[cut: only the first 33554432 bytes of this file were read]
<?xml version="1.0" encoding="utf-8"?>
<posts>
  <row Id="1" PostTypeId="1" CreationDate="2011-01-31T21:02:03.567" Score="24" ViewCount="4907" Body="&lt;p&gt;To get the ball rolling... I will answer this question this evening&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For people aware &amp;amp; unaware I think it would be a great way to introduce the group, resources for fundamental knowledge &amp;amp; concepts.&lt;/p&gt;&#xA;" OwnerUserId="6" LastEditorUserId="23" LastEditDate="2011-01-31T21:13:15.943" LastActivityDate="2011-01-31T21:39:02.880" Title="What are some good technical and non-technical books for a math lover to get in to quantitative analysis?" Tags="&lt;learning&gt;&lt;finance&gt;&lt;books&gt;&lt;quantitative&gt;&lt;analysis&gt;" AnswerCount="8" CommentCount="8" FavoriteCount="35" ClosedDate="2011-01-31T21:49:35.340" CommunityOwnedDate="2011-01-31T21:13:15.943" ContentLicense="CC BY-SA 2.5" />
  <row Id="2" PostTypeId="2" ParentId="1" CreationDate="2011-01-31T21:05:44.007" Score="6" Body="&lt;p&gt;I like Statistics and Data Analysis for Financial Engineering by David Ruppert&#xA;(http://www.amazon.com/gp/product/1441977864/ref=oss_product)&lt;/p&gt;&#xA;" OwnerUserId="33" LastActivityDate="2011-01-31T21:05:44.007" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="3" PostTypeId="1" CreationDate="2011-01-31T21:07:18.193" Score="12" ViewCount="1737" Body="&lt;p&gt;I want to start learning quantitative finance, what articles or blogs should I look at to start? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also see the Related Question on &lt;a href=&quot;https://quant.stackexchange.com/questions/1/what-are-some-good-technical-and-non-technical-books-for-a-math-lover-to-get-in-t&quot;&gt;Quantitative Finance Books&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="27" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2011-01-31T21:53:08.947" Title="What blogs or articles online should I read to get started with quantitative finance?" Tags="&lt;learning&gt;&lt;finance&gt;" AnswerCount="5" CommentCount="6" FavoriteCount="11" ClosedDate="2011-01-31T21:52:28.923" ContentLicense="CC BY-SA 2.5" />
  <row Id="4" PostTypeId="2" ParentId="1" CreationDate="2011-01-31T21:08:35.820" Score="5" Body="&lt;p&gt;John C. Hull's &lt;a href=&quot;http://www.rotman.utoronto.ca/~hull/ofod/&quot; rel=&quot;noreferrer&quot;&gt;&quot;Options, Futures, and &#xA;Other Derivatives&quot;&lt;/a&gt; is the mostly widely recognized introductory book for derivatives valuation.&lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2011-01-31T21:08:35.820" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="5" PostTypeId="1" AcceptedAnswerId="120" CreationDate="2011-01-31T21:08:50.550" Score="19" ViewCount="871" Body="&lt;p&gt;How do you model concentration risk of credit portfolio in IRB/Basel II framework?&lt;/p&gt;&#xA;" OwnerUserId="40" LastEditorUserId="40" LastEditDate="2011-02-01T16:53:40.297" LastActivityDate="2014-07-16T15:52:43.620" Title="Concentration risk in credit portfolio" Tags="&lt;risk&gt;&lt;credit&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="6" PostTypeId="2" ParentId="1" CreationDate="2011-01-31T21:09:01.193" Score="5" Body="&lt;p&gt;This may be too basic a book for what you're hungering for. In preparation for the Financial Engineering actuarial exam, I'm studying from Derivative Markets by McDonald.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's very technical, but gives a great introduction to the mathematics behind pricing options and even goes into depth on Brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Check it out here: &lt;a href=&quot;http://amzn.to/g3QOES&quot; rel=&quot;noreferrer&quot;&gt;http://amzn.to/g3QOES&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="30" LastActivityDate="2011-01-31T21:09:01.193" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="8" PostTypeId="2" ParentId="1" CreationDate="2011-01-31T21:09:30.940" Score="5" Body="&lt;p&gt;I like the following book (though have only very briefly skimmed it):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://books.google.com/books?id=Z7MQvs9CsoYC&amp;amp;lpg=PP1&amp;amp;ots=gcdk6AVkvT&amp;amp;dq=optimization%20finance%20t%C3%BCt%C3%BCnc%C3%BC&amp;amp;pg=PP1#v=onepage&amp;amp;q&amp;amp;f=false&quot; rel=&quot;noreferrer&quot;&gt;Optimization methods in finance&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="29" LastActivityDate="2011-01-31T21:09:30.940" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="9" PostTypeId="1" AcceptedAnswerId="16" CreationDate="2011-01-31T21:09:36.020" Score="17" ViewCount="2137" Body="&lt;p&gt;It seems that VIX futures could be a great hedge for a long-only stock portfolio since they rise when stocks fall. But how many VIX futures should I buy to hedge my portfolio, and which futures expiration should I use?&lt;/p&gt;&#xA;" OwnerUserId="37" LastActivityDate="2019-11-23T17:55:18.170" Title="Hedging stocks with VIX futures" Tags="&lt;equities&gt;&lt;vix&gt;&lt;hedging&gt;" AnswerCount="4" CommentCount="4" FavoriteCount="8" ContentLicense="CC BY-SA 2.5" />
  <row Id="10" PostTypeId="2" ParentId="1" CreationDate="2011-01-31T21:10:16.820" Score="19" Body="&lt;p&gt;Clark,&#xA;This is one of the popular questions we have on our community when someone new to the field come in and ask where they should start.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We point them all to the list we have gathered which is now one of the most comprehensive list for quant finance&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.quantnet.com/master-reading-list-for-quants/&quot;&gt;http://www.quantnet.com/master-reading-list-for-quants/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="43" LastActivityDate="2011-01-31T21:10:16.820" CommentCount="2" CommunityOwnedDate="2011-01-31T21:10:16.820" ContentLicense="CC BY-SA 2.5" />
  <row Id="11" PostTypeId="2" ParentId="1" CreationDate="2011-01-31T21:10:50.130" Score="6" Body="&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0132164949&quot; rel=&quot;noreferrer&quot;&gt;Options, Futures, and Other Derivatives&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470414359&quot; rel=&quot;noreferrer&quot;&gt;Analysis of Financial Time Series&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470432063&quot; rel=&quot;noreferrer&quot;&gt;Inside the Black Box: The Simple Truth About Quantitative Trading&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0195144708&quot; rel=&quot;noreferrer&quot;&gt;Trading and Exchanges: Market Microstructure for Practitioners&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-01-31T21:10:50.130" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="12" PostTypeId="2" ParentId="1" CreationDate="2011-01-31T21:10:54.370" Score="6" Body="&lt;p&gt;One that I found via google that seems promising (for beginners though) is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://books.google.com/books?id=litw2D3bLwMC&amp;amp;lpg=PP1&amp;amp;dq=optimization%20methods%20finance&amp;amp;pg=PP1#v=onepage&amp;amp;q=optimization%20methods%20finance&amp;amp;f=false&quot; rel=&quot;noreferrer&quot;&gt;Numerical methods in finance and Economics&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="29" LastActivityDate="2011-01-31T21:10:54.370" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="13" PostTypeId="2" ParentId="3" CreationDate="2011-01-31T21:11:11.057" Score="3" Body="&lt;p&gt;Mark Joshi's advice - &lt;a href=&quot;http://www.markjoshi.com/downloads/advice.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.markjoshi.com/downloads/advice.pdf&lt;/a&gt; (On becoming a quant)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's quite useful to get some insight into sorts of quantitative analysts, their repsonsibilites, type of companies, requirements for interviews etc ... just a great article to begin with.&lt;/p&gt;&#xA;" OwnerUserId="15" LastActivityDate="2011-01-31T21:11:11.057" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="14" PostTypeId="1" AcceptedAnswerId="34" CreationDate="2011-01-31T21:13:06.893" Score="21" ViewCount="18049" Body="&lt;p&gt;At my work I often see option prices or vols quoted against deltas rather than against strikes.  For example for March 2013 Zinc options I might see 5 quotes available for deltas as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ZINC MARCH 2013 OPTION DELTA -10 POINTS&#xA;ZINC MARCH 2013 OPTION DELTA -25 POINTS&#xA;ZINC MARCH 2013 OPTION DELTA +10 POINTS&#xA;ZINC MARCH 2013 OPTION DELTA +25 POINTS&#xA;ZINC MARCH 2013 OPTION DELTA +50 POINTS&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The same 5 values -10, -25, +10, +25, + 50 are always used.  What are these deltas?  What are the units?  Why are those 5 values chosen?&lt;/p&gt;&#xA;" OwnerUserId="39" LastEditorUserId="70" LastEditDate="2011-01-31T21:32:40.543" LastActivityDate="2016-08-10T07:54:14.220" Title="What is the &quot;delta&quot; option quoting convention about?" Tags="&lt;options&gt;&lt;greeks&gt;" AnswerCount="7" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="15" PostTypeId="2" ParentId="3" CreationDate="2011-01-31T21:13:09.483" Score="9" Body="&lt;p&gt;Second Joshi guide but yout you can do better than that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have a list for all level, some of them are free to download (just like Joshi), others are books and websites that for beginner level&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.quantnet.com/master-reading-list-for-quants/&quot;&gt;http://www.quantnet.com/master-reading-list-for-quants/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for websites and blogs, there are only a handful of them out there (this is a niche field after all).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I run &lt;a href=&quot;http://www.quantnet.com&quot;&gt;http://www.quantnet.com&lt;/a&gt; and I'm a member on &lt;a href=&quot;http://wilmott.com&quot;&gt;http://wilmott.com&lt;/a&gt; as well as &lt;a href=&quot;http://nuclearphynance.com&quot;&gt;http://nuclearphynance.com&lt;/a&gt;. The Quant Finance group on LinkedIn is another popular destination.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Every site has a different flavor and attracts a fairly different audience. You have to sample them all, see the kind of questions asked there, the kind of members and how they answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;WARNING&lt;/strong&gt;: some sites are not very newbies friendly as they carter to the working professionals. As I said, it will take time to learn the in and out of each site. &lt;/p&gt;&#xA;" OwnerUserId="43" LastEditorUserId="43" LastEditDate="2011-01-31T21:33:51.200" LastActivityDate="2011-01-31T21:33:51.200" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="16" PostTypeId="2" ParentId="9" CreationDate="2011-01-31T21:16:23.517" Score="19" Body="&lt;p&gt;VIX measures volatility. It doesn't always go up if stocks go down.&lt;/p&gt;&#xA;" OwnerDisplayName="user59" LastActivityDate="2011-01-31T21:16:23.517" CommentCount="6" ContentLicense="CC BY-SA 2.5" />
  <row Id="17" PostTypeId="2" ParentId="1" CreationDate="2011-01-31T21:17:03.017" Score="6" Body="&lt;p&gt;My type is &quot;&lt;a href=&quot;http://books.google.com/books?id=mWzMpAex1_kC&quot; rel=&quot;noreferrer&quot;&gt;An introduction to the mathematics of financial derivatives&lt;/a&gt;&quot; by &lt;em&gt;Salih N. Neftci&lt;/em&gt;. Though it's definitely harder to digest than &lt;em&gt;Hull&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="38" LastActivityDate="2011-01-31T21:17:03.017" CommentCount="3" CommunityOwnedDate="2011-01-31T21:17:03.017" ContentLicense="CC BY-SA 2.5" />
  <row Id="18" PostTypeId="1" CreationDate="2011-01-31T21:17:48.897" Score="29" ViewCount="16375" Body="&lt;p&gt;There are &lt;a href=&quot;http://www.investopedia.com/articles/04/092904.asp&quot;&gt;three different commonly used Value at Risk (VaR) methods&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Historical method&lt;/li&gt;&#xA;&lt;li&gt;Variance-Covariance Method &lt;/li&gt;&#xA;&lt;li&gt;Monte Carlo&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What is the difference between these approaches, and under what circumstances should each be used?&lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2017-10-05T00:02:50.300" Title="What is the difference between the methods for calculating VaR?" Tags="&lt;risk&gt;&lt;var&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="28" ContentLicense="CC BY-SA 2.5" />
  <row Id="19" PostTypeId="2" ParentId="3" CreationDate="2011-01-31T21:20:04.807" Score="5" Body="&lt;p&gt;&lt;a href=&quot;http://www.wilmott.com/&quot; rel=&quot;noreferrer&quot;&gt;Wilmott&lt;/a&gt; and &lt;a href=&quot;http://www.nuclearphynance.com/&quot; rel=&quot;noreferrer&quot;&gt;NuclearPhynance&lt;/a&gt; are two fairly popular forums, although &lt;a href=&quot;http://quant.stackexchange.com&quot;&gt;quant.stackexchange.com&lt;/a&gt; will hopefully serve as a better resource in the future.&lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2011-01-31T21:20:04.807" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="20" PostTypeId="1" AcceptedAnswerId="62" CreationDate="2011-01-31T21:25:28.170" Score="20" ViewCount="3102" Body="&lt;p&gt;When using time-series analysis to forecast some type of value, what types of error analysis are worth considering when trying to determine which models are appropriate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the big issues that may arise is that successive residuals between the 'forecast' and the 'realized' value of the variable may not be properly independent of one another as large amounts of data will be reused from one data point to its successive one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To give an example, if you fit a GARCH model to forecast volatility for a given time horizon, the fit will use a certain amount of data, and the forecast is produced and then compared to whatever the realized volatility was observed for the given period of time, and it is then possible to find some kind of 'loss' value for that forecast.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once everything moves forward a time period, assuming we refit (but even if we reuse the data parameters), there will be a very large overlap in all the data for this second forecast and realized volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since it is common to desire a model that minimises these 'losses' in some sense, how do you deal with the residuals produced in this way? Is there a way to remove the dependency? Are successive residuals dependent, and how could this dependency be measured? What tools exist to analyse these residuals?&lt;/p&gt;&#xA;" OwnerUserId="61" LastActivityDate="2016-10-26T07:39:48.443" Title="What type of analysis is appropriate for assessing the performance time-series forecasts?" Tags="&lt;forecasting&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 2.5" />
  <row Id="23" PostTypeId="2" ParentId="3" CreationDate="2011-01-31T21:51:01.163" Score="2" Body="&lt;p&gt;&lt;a href=&quot;http://www.bionicturtle.com/forum/&quot; rel=&quot;nofollow&quot; title=&quot;Bionic Turtle&quot;&gt;Bionic Turtle's&lt;/a&gt; forums aren't bad. Some of it is aimed at the FRM (Financial Risk Manager) exam, but there's also a &lt;a href=&quot;http://www.bionicturtle.com/forum/viewforum/5/&quot; rel=&quot;nofollow&quot; title=&quot;Bionic Turtle Quant Finance Forum&quot;&gt;section dedicated to Quant Finance&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="79" LastActivityDate="2011-01-31T21:51:01.163" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="24" PostTypeId="2" ParentId="3" CreationDate="2011-01-31T21:53:08.947" Score="4" Body="&lt;p&gt;I like this site &lt;a href=&quot;http://quant.ly/&quot; rel=&quot;nofollow&quot;&gt;http://quant.ly/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="82" LastActivityDate="2011-01-31T21:53:08.947" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="25" PostTypeId="1" AcceptedAnswerId="28" CreationDate="2011-01-31T21:56:54.423" Score="48" ViewCount="7714" Body="&lt;p&gt;According to the &lt;a href=&quot;http://en.wikipedia.org/wiki/Option_(finance)#Historical_uses_of_options&quot; rel=&quot;noreferrer&quot;&gt;Wikipedia article&lt;/a&gt;,&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Contracts similar to options are believed to have been used since ancient times.&lt;/p&gt;&#xA;&lt;p&gt;In London, puts and &amp;quot;refusals&amp;quot; (calls) first became well-known trading instruments in the 1690s during the reign of William and Mary.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Privileges&lt;/em&gt; were options sold over the counter in nineteenth century America, with both puts and calls on shares offered by specialized dealers.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;But how had traders actually priced the simplest options before the Black–Merton-Scholes model became common knowledge? What were the most popular methods to determine arbitrage-free prices before 1973?&lt;/p&gt;&#xA;" OwnerUserId="70" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2020-04-02T11:54:56.323" Title="Option pricing before Black-Scholes" Tags="&lt;options&gt;&lt;history&gt;&lt;black-scholes&gt;" AnswerCount="9" CommentCount="2" FavoriteCount="23" ContentLicense="CC BY-SA 2.5" />
  <row Id="26" PostTypeId="1" AcceptedAnswerId="77" CreationDate="2011-01-31T21:56:55.617" Score="27" ViewCount="10242" Body="&lt;p&gt;Are there any empirical observations or practices when to prefer Local Volatility Model for pricing over Stochastic Model or vice versa? &lt;/p&gt;&#xA;" OwnerUserId="15" LastActivityDate="2021-04-25T01:34:28.240" Title="Local Volatility vs. Stochastic Volatility" Tags="&lt;local-volatility&gt;&lt;stochastic-volatility&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="15" ContentLicense="CC BY-SA 2.5" />
  <row Id="27" PostTypeId="1" AcceptedAnswerId="58" CreationDate="2011-01-31T21:57:05.983" Score="20" ViewCount="13909" Body="&lt;p&gt;When looking at option chains, I often notice that the (&lt;strong&gt;broker calculated) implied volatility has an inverse relation to the strike price&lt;/strong&gt;. This seems true both for calls and puts. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a current example, I could point at the SPY calls for MAR31'11 : the 117 strike has 19.62% implied volatility, which decreaseses quite steadily until the 139 strike that has just 11.96%. (SPY is now at 128.65)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My intuition would be that volatility is a property of the underlying, and should therefore be roughly the same regardless of strike price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this inverse relation expected behaviour? What forces would cause it, and what does it mean? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having no idea how my broker calculates implied volatility, could it be the result of them using alternative (wrong?) inputs for calculation parameters like interest rate or dividends?&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2019-08-27T13:22:09.873" Title="Why does implied volatility show an inverse relation with strike price when examining option chains?" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;option-pricing&gt;" AnswerCount="8" CommentCount="1" FavoriteCount="5" ContentLicense="CC BY-SA 2.5" />
  <row Id="28" PostTypeId="2" ParentId="25" CreationDate="2011-01-31T22:02:11.603" Score="22" Body="&lt;p&gt;You may want to look at Chapter 5 - &quot;The Quest for the Option Formula&quot; from the &lt;a href=&quot;http://web.archive.org/web/20101026225940/http://www.thederivativesbook.com/contents.html&quot;&gt;Derivatives&lt;/a&gt; book. The book is available online for free and it has a very decent review of approaches that were used 20-30 years before the Black-Scholes-Merton equation.&lt;/p&gt;&#xA;" OwnerUserId="15" LastEditorUserId="15485" LastEditDate="2015-05-18T08:59:43.173" LastActivityDate="2015-05-18T08:59:43.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29" PostTypeId="2" ParentId="25" CreationDate="2011-01-31T22:06:18.477" Score="12" Body="&lt;p&gt;I think this slightly misses the point.  Before Black-Scholes options prices were set entirely &lt;em&gt;by human judgement&lt;/em&gt;, just like prices in many other markets are set, which is why this model was so important.  Peter Bernstein has a good recollection of this kind of behavior in &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0029030129&quot;&gt;&quot;Capital Ideas&quot;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2011-01-31T22:06:18.477" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="30" PostTypeId="1" AcceptedAnswerId="1131" CreationDate="2011-01-31T22:18:28.133" Score="8" ViewCount="1125" Body="&lt;p&gt;There are few methods like Copeland-Antikarov, Herath-Park, Cobb-Charnes etc. to compute project volatility, however these methods compute upward biased volatility. &#xA;What is the best method I could use to compute project volatility for real option valuation?&lt;/p&gt;&#xA;" OwnerDisplayName="user98" LastEditorDisplayName="user1157" LastEditDate="2014-02-13T18:59:46.427" LastActivityDate="2014-02-13T18:59:46.427" Title="What is the best method to compute project volatility in Real Option Valuation?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;real-options&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="31" PostTypeId="2" ParentId="25" CreationDate="2011-01-31T22:31:35.177" Score="8" Body="&lt;p&gt;To add on to what others have said: the formula still does not provide a price -- just a way to calculate &quot;implied&quot; volatility. The BSM calculates a hypothetical value (using binary branchings as the storytelling tool) and this hypothetical merely provides a reference for this common &quot;what-if&quot; question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only sense in which &quot;arbitrage free&quot; entered the minds of traders before BSM was &quot;Am I being cheated?&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One more thing to add: the volume of derivatives trading exploded after the BSM formula, so there wasn't &lt;em&gt;that&lt;/em&gt; much derivatives trading going on beforehand.&lt;/p&gt;&#xA;" OwnerUserId="104" LastActivityDate="2011-01-31T22:31:35.177" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="32" PostTypeId="2" ParentId="9" CreationDate="2011-01-31T22:35:53.580" Score="12" Body="&lt;p&gt;VIX also has a lot of complexities that make it a less-than-ideal hedging tool if you're buying a VIX ETF.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://vixandmore.blogspot.com/&quot; rel=&quot;noreferrer&quot;&gt;http://vixandmore.blogspot.com/&lt;/a&gt; goes into it at length and can probably also answer any questions you have about the VIX as a hedge.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To expand on what @barrycarter said, the VIX is better as a hedge against &lt;strong&gt;kurtosis&lt;/strong&gt;, not against downward movements.&lt;/p&gt;&#xA;" OwnerUserId="104" LastActivityDate="2011-01-31T22:35:53.580" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="33" PostTypeId="2" ParentId="18" CreationDate="2011-01-31T22:38:14.193" Score="14" Body="&lt;p&gt;There are many advantages and flaws to each quoted method by Shane(presuming that I understand them properly), the first one has the big main advantage that it doesn't need any evaluation of probability law, it is just some kind of evolved scenario re-playing &quot;as of&quot; today using the history of (usually) one day market evolutions over one or two year. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So once you know how to evaluate your protfolio (no matter how complex it is) you have something that allows you to mechanically know your quantile and so your VaR. The problem with the method is that there are manny econometrics hypothesis that are actually hard to test for this kind of method to be trustworthy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second &quot;Variance-Covariance&quot; I think that Shane means by this that risk factors returns obey multinomial normally distributed laws (or log-normally), once again the upside of method is its simlpicity once you econometrically estimate your VarCovar matrix. The truth is that unfortunately one day returns exhibit fat tails and asymmetry so those kind of laws aren't the best, this can though be partially overcome by using some other multinomial laws that are elliptic. Another thing you should keep in mind is that when you have a VaR indicator and a profolio that isn't rebalanced over a day, and when market becomes excited, then you expect (and your management) your VaR to go up even though nothing much has happened in your econometric estimation, so what you really want is then not a VaR which is unconditionnal but some conditionnal VaR and then you resort to some kind of overweighing the recent observations versus the old one (like EWMA methods). Then you get some indicator that is really &quot;alive&quot; instead of some indicator that takes a long time to adjust to market conditions. Let me now explain why I used the elliptic laws (multinomial Gaussain are part of this class), this is because with this assumption (If I remember well) then VaR requalifies as a true Risk Measure as defined by Artzner et al. (which is not true for genral probability laws has it lacks the subadditivity axiom). &#xA;Another point, is when you have nonlinear positions in your protfolio such as options then what is usually done (and can be really wrong if not given sufficient attention) is that those position are Taylor derived at order one with respect to risk factors and then Linear VaR is calculated. You can extended your approximation to superior orders but if you have a lot of risk factors then the second derivative estimations are already an achievement, so what you do is that you stay linear and estimate periodically what is the error when quadratic terms are taken into account (or resort to MC methods). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, MC methods then they are efficient methods but very time consumming as you are trying to evaluate a Quantile id est a rare event and you then need to get a very large number of simulation to get something good, moreover it is not always clear which law is to be simulated. In particular in portfolios with derivatives, because it is quite tempting tu use Risk Neutral measure in your simulations but they have two differences over historical estimates, first the underlying model is usually calibrated to model risk factors over large period of times when you are only trying to get estimates over the next day so the underlying measures have different purposes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And second as you may know in theory the difference between Historical and Risk Neutral measures are hidden &quot;in the drift&quot; of the risk factor dynamics (well this is not true unless complete market is assumed but let's go with it) and over a day you can discard this difference with respect to the diffusion term which should be the same for both measures, it happens that almost always Risk Neutral Volatility (i.e. marekt calibrated volatilities) are higher than historical one (or realized ones).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well here are my two cents &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best Regards&lt;/p&gt;&#xA;" OwnerUserId="92" LastActivityDate="2011-01-31T22:38:14.193" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="34" PostTypeId="2" ParentId="14" CreationDate="2011-01-31T22:41:05.343" Score="14" Body="&lt;p&gt;Delta is the partial derivative of the value of the option with respect to the value of the underlying asset. An option with a delta of 0.5 (here listed as +50 points) goes up \$0.50 if the underlying asset goes up \$1.00. Or goes down \$0.50 if the underlying asset goes down \$1.00. Keep in mind that delta is an instantaneous derivative, so the value will change both in time (charm is the change in delta with time) and with changes in value of the underlying asset (gamma is the change in delta with the underlying asset, which is also the second partial derivative of the option value with respect to the underlying asset value).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The actual delta is a little different from +50, +25, and so on, but they're close enough. I am sure that you can find the real delta values. I guess they're listed like this because if you're hedging a portfolio you really care about the delta, not the strike. E.G., if I only wanted to delta hedge, and owned one share, I could buy two -50 delta puts, which sum to a delta of zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The wikipedia page on &lt;a href=&quot;http://en.wikipedia.org/wiki/Greeks_%28finance%29&quot;&gt;Greeks&lt;/a&gt; is a pretty good starting point.&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-01-31T22:41:05.343" CommentCount="8" ContentLicense="CC BY-SA 2.5" />
  <row Id="35" PostTypeId="1" AcceptedAnswerId="193" CreationDate="2011-01-31T23:07:33.457" Score="17" ViewCount="2514" Body="&lt;p&gt;Consider the following strategies:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a stat arb strategy with no overnight exposure, but significant market exposure intraday.&lt;/li&gt;&#xA;&lt;li&gt;a market timing model which is always long or short the market.&lt;/li&gt;&#xA;&lt;li&gt;etc&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;is it meaningful to consider the betas of strategies like these? Or should we ignore beta when the portfolio returns have low (near zero) correlation to market returns? how do you use beta?&lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2011-02-09T17:29:51.550" Title="is beta of a portfolio always meaningful?" Tags="&lt;hedging&gt;&lt;beta&gt;&lt;portfolio&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="36" PostTypeId="1" AcceptedAnswerId="1835" CreationDate="2011-01-31T23:09:04.517" Score="17" ViewCount="987" Body="&lt;p&gt;Assume we decompose the daily (log) returns of a stock as beta times market movement plus an idiosyncratic part. If this is done ex-ante, what proportion of the variance is explained by the market component vs. the idiosyncratic part? I am looking more for rule of thumb/experience of others, based on, say, U.S. equities in the S&amp;amp;P 1500. Another way of putting this is &quot;what is the (average/rule of thumb/expected/garden-variety) Pearson correlation coefficient between the return of a stock and the return of the market?&quot;&lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2011-09-15T17:39:25.157" Title="Approximately what proportion of a stock’s volatility is explained by market movement?" Tags="&lt;beta&gt;&lt;variance&gt;&lt;correlation&gt;&lt;market&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="37" PostTypeId="1" CreationDate="2011-01-31T23:13:33.573" Score="42" ViewCount="10883" Body="&lt;p&gt;I'm currently using IB's Java API and getting feeds through them. However the real-time feed is updated only every 250ms and the historical feed only every second.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm primarily looking for ES data and other index futures and ETFs. I'm not looking at FX since that data is the most subjective since there is no exchange.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want a setup that allows me to get the most accurate real-time tick data and market depth. Tick by tick would be ideal, but probably prohibitively expensive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What setup gives the most accurate data and depth?&lt;/p&gt;&#xA;" OwnerUserId="8" LastEditorUserId="1652" LastEditDate="2013-04-04T14:16:46.253" LastActivityDate="2014-11-04T12:48:39.167" Title="What broker/feed/APIsetup allows for recording the most accurate data (cheaply)?" Tags="&lt;backtesting&gt;&lt;data&gt;&lt;high-frequency&gt;" AnswerCount="8" CommentCount="1" FavoriteCount="41" CommunityOwnedDate="2011-02-01T03:57:45.890" ContentLicense="CC BY-SA 3.0" />
  <row Id="38" PostTypeId="1" AcceptedAnswerId="444" CreationDate="2011-01-31T23:45:21.927" Score="15" ViewCount="986" Body="&lt;p&gt;What is the theoretical/mathematical basis for the valuation of [C]MBS and other structured finance products? Is the methodology mostly consistent across different products?&lt;/p&gt;&#xA;" OwnerUserId="117" LastEditorUserId="117" LastEditDate="2011-01-31T23:57:54.333" LastActivityDate="2015-10-20T20:21:35.473" Title="How are prices calculated for commercial/residential mortgage-backed securities?" Tags="&lt;mbs&gt;&lt;valuation&gt;&lt;structured-finance&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="39" PostTypeId="2" ParentId="35" CreationDate="2011-01-31T23:49:03.780" Score="10" Body="&lt;p&gt;It partly depends on the use case.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If one is taking multiple strategies and assembling a portfolio that includes multiple different strategies and is mixing this with a heavy weighting to an equity index, then this might be a useful measure. &lt;a href=&quot;http://en.wikipedia.org/wiki/Beta_%28finance%29&quot;&gt;Zero or negative beta&lt;/a&gt; does have meaning, in the same way that correlation has meaning.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the more traditional usage of CAPM, a better question might be &quot;which beta to use&quot; in this context.  It's still meaningful (in so far as any measure of beta is meaningful) but an active strategy or one which trades different assets should may not be  compared to a beta of a long-only stock portfolio.  Regarding the specific examples that you give: there are various hedge fund indices which cover statistical arbitrage and long/short equities.  These may or may not be good benchmarks, but they are more likely to be useful than a standard equity market index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Aswath Damodaran has &lt;a href=&quot;http://aswathdamodaran.blogspot.com/2009/02/can-betas-be-negative-and-other-well.html&quot;&gt;a blog post on this&lt;/a&gt; that summarizes some of the issues.  Although I really think that it's important to reflect on what $\beta$ is supposed to measure -- market risk -- and ask yourself whether you're definition of &quot;market&quot; is appropriate for the context.&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="17" LastEditDate="2011-02-01T00:15:29.577" LastActivityDate="2011-02-01T00:15:29.577" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="40" PostTypeId="2" ParentId="25" CreationDate="2011-01-31T23:57:46.457" Score="15" Body="&lt;p&gt;Options and futures were common instruments in France at the end of the 19th century. Louis Bachelier, &lt;a href=&quot;http://archive.numdam.org/article/ASENS_1900_3_17__21_0.pdf&quot;&gt;in his 1900 thesis&lt;/a&gt;, derives the price of a European option when the underlying asset is normally distributed. Interestingly, he seems to have some strong opinions about mathematical finance in his introduction to his thesis:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The calculus of probabilities will undoubtedly never be applied to the movement of stock prices, and the dynamics of the stockmarket will never be an exact science.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="114" LastActivityDate="2011-01-31T23:57:46.457" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="41" PostTypeId="1" AcceptedAnswerId="54" CreationDate="2011-01-31T23:59:50.293" Score="22" ViewCount="4776" Body="&lt;p&gt;It appears that the log 'returns' of the VIX index have a (negative) correlation to the log 'returns' of &lt;em&gt;e.g.&lt;/em&gt; the S&amp;amp;P 500 index. The r-squared is on the order of 0.7. I thought VIX was supposed to be a measure of volatility, both up &lt;em&gt;and&lt;/em&gt; down. However, it appears to spike up when the market spikes down, and has a fairly strong negative correlation to the market (in fact, the correlation is much stronger than &lt;em&gt;e.g.&lt;/em&gt; for your garden variety tech stock).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone explain why? The mean 'returns' of both indices are accounted for in this correlation, so this is not a result of the expectation of the market to increase at ~7% p.a.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a more pure volatility index or instrument?&lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2019-08-14T22:11:46.297" Title="Why does the VIX index have *any* correlation to the market?" Tags="&lt;vix&gt;&lt;volatility&gt;&lt;correlation&gt;&lt;market&gt;" AnswerCount="7" CommentCount="4" FavoriteCount="5" ContentLicense="CC BY-SA 2.5" />
  <row Id="42" PostTypeId="2" ParentId="37" CreationDate="2011-02-01T00:02:55.453" Score="7" Body="&lt;p&gt;The &lt;a href=&quot;http://www.ctsfutures.com/t4_api.aspx&quot;&gt;T4 API &lt;/a&gt; is free to try for two weeks and it has really good &lt;a href=&quot;http://sim.t4login.com/help/api/&quot;&gt;documentation&lt;/a&gt;... if you contact their support they will usually extend your trial period as long as you want. Here are some of the features it has:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Real-time market feed (ticks).&lt;/li&gt;&#xA;&lt;li&gt;Historical tick data (as well as second, minute, hour and day charts).&lt;/li&gt;&#xA;&lt;li&gt;VB/C#/C++ interface.&lt;/li&gt;&#xA;&lt;li&gt;Programming examples that demonstrate the full functionality of the API.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Unfortunately T4 doesn't have any equities, only futures and currencies.&lt;/p&gt;&#xA;" OwnerUserId="78" LastEditorUserId="78" LastEditDate="2011-02-01T06:20:36.470" LastActivityDate="2011-02-01T06:20:36.470" CommentCount="4" CommunityOwnedDate="2011-02-01T03:57:45.890" ContentLicense="CC BY-SA 2.5" />
  <row Id="43" PostTypeId="1" AcceptedAnswerId="277" CreationDate="2011-02-01T00:03:23.143" Score="25" ViewCount="12552" Body="&lt;p&gt;Is there a standard model for market impact? I am interested in the case of high-volume equities sold in the US, during market hours, but would be interested in any pointers.&lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2018-07-26T15:28:21.780" Title="Is there a standard model for market impact?" Tags="&lt;market-impact&gt;&lt;models&gt;" AnswerCount="5" CommentCount="1" FavoriteCount="17" ContentLicense="CC BY-SA 2.5" />
  <row Id="44" PostTypeId="1" AcceptedAnswerId="73" CreationDate="2011-02-01T00:08:54.067" Score="29" ViewCount="6110" Body="&lt;p&gt;One of the main problems when trying to apply &lt;strong&gt;mean-variance portfolio optimization&lt;/strong&gt; in practice is its high input sensitivity. As can be seen in (&lt;em&gt;Chopra&lt;/em&gt;, 1993) using historical values to &lt;strong&gt;estimate returns expected in the future&lt;/strong&gt; is a no-go, as the whole process tends to become &lt;strong&gt;error maximization&lt;/strong&gt; rather than &lt;strong&gt;portfolio optimization&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The primary emphasis should be on obtaining &lt;strong&gt;superior estimates of means&lt;/strong&gt;, followed by good estimates of variances.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In that case, what techniques do you use to &lt;strong&gt;improve those estimates&lt;/strong&gt;? Numerous methods can be found in the literature, but I'm interested in what's more widely adopted from a &lt;strong&gt;practical standpoint&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there some &lt;strong&gt;popular approaches&lt;/strong&gt; being used in the industry other than &lt;a href=&quot;http://www.blacklitterman.org/&quot;&gt;Black-Litterman&lt;/a&gt; model?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Reference:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Chopra, V. K. &amp;amp; Ziemba, W. T. &lt;strong&gt;&lt;a href=&quot;http://faculty.fuqua.duke.edu/~charvey/Teaching/BA453_2006/Chopra_The_effect_of_1993.pdf&quot;&gt;The Effect of Errors in Means, Variances, and Covariances on Optimal Portfolio Choice&lt;/a&gt;&lt;/strong&gt;. &lt;em&gt;Journal of Portfolio Management&lt;/em&gt;, 19: 6-11, 1993.&lt;/p&gt;&#xA;" OwnerUserId="38" LastActivityDate="2013-12-13T09:51:59.337" Title="What methods do you use to improve expected return estimates when constructing a portfolio in a mean-variance framework?" Tags="&lt;modern-portfolio-theory&gt;&lt;mean-variance&gt;&lt;expected-return&gt;&lt;estimation&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="26" ContentLicense="CC BY-SA 2.5" />
  <row Id="45" PostTypeId="1" AcceptedAnswerId="53" CreationDate="2011-02-01T00:16:50.123" Score="26" ViewCount="3106" Body="&lt;p&gt;A potential issue with automated trading systems, that are based on Machine Learning (&lt;strong&gt;ML&lt;/strong&gt;) and/or Artificial Intelligence (&lt;strong&gt;AI&lt;/strong&gt;), is the difficulty of assessing the risk of a trade. An ML/AI algorithm may analyze thousands of parameters in order to come up with a trading decision and applying standard risk management practices might interfere with the algorithms by overriding the algorithm's decision.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are some basic methodologies for applying risk management to ML/AI-based automated trading systems without hampering the decision of the underlying algorithm(s)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;br&gt;&#xA;An example system would be: Genetic Programming algorithm that produces trading agents. The most profitable agent in the population is used to produce a short/long signal (usually without a confidence interval).&lt;/p&gt;&#xA;" OwnerUserId="78" LastEditorUserId="78" LastEditDate="2011-02-01T00:45:46.430" LastActivityDate="2012-04-17T12:02:37.053" Title="How are risk management practices applied to ML/AI-based automated trading systems" Tags="&lt;risk&gt;&lt;automated-trading&gt;&lt;risk-management&gt;&lt;best-practices&gt;&lt;trading&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="12" ContentLicense="CC BY-SA 2.5" />
  <row Id="46" PostTypeId="2" ParentId="43" CreationDate="2011-02-01T00:18:43.927" Score="10" Body="&lt;p&gt;I don't believe that there is a &quot;standard&quot; model (per se); in fact, there are many considerations around market impact models, so you would need to be more specific.  At the most basic level, you might define market as $P_{first fill} - P_{last fill}$ once your order in actually in the order book (e.g. not including other costs like &quot;opportunity cost&quot;).  This doesn't take into account any other trades that may be taking place at the same time or other events that might be impacting the price beyond your order.  It doesn't help you to forecast market impact on an impending order (which would require some knowledge of time of day, volume, volatility, etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That being said, I would certainly recommend reading &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0814407242&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;Optimal Trading Strategies&quot;&lt;/a&gt; (Kissell, Glantz 2003) which gives a good overview (in addition to covering other transaction cost subjects).&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="6283" LastEditDate="2017-08-29T08:25:20.103" LastActivityDate="2017-08-29T08:25:20.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="47" PostTypeId="1" AcceptedAnswerId="49" CreationDate="2011-02-01T00:29:55.100" Score="17" ViewCount="7576" Body="&lt;p&gt;I want to create a lognormal distribution of future stock prices.  Using a monte carlo simulation I came up with the standard deviation as being $\sqrt{(days/252)}$ $*volatility*mean*$ $\log(mean)$.  Is this correct?  &lt;/p&gt;&#xA;" OwnerUserId="123" LastEditorUserId="17" LastEditDate="2011-02-03T16:40:52.230" LastActivityDate="2011-10-02T13:09:50.310" Title="How to calculate future distribution of price using volatility?" Tags="&lt;volatility&gt;&lt;lognormal&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="48" PostTypeId="2" ParentId="41" CreationDate="2011-02-01T00:32:50.263" Score="1" Body="&lt;p&gt;Markets seem to have a bias against being bearish. Lower stock prices are perceived as more risky, and as risk increases so does implied volatility. For example, as the market decreases there will generally be more demand for puts, causing higher prices and higher implied volatility. An up market will imply less volatility for the same reason.&lt;/p&gt;&#xA;" OwnerUserId="117" LastActivityDate="2011-02-01T00:32:50.263" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="49" PostTypeId="2" ParentId="47" CreationDate="2011-02-01T00:37:59.870" Score="6" Body="&lt;p&gt;I'm not sure I understand, but if you want to compute the variance of $exp(X)$, where $X$ is normally distributed with mean $\mu$ and variance $\sigma^2$, that variance is (from &lt;a href=&quot;http://en.wikipedia.org/wiki/Lognormal&quot;&gt;Wikipedia&lt;/a&gt;):&#xA;$$\left(\exp{(\sigma^2)} - 1\right) \exp{(2\mu + \sigma^2)}$$&lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2011-02-01T00:37:59.870" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="50" PostTypeId="2" ParentId="44" CreationDate="2011-02-01T00:40:27.277" Score="8" Body="&lt;p&gt;You raise a very important point, which unfortunately doesn't have a simple answer.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Black-Litterman addresses the allocation problem by allowing you to provide a prior within a bayesian framework.  It doesn't really tell you how to produce the prior itself.  But more importantly, it doesn't address the fundamental problem: &lt;em&gt;it's difficult to accurately predict expected returns&lt;/em&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, you can improve this by having a better model to predict the expect returns besides assuming a static, simple linear model (&quot;this was the mean return over the last $n$ years&quot;).  But improving it is the big challenge in finance in general.  And standard textbook models haven't done too much to improve the situation; the most success in time series modeling has been around volatility prediction (e.g. with some of the GARCH models), which addresses the variance part of the problem.  But ARIMA and other time series models have mixed success success when trying to predict returns for financial assets.&lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2011-02-01T00:40:27.277" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="51" PostTypeId="2" ParentId="36" CreationDate="2011-02-01T00:46:06.640" Score="5" Body="&lt;p&gt;I just want to give a qualitative assessment to your question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Volatility of a market is different than the volatility of a stock. Similarly like Copeland and Antikarov (2001) say that &quot;...the volatility of a gold mine is different than the volatility of a gold...&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to quantitatively compute the percentage of a stock's volatility affected by market's volatility, then I would do back calculation using options formula.   &lt;/p&gt;&#xA;" OwnerDisplayName="user98" LastEditorDisplayName="user98" LastEditDate="2011-02-01T03:31:53.873" LastActivityDate="2011-02-01T03:31:53.873" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="52" PostTypeId="2" ParentId="25" CreationDate="2011-02-01T00:58:55.857" Score="19" Body="&lt;p&gt;The man who grasps principles can successfully select his own methods. The man who tries methods, ignoring principles, is sure to have trouble.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;~ Ralph Waldo Emerson ~&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Black-Scholes made it possible for an idiot with a calculator to imagine that he was smart enough to judge the value of options ... it has always been possible to determine option value -- Black-Scholes is not necessarily the best approach. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In his preface to the sixth edition of &lt;strong&gt;&lt;em&gt;Security Analysis&lt;/em&gt;&lt;/strong&gt;, noted value investor &lt;strong&gt;Seth Klarman&lt;/strong&gt; discusses how Graham and Dodd's methods mentioned in the original edition (copyright 1934) are more relevant than ever.  Specifically, Mr. Klarman suggests how he has successfully applied those methods.  Mr. Klarman is relatively-famous for his use of option in an investment strategy has been been significantly more profitable than average.  Mr. Klarman has taken advantage of less well-informed investors who falsely pride themselves on their mathematical sophistication and familiarity with formulas like Black Scholes.  Those investors &quot;plug and chug&quot; their numbers into their quantitative models &lt;em&gt;[without having a clue about the fundamentals &lt;strong&gt;driving&lt;/strong&gt; the probability distribution upon which the mathematics of the formula are based]&lt;/em&gt;, receive their below average returns and never realize that the problem when almost everyone is using Black-Scholes, the market is ripe for a successful contrarian anti-Black-Scholes strategy.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An option pricing strategy based upon value investing precepts would be driven by a rigorous analysis of downside potential and a similar analysis of upside potential.  The rigor necessary for understanding the sensitivity of the stock to various scenarios would inform the judgement necessary to determine the likelihood of those different scenarios.   Option pricing based upon Graham and Dodd's methods would not be driven by irrationally sanguine market-driven estimates of either implied or historical volatility ... it would reflect actual risks faced by the underlying assets, not the market assessment of those risks ... as you will recall, value investing is based upon the premise that the market-based assessments are frequently very, very wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Anyone seeking additional insights into Seth Klarman's methodoloy, should obtain a copy of &lt;strong&gt;Security Analysis&lt;/strong&gt; and a copy of Mr. Klarman's own text &lt;strong&gt;&lt;a href=&quot;https://rads.stackoverflow.com/amzn/click/com/0887305105&quot; rel=&quot;nofollow noreferrer&quot; rel=&quot;nofollow noreferrer&quot;&gt;Margin of Safety&lt;/a&gt;&lt;/strong&gt;.  Of course, there are plenty of other reasons to read, re-read, re-re-read &lt;strong&gt;Security Analysis&lt;/strong&gt; and &lt;strong&gt;&lt;a href=&quot;https://rads.stackoverflow.com/amzn/click/com/0887305105&quot; rel=&quot;nofollow noreferrer&quot; rel=&quot;nofollow noreferrer&quot;&gt;Margin of Safety&lt;/a&gt;&lt;/strong&gt; beyond just an alternative to Black-Scholes&lt;/em&gt;.  &lt;/p&gt;&#xA;" OwnerUserId="121" LastEditorUserId="38257" LastEditDate="2020-04-02T11:54:30.527" LastActivityDate="2020-04-02T11:54:30.527" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="53" PostTypeId="2" ParentId="45" CreationDate="2011-02-01T01:08:27.770" Score="12" Body="&lt;p&gt;The risks involved in trading is everywhere and always a multifaceted thing: it includes the volatility of the selected asset, the leverage and concentration of the porfolio, whether there is a stop loss, a hedge, etc.  Also, risk management is frequently not tied to the &quot;alpha model&quot; directly (e.g. VaR, shortfall, and scenario testing).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, one well known way of sizing a position is &lt;a href=&quot;http://en.wikipedia.org/wiki/Kelly_criterion&quot;&gt;the Kelly formula&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$f^{*} = \frac{bp - q}{b}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This makes no assumptions about the directional model that is used to enter the position.  You can infer the values (e.g. probability of winning) from a historical simulation, regardless of whether the model is black-box, grey-box, or white-box.  &lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="17" LastEditDate="2011-02-01T01:18:55.873" LastActivityDate="2011-02-01T01:18:55.873" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="54" PostTypeId="2" ParentId="41" CreationDate="2011-02-01T03:04:25.137" Score="15" Body="&lt;p&gt;Increased volatility (high VIX) signifies more risk. To keep their portfolio in line with their risk preferences, market participants deleverage. Since long positions outweigh short positions in the market as a whole, deleveraging entails a lot of selling and less buying.  The relative increase in selling causes downward pressure on stocks.&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2011-02-01T03:04:25.137" CommentCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="55" PostTypeId="2" ParentId="47" CreationDate="2011-02-01T03:12:21.777" Score="3" Body="&lt;p&gt;The distribution of the log of a stock price in n days is a normal &#xA;distribution with mean of $\log(current_price)$ and standard deviation of &#xA;$volatility*\sqrt(n/365.2425)$ if you're using calendar days, and &#xA;assuming no dividends and 0% risk-free interest rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the standard deviation is independent of the current_price: &#xA;if $\log(current_price)$ increases by 0.3 (for example), the stock has &#xA;increased by 35%, regardless of its current_price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To include dividends and the risk-free interest rate, see: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Black-Scholes&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Black-Scholes&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;which models future stock prices w/ an eye towards pricing options. &lt;/p&gt;&#xA;" OwnerDisplayName="user59" LastEditorUserId="117" LastEditDate="2011-02-03T16:39:41.613" LastActivityDate="2011-02-03T16:39:41.613" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="56" PostTypeId="2" ParentId="27" CreationDate="2011-02-01T03:32:58.180" Score="5" Body="&lt;p&gt;&quot;My intuition would be that volatility is a property of the &#xA;underlying, and should therefore be roughly the same regardless of &#xA;strike price&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I agree, but the market doesn't. People who buy out-of-money calls &#xA;tend to be more optimistic than those who buy at-the-money calls, so &#xA;out-of-money calls are &quot;overpriced&quot; and thus have a higher volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Oddly, people who buy deep-in-the-money calls ALSO tend to be more &#xA;optimistic, so these calls ALSO have a higher implied volatility. Why?&lt;br&gt;&#xA;You can buy a deep-in-the-money call for much less than the stock &#xA;price. When the stock goes up 1 point, the deep-in-the-money call goes &#xA;up almost 1 point too, so you get the same gain for less investment &#xA;(ie, leverage). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You probably also noticed implied volatility varies with expiration &#xA;date too. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ultimately, the market determines how much an option is worth, and &#xA;thus the volatility. Black-Scholes' belief that volatility was a &#xA;fundamental characteristic of an instrument isn't really accurate. &lt;/p&gt;&#xA;" OwnerDisplayName="user59" LastActivityDate="2011-02-01T03:32:58.180" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="57" PostTypeId="2" ParentId="37" CreationDate="2011-02-01T03:35:29.347" Score="8" Body="&lt;p&gt;&lt;a href=&quot;http://ratedata.gaincapital.com/&quot;&gt;http://ratedata.gaincapital.com/&lt;/a&gt; has tick by tick historical data for Forex if that helps.&lt;/p&gt;&#xA;" OwnerDisplayName="user59" LastActivityDate="2011-02-01T03:35:29.347" CommentCount="2" CommunityOwnedDate="2011-02-01T03:57:45.890" ContentLicense="CC BY-SA 2.5" />
  <row Id="58" PostTypeId="2" ParentId="27" CreationDate="2011-02-01T03:43:35.793" Score="13" Body="&lt;p&gt;The skew is almost always bid for puts on the stock market. When stocks go down, people tend to panic and volatility goes up as a result. Since the puts get more vega when the market goes down, they trade at higher vols. Read up on stochastic volatility for a more in-depth explanation.&lt;/p&gt;&#xA;" OwnerUserId="83" LastActivityDate="2011-02-01T03:43:35.793" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="59" PostTypeId="2" ParentId="20" CreationDate="2011-02-01T03:44:01.427" Score="5" Body="&lt;p&gt;I am not sure I clearly understand your question. But definitely you can do some analysis on the residuals, especially autocorrelation. If you find any significant autocorrelation, I suggest you add a ARMA process to your model to increase the accuracy of your forecast.&lt;/p&gt;&#xA;" OwnerUserId="134" LastActivityDate="2011-02-01T03:44:01.427" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="60" PostTypeId="1" AcceptedAnswerId="155" CreationDate="2011-02-01T03:49:06.897" Score="9" ViewCount="3163" Body="&lt;p&gt;I would like to take advantage of a volatile market by selling highs and buying lows. As we all know the RSI indicator is very bad and I want to create a superior strategy for this purpose.&lt;br&gt;&#xA;I have tried to model the price using a time varying ARMA process, with no success for now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any other ideas?&lt;/p&gt;&#xA;" OwnerUserId="134" LastActivityDate="2011-02-03T19:47:03.307" Title="Mean reverting strategies" Tags="&lt;arma&gt;&lt;strategy&gt;" AnswerCount="1" CommentCount="10" FavoriteCount="6" ContentLicense="CC BY-SA 2.5" />
  <row Id="61" PostTypeId="2" ParentId="26" CreationDate="2011-02-01T03:54:24.580" Score="9" Body="&lt;p&gt;For pricing and hedging a portfolio of vanilla options, stochastic volatility is almost always preferable to local volatility since empirically it more accurately captures the evolution of the smile. &lt;/p&gt;&#xA;" OwnerUserId="83" LastActivityDate="2011-02-01T03:54:24.580" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="62" PostTypeId="2" ParentId="20" CreationDate="2011-02-01T03:59:30.460" Score="13" Body="&lt;p&gt;I think you're looking for some way to test for autocorrelation in your residuals. If your model is good -- let's say you have an ARMA(1, 1) model for your forecast -- then the residuals from this model will be white noise. Which is to say that the difference between your forecast and the realization can not be predicted any better. The residual is some zero mean normally-distributed error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's pick an extreme example. If your residual (the diff between forecast and realized) were always 1, then the residuals would be autocorrelated. Clearly if your model is always off by 1, then you can do better. So if the residuals in your model are autocorrelated, then you can do better.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The standard test for this these days in Ljung-Box, but in the past Box-Pierce and Durbin-Watson were also used.&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-02-01T03:59:30.460" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="65" PostTypeId="2" ParentId="36" CreationDate="2011-02-01T04:17:33.630" Score="5" Body="&lt;p&gt;So my first answer was off base. For some reason I was thinking first moment (idiosyncratic returns), but he's looking for second moment (idiosyncratic volatility). There is a line of research on the returns to portfolios sorted on idiosyncratic volatility and I was hoping that there were descriptive statistics that said &quot;fraction $\rho$ of stock/portfolio vol is market and $1 - \rho$ of stock/portfolio vol is idiosyncratic&quot;. But I couldn't find any stats. So I guess you have to run your own models and find out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're thinking about implementing this, I would check out the literature. It may save you some time. &lt;a href=&quot;http://www.gsb.columbia.edu/faculty/aang/papers/vol.pdf&quot; rel=&quot;nofollow&quot;&gt;Ang, Hodrick, Xing, and Zhang&lt;/a&gt; (Journal of Finance 2006) say that high ivol has low returns. But &lt;a href=&quot;http://faculty.baruch.cuny.edu/tbali/BaliCakiciJFQA2008.pdf&quot; rel=&quot;nofollow&quot;&gt;Bali and Cakici&lt;/a&gt; (Journal of Finance and Quantitative Analysis 2008) show that their results are do to sorting techniques and that there's really no return (pos or neg) to high ivol.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I may be off base here. But in terms of econometrics, when you calculate beta, you've assumed that the idiosyncratic portion is white noise. So the idiosyncratic portion is mean zero and normally distributed so it accounts for none of the return. So the ratio of market:idiosyncratic is 1:0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By definition the idiosyncratic return should be white noise. Maybe you want to add another risk factor to your model and find the projection of stock returns on that factor to find the split between the market and that other factor?&lt;/p&gt;&#xA;" OwnerUserId="106" LastEditorUserId="106" LastEditDate="2011-02-02T12:55:44.147" LastActivityDate="2011-02-02T12:55:44.147" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="66" PostTypeId="1" AcceptedAnswerId="70" CreationDate="2011-02-01T04:19:13.130" Score="13" ViewCount="3815" Body="&lt;p&gt;Explain pair trading to a layman. What is it, why would you want to do it, and what are the risks? Provide a real life example.&lt;/p&gt;&#xA;" OwnerUserId="74" LastEditorUserId="74" LastEditDate="2012-02-24T07:08:05.813" LastActivityDate="2017-05-30T23:29:16.827" Title="How does pair trading work?" Tags="&lt;pairs-trading&gt;" AnswerCount="4" CommentCount="4" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="67" PostTypeId="2" ParentId="25" CreationDate="2011-02-01T04:54:02.633" Score="7" Body="&lt;p&gt;Ed Thorp is of the opinion that he could price options properly before Fischer and Myron:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.google.ca/url?sa=t&amp;amp;source=web&amp;amp;cd=3&amp;amp;ved=0CCkQFjAC&amp;amp;url=http%3A%2F%2Fwww.edwardothorp.com%2Fsitebuildercontent%2Fsitebuilderfiles%2Foptiontheory.doc&amp;amp;ei=q4hHTbr-CIiqsAOt6rCiAg&amp;amp;usg=AFQjCNHsCRmQcDkfu9F9o5DIFsTxUeK5Xg&amp;amp;sig2=O3SvA_OeVB-1n3Qif4LjgA&quot;&gt;link here (doc)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sounds like he was using a risk-neutral approach&lt;/p&gt;&#xA;" OwnerUserId="74" LastActivityDate="2011-02-01T04:54:02.633" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="68" PostTypeId="2" ParentId="45" CreationDate="2011-02-01T05:22:16.193" Score="19" Body="&lt;p&gt;ML/AI systems are susceptible to a number of risks not traditionally discussed in risk management:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What I call &lt;strong&gt;'backtest arbitrage'&lt;/strong&gt;. In the process of automated model generation and testing, your machine learner may discover, exploit, and concentrate on irregularities in your backtesting system which do not exist in the real world. If, for example, your fill simulation is erroneous, you have not accounted for borrow costs, forgot to deal with dividends properly, &lt;em&gt;etc.&lt;/em&gt;, sufficiently powerful search techniques will find strategies which capture these nonexistent 'arbs'.&lt;/li&gt;&#xA;&lt;li&gt;If you sequentially generate, test, and refine many trading models, you run into the problem of &lt;strong&gt;'datamining bias'&lt;/strong&gt;. Here one has used the same data to simultaneously select the best model and estimate its performance via backtest. The estimate will be positively biased, and the size of the bias can be difficult to estimate if one has not kept careful track of all the strategies tested.&lt;/li&gt;&#xA;&lt;li&gt;Blackbox models are often subject to non-stationarities of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Grue_and_bleen&quot;&gt;&lt;strong&gt;'Grue and Bleen variety'&lt;/strong&gt;&lt;/a&gt;. That is they may behave radically different out of sample due to non-stationarities of their input data and discontinuities in their processing of input data. An example would be an AI strategy which first checks if VIX is above 60, then trades one substrategy, otherwise it trades a different one. Your backtest period may contain little data in the 'over 60' regime, and you may find yourself in such a regime.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Regrettably many of these issues exist at the human level, and there is little one can do statistically to detect them or correct for them. They require great attention to process.&lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2011-02-01T05:22:16.193" CommentCount="16" ContentLicense="CC BY-SA 2.5" />
  <row Id="70" PostTypeId="2" ParentId="66" CreationDate="2011-02-01T06:05:48.380" Score="17" Body="&lt;p&gt;Pair trading is a market neutral bet.  Instead of saying the market in general is going higher, you say one investment under/overvalued relative to another, typically similar, investment.  The bet is that the spread between the two will widen or narrow depending on how you set it up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, say I feel GM is going to outperform Ford over the next year.  I will buy GM's stock and short Ford's stock.  By doing this the market is taken out of the picture, and I make money if the difference between GM's stock and Ford's is greater than it was when I undertook the investment.&lt;/p&gt;&#xA;" OwnerUserId="60" LastEditorUserId="60" LastEditDate="2011-02-01T20:00:56.730" LastActivityDate="2011-02-01T20:00:56.730" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="71" PostTypeId="2" ParentId="35" CreationDate="2011-02-01T06:15:06.667" Score="2" Body="&lt;p&gt;In response to your last question, &quot;how do you use beta?&quot; - I'd say try to as little as possible.  Your use seems to be a bit out of the realm of what I'm used to, but whatever beta you get is so prone to observational error, that it may not be meaningful.&lt;/p&gt;&#xA;" OwnerUserId="60" LastActivityDate="2011-02-01T06:15:06.667" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="73" PostTypeId="2" ParentId="44" CreationDate="2011-02-01T06:50:51.180" Score="17" Body="&lt;p&gt;Short of having a 'reasonable' predictive model for expected returns and the covariance matrix, there are a couple lines of attack.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Shrinkage estimators (via Bayesian inference or Stein-class of estimators)&lt;/li&gt;&#xA;&lt;li&gt;Robust portfolio optimization&lt;/li&gt;&#xA;&lt;li&gt;Michaud's Resampled Efficient Frontier&lt;/li&gt;&#xA;&lt;li&gt;Imposing norm constraints on portfolio weights&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Naively, shrinkage methods 'shrink' (of course,no?) your estimates (arrived at using historical data), toward some global mean or some target. Within the mean-variance framework, you can use the shrinkage estimators, for both, the expected returns vector, as well as the covariance matrix. Jorion introduced application of a 'Bayes-Stein estimator' to portfolio analysis. Bradley &amp;amp; Efron have a paper on the James-Stein estimator. Alternatively, you can stick to the global minimum variance portfolio, which is less susceptible to estimation errors (in expected returns)), and use either the sample covariance matrix or a shrunk estimate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Robust portfolio optimization seems to be another way 'nicer' portfolios can be constructed. I haven't studied this in any detail, but there's a paper by Goldfarb &amp;amp; Iyengar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Michaud's Resampled Efficient Frontier is an application of Monte Carlo and bootstrap to addressing the uncertainty in the estimates. It is a way of 'averaging' out the frontier and it perhaps is best to read up Michaud's book or paper to know what they really have to say.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, there might be a way to directly impose constraints on the norm of the portfolio weight vector which would be equivalent to regularization in the statistical sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having said all that, having a good predictive model for E[r] and Sigma, is perhaps worth the effort.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;References:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Jorion, Philippe, &quot;Bayes-Stein Estimation for Portfolio Analysis&quot;, Journal of Financial and Quantitative Analysis, Vol. 21, No. 3, (September 1986), pp. 279-292.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Philippe Jorion, &quot;Bayesian and CAPM estimators of the means: Implications for portfolio selection&quot;, Journal of Banking &amp;amp; Finance, Volume 15, Issue 3, June 1991&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Robert R. Grauer and Nils H. Hakansson, &quot;Stein and CAPM estimators of the means in asset allocation&quot;, International Review of Financial Analysis, Volume 4, Issue 1, 1995, Pages 35-66&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Donald Goldfarb, Garud Iyengar: &quot;Robust Portfolio Selection Problems&quot;. Math. Oper. Res. 28(1): 1-38 (2003)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Michaud, R. (1998). Efficient Assset Management: A Practial Guide to Stock Portfolio Optimization, Oxford University Press.&lt;/p&gt;&#xA;" OwnerUserId="139" LastActivityDate="2011-02-01T06:50:51.180" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="74" PostTypeId="1" AcceptedAnswerId="94" CreationDate="2011-02-01T07:54:30.207" Score="40" ViewCount="60101" Body="&lt;p&gt;There are all kinds of tools for backtesting linear instruments (like stocks or stock indices). It is a completely different story when it comes to option strategies. Most of the tools used are bespoke software not publicly available. Part of the reason for that seems to be the higher complexity involved, the deluge of data you need (option chains) and the (non-)availability of historical implied vola data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, &lt;strong&gt;my question&lt;/strong&gt;:&lt;br&gt;&#xA;Are there any good, usable tools for backtesting option strategies (or add-ons for standard packages or online-services or whatever). Please also provide infos on price and quality of the products if possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S.: An idea to get to grips with the above challenges would be a tool which uses Black-Scholes - but with historical vola data (e.g. VIX which is publicly available).&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="1355" LastEditDate="2011-09-10T02:35:03.620" LastActivityDate="2021-05-11T07:06:56.853" Title="Are there any good tools for back testing options strategies?" Tags="&lt;backtesting&gt;&lt;option-strategies&gt;&lt;software&gt;" AnswerCount="12" CommentCount="2" FavoriteCount="36" ContentLicense="CC BY-SA 3.0" />
  <row Id="75" PostTypeId="2" ParentId="25" CreationDate="2011-02-01T08:07:31.040" Score="14" Body="&lt;p&gt;There is a missing link to early options pricing literature which had been overlooked. Put-call parity along with static delta hedging were understood in actionable detail well before BSM and trading and risk management were accomplished through heuristic methods which indeed continued to be used after BSM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would point to &lt;a href=&quot;https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.581.884&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt; &quot;Why we Have Never Used the Black-Scholes-Merton Option Pricing Formula&quot;&lt;/a&gt; which gives an interesting overview and supplies further historical references.&lt;/p&gt;&#xA;" OwnerUserId="113" LastEditorUserId="38257" LastEditDate="2020-04-02T11:54:56.323" LastActivityDate="2020-04-02T11:54:56.323" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="76" PostTypeId="2" ParentId="44" CreationDate="2011-02-01T08:09:16.683" Score="13" Body="&lt;p&gt;Both answers from Shane and Vishal Belsare make sense and detail different models.&#xA;In my experience, I have never been satisfied by a unique model since the majority of papers out there can be split in two categories:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Those that predict the mean component of the problem.&lt;/li&gt;&#xA;&lt;li&gt;Those that predict the variance component of the problem.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The ideal (to read &quot;practical&quot;) model would be the one that allows you to incorporate your own views in both expectation of returns and variance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the expected returns, Black-Litterman seems interesting since it enables you to get a relative point of view of the expectations which is far more stable and less risky than absolute expected returns.&#xA;On the variance side, you can use two variance matrices. Theoritically, this would be using a markov switch regime regression or a 2-state regression. There is enough literature on the markov switch model that you can read, the latter model is simpler and easier to use. It consists in considering the returns of your assets as a bivariate normal distribution, one that explains the returns in quiet state of the market and the other explains the hectic state in the market. The result of such regression would be a variance matrix conditioned by the state of the market. (You can use, then, the VIX as a proxy of the state of the market in order to choose between both).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried in the past different models, but, to my opinion, this framework seems to be ahead of the theoretical ones.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll add some references that may be of interest:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kim, J. and Finger, C., A Stress Test to Incorporate Correlation Breakdown, Journal of&#xA;Risk, Spring 2000&lt;/p&gt;&#xA;&#xA;&lt;p&gt;McLachlan, G. and Basford, K., Mixture models: Inference and Applications to Clustering,&#xA;Marcel Dekker Inc., 1988&lt;/p&gt;&#xA;" OwnerUserId="150" LastActivityDate="2011-02-01T08:09:16.683" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="77" PostTypeId="2" ParentId="26" CreationDate="2011-02-01T08:46:35.637" Score="16" Body="&lt;p&gt;There is another reason why Stoc Vol Models should be usually preferred to Local Vol Models, this reason is explained in the Hagan et al. paper &lt;a href=&quot;http://www.math.columbia.edu/~lrb/sabrAll.pdf&quot; rel=&quot;noreferrer&quot;&gt;&quot;Managing Smile Risk&quot;&lt;/a&gt; about SABR process and is in simple terms the fact that &quot;smile dynamics&quot; is poorly predicted by local vol models leading to bad Hedging of exotic options. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway Local Vol models have the good feature to be &quot;arbitrage free&quot; (at the begining) and I think that some link between both approach can be achieved by Markovian Projection Method.for this you can have a look at V. Piterbarg's &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=906473&quot; rel=&quot;noreferrer&quot;&gt;paper&lt;/a&gt; on the subject and the references therein. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorDisplayName="user1157" LastEditDate="2014-01-27T16:38:56.060" LastActivityDate="2014-01-27T16:38:56.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="78" PostTypeId="2" ParentId="25" CreationDate="2011-02-01T08:52:33.347" Score="6" Body="&lt;p&gt;You find lots of info in part 3 &quot;(3. Myth 1: people did not properly “price” options before the Black–Scholes–Merton theory)&quot; of this paper: &lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Option traders use (very) sophisticated heuristics, never the Black–Scholes–Merton formula&quot;: &lt;a href=&quot;http://linkinghub.elsevier.com/retrieve/pii/S0167268110001927&quot; rel=&quot;nofollow&quot;&gt;http://linkinghub.elsevier.com/retrieve/pii/S0167268110001927&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(&lt;a href=&quot;https://docs.google.com/file/d/0B_31K_MP92hUNjljYjIyMzgtZTBmNS00MGMwLWIxNmQtYjMyNDFiYjY0MTJl/edit?hl=en_GB&quot; rel=&quot;nofollow&quot;&gt;a free preprint can be found here&lt;/a&gt; Page 217)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another source is Derivative Pricing 60 Years before Black–Scholes: Evidence from the Johannesburg Stock Exchange by LYNDON MOORE and STEVE JUH&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the abstract:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We obtain daily data for warrants traded on the Johannesburg Stock&#xA;  Exchange between 1909 and 1922, and for a broker’s call option quotes&#xA;  on stocks from 1908 to 1911. We use this new data set to test how&#xA;  close derivative prices are to Black–Scholes (1973) prices and to&#xA;  compute profits for investors using a simple trading rule for call&#xA;  options. We examine whether investors exercised warrants optimally and&#xA;  how they reacted to extensions of the warrants’ durations. We show&#xA;  that long before the development of the formal theory, investors had&#xA;  an intuitive grasp of the determinants of derivative pricing.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;a href=&quot;http://www.buec.udel.edu/coughenj/der_bs_johannesburg.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.buec.udel.edu/coughenj/der_bs_johannesburg.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2012-12-14T13:40:29.910" LastActivityDate="2012-12-14T13:40:29.910" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="79" PostTypeId="1" CreationDate="2011-02-01T10:09:20.380" Score="36" ViewCount="13227" Body="&lt;p&gt;Naively, it seems that Bayesian modeling, structural models particularly, would be quite useful in finance because of their ability to incorporate market idiosyncrasies and produce accurate probabilistic estimates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The down-side of course, is model-brittleness and extremely slow computational speed. Has the Quant community overcome these issues, and how common are these tools?&lt;/p&gt;&#xA;" OwnerUserId="163" LastEditorUserId="1106" LastEditDate="2011-09-08T21:00:20.593" LastActivityDate="2011-09-09T13:13:58.610" Title="How useful is Markov chain Monte Carlo for quantitative finance?" Tags="&lt;probability&gt;&lt;monte-carlo&gt;&lt;modeling&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="21" ContentLicense="CC BY-SA 3.0" />
  <row Id="80" PostTypeId="1" CreationDate="2011-02-01T10:35:02.527" Score="11" ViewCount="1247" Body="&lt;p&gt;Are the prices of e-minis such as S&amp;amp;P 500, Russell 2000, EUROSTOXX, etc. manipulated? That is, are there traders who trade large enough positions to make the price go in the direction they want, taking unfair advantage of the rest of the traders in that market?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so, what implication does this have for designing any trading systems for those markets? Is it essentially a fool's errand unless you have enough money to be one of the &quot;manipulators&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I once heard an experienced trader say (to retail traders):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The first thing you have to understand&#xA;  about this market is that this market was not&#xA;  created for you to make money. It was&#xA;  created for the big players to make&#xA;  money - &lt;strong&gt;from you&lt;/strong&gt;!&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="164" LastActivityDate="2015-06-20T21:58:58.593" Title="Are e-mini markets manipulated?" Tags="&lt;market-impact&gt;" AnswerCount="4" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="81" PostTypeId="1" CreationDate="2011-02-01T10:58:19.637" Score="26" ViewCount="4011" Body="&lt;p&gt;Mean-reversion and trend-following strategies have some kind of a theory behind them that explains why they might work, if implemented well. Pattern-recognition, on the other hand, seems like nothing more than data mining and overfitting. Could patterns possibly have any predictive value?  In other words, is there any theoretical reason why a pattern observed in historical data would be repeated in the future, other than random chance or self-fulfilling prophecy where the pattern &quot;works&quot; because enough traders use it?&lt;/p&gt;&#xA;" OwnerUserId="164" LastActivityDate="2019-06-17T11:52:50.683" Title="Is there any theoretical basis for pattern-recognition strategies?" Tags="&lt;theory&gt;" AnswerCount="4" CommentCount="3" FavoriteCount="11" ContentLicense="CC BY-SA 2.5" />
  <row Id="82" PostTypeId="1" AcceptedAnswerId="130" CreationDate="2011-02-01T11:10:04.150" Score="27" ViewCount="4806" Body="&lt;p&gt;I heard about MetaTrader from &lt;a href=&quot;http://www.metaquotes.net&quot;&gt;http://www.metaquotes.net&lt;/a&gt;. Is there any other framework or program available? Do you use different software for backtracking and running your trading algorithms?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you guys for your great answers. I will check out the posted applications.&lt;/p&gt;&#xA;" OwnerUserId="26" LastEditorUserId="53" LastEditDate="2011-02-04T17:55:24.680" LastActivityDate="2011-02-09T03:59:00.753" Title="What kind of basic framework or application do you use to run your trading algorithms?" Tags="&lt;data&gt;&lt;software&gt;&lt;programming&gt;&lt;algorithm&gt;" AnswerCount="8" CommentCount="0" FavoriteCount="26" CommunityOwnedDate="2011-02-04T16:47:38.160" ContentLicense="CC BY-SA 2.5" />
  <row Id="83" PostTypeId="2" ParentId="81" CreationDate="2011-02-01T11:18:29.167" Score="8" Body="&lt;p&gt;General answer to a very general question: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you find a significant pattern which distinguishes between structure and noise you understand something about that system. You have a model about it so you can extrapolate and forecast. On that basis you can use this model to make money. In that sense mean-reversion and trend-following are also &quot;only&quot; strategies that use a model derived from the data (or where ever from).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take evolution as a proxy: The living organism also have a model about their environment (which is partly stochastic, too). The successful organisms use that to survive and breed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an aside: In terms of a philosophical basis you can say that it is the belief that the past has meaning for the future (inductive argument) - but this is only a belief which cannot be justified in itself (saying that it worked well in the past is itself inductive and therefore we have a catch-22 here)&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-02-01T11:18:29.167" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="84" PostTypeId="1" AcceptedAnswerId="110" CreationDate="2011-02-01T11:43:21.703" Score="28" ViewCount="26294" Body="&lt;p&gt;I know the derivation of the Black-Scholes differential equation and I understand (most of)  the solution of the diffusion equation. What I am missing is the transformation from the Black-Scholes differential equation to the diffusion equation (with all the conditions) and back to the original problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All the transformations I have seen so far are not very clear  or technically demanding (at least by my standards).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question:&lt;/strong&gt;&lt;br&gt;&#xA;Could you provide me references for a very easily understood, step-by-step solution? &lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="70" LastEditDate="2011-02-09T20:09:50.543" LastActivityDate="2019-07-29T13:12:38.367" Title="Transformation from the Black-Scholes differential equation to the diffusion equation - and back" Tags="&lt;black-scholes&gt;&lt;differential-equations&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="26" ContentLicense="CC BY-SA 2.5" />
  <row Id="85" PostTypeId="1" AcceptedAnswerId="88" CreationDate="2011-02-01T12:04:09.257" Score="47" ViewCount="4772" Body="&lt;p&gt;Back in the mid 90's I used the Black-Scholes Model and the Cox-Ross-Rubenstein (Binomial) Model's to price Options. That was nearly 15 years ago and I was wondering if there are any new models being used to price Options?&lt;/p&gt;&#xA;" OwnerUserId="169" LastActivityDate="2016-02-23T09:29:50.377" Title="Are there any new Option pricing models?" Tags="&lt;black-scholes&gt;&lt;option-pricing&gt;" AnswerCount="9" CommentCount="1" FavoriteCount="23" ContentLicense="CC BY-SA 2.5" />
  <row Id="86" PostTypeId="2" ParentId="14" CreationDate="2011-02-01T12:22:47.013" Score="5" Body="&lt;p&gt;I handle volatility curves where moneyness is quoted in delta by an iterative guess:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Use an initial guess for delta of 0.5 (call)/-0.5 (put)&lt;/li&gt;&#xA;&lt;li&gt;Look up the volatility on the curve using the guess for delta&lt;/li&gt;&#xA;&lt;li&gt;Calculate delta for the option using the vol found in 2.&lt;/li&gt;&#xA;&lt;li&gt;Repeat using Newton-Raphson, until the difference in delta is small enough. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="22" LastActivityDate="2011-02-01T12:22:47.013" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="87" PostTypeId="2" ParentId="81" CreationDate="2011-02-01T12:30:31.527" Score="13" Body="&lt;p&gt;Weak form market efficiency says that you can't predict prices based on past prices. Or that technical analysis doesn't work. I think that the tests of weak form market efficiency are pretty conclusive and show that the US stock market is weak-form efficient; at least on a a timeline longer than a few minutes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's not to say that markets are &quot;efficient&quot;. The tests of semi-strong form efficiency (i.e., can't predict prices from all public info) are still debated a little, but I think most would say that markets are not semi-strong form efficient. You can do fundamental analysis have a chance a determining winners and losers. And markets are definitely not strong form efficient (i.e., can't predict prices from all info, public and private). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So does technical analysis work? I don't think so. Some may be earning abnormal returns, but they're likely taking risks that aren't obvious from the charts. Or in the context of mean reversion, yes, most of the time things revert to the mean, but they may not revert to the mean within your tolerance for pain. I think the best light read on the mean reversion topic is &quot;When Genius Failed&quot;. Their convergence trades on off-the-run and on-the-run Treasuries were &quot;right&quot;, but they went further away from the mean before converging after insolvency.&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-02-01T12:30:31.527" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="88" PostTypeId="2" ParentId="85" CreationDate="2011-02-01T12:36:43.923" Score="26" Body="&lt;p&gt;Black-Scholes itself didn't change a lot but we can now adjust it to deal with a lot more complicated factors to price more complicated contracts:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;stochastic volatility (Heston, Gatheral)&lt;/li&gt;&#xA;&lt;li&gt;stochastic rates (Hull)&lt;/li&gt;&#xA;&lt;li&gt;credit risk&lt;/li&gt;&#xA;&lt;li&gt;dividends&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Other methods (computing intensive) have also evolved to deal with various types of contracts where BS is not very appropriate choice (e.g. Monte Carlo simulation for path-dependant options).&lt;/p&gt;&#xA;" OwnerUserId="15" LastEditorUserId="35" LastEditDate="2011-12-10T20:32:50.160" LastActivityDate="2011-12-10T20:32:50.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="89" PostTypeId="2" ParentId="82" CreationDate="2011-02-01T12:58:59.027" Score="13" Body="&lt;p&gt;Some of us see this as a data-driven, empirical problem. And for &lt;em&gt;Programming with Data&lt;/em&gt;, you could do a lot worse than picking &lt;a href=&quot;http://www.r-project.org&quot;&gt;R&lt;/a&gt; which was made for the task.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://cran.r-project.org/web/views/Finance.html&quot;&gt;CRAN Task View on Finance&lt;/a&gt; lists a number of relevant packages. For trading strategies in particular, the quantstrat and blotter packages --which are both still on &lt;a href=&quot;http://r-forge.r-project.org/R/?group_id=316&quot;&gt;R-Forge in the TradeAnalytics bundle&lt;/a&gt;--are a very good start and are often discussed on the &lt;a href=&quot;https://stat.ethz.ch/pipermail/r-sig-finance/&quot;&gt;R-SIG-Finance&lt;/a&gt; mailing list.  &lt;/p&gt;&#xA;" OwnerUserId="69" LastEditorUserId="69" LastEditDate="2011-02-01T15:25:52.530" LastActivityDate="2011-02-01T15:25:52.530" CommentCount="0" CommunityOwnedDate="2011-02-04T16:47:38.160" ContentLicense="CC BY-SA 2.5" />
  <row Id="91" PostTypeId="2" ParentId="85" CreationDate="2011-02-01T13:27:53.360" Score="8" Body="&lt;p&gt;There are plenty of other models&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also add all the exponential Lévy processes with or without time change and also other stochastic volatility models such as SABR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I must add that there exist a paradigm different of the &quot;risk neutral pricing&quot; (mainly developped by Platen and Heath) called  &quot;Benchmark Pricing&quot; and which is in a way (that I do not fully understand yet), more general than &quot;Risk Neutral paradigm&quot;. The biggest problem being that calculation and determination of the benchmark protfolio doesn't seem easy to achieve in this &quot;supermartingale framework&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="92" LastEditDate="2011-02-02T11:22:54.870" LastActivityDate="2011-02-02T11:22:54.870" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="92" PostTypeId="2" ParentId="79" CreationDate="2011-02-01T13:36:51.413" Score="9" Body="&lt;p&gt;As far as I know MCMC and also (PMCMC) can be usefull for (bayesian) estimation of parameters of some Hidden process like in the Heston Model case based on observations of the Stock (filtering). But the problem here is that those estimates are not matching those based on calibration of vanilla options of the Risk Neutral measure. So as an econometric tool it has limited utility in my opinion for financial application.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, let's say that thank's to MCMC methods you've got an estimate of the parameters of Heston Model on a given stock based on the observations of the Stock values. Then you can (I won't blame you for that) hedge a call option on this stock using Heston Model based on your estimates. Nevertheless if there is a market for call options on this stock then you shall observe that the calibration of the Heston Model based on the vanilla prices will give you another set of parameters. So what should we do then ? Please do not forget that when filtering you are under Real World Probabilities but when you are hedging and pricing you are under Risk Neutral Probabilities. Definitely I won't follow (blindly) the filtering estimates mainly for the following reason which can be summed up in rather provocative way &quot;Market is always right&quot;. I say this because if you are Marking to Market you position (as every one does) then you must use the calibration estimate to value your portfolio, now those calibration estimates can evolves in a way that goes against your filtering estimates and there is nothing you can do about this. Finally if your stop loss is attained (you should better have one) then even though you believe you will make money out of your filtering strategy by holding the strategy till the end of the contract you have to realize that it is not an arbitrage strategy and that you are entered in a risky position not because of the filtering estimate that was badly calculated but because the market can evolve against the best past history estimates. I hope I made my point clear. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nevertheless as a tool to sample difficult to simulate random variables, it can be used as a tool for pricing. I think that I have seen a paper on arXiv using MCMC techniques to price american options.&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="1355" LastEditDate="2011-09-09T13:13:58.610" LastActivityDate="2011-09-09T13:13:58.610" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="93" PostTypeId="2" ParentId="36" CreationDate="2011-02-01T14:19:58.550" Score="5" Body="&lt;p&gt;The term 'rule of thumb' is ambiguous here. Because I don't think there are any rule of thumb, you just need to do the number crunching.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However there are some stable characteristic through time linked to correlation.&#xA;For instance it is a common fact that the hierarchy of correlation within different market  is relatively stable. US equities are less correlated than Europe. pre-crisis it was around 40 for the us, and 60 for Europe I think. Obviously it shooted up after.&lt;/p&gt;&#xA;" OwnerUserId="172" LastActivityDate="2011-02-01T14:19:58.550" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="94" PostTypeId="2" ParentId="74" CreationDate="2011-02-01T14:34:38.097" Score="16" Body="&lt;p&gt;A few pointers:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;When I looked into this a few years ago, a good solution at the time was &lt;a href=&quot;http://www.lim.com/?q=tools-apis/xmim&quot;&gt;LIM's XMIM&lt;/a&gt;, which also has an S-Plus/Matlab interface.  Whit Armstrong also provided &lt;a href=&quot;https://github.com/armstrtw/lim.tslib&quot;&gt;an R package&lt;/a&gt; for this, although I don't know how complete it is.  This provides both the data and the software for analysis.&lt;/li&gt;&#xA;&lt;li&gt;On the very high end (and expensive) side of the spectrum, &lt;a href=&quot;http://www.onetick.com/&quot;&gt;OneTick&lt;/a&gt; and &lt;a href=&quot;http://kx.com/&quot;&gt;KDB&lt;/a&gt; are both being used for this purpose by professional money managers.&lt;/li&gt;&#xA;&lt;li&gt;Two tools used by the non-professional community are available from brokers: &lt;a href=&quot;https://www.thinkorswim.com/&quot;&gt;https://www.thinkorswim.com/&lt;/a&gt; or &lt;a href=&quot;http://www.optionvue.com/&quot;&gt;http://www.optionvue.com/&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="17" LastEditorUserId="17" LastEditDate="2011-02-01T14:46:42.340" LastActivityDate="2011-02-01T14:46:42.340" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="95" PostTypeId="2" ParentId="27" CreationDate="2011-02-01T14:44:06.687" Score="11" Body="&lt;p&gt;It can be shown using a combination of calendar and butterfly that one can lock now the future variance &lt;em&gt;conditionally&lt;/em&gt; to the spot being around some specific level (local vol). So if you bought it and it gets realized higher &lt;em&gt;and&lt;/em&gt; the spot is there, you get money. if the spot is not there, you are neutral.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way to look at that dependency of spot level and vol level is just using a regular delta hedge strategy, whose PL is path dependent on what spot level is (wrt option strike) when volatility gets realized : your gamma is located around the strike, so if vol is high around here, you will pocket much (or loose if it is stall), whereas is it moves away from it, your lack of gamma will make you insensitive to it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These dependency combined with the market sentiment that volatility is higher when spot goes down leads to higher vol price for options with lower strike.&lt;/p&gt;&#xA;" OwnerUserId="172" LastEditorUserId="172" LastEditDate="2019-08-27T13:22:09.873" LastActivityDate="2019-08-27T13:22:09.873" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="96" PostTypeId="1" AcceptedAnswerId="2045" CreationDate="2011-02-01T14:45:48.957" Score="23" ViewCount="12153" Body="&lt;p&gt;What is a coherent risk measure, and why do we care? Can you give a simple example of a coherent risk measure as opposed to a non-coherent one, and the problems that a coherent measure addresses in portfolio choice?&lt;/p&gt;&#xA;" OwnerUserId="114" LastActivityDate="2019-07-13T21:20:12.793" Title="What is a &quot;coherent&quot; risk measure?" Tags="&lt;risk&gt;&lt;modern-portfolio-theory&gt;&lt;coherent-risk-measure&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="11" ContentLicense="CC BY-SA 2.5" />
  <row Id="97" PostTypeId="2" ParentId="82" CreationDate="2011-02-01T14:51:00.853" Score="5" Body="&lt;p&gt;We use intensively MetaTrader but it has a lot of problems... we waste a lot of time with turnarounds and dirty tricks to make things work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we're moving some developments to Matlab because it is stable and great for quick prototiping, also you can use free software like Octave, R, Maxima and Sagemath (wich I think englobes all these others applications).&lt;/p&gt;&#xA;" OwnerUserId="82" LastActivityDate="2011-02-01T14:51:00.853" CommentCount="0" CommunityOwnedDate="2011-02-04T16:47:38.160" ContentLicense="CC BY-SA 2.5" />
  <row Id="98" PostTypeId="2" ParentId="37" CreationDate="2011-02-01T14:54:38.387" Score="11" Body="&lt;p&gt;You can download data from 32 forex pairs from the Dukascopy's JForex platform, tick by tick since 2003. I think it is very accurate relative to its price (free).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can download their different formats by starting &lt;a href=&quot;http://www.dukascopy.com/swiss/english/data_feed/historical/&quot;&gt;here&lt;/a&gt;: (no registration required).&lt;/p&gt;&#xA;" OwnerUserId="82" LastEditorUserId="279" LastEditDate="2011-02-08T22:51:37.917" LastActivityDate="2011-02-08T22:51:37.917" CommentCount="8" CommunityOwnedDate="2011-02-01T14:54:38.387" ContentLicense="CC BY-SA 2.5" />
  <row Id="99" PostTypeId="2" ParentId="66" CreationDate="2011-02-01T14:59:18.243" Score="1" Body="&lt;p&gt;&quot;Quantitative Trading&quot;, Ernie Chan's book is a good starting point to learn pairs trading.&lt;/p&gt;&#xA;" OwnerUserId="82" LastActivityDate="2011-02-01T14:59:18.243" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="101" PostTypeId="2" ParentId="82" CreationDate="2011-02-01T15:14:32.753" Score="9" Body="&lt;p&gt;I develop strategies for a lot of these different platforms and the one that I feel offers the most is &lt;a href=&quot;http://www.ninjatrader.com&quot; rel=&quot;noreferrer&quot;&gt;NinjaTrader&lt;/a&gt;. It uses C# which is a bit slower than MetaTrader, which if I remember correctly uses a variant of C++, in fact in MT5 there should be almost no difference. However, it makes up for the slowness in spades with the freedom it allows you. Not only that, but I've had the least problems with it, contrast that with MetaTrader, which I absolutely dread coding in because everything feels like a hack and the historical backtester is just terrible. And if memory serves they don't have near the charting capabilities and they only offer a few periods with which to view the data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One thing to note, NinjaTrader isn't free like MetaTrader. (You can't trade live without paying for it, however everything else is free) It's \$1000/lifetime or \$180/quarter, and &lt;strong&gt;they don't offer refunds&lt;/strong&gt; so be sure you find a brokerage with a free trial before you go paying for it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're looking for a free alternative, I have played a little with &lt;a href=&quot;http://www.openecry.com&quot; rel=&quot;noreferrer&quot;&gt;OpenECry&lt;/a&gt;, and they seem to do a lot of things right that NinjaTrader does wrong, but it doesn't offer near the freedom that Ninja does either. So it's really a trade off and I feel Ninja wins.&lt;/p&gt;&#xA;" OwnerUserId="173" LastActivityDate="2011-02-01T15:14:32.753" CommentCount="1" CommunityOwnedDate="2011-02-04T16:47:38.160" ContentLicense="CC BY-SA 2.5" />
  <row Id="103" PostTypeId="1" CreationDate="2011-02-01T15:29:19.683" Score="46" ViewCount="43904" Body="&lt;p&gt;I've struggled for a long time to understand this - What is this?  And how does it affect you?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yes I mean risk neutral pricing - Wilmott Forums was not clear about that.&lt;/p&gt;&#xA;" OwnerUserId="103" LastEditorUserId="35" LastEditDate="2013-03-06T12:01:33.100" LastActivityDate="2019-03-14T18:28:47.240" Title="How does the &quot;risk-neutral pricing framework&quot; work?" Tags="&lt;risk&gt;&lt;risk-management&gt;" AnswerCount="8" CommentCount="4" FavoriteCount="29" ContentLicense="CC BY-SA 3.0" />
  <row Id="104" PostTypeId="1" CreationDate="2011-02-01T15:59:30.160" Score="2" ViewCount="841" Body="&lt;p&gt;Any recommendations on the best schools and overall education choices for quantitative finance?  &lt;/p&gt;&#xA;" OwnerUserId="147" LastActivityDate="2011-02-02T05:56:49.757" Title="What are the best master programmes for someone interested in a career in quantitative finance?" Tags="&lt;finance&gt;&lt;education&gt;&lt;career&gt;" AnswerCount="3" CommentCount="2" ClosedDate="2011-02-02T05:57:51.363" ContentLicense="CC BY-SA 2.5" />
  <row Id="105" PostTypeId="2" ParentId="104" CreationDate="2011-02-01T16:06:23.473" Score="5" Body="&lt;p&gt;Quantnet provided a &lt;a href=&quot;http://www.quantnet.com/mfe-programs-rankings/&quot; rel=&quot;noreferrer&quot;&gt;rankings of MS in Financial Engineering programs&lt;/a&gt;, which can be used for reference.  More generally, this really depends on what area of quantitative finance that interests you:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to work in developing valuation and pricing models, than one of these programs will be very useful.  If you want to work in quantitative trading, it's slightly less clear.  Quants in other areas can have varied educational backgrounds, ranging from a Ph.D. in Physics to degrees in Computer Science or Engineering.  High frequency trading, for instance, is very technical and will often include people with more of a computer science background.  In my experience, statistics and machine learning is also a very useful specialty.&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="43" LastEditDate="2011-02-01T16:23:43.173" LastActivityDate="2011-02-01T16:23:43.173" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="106" PostTypeId="2" ParentId="104" CreationDate="2011-02-01T16:22:05.473" Score="3" Body="&lt;p&gt;It's often hard to give a definite answer to such &quot;what is top programs&quot; questions. When we did the Quantnet MFE ranking in 2009, it was more or less as a guide for people new to this field since it's hard to find information on these MFE programs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A lot of your choice will come down to personal preferences such as location, tuition, length, program strength. Many people have used our ranking to do further research on programs they may have never heard of before.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We are working on the 2011 ranking which is more comprehensive. &lt;/p&gt;&#xA;" OwnerUserId="43" LastActivityDate="2011-02-01T16:22:05.473" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="107" PostTypeId="2" ParentId="103" CreationDate="2011-02-01T16:37:43.960" Score="35" Body="&lt;p&gt;I assume you mean risk neutral pricing? Think of it this way (beware, oversimplification ahead ;-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You want to price a derivative on gold, a gold certificate. The product just pays the current price of an ounce in $. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, how would you price it? Would you think about your risk preferences? No, you won't, you would just take the current gold price and perhaps add some spread. Therefore the risk preferences did not matter (=risk neutrality) because this product is derived (= derivative) from an underlying product (=underlying). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is because all of the different risk preferences of the market participants is already included in the price of the underlying and the derivative can be hedged with the underlying continuously (at least this is what is often taken for granted). As soon as the price of the gold certificate diverges from the original price a shrewd trader would just buy/sell the underlying and sell/buy the certificate to pocket a risk free profit - and the price will soon come back again...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, you see, the basic concept of risk neutrality is quite natural and easy to grasp. Of course, the devil is in the details... but that is another story.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also my answer to a similar question here: &lt;a href=&quot;https://quant.stackexchange.com/questions/8247/why-drifts-are-not-in-the-black-scholes-formula/8252#8252&quot;&gt;Why Drifts are not in the Black Scholes Formula&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2018-04-07T09:44:45.210" LastActivityDate="2018-04-07T09:44:45.210" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="108" PostTypeId="2" ParentId="96" CreationDate="2011-02-01T16:57:38.543" Score="3" Body="&lt;p&gt;Coherent risk measures were created to address the problem that extant risk measures, like VaR, did not: namely that a risk measure should reward diversification. &lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2011-02-01T16:57:38.543" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="109" PostTypeId="2" ParentId="37" CreationDate="2011-02-01T17:04:10.337" Score="20" Body="&lt;p&gt;&lt;a href=&quot;http://www.iqfeed.net/index.cfm?displayaction=data&amp;amp;section=services&quot;&gt;DTN's IQFeed&lt;/a&gt; is really good, if a little expensive. I believe it starts at 80 dollars/month and then you add your exchange fees on top. To get access to the developer API you need to pay 300 dollars for a year's worth of access.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Details:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Real-Time, TRUE Tick-by-Tick Data on US and Canadian Equities (NYSE, NASDAQ, AMEX, Canadian Stock Exchanges)&lt;/li&gt;&#xA;&lt;li&gt;Delayed Futures Data (Real-Time Data Available for an additional fee)&lt;/li&gt;&#xA;&lt;li&gt;Real-Time Equity/Index Options and Forex Data Available for an additional fee&lt;/li&gt;&#xA;&lt;li&gt;Real Time Index quotes&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="173" LastEditorUserId="8" LastEditDate="2011-02-01T19:59:24.283" LastActivityDate="2011-02-01T19:59:24.283" CommentCount="6" CommunityOwnedDate="2011-02-01T17:04:10.337" ContentLicense="CC BY-SA 2.5" />
  <row Id="110" PostTypeId="2" ParentId="84" CreationDate="2011-02-01T18:13:27.523" Score="36" Body="&lt;p&gt;One starts with the Black-Scholes equation&#xA;$$\frac{\partial C}{\partial t}+\frac{1}{2}\sigma^2S^2\frac{\partial^2 C}{\partial S^2}+&#xA;rS\frac{\partial C}{\partial S}-rC=0,\qquad\qquad\qquad\qquad\qquad(1)$$&#xA;supplemented with the terminal and boundary conditions (in the case of a European call)&#xA;$$C(S,T)=\max(S-K,0),\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad(2)$$&#xA;$$C(0,t)=0,\qquad C(S,t)\sim S\ \mbox{ as } S\to\infty.\qquad\qquad\qquad\qquad\qquad\qquad$$&#xA;The option value $C(S,t)$ is defined over the domain  $0&amp;lt; S &amp;lt; \infty$, $0\leq t\leq T$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step 1.&lt;/strong&gt; The equation can be rewritten in the equivalent form&#xA;$$\frac{\partial C}{\partial t}+\frac{1}{2}\sigma^2\left(S\frac{\partial }{\partial S}\right)^2C+\left(r-\frac{1}{2}\sigma^2\right)S\frac{\partial C}{\partial S}-rC=0.$$&#xA;The change of independent variables&#xA;$$S=e^y,\qquad t=T-\tau$$&#xA;results in &#xA;$$S\frac{\partial }{\partial S}\to\frac{\partial}{\partial y},\qquad \frac{\partial}{\partial t}\to - \frac{\partial}{\partial \tau},$$&#xA;so one gets the constant coefficient equation &#xA;$$\frac{\partial C}{\partial \tau}-\frac{1}{2}\sigma^2\frac{\partial^2 C}{\partial y^2}-\left(r-\frac{1}{2}\sigma^2\right)\frac{\partial C}{\partial y}+rC=0.\qquad\qquad\qquad(3)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step 2.&lt;/strong&gt; If we replace $C(y,\tau)$ in equation (3) with $u=e^{r\tau}C$, we will obtain that&#xA;$$\frac{\partial u}{\partial \tau}-\frac{1}{2}\sigma^2\frac{\partial^2 u}{\partial y^2}-\left(r-\frac{1}{2}\sigma^2\right)\frac{\partial u}{\partial y}=0.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step 3.&lt;/strong&gt; Finally, the substitution $x=y+(r-\sigma^2/2)\tau$ allows us to eliminate the first order term and to reduce the preceding equation to the form &#xA;$$\frac{\partial u}{\partial \tau}=\frac{1}{2}\sigma^2\frac{\partial^2 u}{\partial x^2}$$&#xA;which is the standard &lt;a href=&quot;http://en.wikipedia.org/wiki/Heat_equation&quot;&gt;heat equation&lt;/a&gt;. The function $u(x,\tau)$ is defined for $-\infty &amp;lt; x &amp;lt; \infty$, $0\leq\tau\leq T$. The terminal condition (2) turns into the initial condition &#xA;$$u(x,0)=u_0(x)=\max(e^{\frac{1}{2}(a+1)x}-e^{\frac{1}{2}(a-1)x},0),$$&#xA;where $a=2r/\sigma^2$. The solution of the heat equation is given by the well-known &lt;a href=&quot;http://en.wikipedia.org/wiki/Heat_equation#Homogeneous_heat_equation&quot;&gt;formula&lt;/a&gt;&#xA;$$u(x,\tau)=\frac{1}{\sigma\sqrt{2\pi \tau}}\int_{-\infty}^{\infty} u_0(s)\exp\left(-\frac{(x-s)^2}{2\sigma^2 \tau}\right)ds.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if we evaluate the integral with our specific function $u_0$ and return to the old variables $(x,\tau,u)\to(S,t,C)$, we will arrive at the usual Black–Merton-Scholes formula&#xA;for the value of a European call. The details of the calculation can be found e.g. in &lt;a href=&quot;http://books.google.com/books?id=VYVhnC3fIVEC&amp;amp;printsec=frontcover&amp;amp;dq=the+mathematics+of+financial+derivatives&amp;amp;source=bl&amp;amp;ots=-Mbgb0U8Ac&amp;amp;sig=deXrx-p9jKB-FoqZhuZNmWZlZQU&amp;amp;hl=en&amp;amp;ei=_UtITcyiN4SYOs3j5acE&amp;amp;sa=X&amp;amp;oi=book_result&amp;amp;ct=result&amp;amp;resnum=5&amp;amp;ved=0CD0Q6AEwBA#v=o&quot;&gt;&lt;em&gt;The Mathematics of Financial Derivatives&lt;/em&gt;&lt;/a&gt; by Wilmott, Howison, and Dewynne (see Section 5.4).&lt;/p&gt;&#xA;" OwnerUserId="70" LastEditorUserId="70" LastEditDate="2014-01-27T20:19:10.943" LastActivityDate="2014-01-27T20:19:10.943" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="111" PostTypeId="1" AcceptedAnswerId="113" CreationDate="2011-02-01T18:35:41.513" Score="138" ViewCount="171644" Body="&lt;p&gt;&lt;em&gt;I am not very sure, if this question fits in here.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have recently begun, reading and learning about machine learning. Can someone throw some light onto how to go about it or rather can anyone share their experience and few basic pointers about how to go about it or atleast start applying it to see some results from data sets? How ambitious does this sound?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, do mention about standard algorithms that should be tried or looked at while doing this.&lt;/p&gt;&#xA;" OwnerUserId="175" LastEditorUserId="1106" LastEditDate="2011-12-18T20:52:41.500" LastActivityDate="2019-11-25T21:00:28.903" Title="How can I go about applying machine learning algorithms to stock markets?" Tags="&lt;machine-learning&gt;&lt;prediction&gt;&lt;mathematics&gt;" AnswerCount="15" CommentCount="11" FavoriteCount="291" ContentLicense="CC BY-SA 2.5" />
  <row Id="113" PostTypeId="2" ParentId="111" CreationDate="2011-02-01T18:48:50.043" Score="155" Body="&lt;p&gt;There seems to be a basic fallacy that someone can come along and learn some machine learning or AI algorithms, set them up as a black box, hit go, and sit back while they retire.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My advice to you:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Learn statistics and machine learning first, then worry about how to apply them to a given problem.  There is no free lunch here.  Data analysis is &lt;em&gt;hard work&lt;/em&gt;.  Read &lt;a href=&quot;http://web.stanford.edu/~hastie/ElemStatLearn/&quot; rel=&quot;noreferrer&quot;&gt;&quot;The Elements of Statistical Learning&quot;&lt;/a&gt; (the pdf is available for free on the website), and don't start trying to build a model until you understand at least the first 8 chapters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you understand the statistics and machine learning, then you need to learn how to backtest and build a trading model, accounting for transaction costs, etc. which is a whole other area.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After you have a handle on both the analysis and the finance, then it will be somewhat obvious how to apply it.  The entire point of these algorithms is trying to find a way to fit a model to data and produce &lt;em&gt;low bias and variance&lt;/em&gt; in prediction (i.e. that the training and test prediction error will be low and similar).  &lt;a href=&quot;http://quantumfinancier.wordpress.com/2010/06/26/support-vector-machine-rsi-system/&quot; rel=&quot;noreferrer&quot;&gt;Here is an example of a trading system using a support vector machine in R&lt;/a&gt;, but just keep in mind that you will be doing yourself a huge disservice if you don't spend the time to understand the basics before trying to apply something esoteric.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[Edit:]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just to add an entertaining update: I recently came across this master's thesis: &lt;a href=&quot;http://blog.andersen.im/wp-content/uploads/2012/12/ANovelAlgorithmicTradingFramework.pdf&quot; rel=&quot;noreferrer&quot;&gt;&quot;A Novel Algorithmic Trading Framework Applying Evolution and Machine Learning for Portfolio Optimization&quot;&lt;/a&gt; (2012).  It's an extensive review of different machine learning approaches compared against buy-and-hold.  After almost 200 pages, they reach the basic conclusion: &quot;No trading system was able to outperform the benchmark when using transaction costs.&quot;  Needless to say, this does not mean that it can't be done (I haven't spent any time reviewing their methods to see the validity of the approach), but it certainly provides some more evidence in favor of the &lt;a href=&quot;http://en.wikipedia.org/wiki/No_free_lunch_theorem&quot; rel=&quot;noreferrer&quot;&gt;no-free lunch theorem&lt;/a&gt;.  &lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="25351" LastEditDate="2017-08-03T21:48:24.560" LastActivityDate="2017-08-03T21:48:24.560" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="114" PostTypeId="1" CreationDate="2011-02-01T18:59:40.630" Score="16" ViewCount="1882" Body="&lt;p&gt;How do I price OANDA box options without using their slow and &#xA;machine-unfriendly user interface?: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://fxtrade.oanda.com&quot; rel=&quot;noreferrer&quot;&gt;http://fxtrade.oanda.com&lt;/a&gt; (free demo account) sells &quot;box options&quot;: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;If you already know what a box option is (or visit &#xA;&lt;a href=&quot;http://fxtrade.oanda.com/trade-forex/fxtrade/box-options&quot; rel=&quot;noreferrer&quot;&gt;http://fxtrade.oanda.com/trade-forex/fxtrade/box-options&lt;/a&gt; or signup &#xA;for a free demo account), you can skip the rest of this section. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A box option is a highly flexible binary option where you choose &#xA;a FOREX currency pair, a price range and a time range. You win if &#xA;the FOREX currency pair hits the price range sometime during the &#xA;time range. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Here's how a box option looks on a chart on OANDA's user interface: &lt;img src=&quot;https://i.stack.imgur.com/g7VdM.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;And the same box option in a form: &lt;img src=&quot;https://i.stack.imgur.com/Audlg.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In the above example, you're betting that USDCAD will trade &#xA;between 0.98758 and 0.99674 sometime between 1455 and 2000 &#xA;GMT. Note that USDCAD does not have remain in this range the &#xA;entire time: if USDCAD plunged to 0.98000 before 1455 but then &#xA;rebounded to 0.98760 at 1900 (or any time between 1455 and 2000), &#xA;you still win. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$1000, the purchase price, is the most you can lose. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you win, OANDA will pay back &lt;code&gt;$1005.48&lt;/code&gt; for a profit of &#xA;&lt;code&gt;$5.48&lt;/code&gt;. This isn't much, because it's fairly likely that you'll &#xA;win. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can also buy an option betting the exact opposite: that &#xA;USDCAD won't trade between 0.98758 and 0.99674 &lt;em&gt;any&lt;/em&gt; time between &#xA;1455 and 2000 (in other words, USDCAD remains below 0.98758 from &#xA;1455 to 2000, or remains above 0.99674 from 1455 to 2000). &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;For the opposite option, OANDA pays a little better:&lt;img src=&quot;https://i.stack.imgur.com/P4hmK.png&quot; alt=&quot;enter image description here&quot;&gt; &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;since it's unlikely that USDCAD won't hit that range between 1455 and 2000. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;I'm trying to figure how OANDA prices these options: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;I'm trying to optimize certain values, so I need quotes for &#xA;every price range and every time range. It's infeasible to do this &#xA;using their standard interface. Additionally, it's hard to record &#xA;values from this user interface into a file. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The prices obviously relate in some way to the probability of &#xA;hitting the time/price range. I know how to calculate these &#xA;probabilities &#xA;(&lt;a href=&quot;https://github.com/barrycarter/bcapps/blob/master/box-option-value.m&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/barrycarter/bcapps/blob/master/box-option-value.m&lt;/a&gt;), &#xA;but can't find a correlation between the probabilities and OANDA's &#xA;price. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;OANDA obviously includes a &quot;safety factor&quot; and &quot;commission&quot; in &#xA;their quotes. If a box option is 50% likely to win, they won't &#xA;return &lt;code&gt;$2000&lt;/code&gt; to your &lt;code&gt;$1000&lt;/code&gt; dollars, since that would mean no profit &#xA;for them. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;When the &quot;hit&quot; and &quot;miss&quot; prices are identical (roughly meaning &#xA;they feel the box option has 50% chance of success), they seem to &#xA;pay out about &lt;code&gt;$1400&lt;/code&gt; on a &lt;code&gt;$1000&lt;/code&gt; bet (meaning a &lt;code&gt;$400&lt;/code&gt; profit). That's &#xA;just a rough observation though. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;This might be more of a project, but I'm looking for help, tips &#xA;how to get started, brilliant insights, etc. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I realize OANDA charges a large &quot;commission&quot; on these options, but still think they can be useful in some cases.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerDisplayName="user59" LastEditorUserId="1355" LastEditDate="2011-09-09T18:34:01.053" LastActivityDate="2011-09-09T18:34:01.053" Title="How do I price OANDA box options?" Tags="&lt;option-pricing&gt;&lt;software&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="115" PostTypeId="1" AcceptedAnswerId="116" CreationDate="2011-02-01T19:07:12.580" Score="44" ViewCount="5841" Body="&lt;p&gt;Since Mandelbrot, Fama and others have performed seminal work on the topic, it has been suspected that stock price fluctuations can be more appropriately modeled using Lévy alpha-stable distrbutions other than the normal distribution law. Yet, the subject is somewhat controversial, there is a lot of literature in defense of the normal law and criticizing distributions without bounded variation. Moreover, precisely because of the the unbounded variation, the whole standard framework of quantitative analysis can not be simply copy/pasted to deal with these more &quot;exotic&quot; distributions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet, I think there should be something to say about how to value risk of fluctuations. After all, the approaches using the variance are just shortcuts, what one really has in mind is the probability of a fluctuation of a certain size. So I was wondering if there is any literature investigating that in particular.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words: what is the current status of financial theories based on Lévy alpha-stable distributions? What are good review papers of the field? &lt;/p&gt;&#xA;" OwnerUserId="156" LastEditorUserId="156" LastEditDate="2011-02-02T08:42:46.467" LastActivityDate="2017-11-10T21:37:10.240" Title="Lévy alpha-stable distribution and modelling of stock prices." Tags="&lt;risk&gt;&lt;equities&gt;&lt;variance&gt;&lt;probability&gt;" AnswerCount="11" CommentCount="2" FavoriteCount="30" ContentLicense="CC BY-SA 2.5" />
  <row Id="116" PostTypeId="2" ParentId="115" CreationDate="2011-02-01T19:28:09.343" Score="23" Body="&lt;p&gt;I recently read &lt;a href=&quot;http://academic2.american.edu/~jpnolan/stable/StableFinance23Mar2005.pdf&quot;&gt;&quot;Modeling financial data with stable distributions&quot;&lt;/a&gt; (Nolan 2005) which gives a survey of this area and might be of interest (I believe it was contained in &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0444508961&quot;&gt;&quot;Handbook of Heavy Tailed Distributions in Finance&quot;&lt;/a&gt;).  Another more recent reference is &lt;a href=&quot;http://www.finanalytica.com/uploads/TechnicalReports/09review.pdf&quot;&gt;&quot;Alpha-Stable Paradigm in Financial Markets&quot;&lt;/a&gt; (2008).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not aware of anything covering &quot;risk of fluctuations&quot; and this is still certainly not at the center of the field (i.e. most theory still includes some version of Gaussian or mixture of Gaussians).  Would also be interested in other references.&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="17" LastEditDate="2011-02-01T19:33:55.123" LastActivityDate="2011-02-01T19:33:55.123" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="118" PostTypeId="2" ParentId="111" CreationDate="2011-02-01T20:02:38.270" Score="10" Body="&lt;p&gt;One basic application is predicting financial distress.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Get a bunch of data with some companies that have defaulted, and others that haven't, with a variety of financial information and ratios. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use a machine learning method such as SVM to see if you can predict which companies will default and which will not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use that SVM in the future to short high-probability default companies and long low-probability default companies, with the proceeds of the short sales. &lt;/p&gt;&#xA;" OwnerUserId="74" LastActivityDate="2011-02-01T20:02:38.270" CommentCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="119" PostTypeId="2" ParentId="115" CreationDate="2011-02-01T20:55:14.413" Score="9" Body="&lt;p&gt;I am still a beginner to this topic, and have been working through Cont and Tankov's textbook Financial Modelling With Jump Processes (2003), which is a fairly elementary treatment of the subject.  I think a revised second edition is to come out later this year.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One interesting area of applications that has become more prominent with a recent wave of papers are those that use Bayesian methodology to evaluate stochastic volatility, for example see: &lt;a href=&quot;http://harrisd.net/papers/ARCHSV/Multivariate%20Models%20in%20the%20Literature/JacquierPolsonRossi2004JoE.pdf&quot;&gt;Jacquier, Polson &amp;amp; Rossi&lt;/a&gt; and &lt;a href=&quot;http://www.federalreserve.gov/pubs/feds/2009/200940/200940pap.pdf&quot;&gt;Szerszen&lt;/a&gt; among others.&lt;/p&gt;&#xA;" OwnerUserId="99" LastActivityDate="2011-02-01T20:55:14.413" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="120" PostTypeId="2" ParentId="5" CreationDate="2011-02-01T21:49:17.587" Score="11" Body="&lt;p&gt;There is a fairly recent (2010) &lt;a href=&quot;http://books.google.com/books?id=f73jwdRa3t4C&amp;amp;printsec=frontcover&amp;amp;dq=Risk+Management+in+Credit+Portfolios:+Concentration+Risk+and+Basel+II&amp;amp;hl=en&amp;amp;ei=YHlITcTGF4SYOs3j5acE&amp;amp;sa=X&amp;amp;oi=book_result&amp;amp;ct=result&amp;amp;resnum=1&amp;amp;ved=0CDAQ6AEwAA#v=onepage&amp;amp;q&amp;amp;f=false&quot; rel=&quot;noreferrer&quot;&gt;monograph&lt;/a&gt; by Martin Hibbeln entirely devoted to this very question. He starts with the standard Asymptotic Single Risk Factor model  and shows how it can be modified in order to be consistent with the Basel II framework. He also  compares the accuracy and runtime of several modern models which have been developed to measure sector concentration risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ivgKp.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="70" LastActivityDate="2011-02-01T21:49:17.587" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="121" PostTypeId="1" AcceptedAnswerId="192" CreationDate="2011-02-01T22:51:01.403" Score="21" ViewCount="7148" Body="&lt;p&gt;Suppose you have two sources of covariance forecasts on a fixed set of $n$ assets, method A and method B (you can think of them as black box forecasts, from two vendors, say), which are known to be based on data available at a given point in time. Suppose you also observe the returns on those $n$ assets for a following period (a year's worth, say). What metrics would you use to evaluate the quality of these two covariance forecasts? What statistical tests? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For background, the use of the covariances would be in a vanilla mean-variance optimization framework, but one can assume little is known about the source of alpha. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;edit&lt;/strong&gt;: forecasting a covariance &lt;em&gt;matrix&lt;/em&gt; is a bit different, I think, than other forecasting tasks. There are some applications where getting a good forecast of the eigenvectors of the covariance would be helpful, but the eigenvalues are not as important. (I am thinking of the case where one's portfolio is $\Sigma^{-1}\mu$, rescaled, where $\Sigma$ is the forecast covariance, and $\mu$ is the forecast returns.) In that case, the metric for forecasting quality should be invariant with respect to &lt;em&gt;scale&lt;/em&gt; of the forecast. For some cases, it seems like forecasting the first eigenvector is more important (using it like beta), &lt;em&gt;etc&lt;/em&gt;. This is why I was looking for methods specifically for covariance forecasting for use in quant finance.&lt;/p&gt;&#xA;" OwnerUserId="108" LastEditorUserId="108" LastEditDate="2011-02-04T03:31:53.430" LastActivityDate="2011-02-10T18:40:20.147" Title="How do you evaluate a covariance forecast?" Tags="&lt;forecasting&gt;&lt;statistics&gt;&lt;covariance&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="14" ContentLicense="CC BY-SA 2.5" />
  <row Id="122" PostTypeId="2" ParentId="111" CreationDate="2011-02-01T23:10:25.770" Score="5" Body="&lt;p&gt;I echo much of what @Shane wrote. In addition to reading ESL, I would suggest an even more fundamental study of statistics first. Beyond that, the problems I outlined in &lt;a href=&quot;https://quant.stackexchange.com/questions/45/how-are-risk-management-practices-applied-to-ml-ai-based-automated-trading-system/68#68&quot;&gt;in another question on this exchange&lt;/a&gt; are highly relevant. In particular, the problem of datamining bias is a serious roadblock to any machine-learning based strategy.&lt;/p&gt;&#xA;" OwnerUserId="108" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2011-02-01T23:10:25.770" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="123" PostTypeId="2" ParentId="121" CreationDate="2011-02-01T23:40:54.520" Score="4" Body="&lt;p&gt;You probably want to take it back to how one evaluates forecast models in general: using some metrics over one- or many-step forecasts, see e.g. &lt;a href=&quot;http://en.wikipedia.org/wiki/Calculating_demand_forecast_accuracy&quot; rel=&quot;nofollow&quot;&gt;here for a Wikipedia discussion&lt;/a&gt;.  But instead of forecasting first moments, it would now be second moments.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can still use (root) mean squared error, or &lt;a href=&quot;http://en.wikipedia.org/wiki/Mean_absolute_percentage_error&quot; rel=&quot;nofollow&quot;&gt;mean absolute percentage error&lt;/a&gt;, or related measures; see e.g. this paper by  Rob Hyndman &lt;a href=&quot;http://www.buseco.monash.edu.au/ebs/pubs/wpapers/2005/wp13-05.pdf&quot; rel=&quot;nofollow&quot;&gt;on comparisons of methods&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="69" LastActivityDate="2011-02-01T23:40:54.520" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="124" PostTypeId="2" ParentId="111" CreationDate="2011-02-02T00:15:30.567" Score="39" Body="&lt;p&gt;&lt;strong&gt;My Advice to You:&lt;/strong&gt;&lt;br&gt;&#xA;There are several Machine Learning/Artificial Intelligence (ML/AI) branches out there:&lt;br&gt;&#xA;&lt;a href=&quot;http://www-formal.stanford.edu/jmc/whatisai/node2.html&quot;&gt;http://www-formal.stanford.edu/jmc/whatisai/node2.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have only tried genetic programming and some neural networks, and I personally think that the &quot;learning from experience&quot; branch seems to have the most potential. GP/GA and neural nets seem to be the most commonly explored methodologies for the purpose of stock market predictions, but if you do some data mining on &lt;a href=&quot;http://www.predictwallstreet.com/&quot;&gt;Predict Wall Street&lt;/a&gt;, you might be able to do some sentiment analysis too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Spend some time learning about the various ML/AI techniques, find some market data and try to implement some of those algorithms. Each one will have its strengths and weaknesses, but you may be able to combine the predictions of each algorithm into a composite prediction (similar to what the winners of the NetFlix Prize did).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Some Resources:&lt;/strong&gt;&lt;br&gt;&#xA;Here are some resources that you might want to look into:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Max Dama's blog: &lt;a href=&quot;http://www.maxdama.com/search/label/Artificial%20Intelligence&quot;&gt;http://www.maxdama.com/search/label/Artificial%20Intelligence&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;AI Stock Market Forum: &lt;a href=&quot;http://www.ai-stockmarketforum.com/&quot;&gt;http://www.ai-stockmarketforum.com/&lt;/a&gt; &lt;/li&gt;&#xA;&lt;li&gt;Weka is a data mining tool with a collection of ML/AI algorithms: &lt;a href=&quot;http://www.cs.waikato.ac.nz/ml/weka/&quot;&gt;http://www.cs.waikato.ac.nz/ml/weka/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The Chatter:&lt;/strong&gt;&lt;br&gt;&#xA;The general consensus amongst traders is that Artificial Intelligence is a voodoo science, you can't make a computer predict stock prices and you're sure to loose your money if you try doing it. Nonetheless, the same people will tell you that just about the &lt;em&gt;only&lt;/em&gt; way to make money on the stock market is to build and improve on your own trading strategy and follow it closely (which is not actually a bad idea). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea of AI algorithms is not to build &lt;a href=&quot;http://en.wikipedia.org/wiki/Not_Quite_Human_%28film%29&quot;&gt;Chip&lt;/a&gt; and let him trade for you, but to automate the process of creating strategies. It's a very tedious process and by no means is it easy :).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Minimizing Overfitting:&lt;/strong&gt;&lt;br&gt;&#xA;As we've heard before, a fundamental issue with AI algorithms is &lt;a href=&quot;http://en.wikipedia.org/wiki/Overfitting&quot;&gt;overfitting&lt;/a&gt; (aka datamining bias): given a set of data, your AI algorithm may find a pattern that is particularly relevant to the &lt;a href=&quot;http://en.wikipedia.org/wiki/Training_set&quot;&gt;training set&lt;/a&gt;, but it may not be relevant in the &lt;a href=&quot;http://en.wikipedia.org/wiki/Test_set&quot;&gt;test set&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several ways to minimize overfitting:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Use a &lt;a href=&quot;http://en.wikipedia.org/wiki/Cross-validation_%28statistics%29&quot;&gt;validation set&lt;/a&gt;: it doesn't give feedback to the algorithm, but it allows you to detect when your algorithm is potentially beginning to overfit (i.e. you can stop training if you're overfitting too much).&lt;/li&gt;&#xA;&lt;li&gt;Use &lt;a href=&quot;http://en.wikipedia.org/wiki/Online_machine_learning&quot;&gt;online machine learning&lt;/a&gt;: it largely eliminates the need for back-testing and it is very applicable for algorithms that attempt to make market predictions.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ensemble_learning&quot;&gt;Ensemble Learning&lt;/a&gt;: provides you with a way to take multiple machine learning algorithms and combine their predictions. The assumption is that various algorithms may have overfit the data in some area, but the &quot;correct&quot; combination of their predictions will have better predictive power.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Fun Facts:&lt;/strong&gt;&lt;br&gt;&#xA;Apparently &lt;a href=&quot;http://www.rattraders.com/&quot;&gt;rats can trade too&lt;/a&gt;!&lt;/p&gt;&#xA;" OwnerUserId="78" LastEditorUserId="5093" LastEditDate="2013-04-09T07:09:32.420" LastActivityDate="2013-04-09T07:09:32.420" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="125" PostTypeId="2" ParentId="66" CreationDate="2011-02-02T03:29:07.433" Score="12" Body="&lt;p&gt;Quantitative pair trading (as we are on the quantitative finance forum) is based on cointegration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Two stocks are said to be cointegrated if they move together, which means that they share the same long term trend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Precisely:&#xA;It exists a linear relationship between the price of the 2 stocks so that is mean reverting. (for instance the difference between the 2 is mean reverting). But it can be another relation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you have a mean reverting basket, you can study this mean reversion (average, speed to come back to the mean, etc...) And it exists optimal strategies to trade this basket.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't forget that past behavior is not always a good indicator of future behavior. A cointegration relationship can evolve/break. Then:  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1/ Think also about the exit/stop loss strategies.&#xA;2/ Try to make all your coefficients time varying&lt;/p&gt;&#xA;" OwnerUserId="134" LastActivityDate="2011-02-02T03:29:07.433" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="126" PostTypeId="2" ParentId="104" CreationDate="2011-02-02T05:56:49.757" Score="2" Body="&lt;p&gt;My personal opinion after 2 years of interest in MFE:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ol&gt;&#xA;  &lt;li&gt;NYU's Courant Institute of Mathematics&lt;/li&gt;&#xA;  &lt;li&gt;UC Berkeley&lt;/li&gt;&#xA;  &lt;li&gt;Columbia University&lt;/li&gt;&#xA;  &lt;li&gt;Princeton University&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I cant say about others after these top 4, IMO. &lt;/p&gt;&#xA;" OwnerDisplayName="user98" LastActivityDate="2011-02-02T05:56:49.757" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="127" PostTypeId="2" ParentId="81" CreationDate="2011-02-02T08:47:03.850" Score="4" Body="&lt;p&gt;To my point of view there are never any reason that a pattern or anything else would repeat in the futur. Actualy I don't see any difference between pattern recognition and mean reversion/Trend Following in term of theoretical proof. One can read Pr Andrew Lo : &quot;Foundations of Technical Analysis&quot;. It tries to give a theoretical background to TA by studying the enpirical distribution of stock returns conditionned or not on the presence of predefined chart pattern. His result is that there is a diference that justifies the use of TA. &lt;/p&gt;&#xA;" OwnerUserId="155" LastActivityDate="2011-02-02T08:47:03.850" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="128" PostTypeId="2" ParentId="103" CreationDate="2011-02-02T10:40:52.510" Score="34" Body="&lt;p&gt;We bet on a fair coin toss -- heads you get $\$100$, tails you get $\$0$. So the expected value is $\$50$. But it is unlikely that you'll pay $\$50$ to play this game because most people are risk averse. If you were risk neutral, then you WOULD pay $\$50$ for an expected value of $\$50$ for an expected net payoff of $\$0$. A risk neutral player will accept risk and play games with expected net payoffs of zero. Or equivalently, a risk neutral player doesn't need a positive expected net payoff to accept risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say that you would pay $\$25$ to play this game. That means if you were risk-neutral, that you'd be assigning probabilities of 1/4 to heads and 3/4 to tails for an expected value of $\$25$ and an expected net payoff of $\$0$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if we can convert from the risk probability measure $(1/2, 1/2)$ to a risk neutral probability measure $(1/4, 3/4)$, then we can price this asset with a simple expectation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you can find the risk neutral measure for an asset based on a set of outcomes, then you can use this measure to easily price other assets as an expected value.&lt;/p&gt;&#xA;" OwnerUserId="106" LastEditorUserId="69" LastEditDate="2011-02-07T03:53:16.317" LastActivityDate="2011-02-07T03:53:16.317" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="129" PostTypeId="2" ParentId="85" CreationDate="2011-02-02T11:05:40.823" Score="4" Body="&lt;p&gt;Maybe you think about other model than a diffusion ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is an article on &lt;a href=&quot;http://www.wilmott.com/detail.cfm?articleID=346&quot; rel=&quot;nofollow&quot;&gt;wilmott.com&lt;/a&gt; about the Korn-Kreer-Lenssen Model.&lt;/p&gt;&#xA;" OwnerUserId="183" LastActivityDate="2011-02-02T11:05:40.823" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="130" PostTypeId="2" ParentId="82" CreationDate="2011-02-02T16:46:15.607" Score="25" Body="&lt;p&gt;I am a big believer in do-it-yourself (DIY) backtesting and data analysis, that is, obtaining your own data and writing your own code.  I use my own simple &lt;a href=&quot;http://www.python.org&quot;&gt;Python&lt;/a&gt; scripts to process, test, analyze, and backtest, starting with text-input data files (either OHLC bars or tick data).  The reason for DIY: in order to have an effective backtest, analysis, etc., you must completely understand all the assumptions, explicit and implicit, that go into the test or analysis.  You must understand how that relates to the trading algorithm you implement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a quick example, people commonly say you must take off a tick or two in backtest results to account for slippage.  However, I have found that for several of my backtest methods, I can actually count on getting better entries, on average, than the backtest.  Whatever the case, I can sleep at night without worrying about someone changing something in the way the software works, which would throw off my tests without me knowing about it.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For algorithm execution, I also use a DIY Java API and Java applications build on the &lt;a href=&quot;http://www.interactivebrokers.com/en/pagemap/pagemap_APISolutions.php&quot;&gt;TWS API&lt;/a&gt;.  However, the reason for that is just to save a few bucks.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Not sure I got this point across, but there is an intimate connection between back-test code, historical data, execution code, and real-time data.  The relationship is different depending on what you are doing and what you are using, but it always important to understand the relationship. &lt;/p&gt;&#xA;" OwnerUserId="47" LastEditorUserId="47" LastEditDate="2011-02-03T17:00:24.420" LastActivityDate="2011-02-03T17:00:24.420" CommentCount="7" CommunityOwnedDate="2011-02-04T16:47:38.160" ContentLicense="CC BY-SA 2.5" />
  <row Id="131" PostTypeId="1" AcceptedAnswerId="132" CreationDate="2011-02-02T18:13:38.567" Score="22" ViewCount="2493" Body="&lt;p&gt;I am currently trading futures products on some contracts that have low volumes. More accurately, the volumes of working orders in the book are fairly light. I am trying to execute a relatively large order that could move the market. I would like to break the order up to prevent this but I am unsure of the best algorithm to do it. I know there are iceberg orders but is there any other way to do this?&lt;/p&gt;&#xA;" OwnerUserId="176" LastEditorUserId="1106" LastEditDate="2011-10-18T11:55:06.570" LastActivityDate="2011-10-18T16:41:17.603" Title="How to execute a large futures order?" Tags="&lt;futures&gt;&lt;order-execution&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="132" PostTypeId="2" ParentId="131" CreationDate="2011-02-02T21:04:28.867" Score="7" Body="&lt;p&gt;You are correct that large orders should be algorithmically broken-up. Perhaps the most straightforward algo is the &lt;a href=&quot;http://en.wikipedia.org/wiki/VWAP&quot; rel=&quot;noreferrer&quot;&gt;VWAP&lt;/a&gt; (volume-weighted average price), which most brokers offer. Since a VWAP is easy to compute, the trading details are often transparent to the user.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are more sophisticated algos, like &lt;a href=&quot;http://www.itg.com/news_events/papers/implementation_shortfall.pdf&quot; rel=&quot;noreferrer&quot;&gt;Arrival Price&lt;/a&gt;, though not every broker offers these. Here's a list of common &lt;a href=&quot;http://www.barx.com/futures/algorithmic/index.html&quot; rel=&quot;noreferrer&quot;&gt;broker algos&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, refrain from submitting a standard market order for a large number of contracts and you should be alright.&lt;/p&gt;&#xA;" OwnerUserId="35" LastEditorUserId="35" LastEditDate="2011-02-02T21:14:49.927" LastActivityDate="2011-02-02T21:14:49.927" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="133" PostTypeId="1" CreationDate="2011-02-02T22:16:43.913" Score="35" ViewCount="1100" Body="&lt;p&gt;Weak schemes, such as &lt;a href=&quot;https://wiki.duke.edu/download/attachments/9505461/Ninomiya+and+Victoir+-+2008+-+Weak+approximation+of+stochastic+differential+equa.pdf?version=1&quot;&gt;Ninomiya-Victoir&lt;/a&gt; or Ninomiya-Ninomiya, are typically used for discretization of stochastic volatility models such as the &lt;a href=&quot;http://en.wikipedia.org/wiki/Heston_model&quot;&gt;Heston Model&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone familiar with &lt;a href=&quot;http://www.math.hu-berlin.de/~finance/papers/victoir1.pdf&quot;&gt;Cubature on Wiener Spaces&lt;/a&gt; explain why (i.e. with a detailed proof or a reference) these weak schemes can be seen as a Cubature scheme over Wiener Spaces?&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="1106" LastEditDate="2011-09-21T14:50:40.987" LastActivityDate="2012-10-10T13:40:13.027" Title="How to show that this weak scheme is a cubature scheme?" Tags="&lt;option-pricing&gt;&lt;stochastic-volatility&gt;" AnswerCount="0" CommentCount="9" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="134" PostTypeId="1" AcceptedAnswerId="135" CreationDate="2011-02-02T22:35:46.180" Score="27" ViewCount="1612" Body="&lt;p&gt;The sensitivity of the option value $V$ to volatility $\sigma$ (a.k.a. vega) is different from the other greeks. It is a derivative with respect to a parameter and not a variable. To quote from &lt;em&gt;Paul Wilmott On Quantitative Finance&lt;/em&gt; (Wiley, 2nd edition, p. 127):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;It’s not even Greek. Among other things it is an American car, a star (Alpha Lyrae), the real name of Zorro, there are a couple of 16th century Spanish authors called Vega, an Op art painting by Vasarely and a character in the computer game ‘Street Fighter.’ And who could forget Vincent, and his brother?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question.&lt;/strong&gt; Does anyone know who has suggested to use the term &lt;em&gt;vega&lt;/em&gt; for $\frac{\partial V}{\partial\sigma}$ and why it was named this way?&lt;/p&gt;&#xA;" OwnerUserId="70" LastEditorUserId="2183" LastEditDate="2017-06-26T09:35:45.790" LastActivityDate="2019-08-20T20:30:35.937" Title="Who has introduced the term 'vega' and why?" Tags="&lt;options&gt;&lt;greeks&gt;&lt;history&gt;&lt;terminology&gt;" AnswerCount="4" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="135" PostTypeId="2" ParentId="134" CreationDate="2011-02-03T01:01:44.647" Score="15" Body="&lt;p&gt;I dusted off my oldest option theory books and searched the indexes for &quot;vega&quot;. The oldest reference I found was in &lt;em&gt;Option Volatility and Pricing Strategies&lt;/em&gt; (1st ed.) by Sheldon Natenberg, copyright 1988. When discussing the sensitivity of prices to volatility (p. 132), he says,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;[T]here is no single commonly accepted&#xA;  term for this number. It is sometimes&#xA;  referred to as vega, kappa, omega,&#xA;  zeta or sigma prime.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Continuing, he adds (p. 134),&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Because several computer services&#xA;  popular among traders use the term&#xA;  vega, we will also use this term to&#xA;  refer to an option's change in&#xA;  theoretical value with respect to a&#xA;  change in volatility.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;At the time, a popular option pricing service was the Schwartzatron (yes, that was the name), later purchased by Reuters. I have a dim memory that it used the term &quot;vega&quot;. Natenberg may have been referring to that service, maybe some other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's the oldest reference I can find. Perhaps someone can find an older one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(PS - I still don't have a clue &lt;em&gt;why&lt;/em&gt; they called it &quot;vega&quot;.)&lt;/p&gt;&#xA;" OwnerUserId="37" LastActivityDate="2011-02-03T01:01:44.647" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="136" PostTypeId="2" ParentId="41" CreationDate="2011-02-03T01:26:22.683" Score="9" Body="&lt;p&gt;Technically, yes, the VIX is a measure of implied volatility. But practically speaking, it is a measure of market &lt;em&gt;uncertainty&lt;/em&gt;: when market participants are uncertain of the future, they buy options to protect their positions, driving up option premiums and increasing implied volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The broader market hates uncertainty, however, so that same uncertainty drives some participants to sell off their holdings or, at least, stop buying. That drives down market prices, creating a correlation between rising implied volatility and falling prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want a &quot;more pure&quot; volatility index, perhaps &lt;a href=&quot;http://en.wikipedia.org/wiki/Realized_variance&quot;&gt;realized variance&lt;/a&gt; could be useful to you. That is a backward-looking measure, of course, but any forward-looking measure will inevitably be tainted by people's emotions and, hence, less pure.&lt;/p&gt;&#xA;" OwnerUserId="37" LastActivityDate="2011-02-03T01:26:22.683" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="137" PostTypeId="2" ParentId="41" CreationDate="2011-02-03T02:05:59.397" Score="7" Body="&lt;p&gt;VIX is &lt;a href=&quot;http://www.cboe.com/micro/vix/vixwhite.pdf&quot;&gt;mechanically determined&lt;/a&gt; from the price of S&amp;amp;P500 call and put options. So if the demands for S&amp;amp;P500 calls/puts rise, then the prices rise, then the implied vol from these options rises. During a down market there's a lot of demand for portfolio protection. If you're diversified, then S&amp;amp;P500 puts are good protection, so the prices for puts rise and the implied vol from puts rises. The vol rise from puts drives the VIX up. In most cases the implied vol from calls probably contributes, too, but it's the puts driving VIX.&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-02-03T02:05:59.397" CommentCount="5" ContentLicense="CC BY-SA 2.5" />
  <row Id="138" PostTypeId="2" ParentId="134" CreationDate="2011-02-03T02:14:38.197" Score="6" Body="&lt;p&gt;I have no reference, but it's largely phonetic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Must variables in econ/finance are Greek versions English letter you'd want to use. $\omega$ for weight, $\rho$ for rate, $\epsilon$ for error, and so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Vega is partial derivative of price with respect to &lt;em&gt;V&lt;/em&gt; olatility. But there's no Greek letter for V. Vega sounds kind of Greek.&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-02-03T02:14:38.197" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="139" PostTypeId="1" AcceptedAnswerId="143" CreationDate="2011-02-03T03:43:04.120" Score="35" ViewCount="9056" Body="&lt;p&gt;One cannot directly buy and sell the VIX index. Theoretically, however, one could approximate the index by purchasing an at-the-money straddle on the SP500, then delta-hedging the straddle.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Does anyone have experience with such a &quot;synthetic&quot; replication of the index?&lt;/strong&gt; It might be very useful for betting on volatility or for spreads against the VIX futures (a sort of basis trade), but I can see potential problems if the replication is too inaccurate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(To anticipate your comments: I'm aware of the many VIX-related ETFs; but, no, I would not consider using them. I'm also aware that the VIX calculation uses other strikes beyond the ATM options; this proposed synthetic is admittedly an approximation.)&lt;/p&gt;&#xA;" OwnerUserId="37" LastActivityDate="2014-03-14T08:18:25.690" Title="Trading a synthetic replication of the VIX index" Tags="&lt;vix&gt;&lt;delta-neutral&gt;" AnswerCount="5" CommentCount="7" FavoriteCount="16" ContentLicense="CC BY-SA 2.5" />
  <row Id="140" PostTypeId="1" AcceptedAnswerId="191" CreationDate="2011-02-03T08:11:53.253" Score="36" ViewCount="5614" Body="&lt;p&gt;Are there common procedures prior or posterior backtesting to ensure that a quantitative trading strategy has real predictive power and is not just one of the thing that has worked in the past by pure luck? Surely if we search long enough for working strategies we will end up finding one. Even in a walk forward approach that doesn't tell us anything about the strategy in itself. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some people talk about white's reality check but there are no consensus in that matter.&lt;/p&gt;&#xA;" OwnerUserId="155" LastEditorUserId="356" LastEditDate="2011-04-07T02:35:14.510" LastActivityDate="2011-04-07T02:35:14.510" Title="What are the popular methodologies to minimize data snooping?" Tags="&lt;backtesting&gt;&lt;strategy&gt;" AnswerCount="6" CommentCount="2" FavoriteCount="29" ContentLicense="CC BY-SA 2.5" />
  <row Id="141" PostTypeId="1" AcceptedAnswerId="168" CreationDate="2011-02-03T13:31:00.310" Score="296" ViewCount="223298" Body="&lt;p&gt;What sources of financial and economic data are available online? Which ones are free or cheap? What has your experience been like with these data sources?&lt;/p&gt;&#xA;" OwnerUserId="188" LastEditorUserId="743" LastEditDate="2015-10-22T20:20:52.383" LastActivityDate="2021-04-08T18:31:19.133" Title="What data sources are available online?" Tags="&lt;data&gt;&lt;finance&gt;&lt;economics&gt;&lt;data-source&gt;" AnswerCount="31" CommentCount="7" FavoriteCount="517" CommunityOwnedDate="2011-02-08T19:10:45.013" ContentLicense="CC BY-SA 3.0" />
  <row Id="142" PostTypeId="2" ParentId="140" CreationDate="2011-02-03T14:41:05.943" Score="17" Body="&lt;p&gt;Building an effective backtest is not significantly different than building any other kind of predictive model.  The goal is to have similar behavior &lt;em&gt;out of sample&lt;/em&gt; as you have &lt;em&gt;in sample&lt;/em&gt;.  As such, there are methodologies developed in statistics and machine learning that can be useful: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Understand the bias/variance tradeoff.  This is covered in many places.  For a technical discussion, see &lt;a href=&quot;http://videolectures.net/stanfordcs229f08_ng_lec09/&quot;&gt;lecture 9 of Andrew Ng's machine learning class at Stanford&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;You can certainly use a training and test dataset.  But there are also other kinds of approaches that can be used.  To list two common options: &lt;a href=&quot;http://en.wikipedia.org/wiki/Cross-validation_%28statistics%29&quot;&gt;cross-validation&lt;/a&gt; (similar to having segmented data, but can help with parameter selection) and &lt;a href=&quot;http://en.wikipedia.org/wiki/Machine_learning_ensemble&quot;&gt;ensemble methods&lt;/a&gt; (using multiple models can outperform just one and further reduce the curve-fitting problem).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So a few general recommendations:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Your guiding principle should be &lt;a href=&quot;http://en.wikipedia.org/wiki/Occam%27s_razor#Science_and_the_scientific_method&quot;&gt;&lt;strong&gt;Einstein's razor&lt;/strong&gt;&lt;/a&gt;:  'Everything should be kept as simple as possible, but no simpler.'  In other words, less degrees of freedom in your model equates to less chance for overfitting.  In the statistics world, this can involve eliminating unnecessary parameters through a &lt;a href=&quot;http://en.wikipedia.org/wiki/Feature_selection&quot;&gt;selection&lt;/a&gt; or &lt;a href=&quot;http://en.wikipedia.org/wiki/Regularization_%28mathematics%29&quot;&gt;regularization&lt;/a&gt; method.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Robustness&lt;/strong&gt; (in every respect) is also critical.  Parameters that result in sharp changes in expected prediction error will be more open to the risk of overfitting.  Similarly, if the model has no fundamental basis, then it should be applicable to a wide number of assets.  &lt;/li&gt;&#xA;&lt;li&gt;Lastly, this applies to any kind of model: understand your data, your model, your objectives, assumptions, etc.  There have been countless mistakes made over time from people not understanding the meaning of their models, implications, and risks.  This includes things like execution assumptions and transaction costs.  Make sure that you take everything into account.  Lead by being skeptical of your data, constantly asking what can go wrong, or how can the future be different.  Is there any &lt;a href=&quot;http://en.wikipedia.org/wiki/Survivorship_bias&quot;&gt;survivorship bias&lt;/a&gt; in your data, and if so, how can you control for it?  Have you introduced any look-ahead bias?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="17" LastEditorUserId="17" LastEditDate="2011-02-03T14:46:06.013" LastActivityDate="2011-02-03T14:46:06.013" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="143" PostTypeId="2" ParentId="139" CreationDate="2011-02-03T14:59:55.217" Score="18" Body="&lt;p&gt;A synthetic model for the VIX would be quite useful.  I just mention this since it has been covered elsewhere in the past, although I don't think that it's a real solution to your problem (for a number of reasons).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Several blogs posted on the &quot;William's VIX Fix&quot; (WVF) in the past: &lt;a href=&quot;http://marketsci.wordpress.com/2010/09/04/williams%E2%80%99-vix-fix/&quot; rel=&quot;noreferrer&quot;&gt;marketsci&lt;/a&gt;, &lt;a href=&quot;http://www.tradingtheodds.com/2010/09/williams%E2%80%99-vix-fix/&quot; rel=&quot;noreferrer&quot;&gt;trading the odds&lt;/a&gt;, &lt;a href=&quot;http://davesbrain.blogs.com/mindmoneymarkets/2010/08/ftse-returns-volatility.html&quot; rel=&quot;noreferrer&quot;&gt;mindmoneymarkets&lt;/a&gt;.  The WVF is intended to be a synthetic VIX calculation, derived by &lt;a href=&quot;http://en.wikipedia.org/wiki/Larry_R._Williams&quot; rel=&quot;noreferrer&quot;&gt;Larry Williams&lt;/a&gt; (see &lt;a href=&quot;http://www.ireallytrade.com/newsletters/VIXFix.pdf&quot; rel=&quot;noreferrer&quot;&gt;the original article here&lt;/a&gt;), and is represented by the following formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$wvf = \frac{Highest(Close, 22) - Low}{Highest(Close, 22)} * 100$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In R, this can be represented as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;wvf &amp;lt;- function(x, n=22) {&#xA;  hc &amp;lt;- as.xts(rollmax(as.zoo(Cl(x)), k=n, align=&quot;right&quot;))&#xA;  100*(hc-Lo(x))/hc&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This has had a reasonable correlation to the VIX: from 1995-2010 it was +0.75:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/leCx0.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="2257" LastEditDate="2012-10-09T01:18:28.140" LastActivityDate="2012-10-09T01:18:28.140" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="144" PostTypeId="2" ParentId="140" CreationDate="2011-02-03T15:01:54.137" Score="7" Body="&lt;p&gt;The output of your model will be a realization of your assumptions. Shane's given you a great answer. Besides doing out of sample testing (i.e., calibrating on period X then testing in period Y only using info available at the time of each trade), I would add that you should test it in sub-periods. If you have a big chunk of data, break it up and see how it works on each subset of the data. &lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-02-03T15:01:54.137" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="145" PostTypeId="2" ParentId="82" CreationDate="2011-02-03T15:27:43.917" Score="0" Body="&lt;p&gt;I have found NinjaTrader to be a very powerful free platform, but as I needed to add support for options, I ended developing and backtesting strategies.  I haven't gotten to the point of doing to automated trading yet, but I have read it is possible.&lt;br&gt;&#xA;Brian&lt;/p&gt;&#xA;" OwnerUserId="123" LastActivityDate="2011-02-03T15:27:43.917" CommentCount="0" CommunityOwnedDate="2011-02-04T16:47:38.160" ContentLicense="CC BY-SA 2.5" />
  <row Id="146" PostTypeId="2" ParentId="140" CreationDate="2011-02-03T15:44:30.997" Score="-2" Body="&lt;p&gt;Thanks for the answer as it tackles a lot of backtesting flaws, model parsimony, overfitting, survivorship bias, look ahead...&#xA;But actually one can look at thousands of technical trading rules and other more sofisticated strategies, and maybe find the few ones that will answer all these problems. Nevetheless we would still be left with data snooping ie we have used our data set untill we find a satisfactory result.   &lt;/p&gt;&#xA;" OwnerUserId="155" LastActivityDate="2011-02-03T15:44:30.997" CommentCount="7" ContentLicense="CC BY-SA 2.5" />
  <row Id="147" PostTypeId="1" CreationDate="2011-02-03T16:28:51.397" Score="47" ViewCount="3330" Body="&lt;p&gt;Prompted in part by &lt;a href=&quot;https://quant.stackexchange.com/questions/140/what-are-the-popular-methodologies-to-minimize-data-snooping&quot;&gt;this question on data snooping&lt;/a&gt;, I would be interested to know:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the key risks that should be considered when developing a quantitative strategy based on: (a) historical data or (b) simulated data?&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2014-06-06T09:45:59.160" Title="What are the key risks to the quantitative strategy development process?" Tags="&lt;backtesting&gt;&lt;risk-management&gt;" AnswerCount="5" CommentCount="2" FavoriteCount="32" ContentLicense="CC BY-SA 2.5" />
  <row Id="148" PostTypeId="1" AcceptedAnswerId="153" CreationDate="2011-02-03T16:37:44.127" Score="28" ViewCount="7079" Body="&lt;p&gt;I work with practical, day-to-day trading: just making money. One of my small clients recently hired a smart, new MFE. We discussed potential trading strategies for a long time. Finally, he expressed surprise that I never mentioned (much less used) stochastic calculus, which he spent many long hours studying in his MFE program. I use the products of stochastic calculus (e.g., the Black-Scholes equation) but not the calculus itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I am wondering, &lt;strong&gt;does stochastic calculus play a role in day-to-day trading strategies?&lt;/strong&gt; Am I under-utilizing a potentially valuable tool?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this client was a Wall Street investment bank that was making markets in complicated derivatives, I'm sure their research department would use stochastic calculus for modeling. But they're not, so I'm not sure how we would use stochastic calculus.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(&lt;em&gt;Full disclosure:&lt;/em&gt; I have Masters degrees but not a PhD. I'm an applied mathematician, not a theoretician.)&lt;/p&gt;&#xA;" OwnerUserId="37" LastActivityDate="2011-02-03T19:00:48.793" Title="What is the role of stochastic calculus in day-to-day trading?" Tags="&lt;differential-equations&gt;&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="11" ContentLicense="CC BY-SA 2.5" />
  <row Id="149" PostTypeId="2" ParentId="141" CreationDate="2011-02-03T16:57:52.177" Score="21" Body="&lt;p&gt;I'm only aware about 3 free data sources of which 1 is still working in June 2018: &#xA; - &lt;a href=&quot;http://ratedata.gaincapital.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;GAIN Capital&lt;/a&gt;. It contains infomation about FX rates only&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below ones are not available anymore:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.euronext.com/trader/priceslists/priceslistsbonds-1919-EN.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;s&gt;EuroNext&lt;/s&gt;&lt;/a&gt;. Bonds and Equities are available. &quot;Search by Criteria&quot; -&gt; select  instrument -&gt; &quot;Data downloads&quot;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.databank.rbs.com/default.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;s&gt;RBS Databank&lt;/s&gt;&lt;/a&gt;. Interest rates, FX rate, commodities and CPI&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="15" LastEditorUserId="31793" LastEditDate="2018-06-18T23:40:24.903" LastActivityDate="2018-06-18T23:40:24.903" CommentCount="2" CommunityOwnedDate="2011-02-08T19:10:45.013" ContentLicense="CC BY-SA 4.0" />
  <row Id="150" PostTypeId="2" ParentId="147" CreationDate="2011-02-03T17:05:09.967" Score="43" Body="&lt;p&gt;Here are a few risks when using historical data:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;Data fidelity:&lt;/em&gt; Is your data an accurate reflection of history? For stocks, should you use actual closing prices or adjusted prices? For futures, how should you construct a realistic, continuous contract?&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;Simulation realism:&lt;/em&gt; Are you making realistic assumptions about trade execution? Are you naively assuming, for example, that you can perfectly execute at the day's closing price? Did you remember frictional costs?&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;Sampling variability:&lt;/em&gt; Is your historical sample representative of a wide range of market conditions, or did you (happen to) pick a favorable dataset?&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;Curve fitting:&lt;/em&gt; Did you fiddle with too many parameters for too long, eventually finding a model that worked great last year but won't make a penny in the future?&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;Optimism:&lt;/em&gt; Your actual profits will likely be only a fraction of your simulated profits. Are you assuming otherwise?&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;Model risk:&lt;/em&gt; Even if your model back-tests well, what is it's half-life? How long will it be tradable? Very few ideas work forever.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This is not a theoretical list. I've made all these mistakes personally.&lt;/p&gt;&#xA;" OwnerUserId="37" LastActivityDate="2011-02-03T17:05:09.967" CommentCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="151" PostTypeId="2" ParentId="147" CreationDate="2011-02-03T17:06:25.547" Score="12" Body="&lt;p&gt;&lt;strong&gt;Accuracy&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The trader must make sure the data is not only right, but that the timestamps are useable. That's why a good data warehouse will be &lt;em&gt;bitemporal&lt;/em&gt; or &lt;em&gt;point-in-time&lt;/em&gt;. Thus, we know not only when the item was announced, but when we received it and could act on it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Gaps&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An aggressive safety check on incoming data might inadvertently exclude correct data. For example, a tick-capture that compares today's opening price against yesterday's closing price might exclude legitimate bankruptcy notices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Retro-fitting&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The desk's manager must guard against data mining and other techniques that can cause look-ahead bias. I worked for one hedge fund that required traders to submit their models weeks before production so they could be backtested again without the benefit of hindsight.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-02-03T17:06:25.547" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="152" PostTypeId="1" CreationDate="2011-02-03T18:06:20.490" Score="11" ViewCount="527" Body="&lt;p&gt;When faced with a black box trading strategy with extensive historical data available, how would one select/construct a representative benchmark? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a trivial example, when a strategy historically consists only of long trades on tech stock, the Nasdaq Composite index might be a suitable benchmark. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What about benchmarks for strategies that do not exhibit such clear tendencies in the types of trades they perform?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can imagine constructing a composite benchmark would be appropriate. Which guidelines/ frameworks/methodologies are applicable?&lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2011-02-03T19:10:34.633" Title="How to select/construct benchmarks for black-box trading strategies?" Tags="&lt;trading&gt;&lt;strategy&gt;&lt;benchmark&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="153" PostTypeId="2" ParentId="148" CreationDate="2011-02-03T18:50:12.893" Score="23" Body="&lt;p&gt;This is pure speculation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;MFE's are really tailored toward valuation models (how can we develop a model to price x swap, etc.).  You don't entirely have to worry about those details in order to trade them: you're just quoted a price based on these models.  But if you go in-house at a bank and are working as a product quant (structured products, etc.), then you really need to worry about these things.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, it could be relevant to a trading strategy if you think that the current model is mispricing things and there's an arbitrage opportunity.  This is why banks have put so much effort into having good models, and jump at opportunities for very minor improvements.  This kind of behavior is documented in Derman's &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0471394203&quot;&gt;&quot;My Life as a Quant&quot;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Short of that, if you are simply trading an asset in order to gain a specific kind of exposure, stochastic calculus is not really used very much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a final note, I would point to the draft of Steven Shreve's &lt;a href=&quot;http://www.stat.berkeley.edu/users/evans/shreve.pdf&quot;&gt;&quot;Stochastic Calculus and Finance&quot;&lt;/a&gt; as a free reference, if you're looking for one.&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="17" LastEditDate="2011-02-03T19:00:48.793" LastActivityDate="2011-02-03T19:00:48.793" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="154" PostTypeId="2" ParentId="152" CreationDate="2011-02-03T19:10:34.633" Score="4" Body="&lt;p&gt;Clearly, it's much more difficult than for a white-box strategy.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But you still have some information: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;What is the return profile?&lt;/li&gt;&#xA;&lt;li&gt;What is the average holding period?&lt;/li&gt;&#xA;&lt;li&gt;Does it go long/short?&lt;/li&gt;&#xA;&lt;li&gt;What assets are traded?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Now you can choose a benchmark of an index that matches these criteria as closely as possible.  If an appropriate benchmark doesn't exist, then you can create one: produce a very simple model that characterizes the return profile and run it as your own index (just for benchmarking purposes).  &lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2011-02-03T19:10:34.633" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="155" PostTypeId="2" ParentId="60" CreationDate="2011-02-03T19:47:03.307" Score="8" Body="&lt;p&gt;Your question's title suggests the market prices are mean reverting. I &lt;em&gt;strongly&lt;/em&gt; suggest verifying that assumption via one of the usual tests, such as the Augmented Dickey-Fuller test (implemented in the tseries package of R by the adf.test function, and in other R packages, too).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the market is truly mean reverting, a possible strategy is&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Detrend the data.&lt;/li&gt;&#xA;&lt;li&gt;Monitor the market for an extreme high or extreme low, based on its historical range.&lt;/li&gt;&#xA;&lt;li&gt;Buy or sell-short the market at those extremes.&lt;/li&gt;&#xA;&lt;li&gt;Cover at a logical point: at the mean or at the half-way point, for example.&lt;/li&gt;&#xA;&lt;li&gt;Repeat.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Detrending is useful to eliminate the long-term trend (in stocks) or eliminate the effects of carry (in futures). &quot;Extreme highs&quot; and &quot;extreme lows&quot; must really be extreme: I look for prices in the upper 90 to 95th percentile or lower 10th to 5th percentile, based on a few years of history.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Buying or selling-short at the extremes is fine ... unless the market decides to exceed its historical limits, in which case you'll experience drawdown, potentially large. I use a momentum filter and that helps but it's not perfect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My experience is mostly in trading mean-reverting spreads. Your mileage may vary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(PS - I found no connection between the RSI indicator and mean reversion. I don't use it.)&lt;/p&gt;&#xA;" OwnerUserId="37" LastActivityDate="2011-02-03T19:47:03.307" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="156" PostTypeId="1" CreationDate="2011-02-03T21:16:21.317" Score="106" ViewCount="13677" Body="&lt;p&gt;There are a few things that form the common canon of education in (quantitative) finance, yet everybody knows they are not exactly true, useful, well-behaved, or empirically supported.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So here is the question: which is the single worst idea still actively propagated?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please make it one suggestion per post.&lt;/p&gt;&#xA;" OwnerUserId="69" LastEditorUserId="69" LastEditDate="2011-02-03T21:39:50.437" LastActivityDate="2016-08-16T16:32:37.103" Title="What concepts are the most dangerous ones in quantitative finance work?" Tags="&lt;theory&gt;&lt;research&gt;" AnswerCount="16" CommentCount="1" FavoriteCount="105" CommunityOwnedDate="2011-02-07T04:12:33.263" ContentLicense="CC BY-SA 2.5" />
  <row Id="157" PostTypeId="2" ParentId="156" CreationDate="2011-02-03T21:21:36.933" Score="52" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;CAPM as an allocation strategy.  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Market efficiency was predicated on several falicious ideas, including:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Everyone can borrow (and lend) at the same rate, indefinitely (i.e. no matter their leverage)&lt;/li&gt;&#xA;&lt;li&gt;All information is known instantaneously by all market participants.&lt;/li&gt;&#xA;&lt;li&gt;There are no transaction costs.&lt;/li&gt;&#xA;&lt;li&gt;Rational behavior.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;One conclusion is that the higher the beta, the higher the return, but this has clearly been shown to be violated.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;While it is useful for segmenting $\alpha$ and $\beta$ (and for portfolio/strategy evaluation), it simply isn't entirely reliable as a portfolio allocation strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As Fama/French concluded in &lt;a href=&quot;http://www1.american.edu/academic.depts/ksb/finance_realestate/mrobe/Library/capm_Fama_French_JEP04.pdf&quot;&gt;&quot;The Capital Asset Pricing Model: Theory and Evidence&quot;&lt;/a&gt; (2004):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The CAPM, like Markowitz's (1952,&#xA;  1959) portfolio model on which it is&#xA;  built, is nevertheless a theoretical&#xA;  tour de force. We continue to teach&#xA;  the CAPM as an introduction to the&#xA;  fundamental concepts of portfolio&#xA;  theory and asset pricing, to be built&#xA;  on by more complicated models like&#xA;  Merton's (1973) ICAPM. But we also&#xA;  warn students that despite its&#xA;  seductive simplicity, the CAPM's&#xA;  empirical problems probably invalidate&#xA;  its use in applications.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Note that CAPM adds many assumptions to Markowitz's fundamental model to built itself. Therein lies its fallacy because as said above, those are difficult assumptions. Markowitz' model itself is fairly general in that you can inject 'views' of higher returns or greater volatility etc into the basic framework (or not!) and still be quite rooted in reality for mid-long term horizons. &lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="3509" LastEditDate="2013-01-07T18:21:44.930" LastActivityDate="2013-01-07T18:21:44.930" CommentCount="7" CommunityOwnedDate="2011-03-11T10:26:49.370" ContentLicense="CC BY-SA 3.0" />
  <row Id="158" PostTypeId="2" ParentId="156" CreationDate="2011-02-03T21:22:26.737" Score="46" Body="&lt;p&gt;Everybody's favourite whipping boy: Identically and independently distributed returns, i.e. draws from $N(\mu, \sigma)$ to describe returns.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We could of course split this is arguing&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;identically distributed (and mixture modeling as well as robust methods help)&lt;/li&gt;&#xA;&lt;li&gt;independently distributed (and everybody agrees that there is &lt;em&gt;some&lt;/em&gt; serial correlation though a formal good model is hard to come by)&lt;/li&gt;&#xA;&lt;li&gt;the Normal assumption (and everybody agrees on fatter tails) yet $N(\mu, \sigma)$ makes things so temptingly &lt;em&gt;tractable&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="69" LastEditorUserId="6947" LastEditDate="2015-01-09T16:23:15.070" LastActivityDate="2015-01-09T16:23:15.070" CommentCount="1" CommunityOwnedDate="2011-03-11T10:27:06.063" ContentLicense="CC BY-SA 3.0" />
  <row Id="159" PostTypeId="2" ParentId="35" CreationDate="2011-02-03T22:42:01.747" Score="5" Body="&lt;p&gt;By William Bernstein, &lt;a href=&quot;http://www.efficientfrontier.com/ef/499/scg.htm&quot;&gt;source&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In June of 1992 academicians Eugene&#xA;  Fama and Kenneth French (&quot;F/F&quot;) rocked&#xA;  the investing world with a study&#xA;  published in the Journal of Finance,&#xA;  innocuously entitled &lt;em&gt;&quot;The&#xA;  Cross-Section of Expected Stock&#xA;  Returns.&quot;&lt;/em&gt; The piece is the cognitive&#xA;  equivalent of an enormous hunk of&#xA;  marzipan cake which sits in your&#xA;  freezer for months—there’s no way&#xA;  you’ll get through it in one whack,&#xA;  and is properly consumed only in small&#xA;  sittings. In fact, unless you’ve&#xA;  gotten considerably beyond Stat 101,&#xA;  it’s probably best avoided. So, here’s&#xA;  the short course:&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;&quot;Beta,&quot; the measure of market exposure of a given stock or&#xA;  portfolio, which was previously&#xA;  thought to be the be-all/end-all&#xA;  measurement of stock risk/return, is&#xA;  of only limited use. &lt;strong&gt;F/F convincingly&#xA;  showed that this parameter did not&#xA;  predict the returns of all equity&#xA;  portfolios, although it is still&#xA;  useful in predicting the return of&#xA;  stock/bond and stock/cash mixes.&lt;/strong&gt;&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;so it depends on the type of portfolio, more info in the paper in italics.&lt;/p&gt;&#xA;" OwnerUserId="189" LastEditorUserId="189" LastEditDate="2011-02-03T22:47:23.643" LastActivityDate="2011-02-03T22:47:23.643" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="160" PostTypeId="2" ParentId="141" CreationDate="2011-02-03T23:00:56.373" Score="15" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;-- (historical) stock prices --&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What do you mean by that? Nominal, real, corrected due to monetary-base-change, corrections with Y-other-things? What is your goal?&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I have been able to download (historical) stock prices via yahoo and google. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Alas looking historical data from Google/Yahoo's screeners can be highly misleading and making conclusion based on it very dangerous. Please, note that you cannot always trust the data, sometimes they are nominal or real, and sometimes you won't know the type of data. Google/Yahoo are only third-parties to provide you the historical data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Commercial Data&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.csidata.com/&quot;&gt;CSI Data&lt;/a&gt;: it claims to be the provider to Google, Yahoo, Microsoft and other resellers&lt;/li&gt;&#xA;&lt;li&gt;Yahoo's providers &lt;a href=&quot;http://help.yahoo.com/l/us/yahoo/finance/quotes/fitadelay.html&quot;&gt;here&lt;/a&gt; and notice the small writings at the bottom &lt;a href=&quot;http://finance.yahoo.com/&quot;&gt;here&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Educational and Research Data&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.econ.yale.edu/~shiller/data.htm&quot;&gt;Shiller Data&lt;/a&gt; about stock market data&lt;/li&gt;&#xA;&lt;li&gt;the huge data collection by Ibbotson, book, inflation, interest rates and such things which you must take into account to do any serious research&lt;/li&gt;&#xA;&lt;li&gt;Yale databases (massive work done) &lt;a href=&quot;http://icf.som.yale.edu/stock-market-confidence-indices&quot;&gt;here&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Intelligent Asset Allocator -book, by William Bernstein, in the very end has a summary of very good data sources&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="189" LastEditorUserId="189" LastEditDate="2011-02-03T23:23:27.313" LastActivityDate="2011-02-03T23:23:27.313" CommentCount="1" CommunityOwnedDate="2011-02-08T19:10:45.013" ContentLicense="CC BY-SA 2.5" />
  <row Id="161" PostTypeId="2" ParentId="156" CreationDate="2011-02-03T23:05:51.547" Score="20" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Perfect delta hedging&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I my opinion delta hedging is also a dangerous one, but it definitely should teach though. In the BS framework, it is an allegedly perfect way of covering the risk incurred by buying (or selling) a derivative product (such as call and put in simplest cases). Nevertheless due to several real world facts this doesn't work that well in practice :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;discrete time rebalancing of porfolio &lt;/li&gt;&#xA;&lt;li&gt;constant volatility so much things have been said on this I won't comment any further&lt;/li&gt;&#xA;&lt;li&gt;possibility of market jumps (not little ones) this affects deeply your&#xA;daily P&amp;amp;L&lt;/li&gt;&#xA;&lt;li&gt;transction costs affects the cost of the rebalancing portfolio in a way&#xA;that is not negligeable&lt;/li&gt;&#xA;&lt;li&gt;liquidity, if you are holding big positions in derivatives, your delta&#xA;hedging will impact the price dynamics&lt;/li&gt;&#xA;&lt;li&gt;etc...&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The main advantage of the BS delta hedging is that it presents though the big principles of hedging the rest is a matter of sophistication and derivatives trader's vista (or chance).&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="2543" LastEditDate="2013-03-01T14:37:51.537" LastActivityDate="2013-03-01T14:37:51.537" CommentCount="1" CommunityOwnedDate="2011-03-11T10:27:38.280" ContentLicense="CC BY-SA 3.0" />
  <row Id="162" PostTypeId="1" AcceptedAnswerId="1866" CreationDate="2011-02-03T23:23:39.660" Score="17" ViewCount="1196" Body="&lt;p&gt;I'd like to get a feel for the operating parameters of official market makers. I'm looking more for discerning characteristics, rather than exact numbers or an exhaustive list of each MM. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Examples: what is their working capital? How much leverage do they use intraday? What returns do they achieve? What is their contribution to trade volume? How to these numbers compare to other market participants? &lt;/p&gt;&#xA;" OwnerUserId="53" LastEditorUserId="1355" LastEditDate="2011-09-08T20:46:30.100" LastActivityDate="2015-10-22T12:51:41.340" Title="Operating parameters of market makers?" Tags="&lt;models&gt;&lt;market-making&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 2.5" />
  <row Id="163" PostTypeId="2" ParentId="156" CreationDate="2011-02-03T23:41:09.677" Score="8" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;To trust yourself.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Concepts must be based on logical ideas and proper premises. It is easy to forget a premise and then misuse a model such as CAPM as asset-allocation method as suggested by &lt;a href=&quot;https://quant.stackexchange.com/questions/156/what-concepts-are-the-most-dangerous-ones-in-quantitative-finance-work/157#157&quot;&gt;Shane&lt;/a&gt; so &lt;code&gt;Y-Recheck-things&lt;/code&gt;. Do not make things personal. Do not abuse models with too complicated schemes (you may abuse some basic assumption) -- and even then don't expect pretend &lt;code&gt;to know&lt;/code&gt;, rather &lt;code&gt;to engineer&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="189" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2011-05-31T22:04:59.340" CommentCount="0" CommunityOwnedDate="2011-03-11T10:28:15.800" ContentLicense="CC BY-SA 3.0" />
  <row Id="164" PostTypeId="2" ParentId="162" CreationDate="2011-02-04T00:19:03.267" Score="8" Body="&lt;p&gt;&lt;em&gt;Market makers&lt;/em&gt; covers a broad range of shops, from large investment banks to small proprietary trading firms. So working capital can be in the millions or the billions, and leverage can be anywhere from 2x to 30x. This is no different from buy-side firms, which includes a variety of both asset managers and retail investors. There is tons of diversity among market makers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for contribution to volume, a liquidity provider merely quotes a price; the trade doesn't happen until a buy-side counter-party decides to accept. For example, given a trade of 100 shares between a market maker and an asset manager, we wouldn't say that the market maker was responsible for 50 shares of the trade. We would just say that 100 shares were traded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With this in mind, we can claim that the market maker is responsible for &lt;em&gt;all&lt;/em&gt; trading volume, or we can claim that the market maker is responsible for &lt;em&gt;no&lt;/em&gt; trading volume (and that the buy-side firm is responsible for all volume). Either seems plausible.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-02-04T00:19:03.267" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="165" PostTypeId="2" ParentId="156" CreationDate="2011-02-04T00:30:05.933" Score="7" Body="&lt;p&gt;That value stocks are necessarily riskier than growth; that there has to be a hidden risk factor that we haven't yet found. The &lt;a href=&quot;http://www.economics.harvard.edu/faculty/shleifer/files/ContrarianInvestment.pdf&quot;&gt;Lakonishok, Shleifer, and Vishny&lt;/a&gt; abstract says it better than I can:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;For many years, stock market analysts have argued that value strategies outperform the market. These value strategies call for buying stocks that have low prices relative to earnings, dividends, book assets, or other measures of fundamental value. While there is some agreement that value strategies produce higher returns, the interpretation of why they do so is more controversial. This paper provides evidence that value strategies yield higher returns because these strategies exploit the mistakes of the typical investor and not because these strategies are fundamentally riskier.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-02-04T00:30:05.933" CommentCount="1" CommunityOwnedDate="2011-03-11T10:28:27.300" ContentLicense="CC BY-SA 2.5" />
  <row Id="166" PostTypeId="2" ParentId="82" CreationDate="2011-02-04T01:17:03.160" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://www.marketcetera.com/site/products/overview&quot; rel=&quot;nofollow&quot;&gt;Marketcetera.&lt;/a&gt; I haven't tried it yet, so I can't personally comment on its quality. But the website looks great, plus it's an open source. You can download it for free and make some modifications. The platform supports Java, Ruby, and Python.&lt;/p&gt;&#xA;" OwnerDisplayName="user130" LastActivityDate="2011-02-04T01:17:03.160" CommentCount="0" CommunityOwnedDate="2011-02-04T16:47:38.160" ContentLicense="CC BY-SA 2.5" />
  <row Id="167" PostTypeId="2" ParentId="140" CreationDate="2011-02-04T03:45:19.377" Score="9" Body="&lt;p&gt;I have seen Hansen's SPA ('Superior Predictive Ability') test and stepwise variants used for this purpose. Hansen's test is a Studentized version of White's Reality Check. The stepwise variants allow one to accept or reject the null of no predictive ability on a subset of some tested strategies while maintaining a familywise error rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In his book, 'Evidence-Based Technical Analysis,' David Aronson discusses the overfit bias very well, although I believe his techniques for minimizing the bias may only apply to technical strategies, because they rely on Monte Carlo simulations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;P. R. Hansen, 'A Test for Superior Predictive Ability,' Journal of Business&#xA;&amp;amp; Economic Statistics, vol 23, no 4, 2005, &lt;a href=&quot;http://pubs.amstat.org/doi/abs/10.1198/073500105000000063&quot;&gt;http://pubs.amstat.org/doi/abs/10.1198/07350010&#xA;5000000063&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://groups.google.com/group/testing-for-superior-predictive-ability&quot;&gt;SPA google group&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Hsu, Po-Hsuan, Hsu, Yu-Chin and Kuan, Chung-Ming, 'Testing the Predictive &#xA;Ability of Technical Analysis Using a New Stepwise Test Without Data Snooping &#xA;Bias,' 2008, &lt;a href=&quot;http://ssrn.com/abstract=1087044&quot;&gt;http://ssrn.com/abstract=1087044&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Hsu, Po-Hsuan and Hsu, Yu-Chin, 'A Stepwise SPA Test for Data Snooping and its &#xA;Application on Fund Performance Evaluation,' 2006, &lt;a href=&quot;http://ssrn.com/abstract=885364&quot;&gt;http://ssrn.com/abstract=885364&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.evidencebasedta.com/&quot;&gt;David Aronson's Evidence-Based TA&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="108" LastActivityDate="2011-02-04T03:45:19.377" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="168" PostTypeId="2" ParentId="141" CreationDate="2011-02-04T04:10:19.353" Score="251" Body="&lt;p&gt;&lt;strong&gt;This post is Quant Stack Exchange's master list of data sources.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Please append your links to other data sources to the list below.&lt;/p&gt;&#xA;&lt;h2&gt;Economic Data&lt;/h2&gt;&#xA;&lt;br&gt;&#xA;See [What are the most useful sources of economics data?][1] on Cross Validated.&#xA;&lt;p&gt;&lt;strong&gt;World&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stats.oecd.org/index.aspx&quot; rel=&quot;noreferrer&quot;&gt;OECD.StatExtracts&lt;/a&gt; includes data and metadata for OECD countries and selected non-member economies.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.assetmacro.com/&quot; rel=&quot;noreferrer&quot;&gt;http://www.assetmacro.com/&lt;/a&gt; includes data for 20,000+ Macroeconomic and Financial Indicators of 150 countries&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://db.nomics.world&quot; rel=&quot;noreferrer&quot;&gt;https://db.nomics.world&lt;/a&gt; is an open platform with more than 16,000 datasets among 50+ providers.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;United Kingdom&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.statistics.gov.uk/&quot; rel=&quot;noreferrer&quot;&gt;http://www.statistics.gov.uk/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;United States&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;http://research.stlouisfed.org/fred2/&quot; rel=&quot;noreferrer&quot;&gt;Federal Reserve Economic Data - FRED&lt;/a&gt; (includes URL-based API)&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.census.gov/&quot; rel=&quot;noreferrer&quot;&gt;http://www.census.gov/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.bls.gov/&quot; rel=&quot;noreferrer&quot;&gt;http://www.bls.gov/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.ssa.gov/&quot; rel=&quot;noreferrer&quot;&gt;http://www.ssa.gov/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.treasury.gov/&quot; rel=&quot;noreferrer&quot;&gt;http://www.treasury.gov/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.sec.gov/&quot; rel=&quot;noreferrer&quot;&gt;http://www.sec.gov/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.economagic.com/&quot; rel=&quot;noreferrer&quot;&gt;http://www.economagic.com/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.forecasts.org/&quot; rel=&quot;noreferrer&quot;&gt;http://www.forecasts.org/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h2&gt;Foreign Exchange&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;[1Forge Realtime FX Quotes] &lt;a href=&quot;http://1forge.com/forex-data-api&quot; rel=&quot;noreferrer&quot;&gt;4&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.oanda.com/currency/historical-rates/&quot; rel=&quot;noreferrer&quot;&gt;OANDA Historical Exchange Rates&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.dukascopy.com/swiss/english/data_feed/historical/&quot; rel=&quot;noreferrer&quot;&gt;Dukascopy - Historical FX prices; XML and CSV&lt;/a&gt;. There is a non-affiliated downloader called &lt;a href=&quot;https://tickstory.com/#features&quot; rel=&quot;noreferrer&quot;&gt;tickstory&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.dailyfx.com/forex_forum/free-strategy-trader-historical-data/220967-free-strategy-trader-historical-data.html&quot; rel=&quot;noreferrer&quot;&gt;ForexForums Historical Data - Historical FX downloads via Amazon S3&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.fxcm.com/uk/trading-services/free-tick-data/&quot; rel=&quot;noreferrer&quot;&gt;FXCM&lt;/a&gt; provides an open repository of tick data starting from January 4th 2015, with a download &lt;a href=&quot;https://github.com/FXCMAPI/FXCMTickData&quot; rel=&quot;noreferrer&quot;&gt;script&lt;/a&gt; on github.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ratedata.gaincapital.com/&quot; rel=&quot;noreferrer&quot;&gt;GAIN Capital - Historical FX rates (in ZIP format)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.truefx.com/?page=download&quot; rel=&quot;noreferrer&quot;&gt;TrueFX - Historical FX rates (in ZIP/CSV format)&lt;/a&gt;. A download &lt;a href=&quot;https://github.com/webradio/TrueFX-by-cUrl&quot; rel=&quot;noreferrer&quot;&gt;helper script&lt;/a&gt; is available on GitHub. TrueFX.com asks for free registration. Same files are linked from &lt;a href=&quot;https://pepperstone.com/en/client-resources/historical-tick-data&quot; rel=&quot;noreferrer&quot;&gt;Pepperstone&lt;/a&gt;, no registration needed.&lt;/li&gt;&#xA;&lt;li&gt;[RTFXD - Real Time FX Data] &lt;a href=&quot;http://rtfxd.com&quot; rel=&quot;noreferrer&quot;&gt;9&lt;/a&gt;: Delivered via ssh. Very low pricing.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.olsendata.com&quot; rel=&quot;noreferrer&quot;&gt;Olsen Data / Olsen Financial Technologies&lt;/a&gt;: Historical FX data can be ordered online in custom format. Download link sent in 2 business days. Real time data service. Expensive but very high quality.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://zorro-project.com/download.php&quot; rel=&quot;noreferrer&quot;&gt;Zorro&lt;/a&gt;: 1Minute bars from 2010 in &lt;a href=&quot;https://manual.zorro-project.com/history.htm&quot; rel=&quot;noreferrer&quot;&gt;t6&lt;/a&gt; format (OHLC and tick volume)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2&gt;Equity and Equity Indices##&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://finance.yahoo.com/&quot; rel=&quot;noreferrer&quot;&gt;http://finance.yahoo.com/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.iasg.com/managed-futures/market-quotes&quot; rel=&quot;noreferrer&quot;&gt;http://www.iasg.com/managed-futures/market-quotes&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://kumo.swcp.com/stocks/&quot; rel=&quot;noreferrer&quot;&gt;http://kumo.swcp.com/stocks/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html&quot; rel=&quot;noreferrer&quot;&gt;Kenneth French Data Library&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://unicorn.us.com/advdec/&quot; rel=&quot;noreferrer&quot;&gt;http://unicorn.us.com/advdec/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://siblisresearch.com/&quot; rel=&quot;noreferrer&quot;&gt;http://siblisresearch.com/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.usfundamentals.com/download&quot; rel=&quot;noreferrer&quot;&gt;Fundamental data for US stocks&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://simfin.com/&quot; rel=&quot;noreferrer&quot;&gt;http://simfin.com/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.olsendata.com&quot; rel=&quot;noreferrer&quot;&gt;Olsen Data / Olsen Financial Technologies&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.tiingo.com/welcome&quot; rel=&quot;noreferrer&quot;&gt;https://www.tiingo.com/welcome&lt;/a&gt; - Equity, ETF, and Mutual Fund  price and fundamental data&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h2&gt;Fixed Income&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://federalreserve.gov/releases/h15/data.htm&quot; rel=&quot;noreferrer&quot;&gt;FRB: H.15 Selected Interest Rates&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://live.barcap.com/&quot; rel=&quot;noreferrer&quot;&gt;Barclays Capital Live&lt;/a&gt; (institutional clients only)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.datagrapple.com/&quot; rel=&quot;noreferrer&quot;&gt;CDS spreads&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h2&gt;Options and Implied Volatility&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.ivolatility.com/&quot; rel=&quot;noreferrer&quot;&gt;http://www.ivolatility.com/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.optionmetrics.com/&quot; rel=&quot;noreferrer&quot;&gt;http://www.optionmetrics.com/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.livevol.com/&quot; rel=&quot;noreferrer&quot;&gt;http://www.livevol.com/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.historicaloptiondata.com/&quot; rel=&quot;noreferrer&quot;&gt;http://www.historicaloptiondata.com/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.commodityvol.com/&quot; rel=&quot;noreferrer&quot;&gt;https://www.commodityvol.com/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.olsendata.com&quot; rel=&quot;noreferrer&quot;&gt;Olsen Data / Olsen Financial Technologies&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h2&gt;Futures&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.simiansavants.com/cmedata.shtml&quot; rel=&quot;noreferrer&quot;&gt;http://www.simiansavants.com/cmedata.shtml&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.cmegroup.com/market-data/index.html&quot; rel=&quot;noreferrer&quot;&gt;http://www.cmegroup.com/market-data/index.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.quandl.com&quot; rel=&quot;noreferrer&quot;&gt;http://www.quandl.com&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.olsendata.com&quot; rel=&quot;noreferrer&quot;&gt;Olsen Data / Olsen Financial Technologies&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h2&gt;Commodities&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://globalderivatives.nyx.com/nl/commodities/nyse-liffe/contract-list&quot; rel=&quot;noreferrer&quot;&gt;LIFFE Commodity Derivatives - 15 min delay; free registration&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h2&gt;Multiple Asset Classes and Miscellaneous&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.eoddata.com/&quot; rel=&quot;noreferrer&quot;&gt;http://www.eoddata.com/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.econ.yale.edu/%7Eshiller/data.htm&quot; rel=&quot;noreferrer&quot;&gt;Robert Shiller Online Data&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/StockSharp/StockSharp#sdata&quot; rel=&quot;noreferrer&quot;&gt;S#.Data&lt;/a&gt; is a free application for downloading and storing market data from various sources&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h2&gt;Specific Exchanges&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.meff.es/ing/Financial-Derivatives/File-Downloads&quot; rel=&quot;noreferrer&quot;&gt;Spanish Futures &amp;amp; Options (MEFF)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="43" LastEditorUserId="19645" LastEditDate="2021-02-19T15:27:22.183" LastActivityDate="2021-02-19T15:27:22.183" CommentCount="11" CommunityOwnedDate="2011-02-08T19:10:45.013" ContentLicense="CC BY-SA 4.0" />
  <row Id="169" PostTypeId="2" ParentId="156" CreationDate="2011-02-04T07:12:30.120" Score="77" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Correlation&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Correlations are notoriously unstable in financial time series - yet one of the most used concepts in quant finance because their is no good theoretical substitute for it. You could say theory is not working with it yet neither without it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example the concept is used for diversification of uncorrelated assets or for the modelling of credit default swaps (correlation of defaults). Unfortunately when you need it most (e.g. a crash) it just vanishes. This is one of the reasons that the financial crises started because the quants modeled the cds's with certain assumptions concerning default correlations - but when a regime shift happens this no longer works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&lt;br&gt;&#xA;See my follow-up question: &lt;a href=&quot;https://quant.stackexchange.com/questions/27674/what-is-the-most-stable-non-trivial-dependence-structure-in-finance&quot;&gt;What is the most stable, non-trivial dependence structure in finance?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-06-17T16:47:31.373" CommentCount="11" CommunityOwnedDate="2011-03-11T10:27:14.817" ContentLicense="CC BY-SA 3.0" />
  <row Id="170" PostTypeId="2" ParentId="147" CreationDate="2011-02-04T07:26:50.377" Score="9" Body="&lt;p&gt;I think the biggest risk is trusting your model too much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would summarize modelling like that: Model for the best but risk-manage for the worst!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example for modelling a portfolio approach with derivatives that could e.g. mean: use black scholes for option pricing (model) but manage your risk by assuming a power law distribution and vary your alpha to see the effect on your portfolio (simulation for risk-management).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I learned that bit in a joint seminar by Wilmott and Taleb - good practical stuff.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-02-04T07:26:50.377" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="172" PostTypeId="2" ParentId="156" CreationDate="2011-02-04T08:59:27.813" Score="32" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Value at Risk&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The great idea to have systematic indicator for risk exposure but the problems arise when&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;it's used as main or single indicator without looking at other risks (e.g Credit risk or Liquidity risk). Emanuel Derman wrote about it recently &lt;a href=&quot;http://www.wilmott.com/blogs/eman/index.cfm/2011/1/31/The-Next-Crisis&quot;&gt;in his blog&lt;/a&gt;:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;But they (GS) did it not with a new formula or a single rule. They did it by being smart rather than doctrinaire. They were eclectic; they had limits on all sorts of exposures -- on VaR, on the fraction of a portfolio that hadn't been modified in a year ... There isn't a formula for avoiding future losses because there isn't one cause of future losses. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;VaR becomes the purpose of risk management - not the situations when when losses exceed VaR&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;“An airbag that works all the time, except when you have a car accident.” (c) D.Einhorm&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It's focused on managable risk in a normal situations with the assumption that tomorrow will be like today and yesterday and without taking rare events into account.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It becomes another parameter (like profit) that could be gamed (the same profit but with low risk).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And there are two exremely great articles about VaR among the best I've ever read:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.nytimes.com/2009/01/04/magazine/04risk-t.html?_r=1&amp;amp;dlbk=&amp;amp;pagewanted=all&quot;&gt;Risk Management - What Led to financial meltdown. NY Times&lt;/a&gt; &lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.derivativesstrategy.com/magazine/archive/1998/0498fea1.asp&quot;&gt;Derivatives Strategy - Rountable on Limits of VaR&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="15" LastActivityDate="2011-02-04T08:59:27.813" CommentCount="1" CommunityOwnedDate="2011-03-11T10:27:28.280" ContentLicense="CC BY-SA 2.5" />
  <row Id="173" PostTypeId="2" ParentId="79" CreationDate="2011-02-04T11:13:39.907" Score="8" Body="&lt;p&gt;MCMC can be used for Bayesian inference of other models with hidden variables. Gibbs sampling, for example, is used in Hidden Markov Models. Here is a &lt;a href=&quot;http://ba.stat.cmu.edu/journal/2008/vol03/issue04/ryden.pdf&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; that discuss the differences between MCMC and the more classical approach using the EM algorithm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is: Are HMMs a useful model in finance? Some academics argue that they have predictive power.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One can look at: &lt;a href=&quot;http://doi.ieeecomputersociety.org/10.1109/ISDA.2005.85&quot; rel=&quot;nofollow&quot;&gt;Stock Market Forecasting Using Hidden Markov Model: A New Approach&lt;/a&gt;. I'm not convinced by the approach they use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, HMM can be used to build volatility filters for trend following strategies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are certainly other models parameters that can be inferred using MCMC. I personally find it very time consuming (this is only based on experience and not on convergence analysis). Furthermore, as stated in the first paper, if one wants to use Bayesian inference then the EM algorithm can be used for computing MAP parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All in all I haven't found it very useful.  &lt;/p&gt;&#xA;" OwnerUserId="155" LastEditorUserId="1106" LastEditDate="2011-09-08T21:05:25.420" LastActivityDate="2011-09-08T21:05:25.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="174" PostTypeId="1" AcceptedAnswerId="179" CreationDate="2011-02-04T13:19:21.993" Score="18" ViewCount="551" Body="&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Stress_testing#Financial_sector&quot;&gt;Wikipedia&lt;/a&gt; lists three of them:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;b&gt;Extreme event&lt;/b&gt;: hypothesize the portfolio's return given the recurrence of a historical event. Current positions and risk exposures are combined with the historical factor returns.&lt;/li&gt;&#xA;&lt;li&gt;&lt;b&gt;Risk factor shock&lt;/b&gt;: shock any factor in the chosen risk model by a user-specified amount. The factor exposures remain unchanged, while the covariance matrix is used to adjust the factor returns based on their correlation with the shocked factor.&lt;/li&gt;&#xA;&lt;li&gt;&lt;b&gt;External factor shock&lt;/b&gt;: instead of a risk factor, shock any index, macro-economic series (e.g., oil prices), or custom series (e.g., exchange rates). Using regression analysis, new factor returns are estimated as a result of the shock.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;But I was wondering if there is a more comprehensive list.&lt;/p&gt;&#xA;" OwnerUserId="159" LastActivityDate="2011-02-04T17:23:46.037" Title="What approaches are there for stress testing a portfolio?" Tags="&lt;risk&gt;&lt;var&gt;&lt;stress&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 2.5" />
  <row Id="175" PostTypeId="1" CreationDate="2011-02-04T14:37:41.727" Score="20" ViewCount="1467" Body="&lt;p&gt;Usually even good performing quant trading strategies work for a while and then return start to shrink. I see two reasons for that which would probably give rise to different analysis:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The Strategy got known by too many traders and has been arbitraged away.&lt;/li&gt;&#xA;&lt;li&gt;Market conditions have changed (will or will not revert).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="155" LastEditorUserId="35" LastEditDate="2011-02-06T16:16:50.943" LastActivityDate="2013-02-22T22:02:42.410" Title="Is there a way to estimate (predict) the half life of a quantitative trading system?" Tags="&lt;automated-trading&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 2.5" />
  <row Id="176" PostTypeId="1" CreationDate="2011-02-04T15:02:34.870" Score="27" ViewCount="3477" Body="&lt;p&gt;Let's say I have a brand new fancy model on some asset class (calibration porcedure included over a set of vanilla options) in which I truly believe I made a step forward comparing to existing literature (a phantasmatic situation I recognize). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which criteria should be in order so I can claim that I am in a position to &quot;validate&quot; this model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS:&#xA;We will assume that the math are OK and that I can prove that there is no bug in the model implementation&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="36636" LastEditorDisplayName="user1157" LastEditDate="2020-06-15T18:52:57.950" LastActivityDate="2020-06-16T17:32:14.230" Title="Model Validation Criteria" Tags="&lt;models&gt;&lt;model-validation&gt;&lt;model-risk-management&gt;" AnswerCount="6" CommentCount="4" FavoriteCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="177" PostTypeId="2" ParentId="175" CreationDate="2011-02-04T15:11:50.610" Score="10" Body="&lt;p&gt;I go out on a limb and say &lt;em&gt;No&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can of course observe how it does, but making a prediction about how and when it decays is difficult to impossible with any degree of precision.  You'd need a meta-model of the market as a whole.  And, well, if you had that, wouldn't you use that knowledge to make your model better?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, you can of course measure pnl and other return characteristics and extrapolate, but that isn't a proper &lt;em&gt;predictive model&lt;/em&gt; in my book.&lt;/p&gt;&#xA;" OwnerUserId="69" LastEditorUserId="69" LastEditDate="2011-02-04T15:24:35.753" LastActivityDate="2011-02-04T15:24:35.753" CommentCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="179" PostTypeId="2" ParentId="174" CreationDate="2011-02-04T17:23:46.037" Score="8" Body="&lt;p&gt;Well all that you have cited seems quite all you can do with scenario maybe I can add another one which is portfolio dependent. Instead of looking to arbitrary scenarios you first decompose the factor to which you portfolio is the most sensitive to, and then look for scenarios that are specifically impacting this combination of risk factors. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway,scenario losses can be quite an effective tool in risk management because it shows in a simple way where is your risk standing but it shouldn't be viewed as a standalone indicator. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One flaw is that it usually tell you something about only a few scenarios,but you can't be really sure that other scenarios won't impact you more. Moreover the more you have scenarios the less you know how to order them with respect to each other or with respect to some kind of likelihood. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise in the field of capital requirement area, I start to ear about Stressed-VaR which means among other things that you raise in a considerable way correlations between risk factors (as it usually happens during crisis) as well as volatility of risk factors. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the end Scenarios or Stressed-VaR, look a little bit like some &quot;cuisine&quot; with no real theoretical grounds to support the whole building and that's the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards&lt;/p&gt;&#xA;" OwnerUserId="92" LastActivityDate="2011-02-04T17:23:46.037" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="180" PostTypeId="1" AcceptedAnswerId="319" CreationDate="2011-02-04T19:14:34.403" Score="22" ViewCount="1747" Body="&lt;p&gt;Let's say you want to calculate a VaR for a portfolio of 1000 stocks. You're really only interested in the left tail, so do you use the whole set of returns to estimate mean, variance, skew, and shape (let's also assume a skewed generalized error distribution - SGED)? Or would you just use the left tail (let's say the bottom 10% of returns)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For some reason, using the whole set of returns seems more correct to me (by using only the left 10% or returns you'd really be approaching a non-parametric VaR). But using the whole set of returns would likely cause some distortion in the left tail in order to get a better fit elsewhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How are the pros doing this? Thanks!&lt;/p&gt;&#xA;" OwnerUserId="106" LastEditorUserId="999" LastEditDate="2011-09-22T22:07:59.113" LastActivityDate="2016-01-29T04:11:24.493" Title="How are distributions for tail risk measures estimated in practice?" Tags="&lt;risk&gt;&lt;probability&gt;&lt;estimation&gt;&lt;var&gt;&lt;expected-return&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="9" ContentLicense="CC BY-SA 2.5" />
  <row Id="181" PostTypeId="1" AcceptedAnswerId="370" CreationDate="2011-02-04T19:52:56.263" Score="21" ViewCount="1631" Body="&lt;p&gt;If I design a trading model, I might want to know the &lt;a href=&quot;https://quant.stackexchange.com/questions/147/what-are-the-key-risks-to-the-quantitative-strategy-development-process/150#150&quot;&gt;model's half life&lt;/a&gt;. Unfortunately, it doesn't seem possible to predict alpha longevity without a &lt;a href=&quot;https://quant.stackexchange.com/questions/175/is-there-a-way-to-estimate-predict-the-half-life-of-a-quantitative-trading-syst/177#177&quot;&gt;meta-model of the market&lt;/a&gt;. Intuitively, such a meta-model does not exist, but has that ever been proven? This sounds like a Russell's paradox or Gödel's incompleteness theorems for the financial markets.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I'm adding a bounty to see if I can get some more responses.&lt;/p&gt;&#xA;" OwnerUserId="35" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2014-02-13T19:48:26.607" Title="Why is there no &quot;meta-model&quot;?" Tags="&lt;strategy&gt;" AnswerCount="8" CommentCount="0" FavoriteCount="13" ContentLicense="CC BY-SA 2.5" />
  <row Id="182" PostTypeId="1" AcceptedAnswerId="196" CreationDate="2011-02-05T01:20:15.523" Score="17" ViewCount="2120" Body="&lt;p&gt;The practice of using Gaussian copulas in modeling credit derivatives has come under a lot of criticism in the past few years. What are the major arguments against using the copula method in this respect?&lt;/p&gt;&#xA;" OwnerUserId="117" LastActivityDate="2011-02-06T16:16:56.943" Title="What are the limitations of Gaussian copulas in respect to pricing credit derivatives?" Tags="&lt;credit&gt;&lt;valuation&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="183" PostTypeId="1" AcceptedAnswerId="185" CreationDate="2011-02-05T12:41:20.743" Score="28" ViewCount="9234" Body="&lt;p&gt;How do you explain what a stationary process is? In the first place, what is meant by &lt;em&gt;process&lt;/em&gt;, and then what does the process have to be like so it can be called &lt;em&gt;stationary&lt;/em&gt;?&lt;/p&gt;&#xA;" OwnerUserId="40" LastEditorUserId="20795" LastEditDate="2019-09-21T14:24:45.307" LastActivityDate="2019-09-21T14:24:45.307" Title="What is a stationary process?" Tags="&lt;time-series&gt;&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;stationarity&gt;&lt;terminology&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="21" ContentLicense="CC BY-SA 3.0" />
  <row Id="184" PostTypeId="2" ParentId="182" CreationDate="2011-02-05T13:39:39.967" Score="9" Body="&lt;p&gt;If you want a 'pop science' account for it, the &lt;a href=&quot;http://www.wired.com/techbiz/it/magazine/17-03/wp_quant?currentPage=all&quot;&gt;Wired article by Felix Salmon&lt;/a&gt; is a pretty good start.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want harder technical stuff, well then you can start at &lt;a href=&quot;http://en.wikipedia.org/wiki/Copula_%28statistics%29#Applications&quot;&gt;the Wikipedia article and its section on Applications&lt;/a&gt; and follow the references:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;[...] Some believe the&#xA;  methodology of applying the Gaussian&#xA;  copula to credit derivatives to be one&#xA;  of the reasons behind the global&#xA;  financial crisis of 2008–2009.[6][7]&#xA;  Despite this perception, there are&#xA;  documented attempts of the financial&#xA;  industry, occurring before the crisis,&#xA;  to address the limitations of the&#xA;  Gaussian copula and of Copula&#xA;  functions more generally, specifically&#xA;  the lack of dependence dynamics and&#xA;  the poor representation of extreme&#xA;  events[8]. The volume &quot;Credit&#xA;  Correlation: Life After Copulas&quot;,&#xA;  published in 2007 by World Scientific,&#xA;  summarizes a 2006 conference held by&#xA;  Merrill Lynch in London where several&#xA;  practitioners attempted to propose&#xA;  models rectifying some of the copula&#xA;  limitations. See also the article by&#xA;  Donnelly and Embrechts [9] and the&#xA;  book by Brigo, Pallavicini and&#xA;  Torresetti [10].&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="69" LastEditorUserId="117" LastEditDate="2011-02-06T16:16:56.943" LastActivityDate="2011-02-06T16:16:56.943" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="185" PostTypeId="2" ParentId="183" CreationDate="2011-02-05T14:12:55.267" Score="26" Body="&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Stationary_process&quot; rel=&quot;nofollow noreferrer&quot;&gt;A stationary process&lt;/a&gt; is one where the mean and variance don't change over time.  This is technically &quot;second order stationarity&quot; or &quot;weak stationarity&quot;, but it is also commonly the meaning when seen in literature.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In first order stationarity, the distribution of $(X_{t+1}, ..., X_{t+k})$ is the same as $(X_{1}, ..., X_{k})$ for all values of $(t, k)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see whether a series is stationary through it's &lt;a href=&quot;http://en.wikipedia.org/wiki/Autocorrelation&quot; rel=&quot;nofollow noreferrer&quot;&gt;autocorrelation function&lt;/a&gt; (ACF): $\rho_k = Corr(X_t, X_{t-k})$.  When the ACF of the time series is slowly decreasing, this is an indication that the mean is not stationary; conversely, a stationary series should converge on zero quickly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, white noise is stationary, while a random walk is not.  We can simulate these distributions easily in R (&lt;a href=&quot;https://stats.stackexchange.com/questions/2623/autocorrelation-in-the-presence-of-non-stationarity&quot;&gt;from a prior answer of mine&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;op &amp;lt;- par(mfrow = c(2,2), mar = .5 + c(0,0,0,0))&#xA;&#xA;N &amp;lt;- 500&#xA;# Simulate a Gaussian noise process&#xA;y1 &amp;lt;- rnorm(N)&#xA;# Turn it into integrated noise (a random walk)&#xA;y2 &amp;lt;- cumsum(y1)&#xA;&#xA;plot(ts(y1), xlab=&quot;&quot;, ylab=&quot;&quot;, main=&quot;&quot;, axes=F); box()&#xA;plot(ts(y2), xlab=&quot;&quot;, ylab=&quot;&quot;, main=&quot;&quot;, axes=F); box()&#xA;acf(y1, xlab=&quot;&quot;, ylab=&quot;&quot;, main=&quot;&quot;, axes=F); box()&#xA;acf(y2, xlab=&quot;&quot;, ylab=&quot;&quot;, main=&quot;&quot;, axes=F); box()&#xA;&#xA;par(op)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which ends up looking somewhat like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/5UZLJ.jpg&quot; alt=&quot;alt text&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If a time series varies over time, it is possible &lt;a href=&quot;https://stats.stackexchange.com/questions/2077/how-to-make-a-time-series-stationary&quot;&gt;to make it stationary&lt;/a&gt; through a number of different techniques.&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2011-02-07T01:17:19.893" CommentCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="186" PostTypeId="2" ParentId="183" CreationDate="2011-02-05T14:47:19.200" Score="8" Body="&lt;p&gt;A process is defined &lt;a href=&quot;http://en.wikipedia.org/wiki/Stochastic_process&quot;&gt;here&lt;/a&gt; and is simply a collection of random variables indexed (in general) by time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise I know the concept stated by Shane under the name of &quot;weak stationarity&quot;, strong stationary processes are those that have probability laws that do not evolve through time.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;More formally let $X_t$ be a given process, then let's call $P_X$ the probability law of the process, then for any given finite set of times $(t_1,...,t_n)$, and some borelian sets $(A_1,...,A_n)$ and any real $h&gt;0$, $X_t$ is said (strongly) stationary iff :  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P_X(X_{t_1}\in A_1,...,X_{t_n}\in A_n)=P_X(X_{t_1+h}\in A_1,...,X_{t_n+h}\in A_n)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Gaussian process weak stationarity is equivalent to stationarity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="92" LastEditDate="2011-02-05T22:34:42.937" LastActivityDate="2011-02-05T22:34:42.937" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="187" PostTypeId="2" ParentId="176" CreationDate="2011-02-05T16:03:23.840" Score="12" Body="&lt;p&gt;I don't think that there is a precise point in time when we can say that model is valid (well, it's a model not a law). For example, &lt;a href=&quot;http://www.ederman.com/new/docs/gs-model_risk.pdf&quot;&gt;E. Derman in his article on Model risk&lt;/a&gt; describes the verification of model as a iterative process:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;It is impossible to avoid errors during model development, especially when they are created under trading floor duress .... So, after the model is built, the developer tests it extensively. Thereafter, other developers “play” with it too. Next, traders who depend on the model for pricing and hedging use it. Finally, it’s released to salespeople. After a suitably long period during which most wrinkles are ironed out, it’s given to appropriate clients. This slow diffusion helps eliminate many risks,&#xA;  slowly but steadily.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;He also describes 6 types possibilities which constitutes model risk here:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Incorrect model &lt;/li&gt;&#xA;&lt;li&gt;Correct model, incorrect solution&lt;/li&gt;&#xA;&lt;li&gt;Correct model, inappropriate use&lt;/li&gt;&#xA;&lt;li&gt;Badly approximated solution&lt;/li&gt;&#xA;&lt;li&gt;Software and hardware bugs  &lt;/li&gt;&#xA;&lt;li&gt;Unstable data&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In addition to that he provides some tips that can be used to avoid model risk and its consequences (to name just few):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Test complex models in simple cases first &lt;/li&gt;&#xA;&lt;li&gt;Test the model’s boundaries&lt;/li&gt;&#xA;&lt;li&gt;Don’t ignore small discrepancies&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="15" LastActivityDate="2011-02-05T16:03:23.840" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="188" PostTypeId="2" ParentId="183" CreationDate="2011-02-05T16:17:46.503" Score="9" Body="&lt;p&gt;A very excellent discussion of stationarity as it relates to trading can be found in Sherry's (Sherrys'?) &lt;a href=&quot;http://search.barnesandnoble.com/The-Mathematics-of-Technical-Analysis/Clifford-J-Sherry/e/9780595012077&quot; rel=&quot;noreferrer&quot;&gt;Mathematics of Technical Analysis&lt;/a&gt; (poorly organized, but very useful book).  As he puts it, if the price changes of a stock, etc.,  are stationary over a time period, the underlying rules generating the price changes are effectively unchanged.  The hypothesis is that a trading algorithm has little chance of working on a non-stationary series of price changes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below are some charts I've generated using the technique he describes in the book.  Basically, you break your data set into two parts, histogram the prices changes, and construct cumulative distribution functions (cdfs).  Then, do a Pearson's $\chi^2$ test to see if one cdf is significantly different than the other.  You can also just look at the cdfs by eye.  The case below is a borderline case.  You can see the cdfs look a little bit different, but $\chi^2$ needs to be better than 14.07 to reach the 0.05 significance level in Pearson's test.&#xA;&lt;img src=&quot;https://i.stack.imgur.com/3OGqg.png&quot; alt=&quot;Testing for stationarity&quot;&gt;  &lt;/p&gt;&#xA;" OwnerUserId="47" LastActivityDate="2011-02-05T16:17:46.503" CommentCount="5" ContentLicense="CC BY-SA 2.5" />
  <row Id="189" PostTypeId="1" AcceptedAnswerId="255" CreationDate="2011-02-05T20:04:31.503" Score="11" ViewCount="451" Body="&lt;p&gt;In order to use Real Option Valuation (ROV), using Black-Scholes equation, I must know the volatility of the economic returns for T years. Knowing this information what could be the appropriate measure of computing volatility of the economic returns from my reservoir? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The distribution of PV for any particular year is coming out to be gaussian. There is no historical data known.&lt;/p&gt;&#xA;" OwnerDisplayName="user98" LastEditorDisplayName="user98" LastEditDate="2016-07-11T23:13:12.483" LastActivityDate="2016-07-12T09:30:21.863" Title="Appropriate measure of Volatility for economic returns from an asset?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;black-scholes&gt;&lt;real-options&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="190" PostTypeId="2" ParentId="181" CreationDate="2011-02-05T22:35:46.190" Score="7" Body="&lt;p&gt;I would conjecture that the reason a proof does not seem to exist, is that in a purely theoretical framework, such a model could exist for 'corner cases'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under the assumption that the existence of a meta-model would modify the usage of the model / effect the market, something like Russell's paradox would seem to occur. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Except in the case where a stable market/meta-market relationship could be achived. I.e. we could construct some theoretical markets (i.e., not a model, but some purely theoretical complete description of the market) in which the existence of a meta-model would not effect the market or which in a finite number of steps would converge to final market / meta-model pair in which the existence of a final meta-model does not cause changes to the market.&lt;/p&gt;&#xA;" OwnerUserId="133" LastActivityDate="2011-02-05T22:35:46.190" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="191" PostTypeId="2" ParentId="140" CreationDate="2011-02-05T22:55:07.890" Score="22" Body="&lt;p&gt;Strictly speaking, data snooping is &lt;em&gt;not&lt;/em&gt; the same as in-sample vs out-of-sample model selection and testing, but has to deal with &lt;em&gt;sequential&lt;/em&gt; or &lt;em&gt;multiple&lt;/em&gt; tests of hypothesis based on the &lt;em&gt;same&lt;/em&gt; data set. To quote Halbert White:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Data snooping occurs when a given set&#xA;  of data is used more than once for&#xA;  purposes of inference or model&#xA;  selection. When such data reuse&#xA;  occurs, there is always the&#xA;  possibility that any satisfactory&#xA;  results obtained may simply be due to&#xA;  chance rather than to any merit&#xA;  inherent in the methody yielding the&#xA;  results.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Let me provide an example. Suppose that you have a time series of returns for a single asset, and that you have a large number of candidate model families. You fit each of these models, on a test data set, and then check the performance of the model prediction on a hold-out sample. If the number of models is high enough, there is a non-negligible probability that the predictions provided by one model will be considered good. This has nothing to do with bias-variance trade-offs. In fact, each model may have been fitted using cross-validation on the training set, or other in-sample criteria like AIC, BIC, Mallows etc. For examples of a typical protocol and criteria, check Ch.7 of Hastie-Friedman-Tibshirani's &quot;&lt;a href=&quot;http://www-stat.stanford.edu/~tibs/ElemStatLearn/&quot;&gt;The Elements of Statistical Learning&lt;/a&gt;&quot;. Rather the problem is that implicitly multiple tests of hypothesis are being run &lt;em&gt;at the same time&lt;/em&gt;. Intuitively, the criterion to evaluate multiple models should be more stringent, and a naive approach would be to apply a &lt;a href=&quot;http://en.wikipedia.org/wiki/Bonferroni_correction&quot;&gt;Bonferroni correction&lt;/a&gt;. It turns out that this criterion is too stringent. That's where &lt;a href=&quot;http://www.math.tau.ac.il/~ybenja/MyPapers/benjamini_hochberg1995.pdf&quot;&gt;Benjamini-Hochberg&lt;/a&gt;, &lt;a href=&quot;http://weber.ucsd.edu/~hwhite/pub_files/hwcv-077.pdf&quot;&gt;White&lt;/a&gt;, and &lt;a href=&quot;http://www-stat.wharton.upenn.edu/~steele/Courses/956/Resource/MultipleComparision/RomanoWolf05.pdf&quot;&gt;Romano-Wolf&lt;/a&gt; kick in. They provide efficient criteria for model selection. The papers are too involved to describe here, but to get a sense of the problem, I recommend Benjamini-Hochberg first, which is both easier to read and truly seminal.&lt;/p&gt;&#xA;" OwnerUserId="194" LastActivityDate="2011-02-05T22:55:07.890" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="192" PostTypeId="2" ParentId="121" CreationDate="2011-02-06T04:05:43.783" Score="9" Body="&lt;p&gt;You are correct: evaluating volatility forecasts is quite different from evaluating forecasts in general, and it is a very active area of research. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Methods can be classified in several ways. One criterion is to consider evaluation methods for single forecasts (e.g., for the time series of returns of a specific portfolio) vs multiple simultaneous forecasts (e.g., for an investable universe). Another criterion is to separate direct evaluation methodsfrom indirect evaluation methods (more on this later). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Focusing on single-asset methods: historically the most commonly used approach by practitioners, and the one advocated by Barra is the &quot;bias&quot; statistics. If you have a forecast return process $r_t$ and a forecast $h_t$, then under the null hypothesis that the forecast is correct, $r_t/h_t$ has unit variance. The Bias statistics is defined as $T^{-1} \sum_{t=1}^T (r_t/h_t)^2$, which is asymptotically normally distributed with unit mean and st.dev. $1/\sqrt{T}$, which can be used for hypothesis testing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An alternative is Mincer-Zarnowitz regression, in which one runs a regression between realized variance (say, 20-trading day estimate between $t$ and $t+20$) and the forecast:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\hat\sigma^2_t =\alpha +\beta h^2_t + \epsilon_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under the null one tests the joint hypothesis $\alpha=0, \beta=1$. &lt;a href=&quot;http://www.kevinsheppard.com/images/c/c6/Patton_Sheppard.pdf&quot;&gt;Patton and Sheppard&lt;/a&gt; also recommend the regression, which yields a more powerful test:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$(\hat\sigma_t/h_t)^2 =\alpha/h^2_t +\beta + \epsilon_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both these tests can be (non-rigorously) extended to multiple forecasts by simulating random portfolios and generating statistics for each portfolio, or by assuming an identical relationship between forecasts and realizations across asset  pairs:&#xA;$$vech(\Sigma_t) = \alpha + \beta vech ( H_t) + \epsilon_t$$&#xA;in which $vech$ is the &quot;stacking&quot; operator on a matrix (in this case, the forecast and realized variance matrices).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for indirect tests, a popular approach is the minimum variance portfolio for risk model comparison. One finds the minimum variance portfolio under a unit budget constraint using two or more asset covariance matrices. One can prove that the &lt;em&gt;true&lt;/em&gt; covariance matrix would result in the portfolio with the &lt;em&gt;lowest&lt;/em&gt; realized variance. In other words, better models hedge better. The advantage of this approach is that it does take into account the quality of the forecast of $\Sigma^{-1}$, which is used in actual optimization problems; and it doesn't require providing alphas, so that the test is not a joint test of risk model and manager skill.&lt;/p&gt;&#xA;" OwnerUserId="194" LastActivityDate="2011-02-06T04:05:43.783" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="193" PostTypeId="2" ParentId="35" CreationDate="2011-02-06T04:33:58.627" Score="11" Body="&lt;p&gt;I would split the question into two sub-questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is market beta useful at all?&lt;/li&gt;&#xA;&lt;li&gt;Is market beta useful for high-frequency strategies that are fully hedged EOD?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;With regards to the first question, I would summarize the hundreds of papers on the subject as: yes, but not as much as it was initially believed. The reason being that multi-factor models are empirically superior to CAPM and intertemporal CAPM, and in these models the market factor explains relatively little volatility, and in some cases it is entirely omitted, as the volatility is entirely captured by industry factors. Yet, risk models are not universally adopted, especially outside of equities, and moreover market beta can still be useful to assess risk premia (as is usually done in investment banking) or to tactically hedge portfolios. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With regards to the second question: it depends on the time scale. If you estimate beta using daily returns, you cannot use this loading to hedge intraday exposure to market risk, since this risk is not captured by the estimation interval. So you'd have to use 30- or 15- minute returns. This is not trivial however, because asynchroneity effects and induced autocorrelation of returns (Epps' effect). I don't know of commercial high-frequency factor models. I am not sure that statistical arbitrageurs use in house models, but there are many technical hurdles to overcome.&lt;/p&gt;&#xA;" OwnerUserId="194" LastEditorUserId="194" LastEditDate="2011-02-07T03:24:59.033" LastActivityDate="2011-02-07T03:24:59.033" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="194" PostTypeId="1" AcceptedAnswerId="205" CreationDate="2011-02-06T08:46:44.807" Score="8" ViewCount="420" Body="&lt;p&gt;I have several measures:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1. Profit and loss (PNL).      &#xA;2. Win to loss ratio (W2L).&#xA;3. Avg gain to drawdown ratio (AG2AD).&#xA;4. Max gain to maximum drawdown ratio (MG2MD).&#xA;5. Number of consecutive gains to consecutive losses ratio (NCG2NCL).&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If there were only 3 measures (A, B, C), then I could represent the &quot;total&quot; measure as a magnitude of a 3D vector:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;R = SQRT(A^2 + B^2 + C^2)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I want to combine those 5 measures into a single value, would it make sense to represent them as the magnitude of a 5D vector? Is there a better way to combine them? Is there a way to put more &quot;weight&quot; on certain measures, such as the PNL?&lt;/p&gt;&#xA;" OwnerUserId="78" LastActivityDate="2011-02-07T05:42:11.163" Title="How to combine various equity measures into a single measure (vector magnitude)" Tags="&lt;analysis&gt;&lt;statistics&gt;&lt;quantitative&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="195" PostTypeId="1" AcceptedAnswerId="199" CreationDate="2011-02-06T10:43:16.347" Score="23" ViewCount="6917" Body="&lt;p&gt;I notice that, on the surface, there are some similarities between quantitative sports betting and quantitative finance. Both have the concept of arbitraging, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the applications of quantitative finance that lend themselves readily to sports betting?&lt;/p&gt;&#xA;" OwnerUserId="129" LastEditorUserId="20795" LastEditDate="2019-09-22T10:13:58.033" LastActivityDate="2019-09-22T10:13:58.033" Title="The application of quantitative finance in sports betting" Tags="&lt;application&gt;&lt;betting&gt;" AnswerCount="4" CommentCount="5" FavoriteCount="11" ContentLicense="CC BY-SA 4.0" />
  <row Id="196" PostTypeId="2" ParentId="182" CreationDate="2011-02-06T16:09:27.307" Score="15" Body="&lt;p&gt;The limitations of the Gaussian copula were well-known among the quantitative finance practitioners before the crisis. See &lt;a href=&quot;http://arxiv.org/abs/0912.5427&quot;&gt;this paper by D. Brigo&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer the question:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;no &quot;fat tails&quot;&lt;/li&gt;&#xA;&lt;li&gt;unable to fit the market prices without tweaks (base correlation) which make the model arbitrageable&lt;/li&gt;&#xA;&lt;li&gt;it's a static model (e.g. forward-starting tranches are impossible to price -- but nobody trades them now anyway)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This said, all other models are either worse or offer cosmetic improvements. Changing the Gaussian factors to some others doesn't really give you much. A few years ago the Random Factor Loading model was en vogue, but it turned out to be much harder to calibrate, and still not flexible enough.&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2011-02-06T16:09:27.307" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="197" PostTypeId="2" ParentId="195" CreationDate="2011-02-06T19:36:02.513" Score="3" Body="&lt;p&gt;To be precise, its not the application of quant finance, but rather its the general statistics which is used in myriad fields. For example, you could use monte carlo simulation (part of statistics) to determine the chances of which horse could win the horse race. For that we can form distributions of weather conditions, track conditions, horse's success rates etc. However, as these parameters are not independent so we must know the correlation between them to sample their outcomes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having said that, there are other fields where application of quant finance is prevalent. Like in valuation of tangible and real assets using options theory. It is widely used to assess risk of either developing or venturing out a certain product, property etc. Evaluating risk helps us make decisions eventually. So in essence, to do risk and decision analysis for real and tangible properties/products we use options theory.&lt;/p&gt;&#xA;" OwnerDisplayName="user98" LastActivityDate="2011-02-06T19:36:02.513" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="198" PostTypeId="2" ParentId="194" CreationDate="2011-02-06T20:28:08.410" Score="4" Body="&lt;p&gt;A &lt;em&gt;multi-alpha&lt;/em&gt; trading model ranks each asset according to the individual signals. For example, if I have two metrics and three stocks, I could just create this reverse-sorted table:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Rank| PNL  W2L &#xA;----| ---------&#xA;3   | AAPL AAPL&#xA;2   | MSFT YHOO&#xA;1   | YHOO MSFT&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Because this ranking/sorting method is non-parametric, I can just average each metric's rank by stock:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;stock| score&#xA;-----| -----&#xA;AAPL | 3.0    &#xA;MSFT | 1.5    &#xA;YHOO | 1.5    &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And now it's easy to make a weighted average of the ranks; if I want &lt;em&gt;PNL&lt;/em&gt; to be 2/3 of the value and &lt;em&gt;W2L&lt;/em&gt; to be 1/3, I have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;stock| score&#xA;-----| -----&#xA;AAPL | 3.000&#xA;MSFT | 1.667&#xA;YHOO | 1.333&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-02-06T20:28:08.410" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="199" PostTypeId="2" ParentId="195" CreationDate="2011-02-06T21:33:29.710" Score="7" Body="&lt;p&gt;Well in my opinion a good parallel can be made between sport betting and bookmakers on the one hand and derivative pricing and market makers of those derivative on the other hand. I'll try to explain that if I can.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are given a set of bookmakers taking bets for let's say one underlying outcome and that they quote this event as a percentage (as for binary options). Then if they are smart enough they shouldn't care about the statistics of the event itself, what they shall try to do is to balance their quotes with respect the positions of their outstanding books. I mean by this that they should do the P&amp;amp;L scenarios of each outcome of the bets in their books and try to balance things so they can earn a living while taking as little risk as possible. This will make dynamicaly evolve the quotes of the events as the bets come to their books. Of course the clients do care about statistics and so they will think twice before taking bets that rarely occur (or pay too much for it).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you think at the market making of binary options, the situation is quite the same as the one with the bookie, but at the end what you get is the Risk Neutral Probability. It is set by market participants and is in a way &quot;an opinion&quot;. This RN Probability is not always coherent with the statistics of the history of the underlying.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This however can make sense if all the market makers are in some way minimizing the aggregate risk of their returns  (I don't explain the word 'risk' here on purpose but here the limits set by risk managers should enter into play). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course all this is not properly and mathematically formalised but the appropriatness of the parallel of both situations appears quite striking to me. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best Regards&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="92" LastEditDate="2011-02-06T22:50:50.187" LastActivityDate="2011-02-06T22:50:50.187" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="200" PostTypeId="2" ParentId="115" CreationDate="2011-02-07T02:31:06.587" Score="15" Body="&lt;p&gt;There are several application of Lévy alpha-stable distributions to finance, especially in insurance and reinsurance. I believe that &lt;a href=&quot;http://books.google.com/books?id=BXOI2pICfJUC&amp;amp;printsec=frontcover&amp;amp;dq=mikosh+extremal+events&amp;amp;source=bl&amp;amp;ots=yS18YW3H5a&amp;amp;sig=7o9ofLu_T0Mw4Yo6RAefvXGzaKg&amp;amp;hl=en&amp;amp;ei=FVdPTYRnhvaAB9rQ2Tk&amp;amp;sa=X&amp;amp;oi=book_result&amp;amp;ct=result&amp;amp;resnum=1&amp;amp;ved=0CBMQ6AEwAA#v=onepage&amp;amp;q&amp;amp;f=false&quot;&gt;Embrechts-Kluppelberg-Mikosh's &quot;Modelling Extremal Events for Insurance and Finance&quot;&lt;/a&gt; is still an excellent reference. However, in the modeling of stock prices, this line of research is essentially inactive. The reason is that there is conclusive evidence that stock prices have finite second moments (for a survey, see &lt;a href=&quot;http://books.google.com/books?id=I-GMGwAACAAJ&amp;amp;dq=taylor+asset+price+dynamics+volatility&amp;amp;hl=en&amp;amp;ei=M1hPTeiJE8LagQe3wLky&amp;amp;sa=X&amp;amp;oi=book_result&amp;amp;ct=result&amp;amp;resnum=1&amp;amp;ved=0CDIQ6AEwAA&quot;&gt;Taylor's book&lt;/a&gt; or &lt;a href=&quot;http://www.proba.jussieu.fr/pageperso/ramacont/papers/empirical.pdf&quot;&gt;Cont's nice survey&lt;/a&gt;. This essentially rules out all stable distributions except the gaussian one. Stochastic volatility models using mixture of normals for the unconditional distributions and/or diffusion/jump processes are far more popular.&lt;/p&gt;&#xA;" OwnerUserId="194" LastActivityDate="2011-02-07T02:31:06.587" CommentCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="201" PostTypeId="2" ParentId="103" CreationDate="2011-02-07T03:22:11.923" Score="19" Body="&lt;p&gt;Suppose that you and other bettors participate in a lottery with $N$ possible outcomes; event will occur with probability $\pi_n$. There are $N$ basic contracts available for purchase. Contract $n$ costs $p_n$ and entitles you to one dollar if outcome $n$ occurs, zero otherwise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, imagine that you have a contingent claim that pays a complex payoff based on the outcome, say $f(n)$. The expected value of the payoff is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E(f(n))=\sum_n \pi_n f(n) =E(f)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, consider a portfolio of $f(1)$ units of basic contract $1$, $f(2)$ units of basic contract $2$, etc. This portfolio has exactly the same random payoff as the contingent claim. Because of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Law_of_one_price&quot;&gt;law of one price&lt;/a&gt;, it must have the same price as the contingent claim. Hence, the contingent claim has price equal to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{price}(f)=\sum_n p_n f(n)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Define $r= 1/(\sum_{i=1}^N  p_i)$ and set $\tilde p_n :=  r p_n$, which is a probability measure, and you can rewrite&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{price}(f)=r^{-1} \sum_n \tilde p_n f(n)=r^{-1} E^*(f)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the risk-neutral probabilities are essentially the normalized prices of &quot;state-contingent claims&quot;, i.e., outcome-specific bets. And the price of any claim is the discounted expectation according to this probability distribution. $r$ is easy to identify: if the contingent claim is 1 dollar for any outcome, then it's price is the discounted value of a dollar using the risk-free interest rate. Hence $r$ is the risk-free interest rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where do these prices come from? There are three ways to think about price determination:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;They are determined by a&#xA;non-arbitrage condition, where no&#xA;bettor can make something for&#xA;nothing almost surely;&lt;/li&gt;&#xA;&lt;li&gt;They are determined by an&#xA;equilibrium condition, where all&#xA;bettors optimize their utility;&lt;/li&gt;&#xA;&lt;li&gt;They are determined by a&#xA;single-agent utility optimization&#xA;problem.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;All conditions imply that the prices are strictly positive. For more information, Duffie's Dynamic Asset Pricing is still the standard reference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This basic intuition behind this framework goes back 35 years to Cox-Rubinstein. Harrison-Kreps extended the result, and since then it has further extended. The most general forms to useless level of technicality are by Delbaen and Schachermayer.&lt;/p&gt;&#xA;" OwnerUserId="194" LastEditorUserId="194" LastEditDate="2011-02-07T21:09:32.740" LastActivityDate="2011-02-07T21:09:32.740" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="202" PostTypeId="2" ParentId="156" CreationDate="2011-02-07T03:34:27.217" Score="25" Body="&lt;p&gt;Easily, the &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Efficient Market Hypothesis&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For many reasons. First, many adherents and critics support it for the wrong (often ideological) reasons. This applies even to well-known economists like John Quiggin. Second, because even fewer people know the extent and scope of the anomalies. The literature can get very technical. So even smart people rejecting the EMH, or publishing anomalies, end up being over-optimistic about their ability to beat the market.&lt;/p&gt;&#xA;" OwnerUserId="194" LastEditorUserId="194" LastEditDate="2011-02-07T14:59:24.077" LastActivityDate="2011-02-07T14:59:24.077" CommentCount="5" CommunityOwnedDate="2011-03-11T10:28:54.757" ContentLicense="CC BY-SA 2.5" />
  <row Id="203" PostTypeId="2" ParentId="156" CreationDate="2011-02-07T03:39:37.260" Score="19" Body="&lt;p&gt;My second best is &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Copulas&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I won't go as far as declaring gaussian copula &lt;a href=&quot;http://www.wired.com/techbiz/it/magazine/17-03/wp_quant?currentPage=all&quot;&gt;The formula that killed Wall Street&lt;/a&gt;&quot; (warning: lousy article), but will defer to T. Mikosch in his &lt;a href=&quot;http://www.math.ku.dk/~mikosch/Preprint/Copula/s.pdf&quot;&gt;very good paper&lt;/a&gt; on misuses of copulas.&lt;/p&gt;&#xA;" OwnerUserId="194" LastEditorUserId="194" LastEditDate="2011-02-07T14:59:57.803" LastActivityDate="2011-02-07T14:59:57.803" CommentCount="4" CommunityOwnedDate="2011-03-11T10:28:08.093" ContentLicense="CC BY-SA 2.5" />
  <row Id="204" PostTypeId="2" ParentId="156" CreationDate="2011-02-07T05:02:31.963" Score="5" Body="&lt;p&gt;It is dangerous when large proportions of the trading population &quot;religiously&quot; believe [as a matter of unexamined faith] that certain necessary assumptions which govern the accuracy of the models they use will always hold.  It is best to really understand how the models have been derived and to have a skeptics understanding of these assumptions and their impact.  All models have flaws -- yet it is possible to use flawed models if you can get consistent indicators from several different or contrarian approaches based upon radically different assumptions.  When the valuations from different approaches diverge, it is necessary to understand why -- when this happens, it is necessary to investigate the underlying assumptions ... this sort of environment often provides trading opportunities, but the environment can also quite easily be an opportunity for disaster.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, implicit and explicit assumptions are absolutely necessary to sufficiently simplify any mathematical analysis and to make it possible to derive models that can give lots of traders the generally useful trading &quot;yardsticks&quot; that they rely upon.  As an example, consider the Black-Scholes model.  The Black-Scholes model is ubiquitous; a commonly used &quot;yardstick&quot; for option valuations.  The Black-Scholes model of the market for a particular equity explicitly assumes that the stock price follows a geometric Brownian motion with constant drift and volatility.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This assumption of &quot;geometric Brownian motion with constant drift and volatility&quot; is never exactly true in the very strictest sense but, most of the time, it is a very useful, simplifying assumption because stock prices are often &quot;like&quot; this.  It might not be reality, but the assumption is a close enough approximation of reality.  This assumption is highly useful because of how makes it possible to apply stochastic partial differential equations methodology to the problem of determining appropriate option valuations.  However, the assumption of &quot;constant drift and volatility&quot; is a very dangerous assumption in times when judgement, wisdom and intuition would tell an experienced investor &quot;Something is &quot;odd.&quot;  It's as if we're in the calm before the storm.&quot;  OR  &quot;Crowd psychology and momentum seem to be more palpable factor in the prices right now.&quot;   &lt;/p&gt;&#xA;" OwnerUserId="121" LastActivityDate="2011-02-07T05:02:31.963" CommentCount="4" CommunityOwnedDate="2011-02-07T05:02:31.963" ContentLicense="CC BY-SA 2.5" />
  <row Id="205" PostTypeId="2" ParentId="194" CreationDate="2011-02-07T05:42:11.163" Score="4" Body="&lt;p&gt;One approach would be to rescale these metrics so that they are approximately normally distributed with unit variance under the null hypothesis that the stock's price is an unbiased geometric random walk (equivalently that the log returns are zero mean). This rescaling is effectively going to 'downweight' the statistics with a large amount of variance. Once they have been rescaled to approximate normality, one *could *combine them as you have done, in which case the sum of their squares would be a Chi square with 5 degrees of freedom under the null. It would probably be more appropriate, however, to simply take their mean, because sign should not be discarded, I think.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first two metrics should be easy to rescale.  The metrics involving maximum drawdown, however, are a bit tricky. You probably want to estimate the variance of these statistics under the null via a Monte Carlo simulation.&lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2011-02-07T05:42:11.163" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="206" PostTypeId="2" ParentId="156" CreationDate="2011-02-07T09:59:54.193" Score="15" Body="&lt;p&gt;&lt;strong&gt;Backtesting&lt;/strong&gt; - pure and simple. Its the logical and obvious thing to do right? Yet, so many pitfalls lie in wait. Be very careful people. Do it as little as possible and as late as possible. &lt;/p&gt;&#xA;" OwnerUserId="200" LastActivityDate="2011-02-07T09:59:54.193" CommentCount="6" CommunityOwnedDate="2011-02-07T09:59:54.193" ContentLicense="CC BY-SA 2.5" />
  <row Id="207" PostTypeId="2" ParentId="195" CreationDate="2011-02-07T11:36:41.677" Score="5" Body="&lt;p&gt;There are certain overlaps. One example is the so called &lt;a href=&quot;http://en.wikipedia.org/wiki/Favourite-longshot_bias&quot; rel=&quot;nofollow noreferrer&quot;&gt;favourite-longshot-bias&lt;/a&gt;, e.g.,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Stewart D. Hodges, Robert G. Tompkins, William T. Ziemba, &lt;a href=&quot;http://www.nccr-finrisk.uzh.ch/media/pdf/ziemba.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;The favorite-longshot bias in S&amp;amp;P 500 and FTSE 100 index futures options: the return to bets and the cost of insurance&lt;/a&gt; [PDF], November 27, 2002.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://favourite-longshot-bias.behaviouralfinance.net&quot; rel=&quot;nofollow noreferrer&quot;&gt;Favourite-Longshot Bias&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Another field is &lt;a href=&quot;http://en.wikipedia.org/wiki/Arbitrage_betting&quot; rel=&quot;nofollow noreferrer&quot;&gt;arbitrage betting&lt;/a&gt;, so called sure bets. The third field that comes to mind is risk management, especially the &lt;a href=&quot;http://en.wikipedia.org/wiki/Kelly_criterion&quot; rel=&quot;nofollow noreferrer&quot;&gt;Kelly formula&lt;/a&gt; and &lt;a href=&quot;https://books.google.de/books?id=xz4y3u-qM04C&amp;amp;lpg=PP1&amp;amp;dq=Fortune&amp;#39;s%20Formula&amp;amp;pg=PP1#v=onepage&amp;amp;q&amp;amp;f=false&quot; rel=&quot;nofollow noreferrer&quot;&gt;this wonderful book (Fortune's Formula by W. Poundstone)&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2018-05-14T17:52:18.393" LastActivityDate="2018-05-14T17:52:18.393" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="208" PostTypeId="1" AcceptedAnswerId="225" CreationDate="2011-02-07T11:48:42.807" Score="13" ViewCount="1395" Body="&lt;p&gt;In &lt;em&gt;Paul Wilmott on Quantitative Finance Sec. Ed.&lt;/em&gt; in vol. 3 on p. 784 and p. 809 the following stochastic differential equation: $$dS=\mu\ S\ dt\ +\sigma \ S\ dX$$ is approximated in discrete time by $$\delta S=\mu\ S\ \delta t\ +\sigma \ S\ \phi \ (\delta t)^{1/2}$$ where $\phi$ is drawn from a standardized normal distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This reasoning which seems to follow naturally from the definition of a &lt;a href=&quot;http://en.wikipedia.org/wiki/Wiener_process&quot; rel=&quot;nofollow noreferrer&quot;&gt;Wiener process&lt;/a&gt; triggered some thoughts and questions I cannot solve. Think of the following general diffusion process: $$dS=a(t,S(t))\ dt\ +b(t,S(t))\ dX$$ Now transform the second term in a similar fashion as above and drop the stochastic component:$$dS=a(t,S(t))\ dt\ +b(t,S(t))\ (dt)^{1/2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;NB:&lt;/strong&gt; The last term is &lt;em&gt;no&lt;/em&gt; &lt;a href=&quot;http://en.wikipedia.org/wiki/Riemann-Stieltjes&quot; rel=&quot;nofollow noreferrer&quot;&gt;Riemann-Stieltjes integral&lt;/a&gt; (that would e.g. be $d(t)^{1/2}$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My questions&lt;/strong&gt;&lt;br&gt;(1) How would you interpret the last formula and how can the (now deterministic) differential  equation be solved analytically? Will you get an additional term with a second derivative like in &lt;a href=&quot;http://en.wikipedia.org/wiki/Ito%27s_lemma&quot; rel=&quot;nofollow noreferrer&quot;&gt;Ito's lemma&lt;/a&gt;?&lt;br&gt;(2) Is the last term a &lt;a href=&quot;http://mathworld.wolfram.com/FractionalIntegral.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;fractional integral&lt;/a&gt; of order 1/2 (which is a &lt;a href=&quot;http://mathworld.wolfram.com/Semi-Integral.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Semi-Integral&lt;/a&gt;)? Or is this a completely different concept?&lt;br&gt;(3) Will there be a different result in the construction of the limit like with Ito integrals (from left endpoint) and &lt;a href=&quot;http://en.wikipedia.org/wiki/Stratonovich_integral&quot; rel=&quot;nofollow noreferrer&quot;&gt;Stratonovich integrals&lt;/a&gt; (average of left and right endpoint)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note&lt;/em&gt;: This is a cross-posting from &lt;a href=&quot;https://mathoverflow.net/questions/20091/deterministic-interpretation-of-stochastic-differential-equation&quot;&gt;mathoverflow&lt;/a&gt; where I got no answer to these questions.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="-1" LastEditDate="2017-04-13T12:58:47.233" LastActivityDate="2019-04-13T18:39:27.537" Title="Deterministic interpretation of stochastic differential equation" Tags="&lt;differential-equations&gt;&lt;stochastic-calculus&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="209" PostTypeId="1" AcceptedAnswerId="275" CreationDate="2011-02-07T12:01:02.797" Score="16" ViewCount="2256" Body="&lt;p&gt;There are many corporate actions that will affect the stock price, like dividend, stock split and rights.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given a large series of historical price data, how do we adjust the data to filter out the effect of the corporate action?&lt;/p&gt;&#xA;" OwnerUserId="191" LastEditorUserId="1355" LastEditDate="2011-09-08T20:44:41.943" LastActivityDate="2011-09-08T20:44:41.943" Title="How do strategies deal with corporate actions?" Tags="&lt;trading-systems&gt;&lt;corporate-actions&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="8" ContentLicense="CC BY-SA 2.5" />
  <row Id="212" PostTypeId="1" AcceptedAnswerId="231" CreationDate="2011-02-07T14:21:19.540" Score="12" ViewCount="1034" Body="&lt;p&gt;I've asked this &lt;a href=&quot;https://physics.stackexchange.com/questions/1873/the-concepts-of-path-integral-in-quantitative-finance&quot;&gt;question&lt;/a&gt; here at Physics SE, but I figured that some parts would be more appropriate to ask here. So I'm rephrasing the question again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know that for option value calculation, path integral is one way to solve it. But the solution I get from the Black-Scholes formula (derived from the &lt;a href=&quot;https://physics.stackexchange.com/questions/1873/the-concepts-of-path-integral-in-quantitative-finance&quot;&gt;above question&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{array}{rcl}\mathbb{E}\left[ F(e^{x_T})|x(t)=x \right] &amp;amp; = &amp;amp; \int_{-\infty}^{+\infty} F(e^{x_T}) p(x_T|x(t)=x) dx_T \\&#xA;&amp;amp; = &amp;amp; \int_{-\infty}^{+\infty} F(e^{x_T}) \int_{\tilde{x}(t)=x}^{\tilde{x}(T)=x_T} p(x_T|\tilde{x}(\tilde{t})) p(\tilde{x}(\tilde{t})|x(t)=x) d\tilde{x}(\tilde{t}) dx_T \end{array}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is very cryptic and simply unusable on a computer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, how can we program this solution? Or more generally, how can we devise computer algorithms to solve path integral problem in quantitative finance?&lt;/p&gt;&#xA;" OwnerUserId="129" LastEditorUserId="-1" LastEditDate="2017-04-13T12:40:17.967" LastActivityDate="2015-01-03T07:50:35.953" Title="Solving Path Integral Problem in Quantitative Finance using Computer" Tags="&lt;stochastic-calculus&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="213" PostTypeId="2" ParentId="147" CreationDate="2011-02-07T14:29:52.927" Score="13" Body="&lt;p&gt;&lt;strong&gt;Knowledge leads to profit BUT NOT the reverse&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;YOU&lt;/strong&gt; are the biggest risk to the process. All the hopes, wishes and &lt;a href=&quot;http://en.wikipedia.org/wiki/Cognitive_bias&quot; rel=&quot;nofollow&quot; title=&quot;bias&quot;&gt;bias&lt;/a&gt; you come with get in the way of making good decisions. The more you want something to be true, the more you have to kick the tires. So many people try out a bunch of random stuff, find a pattern that has a notional profit and just get blinded by dollar signs. That's when you start to skip over important details and you make all the sort of errors as detailed in the other answers here. Even when you are aware of these risks, they only get lip service while you are too busy grasping at the profit. You need to keep your feet on the ground and make reality based decisions. (Note that when you start to loose money fear takes the place of greed and you continue to make bad decisions)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remember that in the end your own or your clients wealth will rest on the decisions you make. You will have down days, when you see your wealth falling what will you do? Unless, you have rock solid faith in your process you will start to tinker and go into a death spiral. To have that faith you need to have absolute discipline right from the start. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Luckily, there is a well established approach that has been developed of thousands of years to tackle this problem and it has proved very successful. It's called the &lt;a href=&quot;http://en.wikipedia.org/wiki/Scientific_method&quot; rel=&quot;nofollow&quot; title=&quot;Scientific method&quot;&gt;Scientific method&lt;/a&gt;. At this point people throw up their arms and say that's too hard to understand or I don't have time for this. Well if you aren't prepared to work hard and spend the time, you've already lost. Believe me, I've done this for a long time now and I'm convinced this is the most valuable thing you can learn. It doesn't mean you have to have a PhD, wear a white coat and smoke a pipe. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The scientific method really is your friend here. Wandering away from reality into fantasy is so tempting but will lead to failure. Step away from the P&amp;amp;L! Don't look at the notional dollars instead work out what you know and what you can prove.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question -&gt; observe -&gt; theory -&gt; predict -&gt; measure -&gt; record/publish/peer review -&gt; repeat&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Think long and hard about what you believe are the facts/processes that underlie your strategy or idea. Ask questions - What properties can you measure?, what can you predict?, what is the cause? how long does it last?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Observe the world - yes this requires data but it doesn't require P&amp;amp;L! and probably not trading either. Form a theory on how the bits fit together then test this theory - make prediction and measure their success (accuracy etc. NOT P&amp;amp;L).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Objectively assess this new theory. If you are lucky enough to work in a team then this is where peer review and discussion really pay off. If you are on your own, then you face the hard task of dealing with all your behavioral biases and facing up to reality. Good luck with that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you make it to the end. Great job, you have learnt something new about the world or at least have an estimate and some associated uncertainty. Most importantly you can have &lt;em&gt;faith&lt;/em&gt; that it's right not just wishful thinking. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now repeat this process until you've built up a useful body of knowledge - a complete picture regarding your idea. Then and only then do you look at trying to best exploit what you know. This will probably lead to more research. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But finally you should have a strategy which you can finally back-test. As little as possible. With the minimum amount of data. If you've done the right job above you will already know what to expect and there shouldn't be many surprises. Resist the urge to tweak, and if you must - only do it with some careful thought and justification. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If its not the money machine that you expected then you made a mistake upstream - go back there and find out the piece you are missing. Start fiddling now and you're off to la la land again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do it right then you get to sleep better at night.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sorry to ramble, but I really do believe that not sticking to the scientific method is the biggest risk to the process.&lt;/p&gt;&#xA;" OwnerUserId="200" LastEditorUserId="200" LastEditDate="2014-06-06T09:45:59.160" LastActivityDate="2014-06-06T09:45:59.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="214" PostTypeId="1" CreationDate="2011-02-07T14:31:40.857" Score="53" ViewCount="5977" Body="&lt;p&gt;Everyone seems to agree that the option prices predicted by the Black-Merton-Scholes model are inconsistent with what is observed in reality. Still, many people rely on the model by using &quot;the wrong number in the wrong formula to get the right price&quot;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Question.&lt;/strong&gt; What are some of the most important contradictions that one encounters in quantitative finance? Are there any model-independent inconsistencies? Are some of these apparent paradoxes born more equal than the others (i.e. lead to better models)? &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I would like to limit the scope of the question to the contradictions arising in &lt;em&gt;quantitative finance&lt;/em&gt; (so the well-documented paradoxes of economics and probability theory such as the &lt;a href=&quot;http://en.wikipedia.org/wiki/St._Petersburg_paradox&quot; rel=&quot;noreferrer&quot;&gt;St. Petersburg paradox&lt;/a&gt; or &lt;a href=&quot;http://en.wikipedia.org/wiki/Allais_paradox&quot; rel=&quot;noreferrer&quot;&gt;Allais paradox&lt;/a&gt; are deliberately excluded).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt; (to adress Shane's comment). Hopefully, this question is different in focus and has a slightly more narrow scope than the previous question concerning  &lt;a href=&quot;https://quant.stackexchange.com/questions/156/what-concepts-are-the-most-dangerous-ones-in-quantitative-finance-work&quot;&gt;the most dangerous concepts in quantitative finance work&lt;/a&gt;. For instance, using VaR &quot;naively&quot; does not lead to immediate contradictions the way naive application of the BS model does. VaR may be considered inadequate because it seriously underestimates tail risks but it is not self-contradictory per se (please correct me if I'm wrong). Similarly, the EMH in its weaker forms may not be inconsistent with the market reality (at least the opposite has not been demonstrated decisively yet).      &lt;/p&gt;&#xA;" OwnerUserId="70" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2015-10-28T22:41:26.067" Title="Paradoxes in quantitative finance" Tags="&lt;black-scholes&gt;&lt;models&gt;" AnswerCount="7" CommentCount="5" FavoriteCount="44" CommunityOwnedDate="2011-02-07T16:06:29.650" ContentLicense="CC BY-SA 3.0" />
  <row Id="215" PostTypeId="2" ParentId="209" CreationDate="2011-02-07T14:38:05.580" Score="5" Body="&lt;p&gt;You can take a corporate action and look at a price before/after the event.  In general, this simply means applying a series of multiplicative or additive factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, with a $2:1$ stock split, the price following the event will be $1/2$ what it was prior to the split.  If you want to see the prices &lt;em&gt;as they were before&lt;/em&gt; then you need to multiply all future prices by 2.  On the other hand, if you want to see historical prices so that they are continuous with the new price level, you would need to divide them by 2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Stock dividends are also multiplicative, while cash dividends are additive (meaning that you would add or subtract the values).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many good price sources can give you prices adjusted or unadjusted.&lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2011-02-07T14:38:05.580" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="216" PostTypeId="2" ParentId="214" CreationDate="2011-02-07T14:42:47.587" Score="15" Body="&lt;p&gt;A very good book addressing such &quot;puzzles of finance&quot; — highly recommended!&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://books.google.de/books?id=iqMdG4TTWNYC&amp;amp;lpg=PP1&amp;amp;ots=FCP8K8OXTv&amp;amp;dq=puzzles%20of%20finance&amp;amp;hl=en&amp;amp;pg=PP1#v=onepage&amp;amp;q&amp;amp;f=false&quot; rel=&quot;noreferrer&quot;&gt;Puzzles of Finance: Six Practical Problems and Their Remarkable Solutions&lt;/a&gt; by Mark P. Kritzman&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The paradoxes that are treated here are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Siegel's Paradox.&lt;/li&gt;&#xA;&lt;li&gt;Likelihood of Loss.&lt;/li&gt;&#xA;&lt;li&gt;Time Diversification.&lt;/li&gt;&#xA;&lt;li&gt;Why the Expected Return Is Not To Be Expected.&lt;/li&gt;&#xA;&lt;li&gt;Half Stocks All the Time or All Stocks Half the Time?&lt;/li&gt;&#xA;&lt;li&gt;The Irrelevance of Expected Return on Option Valuation.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="12" LastEditorUserId="263" LastEditDate="2013-12-29T14:41:04.920" LastActivityDate="2013-12-29T14:41:04.920" CommentCount="0" CommunityOwnedDate="2011-04-02T02:50:30.090" ContentLicense="CC BY-SA 3.0" />
  <row Id="217" PostTypeId="2" ParentId="214" CreationDate="2011-02-07T15:07:08.987" Score="26" Body="&lt;p&gt;In the Interest Rates field there is one paradox in nowadays market conditions (i.e. since the crisis) that is quite tricky to properly understand.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the fact that one need several curves to have a correct pricing of simple interest derivatives such as Swap with floating index set to some Libor reference. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simply and crudely speaking, you have to build first a discount curve (generally based on OIS swap curve) and then use this curve to compute some &quot;adjusted&quot; forward Libor Rate (procedure that I improperly qualify as &quot;forwarding&quot;). The froward Libor Rates used to be calculated by discounting and &quot;forwarding&quot; (sorry for the term) on the very same curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is due to the fact that the once negligeable spreads between OIS and Libor Curves are now large enough to generate significant arbitrage if not properly taken into account. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The paradox comes from the fact that &quot;usual&quot; theory of pricing of linear interest rates derivatives asserts that there can be only one curve for discounting cash flows and &quot;forwarding&quot; floating index references otherwise there is arbitrage. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover the right discount curve can be even more problematic if multicurrency trade are involved (then the collateral currency and rate are important aspect of this topic).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The extension of the multicurve framework to the Risk Neutral Pricing is not easy to implement and many attempts are now published. I will add some references when I have enough time,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are a few references on the subject: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Fujii, Shimada, Takahashi — &quot;A Note on Construction of Multiple Swap Curves with and without Collateral&quot;&lt;/li&gt;&#xA;&lt;li&gt;Bianchetti — &quot;Two curves, One price&quot;  &lt;/li&gt;&#xA;&lt;li&gt;Henrard — &quot;The Irony in the Derivatives Discounting&quot;  &lt;/li&gt;&#xA;&lt;li&gt;Henrard — &quot;The Irony in the Derivatives Discounting II&quot;  &lt;/li&gt;&#xA;&lt;li&gt;Mercurio — &quot;Interest Rates and The Credit Crunch, New Formulas and Market Models&quot;  &lt;/li&gt;&#xA;&lt;li&gt;Mercurio — &quot;Libor Market Models with Stochastic Basis&quot;  &lt;/li&gt;&#xA;&lt;li&gt;Morini — &quot;Solving the Puzzle of Interest Rate Market&quot;  &lt;/li&gt;&#xA;&lt;li&gt;Moreni, Pallavicini — &quot;Parsimonious HJM Models for Multiple Yield-Curve Dynamics&quot;  &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="92" LastEditorUserId="263" LastEditDate="2013-12-29T14:45:04.677" LastActivityDate="2013-12-29T14:45:04.677" CommentCount="2" CommunityOwnedDate="2011-04-02T02:50:19.390" ContentLicense="CC BY-SA 3.0" />
  <row Id="218" PostTypeId="2" ParentId="208" CreationDate="2011-02-07T16:11:01.410" Score="2" Body="&lt;p&gt;1) This last DE is implicit equation. This can't be solved analytically. I guess you can solve it by finite difference method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) The last term is indeed a differential term of order 1/2. However, it is the term for time difference and it can remain in the equation as it is. In the final formula as well it will come out to be as difference term, implying that we use difference of time when substituting in the formula to compute stock price, or option price for that matter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) I am not sure about this part.&lt;/p&gt;&#xA;" OwnerDisplayName="user98" LastActivityDate="2011-02-07T16:11:01.410" CommentCount="7" ContentLicense="CC BY-SA 2.5" />
  <row Id="219" PostTypeId="1" AcceptedAnswerId="221" CreationDate="2011-02-07T16:16:19.097" Score="32" ViewCount="18838" Body="&lt;p&gt;What is the intuition behind cointegration? What does the Dickey-Fuller test do to test for it? Ideally, a non-technical explanation would be appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say you need to explain it to an investor and justify why your pairs trading strategy should make him rich!&lt;/p&gt;&#xA;" OwnerUserId="40" LastEditorUserId="1106" LastEditDate="2012-01-01T21:32:04.370" LastActivityDate="2014-11-12T20:43:03.297" Title="What is the intuition behind cointegration?" Tags="&lt;time-series&gt;&lt;statistics&gt;&lt;cointegration&gt;&lt;intuition&gt;" AnswerCount="6" CommentCount="0" FavoriteCount="25" ContentLicense="CC BY-SA 3.0" />
  <row Id="220" PostTypeId="2" ParentId="219" CreationDate="2011-02-07T16:18:47.113" Score="49" Body="&lt;p&gt;This one is quite easy: Think of a man walking his dog. He will go along and his dog will stroll along running back and forth. Man and dog are mathematically &quot;cointegrated&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an investor you bet that the dog is coming back to his master or that the leash has only a certain length.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-02-07T16:18:47.113" CommentCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="221" PostTypeId="2" ParentId="219" CreationDate="2011-02-07T16:24:21.430" Score="35" Body="&lt;p&gt;The standard story (also told by @vonjd) is of &quot;The Drunk and Her Dog&quot;.  This is based on &lt;a href=&quot;http://www.uta.edu/faculty/crowder/papers/drunk%20and%20dog.pdf&quot; rel=&quot;noreferrer&quot;&gt;&quot;A Drunk and Her Dog: An Illustration of Cointegration and Error Correction&quot;&lt;/a&gt; (1994).  The story is itself based on the standard illustration for a &lt;a href=&quot;http://en.wikipedia.org/wiki/Random_walk&quot; rel=&quot;noreferrer&quot;&gt;random walk&lt;/a&gt; known as the &quot;drunkard's walk&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://en.wikipedia.org/wiki/Dickey%E2%80%93Fuller_test&quot; rel=&quot;noreferrer&quot;&gt;Dickey-Fuller&lt;/a&gt; test is used to check for a &lt;a href=&quot;http://en.wikipedia.org/wiki/Unit_root&quot; rel=&quot;noreferrer&quot;&gt;unit root&lt;/a&gt;.  It can be used as part of the general Engle-Granger two-step method (although it isn't the only option).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, while the two assets themselves are not stationary, you are able to test if the residuals between a regression of the two assets &lt;em&gt;is&lt;/em&gt; &lt;a href=&quot;https://quant.stackexchange.com/questions/183/what-is-stationary-process/185#185&quot;&gt;stationary&lt;/a&gt;.  Most people prefer another approach, the &lt;a href=&quot;http://en.wikipedia.org/wiki/Johansen_test&quot; rel=&quot;noreferrer&quot;&gt;Johansen test&lt;/a&gt;, which uses a VECM model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The intuition behind pairs trading is that two cointegrated instruments will follow the same long-run path (since they presumably have some common factor, such as they are both oil companies and are heavily influenced by the price of oil), and any deviations will ultimately return back to the mean.  Needless to say, pairs trading (or any other form of statistical arbitrage) is still a risky endeavor, as should be clear by the performance of arbitrage funds.  &lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2014-06-01T17:21:53.897" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="222" PostTypeId="2" ParentId="219" CreationDate="2011-02-07T16:43:53.940" Score="23" Body="&lt;p&gt;Two time series $X_1$ and $X_2$  are cointegrated if a linear combination $aX_1+bX_2$ is stationary i.e. it has constant mean, standard deviation and autocorrelation function for some $a$ and $b$. In other words, the two series never stray very far from one another.&#xA;Cointegration might provide a more robust measure of the linkage between two financial quantities than correlation which is very unstable in practice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have borrowed the following two examples from Willmot's &lt;em&gt;Frequently Asked Questions in Quantitative Finance&lt;/em&gt;, one may be typical for a hedge fund trader and another illustrates the job of a mutual fund manager.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;A.&lt;/strong&gt; Suppose you have two stocks $S_1$ and $S_2$ and you find that $S_1 − 3 S_2$ is stationary, so that this combination never strays too far from its mean. If one day this ‘spread’ is particularly large then you would have sound statistical reasons for thinking&#xA;  the spread might shortly reduce, giving you a possible source of statistical arbitrage profit. This can be the basis for pairs trading.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;B.&lt;/strong&gt; Suppose we find that the S&amp;amp;P500 index is cointegrated with a portfolio of 15 stocks. We can then use these fifteen stocks to track the index. The error in this tracking&#xA;  portfolio will have constant mean and standard deviation, so should not wander too far from its average. This is clearly easier than using all 500 stocks for the tracking (when, of&#xA;  course, the tracking error would be zero).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="70" LastEditorUserId="70" LastEditDate="2011-02-07T17:08:44.230" LastActivityDate="2011-02-07T17:08:44.230" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="223" PostTypeId="2" ParentId="214" CreationDate="2011-02-07T18:04:39.440" Score="13" Body="&lt;p&gt;There is also the so-called Hakansson’s paradox that can be found in &lt;a href=&quot;http://www.ederman.com/new/docs/qf-Illusions-dynamic.pdf&quot; rel=&quot;nofollow&quot;&gt;Derman's article&lt;/a&gt; on dynamic replication.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Hakansson’s so-called paradox (Hakansson 1979, Merton&#xA;  1992) encapsulates the skepticism about dynamic replication:&#xA;  if options can only be priced because they can be&#xA;  replicated, then, since they can be replicated, why are they&#xA;  needed at all?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="15" LastEditorUserId="263" LastEditDate="2013-12-29T14:44:11.827" LastActivityDate="2013-12-29T14:44:11.827" CommentCount="3" CommunityOwnedDate="2011-02-07T18:04:39.440" ContentLicense="CC BY-SA 3.0" />
  <row Id="224" PostTypeId="2" ParentId="156" CreationDate="2011-02-07T18:48:43.657" Score="14" Body="&lt;p&gt;This isn't particularly insightful, but worth pointing out in this thread. Many people get caught up in the elegance and beauty of the mathematics and tend to be disconnected from the real world. &lt;/p&gt;&#xA;" OwnerUserId="122" LastActivityDate="2011-02-07T18:48:43.657" CommentCount="3" CommunityOwnedDate="2011-02-07T18:48:43.657" ContentLicense="CC BY-SA 2.5" />
  <row Id="225" PostTypeId="2" ParentId="208" CreationDate="2011-02-07T19:23:25.403" Score="9" Body="&lt;p&gt;(1) You analytically solve a stochastic differential equation (SDE) using &lt;a href=&quot;http://en.wikipedia.org/wiki/It%C5%8D%27s_lemma&quot; rel=&quot;noreferrer&quot;&gt;Ito's lemma&lt;/a&gt;. Your second equation (the discretized one) is how you could model &lt;em&gt;one&lt;/em&gt; path over &lt;em&gt;one&lt;/em&gt; step. To find the solution, you would model many of these paths over many steps and then take the expectation (i.e., Monte Carlo methods). The solution to the SDE models all of these paths simultaneously in expectation. You can't switch directly to discretized version and solve without some numerical technique like Monte Carlo. The differential notation is really just short hand for the more formal way to write the Ito process. For example: $$S_t = x + \int_0^t \mu_s S_s ds + \int_0^t \sigma_s S_s dW_s \Leftrightarrow dS_t = \mu_t S_t dt + \sigma_t S_t dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then use the expectation operator to find the expected stock price $S$ at time $t$ given the parameters and original stock price $x$. Do you have a specific problem? Maybe someone here could help you along. The stuff's pretty tricky, but notes that Steve Shreve later built into a textbook series are still available &lt;a href=&quot;http://www.stat.berkeley.edu/users/evans/shreve.pdf&quot; rel=&quot;noreferrer&quot;&gt;for free&lt;/a&gt;. His textbooks are pretty approachable if you'd like to learn more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) Different concept. Ito calculus is a bit different from the calculus we learn in high school and undergrad. The power of $1/2$ is in your second equation because of the variance-standard deviation conversion. I think the wikipedia and Shreve links above are the best place to start.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(3) I am not familiar with Stratonovich integrals.&lt;/p&gt;&#xA;" OwnerUserId="106" LastEditorUserId="106" LastEditDate="2011-02-08T11:34:34.153" LastActivityDate="2011-02-08T11:34:34.153" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="226" PostTypeId="1" CreationDate="2011-02-07T21:48:03.303" Score="33" ViewCount="59217" Body="&lt;p&gt;How do &lt;a href=&quot;http://en.wikipedia.org/wiki/Volatility_(finance)&quot; rel=&quot;noreferrer&quot;&gt;volatility&lt;/a&gt; and variance differ in finance and what do both imply about the movement of an underlying?&lt;/p&gt;&#xA;" OwnerUserId="205" LastEditorUserId="12" LastEditDate="2015-02-15T08:14:20.730" LastActivityDate="2020-01-08T11:03:14.143" Title="What is the difference between volatility and variance?" Tags="&lt;volatility&gt;&lt;variance&gt;" AnswerCount="9" CommentCount="1" FavoriteCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="227" PostTypeId="2" ParentId="212" CreationDate="2011-02-07T21:48:24.903" Score="0" Body="&lt;p&gt;You can use Monte Carlo methods to generate paths.&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2011-02-07T21:48:24.903" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="228" PostTypeId="2" ParentId="37" CreationDate="2011-02-07T21:56:26.457" Score="7" Body="&lt;p&gt;A high quality and reliable solution: &lt;br /&gt;&#xA;&lt;a href=&quot;http://www.nanex.net/&quot;&gt;http://www.nanex.net/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found out that you can't afford it if you have to ask for the price.&lt;/p&gt;&#xA;" OwnerDisplayName="user208" LastActivityDate="2011-02-07T21:56:26.457" CommentCount="2" CommunityOwnedDate="2011-02-07T21:56:26.457" ContentLicense="CC BY-SA 2.5" />
  <row Id="229" PostTypeId="2" ParentId="226" CreationDate="2011-02-07T22:01:37.103" Score="26" Body="&lt;p&gt;Volatility is typically &lt;em&gt;unobservable&lt;/em&gt;, and as such estimated --- for example via the (sample) variance of returns, or more frequently, its square root yielding the standard deviation of returns as a volatility estimate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are also countless models for volatility, from old applied models like &lt;a href=&quot;http://www.fea.com/resources/pdf/a_estimation_of_security_price.pdf&quot;&gt;Garman/Klass&lt;/a&gt; to exponential decaying and formal models such as &lt;a href=&quot;http://www.fea.com/resources/pdf/a_estimation_of_security_price.pdf&quot;&gt;GARCH&lt;/a&gt; or &#xA;&lt;a href=&quot;http://en.wikipedia.org/wiki/Stochastic_volatility&quot;&gt;Stochastic Volatility&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for forecasts of the &lt;em&gt;movement&lt;/em&gt;: well, that is a different topic as movement is the &lt;em&gt;first moment&lt;/em&gt; (mean, location) whereas volatility is a &lt;em&gt;second moment&lt;/em&gt; (dispersion, variance, volatility).  So in a certain sense, volatility estimates do &lt;em&gt;not&lt;/em&gt; give you estimates of future direction but of future &lt;em&gt;ranges&lt;/em&gt; of movement.&lt;/p&gt;&#xA;" OwnerUserId="69" LastEditorUserId="69" LastEditDate="2011-02-07T22:07:43.987" LastActivityDate="2011-02-07T22:07:43.987" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="230" PostTypeId="2" ParentId="226" CreationDate="2011-02-07T22:06:15.590" Score="1" Body="&lt;p&gt;Volatility is essentially quadratic variation.  It is a property of sample paths, not probability measures.  In other words, it can be calculated given a single historical path and doesn't depended upon the probability you assign to that path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Variance, and standard deviation, are functions of the probability you assign to events.&lt;/p&gt;&#xA;" OwnerUserId="212" LastActivityDate="2011-02-07T22:06:15.590" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="231" PostTypeId="2" ParentId="212" CreationDate="2011-02-07T22:06:15.860" Score="9" Body="&lt;p&gt;There are many numerical approaches to solving stochastic integrals such as the above.  Assuming that there is no closed form slight-of-hand, the easiest approach is the Monte Carlo approach.   I would recommend referring to Glasserman's excellent &quot;Monte Carlo Methods in Financial Engineering&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are not familiar with MC, think of it as evaluating millions of possible paths in N dimensional space (the space of your random variable x time) and computing the expectation from a probability weighted average.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Making MC work for you involves:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;modeling your distribution accurately&lt;/li&gt;&#xA;&lt;li&gt;being able to randomly sample your distribution over the simulation in such as way as to have uniformly sampled on its cumulative probability function&lt;/li&gt;&#xA;&lt;li&gt;having a good random N dimensional number generator with period &gt; total # of samples&lt;/li&gt;&#xA;&lt;li&gt;various tricks to reduce the required sample space&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="51" LastActivityDate="2011-02-07T22:06:15.860" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="232" PostTypeId="2" ParentId="226" CreationDate="2011-02-07T22:08:32.250" Score="12" Body="&lt;p&gt;By volatility people usually refer to to annualized standard deviation of an asset. For an asset it's usually quoted as a percentage of the asset price (i.e. the return volatility). For a portfolio, it is often quoted in currency units. Variance is the &lt;em&gt;square&lt;/em&gt; of the standard deviation. It is usually not quoted directly because it doesn't have an intuitive unit of measure. Instead, it is used in variance decomposition, e.g. the idiosyncratic variance of a portfolio is 6% of the total portfolio variance.&lt;/p&gt;&#xA;" OwnerUserId="194" LastActivityDate="2011-02-07T22:08:32.250" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="235" PostTypeId="1" AcceptedAnswerId="403" CreationDate="2011-02-07T22:50:44.870" Score="28" ViewCount="15472" Body="&lt;p&gt;For a vanilla option, I know that the probability of the option expiring in the money is simply the delta of the option...  but how would I calculate the probability, without doing monte carlo, of the underlying touching the strike at some time at or before maturity?&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2019-09-18T16:15:49.833" Title="Probability of touching" Tags="&lt;option-pricing&gt;&lt;probability&gt;" AnswerCount="11" CommentCount="3" FavoriteCount="13" ContentLicense="CC BY-SA 2.5" />
  <row Id="236" PostTypeId="1" AcceptedAnswerId="280" CreationDate="2011-02-07T22:54:40.780" Score="8" ViewCount="678" Body="&lt;p&gt;How can I use a binomial tree to price a European option that's based on a portfolio of equity products?  I have volatility and correlation matrix of all underlying products?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking for a formula based solution so that I use in Matlab.  Thanks.  &lt;/p&gt;&#xA;" OwnerUserId="223" LastActivityDate="2011-02-08T14:59:52.827" Title="How to use binomial tree for portfolio of equity products" Tags="&lt;option-pricing&gt;&lt;equities&gt;&lt;binomial-tree&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="237" PostTypeId="2" ParentId="27" CreationDate="2011-02-07T22:56:54.110" Score="5" Body="&lt;p&gt;Short answer:  volatility skew.&#xA;Longer answer: &#xA;investors are willing to pay more for out of the money puts (disaster hedge).&lt;br&gt;&#xA;This buying bids up the price of puts, which makes the volatility implied by those prices go up.&lt;br&gt;&#xA;calls and puts at the same strike must trade roughly at the same implied volatility otherwise there is arbitrage, this is why you see the same phenomenon for lower strike calls.&#xA;(investors are less willing to do this when buying out of the money calls(higher strikes), and so those options typically trade at lower bids, and lower implied volatility.&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-02-07T22:56:54.110" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="238" PostTypeId="2" ParentId="235" CreationDate="2011-02-07T23:00:35.663" Score="2" Body="&lt;p&gt;This surely isn't the most efficient way, but if you want something quick and dirty:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could run a vanilla model that calcs delta for each expiration date between now and expiration, and grab the delta for each.  That would give you the likelihood that it's in the money at the close on any day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From that, you can pretty easily calculate the odds that it's &lt;em&gt;not&lt;/em&gt; in the money each day (just subtract the delta from one), multiply them all together, and subract the product from one to determine the likelihood that it closes above the strike between now and expiration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This does require running the formula to calc delta many times, and it ignores the risk of an intra-day touch, but it doesn't require writing something to calc the exotic you're describing.&lt;/p&gt;&#xA;" OwnerUserId="205" LastEditorUserId="205" LastEditDate="2011-02-08T00:52:51.910" LastActivityDate="2011-02-08T00:52:51.910" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="239" PostTypeId="2" ParentId="195" CreationDate="2011-02-07T23:40:46.930" Score="4" Body="&lt;p&gt;There's a very interesting article about this: &lt;a href=&quot;http://www.wired.com/magazine/2010/11/ff_midas&quot; rel=&quot;nofollow&quot;&gt;http://www.wired.com/magazine/2010/11/ff_midas&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Wall Street Firm Uses Algorithms to Make Sports Betting Like Stock Trading&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The cornerstone of the operation is a piece of number-crunching software called Midas. It functions like the predictive computer programs that Amaitis dealt with on Wall Street: Midas acquires information, processes it, finds mathematical patterns and correlations, and uses all of that to divine the ever-shifting odds of sporting events. The system is robust enough to handle the play-by-play handicapping that keeps Jimmy E. glued to every pitch of the Tigers-White Sox game. During basketball season, things move so quickly that the bettors at the M have about eight seconds to consider a wager before the odds change.&lt;/p&gt;&#xA;" OwnerUserId="225" LastActivityDate="2011-02-07T23:40:46.930" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="240" PostTypeId="1" AcceptedAnswerId="242" CreationDate="2011-02-07T23:50:26.813" Score="15" ViewCount="4980" Body="&lt;p&gt;I've always wondered about this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have a series of options, with the expires spaced let's say one week between them, and you search for each expiration date the option with the smallest premium, would the series of strikes represent the current market predicted path of the asset?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you use that information to speculate the spot price?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe that this paper is about a similar approach: &lt;a href=&quot;http://ideas.repec.org/p/ihs/ihsesp/104.html&quot;&gt;http://ideas.repec.org/p/ihs/ihsesp/104.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="225" LastActivityDate="2018-01-29T14:38:54.967" Title="Is it possible to use a series of option prices to predict the most likely path of an asset?" Tags="&lt;option-strategies&gt;" AnswerCount="6" CommentCount="2" FavoriteCount="7" ContentLicense="CC BY-SA 2.5" />
  <row Id="241" PostTypeId="2" ParentId="226" CreationDate="2011-02-08T00:19:44.017" Score="17" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The main underlying difference is in their definition. Variance has a fixed mathematical definition, however volatility does not as such. Volatility is said to be the measure of fluctuations of a process.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Volatility is a subjective term, whereas variance is an objective term i.e. given the data you can definitely find the variance, while you can't find volatility just having the data. Volatility is associated with the process, and not with the data.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In order to know the volatility you&#xA;need to have an idea of the process&#xA;i.e you need to have an&#xA;observation of the dispersion of the&#xA;process. All the different processes will have different methods to compute volatilities based on the underlying assumptions of the process.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerDisplayName="user98" LastActivityDate="2011-02-08T00:19:44.017" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="242" PostTypeId="2" ParentId="240" CreationDate="2011-02-08T01:03:27.863" Score="9" Body="&lt;p&gt;If you think of a path as a series of ranges then your idea kind of makes sense.&#xA;However, I don't think you would get a path out of this approach, just a series of ranges.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&#xA;Taking one expiry, the prices in a chain imply a range of price movements between today and expiration.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take the SPX(at say 1300) and VIX, for example, is at 15.8 and the SPX option chain that you are looking at is 30 days from expiry. That tells you that there is approximately a 68% probability that the SPX will be between approximately 1370 and 1230 at the end of 30 days, or a 68% probability that it will be within 1% of 1300 in 1 day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Running this example on multiple chains would only expand the range(implied vol is increasing in later expiries), or contract the range(implied vol is decreasing in later expiries).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;----- idea -----&#xA;If you had access to a standardized/liquid market of path dependant options, you might be able to narraw the range down somewhat.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you did arrive at a narrow path estimate, it would change frequently with volatility... what would be the value of this path estimate?&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-02-08T01:03:27.863" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="244" PostTypeId="2" ParentId="240" CreationDate="2011-02-08T02:17:19.120" Score="3" Body="&lt;p&gt;If you're asking &quot;can I get a prediction of a future price from an option chain&quot;, then, no, I don't think so. The value of an option does not depend on the underlying stock's drift, or price expectation,  because this expectation is already reflected in the stock's current price. Given the risk-free rate and the time to expiration, all that you can back out of the option price is the implied volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The intuition is that we don't really value options in absolute terms, but in terms of the underlying stock.&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-02-08T02:17:19.120" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="245" PostTypeId="2" ParentId="240" CreationDate="2011-02-08T02:17:50.630" Score="6" Body="&lt;p&gt;Just would like to expand on user214's answer: you can use options to predict underlying in probabilistic sense. As you know option prices imply a certain distribution - you can find expected value for stock, and volatility around that value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you assume a particular distribution (for example normal distribution for returns) you can derive expected high (over some period of time), expected low, expected range, expected drawdown, probabilities for different paths, etc. That is not something you should do in practice, or do it and know the limitations of such model-based estimates (that is what I do in trading). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have access to exotic, particularly path-dependent options you can fit more complicated models, and figure out what they predict about the stock price. While you can fit more realistic models to only vanilla options, such fits are not robust, because they depend only on terminal distribution of the underlying, and not its path. &lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2011-02-08T02:17:50.630" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="246" PostTypeId="2" ParentId="209" CreationDate="2011-02-08T02:30:53.693" Score="3" Body="&lt;p&gt;It appears like you're asking for steps on how to process large datasets. &#xA;The best solution for handling/processing/filtering these things is a relational database. &#xA;I use MySQL or Oracle most of the time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is something that I usually do:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Lay down all your data in one sheet/table (make sure you have a column for date, and  another unique identifier like hour of day)&lt;/li&gt;&#xA;&lt;li&gt;Import the data into a MySQL/Oracle Database table.&lt;/li&gt;&#xA;&lt;li&gt;Apply your filters for each query you make. (select according to a range)&lt;/li&gt;&#xA;&lt;li&gt;Update the tables according to corporate events. e.g. If you experience par value adjustments multiply it with the appropriate factors. You can even have a separate table listing the events and you can use nested SQL to filter them as they update. &lt;/li&gt;&#xA;&lt;li&gt;You now have an adjusted Dataset. &lt;/li&gt;&#xA;&lt;li&gt;Live like a boss.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;:D&lt;/p&gt;&#xA;" OwnerUserId="233" LastActivityDate="2011-02-08T02:30:53.693" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="247" PostTypeId="1" CreationDate="2011-02-08T02:34:17.810" Score="10" ViewCount="1672" Body="&lt;p&gt;For the Black-Scholes model my feeling is that the volatility parameter is like sweeping stuff under the rug.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there models which improve on the volatility aspect of Black-Scholes by adding other parameters (I'm guessing things like the distribution of past returns, or perhaps some measure of debt load held by the company).&lt;/p&gt;&#xA;" OwnerUserId="188" LastActivityDate="2013-07-31T15:43:43.337" Title="Extensions of Black-Scholes model" Tags="&lt;black-scholes&gt;&lt;option-pricing&gt;&lt;volatility&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="248" PostTypeId="1" AcceptedAnswerId="256" CreationDate="2011-02-08T02:36:37.700" Score="5" ViewCount="3290" Body="&lt;p&gt;Does the debt load of a company have an impact on the stock price of a company and its volatility? Also, how does the market react to the announcement of a company issuing bonds?&lt;/p&gt;&#xA;" OwnerUserId="188" LastEditorUserId="1106" LastEditDate="2011-09-09T16:40:15.170" LastActivityDate="2011-09-09T17:39:14.223" Title="Does the debt load affect the volatility of equity?" Tags="&lt;volatility&gt;&lt;equities&gt;&lt;fixed-income&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="249" PostTypeId="1" AcceptedAnswerId="290" CreationDate="2011-02-08T02:37:32.067" Score="14" ViewCount="4543" Body="&lt;p&gt;Forward volatility implied by SPX options, and that of VIX futures get out of line. If there existed VIX SQUARED futures they could easily be replicated (and arbitraged) with a strip of SPX options. However replicating VIX futures would theoretically require dynamic trading in options (all strikes) and is also would depend on the model for distribution of vol of vol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question for traders: have you or someone you know ever traded SPX options (variance) vs VIX futures, and if yes then please provide some clues. Please don't write that there is an academic article about this; I'm asking if someone did this is practice.&lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2016-04-26T16:38:47.610" Title="SPX options vs VIX futures trading" Tags="&lt;volatility&gt;&lt;vix&gt;&lt;arbitrage&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="6" ContentLicense="CC BY-SA 2.5" />
  <row Id="250" PostTypeId="1" AcceptedAnswerId="274" CreationDate="2011-02-08T02:41:46.133" Score="5" ViewCount="998" Body="&lt;p&gt;The model assumption of the Black-Scholes formula has two parameters for the geometric Brownian motion, the volatility $\sigma$ and the expected growth $\mu$ (which disappears in the option formulae). How can this parameter $\mu$ be estimated?&lt;/p&gt;&#xA;" OwnerUserId="188" LastActivityDate="2011-02-08T22:00:33.247" Title="Expected Growth" Tags="&lt;black-scholes&gt;&lt;interest-rates&gt;&lt;brownian-motion&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="251" PostTypeId="1" AcceptedAnswerId="281" CreationDate="2011-02-08T02:56:39.583" Score="26" ViewCount="4095" Body="&lt;p&gt;How much is QuantLib used in industry and how much street cred does it have?&lt;/p&gt;&#xA;" OwnerUserId="188" LastActivityDate="2012-01-27T15:51:49.440" Title="QuantLib in industry" Tags="&lt;software&gt;&lt;quantlib&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="8" ContentLicense="CC BY-SA 2.5" />
  <row Id="252" PostTypeId="2" ParentId="250" CreationDate="2011-02-08T03:20:14.277" Score="2" Body="&lt;p&gt;I take it that μ is the drift of the long-term equilibrium price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;let's take a lognormal model as an example,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;dS = μ x dt + σ x S x dz&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;S= spot,&#xA;t = time,&#xA;T-t = length of time &#xA;μ = drift rate,&#xA;σ = volatility,&#xA;dz= random variable,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to solve for μ, you might first want to look for the expected spot price:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;given X = ln(S),&lt;/p&gt;&#xA;&#xA;&lt;p&gt;dX = ((μ - σ)dt)/2 + σdz&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This allows us to solve for X,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ST  = St e ^((μσ^2/2)(T-t) -σdz)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking the expected value of both Sides:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E[ST] = S e ^(μ(T-t))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This equation can be used to look for your expected growth, μ&lt;/p&gt;&#xA;" OwnerUserId="233" LastActivityDate="2011-02-08T03:20:14.277" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="253" PostTypeId="2" ParentId="250" CreationDate="2011-02-08T03:33:50.020" Score="0" Body="&lt;p&gt;The drift term, $\mu$ is assumed to follow from the 'no-arbitrage' assumption. That is, if $\mu$ were greater than the risk-free rate, one would borrow at the risk-free rate, invest in the stock, and collect the difference. If the stock may be freely borrowed, and $\mu$ is less than the risk free rate, one would short the stock and invest in the risk-free rate, and collect the difference.&lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2011-02-08T03:33:50.020" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="254" PostTypeId="1" AcceptedAnswerId="321" CreationDate="2011-02-08T03:39:19.983" Score="8" ViewCount="667" Body="&lt;p&gt;Can Someone Explain to me what this term means, and how it's used?&lt;/p&gt;&#xA;" OwnerUserId="233" LastActivityDate="2011-02-08T22:11:12.113" Title="Black-Equivalent Volatility" Tags="&lt;volatility&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="255" PostTypeId="2" ParentId="189" CreationDate="2011-02-08T05:17:44.093" Score="7" Body="&lt;p&gt;I think this has something to do with my question (&quot;&lt;a href=&quot;https://quant.stackexchange.com/questions/254/black-equivalent-volatility&quot; title=&quot;Black-Equivalent Volatility&amp;quot;&quot;&gt;Black Equivalent Volatility&lt;/a&gt;&quot;). I just realized that the answer might be your question: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Knowing this information what could be the appropriate measure of computing volatility of the economic returns?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In Energy Markets, like oil and electricity, one model we use is the mean reversion in the natural log of the spot prices.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d(ln(S)) = a(b-ln(S))de + vdz$$&#xA;where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S$ = spot price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$t$ = time of observation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$a$ = rate of mean reversion&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$v$ = volatility&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$b$ = long-term equilibrium&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dz$ = random stochastic variable&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now there are books that would show you how to solve for the volatility in that equation but i think the best one for me is Dragana Pilipovic's book entitled &quot;Energy Risk 2nd Ed&quot; (chapter 5, page 108)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And I think the black-equivalent volatility is a short-form equation that you can use off the bat. So here is my answer to your question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;black-equivalent volatility =  volatility x $\sqrt{(1-e^{-2aT})/2aT }$&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$T$ = period of time (20 years)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$a$ = rate of mean reversion &lt;/p&gt;&#xA;" OwnerUserId="233" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-07-12T09:30:21.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="256" PostTypeId="2" ParentId="248" CreationDate="2011-02-08T06:23:36.907" Score="6" Body="&lt;p&gt;Q1 - Yes, debt load has an impact on the stock price.  For instance, say you are valuing a company with a discounted cash flow model, while the interest won't affect the operational cash flows, it will increase the cost of capital.  With that, the perceived value will be less than a similar company with less debt.  Debt will also affect the volatility of the equity.  As debt becomes a larger portion of the old Assets = Liabilities + Equity equation, changes in asset value will have a larger sway on Equity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q2 - Depends.  If the market perceives that the company needs more debt to fund capital expenditures due to opportunity, then the market should react positively.  If they're issuing debt and the market thinks this is a poor choice, the market with punish the stock.  As a caveat, if they issue debt to buy back stock the market will almost always act positively due to less shares for trade.    &lt;/p&gt;&#xA;" OwnerUserId="60" LastActivityDate="2011-02-08T06:23:36.907" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="257" PostTypeId="1" AcceptedAnswerId="414" CreationDate="2011-02-08T07:49:55.303" Score="8" ViewCount="1016" Body="&lt;p&gt;Many times, we want to calculate VaR using some parametric approach (delta-normal approximation for instance) when historical simulation or monte carlo are simply to slow. This is fine as long as only the deltas are needed and the instruments are reasonably linear.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when the approach is extended to use both deltas and gammas, it is no longer certain that the approach is computationally efficient compared to the simulation-based methods since the calculation of a complete matrix of cross-gammas between the risk factors (nbr of RFs &gt;10000) becomes a very heavy task.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any &quot;justifications&quot;/old-wives-tales/adhoc methods on how to limit the nbr of gammas to calculate that has been used used with good result in the industry? One obvious simplification is of course to skip all cross-gammas and only calc the diagonal of the matrix but that feels dangerous.&lt;/p&gt;&#xA;" OwnerUserId="32" LastEditorUserId="35" LastEditDate="2012-08-08T12:57:00.600" LastActivityDate="2012-08-08T12:57:00.600" Title="How to limit the nbr of cross-gamma calculations in a delta-gamma VaR calculation?" Tags="&lt;var&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="258" PostTypeId="2" ParentId="251" CreationDate="2011-02-08T08:17:42.957" Score="16" Body="&lt;p&gt;Based on anecdata (conversations with other quants), not much. Banks develop their own models and if they do outsource the effort, they pay someone for the code + support (there are companies like Numerix or Pricing Partners which do that). QuantLib is criticized for being poorly documented and convoluted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My own observation is that the parts of QuantLib I was interested in (LMM) weren't particularly advanced, so if I were to make a call, I would see no point to make an effort to integrate this code with the rest of my bank's systems.&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2011-02-08T08:17:42.957" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="260" PostTypeId="1" CreationDate="2011-02-08T09:12:56.647" Score="8" ViewCount="734" Body="&lt;p&gt;It was pointed in an other question that ensemble methods can help to reduce curve fitting. &#xA;What are your experience with these and which one seems the most appropriate? If I had two forecasters that give reasonably good results. Would it be better to use both and invest half in each (diversification) or use one of the ensemble method?&lt;/p&gt;&#xA;" OwnerUserId="155" LastActivityDate="2011-02-08T13:41:46.523" Title="What are the ensemble techniques to forecast returns?" Tags="&lt;backtesting&gt;&lt;forecasting&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 2.5" />
  <row Id="261" PostTypeId="1" CreationDate="2011-02-08T09:48:36.943" Score="2" ViewCount="20094" Body="&lt;p&gt;What is the difference between the two?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Today in the FT I see that UBS is the second biggest 'wealth manager' after BOA whilst I was always under the impression that Blackrock was the largest asset manager.&lt;/p&gt;&#xA;" OwnerUserId="103" LastEditorUserId="117" LastEditDate="2011-02-09T02:17:55.490" LastActivityDate="2011-02-09T02:17:55.490" Title="Wealth Management Vs Asset Management" Tags="&lt;finance&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ClosedDate="2011-02-08T19:28:43.517" ContentLicense="CC BY-SA 2.5" />
  <row Id="262" PostTypeId="1" CreationDate="2011-02-08T09:49:04.230" Score="4" ViewCount="2810" Body="&lt;p&gt;This is a bit of a subjective question and relates primarily to the UK market&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a number of banks who are lending at BOE + 1.49% (ie: 1.99 %) whilst at the same time accepting deposits paying 2.75% &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Granted the 2.75 is a bonus rate but I just cannot understand how writing these kind of mortgages are beneficial froma a banks perspective&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:  The terms were in fact on a two year fix with the ability to refinance tpo another provider.  The answer to this question was in fact that the bank is able to artifically create moiney by fractional reserve banking and is further able to source funds from the BoE direct.  &lt;/p&gt;&#xA;" OwnerUserId="103" LastEditorUserId="103" LastEditDate="2014-10-01T10:30:04.017" LastActivityDate="2014-10-01T10:30:04.017" Title="How do banks actually make money on mortgages" Tags="&lt;finance&gt;" AnswerCount="4" CommentCount="4" FavoriteCount="1" ClosedDate="2011-02-08T19:38:01.723" ContentLicense="CC BY-SA 3.0" />
  <row Id="263" PostTypeId="2" ParentId="235" CreationDate="2011-02-08T10:15:05.880" Score="7" Body="&lt;p&gt;Allow me to disagree with Jaydles' proposal ; his methodology is valid only if the events of touching the barrier on each were independent. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are working within the standard Black-Scholes framework, you're looking for the probability of a drifted Brownian motion hitting a fixed level before a fixed time ; this probability is derived in most stochastic calculus texts, see for example Karatzas-Shreve or Chesney-Jeanblanc-Yor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way of seeing it : you're trying to price a knock-in digital option with 0 interest rate, or knock-in zero bond. You can find formulae for these in Peter Carr's work on barrier options.&lt;/p&gt;&#xA;" OwnerUserId="250" LastActivityDate="2011-02-08T10:15:05.880" CommentCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="264" PostTypeId="2" ParentId="219" CreationDate="2011-02-08T10:21:00.437" Score="12" Body="&lt;p&gt;The somewhat tongue-in-cheek blog post &lt;a href=&quot;http://www.portfolioprobe.com/2010/10/18/american-tv-does-cointegration/&quot;&gt;http://www.portfolioprobe.com/2010/10/18/american-tv-does-cointegration/&lt;/a&gt; includes the example of two classes of shares on the same company.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case you have two assets that are essentially the same but with a few details different.  The buying and selling of these assets will make the prices fluctuate from each other.  However they are unlikely to stray too far from each other because there will be arbitrageurs that will bring the prices back together.  Arbitrage is the leash in the human-canine analogy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But there is a difference between cointegration and high correlation.  I'm guessing that a lot of pairs trading based on &quot;cointegration&quot; is actually based on high correlation.  The difference is risk: if two assets are truly cointegrated, then they will eventually snap back towards each other; two assets that have a history of high correlation need not snap back together.&lt;/p&gt;&#xA;" OwnerUserId="249" LastActivityDate="2011-02-08T10:21:00.437" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="266" PostTypeId="2" ParentId="82" CreationDate="2011-02-08T10:48:24.853" Score="-1" Body="&lt;p&gt;I have worked with First Futures at the time developing their Strategy Studio against our platform, has back testing and algo tuning possibilities: &lt;a href=&quot;http://www.firstfuturessoftware.com/products/strategystudio.php&quot; rel=&quot;nofollow&quot;&gt;http://www.firstfuturessoftware.com/products/strategystudio.php&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user251" LastActivityDate="2011-02-08T10:48:24.853" CommentCount="0" CommunityOwnedDate="2011-02-08T10:48:24.853" ContentLicense="CC BY-SA 2.5" />
  <row Id="267" PostTypeId="2" ParentId="121" CreationDate="2011-02-08T11:29:32.447" Score="2" Body="&lt;p&gt;I think a good approach is to compare your two covariance matrices on a set of random portfolios (see for instance &lt;a href=&quot;http://www.portfolioprobe.com/about/applications-of-random-portfolios/assess-risk-models/&quot; rel=&quot;nofollow&quot;&gt;http://www.portfolioprobe.com/about/applications-of-random-portfolios/assess-risk-models/&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you want is a high correlation (across the portfolios) between the predicted and realized portfolio volatility.  We're never going to estimate the level of volatility especially well.  But if you get the right ranking across portfolios, then that is as much as you can ask.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be best to generate random portfolios that look like the ones you will actually have, but even naively generated portfolios may be good enough.&lt;/p&gt;&#xA;" OwnerUserId="249" LastActivityDate="2011-02-08T11:29:32.447" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="268" PostTypeId="2" ParentId="247" CreationDate="2011-02-08T11:32:16.530" Score="5" Body="&lt;p&gt;The Black-Scholes model assumes that the underlying volatility is constant over the life of the derivative, which is indeed a gross oversimplification. &lt;a href=&quot;http://en.wikipedia.org/wiki/Stochastic_volatility&quot;&gt;Stochastic Volatility&lt;/a&gt; models improve on that assumption by making volatility dependent on additional parameters such as distribution of returns and variance itself. However, the well known stochastic volatility models do not include company fundamentals among their parameters. &lt;/p&gt;&#xA;" OwnerUserId="53" LastActivityDate="2011-02-08T11:32:16.530" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="269" PostTypeId="2" ParentId="140" CreationDate="2011-02-08T11:40:55.330" Score="7" Body="&lt;p&gt;This blog post points to a presentation about backtesting and data snooping: &lt;a href=&quot;http://www.portfolioprobe.com/2010/11/05/backtesting-almost-wordless/&quot;&gt;http://www.portfolioprobe.com/2010/11/05/backtesting-almost-wordless/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the only non-datasnooping method there is is to trade live.  But the problem of data snooping can be reduced by seeing how significant the backtest result is compared to what would have happened if the trades were random.  Using this technology also makes it clear that backtesting results can easily be deceiving.&lt;/p&gt;&#xA;" OwnerUserId="249" LastActivityDate="2011-02-08T11:40:55.330" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="270" PostTypeId="2" ParentId="260" CreationDate="2011-02-08T12:48:51.157" Score="7" Body="&lt;p&gt;Ensemble methods, or &lt;a href=&quot;http://en.wikipedia.org/wiki/Ensemble_learning&quot;&gt;ensemble learning&lt;/a&gt; are a class of statistical methods that, loosely speaking, operate on &lt;em&gt;many&lt;/em&gt; rather than a single instance of the data.  Think bootstrapping, but then combine the estimates for an aggregate. The &lt;a href=&quot;http://en.wikipedia.org/wiki/Ensemble_learning&quot;&gt;Wikipedia link&lt;/a&gt; has more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Combining two forecasters is something else that is sometimes called &lt;a href=&quot;http://www.google.com/webhp?sourceid=chrome-instant&amp;amp;ie=UTF-8&amp;amp;ion=1&amp;amp;nord=1#hl=en&amp;amp;sugexp=ldymls&amp;amp;xhr=t&amp;amp;q=pooling+forecasts&amp;amp;cp=0&amp;amp;qe=cG9vbGluZyBmb3Jl&amp;amp;qesig=ZJHlsP2SSloq8fj5g4vhww&amp;amp;pkc=AFgZ2tlTEByw1xxXxY8Syk-Ov0zN_-HfCTHAxwPXXx8CsMAedOgKyGqhehOqwXTc9w3FPMfQVI1eKiP3rH6bvjxy891Pu9cv9A&amp;amp;pf=p&amp;amp;sclient=psy&amp;amp;nord=1&amp;amp;site=webhp&amp;amp;source=hp&amp;amp;aq=0v&amp;amp;aqi=&amp;amp;aql=&amp;amp;oq=pooling+fore&amp;amp;pbx=1&amp;amp;fp=5b2df7f8ff10eaf9&amp;amp;ion=1&quot;&gt;pooling forecasts&lt;/a&gt; or, more generally, &lt;a href=&quot;http://en.wikipedia.org/wiki/Consensus_forecast&quot;&gt;consensus forecast&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main difference is that the pieces in an ensemble method are related---pooling is from the same class or instance of an estimate---whereas pooled forecast are aggregating over different forecast which may not have any commonality.&lt;/p&gt;&#xA;" OwnerUserId="69" LastEditorUserId="69" LastEditDate="2011-02-08T13:41:46.523" LastActivityDate="2011-02-08T13:41:46.523" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="271" PostTypeId="2" ParentId="261" CreationDate="2011-02-08T13:03:46.107" Score="1" Body="&lt;p&gt;Wealth management typically refers to the management of the personal wealth of high net worth (HNW) individuals. Asset management, on the other hand, usually means managing the assets on the behalf of a larger entity (pension funds, insurance companies, endowments, etc). &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Some banks provide both services&lt;/li&gt;&#xA;&lt;li&gt;Some larger entities do their own asset management (some less successfully, like Harvard)&lt;/li&gt;&#xA;&lt;li&gt;Wealth management could be used even by smaller banks for retail customer assets (401k allocation, etc)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="253" LastActivityDate="2011-02-08T13:03:46.107" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="272" PostTypeId="2" ParentId="240" CreationDate="2011-02-08T13:16:26.903" Score="10" Body="&lt;p&gt;A further comment on user214's answer : the probability distribution of the future value of the index that you imply from option prices is its distribution under the (market) risk-neutral measure, which generally different from the true historical measure. In particular, option prices do not give information about the risk premium. There is a vast literature about this, but a good start is &lt;a href=&quot;http://www.statslab.cam.ac.uk/~chris/papers/caution.pdf&quot;&gt;this paper from Chris Rogers and Steve Satchell&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, European option prices give you information about the marginal distributions of the index at fixed maturities, but they give you no clue about the dynamical properties of the value process, that is, the distribution of the paths.&lt;/p&gt;&#xA;" OwnerUserId="250" LastActivityDate="2011-02-08T13:16:26.903" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="273" PostTypeId="2" ParentId="240" CreationDate="2011-02-08T13:45:08.937" Score="5" Body="&lt;p&gt;This is the paper for you:&lt;br&gt;&#xA;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1107464&quot; rel=&quot;noreferrer&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1107464&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the abstract:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The shape of the volatility smirk has significant cross-sectional predictive power for future equity returns. Stocks exhibiting the steepest smirks in their traded options underperform stocks with the least pronounced volatility smirks in their options by around 10.9% per year on a risk-adjusted basis. This predictability persists for at least six months, and firms with the steepest volatility smirks are those experiencing the worst earnings shocks in the following quarter. The results are consistent with the notion that informed traders with negative news prefer to trade out-of-the-money put options, and that the equity market is slow in incorporating the information embedded in volatility smirks.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For information on the volatility smirk a good starting point is here: &lt;br&gt;&#xA;&lt;a href=&quot;http://en.wikipedia.org/wiki/Volatility_smile&quot; rel=&quot;noreferrer&quot;&gt;http://en.wikipedia.org/wiki/Volatility_smile&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-02-08T13:45:08.937" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="274" PostTypeId="2" ParentId="250" CreationDate="2011-02-08T13:48:24.193" Score="5" Body="&lt;p&gt;As you said, $\mu$ is the &lt;strong&gt;expected return&lt;/strong&gt; that is the expected value (mathematical expectation) of the random variable &quot;stock return&quot; under the objective probability measure. Assuming that returns are stationary*, the obvious way to estimate it is to compute a large number $N$ of returns $R_i$, then to average them. You also want to annualize this average (multyply by 252).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if you are using consecutive periods, and logarithmic returns, this simply amounts to computing the overall return $\log S_{T_N} / S_{T_0}$ and dividing it by the time lapse $T_N-T_0$ (in year fraction). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(*) : This is a dubious hypothesis, and the estimate will indeed be very unstable.&lt;/p&gt;&#xA;" OwnerUserId="250" LastActivityDate="2011-02-08T13:48:24.193" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="275" PostTypeId="2" ParentId="209" CreationDate="2011-02-08T13:52:19.157" Score="17" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Q: How do strategies deal with&#xA;  corporate actions?&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;A: Very carefully.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Jokes aside, it is not trivial, and &lt;strong&gt;the answer depends on what you want to do with the data&lt;/strong&gt;. Yahoo provides adjusted stock prices/returns for splits/mergers/dividend, as explained by Shane. The resulting time series is not very useful for predictive and risk management purposes. Commercial providers (or their resellers) do not follow this approach. They develop an internal and &lt;em&gt;unique&lt;/em&gt; ID for every asset (Barra ID, Axioma Db, Thomson Reuters has its own etc.) that is mapped to the ticker/cusip/sedol at any given date. Prices are not merged and dividends are reported separately. Why is that? Because if you want to actually predict asset returns, you're better off with the pristine time series. For example, if you want to develop a model to predict returns of HPQ, you are better off looking at HP time series pre-merger with Compaq, and HPQ afterwards. By combining their return, you would corrupt the value of predictive variables like company size, EPS. etc. One more complication: from the announcement of the merger of CPQ and HP, their return was effectively coupled. How you go about modeling this correlation of their idiosyncratic returns is highly subjective, but it shouldn't be ignored.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, one more point: when building a prediction model of stock returns based on daily or monthly data, the dividend should be ignored, since the value of the dividend is already priced in the asset prices and returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am just skimming the surface of the issue. But the take-away messages are: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;it depends on what you want to do, so think hard about what the data mean; &lt;/li&gt;&#xA;&lt;li&gt;it is complicated, and that it is why data providers sell their service for a small fortune.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Daily returns from public sources do not backfill for delisted assets, so you have a survivorship bias. If you are using those, I recommend having a small universe, a short time interval (2-3 years), and using unadjusted returns.&lt;/p&gt;&#xA;" OwnerUserId="194" LastActivityDate="2011-02-08T13:52:19.157" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="276" PostTypeId="2" ParentId="180" CreationDate="2011-02-08T13:55:07.393" Score="10" Body="&lt;p&gt;One approach is Conditional Value at Risk (CVaR) a.k.a. Expected Shortfall (ES). It does, as you suggest, take into account the whole set of returns. However, instead of traditional VaR which asks &quot;what is the worst 1% or 5% loss I can expect&quot; in a given time frame, conditional VaR asks &quot;assuming I sustain losses of at least 95% or 99% (and perhaps am capitalized to sustain losses of only this amount), what is my expected loss (or shortfall)&quot; for this time period? It can be argued this is more relevant for understanding the impact of more dire scenarios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another approach from Extreme Value Theory is concerned with strictly modeling the heavy tail of the returns. Generalized distributions (e.g. Gumbel, Frechet) can be fit to the tail(s) in question via something called the Hill Estimation technique. These are covered in depth in literature should you be interested in more detail.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2011-02-08T13:55:07.393" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="277" PostTypeId="2" ParentId="43" CreationDate="2011-02-08T14:20:15.810" Score="25" Body="&lt;p&gt;There is a family of models that is so commonly used among practitioners that it can be almost regarded as standard. For a survey, check out &lt;a href=&quot;http://www.courant.nyu.edu/~almgren/papers/eqf.pdf&quot;&gt;Rob Almgren's&lt;/a&gt; entry in the Encyclopedia of Quantitative Finance. Check out also Barra, Axioma and Northfield's handbooks. In general, the impact term per unit traded currency is of the form&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$MI \propto \sigma_n \cdot \text{(participation rate)}^\beta$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the exponent is somewhere between 1/2 and 1, depending on the model being used, and the participation rate is the percentage of total volume of the trade, during the trading interval itself. When including the total MI in optimization, the models commonly used are the &quot;3/2&quot; model and the &quot;5/3&quot; model, in which the costs are proportional to (dollar value being traded for asset i)^{3/2, 5/3}. Since the term is not quadratic (and not solvable by a quadratic optimizer) some people approximate it by a linear term  plus a quadratic one, or by a piece-wise linear convex function.&lt;/p&gt;&#xA;" OwnerUserId="194" LastActivityDate="2011-02-08T14:20:15.810" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="278" PostTypeId="2" ParentId="251" CreationDate="2011-02-08T14:25:41.173" Score="1" Body="&lt;p&gt;I've never heard of it, but I've only been in the industry 2.5 years.  Our C++ guys haven't even mentioned it either.  They prefer using PACK/LAPACK which is mostly rooted in academia &amp;amp; heavily debugged.  We also make heavy use of the IMSL FORTRAN libraries for hardcore statistical computation and Extreme Optimization (for .NET).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of our other researches has reported some interest in the Intel Math Kernel library, but that faded once they saw the price tag.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To echo what @quant_dev said, we much prefer to build our own models.&lt;/p&gt;&#xA;" OwnerUserId="19" LastActivityDate="2011-02-08T14:25:41.173" CommentCount="5" ContentLicense="CC BY-SA 2.5" />
  <row Id="279" PostTypeId="2" ParentId="262" CreationDate="2011-02-08T14:37:00.767" Score="0" Body="&lt;p&gt;I am no expert of banking, but hope to share my thoughts. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, bank's capital charge for mortgage is not 100%, so with $100 deposite, banks can lend out, say, $500, depending on the capital charge.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, I think the deposit rate and the mortgage rate you mentioned is not the same duration. I am not familar with the rates in UK. It's possible that the deposit rate of 2.75% is, for example, 3 year rate, while the 1.49% mortgage rate is a floating rate (1-month rate). Usually the short term rates are lower than long term rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me know if I am wrong. Thanks.&lt;/p&gt;&#xA;" OwnerDisplayName="user255" LastActivityDate="2011-02-08T14:37:00.767" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="280" PostTypeId="2" ParentId="236" CreationDate="2011-02-08T14:59:52.827" Score="3" Body="&lt;p&gt;Under the typical Black-Scholes model, you &quot;cannot&quot; do it, because the assumption is that each of the securities in the portfolio has a lognormal terminal distribution, and the sum of lognormally distributed variables it not itself lognormally distributed.  In theory one needs an N-dimensional tree (or grid) to treat an N-element portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I write &quot;cannot&quot; in quotes because this problem is actually quite commonly encountered and solved in one of a few ways, none of which involves a binomial tree:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If you are comfortable using historical estimates, simply look at the volatility of the portfolio hypothetically over history.  This has two significant disadvantages: (i) historical volatility is generally smaller than forward volatility due to survivorship bias, and (ii) there may have been IPOs or other corporate events that make the portfolio value unknown before some date&lt;/li&gt;&#xA;&lt;li&gt;Use Monte Carlo to simulate every element of the portfolio, pricing the option by the usual MC methods.&lt;/li&gt;&#xA;&lt;li&gt;Use the trick of moment-matching, where a little mathematics tells you the equivalent lognormal (or sometimes shifted lognormal) distribution to your portfolio.  You can then use the usual closed form option pricing formulas.  The technique has been around since at least the mid-90s.  Since not all the papers from back then are easy to see online, here's an URL to a recent &lt;a href=&quot;http://www.feweb.vu.nl/en/Images/AmericanBasketOptions_tcm97-194676.pdf&quot; rel=&quot;nofollow&quot;&gt;rediscovery&lt;/a&gt; of the trick in which they go so far as to run a binomial tree for American basket options.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The final technique is almost certainly what you want to use.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-02-08T14:59:52.827" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="281" PostTypeId="2" ParentId="251" CreationDate="2011-02-08T15:09:58.430" Score="14" Body="&lt;p&gt;It's a very good and useful question.  And it is bloody hard to answer just like many other questions relating to the proprietary nature of how banks and funds implement their core technology.  A better route may be to ask on the QL lists, and/or to inquire as to who actually attented the first &lt;a href=&quot;http://www.statpro.com/quantlib_forum.aspx&quot;&gt;Quantlib forum&lt;/a&gt; in London last month.  Another route would be to see who &lt;a href=&quot;http://www.statpro.com/&quot;&gt;StatPro&lt;/a&gt; lists as clients. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been near QL for a long time based on my &lt;a href=&quot;http://dirk.eddelbuettel.com/code/rquantlib.html&quot;&gt;RQuantLib&lt;/a&gt; bindings to &lt;a href=&quot;http://www.r-project.org&quot;&gt;GNU R&lt;/a&gt;.  That obviously covers only a subset of users (those who like R) as well as functionality but I can assure you that I have been in contact with a number of places about it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which makes perfect sense: this is open source code, so you can always bring it in to at least provide a benchmark or reference implementation.&lt;/p&gt;&#xA;" OwnerUserId="69" LastActivityDate="2011-02-08T15:09:58.430" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="282" PostTypeId="1" AcceptedAnswerId="384" CreationDate="2011-02-08T15:29:51.080" Score="7" ViewCount="404" Body="&lt;p&gt;This sentence in the following paper got me thinking:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Some traders [...] trade every pattern whether proven or not, expecting&#xA;authentic ones to produce positive results, whilst the profits and losses of&#xA;fake patterns cancel each other out.&quot;&lt;br&gt;&#xA;&lt;a href=&quot;http://www.seasonalcharts.com/img/ZUTEXTEN/saisonalitaet_e.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.seasonalcharts.com/img/ZUTEXTEN/saisonalitaet_e.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I got my hands on another paper - seemingly unrelated...: &quot;The&#xA;evolution of superstitious and superstition-like behaviour&quot;:&lt;br&gt;&#xA;&lt;a href=&quot;http://rspb.royalsocietypublishing.org/content/276/1654/31.full.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://rspb.royalsocietypublishing.org/content/276/1654/31.full.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The bottom line is that I can be rational to act irrational, or in other&#xA;words there is a trade-off between being superstitious and being ignorant -&#xA;and being superstitious (i.e. seeing patterns where there are none) can under certain circumstances be beneficial - this is why it survived evolution up until now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have you come across research that systematized this approach for the&#xA;trading arena, i.e.&lt;br&gt;&#xA;&lt;strong&gt;first&lt;/strong&gt;: what is the &lt;em&gt;right&lt;/em&gt; confidence level to trade a signal and&lt;br&gt;&#xA;&lt;strong&gt;second&lt;/strong&gt; &quot;opportunistic trading&quot; as an approach of its own? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &quot;opportunistic trading&quot; I mean a framework to trade &lt;em&gt;every&lt;/em&gt; signal out&#xA;of some class (with money and risk management attached for not going&#xA;bust) in the hope that the false signals cancel each other out and the real&#xA;ones make money.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps you have some thoughts how to backtest these ideas, too.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-02-10T03:58:46.130" Title="Is there something like opportunistic &quot;superstitious&quot; trading?" Tags="&lt;backtesting&gt;&lt;trading&gt;&lt;trading-patterns&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="283" PostTypeId="1" AcceptedAnswerId="383" CreationDate="2011-02-08T16:14:56.500" Score="8" ViewCount="726" Body="&lt;p&gt;Are there any papers about possible trading strategies you can apply when you know where a large cluster of orders is located in the order-book?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These seem to fall in the liquidity-provisioning/hunting range of strategies, is this correct?&lt;/p&gt;&#xA;" OwnerUserId="225" LastActivityDate="2011-09-25T19:51:18.747" Title="What quant terms to use to search for papers about &quot;stop-hunting&quot; trading strategies?" Tags="&lt;strategy&gt;&lt;liquidity&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 2.5" />
  <row Id="284" PostTypeId="1" AcceptedAnswerId="285" CreationDate="2011-02-08T16:16:42.410" Score="8" ViewCount="2106" Body="&lt;p&gt;On average, how much slippage (measured in lost % return potential) is typical for an operating quant fund that trades in, say, major U.S. equities?&lt;/p&gt;&#xA;" OwnerUserId="80" LastActivityDate="2011-10-31T23:58:56.180" Title="How significant is slippage in a successful quant fund?" Tags="&lt;slippage&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="7" ContentLicense="CC BY-SA 2.5" />
  <row Id="285" PostTypeId="2" ParentId="284" CreationDate="2011-02-08T16:28:31.800" Score="9" Body="&lt;p&gt;It depends &lt;em&gt;almost&lt;/em&gt; entirely on the size of the positions the fund is trading.&#xA;More specifically, it is a function of the liquidity of the stock.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;ex-post liquidity can be observed from volume in aggregate and time &amp;amp; sales, in particular.&#xA;ex-ante liquidity can be estimated (often reasonably well using a bucketed look-back approach)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It also depends on whether the fund is trading to provide liquidity(against momentum), or remove liquidity(momentum following).  In the case of the former the slippage can often be negative.  In the latter, slippage increases as trade size increases.  Slippage can be lowered by using an algo like vwap, IS, twap, etc...  But trades take longer to place under these block break-up approaches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For large US equities, you can consistently trade in the low thousands of shares multiple times per day, with little to no impact on slippage.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This guy is generally considered the expert on this topic:&#xA;&lt;a href=&quot;http://www.courant.nyu.edu/~almgren/&quot;&gt;http://www.courant.nyu.edu/~almgren/&lt;/a&gt;&#xA;his papers describe some novel approaches to minimizing slippage for large blocks.&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-02-08T16:28:31.800" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="286" PostTypeId="1" CreationDate="2011-02-08T16:35:43.010" Score="3" ViewCount="1205" Body="&lt;p&gt;What are some trading strategies for stocks (just stocks, no derivatives) using freely available &lt;a href=&quot;https://quant.stackexchange.com/questions/141/data-sources-online&quot;&gt;online data sources&lt;/a&gt;?&lt;/p&gt;&#xA;" OwnerUserId="128" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2011-02-08T16:45:13.347" Title="basic stock trading strategies" Tags="&lt;strategy&gt;&lt;trading&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="4" ClosedDate="2011-02-08T19:40:24.200" ContentLicense="CC BY-SA 2.5" />
  <row Id="287" PostTypeId="2" ParentId="262" CreationDate="2011-02-08T16:36:48.203" Score="0" Body="&lt;p&gt;A banking textbook will tell you that banks earn their profits from their net interest margin(difference between rates charged, and rates paid on banks borrowing).&#xA;Your question makes it clear that the net interest margin math does not add up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Look at the 10-K (or the 10-Q for that matter) filings for a publicly traded bank that is a significant mortgage originator.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you'll see in the filings is that the income of the bank is actually driven primarily by fee income.  (this fee income is overdraft fees, atm fees, and loan(mortgage) origination fees).  &lt;strong&gt;For most banks fee income drives 50% or more of their net income.&lt;/strong&gt;&#xA;This is how they make money on doing mortgages.&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-02-08T16:36:48.203" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="288" PostTypeId="2" ParentId="286" CreationDate="2011-02-08T16:45:13.347" Score="3" Body="&lt;p&gt;There are two broad categories of trading strategies.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Momentum strategies(e.g trend following)&lt;/li&gt;&#xA;&lt;li&gt;Mean reversion strategies.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Elder's book outlines the major ones:&#xA;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0471592242&quot; rel=&quot;nofollow&quot;&gt;http://www.amazon.com/Trading-Living-Psychology-Tactics-Management/dp/0471592242&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And the depressing truth about most of these strategies is outlined by Aronson:&#xA;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470008741&quot; rel=&quot;nofollow&quot;&gt;http://www.amazon.com/Evidence-Based-Technical-Analysis-Scientific-Statistical/dp/0470008741/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-02-08T16:45:13.347" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="289" PostTypeId="2" ParentId="282" CreationDate="2011-02-08T16:46:53.297" Score="2" Body="&lt;p&gt;Not exactly definitive, but I once met a lady at a seminar I was teaching that gave an overview of how she uses astrology to make trading decisions.  &lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-02-08T16:46:53.297" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="290" PostTypeId="2" ParentId="249" CreationDate="2011-02-08T16:58:04.037" Score="10" Body="&lt;p&gt;Short answer: yes.&#xA;Long answer:  the challenge in trading these things, like you mentioned, is that each contract is not perfectly hedgable.  This is an intentional choice made by the exchanges that list these products, so that they can provide an incentive to trading firms(locals) to provide liquidity for these new products and help boost trading volume.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The primary challenge in trading spx options vs vix futures, or spx options vs vix options, or vix options vs vix futures, is the fact that all three have different expirations.&#xA;This fact combined with the wildly different notionals for each (vix futures = 1000*vix, vix options = 100 * vix, and spx = 250*vix)  makes it more difficult to hedge and trade one versus the other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What most liquidity providers do instead of trying some kind of variance-gamma model approach is to simply hedge vix options or vix futures using spx straddles, and updating their hedges several times a day.  This isn't a perfect hedge, and has lots of additional timing risks.  However, there is something like 1% to 1.5% edge in trading this approach, so levering up can make it a reasonable strategy when considered with mean reverting nature of vix.&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-02-08T16:58:04.037" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="291" PostTypeId="2" ParentId="261" CreationDate="2011-02-08T16:59:10.667" Score="0" Body="&lt;p&gt;Put Simply:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;asset management is about producing growth.&#xA;wealth management is about preserving principle.&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-02-08T16:59:10.667" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="292" PostTypeId="2" ParentId="262" CreationDate="2011-02-08T17:23:46.940" Score="5" Body="&lt;p&gt;Most large banks generally sell the mortgages they originate to investors, but they retain the servicing rights.  Therefore, they make money via origination and servicing fees; the spread between deposit rates and mortgage loan rates isn't as simple or important as your question suggests.&lt;/p&gt;&#xA;" OwnerUserId="56" LastActivityDate="2011-02-08T17:23:46.940" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="293" PostTypeId="1" AcceptedAnswerId="301" CreationDate="2011-02-08T17:34:23.037" Score="14" ViewCount="3903" Body="&lt;p&gt;What are the main categories of systematic trading strategies (e.g. momentum, mean reversion), as might be considered by an index or fund-of-fund analyst?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any common sub-strategies?&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="17" LastEditDate="2011-02-08T20:37:58.537" LastActivityDate="2019-04-02T12:26:38.807" Title="Categories of systematic trading strategies?" Tags="&lt;strategy&gt;&lt;mean-reversion&gt;" AnswerCount="3" CommentCount="5" FavoriteCount="18" ContentLicense="CC BY-SA 2.5" />
  <row Id="294" PostTypeId="2" ParentId="293" CreationDate="2011-02-08T18:58:41.920" Score="9" Body="&lt;p&gt;There is no official taxonomy of quant trading models. After all, &quot;valuations&quot; are inherently subjective, no matter how much math we put behind them. But there are some industry-standard terms that might be helpful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470432063&quot;&gt;Inside the Black Box&lt;/a&gt;&lt;/em&gt; has the following break-down:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Price&lt;/li&gt;&#xA;&lt;li&gt;&lt;ul&gt;&#xA;&lt;li&gt;Trend&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;ul&gt;&#xA;&lt;li&gt;Reversal&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Fundamental&lt;/li&gt;&#xA;&lt;li&gt;&lt;ul&gt;&#xA;&lt;li&gt;Yield&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;ul&gt;&#xA;&lt;li&gt;Growth&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;ul&gt;&#xA;&lt;li&gt;Quality&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;It's also possible to break-down by implementation:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Time horizon: ranging from long-term to high-frequency&lt;/li&gt;&#xA;&lt;li&gt;Bet structure: relative or intrinsic&lt;/li&gt;&#xA;&lt;li&gt;Instruments: liquid or illiquid&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And these don't even get into portfolio construction, position limits, risk monitoring, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for what works, keep this maxim in mind:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Bulls make money, bears make money, but pigs get slaughtered.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And lastly, comparing chartists to quants is like comparing astrologists to astronomers.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-02-08T18:58:41.920" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="295" PostTypeId="2" ParentId="262" CreationDate="2011-02-08T19:20:41.707" Score="1" Body="&lt;p&gt;Check out the &lt;strong&gt;amortization&lt;/strong&gt; table on your mortgage.  You'll find that for the first five years, you are paying 90+% of your payment towards interest.  So, if you need to sell end your loan anytime before full maturity, the majority of what you would have paid is interest, not principle.  So, your &lt;strong&gt;effective&lt;/strong&gt; interest rate for your specific loan duration would have been much higher.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't think this factor is stressed enough, and really ought to be illegal.  Why not just divide the interest evenly over the life of the loan so that interest and principle are applied equally?  A real shameful way to do business...&lt;/p&gt;&#xA;" OwnerDisplayName="user272" LastEditorDisplayName="user272" LastEditDate="2011-02-08T19:25:42.203" LastActivityDate="2011-02-08T19:25:42.203" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="296" PostTypeId="7" CreationDate="2011-02-08T19:34:31.400" Score="0" Body="&lt;p&gt;The Quantitative Finance Stack Exchange is intended for &lt;strong&gt;professionals&lt;/strong&gt; and &lt;strong&gt;academics&lt;/strong&gt; involved in quant modeling or trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Basically, you must either&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;be &lt;strong&gt;earning a living&lt;/strong&gt; at this,&lt;/li&gt;&#xA;&lt;li&gt;or be &lt;strong&gt;studying this specifically in graduate school&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Otherwise, your question will probably be off topic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good questions are focused on an &lt;strong&gt;actual problem you face in the course of your work&lt;/strong&gt; as a quant or academic researcher.  If you have a question about&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;securities valuation&lt;/li&gt;&#xA;&lt;li&gt;risk modeling&lt;/li&gt;&#xA;&lt;li&gt;market microstructure&lt;/li&gt;&#xA;&lt;li&gt;portfolio management&lt;/li&gt;&#xA;&lt;li&gt;financial engineering&lt;/li&gt;&#xA;&lt;li&gt;econometrics&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;then you're in the right place to ask your question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some questions are often asked on here repeatedly; we generally redirect those to the &lt;strong&gt;canonical answers&lt;/strong&gt;. Common questions include:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://quant.stackexchange.com/q/141&quot;&gt;Where can I find free data online?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://quant.stackexchange.com/q/306&quot;&gt;What programming language should I use to implement my trading system?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://quant.stackexchange.com/q/2019&quot;&gt;What books should I read?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;There are also some common questions that are totally &lt;strong&gt;off-topic and will be closed&lt;/strong&gt;. Usually these come from people outside the industry. Examples include:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.markjoshi.com/downloads/advice.pdf&quot; rel=&quot;nofollow&quot;&gt;How do I become a quant?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;What should my thesis topic be?&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;Could someone help me develop a trading strategy?&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;There may be other questions that are better suited for our &lt;strong&gt;sister sites&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Programming: &lt;a href=&quot;http://stackoverflow.com/&quot;&gt;Stack Overflow&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Statistics: &lt;a href=&quot;http://stats.stackexchange.com/&quot;&gt;Cross Validated&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Basic Finance and Definitions: &lt;a href=&quot;http://money.stackexchange.com/&quot;&gt;Personal Finance &amp;amp; Money&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;We can answer questions for software packages that are specific to quantitative finance, though bug reports and requests for support should be filed with the software vendor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please note, however, that cross-posting is not encouraged.&lt;/p&gt;&#xA;" OwnerUserId="-1" LastEditorUserId="467" LastEditDate="2013-02-04T16:25:37.370" LastActivityDate="2013-02-04T16:25:37.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="297" PostTypeId="1" AcceptedAnswerId="307" CreationDate="2011-02-08T20:33:33.290" Score="8" ViewCount="1499" Body="&lt;p&gt;I don't quite understand how anyone would invest in VXX (asides from short-term trades)... Since the VIX term structure is generally in contango, the VXX is doomed to bleed to death. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, how exactly does this type of structure work (ETN)? Eventually, the capital raised by selling these notes will run out - what happens then? They have already reverse splitted the VXX, what's next?  Who is investing in it in the first place?&lt;/p&gt;&#xA;" OwnerUserId="290" LastEditorUserId="17" LastEditDate="2011-02-08T20:41:50.950" LastActivityDate="2011-02-08T21:10:05.473" Title="How to make sense of VXX and the people who bought it?" Tags="&lt;vix&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="298" PostTypeId="1" AcceptedAnswerId="308" CreationDate="2011-02-08T20:34:09.507" Score="21" ViewCount="17364" Body="&lt;p&gt;I'm curious about high performance computing and consider algo/program trading as an interesting source of information about what are performant technologies that are used to trade the markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is scala being used out there? Is it a viable language for a startup prop shop? Would it be considered an advantageous language given it's more expressive syntax (and thus less code) as compared to java/c++ but be just as speedy?&lt;/p&gt;&#xA;" OwnerUserId="57" LastActivityDate="2020-10-26T19:45:36.303" Title="Is Scala used in trading systems" Tags="&lt;trading-systems&gt;" AnswerCount="6" CommentCount="2" FavoriteCount="19" ContentLicense="CC BY-SA 2.5" />
  <row Id="299" PostTypeId="2" ParentId="298" CreationDate="2011-02-08T20:39:12.170" Score="9" Body="&lt;p&gt;Empirics should count for something, and the (awesome) &lt;a href=&quot;http://shootout.alioth.debian.org/&quot;&gt;Language Shootout&lt;/a&gt; does show that &lt;a href=&quot;http://shootout.alioth.debian.org/u64q/benchmark.php?test=all&amp;amp;lang=scala&amp;amp;lang2=gpp&quot;&gt;C++ still very clearly dominates Scala&lt;/a&gt; in execution time and memory use -- though Scala looks better in code size.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Shops that have existing investment in Java like Scala as a next-generation Java given that the latter hasn't moved all that much of late.  I also heard some startups betting on it.  I am not in the Java camp, so my money is still on C++ (especially when performance really matters).&lt;/p&gt;&#xA;" OwnerUserId="69" LastActivityDate="2011-02-08T20:39:12.170" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="300" PostTypeId="2" ParentId="298" CreationDate="2011-02-08T20:55:13.113" Score="5" Body="&lt;p&gt;To the best of my knowledge, there is no Scala implementation of execution platforms. C/C++ is still the language of choice for mission-critical financial applications, followed by Java, for those more recent shops that didn't have the burden of much legacy C++ code. I cannot imagine Scala taking hold, given that is slower and not nearly as robust as C++ and Java. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For UIs, everything is fair game, from Java to Python to C# to Ruby. But choosing the right language of a UI has never been the competitive advantage of any investment firm, I believe.&lt;/p&gt;&#xA;" OwnerUserId="194" LastActivityDate="2011-02-08T20:55:13.113" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="301" PostTypeId="2" ParentId="293" CreationDate="2011-02-08T20:57:47.933" Score="13" Body="&lt;p&gt;There are other strategy types not covered by mean-reversion/trend following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;arbitrage - keep correlated assets close in price (SPX index versus the 500 stocks contained in it, or Gold trading in London versus Gold trading in New York)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;market making - buy on bid, sell on ask, gain the spread&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;liquidity rebate - some venus pay you for putting limit orders in the book. Put in a limit order to buy, when it's hit try to sell at the same price that you bought at (or better) and gain the rebate. Works best on high volume, low price assets.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;predatory trading - seek big hidden liquidity in the market and front-run it&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;behavioral trading - quantify market sentiment and trade on it (analyze tweets, determine global/regional mood and use known psychological theories to predict the effect on market behavior)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;event trading - analyze news (electronic, paper, blogs, twits) and predict market impact of new relevant facts (litigation, new products, new management, ...)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="225" LastEditorUserId="35" LastEditDate="2013-10-26T02:11:50.650" LastActivityDate="2013-10-26T02:11:50.650" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="302" PostTypeId="2" ParentId="298" CreationDate="2011-02-08T20:59:41.760" Score="5" Body="&lt;p&gt;Yes, it's used. However its purpose for now is mainly limited by creation of Domain Specific Languages for prototyping because of easy integration with existing infrastructure in Java. Here Scala also competes with another JVM based language - Groovy and F# because of its relatively easy interaction with Excel.&lt;/p&gt;&#xA;" OwnerUserId="15" LastActivityDate="2011-02-08T20:59:41.760" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="303" PostTypeId="1" CreationDate="2011-02-08T21:00:27.773" Score="36" ViewCount="10961" Body="&lt;p&gt;Similar to &lt;a href=&quot;https://quant.stackexchange.com/questions/298/is-scala-used-in-trading-systems&quot;&gt;this other question about Scala&lt;/a&gt;, I'm interested in knowing whether F# is used to any measurable degree in financial circles. Have there been any successful shops using it, any research on performance and viability?&lt;/p&gt;&#xA;" OwnerUserId="288" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2020-06-24T04:52:00.707" Title="Is F# used in trading systems?" Tags="&lt;programming&gt;" AnswerCount="13" CommentCount="6" FavoriteCount="15" ContentLicense="CC BY-SA 2.5" />
  <row Id="304" PostTypeId="2" ParentId="298" CreationDate="2011-02-08T21:04:59.577" Score="14" Body="&lt;p&gt;We can play these language wars until pigs fly, but there are a few very basic things that most people agree on:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;As has already been said, C++ is the standard language where performance is really important (and Java comes in second).  An example of how this shows up: C++ is taught in the Wilmott quant finance certificate and in MFE programs.  It also appears the most often in job postings.&lt;/li&gt;&#xA;&lt;li&gt;For other areas, where performance is the top priority, a wide variety of other languages undoubtedly get used.  For instance, &lt;a href=&quot;http://www.janestcapital.com/technology/ocaml.php&quot;&gt;Jane Street&lt;/a&gt; is very public about their OCaml implementation.  Many hedge funds use languages like R, matlab, and Python, even in their production environments.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Are firms using Scala?  Probably.  Do you want to become a Scala expert in the hope of using it in quantitative finance?  Not a good bet.&lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2011-02-08T21:04:59.577" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="305" PostTypeId="2" ParentId="303" CreationDate="2011-02-08T21:05:48.970" Score="5" Body="&lt;p&gt;Not that I know of, although I know .net is sometimes used as a platform by (larger) asset management companies, so F# seems a good candidate to parallelize computationally intensive jobs.&lt;/p&gt;&#xA;" OwnerUserId="194" LastActivityDate="2011-02-08T21:05:48.970" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="306" PostTypeId="1" CreationDate="2011-02-08T21:10:03.827" Score="27" ViewCount="89866" Body="&lt;p&gt;What programming languages are the most common in quantitative finance, and why are these languages used?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I do not mean, what languages are used to develop the accounting system at a hedge fund: this is specifically related to aspects of valuation and trading.&lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2013-06-12T10:13:15.257" Title="What programming languages are most commonly used in quantitative finance?" Tags="&lt;programming&gt;" AnswerCount="17" CommentCount="4" FavoriteCount="66" CommunityOwnedDate="2011-02-09T00:33:33.657" ContentLicense="CC BY-SA 2.5" />
  <row Id="307" PostTypeId="2" ParentId="297" CreationDate="2011-02-08T21:10:05.473" Score="6" Body="&lt;p&gt;Generally, one holds VXX (or VXZ) for the same reasons one holds any long-volatility position, either (a) as a directional bet on volatility or (b) as a hedge to large directional moves or implicit short volatility positions.  Obviously the former reason is often shorter-term. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the second case, it's relatively easy to see that, say, an equity portfolio of leveraged companies will get creamed in precisely the same circumstances that VXX will spike.  In effect, the dividends or appreciation of those stocks will pay for the bleeding of the VXX position.  The same is even more evidently true of positions belonging to the subset of options traders whose personal style often puts them in short volatility (short gamma) positions.  In these cases VXX provides something of a fire-and-forget hedge that does not need constant rolls, as an option or VIX futures position might.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially all long-volatility positions tend to &quot;bleed&quot; value from day to day, at least on those days when nothing &quot;interesting&quot; happens.  Options traders call this the &lt;em&gt;theta bill&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With respect to the mechanics, Barclay's has the right to redeem the notes.  The capital won't run all the way out, but may get so low that they decide to redeem and reissue.  I would be willing to bet that, if they do so, they will work out a way to keep the stock symbol unaltered. &lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-02-08T21:10:05.473" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="308" PostTypeId="2" ParentId="298" CreationDate="2011-02-08T21:10:40.270" Score="20" Body="&lt;p&gt;EDF Trading uses it (or used it): &lt;a href=&quot;http://cufp.org/videos/scala-edf-trading-implementing-domain-specific-language-derivative-p&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://cufp.org/videos/scala-edf-trading-implementing-domain-specific-language-derivative-p&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;In general, many financial institutions use functional programming languages. Andrei is correct in that they often are used to develop domain-specific languages (DSLs).&lt;/p&gt;&#xA;&lt;p&gt;Some examples:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Credit Suisse uses F# &lt;a href=&quot;http://cufp.org/archive/2008/abstracts.html#MansellHoward&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://cufp.org/archive/2008/abstracts.html#MansellHoward&lt;/a&gt; (they had toyed around with Haskell for a bit to create a DSL called Paradise &lt;a href=&quot;http://urchin.earth.li/%7Eganesh/icfp08.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://urchin.earth.li/~ganesh/icfp08.pdf&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Jane Street Capital uses OCaml ( &lt;a href=&quot;http://ocaml.janestreet.com/?q=node/61&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://ocaml.janestreet.com/?q=node/61&lt;/a&gt; )&lt;/li&gt;&#xA;&lt;li&gt;Barclays uses a DSL in Haskell for descibing exotic trades ( &lt;a href=&quot;https://web.archive.org/web/20160313025331/http://www.lexifi.com/files/resources/frankau.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://web.archive.org/web/20160313025331/http://www.lexifi.com/files/resources/frankau.pdf&lt;/a&gt; )&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;A &amp;quot;complete&amp;quot; list can be found by exploring proceedings from Commercial Users of Functional Programming workshop proceedings: &lt;a href=&quot;http://cufp.org/conference&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://cufp.org/conference&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;If you are smart about DSL creation, the programs you write can actually have better performance because you can perform smarter compiler optimizations (e.g., &lt;a href=&quot;http://infoscience.epfl.ch/record/148814/files/paper.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://infoscience.epfl.ch/record/148814/files/paper.pdf&lt;/a&gt;)&lt;/p&gt;&#xA;&lt;p&gt;One last note, since Scala targets the JVM, you could always integrate the Java and Scala code (or even make native calls to C++ code via the Java Native Interface).&lt;/p&gt;&#xA;" OwnerUserId="75" LastEditorUserId="33410" LastEditDate="2020-10-26T19:45:36.303" LastActivityDate="2020-10-26T19:45:36.303" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="309" PostTypeId="2" ParentId="303" CreationDate="2011-02-08T21:10:41.510" Score="12" Body="&lt;p&gt;I worked for a big investment bank a few years ago that announced it was moving all quant models to F#. The goal behind the switch was that F# is a functional programming language and available on .NET, both of which were desirable qualities for this particular company. I left before they got started on the transition, so I don't know what came of it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the related OCaml, &lt;a href=&quot;http://www.janestcapital.com/technology/ocaml.php&quot;&gt;Jane Street&lt;/a&gt; famously uses that.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-02-08T21:10:41.510" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="310" PostTypeId="1" AcceptedAnswerId="314" CreationDate="2011-02-08T21:18:52.283" Score="44" ViewCount="8572" Body="&lt;p&gt;How many trades per second are we talking about?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What kind of strategies are used in this time frame?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can the small guy play the game?&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="2299" LastEditDate="2014-04-12T15:56:30.683" LastActivityDate="2017-05-29T01:41:17.163" Title="How 'High' is the frequency in HFT?" Tags="&lt;high-frequency&gt;&lt;market-microstructure&gt;&lt;strategy&gt;" AnswerCount="9" CommentCount="0" FavoriteCount="26" ContentLicense="CC BY-SA 2.5" />
  <row Id="311" PostTypeId="2" ParentId="303" CreationDate="2011-02-08T21:18:54.517" Score="24" Body="&lt;p&gt;Credit Suisse has publicly stated that they use F# for some valuation tasks (which tend to be very parallelizable). Here's a link to a talk abstract from a Commercial Users of Functional Programming workshop: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://cufp.org/archive/2008/abstracts.html#MansellHoward&quot;&gt;http://cufp.org/archive/2008/abstracts.html#MansellHoward&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure if there's a video of the talk floating around or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since F# targets the .NET framework, it gives you a lot of flexibility in integrating other applications that might have been written in, say, C#.&lt;/p&gt;&#xA;" OwnerUserId="75" LastActivityDate="2011-02-08T21:18:54.517" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="312" PostTypeId="2" ParentId="306" CreationDate="2011-02-08T21:22:35.853" Score="29" Body="&lt;p&gt;A choice of &lt;strong&gt;C&lt;/strong&gt;, &lt;strong&gt;C++&lt;/strong&gt;, or &lt;strong&gt;Java&lt;/strong&gt; is practically required somewhere in the stack since most data vendors only supply bindings for one of those languages. Once the data arrives, though, the trading desk can use whatever it wants.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition to the above three, I've seen these used in production:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Visual Basic / Excel&lt;/li&gt;&#xA;&lt;li&gt;q / kdb+&lt;/li&gt;&#xA;&lt;li&gt;R&lt;/li&gt;&#xA;&lt;li&gt;Python&lt;/li&gt;&#xA;&lt;li&gt;MATLAB&lt;/li&gt;&#xA;&lt;li&gt;OCaml&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I've also seen &lt;em&gt;Flex&lt;/em&gt; and &lt;em&gt;AJAX&lt;/em&gt; used for some front-end components.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And finally, some firms build their own in-house proprietary languages. Goldman Sachs famously has &lt;em&gt;Slang&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Related question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What language should I use in quantitative finance?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Related answer:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Whatever your boss pays you to use.&lt;/li&gt;&#xA;&lt;li&gt;At least one of the &quot;Big Three&quot; above to get the data feed.&lt;/li&gt;&#xA;&lt;li&gt;If you actually do get a choice, whatever you feel most comfortable using.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;As per #3, that's why you'll notice most language choices are either mathematical in nature (like R and MATLAB) or very high-level in nature (like Python and OCaml).&lt;/p&gt;&#xA;" OwnerUserId="35" LastEditorUserId="35" LastEditDate="2011-02-08T21:34:40.397" LastActivityDate="2011-02-08T21:34:40.397" CommentCount="5" ContentLicense="CC BY-SA 2.5" />
  <row Id="313" PostTypeId="2" ParentId="303" CreationDate="2011-02-08T21:23:09.010" Score="6" Body="&lt;p&gt;There was huge buzz about F# in the City and few banks / funds tried very agressively to hire people with F# knowledge and experience in finance. For example, Luka Bolognese one of the F# authors joined Credit Suisse almost 2 years ago. Also Don Syme used to conduct visiting lectures about F# and its possible applications to finance in the City  .&lt;/p&gt;&#xA;" OwnerUserId="15" LastEditorUserId="15" LastEditDate="2011-09-09T15:01:03.863" LastActivityDate="2011-09-09T15:01:03.863" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="314" PostTypeId="2" ParentId="310" CreationDate="2011-02-08T21:24:19.053" Score="30" Body="&lt;p&gt;You could for example look at &lt;a href=&quot;http://www.dbresearch.com/PROD/DBR_INTERNET_EN-PROD/PROD0000000000269468.pdf&quot; rel=&quot;noreferrer&quot;&gt;this research paper released by Deutsche Bank's Research group&lt;/a&gt; (&lt;a href=&quot;https://web.archive.org/web/20170529002243/http://www.dbresearch.com/PROD/DBR_INTERNET_EN-PROD/PROD0000000000269468.pdf&quot; rel=&quot;noreferrer&quot;&gt;mirror&lt;/a&gt;) just yesterday which defines both high-frequency and ultra-high-frequency trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the paper it says&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Typically, a &lt;strong&gt;high frequency trader&lt;/strong&gt; would not hold a position open for&#xA;  more than a few seconds. Empirical evidence reveals that the average&#xA;  U.S. stock is held for 22 seconds.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And in a footnote it says&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;There even is a subcategory of high-frequency trading, &lt;strong&gt;Ultra-HFT&lt;/strong&gt;,&#xA;  which is sensitive to a latency down to the microsecond. Here,&#xA;  co-location [of servers] is exceedingly significant, and shaving off&#xA;  further microseconds is of utmost importance.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And no, the small guy can't play for reason well-put in the paper, co-location probably being the single most important one.&lt;/p&gt;&#xA;" OwnerUserId="69" LastEditorUserId="2183" LastEditDate="2017-05-29T01:41:17.163" LastActivityDate="2017-05-29T01:41:17.163" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="315" PostTypeId="2" ParentId="310" CreationDate="2011-02-08T21:24:53.780" Score="17" Body="&lt;p&gt;A survey by FinAlternatives in 2009 concluded that &quot;86% believe that the term “high-frequency trading” referred strictly to holding periods of only one day or less.&quot; (Aldridge 2009):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/kIav2.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two problems with this survey for our present discussion: (1) the meaning of the term has been clarified significantly since that survey and (2) it surveyed a wide spectrum of people. This latter point isn't necessarily a problem, but it amounts to asking non-experts questions about a very esoteric field: you are bound to get a wide variance in the answers. High frequency trading is primarily a proprietary trading phenomenon (including when it is done by banks like Goldman Sachs), because its primary benefit is very high returns with low risk on a small amount of capital. Trading at high speeds is not a high-capacity strategy, so it is not as suitable to a hedge fund structure which is (a) fee-driven and (b) subject to client scrutiny.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long story short: in order to have any meaning, HFT needs to mean something akin to &lt;em&gt;latency arbitrage&lt;/em&gt;, in which case co-location and &lt;em&gt;going as fast as possible&lt;/em&gt; are critical.  This means different things depending on the asset class, strategy, etc.  But firms like GETCO are making edits to their Linux distributions in order to get higher speeds: that's your competition.&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="17" LastEditDate="2011-02-08T21:36:45.720" LastActivityDate="2011-02-08T21:36:45.720" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="316" PostTypeId="2" ParentId="306" CreationDate="2011-02-08T21:29:42.303" Score="13" Body="&lt;p&gt;I believe that C++ is the most common quantitative infrastructure language. I don't know of a single hedge fund or investment bank that doesn't use it extensively or completely (and I spoke to &lt;em&gt;a lot&lt;/em&gt; of them at some point in the past). In some cases, as the former Lehman brothers-now-Barclays, C++ was the only language of choice, which is a bit extreme, given that C++ is not as easy to use as a scripting language. Most companies I know pair C++ with a scripting language of choice. Traditionally, this was MATLAB, which is still amazingly popular for prototyping. More recently, R and Python have become more popular. R especially is now used at several hedge funds I know, and has taken many MATLAB seats; and I know of Python users in JPM and UBS. Python has also nice bindings to BLAS, LAPACK, NAG and MOSEK. Goldman has diffentiated itself by developing a proprietary language, SLANG; the very definiton of non-popular. I don't think Java is used heavily or at all for numerical work. Just try to find maintained to BLAS and LAPACK. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some crazy market maker will differentiate itself via language, as in the case of Jane St., lonely user of OCAML. I would not be surprised to find a LISP-only 10-person shop flying under the radar screen, and very wealthy. But I have never heard of a single Clojure/Scala/Groovy/Ruby/[add your trendy language] in a serious company. At least, I would never invest my money in a company using a web development, immature language to manage wealth.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Summing up, I would say C++, and then a number of prototyping languages, with MATLAB still dominating, but R having a strong positive momentum.&lt;/p&gt;&#xA;" OwnerUserId="194" LastActivityDate="2011-02-08T21:29:42.303" CommentCount="9" ContentLicense="CC BY-SA 2.5" />
  <row Id="317" PostTypeId="2" ParentId="306" CreationDate="2011-02-08T21:37:10.020" Score="8" Body="&lt;p&gt;Let me quote a few excerpts from &lt;em&gt;Paul &amp;amp; Dominics Guide to Quant Careers&lt;/em&gt; (version 2.0):&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Most quant jobs ask for C++, with much smaller demand for C# and Excel VBA and Java. Although Excel is the second most common skill, alas Excel VBA is regarded as “trivial” so few employers will be impressed by mastering it. This attitude is responsible for major efforts at the large banks to defuse the vast number of actively disruptive, yet critical spreadsheets that enjoy the reliability of a British train... Some quants get sucked into roles that we call “Excel Jockeys”. Although some Excel work is cutting edge trading floor work that makes money every time you get the sheet to work properly, the majority is looking after risk reports, data ingest and sheets that even users don't know why they have.&lt;/p&gt;&#xA;&lt;p&gt;MatLab is common in both academia and finance, and it does not harm to have used it, but again like Excel VBA the view amongst managers is that if you are smart enough to do real quant work you can pick up whatever MatLab you need though we do see a few jobs for extreme high end MatLab gurus.&lt;/p&gt;&#xA;&lt;p&gt;Fortran is still quite popular in academia, but has only a tiny market share in banks...  Much “C++” code in banks is really much like C, and one does see “C++” code that is written using the C subset but trying to be like Fortran.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="70" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2011-02-08T21:37:10.020" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="318" PostTypeId="2" ParentId="310" CreationDate="2011-02-08T21:44:00.723" Score="15" Body="&lt;p&gt;I. Re: &lt;strong&gt;# of trades&lt;/strong&gt;...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://howtohft.blogspot.com/2011/02/how-to-build-fast-limit-order-book.html&quot;&gt;According to WK Selph&lt;/a&gt; (former quant turned blogger) @ &lt;a href=&quot;http://howtohft.blogspot.com&quot;&gt;WK's High Frequency Trading How To&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;To give some idea of the data volumes,&#xA;  the Nasdaq &lt;strong&gt;TotalView ITCH&lt;/strong&gt; feed, which&#xA;  is &lt;strong&gt;every event in every instrument&#xA;  traded on the Nasdaq&lt;/strong&gt;, can have data&#xA;  rates of &lt;strong&gt;20+ gigabytes/day&lt;/strong&gt; with spikes&#xA;  of &lt;strong&gt;3 megabytes/second&lt;/strong&gt; or more.  The&#xA;  individual messages average about 20&#xA;  bytes each so this means handling&#xA;  &lt;strong&gt;100,000-200,000 messages per second&lt;/strong&gt;&#xA;  during high volume periods.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Doesn't speak to # of trades executed, but in terms of # of transactions analyzed by an HFT trading sytem in search of opportunistic trades...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;II. re: &quot;&lt;strong&gt;can the small guy play the game&lt;/strong&gt;?&quot;...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can't recommend highly enough reading WK Selph's post on &quot;&lt;a href=&quot;http://howtohft.blogspot.com/2011/01/how-i-built-startup-hft-fund-part-1.html&quot;&gt;How I Built a Startup HFT Firm&lt;/a&gt;&quot;, e.g.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;He started an HFT startup with only one partner:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;my focus will be mainly on the&#xA;  technical challenges I faced as the&#xA;  engineering half of a &lt;strong&gt;two person HFT&#xA;  startup&lt;/strong&gt;, the business challenges, such&#xA;  as &lt;strong&gt;acquiring trading capital&lt;/strong&gt; and&#xA;  &lt;strong&gt;negotiating ever-lower trading costs&lt;/strong&gt;,&#xA;  were similarly massive.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;On the never-ending challenge for lower cost-per-trade:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Another problem, especially acute in&#xA;  high frequency trading, is that the&#xA;  cost per trade directly impacts the&#xA;  profitability of a trading strategy&#xA;  so, &lt;strong&gt;for a given per-trade cost,&#xA;  strategies that would otherwise be&#xA;  profitable are not&lt;/strong&gt;. Clearing firms&#xA;  will only provide a low per-trade cost&#xA;  to customers that &lt;strong&gt;execute many trades&lt;/strong&gt;,&#xA;  but to execute many trades one needs a&#xA;  &lt;strong&gt;low per-trade cost&lt;/strong&gt;.  So in addition to&#xA;  the purely technical challenges,&#xA;  &lt;strong&gt;building a HFT firm from scratch&lt;/strong&gt; means&#xA;  solving &lt;strong&gt;two chicken-and-egg problems&lt;/strong&gt;,&#xA;  that of &lt;strong&gt;building a track record&lt;/strong&gt; and&#xA;  that of &lt;strong&gt;negotiating a low per-trade&#xA;  cost&lt;/strong&gt;, &lt;strong&gt;&lt;em&gt;simultaneously&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="266" LastEditorUserId="266" LastEditDate="2011-02-08T21:52:22.243" LastActivityDate="2011-02-08T21:52:22.243" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="319" PostTypeId="2" ParentId="180" CreationDate="2011-02-08T21:58:15.363" Score="11" Body="&lt;p&gt;Perhaps you may want to consider article by &lt;a href=&quot;http://www.soa.org/library/newsletters/risk-management-newsletter/2009/september/jrm-2009-iss17-levine.pdf&quot;&gt;D. Levine - Modeling Tail Behavior with Extreme Value Theory&lt;/a&gt; who gives practicale example on how EVT can be used to calculate probabilities on returns in tails with use of the Pickands-Balkema-de Haan Theorem and generalized Pareto distribution. It also contains some criterias and points on other methods that can be used  to determine threshold value for PBH theorem:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Contrary to this notion is the fact that the PBH theorem&#xA;  states a result based on the assumption of threshold values&#xA;  approaching the right endpoint of the distribution F. This&#xA;  implies that better GPD fits are expected for larger choices&#xA;  of the threshold u.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;One must strike a balance between choosing u large&#xA;  enough so that the theorem is applicable from a practical&#xA;  standpoint and small enough so that a sufficient number&#xA;  of data points can be used in estimation of the parameters&#xA;  of the GPD.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;There is no hard and fast rule describing the “right”&#xA;  choice of the threshold value. Some methods for threshold&#xA;  selection can be found in &lt;a href=&quot;http://www.bankofcanada.ca/en/res/wp/2000/wp00-20.pdf&quot;&gt;Bensalah’s “Steps in Applying&#xA;  Extreme Value Theory to Finance: A Review&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="15" LastActivityDate="2011-02-08T21:58:15.363" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="320" PostTypeId="2" ParentId="250" CreationDate="2011-02-08T22:00:33.247" Score="0" Body="&lt;p&gt;In the risk-free measure, $\mu$ is equal to the risk-free rate. In the real-world measure, $\mu$ is uknown and must be estimated using statistical methods: either directly from historical data, or from a model calibrated to historical data. Note that, in general, there is nothing preventing you from using today's (or past) prices as inputs to this model. For example, no-arbitrage relationships ought to hold in both &quot;worlds&quot;.&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2011-02-08T22:00:33.247" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="321" PostTypeId="2" ParentId="254" CreationDate="2011-02-08T22:11:12.113" Score="5" Body="&lt;p&gt;Quite a lot of options on asset $S(t) &gt; 0$ have a payoff at tinme $T$ equal (at least approximately -- it's a bit more complicated in the case of e.g. credit index options)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$&#xA;(S(T) - K)^+&#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can always find a number $\sigma$ such that, when plugged into Black formula together with strike $K$, spot price $S(t)$, interest rate $r$ and time to expiry $T-t$, you will recover the market price of the option $V(t)$. This number is called the Black implied volatility of the option. Basically, it's a quoting convention for the option prices. Traders use it because:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;it makes it easier for them to compare prices of options on different days, with different strikes&lt;/li&gt;&#xA;&lt;li&gt;Black vols tend to be similar across strikes and expiries (not always!)&lt;/li&gt;&#xA;&lt;li&gt;it is better (in the sense: you're less likely to suffer lots of arbitrage) to interpolate market prices in the $\sigma$ space then directly; that is, if prices for strikes $K_1$ and $K_2$ are quoted, it's better to use some interpolation method on their Black vols $\sigma_1$ and $\sigma_2$ than on their prices $V_1$ and $V_2$&lt;/li&gt;&#xA;&lt;li&gt;it fits their intution better (a paramount argument)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="89" LastActivityDate="2011-02-08T22:11:12.113" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="322" PostTypeId="2" ParentId="114" CreationDate="2011-02-08T22:24:12.197" Score="1" Body="&lt;p&gt;These are a kind of FX barrier options, look up the models for them. You could even use Blacks model for them. By playing around with strikes, you can test this hypothesis.&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2011-02-08T22:24:12.197" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="323" PostTypeId="2" ParentId="306" CreationDate="2011-02-08T22:58:17.943" Score="2" Body="&lt;p&gt;To add some languages I've seen used that I don't see in any responses yet:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/SAS_%28software%29#Example_SAS_code&quot; rel=&quot;nofollow&quot;&gt;SAS&lt;/a&gt; for statistical analysis&lt;/li&gt;&#xA;&lt;li&gt;Perl, as a general purpose scripting language&lt;/li&gt;&#xA;&lt;li&gt;Mathematica, as a possible alternative to MATLAB for mathematical scripting&lt;/li&gt;&#xA;&lt;li&gt;C# or any other .NET language, used in similar capacities as Java would be&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="117" LastEditorUserId="117" LastEditDate="2011-02-08T23:04:43.227" LastActivityDate="2011-02-08T23:04:43.227" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="325" PostTypeId="1" AcceptedAnswerId="336" CreationDate="2011-02-08T23:33:31.573" Score="24" ViewCount="31978" Body="&lt;p&gt;By HFT here I mean anything with holding period less than 5 to 10 minutes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any empirical/anecdotal evidence of using it successfully on even higher frequencies?&lt;/p&gt;&#xA;" OwnerUserId="40" LastEditorUserId="11807" LastEditDate="2015-10-17T20:37:18.960" LastActivityDate="2017-05-10T13:15:42.107" Title="Is the Interactive Brokers API suitable for hft?" Tags="&lt;programming&gt;&lt;high-frequency&gt;&lt;interactive-brokers&gt;" AnswerCount="7" CommentCount="5" FavoriteCount="24" ContentLicense="CC BY-SA 3.0" />
  <row Id="327" PostTypeId="2" ParentId="310" CreationDate="2011-02-09T02:01:49.813" Score="17" Body="&lt;p&gt;My definition is not pretty, but it's practical: If you trade based on 5- or 10-minute bars, I call that &lt;em&gt;high-frequency trading&lt;/em&gt;. If you trade based on tick-by-tick data, including bids and offers, I call that &lt;em&gt;ultra-high frequency trading&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Trading 1-minute bars is somewhere in between. Trading more slowly than 10-minute bars is &quot;day trading&quot;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I make this distinction because the distribution of tick data is very different than the distribution of 5-minute bars. 5-minute bars behave like daily data or like the data from your Time Series Analysis class. In contrast, tick data is essentially an integer-valued process, occasionally moving by a tick or two but usually unchanged, generating data at incredible speed. Its distribution is very different and resembles a Poisson process -- nothing like a conventional time series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The distinction also determines the required caliber of your network and computing gear. You need a very fast connection and a very fast computer to process tick data. A desktop computer with a broadband connection could process 5-minute bars.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bottom line: trading tick data requires a fat pipe to the exchange, a blazingly fast computer, and a whole new data model. Trading 5-minute data is much more like conventional trading happening in real-time. That's a big difference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more about the distribution of tick data, I recommend &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470414359&quot; rel=&quot;noreferrer&quot;&gt;Ruey Tsay's book&lt;/a&gt; or this &lt;a href=&quot;http://www.oxford-man.ox.ac.uk/~nshephard/skellam210910.pdf&quot; rel=&quot;noreferrer&quot;&gt;excellent paper&lt;/a&gt; by Neil Shephard &lt;em&gt;et al&lt;/em&gt;. Tsay calls it &quot;transaction data&quot;. Shephard &lt;em&gt;et al&lt;/em&gt; call it &quot;low latency data&quot;.&lt;/p&gt;&#xA;" OwnerUserId="37" LastEditorUserId="37" LastEditDate="2011-02-09T18:57:50.393" LastActivityDate="2011-02-09T18:57:50.393" CommentCount="13" ContentLicense="CC BY-SA 2.5" />
  <row Id="328" PostTypeId="1" CreationDate="2011-02-09T02:03:53.410" Score="18" ViewCount="2414" Body="&lt;p&gt;Are there ways to measure the risk aversion of a representative investor, based on publicly available market data?  Public available data could include asset price, volume, and flow data, and may be aggregated according to some criterion (asset class and contract type being the most obvious). Pointers to any existing literature are greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="194" LastEditorUserId="1106" LastEditDate="2011-09-27T19:51:57.860" LastActivityDate="2012-03-29T10:21:18.490" Title="Are there ways to measure the risk aversion of a representative investor, based on publicly available market data?" Tags="&lt;research&gt;&lt;reference-request&gt;&lt;market&gt;&lt;risk-premium&gt;" AnswerCount="7" CommentCount="3" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="329" PostTypeId="1" CreationDate="2011-02-09T02:14:14.760" Score="22" ViewCount="955" Body="&lt;p&gt;Some of the largest funds in the world are entirely macro-based: Soros, Brevan Howard, Bridgewater. They trade across asset classes, and seemingly with very concentrated allocations. What type of risk management framework do they adopt? &lt;/p&gt;&#xA;" OwnerUserId="194" LastEditorUserId="1355" LastEditDate="2011-09-08T20:48:49.003" LastActivityDate="2011-09-08T20:48:49.003" Title="How do macro funds manage risk and model asset returns? Do they use factor models?" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;risk-models&gt;&lt;macro&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="330" PostTypeId="2" ParentId="328" CreationDate="2011-02-09T02:19:25.540" Score="1" Body="&lt;p&gt;Going out on another limb here:  No.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First off, there is no representative investor.  If we were all the same, the CAPM and the market portfolio would hold.  So that part is unobservable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, that is why the sell-side strategists are to happy to create things like &lt;em&gt;misery indices&lt;/em&gt; (bad example as it's more macro-based in its sum of inflation plus unemployment), or vix plus credit spreads, or things like AAII sentiment, or speculators/hedgers rations, or put/call ratios, or ... You get the drift.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All that said, I'd love to be proven wrong and see estimates of one such beast.  &lt;/p&gt;&#xA;" OwnerUserId="69" LastActivityDate="2011-02-09T02:19:25.540" CommentCount="10" ContentLicense="CC BY-SA 2.5" />
  <row Id="331" PostTypeId="2" ParentId="82" CreationDate="2011-02-09T03:59:00.753" Score="5" Body="&lt;p&gt;Like @Pete mentioned; knowing what assumptions you are making in your testing and what impact those assumptions could have on your algorithm's results are one of the major drivers to rolling your own trading simulation engine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The framework listed below is based on daily bar needs. Your mileage may vary if you're focused on intra-day.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Good data.  If your trading rules are mid to long-term in nature; you'll need a data provider that has a) true dividend-adjusted data (know of only 2 at this time: CSI Data &amp;amp; FastTrack) and b) delisted data.  CSI is the data provider I currently use.  Know of others that offer true dividend-adjusted data? Please comment.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Language choice. I've prototyped the simulation engine in various languages over the years. R Language was a true winner for awhile until my data needs grew too large. But, if you don't have big data needs...R is really hard to beat for time series analysis. Like @Dirk mentioned; check out the R-SIG-Finance listserv (many gems in there).  In the end, I went with Python. Though, the speed can be an issue at times.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Database. I've also used quite a few database backends for the simulation engine. Could spend pages and pages on what to do here. But, if you don't have big data needs - just go with simple CSV files and use the file system as your index structure. Or if you must have a SQL hammer...give SQLite a shot. Due to big data needs, I had to roll my own here.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I also use Python's matplotlib for charting.  Really nice. But, currently reviewing other charting packages such as &lt;a href=&quot;http://vis.stanford.edu/protovis/&quot; rel=&quot;noreferrer&quot;&gt;Protovis&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &lt;a href=&quot;http://www.datatables.net/&quot; rel=&quot;noreferrer&quot;&gt;DataTables&lt;/a&gt; for displaying the results of large simulations.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="6528" OwnerDisplayName="user301" LastEditorUserId="6528" LastActivityDate="2011-02-09T03:59:00.753" CommentCount="1" CommunityOwnedDate="2011-02-09T03:59:00.753" ContentLicense="CC BY-SA 2.5" />
  <row Id="332" PostTypeId="1" AcceptedAnswerId="333" CreationDate="2011-02-09T04:12:09.103" Score="31" ViewCount="8549" Body="&lt;p&gt;Is there any published research of decent quality linking news or unstructured information to asset returns? I know that Thomson Reuters offers its Machine Readable news (MRN), so somebody must use it. But I can't find much in the public domain.&lt;/p&gt;&#xA;" OwnerUserId="194" LastEditorUserId="1106" LastEditDate="2011-10-03T22:15:27.190" LastActivityDate="2018-03-19T13:26:57.637" Title="Any research on how natural language processing can be used to forecast stocks?" Tags="&lt;quant-trading-strategies&gt;&lt;research&gt;&lt;equities&gt;&lt;forecasting&gt;&lt;prediction&gt;" AnswerCount="5" CommentCount="3" FavoriteCount="34" ContentLicense="CC BY-SA 3.0" />
  <row Id="333" PostTypeId="2" ParentId="332" CreationDate="2011-02-09T04:22:38.330" Score="21" Body="&lt;p&gt;I know that I have seen things like this in the past.  Wasn't there something recently that used Twitter?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are a few recent papers as examples, although I will be brutally honest that I don't know if they speak to your &lt;em&gt;decent quality&lt;/em&gt; requirement:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.aaai.org/ocs/index.php/ICWSM/ICWSM10/paper/download/1529/1904&quot;&gt;&quot;Trading Strategies to Exploit Blog and News Sentiment&quot;&lt;/a&gt; (Zhang, Skiena 2010)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://thesis.haverford.edu/dspace/handle/10066/4888&quot;&gt;&quot;The Predictive Power of Financial Blogs&quot;&lt;/a&gt; (Frisbee 2010)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://portal.acm.org/citation.cfm?id=1860669&quot;&gt;&quot;An analysis of verbs in financial news articles and their impact on stock price&quot;&lt;/a&gt; (Schumaker 2010)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="17" LastActivityDate="2011-02-09T04:22:38.330" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="334" PostTypeId="1" CreationDate="2011-02-09T04:30:37.933" Score="24" ViewCount="2425" Body="&lt;p&gt;Mean-variance optimization (MVO) is a 50+ year concept, and perhaps the first seminal idea of quantitative finance. Still, as far as I know, less than 25% of AUM in the US is quantitatively managed. While a small minority of fundamental managers use MVO, that is counterbalanced by statistical arbitrage and HF strategies that often use optimization but not MVO, so the percentage of AUM &lt;strong&gt;not&lt;/strong&gt; allocated using Markowitz' invention is surely not less than 70%. My questions: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;if MVO is such a great idea, why after&#xA;all this time, so few people use it?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;if MVO was such a bad idea, how come&#xA;companies like Axioma, Northfield&#xA;and Barra still make money off it?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;is there there a rationale for the current&#xA;mixed equilibrium of users and&#xA;non-users?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;A few caveats on what I just said: i) perhaps the first and most important idea in finance is that of state-contingent assets, which is Arrow's; ii) I am focused on the buy side. I believe that optimization is widely used for hedging on the sell side.&lt;/p&gt;&#xA;" OwnerUserId="194" LastActivityDate="2021-05-07T06:06:23.547" Title="Does mean-variance portfolio optimization provide a real edge to those who use it?" Tags="&lt;mean-variance&gt;&lt;optimization&gt;" AnswerCount="6" CommentCount="1" FavoriteCount="10" ContentLicense="CC BY-SA 2.5" />
  <row Id="335" PostTypeId="2" ParentId="111" CreationDate="2011-02-09T04:41:33.260" Score="18" Body="&lt;p&gt;The short and brutal answer is: you don't. First, because ML and Statistics is not something you can command well in one or two years.  &lt;a href=&quot;http://norvig.com/21-days.html&quot;&gt;My recommended time horizon to learn anything non-trivial is 10 years&lt;/a&gt;. ML not a recipe to make money, but just another means to observe reality. Second, because any good statistician knows that understanding the data and the problem domain is 80% of the work. That's why you have statisticians focusing on Physics data analysis, on genomics, on sabermetrics etc. For the record, Jerome Friedman, co-author of ESL quoted above, is a physicist and still holds a courtesy position at &lt;a href=&quot;http://www.slac.stanford.edu/&quot;&gt;SLAC&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, study Statistics and Finance for a few years. Be patient. Go your own way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mileage may vary.&lt;/p&gt;&#xA;" OwnerUserId="194" LastEditorUserId="25" LastEditDate="2014-10-16T05:53:51.203" LastActivityDate="2014-10-16T05:53:51.203" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="336" PostTypeId="2" ParentId="325" CreationDate="2011-02-09T05:57:12.090" Score="21" Body="&lt;p&gt;Holding period and trade frequency are two different things.  If you have a high trade frequency, the name of the game is negotiating lower commissions.  That being said, the TWS API gives you the same quality feed as you get using TWS itself.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &lt;a href=&quot;http://www.dbresearch.com/PROD/DBR_INTERNET_EN-PROD/PROD0000000000269468.pdf&quot;&gt;Article on HFT&lt;/a&gt; Provided by Dirk Eddelbuettel in &lt;a href=&quot;http:///questions/310/how-high-is-the-frequency-in-hft&quot;&gt;this question about HFT&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;High-frequency trading (HFT) is a subset of algorithmic trading &#xA;  where a large number of orders (which are usually fairly small in &#xA;  size) are sent into the market at high speed, with round-trip &#xA;  execution times measured in microseconds (Brogaard, 2010). &#xA;  Programs running on high-speed computers analyse massive &#xA;  amounts of market data, using sophisticated algorithms to exploit &#xA;  trading opportunities that may open up for milliseconds or seconds. &#xA;  Participants are constantly taking advantage of very small price &#xA;  imbalances; by doing that at a high rate of recurrence, they are able &#xA;  to generate sizeable profits. Typically, a high frequency trader would &#xA;  not hold a position open for more than a few seconds. Empirical &#xA;  evidence reveals that the average U.S. stock is held for 22 seconds&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Updates and orders with the TWS API occur on the order of 10s to 100s of milliseconds, as far as I can tell, which would disqualify it for use in the regime described in the article.  (This is just what I have measured on my own computer on my retail Internet connection.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Honestly I would be surprised if anyone could do HFT with any retail product.  Sounds impossible.&lt;/p&gt;&#xA;" OwnerUserId="47" LastEditorUserId="47" LastEditDate="2011-02-09T15:15:01.427" LastActivityDate="2011-02-09T15:15:01.427" CommentCount="6" ContentLicense="CC BY-SA 2.5" />
  <row Id="337" PostTypeId="2" ParentId="334" CreationDate="2011-02-09T06:25:44.033" Score="4" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The biggest problem with mean-variance optimization is that the sensitivity of the estimated covariance matrix.&lt;br&gt;&#xA;Mean variance optimization assumes that one &quot;knows&quot; the covariance of each asset with every other asset, or that the covariance matrix is constant. Without this assumption the MVO framework is not tractable.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Axioma and others do a lot more than just MVO.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;None of the approaches are foolproof. An approach that is easy to calculate (MVO), usually has some unpalatable consequences. Things that are difficult to calculate usually provide a false sense of security when it comes to robustness.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Wilmott is a good source to consult for the balance between easy and complex.&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-02-09T06:25:44.033" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="338" PostTypeId="2" ParentId="328" CreationDate="2011-02-09T06:27:13.330" Score="2" Body="&lt;p&gt;Short answer yes!&#xA;It's called VIX.  When it goes up, investors are afraid.  When it goes down, investors are complacent. &lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-02-09T06:27:13.330" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="339" PostTypeId="2" ParentId="325" CreationDate="2011-02-09T06:32:26.523" Score="10" Body="&lt;p&gt;For real HFT, IB is absolutely not going to work.&#xA;The prices in IB update a max of about 7 times a second.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, for a holding period of 5 to 10 minutes though, which is certainly not high frequency, it works fine.&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-02-09T06:32:26.523" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="340" PostTypeId="2" ParentId="38" CreationDate="2011-02-09T06:48:30.317" Score="2" Body="&lt;p&gt;The framework for valuing structured finance products in general is based on the nature of the cashflows in the product.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Decompose the constituent components of the structure.&lt;/li&gt;&#xA;&lt;li&gt;Make some choices about handling the correlations between assets in the structure.&lt;/li&gt;&#xA;&lt;li&gt;Review the covenants of the structure and their impact on the cashflows (sequence of events).&lt;/li&gt;&#xA;&lt;li&gt;Compute.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-02-09T06:48:30.317" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="341" PostTypeId="1" AcceptedAnswerId="349" CreationDate="2011-02-09T07:58:10.193" Score="23" ViewCount="17548" Body="&lt;p&gt;What is a martingale and how it compares with a random walk in the context of the Efficient Market Hypothesis?&lt;/p&gt;&#xA;" OwnerUserId="40" LastEditorUserId="70" LastEditDate="2011-09-15T17:32:09.147" LastActivityDate="2017-11-11T19:31:07.590" Title="What is a martingale?" Tags="&lt;mathematics&gt;&lt;martingale&gt;&lt;emh&gt;" AnswerCount="6" CommentCount="0" FavoriteCount="16" ContentLicense="CC BY-SA 2.5" />
  <row Id="342" PostTypeId="2" ParentId="341" CreationDate="2011-02-09T08:18:14.267" Score="7" Body="&lt;p&gt;A martingale can be viewed as a fair game (a game in which there is no arbitrage strategy)  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A (centered) random walk is a martingale (think of it as the total Gain of the fair game)   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If EFH is in order, then you can think that all information is in the current price, I think this more comparable to Markov Property than to Martingale property.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope that this helps a bit&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="92" LastEditDate="2011-02-09T10:53:16.273" LastActivityDate="2011-02-09T10:53:16.273" CommentCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="343" PostTypeId="2" ParentId="306" CreationDate="2011-02-09T08:20:10.960" Score="6" Body="&lt;p&gt;I use C# ( and more generally .Net Framework)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards&lt;/p&gt;&#xA;" OwnerUserId="92" LastActivityDate="2011-02-09T08:20:10.960" CommentCount="0" CommunityOwnedDate="2011-02-09T08:20:10.960" ContentLicense="CC BY-SA 2.5" />
  <row Id="344" PostTypeId="1" AcceptedAnswerId="1771" CreationDate="2011-02-09T08:27:41.263" Score="20" ViewCount="26678" Body="&lt;p&gt;I often hear people talking about the skew of the volatility surface, model, etc... but it appears to me that a clear standard definition is not unanimously in place among practitioners.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;So here is my question:&lt;/strong&gt; Does anyone has a clear and unifying definition that can be stated in mathematical terms of what skew is in the context of risk neutral pricing?  If not, do you have a set of definitions of the skew with respect to a specific context?&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="1106" LastEditDate="2011-08-25T16:30:05.200" LastActivityDate="2021-02-17T06:04:39.753" Title="What is the implied volatility skew?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;implied-volatility&gt;&lt;skew&gt;" AnswerCount="6" CommentCount="1" FavoriteCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="345" PostTypeId="2" ParentId="344" CreationDate="2011-02-09T09:03:03.387" Score="4" Body="&lt;p&gt;The skew of a distribution is a measure of its assymetry. Let $X_n$ be a discrete process (say, of daily returns) with mean 0 and noncentered volatility $\sigma$. Then the noncentered skew is defined as&#xA; $$\frac{1}{n}\sum_{k=1}^{n}\frac{X_k^3}{\sigma}.$$&#xA;It will be positive is $X_n$ and $X_n^2$ are positively correlated and negative if they are negatively correlated. Roughly speaking, the skew expresses the correlation between the move of a random process and its volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The volatility skew is the slope of the graph of implied volatility versus strike. A negative skew corresponds to a downward slope which is observed in equity options.&lt;/p&gt;&#xA;" OwnerUserId="70" LastEditorUserId="70" LastEditDate="2011-02-09T09:12:24.767" LastActivityDate="2011-02-09T09:12:24.767" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="346" PostTypeId="2" ParentId="341" CreationDate="2011-02-09T09:28:44.287" Score="20" Body="&lt;p&gt;A martingale is a random process $X(t)$ which has the following properties:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$&#xA;E[X(T)|\mathcal{F}_t] = X(t)&#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for $T &gt; t$ and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$&#xA;E[|X(T)|] &amp;lt; \infty&#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\mathcal{F}_t$ is the filtration at time $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A martingale is a random walk, but not every random walk is a martingale. A Brownian random walk is a martingale if it does not have drift.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, a martingale does not have to be a Markov process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EMH is not directly related to martingales.&lt;/p&gt;&#xA;" OwnerUserId="89" LastEditorUserId="89" LastEditDate="2011-02-10T12:41:42.577" LastActivityDate="2011-02-10T12:41:42.577" CommentCount="6" ContentLicense="CC BY-SA 2.5" />
  <row Id="347" PostTypeId="2" ParentId="344" CreationDate="2011-02-09T09:52:36.427" Score="9" Body="&lt;p&gt;Skew is indeed a widely used word and can represent one of the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Skew(ness) - 3rd standardized moment that represents assymetry of the&#xA;distribution (&lt;em&gt;olaker&lt;/em&gt; metioned it his answer).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;(Volatility) skew - is observable property of implied volatility surface that can be seen on the market after the 1987 crash. &#xA;It shows that OTM puts (high demand) are usually have higher price (for the same expiry) than OTM calls (high supply to buy protective puts).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the first assumption you can think about &lt;em&gt;IV surface =  term structure (IV changes over time) + volatility skew (IV changes with strikes)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also &lt;a href=&quot;http://www.quantonline.co.za/documents/Safex%20Volatility%20Skew%20FAQs.pdf&quot;&gt;Volatility Skew FAQ&lt;/a&gt; for brief explanation.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Skew can also represent term in volatility model that adds adjustment to represent volatility skew which itself is a subject of proper calibration. For example see &lt;a href=&quot;http://www.scicomp.com/news/article/risk_skew_fits.pdf&quot;&gt;If Skew Fits article&lt;/a&gt; where local volatility model has the following form:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$${\sigma_t} = \sigma_{atm}+\sigma_{skew}+\sigma_{kurt}.$$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="15" LastEditorUserId="70" LastEditDate="2011-02-09T15:31:44.190" LastActivityDate="2011-02-09T15:31:44.190" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="348" PostTypeId="1" AcceptedAnswerId="356" CreationDate="2011-02-09T10:20:17.667" Score="21" ViewCount="1695" Body="&lt;p&gt;Common wisdom holds it that a moving average approach is more successful than buy-and-hold. There is quantitative evidence for that across different asset classes (see e.g. &lt;a href=&quot;http://books.google.de/books?id=DP_YREBTXREC&amp;amp;lpg=PP1&amp;amp;dq=mebane%20faber&amp;amp;hl=en&amp;amp;pg=PP1#v=onepage&amp;amp;q&amp;amp;f=false&quot;&gt;this book&lt;/a&gt;, or &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=962461&quot;&gt;this paper&lt;/a&gt; from the same author Mebane Faber).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question takes a different turn: I am trying to generalize these empirical findings to a general class of stochastic processes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question:&lt;/strong&gt;&lt;br&gt;&#xA;What properties must a stochastic process have for moving average trading to outperform naive buy-and-hold. At the moment I am only talking about simple moving average strategies like when the process crosses the average from above/below sell/buy. There could also be simplifying assumptions like no trading costs etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The plan behind this is to find general properties which are empirically testable on their own. In a way I want to find the building blocks for moving average strategies to work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you have some ideas, papers, references...? Thank you!&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-08-22T07:51:38.003" Title="Statistical properties of stochastic processes for moving average trading to work" Tags="&lt;trading&gt;&lt;stochastic-processes&gt;&lt;moving-average&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="10" ContentLicense="CC BY-SA 2.5" />
  <row Id="349" PostTypeId="2" ParentId="341" CreationDate="2011-02-09T10:20:58.390" Score="24" Body="&lt;p&gt;Samuelson suggested in 1965 that the stock prices follow a martingale (see P. Samuelson &lt;a href=&quot;http://stevereads.com/papers_to_read/proof_that_properly_anticipated_prices_fluctuate_randomly.pdf&quot;&gt;“Proof That Properly Anticipated Prices Fluctuate Randomly”&lt;/a&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume there is a security with a random payoff $X_T$ at date $T$.  Let $..., P_{t–1}, P_t, P_{t+1},...$ be the time series of prices of a security with this payoff.   Finally, define the price change $\Delta P_{t+1}=P_{t+1} – P_{t}$ for any pair of successive dates $t$ and $t + 1$. Samuelson begins by defining “properly anticipated prices” as prices that are equal to the expected value of $X_T$ at every date $t \leq T$, based on the information $\Phi_t$ available   at date t (which, in particular, includes the present and all past price realizations for that security, $...,P_{t–2}, P_{t–1}, P_t$). That is, for all $t \leq T$:&#xA;$$P_t = \mathbb E(X_T|\Phi_t).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular, $P_T = X_T$. He then proves that the “prices fluctuate randomly”&#xA;since it follows that for all $t \leq T$, $P_t = \mathbb E(P_{t+1}|\Phi_t)$ or alternatively that $\mathbb E(\Delta P_{t+1}|\Phi_t) = 0$, and $$\mathbb E(\Delta P_{t+1}\Delta P_{t+2}...\Delta P_T|\Phi_t) = \mathbb E(\Delta P_{t+1}|\Phi_t) \mathbb E(\Delta P_{t+2}|\Phi_t)...\mathbb E(\Delta P_T|\Phi_t)=0.$$ In words, prices follow a martingale, and successive price changes are mutually uncorrelated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This implies that if “prices are properly anticipated,” all the information&#xA;in the past price series that is useful for forecasting next period’s &lt;em&gt;expected&#xA;price&lt;/em&gt; is contained in the current price. Note that this is a much weaker statement than to say that all information in the past price series that is useful for forecasting the &lt;em&gt;probability distribution of next period’s price&lt;/em&gt; is contained in the current price (which is the random walk hypothesis suggested by Fama in his &lt;a href=&quot;http://stevereads.com/papers_to_read/the_behavior_of_stock_market_prices.pdf&quot;&gt;thesis&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="70" LastEditorUserId="70" LastEditDate="2011-02-09T10:40:24.847" LastActivityDate="2011-02-09T10:40:24.847" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="350" PostTypeId="1" AcceptedAnswerId="351" CreationDate="2011-02-09T12:12:13.830" Score="14" ViewCount="2234" Body="&lt;p&gt;In the interest of having &quot;&lt;a href=&quot;http://blog.stackoverflow.com/2011/01/the-wikipedia-of-long-tail-programming-questions/&quot; rel=&quot;nofollow&quot;&gt;canonical questions&lt;/a&gt;&quot; on this site ... What is a Quant?&lt;/p&gt;&#xA;" OwnerUserId="288" LastEditorUserId="17" LastEditDate="2011-02-09T14:32:48.563" LastActivityDate="2011-12-27T19:32:53.747" Title="What is a Quant" Tags="&lt;quants&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="351" PostTypeId="2" ParentId="350" CreationDate="2011-02-09T12:18:35.153" Score="19" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Mark Joshi briefly describes the roles of six types of quants  in his &lt;a href=&quot;http://www.markjoshi.com/downloads/advice.pdf&quot;&gt;advice&lt;/a&gt; for wannabe quants:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Front office or desk quant&lt;/li&gt;&#xA;&lt;li&gt;Model validating quant&lt;/li&gt;&#xA;&lt;li&gt;Research quant&lt;/li&gt;&#xA;&lt;li&gt;Quant developer&lt;/li&gt;&#xA;&lt;li&gt;Statistical arbitrage quant&lt;/li&gt;&#xA;&lt;li&gt;Capital quant  &lt;/li&gt;&#xA;&lt;/ol&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;His classification agrees  more or less with the taxonomy contained in the &lt;a href=&quot;http://en.wikipedia.org/wiki/Quantitative_analyst#Types_of_Quant&quot;&gt;Wikipedia article&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&quot;For the past twenty years, throughout Wall Street and the City of London, in most major and many minor financial institutions, small groups of ex-physicists and applied mathematicians have tried to apply their skills to securities markets. Formerly called “rocket scientists” by those who mistakenly thought that rocketry was the most advanced branch of science, they are now commonly called “quants.” (Emanuel Derman, &lt;a href=&quot;http://books.google.com/books?id=9SFgTpq770QC&amp;amp;printsec=frontcover&amp;amp;dq=my+life+as+a+quant&amp;amp;hl=en&amp;amp;ei=vaZSTdGdEsKDOravkbcH&amp;amp;sa=X&amp;amp;oi=book_result&amp;amp;ct=result&amp;amp;resnum=1&amp;amp;ved=0CCkQ6AEwAA#v=onepage&amp;amp;q&amp;amp;f=false&quot;&gt;&lt;em&gt;My Life as a Quant&lt;/em&gt;&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&quot;A quant is a brand of industrial scientist who applies mathematical models of uncertainty to financial (or socioeconomic) data and complex financial instruments.&quot; (Nassim Taleb, &lt;a href=&quot;http://books.google.com/books?id=_StMPgAACAAJ&amp;amp;dq=editions%3aYdOYmYA2TJYC&amp;amp;hl=en&amp;amp;ei=g6tSTYX2G4rP4gbhx9SrCA&amp;amp;sa=X&amp;amp;oi=book_result&amp;amp;ct=result&amp;amp;resnum=10&amp;amp;ved=0CEoQ6AEwCQ&quot;&gt;&lt;em&gt;The Black Swan&lt;/em&gt;&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="70" LastEditorUserId="70" LastEditDate="2011-02-09T18:41:53.690" LastActivityDate="2011-02-09T18:41:53.690" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="352" PostTypeId="1" AcceptedAnswerId="354" CreationDate="2011-02-09T12:26:05.793" Score="21" ViewCount="8341" Body="&lt;p&gt;The fascinating thing about &lt;strong&gt;volatility pumping&lt;/strong&gt; (or &lt;strong&gt;optimal growth portfolio&lt;/strong&gt;, see e.g. &lt;a href=&quot;http://www.math.ust.hk/~maykwok/courses/Fin_econ_05/Fin_econ_05_1.pdf&quot;&gt;here&lt;/a&gt;) is that here volatility is not the same as risk, rather it represents opportunity. Additionally it is a generic mechanical strategy that is independent of asset classes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question:&lt;/strong&gt;&lt;br&gt;&#xA;Do you know examples where volatility pumping is actually implemented? What are the results? What are the pitfalls?&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="70" LastEditDate="2011-02-09T13:03:16.090" LastActivityDate="2021-03-31T11:08:31.857" Title="Volatility pumping in practice" Tags="&lt;volatility&gt;&lt;trading&gt;&lt;kelly-criterion&gt;" AnswerCount="5" CommentCount="5" FavoriteCount="17" ContentLicense="CC BY-SA 2.5" />
  <row Id="353" PostTypeId="2" ParentId="350" CreationDate="2011-02-09T12:27:18.157" Score="-1" Body="&lt;p&gt;Generally speaking, a Quant is just another fancy word for &quot;financial engineer&quot;.&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="467" LastEditDate="2011-12-27T19:32:53.747" LastActivityDate="2011-12-27T19:32:53.747" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="354" PostTypeId="2" ParentId="352" CreationDate="2011-02-09T12:36:43.437" Score="12" Body="&lt;p&gt;The optimal growth portfolio is obtained by applying the &lt;a href=&quot;http://en.wikipedia.org/wiki/Kelly_criterion&quot;&gt;Kelly criterion&lt;/a&gt; which is one of the pillars of the sound risk management.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Edward_O._Thorp&quot;&gt;Ed Thorp's&lt;/a&gt; weekend forays to Las Vegas to play blackjack were one of the first historically documented cases of successful practical implementation of the Kelly strategy. Since then this method and its modifications have been systematically used by Thorp himself and other hedge fund managers as an important risk control tool.  &lt;/p&gt;&#xA;" OwnerUserId="70" LastEditorUserId="70" LastEditDate="2011-02-09T12:42:02.137" LastActivityDate="2011-02-09T12:42:02.137" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="355" PostTypeId="2" ParentId="350" CreationDate="2011-02-09T14:27:50.780" Score="8" Body="&lt;p&gt;A Quant is someone who develops mathematical models for financial markets.&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="17" LastEditDate="2011-02-09T15:16:13.313" LastActivityDate="2011-02-09T15:16:13.313" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="356" PostTypeId="2" ParentId="348" CreationDate="2011-02-09T15:10:45.070" Score="11" Body="&lt;p&gt;These moving strategies are also known as trend-following. If returns have positive autocorrelation, hurst exponent &gt; 0.5 that would be good for these strategies.  &lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2011-02-09T15:10:45.070" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="357" PostTypeId="2" ParentId="325" CreationDate="2011-02-09T15:58:43.670" Score="22" Body="&lt;p&gt;This has nothing to do with IB in particular. The primary issue with retail data feeds is that they run over the Internet. That means dealing with a shared line and all of the latency spikes that comes with it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Institutional traders, even when they aren't co-located, build a private network pipe to their data vendor since that's the only way to prevent network jitter (and hacking attempts). Regardless of vendor or even application domain, it is simply impossible to run a real-time mission-critical business over the Internet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, no, IB can't be used for HFT. And neither can anything else.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-02-09T15:58:43.670" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="358" PostTypeId="1" AcceptedAnswerId="453" CreationDate="2011-02-09T15:59:20.580" Score="11" ViewCount="2242" Body="&lt;p&gt;I am starting to work with options data from optionmetrics. I use data frames, but it seems like xts or zoo objects are the way to go for features and speed. I can't figure out the best work-around to get 1 row per date. Should I be doing a list of xts objects with one object per optionid?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's my current approach: I am trying to price higher moments by looking at the returns to hedged portfolios of S&amp;amp;P 500 index options, so I really need to match next period's option price with this period's date. I use a data frame with the dates as a &lt;code&gt;Date&lt;/code&gt; class and peel off the date, optionid, and option price (boa) columns. I reshape to wide with the optionid as the column names and shift the date back (here I do daily, but it can be any holding period). Then I melt back to long dataframe and merge back on the original data frame. I will give code below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I do this for both calls and puts, then I can merge on date, strike, and expiry and form hedged portfolios. This approach works well enough, but it doesn't seem very extensible and probably ignoring a lot of good tools in R. Right now I am just looking at index options, but maybe later I'll be looking at the cross-section, so speed will come in handy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do you go about working with options data in R? Thanks!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the code:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; head(call.l)&#xA;        date     exdate dte optionid strike close   Xms    boa    delta&#xA;1 1996-01-04 1996-03-16  72 10003226    600 617.7 -17.7 25.250 0.768930&#xA;2 1996-01-04 1996-02-17  44 10016457    570 617.7 -47.7 48.750 0.000000&#xA;3 1996-01-04 1996-06-22 170 10019107    595 617.7 -22.7 39.000 0.732626&#xA;4 1996-01-04 1997-06-21 534 10050656    700 617.7  82.3 15.750 0.294790&#xA;5 1996-01-04 1996-02-17  44 10060564    615 617.7  -2.7 11.000 0.599153&#xA;6 1996-01-04 1996-02-17  44 10091463    655 617.7  37.3  0.375 0.046054&#xA;&#xA;temp.l &amp;lt;- call.l[, c(&quot;date&quot;, &quot;optionid&quot;, &quot;boa&quot;)]&#xA;temp.w &amp;lt;- dcast(temp.l, formula = &quot;date ~ optionid&quot;, value_var = &quot;boa&quot;)&#xA;temp.w &amp;lt;- temp.w[ order(temp.w[, &quot;date&quot;]), ]&#xA;temp.w.shift &amp;lt;- tail(temp.w, -1) &#xA;temp.w.shift[, &quot;date&quot;] &amp;lt;- head(temp.w[, &quot;date&quot;], -1)&#xA;temp.l.shift &amp;lt;- melt(temp.w.shift, id.vars = &quot;date&quot;, variable.name = &quot;optionid&quot;, value.name = &quot;boa.fut&quot;, na.rm = T)&#xA;call.l.new &amp;lt;- merge(call.l, temp.l.shift)&#xA;&#xA;&amp;gt; head(subset(call.l.new, strike == 615))&#xA;          date optionid     exdate dte strike  close   Xms    boa    delta boa.fut&#xA;5   1996-01-04 10060564 1996-02-17  44    615 617.70 -2.70 11.000 0.599153 10.6250&#xA;43  1996-01-04 10372012 1996-03-16  72    615 617.70 -2.70 15.000 0.593709 14.6250&#xA;80  1996-01-04 10823593 1996-01-20  16    615 617.70 -2.70  7.750 0.597414  6.0000&#xA;144 1996-01-05 10060564 1996-02-17  43    615 616.71 -1.71 10.625 0.577407 12.2500&#xA;182 1996-01-05 10372012 1996-03-16  71    615 616.71 -1.71 14.625 0.578089 16.2500&#xA;219 1996-01-05 10823593 1996-01-20  15    615 616.71 -1.71  6.000 0.584558  7.0625&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="106" LastEditorUserId="17" LastEditDate="2011-02-09T16:04:00.510" LastActivityDate="2011-02-19T16:31:10.047" Title="Is there a technique for using xts or zoo objects with options data (i.e., many entries per date) in R?" Tags="&lt;data&gt;&lt;analysis&gt;&lt;options&gt;&lt;r&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="9" ContentLicense="CC BY-SA 2.5" />
  <row Id="359" PostTypeId="2" ParentId="328" CreationDate="2011-02-09T16:05:25.457" Score="2" Body="&lt;p&gt;There are multiple components to this but in a very general sense one has to look at two things: The &quot;credit&quot; spread and the &quot;cost of insurance&quot;&#xA;The former tells you how much excess return the representative investor is demanding to be compensated for the risk of counterparty default. The later tells you how much an investor is willing to pay to defease a risk over a given interval. Insurance can come in the form of credit default swaps, option premium or in some cases the contango. &lt;/p&gt;&#xA;" OwnerDisplayName="user315" LastActivityDate="2011-02-09T16:05:25.457" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="360" PostTypeId="2" ParentId="329" CreationDate="2011-02-09T16:15:20.537" Score="1" Body="&lt;p&gt;Multi Factor Models are certainly used as a cross validation for policy. &lt;/p&gt;&#xA;" OwnerDisplayName="user315" LastActivityDate="2011-02-09T16:15:20.537" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="361" PostTypeId="2" ParentId="181" CreationDate="2011-02-09T16:21:54.863" Score="1" Body="&lt;p&gt;Without a stable covariance structure, I imagine the error terms driven by distributional assumptions and time elements of the underlying would kill any definitive statement one could make.&lt;/p&gt;&#xA;" OwnerDisplayName="user315" LastActivityDate="2011-02-09T16:21:54.863" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="362" PostTypeId="2" ParentId="334" CreationDate="2011-02-09T17:21:35.363" Score="11" Body="&lt;p&gt;Hey, it's early days yet.  After all it is still called MODERN portfolio theory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think there are two main issues and they are both really cultural:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) specifying alphas&#xA;2) wild results&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alphas&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I agree with Gappy that alphas are the key thing you need to have effectiveness (unless you are doing minimum variance).  Having a vector of expected returns is quite a natural thing for quant managers.  But it is something foreign to fundamental managers.  They have to map their views into a number for each asseet in the universe.  That is not necessarily an easy task, and probably would seem like busywork.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've proposed an optimization that minimizes distance to an ideal target portfolio (subject to constraints).  But I haven't exactly been overrun with fundamental managers clamoring for it.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wild answers&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you take a textbook optimization at its word, you're likely to do some pretty strange things.  That has given optimization quite a bad reputation in many quarters.  The solution is quite simple: either impose a turnover constraint or increase trading costs to account for the uncertainty of the expected returns (and, less so, the variance matrix).  Using trading costs is the better approach but getting the trading costs right is a project in itself.&lt;/p&gt;&#xA;" OwnerUserId="249" LastActivityDate="2011-02-09T17:21:35.363" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="363" PostTypeId="2" ParentId="35" CreationDate="2011-02-09T17:29:51.550" Score="2" Body="&lt;p&gt;This blog post just came out: &lt;a href=&quot;http://www.portfolioprobe.com/2011/02/08/4-and-a-half-myths-about-beta-in-finance/&quot; rel=&quot;nofollow&quot;&gt;http://www.portfolioprobe.com/2011/02/08/4-and-a-half-myths-about-beta-in-finance/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="249" LastActivityDate="2011-02-09T17:29:51.550" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="364" PostTypeId="1" CreationDate="2011-02-09T17:46:56.340" Score="16" ViewCount="5597" Body="&lt;p&gt;In the spirit of canonical questions please state here versions of the FTAP in the following form (please only one theorem by answer) :  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Necessary definitions (or a direct link to definitions) &lt;/li&gt;&#xA;&lt;li&gt;Hypothesys and Context (such as existence or not of transaction costs, discrete time setting, etc...)  &lt;/li&gt;&#xA;&lt;li&gt;Statement of the Theorem  &lt;/li&gt;&#xA;&lt;li&gt;Reference(s) for a proof   &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The motivation is coming from the fact there are several versions of this theorems and having one place regrouping those differents versions would be nice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="92" LastEditDate="2011-02-10T14:04:03.390" LastActivityDate="2012-03-29T20:31:20.233" Title="Fundamental Theorem of Asset Pricing (FTAP)" Tags="&lt;no-arbitrage-theory&gt;" AnswerCount="2" CommentCount="8" FavoriteCount="7" ContentLicense="CC BY-SA 2.5" />
  <row Id="365" PostTypeId="2" ParentId="334" CreationDate="2011-02-09T18:13:00.717" Score="4" Body="&lt;p&gt;In addition to the points above, I'd say that asset managers also have to bear two things in mind that limit their ability to &quot;properly&quot; optimise their portfolios:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) general restrictions on asset allocation (regulatory, contractual, common-sense)&#xA;2) transaction cost&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my experience, asset managers do use a variety of optimisation techniques occasionally (rather than constantly) and in order to inform their decisions (rather than trading on them 1:1). Quite often, they would also get their brokers to run an optimisation after whatever technique is currently in fashion and to suggest appropriate trades on the back of that. They will then think about it - which is, after all, what active managers are being paid for - and do what they think is sensible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hans&lt;/p&gt;&#xA;" OwnerUserId="317" LastActivityDate="2011-02-09T18:13:00.717" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="366" PostTypeId="2" ParentId="156" CreationDate="2011-02-09T18:20:55.360" Score="8" Body="&lt;p&gt;&lt;strong&gt;Corporate Actions&lt;/strong&gt; do not happen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is to say, both the models and psychology tend to ignore the possibility of such behavior as takeovers, spinouts, significant changes in leverage (ratio of debt to equity) by issuing or redeeming bonds, and the like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, there are desks (such as merger arb) that specifically play these, and fundamental analysts discuss and sometimes &quot;model&quot; them (if you can call their relatively simple spreadsheets models).  But you'll find that the difficulty of including them in options models keeps them unincorporated, and plenty of traders fail to make the necessary mental adjustments.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-02-09T18:20:55.360" CommentCount="0" CommunityOwnedDate="2011-02-09T18:20:55.360" ContentLicense="CC BY-SA 2.5" />
  <row Id="369" PostTypeId="1" AcceptedAnswerId="372" CreationDate="2011-02-09T19:36:39.913" Score="5" ViewCount="956" Body="&lt;p&gt;People &quot;on the Street&quot; distinguish between quants and structurers. Who are the structurers? what do they do?&lt;/p&gt;&#xA;" OwnerUserId="89" LastEditorUserId="16595" LastEditDate="2018-09-27T20:36:29.577" LastActivityDate="2018-09-27T20:36:29.577" Title="What is a Structurer?" Tags="&lt;career&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="370" PostTypeId="2" ParentId="181" CreationDate="2011-02-09T19:45:13.907" Score="13" Body="&lt;p&gt;There are plenty of market models -- capital asset pricing model (CAPM), conditional CAPM (CCAPM), intertemporal CAPM (ICAPM), and arbitrage pricing theory (APT). But any model, finance or otherwise, requires assumptions. Under these models the market may pay you to play your strategy, but in return you must accept risk. So with one of these models you could determine the half-life of your trading model, but it would require you to make some forecast about the relevant factors in your model. And even then you would have to accept some risk-return trade-off.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The required assumptions for these models -- typically things like common information set and expectations for all players, no arbitrage, and complete markets -- aren't perfect, but I think they are the only way to build a tractable model for the whole market. It is difficult to justify a model that has predictable risk-free profit opportunities. There are just too many smart, hardworking people in financial markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not saying that I think markets are completely efficient, just that it would be difficult to build such a model. &lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-02-09T19:45:13.907" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="371" PostTypeId="1" AcceptedAnswerId="1485" CreationDate="2011-02-09T20:23:09.233" Score="9" ViewCount="724" Body="&lt;p&gt;I need to model MBS coupon stack prices.  It would not be difficult to create something from scratch, but I don't want to re-invent the wheel (and explain why I did) if a somewhat standard model already exists.  By &quot;somewhat standard&quot;, I mean models like those for the term structure (e.g. &lt;a href=&quot;http://en.wikipedia.org/wiki/Nelson-Siegel#Modeling_the_yield_curve&quot;&gt;Nelson-Siegel / Nelson–Siegel–Svensson&lt;/a&gt; or some newer stuff by &lt;a href=&quot;http://www.ssc.upenn.edu/~fdiebold/YieldCurve.html&quot;&gt;Diebold et al&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would appreciate any pointers, no matter how obscure.&lt;/p&gt;&#xA;" OwnerUserId="56" LastActivityDate="2011-07-22T16:46:44.473" Title="Are there any standard MBS coupon stack models?" Tags="&lt;models&gt;&lt;mbs&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="372" PostTypeId="2" ParentId="369" CreationDate="2011-02-09T20:59:57.740" Score="2" Body="&lt;p&gt;Well,  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Structurers are simply guys that actually have something to sell.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;They (usually) try to identify if their clients have some complex balance sheet problems, or risks to hedge, or returns to get, and propose them Structured Products&quot; that can fit those problematic.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards&lt;/p&gt;&#xA;" OwnerUserId="92" LastActivityDate="2011-02-09T20:59:57.740" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="373" PostTypeId="1" AcceptedAnswerId="374" CreationDate="2011-02-09T21:23:26.000" Score="6" ViewCount="492" Body="&lt;p&gt;Ideally an intuitive explanation with an example, please.&lt;/p&gt;&#xA;" OwnerUserId="40" LastEditorUserId="70" LastEditDate="2011-02-09T21:58:30.430" LastActivityDate="2014-08-31T16:27:03.960" Title="What is a cubature scheme?" Tags="&lt;numerical-methods&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="374" PostTypeId="2" ParentId="373" CreationDate="2011-02-09T22:00:40.950" Score="7" Body="&lt;p&gt;Cubature (of a given order) is a general method that allows you to do some approximate integration by being exact on a subset of integrand. If you are given a measure $M$ over for example $\mathbb R^n$ then will approach $M$ by (typically) a discrete measure $M^d=\sum_{i=1}^m \lambda_i\delta(x_i) $ such that polynomials $P$ of degree less or equal to $\gamma$ you have :&lt;br&gt;&#xA;$$\int_{\mathbb R^n}P(x)dM(x)=\sum_{i=1}^m \lambda_i.P(x_i)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the context of a Stochastic Diffusion processes $X_t$ defined by an SDE (ideally in a Stratonovitch form), if you have the to calculate the expectation of a functional of the diffusion path, then you can think of this as an integration over the Wiener measure.  Formally this looks like :  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E_{\mathbb{W}}[F(X_.)]=\int_{p\in Path}F(p)d\mathbb{W}(p)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course here the problem is infinite dimensional so quite hard to address in its full generallity and in a numerically tractable form.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway by using Cubature over Wiener Space you can &quot;in a way&quot; approximate the problem by switching to another (and simpler to use) measured space over finite variation paths (recall that Wiener measure doesn't weigh finite variation path !!!) and this approximate measure is such that it matches the values Wiener Measure moments of Iterated Wiener Integral.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This transforms then the SDE into a classical ODE (that can be eventually solved analyticaly or numercaly), and finaly your expectation of your functional becomes hopefully numerically tractable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="70" LastEditDate="2011-02-09T22:03:37.993" LastActivityDate="2011-02-09T22:03:37.993" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="375" PostTypeId="1" AcceptedAnswerId="382" CreationDate="2011-02-10T01:37:00.237" Score="8" ViewCount="599" Body="&lt;p&gt;Suffixes indicating class, preferred, new, etc., are well defined for NASDAQ and NYSE, but I can't find anything documenting the meanings of the trailing punctuation. For example, here's some that I saw in today's feed from NASDAQ:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;OHI-D*&lt;/li&gt;&#xA;&lt;li&gt;REN+&lt;/li&gt;&#xA;&lt;li&gt;RTN+&lt;/li&gt;&#xA;&lt;li&gt;SGS=&lt;/li&gt;&#xA;&lt;li&gt;F+&lt;/li&gt;&#xA;&lt;li&gt;AIG+&lt;/li&gt;&#xA;&lt;li&gt;BLL#&lt;/li&gt;&#xA;&lt;li&gt;AA-&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="324" LastEditorUserId="324" LastEditDate="2011-02-10T01:43:15.253" LastActivityDate="2011-02-10T03:26:18.663" Title="Are special condition identifiers (e.g. AIG+) standardized?" Tags="&lt;trading&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="376" PostTypeId="2" ParentId="14" CreationDate="2011-02-10T01:57:17.390" Score="3" Body="&lt;p&gt;I'm going to disagree with richardh here, since it seems unusual to &#xA;quote options with 10% delta. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, I think &quot;+25 POINTS&quot; means an option whose strike price is 25 &#xA;points above zinc's current March 2013 futures price (not zinc's current spot price). In other words, an option that's 25 points out of the money (I'm assuming these are calls). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quoting option prices this way is much more stable. The price of an &#xA;option on X with a fixed strike price varies as X's price &#xA;varies. However, the price of an option with strike price X+25 is &#xA;relatively stable (since X+25 itself varies with X). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, option volatility follows a &quot;V&quot; pattern when plotted &#xA;against strike price (the &quot;volatility smile&quot;), with the lowest &#xA;volatility when the strike price is equal to the current &#xA;price. Therefore, you only need 4 volatilitys (2 on each side of the &#xA;current price) to obtain the volatility-vs-strike-price graph. I'm not &#xA;sure why they give you 5 (and why the 5th one isn't zero delta). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be absolutely pedantic, Black-Scholes looks at Log[strikeprice/currentprice], not strikeprice minus currentprice. However, if the &#xA;strike is close to the current price, these two numbers are &#xA;nearly equal. &lt;/p&gt;&#xA;" OwnerDisplayName="user59" LastEditorDisplayName="user59" LastEditDate="2011-02-10T02:09:46.320" LastActivityDate="2011-02-10T02:09:46.320" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="377" PostTypeId="2" ParentId="332" CreationDate="2011-02-10T02:57:01.067" Score="11" Body="&lt;p&gt;Just FYI the Reuters product is called NewsScope.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The selling point is that they provide a sentiment reading per news item so the user doesn't have to do any NLP.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have a Reuters sales rep or contact them then they can get you several research/white papers that are interesting. Here are the ones I have been able to find online (my sales rep has provided me with better ones but I didn't save them):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1558434&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1558434&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using their Event Indices product:&#xA;&lt;a href=&quot;http://puppetmastertrading.com/images/Reuters_NewsScope_Event_Indices_Whitepaper.pdf&quot;&gt;http://puppetmastertrading.com/images/Reuters_NewsScope_Event_Indices_Whitepaper.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="241" LastActivityDate="2011-02-10T02:57:01.067" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="378" PostTypeId="2" ParentId="80" CreationDate="2011-02-10T02:58:54.407" Score="7" Body="&lt;p&gt;Arbitrage absolutely does not prevent a derivative (option, future, or otherwise) driving the price of the underlying.  In fact, arbitrage, or the elimination of it, is what causes the &quot;tail wagging the dog&quot; phenomenon of large trades in the derivative causing wild swings in the underlying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;see the may 2010 flash crash that started with some large e-mini futures trades.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://chicagobreakingbusiness.com/2010/10/may-6-flash-crash-triggered-by-e-mini-trades.html&quot;&gt;http://chicagobreakingbusiness.com/2010/10/may-6-flash-crash-triggered-by-e-mini-trades.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-02-10T02:58:54.407" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="379" PostTypeId="1" AcceptedAnswerId="386" CreationDate="2011-02-10T03:08:13.867" Score="10" ViewCount="1039" Body="&lt;p&gt;Given the time series for a particular stock market, what are the statistical weapons one can bring on to prove, or disprove that random walk hypothesis?&lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2011-02-10T05:39:57.110" Title="Proving Random Walk Hypothesis in Stock Market" Tags="&lt;random-walk&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="380" PostTypeId="2" ParentId="379" CreationDate="2011-02-10T03:20:54.730" Score="5" Body="&lt;p&gt;The first chapter of the book &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0691043019&quot;&gt;Econometrics of Financial Markets&lt;/a&gt; by Campbell, Lo and MacKinlay discusses this very well.&lt;/p&gt;&#xA;" OwnerUserId="69" LastActivityDate="2011-02-10T03:20:54.730" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="381" PostTypeId="2" ParentId="284" CreationDate="2011-02-10T03:21:43.413" Score="6" Body="&lt;p&gt;The slippage is going to largely depend on the benchmark used and vary wildly depending on what kind of order working is being done (all day vwaps, pair orders working for a few minutes at a time)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given that in my experience I've seen strategies that turn over infrequently with long running volume driven orders (hours, pov/vwap) using vwap as benchmark give up 20-30% in annual returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand I've seen strategies that turn over frequently and have short hold times have no slippage relative to the benchmark used (derived from tick/order book data).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But that is anecdotal, going to be hard to find good numbers since it requires disclosure of information that most want to keep private.&lt;/p&gt;&#xA;" OwnerUserId="241" LastActivityDate="2011-02-10T03:21:43.413" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="382" PostTypeId="2" ParentId="375" CreationDate="2011-02-10T03:26:18.663" Score="7" Body="&lt;p&gt;What you are seeing is the Nasdaq Ticker Symbol conventions for CQS securities. You can essentially translate them at the below link:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.nasdaqtrader.com/Trader.aspx?id=CQSSymbolConvention&quot; rel=&quot;nofollow&quot;&gt;http://www.nasdaqtrader.com/Trader.aspx?id=CQSSymbolConvention&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="241" LastActivityDate="2011-02-10T03:26:18.663" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="383" PostTypeId="2" ParentId="283" CreationDate="2011-02-10T03:41:55.890" Score="3" Body="&lt;p&gt;To search for &quot;stop-hunting&quot; I would search for stop orders and doing so on ssrn turned up the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=920687&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=920687&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you're looking for something that addresses what's in the body of the question then I'd search for something entirely different. When one knows there is a large cluster of orders in the order book, it means you're looking at limit orders and not stop orders as stop orders are never publicly disclosed. In that case you'd want to search for papers that deal  with the order book, a quick search on ssrn turned up:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=565324&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=565324&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually a strategy that is looking at the order book will have a short time horizon and probably be close to if not hft in which case yes, they have something to do with liquidity provision as normally you're trying to offset imbalances. This paper using a unique data set shows that hft has mean reversion/imbalance offsetting strategies:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1641387&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1641387&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="241" LastActivityDate="2011-02-10T03:41:55.890" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="384" PostTypeId="2" ParentId="282" CreationDate="2011-02-10T03:58:46.130" Score="4" Body="&lt;p&gt;In a sense all quantitative strategies do that because no one expects every instance of a signal to create a positive return. The expectation is that on average it will. Recall that these questions are supposed to be about quantitative finance whereas the first link you have seems to be related to technical analysis.&lt;/p&gt;&#xA;" OwnerUserId="241" LastActivityDate="2011-02-10T03:58:46.130" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="386" PostTypeId="2" ParentId="379" CreationDate="2011-02-10T05:39:57.110" Score="11" Body="&lt;p&gt;Test your historical time series for both randomness and independence.  Understand that a time series may be random and independent; non-random and independent; random with dependencies; and non-random with dependencies.  A mistake would be to limit dependency tests to autocorrelation.  The most general test I know of is called the differential spectrum by Sherry, which works like this:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;histogram the price changes in your&#xA;time series &lt;/li&gt;&#xA;&lt;li&gt;if the price changes are independent,&#xA;they should be symmetric about 0&lt;/li&gt;&#xA;&lt;li&gt;use Pearson's $\chi^2$ test with one &#xA;sign as &quot;observed&quot; and the other as&lt;br&gt;&#xA;&quot;expected&quot; for a quantitative measure&#xA;of symmetry.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;However, when you find something with this test, you've still got to hunt for the dependency.  But at least the test can tell you if you've got a dependencies or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most important point is that whatever tests you work with, that market can change in the future.  So I wouldn't say a market &quot;is&quot; or &quot;isn't&quot; a random walk.  Rather, it may phase in and out of random-walkiness for indeterminate amounts of time. &lt;/p&gt;&#xA;" OwnerUserId="47" LastActivityDate="2011-02-10T05:39:57.110" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="387" PostTypeId="2" ParentId="139" CreationDate="2011-02-10T06:08:01.627" Score="2" Body="&lt;p&gt;One final thought: you want something that depends on volatility, but &#xA;not on price. In other words, if SPX goes up, your VIX replicant &#xA;wouldn't necessarily change at all. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would an SPX option calendar spread behave something like this, since &#xA;option prices change w/ volatility, and short-term options change more &#xA;than long-term options? &lt;/p&gt;&#xA;" OwnerDisplayName="user59" LastActivityDate="2011-02-10T06:08:01.627" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="388" PostTypeId="1" AcceptedAnswerId="1190" CreationDate="2011-02-10T08:01:29.687" Score="8" ViewCount="963" Body="&lt;p&gt;I have asked myself many times about Quantization Numerical Methods, is anyone here familiar with the subject and could give a reasonable insight of what Quantization concepts are about, and what are the underlying principles that make it work ?&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="467" LastEditDate="2014-11-03T01:45:41.393" LastActivityDate="2014-11-03T01:45:41.393" Title="What is Quantization?" Tags="&lt;numerical-methods&gt;&lt;quantization&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="390" PostTypeId="1" CreationDate="2011-02-10T08:15:27.520" Score="12" ViewCount="10218" Body="&lt;p&gt;Let's say you have a logistic regression model. Some of the factors are intrinsically categorical but some are continuous variables. Under which circumstances should a continuous variable be binned into categories?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, logistic regression is widely used in retail credit modeling, and age is an explanatory variable. When is it wise to bin age (e.g., 2-3, 4-10, 11+) and when should you leave it as a continuous variable?&lt;/p&gt;&#xA;" OwnerUserId="40" LastEditorUserId="56" LastEditDate="2011-02-10T14:28:43.420" LastActivityDate="2017-05-04T10:50:51.180" Title="Is variable binning a good thing to do?" Tags="&lt;credit-scoring&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="11" ContentLicense="CC BY-SA 2.5" />
  <row Id="393" PostTypeId="2" ParentId="390" CreationDate="2011-02-10T12:59:48.057" Score="8" Body="&lt;p&gt;According to Frank Harrell's &lt;a href=&quot;http://www.r-project.org/conferences/useR-2010/Invited/harrell_talk.pdf&quot;&gt;useR2010 keynote on &lt;em&gt;Information Allergy&lt;/em&gt;&lt;/a&gt;: Never.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit:&lt;/em&gt; And &lt;a href=&quot;http://biostat.mc.vanderbilt.edu/wiki/Main/CatContinuous&quot;&gt;here is a long list of reasons why one should not &lt;em&gt;categorize continuous variables&lt;/em&gt;&lt;/a&gt;  (which is the same thing, but expressed in more statistical terms).  And for completeness, &lt;a href=&quot;http://www.stat.columbia.edu/~cook/movabletype/archives/2008/01/debate_over_cat.html&quot;&gt;here is Andrew Gelman&lt;/a&gt; debating the issue some more.&lt;/p&gt;&#xA;" OwnerUserId="69" LastEditorUserId="69" LastEditDate="2011-02-10T17:10:56.847" LastActivityDate="2011-02-10T17:10:56.847" CommentCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="394" PostTypeId="2" ParentId="14" CreationDate="2011-02-10T13:42:35.877" Score="3" Body="&lt;p&gt;The question may be motivated by the way closing implied volatilities are reported for LME traded third wednesday prompt metals contracts. Function LMIV on Bloomberg provides vol quotes for 50 delta options and corresponding premiums/discounts for 10, 25 delta puts and calls.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;LME metals futures are really forward contracts with constant maturity forwards being electronically quoted for various terms (e.g. LMCADS03 Comdty for 3 month copper). Most of the liquidity is clustered in the third wednesday prompt contracts for which there are no continuous electronic quotes (at least not on Bloomberg) and which thus are frequently quoted by premium/discount from the nearest forward contract.&lt;/p&gt;&#xA;" OwnerUserId="335" LastActivityDate="2011-02-10T13:42:35.877" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="395" PostTypeId="1" AcceptedAnswerId="398" CreationDate="2011-02-10T15:00:54.967" Score="19" ViewCount="2493" Body="&lt;p&gt;A fairly naive approach to estimate the probability of drawdown / ruin is to calculate the probabilities of all the permutations of your sample returns, keeping track of those that hit your drawdown / ruin level (as I've &lt;a href=&quot;http://blog.fosstrading.com/2010/06/estimating-probability-of-drawdown.html&quot;&gt;written about&lt;/a&gt;).  However, that assumes returns are independently distributed, which is unlikely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In response to my blog post, &lt;a href=&quot;http://braverock.com/brian/&quot;&gt;Brian Peterson&lt;/a&gt; suggested a &lt;a href=&quot;http://en.wikipedia.org/wiki/Bootstrapping_%28statistics%29#Moving_block_bootstrap&quot;&gt;block bootstrap&lt;/a&gt; to attempt to preserve any dependence that may exist. (Extra credit: is there a method / heuristic to choose the optimal block size?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What other methods are there?&lt;/p&gt;&#xA;" OwnerUserId="56" LastActivityDate="2011-02-21T15:54:09.630" Title="How to estimate the probability of drawdown / ruin?" Tags="&lt;estimation&gt;&lt;probability&gt;&lt;drawdown&gt;" AnswerCount="5" CommentCount="1" FavoriteCount="15" ContentLicense="CC BY-SA 2.5" />
  <row Id="396" PostTypeId="2" ParentId="395" CreationDate="2011-02-10T15:54:36.970" Score="7" Body="&lt;p&gt;A block bootstrap makes sense to me.  (If the term doesn't make sense to you, I explain it at the end.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to pick the block size, I would essentially do a grid search:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;pick the largest feasible block size&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;pick a smallest reasonable block size&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;pick how many block sizes you feel like testing&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'd run the selected bootstraps and see if there was a pattern, and if so, what might it mean.  Once that was done, then hopefully you could feel comfortable with just one block size for subsequent use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would think that the best block size would be strategy dependent.  But of course I could be wrong.  I haven't done this in practice -- I'd be interested to hear of real experiences.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is a block bootstrap?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose you have N observations.  A regular bootstrap repeatedly samples the N observations N times with replacement and performs the statistic on each resampled set of data.  The two key things are that the sample size remains the same and the sampling is done independently.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The regular bootstrap is good for when the data are independent.  But if there is autocorrelation in the data, then the regular bootstrap completely destroys that.  In the case of drawdown, autocorrelation is of significant interest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The block bootstrap keeps a lot of the autocorrelation of the original data by taking continuous blocks of data instead of individual datapoints.  For example if we had 1000 (ordered) observations, then we could sample 10 blocks of length 100, or 100 blocks of length 10, or 50 blocks of length 20, ...&lt;/p&gt;&#xA;" OwnerUserId="249" LastActivityDate="2011-02-10T15:54:36.970" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="397" PostTypeId="2" ParentId="395" CreationDate="2011-02-10T15:54:54.647" Score="4" Body="&lt;p&gt;You could try measuring autocorrelation at varying lags, as described &lt;a href=&quot;http://www.breakoutfutures.com/Newsletters/Newsletter1110.htm&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;, and then choose your optimal block size according to the results of this test, i.e. if there is significant autocorrelation up to and including lag 5, your block size should be no larger than 5. &lt;/p&gt;&#xA;" OwnerUserId="252" LastActivityDate="2011-02-10T15:54:54.647" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="398" PostTypeId="2" ParentId="395" CreationDate="2011-02-10T16:25:51.683" Score="11" Body="&lt;p&gt;I highly recommend the Maximum Entropy Bootstrap for time series, implemented by the &lt;a href=&quot;http://cran.r-project.org/web/packages/meboot/index.html&quot;&gt;meboot&lt;/a&gt; package in R. In my work, I've stopped using both the block bootstrap and residuals bootstrap in favor of meboot, and I am pleased with the results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hrishikesh Vinod, the researcher behind meboot, described it in his talk at UseR/2010 last year. The algorithm is quite clever and preserves the correlation structure of the original time series while creating bootstrap replications consistent with that structure. The algorithm is outlined in the package documentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The package does the heavy lifting for you, creating all the bootstrap replications of your time series. It does not take the final step of calculating the estimated confidence intervals based on the replications, unfortunately. Read the vignette for how you can calculate the CIs from the replications. (In contrast, the boot package supplies the boot.ci function which performs that final step.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A final note: I trust statistical methods to estimate reasonable outcomes based on historical data. I have absolutely no faith they can predict the &lt;em&gt;full&lt;/em&gt; range of possible outcomes, however. Please remember the false sense of security induced by VaR analysis... right up to the great financial meltdown. Now, how will you protect yourself from ruin?&lt;/p&gt;&#xA;" OwnerUserId="37" LastActivityDate="2011-02-10T16:25:51.683" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="399" PostTypeId="1" AcceptedAnswerId="417" CreationDate="2011-02-10T16:30:52.060" Score="8" ViewCount="2414" Body="&lt;p&gt;I came across an example where a well-known weakness of a credit risk model was dealt with by augmenting some of the existing risk factors via increased factor loadings.  This made the the model more conservative in terms of the required economic capital it recommended.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What does that mean? Is it a matter of increasing the estimated coefficients by some arbitrary percentage or is there more to it?&lt;/p&gt;&#xA;" OwnerUserId="40" LastEditorUserId="1106" LastEditDate="2011-12-14T03:11:21.457" LastActivityDate="2014-06-04T17:26:04.643" Title="What does it mean to modify the factor loadings of a credit risk model?" Tags="&lt;risk&gt;&lt;risk-models&gt;&lt;factor-loading&gt;" AnswerCount="4" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="401" PostTypeId="2" ParentId="395" CreationDate="2011-02-10T16:55:02.363" Score="2" Body="&lt;p&gt;I like the function b.star in the np package for R to select the block size and pass it to tsboot although I don't have the math background to determine whether this is the best method.&lt;/p&gt;&#xA;" OwnerUserId="232" LastActivityDate="2011-02-10T16:55:02.363" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="402" PostTypeId="1" AcceptedAnswerId="404" CreationDate="2011-02-10T16:56:19.990" Score="5" ViewCount="2392" Body="&lt;p&gt;I have been thinking a lot about the following puzzle. But, could not arrive at a solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone explain me how can you get a fair (equal probability) outcome using only an unfair coin (where unfair means that it will land head with probability p and tails 1-p where p != .5)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="342" LastActivityDate="2011-02-10T18:39:01.507" Title="Probability - Generating fair outcome using unfair coin" Tags="&lt;probability&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="403" PostTypeId="2" ParentId="235" CreationDate="2011-02-10T17:34:02.747" Score="11" Body="&lt;p&gt;There is a simple solution if there is no drift, as the probability $p(x,t)$ obeys a simple diffusion equation: $\mathrm{d}(p)/\mathrm{d}t = \frac{1}{2} \sigma^2 \frac{\mathrm{d}(\mathrm{d}(p))}{\mathrm{d}x^2}$, here $x$ is the price difference $\text{price}(t) - \text{price}(t=0)$.  Of course there is a simple solution to the diffusion equation (using scaling as a method to solve the PDE):&lt;br&gt;&#xA;$$&#xD;&#xA;p(x,t) = (4\pi \frac{\sigma^2}{2}  t)^{-\frac{1}{2}} \text{e}^{(-x^2/(4 \frac{\sigma^2}{2} t) )}&#xD;&#xA;$$&#xA; to find the probability of hiting a barrier $x$ on or before $T$ simply ( :} ) integrate,&#xA;$$&#xA;\text{prob of hitting ($t \le T$)} = \int\limits_{t=0}^{T} p(x,t)\mathrm{d}t&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="345" LastEditorUserId="1129" LastEditDate="2011-09-01T04:39:23.460" LastActivityDate="2011-09-01T04:39:23.460" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="404" PostTypeId="2" ParentId="402" CreationDate="2011-02-10T17:37:58.593" Score="7" Body="&lt;p&gt;As long as you are allowed to discard initial unbalanced results (HH or TT) in favor of balanced results (HT or TH), you can get a fair outcome. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://en.wikipedia.org/wiki/Fair_coin&quot;&gt;http://en.wikipedia.org/wiki/Fair_coin&lt;/a&gt; for a detailed explanation.&lt;/p&gt;&#xA;" OwnerUserId="80" LastActivityDate="2011-02-10T17:37:58.593" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="405" PostTypeId="2" ParentId="402" CreationDate="2011-02-10T17:56:00.097" Score="2" Body="&lt;p&gt;You throw the coin twice. When you get heads-tails you count the toss as heads. If the tosses come up tails-heads you count it as tails. You ignore the throws that come up twice the same side. With this method you remove the bias.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This method is also called a von neumann corrector.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-02-10T17:56:00.097" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="406" PostTypeId="1" CreationDate="2011-02-10T18:04:19.070" Score="20" ViewCount="1007" Body="&lt;p&gt;When returns are auto-correlated, calculating a Sharpe ratio := $\frac {mean(x)}{\sqrt{var(x)}}$, (where $x$ are the returns) is complicated, but basically solved (see, e.g. &lt;a href=&quot;http://www.edge-fund.com/Lo02.pdf&quot; rel=&quot;noreferrer&quot;&gt;Lo (2005)&lt;/a&gt;). Without the correction, the Sharpe ratio is too large, b/c auto-correlation reduces the variance of the returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However calculating the Calmar ratio := $\frac{mean(x)}{Maxdrawdown(x)}$ with auto-correlated returns gives too small an answer b/c $Mdd(x)$ is too large.  How do you correct Mdd(x) for auto-correlation?  The answer must be quite novel, because unlike the Sharpe ratio case (where $var(x)$ is a linear statistic), $Mdd(x)$ is not a linear statistic, so the delta method cannot be employed.&lt;/p&gt;&#xA;" OwnerUserId="345" LastEditorUserId="1106" LastEditDate="2011-09-25T21:08:54.360" LastActivityDate="2011-09-25T21:08:54.360" Title="How do you correct Max Draw-Down for auto-correlation?" Tags="&lt;statistics&gt;&lt;returns&gt;&lt;auto-correlation&gt;&lt;performance&gt;&lt;sharpe-ratio&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="407" PostTypeId="1" AcceptedAnswerId="408" CreationDate="2011-02-10T18:13:47.960" Score="14" ViewCount="634" Body="&lt;p&gt;A real track record is better than backtesting! I am looking for &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;products, funds, certificates, indices etc.&lt;/strong&gt; that are based on&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;quantitative trading strategies&lt;/strong&gt; where the&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;strategies and performance data are completely transparent and reproducible&lt;/strong&gt; (apart perhaps from trading costs).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The markets and locations are not important as long as the above mentioned criteria are met. The track record could be negative or positive (from both we learn). The underlyings could also be all kinds of asset classes (linear or non-linear products).&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-02-11T10:03:09.663" Title="Transparent quant products with real track record" Tags="&lt;option-strategies&gt;&lt;quant-trading-strategies&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="10" ContentLicense="CC BY-SA 2.5" />
  <row Id="408" PostTypeId="2" ParentId="407" CreationDate="2011-02-10T18:21:31.210" Score="11" Body="&lt;p&gt;There are a large range of products that are now being offered as &quot;alternative beta&quot;.  These try to provide consistent returns in a known systematic bias or strategy, as defined by an index tracking that strategy.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;ETF's can be a very good source of information on transparent quantitative strategies that have a published track record.  See, for example, some of the funds mentioned in &lt;a href=&quot;http://www.tradingmarkets.com/.site/etfs/how_to/articles/-75909.cfm&quot; rel=&quot;nofollow&quot;&gt;&quot;ETFs that Track Quantitative Indexes&quot;&lt;/a&gt; and &lt;a href=&quot;http://seekingalpha.com/article/17904-quasi-index-and-quantitative-model-etfs-it-s-beta-not-alpha&quot; rel=&quot;nofollow&quot;&gt;&quot;Quasi-index and Quantitative Model ETFs: It's Beta, Not Alpha&quot;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="17" LastEditDate="2011-02-10T18:35:01.133" LastActivityDate="2011-02-10T18:35:01.133" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="409" PostTypeId="2" ParentId="402" CreationDate="2011-02-10T18:39:01.507" Score="2" Body="&lt;p&gt;What you are looking for is a Von Neumann Corrector - &lt;a href=&quot;http://everything2.com/title/von+Neumann+corrector&quot; rel=&quot;nofollow&quot;&gt;http://everything2.com/title/von+Neumann+corrector&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="344" LastActivityDate="2011-02-10T18:39:01.507" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="410" PostTypeId="2" ParentId="121" CreationDate="2011-02-10T18:40:20.147" Score="2" Body="&lt;p&gt;In mean-variance portfolio work, the elements of the covariance matrices are highly volatile and infused with error, so how to obtain forecasts that are usable ?  A simple idea is to use a Stein-equal covar shrinkage estimator which, in practice, is easy to calculate and produces superior portfolios when evaluated on out-of-sample data ( see Continuous Time Mean Variance Portfolios, Zhou, 2000) . So to evaluate a proposed covar matrix,:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) calculate the equal covar matrix, covar.eq, where covar.eq[i,i] = covar[i,i]; and covar.eq[i,j] = mean(covar[i,j]); i not = j.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) del = Sum(i,j)[ Abs(covar.eq[i,j]-covar[i,j] )], or if you prefer&#xA;     delsq = sum(i,j)[ (covar.eq[i,j]-covar[i,j])^2 ]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and pick the covar with the smallest del or delsq.  The selected covar matrix will be closest to the stein-shrinkage matrix which (see above ) produces superior portfolio's.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Paul H. Lasky&#xA;  B &amp;amp; P Investments   &lt;/p&gt;&#xA;" OwnerUserId="345" LastActivityDate="2011-02-10T18:40:20.147" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="411" PostTypeId="2" ParentId="27" CreationDate="2011-02-10T19:50:21.653" Score="13" Body="&lt;p&gt;That implied volatility you are observing was calculated using the standard Black-Scholes model (BSM).  As we all know, no model is a perfect representation of reality.  The variation (or &lt;em&gt;skew&lt;/em&gt;) you observe is a consequence of the model being wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's think about the implications of the BSM &lt;strong&gt;not&lt;/strong&gt; being exactly correct and everybody knowing that fact.  Market prices cannot come solely from the model in this case. In particular, an important result is that (since the model is incorrect) even if you were to plug in the &quot;right&quot; value for every parameter, you would not get the market option prices. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any model, including the BSM, can be run &quot;backwards&quot;, by which we mean here that it can start with an option price and derive an &lt;em&gt;implied&lt;/em&gt; parameter.  If the model has $M$ parameters $p_1, p_2, \dots, p_M$ that are normally used to find a price $V$, then we can also choose any one of the parameters, call it $p_n$, to derive from an observed price $W$ (normally by root-finding techniques).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is to say,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;V = f(p_1, p_2, \dots, p_M)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;gets inverted to $g=f^{-1}$ in parameter $n$ to form&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;p_n^{\text{impl}} = g(W, p_1,\dots,p_{n-1},p_{n+1},\dots,p_M).&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It so happens that for the BSM most of the parameters are reasonably easy to observe (strike, interest rate, etc.) while volatility is a rather more mysterious quantity, especially because the BSM needs &lt;em&gt;future&lt;/em&gt; volatility rather than past volatility.  Therefore, the market practitioners tend to pick on that parameter and talk about &lt;em&gt;implied volatility&lt;/em&gt; even though in principle we could do everything in terms of, say, &lt;em&gt;implied dividend yield&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In any case, since the model is wrong, we don't expect to get the exact right option prices when we run the model forward, and therefore don't expect to get one &quot;right&quot; parameter when we run it backward.  That's why you see variation in volatility by option strike.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, as to the exact shape of that variation (decreasing implied volatility with strike), there are quite a few explanations and they are not mutually exclusive.  For example, a somewhat more credible model than the plain old BSM is Black-Scholes With Jumps (BSJ), where the underlying price can take a sudden dive.  You need extra parameters to describe the jumps of course, but the result is a model whose implied volatility skew is &quot;flatter&quot;.  Because those jumps are to the downside, they show up as higher prices(=higher BSM implied volatility) for the low-strike options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other explanations involve transaction costs, discrete stock price processes, bankruptcy, stochastic volatility, market psychology, etc.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2015-12-18T14:11:18.240" LastActivityDate="2015-12-18T14:11:18.240" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="412" PostTypeId="2" ParentId="235" CreationDate="2011-02-10T21:00:24.980" Score="-2" Body="&lt;p&gt;An asymptotic answer is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;p(t &gt; \tau) \sim \mathrm{e}^{(-t/\tau)} \qquad \text{where $\tau = x^2/(\frac{\sigma^2}{2} \pi^2)$};&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, as in much of statistics, asymptotic answers = &quot;In the long-run&quot; are not usually helpful to traders, or even investors.  Example: say initial price $x_0=\$20$, and you wish the probability of reaching say, $x= \$25$ before $x = \$15$ with an annual $\sigma$ of say $0.2$.  Convert $X$ to fractions, $X=(\$25-\$15)/\$15$, and calculate $\tau = 1.126$ years.  That is without some drift and for reasonable values of the volatility, you are going to have to wait a long time.&lt;/p&gt;&#xA;" OwnerUserId="345" LastEditorUserId="1129" LastEditDate="2011-09-01T04:39:32.087" LastActivityDate="2011-09-01T04:39:32.087" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="413" PostTypeId="1" CreationDate="2011-02-10T21:23:20.590" Score="7" ViewCount="895" Body="&lt;p&gt;This is based on a 1995 paper by Rubinstein/Jackwerth by the above title where the authors produces a distribution of stock prices inferred from option prices. But their approach only produces a joint distribution of stock prices and whatever other contributing factors, most prominent being volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: is there another way to make out this distribution which also incorporates the expected changes in volatility based on say vix futures? A reference to paper or code will be helpful. Is the difference not sufficient to agonize over? I am interested in computing VaR, that too at time horizons other than the option expiry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="350" LastActivityDate="2011-02-14T18:11:58.667" Title="on &quot;recovering probability distributions from option prices&quot; - how to subtract influence of stochastic volatility?" Tags="&lt;probability&gt;&lt;stochastic-volatility&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="414" PostTypeId="2" ParentId="257" CreationDate="2011-02-10T21:35:26.190" Score="5" Body="&lt;p&gt;Using the delta-gamma approximation is still significantly faster even if you incorporate all of the nonzero cross-gammas. This speedup comes from the fact that you're using just the delta/gamma/cross-gamma parameters to calculate your VaR instead of 10,000+ Monte Carlo simulations. The calculations of each cross-gamma to the overall VaR, furthermore, can be parallelized across CPU/GPU threads and cores. &lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2011-02-10T21:35:26.190" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="416" PostTypeId="2" ParentId="413" CreationDate="2011-02-10T21:47:17.560" Score="2" Body="&lt;p&gt;It would help if you made your question more clear (or included a link to a copy of the paper). If you know call (or put) option prices for a single stock across all strikes $K$ for common expiry $T$, you can then derive the distribution of the stock price at time $T$ in the $T$-forward measure (in which the numeraire is the zero-coupon bond with maturity $T$, and the price of the put option is $V_K(t) = D(T) E[(K-S(T))^+]$, $D(T)$ being the discount factor to expiry $T$). You can do this by differentiating $V_K(T)$ twice over $K$ and dividing by $D(T)$. This will give you simply the distribution of the stock price in the $T$-forward measure, nothing more and nothing else. In other measures (in particular in the real-world measure) this distribution will be different.&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2011-02-10T21:47:17.560" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="417" PostTypeId="2" ParentId="399" CreationDate="2011-02-10T21:57:42.800" Score="5" Body="&lt;p&gt;&quot;Factor loading&quot; is a somewhat ambiguous phrase -- it could refer to the factors in a linear model (e.g. the beta in CAPM or extended linear stock models), the factors of principal component analysis, etc. If you could provide a reference to the exact example/paper it would be clearer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In credit, however, a likely interpretation is the loadings of different macroeconomic variables and firm-specific risk components within a Cox Framework model. The Cox Framework is a generalized stochastic analysis framework where the &lt;em&gt;default trigger level&lt;/em&gt; of a particular credit/firm is uniformly distributed, and the &lt;em&gt;countdown process&lt;/em&gt; is controlled by a strictly decreasing firm specific function such that the firm defaults once this countdown process falls below the trigger level. Increasing the &quot;loadings&quot; of the risk factors within the countdown process would increase the speed at which the countdown process decreases and therefore cause the firm to default more quickly/frequently in the model. This would be one way of making a Cox-based credit model more conservative. (How much more conservative, and how to build the firm-specific countdown process realistically in the first place can be more art than exact science). For more information, the Cox framework is treated in some detail in several credit textbooks.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2011-02-10T21:57:42.800" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="419" PostTypeId="1" AcceptedAnswerId="438" CreationDate="2011-02-10T23:56:08.747" Score="21" ViewCount="3449" Body="&lt;p&gt;I would like to be able to analyse futures prices as one continuous time series, so what kinds of methods exist for combining the prices for the various delivery dates into a single time series?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am assuming you would just use the front date for most of the time, and then combine this into some kind of weighted combination of the front and second month to simulate the roll.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A quick Google search has shown that there seems to be a number of methods for doing this. Are any considered standard?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of my ultimate goal, I would like a single time series of prices (I can live with just using closing prices rather then OHLC data) so that I can estimate historical volatilities in the prices.&lt;/p&gt;&#xA;" OwnerUserId="61" LastActivityDate="2011-07-07T08:15:22.643" Title="Is there a standard method for getting a continuous time series from futures data?" Tags="&lt;futures&gt;&lt;time-series&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="7" ContentLicense="CC BY-SA 2.5" />
  <row Id="420" PostTypeId="2" ParentId="310" CreationDate="2011-02-11T00:03:56.647" Score="9" Body="&lt;p&gt;HFT can be loosely defined as any strategy where your profitability is a function of latency. &lt;/p&gt;&#xA;" OwnerUserId="122" LastActivityDate="2011-02-11T00:03:56.647" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="421" PostTypeId="2" ParentId="310" CreationDate="2011-02-11T02:22:12.563" Score="3" Body="&lt;p&gt;At the highest possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The High in HFT refers to the frequency of data, not of trading decisions [which varies quite a bit]. Data is nearly always tic by tic; computers typically synchronized with costly clocks servers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It might have originated from the Fourier transform, and would indirectly point to speed of data once again. HFT then would be a good complement to FFT and DFT :-)&lt;/p&gt;&#xA;" OwnerUserId="350" LastActivityDate="2011-02-11T02:22:12.563" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="422" PostTypeId="1" CreationDate="2011-02-11T03:25:59.827" Score="30" ViewCount="18247" Body="&lt;p&gt;I'm looking to find a free source of tick by tick data (&amp;lt;1sec) for training purposes. It doesn't need to be longer than a day, and I don't care what instrument, or exchange, or time it is. I just want real numbers with a high frequency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is such a data set freely available?&lt;/p&gt;&#xA;" OwnerUserId="107" LastActivityDate="2019-11-19T23:08:53.500" Title="Training set of tick-by-tick data?" Tags="&lt;data&gt;" AnswerCount="10" CommentCount="1" FavoriteCount="28" ContentLicense="CC BY-SA 2.5" />
  <row Id="423" PostTypeId="2" ParentId="422" CreationDate="2011-02-11T03:30:35.203" Score="14" Body="&lt;p&gt;You could try some of tier-2 exchanges which often give data away for free to drum up interest and hence trading volume in their product.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will not get SP500, 10-year note, Crude Oil, Gold, ... futures for free on a tick-by-tick basis simply ... because with per-trade fees down, sales of data are &lt;em&gt;the&lt;/em&gt; main revenue for exchanges as sternly noted in the media coverage of this week's exchange mergers.&lt;/p&gt;&#xA;" OwnerUserId="69" LastActivityDate="2011-02-11T03:30:35.203" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="424" PostTypeId="1" AcceptedAnswerId="443" CreationDate="2011-02-11T06:59:35.773" Score="6" ViewCount="362" Body="&lt;p&gt;I'd like to compare the returns of a portfolio segregated by groups to the returns of those groups in total.  So say for example I have a portfolio with 40% Industrials and 60% Technology, then over the the same period the returns of Industrials and Technology were 5% and 10%, respectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get some idea of the performance of the portfolio?  Or just some ideas on how to measure the performance of a portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="60" LastActivityDate="2015-07-21T07:36:07.647" Title="Comparing Returns on a Sector Basis" Tags="&lt;portfolio&gt;&lt;returns&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="425" PostTypeId="2" ParentId="181" CreationDate="2011-02-11T08:23:30.527" Score="1" Body="&lt;p&gt;I see the meta model as the process you employ to develop a model. The important problem is that the real world changes from continuously in order to maintain your meta model you would need to constantly enhance your middling process to account for those changes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good meta model is theoretical construct&lt;/p&gt;&#xA;" OwnerUserId="40" LastActivityDate="2011-02-11T08:23:30.527" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="427" PostTypeId="2" ParentId="422" CreationDate="2011-02-11T09:52:26.117" Score="13" Body="&lt;p&gt;You have a couple of years of free tick by tick FX data in &lt;a href=&quot;http://www.dukascopy.com/swiss/english/data_feed/historical/&quot;&gt;http://www.dukascopy.com/swiss/english/data_feed/historical/&lt;/a&gt; . The easiest way to get the data is to write scripts to download all the files but if you are only playing around I guess you can get a few of them by hand.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2011-02-11T09:52:26.117" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="428" PostTypeId="1" CreationDate="2011-02-11T10:02:37.993" Score="4" ViewCount="312" Body="&lt;p&gt;Can you implement a condor options trading strategy in a spreadsheet?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you give an example?&lt;/p&gt;&#xA;" OwnerUserId="353" LastActivityDate="2011-02-11T10:02:37.993" Title="Can you implement a condor options trading strategy in a spreadsheet?" Tags="&lt;options&gt;" AnswerCount="0" CommentCount="3" ClosedDate="2011-02-11T13:36:24.370" ContentLicense="CC BY-SA 2.5" />
  <row Id="429" PostTypeId="2" ParentId="407" CreationDate="2011-02-11T10:03:09.663" Score="7" Body="&lt;p&gt;Root around in &lt;a href=&quot;http://etfdb.com/etfdb-categories/&quot; rel=&quot;nofollow&quot;&gt;ETFdb Categories&lt;/a&gt;, particulary in &lt;a href=&quot;http://etfdb.com/etfdb-category/quantitative-methodology-indexes/&quot; rel=&quot;nofollow&quot;&gt;Quantitative Methodology ETFs&lt;/a&gt;, Hedge Fund ETFs, and Long-Short ETFs. Not all of the ETFs listed are completely transparent and completely quantitative but ETFdb is a good start.&lt;/p&gt;&#xA;" OwnerUserId="352" LastActivityDate="2011-02-11T10:03:09.663" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="430" PostTypeId="1" AcceptedAnswerId="439" CreationDate="2011-02-11T10:05:09.283" Score="14" ViewCount="1832" Body="&lt;p&gt;Is there a general (or specialised) FREE library to solve learning problems such that found in the book &quot;The Elements of statistical Learning&quot;. As it is often time consuming to write all the algorithms for statistical learning, I would like to know what (free) libraries are used in quantitative finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm thinking about libraries for languages that are not intended for numerical calculus. So R or Matlab libraries would not fit in the scope of this question. C/C++/C# or Java libraries are welcome.    &lt;/p&gt;&#xA;" OwnerUserId="155" LastEditorUserId="1355" LastEditDate="2011-09-08T13:39:00.487" LastActivityDate="2016-12-22T08:14:17.990" Title="Statistical learning libraries" Tags="&lt;machine-learning&gt;&lt;programming&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="16" ContentLicense="CC BY-SA 3.0" />
  <row Id="431" PostTypeId="1" CreationDate="2011-02-11T10:09:15.353" Score="101" ViewCount="19363" Body="&lt;p&gt;What are your favourite video lectures, presentations and talks available online?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few rules:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Must be related to &lt;em&gt;quantitative finance&lt;/em&gt;. No Economics 101 courses, please.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Try to avoid DIY lectures for wannabe Soros  types (e.g. how to earn millions trading S&amp;amp;P 500 futures). &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;Try to post specific links to freely available stuff. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="70" LastEditorUserId="70" LastEditDate="2012-01-03T13:29:20.937" LastActivityDate="2019-06-22T19:43:25.793" Title="Video lectures and presentations on quantitative finance" Tags="&lt;research&gt;&lt;finance&gt;&lt;education&gt;&lt;big-list&gt;" AnswerCount="17" CommentCount="2" FavoriteCount="165" CommunityOwnedDate="2011-02-11T13:35:42.827" ContentLicense="CC BY-SA 2.5" />
  <row Id="432" PostTypeId="2" ParentId="431" CreationDate="2011-02-11T10:25:55.667" Score="32" Body="&lt;p&gt;Department of Mathematics at University of Minnesota has 4 online lectures on financial mathematics - &lt;a href=&quot;http://www.math.umn.edu/finmath/lectures/&quot;&gt;Lectures on financial mathematics&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Notes on Financial Mathematics &lt;/li&gt;&#xA;&lt;li&gt;The Risk-Neutral World &lt;/li&gt;&#xA;&lt;li&gt;Δ-Hedging &lt;/li&gt;&#xA;&lt;li&gt;The Central Limit Theorem&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;David Harper aka Bionic Turtle has set of small videos on his website about quantitative finance and risk management - &lt;a href=&quot;http://www.bionicturtle.com/how-to/videos/category/risk-frm/&quot;&gt;Bionic Turtle videos&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Salomon Center at NYU Stern School of Business has free to download videos from &lt;em&gt;Derivatives 2009&lt;/em&gt; and &lt;em&gt;Derivatives 2007&lt;/em&gt; conferences with presentations by  J.Hull, P.Carr, E.Derman and others:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://w4.stern.nyu.edu/salomon/deriv.cfm?doc_id=101294&quot;&gt;Derivatives 2009&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://w4.stern.nyu.edu/salomon/salomon.cfm?doc_id=6885&quot;&gt;Derivatives 2007&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="15" LastEditorUserId="15" LastEditDate="2011-02-12T18:31:02.167" LastActivityDate="2011-02-12T18:31:02.167" CommentCount="1" CommunityOwnedDate="2011-03-10T21:18:29.467" ContentLicense="CC BY-SA 2.5" />
  <row Id="433" PostTypeId="2" ParentId="431" CreationDate="2011-02-11T11:34:07.860" Score="11" Body="&lt;p&gt;There is a mathfinance &quot;tube&quot;:&lt;br&gt;&#xA;&lt;a href=&quot;http://www.mathfinance.cn/video/&quot;&gt;http://www.mathfinance.cn/video/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-02-11T11:34:07.860" CommentCount="0" CommunityOwnedDate="2011-03-10T21:19:02.930" ContentLicense="CC BY-SA 2.5" />
  <row Id="434" PostTypeId="1" CreationDate="2011-02-11T11:39:25.043" Score="3" ViewCount="338" Body="&lt;p&gt;First thing i want to do is load data(.csv) into R. The data i am concentrating are the COT reports. Want to load a single column into R and calculate the correlation with the proper instrument. &lt;/p&gt;&#xA;" OwnerUserId="354" LastActivityDate="2011-02-11T11:39:25.043" Title="How to calculate correlations(COT report) in R ?" Tags="&lt;correlation&gt;" AnswerCount="0" CommentCount="2" ClosedDate="2011-02-11T13:36:46.943" ContentLicense="CC BY-SA 2.5" />
  <row Id="435" PostTypeId="2" ParentId="422" CreationDate="2011-02-11T12:38:05.333" Score="7" Body="&lt;p&gt;You can get 1.5 years of dense milisecond tagged forex tick data from here: &lt;a href=&quot;http://www.truefx.com/?page=downloads&quot; rel=&quot;noreferrer&quot;&gt;http://www.truefx.com/?page=downloads&lt;/a&gt; (free account required)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a few problems with it - some missing days and a couple of days with bad data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EUR/USD has an average of 200,000 ticks/day for January 2011.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Dukascopy ticks mentioned in another answer are also good. Another good forex tick data source can be a demo account for FXCM, dbFX or MB Trading. But you need to use the respective APIs to retrieve them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also get free equity market order book data from Trading Physics - &lt;a href=&quot;http://www.tradingphysics.com/Feeds/DownloadHistoricalITCH.aspx&quot; rel=&quot;noreferrer&quot;&gt;http://www.tradingphysics.com/Feeds/DownloadHistoricalITCH.aspx&lt;/a&gt;. A free account is required and you can retrieve a limited number of data files per week.&lt;/p&gt;&#xA;" OwnerUserId="225" LastActivityDate="2011-02-11T12:38:05.333" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="436" PostTypeId="2" ParentId="431" CreationDate="2011-02-11T13:18:33.397" Score="9" Body="&lt;p&gt;Quite a lot of lectures on Wilmott.com: &lt;a href=&quot;http://wilmott.com/av.cfm&quot;&gt;http://wilmott.com/av.cfm&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2011-02-11T13:18:33.397" CommentCount="0" CommunityOwnedDate="2011-03-10T21:19:21.260" ContentLicense="CC BY-SA 2.5" />
  <row Id="437" PostTypeId="2" ParentId="399" CreationDate="2011-02-11T13:22:19.820" Score="1" Body="&lt;p&gt;In many popular copula models a factor driving a certain even (e.g. default) has the form&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$&#xA;Y_i = \sum_k a_{ik} X_k + b_i Z_i&#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\lbrace X_k \rbrace, Z_i$ are independent random factors. Coefficients $a_{ik}$ and $b_i$ are commonly called &quot;factor loadings&quot;.&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2011-02-11T13:22:19.820" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="438" PostTypeId="2" ParentId="419" CreationDate="2011-02-11T13:24:41.503" Score="9" Body="&lt;p&gt;If your intention is to use the resulting continuous contract time series to perform return based calculation as would be the case with a volatility analysis then what you want to use is the ratio-adjustment method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are happy to roll on a single day this is trivially implemented by taking the ratio of next contract settlement price to leading contract settlement price on the roll day, then multiplying all historical leading contract prices by that ratio and repeating the process backwards along the contract history.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will result in a time series that exhibits the returns of an excess return commodity index. Note that benchmark commodity indices roll on a multi-day window, e.g. DJ-UBS or GSCI roll in 20% increments over 5 days.&lt;/p&gt;&#xA;" OwnerUserId="335" LastActivityDate="2011-02-11T13:24:41.503" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="439" PostTypeId="2" ParentId="430" CreationDate="2011-02-11T14:35:23.233" Score="10" Body="&lt;p&gt;If you're looking for Java or C/C++/C#, then you will have a much harder time with this than if you looked at R, Matlab, or Python (with Scipy).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For those other languages, I recommend:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Java: &lt;a href=&quot;http://www.cs.waikato.ac.nz/ml/weka/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Weka&lt;/a&gt; is one of the most complete data mining libraries out there.  Fortunately, it also comes with a very good book -- &lt;a href=&quot;http://www.cs.waikato.ac.nz/ml/weka/book.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;Data Mining: Practical Machine Learning Tools and Techniques&quot;&lt;/a&gt; -- that covers the field of data mining.  They just came out with a new edition.&lt;/li&gt;&#xA;&lt;li&gt;C++: In my experience, the most complete, well-documented library for this is &lt;a href=&quot;http://image.diku.dk/shark/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Shark&lt;/a&gt;.  Just one note there: it currently going through a pretty major revision as they start to use Boost to replace their existing Array library.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In general, I don't know why you wouldn't use R for this.  It's freely available, very complete, has lots of documentation, and can be easily interfaced from Java (&lt;a href=&quot;http://www.rforge.net/rJava/&quot; rel=&quot;nofollow noreferrer&quot;&gt;RJava&lt;/a&gt;) and C++ (&lt;a href=&quot;http://dirk.eddelbuettel.com/code/rcpp.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Rcpp&lt;/a&gt;).  Plus, if you're using &quot;The Elements of Statistical Learning&quot;: that textbook used S-Plus/R to do all their analysis.  And R is the only langauge that I know which includes all of the algorithms from the book (including things like &lt;a href=&quot;http://cran.r-project.org/web/packages/lars/&quot; rel=&quot;nofollow noreferrer&quot;&gt;lars&lt;/a&gt;, which was created by one of the book's authors).  And I am starting to &lt;em&gt;slowly&lt;/em&gt; reproduce most of the key examples from that book in R &lt;a href=&quot;http://www.statalgo.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;on my blog&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="2183" LastEditDate="2016-12-22T08:14:17.990" LastActivityDate="2016-12-22T08:14:17.990" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="440" PostTypeId="2" ParentId="341" CreationDate="2011-02-11T15:24:03.607" Score="8" Body="&lt;p&gt;Often one will find the argument that a random walk of price changes would be a proof of the efficient market hypothesis, but this is (IMO) a logical fallacy: Only because the EMH does imply random walks in the price changes, the finding of random walks does not imply automagically that the EMH is true. &lt;/p&gt;&#xA;" OwnerUserId="357" LastActivityDate="2011-02-11T15:24:03.607" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="441" PostTypeId="1" AcceptedAnswerId="446" CreationDate="2011-02-11T15:28:02.467" Score="7" ViewCount="1901" Body="&lt;p&gt;I am trying to analyze valuation methods for swaptions. Does anyone know of free example data for these OTC-traded securities?&lt;/p&gt;&#xA;" OwnerUserId="357" LastActivityDate="2015-06-03T16:04:03.907" Title="Free data on swap options" Tags="&lt;data&gt;" AnswerCount="5" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="442" PostTypeId="2" ParentId="441" CreationDate="2011-02-11T15:31:02.453" Score="7" Body="&lt;p&gt;I will go out on a limb and say that this doesn't exist, unless you have a good relationship and can get some from your broker.  &lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2011-02-11T15:31:02.453" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="443" PostTypeId="2" ParentId="424" CreationDate="2011-02-11T16:11:58.940" Score="4" Body="&lt;p&gt;Unless I'm missing something, your question simply boils down to arithmetic as you have the portfolio allocation and sector returns explicitly identified:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Portfolio Return = (Sector 1 Allocation) * (Sector 1 Return) + (Sector 2 Allocation) * (Sector 2 Return) + ... + (Sector n Allocation) * (Sector n Return)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where the allocations among n sectors add up to 100%.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2011-02-11T16:11:58.940" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="444" PostTypeId="2" ParentId="38" CreationDate="2011-02-11T16:32:06.883" Score="6" Body="&lt;p&gt;I can't speak for all structured products but valuing a MBS is straight-forward, but not easy.  It's straight-forward because you just need to calculate the net present value of the discounted cash flows.  That said, accurately determining those cash flows is &lt;em&gt;hard&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most difficult cash flows to determine--prepayments and defaults/severity--also have the largest impact on MBS value.  Prepayments are highly dependent on interest rates, so an OAS (&lt;a href=&quot;http://en.wikipedia.org/wiki/Option-adjusted_spread&quot; rel=&quot;nofollow&quot;&gt;option-adjusted spread&lt;/a&gt;) approach is superior to a static assumption.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The valuation is fairly consistent across different MBS, especially for MBS from the GSEs.  A private MBS would likely be more complicated because they don't have the pooling restrictions of the GSEs.  &lt;a href=&quot;http://en.wikipedia.org/wiki/Collateralized_mortgage_obligation&quot; rel=&quot;nofollow&quot;&gt;CMOs&lt;/a&gt; are even more complicated to value because of the tranche structure.&lt;/p&gt;&#xA;" OwnerUserId="56" LastActivityDate="2011-02-11T16:32:06.883" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="445" PostTypeId="2" ParentId="422" CreationDate="2011-02-11T16:41:44.437" Score="3" Body="&lt;p&gt;NYSE has a bunch of sample data on their FTP site: &lt;a href=&quot;ftp://sampledata%3adatacap@ftp2.nyxdata.com/custom/&quot; rel=&quot;nofollow&quot;&gt;ftp://sampledata:datacap@ftp2.nyxdata.com/custom/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For NYSE's data products that I've worked with, the sample set tends to be a day's worth of data for their entire universe.&lt;/p&gt;&#xA;" OwnerUserId="90" LastActivityDate="2011-02-11T16:41:44.437" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="446" PostTypeId="2" ParentId="441" CreationDate="2011-02-11T16:45:06.957" Score="7" Body="&lt;p&gt;I agree with Shane; I seriously doubt you're going to find publicly available swaption data for free.  You might get some sample data with a textbook, or from a published journal article.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you only need &lt;em&gt;one&lt;/em&gt; example, you can find one in the documentation for the &lt;code&gt;BermudanSwaption&lt;/code&gt; function in the &lt;a href=&quot;http://cran.r-project.org/web/packages/RQuantLib/&quot;&gt;RQuantLib&lt;/a&gt; R package.&lt;/p&gt;&#xA;" OwnerUserId="56" LastActivityDate="2011-02-11T16:45:06.957" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="447" PostTypeId="1" AcceptedAnswerId="1160" CreationDate="2011-02-11T17:03:58.373" Score="6" ViewCount="13849" Body="&lt;p&gt;I'm looking for an &lt;strong&gt;options&lt;/strong&gt; broker that provides an execution &lt;strong&gt;API&lt;/strong&gt;.&lt;br&gt;&#xA;I'd like to ideally test on a papertrading version of it before connecting to a real execution engine. I know IB offers that, but they require a funded account with 10K min balance. &#xA;I was hoping for no more than 2-3K.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would appreciate your suggestions&lt;/p&gt;&#xA;" OwnerUserId="358" LastEditorUserId="1355" LastEditDate="2011-09-08T19:22:51.750" LastActivityDate="2013-05-20T11:26:34.087" Title="Option trading API other than Interactive Brokers" Tags="&lt;options&gt;&lt;programming&gt;&lt;interactive-brokers&gt;&lt;trade&gt;&lt;broker&gt;" AnswerCount="6" CommentCount="3" FavoriteCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="448" PostTypeId="2" ParentId="441" CreationDate="2011-02-11T17:04:31.337" Score="0" Body="&lt;p&gt;You can try begging for them, if you're an academician.&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2011-02-11T17:04:31.337" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="449" PostTypeId="2" ParentId="447" CreationDate="2011-02-11T17:20:38.647" Score="0" Body="&lt;p&gt;I don't use them, but &lt;a href=&quot;http://www.thinkorswim.com&quot; rel=&quot;nofollow&quot;&gt;thinkorswim&lt;/a&gt; has a $3,500 account minimum.  They also have an &lt;a href=&quot;http://www.thinkpipes.com/api/&quot; rel=&quot;nofollow&quot;&gt;API&lt;/a&gt; via &lt;a href=&quot;http://www.thinkpipes.com/&quot; rel=&quot;nofollow&quot;&gt;thinkpipes&lt;/a&gt;.  I'm not sure if it costs extra to use the API.&lt;/p&gt;&#xA;" OwnerUserId="56" LastActivityDate="2011-02-11T17:20:38.647" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="450" PostTypeId="1" CreationDate="2011-02-11T18:08:36.227" Score="17" ViewCount="13691" Body="&lt;p&gt;Are there any free data source for historical US equity data? Yahoo finance has daily prices but I'm looking for something more granular and goes back 2 or more years (doesn't have to be close to tick data, hourly is fine).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've looked through &lt;a href=&quot;https://quant.stackexchange.com/questions/141/data-sources-online&quot;&gt;Data sources online&lt;/a&gt;, there isn't much on stock market data.&lt;/p&gt;&#xA;" OwnerUserId="128" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2021-04-08T18:29:00.837" Title="Free intra-day equity data source" Tags="&lt;data&gt;&lt;equities&gt;" AnswerCount="9" CommentCount="0" FavoriteCount="11" ContentLicense="CC BY-SA 2.5" />
  <row Id="451" PostTypeId="2" ParentId="450" CreationDate="2011-02-11T18:42:58.273" Score="5" Body="&lt;p&gt;Open an account with IB, and you can get access to equity, options for free, via their API.&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-02-11T18:42:58.273" CommentCount="9" ContentLicense="CC BY-SA 2.5" />
  <row Id="452" PostTypeId="2" ParentId="441" CreationDate="2011-02-11T18:47:07.270" Score="6" Body="&lt;p&gt;Just for future reference, if you are student or academic, you can request for market data on &lt;a href=&quot;http://www.quantnet.com/forum/&quot; rel=&quot;noreferrer&quot;&gt;http://www.quantnet.com/forum/&lt;/a&gt;.&#xA;Many of our members are Wall Street practitioners and as a policy, they will provide such data to help with your research (hence students/academic only). I have been the conduit for many of such transaction in the past.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will need to be precise about the type of data you need (series, ticker name, timeline, etc). These helpers are not going to waste their time if you have no clue on what data you need.&lt;/p&gt;&#xA;" OwnerUserId="43" LastActivityDate="2011-02-11T18:47:07.270" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="453" PostTypeId="2" ParentId="358" CreationDate="2011-02-11T18:55:24.080" Score="4" Body="&lt;p&gt;I haven't seen a framework for options specifically, however...&#xA;The way I have done this in the past is to essentially setup a timeseries(xts or zoo) for each option(underlying,type,strike,expiry).  Obviously doing this via code is important because it is intensely error prone.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We use a build function to put those into the workspace.&#xA;It is still difficult and brittel to do longer tests that span multiple expiries.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We eventually gave up on R and matlab in favor of a functional programming approach.  This way as we evaluate the code scans a mapped structure, instead of an array.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly this is slower, but really simplifies the programming, and is easily parallized.  It performs reasonably well on a live data feed.  Probably not tractable for HFT ( calcs are in ms, not microseconds).&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-02-11T18:55:24.080" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="454" PostTypeId="2" ParentId="447" CreationDate="2011-02-11T19:08:17.830" Score="1" Body="&lt;p&gt;TradeStation does options, not necessarily through IB.&#xA;&lt;a href=&quot;http://www.tradestation.com/&quot; rel=&quot;nofollow&quot;&gt;http://www.tradestation.com/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-02-11T19:08:17.830" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="455" PostTypeId="1" CreationDate="2011-02-11T21:27:54.637" Score="8" ViewCount="580" Body="&lt;p&gt;What are the most effective techniques for reject inference in the context of retail credit scoring. &lt;a href=&quot;http://analytics.ncsu.edu/sesug/2008/ST-160.pdf&quot;&gt; Parcelling&lt;/a&gt; is something I use frequently... Any other approaches out there?&lt;/p&gt;&#xA;" OwnerUserId="40" LastActivityDate="2011-02-12T15:40:24.327" Title="Reject inference" Tags="&lt;credit-scoring&gt;&lt;reject-inference&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="456" PostTypeId="2" ParentId="455" CreationDate="2011-02-12T00:02:34.433" Score="2" Body="&lt;p&gt;Have you looked at the &lt;a href=&quot;http://www.defaultrisk.eu/img_auth.php/a/a3/%7E2660380.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;bivariate probit model&lt;/a&gt; at all?&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Bivariate probit model with sample&#xA;selection assumes that the&#xA;distribution of the accepted applicant&#xA;population is different from that of&#xA;the rejected applicant population.&#xA;That is, it is assumed that&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$P(default|X, rejected) \neq P(default|X, accepted)$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;for some vector of&#xA;explanatory variables X of the model&#xA;predicting the default of companies.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I addition to that paper, there's an article that highlights different approaches available here: &lt;a href=&quot;http://www.defaultrisk.eu/img_auth.php/2/26/Theoretical_approaches_of_reject_inference.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Theoretical approaches of reject inference&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;It gives overviews of:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Several different parceling methods&lt;/li&gt;&#xA;&lt;li&gt;Fuzzy reclassification&lt;/li&gt;&#xA;&lt;li&gt;Iterative reclassification&lt;/li&gt;&#xA;&lt;li&gt;Three-groups approach&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;among others.&lt;/p&gt;&#xA;" OwnerUserId="117" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2011-02-12T15:40:24.327" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="457" PostTypeId="2" ParentId="424" CreationDate="2011-02-12T00:19:09.367" Score="1" Body="&lt;p&gt;Portfolio's return minus the return of a hypothetical tech and industrials portfolio with market weighting. For example, if the total market cap of the industrial sector is twice that of tech then a two sector portfolio using market relative weights would be 66.67% industrials and 33.33% tech.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are investing in all sectors then it is as trivial as subtracting the market return from your portfolio's return. This, however won't tell you what, if any alpha you've achieved.&lt;/p&gt;&#xA;" OwnerUserId="352" LastActivityDate="2011-02-12T00:19:09.367" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="458" PostTypeId="2" ParentId="447" CreationDate="2011-02-12T00:43:53.697" Score="0" Body="&lt;p&gt;Sterling Trader has an API that can handle options. I have not personally used it but it may be worth checking out. Sterling is mainly used by prop firms or larger independent accounts.&lt;/p&gt;&#xA;" OwnerUserId="341" LastActivityDate="2011-02-12T00:43:53.697" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="460" PostTypeId="2" ParentId="306" CreationDate="2011-02-12T08:19:24.130" Score="7" Body="&lt;p&gt;&lt;strong&gt;C++,&#xA;Java,&#xA;Ocaml&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Very good link for further information:&#xA;&lt;a href=&quot;http://www.selectorweb.com/algorithmic_trading.html&quot;&gt;http://www.selectorweb.com/algorithmic_trading.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="354" LastActivityDate="2011-02-12T08:19:24.130" CommentCount="1" CommunityOwnedDate="2011-02-12T08:19:24.130" ContentLicense="CC BY-SA 2.5" />
  <row Id="461" PostTypeId="1" CreationDate="2011-02-12T09:48:20.777" Score="32" ViewCount="24843" Body="&lt;p&gt;How should I store tick data? For example, if I have an IB trading account, how should I download and store the tick data directly to my computer? Which software should I use?&lt;/p&gt;&#xA;" OwnerUserId="354" LastEditorUserId="1106" LastEditDate="2011-08-07T13:34:16.267" LastActivityDate="2017-06-06T21:31:12.473" Title="How should I store tick data?" Tags="&lt;data&gt;&lt;interactive-brokers&gt;" AnswerCount="9" CommentCount="1" FavoriteCount="41" ContentLicense="CC BY-SA 3.0" />
  <row Id="462" PostTypeId="2" ParentId="141" CreationDate="2011-02-12T09:54:56.123" Score="6" Body="&lt;p&gt;&lt;a href=&quot;http://www.mbtrading.com/developersPriceServer.aspx&quot; rel=&quot;noreferrer&quot;&gt;http://www.mbtrading.com/developersPriceServer.aspx&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;MBT Quote API was designed for third-party software developers and provides access to the following data feeds:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;* NASDAQ Market&#xA;* New York Stock Exchange - NYSE&#xA;* American Stock Exchange - AMEX&#xA;* Toronto Stock Exchange - TSX&#xA;* INET and ARCA ECN books&#xA;* CBOE Options quotes&#xA;* CME Futures Quotes&#xA;* CBOT Futures quotes&#xA;* Foreign Currencies&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Under development.&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="354" LastActivityDate="2011-02-12T09:54:56.123" CommentCount="1" CommunityOwnedDate="2011-02-12T09:54:56.123" ContentLicense="CC BY-SA 2.5" />
  <row Id="463" PostTypeId="1" AcceptedAnswerId="504" CreationDate="2011-02-12T10:50:52.440" Score="9" ViewCount="650" Body="&lt;p&gt;What methods can be used to map the correlation skew of a credit index on a bespoke CDO portfolio?&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2011-02-14T18:17:10.400" Title="Correlation skew mapping" Tags="&lt;structured-credit&gt;&lt;cdo&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="464" PostTypeId="1" AcceptedAnswerId="473" CreationDate="2011-02-12T10:56:08.987" Score="15" ViewCount="2288" Body="&lt;p&gt;Libor Market Model (LMM) models the interest rate market by simulating a set of simply compounded, non-overlapping Libor rates which reset and mature on predefined dates. How do I obtain from them a Libor rate which resets and/or mature between these fixed dates?&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2011-12-20T20:16:39.027" Title="Rate interpolation in Libor Market Model" Tags="&lt;interest-rates&gt;&lt;lmm&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="465" PostTypeId="1" AcceptedAnswerId="488" CreationDate="2011-02-12T10:57:19.830" Score="8" ViewCount="721" Body="&lt;p&gt;How do I model the randomness of recovery rate given default when pricing credit derivatives?&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2011-02-13T20:39:34.113" Title="Stochastic recovery rates" Tags="&lt;credit&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="466" PostTypeId="1" AcceptedAnswerId="3407" CreationDate="2011-02-12T11:06:42.113" Score="8" ViewCount="2048" Body="&lt;p&gt;What is an efficient method of pricing callable range accruals on rate spreads? As an example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A cancellable 30 year swap which pays 6M Libor every 6M multiplied by the number of days the spread of 10-year and 2-year CMS rate is above 0, in exchange for a fixed or floating coupon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using LMM for this is dog slow, and 1 factor models are not enough because of both Libor and swap rates involved.&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2012-05-02T09:03:30.077" Title="Pricing callable range accruals on spreads" Tags="&lt;interest-rates&gt;&lt;exotics&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="467" PostTypeId="2" ParentId="430" CreationDate="2011-02-12T13:18:12.640" Score="7" Body="&lt;p&gt;An interesting pick if you'd like to use Python within the Numpy/Scipy environment is &lt;a href=&quot;http://scikit-learn.sourceforge.net/&quot;&gt;scikits.learn&lt;/a&gt;. And an other viable Java package is &lt;a href=&quot;http://mahout.apache.org/&quot;&gt;Apache's Mahout&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="243" LastActivityDate="2011-02-12T13:18:12.640" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="468" PostTypeId="2" ParentId="461" CreationDate="2011-02-12T16:03:54.603" Score="18" Body="&lt;p&gt;What do you want to do with the tick data later? Run analytics? You can save tick data to a flat file for all the software cares, but that would be really slow to access later.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, you should ideally save the data:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Column-oriented - all elements in a field are stored contiguously for better caching&lt;/li&gt;&#xA;&lt;li&gt;Binary - all elements are ready for immediate use; no lexical casting required&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;There are number of column-oriented databases, though no production quality ones are open-source at the moment. You can try the &lt;a href=&quot;http://kx.com/Developers/software.php&quot;&gt;non-commercial version of q/kdb+&lt;/a&gt; to see what you think of it, though it's a huge learning curve if you aren't used to it already.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something else to think about when storing tick data is the physical medium. Ideally you'll want:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Local storage - fetching across NFS is going to be painful&lt;/li&gt;&#xA;&lt;li&gt;Solid state - fetching from disk is also painful&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-02-12T16:03:54.603" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="469" PostTypeId="2" ParentId="430" CreationDate="2011-02-12T16:55:00.930" Score="8" Body="&lt;p&gt;If you are programming in C#, you may have a look at &lt;a href=&quot;http://www.aforgenet.com/&quot; rel=&quot;noreferrer&quot; title=&quot;AForge.NET&quot;&gt;AForge.NET&lt;/a&gt; and &lt;a href=&quot;http://accord-net.origo.ethz.ch/&quot; rel=&quot;noreferrer&quot; title=&quot;Accord.NET&quot;&gt;Accord.NET&lt;/a&gt; too&lt;/p&gt;&#xA;" OwnerUserId="191" LastActivityDate="2011-02-12T16:55:00.930" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="470" PostTypeId="2" ParentId="430" CreationDate="2011-02-12T17:11:39.603" Score="7" Body="&lt;p&gt;A good resource for open-source statistical learning / machine learning libraries is &lt;a href=&quot;http://www.mloss.org/software&quot;&gt;mloss.org&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="69" LastActivityDate="2011-02-12T17:11:39.603" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="471" PostTypeId="2" ParentId="464" CreationDate="2011-02-12T17:42:18.560" Score="3" Body="&lt;p&gt;You could bootstrap a curve based on the forward rates you get, plus your standard interpolation scheme.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's certainly what you'd do if the rates were presented to you as a set of market quotes for FRAs. It does ignore the evolution of the future forward rates though, so I'd expect it to work best if the intetpolated rate is close to one of your simulated rates.&lt;/p&gt;&#xA;" OwnerUserId="371" LastActivityDate="2011-02-12T17:42:18.560" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="472" PostTypeId="2" ParentId="465" CreationDate="2011-02-12T17:42:55.270" Score="2" Body="&lt;p&gt;CreditMetrics uses monte carlo simulation assuming a beta-distribution fitted to historical recovery rates.  &lt;/p&gt;&#xA;" OwnerUserId="357" LastActivityDate="2011-02-12T17:42:55.270" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="473" PostTypeId="2" ParentId="464" CreationDate="2011-02-12T17:46:49.753" Score="5" Body="&lt;p&gt;The subject is interesting and not so easy if you want to interpolate in an arbitrage-free way, to my knowledge a good paper on the subject is &lt;a href=&quot;http://ideas.repec.org/p/uts/rpaper/71.html&quot;&gt;this one&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="92" LastActivityDate="2011-02-12T17:46:49.753" CommentCount="6" ContentLicense="CC BY-SA 2.5" />
  <row Id="474" PostTypeId="2" ParentId="431" CreationDate="2011-02-12T18:33:30.360" Score="12" Body="&lt;p&gt;I strongly recommend Robert Shiller's &lt;a href=&quot;http://oyc.yale.edu/economics/financial-markets&quot;&gt;&quot;Financial Markets&quot;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2011-02-12T18:33:30.360" CommentCount="1" CommunityOwnedDate="2011-02-12T18:33:30.360" ContentLicense="CC BY-SA 2.5" />
  <row Id="475" PostTypeId="2" ParentId="461" CreationDate="2011-02-12T20:02:29.320" Score="1" Body="&lt;p&gt;If you have an IB account, you can use their API to request market data and save to a flat file. That being said, IB does not offer true tick data, it is filtered and you may want to consider a different data feed if you need true tick data.&lt;/p&gt;&#xA;" OwnerUserId="341" LastActivityDate="2011-02-12T20:02:29.320" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="476" PostTypeId="2" ParentId="461" CreationDate="2011-02-12T23:03:46.633" Score="4" Body="&lt;p&gt;I am using just a filesystem to store raw tick data. I am using protocol buffers to easily allow multiple languages to consume the data. Part of the reason is that I am moving more stuff onto Amazon's EC2 to use their GPU compute instances and storing data in blobs allows for easy integration with S3. I would love a proper column store put right now this has worked well with low development overhead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have also tuned our workloads to get around these constraints. Data is typically worked on for minutes or hours after it is retrieved. We are doing pure algo development and don't have (or need) low latency access in a UI.&lt;/p&gt;&#xA;" OwnerUserId="373" LastActivityDate="2011-02-12T23:03:46.633" CommentCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="477" PostTypeId="2" ParentId="306" CreationDate="2011-02-12T23:17:58.883" Score="13" Body="&lt;p&gt;F# was used at credit suisse and I believe a number of other desks. From people I know at Microsoft the banks told MS to make it a supported language, otherwise it would have stayed a project at Microsoft Research.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have also seen Haskell used for derivatives trading.&lt;/p&gt;&#xA;" OwnerUserId="373" LastActivityDate="2011-02-12T23:17:58.883" CommentCount="3" CommunityOwnedDate="2011-02-12T23:17:58.883" ContentLicense="CC BY-SA 2.5" />
  <row Id="478" PostTypeId="5" CreationDate="2011-02-12T23:21:45.207" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2011-02-12T23:21:45.207" LastActivityDate="2011-02-12T23:21:45.207" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="479" PostTypeId="4" CreationDate="2011-02-12T23:21:45.207" Score="0" Body="The process of using a computer program to place orders to trade securities in financial markets.  Typically, these trades are made in exchange-traded instruments, such as listed equities, options, and futures.  However, automated trading can occur in numerous other products such as bonds and currencies." OwnerUserId="214" LastEditorUserId="1106" LastEditDate="2011-12-14T15:29:39.137" LastActivityDate="2011-12-14T15:29:39.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="480" PostTypeId="5" CreationDate="2011-02-12T23:27:32.830" Score="0" Body="&lt;p&gt;The kelly-criterion is a risk management strategy (or wagering system) developed by J.L. Kelly of Bell Labs.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kelly's formula, as it is also called, provides an optimal risk apportionment system that relies on having 2 calculated probabilities.  Namely, the odds of an event occurring and the edge the investor (gambler) has in the event.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is optimal because it is guaranteed not to bankrupt the investor (gambler), while maximizing the expected return of each event.&lt;/p&gt;&#xA;" OwnerUserId="-1" LastEditorUserId="771" LastEditDate="2013-05-21T04:37:54.570" LastActivityDate="2013-05-21T04:37:54.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="481" PostTypeId="4" CreationDate="2011-02-12T23:27:32.830" Score="0" Body="The kelly-criterion is a risk management strategy (or wagering system) providing an optimal risk apportionment system that relies on having 2 calculated probabilities." OwnerUserId="214" LastEditorUserId="771" LastEditDate="2013-05-21T04:37:54.570" LastActivityDate="2013-05-21T04:37:54.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="482" PostTypeId="1" AcceptedAnswerId="486" CreationDate="2011-02-13T07:20:41.557" Score="8" ViewCount="673" Body="&lt;p&gt;I have been testing a trend following strategy. The results shows massive drawdowns which makes the equity curve very unstable. I just wanted to know what are some ways in which I can reduce the volatility (increase smoothness) of the equity curve? Better exits? Better entries? &lt;/p&gt;&#xA;" OwnerUserId="2318" LastEditorUserId="17" LastEditDate="2011-02-13T15:15:09.797" LastActivityDate="2011-02-14T15:52:35.103" Title="System Development / Optimization" Tags="&lt;trading-systems&gt;&lt;drawdown&gt;&lt;equity-curve&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="483" PostTypeId="1" AcceptedAnswerId="502" CreationDate="2011-02-13T10:01:34.830" Score="12" ViewCount="709" Body="&lt;p&gt;Is a JV model simply Local Vol + Jump Diffusion?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so, it seems logical that an existing JV model be able to be used for valuation of both Vanilla and Exotic options.  Is this true?  Does a Local Vol model not model the smile parameters (Skew and Kurtosis) at all, and hence the use of JVol in equity option calculation?&lt;/p&gt;&#xA;" OwnerUserId="293" LastActivityDate="2011-02-14T15:23:48.797" Title="What are the main differences in Jump Volatility and Local Volatility" Tags="&lt;volatility&gt;&lt;black-scholes&gt;&lt;local-volatility&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="484" PostTypeId="2" ParentId="482" CreationDate="2011-02-13T11:04:13.620" Score="4" Body="&lt;p&gt;Be careful when you optimize the exit parameters (and any other parameter) as you could get better results in backtest that will only be due to over fitting. IF you haven't done that yetn use In and Out sample to verify your improvements. After that you can try to build entry filters. In my experience trend following usually have bigger drawdowns than mean reverting.  &lt;/p&gt;&#xA;" OwnerUserId="155" LastEditorUserId="155" LastEditDate="2011-02-13T13:23:58.230" LastActivityDate="2011-02-13T13:23:58.230" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="486" PostTypeId="2" ParentId="482" CreationDate="2011-02-13T13:05:34.733" Score="5" Body="&lt;p&gt;Another possibility is to analyze the equity curve itself so as to go live with the system when good performance is expected and to either reduce risk or just paper trade when performance is expected to be negative. Are a series of positive returns followed by negative returns (i.e. is there mean reversion)? Does a trend-following &quot;meta-system&quot; and/or a trailing stop loss (on the total account equity) reduce risk or at least make it more tolerable? A couple other ideas might be to try &lt;a href=&quot;http://en.wikipedia.org/wiki/Supervised_learning&quot; rel=&quot;nofollow&quot;&gt;supervised learning&lt;/a&gt; for the drawdown periods or incorporate concepts from &lt;a href=&quot;http://cssanalytics.wordpress.com/2010/06/08/concepts-from-statistical-control-theory/&quot; rel=&quot;nofollow&quot;&gt;control charts&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is some danger that you might just end up multiplying your &lt;a href=&quot;http://en.wikipedia.org/wiki/Model_risk&quot; rel=&quot;nofollow&quot;&gt;model risk&lt;/a&gt; by overlaying a meta-strategy on your original system. Statistically significant changes may be very hard to come by and in the end you might just have to trade smaller size. Good luck. &lt;/p&gt;&#xA;" OwnerUserId="352" LastEditorUserId="352" LastEditDate="2011-02-14T15:52:35.103" LastActivityDate="2011-02-14T15:52:35.103" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="487" PostTypeId="2" ParentId="431" CreationDate="2011-02-13T20:23:57.293" Score="9" Body="&lt;p&gt;A couple of lecture note links, no video or audio, but these are pretty useful nonetheless.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notes from Emmanuel Derman's 2007 Columbia course on the &lt;a href=&quot;http://www.ederman.com/new/docs/laughter.html&quot;&gt;Volatility Smile&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Andrew Lesniewski's 2009 notes on Interest Rate and Credit pricing, on his &lt;a href=&quot;http://lesniewski.us/presentations.html&quot;&gt;Lectures and Presentations&lt;/a&gt; page, there are a few other interesting presentations there as well.&lt;/p&gt;&#xA;" OwnerUserId="371" LastActivityDate="2011-02-13T20:23:57.293" CommentCount="0" CommunityOwnedDate="2011-02-13T20:23:57.293" ContentLicense="CC BY-SA 2.5" />
  <row Id="488" PostTypeId="2" ParentId="465" CreationDate="2011-02-13T20:39:34.113" Score="5" Body="&lt;p&gt;The standard reference is Anderson and Sidenius &lt;a href=&quot;http://www.defaultrisk.com/pa_model_15.htm&quot; rel=&quot;nofollow&quot;&gt;Extensions to the Gaussian Copula: Random recovery and random factor loadings&lt;/a&gt;. Random recovery proved necessary in 2007/2008 when you couldn't calibration standard one factor base correlation models. &lt;a href=&quot;http://www.defaultrisk.com/pp_recov_45.htm&quot; rel=&quot;nofollow&quot;&gt;This paper&lt;/a&gt; discusses this, and might be an easier starting point than the Anderson and Sidenius paper.&lt;/p&gt;&#xA;" OwnerUserId="371" LastActivityDate="2011-02-13T20:39:34.113" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="489" PostTypeId="1" CreationDate="2011-02-13T20:48:11.220" Score="20" ViewCount="32785" Body="&lt;p&gt;If you are interested in determining whether there is a correlation between the Federal Reserve Balance Sheet and PPI, would you calculate the correlation between values (prices) or period-to-period change (returns)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've massaged both data sets to be of equal length and same date range and have labeled them WWW (WRESCRT) and PPP (PPIACO). Passing them into R we get the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; cor(WWW, PPP)&#xA;[1] 0.7879144&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then applying the Delt() function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; PPP.d &amp;lt;- Delt(PPP)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then applying the na.locf() function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;PPP.D &amp;lt;- na.locf(PPP.d, na.rm=TRUE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then passing it through cor() again:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; cor(WWW.D, PPP.D)&#xA;[1] -0.406858&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, bottom line is that it matters. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;NOTE: To view how I created the data view &lt;a href=&quot;http://snipt.org/wmkpo&quot;&gt;http://snipt.org/wmkpo&lt;/a&gt;. Warning: it needs refactoring but good news is that it's only 27 iines. &lt;/p&gt;&#xA;" OwnerUserId="291" LastEditorUserId="291" LastEditDate="2011-02-14T00:39:17.563" LastActivityDate="2018-06-28T13:46:12.330" Title="Correlation between prices or returns?" Tags="&lt;correlation&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="14" ContentLicense="CC BY-SA 2.5" />
  <row Id="490" PostTypeId="2" ParentId="489" CreationDate="2011-02-13T21:44:41.583" Score="14" Body="&lt;p&gt;Short answer, you want to use the correlation of returns, since you're typically interested in the returns on your portfolio, rather than the absolute levels.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, correlations on price series have very strange properties.  If you think about a time series of prices, you could write it out as [P0,P1,P2,...,PN], or &#xA;[P0,P0+R1,P0+R1+R2,...,P0+R1+...+RN], where Ri = Pi-P(i-1).  Written this way you can see that the first return R1, contributes to every entry in the series, whereas the last only contributes to one.  This gives the early values in the correlation of prices more weight than they should have. See the answers in &lt;a href=&quot;http://www.wilmott.com/messageview.cfm?catid=34&amp;amp;threadid=45783&quot;&gt;this thread&lt;/a&gt; for some more details.&lt;/p&gt;&#xA;" OwnerUserId="371" LastActivityDate="2011-02-13T21:44:41.583" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="491" PostTypeId="2" ParentId="489" CreationDate="2011-02-13T22:22:22.957" Score="8" Body="&lt;p&gt;It depends, usually you would want to measure correlation between variables that are both stationary, else you would always be able to measure a correlation in the case of variables developing with a trend, even if they are unrelated. In this case I would guess that you should use first differences. &lt;/p&gt;&#xA;" OwnerUserId="357" LastActivityDate="2011-02-13T22:22:22.957" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="492" PostTypeId="1" AcceptedAnswerId="495" CreationDate="2011-02-13T23:37:11.597" Score="13" ViewCount="2034" Body="&lt;p&gt;I am currently developing a commercial automated trading program in which users can write their own proprietary code and develop strategies, like in NinjaTrader, MetaTrader etc. Right now I am working on the order handling part, which is really important. I can not figure out how to reference the orders entered during the execution of a strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose in a strategy, there is this piece of code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if(some_condition)&#xA;  EnterLong(&quot;IBM&quot;,100)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My problem is &lt;code&gt;some_condition&lt;/code&gt; can be set to true several times, which results in generating several buy orders. Somehow I have to provide the ability for users to modify or cancel some of these orders.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NinjaTrader, for example, has a feature called &lt;code&gt;EntriesPerDirection&lt;/code&gt;, which limits the entry number for a direction (long or short). So you can have a certain number of order objects (or an array of orders) that are returned by order entry functions and say &lt;code&gt;order1.Cancel();&lt;/code&gt; However, this does not make any sense for an iceberging strategy in which thousands of orders could be generated.  Both programs enable the user to iterate over the orders that have not led to a transaction yet. This again could be painful for iceberging purposes. I think those two programs are not specifically built for handling large numbers of orders or for developing execution algorithms (e.g., VWAP, Arrival Price, Implementation Shortfall) which are widely used among buy-side firms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also both NT and MT have events (&lt;code&gt;OnOrderUpdate&lt;/code&gt;, &lt;code&gt;OnExecution&lt;/code&gt;, &lt;code&gt;OnTrade&lt;/code&gt;) that are fired when the status of an order is changed. This is a good idea, but I am not sure it is the best solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any approaches or methodologies addressing my problem that are commonly used by other automated trading software?&lt;/p&gt;&#xA;" OwnerUserId="42" LastEditorUserId="1106" LastEditDate="2011-09-22T14:50:45.260" LastActivityDate="2011-09-22T14:50:45.260" Title="What approaches are there to order handling in automated trading?" Tags="&lt;automated-trading&gt;&lt;software&gt;&lt;programming&gt;&lt;order-handling&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="493" PostTypeId="2" ParentId="461" CreationDate="2011-02-14T00:08:35.867" Score="13" Body="&lt;p&gt;If you're planning on analyzing the data later in R, you should take a look at the &lt;a href=&quot;https://r-forge.r-project.org/R/?group_id=648&quot; rel=&quot;nofollow noreferrer&quot;&gt;indexing and mmap packages&lt;/a&gt;.  Though, as &lt;a href=&quot;https://quant.stackexchange.com/users/35/chrisaycock&quot;&gt;@chrisaycock&lt;/a&gt; said, you'll need to save the data in a column-oriented, binary format.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're downloading the IB data with R, using &lt;a href=&quot;http://cran.r-project.org/web/packages/IBrokers/&quot; rel=&quot;nofollow noreferrer&quot;&gt;IBrokers&lt;/a&gt;, you can write your own eWrapper to store the data in whatever format you want.&lt;/p&gt;&#xA;" OwnerUserId="56" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2011-02-14T00:08:35.867" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="494" PostTypeId="2" ParentId="492" CreationDate="2011-02-14T00:52:32.200" Score="4" Body="&lt;p&gt;What I've done in the past is create an OnOrderSubmit event/method that fires when an order is placed. Use set a semaphore in that method so that your tick/analytical method ignores order placement instructions until an execution occurs or a timer expires.  Then flip the semaphore.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(If you're using multiple threads you want to make sure to serialize access to each thread by symbol.)&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-02-14T00:52:32.200" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="495" PostTypeId="2" ParentId="492" CreationDate="2011-02-14T01:35:32.223" Score="11" Body="&lt;p&gt;Regarding your order management issue, every order should have a unique identifier that the user can reference; in FIX, this is the ClOrdID. The parameters of every order the user requests should be stored in a table keyed by this identifier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your goal is to prevent duplicate orders from going out, consider having a &lt;em&gt;trade volume limit&lt;/em&gt; per each symbol. That way, subsequent order requests will be rejected by your order manager even if the condition has passed. A trade volume limit is also desirable to prevent moving the market (especially when coupled with a &lt;em&gt;position limit&lt;/em&gt;) and can act as a safety mechanism if things get out of hand (we call this the &lt;em&gt;blowout preventer&lt;/em&gt; at my current firm).&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;... both NT and MT have events (OnOrderUpdate, OnExecution, OnTrade) that are fired when the status of an order is changed. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Event-driven programming makes real-time trading much more manageable. This paradigm is known as &quot;complex event processing&quot; and is quite common in institutional trading.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I think those two programs are not spesifically built for handling large number of orders ...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That's because they were designed for day traders who want to pretend they're quants. No institutional trader would ever use those software packages.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-02-14T01:35:32.223" CommentCount="6" ContentLicense="CC BY-SA 2.5" />
  <row Id="496" PostTypeId="2" ParentId="306" CreationDate="2011-02-14T02:37:26.717" Score="3" Body="&lt;p&gt;I've seen the following languages in use:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;C++&lt;/li&gt;&#xA;&lt;li&gt;C#&lt;/li&gt;&#xA;&lt;li&gt;Excel (VBA)&lt;/li&gt;&#xA;&lt;li&gt;F#&lt;/li&gt;&#xA;&lt;li&gt;Q&lt;/li&gt;&#xA;&lt;li&gt;MatLab&lt;/li&gt;&#xA;&lt;li&gt;R&lt;/li&gt;&#xA;&lt;li&gt;Python&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="141" LastEditorUserId="2312" LastEditDate="2012-04-23T13:37:09.840" LastActivityDate="2012-04-23T13:37:09.840" CommentCount="1" CommunityOwnedDate="2011-02-14T02:37:26.717" ContentLicense="CC BY-SA 3.0" />
  <row Id="497" PostTypeId="2" ParentId="461" CreationDate="2011-02-14T03:42:15.450" Score="25" Body="&lt;p&gt;Using IBrokers from R is going to be the easiest route.  A quick example of capturing data to disk would be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(IBrokers)&#xA;tws &amp;lt;- twsConnect()&#xA;aapl.csv &amp;lt;- file(&quot;AAPL.csv&quot;, open=&quot;w&quot;)&#xA;&#xA;# run an infinite-loop ( &amp;lt;C-c&amp;gt; to break )&#xA;reqMktData(tws, twsSTK(&quot;AAPL&quot;), &#xA;           eventWrapper=eWrapper.MktData.CSV(1), &#xA;           file=aapl.csv)&#xA;&#xA;close(aapl.csv)&#xA;close(tws)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will send CSV style output to disk.  Additionally the data can be stored in xts objects within the loop which can be appended to/filled to provide a constant in-memory object to use for analytics.  Objects can be shared with many tools - including using the RBerkeley package on CRAN to share objects with other programs with Berkeley DB bindings.  This latter approach, if managed intelligently is very, very fast.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the symbol limit of IB (100 concurrent more or less) and the 250ms updates - R can typically handle all of this without breaking a sweat (i.e. the JVM running IB's TWS or even IBGateway client is likely to be far surpassing the R/IBrokers process in terms of CPU usage).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can even extend the syntax above to record more than one symbol by passing a list of Contracts, increasing the number on the eWrapper, and making sure you have a suitable list of files to write to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of something closer to long-term storage/access, the packages Josh referred to (mmap and indexing) are also very useful.  I've given talks with some basic options data examples that are 3-4GB in size without derived columns (12GB total), and I can pull using R-style subsetting syntax any subset I need nearly instantly.  e.g. finding 90k+ contracts for AAPL in 2009 (out of 70MM rows) took tens of milliseconds.  All without keeping anything in RAM, and all running on a laptop with 2GB of RAM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll likely get some more presentation material for the latter packages put together soon, and will be giving some talk(s) at the upcoming &lt;a href=&quot;http://www.RinFinance.com&quot;&gt;R/Finance&lt;/a&gt; conference in Chicago.  I am also planning on some public workshops through &lt;a href=&quot;http://www.lemnica.com&quot;&gt;lemnica&lt;/a&gt; related to R and IB for 2011.&lt;/p&gt;&#xA;" OwnerUserId="347" LastActivityDate="2011-02-14T03:42:15.450" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="498" PostTypeId="2" ParentId="492" CreationDate="2011-02-14T07:42:41.203" Score="3" Body="&lt;p&gt;Instead of sending orders each time condition is met, try to set &quot;wanted holding&quot; in the trade logic thread. Trade execution will then make sure (issue sufficient number of orders) to achieve your wanted holding.... For example, the first time signal happens, you sent wanted holding to 100 shares the next time it happens you only confirm that you want 100 shares - you do not send the order!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some other class/thread is looking after actual order management... Not trading logic&lt;/p&gt;&#xA;" OwnerUserId="40" LastActivityDate="2011-02-14T07:42:41.203" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="499" PostTypeId="2" ParentId="37" CreationDate="2011-02-14T14:45:47.867" Score="2" Body="&lt;p&gt;Try the OEC API at &lt;a href=&quot;http://www.openecry.com/services/api_highlights.cfm&quot; rel=&quot;nofollow&quot;&gt;http://www.openecry.com/services/api_highlights.cfm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is a free .NET based API for Futures.  Very easy to work with and can give you both current and historical tick data.  Not sure of the frequency, however.&lt;/p&gt;&#xA;" OwnerUserId="386" LastActivityDate="2011-02-14T14:45:47.867" CommentCount="1" CommunityOwnedDate="2011-02-14T14:45:47.867" ContentLicense="CC BY-SA 2.5" />
  <row Id="500" PostTypeId="1" CreationDate="2011-02-14T15:22:50.260" Score="17" ViewCount="7878" Body="&lt;p&gt;How does left tail risk differ from right tail risk? In what context would an analyst use these metrics?&lt;/p&gt;&#xA;" OwnerUserId="389" LastEditorUserId="999" LastEditDate="2011-09-22T20:01:12.840" LastActivityDate="2011-09-22T20:01:12.840" Title="How does left tail risk differ from right tail risk?" Tags="&lt;risk&gt;&lt;probability&gt;&lt;expected-return&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="501" PostTypeId="1" AcceptedAnswerId="507" CreationDate="2011-02-14T15:23:02.757" Score="18" ViewCount="2307" Body="&lt;p&gt;I can't find S&amp;amp;P 500 index (SPX) futures data with Greeks to create delta-hedged portfolios. Do these data exist? I have access to most of the common data sources.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the meantime, I am trying to form so these delta=hedged portfolios &quot;manually&quot;. Unfortunately, I can't find SPX data with maturity, so I use a continuous e-mini S&amp;amp;P 500 future from Datastream and form the delta-neutral portfolio based on guidance from Chapter 14 of Hull.&#xA;\begin{equation}&#xA;    H_{fut} = H_{index} \exp \left( -(R_f - R_{div})T \right)&#xA;\end{equation}&#xA;where $R_{div}$ is the continuous dividend yield on SPX, $R_f$ is the one-month US Treasury bill, and $H$ are the dollar holdings of each asset. Of course this won't work without the right time to maturity. Is there a &quot;correct&quot; time to maturity to use with an e-mini? Or is there a better source for futures data? Thanks!&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-02-14T21:00:22.423" Title="Where to find Greeks for futures to form delta-hedged futures portfolio of S&amp;P 500 index/futures" Tags="&lt;futures&gt;&lt;hedging&gt;&lt;delta-neutral&gt;&lt;index&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="502" PostTypeId="2" ParentId="483" CreationDate="2011-02-14T15:23:48.797" Score="5" Body="&lt;p&gt;Jump volatility is a term sometimes used to describe randomly varying jump sizes in a model with asset value jumps.  So strictly speaking it is merely a parameter in generic jump diffusion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both local volatility models and jump diffusions end up resulting in skew and kurtosis (of  Black-Scholes volatilities).  However, they are complementary in practice, at least with sane parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because jumps tend to &quot;average out&quot; over time, jump-diffusion models have trouble reproducing skew at long tenors.  At the same time, it is difficult for a continuous process to achieve the kinds of skews (or equivalently implied probability distributions) observed at short tenors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, you often see exotics desks combine the two, or at least have both available.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-02-14T15:23:48.797" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="503" PostTypeId="2" ParentId="413" CreationDate="2011-02-14T15:59:25.617" Score="4" Body="&lt;p&gt;You cannot derive the probability distribution you require, because for VaR you need a real-world probability distribution.  From the options prices, it is only possible to obtain a risk-neutral distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if you are willing to assume some kind of parametric relationship between the risk-neutral and real-world distributions, then you might find the options prices useful.  The resulting mathematics for a stochastic volatility model is somewhat tricky, however.  You can find most of it in Jim Gatheral's books.  A sloppy treatment would just take the risk-neutral distribution and shift its mean.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obtaining the approximate risk-neutral distribution is fairly simple.  Let p(S) be the time-T risk-neutral probability density.  Then we see that (TeX notation alert)&#xA;\begin{equation}&#xA; C := Call(T) = B(0,T)  \int_0^\infty Max(0,S-K) p(S) dS &#xA;\end{equation}&#xA;\begin{equation}&#xA; \frac{dC}{dK} = B(0,T)  \int_0^\infty 1[S&gt;=K] (-1) p(S) dS   \qquad\text{[differentiate under integral] }&#xA;\end{equation}&#xA;\begin{equation}&#xA; \frac{dC}{dK} = B(0,T)  \int_K^\infty (-1) p(S) dS &#xA;\end{equation}&#xA;\begin{equation}&#xA; \frac{d^2C}{dK^2} =  B(0,T) p(K) \qquad \text{ [Fundamental thm of calculus]}&#xA;\end{equation}&#xA;Alternatively, you could say that p(S) is the density, and is the derivative of the cumulative distribution function P(S), and write&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA; C := Call(T) = B(0,T)  \int_0^\infty Max(0,S-K) p(S) dS &#xA;\end{equation}&#xA;\begin{equation}&#xA; \frac{dC}{dK} = B(0,T)  \int_0^\infty 1[S&gt;=K] (-1) p(S) dS   \qquad\text{[differentiate under integral] }&#xA;\end{equation}&#xA;\begin{equation}&#xA; \frac{dC}{dK} = B(0,T)  \int_K^\infty (-1) p(S) dS &#xA;\end{equation}&#xA;\begin{equation}&#xA; \frac{dC}{dK} = B(0,T)  (-1) ( P(\infty) - P(K))&#xA;\end{equation}&#xA;\begin{equation}&#xA; \frac{d^2C}{dK^2} =  B(0,T) p(K)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Either way you end up finding the density&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;p(x) = \frac{1}{B(0,T)}  \frac{d^2C(x)}{dx^2}&#xA;\end{equation}&#xA;where $x$ is the strike.  So an approximate density comes from using the actual option prices available to you.   You can spline interpolate, or if you have a regular grid of strikes spaced by dK you can make a histogram of values&#xA;\begin{equation}&#xA;      \frac{ C(K+dK) - 2C(K) +C(K-dK) }{  dK^2}&#xA;\end{equation}&#xA;and divide by the discount factor to find your risk-neutral distribution.  &lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2011-02-14T18:11:58.667" LastActivityDate="2011-02-14T18:11:58.667" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="504" PostTypeId="2" ParentId="463" CreationDate="2011-02-14T16:28:45.533" Score="6" Body="&lt;p&gt;Find the most similar (in terms of credit risk and industry) quoted index tranches you can.  Then map its base correlation skew over to your bespoke portfolio, preserving expected loss (EL) levels.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The basic formula is&#xA;\begin{equation}&#xA;    c_\text{bespoke}(z) =  c_\text{index}\left( z \frac{EL_\text{index}}{EL_\text{bespoke}} \right) &#xA;\end{equation}&#xA;though sometimes a scale factor $f$ is included like this&#xA;\begin{equation}&#xA;    c_\text{bespoke}(z) =  c_\text{index}\left( z \left( \frac{EL_\text{index}}{EL_\text{bespoke}} \right)^f \right) &#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main flaw here is that the dispersion of your portfolio may differ from that of the index.  Try to keep that difference to a minimum.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2011-02-14T18:17:10.400" LastActivityDate="2011-02-14T18:17:10.400" CommentCount="6" ContentLicense="CC BY-SA 2.5" />
  <row Id="505" PostTypeId="2" ParentId="500" CreationDate="2011-02-14T16:57:11.817" Score="5" Body="&lt;p&gt;Tail risk represents the probability that the magnitude of returns on an asset/portfolio will exceed some threshold (usually three standard deviations) on the normal curve. If you visualize a normal curve on standard axes, the tail on the left side corresponds to an extreme low return and the tail on the right side corresponds to an extreme high return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, left vs right is a measurement of (the likelihood of) extreme low or high returns. An analyst might look at these in order to estimate the impact of rare but significant events.&lt;/p&gt;&#xA;" OwnerUserId="80" LastActivityDate="2011-02-14T16:57:11.817" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="506" PostTypeId="2" ParentId="500" CreationDate="2011-02-14T16:58:32.333" Score="7" Body="&lt;p&gt;Here's a partial answer:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;This partly depends on the return characteristics.  One way to look at this is to analyze the &lt;a href=&quot;http://en.wikipedia.org/wiki/Skewness&quot;&gt;skewness&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/Kurtosis&quot;&gt;kurtosis&lt;/a&gt; of the returns.  Most strategies have a negative skewness, which roughly means that they have mostly consistent small positive returns, with the occasional large negative return.  Alternatively, some strategies have &quot;option-like features&quot;, which results in the opposite distribution: positive skewness.  See, for instance &lt;a href=&quot;http://www.romahi.com/yazann/wiki/data/Hedge_Fund_Beta_attach/paper.pdf&quot;&gt;&quot;The Risk in Hedge Fund Strategies&quot;&lt;/a&gt; (Fung, Hsieh 2001).  &lt;/li&gt;&#xA;&lt;li&gt;You might want to look at some of the work done on &lt;a href=&quot;http://en.wikipedia.org/wiki/Post-modern_portfolio_theory&quot;&gt;&quot;post-modern portfolio theory&quot;&lt;/a&gt; (PMPT) which attempted to differentiate between upside and downside risks.  As an example, one simple adjustment based on this would be to use the &lt;a href=&quot;http://en.wikipedia.org/wiki/Sortino_ratio&quot;&gt;Sortino ratio&lt;/a&gt; instead of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Sharpe_ratio&quot;&gt;Sharpe ratio&lt;/a&gt; as a risk/reward metric.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="17" LastEditorUserId="17" LastEditDate="2011-02-14T17:05:20.267" LastActivityDate="2011-02-14T17:05:20.267" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="507" PostTypeId="2" ParentId="501" CreationDate="2011-02-14T17:23:42.937" Score="6" Body="&lt;p&gt;The delta factor you seek is the spot to futures price ratio without having to use all those parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now to answer your actual question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you are getting futures data, you presumably have the tickers.  You can infer the expiration date from the ticker.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Expiration dates are always on the third Friday of the month, and the ticker contains four letters.  The first two letters are always SP.  The next letter is a month code (H=March, M=June, U=Sep, Z=Dec).  The final letter is a year.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example: SPZ2 expires on Friday, Dec 21, 2012.  &quot;Z&quot; tells you December, and &quot;2&quot; tells you 2012.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that you can infer $R_{div}$ from the futures contract price and the interest rates (which won't always be 1 month T-bills). &lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2011-02-14T17:59:14.967" LastActivityDate="2011-02-14T17:59:14.967" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="509" PostTypeId="2" ParentId="329" CreationDate="2011-02-14T19:17:47.617" Score="8" Body="&lt;p&gt;Each shop will differ - there is no widely used, unified framework shared across firms.  Competitive advantages vary across shops, which ultimately reflect the biases/characteristics of the particular shop.  Some will be far more mathematically sophisticated/inclined than others.  Some maintain strong aversion to quantiative techniques such as risk models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regardless, the major shops all have some form of top-down risk management systems.  Some will use Monte Carlo simulations to assess daily VaR.  Some shops will heavily use factor models for risk assessment across positions.  Some will go much further and use factor models for research to vary their level of conviction for a particular trade (e.g., for alpha generation).&lt;/p&gt;&#xA;" OwnerUserId="390" LastActivityDate="2011-02-14T19:17:47.617" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="510" PostTypeId="2" ParentId="501" CreationDate="2011-02-14T21:00:22.423" Score="1" Body="&lt;p&gt;Not sure this helps, but visit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://delayedquotes.cboe.com/new/options/options_chain.html?symbol=SPX&amp;amp;ID_NOTATION=8941848&amp;amp;ID_OSI=10614550&amp;amp;ASSET_CLASS=IND&quot; rel=&quot;nofollow&quot;&gt;http://delayedquotes.cboe.com/new/options/options_chain.html?symbol=SPX&amp;amp;ID_NOTATION=8941848&amp;amp;ID_OSI=10614550&amp;amp;ASSET_CLASS=IND&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and click on any option to see its Greeks.&lt;/p&gt;&#xA;" OwnerDisplayName="user59" LastActivityDate="2011-02-14T21:00:22.423" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="511" PostTypeId="1" AcceptedAnswerId="514" CreationDate="2011-02-14T21:09:09.663" Score="10" ViewCount="709" Body="&lt;p&gt;Aside from Black-Scholes with crazy skews, what major models are used for energy derivatives?  I'm thinking particularly of electricity derivatives, but I'm also interested in natural gas and other volatile contracts(*).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(*): pun intended&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-05-01T21:44:21.090" Title="What are the major models for energy derivatives, particularly electricity derivatives?" Tags="&lt;options&gt;&lt;derivatives&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="512" PostTypeId="1" CreationDate="2011-02-14T21:20:07.487" Score="14" ViewCount="1383" Body="&lt;p&gt;What are the current computational (non-network) bottlenecks now in a quant's workflow? What computational tasks would be revolutionary with a 10-100x improvement in performance using general purpose GPUs?&lt;/p&gt;&#xA;" OwnerUserId="394" LastEditorUserId="2299" LastEditDate="2012-08-08T12:22:54.900" LastActivityDate="2012-08-08T12:22:54.900" Title="What are some computational bottlenecks that quants face?" Tags="&lt;performance&gt;&lt;gpgpu&gt;&lt;hardware&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="3" ClosedDate="2011-02-17T14:12:34.067" ContentLicense="CC BY-SA 2.5" />
  <row Id="513" PostTypeId="2" ParentId="388" CreationDate="2011-02-14T21:30:44.187" Score="9" Body="&lt;p&gt;Centroidal Voronoi methods you mean? i.e. approximating a continous space with discrete points (generators) and for the sake of modeling evaluate the neighborhood around each generator as having the same value?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example. Here is a guy who encodes images with unicode in twitter. He is quantizing in both the spacial and color spaces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/quasimondo/3518306770/in/photostream/&quot;&gt;http://www.flickr.com/photos/quasimondo/3518306770/in/photostream/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a paper I wrote about it in 2001. You can use them to cluster the behavior of time series data. Useful for both portfolio diversification and so you can make fine models for each cluster of time series data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://orion.math.iastate.edu:80/reu/2001/voronoi_paper/voronoi.pdf&quot;&gt;http://orion.math.iastate.edu:80/reu/2001/voronoi_paper/voronoi.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="394" LastActivityDate="2011-02-14T21:30:44.187" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="514" PostTypeId="2" ParentId="511" CreationDate="2011-02-14T21:41:28.053" Score="10" Body="&lt;p&gt;That's a complicated question.   There are many paths.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One path is to build a model of the underlying supply/demand relationships.   For example, the sudden loss of a power supplier (or transmision corridor) shifts the supply curve to the left spiking the price.   The key to the game is data, data, and more data (price, weather/wind, season, power loads, current power generation, stand-by generation, transmission line overload, etc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several books written on the subject.  If you dig around, you'll find everything from over-simplified books, to books that over-kill on a specific area of the business.    Just a quick Google gives:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1904339190&quot;&gt;http://www.amazon.com/Managing-Energy-Price-Risk-Challenges/dp/1904339190&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0974174416&quot;&gt;http://www.amazon.com/Understanding-Todays-Electricity-Business-Shively/dp/0974174416&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My reputation level is too low to post more links.&lt;/p&gt;&#xA;" OwnerUserId="392" LastActivityDate="2011-02-14T21:41:28.053" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="515" PostTypeId="2" ParentId="512" CreationDate="2011-02-15T02:39:37.360" Score="7" Body="&lt;p&gt;Coming from an HPC background myself, I know too well the feeling of owning a hammer and yet having no nail. Your question is about computational bottlenecks that can be relieved with GPGPU, though I'm afraid to admit that there aren't many in finance. For realtime applications, the network is the bottleneck; for historical applications, the memory is the bottleneck. The CPU is rarely saturated in my line of work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, there is one particular area that does appear to be CPU bound: &lt;strong&gt;interpretation&lt;/strong&gt;. Namely, the &lt;em&gt;feed handler&lt;/em&gt; and the &lt;em&gt;FIX parser&lt;/em&gt; both require many small amounts of data to be transformed from one representation to another. FPGA-based feed handlers are starting to become more popular; I haven't seen anything similar for FIX parsers though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;If you could show how to parse a FIX message with a GPU off the wire, then that might be interesting.&lt;/strong&gt; FIXT 1.1 can support InfiniBand, so NVIDIA / Mellanox's GPU Direct set-up would be especially noteworthy, though not required. (There aren't many trading venues supporting FIXT right now anyway, so there's no rush there.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you wanted to generalize your work for all key-value pairs communicated over a network, you might be able to apply some of your findings to parsing HTTP headers in realtime. No doubt many cloud vendors would be pleased to see that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, the reason I advocated FIX parsing instead of feed handling is that most data vendors ship their own proprietary API. Good luck getting Wombat to cooperate with you until you have some results of your own to show.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-02-15T02:39:37.360" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="516" PostTypeId="1" AcceptedAnswerId="528" CreationDate="2011-02-15T06:27:59.480" Score="10" ViewCount="2612" Body="&lt;p&gt;Can anyone explain the process and the calculations needed to select a portfolio of liquid futures assets with the least correlation? Given a set of returns for a series of assets, how do I select the best subset such that I minimize their correlation with each other?&lt;/p&gt;&#xA;" OwnerUserId="2318" LastEditorUserId="1106" LastEditDate="2011-08-21T01:22:43.570" LastActivityDate="2011-08-23T05:02:46.027" Title="How can I select the least correlated portfolio of assets?" Tags="&lt;correlation&gt;&lt;portfolio&gt;&lt;portfolio-selection&gt;" AnswerCount="4" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="517" PostTypeId="2" ParentId="512" CreationDate="2011-02-15T09:20:54.527" Score="2" Body="&lt;p&gt;In exotics options pricing, there are lots of CPU bottlenecks -- for example the calculation of Fast Fourier Transform or Monte Carlo simulation. When I price a range accrual in Libor Market Model, I don't use a lot of data (carefully optimized, everything should fit in a few MB of L2 cache), but I do a lot of calculations. This is where, I think, a GPU may be useful.&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2011-02-15T09:20:54.527" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="519" PostTypeId="1" AcceptedAnswerId="520" CreationDate="2011-02-15T12:12:39.427" Score="15" ViewCount="810" Body="&lt;p&gt;Assuming a naive stochastic process for modelling movements in stock prices we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS = \mu S dt + \sigma S \sqrt{dt}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where S = Stock Price, t = time, mu is a drift constant and sigma is a stochastic process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm currently reading Hull and they consider a simple example where volatility is zero, so the change in the stock price is a simple compounding interest formula with a rate of mu.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{dS}{S} = \mu dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The book states that by, &quot;Integrating between time zero and time T, we get&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_{T} = S_{0} e^{\mu T}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i.e. the standard continuously compounding interest formula. I understand all the formulae but not the steps taken to get from the second to the third. This may be a simple request as my calculus is a bit rusty but can anyone fill in the blanks?&lt;/p&gt;&#xA;" OwnerUserId="403" LastActivityDate="2012-12-12T00:52:04.013" Title="Missing step in stock price movement equations" Tags="&lt;stochastic-calculus&gt;&lt;equities&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="520" PostTypeId="2" ParentId="519" CreationDate="2011-02-15T12:43:56.377" Score="7" Body="&lt;p&gt;This is the separable differential equation for simple continuous compounding!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See this very accessible article for a step-by-step derivation (esp. under continuous compounding):&lt;br&gt;&#xA;&lt;a href=&quot;http://plus.maths.org/content/have-we-caught-your-interest&quot; rel=&quot;nofollow&quot;&gt;http://plus.maths.org/content/have-we-caught-your-interest&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-02-15T12:43:56.377" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="521" PostTypeId="2" ParentId="431" CreationDate="2011-02-15T13:32:22.650" Score="21" Body="&lt;p&gt;This is a great question. I hope there are many valuable contributions.  &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The recent (Jan 27, 28) MIT 150 Symposium, &quot;Economics and Finance: From Theory to Practice to Policy&quot;. &lt;a href=&quot;http://mit150.mit.edu/symposia/economics&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://mit150.mit.edu/symposia/economics-finance.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, the Jan 28 should be of interest (Finance).  I particularly enjoyed Ross.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&quot;Finding Alpha&quot; Videos (based on Falkenstein's Wiley Finance book. &lt;a href=&quot;http://www.efalken.com/video/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.efalken.com/video/index.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I haven't watched any yet, nor read the book - but intend to - so I cannot vouch for quality.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;There are also some nuggets buried in here (J. Simons, A. Lo, etc.): &lt;a href=&quot;http://mitworld.mit.edu/browse/topic/13&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://mitworld.mit.edu/browse/topic/13&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="390" LastEditorUserId="33410" LastEditDate="2019-06-14T21:04:08.633" LastActivityDate="2019-06-14T21:04:08.633" CommentCount="1" CommunityOwnedDate="2011-02-15T13:32:22.650" ContentLicense="CC BY-SA 4.0" />
  <row Id="522" PostTypeId="1" AcceptedAnswerId="525" CreationDate="2011-02-15T14:47:17.550" Score="32" ViewCount="6030" Body="&lt;p&gt;The new kid on the block in finance seems to be random matrix theory. Although RMT as a theory is not so new (about 50 years) and was first used in quantum mechanics it being used in finance is a quite recent phenomenon. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;RMT in itself is a fascinating area of study concerning the eigenvalues of random matrices and finding laws that govern their distribution (a little bit like the central limit theorem for random variables). These laws show up in all kinds of areas (even in such arcane places like the spacings of the zeros of the Riemann-Zeta function in number theory) - and nobody really understands why...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a good first treatment see this non-technical &lt;a href=&quot;http://terrytao.wordpress.com/2010/09/14/a-second-draft-of-a-non-technical-article-on-universality/&quot;&gt;article by Terence Tao&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question:&lt;/strong&gt;&lt;br&gt;&#xA;Do you know (other) accessible intros to Random Matrix Theory - and its application in finance?&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="1800" LastEditDate="2012-01-24T21:10:08.320" LastActivityDate="2014-03-28T08:26:34.943" Title="Random matrix theory (RMT) in finance" Tags="&lt;probability&gt;&lt;mathematics&gt;&lt;random-matrix-theory&gt;" AnswerCount="5" CommentCount="1" FavoriteCount="25" ContentLicense="CC BY-SA 2.5" />
  <row Id="523" PostTypeId="2" ParentId="516" CreationDate="2011-02-15T15:19:04.267" Score="3" Body="&lt;p&gt;I would start by looking at calculating the efficient frontier. which maximizes return given a specified risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the Wikipedia article which specifies how you would do the calculation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Modern_portfolio_theory&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Modern_portfolio_theory&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Ralph Winters&lt;/p&gt;&#xA;" OwnerDisplayName="user410" LastActivityDate="2011-02-15T15:19:04.267" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="524" PostTypeId="1" CreationDate="2011-02-15T17:11:42.897" Score="17" ViewCount="516" Body="&lt;p&gt;While many systems like to treat dividends as a continuous yield when pricing equity options, it works quite poorly for short-dated options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the short run, deterministic dividends are clearly the way to go, since the upcoming dividend is usually known with fairly high precision.  In the medium term, we may start to think of those dividends as being linked to the stock price, but still want to treat them discretely so as to get early exercise dates right.  In the long term, tracking all those discrete dividends becomes a pain and it feels nicest to go back to a yield.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Advanced option pricing frameworks allow for mixtures of these 3 treatments.  What are some good ways of selecting a reasonable mixture of dividend treatments in any given circumstance?   &lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2019-08-09T13:20:52.017" Title="How do you characterize dividends for equity options?" Tags="&lt;options&gt;&lt;equities&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="525" PostTypeId="2" ParentId="522" CreationDate="2011-02-15T17:42:57.977" Score="14" Body="&lt;p&gt;Check out page 55 in &quot;Quantitative Equity Investing: Techniques and Strategies,&quot; Fabozzi et al.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Section is titled &quot;Random Matrix Theory&quot; - very intro.  The context pertains to the estimation of a large covariance matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, see work at Capital Fund Management, filed under:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://arxiv.org/abs/physics/0507111&quot; rel=&quot;nofollow&quot;&gt;Random Matrix and Finance : correlations and portfolio optimisation&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="390" LastEditorUserId="467" LastEditDate="2012-12-13T11:12:47.477" LastActivityDate="2012-12-13T11:12:47.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="526" PostTypeId="1" AcceptedAnswerId="541" CreationDate="2011-02-15T18:46:55.187" Score="18" ViewCount="2278" Body="&lt;p&gt;Assuming a directional strategy (no pairs or spread trades) is there a &quot;standard&quot; method for quantifying mean-reversion? Should auto-correlation, variance ratios, hurst exponent, or some other measure be preferred in all cases, or are there advantages to each given the context?&lt;/p&gt;&#xA;" OwnerUserId="352" LastActivityDate="2011-02-17T18:35:14.073" Title="Is there a standard method for quantifying mean-reversion for use in directional trading?" Tags="&lt;trading&gt;&lt;mean-reversion&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="8" ContentLicense="CC BY-SA 2.5" />
  <row Id="527" PostTypeId="1" CreationDate="2011-02-15T19:09:25.027" Score="12" ViewCount="62259" Body="&lt;p&gt;There are many online sources about common risk factors in investing and trading e.g.  market risk, credit risk, interest rate risk. There are various factor models (Fama-French, Carhart) and risk management methods to mitigate them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are examples of non-financial risk, such as hardware or network connection failure, death/injury of an employee, that quant trading firms face? Are there any decent examples of risk mitigation or contingency planning methods for such risks that are available online?&lt;/p&gt;&#xA;" OwnerUserId="352" LastEditorUserId="1106" LastEditDate="2011-08-21T01:39:35.633" LastActivityDate="2013-01-04T03:06:20.967" Title="What are some examples of non-financial risks and contingency plans?" Tags="&lt;risk&gt;&lt;risk-management&gt;" AnswerCount="4" CommentCount="9" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="528" PostTypeId="2" ParentId="516" CreationDate="2011-02-15T19:32:53.797" Score="5" Body="&lt;p&gt;Since you are asking for low correlation of the assets, I'm guessing that you are really trying to get a low (or minimum) volatility portfolio.  If that is the case, then the steps for one approach are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;estimate the variance matrix of the universe of assets&lt;/li&gt;&#xA;&lt;li&gt;use a portfolio optimizer to select the minimum variance portfolio given your constraints&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This assumes that you don't have preferences in terms of expected returns of some assets over others.  That seems to be implied from your question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You don't indicate the size of your universe.  If it is large, then you'll want to use a factor model or shrinkage model rather than the sample estimate to estimate the variance matrix.&lt;/p&gt;&#xA;" OwnerUserId="249" LastActivityDate="2011-02-15T19:32:53.797" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="529" PostTypeId="1" AcceptedAnswerId="531" CreationDate="2011-02-15T20:27:56.303" Score="24" ViewCount="2724" Body="&lt;p&gt;I would like to find stock pairs that exhibit low correlation. If the correlation between A and B is 0.9 and the correlation between A and C is 0.9 is there a minimum possible correlation for B and C? I'd like to save on search time so if I know that it is mathematically impossible for B and C to have a correlation below some arbitrary level based on A to B and A to C's correlations I obviously wouldn't have to waste time calculating the correlation of B and C.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there such a &quot;law&quot;? If not, what are other methods of decreasing the search time?&lt;/p&gt;&#xA;" OwnerUserId="352" LastEditorUserId="1106" LastEditDate="2011-10-18T21:05:32.860" LastActivityDate="2012-06-07T03:55:20.177" Title="How to quickly estimate a lower bound on correlation for a large number of stocks?" Tags="&lt;time-series&gt;&lt;correlation&gt;&lt;numerical-methods&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="20" ContentLicense="CC BY-SA 3.0" />
  <row Id="530" PostTypeId="1" AcceptedAnswerId="583" CreationDate="2011-02-15T20:46:15.527" Score="35" ViewCount="32458" Body="&lt;p&gt;There is a concept of trading or observing the market with signal processing originally created by &lt;a href=&quot;http://www.mesasoftware.com/&quot;&gt;John Ehler&lt;/a&gt;. He wrote three books about it.&lt;br&gt;&#xA;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0471463078&quot;&gt;Cybernetic Analysis for Stocks and Futures&lt;/a&gt;&lt;br&gt;&#xA;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0471405671&quot;&gt;Rocket Science for Traders&lt;/a&gt;&lt;br&gt;&#xA;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0471151963&quot;&gt;MESA and Trading Market Cycles&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are number of indicators and mathematical models that are widely accepted and used by some trading software (even MetaStock), like MAMA, Hilbert Transform, Fisher Transform (as substitutes of FFT), Homodyne Discriminator, Hilbert Sine Wave, Instant Trendline etc. invented by John Ehler.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But that is it. I have never heard of anybody other than John Ehler studying in this area. Do you think that it is worth learning digital signal processing? After all, each transaction is a signal and bar charts are somewhat filtered form of these signals. Does it make sense?&lt;/p&gt;&#xA;" OwnerUserId="42" LastEditorUserId="42" LastEditDate="2011-02-15T22:58:08.627" LastActivityDate="2017-02-02T19:17:50.603" Title="Digital Signal Processing in Trading" Tags="&lt;trading&gt;&lt;digital-signal-processing&gt;" AnswerCount="8" CommentCount="3" FavoriteCount="49" ContentLicense="CC BY-SA 2.5" />
  <row Id="531" PostTypeId="2" ParentId="529" CreationDate="2011-02-15T20:57:30.387" Score="24" Body="&lt;p&gt;Yes, there is such a rule and it is not too hard to grasp.  Consider the 3-element correlation matrix&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\left(\begin{matrix}&#xD;&#xA; 1 &amp;amp; r &amp;amp; \rho  \\&#xD;&#xA; r &amp;amp; 1 &amp;amp; c \\&#xD;&#xA; \rho  &amp;amp; c &amp;amp; 1&#xD;&#xA;\end{matrix}\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which must be &lt;em&gt;positive semidefinite&lt;/em&gt;.  In simpler terms, that means all its eigenvalues must be nonnegative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming that $\rho$ and $r$ are known positive values, we find that the eigenvalues of this matrix go negative when&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;  c&amp;lt;\rho  r-\sqrt{1-\rho ^2+\rho ^2 r^2-r^2}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore the right hand side of this expression is the lower bound for the AC correlation $c$ that you seek, with $\rho$ being the AB correlation and $r$ being the BC correlation.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2011-10-05T14:29:49.353" LastActivityDate="2011-10-05T14:29:49.353" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="532" PostTypeId="2" ParentId="530" CreationDate="2011-02-15T22:08:07.513" Score="9" Body="&lt;p&gt;Ehler's &lt;a href=&quot;http://www.mesasoftware.com/&quot;&gt;website&lt;/a&gt; has a technical papers section where there are papers available for free download, with code, so you can try things out for yourself. I personally have taken some of his ideas and combined them with other reading, forums etc. on the net and think that applying DSP to trading shows great promise and is definitely worthy investigation. If you are interested, I am blogging about my progress in applying these principles &lt;a href=&quot;http://dekalogblog.blogspot.com/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="252" LastActivityDate="2011-02-15T22:08:07.513" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="533" PostTypeId="2" ParentId="530" CreationDate="2011-02-15T22:10:13.373" Score="6" Body="&lt;p&gt;Cycle analysis and signal processing might be useful for seasonal patterns but without knowing more about the performance of such an approach to trading I would not consider a degree in signal processing for just trading. Would you be happy applying what you learn on standard engineering type problem because that may be what you'll be stuck doing if it doesn't work well enough with trading.&lt;/p&gt;&#xA;" OwnerUserId="416" LastActivityDate="2011-02-15T22:10:13.373" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="534" PostTypeId="2" ParentId="530" CreationDate="2011-02-16T00:40:39.923" Score="14" Body="&lt;p&gt;You need to investigate how to differentiate interpolation methods versus extrapolation methods.  It's easy to build a model that repeats the past (just about any interpolation scheme will do the trick).   The problem is, that model is typically worthless when it comes to extrapolating into the future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you hear/see the word &quot;cycles&quot;, a red flag should be going up.   Dig into the application of &quot;Fourier Integral&quot;, &quot;Fourier Series&quot;, &quot;Fourier Transform&quot;, etc, and you'll find that with enough frequencies you can represent any time series well enough that most retail traders can be convinced that &quot;it works&quot;.  The problem is, it has no predictive power whatsoever.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason Fourier methods are useful in engineering/DSP is because that &quot;signal&quot; (voltage, current, temperature, whatever) typically repeats itself in the circuit/machine where it was generated.   As a result, interpolating then becomes related to extrapolating.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case youre using R, here's some hacky code to try:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; library(gam)&#xA;&#xA; #Generate and plot a 1000 data point time series&#xA; x &amp;lt;- 1:1000&#xA; y &amp;lt;- cumsum(rnorm(1000))&#xA; plot(x, y, type=&quot;l&quot;)&#xA;&#xA; #Fit the first 500 points using a Generalized Additive Model (it'll fit anything)&#xA; #The red line is an example of interpolating&#xA; gam.object &amp;lt;- gam(y[1:500] ~ s(x[1:500]))&#xA; lines(1:500, predict(gam.object, data.frame(x=1:500)), lwd=2, col=&quot;red&quot;)&#xA;&#xA; #Now, predict the future points&#xA; #The blue line is an example of extrapolating (from an interpolation model)&#xA; lines(501:1000, predict(gam.object, data.frame(x=501:1000)), lwd=2, col=&quot;blue&quot;)&#xA;&#xA; #Now, notice the difference in the &quot;fit&quot; of the blue line versus the red line.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/v4gBb.png&quot; alt=&quot;A realization of the simulation and prediction described in the R code above.&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="392" LastEditorUserId="3383" LastEditDate="2013-01-21T18:27:51.310" LastActivityDate="2013-01-21T18:27:51.310" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="535" PostTypeId="2" ParentId="526" CreationDate="2011-02-16T02:48:27.160" Score="2" Body="&lt;p&gt;As usual, no standard method.&#xA;You can maybe test for unit root over a rolling window, but as usual (again) you are going to be lagging. It will all depend on your choice of window and of the persistence of mean reversion in the market you consider.&lt;/p&gt;&#xA;" OwnerUserId="134" LastActivityDate="2011-02-16T02:48:27.160" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="536" PostTypeId="2" ParentId="530" CreationDate="2011-02-16T02:52:27.373" Score="3" Body="&lt;p&gt;Forget all these so called &quot;Technical indicators&quot;. They are crap, especially if you don;t know how to use them. My advice: buy a good wavelet book, and create your own strategy.&lt;/p&gt;&#xA;" OwnerUserId="134" LastActivityDate="2011-02-16T02:52:27.373" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="537" PostTypeId="2" ParentId="527" CreationDate="2011-02-16T16:52:08.100" Score="6" Body="&lt;p&gt;To give an example of a source of risk that isn't one of the ones you mentioned but still broadly on-topic for a Quant Finance site: &lt;a href=&quot;http://en.wikipedia.org/wiki/Operational_risk&quot; rel=&quot;noreferrer&quot;&gt;operational risk&lt;/a&gt; - for which there are many references for contigency plans. This is the domain of the back office. Trades are created (priced and analysed) by quants, executed by traders and approved by preferably at least one other person (called &quot;four eyes approval&quot;) before being officially agreed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is concerned with Trade Administration. A trade goes through several states with different permissions required to move a trade from one state to the next e.g. pending, approved, rejected, confirmed, cancelled, expired, with only certain transitions being allowed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Back office software can ensure that different sets of employees within a bank or other financial instution can only perform certain tasks and enforce limits on trading positions etc. The cost of the added complexity to the system is designed to minimise operational risk and generally prevent &quot;rogue trader&quot; scenarios.&lt;/p&gt;&#xA;" OwnerUserId="403" LastActivityDate="2011-02-16T16:52:08.100" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="538" PostTypeId="2" ParentId="527" CreationDate="2011-02-16T17:18:33.513" Score="3" Body="&lt;p&gt;Data is the lifeblood of a quantitative strategy.  So I would say that the primary operational risks facing quantitative models are related to data.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some places where this can be an issue:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Misinterpreting post-hoc data:  Many economic indicators are revised on a periodic basis, and it's critical to understand what the meaning of the numbers are &lt;em&gt;on a real-time basis&lt;/em&gt;.  Similarly, some exchanges will provide price corrections, and you need to determine whether these would have been applied to your data.  Lastly, some historical price data is &lt;em&gt;indicative&lt;/em&gt; (i.e. not real tick data) because it has been scrubbed or averaged in some way.&lt;/li&gt;&#xA;&lt;li&gt;Data outliers and changes: Data inevitably has problems due to any number of factors, ranging from outliers or errors to re-scalings (and corporate actions).&lt;/li&gt;&#xA;&lt;li&gt;Unexpected infrastructure failures:  No computer system is perfect.  It's critical to understand the likelihood of a down-time, whether related to a data feed or some other aspect of your infrastructure, and either build these assumptions into your model or else mitigate these risks through redundancy and failover.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="17" LastActivityDate="2011-02-16T17:18:33.513" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="539" PostTypeId="1" AcceptedAnswerId="540" CreationDate="2011-02-17T16:07:02.060" Score="13" ViewCount="216" Body="&lt;p&gt;We were talking about merger arb in a class I had last night, and when we got do deal construction it was mentioned that the different ways can be viewed as different options.  For instance a fixed with collar can be a short call, because an upside limit is met, and a long put after the downside limit is met.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are some other areas where different bigger financial transactions can be broken down to easier to value options?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best,&lt;/p&gt;&#xA;" OwnerUserId="60" LastEditorUserId="17" LastEditDate="2011-02-17T18:01:24.863" LastActivityDate="2011-02-17T18:01:24.863" Title="Breaking Transactions Down into Derivatives" Tags="&lt;options&gt;&lt;financial-engineering&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="540" PostTypeId="2" ParentId="539" CreationDate="2011-02-17T17:46:06.483" Score="7" Body="&lt;p&gt;I could be wrong, but this question seems to be about taking one set of cash flows and representing it using a set of derivatives.  There are an almost unlimited number of applications for this kind of approach.  There is an entire field of study dedicated to it: &lt;a href=&quot;http://en.wikipedia.org/wiki/Financial_engineering&quot; rel=&quot;noreferrer&quot;&gt;financial engineering&lt;/a&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A good textbook on the subject is &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0123735742&quot; rel=&quot;noreferrer&quot;&gt;&quot;Principles of Financial Engineering&quot;&lt;/a&gt; (Neftci 2008), which provides a comprehensive yet understandable framework for understanding how structured products are engineered.  It is simplest to consider this in terms of a payoff diagram: when you understand the structure of the object that you're trying to replicate, then you can take various different structures and combine them to match the original.  This is especially common around risky credit and mortgages.  For instance, Neftci provides numerous examples of how one could break down the risks involved in a risky bond by using a CDS and other swaps.  &lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2011-02-17T17:46:06.483" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="541" PostTypeId="2" ParentId="526" CreationDate="2011-02-17T18:35:14.073" Score="10" Body="&lt;p&gt;There is no standard method and many techniques can work well, including simple time series z-scoring.  I'm many cases, I would recommend using the simpler approaches unless the added complexity can be justified.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the challenge with all techniques is the proper calibration, which is very much context sensitive.  The parameter selection needs to be guided by the characteristics of the specific security and investment horizon.  Furthermore, should the parameters themselves be dynamic?  Nearly all processes are driven by non-stationary distributions.  The amount of leverage used may also be an important consideration.&lt;/p&gt;&#xA;" OwnerUserId="390" LastActivityDate="2011-02-17T18:35:14.073" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="542" PostTypeId="1" CreationDate="2011-02-17T18:42:15.343" Score="5" ViewCount="1439" Body="&lt;p&gt;I heard that trading firms employ CEP platforms such as StreamBase, Marketcetera, JBoss Drools, and etc., to implement trading systems. I wonder which one is most popular and the recent trend of related technology.&lt;/p&gt;&#xA;" OwnerUserId="434" LastActivityDate="2011-02-17T18:42:15.343" Title="Which CEP platform is most popular for trading systems?" Tags="&lt;trading&gt;&lt;trading-systems&gt;&lt;order-handling&gt;&lt;order-execution&gt;&lt;cep&gt;" AnswerCount="0" CommentCount="3" ClosedDate="2011-02-19T11:10:48.657" ContentLicense="CC BY-SA 2.5" />
  <row Id="543" PostTypeId="2" ParentId="524" CreationDate="2011-02-17T19:24:56.557" Score="5" Body="&lt;p&gt;Time to expiration is what should guide the choice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A tractable approach is to make the distinction between discrete and yield at the LEAP boundary (or simpler options with expiration more than 1yr into the future).&lt;br&gt;&#xA;When the options are long dated, like LEAPs for example, then the simplicity of the yield approach is usually 'good enough'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It usually makes sense for to ONLY use the the discrete dividend approach for options near expiration.&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-02-17T19:24:56.557" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="544" PostTypeId="2" ParentId="522" CreationDate="2011-02-18T06:38:54.063" Score="18" Body="&lt;p&gt;Google for this paper &quot;Financial applications of random matrix theory: Old laces and new piece&quot; from Marc Potters, Jean-Philippe Bouchaud, and Laurent Laloux.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also check Prof. Gatheral presentation about Random Matrix Theory &lt;a href=&quot;http://www.math.nyu.edu/fellows_fin_math/gatheral/RandomMatrixCovariance2008.pdf&quot;&gt;http://www.math.nyu.edu/fellows_fin_math/gatheral/RandomMatrixCovariance2008.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In R, the package &quot;tawny&quot; has an implementation of RMT to filter noise in the correlation and covariance matrices.&lt;/p&gt;&#xA;" OwnerUserId="440" LastActivityDate="2011-02-18T06:38:54.063" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="545" PostTypeId="1" AcceptedAnswerId="547" CreationDate="2011-02-18T09:00:24.720" Score="57" ViewCount="33389" Body="&lt;p&gt;There is &lt;a href=&quot;http://www.google.com/search?q=evolutionary+algorithm+financial+market&quot;&gt;a large body of literature&lt;/a&gt; on the &quot;success&quot; of the application of evolutionary algorithms in general, and the genetic algorithm in particular, to the financial markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I feel uncomfortable whenever reading this literature. Genetic algorithms can over-fit the existing data.  With so many combinations, it is easy to come up with a few rules that work.  It may not be robust and it doesn't have a consistent explanation of why this rule works and those rules don't beyond the mere (circular) argument that &quot;it works because the testing shows it works&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the current consensus on the application of the genetic algorithm in finance?&lt;/p&gt;&#xA;" OwnerUserId="129" LastEditorUserId="129" LastEditDate="2015-06-09T06:09:02.680" LastActivityDate="2015-06-09T06:09:02.680" Title="How useful is the genetic algorithm for financial market forecasting?" Tags="&lt;quant-trading-strategies&gt;&lt;forecasting&gt;&lt;algorithm&gt;" AnswerCount="9" CommentCount="0" FavoriteCount="59" ContentLicense="CC BY-SA 3.0" />
  <row Id="546" PostTypeId="2" ParentId="545" CreationDate="2011-02-18T09:11:06.927" Score="3" Body="&lt;p&gt;if you backtest properly your GA (using only past data to generate the time serie of indicator), then you can trust the result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I agree with you that genetic algorithms are purely empirical and thus I don't feel very comfortable using them.&lt;/p&gt;&#xA;" OwnerUserId="134" LastActivityDate="2011-02-18T09:11:06.927" CommentCount="5" ContentLicense="CC BY-SA 2.5" />
  <row Id="547" PostTypeId="2" ParentId="545" CreationDate="2011-02-18T09:51:51.487" Score="37" Body="&lt;p&gt;I've worked at a hedge fund that allowed GA-derived strategies. For safety, it required that all models be submitted long before production to make sure that they still worked in the backtests. So there could be a delay of up to several months before a model would be allowed to run.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's also helpful to separate the sample universe; use a random half of the possible stocks for GA analysis and the other half for confirmation backtests.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-02-18T09:51:51.487" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="548" PostTypeId="2" ParentId="545" CreationDate="2011-02-18T10:24:35.110" Score="25" Body="&lt;p&gt;I think the biggest problem that genetic algorithms have are overfitting, &lt;a href=&quot;http://en.wikipedia.org/wiki/Data_dredging&quot;&gt;data snooping bias&lt;/a&gt; and that they are black boxes (not so much like Neural Networks but still - it depends on the way they are implemented).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think they are not used very much. I guess there are a few hedge funds out there that use it but all in all they were hyped and then busted. (But they are still useful for getting a paper accepted ;-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW: There is never a real consensus in finance - everybody tries to outsmart everybody else. This is why it is so interesting. (Or put another way: this is why there are still buyers AND sellers - a &lt;em&gt;real&lt;/em&gt; consensus is a crash ;-)&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-02-18T10:24:35.110" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="549" PostTypeId="1" AcceptedAnswerId="551" CreationDate="2011-02-18T10:43:15.563" Score="88" ViewCount="19227" Body="&lt;p&gt;Finance is drowning in a deluge of data. Humans are not very good at comprehending large amounts of data. One way out may be visualization. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Traditional ways of visualizing patterns, complexities and contexts are of course charts and for derivatives e.g. payoff diagrams, a more modern approach are &lt;a href=&quot;http://en.wikipedia.org/wiki/Heat_map&quot;&gt;heat maps&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question:&lt;/strong&gt;&lt;br&gt;&#xA;Do you know of any innovative (or experimental) ways of visualizing financial and/or derivatives data?&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2019-08-13T15:47:05.627" Title="Innovative ways of visualizing financial data" Tags="&lt;data&gt;&lt;derivatives&gt;&lt;visualization&gt;" AnswerCount="13" CommentCount="6" FavoriteCount="118" ContentLicense="CC BY-SA 2.5" />
  <row Id="550" PostTypeId="1" AcceptedAnswerId="1219" CreationDate="2011-02-18T12:40:35.823" Score="16" ViewCount="2784" Body="&lt;p&gt;&lt;a href=&quot;http://esper.codehaus.org/index.html&quot;&gt;Esper and its .NET port NEsper&lt;/a&gt; are components that enable Complex Event Processing (CEP) and Event Stream Processing (ESP) engines. They are especially suitable for trading applications. They can, among other things, make it easier to deal with data-bursts and threading and they use a query language tailored for event processing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm am interested in:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;drawbacks of (N)Esper in a trading environment, when compared to alternatives (eg. competing ESP/CEP, Database or custom)&lt;/li&gt;&#xA;&lt;li&gt;the type of problems one may encounter when building a trading application around (N)Esper.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="53" LastActivityDate="2012-04-28T05:03:32.803" Title="Drawbacks &amp; Caveats of using (N)Esper for ESP/CEP in trading systems?" Tags="&lt;programming&gt;&lt;cep&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="7" ContentLicense="CC BY-SA 2.5" />
  <row Id="551" PostTypeId="2" ParentId="549" CreationDate="2011-02-18T15:01:06.773" Score="61" Body="&lt;p&gt;Visualization should lead to truth and understanding.  As such, I find that simple visualizations tend to be the best.  My favorite visualization for showing relationships is the &lt;a href=&quot;http://en.wikipedia.org/wiki/Scatter_plot&quot; rel=&quot;noreferrer&quot;&gt;scatterplot&lt;/a&gt;.  Once you start to even introduce a line plot, you are implying continuities between data that may not exist.  And trying to introduce more advanced visualizations like network diagrams (&lt;a href=&quot;http://vis.stanford.edu/protovis/ex/arc.html&quot; rel=&quot;noreferrer&quot;&gt;ex&lt;/a&gt;) or complicated pie charts (&lt;a href=&quot;http://vis.stanford.edu/protovis/ex/crimea-rose.html&quot; rel=&quot;noreferrer&quot;&gt;ex&lt;/a&gt;) can lead to more confusion than understanding if misapplied.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few thoughts:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I think that you have already mentioned a few good ones.  Heatmaps are good because they allow you to show three (or more) dimensional data without the added issues that arise when trying to create a 3D visualization.  Payoff diagrams are simple but they accomplish their goal efficiently as a result.  &lt;/li&gt;&#xA;&lt;li&gt;The &lt;a href=&quot;http://finviz.com/&quot; rel=&quot;noreferrer&quot;&gt;FinViz website&lt;/a&gt; has a few nice examples of visualizations, including a simple &lt;a href=&quot;http://finviz.com/futures_performance.ashx&quot; rel=&quot;noreferrer&quot;&gt;bar chart&lt;/a&gt;, &lt;a href=&quot;http://finviz.com/futures_charts.ashx&quot; rel=&quot;noreferrer&quot;&gt;candlesticks&lt;/a&gt;, and &lt;a href=&quot;http://finviz.com/map.ashx&quot; rel=&quot;noreferrer&quot;&gt;heatmap&lt;/a&gt;.  &lt;/li&gt;&#xA;&lt;li&gt;People often don't consider that it is possible to include more dimensions in a typical plot by changing the width, size, color, or intensity of a shape.  This is a much better idea than trying to plot more than 2 dimensions spatially.&lt;/li&gt;&#xA;&lt;li&gt;The fourth real dimension is time, and time plays a very important role in financial data.  One popular way to incorporate this as another dimension in a visualization is through &lt;em&gt;video&lt;/em&gt;.  A great example is &lt;a href=&quot;http://www.gapminder.org/&quot; rel=&quot;noreferrer&quot;&gt;gapminder&lt;/a&gt;, the software created by Hans Rosling, which made for some very compelling &lt;a href=&quot;http://www.gapminder.org/videos/&quot; rel=&quot;noreferrer&quot;&gt;TED talks&lt;/a&gt; about global poverty.  This was acquired by google and is now available as part of &lt;a href=&quot;http://www.google.com/publicdata/home&quot; rel=&quot;noreferrer&quot;&gt;their web toolkit&lt;/a&gt; (also mentioned by &lt;a href=&quot;https://quant.stackexchange.com/questions/549/innovative-ways-of-visualizing-financial-data/556#556&quot;&gt;Ben Hoffstein&lt;/a&gt;).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Visualization techniques from other fields are still very appropriate in finance, and the best starting point is &lt;a href=&quot;http://www.edwardtufte.com/tufte/&quot; rel=&quot;noreferrer&quot;&gt;Edward Tufte&lt;/a&gt;, especially &lt;a href=&quot;http://www.edwardtufte.com/tufte/books_vdqi&quot; rel=&quot;noreferrer&quot;&gt;&quot;The Visual Display of Quantitative Information&quot;&lt;/a&gt; and &lt;a href=&quot;http://www.edwardtufte.com/tufte/books_ei&quot; rel=&quot;noreferrer&quot;&gt;&quot;Envisioning Information&quot;&lt;/a&gt;.  You also can get a benefit from learning a visualization language.  I recommend any of these three (in order of complexity):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;R with &lt;a href=&quot;http://had.co.nz/ggplot2/&quot; rel=&quot;noreferrer&quot;&gt;ggplot2&lt;/a&gt;, (&lt;a href=&quot;https://plot.ly/r/&quot; rel=&quot;noreferrer&quot;&gt;plotly&lt;/a&gt; now provide an easy way to make ggplot graphes interactive)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://vis.stanford.edu/protovis/&quot; rel=&quot;noreferrer&quot;&gt;Protovis&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.processing.org/&quot; rel=&quot;noreferrer&quot;&gt;Processing&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;These each have a learning curve, but once you learn how to use them they all allow for &lt;a href=&quot;http://en.wikipedia.org/wiki/Exploratory_data_analysis&quot; rel=&quot;noreferrer&quot;&gt;exploratory data analysis&lt;/a&gt; in a way that can't be achieved with other tools.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are also many great and innovative commercial tools.  To mention a few that are all used by banks and hedge funds:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.panopticon.com/&quot; rel=&quot;noreferrer&quot;&gt;Panopticon&lt;/a&gt; does an amazing job with real-time visualization.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.tableausoftware.com/&quot; rel=&quot;noreferrer&quot;&gt;Tableau&lt;/a&gt;, &lt;a href=&quot;http://spotfire.tibco.com/&quot; rel=&quot;noreferrer&quot;&gt;Spotfire&lt;/a&gt;, and &lt;a href=&quot;http://www.qlikview.com/&quot; rel=&quot;noreferrer&quot;&gt;Qlikview&lt;/a&gt; all allow for interactive visualization of data using in-memory databases.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="17" LastEditorUserId="5052" LastEditDate="2019-08-13T13:52:06.010" LastActivityDate="2019-08-13T13:52:06.010" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="552" PostTypeId="2" ParentId="545" CreationDate="2011-02-18T15:49:16.750" Score="9" Body="&lt;p&gt;Assuming you avoid data-snooping bias and all the potential pitfalls of using the past to predict the future, trusting genetic algorithms to find the &quot;right&quot; solution pretty much boils down to the same bet you make when you actively manage a portfolio, whether quantitatively or discretionary. If you believe in market efficiency then increasing your transaction costs from active management is illogical. If, however you believe there are structural &amp;amp; psychological patterns or &quot;flaws&quot; to be exploited and the payoff is worth the time and money for researching and implementing a strategy the logical choice is active management.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Running a GA derived strategy is an implicit bet against market efficiency. You're basically saying &quot;I think there are mis-valuations that occur from some reason&quot; (masses of irrational people, mutual funds herding because of mis-aligned incentives, etc.) and &quot;running this GA can sort this mass of data out way quicker than I can.&quot;&lt;/p&gt;&#xA;" OwnerUserId="352" LastActivityDate="2011-02-18T15:49:16.750" CommentCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="553" PostTypeId="2" ParentId="545" CreationDate="2011-02-18T18:53:30.343" Score="18" Body="&lt;p&gt;I've applied GA to all sorts of things.   I had some success in the deterministic world where a pattern actually existed and I knew that some physical structure existed (seismic analysis, vibration analysis, inventory calcs, etc).   After I found a GA model that behaved, the real work started....figuring out why it behaved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also generated a lot of GA garbage from financial data that &quot;worked&quot; looking backward, but was worthless looking forward.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Techniques aren't the issue in finance, it's the structure.   And, of course, never enough data (useful data).&lt;/p&gt;&#xA;" OwnerUserId="392" LastActivityDate="2011-02-18T18:53:30.343" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="554" PostTypeId="1" CreationDate="2011-02-18T19:21:47.163" Score="15" ViewCount="566" Body="&lt;p&gt;A &lt;a href=&quot;http://www.zerohedge.com/article/barclays-quant-commentary-worst-returns-environment-disciplined-stock-pickers-60-years&quot; rel=&quot;noreferrer&quot;&gt;commentary attributed to Matt Rothman&lt;/a&gt; had recently (in the past six months) been making the rounds of the internet echo chamber claimed &quot;There are no idiosyncratic  returns available in the market&quot;. How would one turn this into a proper statistical hypothesis test? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As part of the commentary, a plot of 'implied correlation' was given:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/Fj68a.jpg&quot; alt=&quot;from zerohedge&quot;&gt;&#xA;This does not tell me much, but it suggest perhaps a test based on the two leading eigenvalues of the correlation matrix, but I am not sure how to pose the problem.&lt;/p&gt;&#xA;" OwnerUserId="108" LastEditorUserId="108" LastEditDate="2011-02-20T22:18:37.080" LastActivityDate="2011-07-20T00:55:16.110" Title="How would you test the hypothesis &quot;There are no idiosyncratic returns available in the market&quot;?" Tags="&lt;correlation&gt;&lt;market&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="555" PostTypeId="2" ParentId="549" CreationDate="2011-02-18T19:33:10.937" Score="8" Body="&lt;p&gt;Here are a few recent examples:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/4951193/find-largest-5-value-less-than-1-lowest-5-values&quot;&gt;https://stackoverflow.com/questions/4951193/find-largest-5-value-less-than-1-lowest-5-values&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://tables2graphs.com/doku.php?id=04_regression_coefficients#figure_6&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://tables2graphs.com/doku.php?id=04_regression_coefficients#figure_6&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://tables2graphs.com/doku.php?id=03_descriptive_statistics#figure_5&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://tables2graphs.com/doku.php?id=03_descriptive_statistics#figure_5&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://chartporn.org/category/innovative/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://chartporn.org/category/innovative/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="392" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2011-02-18T19:33:10.937" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="556" PostTypeId="2" ParentId="549" CreationDate="2011-02-18T23:05:51.603" Score="25" Body="&lt;p&gt;The &lt;a href=&quot;http://code.google.com/apis/visualization/documentation/gallery/motionchart.html&quot;&gt;Google Motion Chart&lt;/a&gt; is a particularly elegant visualization for 'replaying' time series data. There is also an &lt;a href=&quot;http://code.google.com/p/google-motion-charts-with-r/&quot;&gt;R package&lt;/a&gt; to interface with it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/qndV0.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="5" LastActivityDate="2011-02-18T23:05:51.603" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="557" PostTypeId="1" AcceptedAnswerId="682" CreationDate="2011-02-18T23:48:16.457" Score="39" ViewCount="27516" Body="&lt;p&gt;In my firm we are beginning a new OMS (Order Management System) project and there is a debate whether we use Quickfix or we go for a professional fix engine? Because there is a common doubt that QuickFix is not enough fast and obviously we will not get any technical support. I  heard that in BOVESPA it has been used for a while. They are changing it with a paid one now. Well that is enough for me. If they use it I can use it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should I choose a professional one over QuickFix? Is it not good enough?&lt;/p&gt;&#xA;" OwnerUserId="42" LastEditorUserId="1355" LastEditDate="2011-09-08T20:41:05.040" LastActivityDate="2015-09-02T22:19:23.133" Title="How fast is QuickFix ?" Tags="&lt;fix&gt;" AnswerCount="12" CommentCount="1" FavoriteCount="26" ContentLicense="CC BY-SA 2.5" />
  <row Id="558" PostTypeId="2" ParentId="557" CreationDate="2011-02-19T02:11:11.063" Score="13" Body="&lt;p&gt;How fast do you need? Have you measured round-trip times from the exchange and determined that you need a better solution?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wouldn't call QuickFix &lt;em&gt;quick&lt;/em&gt;; it has a lot of unnecessary overhead (temporary objects, temporary strings, nested functions, etc). But I've used it in projects before without too much trouble.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is definitely possible to make a much faster FIX engine from scratch. You can use inlined accessors, call &lt;code&gt;writev()&lt;/code&gt; instead of concatenating strings, etc. Then there's the standard's requirements, like replaying old FIX messages or handling multiple values per one key. It's a ton of work to do something like that correctly, so you'll need to evaluate just how much pain you're willing to go through.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I haven't used any of the commercial off-the-self engines; hopefully someone else can chime-in with a specific recommendation there. Ideally the cost of that will be a fraction of doing it in-house.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-02-19T02:11:11.063" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="559" PostTypeId="1" CreationDate="2011-02-19T13:48:03.200" Score="8" ViewCount="6552" Body="&lt;p&gt;I figure this perhaps the best place to ask this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What technology stack is used in Bloomberg?  I'm C++ developer, and I definitely prefer C++ to C, so I don't want to touch C unless it's strictly necessary.  I've had my fair share of maintaining legacy systems, and it's not something I enjoy.  From my reading it seems they use C heavily.&lt;/p&gt;&#xA;" OwnerUserId="424" LastActivityDate="2012-10-23T11:17:34.937" Title="Technology stack used in Bloomberg" Tags="&lt;programming&gt;&lt;bloomberg&gt;" AnswerCount="5" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="560" PostTypeId="2" ParentId="559" CreationDate="2011-02-19T14:42:20.467" Score="5" Body="&lt;p&gt;But what you see from the outside is just an interface, no? And C interfaces are &lt;strong&gt;much&lt;/strong&gt; easier to handle, e.g. from Excel and other common tools. Almost a decade ago I wrote a (firm-internal, unreleased) interface from R to Bloomberg, that only worked because the C interface permitting me to use gcc / MinGW (as required by R) along with the dll/lib from Bloomberg (presumably built with a Visual C compiler). You cannot mix and match C++ libraries across compilers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, I think I have seen job ads for Bloomberg mentioning C++ skills.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an aside, I also recall an NVidia press release from 1 1/2 years ago when &lt;a href=&quot;http://www.wallstreetandtech.com/it-infrastructure/showArticle.jhtml?articleID=220200055&quot; rel=&quot;nofollow&quot;&gt;Bloomberg switched to a bunch of GPUs for simulation-based pricing models&lt;/a&gt; so they probably do into the 'whatever gets the job done' school of tool deployment.&lt;/p&gt;&#xA;" OwnerUserId="69" LastEditorUserId="35" LastEditDate="2011-02-19T18:52:00.750" LastActivityDate="2011-02-19T18:52:00.750" CommentCount="5" ContentLicense="CC BY-SA 2.5" />
  <row Id="561" PostTypeId="2" ParentId="559" CreationDate="2011-02-19T15:49:40.950" Score="4" Body="&lt;p&gt;I hate to recite &lt;a href=&quot;http://en.wikipedia.org/wiki/Bloomberg_Terminal#Architecture&quot; rel=&quot;nofollow&quot;&gt;Wikipedia&lt;/a&gt;, but it seems like the answer is there. To summarize, the legacy Bloomberg server was written in a mix of Fortran and C, and more recently they've begun adding C++ and embedded Javascript components. Different clients use languages appropriate to their platforms.&lt;/p&gt;&#xA;" OwnerUserId="80" LastActivityDate="2011-02-19T15:49:40.950" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="562" PostTypeId="2" ParentId="554" CreationDate="2011-02-19T15:50:06.343" Score="5" Body="&lt;p&gt;Take the CAPM regression (it's not exactly correct, but it's instructional) $$(R_i - R_f) = \alpha_i + \beta_i (R_{mkt} - R_f) + \epsilon_i$$ The author is saying that these days the $(R_{mkt} - R_f)$ term is driving all returns and that the $\alpha_i$ and $\epsilon_i$ terms are not significantly different than zero because all returns are correlated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way of looking at it is that before this period of high correlation you could find the stocks that were mis-priced by looking at fundamentals. If you bought the stocks that were under-priced, then the market would soon enough find out that you were correct, buy the stock and return it to the correct price, and you would capture this return in excess of predicted by $\beta_i$. He is saying that even if these stocks are mis-priced, because everything is correlated, there are no price corrections and you're only seeing returns based on $\beta_i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That the correlation isn't 1.0 shows that he's not absolutely correct, but it's a good point. Because everything is &quot;correlated&quot; you can't get an excess return without buying a high $\beta_i$ stock and accepting market risk (i.e., this is a &quot;risk on&quot; period when all stocks are correlated).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can think of two things to test:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Fama-MacBeth regressions -- calculate $\beta_i$ for all the stocks, then do cross-sectional regression of the excess returns on $\beta_i$ and take the time series average. If he's correct, then the average coefficient on $\beta_i$ will be positive and significant.&lt;/li&gt;&#xA;&lt;li&gt;Standard CAPM regressions (although to get a decent estimate of $\alpha_i$ you will need more risk factors) -- if he's correct, then the intercepts should not be significantly different than zero and the idiosyncratic error $\epsilon_i$ should be smaller than previous periods.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="106" LastEditorUserId="106" LastEditDate="2011-02-19T16:00:11.770" LastActivityDate="2011-02-19T16:00:11.770" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="563" PostTypeId="2" ParentId="549" CreationDate="2011-02-19T16:22:53.153" Score="12" Body="&lt;p&gt;Shane's advice is good.  I think it's worth adding the following two techniques not already mentioned:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Self-organizing_map&quot;&gt;Self-Organizing Maps&lt;/a&gt; (SOMs)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://cran.r-project.org/web/packages/seriation/vignettes/seriation.pdf&quot;&gt;Seriation&lt;/a&gt; (pdf pertaining to R package &lt;code&gt;seriation&lt;/code&gt;, but great intro to the topic).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They are not explicit visualize techniques, &lt;em&gt;per se&lt;/em&gt;.  Instead, they are algos that transform underlying data in ways that aim to lead to greater/new insight on the underlying data.  Thus, in my mind, the above approaches share the common objective with xy plots, contour plots, scatter-plot matrices, heat maps, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For strict quantitative visualization, Tufte, as mentioned above, a great place to start.  Personally, I've gotten more out of Wong's, &quot;The Wall Street Journal Guide to Information Graphics&quot; and Janert's &quot;Data Analysis with Open Source Tools&quot;.  However, keep in mind that each have different audiences and objectives in mind.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also believe Processing (mentioned by Shane) has a very bright future in finance - it's been used heavily by multimedia artists primarily because of its relative ease and great flexibility.&lt;/p&gt;&#xA;" OwnerUserId="390" LastActivityDate="2011-02-19T16:22:53.153" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="564" PostTypeId="2" ParentId="358" CreationDate="2011-02-19T16:31:10.047" Score="5" Body="&lt;p&gt;FWIW, here's the approach I used. I keep the dates as an integer in YYYYMMDD form and merge the calls and puts in to a data frame &lt;code&gt;both&lt;/code&gt;. Then I use &lt;code&gt;ddply&lt;/code&gt; to operate on each matched call and put to find the future SPX close and call/put bid-offer average &lt;code&gt;boa&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(plyr)&#xA;both &amp;lt;- merge(calls, puts[, c(&quot;date&quot;, &quot;exdate&quot;, &quot;strike&quot;, &quot;boa&quot;, &quot;delta&quot;, &quot;vega&quot;)], by = c(&quot;date&quot;, &quot;exdate&quot;, &quot;strike&quot;), suffixes = c(&quot;.calls&quot;, &quot;.puts&quot;), sort = T) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which gives:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; head(both)&#xA;      date   exdate strike  close    Xms boa.calls delta.calls vega.calls&#xA;1 19960104 19960120    490 588.97 -98.97   100.375    0.965229   8.954686&#xA;2 19960104 19960120    495 588.97 -93.97    95.375    0.964108   9.199321&#xA;3 19960104 19960120    510 588.97 -78.97    80.375    0.960100  10.064710&#xA;4 19960104 19960120    515 588.97 -73.97    75.375    0.958478  10.407010&#xA;5 19960104 19960120    525 588.97 -63.97    65.500    0.949837  12.130740&#xA;6 19960104 19960120    530 588.97 -58.97    60.625    0.942449  13.559780&#xA;  boa.puts delta.puts vega.puts&#xA;1  0.03125  -0.002597  0.960498&#xA;2  0.03125  -0.002725  1.003923&#xA;3  0.09375  -0.007769  2.548534&#xA;4  0.12500  -0.010310  3.279840&#xA;5  0.28125  -0.021612  6.162532&#xA;6  0.28125  -0.023069  6.512128&#xA;&#xA;both &amp;lt;- transform(both, date.ym = date %/% 100, exdate.ym = exdate %/% 100, exdate.d = exdate %% 100)&#xA;both &amp;lt;- ddply(both, .variables = c(&quot;exdate&quot;, &quot;strike&quot;), .fun = my.shift, direc = &quot;fut&quot;, value.col = c(&quot;close&quot;, &quot;boa.calls&quot;, &quot;boa.puts&quot;), .parallel = in.parallel)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which gives:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; head(both)&#xA;      date   exdate strike    close      Xms boa.calls delta.calls vega.calls&#xA;1 19960109 19960120    565 582.7998 -17.7998  18.50000    0.953215   9.323605&#xA;2 19960109 19960120    575 582.7998  -7.7998   9.06250    0.834628  23.915020&#xA;3 19960109 19960120    580 582.7998  -2.7998   6.06250    0.626327  36.502140&#xA;4 19960109 19960120    585 582.7998   2.2002   3.81250    0.445721  38.105320&#xA;5 19960109 19960120    590 582.7998   7.2002   2.06250    0.287108  32.854870&#xA;6 19960109 19960120    595 582.7998  12.2002   1.03125    0.166120  24.049020&#xA;  boa.puts delta.puts vega.puts date.ym exdate.ym exdate.d close.fut&#xA;1   3.1875  -0.220331  28.53901  199601    199601       20    581.99&#xA;2   5.1875  -0.345956  35.53591  199601    199601       20    581.99&#xA;3   7.0000  -0.432961  37.89640  199601    199601       20    581.99&#xA;4   9.6250  -0.525538  38.34777  199601    199601       20    581.99&#xA;5  12.8750  -0.610547  36.90346  199601    199601       20    581.99&#xA;6  17.1250  -0.671490  34.82305  199601    199601       20    581.99&#xA;  boa.calls.fut boa.puts.fut&#xA;1      17.62500      0.34375&#xA;2       8.06250      1.12500&#xA;3       4.43750      2.40625&#xA;4       1.84375      4.93750&#xA;5       0.71875      8.93750&#xA;6       0.28125     13.37500&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where the &lt;code&gt;my.shift&lt;/code&gt; function is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;my.shift &amp;lt;- function(x, date.col = &quot;date&quot;, value.col = NULL, steps = 1, direc = NULL) {&#xA;&#xA;    if (direc == &quot;fut&quot;) {&#xA;        x.shift &amp;lt;- tail(x[, c(date.col, value.col)], -1 * steps) &#xA;        x.shift[, date.col] &amp;lt;- head(x[, date.col], -1 * steps)&#xA;    } else {&#xA;        x.shift &amp;lt;- head(x[, c(date.col, value.col)], -1 * steps) &#xA;        x.shift[, date.col] &amp;lt;- tail(x[, date.col], -1 * steps)&#xA;    }&#xA;&#xA;    x &amp;lt;- merge(x, x.shift, by = date.col, suffixes = c(&quot;&quot;, paste(&quot;&quot;, direc, sep = &quot;.&quot;, collapse = &quot;&quot;)))&#xA;    return(x)&#xA;}    &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;HTH (I use the &lt;code&gt;.ym&lt;/code&gt; and &lt;code&gt;.d&lt;/code&gt; columns later for picking the right time to expiry).&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-02-19T16:31:10.047" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="565" PostTypeId="1" AcceptedAnswerId="790" CreationDate="2011-02-19T18:01:48.280" Score="12" ViewCount="7131" Body="&lt;p&gt;What is the market standard for pricing quanto CDS (i.e. CDS which pays the contingent leg in different currency than the pricing leg)?&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2017-12-01T12:32:04.540" Title="Quanto CDS modeling" Tags="&lt;credit&gt;&lt;cds&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="566" PostTypeId="2" ParentId="559" CreationDate="2011-02-21T03:50:05.530" Score="3" Body="&lt;p&gt;Bloomberg has client/server API libs for most modern programming languages including C++, Java, and .Net.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You don't have to hit the C level api, unless you really want to :-)&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-02-21T03:50:05.530" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="567" PostTypeId="1" AcceptedAnswerId="568" CreationDate="2011-02-21T04:31:28.683" Score="9" ViewCount="2535" Body="&lt;p&gt;What is a good place to acquire cheap/free historical quarterly filings data for US Companies? Specifically, I'm interested in the consolidated financial statements. The data should be well-structured and machine-readable (csv,tsv,json, etc.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm familiar with CompuStat and CRSP but both are well out of my price range. Coverage need not be exhaustive, but most of the Russell 3000 (with dead companies) for the last 5-10 years would be great.&lt;/p&gt;&#xA;" OwnerUserId="436" LastActivityDate="2017-06-02T16:25:02.093" Title="Free/cheap source of structured historical quarterly filings?" Tags="&lt;data&gt;&lt;history&gt;&lt;fundamentals&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 2.5" />
  <row Id="568" PostTypeId="2" ParentId="567" CreationDate="2011-02-21T04:45:10.440" Score="7" Body="&lt;p&gt;You can get quite a bit of structured data for free from the SEC's Edgar system via XML:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.sec.gov/edgar/quickedgar.htm&quot;&gt;http://www.sec.gov/edgar/quickedgar.htm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://xbrl.sec.gov/&quot;&gt;http://xbrl.sec.gov/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even the older stuff that's not xml based, is fairly readily parsable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another source that is easier to deal with, but not free, and possibly expensive, is CapitalIQ (where Yahoo Finance gets their data from).&lt;/p&gt;&#xA;" OwnerUserId="214" LastEditorUserId="35" LastEditDate="2011-02-21T20:34:26.503" LastActivityDate="2011-02-21T20:34:26.503" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="569" PostTypeId="1" AcceptedAnswerId="580" CreationDate="2011-02-21T09:36:04.077" Score="33" ViewCount="13341" Body="&lt;p&gt;Currently I trade trough IB. I run my HFT strategies (100 roundtrips per hour) but I think that latency is killing me and my profits are shrinking. I need the fastest possible brokers out there which meet the following requirements:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Willing to deal with small accounts (50k). Hence lime is off the table.&lt;/li&gt;&#xA;&lt;li&gt;Has Java api (or it's easy to buy third party api for it)&lt;/li&gt;&#xA;&lt;li&gt;Can trade futures&lt;/li&gt;&#xA;&lt;li&gt;Offers colocation (US and EU)&lt;/li&gt;&#xA;&lt;li&gt;Offers data feed&lt;/li&gt;&#xA;&lt;li&gt;Can run on unix box&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="40" LastEditorUserId="1106" LastEditDate="2011-10-07T11:43:23.787" LastActivityDate="2016-03-25T03:55:11.417" Title="What is a good broker for HFT?" Tags="&lt;data&gt;&lt;futures&gt;&lt;high-frequency&gt;&lt;broker&gt;&lt;programming&gt;" AnswerCount="5" CommentCount="5" FavoriteCount="19" ContentLicense="CC BY-SA 3.0" />
  <row Id="570" PostTypeId="2" ParentId="559" CreationDate="2011-02-21T10:51:39.677" Score="3" Body="&lt;p&gt;Tons of legacy Fortran and C, some recent C++ and Java. Lots of in-house technologies of debatable quality, including for things where there exist good open-source alternatives.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you care about using modern technologies and don't want to touch legacy systems, I'd go elsewhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; there is some variability across teams with regards to the technology stack they use on a day-to-day basis. You may be able to find a team that suits your requirements. However, bear in mind that your mobility within the organization will be restricted if you're not prepared to deal with legacy technologies and systems.&lt;/p&gt;&#xA;" OwnerUserId="90" LastEditorUserId="90" LastEditDate="2011-02-21T11:01:41.597" LastActivityDate="2011-02-21T11:01:41.597" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="571" PostTypeId="2" ParentId="431" CreationDate="2011-02-21T11:35:51.500" Score="6" Body="&lt;p&gt;I like &lt;a href=&quot;http://videolectures.net/&quot; rel=&quot;noreferrer&quot;&gt;http://videolectures.net/&lt;/a&gt;, lots of conferences/lectures in computer science and maths, some in finance ...&lt;/p&gt;&#xA;" OwnerDisplayName="user72" LastActivityDate="2011-02-21T11:35:51.500" CommentCount="0" CommunityOwnedDate="2011-02-21T11:35:51.500" ContentLicense="CC BY-SA 2.5" />
  <row Id="572" PostTypeId="1" AcceptedAnswerId="579" CreationDate="2011-02-21T13:54:38.567" Score="13" ViewCount="1039" Body="&lt;p&gt;I am currently wrapping up my thesis. My final chapter is on applying the SABR model model for pricing purposes. I am valuing a constant maturity swap by replicating its value using plain vanille European payer and receiver swaptions as described by P. Hagan (&lt;a href=&quot;http://pds4.egloos.com/pds/200702/26/99/convexit.pdf&quot;&gt;http://pds4.egloos.com/pds/200702/26/99/convexit.pdf&lt;/a&gt;) in equation (2.19a). I use the SABR model to inter- and extrapolate market volatility smiles.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be more specific, I am pricing a 5Y CMS swap swapping the 10Y EURIBOR6M swap rate against a floating payment of EURIBOR3M with payments being made quarterly.  I have (somewhat arbitrarily) chosen to price the CMS swap as if today is June 1st 2010, but $\beta$ should be fairly stable and a contemporary estimate would be equally helpful/interesting.  My &quot;problem&quot; is, that using $\beta=0.25$ gives me a CMS spread of 162 bp while using $\beta=0.85$ gives me a CMS spread of 176 bp. The Bloomberg mid quote for this specific product on June 1st 2010 is 175.5 bp, but I feel that simply choosing the $\beta$ that fits better is not very... academic.&lt;/p&gt;&#xA;" OwnerUserId="463" LastActivityDate="2011-02-21T19:32:04.067" Title="What SABR $\beta$ to use for EURIBOR swaption smiles" Tags="&lt;structured-finance&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="573" PostTypeId="1" AcceptedAnswerId="585" CreationDate="2011-02-21T14:54:08.353" Score="8" ViewCount="1410" Body="&lt;p&gt;Given a historical distribution of weekly prices and price changes for a stock, how can I estimate the the option premium for a nearly at-the-money (ATM) option, say with an expiration date 3 months in the future?  We could also have the stock's historical beta and the current option premium if desired.  To keep things simple assume the volatility of the stock is constant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am writing a little Monte-Carlo sim for a buddy in Excel and would like to simulate a strategy of writing ATM covered calls, letting the option expire if OTM and re-writing.  I will assume exercise at the end of the option period if the call is ITM.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have never modeled options before so another title for this question might be &quot;Options Modeling 101&quot;.  For starters I would just like to improve upon my current model, which is constant premiums.  Thanks!&lt;/p&gt;&#xA;" OwnerUserId="47" LastActivityDate="2011-02-22T18:22:23.587" Title="Simple model for option premium (for covered call simulation)?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;modeling&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="574" PostTypeId="2" ParentId="569" CreationDate="2011-02-21T15:00:26.330" Score="4" Body="&lt;p&gt;Here's a discussion/conclusion about the Flash Crash:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.nanex.net/FlashCrashFinal/FlashCrashAnalysis_Theory.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.nanex.net/FlashCrashFinal/FlashCrashAnalysis_Theory.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quoting the above link:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;....A sale (or purchase) of 2,000+ contracts which rips through one-side of the depth of book in 50-100 milliseconds, will immediately overload many systems.....&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My point is, HFT currently takes place in computers that are located next door to the exchange's computers and happen in milliseconds.  Retail trades are not involved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I now see that HFT has been discussed in the past:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/310/how-high-is-the-frequency-in-hft&quot;&gt;How &amp;#39;High&amp;#39; is the frequency in HFT?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="392" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2011-04-26T16:40:53.273" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="575" PostTypeId="1" AcceptedAnswerId="763" CreationDate="2011-02-21T15:44:25.237" Score="17" ViewCount="792" Body="&lt;p&gt;I am working in the area of probability theory and for a case study I would like to make some calculations in finance. Since I am developing theory for the discrete time, I am interested in models for the stock price in the discrete time. As I remember GARCH is a good one. Could you advise me something else?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It will be nice if you can tell me which model also can be used for the currency markets (since they are quite faster than the stock markets I think there should another relevant models).&lt;/p&gt;&#xA;" OwnerUserId="464" LastActivityDate="2011-03-18T23:00:00.450" Title="Discrete-time model: stock dynamics" Tags="&lt;models&gt;&lt;stochastic-processes&gt;" AnswerCount="3" CommentCount="6" FavoriteCount="5" ContentLicense="CC BY-SA 2.5" />
  <row Id="576" PostTypeId="2" ParentId="395" CreationDate="2011-02-21T15:54:09.630" Score="0" Body="&lt;p&gt;Recently I faced some results in calculations of such probabilities in a very nice and accurate way for Markov models. If you are interested, I will be happy to tell you where you can find it.&lt;/p&gt;&#xA;" OwnerUserId="464" LastActivityDate="2011-02-21T15:54:09.630" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="577" PostTypeId="2" ParentId="208" CreationDate="2011-02-21T16:10:31.213" Score="3" Body="&lt;p&gt;(1)&#xA;You can easily solve it in the case of constant coefficients. The answer will be $\infty$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, this equation has no solution on any interval. The intuition is the following. For the SDE like&#xA;$$&#xA;dS_t = \mu(t,S_t)dt+ \sigma(t,S_t)dw_t&#xA;$$&#xA;you can mention that $dw_t = \xi_t\sqrt{t}$, where $\xi_t\sim\mathcal{N}(0,1)$ are standard gaussian i.i.d. random variables. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you do this &quot;infinite summation&quot; like for the integral, it will be like&#xA;$$&#xA;\int\limits_0^T \sigma(t,S_t)\xi_t\sqrt{dt}.&#xA;$$ &#xA;Due to the fact that expectation of $\xi$ is zero and thanks to the Law of Large Numbers, this integral makes sense. Because the integrand is so often positive and so often negative on any small interval. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand in your equation you reject the term $\xi_t$ - and now on some small intervals your integrand will be positive or negative. Then this integral will diverge.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also consider the following motivation. When you discretize the time and simulate&#xA;$$&#xA;\Delta S_t = \mu(t,S_t)\Delta t +\sigma(t,S_t)\xi_t\sqrt{\Delta t}&#xA;$$&#xA;then for any $\Delta t$ you will have nice behaviour of the trajectories. On the other hand try to simulate&#xA;$$&#xA;\Delta S_t = \mu(t,S_t)\Delta t +\sigma(t,S_t)\sqrt{\Delta t}&#xA;$$&#xA;and decrease the time step. You will see immediately that even on the segment $[0,1]$ your trajectory will diverge for sufficiently small time steps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) Surely, these are different notions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(3) - if you talk about your deterministic equation - then there will be no difference, integrals will blow up. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope that it was useful - otherwise please comment and ask.&lt;/p&gt;&#xA;" OwnerUserId="464" LastActivityDate="2011-02-21T16:10:31.213" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="578" PostTypeId="2" ParentId="212" CreationDate="2011-02-21T16:14:36.360" Score="0" Body="&lt;p&gt;It seems to me that you are making the problem more complicated than it is in fact. What is the process $X_t$ and what is the motivation to find this expectation as a path integral? If you would like to find the value of integral on the trajectory of the diffusion process I think it is undefined.&lt;/p&gt;&#xA;" OwnerUserId="464" LastActivityDate="2011-02-21T16:14:36.360" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="579" PostTypeId="2" ParentId="572" CreationDate="2011-02-21T19:22:42.730" Score="7" Body="&lt;p&gt;There's a paper by Fabio Mercurio called &quot;Smiling at Convexity&quot; which discusses this and proposes doing basically what you've done, namely setting beta to match the market prices of CMS swaps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the Hagan et. al. SABR paper they discuss ways of setting beta based on plotting ATM vols versus the forward rates. The idea here is to plot log vol vs log fwd rate, the slope of which is 1 - $\beta$. This gives you a rough idea, but it's very noisy, so you wouldn't really be able to distinguish (say) $\beta$ = 0.5 and beta = 0.6.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The convexity adjustment will be very sensitive to how you extrapolate the smile, which in the SABR model is strongly affected by the value of beta. You also have to be a bit careful with how far you take the extrapolation, the SABR model will just keep the vol going up forever as you integrate the strike up to infinity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Just to be clear, there's no unique answer, different desks will do different things. Fitting the CMS swaps is probably a good idea, but given only one parameter $\beta$ you would only get a best fit. I've not tried to do this, but I suspect that your $\beta$ values would be very stable against moves in the the CMS market, which seems unsatisfiying, as you'd expect $\beta$ to change very slowly with time.&lt;/p&gt;&#xA;" OwnerUserId="371" LastEditorUserId="371" LastEditDate="2011-02-21T19:32:04.067" LastActivityDate="2011-02-21T19:32:04.067" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="580" PostTypeId="2" ParentId="569" CreationDate="2011-02-21T20:47:07.787" Score="17" Body="&lt;p&gt;Look at &lt;a href=&quot;http://www.gndt.com/&quot;&gt;Genesis Trading&lt;/a&gt;. Most of the sales guys there are kinda like used car salesmen but they will work with you. Starting up with 50K should not be a problem for them. The offer full depth of book feeds if you are colocated with them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They do offer DMA and you can specify all routing instructions for your orders rather than getting stuck on IBs router.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are not doing HFT but don't get discouraged. If your executions are not good and you are getting lots of slippage it may be due to IB.&lt;/p&gt;&#xA;" OwnerUserId="373" LastActivityDate="2011-02-21T20:47:07.787" CommentCount="5" ContentLicense="CC BY-SA 2.5" />
  <row Id="581" PostTypeId="1" AcceptedAnswerId="582" CreationDate="2011-02-21T23:43:12.633" Score="19" ViewCount="5001" Body="&lt;p&gt;Say you have an Exponential Moving Average being continuously updated over a time series using 1-second-long time periods. What should happen if there is no value for the next second, e.g. there were no price updates? Should the function decay in some way since there are no new values? Is there a correct or accepted way of handling this case?&lt;/p&gt;&#xA;" OwnerUserId="373" LastEditorUserId="1106" LastEditDate="2011-09-23T02:36:16.830" LastActivityDate="2011-09-23T02:36:16.830" Title="How to update an exponential moving average with missing values?" Tags="&lt;data&gt;&lt;time-series&gt;&lt;moving-average&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="582" PostTypeId="2" ParentId="581" CreationDate="2011-02-22T00:20:33.360" Score="14" Body="&lt;p&gt;You can either&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;reuse the last computed EMA, or&lt;/li&gt;&#xA;&lt;li&gt;fill-forward the previous period's sample data and recompute the EMA.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I generally prefer the second option, which should cause a decay. Only go for the first option if your application won't change its logic based on missing data.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-02-22T00:20:33.360" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="583" PostTypeId="2" ParentId="530" CreationDate="2011-02-22T01:19:27.890" Score="31" Body="&lt;p&gt;Wavelets are just one form of &quot;basis decomposition&quot;.  Wavelets in particular decompose in both frequency and time and thus are more useful than fourier or other purely-frequency based decompositions.  There are other time-freq decompositions (for instance the HHT) which should be explored as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Decomposition of a price series is useful in understanding the primary movement within a series.  In general with a decomposition, the original signal is the sum its basis components (potentially with some scaling multiplier).  The components range from the lowest frequency (a straight-line through the sample) to the highest frequency, a curve that oscillates with a frequency maximum approaching N / 2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;b&gt;How this is useful&lt;/b&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;denoising a series&lt;/li&gt;&#xA;&lt;li&gt;determining the principal component of movement in the series&lt;/li&gt;&#xA;&lt;li&gt;determining pivots&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Denoising is accomplished by recomposing the series by summing up the components from the decomposition, less the last few highest frequency components.  This denoised (or filtered) series, if chosen well, often gives a view on the core price process.   Assuming continuation in the same direction, can be used to extropolate for a short period forward.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the timeseries ticks in real-time, one can look at how the denoised (or filtering) price process changes to determine whether a price movement in a different direction is significant or just noise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the keys, though, is determining how many levels of the decomposition to recompose in any given situation.  Too few levels (low freq) will mean that the recomposed price series responds very slowly to events.  Too many levels (high freq) will mean for fast response but , perhaps too much noise in some price regimes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given that the market shifts between sideways movements and momentum movements, a filtering process needs to adjust to regime, becoming more or less sensitive to movements in projecting a curve.  There are many ways to evaluate this, such looking at the power of the filtered series versus the power of the raw price series, targeting a certain % depending on regime. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming one has successfully employed wavelet or other decompositions to yield a smooth, appropriately reactive signal, can take the derivative and use to detect minima and maxima as the price series progresses.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;b&gt;Problems&lt;/b&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;One needs a basis that has &quot;good behavior&quot; at the endpoint so that the slope of the curve at the endpoint projects in an appropriate direction.  &#xA;&lt;/li&gt;&#xA;&lt;li&gt;The basis needs to provide consistent results at the endpoint as the timeseries ticks and not be positionally biased&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, I am not aware of any wavelet basis that avoids the above problems.  There are some other bases that can be chosen that do better.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;b&gt;Conclusion&lt;/b&gt;&#xA;&lt;br/&gt;&#xA;If you want to pursue Wavelets and build trading rules around them, expect to do a lot of research.   You may also find that though the concept is good, you will need to explore other decomposition bases to get the desired behavior. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't use decompositions for trade decisions, but I have found them useful in determining market regime and other backward looking measures.&lt;/p&gt;&#xA;" OwnerUserId="51" LastActivityDate="2011-02-22T01:19:27.890" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="584" PostTypeId="1" CreationDate="2011-02-22T04:37:31.503" Score="5" ViewCount="256" Body="&lt;p&gt;Say for a stock I want to do a simulation using 30 days of historical returns, and maybe generate 1000 paths, with 2 days as the forecast horizon. &#xA;Say I have 100 of these 5 day blocks used for generating the distribution, matched with the actual values of the 2 days I am interested in forecasting. How would I estimate the accuracy of this method of generating a distribution? And what is a method I could use to compare it with a different means of forecasting the distribution? Any suggestions would help.   &lt;/p&gt;&#xA;" OwnerDisplayName="user468" LastActivityDate="2011-03-03T03:38:47.373" Title="estimating the accuracy of a method for forecasting the distribution" Tags="&lt;time-series&gt;" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="585" PostTypeId="2" ParentId="573" CreationDate="2011-02-22T18:22:23.587" Score="9" Body="&lt;p&gt;The main component of that option premium is (forward-looking) volatility $\sigma$.  The very simplest formula you could use for ATM options is the Bachelier model&#xA;\begin{equation}&#xA;\text{Call}_T = \sigma S \sqrt{\frac{T}{2\pi}}&#xA;\end{equation}&#xA;where the time to expiration is $T$ and $S$ is the current underlying price.  This formula is &quot;wrong&quot; strictly speaking, but only by a factor of $\sigma^3T^{\frac32}$ which in your case will be around 5%.  You'll also be ignoring a somewhat smaller error due to nonzero interest rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To obtain $\sigma$ you can work with your available historical data to get a historical volatility.  Historical volatility is not always the very best choice but it is far better here than your current constant price assumption, and it is very simple to calculate:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\sigma_{\text{Hist}} = \sqrt{\frac1{N-1}\sum_{i=1}^N{(r_i-\bar{r})^2}}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the $r_i$ are the periodic returns&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;r_i = \frac{\frac{S_{i+1}}{S_i}-1}{\Delta t_i}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;taken of the underlying $S_i$ at times $t_i$, $\Delta t_i=(t_{i+1}-t_i)$ and $\bar{r}$ is their mean. (The Black-Scholes model would have used log returns instead.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are happy with a crude estimate, you may assume $\bar{r}$ is zero rather than bothering to calculate it.  And for a &lt;em&gt;very&lt;/em&gt; crude estimate of historical volatility, you can instead use&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\sigma_\text{Inaccurate} = \text{Mean}\left[|r_i|\right] \frac1{\sqrt{\text{Mean}\left[\Delta t_i\right]}}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For maximum accuracy, you would of course want to use the Black-Scholes model.  But frankly you would have an easier time finding the requisite historical option prices than you would finding a historical time series of forward-looking (implied) Black-Scholes volatilities.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-02-22T18:22:23.587" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="586" PostTypeId="2" ParentId="554" CreationDate="2011-02-22T20:38:54.970" Score="4" Body="&lt;p&gt;One way of thinking about the problem is with a statistical factor model.  Consider the two cases:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You have more assets than time points&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In this case if you accept enough factors, then there is no idiosyncratic risk.  But there will be idiosyncratic risk if you restrict the number of factors.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You have more time points than assets&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In this case even if you accept as many factors as there are assets, you will in general have idiosyncratic risk as well.  In order for your hypothesis to be true (over the time period of the data), there would need to be no idiosyncratic risk visible in this case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't see a good way of testing the hypothesis, but it doesn't seem like a realistic possibility to me.  I think a more reasonable hypothesis is that the distribution of idiosyncratic risk is [smaller, more skewed, ...] in time frame X relative to time frame Y.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Such hypotheses can be tested reasonably by estimating factor models in the two periods.  Use the same number of factors in each period and then plot the densities of idiosyncratic risks.  And probably try a few different choices of the number of factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could bootstrap to get a sense of how variable the idiosyncratic distributions are.&lt;/p&gt;&#xA;" OwnerUserId="249" LastEditorUserId="249" LastEditDate="2011-02-23T08:22:06.960" LastActivityDate="2011-02-23T08:22:06.960" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="587" PostTypeId="2" ParentId="584" CreationDate="2011-02-22T21:20:24.970" Score="1" Body="&lt;p&gt;Compare the density and cumulative density function or your forecast volatility and of the realized volatility&lt;img src=&quot;https://i.stack.imgur.com/TFExE.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="471" LastEditorUserId="471" LastEditDate="2011-02-24T23:47:07.247" LastActivityDate="2011-02-24T23:47:07.247" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="588" PostTypeId="1" CreationDate="2011-02-23T05:16:15.610" Score="9" ViewCount="517" Body="&lt;p&gt;How does one calculate the implied liquidity of a specific option contract given a set of vanilla puts and calls with various strikes and maturities on a single underlying?&lt;/p&gt;&#xA;" OwnerUserId="214" LastEditorUserId="1106" LastEditDate="2011-09-09T18:11:53.053" LastActivityDate="2011-09-09T18:11:53.053" Title="How do you calculate the implied liquidity of an option?" Tags="&lt;options&gt;&lt;liquidity&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="589" PostTypeId="2" ParentId="588" CreationDate="2011-02-23T12:20:19.113" Score="7" Body="&lt;p&gt;From &lt;em&gt;&lt;a href=&quot;https://perswww.kuleuven.be/~u0009713/ImpliedLiquidity.pdf&quot; rel=&quot;nofollow&quot;&gt;Implied Liquidity : Towards stochastic liquidity modeling and liquidity trading&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We will call the parameter, ﬁtting&#xA;  the bid-ask spread (under a symmetric&#xA;  distortion) around the mid price, the&#xA;  implied liquidity parameter. Hence for&#xA;  the European Call option (strike K and&#xA;  maturity T ) with given market bid (b)&#xA;  and ask (a) prices, the implied&#xA;  liquidity parameter is the speciﬁc λ &gt;&#xA;  0, such that:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;a = − exp(−rT )Eλ [−(ST − K )+ ] and b&#xA;  = exp(−rT )Eλ [(ST − K )+ ]&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="471" LastActivityDate="2011-02-23T12:20:19.113" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="590" PostTypeId="1" AcceptedAnswerId="591" CreationDate="2011-02-23T15:36:54.537" Score="7" ViewCount="469" Body="&lt;p&gt;So this is a &amp;quot;work homework&amp;quot; question. As part of my job they are sending us through sort of a training course. I'm looking for advice, or a link to a site that explains how to do this with maybe some formulas or something. I am NOT looking for answers. I want to figure this stuff out myself, I just need a little guidance.&lt;/p&gt;&#xA;&lt;p&gt;Here is the question:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;Given Information&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;3-month Libor 1.85%&lt;/p&gt;&#xA;&lt;p&gt;6-month Libor&#xA;1.94625%&lt;/p&gt;&#xA;&lt;p&gt;12-month Libor 2.06%&lt;/p&gt;&#xA;&lt;p&gt;Find the following:&lt;/p&gt;&#xA;&lt;p&gt;3-month Libor 3 months forward&lt;/p&gt;&#xA;&lt;p&gt;6-month&#xA;Libor 6 months forward&lt;/p&gt;&#xA;&lt;p&gt;3-month Libor 6&#xA;months forward&lt;/p&gt;&#xA;&lt;p&gt;3-month Libor 9 months&#xA;forward&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;ASSUMPTION&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Assume 30/360 day count and even quarterly periods&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Thanks guys.&lt;/p&gt;&#xA;" OwnerUserId="318" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2011-02-24T04:04:31.870" Title="Need advice on finding forward spot rates" Tags="&lt;futures&gt;&lt;interest-rates&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="591" PostTypeId="2" ParentId="590" CreationDate="2011-02-23T17:35:31.270" Score="4" Body="&lt;p&gt;If you are looking for good explanation with example than you may want to consider reading Jim Harper aka Bionic Turtle and his article  on &lt;a href=&quot;http://www.bionicturtle.com/how-to/article/forward_rates_and_spot_rates/&quot; rel=&quot;nofollow&quot;&gt;forward rates and spot rates&lt;/a&gt;. You can find excel spreadsheet for given example there as well.&lt;/p&gt;&#xA;" OwnerUserId="15" LastActivityDate="2011-02-23T17:35:31.270" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="592" PostTypeId="2" ParentId="584" CreationDate="2011-02-23T20:04:04.523" Score="1" Body="&lt;p&gt;Seems like you are interested in the forecast error&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Forecasting&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Forecasting&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With regard to distribution, I would also look at the mean forecast error.  A good model with have a mean error = 0, since it is not bias upward or downward.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Ralph Winters&lt;/p&gt;&#xA;" OwnerDisplayName="user474" LastActivityDate="2011-02-23T20:04:04.523" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="593" PostTypeId="1" AcceptedAnswerId="621" CreationDate="2011-02-23T21:12:23.220" Score="12" ViewCount="770" Body="&lt;p&gt;As of right now, the price of Brent Crude is $\$$111.59/bbl and the price of WTI Crude is $\$$98.36/bbl.   I'm well aware that futures markets don't set the spot price for oil, but actual supply/demand does.   And, that I don't have access to enough refinery/supplier data to figure out the supply/demand balance for WTI, or the supply/demand balance for Brent.   However, common sense says this mismatch in price will eventually close.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is anyone making any kind of bet on this situation?   If so, could you share a general description of how you're controlling risk?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit (03/01/2011): For future reference, below is a graph of the spread:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/lZfsj.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="392" LastEditorUserId="20795" LastEditDate="2018-01-26T22:02:18.510" LastActivityDate="2018-01-26T22:02:18.510" Title="Price of Brent versus West Texas Intermediate" Tags="&lt;risk&gt;&lt;futures&gt;&lt;commodities&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="594" PostTypeId="1" CreationDate="2011-02-23T21:24:11.223" Score="17" ViewCount="1213" Body="&lt;p&gt;I am wondering how UBS hedges its exposure to its ETN XVIX. Unless I am grossly overestimating the trading costs, executing the strategy they describe in their prospectus with futures would be quite expensive, especially since they would incur some slippage (back months are not super liquid).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas on how they do it? Do they have some way to reduce the amount of trades they have to execute in order to track the indices they base their strategy on (SP indices)?&lt;/p&gt;&#xA;" OwnerUserId="290" LastEditorUserId="35" LastEditDate="2012-09-20T16:16:10.277" LastActivityDate="2012-09-20T18:08:23.297" Title="How does UBS hedge its exposure to XVIX ETN?" Tags="&lt;vix&gt;&lt;hedging&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="595" PostTypeId="2" ParentId="593" CreationDate="2011-02-23T21:42:04.503" Score="1" Body="&lt;p&gt;A significant portion of the price difference between different types of oil futures has to do with whether their sulfur content(heavy, light, sweet).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If supply and demand for each are in equilibrium they should not have the same price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, both brent and wti are light, but brent is not as light as wti (brent has more sulfur).  More sulfur, means more loss in refining, which means that the equilibrium price of the heavier, brent, is higher than wti.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fact that the prices are contango-ed suggests a demand imbalance in brent... perhaps produced by the fact that there are supply concerns(opec basket) stemming from the political crisis in libya.  Libyan oil(opec basket) is not technically brent, but lack of supply there can contribute to a demand surge in brent.&lt;/p&gt;&#xA;" OwnerUserId="214" LastEditorUserId="310" LastEditDate="2011-02-26T18:16:16.573" LastActivityDate="2011-02-26T18:16:16.573" CommentCount="5" ContentLicense="CC BY-SA 2.5" />
  <row Id="596" PostTypeId="2" ParentId="594" CreationDate="2011-02-23T21:50:18.077" Score="6" Body="&lt;p&gt;The key in vix based etn's, or any exotic etf/etn in general is the tracking error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Compared to the spot vix (or short spot vix), even considering the long-short term structure features that xvix has, the tracking error is going to be nontrivial.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even leveraged equity basket etfs have terrible tracking error.&#xA;The exotics are even worse...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just compare a return series over a month or more. A lot of times, even a few days will make the tracking error issue clear.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In vix one of the reasons is that there isn't a perfect hedge for them, so traders use S&amp;amp;P500 options as a proxy.  This lowers the liquidity burden, but increases the tracking error.&lt;/p&gt;&#xA;" OwnerUserId="214" LastEditorUserId="131" LastEditDate="2011-03-08T03:36:47.177" LastActivityDate="2011-03-08T03:36:47.177" CommentCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="597" PostTypeId="2" ParentId="590" CreationDate="2011-02-24T04:04:31.870" Score="2" Body="&lt;p&gt;Another good resource is &quot;Investment Science&quot; by David Luenberger (chapter 4).  I'm actually doing &quot;school homework&quot; on the subject right now.  I'm guessing you'll find this book good for future assignments as well.&lt;/p&gt;&#xA;" OwnerUserId="475" LastActivityDate="2011-02-24T04:04:31.870" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="598" PostTypeId="1" CreationDate="2011-02-24T14:15:50.677" Score="9" ViewCount="854" Body="&lt;p&gt;Recently I have been looking at pair trading strategies from a cointegration perspective, as described in chapter 5 of Carol Alexander's &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470998016&quot;&gt;Market Risk Analysis volume 2&lt;/a&gt;. As most quantitative finance texts the science is well explained, but the description of applications is a bit on the light side.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Theoretically it's pretty straightforward and easy to run the tests for a given time period to see whether a certain pair is likely to be conintegrated or not. To apply the theory to an actual pairs trade however, I would like to add the time dimension to my parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I simply model the spread as $residuals = y - \alpha - \beta x$, the first thing I'd like to know is the mean and variance of the residuals. In order to setup my bid/ask limits I must have a mean and some measure of the variance. In an ideal case the two would be stable, but how can I quantify this and incorporate the information into the model? Also, how can I make this analysis structural, rather than having to depend on subjective eye-balling of data? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anyone point me in the right direction here? My guess is that I should take a look at regime switching models. But since that topic is unknown to me, I'd appreciate very much if someone could give some pointers so I can avoid the worst pitfalls.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Perhaps I wasn't clear enough, but my question is not how to do the tests, it's how can do can I quantify the stability of the parameters, i.e., the mean and variance of the spread?&lt;/p&gt;&#xA;" OwnerUserId="478" LastEditorUserId="478" LastEditDate="2011-02-25T04:12:34.597" LastActivityDate="2011-07-24T02:09:22.413" Title="How do I incorporate time-variability in a pair trading framework?" Tags="&lt;time-series&gt;&lt;cointegration&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="599" PostTypeId="2" ParentId="598" CreationDate="2011-02-24T19:16:03.060" Score="3" Body="&lt;p&gt;If you're using R and would like a few examples, here's Paul Teetor's website:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://quanttrader.info/public/&quot; rel=&quot;nofollow&quot;&gt;http://quanttrader.info/public/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And, Ernie Chan's website:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://epchan.blogspot.com/&quot; rel=&quot;nofollow&quot;&gt;http://epchan.blogspot.com/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Energy pairs:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://statistik.ets.kit.edu/download/doc_secure1/ptem342v144techreport.pdf&quot; rel=&quot;nofollow&quot;&gt;http://statistik.ets.kit.edu/download/doc_secure1/ptem342v144techreport.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="392" LastActivityDate="2011-02-24T19:16:03.060" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="600" PostTypeId="2" ParentId="598" CreationDate="2011-02-24T19:18:15.130" Score="2" Body="&lt;p&gt;I assume your 'x' and 'y' are prices and so 'residuals' also is in currency units.  If so, then I would make a vector of the returns of 'residuals'.  This gives you some (reasonably) independent observations on the process.  Then you could do some rolling means and rolling standard deviations to look for patterns that might help you or trip you up.&lt;/p&gt;&#xA;" OwnerUserId="249" LastActivityDate="2011-02-24T19:18:15.130" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="601" PostTypeId="1" CreationDate="2011-02-25T07:28:48.990" Score="9" ViewCount="1481" Body="&lt;p&gt;A convertible bond denominated in USD is issued by an Indian company (with equity traded in INR). The bond will be repaid in USD and if converted into equity in the company, the conversion price will be based on a pre-determined fixed USD/INR rate. When valuing the option embedded in the bond, should we use the USD risk-free rate or INR risk-free rate?&lt;/p&gt;&#xA;" OwnerDisplayName="user480" LastEditorUserId="1106" LastEditDate="2011-12-06T21:53:01.033" LastActivityDate="2011-12-06T21:53:01.033" Title="Which risk-free rate to use to price a bond issued in one currency but convertible into equity in another?" Tags="&lt;option-pricing&gt;&lt;interest-rates&gt;&lt;embedded-options&gt;&lt;convertible-bond&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="602" PostTypeId="1" CreationDate="2011-02-25T13:35:20.350" Score="14" ViewCount="838" Body="&lt;p&gt;On a security by security basis, I want to be able to quantify the level of HFT activity (and later institutional &amp;amp; retail activity). Is it higher than it normally is? How much so?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What would you say is the best way to measure? Number of quotes? # of quotes relative to volume? Relative to # of trades? Spread volatility? Reversals after block prints?&lt;/p&gt;&#xA;" OwnerUserId="483" LastEditorUserId="1355" LastEditDate="2011-09-08T15:27:48.157" LastActivityDate="2011-09-08T15:27:48.157" Title="What is the most effective way of determining &amp; measuring the level of HFT activity in a stock in (close to) real time?" Tags="&lt;high-frequency&gt;&lt;limit-order-book&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="603" PostTypeId="1" AcceptedAnswerId="611" CreationDate="2011-02-25T14:36:51.097" Score="22" ViewCount="24950" Body="&lt;p&gt;The answers to &lt;a href=&quot;https://quant.stackexchange.com/questions/20/what-type-of-analysis-is-appropriate-for-assessing-the-performance-time-series-fo&quot;&gt;this question on forecast assessment&lt;/a&gt; suggest that if the sequence of residuals from the forecast are not properly independent, then the model is missing something and further changes should be made to remove the correlation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That does make sense to me and it suggests that we should be able to do better than a simple GARCH(1,1) model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in almost all the literature on the subject, this issue is never discussed, and the fact that forecasts produced residuals that are serially correlated is taken as a fact of life. Indeed, people have produced methods for accounting for both serial and contemporaneous correlations when comparing different forecast models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, why is this the case? If the GARCH(1,1) model does have such problems, why is it still considered a standard approach for modeling volatility?&lt;/p&gt;&#xA;" OwnerUserId="61" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2019-10-09T16:10:56.450" Title="Why are GARCH models used to forecast volatility if residuals are often correlated?" Tags="&lt;volatility&gt;&lt;time-series&gt;&lt;forecasting&gt;&lt;best-practices&gt;" AnswerCount="5" CommentCount="4" FavoriteCount="13" ContentLicense="CC BY-SA 2.5" />
  <row Id="604" PostTypeId="2" ParentId="406" CreationDate="2011-02-25T14:40:01.157" Score="6" Body="&lt;p&gt;Thanks gappy for your precise response. However the answer to this auto-correlation is much more important than an academic discussion of which portfolio performance ratio is best. Auto-correlation distorts max draw-down calculations raising the question of whether the (positive) auto-correlation will continue in the future producing large draw-downs, or whether it will subside to normally low levels. [ Incidentally I have never seen a negative auto-correlation in real-world monthly publicly traded asset returns.]   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example take two MLP's: the well known and large cap KMP ( a pipe-line operator) and NRGY ( a mid-cap retail propane distributor.)  On data (post Lehman) from 2/2009 to 2/2011 KMP's monthly returns are not auto-correlated, while NRGY's are highly correlated. The two Calmar ratios are: KMP= 0.1304 (StndErr=0.009); NRGY = 0.1472 (StndErr=0.25), i.e. risk-adjusted returns for the 2 assets are statistically equivalent. But if NRGY's auto-correlation is expected to subside then it's past mdd is overstated and it will be a better risk-adjusted investment than KMP in the future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've done some research and have been able to calculate the theoretical maxdd's for 2 models: No auto-correlation ( the much more difficult calculation) and complete auto-correlation($\rho=1$) for a no drift, normal dist. vol model, Irrespective of the size of the returns and volatility, $\rho=1$ $mdd / \rho=0$ mdd is 4.35 - - - a large difference! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words if period (e.g. monthly ) returns are auto-correlated you can expect a future maxdd of 4.35 times that for a normal- no auto-correlation return within the same horizon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Auto-correlation of returns can appear in low-volume traded assets, Hedge funds,&#xA;Preferred stocks, etc. In common stocks it occurs in high-momentum assets.  In all cases of auto-correlation, BEWARE, the maxdd's will be large.  There is an easy test to determine if the returns are auto-correlated: the Ljung-Box test (Please Gappy correct my misspelling of the names if incorrect.) I have a simple R script to calculate the LB if anyone is interested.&lt;/p&gt;&#xA;" OwnerUserId="345" LastEditorUserId="1106" LastEditDate="2011-09-25T21:04:45.910" LastActivityDate="2011-09-25T21:04:45.910" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="605" PostTypeId="2" ParentId="602" CreationDate="2011-02-25T15:57:13.907" Score="5" Body="&lt;p&gt;A simple way to do this with the TAQ database (Nasdaq trade and quote) is to measure the amount of time between a quote update and a trade inside that quote.  The shorter that time, the higher probability HFT is present.&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-02-25T15:57:13.907" CommentCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="606" PostTypeId="2" ParentId="601" CreationDate="2011-02-25T16:44:54.603" Score="2" Body="&lt;p&gt;The answer is, that it does not matter.  Choose one currency as the numeraire, and stick to it.  This is because of the foreign exchange interest rate carry arbitrage relationship.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that relationship doesn't hold, skip the bond and lock-in the arbitrage on the interest rate differential embedded in the USD/INR exchange rate.&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-02-25T16:44:54.603" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="607" PostTypeId="2" ParentId="602" CreationDate="2011-02-25T16:51:07.627" Score="8" Body="&lt;p&gt;You won't know who made the trade, so you'll need to look at the quotes. Specifically, you should look to see if there are a lot of cancellations in the full order book. That will tell you if there's higher &quot;churn&quot; for a particular stock since HTFs often have low fill ratios (&amp;lt;1% for some shops). But you'll need to control for volatility since wild market swings in general will cause market makers to pull their quotes.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-02-25T16:51:07.627" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="608" PostTypeId="1" CreationDate="2011-02-25T18:58:25.430" Score="9" ViewCount="812" Body="&lt;p&gt;I think I've found an arbitrage opportunity. Right now, I can do this&#xA;(first via CME, second via SAXO) :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BUY CADUSD AMERICAN PUT 10200 STRIKE EXPIRING 16 MAR 2011 FOR 53 pips USD&lt;/p&gt;&#xA;&#xA;&lt;p&gt;SELL USDCAD EUROPEAN CALL 0.9805 STRIKE EXPIRING 16 MAR 2011 FOR 68 pips CAD&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first trade costs me 530 USD, the second one gives me 680 CAD,&#xA;for a net profit of 163.52 USD (assuming USDCAD at 0.9805). Now:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;If USDCAD decreases (meaning CADUSD increases), both options &#xA;expire worthless. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If USDCAD increases (meaning CADUSD decreases), it appears that my &#xA;long put gains value faster than my short call (just barely, due to &#xA;the currency difference). &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Is there something I'm not seeing here? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, the prices I'm seeing might not be tradeable, and there are &#xA;some minor expiration date issues, but, assuming I could do this, is &#xA;it arbitrage? &lt;/p&gt;&#xA;" OwnerDisplayName="user59" LastActivityDate="2011-02-26T16:23:42.877" Title="USDCAD options vs CADUSD options arbitrage?" Tags="&lt;arbitrage&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="609" PostTypeId="2" ParentId="601" CreationDate="2011-02-25T19:01:36.257" Score="3" Body="&lt;p&gt;Use the USD rate.  The actual tricky bit is in the volatility.  Normally for a cross currency bond you would use the volatility of the foreign shares as denominated in US currency.  However, the fixed FX rate in this case means that the correct volatility to use is the  volatility in INR.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-02-25T19:01:36.257" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="610" PostTypeId="2" ParentId="603" CreationDate="2011-02-25T19:08:14.190" Score="11" Body="&lt;p&gt;GARCH(1,1) is a &quot;standard approach for modeling volatility&quot; mainly in academic literature.  Most of us in the real world don't use it.  Volatility forecasting tends to come more from looking at more-liquid comparables for future market volatility than from fitting fancy retrospective models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for ignoring the dependence of residuals, well, folks are probably considering the problem to be less nettlesome than problems introduced by trying to fit complex models with too many parameters.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-02-25T19:08:14.190" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="611" PostTypeId="2" ParentId="603" CreationDate="2011-02-25T22:00:32.437" Score="15" Body="&lt;p&gt;One of the reasons the ARCH family of models is used is that you only need price data to generate the model. These data exist back to the 1800s, so ARCH is great for looking at volatility over very long periods. I don't know that I'd say that the ARCH model has a lot of problems -- it solved the problem of not allowing volatility in time or in the level of the underlying process. &lt;a href=&quot;http://nobelprize.org/nobel_prizes/economics/laureates/2003/engle-lecture.pdf&quot;&gt;It allowed Robert Engle to put to rest Milton Friedman's idea that inflation uncertainty varied with inflation level and won Engle the Nobel Prize&lt;/a&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I agree with Brian that there are probably better volatility forecasts. ARCH models are necessarily based in the past, not in expectations. I think I would look first at implied volatility from options. Using implied volatility from options will also allow to forecast higher moments like skew and kurtosis.&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-02-25T22:00:32.437" CommentCount="5" ContentLicense="CC BY-SA 2.5" />
  <row Id="612" PostTypeId="2" ParentId="530" CreationDate="2011-02-26T05:04:37.713" Score="6" Body="&lt;p&gt;DSP and Time Series analysis are the same thing. DSP uses enginering &quot;lingo&quot; and time series analysis uses mathematical &quot;lingo&quot; but the models are quite simular. Ehler's cyber cycle indicator is an ARMA(3,2). Ehlers has some unique ideas: What is the meaning of the phase of a random variable?&lt;/p&gt;&#xA;" OwnerDisplayName="user487" LastActivityDate="2011-02-26T05:04:37.713" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="613" PostTypeId="1" AcceptedAnswerId="619" CreationDate="2011-02-26T05:55:05.937" Score="30" ViewCount="32765" Body="&lt;p&gt;I was wondering what is best practice for representing elements in a time series, especially with large amounts of data. The focus/context is in a back testing engine and comparing multiple series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems there are two options:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Using an integer index, or&lt;br&gt;&#xA;2) Using a date-based index&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the moment I am using dates, but this impacts on performance &amp;amp; memory usage in that I am using a hash table rather than an array, and it requires some overhead in iteration (either forward or backwards) as I have to determine the next/previous valid date before I can access it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it does let me aggregate data on the fly (e.g. building the ohlc for the previous week when looking at daily bars) and most importantly for me allows me to compare different series with certainty I am looking at the same date/time. If I am looking at an equity issue relative to a broader index, and say the broader index is missing a few bars for whatever reason, using an integer indexed array would mean I'm looking at future data for the broad index vs present data for the given security. I don't see how you could handle these situations unless you're using date/times. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using integer indexes would be a lot easier code wise, so I was just wondering what others are doing or if there is best practice with this. &lt;/p&gt;&#xA;" OwnerUserId="489" LastEditorUserId="1106" LastEditDate="2011-08-23T01:26:13.320" LastActivityDate="2016-12-02T01:33:56.303" Title="What is the best data structure/implementation for representing a time series?" Tags="&lt;data&gt;&lt;time-series&gt;&lt;market-data&gt;" AnswerCount="8" CommentCount="4" FavoriteCount="27" ContentLicense="CC BY-SA 3.0" />
  <row Id="614" PostTypeId="1" CreationDate="2011-02-26T14:25:55.197" Score="4" ViewCount="654" Body="&lt;p&gt;I make money selling covered calls on FX spot options, and some of my &#xA;friends want to buy in to this without having to trade their own &#xA;accounts. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One method is for each of them to get an account, and have me trade &#xA;it, but that doesn't scale well: I really don't want to be trading 10 &#xA;accounts. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other method is to let them &quot;buy in&quot; to my account. My question: &#xA;how do I determine what &quot;portion&quot; of my account someone owns, assuming &#xA;many people (including myself) deposit and withdraw money? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a better way of doing this? What if I charge my friends a &#xA;small fee to trade? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm guessing the answer is well known, since hedge funds/mutual funds &#xA;have to deal with this all the time. &lt;/p&gt;&#xA;" OwnerDisplayName="user59" LastActivityDate="2011-03-30T18:51:56.940" Title="Hedgefund-like behavior for covered call selling account?" Tags="&lt;options&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="615" PostTypeId="2" ParentId="614" CreationDate="2011-02-26T16:03:32.667" Score="1" Body="&lt;p&gt;treat it like a hedgefund(limited partnership)&#xA;think of your account as a corporation.&lt;br&gt;&#xA;assign a number shares to your account's netliquidating value(equity).&#xA;let your friends buy a given number of shares at a given price.&#xA;take your fee out and treat it as a cost to the fund that lowers the equity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Repeat this process as you take in new money, or when u distribute profits/return funds.&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-02-26T16:03:32.667" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="616" PostTypeId="2" ParentId="14" CreationDate="2011-02-26T16:08:41.727" Score="4" Body="&lt;p&gt;Quoting prices in delta makes it easier for a trader to delta hedge their portfolio.&#xA;(The trader knows teh delta they are trying to add or cut, so the price quoted in delta gives them the contract qty that they need to trade quickly, without needing a calculator, let alone a pricing model) &lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-02-26T16:08:41.727" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="617" PostTypeId="2" ParentId="613" CreationDate="2011-02-26T16:19:58.780" Score="8" Body="&lt;p&gt;It's usually more efficient to have timeseries objects located sequentially in contiguous memory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A hashtable doesn't provide this.  As good as it is, from a complexity standpoint, it's not faster than a fixed array when accessing items in a [i+1] or [i-lag]  kind of operation that is typical in timeseries code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(For the most part you can estimate the array size needed to do timeseries before you start your operate, so array resizing operations can be optimized out.)&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-02-26T16:19:58.780" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="618" PostTypeId="2" ParentId="608" CreationDate="2011-02-26T16:23:42.877" Score="1" Body="&lt;p&gt;the difference in the expiration dates is enough to explain the source of what appears to be arbitrage. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given that there is a difference, it's not abritrage(riskless profit) because there is risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, that doesn't mean that you can't make money doing thsi trade.  It just means that you might lose  as well(not riskless).&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-02-26T16:23:42.877" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="619" PostTypeId="2" ParentId="613" CreationDate="2011-02-27T10:44:07.397" Score="25" Body="&lt;p&gt;Representing time series (esp. tick data) using elaborate data structures may be not the best idea.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may want to try to use two arrays of the same length to store your time series. The first array stores values (e.g. price) and the second array stores time. Note that the second series is monotonically increasing (or at least non-decreasing), i.e. it's sorted. This property enables you to search it using the binary search algorithm. Once you get an index of a time of interest in the second array you also have the index of the relevant entry in the first array. If you wrap the two arrays and the search algorithm e.g. in a class you will have the whole implementation complexity hidden behind a simple interface.&lt;/p&gt;&#xA;" OwnerUserId="493" LastEditorUserId="-1" LastEditDate="2016-12-02T01:33:56.303" LastActivityDate="2016-12-02T01:33:56.303" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="620" PostTypeId="1" CreationDate="2011-02-28T07:51:08.480" Score="21" ViewCount="5180" Body="&lt;p&gt;I was trying to build a options trading/optimization system. But it often gets more inaccurate as it scans through the far from ATM options because, you know, options skews. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is because I did not price in options skews, or jump premium. I am wondering if there is a popular formula that takes &lt;strong&gt;&lt;em&gt;&quot;degree of options skew&quot;&lt;/em&gt;&lt;/strong&gt;, and either &lt;em&gt;strike price&lt;/em&gt; or &lt;em&gt;Delta&lt;/em&gt; as inputs, and then give me &lt;strong&gt;&lt;em&gt;skews premium&lt;/em&gt;&lt;/strong&gt; in terms of IV as output.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much.&lt;/p&gt;&#xA;" OwnerUserId="496" LastActivityDate="2017-09-12T21:39:39.793" Title="Is there a popular curve fitting formula of options skew vs strike price or vs Delta?" Tags="&lt;options&gt;&lt;skew&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="11" ContentLicense="CC BY-SA 2.5" />
  <row Id="621" PostTypeId="2" ParentId="593" CreationDate="2011-02-28T10:34:32.773" Score="5" Body="&lt;p&gt;If I were you I would be very cautious when playing this mean reversion. For several reasons.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1/ You never know when this spread is going to close, and the contracts on which you enter the trade may have expired. Then you would have rolled. In fact the arbitrage can close without any opportunity to capture it because of the roll yield. &#xA;I advise you to play directly on the backend of the curve if you can find contracts that are liquid enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2/ The cointegration between daily close prices of WTI and Brent is strong but the mean reverting process may be very slow to move. I would not play this &quot;statistical&quot; arbitrage. High frequency ok, but with daily prices... is it really statistically meaningful?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the price of a basket which is long WTI and short brent for the same maturity. Do you see any mean reversion?&#xA;&lt;img src=&quot;https://i.stack.imgur.com/6m62T.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="134" LastEditorUserId="134" LastEditDate="2011-03-04T01:59:12.327" LastActivityDate="2011-03-04T01:59:12.327" CommentCount="5" ContentLicense="CC BY-SA 2.5" />
  <row Id="622" PostTypeId="2" ParentId="620" CreationDate="2011-02-28T15:51:49.670" Score="16" Body="&lt;p&gt;There have been many studies of the shape of volatility skew.  There are two simple empirical approaches that have proven most popular:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Spline (or piecewise polynomial) fits of observable implied vols&lt;/li&gt;&#xA;&lt;li&gt;Parabolic parametric fits.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;and there is one other approach that is fairly simple yet reliable:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Edgeworth expansions&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Other empirical approaches also exist, of course, but quickly become unwieldy mathematically, computationally, and for calibration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The overall process is as follows:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Choose a function, such as a parabola, that you will use to represent skew and code it into the computer&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Choose some input volatilities you trust&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use them in a fitting scheme to calibrate the parameters (tilt and curvature) of your skew.  That is, you find parameters such that your chosen function does the best possible job of reproducing your input volatilities.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use your fitted function to estimate volatilities anywhere on the skew curve.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Sometimes, if data is particularly bad, you can copy tilt and curvature parameters from one fitted curve onto another curve where you have very little input data available.  Exercise caution when you do this!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fits are typically constrained such that the parabola (or other function) cannot dip below zero for any &quot;reasonable&quot; strike.  This is hard to achieve with linear fits, which is one major reason why parabolas are more popular.  Fits also often have &quot;cutoffs&quot; where volatility is assumed to be constant for strikes above (or below) certain extreme values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For all such fits, one usually uses existing mathematical libraries and routines (many of which are simple copies of the serviceable code found in Numerical Recipes).  You can get spline libraries, and you can fit parabolas using any linear algebra library that has a routine for ordinary least squares.  See &lt;a href=&quot;http://mathworld.wolfram.com/LeastSquaresFittingPolynomial.html&quot; rel=&quot;noreferrer&quot;&gt;this site&lt;/a&gt; for more information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edgeworth expansions are in the family of skew treatments that consider skew as a symptom of non-lognormal returns, and try to represent a non-lognormal distribution in some concise way.  A decent place to start learning about them is Rubinstein's paper at &lt;a href=&quot;http://www.haas.berkeley.edu/groups/finance/WP/rpf275.pdf&quot; rel=&quot;noreferrer&quot; title=&quot;Edgeworth Expansions&quot;&gt;this location&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The real trick for any of these fits is choosing a weighting scheme.  Typically, you will prefer to weight some input volatilities more than others.  For example, most people believe the out-of-the-money put and call prices contain the best information.  Others concentrate on weighting the near-the-money options, often by weighting according to the gamma.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2015-07-06T13:17:33.333" LastActivityDate="2015-07-06T13:17:33.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="623" PostTypeId="2" ParentId="406" CreationDate="2011-02-28T19:12:48.520" Score="3" Body="&lt;p&gt;Have you considered a Monte Carlo simulation on your returns?  Then you could look at the distribution of Maximum Drawdowns.&lt;/p&gt;&#xA;" OwnerUserId="520" LastEditorUserId="1106" LastEditDate="2011-09-25T21:02:52.323" LastActivityDate="2011-09-25T21:02:52.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="624" PostTypeId="1" CreationDate="2011-02-28T21:14:10.787" Score="6" ViewCount="753" Body="&lt;p&gt;This is probably not the best place to ask this question but the one that seems most appropriate on stack exchange(doesn't seem to be an economics one).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyways, My question, a serious one and not politically motivated, is about &quot;big oil&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know why we generally see &quot;big oil&quot; have record profits usually in the time of crisis?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only way profits can increase from a business is: Demand increases, product price increases, efficiency increases. I think that is pretty much all and everything else will fall in one of those.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, when oil prices skyrocket(like that have done in the past and are doing now), demand surely decreases? Maybe this is not true because the high demand for oil?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No matter what the cost of the product to the oil companies, if they kept their same profit per barrel there is no way they can have &quot;record profits&quot; no matter what it costs us. So if they always make $\$50$ per barrel it doesn't matter if it costs them $\$10$ or $\$100$ to pull it out of the ground they will make the same profit(since they will pass only those costs to the consumer anyways).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Efficiency increases is really the only one that could technically lead to an increased profit without increasing demand or product cost to consumer. Usually though this costs money to implement though so must be initially offset. In any case we shouldn't see an increase to consumers which we do in these times of &quot;record profit&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For record profit how can we not be increasing how much we make off each barrel if demand is reduced and efficiency is about the same?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What does this say about big oil? Are they really not &quot;gouging&quot; us? Basically if we jump from $\$2.50$ to $\$5.00$ at the pump and they make record profits doesn't that directly imply they are stacking the deck?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can big oil reasonably make &quot;record profits&quot; always at the same time when oil is &quot;hard to get&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Isn't the whole point of supply and demand is that as cost increases it is balanced out by a decrease in demand so the net stays the same? (a sort of zero sum game)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g., if I sell 1 product for $\$1000$ it's the same if I say $1000$ for $\$1$ each(profit in both cases)? Not true in the real world cause you probably going to have to provide additional support for the $1000$ people that you don't for the $1$.&lt;/p&gt;&#xA;" OwnerUserId="501" LastEditorUserId="106" LastEditDate="2011-02-28T21:22:47.897" LastActivityDate="2011-03-02T01:22:26.353" Title="Supply and Demand of Oil" Tags="&lt;economics&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="3" ClosedDate="2011-03-01T13:25:48.520" ContentLicense="CC BY-SA 2.5" />
  <row Id="625" PostTypeId="2" ParentId="624" CreationDate="2011-02-28T21:34:16.550" Score="5" Body="&lt;p&gt;This occurs because the &lt;a href=&quot;http://en.wikipedia.org/wiki/Price_elasticity_of_demand&quot; rel=&quot;noreferrer&quot;&gt;price elasticity of demand&lt;/a&gt; for oil is near zero, which is to say the demand curve is nearly vertical. This is partly a limited rate of production story (i.e., in the short term the rate of oil production is fixed), but it's mostly a limited substitutes story. Our cars run on gas, as do the trucks that move goods around the nation and ships that move good internationally. If I go to the store and the price of Coke rises, then I can buy a Pepsi; if the price of Pepsi rises I can buy an RC; and so on. But if I go to the gas station and the price of gas rises, I can't fill my car with some near substitute, despite being promised a Mr. Fusion for my Delorean. True, we can change our habits, combine trips, car pool, etc., but these are at the margins and it takes time to change habits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So oil companies make money during these times because people are willing to pay a premium to secure access to this good (via futures contracts) that everyone needs.&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-02-28T21:34:16.550" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="626" PostTypeId="2" ParentId="624" CreationDate="2011-03-01T00:37:22.360" Score="4" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;demand surely decreases? Maybe this is not true because the high demand for oil?&lt;/em&gt; &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Demand for oil, like grains, is very inelastic. People have a very hard time changing their energy consumption habits when price shocks happen. Some of this is unwillingness to change, but a lot is that there are very few alternatives. Most people in the US live too far from work to walk or ride a bike; public transportation is non-existant in most parts of the US. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Staple grains, like rice in Asia, or wheat in US, also have extremely inelastic demand curves. When people grow up with a culture of &quot;it isn't a meal unless it has ....&quot; then those people are more likely to riot than change what they eat (see rice riots in 2008, and the current one in Vietnam). We have huge corn (maize) subsidies in the US to prevent reoccurances of the riots and protest marches (in the early 1970s) of farmers and housewives (while that administration had great experience dealing with rioting hippies, they could not figure out how to cope with &quot;good&quot; people rioting). &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;Efficiency increases is really the only one that could technically lead to an increased profit without increasing demand or product cost to consumer. Usually though this costs money to implement though so must be initially offset.&lt;/em&gt;  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The turn-over in the US automobile fleet is close to 10 years. Very few people can afford to purchase a new car when fuel prices change drastically, and it would take a very long time for the automakers to switch to new fuels, fuel stations to switch to new fuels and for consumers to buy new cars. Further compounding this issue are the emotional attachments people have with their car (or the status implied by certain makes and models) which is why most people get fleeced purchasing cars - the salespeople see them coming and know just what buttons to push. The Otto cycle (the thermodynamic cycle used by gasoline engines) is about as efficient as it can be made. Any large improvements in energy consumption for autos won't come from new engines; the only practical improvements are in weight reduction and speed reduction. The failure of the national 55 mph standard shows that we're unwilling as a nation to make the speed reductions needed, and the huge popularity of SUVs shows we won't make the weight reductions needed.  &lt;/p&gt;&#xA;" OwnerUserId="126" LastActivityDate="2011-03-01T00:37:22.360" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="627" PostTypeId="2" ParentId="624" CreationDate="2011-03-01T01:03:35.327" Score="6" Body="&lt;p&gt;The current jump in price is because one or more suppliers are dropping out.   That shifts the supply curve to the left such that for the same demand for oil, the new price is now further up the steeper part of the curve (see the plots below).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The demand for oil will react to that new price, but it takes time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sorry that I don't have a more recent supply curve, however below is an old oil supply curve from 2007/2009 data.    The numbers aren't exactly the same, but the idea still holds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From left to right are the suppliers cost, including internal/political cost, plus profit (the gray curve).   As you can see, Saudi Arabia's costs are the lowest while the cost for &quot;Marginal Suppliers Level 2&quot; are the highest.   When a supplier like Libya drops out, his amount of crude (about 1.XXX million bbl/day) drops out, shifting part of the curve to the left by 1.XXX million bbl/day (the blue curve).  If current demand is above that particular supplier such that he is currently supplying oil, when he drops out, price is pushed upward (on the graph, from about 100 USD/bbl to 120 USD/bbl).   All remaining suppliers (including &quot;big oil&quot;) now make 20 USD/bbl more for their oil.  As a result, their profits go up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The top plot is the complete supply curve.  The bottom plot is the same curve, zoomed in to show the price change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Oj8js.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/c3f5C.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit (03/01/2011)=====================================================&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Archival, quoting your statements:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) &quot;.....Since US oil is higher priced they gain the most?.....&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not true.  Explained below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) &quot;.....Effectively the &quot;big oil&quot; has the &quot;big market&quot; and hence increases in price will effect them more than Saudi Arabia? If this is true then the big oil companies still have control of their profit and could surely reduce their profit to compensate for the increased in price and keep there total profit about the same? Since Lybia is a short term thing it would pass. I'm not saying a business has to do such a thing but it can.....&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not true, Explained below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) &quot;....Suppose &quot;big oil&quot; were to keep there net profit the same this year as, say, last to reduce the price at the pump.....&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Go back and look at various &quot;big oil&quot; Net Income Statements.   Not every year is a profitable year.  If &quot;big oil&quot; becomes unprofitable, we won't be driving what we're currently driving.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) &quot;....How much will it actually reduce it? Would it be drastically different(say 50c or more) or due to the huge market(millions of buyers) it would just be a few cents?....&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can't be done.  If I (you) was a shareholder, I'd (you'd) sue them into the ground.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Archival, you need to pay attention to how supply and demand works and forget about &quot;fairness theories&quot; and &quot;they should do this.....theories&quot; .   If you honestly think &quot;big oil&quot; is making so much money, then couldn't you buy the stock and reap that &quot;big oil money&quot; for yourself?   The deeper you get into the numbers, the more you'll realize why it is the way that it is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I added the following Oil Supply Table to help explain what is going on in the graphs.  This table, when plotted, is the supply curve above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Key Point: On the spot market EVERYONE gets the same selling price.  A barrel of WTI oil is a barrel of WTI oil (or Brent, or whatever grade).   The Low Cost suppliers get the same price as the High Cost suppliers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Column I is the name of the country/group, sorted by Cost (the Cost is all production costs plus &quot;enough&quot; profit to sell the oil).   The first guy in the list has the lowest production Costs.   That Cost shows up as Price in column L.   This Price is the MINIMUM price that particular supplier/group would be willing to accept for his oil.   Obviously, if the current price is higher, they'll take it, but if it's lower, they'll drop out.   Column J tells you how much oil he has for sale, at that price or higher.  This means that the Saudis will sell 10248 Thousand bbl/day for a Price of 28.23 USD/bbl or higher (any lower and they're out).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The next guy in the list is Iran at a Price of 28.24 USD/bbl.   He'll sell up to 4.0 million bbl/day at his Price (28.24 USD/bbl), bringing the cumulative amount of oil available to 14.3 million bbl/day (column K).   So, if demand is between 10.2 and 14.3 million bbl/day, the price would be 28.24 USD/bbl.    That's for EVERYONE that is supplying oil, both Saudi Arabia and Iran (again, a barrel of oil is a barrel of oil).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the above graphs, I started off with Libya still providing oil (the gray curve in both graphs).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the second graph, I chose 83 million bbl/day as the example Total Demand (the red line in the graph).   When you look at column K of the table, ALL SUPPLIERS up to and including the &quot;United States (offshore 26% of total)&quot; will be selling their oil at the going price.  That price is somewhere between 93.57 USD/bbl and 115.66 USD/bbl (the graph is drawn with a linear interpolation between prices).    From the second graph, on the gray curve, it looks like 100 USD/bbl is the going price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, before Libya drops out, to supply 83 million bbl/day of oil, the market (ALL SUPPLIERS up to the required demand) requires about 100 USD/bbl.   Whatever &quot;extra&quot; (above &quot;enough&quot;) profit they make is the difference in the market price and their Cost.   EVERYONE that sells oil into that market gets 100 USD/bbl.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, Libya drops out (everything else is the same).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Column N shows what happens to the Cumulative Production when Libya drops out.    Everything is the same above the pink line.  The cumulative supply available in both column K and N up to Algeria is 78.8 million bbl/day.   However, since demand is 83 million bbl/day, more suppliers are required to fulfill demand.  With Libya out, you have to go all the way up to &quot;Marginal Suppliers (Level 1)&quot; to fulfill demand.    Their Cost is 145 USD/bbl.   From the second graph, on the blue curve, due to interpolation, the going price is now about 120 USD/bbl.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, after Libya drops out, to supply 83 million bbl/day of oil, the market (ALL SUPPLIERS up to the required demand) requires about 120 USD/bbl.   Since this is now 20 USD/bbl higher than before, the profits of ALL SUPPLIERS that are selling oil will jump by 20 USD/bbl.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice that no one manipulated demand or supply, and that the SAME supply curve was used both times.   The only thing that changed was, Libya dropped out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, go back and think about how you would implement ANY kind of &quot;fairness theory&quot; or &quot;they should do this....theory&quot;.   The supply curve is the supply curve.   It depends on the Costs of the suppliers and how many suppliers are available to provide oil.   It's that simple.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/VM6rb.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="392" LastEditorUserId="392" LastEditDate="2011-03-02T01:22:26.353" LastActivityDate="2011-03-02T01:22:26.353" CommentCount="6" ContentLicense="CC BY-SA 2.5" />
  <row Id="628" PostTypeId="1" AcceptedAnswerId="632" CreationDate="2011-03-01T08:57:01.243" Score="8" ViewCount="461" Body="&lt;p&gt;What are the standard methods to price american call/put options on illiquid underlyings?&lt;/p&gt;&#xA;" OwnerUserId="134" LastEditorUserId="134" LastEditDate="2011-03-02T02:44:48.593" LastActivityDate="2011-12-08T04:56:23.207" Title="illiquid american options pricing" Tags="&lt;option-pricing&gt;&lt;liquidity&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="629" PostTypeId="1" AcceptedAnswerId="633" CreationDate="2011-03-01T09:44:48.563" Score="16" ViewCount="1821" Body="&lt;p&gt;If you have a bunch of different econometric data (e.g. indexes, FX, &#xA;commodities, interest rates...) you can try to find a formula to see &#xA;if there is any relationship in the data - e.g. to forecast it by this &#xA;discovered pattern. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I am asking here is a little bit different: Is there another way &#xA;in the sense that you can search for a formula f() such that the given &#xA;form represents a trading strategy where certain indicators are found &#xA;when to go long or short (or any derivative combinations)? The idea is &#xA;that the formula itself lives in n-dimensional space of indicators/ &#xA;trading-strategies and tries to survive as best as it can. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This must be a standard procedure for multi-agent systems simulating artificial stock markets. Alas, I am unable to find a simple approach to do just that...&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2018-01-03T17:32:46.490" Title="How to encode trading strategies mathematically" Tags="&lt;trading-patterns&gt;&lt;data-mining&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="14" ContentLicense="CC BY-SA 2.5" />
  <row Id="631" PostTypeId="1" CreationDate="2011-03-01T12:59:05.893" Score="25" ViewCount="4441" Body="&lt;p&gt;What are the most used/mature/promising commercial solutions today which handle backtesting/ automated trading needs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm talking about vertical product suites like &lt;a href=&quot;http://www.quanthouse.com/?q=node/19&quot;&gt;QuantFactory&lt;/a&gt; or &lt;a href=&quot;http://www.deltixlab.com/&quot;&gt;Deltix&lt;/a&gt; which address market data capture, historical data, CEP, backtesting, trading, etc. (I would be more specifically interested about the backtesting part though.)&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;What are the big players here? &lt;/li&gt;&#xA;&lt;li&gt;Do you have any feedback (pro/cons) about theses solutions?&lt;/li&gt;&#xA;&lt;li&gt;What is the cost of integrating such a solution into an existing ecosystem?&lt;/li&gt;&#xA;&lt;li&gt;Are they customizable enough to handle very specific needs?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I know that sounds like a lot a different questions, but I'm trying to get a general feeling about these tools (are they popular, useful, who use them, for what, etc.)&lt;/p&gt;&#xA;" OwnerUserId="328" LastEditorUserId="274" LastEditDate="2011-03-06T00:07:45.147" LastActivityDate="2012-11-19T21:07:32.823" Title="Main backtesting &amp; trading solutions: QuantFactory, Deltix, etc." Tags="&lt;backtesting&gt;&lt;automated-trading&gt;&lt;software&gt;&lt;trading-systems&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="14" ContentLicense="CC BY-SA 2.5" />
  <row Id="632" PostTypeId="2" ParentId="628" CreationDate="2011-03-01T16:42:30.190" Score="4" Body="&lt;p&gt;For a non-listed company you usually have a poor idea of the share value.  If you do not know the underlying price it is impossible to accurately estimate the option price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, for cases like this, people typically analyze the options on a risk/reward basis, using similar scenario analyses to those used to analyze the cashflows, assets and other components of the firm valuation.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-03-01T16:42:30.190" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="633" PostTypeId="2" ParentId="629" CreationDate="2011-03-01T20:06:21.190" Score="12" Body="&lt;p&gt;Yes, you use an implementation of each signal and then use a statistical package like sas to generate a factor model for you.&#xA;It generates a mathematical formula, with coefficients, and signals(variables) and even tells you the efficacy(R^2)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However you quickly find yourself exposed to data snooping bias by choosing this approach.&#xA;Similar to the results outlined in this paper:&#xA;&lt;a href=&quot;http://www.eco.sdu.edu.cn/jrtzx/uploadfile/pdf/empiricalfinance/10.pdf&quot;&gt;http://www.eco.sdu.edu.cn/jrtzx/uploadfile/pdf/empiricalfinance/10.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Data-snooping bias, is why people stress the economic reasoning for their strategies over the historic statistical efficacy, which often fails to replicate going forward.&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-03-01T20:06:21.190" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="634" PostTypeId="2" ParentId="631" CreationDate="2011-03-01T22:04:17.663" Score="8" Body="&lt;p&gt;Some LinkedIn groups are particularily adequate to post these questions.&#xA;Your question has already been asked in &quot;Automated Trading Strategies&quot; at this URL: &lt;a href=&quot;http://www.linkedin.com/groupItem?view=&amp;amp;gid=1813979&amp;amp;type=member&amp;amp;item=43835799&amp;amp;qid=80b45454-3b0b-461e-8cf9-6f3f6ed31b4c&amp;amp;goback=.gmp_1813979&quot;&gt;Seeking input on QuantFactory, Deltix and 4thStory: Professional end-to-end Automated Trading Solutions&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Feel free to let us know the state of your research.&lt;/p&gt;&#xA;" OwnerUserId="509" LastEditorUserId="35" LastEditDate="2011-03-02T00:30:14.173" LastActivityDate="2011-03-02T00:30:14.173" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="635" PostTypeId="2" ParentId="530" CreationDate="2011-03-02T02:57:31.037" Score="7" Body="&lt;p&gt;The DSP techniques you're referring to are great for repeating signals, but not suitable for random signals (like price movements). While there are some techniques suitable for picking weak signals out of large noise environments (GPS is one that comes to mind), those techniques depend on knowing what the signal looks like, and if you knew what the signal looked like, you'd own the market. &lt;/p&gt;&#xA;" OwnerUserId="126" LastActivityDate="2011-03-02T02:57:31.037" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="636" PostTypeId="1" AcceptedAnswerId="1561" CreationDate="2011-03-02T10:38:42.150" Score="20" ViewCount="9709" Body="&lt;p&gt;Could somebody advise me on where to find good literature on the justification or motivation for using support and resistance lines - and also lines of maximums and minimums. In finance, it is sometimes difficult to find the relevant literature because even if a book does not claim to be able to make you rich, the content of the book can still be bad.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any good literature on support/resistance would be nice.&lt;/p&gt;&#xA;" OwnerUserId="464" LastEditorUserId="1106" LastEditDate="2011-08-08T04:42:10.743" LastActivityDate="2014-06-13T07:06:21.643" Title="Is there any good research on support and resistance?" Tags="&lt;strategy&gt;&lt;research&gt;&lt;technicals&gt;" AnswerCount="4" CommentCount="3" FavoriteCount="17" ContentLicense="CC BY-SA 3.0" />
  <row Id="637" PostTypeId="2" ParentId="594" CreationDate="2011-03-02T16:36:05.810" Score="3" Body="&lt;p&gt;I've been looking around for the holdings of this device, and so far I can't find it listed anywhere.   I'll keep looking, but unless I find something to the contrary, it looks like UBS is your credit risk (if they go down, this thing goes down).   And, remembering Lehman Bros, that possibility is something to think about.&lt;/p&gt;&#xA;" OwnerUserId="392" LastActivityDate="2011-03-02T16:36:05.810" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="638" PostTypeId="2" ParentId="636" CreationDate="2011-03-02T18:37:16.033" Score="17" Body="&lt;p&gt;Below, I see a lot of support and resistance.   Here's the code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x &amp;lt;- cumsum(rnorm(1000))&#xA;plot(x, type=&quot;l&quot;, main=&quot;Support and Resistance&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZIr74.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit (03/03/2011) ================================================&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gortaur, I put my answer here to avoid filling up the comment area.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your question 1) &quot;......I was not asking for the &quot;garbage&quot; literature, I can find it in net by myself........&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason that I posted that article is because it, and a few others, are consistently referenced as &quot;credible proof&quot; that support and resistance, as predicted by certain groups, is a profitable strategy.    As far as I can tell, &quot;credible&quot; comes from the fact that the author worked at FRBNY, not her results.    &quot;Proof&quot; comes from those that accept her results, not from repeating her results.   If you pick at that article long enough, the term &quot;garbage&quot; might just come to mind.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't get me wrong.  Unlike others, I don't think the author was trying to mislead anyone.  I just think that she didn't chew on her methods well enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your question 2) &quot;.......the fact that S&amp;amp;R appear in random walks and the human's eye try to catch it everywhere do not prove the fact that these notions are meaningless in real life where prices are NOT random walks and random walks are just model to simplify dynamics and don't care about the game theory part of the question (because the system is too huge)........&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you run that (or similar) code over and over, and count the plots without &quot;support&quot; and/or &quot;resistance&quot;, you might not get to 1.   If it's that close to 100% of the time, how can you tell the difference between S&amp;amp;R that is random and S&amp;amp;R that isn't?   And, if both the random series and the real series &quot;bounce&quot; off of some arbitrary lines, does it really have to mean something (more importantly, in the random case, you know it doesn't mean anything)?   My point is really simple.    By the time you devise a test that means something, and then run real data through it, you might find that you can't tell when random data has been passed through it.   If so, then you're back to square one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You don't have to believe me, try it yourself.  As a place to start, go to .pdf page 8 in that article and look at the test (Calculating Artificial S&amp;amp;R Levels).   Draw what is described, for a few days worth of data.   Then ask yourself, could you come up with some S&amp;amp;R lines that will beat her test?   If so, does her test mean anything?   And, if you use your method of beating her test as your test, can it provide a way for you to differentiate random versus non-random results?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit (03/04/2011) ==========================================&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gortaur, from your comment below,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;....If you just use logics - then what are you trying to say? A = {for the random data there is smth which looks like S&amp;amp;R}. B = {S&amp;amp;R can be used to analyze random data}. A-&gt;B = false -&gt; what is looking like S&amp;amp;R in random data is not S&amp;amp;R (at least like a tool for analysis). On the other hand, you are trying to use this fact to prove that there is no S&amp;amp;R (like a tool for analysis) for the non-random data. I don't think that it is right.....&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure that I understand your questions, but here goes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By using S&amp;amp;R levels, aren't you trying to react to something that the market is actually doing, something meaningful?   For instance....a bunch of people/money want to buy at support and sell at resistance?  The idea is that something meaningful and non-random is happening at areas of S&amp;amp;R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is, a random process will consistently generate lots and lots of S&amp;amp;R levels, and you can be 100% sure that those S&amp;amp;R levels mean absolutely nothing.   Think about it, how can a random process NOT turn and go the other way?    You can calculate the odds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, when you find an S&amp;amp;R level in real data, do you have a way to identify that this is a &quot;random&quot; versus &quot;non-random&quot; S&amp;amp;R level?  How about a way to calculate the odds that this is a random versus non-random S&amp;amp;R level?   If you can't get past this issue then the rest of your analysis will at least partially (maybe completely) be based on meaningless random events.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously, a lot of people have decided that they can't differentiate random versus non-random S&amp;amp;R levels with price alone, so they add volume, seasonality, sun-spots, or whatever.   Lots of ink has been wasted on this subject.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The bottom line is, whatever tool you develop to identify and use S&amp;amp;R levels, when it's all finished, run the above random &quot;x&quot; through it and see if your answers are any better or worse.   If the performance isn't statistically different when you run random data through it, is the tool doing anything worthwhile?&lt;/p&gt;&#xA;" OwnerUserId="392" LastEditorUserId="392" LastEditDate="2011-03-04T19:07:36.103" LastActivityDate="2011-03-04T19:07:36.103" CommentCount="7" ContentLicense="CC BY-SA 2.5" />
  <row Id="639" PostTypeId="2" ParentId="584" CreationDate="2011-03-03T03:38:47.373" Score="0" Body="&lt;p&gt;You might want to perform a &lt;a href=&quot;http://en.wikipedia.org/wiki/Kolmogorov_Smirnov_Test#Two-sample_Kolmogorov.E2.80.93Smirnov_test&quot; rel=&quot;nofollow&quot;&gt;Two sample Kolmogorov-Smirnov&lt;/a&gt; test on the empirical CDFs of the distributions: your forecast and the realized distribution. Then use the p-value of the test as the metric of interest. Other statistical tests of difference in distribution which can be so abused are the &lt;a href=&quot;http://www.ncbi.nlm.nih.gov/pubmed/15284098&quot; rel=&quot;nofollow&quot;&gt;Baumgartner, Weiss, Schindler test&lt;/a&gt;, and the variations thereupon.  I believe there is also a 2-sample Anderson-Darling type test. There are also the non-symmetric &lt;a href=&quot;http://en.wikipedia.org/wiki/Kullback%E2%80%93Leibler_divergence&quot; rel=&quot;nofollow&quot;&gt;Kullback Leibler divergence&lt;/a&gt;, and a &lt;a href=&quot;http://en.wikipedia.org/wiki/Statistical_distance&quot; rel=&quot;nofollow&quot;&gt;half-dozen other&lt;/a&gt; definitions of statistical distance. Probably you are most limited by the statistical package or programming language you are working with. If using R, I would guess you can find implementations of all of the above.&lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2011-03-03T03:38:47.373" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="641" PostTypeId="2" ParentId="298" CreationDate="2011-03-04T18:54:54.583" Score="8" Body="&lt;p&gt;&lt;a href=&quot;http://www.miriamlaurel.com&quot;&gt;My company&lt;/a&gt; currently uses Scala for all new projects in algorithmic trading. We also have an internal portfolio management / monitoring application written in Scala (with &lt;a href=&quot;http://www.circumflex.ru&quot;&gt;Circumflex&lt;/a&gt; web framework).&lt;/p&gt;&#xA;" OwnerUserId="527" LastActivityDate="2011-03-04T18:54:54.583" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="642" PostTypeId="2" ParentId="593" CreationDate="2011-03-05T16:51:21.707" Score="2" Body="&lt;p&gt;There is a &lt;a href=&quot;http://www.theoildrum.com/node/7519&quot; rel=&quot;nofollow&quot;&gt;surplus of production&lt;/a&gt; between the Mexican Gulf and Canadian sources of crude. This makes refineries in the Midwestern US oversupplied driving the price of WIT down. &lt;/p&gt;&#xA;" OwnerUserId="126" LastActivityDate="2011-03-05T16:51:21.707" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="643" PostTypeId="2" ParentId="557" CreationDate="2011-03-05T18:51:56.677" Score="6" Body="&lt;p&gt;Forget about BOVESPA nobody in Brazil is really doing anything that relies on speed and stability. I can say that from my personal experience. I would say that depending on your demands QuickFIX can be as good as FIX.&lt;/p&gt;&#xA;" OwnerUserId="531" LastActivityDate="2011-03-05T18:51:56.677" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="644" PostTypeId="2" ParentId="575" CreationDate="2011-03-05T18:56:28.223" Score="0" Body="&lt;p&gt;ARMA, VAR, VEC. Please, check this out. &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0471415448&quot; rel=&quot;nofollow&quot;&gt;http://www.amazon.com/Analysis-Financial-Time-Ruey-Tsay/dp/0471415448&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="531" LastActivityDate="2011-03-05T18:56:28.223" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="645" PostTypeId="2" ParentId="545" CreationDate="2011-03-06T20:40:37.093" Score="0" Body="&lt;p&gt;Well, the goal of a genetic algo is to find the best solution without going through all the possible scenarios because it would be too long. So of course it is curve fitting, that's the goal!!!&lt;/p&gt;&#xA;" OwnerDisplayName="user533" LastActivityDate="2011-03-06T20:40:37.093" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="646" PostTypeId="1" CreationDate="2011-03-06T23:02:33.750" Score="4" ViewCount="240" Body="&lt;p&gt;Can anyone provide a simple example of picking from two distributions, such that the two generated time series give a specified value of Pearson's correlation coefficient?  I would like to do this in a simple monte-carlo risk assessment.  Ideally, the method should take two arbitrary CDFs and a correlation coefficient as input.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I asked a &lt;a href=&quot;https://stats.stackexchange.com/questions/7515/what-are-some-techniques-for-sampling-two-correlated-random-variables&quot;&gt;similar question on picking from correlated distributions&lt;/a&gt; on &lt;a href=&quot;http://stats.stackexchange.com&quot;&gt;stats.stackexchange.com&lt;/a&gt; and learned that that mathematical machinery required is a called a copula. However I found quite a steep learning curve waiting after consulting the references... some simple examples would be extremely helpful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="47" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2011-03-08T18:13:49.087" Title="Picking from two correlated distributions" Tags="&lt;risk&gt;&lt;time-series&gt;&lt;monte-carlo&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="647" PostTypeId="1" CreationDate="2011-03-07T00:02:02.093" Score="18" ViewCount="13019" Body="&lt;p&gt;Has anybody else out there made this switch?  I'm considering it right now.  What were the negatives and positives of the switch?&lt;/p&gt;&#xA;" OwnerUserId="443" LastActivityDate="2012-12-29T10:15:04.197" Title="Switching from Matlab to Python for Quant Trading and Research" Tags="&lt;quant-trading-strategies&gt;" AnswerCount="7" CommentCount="8" FavoriteCount="16" ContentLicense="CC BY-SA 2.5" />
  <row Id="648" PostTypeId="2" ParentId="647" CreationDate="2011-03-07T01:22:38.997" Score="2" Body="&lt;p&gt;I've only found MatLab to be useful for modeling and testing algorithms, with the implementation in any other language. &lt;/p&gt;&#xA;" OwnerUserId="126" LastActivityDate="2011-03-07T01:22:38.997" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="649" PostTypeId="1" AcceptedAnswerId="1014" CreationDate="2011-03-07T12:43:42.557" Score="5" ViewCount="3181" Body="&lt;p&gt;What is a persistent variable in the context of regression analysis? For example, dividend to price ratio (D/P) is considered to be persistent variable when used to model future returns (Stambaugh Bias literature).&lt;/p&gt;&#xA;" OwnerUserId="40" LastEditorUserId="35" LastEditDate="2011-03-08T06:15:13.317" LastActivityDate="2011-04-19T14:56:43.673" Title="What is a persistent variable?" Tags="&lt;regression&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="650" PostTypeId="2" ParentId="647" CreationDate="2011-03-07T15:38:18.733" Score="0" Body="&lt;p&gt;Everything has pros &amp;amp; cons. So it has to do with personal preferences but more importantly to me it has to do with what your shop uses. Most use a mix of interpreted/compiled language.&lt;/p&gt;&#xA;" OwnerUserId="471" LastActivityDate="2011-03-07T15:38:18.733" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="651" PostTypeId="2" ParentId="647" CreationDate="2011-03-07T18:44:07.800" Score="17" Body="&lt;p&gt;I made the switch years ago, and it has been great.  I even switched the class I teach from Matlab to Python.  Here are some things to consider&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Others can run your Python code when you share it with them.  Matlab has compilers and the like, but they are an extra step you must take since most people do not have Matlab on their desk.&lt;/li&gt;&#xA;&lt;li&gt;Python and its extensions are open source and so allow you to see under the hood&lt;/li&gt;&#xA;&lt;li&gt;Python ctypes is slightly nicer than Matlab C integration&lt;/li&gt;&#xA;&lt;li&gt;Python syntax is excellent (e.g list comprehensions), and NumPy syntax for arrays is also cleaner than Matlab's&lt;/li&gt;&#xA;&lt;li&gt;Python is easier to integrate with external data sources and files&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;On the other hand&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Matlab integrates nicely with Java&lt;/li&gt;&#xA;&lt;li&gt;Matlab optimization routines are really excellent&lt;/li&gt;&#xA;&lt;li&gt;Matlab 3D plotting is better&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-03-07T18:44:07.800" CommentCount="8" ContentLicense="CC BY-SA 2.5" />
  <row Id="652" PostTypeId="1" CreationDate="2011-03-07T20:37:19.963" Score="13" ViewCount="354" Body="&lt;p&gt;I am currently doing a project involving Monte-Carlo method. I wonder if there is papers dealing with a &quot;learning&quot; refinement method to enhance the MC-convergence, example :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&lt;strong&gt;Objective&lt;/em&gt;&lt;/strong&gt; : estimate of $E(X)\thickapprox \sum _{i=1}^{10 000}X_i$  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;-&gt; &lt;strong&gt;step 1 (500 simulations)&lt;/strong&gt;:  $approx_1=\sum _{i=1}^{500}X_i$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(i) Defining and&#xA;'Acceptance interval' &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$ A_1 = [approx_1-\epsilon_1,approx_1+\epsilon_1]$ &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;where  $\epsilon_1$ could be a function of the empirical variance and other statistics&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-&gt; &lt;strong&gt;step 2 (500 other simulations)&lt;/strong&gt;: &lt;em&gt;&quot;throwing&quot;&lt;/em&gt; all simulation out of the interval $A_1$ , $approx_2=\sum _{i=1}^{500}X_i^{(2)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;New 'acceptance interval' &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$A_2 = [approx_2-\epsilon_2,approx_2+\epsilon_2]$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;where $\epsilon_2 &amp;lt; \epsilon_1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \epsilon \xrightarrow {} 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks you for your help&lt;/p&gt;&#xA;" OwnerUserId="539" LastActivityDate="2011-11-03T14:42:55.423" Title="Enhancing Monte-Carlo convergence (crude method)" Tags="&lt;simulations&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="653" PostTypeId="2" ParentId="646" CreationDate="2011-03-07T22:49:50.020" Score="4" Body="&lt;p&gt;Those people citing copulas are actually answering a different question, because they are leading you to a solution whose &lt;em&gt;transformed&lt;/em&gt; distribution function has the requested correlation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have two distributions $P_1$ and $P_2$.  Let me begin by pointing out that this problem is not actually solvable in the general case.  That's because either $P_1$ or $P_2$ can in principle be a &lt;em&gt;point&lt;/em&gt; distribution with 100% of its density at a single value.  In that case, of course, all correlations will be zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally, the shapes of $P_1$ and $P_2$ will put a ceiling $\rho_{\text{max}}$ on the size of correlation $\rho$ that is achievable even in principle.  That ceiling may be 100% but it is difficult to compute in the general case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your best bet would be to use a copula with 100% correlation $r$, to get a lower bound estimate for the maximum possible correlation.  Compute the Pearson correlation $\rho$ of your actual distribution from your $r=$100% copula and you have an estimate for $\rho_{\text{max}}$.  If your target correlation is smaller than that, you can use a root-finder with copula correlation $r$ as input and resulting correlation $\rho$ as an output.  You'll have to keep recomputing $\rho$ of course, which may in principle involve a nasty integral.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2011-03-08T18:13:49.087" LastActivityDate="2011-03-08T18:13:49.087" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="654" PostTypeId="2" ParentId="647" CreationDate="2011-03-08T01:03:56.827" Score="14" Body="&lt;p&gt;Rich, you might find this &lt;a href=&quot;http://mathesaurus.sourceforge.net/matlab-python-xref.pdf&quot;&gt;cheatsheet&lt;/a&gt; useful on your journey.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was advocating Python over Matlab to a co-worker just minutes ago.  I should start by saying that Matlab is a fine piece of software - its documentation is amazing, as are the pdfs that accompany the various toolboxes (as I'm sure you know).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, regarding Python, Brian B brings up many good points.  Two big advantages I would like to emphasize:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;I know that I will be able to develop&#xA;Python anywhere I might work in the&#xA;future (including at home over the&#xA;weekends).  In other words, learning the language is time well spent.  Learn once, and benefit for years.  It's the same reason why&#xA;I love working on the command line in *nix environments, instead of GUIs (MS Office ribbons come to mind).  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I acknowledge that a very large&#xA;portion of quant research is simple, unglamorous&#xA;data manipulations - Python serves as&#xA;a strong glue language (like Perl, but with much stronger numerical libraries).  I can set cron jobs for Python scripts that load data, send me emails, etc.  I'm sure there are those who do this in Matlab (just like there are those that do all sorts of crazy stuff in VBA), but Python is a far better tool for these jobs.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Having said all of that, all legit quant shops can afford Matlab (and all of the costly toolboxes required for database access, xls read/write, compilation - which really should be free IMO).  If you are purely research, then you can probably get by with only Matlab, but I find it somewhat restrictive and, perhaps, somewhat risky in terms of availability.  &lt;/p&gt;&#xA;" OwnerUserId="390" LastActivityDate="2011-03-08T01:03:56.827" CommentCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="657" PostTypeId="5" CreationDate="2011-03-08T04:51:05.137" Score="0" Body="&lt;p&gt;Black and Scholes first proposed the model in 1973 in a paper titled &lt;em&gt;&quot;The Pricing of Options and Corporate Liabilities&quot;&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The equation at the center of the model uses partial differential equations to calculate the price of options. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In 1997, Scholes received the Nobel Prize in Economics for his work. Black was ineligible as he died in 1995. &lt;/p&gt;&#xA;" OwnerUserId="126" LastEditorUserId="126" LastEditDate="2011-03-08T06:18:19.647" LastActivityDate="2011-03-08T06:18:19.647" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="658" PostTypeId="4" CreationDate="2011-03-08T04:51:05.137" Score="0" Body="Black-Scholes is a mathematical model used for pricing options. " OwnerUserId="126" LastEditorUserId="126" LastEditDate="2011-03-08T06:18:16.620" LastActivityDate="2011-03-08T06:18:16.620" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="659" PostTypeId="5" CreationDate="2011-03-08T05:01:11.960" Score="0" Body="&lt;p&gt;Many times it is not possible to determine an exact solution to a problem because there are random(ish) possible inputs, and therefor random outcomes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The typical &quot;Monte Carlo Method&quot; goes something like:&lt;br&gt;&#xA;1. Determine the possible inputs.&lt;br&gt;&#xA;2. Generate the random inputs based on the probability distribution of your inputs.&lt;br&gt;&#xA;3. Compute the output based on that particular random input.&lt;br&gt;&#xA;4. Compile the results. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Monte Carlo simulation in the context of Quantitative Finance refers to a set of&#xA;techniques to generate artificial time series of the stock price overtime, from which option prices can be derived. There are several choices available in this regard.The first choice is to apply a standard method such as the Euler,&#xA;Milstein, or implicit Milstein scheme The advantage of these schemes is that they are easy to understand, and their convergence properties are well-known. The other choice is to use a method that is better suited, or that is specifically designed for the model.These schemes are designed to have faster&#xA;convergence to the true option price, and in some cases, to also avoid the negative variances that can sometimes be generated from standard methods&lt;/p&gt;&#xA;" OwnerUserId="126" LastEditorDisplayName="user16891" LastEditDate="2015-07-24T14:18:25.360" LastActivityDate="2015-07-24T14:18:25.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="660" PostTypeId="4" CreationDate="2011-03-08T05:01:11.960" Score="0" Body="Monte Carlo simulation methods are a broad class of computational algorithms that rely on repeated random sampling to obtain numerical results." OwnerUserId="126" LastEditorDisplayName="user16891" LastEditDate="2015-07-24T14:16:34.387" LastActivityDate="2015-07-24T14:16:34.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="661" PostTypeId="2" ParentId="431" CreationDate="2011-03-08T06:13:02.667" Score="24" Body="&lt;p&gt;I'm putting up videos about what I'm learning while I read through &lt;em&gt;Paul Wilmott on Quantitative Finance&lt;/em&gt;, it's at &lt;a href=&quot;http://nathanslessons.com&quot;&gt;NathansLessons.com&lt;/a&gt;.  So far I have 23 videos covering chapters 1 through 16.  The videos are in &quot;virtual blackboard&quot; format, like Khan Academy.&lt;/p&gt;&#xA;" OwnerDisplayName="user545" LastActivityDate="2011-03-08T06:13:02.667" CommentCount="4" CommunityOwnedDate="2011-03-08T06:13:02.667" ContentLicense="CC BY-SA 2.5" />
  <row Id="665" PostTypeId="2" ParentId="629" CreationDate="2011-03-08T15:36:31.407" Score="6" Body="&lt;p&gt;Maybe I completely misunderstood the question, but it seems to me that you are looking to find a model structure as opposed to fit a specified/known model. In your context the model specification (the trading rules) are unknown... Am I right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that Is the case, maybe genetic programming:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Genetic_programming&quot; rel=&quot;noreferrer&quot;&gt;http://en.wikipedia.org/wiki/Genetic_programming&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is what you need?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a nutshell, it is a sub-class of GA which applies evolutionary approach for finding a model structure (a program) which is most fit... Throughout generations of evolutionary improvements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My guess is that a language dictionary in this case is a set of constructs (variables) you have at your disposal, and the language grammar are the rules...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just a thought!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Btw. Good Question!&lt;/p&gt;&#xA;" OwnerUserId="40" LastActivityDate="2011-03-08T15:36:31.407" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="666" PostTypeId="2" ParentId="652" CreationDate="2011-03-08T22:47:06.013" Score="7" Body="&lt;p&gt;If your variable of integration is truly one-dimensional, as you seem to be saying, then you should be using &lt;strong&gt;quadrature&lt;/strong&gt; to evaluate the expectation integral.  The computational efficiency of quadrature is much higher than Monte Carlo in one dimension (even accounting for modified sampling).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your problem is actually multidimensional, your best bet is to use the first few iterations (you suggest 500 above) to help choose a scheme for &lt;em&gt;importance sampling&lt;/em&gt;.  Your windowing scheme is a different trick sometimes labeled &lt;em&gt;stratified&lt;/em&gt; sampling, and tends to get tricky from a coding perspective.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To perform importance sampling, you will modify the distribution with what is known as an &lt;em&gt;equivalent&lt;/em&gt; measure of your random samples so that most of them fall in the &quot;interesting&quot; region.  The easiest technique is to ensure you are sampling from the multivariate normal distribution, and then shift the mean and variance of your samples such that, say, 90% of them fall within your &quot;interesting&quot; region.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having shifted your samples, you need to then track their likelihood ratio (or Radon-Nikodym derivative) versus the original distribution, because your samples now need to be weighted by that ratio in your Monte Carlo sum.  In the case of a shift in normal distributions, this is fairly easy to compute for each sample $\vec{x}$, as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;\frac{1}{\sqrt{2\pi\ \text{det}A^{-1}}}\exp{\left[-\frac12 (x-b)A(x-b)^t\right]}&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $A$ and $b$ are the covariance matrix and mean of your change to the original multivariate normal.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2011-11-03T14:42:55.423" LastActivityDate="2011-11-03T14:42:55.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="667" PostTypeId="5" CreationDate="2011-03-09T02:52:57.143" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2011-03-09T02:52:57.143" LastActivityDate="2011-03-09T02:52:57.143" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="668" PostTypeId="4" CreationDate="2011-03-09T02:52:57.143" Score="0" Body="Interactive Brokers (IB) is a mutli-asset retail and institutional brokerage firm." OwnerUserId="1355" LastEditorUserId="1355" LastEditDate="2011-09-08T19:23:01.327" LastActivityDate="2011-09-08T19:23:01.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="669" PostTypeId="5" CreationDate="2011-03-09T03:06:36.820" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2011-03-09T03:06:36.820" LastActivityDate="2011-03-09T03:06:36.820" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="670" PostTypeId="4" CreationDate="2011-03-09T03:06:36.820" Score="0" Body="High-frequency trading (HFT) is the use of sophisticated technological tools to trade securities like stocks or options, and is typically characterized by fast order entry and cancellation, low-latency market access, and co-location of servers on an exchange." OwnerUserId="1355" LastEditorUserId="1106" LastEditDate="2011-12-14T15:35:35.383" LastActivityDate="2011-12-14T15:35:35.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="671" PostTypeId="5" CreationDate="2011-03-09T03:12:52.413" Score="0" Body="&lt;p&gt;&lt;code&gt;Time series analysis&lt;/code&gt; uses methods to extract meaningful information and statistics about a particular time series. &lt;code&gt;Time series forecasting&lt;/code&gt; uses the results of time series analysis to predict future events. For example, a temporal observation set of stock closing prices represents a time series, while time series forecasting is an attempt to predict a future closing price of that stock. &lt;/p&gt;&#xA;" OwnerUserId="126" LastEditorUserId="2553" LastEditDate="2015-04-22T14:38:52.463" LastActivityDate="2015-04-22T14:38:52.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="672" PostTypeId="4" CreationDate="2011-03-09T03:12:52.413" Score="0" Body="A temporal sequence of events measured at discrete points in time." OwnerUserId="126" LastEditorUserId="2553" LastEditorDisplayName="user1157" LastEditDate="2015-04-22T14:38:57.800" LastActivityDate="2015-04-22T14:38:57.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="674" PostTypeId="2" ParentId="629" CreationDate="2011-03-09T11:09:24.750" Score="3" Body="&lt;p&gt;Here is an example of the 75% trading rule coded in R: &lt;a href=&quot;http://intelligenttradingtech.blogspot.com/2011/03/can-one-beat-random-walk-impossible-you.html&quot; rel=&quot;nofollow&quot;&gt;Can one beat the random walk&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is how the author describes the rule: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The following script will generate a random series of data and follow the so called 75% rule which says, Pr[Price&gt;Price(n-1) &amp;amp; Pr&amp;lt;(n-1) &amp;lt; Price_median] Or [Price &amp;lt; Price(n-1) &amp;amp; Price(n-1) &gt; Price_median] = 75%.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="357" LastActivityDate="2011-03-09T11:09:24.750" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="675" PostTypeId="1" CreationDate="2011-03-09T21:39:17.253" Score="28" ViewCount="19497" Body="&lt;p&gt;Does anyone know of a python library/source that is able to calculate the traditional mean-variance portfolio?  To press my luck, any resources where the library/source also contains functions such as alternative covariance functions (etc. shrinkage), Lower partial moment portfolio optimization, etc...  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have developed, like everyone else, and implemented one or two variants.  Is it just me or there isn't much out there in terms of python for financial/portfolio applications.  At least nothing out there matching efforts like Rmetrics for R.  &lt;/p&gt;&#xA;" OwnerUserId="557" LastEditorUserId="467" LastEditDate="2016-04-17T05:11:58.620" LastActivityDate="2020-06-22T08:15:46.740" Title="What is the reference python library for portfolio optimization?" Tags="&lt;portfolio&gt;&lt;optimization&gt;&lt;python&gt;" AnswerCount="13" CommentCount="7" FavoriteCount="28" ContentLicense="CC BY-SA 3.0" />
  <row Id="677" PostTypeId="2" ParentId="675" CreationDate="2011-03-09T22:05:39.043" Score="18" Body="&lt;p&gt;Sorry for not being able to give more than one hyperlink, please do some web search for the project pages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Portfolio optimization could be done in python using the &lt;strong&gt;cvxopt&lt;/strong&gt;  package&#xA;which covers convex optimization. This includes quadratic programming as a special case for the risk-return optimization. In this sense, the following example could be of some use:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://abel.ee.ucla.edu/cvxopt/examples/book/portfolio.html&quot;&gt;http://abel.ee.ucla.edu/cvxopt/examples/book/portfolio.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ledoit-Wolf shrinkage is for example covered in &lt;strong&gt;scikit&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="560" LastEditorUserId="560" LastEditDate="2011-03-09T22:13:40.647" LastActivityDate="2011-03-09T22:13:40.647" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="678" PostTypeId="1" CreationDate="2011-03-10T03:09:16.037" Score="5" ViewCount="768" Body="&lt;p&gt;To the degree in which it's possible, I'd like to know what the community believes are the objective skills/knowledge required to run a successful Quant book.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not interested in strategies, obscure maths or programming languages here.  I'm interested in the practical realities of successfully managing/executing a strategy - the nitty-gritty, practical knowledge outside of the strategy that is required in practice (or a huge advantage to know).  Such topics are often somewhat boring and are rarely taught in school.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This knowledge will overlap significantly with that needed by traditional PMs.   Let's assume this Quant PM is at a relatively small shop which does not have a large back-office or particularly sophisticated traders.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking to fill in any potential missing areas of knowledge.  I imagine other traditionally trained quants may benefit from this discussion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some possible suggestions:  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The ins and outs of Securities Lending and traditional services offered by PBs  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Marketing of strategy (internally, but perhaps formally to outside investors) &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Regulatory Environment / Pending Regulation&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Deep understanding of 'Liquidity' (beyond simply historical ADVs, this may include how crowded you believe your trade to be) &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Algorithmic Execution (what is the best trading approach given strategy's alpha decay?  Should you always be a liquidity demander?)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;???&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="390" LastActivityDate="2011-03-10T03:34:59.103" Title="Quant PMs need to know the following..." Tags="&lt;portfolio-management&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ClosedDate="2011-03-10T04:18:55.513" ContentLicense="CC BY-SA 2.5" />
  <row Id="679" PostTypeId="2" ParentId="678" CreationDate="2011-03-10T03:34:59.103" Score="6" Body="&lt;p&gt;&lt;strong&gt;What does a PM need to know&lt;/strong&gt; is very specific to the investment goals of a firm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regulatory issues are particular to location and asset class. For example, a firm that trades US equities may or may not have to become a member of FINRA, which in turn would dictate whether the PM must take the Series 7. The firm's lawyer should be able to address that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Issues like liquidity and execution approach will be particular to the alpha model. Market makers primarily provide quotes, whereas large stat arb groups need to know their broker algos. And the broker algos for equities can be very different from the algos for interest rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason books and schools focus on programming and math is that those topics have some degree of universality. A lot of the &lt;em&gt;extras&lt;/em&gt; are things a trader will learn on the job---often the &quot;hard way&quot;---which is why nobody becomes a PM without a lot of experience. &lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-03-10T03:34:59.103" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="681" PostTypeId="1" AcceptedAnswerId="4128" CreationDate="2011-03-10T11:39:42.917" Score="8" ViewCount="1708" Body="&lt;p&gt;What is the varswap basis?  I am not completely sure what this number represents.  Is it the basis between the estimated future realized volatility and the vol surface implied volatilty at a specified tenor?&lt;/p&gt;&#xA;" OwnerUserId="293" LastActivityDate="2012-09-16T20:42:06.320" Title="Varswap Basis - What is it in practice?" Tags="&lt;volatility&gt;&lt;swaps&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="682" PostTypeId="2" ParentId="557" CreationDate="2011-03-10T13:09:20.057" Score="30" Body="&lt;p&gt;In order &lt;strong&gt;to answer your question&lt;/strong&gt; (for you) &lt;strong&gt;you would need something to compare to&lt;/strong&gt;. You would need numbers to know if it is slower/faster, how much, and if it will impact your system overall. Also knowing your performance goals could narrow down the options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My advice&lt;/strong&gt; is to take a &lt;strong&gt;look at your overall architecture&lt;/strong&gt; of the sytem you have or intend to build. To just look at QuickFIX is rather meaningless without the &lt;strong&gt;whole chain involved in processing information and reacting to it&lt;/strong&gt;. As an example, say QuickFIX is 100 times faster than some part (in the chain of processing) you have or build. Now, replacing QuickFIX with another part which is 100 times faster than QuickFIX would not change anything because you're still held back by the slowest point. And remember that network hops are usually very expensive compared to in-memory processing of data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you for some reason cannot compare different candidates against each other, why not start with e.g. QuickFIX, but make the system in such a way that it can be replaced with something faster later on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally speaking, QuickFIX is not the fastest option, but the key point is that it might not have to be. &lt;strong&gt;If performance is very critical&lt;/strong&gt; and one has resources, you usually end up &lt;strong&gt;buying&lt;/strong&gt; something or &lt;strong&gt;building&lt;/strong&gt; something yourself. Drawbacks here are having resources like time, money and skilled people.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;To answer your question better&lt;/strong&gt; one would need to know other aspects as well, like &lt;strong&gt;available resources&lt;/strong&gt; (money, time, skill), &lt;strong&gt;overall system overview, performance expectations and other factors that limit decisions&lt;/strong&gt;. E.g. if money is not a limiting factor, just find the fastest option and buy it.&lt;/p&gt;&#xA;" OwnerUserId="563" LastEditorUserId="563" LastEditDate="2011-03-10T14:00:36.357" LastActivityDate="2011-03-10T14:00:36.357" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="683" PostTypeId="1" AcceptedAnswerId="685" CreationDate="2011-03-10T16:37:52.143" Score="10" ViewCount="1204" Body="&lt;p&gt;CBOE has introduced &lt;a href=&quot;http://www.cboe.com/micro/credit/introduction.aspx&quot;&gt;credit event binary options&lt;/a&gt;, kind of as a retail trader's CDS. These binary options are worth &lt;strong&gt;$1&lt;/strong&gt; if there is a credit event (ie, bankruptcy) before expiration, and &lt;strong&gt;$0&lt;/strong&gt; if there is no credit event (ie, solvency) at expiration. The option's premium is quoted in pennies and indicates the chance of a bankruptcy during the option's lifetime (eg, $0.11 is 11% chance).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would someone price one of these options? My gut is that the premium should be similar to the delta of a deeply out-of-the-money put option. Any other thoughts?&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-03-10T18:47:44.793" Title="How would one price a &quot;credit event binary option&quot;?" Tags="&lt;options&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="684" PostTypeId="2" ParentId="683" CreationDate="2011-03-10T17:05:17.050" Score="0" Body="&lt;p&gt;The CBOE site states that the premium will approximately reflect the probability of bankruptcy. Usually the delta reflects the probability that the OTM option will be ITM, so I am not sure what is involved in the premium calculation. However, If you can compute the delta, you can compare it to the premium to see if is over/under valued.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Ralph Winters&lt;/p&gt;&#xA;" OwnerUserId="520" LastActivityDate="2011-03-10T17:05:17.050" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="685" PostTypeId="2" ParentId="683" CreationDate="2011-03-10T17:49:30.770" Score="5" Body="&lt;p&gt;I would see if a binomial tree gives reasonable answers (i.e., can you get close to the CEBOs with high volume). You could determine the probability of default over a given interval using the KMV-Merton model. Then use the probability over each of these intervals to determine the probabilities for each of the branches (since the payoff is in default, the tree will be very one-sided). Then discount each of branches back at your risk-free rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't have first-hand experience calculating the KMV-Merton model, but it's pretty common, so I think you should be able to find code out there for it (it's calculated iteratively).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another option could be to think about no arbitrage with any CDS and swaps that are already written on the underlying. But given that your CEBO are traded, there may also be a liquidity premium wrapped up in them. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking quickly at the website, it doesn't look like retail investors can &lt;em&gt;sell&lt;/em&gt; protection. Is that right? I wonder who has the other side of the option.&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-03-10T17:49:30.770" CommentCount="7" ContentLicense="CC BY-SA 2.5" />
  <row Id="686" PostTypeId="2" ParentId="683" CreationDate="2011-03-10T18:47:44.793" Score="2" Body="&lt;p&gt;Since there is no recovery value, any credit default model should be suitable, were I suppose reduced form models would be more appropiate.  &lt;/p&gt;&#xA;" OwnerUserId="357" LastActivityDate="2011-03-10T18:47:44.793" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="687" PostTypeId="2" ParentId="681" CreationDate="2011-03-10T19:40:34.577" Score="2" Body="&lt;p&gt;Whatever it is, it clearly is not a common term of art in the industry.  Three possibilities come to mind:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;To the options:&lt;/strong&gt; Since one can (under certain assumptions about continuity etc) synthesize a variance swap from European option contract prices, the basis may represent the difference between varswap price and the synthesized price.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;To the VIX:&lt;/strong&gt; If we are talking about SPX variance swaps there is a convexity-related basis to the VIX futures.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;To another tenor:&lt;/strong&gt; As with futures, there is a calendar basis in variance swaps.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-03-10T19:40:34.577" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="688" PostTypeId="2" ParentId="156" CreationDate="2011-03-11T03:53:05.187" Score="8" Body="&lt;p&gt;Persistent autocorrelations in volatility processes are due to long term memory only. I cannot help but sigh at the hundreds of papers which work under this assumption. Haven't people heard about regime shifts?&lt;/p&gt;&#xA;" OwnerDisplayName="user567" LastActivityDate="2011-03-11T03:53:05.187" CommentCount="0" CommunityOwnedDate="2011-03-11T03:53:05.187" ContentLicense="CC BY-SA 2.5" />
  <row Id="689" PostTypeId="1" AcceptedAnswerId="1103" CreationDate="2011-03-11T14:21:30.933" Score="7" ViewCount="573" Body="&lt;p&gt;Let's restrict the scope of the question a little bit: I'm interested to learn about major differences in pricing formulae for nominal government bonds. The pricing formulae for inflation-linked bonds could well make a topic of another (and more difficult) question. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://area51.stackexchange.com/proposals/117/quantitative-finance/685#685&quot;&gt;The question&lt;/a&gt; was previously asked by &lt;a href=&quot;http://area51.stackexchange.com/users/149/cletus&quot;&gt;cletus&lt;/a&gt; during the definition phase of the site. &lt;/p&gt;&#xA;" OwnerUserId="70" LastActivityDate="2013-06-05T14:55:57.543" Title="How do bond pricing formulae differ between the US, UK and the Euro zone?" Tags="&lt;fixed-income&gt;&lt;pricing-formulae&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="690" PostTypeId="1" AcceptedAnswerId="703" CreationDate="2011-03-11T16:12:27.277" Score="10" ViewCount="1604" Body="&lt;p&gt;This question is inspired by the remark due to Vladimir Piterbarg made in a related &lt;a href=&quot;http://wilmott.com/messageview.cfm?catid=19&amp;amp;threadid=17173&quot;&gt;thread&lt;/a&gt; on Wilmott back in 2004:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Not to be a party-pooper, but Malliavin calculus is essentially useless in finance. Any practical result ever obtained with Malliavin calculus can be obtained by much simpler methods by eg differentiating the density of the underlying process.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;At the same time, it seems that recently there has been a rather noticeable flow of academic papers and books devoted to applications of the Malliavin calculus to finance (see, e.g., &lt;a href=&quot;http://books.google.com/books?id=G9EvB_HZCVwC&amp;amp;pg=PR2&amp;amp;dq=Malliavin+Calculus+for+L%C3%A9vy+Processes+with+Applications+to+Finance+%28Universitext%29&amp;amp;hl=en&amp;amp;ei=-D56TY6EIIS84gaB3rCHBg&amp;amp;sa=X&amp;amp;oi=book_result&amp;amp;ct=result&amp;amp;resnum=1&amp;amp;ved=0CCgQ6AEwAA#v=onepage&amp;amp;q&amp;amp;f=false&quot;&gt;&lt;em&gt;Malliavin Calculus for Lévy Processes with Applications to Finance&lt;/em&gt;&lt;/a&gt; by  Di Nunno, Øksendal, and Proske, &lt;a href=&quot;http://books.google.com/books?id=VsmdN58iWAYC&amp;amp;printsec=frontcover&amp;amp;dq=Stochastic+Calculus+of+Variations+in+Mathematical+Finance&amp;amp;hl=en&amp;amp;src=bmrr&amp;amp;ei=tUN6TduZBpW04gbGpPHhBQ&amp;amp;sa=X&amp;amp;oi=book_result&amp;amp;ct=result&amp;amp;resnum=1&amp;amp;ved=0CCgQ6AEwAA#v=onepage&amp;amp;q&amp;amp;f=false&quot;&gt;&lt;em&gt;Stochastic Calculus of Variations in Mathematical Finance&lt;/em&gt;&lt;/a&gt; by Malliavin and Thalmaier, and the references therein).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question.&lt;/strong&gt; So do practitioners actually use the Malliavin calculus to compute Greeks these days? Are there any other real-world financial applications of the Malliavin calculus? Or does Dr. Piterbarg's assessment of the practical potential of the theory remain to be essentially accurate?   &lt;/p&gt;&#xA;" OwnerUserId="70" LastActivityDate="2011-03-19T17:36:57.320" Title="How do practitioners use the Malliavin calculus (if at all)?" Tags="&lt;stochastic-calculus&gt;&lt;application&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="691" PostTypeId="1" CreationDate="2011-03-11T20:03:23.573" Score="12" ViewCount="446" Body="&lt;p&gt;I'm working on some financial analysis code which I'd like to test against a historical dataseries to analyze the correlations to my algorithm to some non-finance related data.  Ideally, I'd like to test against a dataseries which provides a monthly float value as far back as 1997.  Maybe it's the temperature somewhere on the 1st of the month.  Maybe its the number of traffic accidents on the 1st day of each month in a city.  Basically, just something somewhat random, but with the monthly value to test against.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anybody think of a publicly-available data-series which might have a monthly point of data as far back as 1997.  A link to the data-source would be even better.&lt;/p&gt;&#xA;" OwnerUserId="570" LastActivityDate="2011-03-18T19:21:29.017" Title="Seeking Historical Non-Finance Datapoints for Backtesting" Tags="&lt;data&gt;&lt;backtesting&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="692" PostTypeId="1" AcceptedAnswerId="732" CreationDate="2011-03-11T20:16:01.970" Score="14" ViewCount="3217" Body="&lt;p&gt;I'm looking at doing some research drawing comparisons between various methods of approaching option pricing. I'm aware of the Monte Carlo simulation for option pricing, Black-Scholes, and that dynamic programming has been used too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any key (or classical) methods that I'm missing? Any new innovations? Recommended reading or names would be very much appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Additionally, what are the standard methods and approaches for assessing/analysing a model or pricing approach?&lt;/p&gt;&#xA;" OwnerUserId="473" LastEditorUserId="473" LastEditDate="2011-03-11T21:49:02.250" LastActivityDate="2013-01-15T10:12:21.693" Title="Methods for pricing options" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;monte-carlo&gt;" AnswerCount="4" CommentCount="4" FavoriteCount="14" ContentLicense="CC BY-SA 2.5" />
  <row Id="693" PostTypeId="2" ParentId="691" CreationDate="2011-03-11T20:36:51.047" Score="6" Body="&lt;p&gt;Here are a few links:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.economagic.com/&quot; rel=&quot;noreferrer&quot;&gt;http://www.economagic.com/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.eia.doe.gov/electricity/data.cfm&quot; rel=&quot;noreferrer&quot;&gt;http://www.eia.doe.gov/electricity/data.cfm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.drought.unl.edu/dm/source.html&quot; rel=&quot;noreferrer&quot;&gt;http://www.drought.unl.edu/dm/source.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://gcmd.nasa.gov/KeywordSearch/Home.do?Portal=GCMD&amp;amp;MetadataType=0&quot; rel=&quot;noreferrer&quot;&gt;http://gcmd.nasa.gov/KeywordSearch/Home.do?Portal=GCMD&amp;amp;MetadataType=0&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="392" LastActivityDate="2011-03-11T20:36:51.047" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="694" PostTypeId="2" ParentId="691" CreationDate="2011-03-11T21:29:57.567" Score="8" Body="&lt;p&gt;The website &lt;a href=&quot;http://www.infochimps.com&quot;&gt;www.infochimps.com&lt;/a&gt; has a lot of unusual datasets, many of which are free.&lt;/p&gt;&#xA;" OwnerUserId="571" LastActivityDate="2011-03-11T21:29:57.567" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="695" PostTypeId="2" ParentId="692" CreationDate="2011-03-11T22:46:47.287" Score="5" Body="&lt;p&gt;I would also look into pricing models based upon models other than lognormal (Black-Scholes). Do some research on &quot;fat tailed&quot; or stable distributions. There can also be known by their specific distribution names as Levy, Levy-Poisson, or Cauchy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Fat_tail&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Fat_tail&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="520" LastEditorUserId="35" LastEditDate="2011-03-12T22:39:43.387" LastActivityDate="2011-03-12T22:39:43.387" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="696" PostTypeId="1" CreationDate="2011-03-12T05:05:20.987" Score="3" ViewCount="1474" Body="&lt;p&gt;I'm currently studying for my undergrad in CS, and considering to do a grad in both CS and Math.  I would like to see what you guys would recommend to prepare myself for a field as a Quant.  I am specifically interested in Algotrading (algorithmic quant) position.  To be able to write models and software to do automated trading.  Any suggestions on where to begin?  I have no familiarity with trading.  Is it possible to setup a practice account and begin doing some trades so I understand how that works?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="566" LastActivityDate="2011-03-12T09:47:47.703" Title="On my way to becoming a Quant" Tags="&lt;automated-trading&gt;&lt;software&gt;&lt;trading-systems&gt;&lt;learning&gt;&lt;soft-question&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="4" ClosedDate="2011-03-22T03:28:51.440" ContentLicense="CC BY-SA 2.5" />
  <row Id="697" PostTypeId="2" ParentId="696" CreationDate="2011-03-12T07:01:13.037" Score="5" Body="&lt;p&gt;The best way to do it is by getting an internship as an entry level analyst or some sort. They do not necessary expect you to know computational finance(they will teach you), though you need to be bright, have an outstanding academic record, and of course, good communication skills. As you get in there, you can then ask around about the specifics of what you are looking for. In general, quant positions themselves require you to have Masters, Ph.D, or a lot of experience, so your plan on getting into graduate program may work just fine. In my opinion however, it makes more sense to get a  Bachelors degree first, get a job in one of the financial institutions, work there for a couple of years and then come back to pursue your graduate studies. As far as internships go, starting place could be D.E. Shaw, they have summer internships available. Since you have programming background, they might like you. &#xA;Good Luck!&lt;/p&gt;&#xA;" OwnerUserId="428" LastActivityDate="2011-03-12T07:01:13.037" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="698" PostTypeId="2" ParentId="692" CreationDate="2011-03-12T07:07:52.173" Score="3" Body="&lt;p&gt;There are two more methods that i am aware of from my academic curriculum. I am not sure if they are applicable to the real world but you can read up on them.&#xA;Method 1: Binomial Valuation; &#xA;Method 2: Risk Neutral Valuation;&#xA;Both of the methods are fairly easy to implement(in terms of writing a program for it or simply, using excel spreadsheets)  &lt;/p&gt;&#xA;" OwnerUserId="428" LastActivityDate="2011-03-12T07:07:52.173" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="699" PostTypeId="2" ParentId="696" CreationDate="2011-03-12T09:47:47.703" Score="3" Body="&lt;p&gt;Quantivity has three great posts about how to learn algorithmic trading&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://quantivity.wordpress.com/2010/01/10/how-to-learn-algorithmic-trading/&quot; rel=&quot;nofollow&quot;&gt;http://quantivity.wordpress.com/2010/01/10/how-to-learn-algorithmic-trading/&lt;/a&gt;&#xA;http://quantivity.wordpress.com/2010/01/12/how-to-learn-algorithmic-trading-part-2/&#xA;&lt;a href=&quot;http://quantivity.wordpress.com/2010/01/12/how-to-learn-algorithmic-trading-part-3/&quot; rel=&quot;nofollow&quot;&gt;http://quantivity.wordpress.com/2010/01/12/how-to-learn-algorithmic-trading-part-3/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="82" LastActivityDate="2011-03-12T09:47:47.703" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="700" PostTypeId="1" AcceptedAnswerId="704" CreationDate="2011-03-12T15:47:32.820" Score="9" ViewCount="1576" Body="&lt;p&gt;I was looking into the factorial function in an R package called gregmisc and came across the implementation of the gamma function, instead of a recursive or iterative process as I was expecting. The gamma function is defined as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \Gamma(z)=\int_{0}^{\infty}e^{-t}t^{z-1}dt $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A brief history of the function points to Euler's solution to the factorial problem for non-integers (although the equation above is not his). It has some application in physics and I was curious if it is useful to any quant models, apart from being a fancy factorial calculator.&lt;/p&gt;&#xA;" OwnerUserId="291" LastActivityDate="2011-03-12T19:52:15.310" Title="Does the gamma function have any application in quantitative finance?" Tags="&lt;models&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="701" PostTypeId="2" ParentId="700" CreationDate="2011-03-12T17:40:54.933" Score="2" Body="&lt;p&gt;In certain cases some stochastic differential equations(SDE's) have closed form(deterministic) solutions in the form of well known ordinary differential equations (ODE's), partial differential equations(PDE's), and special functions like the gamma function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example from a paper where an SDE has a closed form solution in terms of the gamma function:&#xA;&lt;a href=&quot;http://www.siam.org/books/dc13/DC13samplechpt.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.siam.org/books/dc13/DC13samplechpt.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solving SDE's (preferably quickly), like with a closed form solution (when one is available), is a core activity in quantitative finance.&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-03-12T17:40:54.933" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="702" PostTypeId="2" ParentId="700" CreationDate="2011-03-12T18:03:46.473" Score="0" Body="&lt;p&gt;Gamma distributions are being used to model the default rate of credit portfolios by CreditRisk. &lt;/p&gt;&#xA;" OwnerUserId="357" LastActivityDate="2011-03-12T18:03:46.473" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="703" PostTypeId="2" ParentId="690" CreationDate="2011-03-12T19:07:03.803" Score="5" Body="&lt;p&gt;Well the problems where Malliavin Calculus is applicable are mostly regarding greeks of exotic derivatives where some non smoothness in the payoff function creates trouble when trying to get this by finite difference methods. The thing is in my opinion that Malliavin Calculus is only an opening as it gives you basically an infinite number of ways to get those derivatives by Monte Carlo simulations. Then you have to determine an optimal weight, and it appears that when the probability law of the dynamic is tractable (maybe this is related to Piterbarg's comment)you can use Likelyhood Ratio Method to get those bad greeks and this method is optimal. Anyway Malliavin Calculus alone won't really improve the solution to the problem if you don't use some other techniques together with it(such variance reduction techniques), and it might be the case that those techniques provide sufficient improvements to make difference methods good enough and so to avoid to resort to Malliavin Calculus. But anyway it is ALWAYS a good thing to have as many as possible methods as you can when dealing with a problem. So Piterbarg comment is a little provocative and it should not prevent you from getting your own idea on the subject by implementing some Malliavin Calculus techniques on concrete examples.    &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are a few references if you want to get acquainted with Malliavin Calculus and its application to Greek comptuations :&#xA;Benhamou - Smart Monte Carlo, Various Trikcs using Malliavin Calculus&#xA;Friz - An Introduction to Malliavin Calculus&#xA;Glasserman - Malliavin Greeks without Malliavin Calculus (this one is fun)&#xA;Prével - Greeks via Malliavin&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards.&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="92" LastEditDate="2011-03-14T07:40:24.487" LastActivityDate="2011-03-14T07:40:24.487" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="704" PostTypeId="2" ParentId="700" CreationDate="2011-03-12T19:52:15.310" Score="4" Body="&lt;p&gt;It shows up in Bayes Analysis where a binomial distribution is involved (integer values apply):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \Gamma(k + 1) = k! $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That allows the following integral to be evaluated in closed form:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \int_{0}^{1}p^{j-1}(1-p)^{k-1}dp = \frac{\Gamma(k)\Gamma(j)}{\Gamma(j+k)} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That integral can easily show up in the numerator and/or denominator of Bayes Equation.&lt;/p&gt;&#xA;" OwnerUserId="392" LastActivityDate="2011-03-12T19:52:15.310" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="705" PostTypeId="1" AcceptedAnswerId="713" CreationDate="2011-03-12T20:53:58.857" Score="7" ViewCount="1057" Body="&lt;p&gt;A &lt;a href=&quot;http://www.forbes.com/forbes/2011/0314/investing-malcolm-baker-stocks-google-harvard-low-risk.html&quot; rel=&quot;nofollow&quot;&gt;recent article from Forbes&lt;/a&gt; seems to indicate that low volatility stocks outperform high volatility stocks over the long run. Does anyone have any supporting or contradicting evidence to this claim? The study cited studied returns for the entire stock market and the 1,000 largest stocks from 1968 to 2008.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the answer to this question is really a simple yes or no, however the larger issue is whether or not the period under study was cherry picked and if different results would have been obtained using different end dates.&lt;/p&gt;&#xA;" OwnerUserId="520" LastEditorUserId="1106" LastEditDate="2011-09-16T16:32:47.040" LastActivityDate="2011-09-17T08:42:09.217" Title="Do low volatility stocks outperform high volatility stocks over the long run?" Tags="&lt;volatility&gt;&lt;risk&gt;&lt;research&gt;&lt;equities&gt;" AnswerCount="4" CommentCount="4" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="706" PostTypeId="1" CreationDate="2011-03-12T21:19:06.437" Score="14" ViewCount="2463" Body="&lt;p&gt;Recently I was trying to reproduce the results of &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1107590&quot; rel=&quot;noreferrer&quot;&gt;&quot;Intraday Patterns in the Cross-section of Stock Returns&quot;&lt;/a&gt; (&lt;a href=&quot;http://dx.doi.org/10.1111/j.1540-6261.2010.01573.x&quot; rel=&quot;noreferrer&quot;&gt;published in the Journal of Finance 2010&lt;/a&gt;). The authors used cross-sectional regression to determine which intraday lags have predictive power. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From my understanding when doing cross-sectional regression all variables have to be from the same time period. For example, I can take the one day returns of all stocks and regress them against the number of employees in each company.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following is a short description of how cross-sectional regression was used in the research:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;For each lag, $k$, we run cross-sectional regressions of half-hour stock returns on returns lagged by $k$ half-hour periods,&#xA;  $$&#xA;r_{i,t}=\alpha_{k,t}+\gamma_{k,t}r_{i,t-k}+u_{i,t},&#xA;$$&#xA;  where $r_{i,t}$ is the return on stock i in the half-hour interval $t$. The slope coefficients $\gamma_{k,t}$ represent the response of returns at half-hour $t$ to returns over a previous interval lagged by $k$ half-hour periods, the “return responses.”&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If I understood well, the returns of one period were regressed against the returns of another period and a slope was obtained from each regression. Later, autocorrelation analysis has been done on the slopes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unless my thoughts are wrong, I don't see the point of regressing the returns of one period against another - $R^2$ values are close to zero. Here is an example:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/rEG3X.png&quot; alt=&quot;image&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Did I get the cross-sectional regression wrong? By the way, I was working with a relatively small number of stocks, but I thought that 38 should be enough. &lt;/p&gt;&#xA;" OwnerUserId="537" LastEditorUserId="19321" LastEditDate="2016-02-06T15:23:25.793" LastActivityDate="2017-12-27T15:06:30.550" Title="How do I reproduce the cross-sectional regression in &quot;Intraday Patterns in the Cross-section of Stock Returns&quot;?" Tags="&lt;equities&gt;&lt;research&gt;&lt;statistics&gt;&lt;regression&gt;&lt;theory&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="708" PostTypeId="1" CreationDate="2011-03-12T23:07:48.770" Score="8" ViewCount="7887" Body="&lt;p&gt;On a betting exchange the price (the odds that an event will happen expressed as a decimal, 1/(percentage chance event occurring) of a runner can experience a great deal of volatility before the event in question begins. Since very little about the event in question actually changes before it starts the movement in price must be down to pure market forces. This is especially true in the minutes leading up to the start of the event. A prime examples of this are the ten minutes before the start of a horse race or two minutes from the start of a greyhound race.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is possible to monitor the market in real time (including the currently best available back and lay prices, and the amount of money it is possible to back or lay). Given all of this, what devices from quantitative finance could best be used to predict the immediate movement of the odds of a runner? As with a predictive model of price movements it is possible to trade on a betting exchange as you would a normal stock exchange.&lt;/p&gt;&#xA;" OwnerUserId="578" LastEditorUserId="20795" LastEditDate="2019-09-22T20:25:47.697" LastActivityDate="2019-09-22T20:25:47.697" Title="Predicting Price Movements on a Betting Exchange" Tags="&lt;modeling&gt;&lt;automated-trading&gt;&lt;pricing-formulae&gt;&lt;betting&gt;" AnswerCount="5" CommentCount="3" FavoriteCount="6" ContentLicense="CC BY-SA 2.5" />
  <row Id="709" PostTypeId="2" ParentId="706" CreationDate="2011-03-12T23:47:42.243" Score="11" Body="&lt;p&gt;The $R^2$s are usually close to zero for single stock regressions. The big $R^2$s that a lot of asset pricing research shows is by forming portfolios. Forming portfolios cancels a lot of the idiosyncratic returns, which has a smoothing effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The $R^2$s should be low here, although I don't see any in the paper for you to compare. This probably means they are &lt;em&gt;very&lt;/em&gt; low. We don't expect that the lagged 30-min return should predict much of the future 30-min return. Maybe one percent or two? Heston et al's point is that they are correlated. We can't expect that the lagged return will tell us &lt;em&gt;exactly&lt;/em&gt; the future return (i.e., $R^2 = 100\%$), but the two are correlated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They run the regression $$r_{i,t} = \alpha_{k,t} + \gamma_{k,t} r_{i,t-k} + u_{i,t}$$ which finds the autocorrelation between $r_{i,t}$ and its $k^{th}$ lag $r_{i,t-k}$. This seems endogenous to me because there's an omitted variable that drives both the return and it's lag (maybe some news?). This should bias their $\gamma$, but I don't know &lt;em&gt;a priori&lt;/em&gt; which way. When Jegadeesh (1990) looked at short-term reversals he did some other tricks to get around it, but I don't see that here. Heston et al are very well respected, so there's likely something I'm missing and I'm not very familiar with the intr-day literature, although I didn't see any discussion of this in the paper. I am interested to see this in it's peer-reviewed and published form.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regardless, their $\gamma$s aren't autocorrelated, so they should be fine using the Fama-MacBeth approach. Oh, and that you're only doing 38 stocks shouldn't affect your $R^2$, just the t-statistics on your $\gamma$s.&lt;/p&gt;&#xA;" OwnerUserId="106" LastEditorUserId="106" LastEditDate="2011-03-12T23:58:48.740" LastActivityDate="2011-03-12T23:58:48.740" CommentCount="5" ContentLicense="CC BY-SA 2.5" />
  <row Id="710" PostTypeId="1" AcceptedAnswerId="717" CreationDate="2011-03-13T00:12:15.070" Score="7" ViewCount="1197" Body="&lt;p&gt;If orders are filled pro rata, is there still incentive to engage in HFT? Because pro rata nullifies the time precedence rule, my intuition is no, but I figure there could be other aspects to it I'm unaware of.&lt;/p&gt;&#xA;" OwnerUserId="451" LastEditorUserId="2299" LastEditDate="2012-04-18T02:03:38.570" LastActivityDate="2013-10-25T01:56:58.487" Title="Does HFT make sense in a pro-rata market?" Tags="&lt;automated-trading&gt;&lt;high-frequency&gt;&lt;market-microstructure&gt;&lt;order-handling&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="711" PostTypeId="2" ParentId="710" CreationDate="2011-03-13T01:32:38.237" Score="2" Body="&lt;p&gt;My guess is you are right in that it will be unprofitable to be a liquidity provider because of the lack of time priority.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, liquidity taking strategy (taking out an order that is mis-priced) is still a speed game.&lt;/p&gt;&#xA;" OwnerUserId="443" LastActivityDate="2011-03-13T01:32:38.237" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="712" PostTypeId="2" ParentId="710" CreationDate="2011-03-13T04:42:48.023" Score="3" Body="&lt;p&gt;Market markers still have to consume market data. The techniques required to scale a live order book in real-time will be the same regardless of the intended use case. So while the strategies will be different from what we know as HFT (and even the participants different), the systems in use will be very similar.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-03-13T04:42:48.023" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="713" PostTypeId="2" ParentId="705" CreationDate="2011-03-13T12:13:45.137" Score="5" Body="&lt;p&gt;This current paper is highly relevant to your question:&lt;br&gt;&#xA;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1420356&quot;&gt;Risk and Return in General: Theory and Evidence (Eric G. Falkenstein)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Empirically, standard, intuitive measures of risk like volatility and beta do not generate a positive correlation with average returns in most asset classes. It is possible that risk, however defined, is not positively related to return as an equilibrium in asset markets. This paper presents a survey of data across 20 different asset classes, and presents a model highlighting the assumptions consistent with no risk premium. The key is that when agents are concerned about relative wealth, risk taking is then deviating from the consensus or market portfolio. In this environment, all risk becomes like idiosyncratic risk in the standard model, avoidable so unpriced.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;BTW: The original paper Forbes references to can be found here:&lt;br&gt;&#xA;&lt;a href=&quot;http://people.hbs.edu/mbaker/cv/papers/Benchmarks_as_Limits_unpub_01_14_10_faj.v67.n1.4.pdf&quot;&gt;Benchmarks as Limits to Arbitrage:&#xA;Understanding the Low-Volatility Anomaly (Malcolm Baker, Brendan Bradley, and Jeffrey Wurgler)&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2011-03-13T19:30:33.903" LastActivityDate="2011-03-13T19:30:33.903" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="714" PostTypeId="1" AcceptedAnswerId="1486" CreationDate="2011-03-13T13:49:25.650" Score="13" ViewCount="519" Body="&lt;p&gt;At work we were talking about currency hedging our equity index exposures but I am struggling to understand how this happens in a typical iShares ETF.&lt;/p&gt;&#xA;&lt;p&gt;If we take the &lt;a href=&quot;http://uk.ishares.com/en/pc/products/IJPN&quot; rel=&quot;nofollow noreferrer&quot;&gt;Japan ETF IJPN&lt;/a&gt; then we see this index is against the MSCI Japan index.&lt;/p&gt;&#xA;&lt;p&gt;However it is priced in GBP and its base and benchmark currency is USD.&lt;/p&gt;&#xA;&lt;p&gt;So my question is: What sensitivity does this have to FX (USD/JPY and GBP/JPY) if any and why?&lt;/p&gt;&#xA;" OwnerUserId="103" LastEditorUserId="20092" LastEditDate="2020-09-17T04:46:16.167" LastActivityDate="2020-09-17T04:46:16.167" Title="Currency Hedged ETFs" Tags="&lt;equities&gt;&lt;fx&gt;&lt;etf&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="716" PostTypeId="1" CreationDate="2011-03-13T17:14:32.953" Score="5" ViewCount="5141" Body="&lt;p&gt;Most brokers compute rollover once a day (2200 GMT), but OANDA &#xA;calculates it continuously. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought I'd cleverly found an arbitrage opportunity, but it turns &#xA;out OANDA knows about this &lt;em&gt;and&lt;/em&gt; advertises it. Quoting from &#xA;&lt;a href=&quot;http://www.oanda.com/corp/story/innovations&quot; rel=&quot;nofollow&quot;&gt;http://www.oanda.com/corp/story/innovations&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; Professional traders can exploit this flexibility by arbitraging the &#xA; continuous and discrete interest-calculation scenarios through two &#xA; trading lines--one with an established player, such as Citibank or &#xA; UBS, and the other with OANDA. Whenever they sell a &#xA; high-interest-rate currency (such as South African Rand) they can do &#xA; so with the traditional player, where they will pay no intra-day &#xA; interest for shorting that currency. On the other hand, they can &#xA; always buy a high-interest-rate currency through OANDA, where they &#xA; earn the &quot;carry&quot; (interest-rate differential) for the position, &#xA; however briefly they may hold it. &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Has anyone done this? I realize the bid/ask spread on both sides would &#xA;have to be small, but this still seems viable?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My form of arbitrage is slightly different: hold a high-interest position w/ a regular broker for 1 minute on each side of rollover time, just to get the rollover (for the entire 24 hour period). Take the opposite position w/ OANDA. You'll pay rollover, but for only 2 minutes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Apologies, I never got around to test this. Has anyone else had a chance? I realize oanda.com's higher spreads (which are non-negotiable) may cover the arbitrage.&lt;/p&gt;&#xA;" OwnerDisplayName="user59" LastEditorDisplayName="user59" LastEditDate="2011-08-11T22:45:22.367" LastActivityDate="2014-02-22T09:52:15.370" Title="Arbitraging OANDA continuous rollover vs other brokers' discrete rollover" Tags="&lt;arbitrage&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="717" PostTypeId="2" ParentId="710" CreationDate="2011-03-13T17:20:22.580" Score="8" Body="&lt;p&gt;The Eurodollar market is partially pro-rata. And there is a lot of HFT on it. Getting out of the book when conditions are not right is very much HFT.&lt;/p&gt;&#xA;" OwnerUserId="225" LastActivityDate="2011-03-13T17:20:22.580" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="718" PostTypeId="2" ParentId="691" CreationDate="2011-03-13T19:15:15.063" Score="7" Body="&lt;p&gt;Here's a link to daily weather data.  It looks like it goes as far back as the 1940s.  There's a link to a CSV file at the bottom of the page.  It will only give you one year's worth of data at a time, so you'll have to manually download several files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.wunderground.com/history/airport/KNYC/2011/3/13/CustomHistory.html&quot; rel=&quot;noreferrer&quot;&gt;http://www.wunderground.com/history/airport/KNYC/2011/3/13/CustomHistory.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="584" LastActivityDate="2011-03-13T19:15:15.063" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="720" PostTypeId="2" ParentId="27" CreationDate="2011-03-14T07:37:28.763" Score="4" Body="&lt;p&gt;It's well know by everybody that when the market prices goes up, the &lt;a href=&quot;http://www.livevol.com/historical_files.html&quot; rel=&quot;nofollow&quot;&gt;implied volatility&lt;/a&gt; goes down and vice versa. So the strike prices is having the reverse relationship when examinig the option chains.&lt;/p&gt;&#xA;" OwnerDisplayName="user586" LastActivityDate="2011-03-14T07:37:28.763" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="721" PostTypeId="2" ParentId="705" CreationDate="2011-03-14T11:10:05.733" Score="6" Body="&lt;p&gt;The theory predicts that &lt;em&gt;expected&lt;/em&gt; risk and &lt;em&gt;expected&lt;/em&gt; return should be positively related. But no one has convincingly proved this. The results are very sensitive to how you determine the expectations of risk and return and the timeline you use. Many have shown that there isn't a positive trade-off between risk and return in a CAPM-framework (i.e., Fama and French 1992 showed that $\beta$ has no predictive power in the cross section of returns -- although in 1993 they &quot;saved&quot; $\beta$ by adding two more factors).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is odd about this Baker et al research is that they're buying the 20% with the highest vol and holding them for only one year. They're are constantly investing in the most uncertain stocks without ever really allowing the uncertainty to get resolved. I would be interested in how these results change with a two to five year holding period (e.g., I imagine in the mid 90s both amazon.com and pets.com where volatile; if you held both for one year, then you may or may not come out ahead; but if you held both for five years, pets.com delists and amazon.com skyrockets; but this is anecdotal and far from convincing.) &lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-03-14T11:10:05.733" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="722" PostTypeId="2" ParentId="708" CreationDate="2011-03-14T11:51:49.717" Score="1" Body="&lt;p&gt;I'm not familiar with betting exchanges but what you're describing reminds me a lot of binary options, where the payout is 1 if something occurs (ie APPL trades above 1000$) and 0 if the event doesn't occur. So at any time before expiration, the option is worth the probability that the even will indeed occur, so the options is always worth between [0, 1]. Although, option pricing has nothing to do with path predictions, it has everything to do with volatility pricing, which to me seems perfect for what you're describing.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;On a betting exchange the price of a runner can experience a great deal of volatility before the event in question begins&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="471" LastActivityDate="2011-03-14T11:51:49.717" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="723" PostTypeId="1" AcceptedAnswerId="726" CreationDate="2011-03-14T21:23:14.543" Score="12" ViewCount="8618" Body="&lt;p&gt;Can someone explain to me the rationale for why the market may be moving towards OIS discounting for fully collateralized derivatives?&lt;/p&gt;&#xA;" OwnerUserId="223" LastEditorUserId="20454" LastEditDate="2017-10-09T15:45:49.563" LastActivityDate="2017-10-09T15:45:49.563" Title="Rationale for OIS discounting for collateralized derivatives?" Tags="&lt;valuation&gt;&lt;ois-discounting&gt;&lt;collateral&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="724" PostTypeId="2" ParentId="723" CreationDate="2011-03-14T23:00:07.710" Score="3" Body="&lt;p&gt;The OIS rate is more stable than Libor, right? And according to &lt;a href=&quot;http://www.scribd.com/doc/37180714/Risk-Magazine-The-Price-is-Wrong&quot; rel=&quot;nofollow&quot;&gt;this article&lt;/a&gt; from &lt;em&gt;Risk Magazine&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The party that is owed money at the end of the swap will have been paying an OIS rate on the collateral it has been holding, and so the ultimate value of the cash it will receive will be the sum it is owed minus the overnight interest rate it has had to pay on this collateral.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="35" LastEditorUserId="35" LastEditDate="2011-03-14T23:17:42.953" LastActivityDate="2011-03-14T23:17:42.953" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="725" PostTypeId="1" AcceptedAnswerId="734" CreationDate="2011-03-15T05:01:46.573" Score="7" ViewCount="211" Body="&lt;p&gt;Does anyone know of any research or data on US corporate bankruptcy rates as a function of standard valuation ratios, such as P/B, P/E, etc.?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to adjust the results of backtests to account for survivorship bias.  My first thought was to put an upper bound on the impact of survivorship bias by assuming a certain percentage of holdings go bankrupt each period.  I was looking for some data on what that percentage should be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm aware of values like Altman's Z-score, but that doesn't quite apply to what I'm trying to do.  That's meant to predict bankruptcy, but I'm looking for a typical bankruptcy rate.  Even an overall rate would be better than nothing, but it would be more useful if it was broken down cross-sectionally in some way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, are there any better methods of dealing with survivorship bias when working with incomplete data sets?&lt;/p&gt;&#xA;" OwnerUserId="584" LastActivityDate="2011-03-16T11:32:06.240" Title="Data on US bankruptcy rate vs. standard valuation ratios" Tags="&lt;backtesting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="726" PostTypeId="2" ParentId="723" CreationDate="2011-03-15T06:37:10.120" Score="8" Body="&lt;p&gt;Most counterparty agreements specify some sort of ois rate for the interest paid/received on posted collateral. So the OIS rate is the appropriate one to use for discounting future cash flows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Prior to 2008 the OIS/Libor spread was small and stable, so you didn't really need to worry about this, but now it's much larger, so people are taking it into account. The reason it's &quot;big news&quot; now is that properly switching pricing systems over to use OIS discounting is a large change, so most places are only now getting this online.&lt;/p&gt;&#xA;" OwnerUserId="371" LastActivityDate="2011-03-15T06:37:10.120" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="727" PostTypeId="2" ParentId="447" CreationDate="2011-03-15T12:16:48.903" Score="2" Body="&lt;p&gt;Check out MB Trading.  Their API is quite good and their support is excellent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://mbtrading.com/developers.aspx&quot; rel=&quot;nofollow&quot;&gt;http://mbtrading.com/developers.aspx&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="593" LastActivityDate="2011-03-15T12:16:48.903" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="728" PostTypeId="1" AcceptedAnswerId="731" CreationDate="2011-03-15T18:20:56.460" Score="58" ViewCount="23201" Body="&lt;p&gt;I've only recently begun exploring and learning &lt;em&gt;R&lt;/em&gt; (especially since &lt;em&gt;Dirk&lt;/em&gt; recommended &lt;em&gt;RStudio&lt;/em&gt; and a lot of people in here speak highly of &lt;em&gt;R&lt;/em&gt;). I'm rather &lt;em&gt;C(++)&lt;/em&gt; oriented, so it got me thinking - &lt;strong&gt;what are the limitations of R&lt;/strong&gt;, in particular in terms of performance?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to weigh the &lt;em&gt;C++/Python/R&lt;/em&gt; alternatives for research and I'm considering if getting to know &lt;em&gt;R&lt;/em&gt; well enough is worth the time investment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Available packages look quite promising, but there are some issues in my mind that keep me at bay for the time being:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;How efficient is &lt;em&gt;R&lt;/em&gt; when it comes to importing big datasets?&lt;/strong&gt; And first of all, what's &lt;em&gt;big&lt;/em&gt; in terms of &lt;em&gt;R&lt;/em&gt; development? I used to process a couple hundred CSV files in C++ (around 0.5M values I suppose) and I remember it being merely acceptable. What can I expect from &lt;em&gt;R&lt;/em&gt; here? Judging by &lt;a href=&quot;https://quant.stackexchange.com/questions/461/store-tick-data/497#497&quot;&gt;Jeff's spectacular results&lt;/a&gt; I assume with a proper long-term solution (not CSV) I should be even able to switch to tick processing without hindrances. But what about ad-hoc data mangling? Is the difference in performance (compared to more low level implementations) that visible? Or is it just an urban legend?&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;What are the options for GUI development?&lt;/strong&gt; Let's say I would like to go further than research oriented analysis, like developing full blown UIs for investment analytics/trading etc. From what I found mentioned here and on &lt;em&gt;StackOverflow&lt;/em&gt;, with proper bindings I am free to use &lt;em&gt;Python&lt;/em&gt;'s frameworks here and even further chain into &lt;em&gt;Qt&lt;/em&gt; if such a need arises. But deploying such a beast must be a real nuisance. How do you cope with it?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In general I see &lt;em&gt;R&lt;/em&gt;'s flexibility allows me to mix and match it with a plethora of other languages (either way round - using low level additions in &lt;em&gt;R&lt;/em&gt; or embed/invoke &lt;em&gt;R&lt;/em&gt; in projects written in another language). That seems nice, but does it make sense (I mean like thinking about it from start/concept phase, not extending preexisting solutions)? Or is it better to stick with one-and-only language (insert whatever you like/have experience with)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So to sum up: &lt;strong&gt;In what quant finance applications is &lt;em&gt;R&lt;/em&gt; a (really) bad choice (or at least can be)?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="38" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-12-03T11:30:21.613" Title="Switching from C++ to R - limitations/applications" Tags="&lt;r&gt;&lt;development&gt;" AnswerCount="13" CommentCount="8" FavoriteCount="46" ContentLicense="CC BY-SA 2.5" />
  <row Id="729" PostTypeId="1" CreationDate="2011-03-15T19:45:22.620" Score="6" ViewCount="3029" Body="&lt;p&gt;I try to implemente the LSM method with this algorithm but my price is always too low. By example for an American put option with the following parameters:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;S0 = 36, Strike = 40, rate = 6%, T = 1 year, discrete path = 50, volatility = 20%&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I got 4 dollars, but the Longstaff and Schwartz article lists 4.7 dollars. With a volatility of 40%, the error is bigger at 5 dollars for me vs. 7.3 dollars for L&amp;amp;S. But with my tree pricer I have the same result as the L&amp;amp;S article.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you help me to find the error please?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;void LeastSquaresMC::calcLeastSquaresMC()&#xA;{&#xA;&#xA;     mu_ = (rate_ - vol_*vol_*0.5)*dt; // drift&#xA;     voldt = vol_*sqrt(dt); // diffusion&#xA;          for (i = 0; i &amp;lt; M_; i++)&#xA;          {&#xA;               Paths(i,0) = 36;&#xA;&#xA;               for (j = 1; j &amp;lt; b; j++)&#xA;                    {&#xA;                         // generate deviate&#xA;                         deviate = G();&#xA;                         Paths(i,j) =  Paths(i,j-1)*exp(mu_+voldt*deviate);                         &#xA;                    }&#xA;          }&#xA;     // initialize cash flow matrix by zero&#xA;     for (i = 0; i &amp;lt; z; i++)&#xA;          {&#xA;               for (j = 0; j &amp;lt; b; j++)&#xA;                    {&#xA;                         CashFlow(i,j,0);&#xA;                    }&#xA;          }&#xA;&#xA;     for (i = 0; i &amp;lt; z; i++)&#xA;          {&#xA;               for (j = 0; j &amp;lt; b; j++)&#xA;                    {&#xA;                         Exercise(i,j) = MAX(strike_-Paths(i,j),0);&#xA;                    }&#xA;          }&#xA;     // compute cash flows at maturity&#xA;     for (i = 0; i &amp;lt; z; i++)&#xA;          {&#xA;               CashFlow(i,b-1,(Exercise(i,b-1)));&#xA;&#xA;          }&#xA;     //cout &amp;lt;&amp;lt;CashFlow &amp;lt;&amp;lt; endl;&#xA;     // recursion&#xA;     computeLSM(b-1, Paths, CashFlow, Exercise);&#xA;&#xA;}&#xA;&#xA;double LeastSquaresMC::computeLSM(int time, Matrix&amp;amp; Paths, Matrix&amp;amp; CashFlow, Matrix&amp;amp; Exercise)&#xA;{&#xA;&#xA;     double disc = exp(-rate_*dt);     // discount factor&#xA;     vector&amp;lt;double&amp;gt; Y;               // vector of payoffs (dependent variables)&#xA;     vector&amp;lt;double&amp;gt; B;               // vector of regression coefficients&#xA;     vector&amp;lt;double&amp;gt; C;               // continuation&#xA;     vector&amp;lt;int&amp;gt; num;&#xA;     vector&amp;lt;double&amp;gt; stock;          &#xA;     vector&amp;lt;int&amp;gt;::iterator i = num.begin();&#xA;&#xA;&#xA;     /*long z = M_*2;*/&#xA;&#xA;     for (j = 0; j &amp;lt; z; j++)&#xA;          {&#xA;               if(Exercise(j,time-1)&amp;gt;0)&#xA;                    {&#xA;&#xA;                                   Y.push_back(MAX(CashFlow(j,time),0)*disc);&#xA;                                   num.push_back(j);&#xA;                                   stock.push_back(Paths(j,time-1));                    &#xA;                    }&#xA;          }&#xA;&#xA;     if (time &amp;gt; 1)&#xA;          {&#xA;               if(num.empty()==false)&#xA;                    {&#xA;                         int size_l = Y.size();&#xA;                         Matrix X(size_l,3);    // 1 X X^2 (columns)&#xA;&#xA;                         for (j = 0; j &amp;lt; size_l; j++)&#xA;                              {&#xA;                                   X(j,0,1);&#xA;                                   X(j,1,stock[j]);&#xA;                                   X(j,2,stock[j]*stock[j]);&#xA;                              }&#xA;                         B = ((X.transpose()*X).Inverse())*(X.transpose()*Y);&#xA;                         C = X*B;&#xA;                         j=0;&#xA;                         for(i = num.begin() ; i != num.end(); ++i)&#xA;                              {&#xA;                              if (Exercise(*i,time-1)&amp;gt;C[j])&#xA;&#xA;                                   {&#xA;&#xA;                                        CashFlow(*i,time-1,Exercise(*i,time-1));&#xA;                                        for (l = time; l &amp;lt; b; l++)&#xA;                                             {&#xA;                                                  CashFlow(*i,l,0);&#xA;                                             }&#xA;                              j++;&#xA;                              }&#xA;                         computeLSM(time-1, Paths, CashFlow, Exercise);&#xA;                    }&#xA;               else&#xA;                    {&#xA;                         computeLSM(time-1, Paths, CashFlow, Exercise);&#xA;                    }&#xA;               }&#xA;          else&#xA;               {&#xA;                    return computeValue(CashFlow);&#xA;               }&#xA;&#xA;     return 0.0;     &#xA;}&#xA;&#xA;double LeastSquaresMC::computeValue (Matrix&amp;amp; CashFlow)&#xA;{&#xA;&#xA;&#xA;     double discValue = 0.0; // discounted value&#xA;          for (i = 0; i &amp;lt; z; i++)&#xA;               {&#xA;                    for (j = 1; j &amp;lt; b; j++)&#xA;                         {&#xA;                              if (CashFlow(i, j) &amp;gt; 0)&#xA;                              {&#xA;                                   discValue = discValue + CashFlow(i, j)*exp(-0.06*j);&#xA;                              }&#xA;                         }&#xA;               }&#xA;          cout &amp;lt;&amp;lt;&quot;prix:&quot;&amp;lt;&amp;lt;discValue/z &amp;lt;&amp;lt; endl;&#xA; return discValue/z;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user595" LastEditorUserId="35" LastEditDate="2011-03-15T19:58:56.883" LastActivityDate="2013-01-08T11:02:33.393" Title="Longstaff Schwartz method" Tags="&lt;option-pricing&gt;" AnswerCount="3" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="730" PostTypeId="2" ParentId="728" CreationDate="2011-03-15T20:31:39.590" Score="34" Body="&lt;p&gt;Don't have to switch -- it's not &lt;em&gt;either / or&lt;/em&gt; after all. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use either where it has an advantage: R for explorations, modeling, ... and C++ for industrial-strength and high-performance implementations (at a possible cost in terms of time to code).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And (with the obvious &lt;a href=&quot;http://dirk.eddelbuettel.com/code/rcpp.html&quot;&gt;Rcpp&lt;/a&gt; plug coming) you can even combine both of them.&lt;/p&gt;&#xA;" OwnerUserId="69" LastActivityDate="2011-03-15T20:31:39.590" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="731" PostTypeId="2" ParentId="728" CreationDate="2011-03-15T20:34:13.547" Score="26" Body="&lt;p&gt;R can be pretty slow, and it's very memory-hungry. My data set is only 8 GB or so, and I have a machine with 96 GB of RAM, and I'm always wrestling with R's memory management. Many of the model estimation functions capture a link to their environment, which means you can be keeping a pointer to each subset of the data that you're dealing with. SAS was much better at dealing with large-ish data sets, but R is much nicer to deal with. (This is in the context of mortgage prepayment and default modeling.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Importing the data sets is pretty easy and fast enough, in my experience. It's the ballooning memory requirements for actually processing that data that's the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anything that isn't easily vectorizable seems like it would be a problem. P&amp;amp;L backtesting for a strategy that depends on the current portfolio state seems hard. If you're looking at the residual P&amp;amp;L from hedging a fixed-income portfolio, with full risk metrics, that's going to be hard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I doubt many people would want to write a term structure model in R or a monte-carlo engine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even with all that, though, R is a very useful tool to have in your toolbox. But it's not exactly a computational powerhouse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know anything about the GUI options.&lt;/p&gt;&#xA;" OwnerUserId="596" LastActivityDate="2011-03-15T20:34:13.547" CommentCount="12" ContentLicense="CC BY-SA 2.5" />
  <row Id="732" PostTypeId="2" ParentId="692" CreationDate="2011-03-15T21:08:52.050" Score="21" Body="&lt;p&gt;There are a wide variety of models (by which I mean the theoretical / mathematical formulation of how the underlying financial variable(s) of interest behave).  The most popular ones differ depending on the asset class under consideration (though some are mathematically the same and named differently).  Some examples are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Black-Scholes / Black / Garman-Kohlhagan&lt;/li&gt;&#xA;&lt;li&gt;Local-volatility [aka Dupire model]&lt;/li&gt;&#xA;&lt;li&gt;Stochastic-volatility - a generic term for extensions of Black-Scholes where there is a second stochastic factor driving the volatility of the spot; examples are Heston, SABR&lt;/li&gt;&#xA;&lt;li&gt;Levy processes (usually actually log-Levy): a wide class of models with some features that make them theoretically / technically nice; examples are VG, CGMY&lt;/li&gt;&#xA;&lt;li&gt;jumps (often compound Poisson) of various kinds can be added to the above models, for example Merton model is Black-Scholes with jumps&lt;/li&gt;&#xA;&lt;li&gt;CIR, OU processes show up in fixed-income&lt;/li&gt;&#xA;&lt;li&gt;There are multi-factor (ie multiple driving Brownian motions) versions of the above; e.g. Libor market model, correlated log-normal models&lt;/li&gt;&#xA;&lt;li&gt;Models for pricing, say, credit-default swaps are often Poisson processes with random hazard rates&lt;/li&gt;&#xA;&lt;li&gt;Commodities such as electricity can require specialized models to handle the particular features of that market&lt;/li&gt;&#xA;&lt;li&gt;etc.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Implementation methodologies can include:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;analytic formulae (usually involving special functions): examples are the classic case of European-style vanilla options in Black-Scholes / CEV / VG; many exotics in black-scholes can be &quot;solved&quot; in this way&lt;/li&gt;&#xA;&lt;li&gt;approximate analytic - for example, one might price average-rate options in Black-Scholes by approximating the final distribution (by moment-matching) with a shifted-lognormal and using the closed-form for the shifted-lognormal&lt;/li&gt;&#xA;&lt;li&gt;Binomial / trinomial trees can be viewed as a discretization technique for approximating, say, Black-Scholes.  (Note that some people might view the approximation as a model in its own right --- a conflation of model &amp;amp; implementation and more of a philosophical stance than a practical consideration.)&lt;/li&gt;&#xA;&lt;li&gt;Numerical methods for solving or approximating the PDE governing the option price; this could be solved by finite-difference methods, finite-element methods, etc.&lt;/li&gt;&#xA;&lt;li&gt;Monte-carlo is a nice brute-force way to handle almost any kind of model and most options (though there are complications with early-exercise style features of options), but it typically takes a lot of computing power to get any accuracy in the price&lt;/li&gt;&#xA;&lt;li&gt;Interpolation could be viewed as a technique --- if you know the price of a collection of options (varying in some parameters) you can price a new option by interpolating based on the parameters (volatility surfaces implemented by interpolating a grid of given options are examples of this)&lt;/li&gt;&#xA;&lt;li&gt;etc.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="540" LastActivityDate="2011-03-15T21:08:52.050" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="733" PostTypeId="1" CreationDate="2011-03-15T23:23:03.760" Score="4" ViewCount="225" Body="&lt;p&gt;I'm having a hard time getting my expected loss calculations to tie out with the standard recursion method when implementing the proxy distribution algorithm described by the Back To Normal CDO paper by Shelton.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone have working code examples for this? &lt;/p&gt;&#xA;" OwnerDisplayName="user597" LastActivityDate="2011-03-19T17:31:39.523" Title="Any example code implementing the Shelton CDO 'Back To Normal' Paper?" Tags="&lt;structured-credit&gt;&lt;cdo&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="734" PostTypeId="2" ParentId="725" CreationDate="2011-03-16T11:32:06.240" Score="3" Body="&lt;p&gt;I get my stock data from Univ of Chicago's &lt;a href=&quot;http://www.crsp.com/&quot; rel=&quot;nofollow&quot;&gt;Center for Research in Security Prices&lt;/a&gt; (CRSP), which keeps stocks after delisting, so there's no survivorship bias. I assume that Bloomberg and Reuters do the same. But if you use Yahoo! or Google, there will be a survivorship bias.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think that trying to look at bankruptcies to remove a survivorship bias would be really challenging (not all bankruptcies result in delisting), and might insert an error bigger than survivorship bias. But &lt;a href=&quot;http://www.compustat.com/&quot; rel=&quot;nofollow&quot;&gt;Compustat&lt;/a&gt; provides more corporate finance data than almost anyone knows what to do with.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure that there's a clean work-around for survivorship bias short of moving to a data set like CRSP. HTH.&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-03-16T11:32:06.240" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="735" PostTypeId="2" ParentId="708" CreationDate="2011-03-16T11:46:59.440" Score="6" Body="&lt;p&gt;Have you looked into &quot;noise trader&quot; models? This seems like a market that is mostly noise. A few betters may have some information on or real knowledge of who might win, but certainly nothing like equity markets where there are a lot of people who really know the ins and outs of the firms they're trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The classic model is Pete Kyle's, which should give you some of the intuition, although here I don't think there are an &quot;liquidity&quot; traders -- just noise and informed. This model isn't very applied, but the conclusions should help you develop your picture and you can probably find a lot of working papers in SSRN.com that apply the model in a way that you can use...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found the &lt;a href=&quot;http://www.arw-suisse.ch/doctoralpapers/Kyle%201985.pdf&quot;&gt;Kyle paper&lt;/a&gt;, but it's Econometrica, so it may be a little dense for an introduction. &lt;a href=&quot;http://www.londoninternational.ac.uk/current_students/programme_resources/lse/lse_pdf/further_units/invest_man/23_invest_man_chap4.pdf&quot;&gt;This textbook chapter&lt;/a&gt; may be a better introduction to see if it's something you'd like to pursue.&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-03-16T11:46:59.440" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="737" PostTypeId="1" AcceptedAnswerId="744" CreationDate="2011-03-16T14:43:08.900" Score="11" ViewCount="786" Body="&lt;p&gt;Do you think Walk Forward Analysis is a good method to estimate the predictability or edge of a trading system? Are there similar methods to know (estimate) how much alpha can capture an algo (in the future)?&lt;/p&gt;&#xA;" OwnerUserId="82" LastEditorUserId="1355" LastEditDate="2011-09-22T01:25:23.240" LastActivityDate="2011-09-22T01:25:23.240" Title="Is Walk Forward Analysis a good method to estimate the edge of a trading system?" Tags="&lt;analysis&gt;&lt;simulations&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="738" PostTypeId="1" AcceptedAnswerId="745" CreationDate="2011-03-16T16:33:53.857" Score="13" ViewCount="2716" Body="&lt;p&gt;I built risk models using cluster analysis in a previous life. Years ago I learned about principal component analysis and I've often wondered whether that would have been more appropriate. What are the pros and cons of using PCA as opposed to clustering to derive risk factors?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it makes a difference, I'm using the risk models for portfolio optimization, not performance attribution.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-03-18T16:44:59.183" Title="Cluster analysis vs PCA for risk models?" Tags="&lt;risk-models&gt;&lt;pca&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 2.5" />
  <row Id="739" PostTypeId="1" AcceptedAnswerId="58450" CreationDate="2011-03-16T18:23:28.733" Score="13" ViewCount="16986" Body="&lt;p&gt;The nice list of free online data sources &lt;a href=&quot;https://quant.stackexchange.com/questions/141/data-sources-online&quot;&gt;What data sources are available online?&lt;/a&gt; does not mention any data from ratings agencies.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Are historical time series available for sovereign credit ratings (other than as proprietary datasets)?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I realise that the ratings agencies probably would claim their ratings of sovereign debt as proprietary data, yet due to the way this information is disseminated and used it appears to be in the public interest for it to be available freely, and it also appears possible to recover some parts of the time series from the public domain.  However, I cannot locate any free sources.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Guardian made available &lt;a href=&quot;http://www.guardian.co.uk/news/datablog/2010/apr/30/credit-ratings-country-fitch-moodys-standard&quot; rel=&quot;noreferrer&quot;&gt;a snapshot in July 2010&lt;/a&gt;, but I would like to analyse how the ratings have changed over time.  I would be happy with a subset where nontrivial changes have taken place: for instance, a series for just Greece and Japan would be of interest.  I can of course deduce some of the few unchanging series myself.&lt;/p&gt;&#xA;" OwnerUserId="599" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2021-03-12T05:23:18.923" Title="Are public historical time series available for ratings of sovereign debt?" Tags="&lt;data&gt;&lt;time-series&gt;&lt;credit-ratings&gt;" AnswerCount="6" CommentCount="0" FavoriteCount="10" ContentLicense="CC BY-SA 2.5" />
  <row Id="740" PostTypeId="1" AcceptedAnswerId="1874" CreationDate="2011-03-16T18:42:23.607" Score="15" ViewCount="10101" Body="&lt;p&gt;I am seeing a regression model which is regressing Year-on-Year stock index returns on lagged (12 months) Year-on-Year returns of the same stock index, credit spread (difference between monthly mean of risk-free bonds and corporate bond yields), YoY inflation rate and YoY index of industrial production.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks thus (though you'd substitute the data specific to India in this case):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;SP500YOY(T) = a + b1*SP500YOY(T-12) + b2*CREDITSPREAD(T) &#xA;                + b4*INDUSTRIALPRODUCTION(T+2) + b3*INFLATION(T+2)&#xA;                + b4*INFLATIONASYMM(T+2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;SP500YOY&lt;/code&gt; is the year-on-year returns for S&amp;amp;P500 index To compute this, monthly average of S&amp;amp;P500 values is computed and then converted to year-on-year returns for each month (i.e. Jan'10-Jan'11, Feb'10-Feb'11, Mar'10-Mar'11, . . ). On the explanatory variables side, a 12-month lagged value of the &lt;code&gt;SP500YOY&lt;/code&gt; is used along with the &lt;code&gt;CREDITSPREAD&lt;/code&gt; at time &lt;code&gt;T&lt;/code&gt; and &lt;code&gt;INFLATION&lt;/code&gt; and &lt;code&gt;INDUSTRIALPRODUCTION&lt;/code&gt; two period AHEAD. The &lt;code&gt;INFLATIONASYMM&lt;/code&gt; is a dummy for whether the Inflation is above a threshold value of 5.0%. The index in the parenthesis shows the time index for each variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is estimated by standard OLS linear regression. To use this model for forecasting the 1,2 and 3-months ahead YOY returns of S&amp;amp;P500, one has to generate 3,4 and 5-month ahead forecasts for Inflation and the Index of Industrial Production. These forecasts are done after fitting an ARIMA model to each of the two individually. The CreditSpread forecasts for 1,2 and 3 month ahead are just thrown in as mental estimates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to know whether this OLS linear regression is correct/incorrect, efficient/inefficient or generally valid statistical practice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first problem I see is that of using overlapping data. i.e. the daily values of the stock index are averaged each month, and then used to compute yearly returns which are rolled over monthly. This should make the error term autocorrelated. I would think that one would have to use some 'correction' on the lines of one of the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;White's heteroscedasticity consistent covariance estimator&lt;/li&gt;&#xA;&lt;li&gt;Newey &amp;amp; West heteroscedasticity and autocorrelation consistent (HAC) estimator&lt;/li&gt;&#xA;&lt;li&gt;heteroscedasticity-consistent version of Hansen &amp;amp; Hodrick&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Does it really make sense to apply standard OLS linear regression (without any corrections) to such overlapping data, and more so, use 3-period ahead ARIMA forecasts for explanatory variables to use in the original OLS linear regression for forecasting &lt;code&gt;SP500YOY&lt;/code&gt;? I have not seen such a form before, and hence cannot really judge it, without the exception of correcting for the use of overlapping observations.&lt;/p&gt;&#xA;" OwnerUserId="139" LastEditorUserId="1355" LastEditDate="2011-09-09T13:01:57.130" LastActivityDate="2011-09-09T15:07:30.500" Title="Time Series Regression with Overlapping Data" Tags="&lt;time-series&gt;&lt;regression&gt;&lt;auto-correlation&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="741" PostTypeId="2" ParentId="739" CreationDate="2011-03-16T21:25:56.153" Score="12" Body="&lt;p&gt;&lt;strong&gt;Fitch&lt;/strong&gt; should be available right here: &lt;em&gt;&lt;a href=&quot;http://www.fitchratings.com/web_content/ratings/sovereign_ratings_history.xls&quot; rel=&quot;noreferrer&quot;&gt;Sovereign Ratings History&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &lt;strong&gt;Moody's&lt;/strong&gt; it's not so easy, I don't know if there's a complete source available free of charge. But &lt;em&gt;&lt;a href=&quot;http://v2.moodys.com/cust/content/content.ashx?source=StaticContent/Free%20Pages/Credit%20Policy%20Research/documents/current/2007100000482445.pdf&quot; rel=&quot;noreferrer&quot;&gt;Sovereign Default and Recovery Rates, 1983-2007&lt;/a&gt;&lt;/em&gt; has some data in the appendix III, though not so up to date and in a not that convenient format.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Same goes about &lt;strong&gt;S&amp;amp;P&lt;/strong&gt;, &lt;em&gt;&lt;a href=&quot;http://www2.standardandpoors.com/spf/pdf/fixedincome/KR_sovereign_SovRatingsHistorySince1975.pdf&quot; rel=&quot;noreferrer&quot;&gt;Sovereign Ratings History Since 1975&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;UPDATE: That link no longer works. Start page for all S&amp;amp;P ratings is&#xA;  here: &lt;a href=&quot;http://www.standardandpoors.com/ratings/en/ap/&quot; rel=&quot;noreferrer&quot;&gt;http://www.standardandpoors.com/ratings/en/ap/&lt;/a&gt; You can see&#xA;  latest ratings only. Clicking a country name requires a (free) login,&#xA;  but still only shows the latest data (though it does then have links&#xA;  to methodology, background articles, etc.)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Maybe someone will be able to come up with more edible formats though.&lt;/p&gt;&#xA;" OwnerUserId="38" LastEditorUserId="1587" LastEditDate="2013-09-04T01:03:55.317" LastActivityDate="2013-09-04T01:03:55.317" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="742" PostTypeId="1" CreationDate="2011-03-17T00:01:16.817" Score="4" ViewCount="797" Body="&lt;p&gt;I am implementing a program in Java that needs the Bank of England base rate. Rather than the user inputting this into the system, I have heard that there is a way to get a &lt;strong&gt;live feed&lt;/strong&gt; of the base rate directly from (I am guessing) the Bank of England (i.e. gets automatically updated). Has anyone heard of or used something similar? - any advice would be helpful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="603" LastActivityDate="2011-03-17T11:01:11.940" Title="Bank of England base rate feed" Tags="&lt;interest-rates&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="743" PostTypeId="2" ParentId="742" CreationDate="2011-03-17T00:13:31.780" Score="2" Body="&lt;p&gt;I'm not sure if this is what you're looking for, but they keep it updated on their homepage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.bankofengland.co.uk/&quot; rel=&quot;nofollow&quot;&gt;http://www.bankofengland.co.uk/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Current Bank Rate is shown in the top of the box in the bottom right corner!&lt;/p&gt;&#xA;" OwnerUserId="604" LastActivityDate="2011-03-17T00:13:31.780" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="744" PostTypeId="2" ParentId="737" CreationDate="2011-03-17T01:50:55.597" Score="7" Body="&lt;p&gt;The term &quot;Walk Forward Analysis&quot; typically comes from technical analysis schemes.   If that's the case here, I would be careful with whatever you're considering (or reading).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even if you tune your model parameters (and I'm not talking about any TA scheme) with 80% of the data and then &quot;check&quot; your model with the remaining 20%, you're still using that last 20% to determine if your model is useful.   As a result, whatever model you assemble/test/retest, the reality is, even if there is a solid basis for the structure of the model, the only way to prove its value is to use it in real time.   So, it is worthwhile to build tests that allow you to dump your model at the first sign of trouble.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From personal experience, I can tell you that you'll dump far more models than you'll keep.&lt;/p&gt;&#xA;" OwnerUserId="392" LastActivityDate="2011-03-17T01:50:55.597" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="745" PostTypeId="2" ParentId="738" CreationDate="2011-03-17T02:18:02.813" Score="5" Body="&lt;p&gt;I've played around with both schemes, but not for portfolio optimization.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used PCA on some interest rate models.  That turned into a Partial Least Squares scheme, then into some non-linear thing.   I wasn't impressed with the results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My Cluster Analysis scheme morphed into a classification scheme, and it turned out that the K-Nearest-Neighbor method worked just as well, and possibly better.  Again, this wasn't for portfolio optimization, so it may not apply to your situation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From what I've seen, if you're depending on the computational method to find excess returns (or lower risk), you'll probably be disappointed.   On the other hand, it is common for various methods to highlight some problems that weren't originally obvious.   For instance, bootstrapping your portfolio(s) to determine just how good they are compared to luck.    I've dumped a lot of ideas because of that issue.&lt;/p&gt;&#xA;" OwnerUserId="392" LastActivityDate="2011-03-17T02:18:02.813" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="746" PostTypeId="2" ParentId="742" CreationDate="2011-03-17T11:01:11.940" Score="2" Body="&lt;p&gt;As suggested by &lt;em&gt;Owe&lt;/em&gt;, you could use the &lt;em&gt;Statistics&lt;/em&gt; part of the &lt;em&gt;BoE&lt;/em&gt; website. It's not like the rate is changing every second, so you don't really need a &lt;strong&gt;live&lt;/strong&gt; feed, I suppose.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could update it on every start - for example using the &lt;a href=&quot;http://www.bankofengland.co.uk/mfsd/iadb/index.asp?Travel=NIxSTxTIx&amp;amp;levels=1&amp;amp;XNotes=Y&amp;amp;G0Xtop.x=44&amp;amp;G0Xtop.y=13&amp;amp;C=13T&amp;amp;XNotes2=Y&amp;amp;Nodes=X3687X3688X3691X3694X3716X3738X3754X3757X3764X3771X3774&amp;amp;SectionRequired=I&amp;amp;HideNums=-1&amp;amp;ExtraInfo=false#BM&quot; rel=&quot;nofollow&quot;&gt;Interest and Exchange Rates tables&lt;/a&gt;. Just generate the format you like, and download/import it to your program. For instance, here's a direct link to &lt;a href=&quot;http://www.bankofengland.co.uk/mfsd/iadb/fromshowcolumns.asp?Travel=NIxSTxTIxSUx&amp;amp;FromSeries=1&amp;amp;ToSeries=50&amp;amp;DAT=ALL&amp;amp;VFD=Y&amp;amp;csv.x=8&amp;amp;csv.y=26&amp;amp;CSVF=TT&amp;amp;C=13T&amp;amp;Filter=N&quot; rel=&quot;nofollow&quot;&gt;daily data in CSV&lt;/a&gt;. Parsing it shouldn't be much of a problem.&lt;/p&gt;&#xA;" OwnerUserId="38" LastActivityDate="2011-03-17T11:01:11.940" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="747" PostTypeId="1" AcceptedAnswerId="2125" CreationDate="2011-03-17T12:58:09.200" Score="15" ViewCount="466" Body="&lt;p&gt;If one wants to smooth a time series using a window function such as Hanning, Hamming, Blackman etc. what are the considerations for favouring any one window over another?&lt;/p&gt;&#xA;" OwnerUserId="252" LastEditorUserId="1355" LastEditDate="2011-09-12T01:04:35.067" LastActivityDate="2011-10-06T17:04:17.837" Title="What should be considered when selecting a windowing function when smoothing a time series?" Tags="&lt;time-series&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="748" PostTypeId="1" AcceptedAnswerId="750" CreationDate="2011-03-17T18:22:34.583" Score="16" ViewCount="4277" Body="&lt;p&gt;Hy I posted this question first at &lt;a href=&quot;http://www.mathflow.net&quot; rel=&quot;nofollow noreferrer&quot;&gt;mathflow.net&lt;/a&gt; they suggested me this page, which I was not aware of.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $(X_1,X_2)$ be a multivariate normal random vector ($X_1$ and $X_2$ need not be independent). Is it possible to calculate&#xA;$$VaR_{\alpha}(e^{X_1}+e^{X_2})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;analyticaly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or is it even possible to calulate it in terms of&#xA;$VaR_{\alpha}(e^{X_1})$ and $VaR_{\alpha}(e^{X_2})$&#xA;i.e. is there a representation (a function $g(\cdot,\cdot)$ ) of the form&#xA;$$VaR_{\alpha}(e^{X_1}+e^{X_2})=g(VaR_{\alpha}(e^{X_1}),VaR_{\alpha}(e^{X_2})).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The case where $X_1$ and $X_2$ are independent could be aproached in terms of convolution which dont give in my eyes any impression if it is analyticaly tractable.&lt;/p&gt;&#xA;" OwnerUserId="608" LastEditorUserId="467" LastEditDate="2016-11-23T01:19:35.820" LastActivityDate="2016-11-23T01:19:35.820" Title="How to compute the Value-at-Risk of the sum of two dependent lognormal random variables?" Tags="&lt;risk-management&gt;&lt;var&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="749" PostTypeId="2" ParentId="748" CreationDate="2011-03-17T20:16:59.863" Score="2" Body="&lt;p&gt;For independent random variables the variance of a sum is the sum of the variances. If the random variables are not independent, then there's a covariance term $$Var(X_1 + X_2) = VarX_1 + VarX_2 + 2*Cov(X_1, X_2)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Exponentiating doesn't change this relation; it just makes your random variable log-normal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe you're looking for &lt;a href=&quot;http://en.wikipedia.org/wiki/Stein%27s_lemma&quot; rel=&quot;nofollow&quot;&gt;Steins's lemma&lt;/a&gt;? Is there a further downstream question?&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-03-17T20:16:59.863" CommentCount="6" ContentLicense="CC BY-SA 2.5" />
  <row Id="750" PostTypeId="2" ParentId="748" CreationDate="2011-03-17T20:24:11.480" Score="6" Body="&lt;p&gt;The answer is no, to my knowledge. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suggest you take look at &lt;strong&gt;&lt;a href=&quot;https://mathoverflow.net/questions/30619/sum-of-log-normal-random-variables&quot; title=&quot;MathOverflow&quot;&gt;this thread on MO&lt;/a&gt;&lt;/strong&gt;, about the sum of log normal random variables. A few of the articles mentioned there might help you.&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="-1" LastEditDate="2017-04-13T12:58:47.233" LastActivityDate="2012-01-27T06:08:49.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="751" PostTypeId="1" CreationDate="2011-03-18T01:31:59.063" Score="25" ViewCount="4154" Body="&lt;p&gt;There is a large literature covering volatility forecasts with high-frequency tick data.  Much of this has surrounded the concept of &quot;realized volatility&quot;, such as:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.ssc.upenn.edu/~fdiebold/papers/paper29/temp.pdf&quot;&gt;&quot;Realized Volatility and Correlation&quot;&lt;/a&gt; (Andersen, Bollerslev, Diebold, and Labys 1999)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.ssc.upenn.edu/~fdiebold/papers/paper29/temp.pdf&quot;&gt;&quot;Modeling and Forecasting Realized Volatility&quot;&lt;/a&gt; (Andersen, Bollerslev, Diebold, and Labys 1999)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Other efforts have looked at high/low data to improve the forecast without including all the tick data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Robert Almgrem has &lt;a href=&quot;http://www.courant.nyu.edu/~almgren/timeseries/notes7.pdf&quot;&gt;a nice lecture on the subject&lt;/a&gt; as part of his &lt;a href=&quot;http://www.courant.nyu.edu/~almgren/timeseries/&quot;&gt;&quot;Time Series Analysis and Statistical Arbitrage&quot;&lt;/a&gt; course at NYU.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the best way for forecast volatility using high-frequency data?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: A similar question was previously &lt;a href=&quot;http://www.wilmott.com/messageview.cfm?catid=38&amp;amp;threadid=62514&quot;&gt;asked on Wilmott&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2014-06-28T07:20:20.423" Title="How to forecast volatility using high-frequency data?" Tags="&lt;volatility&gt;&lt;forecasting&gt;&lt;high-frequency&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="21" ContentLicense="CC BY-SA 2.5" />
  <row Id="752" PostTypeId="2" ParentId="575" CreationDate="2011-03-18T14:51:39.827" Score="2" Body="&lt;p&gt;Have you considered Dynamic Liner Models? I don't know enough about currencies or DLMs to give any more guidance, but it may be worth a few minutes of googling to see if you can apply it.&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-03-18T14:51:39.827" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="753" PostTypeId="1" AcceptedAnswerId="770" CreationDate="2011-03-18T15:40:17.987" Score="11" ViewCount="1495" Body="&lt;p&gt;Suppose I have  trend following strategy(on close to close data) that is not getting acceptable returns for some time. When should I start thinking about shutting it down? &lt;/p&gt;&#xA;" OwnerUserId="155" LastActivityDate="2011-03-24T03:46:22.633" Title="When to shut down a trend following strategy?" Tags="&lt;arbitrage&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 2.5" />
  <row Id="754" PostTypeId="2" ParentId="753" CreationDate="2011-03-18T15:57:57.960" Score="6" Body="&lt;p&gt;You can use a equity based model. Stop trading when your equity drops below your &quot;X-day&quot; equity moving average, and resume trading when your equity crosses above the &quot;X day&quot; equity moving average. You could also do this by measuring the slope of the curve, and not trading when the slope is statistically below 0. I like this method because it does not tie your decision to whether or not the trend following strategy does not work, or even I there is really a trend, but is purely based upon monetary concerns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Ralph Winters&lt;/p&gt;&#xA;" OwnerUserId="520" LastActivityDate="2011-03-18T15:57:57.960" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="755" PostTypeId="2" ParentId="753" CreationDate="2011-03-18T16:02:34.780" Score="9" Body="&lt;p&gt;You ought to have pre-determined &quot;kill&quot; switches, like a maximum allowable &lt;em&gt;drawdown&lt;/em&gt; or &lt;em&gt;time-from-high&lt;/em&gt;. Ideally you should get an idea of what these values would be from your backtests.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you do shutdown a model, don't just throw away the code. The strategy might not be working at the moment, but it could come back in the future. I just heard that models turned-off years ago are now working as of this week because of the higher volatility. Of course it helps if you can do automated paper trading with reasonable accuracy.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-03-18T16:02:34.780" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="756" PostTypeId="2" ParentId="738" CreationDate="2011-03-18T16:44:59.183" Score="7" Body="&lt;p&gt;They are not mutually exclusive. PCA and clustering are similar but used for different purposes.  You could use PCA to whittle down 10 risk factors to say 4 uncorrelated factors, and you could combine securities with different FACTORS into different clusters with offsetting returns and variance characteristics. However, when you say you want to derive risk factors, that implies that you are dealing more with variables, and PCA (or factor analysis) is more appropriate. If you are really interested in risk segments across nominal variables, say asset classes, you would be interest more in clustering.&lt;/p&gt;&#xA;" OwnerUserId="520" LastActivityDate="2011-03-18T16:44:59.183" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="757" PostTypeId="1" AcceptedAnswerId="758" CreationDate="2011-03-18T17:01:36.673" Score="3" ViewCount="3353" Body="&lt;p&gt;I am using the Mersenne twister random number generator in Java for a Monte Carlo Simulation. I need a uniform distribution of values between -1 and 1. My code is below (I am importing &lt;a href=&quot;http://commons.apache.org/math/apidocs/org/apache/commons/math/random/MersenneTwister.html&quot; rel=&quot;nofollow&quot;&gt;org.apache.commons.math.random.MersenneTwister&lt;/a&gt;, which is a Apache Commons library that contains the methods I am calling). &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for(int i = 0; i&amp;lt;= NumberOfTrials-1; i++ ) {  &#xA;    MersenneTwister mtsign = new MersenneTwister();  &#xA;    boolean sign = mtsign.nextBoolean();            // random true or false  &#xA;    MersenneTwister mt = new MersenneTwister();  &#xA;    if (sign=true){  &#xA;        random[i] = mt.nextDouble(); }  //i.e. (random number between 0 and 1)  &#xA;    else if (sign=false){  &#xA;        random[i] = - mt.nextDouble(); }   // i.e. random number beween -1 and 0   &#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Each index of the resulting array, &lt;code&gt;random[]&lt;/code&gt;, contains the same value for some reason (and all are positive as boolean keeps returning true). Any thoughts/advice is greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="603" LastEditorUserId="603" LastEditDate="2011-03-25T12:54:12.467" LastActivityDate="2011-03-25T12:54:12.467" Title="Mersenne twister random number generator in Java for Monte Carlo Sim." Tags="&lt;monte-carlo&gt;&lt;programming&gt;&lt;random-walk&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="758" PostTypeId="2" ParentId="757" CreationDate="2011-03-18T18:08:34.780" Score="7" Body="&lt;p&gt;The problem is that you are creating a new random number generator for each iteration. Move &lt;code&gt;new MersenneTwister()&lt;/code&gt; out of the loop:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;MersenneTwister mtsign = new MersenneTwister();&#xA;MersenneTwister mt = new MersenneTwister();&#xA;for(int i = 0; i&amp;lt;= NumberOfTrials-1; i++ ) {&#xA;  // use mtsign and mt here&#xA;  ...&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Furthermore, you don't need two generators, you can just rescale:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;MersenneTwister mt = new MersenneTwister();  &#xA;for(int i = 0; i&amp;lt;= NumberOfTrials-1; i++ ) {  &#xA;   random[i] = mt.nextDouble() * 2 - 1;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Lastly, in your code, you may need to push the generator even further up the call tree to avoid generating the same sequence repeatedly.&lt;/p&gt;&#xA;" OwnerUserId="90" LastEditorUserId="90" LastEditDate="2011-03-18T18:14:47.910" LastActivityDate="2011-03-18T18:14:47.910" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="760" PostTypeId="1" AcceptedAnswerId="773" CreationDate="2011-03-18T19:01:20.253" Score="11" ViewCount="1978" Body="&lt;p&gt;I came across this &lt;a href=&quot;http://historysquared.com/2011/01/31/open-interest-in-futures-markets-predicts-stock-bond-commodity-and-currency-prices-says-study/&quot;&gt;article&lt;/a&gt; and became curious. Can the futures market's open interest really predict market action? &lt;/p&gt;&#xA;" OwnerUserId="520" LastEditorUserId="20795" LastEditDate="2019-09-08T08:00:58.303" LastActivityDate="2019-09-08T08:00:58.303" Title="Can the futures market's open interest predict commodity, treasury, and equity returns?" Tags="&lt;futures&gt;&lt;trading&gt;&lt;forecasting&gt;&lt;prediction&gt;&lt;open-interest&gt;" AnswerCount="4" CommentCount="6" FavoriteCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="761" PostTypeId="2" ParentId="691" CreationDate="2011-03-18T19:21:29.017" Score="4" Body="&lt;p&gt;Here is another link to some non-financial data sets from the University of California Machine Learning Repository:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.ics.uci.edu/~mlearn/MLRepository.html&quot; rel=&quot;nofollow&quot;&gt;http://www.ics.uci.edu/~mlearn/MLRepository.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="520" LastActivityDate="2011-03-18T19:21:29.017" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="762" PostTypeId="2" ParentId="364" CreationDate="2011-03-18T22:19:15.097" Score="8" Body="&lt;p&gt;This question requires a comprehensive answer, perhaps beyond the confines of my input box :) Suffices here to state the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;strong&gt;First Fundamental Theorem of Asset Pricing&lt;/strong&gt; states that in an arbitrage-free market, there exists a (&quot;net&quot;) present value function, that is, a linear valuation rule whose value is zero when evaluated in any traded cash-flow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is an existence theorem, and it does not depend on the theoretical or &quot;real&quot; form of the market. It does not depend on discrete or continuous time modeling, as it does not depend on whether there are transaction costs, trading constraints, or missing markets. All we need to have is the assumption that we can undertake two or more trades simultaneously, that we can scale them up, and that for every given trade, we can have its &quot;mirror&quot; in the market - that is, that we have a linear vector space of traded cashflows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;strong&gt;Second Fundamental Theorem of Asset Pricing&lt;/strong&gt; states that when an arbitrage-free market is &quot;complete&quot;, the linear valuation rule is unique.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is also true that these two &lt;em&gt;separate&lt;/em&gt; theorems with different implications, are more often than not, presented in a fused form. This can be confusing. Proofs of these facts are virtually in every graduate asset pricing book. My favourite one is Duffie's 'Dynamic Asset Pricing Theory'.&lt;/p&gt;&#xA;" OwnerUserId="114" LastEditorUserId="114" LastEditDate="2012-03-29T20:31:20.233" LastActivityDate="2012-03-29T20:31:20.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="763" PostTypeId="2" ParentId="575" CreationDate="2011-03-18T23:00:00.450" Score="3" Body="&lt;p&gt;This link is to a book that covers this exact question:&#xA;&lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1002/9783527610006.ch9/summary&quot; rel=&quot;nofollow&quot;&gt;http://onlinelibrary.wiley.com/doi/10.1002/9783527610006.ch9/summary&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Summary:  the models that map to both stock markets and currency markets are those that have an autoregressive feature (curreny markets commonly exhibit this feature, limiting the choice of models that apply to both currencies and stocks =&gt; *ARCH).  &lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-03-18T23:00:00.450" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="764" PostTypeId="1" AcceptedAnswerId="766" CreationDate="2011-03-19T01:06:54.647" Score="7" ViewCount="3724" Body="&lt;p&gt;From what I understand, Black-Scholes equation in finance is used to price options which are a contract between a potential buyer and a seller. Can I use this mathematical framework to &quot;buy&quot; a stock? I do not have the choice using options in the market I am dealing with -- I either buy something or I don't. So I was wondering if B-S be used to decide to buy a stock, the next day, taking its last price, volatility and other necessary variables into account.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;" OwnerUserId="616" LastEditorUserId="69" LastEditDate="2011-03-19T12:20:45.817" LastActivityDate="2013-04-09T10:48:19.317" Title="Using Black-Scholes equations to &quot;buy&quot; stocks" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;differential-equations&gt;&lt;prediction&gt;" AnswerCount="10" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="765" PostTypeId="2" ParentId="753" CreationDate="2011-03-19T01:27:48.857" Score="5" Body="&lt;p&gt;I typically have several tests.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like Ralph Winters said, one calculation to use is the equity curve.  I use &quot;...equity curve slope must be greater than x1...&quot; to continue using a model.   Another test is, &quot;...%wins must be greater than x2...&quot;.  Another is, &quot;...average %return per winning transaction must be greater than x3...&quot;.  Another is &quot;...%return per losing transaction must be less than x4...&quot;.   Other tests depend on what phase the economy is in, level of various volatilities, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea is to make models that can be compared with each other, older models, newer models, and the level of risk that is acceptable.&lt;/p&gt;&#xA;" OwnerUserId="392" LastEditorUserId="392" LastEditDate="2011-03-19T02:42:23.207" LastActivityDate="2011-03-19T02:42:23.207" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="766" PostTypeId="2" ParentId="764" CreationDate="2011-03-19T02:46:31.160" Score="9" Body="&lt;p&gt;An equity represents ownership of a company and may be thought of as a derivative on the cash flow. For this reason, equities are valued through &lt;strong&gt;discounted cash-flow&lt;/strong&gt; (DCF) analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An option is a &lt;em&gt;right&lt;/em&gt;, though not an obligation, to buy or sell an asset at a fixed price at some point in the future. As per Black-Scholes, the value of an at-the-money option is principally determined by the &lt;em&gt;time&lt;/em&gt; to expiration and the &lt;em&gt;volatility&lt;/em&gt; of the underlying's price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equities are very different from options:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The &lt;em&gt;volatility&lt;/em&gt; of the cash flows cannot be modeled by Brownian motion. Instead, volatility is represented by the discounting factor in DCF used to determine the present value.&lt;/li&gt;&#xA;&lt;li&gt;Equities don't have an &lt;em&gt;expiration&lt;/em&gt;, so their value can't simply decrease to zero over time.&lt;/li&gt;&#xA;&lt;li&gt;Equities don't really confer a &lt;em&gt;right&lt;/em&gt; to the cash flow; there is a whole series of corporate governance on that one.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In short, the features of equities and options are so vastly different that their valuation techniques must be distinct.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-03-19T02:46:31.160" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="767" PostTypeId="2" ParentId="764" CreationDate="2011-03-19T15:10:22.313" Score="2" Body="&lt;p&gt;Yes, this certainly is valid point of view, if you are thinking about purchase the stock outright rather than with options.  In theory, if the Implied Volatility of calls was significantly higher the the Implied Volatility for puts, buying the stock would be a better bet than shorting it. This is particularly true for the At-the-Money calls and puts. You could also use the expiration month as a guide to the time frame.  Longer time frames indicate more of a trust in fundamentals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Ralph Winters&lt;/p&gt;&#xA;" OwnerUserId="520" LastActivityDate="2011-03-19T15:10:22.313" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="768" PostTypeId="2" ParentId="764" CreationDate="2011-03-19T15:54:29.263" Score="9" Body="&lt;p&gt;You can look at equity as a call option on the firm. In &lt;em&gt;theory&lt;/em&gt; this illustrates the differences between holding equity or debt. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The quick and dirty is that equity holders own the firm, but only after the debt holders are repaid. If you have a simple levered firm with one outstanding debt issue, it as though the equity holders have a call option on the firm with strike equal the face value of debt with expiration equal to the debt maturity date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use the technique to price equity, but it still requires you to value the underlying firm and do the calculation for all outstanding debt. A lot of research tests these pricing models, but there are so many assumptions wrapped up in it, I would have a really hard time using the &quot;call option&quot; price to say that the firm's equity is under- or over-priced. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regardless, it's an interesting way of looking at the relation between equity and debt. If you're interested in learning more, &lt;a href=&quot;http://pages.stern.nyu.edu/~adamodar/&quot;&gt;Damodaran&lt;/a&gt; has a &lt;a href=&quot;http://pages.stern.nyu.edu/~adamodar/New_Home_Page/lectures/opt.html&quot;&gt;good reference&lt;/a&gt; on his website.&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-03-19T15:54:29.263" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="769" PostTypeId="2" ParentId="733" CreationDate="2011-03-19T17:31:39.523" Score="1" Body="&lt;p&gt;Proxy integration is just an approximation which can deviate pretty strongly from the recursion algorithm for thin tranches or extremely large/small loss variances. Proceed with caution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also: when you integrate the Gaussian proxy, do you start from $-\infty$ or from 0? Counter-intuitively, you should start from $-\infty$ to get the correct portfolio expected loss.&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2011-03-19T17:31:39.523" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="770" PostTypeId="2" ParentId="753" CreationDate="2011-03-19T17:34:50.690" Score="10" Body="&lt;p&gt;There are really a few issues here: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) When do I turn off a model because I believe the model is &lt;strong&gt;invalid&lt;/strong&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a subjective call and depends on many things such as how strong the economic reasoning behind the model is, how crowded the space is, and how poorly the model is performing relative to backtest.  With regard to the last point, as a rule of thumb I expect to live through a drawdown twice as bad as the worst drawdown in my backtest, since the backtest is overfit.  If you have a Sharpe 5 model and realize a Sharpe 0, it is an easy call to shut down.  But with trend following, you are probably getting a Sharpe around 1, so you can easily have poor performance for a few years without the model being statistically invalid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) How do I &lt;strong&gt;time&lt;/strong&gt; turning off a model using past performance or some other variable, hoping to turn it back on later.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have not had much luck with model timing.  You are layering a tenuous prediction on top of a tenuous prediction.  The only timing models that I know of are conditioning some high freq strats on volatility because volatility tends to be autocorrelated and the economics of high vola regimes rewards liquidity providers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) How do I &lt;strong&gt;size&lt;/strong&gt; my portfolio to &lt;strong&gt;preserve capital&lt;/strong&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can either size down or stop trading when you start losing too much money.  There are many algorithms for this.  This is like buying a put option, so expect to pay for it.  Or you can size your strat to be able to handle your expected worst performance (such as 2x mdd) comfortably and keep a constant size.&lt;/p&gt;&#xA;" OwnerUserId="443" LastEditorUserId="443" LastEditDate="2011-03-19T18:06:25.000" LastActivityDate="2011-03-19T18:06:25.000" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="771" PostTypeId="2" ParentId="690" CreationDate="2011-03-19T17:36:57.320" Score="4" Body="&lt;p&gt;Piterbarg (who's a very smart and no-nonsense guy) looks at the problem from the practitioner's perspective, i.e. &quot;will this make the traders happy?&quot;. Academicians tend to answer the question &quot;will this make the journal referees happy?&quot;. Two different goals.&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2011-03-19T17:36:57.320" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="772" PostTypeId="2" ParentId="760" CreationDate="2011-03-20T03:33:47.020" Score="6" Body="&lt;p&gt;Maybe a better question title is &quot;Can futures market &lt;em&gt;open interest&lt;/em&gt; predict commodity, treasury, and equity returns&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I saw this paper in an earlier form and it still baffles me. Superficially, it makes sense that price*quantity holds more information than just price &lt;em&gt;when&lt;/em&gt; quantity can change quickly (i.e., outstanding futures contracts changes more quickly that outstanding equity shares). Open interest is the dollar value of outstanding futures contracts, so there are two sides to these contracts, and of course each side thinks that they're getting the better deal. So it's not really clear that this should be a bull or bear indicator. If the price component dominates, then this could just be a CPI precursor, which would drive the returns in treasuries and equities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, the open interest term is a rolling average, which makes it highly autocorrelated. On this they regress treasury returns, which are also autocorrelated, so there could be some spurious regression in there. But Hong and Yogo are top of the field, so there's most likely something I'm overlooking and I'm interested in your thoughts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After I saw this paper, I tried the same thing in equities. I got data from the OneChicago single stock futures market and tried to use open interest and open interest growth to predict equity returns. I couldn't find anything more powerful than short term reversal. The OneChicago single stock futures market has only been around since the mid-2000s and still has relatively thin trading. Maybe in a few more years there will be enough volume to get better tests?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I don't think open interest predicts returns in a profitable way. It can predict returns, but not any better than short-term reversal or other documented mechanisms.&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-03-20T03:33:47.020" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="773" PostTypeId="2" ParentId="760" CreationDate="2011-03-20T09:29:24.120" Score="8" Body="&lt;p&gt;&lt;a href=&quot;http://www.cxoadvisory.com/&quot; rel=&quot;noreferrer&quot;&gt;CXO-Advisory&lt;/a&gt; investigate the claim of this paper and conclude that evidence indicates that changes in open interest in futures markets are strong predictors of returns for associated asset classes, even after controlling for a number of conventional predictors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They state that investors may be able to exploit these predictive powers via tactical asset class allocation but nevertheless warn that the study does not explicitly translate this evidence into a realistic trading strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;a href=&quot;http://www.cxoadvisory.com/commodity-futures/futures-market-open-interest-as-return-predictor/&quot; rel=&quot;noreferrer&quot;&gt;http://www.cxoadvisory.com/commodity-futures/futures-market-open-interest-as-return-predictor/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-03-20T09:29:24.120" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="774" PostTypeId="1" AcceptedAnswerId="776" CreationDate="2011-03-20T14:58:29.037" Score="15" ViewCount="1254" Body="&lt;p&gt;I want to start a blog/newsletter and maintain a track record of &#xA;trades I recommend. I have a never-expiring demo account for this &#xA;purpose. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I keep this track record &quot;honest&quot;? Three months from now, &#xA;someone can claim I backdated everything, made up trades, etc. Is &#xA;there a well-known way to keep traders honest? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll be trading OTC FX spot options, so I have to use Saxo Bank, and &#xA;can't use a generic site. Will this affect the answer? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I plan to take screenshots of my account daily, but I'm not sure &#xA;that's enough. &lt;/p&gt;&#xA;" OwnerDisplayName="user59" LastActivityDate="2019-02-16T21:45:22.700" Title="Keeping a track record honest" Tags="&lt;trading-systems&gt;" AnswerCount="7" CommentCount="2" FavoriteCount="6" ContentLicense="CC BY-SA 2.5" />
  <row Id="775" PostTypeId="2" ParentId="774" CreationDate="2011-03-20T15:56:47.787" Score="6" Body="&lt;p&gt;One thing I can think of: On your blog/newletter, offer to send daily email updates of your results to them.  That way no one can say that you backdate results, or otherwise altered results. And I'm sure everyone will appreciate your keeping things honest.&lt;/p&gt;&#xA;" OwnerUserId="520" LastActivityDate="2011-03-20T15:56:47.787" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="776" PostTypeId="2" ParentId="774" CreationDate="2011-03-20T16:16:06.490" Score="9" Body="&lt;p&gt;If what you're worried about is being accused of &lt;strong&gt;backdating&lt;/strong&gt;, then you could try &lt;strong&gt;timestamping&lt;/strong&gt; your articles by some trusted third party. This way you can certify that a document/article was created before a certain date and wasn't modified further on (so in this situation that you've come up with some conclusion/investment decision in the &lt;em&gt;real&lt;/em&gt; past). In case of a non-professional context some free services might give you enough credibility:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.timemarker.org/en/GetStamp.aspx&quot;&gt;timeMarker&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.itconsult.co.uk/stamper.htm&quot;&gt;Stamper service&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;But &lt;strong&gt;backdating is only one of the problems&lt;/strong&gt; you may encounter when trying to reliably report your performance. For example, timestamping won't help the fact that you can selectively publish only the trades that went well or just erase your prior poor record if it wasn't already disseminated. You could try to minimise this risk by keeping the window between actual transactions and publishing recommendations small (no &quot;past trades&quot; popping up in your blog out of nowhere), but in the end I suppose it's a question of trust - do your readers (clients?) feel they should/can trust you and foremost what's at stake (if you're only blogging personally it's different than if you're managing a mutual fund).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Reliable reporting&lt;/strong&gt; is a much more complex topic, there are numerous examples of real problems occurring in professional context, thus guidelines like &lt;strong&gt;&lt;a href=&quot;http://www.gipsstandards.org/standards/index.html&quot;&gt;GIPS&lt;/a&gt;&lt;/strong&gt; were created. But still, I feel there's no ultimate solution to the problem. Most of the time it's a mix of legal regulations, business reasoning (you can't really &quot;cheat&quot; your track record that much if you have to later pay it out), professional/ethical standards and some good faith. But sorry, that was probably too much of a digression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Going back to your question, I think the most important factor is &lt;strong&gt;what your goal is&lt;/strong&gt;. Are you blogging and keeping your transaction journal just for &quot;fun&quot; and educational purposes? Do you sell services/systems? Or maybe this blog is connected in some manner to a financial services company (managing client investments)? Presumably it's the former, but otherwise this would dramatically change the situation, and you would need to think about a much more complete and stringent solution to the problem.&lt;/p&gt;&#xA;" OwnerUserId="38" LastEditorUserId="38" LastEditDate="2011-03-20T16:24:55.387" LastActivityDate="2011-03-20T16:24:55.387" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="777" PostTypeId="2" ParentId="774" CreationDate="2011-03-20T17:33:06.583" Score="9" Body="&lt;p&gt;Occam's Razor:&#xA;Setup a facebook account, or a twitter account, and post your trade recommendations there.  They are time/date stamped, easily accessible to others, and cannot be backdated.&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-03-20T17:33:06.583" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="778" PostTypeId="2" ParentId="774" CreationDate="2011-03-20T18:04:59.640" Score="7" Body="&lt;p&gt;For third party tracking of trades, try these guys:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.timertrac.com/Public/Default.asp&quot;&gt;https://www.timertrac.com/Public/Default.asp&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="392" LastActivityDate="2011-03-20T18:04:59.640" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="779" PostTypeId="2" ParentId="760" CreationDate="2011-03-20T21:13:43.003" Score="3" Body="&lt;p&gt;My main concern when I read this paper was that they appear to not be lagging the CFTC data appropriately.  The open interest data is reported with almost a week delay.  They are using 1yr smoothing of 1mth changes, so that will mitigate some of the look ahead bias, but I think the paper is untradeable.&lt;/p&gt;&#xA;" OwnerUserId="443" LastEditorUserId="443" LastEditDate="2011-03-21T00:32:10.487" LastActivityDate="2011-03-21T00:32:10.487" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="780" PostTypeId="2" ParentId="774" CreationDate="2011-03-20T21:18:22.967" Score="7" Body="&lt;p&gt;My primary recommendation is: &lt;a href=&quot;http://en.wikipedia.org/wiki/Eating_your_own_dog_food&quot;&gt;&quot;eat your own dogfood&quot;&lt;/a&gt;.  You can then share an actual track record.  And have your trades audited by a third party.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One good example of this in the quant blogsphere is &lt;a href=&quot;http://www.marketsci.com/index.html&quot;&gt;MarketSci&lt;/a&gt; (Michael Stokes), and I don't think that you could go wrong by &lt;a href=&quot;https://marketsci.wordpress.com/about/&quot;&gt;following his example&lt;/a&gt;.  He uses TimerTrac (mentioned by @bill_080) for some of the auditing (&lt;a href=&quot;https://www.timertrac.com/Private/Research/GraphSignals.asp&quot;&gt;an example&lt;/a&gt;).  He also offers managed accounts.  &lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2011-03-20T21:18:22.967" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="781" PostTypeId="2" ParentId="774" CreationDate="2011-03-21T15:46:24.737" Score="-1" Body="&lt;p&gt;Easy. Just put an MD5 hash of your complete text with your trade recommendation, along with its timestamp. Then, any reader can verify the exact date and the description of your recommendation.&lt;/p&gt;&#xA;" OwnerUserId="114" LastActivityDate="2011-03-21T15:46:24.737" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="782" PostTypeId="2" ParentId="760" CreationDate="2011-03-21T17:05:29.053" Score="2" Body="&lt;p&gt;I just skimmed the paper, but it looks like Tables 6 through 10 hold the &quot;predictors&quot;.   Notice the R^2 values.   I assume that their R^2=3% is my R^2=0.03.   If that's true, I would guess that trading frictions would dominate any of their predictions.&lt;/p&gt;&#xA;" OwnerUserId="392" LastActivityDate="2011-03-21T17:05:29.053" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="783" PostTypeId="2" ParentId="774" CreationDate="2011-03-22T02:37:36.370" Score="4" Body="&lt;p&gt;Check out what these guys have done (hashes published to arxiv on fixed dates): &lt;a href=&quot;http://arxiv.org/ftp/arxiv/papers/0911/0911.0454.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://arxiv.org/ftp/arxiv/papers/0911/0911.0454.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="225" LastActivityDate="2011-03-22T02:37:36.370" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="784" PostTypeId="1" CreationDate="2011-03-22T03:48:54.870" Score="0" ViewCount="3138" Body="&lt;p&gt;I am putting together an Ultra-High Frequency desk and need to answer the following questions for ordering some rack servers to process about 2 GB of data per second. If anyone has worked at a HFT desk before can you help me out? What kind of software do big HFT shops run?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;How many processors are required, and what clock speed?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How much memory required?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How much internal storage would you need?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Do you require any external storage?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How many network ports are required?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How many fibre connections are required?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerDisplayName="user633" LastEditorUserId="11723" LastEditDate="2018-11-26T20:35:35.563" LastActivityDate="2018-12-29T18:50:30.100" Title="Ultra-High Frequency Trading Help" Tags="&lt;high-frequency&gt;&lt;software&gt;&lt;hardware&gt;" AnswerCount="3" CommentCount="5" FavoriteCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="785" PostTypeId="2" ParentId="784" CreationDate="2011-03-22T05:56:33.243" Score="1" Body="&lt;p&gt;Q: How many Processors are required, and what clock speed?&#xA;&lt;strong&gt;A: as many as you can get&lt;/strong&gt;&#xA;How much Memory required?&#xA;&lt;strong&gt;A: as must as you can get&lt;/strong&gt;&#xA;How much internal storage would you need?&#xA;&lt;strong&gt;A: as much and as fast as you can get, think 500GB SSD&lt;/strong&gt;&#xA;Do you require any external storage?&#xA;&lt;strong&gt;A: yes, think in terabytes&lt;/strong&gt;&#xA;How many Network Ports are required?&#xA;&lt;strong&gt;A: at least 2&lt;/strong&gt;&#xA;How many Fibre connections are required?&#xA;&lt;strong&gt;A: as many as you can get&lt;/strong&gt;&#xA;Which level of AIX software is required?&#xA;&lt;strong&gt;A: the fastest version, with the fewest nonessential modules&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-03-22T05:56:33.243" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="786" PostTypeId="2" ParentId="784" CreationDate="2011-03-22T10:38:03.307" Score="6" Body="&lt;p&gt;Your question is very broad and cannot be answered by community as it requires a thorough analysis of your business needs. This isn't something that can be done while having a coffee break. Of course one may answer to your questions: &quot;as many &amp;amp; as much &amp;amp; at least &amp;amp; the fastest&quot; but your costs will skyrocket as there is virtually no limit... Do you really want to spend money on an F1 car while all your needs can be satisfied by a decent van?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long story short: you'll do better by hiring somebody knowledgeable to do the job.&lt;/p&gt;&#xA;" OwnerUserId="493" LastActivityDate="2011-03-22T10:38:03.307" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="787" PostTypeId="2" ParentId="764" CreationDate="2011-03-22T11:03:19.330" Score="2" Body="&lt;p&gt;The B-S formula is not such interesting for you as its derivation. This formula is based on the B-S model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(i) Suppose that the model nicely describe real-life - remember that price movements are assumed to be random and unpredictable so it does not contradict with EMH.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the model is true, the derivation of the B-S equation tells you how that if you short an option - you can perfectly (non-randomly!) hedge yourself with a given strategy (delta-hedging). What does it mean? It means that if on the real market the price of the option do not coincide with a theoretical value - then using delta-hedging you can make and the maturity on your bank account more money then you need to exercise an option. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Roughly speaking, if real price of the option does not coincide with that which B-S formula gives you - you can make a profit. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Problems? The model is not perfect, i.e. using delta-hedging you are still risky - e.g. in the B-S delta-hedging there are no transaction costs which is artificial.&lt;/p&gt;&#xA;" OwnerUserId="464" LastActivityDate="2011-03-22T11:03:19.330" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="788" PostTypeId="1" AcceptedAnswerId="1097" CreationDate="2011-03-22T13:45:22.267" Score="5" ViewCount="390" Body="&lt;p&gt;Seems like the vast majority of all the Hedging literature is dedicated to the speculative side of it. I am searching for quality papers that deal with the link between financial and physical markets and how non-financial companies can manage and control the risks of price movements of commodities and currencies in their core operations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have an advice about what titles to look for?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="636" LastActivityDate="2011-05-01T21:01:53.607" Title="Commodity hedging in non-financial companies - any literature available?" Tags="&lt;hedging&gt;&lt;commodities&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="790" PostTypeId="2" ParentId="565" CreationDate="2011-03-22T15:16:10.580" Score="4" Body="&lt;p&gt;there is no standard approach to model quanto CDS. In practice, people look at the dynamic hedging costs over time as well as the expected loss from an fx gap in the event of a default of the ref entity. the former is modelled by some correlated brownian (for FX) and mean-reverting processes (for credit - could be Ornstein Uhlenbeck for example). In addition, you need some event correlation of the FX gapping when the reference entity defaults. You see, all a little messy. Don't get me started on the calibration.....&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CDS on sovereigns in the country's own currency trade at roughly 50%-60% of their liquid spot contract while Eur-countries trade between 5% (perepherial) and 30% (core)&lt;/p&gt;&#xA;" OwnerUserId="637" LastActivityDate="2011-03-22T15:16:10.580" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="791" PostTypeId="2" ParentId="565" CreationDate="2011-03-22T15:50:56.637" Score="2" Body="&lt;p&gt;The consensus seems to be is using jump diffusion process (affine), and then using copula's and/or correlated brownian motions to handle the correlation structure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a link to a recent paper that discusses these models in great detail, and includes  application of these models for modeling quanto cds:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1153400&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1153400&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-03-22T15:50:56.637" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="792" PostTypeId="1" AcceptedAnswerId="793" CreationDate="2011-03-22T15:59:29.637" Score="10" ViewCount="4292" Body="&lt;p&gt;I am studying Arbitrage Pricing Theory (APT) and I have a question about calculating factor exposures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;r = \beta_1r_1 + \beta_2r_2 + ... + \beta_kr_k + r_e&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\beta_i$ is the exposure of the asset to a factor&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r$ is the return attributable to a factor &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe that beta will be the covariance of the factor with the underlying asset. Is this correct? Also how is the return attributable to a specific factor calculated? Is there a single way this is done or are there a variety of approaches?&lt;/p&gt;&#xA;" OwnerUserId="373" LastEditorUserId="467" LastEditDate="2012-06-10T17:45:55.513" LastActivityDate="2012-06-10T17:45:55.513" Title="How to perform risk factor calculation?" Tags="&lt;regression&gt;&lt;factor-models&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="793" PostTypeId="2" ParentId="792" CreationDate="2011-03-22T16:18:08.473" Score="6" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I believe that beta will be the covariance of the factor with the underlying asset. Is this correct?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Close, it's the covariance divided by the variance of the factor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\beta_{f,a} = \frac{\sigma_{f,a}}{\sigma^2_f}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Also how is the return attributable to a specific factor calculated? Is there a single way this is done or are there a variety of approaches?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That depends on how you derive your factors. As mentioned in this &lt;a href=&quot;https://quant.stackexchange.com/q/738/35&quot;&gt;earlier question&lt;/a&gt;, I once derived factors with cluster analysis. Thus, each factor was really a collection of highly correlated large-cap stocks. That meant the factor return was simply the cap-weighted average of all constituent stock returns, just like in a stock index.&lt;/p&gt;&#xA;" OwnerUserId="35" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2012-05-29T09:32:56.927" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="794" PostTypeId="2" ParentId="792" CreationDate="2011-03-22T17:07:25.557" Score="-1" Body="&lt;p&gt;You can use PCA as well, not the cluster analysis.&lt;/p&gt;&#xA;" OwnerUserId="464" LastActivityDate="2011-03-22T17:07:25.557" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="796" PostTypeId="1" CreationDate="2011-03-22T19:54:13.400" Score="7" ViewCount="1498" Body="&lt;p&gt;I am valuing a binary FX option (european) with a defined strike and term (2Y).  I'm using a closed form solution based on Black-Scholes framework.  How can I derive the appropriate volatility to use from the market data I have?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Market Data (all quoted in implied volatility):&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ATM &#xA;25D Risk Reversal &#xA;25D Butterfly &#xA;10D Risk Reversal&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="223" LastActivityDate="2011-03-26T14:01:38.657" Title="How to derive appropriate volatility for a binary option (with strike/term) from market data?" Tags="&lt;volatility&gt;&lt;options&gt;&lt;fx&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="797" PostTypeId="2" ParentId="796" CreationDate="2011-03-22T20:15:42.097" Score="3" Body="&lt;p&gt;Binary options can be replicated (in theory) by trading long and short call options with very  close strikes. Take the Black-Scholes formula and differentiate it over the strike. You will need to know the slope of the implied volatility skew around the strike of the binary option. This you can do by fitting a parametric formula (I don't know exactly what is used in FX, also SABR?) to your market data. If your option's strike is not too far away from ATM, you should get a reasonable number.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Disclaimer: I don't specialise in FX.&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2011-03-22T20:15:42.097" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="798" PostTypeId="1" AcceptedAnswerId="820" CreationDate="2011-03-22T20:25:32.217" Score="13" ViewCount="404" Body="&lt;p&gt;Let's say I am hedging an exotic instrument $E$ with $N$ liquid instruments $L_i$, each of which has an associated hedging ratio $R_i$ and a bid-ask spread $\delta_i$ (per dollar of notional). What would you recommend as a cost function to balance the completeness of the hedge and minimize the hedging cost?&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2011-03-28T19:24:26.057" Title="Cost function for hedging portfolio" Tags="&lt;hedging&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="799" PostTypeId="1" CreationDate="2011-03-23T03:16:36.510" Score="8" ViewCount="1153" Body="&lt;p&gt;I'm looking for a heuristic way to calculate the probabilities of being in the money at expiry for non-defined risk options combinations (listed options).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use delta as a proxy for this probability of success for single options, which makes an implicit distributional assumption.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For spreads I use width of the spread (or the worst drawdown/largest possible gain for more complex defined risk combinations) and $ received/paid for it. I treat the options combos as if they were bets and I get the implied probabilities from the prices of those bets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is a good heuristic for estimating such probabilities for straddles and strangles (and other non-defined risk combinations)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: To clarify the above: a straddle/strangle is a bet. What's the probability of this bet being profitable at expiration? How do I imply the probability of success of this bet? &lt;/p&gt;&#xA;" OwnerUserId="358" LastEditorUserId="358" LastEditDate="2011-03-24T13:59:45.487" LastActivityDate="2011-03-26T13:52:02.077" Title="Heuristics for calculating theoretical probabilities of being ITM at time T for listed options" Tags="&lt;options&gt;&lt;probability&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="800" PostTypeId="2" ParentId="792" CreationDate="2011-03-23T04:33:38.810" Score="3" Body="&lt;p&gt;If you have a series of observations of the return as a vector, $\mathbf{r}$ with corresponding observations of the factor returns in matrix $Z$, then the least squares estimate of the vector of betas is&#xA;$$\hat{\beta} = \left(X&amp;#39;X\right)^{-1} X&amp;#39;\mathbf{r},$$&#xA;where $X$ is the matrix with $Z$ and a column of all ones (for the intercept term). The last value of $\hat{\beta}$ will be the estimate of the 'idiosyncratic' return. In general, the estimate of the $j$th coefficient, $\hat{\beta_j}$ will &lt;em&gt;not&lt;/em&gt; be correlation of the return to the return of the $j$th factor, nor will it be that value adjusted for the volatility of the factor. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have only one factor (in which case it is CAPM, not APT), then the computation does simplify. Also, if the sample returns of the different factors are independent vectors (highly unlikely to happen by accident), you will get the simplification. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://en.wikipedia.org/wiki/Ordinary_least_squares#Estimation&quot; rel=&quot;nofollow&quot;&gt;wikipedia&lt;/a&gt; for more on multiple linear regression.&lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2011-03-23T04:33:38.810" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="801" PostTypeId="2" ParentId="792" CreationDate="2011-03-23T20:49:49.977" Score="10" Body="&lt;p&gt;I don't have much to add, but wanted to address the &quot;price of risk&quot; question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;APT is kind of &quot;economics&quot;-free and tries to price assets without the utility maximization required in CAPM/ICAPM. Ross's APT observes that groups of assets move together (e.g., tech stocks) and that is the risk you're bearing because the idiosyncratic risk, like the firing of HP's CEO, can be diversified away. Because this risk is easily diversifiable, the market won't pay you to take it. So in your APT model these factors are returns to asset classes, industries, etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although the model looks the same, in Merton's ICAPM, the factors are state variables (e.g., industrial production, inflation). These are purely academic points -- in practice you run a multivariate regression with return on the LHS and whatever factors you think are priced on the RHS. OLS and GMM are common. So you'll estimate $$E ~ \left[ ~r_i~ \right] = \alpha_i + \beta_i^1 f_1 + \beta_i^2 f_2 + \ldots + \beta_i^k f_k$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your final question.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Also how is the return attributable to&#xA;  a specific factor calculated?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now you regress the returns back on the betas. $$E ~ \left[ ~r_i~ \right] = \sum_{j \in K} \lambda_j \beta_i^j$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $\lambda_j$ is the return to factor $j$. Typically the Fama-MacBeth approach is used here. If you've done it correct and found something, $\lambda &amp;gt; 0$ (i.e., the market is paying you to take this risk).&lt;/p&gt;&#xA;" OwnerUserId="106" LastEditorUserId="106" LastEditDate="2012-05-30T13:32:58.037" LastActivityDate="2012-05-30T13:32:58.037" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="802" PostTypeId="1" CreationDate="2011-03-23T22:14:43.023" Score="21" ViewCount="12703" Body="&lt;p&gt;Do you know of any papers which consider pairs trading (or statistical arbitrage) on foreign exchange? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I couldn't find any. I asked this question on several forums and got no reply. Thus, I guess this trading strategy is inapplicable due to the properties of currency markets or other fundamental reasons. However, it is not obvious to me what these reasons are.&lt;/p&gt;&#xA;" OwnerUserId="370" LastEditorUserId="20795" LastEditDate="2020-03-31T12:10:42.113" LastActivityDate="2020-07-17T22:04:48.380" Title="Is statistical arbitrage on FX possible?" Tags="&lt;fx&gt;&lt;arbitrage&gt;&lt;reference-request&gt;&lt;research&gt;&lt;pairs-trading&gt;" AnswerCount="4" CommentCount="5" FavoriteCount="18" ContentLicense="CC BY-SA 4.0" />
  <row Id="803" PostTypeId="2" ParentId="14" CreationDate="2011-03-23T22:52:51.767" Score="4" Body="&lt;p&gt;Deltas represent hedge ratio; i.e. 5%, 10%, 25%...i.e. buy two 50 delta puts, buy 100 shares of stock for perfect hedge at price, done. Delta volatility &quot;smile&quot; should be represented with the smallest delta having the highest volatility to the largest delta having the smallest volatility, being the at the money option, struck at the price of the stock.  50 delta put on \$100 IBM is 100 strike.  Buy 2 50 delta puts, sell 100 shares IBM at \$100.  Higher volatility options have less chance of ending up in the money at expiration. easy way to think of this is 5 delta has 5% chance of ending up in the money at expiration.  Instead of hedging with the underlying contract, lower deltas can be offset by selling other options against...buy two 5 deltas and sell one 10 delta against it.  &lt;/p&gt;&#xA;" OwnerDisplayName="user639" LastEditorUserId="18977" LastEditDate="2016-08-10T07:54:14.220" LastActivityDate="2016-08-10T07:54:14.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="804" PostTypeId="2" ParentId="764" CreationDate="2011-03-24T00:32:52.727" Score="2" Body="&lt;p&gt;As the BSM gives a call price as function of Stock price, volatility and other inputs, c(0) = BSM[Stock, Strike, volatility, riskfree rate, term], it seems to me you could use it in an analogous way to implied volatility (i.e., implied vol is the volatility input that produce a model output = traded market price).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The analogous use, i think, would be to input/assume a volatility, then given an observed (traded) option price, simply iterate to solve for the Stock price that calibrates the BSM = the traded option price; i.e., conditional on a given volatility assumption, this would be the fair stock/asset price implied by the BSM. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;... of course, in addition to the inherent model risk, you have to assume a volatility [that is NOT the implied volatility] so, i think it's Merton-esque in that you are hinging it on the hard to estimate volatility.&lt;/p&gt;&#xA;" OwnerUserId="640" LastEditorUserId="35" LastEditDate="2011-03-24T04:53:49.483" LastActivityDate="2011-03-24T04:53:49.483" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="805" PostTypeId="2" ParentId="802" CreationDate="2011-03-24T02:12:15.973" Score="4" Body="&lt;p&gt;Disclaimer: I know nothing about FX trading, other than that I've heard something to the effect of &quot;The first rule of FX trading is that you do not trade FX. The second rule...&quot; you know how it goes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not into macroeconomics, but I get the impression that the benchmark for FX models is a random walk. That is to say that the fundamentals have nothing to say about FX at anything on a short horizon, which I think is considered four years. I think what has complicated a lot of the research here is limited data in floating exchange rate regimes, small policy interventions, and rare &lt;em&gt;huge&lt;/em&gt; policy interventions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think Stock and Watson have the best, recent exchange rate models. These papers won't discuss trading, but could be thought-provoking in how you look at the problem&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://econpapers.repec.org/article/besjnlasa/v_3a97_3ay_3a2002_3am_3adecember_3ap_3a1167-1179.htm&quot; rel=&quot;nofollow&quot;&gt;JASA 2002&lt;/a&gt;, Journal of Business &amp;amp; Economic Statistics 2002 (sorry, couldn't find link).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;HTH (someone with practical knowledge will have to chime in with how to implement :) )&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-03-24T02:12:15.973" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="806" PostTypeId="2" ParentId="728" CreationDate="2011-03-24T03:35:46.833" Score="7" Body="&lt;p&gt;Getting something up and running quickly -- i.e. data manipulation and exploration are activities R are adept at, and there are a plethora of packages to help you.  Flexibility and speed (of research) are R's primary strengths.  I feel memory and computing power are less expensive than the thought cycles used to explore an idea.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're entering a production level arms race, obviously R is not the answer.  However, I find R acceptable for production -- enough to plug it into an institutional order management system.  As long as your investment strategy is based on &lt;em&gt;predictive market analytics&lt;/em&gt;, I don't see a drastic need for speed. &lt;/p&gt;&#xA;" OwnerUserId="641" LastActivityDate="2011-03-24T03:35:46.833" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="807" PostTypeId="2" ParentId="799" CreationDate="2011-03-24T03:37:24.023" Score="3" Body="&lt;p&gt;For a straddle, the probability of both legs being in the money is zero  :-)&#xA;The probability of one of the legs being in the money is essentially 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a strangle, the probability of one of the legs being in the money at expiration is the sum of the absolute values of the deltas of the two legs of the strangle.&lt;br&gt;&#xA;( think about one side of the strandge close to the money, and the other side far out of the money... the total probability has to be greater than the probability of the near leg along)&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-03-24T03:37:24.023" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="808" PostTypeId="2" ParentId="753" CreationDate="2011-03-24T03:46:22.633" Score="1" Body="&lt;p&gt;Use Maximum Drawdown at Risk with an exceedance probability test&lt;/p&gt;&#xA;" OwnerUserId="641" LastActivityDate="2011-03-24T03:46:22.633" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="809" PostTypeId="2" ParentId="802" CreationDate="2011-03-24T04:31:24.060" Score="1" Body="&lt;p&gt;Every FX trade is fundamentally a pairs trade.&#xA;e.g. EUR/USD is a pairs trade on euro's vs dollars.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given this fundamental 'pairing', talking about pairs trading on forex pairs becomes, well,  redundant. &lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-03-24T04:31:24.060" CommentCount="8" ContentLicense="CC BY-SA 2.5" />
  <row Id="810" PostTypeId="2" ParentId="802" CreationDate="2011-03-24T09:22:19.107" Score="1" Body="&lt;p&gt;You may be interested in trading using correlations between different quotes - then it is like optimal selection theory for a usual portfolio. The only difference is in the model for FX quotes (while in optimization of portfolios stock models are used) - this model I am also looking for and cannot you advise anything at the moment.&lt;/p&gt;&#xA;" OwnerUserId="464" LastActivityDate="2011-03-24T09:22:19.107" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="811" PostTypeId="1" AcceptedAnswerId="812" CreationDate="2011-03-24T11:02:49.320" Score="2" ViewCount="1648" Body="&lt;p&gt;What are the applications of binomial trees?&lt;/p&gt;&#xA;" OwnerDisplayName="user322" LastActivityDate="2011-03-24T12:38:20.303" Title="What are binomial trees and how are they used?" Tags="&lt;binomial-tree&gt;" AnswerCount="2" CommentCount="3" ClosedDate="2011-03-24T13:17:45.770" ContentLicense="CC BY-SA 2.5" />
  <row Id="812" PostTypeId="2" ParentId="811" CreationDate="2011-03-24T11:17:18.510" Score="1" Body="&lt;p&gt;From wiki's entry&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In finance, the binomial options&#xA;  pricing model (BOPM) provides a&#xA;  generalizable numerical method for the&#xA;  valuation of options. The binomial&#xA;  model was first proposed by Cox, Ross&#xA;  and Rubinstein (1979). Essentially,&#xA;  the model uses a &quot;discrete-time&quot;&#xA;  (lattice based) model of the varying&#xA;  price over time of the underlying&#xA;  financial instrument. In general,&#xA;  binomial options pricing models do not&#xA;  have closed-form solutions.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;See the full post, &lt;a href=&quot;http://en.wikipedia.org/wiki/Binomial_options_pricing_model&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Binomial_options_pricing_model&lt;/a&gt;, for methodology/implementation guidelines.&lt;/p&gt;&#xA;" OwnerUserId="471" LastActivityDate="2011-03-24T11:17:18.510" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="813" PostTypeId="2" ParentId="811" CreationDate="2011-03-24T12:38:20.303" Score="1" Body="&lt;p&gt;You can also read about Cox-Ross-Rubinstein model (see e.g. Shreve, Stochastic Calculus for Finance I). Binomial trees are discrete-time models assuming that at each step there are only two possibilities for the change of the price.&lt;/p&gt;&#xA;" OwnerUserId="464" LastActivityDate="2011-03-24T12:38:20.303" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="814" PostTypeId="2" ParentId="788" CreationDate="2011-03-24T20:58:34.920" Score="2" Body="&lt;p&gt;Hedging is hedging, it's more related to the market you're trading on than to what your goals are or whether you are a bank or an industrial corporation. Granted, some institutions may be able to trade things others cannot, but in principle the same models will aply if your position in the market is the same (i.e. most financial models used for hedging assume that the trades you make do not move the market price significantly).&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2011-03-24T20:58:34.920" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="815" PostTypeId="1" CreationDate="2011-03-25T12:29:04.777" Score="7" ViewCount="1126" Body="&lt;p&gt;I'm currently working on my Masters project related to accelerating Greeks computations for CVA on mixed interest rate portfolios. I would like to know about the status of technology for CVA and its Greeks computations in the industry (mainly related to speed of computation).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example situation:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Portfolio of 100 000 instruments&lt;/li&gt;&#xA;&lt;li&gt;Mixture of IR Swaps, Swaptions on multiple currencies&lt;/li&gt;&#xA;&lt;li&gt;Consider case with credit/IR correlations AND without them&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Question: How long (approximately, or simply mention the order) would it take on your system (or system you know) to compute total CVA (including all the netting agreements, collaterization stuff...) and sensitivities of it to every yield curve used, vol surface?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it is not too confidential, mention the underlying technology (cpu cluster, gpus) and maybe also methods used (like Longstaff-Schwartz); you can skip the name of institution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why I need this? I do have a few numbers from local smaller banks, but I'd like to get a broader picture for the need of accelerated methods for these computations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Basel III is coming soon, so this will be mandatory for every single serious bank.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope it is clear what I'm seeking.&lt;/p&gt;&#xA;" OwnerUserId="647" LastEditorUserId="35" LastEditDate="2011-03-25T14:15:00.813" LastActivityDate="2017-05-25T00:28:33.650" Title="Credit Valuation Adjustments -- computation issues" Tags="&lt;credit&gt;&lt;valuation&gt;&lt;gpgpu&gt;&lt;cva&gt;&lt;adjustments&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="816" PostTypeId="1" CreationDate="2011-03-25T13:11:03.590" Score="2" ViewCount="1297" Body="&lt;p&gt;I am implementing a method in Java to calculate the variance, covariance, and value at risk for a portfolio, which should be flexible for use with any number of assets in a portfolio. I am struggling with how to calculate the covariance of the assets as I can only find formulae to do so for two or three sets of values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Java has a built-in &lt;a href=&quot;http://commons.apache.org/math/apidocs/org/apache/commons/math/stat/correlation/Covariance.html&quot; rel=&quot;nofollow&quot;&gt;library&lt;/a&gt; to calculate the covariance of two assets and also to calculate the covariance matrix. However, I am not sure how to find the covariance for a portfolio that can contain any number of assets.&lt;/p&gt;&#xA;" OwnerUserId="603" LastEditorUserId="35" LastEditDate="2011-03-25T14:24:50.383" LastActivityDate="2011-03-25T15:36:21.583" Title="Covariance for arbitrarily large portfolios" Tags="&lt;risk&gt;&lt;var&gt;&lt;variance&gt;&lt;programming&gt;&lt;covariance&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="817" PostTypeId="2" ParentId="815" CreationDate="2011-03-25T13:27:19.410" Score="2" Body="&lt;p&gt;This book is quite good as a starting point:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/047068576X&quot; rel=&quot;nofollow&quot;&gt;http://www.amazon.co.uk/Counterparty-Credit-Risk-Challenge-Financial/dp/047068576X&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2011-03-25T13:27:19.410" CommentCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="818" PostTypeId="2" ParentId="816" CreationDate="2011-03-25T15:08:46.223" Score="1" Body="&lt;p&gt;Have a look at &lt;a href=&quot;http://en.wikipedia.org/wiki/Covariance_matrix&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Covariance_matrix&lt;/a&gt; - especially the properties part. According to &lt;a href=&quot;http://www.aiaccess.net/English/Glossaries/GlosMod/e_gm_covariance_matrix.htm#Animation_covariance%20matrix&quot; rel=&quot;nofollow&quot;&gt;http://www.aiaccess.net/English/Glossaries/GlosMod/e_gm_covariance_matrix.htm#Animation_covariance%20matrix&lt;/a&gt;, if you have a matrix $X$ of assets (assets in columnes, returns in rows), you can calculate the covariance matrix as $\Sigma=[XX^T]/n$, where $n$ is the size of the sample. This should be rather simple in Java, in R it would look something like &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Sigma &amp;lt;- function(X){&#xA;mu &amp;lt;- apply(X,1,mean)&#xA;n &amp;lt;- ncol(X)&#xA;Sigma &amp;lt;- X%*%t(X)/n&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="357" LastEditorUserId="357" LastEditDate="2011-03-25T15:32:43.563" LastActivityDate="2011-03-25T15:32:43.563" CommentCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="819" PostTypeId="2" ParentId="816" CreationDate="2011-03-25T15:36:21.583" Score="8" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I am implementing a method in Java to&#xA;  calculate the variance, covariance,&#xA;  and value at risk for a portfolio,&#xA;  which should be flexible for use with&#xA;  any number of assets in a portfolio. I&#xA;  am struggling with how to calculate&#xA;  the covariance of the assets as I can&#xA;  only find formulae to do so for two or&#xA;  three sets of values.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Are you sure you are up to the task?  Do you have access to &lt;a href=&quot;http://www.r-project.org&quot; rel=&quot;nofollow&quot;&gt;R&lt;/a&gt; (hey, it's free and open source) or Matlab (hey, &lt;a href=&quot;http://www.octave.org&quot; rel=&quot;nofollow&quot;&gt;Octave&lt;/a&gt; is free and open source) or something similar (hint: no, not Excel) to prototype this?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise, I don't even know where to start as there is so much more to this:  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;non-synchronocity of returns (as your assets may not all trade at the same time), &lt;/li&gt;&#xA;&lt;li&gt;missing observations (leading to non-positive definite matrices), &lt;/li&gt;&#xA;&lt;li&gt;roundoff error, &lt;/li&gt;&#xA;&lt;li&gt;modeling issues,&lt;/li&gt;&#xA;&lt;li&gt;factor-models for dimension reduction as you do &lt;em&gt;not&lt;/em&gt; want N x N for really large N.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;There have literally been shelves full of dissertations and practitioner books been written on this.  Read some---fifteen years ago we all read the first RiskMetrics (now part of MSCI) manual which was pretty novel and path-breaking then. It has answers to your questions too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A decade ago, I did something like this for a universe of 200 assets in Perl (don't ask) and it can be done that way.  That doesn't mean it should be done that way.  Besides learning about the underlying (financial econometrics) math, you should also learn about some numerical libraries for Java.  No need to reinvent the wheel.&lt;/p&gt;&#xA;" OwnerUserId="69" LastActivityDate="2011-03-25T15:36:21.583" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="820" PostTypeId="2" ParentId="798" CreationDate="2011-03-25T18:52:45.920" Score="6" Body="&lt;p&gt;I would assign the cost of incompleteness as the 90th percentile of N-period losses expected on the mis-hedged portfolio (where N is perhaps 5 trading days -- enough for a trader to get hit by a bus and someone else to catch up on his book).  This is nicely compatible with VaR computations, corrects for the fact that expected cost of a mis-hedge is usually zero, and doesn't involve any tricky utility function theory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You sometimes see more precise measurements made.  For example some papers in the 1990s calculated the exact optimal hedging strategy for European options given a particular bid-offer spread on the underlying and (I seem to recall) utility function assumptions.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you like utility functions a lot, clearly you can assign one to the variance (or other metric) of P&amp;amp;L arising from mis-hedging, and use the utility function to turn that directly into a cost.  You can approximate the &quot;right&quot; function parameters by, say, looking at your firm's recent returns and Sharpe ratio.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2011-03-28T19:24:26.057" LastActivityDate="2011-03-28T19:24:26.057" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="821" PostTypeId="1" AcceptedAnswerId="825" CreationDate="2011-03-25T22:44:02.430" Score="11" ViewCount="8433" Body="&lt;p&gt;Pls explain and discuss these limitations, and explain which models can I use to overcome these limitations. Alternatively, provide examples of how to modify the original Black Scholes to overcome these limitations.&lt;/p&gt;&#xA;" OwnerDisplayName="user322" LastEditorDisplayName="user322" LastEditDate="2011-03-25T23:21:01.870" LastActivityDate="2011-03-30T00:36:51.497" Title="What are the main limitations of Black Scholes?" Tags="&lt;black-scholes&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="822" PostTypeId="2" ParentId="821" CreationDate="2011-03-26T01:26:47.097" Score="3" Body="&lt;p&gt;Technical assumptions are below. I think in practice the most vexing assumptions are (i) Brownian motion assumption that has returns as normal and therefore future price as lognormal (the existence of volatility smiles refutes lognormal prices) and (ii) constant volatility assumption (also empirically refuted). Original BSM is Euro only non-dividend, but many assumptions can be overcome with extensions: American-style, dividends, changing volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assumptions used to derive BSM differential equation (source: John Hull):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Stock price follows a Weiner process (itself a particular Markov stochastic process) with a constant volatility&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Short selling is allowed&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No transaction costs and no taxes; securities are perfectly divisible&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dividends are not paid&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are no (risk-less) arbitrage opportunities&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Security trading is continuous&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The risk-free rate of interest is constant and the same for all maturities&lt;/p&gt;&#xA;" OwnerUserId="640" LastActivityDate="2011-03-26T01:26:47.097" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="823" PostTypeId="2" ParentId="799" CreationDate="2011-03-26T13:52:02.077" Score="2" Body="&lt;p&gt;I'm probably missing something, but why not apply Black-Scholes to &#xA;each leg and add the results to get the price distribution for the &#xA;spread? You'll get a non-closed-form result, but can evaluate it to &#xA;arbitrary precision using numerical methods. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To add probability distributions: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Suppose Z = X + Y where X and Y are independent probability &#xA;distributions. Then (PDF = probability distribution function, CDF = &#xA;cumulative distribution function): &#xA;&#xA;P(Z=z) = P(X=x)*P(Y=z-x) integrated over all x, or (Mathematica format): &#xA;&#xA;PDF[Z,z] = Integrate[PDF[X,x]*PDF[Y,z-x],{x,-Infinity,+Infinity}] &#xA;&#xA;A mathematically equivalent form: &#xA;&#xA;CDF[Z,z] = Integrate[CDF[X,x]*PDF[Y,y],{y,-Infinity,z-x},{x,-Infinity,+Infinity}] &#xA;&#xA;(derivation left as exercise to the reader) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user59" LastActivityDate="2011-03-26T13:52:02.077" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="824" PostTypeId="2" ParentId="796" CreationDate="2011-03-26T14:01:38.657" Score="2" Body="&lt;p&gt;It might be easier to use the Black-Scholes formula for binary options: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Binary_option#Black-Scholes_Valuation&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://en.wikipedia.org/wiki/Binary_option#Black-Scholes_Valuation&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;then add the distributions for each leg: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/799/heuristics-for-calculating-theoretical-probabilities-of-being-itm-at-time-t-for-l/823#823&quot;&gt;Heuristics for calculating theoretical probabilities of being ITM at time T for listed options&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and then use numerical methods to calculate what volatility makes the &#xA;legs match the quotes prices. &lt;/p&gt;&#xA;" OwnerDisplayName="user59" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2011-03-26T14:01:38.657" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="825" PostTypeId="2" ParentId="821" CreationDate="2011-03-26T14:14:37.980" Score="4" Body="&lt;p&gt;Actually, handling dividends is fairly easy: &#xA;&lt;a href=&quot;http://en.wikipedia.org/wiki/Black-scholes#cite_note-div_yield-3&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://en.wikipedia.org/wiki/Black-scholes#cite_note-div_yield-3&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;David mentions this above but &quot;Stock price follows a Weiner [sic] &#xA;process&quot; is worth a little more discussion. Recently, USDJPY fell 300 &#xA;pips in just a few minutes. If you accept that USDJPY follows a Wiener &#xA;process, the odds of this happening even once in a million years are &#xA;astronomical. USDJPY has done something equally unlikely earlier (250 &#xA;pips in a few minutes if I remember correctly). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem: once something falls &quot;a lot&quot; quickly, it's likely to fall &#xA;even further. In other words, a loss of 300 pips is 5 minutes is more &#xA;likely than a loss of 75 pips in 5 minutes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution is to use &quot;fat-tailed&quot; distributions: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Fat_tail#Applications_in_economics&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://en.wikipedia.org/wiki/Fat_tail#Applications_in_economics&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;but, of course, you then have to decide &lt;em&gt;which&lt;/em&gt; fat-tailed &#xA;distribution to use. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure the volatility smile disproves lognormal distribution. My &#xA;theory on the volatility smile: &#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/27/why-does-implied-volatility-show-an-inverse-relation-with-strike-price-when-exami&quot;&gt;Why does implied volatility show an inverse relation with strike price when examining option chains?&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerDisplayName="user59" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2011-03-26T14:14:37.980" CommentCount="5" ContentLicense="CC BY-SA 2.5" />
  <row Id="828" PostTypeId="1" AcceptedAnswerId="829" CreationDate="2011-03-27T17:34:37.607" Score="-2" ViewCount="637" Body="&lt;p&gt;What's the right way to take a series of returns and convert it into a continuous index?  Let's say I want to show the performance of a strategy starting from 1, and adding on returns so that I get an equity curve, should I be using &lt;code&gt;cumsum(1 + returns)&lt;/code&gt; or &lt;code&gt;cumprod(1 + returns)&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="658" LastActivityDate="2011-03-27T18:52:48.753" Title="Convert returns into an index?" Tags="&lt;returns&gt;&lt;equity-curve&gt;" AnswerCount="1" CommentCount="3" ClosedDate="2011-03-27T19:30:30.063" ContentLicense="CC BY-SA 2.5" />
  <row Id="829" PostTypeId="2" ParentId="828" CreationDate="2011-03-27T18:52:48.753" Score="4" Body="&lt;p&gt;It should be cumprod. Say you have an index of 0.7, and a daily return of -10%. The new index should be 0.63, not 0.6. &lt;/p&gt;&#xA;" OwnerUserId="357" LastActivityDate="2011-03-27T18:52:48.753" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="832" PostTypeId="1" CreationDate="2011-03-27T23:12:09.317" Score="7" ViewCount="899" Body="&lt;p&gt;This is a bit DSP-related: so if you turn your non-stationary time series into a stationary process, you'll probably see that it is not periodic.. This is an issue for Fourier-based techniques because they are not local in frequency. Now, besides wavelets (some types are causal btw), which other causal techniques can you use? (and ARMA is not it). I tried Empirical Mode Decomposition (HHT), but that's not causal; I tried Intrinsic Time-scale Decomposition: not causal either. Wavelets are pretty old and I would think something better would have been &quot;discovered&quot; by now? Does anyone know of a good causal signal processing technique that deals well with non-periodicity? Thanks!!&lt;/p&gt;&#xA;" OwnerUserId="659" LastActivityDate="2011-09-17T16:48:37.493" Title="DSP: stationary non-periodic signal: what's the best causal technique?" Tags="&lt;arma&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="5" ContentLicense="CC BY-SA 2.5" />
  <row Id="833" PostTypeId="2" ParentId="832" CreationDate="2011-03-28T01:18:02.843" Score="2" Body="&lt;p&gt;The issue with wavelets is that you'll have some boundary distortions so be careful when exploiting the results.&lt;/p&gt;&#xA;" OwnerUserId="134" LastEditorUserId="134" LastEditDate="2011-07-05T10:15:07.213" LastActivityDate="2011-07-05T10:15:07.213" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="834" PostTypeId="1" AcceptedAnswerId="836" CreationDate="2011-03-28T10:53:40.497" Score="12" ViewCount="1935" Body="&lt;p&gt;In reference to the original Black Scholes model, what approach is best to test the model in a rigorous way? Is there a standard approach that can accomplish this in a reasonable amount of time? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Details I require: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;number of trials, &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;which software to use, formulas etc.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;any other information that I should be aware of&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;*&#xA;This should be able to be done on a laptop with a Core i5 processor with a graphics card.&lt;/p&gt;&#xA;" OwnerDisplayName="user322" LastEditorDisplayName="user322" LastEditDate="2011-03-28T12:10:52.427" LastActivityDate="2011-03-31T17:54:17.040" Title="How to conduct Monte Carlo simulations to test validity of Black Scholes for a specific option?" Tags="&lt;black-scholes&gt;&lt;backtesting&gt;" AnswerCount="5" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="835" PostTypeId="2" ParentId="834" CreationDate="2011-03-28T12:18:05.973" Score="3" Body="&lt;p&gt;Write out your model as an SDE, simulate it and compare the result with an analytical solution (if you've got one).&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2011-03-28T12:18:05.973" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="836" PostTypeId="2" ParentId="834" CreationDate="2011-03-28T13:31:43.853" Score="5" Body="&lt;ol&gt;&#xA;&lt;li&gt;I recommend to use MATLAB / Excel for simplicity - depends which one do you already know.  &lt;/li&gt;&#xA;&lt;li&gt;Write down the SDE for geometic brownian motion (to simulate stock price over time) on paper, as quant_dev mentioned.&lt;br&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Discretize it using i.e. forward Euler discretization (see Wikipedia), code up a MC&#xA;simulation to simulate it for the time period you want to price your options.   &lt;/li&gt;&#xA;&lt;li&gt;Don't forget to use the risk-free dynamics in the SDE, otherwise you wont converge to BS price.  &lt;/li&gt;&#xA;&lt;/ol&gt;&lt;/li&gt;&#xA;&lt;li&gt;Code the $f(S_T)$ payoff function for your option payoff.&lt;/li&gt;&#xA;&lt;li&gt;Calculate the expected (average over simulations), discounted payoff.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;With 10 000 simulations, or even 100 000, there should be a decent convergence of your simulation (error at $10^{-4}$) - your CPU should handle this in a few mins max.&lt;/p&gt;&#xA;" OwnerUserId="647" LastEditorUserId="35" LastEditDate="2011-03-28T15:34:30.067" LastActivityDate="2011-03-28T15:34:30.067" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="837" PostTypeId="2" ParentId="834" CreationDate="2011-03-28T15:46:57.540" Score="0" Body="&lt;p&gt;I think what you really need to do is test the results of the analytic/simulated solution against the actual AND future historical price.  So you need to get historical data for the specific option.  That, to me, is much more interesting since it will tell you if Black-Scholes is working vs. the reality. Of course you will need a large number of historical data points to tackle this.&lt;/p&gt;&#xA;" OwnerUserId="520" LastActivityDate="2011-03-28T15:46:57.540" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="838" PostTypeId="2" ParentId="834" CreationDate="2011-03-28T16:10:51.620" Score="2" Body="&lt;p&gt;On the software end, if you want something quick/dirty I would personally go with Matlab/R/python however if you want something a bit more rigorous (e.g. payoff classes, &quot;better&quot; SDEs) something OO like C++ would really be the route to take. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The basic is fairly simple here's a quick sample of what it should look like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;double variance = vol*vol*expire; &#xA;double rootVariance = sqrt(variance); &#xA;double halfVar = -0.5*variance;&#xA;&#xA;double SpotPlusOne = s*exp(r*expire+halfVar); &#xA;double Spot; &#xA;double runningSum=0;&#xA;&#xA;for (unsigned long i=0; i &amp;lt; NumOfPaths; i++) &#xA;{ &#xA;double SN = SNByBoxMuller();&#xA;Spot = SpotPlusOne*exp(rootVariance*SN); &#xA;double PayOff = Spot – strike;&#xA;&#xA;PayOff = PayOff &amp;gt;0 ? PayOff : 0; &#xA;runningSum += PayOff; &#xA;}&#xA;&#xA;double mean = runningSum / NumOfPaths; &#xA;mean*=exp(-r*expire); &#xA;return mean;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The SNByBoxMuller() is just the standard way of generating a random number from a standard normal distribution from Box Muller.&lt;/p&gt;&#xA;" OwnerUserId="122" LastActivityDate="2011-03-28T16:10:51.620" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="839" PostTypeId="1" CreationDate="2011-03-29T06:18:53.347" Score="28" ViewCount="5107" Body="&lt;p&gt;I was thinking about writing my own backtester and I realize I have to make some assumptions. So I was hoping I could post what I am planning on doing and hopefully some of you can give me some ideas on how to make it better (I'm sure there is a lot that can be improved).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all, my strategy involves holding stocks for usually some days, I am not doing (probably any) intra-day trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So here is what I was thinking. First, I would buy some minute OHLC stock quotes covering the stocks I am interested in (thinking about buying some from pitrading.com, is their quality acceptable?). Then if the algorithm triggers a buy or sell at some bar, I would &quot;execute&quot; the order using the high or low of the very next bar (attempting to be as pessimistic as possible here). One thing I am curious about is bid/ask, so I was thinking about maybe adding/subtracting a few cents to take this into account when buying/selling. I would just see what these values have been recently (difference between bid/ask and quote for some recent data on these stocks and then just use these numbers as I wouldn't be backtesting that far back). I would assume that I can buy/sell all I want then at that price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly I would include the cost of commission in the trade. I would neglect any effect my trade would have on the market. Is there any rough guideline using volume to estimate how much you would have to buy/sell to have an effect?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would also simulate stop-loss sell orders and they, too, would be executed at the next bar low after the price passed the threshold.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's it, it will be pretty simple to implement. I am just hoping to make it conservative so it can give me some insight into how well my program works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any thoughts or criticisms about this program would be greatly appreciated. I am new at this and I am sure there are some details I am missing.&lt;/p&gt;&#xA;" OwnerUserId="667" LastEditorUserId="1106" LastEditDate="2011-09-15T21:04:53.203" LastActivityDate="2014-08-20T15:16:41.760" Title="How to design a custom equity backtester?" Tags="&lt;trading&gt;&lt;backtesting&gt;&lt;quant-trading-strategies&gt;&lt;equities&gt;" AnswerCount="8" CommentCount="5" FavoriteCount="17" ClosedDate="2020-08-11T22:19:23.400" ContentLicense="CC BY-SA 3.0" />
  <row Id="840" PostTypeId="2" ParentId="466" CreationDate="2011-03-29T09:12:16.807" Score="2" Body="&lt;p&gt;I've priced similar animals with a naive N-factor method, adding a convexity adjustment for the swap rates. But I'm not sure this is very orthodox...&lt;/p&gt;&#xA;" OwnerUserId="668" LastActivityDate="2011-03-29T09:12:16.807" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="841" PostTypeId="1" AcceptedAnswerId="853" CreationDate="2011-03-29T09:33:46.040" Score="9" ViewCount="1356" Body="&lt;p&gt;Nowadays structured products (or packages) with complex payoff diagrams are omnipresent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you know of any software, add-ons, apps, code whatever, that enables you to enter a payoff diagram or a cashflow profile which gives you the basic building blocks like the underlying, zero coupon bonds and esp. all the option components with their different strikes to replicate this payoff?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: Because some people asked what the input of such a tool could be, have a look at this example - I am asking for a software that is able to do this kind of decomposition automatically:&#xA;&lt;a href=&quot;http://www.risklatte.com/Articles_new/Exotics/exotic_28.php&quot;&gt;http://www.risklatte.com/Articles_new/Exotics/exotic_28.php&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2019-10-13T21:00:43.270" LastActivityDate="2019-10-13T21:00:43.270" Title="Software for decomposing payoff diagrams into plain vanilla products" Tags="&lt;option-pricing&gt;&lt;software&gt;&lt;replication&gt;" AnswerCount="4" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="842" PostTypeId="2" ParentId="839" CreationDate="2011-03-29T11:02:03.053" Score="13" Body="&lt;p&gt;For &quot;maximum pessimism&quot; you should calculate thus:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;for longs - enter at the bar high and&#xA;exit at the bar low on bar following&#xA;signal bar&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;for shorts - enter at the bar low and&#xA;exit at the bar high on bar following&#xA;signal bar&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I had previously heard this approach to back testing called the &quot;torture test.&quot;&lt;/p&gt;&#xA;" OwnerUserId="252" LastActivityDate="2011-03-29T11:02:03.053" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="843" PostTypeId="1" AcceptedAnswerId="873" CreationDate="2011-03-29T18:42:34.480" Score="5" ViewCount="1531" Body="&lt;p&gt;I am substituting reasonable values in the below fomula (like r=0.12, T=20, nColumn=16, sigma=0.004)...why is probability coming out to be greater than 1? Any help? Thanks!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;del_T=T./nColumn; % where n is the number of columns in binomial lattice&#xA;u=exp(sigma.*sqrt(del_T));&#xA;d=1./u;&#xA;p=(exp(r.*del_T)-d)./(u-d); % risk neutral probability&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user98" LastActivityDate="2011-04-01T08:40:44.203" Title="Risk neutral probability in binomial lattice option coming greater than 1...what's wrong?" Tags="&lt;probability&gt;&lt;binomial-tree&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="844" PostTypeId="2" ParentId="843" CreationDate="2011-03-29T20:03:55.700" Score="0" Body="&lt;p&gt;Simple: decrease the time step. The binomial tree is just an approximation, and you can't really call $p$ a genuine probability.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your parameters are also rather far from &quot;typical&quot;. I would choose:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r = 0.05$ (still higher than the current risk-free rate)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma = 0.2$ (more typical volatility value)&lt;/p&gt;&#xA;" OwnerUserId="89" LastEditorUserId="89" LastEditDate="2011-03-29T21:42:07.130" LastActivityDate="2011-03-29T21:42:07.130" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="845" PostTypeId="1" AcceptedAnswerId="846" CreationDate="2011-03-29T21:45:01.703" Score="4" ViewCount="811" Body="&lt;p&gt;I have just started applying Binomial-Lattice, however I am yet to fully understand few things. My questions are:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;What is the concept of working backward (left side) from the values in terminal (farthest) nodes at the right side. Why do we need to do backward induction? I started my first node with some value &lt;code&gt;S&lt;/code&gt;, at say time &lt;code&gt;t=1&lt;/code&gt;, then all I need to know are the option values anywhere ahead of this time till the option expires. What is the need and meaning of the values obtained by backward induction and how are those different from forward induction?&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Now if I apply backward induction, then the values I get at the starting node (the left most node) is far greater than the values at any other node. What does that mean?&lt;/p&gt;&#xA;&lt;p&gt;Let's take this for example: I start with &lt;code&gt;S=1.5295e+009&lt;/code&gt; at the starting node, and then after using Binomial-Lattice and doing backward induction, I get &lt;code&gt;9.9708e+10&lt;/code&gt; at the starting node. Why has it increased this much and what does that imply? If I decrease my time step by two times, then I further get very high values like &lt;code&gt;-1.235e+25&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The values that we get in each node as we move ahead of starting node (i.e. the values on the nodes right hand side to left most node) are the value analogues to Present Value (PV) at that time or Net Present Value (NPV)?&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; This is my Matlab code for binomial lattice:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;function [price,BLOV_lattice]=BLOV_general(S0,K,sigma,r,T,nColumn)&#xA;&#xA;% BLOV stands for Binomial Lattice Option Valuation&#xA;&#xA;%% Constant parameters&#xA;del_T=T./nColumn; % where n is the number of columns in binomial lattice&#xA;u=exp(sigma.*sqrt(del_T));&#xA;d=1./u;&#xA;p=(exp(r.*del_T)-d)./(u-d);&#xA;a=exp(-r.*del_T);&#xA;&#xA;%% Initializing the lattice&#xA;Stree=zeros(nColumn+1,nColumn+1);&#xA;BLOV_lattice=zeros(nColumn+1,nColumn+1);&#xA;&#xA;%% Developing the lattice&#xA;&#xA;for i=0:nColumn&#xA;    for j=0:i&#xA;        Stree(j+1,i+1)=S0.*(u.^j)*(d.^(i-j));&#xA;    end&#xA;end&#xA;for i=0:nColumn&#xA;    BLOV_lattice(i+1,nColumn+1)=max(Stree(i+1,nColumn+1)-K,0);&#xA;end&#xA;for i=nColumn:-1:1&#xA;    for j=0:i-1&#xA;        BLOV_lattice(j+1,i)=a.*(((1-p).*BLOV_lattice(j+1,i+1))+(p.*BLOV_lattice(j+2,i+1)));&#xA;    end&#xA;end&#xA;price=BLOV_lattice(1,1);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;strong&gt;EDIT 2 (an additional question):&lt;/strong&gt; If the binomial lattice is giving me option PV's, and my PV's are supposed to decrease with time, then why does more than half of values in my terminal nodes show an increase in values than what I start with (&lt;code&gt;=S0&lt;/code&gt;). See the attached picture for values.&lt;img src=&quot;https://i.stack.imgur.com/6B6qH.jpg&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user98" LastEditorUserId="-1" LastEditorDisplayName="user98" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2011-04-02T05:08:23.923" Title="Few questions on Binomial-Lattice Option Valuation" Tags="&lt;binomial-tree&gt;&lt;fundamentals&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="846" PostTypeId="2" ParentId="845" CreationDate="2011-03-29T22:18:18.553" Score="1" Body="&lt;p&gt;Let's start with question (2).  If you are not obtaining $S=1.5295e+009$ after backwardation, then you have a bug in your binomial tree code.  You may wish to find and eliminate that before proceeding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One simple check is to make all the terminal nodes have value 1.0.  You should obtain that the initial node has value $e^{-rT}$.   This assumes, of course, that you are using one of the better tree formulations that does not approximate the interest rate term.  Also, check your valuations against one of the online american option pricer website.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, the reason you backwardate is, colloquially, that the tree is meant to represent option present-values under a particular set of assumptions and scenarios about how stock prices change.  Note that during construction you effectively &quot;forwardate&quot; the stock prices $S$ on the tree (albeit in a trivial manner).  Considering the knowledge you start out with for all these stock price scenarios, it is only at the &lt;em&gt;terminal&lt;/em&gt; nodes of the tree that the option prices are clearly known with certainty.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The backwardation process is allowing you to form speculative values for the option in nodes / scenarios where you previously did not have a solid idea what the option value is.  This whole business is hidden from you in the Black-Scholes formulas, but becomes more explicit in trees due to the need to account for early exercise in the scenarios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's a bunch of complicated stochastic calculus and dynamical programming theory behind why the trees you construct are a correct technique for handling the problem of option pricing, but the above should give you a basic idea.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-03-29T22:18:18.553" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="847" PostTypeId="2" ParentId="821" CreationDate="2011-03-30T00:36:51.497" Score="0" Body="&lt;p&gt;One big limitation is that the BSM doesn't work on long term option pricing, see my blog below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://value2get.blogspot.com/2011/03/why-doesnt-black-scholes-model-work-in.html&quot; rel=&quot;nofollow&quot;&gt;http://value2get.blogspot.com/2011/03/why-doesnt-black-scholes-model-work-in.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user673" LastActivityDate="2011-03-30T00:36:51.497" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="848" PostTypeId="1" CreationDate="2011-03-30T00:38:13.493" Score="50" ViewCount="26108" Body="&lt;p&gt;Suppose I have two time series $X$ and $Y$ of stock prices. How do I measure the &quot;similarity&quot; of $X$ and $Y$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I'm being deliberately vague as I don't have a particular application, and I'm curious about different approaches in general. But I guess you can imagine that there's some stock &lt;strong&gt;x&lt;/strong&gt; that I don't want to trade directly, for whatever reason, so I want to find a similar stock &lt;strong&gt;y&lt;/strong&gt; to trade in its place.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One method is to take a Pearson or Spearman correlation. To avoid problems of spurious correlation (since the price series likely contain trends), I should take these correlations on the &lt;em&gt;differenced&lt;/em&gt; or returns series (which should be more stationary).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are other similarity methods and their pros/cons?&lt;/p&gt;&#xA;" OwnerUserId="672" LastEditorUserId="672" LastEditDate="2011-03-30T16:29:47.017" LastActivityDate="2016-03-02T20:18:48.713" Title="Time-series similarity measures" Tags="&lt;time-series&gt;&lt;correlation&gt;" AnswerCount="8" CommentCount="1" FavoriteCount="54" ContentLicense="CC BY-SA 2.5" />
  <row Id="849" PostTypeId="2" ParentId="147" CreationDate="2011-03-30T03:56:28.773" Score="4" Body="&lt;p&gt;I think you can look at books like &quot;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470128011&quot;&gt;The Evaluation and Optimization of Trading Strategies&lt;/a&gt;&quot; for some more insight about developing testing strategies. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, don't forget that &lt;strong&gt;you&lt;/strong&gt;, the strategy designer, knows the future and could potentially develop biased strategies. It's hard to unlearn something once you have learned.&lt;/p&gt;&#xA;" OwnerUserId="511" LastActivityDate="2011-03-30T03:56:28.773" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="850" PostTypeId="2" ParentId="848" CreationDate="2011-03-30T03:57:11.160" Score="27" Body="&lt;p&gt;I assume you're using returns (or log returns) &lt;a href=&quot;https://quant.stackexchange.com/q/489/35&quot;&gt;instead of actual stock prices&lt;/a&gt;. In practice, you may also want to smooth the data by using a moving average.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several correlation coefficients:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Pearson_correlation_coefficient&quot; rel=&quot;noreferrer&quot;&gt;Pearson's $r$&lt;/a&gt; - most commonly used definition of correlation:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;r = \frac{\sigma_{x,y}}{\sigma_x \sigma_y}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Spearman%27s_rank_correlation_coefficient&quot; rel=&quot;noreferrer&quot;&gt;Spearman's $\rho$&lt;/a&gt; - uses the &lt;em&gt;rank&lt;/em&gt; of each data set (array index if data had been sorted); less sensitive to outliers in the sample as it's non-parametric:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;d_i = x_i - y_i&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\rho = 1 - \frac{6\Sigma d_{i}^{2}}{n(n^{2}-1)}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Kendall_tau_rank_correlation_coefficient&quot; rel=&quot;noreferrer&quot;&gt;Kendall's $\tau$&lt;/a&gt; - also based on ranking, but represents the probability that the two data sets are in the same order vs. the probability that they are in different orders:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\tau = \frac{C - D}{\frac{1}{2} n(n - 1)}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Gamma_test_%28statistics%29&quot; rel=&quot;noreferrer&quot;&gt;Kruskal's $\Gamma$&lt;/a&gt; - similar to Kendall's, but acknowledges ties in the ordering:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\Gamma = \frac{C - D}{C + D}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;$C$ is the number of &lt;a href=&quot;http://en.wikipedia.org/wiki/Concordant_pair&quot; rel=&quot;noreferrer&quot;&gt;concordant pairs&lt;/a&gt; and $D$ is the number of discordant pairs.&lt;/p&gt;&#xA;" OwnerUserId="35" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2011-03-30T04:02:17.753" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="851" PostTypeId="2" ParentId="764" CreationDate="2011-03-30T04:10:01.710" Score="2" Body="&lt;p&gt;I'm trying to understand what you are asking: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;you cannot use options directly, only buying stock&lt;/li&gt;&#xA;&lt;li&gt;thus, you want to use options as an indicator on whether or not you should buy a stock&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I don't think the BS model is a great indicator for stock direction because it's based of not knowing where the stock may go. That said, a lot of people use action in the options market for suggestions about the stock movement. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One such indicator is the put/call ratio. Greater put buying suggest downside risk and call buying suggests upside movement. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may want to also consider heavily traded strike prices as an indicator to what level the stock might trade to. If your stock is trading at 100 and there's heavy open interest at the 120 calls, the theory suggests that &quot;smart money&quot; knows something. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Happy trading.&lt;/p&gt;&#xA;" OwnerUserId="511" LastActivityDate="2011-03-30T04:10:01.710" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="852" PostTypeId="1" AcceptedAnswerId="856" CreationDate="2011-03-30T05:45:14.470" Score="7" ViewCount="1120" Body="&lt;p&gt;I am trying to get the historical price data on selected  American and European style options at EUREX. I am not familiar with their system. Does any one know whether they have something like yahoo finance where I can just download market data through R? Or at least, excel files with daily prices.&#xA;Thank you&lt;/p&gt;&#xA;" OwnerUserId="428" LastEditorUserId="12" LastEditDate="2011-03-30T12:18:35.017" LastActivityDate="2015-08-03T01:25:40.997" Title="Need historical prices of EUREX American and European style options" Tags="&lt;options&gt;&lt;eurex&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="853" PostTypeId="2" ParentId="841" CreationDate="2011-03-30T06:15:04.317" Score="8" Body="&lt;p&gt;I do not know such a software - but we can think about the code. There are tow points which you have to define properly:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;which assets (correspondently, payoffs) are you allowed to replicate the complicated option?&lt;/li&gt;&#xA;&lt;li&gt;as barrycarter has already asked - what should be the form of the input?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Further procedure should be quite easy. You are trying to find a linear combination $\lambda$ of basic assets $s_1,s2_,...$ (because in practice this is the only possibility for you to &quot;combine&quot; it) which fits the complex payoff $\gamma$. It's just a peace-wise affine optimization problem. Once you minimize the difference $|\lambda - \gamma|$ you have either zero (so you have found the replication formula) or smth greater than zero (which means that there is no replication formula which perfectly covers this complicated payoff).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you will determine the points I've mentioned - I believe I will be able to help you to solve this problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edited:&lt;/strong&gt; Let us call your payoff $P(S)$ and simple payoff functions are $P_1(S,\theta_1),P_2(S,\theta_2),...$, where $\theta$ are parameters, e.g. strike for Call or Put. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you would like to check if there exist $a_1,a_2,...$ such that &#xA;$$&#xD;&#xA;P(S) = \sum\limits_i a_i P_i(S,\theta_i).&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can solve this problem by defining &#xA;$$&#xD;&#xA;J(a,\theta) = ||P(\cdot) - \sum\limits_i a_i P_i(\cdot,\theta_i)||&#xD;&#xA;$$&#xA;where you can use any norm - and in fact due to the structure of payoffs, this norm should be defined only on some finite interval $[0,S&amp;#39;]$. Then you solve&#xA;$$&#xD;&#xA;J(a,\theta)\to \min&#xD;&#xA;$$&#xA;and if the extremum value is $0$ - you can cover your exotic payoff with simple ones, if non-zero - you cannot cover it perfectly, but the obtained values of $a,\theta$ will be optimal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you need more details about the solution of optimization problem  -just tell me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. I think the paper you have refereed to is not correct - the payoff is not peace-wise affine while they plot it (and considered it) as peace-wise affine function.&lt;/p&gt;&#xA;" OwnerUserId="464" LastEditorUserId="464" LastEditDate="2011-03-31T15:17:17.183" LastActivityDate="2011-03-31T15:17:17.183" CommentCount="8" ContentLicense="CC BY-SA 2.5" />
  <row Id="854" PostTypeId="2" ParentId="848" CreationDate="2011-03-30T07:37:37.430" Score="6" Body="&lt;p&gt;You can look at cointegration.&lt;/p&gt;&#xA;" OwnerUserId="155" LastActivityDate="2011-03-30T07:37:37.430" CommentCount="8" ContentLicense="CC BY-SA 2.5" />
  <row Id="855" PostTypeId="2" ParentId="834" CreationDate="2011-03-30T08:24:07.623" Score="0" Body="&lt;p&gt;It seems like everyone here is MC but you can use PDE methods as well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway there is two things that you can usually check, the Price and ... the Hedge (or replication price). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's look at the first case:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;If you have closed-form formulas (as is usually the case in the BS &quot;fantas(ma)tic-wishfull thinking&quot;-setting), then that's all you need. If not, then you are not comfortable with your math (or your model but this is another issue).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you don't have such an analytical solution at hand, then usually MC comes in naturally (as every one suggests here) but you could use PDE methods aswell (after all it was the original methods for derivation of the BS Call/Put options prices). And you have plenty of books and nice articles that will tell you how to proceed in both cases (especially in BS settings). An easy check that I recommand, is to compare the &quot;closed-form formulas&quot; vs &quot;MC (and/or PDE)&quot; in the vanilla cases. Moreover those methods provide a good introdution to the replication prices that you might be willing to check in the second case.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Note that by using finite difference (or element) methods for the PDE you get an error and that when using discretization sheme for SDE you get at the of the day &quot;random variable&quot; for your P&amp;amp;L. There it is really a matter of taste in my opinion both methods have pros and cons.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the second case, that I called replication price then it is usually provided in a (at least in principle) straigthforward manner of the methods you used for the PDE and/or SDE discretization.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still regarding the replication prices, the very recent article of Wilmott and Ahmad &quot;&lt;a href=&quot;http://www.wilmott.com/detail.cfm?articleID=353&quot; rel=&quot;nofollow&quot;&gt;Which Free Lunch Would You Like Today, Sir?: Delta Hedging, Volatility Arbitrage and Optimal Portfolios&lt;/a&gt;&quot; is really illuminating in many ways and stays in the BS setting you want to stay within I think you should read it.&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="35" LastEditDate="2011-03-31T17:54:17.040" LastActivityDate="2011-03-31T17:54:17.040" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="856" PostTypeId="2" ParentId="852" CreationDate="2011-03-30T12:22:07.807" Score="3" Body="&lt;p&gt;Unfortunately the only possibility to get data from the biggest option exchange of the world is to buy these from EUREX directly (or some other professional data provider) - and they are quite expensive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More infos can be found here (and some sample files):&#xA;&lt;a href=&quot;http://www.eurexchange.com/market/historical_data_en.html&quot; rel=&quot;nofollow&quot;&gt;http://www.eurexchange.com/market/historical_data_en.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-03-30T12:22:07.807" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="857" PostTypeId="1" CreationDate="2011-03-30T14:43:57.497" Score="6" ViewCount="565" Body="&lt;p&gt;I have one portfolio with high beta stocks, and one with low beta stocks. Is it better to have higher expected return with high volatility, or medium expected return with medium volatility?  (All from a asset allocation, efficient frontier, risk/reward prospective.)&lt;/p&gt;&#xA;" OwnerUserId="520" LastEditorUserId="35" LastEditDate="2011-03-30T14:53:37.207" LastActivityDate="2013-01-05T02:05:13.540" Title="Given two portfolios with identical correlation matrices, which one will have a better risk/reward ratio?" Tags="&lt;beta&gt;&lt;modern-portfolio-theory&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="858" PostTypeId="2" ParentId="857" CreationDate="2011-03-30T14:52:14.523" Score="5" Body="&lt;p&gt;Most portfolio managers look at the &lt;a href=&quot;http://en.wikipedia.org/wiki/Sharpe_ratio&quot; rel=&quot;noreferrer&quot;&gt;Sharpe ratio&lt;/a&gt;, or occasionally the &lt;a href=&quot;http://en.wikipedia.org/wiki/Treynor_ratio&quot; rel=&quot;noreferrer&quot;&gt;Treynor ratio&lt;/a&gt;. In general, you want to maximize one of the these metrics, though there could be other issues that you haven't currently considered, like turnover or transaction costs associated with obtaining the portfolio.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-03-30T14:52:14.523" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="859" PostTypeId="2" ParentId="848" CreationDate="2011-03-30T15:45:05.417" Score="4" Body="&lt;p&gt;If you use a Box-Jenkins model, look at this research which uses an ARIMA framework to define clusters, and then measures the similarity of the time series via a cepstral coefficient based upon the autoregressive parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.csee.umbc.edu/~kalpakis/homepage/papers/ICDM01.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.csee.umbc.edu/~kalpakis/homepage/papers/ICDM01.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="520" LastActivityDate="2011-03-30T15:45:05.417" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="860" PostTypeId="2" ParentId="431" CreationDate="2011-03-30T18:31:42.747" Score="13" Body="&lt;p&gt;Khan Academy now offers &lt;a href=&quot;https://www.khanacademy.org/science/core-finance&quot; rel=&quot;noreferrer&quot;&gt;finance videos&lt;/a&gt; (he already started with e.g. the basics of option trading strategies and arbitrage pricing):&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="35" LastEditDate="2013-01-07T20:16:20.710" LastActivityDate="2013-01-07T20:16:20.710" CommentCount="0" CommunityOwnedDate="2011-03-30T18:31:42.747" ContentLicense="CC BY-SA 3.0" />
  <row Id="861" PostTypeId="2" ParentId="857" CreationDate="2011-03-30T18:46:38.190" Score="6" Body="&lt;p&gt;From a theoretical point of view (you mentioned beta, so assume we're in a CAPM world), you should hold the market portfolio (let's assume S&amp;amp;P500 index) and be long (or short) the risk-free asset to decrease (or increase) your return and risk. That is, if you'd like higher returns than the S&amp;amp;P500 offers and are willing to accept the risk, trade the S&amp;amp;P500 index on margin. Again, theoretically, you want to hold a portfolio along the line tangent to the efficient frontier. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the real world, maybe you can't lever up and trade on margin (maybe  borrowing from the bank to buy an S&amp;amp;P500 index fund), so then you'd want to look at an equity only portfolio with a beta greater than one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're looking at portfolio with a beta below one, then it seems that you should just hold the market and risk-free debt (maybe a money market savings account or low-yield corporate debt index fund, depending on your liquidity needs), which should outperform your low beta portfolio for a given level of risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming that you've minimized risk for a given return (i.e., you're on the efficient frontier), then ultimately your risk aversion will determine your trade off between risk and return (i.e., picking the right beta). I agree with Chris that the Sharpe and Treynor ratios are good ways of quantifying the risk-return trade-offs in each of these portfolios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although not viewed as rational in the strict sense, given that you likely need this capital for retirement or buying a house, you may want to also look at value-at-risk (VaR) or expected shortfall (ES) to quantify how much you could lose in some hypothesized worst-case scenario. Of course, there are some problems with these measures, but they're illustrative. &lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-03-30T18:46:38.190" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="862" PostTypeId="2" ParentId="614" CreationDate="2011-03-30T18:51:56.940" Score="2" Body="&lt;p&gt;I haven't tried myself but from what I have seen your best bet would be the managed accounts from Interactive Brokers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a nice post about it here: &lt;a href=&quot;http://leighdrogen.com/the-hedge-fund-structure-is-dead/&quot; rel=&quot;nofollow&quot;&gt;http://leighdrogen.com/the-hedge-fund-structure-is-dead/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;A quick and dirty option would be to use an API to pass the orders and loop through all the accounts doing that (i.e. one file with the list of orders, one with the list of accounts and a small program to pass the orders).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Btw, do you have a track record? ;)&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2011-03-30T18:51:56.940" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="863" PostTypeId="2" ParentId="857" CreationDate="2011-03-30T21:12:13.357" Score="4" Body="&lt;p&gt;The empirical evidence shows that low to medium beta portfolios beat high beta portfolios on a risk adjusted basis. Search SSRN for &quot;betting against beta.&quot; This flies completely in the face of CAPM but frankly CAPM is crap.&lt;/p&gt;&#xA;" OwnerUserId="352" LastActivityDate="2011-03-30T21:12:13.357" CommentCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="864" PostTypeId="1" CreationDate="2011-03-31T00:08:41.337" Score="11" ViewCount="1317" Body="&lt;p&gt;One way investors analyze stocks is on a technical basis.  Looking at Bollinger Banks (20 day moving average +- 2 standard deviations) is one of the most popular technical tools.  Some stocks trade between their Bollinger bands and rarely break through the bands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Research points to price changes in stocks as a random walk.  Also, most people believe that past news, and other factors have little if any impact on future price movements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I reconcile stocks that trade almost exclusively between their Bollinger bands and the two points highlighted above (random walk, past performance doesn't suggest future performance)?  Should looking at Bollinger Bands only be useful when deciding when to buy a stock after doing fundamental and other analysis?  Or is simply looking at Bollinger Bands enough to make a short term trading call?&lt;/p&gt;&#xA;" OwnerUserId="299" LastActivityDate="2012-07-11T03:31:11.993" Title="Trading a stock (or other asset) based on Bollinger Bands." Tags="&lt;moving-average&gt;&lt;technicals&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="865" PostTypeId="2" ParentId="864" CreationDate="2011-03-31T01:55:07.463" Score="13" Body="&lt;p&gt;Seeing a pattern in a chart is the finance equivalence of a Rorschach test---the discerned pattern says more about the person than the image. And really, if you want to trade that way, you may as well use astrology.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your real question seems to be:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;How can I accept or reject the hypothesis that Bollinger bands are an acceptable trading signal?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For that, you'll need to backtest a trading model. You'll have to get some data and write some software to simulate technical analysis. Of course, you must be absolutely carefully that you haven't biased your sample (survivorship, selection, look-ahead, etc). Only a well-executed backtest can give you the evidence to make an informed decision.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And once you've done that, you'll be a quant. Until then, you're just staring at ink on a page.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-03-31T01:55:07.463" CommentCount="7" ContentLicense="CC BY-SA 2.5" />
  <row Id="866" PostTypeId="2" ParentId="864" CreationDate="2011-03-31T02:15:12.000" Score="5" Body="&lt;p&gt;Just like everyone else that's been down this path, you'll have to prove this stuff to yourself.  Make sure that one of your competing tests is a &quot;noise test&quot; where the decision to go long or short is driven by a meaningless random number generator.   If your method can't statistically outperform noise, then your method is not doing anything meaningful.&lt;/p&gt;&#xA;" OwnerUserId="392" LastActivityDate="2011-03-31T02:15:12.000" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="867" PostTypeId="2" ParentId="864" CreationDate="2011-03-31T06:19:30.103" Score="1" Body="&lt;p&gt;Apparently in Forex markets, technical analysis is becoming less and less effective: &lt;a href=&quot;http://forextradingtipsdaily.com/fed-paper-power-of-technical-analysis-in-forex-is-declining/&quot; rel=&quot;nofollow&quot;&gt;http://forextradingtipsdaily.com/fed-paper-power-of-technical-analysis-in-forex-is-declining/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder if this is also the case for equity.&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2011-03-31T06:19:30.103" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="868" PostTypeId="2" ParentId="841" CreationDate="2011-03-31T07:31:41.897" Score="-1" Body="&lt;p&gt;This sounds like a perfect application for genetic algorithms to me.&lt;/p&gt;&#xA;" OwnerUserId="334" LastActivityDate="2011-03-31T07:31:41.897" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="869" PostTypeId="1" AcceptedAnswerId="872" CreationDate="2011-03-31T08:05:24.220" Score="10" ViewCount="1720" Body="&lt;p&gt;One commonly used sample estimator of volatility is the standard deviation of the log returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is indeed a very good estimator (unbiased, ...) &lt;strong&gt;when the sample is large.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I don't like it for small sample as it tends to overweight outliers in log returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you know if any other statistical dispersion measure that can be use to estimate the volatility of a stock? (I don't care about statistical properties; I just want it to estimate differently / better the daily risk of this stock.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: I have already tried to use the norm 1 instead of the Euclidean norm. Any other idea / remark?&lt;/p&gt;&#xA;" OwnerUserId="134" LastEditorUserId="2299" LastEditDate="2013-10-27T09:02:30.917" LastActivityDate="2019-04-28T07:14:58.043" Title="better estimator of volatility for small samples" Tags="&lt;volatility&gt;&lt;risk&gt;&lt;high-frequency-estimators&gt;" AnswerCount="4" CommentCount="5" FavoriteCount="13" ContentLicense="CC BY-SA 2.5" />
  <row Id="870" PostTypeId="2" ParentId="364" CreationDate="2011-03-31T13:17:30.693" Score="10" Body="&lt;p&gt;I teach Derivative Securities in the mathematical finance program at NYU and was rather surprised to learn that there is no proof of the FTAP that is accessible to masters level students. So I wrote &lt;a href=&quot;http://kalx.net/ftapd.pdf&quot;&gt;this&lt;/a&gt;. It is a simple proof for the discrete time case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One bonus of the proof of the one period case is that it tells you how to find the arbitrage if one exists. &lt;/p&gt;&#xA;" OwnerUserId="2357" LastActivityDate="2011-03-31T13:17:30.693" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="871" PostTypeId="2" ParentId="41" CreationDate="2011-03-31T13:30:39.810" Score="7" Body="&lt;p&gt;Richardh is spot on. The price of the VIX option is a weighted sum of put (strikes &amp;lt; forward) and call (strikes &gt; forward) options on the S&amp;amp;P 500. The weights are proportional to 1/strike^2. As the S&amp;amp;P goes down the out of the money puts become more valuable and those have the highest weights.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will leave arguments about the market as a whole to fuzzy headed pundits.&lt;/p&gt;&#xA;" OwnerUserId="2357" LastActivityDate="2011-03-31T13:30:39.810" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="872" PostTypeId="2" ParentId="869" CreationDate="2011-03-31T13:37:19.057" Score="5" Body="&lt;p&gt;You could use something like the interquartile or semi-interquartile range, which is somewhat more insensitive to extremes. This is a better measure to use if your data is skewed, however if your data is normally distributed it is still better to use the standard deviation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Interquartile_range&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Interquartile_range&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="520" LastEditorUserId="520" LastEditDate="2011-03-31T17:09:02.327" LastActivityDate="2011-03-31T17:09:02.327" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="873" PostTypeId="2" ParentId="843" CreationDate="2011-03-31T15:12:57.857" Score="2" Body="&lt;p&gt;Yeah, I've found this formula. So you just need to put&#xA;$$&#xD;&#xA;\Delta t &amp;lt; \frac{\log{u}}{r}.&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edited:&lt;/strong&gt; To avoid arbitrage one should have $0&amp;lt;d&amp;lt;1+r&amp;lt;u$ - (Shreve, Stochastic Calculus for Finance I), or in you case $0&amp;lt;d(\Delta t)&amp;lt;\mathrm{e}^{r\Delta t}&amp;lt;u(\Delta t)$. Only under this condition your formula&#xA;$$&#xD;&#xA;p = \frac{\mathrm{e}^{r\Delta t}-d}{u-d}&#xD;&#xA;$$&#xA;is valid and the probability will be less than $1$ and greater than $0$ - in fact I told you the same from the beginning. Using the formula for $u(\Delta t)$ we have that for a time step&#xA;$$&#xD;&#xA;\Delta t &amp;lt; \frac{\sigma^2}{r^2}.&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's strange that this conditions are not presented in wikipedia. Moreover they abuse notation for $u(\Delta t)$ and $d(\Delta t)$ using there $t$ rather than $\Delta t$.&lt;/p&gt;&#xA;" OwnerUserId="464" LastEditorUserId="464" LastEditDate="2011-04-01T08:40:44.203" LastActivityDate="2011-04-01T08:40:44.203" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="874" PostTypeId="2" ParentId="869" CreationDate="2011-03-31T18:28:42.023" Score="7" Body="&lt;p&gt;You mention &quot;daily&quot; risk, so I'm assuming you're looking at a daily frequency. Yang-Zhang Volatility (&lt;a href=&quot;http://www.atmif.com/papers/range.pdf&quot; rel=&quot;noreferrer&quot;&gt;Drift-independent Volatility Estimation Based on High, Low, Open and Close Prices&lt;/a&gt;) fits the bill for what you're asking, it takes into account intraday fluctuations as well. &lt;/p&gt;&#xA;" OwnerUserId="122" LastActivityDate="2011-03-31T18:28:42.023" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="875" PostTypeId="2" ParentId="751" CreationDate="2011-03-31T18:37:54.357" Score="6" Body="&lt;p&gt;Personally, I've dealt with volatility estimation using wavelets with HF data. Estimations seem reasonable and also it's fairly quick computation wise compared to other methods. There's quite a bit of literature on the subject, I would recommended starting off with &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0122796705&quot;&gt;An Introduction to Wavelets and Other Filtering Methods in Finance and Economics&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="122" LastActivityDate="2011-03-31T18:37:54.357" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="876" PostTypeId="2" ParentId="869" CreationDate="2011-03-31T22:16:46.393" Score="1" Body="&lt;p&gt;In order to suppress the effect of outliers, you can use indicator transform or rank transform. Once you convert your data in those form then you can find the volatility. Personally, I like indicator transform as it is easy, more popular in many applications and gives good results.&lt;/p&gt;&#xA;" OwnerDisplayName="user98" LastEditorDisplayName="user98" LastEditDate="2011-03-31T22:42:42.510" LastActivityDate="2011-03-31T22:42:42.510" CommentCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="877" PostTypeId="2" ParentId="751" CreationDate="2011-03-31T23:22:54.207" Score="6" Body="&lt;p&gt;Relevant paper:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Efficient Estimation of Volatility using High Frequency Data (Zumbach, Corsi, and Trapletti 2002)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.olsen.ch/fileadmin/Publications/Working_Papers/020221-efficientVolEstimator.pdf&quot;&gt;http://www.olsen.ch/fileadmin/Publications/Working_Papers/020221-efficientVolEstimator.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="225" LastActivityDate="2011-03-31T23:22:54.207" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="878" PostTypeId="2" ParentId="764" CreationDate="2011-03-31T23:28:56.463" Score="3" Body="&lt;p&gt;This question has been answered many times over already, though hopefully this will provide a bit more insight. If I understand your question correctly, you're basically asking if you can use BSM as a trading indicator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So let's think about what it really means to be trading an option. Every single variable (i.e. price of underlying asset, strike price, risk-free rate, and time until expiration) in the model is observable in the market, except volatility. So what does this mean? Mostly when we're trading an option, we're trading a difference in volatility. So let's assume you believe that your interpretation of what volatility is, is better than what's currently being priced by the market. That doesn't get us too far if we only want to trade the underlying. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now some people may look at ratios of calls/puts or call/put volume as well. I would definitely warn against this type of indicator as well. You're basing your indicator on the assumption that, say people only buy calls if they think the direction of the underlying is going to rise. This is simply untrue, those positions may be there for a market maker to hedge inventory risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps!&lt;/p&gt;&#xA;" OwnerUserId="122" LastActivityDate="2011-03-31T23:28:56.463" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="879" PostTypeId="1" AcceptedAnswerId="880" CreationDate="2011-04-01T02:04:42.227" Score="23" ViewCount="6669" Body="&lt;p&gt;I am not familiar with the concept of entropy for time series. I am looking for good reference papers and examples of use.&lt;/p&gt;&#xA;" OwnerUserId="134" LastEditorUserId="35" LastEditDate="2011-04-01T02:27:57.943" LastActivityDate="2020-03-25T12:07:35.387" Title="Can the concept of entropy be applied to financial time series?" Tags="&lt;time-series&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="13" ContentLicense="CC BY-SA 2.5" />
  <row Id="880" PostTypeId="2" ParentId="879" CreationDate="2011-04-01T06:27:58.400" Score="16" Body="&lt;p&gt;As a good starting point read this recent paper by Jing Chen:&lt;br&gt;&#xA;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1734526&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1734526&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a special use of the entropy concept for forecasting the '87-crash read this paper:&lt;br&gt;&#xA;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=959547&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=959547&lt;/a&gt;&lt;br&gt;&#xA;(Although I tried to contact the authors to get the data to reproduce their findings, which they didn't send, it is still an enlightening read)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a more popular exposition of the use of entropy in money management (key word 'Kelly formula') you should read this intelligent page turner by Poundstone: &lt;a href=&quot;http://books.google.de/books?id=ywLao52cY08C&amp;amp;dq=fortunes%20formula&amp;amp;hl=de&amp;amp;ei=7W-VTYXvO4ybOp_Znb0H&amp;amp;sa=X&amp;amp;oi=book_result&amp;amp;ct=result&amp;amp;resnum=1&amp;amp;sqi=2&amp;amp;ved=0CDEQ6AEwAA&quot;&gt;Fortunes Formula&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Quite an interesting paper is this one where Black-Scholes is derived through the use of concepts of relative entropy: &lt;a href=&quot;http://www.mdpi.com/1099-4300/2/2/70/&quot;&gt;http://www.mdpi.com/1099-4300/2/2/70/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2011-04-01T16:21:20.417" LastActivityDate="2011-04-01T16:21:20.417" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="881" PostTypeId="1" CreationDate="2011-04-01T11:05:20.063" Score="30" ViewCount="7434" Body="&lt;p&gt;Have a good quant joke? Share it here. The principle &quot;should be of interest to quants&quot; trumps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would be particularly keen to learn jokes which involve some nontrivial finance/mathematics. I am looking for jokes which make you laugh and think at the same time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a community wiki question: One quant joke or pun per answer please.&lt;/p&gt;&#xA;" OwnerUserId="70" LastActivityDate="2020-07-09T12:23:14.267" Title="Good quant finance jokes" Tags="&lt;soft-question&gt;" AnswerCount="14" CommentCount="4" FavoriteCount="12" CommunityOwnedDate="2011-04-01T11:05:34.870" ContentLicense="CC BY-SA 2.5" />
  <row Id="882" PostTypeId="2" ParentId="879" CreationDate="2011-04-01T14:38:02.440" Score="7" Body="&lt;p&gt;I have applied the concept of entropy and more specifically conditional entropy to spreading (ie, as a pricing model to get a sense for value)  &amp;amp; execution decisions. It's good for everytime you're facing a problem of the sort, given X what is the probability density function of Y.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, the concept of mutual information which evaluates mutual dependence between two (random) variables can be useful in many applications. Again spreading comes to mind, risk management, etc &lt;/p&gt;&#xA;&#xA;&lt;p&gt;No papers on hand, but as usual the wiki is pretty good one going&lt;/p&gt;&#xA;" OwnerUserId="471" LastActivityDate="2011-04-01T14:38:02.440" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="883" PostTypeId="1" CreationDate="2011-04-01T15:07:21.120" Score="15" ViewCount="12688" Body="&lt;p&gt;Are there any free c++ libraries that would have some of the functions that would be used in developing a trading strategy. For instance, calculating drawdown, Volatility Forecasting, MAE, MFE....etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know I could code these but this would help me save some time and focus on the strategy and not the report generations.&lt;/p&gt;&#xA;" OwnerUserId="681" LastActivityDate="2019-10-14T16:10:17.513" Title="Trading C++ Libraries" Tags="&lt;backtesting&gt;&lt;automated-trading&gt;&lt;programming&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="9" ContentLicense="CC BY-SA 2.5" />
  <row Id="884" PostTypeId="2" ParentId="883" CreationDate="2011-04-01T15:51:41.217" Score="7" Body="&lt;p&gt;Here are some suggestions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Search Amazon (or your favorite bookseller) for books concerning &quot;C++ quantitative finance.&quot; I found several titles that look promising.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I went to &lt;a href=&quot;http://sourceforge.net/search/?q=trading%20system&quot;&gt;SourceForge&lt;/a&gt; (searching on &quot;Trading Systems&quot;) and saw several promising systems that might give you a leg up in &#xA;drawdown, MAE, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use TradeStation 9.0 for comparing various trading strategies. It will provide MAE/MFE graphs, trade equity curves, and rank strategies based on maximum drawdown. But be sure to read &lt;em&gt;Trading Systems That Work: Building and Evaluating Effective Trading Systems&lt;/em&gt; by Thomas Stridsman for an apt critique of TradeStation's generated reports.&lt;/p&gt;&#xA;" OwnerUserId="343" LastActivityDate="2011-04-01T15:51:41.217" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="885" PostTypeId="2" ParentId="883" CreationDate="2011-04-01T16:39:08.153" Score="2" Body="&lt;p&gt;QuantLib is widely used&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://quantlib.org/docs.shtml&quot; rel=&quot;nofollow&quot;&gt;http://quantlib.org/docs.shtml&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="471" LastActivityDate="2011-04-01T16:39:08.153" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="886" PostTypeId="2" ParentId="883" CreationDate="2011-04-01T19:09:42.937" Score="5" Body="&lt;p&gt;For actually creating your trading strategy, you could use the open-source TA-Lib (written in C/C++) available &lt;a href=&quot;http://ta-lib.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;. To test it, you could use &lt;a href=&quot;http://www.r-project.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;R&lt;/a&gt; and the &lt;a href=&quot;http://cran.r-project.org/web/packages/PerformanceAnalytics/&quot; rel=&quot;nofollow noreferrer&quot;&gt;PerformanceAnalytics package&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="252" LastEditorUserId="26556" LastEditDate="2019-10-14T16:10:17.513" LastActivityDate="2019-10-14T16:10:17.513" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="887" PostTypeId="2" ParentId="881" CreationDate="2011-04-01T20:04:33.263" Score="21" Body="&lt;p&gt;Investment bank Dog competition:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A researcher, a risk manager and a trader each bring a dog to a competition. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first one to display is the researcher's dog. The researcher brought a bottle of milk a bowl and placed it all on the floor. Then he commanded the dog to take the bottle and pour the milk into the bowl until the maximum amount it could hold. And that is exactly what his dog did. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second one to display is the risk manager's dog. The risk manager's brought a bottle of milk a bowl and placed it all on the floor. Then he commanded the dog to take the bottle and pour the milk into the bowl until two thirds of the maximum it could hold and without spilling any milk during the whole process. And that is exactly what his dog did. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The third one to display is the trader's dog. The trader did not bring anything other than the dog. Then he commanded the dog to do what he taught. The dog stands up and walks in the direction of each one of the bowls and drinks all the milk. &lt;/p&gt;&#xA;" OwnerUserId="122" LastActivityDate="2011-04-01T20:04:33.263" CommentCount="0" CommunityOwnedDate="2011-04-01T20:04:33.263" ContentLicense="CC BY-SA 2.5" />
  <row Id="888" PostTypeId="2" ParentId="881" CreationDate="2011-04-02T00:30:39.790" Score="36" Body="&lt;p&gt;Efficient Market Hypothesis Joke:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;There is an old joke, widely told among economists, about an economist strolling down the street with a companion when they come upon a 100 dollar bill lying on the ground. As the companion reaches down to pick it up, the economist says ‘Don’t bother — if it were a real 100 dollar bill, someone would have already picked it up’.”&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerDisplayName="user682" LastActivityDate="2011-04-02T00:30:39.790" CommentCount="1" CommunityOwnedDate="2011-04-02T00:30:39.790" ContentLicense="CC BY-SA 2.5" />
  <row Id="889" PostTypeId="1" AcceptedAnswerId="894" CreationDate="2011-04-02T06:07:20.797" Score="6" ViewCount="999" Body="&lt;p&gt;I am asked to map financial products into XML. It can be in any format. I know there is an open specification FPML. Is that worth to adopt FPML rather than my own standards? Also, how common FPML is in the industry?&lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="601" LastEditDate="2011-04-02T09:46:48.997" LastActivityDate="2011-04-03T10:03:41.277" Title="Financial Products Markup Language" Tags="&lt;quants&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="890" PostTypeId="2" ParentId="889" CreationDate="2011-04-02T16:27:43.443" Score="1" Body="&lt;p&gt;Be prepared to extend any specification you will use.&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2011-04-02T16:27:43.443" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="891" PostTypeId="1" CreationDate="2011-04-02T23:16:55.887" Score="7" ViewCount="313" Body="&lt;p&gt;I recently become interested in finance.  Many books discuss options as simple examples of derivatives.  I also read some &quot;popular books&quot;.  I read in &quot;The Poker Face of Wall Street&quot; that almost no farmers actually use commodity exchanges (p91), while in many places the opposite is claimed (for example, &quot;Traders, Guns, &amp;amp; Money&quot;, p 25, says &quot;The major users [of commodity futures] were really farmers&quot;).  Why are these two accounts differ?&lt;/p&gt;&#xA;" OwnerUserId="686" LastActivityDate="2011-04-02T23:34:14.100" Title="Did farmers really buy options on the CBOE?" Tags="&lt;futures&gt;&lt;books&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ClosedDate="2011-04-03T02:58:15.277" ContentLicense="CC BY-SA 2.5" />
  <row Id="892" PostTypeId="2" ParentId="891" CreationDate="2011-04-02T23:34:14.100" Score="6" Body="&lt;ol&gt;&#xA;&lt;li&gt;Farmers (usually referred to as hedgers) typically buy Futures, not options.&lt;/li&gt;&#xA;&lt;li&gt;The CBOE does not transact in agricultural commodities&lt;/li&gt;&#xA;&lt;li&gt;The CME, and other exchanges, transact in agricultural commodities.&lt;/li&gt;&#xA;&lt;li&gt;These exchanges grew, for the most part, directly from the trading interactions of farmers(hedgers/producers) and middle-men(speculators), in the area where these commodities were brought to be processed and sold.&lt;/li&gt;&#xA;&lt;li&gt;Even if a farmer never buys or sells an exchange traded commodity contract, he will almost surely check the listed exchange price when making a deal with a broker to sell his crop. Also, larger farmers/producers and consumers/foodbeverage manufacturers are more likely to use exchange traded commodities to reduce their risk/costs.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-04-02T23:34:14.100" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="893" PostTypeId="2" ParentId="881" CreationDate="2011-04-02T23:43:57.320" Score="25" Body="&lt;p&gt;Adapted from a joke about economists:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A quant(financial engineer), a mechanical engineer, and a chemical engineer are shipwrecked on a deserted island. They are starving, and are tired of eating coconuts.  They come upon a can of food on the beach....&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The mechanical engineer says, 'let's wdge the can between these 2 palm trees and rig a branch to chop the top of the can off'   The other two quickly point out that this will destroy the can and likely send the contents all over the place, wasting them...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The chemical engineer says, 'let's take the sea water and reverse the polarity of the water extracting the salt to make an acid and then burn one end of the can off'  The other two quickly point out that while this is clever it will likely ruin the contents of the can.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The quant says, 'let's make a simplifying modeling assumption.... let's begin by assuming that we have a can opener'&lt;/p&gt;&#xA;&#xA;&lt;p&gt;:-)&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-04-02T23:43:57.320" CommentCount="0" CommunityOwnedDate="2011-04-02T23:43:57.320" ContentLicense="CC BY-SA 2.5" />
  <row Id="894" PostTypeId="2" ParentId="889" CreationDate="2011-04-03T09:52:20.687" Score="8" Body="&lt;p&gt;we used fpml all the time in morgan. Of course its not surprising given their involvment in it.&lt;/p&gt;&#xA;" OwnerUserId="689" LastActivityDate="2011-04-03T09:52:20.687" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="895" PostTypeId="2" ParentId="889" CreationDate="2011-04-03T10:03:41.277" Score="7" Body="&lt;p&gt;Quite common - such products as Calypso and Murex use their own derivations of FpML: CalypsoMl and MxML respectively. &lt;/p&gt;&#xA;" OwnerUserId="690" LastActivityDate="2011-04-03T10:03:41.277" CommentCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="896" PostTypeId="2" ParentId="115" CreationDate="2011-04-03T18:00:40.800" Score="9" Body="&lt;p&gt;I just ran across an interesting &lt;a href=&quot;http://www.slideshare.net/gaetanlion/black-swan-the-fat-tail-issue&quot;&gt;presentation&lt;/a&gt; comparing the effectiveness of Normal, Cauchy, and Student's-t distributions in modeling the S&amp;amp;P. It concludes that the normal distribution underestimates extreme movements, the Cauchy overestimates them (although a comment on the presentation points out that Mandelbrot used different parameters than the author did), and concludes that the student's-t is a fairly good fit.&lt;/p&gt;&#xA;" OwnerUserId="80" LastActivityDate="2011-04-03T18:00:40.800" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="897" PostTypeId="1" CreationDate="2011-04-04T00:00:54.743" Score="7" ViewCount="2201" Body="&lt;p&gt;What are the limitations of brownian motion in its applications to finance?&lt;/p&gt;&#xA;" OwnerDisplayName="user693" LastActivityDate="2011-04-04T01:54:56.390" Title="What are the limitations of brownian motion in finance?" Tags="&lt;brownian-motion&gt;" AnswerCount="3" CommentCount="0" ClosedDate="2014-01-30T15:10:53.090" ContentLicense="CC BY-SA 2.5" />
  <row Id="898" PostTypeId="2" ParentId="897" CreationDate="2011-04-04T00:49:52.733" Score="4" Body="&lt;p&gt;From &lt;a href=&quot;http://pages.stern.nyu.edu/~churvich/Forecasting/Handouts/Scholes.pdf&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The geometric Brownian motion model implies that the series of ﬁrst differences of the log prices must be uncorrelated. But for the S&amp;amp;P 500 as a whole, observed over several decades, daily from 1 July 1962 to 29 Dec 1995, there are in fact small but statistically signiﬁcant correlations in the differences of the logs at short time lags.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-04-04T00:49:52.733" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="899" PostTypeId="2" ParentId="897" CreationDate="2011-04-04T00:57:43.877" Score="5" Body="&lt;p&gt;So where to begin? Continuity is a big thing as it fails to take into account jumps, the Gaussian assumption is another big one. However, looking deeper into it stationarity is a huge problem as it applies to financial time series.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it does an OK job at simulation stuff in the long-run. &lt;/p&gt;&#xA;" OwnerUserId="122" LastActivityDate="2011-04-04T00:57:43.877" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="900" PostTypeId="2" ParentId="897" CreationDate="2011-04-04T01:54:56.390" Score="4" Body="&lt;p&gt;It is a binomial tree in disguise.&lt;/p&gt;&#xA;" OwnerUserId="2357" LastActivityDate="2011-04-04T01:54:56.390" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="901" PostTypeId="2" ParentId="214" CreationDate="2011-04-04T02:06:17.770" Score="5" Body="&lt;p&gt;Not really a paradox, but kind of surprising that delta is not necessarily the derivative of option value with respect to the price of the underlying in the standard MBA one period binomial model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose the realized return over the period is $R$, the stock price at the beginning is $s$ and can go to either $sd$ or $su$ at the end. We can replicate any payoff function, $f$, by solving two linear equations in two unknowns: $m$, the amount invested in the bond, and $n$, the number of shares of stock to buy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$f(sd) = m R + n sd$&lt;br&gt;&#xA;$f(su) = m R + n su$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We find the delta hedge ratio $n = (f(su) - f(sd))/(su - sd)$ and the option value $v = [(R - d) f(su) + (u - R) f(sd)]/R(u - d)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Find a payoff f such that $n ≠ dv/ds$. &lt;/p&gt;&#xA;" OwnerUserId="2357" LastEditorUserId="263" LastEditDate="2013-12-29T14:43:16.837" LastActivityDate="2013-12-29T14:43:16.837" CommentCount="2" CommunityOwnedDate="2011-04-04T02:06:17.770" ContentLicense="CC BY-SA 3.0" />
  <row Id="903" PostTypeId="1" CreationDate="2011-04-04T04:05:13.860" Score="17" ViewCount="3204" Body="&lt;p&gt;What is the role of skewness in portfolio optimization?&lt;/p&gt;&#xA;" OwnerUserId="696" LastEditorUserId="1106" LastEditDate="2011-08-29T14:27:54.193" LastActivityDate="2011-08-29T20:11:07.047" Title="Role of skewness in portfolio optimization?" Tags="&lt;optimization&gt;&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;skewness&gt;" AnswerCount="3" CommentCount="6" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="904" PostTypeId="2" ParentId="214" CreationDate="2011-04-04T09:51:16.920" Score="9" Body="&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Parrondo%27s_paradox&quot;&gt;Parrondo's paradox&lt;/a&gt; is a paradox in game theory that describes a losing strategy that wins in the long term. It seems the paradox is only used in textbook examples of finance and has little applications in practice, though.&lt;/p&gt;&#xA;" OwnerUserId="156" LastActivityDate="2011-04-04T09:51:16.920" CommentCount="1" CommunityOwnedDate="2011-04-04T09:51:16.920" ContentLicense="CC BY-SA 2.5" />
  <row Id="905" PostTypeId="1" AcceptedAnswerId="912" CreationDate="2011-04-04T19:51:34.640" Score="5" ViewCount="373" Body="&lt;p&gt;So, any European type option we can characterize with a payoff function $P(S)$ where $S$ is a price of an underlying at the maturity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us consider some model $M$ such that within this model $V(S,\tau,P)$ is a price of an option with a payoff $P$ at time to maturity $\tau$ and an asset's price $S$ at time $\tau$.&#xA;Using only non-arbitrage principles we obtain&#xA;$$&#xD;&#xA;V(S,\tau,P_1+P_2) = V(S,\tau,P_1)+V(S,\tau,P_2).&#xD;&#xA;$$&#xA;With this formula we get one symmetry for the equation on the price of the option which holds regardless of the model $M$. Usually all equations are linear in payoff since they are linear themselves which comes from the fact that this equation are obtained using infinitesimal generators of the stochastic processes for the price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any other non-arbitrage principles which can make some additional restrictions on the equations for the price of the European option? I thought about using some facts on $V(S,\tau,P_1(P_2))$ and options on options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edited:&lt;/strong&gt; the non-arbitrage argument for the linearity is the following. Suppose for some $S,\tau$ we have $V(S,\tau,P_1+P_2) &amp;gt; V(S,\tau,P_1)+V(S,\tau,P_2)$. Then we can short $V(...,P_1+P_2)$ and long $V(...,P_1)$ and $V(...,P_2)$ - so at the maturity we have nothing to pay, but at the current time the difference $$V(S,\tau,P_1+P_2) - V(S,\tau,P_1)-V(S,\tau,P_2)$$ is our profit.&lt;/p&gt;&#xA;" OwnerUserId="464" LastEditorUserId="464" LastEditDate="2011-04-05T08:05:38.177" LastActivityDate="2011-04-05T16:50:32.847" Title="An equation for European options" Tags="&lt;option-pricing&gt;&lt;differential-equations&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="906" PostTypeId="1" AcceptedAnswerId="907" CreationDate="2011-04-04T20:29:33.110" Score="8" ViewCount="803" Body="&lt;p&gt;I have a MSc degree in the area of Financial Mathematics, but I am doing research now in other field of stochastics. Could you please tell me about the most important problems of (stochastic) financial mathematics nowadays? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are they only looking for new processes for they price of an asset (and solutions of corresponding pricing problems)? Maybe they also wondering about distributions of log-returns?&#xA;- these are the problem which seems to be always actual and I remember it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there are any other striking problems? Please do not hesitate to make just suppositions - what are the important problems in your opinion.&lt;/p&gt;&#xA;" OwnerUserId="464" LastActivityDate="2012-10-10T09:46:55.880" Title="Modern problems in financial mathematics" Tags="&lt;general&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="907" PostTypeId="2" ParentId="906" CreationDate="2011-04-05T05:43:17.840" Score="7" Body="&lt;p&gt;My personal favourites:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;pricing and hedging in incomplete markets, in particular credit derivatives &lt;/li&gt;&#xA;&lt;li&gt;stochastic prediction-discount and inter-tenor&#xA;basis in the interest rate market; see &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1334356&quot; rel=&quot;noreferrer&quot;&gt;&quot;Two curves, one price&quot;&lt;/a&gt; (Bianchetti) and &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1332205&amp;amp;rec=1&amp;amp;srcabs=1334356&quot; rel=&quot;noreferrer&quot;&gt;&quot;Interest Rates and The Credit Crunch: New Formulas and Market Models &quot;&lt;/a&gt; (Mercurio)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="89" LastEditorUserId="89" LastEditDate="2011-04-08T05:43:15.580" LastActivityDate="2011-04-08T05:43:15.580" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="908" PostTypeId="1" AcceptedAnswerId="1091" CreationDate="2011-04-05T06:10:13.113" Score="20" ViewCount="2763" Body="&lt;p&gt;Mr. Soros in his books talked about principles which are not used by today's financial mathematics&amp;nbsp;— namely reflexivity of all actions on the market. Simply it can be given by following: expectations of traders are based on the news and historical prices. They trade based on their expectations and hence influence prices which then influence expectations on the next &quot;turn&quot;.&#xA;I have never met an implementation of these ideas in the scientific framework. Have you? If yes, please give me a reference.&lt;/p&gt;&#xA;" OwnerUserId="464" LastEditorUserId="263" LastEditDate="2011-04-16T22:02:09.233" LastActivityDate="2015-09-03T04:03:22.150" Title="George Soros models" Tags="&lt;models&gt;" AnswerCount="6" CommentCount="9" FavoriteCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="909" PostTypeId="1" CreationDate="2011-04-05T06:22:59.270" Score="7" ViewCount="1183" Body="&lt;p&gt;I am doing some research involving black-scholes model and got stuck with dividend-paying stocks when evaluating options. What is the real-world approach on handling the situations when an underlying pays dividend? &#xA;Thank you&lt;/p&gt;&#xA;" OwnerUserId="428" LastActivityDate="2011-04-06T19:02:52.947" Title="Black-Scholes No Dividends assumption" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="910" PostTypeId="2" ParentId="909" CreationDate="2011-04-05T07:06:59.263" Score="1" Body="&lt;p&gt;Well the real issue (IMO) is not dividend but rather estimating the forward price of the underlying at exercise date (in the BS setting for vanillas which I think is your setting). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my answer, with which you will not be really satisfied I think, is that any model (continuous, discrete, even stochastic dividend) will do the trick for pricing purposes as long as you get the correct forward of the underlying stock of your option (for hedging this is a different issue).&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="35" LastEditDate="2011-04-05T14:52:39.117" LastActivityDate="2011-04-05T14:52:39.117" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="911" PostTypeId="1" CreationDate="2011-04-05T07:11:34.723" Score="11" ViewCount="327" Body="&lt;p&gt;Consider $U_1(\mu,\Sigma)$ and $U_2(\mu,\Sigma)$, where $U_1(\mu, \cdot) = U_2(\mu, \cdot)$, $U_1(\cdot, \Sigma) = U_2(\cdot, \Sigma)$ such that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation*}&#xA;arg\inf\limits_{\mu \in U_1(\mu, \cdot), \Sigma \in U_1(\cdot, \Sigma)} \left(w^T \mu – \alpha w^T \Sigma w \right)&#xA;\equiv arg\inf\limits_{\mu \in U_2(\mu, \cdot), \Sigma \in U_2(\cdot, \Sigma)} \left(w^T \mu – \alpha w^T \Sigma w\right)&#xA;\end{equation*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solutions for inner problems are the same&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(\mu, \Sigma)$ from $U_1$ are positively related ($\Sigma \uparrow$ as $\mu \uparrow \Rightarrow$ positively skewed)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(\mu, \Sigma)$ from $U_2$ are negatively related ($\Sigma \downarrow$ as $\mu \uparrow \Rightarrow$ negatively skewed)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solutions for inner problem: low $\mu$, high $\Sigma$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;arg\inf\limits_{(\mu, \Sigma) \in U_1(\mu, \Sigma)} \left(w^T \mu – \alpha w^T \Sigma w \right)&#xA;\geq arg\inf\limits_{(\mu, \Sigma) \in U_2(\mu, \Sigma)} \left(w^T \mu – \alpha w^T \Sigma w \right) \quad (1)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Rightarrow$ negative skewness is penalized by linking $U(\mu)$ and $U(\Sigma)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\begin{align}&#xD;&#xA;\max\limits_w \left(w^T \mu – \alpha w^T \Sigma w\right) &amp;amp;\geq \max\limits_w\inf\limits_{(\mu, \Sigma) \in U(\mu, \Sigma)} \left(w^T \mu – \alpha w^T \Sigma w\right)\\ &amp;amp;\geq \max\limits_w\inf\limits_{\mu \in U(\mu), \Sigma \in U(\Sigma)} \left(w^T \mu – \alpha w^T \Sigma w\right)\quad (2)&#xD;&#xA;\end{align}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone help me in proving the equation 1 and 2?&#xA;here the uncertain set for mu(mean) could be ellipsoid and will change the problem in second order conic problem ......and the uncertain set for the sigma(variance matrix) could be a rectangular box which will change the problem in semi definite programming problem.also we can choose some others as i mention in the comments.&lt;/p&gt;&#xA;" OwnerUserId="696" LastEditorUserId="696" LastEditDate="2011-04-11T02:42:38.897" LastActivityDate="2011-10-03T15:04:36.980" Title="penalizing negative skewness by linking $U(\mu)$ and $U(\Sigma)$" Tags="&lt;financial-engineering&gt;&lt;portfolio-management&gt;" AnswerCount="1" CommentCount="16" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="912" PostTypeId="2" ParentId="905" CreationDate="2011-04-05T09:35:26.530" Score="3" Body="&lt;p&gt;I think you provided the two that must be met. Pricing must be linear.$$V(\ldots, 2P) = 2 \cdot V(\ldots, P)$$ And pricing must meet the law of iterated value. Where $\tau \in (t, T)$ $$V_t(\ldots, \tau, V_{\tau}(\ldots, T, P)) = V_t(\ldots, T, P)$$ These two laws must be met for any cash flow to prevent arbitrage.&lt;/p&gt;&#xA;" OwnerUserId="106" LastEditorUserId="106" LastEditDate="2011-04-05T16:50:32.847" LastActivityDate="2011-04-05T16:50:32.847" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="913" PostTypeId="2" ParentId="545" CreationDate="2011-04-05T15:42:36.530" Score="18" Body="&lt;p&gt;There's a lot of people here talking about how GAs are empirical, don't have theoretical foundations, are black-boxes, and the like.  I beg to differ!  There's a whole branch of economics devoted to looking at markets in terms of evolutionary metaphors:  Evolutionary Economics!  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I highly recommend the Dopfer book, The Evolutionary Foundations of Economics, as an intro.&#xA;&lt;a href=&quot;http://www.cambridge.org/gb/knowledge/isbn/item1158033?site_locale=en_GB&quot;&gt;http://www.cambridge.org/gb/knowledge/isbn/item1158033?site_locale=en_GB&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your philosophical view is that the market is basically a giant casino, or game, then a GA is simply a black-box and doesn't have any theoretical foundation.  However, if your philosophy is that the market is a survival-of-the-fittest ecology, then GA's have plenty of theoretical foundations, and it's perfectly reasonable to discuss things like corporate speciation, market ecologies, portfolio genomes, trading climates, and the like.  &lt;/p&gt;&#xA;" OwnerUserId="700" LastActivityDate="2011-04-05T15:42:36.530" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="914" PostTypeId="2" ParentId="903" CreationDate="2011-04-05T18:19:57.437" Score="3" Body="&lt;p&gt;Assuming you're talking about optimizing a portfolio that has options included in its investment universe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Skewness isn't directly modeled in the optimization, although many formulations involve using implied vol as the currency numeraire. (i.e. modeling the components of skewness, instead of skewness itself)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main impact on the optimization though is that the type of solver used changes if you want to guarantee solution uniqueness/global optimality.  (Second order cone - solver).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, this solver change is a result of simply having options in the investment universe, not from skewness per se.&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-04-05T18:19:57.437" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="915" PostTypeId="1" AcceptedAnswerId="1623" CreationDate="2011-04-05T20:48:08.800" Score="11" ViewCount="24029" Body="&lt;p&gt;What does a CVA (Credit Valuation Adjustment) desk do, and how are its activities different from other trading desks? Can you work as a quant for a CVA desk and consider your role &quot;front office&quot;?&lt;/p&gt;&#xA;" OwnerUserId="89" LastEditorUserId="1106" LastEditDate="2011-08-08T03:32:58.350" LastActivityDate="2014-04-20T14:41:19.677" Title="What is the role of Credit Valuation Adjustment (CVA) desks in investment banks?" Tags="&lt;career&gt;&lt;cva&gt;&lt;banks&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="916" PostTypeId="1" AcceptedAnswerId="917" CreationDate="2011-04-05T22:46:51.513" Score="22" ViewCount="8319" Body="&lt;p&gt;does anybody know a site where I can download historical data on stocks including companies that have gone bankrupt such as lehman brothers?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;it appears that bankrupt companies no longer appear in the finance sites that I know...&lt;/p&gt;&#xA;" OwnerUserId="703" LastActivityDate="2021-03-17T13:49:36.880" Title="data on historical stock price of bankrupt companies" Tags="&lt;data&gt;&lt;finance&gt;&lt;equities&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="917" PostTypeId="2" ParentId="916" CreationDate="2011-04-05T23:09:05.790" Score="12" Body="&lt;p&gt;Google and Yahoo finance have a survivorship bias -- they only include firms that are still around. I know of no free source that provides the data you seek. I get my data from Compustat and CRSP via the Wharton Resource Data Service, but these (or Bloomberg or Reuters) are likely too expensive for an individual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have you asked your broker if they will sell you the data you want?&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-04-05T23:09:05.790" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="919" PostTypeId="1" CreationDate="2011-04-06T02:40:33.817" Score="4" ViewCount="233" Body="&lt;p&gt;Curious as to whether or not there is any sort of all time record. Any index, future, or stock will do. Volatility must be well above the average 1 year volatility for all periods.&lt;/p&gt;&#xA;" OwnerUserId="520" LastActivityDate="2017-07-21T05:34:52.150" Title="What is the longest number of consecutive days that options implied volatility has stayed &quot;extremely high&quot; for any particular underlying?" Tags="&lt;volatility&gt;&lt;options&gt;&lt;implied-volatility&gt;" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 2.5" />
  <row Id="920" PostTypeId="1" CreationDate="2011-04-06T03:33:09.547" Score="2" ViewCount="1249" Body="&lt;p&gt;Me and my friends are from Europe, we went to US. At the end of the trip they bought an item worth $USD 100$, but because they were short of money, so I paid for the item first with my own $USD 100$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After we came back from Europe, they would have to pay me. They would like to pay me in EUR. What is the &lt;em&gt;fair&lt;/em&gt; amount of EUR they should pay me?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming that at money exchange counter, the rates are as follow ( buy/sell are from their perspective):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 USD buys 1 EUR&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 EUR buys $\frac{1}{1.05}$ USD.&lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2011-05-12T08:50:22.407" Title="The Fair Value of Paying in Currency X for Goods Bought in Currency Y" Tags="&lt;currency&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="921" PostTypeId="2" ParentId="909" CreationDate="2011-04-06T06:37:00.583" Score="2" Body="&lt;p&gt;Assuming that by &quot;real-world&quot;, you mean &quot;with dividends&quot;, you can find extensions of the Black-Scholes models which include dividends on &lt;a href=&quot;http://en.wikipedia.org/wiki/Black%E2%80%93Scholes#Instruments_paying_continuous_yield_dividends&quot; rel=&quot;nofollow&quot;&gt;this wikipedia page&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As @TheBridge mentioned in his answer, there are several assumptions that are made within the BS framework, so your model can become more complicated depending on the assumptions you make.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2011-04-06T06:37:00.583" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="922" PostTypeId="2" ParentId="920" CreationDate="2011-04-06T06:40:33.400" Score="1" Body="&lt;p&gt;Not realy a quant question but funny though,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are my two euro-cents,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would say that you should ask them for 100-USD times the exchange rate at the date you lend them, plus the interest rates amount that can be calculated by compounding EUR EONIA rate on the period you lend them that money. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards&lt;/p&gt;&#xA;" OwnerUserId="92" LastActivityDate="2011-04-06T06:40:33.400" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="923" PostTypeId="2" ParentId="915" CreationDate="2011-04-06T07:52:57.413" Score="7" Body="&lt;p&gt;In principle you could say they mainly do risk management on bank level, but also make $ on the way trading out the counterparty risks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quoting a post in Willmott:&lt;br&gt;&#xA;&quot;here's how you make profits on a CVA desk.&#xA;1) you get paid by an internal desk to cover their c/p risk. you stay long and the credit tightens... you make money (similar to #2 below)&#xA;2) Prop trading in a credit you may or may not have a risk in&#xA;3) you way overcharge a moronic internal desk that doesn't have bloomberg or know wtf a CDS is AKA arbing your own firm&#xA;4) crossing dealers on illiquid credits AKA being a spiv&quot;&lt;/p&gt;&#xA;" OwnerUserId="647" LastActivityDate="2011-04-06T07:52:57.413" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="924" PostTypeId="2" ParentId="916" CreationDate="2011-04-06T09:47:26.723" Score="7" Body="&lt;p&gt;There is a very cheap, i.e. free, way of obtaining the list of companies included in the  S&amp;amp;P 500 at any given time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Check the revision history for the &lt;strong&gt;&lt;a href=&quot;http://en.wikipedia.org/w/index.php?title=List_of_S&amp;amp;P_500_companies&amp;amp;limit=500&amp;amp;action=history&quot; rel=&quot;nofollow&quot; title=&quot;Wikipedia S&amp;amp;P 500 List history&quot;&gt;S&amp;amp;P 500 List updates on Wikipedia&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is ugly and unreliable but you usually get what you pay for :) ... it should be okay if you are just playing around with your own strategies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This doesn't solve the main issue since you still need a way to get the data for those companies. But having the right ticker usually helps...&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="999" LastEditDate="2012-10-06T10:47:53.123" LastActivityDate="2012-10-06T10:47:53.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="925" PostTypeId="1" CreationDate="2011-04-06T10:46:34.720" Score="10" ViewCount="6659" Body="&lt;p&gt;What is the practical use for Vanna in trading? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can it be used for a PnL attribution?&lt;/p&gt;&#xA;" OwnerUserId="690" LastEditorUserId="690" LastEditDate="2011-04-06T21:25:02.423" LastActivityDate="2012-03-15T16:37:49.580" Title="Vanna - any practical uses for risk or pnl attribution purposes?" Tags="&lt;greeks&gt;" AnswerCount="6" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="926" PostTypeId="2" ParentId="925" CreationDate="2011-04-06T11:52:18.050" Score="7" Body="&lt;p&gt;Pretty much irrelevant for vanilla markets but really cannot be ignored when pricing exotics such as barriers. Basically, if you do not hedge vega you are likely to sell lots of cheap exotics. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Webb discusses the practical relevance of vanna and vomma  in &lt;a href=&quot;http://www.derivativesstrategy.com/magazine/archive/1999/1199fea1.asp&quot; rel=&quot;noreferrer&quot;&gt;&quot;The Sensitivity of Vega&quot;&lt;/a&gt; (&lt;em&gt;Derivatives Strategy&lt;/em&gt;, November (1999), pp. 16 - 19). &lt;/p&gt;&#xA;" OwnerUserId="70" LastActivityDate="2011-04-06T11:52:18.050" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="927" PostTypeId="2" ParentId="881" CreationDate="2011-04-06T15:20:10.543" Score="27" Body="&lt;p&gt;When asked &quot;your money or your life&quot;, attempts to calculate the implied volatility.&lt;/p&gt;&#xA;" OwnerDisplayName="user59" LastActivityDate="2011-04-06T15:20:10.543" CommentCount="5" CommunityOwnedDate="2011-04-06T15:20:10.543" ContentLicense="CC BY-SA 2.5" />
  <row Id="928" PostTypeId="1" AcceptedAnswerId="930" CreationDate="2011-04-06T17:57:33.510" Score="9" ViewCount="2177" Body="&lt;p&gt;I have a time series with monthly data from which I compute the expected shortfall empirically, following the classical definition which can be found, for example, in &lt;a href=&quot;http://en.wikipedia.org/wiki/Expected_shortfall&quot;&gt;wikipedia's definition&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, assuming I have 200 monthly returns and I am looking to compute the 10% expected shortfall, I take the worst 20 returns and I compute their mean to get my $ES_{10}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The thing is, I have a &quot;monthly&quot; expected shortfall, and I would like to annualize this result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder whether I should consider it as a &quot;return&quot; and do $(1+ES_{10})^{12}-1$ or maybe use the volatility annualization $ES_{10} \cdot \sqrt{12}$? Or is it something different?&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2018-06-20T13:33:05.957" Title="How to annualize Expected Shortfall?" Tags="&lt;time-series&gt;&lt;risk-management&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="929" PostTypeId="1" CreationDate="2011-04-06T18:28:45.977" Score="6" ViewCount="161" Body="&lt;p&gt;Does anyone know of a source of machine-readable (XML,etc) OCC Infomemos? The PDF files available below contain all the information I want, but are a pain to parse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.optionsclearing.com/market-data/infomemos/infomemos1.jsp&quot;&gt;http://www.optionsclearing.com/market-data/infomemos/infomemos1.jsp&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="236" LastActivityDate="2011-04-07T09:25:13.290" Title="Availability of machine-readable OCC Infomemos?" Tags="&lt;data&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 2.5" />
  <row Id="930" PostTypeId="2" ParentId="928" CreationDate="2011-04-06T18:43:38.057" Score="5" Body="&lt;p&gt;If you are willing to hypothesize a normal distribution of returns for these purposes, then you scale by the square root.  However, normal tails are fairly skinny, so a lot of people like to fit Student-t or Pareto distributions to the tails.  In this case, you have to convolve 12 copies of the fitted distribution together, and in the general case there is no simple formula to help you.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-04-06T18:43:38.057" CommentCount="4" ContentLicense="CC BY-SA 2.5" />
  <row Id="931" PostTypeId="2" ParentId="909" CreationDate="2011-04-06T19:02:52.947" Score="5" Body="&lt;p&gt;The simplest common approach is to assume a continuous dividend yield.  This is treated mathematically in the same way as foreign interest rates on FX options, and the necessary changes to the formula can be found with a quick web search.  If the options are European exercise then you might be perfectly happy with this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A more robust treatment of dividends involves using dynamic programming (such as trinomial trees) to price the option, where dividends are treated as partly proportional to stock price, and partly fixed according to taste.  In this case, the dividend is treated as a boundary condition on your solution grid.  It's quite a bit more difficult to get that right.  You can see how it works in Hull's book.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-04-06T19:02:52.947" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="932" PostTypeId="2" ParentId="764" CreationDate="2011-04-06T19:38:25.700" Score="0" Body="&lt;p&gt;So, reading the question, I see two parts:  first, can Black-Scholes be part of the buying process? and second, is Black-Scholes, by itself, sufficient to evaluate a stock and make a decision on whether to purchase it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answer to the first, is yes.  The answer to the second, is basically no.  Black-Scholes generates the price of an option on a futures market, not a value of a stock on a regular stock market.  That being said, the futures market are intimately related to stock markets, and an option can be considered an &quot;if-then&quot; clause which defines the availability of a stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Black-Scholes is basically telling you how much it's going to cost to have an option to say yes-or-no to proceed with a purchase, at a certain day in the future, at today's price.  (It's a little like getting on a waiting list to purchase scalped tickets for a sold-out concert.) Whether or not you want to go ahead with the purchase has to be based on some other function.  But Black-Scholes can certainly be part of the process, if you want to be that sophisticated.&lt;/p&gt;&#xA;" OwnerUserId="700" LastActivityDate="2011-04-06T19:38:25.700" CommentCount="5" ContentLicense="CC BY-SA 2.5" />
  <row Id="933" PostTypeId="2" ParentId="929" CreationDate="2011-04-07T09:13:00.263" Score="1" Body="&lt;p&gt;I do not. But I do know how to parse these specific pdfs quite easily. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the open source pdftotext tool ( &lt;a href=&quot;http://en.wikipedia.org/wiki/Pdftotext&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Pdftotext&lt;/a&gt; ).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The table data in the output text file will always (testing the types of the values should ensure that everything is working as expected in case of changes) begin after the line ExDate and ends before DISCLAIMER, with a blank line occuring between each value &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(regular expression to grab text between ExData\n\n, \n\nDISCLAIMER, and you have a plain text double-newline delimited representation of the data).&lt;/p&gt;&#xA;" OwnerUserId="133" LastEditorUserId="133" LastEditDate="2011-04-07T09:25:13.290" LastActivityDate="2011-04-07T09:25:13.290" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="934" PostTypeId="1" CreationDate="2011-04-07T09:48:23.133" Score="37" ViewCount="9017" Body="&lt;p&gt;What types of neural networks are most appropriate for forecasting returns?  Can neural networks be the basis for a high-frequency trading strategy?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Types of neural networks include:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Radial Basis Function Networks&lt;/li&gt;&#xA;&lt;li&gt;Multilayer Perceptron (standard architecture)&lt;/li&gt;&#xA;&lt;li&gt;Convolutional Neural Networks&lt;/li&gt;&#xA;&lt;li&gt;Recurrent Neural Networks &lt;/li&gt;&#xA;&lt;li&gt;Q-learning Networks or Deep Reinforcement Learning&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What about advanced architectures such as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Convolutional&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;LeNet-5&lt;/li&gt;&#xA;&lt;li&gt;AlexNet&lt;/li&gt;&#xA;&lt;li&gt;Inception networks&lt;/li&gt;&#xA;&lt;li&gt;VGGNet&lt;/li&gt;&#xA;&lt;li&gt;ResNet&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Recurrent&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Bi-directional&lt;/li&gt;&#xA;&lt;li&gt;Attention Models&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="707" LastEditorUserId="19222" LastEditDate="2019-04-06T10:30:52.003" LastActivityDate="2019-04-06T10:30:52.003" Title="What types of neural networks are most appropriate for trading?" Tags="&lt;quant-trading-strategies&gt;&lt;forecasting&gt;&lt;high-frequency&gt;&lt;machine-learning&gt;" AnswerCount="4" CommentCount="6" FavoriteCount="41" ContentLicense="CC BY-SA 4.0" />
  <row Id="935" PostTypeId="2" ParentId="764" CreationDate="2011-04-07T15:12:28.020" Score="2" Body="&lt;p&gt;This is basically how one would use BlackScholes to &quot;purchase a stock&quot;...  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;double optionPrice = blackScholes(stock, strike, volatility, rate, time);&#xA;if (optionPurchased) {&#xA;    if (stockPrice &amp;lt; thresholdPrice){&#xA;      ExerciseOption(PurchaseStock());&#xA;    }&#xA;} &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that the purchase of the option would be on a futures exchange, not the regular stock market.  Also note the double if/then clauses.  First you have to purchase the option, then use it to evaluate whether you want to proceed with the purchase.  There are a couple different evaluation functions you could use to set the thresholdPrice.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://sourceforge.net/projects/chipricingmodel/&quot; rel=&quot;nofollow&quot;&gt;http://sourceforge.net/projects/chipricingmodel/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ps. for what it's worth, I used to work at the Booth School of Business in Chicago, as a tutor in the computing labs, helping MBA students do Black-Scholes pricing for assignments.&lt;/p&gt;&#xA;" OwnerUserId="700" LastEditorUserId="700" LastEditDate="2011-04-07T15:19:42.193" LastActivityDate="2011-04-07T15:19:42.193" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="936" PostTypeId="2" ParentId="181" CreationDate="2011-04-07T15:52:22.727" Score="3" Body="&lt;p&gt;Evolutionary economics provides a framework for reasoning about meta-models about markets.  The primary one being ecological.  Thus, predicting a model's half life would involve discussing market ecologies, niche specialization of a model, comparative fitness of models, and the like.     &lt;/p&gt;&#xA;" OwnerUserId="700" LastActivityDate="2011-04-07T15:52:22.727" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="937" PostTypeId="1" CreationDate="2011-04-07T16:13:22.437" Score="2" ViewCount="121" Body="&lt;p&gt;ok, so I can't post more than 1 link since I'm a noobie noob, and in the course of correcting this, Stack managed to delete my post. so here's the more abbreviated, slightly irritated author version…&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to calculate the fair market capitalization of the Metropolitan Transportation Authority of New York. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Facts:&#xA;According to their Wikipedia page, they have: a daily ridership of 11.5 million.&#xA;According to this NY Post article, the average fare price is USD 1.29.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Conclusions:&#xA;the MTA's daily revenue is is 14.8M, their annual revenue is USD 5.4B.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Layman's bad calculation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;comparing Nike's annual operating revenue (from wikipedia) of USD 2.5 billion  and  their market capitalization of USD 40 billion, we extrapolate the factor of 2.16 to determine the MTA's market cap of USD 86.4.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yes, this is wrong. Please show me how you would do it.&#xA;(is there a way to take into account that the MTA is a pseudo monopoly, and as such: 1) gets access to cheap loans if needed from the state, 2) isn't afraid of losing market share to private companies, and as such, is less under fire of losing revenue)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerDisplayName="user708" LastEditorUserId="16595" LastEditDate="2019-06-29T13:41:50.027" LastActivityDate="2019-06-29T13:41:50.027" Title="How to calculate the Metropolitan Transportation Authority of New York's market capitalization or fair market value?" Tags="&lt;market-capitalization&gt;" AnswerCount="0" CommentCount="3" ClosedDate="2011-04-07T17:36:55.693" ContentLicense="CC BY-SA 3.0" />
  <row Id="938" PostTypeId="2" ParentId="934" CreationDate="2011-04-07T16:20:18.433" Score="12" Body="&lt;p&gt;Depends on the data you are trying to model. If your data experience regime change then something with a sigmoid function (arctan, hTan, ...) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your data is mostly linear but does have some deviation use a radial bias.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These are general guidelines for neural networks. The frequency of the data is not relevant to the above statements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remember that any set of basis functions can be made to fit any set of data. The idea is to use functions that reveal some under lying truth about the data.&lt;/p&gt;&#xA;" OwnerDisplayName="user709" LastEditorUserId="15390" LastEditDate="2016-04-17T16:50:18.673" LastActivityDate="2016-04-17T16:50:18.673" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="939" PostTypeId="1" AcceptedAnswerId="941" CreationDate="2011-04-07T18:10:13.797" Score="10" ViewCount="853" Body="&lt;p&gt;Anyone can tell me what the first column and the last column in this FX tick dataset mean? The first seems like some kind of ID, and what D in the last column mean?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;368412956    AUD/CAD    12/30/2007 17:00:03.000    0.8598    0.8604    D&lt;/p&gt;&#xA;&#xA;&lt;p&gt;368413005    AUD/CAD    12/30/2007 17:00:58.000    0.8599    0.8605    D&lt;/p&gt;&#xA;&#xA;&lt;p&gt;368413022    AUD/CAD    12/30/2007 17:01:06.000    0.8600    0.8606    D&lt;/p&gt;&#xA;&#xA;&lt;p&gt;368413102    AUD/CAD    12/30/2007 17:01:37.000    0.8599    0.8605    D&lt;/p&gt;&#xA;&#xA;&lt;p&gt;368413110    AUD/CAD    12/30/2007 17:01:42.000    0.8601    0.8607    D&lt;/p&gt;&#xA;&#xA;&lt;p&gt;368413262    AUD/CAD    12/30/2007 17:03:55.000    0.8602    0.8608    D&lt;/p&gt;&#xA;" OwnerUserId="43" LastActivityDate="2011-04-08T01:50:14.033" Title="FX Tick Data question" Tags="&lt;data&gt;&lt;fx&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="940" PostTypeId="2" ParentId="939" CreationDate="2011-04-07T21:45:17.110" Score="5" Body="&lt;p&gt;Looking at the &lt;strong&gt;&lt;a href=&quot;http://ratedata.gaincapital.com/2011/03%20March/.%5CAUD_CAD_Week2.zip&quot; rel=&quot;nofollow&quot;&gt;original headers&lt;/a&gt;&lt;/strong&gt; for some recent data we have something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;lTid    cDealable   CurrencyPair    RateDateTime    RateBid RateAsk&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So &lt;code&gt;D&lt;/code&gt; would seem to be &quot;&lt;strong&gt;dealable&lt;/strong&gt;&quot;, but to be honest I couldn't find an example of a &lt;code&gt;non-D&lt;/code&gt; value in the files (I haven't looked thorougly though), so I don't really get it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The cryptic ID, is a &lt;strong&gt;tick identifier&lt;/strong&gt;, but no information is given as to how it is really constructed. I assume it should be automatically incremented on every incoming tick (across any currency).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that's true, then the actual data seems to be sorted by &lt;code&gt;date/time&lt;/code&gt; column (if you look at some recent files, some ticks occur with equal time and are out of order when comparing IDs). So you should verify it first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, I couldn't find anything better on this.&lt;/p&gt;&#xA;" OwnerUserId="38" LastActivityDate="2011-04-07T21:45:17.110" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="941" PostTypeId="2" ParentId="939" CreationDate="2011-04-08T00:57:29.967" Score="9" Body="&lt;p&gt;The first column is just a unique id tagged by Gain; this allows you to separate multiple messages that come in with the same timestamp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;D means &quot;dealable&quot;: this means that a trade could take place.  &lt;a href=&quot;http://forex-scam.com/general-trading-discussions-forex/26474-gain-error-11-pair-not-dealable.html&quot;&gt;According to this thread&lt;/a&gt;, Gain is known for not dealing around events like major news announcements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[Note: In EBS data, which is much more reliable, &quot;D&quot; means &quot;deal&quot; (or trade) while &quot;Q&quot; means &quot;quote&quot;.  This is an entirely different meaning from in the Gain data.]&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="17" LastEditDate="2011-04-08T01:50:14.033" LastActivityDate="2011-04-08T01:50:14.033" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="942" PostTypeId="1" AcceptedAnswerId="1087" CreationDate="2011-04-08T08:40:58.820" Score="29" ViewCount="17990" Body="&lt;p&gt;Yahoo Finance allows you to download tables of their daily historical stock price data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The data includes an adjusted closing price that I thought I might use to calculate daily log returns as a first step to other kinds of analyses.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To calculate the adj. close you need to know all the splits and dividends, and ex-div and ex-split dates.  If someone gets this wrong it should create some anomalous returns on the false vs. true ex dates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone seen any major problems in the adj. closing price data on Yahoo Finance?&lt;/p&gt;&#xA;" OwnerUserId="627" LastActivityDate="2014-11-01T23:27:34.953" Title="Any known bugs with Yahoo Finance adjusted close data ?" Tags="&lt;data&gt;&lt;equities&gt;&lt;adjustments&gt;&lt;yahoo&gt;" AnswerCount="9" CommentCount="4" FavoriteCount="18" ContentLicense="CC BY-SA 3.0" />
  <row Id="944" PostTypeId="2" ParentId="249" CreationDate="2011-04-08T12:39:47.600" Score="0" Body="&lt;p&gt;I trade VIX futures exclusively. My hedge is one VIX future pair vs. another future pair in a ratio. Thorough understanding of these and screen time are necessary IMO to earn.&lt;/p&gt;&#xA;" OwnerDisplayName="user712" LastEditorUserId="35" LastEditDate="2011-04-08T17:04:16.983" LastActivityDate="2011-04-08T17:04:16.983" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="945" PostTypeId="2" ParentId="942" CreationDate="2011-04-08T12:52:16.577" Score="5" Body="&lt;p&gt;I read your question as you planning to calculate the daily log return as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\log{\frac{adj.close(t)}{adj.close(t-1)}}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which I think might be problematic as the adjusted close does not necessarily represent a &quot;price&quot; that would have been traded at in the past. I think it would be better if you used the adjusted close to derive the actual close value and calculate returns thus:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\log{\frac{derived.actual.close(t)}{derived.actual.close(t-1)}}&#xA;\end{equation}&lt;/p&gt;&#xA;" OwnerUserId="252" LastEditorUserId="35" LastEditDate="2012-08-01T13:42:06.777" LastActivityDate="2012-08-01T13:42:06.777" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="946" PostTypeId="1" AcceptedAnswerId="1034" CreationDate="2011-04-08T13:32:36.977" Score="38" ViewCount="39875" Body="&lt;p&gt;As far as I understand, most investors are willing to buy options (puts and calls) in order to limit their exposure to the market in case it moves against them. This is due to the fact that they are long gamma.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Being short gamma would mean that the exposure to the underlying becomes more long as the underlying price drops and more short as the underlying price rises.  Thus exposure gets higher with a P&amp;amp;L downturn and lower with a P&amp;amp;L upturn.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence I wonder who is willing to be short gamma?  Is it a bet on a low volatility?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, for a market maker in the option market, writing (selling) an option means being short gamma, so if there is no counterparty willing to be short gamma, how are they going to hedge their gamma?&lt;/p&gt;&#xA;" OwnerUserId="553" LastEditorUserId="1106" LastEditDate="2011-09-11T21:57:48.740" LastActivityDate="2012-03-26T12:40:29.503" Title="What type of investor is willing to be short gamma?" Tags="&lt;options&gt;&lt;hedging&gt;&lt;portfolio-management&gt;&lt;greeks&gt;&lt;investing&gt;" AnswerCount="6" CommentCount="1" FavoriteCount="26" ContentLicense="CC BY-SA 3.0" />
  <row Id="947" PostTypeId="2" ParentId="946" CreationDate="2011-04-08T15:17:09.877" Score="3" Body="&lt;p&gt;I might be misunderstanding your question. My thoughts: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;being short gamma is being long volatility &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;your comment re gamma increasing regardless of direction only &#xA;holds for ATM options. For ITM options, being short gamma is being &#xA;long the underlying. For OTM options, being short gamma is being &#xA;short the underlying. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Some graphs: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Below, except as noted, the underlying is at 1, the interest rate &#xA;is 0%, and the expiration date is 1 year. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The gamma of an ATM call as its volatility varies from .05 to .15: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Plot[bsgamma[1,1,1,0,v],{v,.05,0.15}] &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/YxKRS.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The gamma of a .95 ITM call as the underlying varies from .95 to 1.05: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Plot[bsgamma[x,0.95,1,0,.10],{x,.9,1.1}] &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Ho7US.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The gamma of a 1.05 OTM call as the underlying varies from .95 to 1.05: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Plot[bsgamma[x,1.05,1,0,.10],{x,.9,1.1}] &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/39TAw.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user59" LastActivityDate="2011-04-08T15:17:09.877" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="948" PostTypeId="1" AcceptedAnswerId="949" CreationDate="2011-04-08T15:44:46.773" Score="80" ViewCount="35937" Body="&lt;p&gt;What would be the best approach to handle &lt;strong&gt;real-time intraday data storage&lt;/strong&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For personal research I've always imported from &lt;em&gt;flat files&lt;/em&gt; only into memory (&lt;em&gt;historical EOD&lt;/em&gt;), so I don't have much experience with this. I'm currently working on a side project, which would require daily stock quotes updated every minute from an external feed. For the time being, I suppose any popular database solution should handle it without sweating too much in this scenario. But I would like the adopted solution to &lt;strong&gt;scale easily when real-time ticks become necessary&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A &lt;strong&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/461/store-tick-data&quot;&gt;similar problem&lt;/a&gt;&lt;/strong&gt; has been mentioned by &lt;em&gt;Marko&lt;/em&gt;, though it was mostly specific to &lt;em&gt;R&lt;/em&gt;. I'm looking for a universal data storage accessible both for lightweight web front-ends (&lt;em&gt;PHP/Ruby/Flex&lt;/em&gt;) and analytical back-end (&lt;em&gt;C++&lt;/em&gt;, &lt;em&gt;R&lt;/em&gt; or &lt;em&gt;Python&lt;/em&gt;, don't know yet).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From what &lt;a href=&quot;https://quant.stackexchange.com/questions/461/store-tick-data/468#468&quot;&gt;&lt;em&gt;chrisaycock&lt;/em&gt; mentioned&lt;/a&gt; &lt;em&gt;column oriented databases&lt;/em&gt; should be the most viable solution. And it &lt;a href=&quot;http://www.wallstreetandtech.com/blog/archives/2008/03/columnbased_dat.html&quot; rel=&quot;noreferrer&quot;&gt;seems to be the case&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I'm not sure I understand all the intricacies of &lt;em&gt;column oriented storage&lt;/em&gt; in some exemplary usage scenarios:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Fetching all or subset of price data for a specific ticker for front-end charting&lt;/strong&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Compared to &lt;em&gt;row based&lt;/em&gt; solutions fetching price data should be faster because it's a &lt;em&gt;sequential&lt;/em&gt; read. But how does storing multiple tickers in one place influence this? For example a statement like &quot;select all timestamps and price data where ticker is equal to something&quot;. Don't I have to compare the ticker on every row I fetch? And in the situation where I have to provide complete data for some front-end application, wouldn't serving a raw flat file for the instrument requested be more efficient?&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Analytics performed in the back-end&lt;/strong&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Things like computing single values for a stock (e.g. variance, return for last x days) and dependent time-series (daily returns, technical indicators etc.). Fetching input data for computations should be more efficient as in the preceding case, but what about writing? The gain I see is bulk writing the final result (like value of computed indicator for every timestamp), but still I don't know how the database handles my mashup of different tickers in one table. Does horizontal partitioning/sharding handle it for me automatically or am I better splitting manually into table per instrument structure (which seems unnecessary cumbersome)?&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Updating the database with new incoming ticks&lt;/strong&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Using &lt;em&gt;row based&lt;/em&gt; orientation would be more efficient here, wouldn't it? And the same goes about updating aggregated data (for example daily OHLC tables). Won't it be a possible bottleneck?&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;All this is in the context of available open source solutions. I thought initially about &lt;a href=&quot;http://infinidb.org/&quot; rel=&quot;noreferrer&quot;&gt;&lt;em&gt;InfiniDB&lt;/em&gt;&lt;/a&gt; &lt;strike&gt;or &lt;a href=&quot;http://hbase.apache.org/&quot; rel=&quot;noreferrer&quot;&gt;&lt;em&gt;HBase&lt;/em&gt;&lt;/a&gt;&lt;/strike&gt;, but I've seen &lt;em&gt;MonetDB&lt;/em&gt; and &lt;em&gt;InfoBright&lt;/em&gt; being mentioned around here too. I don't really need &quot;production quality&quot; (at least not yet) as mentioned by &lt;em&gt;chrisaycock&lt;/em&gt; in the &lt;a href=&quot;https://quant.stackexchange.com/questions/461/store-tick-data/468#468&quot;&gt;referenced question&lt;/a&gt;, so would any of this be a better choice than the others?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And the last issue - from approximately which load point are specialized &lt;strong&gt;time-series databases&lt;/strong&gt; necessary? Unfortunately, things like &lt;a href=&quot;http://kx.com/kdb+.php&quot; rel=&quot;noreferrer&quot;&gt;&lt;em&gt;kdb+&lt;/em&gt;&lt;/a&gt; or &lt;a href=&quot;http://www.sungard.com/fame&quot; rel=&quot;noreferrer&quot;&gt;&lt;em&gt;FAME&lt;/em&gt;&lt;/a&gt; are out of scope in this case, so I'm contemplating how much can be done on commodity hardware with standard relational databases (&lt;em&gt;MySQL/PostgreSQL&lt;/em&gt;) or key-value stores (like &lt;a href=&quot;http://fallabs.com/tokyocabinet/&quot; rel=&quot;noreferrer&quot;&gt;&lt;em&gt;Tokyo&lt;/em&gt;&lt;/a&gt;/&lt;a href=&quot;http://fallabs.com/kyotocabinet/&quot; rel=&quot;noreferrer&quot;&gt;&lt;em&gt;Kyoto Cabinet&lt;/em&gt;&lt;/a&gt;'s B+ tree) - is it a dead end really? Should I just stick with some of the aforementioned &lt;em&gt;column oriented&lt;/em&gt; solutions owing to the fact that my application is not &lt;em&gt;mission critical&lt;/em&gt; or is even that an unnecessary precaution?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance for your input on this. If some part is too convoluted, let me know in a comment. I will try to amend accordingly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that strictly speaking &lt;em&gt;HBase&lt;/em&gt; is &lt;a href=&quot;http://dbmsmusings.blogspot.com/2010/03/distinguishing-two-major-types-of_29.html&quot; rel=&quot;noreferrer&quot;&gt;not a &lt;em&gt;column oriented&lt;/em&gt; store&lt;/a&gt; but rather a &lt;a href=&quot;http://jimbojw.com/wiki/index.php?title=Understanding_Hbase_and_BigTable&quot; rel=&quot;noreferrer&quot;&gt;sparse, distributed, persistent multidimensional sorted map&lt;/a&gt;, so I've crossed it out from the original question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After some research I'm mostly inclined towards &lt;em&gt;InfiniDB&lt;/em&gt;. It has all the features I need, supports &lt;em&gt;SQL&lt;/em&gt; (standard &lt;em&gt;MySQL&lt;/em&gt; connectors/wrappers can be used for access) and full &lt;em&gt;DML&lt;/em&gt; subset. The only thing missing in the open source edition is on the fly compression and scaling out to clusters. But I guess it's still a good bang for the buck, considering it's free.&lt;/p&gt;&#xA;" OwnerUserId="38" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-08-22T00:55:44.643" Title="Efficiently storing real-time intraday data in an application agnostic way" Tags="&lt;time-series&gt;&lt;software&gt;&lt;performance&gt;&lt;database&gt;&lt;column-oriented&gt;" AnswerCount="9" CommentCount="1" FavoriteCount="117" ContentLicense="CC BY-SA 3.0" />
  <row Id="949" PostTypeId="2" ParentId="948" CreationDate="2011-04-08T18:00:58.587" Score="51" Body="&lt;p&gt;Column-oriented storage is faster for &lt;em&gt;reading&lt;/em&gt; because of the cache efficiency. Looking at your sample query:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;select price, time from data where symbol = `AAPL&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here I'm concerned with three columns: &lt;code&gt;price&lt;/code&gt;, &lt;code&gt;time&lt;/code&gt;, and &lt;code&gt;symbol&lt;/code&gt;. If all ticks were stored by row, the database would have to read through &lt;strong&gt;all rows&lt;/strong&gt; just to search for the symbols. It would look like this on disk:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;IBM | 09:30:01 | 164.05; IBM | 09:30:02 | 164.02; AAPL | 09:30:02 | 336.85&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So the software must skip over the price and time entries just to read the symbols. That would cause a cache miss for every tick!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let's look at the column-oriented storage:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;IBM | IBM | AAPL; 09:30:01 | 09:30:02 | 09:30:02; 164.05 | 164.02 | 336.85&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here the database can sequentially scan the symbol list. This is cache efficient. Once the software has the array indices that represent the symbol locations of interest, the database can jump to the specific time and price entries via random access. (You may notice that the columns are actually associative arrays; the first element in each column refers to the first row in aggregate, so jumping to the &lt;em&gt;N&lt;/em&gt; th row means simply accessing the &lt;em&gt;N&lt;/em&gt; th element in each array.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can imagine, column-oriented storage really shines during analytics. To compute the moving average of the prices per symbol, the database will index-sort the symbol column to determine the proper ordering of the price entries, and then begin the calculation with the prices in contiguous (sequential) layout. Again, cache efficient.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Beyond the column-oriented layout, many of these really new databases also store everything &lt;strong&gt;in memory&lt;/strong&gt; when performing calculations. That is, if the data set is small enough, the software will read the entire tick history into memory, which will eliminate page faults when running queries. Thus, it will never access the disk!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A second optimization that kdb+ does is that it will automatically &lt;strong&gt;enumerate text&lt;/strong&gt;. (This feature is inspired by &lt;a href=&quot;http://en.wikipedia.org/wiki/Symbol_%28programming%29&quot;&gt;Lisp symbols&lt;/a&gt;). So searching for a particular stock does not involve typical string searching; it's simply an integer search after the initial enumeration look-up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the sequential storage, in-memory allocation, and the automatic text enumeration, searching for a symbol is really just scanning for an integer in an array. That's why a database like kdb+ is a few &lt;em&gt;orders of magnitude faster&lt;/em&gt; than common relational databases for reading and analytics.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;As you've pointed-out in your question, &lt;em&gt;writing&lt;/em&gt; is a weakness of column-oriented storage. Because each column is an array (in-memory) or file (on-disk), changing a single row means updating each array or file individually as opposed to simply streaming the entire row at once. Furthermore, appending data in-memory or on-disk is pretty straightforward, as is updating/inserting data in-memory, but &lt;em&gt;updating/inserting data on-disk is practically impossible&lt;/em&gt;. That is, the user can't change historical data without some massive hack.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For this reason, historical data (stored on-disk) is often considered &lt;em&gt;append-only&lt;/em&gt;. In practice, column-oriented databases &lt;em&gt;require the user to adopt a bitemporal or point-in-time schema&lt;/em&gt;. (I advise this schema for financial applications anyway for both better time-series analysis and proper compliance reporting.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I don't know enough about your application to determine performance or production-level requirements. I just hope the above guide will help you make an informed decision with regard to why column-oriented storage is often your best bet for analytics.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-04-08T18:00:58.587" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="950" PostTypeId="2" ParentId="948" CreationDate="2011-04-08T19:25:23.570" Score="30" Body="&lt;p&gt;I have long hungered for the ultimate, super-fast, super-scaleable data storage solution.  I have used relational databases, kdb, flatfiles, and binary files.  In the end, I used binary files in my research language of choice.  My advice is to KISS.  The choice of storage is actually not that critical (unless maybe you're working with options tick data).  What is critical is how you decide to splay the data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you look at kdb, it can actually be quite slow if you don't splay (segment) the data for your particular need.  It just gives you a fast management layer, but it is up to you to design the data storage on disk for your need.  What you are trying to do is store the data in such a way so that you group together the data that you need and minimize the amount of extra data that has to be read off disk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For me, I found storing data in binary format in the language that I do research in is the least amount of overhead.  Managing a simple splay is easy.  One key is don't be afraid to store multiple copies of your data for different research tasks, so long as the creation of the copies is driven off of one golden source.  So for example, if you very often need all ticks for one stock for the past 5 years, then I would splay by stock.  But if you also need all stocks for a given day, then I would store another dataset that splays by day.  Process and store the data in a way that will be most useful to you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are a big institution, then by all means spend the big $ to get kdb and hire a hotshot q programmer (b/c you are probably not going to figure it out on your own very easily).  It is quite nice.  But, if you are an individual, do the simple thing and move on to more interesting work.&lt;/p&gt;&#xA;" OwnerUserId="443" LastActivityDate="2011-04-08T19:25:23.570" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="951" PostTypeId="2" ParentId="948" CreationDate="2011-04-08T23:41:29.913" Score="16" Body="&lt;p&gt;Personally I make a distinction between two conflicting goals: (1) storing data incoming in real-time for immediate processing and (2) storing the gathered data for &quot;offline&quot; purposes. Such approach makes things a lot easier if we're talking about a home-grown solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) must be as fast as possible but not necessarily scalable beyond a few dozen millions of ticks (remember we're still talking about a home-grow solution and not about a full-blown system for an investment bank).&#xA;(2) mustn't be slow and must scale well to hold billions of ticks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The simplest and fastest solution for (1) are arrays kept in memory. At the end of trading day you'll just put them all into (2). They have one drawback: in case of crash your data is lost. If that worries you then you have to replace them (or back them) with a DB. Any non-toy DB will easily accommodate a few millions of records.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) is more demanding - you can't just put billions of ticks into a DB straight away. And even if you do then retrieval performance will be abysmal. You need to split your data in a way that serves best for your purposes - there is no universal silver bullet here and what works for others may not work so well for you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally I store data gathered from my real-time feed in RAM. Actually I store them only for drawing purposes. For real deal I put them in my CEP subsystem. After the session is over I download all the ticks via my brokerage account and put them in (2).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my solution historical tick data is stored in a database. I use it solely as a storage engine as I hit a filesystem's (NTFS in this case) limits after saving approx. 20 millions of files. My DB has one big table that holds all the data as BLOBs. Each BLOB corresponds to quotations of a single security for a given day. Of course this approach has its drawback but there are two important advantages: it was easy to develop and it's able to accommodate huge amounts of data without any performance drop.&lt;/p&gt;&#xA;" OwnerUserId="493" LastActivityDate="2011-04-08T23:41:29.913" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="952" PostTypeId="1" AcceptedAnswerId="953" CreationDate="2011-04-09T16:16:51.000" Score="7" ViewCount="419" Body="&lt;p&gt;Attempting to get a high level understanding of the role that quantitative finance plays in the financial global markets. Open to any suggestion on how to do this, but figure a starting point might be to estimate the percents of earnings and losses globally on an annual basis attributed to quantitative finance.&lt;/p&gt;&#xA;" OwnerUserId="719" LastEditorUserId="719" LastEditDate="2011-04-09T18:22:14.213" LastActivityDate="2011-04-18T05:12:20.773" Title="What is the effect of quant finance on global markets?" Tags="&lt;market-impact&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="953" PostTypeId="2" ParentId="952" CreationDate="2011-04-09T16:50:28.563" Score="7" Body="&lt;p&gt;This answers a slightly larger question than you're asking, but I highly recommend &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0262134608&quot;&gt;&quot;An Engine, Not a Camera: How Financial Models Shape Markets&quot;&lt;/a&gt; by Donald MacKenzie, which is part of the burgeoning field of &quot;Social Studies of Finance&quot;.  Some relevant links:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://socfinance.wordpress.com/&quot;&gt;http://socfinance.wordpress.com/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.sociology.ed.ac.uk/finance/&quot;&gt;http://www.sociology.ed.ac.uk/finance/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Regarding your specific question: you would need to start by &lt;em&gt;defining&lt;/em&gt; &quot;quantitative finance&quot; in this context.  Does it include any derivative trading (for instance)?  What about index funds (they were based on the insights from CAPM, after all)?  Or do you just want to limit it to things like quantitative hedge funds?&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="69" LastEditDate="2011-04-09T18:27:52.217" LastActivityDate="2011-04-09T18:27:52.217" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="954" PostTypeId="2" ParentId="115" CreationDate="2011-04-10T03:59:59.393" Score="3" Body="&lt;p&gt;Fat tailed distributions have extreme values that follow a Frechet distribution. Try calculating VAR using method outlined in Tsay's Analysis of Financial Time Series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are trying to determine a good distribution for stock price in a non academic setting use hyperbolic-secant. It is a wrong answer but it is much easier to fit then a Levy and it gives better answers then normal. Hyperbolic-Secant is bell shaped so many time series techniques &quot;plug&quot; right in.&lt;/p&gt;&#xA;" OwnerDisplayName="user709" LastActivityDate="2011-04-10T03:59:59.393" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="955" PostTypeId="1" AcceptedAnswerId="958" CreationDate="2011-04-10T09:36:31.907" Score="29" ViewCount="4641" Body="&lt;p&gt;Fund managers are acting in a highly stochastic environment. What methods do you know to systematically separate skillful fund managers from those that were just lucky?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Every idea, reference, paper is welcome! Thank you!&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="35" LastEditDate="2012-02-12T08:01:09.940" LastActivityDate="2013-07-25T09:29:34.230" Title="Separating the wheat from the chaff: What quant methods separate skillful managers from lucky ones?" Tags="&lt;performance-evaluation&gt;" AnswerCount="11" CommentCount="0" FavoriteCount="31" ContentLicense="CC BY-SA 3.0" />
  <row Id="956" PostTypeId="2" ParentId="955" CreationDate="2011-04-10T17:03:11.583" Score="4" Body="&lt;p&gt;I was going to suggest that you use alpha, which is the measure of a managers excess return beyond their benchmark.  But here is an alternative view which is quite interesting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://money.usnews.com/money/blogs/Fund-Observer/2010/06/24/just-how-lucky-is-your-mutual-fund-manager&quot; rel=&quot;nofollow&quot;&gt;http://money.usnews.com/money/blogs/Fund-Observer/2010/06/24/just-how-lucky-is-your-mutual-fund-manager&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="520" LastActivityDate="2011-04-10T17:03:11.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="957" PostTypeId="2" ParentId="955" CreationDate="2011-04-10T17:36:15.507" Score="11" Body="&lt;p&gt;Some links:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.scribd.com/doc/34567320/Untangling-Skill-and-Luck&quot; rel=&quot;noreferrer&quot;&gt;http://www.scribd.com/doc/34567320/Untangling-Skill-and-Luck&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://web.ist.utl.pt/adriano.simoes/tese/referencias/Papers%20-%20Pedro/UK%20mutual%20fund%20performance%20Skill%20or%20luck.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://web.ist.utl.pt/adriano.simoes/tese/referencias/Papers%20-%20Pedro/UK%20mutual%20fund%20performance%20Skill%20or%20luck.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is some code that I used recently to illustrate luck (and con-games).  The story went like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll dream up your lucky lottery number for 2010.....let's say it's 20639.   The number doesn't matter because we're going to use that for the seed of a random number generator.   Then, I'll take the first three digits of your lucky lottery number (206) and reverse them (-.602) and use that as a multiplier on that random number.  Since the S&amp;amp;P500 started off in 2010 at about 1100, I'll start the model at that level.  Here is the code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; library(quantmod)&#xA;&#xA; #Read 2010 S&amp;amp;P500 data from Yahoo&#xA; tem &amp;lt;- as.zoo(getSymbols(&quot;^gspc&quot;, from=&quot;2010-01-01&quot;, to=&quot;2011-01-01&quot;, auto.assign=FALSE, src = &quot;yahoo&quot;))&#xA;&#xA; #Build a lucky lottery model based on the seed&#xA; set.seed(20639) #Your lucky lottery number&#xA; yt &amp;lt;- tem$GSPC.Adjusted&#xA; coredata(yt) &amp;lt;- 1100 * exp(-0.602 * cumsum(rnorm(length(yt), sd=0.0113)))&#xA;&#xA; #Plot the results&#xA; plot(tem$GSPC.Adjusted, type=&quot;l&quot;, main=&quot;S&amp;amp;P500 for Year 2010&quot;, ylab=&quot;S&amp;amp;P500&quot;, xlab=&quot;&quot;, lwd=3, col=&quot;darkgray&quot;)&#xA; lines(yt, lwd=2, col=&quot;red&quot;) &#xA; legend(&quot;bottomright&quot;, legend=c(&quot;Actual S&amp;amp;P500&quot;, &quot;Dredged S&amp;amp;P500&quot;), lwd=c(3, 2), col=c(&quot;darkgray&quot;, &quot;red&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/YhqTw.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is all meaningless BS, but it took a while for some people to untangle luck from the con.   The really hard part is to convince yourself that your &quot;skill&quot; actually found something real.   Something &quot;real&quot; is a very rare event in the world of investing.&lt;/p&gt;&#xA;" OwnerUserId="392" LastEditorUserId="392" LastEditDate="2011-04-10T17:42:46.080" LastActivityDate="2011-04-10T17:42:46.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="958" PostTypeId="2" ParentId="955" CreationDate="2011-04-10T20:07:44.723" Score="29" Body="&lt;p&gt;Larry Harris has a chapter on performance evaluation in &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0195144708&quot;&gt;Trading and Exchanges&lt;/a&gt;. He states that over a long period of time, a skilled asset manager will consistently have excess returns whereas a lucky one will be expected to have random and unpredictable returns. Thus, we start with the portfolio's market-adjusted return standard deviation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\sigma_{adj} = \sqrt{\sigma^2_{port} + \sigma^2_{mk} - 2\rho\sigma_{port}\sigma_{mk}}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\rho$ is the correlation between the market and portfolio returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a sample size $n$ (generally number of years), the average excess returns, and the adjusted standard deviation from above, we have a &lt;a href=&quot;http://en.wikipedia.org/wiki/Student%27s_t-test&quot;&gt;t-statistic&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;t = \frac{\overline{R_{port}} - \overline{R_{mk}}}{\frac{\sigma_{adj}}{\sqrt{n}}}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we can simply determine the probability that the manager's excess returns were luck by plugging this t-statistic into the &lt;a href=&quot;http://en.wikipedia.org/wiki/Student%27s_t-distribution&quot;&gt;t-distribution&lt;/a&gt;'s PDF with degrees-of-freedom $n - 1$. The lower the probability, the more we can believe the manager's excess returns were from skill.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-04-10T20:07:44.723" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="959" PostTypeId="1" CreationDate="2011-04-10T22:55:04.710" Score="28" ViewCount="6050" Body="&lt;p&gt;I am currently working in a firm that does algo trading. We do all of our stuff in Java. And we do make money out of it. We have debates all the time whether we would have made more money with native or VHDL on network cards.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We don't do super high-frequency though we do more complicated trades. Even though we need to be the first. After working there for quite a while it interests me more to know if Java is popular in this area. (And since no one would talk in that field I would like to raise this issue here.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From my experience I have noticed that it has a lot to do with the reliability of the exchange or the broker.  If it is not very reliable (as in many exchanges in the world) a delay of 2 milisec would be much more significant than the language you choose. But still, how many do choose managed code?&lt;/p&gt;&#xA;" OwnerUserId="722" LastEditorUserId="35" LastEditDate="2011-04-10T23:16:51.010" LastActivityDate="2014-11-18T19:19:18.150" Title="How good is managed code for algo trading?" Tags="&lt;programming&gt;&lt;algorithm&gt;" AnswerCount="9" CommentCount="0" FavoriteCount="20" ContentLicense="CC BY-SA 3.0" />
  <row Id="960" PostTypeId="2" ParentId="959" CreationDate="2011-04-10T23:23:37.617" Score="17" Body="&lt;p&gt;There are &lt;a href=&quot;https://quant.stackexchange.com/q/306/35&quot;&gt;tons of languages used in this field&lt;/a&gt;. As for Java-based trading platforms, &lt;a href=&quot;http://www.marketcetera.com/site/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Marketcetera&lt;/a&gt; is popular with customers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To justify switching languages, you'd need to show that there is a bottleneck preventing your team from collecting more P&amp;amp;L. Have you run a profiler and compared the results with tcpdump? You must show that your existing platform is the cause of the delay that loses opportunities before diving into C++.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(And if we are talking milliseconds, I assume  you're co-located at the exchanges in question, if they allow it. If you aren't co-lo, then dealing with that would probably have more impact than changing languages.)&lt;/p&gt;&#xA;" OwnerUserId="35" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2011-04-10T23:23:37.617" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="961" PostTypeId="2" ParentId="959" CreationDate="2011-04-11T07:04:13.470" Score="7" Body="&lt;p&gt;I know (by word of mouth from persons directly involved, so cannot back it up with a reference) that Goldman Sachs uses Java a lot in algo trading.&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2011-04-11T07:04:13.470" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="962" PostTypeId="1" AcceptedAnswerId="975" CreationDate="2011-04-11T15:03:54.503" Score="10" ViewCount="460" Body="&lt;p&gt;I'm trying to understand what caused certain price movements (aren't we all!) in per-minute data for major NYSE stocks. In particular, I'd like to determine whether a given price movement of &lt;em&gt;X&lt;/em&gt;% in either direction was due to a single entity making a large trade (maybe their order-splitting algorithms leave traces, or maybe they skipped that and had to buy/sell in a hurry) versus an aggregation of many small orders. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the best way to approach this analysis?&lt;/p&gt;&#xA;" OwnerUserId="80" LastEditorUserId="467" LastEditDate="2011-04-14T07:03:26.483" LastActivityDate="2011-04-14T07:03:26.483" Title="How to determine if one player moved a price" Tags="&lt;analysis&gt;&lt;equities&gt;&lt;trading-patterns&gt;&lt;order-execution&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="963" PostTypeId="2" ParentId="959" CreationDate="2011-04-11T16:12:30.073" Score="13" Body="&lt;p&gt;Oracle hosted a Trading Applications Developer Workshop in New York on March 15th, 2011. The slides from each of the presentations are &lt;a href=&quot;http://www.oracleevent.com/16832/#ny_tab&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;. One of them covers java for Trading Applications, and it seemed to me that the biggest issue raised by the audience was garbage collection. The presentation talks about some configuration parameters that can limit garbage collection delays, but only down to the millisecond, while most of the audience was looking for microseconds.&lt;/p&gt;&#xA;" OwnerUserId="4" LastActivityDate="2011-04-11T16:12:30.073" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="964" PostTypeId="1" CreationDate="2011-04-11T19:55:37.480" Score="2" ViewCount="153" Body="&lt;p&gt;I am taking a degree in macro economics, and am at a juncture where knowledge about the Keynesian Multiplier is imperative. Though I've been at the lectures, read the literature and scoured the web, I am still somewhat confused about exactly how to define the model for this multiplier. At present, I would say that the following sums up the model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;The keynesian multiplier effect shows how a small positive exogenous change in GDP substantially affects the total amount of GDP in a positive direction. For example, a increase in investment in infrastructure will always yield a higher GDP.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, that certainly is not a definition of the model, but more a working explanation of it (and a short one at that). What worries me, however, is the following questions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Will, in fact, the small change in GDP (in regards to the example above) always yield a &lt;strong&gt;higher&lt;/strong&gt; amount of total GDP?&lt;/li&gt;&#xA;&lt;li&gt;Is the multiplier only relevant to fiscal and monetary amounts, such as GDP?&lt;/li&gt;&#xA;&lt;li&gt;What role does &lt;em&gt;marginal consumption/saving propensity&lt;/em&gt; play in all this?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So basically, I am hoping for a closer and more precise explanation of the keynesian multiplier, as I've had little luck so far.&lt;/p&gt;&#xA;" OwnerUserId="725" LastActivityDate="2011-04-11T19:55:37.480" Title="Keynesian Multiplier" Tags="&lt;finance&gt;" AnswerCount="0" CommentCount="2" ClosedDate="2011-04-11T20:34:56.820" ContentLicense="CC BY-SA 3.0" />
  <row Id="965" PostTypeId="1" AcceptedAnswerId="1000" CreationDate="2011-04-11T23:44:46.540" Score="8" ViewCount="1803" Body="&lt;p&gt;Suppose you have a trading system that is never flat, but either long or short the market. You have four years of performance. During that period, your system changed its position 10 times. So you have 10 trades from which to calculate expected return. Assume you always traded the same lot size. In a transaction-based analysis, you would compute your expected return based on the average win amount, average loss amount, percentage of trades that were winners and percentage of trades that were losers. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume the system had 5 winning trades and 5 losing trades. The average win was 100 dollars and the average loss was 50 dollars. You don't need the expected return formula to figure out if there is a positive expectation to this system. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Expected Return = (ave win * win percent) - (ave loss * lose percent)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Plug in our values we find:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Expected Return = (100 * .5) - (50 * .5) = 25 (dollars)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Alright, wonderful. Too bad we only have 10 trades though. Curiously, if you watch daily returns versus trade returns, you have 1008 observations (252*4). Does returns-based analysis calculate average positive daily returns, average negative daily returns and win/loss percentages in a manner similar to the transaction-based analysis? The &lt;code&gt;Expected Return&lt;/code&gt; would not be a dollar value obviously, but a daily return value. So instead of 25 dollars, you'd get 0.0023423 for example. (NOTE:  0.0023423 is a completely made-up number in this example)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To the question of what frequency we calculate returns. Let's assume the trade system decides what position to be in tomorrow based on a signal given at the end of the current trading day. So our system calculates its signal daily, ergo we rationally only consider daily returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT #2: Our system generates a signal every day, but in our example that signal has only changed 10 times during the course of 4 years. The signal can be either a 1 (long) or -1 (short). If we were previously short (-1) and the signal triggered a change to long (1), we would switch our short position to a long position. If the next day the signal triggered long, we would maintain our current position.&lt;/p&gt;&#xA;" OwnerUserId="291" LastEditorUserId="291" LastEditDate="2011-04-12T16:09:00.163" LastActivityDate="2011-04-21T20:36:48.140" Title="How does return-based analysis calculate expected return of a trading system?" Tags="&lt;analysis&gt;&lt;expected-return&gt;" AnswerCount="2" CommentCount="8" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="966" PostTypeId="2" ParentId="839" CreationDate="2011-04-12T07:09:19.220" Score="3" Body="&lt;p&gt;You can also enter/exit at the opening of the next bar after the trading signal is generated by the backtester. In this case hourly bars may be more appropriate for day trading.&lt;/p&gt;&#xA;" OwnerUserId="42" LastActivityDate="2011-04-12T07:09:19.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="967" PostTypeId="2" ParentId="962" CreationDate="2011-04-12T07:11:22.570" Score="4" Body="&lt;p&gt;If you look at the ladder, you might have some insight, but it's mainly speculation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only way to be really &quot;sure&quot; in my opinion would be to have some insight from a broker.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise, what I'd try to look for is to recognize execution schemes, but again you have to know the algorithms of all the participants in order to determine &quot;who&quot; it was.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my opinion, even &quot;fat fingers&quot; are difficult to detect, because I think the algos are reacting to the move in the market (probably using some kind of momentum) and kicking in as well.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2011-04-12T07:11:22.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="968" PostTypeId="2" ParentId="920" CreationDate="2011-04-12T08:38:38.270" Score="0" Body="&lt;p&gt;This is just a no-arbitrage argument: whatever you paid for the 100 USD plus the corresponding interest rate.&lt;/p&gt;&#xA;" OwnerUserId="668" LastActivityDate="2011-04-12T08:38:38.270" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="969" PostTypeId="2" ParentId="934" CreationDate="2011-04-12T11:55:19.063" Score="20" Body="&lt;p&gt;I would say in the context of trading in general (for HFT see my comment above) further developments of &lt;a href=&quot;http://en.wikipedia.org/wiki/Recurrent_neural_network&quot;&gt;recurrent neural networks&lt;/a&gt; (RNN), e.g. so called historical consistent neural networks (HCNN) together with forecasting ensembles, are state of the art. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I published an article on that which will be published this month by Springer Verlag (Zimmermann, Grothmann, Tietz, von Jouanne-Diedrich: &lt;em&gt;&lt;a href=&quot;http://books.google.de/books?id=NF7U-81MqkQC&amp;amp;lpg=PA531&amp;amp;dq=%22Historical%20Consistent%20Neural%20Networks%22%20Jouanne-Diedrich&amp;amp;hl=en&amp;amp;pg=PA531#v=onepage&amp;amp;q&amp;amp;f=false&quot;&gt;Market Modeling, Forecasting and Risk Analysis with Historical Consistent Neural Networks&lt;/a&gt;&lt;/em&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just to give you an idea about the new paradigm here is a short excerpt:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In this article, we present a new type&#xA;  of recurrent NN, called historical&#xA;  consistent neural network (HCNN).&#xA;  HCNNs allow the modeling of&#xA;  highly-interacting non-linear&#xA;  dynamical systems across multiple time&#xA;  scales. HCNNs do not draw any&#xA;  distinction between inputs and&#xA;  outputs, but model observables&#xA;  embedded in the dynamics of a large&#xA;  state space.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;[...]&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The RNN is used to model and forecast&#xA;  an open dynamic system using a&#xA;  non-linear regression approach. Many&#xA;  real-world technical and economic&#xA;  applications must however be seen in&#xA;  the context of large systems in which&#xA;  various (non-linear) dynamics interact&#xA;  with each other in time. Projected on&#xA;  a model, this means that we do not&#xA;  differentiate between inputs and&#xA;  outputs but speak about observables.&#xA;  Due to the partial observability of&#xA;  large systems, we need hidden states&#xA;  to be able to explain the dynamics of&#xA;  the observables. Observables and&#xA;  hidden variables should be treated by&#xA;  the model in the same manner. The term&#xA;  observables embraces the input and&#xA;  output variables (i. e. Yτ := (yτ , uτ&#xA;  )). If we are able to implement a&#xA;  model in which the dynamics of all of&#xA;  the observables can be described, we&#xA;  will be in a position to close the&#xA;  open system.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;...and from the conclusion:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The joint modeling of hidden and&#xA;  observed variables in large recurrent&#xA;  neural networks provides new prospects&#xA;  for planning and risk management. The&#xA;  ensemble approach based on HCNN offers&#xA;  an alternative approach to forecasting&#xA;  of future probability distributions.&#xA;  HCNNs give a perfect description of&#xA;  the dynamic of the observables in the&#xA;  past. However, the partial&#xA;  observability of the world results in&#xA;  a non-unique reconstruction of the&#xA;  hidden variables and thus, different&#xA;  future scenarios. Since the genuine&#xA;  development of the dynamic is unknown&#xA;  and all paths have the same&#xA;  probability, the average of the&#xA;  ensemble may be regarded as the best&#xA;  forecast, whereas the bandwidth of the&#xA;  distribution describes the market&#xA;  risk. Today, we use HCNN forecasts to&#xA;  predict prices for energy and precious&#xA;  metals to optimize the timing of&#xA;  procurement decisions. Work currently&#xA;  in progress concerns the analysis of&#xA;  the properties of the ensemble and the&#xA;  implementation of these concepts in&#xA;  practical risk management and ﬁnancial&#xA;  market applications.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;br&gt;&#xA;Parts of the paper can now be viewed publicly: &lt;a href=&quot;http://books.google.de/books?id=NF7U-81MqkQC&amp;amp;lpg=PA531&amp;amp;dq=%22Historical%20Consistent%20Neural%20Networks%22%20Jouanne-Diedrich&amp;amp;hl=en&amp;amp;pg=PA531#v=onepage&amp;amp;q&amp;amp;f=false&quot;&gt;Here&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2011-07-22T15:05:27.370" LastActivityDate="2011-07-22T15:05:27.370" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="970" PostTypeId="1" AcceptedAnswerId="974" CreationDate="2011-04-13T10:58:52.800" Score="2" ViewCount="4213" Body="&lt;p&gt;&lt;br&gt;&#xA;I need to display in my system the amount of stocks that I own and the average price it took me to buy them. I am having a problem doing that when I include the selling. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets say I bought 4 stocks in 100 usd each.&lt;br&gt;&#xA;and I sold 2 stocks for 110 usd each.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now my position is 2 stocks for what average price ?&lt;br&gt;&#xA;Option A: (4 * 110 + 2 * 100)/6 = 106.667&lt;br&gt;&#xA;or&lt;br&gt;&#xA;Option B: (4 * 110 - 2 * 100)/2 = 120 (doesnt think so )  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I do go with option A then if I sold 2 more for 110 &#xA;I would get 0 amount but average (4*100+2*110+2*110)/8 - 105 .&#xA;0 stocks for 105 doesnt make any sense. &#xA;thanks.&lt;/p&gt;&#xA;" OwnerUserId="722" LastEditorUserId="722" LastEditDate="2011-04-13T11:14:06.213" LastActivityDate="2012-08-30T19:38:04.427" Title="How do I calculate weighted mean with negative weights?" Tags="&lt;equities&gt;" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="971" PostTypeId="1" CreationDate="2011-04-13T12:13:26.127" Score="7" ViewCount="671" Body="&lt;p&gt;I'm studying for an exam in financial models and came across this question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;An agent with $C^2$ strictly increasing concave utility $U$ has wealth $w_0$ at time 0, and wishes to invest his wealth in shares and bonds so as to maximise his expected utility of wealth at time 1. Explain how the solution to his optimization problem generates an equivalent martingale measure.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Fundamental Theorem of Asset Pricing states that (roughly) there is no arbitrage iff there's an measure $Q$ such that the discounted stock price process becomes a martingale. So , in our (ideal) market, we have such a measure Q. So I think the question is asking how this measure arises in the solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you - I've been confused about this for a while...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Please don't knock this question for being unrealistic. As I said, I'm revising for an exam!)&lt;/p&gt;&#xA;" OwnerUserId="118" LastEditorUserId="118" LastEditDate="2011-04-13T13:08:22.007" LastActivityDate="2011-04-17T19:36:42.283" Title="How do equivalent martingale measures arise in pricing?" Tags="&lt;pricing-formulae&gt;&lt;martingale&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="972" PostTypeId="1" CreationDate="2011-04-13T13:36:19.097" Score="11" ViewCount="3873" Body="&lt;p&gt;I'm working with C# and I start being bored writing optimization algorithm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you know any free library containing this sort of algorithms?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular I'm currently working with Semidefit program. &lt;/p&gt;&#xA;" OwnerUserId="155" LastEditorUserId="467" LastEditDate="2015-11-05T08:53:37.720" LastActivityDate="2015-11-05T08:53:37.720" Title="What .NET library can I use to solve optimization problems?" Tags="&lt;optimization&gt;&lt;programming&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="973" PostTypeId="2" ParentId="972" CreationDate="2011-04-13T14:31:53.540" Score="10" Body="&lt;p&gt;I haven't had the time to try them personally, but if I were you I'd try &lt;a href=&quot;http://www.solverfoundation.com/&quot;&gt;The Solver Foundation&lt;/a&gt; or maybe you can find something useful within &lt;a href=&quot;http://www.mathdotnet.com/About.aspx&quot;&gt;these libraries&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I did was to compile a MATLAB algorithm and used the produced DLL.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; I read yesterday in the Wilmott Magazine that the &lt;a href=&quot;http://www.nag.co.uk/netdevelopers.asp&quot;&gt;NAG Library&lt;/a&gt; is also available for .Net now. Again, I haven't used it and I don't know if you're looking for something open-source, but apparently this one is good.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2011-04-14T06:25:09.623" LastActivityDate="2011-04-14T06:25:09.623" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="974" PostTypeId="2" ParentId="970" CreationDate="2011-04-13T20:09:34.203" Score="3" Body="&lt;p&gt;I think there are two ways: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) distinguish sells and purchases and calculate average for each of them; it will be $100$ and $110$ for sells.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) calculate not &lt;em&gt;average price which took you to buy...&lt;/em&gt; but &lt;em&gt;average trading price&lt;/em&gt;. Then it will be $106.67$.&lt;/p&gt;&#xA;" OwnerUserId="464" LastActivityDate="2011-04-13T20:09:34.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="975" PostTypeId="2" ParentId="962" CreationDate="2011-04-13T20:54:32.940" Score="3" Body="&lt;p&gt;This could be very difficult to determine in practice, because the axe (who controls the supply and demand) wants to hide his tracks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also consider the axe's aliases. I mention this because you would need to take into account the axe disguising his trades through another market maker (for example, Goldman trading through ARCA, or even showing sales between himself and his conferderate). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it is the player's task to accumulate or distribute a lot of stock, his job will be to do so with as small a change in stock price as is possible. He may achieve this through a number of different methods, including head fakes (selling a small quantity when his direction is to accumulate), patience (accumulating over several days or weeks) or refreshing his bid size.&lt;/p&gt;&#xA;" OwnerUserId="343" LastActivityDate="2011-04-13T20:54:32.940" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="976" PostTypeId="2" ParentId="972" CreationDate="2011-04-13T20:59:57.377" Score="6" Body="&lt;p&gt;You can also have a look at &lt;a href=&quot;http://www.alglib.net/optimization/&quot;&gt;&lt;strong&gt;ALGLIB&lt;/strong&gt;&lt;/a&gt; or &lt;a href=&quot;http://www.dotnumerics.com/NumericalLibraries/Optimization/Default.aspx&quot;&gt;&lt;strong&gt;DotNumerics&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would help though if you clarified what kind of optimization problem you have or what kind of algorithm you look for. And if by &lt;strong&gt;free&lt;/strong&gt; you mean &lt;strong&gt;&lt;em&gt;GPL&lt;/em&gt;&lt;/strong&gt; or something more like &lt;strong&gt;&lt;em&gt;MIT&lt;/em&gt;&lt;/strong&gt;?&lt;/p&gt;&#xA;" OwnerUserId="38" LastActivityDate="2011-04-13T20:59:57.377" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="977" PostTypeId="2" ParentId="972" CreationDate="2011-04-14T00:11:54.183" Score="8" Body="&lt;p&gt;You can use &lt;a href=&quot;https://projects.coin-or.org/Clp&quot;&gt;https://projects.coin-or.org/Clp&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other options:&lt;br&gt;&#xA;&lt;a href=&quot;http://sourceforge.net/projects/lpsolve/&quot;&gt;http://sourceforge.net/projects/lpsolve/&lt;/a&gt;&lt;br&gt;&#xA;and in R&lt;br&gt;&#xA;&lt;a href=&quot;http://cran.r-project.org/web/packages/lpSolve/index.html&quot;&gt;http://cran.r-project.org/web/packages/lpSolve/index.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They all solve pure linear, integer and mixed problems&lt;/p&gt;&#xA;" OwnerUserId="134" LastEditorUserId="134" LastEditDate="2011-04-15T03:22:05.147" LastActivityDate="2011-04-15T03:22:05.147" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="978" PostTypeId="1" AcceptedAnswerId="979" CreationDate="2011-04-14T13:39:42.133" Score="18" ViewCount="6975" Body="&lt;p&gt;As you know, the &lt;em&gt;key equation&lt;/em&gt; of risk neutral pricing is the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\exp^{-rt} S_t = E_Q[\exp^{-rT} S_T | \mathcal{F}_t]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, discounted prices are Q-martingales.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It makes real-sense for me from an economic point of view, but is there any &quot;proof&quot; of that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure my question makes real sense, and an answer could be &quot;there is no need to prove anything, we create the RN measure such that this property holds&quot;...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this sufficient to prove that, within this model, the risk-neutral measure exists?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some answers might have been misled by my notation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a new one:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\exp^{-rt} X_t = E_Q[\exp^{-rT} X_T | \mathcal{F}_t]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $X_t$ can be any financial asset. For example, a binary option on an underlying stock $S$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to price the option, you would start with this equation and develop the right-hand side to finally solve for $X_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My key question:&lt;/strong&gt; what allows me to write the initial equation assuming I have &lt;em&gt;no information&lt;/em&gt; about the dynamics of the option or its underlying.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2016-11-08T04:12:57.433" LastActivityDate="2016-11-08T04:12:57.433" Title="Formal proof for risk-neutral pricing formula" Tags="&lt;option-pricing&gt;&lt;pricing-formulae&gt;&lt;risk-neutral-measure&gt;" AnswerCount="7" CommentCount="2" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="979" PostTypeId="2" ParentId="978" CreationDate="2011-04-14T19:05:05.630" Score="9" Body="&lt;p&gt;Note first that this key equation is only assumed to hold true under some extra assumptions.  Typically those assumptions are taken to be about absence of arbitrage, though it is possible to weaken them somewhat if you are willing to consider portfolio arguments or collectively agreeable objective function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, the argument is this: &lt;em&gt;if all the risk can be arbitraged away, then the price of any contingent claim should be equal to its price under the risk-neutral measure Q&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;em&gt;mathematical&lt;/em&gt; proof can be grasped most easily by the old-school arguments where one shows delta-hedges eliminating stochastic terms from the SDE.  More mathematically elegant arguments involving the Girsanov theorem and Feynman-Kac formula are less intuitive.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-04-14T19:05:05.630" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="980" PostTypeId="2" ParentId="972" CreationDate="2011-04-14T20:21:34.800" Score="4" Body="&lt;p&gt;The &lt;a href=&quot;http://www.gnu.org/software/gsl/&quot; rel=&quot;nofollow&quot;&gt;GNU Scientific Library&lt;/a&gt; or GSL contains a few different varieties of optimizer.  They work pretty well and have a relatively good interface.  Their derivative-aware routines are a bit lacking in bounded optimization features compared to NAG, though.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-04-14T20:21:34.800" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="981" PostTypeId="1" AcceptedAnswerId="982" CreationDate="2011-04-14T20:28:52.313" Score="11" ViewCount="2221" Body="&lt;p&gt;How should one correctly &lt;strong&gt;forward adjust&lt;/strong&gt; historical prices given a time series of Open, High, Low, Close, Return?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose that the data series is given below ('1' is the oldest interval; '5' is the latest one):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;interval open  high  low   close return&#xA;---------------------------------------&#xA;1        17.36 17.54 17.17 17.19  0.00% &#xA;2        17.38 17.41 17.2  17.28  0.52% &#xA;3        17.62 17.64 17.35 17.36  0.46% &#xA;4        17.42 17.6  17.34 17.58  1.27% &#xA;5        17.41 17.61 17.29 17.45 -0.74%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I thought of using the following approach. Start with an arbitrary &lt;code&gt;100&lt;/code&gt; value for all fields on interval 1. So for &lt;code&gt;interval = 1&lt;/code&gt;, we have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;interval adj_open adj_high adj_low adj_close return&#xA;---------------------------------------------------&#xA;1                 100      100     100       100   &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, for the following interval (interval &lt;code&gt;2&lt;/code&gt;), we first calculate the adjusted close based on the &lt;code&gt;return&lt;/code&gt; from interval &lt;code&gt;1&lt;/code&gt; to interval &lt;code&gt;2&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;adjusted_close_on_interval_2 = 100 * (1 + 0.52 / 100) = 100.5235&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, we can calculate the adjusted open, high, and low on interval 2 based on the percentage distances from the actual close on &lt;code&gt;interval 2&lt;/code&gt; to these figures:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;open_to_close_ratio_on_interval_2 = (17.38 - 17.28) / 17.28 = 0.5787%`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;hence,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;adjusted_open_on_interval_2 = 100.5235 * ( 1 + 0.5787% ) = 101.10529&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the same manner:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;high_to_close_ratio_on_interval_2 = (17.41 - 17.28) / 17.28 = 0.7523%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;hence,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;adjusted_high_on_interval_2 = 100.5235 * ( 1 + 0.7523% ) = 101.2798&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;low_to_close_ratio_on_interval_2 = (17.2 - 17.28) / 17.28 = -0.4629%`&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;hence,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;adjusted_high_on_interval_2 = 100.5235 * ( 1 + ( -0.4629% ) ) = 100.05817&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the same manner, we continue for the rest of the intervals and get the table of the &lt;strong&gt;forward adjusted&lt;/strong&gt; prices: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;interval adj_open adj_high adj_low adj_close&#xA;--------------------------------------------&#xA;1        100      100      100     100      &#xA;2        101.11   101.28   100.06  100.52   &#xA;3        102.5    102.62   100.93  100.99   &#xA;4        101.34   102.39   100.87  102.27   &#xA;5        101.28   102.44   100.58  101.51&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(imagine that this time series continues for thousands of intervals...)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;My questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Is this a valid approach for forward-adjusting of prices? Do you see any flaws in it? For example, suppose I adjust this way over the course of (say) 10 years of data. And suppose that I have a simulated trade where I buy in the ADJUSTED_LOW price of interval = 50 and sell at the ADJUSTED_CLOSE of interval = 359; will the trade % return that will be calculated from the adjusted prices, be the same as the return I would have gotten in practice, trading 'normal' prices? (neglecting t-costs etc)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Do you agree that this method would be valid even when a stock has a split or a dividend? (the new adjusted prices are ALWAYS calculated based on the interval's return, and this will be correct as it is independent of any corporate actions). If you disagree with this statement, please explain.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Are there alternative ways to forward adjust prices that you can suggest? Better approaches?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="749" LastEditorUserId="35" LastEditDate="2011-04-14T22:51:38.893" LastActivityDate="2012-10-22T09:52:06.123" Title="Forward Adjusting Stock Prices?" Tags="&lt;equities&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="982" PostTypeId="2" ParentId="981" CreationDate="2011-04-15T03:03:27.087" Score="7" Body="&lt;p&gt;Assuming your data provides the &quot;print close&quot;, and there's no dividends and no splits, here's the R code where all values are divided by the first &quot;print close&quot; of 17.19.   This appears to match your results, except for the first line.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; texinp &amp;lt;- &quot;&#xA; interval open  high  low   close&#xA; 1        17.36 17.54 17.17 17.19&#xA; 2        17.38 17.41 17.2  17.28&#xA; 3        17.62 17.64 17.35 17.36&#xA; 4        17.42 17.6  17.34 17.58&#xA; 5        17.41 17.61 17.29 17.45&quot;&#xA;&#xA; dat &amp;lt;- read.table(textConnection(texinp), header = TRUE)&#xA;&#xA; dat1 &amp;lt;- dat&#xA; dat1$open &amp;lt;- 100*dat$open/dat$close[1]&#xA; dat1$high &amp;lt;- 100*dat$high/dat$close[1]&#xA; dat1$low &amp;lt;- 100*dat$low/dat$close[1]&#xA; dat1$close &amp;lt;- 100*dat$close/dat$close[1]&#xA;&#xA; dat1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The output from the above &quot;dat1&quot; statement is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   interval     open     high       low    close&#xA; 1        1 100.9889 102.0361  99.88365 100.0000&#xA; 2        2 101.1053 101.2798 100.05817 100.5236&#xA; 3        3 102.5015 102.6178 100.93077 100.9889&#xA; 4        4 101.3380 102.3851 100.87260 102.2688&#xA; 5        5 101.2798 102.4433 100.58173 101.5125&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As an example of an &quot;adjusted close&quot;, here's GE's dividend/split history:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.ge.com/investors/stock_info/dividend_history.html&quot;&gt;http://www.ge.com/investors/stock_info/dividend_history.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice that on 05/05/2000 they had a 3-for-1 split and had an X-dividend date of 07/05/2000.   The Yahoo data for that time frame shows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://finance.yahoo.com/q/hp?s=GE&amp;amp;a=03&amp;amp;b=1&amp;amp;c=2000&amp;amp;d=07&amp;amp;e=1&amp;amp;f=2000&amp;amp;g=d&quot;&gt;http://finance.yahoo.com/q/hp?s=GE&amp;amp;a=03&amp;amp;b=1&amp;amp;c=2000&amp;amp;d=07&amp;amp;e=1&amp;amp;f=2000&amp;amp;g=d&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you download that data into a spreadsheet, you'll see the &quot;Close&quot; drop from 158 on 05/05/2000 to 52.44 on 05/08/2000 (while the &quot;Adjusted Close&quot; already accounts for this split).   On 07/05/2000, the 0.137 dividend is paid.    Yahoo's &quot;Adjusted Close&quot; already accounts for this dividend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit 1 ========================================================&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Data on GE from Yahoo&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;      Date   Open   High    Low  Close   Volume Adj Close     &#xA; 5/03/2000 159.50 160.00 154.56 156.06 16594800   37.66     &#xA; 5/04/2000 157.44 157.50 152.75 154.00 15411000   37.16     &#xA; 5/05/2000 154.00 160.00 153.50 158.00 20685900   38.13 &amp;lt;----3-for-1 split     &#xA; 5/08/2000  52.13  52.88  51.63  52.44 11676500   37.96     &#xA; 5/09/2000  52.38  52.69  50.88  52.13 13439400   37.74     &#xA; 5/10/2000  51.50  52.06  50.06  50.63 15059400   36.65     &#xA;&#xA;&#xA; 6/30/2000  49.25  53.11  49.06  53.00 19076300   38.37&#xA; 7/03/2000  52.50  52.50  51.38  52.00  6604600   37.64&#xA; 7/05/2000  52.25  52.25  49.50  49.94 13558000   36.25 &amp;lt;----0.137 Dividend Paid&#xA; 7/06/2000  50.06  51.00  49.81  50.19  9616500   36.43&#xA; 7/07/2000  50.75  51.50  50.31  51.31  9937800   37.24&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On 05/05/2000, the &quot;Close&quot; was 158.00.  A 3-for-1 split gives a &quot;split&quot; close of 52.67 (158.00/3).  So, from 05/05/2000 to 05/08/2000, the price dropped from 52.67 to 52.44 or 0.995633 (52.44/52.67).   Check this against the change in the &quot;Adj Close&quot;, 38.13 * 0.995633 = 37.96 which is the &quot;Adj Close&quot; for 05/08/2000.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same idea holds for the dividend on 07/05/2000.  The &quot;Close&quot; for 07/05/2000 was 49.94.  Add to that the 0.137 dividend that was paid on that day, gives a close of 50.077.  The &quot;Close&quot; for 07/03/2000 was 52.00 or 0.963019 (50.077/52.00).    Check this against the change in the &quot;Adj Close&quot;, 37.64 * 0.963019 = 36.25 which is the &quot;Adj Close&quot; for 07/05/2000.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit 2 ================================================&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using &quot;forward&quot; to describe your method versus Yahoo's backward method, the good part of Yahoo's method is that the most recent &quot;adjusted close&quot; is the same as the &quot;print close&quot;, so that it makes sense to just about everyone.  Using GE as the example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://finance.yahoo.com/q/hp?s=GE+Historical+Prices&quot;&gt;http://finance.yahoo.com/q/hp?s=GE+Historical+Prices&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yesterday's (04/14/2011) 20.00 &quot;adjusted close&quot; is the same as the 20.00 &quot;print close&quot;.  The bad part of Yahoo's method is that ALL adjusted close values must be recalculated when a dividend is paid or there's a split.    Whereas, your &quot;forward&quot; method would not require a complete recalculation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From that link, notice that Yahoo's GE data starts at Jan 2, 1962.   When you look at data from that time frame you'll get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://finance.yahoo.com/q/hp?s=GE&amp;amp;a=00&amp;amp;b=1&amp;amp;c=1962&amp;amp;d=01&amp;amp;e=1&amp;amp;f=1962&amp;amp;g=d&quot;&gt;http://finance.yahoo.com/q/hp?s=GE&amp;amp;a=00&amp;amp;b=1&amp;amp;c=1962&amp;amp;d=01&amp;amp;e=1&amp;amp;f=1962&amp;amp;g=d&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice that the starting &quot;adjusted close&quot; is 0.17 while the starting &quot;print close&quot; was 74.50.   That's a ratio of 438.2 (74.50/0.17).   This same ratio would apply if the data was &quot;forward adjusted&quot;, but started at 74.50.   That means your &quot;adjusted close&quot; for yesterday's (04/14/2011) &quot;print close&quot; of 20.00 would be 8764.7 (20.00 * 438.2), a very large number that bears little resemblance to the 20.00 &quot;print close&quot;.  My guess is that most people would be confused by that number.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you index the starting &quot;adjusted close&quot; to 100 (as shown in your original question), the starting ratio would be 588.2 (100/0.17) giving you an &quot;adjusted close&quot; yesterday of 11764.7.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as other problems go, the two techniques are essentially the same, and both methods have been used since the beginning.   You do have to get into the details of mergers/acquisitions, especially when there's a &quot;return of capital&quot; involved.   Even relatively simple mergers can be a pain (for example, the Exxon/Mobil merger).  It's not the &quot;forward&quot; or &quot;backward&quot; technique that's the pain, it's collecting/sorting/applying the data.&lt;/p&gt;&#xA;" OwnerUserId="392" LastEditorUserId="392" LastEditDate="2011-04-15T17:39:13.140" LastActivityDate="2011-04-15T17:39:13.140" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="983" PostTypeId="1" CreationDate="2011-04-15T07:25:09.943" Score="3" ViewCount="4521" Body="&lt;p&gt;I'm looking for an indicator which tells me if it's a good time to use mean reverting type quantitative trading strategies. &#xA;In order to do so I look at the market (the few hundred stocks I trade) and try to build a measure with previous prices, volumes etc. &#xA;It's seems difficult to have a multivariate model based approach because of the large number of stocks. Do you have any idea on were to begin?&#xA;As usual it would have to react fast to market changes but not too fast to be discriminative in terms of transaction costs. &lt;/p&gt;&#xA;" OwnerUserId="155" LastActivityDate="2014-11-25T19:53:12.700" Title="Mean reverting Indicator" Tags="&lt;indicator&gt;&lt;mean&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="984" PostTypeId="2" ParentId="983" CreationDate="2011-04-15T10:13:19.060" Score="5" Body="&lt;p&gt;I think of mean reversion as more of a single stock phenomenon. In aggregate, these ididosyncratic mean reversions should offset one another and make the market smoother than its component stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a lot of work on mean reversion at the single stock level. The best entry is &lt;a href=&quot;http://e-m-h.org/Jega90.pdf&quot; rel=&quot;nofollow&quot;&gt;Jegadeesh's 1990 paper&lt;/a&gt; on what became known as &quot;short run reversal&quot; -- the tendency for winners one month to become losers the next. Also, &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1262416&quot; rel=&quot;nofollow&quot;&gt;Bali, Cakici, and Whitelaw have a 2010 paper&lt;/a&gt; on a similar idea -- stocks with the biggest one-day return in one month have low returns the next.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's a lot of research during the two decades in between, but these -- even if you only read the intros -- should help you ask yourself the right questions.&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-04-15T10:13:19.060" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="985" PostTypeId="1" CreationDate="2011-04-15T16:53:46.563" Score="16" ViewCount="2803" Body="&lt;p&gt;I did cointegration test on two identical time series, and the result shows that they are not cointegrated, but intuitively, I think they are.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone share some thoughts on this? Thanks!&lt;/p&gt;&#xA;" OwnerDisplayName="user752" LastEditorUserId="751" LastEditDate="2011-04-17T16:03:44.687" LastActivityDate="2017-11-15T06:55:47.937" Title="Are two identical time series cointegrated?" Tags="&lt;time-series&gt;&lt;cointegration&gt;&lt;statistics&gt;" AnswerCount="5" CommentCount="8" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="986" PostTypeId="1" AcceptedAnswerId="2027" CreationDate="2011-04-16T14:11:34.200" Score="22" ViewCount="1597" Body="&lt;p&gt;Deutsche Bank’s ETF platform, db X-trackers, provides a rather remarkable ETF  tracking Euro Stoxx 50  (which is the most widely used regional blue-chip index in Europe). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What makes it remarkable is its cost - the fund's TER is 0.00%. But even more surprisingly, the passively managed ETF has been consistently outperforming its benchmark index roughly by  0.5 per cent annually since 2007.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/fvQCt.png&quot; alt=&quot;enter image description here&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/URcAb.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Annual outperformance of the db x-tracker EURO STOXX 50® ETF compared to the Index: 2007: 0.50%, 2008: 0.66%, 2009: 0.45%, 2010 year to date: 0.37%. Source: Deutsche Bank; data at 13.10.2010.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fund managers explain on their &lt;a href=&quot;http://www.etf.db.com/UK/ENG/Pages/Home/409.html&quot; rel=&quot;noreferrer&quot;&gt;site&lt;/a&gt; that the ETF outperformance is &quot;generated through activities such as securities lending&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Questions.&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Are there any other mechanisms at play here which might explain this kind of tracking error? &lt;/li&gt;&#xA;&lt;li&gt;Why the discrepancy between the fund's NAV and the index has not been eliminated by arbitrageurs?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="70" LastEditorUserId="1106" LastEditDate="2011-09-25T22:35:31.590" LastActivityDate="2011-09-26T19:44:04.557" Title="How can an ETF outperform its benchmark index?" Tags="&lt;arbitrage&gt;&lt;performance&gt;&lt;etf&gt;&lt;benchmark&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="987" PostTypeId="1" CreationDate="2011-04-16T14:41:00.247" Score="27" ViewCount="3937" Body="&lt;p&gt;What are the most famous/best performing absolute-return funds employing approaches based on mainstream finance theory (i.e., theory presented in Journal of Finance, AER, Econometrica, using typically factor models)? I am asking because I know certified outstanding managers using fundamental analysis (e.g., Buffett, Robertson, Cohen), and bottom-up algorithmic approaches (e.g., Simons, Thorpe, Malyshev). However, the typical quant asset managers that use some kind of factor model are either institutional investors with mediocre performance (and usually actively managed to a benchmark), or absolute return fund managers with either terrible performance (GSAM, LTCM), or unremarkable one. In short, does anyone have an example of such a fund with average returns in excess of 15-20%/year over an extended period of time?&lt;/p&gt;&#xA;" OwnerUserId="194" LastEditorUserId="70" LastEditDate="2012-01-03T13:20:48.470" LastActivityDate="2013-07-20T02:32:03.393" Title="Most successful investors using academic-based framework?" Tags="&lt;quant-trading-strategies&gt;&lt;factor-models&gt;&lt;research&gt;&lt;big-list&gt;" AnswerCount="6" CommentCount="0" FavoriteCount="27" ContentLicense="CC BY-SA 3.0" />
  <row Id="988" PostTypeId="2" ParentId="986" CreationDate="2011-04-16T16:17:08.363" Score="8" Body="&lt;p&gt;An index is just an abstract concept and does not hold securities.  Hence no source of revenue from lending them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A portfolio mirroring an index holds the securities and can in fact generate revenue by loaning the securities to others wanting to short the stocks.  This provides a positive bias. That is often offset by a negative bias when the index portfolio is under-invested to keep cash on hand for withdrawals, or from inflows not yet invested (cash drag), plus tracking error from finite rebalancing etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, the answer is more theoretical than practical.  I have not seen such a chart for an index-tracking ETF.&lt;/p&gt;&#xA;" OwnerUserId="69" LastEditorUserId="1418" LastEditDate="2011-09-26T17:29:13.050" LastActivityDate="2011-09-26T17:29:13.050" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="989" PostTypeId="2" ParentId="987" CreationDate="2011-04-16T17:51:31.117" Score="13" Body="&lt;p&gt;One might probably mention Yale's Endowment under David Swensen which generated returns of 13% per annum over the past two decades (as compared to the 8 or 9% average return of college and university endowments). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I would not label Swensen's approach to portfolio management with a pure absolute return strategy tag but he definitely uses some insights from the academic finance theory. Swensen speaks about his investment philosophy in this &lt;a href=&quot;http://academicearth.org/lectures/david-swensen&quot;&gt;lecture&lt;/a&gt; (which is a part of &lt;a href=&quot;http://academicearth.org/courses/financial-markets&quot;&gt;Robert Shiller's course on Financial Markets&lt;/a&gt;).   &lt;/p&gt;&#xA;" OwnerUserId="70" LastActivityDate="2011-04-16T17:51:31.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="990" PostTypeId="2" ParentId="987" CreationDate="2011-04-16T18:34:33.870" Score="9" Body="&lt;p&gt;That's a tough question to answer.   The &quot;quant business&quot; is a business.   Some quants sell low-grade/low-volatility results, some sell fast-moving/unpredictable results, some sell industry targeted results, etc.   It depends on what the buyer wants to buy.   There's a market for everything.   Haven't we all met people that think they're going to win the Lottery?  ...beat Vegas?   ...predict the price of gold?   It's their money.  If they want to waste it, there's always someone willing to get on the other side.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then there's a part of the quant market that is real.  They spend a lot of time trying not to lose money, and to make money in a less volatile way.   I don't have money with the following guys, but here's a big, medium, and small organization:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ray Dalio, Bridgewater Assoc - &lt;a href=&quot;http://www.bwater.com/home/our-company/company.aspx&quot;&gt;http://www.bwater.com/home/our-company/company.aspx&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cliff Asness, AQR Capital - &lt;a href=&quot;http://www.aqrcapital.com/cliff.htm&quot;&gt;http://www.aqrcapital.com/cliff.htm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;John Hussman, Hussman Funds - &lt;a href=&quot;http://www.hussmanfunds.com/&quot;&gt;http://www.hussmanfunds.com/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="392" LastActivityDate="2011-04-16T18:34:33.870" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="991" PostTypeId="2" ParentId="983" CreationDate="2011-04-16T21:40:47.777" Score="5" Body="&lt;p&gt;The issue for any technique is, does it consistently work as expected in the future?  If not, then it's worthless.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea behind mean reversion is that you have a &quot;mean&quot; that means something (it's not arbitrary), and a deviation from that mean that reverts in some consistent way.   A pair trade is a common form of a &quot;mean reversion&quot; trade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is a crude example of a &quot;pair trade&quot; where the NASDAQ is assumed to be garbage (needs shorting) while the S&amp;amp;P500 is worth holding (go long).   This is essentially the position that chewed on Cliff Asness in 1999-2000 that I described in another thread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Will the current spread get bigger or smaller?   Who knows.   As stated on that thread, quant funds (no one) can be &quot;future neutral&quot;.   When you take a position, any position, you're exposed to the future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/iQEy8.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a link to a .PPT file on pairs trading.   Notice the conclusions on the last slide:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.stanford.edu/class/msande444/2008/MeanReversion.ppt&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.stanford.edu/class/msande444/2008/MeanReversion.ppt&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an article describing mean reversion trades.   Notice that he doesn't really have a conclusion:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://seekingalpha.com/instablog/167044-bo-peng/46996-anatomy-of-technical-trading-black-swan-or-mean-reversion&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://seekingalpha.com/instablog/167044-bo-peng/46996-anatomy-of-technical-trading-black-swan-or-mean-reversion&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do enough digging and you'll find every opinion imaginable.  I know that doesn't help, but that's reality.&lt;/p&gt;&#xA;" OwnerUserId="392" LastEditorUserId="392" LastEditDate="2011-04-17T00:51:49.907" LastActivityDate="2011-04-17T00:51:49.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="992" PostTypeId="2" ParentId="985" CreationDate="2011-04-17T16:32:37.657" Score="9" Body="&lt;p&gt;Let us test that $x$ and $y$ are co-integrated, say that $x_t, y_t \sim I(1)$. In the Engle-Granger we test stationarity of the error term in $$y_t = \alpha + \beta x_t + u_t$$ which we estimate as $$\hat u_t = y_t - \hat \alpha - \hat \beta x_t$$ and find that $\hat \alpha =0$, $\hat \beta = 1$, and $\hat u_t = 0 \; \forall t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So now when we Dickey-Fuller test residuals in something like $$\Delta \hat u_t = \gamma_0 + \gamma_1 \hat u_{t-1} + \epsilon_t$$ nothing will be significant and we won't find any co-integration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not precisely schooled in this theory, so I'm not sure if this means these series can't be &lt;em&gt;referred&lt;/em&gt; to as &quot;co-integrated&quot; (clearly they have the same drift) or if this is just a trivial case where the test fails,&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-04-17T16:32:37.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="993" PostTypeId="2" ParentId="971" CreationDate="2011-04-17T19:36:42.283" Score="2" Body="&lt;p&gt;This is very standard financial theory. The answer to the question is given in the first chapter of Duffie's Dynamic Asset Pricing Theory and in Cochrane's Asset Pricing. The latter is more elementary, but you have to read more to get to the answer.&lt;/p&gt;&#xA;" OwnerUserId="194" LastActivityDate="2011-04-17T19:36:42.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="994" PostTypeId="2" ParentId="952" CreationDate="2011-04-17T19:51:54.323" Score="4" Body="&lt;p&gt;I have attended a number of conferences, and the percentage of asset under management by quantitative funds is consistently quoted between 17% and 23%; these statistics are usually based on aggregates from eVestments, SEC, and European stop that, like Frankfurt, ask the sender of an order to specify the way it was created. It is likely that the percentage may have decreased in the past two years. This is not the percentage of flows, and for sure not PnL. Not sure there are any reliable data in that respect.&lt;/p&gt;&#xA;" OwnerUserId="194" LastActivityDate="2011-04-17T19:51:54.323" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="995" PostTypeId="2" ParentId="908" CreationDate="2011-04-18T05:06:19.160" Score="1" Body="&lt;p&gt;Sure it is used in non-linear dynamics. What is not used is that this non-linearity is caused by huge operators who cause the deviation from Normal Law delaying the reversion to the mean. This is just common sense and mathematically logics when you go straight to Normal Law premisces: all samples must have about the same weight and being independant. Clearly these premisces are hugely violated in Stock Market.&lt;/p&gt;&#xA;" OwnerUserId="763" LastActivityDate="2011-04-18T05:06:19.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="996" PostTypeId="2" ParentId="952" CreationDate="2011-04-18T05:12:20.773" Score="1" Body="&lt;p&gt;If it wasn't quant it would be something else. I rather think that the effect is due to real time which can allow manipulation more easily and so huge moves. In fact a Nobel Economist Maurice Allay did advocate to forbid real time and one quotation per day if the goal was to stabilize the effect of stock market on Economy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But of course no way that will ever happen since the rules are aimed not to stabilize but to create as much volatility as possible since it is how the big guys can profit.&lt;/p&gt;&#xA;" OwnerUserId="763" LastActivityDate="2011-04-18T05:12:20.773" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="997" PostTypeId="2" ParentId="978" CreationDate="2011-04-18T08:15:13.043" Score="6" Body="&lt;p&gt;Since I did not get any comments to my latest update, and since I find it quite convincing, I hereby post my solution as an answer.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;maybe I can prove that Q exists assuming a lognormal distribution of $S_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming $dS_t = \mu S_t dt + \sigma S_t dW_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By Itô, $d(e^{-rt} S_t) = -r e^{-rt} S_t dt + e^{-rt} S_t dS_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Replacing with the definition of  $dS_t$, I get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d(e^{-rt} S_t) = e^{-rt} S_t [(\mu - r)dt + \sigma dW_t] = e^{-rt} S_t \sigma [\theta dt +  dW_t]$. (with $\theta=\frac{\mu-r}{\sigma}$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By Girsanov, we know that there exists a measure s.t $dW_t = dW_t^* - \theta dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We thus get &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d(e^{-rt} S_t) = e^{-rt} S_t \sigma [\theta dt +  dW_t] = e^{-rt} S_t \sigma dW_t^*$ which means that $e^{-rt} S_t$ is a Q-martingale. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you think it's incorrect, feel free to comment, or even better, to correct!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The thing that worries me is that I need to know the dynamics of the asset, and I think I shouldn't have to...&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2011-04-27T06:43:20.097" LastActivityDate="2011-04-27T06:43:20.097" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="998" PostTypeId="1" AcceptedAnswerId="1002" CreationDate="2011-04-18T09:41:02.443" Score="25" ViewCount="62551" Body="&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Renaissance_Technologies&quot;&gt;Renaissance Technologies Medallion fund&lt;/a&gt; is one of the most successful hedge funds - ever! Yet it is very secretive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you have information on the strategy used that is not yet mentioned in the Wikipedia article above?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there really something fundamental going on (the Holy Grail of investing) - or will this be the next Madoff? &lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2011-04-20T07:17:36.883" LastActivityDate="2019-11-14T19:29:08.073" Title="Strategy of Renaissance Technologies Medallion fund: Holy Grail or next Madoff?" Tags="&lt;strategy&gt;&lt;quant-funds&gt;" AnswerCount="10" CommentCount="16" FavoriteCount="33" ContentLicense="CC BY-SA 3.0" />
  <row Id="999" PostTypeId="2" ParentId="955" CreationDate="2011-04-18T10:03:16.487" Score="11" Body="&lt;p&gt;In order to have a shot at separating skill from luck, you need a sense of what luck looks like.  I think the best chance of understanding luck is to use random portfolios.  See, for instance: &lt;a href=&quot;http://www.portfolioprobe.com/about/random-portfolios-in-finance/&quot;&gt;http://www.portfolioprobe.com/about/random-portfolios-in-finance/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="249" LastActivityDate="2011-04-18T10:03:16.487" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1000" PostTypeId="2" ParentId="965" CreationDate="2011-04-18T12:06:04.507" Score="1" Body="&lt;p&gt;You can't add returns. You must multiply them.&#xA;In your example above where daily returns are 25%, 25%, and -40%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To compute expected return from a return series, simply use this formula:&#xA;return =  product( 1+return);&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in the case of you example this yields:&#xA; return = (1.25 * 1.25 * .6) = .9375&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get the expected daily return use the geometric mean:&#xA;expected return = (1.25 * 1.25 * .6)^(1/3)  -1 = -2.13%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Geometric_mean&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Geometric_mean&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="214" LastEditorUserId="214" LastEditDate="2011-04-21T14:34:35.280" LastActivityDate="2011-04-21T14:34:35.280" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="1002" PostTypeId="2" ParentId="998" CreationDate="2011-04-18T13:32:30.267" Score="19" Body="&lt;p&gt;There are a some information about Renaissance Technologies available in &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0307453383&quot;&gt;The Quants&lt;/a&gt; from Patterson.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, and it's also what I heard in general, they are using intensively algorithmic trading, and from what I understood there are using Information Theory (they worked with &lt;a href=&quot;http://en.wikipedia.org/wiki/Shannon%E2%80%93Hartley_theorem&quot;&gt;Shannon&lt;/a&gt; if I remember well).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd say it'd be harsh to say it's the next Madoff given the background they have, I can easily see them being simply better than the rest...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's just my opinion of course...&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="89" LastEditDate="2011-04-18T18:43:18.187" LastActivityDate="2011-04-18T18:43:18.187" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="1003" PostTypeId="2" ParentId="978" CreationDate="2011-04-18T14:06:07.133" Score="7" Body="&lt;p&gt;You can find a simple proof in the discrete time case at &lt;a href=&quot;http://kalx.net/ftapd.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://kalx.net/ftapd.pdf&lt;/a&gt;. I'm not sure what you are trying to derive with your Ito calculus, but here is a rigourous derivation of the Black-Sholes/Merton PDE: &lt;a href=&quot;http://kalx.net/dsS2011/bms.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://kalx.net/dsS2011/bms.pdf&lt;/a&gt;. The Black-Scholes '73 derivation is not mathematically correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The modern approach does not use so called real-world measures.&lt;/p&gt;&#xA;" OwnerUserId="2357" LastActivityDate="2011-04-18T14:06:07.133" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1004" PostTypeId="1" AcceptedAnswerId="1077" CreationDate="2011-04-18T14:38:22.167" Score="26" ViewCount="14370" Body="&lt;p&gt;One of the answers to &lt;a href=&quot;https://quant.stackexchange.com/questions/998/strategy-of-renaissance-technologies-medallion-fund-holy-grail-or-next-madoof&quot;&gt;my previous question regarding the strategy of Renaissance Technologies&lt;/a&gt;, there was a reference to &lt;a href=&quot;http://books.google.de/books?id=VkB0qVqgzqkC&amp;amp;dq=The%20Quants:%20How%20a%20New%20Breed%20of%20Math%20Whizzes%20Conquered%20Wall%20Street%20and%20Nearly%20Destroyed%20It&amp;amp;hl=de&amp;amp;ei=aUusTeqKDJHEswaForGOCA&amp;amp;sa=X&amp;amp;oi=book_result&amp;amp;ct=result&amp;amp;resnum=1&amp;amp;ved=0CDAQ6AEwAA&quot; rel=&quot;noreferrer&quot;&gt;The Quants: How a New Breed of Math Whizzes Conquered Wall Street and Nearly Destroyed It&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After doing some browsing in the book I found that it states that Renaissance Technologies obviously very successfully employs cryptography and speech recognition technology for forecasting financial time series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you know of any good papers (or other references) where the use of either of these technologies in connection with finance is shown?&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2018-09-13T11:01:34.117" Title="How are cryptography and speech recognition technology applied to forecasting financial markets?" Tags="&lt;quant-trading-strategies&gt;&lt;research&gt;&lt;forecasting&gt;&lt;machine-learning&gt;" AnswerCount="8" CommentCount="2" FavoriteCount="48" ContentLicense="CC BY-SA 3.0" />
  <row Id="1005" PostTypeId="2" ParentId="998" CreationDate="2011-04-18T19:18:09.683" Score="36" Body="&lt;p&gt;The Medallion Fund doesn't take outside investors.  They returned the original investor money years ago.  So:  if it's a Ponzi scheme, then they've figured out how to profit by ripping themselves off.  That's nice work if you can get it.&lt;/p&gt;&#xA;" OwnerUserId="764" LastActivityDate="2011-04-18T19:18:09.683" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1006" PostTypeId="1" AcceptedAnswerId="1008" CreationDate="2011-04-18T19:33:31.240" Score="5" ViewCount="279" Body="&lt;p&gt;I recently read a blog entry where some statistics were generated for a common technical analysis indicator.  Below is the link.  My question shows up close to the bottom under the name bill_080, in the &quot;Response&quot; section:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.portfolioprobe.com/2011/04/16/a-bit-of-analysis-of-the-dow-golden-cross/&quot; rel=&quot;nofollow&quot;&gt;http://www.portfolioprobe.com/2011/04/16/a-bit-of-analysis-of-the-dow-golden-cross/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question here is the same question as in the link:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; &quot;.....In the paper, they were able to come up with a “Universe of Calendar Effects”&#xA; of 9,452 rules (and a reduced set of 244 rules) to generate the statistics.&#xA; In the “Golden Cross” scheme, can you think of a way to put a number to the&#xA; “Universe of Golden Cross Effects”, and then look at the various p-value,&#xA; t-stat, or whatever stats apply?.....&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have been dealing with similar problems for a while, and I do have a very CRUDE way to deal with this issue.   However, I'm looking for any suggestions from others.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit 1 =========================================&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be more specific, the &quot;Calendar Effects&quot; paper that I referenced in that link discussed the multiple comparison problem where the optimization was over a DISCRETE range.  As a result, they were able to count up the &quot;Universe of Calendar Effects&quot; to be 9452 rules.   So, they were then able to correct any p-value/t-stat/etc statistics to reflect this universe of possibilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I try to apply this same technique to a problem that has a CONTINUOUS range or ranges, as in the &quot;Golden Cross&quot; case, the first n-day moving average (which was optimized over a continuous range, giving a 200-day moving average) and the second n-day moving average (which was optimized over a continuous range, giving a 50-day moving average), how do you comfortably nail down a discrete number (the &quot;Universe&quot;) to correct the p-value/t-stat/etc for this CONTINUOUS problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My production/inventory problem is essentially the same as that &quot;Golden Cross&quot; problem.   I have several variables (it's my choice how many) that can be bumped until I hit the optimum combination, but when I do that, how do I come up with a discrete number to correct for the multiple comparisons that I just carried out?   To make things easy, let's just say that the required correction is the &quot;Sidak Correction&quot; given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Multiple_comparisons&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Multiple_comparisons&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alpha1 = 1 - ((1 - alpha2)^(1/n))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Let's say that if this was a normal one-time, no optimization situation (n=1), I might use alpha2 = 0.05 (5%).   What is the equivalent of this 5% value if I optimize 1 variable, 2 variables, 3 variables, etc.   If I add, let's say, 100 to n for each optimized variable, I'll get the following correction table:    &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Number of Optim Var     n    alpha1&#xA;                  0     1   0.05000&#xA;                  1   101   0.00051&#xA;                  2   201   0.00026&#xA;                  3   301   0.00017&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, if 100 is the &quot;right&quot; adder, then that &quot;Golden Cross&quot; problem would have to match alpha1=0.026% (0.00026) to be consistent with an alpha2 of 5%.  Just guessing, but I doubt the Golden Cross scheme would pass the test.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, if I optimize my inventory problem using 3 variables, my target alpha1 is 0.017% (0.00017).   That is a tough hurdle to clear.  At an adder of 100, one optimization variable clears the hurdle, but no more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, is ADDING 100 per variable too much, not enough?  Should it be exponential instead of an adder, so that the above table has n=1, 101, 10001, 1000001?  Some other scheme?   That's what I'm trying to justify.  Has anyone done a study or seen a paper on correcting p-values/t-stats/etc for CONTINUOUS variables?&lt;/p&gt;&#xA;" OwnerUserId="392" LastEditorUserId="392" LastEditDate="2011-04-19T17:00:44.337" LastActivityDate="2011-04-19T17:00:44.337" Title="Multiple comparison problems" Tags="&lt;backtesting&gt;&lt;modeling&gt;&lt;reject-inference&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1007" PostTypeId="2" ParentId="946" CreationDate="2011-04-18T21:44:21.757" Score="9" Body="&lt;p&gt;Short gamma is a bet on volatility (expressed as hedging costs) not getting too large.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The key concept here is that you get &lt;em&gt;paid&lt;/em&gt; to be short gamma.  Consider that any option is sold for a bit more more than its intrinsic value (the extra bit is often called &lt;em&gt;volatility value&lt;/em&gt;.).  If nothing moves, then the option ultimately expires precisely at intrinsic value, netting the seller profits equal to the volatility value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, one is willing to be short gamma if one thinks the &quot;rent&quot; is sufficiently high.  Obviously this can involve high tail risk, but it is otherwise a steady money-maker.  Indeed there are many cases of people backtesting options strategies without including tail events and believing they have found some kind of holy grail.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-04-18T21:44:21.757" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1008" PostTypeId="2" ParentId="1006" CreationDate="2011-04-18T22:01:40.890" Score="6" Body="&lt;p&gt;David Aronson spent 500+ pages detailing this one key idea of multiple comparison problems in searching for trading rules---so have a look at &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470008741&quot; rel=&quot;nofollow&quot;&gt;his book called 'Evidence-Based Technical Analysis&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="69" LastActivityDate="2011-04-18T22:01:40.890" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1009" PostTypeId="2" ParentId="1004" CreationDate="2011-04-19T09:06:52.413" Score="12" Body="&lt;p&gt;I honestly think that most people who could be able to answer to this question simply won't either because they actually work for Renaissance, or because they work in a top quant hedge fund and they'll keep it a secret.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I discussed this topic once during an interview and the guy said &quot;we'll discuss this further if you get the job&quot; lol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;About papers, I'm sure that there have been incredible findings in the industry which are just kept secret until they are found by academy, or simply become obsolete....&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And honestly, it's quite fair...&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2011-04-19T09:06:52.413" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1010" PostTypeId="2" ParentId="965" CreationDate="2011-04-19T10:01:40.447" Score="2" Body="&lt;p&gt;Returns-based analysis cannot calculate the expected return of a trading system. It yields nonsensical results and is not suited to this particular calculation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a game where every time you play, you win 25% twice and lose 40% once. There are basically three permutations of this game. Represented in R vectors:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;first  &amp;lt;- c(.25, .25, -.4)&#xA;second &amp;lt;- c(-.4, .25, .25)&#xA;third  &amp;lt;- c(.25, -.4, .25)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is a simple function that takes each sequence individually and returns what's left from your stack of 100 chips.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;game &amp;lt;- function(x){&#xA;&#xA;start &amp;lt;- 100&#xA;&#xA;for(i in 1:NROW(x))&#xA;&#xA;start &amp;lt;- start + start*x[i]&#xA;&#xA;return(start)   &#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Try it yourself and you will see that each time, the result is &lt;code&gt;93.75&lt;/code&gt;. You lose every time. If you calculate the expected return in the canonical manner, you get the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Expected Return = (.25 * .33) + (.25 * .33) + (-.40 * .33) = 0.033&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is a positive value for a game in which you cannot win. If you sum returns, you get the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Sum Returns = .25 + .25 + (-.40) = .10&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Again, a positive value for a game in which you always lose.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you analyze your expected return using transaction-based analysis as given in the original question, you get the same result each time. The answer comes to &lt;code&gt;-2.0625&lt;/code&gt;. A negative expectation that will keep you clear from playing this game.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE: this answer was based on the false assumption that you can add simple returns, and of course you can only add log returns. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Simple Returns = 1.25 * 1.25 * .6 = .9375&#xA;&#xA;Log Returns = log(1.25) + log(1.25) + log(.6) =  -0.06453852&#xA;antilog of sum = exp( -0.06453852) = .9375&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="291" LastEditorUserId="291" LastEditDate="2011-04-21T20:36:48.140" LastActivityDate="2011-04-21T20:36:48.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1011" PostTypeId="1" AcceptedAnswerId="1015" CreationDate="2011-04-19T10:39:07.903" Score="2" ViewCount="513" Body="&lt;p&gt;Currency valuation (with respect to other currencies) is an important parameter in finance, but how is it related to the cash reserve ratio?&lt;/p&gt;&#xA;" OwnerUserId="768" LastEditorUserId="35" LastEditDate="2011-04-19T13:39:02.997" LastActivityDate="2011-04-19T17:47:22.423" Title="How does currency valuation depend on the cash reserve ratio for a country?" Tags="&lt;finance&gt;&lt;banks&gt;&lt;currency&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1012" PostTypeId="1" CreationDate="2011-04-19T13:48:26.593" Score="1" ViewCount="330" Body="&lt;p&gt;Imagine a British investor with $10-100k in her pocket. She wants to see the previous performance of various British and overseas funds to choose the one to invest. And she wants to filter out the ones which accept minimum one million investment. Is there a website to help her to make the informed choice?&lt;/p&gt;&#xA;" OwnerUserId="769" LastEditorUserId="769" LastEditDate="2011-04-19T22:41:21.960" LastActivityDate="2011-04-19T22:41:21.960" Title="British hedge/mutual funds performance comparison website" Tags="&lt;performance&gt;&lt;quant-funds&gt;" AnswerCount="1" CommentCount="13" ClosedDate="2011-04-20T00:03:59.520" ContentLicense="CC BY-SA 3.0" />
  <row Id="1014" PostTypeId="2" ParentId="649" CreationDate="2011-04-19T14:56:43.673" Score="1" Body="&lt;p&gt;In short, persistence is related to the long-term influence of a shock, e. g. that a one-off shock on the d/p would have an &quot;everlasting&quot; influence on the average return level.&lt;/p&gt;&#xA;" OwnerUserId="40" LastActivityDate="2011-04-19T14:56:43.673" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1015" PostTypeId="2" ParentId="1011" CreationDate="2011-04-19T17:47:22.423" Score="1" Body="&lt;p&gt;Here's a little bit of everything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Some papers on foreign reserves that are used to defend a country's currency, and the flexibility of their exchange rate:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.imf.org/external/pubs/ft/wp/2001/wp0118.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.imf.org/external/pubs/ft/wp/2001/wp0118.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.eusanz.org/pdf/conf04/choi_baek.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.eusanz.org/pdf/conf04/choi_baek.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Some papers on generic modeling of exchange rates:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://faculty.darden.virginia.edu/warnockf/GFM/BP-0496%20Exchange%20Rate%20Models.pdf&quot; rel=&quot;nofollow&quot;&gt;http://faculty.darden.virginia.edu/warnockf/GFM/BP-0496%20Exchange%20Rate%20Models.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Figure 1 in the above link is a common view of the short/medium/long-term variables that affect exchange rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.federalreserve.gov/Pubs/Ifdp/2003/779/ifdp779.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.federalreserve.gov/Pubs/Ifdp/2003/779/ifdp779.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) If you're trying to play with exchange rates as a retail investor, you need to be aware of the game/scams:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://articles.latimes.com/2011/apr/03/business/la-fi-amateur-currency-trading-20110403&quot; rel=&quot;nofollow&quot;&gt;http://articles.latimes.com/2011/apr/03/business/la-fi-amateur-currency-trading-20110403&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Forex_scam&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Forex_scam&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="392" LastActivityDate="2011-04-19T17:47:22.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1016" PostTypeId="2" ParentId="1012" CreationDate="2011-04-19T22:04:16.703" Score="5" Body="&lt;p&gt;Your example shows a fundamental ignorance of how hedge funds operate:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Hedge funds cannot advertise and are limited to 499 investors. Given these restrictions plus the capital requirements to hold positions overnight, it is a virtual guarantee that a fund would not take an investment of $10K.&lt;/li&gt;&#xA;&lt;li&gt;Hedge funds are usually LPs, which means that the GP (the asset manager) must &lt;em&gt;accept&lt;/em&gt; a new client specifically. No one can just &lt;em&gt;choose&lt;/em&gt; to invest in a hedge fund. (A couple hedge fund &lt;em&gt;managers&lt;/em&gt; have publicly traded equity, but that's different from the underlying fund.)&lt;/li&gt;&#xA;&lt;li&gt;Hedge funds are generally not required to publicly file their track record. Occasionally an &lt;a href=&quot;http://www.hedgefundletters.com&quot; rel=&quot;nofollow&quot;&gt;investors' letter might leak onto the interwebs&lt;/a&gt;, but most fund managers consider the specifics of their P&amp;amp;L to be just as proprietary as their trading strategies.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And one final item of note is that all investors must be &lt;a href=&quot;http://en.wikipedia.org/wiki/Accredited_investor&quot; rel=&quot;nofollow&quot;&gt;accredited&lt;/a&gt; (ie, the investor must be wealthy already).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So your premise doesn't really make any sense to begin with. Given the above regulatory framework, a website like what you've described is almost impossible to build and will definitely be useless if it even existed.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-04-19T22:04:16.703" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1017" PostTypeId="1" AcceptedAnswerId="8800" CreationDate="2011-04-19T23:33:02.623" Score="7" ViewCount="26419" Body="&lt;p&gt;I'm looking for a clearly articulated description of the difference between trade matching (e.g. Omgeo's CTM) and trade affirmation (e.g. Omgeo's Oasys). From what I understand, they both involve electronic matching of trade details. So, what's the difference?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(For those who are just trying to follow the conversation, electronic matching of trade details refers to an automatic comparison of a buyer's version and a seller's version of a trade's attributes such as price, value date, etc in order to ensure a successful settlement down the road.)&lt;/p&gt;&#xA;" OwnerUserId="772" LastEditorUserId="772" LastEditDate="2011-04-20T00:53:24.753" LastActivityDate="2013-09-10T07:37:41.663" Title="Trade matching versus affirmation" Tags="&lt;trading&gt;&lt;automated-trading&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1018" PostTypeId="1" CreationDate="2011-04-20T07:27:49.207" Score="17" ViewCount="2058" Body="&lt;p&gt;I'll start this off with a rather broad question: I am trying to simulate returns of a large number of assets within a portfolio of different classes - equity and fixed income in a first step, say 100 stocks and 100 bonds. The main target is to preserve something similar to a realistic correlation structure within the returns. What would be a good way to go about it? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first idea was to estimate the correlation between the classes, draw multivariate normal returns (yes, I know, but if you have better ideas, I'd like to hear them) based on historical mean, sd and correlation, and then replicate the two baseline return series with random errors, say something like (pseudo R code, I think it's clear what I mean)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;require(mnormt)&#xA;n &amp;lt;- 100 # number of assets&#xA;m &amp;lt;- 1000 # days of simulated data&#xA;means &amp;lt;- apply(cbind(equity,bond),2,mean)&#xA;Sigma &amp;lt;- cov(cbind(equity,bond))&#xA;sim.returns &amp;lt;- rmnorm(1000,means,Sigma)&#xA;sim.equities &amp;lt;- matrix(sim.returns[,&quot;equity&quot;]*rnorm(m*n,mean=1,sd=0.5),ncol=n)&#xA;sim.bonds &amp;lt;- matrix(sim.returns[,&quot;bond&quot;]*rnorm(m*n,mean=1,sd=0.2),ncol=n)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any suggestions, improvements or other comments wellcome - how would you do it, or do it better?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: This is were I am now (as of 2011-04-29):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;require(quantmod)&#xA;rets.dax &amp;lt;- dailyReturn(GDAXI)&#xA;(DBCNumber &amp;lt;- 100)&#xA;(DBCNames &amp;lt;- as.character(paste(&quot;DBC&quot;,1:DBCNumber,sep=&quot;_&quot;)))&#xA;(DBCBetas &amp;lt;- runif(DBCNumber, min=0.8,max=1.5)) # seeding Betas&#xA;DBCErrors &amp;lt;- matrix(rnorm(nrow(rets.dax)*DBCNumber,sd=0.01),ncol=DBCNumber) #seeding errors&#xA;DBCReturns &amp;lt;- matrix(rep(NA,nrow(rets.dax)*DBCNumber),ncol=DBCNumber)&#xA;#simulating returns with the betas and errors&#xA;for(i in 1:DBCNumber){DBCReturns[,i] &amp;lt;- rets.dax*DBCBetas[i]+DBCErrors[,i]} &#xA;DBCReturns &amp;lt;- xts(DBCReturns,order.by=index(rets.dax))&#xA;colnames(DBCReturns) &amp;lt;- DBCNames&#xA;DBCIndizes &amp;lt;- xts(apply(DBCReturns+1,2,cumprod),order.by=index(rets.dax)) #calculating prices&#xA;&#xA;cols &amp;lt;- heat.colors(DBCNumber)&#xA;chart.RelativePerformance(DBCReturns,rets.dax,colorset=cols, lwd=1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am quite happy now with the equity returns, but do you have suggestions for bond returns (data sources, can I copy the approach from equities?)&lt;/p&gt;&#xA;" OwnerUserId="357" LastEditorUserId="357" LastEditDate="2011-04-29T08:11:21.467" LastActivityDate="2020-01-09T10:45:16.797" Title="Simulating Returns" Tags="&lt;correlation&gt;&lt;r&gt;&lt;simulations&gt;" AnswerCount="3" CommentCount="8" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1019" PostTypeId="1" AcceptedAnswerId="2631" CreationDate="2011-04-20T15:23:26.277" Score="14" ViewCount="1145" Body="&lt;p&gt;The question is inspired by a short passage on the LMM in &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/143821703X&quot;&gt;Mark Joshi's book&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The LMM cannot be truly Markovian in the underlying Brownian motions due to the presence of state-dependent drifts. Nevertheless, the drifts can be approximated 'in a Markovian way' by using predictor-corrector schemes  to make the rates functions of the underlying increments across a single step.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ignoring the drifts, the LMM would be Markovian in the underlying Brownian motions if the volatility function is separable. The  volatility function $\sigma_i(t)$ is called separable if it can be factored as follows&#xA;$$\sigma_i(t)=v_i\times\nu(t),$$&#xA;where $v_i$ is a LIBOR specific scalar and $\nu(t)$ is a deterministic function which is the same across all LIBOR rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Questions.&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The separability condition above is &lt;em&gt;sufficient&lt;/em&gt; for the LMM to be Markovian in the Brownian motion. How far is it from being a &lt;em&gt;necessary&lt;/em&gt; one?&lt;/li&gt;&#xA;&lt;li&gt;What is the intuition behind the separability condition?&lt;/li&gt;&#xA;&lt;li&gt;Are there any weaker sufficient conditions?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="70" LastActivityDate="2011-12-20T19:44:05.337" Title="When is the LIBOR market model Markovian?" Tags="&lt;interest-rates&gt;&lt;lmm&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1020" PostTypeId="1" AcceptedAnswerId="1704" CreationDate="2011-04-20T18:54:46.220" Score="14" ViewCount="4760" Body="&lt;p&gt;I'm trying to build a simple risk model for stocks using PCA.  I've noticed that when my dimensions are larger than the number of observations (for example 1000 stocks but only 250 days of returns), then the resulting transformed return series (returns rotated by eigenvectors or factor returns) have non-zero correlation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuitively, I can see why this might be, since in the pca process I am estimating a 1000x1000 covariance matrix from 250x1000 observations.  So it is like an underdetermined system.  But I'm not exactly sure what's going on.  Can someone explain what is happening?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, for risk model purposes, is it better to assume a diagonal covariance matrix or use the sample covariance of the factors?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is some matlab code to demonstrate the problem:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% More observation than dimensions&#xA;Nstock = 10;&#xA;Nobs = 11;&#xA;obs = randn(Nobs, Nstock);&#xA;rot = princomp(obs);&#xA;rotobs = obs * rot;&#xA;corr(rotobs) % off diagonals are all zero&#xA;&#xA;% More dimensions that observations&#xA;Nstock = 10;&#xA;Nobs = 9;&#xA;obs = randn(Nobs, Nstock);&#xA;rot = princomp(obs);&#xA;rotobs = obs * rot;&#xA;corr(rotobs) % some off diagonals are non-zero&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="443" LastActivityDate="2019-11-13T00:44:18.067" Title="Equity Risk Model Using PCA" Tags="&lt;risk&gt;&lt;pca&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="1021" PostTypeId="2" ParentId="1019" CreationDate="2011-04-20T20:09:55.750" Score="5" Body="&lt;p&gt;Re 2: It's a mathematical trick. Insisting on the separability of volatility function makes LMM useless. Its power lies in its powerful calibration abilities. If you constrain the vol function to separable form, you throw that ability out of the window. You might just as well use LGM then, and it will be more intuitive and faster.&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2011-04-20T20:09:55.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1022" PostTypeId="2" ParentId="1020" CreationDate="2011-04-21T08:04:00.580" Score="8" Body="&lt;p&gt;About a year ago I saw a presentation by Attilio Meucci in London. The twist of his work is a little bit different compared to yours but the general approach is similar and there is lot to be learned from his accompanying paper:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1358533&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1358533&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here he is also using PCA for dimensionality reduction constructing what he calls principal portfolios. He also shares fully documented code in MATLAB.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2011-04-21T14:37:59.097" LastActivityDate="2011-04-21T14:37:59.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1023" PostTypeId="2" ParentId="1017" CreationDate="2011-04-21T13:33:08.283" Score="3" Body="&lt;p&gt;They essentially perform the same function, but CTM is newer (Oasys Global is being retired at the end of 2012). According to Omgeo's FAQ:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What is the difference between this [CTM] workflow and the OASYS Global Contract-Level&#xA;workflow?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The OASYS Global Contract Level workflow requires investment managers and broker/dealers to&#xA;send and receive allocations manually, often times in an un-automated and non-standard means.&#xA;These allocations are matched, locally, by both parties. This new workflow looks to automate the allocation piece so both sides can code to a standard message format and centrally match the transactions. Both parties can also proactively manage exceptions and view the status of the allocations as they go through the matching process.&lt;/p&gt;&#xA;" OwnerUserId="779" LastActivityDate="2011-04-21T13:33:08.283" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1024" PostTypeId="2" ParentId="1018" CreationDate="2011-04-21T14:11:27.470" Score="4" Body="&lt;p&gt;I have a few thoughts, but no real answers :).&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;You take the returns from the DAX, which isn't normal, then make it normal and apply normal noise to it. It seems that you could be slightly better off just applying the noise to the original, non-normalized DAX.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Have you considered the t-distribution? There are multivariate t-distribution packages in R (e.g., &lt;a href=&quot;http://cran.r-project.org/web/packages/mnormt/index.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;mnormt&lt;/code&gt;&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The normal, skinny tails really show in the plot. I would expect that a few should have huge returns or losses.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;From this I have two suggestions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Why not just pull down real stock data from Yahoo via &lt;code&gt;QuantMod&lt;/code&gt;? Do any of the packages have scripts for pulling all tickers?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Why not assign a $\beta$ to each simulated equity (and bond)? As long as the $\beta$s sum to one, it should be OK (although then you'll be vulnerable to your assumptions about the distribution of $\beta$ -- using real data frees you of this, although even then you're vulnerable to time period).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-04-21T14:11:27.470" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1025" PostTypeId="1" AcceptedAnswerId="1026" CreationDate="2011-04-21T18:38:18.533" Score="7" ViewCount="337" Body="&lt;p&gt;I have a trading system I would like to test for the S&amp;amp;P 500, or another very similar instrument. I'm looking to make approximately 10-15 trades per month. I know if you have a Vanguard account, you can trade their ETFs for no commission, but them limit you to 25 trades in a 12 month period.  Are there any other brokerage that let you trade certain instruments without paying a comission?&lt;/p&gt;&#xA;" OwnerUserId="500" LastActivityDate="2011-04-26T00:29:22.387" Title="Maximum friction-free trades" Tags="&lt;trading-systems&gt;&lt;friction&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1026" PostTypeId="2" ParentId="1025" CreationDate="2011-04-21T19:17:49.267" Score="3" Body="&lt;p&gt;Take a look at Schwab:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.schwab.com/public/schwab/investment_products/etfs/schwab_etfs&quot; rel=&quot;nofollow&quot;&gt;http://www.schwab.com/public/schwab/investment_products/etfs/schwab_etfs&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.schwab.com/public/schwab/investment_products/mutual_funds/no_fee_funds.html&quot; rel=&quot;nofollow&quot;&gt;http://www.schwab.com/public/schwab/investment_products/mutual_funds/no_fee_funds.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pro-funds ========:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.profunds.com/overview/content/faqs.html&quot; rel=&quot;nofollow&quot;&gt;http://www.profunds.com/overview/content/faqs.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.proshares.com/faqs/&quot; rel=&quot;nofollow&quot;&gt;http://www.proshares.com/faqs/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rydex ========:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.rydex-sgi.com/products/mutual_funds/home/mf_home.rails&quot; rel=&quot;nofollow&quot;&gt;http://www.rydex-sgi.com/products/mutual_funds/home/mf_home.rails&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.rydex-sgi.com/products/etfs/home/etf_home.rails&quot; rel=&quot;nofollow&quot;&gt;http://www.rydex-sgi.com/products/etfs/home/etf_home.rails&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="392" LastActivityDate="2011-04-21T19:17:49.267" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1027" PostTypeId="1" AcceptedAnswerId="1038" CreationDate="2011-04-21T21:18:19.987" Score="58" ViewCount="26023" Body="&lt;p&gt;In what ways (and under what circumstances) are correlation and cointegration related, if at all?  One difference is that one usually thinks of correlation in terms of returns and cointegration in terms of price.  Another issue is the different measures of correlation (Pearson, Spearman, distance/Brownian) and cointegration (Engle/Granger and Phillips/Ouliaris).&lt;/p&gt;&#xA;" OwnerUserId="56" LastEditorUserId="1106" LastEditDate="2011-10-18T20:41:30.100" LastActivityDate="2021-04-18T20:38:26.980" Title="How are correlation and cointegration related?" Tags="&lt;time-series&gt;&lt;statistics&gt;&lt;correlation&gt;&lt;cointegration&gt;" AnswerCount="6" CommentCount="3" FavoriteCount="61" ContentLicense="CC BY-SA 3.0" />
  <row Id="1028" PostTypeId="2" ParentId="1025" CreationDate="2011-04-22T01:26:44.273" Score="4" Body="&lt;p&gt;&lt;a href=&quot;http://www.mebanefaber.com/2011/04/20/four-commission-free-portfolios-for-20-bps/&quot; rel=&quot;nofollow&quot;&gt;Here's&lt;/a&gt; a rundown of the various commission-free options out there. Doesn't give any info on maximum number of trades but that shouldn't be very hard to find on the providers' websites.&lt;/p&gt;&#xA;" OwnerUserId="352" LastActivityDate="2011-04-22T01:26:44.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1029" PostTypeId="1" CreationDate="2011-04-22T05:04:26.230" Score="16" ViewCount="6045" Body="&lt;p&gt;I know there are similar questions but I don't think there are any identical ones.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, I'm looking for one of these two things.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Delayed market data feed. A tick by tick feed, but delayed by anything between 0 and 30 minutes. So at 12:30pm I'd be able to get a quote for 12:00pm, but at a tick-by-tick or millisecond resolution.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Market history snapshot. Being able to ask &quot;What was the price of this stock at 12:30:02.35 last Tuesday?&quot;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Either way, the resolution is very important, but when I actually get the data is not &lt;em&gt;as&lt;/em&gt; important. Even something as inaccurate as Google Finance, but I'm looking to use it, download/scrape it, store it, and maybe even distribute it.&lt;/p&gt;&#xA;" OwnerUserId="784" LastActivityDate="2014-01-09T21:37:21.733" Title="Free market data (delayed or snapshot)" Tags="&lt;data&gt;&lt;automated-trading&gt;&lt;market-data&gt;" AnswerCount="3" CommentCount="7" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="1030" PostTypeId="2" ParentId="1027" CreationDate="2011-04-22T13:18:50.430" Score="13" Body="&lt;p&gt;From Quantitative Trading by Ernie Chan :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Correlation between two price series actually refers to the correlations of their returns over some time horizon (for concreteness, let's say a day). If two stocks are positively correlated, there is a good chance that their prices will move in the same direction most days. However, having a positive correlation does not say anything about the long-term behavior of the two stocks. In particular, it doesn't guarantee that the stock prices will not grow farther and farther apart in the long run even if they do move in the same direction most days. However, if two stocks were cointegrated and remain so in the future, their prices (weighted appropriately) will be unlikely to diverge. Yet their daily (or weekly, or any other time horizon) returns may be quite uncorrelated.&quot;&lt;/p&gt;&#xA;" OwnerUserId="785" LastActivityDate="2011-04-22T13:18:50.430" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1031" PostTypeId="1" AcceptedAnswerId="1032" CreationDate="2011-04-22T14:54:35.453" Score="14" ViewCount="6101" Body="&lt;p&gt;Using total return calculations is critical in developing security selection models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The standard way to measure total return is to develop a series of price-adjusted data. Investopedia describes the standard method here:&#xA;&lt;a href=&quot;http://www.investopedia.com/ask/answers/06/adjustedclosingprice.asp&quot;&gt;http://www.investopedia.com/ask/answers/06/adjustedclosingprice.asp&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially, capital distributions/dividends to investors are deducted from the historical close price series. When calculating the return over the holding period using this series: $r(t) = \frac{P(t) - P(t-1)}{P(t-1)}$, you are calculating the actual profit/loss return including dividend distributions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it's possible that the dividend adjustment will cause some adjusted historical prices to go below zero. For example, consider Avis adjusted close prices in 2003. The adjusted close price in May 2003 is about -$\$1.5$. The adjusted close price a year later is $\$80$. This is a considerable return. However, when calculating the return $\frac{85 - (-1.5)}{-1.5}$ a negative return is produced because of the denominator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One approach would be to &quot;forward adjust&quot; dividend adjustments as opposed to deducting dividends paid on the prior series. But then the forward-adjusted close prices would not match prices traded on the exchange (complicating trade execution, etc.). Another approach is to shift the -$\$1.5$ and $\$85$ above the zero line some arbitrary amount. This diminishes the actual return the farther up the number line the two price points are shifted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yahoo calculated dividends adjustments on a percentage basis, not on a absolo&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions on how to solve this problem?&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="106" LastEditDate="2011-04-22T15:33:50.923" LastActivityDate="2018-05-30T19:30:27.640" Title="Total Return measurement paradox w/ Adjusted Close Prices" Tags="&lt;adjustments&gt;&lt;total&gt;&lt;return&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="1032" PostTypeId="2" ParentId="1031" CreationDate="2011-04-22T17:22:19.207" Score="6" Body="&lt;p&gt;&lt;strong&gt;Don't subtract dividends; add them.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Add-back the dividends as if they had not been paid out. That will ensure that you have a positive price when deriving the returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, MSFT paid a 0.16 dividend on 2011-15-02. Here are the raw prices, according to Yahoo:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;date       close&#xA;----------------&#xA;2011.02.01 27.99&#xA;2011.02.02 27.94&#xA;2011.02.03 27.65&#xA;2011.02.04 27.77&#xA;2011.02.07 28.2 &#xA;2011.02.08 28.28&#xA;2011.02.09 27.97&#xA;2011.02.10 27.5 &#xA;2011.02.11 27.25&#xA;2011.02.14 27.23&#xA;----------------    &amp;lt;- dividend was paid here&#xA;2011.02.15 26.96&#xA;2011.02.16 27.02&#xA;2011.02.17 27.21&#xA;2011.02.18 27.06&#xA;2011.02.22 26.59&#xA;2011.02.23 26.59&#xA;2011.02.24 26.77&#xA;2011.02.25 26.55&#xA;2011.02.28 26.58&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Yahoo's own adjustment is to &lt;em&gt;subtract&lt;/em&gt; the dividend for all dates prior to the payment, exactly as your question states. But if all you want is the return, then &lt;em&gt;add-back&lt;/em&gt; the dividend after the payment. Thus, we have:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;date       close&#xA;----------------&#xA;2011.02.01 27.99&#xA;2011.02.02 27.94&#xA;2011.02.03 27.65&#xA;2011.02.04 27.77&#xA;2011.02.07 28.2 &#xA;2011.02.08 28.28&#xA;2011.02.09 27.97&#xA;2011.02.10 27.5 &#xA;2011.02.11 27.25&#xA;2011.02.14 27.23&#xA;----------------    &amp;lt;- add-back dividend&#xA;2011.02.15 27.12&#xA;2011.02.16 27.18&#xA;2011.02.17 27.37&#xA;2011.02.18 27.22&#xA;2011.02.22 26.75&#xA;2011.02.23 26.75&#xA;2011.02.24 26.93&#xA;2011.02.25 26.71&#xA;2011.02.28 26.74&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The return calculations won't match Yahoo's exactly. Yahoo's adjusted first and last price are 27.83 and 26.58, for a return of -4.49%, whereas the return from my adjusted prices above is -4.47%. But my returns are guaranteed to be more sensible simply because I know there will never be a negative price.&lt;/p&gt;&#xA;" OwnerUserId="35" LastEditorUserId="35" LastEditDate="2011-04-22T17:55:01.483" LastActivityDate="2011-04-22T17:55:01.483" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1033" PostTypeId="2" ParentId="1031" CreationDate="2011-04-22T17:42:46.967" Score="3" Body="&lt;p&gt;The problem is, you're calculating the &quot;return on investment&quot; or &quot;return on original investment&quot;.   Anytime you are given back ALL or MORE THAN your original investment, you are no longer &quot;invested&quot;.  As a result, calculating &quot;return on investment&quot; no longer applies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example with a 100% return of capital, the &quot;original investment&quot; drops to zero.   So, the return on &quot;investment&quot; is infinity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another example is a merger/restructuring, where you get back more than all of your original investment.  Your &quot;investment&quot; is negative (someone gave you the money to invest rather than you giving them the money to invest), so your return on &quot;investment&quot; is now negative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice that it doesn't matter whether you calculate the series forward or backward, a 100% return of capital situation provides an infinite return.   And, when you are given back more than you invested, your return is negative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One solution would be to check to see if the original investment is less than or equal to zero.  If so, then flag the result accordingly.&lt;/p&gt;&#xA;" OwnerUserId="392" LastEditorUserId="392" LastEditDate="2011-04-22T17:50:17.820" LastActivityDate="2011-04-22T17:50:17.820" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1034" PostTypeId="2" ParentId="946" CreationDate="2011-04-22T21:45:05.407" Score="20" Body="&lt;p&gt;Being short gamma simply means that you are short options regardless of whether they are puts or calls.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most common type of investor that is willing to be short gamma is someone who sells options, also known as a premium collector.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These investors commonly use strategies such as short puts, covered calls, iron condors, vertical credit spreads,  and a few others.&lt;br&gt;&#xA;These strategies are typically referred to as income generation strategies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They offer the investor a return known in advance, in exchange for the risk of being short options.  Frequently these types of income trades have have a probability of success over 80%.  Clearly there is significant risk associated with a probability of success that high, so approach with caution.&lt;/p&gt;&#xA;" OwnerUserId="214" LastEditorUserId="214" LastEditDate="2011-04-22T21:50:12.283" LastActivityDate="2011-04-22T21:50:12.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1035" PostTypeId="2" ParentId="1029" CreationDate="2011-04-22T22:09:44.483" Score="8" Body="&lt;p&gt;&lt;strong&gt;OpenTick&lt;/strong&gt; used to have this... alas they are no more.&#xA;But here's a link to some decent alternatives.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://blog.fosstrading.com/2009/11/opentick-alternatives.html&quot; rel=&quot;noreferrer&quot;&gt;http://blog.fosstrading.com/2009/11/opentick-alternatives.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some have free data options, but I don't believe that any include tick level data for free.&#xA;If you are in school and have access to WRDS you can get the TAQ (NASDAQ trade and quotes) which is quite verbose tick data, but you can't redistribute it, nor can you use it for a commercial enterprise.&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-04-22T22:09:44.483" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1036" PostTypeId="2" ParentId="1031" CreationDate="2011-04-23T00:13:37.043" Score="4" Body="&lt;p&gt;I think the answer is in your question.  Yahoo uses a percentage adjustment for adjusted close prices.  So this is the procedure I would do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Calculate the proper return for each day (taking into account splits and divs).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Apply the returns going backwards from the current price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By doing it this way it is impossible to get a negative adjusted price, and taking the return from any period to any other period will equal the cumulative return over that period.  I believe yahoo does something like this because I've never seen a negative adj close.  I'm not positive about that though.&lt;/p&gt;&#xA;" OwnerUserId="443" LastActivityDate="2011-04-23T00:13:37.043" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1038" PostTypeId="2" ParentId="1027" CreationDate="2011-04-23T23:08:09.530" Score="43" Body="&lt;p&gt;This isn't really an answer, but it's too long to add as a comment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've always had a real problem with the correlation/covariance of &lt;strong&gt;price&lt;/strong&gt;.   To me, it means nothing.   I realize that it gets used (abused) in many contexts, but I just don't get anything out of it (over time, price has to generally go up, go down, or go sideways, so aren't all prices &quot;correlated&quot;?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the flip side, correlation/covariance of &lt;strong&gt;returns&lt;/strong&gt; makes sense.   You're dealing with random series, not integrated random series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, below is the code required to generate two price series that have correlated &lt;strong&gt;returns&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A typical plot is shown below.   In general, when the red series goes up, the blue series is likely to go up.    If you run this code over and over, you'll get a feel for &quot;correlated returns&quot;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; library(MASS)   &#xA;&#xA; #The input data     &#xA; numpoi &amp;lt;- 1000  #Number of points to generate     &#xA; meax &amp;lt;- 0.0002  #Mean for x     &#xA; stax &amp;lt;- 0.010   #Standard deviation for x     &#xA; meay &amp;lt;- 0.0002  #Mean for y     &#xA; stay &amp;lt;- 0.005   #Standard deviation for y     &#xA; corxy &amp;lt;- 0.8    #Correlation coeficient for xy     &#xA;&#xA; #Build the covariance matrix and generate the correlated random results     &#xA; (covmat &amp;lt;- matrix(c(stax^2, corxy*stax*stay, corxy*stax*stay, stay^2), nrow=2))     &#xA; res &amp;lt;- mvrnorm(numpoi, c(meax, meay), covmat)     &#xA; plot(res[,1], res[,2])     &#xA;&#xA; #Calculate the stats of res[] so they can be checked with the input data     &#xA; mean(res[,1])     &#xA; sd(res[,1])     &#xA; mean(res[,2])     &#xA; sd(res[,2])     &#xA; cor(res[,1], res[,2])     &#xA;&#xA; #Plot the two price series that have correlated returns      &#xA; plot(exp(cumsum(res[,1])), main=&quot;Two Price Series with Correlated Returns&quot;, ylab=&quot;Price&quot;, type=&quot;l&quot;, col=&quot;red&quot;)      &#xA; lines(exp(cumsum(res[,2])), col=&quot;blue&quot;)     &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/UwOAL.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I try to generate correlated &lt;strong&gt;prices (not returns)&lt;/strong&gt;, I'm stumped.   The only techniques that I am aware of deal with &lt;strong&gt;random normally distributed&lt;/strong&gt; inputs, not &lt;strong&gt;integrated inputs&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, my question is, does anyone know how to generate &lt;strong&gt;correlated prices&lt;/strong&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm out of time, so I'll have to add my cointegration comments later.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit 1 (04/24/2011) ================================================&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above deals with the &lt;strong&gt;correlation of returns&lt;/strong&gt;, but as implied in the original question, in the real world it looks like &lt;strong&gt;correlation of prices&lt;/strong&gt; is a more important issue.   After all, even if the returns are correlated, if the two price series drift apart over time, my pairs trade is going to screw me.  That's where co-integration comes in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I look up &quot;co-integration&quot;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Cointegration&quot; rel=&quot;noreferrer&quot;&gt;http://en.wikipedia.org/wiki/Cointegration&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get something like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;....If two or more series are individually integrated (in the time series sense) but some linear combination of them has a lower order of integration, then the series are said to be cointegrated....&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What does that mean?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need some code so I can screw around with things to make that definition meaningful.   Here's my stab at a very simple version of co-integration.  I'll use the same input data as in the code above.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#The input data  &#xA;numpoi &amp;lt;- 1000    #Number of data points  &#xA;meax &amp;lt;- 0.0002    #Mean for x  &#xA;stax &amp;lt;- 0.0100    #Standard deviation for x  &#xA;meay &amp;lt;- 0.0002    #Mean for y  &#xA;stay &amp;lt;- 0.0050    #Standard deviation for y  &#xA;coex &amp;lt;- 0.0200    #Co-integration coefficient for x  &#xA;coey &amp;lt;- 0.0200    #Co-integration coefficient for y  &#xA;&#xA;#Generate the noise terms for x and y  &#xA;ranx &amp;lt;- rnorm(numpoi, mean=meax, sd=stax) #White noise for x  &#xA;rany &amp;lt;- rnorm(numpoi, mean=meay, sd=stay) #White noise for y  &#xA;&#xA;#Generate the co-integrated series x and y  &#xA;x &amp;lt;- numeric(numpoi)  &#xA;y &amp;lt;- numeric(numpoi)  &#xA;x[1] &amp;lt;- 0  &#xA;y[1] &amp;lt;- 0  &#xA;for (i in 2:numpoi) {  &#xA;  x[i] &amp;lt;- x[i-1] + (coex * (y[i-1] - x[i-1])) + ranx[i-1]  &#xA;  y[i] &amp;lt;- y[i-1] + (coey * (x[i-1] - y[i-1])) + rany[i-1]  &#xA;}  &#xA;&#xA;#Plot x and y as prices  &#xA;ylim &amp;lt;- range(exp(x), exp(y))  &#xA;plot(exp(x), ylim=ylim, type=&quot;l&quot;, main=paste(&quot;Co-integrated Pair (coex=&quot;,coex,&quot;,  coey=&quot;,coey,&quot;)&quot;, sep=&quot;&quot;), ylab=&quot;Price&quot;, col=&quot;red&quot;)  &#xA;lines(exp(y), col=&quot;blue&quot;)  &#xA;legend(&quot;bottomleft&quot;, c(&quot;exp(x)&quot;, &quot;exp(y)&quot;), lty=c(1, 1), col=c(&quot;red&quot;, &quot;blue&quot;), bg=&quot;white&quot;)  &#xA;&#xA;#Calculate the correlation of the returns.  &#xA;#Notice that for reasonable coex and coey values,  &#xA;#the correlation of dx and dy is dominated by  &#xA;#the spurious correlation of ranx and rany  &#xA;dx &amp;lt;- diff(x)  &#xA;dy &amp;lt;- diff(y)  &#xA;plot(dx, dy)  &#xA;cor(dx, dy)  &#xA;cor(ranx, rany)  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ggT6m.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice above, that the &quot;co-integration term&quot; for x and y shows up inside the &quot;for loop&quot;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x[i] &amp;lt;- x[i-1] + (coex * (y[i-1] - x[i-1])) + ranx[i-1]  &#xA;y[i] &amp;lt;- y[i-1] + (coey * (x[i-1] - y[i-1])) + rany[i-1]  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A positive &lt;code&gt;coex&lt;/code&gt; determines how fast &lt;code&gt;x&lt;/code&gt; will try to reduce the spread with &lt;code&gt;y&lt;/code&gt;.  Likewise, a positive &lt;code&gt;coey&lt;/code&gt; determines how fast &lt;code&gt;y&lt;/code&gt; will try to reduce the spread with &lt;code&gt;x&lt;/code&gt;.  You can tweak these values to generate all sorts of plots to see how those co-integration terms &lt;code&gt;(y[i-1] - x[i-1])&lt;/code&gt; and &lt;code&gt;(x[i-1] - y[i-1])&lt;/code&gt; work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After you've played with this a while, notice that it doesn't really answer the &lt;strong&gt;correlation of prices&lt;/strong&gt; issue.  It replaces it.  So, am I now off-the-hook for the correlation of prices issue?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;=========================================================&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously, now it's time to put the two concepts together to get a model that is in the ballpark with pairs trading.   Below is the code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(MASS)  &#xA;&#xA;#The input data  &#xA;numpoi &amp;lt;- 1000    #Number of data points  &#xA;meax &amp;lt;- 0.0002    #Mean for x  &#xA;stax &amp;lt;- 0.0100    #Standard deviation for x  &#xA;meay &amp;lt;- 0.0002    #Mean for y  &#xA;stay &amp;lt;- 0.0050    #Standard deviation for y  &#xA;coex &amp;lt;- 0.0200    #Co-integration coefficient for x  &#xA;coey &amp;lt;- 0.0200    #Co-integration coefficient for y  &#xA;corxy &amp;lt;- 0.800    #Correlation coeficient for xy  &#xA;&#xA;#Build the covariance matrix and generate the correlated random results  &#xA;(covmat &amp;lt;- matrix(c(stax^2, corxy*stax*stay, corxy*stax*stay, stay^2), nrow=2))  &#xA;res &amp;lt;- mvrnorm(numpoi, c(meax, meay), covmat)  &#xA;&#xA;#Generate the co-integrated series x and y  &#xA;x &amp;lt;- numeric(numpoi)  &#xA;y &amp;lt;- numeric(numpoi)  &#xA;x[1] &amp;lt;- 0  &#xA;y[1] &amp;lt;- 0  &#xA;for (i in 2:numpoi) {  &#xA;  x[i] &amp;lt;- x[i-1] + (coex * (y[i-1] - x[i-1])) + res[i-1, 1]  &#xA;  y[i] &amp;lt;- y[i-1] + (coey * (x[i-1] - y[i-1])) + res[i-1, 2]  &#xA;}  &#xA;&#xA;#Plot x and y as prices  &#xA;ylim &amp;lt;- range(exp(x), exp(y))  &#xA;plot(exp(x), ylim=ylim, type=&quot;l&quot;, main=paste(&quot;Co-integrated Pair with Correlated Returns (coex=&quot;,coex,&quot;,  coey=&quot;,coey,&quot;)&quot;, sep=&quot;&quot;), ylab=&quot;Price&quot;, col=&quot;red&quot;)  &#xA;lines(exp(y), col=&quot;blue&quot;)  &#xA;legend(&quot;bottomleft&quot;, c(&quot;exp(x)&quot;, &quot;exp(y)&quot;), lty=c(1, 1), col=c(&quot;red&quot;, &quot;blue&quot;), bg=&quot;white&quot;)  &#xA;&#xA;#Calculate the correlation of the returns.  &#xA;#Notice that for reasonable coex and coey values,  &#xA;#the correlation of dx and dy is dominated by  &#xA;#the correlation of res[,1] and res[,2]  &#xA;dx &amp;lt;- diff(x)  &#xA;dy &amp;lt;- diff(y)  &#xA;plot(dx, dy)  &#xA;cor(dx, dy)  &#xA;cor(res[, 1], res[, 2])  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ChLpE.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can play around with the parameters and generate all sorts of combinations.  Notice that even though these series consistently reduce the spread, you can't predict &lt;strong&gt;how or when&lt;/strong&gt; the spread will be reduced.  That's just one reason why pairs-trading is so much fun. The bottom line is, to get in the ballpark with modeling pairs-trading, it requires &lt;strong&gt;both correlated returns and co-integration&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A typical example.  Exxon (XOM) versus Chevron (CVX), where the above model applies if some additional terms are added.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://finance.yahoo.com/q/bc?s=XOM&amp;amp;t=5y&amp;amp;l=on&amp;amp;z=l&amp;amp;q=l&amp;amp;c=cvx&quot; rel=&quot;noreferrer&quot;&gt;http://finance.yahoo.com/q/bc?s=XOM&amp;amp;t=5y&amp;amp;l=on&amp;amp;z=l&amp;amp;q=l&amp;amp;c=cvx&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, to answer your question (as just my opinion), price correlation is typically used/abused as an attempt to deal with the longer term divergence/closeness of the paths of the series, when co-integration is what should be used.  It is the co-integration terms that limit the drift between the series.  Price correlation has no real meaning.  Correlation of the returns of the series determine the short term similarity of the series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did this in a hurry, so if anyone sees an error, don't be afraid to point it out.&lt;/p&gt;&#xA;" OwnerUserId="392" LastEditorUserId="392" LastEditDate="2011-04-25T03:05:52.050" LastActivityDate="2011-04-25T03:05:52.050" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1039" PostTypeId="1" CreationDate="2011-04-24T01:34:50.277" Score="9" ViewCount="9845" Body="&lt;p&gt;I've read documents that claim that SWIFT and FIX are &lt;strong&gt;not competing protocols&lt;/strong&gt; for financial transactions and messaging. And yet, &lt;strong&gt;I have not come across a clear articulation of when to use SWIFT versus FIX&lt;/strong&gt;. For example, I know that FIX can be used for most &lt;strong&gt;trading activities&lt;/strong&gt;, e.g. getting a quote, placing an order, canceling an order, getting settlement instructions, managing positions, etc. And I was under the impression that SWIFT is primary for accomplishing electronic wire transfers of money between financial institutions, e.g. as part of the &lt;strong&gt;trade settlement process&lt;/strong&gt;. However, now I'm told that SWIFT can also be used to handle rolls and closeouts. Am I right in thinking that there's a significant overlap in terms of the domains covered by the two protocols? Would anyone care to take a crack at clarifying?&lt;/p&gt;&#xA;" OwnerUserId="772" LastActivityDate="2016-04-14T15:28:37.393" Title="When should we use SWIFT versus FIX?" Tags="&lt;trading&gt;&lt;automated-trading&gt;&lt;fix&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1040" PostTypeId="2" ParentId="942" CreationDate="2011-04-24T05:27:00.743" Score="6" Body="&lt;p&gt;Yahoo data is not as clean as alternative data providers such as CSI. Some issues are: i) data for some tickers is missing, ii) incorrect data (rare but it does happen), iii) sometimes they fail to merge the price histories of firms that undergoe corporate actions (i.e. merger, acquisition, or changes in corporate headquarters).&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-08-18T21:53:53.970" LastActivityDate="2011-08-18T21:53:53.970" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1044" PostTypeId="2" ParentId="1017" CreationDate="2011-04-24T12:48:08.140" Score="2" Body="&lt;p&gt;I found this SEC article that attempts to clarify the distinction between trade affirmation and trade matching.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;The &lt;strong&gt;confirmation/affirmation process&lt;/strong&gt; refers to the transmission of messages among broker-dealers, institutional investors, and custodian banks regarding the terms of a trade executed for the institutional investor. Because the trades of institutional investors involve larger sums of money, larger amounts of securities, more parties, and more steps between order entry and final settlement, institutional trades are usually more complex than retail transactions.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;&lt;strong&gt;'Matching'&lt;/strong&gt; is the term that is used to describe the process whereby an intermediary compares the broker-dealer's trade data submission (step 2 of Figure 2) with the institution's allocation instructions (step 1 of Figure 2) to determine whether the two descriptions of the trade agree.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.sec.gov/rules/interp/34-39829.htm&quot; rel=&quot;nofollow&quot;&gt;http://www.sec.gov/rules/interp/34-39829.htm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="772" LastActivityDate="2011-04-24T12:48:08.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1045" PostTypeId="2" ParentId="1029" CreationDate="2011-04-24T21:57:56.153" Score="3" Body="&lt;p&gt;From what I saw, Google Finance only distributes weekly or daily data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to what you said in your comments, you are allowed to re-distribute those datasets, but I think this is the case only because the data is at &quot;low frequency&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't think you will be able to find a provider giving away free tick data, and there are for me two main reasons.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all, it is difficult to provide such dataset with enough reliability. Indeed, when you collect tick data, you get a lot of misprints from the exchanges and it is fairly difficult to remove them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, storing years of history of tick data would be very costly for your provider. I'll let you do the calculation, but I think that it is obvious that such database would need to be particularly powerful and would require a lot of labor for maintenance purposes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, during my master thesis, I argued that acquiring sufficient technology to work with high-frequency data generates a payoff in the market because you can find more ineffiencies than you would with larger data. Hence, those who have invested in such technology will most likely either keep it for themselves, or a least ask for a fee.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, you did not specify which assets you were looking for. I guess that some platforms might give you some tick data for free for &quot;common&quot; markets such as FX or maybe the S&amp;amp;P500, but I seriously doubt that you would be able to find even free intraday data for all the commodity futures for example.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2011-04-24T21:57:56.153" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1046" PostTypeId="2" ParentId="955" CreationDate="2011-04-24T22:11:46.463" Score="3" Body="&lt;p&gt;Check out the last chapter in Grinold's classic Active Portfolio Management (2nd Ed) for a discussion on separating luck from skill&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2011-04-24T22:11:46.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1047" PostTypeId="2" ParentId="1027" CreationDate="2011-04-25T10:56:25.677" Score="7" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Correlation between two financial time series should be calculated as correlation of the &lt;strong&gt;returns&lt;/strong&gt; (or log returns for prices). &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;There is absolutely no relationship between correlation of the returns and cointegration.&#xA;Two correlated time series can be cointegrated or not cointegrated.&#xA;Two cointegrated time series can be correlated or not correlated.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Everything else is spurious :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Sorry for this quick answer to an actually good question. They are definitely 2 different concepts. But that's true that they can be confused, because they seam to capture the same kind of things. For instance, one can do a portfolio allocation algorithm taking into account the correlation (VaR, CAPM), or the cointegration. In these examples, correlation and cointegration are 2 measures of risk/diversification. But they do not mean the same think. Taking only one of the 2 may lead to overestimate or underestimate the risk of the portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would say that in this example, correlation is more shorter term (risk over one day, one week, ...), whereas cointegration is more longer term, it is the risk that different assets move together in the long run. I would say that a good algorithm should have the 2 approaches to estimate correctly the diversification. See &lt;a href=&quot;http://www.carolalexander.org/publish/download/JournalArticles/PDFs/RIBF_16_65-90.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.carolalexander.org/publish/download/JournalArticles/PDFs/RIBF_16_65-90.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another example are markets that close at different time. If you look only at correlation of daily returns, you may find a weak correlation even though the markets move together.&lt;/p&gt;&#xA;" OwnerUserId="134" LastEditorUserId="134" LastEditDate="2011-04-27T07:57:21.207" LastActivityDate="2011-04-27T07:57:21.207" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1048" PostTypeId="1" CreationDate="2011-04-25T16:40:02.960" Score="19" ViewCount="3778" Body="&lt;p&gt;I plan to develop a neural network to trade commodities futures, but while messing around with some code, a question came up. If I understand correctly, people use various technical indicators with their networks (moving average, MACD, etc.). However, how do these come into play in a machine learning context? Should I just give the values of these functions as inputs, along with the actual data, for each point in time?&lt;/p&gt;&#xA;" OwnerUserId="798" LastEditorUserId="1106" LastEditDate="2011-09-27T03:12:25.397" LastActivityDate="2011-09-27T03:12:25.397" Title="How to incorporate technical indicators into neural networks?" Tags="&lt;futures&gt;&lt;machine-learning&gt;&lt;prediction&gt;&lt;indicator&gt;&lt;technicals&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="1049" PostTypeId="5" CreationDate="2011-04-25T23:09:15.467" Score="0" Body="&lt;p&gt;While frequently used as a buzzword to describe good ideas, most &quot;best practices&quot; actually help folks get the work done more reliably, efficiently and effectively than average. Please keep in mind that a &quot;best practice&quot; for one industry is not necessarily the best way to get the job done in another industry. &lt;/p&gt;&#xA;" OwnerUserId="126" LastEditorUserId="126" LastEditDate="2011-04-25T23:17:15.240" LastActivityDate="2011-04-25T23:17:15.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1050" PostTypeId="4" CreationDate="2011-04-25T23:09:15.467" Score="0" Body="A &quot;best practice&quot; is a method or process that practitioners recognize (usually through experience and research) as being more effective at getting the job done than other methods (or processes). " OwnerUserId="126" LastEditorUserId="126" LastEditDate="2011-04-25T23:17:10.870" LastActivityDate="2011-04-25T23:17:10.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1051" PostTypeId="1" CreationDate="2011-04-26T00:25:30.713" Score="10" ViewCount="19905" Body="&lt;p&gt;How can I find the delta of a convertible bond to be used for hedging?&lt;/p&gt;&#xA;" OwnerUserId="60" LastEditorUserId="467" LastEditDate="2011-12-28T00:41:45.293" LastActivityDate="2015-03-09T21:59:52.357" Title="How do I calculate the delta of a convertible bond?" Tags="&lt;delta-neutral&gt;&lt;convertible-bond&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1052" PostTypeId="2" ParentId="1025" CreationDate="2011-04-26T00:29:22.387" Score="3" Body="&lt;p&gt;I think you've misread the weasel words about Vanguard ETF trades: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;If you buy and sell &lt;strong&gt;the same&lt;/strong&gt; Vanguard ETF in a Vanguard Brokerage account more than 25 times in a 12-month period, you may be restricted from purchasing that Vanguard ETF through your Vanguard Brokerage account for 60 days.&lt;/em&gt;  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://personal.vanguard.com/us/whatweoffer/stocksbondscds/feescommissions&quot; rel=&quot;nofollow&quot;&gt;Source&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="126" LastActivityDate="2011-04-26T00:29:22.387" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1053" PostTypeId="2" ParentId="1048" CreationDate="2011-04-26T03:03:34.320" Score="8" Body="&lt;p&gt;The predictor variables would consist of the input layer to the neural network. The output layer would consist of your target. You need to specify the hidden layer, number of nodes per layer, the learning algorithm, and the learning algorithm stopping criteria. Typically inputs are normalized (first-differenced, z-scored, etc.) before inputting into the neural network so the model is training on relative changes as opposed to absolute levels. Neural networks have had mixed success in quant finance and in my view there are some more interesting non-parametric techniques worth looking at.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2011-04-26T03:03:34.320" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1054" PostTypeId="2" ParentId="1051" CreationDate="2011-04-26T05:00:34.267" Score="8" Body="&lt;p&gt;Well, it takes a little more information than you've provided, but here are links to a &lt;a href=&quot;http://www.nd.edu/~zda/TeachingNote_ConvertibleBonds.pdf&quot; rel=&quot;noreferrer&quot;&gt;pdf&lt;/a&gt; and associated &lt;a href=&quot;http://www.nd.edu/~zda/CBcalculator.xls&quot; rel=&quot;noreferrer&quot;&gt;excel spreadsheet&lt;/a&gt; that should help you answer your question. &lt;/p&gt;&#xA;" OwnerUserId="126" LastActivityDate="2011-04-26T05:00:34.267" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1055" PostTypeId="2" ParentId="1048" CreationDate="2011-04-26T09:51:12.417" Score="13" Body="&lt;p&gt;Most contemporary NN systems are just made to use the raw price time series for input (maybe with some kind of simple normalization), but for my thesis I wrote a system which traded equities with an ANN with technical indicator inputs (MAs, MACD, even pattern matching for stuff like Head-Shoulders, support levels, etc.). So at least conceptually it's definitely possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the most interesting systems I saw when researching for my thesis, which actually got a lot of impressive results as well, used technical indicators with genetic programming to create a kind of dynamic decision tree to generate buy/hold/sell ratings. If I was to get into AI algo trading again, that's probably the direction I'd focus towards.&lt;/p&gt;&#xA;" OwnerUserId="351" LastActivityDate="2011-04-26T09:51:12.417" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1056" PostTypeId="2" ParentId="1048" CreationDate="2011-04-26T11:39:57.547" Score="5" Body="&lt;p&gt;I will break up your question in to some parts to make answering easier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&quot;people use various economic indicators with their networks (moving average, MACD, etc.) However, how do these come into play in a NN context?&quot;&lt;/em&gt;--the 'indicators' MA, MACD etc. come from the data. They are measures of the data capturing some aspect. You could try to capture/replicate these measures within the NN. In a way, your NN is also an 'indicator'. You can have 'indicators' made up of smaller 'indicators'. A NN approximates a functional form that fits your input-to-output targets. It obtains a shape that you train it to on past data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&quot;Should I just give the values of these functions as inputs, along with the actual data, for each point in time?&quot;&lt;/em&gt;--yes. It is not straight forward though. a single perceptron (node) in the NN cannot handle a complex indicator's output even if it is scalar (1 dimensional but constraints usually appear alongside to work properly). The perceptron usually has a sigmoidal firing function, and many indicators require more sophisticated interpretations than a threshold bounding. It is context dependent without a general gauranteed solution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My advice is that since you say that you are starting in the AI field, make some NN to approximate the indicators first, and then experiment, and with something breaking down; ask again.&lt;/p&gt;&#xA;" OwnerUserId="803" LastActivityDate="2011-04-26T11:39:57.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1057" PostTypeId="5" CreationDate="2011-04-26T13:36:16.353" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2011-04-26T13:36:16.353" LastActivityDate="2011-04-26T13:36:16.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1058" PostTypeId="4" CreationDate="2011-04-26T13:36:16.353" Score="0" Body="The possibility that a negative event (such as a loss) will happen. " OwnerUserId="126" LastEditorUserId="126" LastEditDate="2011-04-26T13:37:45.317" LastActivityDate="2011-04-26T13:37:45.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1059" PostTypeId="5" CreationDate="2011-04-26T13:45:48.360" Score="0" Body="&lt;p&gt;Historic volatility is derived from time series of past market prices. An implied volatility is derived from the market price of a market traded derivative (in particular an option).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is common for discussions to talk about the volatility of a security's price, even while it is the returns' volatility that is being measured. It is used to quantify the risk of the financial instrument over the specified time period. Volatility is normally expressed in annualized terms, and it may either be an absolute number ($5) or a fraction of the mean (5%).&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-12-14T15:27:14.820" LastActivityDate="2011-12-14T15:27:14.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1060" PostTypeId="4" CreationDate="2011-04-26T13:45:48.360" Score="0" Body="A measure of the variation in price over time.  Also a measure of the risk of a financial instrument." OwnerUserId="126" LastEditorUserId="1106" LastEditDate="2011-12-14T15:27:14.833" LastActivityDate="2011-12-14T15:27:14.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1062" PostTypeId="2" ParentId="1051" CreationDate="2011-04-26T18:59:02.780" Score="5" Body="&lt;p&gt;Tangurena's answer and links give the right idea.  You can get a rough approximation by finding the &lt;em&gt;conversion price&lt;/em&gt; $K$ and using that $K$ as the strike in a standard Black-Scholes option pricer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, most people work with 3rd party models such as the ones built into Bloomberg, Monis, or Kynex. &lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-04-26T18:59:02.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1063" PostTypeId="5" CreationDate="2011-04-26T20:09:12.810" Score="0" Body="&lt;p&gt;In finance, an option is a contract which gives the buyer (the owner or holder) the right, but not the obligation, to buy or sell an underlying asset or instrument at a specified strike price on or before a specified date, depending on the form of the option. The strike price may be set by reference to the spot price (market price) of the underlying security or commodity on the day an option is taken out, or it may be fixed at a discount or at a premium. The seller has the corresponding obligation to fulfill the transaction – that is to sell or buy – if the buyer (owner) &quot;exercises&quot; the option. An option that conveys to the owner the right to buy something at a specific price is referred to as a call; an option that conveys the right of the owner to sell something at a specific price is referred to as a put. Both are commonly traded, but for clarity, the call option is more frequently discussed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The simplest option gives the holder the right to trade in the future at a previously agreed price but takes away the obligation. So if the stock falls, we don’t have to buy it after all.&#xA;The European option is one of the simplest options.Indeeda European-type call option on a security $S_t$ is the right to buy the security at a present strike price $K$. This right maybe exercised at the expiration date T of the option. The call option can be purchased for a price of Ct dollars,called the premium, at time $t &amp;lt; T$. A European put option is similar, but gives the owner the right to sell an asset at a specified price at expiration.In contrast to European options, American options can be exercised any time between the writing and the expiration of the contract.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several reasons that traders and investors may want to calculate the arbitrage-free price, $C_t$, of a call option Before the option is first written at time $t$,$C_t$ is not known. A trader may want to obtain some estimate of what this price will be if the option is written. If the option is an exchange-traded security, it will start trading and a market price will emerge. If the option trades over-the-counter, it may also trade heavily and a price can be observed.&lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastEditorDisplayName="user16891" LastEditDate="2015-07-25T12:25:34.267" LastActivityDate="2015-07-25T12:25:34.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1064" PostTypeId="4" CreationDate="2011-04-26T20:09:12.810" Score="0" Body="A contract that gives the owner the right, but not the obligation, to buy or sell a security at a fixed price in the future." OwnerUserId="126" LastEditorUserId="35" LastEditDate="2011-04-26T20:11:06.093" LastActivityDate="2011-04-26T20:11:06.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1065" PostTypeId="5" CreationDate="2011-04-26T23:13:40.597" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2011-04-26T23:13:40.597" LastActivityDate="2011-04-26T23:13:40.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1066" PostTypeId="4" CreationDate="2011-04-26T23:13:40.597" Score="0" Body="The process of determining the price - the value - of an asset." OwnerUserId="126" LastEditorUserId="126" LastEditDate="2011-04-27T00:58:56.080" LastActivityDate="2011-04-27T00:58:56.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1067" PostTypeId="5" CreationDate="2011-04-26T23:16:59.907" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2011-04-26T23:16:59.907" LastActivityDate="2011-04-26T23:16:59.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1068" PostTypeId="4" CreationDate="2011-04-26T23:16:59.907" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2011-04-26T23:16:59.907" LastActivityDate="2011-04-26T23:16:59.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1069" PostTypeId="5" CreationDate="2011-04-26T23:19:21.510" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://www.r-project.org&quot; rel=&quot;nofollow&quot;&gt;R&lt;/a&gt; is available on a wide variety of UNIX platforms, Windows and MacOS, and can be downloaded from &lt;a href=&quot;http://cran.r-project.org/&quot; rel=&quot;nofollow&quot;&gt;CRAN&lt;/a&gt;. It is an implementation of the S programming language combined with lexical scoping semantics inspired by Scheme. R was created by Ross Ihaka and Robert Gentleman and is now developed by the R Development Core Team. It is easily extended through a packaging system on &lt;a href=&quot;http://cran.r-project.org/&quot; rel=&quot;nofollow&quot;&gt;CRAN&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="126" LastEditorUserId="126" LastEditDate="2011-04-27T00:58:47.313" LastActivityDate="2011-04-27T00:58:47.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1070" PostTypeId="4" CreationDate="2011-04-26T23:19:21.510" Score="0" Body="An open source programming language and software environment for statistical computing and graphics." OwnerUserId="126" LastEditorUserId="1106" LastEditDate="2011-12-14T15:32:48.880" LastActivityDate="2011-12-14T15:32:48.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1071" PostTypeId="5" CreationDate="2011-04-26T23:22:30.477" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2011-04-26T23:22:30.477" LastActivityDate="2011-04-26T23:22:30.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1072" PostTypeId="4" CreationDate="2011-04-26T23:22:30.477" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2011-04-26T23:22:30.477" LastActivityDate="2011-04-26T23:22:30.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1073" PostTypeId="5" CreationDate="2011-04-26T23:24:54.453" Score="0" Body="&lt;p&gt;One related question with a clear definition&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/1343/measuring-liquidity&quot;&gt;Measuring liquidity&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="-1" LastEditorUserId="2299" LastEditDate="2017-06-17T17:37:35.947" LastActivityDate="2017-06-17T17:37:35.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1074" PostTypeId="4" CreationDate="2011-04-26T23:24:54.453" Score="0" Body="Liquidity is easy to define qualitatively (the easiness to buy or sell an asset), but difficult to measure." OwnerUserId="-1" LastEditorUserId="2299" LastEditDate="2017-06-17T17:37:35.947" LastActivityDate="2017-06-17T17:37:35.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1075" PostTypeId="5" CreationDate="2011-04-26T23:26:51.067" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2011-04-26T23:26:51.067" LastActivityDate="2011-04-26T23:26:51.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1076" PostTypeId="4" CreationDate="2011-04-26T23:26:51.067" Score="0" Body="Mortgage-backed securities." OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2012-01-18T21:19:19.307" LastActivityDate="2012-01-18T21:19:19.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1077" PostTypeId="2" ParentId="1004" CreationDate="2011-04-27T13:40:46.850" Score="27" Body="&lt;p&gt;By &quot;cryptography&quot; you mean information theory.  Information theory is useful for portfolio optimization and for optimally allocating capital between trading strategies (a problem which is not well addressed by other theoretical frameworks.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;--- J. L. Kelly, Jr., &quot;A New&#xA;   Interpretation of Information Rate,&quot;&#xA;   Bell System Technical Journal, Vol.&#xA;   35, July 1956, pp. 917-26&lt;/p&gt;&#xA;&#xA;&lt;p&gt;--- E. T. Jaynes, Probability Theory: The&#xA;   Logic of Science&#xA;   &lt;a href=&quot;http://amzn.to/dtcySD&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://amzn.to/dtcySD&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;--- &lt;a href=&quot;http://en.wikipedia.org/wiki/Gambling_and_information_theory&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://en.wikipedia.org/wiki/Gambling_and_information_theory&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Kelly_criterion&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://en.wikipedia.org/wiki/Kelly_criterion&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In the simple case, you would use &quot;The Kelly Rule&quot;.  More complicated information theory based strategies for allocating capital between trading strategies take into account correlations between the performance of trading strategies and the relationship between market conditions and strategy performance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for Natural Language Processing and speech recognition; when you examine the founders of Renaissance Technology, you will notice that many of the early employees had backgrounds in natural language processing.  Naively, you might assume that RT is using NLP based strategies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, you will find that all of RT's NLP related hires have backgrounds (published research, Phd thesis's) in speech recognition and specifically in Hidden Markov Models and Kalman filters.  The academic background and published research of RT employees gives you a good idea of the algorithms they are using.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The information that has leaked out of RT suggests that RT heavily uses &quot;hierarchical hidden markov models&quot; for latent variable extraction from market time series.  It is also believed that RT has developed a proprietary algorithm for &quot;layering&quot; multiple trading strategies for trade signal generation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;RT does not have a single secret trading strategy that magically generates billions of dollars a year.  Renaissance Technology's trading strategies are based upon the integration of information from multiple mathematical models.&lt;/p&gt;&#xA;" OwnerUserId="806" LastEditorUserId="-1" LastEditDate="2018-09-13T11:01:34.117" LastActivityDate="2018-09-13T11:01:34.117" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="1078" PostTypeId="1" AcceptedAnswerId="1083" CreationDate="2011-04-27T15:47:45.587" Score="11" ViewCount="1353" Body="&lt;p&gt;The algorithm is introduced in the paper, &lt;em&gt;&lt;a href=&quot;http://www.aaai.org/Papers/JAIR/Vol21/JAIR-2117.pdf&quot;&gt;Can We Learn to Beat the Best Stock&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The obvious advantage is superior risk-adjusted returns (if you can actually achieve them).  Transaction costs and sensitivity to window size seem to be potential disadvantages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm hoping someone can provide more insightful advantages / disadvantages.&lt;/p&gt;&#xA;" OwnerUserId="56" LastEditorUserId="35" LastEditDate="2011-04-27T16:53:26.643" LastActivityDate="2011-04-28T02:20:16.870" Title="What are the advantages / disadvantages of the ANTICOR algorithm?" Tags="&lt;correlation&gt;&lt;portfolio-selection&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1079" PostTypeId="1" AcceptedAnswerId="1080" CreationDate="2011-04-27T21:44:57.803" Score="9" ViewCount="3764" Body="&lt;p&gt;I feel like I'm missing something fundamental here, but I can't shake the feeling that these two series should be equivalent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;/edit: there is also dailyReturn(Cl(SPY)).  I've seen all 3 of these methods used to calculate stock returns on various blogs, and I'm wondering which is 'correct.'  They all give slightly different results...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;/edit2: and there is also Delt(Cl(SPY)), which seems to be equivalent to ClCl(SPY)&lt;/p&gt;&#xA;" OwnerUserId="500" LastEditorUserId="500" LastEditDate="2011-04-27T21:56:50.783" LastActivityDate="2011-05-01T12:38:56.243" Title="Quantmod: what's the difference between ROC(Cl(SPY)) and ClCl(SPY)" Tags="&lt;r&gt;&lt;returns&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="1080" PostTypeId="2" ParentId="1079" CreationDate="2011-04-27T21:57:27.897" Score="3" Body="&lt;p&gt;&lt;code&gt;TTR::ROC&lt;/code&gt; calculates log returns by default.  &lt;code&gt;quantmod::ClCl&lt;/code&gt; uses &lt;code&gt;quantmod::Delt&lt;/code&gt;, which calculates arithmetic returns by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;ROC(Cl(SPY), type=&quot;discrete&quot;)&lt;/code&gt; should match &lt;code&gt;ClCl(SPY)&lt;/code&gt;.  Which is 'correct' depends on your purpose.&lt;/p&gt;&#xA;" OwnerUserId="56" LastActivityDate="2011-04-27T21:57:27.897" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1081" PostTypeId="1" CreationDate="2011-04-27T21:57:37.510" Score="13" ViewCount="1470" Body="&lt;p&gt;Most quantitative investment strategies focus on the changing prices of a commodity or equity over time. Derivatives, however, make this more complicated. How can I apply quantitative strategies to something that is not a single product with a single price, but rather separate products for each month (each with their own price and volatility)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, how should I know whether I should be buying an orange futures contract for July 2011 rather than July 2012? Additionally, how could I apply formulas such as a moving average to all of these different prices?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for bearing with me to answer such a fundamental question, I feel like most quantitative strategies I have read about are in an equity context.&lt;/p&gt;&#xA;" OwnerUserId="807" LastActivityDate="2014-02-02T02:35:03.383" Title="Quantitative Derivatives Trading vs. Time" Tags="&lt;derivatives&gt;" AnswerCount="2" CommentCount="7" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1082" PostTypeId="2" ParentId="1079" CreationDate="2011-04-28T01:24:18.543" Score="6" Body="&lt;p&gt;To expand on what Joshua has already stated, here is a truncated parameter list of similar functions, along with the package to which they belong.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;quantmod::Delt(x1,type = c(&quot;arithmetic&quot;, &quot;log&quot;))&#xA;quantmod::periodReturn(x, type='arithmetic') # log would be &quot;log&quot;&#xA;TTR::ROC(x, type=c(&quot;continuous&quot;, &quot;discrete&quot;))&#xA;PerformanceAnalytics::CalculateReturns(prices, method=c(&quot;compound&quot;,&quot;simple&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Your choice are simple returns, which are &lt;code&gt;(today's_close - yesterday's_close) / yesterday's_close&lt;/code&gt;, or log returns, which are &lt;code&gt;log(today's_close) - log(yesterday's_close)&lt;/code&gt;, or, equivalently, &lt;code&gt;log(today's_close / yesterday's_close)&lt;/code&gt;. If you decide on simple returns, you must multiply returns to get the total return at the end of a period. With log returns you get to add them. This is preferred when your vector may have zeroes in it for obvious reasons. If you have a simple 1 or -1 signal, then you're only going to have a zero in the beginning, or an NA depending on which function you choose. But once you have a system that goes flat, or signals a 0, then you will have some trouble with simple returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simple returns are referred to as arithmetic, discrete or simple in the above functions. The log returns are alternately referred to as log, continuous or compound. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;Delt&lt;/code&gt; function is sort of an artifact and has been updated with the &lt;code&gt;dailyReturn&lt;/code&gt; function. Here is a snapshot of what each function generates on the first two lines of a trading system. Notice also that some have their defaults set to simple returns and others have default set to log returns. Each function allows you to change the default.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;            SLV.Close    Delt   dailyReturn          ROC  CalculateReturns&#xA;2010-01-04  17.23          NA   0.000000000           NA                NA&#xA;2010-01-05  17.51 0.016250725   0.016250725  0.016120096       0.016120096&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Remember that once you convert your returns to a log return, you need to un-convert it to get simple returns again, and this is accomplished by simply applying &lt;code&gt;exp(log_return)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My recent blog post about this topic may be of interest to you. &lt;a href=&quot;http://www.milktrader.net/2011/04/chop-slice-and-dice-your-returns-in-r.html&quot; rel=&quot;nofollow&quot;&gt;http://www.milktrader.net/2011/04/chop-slice-and-dice-your-returns-in-r.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="291" LastEditorUserId="291" LastEditDate="2011-05-01T12:38:56.243" LastActivityDate="2011-05-01T12:38:56.243" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1083" PostTypeId="2" ParentId="1078" CreationDate="2011-04-28T02:20:16.870" Score="4" Body="&lt;p&gt;One of the major assumptions is that you have zero transaction costs. Another one is that your returns are tax-free. Otherwise it looks to me to be a windowed version of CBAL (constant rebalanced).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A more technical analysis can be found at:&lt;br&gt;&#xA;Castonguay, &lt;a href=&quot;http://digitool.library.mcgill.ca/webclient/StreamGate?folder_id=0&amp;amp;dvs=1303954512559~100&quot; rel=&quot;nofollow&quot;&gt;Portfolio Management: An empirical study of the Anticor algorithm&lt;/a&gt; (An MS thesis)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Covan and Gluss, &lt;a href=&quot;http://www.stanford.edu/~cover/papers/paper67.pdf&quot; rel=&quot;nofollow&quot;&gt;Empirical Bayes Stock Market Portfolios&lt;/a&gt; (CBAL)&lt;/p&gt;&#xA;" OwnerUserId="126" LastActivityDate="2011-04-28T02:20:16.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1084" PostTypeId="2" ParentId="832" CreationDate="2011-04-28T02:26:32.080" Score="2" Body="&lt;p&gt;Wavelets and Kalman filtering. &lt;/p&gt;&#xA;" OwnerUserId="126" LastActivityDate="2011-04-28T02:26:32.080" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1085" PostTypeId="2" ParentId="955" CreationDate="2011-04-28T11:16:17.090" Score="5" Body="&lt;p&gt;Take a look at White's Reality Check.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another very crude way would be to calculate a &quot;skill score&quot; (from &lt;em&gt;The Mathematics of Technical Analysis&lt;/em&gt;, p325)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\tt{skill\  score} = \frac{SKILL\_correct - NOSKILL\_correct}{Total\ decisions - NOSKILL\_correct}$$&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;SKILL_correct:&lt;/code&gt; the profitable trades&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;NOSKILL_correct:&lt;/code&gt; randomly assigned trades that were profitable&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;Total decisions:&lt;/code&gt; number of trades&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If this number is 0 or negative, it indicates that you are mostly dealing with a lucky investor, and not a skilled one.&lt;/p&gt;&#xA;" OwnerUserId="659" LastEditorUserId="104" LastEditDate="2013-03-15T23:42:50.793" LastActivityDate="2013-03-15T23:42:50.793" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1086" PostTypeId="2" ParentId="946" CreationDate="2011-04-28T11:20:58.210" Score="7" Body="&lt;p&gt;If you get paid enough theta it absolutely makes sense to be short gamma. And the closer to expiration, the faster the time-value flees. Most of the time, most people would prefer to be gamma long though. It's simply a safer bet because of uncertainty: unexpected events can seriously damage your book if you're short vol.&lt;/p&gt;&#xA;" OwnerUserId="659" LastActivityDate="2011-04-28T11:20:58.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1087" PostTypeId="2" ParentId="942" CreationDate="2011-04-29T14:13:12.343" Score="20" Body="&lt;p&gt;Yahoo rounds the adjusted price to 2 decimals even though dividend amounts often have 3 decimal places.  Since they apply the adjustment formula to adjusted prices, if you go far enough back in time, the value they give for Adjusted Price will be different than it would be if there were no rounding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit: For example, for C (Citigroup), on January 2, 1990, Yahoo gives a close value of 29.37 and an Adjusted value of 1.50.  Using the dividend data that Yahoo supplies, if they didn't round to cents on every adjustment, the adjusted value would be 1.677.&lt;/p&gt;&#xA;" OwnerUserId="508" LastEditorUserId="508" LastEditDate="2011-04-29T14:28:13.617" LastActivityDate="2011-04-29T14:28:13.617" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1088" PostTypeId="1" AcceptedAnswerId="1089" CreationDate="2011-04-29T14:54:37.953" Score="6" ViewCount="373" Body="&lt;p&gt;Would it be considered appropriate risk-management or overkill to utilize multiple brokers to manage a given trading strategy? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A couple specifics:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I'm interested in what a reasonably-sized hedge fund might typically do, not an individual day trader.&lt;/li&gt;&#xA;&lt;li&gt;Let's assume major equities and that either broker could easily handle the whole strategy alone; the point is avoiding the risk of one broker being unavailable or unable to execute a trade.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="80" LastActivityDate="2011-04-29T18:38:09.683" Title="Is it common to use multiple brokers for risk reduction?" Tags="&lt;risk-management&gt;&lt;order-execution&gt;&lt;broker&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1089" PostTypeId="2" ParentId="1088" CreationDate="2011-04-29T15:36:42.180" Score="6" Body="&lt;p&gt;The shops I've worked for have had access to multiple brokers, but not for redundancy as your question implies. It's often because no one broker can handle every task.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I might need a floor broker, a dark-pool broker, an algo broker, and a separate prime broker. Each agency handles a different requirement. Even if one broker could handle all of these tasks, it may be more cost effective to pick and choose. (An analogy on the retail side is that I can have a credit card, checking account, and IRA from separate banks just because the rates are better.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So yes, it's common to have multiple brokers, but not for risk reduction. It's just to silo the required tasks.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-04-29T15:36:42.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1090" PostTypeId="2" ParentId="1088" CreationDate="2011-04-29T18:38:09.683" Score="4" Body="&lt;p&gt;Can't speak to the cash equity space, but at futures shops I think it is common to have the phone number of a give-up broker in case the power goes out or something, but it is uncommon to ever use them.&lt;/p&gt;&#xA;" OwnerUserId="508" LastActivityDate="2011-04-29T18:38:09.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1091" PostTypeId="2" ParentId="908" CreationDate="2011-04-29T21:56:09.857" Score="10" Body="&lt;p&gt;Keynes introduced this idea in the notion of a Keynesian Beauty contest:&#xA;&lt;a href=&quot;http://en.wikipedia.org/wiki/Keynesian_beauty_contest&quot;&gt;http://en.wikipedia.org/wiki/Keynesian_beauty_contest&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone who uses a rolling window regression where the parameters and/or parameter estimates are re-fitted periodically are implicitly accounting for this reflexivity (i.e. the market's changing behavior as agents respond and adapt to each others actions)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With respect to a scientific-framework, agent-based modeling is something that fits the bill and also game theory:&#xA;&lt;a href=&quot;http://en.wikipedia.org/wiki/Agent-based_model&quot;&gt;http://en.wikipedia.org/wiki/Agent-based_model&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2011-04-29T21:56:09.857" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1092" PostTypeId="2" ParentId="1081" CreationDate="2011-04-29T22:00:37.030" Score="3" Body="&lt;p&gt;Best approach is to model each contract separately, or to develop an equilibrium model that constrains the relationship among the various spot and futures contracts. So if you estimate you can make inferences about the other contracts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://en.wikipedia.org/wiki/Yield_curve#Market_expectations_.28pure_expectations.29_hypothesis&quot; rel=&quot;nofollow&quot;&gt;term structure of interest rates&lt;/a&gt; or &lt;a href=&quot;http://en.wikipedia.org/wiki/Interest_rate_parity#Covered_interest_rate_parity&quot; rel=&quot;nofollow&quot;&gt;covered interest parity&lt;/a&gt; would be examples of the latter.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2011-04-29T22:00:37.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1093" PostTypeId="2" ParentId="1081" CreationDate="2011-04-30T13:01:38.387" Score="3" Body="&lt;p&gt;The time behavior of derivatives do not resemble that of commodity or equity towards the end of their life time. Before the expiry date of a derivative there are correlaion models that can be used in both areas, but for your question in making choices between options...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have practical experience with stocks and sports betting, but not derivatives. Regardless, it looks like sports betting approaches are similar in making choices. Moving average does not really help in making choices, and in general all sort of Markovian online learning models. Traditional derivatives tools like the &lt;a href=&quot;http://en.wikipedia.org/wiki/Greeks_%28finance%29&quot; rel=&quot;nofollow&quot;&gt;Greeks&lt;/a&gt;, &lt;a href=&quot;http://en.wikipedia.org/wiki/Black%E2%80%93Scholes&quot; rel=&quot;nofollow&quot;&gt;Black-Scholes&lt;/a&gt; and other methods look at the history of the data and come out with measures for the futures which is better in your case. Then you can compare values and chose accordingly. &lt;/p&gt;&#xA;" OwnerUserId="803" LastActivityDate="2011-04-30T13:01:38.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1094" PostTypeId="1" AcceptedAnswerId="1095" CreationDate="2011-05-01T03:26:46.407" Score="14" ViewCount="1687" Body="&lt;p&gt;&lt;strong&gt;Motivation&lt;/strong&gt;: I am running a quantitative analysis that requires long-term, exchange rate data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;: Does anyone have methods for dealing with the EURUSD exchange rate prior to the Euro's existence?  Is there some &quot;natural&quot; weighting scheme of the various European currencies prior to the Euro that I might use? Or, is there some proxy for the Euro prior to its debut?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance...&lt;/p&gt;&#xA;" OwnerUserId="819" LastActivityDate="2019-06-10T05:35:31.053" Title="Effective Euro-USD (EURUSD) Exchange Rate Prior to Euro's Existence" Tags="&lt;data&gt;&lt;analysis&gt;&lt;fx&gt;&lt;numerical-methods&gt;&lt;currency&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1095" PostTypeId="2" ParentId="1094" CreationDate="2011-05-01T06:36:10.510" Score="13" Body="&lt;p&gt;There was a proxy called the &lt;a href=&quot;http://en.wikipedia.org/wiki/European_Currency_Unit&quot; rel=&quot;noreferrer&quot;&gt;ECU&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should be able to use the weights on the Wikipedia page to get a time series back to 1979. Alternatively, the &lt;a href=&quot;http://research.stlouisfed.org/fred2/series/EXUSEC?cid=280&quot; rel=&quot;noreferrer&quot;&gt;St. Louis FRED&lt;/a&gt; also provides this time series.&lt;/p&gt;&#xA;" OwnerUserId="371" LastEditorUserId="848" LastEditDate="2013-03-12T07:09:19.537" LastActivityDate="2013-03-12T07:09:19.537" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1096" PostTypeId="2" ParentId="1029" CreationDate="2011-05-01T20:49:06.920" Score="1" Body="&lt;p&gt;There's quite a lot of places where you can find free data. Then of course, it really depends on what kind of data you're looking after, as well as what you want to do with it.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;it's fairly easy to find data on governmental websites : especially true for inflation / currency end of day quotes &#xA;&lt;ul&gt;&#xA;&lt;li&gt;exchanges often provide historical and end of day data, and some delayed forward quotes may also be available.  &lt;/li&gt;&#xA;&lt;li&gt;but when you want to do real stuff, a paid connection to exchanges or news agency is necessary. &lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://commoditymodels.com/2010/08/17/commodity-prices/&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; is a list for commodities, could be extended to other asset classes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, the real problem is that each these free data come with their own format, so that's not easy to process. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also as already stated in a previous answer, free data access doesn't mean you will be able to redistribute data which are not yours without paying the original owner, and that makes perfect sense. &lt;/p&gt;&#xA;" OwnerUserId="820" LastEditorUserId="820" LastEditDate="2011-05-01T22:12:06.770" LastActivityDate="2011-05-01T22:12:06.770" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1097" PostTypeId="2" ParentId="788" CreationDate="2011-05-01T21:01:53.607" Score="1" Body="&lt;p&gt;There are a few books on commodity markets, generally available on amazon. I also suggest you look at &lt;a href=&quot;http://garpdigitallibrary.org/display/ERP_Course_Pack.asp&quot; rel=&quot;nofollow&quot;&gt;GARP's Energy Risk Professional curriculum&lt;/a&gt;, their resources have been carefully chosen.&lt;/p&gt;&#xA;" OwnerUserId="820" LastActivityDate="2011-05-01T21:01:53.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1098" PostTypeId="2" ParentId="511" CreationDate="2011-05-01T21:44:21.090" Score="4" Body="&lt;p&gt;This &lt;a href=&quot;http://commoditymodels.com/2010/02/25/key-papers-in-commodities-finance/&quot; rel=&quot;nofollow&quot;&gt;guy&lt;/a&gt; listed a list of key papers relative to commodities price modeling. That could perhaps help you get started.&lt;/p&gt;&#xA;" OwnerUserId="820" LastActivityDate="2011-05-01T21:44:21.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1099" PostTypeId="2" ParentId="841" CreationDate="2011-05-01T21:49:16.173" Score="2" Body="&lt;p&gt;There are already quite a lot of softwares that do that. Quite expensive however for most of them. Then it depends whether you're interested into a trading software (trade capture and stuff) or a pricing engine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Trading softwares : murex, misys summit, calypso ... provide tools to structure deals and value them. Then they are processed front to back.&#xA;Pricing engines : NumeriX, Pricing partners ... are able to define payoff scripts and value them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;disclaimer : I used to work for one of these vendors, but I don't think my answer is biased. &lt;/p&gt;&#xA;" OwnerUserId="820" LastActivityDate="2011-05-01T21:49:16.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1100" PostTypeId="2" ParentId="251" CreationDate="2011-05-01T22:01:15.527" Score="1" Body="&lt;p&gt;Same feedback as &lt;a href=&quot;https://quant.stackexchange.com/users/89/quant-dev&quot;&gt;quant_dev&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few quants are related to &lt;a href=&quot;http://www-rocq.inria.fr/mathfi/Premia/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Premia&lt;/a&gt; but again, not directly used in production. That's more a research consortium and the latest version is not disclosed publicly (but you can pay for it if you want) &lt;/p&gt;&#xA;" OwnerUserId="820" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2011-05-01T22:01:15.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1101" PostTypeId="2" ParentId="925" CreationDate="2011-05-01T22:17:10.997" Score="2" Body="&lt;p&gt;Commonly used on FX option markets, see &lt;a href=&quot;http://en.wikipedia.org/wiki/Vanna_Volga_pricing&quot; rel=&quot;nofollow&quot;&gt;wikipedia&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="820" LastActivityDate="2011-05-01T22:17:10.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1102" PostTypeId="1" CreationDate="2011-05-01T22:31:04.530" Score="26" ViewCount="9923" Body="&lt;p&gt;I am trying to reconcile some research with some published values of 'Sharpe ratio', and would like to know the 'standard' method for computing the same:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Based on daily returns? Monthly? Weekly?&lt;/li&gt;&#xA;&lt;li&gt;Computed based on log returns or relative returns?&lt;/li&gt;&#xA;&lt;li&gt;How should the result be annualized (I can think of a wrong way to do it for relative returns, and hope it is not the standard)?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="108" LastActivityDate="2014-04-19T21:34:11.530" Title="Should Sharpe ratio be computed using log returns or relative returns?" Tags="&lt;returns&gt;&lt;sharpe-ratio&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="1103" PostTypeId="2" ParentId="689" CreationDate="2011-05-01T22:40:24.200" Score="7" Body="&lt;p&gt;Well, that's still a very general question. &#xA;A few elements of answer :&#xA;Bonds pay interest on a regular basis, semiannual for US treasury and corporate bonds, annual for others such as Eurobonds, and quarterly for others. &#xA;You need to distinguish between fixed coupon bonds, zero coupon bonds, bonds with an amortization schedule, floating rate notes based on LIBOR or equivalent, etc ...&#xA;Different quotation methods are available (clean vs dirty especially), and the basis used to compute the accrual interest can differ as well. &lt;/p&gt;&#xA;" OwnerUserId="820" LastActivityDate="2011-05-01T22:40:24.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1104" PostTypeId="2" ParentId="1102" CreationDate="2011-05-01T23:40:47.680" Score="6" Body="&lt;p&gt;I don't feel I can give you an authoritative answer on what the &quot;standard&quot; approach is, maybe someone with more hands-on experience will be able to help. But my quick thoughts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to the period, I've seen &lt;strong&gt;both daily and monthly returns&lt;/strong&gt; being used. Weekly probably not that often. But in the end you &lt;strong&gt;annualize them either way&lt;/strong&gt; to make them comparable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The method I know is to &lt;strong&gt;multiply by $\sqrt{12}$&lt;/strong&gt; (for monthly data) - as can be seen in &lt;strong&gt;Kestner, &lt;em&gt;2003&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would go with &lt;em&gt;log returns&lt;/em&gt;, but it's rather gut instinct. I haven't really thought about it, so feel free to correct me/validate this statement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's one implication to arbitrarily changing your measurement interval - it can (should) &lt;strong&gt;alter the deviation&lt;/strong&gt;. See &lt;strong&gt;Spurgin, &lt;em&gt;2002&lt;/em&gt;&lt;/strong&gt; for details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And all this has to be done under the assumption that you can define your performance using only two first moments of the distribution. But the pitfalls of using Sharpe ratio - that's another issue to discuss.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Kestner, Lars&lt;/strong&gt;: &lt;em&gt;Quantitative trading strategies: harnessing the power of quantitative techniques to create a winning trading program&lt;/em&gt;. McGraw-Hill Professional, 2003. p. 84 (&lt;a href=&quot;http://books.google.com/books?id=zZDr-3DRMqcC&amp;amp;lpg=PP1&amp;amp;pg=PA84#v=onepage&amp;amp;q&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;preview at Google books&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Spurgin, Richard&lt;/strong&gt;: &lt;em&gt;How to Game Your Sharpe Ratio&lt;/em&gt; @ &lt;a href=&quot;http://www.hedgeworld.com/research/download/howtogameyoursharperatio.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.hedgeworld.com/research/download/howtogameyoursharperatio.pdf&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="38" LastEditorUserId="38" LastEditDate="2011-05-02T13:48:11.533" LastActivityDate="2011-05-02T13:48:11.533" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1105" PostTypeId="2" ParentId="1102" CreationDate="2011-05-02T04:51:20.700" Score="7" Body="&lt;p&gt;In long-short equities, it's common to use daily returns in $\frac{\mu}{\sigma}$ and then multiply by $\sqrt{252}$ to annualize.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-05-02T04:51:20.700" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="1106" PostTypeId="1" CreationDate="2011-05-02T13:34:04.180" Score="8" ViewCount="1162" Body="&lt;p&gt;Can someone provide (or point me to) a summary of back office processing nuances specific to FX trading? For example, I know that there are several FX-specific risks that must be managed. They include transaction risk, translation risk, and short- and long-term exposure risks. GAAP and IFRS have published guidelines for fund and tax accounting for FX instruments. What other FX-specific nuanced processing challenges exist within the various back office functions including pricing, risk management, fund and tax accounting, clearance, settlement, custody, cash management, collateral management, and financial reporting?&lt;/p&gt;&#xA;" OwnerUserId="772" LastEditorUserId="70" LastEditDate="2011-05-03T01:14:42.257" LastActivityDate="2014-09-30T17:47:44.733" Title="Back office processing for FX trades" Tags="&lt;fx&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1107" PostTypeId="1" CreationDate="2011-05-02T16:49:15.263" Score="8" ViewCount="473" Body="&lt;p&gt;I watched every documentary on the financial crisis and CDOs, tried to understand Wikipedia etc.. but still not getting the full picture as examples seem to be limited (or complicated). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say Local-Bank-A starts providing mortgages to US subprime, big marketing campaign and sweet offer 100% mortgage, offer start 1 Jun and finish 31 August, so a 3 month marketing window. The sales and marketing guys believe they are going to close 10,000 mortgages with an average loan of US$100,000. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where they do they get the money from first to finance 10,000 mortgages.  Do they borrow US$ 1 billion and from where? When they borrow from other banks what collateral do they accept? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Okay 1st September comes round and Local-Bank-A has sold all expected 10,000 mortgages, exhausted the 1 billion and now wants to sell it on to Goldman Sachs etc.. What do they charge to sell it? How much money is in selling US$1billion of 100% mortgages to the wall street investment banks?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So they sell, they get the US$1billion back plus whatever profit and settle their original loan of 1 billion. They make some money out of this and start the process again? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Goldman Sach now has 1 billion of mortgages on their books and works quickly to CDO this and shift it on. How much were they making on this as obviously they had shell out at least 1 billion for them (as Local-Bank-A wouldnt be selling for a loss)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When the bank sell these mortgages on who is responsible for collecting the monthly payments and handling redemptions etc..? Do US mortgages have a separate handling fee to a 3rd party entity like $10 a month? Who answers the phone when changing repayment amounts etc..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I talk in the current sense but obviously I mean 2006/2007. &lt;/p&gt;&#xA;" OwnerUserId="825" LastActivityDate="2011-05-03T12:12:33.563" Title="Understanding CDOs" Tags="&lt;cdo&gt;" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1108" PostTypeId="2" ParentId="1107" CreationDate="2011-05-02T18:22:08.687" Score="5" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;When the bank sell these mortgages on who is responsible for collecting the monthly payments and handling redemptions etc..? Do US mortgages have a separate handling fee to a 3rd party entity like $10 a month? Who answers the phone when changing repayment amounts etc..&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This would be the &quot;servicer&quot;, which is often the bank/lending institution that wrote the loan in the first place. The servicer collects the monthly payment, subtracts its fee, and passes the payment on to the next guy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It might be helpful to look at how GNMA/FNM/FRE handle the situation and turn the results into a &quot;mortgage-backed security&quot; (MBS):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The lender (usually a bank) writes the original loan by lending money it already has. &lt;/li&gt;&#xA;&lt;li&gt;If the loan meets the underwriting standards, then GNMA/FNM/FRE will purchase the loan from the lender.&lt;/li&gt;&#xA;&lt;li&gt;They will then bundle the loans into large pools so that the risk of an individual foreclosure/default won't adversely sink any individual bond. &lt;a href=&quot;http://www.ginniemae.gov/mip/MIP30_2011_04.pdf&quot; rel=&quot;noreferrer&quot;&gt;Sample list of GNMA pools and bonds from April 2011&lt;/a&gt;.   &lt;/li&gt;&#xA;&lt;li&gt;They'll carve the huge bundle of loans into individual bonds (usually denominated in $5k chunks). &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Each pool is an MBS and will have its own unique &lt;a href=&quot;http://en.wikipedia.org/wiki/CUSIP&quot; rel=&quot;noreferrer&quot;&gt;CUSIP&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;Where they do they get the money from first to finance 10,000 mortgages.&lt;/em&gt;   &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The lenders themselves don't need to &quot;have enough to finance 10k mortgages&quot;, because they sell them as they get them.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;Okay 1st September comes round and Local-Bank-A has sold all expected 10,000 mortgages, exhausted the 1 billion and now wants to sell it on to...&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;They will sell the notes within a day or two after the closing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know this isn't going to come close to answering all your questions, as some of them (&lt;em&gt;&quot;How much were they making on this?&quot;&lt;/em&gt;) cannot be answered.&lt;/p&gt;&#xA;" OwnerUserId="126" LastEditorUserId="35" LastEditDate="2011-05-02T18:58:57.983" LastActivityDate="2011-05-02T18:58:57.983" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1109" PostTypeId="2" ParentId="1102" CreationDate="2011-05-02T18:49:23.847" Score="6" Body="&lt;p&gt;For fixed income hedge funds, monthly returns are almost always used to calculate the Sharpe ratio, because some securities held are relatively illiquid and the dealers who do the pricing for the hedge funds are only willing to do month-end pricing.  Daily returns are not available to be calculated for most such funds.&lt;/p&gt;&#xA;" OwnerUserId="828" LastActivityDate="2011-05-02T18:49:23.847" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1110" PostTypeId="1" AcceptedAnswerId="1441" CreationDate="2011-05-02T18:56:26.963" Score="8" ViewCount="619" Body="&lt;p&gt;Ladies and Gents,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Im writing a quick routine to calculate implied vols for options on EUR$ futures with Bloomberg data.  My question concerns the part where I have all my inputs and am ready to pass them to my implied vol function.  Assume we have the following market quotes (example ticker: EDK1C 98.750 Comdty):&#xA;Strike = 98.750&#xA;Underlying Spot = 99.7050&#xA;Option Price = 0.9550&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When passing these to my function, do I convert the Underlying spot and strike to &#xA;S = (100 - Underlying Spot)/100 and K = (100 - Strike)/100 respectively&#xA;and use the market option price as is so our implied vol method is some function IV = f(S,K,Option Price,...)&#xA;OR&#xA;convert the option price to&#xA;oP = 100 - (Option Price)*100 and leave the spot and strike such that our implied vol method is some function&#xA;IV = f(Strike ,Underlying Spot,oP,...)&#xA;???&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The latter has yielded a rational result but I would love some feedback.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="826" LastActivityDate="2018-12-05T14:14:23.317" Title="Parameters for pricing option on EDF" Tags="&lt;options&gt;&lt;implied-volatility&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1111" PostTypeId="2" ParentId="1107" CreationDate="2011-05-03T11:19:49.777" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Where they do they get the money from first to finance 10,000 mortgages. Do they borrow US$ 1 billion and from where? When they borrow from other banks what collateral do they accept?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It sounds like you're missing a basic understanding of how banking works here. In the fractional reserve system, a bank doesn't need to have 1 billion on its books to issue 1 billion in loans, it only needs to maintain the minimal capital ratio specified by the government. Say this ratio is 10%, they would need to have 100 million to lend out 1 billion.&lt;/p&gt;&#xA;" OwnerUserId="351" LastActivityDate="2011-05-03T11:19:49.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1112" PostTypeId="2" ParentId="1107" CreationDate="2011-05-03T12:12:33.563" Score="2" Body="&lt;p&gt;I wanted to post it as comment to &lt;em&gt;@codebolt&lt;/em&gt;'s answer, but I'm not sure I would fit with the length limit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure I agree with the current wording of your response.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think we mean the same, but I'd rather say &lt;strong&gt;they (the bank) need 1 billion in the first place&lt;/strong&gt; (or exactly said &lt;strong&gt;1,(1) billion&lt;/strong&gt;) for example coming from deposits. They leave &lt;strong&gt;10%&lt;/strong&gt; of this &lt;strong&gt;1,(1) billion&lt;/strong&gt; as reserves, so they now have &lt;strong&gt;1 billion left for lending&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say they use the whole billion for lending. Now all this money will come back somehow to the financial system. If you borrow money, you have to keep it somewhere (let's assume it's not in your wallet). Even if you use it to pay somebody, he will have the same &quot;problem&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this way &lt;strong&gt;most of this 1 billion of initial lending will come back to our bank&lt;/strong&gt; (or some other banks) as new deposits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rinse and repeat till no money comes back or you can't find new clients to lend money to.&lt;/p&gt;&#xA;" OwnerUserId="38" LastActivityDate="2011-05-03T12:12:33.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1113" PostTypeId="2" ParentId="955" CreationDate="2011-05-03T23:40:32.730" Score="3" Body="&lt;p&gt;I remember an article from graduate school that describes a methodology for measuring the true timing ability of a money manager.  I don't remember the name of the article nor the name of the author, however, I do remember some of the details of the article.  Maybe someone else has run across it and would be kind enough to post the appropriate reference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's assume that a manager has the ability to be either in cash, earning the risk-free rate, or a long position in a basket of stocks.  If the money manager had superior timing ability, he would be in the basket when the basket was returning greater than the risk-free rate, and he would be in a cash position when the basket is returning less than the risk-free rate.  What you basically have is a return profile that looks a lot like the payoff of call option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you plot market return on the x-axis and manager return on the y-axis, the return should be flat at the risk-free rate for everything to the left of the risk-free rate on the x-axis/  At the risk free-rate on the x-axis, the return should be a 45-degree line up and to the right of the diagram.  Over time, you measure manager return against market return, and if he is any good, you should see the call option payoff diagram being roughly drawn out.&lt;/p&gt;&#xA;" OwnerUserId="832" LastActivityDate="2011-05-03T23:40:32.730" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1114" PostTypeId="1" AcceptedAnswerId="1116" CreationDate="2011-05-04T12:56:24.527" Score="23" ViewCount="3924" Body="&lt;p&gt;I'm reading Natenberg's book, and he says that all options trades should be delta neutral.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that this prevents small changes in the underlying price from changing the price of the option, but couldn't there be a case where you would want that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I (think I) also understand that if you're betting against just volatilty, it would make sense, since you don't care what direction the underlying price moves, but I don't entirely understand why he says all options trades should be delta neutral.&lt;/p&gt;&#xA;" OwnerUserId="833" LastActivityDate="2014-01-12T14:37:33.317" Title="Why are options trades supposed to be delta-neutral?" Tags="&lt;options&gt;&lt;delta-neutral&gt;" AnswerCount="6" CommentCount="1" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="1115" PostTypeId="2" ParentId="1114" CreationDate="2011-05-04T13:43:37.140" Score="5" Body="&lt;p&gt;Well - if you're not delta neutral - this means you take a position with certain view on the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be very comfortably done when you think that a stock price will go high up, but you don't want to spend all your money on acquiring the stock - you buy a call on it, which is quite cheap, and get the same payoff.&lt;/p&gt;&#xA;" OwnerUserId="647" LastActivityDate="2011-05-04T13:43:37.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1116" PostTypeId="2" ParentId="1114" CreationDate="2011-05-04T15:39:41.437" Score="14" Body="&lt;p&gt;I haven't read Natenberg but it of course depends on your side in the trade:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are you a market maker or a risk taker? So do you live on the spread (first) or are trying to make money based on e.g. forecasts on direction (second).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the great divide in QuantFinance!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Only in the first case will all your option trades be delta neutral.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a nice short paper which elaborates on both concepts (it calls the first one &lt;em&gt;Q&lt;/em&gt; and the second &lt;em&gt;P&lt;/em&gt;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Meucci: 'P' Versus 'Q': Differences and Commonalities between the Two Areas of Quantitative Finance&#xA;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1717163&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1717163&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-05-04T15:39:41.437" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1117" PostTypeId="2" ParentId="1114" CreationDate="2011-05-04T18:58:32.180" Score="2" Body="&lt;p&gt;As I recall, Natenberg recommends selling time premium and places himself in the market maker camp that @vonjd describes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are correct in noting that delta neutral holds for small changes in the underlying price. You can probably imagine a case where you sell a lot of deep out-of-the-money puts and sell a few slightly out-of-the-money calls. This would be delta neutral while the underlying remained steady, but would not be delta neutral if the underlying dropped sharply. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Part of the reason why is because this position is not gamma neutral: the deltas of the puts and calls would change as the underlying moved away from its opening position.&lt;/p&gt;&#xA;" OwnerUserId="343" LastActivityDate="2011-05-04T18:58:32.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1118" PostTypeId="1" CreationDate="2011-05-04T21:10:25.703" Score="8" ViewCount="13712" Body="&lt;p&gt;Say I'm given I set of monthly returns over 10 years on a monthly basis. What is the correct way to find the geometric returns of this data? I ask because a classmate and I are on different sides of the coin.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found the cumulative returns of each year, then found the geometric mean of the 10 years. He found the cumulative returns of the entire time period, then took the (months in a year / total months) root of that data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The numbers turn out to be very close, but if I remember correctly mine are slightly lower over all the funds we measured.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or is there a different way and we're both wrong?&lt;/p&gt;&#xA;" OwnerUserId="60" LastEditorUserId="35" LastEditDate="2011-05-04T22:46:33.600" LastActivityDate="2011-05-05T12:27:25.453" Title="Correct way to find the mean of annual geometric returns of monthly returns?" Tags="&lt;returns&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1119" PostTypeId="1" AcceptedAnswerId="1147" CreationDate="2011-05-04T21:32:37.643" Score="5" ViewCount="562" Body="&lt;p&gt;I'd like to expand on the &lt;a href=&quot;https://quant.stackexchange.com/q/141/343&quot;&gt;Data Sources Online&lt;/a&gt; question. I found this site for a German convertible bond, all free and not requiring a sign-up. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.boerse-stuttgart.de/en/marketandprices/bonds/bonds.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Börse Stuttgart&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.google.de&quot; rel=&quot;nofollow noreferrer&quot;&gt;German Google&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I am looking for similar information for a Norwegian bond.&lt;/p&gt;&#xA;" OwnerUserId="343" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2011-05-09T17:10:21.337" Title="Where can I find European and Scandinavian convertible bond prices?" Tags="&lt;market-data&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1120" PostTypeId="2" ParentId="1118" CreationDate="2011-05-04T23:10:05.367" Score="6" Body="&lt;p&gt;If I understand you correctly, your question is whether this is true:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\sqrt[10]{\prod_{i=1}^{10}{Y_i}} &amp;lt; \sqrt[10]{A}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Y$ is the yearly cumulative returns (your method), and $A$ is the absolute cumulative return (your classmate's method).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question then becomes whether you find this relationship:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\prod_{i=1}^{10}{Y_i} &amp;lt; A&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But that can't be! The absolute cumulative return must be &lt;strong&gt;equal to&lt;/strong&gt; the product of the yearly cumulative returns. So if your yearly returns don't multiply to be his absolute return, then one of you has made a mistake.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you believe that your and his math are both correct, then the culprit is most likely a rounding error.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-05-04T23:10:05.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1121" PostTypeId="1" CreationDate="2011-05-05T02:36:57.970" Score="5" ViewCount="565" Body="&lt;p&gt;Totally new to the world of quant finance, so perhaps this is an odd question...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does there exist an American equivalent to the German style &quot;knock out zertifkate&quot;?  (The name might be slightly wrong.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not even exactly sure what they are, but from what I did learn about their behavior, the nearest thing I could find on Wikipedia was:&#xA;&lt;a href=&quot;http://en.wikipedia.org/wiki/Turbo_warrant&quot; rel=&quot;noreferrer&quot;&gt;http://en.wikipedia.org/wiki/Turbo_warrant&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there is &lt;em&gt;not&lt;/em&gt; an american equivalent, does anybody know where to get English language details and pricing history/data?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="837" LastEditorUserId="837" LastEditDate="2011-05-05T02:49:55.960" LastActivityDate="2011-05-05T09:17:45.273" Title="European turbo warrants" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;eurex&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1122" PostTypeId="2" ParentId="1121" CreationDate="2011-05-05T09:17:45.273" Score="4" Body="&lt;p&gt;I haven't encountered them, but if you mean &quot;&lt;strong&gt;&lt;em&gt;Hebel-Zertifikate&lt;/em&gt;&lt;/strong&gt;&quot; as &lt;a href=&quot;http://de.wikipedia.org/wiki/Zertifikat_%28Wirtschaft%29#Hebel-Zertifikate_.28auch%3a_Turbo-_oder_Knock-out-Zertifikate.2C_Mini-Futures.29&quot; rel=&quot;nofollow&quot;&gt;defined on &lt;em&gt;Wikipedia&lt;/em&gt;&lt;/a&gt; they just seem to be &lt;strong&gt;leveraged certificates with an obligatory stop-loss knock-out&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Those &lt;em&gt;turbo warrants&lt;/em&gt; you mention are more or less the same as &lt;a href=&quot;http://www.vam.ag/product-know-how/leveraged-certificates/mini-futures.html&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Mini Futures&lt;/strong&gt;&lt;/a&gt;. Depending on issuer or some small differences, they can also come up as &lt;strong&gt;Turbo / Short Certificates&lt;/strong&gt; (naming used by &lt;em&gt;The Royal Bank of Scotland&lt;/em&gt;) or &lt;a href=&quot;http://en.wienerborse.at/prices_statistics/certificates/knockout/&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;knock-out certificates&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you can encounter &lt;strong&gt;many names for essentially similar/identical products&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your pricing question is a bit too vague. There are so many products that you would have to define what you're interested in (preferably what market/exchange). You can browse through the websites of the exchanges where products you're interested in are listed. For example &lt;a href=&quot;http://en.wienerborse.at/certificates/&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Wiener Börse&lt;/strong&gt;&lt;/a&gt; has some pricing data for numerous certificates.&lt;/p&gt;&#xA;" OwnerUserId="38" LastActivityDate="2011-05-05T09:17:45.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1123" PostTypeId="2" ParentId="1118" CreationDate="2011-05-05T11:51:36.590" Score="1" Body="&lt;p&gt;I assume you have net simple montly returns. 12 months and 10 years gives you 120 monthly returns $r_1, r_2,...,r_{120} $. You want to know the annual geometric return. Then solve for $ r_g:$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ (1+r_1)\times(1+r_2)\times \dots \times(1+r_{120})=(1+r_g)^{10}$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The order of the multiplication on the LHS is important, that is, you should start multiplying with the oldest return ($r_1$).&lt;/p&gt;&#xA;" OwnerUserId="796" LastActivityDate="2011-05-05T11:51:36.590" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1124" PostTypeId="2" ParentId="1114" CreationDate="2011-05-05T11:52:00.350" Score="4" Body="&lt;p&gt;One other consideration is the cost of the trade. If you're not delta-neutral, you're expressing a directional view, and there are cheaper ways to express a direction view than options. (Namely, just owning the underlying.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, conceptually, it's a little easier to think of there being two separate trades going on: an expensive vol trade (the options) and a cheap direction trade (underlying).&lt;/p&gt;&#xA;" OwnerUserId="596" LastActivityDate="2011-05-05T11:52:00.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1125" PostTypeId="2" ParentId="1118" CreationDate="2011-05-05T12:27:25.453" Score="5" Body="&lt;p&gt;&lt;em&gt;@chrisaycock&lt;/em&gt; already gave you a correct answer, but I thought I would &lt;strong&gt;add a more verbose version&lt;/strong&gt; (and practice some &lt;em&gt;MathJax&lt;/em&gt; by the way). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact when I began answering I thought &lt;strong&gt;it was going to be a straightforward answer&lt;/strong&gt;, but having spent some more time with this question I see &lt;strong&gt;there are some potential traps&lt;/strong&gt; you can fall in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Especially since some of the steps you name are not 100% clear, &lt;strong&gt;I assumed the worst-case scenario&lt;/strong&gt; (AKA everything wrong). I suppose some of them are just shorthand notions. Sorry if you already do it the right way and it's obvious it's wrong making my explanations ridiculous, but at least one of the steps is to blame as you are getting different results. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;So, going through your task:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;Say I'm given a set of monthly returns over 10 years on a monthly basis.&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Let's call them&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;r_{1_{jan}}, \ ...,\  r_{1_{dec}}, \ ...,\  r_{10_{jan}}, \ ...,\  r_{10_{dec}} \ [eq. 1]&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What you do is:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;I found the cumulative returns of each year&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Your cumulative return for a year is a product of monthly returns:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;R_{i} = (1+r_{i_{jan}}) * \ ... \ * (1+r_{i_{dec}}) - 1 \ [eq. 2]&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OK, straightforward. Not that many options here.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;then found the geometric mean of the 10 years&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;if you mean that &lt;em&gt;literally&lt;/em&gt; (I warned you I would take the worst approach possible, sorry), as in found the &lt;strong&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Geometric_mean&quot; rel=&quot;noreferrer&quot;&gt;geometric mean&lt;/a&gt;&lt;/strong&gt; of those 10 returns:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;R_{G} = \sqrt[10]{R_{1} * R_{2} * \ ... \ * R_{10}} \ [eq. 3]&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;we have our first problem. While technically you can calculate anything (as long as it's not negative), it doesn't make sense. We are looking for a &lt;strong&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Rate_of_return#Geometric_average_rate_of_return&quot; rel=&quot;noreferrer&quot;&gt;geometric average rate of return&lt;/a&gt;&lt;/strong&gt; instead:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;R_{G} = \sqrt[10]{(1 + R_{1}) * (1 + R_{2}) * \ ... \ * (1 + R_{10})} - 1 \ [eq. 4]&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OK, done, should be the correct answer.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Your classmate's version:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;He found the cumulative returns of the entire time period,&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;He calculated it either this way:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;AR = (1+r_{1_{jan}}) * \ ... \  * (1+r_{1_{dec}}) * \ ... \ * (1+r_{10_{jan}}) * \ ... \ * (1+r_{10_{dec}}) - 1 \ [eq. 5]&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or just used $\frac{P_{last}}{P_{first}} - 1$ which is the same. No problem here.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;then took the (months in a year / total months) root of that data.&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;First assumption - I suppose you meant &lt;em&gt;power&lt;/em&gt; here (or &lt;code&gt;total months / months in a year&lt;/code&gt; root), because otherwise it wouldn't make much sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if we &lt;em&gt;literally&lt;/em&gt; take the root out of our accumulated returns ($AR$):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;\sqrt[\frac{120}{12}]{AR} = \sqrt[10]{(1+r_{1_{jan}}) * \ ... \  * (1+r_{1_{dec}}) * \ ... \ * (1+r_{10_{jan}}) * \ ... \ * (1+r_{10_{dec}}) - 1} \ [eq. 6]&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;using $[eq. 2]$ we get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;= \sqrt[10]{(1+R_{1})*(1+R_{2})* \ ... \ * (1+R_{10}) - 1}&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Oops, seems similar to $[eq. 4]$, but it's not the same. We did something wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact we wanted it this way (remembering that we're looking for annual returns):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;R_{G} = \sqrt[10]{1 + AR} - 1 \ [eq. 7]&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now plugging $[eq. 5]$ and $[eq. 2]$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;= \sqrt[10]{1 + (1+R_{1})*(1+R_{2})* \ ... \ * (1+R_{10}) - 1} -1&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;= \sqrt[10]{(1+R_{1})*(1+R_{2})* \ ... \ * (1+R_{10})} - 1&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and this is the same as $[eq. 4]$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;This way you see that &lt;strong&gt;both methods should give equivalent results&lt;/strong&gt;. If not, then either it's a &lt;strong&gt;calculation mistake/rounding issue&lt;/strong&gt; or you're &lt;strong&gt;using different methods&lt;/strong&gt; and someone is not calculating an actual &lt;strong&gt;geometric average rate of return&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope now you can find where the issue was.&lt;/p&gt;&#xA;" OwnerUserId="38" LastActivityDate="2011-05-05T12:27:25.453" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1126" PostTypeId="2" ParentId="955" CreationDate="2011-05-05T13:34:16.153" Score="5" Body="&lt;p&gt;Read Fooled by Randomness by Nassim Taleb. In a nutshell, he says that you can only tell the difference by understanding the risks that were taken. Lucky investors can win for many years before blowing up. Even if he doesn't blow up, there is no way to know what might have happened if the risks turned out badly. &lt;/p&gt;&#xA;" OwnerUserId="838" LastActivityDate="2011-05-05T13:34:16.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1127" PostTypeId="1" AcceptedAnswerId="1142" CreationDate="2011-05-05T15:26:45.320" Score="4" ViewCount="2694" Body="&lt;p&gt;In my quest for simulated data, I am trying to generate prices for Total Return Swaps by calculating the NPVs of the fixed and floating leg. My problem: Given the fixed leg, how do I set the spread on the floating leg so that the value of the swap at the beginning equals Zero? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On a more technical side: Using RQuantLib, I use FloatingRateBond to calculate the NPV. How exactly do I set the spread there? The documentation is a bit unclear at that point. &lt;/p&gt;&#xA;" OwnerUserId="357" LastActivityDate="2014-03-22T16:05:34.703" Title="Valuing Total Return Swaps" Tags="&lt;r&gt;&lt;simulations&gt;&lt;swaps&gt;&lt;total&gt;&lt;return&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1128" PostTypeId="2" ParentId="815" CreationDate="2011-05-05T20:29:02.893" Score="4" Body="&lt;p&gt;Claudio Albanese has a paper on the topic of GPUs and CVA computations. Here is one of his papers: &lt;a href=&quot;http://www.level3finance.com/gmcse.pdf&quot; rel=&quot;nofollow&quot;&gt;link to paper&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="842" LastActivityDate="2011-05-05T20:29:02.893" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1129" PostTypeId="1" CreationDate="2011-05-05T23:42:56.643" Score="15" ViewCount="10593" Body="&lt;p&gt;Suppose I want to build a linear regression to see if returns of one stock can predict returns of another. For example, let's say I want to see if the VIX return on day X is predictive of the S&amp;amp;P return on day (X + 30). How would I go about this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The naive way would be to form pairs (VIX return on day 1, S&amp;amp;P return on day 31), (VIX return on day 2, S&amp;amp;P return on day 32), ..., (VIX return on day N, S&amp;amp;P return on day N + 30), and then run a standard linear regression. A t-test on the coefficients would then tell if the model has any real predictive power. But this seems wrong to me, since my points are autocorrelated, and I think the p-value from my t-test would underestimate the true p-value. (Though IIRC, the t-test would be &lt;em&gt;asymptotically&lt;/em&gt; unbiased? Not sure.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what should I do? Some random thoughts I have are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Take a bunch of bootstrap samples on my pairs of points, and use these to estimate the empirical distribution of my coefficients and p-values. (What kind of bootstrap do I run? And should I be running the bootstrap on the coefficient of the model, or on the p-value?)&lt;/li&gt;&#xA;&lt;li&gt;Instead of taking data from consecutive days, only take data from every K days. For example, use (VIX return on day 1, S&amp;amp;P return on day 31), (VIX return on day 11, S&amp;amp;P return on day 41), etc. (It seems like this would make the dataset way too small, though.)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Are any of these thoughts valid? What are other suggestions?&lt;/p&gt;&#xA;" OwnerUserId="672" LastActivityDate="2014-08-21T13:26:17.297" Title="Using linear regression on (lagged) returns of one stock to predict returns of another" Tags="&lt;forecasting&gt;&lt;vix&gt;&lt;prediction&gt;&lt;regression&gt;" AnswerCount="5" CommentCount="1" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="1130" PostTypeId="2" ParentId="1129" CreationDate="2011-05-06T00:37:17.340" Score="11" Body="&lt;p&gt;A few thoughts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yes, your return series are autocorrelated (i.e., stocks don't exactly follow a random walk), so you should use &lt;a href=&quot;http://en.wikipedia.org/wiki/Newey%E2%80%93West_estimator&quot;&gt;Newey-West standard errors&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do this as a univariate regression $$R_{i,t} = \alpha_i + \beta_i R_{j,t-1} + \epsilon_{i,t}$$ then there's almost certainly an omitted variable inside $\epsilon$ that is moving both $R_i$ and $R_j$. So make sure you throw in at least some of the normal &quot;predictors&quot;, like market return, default premium, term premium, or the other standard factors (&lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html&quot;&gt;Fama and French's SMB, HML, and UMD&lt;/a&gt;). In the hedge fund research you also see a &lt;a href=&quot;http://faculty.fuqua.duke.edu/~dah7/HedgeFund/HedgeFund.htm&quot;&gt;set of seven or so factors&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-05-06T00:37:17.340" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1131" PostTypeId="2" ParentId="30" CreationDate="2011-05-06T01:33:53.307" Score="3" Body="&lt;p&gt;There are two main approaches:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Comparables (depends on having an existing sample of similar project outcomes, which can be difficult to obtai [similar to historical volatility for stocks])&lt;/li&gt;&#xA;&lt;li&gt;Simulation (when comparables, or rather enough of them, aren't available)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Here's a link to a paper that provides a technique for estimating volatility for real options:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://new.vmi.edu/media/ecbu/cobb/EE4902.pdf&quot; rel=&quot;nofollow&quot;&gt;http://new.vmi.edu/media/ecbu/cobb/EE4902.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally comparables is the preferable approach in real options, provided that you have a large enough historical sample.  In most cases, however simulation is used as 'true' comparables are notoriously difficult to find en masse.&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-05-06T01:33:53.307" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1133" PostTypeId="1" AcceptedAnswerId="1134" CreationDate="2011-05-06T08:45:32.677" Score="11" ViewCount="3694" Body="&lt;p&gt;From &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0814407242&quot; rel=&quot;nofollow&quot;&gt;Optimal Trading Strategies&lt;/a&gt; : &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;There are two main reasons why traders&#xA;  execute orders using a VWAP trading&#xA;  strategy. First, a VWAP strategy is&#xA;  the trading strategy that minimizes&#xA;  market impact cost. Traders executing&#xA;  orders utilizing VWAP strategies are&#xA;  interested in participating with&#xA;  market volumes so to cause the least&#xA;  disruption to the supply-demand&#xA;  imbalance in each period. Second, for&#xA;  many traders their execution&#xA;  performance is measured against the&#xA;  VWAP benchmark. An average execution&#xA;  price more favorable than the VWAP&#xA;  price benchmark is considered&#xA;  high-quality performance while an&#xA;  average execution price less favorable&#xA;  than the VWAP benchmark is considered&#xA;  inadequate performance.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But, when it comes to backtesting, the market impact is thus assumed to be zero. One is assuming he does not affect the market as the VWAP benchmark price stays untouched. So how can one backtest his VWAP strategy effectively and more realistically?&lt;/p&gt;&#xA;" OwnerUserId="42" LastEditorUserId="1106" LastEditDate="2011-09-22T14:55:45.517" LastActivityDate="2012-10-19T20:08:38.280" Title="What is an effective way of backtesting VWAP execution?" Tags="&lt;backtesting&gt;&lt;order-execution&gt;&lt;market-impact&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1134" PostTypeId="2" ParentId="1133" CreationDate="2011-05-06T12:10:54.323" Score="6" Body="&lt;p&gt;This isn't exclusive to VWAP; any assumed trade price (NBBO, Arrival Price, etc) has the same vulnerabilities. Many shops often lump market impact with slippage and transaction costs when modeling the difference between the ideal price and the realized price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To model the impact during a backtest for a given trade price, assess a penalty:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;This penalty can be fixed (&lt;em&gt;X&lt;/em&gt; basis points added to each buy price) or it can be variable (&lt;em&gt;Y&lt;/em&gt; percentage extra cost for each buy price). One could use a combination of both.&lt;/li&gt;&#xA;&lt;li&gt;For variable penalties, the percentage can be a single number for all trading activity, or it can grow quadratically with respect to the size of the trade. An aggressive penalty models removing liquidity in the order book.&lt;/li&gt;&#xA;&lt;li&gt;To be really swanky, one could have a different penalty for each unique instrument in the portfolio.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Many shops consider their transaction-cost models to be very proprietary. It takes a lot of post-trade analysis to determine proper values for &lt;em&gt;X&lt;/em&gt; and &lt;em&gt;Y&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-05-06T12:10:54.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1135" PostTypeId="1" AcceptedAnswerId="1141" CreationDate="2011-05-06T18:19:56.237" Score="11" ViewCount="1769" Body="&lt;p&gt;Reading from &quot;www.nadex.com&quot; - the copy reads &quot;Binaries are similar to traditional options but with one key difference: their final settlement value will be 0 or 100. This means your maximum risk and reward are always known and capped.&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Isn't that true when you are using traditional options? (Assuming the markets are the same.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Addition:  Can't you essentially replicate the payoff of a binary option using a vertical ATM option spread?&lt;/p&gt;&#xA;" OwnerUserId="520" LastEditorUserId="70" LastEditDate="2011-05-14T17:32:31.683" LastActivityDate="2015-09-13T05:30:25.710" Title="Do binary options make any sense?" Tags="&lt;options&gt;&lt;risk&gt;&lt;binary-options&gt;" AnswerCount="6" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1136" PostTypeId="2" ParentId="1135" CreationDate="2011-05-06T18:41:14.357" Score="5" Body="&lt;p&gt;No. If you are long a vanilla option, your reward is unlimited.  If you are short an option, your risk is unlimited.&lt;/p&gt;&#xA;" OwnerUserId="508" LastActivityDate="2011-05-06T18:41:14.357" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1137" PostTypeId="2" ParentId="1135" CreationDate="2011-05-06T19:17:33.190" Score="6" Body="&lt;p&gt;The key difference besides the cap is that there is nothing in between: its 100 or nothing (binary!) - with traditional options you have S-K as long as S&gt;K (for the call).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find out more here:&#xA;&lt;a href=&quot;http://en.wikipedia.org/wiki/Binary_option&quot;&gt;http://en.wikipedia.org/wiki/Binary_option&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-05-06T19:17:33.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1138" PostTypeId="2" ParentId="1133" CreationDate="2011-05-07T01:04:14.320" Score="4" Body="&lt;p&gt;To get a feel for it think about an extreme scenario.  Suppose I have an order to buy $100bln VWAP in IBM over the course of one day.  My &quot;cost&quot; relative to VWAP will be near zero, b/c I will be on the buy side of every trade that day.  However, my market impact will be extremely high b/c IBM will fall like a rock the next day, leaving me with huge losses.  This is your true cost.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The bottom line is trading will create impact - that is part of your cost.  It is increasing in increasing trade size and decreasing in increasing liquidity of the asset.  VWAP merely spreads the trade out to reduce the impact.  Look at Almgren and Chriss for a discussion of transaction cost functions, or talk to the provider of your VWAP algo for more details.&lt;/p&gt;&#xA;" OwnerUserId="443" LastActivityDate="2011-05-07T01:04:14.320" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1139" PostTypeId="2" ParentId="1135" CreationDate="2011-05-07T16:51:07.517" Score="2" Body="&lt;p&gt;For a long or short position in a vanilla put, the maximum risk/reward is known and capped. For a long position in a vanilla call, the maximum risk is also always known and capped. The maximum reward is therefore known and capped for a short vanilla call position. However, the reward is unbounded for a long vanilla call position, and therefore the risk is likewise unbounded for a short vanilla call.&lt;/p&gt;&#xA;" OwnerUserId="847" LastActivityDate="2011-05-07T16:51:07.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1140" PostTypeId="2" ParentId="1133" CreationDate="2011-05-08T04:27:12.857" Score="0" Body="&lt;p&gt;A factor to take into account: there are algorithms searching for other VWAP algorithms present in the market and then gaming them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.qsg.com/PDFReader.aspx?PUBID=722&quot; rel=&quot;nofollow&quot;&gt;http://www.qsg.com/PDFReader.aspx?PUBID=722&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="225" LastActivityDate="2011-05-08T04:27:12.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1141" PostTypeId="2" ParentId="1135" CreationDate="2011-05-08T09:24:52.340" Score="15" Body="&lt;p&gt;The text of your question doesn't actually match the question title. The answer to your title is of course yes binary options make sense.  And as others have pointed out with binary options your reward is limited, and conversely the risk involved in writing them is less.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer your additional question you can replicate a binary option with a tight call spread around the strike (not ATM as you suggest).  So for example, if you have a binary call struck at K, which pays off 1 if it's ITM and 0 if not, you can replicate that with&#xA;$$&#xD;&#xA;(C(K+\epsilon) - C(K))/\epsilon.&#xD;&#xA;$$&#xA;Where $\epsilon$ is typically the smallest strike unit you can trade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Risk managing these positions can get tricky when the level of the forward gets close to the strike, as the greeks can change sign. &lt;/p&gt;&#xA;" OwnerUserId="371" LastActivityDate="2011-05-08T09:24:52.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1142" PostTypeId="2" ParentId="1127" CreationDate="2011-05-08T09:36:18.400" Score="3" Body="&lt;p&gt;Not sure I understand your question. If I have a fixed stream of payments it has some value $V_{fixed}$ I can always solve for a spread to LIBOR by simply adding the spread $S$ to my calculated stream of LIBOR. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is the value of the LIBOR + spread leg is&lt;br&gt;&#xA;$$&#xD;&#xA;V_{LIBOR}(S) = \sum_{n=1}^{N} D(t_{n}) \alpha(t_{n-1},t_{n}) [L(t_{n-1},t_{n}) + S]&#xD;&#xA;$$&#xA;where $D(t_{n})$ is the discount factor, $\alpha$ is the day count fraction, and $L$ is the LIBOR rate. I just solve &#xA;$$&#xD;&#xA;V_{LIBOR}(S) = V_{fixed}&#xD;&#xA;$$&#xA;for S.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Computing the value of the fixed leg for a TRS might be tricky, as you have to factor in the default probability. But you can hopefully get that from the CDS market.&lt;/p&gt;&#xA;" OwnerUserId="371" LastActivityDate="2011-05-08T09:36:18.400" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1143" PostTypeId="1" AcceptedAnswerId="1144" CreationDate="2011-05-09T04:18:48.443" Score="12" ViewCount="1084" Body="&lt;p&gt;Is there a quantitative method in monitoring trades to reduce the possibility of correlated trades?&lt;/p&gt;&#xA;" OwnerUserId="2318" LastActivityDate="2011-05-10T21:59:51.287" Title="Minimizing Correlation" Tags="&lt;risk&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1144" PostTypeId="2" ParentId="1143" CreationDate="2011-05-09T12:36:44.760" Score="5" Body="&lt;p&gt;The most straightforward approach is to develop a covariance matrix to ensure that you are not overweighting to the same factors or bets in your trading. The covariance matrix can be built off of a factor model, for example, or you can construct a covariance matrix based on your prediction signals if you have multiple models. In this way you can understand the ex-ante historical correlation of your trades.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that there is a considerable amount of art in designing a covariance matrix (See Fabozzi).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without understanding more about your approach it's hard to be more helpful than the above approach.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2011-05-09T12:36:44.760" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1145" PostTypeId="2" ParentId="1143" CreationDate="2011-05-09T15:05:46.310" Score="3" Body="&lt;p&gt;Historical correlation isn't as useful as you might think.   Like volatility, correlation is not constant.   During times of stress, it is common for the correlation of many different assets to increase/change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As examples, look at the data for August 2007, the last quarter of 2008, and May 6, 2010.  Any trading scheme that minimized correlation before those periods probably had a much different affect during those periods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit 1 (05/10/2011) ===========================&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've bumped into all sorts of problems with this issue, with the estimation itself involving large errors.   If you dig around, you'll find several papers with important improvements.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.ledoit.net/honey.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.ledoit.net/honey.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://arxiv.org/PS_cache/arxiv/pdf/1009/1009.5331v1.pdf&quot; rel=&quot;nofollow&quot;&gt;http://arxiv.org/PS_cache/arxiv/pdf/1009/1009.5331v1.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.oxford-man.ox.ac.uk/documents/papers/2011OMI08_Sheppard.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.oxford-man.ox.ac.uk/documents/papers/2011OMI08_Sheppard.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.christoffersen.ca/CHRISTOP/2007/RM2006_introduction.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.christoffersen.ca/CHRISTOP/2007/RM2006_introduction.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.kevinsheppard.com/images/4/47/Chapter8.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.kevinsheppard.com/images/4/47/Chapter8.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.kevinsheppard.com/images/d/de/CES_JFeC.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.kevinsheppard.com/images/d/de/CES_JFeC.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.kevinsheppard.com/images/c/c6/Patton_Sheppard.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.kevinsheppard.com/images/c/c6/Patton_Sheppard.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="392" LastEditorUserId="392" LastEditDate="2011-05-10T21:59:51.287" LastActivityDate="2011-05-10T21:59:51.287" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1146" PostTypeId="2" ParentId="1004" CreationDate="2011-05-09T16:21:19.633" Score="5" Body="&lt;p&gt;The Brown et al. paper and its connection with trading is discussed here: &lt;a href=&quot;http://jochenleidner.posterous.com:80/from-speech-recognition-to-trading&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://jochenleidner.posterous.com:80/from-speech-recognition-to-trading&lt;/a&gt;  (&lt;a href=&quot;https://web.archive.org/web/20110528070947/http://jochenleidner.posterous.com:80/from-speech-recognition-to-trading&quot; rel=&quot;nofollow noreferrer&quot;&gt;mirror&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="854" LastEditorUserId="2183" LastEditDate="2017-07-17T07:33:43.107" LastActivityDate="2017-07-17T07:33:43.107" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1147" PostTypeId="2" ParentId="1119" CreationDate="2011-05-09T17:10:21.337" Score="1" Body="&lt;p&gt;Let me expand on the problem scope a little, to include company information and stock quotes as well. &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;German company information&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://bafin.de/EN/Home/homepage__node.html?__nnn=true&quot; rel=&quot;nofollow&quot;&gt;BaFin has an English page&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;Norwegian company information&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.newsweb.no/newsweb/search.do?siteLanguage=en&quot; rel=&quot;nofollow&quot;&gt;Newsweb&lt;/a&gt;; choose your company&#xA;name from the Issuer pulldown. &#xA;Change the From Date/To Date and a&#xA;search will give you headlines into&#xA;the issues.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;They are not as detailed as a prospectus, but they had the salient details for convertible bonds that I was looking for.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Norwegian stock quotes&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.reuters.com/finance/stocks&quot; rel=&quot;nofollow&quot;&gt;Reuters&lt;/a&gt;; enter the company name&#xA;in the search field. The .OL suffix&#xA;means you're on the Oslo exchange.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.marketwatch.com/&quot; rel=&quot;nofollow&quot;&gt;MarketWatch&lt;/a&gt;; enter the company&#xA;name in the search field. The NO:&#xA;prefix means that you're looking at&#xA;Norway.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;Norwegian bond information&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ose-demo.manamind.com/ob_eng/markedsaktivitet/bondSearch?newt__menuCtx=1.2.SEARCH&quot; rel=&quot;nofollow&quot;&gt;Oslo Børs&lt;/a&gt;; Enter the ISIN.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The bond I was looking for was not found on the Oslo Børs. Instead, I went to &#xA;&lt;a href=&quot;http://www.google.no&quot; rel=&quot;nofollow&quot;&gt;Google Norway&lt;/a&gt; and typed in the word &quot;marked&quot; (Market) and the ISIN, which had a NO prefix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This led me to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.boerse-frankfurt.de/EN/index.aspx?pageID=126&quot; rel=&quot;nofollow&quot;&gt;Börse Frankfurt&lt;/a&gt;. I entered the&#xA;ISIN in the Name/ISIN/Symbol Search&#xA;field.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;That got me the quote I was looking for. Note that while Börse Frankfurt had the quote, Börse Stuttgart did not. Further, the convertible bond I was looking for was denominated in EUR, not NOK, which is probably why it was quoted on a Stuttgart exchange, but not an Oslo exchange.&lt;/p&gt;&#xA;" OwnerUserId="343" LastActivityDate="2011-05-09T17:10:21.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1148" PostTypeId="1" CreationDate="2011-05-10T10:00:36.507" Score="5" ViewCount="958" Body="&lt;p&gt;in their paper &quot;European Real Options: An intuitive algorithm for the Black and Scholes Formula&quot; Datar and Mathews provide a proof in the appendix on page 50, which is not really clear to me. It's meant to show the equivalence of their formula $E_{o}(max(s_{T}e^{-\mu T}-xe^{-rT},0))$ and Black and Scholes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They refer to Hull(2000), define $y=s_{T}e^{-\mu T}$, and then do the following transformation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E_{o}(max(s_{T}e^{-\mu T}-xe^{-rT},0))$&#xA;$=\intop_{-xe^{-rT}}^{\infty}(s_{T}*e^{-\mu T})g(y)dy$ &#xA;$=E(s_{T}e^{-\mu T})N_{d_{1}}-xe^{-rT}N_{d_{2}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An addition: Actually, in the paper it says $E_{o}(max(s_{T}e^{-\mu T}-xe^{-rT}),0)$, so the 0 is outside the brackets. However, I am not sure, if that is a typo and should rather be $E_{o}(max(s_{T}e^{-\mu T}-xe^{-rT},0))$. I am not familiar with a function E(max(x),0)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mu$ and $r$ are two different discount rates, one being the WACC and the other one the riskless rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could I substitute $V=s_{0}e^{-\mu T},K=xe^{-rT}$, go through the BS steps and re-substitute? In other words, under what constrains is $E\left[max(V-K,0)\right]=E(V)N(d_{1})-KN(d_{2})$ valid?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The research related to it is a comparison of different real option pricing method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anybody help me out?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Corn&lt;/p&gt;&#xA;" OwnerUserId="860" LastEditorUserId="860" LastEditDate="2011-05-18T09:53:51.463" LastActivityDate="2011-05-18T09:53:51.463" Title="Better understanding of the Datar Mathews Method - Real Option Pricing" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;financial-engineering&gt;&lt;quantitative&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1150" PostTypeId="1" AcceptedAnswerId="1154" CreationDate="2011-05-10T15:44:39.800" Score="55" ViewCount="67953" Body="&lt;p&gt;Let the Black-Scholes formula be defined as the function $f(S, X, T, r, v)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm curious about functions that are computationally simpler than the Black-Scholes that yields results that approximate $f$ for a given set of inputs $S, X, T, r, v$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that &quot;computationally simpler&quot; is not well-defined. But I mean simpler in terms of number of terms used in the function. Or even more specifically, the number of distinct computational steps that needs to be completed to arrive at the Black-Scholes output.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously Black-Scholes is computationally simple as it is, but I'm ready to trade some accuracy for an even simpler function that would give results that approximate B&amp;amp;S.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does any such simpler approximations exist?&lt;/p&gt;&#xA;" OwnerUserId="526" LastEditorUserId="30479" LastEditDate="2018-04-04T08:44:56.523" LastActivityDate="2019-07-15T16:14:57.170" Title="What are some useful approximations to the Black-Scholes formula?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;optimization&gt;" AnswerCount="8" CommentCount="0" FavoriteCount="69" ContentLicense="CC BY-SA 3.0" />
  <row Id="1152" PostTypeId="2" ParentId="1150" CreationDate="2011-05-10T16:30:48.853" Score="39" Body="&lt;p&gt;This one is the best approximation I have ever seen:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If you hate computers and computer&#xA;  languages don't give up it's still&#xA;  hope! What about taking Black-Scholes&#xA;  in your head instead? If the option is&#xA;  about at-the-money-forward and it is a&#xA;  short time to maturity then you can&#xA;  use the following approximation:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;call = put = StockPrice * 0.4 *&#xA;  volatility * Sqrt( Time )&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;a href=&quot;http://www.espenhaug.com/black_scholes.html&quot;&gt;http://www.espenhaug.com/black_scholes.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-05-10T16:30:48.853" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1153" PostTypeId="2" ParentId="1150" CreationDate="2011-05-10T19:34:10.337" Score="19" Body="&lt;p&gt;In addition to what &lt;em&gt;vonjd&lt;/em&gt; already posted I would recommend you to look at the E.G. Haug's article - &lt;a href=&quot;http://www.wilmott.com/pdfs/010721_collector_01.pdf&quot;&gt;The Options Genius. Wilmott.com&lt;/a&gt;. You can find some aproximations of BS not only for vanilla european call and put but even for some exotics. For example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;chooser option:  call = put = $0.4F_{0} e^{-\mu T}\sigma(\sqrt{T}-\sqrt{t})$&lt;/li&gt;&#xA;&lt;li&gt;asian option: call = put = $0.23F_{0} e^{-\mu T}\sigma(\sqrt{T}+2\sqrt{t})$&lt;/li&gt;&#xA;&lt;li&gt;floating strike lookback call = $0.8F_{0} e^{-\mu T}\sigma\sqrt{T} - 0.25{\sigma^2}T$&lt;/li&gt;&#xA;&lt;li&gt;floating strike lookback put = $0.8F_{0} e^{-\mu T}\sigma\sqrt{T} + 0.25{\sigma^2}T$&lt;/li&gt;&#xA;&lt;li&gt;forward spread: call = put = $0.4F_{1} e^{-\mu T}\sigma\sqrt{T}$ &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="15" LastActivityDate="2011-05-10T19:34:10.337" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1154" PostTypeId="2" ParentId="1150" CreationDate="2011-05-10T19:37:19.613" Score="51" Body="&lt;p&gt;This is just to expand a bit on &lt;a href=&quot;https://quant.stackexchange.com/a/1152/129&quot;&gt;vonjd's answer&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The approximate formula mentioned by vonjd is due to Brenner and Subrahmanyam  (&quot;A simple solution to compute the Implied Standard Deviation&quot;, &lt;em&gt;Financial Analysts Journal&lt;/em&gt; (1988), pp. 80-83). I do not have a free link to the paper so let me just give a quick and dirty derivation here. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the at-the-money call option, we have $S=Ke^{-r(T-t)}$. Plugging this into the standard Black-Scholes formula&#xA;$$C(S,t)=N(d_1)S-N(d_2)Ke^{-r(T-t)},$$&#xA;we get that&#xA;$$C(S,t)=\left[N\left(\frac{1}{2}\sigma\sqrt{T-t}\right)-N\left(-\frac{1}{2}\sigma\sqrt{T-t}\right)\right]S.\qquad\qquad(1)$$&#xA;Now, Taylor's formula implies for small $x$ that&#xA;$$N(x)=N(0)+N'(0)x+N''(0)\frac{x^2}{2}+O(x^3).\qquad\qquad\qquad\qquad(2)$$&#xA;Combining (1) and (2), we will get with some obvious cancellations that&#xA;$$C(S,t)=S\left(N'(0)\sigma\sqrt{T-t}+O(\sigma^3\sqrt{(T-t)^3})\right).$$&#xA;But&#xA;$$N'(0)=\frac{1}{\sqrt{2\pi}}=0.39894228...$$&#xA;so finally we have, for small $\sigma\sqrt{T-t}$, that&#xA;$$C(S,t)\approx 0.4S\sigma\sqrt{T-t}.$$&#xA;The modified formula&#xA;$$C(S,t)\approx 0.4Se^{-r(T-t)}\sigma\sqrt{T-t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;gives a slightly better approximation.&lt;/p&gt;&#xA;" OwnerUserId="70" LastEditorUserId="70" LastEditDate="2017-12-01T08:28:17.153" LastActivityDate="2017-12-01T08:28:17.153" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1155" PostTypeId="2" ParentId="1148" CreationDate="2011-05-11T13:13:32.337" Score="3" Body="&lt;p&gt;I don't know what $\mu$ stands for in the model so let me just recall the standard Black-Scholes formalism. It's likely that everything can be extended with minor modifications to the model you're interested in. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The price of the vanilla call option with a strike $K$ is equal to the expectation of the discounted pay-off&#xA;$$C_K=\mathbb E(e^{-rT}(S_T-K)_+),$$ &#xA;where $(S_T-K)_+:=\max(S_T-K,0)$ and $\mathbb E$ is taken with respect to the risk-neutral measure $\mathbb P$.  Assuming that $\mathbb P$ admits a continuous density $p(y)$, we have that &#xA;$$\mathbb E(e^{-rT}(S_T-K)_+)=\int_{-\infty}^{\infty}e^{-rT}(S_T-K)_+p(S_T)dS_T.$$&#xA;Now, in the risk-neutral Black-Scholes world&#xA;$$S_T=S_0\exp\left(rT-\frac{1}{2}\sigma^2T+\sigma\sqrt{T}N(0,1)\right).$$&#xA;Recalling that the density of $N(0,1)$ is $\frac{1}{\sqrt{2\pi}}e^{-s^2/2}$, we get that&#xA;$$C_K=\frac{e^{-rT}}{\sqrt{2\pi}}\int_{-\infty}^{\infty}e^{-s^2/2}\left(S_0\exp\left(rT-\frac{1}{2}\sigma^2T+\sigma\sqrt{T}s\right)-K\right)_+ds.$$&#xA;The integrand is non-zero if and only if &#xA;$$S_0\exp\left(rT-\frac{1}{2}\sigma^2T+\sigma\sqrt{T}s\right)&amp;gt;K,$$&#xA;i.e. when&#xA;$$s&amp;gt; a=\frac{\ln(K/S_0)+\sigma^2T/2-rT}{\sigma\sqrt{T}}.$$&#xA;Therefore&#xA;$$C_K=\frac{e^{-rT}}{\sqrt{2\pi}}\int_{a}^{\infty}e^{-s^2/2}S_0\exp\left(rT-\frac{1}{2}\sigma^2T+\sigma\sqrt{T}s\right)ds-\frac{e^{-rT}}{\sqrt{2\pi}}\int_{a}^{\infty}e^{-s^2/2}Kds,$$&#xA;which implies after some straightforward manipulations the standard Black-Scholes formula&#xA;$$C_K=S_0N(d_1)-Ke^{-rT}N(d_2).$$&#xA;Note that $S_0=\mathbb E(e^{-rT}S_T)$ since the discounted stock price is a martingale under the risk-neutral measure.&lt;/p&gt;&#xA;" OwnerUserId="70" LastEditorUserId="70" LastEditDate="2011-05-11T14:24:16.200" LastActivityDate="2011-05-11T14:24:16.200" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1156" PostTypeId="2" ParentId="1110" CreationDate="2011-05-12T00:21:53.153" Score="1" Body="&lt;p&gt;If it is option on future, you don't need the spot price at all. &#xA;use the unaltered units for S and K, and you should get results for IV that make sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you think they don't make sense, just plug your IV result back in and verify that you get the option price back correctly.&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-05-12T00:21:53.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1157" PostTypeId="1" AcceptedAnswerId="3625" CreationDate="2011-05-12T08:58:41.877" Score="17" ViewCount="1103" Body="&lt;p&gt;I tried it in several symbols and timeframes with the same result:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac {mean(HIGH-LOW)}{mean(|CLOSE-OPEN|)}$$&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Symbol       Result&#xA;------       ------&#xA;EURUSD:W1    1.9725  &#xA;EURUSD:D1    2.0023 &#xA;EURUSD:H1    2.1766  &#xA;USDJPY:W1    1.9949 &#xA;USDJPY:D1    2.0622  &#xA;USDJPY:H1    2.2327 &#xA;SAN.MC:D1    2.0075  &#xA;BBVA.MC:D1   2.0075    &#xA;REP.MC:D1    2.1320&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="867" LastEditorUserId="1355" LastEditDate="2012-06-16T13:21:31.823" LastActivityDate="2012-06-16T13:21:31.823" Title="Why is the ratio of Hi-Low range to Open-Close range close to 2?" Tags="&lt;data&gt;&lt;analysis&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="1158" PostTypeId="2" ParentId="998" CreationDate="2011-05-12T10:25:30.383" Score="8" Body="&lt;p&gt;Maybe a better answer: &lt;a href=&quot;http://quantivity.wordpress.com/2011/05/08/manifold-learning-differential-geometry-machine-learning/#more-5397&quot;&gt;http://quantivity.wordpress.com/2011/05/08/manifold-learning-differential-geometry-machine-learning/#more-5397&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="134" LastActivityDate="2011-05-12T10:25:30.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1159" PostTypeId="1" CreationDate="2011-05-12T13:42:49.857" Score="12" ViewCount="625" Body="&lt;p&gt;I have recently seen a paper about the Boeing approach that replaces the &quot;normal&quot; Stdev in the BS formula with the Stdev&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\sigma'=\sqrt{\frac{ln(1+\frac{\sigma}{\mu})^{2}}{t}}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma$ and $\mu$ being the &quot;normal&quot; Stdev and Mean, respectively. (Both in absolute values, resulting from a simulation of the pay-offs.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since it is about real options, it sounds reasonable to have the volatility decrease approaching the execution date of a project, but why design the volatility like this? I have plotted the function &lt;a href=&quot;http://www.wolframalpha.com/input/?i=plot%20%5Csqrt%7B%5Cfrac%7Bln%281%2b%5Cfrac%7B5%7D%7B100%7D%29%5E%7B2%7D%7D%7Bt%7D%7D%20for%20t=0..10&quot;&gt;here&lt;/a&gt; via Wolframalpha.com. Even though the volatility should be somewhere around 10% in this example, it never assumes that value. Why does that make sense?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've run a simulation and compared the values. Since the volatility changes significantly, the option value changes, of course, are significant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here some equivalent expressions. Maybe it reminds somebody of something that might help?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Longleftrightarrow t\sigma&amp;#39;^{2}=ln(1+\frac{\sigma}{\mu})^{2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Longleftrightarrow\sqrt{exp(t\sigma&amp;#39;^{2})}-1=\frac{\sigma}{\mu}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Longleftrightarrow\sigma=\mu\left[\sqrt{exp(t\sigma&amp;#39;^{2})}-1\right]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It somehow looks similar to the arithmetic moments of the log-normal distribution, but it does not fit 100%.&lt;/p&gt;&#xA;" OwnerUserId="860" LastEditorUserId="860" LastEditDate="2011-05-18T14:55:56.017" LastActivityDate="2021-04-02T12:01:45.173" Title="Transformation of Volatility - BS" Tags="&lt;option-pricing&gt;&lt;stochastic-calculus&gt;&lt;stochastic-volatility&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1160" PostTypeId="2" ParentId="447" CreationDate="2011-05-12T17:23:16.910" Score="6" Body="&lt;p&gt;My research so far:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OptionsXPress - with commissions of about USD 1.25/contract. USD 1K minimum account opening. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interactive Brokers (IB) - with commissions of about USD 0.70-1.00/contract. USD 10K minimum account opening.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;TradeStation - with commissions of about USD 1/contract. One point to note is that TradeStation's &lt;a href=&quot;http://en.wikipedia.org/wiki/EasyLanguage&quot;&gt;EasyLanguage&lt;/a&gt; platform is NOT a true API and orders can only be executed via EasyLanguage and it's not a full API as per the sales rep. So, if you want to execute more complicated trading strategies (e.g. if front month call IV exceeds) you won't be able to execute it there. USD 1K minimum account opening.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lightspeed - with commissions of about USD 0.60/contract. USD 30K Minimum account opening for using APIs.&lt;/p&gt;&#xA;" OwnerUserId="869" LastEditorUserId="35" LastEditDate="2011-05-12T17:59:10.567" LastActivityDate="2011-05-12T17:59:10.567" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1161" PostTypeId="1" AcceptedAnswerId="1667" CreationDate="2011-05-12T17:41:36.200" Score="15" ViewCount="1175" Body="&lt;p&gt;In the paper &quot;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1012075&quot;&gt;Why We Have Never Used the Black-Scholes-Merton Option Pricing Formula&lt;/a&gt;&quot; (&lt;a href=&quot;http://en.wikipedia.org/wiki/Espen_Gaarder_Haug&quot;&gt;Espen Gaarder Haug&lt;/a&gt;, &lt;a href=&quot;http://en.wikipedia.org/wiki/Nassim_Nicholas_Taleb&quot;&gt;Nassim Nicholas Taleb&lt;/a&gt;) a couple of model-free arbitrage conditions are mentioned which limits the degrees of freedom for an option trader.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The four conditions mentioned in the paper are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Put-call parity (obviously)&lt;/li&gt;&#xA;&lt;li&gt;A call with strike $K$ cannot trade at a lower price than call $K+\delta K$ (avoidance of negative call and put spreads)&lt;/li&gt;&#xA;&lt;li&gt;A call struck at $K$ and a call struck at $K+2*\delta K$ cannot be more expensive than twice the price of a call struck at $K+\delta K$ (negative butterflies)&lt;/li&gt;&#xA;&lt;li&gt;Horizontal calendar spreads cannot be negative (when interest rates are low)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;b&gt;What other such model/assumption-free no-arbitrage conditions exist in options trading?&lt;/b&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, conditions that reduce the degrees of freedom for a rational option trader regardless of his or hers subjective beliefs (such as belief in a certain model, etc.).&lt;/p&gt;&#xA;" OwnerUserId="526" LastEditorUserId="526" LastEditDate="2011-05-12T18:36:21.207" LastActivityDate="2015-05-16T07:22:10.790" Title="What are important model and assumption-free no-arbitrage conditions in options trading?" Tags="&lt;options&gt;&lt;option-pricing&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="1162" PostTypeId="1" AcceptedAnswerId="1165" CreationDate="2011-05-12T19:20:21.213" Score="24" ViewCount="2461" Body="&lt;p&gt;Put-call parity is given by $C + Ke^{-r(T-t)} = P + S$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The variables $C$, $P$ and $S$ are directly observable in the market place. $T-t$ follows by the contract specification.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The variable $r$ is the risk-free interest rate -- the &lt;i&gt;theoretical&lt;/i&gt; rate of return of an investment with zero risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In theory that's all very simple. But in practice there is no &lt;i&gt;one&lt;/i&gt; objective risk-free interest rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in reality, how would you go about setting $r$? Why?&lt;/p&gt;&#xA;" OwnerUserId="526" LastActivityDate="2018-06-21T16:12:54.790" Title="Setting the r in put-call parity?" Tags="&lt;options&gt;&lt;interest-rates&gt;&lt;put-call-parity&gt;" AnswerCount="6" CommentCount="1" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="1163" PostTypeId="2" ParentId="1162" CreationDate="2011-05-12T21:44:14.747" Score="9" Body="&lt;p&gt;I think you might use the relevant OIS-rate like EONIA or Fed Fund Rate, at least this is the current fad when discounting interest rate swaps.&lt;/p&gt;&#xA;" OwnerUserId="357" LastActivityDate="2011-05-12T21:44:14.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1164" PostTypeId="2" ParentId="1162" CreationDate="2011-05-13T00:12:28.030" Score="18" Body="&lt;p&gt;This is not a trivial question. Here's a relevant excerpt (an appetizer, really) from &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0135052831&quot;&gt;Hull's book&lt;/a&gt; (7th Edition, P. 75):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;It is natural to assume that the rates on Treasury bills and Treasury bonds are the correct benchmark risk-free rates for derivative traders working for financial institutions. In fact, these derivative traders usually use LIBOR rates as short-terrn risk-free rates. This is because they regard LIBOR as their opportunity cost of capital (see Section 4.1). Traders argue that Treasury rates are too low to be used as risk-free rates because: &lt;/p&gt;&#xA;  &#xA;  &lt;ol&gt;&#xA;  &lt;li&gt;Treasury bills and Treasury bonds must be purchased by financial institutions &#xA;  to fulfill a variety of regulatory requirements. This increases demand for these &#xA;  Treasury instruments driving the price up and the yield down.&lt;/li&gt;&#xA;  &lt;li&gt;The amount of capital a bank is required to hold to  support an investment in &#xA;  Treasury bills and bonds is substantially smaller than the capital required to &#xA;  support a similar investment in other instruments with very low risk.&lt;/li&gt;&#xA;  &lt;li&gt;In the United States, Treasury instruments are given a favorable tax treatment &#xA;  compared with most other fixed-income investments because they are not taxed &#xA;  at the state level.&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;  &#xA;  &lt;p&gt;LIBOR is approximately equal to the short-term borrowing rate of a AA-rated company. It is therefore not a perfect proxy for the risk-free rate. There is a small chance that a AA borrower will default within the life of a LIBOR loan.  Nevertheless, traders feel it is the best proxy for them to use. LIBOR rates are quoted out to 12 months. As we shall see in Chapter 7, the Eurodollar futures market and the swap market are used to extend the trader's proxy for the risk-free rate beyond 12 months. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="70" LastActivityDate="2011-05-13T00:12:28.030" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1165" PostTypeId="2" ParentId="1162" CreationDate="2011-05-13T06:05:52.757" Score="16" Body="&lt;p&gt;If your trades are collateralized/margined, you should use the rate paid on your collateral/margin.&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2011-05-13T06:05:52.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1166" PostTypeId="1" AcceptedAnswerId="1181" CreationDate="2011-05-13T15:05:09.630" Score="7" ViewCount="262" Body="&lt;p&gt;Assume a stock Foo with a single share class.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, assume a dual class stock Bar with classes I and II with different voting rights.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The shares in the different classes have equal cash flow rights.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The market for shares in class I are substantially more liquid than the market for shares in class II.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why would a market maker prefer making markets in share Bar (the dual class share) rather than in the single class share (Foo)? Or more generally, what market making opportunities arise only in dual class shares?&lt;/p&gt;&#xA;" OwnerUserId="526" LastActivityDate="2011-05-19T17:43:08.853" Title="How are dual class shares different from non dual class shares from a market makers' perspective?" Tags="&lt;high-frequency&gt;&lt;equities&gt;&lt;market-making&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1167" PostTypeId="2" ParentId="1004" CreationDate="2011-05-13T16:15:17.590" Score="13" Body="&lt;p&gt;In a very, very general sense, what  Renaissance Technologies does well [and others try to do, many do less well] is understand where the &quot;true&quot; signal is (i.e. where prices should be) and what is noise (i.e. over-/under-reactions by others in the market) in the total signal of market prices.  Generally, trading profits are made by taking the opposing position to someone who over- / under-reacts to where the market price is going to be because the market will &quot;come back&quot; to the true price.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cryptographic algorithms and speech recognition algorithms have been developed to accomplish essentially the same thing ... it's necessary to separate noise from underlying signal in those and other applications of information theory, basically this is machine learning ... in general, becoming proficient in machine learning is skill that applies in many fields and for the mathematically-inclined individual, it is well worth studying [because there are so many applications, not just trading].  A good starting point would be the &lt;a href=&quot;http://www.youtube.com/results?search_query=Machine%20Learning%20%28Stanford%29&amp;amp;aq=f&quot;&gt;lectures by Andrew Ng of Stanford University&lt;/a&gt;      &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Attempting to beat the hedge funds really isn't something that should be copied by amateurs, i.e. it's an expensive way to get an &lt;em&gt;education&lt;/em&gt; ... the algorithms are dynamic; the people using these algorithms must be faster, better, smarter than others who are using these algorithms ... continually updated, adjusted, advanced, accelerated, sharpened by teams of very smart people ... Renaissance isn't alone; it has smart competitors; there's a constant struggle by well-capitalized new firms with smart founders to make these adjustments with smarter, brighter, more capable teams of people who have access to better, faster technologies ... for example, many these algorithms must now execute so rapidly that it's necessary to use specifically-designed hardware that use ASIC integrated circuits or similar hardware, i.e. software on a supercomputer isn't fast enough to execute the trades ... the oscillation of the noise around the signal happens faster and faster. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally, the world benefits by the development of these algorithms and hardware, because the advances in this technology can eventually &quot;spill over&quot; into other projects in the rest of the world ... you aren't likely to find out what Renaissance Technologies and its competitors are doing primarily mostly because the people doing it don't have time [while they are doing it] to write papers and explain; it's not really that they want to keep secrets (i.e. there's some advantage to having your competition look at what you were doing last month, last year because by the time they understand it, you already know how to beat your old strategy), it's mostly that they don't have time / inclination to write up the explanation just yet ... as with all pursuits, the day eventually arrives where a person just doesn't really care any more and maybe wants to answer questions or tell the story.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone who smugly tells you that they can't tell you because it's a secret basically is telling you they're just somebody like Mr. HR-clerical-job-app-screening-person and they couldn't begin to understand -- so it is easier for them to tell you that it's a secret.  It's not that much of a secret ... mostly, it just happens fast ... so you need to be able to pick it up on your own without somebody explaining ... if you need to learn by having it explained, you shouldn't try to use it.   &lt;/p&gt;&#xA;" OwnerUserId="121" LastEditorUserId="121" LastEditDate="2011-05-13T16:24:56.137" LastActivityDate="2011-05-13T16:24:56.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1168" PostTypeId="2" ParentId="1135" CreationDate="2011-05-13T17:00:57.600" Score="4" Body="&lt;p&gt;They would make sense in certain narrow applications; one can perhaps think about scenarios where binary option might be the most efficient, quickest or easiest way to either benefit from a particular insight OR to hedge against some sort of event ... the real question is whether the volume in the markets for binary options will continue to sufficient to generate enough liquidity to render them as a practical alternative for different people who might have a reason to engage in either sides of the trade.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, whether they make sense or not depends upon whether there are enough people who believe that other enough people will believe that they make sense.  This is true for any any asset or derivative market.  All markets fail (i.e. stop making sense) when people stop believing that other people believe that the market has stopped making sense for anyone.&lt;/p&gt;&#xA;" OwnerUserId="121" LastActivityDate="2011-05-13T17:00:57.600" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1169" PostTypeId="2" ParentId="998" CreationDate="2011-05-13T17:18:57.553" Score="1" Body="&lt;p&gt;It is neither Holy Grail nor next Madoff, although it could be &lt;strong&gt;&lt;em&gt;perceived&lt;/em&gt;&lt;/strong&gt; as the former if it continues to do well or could be &lt;strong&gt;&lt;em&gt;perceived&lt;/em&gt;&lt;/strong&gt; as the latter if it crashes and burns ... but that's just because the general populace [including the financial news media] are so clueless about economic theory, quantitative finance and the practical details of how trading is done ... the methods of Renaissance pretty straightforward; they are not about some sort of magic talisman voodoo witchcraft OR aggressively seeking out idiots and tricking honest people to believe in some sort of magic talisman.  &lt;/p&gt;&#xA;" OwnerUserId="121" LastActivityDate="2011-05-13T17:18:57.553" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1170" PostTypeId="2" ParentId="1157" CreationDate="2011-05-15T20:50:54.777" Score="3" Body="&lt;p&gt;Unfortunately, I cannot answer fully your question. Though I'll give you my partial answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all, using entire price history of an index (from Yahoo), this is what I got:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;                   Daily   Weekly   Monthly&#xA;DJIA               2.91    2.37     2.33&#xA;NASDAQ 100         1.74    1.94     1.91&#xA;NYSE Composite     1.61    1.59     1.85&#xA;S&amp;amp;P 100            1.75    1.90     1.97&#xA;S&amp;amp;P 600 Small Cap  1.59    1.82     1.99&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Based on this, I don't think we can claim that the ratio is always 2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you agree, that the ratio is not always 2. But still, you want to know why it is equal to  2.91 or 1.59 or whatever. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is how I would proceed in answering the question. First, the ratio can be expressed as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{E[max(P_1, P_2,...,P_n)-min(P_1, P_2,...,P_n)]} {E[|P_1 - P_n|]}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, I would start expanding the fraction in order to get a better picture of what exactly influences the ratio. I hope to expand the fraction, and then have some terms cancel each other out and then obtain as an answer 2, $\sigma / \mu$, or something else concise and beautiful. The problem is, it is extremely hard (at least for me) to obtain analytical expression for the expected value of a maximum (or minimum) of a sequence of correlated non-normal variables--the prices. I do not think anyone can give you the analytical expression for that. So this is where it ends as for analytical answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also use numerical methods, something like Monte Carlo simulation. Assume some model for prices, simulate them, and do some sensitivity analysis in parameters of the model to see how they affect the ratio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, one thing I do not get is why you are interested in that ratio. Shoundn't you instead be interested in $$ E(\frac{max(P_1, P_2,...,P_n)-min(P_1, P_2,...,P_n)]} {|P_1 - P_n|})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example if the true expected value of the above ratio is equal to 10, and during a trading day the price is such that the ratio is 20, you would start buying the asset because you expect the close price to be higher than the current price. You would then sell the asset for a profit. Using your definition of the ratio, I see no usefulness in it. Care to explain?&lt;/p&gt;&#xA;" OwnerUserId="796" LastActivityDate="2011-05-15T20:50:54.777" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1171" PostTypeId="1" AcceptedAnswerId="1188" CreationDate="2011-05-17T16:33:09.370" Score="6" ViewCount="219" Body="&lt;p&gt;I am looking at closed-form options approximations, in particular the &lt;a href=&quot;http://old.nhh.no/for/dp/2002/0902.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bjerksund-Stensland model&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have run into a very basic question. How should I scale the input variables in regard to time? My assumptions would be:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;r (riskless interest rate) should be an annual rate, so if the 3-month T-bill yields 0.03%, then I should use .12.&lt;/li&gt;&#xA;&lt;li&gt;σ (variance) should be annual (and according to &lt;a href=&quot;https://quant.stackexchange.com/questions/47/how-to-calculate-future-distribution-of-price-using-volatility/49#49&quot;&gt;How to calculate future distribution of price using volatility?&lt;/a&gt;, variance scales with the &lt;em&gt;square root&lt;/em&gt; of time.&lt;/li&gt;&#xA;&lt;li&gt;T (time to expiration) should be in years, so expiration in 83 days would be 83/365 (=0.227397) years.&lt;/li&gt;&#xA;&lt;li&gt;b (cost of carry) should be an annual rate.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Have I got that right? Are there other input variables that I will need to scale before plugging in?&lt;/p&gt;&#xA;" OwnerUserId="343" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2011-05-20T02:31:16.230" Title="How to scale option pricing components in regard to time" Tags="&lt;option-pricing&gt;&lt;interest-rates&gt;&lt;models&gt;&lt;variance&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1172" PostTypeId="1" AcceptedAnswerId="1196" CreationDate="2011-05-18T09:37:33.630" Score="19" ViewCount="5189" Body="&lt;p&gt;&lt;br&gt;&#xA;Recently I started working in an algotrading company as a programmer.&lt;br&gt;&#xA;After I studied that subject a little in the university and read a book or two in that field I gained a little knowledge in that area.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But apparently very little.&lt;br&gt;&#xA;I mean, when I studied it at the beginning from books I learnt about options and futures,  bull spread and condors, delta and gamma. And in every book the matterial was a bit same.&lt;br&gt;&#xA;When I entered the company, I notices that the whole language is different.&#xA;The traders trade positions not stocks, they buy volatility not assets. They care about vanna and vomma almost as they do for gamma.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I feel that their language is yet unclear.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for a book that bridges this gap. What I dont like is another book that explains options, gamma and yet another simple bull spread. I feel that the books i have read are detached from real life jargon. (Neither would I want a heavy mathematical book)&lt;/p&gt;&#xA;" OwnerUserId="722" LastEditorUserId="80" LastEditDate="2011-05-18T14:37:13.730" LastActivityDate="2012-04-13T02:08:27.390" Title="Looking for a recommendation for a real life volatily trading book." Tags="&lt;volatility&gt;&lt;books&gt;" AnswerCount="7" CommentCount="0" FavoriteCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="1173" PostTypeId="2" ParentId="1172" CreationDate="2011-05-18T10:05:10.083" Score="13" Body="&lt;p&gt;I've read &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/B000UG9JQA&quot;&gt;N. Taleb. Dynamic hedging&lt;/a&gt; for exactly the same reason and found it quite helpful. You can find a preview at &lt;a href=&quot;http://books.google.com/books?id=-5-OldaTjVQC&quot;&gt;Google Books&lt;/a&gt; to examine the content - the greatest thing about this book that N. Taleb tries to show how things work in pracice not just how to derive another formula (what is a subjsect for other great books on quantitative finance).&lt;/p&gt;&#xA;" OwnerUserId="15" LastEditorUserId="15" LastEditDate="2011-05-18T12:47:20.143" LastActivityDate="2011-05-18T12:47:20.143" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1174" PostTypeId="2" ParentId="1172" CreationDate="2011-05-18T13:06:20.500" Score="6" Body="&lt;p&gt;Check out &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470181990&quot; rel=&quot;nofollow&quot;&gt;Volatility Trading&lt;/a&gt; by Euan Sinclair.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are previews available on both Amazon and Google Books.&lt;/p&gt;&#xA;" OwnerUserId="90" LastActivityDate="2011-05-18T13:06:20.500" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1175" PostTypeId="2" ParentId="1172" CreationDate="2011-05-18T13:06:25.353" Score="5" Body="&lt;p&gt;Natenberg's &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/155738486X&quot; rel=&quot;nofollow&quot;&gt;Options Volatility and Pricing&lt;/a&gt; is an excellent resource, and goes into pretty solid detail about why you should be trading volatility rather than direction.&lt;/p&gt;&#xA;" OwnerUserId="833" LastActivityDate="2011-05-18T13:06:25.353" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1176" PostTypeId="2" ParentId="1172" CreationDate="2011-05-18T13:08:34.697" Score="3" Body="&lt;p&gt;Another good book is &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0471578320&quot; rel=&quot;nofollow&quot;&gt;Option Market Making&lt;/a&gt; by Allen Jan Baird.&lt;/p&gt;&#xA;" OwnerUserId="90" LastActivityDate="2011-05-18T13:08:34.697" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1177" PostTypeId="1" AcceptedAnswerId="1180" CreationDate="2011-05-18T17:03:54.203" Score="25" ViewCount="14727" Body="&lt;p&gt;We all know it does mean revert. The question is why. What's making volatility mean-revert? Is it some sort of cyclical behaviour of option traders? The way it's calculated? Why?&lt;/p&gt;&#xA;" OwnerUserId="40" LastEditorUserId="35" LastEditDate="2011-05-18T17:50:53.157" LastActivityDate="2011-12-10T01:07:55.597" Title="Why is volatility mean-reverting?" Tags="&lt;volatility&gt;" AnswerCount="7" CommentCount="2" FavoriteCount="16" ContentLicense="CC BY-SA 3.0" />
  <row Id="1178" PostTypeId="2" ParentId="1177" CreationDate="2011-05-18T17:57:05.670" Score="5" Body="&lt;p&gt;I would give a kind of commonsense answer: Volatility is basically measuring the range of fluctuation of the underlying. There is always some fluctuation (noise), some average range, but there are times when people are panicking and esp. risk-averse (falling stocks, crashes, high vola) and there are times when people are esp. calm (rising stocks, low vola).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So its a little bit how our world is and what drives markets in general (fear, greed -&gt; lots of psychology) ...and no, there is nothing special about options traders here...&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-05-18T17:57:05.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1179" PostTypeId="2" ParentId="1177" CreationDate="2011-05-18T17:58:17.970" Score="5" Body="&lt;p&gt;Do you believe it would be otherwise? Certainly we wouldn't expect low volatility to revert upwards, so you must be asking about why volatility spikes are short-lived.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Volatility spikes are often news related, either micro (merger announcement, bankruptcy notice, patent rejected, etc) or macro (rate changes, commodity bubble bursting, etc). That news isn't perpetual; the dust settles at some point and the world moves on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Related question: Why do media frenzies die down? Same answer.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-05-18T17:58:17.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1180" PostTypeId="2" ParentId="1177" CreationDate="2011-05-18T18:06:24.570" Score="25" Body="&lt;p&gt;Volatility is mean reverting if the underlying security doesn't drop to zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the security has some underlying &quot;value&quot; then its price is co-integrated with that &quot;value&quot;.    The volatility is the uncertainty of that price as it tracks the security's &quot;value&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/k7zxM.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit 12/03/2011 =================================================&lt;/p&gt;&#xA;&#xA;&lt;p&gt;@pteetor,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I may have missed something, but the question was &quot;&lt;strong&gt;Why&lt;/strong&gt; is volatility mean-reverting?&quot;.   I realize that the standard answer is that the VIX (I'm assuming he's asking about the VIX) is related to the historical volatility of the S&amp;amp;P.   A simple version of that relationship provides a reasonable R^2 (see Fig. 1).   It relates the VIX to the S&amp;amp;P &quot;wiggliness&quot; (30-day standard deviation of the daily log differences of the S&amp;amp;P), but it doesn't explain &lt;strong&gt;why&lt;/strong&gt; more or less &quot;wiggliness&quot; takes place.   To explain that, I have to look at the underlying fundamentals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/m9NE5.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Figure 2 below, shows the S&amp;amp;P Price (in gray) and what I think is the underlying S&amp;amp;P &lt;strong&gt;VALUE&lt;/strong&gt; (in red).  Both lines refer to the left hand scale.   This &lt;strong&gt;VALUE&lt;/strong&gt; is calculated from my estimate of sustainable earnings and the appropriate P/E ratio.   It is what I think an &lt;strong&gt;Investor&lt;/strong&gt; would set for the &quot;value&quot; (money generating value) of the S&amp;amp;P.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The blue line is the VIX, and is read on the right hand scale.   On the right hand side of the graph, I have divided the VIX range into three regions.   From past experience, a VIX of 20 or less seems to be a time of &quot;Don't Worry, Be Happy&quot;.  Personally, that's when I worry the most, but the market seems to be in a care-free state, so I tagged it as such.   Next, for a VIX from about 20 to 40, the market seems to be in an &quot;I'm Nervous&quot; state (not care-free, but also not panicky).   For a VIX above 40, a &quot;Panic&quot; state seems to show up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Our current VIX of 28 puts us in the &quot;I'm Nervous&quot; state.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/2U8Pq.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now to the issue of &lt;strong&gt;WHY&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't the Happy/Nervous/Panicky states of the VIX have to be consistent with the level of the S&amp;amp;P Price (not just its &quot;wiggliness&quot;)?  If I'm &quot;Happy&quot; then I'm happy with the level of the Price.    If I'm &quot;Nervous&quot; aren't I nervous about the level of the Price?   If I'm &quot;Panicky&quot; then isn't the level of the Price nose-diving?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an &lt;strong&gt;Investor&lt;/strong&gt;, the only way I can be &quot;Happy&quot; with the level of the Price is for the Price to be somewhere near or below my estimate of the &lt;strong&gt;VALUE&lt;/strong&gt; of the S&amp;amp;P.  That happened from 1991 to 1997, 2003 to 2007, and part of 2010 and 2011.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an &lt;strong&gt;Investor&lt;/strong&gt;, I will be &quot;Nervous&quot; with the level of the Price when the Price is too high compared to the &lt;strong&gt;VALUE&lt;/strong&gt; or when some external &quot;thing&quot; is going on (for example, the Euro-mess).   That happened in 1990, 1997 to 2003, part of 2007, 2008, 2009, 2010, and 2011. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And, as stated above, when &quot;Panic&quot; takes place, the market sells everything and the Price level nose-dives (1998 LTCM/Russian thing, 9/11/2001, July and Sept 2002, Sept 2008, the Debt-mess in 2010 and 2011).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, if all of the above fits the hypothesis, then &quot;&lt;strong&gt;Why&lt;/strong&gt; is volatility mean-reverting?&quot; can be answered as.....the market has, and probably will continue to spend most of its time in the &quot;Don't Worry, Be Happy&quot; state or the &quot;I'm Nervous&quot; state (i.e. reverting to a state that is not extreme).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I agree that my three-sentence answer at the top of this post left out a lot of details, but it is the short version of the same answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit 12/09/2011 =======================================================&lt;/p&gt;&#xA;&#xA;&lt;p&gt;@pteetor,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I must be getting old and forgetful.   In your comment below, you asked for references (which I forgot to include above).   Here are a few:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://faculty.fuqua.duke.edu/~charvey/Research/Working_Papers/W104_The_equity_risk.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://faculty.fuqua.duke.edu/~charvey/Research/Working_Papers/W104_The_equity_risk.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://research.stlouisfed.org/wp/2006/2006-007.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://research.stlouisfed.org/wp/2006/2006-007.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1268567&quot; rel=&quot;noreferrer&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1268567&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With a little Googling, you'll find more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my answer above, I purposely didn't get into my technique for setting the &quot;value&quot; of the S&amp;amp;P.   It always starts an argument about which is best, Modified Gordon Models, Modified Miller-Modigliani Models, Modified XXXX Models, or whatever.   The bottom line is, no matter what valuation technique you use, you'll always find some form of &quot;equity risk premium&quot; that is related to volatility.   It's just common sense......there has to be a &quot;price&quot; for being &quot;Nervous&quot; or &quot;Happy&quot;.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another issue that usually comes up has to do with using Historical Volatility versus Implied Volatility.   All I can say is, the volatility part of the equity risk premium existed long before options were traded.&lt;/p&gt;&#xA;" OwnerUserId="392" LastEditorUserId="392" LastEditDate="2011-12-09T22:53:12.963" LastActivityDate="2011-12-09T22:53:12.963" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1181" PostTypeId="2" ParentId="1166" CreationDate="2011-05-18T19:32:32.653" Score="5" Body="&lt;p&gt;The problem with this question is that the real world answer is probably different than any theoretical answer.   Below is my stab at some &quot;real world&quot; nonsense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Assuming that both Foo and Bar have the same market capitalization and no debt, their market caps would be co-integrated (over time, they wouldn't stray too far from each other).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Because of liquidity issues, the volatilities (uncertainties) of Bar I and Bar II would probably be higher than the volatility of Foo.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Because of voting rights, the volatility (uncertainty) of Bar I would be higher than Bar II.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) Assuming that the difference in voting rights of Bar I and Bar II aren't too extreme, the co-integration of the market caps of Bar I with Bar II would probably be tighter than item 1) above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If all of this is true, then a Market Maker would be more interested in making a market with the higher volatility Bar shares (more moving around leaves more room for monkeying around).   Also, because of item 4) above, Bar pairs trades could be leveraged higher for the same &lt;strong&gt;ASSUMED&lt;/strong&gt; risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem with all of this is, this is bait.    What you think is going to happen is &lt;strong&gt;NOT&lt;/strong&gt; what will happen.   The MM might be better off with some oddball 3-way position and less leverage, or in a less &quot;well defined&quot; situation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit 1 (05/19/2011) ======================================&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you ask 10 MM's, you'll probably get 10 different, but related schemes.  The two extremes of these 10 methods might be heavily opposed.    A major percentage of the MM's income is the bid/ask spread multiplied by volume.   Some MM's might go for higher volume.    Some go for higher bid/ask spreads.   The bigger MM's might have a long term position inventory while the smaller MM's may clear their inventory by the end of the week (or even by the end of the day).    The bottom line is, the bid/ask profits have to more than offset the costs of controlling risk, regardless of the underlying strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, because of the way the problem was described, any MM of Bar I/II will likely be a MM of Foo.   Why?  Is there a cheaper way to reduce inventory risk than another hedge (again, you're in the bid/ask business)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A bigger consideration than all of the above is what kind of business is this?   Is it a company that can easily explode on the upside, downside, both?   How liquid are its options?   Is there more than one way to &quot;volatize&quot; your position?&lt;/p&gt;&#xA;" OwnerUserId="392" LastEditorUserId="392" LastEditDate="2011-05-19T17:43:08.853" LastActivityDate="2011-05-19T17:43:08.853" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1182" PostTypeId="1" CreationDate="2011-05-19T02:29:41.093" Score="6" ViewCount="749" Body="&lt;p&gt;I have a one year transition matrix for three consecutive years. Multiplying these three matrices together yields the three year transition matrix. I want to obtain the average transition matrix for the three years (average^3 = 3yrtransition)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the procedure to be used? Is this possible at all? (I kind of realize that there might be multiple solutions to this problem due to possible multiple paths to achieve the end state).&lt;/p&gt;&#xA;" OwnerUserId="886" LastEditorUserId="1355" LastEditDate="2011-09-11T12:49:35.103" LastActivityDate="2011-09-11T12:49:35.103" Title="How do I get the average transition matrix for three consecutive years?" Tags="&lt;credit-ratings&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1183" PostTypeId="2" ParentId="1182" CreationDate="2011-05-19T11:45:11.987" Score="4" Body="&lt;p&gt;If the transition matrix has distinct eigenvalues, you can diagonalize it and then take the cube root of the diagonal. E.g., you can compute the SVD, verify that the eigenvalues are distinct, take the cube root of the diagonal matrix, then re-multiply it together.&lt;/p&gt;&#xA;" OwnerUserId="596" LastActivityDate="2011-05-19T11:45:11.987" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1185" PostTypeId="1" AcceptedAnswerId="1193" CreationDate="2011-05-19T15:27:21.390" Score="13" ViewCount="2196" Body="&lt;p&gt;Assume a scalper/market maker who is operating on an exchange with $N$ stocks with different characteristics such as current market value, average bid-ask spread, average daily volume and  historical volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Due to constraints imposed on this market maker he can only engage in $n$ of the $N$ stocks on the exchange, where $n &amp;lt;&amp;lt; N$ ($n$ is much smaller than $N$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus the market maker needs to choose which $n$ stocks to engage in. Obviously he wants to choose those $n$ stocks so that he maximizes his risk reward ratio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What procedure/algorithm should the market maker follow to choose which stocks to make a market in? What trade-offs does he face in his choice?&lt;/p&gt;&#xA;" OwnerUserId="526" LastEditorUserId="526" LastEditDate="2011-05-19T17:34:24.447" LastActivityDate="2011-05-21T02:43:41.690" Title="Algorithm for the choice of stocks for a equity scalper/market maker to engage in?" Tags="&lt;high-frequency&gt;&lt;algorithm&gt;&lt;market-making&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="1186" PostTypeId="2" ParentId="1185" CreationDate="2011-05-19T16:05:00.857" Score="3" Body="&lt;p&gt;I don't know about an algorithm, but you probably want to pick the stocks that have the most ways to hedge, or the ones with the least idiosyncratic risk.&lt;/p&gt;&#xA;" OwnerUserId="508" LastEditorUserId="508" LastEditDate="2011-05-19T18:59:19.990" LastActivityDate="2011-05-19T18:59:19.990" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1187" PostTypeId="2" ParentId="1004" CreationDate="2011-05-19T20:33:53.107" Score="2" Body="&lt;p&gt;Here's a $40 million Twitter-based hedge fund from Derwent Capital Markets:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.theatlantic.com/business/archive/2011/05/the-worlds-first-twitter-based-hedge-fund-is-finally-open-for-business/239097/&quot; rel=&quot;nofollow&quot;&gt;Twitter-hedge fund article&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My guess is, you'll get a wide swing of opinions on this scheme.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit 1 (05/25/2012) =================================&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an update on the &quot;Twitter Fund&quot;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.theglobeandmail.com/news/technology/digital-culture/social-networking/twitter-powered-hedge-fund-closes-offers-social-media-data-to-day-traders/article2443362/?utm_medium=Feeds%3a%20RSS/Atom&amp;amp;utm_source=Home&amp;amp;utm_content=2443362&quot; rel=&quot;nofollow&quot;&gt;Update on Twitter hedge fund&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No big surprise.&lt;/p&gt;&#xA;" OwnerUserId="392" LastEditorUserId="392" LastEditDate="2012-05-26T02:44:04.943" LastActivityDate="2012-05-26T02:44:04.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1188" PostTypeId="2" ParentId="1171" CreationDate="2011-05-20T02:31:16.230" Score="1" Body="&lt;p&gt;Yes, that's correct.&lt;br&gt;&#xA;(use the same time unit for all of the parameters)&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-05-20T02:31:16.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1189" PostTypeId="1" AcceptedAnswerId="1191" CreationDate="2011-05-20T11:56:32.567" Score="7" ViewCount="238" Body="&lt;p&gt;Trying to develop a new strategy, but I need to find reliable economic data on China. It's well known that the official figures there don't tell you everything (to put it nicely), so I was wondering if anyone knows of reliable sources on key macro data such as:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Credit&lt;/li&gt;&#xA;&lt;li&gt;Raw materials production and demand (e.g. copper)&lt;/li&gt;&#xA;&lt;li&gt;Durable goods production and demand (e.g. cars)&lt;/li&gt;&#xA;&lt;li&gt;GDP allocation (e.g. spending on infrastructure; US exports as a % of GDP)&lt;/li&gt;&#xA;&lt;li&gt;Government spending&lt;/li&gt;&#xA;&lt;li&gt;Housing&lt;/li&gt;&#xA;&lt;li&gt;Personal income&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="841" LastEditorUserId="841" LastEditDate="2011-05-20T12:10:07.173" LastActivityDate="2011-05-20T18:51:16.080" Title="Reliable Economic Data on China" Tags="&lt;data&gt;&lt;economics&gt;&lt;china&gt;&lt;macro&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1190" PostTypeId="2" ParentId="388" CreationDate="2011-05-20T15:12:07.670" Score="4" Body="&lt;p&gt;Here is a website devoted to optimal quantization methods for numerical probability and mathematical finance specifically:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.quantize.maths-fi.com&quot; rel=&quot;nofollow&quot;&gt;http://www.quantize.maths-fi.com&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find a wide bibliography on the subject on the web site, as well as a database of pre-computed quantization grids.&lt;/p&gt;&#xA;" OwnerUserId="5654" LastEditorUserId="5654" LastEditDate="2014-11-02T23:24:59.960" LastActivityDate="2014-11-02T23:24:59.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1191" PostTypeId="2" ParentId="1189" CreationDate="2011-05-20T18:08:01.653" Score="6" Body="&lt;p&gt;That's the problem with China.   The official data is nonsense, and the estimates of outsiders can change without warning.   Here are some links:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.stats.gov.cn/english/statisticaldata/yearlydata/YB1996e/B2-10e.htm&quot; rel=&quot;noreferrer&quot;&gt;China Official Stats 1&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.stats.gov.cn/english/&quot; rel=&quot;noreferrer&quot;&gt;China Official Stats 2&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.stats.gov.cn/english/statisticaldata/yearlydata/&quot; rel=&quot;noreferrer&quot;&gt;China Official Stats 3&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.chinability.com/GDP.htm&quot; rel=&quot;noreferrer&quot;&gt;More China Stats&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://stats.oecd.org/Index.aspx?datasetcode=MEI_CLI&amp;amp;lang=e&quot; rel=&quot;noreferrer&quot;&gt;OECD&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.cia.gov/library/publications/the-world-factbook/geos/ch.html&quot; rel=&quot;noreferrer&quot;&gt;CIA&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://data.worldbank.org/country/china&quot; rel=&quot;noreferrer&quot;&gt;World Bank 1&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://web.worldbank.org/WBSITE/EXTERNAL/COUNTRIES/EASTASIAPACIFICEXT/CHINAEXTN/0,,menuPK:318956~pagePK:141159~piPK:141110~theSitePK:318950,00.html&quot; rel=&quot;noreferrer&quot;&gt;World Bank 2&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.imf.org/external/country/chn/index.htm&quot; rel=&quot;noreferrer&quot;&gt;IMF&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.chinamacrofinance.com/&quot; rel=&quot;noreferrer&quot;&gt;CMF&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.economist.com/node/10329268?story_id=10329268&quot; rel=&quot;noreferrer&quot;&gt;Changing Stats 1&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.econbrowser.com/archives/2005/10/china_gdp_stati.html&quot; rel=&quot;noreferrer&quot;&gt;Changing Stats 2&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://blogs.wsj.com/chinarealtime/2011/05/20/chinas-doctored-copper-demand/&quot; rel=&quot;noreferrer&quot;&gt;Changing Stats 3 - Copper&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://online.wsj.com/article/BT-CO-20110519-713030.html&quot; rel=&quot;noreferrer&quot;&gt;Changing Stats 4 - Copper&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are some old charts that might help:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/H3S9M.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Yq6ai.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been trying to track China for a long time.   The first problem is the lack of real data, but the second problem is that China is a communist country.   They don't have to bow to market forces, and they can do some really bizarre things (long term and short term).   They have a lot of situations/policies that aren't sustainable, but it's hard to even guess which path(s) they may take to keep things calm.   The only thing an outsider can do is watch and wait.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit 1 =================================================&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Oops, I forgot some links and one image:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Automotive_industry_in_the_People%27s_Republic_of_China&quot; rel=&quot;noreferrer&quot;&gt;Autos 1&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://blogs.forbes.com/china/2011/05/20/chinas-auto-industry-shows-signs-of-impending-gridlock/&quot; rel=&quot;noreferrer&quot;&gt;Autos 2&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.chinadaily.com.cn/business/07house.html&quot; rel=&quot;noreferrer&quot;&gt;Housing 1&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Real_estate_in_the_People%27s_Republic_of_China&quot; rel=&quot;noreferrer&quot;&gt;Housing 2&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/JJXds.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="392" LastEditorUserId="392" LastEditDate="2011-05-20T18:51:16.080" LastActivityDate="2011-05-20T18:51:16.080" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1192" PostTypeId="1" AcceptedAnswerId="1194" CreationDate="2011-05-20T23:26:26.243" Score="8" ViewCount="873" Body="&lt;p&gt;I'm hoping someone could help me understand this subject better. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically I am reading a book and it shows a table&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Coupon Rate   |   10 yrs   |   20 yrs  |  30 yrs  |  50 yrs&#xA;    3%        |   7.894    |   11.744  |  12.614  |  11.857&#xA;    6%        |   7.030    |   9.988   |  10.952  |  11.200&#xA;    9%        |   6.504    |   9.201   |  10.319  |  10.975&#xA;    12%       |   6.150    |   8.755   |  9.985   |  10.862&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It then asks, How can you tell from the table that the modified duration is not an increasing function of maturity?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't really understand that. I know that as the coupon rate increases the loan is repaid faster because of the lower modified duration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it would seem as maturity increases then so does modified duration. So it would seem like its an increasing function just from looking at it. At least to me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone tell me where this information comes from? Like how is it not an increasing function of maturity?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="901" LastActivityDate="2011-05-21T17:29:48.323" Title="Modified Durations of Different Noncallable Bonds and function of Maturity" Tags="&lt;mathematics&gt;&lt;fixed-income&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1193" PostTypeId="2" ParentId="1185" CreationDate="2011-05-21T02:43:41.690" Score="5" Body="&lt;p&gt;All things being equal, stocks with the highest bid-ask spread present the greatest opportunity for the market maker&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The size of the opportunity (i.e. revenue expectation) can be represented as Volume * Bid-Ask Spread. Your algorithm should rank-order that revenue expectation &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Stocks with high current market values will tend to have narrower spreads and be more liquid (i.e. smaller bid-ask per transaction), more competition from other market makers, but also more volume. So there is a trade-off in volume vs. spread in current market value. However, all of this should be captured in the &quot;Bid-Ask * Volume&quot; formula anyway so I don't think that variable is necessary&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Historical volatility will tend to increase the bid-ask spread (i.e. increase the compensation to the market maker). The market-maker is compensated for providing liquidity and holding inventory in a dynamic market (Trade-off #2).  Again, this would already be factored into the bid-ask spread so you can ignore this variable as well&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2011-05-21T02:43:41.690" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1194" PostTypeId="2" ParentId="1192" CreationDate="2011-05-21T12:47:34.107" Score="3" Body="&lt;p&gt;An interesting case you present here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What they mean is that for discount bonds &lt;strong&gt;modified duration can decrease in value even if bond maturity increases&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's indeed &lt;strong&gt;counter-intuitive&lt;/strong&gt; and not that common.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your example, when you look at modified duration values for &lt;code&gt;coupon rate: 3%&lt;/code&gt;, you can see that it's value is rising with longer maturity (going from &lt;code&gt;10 yrs -&amp;gt; 20 yrs -&amp;gt; 30 yrs&lt;/code&gt;), but for &lt;code&gt;50 yrs&lt;/code&gt; &lt;strong&gt;it has decreased&lt;/strong&gt; (&lt;code&gt;11.857&lt;/code&gt; vs &lt;code&gt;12.614&lt;/code&gt; for &lt;code&gt;30 yrs&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The modified duration behaves &quot;&lt;em&gt;normally&lt;/em&gt;&quot; with other coupon rates in your example.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I couldn't exactly replicate the values you have in the example, but instead I've made some rough modified duration calculations for annual payments on a &lt;code&gt;3%&lt;/code&gt; coupon bond &lt;strong&gt;depending on the YTM&lt;/strong&gt; you choose:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    YTM       |   10 yrs   |   20 yrs   |  30 yrs   |  50 yrs&#xA;    3%        |   8.530    |   14.877   |  19.600   |  25.730&#xA;    5%        |   8.245    |   13.785   |  17.136   |  19.869&#xA;    10%       |   7.540    |   11.003   |  11.532   |  10.607&#xA;    15%       |   6.847    |    8.446   |   7.678   |   6.796&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see, if the &lt;em&gt;YTM&lt;/em&gt; (current interest rate) is much higher than the actual coupon rate for our bond (which is &lt;code&gt;3%&lt;/code&gt; in this example), the &lt;strong&gt;modified duration is no longer a monotonically increasing function of maturity&lt;/strong&gt; (on the interval we're assessing). The bigger the difference, the sooner we get to the extremum.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;You can have a look at &quot;&lt;strong&gt;&lt;a href=&quot;http://www.actuaries.org/AFIR/colloquia/Brighton/Villazon.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bond duration, yield to maturity and bifurcation analysis&lt;/a&gt;&lt;/strong&gt;&quot; for a formal explanation of this subject.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The included chart is a really good explanation of what happens with discount bonds:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/O0WbO.png&quot; alt=&quot;Duration as a function of maturity depending on bond type&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="38" LastEditorUserId="38" LastEditDate="2011-05-21T17:29:48.323" LastActivityDate="2011-05-21T17:29:48.323" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1195" PostTypeId="1" AcceptedAnswerId="1290" CreationDate="2011-05-22T00:01:21.563" Score="11" ViewCount="3773" Body="&lt;p&gt;I'd like to calculate the local volatility surface for a series of option strikes, similar to the surface described in this paper:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.ederman.com/new/docs/gs-local_volatility_surface.pdf&quot;&gt;http://www.ederman.com/new/docs/gs-local_volatility_surface.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the image I am referring to in the aforementioned paper:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/QVS0J.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know QuantLib has the ability to do this - but what is the correct C# function call(s)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using the C# build of QuantLib, from:&#xA;&lt;a href=&quot;http://www.resolversystems.com/products/quantlib-binary/&quot;&gt;http://www.resolversystems.com/products/quantlib-binary/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="906" LastEditorUserId="-1" LastEditDate="2011-05-23T00:21:26.167" LastActivityDate="2011-06-07T07:01:35.933" Title="How to calculate the local volatility surface using QuantLib?" Tags="&lt;quantlib&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1196" PostTypeId="2" ParentId="1172" CreationDate="2011-05-22T09:05:42.707" Score="3" Body="&lt;p&gt;&quot;Buying and Selling Volatility&quot; by Kevin Connolly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This book has an amazing property: it explains options at an intuitive level, without any math. Incredible. Once you have gone through the first few chapters, you get to the point of being able to roughly value options in your head with some simple arithmetic, and intuitively understand the relationships such as &quot;as the underlying spot price increases, will delta increase or decrease for a call?&quot; (try doing that after being hit on the head by the Black Scholes formula).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The book finishes with some chapters explaining exactly how to get exposure to volatility.&lt;/p&gt;&#xA;" OwnerUserId="906" LastEditorUserId="906" LastEditDate="2011-05-23T22:20:11.650" LastActivityDate="2011-05-23T22:20:11.650" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1197" PostTypeId="1" AcceptedAnswerId="1267" CreationDate="2011-05-22T09:17:46.657" Score="12" ViewCount="2594" Body="&lt;p&gt;I'd like a library to calculate the options local volatility surface, i.e. the options implied volatility surface  for a collection of strikes and their bid/ask prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are the libraries I've looked at:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://quantlib.org/index.shtml&quot; rel=&quot;nofollow noreferrer&quot;&gt;QuantLib&lt;/a&gt; (Quote: &quot;from memory, the function qlBlackVol will interpolate vols making sure that the surface is arbitrage free&quot; (see &lt;a href=&quot;http://www.wilmott.com/messageview.cfm?catid=4&amp;amp;threadid=34384&quot; rel=&quot;nofollow noreferrer&quot;&gt;forum post&lt;/a&gt;).&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.nag.co.uk/&quot; rel=&quot;nofollow noreferrer&quot;&gt;NAG&lt;/a&gt; (see &quot;&lt;a href=&quot;http://www.nag.co.uk/about/student_awards/nicoletta_gabrielli_presentation.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Using the NAG Toolbox for MATLAB in Mathematical ﬁnance&lt;/a&gt;&quot;).&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.intermarkit.com/toolkit/module_options.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;Intermark Tookits&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.amadeo.name/modelling.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Modelling the implied volatility surface: an empirical study for FTSE options&lt;/a&gt; (contains source code). &lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.fabiomercurio.it/consistentfxsmile.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Consistent Pricing of FX Options&lt;/a&gt; (doesn't calculate a surface, but interesting nevertheless).&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://strata.opengamma.io/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Strata from OpenGamma&lt;/a&gt; (apparently, the source contains Java calls to calculate the local volatility surface).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Do you know of any other libraries?&lt;/p&gt;&#xA;" OwnerUserId="906" LastEditorUserId="18748" LastEditDate="2020-05-19T04:58:32.570" LastActivityDate="2020-05-19T04:58:32.570" Title="Recommendation for a library to calculate the local volatility surface?" Tags="&lt;implied-volatility&gt;&lt;local-volatility&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="8" ContentLicense="CC BY-SA 4.0" />
  <row Id="1198" PostTypeId="1" AcceptedAnswerId="1268" CreationDate="2011-05-22T10:15:34.850" Score="10" ViewCount="2191" Body="&lt;p&gt;I'm looking for an implementation of &lt;a href=&quot;http://edoc.hu-berlin.de/series/sfb-649-papers/2005-19/PDF/19.pdf&quot;&gt;Arbitrage-Free Smoothing of the Implied Volatility Surface - Matthias R. Fengler&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know of any existing libraries that have implemented this paper? Any method is ok (Excel, C++, Matlab, Mathematica, C#, etc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, any method that implements arbitrage free smoothing of the implied volatility surface is ok (can QuantLib do this?).&lt;/p&gt;&#xA;" OwnerUserId="906" LastEditorUserId="906" LastEditDate="2011-05-22T10:54:40.957" LastActivityDate="2014-04-16T08:04:15.357" Title="Lib for Arbitrage-Free Smoothing of Implied Volatility Surface?" Tags="&lt;implied-volatility&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1199" PostTypeId="1" CreationDate="2011-05-22T17:00:14.363" Score="9" ViewCount="1863" Body="&lt;p&gt;My current project requires large amounts of historical and real-time market data (1m or 5m bars for various products, mostly US futures for as far back as available). This data will be analyzed by software, so accessing the data through the internet for each price is not going to cut it, we need local data for speed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are many online data sources, but do any offer downloading of consolidated data rather than requiring a separate request for each price? Also, are there any recommendations for one to use in conjunction with Interactive Brokers?&lt;/p&gt;&#xA;" OwnerUserId="807" LastEditorUserId="807" LastEditDate="2011-05-22T17:06:39.180" LastActivityDate="2014-01-09T21:41:08.300" Title="Mass Market Data Source" Tags="&lt;data&gt;&lt;market-data&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="1200" PostTypeId="2" ParentId="226" CreationDate="2011-05-22T18:36:42.353" Score="3" Body="&lt;p&gt;the only difference between volatility and variance is the square. everything else is bs, as concept that apply to one applies to the other (historical vs implied, blabla)&lt;/p&gt;&#xA;" OwnerUserId="172" LastActivityDate="2011-05-22T18:36:42.353" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1201" PostTypeId="2" ParentId="1198" CreationDate="2011-05-22T18:48:29.903" Score="-3" Body="&lt;p&gt;A little off-topic, but arbitrage conditions are locals. and no one cares about local arbitrage (to the extent that it can not be put in practice with reasonable chance).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's like saying look, you gamma is infinite 1 seconds before expiry : but if your dirac is 1 eur, you'll never make more than that. or, in math speak, time to look if higher order derivatives are not high as well in the region.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All this to say, I'd like to see a non parametric vol surface that actually takes the tradable grid as input. Otherwise it's like talking about angel's sex.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you know one such lib, I'd like to hear about it.&lt;/p&gt;&#xA;" OwnerUserId="172" LastActivityDate="2011-05-22T18:48:29.903" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1203" PostTypeId="2" ParentId="1162" CreationDate="2011-05-22T19:01:11.440" Score="5" Body="&lt;p&gt;I think you should put YOUR attainable interest rate. Because it is your view of how much the forward is worth. So, on the offer the rate at which you are indifferent is computed with the interest rate at which you borrow. And if you go short, the interest at which you can put your have your money fructified.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No what rate can your money be fructified at ?&#xA;Well you are a department inside of a bank. So that rate should be in between the state funding's rate, if your bank as a whole was cash neutral to begin with, and you actually have some money to place, and the marginal cost of borrowing that you save to your bank if the bank had to go in the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But trust the cashiers to always tell your the wrong story..&lt;/p&gt;&#xA;" OwnerUserId="172" LastActivityDate="2011-05-22T19:01:11.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1204" PostTypeId="2" ParentId="1199" CreationDate="2011-05-22T19:02:22.063" Score="2" Body="&lt;p&gt;Heres a related link that has some links to different sites with api's &lt;a href=&quot;https://quant.stackexchange.com/questions/37/what-broker-feed-api-setup-allows-for-recording-the-most-accurate-data-cheaply&quot;&gt;What broker/feed/APIsetup allows for recording the most accurate data (cheaply)?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="898" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2011-05-22T19:02:22.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1205" PostTypeId="2" ParentId="1114" CreationDate="2011-05-22T19:19:08.077" Score="-2" Body="&lt;p&gt;(Edited)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An option trade has 2 main components : 1st derivative, and 2nd derivative wrt to the spot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you need to play 1st derivative, you just buy the stocks right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you consider buying a stock that mean you are there for the 2nd order derivative.&#xA;That's what options are all about.&#xA;And that's why your book says option trades &quot;should&quot; be delta neutral.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS : volatility sensitivity is just the integrated form, over the life of the option, of that 2nd order spot sensitivity...&lt;/p&gt;&#xA;" OwnerUserId="172" LastEditorUserId="172" LastEditDate="2011-05-28T16:48:16.200" LastActivityDate="2011-05-28T16:48:16.200" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1206" PostTypeId="2" ParentId="841" CreationDate="2011-05-22T19:26:51.553" Score="1" Body="&lt;p&gt;the example uses an european payoff.&#xA;every european payoff can be decomposed by call and put combinations.&#xA;just hold for each strike a qtty = to the 2nd derivative of the payoff....&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in the general case, that is non european payoff, there is not always a perfect hedge.&lt;/p&gt;&#xA;" OwnerUserId="172" LastActivityDate="2011-05-22T19:26:51.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1207" PostTypeId="1" AcceptedAnswerId="1218" CreationDate="2011-05-23T14:31:16.030" Score="14" ViewCount="9847" Body="&lt;p&gt;Are there any free/cheap sources for historical data on company earnings and valuations?  I can get historical price data from Google and Yahoo, and it looks like I can get about five years of historical balance sheet data from Google using &lt;a href=&quot;http://www.quantmod.com/&quot;&gt;quantmod&lt;/a&gt; in R.  Are there any longer-term sources of for these kind of data?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bonus points for R packages or code examples.&lt;/p&gt;&#xA;" OwnerUserId="500" LastEditorUserId="35" LastEditDate="2011-05-23T15:15:45.830" LastActivityDate="2016-08-14T08:00:45.010" Title="Earnings and valuation data sources online" Tags="&lt;data&gt;&lt;market-data&gt;" AnswerCount="6" CommentCount="0" FavoriteCount="16" ContentLicense="CC BY-SA 3.0" />
  <row Id="1208" PostTypeId="2" ParentId="1207" CreationDate="2011-05-23T15:02:55.090" Score="3" Body="&lt;p&gt;You can get historical SEC filing from &lt;a href=&quot;http://www.sec.gov/cgi-bin/srch-edgar&quot; rel=&quot;nofollow&quot;&gt;EDGAR&lt;/a&gt;.  You get bonus points if you write an R package to pull info from the database (assuming you can). ;-)&lt;/p&gt;&#xA;" OwnerUserId="56" LastActivityDate="2011-05-23T15:02:55.090" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1209" PostTypeId="1" AcceptedAnswerId="1263" CreationDate="2011-05-23T16:52:30.483" Score="7" ViewCount="6985" Body="&lt;p&gt;Trying to be concise:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I am interested in the most popular indices (SP500, FTSE100, DAX30, CAC40, SMI30, etc).&lt;/li&gt;&#xA;&lt;li&gt;For each index I want to know its constituents in a monthly basis.&lt;/li&gt;&#xA;&lt;li&gt;For each constituent (each month) I would like to know its price.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Since it's monthly data I believe it is easier to find but I haven't been very successful for the moment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am willing to pay something reasonable (i.e. not too expensive).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can get my hands on a Bloomberg terminal for a couple of hours but I have never used them and I don't know if I can do what I want in a reasonable amount of time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will be really grateful for any help on the subject. All suggestions are welcomed!&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2017-08-01T13:37:14.520" Title="Monthly data for popular indices (constituents)." Tags="&lt;data&gt;&lt;bloomberg&gt;&lt;monthly&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1210" PostTypeId="1" AcceptedAnswerId="1225" CreationDate="2011-05-23T20:56:15.250" Score="11" ViewCount="1333" Body="&lt;p&gt;Assume a class &lt;code&gt;LimitOrderBook&lt;/code&gt; which represents a limit order book in a trading system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be able to represent the limit order book a data handler reads a feed which adds data to the representation of the limit order book using the following three methods:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;public OrderReference add(Order order)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;public boolean cancel(OrderReference orderReference)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;public void execute(...)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;These three methods alter the state of the limit order book. These three are more or less given, they're all needed to implement the LOB representation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition to those three required &quot;state altering&quot; methods a typical LOB representation also provides a number of query methods that the trading models can call. One obvious example of such a method would be &lt;code&gt;getBestBid(...)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the most important query methods a general LOB should provide? Or more specifically, in the LOB's you've built, what query methods did you include? Why?&lt;/p&gt;&#xA;" OwnerUserId="526" LastEditorUserId="526" LastEditDate="2011-05-24T09:27:07.733" LastActivityDate="2011-05-24T09:34:51.837" Title="A generic limit order book: What are the most important queries it should be able to answer?" Tags="&lt;data&gt;&lt;trading&gt;&lt;automated-trading&gt;&lt;trading-systems&gt;&lt;limit-order-book&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1211" PostTypeId="2" ParentId="1018" CreationDate="2011-05-23T22:03:37.623" Score="3" Body="&lt;p&gt;I think your best best is going to be some kind of blocked bootstrap sampling using real market data.  If you use a pure simulation approach to &quot;make up&quot; a dataset, there's a significant probability that you're going to end up with a mis-specified model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For starters, you can use the R package quantmod to pull in daily stock market data and calculate returns, and the tsbootstrap function in the tseries package will let you construct hypothetical return series with some basis in reality.&lt;/p&gt;&#xA;" OwnerUserId="500" LastActivityDate="2011-05-23T22:03:37.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1212" PostTypeId="1" AcceptedAnswerId="1214" CreationDate="2011-05-23T22:04:51.423" Score="4" ViewCount="606" Body="&lt;p&gt;Lets say that I have an imaginary model that always gives me a 10% edge over straight 50/50 odds, one day in advance, for an index (i.e. 60% chance of winning / 40% chance of losing).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would I calculate the ideal position size to maximize long term portfolio gain, given a chosen risk threshold?&lt;/p&gt;&#xA;" OwnerUserId="906" LastActivityDate="2011-05-24T18:54:42.110" Title="If I have a model that gives 10% &quot;probability edge&quot; over random chance, how do I calculate the position size?" Tags="&lt;position-sizing&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1213" PostTypeId="1" AcceptedAnswerId="1221" CreationDate="2011-05-23T22:12:41.873" Score="1" ViewCount="1893" Body="&lt;p&gt;Lets say I want to find out the area under the graph of normal distribution curve, between X1=standard deviation of -0.5 and X2 = standard deviation of 0.5. Is there a formula for this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Case study: find the percentage chance of a stock remaining within +0.5 and -0.5 standard deviations within one trading day, given the daily implied volatility of that stock.&lt;/p&gt;&#xA;" OwnerUserId="906" LastEditorUserId="906" LastEditDate="2011-05-23T22:33:11.103" LastActivityDate="2011-05-24T09:26:12.617" Title="Whats the equation to calculate the area under the curve of a normal distribution, given an upper and lower standard deviation?" Tags="&lt;normal-distribution&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1214" PostTypeId="2" ParentId="1212" CreationDate="2011-05-23T22:22:38.263" Score="4" Body="&lt;p&gt;The optimal position size can be determined with the &lt;a href=&quot;http://en.wikipedia.org/wiki/Kelly_criterion&quot; rel=&quot;nofollow&quot;&gt;Kelly criterion&lt;/a&gt;. In your specific case, the long term growth rate of the capital X is maximized by betting $$(0.6-0.4)X=0.2X$$ at each opportunity.  &lt;/p&gt;&#xA;" OwnerUserId="70" LastEditorUserId="70" LastEditDate="2011-05-23T22:31:25.723" LastActivityDate="2011-05-23T22:31:25.723" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1215" PostTypeId="2" ParentId="141" CreationDate="2011-05-23T22:23:32.103" Score="6" Body="&lt;p&gt;&lt;a href=&quot;http://www.historicaloptiondata.com/&quot; rel=&quot;noreferrer&quot;&gt;www.historicaloptiondata.com&lt;/a&gt; for CBOE options data stretching back 10 years (EOD only). They also have an FTP service which allows you to download EOD option data on a daily basis after market close.&lt;/p&gt;&#xA;" OwnerUserId="906" LastActivityDate="2011-05-23T22:23:32.103" CommentCount="2" CommunityOwnedDate="2011-05-23T22:23:32.103" ContentLicense="CC BY-SA 3.0" />
  <row Id="1216" PostTypeId="2" ParentId="1212" CreationDate="2011-05-23T22:56:03.810" Score="1" Body="&lt;p&gt;Use the Kelly Criterion (as suggested by @olaker). For the amount of money to put into each transaction, use Implied Volatility to calculate the amount you are risking to within a VAR (Value At Risk) of 99% (i.e. +/- 3 standard deviations of the underlying).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://quant.stackexchange.com/questions/47/how-to-calculate-future-distribution-of-price-using-volatility&quot;&gt;How to calculate future distribution of price using volatility?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Caveats:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Markets price distributions have fat tails. When markets crash, they really crash.&lt;/li&gt;&#xA;&lt;li&gt;Take into account skew on Implied Volatility (IV). For stocks, the IV skew is negative, so there is a greater chance of a rapid drop in the price. For commodities, the IV skew could be positive, there is a greater chance of a rapid increase in the price.&lt;/li&gt;&#xA;&lt;li&gt;The Kelly Criterion means the greatest long term increase in the value in your portfolio, at the expense of huge drawdowns and large swings in the value of your portfolio. In practice, you'll have to dial down the risk until the expected drawdown is acceptable. You might have to do some  Monte Carlo simulations to work out the actual risk level at any point in time.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Then again, you could always use &lt;a href=&quot;http://www.opengamma.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;OpenGamma&lt;/a&gt; to handle your risk management for you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://quant.stackexchange.com/questions/395/how-to-estimate-the-probability-of-drawdown-ruin&quot;&gt;How to estimate the probability of drawdown / ruin?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="906" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2011-05-23T23:18:17.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1217" PostTypeId="2" ParentId="1199" CreationDate="2011-05-23T23:08:10.460" Score="2" Body="&lt;p&gt;&lt;a href=&quot;http://www.iqfeed.net/&quot; rel=&quot;nofollow&quot;&gt;IQfeed&lt;/a&gt; together with &lt;a href=&quot;http://www.mechtrading.com/qcollector/dtn/index.htm&quot; rel=&quot;nofollow&quot;&gt;QCollector&lt;/a&gt; gives you 1-min historical bars back to mid-2007 for the entire US market (equities, indexes, futures, forex).&lt;/p&gt;&#xA;" OwnerUserId="906" LastActivityDate="2011-05-23T23:08:10.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1218" PostTypeId="2" ParentId="1207" CreationDate="2011-05-23T23:17:47.317" Score="4" Body="&lt;p&gt;If you don't mind parsing some html, &lt;a href=&quot;http://www.advfn.com&quot; rel=&quot;nofollow&quot;&gt;AdvFN&lt;/a&gt; has fundamental data on US companies as far back as 1994.&lt;/p&gt;&#xA;" OwnerUserId="584" LastActivityDate="2011-05-23T23:17:47.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1219" PostTypeId="2" ParentId="550" CreationDate="2011-05-23T23:25:02.650" Score="7" Body="&lt;p&gt;See &lt;a href=&quot;http://rulecore.com/CEPblog/?page_id=47&quot;&gt;Marco's  list of CEP vendors&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm currently using StreamInsight, Microsoft's new CEP engine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd rate it as slightly better than NEsper, for the following reasons:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Supports LINQ natively within Visual Studio.&lt;/li&gt;&#xA;&lt;li&gt;Better documentation (in my opinion).&lt;/li&gt;&#xA;&lt;li&gt;Good samples.&lt;/li&gt;&#xA;&lt;li&gt;Complete training course (see the &lt;a href=&quot;http://blogs.msdn.com/b/streaminsight/&quot;&gt;StreamInsight blog&lt;/a&gt;).&lt;/li&gt;&#xA;&lt;li&gt;The LINQ is compiled into IL code for speed.&lt;/li&gt;&#xA;&lt;li&gt;The engine behind StreamInsight was developed by the same people on the SQL server team, they have applied a lot of the SQL algebra optimizations to make StreamInsight faster.&lt;/li&gt;&#xA;&lt;li&gt;Faster - it has its own built in memory management to meet minimum latency requirements.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;See:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://channel9.msdn.com/Learn/Courses/SQL2008R2TrainingKit/SQL10R2UPD00/SQL10R2UPD00_REC_04&quot;&gt;Video: ​Introducing ​SQL Server ​2008 R2 ​Stream​Insight&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://channel9.msdn.com/Events/TechEd/NorthAmerica/2011/DBI303&quot;&gt;Video: Microsoft StreamInsight: Introduction to Complex Event Processing with SQL Server 2008 R2 StreamInsight&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="906" LastActivityDate="2011-05-23T23:25:02.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1220" PostTypeId="2" ParentId="422" CreationDate="2011-05-23T23:33:13.477" Score="2" Body="&lt;p&gt;IQfeed + QCollector will give you 180 days of tick data for pretty much any symbol on the US market. Not free, but definitely good quality (and not too expensive).&lt;/p&gt;&#xA;" OwnerUserId="906" LastActivityDate="2011-05-23T23:33:13.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1221" PostTypeId="2" ParentId="1213" CreationDate="2011-05-24T00:05:59.000" Score="5" Body="&lt;p&gt;This is simply the integral of the pdf from -0.5 to 0.5 (scaled to the SD of the distribution), also known as the &lt;b&gt;cumulative distribution function&lt;/b&gt; or &lt;b&gt;cdf&lt;/b&gt;.  The &lt;code&gt;cdf(x)&lt;/code&gt; function is indicated on the following wikipedia link: &lt;a href=&quot;http://en.wikipedia.org/wiki/Normal_distribution&quot; rel=&quot;nofollow&quot;&gt;Normal Distribution&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The normal cdf(x) function computes the integral on [-Infinity, x], so to compute on your interval [x1,x2], is simply &lt;code&gt;cdf(x2) - cdf(x1)&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you meant [-.5, +.5] SDs,then would evaluate &lt;code&gt;cdf(0.5*sd) - cdf(-0.5*sd)&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="51" LastEditorUserId="51" LastEditDate="2011-05-24T00:13:05.423" LastActivityDate="2011-05-24T00:13:05.423" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1222" PostTypeId="2" ParentId="1209" CreationDate="2011-05-24T04:32:10.790" Score="3" Body="&lt;p&gt;You can have a look at this &lt;a href=&quot;http://engineering-returns.com/2011/02/07/test-your-trading-strategies-survivorship-free/&quot; rel=&quot;nofollow&quot;&gt;QUANT - Blog&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can get NDX100 and SP500 historical index constitution.&lt;/p&gt;&#xA;" OwnerUserId="912" LastEditorUserId="467" LastEditDate="2012-04-15T20:53:45.140" LastActivityDate="2012-04-15T20:53:45.140" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1223" PostTypeId="2" ParentId="1213" CreationDate="2011-05-24T09:26:12.617" Score="0" Body="&lt;p&gt;The source code for the CDF is listed in the book &quot;The Complete Guide to Option Pricing Formulas - 2nd. Edition - Espan Gaarder Haug, Ph.D (McGraw-Hill, 2006, ISBN 9780071389976)&quot;.&lt;/p&gt;&#xA;" OwnerUserId="906" LastActivityDate="2011-05-24T09:26:12.617" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1224" PostTypeId="1" AcceptedAnswerId="1228" CreationDate="2011-05-24T09:32:25.660" Score="7" ViewCount="9257" Body="&lt;p&gt;Does anyone know of a utility that can download historical Implied Volatility (IV) data from &lt;a href=&quot;http://www.interactivebrokers.com/&quot;&gt;Interactive Brokers' Trader Workstation&lt;/a&gt;?&lt;/p&gt;&#xA;" OwnerUserId="906" LastEditorUserId="35" LastEditDate="2011-05-24T15:02:04.173" LastActivityDate="2015-07-10T00:28:26.867" Title="Utility to download historical Implied Volatility data from Interactive Brokers?" Tags="&lt;interactive-brokers&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1225" PostTypeId="2" ParentId="1210" CreationDate="2011-05-24T09:34:51.837" Score="6" Body="&lt;p&gt;There is no need to complicate things:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;...&#xA;d = getBdepth();&#xA;d = getOdepth();&#xA;// for the calls below pos == 0 means the best bid/offer&#xA;p = getB(int pos); // bid price at pos&#xA;p = getO(int pos); // offer price at pos&#xA;q = getBq(int pos); // bid quantity at pos&#xA;q = getOq(int pos);// offer quantity at pos&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that the above API is not the best choice if your LimitOrderBook instance is updated in background. But as long as you update its state within the same thread that does strategy calculations you're safe. In case of asynchronous updates things complicate a bit - you'll need two classes. The first one will have all the methods you describe plus one for getting a static snapshot of the order book at current time:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;...&#xA;public LimitOrderBookSnapshot getSnapshot();&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The LimitOrderBookSnapshot instance is made by synchronously copying data that underlie your LimitOrderBook instance. LimitOrderBookSnapshot API is made of the six calls I described at the top of this post.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note that in real solution you need to remember the time of getting a snapshot - if you won't you may end up using quotes that were not available at the moment of obtaining the order book data.&lt;/p&gt;&#xA;" OwnerUserId="493" LastActivityDate="2011-05-24T09:34:51.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1226" PostTypeId="1" AcceptedAnswerId="1230" CreationDate="2011-05-24T09:50:50.207" Score="17" ViewCount="3772" Body="&lt;p&gt;Consider a market maker that has decided to try to make a round-trip trade in stock A in order to capture the bid-ask spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume furthermore that he has no current inventory in the stock A. To further simplify things assume that he wants to trade only one share in stock A.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The market maker now has to choose in which order he should submit the orders needed to complete this round-trip trade:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Strategy I: Submit a buy limit order, wait for a match then submit the sell limit order and wait for a match&lt;/li&gt;&#xA;&lt;li&gt;Strategy II: Submit a sell limit order, wait for a match then submit the buy limit order and wait for a match&lt;/li&gt;&#xA;&lt;li&gt;Strategy III: Submit both the buy and the sell limit orders directly and wait for matches&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Does strategy III strictly dominate strategies I and II? Under what circumstances would a rational market maker want to use strategy I or II rather than strategy III?&lt;/p&gt;&#xA;" OwnerUserId="526" LastActivityDate="2012-04-18T02:10:00.073" Title="Order submission strategies of a rational market maker?" Tags="&lt;trading&gt;&lt;automated-trading&gt;&lt;high-frequency&gt;&lt;market-making&gt;&lt;limit-order-book&gt;" AnswerCount="3" CommentCount="7" FavoriteCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="1227" PostTypeId="2" ParentId="1224" CreationDate="2011-05-24T13:10:20.030" Score="6" Body="&lt;p&gt;There isn't a utility to do accomplish this. &#xA;However one could build one by using their api, and asking for historical data on option prices and then backing out the implied vol from the pirces.&lt;br&gt;&#xA;Keep in mind that these will be close prices only, and the program will have to keep track of the expiries and switchovers to different months' chains.&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-05-24T13:10:20.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1228" PostTypeId="2" ParentId="1224" CreationDate="2011-05-24T17:23:00.050" Score="2" Body="&lt;p&gt;check out max dama:&#xA;&lt;a href=&quot;http://www.maxdama.com/&quot; rel=&quot;nofollow&quot;&gt;http://www.maxdama.com/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="826" LastActivityDate="2011-05-24T17:23:00.050" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1229" PostTypeId="2" ParentId="1212" CreationDate="2011-05-24T18:54:42.110" Score="1" Body="&lt;p&gt;If you want to use the Kelly Criterion you might find &lt;a href=&quot;http://www.financialwebring.org/gummy-stuff/kelly-ratio.htm&quot; rel=&quot;nofollow&quot;&gt;this link&lt;/a&gt;, particularly part III, useful.&lt;/p&gt;&#xA;" OwnerUserId="252" LastActivityDate="2011-05-24T18:54:42.110" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1230" PostTypeId="2" ParentId="1226" CreationDate="2011-05-24T20:22:11.847" Score="11" Body="&lt;p&gt;Market makers place quotes on both sides (ie, the bid and the ask). Depending on the market, the MM might even be contractually obligated to provide liquidity within some threshold. NYSE's &lt;em&gt;designated market makers&lt;/em&gt; (who replaced the &lt;em&gt;specialists&lt;/em&gt; a few years back) are an example. Even when there is no explicit requirement, the MM will quote both sides and simply shift (or &lt;em&gt;skew&lt;/em&gt;) the quotes in the direction of the desired trade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, say the MM is bullish on a stock whose midpoint is USD 50.25. The MM might bid 50.24 and ask 50.35. This of course glosses over issues like volatility or liquidity of the stock, both of which will cause the spreads to widen or tighten.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only time I can think of that an MM would quote only one side is if it can't possibly take-on more of an existing position, like in position limits or when trying to exit at the end of the day. An MM who doesn't want &lt;em&gt;any&lt;/em&gt; exposure simply won't provide quotes on either side.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-05-24T20:22:11.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1231" PostTypeId="1" CreationDate="2011-05-24T20:57:48.147" Score="8" ViewCount="671" Body="&lt;p&gt;VIX (spot) has very nice features, including mean reversion. We all know that we can't trade VIX (spot). The closest we can get is using front-month future contracts. The problem I have with that is that, in practice, VIX futures are not great at tracking VIX. Is there a way to replicate tradable VIX?&lt;/p&gt;&#xA;" OwnerUserId="40" LastEditorUserId="35" LastEditDate="2011-05-24T23:31:40.800" LastActivityDate="2011-05-24T23:31:40.800" Title="Tradable Volatility" Tags="&lt;volatility&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="5" ClosedDate="2017-03-30T15:10:26.550" ContentLicense="CC BY-SA 3.0" />
  <row Id="1232" PostTypeId="2" ParentId="1231" CreationDate="2011-05-24T21:03:25.930" Score="4" Body="&lt;p&gt;Here are some older answers:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/139/trading-a-synthetic-replication-of-the-vix-index&quot;&gt;Trading a synthetic replication of the VIX index&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/249/spx-options-vs-vix-futures-trading&quot;&gt;SPX options vs VIX futures trading&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="392" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2011-05-24T21:03:25.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1233" PostTypeId="1" CreationDate="2011-05-24T22:46:11.527" Score="7" ViewCount="868" Body="&lt;p&gt;Say you have a trading system that works best when markets are most volatile. What would be the best way to hedge against lack of volatility ? For example, 2008, 2009 was highly volatile and it has been trending down since. What's the best way to hedge and if VIX is the best one ?&lt;/p&gt;&#xA;" OwnerUserId="917" LastActivityDate="2012-04-19T05:25:17.710" Title="How to hedge against lack of volatility" Tags="&lt;volatility&gt;" AnswerCount="4" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1235" PostTypeId="2" ParentId="1233" CreationDate="2011-05-25T01:42:20.223" Score="7" Body="&lt;p&gt;If you're mostly trading equities, sell 2-3 month VIX futures, otherwise sell straddles on your non-equity assets or consider the new CME volatility futures on gold, oil, Euro.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;chrisaycock isn't wrong: even if your trading system does better during volatile periods, you should be careful not to over-hedge, since losses on your short vol position(s) will probably come faster than profits from your core system.&lt;/p&gt;&#xA;" OwnerUserId="918" LastActivityDate="2011-05-25T01:42:20.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1236" PostTypeId="1" AcceptedAnswerId="1960" CreationDate="2011-05-25T04:05:34.163" Score="19" ViewCount="3441" Body="&lt;p&gt;Do you have historical market/pricing ticket data that you would like to donate to the &lt;a href=&quot;http://www.opensourcetrader.com&quot;&gt;Open Source Trader&lt;/a&gt; project (OST)?? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please: upload your files! Once we gather some data, we'll do our best to help create an excellent web-service (RESTFul API) based repository of free market tick data. If we can afford the services, I'll host it in a cloud-platform (&lt;em&gt;but that's still to-be-decided&lt;/em&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No we are not going to resell your data!!! The only income the site has right now is revenue from CPC advertising, and we'll use this to fund the bandwidth and server space required to redistribute data for free later.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Upload here:&#xA;&lt;a href=&quot;http://www.opensourcetrader.com/api/free-tick-data/&quot;&gt;http://www.opensourcetrader.com/api/free-tick-data/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. Keep checking for updates, free market data of any size-able breadth or depth that is none-paid and redistributable for our project (visa via the now defunct 'opentick') has been hard to come by, so I'm soliciting for &lt;em&gt;donations of data dumps&lt;/em&gt;!! &lt;/p&gt;&#xA;" OwnerUserId="913" LastActivityDate="2012-03-20T19:29:01.550" Title="Do you have historical tick data you want to donate?" Tags="&lt;data&gt;&lt;market-data&gt;&lt;database&gt;" AnswerCount="2" CommentCount="16" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="1237" PostTypeId="2" ParentId="1233" CreationDate="2011-05-26T11:55:57.550" Score="1" Body="&lt;p&gt;Write Iron Condors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Preferably, with expiration between 21 and 45 days. Pick short strikes (call and puts) around the 30 delta for aggressive trades, and around 18 for conservative trades. Keep in mind that a 'conservative' Iron Condor blows up much worse than an aggressive one. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You always risk the spread value of your call or put spread (whichever is greater) less the credit received. The typical Iron Condor is balanced, so the call spread and put spreads are equal in risk. You only take risk on one side or the other because in our world, prices can only be at one place at a time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This trade generates an initial credit and has positive time decay. It is short volatility and will lose 'paper' value if volatility increases or price moves towards the short strikes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By no means would I recommend this trade, but for illustration purposes, an SPX Iron Condor this morning before the market opens is marked at $2.80 credit for strikes of 1290/1295 (put) 1345/1350 (call). This is for the Jun expiry, which is only 21 days away. The short strikes are the ones in the middle, and are sitting at about 30 deltas. Ostensibly, there is a 30% chance SPX expires higher than 1345 and a 30% chance it expires lower than 1295 by expiration. This gives you a small edge but keep in mind that Iron Condors have an expected return of zero. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Zero. Nada. Zip. You've been warned. &lt;/p&gt;&#xA;" OwnerUserId="291" LastEditorUserId="291" LastEditDate="2011-05-26T14:26:46.303" LastActivityDate="2011-05-26T14:26:46.303" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1238" PostTypeId="1" AcceptedAnswerId="1246" CreationDate="2011-05-26T12:14:59.413" Score="7" ViewCount="3702" Body="&lt;p&gt;I need suggestions for some good books on the following topics:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Credit Value Adjustment (CVA) / Credit Risk&lt;/li&gt;&#xA;&lt;li&gt;Probability of Default / Loss-Given-Default / Exposure-At-Default modeling&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Any pointers on good research papers?  I would prefer anything from after the 2008 crisis.&lt;/p&gt;&#xA;" OwnerUserId="928" LastEditorUserId="1106" LastEditDate="2011-09-06T19:48:39.933" LastActivityDate="2013-06-19T08:41:59.190" Title="Recommendation for a book on CVA/Credit Risk and PD/LGD/EAD modeling?" Tags="&lt;risk&gt;&lt;research&gt;&lt;modeling&gt;&lt;risk-models&gt;&lt;cva&gt;" AnswerCount="7" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="1239" PostTypeId="1" AcceptedAnswerId="1240" CreationDate="2011-05-26T15:01:55.860" Score="8" ViewCount="3657" Body="&lt;p&gt;I am running a mean reversion strategy. I have question with regards to half-life; I have heard of OU process to determine the half-life but it's not giving me that kind of result.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone advise another way to identify half-life or else any other indicator that I can use to trade to support my Z score?&lt;/p&gt;&#xA;" OwnerUserId="926" LastEditorUserId="8164" LastEditDate="2018-02-13T20:09:52.320" LastActivityDate="2018-02-13T20:09:52.320" Title="Mean Reversion Time Frame" Tags="&lt;mean-reversion&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1240" PostTypeId="2" ParentId="1239" CreationDate="2011-05-26T15:40:08.420" Score="7" Body="&lt;p&gt;The OU process is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ornstein-Uhlenbeck_process&quot; rel=&quot;noreferrer&quot;&gt;http://en.wikipedia.org/wiki/Ornstein-Uhlenbeck_process&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example of the use of the OU method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://epchan.blogspot.com/2007/01/what-is-your-stop-loss-strategy.html&quot; rel=&quot;noreferrer&quot;&gt;http://epchan.blogspot.com/2007/01/what-is-your-stop-loss-strategy.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To me, the problem is identifying processes that actually have a reason to bleed down to the mean, and that show statistically significant results.    If you can identify the &quot;bleeds&quot;, then you can build a model of a &quot;bleed&quot;.   From that, you can determine if the current &quot;bleed&quot; is taking longer than 95% (or whatever % you like) of the &quot;bleeds&quot; that you modeled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit 1 =================================&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To illustrate some considerations, I'll use the picture from one of Ernie's examples at this link:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://epchan.blogspot.com/2006/11/cointegration-of-oih-with-spot-oil.html&quot; rel=&quot;noreferrer&quot;&gt;http://epchan.blogspot.com/2006/11/cointegration-of-oih-with-spot-oil.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As shown below, I added green &quot;entry points&quot; (1 through 7) where you would &quot;get in&quot; as the blue line drops down through the top one-sigma red line.    I added red &quot;exit points&quot; (A through C) where you &quot;get out&quot; as the blue line drops through the mean zero line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/0IaIt.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see, trades 1-A, 2-B and 5-C are all profitable &quot;bleeds&quot;.  However, entries 3, 4, 6, 7, (and others that I didn't label) are garbage.  You'll have to come up with a way to get out of those positions without wasting too much time and money.  The costs of closing out the garbage have to be subtracted from the gains of the bleeds to determine if this pair-trade is worth trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now look at another potential pair:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://epchan.blogspot.com/2006/11/reader-suggested-possible-trading.html&quot; rel=&quot;noreferrer&quot;&gt;http://epchan.blogspot.com/2006/11/reader-suggested-possible-trading.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the same general idea, this trade might have less garbage to deal with.    My point is, choosing the right pair is probably the most important part of pairs trading.&lt;/p&gt;&#xA;" OwnerUserId="392" LastEditorUserId="392" LastEditDate="2011-05-26T18:44:52.270" LastActivityDate="2011-05-26T18:44:52.270" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1241" PostTypeId="1" CreationDate="2011-05-26T19:24:32.427" Score="4" ViewCount="644" Body="&lt;p&gt;How do the two modelling frameworks compare? I spent some time developing PD LGD and EAD models for banking portfolios... But I never did insurance modelling project which I suspect is based on Solvency II?&lt;/p&gt;&#xA;" OwnerUserId="40" LastEditorUserId="5883" LastEditDate="2013-08-12T11:20:06.330" LastActivityDate="2013-08-12T11:20:06.330" Title="Basel II modelling vs Solvency II modelling?" Tags="&lt;risk-management&gt;&lt;risk-models&gt;&lt;solvency-ii&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1242" PostTypeId="1" CreationDate="2011-05-27T02:52:10.287" Score="7" ViewCount="585" Body="&lt;p&gt;I am looking for the S&amp;amp;P 500 index list of stocks for each day since January 1, 1960.  Does anyone know where I can find these lists?&lt;/p&gt;&#xA;" OwnerUserId="930" LastActivityDate="2011-05-31T15:02:24.347" Title="S&amp;P 500 list of stocks since 1960" Tags="&lt;trading&gt;&lt;investing&gt;&lt;index&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1244" PostTypeId="1" CreationDate="2011-05-27T11:50:51.537" Score="7" ViewCount="282" Body="&lt;p&gt;What are practically useful ways of modelling the effect of liquidity on options?&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2011-05-27T18:09:09.083" Title="Modeling liquidity effect on option prices" Tags="&lt;options&gt;&lt;liquidity&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1245" PostTypeId="2" ParentId="1244" CreationDate="2011-05-27T18:09:09.083" Score="4" Body="&lt;p&gt;In general liquidity is most often modeled, for most types of instruments, via proxy by the 'bid-ask spread'&#xA;(wider = less liquid, narrower = more liquid)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can choose to model the bid-ask spread in dollars, or what is often most helpful, for options, is to model the bid-ask spread in terms of implied volatility (of the difference between the bid and ask prices).  This lets you make consistent cross-sectional comparisons of liquidity, and do hypothesis testing.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;here's a sample paper that uses the implied vol appraoch:&#xA;&lt;a href=&quot;http://www.ccfr.org.cn/cicf2010/papers/20091215131015.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.ccfr.org.cn/cicf2010/papers/20091215131015.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-05-27T18:09:09.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1246" PostTypeId="2" ParentId="1238" CreationDate="2011-05-30T09:17:57.443" Score="3" Body="&lt;p&gt;&lt;a href=&quot;http://defaultrisk.com/&quot; rel=&quot;nofollow&quot;&gt;http://defaultrisk.com/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Main Authors, Papers &amp;amp; Book links, recommendations. Should be all you need.&lt;/p&gt;&#xA;" OwnerUserId="647" LastEditorUserId="1106" LastEditDate="2011-09-07T15:17:49.330" LastActivityDate="2011-09-07T15:17:49.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1247" PostTypeId="1" AcceptedAnswerId="1262" CreationDate="2011-05-30T12:30:51.313" Score="8" ViewCount="431" Body="&lt;p&gt;I want to try out the &lt;a href=&quot;http://en.wikipedia.org/wiki/Vickrey_auction&quot; rel=&quot;nofollow&quot;&gt;Vickrey auction&lt;/a&gt; for a project of mine, but I'm not sure that I understand it completely. The thing is that I have several consumers and several providers trading one resource type on the market. If I have just one provider and several consumers, the things are pretty straight forward. But what happens if I have more of them? If I randomly choose one provider's offer and try to find the appropriate buyer and then continue until I find a match for all the offers, it might happen that I won't find the optimal solution. For example, I have two offers (o1, o2) and two requirements (r1, r2). If I check first the best match for o1, I might find out that the best result would be o1-r1, and therefore o2-r2 (that's what's left). But what if when I first check the o2 and find out that o2-r1 and o1-r2 brings higher utility? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For me it seems the best to try out all solutions and then to compare the welfare, but it sounds incredibly stupid. It would take many iterations. Any ideas how to solve this?&lt;/p&gt;&#xA;" OwnerUserId="939" LastEditorUserId="1106" LastEditDate="2011-08-23T13:39:46.587" LastActivityDate="2011-08-24T09:25:48.553" Title="How to generalize the Vickrey auction for two-sided trading?" Tags="&lt;market&gt;&lt;market-design&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1248" PostTypeId="1" AcceptedAnswerId="1249" CreationDate="2011-05-30T14:22:02.953" Score="2" ViewCount="47" Body="&lt;p&gt;What are the exceptions set by the &lt;a href=&quot;http://www.cftc.gov/&quot; rel=&quot;nofollow&quot;&gt;CFTC&lt;/a&gt; which exempt &lt;a href=&quot;http://en.wikipedia.org/wiki/Commodity_Pool_Operator&quot; rel=&quot;nofollow&quot;&gt;Commodity Pool Operators&lt;/a&gt; (CPO) from registering as such?&lt;/p&gt;&#xA;" OwnerUserId="151" LastEditorUserId="16595" LastEditDate="2018-09-27T19:00:42.483" LastActivityDate="2018-09-27T19:00:42.483" Title="CFTC CPO Exemptions" Tags="&lt;regulation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1249" PostTypeId="2" ParentId="1248" CreationDate="2011-05-30T16:08:40.017" Score="3" Body="&lt;p&gt;&lt;a href=&quot;http://www.hedgefundlawblog.com/hedge-fund-cpo-exemptions.html&quot; rel=&quot;nofollow&quot;&gt;http://www.hedgefundlawblog.com/hedge-fund-cpo-exemptions.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-05-30T16:08:40.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1250" PostTypeId="1" CreationDate="2011-05-30T16:56:23.557" Score="7" ViewCount="6073" Body="&lt;p&gt;I am experimenting with Monte Carlo methods. I'd like to measure/estimate convergence with a graph/chart. &#xA;How do I do that? Can anyone please direct me to relevant documentation/links or even give me tips or general guidelines?&#xA;Thanks in advance,&#xA;Julien.&lt;/p&gt;&#xA;" OwnerUserId="941" LastEditorUserId="1106" LastEditDate="2011-08-07T12:46:12.050" LastActivityDate="2011-08-07T19:06:31.503" Title="How do I estimate convergence in monte carlo methods?" Tags="&lt;option-pricing&gt;&lt;monte-carlo&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1251" PostTypeId="1" AcceptedAnswerId="1253" CreationDate="2011-05-30T17:26:06.540" Score="4" ViewCount="1611" Body="&lt;p&gt;I know what random variables are but I don't understand what a linear combination of gaussian random variables is. Can anyone please give me an explanation or clues?&#xA;Thanks in advance,&#xA;Julien.&lt;/p&gt;&#xA;" OwnerUserId="941" LastActivityDate="2011-05-30T20:45:42.823" Title="Linear combination of gaussian random variables" Tags="&lt;random-variables&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1253" PostTypeId="2" ParentId="1251" CreationDate="2011-05-30T20:45:42.823" Score="3" Body="&lt;p&gt;Gaussian random variable is another name for Normal random variable. It is called Gaussian because Carl Friedrich Gauss &lt;a href=&quot;http://www.willamette.edu/~mjaneba/help/normalcurve.html&quot; rel=&quot;nofollow&quot;&gt; discovered &lt;/a&gt; many properties of the Normal distribution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A linear combination of Gaussian random variables is another random variable, not necessarily Gaussian itself, that you get by adding and subtracting Gaussian random variables. Lets call this linear combination of Gaussian variables $Y$. The random variable $Y$ could be something like $$ Y = 2 \times X_1 + 1.2234 \times X_2 -7 $$ Or it could be something like $$Y = \frac{X_1 - 0.01 \times X_2}{12}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $X$'s are Gaussian random variables. As you can see a linear combination of them is obtained by summing them up or subtracting them from each other, but never multiplying or dividing them with each other or by itself (like squaring or taking roots). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can give general form of linear combination of random Gaussian variables: $$ Y = a_1X_1 + a_2X_2 + ... + a_n X_n$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $a_i$ is any number you want it to be, like -222, or 0 or 17.222...&lt;/p&gt;&#xA;" OwnerUserId="796" LastActivityDate="2011-05-30T20:45:42.823" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1256" PostTypeId="1" AcceptedAnswerId="1553" CreationDate="2011-05-31T13:07:26.203" Score="7" ViewCount="241" Body="&lt;p&gt;Say I have two risk factors $X_1$ and $X_2$. Standard deviation for $X_1$ is $\sigma_1$ and $\sigma_2$ for $X_2$. Furthermore, $X_1$ has a mean of $\mu_1$ and $X_2$ has a mean of $\mu_2$. Correlation between $X_1$ and $X_2$ is $\rho$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The system is as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{eqnarray} &#xD;&#xA;X_1 &amp;amp; = &amp;amp; \mu_1 + \lambda_{11} U_1 \\&#xD;&#xA;X_2 &amp;amp; = &amp;amp; \mu_2 + \lambda_{21} U_1 + \lambda_{22} U_2&#xD;&#xA;\end{eqnarray}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My book reads as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Accordingly:&lt;br&gt;&#xA;$\lambda_{11}=\sigma_1$ (1)&lt;br&gt;&#xA;$\lambda_{21}^2 + \lambda_{22}^2= \sigma_2^2$ (2)&lt;br&gt;&#xA;$\lambda_{21} \lambda_{11}= \rho \sigma_1 \sigma_2$ (3)&quot;&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't understand how they work out lines (2) and (3).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone please help?&lt;/p&gt;&#xA;" OwnerUserId="943" LastEditorUserId="38" LastEditDate="2011-05-31T13:47:05.250" LastActivityDate="2011-08-01T22:33:26.993" Title="Question about equations and risk factors." Tags="&lt;models&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1257" PostTypeId="2" ParentId="1242" CreationDate="2011-05-31T15:02:24.347" Score="4" Body="&lt;p&gt;Find a friend with a Bloomberg terminal. If you are student check at your university, they might have access to different sources.&lt;/p&gt;&#xA;" OwnerUserId="262" LastActivityDate="2011-05-31T15:02:24.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1258" PostTypeId="2" ParentId="1256" CreationDate="2011-05-31T16:42:47.103" Score="3" Body="&lt;p&gt;You should offer more details [I assume U1 and U2 are N(0,1)] but I think you should read this:&#xA;&lt;a href=&quot;http://en.wikipedia.org/wiki/Cholesky_decomposition&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Cholesky_decomposition&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="826" LastActivityDate="2011-05-31T16:42:47.103" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1259" PostTypeId="1" AcceptedAnswerId="1411" CreationDate="2011-05-31T22:20:56.553" Score="13" ViewCount="625" Body="&lt;p&gt;What would be an ideal way to estimate the covariance of an index with a basket of stocks? For example, should I use one-tail ANOVA test or an individual stock &amp;amp; index F-test?&lt;/p&gt;&#xA;" OwnerUserId="926" LastEditorUserId="1106" LastEditDate="2011-10-18T20:45:12.683" LastActivityDate="2011-10-18T20:48:52.050" Title="How to estimate the covariance of an index with a basket of stocks?" Tags="&lt;equities&gt;&lt;statistics&gt;&lt;correlation&gt;&lt;covariance&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1260" PostTypeId="1" AcceptedAnswerId="4565" CreationDate="2011-05-31T22:34:13.640" Score="17" ViewCount="11619" Body="&lt;p&gt;Can any one help me with some R code to run Ornstein-Uhlenbeck process?&lt;/p&gt;&#xA;" OwnerUserId="926" LastEditorUserId="1355" LastEditDate="2012-11-19T14:56:10.797" LastActivityDate="2017-12-04T11:01:16.660" Title="R code for Ornstein-Uhlenbeck process" Tags="&lt;r&gt;&lt;mean&gt;&lt;mean-reversion&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="1261" PostTypeId="2" ParentId="1260" CreationDate="2011-06-01T02:38:37.317" Score="11" Body="&lt;p&gt;Take a look at the &lt;a href=&quot;http://cran.r-project.org/web/packages/sde&quot;&gt;sde&lt;/a&gt; package; specifically the &lt;code&gt;dcOU&lt;/code&gt; and &lt;code&gt;dsOU&lt;/code&gt; functions.  You may also find some examples on the R-SIG-Finance mailing list, which would be in the results of a search on &lt;a href=&quot;http://www.rseek.org&quot;&gt;www.rseek.org&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="56" LastActivityDate="2011-06-01T02:38:37.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1262" PostTypeId="2" ParentId="1247" CreationDate="2011-06-01T17:06:11.047" Score="4" Body="&lt;p&gt;One idea - borrowing from Google's 2nd Price auction model, which uses Vickery, for prioritizing rank of ads on their search page would be to determine a strictly monotonic increasing function $f(*)$, which applied to $u1 = (o1 - r1)$ and $u2 = (o2-r2)$ results in $o1*f(u1) \geq o2*f(u2)$ iff $o1 \geq o2$.  The winner in this case would pay: $o2*f(u2) / f(u1)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Google's case, they use a function that also incorporates other variables that describe the utility of being in a &quot;winning&quot; or higher ranked position for each resource. &lt;/p&gt;&#xA;" OwnerUserId="948" LastEditorUserId="526" LastEditDate="2011-06-02T08:42:53.457" LastActivityDate="2011-06-02T08:42:53.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1263" PostTypeId="2" ParentId="1209" CreationDate="2011-06-02T08:30:58.537" Score="5" Body="&lt;p&gt;All of these index constituents are available on Bloomberg and through Bloomberg Excel link. Just use one of those Index member formulas with a date override.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://libfaq.smu.edu.sg/a.php?qid=2998&quot; rel=&quot;noreferrer&quot;&gt;http://libfaq.smu.edu.sg/a.php?qid=2998&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="932" LastActivityDate="2011-06-02T08:30:58.537" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1264" PostTypeId="1" AcceptedAnswerId="1265" CreationDate="2011-06-02T14:53:56.693" Score="15" ViewCount="6744" Body="&lt;p&gt;I'm backtesting a trading strategy, using free OHLC data from yahoo or google.  I'm simulating friction by lopping a flat percentage (say 0.5%) off my returns for each day that I make a trade.  Whats a good way to simulate &lt;a href=&quot;http://www.investopedia.com/terms/s/slippage.asp&quot; rel=&quot;noreferrer&quot;&gt;slippage&lt;/a&gt;?  I tried '&lt;a href=&quot;https://quant.stackexchange.com/questions/839/making-your-own-backtester/842#842&quot;&gt;torturing&lt;/a&gt;' my returns, by pretending that I always buy at the day's high and sell at the day's low, but that was depressing.  Is there a good compromise between naively assuming my trades execute at the day's close and 'torturing' my trades?&lt;/p&gt;&#xA;" OwnerUserId="500" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2015-07-20T00:55:15.330" Title="How to simulate slippage" Tags="&lt;trading&gt;&lt;backtesting&gt;&lt;slippage&gt;&lt;friction&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="1265" PostTypeId="2" ParentId="1264" CreationDate="2011-06-02T16:31:06.877" Score="11" Body="&lt;p&gt;Slippage is multi-facetted, however, I think the main element to slippage is going to depend on the sophistication of your execution approach.   Also, in your case there are 2 types of slippage:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;execution slippage (i.e. cost above mid to get your fill)&lt;/li&gt;&#xA;&lt;li&gt;tracking slippage (how much price difference between actual close and your fill price)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;b&gt;Execution Approaches&lt;/b&gt;&lt;br/&gt;&#xA;Here are a few ways one might try to execute near the close price (I'll assume the use of limit orders).  Each of these has a different impact in terms of execution slippage:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;put in a very aggressive order in the final minute(s) that is priced to cross deep into the ask book (if buying) or bid book (if selling).  By deep mean buy at ask + some price enrichment such that if the inside book is taken out before your order is received you still obtain a fill.&lt;/li&gt;&#xA;&lt;li&gt;project some closing price estimate before EOD and put in a standing order for that price some period before close&lt;/li&gt;&#xA;&lt;li&gt;try to cross aggressively on the inside price, adjusting order at high-frequency&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The first approach may have the most execution slippage, but does not require HF order placement and replacement.  The second is optimal in terms of execution costs, but projected target may deviate from actual close.  The 3rd is tighter than the first (often) in terms of execution costs, but requires HF data/execution to do well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;b&gt;Price Action&lt;/b&gt;&lt;br/&gt;&#xA;I don't believe an analytic approach on OHLC will ever work as cannot determine without seeing the microstructure or intraday price action. For instance consider trying to buy near the close in each of these scenarios:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;upward momentum&lt;/li&gt;&#xA;&lt;li&gt;downward momentum&lt;/li&gt;&#xA;&lt;li&gt;sideways / flat&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If one attempts to buy in upward momentum you will be chasing price and will likely need to enrich your order significantly to get a fill (hence more slippage).  (this is the most frequent scenario, since if you are buying there is probably reason for others to be as well). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If one is buying in downward momentum then the fill is incredibly easy to do, as the market is biased towards sellers.  Hence a passive order (such as buying at the bid) or even bid - some spread is likely to be filled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If price action is sideways passive (at the bid) or aggressive orders (crossing to ask) should both be effective and hence have low execution slippage. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;br/&gt;&#xA;Slippage is a function of execution approach and local price action behavior (vol, buyer/seller bias, etc).  So, in my view you should obtain higher-frequency data and simulate your signal and execution algo to get an accurate picture.  This will not be wasted in that the same logic can (and should) be used to automate your execution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are looking to do large size, then your execution algo will be something more complex where you make multiple buying (selling) entries into the market.&lt;/p&gt;&#xA;" OwnerUserId="51" LastEditorUserId="51" LastEditDate="2011-06-02T16:36:58.247" LastActivityDate="2011-06-02T16:36:58.247" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1266" PostTypeId="1" AcceptedAnswerId="1269" CreationDate="2011-06-02T18:43:11.073" Score="11" ViewCount="791" Body="&lt;p&gt;As in the subject, I'm interested in a math puzzle of sorts:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If stock A has a 60% chance of rising, and stocks A and B have an 80% correlation, what is the chance of stock B rising?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would it be possible to extend this concept so that if we know the probabilities of stocks A,B,C,D rising, we can work out the probability of stock E rising, given tha stock E has some correlation to stocks A,B,C,D?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For an indepth tutorial video on the basics of probability, see the &lt;a href=&quot;http://www.khanacademy.org/video/probability--part-1?playlist=Probability&quot; rel=&quot;noreferrer&quot;&gt;Khan Academy Tutorial Videos on Probability&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="906" LastEditorUserId="906" LastEditDate="2011-06-06T00:21:57.310" LastActivityDate="2011-06-06T00:21:57.310" Title="If stock A has a 60% chance of rising, and stocks A and B have 80% correlation, what is the chance of stock B rising?" Tags="&lt;correlation&gt;&lt;probability&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1267" PostTypeId="2" ParentId="1197" CreationDate="2011-06-02T18:44:14.407" Score="0" Body="&lt;p&gt;I ended up writing my own library - not easy, but doable.&lt;/p&gt;&#xA;" OwnerUserId="906" LastActivityDate="2011-06-02T18:44:14.407" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1268" PostTypeId="2" ParentId="1198" CreationDate="2011-06-02T18:45:20.533" Score="4" Body="&lt;p&gt;Arbitrage free smoothing of a local volatility surface is actually quite a difficult feat to accomplish. Its unlikely that this sort of library will be available outside of the big institutions, for some time to come.&lt;/p&gt;&#xA;" OwnerUserId="906" LastActivityDate="2011-06-02T18:45:20.533" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1269" PostTypeId="2" ParentId="1266" CreationDate="2011-06-02T21:39:26.723" Score="9" Body="&lt;p&gt;You can't determine this with just the correlation; you need to know the joint probability.&lt;/p&gt;&#xA;" OwnerUserId="56" LastActivityDate="2011-06-02T21:39:26.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1270" PostTypeId="1" AcceptedAnswerId="1423" CreationDate="2011-06-03T16:46:14.923" Score="11" ViewCount="1741" Body="&lt;p&gt;I have two stocks, A and B, that are correlated in some way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I know (hypothetically) that stock A has a 60% chance of rising tomorrow, and I know the joint probability between stocks A and B, how do I calculate the probability of stock B moving tomorrow?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For bonus upvotes - do you know of any standard libraries that can calculate the joint probability of stocks A and B, given a time series of historical data?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The phrase &quot;conditional probability&quot; is also applicable.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;See &lt;a href=&quot;http://en.wikipedia.org/wiki/Conditional_probability/&quot;&gt;Wikipedia on Conditional Probability&lt;/a&gt;. &lt;/li&gt;&#xA;&lt;li&gt;See &lt;a href=&quot;http://www.khanacademy.org/video/probability--part-6?playlist=Probability&quot;&gt;Tutorial video on Conditional Probability from Khan Academy&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="906" LastEditorUserId="906" LastEditDate="2011-06-05T22:15:57.883" LastActivityDate="2013-08-10T05:43:03.637" Title="How do I estimate the joint probability of stock B moving, if  stock A moves?" Tags="&lt;correlation&gt;&lt;probability&gt;&lt;joint-probability&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1271" PostTypeId="1" AcceptedAnswerId="1805" CreationDate="2011-06-04T01:01:56.493" Score="13" ViewCount="1252" Body="&lt;p&gt;Back in the &quot;old days&quot; (ie 5-10 years ago) when we wanted to be long or short an emerging currency (say the ZAR, BRL, or TRY) we simply did everything against the pre-eminent currency of the day, the dollar. So for example to be long the Turkish Lira, we sold USDTRY. Short the rand, we bought USDZAR. Most of the return was attributable to the RHS of the pair. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nowadays, the dollar is not the universally dominant hard currency, and so the relative strength or weakness of the USD itself &quot;pollutes&quot; a USD-EMFX position. In practise, for example, the correlation between EURUSD and USDXXX where XXX is an EM currency, has increased (in absolute terms):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/9zzkU.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, if I am short USDZAR, I am significantly long of EURUSD through the correlation. The question is, how do I hedge this developed-currency cross rate risk out? How do I get back as close as possible to a pure-play on the emerging currency? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously the answer will be that I have to fund my emerging currency position with a basket of hard currencies (candidates being say, USD, EUR, GBP, CHF, CAD, AUD, and JPY). But how do I best calculate the weights of this basket? Multiple regression of USDZAR against USDEUR, USDGBP, USDCHF, USDCAD, USDAUD, and USDJPY? Is that the right approach? Is there anything better? I've seen bloomberg using PCA for example in their Bloomberg Correlation Weighted Indices.&lt;/p&gt;&#xA;" OwnerUserId="954" LastEditorUserId="35" LastEditDate="2011-06-04T01:46:44.673" LastActivityDate="2011-08-31T21:11:07.323" Title="How do I eliminate developed currency funding cross rate risk in an EMFX position?" Tags="&lt;fx&gt;" AnswerCount="3" CommentCount="6" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1273" PostTypeId="2" ParentId="1209" CreationDate="2011-06-04T20:30:39.083" Score="1" Body="&lt;p&gt;You can get this information by 'web scraping' - running a script (Python is ideal) which visits the relevant websites and extracts the prices from the HTML, then packages it into a suitable form (eg XML) and saves to disk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only drawback is that the script needs fairly regular maintenance, as the pages you are getting the information from tend to be updated quite regularly and when that happens the script needs to modified accordingly.&lt;/p&gt;&#xA;" OwnerDisplayName="user957" LastActivityDate="2011-06-04T20:30:39.083" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1274" PostTypeId="1" AcceptedAnswerId="1357" CreationDate="2011-06-05T09:27:19.730" Score="46" ViewCount="16865" Body="&lt;p&gt;Consider a market participant $A$ who is mechanically following an automated liquidity providing algorithm (HFT) in a number of large cap stocks on a specific exchange.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume furthermore that we are able to observe all orders placed by $A$ and that we know that the algorithm used by $A$ takes only public market data as input. $A$ starts and ends all trading days with zero inventory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We want to reverse engineer the algorithm used by $A$. Let's call this algorithm $f(...)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first step in reverse engineering the algorithm $f(...)$ would be to collect potential input variables to the algorithm that can later be used to infer the exact form of $f(...)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first problem we face is which input variables we should collect in order to be able to reverse engineer $f(...)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To have a starting point we can consider the input variables used in &lt;a href=&quot;http://www.math.nyu.edu/faculty/avellane/HighFrequencyTrading.pdf&quot;&gt;Avellaneda &amp;amp; Stoikov (2008)&lt;/a&gt;. In &lt;a href=&quot;http://www.math.nyu.edu/faculty/avellane/HighFrequencyTrading.pdf&quot;&gt;Avellaneda &amp;amp; Stoikov (2008)&lt;/a&gt; the authors derive how a rational market maker (non-specialist) should set his bid and ask quotes in a limit order book market. The results are obviously contingent on the assumptions and model choices made in the paper.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The optimal bid (or ask) in &lt;a href=&quot;http://www.math.nyu.edu/faculty/avellane/HighFrequencyTrading.pdf&quot;&gt;Avellaneda &amp;amp; Stoikov (2008)&lt;/a&gt; is a function of the following inputs:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The trader's reservation price, which is a function of the security price ($S$), the market maker's current inventory ($q$) and time left until terminal holding time ($T-t$)&lt;/li&gt;&#xA;&lt;li&gt;The relative risk aversion of the trader ($\gamma$) (obviously hard to observe!)&lt;/li&gt;&#xA;&lt;li&gt;The frequency of new bid and ask quotes ($\lambda_{bid}$ and $\lambda_{ask}$)&lt;/li&gt;&#xA;&lt;li&gt;The latest change in frequency of new bid and ask quotes ($\delta\lambda_{bid}$ and $\delta\lambda_{ask}$)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What potential input variables should we collect in order to be able to reverse engineer $f(...)$?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="526" LastEditorUserId="2299" LastEditDate="2012-04-18T02:00:42.520" LastActivityDate="2012-05-23T18:43:00.443" Title="How can we reverse engineer a market-making algorithm (HFT)?" Tags="&lt;trading&gt;&lt;automated-trading&gt;&lt;high-frequency&gt;&lt;market-microstructure&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="47" ContentLicense="CC BY-SA 3.0" />
  <row Id="1275" PostTypeId="1" AcceptedAnswerId="1278" CreationDate="2011-06-05T09:58:39.427" Score="8" ViewCount="2447" Body="&lt;p&gt;Suppose quantified duration (like Macaulay duration with changing intervals) $Dur = \frac{\sum t_{i} PV_{i}}{\sum PV_{i}}$ and two funds having durations $D_{a}$ and $D_{b}$. You own them in the proportion $w_{a}=0.4$ and $w_{b}=0.6$.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;What is the duration of your portfolio?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is it the following? $C_{newDur}=A_{fundDur}w_{a} + B_{fundDur}w_{b}$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is duration combinations always sumproduct (like above, presupposing right not sure) or does it vary between different definitions of duration?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Resources&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;page 61 about parallel shift, page 73 about traditional immunization, page 79 about multivariate immunization (1990), &lt;a href=&quot;http://math.illinoisstate.edu/krzysio/Primer.pdf&quot;&gt;here&lt;/a&gt;. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="956" LastEditorUserId="956" LastEditDate="2011-06-05T20:03:50.747" LastActivityDate="2016-03-21T15:35:30.710" Title="Is duration additive? $C_{newDur}=A_{fundDur}w_{a} + B_{fundDur}w_{b}$?" Tags="&lt;fixed-income&gt;&lt;duration&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1276" PostTypeId="2" ParentId="1264" CreationDate="2011-06-05T14:20:12.690" Score="6" Body="&lt;p&gt;You can use MOC (Market on Close) orders to realize the closing price on NYSE or NASDAQ.  The price you get will be the official close.  You should check to see whether the free data you are getting contains the consolidated (last price across all venues) or primary (last price on the primary listing exchange for the stock) for its closing prices.  If it contains consolidated prices then you could find that you realize different prices than your backtest.  It should still be relatively close however.&lt;/p&gt;&#xA;" OwnerUserId="959" LastActivityDate="2011-06-05T14:20:12.690" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1277" PostTypeId="1" AcceptedAnswerId="1283" CreationDate="2011-06-05T15:03:19.290" Score="10" ViewCount="6253" Body="&lt;p&gt;I'm wondering what API methods there are to determine a company's market cap, i.e. (number of shares issued) * (price per share).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know IQfeed and perhaps Yahoo will do this - does anyone know of any other API's that will do the job?&lt;/p&gt;&#xA;" OwnerUserId="906" LastEditorUserId="906" LastEditDate="2011-06-06T10:48:34.777" LastActivityDate="2013-02-26T06:36:10.207" Title="What API methods are there to determine a company's market cap?" Tags="&lt;programming&gt;&lt;yahoo&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1278" PostTypeId="2" ParentId="1275" CreationDate="2011-06-05T15:47:21.510" Score="6" Body="&lt;p&gt;Yes, you are correct. &lt;strong&gt;Duration is additive&lt;/strong&gt;, so your aggregate portfolio duration is the &lt;em&gt;weighted average of your individual durations&lt;/em&gt; as you present in point 2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That holds assuming a &lt;strong&gt;close to flat yield curve&lt;/strong&gt; and &lt;strong&gt;parallel (additive) shifts&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that's not the case, the situation gets a bit more complex. Unfortunately, right now I couldn't find any interesting and freely accessible paper that would deal with non-additive shifts or non-flat yield curve.&lt;/p&gt;&#xA;" OwnerUserId="38" LastEditorUserId="38" LastEditDate="2016-03-21T15:35:30.710" LastActivityDate="2016-03-21T15:35:30.710" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1279" PostTypeId="1" AcceptedAnswerId="1288" CreationDate="2011-06-05T18:21:25.760" Score="7" ViewCount="736" Body="&lt;p&gt;Since I began thinking about portfolio optimization and option pricing, I've struggled to get an intuition for the risk premium, i.e. that investors are only willing to buy risky instruments when they are compensated by an add-on above $r$ (the risk free interest rate).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the one hand this is understandable and backed by most empirical data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand there is this divide between the risk-neutral world of derivatives pricing and the real world with real world probabilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The bridge between both worlds goes via a hedging argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder (just to give one possibility of debunking the classic risk premium argument) if there really was something like a systematic risk premium $\mu-r$ nothing would be easier as to squeeze it out by simply buying the underlying and selling the futures contract against it. The result should be a reduction of the risk premium until it becomes $0$ and the trading strategy wouldn't work anymore.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The result should be that even in a risk-averse world probabilities become risk-neutral (i.e.  the growth rate $\mu$ equals $r$) like in option pricing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there something wrong with this reasoning?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;br&gt;&#xA;OK, my original argument doesn't work. Anyway: I'm still feeling uncomfortable with the idea. My reasoning is that the whole idea of an inherent mechanism for compensating people for taking risk within a random process nevertheless (!) seems to be build on shaky ground. If it was true it would also be true for shorting the instrument since you are also taking risk there. But in this more or less symmetrical situation one side seems to be privileged. And the more privileged one side is the more disadvantaged the other side must be. It all doesn't make sense...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the only compensation that makes sense in the long run is $r$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please feel free to comment and/or give some references on similar ideas. Thank you again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT2&lt;/strong&gt;&lt;br&gt;&#xA;After a longer quiet period on that issue see this follow-up question and answers:&lt;br&gt;&#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/3739/equity-risk-premium-and-risk&quot;&gt;Why should there be an equity risk premium?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-04-29T17:39:06.737" Title="Debunking risk premium via &quot;hedging&quot; argument? (or why even in the real world $\mu$ should equal $r$)" Tags="&lt;option-pricing&gt;&lt;hedging&gt;&lt;risk-premium&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1282" PostTypeId="2" ParentId="1279" CreationDate="2011-06-05T23:10:33.377" Score="2" Body="&lt;p&gt;I also find the &quot;risk premium&quot; idea unsatisfying, but I don't think your hedging argument works.  Because hedging implies correlation, the risk free asset needs to be well correlated with the risky one in order for you to make any spread between the two.  Are you saying that someone should be able to earn the risk premium (without taking any risk!) by being long equities and short treasuries, for example?  I don't think that's possible.&lt;/p&gt;&#xA;" OwnerUserId="959" LastActivityDate="2011-06-05T23:10:33.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1283" PostTypeId="2" ParentId="1277" CreationDate="2011-06-06T00:16:19.853" Score="4" Body="&lt;p&gt;See Yahoo Query Language (YQL) blog: &lt;a href=&quot;http://www.yqlblog.net/blog/2009/06/02/getting-stock-information-with-yql-and-open-data-tables/&quot; rel=&quot;nofollow&quot;&gt;Getting stock information with YQL and open data tables&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Go to the &lt;a href=&quot;http://y.ahoo.it/DEiCg2SN&quot; rel=&quot;nofollow&quot;&gt;YQL console&lt;/a&gt;, and use the following query:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;select MarketCapitalization from yahoo.finance.quotes where symbol in (&quot;YHOO&quot;,&quot;AAPL&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is key part of the result:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;results&amp;gt;&#xA;    &amp;lt;quote&amp;gt;&#xA;        &amp;lt;MarketCapitalization&amp;gt;20.508B&amp;lt;/MarketCapitalization&amp;gt;&#xA;    &amp;lt;/quote&amp;gt;&#xA;    &amp;lt;quote&amp;gt;&#xA;        &amp;lt;MarketCapitalization&amp;gt;317.5B&amp;lt;/MarketCapitalization&amp;gt;&#xA;    &amp;lt;/quote&amp;gt;&#xA;&amp;lt;/results&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Once you have the result in .xml, its easy to query it using LINQ in C#.&lt;/p&gt;&#xA;" OwnerUserId="906" LastEditorUserId="906" LastEditDate="2011-06-06T00:23:22.710" LastActivityDate="2011-06-06T00:23:22.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1284" PostTypeId="1" AcceptedAnswerId="1309" CreationDate="2011-06-06T00:17:33.693" Score="22" ViewCount="5614" Body="&lt;p&gt;what would you suggest are the starting points for comparing, in an easy, visual way, implied and delivered volatility surfaces? I'd like to see what the differences are between the historic surfaces, and the implied surfaces. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Implieds are easy enough, for example USDBRL:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/hQDeX.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But how would you go about taking a set of the past 2 years of historic returns and convert it into an equivalent surface to the above? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps there are other ways usefully to look at this problem, and where should I start? I have looked at boxplots of historic returns, but then I have the opposite problem namely, a visual representation of the historic vol but then how do I compare it to implieds?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another thing I could do is simply to look at the historic standard deviation and compare it to the ATM vols, but then I'd be ignoring the (very useful) relative value information in the wings (because I have a sneaky suspicion that the upside wings are expensive). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My preferred tool is R (and Excel fallback if I must), or Python.&lt;/p&gt;&#xA;" OwnerUserId="954" LastEditorUserId="1106" LastEditDate="2011-12-16T10:04:31.397" LastActivityDate="2011-12-16T10:04:31.397" Title="How do I compare implied and historic volatility?" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;fx&gt;&lt;visualization&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1285" PostTypeId="1" AcceptedAnswerId="1670" CreationDate="2011-06-06T00:39:38.690" Score="5" ViewCount="297" Body="&lt;p&gt;If we know the options Implied Volatility (IV) skew for an equity, is it possible to calculate the probability of the equity moving, given a move in the IV?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can define IV skew as the difference between IV at delta 0.25 compared to IV at delta 0.75.&lt;/p&gt;&#xA;" OwnerUserId="906" LastActivityDate="2011-08-15T15:39:47.180" Title="Is it possible to estimate the correlation between an equity and its IV, purely from its IV skew?" Tags="&lt;correlation&gt;&lt;implied-volatility&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1287" PostTypeId="1" AcceptedAnswerId="1289" CreationDate="2011-06-06T15:50:31.163" Score="11" ViewCount="4857" Body="&lt;p&gt;I read in a book that the distance to default of a company is &quot;2.978&quot;.&#xA;Can anyone please tell me what is the unit implied behind this measure? Are they &quot;years&quot; for instance? &lt;/p&gt;&#xA;" OwnerUserId="943" LastEditorUserId="467" LastEditDate="2012-04-25T06:28:43.663" LastActivityDate="2017-06-24T17:53:57.093" Title="What is the unit of the Distance to Default measure?" Tags="&lt;credit&gt;&lt;default&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1288" PostTypeId="2" ParentId="1279" CreationDate="2011-06-06T17:23:51.607" Score="5" Body="&lt;p&gt;If you're long the underlying and short the futures contract, then you have no risk and earn the risk-free rate. You get into the position at $S_0$ and will be able to get out of the position at $F_0$ at time $T$. By a no arbitrage argument it must be that $F_0 = S_0 \exp(r T)$. I imagine Hull has a pretty good exposition on this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The risk premium is because of uncertainty, and in this case there's no uncertainty. But imagine that everyone &lt;em&gt;knows&lt;/em&gt; that 1/2 the time I will not deliver the underlying at $T$. Then you'll likely only agree to $F_0 &amp;lt; \frac{1}{2} S_0 \exp(r T)$ and if everyone knows that I 1/2 the time I won't deliver, then arbitrage won't restore $F_0 = S_0 \exp(r T)$.&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-06-06T17:23:51.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1289" PostTypeId="2" ParentId="1287" CreationDate="2011-06-06T17:32:28.037" Score="10" Body="&lt;p&gt;Distance to default $DD$ should be measured in standard deviations. You convert this into a probability $p_{default}$ using the normal CDF: $p_{default} = N(-DD)$. So if $DD = 2.978$ then the firm is about 3 standard deviations from default and has a $\frac{1 - 0.997}{2} = 0.0015 = 0.15 \%$ chance of defaulting in the next period. I divided by two because this is a single-tailed test.&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-06-06T17:32:28.037" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1290" PostTypeId="2" ParentId="1195" CreationDate="2011-06-07T07:01:35.933" Score="9" Body="&lt;p&gt;Assuming you're referring to the local-volatility class implemented in &lt;code&gt;&amp;lt;QuantLib/ql/termstructures/volatility/equityfx/localvolsurface.hpp&amp;gt;&lt;/code&gt;, it's among the several classes that are not exported through SWIG.  You'll have to add it to the SWIG interface files (probably in &lt;code&gt;volatilities.i&lt;/code&gt;), regenerate the wrappers and recompile them.  If you need instructions on the building process, you can ask on the QuantLib mailing list.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2011-06-07T07:01:35.933" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1291" PostTypeId="1" CreationDate="2011-06-07T18:07:44.007" Score="4" ViewCount="4910" Body="&lt;p&gt;How do I specify the GARCH/TARCH equation in Eviews 6 in the variance regressors frame, if I want to find out whether there are volatilty spillovers from stock markets A and B to stock market C?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. I know I have to set threshold order to 1 ;)&lt;/p&gt;&#xA;" OwnerUserId="963" LastEditorUserId="106" LastEditDate="2011-06-08T02:13:07.897" LastActivityDate="2011-07-20T20:35:42.067" Title="How to estimate a multivariate GJR or TARCH model in Eviews?" Tags="&lt;volatility&gt;&lt;time-series&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1292" PostTypeId="1" AcceptedAnswerId="1564" CreationDate="2011-06-09T14:37:46.323" Score="14" ViewCount="2751" Body="&lt;p&gt;I'm trying to come up with the implied volatility skew adjusted delta for SPY options. I'm working with the following formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Skew Adjusted Delta = Black Scholes Delta + Vega * Vol Skew Slope.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I fitted a cubic polynomial to the volatility data, but I am not sure at which points to measure the slope.&lt;/p&gt;&#xA;" OwnerUserId="892" LastEditorUserId="1106" LastEditDate="2011-09-12T15:02:25.453" LastActivityDate="2011-09-12T15:02:25.453" Title="How should I estimate the implied volatility skew term when calculating the skew-adjusted delta?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;black-scholes&gt;&lt;delta-neutral&gt;&lt;skew&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1293" PostTypeId="2" ParentId="306" CreationDate="2011-06-09T15:59:19.607" Score="3" Body="&lt;p&gt;For a lot of complex Financial applications , the Array Programming Languages virtually have a monopoly .  Check out the APLs from IBM , Dyalog , APLnext , and the variants J and Kdb ( Q ) .  Python , R , and Matlab have implemented a number of ideas from the APL tradition . Morgan Stanley continues to use Arthur Whitney's ( the creator of Q , nee K ) A+ . SmartArrays has a library , interfaced to most standard languages and operating systems , implementing the essential array functions abstracted by a couple of the implementers of the most prominent traditional APLs &lt;/p&gt;&#xA;" OwnerUserId="969" LastActivityDate="2011-06-09T15:59:19.607" CommentCount="1" CommunityOwnedDate="2011-06-09T15:59:19.607" ContentLicense="CC BY-SA 3.0" />
  <row Id="1294" PostTypeId="2" ParentId="1270" CreationDate="2011-06-09T20:49:30.633" Score="5" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;...do you know of any standard&#xA;  libraries that can calculate the joint&#xA;  probability of stocks A and B, given a&#xA;  time series of historical data?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Using &lt;a href=&quot;http://www.r-project.org/&quot;&gt;R&lt;/a&gt; and the &lt;a href=&quot;http://lspm.r-forge.r-project.org/&quot;&gt;LSPM package&lt;/a&gt; with the code posted &lt;a href=&quot;http://blog.fosstrading.com/2010/05/lspm-joint-probability-tables.html?utm_source=feedburner&amp;amp;utm_medium=feed&amp;amp;utm_campaign=Feed%3a%20FossTrading%20%28FOSS%20Trading%29&quot;&gt;here&lt;/a&gt; might be what you are looking for.&lt;/p&gt;&#xA;" OwnerUserId="252" LastActivityDate="2011-06-09T20:49:30.633" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1295" PostTypeId="2" ParentId="1275" CreationDate="2011-06-10T02:29:52.910" Score="2" Body="&lt;p&gt;Duration is also additive if you are dealing with key rate durations. In this case, Effective Duration is the weighted average of your key rate durations.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2011-06-10T02:29:52.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1296" PostTypeId="2" ParentId="959" CreationDate="2011-06-10T19:31:58.620" Score="11" Body="&lt;p&gt;In a typical HFT scenario (process incoming UDP quotes and send TCP order entry responses) well written Java can compete with C++ for pure speed.  If you need more speed, look to improve the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Your code (setup a good benchmark and then profile and tune)&lt;/li&gt;&#xA;&lt;li&gt;Your networking environment (low-latency switches, DMA NICs)&lt;/li&gt;&#xA;&lt;li&gt;Your architecture (are you doing multi-process or multi-computer hops?)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;We have written a couple of small networking benchmarks in C++ and Java, and if you use the same techniques in both, you get the same performance.&lt;/p&gt;&#xA;" OwnerUserId="77" LastActivityDate="2011-06-10T19:31:58.620" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1297" PostTypeId="2" ParentId="80" CreationDate="2011-06-10T19:38:47.463" Score="4" Body="&lt;p&gt;Markets adjust with the impact of incoming orders.  A large buyer will send the price up in any market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't let the mini in the name fool you, the emini S&amp;amp;P is one of the most liquid futures contracts in the world.  The futures market often has more volume available in the best couple ticks than the equity markets that it is based on.  &lt;/p&gt;&#xA;" OwnerUserId="77" LastActivityDate="2011-06-10T19:38:47.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1298" PostTypeId="2" ParentId="1110" CreationDate="2011-06-12T03:57:00.230" Score="1" Body="&lt;p&gt;I'm not sure where the (100 - X)/100 pattern is coming from. Implied volatility is defined on top of the Black-Scholes value for an option, which I understood to multiply a decaying function of the dividend and interest-free rates with the current spot and strike... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In any case, I've always seen it expressed in terms of straight prices, no normalization necessary.&lt;/p&gt;&#xA;" OwnerUserId="80" LastActivityDate="2011-06-12T03:57:00.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1299" PostTypeId="2" ParentId="1039" CreationDate="2011-06-12T04:10:37.400" Score="4" Body="&lt;p&gt;SWIFT is actually not a standard per se; rather, it's an organization that operates a proprietary exchange network that utilizes a set of ISO messaging standards.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FIX is a non-proprietary set of messaging standards with no underlying network specified. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is certainly overlap between the two, and there has been &lt;a href=&quot;http://www.londonmarketsystems.com/iso20022.pdf&quot; rel=&quot;nofollow&quot;&gt;work to co-align&lt;/a&gt; these standards. I would say the choice between them would be made more on the transport requirements (e.g. SWIFT for a centralized guaranteed delivery) and on the fringes where they don't overlap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A couple salient threads from the FIX website:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.fixprotocol.org/discuss/read/46f5a06f&quot; rel=&quot;nofollow&quot;&gt;http://www.fixprotocol.org/discuss/read/46f5a06f&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.fixprotocol.org/discuss/read/53a3fa9b&quot; rel=&quot;nofollow&quot;&gt;http://www.fixprotocol.org/discuss/read/53a3fa9b&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="80" LastActivityDate="2011-06-12T04:10:37.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1300" PostTypeId="2" ParentId="1129" CreationDate="2011-06-13T17:40:28.477" Score="6" Body="&lt;p&gt;Have you considered fitting ARIMA with exogenous regressors model? Linear regression with autocorrelated errors might be appropriate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;R can do this with the arima() function via specifying the xreg argument.&lt;/p&gt;&#xA;" OwnerUserId="139" LastActivityDate="2011-06-13T17:40:28.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1301" PostTypeId="2" ParentId="1039" CreationDate="2011-06-14T17:16:14.843" Score="1" Body="&lt;p&gt;FIX is frequently used for order entry traffic (new order, amend order, cancel order) and occasionally used for delivering market data when latency and performance are not critical.  (FIX/FAST is quite different, that is an encoding that CME and others use to compress price feed information.)  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are entering orders (either to a broker or directly to an exchange), FIX is a good choice, and is often your only choice.  &lt;/p&gt;&#xA;" OwnerUserId="77" LastActivityDate="2011-06-14T17:16:14.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1302" PostTypeId="1" CreationDate="2011-06-15T00:09:35.103" Score="3" ViewCount="754" Body="&lt;p&gt;I'm interested in investing some money in the stock market, and I have the math background that will make following the math used in quantitative finance possible (with some work).  What are the resources necessary to apply quantitative finance methods (algorithmic analysis and portfolio management) toward making money in the stock market?  Is this something that isn't profitable unless you have massive amounts of time/ huge databases of data/ ridiculously low latency bandwith / licenses or memberships to federal institutions?  Or is it possible for a hobbyist to do the analysis and make money without these things.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm just starting to learn about all this, but I don't want to waste my time if it's not cost effective to do this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a continuation of this, what are some low cost data sources that have API's available to them (I've seen Yahoo finance has an API, does Google finance?  MSN?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="984" LastActivityDate="2011-06-15T00:09:35.103" Title="Hobbyist Quants" Tags="&lt;data&gt;&lt;trading&gt;&lt;automated-trading&gt;&lt;equities&gt;&lt;learning&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ClosedDate="2011-06-15T02:37:50.477" ContentLicense="CC BY-SA 3.0" />
  <row Id="1303" PostTypeId="2" ParentId="1129" CreationDate="2011-06-15T04:41:18.613" Score="4" Body="&lt;p&gt;Van Belle describes a basic correction for autocorrelation in a t-test, although it may be hard to wedge it into the regression t-test. For the 1-sample t-test of the mean, the correction is to multiply the t-statistic by $\sqrt{\frac{1 - \rho}{1 + \rho}}$, where $\rho$ is the 1-period autocorrelation (or estimate thereof).&lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2011-06-15T04:41:18.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1304" PostTypeId="2" ParentId="959" CreationDate="2011-06-15T06:40:48.363" Score="9" Body="&lt;p&gt;I have these posts favorited from stackoverflow. They might help you. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/1176986/high-frequency-trading&quot; title=&quot;High Frequency Trading&quot;&gt;High Frequency Trading&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/1996432/what-programming-languages-is-algorithmic-trading-software-written-in&quot;&gt;What programming language(s) is algorithmic trading software written in?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/1641533/why-does-a-derivative-trading-position-always-require-c-knowledge&quot;&gt;Why does a derivative trading position always require C++ knowledge?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Jane Street Capital, a high-frequency market making firm, uses OCaml. &lt;a href=&quot;http://ocaml.janestreet.com/?q=node/82&quot; rel=&quot;nofollow noreferrer&quot;&gt;Here are videos from the head programmer where he explains why.&lt;/a&gt; I thought it was quite interesting.&lt;/p&gt;&#xA;" OwnerUserId="796" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2011-06-15T06:40:48.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1305" PostTypeId="2" ParentId="1129" CreationDate="2011-06-15T08:36:01.277" Score="3" Body="&lt;p&gt;Well vix is a measure of volatitity which would make it an estimate of a second moment for S&amp;amp;P 500 so you might try an arch/garch in the mean type model on S&amp;amp;P.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A good starting place for a project like this is to just do Vector Autoregressions on industry groups that you think might be related and see what comes up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;N+30 is a long way in the future, especially to estimate a return. I would use weekly data and try and estimate a mean.&lt;/p&gt;&#xA;" OwnerUserId="986" LastActivityDate="2011-06-15T08:36:01.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1306" PostTypeId="1" CreationDate="2011-06-16T08:06:55.580" Score="12" ViewCount="505" Body="&lt;p&gt;I am currently working on my research paper and trying to explain a two-dimensional variable: volume and instrument of corporate debt financing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Independent variables that I believe must be included in the model are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;specific characteristics (capitalization of the company, debt to equity ratio, maybe rating)&lt;/li&gt;&#xA;&lt;li&gt;market conditions (corporate spread over t-bonds of bill, may be amount of corporate debt financing)&lt;/li&gt;&#xA;&lt;li&gt;specific characteristics of the instrument maturity and covenants&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The questions are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Which proper model can be used? Maybe probability models (besides multinomial probit and logit).&lt;/li&gt;&#xA;&lt;li&gt;How can I include covenants in the quantitative model? &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="988" LastEditorUserId="35" LastEditDate="2011-06-16T14:20:30.933" LastActivityDate="2011-10-26T14:17:15.603" Title="Fixed income modeling" Tags="&lt;analysis&gt;&lt;probability&gt;&lt;binomial-tree&gt;&lt;financial-engineering&gt;&lt;modeling&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1307" PostTypeId="1" AcceptedAnswerId="1308" CreationDate="2011-06-16T13:54:58.327" Score="14" ViewCount="1684" Body="&lt;p&gt;I understand that by applying Ito's lemma to the following SDE&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dX=\mu\,X\,dt+\sigma\,X\,dW$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;one obtains a solution to the above SDE which is as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$${X}\left( t\right) =\mathrm{X}\left( 0\right) \,{e}^{\sigma\,\mathrm{W}\left( t\right) +\left( \mu-\frac{{\sigma}^{2}}{2}\right) \,t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been told that I can use either of these equations (SDE or its solution) for applying monte carlo simulations to vanilla European options although the second one converges faster that the first one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone confirm this statement?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, one point remains unclear to me: &lt;strong&gt;What is Ito's lemma used for in quantitative finance?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="943" LastEditorUserId="943" LastEditDate="2011-06-18T08:44:18.657" LastActivityDate="2012-11-27T14:52:37.563" Title="Monte carlo methods for vanilla european options and Ito's lemma." Tags="&lt;monte-carlo&gt;&lt;itos-lemma&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1308" PostTypeId="2" ParentId="1307" CreationDate="2011-06-16T19:09:18.827" Score="11" Body="&lt;p&gt;The difference between the two is that the first will lead you to a discretization scheme of the process. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you will have to simulate a whole (approximate) trajectory of (meaning by that $X'_{t_0},...,X'_{t_n}$) up to time $T$ (the expiry of your vanilla option) to get to $X'_T$ which is then only an approximation of $X_T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second method is exact and gives you the law of $X_T$ in one step only.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I simply don't get your second question.&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="467" LastEditDate="2012-11-26T19:01:17.390" LastActivityDate="2012-11-26T19:01:17.390" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1309" PostTypeId="2" ParentId="1284" CreationDate="2011-06-16T19:56:23.190" Score="11" Body="&lt;p&gt;Implied volatility is the volatility implied by some model. You will have a skew if your model is implying different volatilities for different strikes.  However, the realized volatility of the underlying will be the same for all strikes. So, when you are dealing with realized vol, you can drop the &quot;moneyness&quot; axis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Volatility cones can help you compare implied vol to historic vol.  Volatility cones are constructed using any historic volatility estimator to calculate n-day vols for several n's using a rolling window.  Multiply by an adjustment factor to take out the bias introduced by using overlapping data. Then you can plot confidence intervals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See Euan Sinclair's book, Volatility Trading, or the 1990 paper by Burghart and Lane, &quot;How to Tell if Options are Cheap&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: See &lt;a href=&quot;http://www.m-x.ca/f_publications_en/cone_vol_en.pdf&quot;&gt;an application of the Burghart, Lane paper&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="508" LastEditorUserId="508" LastEditDate="2011-06-16T20:30:31.177" LastActivityDate="2011-06-16T20:30:31.177" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1310" PostTypeId="2" ParentId="1307" CreationDate="2011-06-17T07:00:35.617" Score="4" Body="&lt;p&gt;To add to the answer of TheBridge:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand your second question in the sense if you could use Ito's lemma for all stochastic processes. This is definitely not the case: It can also be used for processes with &lt;em&gt;bounded quadratic variation&lt;/em&gt; (e.g. Wiener process) - you should google this term or look it up in wikipedia: &lt;a href=&quot;http://en.wikipedia.org/wiki/Quadratic_variation&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Quadratic_variation&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-06-17T07:00:35.617" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1311" PostTypeId="1" AcceptedAnswerId="1313" CreationDate="2011-06-17T15:10:46.677" Score="8" ViewCount="7777" Body="&lt;p&gt;There is much in the literature about time-series and the problem of auto-correlation. Unfortunately the issue of why auto-correlation is actually troublesome is glossed over, and methods for testing a time-series for auto-correlation are presented. Basically, it is assumed that auto-correlation is bad for purposes of analysis. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What assumptions does the presence of auto-correlation violate for downstream analysis (eg, i.i.d) and what are some practices for dealing with the issue?&lt;/p&gt;&#xA;" OwnerUserId="291" LastActivityDate="2011-06-17T16:12:05.533" Title="Who cares about autocorrelation?" Tags="&lt;auto-correlation&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1312" PostTypeId="2" ParentId="1311" CreationDate="2011-06-17T15:18:39.400" Score="3" Body="&lt;p&gt;Autocorrelation is usually a problem when you are doing the analysis of your error terms.&#xA;When you build a model, you expect that the error term will have non significant autocorrelation. It is simple to understand: If your error term still have autocorrelations it certainly means that you are missing some information that could be introduced in your model. A standard approach to get rid of it is to incoporate autoregressive factors that could explain the autocorrelations in the errors terms.&lt;/p&gt;&#xA;" OwnerUserId="155" LastActivityDate="2011-06-17T15:18:39.400" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1313" PostTypeId="2" ParentId="1311" CreationDate="2011-06-17T16:12:05.533" Score="10" Body="&lt;p&gt;Just about every introductory Econometrics class teaches that the violations of &lt;a href=&quot;http://en.wikipedia.org/wiki/Best_linear_unbiased_prediction&quot;&gt;BLUE (&quot;Best Linear Unbiased Estimator&quot; -- the properties of linear least squares)&lt;/a&gt; are&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;invalid standard errors in the case in the heteroscedasticity, so while your parameter estimates are still valid (&quot;unbiased&quot;) your inference may be off&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;invalid estimates (!!) in the presence of autocorrolated errors, so your actual parameter estimates may be off, and that can be a big deal.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Libraries have been filled with this material so I won't start rehashing it. A real nice discussion of how to account for AR(1) and AR(2) errors when estimating a linear trend was recently provided &lt;a href=&quot;http://www.r-bloggers.com/additive-modelling-and-the-hadcrut3v-global-mean-temperature-series/&quot;&gt;here&lt;/a&gt; (via R Bloggers).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the most basic fixes in Finance is to work on returns rather prices, but you still want to check.&lt;/p&gt;&#xA;" OwnerUserId="69" LastActivityDate="2011-06-17T16:12:05.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1314" PostTypeId="2" ParentId="1277" CreationDate="2011-06-17T23:06:25.240" Score="1" Body="&lt;p&gt;The Zacks API should have this data, see &lt;a href=&quot;http://www.zacksdata.com/zacks-data-api&quot; rel=&quot;nofollow&quot;&gt;http://www.zacksdata.com/zacks-data-api&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;(Disclosure: The API is managed by my company)&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="63" LastActivityDate="2011-06-17T23:06:25.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1315" PostTypeId="2" ParentId="1207" CreationDate="2011-06-17T23:08:57.530" Score="0" Body="&lt;p&gt;Take a look at &lt;a href=&quot;http://www.mergent.com/servius&quot; rel=&quot;nofollow&quot;&gt;http://www.mergent.com/servius&lt;/a&gt; - it should have many years of historical earnings data&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;(Disclosure: The API is managed by my company)&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="63" LastActivityDate="2011-06-17T23:08:57.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1316" PostTypeId="2" ParentId="916" CreationDate="2011-06-17T23:11:48.060" Score="2" Body="&lt;p&gt;Take a look at &lt;a href=&quot;http://www.mergent.com/servius&quot; rel=&quot;nofollow&quot;&gt;http://www.mergent.com/servius&lt;/a&gt; - I believe they have historical data for all companies, whether they're currently being traded or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;(Disclosure: The API is managed by my company)&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="63" LastActivityDate="2011-06-17T23:11:48.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1317" PostTypeId="2" ParentId="567" CreationDate="2011-06-17T23:13:54.767" Score="0" Body="&lt;p&gt;Take a look at &lt;a href=&quot;http://www.mergent.com/servius&quot; rel=&quot;nofollow&quot;&gt;http://www.mergent.com/servius&lt;/a&gt; - specifically the Company Fundamentals API - this has historical quarterly financial statements, both in an as-reported and standardized form.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;(Disclosure: The API is managed by my company)&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="63" LastActivityDate="2011-06-17T23:13:54.767" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1318" PostTypeId="1" AcceptedAnswerId="1321" CreationDate="2011-06-18T01:37:16.847" Score="12" ViewCount="1148" Body="&lt;p&gt;Other than Kelly (or fractional derivatives), are there other money management strategies in wide use among quant funds? Certainly Kelly is mathematically optimal, but perhaps there are other approaches that take into account factors beyond optimized return (lower risk, less exposure to X, etc.)? &lt;/p&gt;&#xA;" OwnerUserId="80" LastActivityDate="2011-07-02T09:28:40.603" Title="Alternate money management strategies to Kelly?" Tags="&lt;portfolio-management&gt;&lt;money-management&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="1319" PostTypeId="1" CreationDate="2011-06-18T11:52:01.417" Score="0" ViewCount="244" Body="&lt;p&gt;I have implemented a monte carlo pricer for an option. I simply don't know &lt;strong&gt;how many decimals&lt;/strong&gt; I need to include in the quoted price. Can anyone please provide guidelines?&lt;/p&gt;&#xA;" OwnerUserId="943" LastActivityDate="2011-07-18T21:22:07.023" Title="What are the rules for quoting option prices on the market?" Tags="&lt;option-pricing&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1320" PostTypeId="1" AcceptedAnswerId="1325" CreationDate="2011-06-18T11:58:54.223" Score="7" ViewCount="934" Body="&lt;p&gt;I have implemented a monte carlo simulation for a &lt;strong&gt;plain vanilla&lt;/strong&gt; European Option and I am trying to compare it to the analytical result obtained from the BS formula.&#xA;Assuming my monte carlo pricer is correctly implemented, am I supposed to get the very same result with both methods (Monte Carlo and BS analytical formula)?&lt;/p&gt;&#xA;" OwnerUserId="943" LastActivityDate="2011-06-19T00:43:00.650" Title="Vanilla European options: Monte carlo vs BS formula" Tags="&lt;monte-carlo&gt;&lt;black-scholes&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1321" PostTypeId="2" ParentId="1318" CreationDate="2011-06-18T14:08:05.067" Score="7" Body="&lt;p&gt;In statistical arbitrage, quant traders attempt to build a &lt;em&gt;neutral&lt;/em&gt; portfolio by balancing various assets against each other. Each asset's size within the portfolio isn't determine necessarily by how much money it's expected to generate, but by how correlated it is against other assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A simple approach is &lt;em&gt;sector neutrality&lt;/em&gt;, in which sector/industry affiliation is the sole criteria for &quot;correlation&quot;. A better approach is &lt;em&gt;risk neutrality&lt;/em&gt;, in which a risk model that describes each asset's exposure to common factors is fed into a portfolio optimizer. In either case, the goal is to build a portfolio where the assets balance each other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Neutrality is just a goal, though. There are other issues that may prevent a trader from obtaining the ideal positions, such as position limits, volume limits, inability to get the locates on a short sell, transaction costs, etc. The trading engine must consider these issues as well.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-06-18T14:08:05.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1322" PostTypeId="2" ParentId="1318" CreationDate="2011-06-18T17:03:34.587" Score="11" Body="&lt;p&gt;Van Tharp, in his book &lt;em&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0935219099&quot;&gt;Definitive Guide to Position Sizing&lt;/a&gt;&lt;/em&gt;, identifies 31 separate models for money management. In said book he specifically warns against using both the Kelly Criterion and Optimal f.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition to the models identified by Van Tharp there is Ralph Vince's Leverage Space Portfolio Model.&lt;/p&gt;&#xA;" OwnerUserId="252" LastEditorUserId="35" LastEditDate="2011-06-19T01:26:59.647" LastActivityDate="2011-06-19T01:26:59.647" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1323" PostTypeId="2" ParentId="1319" CreationDate="2011-06-18T21:11:41.743" Score="3" Body="&lt;p&gt;Go to the website of the exchange that lists the option you care about and look at the contract specifications for that option.&lt;/p&gt;&#xA;" OwnerUserId="508" LastActivityDate="2011-06-18T21:11:41.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1324" PostTypeId="2" ParentId="1320" CreationDate="2011-06-19T00:03:07.110" Score="2" Body="&lt;p&gt;As long as your simulations are independents, you can calculate some confidence interval thank's to the Central Limit Theorem and see if this interval is encompassing the true BS price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards&lt;/p&gt;&#xA;" OwnerUserId="92" LastActivityDate="2011-06-19T00:03:07.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1325" PostTypeId="2" ParentId="1320" CreationDate="2011-06-19T00:43:00.650" Score="7" Body="&lt;p&gt;Fundamentally this is no different from other simulation-based estimation---see this little experiment in R:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;R&amp;gt; set.seed(42)&#xA;R&amp;gt; rowMeans(replicate(200,sapply(1:6, &#xA;+&amp;gt;          FUN=function(x) mean(rnorm(10^x)), simplify=TRUE)))&#xA;[1] -2.47827e-02 -9.46800e-03  2.38226e-03 -1.08650e-03  9.41395e-05  1.06759e-05&#xA;R&amp;gt; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We are calculating the mean of a $N(0,1)$ vector for sample sizes from $10^1$ to $10^6$. That is then repeated 200 times, and we are calculating the mean of the 200 draws at the different sample sizes.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We find that by and large, the mean gets closer to zero. But even at $10^6$, repeated 200 times, we are still pretty far from 'zero'.  That is the way it goes with simulation, and it pays to get a feel for this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So while you have perfect benchmark with your analytical Black-Scholes result, you will be hard-pressed to get the difference to vanish  &lt;em&gt;completely&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="69" LastActivityDate="2011-06-19T00:43:00.650" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1326" PostTypeId="1" AcceptedAnswerId="1328" CreationDate="2011-06-20T08:48:37.157" Score="4" ViewCount="495" Body="&lt;p&gt;I am trying to implement a vanilla European option pricer with Monte Carlo and compare its result to the BS analytical formula's result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I noticed that as I increase (from 1 million to 10 millions) the number of simulations, the &lt;strong&gt;MC result starts to diverge&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that I deliberately only use only one variance reduction technique: antithetic variables. I was hoping that by merely increasing the number of simulations, I would manage to increase the precision.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone please give me clues or pointers as to why my result diverges?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Included below is the C# code for the pricer:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;using System;&#xA;using System.Threading.Tasks;&#xA;using MathNet.Numerics.Distributions;&#xA;using MathNet.Numerics.Random;&#xA;&#xA;namespace MonteCarlo&#xA;{&#xA;    class VanillaEuropeanCallMonteCarlo&#xA;    {&#xA;        static void Main(string[] args)&#xA;        {&#xA;            const int NUM_SIMULATIONS = 10000000;&#xA;            const decimal strike = 50m;&#xA;            const decimal initialStockPrice = 52m;&#xA;            const decimal volatility = 0.2m;&#xA;            const decimal riskFreeRate = 0.05m;&#xA;            const decimal maturity = 0.5m;&#xA;            Normal n = new Normal();&#xA;            n.RandomSource = new MersenneTwister();&#xA;&#xA;&#xA;            VanillaEuropeanCallMonteCarlo vanillaCallMonteCarlo = new VanillaEuropeanCallMonteCarlo();&#xA;&#xA;            Task&amp;lt;decimal&amp;gt;[] simulations = new Task&amp;lt;decimal&amp;gt;[NUM_SIMULATIONS];&#xA;&#xA;            for (int i = 0; i &amp;lt; simulations.Length; i++)&#xA;            {&#xA;                simulations[i] = new Task&amp;lt;decimal&amp;gt;(() =&amp;gt; vanillaCallMonteCarlo.RunMonteCarloSimulation(strike, initialStockPrice, volatility, riskFreeRate, maturity, n));&#xA;                simulations[i].Start();&#xA;            }&#xA;&#xA;            Task.WaitAll(simulations);&#xA;&#xA;            decimal total = 0m;&#xA;&#xA;            for (int i = 0; i &amp;lt; simulations.Length; i++)&#xA;            {&#xA;                total += simulations[i].Result;&#xA;            }&#xA;&#xA;            decimal callPrice = (decimal)(Math.Exp((double)(-riskFreeRate * maturity)) * (double)total / (NUM_SIMULATIONS * 2));&#xA;&#xA;            Console.WriteLine(&quot;Call Price: &quot; + callPrice);&#xA;            Console.WriteLine(&quot;Difference: &quot; + Math.Abs(callPrice - 4.744741008m));&#xA;        }&#xA;&#xA;&#xA;        decimal RunMonteCarloSimulation(decimal strike, decimal initialStockPrice, decimal volatility, decimal riskFreeRate, decimal maturity, Normal n)&#xA;        {&#xA;            decimal randGaussian = (decimal)n.Sample();&#xA;            decimal endStockPriceA = initialStockPrice * (decimal)Math.Exp((double)((riskFreeRate - (decimal)(0.5 * Math.Pow((double)volatility, 2))) * maturity + volatility * (decimal)Math.Sqrt((double)maturity) * randGaussian));&#xA;            decimal endStockPriceB = initialStockPrice * (decimal)Math.Exp((double)((riskFreeRate - (decimal)(0.5 * Math.Pow((double)volatility, 2))) * maturity + volatility * (decimal)Math.Sqrt((double)maturity) * (-randGaussian)));&#xA;            decimal sumPayoffs = (decimal)(Math.Max(0, endStockPriceA - strike) + Math.Max(0, endStockPriceB - strike));&#xA;            return sumPayoffs;&#xA;        }&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="943" LastEditorUserId="35" LastEditDate="2011-06-20T10:10:26.230" LastActivityDate="2011-06-20T11:39:52.250" Title="Divergence issue with my monte carlo pricer..." Tags="&lt;monte-carlo&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1327" PostTypeId="1" AcceptedAnswerId="1331" CreationDate="2011-06-20T10:50:09.093" Score="0" ViewCount="1171" Body="&lt;p&gt;I would like to know how stressful this work can be and where the stress could come from. How to avoid it? Does it really depend on the company you are working? Is there a way to know in advance if work in a particular company is stressful or not?&lt;/p&gt;&#xA;" OwnerUserId="981" LastActivityDate="2011-06-20T16:55:53.193" Title="How stressful is work of quants?" Tags="&lt;stress&gt;&lt;general&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ClosedDate="2011-06-20T21:25:19.070" ContentLicense="CC BY-SA 3.0" />
  <row Id="1328" PostTypeId="2" ParentId="1326" CreationDate="2011-06-20T11:39:52.250" Score="4" Body="&lt;p&gt;This is essentially the same question as &lt;a href=&quot;https://quant.stackexchange.com/questions/1320/vanilla-european-options-monte-carlo-vs-bs-formula&quot;&gt;your previous question&lt;/a&gt; and the issue is still the same: variability just does not go away just because you use 100 million draws &lt;em&gt;once&lt;/em&gt;.  Compare the distribution of results of $N$ Monte Carlo simulations at $n_1 = 1,000,000$ with those for $n_2 = 10,000,000$.  You will see a reduction but that does not imply that every single run get a tighter answer.&lt;/p&gt;&#xA;" OwnerUserId="69" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2011-06-20T11:39:52.250" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1329" PostTypeId="1" AcceptedAnswerId="1952" CreationDate="2011-06-20T12:22:22.133" Score="12" ViewCount="513" Body="&lt;p&gt;A simple interest rate model in discrete time is the autoregressive model,&#xA;$$&#xD;&#xA;I_{n+1} = \alpha I_n+w_n&#xD;&#xA;$$&#xA;where $\alpha\in [0,1)$ and $w_n\geq 0$ are i.i.d. random variables. When working with ruin probabilities in a model which incorporates this interest rate model, I've faced that $I$ can reach any positive value with a positive probability. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence I'd like to know:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Are there any interest rate models in discrete time which assume bounded interest?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Why do people use models with unbounded interest (which is unrealistic) at all?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="464" LastEditorUserId="1106" LastEditDate="2011-09-15T20:37:17.210" LastActivityDate="2012-08-27T18:30:13.060" Title="Do people use unbounded interest rate models, and what alternatives exist?" Tags="&lt;probability&gt;&lt;interest-rates&gt;&lt;modeling&gt;&lt;fixed-income&gt;&lt;random-variables&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1330" PostTypeId="1" AcceptedAnswerId="1337" CreationDate="2011-06-20T14:14:21.440" Score="15" ViewCount="11129" Body="&lt;p&gt;Further to my question asked here: &lt;a href=&quot;https://quant.stackexchange.com/questions/1307/monte-carlo-methods-for-vanilla-european-options-and-itos-lemma&quot;&gt;prior post&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and which left some points unanswered, I have reformulated the question as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What is Ito's lemma used for in quantitative finance?&lt;/strong&gt; and when is it applicable?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't understand for instance if Ito's lemma is used for obtaining a SDE from a stochastic process or the converse: obtain a stochastic process from an SDE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore vonjd's reply is a bit confuse to me: does he mean &quot;Ito's lemma can &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;only&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;or &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;also&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;be used for processes with bounded quadratic variation?&lt;/p&gt;&#xA;" OwnerUserId="943" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2011-07-15T06:46:49.453" Title="What is Ito's lemma used for in quantitative finance?" Tags="&lt;itos-lemma&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="1331" PostTypeId="2" ParentId="1327" CreationDate="2011-06-20T16:55:53.193" Score="3" Body="&lt;p&gt;It's more stressful than the work of a tenured professor but less stressful than the work of a postdoc.&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2011-06-20T16:55:53.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1332" PostTypeId="1" AcceptedAnswerId="1333" CreationDate="2011-06-20T16:59:00.167" Score="16" ViewCount="5453" Body="&lt;p&gt;I am learning about quantitative finance, and I am struck by how different it is from the techniques that make it into magazines and TV, particularly technical analysis.  Specifically, if they say an indicator (RSI, TRIX, etc.) can predict even short term future prices, then you should be able to run some analysis to see if this was at least true in the past.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my questions are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I wanted to learn the statistics used to calculate if there is any correlation between an indicator and any future price tendencies, what methods do I use?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are any of these indicators known to have been verified quantitatively?&lt;/p&gt;&#xA;" OwnerUserId="1001" LastEditorUserId="1106" LastEditDate="2011-09-09T15:31:31.507" LastActivityDate="2013-01-23T11:47:38.057" Title="How can I quantitatively test the validity of momentum indicators?" Tags="&lt;statistics&gt;&lt;research&gt;&lt;indicator&gt;&lt;technicals&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="18" ContentLicense="CC BY-SA 3.0" />
  <row Id="1333" PostTypeId="2" ParentId="1332" CreationDate="2011-06-20T17:18:21.003" Score="7" Body="&lt;p&gt;Remember that there is almost no point in predicting market movements if you cannot use it to trade and generate P&amp;amp;L. Thus, backtesting a stat arb strategy based on the indicator is best option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't let yourself fooled by correlation or even directional forecast percentage accuracy as a few wrong predictions can blow your capital. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;You will need a set of entry and exit rules in addition to your indicator. (enter when indicator 1 is crosses 0.5 from below etc)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Don't forget to account for all types of transaction fees you will have to pay.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If it's purely academic research you are doing then what I just said is of course not true.     &lt;/p&gt;&#xA;" OwnerUserId="155" LastEditorUserId="1355" LastEditDate="2011-09-09T14:06:49.133" LastActivityDate="2011-09-09T14:06:49.133" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1334" PostTypeId="1" AcceptedAnswerId="1335" CreationDate="2011-06-20T17:38:42.490" Score="6" ViewCount="386" Body="&lt;p&gt;If a large sell order hits many bids from the book, is the order filled at once? Or is it filled one bid at a time with a chance for any new orders to come in between each trade?&lt;/p&gt;&#xA;" OwnerUserId="1002" LastEditorUserId="35" LastEditDate="2011-06-20T21:34:07.613" LastActivityDate="2011-06-21T20:52:28.087" Title="How does order fulfillment proceed with larger orders?" Tags="&lt;order-execution&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1335" PostTypeId="2" ParentId="1334" CreationDate="2011-06-20T17:55:34.417" Score="5" Body="&lt;p&gt;Most exchanges will cross a large order with numerous smaller orders so long as the large order sufficiently crosses the book to cause a fill. This is obviously dependent on specific instructions on the large order causing the cross as well as the orders on the other side of the book. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the second part a new order coming in should only cross with the large order if it offers price improvement over other orders in the book as they will have time priority. A single large order will sweep the other side of the book to fill and this typically happens in a single atomic step although I don't believe that there is any requirement to do so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is all exchange dependent. Check out &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0195144708&quot; rel=&quot;nofollow&quot;&gt;Trading and Exchanges&lt;/a&gt; or &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0956399207&quot; rel=&quot;nofollow&quot;&gt;Algorithmic Trading and DMA&lt;/a&gt; as both these books cover crossing mechanics in considerable detail.&lt;/p&gt;&#xA;" OwnerUserId="373" LastEditorUserId="373" LastEditDate="2011-06-21T20:52:28.087" LastActivityDate="2011-06-21T20:52:28.087" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1336" PostTypeId="2" ParentId="1334" CreationDate="2011-06-20T20:57:59.097" Score="5" Body="&lt;p&gt;It depends if the large incoming sell order is a market order or a limit order.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it is a market order, it will immediately &quot;sweep&quot; through as many levels of the bid book as neccessary to get the required volume.  There is no chance for someone to add more bids to execute against the market order.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A limit order will execute against all the bid volume that it can without selling below the limit price.  Then the remaining volume will go resting in the book, at which point there is a chance for new buyers to come in and execute against it.  &lt;/p&gt;&#xA;" OwnerUserId="77" LastActivityDate="2011-06-20T20:57:59.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1337" PostTypeId="2" ParentId="1330" CreationDate="2011-06-20T22:13:16.190" Score="15" Body="&lt;p&gt;If you are given a diffusion process $X_t$, and a $C^{1,2}$ transformation $Y_t=f(t,X_t)$ of the process $X_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then Itô's lemma gives you the SDE followed by the process $Y_t$ in terms of $dX_t$, and $dt$ and partial derivatives of $f$ up to order 1 in time and 2 in $x$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are given the SDE followed by $X_t$ in terms of Brownian motion, drift, and diffusion term then you can write down the SDE of $Y_t$ in terms of Brownian motion, drift, and diffusion term. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This shows in particular that diffusions are stable by those type of transformations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is nothing more and nothing less in it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course you can extend this lemma in various fancy and sophisticated ways.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards&lt;/p&gt;&#xA;" OwnerUserId="92" LastActivityDate="2011-06-20T22:13:16.190" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1338" PostTypeId="2" ParentId="1334" CreationDate="2011-06-21T08:26:20.223" Score="2" Body="&lt;p&gt;Here is a good mental model. The exchange's matching engine processes incoming orders &lt;em&gt;one at a time&lt;/em&gt;: all effects of an order on the book are settled before any further incoming orders for the same instrument are looked at.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, when a marketable order comes in, it is matched against resting orders &quot;atomically&quot;, producing one or more fills. If this completely fills the incoming order, that's it. If some part of the order could not be matched, the remainder is either placed on the book or cancelled (or in some cases routed to a different exchange). Any subsequent incoming orders wait their turn until all of this is done.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With many modern matching engines all of this happens very quickly: for example, &lt;a href=&quot;http://www.batstrading.com/&quot; rel=&quot;nofollow&quot;&gt;BATS&lt;/a&gt; claim an average order matching latency of 200 microseconds. I understand this even includes a network roundtrip.&lt;/p&gt;&#xA;" OwnerUserId="90" LastEditorUserId="90" LastEditDate="2011-06-21T17:53:13.547" LastActivityDate="2011-06-21T17:53:13.547" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1339" PostTypeId="1" CreationDate="2011-06-21T15:13:28.543" Score="20" ViewCount="3189" Body="&lt;p&gt;Pseudorandom number generators are often tested using e.g. a test suite like &lt;a href=&quot;http://en.wikipedia.org/wiki/Diehard_tests&quot;&gt;Diehard tests&lt;/a&gt; or &lt;a href=&quot;http://cran.r-project.org/web/packages/RDieHarder/&quot;&gt;Dieharder&lt;/a&gt;. If one would run these tests e.g. on stock market time series or other financial data, would you expect your financial data to qualify as being a good random number generator or would it fail in many of these tests?&lt;/p&gt;&#xA;" OwnerUserId="1003" LastEditorUserId="1106" LastEditDate="2011-12-16T10:00:53.353" LastActivityDate="2011-12-18T08:10:06.490" Title="How random are financial data series?" Tags="&lt;time-series&gt;&lt;statistics&gt;&lt;mathematics&gt;&lt;random-walk&gt;" AnswerCount="6" CommentCount="1" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="1340" PostTypeId="2" ParentId="1339" CreationDate="2011-06-21T15:55:32.647" Score="9" Body="&lt;p&gt;Why don't you try it and report back?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recall, though, that while a &lt;em&gt;random walk&lt;/em&gt; is often a rather competitive forecast, realized data is understood to have weak dependence especially in higher moments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having worked a bit with DieHarder, I'd suspect it to reject a number of series.  But the proof is in the pudding...&lt;/p&gt;&#xA;" OwnerUserId="69" LastActivityDate="2011-06-21T15:55:32.647" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1341" PostTypeId="2" ParentId="1339" CreationDate="2011-06-21T17:13:31.403" Score="19" Body="&lt;p&gt;Variance ratio tests have been used numerous times to show that financial asset prices do not follow a random walk. You can for example look at &lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Lo and MacKinlay : Stock market prices do not follow a random walk :         &lt;a href=&quot;http://press.princeton.edu/books/lo/chapt2.pdf&quot;&gt;http://press.princeton.edu/books/lo/chapt2.pdf&lt;/a&gt; (US Stocks)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Hoque, Kim, Pyun: A comparison of variance ratio tests of random walk: A case of Asian emerging stock markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a quick search, I haven't found any article using the kind of test you talk about. It seems like a new interesting approach so I completly agree with Dirk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, it would be interesting to change the time frame as asset can behave quite differently on different time frames. Liquidity should also be a factor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please keep us posted.&lt;/p&gt;&#xA;" OwnerUserId="155" LastActivityDate="2011-06-21T17:13:31.403" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1343" PostTypeId="1" AcceptedAnswerId="1346" CreationDate="2011-06-22T08:08:50.597" Score="18" ViewCount="1861" Body="&lt;p&gt;While liquidity is one of the key figure of financial markets, It seems to be very difficult to measure. Volume is sometime used as a proxy but can sometimes be completly irrelevant. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you point to relevant research on what data to use and how to compute the measure?&lt;/p&gt;&#xA;" OwnerUserId="155" LastActivityDate="2014-03-05T11:06:38.590" Title="Measuring liquidity" Tags="&lt;liquidity&gt;" AnswerCount="8" CommentCount="0" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="1344" PostTypeId="2" ParentId="1343" CreationDate="2011-06-22T09:40:40.007" Score="6" Body="&lt;p&gt;For my master thesis, I used the bid-ask spread as a liquidity measure. Intuitively, it is the price to the have the liquidity (or even the price of liquidity); the bigger the bid-ask spread, the lower the liquidity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that Carlo Acerbi of MSCI is also looking into liquidity risk management and has a very interesting model for liquidity which is explained in &lt;a href=&quot;http://www.prmia.org/Chapter_Pages/Geneva/talks/20101201GenevaPRMIA.pdf&quot;&gt;this presentation&lt;/a&gt;. Maybe it can give you some ideas.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2011-06-22T09:40:40.007" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1345" PostTypeId="2" ParentId="1330" CreationDate="2011-06-22T09:55:47.083" Score="20" Body="&lt;p&gt;A common way to use Ito's lemma is also to solve the SDEs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most classic example (I guess) is the geometric Brownian motion:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dX_t = \mu X_t dt + \sigma X_t dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and this can be solved easily by applying Itô's lemma with&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f(x)=\ln(x)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's the BnB example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f&amp;#39;(x)=\frac{1}{x}$$&#xA;$$f&amp;#39;&amp;#39;(x)=-\frac{1}{x^2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and by Itô:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d(ln(X_t))=\frac{1}{X_t} dX_t -\frac{1}{2X_t^2} d&amp;lt;X_t&amp;gt;$$&#xA;$$d(ln(X_t))=\mu dt + \sigma dW_t - \frac{\sigma^2}{2} dt$$&#xA;$$d(ln(X_t))=\mu dt + \sigma dW_t - \frac{\sigma^2}{2} dt$$&#xA;$$d(ln(X_t))=(\mu - \frac{\sigma^2}{2}) dt + \sigma dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And then,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ln(X_t)-ln(X_0)=ln(\frac{X_t}{X_0})=(\mu - \frac{\sigma^2}{2})(t-0) + \sigma W_t$$&#xA;$$X_t=X_0 \exp^{(\mu - \frac{\sigma^2}{2})t + \sigma W_t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means that $X_t$ is log-normally distributed...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Such model is used in the most common (and hence trivial) derivative pricing framework such as the &lt;a href=&quot;http://en.wikipedia.org/wiki/Black%E2%80%93Scholes&quot;&gt;Black and Scholes Model&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another example is the Ornstein–Uhlenbeck process which can be solved using a different $f(x)$.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2011-07-15T06:46:49.453" LastActivityDate="2011-07-15T06:46:49.453" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1346" PostTypeId="2" ParentId="1343" CreationDate="2011-06-22T16:51:13.760" Score="8" Body="&lt;p&gt;Volume merely indicates how much buy-side interest exists in a stock. For liquidity, the sell-side interest is more relevant, which implies the quote characteristics (the limit-order book).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition to the bid-ask spread, I look at the top-of-book quote &lt;strong&gt;size&lt;/strong&gt;. Here's an example from &lt;a href=&quot;http://batstrading.com/&quot; rel=&quot;nofollow&quot;&gt;BATS&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sym | bid    ask    bidsize asksize&#xA;----| -----------------------------&#xA;AAPL| 325.12 325.21  100     100    &#xA;MSFT|  24.70  24.71 3900    5900   &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can only buy \$32,521 worth of Apple without impacting price, as opposed to \$145,789 of Microsoft. So the slippage is smaller.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are more sophisticated measurements for order book entries. I could look at the full book (&quot;level II data&quot;) to see the depth of the order chain. I could look across multiple exchanges, which is what a smart order router must do anyway. I could even look at related asset classes if the investor's goal is merely to gain exposure to general risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be really swanky, I could investigate dark pools, though that's harder since the quotes aren't displayed. For this, a quant would need historical data regarding how much has been executed in the past. That's one reason why the big banks have a competitive advantage in dark-pool aggregator algorithms: they have enough client flow to record execution patterns.&lt;/p&gt;&#xA;" OwnerUserId="35" LastEditorUserId="35" LastEditDate="2011-06-23T13:50:01.033" LastActivityDate="2011-06-23T13:50:01.033" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1347" PostTypeId="1" AcceptedAnswerId="1358" CreationDate="2011-06-22T22:40:15.610" Score="18" ViewCount="5004" Body="&lt;p&gt;When the risk is defined by a discrete random variable, is CVaR a coherent risk measure? I stick to the following definition of CVaR:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ CVaR_\alpha(R) = \min_v \quad \left\{ v + \frac{1}{1-\alpha} \mathbb{E}[R-v]^+ \right \}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $R$ is the DISCRETE random variable for the loss and $\alpha$ is the confidence level.&lt;/p&gt;&#xA;" OwnerUserId="494" LastActivityDate="2012-07-20T20:09:30.573" Title="Is Conditional Value-at-Risk (CVaR) coherent?" Tags="&lt;risk&gt;&lt;coherent-risk-measure&gt;&lt;risk-models&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1348" PostTypeId="1" AcceptedAnswerId="1887" CreationDate="2011-06-23T01:47:10.830" Score="20" ViewCount="9617" Body="&lt;p&gt;The bid-ask bounce is the bouncing of trade prices between the bid and ask sides of the market.  It introduces a systematic bias to the data which can cause serious problems in analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What methods can be used to control for the bid/ask bounce when using high-frequency data?  One approach is to use the bid/ask midpoint, but what about with trade data?  Even using n-minutely VWAP prices doesn't guarantee that you won't have spurious mean-reverting behavior.&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="1355" LastEditDate="2011-09-08T19:21:15.263" LastActivityDate="2019-09-19T19:34:23.610" Title="Control for bid/ask bounce in high-frequency trade data?" Tags="&lt;high-frequency&gt;&lt;limit-order-book&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="18" ContentLicense="CC BY-SA 3.0" />
  <row Id="1349" PostTypeId="2" ParentId="1348" CreationDate="2011-06-23T06:20:58.177" Score="8" Body="&lt;p&gt;You don't say what it is that you &lt;em&gt;do&lt;/em&gt; with trade data that is made difficult by the bid-ask bounce.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it's for the purpose of establishing the price at which &lt;em&gt;you&lt;/em&gt; can trade and it's at a frequency where the bid-ask bounce is a problem, then I think having realistic execution assumptions is the way to go. In particular this means that you should be mainly looking at quotes rather than trades in order to establish prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For most other applications that I can think of, either smoothing or reducing the frequency of the data seem the way to go.&lt;/p&gt;&#xA;" OwnerUserId="90" LastEditorUserId="90" LastEditDate="2011-06-23T10:18:18.903" LastActivityDate="2011-06-23T10:18:18.903" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1350" PostTypeId="1" CreationDate="2011-06-23T14:14:02.837" Score="9" ViewCount="765" Body="&lt;p&gt;Suppose I have a random walk $X_{n+1} = X_n+A_n$ where $A_n$ is an iid sequence, $\mathsf EA_n = A&amp;gt;0$. How to construct a martingale measure for this case?&lt;/p&gt;&#xA;" OwnerUserId="464" LastActivityDate="2014-02-25T16:36:44.377" Title="Change of measure discrete time" Tags="&lt;stochastic-calculus&gt;&lt;martingale&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1351" PostTypeId="2" ParentId="1348" CreationDate="2011-06-23T15:33:04.563" Score="14" Body="&lt;p&gt;IMO transaction data is a better approach, because you have both sides of the trade agreeing that the price is &quot;right.&quot; The literature tends to decompose the transaction price $P$ into a true/efficient price $P^e$ plus micro-structure noise, which I think originates from Hasbrouck '93 in the Review of Financial Studies. So you end up with something like $$P^e_t = P^e_{t-1} + \nu$$ and $$P_t = round(P^e_t + c_t Q_t, d)$$ where $\nu \sim N(0, \sigma^2_t)$, $c_t &amp;gt; 0$, $Q_t \in \left\{-1, 1 \right\}$, and $d$ is the tick size. Note that $c_t$ provides the spread and $Q_t$ tells you if the transaction is buyer or seller initiated (typically determined with the &quot;Lee-Ready algorithm&quot;). I found this particular presentation in a &lt;a href=&quot;https://www.ece.uic.edu/~cpress/ref/2004-robert.engle%20Analysis%20of%20High%20Frequency%20Financial%20Data.pdf&quot; rel=&quot;nofollow&quot;&gt;2002 working paper from Engle and Russell&lt;/a&gt; (edit: titled &lt;em&gt;Analysis of High Frequency Data&lt;/em&gt;); I think this is pretty standard and you can probably find a good deal of research that tries to provide $c_t = f(\cdot)$. It looks like a &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=847047&quot; rel=&quot;nofollow&quot;&gt;Andersen, Bollerslev, and Diebold have a 2007 NBER working paper&lt;/a&gt; (edit: titled &lt;em&gt;Roughing it Up: Including Jump Components in the Measurement, Modeling and Forecasting of Return Volatility&lt;/em&gt;) that provides a more thorough treatment of these ideas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you're dealing with (ultra) high-frequency data you also have the problem of &lt;em&gt;time&lt;/em&gt; to transaction. &lt;a href=&quot;http://www.jstor.org/stable/2999473&quot; rel=&quot;nofollow&quot;&gt;Engle has a 2000 Econometrica paper&lt;/a&gt; (edit: titled &lt;em&gt;The Econometrics of Ultra-High-Frequency Data&lt;/em&gt;) in which he describes how to account  for time to transaction, but he's using bid-ask midpoints, not transactions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't have any first-hand experience to know if using the midpoint is a bad assumption in practice, but the 2000 and 2007 papers should be a good start.&lt;/p&gt;&#xA;" OwnerUserId="106" LastEditorUserId="106" LastEditDate="2016-10-24T14:43:41.163" LastActivityDate="2016-10-24T14:43:41.163" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="1352" PostTypeId="2" ParentId="1350" CreationDate="2011-06-23T16:53:19.440" Score="1" Body="&lt;p&gt;Edit: Albeit of BFin or entry MFE type, sounds like homework.Answer:&#xA;In many ways, for example take the countable product of (.-E[A])*(lawofA).&#xA;More generally if g(x,y) is a function such that E[g(A,E[A])]=0 then g(.,E[A])*lawofA will do. Of course it doesn't have to be equivalent, like if A is deterministic.&lt;/p&gt;&#xA;" OwnerUserId="1014" LastEditorUserId="1014" LastEditDate="2011-06-23T21:33:21.167" LastActivityDate="2011-06-23T21:33:21.167" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1353" PostTypeId="2" ParentId="1347" CreationDate="2011-06-23T20:25:52.143" Score="7" Body="&lt;p&gt;Conditional VaR (CVaR), which is also called Expected Shortfall, is a coherent risk measure (although being derived from a non-coherent one, namely VaR).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See this paper:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Expected Shortfall: a natural coherent alternative to Value at Risk&lt;br&gt;&#xA;from Carlo Acerbi and Dirk Tasche&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.bis.org/bcbs/ca/acertasc.pdf&quot;&gt;http://www.bis.org/bcbs/ca/acertasc.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I just saw that you emphasized &lt;em&gt;discrete&lt;/em&gt; but that shouldn't change the general situation.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-06-23T20:25:52.143" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1354" PostTypeId="2" ParentId="1347" CreationDate="2011-06-24T14:41:26.683" Score="9" Body="&lt;p&gt;$VaR^\alpha$ is not a coherent risk measure because it fails sub-additivity (a &lt;a href=&quot;http://en.wikipedia.org/wiki/Coherent_risk_measure#Properties&quot;&gt;coherent risk measure&lt;/a&gt; is monotonic, sub-additive, positive homogenous, and translation invariant). The expectation operator $E[\cdot]$ is linear, so it meets sub-additivity, as well as the other three properties, so $CVaR$ is a coherent risk measure.&lt;/p&gt;&#xA;" OwnerUserId="106" LastEditorUserId="106" LastEditDate="2011-06-25T15:59:08.277" LastActivityDate="2011-06-25T15:59:08.277" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1355" PostTypeId="2" ParentId="549" CreationDate="2011-06-25T17:56:13.883" Score="6" Body="&lt;p&gt;There are many price driven financial data finsualization concepts are available such as candle stick stock charts. However, there is an advanced charting concept, Mano Stick which is supply &amp;amp; demand driven charting concept. Mano Stick is a multidimentional charting concept which is able to display price information along with volume information to show trend changes in early statge. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Visit &lt;a href=&quot;http://www.manostick.com/share-price-analysis.html&quot;&gt;http://www.manostick.com/share-price-analysis.html&lt;/a&gt;. And see mano Stick at &lt;a href=&quot;http://www.manostick.com/Images/MS-volume.png&quot;&gt;http://www.manostick.com/Images/MS-volume.png&lt;/a&gt; &quot;manostick&quot;&lt;/p&gt;&#xA;" OwnerUserId="1019" LastActivityDate="2011-06-25T17:56:13.883" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1356" PostTypeId="1" CreationDate="2011-06-25T21:02:34.330" Score="23" ViewCount="1371" Body="&lt;p&gt;I have found many financial authors making generalizations about the geometric mean (GM) and arithmetic mean (AM) but they are wrong in certain circumstances. Could someone explain their reasoning?&lt;/p&gt;&#xA;&lt;p&gt;My fact why they are wrong is based Jensen inequality:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$\sum^{n}_{i=1} p_{i} f(x_{i}) \geq f( \sum_{i=1}^{n} p_{i} x_{i})$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;for concave up functions, verified &lt;a href=&quot;http://mathworld.wolfram.com/JensensInequality.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;. Now the special case is:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$\sqrt[n]{x_{1}x_{2}...x_{n}} \leq \frac{x_{1}+x_{2}+...+x_{n}}{n}$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;For concave down functions, the corresponding result can be obtained by reversing the inequality, more &lt;a href=&quot;https://docs.google.com/viewer?a=v&amp;amp;q=cache:oVJhK17HdKAJ:www.hkame.org.hk/html/modules/tinyd2/content/Edumath/v5/v5_84o87.pdf%20concave%20%22geometric%20mean%22&amp;amp;hl=fi&amp;amp;pid=bl&amp;amp;srcid=ADGEEShicFNsnO5nEm9MBMf9hwo3Yqr4l9tf1l63aHAZQHE7r09MZIyR651iNhvjIfCYWJCtuSxg_M5TMZbttkm6P6cHRob-hg7BNmIoIbrZItIVWWS4ikvSrvS_ghg8dsjskmh6_0zu&amp;amp;sig=AHIEtbQ2qkxSuEsLk2H_hB94EkvQ8dEYfQ&amp;amp;pli=1&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Author 1&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Rebalancing and diversification go&#xA;hand in hand.  &lt;strong&gt;There is no&#xA;diversification benefit without&#xA;rebalancing – otherwise the total&#xA;return will simply be the  weighted&#xA;average of the long-term geometric&#xA;returns.&lt;/strong&gt;  If you don’t rebalance to&#xA;asset  types, you will get no&#xA;diversification benefit.  If you can’t&#xA;rebalance to an asset type, you&#xA;cannot get diversification benefits.&lt;br /&gt;&#xA;Rebalancing benefits increase as&#xA;volatility rises, and decreases in&#xA;less volatile times.  &lt;strong&gt;The  benefit of&#xA;rebalancing after a 10% movement is&#xA;more than 10 times the benefit after a&#xA;1%  movement, and the benefit from&#xA;rebalancing after a 50% move is more&#xA;than 5 times the  benefit after a 10%&#xA;move.&lt;/strong&gt;  The greatest benefit comes in&#xA;times, like 2008-2009, when  there are&#xA;wild movements in portfolios.&#xA;-- diversification does not assure profit or protect against loss in a declining that affects numerous asset types. &lt;a href=&quot;http://www.brandes.com/Institute/Documents/BI%20White%20Paper_Back%20to%20the%20Future_0510.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Source.&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Suppose we have a concave-down environment so&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$\sqrt[n]{x_{1}x_{2}...x_{n}} \geq \frac{x_{1}+x_{2}+...+x_{n}}{n}$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Now following the logic in the paragraph the total return is simply the weighted average of the long-term geometric returs. We know from the latter result that it is greater than or equal to the arithmetic mean. Is there a diversification benefit with rebalancing?&lt;/li&gt;&#xA;&lt;li&gt;Then the numbers thrown in the next bolded sentence are a bit odd. Why would there be such a benefit if we just noticed that it is not necessarily so if our environment is concave-down environment (valuations going down)?&lt;/li&gt;&#xA;&lt;li&gt;But the last sentence saves this writer! No error here.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&lt;strong&gt;Author 2.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;William Bernstein &lt;a href=&quot;http://www.lombardreport.it/uploads/dispense/rebal.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; goes one step further, ignoring the Jensen:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The effective (geometric mean) return of a periodically rebalanced&#xA;portfolio always exceeds the weighted sum of the component geometric means.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;The implicit premise behind such statements probably is that the market in the long-run is rising, very well right to some extent. But with that assumption, the problem of asset allocation simplifies to the Jensen -- an even with such premise, it should be noticed to the reader (or such sentences are wrong).&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Author 3.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Many works rely on the ambiguous assertions such as Ilmanen's Expected Return -book, page 485:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;the arithmetic mean of a series is always higher than the geometric mean (AM &amp;gt; GM) except when there is a zero volatility (AM = GM).&lt;/strong&gt; A simple Taylor series expansion show a good approximate is &lt;span class=&quot;math-container&quot;&gt;$GM \approx AM - \frac{Variance}{2}.$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;...but the bolded sentence is wrong. You can make a function with concave values and &lt;span class=&quot;math-container&quot;&gt;$AM &amp;lt; GM$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Questions&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What are the authors meaning here?&lt;/li&gt;&#xA;&lt;li&gt;Are they wrong or do they have some some hidden premises that I am missing?&lt;/li&gt;&#xA;&lt;li&gt;Why are they stating such issues about AM and GM as they cannot &lt;strong&gt;always&lt;/strong&gt; be true?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="956" OwnerDisplayName="hhh" LastEditorUserId="41390" LastEditDate="2020-11-18T23:06:52.577" LastActivityDate="2020-11-18T23:06:52.577" Title="Diversification, Rebalancing and Different Means" Tags="&lt;portfolio-management&gt;&lt;rebalancing&gt;&lt;mean&gt;" AnswerCount="2" CommentCount="10" FavoriteCount="11" ContentLicense="CC BY-SA 4.0" />
  <row Id="1357" PostTypeId="2" ParentId="1274" CreationDate="2011-06-27T15:23:49.943" Score="24" Body="&lt;p&gt;I'll take a stab at it, but this is a really broad question.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A direct answer: Bayesian models often use &quot;probability that the counter-party is informed.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indirect answers:&#xA;I think your assumption is that the algorithm operates on each stock individually, and has no knowledge of what it's doing in any other stock.  But, it is likely that the algorithm is doing some hedging that you don't see yet.  You should look at similar products (or build synthetic baskets) and see if your algorithm is changing it's quote sizes/prices when other products' quote sizes/prices change. (It is also possible that the algorithm is aware of all orders/positions it has in all stocks and it leaning more heavily on some bid/offers than others as it tries to flatten out delta (beta) of the entire portfolio.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're certain that the algorithm is working on an individual name with only that stock's orderbook as input, then I would study the active orders to see when and why it gets out.  (maybe the only active orders are at the end-of-day flattening, in which case, I would study the canceled orders.)  It's easy to make a little money working bids and offers &lt;em&gt;most&lt;/em&gt; of the time, but at some point you will get run-over unless you know when to get out of the way (and/or hedge).  I'd also look for times when the algo pauses.  Are there times when it doesn't have both a bid and an offer in the book?  If so, these are times that it is unsure, or it is at it's position limit (should be pretty easy to distinguish which is which).  It might be helpful to see what it going on when it is 'unsure' that wasn't going on when it was 'sure.'  This will help you eliminate possible parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long, long, ago, we used a micro-pricer to come up with an estimate of where the real price was using things like qty traded on the ask vs. qty traded on the bid, and sums of bid and ask sizes.  Initially, the micro-pricer worked as a stand-alone high-frequency liquidity-taker.  Then it became a piece in a market-making algo that was just a way to know when to cancel orders.&lt;/p&gt;&#xA;" OwnerUserId="508" LastActivityDate="2011-06-27T15:23:49.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1358" PostTypeId="2" ParentId="1347" CreationDate="2011-06-27T17:34:56.860" Score="12" Body="&lt;p&gt;I found this paper:&#xA;Conditional value-at-risk for general loss distributions by Rockafellar and Uraysev&#xA;&lt;a href=&quot;http://dx.doi.org/10.1016/S0378-4266(02)00271-6&quot; rel=&quot;noreferrer&quot;&gt;http://dx.doi.org/10.1016/S0378-4266(02)00271-6&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which says CVaR is coherent for general loss distributions, including discrete distributions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think that I was confused by other authors who were also confused with the definitions of CVaR. In particular, in the following paper, the author mistakenly stated that Tail Conditional Expectation (TCE) is same as CVaR, and they are not coherent. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://dx.doi.org/10.1016/S0378-4266(02)00281-9&quot; rel=&quot;noreferrer&quot;&gt;http://dx.doi.org/10.1016/S0378-4266(02)00281-9&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, TCE is not same as CVaR in general. If the underlying distribution is continuous, they are same.&lt;/p&gt;&#xA;" OwnerUserId="494" LastEditorUserId="494" LastEditDate="2012-07-20T20:09:30.573" LastActivityDate="2012-07-20T20:09:30.573" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1361" PostTypeId="2" ParentId="1330" CreationDate="2011-06-28T04:01:45.147" Score="6" Body="&lt;p&gt;Buy copies of Brent Oksendal's &quot;Stochastic Differential Equations An Introduction with Applications&quot; and Thomas Bjork's &quot;Arbitrage Theory in Continuous Time.&quot; These are well written graduate level textbooks. I can't promise it will be painless, but if you want to understand continuous time derivative pricing models these are a place to start. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another option is to not worry about continuous time models and get a copy of Stanley R. Pliska's &quot;Introduction to Mathematical Finance.&quot; It is a graduate textbook covering discrete time models. To use these models all you need to know is linear algebra and how to optimize linear equations using the simplex method. (not to be confused with the simplex numerical optimization algorithm.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bluntly put: Ito Integration can be viewed two ways.&#xA;1) As an incomplete Riemann Stieltjes Integral&#xA;2) An extended Lebesgue Integral. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have no idea what either of the above two things are, go with the descrete time models.&lt;/p&gt;&#xA;" OwnerUserId="1023" LastActivityDate="2011-06-28T04:01:45.147" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1363" PostTypeId="2" ParentId="1270" CreationDate="2011-06-28T13:13:55.590" Score="9" Body="&lt;p&gt;Why not using the so simple Monte-Carlo estimator&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \hat{p}_N =\frac{ \sum_{i=1}^N 1_{|A_{i+1}-A_i|&amp;gt;0 \cap |B_{i+1}-B_i|&amp;gt;0}}  {\sum_{i=1}^N 1_{|A_{i+1}-A_i|&amp;gt;0 }}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $1_{|A_{i+1}-A_i|&amp;gt;0}$ is $1$ if stock $A$ has moved at time $i+1$&lt;/p&gt;&#xA;" OwnerUserId="539" LastActivityDate="2011-06-28T13:13:55.590" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1364" PostTypeId="1" CreationDate="2011-06-28T13:54:17.333" Score="8" ViewCount="205" Body="&lt;p&gt;Let's say I have two call option liabilities that I want to statically hedge with a single call option.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Liabilities:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Liab_Call_1:&#xA; Strike: 100&#xA; Notional: 1000&#xA; DaysToExpiration: 20&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Liab_Call_2:&#xA; Strike: 100&#xA; Notional: 1000&#xA; DaysToExpiration: 30&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assets:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Asset_Call_1:&#xA; Strike: 100&#xA; Notional: 2000&#xA; DaysToExpiration: 25&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, I can see that after 25 days when my Asset_Call_1 expires, my Liab_Call_2's 1000 notional will be unhedged for 5 days.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Questions&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Are the numbers in my post correct (or basically, am I understanding this problem correctly)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is this as far as I can go in my quantification of the exposure after my assets expire?  Are there any further metrics I can use to tell the effect of a trade day range on my hedge?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is taking the weighted average strike (by notional) of the liabilities the best way to calculate the strike of the asset?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Addendum&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was thinking about this a bit more, and actually, after 20 days, there are 5 days where the Asset_Call_1's notional exceeds my liability notional by 1000.  So from day 20-25, there is 1000 extra notional that is hedged, and from 25-30 there is 1000 notional that is unhedged.  So in this case, you could describe your hedging error as:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;5 days of 1000 overhedged (is this the right word) notional&lt;/li&gt;&#xA;&lt;li&gt;5 days of 1000 unhedged notional&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Does that sound right at all?&lt;/p&gt;&#xA;" OwnerUserId="551" LastEditorUserId="551" LastEditDate="2011-06-28T17:25:30.510" LastActivityDate="2011-06-28T19:52:10.960" Title="Quantifying Hedging Error Due To Expiration Day Range?" Tags="&lt;options&gt;&lt;hedging&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1365" PostTypeId="2" ParentId="549" CreationDate="2011-06-28T14:58:00.217" Score="22" Body="&lt;p&gt;Nanex has an interesting way of showing the order-book:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following images show CME's emMni future (S&amp;amp;P 500) depth of book and trades. The images are rainbow (ROYGBIV) color coded by the relative size at each depth level. Red indicates a lot of size, violet indicates size approaching 0. Note that a full minute before each event, the depth starts cooling rapidly. The volume of contracts traded is represented at the bottom of the chart.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/L0xBQ.jpg&quot; alt=&quot;Order book&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More info here: &lt;a href=&quot;http://www.nanex.net/Research/EMini1/Emini1.html&quot; rel=&quot;noreferrer&quot;&gt;http://www.nanex.net/Research/EMini1/Emini1.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="225" LastActivityDate="2011-06-28T14:58:00.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1366" PostTypeId="2" ParentId="1364" CreationDate="2011-06-28T19:52:10.960" Score="2" Body="&lt;p&gt;Your assumptions are that there are 3 call options, all struck at 100, all with contract multipliers of 10 and with maturities, 20 days, 25 days, and 30 days.  You are short 1 of the 20 day calls and short 1 of the 30 day calls.  You want to hedge with the 25 day call.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, you'll buy 2 of those (1 to hedge the 20 day call, and 1 to hedge the 30 day call), and now you're short a time-fly.  If you don't unwind it, then when the front leg expires, you'll be left with an unbalanced time spread (i.e. long 2 near-term, short 1 longer term).  When the middle expires, you're left naked short a call.  So, the static hedge is only good until the first option expires. Then you have to rehedge, or unwind.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, please see &lt;a href=&quot;https://quant.stackexchange.com/faq#questions&quot;&gt;What kind of questions can I ask here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, the 1st paragraph: &#xA;The Quantitative Finance Stack Exchange is intended for professionals and academics involved in securities valuations, risk modeling, and other topics related to quant modeling or trading. Basically, if you aren't earning a living at this, it's probably off topic&lt;/p&gt;&#xA;" OwnerUserId="508" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2011-06-28T19:52:10.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1367" PostTypeId="2" ParentId="1343" CreationDate="2011-06-29T02:28:52.400" Score="3" Body="&lt;p&gt;You can have a look at what the guys at &lt;a href=&quot;http://www.nanex.net/FlashCrash/FlashCrashAnalysis.html&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;Nanex&quot;&gt;Nanex&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example of what they look at. The chart is colour coded for market depth (the colder the colour the less depth)&#xA;&lt;img src=&quot;https://i.stack.imgur.com/eYKh0.jpg&quot; alt=&quot;Market depth&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="134" LastActivityDate="2011-06-29T02:28:52.400" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1368" PostTypeId="2" ParentId="181" CreationDate="2011-06-29T07:00:45.430" Score="3" Body="&lt;p&gt;Imagine you had a formula that predicted what the S&amp;amp;P 500 would do every microsecond for the next 5 years. A parsimonious representation of this formula would stitch together simpler formulae that operate on disjoint, exhaustive sub-intervals of the next 5 years. So in a sense even a &quot;perfect formula&quot; would be made up of models that expire.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe there are ways of meta-modelling just as there are ways of modelling &amp;mdash; but there is no formula for the stock market because some determinants of the price are exogenous. Meta-models are imperfect for the same reason models are imperfect.&lt;/p&gt;&#xA;" OwnerUserId="104" LastActivityDate="2011-06-29T07:00:45.430" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1369" PostTypeId="1" AcceptedAnswerId="1370" CreationDate="2011-06-30T00:06:16.230" Score="18" ViewCount="879" Body="&lt;p&gt;Let's say you have a dependent variable and many independent variables. What are the preferred metrics for sorting and selecting variables based on explanatory power? Let's say you are not concerned with correlation among your inputs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My thoughts are below. Let me know if I'm missing anything obvious, or if there is a metric that you feel dominates the others.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Spearman correlation controlling for sector&lt;/li&gt;&#xA;&lt;li&gt;Granger causality&lt;/li&gt;&#xA;&lt;li&gt;Johansen test for cointegration&lt;/li&gt;&#xA;&lt;li&gt;Grinold's Information Ratio&lt;/li&gt;&#xA;&lt;li&gt;Economic performance of the factor during a factor backtest (i.e. drawdown, sharpe, etc.)&lt;/li&gt;&#xA;&lt;li&gt;Volatility of the factor premium&lt;/li&gt;&#xA;&lt;li&gt;Persistency of the factor premium&lt;/li&gt;&#xA;&lt;li&gt;Monotonic relation test&lt;/li&gt;&#xA;&lt;li&gt;Significance test on spread return (Q5-Q1) vs. Mean Return&lt;/li&gt;&#xA;&lt;li&gt;R^2 of factor after building some kind of model&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;My preference would be correlation coefficient.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1106" LastEditDate="2011-09-09T19:20:19.213" LastActivityDate="2015-02-23T03:45:35.130" Title="Variable Selection in factor models" Tags="&lt;cointegration&gt;&lt;factor-models&gt;&lt;information&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="1370" PostTypeId="2" ParentId="1369" CreationDate="2011-06-30T02:25:32.840" Score="4" Body="&lt;p&gt;I'd add:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Variance reduction&lt;/li&gt;&#xA;&lt;li&gt;Fraction same sign / Hit rate&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Additionally, you might look at the relationship between the Q5-Q1 spread itself and the dependent (i.e. are larger/smaller spreads associated with some feature of the dependent).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Turnover may also be an issue as slippage and friction come into consideration. Measures such as percent turnover in the Q5-Q1 portfolio, and correlation coefficient decay over lagged periods can prove insightful in selecting factors with higher stability and persistence.&lt;/p&gt;&#xA;" OwnerUserId="767" LastActivityDate="2011-06-30T02:25:32.840" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1372" PostTypeId="2" ParentId="959" CreationDate="2011-06-30T14:02:04.300" Score="8" Body="&lt;p&gt;I have worked with C++, java and C# implementing a google like search engine for DOD in along with many other software that require high performance (using low level memory mapping and named pipes/tcp).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my experience, you cannot match speed of C++ with the managed code.  In managed code, every call to new, garbage collection, etc. requires multiple memory look ups to allocate, de-allocate memory.  With each garbage collections there are multiple threads created for each generations of the memory locations (so if you got not so savvy developers...).  in addition, when you are performing a lot of thread switches or loading data in memory(e.g. in memory streams or transfers over tcp/named pipes) you will lose speed because of managed codes need for serialization (may it be wcf, remoting, web services etc.)  no matter what the data transfers in .net is serialized unless you write your own tcp/named pipe wrappers. its worse if you need to use COM as your managed code will need to wrap everything up in com callable wrappers. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly and most importantly, don't forget that most of the .net libraries are wrappers around the old win32 api.  .net framework pump still translates your calls down to the old win32 message pump in order to perform many of its operations (e.g. DllImport(&quot;User32&quot;,...)).  So does the .Net socket library (wcf, remoting, etc.) also use the underlying tcp/ip and named pipe api (e.g. see the WCF's ability to allow you to configure eitehr named pipes and tcp connection.  Namedpipes are like file handle and require very low level access hence you are given a simple wrapper). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;so for speed C++; for  ease of development C#/Java. C# can be optimized using various tactics but requires good developers that know how to &quot;manage&quot; objects and GC (e.g. implement interfaces to do your own GC, call win32 api directly as needed, suppress GC, don t use classes that serialize and deserialize at least try to avoid, build your own buffer classes and crc checks for ease, use lower level sockets and not use wcf wrappers (unless its your goal to create a webservice).&lt;/p&gt;&#xA;" OwnerUserId="1029" LastActivityDate="2011-06-30T14:02:04.300" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1373" PostTypeId="2" ParentId="1369" CreationDate="2011-06-30T14:39:37.827" Score="1" Body="&lt;p&gt;If you're using R, you might try:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://cran.r-project.org/web/packages/relaimpo/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://cran.r-project.org/web/packages/relaimpo/index.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stats.stackexchange.com/questions/8918/is-there-a-way-to-optimize-regression-according-to-a-specific-criterion/8932#8932&quot;&gt;https://stats.stackexchange.com/questions/8918/is-there-a-way-to-optimize-regression-according-to-a-specific-criterion/8932#8932&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="392" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2011-06-30T14:39:37.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1374" PostTypeId="1" AcceptedAnswerId="1376" CreationDate="2011-06-30T18:18:44.390" Score="12" ViewCount="3528" Body="&lt;p&gt;It is a not so well known fact that the &lt;a href=&quot;http://en.wikipedia.org/wiki/Kelly_criterion&quot;&gt;Kelly criterion&lt;/a&gt; is only optimal in a nice and well-behaved Merton-world. It is far from optimal when things are getting non-(log)normal (i.e. more realistic!).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question&lt;/strong&gt;&lt;br&gt;&#xA;My question is simply: Why is this so? What are the reasons and is there some intuition for this fact.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2013-12-07T23:00:08.640" Title="Optimality of Kelly criterion in non-normal environment" Tags="&lt;quant-trading-strategies&gt;&lt;kelly-criterion&gt;" AnswerCount="3" CommentCount="6" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="1376" PostTypeId="2" ParentId="1374" CreationDate="2011-06-30T19:30:43.197" Score="2" Body="&lt;p&gt;The Kelly Criterion was derived for two-outcome events (binomial).   Assuming it &quot;works&quot; for anything else (including &quot;normal&quot; events) is asking for trouble.&lt;/p&gt;&#xA;" OwnerUserId="392" LastActivityDate="2011-06-30T19:30:43.197" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1377" PostTypeId="1" CreationDate="2011-06-30T19:36:50.720" Score="4" ViewCount="459" Body="&lt;p&gt;I need to implement a reverse stress testing model (definition &lt;a href=&quot;http://www.fsa.gov.uk/pages/About/What/International/stress_testing/firm_s/reverse_stress_testing/index.shtml&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have searched around and cannot find anything substantial on the topic.  Does anyone know of any good papers/references regarding actual implementation?  Please don't post links to Basel docs.&lt;/p&gt;&#xA;" OwnerUserId="826" LastEditorUserId="1106" LastEditDate="2011-08-18T11:49:31.440" LastActivityDate="2011-08-18T11:49:31.440" Title="What research exists regarding implementation of reverse stress testing?" Tags="&lt;research&gt;&lt;risk-models&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1378" PostTypeId="1" CreationDate="2011-06-30T21:54:12.457" Score="16" ViewCount="571" Body="&lt;p&gt;I have 10 years of backtested simulated performance of some trading strategy (using historical prices), and N months of actual trading performance. What statistical test can I do find out if I'm on target with the backtesting numbers? (both, in terms of expected annual returns and expected annual Sharpe ratio)&lt;/p&gt;&#xA;" OwnerUserId="683" LastActivityDate="2011-07-01T17:03:31.343" Title="Comparing backtesting returns with real trading returns" Tags="&lt;backtesting&gt;&lt;statistics&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1379" PostTypeId="1" AcceptedAnswerId="1389" CreationDate="2011-06-30T22:58:10.647" Score="24" ViewCount="8713" Body="&lt;p&gt;I'm working on implementing a 'LOB' and I'm being very careful about choosing my data-structures so as to maximize performance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using F# as an example, I need to consider a &lt;em&gt;List&lt;/em&gt; versus &lt;em&gt;Array&lt;/em&gt; for holding 'Bids' and 'Asks'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because these lists are constantly being updated very rapidly, and the orders that need to be removed, added, updated quickly, I would think 'Array' because of 'efficient random access'. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That being said, Lists (singly-linked in a functional language like F#) seem to be more versatile, and faster for adding and subtracting from the 'head' of the list, but not necessary good for 'random access'? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thoughts, am I on the right track? &lt;/p&gt;&#xA;" OwnerUserId="913" LastEditorUserId="2299" LastEditDate="2013-12-08T20:59:52.530" LastActivityDate="2015-12-18T11:06:37.990" Title="Implementing data-structures in a Limit order book" Tags="&lt;programming&gt;&lt;limit-order-book&gt;&lt;market-microstructure&gt;" AnswerCount="5" CommentCount="1" FavoriteCount="18" ContentLicense="CC BY-SA 3.0" />
  <row Id="1381" PostTypeId="1" CreationDate="2011-07-01T00:09:27.783" Score="5" ViewCount="209" Body="&lt;p&gt;I am missing tools to investigate this issue. I am trying to solve this question &lt;a href=&quot;https://quant.stackexchange.com/q/1356/956&quot;&gt;here&lt;/a&gt;. What kind of issues should you acknowledge over the naive diversification/rebalancing with normal distribution? You could have a different return distribution curve so does the distribution affect the benefits? If you know how to investigate this kind of problem, please, let me know -- I am unsure whether this runs over the properties of mean-variance portfolio optimization (MVO).&lt;/p&gt;&#xA;" OwnerUserId="956" LastEditorUserId="41390" LastEditDate="2020-11-18T23:03:05.503" LastActivityDate="2020-11-18T23:03:05.503" Title="Benefits of Diversification and Rebalancing with negatively skewed leptokurtic return distribution?" Tags="&lt;portfolio&gt;&lt;diversification&gt;&lt;skewness&gt;&lt;rebalancing&gt;&lt;kurtosis&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="1382" PostTypeId="2" ParentId="1379" CreationDate="2011-07-01T00:30:14.893" Score="11" Body="&lt;p&gt;Here's a blog post with a general overview of some possible implementations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/yoblin/PyLimitBook/blob/master/documentation/howtohft_howtobuildafastlimitorderbook.pdf&quot; rel=&quot;nofollow&quot;&gt;howtohft_howtobuildafastlimitorderbook - (mirror of the original posting)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The posting was originally on the website www.quantcup.org - &lt;a href=&quot;http://www.quantcup.org/home/howtohft_howtobuildafastlimitorderbook&quot; rel=&quot;nofollow&quot;&gt;this site is up for sale but I leave the broken URL to help future searchers&lt;/a&gt;: &lt;/p&gt;&#xA;" OwnerUserId="584" LastEditorUserId="17999" LastEditDate="2015-10-23T23:35:07.520" LastActivityDate="2015-10-23T23:35:07.520" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1383" PostTypeId="1" CreationDate="2011-07-01T05:55:10.370" Score="2" ViewCount="328" Body="&lt;p&gt;Can you please recommend good reads on statistical analysis related to online fraud detection and prevention of account abuse? &lt;/p&gt;&#xA;" OwnerUserId="1034" LastEditorUserId="467" LastEditDate="2011-07-01T09:04:31.630" LastActivityDate="2013-12-19T14:37:08.467" Title="Reading recommendation on using statistical analysis in online fraud prevention" Tags="&lt;books&gt;" AnswerCount="1" CommentCount="3" ClosedDate="2011-07-02T03:36:23.170" ContentLicense="CC BY-SA 3.0" />
  <row Id="1386" PostTypeId="1" AcceptedAnswerId="1387" CreationDate="2010-09-19T21:30:35.003" Score="17" ViewCount="3645" Body="&lt;p&gt;Can someone suggest a topic or some reasonably narrow area in financial time series analysis (e.g. statistical, machine learning, etc.) which can make a good topic for a master thesis? By 'good' I mean that it's perspective i.e. can be extended to PhD-level studies, but still manageable in 3-4 month time for an applied math master student. Thank you. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Thank you for the feedback. The field is indeed very broad and well developed that's why I would like to have some input from the community. Let's narrow down to high frequency financial time series or market microstructure (but if you come up with ideas in different areas I would be most grateful to hear it).&lt;/p&gt;&#xA;" OwnerUserId="370" OwnerDisplayName="Alexey Kalmykov" LastActivityDate="2016-04-08T07:52:39.253" Title="What is a good topic on financial time series analysis for master thesis?" Tags="&lt;time-series&gt;&lt;finance&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="1387" PostTypeId="2" ParentId="1386" CreationDate="2010-09-20T16:52:43.323" Score="10" Body="&lt;p&gt;Natural experiments are good working material for MA-thesis (less issue statistically speaking, quicker path to results,...).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A good one recently in finance deals with short selling ban: in many countries in the euro-zone, in 2008, short sales were banned on some banks/financial corporations in some countries (Greece, France, Belgium, Germany) while still allowed in others. You could try to find some banks that are similar in many characteristic (size, volatility in the years leading to 2008, type of assets) and see to what extend there behavior (volatility) was different during the crisis conditional to being in a no-short sale country or not. &lt;/p&gt;&#xA;" OwnerUserId="994" OwnerDisplayName="user189035" LastActivityDate="2010-09-20T16:52:43.323" CommentCount="2" ContentLicense="CC BY-SA 2.5" />
  <row Id="1389" PostTypeId="2" ParentId="1379" CreationDate="2011-07-01T16:23:38.143" Score="7" Body="&lt;p&gt;i am not a F# expert but when it comes to performance and thread safety try sorted list or hashset.  sorted list if the data needs to be sorted (it gets sorted when added to the list) otherwise hashset, no sorting hence better performance.  they are both generic.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;in addition i would think you need thread safety when reading/writing/updating your data in this case the above will give you performance and safety you need.  if i remember correctly the hashtable will give you the identical or close to it times as listed on the page provided by bellamyj above.  &lt;/p&gt;&#xA;" OwnerUserId="1029" LastActivityDate="2011-07-01T16:23:38.143" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1390" PostTypeId="2" ParentId="1378" CreationDate="2011-07-01T17:03:31.343" Score="3" Body="&lt;p&gt;see &lt;a href=&quot;https://stats.stackexchange.com/questions/12521/comparing-backtesting-returns-with-real-trading-returns&quot;&gt;https://stats.stackexchange.com/questions/12521/comparing-backtesting-returns-with-real-trading-returns&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="683" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2011-07-01T17:03:31.343" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1391" PostTypeId="1" AcceptedAnswerId="1433" CreationDate="2011-07-01T17:13:00.850" Score="27" ViewCount="7197" Body="&lt;p&gt;I am looking for all kinds of research concerning option trading strategies. With that I mean papers that publish results on different option trading strategies properly backtested with real-world data.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="1106" LastEditDate="2011-09-09T19:15:24.307" LastActivityDate="2021-04-14T09:22:26.263" Title="Papers about backtesting option trading strategies" Tags="&lt;options&gt;&lt;backtesting&gt;&lt;quant-trading-strategies&gt;&lt;research&gt;&lt;option-strategies&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="44" ContentLicense="CC BY-SA 3.0" />
  <row Id="1392" PostTypeId="1" CreationDate="2011-07-01T18:42:53.023" Score="36" ViewCount="23181" Body="&lt;p&gt;I am wondering if anyone has used NoSQL (mongodb, cassandra, etc.) to store and analyze data.&#xA;I tried searching the web but was not able to see if the financial firms had gotten in to using nosql storage.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far even on this site i have only seen talks of using SQL DBs. I would imagine that NoSQL would be much faster.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would someone shed light on the subject of NoSQL solutions in the finance world.&#xA;have you seen/heard anyone use it? if so why are they using.  if not using then why not. &lt;/p&gt;&#xA;" OwnerUserId="1029" LastEditorUserId="1587" LastEditDate="2012-07-09T02:15:27.643" LastActivityDate="2020-08-20T13:02:13.750" Title="Usage of NoSQL storage in Finance" Tags="&lt;data&gt;&lt;database&gt;" AnswerCount="7" CommentCount="0" FavoriteCount="30" ContentLicense="CC BY-SA 3.0" />
  <row Id="1393" PostTypeId="2" ParentId="1392" CreationDate="2011-07-01T19:12:08.553" Score="6" Body="&lt;p&gt;In the finance world, most data (especially given this forum is for Quant monkeys) is transactional and subject to regulatory reporting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NoSQL isn't generally transactional and given the shape of, say, risk data, there is no overpowering reason to throw away ACID and RDBMS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are more mundane reasons: there are 1000s of IT guys who know RDBMS. When your NoSQL folk leave, where is your continuity and support?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm biased here: I'm an RDBMS database specialist who manages risk/pricing/trading systems&lt;/p&gt;&#xA;" OwnerDisplayName="user1041" LastActivityDate="2011-07-01T19:12:08.553" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="1394" PostTypeId="2" ParentId="1392" CreationDate="2011-07-01T20:09:25.313" Score="22" Body="&lt;p&gt;Specialised NoSQL database systems are used a lot for time series storage, particularly for tick data:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://kx.com/&quot;&gt;Kx / Kdb&lt;/a&gt; is one prominent solution; from Arthur Whitney et al who did &lt;a href=&quot;http://www.aplusdev.org&quot;&gt;A+&lt;/a&gt; at Morgan Stanley&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.onemarketdata.com&quot;&gt;Onetick&lt;/a&gt; is another, newer entrant, which has traces back to Goldman Sachs&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.voltdb.com&quot;&gt;Voltdb&lt;/a&gt; is something by serial database inventer Michael Stonebreaker&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.scidb.org&quot;&gt;SciDB&lt;/a&gt; is another recent Stonebreaker project, trying 'commercial open source' but more for science apps (at least for now?)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The commercial offerings tend to be &lt;em&gt;rather expensive&lt;/em&gt; and I have not heard of use of standard Web 2.0 NoSQL databases in trading environments.  Some may of course &lt;em&gt;do&lt;/em&gt; rather than &lt;em&gt;talk&lt;/em&gt; ...&lt;/p&gt;&#xA;" OwnerUserId="69" LastEditorUserId="5086" LastEditDate="2013-05-08T06:51:39.920" LastActivityDate="2013-05-08T06:51:39.920" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="1395" PostTypeId="2" ParentId="1383" CreationDate="2011-07-01T21:20:53.750" Score="2" Body="&lt;p&gt;Technically, this isn't fraud, but it should be.   It's definitely account abuse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://articles.latimes.com/2011/apr/03/business/la-fi-amateur-currency-trading-20110403&quot; rel=&quot;nofollow&quot;&gt;http://articles.latimes.com/2011/apr/03/business/la-fi-amateur-currency-trading-20110403&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://ftalphaville.ft.com/blog/2009/11/02/80866/the-100bn-fx-hustle/&quot; rel=&quot;nofollow&quot;&gt;http://ftalphaville.ft.com/blog/2009/11/02/80866/the-100bn-fx-hustle/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The sad part is, even after being shown this kind of information, I have watched several retail &quot;traders&quot; lose their ass on this crap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update (10/11/2013) =============================&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No big surprise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.bloomberg.com/news/2013-10-11/u-s-said-to-open-criminal-probe-of-fx-market-rigging.html&quot; rel=&quot;nofollow&quot;&gt;http://www.bloomberg.com/news/2013-10-11/u-s-said-to-open-criminal-probe-of-fx-market-rigging.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update (12/19/2013) =============================&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another &quot;no big surprise&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.bloomberg.com/news/2013-12-19/how-secret-currency-traders-club-devised-biggest-market-s-rates.html&quot; rel=&quot;nofollow&quot;&gt;http://www.bloomberg.com/news/2013-12-19/how-secret-currency-traders-club-devised-biggest-market-s-rates.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="392" LastEditorUserId="392" LastEditDate="2013-12-19T14:37:08.467" LastActivityDate="2013-12-19T14:37:08.467" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1396" PostTypeId="2" ParentId="1318" CreationDate="2011-07-02T09:28:40.603" Score="0" Body="&lt;p&gt;Also Ryan Jones' Fixed Ratio strategy, from his book The Trading Game.&lt;/p&gt;&#xA;" OwnerUserId="82" LastActivityDate="2011-07-02T09:28:40.603" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1397" PostTypeId="2" ParentId="948" CreationDate="2011-07-02T22:42:56.483" Score="5" Body="&lt;p&gt;I have become a fan of SQLite. It's a very lightweight SQL database, which you can use as an intermediate solution. I agree with Rich C that the best thing to do is probably come up with a custom solution that is optimal for your needs. Using SQLite as persistent storage, and loading the data in memory when you want to do intensive computations on it seems like a best of both worlds approach.&lt;/p&gt;&#xA;" OwnerUserId="1043" LastActivityDate="2011-07-02T22:42:56.483" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1398" PostTypeId="1" AcceptedAnswerId="1402" CreationDate="2011-07-04T12:13:50.527" Score="6" ViewCount="752" Body="&lt;p&gt;I am testing my model and I am interested in options prices on EUR|USD for Jan, 2011.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The history can be even daily - but I have never had a deal with fx options, so I don't know where start to look for such history.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you advise me?&lt;/p&gt;&#xA;" OwnerUserId="464" LastEditorUserId="467" LastEditDate="2011-07-05T14:43:21.967" LastActivityDate="2011-07-05T14:43:21.967" Title="FX option history" Tags="&lt;fx&gt;&lt;history&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1399" PostTypeId="2" ParentId="978" CreationDate="2011-07-04T12:46:55.633" Score="2" Body="&lt;p&gt;The first think you have to ask is ¿¿What price??? Monetary price or equity price?? All answers,the ones I read, related to monetary price, but are equity price really risk free????&#xA;One of the biggest problem with Black Scholes (personal opinion) is that they consider the behave of equity price as monetary price: Solve this ODE: S(t)'/dt= r*S(0), this tell you how money change in a deposit account (monetary price). All finance theory comes form this simple implementation. Now check Hull, and you will see that they use this expression to get the final result en the E(S(T)).&#xA;Nice question, and I dont pretent to solve it, cause risk neutral in equity price does not exist........., is better to understand the model, limitation, etc.......&lt;/p&gt;&#xA;" OwnerUserId="1046" LastActivityDate="2011-07-04T12:46:55.633" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1401" PostTypeId="2" ParentId="1391" CreationDate="2011-07-05T14:29:10.757" Score="9" Body="&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1012075&quot;&gt;Option Traders Use (very) Sophisticated Heuristics, Never the Black–Scholes–Merton Formula&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=519044&quot;&gt;Stock Price Clustering on Option Expiration Dates&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=889947&quot;&gt;Option Returns and Volatility Mispricing&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1029" LastActivityDate="2011-07-05T14:29:10.757" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1402" PostTypeId="2" ParentId="1398" CreationDate="2011-07-05T14:42:36.803" Score="4" Body="&lt;p&gt;If you're looking for free data, I've heard this question many times asked to derivatives professors at the end of a lesson. They answered was most of the time to step by their offices so that they could give data they imported from the university data provider. So apparently, if even academy has to do it this way, I'd be surprised if you found.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This &lt;a href=&quot;http://www.wilmott.com/messageview.cfm?catid=38&amp;amp;threadid=50980&quot; rel=&quot;nofollow&quot;&gt;post&lt;/a&gt; also suggests using Bloomberg apparently, which is also what I would suggest if you have access to a BB terminal.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2011-07-05T14:42:36.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1403" PostTypeId="1" AcceptedAnswerId="1404" CreationDate="2011-07-05T14:58:01.593" Score="8" ViewCount="317" Body="&lt;p&gt;I am at the moment writing a program focusing on asset allocation and I am thinking about how I should represent my constraints in the data model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first approach that came to mind was to define some categories to classify the constraints so that they could be stored in a table according to their &quot;category&quot; (for example, unary constraints x&gt;=y, binary constraints y&#xA;&#xA;&lt;p&gt;I then came up with another idea which is to define my own &quot;constraint language&quot; with its own grammar and to store it as a &lt;code&gt;string&lt;/code&gt; in the database (like &lt;code&gt;Sum(&quot;Equities&quot;)&amp;lt;Percent(20,Portfolio)&lt;/code&gt;). This would imply writing a parser. I could also opt to use an XML representation of the constraints to use one of the many XML parsers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wanted to know if anyone had another potential solution and if you knew about some papers discussing this subject?&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2012-06-10T17:51:08.830" LastActivityDate="2012-06-10T17:51:08.830" Title="How to represent constraints for optimization problems in a data model?" Tags="&lt;optimization&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1404" PostTypeId="2" ParentId="1403" CreationDate="2011-07-05T18:30:43.113" Score="4" Body="&lt;p&gt;A lot of people use mathematical modelling languages/formats like the proprietary AMPL (see &lt;a href=&quot;http://en.wikipedia.org/wiki/AMPL&quot;&gt;http://en.wikipedia.org/wiki/AMPL&lt;/a&gt;) or MPS (see &lt;a href=&quot;http://en.wikipedia.org/wiki/MPS_%28format%29&quot;&gt;http://en.wikipedia.org/wiki/MPS_%28format%29&lt;/a&gt;) to define optimization problems. There are also open source alternatives for a subset of problems (like for example the GNU Linear Programming Kit with its language). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hans Mittelmann has collected a lot of useful information including test cases under &lt;a href=&quot;http://plato.asu.edu/guide.html&quot;&gt;http://plato.asu.edu/guide.html&lt;/a&gt;.&#xA;However, using an optimizer that understands for example AMPL may be not the best approach.&lt;/p&gt;&#xA;" OwnerUserId="560" LastEditorUserId="560" LastEditDate="2011-07-05T18:54:10.940" LastActivityDate="2011-07-05T18:54:10.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1405" PostTypeId="2" ParentId="1403" CreationDate="2011-07-05T19:06:22.617" Score="4" Body="&lt;p&gt;This seems like it would be well-suited for implementation in a Prolog. That family of languages is built around a constraint programming model. Specifically, take a look at &lt;a href=&quot;http://eclipseclp.org/&quot; rel=&quot;nofollow&quot;&gt;ECLiPSe&lt;/a&gt;. It's mature (originally developed in the 90's by Cisco I believe) and has external hooks to e.g. Java &amp;amp; C++ if you don't want to implement your whole system in prolog. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Prologs are well suited for scheduling and distribution problems: distribute this sum of  time/money/points in some way that satisfies this other list of constraints.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's worth pointing out that the constraints are declarative, so you can just add new constraints or remove old constraints and rerun the program to get new results without having to re-build or re-compile any of the core code.&lt;/p&gt;&#xA;" OwnerUserId="80" LastActivityDate="2011-07-05T19:06:22.617" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1406" PostTypeId="2" ParentId="978" CreationDate="2011-07-06T09:17:03.150" Score="3" Body="&lt;p&gt;The only requirement if you are risk neutral is the property of martingale on your discounted stock price $M_t=e^{-rt} S_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you apply Itô $d( S_t\cdot e^{-rt} e^{rt})=d(M_t\cdot e^{rt})=r_tM_te^{rt}dt + ..dW_t=r_tS_tdt+..dW_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you see see that under the risk free probability, the asset price must have $r_t$ as yield  and to answer to your question, &#xA;why the GB is so popular? simply because $dS_t=S_t(r dt+ \sigma dW_t)$ is the most simple SDE that hold this property.&lt;/p&gt;&#xA;" OwnerUserId="539" LastActivityDate="2011-07-06T09:17:03.150" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1407" PostTypeId="2" ParentId="1027" CreationDate="2011-07-06T15:46:27.270" Score="9" Body="&lt;p&gt;Before I try to answer your question we need to establish a difference between what one wants to analyse. &#xA;It is true that before modern time-series methodologies were developed, researches used &quot;correlation&quot; between prices as a means of analysis. However, since a Price (at a specific moment in time) is 1 value, it makes no sense to compare 2 prices with each other using &quot;correlation&quot; (although there are some attempts: Robinson (2006) &lt;a href=&quot;http://www.cemmap.ac.uk/wps/cwp107.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.cemmap.ac.uk/wps/cwp107.pdf&lt;/a&gt; )&#xA;And as already has been pointed out before, most people above mention correlation in context of returns and such. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most of the time we are interested not in the price but its movement! (i.e. it's a relative/dynamic concept which involves TIME).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this &quot;time-series&quot; context, co-integration is the right tool to measure relationship between MOVEMENTS in prices. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me try to answer your question concretely by elaborating a bit on Johansen co-integration methodology as an illustration.&#xA;The maximum likelihood estimation is in function of the deterministic term and the stationary effects. In other words we consider the multivariate linear regressions 1 and 2. With basic mathematic transformations it is easy to prove that the Johansen test statistics are directly linked to the angle (mean(t)) between the vectors of residuals in (1) and (2), ut and vt respectively. (If you care to read the full proof feel free to contact me)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/z1iE7.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, the smaller the angle(t) between the two &quot;error-vectors&quot; ut and vt the more &quot;connected&quot; or integrated the price movements are between time-series 1 and 2. Which is quite intuitive actually...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, with some background knowledge, I think this illustration puts cointegration in contrast to correlation &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this was not too confusing (without the whole proof) and helped to answer your question to some degree.&lt;/p&gt;&#xA;" OwnerUserId="1053" LastEditorUserId="1053" LastEditDate="2011-07-07T13:11:03.277" LastActivityDate="2011-07-07T13:11:03.277" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1408" PostTypeId="2" ParentId="1027" CreationDate="2011-07-06T19:43:50.667" Score="9" Body="&lt;ul&gt;&#xA;&lt;li&gt;Correlation is a property of collections of observations.&lt;/li&gt;&#xA;&lt;li&gt;Cointegration is a property of time series.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The important difference is that temporal observations have one neighbour to their left and one to their right. Collections are like a set &amp;mdash; no implicit &quot;neighbour&quot; relationships.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moving average is an inappropriate statistic to apply to lab experiments or phone survey data. It is appropriate in the analysis of time series.&lt;/p&gt;&#xA;" OwnerUserId="104" LastActivityDate="2011-07-06T19:43:50.667" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1409" PostTypeId="1" AcceptedAnswerId="1418" CreationDate="2011-07-06T23:06:53.740" Score="5" ViewCount="31677" Body="&lt;p&gt;I've recently started reading some books on asset allocation and portfolio theory but I don't work in the field and don't have much knowledge yet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I've been reading up on mean-variance analysis and my question is regarding the computation of the expected returns for a particular asset. From what I understand historical data is used to predict future returns. In the book that I'm currently reading, the author provides monthly returns for a particular stock and then we're asked to calculate the expected return for future months.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is this, if i have historical open/close data for a particular stock, how do I use this information to calculate the returns? Since the return is based on the share price when the stock was purchased and the price when the it was sold, I'm not sure exactly what the calculation would look like.&lt;/p&gt;&#xA;" OwnerUserId="914" LastEditorUserId="467" LastEditDate="2011-07-18T08:22:49.603" LastActivityDate="2012-01-26T21:30:19.870" Title="How to calculate expected return based on historical data for Mean Variance Analysis" Tags="&lt;mean-variance&gt;" AnswerCount="3" CommentCount="6" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1411" PostTypeId="2" ParentId="1259" CreationDate="2011-07-07T07:16:23.037" Score="3" Body="&lt;p&gt;It sounds like you are referring to measuring correlation and/or cointegration.  May I suggest you take a look at &lt;a href=&quot;https://quant.stackexchange.com/questions/1027/1407&quot;&gt;another question&lt;/a&gt; with several answers. I believe it may include an answer to yours as well...&lt;/p&gt;&#xA;" OwnerUserId="1053" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2011-10-18T20:48:52.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1412" PostTypeId="2" ParentId="1250" CreationDate="2011-07-07T07:28:15.353" Score="2" Body="&lt;p&gt;Julien, frankly I have no idea what your research question is... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you are quite vague in formulation your question I can only provide a vague answser...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following academic papers might be of use&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.jstor.org/stable/1428344&quot; rel=&quot;nofollow&quot;&gt;http://www.jstor.org/stable/1428344&lt;/a&gt;&#xA;http://www.math.ethz.ch/~mschweiz/Files/converge.pdf&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and I suggest you take a look at:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Introducing Monte Carlo Methods with R     by  Christian P. Robert · George Casella&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;it will give you concrete examples of applying monte carlo methodologies&lt;/p&gt;&#xA;" OwnerUserId="1053" LastActivityDate="2011-07-07T07:28:15.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1413" PostTypeId="2" ParentId="419" CreationDate="2011-07-07T08:15:22.643" Score="1" Body="&lt;p&gt;I think the key here is consistency in your analysis. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would use (and do so for my research) the nearby contract(s) - the daily close and roll over on last day of expiry. From my experience this is the best way to approach analyses such as volatility and comparison between different time series... &lt;/p&gt;&#xA;" OwnerUserId="1053" LastActivityDate="2011-07-07T08:15:22.643" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1414" PostTypeId="2" ParentId="1177" CreationDate="2011-07-07T08:25:49.950" Score="0" Body="&lt;p&gt;It is not the volatility that mean reverts, but the price! The volatility (attempts to) measure the deviations from the &quot;equilibrium&quot; or the &quot;stable price&quot; (even though we might never observe it). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is not really a cyclical behaviour of traders, but one can look at it as a &lt;em&gt;continuous&lt;/em&gt; game of tug of war between the bulls and bears where any player can change sides at any time depending on her perception of future movements of price. &lt;/p&gt;&#xA;" OwnerUserId="1053" LastActivityDate="2011-07-07T08:25:49.950" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1415" PostTypeId="2" ParentId="1233" CreationDate="2011-07-07T08:33:22.987" Score="-1" Body="&lt;p&gt;Hedging against lack of volatility is per definition a spurious concept. Hedging is done exactly to AVOID volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is obvious that during volatile periods there is much more potential to make profits (for speculators) since the frequency of prices going up and down is per definition high(er). &#xA;So hedging against lack of volatility is not possible. And from the above, TIME is the key here. Volatility is basically (quick) changes in prices over (short) periods of time. The only thing one can do is to stretch the time frame by trading further away contracts.&lt;/p&gt;&#xA;" OwnerUserId="1053" LastActivityDate="2011-07-07T08:33:22.987" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1416" PostTypeId="1" CreationDate="2011-07-07T10:35:26.930" Score="12" ViewCount="321" Body="&lt;p&gt;Inputs are most important to any decision making.&#xA;For strategy backtesting, the OHLC data is one of the most inputs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So to ensure the correctness and integrity of OHLC data, we have checks on the following OHLC issues:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Outlier Price&lt;/li&gt;&#xA;&lt;li&gt;Negative Price&lt;/li&gt;&#xA;&lt;li&gt;Corrupted Price (High &amp;lt; Low, etc)&lt;/li&gt;&#xA;&lt;li&gt;Missing minute ticks in 1-min timeframe&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;However, there is a lacking of a standard or methodology to grade the data quality.&#xA;So is there any standard / methodology to determine and grade the quality of the OHLC data?&lt;/p&gt;&#xA;" OwnerUserId="1054" LastActivityDate="2011-07-07T11:01:26.630" Title="Is there a standard / methodology to determine and grade the quality of OHLC data?" Tags="&lt;data&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1417" PostTypeId="2" ParentId="1416" CreationDate="2011-07-07T11:01:26.630" Score="4" Body="&lt;p&gt;I think your list is pretty good, and I doubt there are any &quot;standards&quot; in this space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I tend to do is source the data from multiple places, and compare. This doesn't have to be for the entire period/universe; a sample is often sufficient to figure out what types of problems I am dealing with.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly, there is a chapter in &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0122796713&quot; rel=&quot;nofollow&quot;&gt;&quot;An Introduction to High-Frequency Finance&quot;&lt;/a&gt; devoted to data cleaning (they look at FX tick data).&lt;/p&gt;&#xA;" OwnerUserId="90" LastActivityDate="2011-07-07T11:01:26.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1418" PostTypeId="2" ParentId="1409" CreationDate="2011-07-07T19:02:13.797" Score="1" Body="&lt;p&gt;Try this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Rate_of_return&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Rate_of_return&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="392" LastActivityDate="2011-07-07T19:02:13.797" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1419" PostTypeId="2" ParentId="948" CreationDate="2011-07-08T01:43:07.177" Score="11" Body="&lt;p&gt;I have been using FastBit for a while now and find it to be quite performant. It's very non-intrusive to your existing binary storage format provided your data is stored in a columnar manner. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have briefly tested Tokyo/KyotoCabinet and didnt find it suitable for my (persistent storage) requirements.&lt;/p&gt;&#xA;" OwnerUserId="1057" LastActivityDate="2011-07-08T01:43:07.177" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1420" PostTypeId="1" AcceptedAnswerId="1421" CreationDate="2011-07-08T06:27:57.507" Score="9" ViewCount="723" Body="&lt;p&gt;I've just downloaded quantlib and started playing around with it, and it looks like it's designed primarily to use Euler discretizations for everything -- so far as I can tell, there's not even a method provided to exactly simulate geometric Brownian motion.  Am I missing an obvious feature?  If not, is there a fundamental reason why you wouldn't (ever) want to use exact numerics instead of approximate ones?&lt;/p&gt;&#xA;" OwnerUserId="1061" LastActivityDate="2014-09-22T19:49:18.553" Title="QuantLib and exact numerical simulation" Tags="&lt;numerical-methods&gt;&lt;quantlib&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1421" PostTypeId="2" ParentId="1420" CreationDate="2011-07-08T07:55:57.643" Score="12" Body="&lt;p&gt;Well, actually it's designed to use whatever discretization you throw at it---but for the time being only Euler discretization is implemented, mostly for lack of time or interest on the part of contributors.  If you want to use exact numerics with a process, you can just code the corresponding discretization class (you'll have to inherit from &lt;code&gt;StochasticProcess::discretization&lt;/code&gt;) and pass an instance of your class to the process upon instantiation.  The whole design is described in more detail in chapter 6 at &lt;a href=&quot;http://implementingquantlib.blogspot.com/p/the-book.html&quot; rel=&quot;nofollow&quot;&gt;http://implementingquantlib.blogspot.com/p/the-book.html&lt;/a&gt;, or rather, the half of chapter 6 I've written so far.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Needless to say, if you do write exact discretization, send a patch our way and we'll include it in the library.&lt;/p&gt;&#xA;" OwnerUserId="308" LastEditorUserId="308" LastEditDate="2014-09-22T19:49:18.553" LastActivityDate="2014-09-22T19:49:18.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1422" PostTypeId="1" AcceptedAnswerId="1434" CreationDate="2011-07-08T10:01:58.687" Score="4" ViewCount="252" Body="&lt;p&gt;Where can I find the standard discount curves for the standard CDS model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular I'm keen to see if ZAR is a supported currency yet...&lt;/p&gt;&#xA;" OwnerUserId="1060" LastActivityDate="2011-07-11T17:38:55.203" Title="Where can I find the standard discount curves for the standard CDS model?" Tags="&lt;cds&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1423" PostTypeId="2" ParentId="1270" CreationDate="2011-07-08T15:53:00.867" Score="7" Body="&lt;p&gt;So you want to calculate $\mathbb{P}[B_1 &amp;gt; B_0 + \varepsilon \;|\; A_1 &amp;gt; A_0 + \varepsilon]$?  If you truly have the joint distribution of $A_1$ and $B_1$ and the current prices $A_0$ and $B_0$, this just becomes a simple exercise in integration, by the definition of probability density.  Are you asking how to find a conditional probability in general, or is your question about something else?&lt;/p&gt;&#xA;" OwnerUserId="1061" LastActivityDate="2011-07-08T15:53:00.867" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1424" PostTypeId="1" AcceptedAnswerId="1425" CreationDate="2011-07-08T16:49:08.323" Score="7" ViewCount="1304" Body="&lt;p&gt;This is a follow-up to my previous question regarding anyone whom wanted to &lt;a href=&quot;https://quant.stackexchange.com/questions/1236/do-you-have-historical-tick-data-you-want-to-donate&quot;&gt;'donate' data&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far no one has stepped up &lt;em&gt;(learning more about buying and selling data, I realize that I'm going to have to buy the data if I want to re-sell it, or give it away for that matter - re: licensing agreements?)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I'm trying to determine a good source for data with a &lt;em&gt;relatively flexible licensing&lt;/em&gt; agreement. So far the first place I've found is the &lt;a href=&quot;http://www.cmegroup.com/market-data/distributor/&quot; rel=&quot;nofollow noreferrer&quot;&gt;CME's distributor's service&lt;/a&gt; @ ~$12,000/yr starting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you sell historical data, know of data-feeds, etc., please let me know. I'll add it to this list, and we can discuss the pluses and negatives.&lt;/p&gt;&#xA;" OwnerUserId="913" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2014-05-19T03:10:20.807" Title="Which data service to buy for redistributable data?" Tags="&lt;data&gt;&lt;tick-data&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1425" PostTypeId="2" ParentId="1424" CreationDate="2011-07-08T19:12:38.650" Score="5" Body="&lt;p&gt;I think you're addressing the wrong people.  What I'd do is to talk to the data vendors' marketing departments, much like I'm sure &lt;a href=&quot;http://www.wikiposit.org/&quot; rel=&quot;noreferrer&quot;&gt;http://www.wikiposit.org/&lt;/a&gt; has done.  Tell them you would like to offer (an excerpt of) their data, in a unified/post-processed form, you would be willing to include links back to their sales website, or praise the vendors somehow, e.g. have a voting system for the quality of the data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not a data vendor but I'm sure as long as you make it look like that's the best form of advertising they've ever had you should be able to negotiate a licensing model that allows you to at least show the data on your website.  I imagine this works particularly well with smaller or niche data providers.&lt;/p&gt;&#xA;" OwnerUserId="1040" LastActivityDate="2011-07-08T19:12:38.650" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1427" PostTypeId="1" CreationDate="2011-07-09T18:29:09.747" Score="13" ViewCount="923" Body="&lt;p&gt;What do you think of strategies displayed on &lt;a href=&quot;http://timelyportfolio.blogspot.com&quot;&gt;timelyportfolio.blogspot.com&lt;/a&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I really like the fact that there is some code to reproduce the strategies, but they seem very elementary because he does not control for risk factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By that I mean that you can have a super complex strategy with lots of bells and whistles, &lt;strong&gt;but&lt;/strong&gt; if in the end your strategy is &lt;strong&gt;&lt;em&gt;mostly long&lt;/em&gt;&lt;/strong&gt;, and that for the period you consider the &lt;strong&gt;&lt;em&gt;market is up&lt;/em&gt;&lt;/strong&gt;, you are merely looking at &lt;strong&gt;1&lt;/strong&gt; big point and not 5000 independent samples from your strategy even though you might have this illusion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do professional deal with this, can you point at good papers for it ?&lt;/p&gt;&#xA;" OwnerUserId="172" LastEditorUserId="1106" LastEditDate="2011-09-09T19:20:33.737" LastActivityDate="2011-09-09T23:04:30.857" Title="What are the risk factors in analysing strategies?" Tags="&lt;risk&gt;&lt;backtesting&gt;&lt;quant-trading-strategies&gt;&lt;factor-loading&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1428" PostTypeId="2" ParentId="1427" CreationDate="2011-07-10T02:17:36.463" Score="6" Body="&lt;p&gt;I don't think risk factors are that important here.  This is a simple market timing strategy where you're either fully exposed to the market or not exposed at all.  All he needs to show is that he's adding value above buy-and-hold by all of the in-and-out trading.  &lt;/p&gt;&#xA;" OwnerUserId="1063" LastActivityDate="2011-07-10T02:17:36.463" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="1430" PostTypeId="2" ParentId="942" CreationDate="2011-07-10T22:58:44.487" Score="8" Body="&lt;p&gt;Yahoo's historical data is sometimes missing dividends.  For example:&#xA;&lt;a href=&quot;http://finance.yahoo.com/q/hp?s=VWINX&amp;amp;a=00&amp;amp;b=1&amp;amp;c=2010&amp;amp;d=11&amp;amp;e=20&amp;amp;f=2011&amp;amp;g=v&quot;&gt;http://finance.yahoo.com/q/hp?s=VWINX&amp;amp;a=00&amp;amp;b=1&amp;amp;c=2010&amp;amp;d=11&amp;amp;e=20&amp;amp;f=2011&amp;amp;g=v&lt;/a&gt;&#xA;(VWINX) is missing two dividends for 2011, though it has the ones for 2010.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, this paper:&#xA;  &lt;a href=&quot;http://arxiv.org/PS_cache/arxiv/pdf/1105/1105.2956v1.pdf&quot;&gt;http://arxiv.org/PS_cache/arxiv/pdf/1105/1105.2956v1.pdf&lt;/a&gt;&#xA;from 2010 reports Yahoo finance as missing a dividend in the 2007 data.&lt;/p&gt;&#xA;" OwnerUserId="1066" LastActivityDate="2011-07-10T22:58:44.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1432" PostTypeId="2" ParentId="1424" CreationDate="2011-07-11T13:58:36.333" Score="5" Body="&lt;p&gt;&lt;a href=&quot;http://xignite.com&quot; rel=&quot;noreferrer&quot;&gt;xignite&lt;/a&gt; seems like a cheaper option for historical data at around $6,000 per year.&#xA;I am not a client (yet) so I can't give my opinion but it looks good to me.&#xA;They have a long list of &lt;a href=&quot;http://www.xignite.com/Products/Catalog.aspx&quot; rel=&quot;noreferrer&quot;&gt;services&lt;/a&gt;, a free trial period and interesting pricing model based on the number of queries you send them.&#xA;If you do use them, let us all know.&lt;/p&gt;&#xA;" OwnerUserId="1069" LastActivityDate="2011-07-11T13:58:36.333" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1433" PostTypeId="2" ParentId="1391" CreationDate="2011-07-11T15:50:50.430" Score="22" Body="&lt;p&gt;I did some digging and found the following papers - most of them offering quite a distinct perspective compared to classical option pricing theory!&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1787365&quot; rel=&quot;nofollow noreferrer&quot;&gt;Stock Options as Lotteries by Brian H. Boyer et al. (2011)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1535123&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Efficiency of the Buy-Write Strategy: Evidence from Australia by Tafadzwa Mugwagwa et al. (2010)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The following is my favorite: You could do some backtests on your own with freely available data (using the VXO as volatility information) and with any spreadsheet - easy and elegant:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://web.archive.org/web/20120417044216/http://leeds.colorado.edu/asset/burridge/backtestmadoffsclaims.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;How Students Can Backtest Madoff’s Claims by Michael J. Stutzer (2009)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.isenberg.umass.edu/CISDM/uploads/textWidget/3642.00002/documents/QQQ_Active_Collar_Paper_website_v3.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Loosening Your Collar: Alternative Implementations of QQQ Collars by Edward Szado et al. (2009)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1293203&quot; rel=&quot;nofollow noreferrer&quot;&gt;A Study of Optimal Stock &amp;amp; Options Strategies by Mihir Dash et al. (2008)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=873639&quot; rel=&quot;nofollow noreferrer&quot;&gt;Is There Money to Be Made Investing in Options? A Historical Perspective by James S. Doran et al. (2008)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;EDIT:&lt;br&gt;&#xA;I will update this answer from time to time when new interesting papers arive:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1928822&quot; rel=&quot;nofollow noreferrer&quot;&gt;15 Years of the Russell 2000 Buy-Write by N. Kapadia and E. Szado (2011)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;EDIT 2:&lt;br&gt;&#xA;I just published a blog post where I replicate the abovementioned paper by Stutzer (2009):&lt;br&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://blog.ephorie.de/backtesting-options-strategies-with-r&quot; rel=&quot;nofollow noreferrer&quot;&gt;Backtesting Options Strategies with R&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;In the post, I provide the fully documented R code for your own experiments. For details please consult the post.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2021-04-14T09:22:26.263" LastActivityDate="2021-04-14T09:22:26.263" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="1434" PostTypeId="2" ParentId="1422" CreationDate="2011-07-11T17:38:55.203" Score="2" Body="&lt;p&gt;According to the data &lt;a href=&quot;http://www.cdsmodel.com/assets/cds-model/docs/Interest%20Rate%20Curve%20-%20XML%20Specifications.pdf&quot; rel=&quot;nofollow&quot;&gt;spec&lt;/a&gt;, currencies published only include USD, GBP, EUR, JPY, CHF, CAD, AUD, NZD, SGD, and HKD.&lt;/p&gt;&#xA;" OwnerUserId="1039" LastActivityDate="2011-07-11T17:38:55.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1435" PostTypeId="1" AcceptedAnswerId="30599" CreationDate="2011-07-12T13:35:53.133" Score="8" ViewCount="5403" Body="&lt;p&gt;I need to model the market value of CDS in a portfolio. My current approach is to calculate the present value of the future spread payments - does anybody have a better idea to solve the problem? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&#xA;I calculated the spread in the following way (as in Hull-White):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$PV_{surv} = \sum_{i=1}^T {(1−p_d )^i \cdot e^{-y\cdot i }}; $ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$PV_{def}=\sum_{i=1}^{t}{p_d \cdot (1-p_d)^{i-1} \cdot (1-R)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$s=PV_{def}/PV_{surv}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2nd edit: I found the following statement: &#xA;&lt;a href=&quot;http://www.yieldcurve.com/Mktresearch/files/Abukar_Dissertation_Sep05.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.yieldcurve.com/Mktresearch/files/Abukar_Dissertation_Sep05.pdf&lt;/a&gt;&#xA;&quot;the market value of a cds is the difference between the two legs&quot;, leading to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$MV_{CDS} = s\cdot PV_{surv} - PV_{def}$&lt;/p&gt;&#xA;" OwnerUserId="357" LastEditorUserId="357" LastEditDate="2011-07-28T17:39:08.033" LastActivityDate="2017-12-01T13:23:16.020" Title="Market Value of a CDS" Tags="&lt;pricing-formulae&gt;&lt;cds&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1436" PostTypeId="2" ParentId="141" CreationDate="2011-07-12T19:18:33.357" Score="6" Body="&lt;p&gt;Futures and Forex:&#xA;&lt;a href=&quot;http://www.tradingblox.com/?page_id=218&quot; rel=&quot;nofollow&quot;&gt;http://www.tradingblox.com/?page_id=218&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indicies, Forex, Futures:&#xA;&lt;a href=&quot;http://pitrading.com/free_market_data.htm&quot; rel=&quot;nofollow&quot;&gt;http://pitrading.com/free_market_data.htm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Commodities, Forex, Stocks, Interest Rates, Mutual Funds, Hedge Funds and more:&#xA;&lt;a href=&quot;http://www.wikiposit.com&quot; rel=&quot;nofollow&quot;&gt;http://www.wikiposit.com&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="508" LastEditorUserId="508" LastEditDate="2013-06-04T00:26:30.963" LastActivityDate="2013-06-04T00:26:30.963" CommentCount="1" CommunityOwnedDate="2011-07-12T19:18:33.357" ContentLicense="CC BY-SA 3.0" />
  <row Id="1437" PostTypeId="2" ParentId="1427" CreationDate="2011-07-12T23:44:19.803" Score="8" Body="&lt;p&gt;Glad people are reading. Simple with more history in terms of time and indexes is better in my book.  I have spent 13 years reading over 200 research papers, incorporating complicated and advanced techniques, and studying very reputable buy side research with no improvement in results.  Readers are on their own to extend to lots of markets including Nikkei with 90% drawdown over 20 years.  Also equity markets have an upward bias making reliable robust  shorting techniques extremely difficult.  I save the currency, bond, and commodity markets with long term mean reversion and no upward bias for potential shorts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See and hear Emmanuel Derman for much more discussion from someone who knows far better than me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Absolutely love the discussion.  Look forward to reading other responses.&lt;/p&gt;&#xA;" OwnerUserId="1070" LastActivityDate="2011-07-12T23:44:19.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1438" PostTypeId="2" ParentId="1435" CreationDate="2011-07-12T23:58:55.990" Score="3" Body="&lt;p&gt;I'm not expert.  However, it seems clear that you're generating an upper bound on the seller value.  You have to model the risk of default, as well as any convenantal terms for structured default, to generate an expected payout rate, and deduct that from the DCFs, to get a more realistic value. If the terms include a swap put model that separately. To set a bid, you need to model counter-party and (ideally) liquidity risk as well.  You might want to read the standard: &lt;a href=&quot;http://www.cdsmodel.com/&quot; rel=&quot;nofollow&quot;&gt;http://www.cdsmodel.com/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1071" LastEditorUserId="1071" LastEditDate="2011-07-13T02:00:42.827" LastActivityDate="2011-07-13T02:00:42.827" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1439" PostTypeId="1" AcceptedAnswerId="1440" CreationDate="2011-07-13T10:00:48.143" Score="13" ViewCount="3521" Body="&lt;p&gt;I am preparing a QuantFinance lecture and I am looking for the easiest and most accessible derivation of the Black-Scholes formula (NB: the &lt;em&gt;actual&lt;/em&gt; formula, &lt;em&gt;not&lt;/em&gt; the differential equation).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My favorite at the moment is&lt;br&gt;&#xA;&lt;a href=&quot;http://arxiv.org/abs/physics/0612022&quot;&gt;Intuitive Proof of Black-Scholes Formula Based on Arbitrage and Properties of Lognormal Distribution by Alexei Krouglov&lt;/a&gt;&lt;br&gt;&#xA;which uses the truncated or partial lognormal distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would love to see derivations which are even easier - Thank you!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;br&gt;&#xA;The course is for beginners. It is business administration, so the math level is undergraduate.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2011-07-13T12:47:18.987" LastActivityDate="2013-06-10T15:21:58.803" Title="Easiest and most accessible derivation of Black-Scholes formula" Tags="&lt;intuition&gt;&lt;black-scholes&gt;&lt;derivation&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="1440" PostTypeId="2" ParentId="1439" CreationDate="2011-07-13T12:17:11.527" Score="8" Body="&lt;p&gt;You should look at Paul Willmott's &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470748753&quot;&gt;Frequently Asked Questions In Quantitative Finance&lt;/a&gt;.&#xA;He offers 12 (I think) ways of deriving BS and I think you'll find what you look for there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The cool thing is that you really have many different &lt;em&gt;approaches&lt;/em&gt;; one is the classic PDE, one is done using change of measure, one is done using binary trees, and so on....&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Really worth it. And the book is very useful to introduce complicated topics to beginners.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2011-07-13T15:02:44.067" LastActivityDate="2011-07-13T15:02:44.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1441" PostTypeId="2" ParentId="1110" CreationDate="2011-07-13T14:54:48.457" Score="2" Body="&lt;p&gt;Eurodollar options (and STIR options in general) are options on the RATE, so you have to transform the strike and underlying futures prices to yields as you mentioned (100-x)/100 AND you have to switch puts and calls. Also remember they are American exercise, although that's not very important these days. The volatilities are on the rates (log-relative returns). In Bloomberg, you have to use a lognormal model and no other models are provided. But many practitioners use other models and quote the 'normal' (basis point) vols instead of the Black-Scholes vols.&lt;/p&gt;&#xA;" OwnerUserId="1075" LastActivityDate="2011-07-13T14:54:48.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1442" PostTypeId="1" AcceptedAnswerId="1443" CreationDate="2011-07-14T02:21:57.073" Score="10" ViewCount="9957" Body="&lt;p&gt;Two popular ways to measure returns are Arithmetic returns and Log returns. Let's define arithmetic (simple period) returns as: P(t) - P(t-1) / P(t-1). Let's define log return as Ln( P(t)/P(t-1) ) or equivalently Ln(1 + arithmetic return).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The log returns have nice properties -- logarithmic returns prevents security prices from becoming negative; we can interpret log returns as continuously compounded returns; they are approximately equal to simple returns at small values; if the security price follows Brownian motion then the log returns are normally distributed; logs convert products into sums. Jorion (2001) has a brief description of the properties and application of the log description (pg. 94): &lt;a href=&quot;http://books.google.com/books?id=nnblKhI7KP8C&amp;amp;lpg=PA75&amp;amp;pg=PA94#v=onepage&amp;amp;q&amp;amp;f=false&quot;&gt;Jorion 2001&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say a security lost 1% (simple return) today. We would like to annualize this daily return (as it is an input to some risk model whose outputs we would like on an annualized basis). So: Ln(1 -.01) * 251 trading days = -2.52 annualized return. However, a security cannot lose more than 100% of its value. How do we explain this outcome (i.e. what is the right operation such that the lower bound on the log return is &gt; -1)?&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-07-14T05:59:16.247" LastActivityDate="2019-10-16T08:50:35.637" Title="Annualzing the log of daily returns riddle" Tags="&lt;volatility&gt;&lt;risk&gt;&lt;returns&gt;&lt;statistics&gt;&lt;lognormal&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="1443" PostTypeId="2" ParentId="1442" CreationDate="2011-07-14T05:26:33.403" Score="9" Body="&lt;p&gt;You're forgetting that -2.52 is still in natural logarithm terms. So the correct answer is 2.71828183 raised to the -2.52 power which equals 0.08. Your ending portfolio value is 8% of what it was a year ago.&lt;/p&gt;&#xA;" OwnerUserId="352" LastActivityDate="2011-07-14T05:26:33.403" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1447" PostTypeId="1" AcceptedAnswerId="1449" CreationDate="2011-07-14T13:25:51.143" Score="-1" ViewCount="1533" Body="&lt;p&gt;Can someone please explain to me how we are in debt with China? Every weblog, article, journal I read have people in the comments going insane about how we &quot;owe China monies&quot; and &quot;China owns the US&quot; or how the world is being taken over by China!!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From my understanding we sell bonds to the open market (like most countries and businesses) and China is just one country in a laundry-list of countries that buy these bonds. These bonds are also NOT the same as debt right? I just don't know why people say that we &quot;owe too much money to china&quot; What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="1084" LastActivityDate="2017-04-24T20:26:17.607" Title="Please Explain the Debt to China" Tags="&lt;china&gt;&lt;money-management&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ClosedDate="2011-07-14T19:47:24.803" ContentLicense="CC BY-SA 3.0" />
  <row Id="1448" PostTypeId="1" CreationDate="2011-07-14T13:29:12.150" Score="7" ViewCount="273" Body="&lt;p&gt;I am looking for papers that would describe asset allocation with geometry, group theory, markov chains or things like that. Keeping asset allocation in a range is easy but to keep it more precisely is harder. I find it often hard to judge things such as evaluation of trading costs and cause-effect -relationship (particularly when the relationships are long).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are some phases or states which I would like to control better:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Cash is liquid which can change to any other asset with 2 phase: holding cash and buy another asset. &lt;/li&gt;&#xA;&lt;li&gt;The change of a fund requires that you sell it first to cash and then to your indented fund -- 3 phase. &lt;/li&gt;&#xA;&lt;li&gt;Changing fund to the better, 3phase but too expensive better to keep the old.&lt;/li&gt;&#xA;&lt;li&gt;much more phases!&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Reference material appreciated.&lt;/p&gt;&#xA;" OwnerUserId="956" LastEditorUserId="956" LastEditDate="2011-07-14T13:50:01.927" LastActivityDate="2011-07-23T20:55:12.450" Title="Reference material about  Quantified Asset Allocation?" Tags="&lt;asset-allocation&gt;&lt;reference-request&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1449" PostTypeId="2" ParentId="1447" CreationDate="2011-07-14T14:03:51.527" Score="10" Body="&lt;p&gt;This is roughly what countries own US treasuries:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.treasury.gov/resource-center/data-chart-center/tic/Documents/mfh.txt&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.treasury.gov/resource-center/data-chart-center/tic/Documents/mfh.txt&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see China owns a lot.  In fact they own way more than any other nation.  Why does China own so many?  Because of the trade deficit between the US and China.  What's that?  China has gotten all of it's fortune by being the factory that makes things for other companies.  China is the factory of the world.  Hence whenever a product in the world is created more than likely the Chinese had some hand in building it.  Every IPod, IPad, Android Phone, etc sold has to be bought from China because they made it.  The act of buying those products produced outside your countries borders is called importing.  The USA imports goods from China.  Now in theory the USA should be manufacturing things that China wants and hence because we are in a good trade relationship (we're not again theory), China would buy things from us that we manufacture.  Say cars, windows software, mac os software, etc.  The fact of the matter is that the US is buying way more stuff from China than they are buying from the US.  This creates a the trade deficit.  A trade deficit means more money is moving out of the USA and into China.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does a nation get rich?  By exporting more than they import.  Across all of it's trading partners the USA is importing vastly more than exporting.  In fact the USA can't really pay for everything it's importing each year, and the US government is running debt over it's spending thanks to social security (funded, but poorly), medicare (not directly funded - big problem), and the military (DOD spending accounts for ~60% of all government spending).  So to cover these losses it has to borrow money from the Treasury.  When the US borrows money from the Treasury it issues that in terms of US Treasury bonds.  A bond says 'Let me have $100 today, and I'll pay you back $103 tomorrow.'  In order for the US to pay its debts someone has to buy our bonds to get that $100.  Who is doing that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well China is making tons of money.  Where do they park that money so it can grow and earn interest?  Countries aren't like you and I in this regard.  They don't hop down to bank and dump their money in there.  Instead they buy debt from other countries.  The best debt and most stablest debt in the world is US Treasury Debt because they've never defaulted and they are the richest country in the world.  Because of that their currency is really predictable and doesn't have crazy inflation.  To protect that money China owns &lt;strong&gt;China buys US Treasury bonds&lt;/strong&gt;.  And they've been doing this for 40 years or more.  So US is buying China's goods with China's money and promising to pay China back at a later date.  China is happy to do this because they can safely earn an almost guaranteed interest on their money keeping it safe from inflation.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another reason China does this, and really the primary reason is to keep their inflation low.  When China sells goods into the US it gets paid in dollars, but ultimately it wants Renminbi so under normal circumstances it would exchange dollars for Renminbi and then import that money back into China.  When this happens it will raise the demand for Renminbi, and trade will balance out as China's currency rises.  This eliminates trade imbalances, except that China doesn't do that.  They've been buying US bonds from dollars they have rather than buying Renminbi.  This keeps the money out of the China banking system so it doesn't experience inflation.  That is how China &quot;manipulates&quot; their currency is by buying foreign bonds keeping the money from causing inflation in their country.  China has dialed back their rate of buying US bonds around 2013 or 2014 so they are letting their currency rise more than in the past.  They really aren't manipulating their currency like they were in the past.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is why the argument over the debt ceiling is really really important.  The debt ceiling is what allows the US government to keep borrowing money.  There is a US law that says the US government will never borrow more than X.  And they rewrite that law every time the US needs to borrow more than X (it's been rewritten a lot &lt;strike&gt;for like 30 years&lt;/strike&gt; since 1980s - except for 1998-2001 where it ran surpluses).  They are in the process of rewriting that law now to up the debt ceiling to Y, and they're playing an ideological war over all the shit they argue about.  In the end they have to raise it because there is no other option, but they're playing a game of chicken with each other.  If they didn't we would default on paying back debt.  Essentially, the holders of those US bonds wouldn't get $103 back, and they'd be really super pissed off.  This could cause US holders of debt to rethink it call in early payment on that debt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If China decides to call in the debt the US has to pay them and would have a shortage of funds to pay that debt.  The US would be absolutely screwed.  Remember the US doesn't have any money because it's been selling US bonds to get money, so the US can't get money because it just defaulted on the one thing that brings in the money.  And who's gonna want to buy them?  If this came to pass and it would ruin the USA.  This would be financial system Armageddon because China (and others) owns so much of our money.  We owe them so much money that we'd never pay them back for the next century or two.  That kind of debt is basically financial slavery.  We're talking 100 years of the Great Depression type conditions.  Huge inflation, US money would be worthless.  It'd make Zimbabwe look like a stable investment.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now what holds this altogether is that having the US falter like that would take everyone down because everyone looses their money.  US owes everyone so every dollar we make of GDP would go right out the window to our debt holders, and their savings would be obliterated because we defaulted.  This is the end of the world as we know it type stuff should it come to pass.&lt;/p&gt;&#xA;" OwnerUserId="1085" LastEditorUserId="1085" LastEditDate="2017-04-24T20:26:17.607" LastActivityDate="2017-04-24T20:26:17.607" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="1451" PostTypeId="2" ParentId="1448" CreationDate="2011-07-14T21:13:23.347" Score="4" Body="&lt;p&gt;I think you might be interested by an article I mentioned in this &lt;a href=&quot;https://quant.stackexchange.com/questions/1343/measuring-liquidity/1344#1344&quot;&gt;post&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Carlo Acerbi from MSCI presents in this &lt;a href=&quot;http://www.prmia.org/Chapter_Pages/Geneva/talks/20101201GenevaPRMIA.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;presentation&lt;/a&gt; an innovative approach to liquidity risk. The idea is basically to model how liquid an asset is and how your portfolio allocation should take this risk into account.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This way of seeing risk is in my opinion pretty interesting an quite brilliant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hopefully, it'll be the kind of theory you're looking for.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2011-07-14T21:13:23.347" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="1452" PostTypeId="1" AcceptedAnswerId="1453" CreationDate="2011-07-15T06:27:32.497" Score="8" ViewCount="424" Body="&lt;p&gt;I want to use the following stochastic model&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\mathrm{d}S_{t}}{ S_{t}} = k(\theta - \ln S_{t}) \mathrm{d}t + \sigma\mathrm{d}W_{t}\quad (1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;using the change in variable $Z_t=ln(S_t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;we obtain the following SDE&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathrm{d}Z_{t} = k(\theta - \frac{\sigma^2}{2k} - Z_{t}) \mathrm{d}t + \sigma\mathrm{d}W_{t}\quad (2)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;again we change variable $X_t=e^{kt}Z_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;we obtain the following SDE&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathrm{d}X_t = k(\theta -\frac{\sigma^2}{2k})e^{kt}\mathrm{d}t + \sigma e^{kt}\mathrm{d}W_{t} \quad (3)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This last equation can be integrated easily and we see that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$(X_{t+1}-X_t)\sim N(\mu, \sigma)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is:&#xA;How can I get the ditribution of $\frac{S_{t+1}-S_{t}}{ S_{t}}$ ? (at least its expectation and standard deviation under filtration $F_t$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we come back to the first equation it seams that if $\mathrm{d}t$ is small enough then it is a normal distribution with mean $k(\theta - \ln S_{t}) \mathrm{d}t$ and sd $\sigma\mathrm{d}t$, but I want to find mathematically if it is true, and if yes, under what assumptions.&lt;/p&gt;&#xA;" OwnerUserId="134" LastEditorUserId="399" LastEditDate="2011-07-19T10:57:21.083" LastActivityDate="2011-07-19T10:57:21.083" Title="Obtaining characteristics of stochastic model solution" Tags="&lt;stochastic-calculus&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1453" PostTypeId="2" ParentId="1452" CreationDate="2011-07-15T08:30:38.443" Score="4" Body="&lt;p&gt;I've edited my answer since Berr4All showed that your equation is right.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you still can do - is to use &lt;a href=&quot;http://en.wikipedia.org/wiki/Fokker%E2%80%93Planck_equation&quot; rel=&quot;nofollow&quot;&gt;Fokker-Planck equation&lt;/a&gt; to derive a density.&lt;/p&gt;&#xA;" OwnerUserId="464" LastEditorUserId="464" LastEditDate="2011-07-18T14:20:27.807" LastActivityDate="2011-07-18T14:20:27.807" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="1454" PostTypeId="2" ParentId="1452" CreationDate="2011-07-15T09:23:42.630" Score="3" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;1 ) A first-order Taylor expansion gives $\ln \left(\frac{S_{t+\Delta_t}}{S_t}\right)\approx \frac{S_{t+\Delta_t}-S_{t}}{S_t}+o(\Delta_t)$ , thus unless $\Delta_t$ is not small you can drop the residual term and consider $Z_t\overset{law}{=}\frac{S_{t+\Delta_t}-S_{t}}{S_t}$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;2 ) Calculation of the moments: we can proceed by using the classical Dynkin way&lt;/p&gt;&#xA;&#xA;&lt;p&gt;we remind that $dZ_t=k(\theta-\frac{\sigma^2}{2k}-Z_t)dt+\sigma dW_t$, so&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d(Z_t^p)\overset{It&amp;#244;}{=}p\cdot(Z_t)^{p-1}dZ_t+\frac{\sigma^2}{2}dt =  \left(\frac{\sigma^2}{2}+ Z_t^{p-1}\cdot{pk(\theta-\frac{\sigma^2}{2k})-Z_t^p\cdot pk} \right)dt+p\sigma Z_t^{p-1}dW_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;taking the expectation,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E\left( Z_t^p \right)=E\left( Z_0^p \right)+\int_0^t\left(\frac{\sigma^2}{2}+ E(Z_s^{p-1})\cdot{pk(\theta-\frac{\sigma^2}{2k})-E(Z_s^p)\cdot pk} \right)ds$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;finally:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E\left( Z_t^p \right)=E\left( Z_0^p \right)+\frac{\sigma^2}{2}t+pk(\theta-\frac{\sigma^2}{2k}) \int_0^t E(Z_s^{p-1})ds-pk \int_0^tE(Z_s^p)ds  $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so, your p-&lt;em&gt;th&lt;/em&gt; moment is the solution of the above deterministic ODE which can be solved step-by-step starting $p=1$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;3 ) Exact distribution of the yield: in general it's far to be simple to get exact distribution/ simulation for diffusions (and more for multidimensional SDE's -- example: Heston's joint SDE has an exact pdf which computation requires Malliavin calculus).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, in my opinion unless you are considering simulations with large time step it would be useless to deal with the exact distribution of your SDE.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="539" LastEditorUserId="539" LastEditDate="2011-07-15T09:40:28.087" LastActivityDate="2011-07-15T09:40:28.087" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1455" PostTypeId="1" CreationDate="2011-07-15T15:51:28.063" Score="-2" ViewCount="870" Body="&lt;p&gt;I'm looking to find a service that will allow me to download historical data on stocks, bonds, options, futures, indices, etc and also to pick up new files either on a daily or weekly basis. I've been a software engineer for a couple of years now but I'm new the world of quantitative finance. I've purchased a few books on portfolio theory and I'd like some play data on which to test out some of these ideas and techniques. I've seen a number of different sites that offer data either for free or for a small monthly fee. I'm considering using a company called EOD Data (http://www.eoddata.com/) but there are seemingly countless sites out there that offer market data, how do I go about choosing the best one? For my needs, which is only access to market data, how do I go about evaluating the sites so I can get the best quality for my very limited budget? Does anyone have experience using EOD Data or a similar service?&lt;/p&gt;&#xA;" OwnerUserId="914" LastEditorUserId="467" LastEditDate="2011-07-16T14:56:54.747" LastActivityDate="2014-01-09T21:34:05.710" Title="Market Data For Project" Tags="&lt;data&gt;&lt;backtesting&gt;" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1457" PostTypeId="2" ParentId="1455" CreationDate="2011-07-16T03:01:56.243" Score="2" Body="&lt;p&gt;What language or statistical package are you planning on using? There are multiple free options available. If you are thinking R, then you can just use yahoo finance and directly download the data into the R console. There is plenty of sample code available on the internet and also, this forum.&lt;/p&gt;&#xA;" OwnerUserId="428" LastActivityDate="2011-07-16T03:01:56.243" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1458" PostTypeId="2" ParentId="1455" CreationDate="2011-07-16T17:16:50.893" Score="3" Body="&lt;p&gt;@chrisaycock agreed that is the most common question (I'm guilty of it myself) -- I realized that even some of my questions were better answered by looking at other posts where people had thrown in their 2 cents.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;@miggety &lt;em&gt;I've been researching the availability of data for some time as I wanted to create a model 'free data' web-service (similar to ones that have existed in the past) I even have been trying to get people to donate date (no luck there).&lt;/em&gt; &lt;strong&gt;So I'm in the process of saving money to purchase a service I can redistribute...not cheap!!!!&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically the more accuracy and breadth of data (number of markets, order-depth, etc.) you want the more your going to pay! I &lt;em&gt;recommend&lt;/em&gt; that you buy a 1-off historical package from one of the smaller data providers (names of which are widely avaliable on here), and than possibly if you need live market data, subscribing to a 'web-service' based service &lt;a href=&quot;http://www.xignite.com/Products/Catalog.aspx&quot; rel=&quot;nofollow&quot;&gt;xgnite&lt;/a&gt; has a pretty wide offering of services that are reasonably priced.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe you should list how much your willing to spend, and what amount of data you need (markets, depth, etc.) and people can give you a better idea if it's possible?&lt;/p&gt;&#xA;" OwnerUserId="913" LastEditorUserId="913" LastEditDate="2011-07-16T17:23:33.510" LastActivityDate="2011-07-16T17:23:33.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1459" PostTypeId="2" ParentId="1409" CreationDate="2011-07-18T02:02:20.327" Score="0" Body="&lt;p&gt;You can have a look at &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Autoregressive_integrated_moving_average&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Autoregressive_integrated_moving_average&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I doubt you'll have very good results as it is a very naive technique.&lt;/p&gt;&#xA;" OwnerUserId="134" LastActivityDate="2011-07-18T02:02:20.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1460" PostTypeId="2" ParentId="1027" CreationDate="2011-07-18T09:55:49.820" Score="19" Body="&lt;p&gt;Correlation is much more widely used concept and it has much more &amp;quot;informal&amp;quot; meanings. If we have only two random variables &lt;span class=&quot;math-container&quot;&gt;$X$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$Y$&lt;/span&gt; then correlation is simply a measure of linear dependence between the two variables:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$corr(X,Y)=\frac{cov(X,Y)}{\sqrt{var(X)var(Y)}}=\frac{EXY-EX\cdot EY}{\sqrt{var(X)var(Y)}}$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;If correlation is -1 or 1 then the two variables are perfectly linearly related, i.e. there exists real numbers &lt;span class=&quot;math-container&quot;&gt;$a,b,c$&lt;/span&gt; for which&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$P(aX+bY=c)=1$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;The correlation is called a measure of linear dependence since if we standartize &lt;span class=&quot;math-container&quot;&gt;$X$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$Y$&lt;/span&gt; (subtract the means and divide by standard deviations) then the correlation is the solution for the following&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$cor(X,Y)=argmin_a(E(Y-aX)^2)$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;So if &lt;span class=&quot;math-container&quot;&gt;$cor(X,Y)=0$&lt;/span&gt; then you can say that there is no way to explain &lt;span class=&quot;math-container&quot;&gt;$Y$&lt;/span&gt; using linear combination of &lt;span class=&quot;math-container&quot;&gt;$X$&lt;/span&gt;. For &lt;a href=&quot;https://en.wikipedia.org/wiki/Normally_distributed_and_uncorrelated_does_not_imply_independent&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;em&gt;jointly&lt;/em&gt;&lt;/a&gt; Gaussian random variables this have stronger implications, if correlation is zero, then the Gaussian random variables are independent.&lt;/p&gt;&#xA;&lt;p&gt;When we have time series then we have more than two variables. Each time series is a sequence of random variable &lt;span class=&quot;math-container&quot;&gt;$\{X_t,t=1,2,...\}$&lt;/span&gt;. Naturally we can calculate correlation between any two time periods &lt;span class=&quot;math-container&quot;&gt;$corr(X_t,X_s)$&lt;/span&gt;. This gives us a lot of correlations for one time series, which are characterised by correlation function &lt;span class=&quot;math-container&quot;&gt;$r(t,s)=corr(X_t,X_s)$&lt;/span&gt;. Now if this function depends only on the difference &lt;span class=&quot;math-container&quot;&gt;$t-s$&lt;/span&gt;, i.e &lt;span class=&quot;math-container&quot;&gt;$r(t,s)=r(t-s)$&lt;/span&gt; then the time series &lt;span class=&quot;math-container&quot;&gt;$X_t$&lt;/span&gt; are called stationary (to be precise this is called weak stationarity and also requires that &lt;span class=&quot;math-container&quot;&gt;$EX_t$&lt;/span&gt; should be constant, to be more precise the definition of stationarity actually involves the covariance not the correlation).&lt;/p&gt;&#xA;&lt;p&gt;Now if we introduce another time series &lt;span class=&quot;math-container&quot;&gt;$Y_t$&lt;/span&gt; we again can define a lot of correlations &lt;span class=&quot;math-container&quot;&gt;$corr(X_t,Y_s)$&lt;/span&gt;. And again we can define stationarity. Now for stationary series &lt;span class=&quot;math-container&quot;&gt;$(X_t,Y_t)$&lt;/span&gt; the correlation &lt;span class=&quot;math-container&quot;&gt;$corr(X_t,Y_t)$&lt;/span&gt; does not depend on &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt;, so as in simple two random variables case we can talk about linear relationship between &lt;span class=&quot;math-container&quot;&gt;$X_t$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$Y_t$&lt;/span&gt;. Note that in time series case we still have a lot of correlations left: &lt;span class=&quot;math-container&quot;&gt;$corr(X_t,Y_t+h)$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$h=...,-1,0,1,...$&lt;/span&gt;, which can be interpreted as a measure of linearity between past and future values of times series &lt;span class=&quot;math-container&quot;&gt;$X_t$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$Y_t$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;And only now we can introduce the concept of cointegration. The stationary time-series are called integrated of order 0. If the &lt;strong&gt;difference&lt;/strong&gt; of the time series is stationary then such time series are called integrated of order 1.&lt;/p&gt;&#xA;&lt;p&gt;Integrated time-series are non-stationary, so for example &lt;span class=&quot;math-container&quot;&gt;$corr(X_t,Y_t)$&lt;/span&gt; for integrated time series depend on &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt;, which is not so nice. If for example we have highly correlated stationary processes knowing the fact that the correlation does not depend on time we can forecast one process with high accuracy knowing the values of the other. This does not hold for integrated time-series. Of course we can difference the integrated time series to get the stationary time series but if we difference them we can only investigate so call short-term dynamics, i.e. what happens now or in the near future (here we measure the time in numbers of time periods, short-term usualy mean 1-10 time periods).&lt;/p&gt;&#xA;&lt;p&gt;Now finally we can introduce the definition of cointegration. The &lt;strong&gt;integrated&lt;/strong&gt; (of order 1) time-series &lt;span class=&quot;math-container&quot;&gt;$X_t$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$Y_t$&lt;/span&gt; are called &lt;strong&gt;cointegrated&lt;/strong&gt; if their linear combination &lt;span class=&quot;math-container&quot;&gt;$aX_t+bY_t$&lt;/span&gt; is stationary. Since stationarity property remains if we multiply the time series by the constant we get that &lt;span class=&quot;math-container&quot;&gt;$Y_t-a/(-b)X_t$&lt;/span&gt; is stationary. Which in turns gives us&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$Y_t=cX_t+\varepsilon_t$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;where &lt;span class=&quot;math-container&quot;&gt;$\varepsilon_t$&lt;/span&gt; is a stationary time-series and &lt;span class=&quot;math-container&quot;&gt;$c$&lt;/span&gt; is apropriate constant. This is again useful for predicting what happens to &lt;span class=&quot;math-container&quot;&gt;$Y_t$&lt;/span&gt; if we know &lt;span class=&quot;math-container&quot;&gt;$X_t$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$\varepsilon_t$&lt;/span&gt; does not vary too much. Note that this relationship holds for all &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$c$&lt;/span&gt; can be estimated having the apropriate data since it does not depend on &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The confusion between correlation and cointegration might arise from the fact that for &lt;strong&gt;stationary&lt;/strong&gt; time series &lt;span class=&quot;math-container&quot;&gt;$Y_t$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$X_t$&lt;/span&gt; the exact same relationship holds:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$Y_t=cX_t+\varepsilon_t$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;where &lt;span class=&quot;math-container&quot;&gt;$\varepsilon_t$&lt;/span&gt; is a stationary process. Furthermore if we try to estimate &lt;span class=&quot;math-container&quot;&gt;$c$&lt;/span&gt; using the data it can be shown that if we increase the number of data points indefinitely, the estimate for &lt;span class=&quot;math-container&quot;&gt;$c$&lt;/span&gt; will converge to some meaningful number, which for example in case where &lt;span class=&quot;math-container&quot;&gt;$X_t$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$Y_t$&lt;/span&gt; are zero mean unit variance time series will be exactly the correlation &lt;span class=&quot;math-container&quot;&gt;$corr(X_t,Y_t)$&lt;/span&gt; (which for stationary series is the constant, as discussed previously).&lt;/p&gt;&#xA;&lt;p&gt;Note that this will not hold for cointegrated time series: although &lt;span class=&quot;math-container&quot;&gt;$c$&lt;/span&gt; can be estimated, it in general will not be correlation &lt;span class=&quot;math-container&quot;&gt;$corr(X_t,Y_t)$&lt;/span&gt;, since &lt;span class=&quot;math-container&quot;&gt;$X_t$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$Y_t$&lt;/span&gt; are integrated (the special particular case is discussed in the link below). The story becomes worse for integrated time series, which are not cointegrated. Then the same estimate for &lt;span class=&quot;math-container&quot;&gt;$c$&lt;/span&gt; which has nice properties and interpretations under stationarity and cointegration becomes meaningless. For more mathematical details what exactly happens in this case you can look at my post in &lt;a href=&quot;https://stats.stackexchange.com/questions/7376/does-correlation-assume-stationarity-of-data/7378#7378&quot;&gt;stats.SE&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I hope this answer is useful. I intentionally sacrificed some mathematical strictness for better clarity, hopefully not too much.&lt;/p&gt;&#xA;" OwnerUserId="399" LastEditorUserId="6858" LastEditDate="2021-04-18T20:38:26.980" LastActivityDate="2021-04-18T20:38:26.980" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="1461" PostTypeId="2" ParentId="985" CreationDate="2011-07-18T11:55:10.347" Score="8" Body="&lt;p&gt;Two &lt;strong&gt;integrated&lt;/strong&gt;  series $X_t$ and $Y_t$ are &lt;strong&gt;cointegrated&lt;/strong&gt; if their linear combination (some, not any) $\alpha X_t+\beta Y_t$ is stationary. If you have $P(X_t=Y_t)=1$ for all $t$, then $P(\alpha X_t+\beta Y_t=(\alpha+\beta) X_t)=1$. So according to definition of cointegration $(\alpha+\beta) X_t$ should be stationary, which is identical to $X_t$ being stationary. And here we get the contradiction, since $X_t$ is integrated, hence not stationary. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This was a basic explanation why you received your result. However a lot depends on how the actual statistic is computed. For other statistics or their software implementations you might get that two identical series are cointegrated, but that will not mean that they are. Two identical time series are the degenerate case which no-one checks against, and with degenerate cases you can always get unexpected results. &lt;/p&gt;&#xA;" OwnerUserId="399" LastEditorUserId="399" LastEditDate="2012-10-11T07:18:42.687" LastActivityDate="2012-10-11T07:18:42.687" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="1462" PostTypeId="1" AcceptedAnswerId="1502" CreationDate="2011-07-18T16:19:33.710" Score="22" ViewCount="12546" Body="&lt;p&gt;I've got a quanitative trading model I want to test out in the real stock market.  Right now, I'm writing some code to pull &quot;live&quot; quotes from yahoo, feed them to my model, and keep track of the trades my model makes.  However, I feel like I'm re-investing the wheel. Sites like &lt;a href=&quot;http://simulator.investopedia.com/Home.aspx&quot;&gt;Investopedia&lt;/a&gt; have free stock trading &quot;simulators&quot; and I was wondering if there were any sites like this that also provide a free api.  I'm primarily interesting in 3 things:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Web service that I can interact with by GETing a url (i.e. www.site.com/?trade&amp;amp;id=1234&amp;amp;pw=abcd&amp;amp;action=BUY&amp;amp;shares=100)&lt;/li&gt;&#xA;&lt;li&gt;Supports placing orders&lt;/li&gt;&#xA;&lt;li&gt;Can return current positions&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Or is this too much to ask for a free service?&lt;/p&gt;&#xA;" OwnerUserId="500" LastActivityDate="2014-02-24T00:05:41.190" Title="Free paper trading site with an API" Tags="&lt;automated-trading&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="1463" PostTypeId="2" ParentId="1462" CreationDate="2011-07-18T16:27:09.593" Score="2" Body="&lt;p&gt;You might want to look into &lt;a href=&quot;http://www.tradery.com/&quot; rel=&quot;nofollow&quot;&gt;Tradery&lt;/a&gt; as I think it allows you to run a test system for free (including back-testing).&lt;/p&gt;&#xA;" OwnerUserId="1091" LastActivityDate="2011-07-18T16:27:09.593" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1464" PostTypeId="1" CreationDate="2011-07-18T20:55:03.660" Score="10" ViewCount="20049" Body="&lt;p&gt;Call Option S=100 K=100 Payoff=1 (option is not available) How can i replicate this (payoff) with calls and puts with strike prices with multiples of 5$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for help&lt;/p&gt;&#xA;" OwnerUserId="1094" LastActivityDate="2019-10-28T11:12:32.323" Title="How to replicate a digital call option" Tags="&lt;options&gt;&lt;replication&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1465" PostTypeId="2" ParentId="1464" CreationDate="2011-07-18T21:15:17.320" Score="3" Body="&lt;p&gt;use a vertical spread and delta hedge it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.wilmott.com/messageview.cfm?catid=3&amp;amp;threadid=65988&quot; rel=&quot;nofollow&quot;&gt;http://www.wilmott.com/messageview.cfm?catid=3&amp;amp;threadid=65988&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-07-18T21:15:17.320" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1466" PostTypeId="1" AcceptedAnswerId="1518" CreationDate="2011-07-18T23:28:51.147" Score="8" ViewCount="610" Body="&lt;p&gt;Arbitrage pricing theory states that expected returns for a security are linear combination of exposures to risk factors and the returns on these risk factors. Betas, or the exposures of the security to a given risk factor, can be estimated via a time-series regression of the excess returns of the security on the excess returns of the factor return (single variable time-series regression).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Theory says the constant (or zero-beta excess return) in the time-series regression should be zero. However, practically speaking it is the case that some constants may be estimated that are statistically significant and different from zero. Question: Should one estimate Betas while forcing the constant equal to zero (i.e. theoretically consistent) vs. extracting Betas while allowing the constant term to exist?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the trade-off or which decision leads to superior accuracy? Ultimately the estimated factor exposures from the above time-series regression would be used to estimate the factor returns in a cross-sectional risk model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Attached is a &lt;a href=&quot;http://www.google.com/url?sa=t&amp;amp;source=web&amp;amp;cd=4&amp;amp;ved=0CDIQFjAD&amp;amp;url=http://faculty.chicagobooth.edu/john.cochrane/teaching/35150_advanced_investments/Cochrane_asset_pricing_CH12_229-250.pdf&amp;amp;ei=EbskTrPVNsPdgQfI4LW-Cw&amp;amp;usg=AFQjCNEWvHFO3y-uVpABpyxuehFEQO1T-Q&quot;&gt;link&lt;/a&gt; to John Cochrane's Asset Pricing chapter 12 which describes the theory in fuller detail.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-07-18T23:44:45.857" LastActivityDate="2014-07-16T16:23:02.403" Title="Efficiency vs. Robustness - To use a constant or not in single factor time-series regression?" Tags="&lt;statistics&gt;&lt;regression&gt;&lt;estimation&gt;&lt;no-arbitrage-theory&gt;&lt;pricing&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1467" PostTypeId="2" ParentId="1377" CreationDate="2011-07-19T08:11:27.957" Score="1" Body="&lt;p&gt;Within the Insurance and Portfolio Management Industry there is a concept called Probability of Shortfall as well as Probability of Ruin. There were a number of papers (not on the internet) that I remember seeing on shortfall as part of my actuarial courses. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;They evaluate how a certain product or strategy would impact a reduction in surplus or equity beneath some target level. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if we take a similar approach here, you could start by identifying market shocks in isolation as well as in combination that would bring your regulatory capital below the minimum requirement.  At work I run an ALM simulation for clients where I track what strategies lead to what probabilities of shortfall. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not sure if this helps. &lt;/p&gt;&#xA;" OwnerUserId="1095" LastActivityDate="2011-07-19T08:11:27.957" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1468" PostTypeId="2" ParentId="1462" CreationDate="2011-07-19T12:38:05.810" Score="3" Body="&lt;p&gt;Whilst not free, &lt;a href=&quot;http://www.collective2.com/&quot; rel=&quot;nofollow&quot;&gt;Collective2&lt;/a&gt; is, in my opinion, reasonably priced.&lt;/p&gt;&#xA;" OwnerUserId="252" LastActivityDate="2011-07-19T12:38:05.810" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1469" PostTypeId="2" ParentId="554" CreationDate="2011-07-19T20:05:15.677" Score="2" Body="&lt;p&gt;A proper analysis of whether idiosyncratic returns exist requires a &quot;joint hypothesis&quot; test. In other words, an equilbirum risk factor model must be assumed to test that the intercept across stocks is not statistically different from zero. You can use the GRS statistic to test the joint hypothesis that the idiosyncratic returns are zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The CAPM test as described in @richardh's answer above is the right approach go about estimating intercepts (especially since, visually, it seems that the market factor is dominant), or another model such as the Fama-French 3 factor model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The chart illustrates the pairwaise correlation of stocks is increasing (i.e. we are in a &quot;macro market&quot; as opposed to a stock-pickers market). This means that there are likely a few common factors driving returns rather than a high variety of residual dispersion. &lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-07-20T00:55:16.110" LastActivityDate="2011-07-20T00:55:16.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1470" PostTypeId="1" CreationDate="2011-07-20T07:42:42.960" Score="11" ViewCount="3246" Body="&lt;p&gt;I saw an article in which the writer had mentioned that he used chaos theory to predict stock prices and ended up with a profit over 30%.  Chaos theory is basically about finding patterns called fractals in the data.   It is used in various fields such as weather prediction and stock price determination.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How we can forecast stock prices using chaos theory?  It would be great if someone can provide me with some examples.&lt;/p&gt;&#xA;" OwnerUserId="1100" LastEditorUserId="1106" LastEditDate="2011-09-12T15:07:37.723" LastActivityDate="2011-09-12T15:07:37.723" Title="How we can forecast stock prices using chaos theory?" Tags="&lt;forecasting&gt;&lt;research&gt;&lt;equities&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="1471" PostTypeId="2" ParentId="1470" CreationDate="2011-07-20T09:42:54.557" Score="5" Body="&lt;p&gt;I think you got something wrong here: Chaos theory states that even when the system is deterministic but chaotic it is &lt;em&gt;unpredictable&lt;/em&gt;!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the very definition of a chaotic system. So it is rather paradoxical to ask how to use the statement that something is unpredictable to predict it... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See here for more details:&#xA;&lt;a href=&quot;http://en.wikipedia.org/wiki/Chaos_theory&quot; rel=&quot;noreferrer&quot;&gt;http://en.wikipedia.org/wiki/Chaos_theory&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-07-20T09:42:54.557" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1472" PostTypeId="2" ParentId="141" CreationDate="2011-07-20T16:05:40.723" Score="19" Body="&lt;p&gt;I don't know how interested you are in the CME data, but I have been learning about options and volatility modeling.  I have been working with delayed CME data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been able to extract the JSON queries and now have been able to run them in my .NET application to get data for every asset type.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Exmaple of ES options data: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Run the query below in Chrome and you will see the JSON response. In other browsers you will be prompted to download the JSON file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The link below asks CME server to return back options data for given strikes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cmegroup.com/CmeWS/md/MDServer/V1/Venue/G/Exchange/XCME/FOI/OPT/Product/ES?currentTime=1311084303814&amp;amp;contractCDs=,ESU1%20C1315,ESU1%20P1315,ESU1%20C1320,ESU1%20P1320,ESU1%20C1325,ESU1%20P1325,ESU1%20C1330,ESU1%20P1330,ESU1%20C1335,ESU1%20P1335&quot;&gt;http://www.cmegroup.com/CmeWS/md/MDServer/V1/Venue/G/Exchange/XCME/FOI/OPT/Product/ES?currentTime=1311084303814&amp;amp;contractCDs=,ESU1%20C1315,ESU1%20P1315,ESU1%20C1320,ESU1%20P1320,ESU1%20C1325,ESU1%20P1325,ESU1%20C1330,ESU1%20P1330,ESU1%20C1335,ESU1%20P1335&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been able to get other data as well by just changing the contract Code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To parse it you just use the .NET &lt;code&gt;Serialization&lt;/code&gt; class (add reference to &lt;code&gt;system.web.extensions&lt;/code&gt; and &lt;code&gt;using System.Web.Script.Serialization;&lt;/code&gt; on .NET framework 4.0)&lt;/p&gt;&#xA;" OwnerUserId="1029" LastEditorUserId="1652" LastEditDate="2011-11-15T15:55:20.827" LastActivityDate="2011-11-15T15:55:20.827" CommentCount="3" CommunityOwnedDate="2011-07-20T16:05:40.723" ContentLicense="CC BY-SA 3.0" />
  <row Id="1473" PostTypeId="1" AcceptedAnswerId="1476" CreationDate="2011-07-20T20:01:56.740" Score="8" ViewCount="1060" Body="&lt;p&gt;Let's say I have the following two positions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Buy ATM SPX call, expires in 1 month&lt;/li&gt;&#xA;&lt;li&gt;Sell ATM SPX put, expires in 1 month&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This creates a synthetic futures position.  How do I calculate how many futures are required to replicate (or hedge) my options position?&lt;/p&gt;&#xA;" OwnerUserId="551" LastActivityDate="2013-08-02T10:39:21.423" Title="How to calculate equivalent futures position?" Tags="&lt;options&gt;&lt;hedging&gt;&lt;replication&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1474" PostTypeId="2" ParentId="1291" CreationDate="2011-07-20T20:35:42.067" Score="2" Body="&lt;p&gt;Would &lt;a href=&quot;http://forums.eviews.com/viewtopic.php?f=4&amp;amp;t=2586&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; work?&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;EViews actually estimates the GJR-GARCH model when you select the GARCH/TARCH option and specify a threshold order. Original TARCH model works on conditional standard deviation. However, as you can verify it from the user's guide, EViews' TARCH model uses the same specification as GJR model does. Given that, in order to employ a different error distribution, all you have to do is select from the drop down menu in the ARCH-GARCH models dialog box.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1092" LastActivityDate="2011-07-20T20:35:42.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1475" PostTypeId="1" CreationDate="2011-07-21T09:39:24.263" Score="7" ViewCount="596" Body="&lt;p&gt;I'm struggling to understand why the risk on an equity CFD is not the same as for the corresponding equity. The RiskMetrics &lt;a href=&quot;http://help.riskmetrics.com/RiskManager3/Content/Frequently_Asked_Questions/FAQModelling.htm&quot;&gt;FAQ&lt;/a&gt; mentions two ways to model a CFD, but it does not explain why this is necessary. A good explanation would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="1104" LastActivityDate="2011-09-24T17:28:37.557" Title="How to model the risk of a CFD" Tags="&lt;risk&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1476" PostTypeId="2" ParentId="1473" CreationDate="2011-07-21T11:02:31.880" Score="3" Body="&lt;p&gt;Perhaps I don't understand your question correctly but &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;one&lt;/strong&gt; Synthetic Long Futures Construction &lt;br&gt;equals&lt;br&gt; &quot;Buy &lt;strong&gt;one&lt;/strong&gt; ATM Call&quot; and &quot;Sell &lt;strong&gt;one&lt;/strong&gt; ATM Put&quot; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(see e.g. here: &lt;a href=&quot;http://www.theoptionsguide.com/synthetic-long-futures.aspx&quot; rel=&quot;nofollow&quot;&gt;http://www.theoptionsguide.com/synthetic-long-futures.aspx&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-07-21T11:02:31.880" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1477" PostTypeId="2" ParentId="839" CreationDate="2011-07-21T20:41:24.237" Score="6" Body="&lt;p&gt;There are many details you need to take into account in order to do a proper backtest.  Besides the correction regarding bar entry/exit prices mentioned &lt;a href=&quot;https://quant.stackexchange.com/questions/839/making-your-own-backtester/842#842&quot;&gt;earlier&lt;/a&gt;, you will also need to correct for the bid/ask spread, which may be wider than the high/low for some stocks at some times.  Some other details are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Splits&lt;/li&gt;&#xA;&lt;li&gt;Dividends&lt;/li&gt;&#xA;&lt;li&gt;Ticker changes&lt;/li&gt;&#xA;&lt;li&gt;Warrants/rights issuances&lt;/li&gt;&#xA;&lt;li&gt;Merger/acquisition activity&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Be careful to include stocks that have been delisted in your backtest, and generally only use criteria that would have been known at the time to construct your sample (see &lt;a href=&quot;http://www.investopedia.com/terms/l/lookaheadbias.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for volume limits, a good proxy is to never be trading more than 5% of the typical volume that takes place in a given period.  For example, if you intend to buy $1MM of some stock over, say, a half hour period, be sure that at least 20MM is typically traded during that half hour of the day.  From your question, though, it sounds like you are thinking of a strategy that is executed minute-to-minute, so you are probably better off just looking at the order book and how many shares are typically available to trade.  You can somewhat get a sense for that by looking at minute volume bars, and assume you will not be able to trade more than the 10th percentile of the distribution.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2011-07-21T20:41:24.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1478" PostTypeId="2" ParentId="1470" CreationDate="2011-07-21T21:00:38.590" Score="7" Body="&lt;p&gt;Benoit Mandelbrot, pioneer of fractals theory, has a set of papers on the &lt;a href=&quot;http://users.math.yale.edu/~bbm3/web_pdfs/Cowles1164.pdf&quot; rel=&quot;noreferrer&quot;&gt;Multifractal Model of Asset Returns&lt;/a&gt;.  I believe when most people in finance are saying they use &quot;chaos theory&quot;, they are really referring to fractals, and particularly multifractals.  I am skeptical as to whether it can be useful to predict stock prices or even to predict volatility, but searching down this line of research (see, e.g. &lt;a href=&quot;http://www.ifw-members.ifw-kiel.de/publications/stochastic-behavioral-asset-pricing-models-and-the-stylized-facts-1/KWP_1426_Stochastic%20Behavioral%20Asset%20pricing%20Models.pdf&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=583421&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;) could lead you to your answer.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-07-22T13:37:37.193" LastActivityDate="2011-07-22T13:37:37.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1479" PostTypeId="1" AcceptedAnswerId="2879" CreationDate="2011-07-21T21:22:55.713" Score="9" ViewCount="2347" Body="&lt;p&gt;I am interested in coding a medium frequency (trading over minutes to hours, holding for days to weeks) quantitative trading strategy and trading it with Interactive Brokers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have seen many people here mention that they use Matlab (or R, SAS, etc.) for strategy development/backtesting, but that they would prefer to program the execution code for live trading in C++/C#/Java.  &lt;strong&gt;What are the advantages of re-coding the strategy into a lower-level language and/or the disadvantages of maintaining the same platform for strategy development and implementation?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My thinking is that keeping the same platform allows one to easily incorporate updates and improvements to the strategy over time, whereas the IBrokers package and various commercial Matlab tie-ins to IB's API make it feasible to communicate directly with IB from the development platform.  Is there something I am missing here?  Have others tried this?&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-08-07T12:54:55.113" LastActivityDate="2012-02-02T01:46:47.433" Title="What are the advantages of switching platforms/languages between strategy development and implementation?" Tags="&lt;backtesting&gt;&lt;quant-trading-strategies&gt;" AnswerCount="5" CommentCount="3" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="1480" PostTypeId="1" AcceptedAnswerId="1481" CreationDate="2011-07-21T22:34:23.337" Score="16" ViewCount="3526" Body="&lt;p&gt;Suppose you are running a portfolio of quantitative strategies and that you develop a new potential strategy to be added to the mix.  Assume for simplicity that the new strategy is independent of the existing strategy.  The new strategy relies on data which is available going back X years.  You proceed by backtesting and optimizing the parameters of the new strategy on an &quot;in-sample&quot; portion of your dataset, while reserving an &quot;out-of-sample&quot; portion for validation.  The new strategy's weight in your portfolio will be determined by its out-of-sample performance.  Your goal is to maximize your overall Sharpe ratio.  What is the ideal ratio of in-sample length to out-of-sample length?&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-08-07T12:47:51.883" LastActivityDate="2019-02-25T11:33:21.053" Title="What is the ideal ratio of in-sample length to out-of-sample length?" Tags="&lt;backtesting&gt;&lt;quant-trading-strategies&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="1481" PostTypeId="2" ParentId="1480" CreationDate="2011-07-22T13:02:03.543" Score="10" Body="&lt;p&gt;Interestingly enough there is no scientific theory that suggests what fraction of the data should be assigned to training and testing and results can be very sensitive to these choices. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &lt;a href=&quot;http://books.google.de/books?id=HPKCPQAACAAJ&amp;amp;dq=quantitative%20trading&amp;amp;hl=en&amp;amp;ei=DnMpTsG3F4WRswbZt4WfDA&amp;amp;sa=X&amp;amp;oi=book_result&amp;amp;ct=result&amp;amp;resnum=2&amp;amp;ved=0CDMQ6AEwAQ&quot;&gt;Quantitative Trading by Ernest Chan&lt;/a&gt; (p. 53-54):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Out-of-Sample Testing&lt;/strong&gt; Divide your historical data into two parts.&#xA;  Save the second (more recent) part of the data for out-of-sample&#xA;  testing. When you build the model, optimize the parameters as well as&#xA;  other qualitative decisions on the first portion (called the training&#xA;  set), but test the resulting model on the second portion (called the&#xA;  test set). (The two portions should be roughly equal in size, but if&#xA;  there is insufficient training data, we should at least have one-third&#xA;  as much test data as training data. [...]&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For more sophisticated methods see &lt;a href=&quot;http://books.google.de/books?id=jbD47VkOHAEC&amp;amp;lpg=PP1&amp;amp;dq=evidence%20based%20technical%20analysis&amp;amp;hl=en&amp;amp;pg=PP1#v=onepage&amp;amp;q&amp;amp;f=false&quot;&gt;Evidence-based technical analysis by David Aronson&lt;/a&gt; p. 321-323.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would add that once the strategy has been revised to reflect such data it is no longer &quot;out-of-sample&quot; or in other words: If you optimize your strategy &quot;out-of-sample&quot; you will incur data snooping bias via curve fitting nevertheless! Or as Aronson puts it:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;the Virginal status of the data reserved for out-of-sample testing has&#xA;  a short life span. It is lost as soon as it is used one time.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2011-07-22T13:18:30.870" LastActivityDate="2011-07-22T13:18:30.870" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1482" PostTypeId="2" ParentId="839" CreationDate="2011-07-22T13:13:22.743" Score="2" Body="&lt;p&gt;Stop loss simulation with strictly OHLC is not possible since you need to assume the ordering of the high and low (which one came first)? You can make an assumption when there is a straight line thru the price (open at low, close at high for example), however, in general you will have days where it is not clear what low/high came first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You also need to consider the logic for market vs. limit orders. If you use market orders you need some slippage assumptions. If you use limit orders there is a probability your order will not be filled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, using OHLC may lead you to design a strategy that trades on the Open. However, the open price is extremely volatile and you may face steep slippage and inability to achieve the quoted open price.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2011-07-22T13:13:22.743" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1483" PostTypeId="2" ParentId="705" CreationDate="2011-07-22T15:48:24.540" Score="2" Body="&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=980865&quot; rel=&quot;nofollow&quot;&gt;Blitz and Van Vliet (2007)&lt;/a&gt;, published in the Journal of Portfolio Management, has also tested this proposition on a global dataset.  Some other important papers on this phenomenon are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.afajof.org/afa/forthcoming/ang1.pdf&quot; rel=&quot;nofollow&quot;&gt;Ang et al. (2006)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.iijournals.com/doi/abs/10.3905/jpm.2006.661366&quot; rel=&quot;nofollow&quot;&gt;Clarke, de Silva, and Thorley (2006)&lt;/a&gt; (also see &lt;a href=&quot;http://www.cfassd.org/Linked%20Files/Low%20Volatility%20Equity%20Portfolios-%20A%20Free%20Lunch.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1739227&quot; rel=&quot;nofollow&quot;&gt;Sullivan and Lee (2010)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Currently the literature is moving more towards explaining this phenomenon as a result of idiosyncratic risk rather than overall volatility (see &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1571718&quot; rel=&quot;nofollow&quot;&gt;Gao, Yu, and Yuan (2010)&lt;/a&gt; and &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=886717&quot; rel=&quot;nofollow&quot;&gt;Bali and Cakici (2008)&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Possible explanations for this phenomenon are given by &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=649421&quot; rel=&quot;nofollow&quot;&gt;Barberis and Huang (2008)&lt;/a&gt; and &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1262416&quot; rel=&quot;nofollow&quot;&gt;Bali, Cakici, and Whitelaw (2010)&lt;/a&gt;.  They suggest a &quot;preference among investors for assets with lottery-like payoffs.&quot;&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-07-22T15:48:24.540" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1484" PostTypeId="2" ParentId="1102" CreationDate="2011-07-22T15:59:10.450" Score="11" Body="&lt;p&gt;Nowadays most quantitative researchers choose to use &lt;a href=&quot;http://en.wikipedia.org/wiki/Information_ratio&quot;&gt;Information Ratio&lt;/a&gt;, developed and popularized by Grinold and Kahn (1999), as the gold standard for performance evaluation.  Generally, though, it is called a Sharpe Ratio if returns are measured relative to the risk-free rate and an Information Ratio if returns are measured relative to some benchmark.  Calculations may be done on daily, weekly, or monthly data, but results are always annualized (and typically by a factor of $\sqrt{252}$ for daily equities, $\sqrt{260}$ for daily FX, or $\sqrt{12}$ for any monthly series).&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-07-22T15:59:10.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1485" PostTypeId="2" ParentId="371" CreationDate="2011-07-22T16:46:44.473" Score="1" Body="&lt;p&gt;I am not familiar with any formal &quot;models&quot; of the TBA coupon stack similar to Nelson-Siegel, but we typically compare the TOAS and ZV (Z-spread) curves as a function of coupon and issuer/maturity.  We also examine relative value between these curves and various seasoned loan pools.  The curve itself is very erratic, and plotting it often gives a good impression of which particular points on the curve may be over/under-valued.  I have dealt with a number of market participants (traders) in this area over the years, and it seems like much is still done by guess-timating.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, there are a few references on TBAs generally by &lt;a href=&quot;http://www.docstoc.com/docs/17756433/%5BCitibank%5D-Guide-to-Mortgage-Back-Securities&quot; rel=&quot;nofollow&quot;&gt;Citigroup&lt;/a&gt;, &lt;a href=&quot;http://www.docstoc.com/docs/17756433/%5BCitibank%5D-Guide-to-Mortgage-Back-Securities&quot; rel=&quot;nofollow&quot;&gt;JPMorgan&lt;/a&gt;, &lt;a href=&quot;http://www.ny.frb.org/research/staff_reports/sr468.pdf&quot; rel=&quot;nofollow&quot;&gt;the Fed&lt;/a&gt; and probably others.  I couldn't find a reference to a model of the TBA coupon stack in any of these.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-07-22T16:46:44.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1486" PostTypeId="2" ParentId="714" CreationDate="2011-07-22T16:50:51.770" Score="7" Body="&lt;p&gt;Unless explicitly mentioned, iShares ETFs do not apply any currency hedging directly.  (See the &lt;a href=&quot;http://uk.ishares.com/en/rc/stream/pdf/false/publish/repository/documents/dffs_comit/dub/CURRENT/PDF/FFS_EQ_IJPN_IE00B02KXH56_GB_en.pdf&quot;&gt;factsheet&lt;/a&gt; for the case of IJPN.  The base currency is USD merely because it is the common currency for a set of identical funds offered in many different versions around the world.  At the end of each day they mark their books in USD, converting their JPY-denominated equities exposures to USD based on current exchange rates.  The fund is 100% long JPY-denominated assets.  Just to be clear, that means there is no explicit exposure to USD, GBP, or any other currency not part of the underlying index (MSCI Japan in this case).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More recently, iShares has introduced &quot;currency-hedged&quot; funds.  See, for example, the fact sheet for the &lt;a href=&quot;http://uk.ishares.com/en/rc/stream/pdf/-/publish/repository/documents/dffs_comit/dub/CURRENT/PDF/FFS_EQ_IJPE_IE00B42Z5J44_GB_en.pdf&quot;&gt;EUR-hedged Japan ETF&lt;/a&gt;.  The hedging methodology was created by MSCI and is explained &lt;a href=&quot;http://ebookbrowse.com/msci-hedged-fx-hedge-global-currency-methodology-nov09-pdf-d25771555&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-07-22T19:59:19.643" LastActivityDate="2011-07-22T19:59:19.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1487" PostTypeId="2" ParentId="306" CreationDate="2011-07-22T20:50:15.370" Score="1" Body="&lt;p&gt;Has anyone else here ever used Stata?  It's probably closest to R and Matlab.  Like both R and Matlab, it is remarkably flexible and has many good built-in routines for the standard statistical techniques and a decent-sized community contributing code for some of the less popular techniques. Like Matlab but unlike R, it is very well documented with clear and simple examples and very easy to use and pick up, yet it is much cheaper than Matlab.  For at least one hedge fund I know of, it has substituted well as a cheaper alternative to Matlab for strategy research and development.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-07-22T20:50:15.370" CommentCount="0" CommunityOwnedDate="2011-07-22T20:50:15.370" ContentLicense="CC BY-SA 3.0" />
  <row Id="1488" PostTypeId="2" ParentId="1391" CreationDate="2011-07-22T21:21:18.510" Score="11" Body="&lt;p&gt;Since I, too, have been very interested in this question, I will share some of my findings in the dual hope of encouraging comments on the papers and eliciting more activity on this question.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1324605&quot;&gt;Ammann, Skovmand, and Verhofen (2008): Implied and Realized Volatility in the Cross-Section of Equity Options&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1533089&quot;&gt;Ang, Bali, and Cakici (2010): The Joint Cross Section of Stocks and Options&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1572827&quot;&gt;Bali and Murray (2011): Does Risk-Neutral Skewness Predict the Cross-Section of Equity Option Portfolio &lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1786607&quot;&gt;Cao and Han (2011): Cross-Section of Option Returns and Stock Volatility&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1491469&quot;&gt;Constantinides, Jackwerth, and Savov (2011): The Puzzle of Index Option Returns&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1156620&quot;&gt;Deng (2008): Volatility Dispersion Trading&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1572269&quot;&gt;Driessen, Lin, and Hemert (2011): How the 52-Week High and Low Affect Option-Implied Volatilities and Stock Return Moments&#xA;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1364721&quot;&gt;Jones and Shemesh (2010): The Weekend Effect in Equity Option Returns&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-07-22T21:21:18.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1489" PostTypeId="1" AcceptedAnswerId="1923" CreationDate="2011-07-22T21:44:39.253" Score="34" ViewCount="17543" Body="&lt;p&gt;There are many models available for calculating the implied volatility of an American option.  The most popular method, employed by &lt;a href=&quot;http://www.optionmetrics.com/pdf/DividendForecasting_WhitePaper.pdf&quot;&gt;OptionMetrics&lt;/a&gt; and others, is probably the &lt;a href=&quot;http://en.wikipedia.org/wiki/Binomial_options_pricing_model&quot;&gt;Cox-Ross-Rubinstein&lt;/a&gt; model.  However, since this method is numerical, it yields a computationally intensive algorithm which may not be feasible (at least for my level of hardware) for repeated re-calculation of implied volatility on a hundreds of option contracts and underlying instruments with ever-changing prices.  I am looking for an efficient and accurate closed form algorithm for calculating implied volatility.  Does anyone have any experience with this problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most popular closed-form approximation appears to be Bjerksund and Stensland (2002), which is recommended by &lt;a href=&quot;http://www.mathworks.com/help/toolbox/finderiv/brq9e2y-1.html&quot;&gt;Matlab&lt;/a&gt; as the top choice for American options, although I've also seen Ju and Zhong (1999) mentioned on &lt;a href=&quot;http://www.wilmott.com/messageview.cfm?catid=4&amp;amp;threadid=66731&quot;&gt;Wilmott&lt;/a&gt;.  I am interested in knowing which of these (or other) methods gives the most reasonable and accurate approximations in a real-world setting.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-08-07T14:57:40.017" LastActivityDate="2017-03-28T22:34:45.957" Title="How should I calculate the implied volatility of an American option in a real-time production environment?" Tags="&lt;option-pricing&gt;&lt;implied-volatility&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="36" ContentLicense="CC BY-SA 3.0" />
  <row Id="1490" PostTypeId="1" AcceptedAnswerId="1495" CreationDate="2011-07-23T13:44:04.380" Score="19" ViewCount="22300" Body="&lt;p&gt;Why would an investor trade a variance swap over a volatility swap?  Is it simply related to the leverage involved in a Var (i.e. sigma-squared) or is there something else to it?&lt;/p&gt;&#xA;" OwnerUserId="293" LastEditorUserId="1355" LastEditDate="2011-09-14T11:37:47.500" LastActivityDate="2012-08-31T17:08:34.797" Title="Why would an investor trade a variance swap over a volatility swap?" Tags="&lt;volatility&gt;&lt;variance&gt;&lt;swaps&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="1491" PostTypeId="2" ParentId="1479" CreationDate="2011-07-23T15:41:08.383" Score="7" Body="&lt;p&gt;The only benefits I can imagine from re-coding in C++ would be speed.  But speed doesn't seem to be a concern for your time horizon (especially if you write efficient Matlab code).  Some may argue that C++ is more stable, but Matlab is plenty stable for live trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the downsides of using two languages are even more significant than just ease of updating and improving the strategy.  Not only do you have to code new updates twice, but C++ and Matlab aren't that similar, so you'll have to write &lt;strong&gt;different&lt;/strong&gt; code.  This will dramatically increase your chance of making errors, which will more than likely lose you money.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ultimately, unless you're at the point where speed is critical, having two different code bases for development and implementation is a nightmare.&lt;/p&gt;&#xA;" OwnerUserId="1063" LastActivityDate="2011-07-23T15:41:08.383" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1492" PostTypeId="2" ParentId="1479" CreationDate="2011-07-23T16:29:02.777" Score="3" Body="&lt;p&gt;You could combine both languages into one platform. I use Octave a lot ( the open source equivalent of MATLAB ) and where speed is an issue I have re-written .oct functions in C++ that are called from Octave. This has the advantage of using just Octave code for functional day to day use but with the speed of C++ where necessary.&lt;/p&gt;&#xA;" OwnerUserId="252" LastActivityDate="2011-07-23T16:29:02.777" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1493" PostTypeId="2" ParentId="1448" CreationDate="2011-07-23T20:55:12.450" Score="4" Body="&lt;p&gt;&lt;a href=&quot;http://www.smirnov.sp.ru/forex_html/forex3eng.html&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; example of practical application of Markov ideas to trading.&lt;/p&gt;&#xA;" OwnerUserId="1110" LastActivityDate="2011-07-23T20:55:12.450" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1494" PostTypeId="2" ParentId="1339" CreationDate="2011-07-23T23:21:20.110" Score="5" Body="&lt;p&gt;I have tested lots of forex data for randomness. Some currency pairs are very close to random walk. And the problem is open question, because there is no uniform explanation what the random walk is. According to &lt;a href=&quot;http://www.ft.com/intl/cms/s/2/5372968a-ba82-11da-980d-0000779e2340.html#axzz1SyLsVrMU&quot; rel=&quot;nofollow&quot;&gt;Mandelbrot, Taleb&lt;/a&gt; and some other authors randomness can be different. &#xA;Even if the data is not random it doesn't mean it can be effectively traded. In other words, test for existence of trade opportunity is more useful than randomness test.&lt;/p&gt;&#xA;" OwnerUserId="1110" LastActivityDate="2011-07-23T23:21:20.110" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1495" PostTypeId="2" ParentId="1490" CreationDate="2011-07-24T01:31:20.417" Score="13" Body="&lt;p&gt;Var and vol swaps are very similar products, with the leverage (convexity) being the biggest theoretical difference, yes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the actual market however they are very different. After the 2008 debacle var swaps in the single stock space are not too common, whereas single stock vol swaps are regularly quoted. One interesting perspective is trading one versus the other to get clean exposure to convexity.&lt;/p&gt;&#xA;" OwnerUserId="478" LastActivityDate="2011-07-24T01:31:20.417" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1496" PostTypeId="2" ParentId="1490" CreationDate="2011-07-24T01:59:23.903" Score="2" Body="&lt;p&gt;I guess it is more natural to trade the volatility swap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BUT in practice, it is easier to replicate a variance swap. You 'll find several methodologies on Internet. To replicate vol swap, one method is to trade dynamically a var swap.&lt;/p&gt;&#xA;" OwnerUserId="134" LastEditorUserId="134" LastEditDate="2011-07-24T02:11:11.143" LastActivityDate="2011-07-24T02:11:11.143" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1498" PostTypeId="2" ParentId="998" CreationDate="2011-07-24T03:41:31.107" Score="6" Body="&lt;p&gt;I think the key to fund performance is the use of own money, not borrowed. In this case, it is possible to implement strategies that ordinary hedge funds can not use due to risk management. &lt;/p&gt;&#xA;" OwnerUserId="1110" LastActivityDate="2011-07-24T03:41:31.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1499" PostTypeId="2" ParentId="1490" CreationDate="2011-07-24T04:30:33.727" Score="9" Body="&lt;p&gt;As you know both var swap &amp;amp; vol swap are traded on vol. The difference comes in convexity. Although variance swap payoffs are linear with variance they are convex with volatility. Because of the convexity, a variance swap will always outperform a contract linear in volatility of the same strike. This convexity is the reason that variance swaps strikes trade above at-the-money volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case of large swing in volatility, var swap will give far better result than vol swap.&lt;/p&gt;&#xA;" OwnerUserId="1111" LastActivityDate="2011-07-24T04:30:33.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1500" PostTypeId="2" ParentId="1490" CreationDate="2011-07-24T04:39:47.393" Score="11" Body="&lt;p&gt;&lt;a href=&quot;http://www.ederman.com/new/docs/gs-volatility_swaps.pdf&quot;&gt;Derman et al&lt;/a&gt; has a long note on this from 1999.  Variance swaps are actually the more natural choice.  It has nothing to do with leverage.  From the linked article:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Although options market participants talk of volatility, it is &lt;em&gt;variance&lt;/em&gt;,&#xA;  or volatility squared, that has more fundamental theoretical significance.&#xA;  This is so because the correct way to value a swap is to value the&#xA;  portfolio that replicates it, and the swap that can be replicated most&#xA;  reliably (by portfolios of options of varying strikes, as we show later) is&#xA;  a &lt;em&gt;variance swap&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;A little further down in the same article, he discusses how volatility swaps are actually a derivative on variance swaps:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Since variance can be replicated relatively simply, it is useful&#xA;  to regard volatility as the square root of variance. From this point of&#xA;  view, volatility is itself a square-root derivative contract on variance.&#xA;  Thus, a volatility swap can be dynamically hedged by trading the&#xA;  underlying variance swap, and its value depends on the volatility of the&#xA;  underlying variance – that is, on the volatility of volatility.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-07-24T04:39:47.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1501" PostTypeId="1" AcceptedAnswerId="1505" CreationDate="2011-07-24T15:01:00.363" Score="47" ViewCount="8438" Body="&lt;p&gt;According to my current understanding, there is a clear difference between &lt;strong&gt;data mining&lt;/strong&gt; and &lt;strong&gt;mathematical modeling&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Data mining&lt;/em&gt; methods treat systems (e.g., financial markets) as a &quot;black box&quot;. The focus is on the observed variables (e.g., stock prices). The methods do not try to explain the observed phenomena by proposing underlying mechanisms that cause the phenomena (i.e., what happens in the black box). Instead, the methods try to find some features, patterns, or regularities in the data in order to predict future behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Mathematical modeling&lt;/em&gt;, in contrast, tries to propose a model for what happens inside the black box.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which approach dominates in quantitative finance? Do people try to use more and more fancy data mining techniques or do people try to construct better and better mathematical models?&lt;/p&gt;&#xA;" OwnerUserId="981" LastEditorUserId="1106" LastEditDate="2011-10-18T21:24:05.707" LastActivityDate="2012-06-20T19:22:30.527" Title="Which approach dominates? Mathematical modeling or data mining?" Tags="&lt;modeling&gt;&lt;market&gt;&lt;data-mining&gt;" AnswerCount="6" CommentCount="0" FavoriteCount="58" ContentLicense="CC BY-SA 3.0" />
  <row Id="1502" PostTypeId="2" ParentId="1462" CreationDate="2011-07-24T16:05:01.380" Score="6" Body="&lt;p&gt;This question sounds a lot like &lt;a href=&quot;https://quant.stackexchange.com/questions/447/option-trading-api-other-than-ib&quot;&gt;this one&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's going to be difficult to find everything you need completely for free.  In order to simulate trading sensibly, you will need a real-time data feed, and even the Yahoo! quotes you are getting are delayed (unless you are already paying for Yahoo's real-time service).  If you have the cash available (and are willing to tolerate the monthly data fees of $10/month, which are waived if you actually trade), Interactive Brokers has a &lt;a href=&quot;http://individuals.interactivebrokers.com/en/p.php?f=tws&amp;amp;p1=papertrader&quot; rel=&quot;nofollow noreferrer&quot;&gt;Paper Trader&lt;/a&gt; which is fully functional and simulates all the rules and limitations of your actual account.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;AFAIK, IB is the top choice for semi-professional retail traders.  For examples on this site, see &lt;a href=&quot;https://quant.stackexchange.com/questions/1199/mass-market-data-source&quot;&gt;1&lt;/a&gt;, &lt;a href=&quot;https://quant.stackexchange.com/questions/1224/utility-to-download-historical-implied-volatility-data-from-interactive-brokers&quot;&gt;2&lt;/a&gt;, &lt;a href=&quot;https://quant.stackexchange.com/questions/614/hedgefund-like-behavior-for-covered-call-selling-account&quot;&gt;3&lt;/a&gt;, &lt;a href=&quot;https://quant.stackexchange.com/questions/569/best-broker-for-hft&quot;&gt;4&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2011-07-24T16:05:01.380" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1503" PostTypeId="2" ParentId="1501" CreationDate="2011-07-24T17:05:43.563" Score="17" Body="&lt;p&gt;I think you have the correct dichotomy here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Things started in the late 1980s and through the 1990s with &lt;em&gt;analytical&lt;/em&gt; approaches particularly to derivative pricing (as in &quot;hey, let's create yet another exotic option we can sell to the buy side&quot;). The risk modelling &quot;fashion&quot; of the 1990s (when regulated entities such as banks needed to beef up reporting) carried on with this, as did credit modelling as that market grew in leaps and bounds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the same time there have always been &lt;em&gt;empirical&lt;/em&gt; approaches to arbitrage as e.g. with the PDT group at Morgan Stanley and other early adopters.  And with increases in computing power, as well as increased data availability and electronic exchange access, there are fewer barriers to entry on this front and hence more players competing for what may be a fixed pool of profits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to your questions about which approach dominates: hard to say, I guess it ebbs and flows somewhat. &quot;Classic&quot; quant investing  got whiplashed in 2007 and 2008, which lead to increased interest in higher frequency approaches.  Which may now be saturated---time will tell.   As for the analytical side: it appears over-harvested too with few recent advances.&lt;/p&gt;&#xA;" OwnerUserId="69" LastActivityDate="2011-07-24T17:05:43.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1504" PostTypeId="1" AcceptedAnswerId="1539" CreationDate="2011-07-24T17:54:01.383" Score="12" ViewCount="3517" Body="&lt;p&gt;The optimal re-balancing strategy takes account of factors including i) objective function, ii) current portfolio weights, iii) expected return vector containing updated views/alpha forecasts, iv) uncertainty in the alpha forecasts, v) transaction costs, vi) risk aversion, and vii) constraints (long-only, turnover, etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question - Are there any libraries in R that return the optimal weight vector as a function of these inputs and related reporting? Or should I select one of the &lt;a href=&quot;https://quant.stackexchange.com/questions/972/library-to-solve-optimization-problems&quot;&gt;many optimizers&lt;/a&gt; in R and build out all the wonderful optimization reporting (risk budgeting, contribution to risk, etc.) that the rmetrics team has already done?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below I describe why the rmetrics package does not solve the problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The challenge is that the rmetrics optimization procedure identifies the optimal portfolio without reference to current vector of portfolio weights, updated alpha forecasts, and transactions costs. The correct procedure performed periodically would be to specify the path of the portfolio along a line where the marginal transaction cost is just offset by the marginal expected return (or marginal risk reduction) in the utility function. The marginal return would be the output of a forecasting model as opposed to using the mean return. The fPortfolioBacktest anticipates this issue and attempts to smooth the change in weights from period to period. But we can do better by having the optimizer confront the trade-off directly.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2019-03-25T16:52:27.017" Title="robust portfolio optimization re-balancing with transaction costs" Tags="&lt;software&gt;&lt;r&gt;&lt;optimization&gt;&lt;portfolio-management&gt;&lt;rebalancing&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="1505" PostTypeId="2" ParentId="1501" CreationDate="2011-07-24T18:23:27.710" Score="38" Body="&lt;p&gt;I would offer the distinctions are i) pure statistical approach, ii) equilibrium based approach, and iii) empirical approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The statistical approach includes data mining. Its techniques originate in statistics and machine learning. In its extreme there is no &lt;em&gt;a priori&lt;/em&gt; theoretical structure imposed on asset returns. Factor structure might be identified thru Principal Components, for example. The goal here is to maximize predictive accuracy at the expense of intuition and explanatory power. This approach increasingly dominates at very short frequencies in modeling market microstructure, market making algorithms, volatility modeling, etc. However, even in high-frequency trading one can impose a factor model based on depth of order book, liquidity, factor characteristics (momentum, correlation with S&amp;amp;P), etc. Therefore my guess is that hybrid models (factor model + a statistical model to pick-up signal in residuals) are dominant in the HFT space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The equilibrium approach is best characterized by CAPM or Fama-French models that originate in academic finance. Here you have a theory (such as Arbitrage Pricing Theory, consumption-based theories, Black-Scholes, etc.) that imposes structure to the returns you are modeling. Many well-regarded quant shops use extensions of an equilibrium model (adding momentum, liquidity, own-volatility, etc.) or other factors to generate expected returns. In the mid-late 90's many academics identified &quot;anomalies&quot; and left to start their own funds and these are the biggest players. Cliff Asness et al played a big role in developing this approach at Goldman Sachs Asset Management and later at Applied Quantitative Research (AQR).  Lakonishok et al started LSV. Andrew Lo has been involved with Simplex. Also, there are funds that use BARRA or Axioma models to make explicit factor bets. Many of the funds in this camp may agree that factor structure exist in the market but disagree on their source. Some would argue that the premiums exist because of behavioral bias as opposed to compensation for systematic risk. Nonetheless I would group these sub-camps under this banner since their approach in estimating risk is very similar (although they disagree on how to interpret and whether one can exploit factor premia). If you measure quant funds by AUM I would argue that this school has the highest share. Indeed the so-called quant meltdown of Aug '07 supports this view since it implies that many firms were trading on the same factors (value and momentum in particular).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The third approach is the empirical approach. Members of this group apply a framework to analyze returns and usually hail from a statistical physics, computer science, or perhaps bioinformatics background. This is where you have a hypothesis (based on corporate finance theory, or by observation of market history) and you may test the hypothesis out-of-sample or in another market. I would place Capital Fund Management, Nassim Taleb's Empirica, and Vic Neiderholffer as exemplars of this category. I would argue that you can include fundamental analysts and managers such as Warren Buffet, Ken Fisher, and Peter Lynch in this category as well. They have a model for evaluating the returns of stocks (i.e. margin of safety, strong positioning, etc.) grounded in history although they do not formalize the model in the language of statistics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; Here is a link to &quot;&lt;a href=&quot;http://www.cfapubs.org/toc/rf/2008/2008/2&quot;&gt;Challenges in Quantitative Equity Management&lt;/a&gt;&quot; by Fabozzi. It does a great job discussing what quant methods are used, and covers market share and growth rates. This may answer your question at a granular level (see page 60 for example)&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1129" LastEditDate="2011-07-31T20:50:15.187" LastActivityDate="2011-07-31T20:50:15.187" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1506" PostTypeId="2" ParentId="1504" CreationDate="2011-07-24T21:07:18.483" Score="7" Body="&lt;p&gt;This is the website to the R/Finance conference this year. Tons of great links.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.rinfinance.com/agenda/&quot;&gt;http://www.rinfinance.com/agenda/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Brian Peterson's slide (Building and Testing Quantitative Strategy Models in R) mentions Portfolio-Analytics (which I think is based on R/Metrics).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And here is a paper based on Portfolio-Analytics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://cran.r-project.org/web/packages/portfolio/vignettes/portfolio.pdf&quot;&gt;http://cran.r-project.org/web/packages/portfolio/vignettes/portfolio.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am a Python guy (not R) so I can't say if my response exactly answers your question but it may be a good starting place.&lt;/p&gt;&#xA;" OwnerUserId="1112" LastActivityDate="2011-07-24T21:07:18.483" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1507" PostTypeId="2" ParentId="1501" CreationDate="2011-07-24T23:07:32.330" Score="3" Body="&lt;p&gt;I think both approaches don't answer question of profitability. The most algo systems are more sophisticated than this. I would extend your list to adaptive algorithms, stat models and knowing something that other overlook.&lt;/p&gt;&#xA;" OwnerUserId="1110" LastActivityDate="2011-07-24T23:07:32.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1508" PostTypeId="2" ParentId="306" CreationDate="2011-07-25T02:20:18.863" Score="3" Body="&lt;p&gt;For empirical researching, we used MATLAB for the ease of implementation.&#xA;We coupled with some C++ functions for the speed of backtesting in MATLAB.&#xA;We tried Excel, VBA but its too slow for processing a huge amount of data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For execution, it will depends if the strategy is sensitive to slippage.  If high speed execution is required, C++.  If not, Java is what we preferred.&lt;/p&gt;&#xA;" OwnerUserId="1054" LastActivityDate="2011-07-25T02:20:18.863" CommentCount="0" CommunityOwnedDate="2011-07-25T02:20:18.863" ContentLicense="CC BY-SA 3.0" />
  <row Id="1509" PostTypeId="2" ParentId="306" CreationDate="2011-07-25T10:52:43.737" Score="30" Body="&lt;p&gt;Searching &lt;a href=&quot;http://www.quantfinancejobs.com&quot;&gt;http://www.quantfinancejobs.com&lt;/a&gt; for&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&quot;C#&quot;: 62 jobs, 54 (2011) &lt;/li&gt;&#xA;&lt;li&gt;&quot;C++&quot;: 209 jobs, 236 (2011)&lt;/li&gt;&#xA;&lt;li&gt;&quot;Java&quot;: 72 jobs, 121 (2011)&lt;/li&gt;&#xA;&lt;li&gt;&quot;VBA&quot;: 35 jobs, 20 (2011)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Searching &lt;a href=&quot;http://www.quantcode.com/modules/jobs/&quot;&gt;http://www.quantcode.com/modules/jobs/&lt;/a&gt; for &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&quot;C#&quot;: 228 jobs, 277 (2011)&lt;/li&gt;&#xA;&lt;li&gt;&quot;C++&quot;: 696 jobs, 813 (2011)&lt;/li&gt;&#xA;&lt;li&gt;&quot;Java&quot;: 291 jobs, 328 (2011)&lt;/li&gt;&#xA;&lt;li&gt;&quot;VBA&quot;: 157 jobs, 190 (2011)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="796" LastEditorDisplayName="user1606" LastEditDate="2011-11-17T14:02:18.480" LastActivityDate="2011-11-17T14:02:18.480" CommentCount="1" CommunityOwnedDate="2011-07-25T10:52:43.737" ContentLicense="CC BY-SA 3.0" />
  <row Id="1510" PostTypeId="2" ParentId="306" CreationDate="2011-07-25T11:20:05.000" Score="4" Body="&lt;p&gt;It is true that C++ is oftenly required in jobs advertising but for me it is as a pledge of programming knowledge.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, in my opinion C# use tends to  become the next standard over the next few years in the quant industry. I see two reasons for that, &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;from a programming point of view, C# is very mature programming language AND does (natively) offer a plenty of very interesting possibilities such interaction with databases, excel, real time application, GPU programming  ..  and the transition for a C++ programmer is incredibly easy, &lt;/li&gt;&#xA;&lt;li&gt;the number of high end numerical libraries available in C#&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="539" LastActivityDate="2011-07-25T11:20:05.000" CommentCount="5" CommunityOwnedDate="2011-07-25T11:20:05.000" ContentLicense="CC BY-SA 3.0" />
  <row Id="1511" PostTypeId="2" ParentId="1501" CreationDate="2011-07-25T14:25:26.827" Score="7" Body="&lt;p&gt;Is your question more about approaches taken on the buy side vs. sell side?  If so, you may want to read &lt;a href=&quot;http://www.symmys.com/node/62&quot;&gt;Attilio Meucci's paper, P vs. Q&lt;/a&gt;, on this topic.  He breaks down the dichotomy as derivatives pricing (the &quot;Q&quot; world), which uses a lot of very sophisticated modeling involving Ito calculus and PDEs, and portfolio management (the &quot;P&quot; world), which makes use of a lot of statistics and large scale estimation.  Both sides, however, may do some sophisticated mathematical modeling, but only the buy side truly &quot;mines&quot; the data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your question is more about what is done on the buy side, it would depend on what you mean by &quot;dominates.&quot;  The pure data mining approaches tend not to work well at all beyond very short horizons.  As @Quant-Guy has already mentioned, these approaches are most often found at market making and high frequency trading (HFT) firms.  Many studies have already found that well over half the trading in U.S. equities (all trading, not just quant) is done by these firms, so there is no question that these firms dominate in terms of $ traded.  If anything, the flash crash revealed that these firms are already too large.  On the other hand, most of these kinds of strategies are extremely capacity constrained, whereas the modeling approaches tend to work well at longer horizons as well.  Consequently, the modelers tend to dominate in terms of AUM.  Like the flash crash for HFT firms, the Quant Quake of Auguest 2007 revealed that the modeling types were also too large.  Now that each category of quant finance has had its own mini-crisis, it is anybody's guess which will dominate in the future (perhaps neither/both).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are seriously interested in a taxonomy of quant strategies, and particularly quant equity, you should check out &lt;a href=&quot;http://www.cap.columbia.edu/pdf-files/Hayes_CAP_2010.pdf&quot;&gt;Morgan Stanley's presentation on this topic&lt;/a&gt;.  They break down all quant funds as follows (some firms may do more than one of these):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Equity&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Equity Market Neutral&lt;/li&gt;&#xA;&lt;li&gt;Technical&lt;/li&gt;&#xA;&lt;li&gt;Event-Driven&lt;/li&gt;&#xA;&lt;li&gt;Hedge Fund Replication&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Futures &amp;amp; Forwards&#xA;&lt;ul&gt;&#xA;&lt;li&gt;CTAs&lt;/li&gt;&#xA;&lt;li&gt;Short-Term Traders&lt;/li&gt;&#xA;&lt;li&gt;Systematic Macro&lt;/li&gt;&#xA;&lt;li&gt;HF Replication&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Options&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Volatility Arbitrage&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Credit&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Correlation, basis trading, long/short&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Hybrid Asset Strategies&#xA;&lt;ul&gt;&#xA;&lt;li&gt;HF Replication&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The MS presentation then goes in depth into comparisons of EMN and Technical Equities strategies.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-07-25T14:47:09.187" LastActivityDate="2011-07-25T14:47:09.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1512" PostTypeId="2" ParentId="987" CreationDate="2011-07-25T15:31:13.017" Score="7" Body="&lt;p&gt;I believe the reason no one has been able to come up with an example of a quant fund employing the academic factor-based approach with stellar performance is because there aren't any (at least not any with decent sized AUM).  For a while, now, there has been a debate amongst institutional investors and quantitative professionals as to whether &lt;a href=&quot;https://advisors.vanguard.com/VGApp/iip/site/advisor/researchcommentary/commentary/article/IWE_NewsBoardroom&quot;&gt;quant is dead&lt;/a&gt;.  The alpha factor approach is definitely not the kind of magic bullet many people thought it would be.  In part I believe the reason for its perceived failure is that expectations were too high to begin with.  Even @gappy's question, which asks about 15-20%/yr over an extended period, shows this.  Such returns are simply not possible on a large asset base.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Over time, the alpha factors have morphed into risk factors.  The latest fad now appears to be factor timing (see &lt;a href=&quot;http://www.edhec-risk.com/edhec_publications/all_publications/RISKReview.2010-10-22.4500?newsletter=yes&quot;&gt;EDHEC&lt;/a&gt;, &lt;a href=&quot;http://ebookee.org/dl/Deutsche-Bank-Style-Rotation/&quot;&gt;Deutsche Bank&lt;/a&gt;, &lt;a href=&quot;https://mm.jpmorgan.com/stp/t/c.do?i=2A534-7&amp;amp;u=a_p%2ad_504293.pdf%2ah_-pt95v9j%0D%0A&quot;&gt;JPMorgan&lt;/a&gt;, Bernstein, Macquarie, and others).  Yet practitioners acknowledge that factor timing is much harder than it appears.  There also seems to be some emphasis on finding new and original data sources, but after a while even these &quot;new&quot; data sources will become old.  The paradigm itself is being called into question.  In fact, much of the debate now is as to whether there ever really was an edge in these factors, or perhaps GSAM, AQR, and the other major quant equity firms were merely benefiting from the huge inflows into the space pushing valuations in their direction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On a final note, I've never heard of Malyshev, but it's not clear that Simons and Thorp didn't/don't make abundant use of academic finance research generally.  Merely that they do not employ the factor paradigm as an organizing principle behind their primary strategies.  Even Simons, btw, has his own foray into traditional factor-based quant equity in the form of RIEF.  &lt;a href=&quot;http://dealbook.nytimes.com/2011/07/07/in-rough-year-renaissance-notches-21-percent-gain/&quot;&gt;Reportedly&lt;/a&gt;, this has not worked so well, with the fund seeing major losses in 2007, 2008, and 2009.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-07-25T20:39:32.930" LastActivityDate="2011-07-25T20:39:32.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1513" PostTypeId="2" ParentId="987" CreationDate="2011-07-25T16:11:37.183" Score="0" Body="&lt;p&gt;Joel Greenblatt (Columbia Business School) has some outsized returns. However, he does not use an equilibrium factor model framework. I would consider him a practitioner who has done well and therefore teaches.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2011-07-25T16:11:37.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1514" PostTypeId="1" CreationDate="2011-07-25T21:44:18.100" Score="6" ViewCount="821" Body="&lt;p&gt;The basic principles of &lt;a href=&quot;http://en.wikipedia.org/wiki/Arbitrage#Convertible_bond_arbitrage&quot; rel=&quot;nofollow&quot;&gt;convertible bond arbitrage&lt;/a&gt; have been clear at least since &lt;a href=&quot;http://www.edwardothorp.com/sitebuildercontent/sitebuilderfiles/beatthemarket.pdf&quot; rel=&quot;nofollow&quot;&gt;Thorp and Kassouf (1967)&lt;/a&gt;.  For those who are not familiar, the arbitrage entails purchasing a convertible bond and selling short the underlying stock, creating a delta neutral hedge long volatility position.  Arbitrageurs profit from dynamically hedging the long volatility exposure, adding to or subtracting from the short stock position as the stock price changes.  The trade generates a positive return if the actual volatility over the life of the position is greater than the implied volatility of the convertible bond, accounting for income/expenditure from the bond’s coupons, the stock’s dividends, and interest rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.efmaefm.org/efma2005/papers/114-hutchinson_paper.pdf&quot; rel=&quot;nofollow&quot;&gt;Hitchinson and Gallagher (2004)&lt;/a&gt; documented and replicated the original strategy and compared it to hedge fund returns.  They found that their convertible bond arbitrage strategy had lower returns and higher volatility and kurtosis than either the HFRI Convertible Arbitrage Index or the CSFB Tremont Convertible Arbitrage Index.  This leads me to believe that the strategies employed by the hedge funds must be considerably more advanced and sophisticated than the simple strategy first published in 1967.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More technically sophisticated models of convertible arbitrage are out there (&lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.15.6199&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow&quot;&gt;Ayache-Forsyth-Vetzal&lt;/a&gt;, &lt;a href=&quot;http://www.iijournals.com/doi/abs/10.3905/jfi.1998.408243&quot; rel=&quot;nofollow&quot;&gt;Tsiveriotis-Fernandes&lt;/a&gt;, and &lt;a href=&quot;http://www.jstor.org/pss/2330567&quot; rel=&quot;nofollow&quot;&gt;Brennan-Schwartz&lt;/a&gt; are the most popular), but most work following these models is more concerned with their estimation and their accuracy in pricing, rather than the P&amp;amp;L performance of a strategy based on the models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is anyone aware of academic or professional quality research which tests the profitability of some of the sophisticated convertible bond arbitrage models on real data?  Has anyone even done any work replicating convertible arbitrage and documenting its performance in the last 8 years?  I am particularly interested in strategies that incorporate CDS prices, but anything at all would be nice.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-08-07T12:52:01.807" LastActivityDate="2011-08-07T12:52:01.807" Title="What research is available on the performance of convertible bond arbitrage models?" Tags="&lt;volatility&gt;&lt;strategy&gt;&lt;arbitrage&gt;&lt;convertible-bond&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1515" PostTypeId="1" AcceptedAnswerId="1516" CreationDate="2011-07-26T05:34:33.593" Score="19" ViewCount="4082" Body="&lt;p&gt;I would like to learn more about the possible ways of doing quantitative research regarding option market making.  In particular, while the mainstream index option market may be very liquid, the single stock option market is highly illiquid.  I would like to research market making in single stock options while making use of greater liquidity in index options.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, I would love to read a few books which cover the quant aspects of option market making more generally.&lt;/p&gt;&#xA;" OwnerUserId="1118" LastEditorUserId="1106" LastEditDate="2011-08-10T18:19:09.213" LastActivityDate="2011-08-10T18:19:09.213" Title="How can I learn about the quantitative aspects of market making in illiquid single stock options?" Tags="&lt;equities&gt;&lt;quant-trading-strategies&gt;&lt;option-strategies&gt;&lt;market-making&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="1516" PostTypeId="2" ParentId="1515" CreationDate="2011-07-26T14:26:15.963" Score="12" Body="&lt;p&gt;A good place to start learning about option market making using quantitative techniques is &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470497106&quot;&gt;Euan Sinclair's Option Trading&lt;/a&gt; (chapter 10 is devoted to market making techniques).  He also gives a decent introduction to a more sophisticated quantitative market making technique which he calls information-based market making.  Specifically, he explains how to apply Kalman filtering to optimally incorporate new information into an estimate of value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sinclair's Volatility Trading is also a good reference for options, but more geared towards aggressive strategies that attempt to predict where the market is headed.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;As for your actual question regarding market making in illiquid markets, I believe your best bet is to learn all the &lt;a href=&quot;http://en.wikipedia.org/wiki/Greeks_%28finance%29&quot;&gt;Greeks&lt;/a&gt; well and try to create tools to manage them in real time.  Your question suggests that you would like to hedge your individual equity options with index options.  Index options are generally a very poor hedge for the options on the constituents of the index.  Rather, most market makers dynamically hedge by trading the underlying and by trading other options contracts on the same underlying (different strikes/maturities) that may be more liquid.  Remember that, at least in theory, an option can be perfectly hedged by dynamically trading the underlying.  In practice, due to the risk of jumps in the underlying and to hedge higher order Greeks, market makers attempt to hedge using other options (in the same underlying) first, and then hedge the residual exposure by trading in the underlying.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;A good way to start learning, as Sinclair writes, is mimicry:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If a trader has no clue where to quote a market, a good trick is to identify a competent trader and post the same prices as him.  The identification of the “competent” trader is not actually crucial either.  This trick works purely because it keeps the trader on the general market and hence collecting the bid-ask spread. And as we saw in the Chapter&#xA;  on volatility trading, even hedging these trades at the current implied volatility gives as good a result as anything else. This method is good for generating revenue, however it is poor for inventory management and traders using it will find themselves with problems&#xA;  as they approach expiration.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-07-26T14:26:15.963" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1517" PostTypeId="2" ParentId="1515" CreationDate="2011-07-26T14:45:54.073" Score="7" Body="&lt;p&gt;For single stock options against index options, this may be of interest:&#xA;&lt;a href=&quot;http://www.nuclearphynance.com/User%20Files/2/Dispersion%20-%20A%20guide%20for%20the%20clueless%201.1.pdf&quot;&gt;Dispersion -- A Guide for the clueless&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="508" LastActivityDate="2011-07-26T14:45:54.073" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="1518" PostTypeId="2" ParentId="1466" CreationDate="2011-07-26T15:19:47.447" Score="2" Body="&lt;p&gt;Time-series regression is not a great method for determining betas on individual securities.  Rather, the most common method used by the commercial risk model providers is called &quot;predicted beta&quot; or &quot;fundamental beta.&quot;  The leader in this area is &lt;a href=&quot;http://www.barra.com/support/library/PredictedBeta.pdf&quot; rel=&quot;nofollow&quot;&gt;Barra&lt;/a&gt;.  The way they define the predicted beta, it appears that they include the constant in the regression.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-07-26T15:19:47.447" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1519" PostTypeId="2" ParentId="1475" CreationDate="2011-07-26T15:55:07.353" Score="2" Body="&lt;p&gt;Can you point to a source saying that the risks really are different?  See the risk section of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Contract_for_difference&quot; rel=&quot;nofollow&quot;&gt;wikipedia&lt;/a&gt; page.  The market risk of an equity CFD and the corresponding equity should be the same.  A CFD trader also faces additional liquidation (leverage) risk and counterparty risk, which an ordinary unlevered equity trader does not.  There are also a few other differences in risk due to corporate actions (dividends).  Once again, the wikipedia page explains everything here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My impression is that CFDs are functionally equivalent to futures, except that they are traded OTC and have smaller contract sizes.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-07-26T15:55:07.353" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="1520" PostTypeId="2" ParentId="1343" CreationDate="2011-07-26T20:13:43.513" Score="2" Body="&lt;p&gt;You may also be interested in a series of papers by &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1695596&amp;amp;rec=1&amp;amp;srcabs=1748633&quot; rel=&quot;nofollow&quot;&gt;Easley, de Prado, and O'Hara (2011), Flow Toxicity and Volatility in a High Frequency World&lt;/a&gt;.  This paper follows up on a measure of the effect of trades on prices developed by two of the authors in &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/0304405X87900298&quot; rel=&quot;nofollow&quot;&gt;1987&lt;/a&gt;.  They show that the new measure, which takes volume and concurrent price movements into account, can predict rapid changes in liquidity such as the &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1695041&amp;amp;rec=1&amp;amp;srcabs=1695596&quot; rel=&quot;nofollow&quot;&gt;&quot;flash crash&quot;&lt;/a&gt;.  From the abstract (published in JPM Winter 2011):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The ‘flash crash’ of May 6th 2010 was the second largest point swing (1,010.14 points) and the biggest one-day point decline (998.5 points) in the history of the Dow Jones Industrial Average. For a few minutes, $1 trillion in market value vanished. In this paper, we argue that the ‘flash crash’ is the result of the new dynamics at play in the current market structure. We highlight the role played by order toxicity in affecting liquidity provision, and we show that a measure of this toxicity, the Volume-Synchronized Probability of Informed Trading (VPIN)*, captures the increasing toxicity of the order flow in the hours and days prior to collapse.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-07-26T20:13:43.513" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1521" PostTypeId="5" CreationDate="2011-07-26T20:49:54.950" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2011-07-26T20:49:54.950" LastActivityDate="2011-07-26T20:49:54.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1522" PostTypeId="4" CreationDate="2011-07-26T20:49:54.950" Score="0" Body="The process of evaluating a strategy, theory, or model by applying it to historical data." OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-07-26T20:50:19.550" LastActivityDate="2011-07-26T20:50:19.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1523" PostTypeId="5" CreationDate="2011-07-26T20:51:51.407" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2011-07-26T20:51:51.407" LastActivityDate="2011-07-26T20:51:51.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1524" PostTypeId="4" CreationDate="2011-07-26T20:51:51.407" Score="0" Body="The volatility of the price of the underlying security that is implied by the market price of an option based on an option pricing model." OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-07-27T00:10:12.013" LastActivityDate="2011-07-27T00:10:12.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1525" PostTypeId="5" CreationDate="2011-07-26T20:54:06.240" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2011-07-26T20:54:06.240" LastActivityDate="2011-07-26T20:54:06.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1526" PostTypeId="4" CreationDate="2011-07-26T20:54:06.240" Score="0" Body="The identification, assessment, and prioritization of risks, followed by coordinated and economical application of resources to minimize, monitor, and control the probability and/or impact of unfortunate events or to maximize the realization of opportunities." OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-07-27T00:10:00.203" LastActivityDate="2011-07-27T00:10:00.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1527" PostTypeId="5" CreationDate="2011-07-26T20:55:43.010" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2011-07-26T20:55:43.010" LastActivityDate="2011-07-26T20:55:43.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1528" PostTypeId="4" CreationDate="2011-07-26T20:55:43.010" Score="0" Body="Attempting to profit from short-term fluctuations in a security's price as opposed to investing in the security for use or income." OwnerUserId="1106" LastEditorUserId="35" LastEditDate="2011-07-27T00:11:20.513" LastActivityDate="2011-07-27T00:11:20.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1529" PostTypeId="5" CreationDate="2011-07-26T20:59:01.633" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2011-07-26T20:59:01.633" LastActivityDate="2011-07-26T20:59:01.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1530" PostTypeId="4" CreationDate="2011-07-26T20:59:01.633" Score="0" Body="Questions about models for the valuation of option contracts." OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-07-27T00:11:34.757" LastActivityDate="2011-07-27T00:11:34.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1531" PostTypeId="5" CreationDate="2011-07-26T21:00:04.207" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2011-07-26T21:00:04.207" LastActivityDate="2011-07-26T21:00:04.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1532" PostTypeId="4" CreationDate="2011-07-26T21:00:04.207" Score="0" Body="The Chicago Board Options Exchange Market Volatility Index, a popular measure of the implied volatility of S&amp;P 500 index options." OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-07-27T00:11:46.050" LastActivityDate="2011-07-27T00:11:46.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1533" PostTypeId="5" CreationDate="2011-07-26T21:08:10.690" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2011-07-26T21:08:10.690" LastActivityDate="2011-07-26T21:08:10.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1534" PostTypeId="4" CreationDate="2011-07-26T21:08:10.690" Score="0" Body="Fixed-income instruments whose price depends in large part upon judgments of the creditworthiness of a corporation or government." OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-07-27T00:11:57.330" LastActivityDate="2011-07-27T00:11:57.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1535" PostTypeId="1" AcceptedAnswerId="1693" CreationDate="2011-07-27T03:10:33.247" Score="6" ViewCount="3309" Body="&lt;p&gt;What are the advantages of buying basket equity swaps derivative compared to single equity swap? Will correlation play a role in basket equity swap?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="1111" LastActivityDate="2011-08-15T17:28:18.997" Title="Basket equity swap" Tags="&lt;equities&gt;&lt;swaps&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1536" PostTypeId="1" CreationDate="2011-07-27T10:34:43.080" Score="5" ViewCount="1087" Body="&lt;p&gt;I'd like to use the &lt;a href=&quot;http://braverock.com/brian/R/PerformanceAnalytics/html/PerformanceAnalytics-package.html&quot;&gt;PerformanceAnalytics R package&lt;/a&gt; to view various metrics from a list of trades with profit values.  From looking at the documentation from the PerformanceAnalytics package that most functions are set up to use a time series of prices rather than an array of profit values (which of course can be negative).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can PerformanceAnalytics be used on an array of profit values (from a backtest that might have several instruments in it for example)?  If not, is there a way to convert the profit values to a format that makes sense to input into most PerformanceAnalytics functions?&lt;/p&gt;&#xA;" OwnerUserId="593" LastActivityDate="2011-07-27T13:28:12.963" Title="Use Trades as Input for PerformanceAnalytics" Tags="&lt;r&gt;&lt;performanceanalytics&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1537" PostTypeId="2" ParentId="1536" CreationDate="2011-07-27T11:14:30.753" Score="0" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;...is there a way to convert the profit values to a format that makes sense to input into most PerformanceAnalytics functions?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Assume trade outcomes of 10, -5, 15,... for example, and starting equity of 100, then your equity time series will be 100, 110, 105, 120,... from which &lt;em&gt;returns&lt;/em&gt; can be calculated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taken from the link you gave &quot;In general, this library requires &lt;em&gt;return&lt;/em&gt; (rather than price) data.&quot;&lt;/p&gt;&#xA;" OwnerUserId="252" LastActivityDate="2011-07-27T11:14:30.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1538" PostTypeId="2" ParentId="1536" CreationDate="2011-07-27T13:28:12.963" Score="8" Body="&lt;p&gt;If you've got a list of trades, I would first suggest using the &lt;a href=&quot;https://r-forge.r-project.org/projects/blotter/&quot;&gt;blotter&lt;/a&gt; package to enter those transactions and compute your cash P&amp;amp;L.  Then you can use the &lt;code&gt;tradeStats&lt;/code&gt; function to see trade related statistics, or the &lt;code&gt;portfReturns&lt;/code&gt; function to extract percent returns for your portfolio of symbols as a contribution to total account equity returns.  After calling portfReturns, all the functions in PerformanceAnalytics will have the inputs that they expect.&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2011-07-27T13:28:12.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1539" PostTypeId="2" ParentId="1504" CreationDate="2011-07-27T13:32:56.890" Score="8" Body="&lt;p&gt;The &lt;a href=&quot;https://r-forge.r-project.org/R/?group_id=579&quot; rel=&quot;nofollow noreferrer&quot;&gt;PortfolioAnalytics&lt;/a&gt; package will create weights without reference to current weights, if that's what you want.  It should also have much of the reporting that you like from Rmetrics fPortfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a longer seminar presentation on Portfolioanalytics from 2010's R/Finance conference here: &lt;a href=&quot;http://past.rinfinance.com/agenda/2010/Carl+Peterson+Boudt_Tutorial.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Complex Portfolio Optimization with Generalized Business Objectives&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="34982" LastEditDate="2019-03-25T16:52:27.017" LastActivityDate="2019-03-25T16:52:27.017" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="1540" PostTypeId="2" ParentId="141" CreationDate="2011-07-27T16:19:37.950" Score="2" Body="&lt;p&gt;Does anyone have any experience with or knowledge of &lt;a href=&quot;http://www.livevol.com&quot; rel=&quot;nofollow&quot;&gt;livevol&lt;/a&gt;?  They are the only source I've found for historical intraday options data, especially including implied volatility and Greeks calculation, and pricing seems not bad.  Even the real-time service seems decent, although it is unclear how it could potentially be tied in to an API.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-07-27T16:19:37.950" CommentCount="3" CommunityOwnedDate="2011-07-27T16:19:37.950" ContentLicense="CC BY-SA 3.0" />
  <row Id="1542" PostTypeId="1" CreationDate="2011-07-28T17:16:20.063" Score="13" ViewCount="653" Body="&lt;p&gt;What are the standard models used to forecast asset price movements?  For example, if I were to trade an option, what model would I use in conjunction with option pricing models to forecast the stock price?  Should I use GARCH or one of its variants?&lt;/p&gt;&#xA;" OwnerUserId="1029" LastEditorUserId="1106" LastEditDate="2011-08-04T21:19:26.120" LastActivityDate="2011-08-04T21:19:26.120" Title="What methods do I need to learn in order forecast asset price movements?" Tags="&lt;time-series&gt;&lt;equities&gt;&lt;forecasting&gt;&lt;models&gt;&lt;asset-pricing&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1544" PostTypeId="2" ParentId="1435" CreationDate="2011-07-28T17:39:44.630" Score="-1" Body="&lt;p&gt;A simpler solution I found is to discount the differences between current spread and original spread:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$MV_{CDS}=T \cdot (s_0 - s_t )\cdot \sum_{i=1}^{T}{e^{-r\cdot i }}$&lt;/p&gt;&#xA;" OwnerUserId="357" LastActivityDate="2011-07-28T17:39:44.630" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1545" PostTypeId="2" ParentId="1542" CreationDate="2011-07-28T22:49:02.747" Score="13" Body="&lt;p&gt;You can forecast stock prices thru time-series models, cross-sectional, or panel models. There is considerable variation within these categories.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In time-series models you would use an auto-regressive model such as an AR(1) where the independent variable is the dependent variable lagged by one period. Naturally, an AR(2) would consist of 2 lags and so on. AR(1) models are best when the stock price exhibits mean reversion and does not have a &lt;a href=&quot;http://en.wikipedia.org/wiki/Unit_root&quot;&gt;unit root&lt;/a&gt;. You would have to perform an analysis to determine the appropriate # of lags (partial auto-correlation coefficient, checks for seasaonlity, heteroskedasticity, etc.) and so forth. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other time-series models include the &lt;a href=&quot;http://en.wikipedia.org/wiki/Moving_average_model&quot;&gt;Moving Average&lt;/a&gt; MA(1), or combination models such as ARIMA. These models have different properties from AR(1) models. For example, the auto-correlation function of the residuals for a MA(1) collapses to zero after one lag.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GARCH and ARCH models are also worth exploring, particularly for volatility modeling, however this specification is not used for modeling returns because returns do not have clustering and memory in the same way that volatility does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would recommend &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0471690740&quot;&gt;Ruey Tsay&lt;/a&gt;'s text to learn more about time-series models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cross-sectional models use multiple regression to predict returns based on a security's characteristics or exposures to factors. In this case you may elect to explain security returns in terms of a factor model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other models might consist of panel models (i.e. time series and cross-sectional) such as random effects or mixed effects. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In any modeling choice, however, you are making a claim as to the structure of the data generating process. I would argue that you begin with empirical study, develop a theory that describes returns, and then formulate your ideas on the best approach to model the series. Some popular theories are covered in John Cochrane's &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0691121370&quot;&gt;asset pricing&lt;/a&gt; text.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-07-29T18:42:28.690" LastActivityDate="2011-07-29T18:42:28.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1546" PostTypeId="2" ParentId="306" CreationDate="2011-07-29T01:32:33.090" Score="10" Body="&lt;h3&gt;I recently did a 'Poll' on 'LinkedIn' about this topic that got &lt;em&gt;&lt;strong&gt;160 votes&lt;/strong&gt;&lt;/em&gt; &lt;em&gt;&lt;strong&gt;and generated some great conversation on this subject.&lt;/strong&gt;&lt;/em&gt;&lt;/h3&gt;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.opensourcetrader.com/ad&quot; rel=&quot;noreferrer&quot;&gt;http://linkd.in/gHNOgt&lt;/a&gt; &lt;em&gt;&lt;strong&gt;(Poll Results: Java won out)&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;I realized after the fact that I should have structured the question more specifically&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;Ultimately, depending on what component of a trading system you are tasked with building (back office, front office, messaging system, quant. analysis, etc.) different technologies do things better than others, and there is no 'One Size Fits All'&lt;/p&gt;&#xA;&lt;p&gt;Interestingly, if you look at the 'age' demographic of the respondents, C/C++ was typically those whom were a bit older 30+, while the younger generation tended toward Java, F# (OCaml), Or Python.&lt;/p&gt;&#xA;&lt;p&gt;Also, it's important that &lt;em&gt;many programmers whom have mathematical backgrounds tend to find 'functional' languages more useful&lt;/em&gt; as opposed to 'imperative languages'.&lt;/p&gt;&#xA;&lt;p&gt;Both have their pro's and con's, but remember: functional languages tend to compile into &lt;em&gt;faster&lt;/em&gt; byte-code, but maybe harder to adapt to newer technologies for the web.&lt;/p&gt;&#xA;&lt;p&gt;For my part, I'm writing a limit-order-book in F#, Scala (Functional Java), and Python, and am going to study the results.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.opensourcetrader.com&quot; rel=&quot;noreferrer&quot;&gt;http://www.opensourcetrader.com&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="913" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2011-11-06T02:18:39.010" CommentCount="6" CommunityOwnedDate="2011-07-29T01:32:33.090" ContentLicense="CC BY-SA 3.0" />
  <row Id="1547" PostTypeId="1" CreationDate="2011-07-29T12:47:09.063" Score="7" ViewCount="1749" Body="&lt;p&gt;Since no one was able to answer my &lt;a href=&quot;https://quant.stackexchange.com/questions/1514/performance-of-convertible-bond-arbitrage-models&quot;&gt;previous question&lt;/a&gt;, I am going to try to backtest a modern convertible bond arbitrage strategy myself (perhaps I'll report the results back here, if you're lucky :)).  What suite of R packages should I use?  Where can I get the data (free or cheap, preferably)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Updated to add:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main question here is what pre-packaged routines or packages are available to test &lt;em&gt;convertible bond arbitrage models&lt;/em&gt; (see &lt;a href=&quot;https://quant.stackexchange.com/questions/1514/performance-of-convertible-bond-arbitrage-models&quot;&gt;linked question&lt;/a&gt; for description of models), not simply quantitative models in general.  I presume they are most likely to be available in R, but I'd take Matlab, too.  The &lt;a href=&quot;http://www.mathworks.com/help/toolbox/finfixed/cbprice.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;cbprice&lt;/a&gt; function in the &lt;a href=&quot;http://www.mathworks.com/help/toolbox/finfixed/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Fixed-Income Toolbox&lt;/a&gt; leaves much to be desired, here.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2011-08-07T12:53:16.597" Title="How do I backtest a convertible bond arbitrage strategy in R/Matlab?" Tags="&lt;data&gt;&lt;backtesting&gt;&lt;r&gt;&lt;convertible-bond&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1548" PostTypeId="2" ParentId="1479" CreationDate="2011-07-29T18:20:09.503" Score="2" Body="&lt;p&gt;I am still researching this topic more fully, but so far I have found the following advantages to re-coding the strategy in a lower level language (for better or worse, my language of choice in this case is Java):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Access to the latest API.&lt;/strong&gt; R's IBrokers doesn't implement all of the IB API's latest features, and there is no guarantee that the package will be kept up-to-date. I do not like relying on a commercial vendor for a Matlab interface to IB, and most of the developers of these interfaces would lead you to believe that setting it up is no trivial matter.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Personalized trading front-end/GUI.&lt;/strong&gt;  Both R and Matlab's GUI capabilities leave much to be desired.  Java's Swing is a joy to use.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Multi-threading.&lt;/strong&gt;  Although parallel processing has been built into R, and Matlab somewhat if you are willing to pay for it, both were designed as fundamentally single-threaded languages.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Ability to call R/Matlab code from Java.&lt;/strong&gt;  I am as yet unsure as to how well this would work, but it at least seems possible to directly use much of the strategy code I've already built by calling an instance of Matlab from Java.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Help or further advice on this topic would still be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="373" LastEditDate="2012-02-01T22:13:43.503" LastActivityDate="2012-02-01T22:13:43.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1550" PostTypeId="2" ParentId="1514" CreationDate="2011-07-29T23:46:47.870" Score="1" Body="&lt;p&gt;Andrew Lo has an analysis documenting the performance of Convertible Bond strategies (see page 13 &lt;a href=&quot;http://web.mit.edu/alo/www/Papers/replicate.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;). His purpose is to see whether various hedge fund strategies can be replicated by a portfolio of tradeable risk assets. His sample period his 1986-2005.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2011-07-29T23:46:47.870" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1551" PostTypeId="1" CreationDate="2011-07-30T18:18:38.690" Score="4" ViewCount="234" Body="&lt;p&gt;Suppose funds X and Y are the same but X has 0.25% higher management cost. Suppose we are analyzing a 2 year interval. The simple models with discrete/continuous interval -assumptions are not really right below. I will get more specific in the end.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;discrete intervals &lt;code&gt;0.9975**2&lt;/code&gt; &lt;/li&gt;&#xA;&lt;li&gt;continuous intervals $e^{0.0025*2}$&lt;/li&gt;&#xA;&lt;li&gt;$\sum_{0}^{days} a_{i} 0.0025^\frac{t_{i}}{t_{total Days}}$, where $a_{i}$ is amount of capital invested.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This is not really right, as the prices change frequently. Let $P_{1}=P_{0}r_{1}$, $P_{N}=P_{N-1}r_{N}=P_{0} \prod_{0}^{t}r_{i}$ and now to charge the customer we could take charge with as small intervals as possible:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$C_{0} = 0$, $C_{1} = P_{1} pp_{1}$ and $C_{N} = P_{N} pp_{N}$,&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;where $pp_{N}$ is a charging function. It is a function because the economic cost to the investor is not really just day-adjusted cost but the foregone opportunity to invest into the fund. Now the sum of such costs differ with convexity. If we have a rising market, the accounting cost is less than the economic cost according to Jensen (note that the accounting cost is just taken from the end result while the economic cost of each single CF):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$EC = \sum^{n}_{i=1} p_{i} pp(x_{i}) \geq pp( \sum_{i=1}^{n} p_{i} x_{i}) = AC$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is opposite for the opposite convexity. Because of changing convexity, I have found it very hard to track the impact of cost on the return. Its impact does change over time as described.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I quantify the impact of management cost on return? What kind of approximations do you use and how do they differ with different convexity? It is very hard for me to separate the impact of management cost from other issues such as style-drifting. I need to find some proper ways with proper significance levels to investigate this issue. Any paper about this?&lt;/p&gt;&#xA;" OwnerUserId="956" LastEditorUserId="1106" LastEditDate="2011-10-03T14:57:24.140" LastActivityDate="2011-10-03T14:57:24.140" Title="How to quantify the impact of management cost on return?" Tags="&lt;portfolio-management&gt;&lt;reference-request&gt;&lt;theory&gt;&lt;funds&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1552" PostTypeId="1" CreationDate="2011-07-30T21:58:24.133" Score="9" ViewCount="796" Body="&lt;p&gt;I currently use the following process for bootstrapping a multivariate time series in R:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Determine block sizes - run the function b.star in the np package which produces a block size for each series&lt;/li&gt;&#xA;&lt;li&gt;Select maximum block size&lt;/li&gt;&#xA;&lt;li&gt;Run tsboot on any series using the selected block size&lt;/li&gt;&#xA;&lt;li&gt;Use index from bootstrap output to reconstruct multivariate time series&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Someone suggested using the meboot package as an alternative to the block bootstrap but since I am not using the entire data set to select a block size, I am unsure of how to preserve correlations between series if I were to use the index created by running meboot on one series. If anyone has experience with meboot in a multivariate setting, I would greatly appreciate advice on the process.&lt;/p&gt;&#xA;" OwnerUserId="232" LastActivityDate="2011-07-30T21:58:24.133" Title="Alternative to Block Bootstrap for Multivariate Time Series" Tags="&lt;time-series&gt;&lt;r&gt;&lt;multivariate&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1553" PostTypeId="2" ParentId="1256" CreationDate="2011-07-31T03:33:42.847" Score="4" Body="&lt;p&gt;If $\Sigma$ is the variance/covariance matrix of random variables $U_1, U_2, \ldots U_n$, and $V = c + w_1 U_1 + \ldots + w_n U_n$, where $c$ is a constant, and we let $\mathbf{w}$ be the vector with the 'weights' $w_1, w_2, \ldots, w_n$, then the variance of $V$ is equal to $\mathbf{w}^{\top}\Sigma\mathbf{w}$. Moreover, if $T$ is another random variable described by weights vector $\mathbf{x}$, then the variance of $T$ is $\mathbf{x}^{\top}\Sigma\mathbf{x}$, and the covariance of $V$ and $T$ is equal to $\mathbf{x}^{\top}\Sigma\mathbf{w}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your problem, &#xA;$$&#xD;&#xA;\Sigma = \begin{bmatrix}&#xD;&#xA;  1 &amp;amp; 0 \\&#xD;&#xA;  0 &amp;amp; 1&#xD;&#xA; \end{bmatrix}&#xD;&#xA;$$&#xA;and you are looking at weights vectors $[\lambda_{11}\,0]$ and $[\lambda_{21}\,\lambda_{22}]$, thus the variance of $X_1$ is $\lambda_{11}^2$, which is the first equation, and the variance of $X_2$ is $\lambda_{21}^2 + \lambda_{22}^2$, which is the second equation. Computing the covariance of $X_1$ and $X_2$ gives the third equation.&lt;/p&gt;&#xA;" OwnerUserId="108" LastEditorUserId="108" LastEditDate="2011-08-01T22:33:26.993" LastActivityDate="2011-08-01T22:33:26.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1554" PostTypeId="1" AcceptedAnswerId="1574" CreationDate="2011-07-31T16:33:06.757" Score="13" ViewCount="13259" Body="&lt;p&gt;I'm trying to make up my mind and choose a broker, however much of my choice depends on the trading API offered.&#xA;I'm definitely not interested in FIX solutions and I'd very much like a .NET implementation of the client interface.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far I've looked at MBTrading (poorly implemented, not compatible with modern software stacks), IB (complicated, not .NET, requires their TWS software to be running as a proxy), Thinkorswim (little documentation, not .NET).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also have some experience with Lime Brokerage's API, which is very nice indeed, however I'm afraid the operation I intend on starting might not meet their minimums.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any good alternatives?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course an API is worthless without an efficient broker, so speed of execution and a decent fee structure would be appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="788" LastEditorUserId="1106" LastEditDate="2011-08-08T03:27:59.263" LastActivityDate="2013-05-17T20:55:04.437" Title="Which brokers offer a .NET stock trading API?" Tags="&lt;automated-trading&gt;&lt;equities&gt;&lt;programming&gt;&lt;broker&gt;" AnswerCount="7" CommentCount="6" FavoriteCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="1555" PostTypeId="1" AcceptedAnswerId="1607" CreationDate="2011-07-31T18:23:36.783" Score="5" ViewCount="378" Body="&lt;p&gt;Given this equation, according to the article &lt;a href=&quot;http://hoisingtonmgt.com/pdf/HIM2011Q2NP.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;at this location&lt;/a&gt; , which provides the following equation as an argument, the author claims that he predicts &quot;deflation&quot; in the last paragraph of the article.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/dY90T.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From what I see, given that his article predicts a fairly constant interest rate, and the fact that we know T-G will always be negative, this seems to imply that P (price levels) , in the economy, must fall in order to equalize this equation?   This seems to imply that , even though money supply is being pumped into the system, price levels MUST fall at a greater percentage rate in order to continue to equalize this equation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NOTE: where Govt Debt = National Debt - Public Debt&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for comments from anyone on this equation and what it means to you.  Or , if I am wrong, I am looking for a correction (as an answer to this question).&lt;/p&gt;&#xA;" OwnerUserId="1139" LastActivityDate="2011-08-07T17:57:04.550" Title="Will price levels fall even though money supply increases?" Tags="&lt;macro-economics&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1556" PostTypeId="2" ParentId="1554" CreationDate="2011-07-31T20:22:13.837" Score="2" Body="&lt;p&gt;I would suggested you have a look @ Interactive Brokers, they seem to have a very decent API and reasonable fee structure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.interactivebrokers.com/en/p.php?f=programInterface&quot; rel=&quot;nofollow&quot;&gt;http://www.interactivebrokers.com/en/p.php?f=programInterface&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="913" LastActivityDate="2011-07-31T20:22:13.837" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1557" PostTypeId="1" CreationDate="2011-07-31T22:58:49.320" Score="16" ViewCount="6827" Body="&lt;p&gt;I need to calculate the skewness of a portfolio consisting of 6 assets. I know that for that I would need the co-skewness matrix between the assets. Does anybody know the formula for co-skewness or any simple software to calculate a co-skewness matrix?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any useful information would be highly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="1140" LastEditorUserId="1106" LastEditDate="2011-08-07T19:02:47.927" LastActivityDate="2016-02-12T06:52:06.157" Title="How do I calculate the skewness of a portfolio of assets?" Tags="&lt;time-series&gt;&lt;statistics&gt;&lt;portfolio-management&gt;&lt;skewness&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="1558" PostTypeId="2" ParentId="1557" CreationDate="2011-08-01T06:22:21.790" Score="2" Body="&lt;p&gt;Have a look at PortfolioAnalytics in R.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; library(PerformanceAnalytics)&#xA;&amp;gt; data(managers)&#xA;&amp;gt; CoSkewness(managers, managers)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="17" LastActivityDate="2011-08-01T06:22:21.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1559" PostTypeId="2" ParentId="461" CreationDate="2011-08-01T13:40:28.447" Score="2" Body="&lt;p&gt;I am planning on using a complex event processing platform such as &lt;a href=&quot;http://esper.codehaus.org/&quot; rel=&quot;nofollow&quot; title=&quot;Esper&quot;&gt;Esper&lt;/a&gt; or &lt;a href=&quot;http://www.streambase.com/&quot; rel=&quot;nofollow&quot;&gt;StreamBase&lt;/a&gt; to handle the incoming tick data to generate buy/sell events. The tick data would also be  be forwarded through a queue (0MQ or RabbitMQ) to be written to a datastore (file or SQL database). By doing so, I have the data necessary to backtest or analyze in R or MATLAB, while still being able to act on the data &quot;real-time&quot;. It seems that, depending on transaction volumes and frequency, that a SQL database may become a bottleneck if you want to act on data near real-time since using a SQL database would require that you pick a trigger or a time period to generate a query.&lt;/p&gt;&#xA;" OwnerUserId="1138" LastActivityDate="2011-08-01T13:40:28.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1560" PostTypeId="2" ParentId="1551" CreationDate="2011-08-01T14:45:51.990" Score="1" Body="&lt;p&gt;Is the management fee deducted daily or annually?  Or perhaps are you trying to quantify the difference between the two?  If annually, are fees in this example deducted based on average daily balance, or ending balance?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think you are also confusing yourself regarding economic vs. accounting cost.  Look at how much money is left in the fund after fees under different scenarios versus how much the manager collected in fees.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-08-01T14:45:51.990" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="1561" PostTypeId="2" ParentId="636" CreationDate="2011-08-01T18:05:57.267" Score="8" Body="&lt;p&gt;Contrary to popular belief, there does exist some truly high quality academic literature on this topic.  The most sophisticated and well executed paper in this regard is &lt;a href=&quot;http://web.mit.edu/alo/www/Papers/1705-1765.pdf&quot; rel=&quot;noreferrer&quot;&gt;Lo, Mamaysky, and Wang (2000)&lt;/a&gt;.  They write:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In this paper, we propose a systematic and automatic approach to&#xA;  technical pattern recognition using nonparametric kernel regression, and we apply&#xA;  this method to a large number of U.S. stocks from 1962 to 1996 to evaluate the&#xA;  effectiveness of technical analysis. By comparing the unconditional empirical distribution&#xA;  of daily stock returns to the conditional distribution—conditioned on specific&#xA;  technical indicators such as head-and-shoulders or double-bottoms—we find&#xA;  that over the 31-year sample period, several technical indicators do provide incremental&#xA;  information and may have some practical value.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We find that certain technical patterns, when applied to many stocks over&#xA;  many time periods, do provide incremental information, especially for Nasdaq&#xA;  stocks. Although this does not necessarily imply that technical analysis&#xA;  can be used to generate “excess” trading profits, it does raise the possibility&#xA;  that technical analysis can add value to the investment process.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Moreover, our methods suggest that technical analysis can be improved by&#xA;  using automated algorithms such as ours and that traditional patterns such&#xA;  as head-and-shoulders and rectangles, although sometimes effective, need&#xA;  not be optimal. In particular, it may be possible to determine “optimal patterns”&#xA;  for detecting certain types of phenomena in financial time series, for&#xA;  example, an optimal shape for detecting stochastic volatility or changes in&#xA;  regime. Moreover, patterns that are optimal for detecting statistical anomalies&#xA;  need not be optimal for trading profits, and vice versa. Such considerations may lead to an entirely new branch of technical analysis, one based on selecting pattern-recognition algorithms to optimize specific objective functions.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;A search for this paper also reveals other potentially valuable academic articles on technical analysis and chart patterns, such as this &lt;a href=&quot;http://chart-patterns.technicalanalysis.org.uk/&quot; rel=&quot;noreferrer&quot;&gt;list&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-08-01T18:16:57.143" LastActivityDate="2011-08-01T18:16:57.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1562" PostTypeId="2" ParentId="955" CreationDate="2011-08-01T18:14:27.070" Score="3" Body="&lt;p&gt;Martijn Cremers and Antti Petajisto have a &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=891719&quot; rel=&quot;nofollow&quot;&gt;series&lt;/a&gt; of &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1685942&quot; rel=&quot;nofollow&quot;&gt;papers&lt;/a&gt; using the concept of &quot;Active Share,&quot; a new measure of active portfolio management which represents the share of portfolio holdings that differ from the benchmark index holdings, to evaluate mutual fund managers.  They find that the most active stock pickers have outperformed their benchmark indices even after fees and transaction costs. In contrast, closet indexers or funds focusing on factor bets have lost to their benchmarks after fees.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bottom line: when separating skill from luck, concentrate on those managers that actually try to differentiate themselves from the crowd.  Also, the more fine grained your strategy is, the more likely it is to represent skill over luck.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-08-01T18:14:27.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1563" PostTypeId="2" ParentId="716" CreationDate="2011-08-01T18:43:39.200" Score="2" Body="&lt;p&gt;OANDA's quotes are set by OANDA, not by the market.  They deliberately skew their quotes towards whichever side they would like to be on.  In your example, if as a result of traders like you OANDA has accumulated a net long position in a high yielding currency just before the official rollover time, they will set their quotes a bit higher than the true market in order to encourage selling.  After the rollover time, they will set their quotes a bit lower in order to encourage buying while you and other trades like you are selling.  The closed nature of OANDA's platform (no possibility to move your positions to another broker) make it very unlikely that this sort of strategy will work in practice.  Even if it does, I am confident you will be benefiting at the expense of other OANDA traders, not at the expense of OANDA itself.  In any case, it is unlikely that yields will be high enough to offset the typically very wide bid/ask spreads at rollover time.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-08-01T18:43:39.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1564" PostTypeId="2" ParentId="1292" CreationDate="2011-08-01T19:12:00.053" Score="6" Body="&lt;p&gt;Judging by the math in a paper by &lt;a href=&quot;http://mfs.rutgers.edu/MFC/MFC10/mfcindex/files/MFC-099%20Vahamaa.pdf&quot;&gt;Vahamaa (1999)&lt;/a&gt;, you should measure the slope using the options closest to the strike you are examining.  In other words, suppose that you are trying to come up with the skew-adjusted delta of an SPY option with strike of 130.  Then the skew slope should be based on the 129 and 131 strike options.  If these points happen to be very illiquid, then you can, in principle, estimate the slope based on options further away from the strike of interest, but the skew adjustment is a local adjustment, and so the relevant slope is the slope at that strike.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-08-01T19:12:00.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1565" PostTypeId="1" AcceptedAnswerId="1566" CreationDate="2011-08-01T21:39:00.450" Score="46" ViewCount="8719" Body="&lt;p&gt;I am working with a set of covariance matrices evaluated at various points in time over some history.  Each covariance matrix is $N\times N$ for $N$ financial time-series over $T$ periods.  I would like to explore some of the properties of this matrix's evolution over time, particularly whether correlation as a whole is increasing or decreasing, and whether certain series become more or less correlated with the whole.  I am looking for suggestions as to the kinds of analysis to perform on this data-set, and particularly graphical/pictorial analysis.  Ideally, I would like to avoid having to look in depth into each series as $N$ is rather large.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following graphs were generated based on the accepted answer from @Quant-Guy.  PC = principal component = eigenvector.  The analysis was done on correlations rather than covariances in order to account for vastly different variances of the $N$ series.&#xA;&lt;img src=&quot;https://i.stack.imgur.com/UIuxu.jpg&quot; alt=&quot;Principal Component Angle with Previous Month&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/VDAQ7.jpg&quot; alt=&quot;Principal Component Angle with Present&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/8xiCG.jpg&quot; alt=&quot;Principal Component Angle with Initial&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-08-02T20:44:28.023" LastActivityDate="2012-04-26T13:15:07.363" Title="How do I graphically represent the evolution of a covariance matrix over time?" Tags="&lt;time-series&gt;&lt;correlation&gt;&lt;covariance&gt;" AnswerCount="5" CommentCount="3" FavoriteCount="47" ContentLicense="CC BY-SA 3.0" />
  <row Id="1566" PostTypeId="2" ParentId="1565" CreationDate="2011-08-01T22:33:16.913" Score="23" Body="&lt;p&gt;I would consider a &lt;a href=&quot;http://code.google.com/p/google-motion-charts-with-r/&quot;&gt;motion chart&lt;/a&gt; that plots the eigenvalues of the covariance matrix over time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a static view you can create a table: rows represent dates, and columns represent eigenvectors. The entries of the table represent changes in the angle of the eigenvector from the previous row. This will show how stable your covariance structure is. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also create a second table this time with eigenvalues as the columns sorted from high to low (and the corresponding values below for each date). This shows the variance described by each eigenvector so you can see whether correlation as whole is increasing or decreasing&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: You can also measure the distance between the two covariance matrices via some distance measure metric such as &lt;a href=&quot;http://www.google.com/url?sa=t&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CBkQFjAA&amp;amp;url=http://en.wikipedia.org/wiki/Kullback%25E2%2580%2593Leibler_divergence&amp;amp;ei=zb5ATsGHJrDC0AGEiZz7CQ&amp;amp;v6u=http://dualstack.ipv6-exp.l.google.com/gen_204?ip=108.46.28.77&amp;amp;ts=1312865997811811&amp;amp;auth=5y5aiy4fyhs5hxni7mh66tk547cnqugn&amp;amp;rndm=0.19591150199994445&amp;amp;v6s=2&amp;amp;v6t=16996&amp;amp;usg=AFQjCNFXcPracsjNxgYSRoRctz0fPpFXJA&quot;&gt;Kullback-Leibler&lt;/a&gt; divergence, euclidean distance, Mahalanabois, etc.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-08-09T05:01:23.387" LastActivityDate="2011-08-09T05:01:23.387" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1567" PostTypeId="1" AcceptedAnswerId="1568" CreationDate="2011-08-01T23:46:16.480" Score="7" ViewCount="1080" Body="&lt;p&gt;Can anyone point me to some Hedge Fund index data - daily levels of the HFRX or something similar, that is available for free and has history back to 2007? The data available through my broker seems to only go back to beginning of 2010.&lt;/p&gt;&#xA;" OwnerUserId="436" LastActivityDate="2011-08-02T01:10:01.633" Title="Historical Hedge Fund Index Data" Tags="&lt;data&gt;&lt;market-data&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1568" PostTypeId="2" ParentId="1567" CreationDate="2011-08-02T01:10:01.633" Score="6" Body="&lt;p&gt;You can &lt;a href=&quot;http://www.edhec-risk.com/&quot;&gt;download EDHEC's indexes&lt;/a&gt; for free.  You just need to create an account on their site (which is worth doing to get their research).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some of their data is also bundled in the &lt;a href=&quot;http://cran.r-project.org/web/packages/PerformanceAnalytics/index.html&quot;&gt;PerformanceAnalytics package in R&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2011-08-02T01:10:01.633" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1569" PostTypeId="2" ParentId="1339" CreationDate="2011-08-02T03:53:18.497" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;would you expect your financial data to qualify as being a good random number generator&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Financial time-series, specifically price-change series, would make terrible random number generators because they generally contain significant dependencies. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;or would it fail in many of these tests?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you test for &lt;strong&gt;randomness&lt;/strong&gt;, meaning, initial conditions do not completely determine the subsequent values, you will &lt;em&gt;generally&lt;/em&gt; find price-change series to be random.  I say &lt;em&gt;generally&lt;/em&gt; because you will also find situtations (which come and go, and are rare) where price-change series are measurably &lt;strong&gt;deterministic.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you test for &lt;strong&gt;dependence&lt;/strong&gt;, you will generally find serious serial dependencies in price-change series.  For example, a price increase followed by a price increase  is generally far more probable than one finds with artificially generated random, independent price-change series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I say &quot;generally&quot; because the statistical characteristics can change with time and with market, back and forth.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, to summarize, the fact that price-change series are normally &lt;strong&gt;dependent&lt;/strong&gt; is why technical analysis works.  The fact that the series are &lt;strong&gt;random&lt;/strong&gt; is why many smart people are fooled into thinking technical analysis doesn't work.&lt;/p&gt;&#xA;" OwnerUserId="47" LastActivityDate="2011-08-02T03:53:18.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1570" PostTypeId="2" ParentId="1547" CreationDate="2011-08-02T12:24:28.290" Score="4" Body="&lt;p&gt;I can't answer your question about the data, since my sources for data like that are Reuters and Bloomberg, neither of which are cheap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For testing trading strategies, I'll separate them into three camps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For 'simple' optimization schemes, RMetrics fPortfolio can likely do the trick.  This would be for weight-based asset allocation.  RMetrics also has some pricing functionality for bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For 'complex' optimization schemes, still weight-based, &lt;a href=&quot;https://r-forge.r-project.org/R/?group_id=579&quot; rel=&quot;nofollow&quot;&gt;PortfolioAnalytics&lt;/a&gt; can construct complex portfolio optimization problems using any arbitrary R function as part of your objective.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to use indicators to define signals and construct trading rules, the &lt;a href=&quot;https://r-forge.r-project.org/projects/blotter/&quot; rel=&quot;nofollow&quot;&gt;quantstrat&lt;/a&gt; package will likely fit. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want additional pricing functionality for bonds, look at &lt;a href=&quot;https://r-forge.r-project.org/projects/rquantlib/&quot; rel=&quot;nofollow&quot;&gt;RQuantLib&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="454" LastActivityDate="2011-08-02T12:24:28.290" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1571" PostTypeId="2" ParentId="1557" CreationDate="2011-08-02T12:48:19.110" Score="13" Body="&lt;p&gt;Actually, co-skewness is represented by a rank 3 tensor, rather than a matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm going to reproduce the formulation from Bhandari and Das, &lt;a href=&quot;http://algo.scu.edu/~sanjivdas/tensor.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Options on portfolios with higher-order moments&lt;/a&gt;, but I'll add and omit some details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The co-skewness tensor is&#xA;$$&#xA;S_{ijk} = E \left[ r_i \times r_j \times r_k \right] = \frac{1}{T} \sum_{t=1}^T r_i(t) \times r_j(t) \times r_k(t)&#xA;$$&#xA;where $r$ are asset returns over $T$ time periods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, given portfolio weights $w$, mean asset returns $\mu$, covariance matrix $\Sigma$, and portfolio variance $\sigma_p^2(w) = w\prime \Sigma w$, we calculate moments:&#xA;$$\begin{eqnarray*}&#xA;m_1 &amp;amp; = &amp;amp; w\prime \mu \\&#xA;m_2 &amp;amp; = &amp;amp; \sigma_p^2 + m_1^2 \\&#xA;m_3 &amp;amp; = &amp;amp; \sum_{i=1}^N \sum_{j=1}^N \sum_{k=1}^N w_i w_j w_k S_{ijk}&#xA;\end{eqnarray*}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The portfolio skewness is then&#xA;$$&#xA;S_p = \frac{1}{\sigma_p^3} \left[ m_3 - 3m_2 m_1 + 2m_1^3 \right]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of a 6-asset portfolio, the co-skewness tensor will contain 216 components; however, due to symmetry, it only contains 56 independent components.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, it can be helpful to reformulate the portfolio skewness equation for computational efficiency.  To do this, we can start with the definition of skewness for portfolio returns,&#xA;$$&#xA;S_p = \frac{1}{\sigma_p^3} E [  \left( \sum_{i=1}^N w_i r_i \right)^3 ] \quad ,&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and then apply the &lt;a href=&quot;http://en.wikipedia.org/wiki/Multinomial_theorem&quot; rel=&quot;nofollow noreferrer&quot;&gt;multinomial theorem&lt;/a&gt; to obtain the portfolio skewness in terms of only the independent components.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Especially for longer time series, the return moments should  be&#xA;centered on the means, i.e., $r_i = R_i - \bar{R}_i$&lt;/li&gt;&#xA;&lt;li&gt;In the case of daily returns, $R_i(t) = \frac{P(t) -&#xA;   P(t-1)}{P(t-1)}$, where $P(t)$ is the closing price at time $t$.&lt;/li&gt;&#xA;&lt;li&gt;Be sure the prices for returns are comparable from period to period. &#xA;For example, stock prices may need adjustments to account for&#xA;dividend payments.  See this &lt;a href=&quot;https://quant.stackexchange.com/questions/1031/total-return-measurement-paradox-w-adjusted-close-prices&quot;&gt;Q &amp;amp; A on return measurement&lt;/a&gt; for&#xA;more discussion.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;note:&lt;/em&gt; I edited the equation for the co-skewness tensor above.&lt;/p&gt;&#xA;" OwnerUserId="1129" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2011-08-08T04:03:57.570" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1572" PostTypeId="1" AcceptedAnswerId="1666" CreationDate="2011-08-02T16:05:25.850" Score="4" ViewCount="4036" Body="&lt;p&gt;I was reading Derman's latest &lt;a href=&quot;http://blogs.reuters.com/emanuelderman/2011/07/28/sophisticated-vulgarity-1/&quot; rel=&quot;nofollow&quot;&gt;blog post&lt;/a&gt; on &lt;a href=&quot;http://en.wikipedia.org/wiki/Vanna_Volga_pricing&quot; rel=&quot;nofollow&quot;&gt;Vanna Volga pricing&lt;/a&gt;, which, according to the linked Wikipedia article, is used mostly for pricing &lt;a href=&quot;http://en.wikipedia.org/wiki/Exotic_option&quot; rel=&quot;nofollow&quot;&gt;exotic options&lt;/a&gt; on foreign exchange (FX).  This &lt;a href=&quot;http://www.wilmott.com/messageview.cfm?FTVAR_FORUMVIEWTMP=Threaded&amp;amp;catid=38&amp;amp;threadid=60321&amp;amp;messid=367091&amp;amp;ftvar_msgdbtable=#367091&quot; rel=&quot;nofollow&quot;&gt;Willmott thread&lt;/a&gt; claims most demand for exotics is by asset-liability, pensions, and insurance firms.  But this does not explain why most of the trading in these products is in FX, as opposed to equities, bonds, etc.  &lt;strong&gt;Why are these firms trading FX exotics&lt;/strong&gt;, and, relatedly, &lt;strong&gt;why are they not trading exotics in other products?&lt;/strong&gt;  Is it just the liquidity of FX vs. other markets, or is there a good fundamental reason for exotics to exist in FX and not in other markets?&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-08-15T15:34:23.910" Title="Why are exotic options most popular in FX?" Tags="&lt;option-pricing&gt;&lt;fx&gt;&lt;modeling&gt;&lt;exotics&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1573" PostTypeId="2" ParentId="1565" CreationDate="2011-08-02T16:39:09.627" Score="1" Body="&lt;p&gt;Minimum spanning trees are another option, with edges between nodes based on either Euclidean distances of the matrix or another distance measure of your choosing. They can be more effective at illustrating the underlying structure of the matrix than some other methods (eg heatmaps, eigenvalue ratio plots), but this may not be practical if T is large.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You didn't specify what environment you're working in, but R has several packages (see vegan:spantree, ape:mst, igraph:minimum.spanning.tree, ade4:mstree and fAssets:assetsDendrogramPlot or fAssets:assetsCorEigenPlot) that support plotting both minimum spanning trees (with various layout types) and dendrograms. Gephi also produces plots that may be more aesthetically pleasing (and it's open source), although it does require that the data processing be done elsewhere and there is a bit of a learning curve.&lt;/p&gt;&#xA;" OwnerUserId="779" LastActivityDate="2011-08-02T16:39:09.627" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1574" PostTypeId="2" ParentId="1554" CreationDate="2011-08-02T19:28:28.403" Score="13" Body="&lt;p&gt;Interactive Brokers does have a .NET API, albeit a free (as in speach) one written by Karl Schulze, not IB themselves.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.dinosaurtech.com/utilities/&quot;&gt;http://www.dinosaurtech.com/utilities/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's written in C# (and IMHO well written).  I've examined both it and the Java API and find the .NET version more to my liking.  That's probably just because I'm more familiar with .NET than I am with Java.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You're right about TWS, the API talks to a TWS or IB Gateway instance.  As far as I can tell, IB Gateway is produced for no other reason than to allow API clients to execute.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The IB API may indeed by overly complicated compared to other APIs -- I've read as much elsewhere.  But it's the first trading API I've worked with personally, so I can't say for sure.  &lt;/p&gt;&#xA;" OwnerUserId="1148" LastActivityDate="2011-08-02T19:28:28.403" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1575" PostTypeId="2" ParentId="1466" CreationDate="2011-08-02T20:32:16.180" Score="2" Body="&lt;p&gt;Here's an answer from a purely statistical point of view: &#xA;&lt;a href=&quot;http://www.duke.edu/~rnau/regnotes.htm#constant&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.duke.edu/~rnau/regnotes.htm#constant&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And another from Cross Validated:&#xA;&lt;a href=&quot;https://stats.stackexchange.com/questions/7948/when-is-it-ok-to-remove-the-intercept-in-lm&quot;&gt;https://stats.stackexchange.com/questions/7948/when-is-it-ok-to-remove-the-intercept-in-lm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The lean in both cases is to include the intercept unless there is a strong theoretical reason.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A more satisfying answer would be from the asset-pricing literature Ironically, when you perform an two-stage cross-sectional asset-pricing test (see Cochrane 2005) the procedure is to include the intercept and test whether it is statistically different from zero. However, APT theory argues that the intercept can be ignored. The best way to answer this would be empirical research on the out-of-sample performance of models with and without the intercept...&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2011-08-02T20:32:16.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1576" PostTypeId="1" AcceptedAnswerId="1578" CreationDate="2011-08-03T04:22:33.140" Score="19" ViewCount="1836" Body="&lt;p&gt;How does diversification actually lead to less variance in a portfolio? I'm looking for a formal reason why this is the case. There are a number of explanations I have been able to find, but they make the assumption that stocks are wiener processes - that is they assume that the daily changes in a stock's price are normally distributed. In this model of stocks, diversification leads to less variance in portfolio prices because the average of some normally distributed random variables is always a normal variable with less variance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if a and b are distributed normally with mean 0 and variance 1, then their average is normally distributed with mean 0 and variance 1/Sqrt(2). If a and b represented daily price differences for stocks, then this means we could reduce the variance of the daily price difference by spreading our investment out among multiple such stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is essentially what is shown on the Wikipedia page for the theory of diversification.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Changes in stock price are Cauchy Distributed - that is stocks are better modeled as Levy processes. The Cauchy distribution doesn't exhibit the behavior above which is used to justify diversification. Instead, averaging out a number of Cauchy random variables does nothing to reduce the amount of spread in the distribution. Put more formally, if a and b are identically distributed Cauchy random variables, then their average is a Cauchy random variable with the same parameters. In this way, spreading out your investment across many different levy processes will not result in a levy process with a less variation and there is no reason then to diversify.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I might be missing something pretty simple, however it seems kinda strange to me how mischaracterized diversification seems to be in everything I've read. Is there a paper or something which covers the topic better and doesn't assume that stocks are Wiener processes?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;As a bit or warning, I'm clearly not a quant. I just happen to know math and was kinda curious about stocks.&lt;/em&gt; &lt;/p&gt;&#xA;" OwnerUserId="1124" LastEditorUserId="1106" LastEditDate="2011-08-07T14:08:44.930" LastActivityDate="2014-09-19T13:04:04.947" Title="How does one analyze diversification if stock prices follow a Cauchy distribution?" Tags="&lt;diversification&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="1577" PostTypeId="1" AcceptedAnswerId="1770" CreationDate="2011-08-03T05:09:39.457" Score="22" ViewCount="2709" Body="&lt;p&gt;Let's say we have a predictive distribution of expected returns for N assets. The distribution is not normal. We can interpret the dispersion in the distribution as reflection of our uncertainty (or estimation risk) in the expected returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question - What is the set of optimal portfolio weights that is mean-variance efficient with some constraint for the predictive distribution? Of course, we do not know what possible realization from the predictive distribution Nature will select.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will suggest some angles of attack and show their various flaws. This is a very real and challenging problem -- I'm hoping the community can crack this!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Approach 1 (Monte Carlo) : Sample from the multivariate predictive distribution. Find the weights corresponding to the mean-variance efficient portfolio for each sample. Repeat the procedure for 1,000 draws from the predictive distribution. Average the weights via some procedure (for example, average of the rank-associated mean variance portfolios per Michaud 1998).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The re-sampling approach has several major flaws as discussed by &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=796625&quot;&gt;Scherer&lt;/a&gt;: if short-sales are allowed this will add noise to estimation; procedure will include mean-variance dominated assets in the presence of a long-only constraint; the shape of the efficient frontier excludes the feasible maximum return option which is not theoretically plausible; re-sampled allocations can produce portfolios that violate investment constraints;  and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Approach 2 (Black-Litterman) : This knee-jerk answer doesn't work since the posterior is already provided here. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Approach 3 (Mean of Posterior): Sample from the predictive distribution N times. Collapse the distribution of expected returns into a single vector corresponding to each security's mean return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The flaw here is that estimation risk is assumed away. This is a robust optimization problem where the goal is to identify weights that are approximately optimal under various realizations of market returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What might work?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Approach 4 (Complex objective function). Perhaps we could extend the objective function by summing over the mean-variance objective for each draw from the predictive distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The mean-variance objective function for a single draw is: weights*expected return vector + wEw, where the expected return vector is a sampling from the predictive distribution, and E is the sample covariance matrix, and w is the vector we are solving for. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For multiple draws, the objective function = (w*expected return draw 1 + wEw) + (w*expected return draw 2 + wEw) + ... (w*expected return draw n + wEw)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This would be a lengthy objective function that is computationally intensive assuming 500 assets and 1,000 draws. Maybe some fast genetic algorithms could work in parallel. I also have not seen the literature discuss this approach although intuitively it seems sound. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please poke holes and let me know if there is another approach.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-08-09T05:10:52.317" LastActivityDate="2011-08-26T00:13:35.357" Title="Portfolio optimization with monte carlo sampling from predictive distribution" Tags="&lt;risk&gt;&lt;monte-carlo&gt;&lt;optimization&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio-selection&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="24" ContentLicense="CC BY-SA 3.0" />
  <row Id="1578" PostTypeId="2" ParentId="1576" CreationDate="2011-08-03T06:44:36.123" Score="7" Body="&lt;p&gt;I think this is a very good and valid question. I will try to give a more general answer here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is by now a well known fact that much of the classical stuff won't work in the manner it was thought and supposed to work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the points that are not clear when it comes to real financial time series is how they are distributed (they are obviously not normal) and by far the more important question: Do they exhibit finite variance? By definition you can't find out by just looking at finite samples but of course the validity of such cornerstones of classical statistics (like the central limit theorem) rest on the assumption of a finite variation in the population. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another thing is that financial times series are not i.i.d. - you have all kinds of dependencies, like e.g. autocorrelation, vol clustering etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand some of the results (like basic option pricing, but I would also count in diversification) seem to be pretty robust (but of course not perfect in a mathematical sense) when it comes to using them although many of the assumptions are not met.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a starting point I would recommend google'ling for articles/books from Taleb and Mandelbrot for a very critical stance on the classical results, but also e.g. for Wilmott for a more balanced view. A very good author is also Meucci who writes about robust methods under non-normality assumptions.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-08-03T06:44:36.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1579" PostTypeId="1" AcceptedAnswerId="1585" CreationDate="2011-08-03T18:21:00.670" Score="7" ViewCount="1017" Body="&lt;p&gt;We already have a list of &lt;a href=&quot;https://stackoverflow.com/questions/59327/what-online-brokers-offer-apis&quot;&gt;brokerages that provide apis&lt;/a&gt;.  What about brokerages that provide web apis?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, &lt;a href=&quot;http://www.collective2.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Collective2&lt;/a&gt; has a url-based web &lt;a href=&quot;http://www.collective2.com/content/automation.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;api for entering trades&lt;/a&gt;.  Are there any brokerages that provide a similar interface for getting data or entering orders?&lt;/p&gt;&#xA;" OwnerUserId="500" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2011-08-07T12:39:07.483" Title="Are there any brokerages which use URL-based web APIs?" Tags="&lt;trading&gt;&lt;programming&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1580" PostTypeId="2" ParentId="1565" CreationDate="2011-08-03T19:26:27.880" Score="4" Body="&lt;p&gt;I'd look at the evolution of a heat map based on the correlation structure (literally the lower triangle).  I'd probably write a script in R or python that writes out the heat map per t to disk, then use a command line program like imagemagick to stitch images together into an animated gif, for example.  I'm sure you could do it entirely in Processing too, and there you'd be able to mouse over pairs, etc.  Perhaps seriation techniques could group sets ex post within the triangle.  &lt;/p&gt;&#xA;" OwnerUserId="390" LastActivityDate="2011-08-03T19:26:27.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1581" PostTypeId="2" ParentId="1554" CreationDate="2011-08-03T21:12:05.350" Score="6" Body="&lt;p&gt;JunoTrade claims to have a streaming .NET API -- &lt;a href=&quot;http://www.junotrade.com/index.php/junotradeapi&quot; rel=&quot;nofollow&quot;&gt;http://www.junotrade.com/index.php/junotradeapi&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pinncle Trading - &lt;a href=&quot;http://www.pcmtrading.com/technology/api.html&quot; rel=&quot;nofollow&quot;&gt;http://www.pcmtrading.com/technology/api.html&lt;/a&gt; (supports C# according to the last item).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;TD Ameritrade @ codeplex (unoffical)&lt;/p&gt;&#xA;" OwnerUserId="386" LastActivityDate="2011-08-03T21:12:05.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1582" PostTypeId="2" ParentId="461" CreationDate="2011-08-03T21:26:36.817" Score="2" Body="&lt;p&gt;IB does not offer tick data.  They consolidate their data every 0.3 seconds or so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to store your data temporarily for import into another system later on, then just store it as a CSV file.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally I use IQFeed to download tick data into SQL Server which I then use to run analyses on.  When I need to run multiple test runs on the same data, I store the data locally into a file that I just read directly into memory.&lt;/p&gt;&#xA;" OwnerUserId="1150" LastActivityDate="2011-08-03T21:26:36.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1583" PostTypeId="2" ParentId="1572" CreationDate="2011-08-03T22:04:21.537" Score="5" Body="&lt;ol&gt;&#xA;&lt;li&gt;Liquidity&lt;/li&gt;&#xA;&lt;li&gt;Since this is an asset class which is so tightly coupled with interest rates - it makes good products for clients inherently complex.&lt;/li&gt;&#xA;&lt;li&gt;It also makes good sense to make wider markets for more exotic products than the plain vanilla ones - in which razor-thin spreads rule (and trading huge notionals is not everyone's cup of tea)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1151" LastActivityDate="2011-08-03T22:04:21.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1584" PostTypeId="2" ParentId="1565" CreationDate="2011-08-03T22:29:47.333" Score="10" Body="&lt;p&gt;Here's an interesting possibility: correlation network analysis + motion chart. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks to the hot research efforts in social network analysis (SNA), network analysis and graphics libraries such as &lt;a href=&quot;http://www.rcasts.com/2010/04/social-network-analysis-using-r-and.html&quot;&gt;R and Gephis&lt;/a&gt; are now easily accessible. I am well-versed in correlation analysis, and have a feeling that SNA can be effectively adapted for it. After all, the 'linear' correlation is just a special relationship among many others. Since SNA is hot area now. Many efforts are devoted and many resources are available. Can't help imagining that we can leverage it in finance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the motion chart concept can further leverage the power of network representation. I would imagine that when a regime shifts toward high correlation, we should see the dynamics of 'clustering' effects, whereas low correlation regimes would show nodes scattered around. For example, if there is a sector-level event, we would see nodes in that sector start to cluster more tightly around few benchmark nodes. In a macro event, we would see all benchmarks or eigenvectors cluster.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In any cases, I think the motion network graph will be a much richer representation than the motion matrix, where the dynamics are usually represented in numbers, colors, or angles. If one still prefers to visualize 'covariance', then the node size will be a natural place for volatility (though I still prefer to separate correlation and variance visualization). The line width / color / distance can represent something else intuitively. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Last, I guess the reason evolving network graphs are not often used for financial correlations is that a lot of the traditional financial applications are static, in which case the advantages of network graphs over matrix representation are limited. &lt;/p&gt;&#xA;" OwnerUserId="1089" LastEditorUserId="1089" LastEditDate="2011-08-20T05:01:41.057" LastActivityDate="2011-08-20T05:01:41.057" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1585" PostTypeId="2" ParentId="1579" CreationDate="2011-08-04T10:37:29.837" Score="6" Body="&lt;p&gt;I haven't come across brokerages with Web APIs. In fact, there are several reasons why I think such APIs would be a bad idea for live trading:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Security would be a concern, both for authentication and encryption of sensitive data (perhaps the latter could be addressed by using &lt;a href=&quot;http://en.wikipedia.org/wiki/HTTP_Secure&quot; rel=&quot;nofollow&quot;&gt;HTTPS&lt;/a&gt;).&lt;/li&gt;&#xA;&lt;li&gt;The &lt;a href=&quot;http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol&quot; rel=&quot;nofollow&quot;&gt;HTTP protocol&lt;/a&gt; is not designed for transactional data of this sort. It is not all that infrequent that, while browsing the Web, one sees timeouts, &quot;bad gateway&quot; errors and other glitches. Now imagine this happening as you submit an order. You don't know whether the order has made it to the broker, whether it's out on the market, has been filled etc. A specialized protocol can handle this much better.&lt;/li&gt;&#xA;&lt;li&gt;If you lose your connectivity to the broker, it's hard for them to know that and take corrective action on your behalf (e.g. pull all your orders from the market).&lt;/li&gt;&#xA;&lt;li&gt;It is not at all clear what the mechanism for feeding data (e.g. fills) back to you might be.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I think it might be possible to &lt;em&gt;make&lt;/em&gt; this work (in a square-peg-in-a-round-hole kind of way), but there are clearly better alternatives.&lt;/p&gt;&#xA;" OwnerUserId="90" LastEditorUserId="90" LastEditDate="2011-08-04T21:43:14.763" LastActivityDate="2011-08-04T21:43:14.763" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1586" PostTypeId="2" ParentId="1576" CreationDate="2011-08-04T14:43:04.233" Score="7" Body="&lt;p&gt;There is, in fact, a large literature on this subject, but you may have been searching for the wrong terms.  This issue is broadly explored within the literature regarding a preference for higher moments.  Cauchy distributions, themselves, are very hard to work with because they don't have &lt;em&gt;any&lt;/em&gt; well-defined moments.  One possible solution to this is to use what is termed the &quot;truncated Levy flight&quot; in a paper by &lt;a href=&quot;http://corporate.morningstar.com/ib/documents/MethodologyDocuments/IBBAssociates/UsingTruncatedLevyFlightToEstimateDownsideRisk.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Xiong (2010)&lt;/a&gt;.  Modeling stocks using a Levy distribution has also been discussed in a &lt;a href=&quot;https://quant.stackexchange.com/questions/115/levy-alpha-stable-distribution-and-modelling-of-stock-prices&quot;&gt;previous question&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The specific issue of how a preference for third moments (particularly skewness) leads to underdiversification is addressed by &lt;a href=&quot;http://marriottschool.net/emp/tsp/papers/skew_div.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Mitton and Vorkink (2007)&lt;/a&gt;.  Their goal, however, is more to explain the fact that people do not &quot;diversify sufficiently&quot; in a mean-variance sense than to replace the theory of diversification.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More broadly, however, examining the implications of a preference for higher moments has been analyzed by:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1807264&quot; rel=&quot;nofollow noreferrer&quot;&gt;Xiong and Idzorek (2011)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://badger.som.yale.edu/faculty/ncb25/pwf_final.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Barberis and Huang (2008)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1089071&quot; rel=&quot;nofollow noreferrer&quot;&gt;Boyer, Mitton, and Vorkink (2009)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=61332&quot; rel=&quot;nofollow noreferrer&quot;&gt;Harvey and Siddique (2000)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.jstor.org/pss/2977297&quot; rel=&quot;nofollow noreferrer&quot;&gt;Arditti (1967)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;These references should definitely be enough to get you started.  They can explain it much better in their own words than I can paraphrasing.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;On a related side note, a different set of papers, much more empirical in nature, have shown that the higher moments of measured equity returns do converge towards a normal distribution (albeit very slowly) as the horizon lengthens.  Hence diversification may not work in the short run (days to years) but is still likely to work over decades.  This fact may or may not provide much comfort.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2011-08-04T16:04:45.690" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1588" PostTypeId="2" ParentId="1579" CreationDate="2011-08-04T19:39:49.140" Score="5" Body="&lt;p&gt;There is no specific reason that these APIs don't exist. There are no concerns around security or performance that are specific to the HTTP protocol itself. HTTP can be easily secured with HTTPS (much more testing than your brokers custom solution). Traditionally HTTP has had less support for streaming data over persistent connections as the main way to do this was a chunked encoded stream of unlimited length. The introduction of web sockets removes any impediment to using an HTTP + WebSockets based solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A custom protocol would still need to implement error handling, checking for dropped packets, connection disruption, etc... You could implement this just fine in HTTP. Developers of custom protocols often describe efficiencies of using custom binary protocols but there are rarely accurate and detailed measurements to back up their assertions. It would be very simple to build a very high performance solution using nginx and WebSockets that supported any piece of functionality that brokers usually provide.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would suspect that there is not more of this since most financial developers don't typically turn to these types of solutions just because that is not the way things have been done. Inertia in any industry can be very powerful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In either case various FIX engines are already heavily tested and in use at scale and since most people trading at scale are using FIX there is little incentive to invest in developing a web based technology. If a brokerage already has an existing custom API the ROI of moving to a HTTP based solution is probably almost zero.&lt;/p&gt;&#xA;" OwnerUserId="373" LastActivityDate="2011-08-04T19:39:49.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1589" PostTypeId="2" ParentId="1554" CreationDate="2011-08-04T21:09:21.297" Score="5" Body="&lt;p&gt;TD Ameritrade has a streaming API available at their &lt;a href=&quot;http://apiforums.tdameritrade.com/tda-board/ubbthreads.php&quot; rel=&quot;nofollow&quot;&gt;TD AMERITRADE API Support Portal&lt;/a&gt;. It is implemented as a web service so you can choose whatever language you'd like. They have examples in many languages, including .NET. My first exploration into automating my trading through TD Ameritrade has been using Java on Windows but I'm switching to C++ on Unix -- fortunately, much of my logic, and the API, will remain he same.&lt;/p&gt;&#xA;" OwnerUserId="1138" LastActivityDate="2011-08-04T21:09:21.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1590" PostTypeId="2" ParentId="18" CreationDate="2011-08-04T21:18:48.010" Score="6" Body="&lt;p&gt;The Historical Method, which I would call Historical Simulation requires that you have a reasonably clean and accurate time series of data for the underlying asset.  Essentially, you are using the past performance of the asset to model its likely behaviour over a time frame of typically 1 to 10 days.  Choosing and updating your time series data set needs to be thought about carefully as your VaR number can be impacted significantly by extreme events in the time series used.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where good time series data is not available, it would be appropriate to use the Variance-Covariance method.  This is generally considered to be less accurate than Historical Simulation due to assumptions about the distribution of returns that do not hold perfectly true in real markets (fat tail distributions).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Monte Carlo simulation is computationally a lot more expensive than Historical Simulation or V-CV and requires that a large number of asset paths are calculated to get a statistically significant result.&lt;/p&gt;&#xA;" OwnerUserId="1161" LastActivityDate="2011-08-04T21:18:48.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1591" PostTypeId="2" ParentId="306" CreationDate="2011-08-04T21:27:21.170" Score="3" Body="&lt;p&gt;C++ is used everywhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is some interest in function programming languages, like Haskell, which are a good fit for mathematical modelling but there are numerous issues with performance and memory consumption which limit usability.  From experience, the talent pool is also not very deep when it comes to functional programmers, so building and sustaining a team of quant developers using a functional language is difficult.&lt;/p&gt;&#xA;" OwnerUserId="1161" LastActivityDate="2011-08-04T21:27:21.170" CommentCount="0" CommunityOwnedDate="2011-08-04T21:27:21.170" ContentLicense="CC BY-SA 3.0" />
  <row Id="1592" PostTypeId="2" ParentId="1579" CreationDate="2011-08-04T21:34:14.083" Score="6" Body="&lt;p&gt;TD Ameritrade offers web-apis -- you have to have an account with TD Ameritrade to get access, but the portal page can be found at &lt;a href=&quot;http://apiforums.tdameritrade.com/tda-board/ubbthreads.php&quot; rel=&quot;nofollow&quot;&gt;TD AMERITRADE API Support Portal&lt;/a&gt;. It seems pretty robust and there are many that are using it for automated trading -- I'm currently coding to it in Java.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good luck!&lt;/p&gt;&#xA;" OwnerUserId="1138" LastActivityDate="2011-08-04T21:34:14.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1593" PostTypeId="2" ParentId="141" CreationDate="2011-08-05T01:16:00.170" Score="8" Body="&lt;p&gt;I did a fair amount of searching for a good source of historical data and I came across &lt;a href=&quot;http://www.premiumdata.net/products/premiumdata/ushistorical.php&quot;&gt;Norgate Investor Services&lt;/a&gt;. They provide the data in MetaStock format. I used the data for analysis in MATLAB via &lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/28664-metastockread&quot;&gt;Metastockread&lt;/a&gt;. They have data for the US, Australia and Singapore.&lt;/p&gt;&#xA;" OwnerUserId="1138" LastActivityDate="2011-08-05T01:16:00.170" CommentCount="0" CommunityOwnedDate="2011-08-05T01:16:00.170" ContentLicense="CC BY-SA 3.0" />
  <row Id="1594" PostTypeId="1" AcceptedAnswerId="1596" CreationDate="2011-08-05T08:04:41.373" Score="7" ViewCount="851" Body="&lt;p&gt;My team will soon be implementing an auto hedger for our bond trading desk which will be integrated tightly with our risk application and I am interested in researching how this may work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any advice or information or general thoughts would be appreciated, especially on algorithms used to suggest hedges with bond futures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am guessing at the simplest level comparing the DV01 and instrument maturity to find the closest matching bond future would work but I am keen to know what other factors could be taken into account.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks.&lt;/p&gt;&#xA;" OwnerUserId="1165" LastEditorUserId="1106" LastEditDate="2011-08-07T12:49:57.470" LastActivityDate="2011-08-07T12:49:57.470" Title="What are some simple algorithms for hedging vanilla bonds?" Tags="&lt;hedging&gt;&lt;fixed-income&gt;&lt;duration&gt;&lt;yield-curve&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1595" PostTypeId="2" ParentId="728" CreationDate="2011-08-05T10:27:17.240" Score="5" Body="&lt;p&gt;What about customizing KNIME (Open source aswell) for this particular problem? I am no expert, just my two cent. KNIME comes with Weka(I dont mean complete Weka, but a basic machine learning functions) &amp;amp; R integration aswell(Importing/Exporting R codes are easy), Text Mining, Neural Nets etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I reckon, KINME(www.knime.org) with it's enterprise edition(EE) can do wonders, but it costs 2000euros.:( &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For BigData R seems to not perform well. Instead use Hadoop or Apache Mahout or KNIME. My bets are on KNIME. Currently I am working on a similar trading system as a personal project using these tools. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apologies if I am not so coherent, my first language is not english. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks &#xA;Roshan Daniel&#xA;quoreanalytics@gmail.com &#xA;Bangalore&lt;/p&gt;&#xA;" OwnerUserId="1167" LastActivityDate="2011-08-05T10:27:17.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1596" PostTypeId="2" ParentId="1594" CreationDate="2011-08-05T16:00:19.737" Score="1" Body="&lt;p&gt;The top reference for this topic is &lt;em&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0471332119&quot; rel=&quot;nofollow&quot;&gt;Risk Management: Approaches for Fixed Income Markets&lt;/a&gt;&lt;/em&gt; by Golub and Tilman.  The main measures you will want to calculate for hedging the yield curve risks of a bond portfolio are the &lt;strong&gt;key rate durations&lt;/strong&gt;.  The &lt;a href=&quot;http://en.wikipedia.org/wiki/Fixed_income_attribution#Key_rate_durations&quot; rel=&quot;nofollow&quot;&gt;wikipedia&lt;/a&gt; article gives a brief overview.  If you have access to Lehman/Barclays data, they calculate key rate durations daily for every bond in their indices.  You can also calculate it yourself as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$krd_i=-\frac 1P  \frac {P_{i,up}-P_{i,down}} {2\Delta r_i}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if you have a pricing model for the bonds in which you can vary a set of interest rates $r_i$.  See chapter 2 of the book for details.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-08-05T16:24:11.590" LastActivityDate="2011-08-05T16:24:11.590" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1597" PostTypeId="1" AcceptedAnswerId="1598" CreationDate="2011-08-05T20:32:28.743" Score="15" ViewCount="3315" Body="&lt;p&gt;As a developer and statistician, I consider value investing to be a statistically sound investment strategy. I've read a few books on the area but I am still not clear on valuation measures. So I would like to hear from experts in quantitative finance about the approach and its methods. For example, I would like know the pros and cons of value investing and what valuation methods are out there. Any opinions or references would be great, too. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="1170" LastEditorUserId="1106" LastEditDate="2011-08-07T12:44:22.013" LastActivityDate="2018-12-12T12:42:28.110" Title="What are some quantitative approaches to value investment?" Tags="&lt;valuation&gt;&lt;investing&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="1598" PostTypeId="2" ParentId="1597" CreationDate="2011-08-05T21:07:25.623" Score="16" Body="&lt;p&gt;Value has traditionally been one of the most important stock-selection signals for quantitative managers.  However, since the late 2000s, following a rapid flow into quantitative investing, traditional value strategies have lost most of their predictive power and the returns generated from them have also become more volatile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The typical approach of quantitative managers is to distill a valuation measure into a &quot;factor&quot;.  This is often done using the hedged portfolio approach pioneered by Fama and French (1993). In this approach, analysts divide the investable universe into quantiles (typically in quintiles or deciles) to form quantile portfolios. Stocks are either equally weighted or cap weighted within each quantile. Each quantile portfolio’s performance is then tracked over time. A long/short hedged portfolio is typically formed by going long the best quantile and shorting the worst quantile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few of the most common valuation factors are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Dividend yield&lt;/li&gt;&#xA;&lt;li&gt;Earnings quality (accruals)&lt;/li&gt;&#xA;&lt;li&gt;Earnings yields / P/E ratios&lt;/li&gt;&#xA;&lt;li&gt;Price-to-book&lt;/li&gt;&#xA;&lt;li&gt;Return on Equity&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Many of these also come in all sorts of simple or sophisticated variations.  A few related factors that are not strictly valuation-based are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Earnings surprise&lt;/li&gt;&#xA;&lt;li&gt;Analyst recommendations&lt;/li&gt;&#xA;&lt;li&gt;Short interest&lt;/li&gt;&#xA;&lt;li&gt;Insider ownership&lt;/li&gt;&#xA;&lt;li&gt;Turnover (volume)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;These are just a few, and practically every paper published in the broad field of Behavioral Finance - Asset Pricing has been turned into a quantitative factor by someone somewhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Authors Ludwig Chincarini and Daehwan Kim, in their book, Quantitative Equity&#xA;Portfolio Management, make a very interesting comparison of quantitative and fundamental investing:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;It is inaccurate to say that fundamental&#xA;  managers dig deep at the solo stock level, but have no models or disciplines. It is also&#xA;  unfair to say that quantitative managers apply skills to so broad a set of stocks that&#xA;  the process is superficial at the fundamental level, and often labeled black-box, data&#xA;  mining nerds. This is a misrepresentation. Many quantitative investment strategies&#xA;  rely on factors that are based on not only solid economic principles, but also on&#xA;  sound fundamental intuition. At the same time, fundamental managers all use&#xA;  models. These may be rules-of-thumb or heuristics, and not subject to rigorous&#xA;  testing, but the deep implementation of the model into the security makes up for the&#xA;  lack of breadth. To repeat, quantitative management – lies in broadly perfecting the&#xA;  comprehensive portfolio system, whereas, fundamental management lies in deeply&#xA;  comprehending the perfect stock selection.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;J.P. Morgan's &lt;a href=&quot;http://www.thinkfn.com/ficheiros/JPUSFactorReferenceBook.pdf&quot;&gt;US Factor Reference Book&lt;/a&gt; provides a good (and very lengthy) overview of the state of the art.  Lots of other major sell-side institutions also have their own stock selection models, such as Deutsche Bank, Macquarie, Bernstein, and Barclays.  It is not always easy to access information on their products on the public internet.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-08-05T21:07:25.623" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1599" PostTypeId="1" CreationDate="2011-08-05T22:31:01.203" Score="13" ViewCount="706" Body="&lt;p&gt;Does anyone know what time the &lt;a href=&quot;http://bsym.bloomberg.com/sym/&quot; rel=&quot;noreferrer&quot;&gt;Bloomberg Open Symbology&lt;/a&gt; precanned files are updated every day? I am planning on upating my view of them at 9 AM EST every morning. Furthermore, will the files for equities have any IPOs from the day listed?&lt;/p&gt;&#xA;" OwnerUserId="373" LastEditorUserId="1106" LastEditDate="2011-08-07T12:43:04.430" LastActivityDate="2011-12-20T15:39:05.933" Title="What time are Bloomberg Open Symbology Files updated daily?" Tags="&lt;data&gt;&lt;bloomberg&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1600" PostTypeId="1" AcceptedAnswerId="1602" CreationDate="2011-08-06T01:43:48.947" Score="0" ViewCount="218" Body="&lt;p&gt;From a modeling point of view, here are my primary assumptions for Monday:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) I would expect the US$ to depreciate and crude oil to rise in the long term.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) Expect crude oil to dip in the short run but rise in the long run&lt;/p&gt;&#xA;&#xA;&lt;p&gt;c) Would also expect correlation with Gold to dip in the short run and rise in the long run&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would you defend or challenge the above assumptions?&lt;/p&gt;&#xA;" OwnerUserId="1095" LastActivityDate="2011-08-07T13:15:50.220" Title="What would be the impact of the US Credit Rating downgrade on Crude Oil Prices?" Tags="&lt;trading&gt;&lt;quant-trading-strategies&gt;&lt;commodities&gt;" AnswerCount="1" CommentCount="5" ClosedDate="2011-08-06T12:55:13.143" ContentLicense="CC BY-SA 3.0" />
  <row Id="1601" PostTypeId="2" ParentId="1579" CreationDate="2011-08-06T06:14:02.920" Score="3" Body="&lt;p&gt;In the footer of this page, you can find a list of brokerages, they provide API(web or stripped down) services and cheap brokerages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.elitetrader.com/vb/forumdisplay.php?s=eff1f8fd5f8145d41006a327f286ca27&amp;amp;forumid=48&quot; rel=&quot;nofollow&quot;&gt;http://www.elitetrader.com/vb/forumdisplay.php?s=eff1f8fd5f8145d41006a327f286ca27&amp;amp;forumid=48&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thnks&#xA;Roshan&lt;/p&gt;&#xA;" OwnerUserId="1167" LastActivityDate="2011-08-06T06:14:02.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1602" PostTypeId="2" ParentId="1600" CreationDate="2011-08-06T08:37:03.887" Score="1" Body="&lt;p&gt;In the formulation of your hypotheses you had to assume that this is relevant news to the market with an imidiate effect on prices and volatilities, in other words that a rating action leads to a structural break, not the other way round (that a structural break leads to rating action). The problem in testing will probably be a too small sample within this particular dataset - too few rating actions of countries with relevant size to move the price of commodities. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My idea would be to test three time-series pairwise: First test structural breaks in CDS against Rating Actions to get the lag or lead of the time-series. Second, test structural breaks in CDS against structural breaks in Commodities to get the lag or lead of the time series. Then, if for example you get a lag of 3 Months for Rating Actions to CDS, and a lead of 4 Months for CDS against Commodities, you might conclude that Rating Actions lead relative to structural breaks in commodities. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With regard to your concrete predictions: Whats the reasoning for expecting a short-run dip in oil, and a decline in correlation for gold? &lt;/p&gt;&#xA;" OwnerUserId="357" LastEditorUserId="357" LastEditDate="2011-08-07T13:15:50.220" LastActivityDate="2011-08-07T13:15:50.220" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1603" PostTypeId="2" ParentId="27" CreationDate="2011-08-06T14:03:18.373" Score="6" Body="&lt;p&gt;The Black-Scholes model is based on a set of assumptions about the distribution of asset returns which are incorrect for real markets.  For mathematical simplicity, returns are assumed to be normally distributed, but in reality the distributed is asymetrical (skew) and has fat tails (kurtosis).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you back out implied volatility from option prices across a range of strikes at the same expiry, you will observe that it is not a constant, but a function of strike that tilts downwards (skew) and curves upwards (smile).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can think of the value of an option in a number of ways, including:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;the &lt;a href=&quot;http://en.wikipedia.org/wiki/Expected_value&quot; rel=&quot;noreferrer&quot;&gt;Expected Value&lt;/a&gt; e.g. the sum of the size of the pay out multiplied by the probability of getting it&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The cost of hedging the option&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Where implied volatility demonstrates skew it is because the Black-Scholes model is an approximation and to get the right price for the option you need to adjust its value.&lt;/p&gt;&#xA;" OwnerUserId="1161" LastActivityDate="2011-08-06T14:03:18.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1604" PostTypeId="1" CreationDate="2011-08-06T14:45:17.337" Score="3" ViewCount="162" Body="&lt;p&gt;It is well documented that following the &lt;a href=&quot;http://en.wikipedia.org/wiki/Volatility_smile&quot; rel=&quot;nofollow&quot;&gt;stock market crash in 1987&lt;/a&gt; the prices of options started to demonstrate skew and smile in the distribution of implied volatilities.  This feature has been present in equity markets ever since.  Could a future event change the shape of the implied volatility distribution again?&lt;/p&gt;&#xA;" OwnerUserId="1161" LastEditorUserId="1161" LastEditDate="2011-08-06T14:54:47.033" LastActivityDate="2011-08-06T14:54:47.033" Title="Could the Implied Volatility distribution change again?" Tags="&lt;implied-volatility&gt;" AnswerCount="0" CommentCount="2" ClosedDate="2011-08-07T13:26:13.313" ContentLicense="CC BY-SA 3.0" />
  <row Id="1605" PostTypeId="1" CreationDate="2011-08-07T14:11:22.330" Score="11" ViewCount="3790" Body="&lt;p&gt;It is often convenient to parametrize the implied volatility curve to allow easy interpolation of volatility for any strike or maturity. What functional form describes the implied volatility curve for options at varying strikes and fixed maturity?&lt;/p&gt;&#xA;" OwnerUserId="1161" LastActivityDate="2012-02-07T22:43:25.960" Title="What functional form describes the implied volatility curve?" Tags="&lt;implied-volatility&gt;" AnswerCount="5" CommentCount="2" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="1606" PostTypeId="1" CreationDate="2011-08-07T16:00:11.453" Score="2" ViewCount="1774" Body="&lt;p&gt;A forward contract has a premium of $ 0$ because it is an obligation to buy or sell something in the future (hence there is more risk). Call and put options, on the other hand, have premiums of $C$ and $P$ respectively where $C,P&amp;gt;0$ because one has the option to exercise it in the future (hence there is less risk). We price call and put options by using &lt;a href=&quot;http://en.wikipedia.org/wiki/Put%E2%80%93call_parity&quot; rel=&quot;nofollow&quot;&gt;put-call parity&lt;/a&gt;: $$PV(F_{0,T}) = C-P+PV(K)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The annualized forward premium is defined as $$A = \frac{1}{T} \ \ln \left(\frac{F_{0,T}}{S_0} \right)$$&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Question.&lt;/strong&gt; What is the purpose of defining $A$? What utility does is serve? It is not a premium in the sense of call and put options. Yet it still has the same name.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerDisplayName="Damien" LastEditorUserId="1106" LastEditDate="2011-09-22T17:16:35.520" LastActivityDate="2011-09-22T17:16:35.520" Title="What exactly is the annualized forward premium?" Tags="&lt;options&gt;&lt;derivatives&gt;&lt;put-call-parity&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1607" PostTypeId="2" ParentId="1555" CreationDate="2011-08-07T16:45:36.223" Score="1" Body="&lt;p&gt;The author's article does not predict constant interest rates. On the contrary, &quot;...if nothing is politically accomplished in reducing our long-term debt liabilities, a large risk premium could be established in Treasury securities.&quot; The reason why this is the case is because in interest rates (R in the equation) adjust so that the quantity borrowed and quantity saved match. This state is called equilibrium.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, as the article points out, the US government through Fed purchases of US treasuries is merely changing the composition of its liabilities. Longer-maturity bond liabilities of the US treasury are replaced with zero-interest perpetually revolving liabilities of the US Fed redeemable at par (we call this currency or reserves). The net effect is to shorten the average maturity of US obligations as whole. Now of course we do not expect the Fed to &quot;redeem&quot; currency with gold, bonds, or some other asset so arguably you can remove this from the numerator of the equation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding whether T-G must will remain negative in perpetuity... If bond markets lose confidence in the long-run expected outlays vs. revenues then the value of US Treasury bonds will drop (and equivalently interest rates will rise). At the extreme, bond markets would not finance expenditures in excess of revenues so there is a constraint on fiscal recklessness (witness Greece). On the other hand, a government can indeed revolve debt in perpetuity so long as the capacity of the government to pay increases with liabilities (i.e. the growth in tax revenues is &gt;= the nominal government interest rate).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, another way to look at the relationship between money supply and price level is the Money * Velocity of money = Price * # Transactions relation. The Fisher hypothesis is that even though the money supply has expanded dramatically, the velocity of money has slowed by an even greater amount. Indeed this is the case of the last several years and the story of Japan. Therefore, price level can drop despite increases in the money supply.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-08-07T17:57:04.550" LastActivityDate="2011-08-07T17:57:04.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1608" PostTypeId="2" ParentId="1250" CreationDate="2011-08-07T16:50:35.360" Score="10" Body="&lt;p&gt;You are typically interested in evaluating $E\left[ f(X_T)-f(\bar{X}_T^{(n)}) \right]$ (refered as the &lt;em&gt;weak convergence&lt;/em&gt;)&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$X_t$ the solution of the sde : $dX_t^x=b(X_t^x)dt+\sigma(X_t^x)dW_t$&lt;/li&gt;&#xA;&lt;li&gt;$\bar{X}_t^{(n)}=b(\underline{t},X_{\underline{t}}^{(n)})\cdot (t-\underline{t})+\sigma(\underline{t},X_{\underline{t}}^{(n)})\cdot (W_{\underline{t}}-W_t)$  is your Euler-continous discritized SDE, with $T/n$ your time step.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;under some regularity assumptions on both your SDE coefficients and &lt;em&gt;payoff&lt;/em&gt; function $f$ ,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ol&gt;&#xA;  &lt;li&gt;The &lt;strong&gt;rate of convergence&lt;/strong&gt; is $o\left(\frac{1}{n}\right)$&lt;/li&gt;&#xA;  &lt;li&gt;&lt;strong&gt;Expansion of order $\frac{1}{n}$&lt;/strong&gt;: &#xA;  $E\left[ f(X_T)-f(\bar{X}_T^{(n)}) \right]= \sum_{i=1}^R\frac{c_k}{n^k}+O(\frac{1}{n^{R+1}})$&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;A strong  condition would be $b,\sigma,f$ are $C^\infty$ with $f$ having polynomial growth (i.e. $\exists r&gt;0,  |f(x)|\leq C\dot(1+|x|^r)$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, if you don't know the true value of your Eu. option you would approximate it with $E\left[ f(\bar{X}_T^{n\approx\infty})\right]$ , and then trace $n\rightarrow E\left[ f(\bar{X}_T^{n\approx\infty})-f(\bar{X}_T^{(n)}) \right]$ and observe a $o(1/n)$ behavior (and try to guess the value of $c_1$). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note also that using the second assertion you might avoid using an estimate of your option. Indeed, consider $\bar{X}_T^{(n)}$ and  $\bar{X}_T^{(2n)}$ two Euler schemes with different time steps (the second has one time more steps). Then, by applying the error expansions to the first scheme,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E\left[ f(X_T)-f(\bar{X}_T^{(n)}) \right]= \frac{c_1}{n}+O(\frac{1}{n^{2}})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and then to the second scheme&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E\left[ f(X_T)-f(\bar{X}_T^{(2n)}) \right] = \frac{c_1}{2n}+O(\frac{1}{n^{2}})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;we get,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ E\left[f(\bar{X}_T^{(2n)}) - f(\bar{X}_T^{(n)}) \right] = \frac{c_1}{2n}+O(\frac{1}{n^{2}})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, without knowing the exact value of your european option ($E(f(X_T))$) you can get the exact (first order) rate of convergence, $n\rightarrow E\left[f(\bar{X}_T^{(2n)}) - f(\bar{X}_T^{(n)}) \right]= c_1/n$. Needless to say, that $c_1=n\cdot E\left[f(\bar{X}_T^{(2n)}) - f(\bar{X}_T^{(n)}) \right]$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(This useful expansion also known as the Romberg expansion is also used to build accelerated  Monte-Carlo estimates, with the same notations we obtain  $E(f(X_T)-2E(X_T^{2n})+E(X_T^{n})=\frac{c_2}{n^2}$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A (dated) reference would be  &lt;a href=&quot;http://www-sop.inria.fr/members/Denis.Talay/fichiers-pdf/vladnew2.pdf&quot;&gt;Bally and Talay&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="539" LastEditorUserId="539" LastEditDate="2011-08-07T19:06:31.503" LastActivityDate="2011-08-07T19:06:31.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1609" PostTypeId="1" CreationDate="2011-08-07T22:31:08.560" Score="8" ViewCount="7213" Body="&lt;p&gt;I am doing research estimating the value at risk for non-normally distributed assets. I need help in the process of estimating the parameters of Student's t distribution and which method to use. I would highly appreciate any assistance in this issue.&lt;/p&gt;&#xA;" OwnerUserId="1178" LastEditorUserId="1106" LastEditDate="2011-08-08T03:20:43.987" LastActivityDate="2018-11-29T22:13:10.313" Title="How can I estimate the degrees of freedom for a Student's T distribution?" Tags="&lt;statistics&gt;&lt;estimation&gt;&lt;distribution&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1611" PostTypeId="2" ParentId="1609" CreationDate="2011-08-07T23:33:00.303" Score="4" Body="&lt;p&gt;The pdfs of Student-t distributions have asymptotically Paretian tails, and the tail shape parameter (aka the maximal moment exponent) is equal to the distribution's degrees of freedom parameter. Assuming you have enough observations, you could estimate the Pareto parameter using the so-called Hill method (named after Bruce Hill, 1975). A word of caution: Use of the Hill method (and derived methods) is often criticized in fairly broad and rather unqualified ways. The main point to remember when using Hill's method is to use only observations that fall &quot;safely&quot; in the distribution's tails. Where this region lies differs from distribution to distribution. The only reasonably &quot;safe&quot; way is to plot the data in double-log coordinates: if the distribution does have Paretian tails, you'll see it in the graph, and you'll know where to set the cutoff for the observations that belong in the respective left and right tails.&lt;/p&gt;&#xA;" OwnerUserId="1180" LastActivityDate="2011-08-07T23:33:00.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1612" PostTypeId="2" ParentId="1605" CreationDate="2011-08-08T05:22:48.390" Score="3" Body="&lt;p&gt;A Polynomial of degree 2 or 3 ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But Linear interpolation on a datapoints vector works fine in my experience, let's say you have an index whose options strike :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;80/82/84/86/88/90&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You usually don't need to calculate vol @ 83. The only case is if you have a different volatility smile (estimated vol. for example) whose data points are 80/85/90 then you can just do linear interp to find your estimated vol @ 82/84.&lt;/p&gt;&#xA;" OwnerUserId="1181" LastEditorUserId="1181" LastEditDate="2011-08-08T06:08:27.347" LastActivityDate="2011-08-08T06:08:27.347" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1613" PostTypeId="2" ParentId="1605" CreationDate="2011-08-08T11:18:23.723" Score="8" Body="&lt;p&gt;OptionMetrics uses a &lt;a href=&quot;http://en.wikipedia.org/wiki/Kernel_smoother&quot; rel=&quot;nofollow&quot;&gt;kernel smoothing&lt;/a&gt; algorithm to interpolate the volatility surface. Their assumptions tend to be based on the academic consensus and have become somewhat industry standard, so the real answer to your question may be that there really is no good functional form. &lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-10-05T17:11:11.730" LastActivityDate="2011-10-05T17:11:11.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1615" PostTypeId="1" AcceptedAnswerId="1622" CreationDate="2011-08-08T19:25:05.083" Score="8" ViewCount="1027" Body="&lt;p&gt;In reference to this paper: &lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.banque-france.fr/fileadmin/user_upload/banque_de_france/publications/Revue_de_la_stabilite_financiere/etud3_1206.pdf&quot; rel=&quot;nofollow&quot;&gt;Can risk aversion indicators anticipate ﬁnancial crises?&lt;/a&gt;&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the investable &lt;strong&gt;UBS Risk Adjusted Dynamic Alpha Strategy:&lt;/strong&gt;&lt;br&gt;&#xA;&lt;a href=&quot;http://www.ibb.ubs.com/mc/strategyindices/ubsrada/downloads/rada_factsheet.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.ibb.ubs.com/mc/strategyindices/ubsrada/downloads/rada_factsheet.pdf&lt;/a&gt;&lt;br&gt;&#xA;(see here for their &lt;a href=&quot;http://www.finanzen.net/zertifikate/emittent/UBS/DERI&quot; rel=&quot;nofollow&quot;&gt;UBS Dynamic Equity Risk Indicator&lt;/a&gt; and here for a &lt;a href=&quot;http://www.comdirect.de/inf/zertifikate/detail/chart_big.html?ID_NOTATION=19503857&amp;amp;timeSpan=SE&amp;amp;chartType=CONNECTLINE&amp;amp;openerPageId=zertifikate.detail.chart.middle&amp;amp;BRANCHEN_FILTER=false&amp;amp;ID_NOTATION_INDEX=&amp;amp;fromDate=02.10.2007&amp;amp;toDate=21.07.2011&amp;amp;interactivequotes=true&amp;amp;useFixAverage=true&amp;amp;fixAverage0=0&amp;amp;fixAverage1=0&amp;amp;freeAverage0=&amp;amp;freeAverage1=&amp;amp;freeAverage2=&amp;amp;chartIndicator=&amp;amp;indicatorsBelowChart=VOLUME&amp;amp;indicatorsBelowChart=&amp;amp;benchmarkNotations=20735&amp;amp;benchmarkColors=3366cc&amp;amp;selectedBenchmarks=true&amp;amp;&quot; rel=&quot;nofollow&quot;&gt;real track record&lt;/a&gt; of this product on the DAX).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My questions are:&lt;/strong&gt;&lt;br&gt;&#xA;Do you know of any other research on the topic, i.e. different levels of financial markets stress (however measured) that forecast rising, flat or falling markets?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would also be interesting to know if there are any other strategies, products, funds etc. out there that have comparable approaches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;:&lt;br&gt;&#xA;Since some of the answers are about sentiment indicators: That is not what I mean! I am more interested in &quot;hard&quot; measures of risk (like volatilities, swap spreads, credit spreads etc.) and their relation to future equity returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT2&lt;/strong&gt;:&lt;br&gt;&#xA;Two of the links were broken - fixed them.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2013-06-25T12:19:11.990" LastActivityDate="2017-02-03T18:53:57.967" Title="Indicators and research for stress-based investment strategies" Tags="&lt;risk&gt;&lt;quant-trading-strategies&gt;&lt;indicator&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="1616" PostTypeId="2" ParentId="1606" CreationDate="2011-08-08T19:59:52.920" Score="2" Body="&lt;p&gt;The word &quot;premium&quot; in forward premium is more akin to &lt;a href=&quot;http://en.wikipedia.org/wiki/Risk_premium&quot; rel=&quot;nofollow&quot;&gt;risk premium&lt;/a&gt; than it is to option premium.  In fact, the forward premium may be negative, whence it is called a forward discount.  The premium/discount is merely the difference between the spot and forward prices, which may be due to interest rates and/or interest rate differentials and cost of carry (dividends).&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-08-08T19:59:52.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1617" PostTypeId="2" ParentId="915" CreationDate="2011-08-08T21:00:20.763" Score="7" Body="&lt;p&gt;In some banks the CVA desk is not expected to make profits (or losses). If they are having profit it is because they are overcharging CVA from other internal desks (and hence making those desks less competitive to external clients). If they are making losses it is because they are not pricing correctly the CVA (and therefore not able to buy enough hedges against credit losses), or because they are overhedging. So their performance measurement is not done the same way as for other trading desks of the bank. Same logic applies to funding desks.&lt;/p&gt;&#xA;" OwnerUserId="1183" LastActivityDate="2011-08-08T21:00:20.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1618" PostTypeId="1" AcceptedAnswerId="1635" CreationDate="2011-08-08T21:26:18.880" Score="9" ViewCount="1182" Body="&lt;p&gt;&lt;a href=&quot;http://www.hussman.net/&quot; rel=&quot;nofollow&quot;&gt;John Hussman&lt;/a&gt; has a &lt;a href=&quot;http://www.hussmanfunds.com/wmc/wmc110801.htm&quot; rel=&quot;nofollow&quot;&gt;recession forecasting methodology&lt;/a&gt; he often posts about on his blog, and I am trying to replicate it using publicly available data.  I would like to assess his accuracy in predicting recessions, and try my own hand at the same problem. Here is Dr. Hussman's criteria for a recession 'warning:'&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;1: Widening credit spreads: An increase over the past 6 months in&#xA;  either the spread between commercial paper and 3-month Treasury&#xA;  yields, or between the Dow Corporate Bond Index yield and 10-year&#xA;  Treasury yields.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;2: Falling stock prices: S&amp;amp;P 500 below its level of 6 months earlier.&#xA;  This is not terribly unusual by itself, which is why people say that&#xA;  market declines have called 11 of the past 6 recessions, but falling&#xA;  stock prices are very important as part of the broader syndrome.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;3: Weak ISM Purchasing Managers Index: PMI below 50, or,&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;3: (alternate): Moderating ISM and employment growth: PMI below 54,&#xA;  coupled with slowing employment growth: either total nonfarm&#xA;  employment growth below 1.3% over the preceding year (this is a figure&#xA;  that Marty Zweig noted in a Barron's piece many years ago), or an&#xA;  unemployment rate up 0.4% or more from its 12-month low.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;4: Moderate or flat yield curve: 10-year Treasury yield no more than&#xA;  2.5% above 3-month Treasury yields if condition 3 is in effect, or any&#xA;  difference of less than 3.1% if 3(alternate) is in effect (again, this&#xA;  criterion doesn't create a strong risk of recession in and of itself).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Here's my interpretation of what that actually means:&lt;br&gt;&#xA;1. 6 month change in [&lt;a href=&quot;http://research.stlouisfed.org/fred2/series/CPF3M&quot; rel=&quot;nofollow&quot;&gt;3-Month AA Financial Commercial Paper Rate&lt;/a&gt;]-[&lt;a href=&quot;http://research.stlouisfed.org/fred2/series/GS3M?cid=115&quot; rel=&quot;nofollow&quot;&gt;3-Month Treasury Constant Maturity Rate (GS3M)&lt;/a&gt;] &gt; 0&lt;br&gt;&#xA;2. 6 month change in the &lt;a href=&quot;http://research.stlouisfed.org/fred2/series/SP500&quot; rel=&quot;nofollow&quot;&gt;S&amp;amp;P 500&lt;/a&gt; monthly closing price &amp;lt; 0&lt;br&gt;&#xA;3. &lt;a href=&quot;http://www.ism.ws/ISMReport/content.cfm?ItemNumber=10752&quot; rel=&quot;nofollow&quot;&gt;PMI&lt;/a&gt; &amp;lt; 50&lt;br&gt;&#xA;3b. OR [&lt;a href=&quot;http://www.ism.ws/ISMReport/content.cfm?ItemNumber=10752&quot; rel=&quot;nofollow&quot;&gt;PMI&lt;/a&gt; &amp;lt; 54] AND [the 6-month % change in &lt;a href=&quot;http://research.stlouisfed.org/fred2/series/PAYEMS&quot; rel=&quot;nofollow&quot;&gt;employment&lt;/a&gt; &amp;lt; 1.3]&lt;br&gt;&#xA;4. [&lt;a href=&quot;http://research.stlouisfed.org/fred2/series/GS3M?cid=115&quot; rel=&quot;nofollow&quot;&gt;3-Month Treasury Constant Maturity Rate&lt;/a&gt;]-[&lt;a href=&quot;http://research.stlouisfed.org/fred2/series/GS10&quot; rel=&quot;nofollow&quot;&gt;10-Year Treasury Constant Maturity Rate&lt;/a&gt;] &amp;lt; 2.5 OR (if 3b, &amp;lt; 3.1)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this seem like the correct interpretation of John Hussman's methodology?  Am I missing anything important?  Once I'm certain of the correct data and correct calculations, I'll post some code in R to automatically calculate the 'recession warning' index.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Edit: Here is the code I have so far in R, I welcome any comments here or on &lt;a href=&quot;http://moderntoolmaking.blogspot.com/2011/08/forecasting-recessions.html&quot; rel=&quot;nofollow&quot;&gt;my blog&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#Code to re-create John Hussman's Recession warning index&#xA;#http://www.hussmanfunds.com/wmc/wmc110801.htm&#xA;#R code by Zach Mayer&#xA;&#xA;rm(list = ls(all = TRUE)) #CLEAR WORKSPACE&#xA;library(quantmod)&#xA;&#xA;#################################################&#xA;# 1. Credit spreads&#xA;#################################################&#xA;&#xA;getSymbols('CPF3M',src='FRED') #3-Month Financial Commercial Paper &#xA;getSymbols('GS3M',src='FRED') #3-Month Treasury&#xA;CS &amp;lt;- na.omit(CPF3M-GS3M)&#xA;&#xA;#6 month increase&#xA;CS &amp;lt;- na.omit(CS-Lag(CS,6))&#xA;names(CS) &amp;lt;- 'CS'&#xA;&#xA;#################################################&#xA;# 2. Stock Prices&#xA;#################################################&#xA;getSymbols('SP500',src='FRED')&#xA;SP500 &amp;lt;- Cl(to.monthly(SP500))&#xA;&#xA;#Re-index to start of month&#xA;library(lubridate)&#xA;index(SP500) &amp;lt;- as.Date(ISOdate(year(index(SP500)),month(index(SP500)),1))&#xA;&#xA;#6 month increase&#xA;SP500 &amp;lt;- na.omit(SP500-Lag(SP500,6))&#xA;names(SP500) &amp;lt;- 'SP500'&#xA;&#xA;#################################################&#xA;# 3. ISM Purchasing Managers index&#xA;#################################################&#xA;&#xA;#A. PMI&#xA;getSymbols('NAPM',src='FRED') #Non-farm emploment&#xA;PMI &amp;lt;- NAPM&#xA;names(PMI) &amp;lt;- 'PMI'&#xA;&#xA;#B. Employment&#xA;getSymbols('PAYEMS',src='FRED') #Non-farm emploment&#xA;PAYEMS &amp;lt;- na.omit((PAYEMS-Lag(PAYEMS,12))/Lag(PAYEMS,12)) #12 month increase&#xA;names(PAYEMS) &amp;lt;- 'PAYEMS'&#xA;&#xA;#################################################&#xA;# 4. Yield Curve&#xA;#################################################&#xA;getSymbols('GS10',src='FRED') #3-Month Treasury&#xA;YC &amp;lt;- na.omit(GS10-GS3M)&#xA;names(YC) &amp;lt;- 'YC'&#xA;&#xA;#################################################&#xA;# Put it all together&#xA;#################################################&#xA;&#xA;P.A &amp;lt;-(CS&amp;gt;0) &amp;amp; #1. Credit spreads widening over 6 months&#xA;                    (SP500&amp;lt;0) &amp;amp; #2. Stocks falling over 6 months&#xA;                    (PMI&amp;lt;50) &amp;amp;      #3. PMI below 50&#xA;                    (YC&amp;lt;2.5)        #4. 10 year vs 3 year yields below 2.5%&#xA;P.B &amp;lt;- (CS&amp;gt;0) &amp;amp; #1. Credit spreads widening over 6 months&#xA;                    (SP500&amp;lt;0) &amp;amp; #2. Stocks falling over 6 months&#xA;                    (PMI&amp;lt;54) &amp;amp;      #3. PMI below 54&#xA;                    (PAYEMS&amp;lt;1.3) &amp;amp;  #3.B 1Y employment growth below 1.3%&#xA;                    (YC&amp;lt;3.1)        #4. 10 year vs 3 year yields below 2.5%&#xA;&#xA;P.Rec &amp;lt;- P.A | P.B&#xA;names(P.Rec) &amp;lt;- 'P.Rec'&#xA;P.Rec$P.Rec &amp;lt;- as.numeric(P.Rec$P.Rec)&#xA;&#xA;#Actual Recessions&#xA;getSymbols('USREC',src='FRED') &#xA;chartSeries(P.Rec)&#xA;chartSeries(USREC)&#xA;&#xA;#Compare&#xA;ReccessionForecast &amp;lt;- na.omit(cbind(P.Rec,USREC))&#xA;start &amp;lt;- min(index(ReccessionForecast))&#xA;ReccessionForecast &amp;lt;- ts(ReccessionForecast,frequency=12,start=c(year(start),month(start)))&#xA;plot(ReccessionForecast)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="500" LastEditorUserId="500" LastEditDate="2011-08-10T13:38:37.963" LastActivityDate="2011-08-10T13:38:37.963" Title="How do I replicate John Hussman's recession forecasting methodology?" Tags="&lt;r&gt;&lt;forecasting&gt;&lt;machine-learning&gt;&lt;macro-economics&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="1619" PostTypeId="2" ParentId="1615" CreationDate="2011-08-08T21:30:18.763" Score="4" Body="&lt;p&gt;Post-crisis there has been some research that uses return series for financial institutions to predict downturns. I think the major ones are &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1269446&quot; rel=&quot;nofollow&quot;&gt;CoVaR&lt;/a&gt; (Adrian and Brunnermeier) and &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1623577&quot; rel=&quot;nofollow&quot;&gt;CATFIN&lt;/a&gt; (Allen, Bali, and Tang). These lit reviews in these papers should provide a lot of background.&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-08-08T21:30:18.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1620" PostTypeId="2" ParentId="1618" CreationDate="2011-08-08T22:34:08.530" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;This may have been correct earlier on - but now, with the CP market all but frozen up, this is not such a good indicator. Moreover, corporate credit is quite robust these days and still, we are talking of an impending recession - simply put, the credit risk has passed on to the sovereigns. Hence a better proxy would be &lt;em&gt;municipal paper&lt;/em&gt;/peripehral EU bonds vs US 2y Treasury&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Rather than just a decline, a volatility based measure would be more appropriate (although, as we know from skews, a bearish market is inherently more volatile). But, do remember, that it is &lt;em&gt;volatility&lt;/em&gt; that leads to greater financing costs (higher option prices, uncertain collateral value - all unhealthy signs).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;3a and 3b. Looks correct - although in 3b, I would be careful about combining a leading and a lagging indicator.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Historically, the 2s10s (or equivalently, the 2y/10y CMT spread is amazingly accurate at predicting recessions (the classic inversion of the yield curve) - beware when this hovers close to zero (or even below zero)!&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I won't be too religious about actual figures like &quot;1.3%&quot; - I think calibration against past data using your methodology should give you better bounds on these numbers (ie use these numbers as parameters and see which parameters vector helps you predict recessions with the highest accuracy for historical data).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="1151" LastActivityDate="2011-08-08T22:34:08.530" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="1621" PostTypeId="1" AcceptedAnswerId="1676" CreationDate="2011-08-08T22:35:19.860" Score="29" ViewCount="24719" Body="&lt;p&gt;The general problem I have is visualization of the &lt;em&gt;implied&lt;/em&gt; distribution of returns of a currency pair. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I usually use QQplots for historical returns, so for example versus the normal distribution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/fAeEf.png&quot; alt=&quot;QQ plots&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I would like to see the same QQplot, but for implied returns given a set of implied BS volatilities, for example here are the surfaces:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;USDZAR  1month  3month  6month  12month 2year&#xA;10dPut  15.82   14.59   14.51   14.50   15.25&#xA;25dPut  16.36   15.33   15.27   15.17   15.66&#xA;ATMoney 17.78   17.01   16.94   16.85   17.36&#xA;25dCall 20.34   20.06   20.24   20.38   20.88&#xA;10dCall 22.53   22.65   23.39   24.23   24.84&#xA;&#xA;EURPLN  1month  3month  6month  12month 2year&#xA;10dPut  9.10    9.06    9.10    9.43    9.53&#xA;25dPut  9.74    9.54    9.51    9.68    9.77&#xA;ATMoney 10.89   10.75   10.78   10.92   11.09&#xA;25dCall 12.83   12.92   13.22   13.55   13.68&#xA;10dCall 14.44   15.08   15.57   16.16   16.34&#xA;&#xA;EURUSD  1month  3month  6month  12month 2year&#xA;10dPut  19.13   19.43   19.61   19.59   18.90&#xA;25dPut  16.82   16.71   16.67   16.49   15.90&#xA;AtMoney 14.77   14.52   14.44   14.22   13.87&#xA;25dCall 13.56   13.30   13.23   13.04   12.85&#xA;10dCall 12.85   12.85   12.90   12.89   12.78&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Anybody know how I could go about doing this? Any R packages or hints where to start on this? It doesn't necessarily have to be a qqplot, it could just be a plot of the density function; that would help me too. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="954" LastEditorUserId="1106" LastEditDate="2011-08-16T13:28:06.693" LastActivityDate="2019-03-20T12:48:02.473" Title="How to derive the implied probability distribution from B-S volatilities?" Tags="&lt;options&gt;&lt;r&gt;&lt;implied-volatility&gt;&lt;visualization&gt;&lt;distribution&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="27" ContentLicense="CC BY-SA 3.0" />
  <row Id="1622" PostTypeId="2" ParentId="1615" CreationDate="2011-08-08T22:54:36.133" Score="6" Body="&lt;p&gt;This is one index I find to quite credible (Kansas City Fed Financial Stress Indicator):&#xA;&lt;a href=&quot;http://www.kansascityfed.org/research/indicatorsdata/kcfsi/&quot;&gt;http://www.kansascityfed.org/research/indicatorsdata/kcfsi/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1151" LastActivityDate="2011-08-08T22:54:36.133" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1623" PostTypeId="2" ParentId="915" CreationDate="2011-08-08T22:56:29.340" Score="13" Body="&lt;p&gt;CVA desks are not front office as they have no dealings with external clients. They can be considered &quot;smart middle office&quot; as they are a necessary part of the plumbing to facilitate the core activity of the bank, which is to trade as many derivatives as possible with clients, all of whom have varying levels of credit risk. Essentially, it allows traders in financial products to specialise in their area, rather than having to worry about overlaying credit on top of their pureplay core competence.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My personal experience is that good CVA people often make it to the front office, and are certainly part of the dealmaking process as there will often be a negotiation with them to take on a credit risk (at the right price) which will make/break an external transaction. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To the extent that you &quot;deal&quot; with internal clients you can be said to have &quot;front office style&quot; skills, but remember, most trading desks &lt;em&gt;must&lt;/em&gt; deal with you, whereas most external clients do not &lt;em&gt;have to&lt;/em&gt; deal with the bank. That's the key difference. There's no art in transacting with captive clients. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, CVA is super complex as you have massive correlations to worry about on risks right across the bank, many (most) of which are unhedgable directly, and so the quants on these desks usually are highly respected, and must have a strong feel for the market as there will always be risks that they want to (or indeed &lt;em&gt;have&lt;/em&gt; to) keep. So they're often great traders. That said, a large part of their profits will be used up as reserve, so they won't get paid on it, that reserve will often vanish in a crisis, and finally, if a CVA desk is making &quot;too much&quot; money (obviously hard to define - but easy to point fingers at), they will attract the attention of the management, for the wrong reasons, because ultimately, to the people that run the show, they represent a cost of doing business.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when &quot;it&quot; hits the fan, if the CVA desk has done its job, then they can literally save the bank, and that's potentially a huge source of reward. &lt;/p&gt;&#xA;" OwnerUserId="954" LastEditorUserId="954" LastEditDate="2011-08-08T23:09:23.393" LastActivityDate="2011-08-08T23:09:23.393" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1624" PostTypeId="1" AcceptedAnswerId="1630" CreationDate="2011-08-08T22:58:34.100" Score="7" ViewCount="1724" Body="&lt;p&gt;In teaching myself about bonds, I am writing some software, one piece of which will calculate the maturity of a bond given the yield curve as a function and a requested duration.  The tricky part is that duration depends on interest rates, and the interest rate depends (through the yield curve) on maturity, which depends on duration.  That part is working fine for reasonable durations and interest rates, albeit somewhat slowly, simply by iterating back and forth between calculating maturity and calculating interest rates, until a solution is settled upon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, another function is supposed to generate a portfolio of such bonds by calling the former function, given an average duration and a std. dev. of the duration of the bonds in the portfolio.  Now the paradigm breaks down, since the generator will occasionally request durations greater than the maximum duration of the bond itself.  The easiest fix for both functions is to calculate an approximate maximum duration and avoid duration requests that are beyond that limit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My understanding of maximum duration is somewhat limited, except to say that the duration-maturity relationship is inverted-U shaped and generally not amenable to closed-form solutions.  I have only been able to locate &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=738445&quot; rel=&quot;noreferrer&quot;&gt;one paper on the subject&lt;/a&gt;, which is for below-par bonds only.  Gross approximations are fine; I just need to be in the ballpark for this application.  But closed-form solutions are essential since this check will be run on every bond created (and if I simulate I may create thousands or more over time).&lt;/p&gt;&#xA;" OwnerUserId="1184" LastActivityDate="2011-08-10T13:12:53.917" Title="Closed-form formula for approximate maximum duration of a bond?" Tags="&lt;fixed-income&gt;&lt;duration&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1625" PostTypeId="2" ParentId="1615" CreationDate="2011-08-09T02:04:27.087" Score="4" Body="&lt;p&gt;There is considerable literature on the role of sentiment in predicting stock market returns. Sentiment is often used as the proxy variable to explain Risk Aversion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would check out the following for details:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://bbs.cenet.org.cn/uploadImages/200361315135868299.pdf&quot; rel=&quot;nofollow&quot;&gt;Neal &amp;amp; Wheatley&lt;/a&gt; - Do measures of investor sentiment predict stock market returns&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.econ.yale.edu/~shiller/behfin/2011-04/Stambaugh.pdf&quot; rel=&quot;nofollow&quot;&gt;Stambaugh&lt;/a&gt; - The Short of it: Investor sentiment and stock market anomolies&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://mba.vanderbilt.edu/vanderbilt/data/research/1018full.pdf&quot; rel=&quot;nofollow&quot;&gt;Charenarook&lt;/a&gt; - Does Sentiment matter?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Also, take a look at &lt;a href=&quot;http://www.econ.nyu.edu/user/ludvigsons/eqprem1.pdf&quot; rel=&quot;nofollow&quot;&gt;CAY&lt;/a&gt; - a variable describing the consumption-to-wealth ratio:&#xA;Lettau and Ludvigson - Consumption, Aggregate Wealth, and Stock Returns&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2011-08-09T02:04:27.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1626" PostTypeId="2" ParentId="1339" CreationDate="2011-08-09T02:11:13.943" Score="5" Body="&lt;p&gt;All the ideas above are great ideas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another kind of test would be an idea borrowed from &lt;a href=&quot;http://en.wikipedia.org/wiki/Random_matrix&quot; rel=&quot;noreferrer&quot;&gt;Random Matrix Theory&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assemble your time-series into a matrix. Evaluate the distribution of the eigenvalues of the matrix vs. the distribution of a random matrix. Turns out that the distribution of eigenvalues in a random matrix conforms to distributions such as the Marchenko-Pastur distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the distribution of eigenvalues conform to the eigenvalues predicted by a random matrix (where each entry corresponds to a draw from a standard normal random variable, for example), then there is probably not information in the time-series. &lt;a href=&quot;http://mathworld.wolfram.com/WignersSemicircleLaw.html&quot; rel=&quot;noreferrer&quot;&gt;Here&lt;/a&gt; is an illustration of Wigner's semi-circle law for a random matrix.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2011-08-09T02:11:13.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1627" PostTypeId="1" AcceptedAnswerId="1695" CreationDate="2011-08-09T04:47:01.873" Score="8" ViewCount="764" Body="&lt;p&gt;I am building a global tactical equity allocation model. The model will help determine an optimal allocation amongst a number of major developed and emerging stock markets (represented for my purposes by the MSCI country indices). The model will use inputs such as macroeconomic indicators, local currency yield curves and differentials, valuation (e.g. P/E), momentum, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should the returns series input into the model be currency hedged or unhedged?  In practice, we will have the option of making separate currency bets. Is the fundamental series which should be compared across countries the hedged or unhedged series? To clarify, the goal in making this decision is to maximize our predictive power.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if I were building an options relative value model, I would certainly compare only delta-hedged returns, even though my actual hedging may differ I practice. in this case, however, adding currency hedging may actually be adding noise rather than reducing it. &lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-08-15T23:51:42.040" Title="Should I use currency hedged or unhedged returns for a global equity allocation model?" Tags="&lt;equities&gt;&lt;modeling&gt;&lt;currency&gt;&lt;tactical-asset-allocation&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1628" PostTypeId="1" AcceptedAnswerId="1629" CreationDate="2011-08-09T04:47:10.410" Score="25" ViewCount="7099" Body="&lt;p&gt;What are the best sources of quantitative finance research in equities?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will list a couple and note an asterisk if the research is available by request (i.e. non-clients) or online:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;BAC-Merrill Lynch - Savita Subramanian&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Deutsche Bank - Yin Luo*&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Credit Suisse - Pankaj Patel&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Barclay's - Matthew Rothman&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;HSBC - Ely Klepfish*&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Goldman Sachs - Quantitative Strategies &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Neuberger-Berman - &lt;a href=&quot;https://www.nb.com/europe/strategy_quantitative.html&quot;&gt;Wai Lee&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Nomura - Joseph Mezrich&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Perhaps there are also more un-conventional sources of quant research besides sell-side wall street:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.hussman.net/&quot;&gt;Hussman Funds&lt;/a&gt; - John Hussman*&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Emanuel Derman's &lt;a href=&quot;http://www.ederman.com/new/index.html&quot;&gt;collection of papers&lt;/a&gt; &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-06-16T19:41:15.640" LastActivityDate="2017-05-28T21:52:16.950" Title="What are the best sources for equity quantitative research?" Tags="&lt;quant-trading-strategies&gt;&lt;equities&gt;&lt;research&gt;" AnswerCount="3" CommentCount="6" FavoriteCount="31" CommunityOwnedDate="2011-08-09T08:45:05.687" ContentLicense="CC BY-SA 3.0" />
  <row Id="1629" PostTypeId="2" ParentId="1628" CreationDate="2011-08-09T04:56:08.533" Score="12" Body="&lt;p&gt;&lt;strong&gt;Sell Side&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Macquarie Quant - Venkat Eleswarapu&lt;/li&gt;&#xA;&lt;li&gt;Bernstein Research - Vadim Zlotnikov&lt;/li&gt;&#xA;&lt;li&gt;Nomura - Joe Mezrich&lt;/li&gt;&#xA;&lt;li&gt;JPMorgan Investment Strategies series&lt;/li&gt;&#xA;&lt;li&gt;Societe Generale - Alain Bokobza&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Independent&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.cxoadvisory.com/&quot;&gt;CXO Advisory&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://blog.empiricalfinancellc.com/&quot;&gt;Empirical Finance Blog&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.russell.com/indexes/tools-resources/research-insights.asp&quot;&gt;Russell Indexes: Research and Insights&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.msci.com/resources/research_papers/&quot;&gt;MSCI Research Papers&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.axiomainc.com/research_papers.htm&quot;&gt;Axioma Research Papers&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-09-20T20:28:14.350" LastActivityDate="2011-09-20T20:28:14.350" CommentCount="0" CommunityOwnedDate="2011-08-09T08:45:05.687" ContentLicense="CC BY-SA 3.0" />
  <row Id="1630" PostTypeId="2" ParentId="1624" CreationDate="2011-08-09T08:10:59.703" Score="5" Body="&lt;p&gt;After struggling through the Pianca paper due to its poor proofing ($F$ is never defined but appears to be face value, and $n$ is implied to be the number of periods remaining but is instead maturity), I seem to have it worked out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the lambertW function in gsl, I have it replicated in R:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Estimate duration using various closed-form formulae&#xA;# Equations 5,6, and 11 in Pianca &quot;Maximum duration of below-par bonds: A closed-form formula&quot;&#xA;# Assumptions: flat yield curve, constant coupon, reimbursement value = face value&#xA;# r = C/F, or the coupon rate (F is face value, C is dollar value of coupons)&#xA;# i = applicable interest rate&#xA;# n = maturity date,&#xA;# type = &quot;pianca&quot;, &quot;macaulay&quot;, or &quot;hawawini&quot;&#xA;# At par, (i==r)&#xA;findDur_ClosedForm &amp;lt;- function(r,i,n,type=&quot;pianca&quot;) {&#xA;  type &amp;lt;- tolower(type)&#xA;  ani &amp;lt;- NA # For hawawini: Need pv of an n-period annuity at rate i&#xA;  switch(type,&#xA;    pianca = 1 + (1/i) + ( n*(i-r) - (1+i) )/( r*( (1+i)^n - 1 ) + i ) ,&#xA;    macaulay = 1 + 1/i - ( (1+i)/r + n*(1+1/r-(1+i)/r ) ) / ( (1+i)^n - 1 - 1/r + (1+i)/r ) ,&#xA;    hawawini = ( (1+i)*ani*r + n*(i-r)(1+i)^(-n) ) / ( r+(i-r)(1+i)^-n )&#xA;  )&#xA;}&#xA;&#xA;library(gsl)&#xA;# Find maximum duration using closed-form formulae&#xA;# ... pass-alongs to findDur_ClosedForm&#xA;findMaxDur &amp;lt;- function(r,i,...) {&#xA;  # If above or at par, max duration is 1+1/i&#xA;  # Otherwise use Pianca formula&#xA;  asymptote &amp;lt;- 1+1/i&#xA;  if( i&amp;lt;=r ) { # At or above par&#xA;    return(asymptote)&#xA;  } else { # Below par&#xA;    a &amp;lt;- i-r&#xA;    b &amp;lt;- log(1+i)&#xA;    n &amp;lt;- ( b*(1+i) + a*( 1 + lambert_W0( a*exp( -(a+b*(1+i))/a )/r ) ) ) / (a*b)&#xA;    return( findDur_ClosedForm(r=r,i=i,n=n) )&#xA;  }&#xA;}&#xA;&#xA;Ns &amp;lt;- seq(1,300,1)&#xA;Ds &amp;lt;- sapply( Ns, findDur_ClosedForm,r=.001,i=.05 )&#xA;plot(Ds~Ns)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/nE29l.png&quot; alt=&quot;r=.001,i=.05&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Numerical optimization from closed form&#xA;&amp;gt; max(Ds)&#xA;[1] 51.01994&#xA;# Maximum according to Pianca's paper&#xA;&amp;gt; findMaxDur(r=.001,i=.05)&#xA;[1] 51.01998&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have also confirmed through reading through the papers carefully and comparing to exact results that the closed form solutions are all estimates not exact.&lt;/p&gt;&#xA;" OwnerUserId="1184" LastEditorUserId="1184" LastEditDate="2011-08-10T13:12:53.917" LastActivityDate="2011-08-10T13:12:53.917" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1631" PostTypeId="2" ParentId="1624" CreationDate="2011-08-09T08:16:43.043" Score="4" Body="&lt;p&gt;If you're able to work with the results from the paper cited (Pianca, &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=738445&quot; rel=&quot;nofollow noreferrer&quot;&gt;Maximum Duration of Below Par Bonds: A Closed-Form Formula&lt;/a&gt;), congratulations!  You have the hard part done!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maximum durations for par and premium bonds are trivial.  Here is a figure directly from the cited paper:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Mpr86.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some points about the figure:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the market interest rate used is $i=10\%$&lt;/li&gt;&#xA;&lt;li&gt;$1 + 1/i$ is the duration of a perpetual bond&lt;/li&gt;&#xA;&lt;li&gt;except for the zero-coupon bond, as maturity increases, the durations of all bonds asymptotically approach that of the perpetual bond&lt;/li&gt;&#xA;&lt;li&gt;the par and premium bonds ($r=10\%$ and $r=20\%$ both monotonically increase toward the duration of the perpetual bond as maturity increases&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Thus, the maximum duration for par and above-par bonds is simply $1+1/i$, where $i$ is the market interest rate.&lt;/p&gt;&#xA;" OwnerUserId="1129" LastActivityDate="2011-08-09T08:16:43.043" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1632" PostTypeId="1" CreationDate="2011-08-09T08:33:56.027" Score="2" ViewCount="2155" Body="&lt;p&gt;Someone told me that mean reversion can be implied by the different valuations of bermudan swaptions when using different methods for volatility calibration. Does anyone know what this means?&lt;/p&gt;&#xA;" OwnerUserId="1166" LastEditorUserId="1106" LastEditDate="2011-08-09T11:53:33.500" LastActivityDate="2011-08-12T17:45:23.527" Title="How is mean reversion implied by different valuations of Bermudan swaptions?" Tags="&lt;volatility&gt;&lt;stochastic-volatility&gt;&lt;mean-reversion&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1633" PostTypeId="1" CreationDate="2011-08-09T10:57:20.400" Score="3" ViewCount="956" Body="&lt;p&gt;I m recently doing my dissertation and faced with problem in estimation basic rolling GARCh (1,1) process. I have 2500 observation and need to forecast 1 day ahead volatility in rolling form. I will highly appreciate if advanced users provide me assistance in that issue.. I looked guideline but there was no information. In addition I have 6 day remaining to finish my dissertation. So I need your help immediately. Please share any knowledge that you have in that issue&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition how can I estimate AGARCH in eviews? Iwant to capture asymmetry in time series? ( not by the method of EGARCH and GJR GARCH)&#xA;Sincerely&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fariz&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks all&lt;/p&gt;&#xA;" OwnerUserId="1178" LastActivityDate="2011-08-12T13:42:07.563" Title="Rolling GARCH and higher moments" Tags="&lt;forecasting&gt;&lt;software&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1634" PostTypeId="2" ParentId="1609" CreationDate="2011-08-09T11:49:38.573" Score="3" Body="&lt;p&gt;In software R use the function fitdistr ( package MASS). For more information:&#xA;&lt;a href=&quot;http://stat.ethz.ch/R-manual/R-patched/library/MASS/html/fitdistr.html&quot; rel=&quot;nofollow&quot;&gt;http://stat.ethz.ch/R-manual/R-patched/library/MASS/html/fitdistr.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1185" LastActivityDate="2011-08-09T11:49:38.573" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1635" PostTypeId="2" ParentId="1618" CreationDate="2011-08-09T14:16:36.323" Score="2" Body="&lt;p&gt;I think you may have made a mistake in your interpretation of #1.  Putting aside Akshay's concerns (which are actually quite relevant), you can find commercial paper data and other relevant interest rates at the &lt;a href=&quot;http://www.federalreserve.gov/releases/h15/data.htm&quot; rel=&quot;nofollow&quot;&gt;Federal Reserve's H15&lt;/a&gt; data release page.  There you will find CP rate data for financial and non-financial firms, as well as the 3 &lt;strong&gt;month&lt;/strong&gt; Treasury bill rate.  I am not sure whether Hussman would use the financial or non-financial CP rate, he probably created this when there was only one rate, which has since been discontinued.  In any case, you will want to compare 3-month CP to 3-month Treasury to keep it apples-to-apples.  You may have to do some of your own research to see how to replicate the old CP rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Fed page also has corporate bond data, for which you may want to look at the Moody's seasoned Baa index data, and compare to 10-year Treasury constant maturity.  Alternatively, going with Akshay's recommendation, you can use the State &amp;amp; Local Bonds rate from the same page (also compared to 10-year Treasury).  If you have access to Barclays (Lehman) data, you have much more choice.  In that case, you would want to look at the OAS of the Investment Grade Corporate index.  However, the Fed series are going to have the longest history, which IMHO is of paramount concern when constructing an indicator for something with inherently very few independent observations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW, you also seem to have made the mistake of using 3-year instead of 3-month Treasuries in #4.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-08-09T14:16:36.323" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1636" PostTypeId="1" AcceptedAnswerId="1712" CreationDate="2011-08-09T15:03:18.353" Score="2" ViewCount="196" Body="&lt;p&gt;The old &lt;a href=&quot;http://research.stlouisfed.org/fred2/series/CP3M&quot; rel=&quot;nofollow&quot;&gt;3-Month Commercial Paper Rate (CP3M)&lt;/a&gt; on FRED was discontinued in 1997. I would like to reconstruct this series in a reasonable fashion, so I can use it to analyze more recent events.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was thinking of using some combination of &lt;a href=&quot;http://research.stlouisfed.org/fred2/series/CPF3M&quot; rel=&quot;nofollow&quot;&gt;3-Month AA Financial Commercial Paper Rate (CPF3M)&lt;/a&gt; and &lt;a href=&quot;http://research.stlouisfed.org/fred2/series/CPN3M&quot; rel=&quot;nofollow&quot;&gt;3-Month AA Nonfinancial Commercial Paper Rate (CPN3M)&lt;/a&gt;, but I'm unsure how to weight them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="500" LastEditorUserId="1106" LastEditDate="2011-08-18T14:43:01.823" LastActivityDate="2011-08-18T14:43:01.823" Title="How to reconstruct a discontinued economic time series such as the Fed's CP rate?" Tags="&lt;time-series&gt;&lt;statistics&gt;&lt;estimation&gt;&lt;fixed-income&gt;&lt;macro-economics&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1637" PostTypeId="1" AcceptedAnswerId="2111" CreationDate="2011-08-09T15:23:46.060" Score="4" ViewCount="112" Body="&lt;p&gt;I'm just trying to determine the appropriate naming convention for a category that holds cap or spread, or in other words, what category can I put cap and spread (in this context) into?  Are they &quot;Features&quot; of a monthly sum option, or &quot;Limits&quot; ... I really don't know.  &lt;/p&gt;&#xA;" OwnerUserId="551" LastActivityDate="2011-10-05T19:45:16.207" Title="How Would You Categorize A Cap or Spread On A Monthly Sum Option?" Tags="&lt;monthly&gt;&lt;spread&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1638" PostTypeId="2" ParentId="1633" CreationDate="2011-08-09T17:25:33.553" Score="2" Body="&lt;p&gt;After trying to write some pseudo-code which might or might not have helped you, I googled this forum discussion: &lt;a href=&quot;http://forums.eviews.com/viewtopic.php?f=5&amp;amp;t=1048&quot; rel=&quot;nofollow&quot;&gt;http://forums.eviews.com/viewtopic.php?f=5&amp;amp;t=1048&lt;/a&gt; - maybe it is helpful for you, because it describes a similar problem.&lt;/p&gt;&#xA;" OwnerUserId="357" LastActivityDate="2011-08-09T17:25:33.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1639" PostTypeId="2" ParentId="942" CreationDate="2011-08-09T19:31:26.530" Score="16" Body="&lt;p&gt;Do not passively use Yahoo where you need reliable historical data; it will just fail at one point (from what I have seen due to corporate actions/dividends not properly implemented). Paying for a single alternative data source will not save you either (Bloomberg sometimes reports crazy intraday prices); the only way is to write some data cleaning routines (that will warn you if something strange happens), and to compare what several different providers say. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Welcome to the prehistory!&lt;/p&gt;&#xA;" OwnerUserId="1187" LastActivityDate="2011-08-09T19:31:26.530" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1640" PostTypeId="1" CreationDate="2011-08-10T00:53:45.187" Score="94" ViewCount="165809" Body="&lt;p&gt;I have a very basic data question: how to get a list of all common stocks traded on NYSE, NASDAQ and AMEX? I would need to be able to get the approximate list of common stocks as is available in Telechart... I can not get this data at &lt;a href=&quot;http://www.eoddata.com&quot;&gt;eoddata&lt;/a&gt;, for example...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to calculate market breadth indicators and would like to find out how many of common stocks traded were up or down 4% (breakouts/breakdowns) (Cl-Lag(Cl) &gt; 0.04 (4% breakout), Cl-Lag(Cl) &amp;lt; -0.04 (4% breakdown)), how many of common stocks traded are down/up 25% in quarter etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first problem is how to get a list of symbols with only common stocks (no ETFs).&lt;/p&gt;&#xA;" OwnerUserId="1188" LastEditorUserId="56" LastEditDate="2011-08-10T20:39:32.883" LastActivityDate="2021-03-01T03:24:18.463" Title="Where to download list of all common stocks traded on NYSE, NASDAQ and AMEX?" Tags="&lt;data&gt;&lt;market-data&gt;" AnswerCount="8" CommentCount="7" FavoriteCount="77" ContentLicense="CC BY-SA 3.0" />
  <row Id="1641" PostTypeId="2" ParentId="1640" CreationDate="2011-08-10T02:01:13.533" Score="19" Body="&lt;p&gt;&lt;a href=&quot;http://bsym.bloomberg.com/sym/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bloomberg Open Symbology&lt;/a&gt; has this list. Look in the Common Stock precanned file. This will have a bit more data than you probably need as it has a separate entry and unique id for each place an equity is traded. However it is probably the highest quality list available for free anywhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for filtering ETFs are broken out in a separate file (Equity_ETP) so you simply need to filter by exchange.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update November 2017: BSYM is no more and its replacement does not have prebuilt files as far as I can tell.&lt;/p&gt;&#xA;" OwnerUserId="373" LastEditorUserId="373" LastEditDate="2017-11-15T00:46:44.813" LastActivityDate="2017-11-15T00:46:44.813" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="1644" PostTypeId="2" ParentId="1628" CreationDate="2011-08-10T10:56:27.943" Score="11" Body="&lt;p&gt;Quantivity's &lt;a href=&quot;http://quantivity.wordpress.com/2011/03/06/people-of-quant-research/&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;People of Quant Research&quot;&gt;&quot;People of Quant Research&quot;&lt;/a&gt;(&lt;a href=&quot;https://web.archive.org/web/20170528215145/https://quantivity.wordpress.com/2011/03/06/people-of-quant-research/&quot; rel=&quot;nofollow noreferrer&quot;&gt;mirror&lt;/a&gt;) has quite an exhaustive list (albeit not exclusively equity-orientated).&lt;/p&gt;&#xA;" OwnerUserId="767" LastEditorUserId="2183" LastEditDate="2017-05-28T21:52:16.950" LastActivityDate="2017-05-28T21:52:16.950" CommentCount="4" CommunityOwnedDate="2011-08-10T10:56:27.943" ContentLicense="CC BY-SA 3.0" />
  <row Id="1645" PostTypeId="1" CreationDate="2011-08-10T12:35:27.127" Score="12" ViewCount="3673" Body="&lt;p&gt;I am currently working in a team responsible for maintaining a simple risk application for our bond desk and I am interested in knowing how to provide some sort of basic basis risk metric.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Our desk mainly trades vanilla bonds which are hedged with bond futures. While I will not be implementing this, I am keen to know at a high level how this might be possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if I have a German Bund maturing in ten years with a DV01 of 100 which I hedge with German Bund futures which also have a DV01 of 100, how might I calculate the basis risk between these two instruments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any references would also be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="1165" LastEditorUserId="1106" LastEditDate="2011-08-11T11:43:22.860" LastActivityDate="2015-10-17T16:44:37.040" Title="What is the basis risk between cash and futures government bonds?" Tags="&lt;risk&gt;&lt;futures&gt;&lt;fixed-income&gt;&lt;duration&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1646" PostTypeId="2" ParentId="1628" CreationDate="2011-08-10T14:39:51.467" Score="7" Body="&lt;p&gt;definitely add:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.moneyscience.com/pg/linklibrary/financial-research&quot;&gt;http://www.moneyscience.com/pg/linklibrary/financial-research&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-08-10T14:39:51.467" CommentCount="0" CommunityOwnedDate="2011-08-10T14:39:51.467" ContentLicense="CC BY-SA 3.0" />
  <row Id="1647" PostTypeId="2" ParentId="1615" CreationDate="2011-08-10T15:12:32.957" Score="3" Body="&lt;p&gt;Here is another paper I found recently on using sentiment to predict equity markets:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1503305&quot; rel=&quot;nofollow&quot;&gt;Risk Sentiment Index (RSI) and Market Anomalies&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-08-10T15:12:32.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1648" PostTypeId="2" ParentId="1640" CreationDate="2011-08-10T15:17:34.257" Score="13" Body="&lt;p&gt;You can download all stocks on the three exchanges listed in your question from the NASDAQ website: &lt;a href=&quot;http://www.nasdaq.com/screening/company-list.aspx&quot;&gt;http://www.nasdaq.com/screening/company-list.aspx&lt;/a&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like removing those entries with an industry of &quot;N/A&quot; will eliminate ETFs and other funds from the list.&lt;/p&gt;&#xA;" OwnerUserId="584" LastActivityDate="2011-08-10T15:17:34.257" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1649" PostTypeId="2" ParentId="1640" CreationDate="2011-08-10T20:50:40.243" Score="9" Body="&lt;p&gt;The &lt;code&gt;stockSymbols&lt;/code&gt; function in the R package &lt;a href=&quot;http://cran.r-project.org/web/packages/TTR/index.html&quot;&gt;TTR&lt;/a&gt; pulls the data from nasdaq.com that @bellamyj mentioned.  It also attempts to convert the symbols to a format acceptable to Yahoo Finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, I'm not certain how to filter this list for only common stocks.  There are 1275 securities with &quot;n/a&quot; Sector or Industry, leaving ~5000.  Perhaps the remaining categories in Sectors and Industries can help you further refine the list.&lt;/p&gt;&#xA;" OwnerUserId="56" LastActivityDate="2011-08-10T20:50:40.243" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1651" PostTypeId="2" ParentId="141" CreationDate="2011-08-10T23:30:06.617" Score="5" Body="&lt;p&gt;General data source:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://wrds-web.wharton.upenn.edu/wrds/&quot; rel=&quot;noreferrer&quot;&gt;WRDS&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fixed Income:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://federalreserve.gov/releases/h15/data.htm&quot; rel=&quot;noreferrer&quot;&gt;Fed historical daily rates&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="1184" LastActivityDate="2011-08-10T23:30:06.617" CommentCount="0" CommunityOwnedDate="2011-08-10T23:30:06.617" ContentLicense="CC BY-SA 3.0" />
  <row Id="1654" PostTypeId="2" ParentId="1645" CreationDate="2011-08-11T11:37:32.090" Score="4" Body="&lt;p&gt;There are (at least) two factors here. One is the difference in convexity between the vanilla bond and the cheapest-to-deliver underlying the futures. The second is potential changes in which bond is cheapest to deliver. The former is simple enough to calculate, and you will need to dynamically hedge with futures to offset that risk  For the latter, you will want to create something like a spreadsheet showing which bond is cheapest to deliver under various interest rate scenarios, and how the duration and convexity of the new underlying changes at those points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One added complication is that you will also have to apply a convexity correction to the futures price (on top of the normal value of the forward) to handle the convexity bias.  See &lt;a href=&quot;http://www.scribd.com/doc/19607017/Salomon-Brothers-Understanding-the-Yield-Curve-Part-5-Convexity-Bias-and-the-Yield-Curve&quot; rel=&quot;nofollow&quot;&gt;Salomon Brothers' Understanding the Yield Curve&lt;/a&gt;.  The Salomon Brothers note series is also a good general reference for yield curve trades.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-08-18T18:12:09.657" LastActivityDate="2011-08-18T18:12:09.657" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1655" PostTypeId="1" AcceptedAnswerId="1659" CreationDate="2011-08-11T17:03:39.203" Score="4" ViewCount="445" Body="&lt;p&gt;Due to the ongoing turmoil in the financial markets a short-selling ban is being considered (again, one has to say, but this time in Europe): &lt;br&gt; &lt;a href=&quot;http://www.nytimes.com/2011/08/12/business/global/europe-considers-ban-on-short-selling.html&quot; rel=&quot;nofollow&quot;&gt;http://www.nytimes.com/2011/08/12/business/global/europe-considers-ban-on-short-selling.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Aside from the point that this seems to serve purely political reasons (since it is pretty clear that short-selling is &lt;strong&gt;not&lt;/strong&gt; the culprit, quite the opposite as a ban will most probably lead to even &lt;strong&gt;more&lt;/strong&gt; market volatility) I have a different question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Concerning the experience with past bans: How was the derivatives markets affected esp. futures and options? There will be studies out there, I hope. This is also interesting with respect to the question how important hedging with linear instruments really is for market makers. &lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2011-08-12T07:39:17.830" LastActivityDate="2011-08-12T07:39:17.830" Title="How did bans on short-selling affect the derivatives markets?" Tags="&lt;hedging&gt;&lt;derivatives&gt;&lt;short-selling&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1656" PostTypeId="1" CreationDate="2011-08-11T18:20:59.823" Score="18" ViewCount="18470" Body="&lt;p&gt;I want a list of all CUSIPs/ISINs. It would be nice if they were also categorized (e.g. Bonds/Funds etc). Where can I get such a data?&lt;/p&gt;&#xA;" OwnerUserId="1203" LastEditorUserId="2183" LastEditDate="2017-05-30T05:16:18.827" LastActivityDate="2018-02-02T20:26:18.557" Title="How to get list of all CUSIPS/ISIN?" Tags="&lt;equities&gt;&lt;fixed-income&gt;&lt;data&gt;&lt;funds&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="1657" PostTypeId="2" ParentId="716" CreationDate="2011-08-11T18:45:45.567" Score="2" Body="&lt;p&gt;How did your test of arbitraging Oanda's continuous interest versus other FX broker's rollover go?  I ran a similar test before and found it did not overcome the spread costs, although starting on Wednesday (triple pay day) helped, the weekend interest at Oanda would catch up.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are other ways of trading this arbitrage.  You can average into a leveraged interest positive position at Oanda, and then open a hedging position at another broker after the rollover.  However, that is essentially no different than conducting a straight retail trade but with the added risk of carrying potentially large positions in multiple brokers.&lt;/p&gt;&#xA;" OwnerUserId="1205" LastEditorUserId="38" LastEditDate="2011-09-09T09:44:39.763" LastActivityDate="2011-09-09T09:44:39.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1658" PostTypeId="1" AcceptedAnswerId="1682" CreationDate="2011-08-11T21:19:35.673" Score="36" ViewCount="4307" Body="&lt;p&gt;&lt;a href=&quot;http://www.bloomberg.com/news/2011-01-24/high-frequency-trading-is-77-of-u-k-market-tabb-group-says.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Various&lt;/a&gt; &lt;a href=&quot;http://www.opalesque.com/53867/High%20frequency%20trading/frequency_under261.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;studies&lt;/a&gt; &lt;a href=&quot;http://www.nytimes.com/2011/01/02/business/02speed.html?_r=1&amp;amp;ref=highfrequencyalgorithmictrading&quot; rel=&quot;nofollow noreferrer&quot;&gt;have&lt;/a&gt; demonstrated the very large and growing influence of high frequency trading (HFT) on the markets.  HFT firms are clearly making a great deal of money from somewhere, and it stands to reason that they are making this money at the expense of every other participant in the market.  Defenders of HFT will argue that HFT firms provide an essential service to the economy in the form of greater liquidity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What research has been done on the benefits and costs of HFT?&lt;/strong&gt;  Has any study attempted to measure either the benefits or the costs?  How would one attempt to measures these benefits and costs?  What would be the effect of banning rapidly cancelled limit orders (see &lt;a href=&quot;https://quant.stackexchange.com/q/1685/1106&quot;&gt;follow-up question&lt;/a&gt;), e.g. via a minimum 1-second tick rule?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any references and professional opinions (backed by research) on this topic would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-09-30T00:35:01.367" Title="Has high frequency trading (HFT) been a net benefit or cost to society?" Tags="&lt;automated-trading&gt;&lt;research&gt;&lt;high-frequency&gt;&lt;market-microstructure&gt;" AnswerCount="9" CommentCount="5" FavoriteCount="19" ContentLicense="CC BY-SA 3.0" />
  <row Id="1659" PostTypeId="2" ParentId="1655" CreationDate="2011-08-12T01:26:40.967" Score="2" Body="&lt;p&gt;In 2008, the SEC instituted an exemption for market makers to allow them to sell short for the purposes of bona fide activities related to market making in options. However, &quot;for new positions, a market maker may not sell short if the market maker knows a customer or counterparty is increasing an economic net short position&quot;.&lt;/p&gt;&#xA;" OwnerUserId="767" LastActivityDate="2011-08-12T01:26:40.967" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1660" PostTypeId="2" ParentId="1621" CreationDate="2011-08-12T01:46:46.737" Score="1" Body="&lt;p&gt;This stuff is not exactly my area of expertise, but since you're offering the bounty, I'll start things out and we'll see if the community can get us further along.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe the essence of your question is actually to find the implied distribution of returns given the B-S volatilities.  Once you have an implied distribution, comparing it to a normal distribution on a Q-Q plot is a relatively simple matter.  A Q-Q plot is an excellent visual inspection tool for comparing an empirical distribution to a theoretical one, as you've done above for a few currency pairs, although I am less certain you will find it as beneficial to plot two theoretical distributions on a Q-Q plot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, how do we find the implied distribution of returns from a set of Black-Scholes volatilities?  Your Q-Q plot question implies that you'd be equally happy with an &quot;empirical&quot; distribution as a theoretical one, so perhaps your best route here is a local volatility model.  See &lt;a href=&quot;http://www.ederman.com/new/docs/gs-volatility_smile.pdf&quot; rel=&quot;nofollow&quot;&gt;Derman and Kani (1994)&lt;/a&gt; for an excellent introduction on fitting a binomial tree model to the volatility smile.  Estimation of the continuous version of this model, the Dupire equation, is described in &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.69.9928&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow&quot;&gt;Computation of Local Volatilities from Regularized Dupire Equations by Hanke and Rosler&lt;/a&gt;.  Here is &lt;a href=&quot;http://www.performancetrading.it/Documents/KsIntroduction/Local_vs_Dupire.m&quot; rel=&quot;nofollow&quot;&gt;some MATLAB code&lt;/a&gt; which claims to estimate the equation.  Although the equation takes call prices as inputs and calculates implied vols, I'm sure you can modify it to take a set of implied volatilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you prefer to take a more theoretically sound approach, then &lt;a href=&quot;http://en.wikipedia.org/wiki/Stochastic_volatility&quot; rel=&quot;nofollow&quot;&gt;stochastic volatility&lt;/a&gt; models should be your choice, of which the &lt;a href=&quot;http://en.wikipedia.org/wiki/Heston_model&quot; rel=&quot;nofollow&quot;&gt;Heston&lt;/a&gt; model is the most popular.  These models have also been embellished with jumps and whatnot, but I am definitely not an expert there.  An excellent (although very technical) introduction to all of these concepts is &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0471792519&quot; rel=&quot;nofollow&quot;&gt;Gatheral's The Volatility Surface&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps those here who are more familiar with R can also point you in the right direction in terms of packages which will estimate these models for you given a set of points on the volatility surface.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good luck!  It looks like what you are asking is far more complex than you may have anticipated, but at least it has been well explored in the literature.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-08-12T01:46:46.737" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1663" PostTypeId="2" ParentId="1656" CreationDate="2011-08-12T13:45:32.527" Score="3" Body="&lt;p&gt;There is a service on the cusip homepage, but I suspect it will cost you money: &lt;a href=&quot;https://www.isin.cusip.com/isin/IsinServiceLogin.jsp&quot; rel=&quot;nofollow&quot;&gt;https://www.isin.cusip.com/isin/IsinServiceLogin.jsp&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="357" LastActivityDate="2011-08-12T13:45:32.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1664" PostTypeId="1" AcceptedAnswerId="1681" CreationDate="2011-08-12T15:43:36.643" Score="6" ViewCount="13193" Body="&lt;p&gt;When researching any sort of predictive model, whether using ordinary linear regression or more sophisticated methods such as neural networks or classification and regression trees, there seems to always be a temptation to add in more explanatory variables/factors.  The in-sample performance of the model always improves, and sometimes it improves a great deal, even after one has already added quite a few variables already.  When is it too much?  When is the supposed improvement in in-sample performance very unlikely to carry over into live trading?  How can you measure this (beyond simple things like the Akaike and Bayesian Information Criteria, which don't work very well in my experience anyway)?  Advice, references, and experiences would all be welcome.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-10-25T01:49:40.543" Title="How many explanatory variables is too many?" Tags="&lt;statistics&gt;&lt;quant-trading-strategies&gt;&lt;modeling&gt;&lt;prediction&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1665" PostTypeId="2" ParentId="1572" CreationDate="2011-08-12T15:56:14.640" Score="2" Body="&lt;p&gt;Posting this question to a LinkedIn discussion group solicited the following additional answers:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The underlying is relatively well understood and simple in a pricing sense.  This allows you to put a complex (exotic) payoff on top.&lt;/li&gt;&#xA;&lt;li&gt;The vast majority of FX spot volumes are spread among a small group of G-7 currencies, unlike equities or other markets where you have a myriad of different tickers.&lt;/li&gt;&#xA;&lt;li&gt;No major barriers to the market / inside information / absence of manipulators (except for Central Banks who do not have speculative missions).&lt;/li&gt;&#xA;&lt;li&gt;Pension and insurance firms are taking deposits in one currency which they invest in a different currency for carry/performance.  They only partially hedge their currency exposure using options, and sometimes exotic OTC options are designed in order to best fit their particular mix of assets and liabilities.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I do have my own question on point #2, though.  Aren't there relatively few highly liquid equity indices and fixed income futures?  Why don't we see more S&amp;amp;P 500 or US 10Y Treasury exotics?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; I actually like #4, which just came in from LinkedIn, best so far.  Basically, the real-world exposure of unsophisticated firms is complicated, and so they offload the complex hedging to a sophisticated counterparty.  This, combined with @chrisaycock's answer, completely answers the question to my satisfaction.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-08-15T15:34:23.910" LastActivityDate="2011-08-15T15:34:23.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1666" PostTypeId="2" ParentId="1572" CreationDate="2011-08-12T16:11:35.957" Score="4" Body="&lt;p&gt;As I understand it, the currency derivatives are meant for customers to hedge &lt;em&gt;actual exposure&lt;/em&gt;. A foreign distributor obviously has exchange-rate risk, but it's hard to say who actually has risk exposure to the S&amp;amp;P 500. (There's the effect of beta, of course, but it's pretty rare for someone to have tangible---not just CAPM---exposure to the S&amp;amp;P. Someone who holds the S&amp;amp;P does so intentionally.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fear not, though. There are a few OTC derivatives that are used in levered ETFs. Consider &lt;a href=&quot;http://www.direxionshares.com/holdings_tna.csv&quot; rel=&quot;nofollow&quot;&gt;3X Russell 2000&lt;/a&gt; or &lt;a href=&quot;http://www.proshares.com/funds/qld_daily_holdings.html?show=all&quot; rel=&quot;nofollow&quot;&gt;Ultra NASDAQ 100&lt;/a&gt;, both of which list index swaps among their holdings.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-08-12T16:11:35.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1667" PostTypeId="2" ParentId="1161" CreationDate="2011-08-12T17:32:55.903" Score="5" Body="&lt;p&gt;You have pretty much hit them all.  The no-arbitrage assumption itself is highly unrealistic, though.  If you want to enhance your model-free thinking about options, you will have to incorporate at least two important cases where that assumption is false:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Bid-offer spreads are not zero.&lt;/strong&gt;  This means in particular that the four model-free conditions you cite above &lt;em&gt;can&lt;/em&gt; be violated within the sum total of spreads involved.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;The borrow/lend rate.&lt;/strong&gt;  Since in practice you generally cannot receive the same rate for lending stock that you pay to borrow it, put/call parity (among other prices) will have apparent violations.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Counterparty risk can also be a significant model-free consideration.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-08-12T17:32:55.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1668" PostTypeId="2" ParentId="1632" CreationDate="2011-08-12T17:45:23.527" Score="2" Body="&lt;p&gt;Bermudan swaptions (often on interest rates) are typically valued with a model that incorporates mean-reversion parameters.  This might be as naive as Black-Karasinski, but more often is somewhat more sophisticated, for example Generalized Vasicek.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Calibrating the model involves choosing model parameters that &quot;best&quot; fit the observed bermudan swaption prices.  Since one of those parameters is a mean reversion term ($\mu$), after your fitting process you end up with a market-implied risk-neutral estimate of mean reversion rate $\mu$ &lt;em&gt;within that model&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will find that $\mu$'s magnitude will correlate highly with other measures of mean reversion (say from time series analysis), but that outside your original model framework $\mu$'s  actual level is only qualitatively valuable .&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-08-12T17:45:23.527" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1669" PostTypeId="2" ParentId="1627" CreationDate="2011-08-12T17:48:47.327" Score="0" Body="&lt;p&gt;Since currencies are explicitly part of your asset set, it does not matter in principle which choice you make (currency hedged or unhedged) for the other securities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order for you model weights to have the most intuitive meaning, you should choose unhedged if you think you will generally be neglecting to hedge the risk, and hedged otherwise.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-08-12T17:48:47.327" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1670" PostTypeId="2" ParentId="1285" CreationDate="2011-08-12T17:56:14.710" Score="2" Body="&lt;p&gt;The skew alone is not enough.  You can see this by noting the one-to-one correspondence between volatility skew and terminal probability distributions, which is independent of price and volatility dynamics.  (See my answer at &lt;a href=&quot;https://quant.stackexchange.com/questions/1621/qqplot-of-returns-from-implied-vols-as-opposed-to-historic-vols/1676#1676&quot;&gt;How to derive the implied probability distribution from B-S volatilities?&lt;/a&gt; for a derivation of that dependence)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if you choose a non-Black-Scholes model (such as the Heston model) and calibrate it, then you can use that model to compute, say, the maximum likelihood equity price given a certain level of implied volatility.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2011-08-15T15:39:47.180" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1671" PostTypeId="2" ParentId="1489" CreationDate="2011-08-12T17:58:23.613" Score="3" Body="&lt;p&gt;If you think it is too computationally intensive, you are probably not using enough numerical analytic &quot;tricks&quot;, such as control variates.  Using them, you will generally find american option pricing to be faster on trees than with the analytic approximations.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-08-12T17:58:23.613" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1672" PostTypeId="1" CreationDate="2011-08-12T19:02:14.087" Score="6" ViewCount="646" Body="&lt;p&gt;We know that $$C-P = PV(F_{0,T}-K)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When we create a synthetic forward, we buy call and sell a put at the same strike price $K$. When we buy the call why do we assume the premium is positive? When we sell the put, why do we assume the premium is negative? &lt;/p&gt;&#xA;" OwnerUserId="1211" LastEditorUserId="1106" LastEditDate="2011-09-12T14:57:22.250" LastActivityDate="2011-09-12T15:28:16.647" Title="What does put-call parity imply about option premiums?" Tags="&lt;options&gt;&lt;arbitrage&gt;&lt;soft-question&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1673" PostTypeId="2" ParentId="1672" CreationDate="2011-08-12T19:10:39.033" Score="5" Body="&lt;p&gt;Both premiums are actually always positive by definition.  The difference will be positive when the forward price exceeds the strike and vice versa.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-08-12T19:10:39.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1676" PostTypeId="2" ParentId="1621" CreationDate="2011-08-12T20:54:17.133" Score="29" Body="&lt;p&gt;You can directly imply a probability distribution from a volatility skew.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that, for any terminal probability distribution $p(S)$ at tenor $T$, we have the model-free formula for the call price $C(K)$ as a function of strike $K$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;C=e^{-rT} \int_0^\infty (S-K)^+ p(S) dS&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore we can write&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;e^{rT} \frac{\partial C}{\partial K}=\int_K^\infty (-1) \cdot p(S) dS&#xA;\end{equation}&#xA;and by the fundamental theorem of calculus&#xA;\begin{equation}&#xA;e^{rT} \frac{\partial^2 C}{\partial K^2} = p(K)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, all you need, in order to find the value of $p(x)$ for any $x$, is the second derivative of call prices at strike $x$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually, one uses a fitted skew (such as a polynomial fit) to the available volatility values at the given tenor.  In your case, with just 5 points, I would recommend fitting a parabola in log strike space.  Once you have a continuous skew $\sigma(K)$ then you just need to find&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;{\left. \frac{\partial^2 }{\partial x^2}\right|}   BS_{\text{Call}}(S_0, x, \sigma(x), r, T, q)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;evaluated at $x=K$ which can be done either with a bunch of symbol-jiggling, or by simply finite differencing.  In your case I recommend the latter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you have probability distribution values, of course, the process of generating the qq plots is one you have already mastered.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; Sign error correction, per @Robino&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2015-06-29T13:45:53.590" LastActivityDate="2015-06-29T13:45:53.590" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="1678" PostTypeId="2" ParentId="1664" CreationDate="2011-08-13T10:46:05.497" Score="4" Body="&lt;p&gt;Although not directly related to financial modeling, I've found the following quotation to be very instructive:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;I remember my friend Johnny von Neumann used to say, 'with four parameters I can fit an elephant and with five I can make him wiggle his trunk.'&quot; -- E. Fermi&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may also read this: &lt;a href=&quot;http://mahalanobis.twoday.net/stories/264091/&quot; rel=&quot;nofollow&quot;&gt;http://mahalanobis.twoday.net/stories/264091/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="493" LastActivityDate="2011-08-13T10:46:05.497" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1679" PostTypeId="1" CreationDate="2011-08-13T16:14:24.647" Score="6" ViewCount="2468" Body="&lt;p&gt;There seems to be increasing interest in risk controlled products such as volatility target indices and derivatives products on these underlyings.  From a risk management perspective what are the advantages of these products?&lt;/p&gt;&#xA;" OwnerUserId="1161" LastActivityDate="2011-08-15T15:59:09.363" Title="Why write options on a volatility target index?" Tags="&lt;risk-management&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1680" PostTypeId="2" ParentId="1664" CreationDate="2011-08-13T20:26:40.627" Score="3" Body="&lt;p&gt;There's no rule to answer this question for you.  You need some combination of:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Judgment: Are the parameters you're including reasonable?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Sniff test: Is there theory to justify your parameter choices, or are you just hunting for chance associations?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Hold-outs: You correctly mention that the problem is &quot;in sample performance.&quot; The solution is therefore to hold out some data when you start and look at out-of-sample performance.  Of course, if you iterate enough times, you can over-fit your holdout sample, too!  So save this until the last step, and be honest with yourself.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As always, the key is to be certain of what question you are trying to answer.  Then you can muster as much unbiased evidence as possible.  &lt;/p&gt;&#xA;" OwnerUserId="1184" LastEditorUserId="1106" LastEditDate="2011-10-25T01:49:40.543" LastActivityDate="2011-10-25T01:49:40.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1681" PostTypeId="2" ParentId="1664" CreationDate="2011-08-13T21:53:21.033" Score="4" Body="&lt;p&gt;&lt;a href=&quot;http://en.wikiquote.org/wiki/Albert_Einstein&quot; rel=&quot;nofollow&quot;&gt;“Make things as simple as possible, but not simpler.”&lt;/a&gt; The problem you want to avoid is (near) multicollinearity. The tip-off will be that adding/removing a regressor will significantly change the coefficients on the other regressors. In practice (well, in the research that I read) I rarely see this explicitly tested. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you think that you have multicollinearity, then it's likely best to either estimate over a subset without multicollinearity or to drop the offending regressors. A model with less explanatory power as measured by $R^2$ is certainly better than a model with incorrect (unstable) explanatory power. &lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-08-13T21:53:21.033" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="1682" PostTypeId="2" ParentId="1658" CreationDate="2011-08-13T22:19:36.507" Score="22" Body="&lt;p&gt;The lead paper in the January 2011 Journal of Finance (&lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/j.1540-6261.2010.01624.x/full&quot;&gt;Hendershott, Jones, and Menkveld&lt;/a&gt;) addresses algorithmic trading (AT). In short, they find that AT &lt;em&gt;improves&lt;/em&gt; liquidity as measured by bid-offer spreads. Taking the econometrics as correct (it is in the Journal of Finance) the next question is if bid-offer spreads are a sufficient statistic for measuring liquidity (or any other benefits).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is a difficult question to answer because, given current market structure, AT may improve liquidity (as measured by bid-offer spreads), but without data on other market structures, it is hard to say that we wouldn't better off with something like on-demand call auctions. I think there's a consensus that opening and closing call auctions have improved market quality as measured by opening and closing volatility, but it is not clear that we'd be better/worse off with completely call on-demand exchanges (although I know of at least call on-demand exchange in the works).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think at this point it's still a subjective question with smart people on both sides. I tend to think we'd be better with call auctions (in terms of the pure economics of matching supply and demand). Finally, you may find this &lt;a href=&quot;http://www.ritholtz.com/blog/2011/05/come-get-your-sausage-right-heahhhh/&quot;&gt;Big Picture post&lt;/a&gt; interesting.&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-08-13T22:19:36.507" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1683" PostTypeId="1" AcceptedAnswerId="1688" CreationDate="2011-08-14T14:53:45.710" Score="7" ViewCount="6425" Body="&lt;p&gt;I am a PhD student in stochastic analysis/control and had a MSc degree in Financial Mathematics. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am interested in determining there is a quantitative finance ranking system for universities like &lt;a href=&quot;http://en.wikipedia.org/wiki/QS_World_University_Rankings&quot;&gt;this&lt;/a&gt;. It's easy to find such a ranking for the Math Universities, though it doesn't hold for the quantitative/financial mathematics field.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does such a ranking system exist, or is there another ranking system that can be applied to universities and quantitative finance -- and if so, how?&lt;/p&gt;&#xA;" OwnerUserId="464" LastEditorUserId="226" LastEditDate="2011-08-15T08:57:13.093" LastActivityDate="2012-04-13T20:30:19.670" Title="Is there a quantitative finance ranking system for universities?" Tags="&lt;research&gt;" AnswerCount="6" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1684" PostTypeId="1" CreationDate="2011-08-15T00:12:09.147" Score="16" ViewCount="4562" Body="&lt;p&gt;I want to generate synthetic forex data for the purpose of backtesting my trading algorithms. I have some rough ideas in mind on how to do this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;Start with a curve representing a trend, then randomly generate points around the curve according to a Gaussian or some other distribution. Then take the generated points and somehow generate the bar data (open, high, low, close) around those points; alternatively, add a time factor, and then randomly determine when a tick occurs and collect the data into bars afterward.&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My question is: is this far off from the established methods for synthetic data generation? I suppose that raises the more basic question: &lt;em&gt;are&lt;/em&gt; there any established methods for synthetic data generation? I can't seem to find any writing on this subject, be it a blog post or a research paper.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in addition to a request for external resources on synthetic data generation, I'd like to know what sorts of distributions best model the relationships between open, high, low, close, or how to generate the appropriate intervals between ticks, the spread between ask and bid prices, etc.&lt;/p&gt;&#xA;" OwnerUserId="1219" LastEditorUserId="1106" LastEditDate="2011-08-16T13:30:30.730" LastActivityDate="2016-08-16T16:26:52.700" Title="How to generate synthetic FX data for backtesting?" Tags="&lt;data&gt;&lt;automated-trading&gt;&lt;backtesting&gt;&lt;statistics&gt;&lt;fx&gt;" AnswerCount="4" CommentCount="3" FavoriteCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="1685" PostTypeId="1" AcceptedAnswerId="1854" CreationDate="2011-08-15T11:37:05.877" Score="30" ViewCount="9892" Body="&lt;p&gt;In reading about the various practices and strategies of high frequency traders, one of the most mysterious to me is &quot;fleeting orders,&quot; or orders that are cancelled almost immediately after they are sent (see &lt;a href=&quot;http://ssrn.com/abstract=994369&quot;&gt;Hasbrouck and Saar (2011)&lt;/a&gt;). Why do HFTs use these orders? Some of those trying to explain the practice claim it gives HFTs an informational advantage. How? What information do they get and how do they use it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am hoping for someone with actual experience in HFT to answer and verify some of the hypotheses laid out by academics.  In particular, one hypothesis is that rapidly cancelled limit orders bring forth market orders on the other side, which are then executed at a less favorable price also placed by the HFT.  In other words, HFTs are gaming the system to exploit sub-optimal behavior by slower traders.  Is there any evidence of this &lt;em&gt;still&lt;/em&gt; occurring, now that the practice of fleeting orders is widespread and well known?  This explanation would also imply that it is relatively simple to avoid being taken advantage of, thus weakening the policy implications.  Is there some reason that slower traders prefer sending market orders only after seeing a limit order meeting their price target?&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-08-18T18:33:54.347" LastActivityDate="2013-02-25T14:57:31.227" Title="Why do high frequency traders use rapidly cancelled limit orders?" Tags="&lt;high-frequency&gt;&lt;market-making&gt;" AnswerCount="4" CommentCount="8" FavoriteCount="22" ContentLicense="CC BY-SA 3.0" />
  <row Id="1687" PostTypeId="1" AcceptedAnswerId="1696" CreationDate="2011-08-15T14:29:50.133" Score="20" ViewCount="19098" Body="&lt;p&gt;I tried a search with google but I can't find a clear definition of what a Heat Rate Option is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would appreciate if someone could explain to me what this type of option is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My understanding is that it has to do with energy options but I am not sure on the underlying.&lt;/p&gt;&#xA;" OwnerUserId="1166" LastEditorUserId="467" LastEditDate="2015-02-03T10:01:48.793" LastActivityDate="2019-08-22T19:15:10.070" Title="What is a Heat Rate Option?" Tags="&lt;options&gt;&lt;commodities&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="1688" PostTypeId="2" ParentId="1683" CreationDate="2011-08-15T14:30:53.347" Score="4" Body="&lt;p&gt;I've never heard of a ranking of post-doc programs in any academic field, but I guess the closest proxy would be a ranking of graduate schools. QuantNet has a &lt;a href=&quot;http://www.quantnet.com/mfe-programs-rankings/&quot; rel=&quot;nofollow&quot;&gt;ranking of MFE programs&lt;/a&gt; in America, which is similar to the &lt;em&gt;US News and World Report&lt;/em&gt; methodology.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-08-15T14:30:53.347" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1689" PostTypeId="2" ParentId="1684" CreationDate="2011-08-15T14:37:46.280" Score="7" Body="&lt;p&gt;For starters, I am not even sure why you need to ask this question.  There is literally years of free tick data available for FX, just check out quant.SE's &lt;a href=&quot;https://quant.stackexchange.com/q/141/1106&quot;&gt;data wiki&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Having said that, a Gaussian is a very poor fit to high-frequency data, particularly FX.  Your strategy for simulating data depends on the idea behind the simulation.  If you wish to actually estimate any parameters or test methods on this data, and you will be accepting or rejecting ideas based on the results of the simulation, I urge you to stop right there and reconsider.&lt;/p&gt;&#xA;&lt;p&gt;If, instead, you wish to model the volatility of the process and test the ability of your system to deal with changes to the parameters of the data generating process, you should consult chapter 5 and particularly page 122 of &lt;a href=&quot;http://books.google.com/books?id=dobO95EBcqsC&amp;amp;printsec=frontcover#v=onepage&amp;amp;q&amp;amp;f=false&quot; rel=&quot;noreferrer&quot;&gt;An Introduction to High Frequency Finance&lt;/a&gt;.  They write:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The distributions of returns are increasingly fat-tailed as data frequency increases (smaller interval sizes) and are hence distinctly unstable...&lt;/p&gt;&#xA;&lt;p&gt;Scaling laws describe mean absolute returns and mean squared returns as functions of their time intervals...&lt;/p&gt;&#xA;&lt;p&gt;There is evidence of seasonal heteroskedasticity in the form of distinct daily and weekly clusters of volatility...&lt;/p&gt;&#xA;&lt;p&gt;Some papers claim FX returns to be close to Paretian stable ones, for instance (McFarland et al., 1982; Westerfield, 1997); some to Student distributions that are not stable (Rogalski and Vinso, 1978; Boothe and Glassman, 1987); some reject any single distribution... Most researchers now agree that a better description of the data generating process is in the form of a conditional heteroskedastic model rather than being from an unconditional distribution.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Finally, if you wish to construct OHLC data, your best bet is to model the data generating process as above along with a tick frequency process (also discussed in the above reference) and construct OHLC bars from simulated tick data.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2011-08-15T20:28:14.597" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="1690" PostTypeId="2" ParentId="1683" CreationDate="2011-08-15T14:57:13.957" Score="3" Body="&lt;p&gt;I have no idea of the methodology, and it is not specifically quant, but here is another ranking from 2011: &lt;a href=&quot;http://rankings.ft.com/businessschoolrankings/masters-in-finance-pre-experience-2011&quot; rel=&quot;nofollow&quot;&gt;http://rankings.ft.com/businessschoolrankings/masters-in-finance-pre-experience-2011&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-08-15T14:57:13.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1691" PostTypeId="2" ParentId="1679" CreationDate="2011-08-15T15:59:09.363" Score="4" Body="&lt;p&gt;Typically these options are sold to portfolio managers to help smooth out their returns in times of trouble.  A call (or even long position) on such an index will give a little PL in precisely the sort of markets that long-biased portfolio managers often lose money in, since high volatility is empirically correlated with negative returns.  That keeps risk down, and PL smooth.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most of these customers &lt;em&gt;could&lt;/em&gt; be trading variance swaps or options on VIX instead.  They could even use stock futures index puts to get insurance they want.  These options are &quot;more precisely targeted&quot; at what they think they want to hedge, and require less frequent attention than VIX positions (though not necessarily less than a varswap).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, a hedge fund manager who says to his investors that he hedges risk with varswaps or VIX invites questions about his competence with those products, whereas one who buys protection marketed by an investment bank is presumed -- by the typical HF investor -- to have received proper guidance from his bankers on the investment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, I am sure that the options are terribly expensive trades for the customers, many of whom would be better off with trades in more liquid and transparent securities such as varswaps or (if they can spare the time) stock futures option/VIX positions.  It's cheaper, and I attribute scant value to the advice of the bankers.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-08-15T15:59:09.363" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1692" PostTypeId="2" ParentId="1684" CreationDate="2011-08-15T16:16:41.337" Score="1" Body="&lt;p&gt;The method for generating synthetic data described &lt;a href=&quot;http://www.breakoutfutures.com/Newsletters/Newsletter1205.htm&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; might be useful to you. Also I believe the &lt;a href=&quot;http://cran.r-project.org/web/packages/meboot/index.html&quot; rel=&quot;nofollow&quot;&gt;meboot&lt;/a&gt; R package can be used for synthetic time series generation. &lt;/p&gt;&#xA;" OwnerUserId="252" LastActivityDate="2011-08-15T16:16:41.337" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1693" PostTypeId="2" ParentId="1535" CreationDate="2011-08-15T17:28:18.997" Score="2" Body="&lt;p&gt;Correlation will play an indirect role.  Begin by noting that, if correlation is 100%, then your basket swap will behave the same as a swap on a single equity (from a modeling point of view).  Thus your risk-management systems and derivatives will care about the correlation.  For pure valuation of the swap, there's no role for correlation.   Valuation is basically just mark-to-market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally, equity swaps are used to trade in long-short positions that are unavailable or impractical from a regulatory point of view.  For example, you might be avoiding dividend taxes or trading foreign securities.  If you have a position that you intend to treat as a unit, comprised of a basket of securities, it makes sense to combine the whole thing into one swap to keep transaction costs low.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that basket &lt;em&gt;options&lt;/em&gt; are considered correlation plays.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-08-15T17:28:18.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1694" PostTypeId="2" ParentId="1307" CreationDate="2011-08-15T17:59:46.027" Score="7" Body="&lt;p&gt;In quantitative finance, we sometimes find ourselves choosing a new stochastic model for what market variables are random, and how.  For example, someone might decide that they like the SDE&#xA;\begin{equation}&#xA;dS = \mu\ S\  dt +  \left( \frac{S_0}{S} \right)^{\frac32} \sigma\  S\ dW&#xA;\end{equation}&#xA;because they want to capture a leverage effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, this SDE may or may not have a closed-form solution.  For example in your question,&#xA;\begin{equation}&#xA;X(t)=X(0)\ \exp{\left( σW(t)+(μ − \frac{σ^2}2)t\right)}&#xA;\end{equation}&#xA;is the solution to the Black-Scholes SDE.  On the other had, I'm not even sure if the leverage SDE above has a solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ito's Lemma is the mathematical tool we can use to prove that a potential solution to our SDE really satisfies the SDE.  So in practice, that is where it is actively used in quantitative finance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The lemma also underlies a lot of the stochastic calculus used in quantitative finance, for example the Girsanov theorem, but those uses are &quot;hidden underneath&quot; since the pure mathematics is reasonably mature by now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To chime in on the question of convergence, if you possess a &lt;em&gt;solution&lt;/em&gt; to your favorite SDE, then you can simulate terminal values $S_t$ of the process after macroscopic bits of time $t$.  That then lets you quickly simulate, say, $M$ option values at expiration time $t$ and then average to form an estimate of their expected value at computational cost $O(M)$.   If you do &lt;em&gt;not&lt;/em&gt; possess a solution, then you must generate each $S_t$ by simulating a whole path of $S$ from time 0 to time $t$ in $J$ small increments of size $\Delta t$, using your SDE itself, at computational cost $O(J \times M)$.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="70" LastEditDate="2012-11-27T14:33:13.853" LastActivityDate="2012-11-27T14:33:13.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1695" PostTypeId="2" ParentId="1627" CreationDate="2011-08-15T23:51:42.040" Score="5" Body="&lt;p&gt;Check out: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;&lt;a href=&quot;http://www.jstor.org/stable/4479236&quot; rel=&quot;noreferrer&quot;&gt;Universal hedging: Optimizing currency risk and reward in international equity portfolios&lt;/a&gt;,&quot; Fischer Black - Financial Analysts Journal, 1989.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;as well as many of the subsequent research that references this article (via Google Scholar, for instance).  Good luck.&lt;/p&gt;&#xA;" OwnerUserId="390" LastActivityDate="2011-08-15T23:51:42.040" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1696" PostTypeId="2" ParentId="1687" CreationDate="2011-08-16T15:14:52.920" Score="10" Body="&lt;p&gt;That's a complicated subject.   Unless you're on the trading desk of a power/chemical/refinery company, you probably won't find much information.   In addition, if your company doesn't have the &quot;marginal&quot; (best) equipment, such that you compete on efficiency/price, you'll only watch from the sidelines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a previous discussion:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.wilmott.com/messageview.cfm?catid=3&amp;amp;threadid=54982&quot;&gt;http://www.wilmott.com/messageview.cfm?catid=3&amp;amp;threadid=54982&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keep in mind that some plants produce electricity by simply burning coal.  Some by gas fired turbines with secondary heat recovery.   Some by other means.    And, some of those plants produce only power while others produce products (power is a sideline).   The economics of each plant is different, and those numbers change rapidly.   As a result, pricing a plant specific heat rate versus a market heat rate can be a real humbling experience.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've watched that game from the sidelines long enough to know that I don't know anything about it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit 1 ======================&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some additional links:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://nodal.ercot.com/docs/tntarc/mo/CAHeatRates.pdf&quot;&gt;http://nodal.ercot.com/docs/tntarc/mo/CAHeatRates.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.potomaceconomics.com/uploads/ercot_reports/2010_02_ERCOT_IMM_Monthly_Report.pdf&quot;&gt;http://www.potomaceconomics.com/uploads/ercot_reports/2010_02_ERCOT_IMM_Monthly_Report.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.owlnet.rice.edu/~inal/energy/ManualForEnergyEconStudent.pdf&quot;&gt;http://www.owlnet.rice.edu/~inal/energy/ManualForEnergyEconStudent.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.ferc.gov/market-oversight/mkt-electric/texas.asp&quot;&gt;http://www.ferc.gov/market-oversight/mkt-electric/texas.asp&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://math.stanford.edu/~valdo/papers/siam.pdf&quot;&gt;http://math.stanford.edu/~valdo/papers/siam.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.capitolareaenergy.com/index.php/capitol/electricity&quot;&gt;http://www.capitolareaenergy.com/index.php/capitol/electricity&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="392" LastEditorUserId="392" LastEditDate="2011-08-16T17:44:01.037" LastActivityDate="2011-08-16T17:44:01.037" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1698" PostTypeId="1" AcceptedAnswerId="1716" CreationDate="2011-08-17T13:20:33.703" Score="9" ViewCount="2740" Body="&lt;p&gt;Jason Perl's book &lt;em&gt;DeMark Indicators&lt;/em&gt; details rules for calculating signals developed by Thomas DeMark. These rules are not complex in themselves, but there is no dirth of &lt;code&gt;ifelse&lt;/code&gt; structure to incrementing a signal's progression. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example of a rule from Perl's book:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;A Bearish TD Price Flip occurs when the market records a close greater than the close four bars earlier, immediately followed by a close less than the close four bars earlier.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's possible to implement these rules in something as clumsy as Excel, but what programming language would implement it most gracefully? The control structure suggests a C/C++ approach, but I'm wondering if Haskell, R, Python or even Prolog might be better suited.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE: here is a sample of what an R implementation might look like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;S$deMark &amp;lt;- ifelse(Lag(Cl(S) &amp;lt; Lag(Cl(S), k=5)) &amp;amp; Cl(S) &amp;lt; Lag(Cl(S), k=4), 1,0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where &lt;code&gt;S&lt;/code&gt; is an xts object. &lt;/p&gt;&#xA;" OwnerUserId="291" LastEditorUserId="291" LastEditDate="2011-08-17T15:28:57.270" LastActivityDate="2011-08-23T12:30:27.643" Title="What programming language is best suited for implementing DeMark?" Tags="&lt;programming&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="1699" PostTypeId="2" ParentId="1698" CreationDate="2011-08-17T14:38:19.677" Score="1" Body="&lt;p&gt;Given the relative simplicity of these rules (and that your alternative appears to be Excel), I would recommend any procedural programming language, and preferably one with statistical routines built in.  Examples include R and Python with various extensions such as NumPy or SciPy (add as needed), as well as Matlab/Octave or any other statistical programming language.  Object-oriented languages will probably require you to write many more lines of code than necessary for this relatively simple task.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, at the end of the day, go with what you know.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-08-17T14:38:19.677" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1700" PostTypeId="1" AcceptedAnswerId="1703" CreationDate="2011-08-17T15:48:22.247" Score="9" ViewCount="429" Body="&lt;p&gt;Competing academic studies, such as Asness's &lt;a href=&quot;http://ssrn.com/abstract=381480&quot;&gt;Fight the Fed Model&lt;/a&gt; and Lee, Myers, and Swaminathan's &lt;a href=&quot;http://ssrn.com/abstract=376&quot;&gt;What is the Intrinsic Value of the Dow&lt;/a&gt;, offer differing answers to the question of whether equity valuation measures (such as P/E in the case of Asness, &lt;a href=&quot;http://en.wikipedia.org/wiki/Dividend_Discount_Model&quot;&gt;DDM&lt;/a&gt; in the case of Lee et. al.) can be used to predict the direction of overall equity markets.  These are just two seminal studies in the field of market timing, which is itself a part of the broader Tactical Asset Allocation literature.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to know if there are any academic studies (the more recent the better) which use more than one valuation measure/model to try to predict equity market returns, either in absolute terms or relative to fixed income.  It would also be interesting if these studies look into what kinds of models may be combined with valuation, such as momentum (see Faber's &lt;a href=&quot;http://ssrn.com/abstract=962461&quot;&gt;A Quantitative Approach to Tactical Asset Allocation&lt;/a&gt;), in order to yield the best results.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-08-17T21:25:42.470" Title="Which valuation measures are most useful for equity market timing?" Tags="&lt;equities&gt;&lt;research&gt;&lt;valuation&gt;&lt;tactical-asset-allocation&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="1701" PostTypeId="5" CreationDate="2011-08-17T15:50:16.517" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2011-08-17T15:50:16.517" LastActivityDate="2011-08-17T15:50:16.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1702" PostTypeId="4" CreationDate="2011-08-17T15:50:16.517" Score="0" Body="For questions citing or requesting references to academic and/or professional research." OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-08-17T19:18:34.640" LastActivityDate="2011-08-17T19:18:34.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1703" PostTypeId="2" ParentId="1700" CreationDate="2011-08-17T17:24:57.820" Score="4" Body="&lt;p&gt;Take a look at Campbell's 2008 &lt;a href=&quot;http://www.google.com/url?sa=t&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CBYQFjAA&amp;amp;url=http://www.princeton.edu/bcf/newsevents/events/lectures-in-finance/campbellthompson_rfs2008.pdf&amp;amp;ei=g_dLTrOdJsfZgQfxppRz&amp;amp;usg=AFQjCNGwkSjp_OUTQ_hUOy_PMa1L7-f_3w&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; &quot;Predicting Excess Stock Returns out of Sample&quot;. This paper is in response to Goyal &amp;amp; Welch's &lt;a href=&quot;http://faculty.chicagobooth.edu/john.cochrane/teaching/Empirical_Asset_Pricing/Goyal_Welch.pdf&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; which argued that excess returns cannot be predicted out of sample. Also see Baekart and Ang's &lt;a href=&quot;http://www.google.com/url?sa=t&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CCEQFjAA&amp;amp;url=http://www0.gsb.columbia.edu/faculty/gbekaert/stockreturn.pdf&amp;amp;ei=2PdLTpWrCM3PgAed3ZRz&amp;amp;usg=AFQjCNF70EFrMMEx37MeVTYYtewPCyNrwA&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; &quot;Stock Return Predictability: Is it there?&quot;. A good theoretical framework that ties stock return predictability to variables most likely to predict returns is Cochrane's 2008 &lt;a href=&quot;http://www.google.com/url?sa=t&amp;amp;source=web&amp;amp;cd=2&amp;amp;sqi=2&amp;amp;ved=0CCkQFjAB&amp;amp;url=http://faculty.chicagobooth.edu/john.cochrane/research/papers/cochrane%2520dog%2520that%2520did%2520not%2520bark.pdf&amp;amp;ei=tPhLTufPN4bAtgfX9o23Cg&amp;amp;usg=AFQjCNFVwSgmJ8P5IdEnivKSyjVmtX0CVg&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; &quot;The Dog that did not bark: A defense of return predictability&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can identify more recent citations of these papers on Google Scholar for the latest research. However, I would suggest starting here since the key variables, tests, and theory are laid out by the more highly regarded academics.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-08-17T21:25:42.470" LastActivityDate="2011-08-17T21:25:42.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1704" PostTypeId="2" ParentId="1020" CreationDate="2011-08-17T18:16:42.713" Score="4" Body="&lt;p&gt;Regarding the second part of your question - You are running into the classic N&gt;T problem (N=# assets; T=# of observations). Therefore the number of parameters you must estimate grows geometrically with each N, but only arithmetically for each day of observation. Because you are estimating the diagonal portion of the covariance matrix you must estimate N*(N+1)/2 entries with only T observations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A better approach would involve a shrinkage estimator where you assume constant correlation or constant covariance across securities. The out-of-sample performance of this approach is strong. Consider blending a covariance matrix between the diagonal and sample covariance matrix - See Ledoit and Wolf's &lt;a href=&quot;http://www.google.com/url?sa=t&amp;amp;source=web&amp;amp;cd=2&amp;amp;ved=0CCcQFjAB&amp;amp;url=http://www.ledoit.net/honey.pdf&amp;amp;ei=4ANMToy5BMfogQfSo_ly&amp;amp;usg=AFQjCNHfL9Xy38qWLTs_9ClJTzpxHRnkHw&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt;: &quot;Honey I shrunk the covariance matrix&quot;.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2011-08-17T18:16:42.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1705" PostTypeId="2" ParentId="1684" CreationDate="2011-08-17T18:53:26.280" Score="0" Body="&lt;p&gt;You could start with some representative data (i.e. historical data for the period of interest) and then use &lt;a href=&quot;http://en.wikipedia.org/wiki/Bootstrapping_%28statistics%29&quot; rel=&quot;nofollow&quot;&gt;bootstrapping&lt;/a&gt; to estimate the true distribution of that data. From there, you can use that distribution to generate representative data.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;In &lt;a href=&quot;http://www.ats.ucla.edu/stat/r/library/bootstrap.htm&quot; rel=&quot;nofollow&quot;&gt;R&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;In &lt;a href=&quot;http://data-sorcery.org/2009/07/04/bootstrapping/&quot; rel=&quot;nofollow&quot;&gt;Incanter&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="80" LastActivityDate="2011-08-17T18:53:26.280" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1706" PostTypeId="1" AcceptedAnswerId="1709" CreationDate="2011-08-17T22:56:20.770" Score="10" ViewCount="1805" Body="&lt;p&gt;You need quantmod &amp;amp; tseries in R to run this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quantmod)&#xA;library(tseries)&#xA;&#xA;pairs &amp;lt;- c(&#xA;    &quot;EUR/USD&quot;,&#xA;    &quot;GBP/USD&quot;,&#xA;    &quot;AUD/USD&quot;,&#xA;    &quot;USD/CAD&quot;,&#xA;    &quot;USD/CHF&quot;,&#xA;    &quot;NZD/USD&quot;&#xA;    )&#xA;&#xA;name &amp;lt;- function(n) {&#xA;    gsub(&quot;/&quot;,&quot;&quot;,n,fixed=TRUE)&#xA;}&#xA;&#xA;getFrame &amp;lt;- function(p) {&#xA;    result &amp;lt;- NULL&#xA;    as.data.frame(lapply(p, function(x) {&#xA;        if(!exists(name(x))) {&#xA;            getSymbols(x, src=&quot;oanda&quot;) &#xA;        }&#xA;        if(is.null(result)) {&#xA;            result &amp;lt;- get(name(x))&#xA;        } else {&#xA;            result &amp;lt;- merge(result, get(name(x))) &#xA;        }&#xA;    }))&#xA;}&#xA;&#xA;isStationary &amp;lt;- function(frame) {&#xA;    model &amp;lt;- lm(frame[,1] ~ as.matrix(frame[,-1]) + 0)&#xA;    spread &amp;lt;- frame[,1] - rowSums(coef(model) * frame[, -1])&#xA;    results &amp;lt;- adf.test(spread, alternative=&quot;stationary&quot;, k=10)&#xA;    if(results$p.value &amp;lt; 0.05) {&#xA;			coefficients &amp;lt;- coef(model)&#xA;			names(coefficients) &amp;lt;- gsub(&quot;as.matrix.frame.......&quot;, &quot;&quot;, names(coefficients))&#xA;			plot(spread[1:100], type = &quot;b&quot;)&#xA;			cat(&quot;Minimum spread: &quot;, min(spread), &quot;\n&quot;)&#xA;			cat(&quot;Maximum spread: &quot;, max(spread), &quot;\n&quot;)&#xA;			cat(&quot;P-Value: &quot;, results$p.value, &quot;\n&quot;)&#xA;        cat(&quot;Coeficients: \n&quot;)&#xA;        print(coefficients)&#xA;    }&#xA;}&#xA;&#xA;frame &amp;lt;- getFrame(pairs)&#xA;isStationary(frame)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get FX daily data from Oanda, do a simple linear regression to find the hedging ratios, and then use the Augmented DF test to test for the P-value of mean reversion in the spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I run it I get this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Minimum spread:  -1.894506 &#xA;Maximum spread:  2.176735 &#xA;P-Value:  0.03781909 &#xA;Coeficients: &#xA;        GBP.USD     AUD.USD     USD.CAD     USD.CHF     NZD.USD &#xA; 0.59862816  0.48810239 -0.12900886  0.04337268  0.02713479&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;EUR.USD coefficient is 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I plot the spread the first 100 days look like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/l4wwc.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Surely something must be wrong. The holy grail shouldn't be so easy to find.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone help me find what is wrong?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried backtesting on Dukascopy with the above coefficients as lot sizes of a basket, but I run into loses. And the spread has a different order of magnitude in dukascopy. Why is that?&lt;/p&gt;&#xA;" OwnerUserId="1231" LastEditorUserId="35" LastEditDate="2011-08-18T02:40:04.423" LastActivityDate="2011-08-19T11:43:57.103" Title="Why does this Co-integrated basket look too good to be true?" Tags="&lt;fx&gt;&lt;cointegration&gt;&lt;stationarity&gt;&lt;basket&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1707" PostTypeId="1" CreationDate="2011-08-18T00:41:00.997" Score="17" ViewCount="5684" Body="&lt;p&gt;I have a trading system that chooses top 10 stocks in Nasdaq 100 ranked on relative strength and some other factors.  However, I'd like to take positions in only 5 of these 10 stocks based on how minimally correlated these are to others for diversification effect.  How do I resolve this? I do have the correlation/covariance matrices computed.  Literature seems to indicate applying weights to reduce correlations but I felt there should be a simpler solution.  That said, the stocks doesn't need to be equally weighted if it is easier to compute these weights. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A computationally easier solution is preferred even if it is not completely accurate since I need to implement this in Amibroker trading software.&lt;/p&gt;&#xA;" OwnerUserId="1232" LastEditorUserId="1106" LastEditDate="2011-08-18T11:44:11.573" LastActivityDate="2014-06-09T06:47:12.437" Title="How do I find the most diversified portfolio, or least correlated subset, of stocks?" Tags="&lt;trading&gt;&lt;correlation&gt;&lt;portfolio&gt;&lt;diversification&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="1708" PostTypeId="2" ParentId="1707" CreationDate="2011-08-18T03:58:59.750" Score="15" Body="&lt;p&gt;One simple method, based on the principles of mean-variance optimization, is to set the weights proportional to the product of the inverse of the covariance matrix and a vector of standard deviations. This implicitly assumes that the normalized expected return of each stock is equal. If you wish, you can take only the top 5 weights and set the others to zero. The actual problem you face, of selecting just 5 stocks, can be solved rigorously with an optimizer, but since it is not a quadratic program, may be difficult to solve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A more sophisticated but very interesting additional possibility is to find the &quot;Maximum Diversification Portfolio (MDP)&quot;, as defined in &lt;a href=&quot;http://www.iijournals.com/doi/abs/10.3905/JPM.2008.35.1.40&quot; rel=&quot;nofollow&quot;&gt;Toward Maximum Diversification&lt;/a&gt; (&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1895459&quot; rel=&quot;nofollow&quot;&gt;free version&lt;/a&gt;, hat tip vonjd).  The MDP is defined as the portfolio that maximizes the Diversification Ratio (DR), which in turn is defined as the ratio of the portfolio’s weighted average volatility to its overall volatility.  A follow-up &lt;a href=&quot;http://ssrn.com/abstract=1895459&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; investigates the properties of this portfolio.  From the paper:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This measure [DR] embodies the very nature of diversification whereby the volatility of a long-only portfolio of assets is less than or equal to the weighted sum of the assets' volatilities.  As such, the DR of a long-only portfolio is greater than or equal to one, and equals unity for a single asset portfolio.  Consider for example an equal-weighted portfolio of two independent assets with the same volatility: its DR is equal to $\sqrt{2}$, and to $\sqrt{N}$ for $N$ independent assets.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;$DR(\bf{w})=\frac {\sum_i{\it{w}_i\sigma_i}} {\sigma(\bf{w})}$&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2012-05-29T15:13:39.303" LastActivityDate="2012-05-29T15:13:39.303" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1709" PostTypeId="2" ParentId="1706" CreationDate="2011-08-18T06:27:34.950" Score="9" Body="&lt;p&gt;The main problem in your code is this line: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;rowSums(coef(model) * frame[, -1])&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure exactly what is does, perhaps some matrix multiplication, but definitely not what you expect it to do. Try to replace it with manual multiplication&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;spread &amp;lt;- frame[,1] - (coef(model)[1]*frame[,2] + coef(model)[2]*frame[,3] + coef(model)[3]*frame[,4] + coef(model)[4]*frame[,5] + coef(model)[5]*frame[,6])&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And holy grail will disappear &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Pracr.png&quot; alt=&quot;no more holy grail&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can see a couple of other errors as well:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You cant sell on ASK price. With getSymbols.oanda you always get ASK&lt;/li&gt;&#xA;&lt;li&gt;You'd better separate testing and training data sets&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1234" LastEditorUserId="1234" LastEditDate="2011-08-18T08:05:31.743" LastActivityDate="2011-08-18T08:05:31.743" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1710" PostTypeId="1" AcceptedAnswerId="1719" CreationDate="2011-08-18T08:24:50.060" Score="24" ViewCount="7785" Body="&lt;p&gt;There is much speculation to what degree financial series are random (and what kind of randomness prevails).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to turn the question on its head and ask:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Is there a mathematical proof that whatever trading strategy you use you cannot beat a random walk (that is the expected value will always be 0 assuming no drift)?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I found this &lt;a href=&quot;http://intelligenttradingtech.blogspot.com/2011/03/can-one-beat-random-walk-impossible-you.html&quot;&gt;blog post&lt;/a&gt; where the author used the so called &quot;75% rule&quot; to purportedly beat a random walk but I think he got the distinction between prices and returns wrong. This method would only work if you had a range of allowed prices (e.g. a mean reverting series). See e.g. &lt;a href=&quot;http://arxiv.org/PS_cache/cond-mat/pdf/0001/0001324v1.pdf&quot;&gt;here&lt;/a&gt; for a discussion.)&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2015-12-12T21:28:28.097" Title="Proof that you cannot beat a random walk" Tags="&lt;quant-trading-strategies&gt;&lt;random-walk&gt;" AnswerCount="5" CommentCount="3" FavoriteCount="18" ContentLicense="CC BY-SA 3.0" />
  <row Id="1711" PostTypeId="2" ParentId="1710" CreationDate="2011-08-18T10:20:15.447" Score="7" Body="&lt;p&gt;If the price of every asset follows an independent random walk without drift then every position has an expected return of zero. So, in expectation, there is no combination of positions that has an expectation different from zero.&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="1106" LastEditDate="2011-08-19T14:00:02.587" LastActivityDate="2011-08-19T14:00:02.587" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="1712" PostTypeId="2" ParentId="1636" CreationDate="2011-08-18T14:38:34.653" Score="1" Body="&lt;p&gt;Take a basket of &quot;similar&quot; interest rates from the &lt;a href=&quot;http://www.federalreserve.gov/releases/h15/data.htm&quot; rel=&quot;nofollow&quot;&gt;Fed's H.15 data page&lt;/a&gt; which have sufficient (at least a few years) data both before and after the 1997 discontinuation date.  Run a regression of the old CP rate on those variables, derive a fitted CP rate, extrapolate the fitted CP rate past 1997, then regress the fitted CP rate on the two new CP rates.  Use the coefficients from this regression, perhaps excluding the constant and perhaps normalizing the coefficients to be weights that sum to 1.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-08-18T14:38:34.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1713" PostTypeId="2" ParentId="1710" CreationDate="2011-08-18T15:25:09.793" Score="4" Body="&lt;p&gt;That post has been up since March.    Either he hasn't figured it out, or he's trying to get people to click through to the book.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the following statement, isn't he implying that &quot;rw&quot; is a return (as in....random walk)?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;rw &amp;lt;- rnorm(100)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the following statements, isn't he calling a &quot;trade&quot; the DIFFERENCE IN RETURNS?    Isn't that meaningless?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if(rw[i] &amp;lt; m) trade[i] &amp;lt;- (rw[i+1]-rw[i])&#xA;if(rw[i] &amp;gt; m) trade[i] &amp;lt;- (rw[i]-rw[i+1])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From there on, isn't the whole thing a waste of time?   Likewise, when I opened that .pdf file, the first thing I saw was Sornette's name.   There's no need to read further.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as &quot;proofs&quot; go, how are you going to agree on the properties of the market?  If you can't, then the idea of a &quot;proof&quot; goes poof.&lt;/p&gt;&#xA;" OwnerUserId="392" LastActivityDate="2011-08-18T15:25:09.793" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1714" PostTypeId="2" ParentId="1710" CreationDate="2011-08-18T20:58:56.743" Score="2" Body="&lt;p&gt;I think you mean to say any &lt;em&gt;self-financing&lt;/em&gt; trading strategy would give you zero returns - which it will - the principle of no-arbitrage ensures that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, say you have a stock whose returns follow a random walk pattern with expected return equal to zero. The only way this can happen is (a) the stock stays fixed at a value K or (b) the stock has an equal probability of being +x% or -x% tomorrow or (c) the stock can go +x% with probability p1 and -y% with probability p2 with p1*x + p2*y = 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, for all of these cases, I can have an options-based long straddle centered around K. With non-zero volatility (stochastic as well as determinate), it is &lt;em&gt;far&lt;/em&gt; more likely that my straddle will earn me a positive return than not. The down-side is - other traders also realize this fact and so I can't have that straddle for free (and thus earning a clean expected non-zero return).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it is &lt;em&gt;not&lt;/em&gt; the iid process by itself which is non-exploitable (sure it is, as in the strategy above if arbitrage exists or, even simpler, in the case of a &quot;buy-low, sell-high&quot; strategy which can earn a positive return from an iid). The &quot;mathematical structure&quot;which can be exploited is known as the process volatility. It is no-arbitrage which disallows an iid process from being exploited for returns in excess of those commensurate with its volatility - not any property of the process itself.&lt;/p&gt;&#xA;" OwnerUserId="1151" LastActivityDate="2011-08-18T20:58:56.743" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1715" PostTypeId="2" ParentId="1706" CreationDate="2011-08-19T11:43:57.103" Score="3" Body="&lt;p&gt;@Sergey correctly identified the problem.  The explanation is that &lt;code&gt;coef(model)&lt;/code&gt; is a vector, &lt;code&gt;frame&lt;/code&gt; is a data.frame, and element-by-element multiplication takes place in column-major order.  The shorter vector (&lt;code&gt;coef(model)&lt;/code&gt;) is recycled along the longer vector (each column in &lt;code&gt;frame&lt;/code&gt;).  For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;frame &amp;lt;- data.frame(V1=1:5)&#xA;frame$V2 &amp;lt;- 2&#xA;frame$V3 &amp;lt;- 5&#xA;coef.model &amp;lt;- 1:3&#xA;frame * coef.model&#xA;#   V1 V2 V3&#xA;# 1  1  6 10&#xA;# 2  4  2 15&#xA;# 3  9  4  5&#xA;# 4  4  6 10&#xA;# 5 10  2 15&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What you intended was something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sweep(frame,2,coef.model,&quot;*&quot;)&#xA;#   V1 V2 V3&#xA;# 1  1  4 15&#xA;# 2  2  4 15&#xA;# 3  3  4 15&#xA;# 4  4  4 15&#xA;# 5  5  4 15&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="56" LastActivityDate="2011-08-19T11:43:57.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1716" PostTypeId="2" ParentId="1698" CreationDate="2011-08-19T12:30:05.340" Score="7" Body="&lt;p&gt;Any kind of language would work. I suppose that if you really want it to be 'prettier than most', go with a language such as OCaml or F#. Pattern-matching will let you make code more readable than having lots of &lt;code&gt;if&lt;/code&gt; statements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the example you give, instead of treating &lt;code&gt;S&lt;/code&gt; as monolithic, I'm going to treat it as a &lt;code&gt;List&lt;/code&gt; of values. That being the case, your problem is solved with something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;let rec deMark S =&#xA;  match S with&#xA;  | a, b, _, _, now when now &amp;lt; Cl(a) &amp;amp;&amp;amp; now &amp;lt; Cl(b) -&amp;gt; 1&#xA;  | h :: t -&amp;gt; deMark t&#xA;  | _ -&amp;gt; 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Something like that. The moral of the story is that instead of backtracking the list, which is what I assume &lt;code&gt;Lag&lt;/code&gt; is doing (I don't know R), you pattern-match the list 5 elements at a time.&lt;/p&gt;&#xA;" OwnerUserId="1217" LastEditorUserId="1217" LastEditDate="2011-08-23T12:30:27.643" LastActivityDate="2011-08-23T12:30:27.643" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="1717" PostTypeId="1" CreationDate="2011-08-19T14:57:37.670" Score="5" ViewCount="1876" Body="&lt;p&gt;It is well known that vanilla fixed for floating swaps usually have a bit of gamma, but does a floating for floating (basis) swap have any? For the sake of simplicity, let's assume that both legs of the swaps are in the same currency.&lt;/p&gt;&#xA;" OwnerUserId="690" LastEditorUserId="1106" LastEditDate="2011-08-19T15:12:31.393" LastActivityDate="2016-03-16T13:51:57.053" Title="Is there any gamma in basis (i.e., floating for floating) interest rates swaps?" Tags="&lt;interest-rates&gt;&lt;swaps&gt;&lt;greeks&gt;&lt;derivatives&gt;&lt;gamma&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1718" PostTypeId="2" ParentId="1717" CreationDate="2011-08-19T19:02:00.133" Score="1" Body="&lt;p&gt;Yes, if the two rates belong to two different currencies having different yield curves.&#xA;Or in fact any two indices (bases) having different yield curves. e.g OIS vs LIBOR or LIBOR vs UST etc.&lt;/p&gt;&#xA;" OwnerUserId="1151" LastActivityDate="2011-08-19T19:02:00.133" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1719" PostTypeId="2" ParentId="1710" CreationDate="2011-08-19T21:47:02.527" Score="25" Body="&lt;p&gt;I can help you beat random walk 'in the way you want', i.e. the expected value $E[\$]$ will always be positive even assuming no drift. However, I have to warn people that $E[\$] &gt; 0$ is NOT really an adequate condition for 'beating' in reality (at least to myself). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's define some mathematical notations for derivation, and rephrase (simplify) vonjd's question without losing generality. Assume a trader plays a fair game, and his surplus $X(0), X(1), X(2), ... X(t)$ is a martingale. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q: Can the trader find a stopping time $s$ such that $E[X($s$)] &gt; X(0)$?&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;A proof supporting Bootvis' answer, for comparison, consider a normal trading strategy that bets evenly. Then, &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align*}E[X(s)] &amp;amp;= E[ E[X(s)|X(s-1), X(s-2),..., X(0)] ] \\&#xD;&#xA;&amp;amp;= E[X(s-1)] = E[X(s-2)] = ... = E[X(0)] = X(0).\end{align*}$$ &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Now, consider a 'double-betting' strategy. &lt;em&gt;We keep doubling your losing trade until first win&lt;/em&gt;. Let's set the initial surplus, $X(0) = 0$ for simplicity. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Accordingly, $X(k) = X(k-1) + G(k)$, where $G(k)=\pm 2^{k}$ with probability $1/2$. Note that we get the power $(k)$ of $2$ in $G(k)$ because of 'double-betting'. Our market is still random walk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This strategy is designed stop at a time $s = min{k}$ s.t. $G(k) &amp;gt; 0$ (Note that $Prob{s=infinity} = 0$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Compute $E[X(s)]$ by conditioning on s: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align*}&#xD;&#xA;E[X(s)] &amp;amp;= E[E[X(s)|s]] = \sum_{k=1}^{\infty} E[X(s)|s=k] * Prob{s=k} \\&#xD;&#xA;&amp;amp;= \sum_{k=1}^{...} (-1-2-4-8...-2^{(k-1)} + 2^{k}) * (1/2)^{k} \\&#xD;&#xA;&amp;amp;= \sum_{k=1}^{...} 1 * (1/2)^k = 1 &amp;gt; 0 = X(0)\end{align*}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A trader can make $E[X(s)]&amp;gt;0$ for random walk using the double-betting strategy. We proved that you can beat random walk in your definition of 'beating', i.e. expected value &gt; 0. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is actually a simplified proof supporting Akshay's answer. Whatever it's called: volatility pumping, Kelly strategy, optimal growth portfolio, and etc. These ideas simply ask one more question: why double? Is there an optimal betting ratio because of ... (various reasons and assumptions)? &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;WARNING: Yes, the expected value is indeed positive, and it might be an adequate proof for people who believe winning strategy is all about searching for $E[X(s)]&amp;gt;0$. Unfortunately, this is NOT adequate in reality, at least to myself. You have been warned. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A $E[X(s)]&amp;gt;0$ strategy is guaranteed to make you real fortune if and only if we have 'unlimited amount of capital'. For details (long story), see wiki: &lt;a href=&quot;http://en.wikipedia.org/wiki/Martingale_%28betting_system%29&quot;&gt;Martingale betting system&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You might ask what should we do if we only have limited capital? The Kelly criteria actually kind of offers the effect of the double-betting strategy for limited capital. For example, if you have a very weak trading signal (close to random walk in which there is no signal at all), the Kelly criteria will recommend you to bet something like \$1 (initially) for \$1M capital, and increase/decrease your position by certain % when you lose/win. Yeah, \$1M indeed looks like unlimited capital to \$1. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;(From comment) There is no contradiction to the common sense that 'pure independence = zero E[PnL]'. $E[] &amp;gt; 0$ in my example and vonjd'd Parrondo's paradox are indeed exploited from sort of dependency. While the Parrondo's paradox exploits the dependency between two losing games, mine is exploiting the dependency from my losing trades (which is less obvious). But warn again: This is at the cost of ruin risk! Though Kelly and vol-pump strategies eliminate ruin risk, they still suffer from trending risk. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1089" LastEditorUserId="956" LastEditDate="2012-02-27T04:43:15.947" LastActivityDate="2012-02-27T04:43:15.947" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1720" PostTypeId="2" ParentId="516" CreationDate="2011-08-20T12:28:45.320" Score="4" Body="&lt;p&gt;The question is somewhat vague (lacking a well-defined objective), so this advice may not apply.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Be mindful that you may be simultaneously considering multiple futures contracts that contain overlapping underlying constituents (e.g. futures that track the EuroStoxx 600 and DAX).  If you are using a risk model, the idiosyncratic risk may not, in fact, be uncorrelated across constituents.  This phenomenon is true for other 'composite' assets, such as ETFs, as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dan diBartolomeo, of Northfield, motivates this concept clearly in his 1998 paper:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;&lt;a href=&quot;http://www.northinfo.com/documents/58.pdf&quot; rel=&quot;nofollow&quot;&gt;Optimization with Composite Assets Using Implied Covariance Matrices&lt;/a&gt;&quot;&lt;/p&gt;&#xA;" OwnerUserId="390" LastActivityDate="2011-08-20T12:28:45.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1721" PostTypeId="2" ParentId="1698" CreationDate="2011-08-20T16:11:10.237" Score="3" Body="&lt;p&gt;For financial analysis I use Amibroker. It uses a &quot;C&quot; like syntax for implementing custom indicators. A brief article on some of DeMark's indicators and Amibroker source code can be found &lt;a href=&quot;http://www.amibroker.com/newsletter/02-2000.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1239" LastActivityDate="2011-08-20T16:11:10.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1722" PostTypeId="2" ParentId="527" CreationDate="2011-08-20T20:16:54.373" Score="4" Body="&lt;p&gt;I consider market risk, credit risk and &lt;strong&gt;operational risk&lt;/strong&gt; to be the three major forms of financial risk exposure. @jeebs addressed the trade settlement component of operational risk. I would also include the third bullet point that @shane gave in his answer as belonging to the category of operational risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another form of non-financial risk would be &lt;strong&gt;political risk&lt;/strong&gt;, if one is trading in securities that are sourced from a single country e.g. commodities, or traded on a foreign exchange which may become unstable due to political turbulence. Contingency plans would be to trade the same commodity, but perhaps the futures or options on that commodity, or trade the same commodity if listed on other exchanges. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Political risk can also be mitigated by investing in similar but not quite as high yielding securities. For example, if one wanted to invest in developing nations sovereign debt in the past, but have the transaction denominated in a major currency, there were Brady Bonds, which were $US denominated. The same is still true if one is willing to relinquish some return, by buying large corporation bonds from say, Mexico, but denominated in Canadian or US dollars, rather than Peso's.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, there is &lt;strong&gt;liquidity risk&lt;/strong&gt;. If a market is not deep enough, with enough daily (or weekly) transactions, one can get stuck in a position. This can happen in any market, any security type, any where.&lt;/p&gt;&#xA;" OwnerUserId="999" LastActivityDate="2011-08-20T20:16:54.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1723" PostTypeId="1" AcceptedAnswerId="1724" CreationDate="2011-08-21T03:36:26.520" Score="16" ViewCount="1953" Body="&lt;p&gt;I'm just starting to work with QuantLib and wonder if I'm going down a very wrong path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm working on a site that presents the visitor with a table of streamed real-time options data, including Theoretical Value calculated by the stream provider. The visitor, as I envision it, is a normal-type casual retail customer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yesterday I'm thinking: Hey! Wouldn't it be nice to give the guy access to QuantLib so he can select one of the three (as it seems to me at the moment) option-pricing engines that QuantLib offers? I'm excited! I want to put just as much function as I can into an app. I love this!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Today I installed QuantLib on my win32 machine and started to look around. Come to find out (should be no surprise, I guess) that the three pricing engines deliver prices that differ by only miniscule amounts -- tenths or hundredths of pennies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't believe that the visitor I have in mind cares about nickels and dimes per contract. Maybe the value that QuantLib delivers just does not justify its weight in server-side computation time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it worth my while to integrate QuantLib on my server (a huge PITA)? Or should I just forget about it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="618" LastEditorUserId="618" LastEditDate="2011-08-23T19:07:11.797" LastActivityDate="2011-08-23T19:07:11.797" Title="Is QuantLib more trouble than it's worth?" Tags="&lt;options&gt;&lt;quantlib&gt;&lt;pricing&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1724" PostTypeId="2" ParentId="1723" CreationDate="2011-08-21T04:29:38.600" Score="6" Body="&lt;p&gt;Numerical methods are only &lt;strong&gt;approximations&lt;/strong&gt;. So binomial trees, Monte Carlo simulations, and finite difference methods should all produce different numbers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for whether you should install it for your customers, that can only be answered by what you think your customers want. Do retail customers really want the potential confusion? Are they going to understand the implications of numerical approximations? What kind of visitors do you want anyway?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is more of a marketing exercise than anything else. Consider what kind of users you want before building your product.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-08-21T04:29:38.600" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1725" PostTypeId="1" AcceptedAnswerId="1732" CreationDate="2011-08-21T06:08:13.480" Score="17" ViewCount="3695" Body="&lt;p&gt;I am looking for references on the architecture of automated trading systems and the trading algorithms behind them.  I am more interested in system development than analysis.  A couple of books I found are &lt;a href=&quot;http://books.google.com/books/about/Building_automated_trading_systems.html?id=zQLpvF_xRw0C&quot; rel=&quot;noreferrer&quot;&gt;Building Automated Trading Systems&lt;/a&gt; by van Vliet and &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470284889&quot; rel=&quot;noreferrer&quot;&gt;Quantitative Trading&lt;/a&gt; by Chan. Any other tips or references on this matter would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="1170" LastEditorUserId="2299" LastEditDate="2012-04-18T01:58:18.513" LastActivityDate="2013-10-28T21:34:19.327" Title="References for developing an automated trading system?" Tags="&lt;automated-trading&gt;&lt;research&gt;&lt;trading-systems&gt;&lt;market-microstructure&gt;&lt;development&gt;" AnswerCount="6" CommentCount="7" FavoriteCount="29" ContentLicense="CC BY-SA 3.0" />
  <row Id="1727" PostTypeId="1" CreationDate="2011-08-21T14:53:33.250" Score="4" ViewCount="744" Body="&lt;p&gt;I am a postgrad student doing a master in Signal Processing and I have graduated from an engineering school&#xA;I was wondering if there are any jobs in finance that are opened to people having this kind of background? I don't know much about finance but I've seen the words &quot;algorithmic trading&quot; or &quot;HF trading&quot; thrown around a few times and I'm wondering if it's not something that is related to signal processing? Or would I need to have a more specific degree?&#xA;thanks&lt;/p&gt;&#xA;" OwnerUserId="1242" LastActivityDate="2011-08-21T14:53:33.250" Title="signal processing + finance?" Tags="&lt;finance&gt;&lt;career&gt;&lt;general&gt;&lt;algorithm&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ClosedDate="2011-08-22T13:29:38.277" ContentLicense="CC BY-SA 3.0" />
  <row Id="1729" PostTypeId="2" ParentId="348" CreationDate="2011-08-22T07:51:38.003" Score="4" Body="&lt;p&gt;In fact there is an exhaustive paper on this issue available now: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.frankfurt-school.de/dms/publications-cqf/CPQF_Arbeits29.pdf&quot; rel=&quot;nofollow&quot;&gt;&quot;The Trend is not Your Friend! Why Empirical Timing Success is Determined by the Underlying’s Price Characteristics and Market Efficiency is Irrelevant&quot;&lt;/a&gt;&#xA;&lt;br&gt;by Peter Scholz and Ursula Walther, Frankfurt School Working Paper, CPQF No. 29, 2011&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fascinating read - highly recommended!&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-08-22T07:51:38.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1730" PostTypeId="2" ParentId="1725" CreationDate="2011-08-22T08:31:12.680" Score="7" Body="&lt;p&gt;&lt;a href=&quot;http://dspace.mit.edu/handle/1721.1/55249&quot;&gt;DSpace@MIT - High frequency trading system design and process management (non-printable)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This &lt;strong&gt;thesis&lt;/strong&gt; provides a detailed study composed of high frequency trading system design, system modeling and principles, and processes management for system development. Particular emphasis is given to backtesting and optimization, which are considered the most important parts in building a trading system. This &lt;strong&gt;research&lt;/strong&gt; builds system engineering models that guide the development process. It also uses experimental trading systems to verify and validate principles addressed in this thesis. Finally, this thesis concludes that systems engineering principles and frameworks can be the key to success for implementing high frequency trading or quantitative investment systems.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It's just a thesis and you should not consider this as a state of art which is used in a production environment on Wall street. However it's at least something to begin with and become familiar with some approaches which are conisdered in this work.&lt;/p&gt;&#xA;" OwnerUserId="15" LastActivityDate="2011-08-22T08:31:12.680" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1732" PostTypeId="2" ParentId="1725" CreationDate="2011-08-22T14:25:00.490" Score="6" Body="&lt;p&gt;In addition to Chan's Quantitative Trading, I have also found the description of trading systems in Rishi Narang's &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470432063&quot; rel=&quot;noreferrer&quot;&gt;Inside the Black Box&lt;/a&gt; to be informative and interesting.  There are a few chapters there that give some details on system development, but they are very broad overviews.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-08-22T14:25:00.490" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1733" PostTypeId="1" AcceptedAnswerId="2783" CreationDate="2011-08-22T16:01:45.450" Score="3" ViewCount="240" Body="&lt;p&gt;A friend of mine who studies game theory suggested that credit ratings from the bond ratings agencies, such as Moody's, S&amp;amp;P, and Fitch, may suffer from a sort of &quot;ratings inflation&quot; similar to the grade inflation seen in many colleges.  What are the forces driving grade inflation and how would those same forces apply to bond ratings?  Is there any evidence that ratings inflation has taken place?&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2012-01-17T00:15:16.307" Title="Do bond credit ratings suffer from &quot;ratings inflation&quot;?" Tags="&lt;fixed-income&gt;&lt;credit-ratings&gt;&lt;inflation&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1734" PostTypeId="2" ParentId="1725" CreationDate="2011-08-22T16:30:36.190" Score="5" Body="&lt;p&gt;Additionally I would recommend &lt;a href=&quot;http://books.google.de/books?id=jbD47VkOHAEC&amp;amp;lpg=PP1&amp;amp;dq=evidence%20based%20technical%20analysis&amp;amp;hl=en&amp;amp;pg=PP1#v=onepage&amp;amp;q&amp;amp;f=false&quot;&gt;Evidence-based technical analysis by David Aronson&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It explains the whole process (including the complete statistical background) of rigorously setting up the basis for your trading system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See for a short summary of important points here: &lt;a href=&quot;http://www.cxoadvisory.com/2526/technical-trading/evidence-based-technical-analysis-applying-the-scientific-method-and-statistical-inference-to-trading-signals-chapter-by-chapter-review/&quot;&gt;CXO Advisory&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See for a review here (including some practical advice and programs how to use the recipes in the book): &#xA;&lt;a href=&quot;http://www.automated-trading-system.com/evidence-based-technical-analysis-aronson-book/&quot;&gt;Automated trading system&lt;/a&gt; (This whole blog is btw a good starting point on its own for your endeavor!)&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-08-22T16:30:36.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1735" PostTypeId="1" CreationDate="2011-08-16T14:15:24.160" Score="3" ViewCount="12167" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Possible Duplicate:&lt;/strong&gt;&lt;br&gt;&#xA;  &lt;a href=&quot;https://quant.stackexchange.com/questions/1640/where-to-download-list-of-all-common-stocks-traded-on-nyse-nasdaq-and-amex&quot;&gt;Where to download list of all common stocks traded on NYSE, NASDAQ and AMEX?&lt;/a&gt;  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&#xA;&#xA;&lt;p&gt;Is it possible to download a list of stocks that belong to a specific exchange (e.g. NASDAQ, AMEX, NYSE)?  The &lt;code&gt;tseries&lt;/code&gt; package has a function to download the price history of a stock, but how to get all the stocks of an exchange?&lt;/p&gt;&#xA;" OwnerUserId="1663" OwnerDisplayName="Dail" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2011-08-22T19:14:06.557" Title="How to get a list of stocks symbol of a specific exchange?" Tags="&lt;r&gt;" AnswerCount="1" CommentCount="9" FavoriteCount="3" ClosedDate="2011-09-10T19:15:12.010" ContentLicense="CC BY-SA 3.0" />
  <row Id="1736" PostTypeId="2" ParentId="1735" CreationDate="2011-08-16T14:24:52.030" Score="5" Body="&lt;p&gt;I think you are confused about &quot;markets&quot;. Of the three you listed, only NASDAQ is an exchange, the other two are information services. For the three major US exchanges, you go to:&#xA; (NASDAQ, AMEX, NYSE):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.nasdaq.com/screening/company-list.aspx&quot;&gt;http://www.nasdaq.com/screening/company-list.aspx&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pick the one you are interested in and answer their silly robot barrier &quot;puzzle&quot; and download the csv file, in which the ticker symbol is the first column.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: With TTR_0.20-3 from r-forge, the list appears more complete than with the prior version:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;require(TTR)&#xA;SYMs &amp;lt;- TTR::stockSymbols()&#xA;#Fetching AMEX symbols...&#xA;#Fetching NASDAQ symbols...&#xA;#Fetching NYSE symbols...&#xA; table(SYMs$Exchange)&#xA;&#xA;##  AMEX NASDAQ   NYSE &#xA;#   308   2820   3261 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Whereas the csv file from NASDAQ for NASDAQ had 2820 symbols. &lt;strike&gt;On the other hand the TTR authors may have eliminated some of the duplicates, warrants or outdated symbols.&lt;/strike&gt;&lt;/p&gt;&#xA;" OwnerUserId="43602" OwnerDisplayName="DWin" LastActivityDate="2011-08-16T17:03:23.167" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1737" PostTypeId="2" ParentId="613" CreationDate="2011-08-22T22:32:26.537" Score="7" Body="&lt;p&gt;There is a third option -- use the &lt;a href=&quot;http://cran.r-project.org/web/packages/zoo/index.html&quot; rel=&quot;noreferrer&quot;&gt;ZOO&lt;/a&gt; packages for time-series objects. You will have the benefit of index and time-series indexes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Per Ulrich's comment -- XTS is the way to go!&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-10-22T18:24:05.727" LastActivityDate="2011-10-22T18:24:05.727" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1738" PostTypeId="2" ParentId="1725" CreationDate="2011-08-22T22:48:23.023" Score="4" Body="&lt;p&gt;I just finished &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470563761&quot;&gt;&quot;High-Frequency Trading: A Practical Guide to Algorithmic Strategies and Trading Systems&quot;&lt;/a&gt; by Irene Aldridge -- I think it provides a very good overview of HFT, considerations of different aspects of trading systems, and good introductions to many formulas and research.&lt;/p&gt;&#xA;" OwnerUserId="1138" LastActivityDate="2011-08-22T22:48:23.023" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1739" PostTypeId="2" ParentId="516" CreationDate="2011-08-23T02:04:20.303" Score="3" Body="&lt;p&gt;Mean-Variance optimization is the standard finance answer to this question. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, solutions can be costly since the weights will likely be dispersed across many instruments raising fixed transactions costs. I would consider &lt;a href=&quot;http://www.google.com/url?sa=t&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CB8QFjAA&amp;amp;url=http://www.cmap.polytechnique.fr/~aspremon/PDF/INFORMS05sparsePCA.pdf&amp;amp;ei=bgpTTvv7A4jAgQfI2vU9&amp;amp;usg=AFQjCNGtCmVzbRIjkyLatZXi7IMd96howg&quot; rel=&quot;nofollow&quot;&gt;Sparse PCA&lt;/a&gt; as another solution where you can specify cardinality constraints on the number of securities in your basket to better manage the transasctions costs vs. diversification trade-off&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-08-23T05:02:46.027" LastActivityDate="2011-08-23T05:02:46.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1740" PostTypeId="2" ParentId="1247" CreationDate="2011-08-23T04:19:54.800" Score="4" Body="&lt;p&gt;I think there is a result that some generalizations of the Vickrey auction to two sided trading do not have balanced budgets: i.e. require additional incentives from the market maker.  It occurs as a consequence of avoiding any participant's price being dependent on their own input. The &quot;Vickrey&quot; approach would be to make someone's price equal to the decrease in surplus of everyone else that is involved in accepting their bid or ask. But that means buyers all pay marginal cost of the most costly traded unit and sellers all receive marginal value of the lowest valued traded unit. Obviously there is a gap there and thats what the market maker has to pay to get traders individually to tell the truth. Also, it can be manipulated by groups of traders. Milgrom, &quot;Putting Auction Theory To Work&quot; &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0521536723&quot; rel=&quot;nofollow&quot;&gt;http://www.amazon.com/Putting-Auction-Churchill-Lectures-Economics/dp/0521536723/ref=sr_1_1?ie=UTF8&amp;amp;qid=1314177894&amp;amp;sr=8-1&lt;/a&gt;  would be a good place to start reading for an understanding of these issues.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A more practical approach perhaps is the UPDA. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider using a uniform price double auction if you need a two-sided trading institution -- for buying or selling -- but want something like the kind of truth-telling incentive found in the Vickrey auction.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the Uniform Price Double Auction, truth-telling bids/asks are incentive compatible if you are not the price setter because pricing is an order statistic (like a median, but not literally the median) not a mean.   And, you can't know if you are the price setter if all the bids and asks are processed simultaneously and in secret.  Like the Vickrey auciton, with the UPDA, strategic under pricing or over pricing by a participant exposes that specific participant to either lost opportunities that would have made money or to actual deals with losses. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your single resource type consists of identical units of a commodity, then a reasonable approach is the uniform price double auction, as follows:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;All bids (quotes from buyers) and asks (quotes from sellers) are for single units of a well-defined commodity good or service.  To bid for multiple units, just send more than one bid or ask. Collect all the bids and asks from everyone in two arrays b[], and a[].  Thats two arrays for the entire market, not for each participant.&lt;/li&gt;&#xA;&lt;li&gt;Sort the bids in b[] by price from high to low.&lt;/li&gt;&#xA;&lt;li&gt;Sort the asks in a[] by price from low to high.&lt;/li&gt;&#xA;&lt;li&gt;Find q*&gt;0, perhaps incrementally, such that &lt;code&gt;b[q*]&amp;gt;=a[q*]&lt;/code&gt; AND &lt;code&gt;b[q*+1]&amp;lt;a[q*+1]&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Make every bid/ask corresponding to an array index q, q&amp;lt;=q* a trade.  q&gt;q* does NOT trade&lt;/li&gt;&#xA;&lt;li&gt;Set price the same for all traders, p can be set anywhere from as low as max(a[q*],b[q*+1]) to as high as min(b[q*],a[q*+1]) and the result will be consistent with all the bids and asks. It is common to calculate both and choose the midpoint.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You might also want to do some reading on Experimental Economics, where many variations of auctions and markets have been studied with prototype software in human subject laboratories where the human subjects trade for profit. I have also done some work in this area.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Vernon L. Smith, &lt;em&gt;Economics in the Laboratory&lt;/em&gt;, Journal of Economic Perspectives, Vol 8, no.1, 1994.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find a few examples of uniform price double auctions in Smith's collected works, which can be had on Amazon:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/052102465X&quot; rel=&quot;nofollow&quot;&gt;http://www.amazon.com/Papers-Experimental-Economics-Vernon-Smith/dp/052102465X/ref=sr_1_7?ie=UTF8&amp;amp;qid=1314072760&amp;amp;sr=8-7&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="627" LastEditorUserId="627" LastEditDate="2011-08-24T09:25:48.553" LastActivityDate="2011-08-24T09:25:48.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1741" PostTypeId="2" ParentId="1710" CreationDate="2011-08-23T09:35:05.370" Score="4" Body="&lt;p&gt;Here is a more or less formal proof of the fact that &quot;the system can't be beaten&quot;. The argument works whenever the underlying process is a &lt;a href=&quot;http://en.wikipedia.org/wiki/Martingale_%28probability_theory%29&quot; rel=&quot;nofollow&quot;&gt;martingale&lt;/a&gt;. In particular, it is valid for a random walk without drift. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $S=\{S_n\}$ be a discrete-time martingale which represents a series of games played at times $n=1,2,...$. Assume that $S_0=0$ (no game at time $n=0$). &#xA;Let $\mathcal A=\{\mathcal A_n\}$ be a &lt;a href=&quot;http://en.wikipedia.org/wiki/Filtration_%28mathematics%29&quot; rel=&quot;nofollow&quot;&gt;filtration&lt;/a&gt; of $\sigma$-algebras &#xA;$\mathcal A_0\subset \mathcal A_1\subset\ ...$, such that the process $S$ is &lt;em&gt;adapted&lt;/em&gt; with respect to $\mathcal A$, i.e.  $S_n$ is  $\mathcal A_n$-measurable for each $n$. Intuitively speaking, this implies that $\mathcal A_n$ contains all information about the outcomes of the game after the first $n$ rounds, and the value of $S_n$ is known to the player at time $n$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We may think of the difference $S_n-S_{n-1}$ as the net winnings &lt;em&gt;per unit stake&lt;/em&gt; in game $n$. Since $S$ is a martingale,&#xA;$$\mathbb E(S_n-S_{n-1}|\mathcal A_{n-1})=0,\qquad n=1,2,... $$&#xA;Now let $C=\{C_n\}$ be a &lt;em&gt;previsible&lt;/em&gt; bounded process, i.e. $C_n$ is $\mathcal A_{n-1}$-measurable and&#xA;$$\sup|C_n(\omega)|\leq K $$ for each $n=1,2,...$ and some constant $K$. $C_n$ represents the player's stake in game $n$. Obviously, the value&#xA;of $C_n$ must be determined based on the history up to time $n-1$ (the player has no information about the value of $S_n$ before the n-th round is played). Thus the total winnings up to time $n$ are &#xA;$$X_0=0,\qquad X_n=\sum\limits_{k=1}^{n}C_k(S_k-S_{k-1}),\quad n\geq1.$$&#xA;Since the process $C$ is previsible and bounded, using the standard properties of the conditional mean, we have that&lt;br&gt;&#xA;$$\mathbb E(X_n-X_{n-1}|\mathcal A_{n-1})=\mathbb E(C_n(S_n-S_{n-1})|\mathcal A_{n-1})=&#xD;&#xA;C_n\mathbb E(S_n-S_{n-1}|\mathcal A_{n-1})=0$$&#xA;for each $n=1,2,...$. In other words, $X=\{X_n\}$ is an adapted integrable process such that&#xA;$$\mathbb E(X_n|\mathcal A_{n-1})=X_{n-1}$$&#xA;for all $n\geq 1$, i.e. it's a martingale itself. It immediately follows that  $\mathbb E(X_n|\mathcal A_{m})=X_m$ when $m&amp;lt;n$ and that the unconditional mean $\mathbb E(X_n)=\mathbb E(X_0)=0$ does not depend on $n$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://books.google.com/books?id=e9saZ0YSi-AC&amp;amp;dq=david%20williams&amp;amp;printsec=frontcover&amp;amp;source=in&amp;amp;hl=en&amp;amp;ei=PLH4Sb2WCdqwtgf-oPDBDw&amp;amp;sa=X&amp;amp;oi=book_result&amp;amp;ct=result&amp;amp;resnum=14#v=onepage&amp;amp;q&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;&quot;Probability with Martingales&quot;&lt;/a&gt; by Williams is a good and fairly standard reference for this stuff.&lt;/p&gt;&#xA;" OwnerUserId="70" LastEditorUserId="70" LastEditDate="2011-08-23T10:45:58.673" LastActivityDate="2011-08-23T10:45:58.673" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1742" PostTypeId="1" AcceptedAnswerId="1744" CreationDate="2011-08-23T14:11:12.203" Score="9" ViewCount="523" Body="&lt;p&gt;Can the CAPM beta of emerging markets be less than the beta of the developed markets?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As part of my research, I run regressions using market indices.  I estimate the beta using a regression of MSCI country/region excess returns on the excess returns of the MSCI ACWI.  Excess returns are returns minus the risk-free rate (which I take to be the T-bill rate).  When running this regression, I found the following strange result.  While the beta of China is less than 1, the beta of the USA and of Europe are greater than 1.  Can anyone please explain this result?&lt;/p&gt;&#xA;" OwnerUserId="1179" LastEditorUserId="1106" LastEditDate="2011-08-23T14:31:56.783" LastActivityDate="2011-08-23T15:10:49.500" Title="How well does CAPM beta track the risk of a particular market relative to world markets?" Tags="&lt;equities&gt;&lt;beta&gt;&lt;capm&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1743" PostTypeId="2" ParentId="946" CreationDate="2011-08-23T14:19:42.200" Score="15" Body="&lt;p&gt;You are absolutely right to point out that most &lt;em&gt;proactive&lt;/em&gt; participants in options markets prefer to be long gamma, and it is typically &lt;em&gt;reactive&lt;/em&gt; market makers who take the opposite side of their trades.  While the typical options trader (I find it difficult to call anyone trading options an &quot;investor&quot;) does not hedge his position, market makers will attempt to dynamically hedge an entire portfolio of options.  In addition, covered call writers (also known as call overwriters) are a major source of gamma to the market, particularly for individual stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most market makers will immediately delta-hedge with the underlying, and will typically seek to offset the other Greeks of that option (most importantly, Gamma and Vega) by buying other options on the same underlying at more attractively priced strikes and/or tenors.  Failing that, some more sophisticated market makers, or market makers in less liquid options, will put on an inexact hedge using options on a closely correlated underlying with more liquid options, or with ETFs or index options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Market makers are typically paid for this service via the negative volatility risk premium (see &lt;a href=&quot;http://faculty.baruch.cuny.edu/lwu/890/BakshiKapadia2003.pdf&quot;&gt;Bakshi and Kapadia [2003a]&lt;/a&gt;).  In other words, the P&amp;amp;L from a typical delta-hedged short gamma (short options) position is positive.  However, partly due to the influence of call overwriting, which is more common for individual stocks, and partly due to the ability to diversify away some idiosyncratic volatility, the volatility risk premium is much greater in index options (see [Bakshi and Kapadia &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=438661&quot;&gt;2003b&lt;/a&gt;]).  Some active options traders also attempt to exploit this difference via &lt;a href=&quot;http://ssrn.com/abstract=1156620&quot;&gt;dispersion trading&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-08-23T14:19:42.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1744" PostTypeId="2" ParentId="1742" CreationDate="2011-08-23T14:39:43.977" Score="5" Body="&lt;p&gt;What you observe in your regression is not strange at all.  The regression beta you estimated is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\beta_i = \frac {\mathrm{cov}(r_i,r_m)}{\mathrm{var}(r_m)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $i$ represents the country/region (such as the USA or China) and $m$ represents the &quot;market&quot; (which you take to be the ACWI).  Since the USA is itself such a large component of the ACWI (about 40%, I believe) it is not surprising to find that its covariance with ACWI is much greater than China's, even though China probably has a much greater variance than the USA.  Recall that covariance is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathrm{cov}(r_i,r_m)=\rho_{i,m}\sigma_i\sigma_m$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even though $\sigma_i$ is likely higher for China, $\rho$ is much higher for USA.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-08-23T14:39:43.977" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1745" PostTypeId="2" ParentId="1742" CreationDate="2011-08-23T15:10:49.500" Score="4" Body="&lt;p&gt;Beta as a measure of risk has serious drawbacks, particularly in emerging markets. You need to consider alternative risk metrics (cost-of-capital build-up method or volatility, for example), or if you do use beta consider what the market index refers to and the composition of that index. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This &lt;a href=&quot;http://pages.stern.nyu.edu/~adamodar/pdfiles/papers/beta.pdf&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; actually happens to touch on beta estimation and uses Brazil's Bovespa as an illusration. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a choice excerpt:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;The good fit is deceptive, however. Telebras is 40% or more of the Bovespa, and this has&#xA;some strange consequences. The first is that the beta estimates for all other Brazilian&#xA;stocks essentially become regressions of those stocks against Telebras, rather than a&#xA;diversified stock index. The second is that more than 90% of all stocks on the Brazilian index were reporting betas less than one at the time of this regression. Since it is the weighted average beta that is one, and Telebras has a beta greater than one, this&#xA;asymmetry in beta estimates becomes possible. The third and most troubling consequence&#xA;is that it is the smallest, riskiest companies in the Brazilian market that have the lowest&#xA;betas, while the largest and most estabilished firms have the highest betas.&quot;&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2011-08-23T15:10:49.500" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1746" PostTypeId="1" CreationDate="2011-08-23T16:42:36.723" Score="6" ViewCount="1527" Body="&lt;p&gt;I am trading with standard deviation bands (6 bands) on de-trended data. How can I find the most profitable  signals with neural network or GA with standard deviation bands? Should I first find the slope  degree of n bars of trend line (for example, 50 bars linear trend line slope is 30 degree) then calculate bands distance to price the finally find the probability distribution of the signals? Is this the correct method? Any comments welcome from people with a good grasp of signal processing and knowledge of probability.&lt;/p&gt;&#xA;" OwnerUserId="1253" LastEditorUserId="1106" LastEditDate="2011-08-23T17:02:30.067" LastActivityDate="2012-10-18T11:10:35.193" Title="How to calculate optimal standard deviation bands for trading?" Tags="&lt;volatility&gt;&lt;trading&gt;&lt;automated-trading&gt;&lt;machine-learning&gt;&lt;digital-signal-processing&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1747" PostTypeId="5" CreationDate="2011-08-23T19:02:22.867" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2011-08-23T19:02:22.867" LastActivityDate="2011-08-23T19:02:22.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1748" PostTypeId="4" CreationDate="2011-08-23T19:02:22.867" Score="0" Body="Value at Risk, a widely used risk measure of the risk of loss on a specific portfolio of financial assets." OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-08-23T19:23:34.983" LastActivityDate="2011-08-23T19:23:34.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1749" PostTypeId="5" CreationDate="2011-08-23T19:11:05.973" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2011-08-23T19:11:05.973" LastActivityDate="2011-08-23T19:11:05.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1750" PostTypeId="4" CreationDate="2011-08-23T19:11:05.973" Score="0" Body="Algorithms that allow computers to evolve behaviors based on empirical data.  Approaches include genetic programming, artificial neural networks, decision trees, support vector machines, and cluster analysis." OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-08-23T19:23:37.840" LastActivityDate="2011-08-23T19:23:37.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1751" PostTypeId="5" CreationDate="2011-08-23T19:14:35.187" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2011-08-23T19:14:35.187" LastActivityDate="2011-08-23T19:14:35.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1752" PostTypeId="4" CreationDate="2011-08-23T19:14:35.187" Score="0" Body="Questions about handling, obtaining, generating, or analyzing all types of financial or economic data." OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-08-23T19:23:41.223" LastActivityDate="2011-08-23T19:23:41.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1753" PostTypeId="2" ParentId="1746" CreationDate="2011-08-23T20:06:36.310" Score="5" Body="&lt;p&gt;You need to define the parameters over which you are searching (i.e. # of bands, slope of trendline, some function relating slopes to trendline, etc.). Then you can use your favorite optimizer to identify which parameters satisfy your P&amp;amp;L objective.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, your approach is a surefire way to lose money since this &lt;a href=&quot;http://en.wikipedia.org/wiki/Curve_fitting&quot; rel=&quot;nofollow&quot;&gt;curve-fitted&lt;/a&gt; model will not generalize out-of-time. There is no theoretical reasoning on why the parameters and functional form that your optimizer identifies need explain future returns. It's also not clear what your strategy is -- trend-following or mean-reversion on breaks -- which suggests there is not much of a theoretical underpinning here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A better approach along your lines of going long/short and certain bands would be the attached &lt;a href=&quot;http://math.nyu.edu/faculty/avellane/StatArb13030.pdf&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; by Marco Avellaneda @ NYU. Better still is taking a step back and making empirical observations about the market and then fitting a &lt;em&gt;theory&lt;/em&gt; (what statisticians call the &quot;data generating process&quot;) to explain your observations. Then try to build a model that reflects your theory.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-08-23T20:16:14.733" LastActivityDate="2011-08-23T20:16:14.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1754" PostTypeId="1" AcceptedAnswerId="1858" CreationDate="2011-08-23T20:14:26.413" Score="12" ViewCount="2026" Body="&lt;p&gt;What kind of computer hardware, in additional to the 'conventional' fare, is actually used in trading? And what languages is it typically programmed in? I'm interested in ASICs, FPGAs, that sort of thing.&lt;/p&gt;&#xA;" OwnerUserId="1217" LastEditorUserId="2299" LastEditDate="2012-08-08T12:21:58.037" LastActivityDate="2012-08-08T12:21:58.037" Title="What kind of specialized hardware is used in trading?" Tags="&lt;trading&gt;&lt;hardware&gt;" AnswerCount="4" CommentCount="4" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1755" PostTypeId="2" ParentId="946" CreationDate="2011-08-23T20:53:08.940" Score="11" Body="&lt;p&gt;Short gamma is being of the view that &lt;em&gt;realized volatility&lt;/em&gt; would be less than the &lt;em&gt;implied volatility&lt;/em&gt; for the period in which an option is valid. So if you think realized volatility in the future would be consistently lesser than implied volatility at present, then you'd be short gamma.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The premium one would receive by selling an option (call or put) is a proxy for the implied volatility of the underlying (forward underlying, to be precise, if you take into account stochastic discount rates). Call this (single) cashflow I.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The amount one would lose in a delta-neutral short option position would be due to constant adjustment of the hedge (as the underlying keeps moving). This is roughly 0.5 * gamma * (change in underlying)^2 for each time step. Call the discounted sum of these delta-adjustment based &quot;realized&quot; cashflows R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, a short gamma investor is hoping that I-R &gt;= 0&lt;/p&gt;&#xA;" OwnerUserId="1151" LastActivityDate="2011-08-23T20:53:08.940" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1756" PostTypeId="1" CreationDate="2011-08-23T21:05:32.843" Score="8" ViewCount="510" Body="&lt;p&gt;Suppose we train on M individuals consisting of T observations (i.e. TxM design matrix). The dependent variable is one-year return for each security (H = horizon of one year). In a factor model specification, we align security characteristics and economic factor exposures observed at time T with the dependent variable observed at T+H.  Therefore any operational forecasting factor model must use information that is stale by at least one-year.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can have traumatic consequences especially as market conditions are continuously changing. For example, such a forecasting model would  not “recognize” a bear market until at least one full year into the bear market (maybe when the bear market ended as in the illustration below).  Likewise, a full one year after the end of the bear market on March 2009 such a forecasting model would continue to predict substantial negative returns thru March 2010 and then some.  Or consider today -- a 1 year forecasting model’s most recent training data is an observation from August 2010 – changes in factor premia are lagged by construction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/bEuAF.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Check out this slide from an Axioma Risk Model presentation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/1Ta3n.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice the lagged &quot;echo&quot; volatility spike that takes place months after October 2008 -- several months after the realized volatility spike. Perversely, as realized risk (gray line) is declining the predicted risk (red/blue line) is increasing! This is because the realized volatility enters the training data with some lag. There is no &quot;instantaneous&quot; adjustment to current conditions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What creative work-arounds or modeling approaches can be used to dealing with this problem endemic to forecasting models? Are there statistical methods to cope with this?&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1106" LastEditDate="2011-09-09T19:20:04.177" LastActivityDate="2011-09-09T19:20:04.177" Title="The T+H Problem in Factor model forecasts" Tags="&lt;volatility&gt;&lt;correlation&gt;&lt;forecasting&gt;&lt;prediction&gt;&lt;factor-models&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1757" PostTypeId="2" ParentId="1754" CreationDate="2011-08-23T21:13:47.433" Score="4" Body="&lt;p&gt;There is a very small minority of people using nvidia GPGPUs which can be programmed with the &lt;a href=&quot;http://www.nvidia.com/object/cuda_home_new.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;CUDA&lt;/a&gt; libraries.  This sort of specialist hardware can be very effective at solving certain problems - mostly where you have very little I/O.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally, if you are interested in how people are using GPGPUs, then I recommend taking a look at this &lt;a href=&quot;https://stackoverflow.com/questions/55403/have-you-successfully-used-a-gpgpu&quot;&gt;question&lt;/a&gt; on StackOverflow.&lt;/p&gt;&#xA;" OwnerUserId="1161" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2011-08-24T10:44:55.990" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1758" PostTypeId="2" ParentId="1756" CreationDate="2011-08-23T21:42:11.520" Score="4" Body="&lt;p&gt;I can offer three suggestions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(a) Since any model, however sophisticated, will miss tail cases (such as Oct 2008) I would increase the number of high-frequency factors (eg weekly jobless claims - I don't know if that is a relevant example in your case - but just to give you an idea) in the model. Not only does that make the model more responsive to current events, it would also allow the H-window to be shortened while still maintaining  a low variance for model error (as sample size within a time window remains unaffected)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(b) Weighting, maybe? Give more weightage to recent points and lesser so to older data. Some HVaR models I have seen do apply this while still giving tail events a higher weightage (manually) - thus maintaining predictive capacity for tail events (which we are more concerned about, anyway) while making the model less &quot;burdened&quot; by older, redundant data (not all data adds &quot;new&quot; information).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(c) Some sort of instantaneous feedback to calculate how &quot;off&quot; your model is. The larger this &quot;difference&quot; metric is, the more intensely you can apply your weighting rules as described in (b). This again makes the model more responsive to volatile current events.&lt;/p&gt;&#xA;" OwnerUserId="1151" LastActivityDate="2011-08-23T21:42:11.520" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1759" PostTypeId="2" ParentId="1754" CreationDate="2011-08-23T21:59:07.340" Score="6" Body="&lt;p&gt;The only real use of this type of hardware in trading that I've seen is the recent spate of FPGA-based risk engines and feed handlers. See &lt;a href=&quot;http://low-latency.com/blog/fpga-momentum-accelerates&quot; rel=&quot;nofollow&quot;&gt;this article&lt;/a&gt; for some pointers; googling for some obvious keywords will provide more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the very small deployment volumes, it seems unlikely that anyone would be looking at ASICs for this.&lt;/p&gt;&#xA;" OwnerUserId="90" LastEditorUserId="90" LastEditDate="2011-08-24T09:25:55.790" LastActivityDate="2011-08-24T09:25:55.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1760" PostTypeId="2" ParentId="1756" CreationDate="2011-08-23T22:49:47.387" Score="4" Body="&lt;p&gt;Hopefully these ideas open up some solution strategies. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A. Calibration approach:&#xA;In the case of a volatility model such as Axioma's above, you could perform an instantaneous volatility adjustment. Procedure:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You build your usual T+H volatility model.&lt;/li&gt;&#xA;&lt;li&gt;You measure the realized volatility and implied volatility of the training set.&lt;/li&gt;&#xA;&lt;li&gt;You measure the out-of-time performance your T+H volatility model (specifically, realized volatility and implied volatility) over some period.&lt;/li&gt;&#xA;&lt;li&gt;You identify a scaling factor that is a function of the observed volatility today and the implied and realized volatility of the training set. For example, imagine that the out-of-time realized volatility was 2x the volatility of your training set. Then a naive scaling factor of 2x can be applied to your covariance matrix -- of course you can do better by estimating the relationship.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Weakness: The above procedure might work for volatility estimation where you have one dependent variable or one covariance matrix that you scale up or down. But it's not clear how you would apply this to a cross-sectional equity return model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;B. Regime Switching Model:&#xA;Another approach would be to setup a regime switching model. Here you are conditioning returns and volatility expectations on today's state. You estimate the expected returns and  volatility associated with each state. This is an improvement in that you are making use of today's states but you still have a subtle T+H problem since the dependent variable is still lagged. Also, your model will have difficulty handling regimes not in the training set such as stagflation, QE3, etc. and you have the usual issues with regime models (parameter estimation, new regimes, convergence, etc.). This approach has the most merit in asset allocation policy and volatility estimation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;C. Forecast for half-the horizon. This is a bit like Zeno's paradox though -- why not forecast for half of half of the horizon? Another drawback is that different correlation structures emerge at different time scalings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;D. One angle would be a hybrid model. Estimate the contemporaneous factor returns and then have another model that forecasts the evolution of each factor. Weakness here is the complexity -- you go from one model to K+1 models (one model for each factor). You are estimating too many parameters with the same data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;E. Weighting + Re-scaling. Here you take a some rolling average of exponentially weighted factor returns and scale them to an annualize horizon and add to your training set. Problem is you would get unrealistic data. For example, if you had 4 consecutive weeks of sub-par returns you would extrapolate a correction into financial armageddon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(B) is no panacea but it seems like the most promising approach. To my knowledge BARRA, Axioma, et al do not apply regime switching models. What other techniques might we be missing?&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-08-23T23:05:50.730" LastActivityDate="2011-08-23T23:05:50.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1761" PostTypeId="2" ParentId="1754" CreationDate="2011-08-24T07:29:45.197" Score="8" Body="&lt;p&gt;The very good description of specialized hardware in finance can be found at Cisco.com - &lt;a href=&quot;http://www.cisco.com/web/strategy/financial/algo_speed.html&quot; rel=&quot;nofollow&quot;&gt;Algo Speed High Frequency Trading Solution&lt;/a&gt; section. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Their &lt;a href=&quot;http://www.cisco.com/web/strategy/docs/finance/HPT_Poster_hires_060311.pdf&quot; rel=&quot;nofollow&quot;&gt;High-Performance Trading Architecture (pdf)&lt;/a&gt; poster is just great to find out used hardware for different purposes and there are also some presentations, white papers and videos about Cisco's solutions for &lt;a href=&quot;http://www.cisco.com/web/strategy/financial/markets.html&quot; rel=&quot;nofollow&quot;&gt;financial markets&lt;/a&gt; on this website. &lt;/p&gt;&#xA;" OwnerUserId="15" LastEditorUserId="15" LastEditDate="2011-08-24T11:08:41.673" LastActivityDate="2011-08-24T11:08:41.673" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1762" PostTypeId="1" CreationDate="2011-08-24T23:50:07.143" Score="16" ViewCount="2207" Body="&lt;p&gt;Is there any relationship between the risk aversion coefficient in an individual's utility function (commonly used in portfolio optimization) and the preference for higher moments such as skewness and kurtosis?  In what range, approximately, should they be?  Logically, a relationship should exist, as they all somehow represent the investor's attitude towards risk.&lt;/p&gt;&#xA;" OwnerUserId="1179" LastEditorUserId="1106" LastEditDate="2011-08-25T01:51:36.907" LastActivityDate="2019-05-08T11:50:30.273" Title="What is the relationship between risk aversion and preference for skewness and kurtosis in portfolio optimization?" Tags="&lt;risk&gt;&lt;modern-portfolio-theory&gt;&lt;skewness&gt;&lt;kurtosis&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="1763" PostTypeId="2" ParentId="1762" CreationDate="2011-08-25T01:54:40.713" Score="9" Body="&lt;p&gt;Yes. Check out the Lower Partial Moments literature. In my view the best introduction to this is &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.22.262&amp;amp;rep=rep1&amp;amp;type=pdf&amp;amp;rct=j&amp;amp;q=nawrocki%20lower%20partial%20moments&amp;amp;ei=5apVTuWKKoaDgAff3PAT&amp;amp;usg=AFQjCNHSHUsSE8kfAUs3fLeUgxs1lSRwpA&quot;&gt;Narwrocki&lt;/a&gt; - A Brief History of Downside Risk Measures. Uryasev established equivalence between CVaR approach and low partial moments. If Markowitz had the tools at the time time, LPM utility functions would be the introductory optimization model as opposed to mean-variance.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-08-25T02:11:19.093" LastActivityDate="2011-08-25T02:11:19.093" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1764" PostTypeId="1" AcceptedAnswerId="1768" CreationDate="2011-08-25T02:40:32.383" Score="48" ViewCount="56337" Body="&lt;p&gt;I had to ask this question after reading the answers to &lt;a href=&quot;https://quant.stackexchange.com/questions/306/what-programming-languages-are-most-commonly-used-in-quantitative-finance&quot;&gt;What programming languages are most commonly used in quantitative finance?&lt;/a&gt; I understand that C++ programs can be optimized pretty well and are faster than anything else. But in this era, the performance of a program written in a language based on frameworks such as C# and Java can be pretty close to that of C++, while the maintenance cost of the program would be lower than the C++ one. But why is C++ still a very popular language in QF? &lt;/p&gt;&#xA;" OwnerUserId="1170" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2016-05-09T09:42:51.363" Title="Why is C++ still a very popular language in quantitative finance?" Tags="&lt;programming&gt;" AnswerCount="12" CommentCount="13" FavoriteCount="46" ClosedDate="2013-02-13T18:54:13.973" ContentLicense="CC BY-SA 3.0" />
  <row Id="1765" PostTypeId="2" ParentId="1764" CreationDate="2011-08-25T03:32:07.993" Score="23" Body="&lt;p&gt;The main reason is traders/quants currently in business often learned C++ in their formation rather than C#, they naturally used this language when starting new projects.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It will gradually evolve, I guess you could have asked &quot;what's the reason cobol is still the most popular language in Finance&quot; 20 years ago.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also most projects in production use C++ but I think now most new projects gradually evolve towards C#/Java.&lt;/p&gt;&#xA;" OwnerUserId="1181" LastActivityDate="2011-08-25T03:32:07.993" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1766" PostTypeId="1" CreationDate="2011-08-25T03:58:06.747" Score="10" ViewCount="1631" Body="&lt;p&gt;How can I compute the predicted return from a linear regression that includes a number of different terms.  For instance, suppose my equation is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_{future} = \alpha + \beta_1 r_{history} + \beta_2 x_{news} + \beta_3 r_{history} * x_{news} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $r$ is the geometric return, and $x$ is a news dummy variable (0 or 1 depending on whether news existed).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I still conclude that the expected return $r_{future} = \sum \beta_i$?&lt;/p&gt;&#xA;" OwnerUserId="658" LastActivityDate="2011-08-25T13:47:53.373" Title="Expected return from a multiple linear regression?" Tags="&lt;regression&gt;&lt;expected-return&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1767" PostTypeId="2" ParentId="1764" CreationDate="2011-08-25T06:05:57.073" Score="18" Body="&lt;p&gt;I don't know if it &lt;em&gt;the&lt;/em&gt; most popular but it is popular for sure - I think there are several reasons for that, which not only apply to QF:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It is a mature language with many years of development behind it&lt;/li&gt;&#xA;&lt;li&gt;There are many people who are able to program it&lt;/li&gt;&#xA;&lt;li&gt;Many books, tutorials, websites, communities are available (network effect!)&lt;/li&gt;&#xA;&lt;li&gt;It is fast&lt;/li&gt;&#xA;&lt;li&gt;There are many libraries available (also math and quant-oriented) - and it is transparent what happens within these libraries (which is sometimes not the case with proprietary higher language toolboxes and systems)&lt;/li&gt;&#xA;&lt;li&gt;There are sophisticated free compilers which make it possible for academia and basically everybody to start exploring the language&lt;/li&gt;&#xA;&lt;li&gt;It is a hybrid with which you can - but need not - program in an object-oriented way&lt;/li&gt;&#xA;&lt;li&gt;The resulting code can run on its own but can also be connected to other programming systems&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;There are few languages out there that have all of these characteristics - but there will finally be a transisiton at least towards C# and Java (This is already happening).&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-08-25T06:05:57.073" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1768" PostTypeId="2" ParentId="1764" CreationDate="2011-08-25T11:40:14.177" Score="49" Body="&lt;p&gt;The other posters have already noted that the prevalent use of C++ &lt;em&gt;appears to be&lt;/em&gt; due to historical reasons and unwillingness to change. Those reasons aren't the ones that people should be applying. If you want &lt;em&gt;real&lt;/em&gt; reasons to use C++, how about the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Powerful infrastructure. Take a look at &lt;a href=&quot;http://software.intel.com/en-us/articles/intel-parallel-studio-home/&quot; rel=&quot;noreferrer&quot;&gt;Intel Parallel Studio&lt;/a&gt; for an example.&lt;/li&gt;&#xA;&lt;li&gt;Performance compared to .Net or Java (see &lt;a href=&quot;https://www.pluralsight.com/courses/cpp-high-performance-computing&quot; rel=&quot;noreferrer&quot;&gt;my course on HPC&lt;/a&gt;). When each array element access checks the bounds and throws exceptions, you know you're leaking CPU cycles there.&lt;/li&gt;&#xA;&lt;li&gt;Parallelization. The C++ ecosystem has vastly superior paralellization in both 'blind' mode (OpenMP vs TPL's &lt;code&gt;Parallel&lt;/code&gt;) and explicit mode (Intel TBB vs TPL)&lt;/li&gt;&#xA;&lt;li&gt;Lots of SDKs, most notably CUDA, base their development on C/C++.&lt;/li&gt;&#xA;&lt;li&gt;Possibility of invoking low-level CPU instructions (e.g., work with SSE intrinsics).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;On the other hand, C++ is&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Extremely noisy. What with all the headers, include directives, &lt;code&gt;friend&lt;/code&gt; class declarations, and myriads of other redundant things.&lt;/li&gt;&#xA;&lt;li&gt;Has hard-to-use libraries (STL, Boost) with very cryptic, global-level mechanisms. Think &lt;code&gt;bind_2nd&lt;/code&gt; :) &lt;/li&gt;&#xA;&lt;li&gt;Editor support is vastly inferior compared to IDEA/ReSharper. Navigation, refactoring, analysis - all are weaker or non-existent. This is going to be improved in the near future for both VS and standalone editing.&lt;/li&gt;&#xA;&lt;li&gt;Compiler errors are beyond cryptic. Clang attempts to fix it to some extent, but things are still cryptic, just not as abysmally bad as they were previously.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And by the way, for the typical user, the performance difference between C++ and, say, C# won't be as pronounced.&lt;/p&gt;&#xA;" OwnerUserId="1217" LastEditorUserId="1217" LastEditDate="2016-05-09T09:42:51.363" LastActivityDate="2016-05-09T09:42:51.363" CommentCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="1769" PostTypeId="2" ParentId="1766" CreationDate="2011-08-25T13:47:53.373" Score="5" Body="&lt;p&gt;If the equation satisfies all the assumptions of OLS, particularly homoscedasticity and no autocorrelation in the errors, then the expected return for the equation you laid out is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E[r_{future}|r_{history},x_{news}]=\alpha+\beta_1r_{history}+\beta_2x_{news}+\beta_3r_{history}*x_{news}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the unconditional expected return is zero (as is likely to be approximately true for short horizon returns), then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E[r_{future}|x_{news}]=\alpha+\beta_2x_{news}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These types of return regressions usually do &lt;em&gt;not&lt;/em&gt; satisfy the conditions for OLS, so your coefficients estimated using OLS or (more likely) your standard errors may be biased.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-08-25T13:47:53.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1770" PostTypeId="2" ParentId="1577" CreationDate="2011-08-25T14:55:00.940" Score="8" Body="&lt;p&gt;Tools from the field of &lt;a href=&quot;http://en.wikipedia.org/wiki/Stochastic_optimization&quot;&gt;stochastic optimizatio&lt;/a&gt;n are best suited for these problems. In particular, attached is a &lt;a href=&quot;http://www.cs.princeton.edu/~blei/papers/HannahPowellBlei2010a.pdf&quot;&gt;paper&lt;/a&gt; on non-parametric density estimation for stochastic optimization that describes an algorithm if state variables can be associated with draws from the predictive distribution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's another approach by &lt;a href=&quot;http://www.doc.ic.ac.uk/~pp500/pubs/KuhnParpasRustem.pdf&quot;&gt;Kuhn&lt;/a&gt;. These are all one-period solutions. Multi-period solutions would require dynamic programming and its solutions cannot be resolved within the expected lifespan of the universe. At least that bounds the problem space!&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-08-26T00:13:35.357" LastActivityDate="2011-08-26T00:13:35.357" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1771" PostTypeId="2" ParentId="344" CreationDate="2011-08-25T16:26:49.450" Score="11" Body="&lt;p&gt;Scott Mixon argues in &lt;a href=&quot;http://ssrn.com/abstract=1618602&quot;&gt;What Does Implied Volatility Skew Measure&lt;/a&gt; that among all measures of implied volatility skew, the (25 delta put volatility - 25 delta call volatility)/50 delta volatility is the most descriptive and least redundant (volatility is Black-Scholes implied volatility).  His paper, recently published in the &lt;a href=&quot;http://www.iijournals.com/doi/abs/10.3905/jod.2011.18.4.009&quot;&gt;Journal of Derivatives&lt;/a&gt;, gives a number of both theoretical and empirical arguments in favor of this measure.  He distinguishes between &quot;skew&quot;, which is a measure of the slope of the implied volatility curve for a given expiration date, and &quot;skewness&quot;, which is the skewness of an option implied, risk neutral probability distribution.  To calculate the latter, one needs to have a theoretical framework or model, whereas the former is easily observable from options prices.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-08-25T16:26:49.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1772" PostTypeId="1" CreationDate="2011-08-25T16:40:28.647" Score="3" ViewCount="442" Body="&lt;p&gt;I'm having a problem in which a time series of 24 data points is given to forecast the next 12 data points. This 24 data points might be sparse (many are missing).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you have any suggestion on what technique can be used?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ADDED: The series is a transformed data from tabulated dataset which shows a measure of one's `skill' over time. The dataset given is only capture in the previous 2 years on a monthly basis, I need to find either an estimation of his/her skill over the next 12 months, or some average measure is also aceptable. &lt;/p&gt;&#xA;" OwnerUserId="1264" LastEditorUserId="1264" LastEditDate="2011-08-25T17:11:17.667" LastActivityDate="2011-08-25T20:09:56.860" Title="Techniques for forecasting short-frame data?" Tags="&lt;time-series&gt;&lt;forecasting&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1773" PostTypeId="1" AcceptedAnswerId="1774" CreationDate="2011-08-25T17:20:22.917" Score="7" ViewCount="509" Body="&lt;p&gt;Many mutual funds sell &quot;asset allocation&quot; products which include appropriately sized investments in a variety of asset classes meant for a prototypical investor.  Some of these, such as PIMCO, even include direct commodity investments in the portfolio.  Pension funds often base their investments on a model portfolio, which increasingly includes &quot;alternatives&quot; such as commodities.  Wealth advisors and investment advisors are increasingly steering their clients towards including some small allocation to commodities, often touting the &quot;diversification&quot; benefits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; Should the average investor be holding some commodities?  Are these allocations in the interests of the client?  Are there real diversification benefits to be had?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both research/references and well reasoned arguments are welcome.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2012-12-22T18:50:32.787" Title="Should the average investor hold commodities as part of a broadly diversified portfolio?" Tags="&lt;research&gt;&lt;portfolio-management&gt;&lt;commodities&gt;&lt;diversification&gt;&lt;asset-allocation&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1774" PostTypeId="2" ParentId="1773" CreationDate="2011-08-25T17:33:15.173" Score="10" Body="&lt;h2&gt;Yes&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ssrn.com/abstract=1368689&quot; rel=&quot;noreferrer&quot;&gt;Strategic Asset Allocation: Determining the Optimal Portfolio with Ten Asset Classes&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://corporate.morningstar.com/ib/documents/MethodologyDocuments/IBBAssociates/Commodities.pdf&quot; rel=&quot;noreferrer&quot;&gt;Strategic Asset Allocation and Commodities&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://advisor.morningstar.com/articles/fcarticle.asp?docId=3979&quot; rel=&quot;noreferrer&quot;&gt;The Case for Commodities&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.gersteinfisher.com/assets/files/research/benefits_of_a_strategic_allocation_to_commodities.pdf&quot; rel=&quot;noreferrer&quot;&gt;An Asset Class for All Seasons: The Benefits of a Strategic Allocation to&#xA;Commodities&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;No&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ssrn.com/abstract=1652699&quot; rel=&quot;noreferrer&quot;&gt;Should Investors Include Commodities in Their Portfolios After All? New Evidence&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;My Take&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Although there seems to be more research on the &quot;yes&quot; side, I would caution against concluding that this is the consensus.  I have not yet found more solid &quot;no&quot; research pieces, but the one I did find seemed more convincing than all the others combined, most of which are actually trying to sell a product.  FYI, I have done some of my own research on this topic as well, and based on that information my employer has decided &lt;em&gt;not&lt;/em&gt; to include commodities in our strategic asset allocation product (or even in our inflation product, for which commodities are arguably (see &lt;a href=&quot;http://investments.pimco.com/Products/pages/287.aspx?ShareClassCode=D&quot; rel=&quot;noreferrer&quot;&gt;PIMCO&lt;/a&gt;) more appropriate).&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-08-26T00:38:38.450" LastActivityDate="2011-08-26T00:38:38.450" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1775" PostTypeId="2" ParentId="1772" CreationDate="2011-08-25T20:09:56.860" Score="2" Body="&lt;p&gt;In order to properly answer this question, I would ask that you also tell us:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is the &quot;skill&quot; variable continuous or discrete?  How is it actually measured?&lt;/li&gt;&#xA;&lt;li&gt;Can you put theoretical bounds on the skill?  Is it, say, between 0 and 1, or in some well-defined range?&lt;/li&gt;&#xA;&lt;li&gt;Do you expect skill to change over the next 12 months?  Is the person being measured continuing to put effort into improving his skill over time?  Does skill tend to mean-revert?&lt;/li&gt;&#xA;&lt;li&gt;Do you have any other variables which may reasonably be correlated with skill?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Until you have answered these questions, my provisional answer is that you should regress the skill on a constant, a lag, and a time trend.  I also agree with @QuantGuy's recommendation that you plot the data to see if there are any obvious patterns such as trending or mean-reversion.  You may, for example, see that skill appears to be deteriorating, in which case you may want to estimate the rate of decay using a regression of log skill on time.  Proper estimation of the dynamics of the process will help you determine both what the skill will be in the immediate future and what it will be in one year's time.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-08-25T20:09:56.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1776" PostTypeId="1" CreationDate="2011-08-25T23:23:23.753" Score="9" ViewCount="4915" Body="&lt;p&gt;I want to include the QuantLib function for option greeks calculations in my own C++ code.&#xA;My question is: can I just include those functions? I don't want to use the rest of their stuff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I obviously cannot just write:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;QuantLib::europeanOption.delta()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have included the header:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#include &amp;lt;ql/quantlib.hpp&amp;gt;&#xA;&#xA;using namespace QuantLib;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I wish they had some good documentation.&lt;/p&gt;&#xA;" OwnerUserId="1266" LastEditorUserId="35" LastEditDate="2011-08-26T01:37:33.387" LastActivityDate="2014-04-11T07:41:04.893" Title="using quantlib function in my c++ program" Tags="&lt;options&gt;&lt;quantlib&gt;&lt;programming&gt;" AnswerCount="2" CommentCount="11" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1777" PostTypeId="1" AcceptedAnswerId="2085" CreationDate="2011-08-26T00:35:31.600" Score="8" ViewCount="848" Body="&lt;p&gt;Is there any research on applying state-space or dynamic linear models to forecasting equity risk premia on a security-by-security basis with a medium term horizon (say 3 month to 12 months horizon)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Markov Models are a special case of state-space models where the states are discrete. There's an avalanche of research on these MM's and HMM's (beginning with &lt;a href=&quot;http://www.eecs.harvard.edu/~parkes/cs286r/spring08/.../RydenEtAl98.pdf&quot; rel=&quot;nofollow&quot;&gt;Ryden&lt;/a&gt; 1998) but it seems to me there are some advantages to taking an approach where the state is a continuous variable. I have seen &lt;a href=&quot;http://projecteuclid.org/DPubS?service=UI&amp;amp;version=1.0&amp;amp;verb=Display&amp;amp;handle=euclid.ss/1280841735&quot; rel=&quot;nofollow&quot;&gt;papers&lt;/a&gt; by Johannes, Lopes, and Carvalho that focus on shorter-horizons and demonstrate the superiority of PL over MCMC methods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Seems to me that this approach could capture the time-series dependence and cross-sectional dependencies in a way that traditional panel models cannot. Also, it seems that since history rhymes but does not repeat, a long-memory state-space model would be better than an HMM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before I go down this windy road I'm curious if anyone out there has already attempted this or if there is a weakness with this approach. For example, perhaps state-space or particle filtering models only work best when the forecast horizon is very short.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1355" LastEditDate="2011-09-19T18:30:42.543" LastActivityDate="2011-10-03T15:26:14.963" Title="Is there any research on applying state-space or dynamic linear models to forecasting equity risk premia?" Tags="&lt;time-series&gt;&lt;forecasting&gt;&lt;monte-carlo&gt;&lt;risk-management&gt;&lt;machine-learning&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="1778" PostTypeId="2" ParentId="1776" CreationDate="2011-08-26T01:46:01.137" Score="7" Body="&lt;p&gt;How at ease are you with programming, dynamic linking, Makefiles and the rest?   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In essence, there is no magic here. QL has a very liberal license, and you &quot;merely&quot; have to set up your project such that it finds&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;the quantlib headers (and hence Boost headers) during compilation&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;the quantlib library during linking&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;and both of those can be automated by calling &lt;code&gt;quantlib-config&lt;/code&gt; with proper flags &lt;code&gt;--clags&lt;/code&gt; and &lt;code&gt;--libs&lt;/code&gt;, respectively. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is &lt;em&gt;really&lt;/em&gt; no different than linking to any other external library.&lt;/p&gt;&#xA;" OwnerUserId="69" LastActivityDate="2011-08-26T01:46:01.137" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1779" PostTypeId="2" ParentId="1776" CreationDate="2011-08-26T14:47:11.267" Score="16" Body="&lt;p&gt;This is off-topic and maybe belongs to StackOverflow, but here goes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;1. Compile QuantLib&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best way is to open the &lt;em&gt;Visual Studio Command Prompt&lt;/em&gt; using a shortcut under Programs&amp;rarr;Microsoft Visual Studio&amp;rarr;Visual Studio Tools. Now, you need to navigate to the &lt;code&gt;QuantLib&lt;/code&gt; folder inside the folder where you have QuantLib (there are other folders such as &lt;code&gt;QuantLibXL&lt;/code&gt; &amp;ndash; that&amp;rsquo;s not the one you need.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, compile the whole of QuantLib by running the following command: &lt;code&gt;msbuild /t:Rebuild /p:Configuration=Release QuantLib_vc10.sln&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Inside this folder, if you look in the &lt;code&gt;lib&lt;/code&gt; folder, you&amp;rsquo;ll get a lib file called &lt;code&gt;QuantLib-vc&amp;lt;VER&amp;gt;-mt.lib&lt;/code&gt; and a corresponding file with a &lt;code&gt;-gd&lt;/code&gt; suffix. You need these libs as well as the headers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2. Configure headers&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right-click the project and choose Properties. Now, make sure you choose &lt;em&gt;All Configurations&lt;/em&gt; in the configuration drop-down list box on the top-left of the window. &#xA;First, navigate to ConfigurationProperties&amp;rarr;C/C++&amp;rarr;General. In the &lt;em&gt;Additional Include Directories&lt;/em&gt;, add the path to QuantLib&amp;rsquo;s directory. If you add the &lt;code&gt;&amp;lt;QL Root&amp;gt;\QuantLib&lt;/code&gt; directory, you will be able to reference QuantLib headers with statements such as &lt;code&gt;#include &amp;lt;ql/someheader.hpp&amp;gt;&lt;/code&gt;. If you did it correctly and you&amp;rsquo;re using VS2010, IntelliSense will kick in &lt;em&gt;immediately&lt;/em&gt;, meaning if you type &lt;code&gt;#include &amp;lt;ql/&lt;/code&gt;, VS will show you a helper list with headers (which is useful).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;3. Configure library references&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, navigate down to Configuration Properties&amp;rarr;Linker&amp;rarr;General. In the &lt;em&gt;Additional Library Directories&lt;/em&gt; add the path to the QuantLib&amp;rsquo;s &lt;code&gt;\lib&lt;/code&gt; directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now move down to the &lt;em&gt;Input&lt;/em&gt; header under the &lt;em&gt;Linker&lt;/em&gt; header. Edit the &lt;em&gt;Additional Dependencies&lt;/em&gt; field, prepending it with the name of the QuantLib library file &amp;mdash; you need to specify the filename (without the full path) of the &lt;code&gt;.lib&lt;/code&gt; file you need to include. The &lt;code&gt;-mt.lib&lt;/code&gt; file is used for the Release build, and the &lt;code&gt;-mt-gd.lib&lt;/code&gt; for the Debug build. If you mess these up, you'll get errors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;4. Run it&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By now, assuming you have the boost libraries in your VS &lt;code&gt;\include&lt;/code&gt; folder, the following should compile and run without problem:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;//first line is required in .NET&#xA;#include &quot;stdafx.h&quot;&#xA;#include &amp;lt;iostream&amp;gt;&#xA;#include &amp;lt;ql/quantlib.hpp&amp;gt;&#xA;&#xA;using namespace std;&#xA;using namespace QuantLib;&#xA;&#xA;void main()&#xA;{&#xA;  boost::shared_ptr&amp;lt;Money&amp;gt; m(new Money);&#xA;  cout &amp;lt;&amp;lt; m-&amp;gt;value() &amp;lt;&amp;lt; endl;&#xA;&#xA;  getchar();&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1217" LastEditorUserId="3595" LastEditDate="2013-06-18T06:53:41.973" LastActivityDate="2013-06-18T06:53:41.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1780" PostTypeId="1" AcceptedAnswerId="1782" CreationDate="2011-08-26T18:26:51.893" Score="9" ViewCount="2056" Body="&lt;p&gt;Can one use options on Treasury bond futures to hedge a typical fixed income portfolio?  If so, how can one estimate the duration for an option on a Treasury futures contract, and taking this a step further, how would one then use the duration to determine the option's contribution to the overall portfolio duration?  &lt;/p&gt;&#xA;" OwnerUserId="1269" LastActivityDate="2011-08-26T20:44:25.037" Title="Can one use options on Treasury futures to hedge a portfolio?" Tags="&lt;options&gt;&lt;futures&gt;&lt;hedging&gt;&lt;fixed-income&gt;&lt;duration&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1781" PostTypeId="2" ParentId="1780" CreationDate="2011-08-26T19:52:51.520" Score="0" Body="&lt;p&gt;Black-model deltas may be calculated on standard call and put options on Treasury bond futures.  A naive estimate of the duration of the option would be the duration of the future times the Black delta.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-08-26T20:44:25.037" LastActivityDate="2011-08-26T20:44:25.037" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1782" PostTypeId="2" ParentId="1780" CreationDate="2011-08-26T20:00:00.150" Score="4" Body="&lt;p&gt;Yes, it is definitely possible to do so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With a long fixed-income portfolio, you'd typically be buying puts on treasury futures or writing calls on them (writing calls may not be feasible if you're an institutional investor due to regulatory reasons). In general, duration for long puts/short calls would be negative. However see caveats below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typically, you might use the Black model to price the option. The duration of an option in the traditional &quot;bond&quot; sense would then be the sensitivity of the option price to the interest rates (or by implication, on the Treasury future's price itself).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a down-side though in the Black model which assumes constant interest-rate volatility while bond futures prices usually do have a time-dependent volatility - known as the pull-to-par effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use more complex interest rate models (LMM etc) but the duration would be a more complex beast to handle.&lt;/p&gt;&#xA;" OwnerUserId="1151" LastActivityDate="2011-08-26T20:00:00.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1783" PostTypeId="2" ParentId="1764" CreationDate="2011-08-28T17:21:37.167" Score="9" Body="&lt;p&gt;Whichever treasury system the banks implements it will have pieces in C/C++ and/or Java. So C++ is just easier to interface.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, as little as the difference of performance is, it does matter if you need to plug that model in a Montecarlo simulation running hundreds of scenarios -  for value at risk computation.&lt;/p&gt;&#xA;" OwnerUserId="1281" LastActivityDate="2011-08-28T17:21:37.167" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1785" PostTypeId="2" ParentId="1764" CreationDate="2011-08-28T23:18:00.770" Score="22" Body="&lt;p&gt;Garbage Collection.  The amortized performance between C++ and more modern languages is similar, but when your heap gets large, a GC can still take 100ms or more!  That's an eternity, and just isn't acceptable for anything with real-time requirements&lt;/p&gt;&#xA;" OwnerUserId="1298" LastActivityDate="2011-08-28T23:18:00.770" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="1786" PostTypeId="2" ParentId="1664" CreationDate="2011-08-29T05:02:25.930" Score="-2" Body="&lt;p&gt;Just pick up a decent econometrics book (Gujurati is what I used in school). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have multicollinearity, find a dummy variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Coefficient_of_determination#Adjusted_R2&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Coefficient_of_determination#Adjusted_R2&lt;/a&gt; &amp;lt;&amp;lt; this should be somewhat helpful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have no trading experience, so cum grano salis.&lt;/p&gt;&#xA;" OwnerUserId="1306" LastActivityDate="2011-08-29T05:02:25.930" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1787" PostTypeId="1" AcceptedAnswerId="1790" CreationDate="2011-08-29T07:30:59.030" Score="18" ViewCount="1568" Body="&lt;p&gt;High Frequency Trading (HFT) seems to be the big money making mystery machine these days. The purported source of unlimited floods of gelt pouring into the investment shops using it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For me, HFT is first of all nothing else but trading on a different (i.e. ultra short) time scale. You can make a fast buck, but you can also ruin yourself within seconds. Fast doesn't mean smart, right!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are not too many players there at the moment so markets are not completely efficient? Fine but the players that are there are the best quants with the finest pieces of technology available on this planet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question&lt;/strong&gt;&lt;br&gt;&#xA;What is the biggest differentiator of HFT at the moment (apart form the fact that it is faster)? What can you do here to outperform what you can't do on other time scales? Or is it just like it is with all the other time scales: A few winners and many losers (survivorship bias)? In short: Does quantity turn into quality because it is faster - and if yes, when and why?&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="35" LastEditDate="2012-05-02T15:41:54.473" LastActivityDate="2012-05-02T15:41:54.473" Title="HFT: What is the big differentiator in comparison to other time scales?" Tags="&lt;high-frequency&gt;&lt;quant-trading-strategies&gt;&lt;time-scale&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="1788" PostTypeId="2" ParentId="1773" CreationDate="2011-08-29T07:59:46.673" Score="3" Body="&lt;p&gt;Very informative and balanced is: &lt;br&gt;&lt;a href=&quot;http://faculty.fuqua.duke.edu/~charvey/Research/Published_Papers/P91_The_strategic_and.pdf&quot; rel=&quot;nofollow&quot;&gt;The Strategic and Tactical Value of Commodity Futures&lt;/a&gt; &lt;br&gt;by Claude B. Erb, CFA, and Campbell R. Harvey&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One well-known scientifically based passive investment fund in Germany (ARERO) draws a ratio of 15% for commodities (60% world stocks and 25% bonds, rebalanced on a yearly basis) as a conclusion out of this - see the live performance (DAX as benchmark): &lt;a href=&quot;http://www.comdirect.de/inf/fonds/detail/chart_big.html?ID_NOTATION=25521984&amp;amp;timeSpan=3M&amp;amp;chartType=CONNECTLINE&amp;amp;openerPageId=fonds.detail.chart.middle&amp;amp;BRANCHEN_FILTER=false&amp;amp;ID_NOTATION_INDEX=&amp;amp;fromDate=21.04.2011&amp;amp;toDate=21.07.2011&amp;amp;fundWithEarnings=true&amp;amp;interactivequotes=true&amp;amp;useFixAverage=true&amp;amp;fixAverage0=0&amp;amp;fixAverage1=0&amp;amp;freeAverage0=&amp;amp;freeAverage1=&amp;amp;freeAverage2=&amp;amp;chartIndicator=&amp;amp;indicatorsBelowChart=VOLUME&amp;amp;indicatorsBelowChart=&amp;amp;benchmarkNotations=20735&amp;amp;benchmarkColors=3366cc&amp;amp;selectedBenchmarks=true&amp;amp;&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-08-29T07:59:46.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1789" PostTypeId="2" ParentId="1787" CreationDate="2011-08-29T13:42:58.750" Score="9" Body="&lt;p&gt;At higher frequencies the coastline is longer. Thus you can be more selective in your entries, or trade more. And by trading more you can get a higher statistical relevance for you system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When it will stop having an edge, you will be able to stop trading it before it eats into your previous profits. ie: if each day you make 0.5%, in 80 days you will have 40%. Than disaster strikes and you lose 20% in a single day. You are still positive. There were HFT firms posting these kinds of results (but the article didn't mention if they were taking risk or just arbitraging).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can ruin yourself in seconds without proper risk control, but I don't see how that is different from other types of trading. If you fail to control your algo, you can also fail to control your lower-frequency algo or your human.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More concretely, to quote from &lt;a href=&quot;http://www.nytimes.com/2010/05/17/business/17trade.html&quot; rel=&quot;noreferrer&quot;&gt;http://www.nytimes.com/2010/05/17/business/17trade.html&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The founder of Tradebot, in Kansas City, Mo., told students in 2008&#xA;  that his firm typically held stocks for 11 seconds. Tradebot, one of&#xA;  the biggest high-frequency traders around, &lt;strong&gt;had not had a losing day in&#xA;  four years&lt;/strong&gt;, he said.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In more recent interviews he was quoted saying that they finally had a losing week :)&lt;/p&gt;&#xA;" OwnerUserId="225" LastActivityDate="2011-08-29T13:42:58.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1790" PostTypeId="2" ParentId="1787" CreationDate="2011-08-29T13:54:26.150" Score="12" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;HFT seems to be the big money making mystery machine these days.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That's not correct. By its very nature, HFT can only produce a limited amount of revenue. The big money makers are still the large hedge funds that charge 2-and-20 on their \$10B worth of assets.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;There are not too many players there at the moment so markets are not completely efficient?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;There are &lt;strong&gt;tons&lt;/strong&gt; of players in this space. Feel free to look at any job board.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;What is the biggest differentiator of HFT at the moment?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;HFT strategies operate at the tick level, and many shops use the full order book data (TotalView, OpenBook etc). That means they can act as &lt;em&gt;market makers&lt;/em&gt;, and therefore provide liquidity to the market. There are many equity shops in the US that live off the exchange rebates; search for &lt;a href=&quot;http://www.google.com/search?q=exchange%20fee%20schedule&quot;&gt;exchange fee schedule&lt;/a&gt; to see the structure at each venue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, it's not easy money. With gross returns often under 1 bps, it's a really tight model and one mistake can seriously injure the firm. There's also the &quot;arms race&quot; to out-do the competitors in speed, which is really tough by itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think we're in a period of over-expansion at the moment and we should expect to see consolidation (either bankruptcies or mergers) in the coming years, just as with any other &quot;hot&quot; industry.&lt;/p&gt;&#xA;" OwnerUserId="35" LastEditorUserId="35" LastEditDate="2011-08-30T17:43:50.050" LastActivityDate="2011-08-30T17:43:50.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1791" PostTypeId="2" ParentId="903" CreationDate="2011-08-29T14:25:11.483" Score="5" Body="&lt;p&gt;There are many portfolio optimization paradigms that include a preference for skewness.  These are generally alternatives meant to replace the modern portfolio management mean-variance framework developed by Markowitz.  Skewness (or, more generally, higher moments) are only relevant in portfolio optimization if (a) assets are not normally distributed, and (b) agents have a preference for positive skewness above and beyond their preference for a higher mean and lower volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the leading alternative paradigms which implicitly takes skewness into account is &lt;a href=&quot;http://corporate.morningstar.com/ib/documents/MethodologyDocuments/IBBAssociates/CVarOptimization.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Conditional-Value-at-Risk Optimization&lt;/a&gt;.  &lt;a href=&quot;http://www.symmys.com/node/resources/exercises-advanced-risk-and-portfolio-management&quot; rel=&quot;nofollow noreferrer&quot;&gt;Attilio Meucci&lt;/a&gt; has a (rather long) introduction to both classical and state-of-the-art portfolio optimization.  A google search for &quot;skewness preference&quot; also yields plenty of additional background on this topic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A similar question on this topic is:&#xA;&lt;a href=&quot;https://quant.stackexchange.com/q/1762/1106&quot;&gt;What is the relationship between risk aversion and preference for skewness and kurtosis in portfolio optimization?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2011-08-29T14:25:11.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1792" PostTypeId="2" ParentId="903" CreationDate="2011-08-29T17:21:47.667" Score="4" Body="&lt;p&gt;the question is very broad, Here is the brief summary of the role of all moments in portfolio optimization:&#xA;expected value- the 1st moment represents the reward. All the even higher moments&#xA;represent the likelihood of extreme values. Larger values for these moments indicate&#xA;greater uncertainty. The odd moments represent measures of asymmetry. Skewness belongs to the second category so it represents the assymmetry. Positive skewness is desirable for investors.&#xA;Skewness affects the Utility of the investor through the skewness preference. however till recently the role of higher moments in portfolio optimization was ignored in the literature. One reason for this can be the difficulties in calcualting higher moments. Becasue, to calculate the skewness or kurtosis of the portfolio the number of co-moments should be calculated.The more assets included in the portolfio, the more number of co-momnets should be calculated. On this issue I would recommend the following papers: &quot;Improved Estimates of Higher-Order Comoments and Implications for Portfolio Selection&quot; by Lionel Martellini and Volker Ziemann and &quot;Optimal Hedge Fund Allocation with Improved Estimates for Coskewness and Cokurtosis Parameters&quot; by Lionel Martellini, Asmerilda Hitaj,and Giovanni Zambruno.&lt;/p&gt;&#xA;" OwnerUserId="1179" LastEditorUserId="1179" LastEditDate="2011-08-29T20:11:07.047" LastActivityDate="2011-08-29T20:11:07.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1794" PostTypeId="2" ParentId="802" CreationDate="2011-08-29T19:53:28.860" Score="8" Body="&lt;p&gt;&lt;a href=&quot;http://www.terrapinn.com/2011/fx-investment-world/SPK-mr-fatih-YILMAZ.stm&quot;&gt;Fatih Yilmaz&lt;/a&gt;, formerly of Bank of America (currently BlueGold), has a piece called &quot;Imaginal Spreads and Pairs Trading&quot; on exactly this topic, if you can find it (I couldn't find a copy on the public internet), originally published April 17, 2009.  He writes:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Academics and industry practitioners generally concentrate on time series aspects of currency markets.&#xA;  This is primarily the result of limited number of traded currencies. Most markets for emerging currencies&#xA;  are far from ignorable frictions. Hence, if one is confined to G10 currency markets, considering that&#xA;  shocks to the USD typically account more than 50% of variations in G10 (see Figure 1), not much room is&#xA;  left for cross-sectional selection skills or market neutral strategies. Pairs trading is a market-neutral (or&#xA;  USD-neutral) strategy and it can capture different opportunities within G10 currency markets from a&#xA;  statistical point of view. Moreover, given the strategy sells winners and buys losers, it is likely to be low or&#xA;  negatively correlated with most traditional directional models (such as momentum strategy).&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Our focus in this note is to test pairs trading strategy within G10 currency markets. Our currency data set is&#xA;  monthly (end of month data obtained from Reuters and DataStream) and we use short-term money market&#xA;  rates for carry calculations (obtained from DataStream). Our data set is from 1973-2009. We take the USD&#xA;  as the numéraire currency and form 36 possible pairs using all 9 USD crosses. Our pairs-matching&#xA;  algorithm and trading strategy is described below:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;He finds:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Excess returns, Sharpe ratios and directional accuracy&#xA;  statistics generally indicate promising results. In particular, as we increase threshold misalignment&#xA;  level for trading signals, all performance statistics tend to improve. Generally speaking, misalignment&#xA;  levels around 1.5-2.0 standard deviations tend to produce consistently good results.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The Sharpe Ratios he refers to are about 0.7-0.8 for a 3M holding period.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The presented results in this note should be taken as exploratory. Nevertheless, the first set of results&#xA;  appears to be encouraging for several reasons. Performance statistics are relatively attractive and robust for&#xA;  an active G10 strategy. Especially considering that the strategy is USD neutral and the forecast horizon is&#xA;  over 25y. Moreover, the strategy is contrarian and concentrates on relative value trades. Hence, likely to&#xA;  produce low correlated returns to traditional directional currency models. If we take the presented results&#xA;  in this note at face value, then we should ask an important question: what are we being paid for?&#xA;  Transaction costs in this study are not relevant given that we used monthly data. Bankruptcy and liquidity&#xA;  risks and short sales constraints can generally be ignored for G10 currency markets. It would be interesting&#xA;  to analyse the correlation of pairs strategy returns with macroeconomic and related asset market cycles (i.e.&#xA;  time-varying risk premia for cycles). In their study, Goetzmann et. al. (2006) argue that the pairs strategy&#xA;  might be rewarding because of (hidden or latent) common factor as a main driver of the equities they&#xA;  analyse. There is always the risk of being arbitraged away; however the strategy appears to produce&#xA;  relatively robust results even in the past decade or so (when hedge fund activity increased significantly).&#xA;  Other possibilities might be that the strategy can be rewarding for pushing markets towards equilibrium via&#xA;  arbitrage trades. Given that the strategy is market neutral and relies on relative value trades, there is also&#xA;  the risk of missing strong market moves with such a strategy from a model allocation point of view. In any&#xA;  case, in our view, understanding fundamental risk-reward characteristics of such a strategy is important&#xA;  and requires further analysis in this context.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-08-29T19:53:28.860" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1795" PostTypeId="1" CreationDate="2011-08-29T20:21:46.650" Score="12" ViewCount="837" Body="&lt;p&gt;A question from one of my members.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone have experience hedging a long municipal bond portfolio using BMA / SIFMA swaps? Anything you can share regarding sizing and structuring the swap and monitoring / adjusting it over time? How effective has this swap been in different market scenarios?&lt;/p&gt;&#xA;" OwnerUserId="43" LastActivityDate="2012-07-02T12:08:53.407" Title="Hedging long municipal bond portfolio using BMA/SIFMA" Tags="&lt;hedging&gt;&lt;fixed-income&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="1796" PostTypeId="2" ParentId="1787" CreationDate="2011-08-29T21:22:04.963" Score="7" Body="&lt;p&gt;&quot;Does quantity turn into quality because it is faster - and if yes, when and why?&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yes it does. As per &lt;a href=&quot;http://www.barra.com/newsletter/nl163/SevIns3NL163.asp&quot;&gt;The Fundamental Law of Active Management&lt;/a&gt;, all else being equal the more positive expectancy bets one can make in a given time period the higher the profitability and return per unit of risk. As Adal responded, statistical significance (or lack) is increased, and depth and length of drawdown is reduced.&lt;/p&gt;&#xA;" OwnerUserId="352" LastActivityDate="2011-08-29T21:22:04.963" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1797" PostTypeId="2" ParentId="1762" CreationDate="2011-08-30T16:39:20.197" Score="4" Body="&lt;p&gt;There's a huge literature on this topic going back at least 30 years, and I am unfortunately not familiar enough with this literature to give you a great answer to your specific question.  However, I will in this answer at least try to point you in some useful directions according to what I've found thus far.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kurtosis, by the way, seems like it is not addressed directly as part of this literature, perhaps because it is too difficult to measure, or, because it is an even higher moment than skewness, perhaps we should attain a solid understanding of the first 3 moments before we move on to the fourth.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are at least 3 ways I've come across to answer the question of a relationship between risk aversion and a preference for skewness.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Cross-sectional relationship between equity skewness and average equity returns.&lt;/li&gt;&#xA;&lt;li&gt;Option-implied skewness and average option returns.&lt;/li&gt;&#xA;&lt;li&gt;Theory (e.g. Mean-CVaR optimization).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;All of these actually try to measure the amount of expected return one gives up in order to get positive skewness, or the amount one gets in exchange for negative skewness.  However, combining these estimates with popular estimates of risk aversion measured in the traditional sense could give you a precise answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some references to get you started:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.springerlink.com/content/q7443n73286v13w1/&quot; rel=&quot;nofollow&quot;&gt;Boyle and Ding (2005): Portfolio Selection with Skewness&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1807264&quot; rel=&quot;nofollow&quot;&gt;Xiong and Idzorek (2011)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://badger.som.yale.edu/faculty/ncb25/pwf_final.pdf&quot; rel=&quot;nofollow&quot;&gt;Barberis and Huang (2008)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1089071&quot; rel=&quot;nofollow&quot;&gt;Boyer, Mitton, and Vorkink (2009)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=61332&quot; rel=&quot;nofollow&quot;&gt;Harvey and Siddique (2000)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.jstor.org/pss/2977297&quot; rel=&quot;nofollow&quot;&gt;Arditti (1967)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Morningstar recently came out with a piece entitled &lt;a href=&quot;http://morningstardirect.morningstar.com/clientcomm/iss/Tsai_Real_World_Not_Normal.pdf&quot; rel=&quot;nofollow&quot;&gt;The Real World is&#xA;Not Normal: Introducing the new frontier: an alternative to the mean-variance optimizer&lt;/a&gt;.  It essentially summarizes their views on Mean-CVaR optimization, based on Xiong and Idzorek (2011).&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2012-01-04T22:11:10.573" LastActivityDate="2012-01-04T22:11:10.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1799" PostTypeId="2" ParentId="1271" CreationDate="2011-08-31T08:32:19.273" Score="5" Body="&lt;p&gt;It depends on what aspect of ZAR you are trying to take a position on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As A K pointed out, if your book is in USD and you want to take a position on the spot rate itself, then just have a USDZAR position. Yes, it is correlated with EURUSD because of both EUR-ZAR correlations and because of USD variations, but that's part of the USDZAR tradeoff. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If, instead, you want to play the ZAR internal interest rates, then choose your period and do the fx swap instead; you do a USD for ZAR exchange at the beginning and a ZAR for USD exchange at the end. Since you've set the exchange rates today at the spot and outright rates, the deal is only dependent on the interest rate differential between USD and ZAR, not on the spot rate variations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, if you do want exposure to the spot variation, you could do a ZAR IRS plus an FX option on the spot price at 1y and if you haven't needed it just do another at 1y. For a more fixed period, do a Bermudan.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, choose your instrument. There is no immovable object in finance, and you actually don't need one; if you make a basket of currencies that's really stable against market movements, you'll just have exposure to the variation of the currency of your book.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2011-08-31T08:32:19.273" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1800" PostTypeId="2" ParentId="1271" CreationDate="2011-08-31T14:20:45.443" Score="0" Body="&lt;p&gt;Pay close attention to what factors your model is actually predicting (or trying to predict).  In the case of ZAR, a good model could be identifying mispricing in the USD factor, or it could be gold, overall EM currency risk, risk tolerance, etc.  A complex model could easily be predicting all of these factors to some degree.  You should strive to hedge out only those factors for which you do not have an edge.  Isolate exposure to the risk you want, hedge out the risk you don't want.  Ideally, you will want to do this using both a theoretical understanding of how your model &lt;em&gt;should&lt;/em&gt; work as well as empirical work (backtests, regressions, etc.) confirming that this is how it works &lt;em&gt;in practice&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you have isolated your desired risk factors, using either method you mention above (regression and PCA) should work fine at eliminating undesired risks.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-08-31T14:20:45.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1802" PostTypeId="1" CreationDate="2011-08-31T17:47:22.790" Score="8" ViewCount="267" Body="&lt;p&gt;I am working on calibrating a Heston model from simulated historical stock data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After obtaining an accurate estimate of the model parameters I found very large 95% confidence intervals for these estimations if the sample size is about 10-15 years. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In view of the graph below, how would you choose the ideal sample size? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/64efn.jpg&quot; alt=&quot;kappa vs. time&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A 5-10 years period seems small since a large confidence interval means that there is a large uncertainty about the estimation. On the other hand, it appears useless to accept a sample size for which the confidence interval is small (50 years) since shorter periods provides good enough estimates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am a little confused as to how to interpret these results.&lt;/p&gt;&#xA;" OwnerUserId="539" LastEditorUserId="1106" LastEditDate="2011-08-31T18:59:37.493" LastActivityDate="2011-08-31T18:59:37.493" Title="What tradeoff is there to using an accurate estimate with a large confidence interval?" Tags="&lt;statistics&gt;&lt;estimation&gt;&lt;stochastic-volatility&gt;&lt;simulations&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1803" PostTypeId="2" ParentId="1802" CreationDate="2011-08-31T18:52:40.297" Score="2" Body="&lt;p&gt;Unless it is due to random chance, there seems to be a bias in your estimation method for $\kappa$, and this bias appears to depend on the size of the sample.  This may be revealing a deeper underlying problem with your technique that will ultimately make it clearer what the tradeoff is between accuracy and sample size.  I do not believe it should be the case that a shorter sample-size yields a more accurate estimate in a simulation where you can be certain the data generating process has not changed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, though, you will want to use as long a sample as possible over which you can be reasonably sure the underlying DGP has not changed.  I would also suggest trying to obtain higher frequency data.  Unless your time scale here is arbitrary, it will be difficult to justify an estimate based on 20+ actual years of stock market data.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-08-31T18:52:40.297" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1804" PostTypeId="1" AcceptedAnswerId="1818" CreationDate="2011-08-31T20:20:49.153" Score="14" ViewCount="2793" Body="&lt;p&gt;I have a portfolio allocation strategy I want to backtest, but I need a large &quot;universe&quot; of ETFs for it to choose from at each time period.  I was thinking of starting with a criteria such as &quot;all ETFs available in 2000&quot; or something like that to ensure sufficient data for a backtest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions as to where I can find a databse of all the ETFs out there, complete with their inception date?&lt;/p&gt;&#xA;" OwnerUserId="500" LastEditorUserId="500" LastEditDate="2011-09-01T14:05:20.910" LastActivityDate="2015-10-08T18:31:29.210" Title="Where can I find a database of ALL ETFs, sorted by age?" Tags="&lt;portfolio-selection&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1805" PostTypeId="2" ParentId="1271" CreationDate="2011-08-31T20:38:40.980" Score="4" Body="&lt;p&gt;Short answer - Use the betas from a multiple regression to create a hedged portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a single factor model (i.e. hedging with only one other currency), you can interpret the Beta as the proportion of the factor that you would need to short. So if Beta = .5 then for every 1MM you are long, you would go short $500K on your currency pair hedge. The same idea extends to multiple betas. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long answer - Naturally, a host of questions open up here -- what is the window for estimating the beta? What regression procedure to use (LAD, OLS, GLS, robust methods)? Are the currency correlations stationary? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whether to use PCA or multiple regression depends on which model is more stable. (Technical note: PCA and multiple regression assumes your errors are i.i.d. Also, the history of past returns is an approximation of Beta only if the returns are invariants - i.i.d. across time. Therefore, regressing with realized returns is not actually a true representation of the true forward distribution.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might try a rolling multiple regression test and measure the significance and consistency of the factors out-of-sample. If you do PCA, asymptotic PCA (see Stock &amp;amp; Watson 2002) is preferable for time-series with many factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, you might want to consider time-series factor analysis (see package TSFA in R) if you believe there is a latent factor structure that explains the covariance of currency pairs traded.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-08-31T21:11:07.323" LastActivityDate="2011-08-31T21:11:07.323" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1806" PostTypeId="1" CreationDate="2011-08-31T22:00:40.177" Score="14" ViewCount="1316" Body="&lt;p&gt;I recently heard the term Sugihara Trading System. I guess it might be some trading strategy or a special model to predict trends in market data, but I couldn't find out anything about it. Does anyone know what's behind this term?&lt;/p&gt;&#xA;" OwnerUserId="1003" LastActivityDate="2012-11-23T10:03:17.150" Title="What is the Sugihara Trading System?" Tags="&lt;statistics&gt;&lt;forecasting&gt;&lt;quant-trading-strategies&gt;&lt;strategy&gt;&lt;trading-systems&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1807" PostTypeId="1" CreationDate="2011-09-01T03:30:05.380" Score="18" ViewCount="5995" Body="&lt;p&gt;When market makers price options on hard-to-borrow equities, they include the cost to borrow the underlying equity that their broker is going to charge them to sell the security short to hedge. I'm trying to back-out this cost. I'm guessing it is similar to implied volatility but I'm solving for the interest rate. Can anyone point me in the right direction?&lt;/p&gt;&#xA;" OwnerUserId="892" LastEditorUserId="35" LastEditDate="2011-09-02T14:35:53.583" LastActivityDate="2017-10-16T17:59:41.167" Title="How to solve for the implied stock lending rate given equity options prices?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;equities&gt;&lt;short-selling&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="1808" PostTypeId="2" ParentId="1806" CreationDate="2011-09-01T06:41:51.140" Score="7" Body="&lt;p&gt;I don't think that it is a real applicable trading system but it is more general work concerning the connection between chaos and financial markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A good starting point is this (relatively recent) article:&lt;br&gt;&#xA;&lt;a href=&quot;http://deepeco.ucsd.edu/~george/publications/08_ecology_bankers.pdf&quot;&gt;http://deepeco.ucsd.edu/~george/publications/08_ecology_bankers.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find his publications here: &lt;a href=&quot;http://sio.ucsd.edu/Profile/gsugihara#pubs&quot;&gt;http://sio.ucsd.edu/Profile/gsugihara#pubs&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-09-01T06:41:51.140" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1809" PostTypeId="2" ParentId="1804" CreationDate="2011-09-01T08:38:29.790" Score="0" Body="&lt;p&gt;I seriously don't think such a thing exists.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recently saw an ETF specialist who was working along with his team to standardize their own database in order to be able to sell its access to the public.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's a question I've heard several times and I seriously don't think you'll find that for free anywhere.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2011-09-01T08:38:29.790" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1810" PostTypeId="1" AcceptedAnswerId="1813" CreationDate="2011-09-01T10:43:02.927" Score="13" ViewCount="5276" Body="&lt;p&gt;In all the classic texts on equities derivatives, there is an assumption of the risk-free rate &lt;i&gt;r&lt;/i&gt;. We can immediately dismiss the concept of a fixed rate; all interest rates are variable (and martingale?) in reality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But also, as is more apparent in the current crisis, currency has a cost of carry, and no counterparty is risk-free (witness the lowering of sovereign credit ratings). On the other hand, there is almost always inflation; in growth periods the inflation is driven by high base rates, and in recession it is driven by quantitative easing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can we say, then, that the risk-free rate is in fact only ever &lt;i&gt;lower&lt;/i&gt; than inflation, and that the rate is never fixed?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you disagree, in what circumstances is the risk-free rate higher than inflation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: answers appreciated, but the crux of the issue is this: how can a rate be actually risk-free if it is above inflation? That implies there is a resource which yields increasing value with no risk; but no commodity permits this? Where is the disconnect?&lt;/p&gt;&#xA;" OwnerUserId="1314" LastEditorUserId="1314" LastEditDate="2011-11-26T18:07:35.887" LastActivityDate="2012-05-30T17:54:31.650" Title="Is the risk-free rate really limited by inflation?" Tags="&lt;risk&gt;&lt;interest-rates&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1811" PostTypeId="1" CreationDate="2011-09-01T10:49:50.610" Score="17" ViewCount="404" Body="&lt;p&gt;For a long time, the dominant tenors for money market and FX instruments were 6 months and 3 months, and banks slowly moved to commercial trades at those tenors but funding overnight. If this is a step in the direction of increasingly short-term funding as trade frequencies and volumes increase, could banks move to continuous funding? That is, the book would be continuously balanced, excess lent continuously and funding performed continuously, with a continuously indexed swap instead of an Overnight Indexed Swap (OIS)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One can imagine an hourly or minute-to-minute fixing in FX already.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;[Update Sep 2012]:&#xA;Via &lt;a href=&quot;http://blog.rivast.com/?p=6180&quot; rel=&quot;nofollow noreferrer&quot;&gt;Deus Ex Macchiato&lt;/a&gt;, this from the FSOC annual report:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;Currently, triparty repo trades unwind every day, meaning that the clearing bank returns cash to the lender’s account and returns collateral to the borrower’s account. Trades are not settled until several hours later. For several hours each afternoon, dealers require funding of their entire triparty repo book that lenders do not provide. This $1.7 trillion funding need is provided by two clearing banks.&#xA;&lt;br&gt;&lt;br&gt;&#xA;This is a potentially unstable situation.&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This suggests that accounts are already balanced hourly or less.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastEditorUserId="20795" LastEditDate="2019-09-20T19:15:47.563" LastActivityDate="2019-09-20T19:15:47.563" Title="Could banks move to continuous (rather than overnight) funding?" Tags="&lt;interest-rates&gt;&lt;fx&gt;&lt;banks&gt;&lt;money-markets&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="1812" PostTypeId="2" ParentId="1807" CreationDate="2011-09-01T12:28:12.567" Score="6" Body="&lt;p&gt;The cost of the hedge does not appear directly in the price for any one option, but rather will appear as an apparent violation of put-call parity.  However, due to differing demand for puts and calls, this merely widens the arbitrage bounds ordinarily set by put-call parity, but does not imply a single implied borrow rate.  In other words, the borrow rate is an input to establishing the put-call parity bounds.  One can reverse the relationship to obtain a lower limit on the borrow rate, but an upper limit cannot be inferred.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-09-05T15:00:55.967" LastActivityDate="2011-09-05T15:00:55.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1813" PostTypeId="2" ParentId="1810" CreationDate="2011-09-01T12:37:14.300" Score="6" Body="&lt;p&gt;Take a look at historical short-term risk-free rate proxies such as Fed Funds, LIBOR, short Treasuries, and you will find plenty of periods where rates have been significantly above or below inflation (as measured by any CPI series) in the same period. In fact, controlling this difference, known as the &lt;em&gt;real&lt;/em&gt; interest rate, is the primary tool of modern central bank monetary policy.  The real rate is typically positive when inflation is considered too high, as &lt;a href=&quot;http://en.wikipedia.org/wiki/Paul_Volcker#Chairman_of_the_Federal_Reserve&quot; rel=&quot;noreferrer&quot;&gt;Volcker thought in the early 80s&lt;/a&gt;. Back then, Volcker raised Fed Funds to 20% while inflation peaked at 13.5%.  Thus this period is a clear example of when the &quot;risk-free&quot; rate is much higher than inflation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Setting a real risk-free rate above inflation is really quite simple for the government, which has near direct control over short term rates. I can understand your confusion for long term rates, though. The key idea is that in times of strong economic expansion, the market is actually quite willing to &quot;yield an increase in value with no risk,&quot; as you put it. The &quot;commodity&quot; that permits this is the overall economy. In fact, it is the present situation which is more unusual, where the economy is so weak that the market is unwilling to offer a return to investors for delaying consumption. &lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-11-26T22:44:29.460" LastActivityDate="2011-11-26T22:44:29.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1814" PostTypeId="1" CreationDate="2011-09-01T14:18:55.053" Score="8" ViewCount="449" Body="&lt;p&gt;I have a portfolio selection algorithm I want to backtest, but I don't want to limit the inputs at any point in time.  For example, I don't want to exclude the Japanese stock market, just because it hasn't done well in recent history.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally, I'll have a pool of ETFs that:&#xA;1. Cover broad market segments (i.e. &quot;US Stocks,&quot; &quot;Commodities,&quot; &quot;Precious Metals,&quot; &quot;Japanese stocks,&quot; &quot;US Real Estate.&quot; etc.)&#xA;2. Are fairly liquid&#xA;3. Have low expense ratios&#xA;4. (Most important) Closely track an index that has a long history (This allows for a longer backtest).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, SPY is perfect.  It's large, liquid, covers a major segment of the market, it has a long history, and I can substitute the S&amp;amp;P500 index if I need to go back further than the 1990's.  CEF might also be a good option, as it's large, liquid, covers gold and silver, and has a pretty long history (back to about 1986 it seems).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any other obvious choices&lt;/p&gt;&#xA;" OwnerUserId="500" LastActivityDate="2016-03-11T01:39:01.997" Title="Which ETFs should I use to test my portfolio selection algorithm?" Tags="&lt;portfolio-selection&gt;&lt;etf&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1815" PostTypeId="2" ParentId="1814" CreationDate="2011-09-01T19:08:32.477" Score="3" Body="&lt;p&gt;MSCI has country indices for developed markets going back to 1970 in many cases and a decent history for emerging markets (starting 1988).  iShares has pretty liquid ETFs for many of the most popular countries and regions, such as EAFE (EFA), Emerging Markets (EEM), Japan (EWJ), Germany (EWG), Canada (EWC), etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other major indices with very long histories include the German DAX, Japanese Nikkei 225, UK FT-30 (predecessor to FTSE), and Canada's TSX.  These indices may also serve as substitutes for the corresponding MSCI indices to backfill even more data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most popular bond index with a long history is the Barclays Aggregate (1976), which iShares also covers (AGG).  Intermediate Treasuries (IEF) and US Corporate Investment Grade (LQD) go back even further (1973).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know much about other major asset classes, such as REITs and metals, as you've mentioned, but I believe they have very long histories as well.  I'd track the main metals, such as gold and silver, directly rather than through a mixed commodity index.  I'd also add crude oil to the mix, since that, too, has a pretty long history.  The only &quot;alternative&quot; asset class you haven't mentioned is currencies.  Each major currency has its own ETF (FXE, FXY, FXB, etc.), and the currencies themselves have been freely floating since the end of Bretton Woods in 1971.  Here you would probably want to substitute DEM for EUR before 1999.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I worked on a similar project myself recently, so I believe that is all.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="848" LastEditDate="2016-03-10T22:03:53.263" LastActivityDate="2016-03-10T22:03:53.263" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1816" PostTypeId="2" ParentId="1810" CreationDate="2011-09-01T20:23:37.140" Score="2" Body="&lt;p&gt;Inflation usually has little to do with the &quot;risk-free&quot; nature of a rate. Also, interest rates &lt;em&gt;follow&lt;/em&gt; inflation rather than the other way round i.e. QE does not &quot;cause&quot; inflation. QE was performed because inflation was too low in the first place and the interest rates had to be artificially lowered &quot;below&quot; the 0-0.25% range as the real interest rate (ie nominal rate-inflation rate) was too high making it harder to borrow money. Similarly, in a growing economy, it is the narrowing output gap that causes high inflation - not the &quot;base rate&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most recent example of a risk free rate being higher than inflation is of the early period in the current recession. The inflation rate was negative while the Federal Funds target was 0-0.25% &lt;a href=&quot;http://www4d.wolframalpha.com/Calculate/MSP/MSP277819h32f8138ca0h2000001d27hg6g82060fe2?MSPStoreType=image/gif&amp;amp;s=15&amp;amp;w=496&amp;amp;h=202&amp;amp;cdf=Coordinates&amp;amp;cdf=Tooltips&quot; rel=&quot;nofollow&quot;&gt;http://www4d.wolframalpha.com/Calculate/MSP/MSP277819h32f8138ca0h2000001d27hg6g82060fe2?MSPStoreType=image/gif&amp;amp;s=15&amp;amp;w=496&amp;amp;h=202&amp;amp;cdf=Coordinates&amp;amp;cdf=Tooltips&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1151" LastActivityDate="2011-09-01T20:23:37.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1817" PostTypeId="2" ParentId="1795" CreationDate="2011-09-01T21:11:35.337" Score="3" Body="&lt;p&gt;(1) Assuming the portfolio comprises mostly senior VRDOs or comparable muni-floaters, one way of sizing a SIFMA-indexed swap would be to find the historical root-mean-square volatility of the  coupon fixings of the portfolio constituents and weight them by their percentage nominal to get a proxy for the portfolio volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do the same for the SIFMA index. The ratio of the two volatilities can then be used a scaling factor for sizing the swap. (NB: This is certainly not the best way to do it, but just a useful method to get a &quot;feel&quot; for the swap size).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) With fixed-rate munis, the regular key-rate durations-based swap-hedging method should be applicable (ie calculate the dollar-duration of your portfolio with respect to rates for key tenors and then swap that fixed-rate exposure for a floating one).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(3) With subordinated debt and a collateralized swap, the credit quality of your portfolio (assuming part of it is pledged as collateral) comes into play - you might end up paying a massive &lt;em&gt;fixed&lt;/em&gt; basis over the par swap rate which will obliterate the advantage gained by hedging the volatility of the floating rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(4) As far as adjustment of the swap goes: at each reset period, see if you can get a &quot;cheaper&quot; basis above par-swap rate if the floating-rate volatility or credit quality of your portfolio change over the reset period.&lt;/p&gt;&#xA;" OwnerUserId="1151" LastActivityDate="2011-09-01T21:11:35.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1818" PostTypeId="2" ParentId="1804" CreationDate="2011-09-01T21:56:05.893" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://finance.yahoo.com/etf/browser/op?c=0&amp;amp;k=9&amp;amp;f=0&amp;amp;cs=1&amp;amp;ce=20&amp;amp;o=a&quot; rel=&quot;nofollow noreferrer&quot;&gt;Yahoo! Finance&lt;/a&gt; allows you to list all ETFs and sort by inception date or size.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Considering your &lt;a href=&quot;https://quant.stackexchange.com/q/1814/1106&quot;&gt;follow-up question&lt;/a&gt;, though, I think you are asking the wrong question here.  ETFs are a relatively recent innovation. Only 32 of these ETFs were around in 2000.  For example, the Russell 2000 ETF (IWM), today's third most actively traded ETF overall, was only introduced in May 2000, thus missing your cutoff date.  The CBOE only started listing options on SPY in 2006, and now it is one of the most liquid and popular options series.  If your real goal is to backtest an ETF strategy, then think first about what indices/asset classes belong in your backtest then see what ETFs match those choices best.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, start with what is most actively traded today.  Unlike single stocks, a backtest involving index ETFs is not subject to backfill bias (a.k.a. survivorship bias) in quite the same way.  Instead, you'll have to think hard about whether the index on which the ETF is based could reasonably have been considered one of a handful of popular indices as of your backtest date.  Russell 2000 (EF: IWM) and MSCI EAFE (ETF: EFA) can reasonably be considered survivor-bias free index choices as of at least 1990, but Brazil (ETF: EWZ) wasn't on most people's radar until some time in the 2000s.  This is despite the fact that their ETFs were all created around the same time.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2011-09-01T22:12:30.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1819" PostTypeId="2" ParentId="1810" CreationDate="2011-09-02T05:01:06.063" Score="0" Body="&lt;p&gt;Risk-free interest should never go negative, so in a period of deflation the risk-free interest should be higher than the negative inflation rate.&lt;/p&gt;&#xA;" OwnerUserId="1328" LastActivityDate="2011-09-02T05:01:06.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1820" PostTypeId="1" CreationDate="2011-09-02T05:11:27.123" Score="7" ViewCount="4144" Body="&lt;p&gt;I would like to ask &quot;how to do GARCH modelling on stata&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically I want to estimate stock market volatility using daily data. I have one variable as return series, $r_t=\ln(\frac{P_t}{P_{t-1}})$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need a step by step explanation. &lt;/p&gt;&#xA;" OwnerUserId="1329" LastEditorUserId="467" LastEditDate="2011-09-02T08:40:08.670" LastActivityDate="2013-12-06T01:14:22.430" Title="Garch modelling on Stata" Tags="&lt;volatility&gt;&lt;garch&gt;" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="1821" PostTypeId="2" ParentId="1820" CreationDate="2011-09-02T08:37:43.633" Score="4" Body="&lt;p&gt;You need to find the values of the GARCH parameters which fit best your data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To do so, you usually create a function simulating a GARCH simulation taking, as input the parameters, and you run it through an optimizer to that the sum of the squares of the differences of the simulations points and the sample points are minimal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that it will not give you a number (&lt;em&gt;the&lt;/em&gt; volatility, which is not very useful), it will give you a time series of the volatility for each data point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, beware that this is just a model, it is not &lt;em&gt;the ultimate answer&lt;/em&gt;. Try looking at different GARCH versions on the &lt;a href=&quot;http://en.wikipedia.org/wiki/Autoregressive_conditional_heteroskedasticity&quot; rel=&quot;nofollow&quot;&gt;wiki page&lt;/a&gt; if you need to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt;&#xA;This is the manual way of doing it. You have packages available in R and MATLAB who handle all that for you, it might exist in Stata.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2011-09-02T08:37:43.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1822" PostTypeId="2" ParentId="1820" CreationDate="2011-09-02T10:09:58.673" Score="5" Body="&lt;p&gt;I don't use Stata often, but the &lt;code&gt;help()&lt;/code&gt; function is typically very good. Try &lt;code&gt;help(garch)&lt;/code&gt;. It looks like the command is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;garch _depvar_ _indepvars_ _options_&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the help &lt;a href=&quot;http://www.stata.com/manuals13/tsarch.pdf#tsarchRemarksandexamples&quot; rel=&quot;nofollow&quot;&gt;page&lt;/a&gt; on the web.&lt;/p&gt;&#xA;" OwnerUserId="106" LastEditorUserId="5680" LastEditDate="2013-12-06T01:14:22.430" LastActivityDate="2013-12-06T01:14:22.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1823" PostTypeId="2" ParentId="1664" CreationDate="2011-09-02T14:04:27.170" Score="2" Body="&lt;p&gt;I think you're looking for a metric that quantifies the effectiveness of the added variable(s). Objectively, you want each variable to have correlation to your model estimation output and non-correlation between other variables that may be utilized. If you adjust your $R^2$ metric accordingly (less degrees of freedom per variable) you'll get a reasonable feel for where the limit is for adding more variables (otherwise $R^2$ will just increase and you're back to asking the same question). &lt;/p&gt;&#xA;" OwnerUserId="1331" LastEditorUserId="1106" LastEditDate="2011-09-02T14:15:28.640" LastActivityDate="2011-09-02T14:15:28.640" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1824" PostTypeId="1" AcceptedAnswerId="1906" CreationDate="2011-09-02T17:13:16.680" Score="8" ViewCount="758" Body="&lt;p&gt;I am designing an asset allocation strategy/fund which invests in four asset classes (via four independent sub-funds):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Domestic equity&lt;/li&gt;&#xA;&lt;li&gt;International equity&lt;/li&gt;&#xA;&lt;li&gt;Domestic fixed income&lt;/li&gt;&#xA;&lt;li&gt;Foreign currencies&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The strategy must be fully invested in these four funds at all times.  I already have a default &quot;strategic&quot; allocation to the four funds based on our baseline views for the performance of the four asset classes.  The managers of the strategy may, at times, have tactical views on relative value between&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Domestic equity and fixed income&lt;/li&gt;&#xA;&lt;li&gt;International and domestic equity&lt;/li&gt;&#xA;&lt;li&gt;The broad direction of foreign currencies (relative to USD)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Managers express their tactical views discretely on a 5-point scale from &lt;em&gt;strong sell&lt;/em&gt; to &lt;em&gt;strong buy&lt;/em&gt; (where buy/sell refers to the first of the two asset classes in the pairings).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The catch is that the view on international vs. domestic equity relative value is best seen as a view on currency-hedged relative returns, whereas the international equity fund is not currency hedged.  The currency fund's holdings do not correspond exactly to the currency exposures of the international fund, but they are &lt;em&gt;close&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My job is to research how and how much to shift from one fund to another in response to the manager's views.  For the purposes of this problem, it is reasonable to assume we have standard mean-variance preferences.  I must also take into account transaction costs, which are rather large.  Hence tactical moves must be relatively long-lived and stable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas on how to approach this problem?  How should I calculate the tradeoffs between various asset classes?&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-09-09T18:33:08.013" LastActivityDate="2011-09-14T00:02:46.970" Title="How to shift amongst asset classes in response to relative value views?" Tags="&lt;portfolio-management&gt;&lt;asset-allocation&gt;&lt;tactical-asset-allocation&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1825" PostTypeId="5" CreationDate="2011-09-02T17:17:36.207" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2011-09-02T17:17:36.207" LastActivityDate="2011-09-02T17:17:36.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1826" PostTypeId="4" CreationDate="2011-09-02T17:17:36.207" Score="0" Body="An investment strategy that attempts to balance risk versus reward by adjusting the percentage of each asset in an investment portfolio according to the investors risk tolerance, goals and investment time frame." OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-09-02T17:51:30.627" LastActivityDate="2011-09-02T17:51:30.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1827" PostTypeId="5" CreationDate="2011-09-02T17:18:28.403" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2011-09-02T17:18:28.403" LastActivityDate="2011-09-02T17:18:28.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1828" PostTypeId="4" CreationDate="2011-09-02T17:18:28.403" Score="0" Body="An active management portfolio strategy that rebalances the percentage of assets held in various categories in order to take advantage of market pricing anomalies or strong market sectors." OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-09-02T17:51:32.657" LastActivityDate="2011-09-02T17:51:32.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1829" PostTypeId="2" ParentId="235" CreationDate="2011-09-02T21:00:54.677" Score="4" Body="&lt;p&gt;First of all, the delta is not the probability of the option in the black scholes model,&#xA;it is instead the closely related N(d2) (binary probability)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly, the black scholes model gives risk neutral probabilities - for a binary event this is ok, but it gives no correct measure of, say, how far you would be through&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thirdly, the options you are interested in are traded in the market - they are called binary no touch or one touch options ... there are several mechanisms to price, depending on your model for volatility ... black scholes pricers for them are available online, eg here&#xA;&lt;a href=&quot;http://www.volopta.com/Matlab.html&quot; rel=&quot;nofollow&quot;&gt;http://www.volopta.com/Matlab.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1334" LastActivityDate="2011-09-02T21:00:54.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1830" PostTypeId="1" CreationDate="2011-09-03T11:36:51.600" Score="8" ViewCount="1538" Body="&lt;p&gt;I m doing my research on estimating Value at risk using different assumptions on volatility and then compare my results based on backtesting.&#xA;I obtained results and just on question based on my results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The different models estimates accurately in 5% confidence level rather than 1%.. Is it common result? Because the same model rejected in 1% but accepted in 5%..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="1335" LastActivityDate="2011-09-04T09:16:42.313" Title="Value at Risk backtesting (kupiec)" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;coherent-risk-measure&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1831" PostTypeId="2" ParentId="1830" CreationDate="2011-09-04T09:16:42.313" Score="5" Body="&lt;p&gt;It is common.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The smaller the tail area you are considering the harder it is to be right because the effect of the assumption on the distribution becomes more important.  Think about it in the other direction: if your level is 50%, then pretty much any distributional assumption will do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other issue is the length of the time horizon.  As the horizon expands practical amounts, there is even more sensitivity to the model.  What I found in &lt;a href=&quot;http://www.burns-stat.com/pages/Working/varunigar.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.burns-stat.com/pages/Working/varunigar.pdf&lt;/a&gt; was that 10 day horizons demand exceptionally good models -- moving from 1 day to 10 days is much harder than moving from 5% to 1% tail areas.&lt;/p&gt;&#xA;" OwnerUserId="249" LastActivityDate="2011-09-04T09:16:42.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1832" PostTypeId="1" CreationDate="2011-09-04T14:14:11.480" Score="24" ViewCount="9364" Body="&lt;p&gt;Market making often requires placing and canceling a lot of orders.  You have to buy and sell nearly simultaneously, so you need to move orders pretty often to beat other traders.  But I would like to optimize my strategy,  minimizing the number of orders placed while maximizing the total volume of deals.  Otherwise I will pay for each unmatched order. Are there any well-known optimizations? I've invented several optimizations myself.  For example, one technique is to ignore orders with volume less than certain amount.  But I'm sure there are a lot of optimization techniques already invented by someone else and I just need to find them.&lt;/p&gt;&#xA;" OwnerUserId="1337" LastEditorUserId="2299" LastEditDate="2012-04-18T01:57:38.357" LastActivityDate="2016-02-01T00:24:44.080" Title="Techniques to optimize the placement of orders in market making strategy?" Tags="&lt;quant-trading-strategies&gt;&lt;automated-trading&gt;&lt;optimization&gt;&lt;market-making&gt;&lt;market-microstructure&gt;" AnswerCount="4" CommentCount="10" FavoriteCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="1833" PostTypeId="1" AcceptedAnswerId="1935" CreationDate="2011-09-05T12:55:07.763" Score="18" ViewCount="1009" Body="&lt;p&gt;One of the greatest achievements of modern option pricing theory is finding corresponding dynamical trading strategies in linear instruments with which you can replicate and by that price derivative instruments; of course the most prominent example being Black Scholes and dynamic hedging.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder concerning another trading strategy, the &lt;a href=&quot;http://www.cs.princeton.edu/courses/archive/spr08/cos511/scribe_notes/0428.pdf&quot;&gt;constant rebalanced portfolio (CRP)&lt;/a&gt;, what a corresponding derivative would look like:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How would the payoff diagram and resulting return distribution look like?&lt;/li&gt;&#xA;&lt;li&gt;How to price it (in a BS world for a start)?&lt;/li&gt;&#xA;&lt;li&gt;How to statically hedge it with plain vanilla options?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I think this will be especially interesting since it is a well known fact that (under appropriate assumptions) a CRP uses the volatility component to shift the drift upwards (unlike most other trading strategies which leave the drift unchanged but only form the return distribution differently). Therefore volatility is not only an element of risk but of chance too. I want to fully understand this phenomenon, also known as volatility pumping, by using the machinery of option theory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you have any literature concerning this topic (I found none) or any ideas and hints where to start?&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-09-16T02:56:55.953" Title="Duality between constant rebalanced portfolio (CRP) and corresponding derivative" Tags="&lt;option-pricing&gt;&lt;hedging&gt;&lt;replication&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="1834" PostTypeId="1" CreationDate="2011-09-05T15:32:38.683" Score="11" ViewCount="3122" Body="&lt;p&gt;I trade on local exchanges in Europe, but my HFT strategies need S&amp;amp;P 500 e-mini futures data (ES). I don't need to trade ES, but I need real-time data and I want to have it as fast as possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried &lt;a href=&quot;http://www.zen-fire.com/&quot; rel=&quot;noreferrer&quot;&gt;http://www.zen-fire.com/&lt;/a&gt; and it works fine, but probably something better exist?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or maybe (just maybe...) I can use another instrument that located somewhere in Europe and has a good correlation with ES?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I only need &quot;last deal price&quot; if this is important.&lt;/p&gt;&#xA;" OwnerUserId="1337" LastEditorUserId="1531" LastEditDate="2012-08-02T05:19:16.127" LastActivityDate="2014-06-30T09:16:17.033" Title="Real-time &amp; Fast S&amp;P 500 E-Mini Futures (ES) Data" Tags="&lt;data&gt;&lt;automated-trading&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1835" PostTypeId="2" ParentId="36" CreationDate="2011-09-05T15:35:50.653" Score="4" Body="&lt;p&gt;An Axioma research paper from August 2011, &lt;a href=&quot;http://www.axiomainc.com/downloads/AxiomaMultipleRiskModelCaseStudy20110801.pdf&quot; rel=&quot;nofollow&quot;&gt;Using Multiple Risk Models for Superior&#xA;Portfolio Management… A Practice Not Just For Quants&lt;/a&gt;, answers exactly your question, I believe.  Note the graphs at the top of page 8.  They compare their medium-horizon fundamental and statistical factor models from January 2008 to January 2009.  At the start of the period, they find about 30% of active risk comes from common fundamental factors (as a % of variance), with the rest accounted for by stock-specific factors.  The corresponding figure for statistical factors is 40%.  During the 2008-2009 crisis, this figure rose to as high as 50% for fundamental factors and close to 70% for statistical factors.  Other research included in this paper suggests these numbers would have been even higher for their short-horizon risk models.  I would guess that common risk proportion decreased to levels similar to early 2008 more recently, and may even be lower than that over longer horizons.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe that over the last 3 years or so the $R^2$ of a regression of actual returns on model returns was in the low 30s % using the medium-horizon fundamental factor model, which generally agrees with their data and implies that common risk proportion continued to decline into 2009 and 2010.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Addendum:&lt;/strong&gt; The previous research concerned the $R^2$ for daily returns, which was the essence of your question.  However, some additional research shows that the &lt;em&gt;monthly&lt;/em&gt; $R^2$ is much higher, currently at around 60%, and has been trending higher for some time now. In 1995 the $R^2$ was consistently under 20%.  In 2000 it was 20-30%, occasionally increasing to over 40% during crisis periods.  Even during the relatively calm mid-2000s $R^2$ was consistently between 30% and 40%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many people today talk about there being a &quot;correlation bubble&quot; in equities, but considering how long these trends have gone on, I'd be surprised to find the $R^2$ drop to anywhere near the 1990s levels any time soon.  Henceforth I think we can rely on at least 40% (30%) of monthly (daily) returns being attributable to various broad factors, possibly much higher.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW, besides the overall market itself, the most significant factors are industry, size, momentum, and volatility.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-09-15T17:39:25.157" LastActivityDate="2011-09-15T17:39:25.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1836" PostTypeId="1" CreationDate="2011-09-05T17:21:14.440" Score="14" ViewCount="2234" Body="&lt;p&gt;I have some market data (daily time series) for bond prices and CDS indices and I would like to generate synthetic versions of these which are statistically &quot;similar&quot; for testing trading strategies. Is there literature on this subject?&lt;/p&gt;&#xA;" OwnerUserId="1340" LastActivityDate="2012-03-09T01:07:40.657" Title="Literature on generating synthetic time series for testing" Tags="&lt;data&gt;&lt;time-series&gt;&lt;backtesting&gt;&lt;market-data&gt;&lt;simulations&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="1837" PostTypeId="2" ParentId="1834" CreationDate="2011-09-05T18:17:21.037" Score="9" Body="&lt;p&gt;In terms of pricing, Zen-Fire seems to be the best &quot;retail&quot; solution. But as you said, you need to be faster, so you can try some faster and more serious options:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.quanthouse.com/&quot;&gt;QuantHouse&lt;/a&gt; - CME's Level 1 market data will cost you around 1500 Euros per month. They have points of presence in most local financial centers in Europe (Stockholm, Frankfurt, etc.) so you can colocate near to them, if you wish. They aslo operate their own fiber network, so you will get your stuff from USA very fast.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.fixnetix.com/&quot;&gt;FixNetix&lt;/a&gt; - All the same, actually :) Maybe some little differences in pricing.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Regarding your question about higly correlated instruments - i do not know any, and as i know, S&amp;amp;P500 Index futures (big and e-mini) is traded only on CME and somewhere in Asia (am I wrong?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best regards,&#xA;Dmitry&lt;/p&gt;&#xA;" OwnerUserId="1341" LastActivityDate="2011-09-05T18:17:21.037" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1838" PostTypeId="2" ParentId="1834" CreationDate="2011-09-05T22:21:45.747" Score="5" Body="&lt;p&gt;You can get free real-time S&amp;amp;P 500 CFD data from a forex broker like FXCM. You can open a demo account and test the quality of the feed through their API. Note that it's a CFD, so there are some small differences to ES. The quality is probably not as good as Zen-Fire.&lt;/p&gt;&#xA;" OwnerUserId="225" LastActivityDate="2011-09-05T22:21:45.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1839" PostTypeId="2" ParentId="1834" CreationDate="2011-09-06T03:15:53.150" Score="1" Body="&lt;p&gt;You can get this data streamed real-time from IQFeed. Should be easily less than $100/month.&lt;/p&gt;&#xA;" OwnerUserId="1344" LastActivityDate="2011-09-06T03:15:53.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1840" PostTypeId="2" ParentId="1811" CreationDate="2011-09-06T06:11:46.833" Score="5" Body="&lt;p&gt;Overnight funding is made through an auction, a fixing as you name it and it is achieved successfully (usually, i.e. when Lehman Brothers doesn't go bankrupt) because of the huge amounts on BOTH sides of this auction (i.e. liquidity).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do an auction every minute, you will have more volatility as prices will potentially vary every minute and there will be less liquidity, this is definitely not something Back Office should handle (because it's basically Trading). I cannot really imagine the situation if we add arbitrageurs in the middle of this, things would get really messy.&lt;/p&gt;&#xA;" OwnerUserId="1181" LastActivityDate="2011-09-06T06:11:46.833" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1841" PostTypeId="2" ParentId="1836" CreationDate="2011-09-06T06:30:18.300" Score="4" Body="&lt;p&gt;The easiest answer which comes to my mind is generating &lt;strong&gt;correlated time series&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a good description of the process in Part 3 of this document :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.columbia.edu/~mh2078/MCS04/MCS_framework_FEegs.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.columbia.edu/~mh2078/MCS04/MCS_framework_FEegs.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you base your correlation input on the correlation observed in the market data you should obtain &quot;statistically&quot; similar time series.&lt;/p&gt;&#xA;" OwnerUserId="1181" LastActivityDate="2011-09-06T06:30:18.300" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1842" PostTypeId="2" ParentId="1832" CreationDate="2011-09-06T06:44:28.200" Score="9" Body="&lt;p&gt;I don't know if you can really improve, the point of Market Making is that you don't know when you'll be executed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It also depends a lot on the type of product you're trading, it's not the same business Market Making far from the money options (where you will never be executed but just offer a reference price and answer traders phone calls) and MM on Bonds/ETF/Futures....&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could :&#xA;- Stop moving price if price moves too often without actual trades&#xA;- Move the price only when the Mid moves significantly (refer to the Bid Price if you want to specify an Ask price)&#xA;- Move the price only if a certain amount (say more than 1000 lots) is better priced than you&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no magic, either you filter market moves and get less executions or you prefer making trade volume and lose margin by cancelled orders or prices too close to the mid. The closer you want to be to the mid the less margin you will have.&lt;/p&gt;&#xA;" OwnerUserId="1181" LastActivityDate="2011-09-06T06:44:28.200" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1843" PostTypeId="2" ParentId="1807" CreationDate="2011-09-06T19:09:04.290" Score="6" Body="&lt;p&gt;As 'sheegaon' suggested, you can solve for an implied interest rate -- which is not necessarily the cost of borrowing the underlying stock -- using put-call parity.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you probably know, an implied volatility algorithm increases and decreases its implied volatility guess until the theoretical price and market prices of an option converge. Similarly, to imply options' interest rate and implied volatility, take a put and call pair with the same strike and expiration, and increase or decrease their interest rate and implied volatility inputs until put-call parity holds and the put and call theoretical and market prices converge.  In building such algorithms, I take advantage of the property that puts have positive and calls have negative sensitivity to interest rates, while both calls and puts have positive sensitivity to implied volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that put-call pairs of different strikes or expirations often imply different rates.  &lt;/p&gt;&#xA;" OwnerUserId="1052" LastActivityDate="2011-09-06T19:09:04.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1844" PostTypeId="2" ParentId="1238" CreationDate="2011-09-06T19:24:08.417" Score="4" Body="&lt;p&gt;Book:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/047068576X&quot; rel=&quot;nofollow&quot;&gt;Counterparty Credit Risk: The new challenge for global financial markets&lt;/a&gt; by Jon Gregory&lt;/p&gt;&#xA;" OwnerUserId="1348" LastEditorUserId="1106" LastEditDate="2011-09-06T19:51:53.173" LastActivityDate="2011-09-06T19:51:53.173" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1845" PostTypeId="2" ParentId="1238" CreationDate="2011-09-06T20:59:42.447" Score="2" Body="&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/3642044530&quot; rel=&quot;nofollow&quot;&gt;Modelling, Pricing, and Hedging Counterparty Credit Exposure: A Technical Guide (Springer Finance)&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1183" LastActivityDate="2011-09-06T20:59:42.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1847" PostTypeId="1" CreationDate="2011-09-07T04:18:15.760" Score="16" ViewCount="5596" Body="&lt;p&gt;I am guessing the short answer to this question is &quot;use the chain rule and linearity of the derivative,&quot; but I am looking for more specific advice on how to compute the derivatives of a VIX futures contract. Roughly speaking, the VIX index represents a rolling weighted position in a bunch of S&amp;amp;P call &amp;amp; put options at different strikes.  Generally speaking, one cannot buy and sell spot VIX, but there are VIX futures contracts. I would like to be able to compute the sensitivity of the price of the futures contract to: the price of the underlying (in this case the S&amp;amp;P index), volatility of the underlying, change in volatility of the underlying, the risk-free rate, and time. &lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2012-03-07T16:59:21.577" Title="How can one compute the Greeks on VIX Futures" Tags="&lt;option-pricing&gt;&lt;futures&gt;&lt;vix&gt;&lt;greeks&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1848" PostTypeId="2" ParentId="1847" CreationDate="2011-09-07T05:23:54.790" Score="6" Body="&lt;p&gt;Short Answer : Futures don't have Greeks&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long Answer : Assuming a non strictly mathematical (i.e. false) point of view.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well, having Greeks on VIX Futures is not relevant, VIX value is itself a &quot;Greek&quot; (and Futures don't have Greeks).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sensitivity to&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Price of the Underlying : Insensitive (ν = 0)&lt;/li&gt;&#xA;&lt;li&gt;Volatility of the Underlying : Delta Δ = 1 (to Volatility of S&amp;amp;P Option Combination used to compute VIX)&lt;/li&gt;&#xA;&lt;li&gt;Change in Volatility of the Underlying : Gamma Γ = 1&lt;/li&gt;&#xA;&lt;li&gt;Risk Free Rate : Same than any other kind of future&lt;/li&gt;&#xA;&lt;li&gt;Time : 0 (Θ = 0)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Volatility of VIX should be Vega of S&amp;amp;P Option Combination used to compute VIX&#xA;Vega of VIX should be Vomma of S&amp;amp;P  Option Combination used to compute VIX&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can compute the Greeks on the VIX Options, it would be more relevant, but don't expect relationships with the S&amp;amp;P Volatility/Prices, VIX is much more complex than simple plain Volatility of S&amp;amp;P.&lt;/p&gt;&#xA;" OwnerUserId="1181" LastEditorUserId="1181" LastEditDate="2011-09-07T15:55:46.830" LastActivityDate="2011-09-07T15:55:46.830" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1849" PostTypeId="1" CreationDate="2011-09-07T13:21:50.063" Score="25" ViewCount="7872" Body="&lt;p&gt;When holding vanilla options, you can cancel out, theoretically, all risk with dynamic (delta) hedging. Then you earn the &quot;risk free rate of return&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why would you make such a portfolio when you can simply buy a bond that earns the &quot;risk free rate of return&quot;?&lt;/p&gt;&#xA;" OwnerUserId="1352" LastEditorUserId="1106" LastEditDate="2011-09-07T18:34:28.243" LastActivityDate="2020-04-19T08:16:15.877" Title="Why hold options when you can dynamically replicate their payoff?" Tags="&lt;options&gt;&lt;hedging&gt;&lt;black-scholes&gt;&lt;replication&gt;&lt;theory&gt;" AnswerCount="5" CommentCount="2" FavoriteCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="1850" PostTypeId="1" CreationDate="2011-09-07T13:33:50.467" Score="12" ViewCount="303" Body="&lt;p&gt;The question is inspired by yesterday's (06/09/11) historic announcement by the Swiss National Bank that it would impose a ceiling on the franc of 1.20 against the euro.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to know if there are any standard models to value currency options and quantos when the currency exchange rate is effectively capped by the central bank. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anyone point to good readable references? A quick web search did not show anything relevant.&lt;/p&gt;&#xA;" OwnerUserId="70" LastEditorUserId="1106" LastEditDate="2011-09-12T15:41:10.117" LastActivityDate="2011-09-12T15:41:10.117" Title="How should FX options be priced when a currency is artificially capped?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;fx&gt;&lt;models&gt;&lt;reference-request&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1851" PostTypeId="2" ParentId="1849" CreationDate="2011-09-07T13:38:48.950" Score="17" Body="&lt;p&gt;Short Version :&#xA;Two main uses&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;I'm doing an arbitrage/statarb strategy (volatility for instance) which should not be dependant on the Delta (I'm an arbitragist).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I HAVE to keep a product in my portfolio, but I don't want to be EXPOSED to it (I'm a market maker).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Long Version :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The goal of Dynamic Hedging is not down the line to earn risk free rate of return. You are probably talking about a Delta Hedge, Delta is not the only Greek you can hedge, you could hedge over Parameters, but I assume you're talking about Delta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I'm an option trader, I can basically Buy or Sell Volatility, I will hedge my Delta at the start of the day (Usually before the close of the day before). But I will gain money on the day after if realized Volatility is Higher than Implied Volatility if I'm a Volatility Buyer (and vice versa). Pay off of the strategy below :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/DrGB4.png&quot; alt=&quot;Gamma Trading&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I need dynamic hedging, which if done every minute will provide me risk free interest rate minus fees (i.e. probably negative return), if I do it once a day I will realize profit that is not related to the direction of the change of the underlying but rather it's intensity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Other businesses in Finance need to Hedge Frequently as they are not supposed to have a directionnal bias on the market, most notably Market Makers and Liquidity Suppliers. Sometimes you also need to keep some position you can't sell, like an OTC swap, in your portfolio, you probably want a very good hedge on this.&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="1181" LastEditorUserId="1181" LastEditDate="2011-09-07T14:50:34.673" LastActivityDate="2011-09-07T14:50:34.673" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1852" PostTypeId="2" ParentId="1849" CreationDate="2011-09-07T14:23:28.853" Score="5" Body="&lt;p&gt;You have to &lt;strong&gt;differentiate here between the risk-taking and the market-making side&lt;/strong&gt;. As a risk-taker, like e.g. a hedge-fund, you are right, you could just buy the bond!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But as a market-maker you sell these options but don't want to bear the risk, so you have to counterbalance it. You could of course counterbalance it with another option which would be the best case when you find another customer as the counterparty (you would earn double here). Another market-maker as your counterparty would not be a good idea since it is too expensive (he wants to earn something too!).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you have a &lt;strong&gt;completely different business model here: As a market-maker you live on the spread&lt;/strong&gt; but don't want to bear risks. The risk-taker lives on some kind of model or edge but has to assume adequate risks as a consequence.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-09-07T14:23:28.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1853" PostTypeId="2" ParentId="1849" CreationDate="2011-09-07T15:13:47.340" Score="6" Body="&lt;p&gt;I think there is an error implicit in your question.  Dynamic delta hedging, even assuming the underlying process is a continuous martingale and trading entails zero transaction costs, only eliminates the &lt;strong&gt;directional risk&lt;/strong&gt;.  A number of residual risks remain, most notably &lt;strong&gt;volatility risk&lt;/strong&gt;, embodied in both the gamma and vega.  A dynamically hedged portfolio of stock and option will only yield the risk-free rate if the realized volatility equals the implied volatility at which the option was purchased.  Actual P&amp;amp;L from the portfolio will differ from the risk-free rate if realized differs from implied (gamma risk) or if the implied volatility in the market for similar options changes (vega risk).  In addition, some interest rate risk (rho) will also remain.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the Black-Scholes derivation assumes that changes in volatility are only functions of time and underlying (spot) price.  Thus, even in the theoretical limit of continuous hedging, one would still want to trade options to take a view on unexpected changes in volatility (or on differences between their expectation and the market's expectation of volatility).&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-09-07T15:13:47.340" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1854" PostTypeId="2" ParentId="1685" CreationDate="2011-09-08T02:26:00.907" Score="19" Body="&lt;p&gt;All HFTs are event driven. In the most basic sense, they have some model that is a function of order book events. For every order book event the model calculates some micro price that is the HFTs perceived fair value. This is often a function of the current bid, ask, depth, last n trade prices, inventory, etc. Given the most up to date view of fair value, the HFT will be adjust orders in the market. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can imagine, the rate of events for order book data is very high. This results in a very high scratch rate (cancel to fill ratio) because the HFT is adjusting their orders at a rate similar (but not equal to) the event arrival rate for a given stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The likelihood that there are shenanigans going on is non-zero. However, the use of said shenanigans is not wide spread, IMO.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2011-09-08T02:26:00.907" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1855" PostTypeId="2" ParentId="325" CreationDate="2011-09-08T11:20:00.557" Score="38" Body="&lt;p&gt;I'll just add that with Interactive Brokers you have to be aware of their cancel fees. Remember, Interactive Brokers owns Timber Hill, a very large and active market maker. They will discourage you from competing with Timber Hill through monetary disincentives, among other things.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if you send a directed order (i.e., you don't allow IB to SMART route it), that order will be subject to a cancellation fee. See: &lt;a href=&quot;http://individuals.interactivebrokers.com/en/p.php?f=otherFees&quot;&gt;http://individuals.interactivebrokers.com/en/p.php?f=otherFees&lt;/a&gt;, specifically the Stock tab.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll notice a $0.12 fee for cancelling or modifying directed orders. This is outrageously high and completely eliminates any HF strategy, even if the latency, market data, and other issues raised in the other answers were non-existent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IB is not interested in HFT flow. They make their money in other ways. Automated traders that choose to use IB are best off letting them route with SMART and accept/embrace the fact that Timber Hill will get a chance to internalize the order.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastEditorUserId="1355" LastEditDate="2013-02-05T14:44:42.633" LastActivityDate="2013-02-05T14:44:42.633" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="1856" PostTypeId="2" ParentId="1277" CreationDate="2011-09-08T12:47:02.380" Score="8" Body="&lt;p&gt;I know you mentioned that you already know about Yahoo's ability to do this. However, I thought I'd add the following snippet on how to do this with Yahoo. It's a trivial HTTP Get, and is likely the quickest and easiest way to get the information you're after:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; curl &quot;http://download.finance.yahoo.com/d/quotes.csv?s=CSCO&amp;amp;f=j1&quot;&#xA;86.991B&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That will return a single result with one entry, which is the market cap of the stock you supplied. You can also supply more than one stock:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; curl &quot;http://download.finance.yahoo.com/d/quotes.csv?s=CSCO,AAPL&amp;amp;f=j1&quot;&#xA;86.991B&#xA;355.9B&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2011-09-08T12:47:02.380" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1857" PostTypeId="2" ParentId="602" CreationDate="2011-09-08T12:51:14.777" Score="5" Body="&lt;p&gt;You might find the paper &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1695460&quot; rel=&quot;noreferrer&quot;&gt;&quot;Low-Latency Trading&quot;&lt;/a&gt; by Hasbrouck and Saar useful. In it they discuss the episodic nature of some high-frequency flow and construct some useful measures of this flow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally, I would think some model that relates the cancel rate with the quote rate is most useful.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2011-09-08T12:51:14.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1858" PostTypeId="2" ParentId="1754" CreationDate="2011-09-08T13:02:50.937" Score="6" Body="&lt;p&gt;Some examples:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Exegy's ticker plant uses FPGAs and InfiniBand.&lt;/li&gt;&#xA;&lt;li&gt;Redline Trading's ticker plant is packaged as a PCI card and uses the IBM Cell Processor.&lt;/li&gt;&#xA;&lt;li&gt;SolarFlare makes a line of 1G/10G nics that are heavily used because they also ship an alternate POSIX-compatible socket API that bypasses the kernel and uses DMA for reduced latency.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;There are surely usages of FPGAs and ASICs for option pricing, real-time risk, etc. These aren't nearly as prevalent as the above examples.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2011-09-08T13:02:50.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1859" PostTypeId="2" ParentId="1834" CreationDate="2011-09-08T13:52:08.187" Score="3" Body="&lt;p&gt;Another DTN product, Nanex NxCore is a very good choice for a high-quality &quot;retail&quot; feed. It will suffer from the standard latency issues of transporting the feed across the internet, but it is likely the highest quality feed one can get on the retail end of the spectrum.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2011-09-08T13:52:08.187" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1860" PostTypeId="5" CreationDate="2011-09-08T15:30:27.607" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2011-09-08T15:30:27.607" LastActivityDate="2011-09-08T15:30:27.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1861" PostTypeId="4" CreationDate="2011-09-08T15:30:27.607" Score="0" Body="The prioritized list of resting orders held by the exchange. Each limit order represents an obligation to buy or sell. The most common type of order book is prioritized first by price and them by time. Another variation is the price/size book, where larger size results in higher priority." OwnerUserId="1355" LastEditorUserId="1355" LastEditDate="2011-09-08T15:33:11.533" LastActivityDate="2011-09-08T15:33:11.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1862" PostTypeId="2" ParentId="1640" CreationDate="2011-09-08T17:20:37.533" Score="111" Body="&lt;p&gt;NASDAQ makes this information available via FTP and they update it every night. Log into &lt;code&gt;ftp.nasdaqtrader.com&lt;/code&gt; anonymously. Look in the directory &lt;code&gt;SymbolDirectory&lt;/code&gt;. You'll notice two files: &lt;code&gt;nasdaqlisted.txt&lt;/code&gt; and &lt;code&gt;otherlisted.txt&lt;/code&gt;. These two files will give you the entire list of tradeable symbols, where they are listed, their name/description, and an indicator as to whether they are an ETF.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given this list, which you can pull each night, you can then query Yahoo to obtain the necessary data to calculate your statistics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE: More information about these files and their fields can be found &lt;a href=&quot;http://www.nasdaqtrader.com/trader.aspx?id=symboldirdefs&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastEditorUserId="1355" LastEditDate="2013-11-11T18:20:37.013" LastActivityDate="2013-11-11T18:20:37.013" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="1863" PostTypeId="2" ParentId="1832" CreationDate="2011-09-08T17:42:52.163" Score="4" Body="&lt;p&gt;It sounds like you're trying to filter your input event stream so as to reduce noise. By reducing noise you'll reduce the number of cancel/replace's you're doing and, hopefully, have a better order-to-fill ratio. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;I would investigate algorithms from control theory, in particular dynamic linear models like Kalman. The problem with denoising is you want to do it without introducing an arbitrary lag in your input event stream.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In dealing with order book events you might want to consider how long an order has been present at a given level. This might carry with it an information advantage if that order was subsequently canceled.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In calculating fair price consider how you might dampen the movement of your perceived fair value by adding some stable dampening series.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1355" LastEditorUserId="1355" LastEditDate="2011-09-09T00:55:15.247" LastActivityDate="2011-09-09T00:55:15.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1864" PostTypeId="2" ParentId="310" CreationDate="2011-09-08T17:55:07.993" Score="8" Body="&lt;p&gt;The defining characteristic of &quot;high-frequency&quot; is not the number of trades, but instead it is the number of orders you place, and in particular how often you are changing those orders. The scratch rate (cancel/fill ratio) is often very high. For every 1,000 orders you place, you might get 5 fills. This is the single most defining criteria of whether someone is playing the HFT game.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason this is the defining criteria is because the type of edge being captured by the high-frequency players is fundamentally different than that of other market participants. Whether its micro-structure oriented or market making, the edge a HFT is trying to capture is typically very small and also very dependent on factors such as receiving a rebate, getting a fill on a specific exchange, or achieving the highest possible queue placement at a given price level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Speed is important in almost all realms of intraday trading, but that doesn't mean you're a HFT. Being fast is important to intraday stat arb traders even if they hold their position for 4 hours. The reason is because their signal might hit 80% realization very quickly. The faster you can act the more edge you capture. That doesn't mean folks playing the stat arb game are HFT, they most certainly aren't. However, when viewed from the outside the layman often sees no difference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That being said, any attempt to classify most firms will fail. Most do a mix of everything, but they all have their bread and butter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To the question of whether a small guy can do it: yes you can. Can you do it on 25k? Probably  not. Can you do it on 150-250k? Yes.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2011-09-08T17:55:07.993" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1865" PostTypeId="1" AcceptedAnswerId="1873" CreationDate="2011-09-08T19:39:17.027" Score="37" ViewCount="17625" Body="&lt;p&gt;What tools exist for order book analysis and visualization? In particular, if one wanted to examine a limit order book and understand how it changes throughout the day where would you turn for software help? I've not found anything off the shelf, but I'm curious if others in this community might know of something. My preference is for free/open source that are available for R or Python, but commercial tools are acceptable as well. My wish list would look something like this:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Order book visualization. Show the bids and asks in standard book form.&lt;/li&gt;&#xA;&lt;li&gt;Order by order or level aggregation.&lt;/li&gt;&#xA;&lt;li&gt;Order tracking through time.&lt;/li&gt;&#xA;&lt;li&gt;&quot;VCR style&quot; controls that allow one to easily scan through the book across time.&lt;/li&gt;&#xA;&lt;li&gt;Multiple venue support. Depth of book data from more than one venue is maintained as a separate book for a given instrument, but an aggregated &quot;virtual&quot; book can be displayed.&lt;/li&gt;&#xA;&lt;li&gt;Descriptive statistics could be calculated across arbitrary time periods (# of orders added, deleted, etc.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Any suggestions on tools that might help in this type of analysis are welcome as are suggestions of features not listed here but that are provided by software packages available today.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastEditorUserId="1106" LastEditDate="2011-09-08T20:48:33.513" LastActivityDate="2016-07-01T16:01:09.323" Title="What tools exist for order book analysis and visualization?" Tags="&lt;r&gt;&lt;software&gt;&lt;limit-order-book&gt;&lt;visualization&gt;&lt;python&gt;" AnswerCount="9" CommentCount="0" FavoriteCount="31" ContentLicense="CC BY-SA 3.0" />
  <row Id="1866" PostTypeId="2" ParentId="162" CreationDate="2011-09-08T21:01:42.213" Score="9" Body="&lt;p&gt;The paper &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1722924&quot;&gt;&quot;High Frequency Trading and The New-Market Makers&quot;&lt;/a&gt; by Menkveld will likely have information that will be interesting to you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The paper breaks down the activity of one HFT in a European market. It provides statistics such as the # of trades, capital required, average profit, loss, etc. You can judge for yourself whether you trust the numbers based on their methodology. It's an interesting read none the less.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2011-09-08T21:01:42.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1867" PostTypeId="2" ParentId="557" CreationDate="2011-09-08T23:26:50.837" Score="4" Body="&lt;p&gt;Bovespa is starting to release the new trade platform; take a &lt;a href=&quot;http://www.bmfbovespa.com.br/en-us/services/trading-platforms/puma-trading-system/puma-trading-system.asp&quot; rel=&quot;nofollow&quot;&gt;look for yourself&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The BM&amp;amp;FBOVESPA PUMA Trading System will incorporate all of the functionalities that currently exist in the BM&amp;amp;FBOVESPA trading systems. Its trading speed will be &lt;strong&gt;less than a millisecond&lt;/strong&gt;. In addition, the new platform will allow trading on the following markets: equities in the cash market, futures, options on futures and on actuals, spot US dollar, federal government bonds, private fixed-income securities, and spot commodities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IMHO, quickfix needs to be patched/improved in order to handle such latency. (:&lt;/p&gt;&#xA;" OwnerUserId="1360" LastEditorUserId="35" LastEditDate="2011-09-09T01:36:55.913" LastActivityDate="2011-09-09T01:36:55.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1868" PostTypeId="2" ParentId="1865" CreationDate="2011-09-08T23:35:18.967" Score="0" Body="&lt;p&gt;Take a look a &lt;a href=&quot;http://www.eclipsetrader.org/&quot; rel=&quot;nofollow&quot;&gt;EclipseTrader&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1360" LastEditorUserId="35" LastEditDate="2011-09-09T01:37:59.873" LastActivityDate="2011-09-09T01:37:59.873" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1869" PostTypeId="2" ParentId="1824" CreationDate="2011-09-09T00:18:48.880" Score="3" Body="&lt;p&gt;I would use something similar to Black Litterman where both confidence of manager views as well as dynamic correlations are used to re weight asset classes. For a good look at how transaction costs affect long term allocation decisions with changing parameters, you may be interested in &lt;a href=&quot;http://pages.stern.nyu.edu/~alynch/pdfs/jfe99bl.pdf&quot; rel=&quot;nofollow&quot;&gt;Balduzzi and Lynch (1999)&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another approach to consider is to look at autocorrelation within each asset class to determine absolute magnitude of a weight change in a single period. &lt;a href=&quot;http://faculty.london.edu/fgomes/ccgmv.pdf&quot; rel=&quot;nofollow&quot;&gt;Stock Market Mean Reversion and the Optimal Equity Allocation of a Long-Lived Investor&lt;/a&gt; might be useful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet another way to approach the problem would be to run simulations to determine the TAA bands to place on each asset class to maximize long run returns incorporating transaction fees. This method would be sensitive to initial weights so a risk neutral portfolio framework may be a useful starting point. I use a block bootstrap to account for auto correlation in the return series and time varying correlations. &lt;/p&gt;&#xA;" OwnerUserId="232" LastEditorUserId="232" LastEditDate="2011-09-14T00:02:46.970" LastActivityDate="2011-09-14T00:02:46.970" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="1870" PostTypeId="1" AcceptedAnswerId="1871" CreationDate="2011-09-09T01:37:03.730" Score="13" ViewCount="4676" Body="&lt;p&gt;I hear a lot about Q/kdb+. I've never had the opportunity to use it for anything real but have played with it using their trial license and found it intriguing (if not somewhat mind warping). I've seen a few references to the &lt;a href=&quot;http://www.jsoftware.com/&quot;&gt;J language&lt;/a&gt; which is also a derivative of APL &lt;a href=&quot;http://en.wikipedia.org/wiki/J_%28programming_language%29&quot;&gt;according to Wikipedia&lt;/a&gt; and have heard of at least one quant trader using it as a poor man's replacement for Q/kdb+.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone put J to use in the real world? Is it worth investing time and energy into to learn, especially if I'm not interested in investing the dollars required to get a kdb+ license? I suspect a lot of K/Q's value comes from the kdb+ database that underlies it. I'm not sure there is an equivalent for J, but I haven't performed an exhaustive search.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interestingly enough, J recently went fully open source and is now hosted (not officially) on Github: &lt;a href=&quot;https://github.com/openj/core&quot;&gt;https://github.com/openj/core&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; Assuming some folks here are familiar with J and Q/kdb+ but have not used J extensively in industry, what might be some major advantages or disadvantages of using J.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT 2:&lt;/strong&gt; J has a database solution in &lt;a href=&quot;http://www.jsoftware.com/jwiki/JDB&quot;&gt;JDB&lt;/a&gt;. One obvious follow-up which I also asked in a comment to @chrisaycock's answer below is how JDB might compare to kdb+ in terms of functionality.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastEditorUserId="1355" LastEditDate="2011-09-09T02:28:58.417" LastActivityDate="2016-06-12T14:57:55.770" Title="Can the J language be used as an effective alternative to Q/Kdb+?" Tags="&lt;programming&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="1871" PostTypeId="2" ParentId="1870" CreationDate="2011-09-09T02:24:33.777" Score="7" Body="&lt;p&gt;You are right that the database component is the main selling point of q/kdb+. Indeed, many Kx customers use kdb+ just for time-series data (and often just for tick history) and don't take advantage of the q language. So the first disadvantage to using J as-is would be to miss the reason most folks even bother with Kx: data storage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now of course you could clone the data storage for J, just as you could for any language. The really hard part is coming-up with your own version of the query and join routines found in &lt;code&gt;q.k&lt;/code&gt;, that cryptic file that comes with the q software distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding &lt;a href=&quot;http://www.jsoftware.com/jwiki/JDB&quot;&gt;JDB&lt;/a&gt;, the biggest difference I can find is that it doesn't support partitioning. For example, kdb+ can split the column-mapped files into separate directories for each date. That means a query &lt;code&gt;select from quotes where date=2011.09.08&lt;/code&gt; will cause kdb+ to jump directly to today's ticks. Taking that further, kdb+ supports threading to some degree (via &lt;code&gt;par.txt&lt;/code&gt;) so that it can process multiple dates in parallel. And beyond the performance benefits, partitioning is practically required for really large tables anyway since the columns are memory-mapped at query time; there's no feasible way to do that for a multi-terabyte database without some selectivity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second disadvantage is that there aren't nearly as many finance shops that use J. Almost every big bank has a Kx license somewhere, so there's always an expert if needed. J doesn't have nearly that adoption.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, J's main advantage now is that it's open source. And even before going open, J Software was more academic-friendly than Kx Systems, so there's more presence of J in the universities. Because of that, there seems to be more J examples in papers and on Project Euler than for either k or q.&lt;/p&gt;&#xA;" OwnerUserId="35" LastEditorUserId="35" LastEditDate="2011-09-09T03:59:25.837" LastActivityDate="2011-09-09T03:59:25.837" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1872" PostTypeId="2" ParentId="1332" CreationDate="2011-09-09T14:08:01.347" Score="5" Body="&lt;p&gt;You might want to check out the book &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470008741&quot;&gt;Evidence Based Technical Analysis&lt;/a&gt; by David Aronson. In it he applies statistical techniques to determine whether certain technical analysis indicators and ensembles have any predictive power. It's an interesting read and should equip you with some ideas on how you might perform a similar analysis.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2011-09-09T14:08:01.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1873" PostTypeId="2" ParentId="1865" CreationDate="2011-09-09T14:43:45.953" Score="16" Body="&lt;p&gt;I don't know why it was removed, but the R package &quot;orderbook&quot; was available:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://journal.r-project.org/archive/2011-1/RJournal_2011-1_Kane~et~al.pdf&quot;&gt;http://journal.r-project.org/archive/2011-1/RJournal_2011-1_Kane~et~al.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://cran.r-project.org/web/packages/orderbook/index.html&quot;&gt;http://cran.r-project.org/web/packages/orderbook/index.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the IBrokers package, the function &quot;reqMktDepth&quot; is used for streaming order book data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://cran.r-project.org/web/packages/IBrokers/IBrokers.pdf&quot;&gt;http://cran.r-project.org/web/packages/IBrokers/IBrokers.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="392" LastActivityDate="2011-09-09T14:43:45.953" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1874" PostTypeId="2" ParentId="740" CreationDate="2011-09-09T15:02:13.363" Score="7" Body="&lt;p&gt;This question was ultimately answered on &lt;a href=&quot;https://stats.stackexchange.com/questions/8373/time-series-regression-with-overlapping-data/10275#10275&quot;&gt;Cross Validated&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Here are a couple of articles that deal with this subject:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;a href=&quot;http://www2.warwick.ac.uk/fac/soc/wbs/subjects/finance/faculty1/anthony_neuberger/improved.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Britten-Jones and Neuberger, Improved inference and estimation in&#xA;  regression with overlapping observations&lt;/a&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;a href=&quot;http://www.qass.org.uk/2009/Vol_3/paper4.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Harri &amp;amp; Brorsen, The Overlapping Data Problem&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2011-09-09T15:07:30.500" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1875" PostTypeId="2" ParentId="1332" CreationDate="2011-09-09T15:27:58.783" Score="5" Body="&lt;p&gt;There is so much finance literature on this topic, I don't even know where to begin.  Specifically on momentum, some of the earlier foundational papers are&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.e-m-h.org/JeTi93.pdf&quot;&gt;Returns to Buying Winners and Selling Losers: Implications for Stock Market Efficiency&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www-stat.wharton.upenn.edu/~steele/Courses/434/434Context/Momentum/MomentumStrategiesJF96.pdf&quot;&gt;Momentum Strategies&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.lsvasset.com/pdf/Price-Momentum-Trad-Vol-2000.pdf&quot;&gt;Price Momentum and Trading Volume&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://faculty.fuqua.duke.edu/~charvey/Teaching/IntesaBci_2001/R_International_momentum.pdf&quot;&gt;International Momentum Strategies&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Momentum has an entire page devoted to it at &lt;a href=&quot;http://momentum.behaviouralfinance.net/&quot;&gt;behaviouralfinance.net&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://web.mit.edu/alo/www/Papers/1705-1765.pdf&quot;&gt;Lo, Mamaysky, and Wang (2000)&lt;/a&gt; conduct rigorous tests of a variety of popular technical indicators (although not specifically the ones you mention).&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-09-09T15:27:58.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1876" PostTypeId="2" ParentId="248" CreationDate="2011-09-09T16:49:15.640" Score="3" Body="&lt;p&gt;The standard theoretical model for examining this question is the &lt;a href=&quot;http://en.wikipedia.org/wiki/Merton_Model&quot; rel=&quot;nofollow&quot;&gt;Merton Model&lt;/a&gt;.  The Merton Model views the company's equity as a call option on its assets.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This model assumes that a company has a certain amount of zero-coupon&#xA;  debt that will become due at a future time T. The company defaults if&#xA;  the value of its assets is less than the promised debt repayment at&#xA;  time T. The equity of the company is a European call option on the&#xA;  assets of the company with maturity T and a strike price equal to the&#xA;  face value of the debt.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Hence the equity volatility for a company with very low debt converges to the asset volatility, since the equity value (call option price) is about equal to the total assets.  As the debt load rises, the option becomes closer to the money, and, assuming total assets remain unchanged, the equity value shrinks.  If the underlying volatility of the assets also remains essentially unchanged, then the volatility of the equity increases as asset volatility is larger relative to the lower equity value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Merton Model has been shown to be a empirically accurate for non-financial firms.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-09-09T16:49:15.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1877" PostTypeId="2" ParentId="248" CreationDate="2011-09-09T17:07:41.547" Score="2" Body="&lt;p&gt;Let's start with an empirical test of the relationship between leverage and stock price returns and see if this connects to corporate finance theory. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is a bivariate chart that show the one-year forward return of a security vs. leverage. The x-axis is the leverage characteristic &quot;Total Liabilities to Total Assets&quot; in the current quarter. The characteristic is binned in six equally sized buckets and the harmonic mean of the one-year forward return is the y-coordinate of each dot. The population is S&amp;amp;P 500 securities from 2004 to mid-2011.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice there is U-shape relationship between leverage and returns. Some observations:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Firms with top quartile (right-most bin) debt have the worst forward returns.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Firms with very low debt (left-most bin) have low returns&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The Goldilocks firms in the middle have higher returns.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;How to reconcile this with theory? This confirms &lt;a href=&quot;http://en.wikipedia.org/wiki/Modigliani%E2%80%93Miller_theorem#With_taxes&quot; rel=&quot;nofollow noreferrer&quot;&gt;Miller &amp;amp; Modigliani propositions&lt;/a&gt; in a world with taxes (where interest expense is tax-deductible). On the margin, firms can increase enterprise value by generate a tax shield by increasing leverage. However, an indifference point is reached where the benefits of marginal debt are offset by the marginal increase of default. This is also called &lt;a href=&quot;http://wiki.answers.com/Q/Static_trade-off_theory_relation_to_agency_theory_of_capital_structure&quot; rel=&quot;nofollow noreferrer&quot;&gt;static trade-off theory&lt;/a&gt; (and investment bankers and CFOs think hard about this optimal capital structure problem).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is why you see firms in bucket 4 have the highest returns. With some simplification in this static analysis, you can argue that firms to the left of this bucket can benefit from increasing leverage and firms to the right should de-lever.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All things being equal, as firms increase leverage the volatility of their earnings and therefore the volatility of the share price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/yct11.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The last part of your question regarding market perception to debt issuance is related to &lt;a href=&quot;http://en.wikipedia.org/wiki/Pecking_Order_Theory&quot; rel=&quot;nofollow noreferrer&quot;&gt;Pecking Order theory&lt;/a&gt;. The theory starts in a principal-agent world where agents (firm managers) have more information regrading the firm than their principals (shareholders). The wikipedia link is a bit light - but the idea is that managers will prefer forms of raising capital that reveal the least amount of information as possible. Cash from operations reveals the least amount of information whereas equity issuance reveals the most. Managers that issue stock may be revealing information that their share price is overvalued whereas managers that have favorable views of the firm prospects would favor issuance of debt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, take a look at &lt;a href=&quot;http://www.cob.ohio-state.edu/fin/faculty/stulz/publishedpapers/A%20Test%20of%20the%20Free%20Cash.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Jensen's Free Cash Flow hypothesis&lt;/a&gt;. Jensen argues that debt constrains manager behavior by removing discretion in the use of cashflows which therefore leads to better shareholder value creation.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-09-09T17:39:14.223" LastActivityDate="2011-09-09T17:39:14.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1878" PostTypeId="2" ParentId="1832" CreationDate="2011-09-09T17:23:11.473" Score="2" Body="&lt;p&gt;Actually depends on the kind of market you are trying to make, if you are a authorized MM some markets/exchanges have special structure for market makers so they don't really pay for every quote that they send to the system, instead they pay a fixed amount of fee to have certain rights and responsibilities for a particular bin(set of instruments) of the market. &lt;/p&gt;&#xA;" OwnerUserId="1361" LastActivityDate="2011-09-09T17:23:11.473" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1879" PostTypeId="2" ParentId="1427" CreationDate="2011-09-09T18:41:06.110" Score="4" Body="&lt;p&gt;&lt;a href=&quot;http://ssrn.com/abstract=1887264&quot; rel=&quot;nofollow&quot;&gt;On the Expected Performance of Market Timing Strategies&lt;/a&gt;, a recent working paper by Hallerbach from Robeco Asset Management, attempts to construct a rigorous framework for evaluating market-timing strategies.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We derive expressions for the Information Ratio (IR) that can be expected from market timing strategies in non-parametric and parametric settings. Our results hold as superior approximations and lift Grinold’s [1989] “Fundamental Law of Active Management” to an operational level. In addition, we separate “time series breadth” (the timing frequency per strategy) from “cross-section breadth” (the number of separate sub-strategies) because they contribute differently to performance. We provide theoretical proofs that implementing volatility-weighted bet sizes, both in the time series context of a single underlying market and in the cross-section context of multiple underlying markets, maximizes the expected timing IR. Our theoretical results can be used as a benchmark for and reality check on the back tested performance of timing strategies. We confirm the accuracy of our results by simulating timing strategies for currencies, equities and fixed income. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-09-09T18:41:06.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1880" PostTypeId="2" ParentId="1865" CreationDate="2011-09-09T18:46:00.347" Score="2" Body="&lt;p&gt;I came across &lt;a href=&quot;http://pages.stern.nyu.edu/~jhasbrou/BView/launch.html&quot; rel=&quot;nofollow&quot;&gt;B/View&lt;/a&gt; which is a Java application that visualizes the order book for a single stock on a single day. It encompasses some of the basic features I would expect in such a tool. It appears to be more a demonstration than a general purpose tool.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2011-09-09T18:46:00.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1881" PostTypeId="2" ParentId="1427" CreationDate="2011-09-09T23:04:30.857" Score="5" Body="&lt;p&gt;I think the way to see the real effect in a backtest is to produce the distribution achieved with zero skill.  You can get one point from this distribution by starting with the same initial portfolio, then do random trading through the time period conditional on obeying the same set of constraints.  Do that several times to get the approximate distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The initial portfolio &lt;strong&gt;can&lt;/strong&gt; have a big effect on what you see.  So at the very least using different starting portfolios can give you some information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A fuller discussion of this is at &lt;a href=&quot;http://www.portfolioprobe.com/2010/11/05/backtesting-almost-wordless/&quot;&gt;http://www.portfolioprobe.com/2010/11/05/backtesting-almost-wordless/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="249" LastActivityDate="2011-09-09T23:04:30.857" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1882" PostTypeId="2" ParentId="987" CreationDate="2011-09-09T23:17:25.643" Score="4" Body="&lt;p&gt;If it was possible to simply pick up some papers and adapt them and produce returns that trade would quickly disappear since it would be an inexpensive way for firms to produce excess returns. If you have a factor that produces alpha you had best not publish it or all returns associated with it will disappear. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have found most of the value in the academic literature unlocked by our group to have come from other quantitative disciplines with signal processing problems. Generally most of the academic literature on finance is either behind the times or not possible to implement in a profitable way.&lt;/p&gt;&#xA;" OwnerUserId="373" LastActivityDate="2011-09-09T23:17:25.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1883" PostTypeId="2" ParentId="557" CreationDate="2011-09-10T11:30:13.537" Score="20" Body="&lt;p&gt;I work in a big hedge fund and our DMA is entirely based on quickfixj with hundreds of trades a day and thousands of fills.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quickfixj sits at the end of the OMS connecting to various counterparties and is in use since 2009, I think. Number of orders vary, possibly 150-450 a day, obviously with a lot more fills coming back than that number. Latency from an order entering the OMS to the fix message being sent is perhaps 150ms -- we are not aiming to be low latency at all though. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using quickfixj is absolutely pain free.&lt;/p&gt;&#xA;" OwnerUserId="1364" LastEditorUserId="1364" LastEditDate="2011-09-10T16:17:04.347" LastActivityDate="2011-09-10T16:17:04.347" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1884" PostTypeId="5" CreationDate="2011-09-10T15:10:15.030" Score="0" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Modern portfolio theory&lt;/strong&gt; (&lt;em&gt;MPT&lt;/em&gt;) is a framework for analyzing portfolios of investments. The concept is based on the premise that the investor is &lt;em&gt;risk averse&lt;/em&gt; and there are only two factors differentiating between potential portfolios - &lt;em&gt;expected return&lt;/em&gt; and &lt;em&gt;risk&lt;/em&gt;. Thus the investor can optimize his investment decision by choosing a combination of assets that &lt;strong&gt;maximize the portfolio's expected return for a given amount of risk&lt;/strong&gt; or vice versa &lt;strong&gt;minimize risk for a given level of expected return&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the &lt;em&gt;standard deviation&lt;/em&gt; of return is the most common proxy for risk, quite often &lt;em&gt;MPT&lt;/em&gt; application can also be referred to as &lt;strong&gt;mean-variance analysis&lt;/strong&gt; or &lt;strong&gt;mean-variance optimization&lt;/strong&gt; (&lt;em&gt;MVO&lt;/em&gt;).&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Further resources:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Modern_portfolio_theory&quot; rel=&quot;nofollow&quot;&gt;Modern portfolio theory at Wikipedia&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Markowitz, H.: &lt;strong&gt;&lt;a href=&quot;http://www.mendeley.com/research/portfolio-selection-2/&quot; rel=&quot;nofollow&quot;&gt;Portfolio Selection&lt;/a&gt;&lt;/strong&gt;. &lt;em&gt;The Journal of Finance&lt;/em&gt;, 7 (1): 77–91, 1952.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="38" LastEditorUserId="38" LastEditDate="2011-09-10T19:15:39.247" LastActivityDate="2011-09-10T19:15:39.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1885" PostTypeId="4" CreationDate="2011-09-10T15:10:15.030" Score="0" Body="A theoretical framework for analyzing investment portfolios based on their expected return and risk." OwnerUserId="38" LastEditorUserId="38" LastEditDate="2011-09-10T19:15:45.907" LastActivityDate="2011-09-10T19:15:45.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1886" PostTypeId="2" ParentId="1865" CreationDate="2011-09-11T05:51:26.213" Score="8" Body="&lt;p&gt;So one such visualization package is demonstrated in &lt;a href=&quot;http://www.tradeworx.com/movie/booklet_demo/temp/booklet_demo2.mov&quot;&gt;http://www.tradeworx.com/movie/booklet_demo/temp/booklet_demo2.mov&lt;/a&gt;.  AFAICT it looks like a tk script.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Trading Technologies (TT) sells another visualization tool.  But TBH writing your own tool takes a few hours and allows you to focus on what information you are interested in finding.&lt;/p&gt;&#xA;" OwnerUserId="1292" LastActivityDate="2011-09-11T05:51:26.213" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1887" PostTypeId="2" ParentId="1348" CreationDate="2011-09-11T05:57:37.000" Score="16" Body="&lt;p&gt;Why not just use the weighted mid-market price, quoted as &lt;code&gt;(Bsize * Aprc + Asize * Bprc) / (Asize + Bsize)&lt;/code&gt;?  This measure doesn't suffer a bounce per se and allows you to directly take moving or exponential moving averages.&lt;/p&gt;&#xA;" OwnerUserId="1292" LastActivityDate="2011-09-11T05:57:37.000" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1888" PostTypeId="1" AcceptedAnswerId="1889" CreationDate="2011-09-12T08:56:21.920" Score="25" ViewCount="13029" Body="&lt;p&gt;Some people claim that the data-generating process for stocks is a &quot;martingale&quot; and that is has the &quot;Markov property&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are they unrelated? Is it that the Markov property implies some sort of martingale property, or is it the other way around?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do you statistically test for such properties? How far from reality is it to assume such properties?&lt;/p&gt;&#xA;" OwnerUserId="1352" LastEditorUserId="1106" LastEditDate="2011-09-12T14:05:19.713" LastActivityDate="2013-01-20T06:31:17.373" Title="Is the stock price process a martingale or a Markov process?" Tags="&lt;equities&gt;&lt;martingale&gt;&lt;stochastic-processes&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="23" ContentLicense="CC BY-SA 3.0" />
  <row Id="1889" PostTypeId="2" ParentId="1888" CreationDate="2011-09-12T13:15:01.843" Score="19" Body="&lt;p&gt;From what I remember, there is no real relation between Markov and Martingale, and my intuition was confirmed by &lt;a href=&quot;http://www.wilmott.com/messageview.cfm?catid=8&amp;amp;threadid=11322&quot;&gt;this post&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, it says that you can say neither of the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If A is Markov, then A is a martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If A is a martingale, then A is Markov.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;further down the post, you can find two counter examples:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dX_t = a dt + \sigma dW_t$ is Markov but not a martingale&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dX_t = (\int_0^t X_s ds) dW_t$ is a Martingale but is not Markov.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the assumption of these properties being true, I think it really depends on how you see stock markets. My personal opinion being that no, the assumption is not very realistic.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2012-11-01T08:03:59.437" LastActivityDate="2012-11-01T08:03:59.437" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1890" PostTypeId="2" ParentId="1888" CreationDate="2011-09-12T14:00:05.337" Score="17" Body="&lt;p&gt;I will defer to others answering the parts of your question concerning the relationship between Markov processes and martingales (@SRKX has already given a good explanation of the relationship) and concerning statistical testing.  Broadly, however, it is not possible to &quot;prove&quot; either assumption, but only to fail to reject them.  &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0691092567&quot;&gt;A Non-Random Walk Down Wall Street&lt;/a&gt; by Andrew Lo and Craig MacKinlay provides many examples of the sophisticated statistical techniques which have been used to disprove these assumptions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I focus here on the realism of the two assumptions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To say that stock prices are a &lt;strong&gt;martingale&lt;/strong&gt; is to essentially say they are weak-form efficient (see &lt;a href=&quot;http://en.wikipedia.org/wiki/Efficient-market_hypothesis&quot;&gt;Efficient-Market Hypothesis&lt;/a&gt;, or EMH).  Weak-form efficiency says that knowledge of all past prices is not informative regarding the expectation of future prices.  A martingale is a special case of weak-form efficiency which says that the expected next future price is equal to current price.  This is either nearly true when examining a sufficiently short horizon or it is precisely true when considering the &quot;discounted price process,&quot; which discounts the price by the risk-free rate plus the equity risk premium.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The EMH was taken very seriously and much evidence was accumulated in its favor in the 1960s and 1970s.  Starting in the 1980s and particularly in the 1990s, evidence began accumulating of ways in which stock prices violate the EMH (see &lt;a href=&quot;http://en.wikipedia.org/wiki/Behavioral_finance&quot;&gt;Behavioral Finance&lt;/a&gt;), particularly the discovery of short-horizon reversal, medium-horizon momentum, and long-horizon overreaction.  Nevertheless, these effects are relatively weak, and the assumption of weak-form efficiency is generally seen as reasonable outside of a few specific instances.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To say that stock prices have the &lt;strong&gt;Markov property&lt;/strong&gt; is to assume much greater stability in the data-generating process than is generally believed to be the case.  In particular, if prices were a Markov process, then knowledge of merely the &lt;em&gt;current price&lt;/em&gt; would be a sufficient statistic for the probability distribution of future prices.  A clear example of how this is not true is the demonstrated &lt;a href=&quot;http://en.wikipedia.org/wiki/Volatility_%28finance%29#Volatility_over_time&quot;&gt;persistence of volatility&lt;/a&gt;.  In other words, knowing the volatility of past prices adds significant information regarding the future probability distribution of prices relative to just knowing the current price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short, stock prices are neither martingales nor Markovian, but the former is a much better working assumption than the latter.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-09-12T15:58:21.743" LastActivityDate="2011-09-12T15:58:21.743" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1891" PostTypeId="1" AcceptedAnswerId="1904" CreationDate="2011-09-12T14:28:20.737" Score="46" ViewCount="6182" Body="&lt;p&gt;Suppose one has an idea for a short-horizon trading strategy, which we will define as having an average holding period of under 1 week and a required latency between signal calculation and execution of under 1 minute.  This category includes much more than just high-frequency market-making strategies.  It also includes statistical arbitrage, news-based trading, trading earnings or economics releases, cross-market arbitrage, short-term reversal/momentum, etc.  Before even thinking about trading such a strategy, one would obviously want to backtest it on a sufficiently long data sample.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How much data does one need to acquire in order to be confident that the strategy &quot;works&quot; and is not a statistical fluke?&lt;/strong&gt;  I don't mean confident enough to bet the ranch, but confident enough to assign significant additional resources to forward testing or trading a relatively small amount of capital.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Acquiring data (and not just market price data) could be very expensive or impossible for some signals, such as those based on newer economic or financial time-series.  As such, this question is important both for deciding what strategies to investigate and how much to expect to invest on data acquisition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A complete answer should depend on the expected Information Ratio of the strategy, as a low IR strategy would take a much longer sample to distinguish from noise.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-09-13T14:44:44.943" LastActivityDate="2019-03-11T12:23:09.907" Title="How much data is needed to validate a short-horizon trading strategy?" Tags="&lt;data&gt;&lt;time-series&gt;&lt;backtesting&gt;&lt;quant-trading-strategies&gt;&lt;arbitrage&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="55" ContentLicense="CC BY-SA 3.0" />
  <row Id="1892" PostTypeId="2" ParentId="1672" CreationDate="2011-09-12T15:28:16.647" Score="6" Body="&lt;p&gt;To see the connection between &lt;strong&gt;put-call parity and option price&lt;/strong&gt; you should read this highly insightful paper by Espen Gaarder Haug &amp;amp; Nassim Nicholas Taleb:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1012075&quot; rel=&quot;noreferrer&quot;&gt;Option traders use (very) sophisticated heuristics, never the Black–&#xA;  Scholes–Merton formula&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It shows how you can heuristically derive option pricing formulas by adapting the tails and skewness by varying the standard deviation of a Gaussian - and then remove the risk parameter by using put-call parity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both authors are well known in the Quant-Community, they both have an academic as well as a practical background as traders.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-09-12T15:28:16.647" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1893" PostTypeId="2" ParentId="1850" CreationDate="2011-09-12T15:39:56.533" Score="3" Body="&lt;p&gt;I don't believe there are any models because it would be fruitless to develop one.  Whenever central bank intervention looms large in currency markets, all the traditional models become much less relevant than trying to predict how the central bank will react to various scenarios.  In this case, foreseeing the &lt;a href=&quot;http://uk.reuters.com/article/2011/09/08/uk-swiss-snb-intervention-idUKTRE78723920110908&quot; rel=&quot;nofollow&quot;&gt;SNB's move to sell a significant quantity of short-dated gamma&lt;/a&gt; in an effort to get markets to help them enforce the ceiling would have been much more lucrative than application of any artificial model.  Models must necessarily be estimated from historical data.  The moves happening in the EUR/CHF market these days are completely outside the norms established over the last 10+ years of trading.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-09-12T15:39:56.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1895" PostTypeId="1" AcceptedAnswerId="2166" CreationDate="2011-09-12T16:37:57.077" Score="31" ViewCount="2530" Body="&lt;p&gt;In their 1990 book, &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0691057745&quot;&gt;A Non-Random Walk Down Wall Street&lt;/a&gt;, Andrew Lo and Craig MacKinlay document a number of persistent predictable patterns in stock prices.  One of these &quot;anomalies&quot; is variously known as lead-lag or serial cross-correlation, and it says that the returns of larger, more liquid stocks tend to lead the returns of less liquid small-capitalization stocks.  Lo and MacKinlay showed that the degree of lag is greater than what could be explained by the lower trading frequency of small-cap stocks (nonsynchronous trading).  A 2005 working paper by &lt;a href=&quot;http://arxiv.org/abs/physics/0506071&quot;&gt;Toth and Kertesz&lt;/a&gt; claims to show that the lead-lag effect has &quot;vanished&quot; over the past 20 years.  Meanwhile, other anomalies documented at the time, such as long-horizon overreaction (first documented by &lt;a href=&quot;http://home.business.utah.edu/finmll/fin787/papers/debondtthaler1985.pdf&quot;&gt;DeBondt and Thaler (1985)&lt;/a&gt;), appears to be alive and well (see &lt;a href=&quot;http://www.business.ualberta.ca/DavidMcLean/~/media/University%20of%20Alberta/Faculties/Business/FacultyAndStaff/FSA/DavidMcLean/Documents/jfqafinal2010.pdf&quot;&gt;McLean (2010)&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Why do some anomalies persist even decades after they are discovered while others have seemingly been arbitraged away to nothingness?&lt;/strong&gt;  What is it about those anomalies that are still around so many years later that prevents them from being arbitraged away?  Conversely, what is it about the short-lived anomalies that made them so fragile?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: This post was inspired by a a blog post, &lt;a href=&quot;http://physicsoffinance.blogspot.com/2011/09/of-hurricanes-and-economic-equilibrium.html&quot;&gt;Of Hurricanes and Economic Equilibrium&lt;/a&gt;, although I do not agree with the author's conclusions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Bounty update: As promised, I created a new bounty for RYogi's answer, which is &quot;exemplary and worthy of an additional bounty&quot;.  It will be awarded shortly, as the system requires some lag time until the bounty is awarded.  Feel free to add your own up-votes to his answer in the mean time.&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-10-19T19:14:26.263" LastActivityDate="2018-02-14T06:04:31.617" Title="Why do some anomalies persist while others fade away?" Tags="&lt;equities&gt;&lt;research&gt;&lt;reference-request&gt;&lt;anomalies&gt;" AnswerCount="7" CommentCount="0" FavoriteCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="1897" PostTypeId="2" ParentId="1895" CreationDate="2011-09-12T17:52:20.237" Score="15" Body="&lt;p&gt;Very good question! I think part of the answer lies in the structure of the financial industry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some anomalies have a certain kind of structure which cannot be exploited by the players that are big enough to let the anomaly disappear. I would put e.g. the Turn-of-the-month effect (TOTM) into this category since big funds just can't turn their whole portfolio every end of the month.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following page concisely lists some of the differences between big players and smaller, independent asset managers: &lt;a href=&quot;http://quantivity.wordpress.com/2011/08/28/fund-structure-arbitrage/&quot;&gt;http://quantivity.wordpress.com/2011/08/28/fund-structure-arbitrage/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be interesting to see if there is a certain correlation between the persistence of anomalies and structural issues in the industry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally many interesting ideas and research concerning anomalies can be found here: &lt;a href=&quot;http://www.cxoadvisory.com/?s=anomalies&quot;&gt;http://www.cxoadvisory.com/?s=anomalies&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-09-12T17:52:20.237" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1900" PostTypeId="1" AcceptedAnswerId="1902" CreationDate="2011-09-13T08:45:39.320" Score="-5" ViewCount="468" Body="&lt;p&gt;&lt;a href=&quot;http://billing.finance.yahoo.com/realtime_quotes/signup?.src=quote&amp;amp;.refer=quote&quot; rel=&quot;nofollow&quot;&gt;http://billing.finance.yahoo.com/realtime_quotes/signup?.src=quote&amp;amp;.refer=quote&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can i get real time data(from NSE india) using Yahoo finance API after subscribing to their service ?&lt;/p&gt;&#xA;" OwnerUserId="1372" LastActivityDate="2011-09-13T10:02:45.147" Title="get live data from national stock exchange" Tags="&lt;equities&gt;" AnswerCount="1" CommentCount="2" ClosedDate="2011-09-13T14:04:33.020" ContentLicense="CC BY-SA 3.0" />
  <row Id="1902" PostTypeId="2" ParentId="1900" CreationDate="2011-09-13T10:02:45.147" Score="2" Body="&lt;p&gt;No, it supports 3 exchanges: NYSE, NASDAQ, and AMEX.&lt;/p&gt;&#xA;" OwnerUserId="1181" LastActivityDate="2011-09-13T10:02:45.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1903" PostTypeId="1" CreationDate="2011-09-13T14:17:50.770" Score="9" ViewCount="1102" Body="&lt;p&gt;I'm working on a tool to price Credit Default Swaps. I've already done the standard pricing tools. I'm working on a pricing tool which uses the credit rating for the default probabilities used in the pricing of CDS. What is the relation between these probabilities and the price?&lt;/p&gt;&#xA;" OwnerUserId="1374" LastEditorUserId="1106" LastEditDate="2011-09-13T14:35:21.620" LastActivityDate="2012-11-14T11:08:47.733" Title="What is the connection between default probabilities calculated using the credit rating and the price of a CDS?" Tags="&lt;fixed-income&gt;&lt;derivatives&gt;&lt;cds&gt;" AnswerCount="4" CommentCount="6" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1904" PostTypeId="2" ParentId="1891" CreationDate="2011-09-13T16:22:17.753" Score="45" Body="&lt;p&gt;Consider the &lt;a href=&quot;http://en.wikipedia.org/wiki/Standard_error_%28statistics%29&quot;&gt;standard error&lt;/a&gt;, and in particular the distance between the upper and lower limits:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\Delta = (\bar{x} + SE \cdot \alpha) - (\bar{x} - SE \cdot \alpha) = 2 \cdot SE \cdot \alpha&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the formula for standard error, we can solve for sample size:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;n = \left(\frac{2 \cdot s \cdot \alpha}{\Delta}\right)^{2}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $s$ is the measured standard deviation, which you already have from your IR calculation.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;High-frequency Example&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was testing a market-making model recently that was expected to return a couple basis points for each &lt;em&gt;trade&lt;/em&gt; and I wanted to be confident that my returns were really positive (ie, not a fluke). So, I chose a distance of 3 bps $(\Delta = .0003)$. My sample's measured standard deviation was 45 bps $(s = .0045)$. For a confidence interval of 95% $(\alpha = 1.96)$, my sample size needs to be $n = 3458$ &lt;em&gt;trades&lt;/em&gt;. I would have picked a tighter distance if I had been simulating this model, but I was trading live and I couldn't be too choosy with money on the line.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Low-frequency Example&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I imagine that for a low-frequency model that was expected to return 1.5% per &lt;em&gt;month&lt;/em&gt;, I'd want maybe 1% as the distance $(\Delta = .01)$. If the hoped-for Sharpe ratio were 3, then the standard deviation would be 1.7% $(s = .017)$, which I came-up with by backing-out the monthly &#xA;returns. So for a confidence interval of 95% $(\alpha = 1.96)$, I'd need 45 &lt;em&gt;months&lt;/em&gt; of data.&lt;/p&gt;&#xA;" OwnerUserId="35" LastEditorUserId="35" LastEditDate="2011-09-14T23:47:47.703" LastActivityDate="2011-09-14T23:47:47.703" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="1905" PostTypeId="2" ParentId="1004" CreationDate="2011-09-13T18:50:28.413" Score="9" Body="&lt;p&gt;I have been learning more about speech recognition motivated by its application to financial forecasting. I have identified a couple connect points. Turns out each of these tools can and are regularly used in financial modeling as well.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Use of Markov Models&lt;/li&gt;&#xA;&lt;li&gt;Use of Fourier transforms (sine/cosine decompositions)&lt;/li&gt;&#xA;&lt;li&gt;Use of component analysis&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2011-09-13T18:50:28.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1906" PostTypeId="2" ParentId="1824" CreationDate="2011-09-13T19:51:49.857" Score="3" Body="&lt;p&gt;There are a couple components to this problem:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Construct a portfolio incorporating relative views where weights shrink towards a default policy&#xA; 1a. Some views are in currency-hedged terms&#xA; 1b. Relative views are on a 5-point scale&lt;/li&gt;&#xA;&lt;li&gt;Maximize a mean-variance utility function incorporating a penalty for transactions costs and requiring that weights sum to one.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Solve for 1: Construct a posterior that blends your prior (default strategic policy allocation) with the relative currency-hedge views. Black-Litterman is the right idea but it uses CAPM as the prior. You need a more flexible framework. I would suggest Meucci's &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1213325&quot; rel=&quot;nofollow&quot;&gt;Fully Flexible Views&lt;/a&gt; (2008) which uses entropy-pooling to blend an arbitrary number of views and confidences. Incidentally, Meucci has fully commented MATLAB code on his website www.symmys.com (I have a project to convert this to R for whoever is interested!)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solve for 1a: To address that fact that views are based on currency-hedged returns whereas the component assets are not currency hedged, you need to translate the currency-hedged view into a non-currency hedged view. Then you can proceed to incorporate this view into Meucci's framework. (Side note: Black-Litterman will not work here because if you define a relative view in the Pick Matrix on the basis currency-hedged whereas the covariance matrix where these views are propogated are on the basis of non-currency hedged returns). Unlike Black-Litterman where you can only take views on return outcomes, you can also include views on an arbitrary number of factors which might include the currency-hedged returns. So you can express a view on the currency-hedged return in Meucci's framework as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solve for 1b:&#xA;Meucci's framework supports lax-views such as relative ranking and partial information views. So your view matrix (specifically, the inequality view matrix in Meucci's implementation) could express the idea that the returns from Strong Buys are greater than than returns from Buys, and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solve for 2: &#xA;Now that you have your posterior, you need to perform an optimization.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suggest incorporating transactions costs directly into your objective function. Your objective function would you have three quantities: arg(weights) max utility = posterior*optimal weight vector - lambda1*variance - lambda2*transactions costs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Variance is determined by weights-transposed*covariance matrix*weights. Lambda1 is the usual mean-variance risk-aversion parameter. No surprises here - naturally this is mean-variance optimization.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have an additional quantity. Lambda-2 is your transaction cost aversion parameter. Transactions costs are the cost involved for turning over your portfolio. The function returns the transactions costs given the current weight vector, the proposed weight vector, portfolio value, and some transaction cost assumption. A simple way is to take sum of (current weight vector minus the optimal weight vector) * portfolio value * cost per $ traded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are essentially creating a efficient frontier surface where your utility is maximized for various risk-aversions and transaction cost aversion levels. &lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2011-09-13T19:51:49.857" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1907" PostTypeId="2" ParentId="1847" CreationDate="2011-09-13T20:14:50.617" Score="8" Body="&lt;p&gt;VIX is calculated from a basket of SPX options, and VIX futures expire into following expiration, e.g. September VIX futures that will expire next Wednesday will use SPX October options chain to calculate settlement value. If $B$ is the value of the basket then VIX value at expiration is $\sqrt{ B }$. Then VIX futures price is the expectation of the basket $VIX _{F} = E[\sqrt{ B }]$. Delta of the VIX futures price with respect to the basket would be $$\ \frac{\partial VIX _{F}}{\partial B} = \frac{\partial E[\sqrt{ B }]}{\partial B}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see that taking that expectation is not simple, since there is no simple connection  between VIX futures greeks and SPX options greeks because of the expectation and square root. So &quot;use the chain rule and linearity of the derivative&quot; approach would not get you anywhere. But that does not mean that such derivative is 0. Such derivative can be calculated in Malliavin sense, but that is probably not what you're looking for.  &lt;/p&gt;&#xA;" OwnerUserId="185" LastEditorUserId="185" LastEditDate="2011-09-14T17:15:48.610" LastActivityDate="2011-09-14T17:15:48.610" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1908" PostTypeId="1" CreationDate="2011-09-13T21:02:39.337" Score="20" ViewCount="7997" Body="&lt;p&gt;I am looking for an all-java implementation of black scholes, preferably open source. I found jquantlib and quantlib (C++). Any other recommendations?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://www.jquantlib.org/&quot;&gt;jquantlib site&lt;/a&gt; seems to be down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd prefer to stay away from a C++ implementation that runs on a jvm like quantlib seems to be. My team would like to look at the code if open source and none of us are C++ capable.&lt;/p&gt;&#xA;" OwnerUserId="1375" LastEditorUserId="1106" LastEditDate="2011-09-14T16:43:14.047" LastActivityDate="2020-10-03T13:56:34.133" Title="Is there an all Java options-pricing library (preferably open source) besides jquantlib?" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;programming&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="1909" PostTypeId="2" ParentId="1903" CreationDate="2011-09-13T21:10:18.420" Score="2" Body="&lt;p&gt;Well I m affraid that there is a little bit of confusion here. Ratings are ... Ratings usually when used by notation agencies they imply a definite fixed once for all default probability (or transition matrix to some other rating) and then issuers are classified among those ratings usually by using some historical data. When using CDS spread then you get market implied default probability for some period and you bootstrap it from CDS quotes by using standard procedure, you can have a look at Brigo and Mercurio's book for the details. Hope this helps &#xA;Regards&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="92" LastEditDate="2011-09-14T15:05:28.010" LastActivityDate="2011-09-14T15:05:28.010" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1910" PostTypeId="2" ParentId="1908" CreationDate="2011-09-13T22:19:57.913" Score="5" Body="&lt;p&gt;&lt;a href=&quot;http://www.quantlib.org&quot;&gt;QuantLib&lt;/a&gt; itself also provides &lt;a href=&quot;http://www.swig.org&quot;&gt;Swig&lt;/a&gt; interfaces which can be used to create bindings for dozens of languages, Java included. Quoting:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;SWIG is a software development tool that connects programs written in&#xA;  C and C++ with a variety of high-level programming languages. SWIG is&#xA;  used with different types of target languages including common&#xA;  scripting languages such as Perl, PHP, Python, Tcl and Ruby. The list&#xA;  of supported languages also includes non-scripting languages such as&#xA;  C#, Common Lisp (CLISP, Allegro CL, CFFI, UFFI), D, Go language, Java,&#xA;  Lua, Modula-3, OCAML, Octave and R.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;See the QuantLib site for more on &lt;a href=&quot;http://quantlib.org/extensions.shtml&quot;&gt;support for other languages and extensions&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, &lt;a href=&quot;http://www.jquantlib.org/&quot;&gt;JQuantLib&lt;/a&gt; is an independent project that was last reported to have a good sized portion of a prior release ported to Java.&lt;/p&gt;&#xA;" OwnerUserId="69" LastEditorUserId="69" LastEditDate="2011-09-13T23:40:14.193" LastActivityDate="2011-09-13T23:40:14.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1911" PostTypeId="1" AcceptedAnswerId="1919" CreationDate="2011-09-13T23:32:45.457" Score="7" ViewCount="260" Body="&lt;p&gt;I need to estimate &lt;strong&gt;cumulative&lt;/strong&gt; earnings over the next Y years and I'd like to find a solution that is theoretically sound and relatively simple.  Can anyone recommend an approach?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Given:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have 30 years of historical monthly earnings.  &lt;/p&gt;&#xA;" OwnerUserId="223" LastActivityDate="2011-09-14T20:08:57.050" Title="What is a sound way to project Company X's earnings over the next Y years?" Tags="&lt;data&gt;&lt;forecasting&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1912" PostTypeId="2" ParentId="1911" CreationDate="2011-09-14T00:02:43.803" Score="4" Body="&lt;p&gt;Most of these models would be very industry specific, but there is never going to be a default way to estimate earnings.  Banks are very descriptive of these earnings models. I would start with an industry report and go from there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a serious task to do for one company.  Much more so than I think you realize.&lt;/p&gt;&#xA;" OwnerUserId="1368" LastEditorUserId="1368" LastEditDate="2011-09-14T02:41:34.370" LastActivityDate="2011-09-14T02:41:34.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1913" PostTypeId="2" ParentId="1891" CreationDate="2011-09-14T00:35:52.470" Score="4" Body="&lt;p&gt;I would also note that you need to watch out for correlations between data points. (EG ,if you have a data point proving this works for oil company x. Another data point for oil company y may not actually count as separate.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are looking at 5 day holding periods, why not just grab all the EOD data that you can as well.EOD data is obviously not tradeable but can be used as a sanity check for long term trading strategy returns when you do not actually have the data.&lt;/p&gt;&#xA;" OwnerUserId="1368" LastActivityDate="2011-09-14T00:35:52.470" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1914" PostTypeId="1" AcceptedAnswerId="1929" CreationDate="2011-09-14T02:26:03.520" Score="36" ViewCount="9755" Body="&lt;p&gt;There are many approaches to estimating fundamental factor equity models.  I would like to focus on two traditional methods:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;The time-series regression approach of Fama and French.&lt;/strong&gt; Factors are defined &lt;em&gt;ex ante&lt;/em&gt;. Betas to the factors are estimated in the time-series.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;The Barra cross-sectional regression approach described in &lt;a href=&quot;http://www.msci.com/resources/research_papers/the_barra_us_equity_model_use4.html&quot;&gt;Menchero, Orr, and Wang (2011)&lt;/a&gt;, &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0070248826&quot;&gt;Grinold and Kahn (2000)&lt;/a&gt; and Sheikh (1995).&lt;/strong&gt; Factor realizations are derived &lt;em&gt;ex post&lt;/em&gt;.  Factors are estimated independently in each time period in the cross-section.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I'll sketch the methodology of each and the high-level pros/cons. I'm curious if anyone has experience or links to research regarding which approach is better for the purposes of hedging, optimal portfolio construction, and alpha generation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Fama-French time-series regression approach:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Build a design matrix where each column is a time-series of economic factor returns. These factors could be traditional economic factors but also may include &quot;spread&quot; returns such as Fama-French factors SMB, HML, MKT generated from portfolio sorts.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Perform N time-series regressions (one per security). In particular, for each security regress the security returns on the economic factor returns and estimate the beta. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In this approach, the betas are constant and the factors are time-varying depending on the regression window. The advantage here is that estimation of beta is diversified away across securities, so it seems to be this approach would be superior for portfolio construction. The disadvantage is that betas are slower to respond to changes that change the risk profile of a firm (for example, in a sudden shift in Debt-to-Equity ratio).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Barra cross-sectional regression approach:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Assume that fundamental factor characteristics are Betas. For example, create z-scores of the fundamental factor characteristics thereby generating Betas for each time slice for each security.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Perform T cross-sectional regressions (one per factor). In particular, at each time slice regress the panel of security returns on the normalized Betas to estimate the un-observable factor realizations.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The advantage here is that the betas respond instantaneously to changes in firm characteristics. The disadvantage is that there is a potential errors-in-variable bias -- in fact, the errors from model mis-specification do not diversify away. Intuition suggests this approach may be better suited for alpha signal generation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there research comparing the out-of-sample performance of these two methods for various applications (i.e. risk decomposition, portfolio construction, hedging, alpha signal generation)?&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1106" LastEditDate="2011-09-15T02:40:26.587" LastActivityDate="2019-10-14T09:35:01.433" Title="Which approach to estimating fundamental factor models is better, cross-sectional (unobservable) factors or time-series (observable) factors?" Tags="&lt;risk-management&gt;&lt;regression&gt;&lt;beta&gt;&lt;factor-models&gt;&lt;factor-loading&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="37" ContentLicense="CC BY-SA 3.0" />
  <row Id="1916" PostTypeId="1" CreationDate="2011-09-14T08:29:06.943" Score="12" ViewCount="2792" Body="&lt;p&gt;I'm writing the Bachelor thesis but I need some information. I need to find some practical examples and applications of the Compound Poisson Process in insurance. Does anyone have any good examples?&lt;/p&gt;&#xA;" OwnerUserId="1379" LastEditorUserId="1355" LastEditDate="2011-09-14T11:16:39.267" LastActivityDate="2012-08-17T19:52:28.140" Title="What are some examples of Compound Poisson processes in insurance?" Tags="&lt;probability&gt;&lt;stochastic-processes&gt;&lt;application&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1917" PostTypeId="2" ParentId="1903" CreationDate="2011-09-14T13:35:48.473" Score="2" Body="&lt;p&gt;You should use the ratings-based default probabilities to derive the &quot;fair&quot; spreads on a set of hypothetical new contracts and compare this result to the market spreads. Each could then be used independently to also derive the price for an existing CDS. There is no set way to combine the two prices, as these are two completely different and independent approaches to solving the same problem. &lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-09-14T13:35:48.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1918" PostTypeId="2" ParentId="1908" CreationDate="2011-09-14T14:14:12.073" Score="12" Body="&lt;p&gt;Black Scholes in java?&lt;/p&gt;&#xA;&lt;p&gt;This guy, Christian Fries &lt;a href=&quot;http://www.christian-fries.de/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.christian-fries.de/&lt;/a&gt;, has some impressive codes and a book on these topics.&lt;/p&gt;&#xA;&lt;p&gt;You can find &lt;a href=&quot;http://www.finmath.net/java/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.christian-fries.de/finmath/book/index.html&lt;/a&gt; the contents as well as the library itself &lt;a href=&quot;http://www.finmath.net/finmath-lib/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.finmath.net/finmath-lib/&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;As well as your request, you'll see LIBOR model, HJM model, binomial model, etc. Of course there are numerical algorithms to solve these problems like Box Muller transform, etc..&#xA;He also has a straight forward approach to theoretical stuff on the topics(probably much straight forward than others)&lt;/p&gt;&#xA;&lt;p&gt;Hope it helps!&lt;/p&gt;&#xA;" OwnerUserId="1352" LastEditorUserId="3548" LastEditDate="2020-10-03T13:56:34.133" LastActivityDate="2020-10-03T13:56:34.133" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="1919" PostTypeId="2" ParentId="1911" CreationDate="2011-09-14T14:46:15.767" Score="3" Body="&lt;p&gt;If you want a generic mechanical approach, try to build a time-series model. A log-linear trend model or building an auto-regressive model such as ARMA (on a stationary) series would probably work. As a start point I would plot the data to see what features you notice (seasonality? exponential growth? mean-reversion? trend? one-off shocks?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that securities analysts forecasts are better than these time-series models. Also these time-series models would have limited ability to extrapolate beyond a couple k-step ahead periods. So if you need cumulative out-of-sample earnings in years and your training data is in months, you will have low confidence in your prediction. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a rich academic history of using such models used to forecast quarterly earnings although that doesn't mean it's a great trading strategy.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-09-14T15:17:46.923" LastActivityDate="2011-09-14T15:17:46.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1920" PostTypeId="1" AcceptedAnswerId="1930" CreationDate="2011-09-14T16:06:14.153" Score="8" ViewCount="809" Body="&lt;p&gt;Consider two statistically identical strategies (identical information ratios, sample size, ratio of transaction costs to total profit, etc.) except that one has a much shorter average holding period.  Is there a statistical reason to favor one over the other?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At first blush, it would appear the statistical confidence in the expected return to the two strategies is identical.  One way to measure statistical confidence is to regress the P&amp;amp;L time-series on a constant and examine the t-statistic.  Using OLS, these two strategies would yield identical t-stats.  However, the longer holding period strategy may be expected to have greater serial correlation, and so perhaps we should adjust the standard errors.  Of course, even short horizon strategies can display autocorrelation in P&amp;amp;L beyond the holding period, so perhaps this is not a reason to prefer one over another.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My intuition says I should prefer the short holding period strategy, but I have been unable to find a solid reason why, and in particular how I would measure the strength of this preference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: This question is a follow-up to my previous question:&#xA;&lt;br&gt;&#xA;&lt;a href=&quot;https://quant.stackexchange.com/q/1891/1106&quot;&gt;How much data is needed to validate a short-horizon trading strategy?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2011-09-15T14:43:44.123" Title="Are shorter holding period strategies better?" Tags="&lt;time-series&gt;&lt;backtesting&gt;&lt;quant-trading-strategies&gt;&lt;statistics&gt;&lt;auto-correlation&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1921" PostTypeId="2" ParentId="1911" CreationDate="2011-09-14T16:36:30.063" Score="2" Body="&lt;p&gt;I agree with @Quant Guy's answer.  His approach should definitely be the first thing you try, and you should also heed his warning regarding the low confidence when forecasting out many years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would only add that if you have data for more companies available, even if your goal is to only estimate the earnings for one company, you can improve your estimate further with a vector auto-regression (VAR). Better yet, you can estimate relationships between this firm and its industry average earnings and add a term for convergence of this firm's growth rate to the industry average.  ARMA estimates will also probably be better on aggregates such as industries/sectors.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-09-14T16:36:30.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1922" PostTypeId="2" ParentId="1833" CreationDate="2011-09-14T17:19:43.737" Score="3" Body="&lt;p&gt;While not really an answer, here are my thoughts on the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For starters, I would approach the problem as one of whether a portfolio which is constantly rebalanced over some horizon can be replicated using vanilla options.  Obviously the portfolio will have to be rolled over when the options reach expiration.  Then the rest, such as payoff diagram and price in a B-S world can be easily derived.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose you have a \$100 portfolio to be invested equally in two assets, X and Y, both of which have liquid options over a closely-spaced range of strikes.  Let's say both assets start out at a price of \$50, so that initially you want to hold 1 share of each.  In a traditional CRP, as the asset prices evolve, you will want to sell some of whichever asset outperforms and buy the underperformer.  With options, however, an alternative strategy is to simply try to keep the exposure to each asset fixed at \$50.  In order for the P&amp;amp;L from the options portfolio to match the hypothetical CRP, though, one must then &quot;rebalance&quot; by buying and selling the entire replicating portfolio.  For example, if both assets increase by 1%, then the replicating portfolio should show a P&amp;amp;L of \$1.  However, since the exposures will remain \$50/\$50, and additional \$1 unit of the options portfolio must be purchased (essentially reinvesting the P&amp;amp;L).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Proceeding under these assumptions, the replicating portfolio of options for asset X must satisfy&#xA;\begin{equation}&#xA;\sum_i\Delta_{t,i}^X=\frac{p_0^X}{p_t^X}&#xA;\end{equation}&#xA;where the sum of $i$ is over all option contracts held for asset X, and $p_t^X$ is the price of X at time $t$.  A similar equation holds for asset Y, which is henceforth interchangeable with X (so I drop the superscript).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to keep the exposures constant, the sum of deltas must not depend on volatility, interest rates, or other extraneous factors besides price.  I'm not sure what the ultimate dependence between sum of deltas and price will be, so perhaps some additional dynamic trading will be necessary because of this factor.  What remains now is to solve for the portfolio of options with this property.  Perhaps with this first step someone else can take up the mantle, but I believe this will take me more time than I have to spend on this problem at the moment.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-09-14T17:19:43.737" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1923" PostTypeId="2" ParentId="1489" CreationDate="2011-09-14T17:53:30.153" Score="33" Body="&lt;p&gt;I have worked on this topic extensively (pricing and calculating IV in production) and believe can offer an informed opinion. First of all Mathworks - the company that creates Matlab is not a trading firm so you should probably not rely on their advice so much. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are few closed form options pricing models, and all have practical shortcomings. Barone-Adesi and Whaley (please correct my spelling of last names as I'm typing from memory) model is simple approximation for American options but is unfortunately not very accurate, and does not deal with dividends. Roll-Geske-Whaley deals with dividends, but not very well - there are arbitrage situations that are possible in the model. Ju and Zhong have another approximation but again not very accurate. Finally Bjerksund and Stensland seem to have the best approximation (2002 version, not 1993) but that still does not solve the discrete dividend problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my experience the tree is the way to go. CRR trees are slow but &lt;a href=&quot;http://janroman.dhis.org/finance/Binomial%20Models/Leisen%20Reimer%20Binomial%20tree.pdf&quot; rel=&quot;noreferrer&quot;&gt;Leisen and Reimer, 1995&lt;/a&gt; came up with a scheme that converges much faster. Also Mark Joshi created his own binomial scheme that converges slightly faster. Instead of discrete dividend you can use discrete proportional dividend - so you don't end up with a bushy tree. Alternatively you can try a trinomial tree and extra DF will give you better resolution on dividend, but I did not find that big of an improvement in production. That in my opinion is the best combination for speed and accuracy. If you're looking for alternative opinions check out these two articles - &#xA;&lt;a href=&quot;http://www.nccr-finrisk.uzh.ch/media/pdf/ODD.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.nccr-finrisk.uzh.ch/media/pdf/ODD.pdf&lt;/a&gt;  about discrete dividend problem, and &#xA;&lt;a href=&quot;http://ssrn.com/abstract=1567218&quot; rel=&quot;noreferrer&quot;&gt;http://ssrn.com/abstract=1567218&lt;/a&gt; on pricing American options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still the most important speed improvements will come in from your code: one technique that is extensively used in quoting servers is pre-computation. Basically you continuously compute prices for the stock price $\pm 0.1$ and volatility $\pm 0.01$, so when spot or vol moves you used pre-computed cached value (or interpolated from closest values). &lt;/p&gt;&#xA;" OwnerUserId="185" LastEditorUserId="24222" LastEditDate="2017-03-28T22:18:18.897" LastActivityDate="2017-03-28T22:18:18.897" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1925" PostTypeId="2" ParentId="1911" CreationDate="2011-09-14T18:26:54.520" Score="3" Body="&lt;p&gt;The most common model is....&quot;Next year's earnings will be this year's earnings plus some percentage (an exponential trend)&quot;.    Why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Look closely at the process that generates an earnings number.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Earnings = Sales - Costs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Let's start off by assuming that you can estimate &lt;code&gt;Sales&lt;/code&gt; with 100% accuracy.   And, let's assume that you can estimate &lt;code&gt;Costs&lt;/code&gt; within +/- 5% (not likely, but let's use this anyway).    If &lt;code&gt;Costs&lt;/code&gt; are typically 90% of &lt;code&gt;Sales&lt;/code&gt; (a 10% profit margin), then the +/- 5% error in &lt;code&gt;Costs&lt;/code&gt; gives you an &lt;code&gt;Earnings Estimate&lt;/code&gt; that is 5% to 15% of &lt;code&gt;Sales&lt;/code&gt;.   &lt;strong&gt;That's an &lt;code&gt;Earnings&lt;/code&gt; spread based on &lt;code&gt;Earnings&lt;/code&gt; of -50% to +50% (for a +/-5% error in &lt;code&gt;Costs&lt;/code&gt;).&lt;/strong&gt;  As you can imagine, a higher uncertainty in &lt;code&gt;Costs&lt;/code&gt; plus the uncertainty in &lt;code&gt;Sales&lt;/code&gt; can drive that &lt;code&gt;Earnings Estimate&lt;/code&gt; spread to some really big numbers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, it turns out that you'll be lucky if you can estimate an &lt;code&gt;Earnings&lt;/code&gt; exponential trend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One other thing to keep in mind.   The smaller the company, the more ridiculous the &lt;code&gt;Earnings Estimates&lt;/code&gt;.   And, estimating the &lt;code&gt;Earnings&lt;/code&gt; of the S&amp;amp;P500 beyond an exponential trend, the easiest of all estimates, is by no means easy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to try some schemes on various companies, here's some data:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www3.valueline.com/dow30/index.aspx&quot; rel=&quot;nofollow&quot;&gt;http://www3.valueline.com/dow30/index.aspx&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's some S&amp;amp;P500 data:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.econ.yale.edu/~shiller/data.htm&quot; rel=&quot;nofollow&quot;&gt;http://www.econ.yale.edu/~shiller/data.htm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From your question, to get &lt;strong&gt;cumulative&lt;/strong&gt; &lt;code&gt;Earnings&lt;/code&gt; over some time period, you simply add up the &lt;code&gt;Earnings&lt;/code&gt; for that time period.&lt;/p&gt;&#xA;" OwnerUserId="392" LastEditorUserId="392" LastEditDate="2011-09-14T20:08:57.050" LastActivityDate="2011-09-14T20:08:57.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1926" PostTypeId="1" CreationDate="2011-09-14T19:03:29.693" Score="3" ViewCount="2635" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Possible Duplicate:&lt;/strong&gt;&lt;br&gt;&#xA;  &lt;a href=&quot;https://quant.stackexchange.com/questions/1908/is-there-an-all-java-options-pricing-library-preferably-open-source-besides-jqu&quot;&gt;Is there an all Java options-pricing library (preferably open source) besides jquantlib?&lt;/a&gt;  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&#xA;&#xA;&lt;p&gt;Can anyone recommend a library with an implementation of Black Scholes and Monte Carlo in Java? Ideally something that is Java only and doesn't require a C++ dll or .so or .lib etc..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've posted a similar question about open source and the choices appear to be quite limited thus far:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quantlib - C++ using SWIG or similar to communicate with JVM&#xA;JQuantLib - port of QuantLib to pure Java, but can't access site for 2 days now.&#xA;finmath.net - Appears to be all java and has promise, but finding problems running applets using it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Presently, this is for pricing very simple vanilla euro-style options. But must be open to the complexity that's sure to come prob. requiring Monte Carlo or other pricing models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="1375" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2011-09-15T08:44:24.370" Title="Black Scholes and Monte Carlo implementations in Java" Tags="&lt;black-scholes&gt;&lt;monte-carlo&gt;&lt;programming&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ClosedDate="2011-09-14T22:51:43.397" ContentLicense="CC BY-SA 3.0" />
  <row Id="1927" PostTypeId="2" ParentId="1926" CreationDate="2011-09-14T19:49:32.170" Score="0" Body="&lt;p&gt;You could try to see if &lt;a href=&quot;http://www.nag.co.uk/javadevelopers.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;NAG&lt;/a&gt; could suit your needs as I suggested in &lt;a href=&quot;https://quant.stackexchange.com/questions/972/library-to-solve-optimization-problems/973#973&quot;&gt;this post&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's not free, but I think it's a pretty good tool to tackle problems of any complexity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I haven't personally tested it though.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2011-09-14T19:49:32.170" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1928" PostTypeId="2" ParentId="1926" CreationDate="2011-09-14T19:56:15.820" Score="1" Body="&lt;p&gt;This one is in C#, but it could help you create yours in Java:&#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/1326/divergence-issue-with-my-monte-carlo-pricer&quot;&gt;Divergence issue with my monte carlo pricer...&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;using System;&#xA;using System.Threading.Tasks;&#xA;using MathNet.Numerics.Distributions;&#xA;using MathNet.Numerics.Random;&#xA;&#xA;namespace MonteCarlo&#xA;{&#xA;    class VanillaEuropeanCallMonteCarlo&#xA;    {&#xA;        static void Main(string[] args)&#xA;        {&#xA;            const int NUM_SIMULATIONS = 10000000;&#xA;            const decimal strike = 50m;&#xA;            const decimal initialStockPrice = 52m;&#xA;            const decimal volatility = 0.2m;&#xA;            const decimal riskFreeRate = 0.05m;&#xA;            const decimal maturity = 0.5m;&#xA;            Normal n = new Normal();&#xA;            n.RandomSource = new MersenneTwister();&#xA;&#xA;&#xA;            VanillaEuropeanCallMonteCarlo vanillaCallMonteCarlo = new VanillaEuropeanCallMonteCarlo();&#xA;&#xA;            Task&amp;lt;decimal&amp;gt;[] simulations = new Task&amp;lt;decimal&amp;gt;[NUM_SIMULATIONS];&#xA;&#xA;            for (int i = 0; i &amp;lt; simulations.Length; i++)&#xA;            {&#xA;                simulations[i] = new Task&amp;lt;decimal&amp;gt;(() =&amp;gt; vanillaCallMonteCarlo.RunMonteCarloSimulation(strike, initialStockPrice, volatility, riskFreeRate, maturity, n));&#xA;                simulations[i].Start();&#xA;            }&#xA;&#xA;            Task.WaitAll(simulations);&#xA;&#xA;            decimal total = 0m;&#xA;&#xA;            for (int i = 0; i &amp;lt; simulations.Length; i++)&#xA;            {&#xA;                total += simulations[i].Result;&#xA;            }&#xA;&#xA;            decimal callPrice = (decimal)(Math.Exp((double)(-riskFreeRate * maturity)) * (double)total / (NUM_SIMULATIONS * 2));&#xA;&#xA;            Console.WriteLine(&quot;Call Price: &quot; + callPrice);&#xA;            Console.WriteLine(&quot;Difference: &quot; + Math.Abs(callPrice - 4.744741008m));&#xA;        }&#xA;&#xA;&#xA;        decimal RunMonteCarloSimulation(decimal strike, decimal initialStockPrice, decimal volatility, decimal riskFreeRate, decimal maturity, Normal n)&#xA;        {&#xA;            decimal randGaussian = (decimal)n.Sample();&#xA;            decimal endStockPriceA = initialStockPrice * (decimal)Math.Exp((double)((riskFreeRate - (decimal)(0.5 * Math.Pow((double)volatility, 2))) * maturity + volatility * (decimal)Math.Sqrt((double)maturity) * randGaussian));&#xA;            decimal endStockPriceB = initialStockPrice * (decimal)Math.Exp((double)((riskFreeRate - (decimal)(0.5 * Math.Pow((double)volatility, 2))) * maturity + volatility * (decimal)Math.Sqrt((double)maturity) * (-randGaussian)));&#xA;            decimal sumPayoffs = (decimal)(Math.Max(0, endStockPriceA - strike) + Math.Max(0, endStockPriceB - strike));&#xA;            return sumPayoffs;&#xA;        }&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1360" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2011-09-14T21:53:58.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1929" PostTypeId="2" ParentId="1914" CreationDate="2011-09-15T14:25:40.727" Score="14" Body="&lt;p&gt;Jennifer Bender of MSCI Barra has a paper from 2007 entitled:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.179.1830&quot; rel=&quot;noreferrer&quot;&gt;To Beta or Not to Beta: A Comparison of Historical Versus Fundamental Betas for Hedging Market Risk&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;She deals specifically and exclusively with which method is superior for hedging long-only portfolios.  Not surprisingly, she finds that Barra's approach is better.  She tests long-only and long-short portfolios separately, using random portfolios with asymmetric bets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you call &quot;cross-sectional&quot; or &quot;unobservable&quot; factors she calls &quot;fundamental betas,&quot; and &quot;time-series&quot; or &quot;observable&quot; factors are termed &quot;historical betas.&quot;  Here is the abstract:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Fundamental betas provide several conceptual advantages to historical betas--they reflect&#xA;  information on a timelier basis and are less likely to confuse noise for information. This paper&#xA;  revisits the advantages of using fundamental beta for hedging systematic risk in the U.S.&#xA;  Fundamental beta appears to be a more consistent measure for hedging market risk, particularly&#xA;  for investors who care about downside risk and tail risk.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;BTW, I have met her IRL and she seems pretty smart, so I trust she did the research right, but of course you must always be skeptical of company research that makes their product look better than their competitors'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update after reading Bender's paper:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;For hedging, my impression is that there is not a great difference between the two approaches, although fundamental betas win out slightly over historical betas.&lt;/li&gt;&#xA;&lt;li&gt;For portfolio construction, where stability of betas is much more important, she makes a convincing case for fundamental betas.  Fundamental betas are more stable during stable periods and adjust more quickly to large shifts in a stock's expected behavior due to M&amp;amp;A or spinoff activity.  She also argues risk estimates will adapt more quickly to a regime change with fundamental versus historical betas, particularly as she finds the best historical beta overall to be a 60-month regression.&lt;/li&gt;&#xA;&lt;li&gt;Fundamental betas also provide a distinct advantage over historical for risk decomposition due to the rapidly changing nature of cross-correlations and the lower propensity for assigning idiosyncratic moves coincident with a particular risk factor to the beta for that factor.&lt;/li&gt;&#xA;&lt;li&gt;Alpha signal generation is not really the goal of either approach, so I'm not sure if it is fair to evaluate based on this.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The fact that the two major commercial risk model providers essentially use the same approach should also tell you something.  Barclays Capital's US Equity Risk Model (for institutional POINT clients) also uses cross-sectional regressions.  In fact, in the face of all this industry research, the real question is &lt;em&gt;why do academics still use the historical time-series regression approach?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Gregory Connor published an article &lt;a href=&quot;http://www.mscibarra.com/research/articles/barra/connorfactor.pdf&quot; rel=&quot;noreferrer&quot;&gt;The Three Types of Factor Models: A Comparison of Their Explanatory Power&lt;/a&gt; in 1995 in the Financial Analysts Journal.  However, his goal is to compare statistical and fundamental models, not the two types of fundamental models to each other (he also throws in macroeconomic models, which he finds to be close to useless).  The research is somewhat dated but still interesting for those looking at risk models in general.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="70" LastEditDate="2014-02-25T12:44:12.667" LastActivityDate="2014-02-25T12:44:12.667" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1930" PostTypeId="2" ParentId="1920" CreationDate="2011-09-15T14:43:44.123" Score="7" Body="&lt;p&gt;This is a partial explanation in that trading strategies with longer horizons have higher information ratios, t-statistics, slope coefficients, and R^2 in general.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, if information ratios for both strategies are identical then the longer-term trading strategy is already worse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;John Cochrane illustrates how longer horizons have higher t-stats and information ratios in various lectures including &quot;&lt;a href=&quot;http://www.nber.org/papers/w16972.pdf&quot;&gt;Discount Rates&lt;/a&gt;&quot; -- a fantastic read for its other ideas as well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fama and French (1998) initially documented the fact that long-horizon models have higher fits. This spawned a slew of statistical research to understand why this peculiar feature would hold. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This research is summarized in &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=893380&quot;&gt;Boudoukh, Richardson, and Whitelaw&lt;/a&gt; (2006) who find that it is not the case that predictability somehow &quot;emerges&quot; at long-horizons but rather higher R^2 occurs when you have i) persistency (auto-correlation) of the predictive variable and ii) overlapping returns, and therefore iii) common sampling error in the coefficient estimates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you can contrive a scenario where these effects do not hold or are controlled for then your question stands. On that front, I would argue that shorter-term horizon trading strategies generate optionality and so should be preferred to longer-horizon models.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2011-09-15T14:43:44.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1931" PostTypeId="1" AcceptedAnswerId="1963" CreationDate="2011-09-15T16:31:35.010" Score="8" ViewCount="380" Body="&lt;p&gt;I am at the moment considering investing into ETFs, but I am looking first to understand  how these products really work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed, it is my understanding that ETF can vary in terms of structure, thus affecting their counterparty risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, some of them are doing a SWAP with a third counterpart to whom they have to give the returns of some assets basket in return to the returns of the index (here the index being the &quot;underlying&quot; of the SWAP).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I'm looking for, is some resource describing, if possible, all the different types of ETFs, and it would be even better if it had some risk analysis approach for each of those types.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2011-09-20T07:45:21.220" Title="Do you know a good article on ETF's counterparty risk analysis?" Tags="&lt;risk&gt;&lt;etf&gt;&lt;counterparty-risk&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1932" PostTypeId="2" ParentId="303" CreationDate="2011-09-15T16:37:30.593" Score="2" Body="&lt;p&gt;For what it is worth , I work for a major investment bank and we have decided to go the functional way. Since most of our other legacy apps are JAVA we decided on using clojure on JVM. &lt;/p&gt;&#xA;" OwnerUserId="1386" LastActivityDate="2011-09-15T16:37:30.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1933" PostTypeId="1" CreationDate="2011-09-15T18:21:18.587" Score="14" ViewCount="957" Body="&lt;p&gt;I have an upcoming quantitative trading interview (prop desk at a large bank), and I would like to have some good questions to ask about the group. However, I am changing fields from academia and I do not have a good idea about what sort of things I should be looking for, and what questions would 1) probe my fit with the group/firm and 2) give me a better idea of how they work.&lt;/p&gt;&#xA;&lt;p&gt;Here are two suggestions I have received so far, which illustrate the type of questions I would be looking for:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;What markets do you operate in?&lt;/p&gt;&#xA;&lt;p&gt;What is your Sharpe ratio?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;In addition to the question, a brief explanation of how to interpret the group's answer to the question would be appreciated. What does operating in one market tell me? Many markets? An example answer featuring a question/explanation would be&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;What is your Sharpe ratio? - A high ratio tells you ... Avoid groups with low ratios because ...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;One question/explanation per answer, please. Feel free to use the examples I've given, as I am unsure of how to interpret the responses.&lt;/p&gt;&#xA;" OwnerUserId="686" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2014-02-10T13:54:25.647" Title="Issues when considering a quantitative trading/finance firm" Tags="&lt;career&gt;&lt;banks&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="1934" PostTypeId="2" ParentId="1933" CreationDate="2011-09-15T18:34:51.480" Score="13" Body="&lt;p&gt;Asking questions like &quot;what is your sharpe ratio&quot; is, IMO, not a good idea. Ask questions that demonstrate your interest in making their firm a success.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What markets do you trade? (you listed this one)&lt;/li&gt;&#xA;&lt;li&gt;Describe the firm's high-level process for taking an idea, developing a model, and moving it into production.&lt;/li&gt;&#xA;&lt;li&gt;What constraints do you place on new models?&lt;/li&gt;&#xA;&lt;li&gt;How do you monitor and manage model-specific and firm-wide risk?&lt;/li&gt;&#xA;&lt;li&gt;What types of models will I be prohibited from developing? For example, am I free to construct a model that holds positions for 100+ days? What about a pure intraday model?&lt;/li&gt;&#xA;&lt;li&gt;Describe the tool set or framework that your quants use to develop models.&lt;/li&gt;&#xA;&lt;li&gt;Are there resources available to develop new tools for internal use to make quants more productive?&lt;/li&gt;&#xA;&lt;li&gt;How are your quants organized within the organization? Are they encouraged to collaborate or are they competing with one another (whether directly or, indirectly for mind share and resources from other support teams).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Questions that show you're interested in deducing whether you can be a success are much more interesting to the interview than questions that might be perceived as you measuring them to some arbitrary yard stick to see if its worth your while to join.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2011-09-15T18:34:51.480" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1935" PostTypeId="2" ParentId="1833" CreationDate="2011-09-15T20:24:53.780" Score="12" Body="&lt;p&gt;Actually there are more than just ideas and hints concerning this topic. There is an intuitive model and solution to your question already using machinery of option theory. But don't worry, it's not a surprise that you didn't find any useful literature in your search because the proposed solution actually comes from a very different topic. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition to the references recommendation, here are some analogies and highlights that hopefully will bridge the proposed solution and your interests: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Note that in volatility pumping, which is the easiest version of constant rebalanced portfolio (CRP), we always invest less than 100% capitals in risky assets. What if now, I propose to invest more than 100% capitals in risky assets? Will you buy it? :)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;For whatever reasons, many investors buy it! And that's why we have a fast growing leveraged exchange-traded funds (Leveraged ETFs) market. Yeah, &gt;100% capital investment is 'leveraged'. As the business grow, there thus arise greater demands for better understanding and modeling of these leveraged services/products. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;There you go! The answer you are looking for, for a 'de-leveraged' trading strategy, actually lies in the research of modeling leveraged assets. All you need to do is to plug in your favored leverage (x1/2 for volatility pumping) and double think about the new formula and consequences (mostly reversed). Here is a list of the recommended references: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;[1] &lt;a href=&quot;http://math.nyu.edu/faculty/avellane/LETFRISKPROF.pdf&quot;&gt;Leveraged ETFs: All You Wanted to Know but Were Afraid to Ask&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[2] &lt;a href=&quot;http://www.risk.net/digital_assets/1118/giese_%28tech_2%29.pdf&quot;&gt;A Dynamic Model for Leveraged Funds&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[3] &lt;a href=&quot;http://www.google.com/url?sa=t&amp;amp;source=web&amp;amp;cd=5&amp;amp;ved=0CEcQFjAE&amp;amp;url=http%3A%2F%2Fwww.onlinetradersforum.com%2Fattachment.php%3Fattachmentid%3D4272%26d%3D124055976&amp;amp;ei=ok9yTuywBYWAsgKnmtDyCQ&amp;amp;usg=AFQjCNEve2yoI8z5Oqn0B7sSmweW6FQBgw&amp;amp;sig2=f2lahl_ynFSRL_A2lxl1wAattachmentid=4272&amp;amp;d=124055976&amp;amp;ei=ok9yTuywBYWAsgKnmtDyCQ&amp;amp;usg=AFQjCNEve2yoI8z5Oqn0B7sSmweW6FQBgw&amp;amp;sig2=f2lahl_ynFSRL_A2lxl1wA&quot;&gt;The Dynamics of Leveraged and Inverse Exchange-Traded Funds&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[4] &lt;a href=&quot;http://math.nyu.edu/faculty/avellane/thesis_Zhang.pdf&quot;&gt;Path-Dependence Properties of Leveraged Exchange-Traded Funds: Compounding, Volatility and Option Pricing&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;There is nothing magic after you read it: your volatility pumping (upward drift) will become volatility 'dragging' (downward) for leveraged ETFs. If you can fully understand dragging in leveraged ETFs (which is exactly the goal these references try to help you), you gain a complete understanding of pumping in CRP at the same time. Even better, these references indeed use the machinery of option theory :) &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can also prove to yourself that x1/2 leverage will maximize your volatility pumping (not in paper discussion, but it's very obvious once you understand it). &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, there are not much discussions regarding derivatives on leveraged assets in these references and others except for the last paper. But honestly once you master the underlying dynamics, solution for derivatives pricing isn't too far away :)&lt;/p&gt;&#xA;" OwnerUserId="1089" LastEditorUserId="1089" LastEditDate="2011-09-16T02:56:55.953" LastActivityDate="2011-09-16T02:56:55.953" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1936" PostTypeId="2" ParentId="1903" CreationDate="2011-09-15T20:28:24.657" Score="4" Body="&lt;p&gt;Your transition matrix $M$ has a time horizon associated with it, typically one year but sometimes 3 months or 5 years.  Assume for convenience the horizon is 3 months.  If it is not, you may wish to take a matrix square root to turn it into a 3 month matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the 6 month transition probabilities are formed by multiplying the matrix with itself, $ M \cdot M $ and the process can be repeated.  So $N$ quarters into the future, the appropriate matrix is $M^N$.  Let us take the convention that the first row $\{d_{1,j}\}_{j=1}^R$ of $M$ represents default.  Let's say the current rating corresponds to row $I$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A CDS has 2 kinds of cashflows, coupon payments $c_n$ and a default payment $D_n$  (normally $c_n$ and $D_n$ are constant).  The coupon payment $n$ quarters from now has probability $p_n$ of occurring that you can read as the non-default entries for the initial rating's row, $\sum_{j=2}^R (M^N)_{I,j}$, or more easily as $p_n=1-(M^N)_{I,1}$ since the probabilities must sum to 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The coupon leg $L_C = \sum_{n=1}^N PV_n p_n c_n$ of the CDS has value corresponding to the present value of these cashflows times their probabilities of occurring.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The default leg is priced similarly.  A default payment $D_n$ occurs only on the occurrence of a fresh default at iteration $n$.  The probability of this occurring is the sum of probabilities of achieving various ratings in the iteration just before default, times their respective probabilities of freshly defaulting in one more iteration.  That is to say, the total probability is is $q_n=\sum_{j=2}^R (M^{n-1})_{I,j} M_{j,1}$.  This payment may occur at any iteration $n$ occurring before default, so you have to total up the default value contributions for all $n$ prior to the contract expiration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The default leg $L_D = \sum_{n=1}^N PV_n q_n D_n$ has value equal to the sum of these payments times their probabilities of occurring.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The overall contract value can now be written as $L_D-L_C$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Technically, this is all known as a ratings migration model, and is used a lot for risk control.  The ratings paths form something called a Markov chain.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-09-15T20:28:24.657" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1937" PostTypeId="1" AcceptedAnswerId="1938" CreationDate="2011-09-15T21:08:56.193" Score="33" ViewCount="37958" Body="&lt;p&gt;I'm working on a small application that will provide some charts and graphs to be used for technical analysis. I'm new to TA but I'm wondering if there is a way to algorithmically identify the formation of certain patterns. In most of the TA literature I've read the authors explain how to identify these patterns visually. Is there a way to algorithmically determine these patterns so that I could, for example, examine the prices in code and identify a possible Head and Shoulders pattern?&lt;/p&gt;&#xA;" OwnerUserId="914" LastEditorUserId="1175" LastEditDate="2011-09-17T07:58:05.737" LastActivityDate="2016-05-13T12:34:19.800" Title="How to identify technical analysis chart patterns algorithmically?" Tags="&lt;algorithm&gt;&lt;technicals&gt;&lt;indicator&gt;" AnswerCount="6" CommentCount="0" FavoriteCount="43" ContentLicense="CC BY-SA 3.0" />
  <row Id="1938" PostTypeId="2" ParentId="1937" CreationDate="2011-09-15T21:41:34.827" Score="28" Body="&lt;p&gt;As &lt;a href=&quot;https://quant.stackexchange.com/q/81/1106&quot;&gt;mentioned&lt;/a&gt; &lt;a href=&quot;https://quant.stackexchange.com/q/1332/1106&quot;&gt;elsewhere&lt;/a&gt; on this site, &lt;a href=&quot;http://web.mit.edu/alo/www/Papers/1705-1765.pdf&quot; rel=&quot;noreferrer&quot;&gt;Lo, Mamaysky, and Wang (2000)&lt;/a&gt; do exactly what you're talking about, namely algorithmic detection of head and shoulders patterns.  Their definition:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Head-and-shoulders (HS) and inverted head-and-shoulders (IHS) patterns are characterized by a sequence of five consecutive local extrema $E_1,...,E_5$ such that&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$$ HS \equiv \begin{cases} E_1 \text{ is a maximum} \\ E_3 &amp;gt; E_1, E_3&#xA;&amp;gt; E_5 \\ E_1\text{ and }E_5\text{ are within 1.5 percent of their average} \\ E_2\text{ and }E_4\text{ are within 1.5 percent of their average,} \end{cases} $$&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$$ IHS \equiv \begin{cases} E_1\text{ is a minimum} \\ E_3&amp;lt;E_1, E_3 &amp;lt; E_5 \\ E_1\text{ and }E_5\text{ are within 1.5 percent of their average} \\ E_2\text{ and }E_4\text{ are within 1.5 percent of their average.} \end{cases} $$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2011-09-15T21:47:35.490" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1939" PostTypeId="2" ParentId="1937" CreationDate="2011-09-15T22:22:19.920" Score="18" Body="&lt;p&gt;I would recommend that you read &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470008741&quot;&gt;&quot;Evidence-Based Technical Analysis&quot;&lt;/a&gt; by David Aronson.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Firstly, I am mentioning it because it is a highly worthwhile book.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly, on pp151--161 he attempts to &quot;objectify subjective TA&quot;, using the head-and-shoulders pattern as an example.&lt;/p&gt;&#xA;" OwnerUserId="90" LastEditorUserId="90" LastEditDate="2011-09-16T06:21:00.317" LastActivityDate="2011-09-16T06:21:00.317" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="1940" PostTypeId="1" CreationDate="2011-09-16T03:11:44.820" Score="0" ViewCount="2665" Body="&lt;p&gt;I am a Linux user, and taking an investment and portfolio management course that uses excel. I was wondering if there are open source alternatives to excel for optimal portfolio calculations? If yes, are they used basically the same way as excel?&lt;/p&gt;&#xA;" OwnerUserId="408" LastEditorUserId="467" LastEditDate="2011-09-16T07:35:19.140" LastActivityDate="2011-09-16T09:30:29.967" Title="Open source alternative to excel for investment and portfolio calculations" Tags="&lt;software&gt;" AnswerCount="2" CommentCount="9" ClosedDate="2011-09-16T14:27:14.460" ContentLicense="CC BY-SA 3.0" />
  <row Id="1941" PostTypeId="2" ParentId="141" CreationDate="2011-09-16T05:46:23.593" Score="18" Body="&lt;p&gt;&lt;strong&gt;Academic access to Thomson Reuters Tick History:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;&lt;a href=&quot;http://www.sirca.org.au&quot; rel=&quot;noreferrer&quot;&gt;www.sirca.org.au&lt;/a&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The Thomson Reuters Tick History database provides millisecond-timestamped tick data going back to January 1996, covering 45 million OTC and exchange-traded instruments worldwide. The database currently updates at a rate of 1 million messages per second and is around 3 Petabytes uncompressed. It is a comprehensive, accurate and precise historical record of market behaviour. Includes API and MATLAB API access. Contact Sirca for more information.&lt;/p&gt;&#xA;" OwnerUserId="1391" LastEditorUserId="1040" LastEditDate="2016-10-21T03:18:23.657" LastActivityDate="2016-10-21T03:18:23.657" CommentCount="1" CommunityOwnedDate="2011-09-16T05:46:23.593" ContentLicense="CC BY-SA 3.0" />
  <row Id="1942" PostTypeId="2" ParentId="1940" CreationDate="2011-09-16T06:12:58.007" Score="5" Body="&lt;p&gt;You can try CrossOver Office or LibreOffice/OpenOffice Calc. And let me qualify that with: Don't go down the LibreOffice road, you run in al sorts of issues such as rounding errors and that one missing function and you will not get any support from your professor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On a personal note: During college I preferred to dual boot or use a VM.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2011-09-16T06:12:58.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1943" PostTypeId="2" ParentId="1940" CreationDate="2011-09-16T09:30:29.967" Score="6" Body="&lt;p&gt;One answer is to use R (see the Finance taskview &lt;a href=&quot;http://cran.r-project.org/web/views/Finance.html&quot;&gt;http://cran.r-project.org/web/views/Finance.html&lt;/a&gt; ).  In this case it does not work like Excel (and that's a good thing).&lt;/p&gt;&#xA;" OwnerUserId="249" LastActivityDate="2011-09-16T09:30:29.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1946" PostTypeId="1" AcceptedAnswerId="1954" CreationDate="2011-09-17T03:39:08.833" Score="9" ViewCount="167" Body="&lt;p&gt;Imagine that prior to entering the market you know beforehand the profit factor of similar situations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;trades similar to TRADE 1 have yielded a 1.2 pf &#xA;trades similar to TRADE 2 have yielded a 2.0 pf&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is the best way to manage lot sizes for the two different trades relative to each other?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The obvious thing to do is &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;TRADE 1 Lots = X*1.2&#xA;TRADE 2 Lots = X*2.0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but I am not sure if this is the smartest move.&lt;/p&gt;&#xA;" OwnerUserId="859" LastActivityDate="2011-09-19T08:59:21.947" Title="How should you manage lot sizes in this situation?" Tags="&lt;fx&gt;&lt;money-management&gt;&lt;best-practices&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1947" PostTypeId="1" CreationDate="2011-09-17T05:43:05.970" Score="11" ViewCount="466" Body="&lt;p&gt;I am attempting to evaluate and compare the profit factor of different &quot;test runs&quot; of a FOREX trading strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem is that, despite an average time between orders of 2hr+, some of these runs can have 20+ orders in a row, every 5 minutes, in the same direction. I need some way to normalize these clusters that occur without just throwing the data out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to treat the cluster as 1 data point by averaging the gain/loss of each trade within the cluster.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was thinking of doing it with a moving time window in the following manner:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;For each order:&#xA;Weight = 1/(N+1) &#xA;N =  count of consecutive orders within 30 minutes of the current order.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I am not sure if that is correct. &lt;/p&gt;&#xA;" OwnerUserId="859" LastActivityDate="2011-10-24T08:50:48.720" Title="How to &quot;uncluster&quot; a set of financial data?" Tags="&lt;data&gt;&lt;time-series&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1948" PostTypeId="2" ParentId="705" CreationDate="2011-09-17T08:42:09.217" Score="2" Body="&lt;p&gt;Antti Ilmanen in his book &lt;em&gt;Expected Returns&lt;/em&gt; shows this phenomenon in assets in addition to equities.  So it seems to be a general phenomenon rather than due to a cherry-picked example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;He also discusses (page 393) an explanation in addition to the lottery idea.  Investors that can not leverage but who seek higher returns will overweight high volatility assets.  This will tend to drive up their prices and hence drive down their expected returns.&lt;/p&gt;&#xA;" OwnerUserId="249" LastActivityDate="2011-09-17T08:42:09.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1950" PostTypeId="2" ParentId="832" CreationDate="2011-09-17T16:48:37.493" Score="3" Body="&lt;p&gt;I know only that Jurik's JMA is good causal filter, better than Kalman and Volterra filters, but I don't know for sure what algorithm inside - it's black box. Does anybody know better causal filter?&lt;/p&gt;&#xA;" OwnerUserId="1395" LastActivityDate="2011-09-17T16:48:37.493" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1951" PostTypeId="1" CreationDate="2011-09-17T18:06:13.343" Score="15" ViewCount="1233" Body="&lt;p&gt;There exist several volatility indices, such as the CBOE Volatility Index (VIX). There are also options on such indicies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the best way to price a volatility-index option? Is there a simple model that works well in terms of performance and precision?&lt;/p&gt;&#xA;" OwnerUserId="1208" LastEditorUserId="1208" LastEditDate="2011-09-17T19:54:04.717" LastActivityDate="2019-11-13T14:55:46.973" Title="How to price a volatility-index option?" Tags="&lt;volatility&gt;&lt;option-pricing&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="1952" PostTypeId="2" ParentId="1329" CreationDate="2011-09-18T14:58:18.537" Score="8" Body="&lt;p&gt;There are certainly (short-rate) models which assume bounded interest rates. I suppose I should clarify - the design of the model prohibits negative interest rates. Further, some models asymptotically reach some target, or mean rate which is considered mean reversion, the most famous perhaps the Vasicek.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Short rate models where rates cannot go negative:&lt;br&gt;&#xA;Cox-Ingersoll-Ross&lt;br&gt;&#xA;Black-Derman-Toy&lt;br&gt;&#xA;Black-Karasinsky&lt;br&gt;&#xA;Exponential Vasicek&lt;br&gt;&#xA;Hull-White  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Short rate models where rates can go negative:&lt;br&gt;&#xA;Ho-Lee&lt;br&gt;&#xA;Vasicek  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;These are all stochastic models that can be solved in discrete time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, each of these models have there own shortcomings. For example, the mean reversion in the Black-Derman-Toy model is dependent on volatility decay which only happens in practice if the modeled volatility is fit to traded securities whose volatility diminishes over time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;People may use an interest rate model which has the possibility of negative interest rates if they are valuing derivatives that might have a payoff of 0 when rates get low, or below some low but positive value. In other words, the interesting stuff happens at some high positive interest rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a simple example, think of a put option on a bond. This contract only gets interesting when the price of the bond goes down (with the corresponding rates going up) so it really doesn't matter if the model has negative rates in it because we're only interested in the payoffs when rates are high.&lt;/p&gt;&#xA;" OwnerUserId="1112" LastEditorUserId="1112" LastEditDate="2011-09-18T21:51:32.030" LastActivityDate="2011-09-18T21:51:32.030" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="1953" PostTypeId="2" ParentId="1947" CreationDate="2011-09-19T00:23:57.323" Score="4" Body="&lt;p&gt;That is definitely &lt;em&gt;not&lt;/em&gt; correct.  Your test results will suffer from look-ahead bias.  At the point in time that you will be entering your order, you will not know yet how many orders will come in the next 30 minutes, thus a proper backtest should not use that information to size the trade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are many factors to consider when running a proper backtest (see &lt;a href=&quot;http://en.wikipedia.org/wiki/Backtesting&quot; rel=&quot;nofollow&quot;&gt;wikipedia&lt;/a&gt;), but the key factor behind all of them is to replicate as closely as possible what is realizable in live trading.  In your case, that means that you will have to predict how many trades your strategy is about to enter and size all subsequent trades appropriately.  Once you reach your &quot;limit,&quot; at which point in real trading you would have run out of capital, your backtest is effectively prevented from entering new trades.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your strategy isn't able to predict whether trades are about to cluster, you could try an incremental system, whereby the first trade is assigned a proportion $\delta$ of total  capital, the second gets $\delta(1-\delta)$, etc.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-09-19T00:23:57.323" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="1954" PostTypeId="2" ParentId="1946" CreationDate="2011-09-19T08:59:21.947" Score="5" Body="&lt;p&gt;Maybe not really an answer, but a justification of your approach. It's likely that your results can be expresses as &#xA;$$&#xD;&#xA;\mathsf EX_1 = 1.2\text{ and }\mathsf EX_2 = 2&#xD;&#xA;$$&#xA;where $X_i$ for $i=1,2$ is a random pf of  a situation in a class $i$ (we denote it $S_i$). Your method solves the following problem: given a fixed number of trials we would like to maximize the average pf:&#xA;$$&#xD;&#xA;\mathsf E(\alpha X_1+(1-\alpha)X_2)\to\max_{\alpha\in[0,1]}&#xD;&#xA;$$&#xA;which certainly has a solution $\alpha = \frac{1.2}{1.2+2} = 0.375$ &lt;strong&gt;without any assumptions&lt;/strong&gt; on independence or correlation of $X_1$ and $X_2$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So your answer fits exactly this problem. On the other hand you can also think about the following model: given that you encounter $S_1$ let $p$ be the probability that the $S_2$ will appear before you close your $S_1$ position. So, $p$ is the probability that you will lose $S_2$ if you admit $S_1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you encounter $S_1$ you should decide if admit it, or wait for the possible better situation $S_2$. Let us admit $S_1$ with a probability $\beta$ - then what is the optimal $\beta$? The possible outcomes are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;you admit $S_1$ (pr = $\beta$), then pf = $X_1$;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;you reject $S_1$ (pr = $1-\beta$), $S_2$ appears (pr = $p$), then pf = $X_2$;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;you reject $S_1$ (pr = $1-\beta$), $S_2$ does not appear (pr = $1-p$), then pf = $0$;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;so expected pf is&#xA;$$&#xD;&#xA;\mathsf E(\beta X_1+(1-\beta)p X_2)\to\max_{\beta\in [0,1]}&#xD;&#xA;$$&#xA;so you have in the right-hand side $(1.2-2p)\beta+2p$ that is you always admit $S_1$ if $p&amp;lt;0.6$ and always reject $S_1$ if $p&amp;gt;0.6$.&lt;/p&gt;&#xA;" OwnerUserId="464" LastActivityDate="2011-09-19T08:59:21.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1955" PostTypeId="1" CreationDate="2011-09-19T11:15:44.240" Score="8" ViewCount="272" Body="&lt;p&gt;I'm progressing, all too slowly, on a site that aims to show real-time numbers for options that are listed on the CBOE. Most of the instantaneous numbers are all set. Now I'm going to pay attention to some of the trends in those numbers: option price, volume, put-call ratio, open interest, and similar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the sets of values I want to show for each option is MACD of price (others, too, but my question is about price).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; @Tal Fishman -- I want to show MACD because I understand that convergence/divergence of fast and slow EMA is helpful to a guy trying to decide whether or not to buy/sell an option. Am I quite wrong? SHould I abandon MACD and show something else? If so, what is that something else?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder how I should calculate the EMAs that contribute to the MACD for option price: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it more useful, appropriate, and usual to calculate EMA based on the price of the underlying? Or on the price of the option itself?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the question betrays my naïvté, well, so much the better: I welcome comments that tell me how I'm wrong &lt;em&gt;wrong&lt;/em&gt; &lt;strong&gt;&lt;em&gt;wrong&lt;/em&gt;&lt;/strong&gt;!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks so much! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The site is &lt;a href=&quot;http://www.sellmycalls.com/cgi-bin/chain&quot;&gt;http://www.sellmycalls.com/cgi-bin/chain&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="618" LastEditorUserId="618" LastEditDate="2011-09-19T21:18:45.373" LastActivityDate="2011-09-20T01:12:00.797" Title="What is more appropriate: the EMA of the option price or the EMA of the underlying?" Tags="&lt;options&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1956" PostTypeId="2" ParentId="1931" CreationDate="2011-09-19T13:43:59.470" Score="4" Body="&lt;p&gt;&lt;a href=&quot;http://seekingalpha.com/article/89209-comparing-etf-costs-and-counterparty-risk&quot; rel=&quot;nofollow&quot;&gt;There is a good article in Seeking Alpha&lt;/a&gt; but if you did a Google Search you probably found it already. Some ETF's work through swaps with a counterpart, but you will never know who the counter-part is. As you said it depends on the type of ETF, with a UCITS ETF you're not supposed to have a big counter-part risk as you own the underlyings, when it's replication, you never know.&lt;/p&gt;&#xA;" OwnerUserId="1181" LastActivityDate="2011-09-19T13:43:59.470" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1957" PostTypeId="2" ParentId="1955" CreationDate="2011-09-19T14:01:46.683" Score="4" Body="&lt;p&gt;Smoothing the underlying's price movements would decrease the volatility of the underlying, which in turn would lower the computed Black-Scholes option premium. This probably isn't the effect you want. (I also don't get the impression you're displaying &lt;em&gt;fair value&lt;/em&gt; anyway, just the market price.) So the EMA must be applied to the option's price.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-09-19T14:01:46.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1958" PostTypeId="2" ParentId="1951" CreationDate="2011-09-19T14:40:05.180" Score="2" Body="&lt;p&gt;Volatility and variance derivatives, such as the VIX, are priced by creating a replicating portfolio of options, weighted so as to have constant gamma for a wide range price levels. So an option on such a structure would necessarily be the sum of options on each of the individual options in the replicating portfolio. Thus, the question of their pricing reduces to the question of pricing options on options, which is easier to research. Or is the question how you price an option on an option?&lt;/p&gt;&#xA;" OwnerUserId="1398" LastActivityDate="2011-09-19T14:40:05.180" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1959" PostTypeId="2" ParentId="1777" CreationDate="2011-09-19T15:34:05.320" Score="4" Body="&lt;p&gt;I think, as with many machine learning approaches to investing decision support, it depends largely on the data. With a good selection of features, yes dynamic models like you're talking about will probably do better than a simple linear regression; but then again, with a good selection of features, linear regression will probably work reasonably well, too. On the other hand, with a poor selection of features, you can use any statistical model in the world and it won't work -- simply put, you can't learn from patterns that aren't there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That aside, you could probably also make gains by generalizing your search a bit from the models you describe to all Bayesian dynamic models.&lt;/p&gt;&#xA;" OwnerUserId="1398" LastActivityDate="2011-09-19T15:34:05.320" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1960" PostTypeId="2" ParentId="1236" CreationDate="2011-09-19T16:15:01.300" Score="6" Body="&lt;p&gt;While noble, unfortunately, this type of effort is not very practical. Mostly because market data is a major source of revenue for the market centers and is never simply given away, at least not in intraday form. A few things to consider:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Becoming a market data distributor is both costly and entails entering into agreements with each market center. If we simply consider US equities, that means completing contracts with a minimum of: NASDAQ, NYSE, BATS, and Direct Edge. This isn't a fun process. Simply purchasing data directly from these places, with no intent to re-distribute, entails tens to hundreds of pages of contract documents.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you do become a distributor you will be required to maintain accurate records of your end users. Not only that, but most venues require you to maintain records of your end users uses of the data. For example, one end user using the data on two separate devices would be responsible for paying twice for their market data usage. You have to collect device fees from these users, build a report, send that report to the market center, and then cut a check to the market center for your end users uses. This isn't a fun process.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Web sites such as Yahoo and Google pay handsomely for their right to redistribute data. Intraday data made available via API likely only represents a specific market center. For example, Yahoo, unsurprisingly, gets their intraday quotes from BATS. BATS is the easiest to work with in regards to market data (and most things, actually).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I were to contribute my market data to this effort I would be in violation of the many agreements I've signed as an end user of data. All of those agreements require me to indicate whether I intend to redistribute etc. Receiving data from folks that have no right to redistribute is a quick way to run into trouble, IMO.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2011-09-19T16:15:01.300" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1961" PostTypeId="2" ParentId="1951" CreationDate="2011-09-19T18:14:45.643" Score="7" Body="&lt;p&gt;There is a replicating portfolio for the VIX contract, involving one option and the underlying S&amp;amp;Ps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unlike for variance swaps on jump-free underlyings, though, the replicating portfolio requires a dynamic option hedge.  In practice, one uses more than one option to do the hedge because a given option's sensitivity to volatility (vega) and bid-offer spread will vary crazily over time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You ask about a simple model...one thing you can do is start with the variance swap formula and then do a convexity correction by integrating the VIX-related square root over the terminal probability distribution.  Beyond that, you're getting into stochastic volatility models, which are not super-simple but do enjoy reasonably efficient pricing schemes via fast fourier transforms.  See Jim Gatheral's book for more on that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, its worth noting that many VIX options traders just hedge against VIX futures, treating the whole thing as a Black-Scholes market with unusual skew, and making local linear approximations where necessary.  That takes balls but the spreads are so wide that it works.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-09-19T18:14:45.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1962" PostTypeId="2" ParentId="1955" CreationDate="2011-09-20T01:12:00.797" Score="3" Body="&lt;p&gt;I think concepts like MACD should typically be applied to underlying price rather than the option price. Option returns are not what &lt;a href=&quot;http://ssrn.com/abstract=1753788&quot; rel=&quot;nofollow&quot;&gt;Meucci&lt;/a&gt; calls an &quot;invariant,&quot; and concepts such as moving averages need to be applied to (sums of) invariants. What I meant in my comment, though, is that if your users will be using options to make volatility bets, then a MACD of implied volatility could make sense, but I've never seen this. &lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-09-20T01:12:00.797" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1963" PostTypeId="2" ParentId="1931" CreationDate="2011-09-20T07:45:21.220" Score="3" Body="&lt;p&gt;I recommend you read the &lt;a href=&quot;http://www.financialstabilityboard.org/publications/r_110412b.pdf&quot; rel=&quot;nofollow&quot;&gt;Financial Stability Board report&lt;/a&gt;. &lt;a href=&quot;http://ftalphaville.ft.com/blog/2011/04/13/544396/do-banks-see-etfs-as-inexpensive-funding-for-illiquid-securities-part-i/&quot; rel=&quot;nofollow&quot;&gt;FT Alphaville&lt;/a&gt; provides a nice summary of the report with plenty of links to investigate further. &lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-09-20T07:45:21.220" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1964" PostTypeId="1" AcceptedAnswerId="1980" CreationDate="2011-09-20T12:35:14.743" Score="6" ViewCount="157" Body="&lt;p&gt;Are there any &quot;standard&quot; VaR calculations run in a batch?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, testing a VaR calculation with a lag of 1,2, 5 or 10 days over 2 years?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Same question for the  percentile, 1%, 2.5%, 5% etc.&lt;/p&gt;&#xA;" OwnerUserId="1404" LastEditorUserId="1106" LastEditDate="2011-09-20T13:53:44.837" LastActivityDate="2011-09-24T15:47:33.010" Title="Which lags or percentiles should be run in a batch when calculating Value-at-Risk?" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;var&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1966" PostTypeId="1" AcceptedAnswerId="1968" CreationDate="2011-09-20T17:17:26.097" Score="12" ViewCount="749" Body="&lt;p&gt;Perusing the other SE network sites, particularly &lt;a href=&quot;https://softwareengineering.stackexchange.com/&quot;&gt;Programmers&lt;/a&gt;, I often find vigorous support for various agile software development methodologies, particularly the various values known as &lt;a href=&quot;http://en.wikipedia.org/wiki/Extreme_Programming&quot; rel=&quot;nofollow noreferrer&quot;&gt;Extreme Programming&lt;/a&gt; (I'm thinking of unit testing, coding standards, etc. and also SOLID principles, variable naming consistency).  Yet none of the quantitative researchers I know employ these methods and design principles anywhere near as rigorously as it would appear some software developers do.  In fact, many of these concepts are virtually unheard of outside the IT departments of many major financial institutions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Would it be worth my while to learn and adapt some of these principles to my work, or is it a waste of time?&lt;/strong&gt;  I would mostly be doing this on my own, since there is little desire on the part of my boss and colleagues to change the way we do things now.  Most of my code gets thrown away anyhow, and often the qualitative conclusions I reach are more important than re-usability.  That is, I am typically testing some hypothesis, and once I have reached a conclusion, that code is not really needed any more.  Occasionally I have to re-write large chunks of code to automate the recalculation of proprietary indicators I have developed, but I usually have no idea what will end up in production until I am nearly done with the research.  Besides, there may even be value in reviewing all the code as it is re-written now that I have an end goal in mind.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="-1" LastEditDate="2017-04-12T07:32:02.093" LastActivityDate="2011-09-22T18:29:18.660" Title="What benefits are there to employing agile software development methodologies for quants?" Tags="&lt;soft-question&gt;&lt;programming&gt;&lt;quants&gt;&lt;development&gt;" AnswerCount="5" CommentCount="1" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="1967" PostTypeId="2" ParentId="1964" CreationDate="2011-09-20T18:04:15.557" Score="4" Body="&lt;p&gt;Usually when it is for (market) risk management purposes it is quite standard to have 1 day horizon with (allegedly ;-) ) 99% confidence level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I know when it is for regulatory or economic capital requirement and/or Asset Liability Management then horizons might be much longer up to one year and confidence levels are usually 99% and 95%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards&lt;/p&gt;&#xA;" OwnerUserId="92" LastActivityDate="2011-09-20T18:04:15.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1968" PostTypeId="2" ParentId="1966" CreationDate="2011-09-20T20:45:27.317" Score="7" Body="&lt;p&gt;&quot;Extreme programming&quot; is a buzzword that has received a lot of hype in the past few years. However it's important to note that it's only one item in the long list of &lt;a href=&quot;https://secure.wikimedia.org/wikipedia/en/wiki/List_of_software_development_philosophies&quot;&gt;SW development philosophies&lt;/a&gt; and that it's not - contrary to its proponents' claims - a panacea.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other side it's very beneficial to follow a few simple rules while writing even small pieces of code. To the fundamental ones you already mentioned (sticking to a coding standard and a consistent naming convention) I'd add extensive commenting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your usage model (&quot;most of my code gets thrown away&quot; and &quot;conclusions I reach are more important than re-usability&quot;) I'd suggest setting up a simple repository and revision control. This may sound like an overkill but IMO you'll benefit from it in the long term:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;All pieces of your code are in one place and are easily accessible. My experience tells me that sooner or later you'll want to at least have a look at some code  written in the past - even if you thought that it wouldn't be needed anymore.&lt;/li&gt;&#xA;&lt;li&gt;Change tracking is trivial. The need to look at / go back to a previous version happens surprisingly often. Having a source repository at hand is then a godsend.&#xA;For the purposes listed above you don't need all the fancy features of modern revision control systems - just a central repository and linear history. I'd suggest going with Mercurial - there is no need for setting up a server, it's cross-platform and simple to use. It also has a nice GUI named TortoiseHg. To avoid having separate repositories for separate pieces of code you may use directories inside one big repository. The whole repository and Mercurial binaries may be put on a pen drive - there is no need to install anything if you don't want to.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Unit testing is extremely useful and beneficial in regular software development. I'm not sure if it'll help you in your work (research) apart from adding extra burden. But definitely start thinking of it as soon as you notice that you're transforming some of your code into e.g. a library of functions (or anything that is intended to be re-usable). And of course keep your unit test in your repository.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your type of work I'd also stick to &lt;a href=&quot;http://en.wikipedia.org/wiki/You_ain%27t_gonna_need_it&quot;&gt;YAGNI&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/KISS_principle&quot;&gt;KISS&lt;/a&gt; principles. (Wikipedia articles on them are sufficient to get a good grasp of them).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS For bs-free view on SW development I recommend works by Frederick Brooks.&lt;/p&gt;&#xA;" OwnerUserId="493" LastEditorUserId="1106" LastEditDate="2011-09-21T01:38:14.310" LastActivityDate="2011-09-21T01:38:14.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1969" PostTypeId="2" ParentId="141" CreationDate="2011-09-20T21:35:09.060" Score="6" Body="&lt;p&gt;Information on the FOMC Meeting dates can be in the &lt;a href=&quot;http://www.rose-hulman.edu/~bremmer/professional/fed_target_paper.htm&quot; rel=&quot;nofollow&quot;&gt;tables of this article&lt;/a&gt; and on the &lt;a href=&quot;http://www.federalreserve.gov/monetarypolicy/fomchistorical2005.htm&quot; rel=&quot;nofollow&quot;&gt;FED website&lt;/a&gt; but one would need to manually retype the data which takes time and is error prone.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a Python script to parse the meeting dates from the federalreserve.gov page that you linked: pastie.org/2566958. It pulls the dates from the url of the &quot;Minutes&quot; link for each meeting&lt;/p&gt;&#xA;" OwnerUserId="1409" LastEditorUserId="848" LastEditDate="2016-04-14T05:36:10.010" LastActivityDate="2016-04-14T05:36:10.010" CommentCount="5" CommunityOwnedDate="2011-09-20T21:35:09.060" ContentLicense="CC BY-SA 3.0" />
  <row Id="1970" PostTypeId="1" AcceptedAnswerId="1972" CreationDate="2011-09-21T12:06:37.140" Score="11" ViewCount="595" Body="&lt;p&gt;Reading up on quantitative methods, model development, and back-testing, one obvious question springs to mind:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What should one ask of a prototyping (model testing) framework?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know a lot of people use R, C/C++ and so on for testing, but does one have to re-invent everything or are there some features, such as basic statistics methods and data viewing capabilities, that one should ask for?&lt;/p&gt;&#xA;" OwnerUserId="1346" LastEditorUserId="1106" LastEditDate="2011-09-21T14:01:20.020" LastActivityDate="2011-09-21T16:38:46.270" Title="What to ask for in a good prototyping framework?" Tags="&lt;backtesting&gt;&lt;software&gt;&lt;modeling&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1971" PostTypeId="2" ParentId="1966" CreationDate="2011-09-21T13:51:57.507" Score="4" Body="&lt;p&gt;There are some Agile benefits that you will reap, even if you are the sole programmer.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You may feel silly doing a scrum by yourself in the morning. But you may find it to be a benefit to plan what you would like to work on that day, and to think about what you might need that day (especially if you need to read about solving a quant problem).&lt;/li&gt;&#xA;&lt;li&gt;Planning out what will be released in the next (short) release cycle is a valuable skill that can help you shape the project as a whole. Estimating the time to release a feature and measuring actual time will help you to avoid fantasy estimates and help you gauge your abilities as a developers. It helps you think globally, about software strategy (think Field Marshall); your tendency may be to think locally, in the trenches.&lt;/li&gt;&#xA;&lt;li&gt;Building unit tests as you go will server you wonderfully in two ways. First, it documents what you have done and how to use your classes under test. (This works well when you're going back several weeks or months and can't remember how to use the class.) Second, and more important, it helps you think about the &lt;em&gt;software contract&lt;/em&gt;, that is, what different objects are responsible to do. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;A word about general design principles: if you find yourself throwing away large pieces of code, you may need to abstract-out your classes. For example, if there are methods that every fixed-income equity needs to respond to, such as nominal interest or par value, then perhaps you need an abstract fixed-income object. If there are fields that every equity object has, such as a CUSIP or a company name, then consider an abstract equity object with those fields.&lt;/p&gt;&#xA;" OwnerUserId="343" LastActivityDate="2011-09-21T13:51:57.507" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1972" PostTypeId="2" ParentId="1970" CreationDate="2011-09-21T14:24:35.333" Score="7" Body="&lt;p&gt;There is a huge difference between R (and Matlab, SAS, or other statistical languages) and relatively low-level languages such as C/C++/C#/Java in exactly this regard.  The latter category is used more often for stable end-products, where speed and performance can be crucial, whereas the former category is used more often for model testing and prototyping.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The statistical languages have many basic features, including those you mention, basic statistics and data viewing, as well as much else that will make prototyping a much easier and quicker process.  Some of the features I use most in may day-to-day model development and backtesting are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Optimization (importance of good optimization algos is not to be underestimated!)&lt;/li&gt;&#xA;&lt;li&gt;Linear algebra (eigenvalues, singular value decomposition)&lt;/li&gt;&#xA;&lt;li&gt;Interpolation (cubic splines)&lt;/li&gt;&#xA;&lt;li&gt;Filtering (FIR, IIR, EMA)&lt;/li&gt;&#xA;&lt;li&gt;Read/write to CSV/Excel/databases/other formats&lt;/li&gt;&#xA;&lt;li&gt;Advanced graphics (bar charts, histograms, box plots, scatter, 3-D)&lt;/li&gt;&#xA;&lt;li&gt;Date/time manipulation and time-series support&lt;/li&gt;&#xA;&lt;li&gt;Vector/matrix manipulation (data manipulation)&lt;/li&gt;&#xA;&lt;li&gt;Large library of less-commonly used algorithms (e.g. &lt;a href=&quot;http://en.wikipedia.org/wiki/Expectation-maximization_algorithm&quot; rel=&quot;nofollow&quot;&gt;Expectation-Maximization&lt;/a&gt;) available as packages&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'm sure many of these features could also be found in low-level languages, but the level of tight integration makes them much easier to use in the statistical languages.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-09-21T16:38:46.270" LastActivityDate="2011-09-21T16:38:46.270" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1973" PostTypeId="2" ParentId="1966" CreationDate="2011-09-21T16:03:22.270" Score="1" Body="&lt;p&gt;An important part of research is reproducibility of results. There is no point of drawing conclusions, if you can't reproduce the data to back them up. For this you need at least an organized way of storing your code, so that you can find what was the algorithm you used to produce that graph. A source code repositore is an ideal way to do it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the same token, unit tests are useful in research because they give you a better guarantee that your code actually does what you think it does.&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2011-09-21T16:03:22.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1974" PostTypeId="2" ParentId="1658" CreationDate="2011-09-21T16:37:25.727" Score="13" Body="&lt;p&gt;&lt;strong&gt;This answer is my ongoing attempt to consolidate some recent commentary on this hot topic.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A good place to start for anyone thinking about this question is the Economists's &lt;a href=&quot;http://www.economist.com/node/21525456&quot;&gt;Buttonwood: Not So Fast&lt;/a&gt;, which mentions recent research by &lt;a href=&quot;http://idei.fr/doc/conf/pwri/biais_pwri_0311.pdf&quot;&gt;Biais and Woolley (2011)&lt;/a&gt; and &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1754215&quot;&gt;Dichev, Huang, and Zhou (2011)&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.dauphine.fr/cereg/UserFiles/File/WFMQ2008_7.pdf&quot;&gt;Does Algorithmic Trading Improve Liquidity?&lt;/a&gt; This paper claims &lt;em&gt;yes&lt;/em&gt;. Nevertheless, it does not answer Buttonwood's concern that the improved liquidity is illusory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A survey commissioned by LiquidNet (written up in the &lt;a href=&quot;http://www.ignites.com/c/249761/30291/high_frequency_trading_rattles_fund_traders_survey?referrer_module=emailMorningNews&amp;amp;module_order=3&amp;amp;code=ZEdacGMyaHRZVzVBYkc5eVpHRmlZbVYwZEM1amIyMHNJREV4TnpjeU56SXNJREV5TXpJNU1UQTFOdz09&quot;&gt;Financial Times&lt;/a&gt;), charges that &quot;high-frequency trading strategies are at direct odds with investors, and it’s incumbent on the institutions to protect the information and the orders of their investors.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Andrew Haldane, Executive Director, Financial Stability and member of the interim&#xA;Financial Policy Committee at the Bank of England, gave a speech on this topic entitled &lt;a href=&quot;http://www.bankofengland.co.uk/publications/speeches/2011/speech509.pdf&quot;&gt;The Race to Zero&lt;/a&gt;.  Mark Buchanan is doing a series on HFT based on this speech &lt;a href=&quot;http://physicsoffinance.blogspot.com/2011/09/high-frequency-trading-downside-part-i.html&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Institutional equity managers are clearly very worried about the effects of HFT on their costs, according to a &lt;a href=&quot;http://www.tabbgroup.com/PublicationDetail.aspx?PublicationID=801&quot;&gt;TABB survey&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.ft.com/cms/s/0/38452490-da07-11e0-b199-00144feabdc0.html#ixzz1ZC012jau&quot;&gt;Studies say no link between HFT and volatility [Financial Times]&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://highfrequencytradingreview.com/pdf/11-1276-the-future-of-computer-trading-in-financial-markets.pdf&quot;&gt;The Future of Computer Trading in Financial Markets – Working Paper&lt;/a&gt;.  Commentary by &lt;a href=&quot;http://highfrequencytradingreview.com/the-future-of-computer-trading-in-financial-markets-working-paper/&quot;&gt;High Frequency Trading Review&lt;/a&gt;.  &lt;a href=&quot;http://www.moneyscience.com/pg/blog/Admin/read/114402/the-future-of-computer-trading-in-financial-markets-supplementary-materials-research-and-reviews&quot;&gt;MoneyScience&lt;/a&gt; has this as just one of a slew of recent papers.  Many were commissioned by the UK's &lt;a href=&quot;http://www.bis.gov.uk/foresight/our-work/projects/current-projects/computer-trading/working-paper&quot;&gt;Department for Business Innovation &amp;amp; Skills&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Morningstar writes: &lt;a href=&quot;http://advisor.morningstar.com/Uploaded/PDF/AIO_QuarterlyQ42010_NonACC.pdf&quot;&gt;Market Structure Arbitrage Fast trading techniques that are making&#xA;some investors furious.&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2012-01-04T22:23:44.547" LastActivityDate="2012-01-04T22:23:44.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1975" PostTypeId="2" ParentId="1966" CreationDate="2011-09-21T17:26:17.587" Score="8" Body="&lt;p&gt;I have only seen one framework that works in a research oriented development environment which is the &lt;a href=&quot;http://en.wikipedia.org/wiki/Spiral_model&quot;&gt;spiral model&lt;/a&gt;. Using try agile methodologies is impossible because the frontier of tasks is not known. Agile is very useful for building/maintaining known applications with known functionality and problem spaces. It is not useful for research oriented development since agile requires good estimates to plan releases (you could say this about almost any methodology but it is very important to agile).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a team I used to work in the spiral model went something like this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Three weeks of research&lt;/li&gt;&#xA;&lt;li&gt;Three weeks of building&lt;/li&gt;&#xA;&lt;li&gt;Three weeks of integration, testing and deployment&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I thought it worked very well. In a larger team than I have now I would use a variant of this again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All that being said software development methodologies are a religious war and I think anything can work. Honestly I think that until you have several people working on the same component and a larger team agile or any other methodology is going to have very low returns as all approaches are attempting to solve the problem of communication overhead in a large group of people.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In our 3 man trading shop we use the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;No formal software development methodology&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.pivotaltracker.com&quot;&gt;Pivotal Tracker&lt;/a&gt; for task tracking&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.github.com&quot;&gt;Github&lt;/a&gt; for source control&lt;/li&gt;&#xA;&lt;li&gt;Central build server with static code analysis for enforcing coding standards, especially things like functions that we don't allow&lt;/li&gt;&#xA;&lt;li&gt;Code reviews. We read each others code. In my experience code reviews more than anything else lead to better code.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What works for me may not work for you. Remember if you are serious measure the before/after productivity with the introduction of any methodology. If you can't see an improvement in either code quality/features shipped you are spitting in the wind.&lt;/p&gt;&#xA;" OwnerUserId="373" LastActivityDate="2011-09-21T17:26:17.587" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1976" PostTypeId="1" AcceptedAnswerId="1979" CreationDate="2011-09-21T23:22:42.130" Score="-2" ViewCount="80" Body="&lt;p&gt;If a company issues commercial paper and the bookkeeper, bank A, receives a buy order from bank B, in which bank B creates credit to buy the commercial paper, does the company has a credit in bank B or does bank B owe himself and has the asset of the commercial paper?&lt;/p&gt;&#xA;" OwnerUserId="1413" LastActivityDate="2011-09-22T01:18:30.060" Title="Who is in debt when a bank investments in commercial paper?" Tags="&lt;accounting&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2011-09-22T09:49:37.433" ContentLicense="CC BY-SA 3.0" />
  <row Id="1977" PostTypeId="2" ParentId="737" CreationDate="2011-09-21T23:54:18.183" Score="4" Body="&lt;p&gt;I found a very good process for running a walk forward analysis in The Encyclopedia of Technical Market Indicators, Second Edition: &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0070120579&quot; rel=&quot;nofollow&quot;&gt;http://www.amazon.com/Encyclopedia-Technical-Market-Indicators-Second/dp/0070120579&lt;/a&gt; . &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The approach in the book helps mitigate the problem described above of assemble/test/retest. When you finally implement a trading system, it should have a good chance of success.&lt;/p&gt;&#xA;" OwnerUserId="1384" LastActivityDate="2011-09-21T23:54:18.183" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1978" PostTypeId="2" ParentId="492" CreationDate="2011-09-21T23:59:38.193" Score="3" Body="&lt;p&gt;You need to track your current position for each stock in the software. You need a process to find out when an order is executed, and update your position for the appropriate stock. This process is separate from sending orders to the market.&lt;/p&gt;&#xA;" OwnerUserId="1384" LastActivityDate="2011-09-21T23:59:38.193" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1979" PostTypeId="2" ParentId="1976" CreationDate="2011-09-22T01:18:30.060" Score="0" Body="&lt;p&gt;This is off topic in my humble opinion, but.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Company owes Bank B and Bank B has the paper as an asset on its balance sheet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Double-entry_bookkeeping_system&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Double-entry_bookkeeping_system&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1181" LastActivityDate="2011-09-22T01:18:30.060" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1980" PostTypeId="2" ParentId="1964" CreationDate="2011-09-22T13:10:39.293" Score="5" Body="&lt;p&gt;Standard (read: regulators will accept it) could be a one day, 99% VaR calculated with two years of historical data.  A minimum of one year of history is needed although this is not the norm.  Typically the one-day VaR is transformed into a 10-day VaR by scaling the calculation by sqrt(10).  However, the new market risk rule governs that one justify their use of the square-root factor leaving the alternative of an actual 10-day VaR calculation (a lag of 10 days as you suggest).  &lt;/p&gt;&#xA;" OwnerUserId="826" LastActivityDate="2011-09-22T13:10:39.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1981" PostTypeId="1" CreationDate="2011-09-22T15:42:15.907" Score="7" ViewCount="1721" Body="&lt;p&gt;Beyond optimal / partial f and a few other older methods, there's very little information out there for futures trading.&lt;/p&gt;&#xA;" OwnerUserId="1416" LastActivityDate="2011-09-22T22:52:56.797" Title="What position-sizing methods are used in futures trading?" Tags="&lt;risk-management&gt;&lt;portfolio-management&gt;&lt;position-sizing&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1983" PostTypeId="2" ParentId="1981" CreationDate="2011-09-22T16:22:35.670" Score="7" Body="&lt;p&gt;The &lt;a href=&quot;http://en.wikipedia.org/wiki/Kelly_criterion&quot; rel=&quot;noreferrer&quot;&gt;Kelly criterion&lt;/a&gt; is a very popular bet-sizing method.  &lt;a href=&quot;http://www.edwardothorp.com/&quot; rel=&quot;noreferrer&quot;&gt;Edward Thorp&lt;/a&gt; has written a great deal on this topic.  You can try googling for more, or start with his &lt;a href=&quot;http://www.edwardothorp.com/sitebuildercontent/sitebuilderfiles/KellyCriterion2007.pdf&quot; rel=&quot;noreferrer&quot;&gt;review of the concept&lt;/a&gt;, or a recent paper, &lt;a href=&quot;http://www.edwardothorp.com/sitebuildercontent/sitebuilderfiles/KellySimulationsNew.pdf&quot; rel=&quot;noreferrer&quot;&gt;Medium Term Simulations of The Full Kelly and Fractional Kelly Investment Strategies&lt;/a&gt;.  This is not specific to futures, but I'm not sure why you would need something specific to futures.  I've never heard of optimal f, but at first blush it sounds a lot like a dumbed-down Kelly criterion.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-09-22T16:22:35.670" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1984" PostTypeId="2" ParentId="1981" CreationDate="2011-09-22T16:31:34.703" Score="4" Body="&lt;p&gt;&lt;em&gt;Money Management Strategies for Futures Traders&lt;/em&gt; by Nauzer J. Balsara is a good resource.&lt;/p&gt;&#xA;" OwnerUserId="56" LastActivityDate="2011-09-22T16:31:34.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1985" PostTypeId="1" AcceptedAnswerId="2008" CreationDate="2011-09-22T17:00:30.927" Score="47" ViewCount="4790" Body="&lt;p&gt;My question is pretty simple: what papers do you feel are foundational to quantitative finance?  I'm compiling a personal reading list already, drawn from Wilmott forums, papers referenced in Derivatives, and other sources.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the body of research is immense, especially in recent years, so I'm interested in what the professionals are reading/building their work off of.  Any references the community could offer would be much appreciated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&#xA;As per the comments I'll define recent years as post 2000 with an emphasis on research after the crash of 2008.  In particular, I'm seeking papers on quantitative management of portfolios and asset pricing.&lt;/p&gt;&#xA;" OwnerUserId="1354" LastEditorUserId="1354" LastEditDate="2011-09-22T17:15:08.480" LastActivityDate="2011-11-16T23:09:20.607" Title="What papers have progressed the field of quantitative finance in recent years (post 2000)?" Tags="&lt;research&gt;&lt;soft-question&gt;&lt;reference-request&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="76" CommunityOwnedDate="2011-09-22T17:04:33.650" ContentLicense="CC BY-SA 3.0" />
  <row Id="1986" PostTypeId="2" ParentId="1658" CreationDate="2011-09-22T17:15:14.060" Score="3" Body="&lt;p&gt;This is a really good question. The media loves to bash HFT and Algorithmic Trading as some kind of evil that steals money from working people. HFT makes a great scapegoat for people who don't understand it and are losing money.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think HFT really doesn't have a net benefit or cost. It's just another way of using technology to make money. Yes, people make money using HTF. But they also create jobs and build businesses.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ultimately HFT increases the &lt;strong&gt;&lt;em&gt;efficiency&lt;/em&gt;&lt;/strong&gt; of the markets.&lt;/p&gt;&#xA;" OwnerUserId="1384" LastActivityDate="2011-09-22T17:15:14.060" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1987" PostTypeId="2" ParentId="1480" CreationDate="2011-09-22T17:25:42.520" Score="3" Body="&lt;p&gt;I think it depends on many factors: the characteristics of the market, the consistency of the market, the number of parameters, the optimization criteria and methodology, the time frame (whether it trades weekly, hourly, by minute, etc), and even the trading strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One approach to answer this question would be to test on many different assets and compare the results of different in sample/out of sample ratios. For example, if you have a system that trades large cap stocks, then maybe you could test different in sample/out of sample ratios on 100 large cap stocks. Then analyze the &lt;strong&gt;&lt;em&gt;average and distribution&lt;/em&gt;&lt;/strong&gt; of Sharpe Ratios for each in sample/out of sample ratio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would be looking for not only high average Sharpe Ratio but few low outliers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, due to the many problems of in sample/out of sample testing, I wonder if there are other approaches that have higher likelihood of producing profitable systems.&lt;/p&gt;&#xA;" OwnerUserId="1384" LastActivityDate="2011-09-22T17:25:42.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1988" PostTypeId="2" ParentId="1966" CreationDate="2011-09-22T17:44:31.013" Score="3" Body="&lt;p&gt;As an agile developer and quant finance programmer, I think that unit testing is invaluable. Because you really never know if your code is doing what it is supposed to do without tests. How do you know that your code is calculating your proprietary indicators correctly? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You probably ran your new code and checked the result against some other code or system that is known to be correct. &lt;strong&gt;&lt;em&gt;That is precisely what a test is.&lt;/em&gt;&lt;/strong&gt; The only difference is that instead of doing it once manually, you save the expected output as part of a test.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This has several benefits&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You can check your code at any time in a few minutes with virtually no effort.&lt;/li&gt;&#xA;&lt;li&gt;You can refactor your code and be confident that it is still correct.&lt;/li&gt;&#xA;&lt;li&gt;You can improve the quality of the test. Instead of doing a quick test once, you can save a large amount of the expected output. This will minimize the possibility of small bugs that only show up occasionally. For example, instead of checking that a few rows of the indicator data is correct, you can verify that it is correct for thousands of rows and dozens of assets.&lt;/li&gt;&#xA;&lt;li&gt;You can create new code from scratch for production, and use the tests to verify that it is correct.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I think that unit testing is particularly important for quantitative finance because the intermediate results are never really checked. For example, you can create custom indicators but the results are used by an algorithm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1933988274&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;The Art of Unit Testing&lt;/em&gt;&lt;/a&gt; easy to use and understand. It's for .NET programmers.&lt;/p&gt;&#xA;" OwnerUserId="1384" LastEditorUserId="1106" LastEditDate="2011-09-22T18:29:18.660" LastActivityDate="2011-09-22T18:29:18.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1989" PostTypeId="1" AcceptedAnswerId="1991" CreationDate="2011-09-22T18:00:36.953" Score="8" ViewCount="2035" Body="&lt;p&gt;Question: if VIX is the Implied Volatility of SPX, 30 days in the future, how many days into the future does VIX vol look? +60 or +30?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets see if I'm on the right track:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Premise 1: VIX is the Implied Volatility (IV) of SPX, looking +30 days into the future (actually, technically VIX is a variance swap, but for all intents and purposes its 99% correlated to the IV).&lt;/li&gt;&#xA;&lt;li&gt;Premise 2: Lets define VIX vol as the Implied Volatility (IV) of VIX, calculated from options on VIX, normalized to +30 days in the future (I am assuming that we calculate VIX vol using the same method as used to calculate SPX vol, by using the front and back month of the VIX options, then normalising this to a 30-day time horizon).&lt;/li&gt;&#xA;&lt;li&gt;Premise 3: Thus, VIX vol is equivalent to the vol-of-vol of SPX.&lt;/li&gt;&#xA;&lt;li&gt;Premise 4: VIX is the expected volatility of SPX, +30 days into the future.&lt;/li&gt;&#xA;&lt;li&gt;Premise 5: VIX vol is the expected volatility of VIX, +30 days further into the future.&lt;/li&gt;&#xA;&lt;li&gt;Premise 6: Therefore, VIX vol is the expected vol-of-vol of SPX, +60 days into the future?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="906" LastActivityDate="2011-09-22T19:56:26.007" Title="If VIX is the Implied Volatility of SPX, 30 days in the future, how many days into the future does VIX vol look?" Tags="&lt;implied-volatility&gt;&lt;vix&gt;&lt;spx&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1990" PostTypeId="2" ParentId="1985" CreationDate="2011-09-22T18:25:49.027" Score="9" Body="&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0070248826&quot;&gt;Grinold and Kahn (2000)&lt;/a&gt; remains the bible for people just starting to get into quantitative portfolio management.  Some readers may prefer the treatment in &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0471124109&quot;&gt;Litterman (2003)&lt;/a&gt;.  Both of these, however, are thorough books covering all the foundational material.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most of the recent work in portfolio management has built upon the research covered in those books. Here are some important recent papers:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://faculty.fuqua.duke.edu/~charvey/Teaching/BA491_2005/Transfer_coefficient.pdf&quot;&gt;Portfolio constraints and the Fundamental Law of Active Management&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ssrn.com/abstract=1213323&quot;&gt;Enhancing the Black-Litterman and Related Approaches: Views and Stress-Test on Risk Factors&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Some important recent papers in asset pricing:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ssrn.com/abstract=1139062&quot;&gt;Factor Models in Portfolio and Asset Pricing&lt;/a&gt; (summary paper)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-09-23T19:42:30.050" LastActivityDate="2011-09-23T19:42:30.050" CommentCount="0" CommunityOwnedDate="2011-09-22T18:25:49.027" ContentLicense="CC BY-SA 3.0" />
  <row Id="1991" PostTypeId="2" ParentId="1989" CreationDate="2011-09-22T19:56:26.007" Score="4" Body="&lt;p&gt;You are very close.  VIX vol is indeed a vol-of-vol.  However the way VIX options actually work is that they expire into the futures, which themselves have value derived from 30-day options on expiration day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is to say, the VIX spot index today has &lt;em&gt;no&lt;/em&gt; direct relationship to the VIX options you can trade today.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A VIX option vol is the volatility of (implied) volatility for a &lt;em&gt;specific&lt;/em&gt; one month period starting on the contract expiration day, and ending a month after that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, all this stuff is highly correlated of course, so you can pretend that VIX spot is telling you things about the options and vice versa.  But the relationships need not hold solid, just as, say, eurodollar futures for disparate expirations can differ. &lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-09-22T19:56:26.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1992" PostTypeId="1" AcceptedAnswerId="2009" CreationDate="2011-09-22T20:18:34.053" Score="8" ViewCount="255" Body="&lt;p&gt;Let's say I have one strategy that has a hedging error of:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2,&#xA;2,&#xA;-2,&#xA;-2&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say I have another strategy that has a hedging error of &lt;/p&gt;&#xA;&#xA;&lt;p&gt;.5,&#xA;.5,&#xA;3,&#xA;3&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would it be a better idea to grade the hedging strategies based on the sum of hedging errors (absolute value) or the sum of squares of hedging errors?  Why?&lt;/p&gt;&#xA;" OwnerUserId="551" LastEditorUserId="1106" LastEditDate="2011-09-25T21:15:16.537" LastActivityDate="2011-09-26T22:40:53.930" Title="Is it better to grade hedging strategies based on the sum of absolute or squared hedging errors?" Tags="&lt;risk&gt;&lt;hedging&gt;&lt;statistics&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="1993" PostTypeId="1" AcceptedAnswerId="2018" CreationDate="2011-09-22T21:46:57.580" Score="6" ViewCount="1390" Body="&lt;p&gt;And, in a second round, what is the origin of the &quot;long&quot; and &quot;short&quot; in characterizing the respective positions in assets? Any pointers to etymology, first occurrences, or related literature would be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="114" LastActivityDate="2011-09-25T10:52:33.090" Title="What is the origin of the words &quot;put&quot; and &quot;call&quot; that characterize derivatives?" Tags="&lt;history&gt;&lt;general&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="1994" PostTypeId="2" ParentId="1981" CreationDate="2011-09-22T22:38:51.110" Score="4" Body="&lt;p&gt;Van Tharp's &lt;a href=&quot;http://www.vantharp.com/products/definitive-guide-position-sizing.asp&quot; rel=&quot;nofollow&quot;&gt;Definitive Guide to Position Sizing&lt;/a&gt; identifies 31 separate position sizing models (be sure to check out the extended table of contents). Specifically for futures trading, I quite like Ryan Jones' Fixed Ratio position sizing, a nice overview of which is available &lt;a href=&quot;http://www.breakoutfutures.com/Newsletters/Newsletter0703.htm&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;, book on &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0471316989&quot; rel=&quot;nofollow&quot;&gt;Amazon&lt;/a&gt; and OTT website &lt;a href=&quot;http://www.fixedratio.com/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="252" LastEditorUserId="252" LastEditDate="2011-09-22T22:52:56.797" LastActivityDate="2011-09-22T22:52:56.797" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1995" PostTypeId="2" ParentId="613" CreationDate="2011-09-23T02:18:01.033" Score="11" Body="&lt;p&gt;I really wouldn't implement time series on my own unless I had a good reason to.  AQR uses pandas, almost everyone in R using zoo or xts. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I never like multiple parallel arrays, if it breaks everything is broken, plus it gets uglier as you increment data.  If you are doing something in C++, why not have an array of structs for each object where you have quote,time and all other data you need?&lt;/p&gt;&#xA;" OwnerUserId="1368" LastActivityDate="2011-09-23T02:18:01.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1996" PostTypeId="2" ParentId="581" CreationDate="2011-09-23T02:33:56.367" Score="4" Body="&lt;p&gt;You should look into inhomogeneous time series operators.  The original reference for this work is &lt;a href=&quot;http://ssrn.com/abstract=261149&quot; rel=&quot;nofollow&quot;&gt;Zumbach and Muller (2001)&lt;/a&gt;.  An excellent introduction to the material can be found in &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0122796713&quot; rel=&quot;nofollow&quot;&gt;An Introduction to High-Frequency Finance&lt;/a&gt;, starting on page 59.  I also found online a book chapter from &lt;a href=&quot;http://www.springer.com/cda/content/document/cda_downloaddocument/9780387279657-c1.pdf?SGWID=0-0-45-169676-p59330694&quot; rel=&quot;nofollow&quot;&gt;Modeling Financial Time Series with S-PLUS&lt;/a&gt; that includes code for the inhomogeneous EMA (section 9.2.4).&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-09-23T02:33:56.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="1997" PostTypeId="1" AcceptedAnswerId="1998" CreationDate="2011-09-23T03:40:45.050" Score="12" ViewCount="1415" Body="&lt;p&gt;My objective is to measure the modified-CVAR for a portfolio given its weights and matrix of security returns. Luckily the wonderful package PerformanceAnalytics has an ES() function that does just this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The issue I am having is that modified-CVAR takes minutes to compute, when according to this &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1024151&quot; rel=&quot;noreferrer&quot;&gt;paper&lt;/a&gt; (by the same authors) the algorithm should only take seconds: &quot;...we provide a long but explicit formula for computing the derivative of mES. Although the resulting formulae are rather complex, they lend themselves to efficient translation into a simple algorithm that computes in less than a second mES and component mES, even for portfolios with a very large number of assets.&quot; (page 14)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I re-produce code from a &lt;a href=&quot;http://cran.r-project.org/web/.../DEoptim/.../DEoptimPortfolioOptimization.pdf&quot; rel=&quot;noreferrer&quot;&gt;vignette&lt;/a&gt; which works fine when using &lt;code&gt;method = &quot;gaussian&quot;&lt;/code&gt; but not &lt;code&gt;method = &quot;modified&quot;&lt;/code&gt;. I have also reviewed the &lt;a href=&quot;http://cran.r-project.org/web/packages/PerformanceAnalytics/PerformanceAnalytics.pdf&quot; rel=&quot;noreferrer&quot;&gt;CRAN reference&lt;/a&gt; for the PerformanceAnalytics package although it is not as clear as the paper (linked above).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(PerformanceAnalytics)&#xA;&#xA;tickers = c( &quot;VNO&quot; , &quot;VMC&quot; , &quot;WMT&quot; , &quot;WAG&quot; , &quot;DIS&quot; , &quot;WPO&quot; , &quot;WFC&quot; , &quot;WDC&quot; ,&#xA; &quot;WY&quot; , &quot;WHR&quot; , &quot;WMB&quot; , &quot;WEC&quot; , &quot;XEL&quot; , &quot;XRX&quot; , &quot;XLNX&quot; ,&quot;ZION&quot; ,&quot;MMM&quot; ,&#xA; &quot;ABT&quot;, &quot;ADBE&quot; , &quot;AMD&quot; , &quot;AET&quot; , &quot;AFL&quot; , &quot;APD&quot; , &quot;ARG&quot; ,&quot;AA&quot; , &quot;AGN&quot; ,&#xA; &quot;ALTR&quot; , &quot;MO&quot; , &quot;AEP&quot; , &quot;AXP&quot; , &quot;AIG&quot; , &quot;AMGN&quot; , &quot;APC&quot; ,&quot;ADI&quot; , &quot;AON&quot; ,&#xA; &quot;APA&quot;, &quot;AAPL&quot; , &quot;AMAT&quot; ,&quot;ADM&quot; , &quot;T&quot; , &quot;ADSK&quot; , &quot;ADP&quot; , &quot;AZO&quot; , &quot;AVY&quot; ,&#xA; &quot;AVP&quot;, &quot;BHI&quot; , &quot;BLL&quot; , &quot;BAC&quot; , &quot;BK&quot; , &quot;BCR&quot; , &quot;BAX&quot; , &quot;BBT&quot; , &quot;BDX&quot; ,&#xA; &quot;BMS&quot; , &quot;BBY&quot; , &quot;BIG&quot; , &quot;HRB&quot; , &quot;BMC&quot; , &quot;BA&quot; , &quot;BMY&quot; , &quot;CA&quot; , &quot;COG&quot; ,&#xA; &quot;CPB&quot; , &quot;CAH&quot; , &quot;CCL&quot; , &quot;CAT&quot; , &quot;CELG&quot; , &quot;CNP&quot; , &quot;CTL&quot; , &quot;CEPH&quot;, &quot;CERN&quot; ,&#xA; &quot;SCHW&quot; , &quot;CVX&quot; , &quot;CB&quot; , &quot;CI&quot; ,&quot;CINF&quot; ,&quot;CTAS&quot; , &quot;CSCO&quot; , &quot;C&quot; , &quot;CLF&quot; ,&#xA; &quot;CLX&quot;, &quot;CMS&quot; , &quot;KO&quot; , &quot;CCE&quot; , &quot;CL&quot; , &quot;CMCSA&quot; ,&quot;CMA&quot; , &quot;CSC&quot; , &quot;CAG&quot; ,&#xA; &quot;COP&quot; , &quot;ED&quot; , &quot;CEG&quot; ,&quot;GLW&quot; , &quot;COST&quot; , &quot;CVH&quot; , &quot;CSX&quot; , &quot;CMI&quot; , &quot;CVS&quot; ,&#xA; &quot;DHR&quot; , &quot;DE&quot;)&#xA;&#xA; library(quantmod)&#xA; getSymbols(tickers, from = &quot;2000-12-01&quot;, to = &quot;2010-12-31&quot;)&#xA; P &amp;lt;- NULL; seltickers &amp;lt;- NULL&#xA; for(ticker in tickers) {     &#xA;tmp &amp;lt;- Cl(to.monthly(eval(parse(text=ticker))))&#xA; if(is.null(P)){ timeP = time(tmp) }&#xA; if( any( time(tmp)!=timeP )) next&#xA; else P&amp;lt;-cbind(P,as.numeric(tmp))&#xA; seltickers = c( seltickers , ticker )&#xA; }&#xA;&#xA;&#xA; P = xts(P,order.by=timeP)&#xA; colnames(P) &amp;lt;- seltickers&#xA; R &amp;lt;- diff(log(P))&#xA; R &amp;lt;- R[-1,]&#xA; dim(R)&#xA;&#xA; mu &amp;lt;- colMeans(R)&#xA; sigma &amp;lt;- cov(R)&#xA;&#xA; obj &amp;lt;- function(w) {&#xA; if (sum(w) == 0) {&#xA; w &amp;lt;- w + 1e-2&#xA; }&#xA; w &amp;lt;- w / sum(w)&#xA; CVaR &amp;lt;- ES(weights = w,&#xA; method = &quot;gaussian&quot;,&#xA; portfolio_method = &quot;component&quot;,&#xA; mu = mu,&#xA; sigma = sigma)&#xA; tmp1 &amp;lt;- CVaR$ES&#xA; tmp2 &amp;lt;- max(CVaR$pct_contrib_ES - 0.05, 0)&#xA; out &amp;lt;- tmp1 + 1e3 * tmp2 &#xA; return(out)&#xA; } &#xA;&#xA; N &amp;lt;- ncol(R)&#xA; minw &amp;lt;- 0&#xA; maxw &amp;lt;- 1&#xA; lower &amp;lt;- rep(minw,N)&#xA; upper &amp;lt;- rep(maxw,N)&#xA;&#xA;w&amp;lt;-rep(100/120 , 100)&#xA;&#xA;# works&#xA;CVaR1 &amp;lt;- ES(weights = w, method = &quot;gaussian&quot;,  portfolio_method = &quot;component&quot;, mu = mu, sigma = sigma)&#xA;&#xA;# takes too long&#xA;date()&#xA;CVaR4 &amp;lt;- ES(R = R , weights = w, method = &quot;modified&quot; , portfolio_method = &quot;component&quot; , clean = &quot;boudt&quot;)&#xA;date()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It turns out that if you want to estimate m3 and m4 (skewness and kurtosis) you need to construct matrices with dimension (number of assets) raised to the 3rd and 4th powers. Therefore for large matrices such as the S&amp;amp;P 500, the memory demands are significant - my back of the envelope calculations are 25Gb. So this procedure suffers from the curse of dimensionality.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1106" LastEditDate="2011-10-10T13:45:26.477" LastActivityDate="2018-03-04T18:06:40.097" Title="How to compute modified-CVaR in the PerformanceAnalytics package?" Tags="&lt;risk&gt;&lt;r&gt;&lt;programming&gt;&lt;performanceanalytics&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1998" PostTypeId="2" ParentId="1997" CreationDate="2011-09-23T14:00:09.583" Score="8" Body="&lt;p&gt;The &quot;Component ES&quot; section of &lt;code&gt;?ES&lt;/code&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;For the decomposition of Gaussian ES, the estimated mean and covariance matrix are needed. For the decomposition of modified ES, also estimates of the coskewness and cokurtosis matrices are needed.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The estimate of the coskewness and cokurtosis matrices are what take such a long time.  You can calculate them beforehand and pass them to &lt;code&gt;ES&lt;/code&gt;.  &lt;code&gt;?ES&lt;/code&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The matrices can be estimated through the functions ‘skewness.MM’ and ‘kurtosis.MM’.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;but I do not see those functions in the version of PerformanceAnalytics installed on my system.  &lt;code&gt;ES&lt;/code&gt; itself uses the unexported functions &lt;code&gt;M3.MM&lt;/code&gt; and &lt;code&gt;M4.MM&lt;/code&gt;, so you could call them explicitly:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;m3 &amp;lt;- PerformanceAnalytics:::M3.MM(R)&#xA;m4 &amp;lt;- PerformanceAnalytics:::M4.MM(R)&#xA;CVaR4 &amp;lt;- ES(R=R , weights=w, method=&quot;modified&quot;, portfolio_method=&quot;component&quot;,&#xA;  clean=&quot;boudt&quot;, m3=m3, m4=m4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="56" LastEditorUserId="1800" LastEditDate="2011-09-23T14:15:39.527" LastActivityDate="2011-09-23T14:15:39.527" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="1999" PostTypeId="2" ParentId="1480" CreationDate="2011-09-23T14:26:54.377" Score="0" Body="&lt;p&gt;Another approach is to use k fold or leave one out &lt;a href=&quot;https://secure.wikimedia.org/wikipedia/en/wiki/Cross-validation_%28statistics%29&quot; rel=&quot;nofollow&quot;&gt;cross-validation&lt;/a&gt; by splitting the time series into a series of &quot;chunks&quot; according to the k value you want to use.&lt;/p&gt;&#xA;" OwnerUserId="252" LastActivityDate="2011-09-23T14:26:54.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2000" PostTypeId="1" AcceptedAnswerId="2006" CreationDate="2011-09-23T15:24:31.217" Score="21" ViewCount="4507" Body="&lt;p&gt;Commercial risk models (e.g., &lt;a href=&quot;http://www.msci.com/products/portfolio_management_analytics/equity_models/&quot;&gt;Barra&lt;/a&gt;, &lt;a href=&quot;http://www.axioma.com/robust.htm&quot;&gt;Axioma&lt;/a&gt;, &lt;a href=&quot;http://www.barcap.com/Client+offering/Investment+Banking/Global+Finance+and+Risk+Solutions/Equity+Capital+Markets&quot;&gt;Barclays&lt;/a&gt;, &lt;a href=&quot;http://www.northinfo.com/&quot;&gt;Northfield&lt;/a&gt;) have evolved to a very high level of sophistication.  However, all of these models attempt to solve a very broad set of problems.  The optimal risk model for, say, risk attribution in a fundamental portfolio may differ substantially from the optimal risk model for downside risk estimation of an optimized quantitative strategy or for hedging unwanted exposures in a pure relative value play.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose that one already subscribes to a decent risk model provider, so that cost is not an issue.  &lt;strong&gt;For what applications is it most appropriate to build your own equity risk model?&lt;/strong&gt;  What are the main benefits of a customized risk model?  When is it worth the time and effort to replicate the increasingly sophisticated data cleaning/analysis and statistical methods to reap these benefits?&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2019-11-13T01:04:27.930" Title="When should you build your own equity risk model?" Tags="&lt;risk&gt;&lt;equities&gt;&lt;risk-models&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="16" ContentLicense="CC BY-SA 3.0" />
  <row Id="2001" PostTypeId="1" AcceptedAnswerId="2004" CreationDate="2011-09-23T15:25:45.013" Score="7" ViewCount="1844" Body="&lt;p&gt;I have been trading (mostly equity and equity index) options for a while now and I want to apply a slightly more quantitative approach to my trading - specifically, by calculating IV and incorporating it into my decision making process. BTW, I am referring to a &quot;bog standard&quot; BS model for exchange traded european and american options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In most text books where IV is discussed, the sections that discuss pricing and IV calculation (on equity/equity index options) simply &quot;pluck&quot; the three key figures &quot;out of the air&quot; - the three key figures being:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Historical vol (in case of pricing)&lt;/li&gt;&#xA;&lt;li&gt;Dividend yield&lt;/li&gt;&#xA;&lt;li&gt;Applicable interest rate&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h2&gt;HistVol&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;There are different ways of calculating historical volaltility, and as we all know, vol has a term structure. My question for histvol then is: &#xA;Which methodology do practitioners use for estimating/calculating historical vol (and why?), and how does the calculation take into account the term structure of vol (vis-a-vie time to expiry for the option?)&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Dividend Yield&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;It is impossible to obtain this data (for equity indices) from anywhere on the internet - without paying through the nose for it. Since I am a private investor, that rules that option out for me - does anyone know where I can obtain this data?. Failing that I would like to calculate the dividend yield from the equivalent total return index. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think there must be a (constant?) relationship between:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i). a country's (annualized) interest rate&#xA;ii). Dividend yield on an equity index in the country&#xA;iii). Spread between the total return index and the 'adjusted' index&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If my assumption is correct (maybe someone with an economics/finance background can help), how, may I calculate the dividend yield of an index from the above information - my objective is to derive historical dividend yields so that I can analyse historical option prices.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Interest Rate&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Again, in books, the applicable interest is just &quot;given&quot;. In practise though, one has to determine the applicable interest rate - presumably, by interpolating points on the relevant yield curve with the time to expiry. Could a practitioner please elaborate whether I am on the right path? - i.e. how the &quot;correct&quot; interest rate is obtained.&lt;/p&gt;&#xA;" OwnerUserId="1422" LastActivityDate="2013-07-23T18:48:37.513" Title="Can anyone give me a practical example of pricing and calculating IV on equity index options? (i.e. using real market data)" Tags="&lt;option-pricing&gt;&lt;implied-volatility&gt;&lt;market-data&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2002" PostTypeId="1" AcceptedAnswerId="2005" CreationDate="2011-09-23T15:31:34.310" Score="8" ViewCount="346" Body="&lt;p&gt;Yahoo finance conveniently provides &lt;a href=&quot;http://finance.yahoo.com/q/ud?s=MSFT&quot; rel=&quot;nofollow noreferrer&quot;&gt;historic ratings&lt;/a&gt; from a number of analysts.  Unfortunately, each analyst seems to use a different scale: buy/hold/sell, perform/outperform/neutral, overweight/equal weight/underweight, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've already &lt;a href=&quot;https://stackoverflow.com/questions/7531238/pulling-historic-analyst-opinions-from-yahoo-finance-in-r&quot;&gt;written a function&lt;/a&gt; to scrape this data into R, and I would like to expand it by automatically coding the ratings.  I was thinking of using a -1,0,1 system, which would basically encode bad/neutral/good, and trying to shoehorn each analyst's system onto this scale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm sure other people have solutions to this problem, and I'm interested to see what they are before I start working.&lt;/p&gt;&#xA;" OwnerUserId="500" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2017-10-25T21:16:03.650" Title="How to assign equity analyst recommendations to a common, numeric scale?" Tags="&lt;equities&gt;&lt;yahoo&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2003" PostTypeId="1" CreationDate="2011-09-23T15:48:54.480" Score="10" ViewCount="805" Body="&lt;p&gt;I am in the process of building zero coupon curves for some countries in the Eurozone.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the following data sets:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Euribor and EONIA&lt;/li&gt;&#xA;&lt;li&gt;Swap rates&lt;/li&gt;&#xA;&lt;li&gt;Bond price and yields&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The bond prices (and thus yields) reflect the relative credit worthiness of the sovereign issuer (a point that has come to the fore most recently). For the longer dated time buckets therefore, the yields &quot;make sense&quot;. At the shorter end however, the official rates seems to be Euribor and EONIA (for s/n-o/n) - I can't see how this makes sense - since these are the same data points I would be using to evaluate &quot;high quality&quot; debt from Germany (for example). I can't see how it makes sense to use these same points for constructing yield curves for any of the peripheral Euro-zone countries - as the credit risk does not seem to be reflected at the short end - am I missing something?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What data points do professionals out there use to construct yield curves for Eurozone countries (with the exception of Germany)?&lt;/p&gt;&#xA;" OwnerUserId="1422" LastEditorUserId="1106" LastEditDate="2011-09-23T16:13:26.363" LastActivityDate="2011-09-26T22:53:39.617" Title="How to build the short end of a zero coupon curve for non-core Eurozone countries?" Tags="&lt;interest-rates&gt;&lt;fixed-income&gt;&lt;swaps&gt;&lt;yield-curve&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2004" PostTypeId="2" ParentId="2001" CreationDate="2011-09-23T15:49:11.053" Score="6" Body="&lt;p&gt;The &quot;industry standard&quot; for calculating implied volatility is OptionMetrics.  Chapter 3 of their &lt;a href=&quot;http://www.modusinc.com/experimentalFinance/files/Ivy/IvyDB%20Reference%202.5.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;reference document&lt;/a&gt; contains details of how they calculate all the inputs to the standard Black-Scholes model.  They also have a &lt;a href=&quot;http://www.optionmetrics.com/pdf/DividendForecasting_WhitePaper.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;white paper&lt;/a&gt; just on dividend yield forecasting, which can potentially be a major issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, much of the data they use is far from free or cheap, and they apply a considerable amount of effort cleaning and massaging the data before plugging into their models.  This is why they charge so much for their service.  There are other implied volatility providers that are cheaper, though (see &lt;a href=&quot;https://quant.stackexchange.com/q/141/1106&quot;&gt;What data sources are available online?&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Historical volatility is an entirely separate issue.  As for &lt;em&gt;how&lt;/em&gt; you should calculate HistVol, though, that depends on &lt;em&gt;why&lt;/em&gt; you want to calculate it.  It's a huge topic, best left to a new question.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2011-09-23T15:49:11.053" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2005" PostTypeId="2" ParentId="2002" CreationDate="2011-09-23T16:01:48.083" Score="2" Body="&lt;p&gt;These are actually known as equity analyst recommendations, and although the terms differ, virtually all of them grade on a 5-point scale.  Much academic research has been done using analyst recommendations, typically using the &lt;a href=&quot;http://thomsonreuters.com/products_services/financial/financial_products/a-z/ibes/&quot; rel=&quot;nofollow&quot;&gt;I/B/E/S&lt;/a&gt; database (see, e.g. &lt;a href=&quot;http://subra.x10hosting.com/ss.pdf&quot; rel=&quot;nofollow&quot;&gt;Sorescu and Subrahmanyam (2006)&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;IBES distinguishes five categories of recommendations, labeled 1 through 5, which we interpret as “strong buy,” “buy,” “hold,” “sell,” and “strong sell,” respectively.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-09-23T16:01:48.083" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2006" PostTypeId="2" ParentId="2000" CreationDate="2011-09-23T18:07:27.777" Score="9" Body="&lt;p&gt;Great question. We would expect 3rd party risk providers to have specialized expertise (robust regression techniques, factor research, data cleansing etc.). We might grant them these advantages but still find weakness in the product design.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's start off with the different uses of risk models and the procedure or metric which is maximized to solve for that use case. What we will see is that solving for a particular objective diminishes our ability to achieve other objectives.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Portfolio construction = If you want to construct a minimum variance portfolio, for example, then the key here is developing a covariance matrix (of factor returns) that is invertible and stable. So we could use procedures that develop well-conditioned cleansed covariance matrices. This conflicts with #3&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Estimate beta for the purposes of hedging = here you care about the yet-to-be-realized return on a security you wish to hedge, and yet-to-be-realized returns on a basket which you will use to hedge. So if you wanted to create a market-neutral constraint, then you would want to use betas from a time-series regression so that the estimation error for each particular beta can be diversified away. You would also want to maximize accuracy (at the expense of interpretation) perhaps using statistical factor methods such as asymptotic PCA.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Performance reporting (risk and return decomposition) = here you have some contemporaneous regression specification (i.e. the time-index is the same on the left and right-hand side of the regression). Your concern is interpretability of factor exposures at the expense of accuracy. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Estimate marginal factor returns = use a cross-sectional regression to explain the returns accruing to a factor after controlling for all other factors. The technique is quite popular and used to explain the cross-section of returns or measuring the risk premiums for various factors. However, there is a substantial errors-in-variables problem. The errors in the estimated betas for such a security cannot be diversified away, unlike a time-series regression so it is risky to apply this model to other use cases. This conflicts with #2.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Risk forecasting = here you have a forecasting specification (left-hand side time index is $t+1$, right-hand side time index is $t$). This conflicts with #3.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Some people use risk models to make systematic factor bets. It can be difficult to develop a variant perception if you are using the same risk framework as everyone else.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Predict volatility. At shorter-horizons a stochastic volatility model would be appropriate, whereas at longer horizons a factor-model makes more sense.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Any risk model that excels at one of these objectives will have severe weaknesses in some other areas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could have multiple risk models (indeed Axioma has one for fundamentals that is easily interpretable, and another based on statistical methods for accuracy) but this can be confusing to clients.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-09-23T19:06:53.803" LastActivityDate="2011-09-23T19:06:53.803" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2007" PostTypeId="2" ParentId="2000" CreationDate="2011-09-23T18:21:28.840" Score="5" Body="&lt;p&gt;Danielsson and Macrae suggest that portfolio optimization should be based on simple models.  I interpret that to mean using something like Ledoit-Wolf (as opposed to most commercial models).  In that case doing it yourself is not at all laborious assuming you have return data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A link to Danielsson and Macrae (worth reading if you haven't seen it) is in &lt;a href=&quot;http://www.portfolioprobe.com/2011/08/15/appropriate-risk-modeling/&quot;&gt;http://www.portfolioprobe.com/2011/08/15/appropriate-risk-modeling/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="249" LastActivityDate="2011-09-23T18:21:28.840" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2008" PostTypeId="2" ParentId="1985" CreationDate="2011-09-23T18:50:19.050" Score="23" Body="&lt;p&gt;&lt;a href=&quot;http://www.ledoit.net/honey.pdf&quot;&gt;Ledoit and Wolf shrinkage methods (&quot;Honey I shrunk the sample covariance matrix&quot;)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.axiomainc.com/downloads/incorporating_estimation.pdf&quot;&gt;Ceria and Stubbs - Robust optimization literature  (2006)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://pubs.amstat.org/doi/abs/10.1198/016214502388618960&quot;&gt;Stock &amp;amp; Watson (2002ab) - papers on large N small P estimation&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.ise.ufl.edu/uryasev/CVaR1_JOR.pdf&quot;&gt;Rockafellar &amp;amp; Uryasev (2000) - &quot;Optimization of CVaR and coherent risk measures&quot;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1584885580&quot;&gt;Sorensen, Qian, Hua - &quot;Quantitative Portfolio Management&quot;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.bus.lsu.edu/finance/faculty/lin/Paper/Topic%207/Ang%20and%20Bekaert,%202002,%20International%20asset%20allocation%20with%20regime%20shifts.pdf&quot;&gt;Ang and Bekaert - International Asset Allocation with  Regime Shifts&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0691121370&quot;&gt;Cochrane, &quot;Asset Pricing&quot; (2005)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://faculty.chicagobooth.edu/john.cochrane/research/papers/AFA_pres_speech.pdf&quot;&gt;Cochrane, &quot;Discount Rates&quot;, (2011)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1899332448&quot;&gt;Bernd Scherer, Portfolio Construction and Risk Budgeting 4th Edition&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.frbatlanta.org/filelegacydocs/wp0222.pdf&quot;&gt;Robertson et al, &quot;Forecasting Using Relative Entropy&quot; (2002)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are recent picks that I believe will be looked on as major contributions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://ssrn.com/abstract=681553&quot;&gt;&quot;Robust Bayesian Allocation&quot;, Attillio Meucci (2010)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www2.mccombs.utexas.edu/faculty/carlos.carvalho/CarvalhoLopesAguilarFinal.pdf&quot;&gt;&quot;Dynamic stock selection - A structured factor model framework&quot;, Lopes Carvallho Aguilar (2011)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1752702&quot;&gt;A New Breed of Copulas for Risk and Portfolio Management&lt;/a&gt;&quot;, Atillio Meucci (2011)&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-11-16T23:09:20.607" LastActivityDate="2011-11-16T23:09:20.607" CommentCount="4" CommunityOwnedDate="2011-09-23T18:50:19.050" ContentLicense="CC BY-SA 3.0" />
  <row Id="2009" PostTypeId="2" ParentId="1992" CreationDate="2011-09-23T19:24:50.910" Score="5" Body="&lt;p&gt;In practice, absolute summability of hedging errors may not be applicable. Mostly, for the sequences of hedging errors, one relaxes the absolute convergence criteria and uses the squared summability of hedging errors. Note: Absolute summability is a stricter condition than squared summability. Some sequences may not be absolute summable but are only squared summable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, to notice the significant impact of the error and to make it visible is one of the prime reasons for using sum of squares for hedging errors. Remember, we're talking about managing or controlling risks, the finer we notice the errors, the useful it shall be. :)&lt;/p&gt;&#xA;" OwnerUserId="1424" LastActivityDate="2011-09-23T19:24:50.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2010" PostTypeId="1" AcceptedAnswerId="2011" CreationDate="2011-09-23T20:05:44.510" Score="16" ViewCount="916" Body="&lt;p&gt;What are some quant theoretical or empirical insights that have shaped your thinking or provided a deeper conceptual basis for explaining returns and risk?&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="70" LastEditDate="2011-09-23T20:15:02.647" LastActivityDate="2013-01-29T04:12:12.360" Title="Empirical or theoretical quant insights that have shaped your thinking?" Tags="&lt;soft-question&gt;&lt;theory&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="20" CommunityOwnedDate="2011-09-23T20:11:51.670" ContentLicense="CC BY-SA 3.0" />
  <row Id="2011" PostTypeId="2" ParentId="2010" CreationDate="2011-09-23T20:22:46.080" Score="18" Body="&lt;p&gt;&lt;em&gt;Big Picture&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Time-series variance is driven mostly by discount rates, whereas expected cash flows dominate the cross-sectional variance. These results are important because they highlight the value of focusing on both dimensions of stock prices and returns: time-series and cross-section. On the other hand, however, they also show that a single mechanism is not capable of explaining both types of variation.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The cash flows of growth stocks are particularly sensitive to temporary movements in aggregate stock prices, driven by shocks to market discount rates, while the cash flows of value stocks are particularly sensitive to permanent movements, driven by shocks to aggregate cash flows. Thus, the high betas of growth (value) stocks with the market's discount-rate (cash-flow) shocks are determined by the cash-flow fundamentals of growth and value companies. Growth stocks are not merely “glamour stocks” whose systematic risks are purely driven by investor sentiment. More generally, the systematic risks of individual stocks with similar accounting characteristics are primarily driven by the systematic risks of their fundamentals. - John Campbell&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;“There is beta you understand and there is beta you do not understand.” – John Cochrane&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;General equilibrium arguments. For example, systematic risk must be borne in aggregate, therefore alpha is a zero-sum game. Or, one cannot count the “distress” of the individual firm as a risk factor. Such distress is idiosyncratic and can be diversified away. Only aggregate events that average investors care about can result in a risk premium. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Conventional linear asset pricing models imply a positive and monotonic risk-return relation (e.g., Merton, 1973). In contrast, changes between discrete regimes with different consumption growth rates can lead to increasing, decreasing, flat or non-monotonic risk return relations as shown by, e.g., Backus and Gregory (1993), Whitelaw (2000), and Ang and Liu (2007). The possibility of switching across regimes, even if it occurs relatively rarely, induces an important additional source of uncertainty that investors want to hedge against&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Better to think of risk as the co-variance of an asset's returns with an investor's cashflows rather than the merely the variance of the asset returns independent of the investor's circumstances&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Most returns and price variation come from variation in risk premia, not variation in expected cash flows or interest rates&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Bayesian decision-making&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Unconditional risk premia do not exist&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Technical know-how&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Returns are typically leptokurtotic and left-skewed and non-stationary and exhibit autocorrelation of absolute returns . Good models will reflect the stylized empirical facts &#xA;of the markets&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Regression coefficients in a time-series regression can be interpreted as portfolio weights or hedge ratios&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The square-root rule (to scaling variance) only applies under the assumption that the compounded returns are invariants, i.e. they behave identically and independently across time. Sharpe ratios scale with square root of horizon &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Optimizers are error-maximizers&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Robust regressions tends to outperform OLS or LAD when estimating Betas out-of-sample&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Neural networks can mimic any functional form of the DGP but imply the estimation of a large number of parameters with the consequent risk of overfitting and loss of forecasting ability&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Requiring that the residuals are mutually uncorrelated and uncorrelated in a factor model is different from requiring that the residuals are i.i.d. variables. The former is an assumption on the model, the latter is an assumption on how different samples are distributed&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In-sample significance testing is not that helpful...out-of-time testing is critical&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you torture the data enough they will confess to anything&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Sometimes it is worth accepting bias to lower variance and improve ability to generalize&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="4660" LastEditDate="2013-01-29T04:12:12.360" LastActivityDate="2013-01-29T04:12:12.360" CommentCount="4" CommunityOwnedDate="2011-09-23T20:22:46.080" ContentLicense="CC BY-SA 3.0" />
  <row Id="2012" PostTypeId="2" ParentId="1814" CreationDate="2011-09-23T22:45:35.933" Score="2" Body="&lt;p&gt;I found this searchable/sortable list: &lt;a href=&quot;http://www.etftrends.com/etf-analyzer.php&quot; rel=&quot;nofollow&quot;&gt;http://www.etftrends.com/etf-analyzer.php&lt;/a&gt; . Premium membership is required to sort by inception date, $15/month.&lt;/p&gt;&#xA;" OwnerUserId="1384" LastActivityDate="2011-09-23T22:45:35.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2013" PostTypeId="2" ParentId="1916" CreationDate="2011-09-23T22:53:48.967" Score="4" Body="&lt;p&gt;An insurer might model the filing of claims as a Poisson process, but the cumulative amount of the claims as a compound Poisson process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, suppose a company has issued a large large number of auto liability policies that are geographically dispersed and have identical limits and driver risk profiles.  The incidence of claims being made by policy holders would approximate a Poisson process, but each claim would be for a varying dollar amounts (following some other distribution taking on values between zero and the policy limit).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The car insurance example fits the Poisson model because a single claim (or the lack of a claim) in a particular period doesn't indicate that another claim is more or less likely in the near future.  A bad example would be flood insurance policies in a concentrated coastal area.  That's because the claims are likely to come in waves, so a single claim is likely to be followed by others.&lt;/p&gt;&#xA;" OwnerUserId="1418" LastEditorUserId="1418" LastEditDate="2012-08-16T03:12:40.930" LastActivityDate="2012-08-16T03:12:40.930" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2014" PostTypeId="1" CreationDate="2011-09-24T14:18:49.683" Score="0" ViewCount="781" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Possible Duplicate:&lt;/strong&gt;&lt;br&gt;&#xA;  &lt;a href=&quot;https://quant.stackexchange.com/questions/141/what-data-sources-are-available-online&quot;&gt;What data sources are available online?&lt;/a&gt;  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&#xA;&#xA;&lt;p&gt;Is there a free way to download the current prices (and possibly other data) for stocks for various companies?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Context: This is for a data source for a group programming project for a class.  We weren't assigned this project or even a list of projects to pick from.  If there isn't a way to do this for free, we'll do something else.&lt;/p&gt;&#xA;" OwnerUserId="1429" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2011-09-24T14:43:08.187" Title="Way to download current stock information (for free)?" Tags="&lt;data&gt;&lt;market-data&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2011-09-24T14:54:13.413" ContentLicense="CC BY-SA 3.0" />
  <row Id="2015" PostTypeId="2" ParentId="2014" CreationDate="2011-09-24T14:43:08.187" Score="0" Body="&lt;p&gt;You can download a lot of stock prices and similar data from yahoo.com, either directly from the site or with R (getSymbols from the package quantmod).&lt;/p&gt;&#xA;" OwnerUserId="357" LastActivityDate="2011-09-24T14:43:08.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2016" PostTypeId="2" ParentId="1964" CreationDate="2011-09-24T15:47:33.010" Score="3" Body="&lt;p&gt;I think time length should very dependent on the holding period you are looking at.(This is at least how we handle)  For example, if you turn your book every ten minutes, a 6 month time frame could be sufficient.  If your holding periods are on a monthly basis, you will need much longer holding periods&lt;/p&gt;&#xA;" OwnerUserId="1368" LastActivityDate="2011-09-24T15:47:33.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2018" PostTypeId="2" ParentId="1993" CreationDate="2011-09-25T10:52:33.090" Score="5" Body="&lt;p&gt;&lt;a href=&quot;http://www.sfu.ca/~poitras/heinz_%24%24.pdf&quot; rel=&quot;noreferrer&quot;&gt;The Early History of Option Contracts&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Haven't read this so can't vouch for whether they get into etymology.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ABSTRACT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This chapter discusses the history of option contracts from ancient times until the appearance of&#xA;Theorie der Prämiengeschäfte by Vincenz Bronzin in 1908. The history examines the use of&#xA;contracts with option features prior to the introduction of trade in free standing option contracts on&#xA;the Antwerp bourse during the 16th century. Descriptions of the Amsterdam share option market by&#xA;de la Vega in the 17th century and de Pinto in the 18th century are reviewed. The specific language&#xA;of a late 17th century English option contract is provided in detail. The development and practice of&#xA;option trading in the 18th and 19th centuries, as reflected in merchant manuals of that period, is&#xA;examined. The article concludes with an overview of late 19th century option trading in securities&#xA;and commodities.&lt;/p&gt;&#xA;" OwnerUserId="352" LastActivityDate="2011-09-25T10:52:33.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2019" PostTypeId="1" AcceptedAnswerId="2040" CreationDate="2011-09-25T12:49:06.067" Score="44" ViewCount="14547" Body="&lt;p&gt;Can anyone recommend books that explain the math used in quantitative finance academic papers?&lt;/p&gt;&#xA;" OwnerUserId="906" LastEditorUserId="1106" LastEditDate="2011-09-25T16:01:31.217" LastActivityDate="2014-06-30T13:53:08.570" Title="Recommendations for books to understand the math in quantitative finance papers?" Tags="&lt;soft-question&gt;&lt;books&gt;&lt;mathematics&gt;" AnswerCount="8" CommentCount="9" FavoriteCount="94" CommunityOwnedDate="2013-07-22T11:12:50.077" ContentLicense="CC BY-SA 3.0" />
  <row Id="2020" PostTypeId="1" AcceptedAnswerId="2042" CreationDate="2011-09-25T13:19:57.350" Score="19" ViewCount="879" Body="&lt;p&gt;How do you distinguish between losses that are within the normal range for day-to-day shifts and situations with a real potential for loss?  The specific application I have in mind is pattern recognition-based algorithmic trading.&lt;/p&gt;&#xA;" OwnerUserId="1204" LastEditorUserId="1106" LastEditDate="2011-09-26T19:33:10.457" LastActivityDate="2011-09-28T16:02:45.510" Title="How do you distinguish &quot;significant&quot; moves from noise?" Tags="&lt;automated-trading&gt;&lt;equities&gt;&lt;probability&gt;&lt;algorithm&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="2021" PostTypeId="2" ParentId="2019" CreationDate="2011-09-25T16:08:40.320" Score="17" Body="&lt;p&gt;I doubt you will find one book that covers everything you need, but here are a few that I continually come back to whenever I have some questions on the mathematics.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0471690740&quot; rel=&quot;nofollow noreferrer&quot;&gt;Analysis of Financial Time Series&lt;/a&gt; by Ruey Tsay&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0122796713&quot; rel=&quot;nofollow noreferrer&quot;&gt;An Introduction to High-Frequency Finance&lt;/a&gt; by Dacorogna et al&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0321500466&quot; rel=&quot;nofollow noreferrer&quot;&gt;Probability and Statistics&lt;/a&gt; by DeGroot and Schervish&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0534243126&quot; rel=&quot;nofollow noreferrer&quot;&gt;Statistical Inference&lt;/a&gt; by Casella and Berger&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0131395386&quot; rel=&quot;nofollow noreferrer&quot;&gt;Econometric Analysis&lt;/a&gt; by Greene&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0132777428&quot; rel=&quot;nofollow noreferrer&quot;&gt;Options, Futures, and Other Derivatives&lt;/a&gt; by Hull&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0521552893&quot; rel=&quot;nofollow noreferrer&quot;&gt;Financial Calculus: An Introduction to Derivative Pricing&lt;/a&gt; by Baxter and Rennie&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0125153929&quot; rel=&quot;nofollow noreferrer&quot;&gt;An Introduction to the Mathematics of Financial Derivatives&lt;/a&gt; by Salih Neftci&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;A few previous questions also have some good recommendations contained within their answers.  See &lt;a href=&quot;https://quant.stackexchange.com/q/1/1106&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;https://quant.stackexchange.com/q/2391/1106&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2011-12-18T20:47:31.197" CommentCount="0" CommunityOwnedDate="2013-07-22T11:12:50.077" ContentLicense="CC BY-SA 3.0" />
  <row Id="2022" PostTypeId="1" CreationDate="2011-09-25T18:29:05.110" Score="2" ViewCount="504" Body="&lt;p&gt;I am currently trying to understand the in's and out's of options and more specifically hedging. I came across a document that was talking about Delta Hedging which is just making sure the delta of your overall position will be 0. But how do you hedge Omega(Time)?&lt;/p&gt;&#xA;" OwnerUserId="1436" LastActivityDate="2011-09-25T18:29:05.110" Title="Delta-Omega Hedging" Tags="&lt;options&gt;&lt;hedging&gt;&lt;delta-neutral&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="1" ClosedDate="2011-10-08T23:53:35.620" ContentLicense="CC BY-SA 3.0" />
  <row Id="2023" PostTypeId="2" ParentId="283" CreationDate="2011-09-25T19:51:18.747" Score="2" Body="&lt;p&gt;The academic term for this phenomenon is &quot;predatory trading.&quot;  &lt;a href=&quot;http://pages.stern.nyu.edu/~lpederse/papers/predatory_trading.pdf&quot; rel=&quot;nofollow&quot;&gt;Brunnermeier and Pederson (2005)&lt;/a&gt; wrote an entire paper on the topic, and you can also examine the references contained therein.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This paper studies &lt;em&gt;predatory trading&lt;/em&gt;, trading that induces and/or exploits the need of&#xA;  other investors to reduce their positions.We show that if one trader needs to sell, others&#xA;  also sell and subsequently buy back the asset. This leads to price overshooting and a&#xA;  reduced liquidation value for the distressed trader. Hence, the market is illiquid when&#xA;  liquidity is most needed. Further, a trader profits from triggering another trader’s&#xA;  crisis, and the crisis can spill over across traders and across markets.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The paper is mostly theoretical, covering the consequences of predatory trading rather than &lt;em&gt;how to do it&lt;/em&gt; (which seems to be what you're interested in).  Judging from the examples in their introduction, I would say that typically one first has knowledge regarding the presence of others' stop-loss orders then they place predatory orders in response, rather than dedicated &quot;stop-hunting&quot;.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-09-25T19:51:18.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2024" PostTypeId="2" ParentId="332" CreationDate="2011-09-25T20:01:06.207" Score="8" Body="&lt;p&gt;Deutsche Bank's Quantitative Strategy (US) team put together the &lt;a href=&quot;http://www.docin.com/p-68451313.html&quot;&gt;following piece&lt;/a&gt; on this topic (note: their research is available for clients, but I found that somebody uploaded the piece to a sketchy web site).  In case the link dies, some of the academic papers they site are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ssrn.com/abstract=1107690&quot;&gt;Akbras, F., E. Kocatulum, and S. Sorescu, 2008, “Mispricing following public news:&#xA;Overreaction for losers, underreaction for winners”&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Barber, B. and T. Odean, 2007, “All that glitters: The effect of attention and news on the buying behavior of individual and institutional investors”, Review of Financial Studies, Volume 21, Number 2&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ssrn.com/abstract=1364209&quot;&gt;Da, Z., J. Engelberg, and P. Gao, 2009, “In search of attention”&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ssrn.com/abstract=1303612&quot;&gt;Tetlock, P., 2009, “Does public news resolve asymmetric information?”&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Their introduction says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This month we tackle another new dataset: news sentiment. Regular readers of our research&#xA;  will know that this is a topic we find particularly interesting, and one that we have already&#xA;  done a lot of work in. In this particular report, we take what we think is an innovative&#xA;  approach to studying the predictive power of news sentiment; instead of using standard&#xA;  linear models, we focus on three non-linear, “learning” type models: classification and&#xA;  regression trees, forests of classification and regression trees, and multivariate adaptive&#xA;  regression splines. All three of these models are unique in that they allow us to take a datacentric&#xA;  approach to our analysis. Instead of predefining a hypothetical relationship and then&#xA;  testing it, we allow the data to determine the form of the model. This allows us to better&#xA;  understand which variables within our dataset are most important in determining post-event&#xA;  abnormal returns. It also allows us to model complex non-linear relationships that may not be&#xA;  apparent at first glance.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Overall we find that news sentiment, in conjunction with non-linear models, can generate&#xA;  alpha. Even better, we find this alpha is relatively uncorrelated with the more traditional quant&#xA;  factors. Of course, there is also a downside. The predictive ability of news sentiment is shortlived;&#xA;  the best results are obtained when forecasting only the next five days. Therefore, for&#xA;  some quantitative investors, the signal on its own may have too much turnover to be viable.&#xA;  Nonetheless, we do show that there are ways for even lower-frequency investors to use&#xA;  news sentiment data to enhance their stock-selection process.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;A more recent DB Quant piece highlights another recent paper, &lt;a href=&quot;http://ssrn.com/abstract=1889030&quot;&gt;Dzielinski, 2011, &quot;News sensitivity and the cross-section of stock returns&quot;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Results&lt;/strong&gt;&lt;br&gt;&#xA;  First of all, the author shows that there is, as expected, a statistical and economical&#xA;  difference in the returns on news days compared to non-news days. Also, while the direction&#xA;  of the difference is in accordance with the sentiment, the magnitude of the difference&#xA;  doesn’t relate to the news being positive or negative. These differences in returns between&#xA;  news and no-news days are actually heterogeneous among stocks: small and illiquid stocks&#xA;  tend to react more strongly, as do low book-to-market and high volatility stocks. From an&#xA;  industry point of view, the reactions also differ substantially, while still being significant, in&#xA;  each group. Interestingly, Dzielinski finally finds that there is a risk premium attached to news&#xA;  sensitivity, and that this phenomenon remains after controlling for well-known risk factors.&#xA;  The monthly return on the hedge portfolio is significantly different from zero and stands at&#xA;  0.95% on average. The strategy still exhibits some significant loadings on some risk factors,&#xA;  as could have been expected from the panel regressions in sub-samples.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In the same piece, DB also mentions&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ssrn.com/abstract=1924867&quot;&gt;Uhi - Reuters sentiment and stock returns&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ssrn.com/abstract=1924867&quot;&gt;Karabulut - Can Facebook predict stock market activity?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-09-28T14:38:15.650" LastActivityDate="2011-09-28T14:38:15.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2025" PostTypeId="2" ParentId="41" CreationDate="2011-09-25T20:15:01.180" Score="3" Body="&lt;p&gt;This phenomenon is known as the &quot;leverage effect.&quot;  It was first pointed out by Black (1976) [&quot;Studies of Stock Price Volatility Changes&quot;].  It was studied in slightly greater detail by &lt;a href=&quot;http://www.jstor.org/pss/2328636&quot; rel=&quot;nofollow&quot;&gt;Schwert (1989)&lt;/a&gt;.  A (relatively) more recent reference is &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=256109&quot; rel=&quot;nofollow&quot;&gt;Figlewski and Wang (2000)&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-09-25T20:15:01.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2027" PostTypeId="2" ParentId="986" CreationDate="2011-09-26T00:42:05.583" Score="7" Body="&lt;ul&gt;&#xA;&lt;li&gt;Are there any other mechanisms at play here which might explain this kind of tracking error?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Dirk is right, you often lend the titles internally or not, etc.&#xA;You can also write calls for your index, this is not orthodox, but it's ETF, there is no orthodoxy there...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit : With the graph and given the outperforming is seasonnal (around May), I think we can also account for a Dividend Effect (more lending there because of fiscal optimisation)&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Why the discrepancy between the fund's NAV and the index has not been eliminated by arbitrageurs?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Because an ETF is not the Underlying Index, any ETF &lt;strong&gt;SHOULD&lt;/strong&gt; actually award more than the Index on &quot;Developed&quot; aka &quot;Easy to Access&quot; aka &quot;We don't have regulations that make the market impossible to Invest without ETF&quot;. You're taking additional risk by financing a bank operations. I mean Lehman was not in the ETF business, but it could have been, so taking a huge counterpart risk for less than 1.00%/year is &lt;strong&gt;REALLY&lt;/strong&gt; not worth it, you'd better invest in the bank bonds or arbitrage CDS/bond. &lt;/p&gt;&#xA;" OwnerUserId="1181" LastEditorUserId="1181" LastEditDate="2011-09-26T12:58:48.403" LastActivityDate="2011-09-26T12:58:48.403" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2028" PostTypeId="1" AcceptedAnswerId="2031" CreationDate="2011-09-26T15:35:49.843" Score="7" ViewCount="6076" Body="&lt;p&gt;Forewarning: this is a complete newbie question :-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am starting to learn about ETFs by trying to do the numbers. When learning about the compounding effect in leveraged ETFs, I wanted to simulate the return for a simple ETF. Here is what I wanted to do: a hypothetical index ETF gains 1% every day for a 10-day range. I wanted to calculate the final return after the range for 1X, -1X, 3X and -3X ETF. Here are the numbers:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/tsIvc.png&quot; alt=&quot;Spreadsheet Calculation&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That means, at the end of 10 days, 1X gained 10.5%, 3X gained 34.4%, -1X lost 10.6% and -3X lost 26.3%.&#xA;Two questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is the above statement/calculations correct, specifically w.r.t.&#xA;-1X and -3X ETFs? &lt;/li&gt;&#xA;&lt;li&gt;Now if I consider a scenario where the 1X ETF&#xA;loses 1% every day for 10 days, then can I say the following without&#xA;additional calculations: at the end of 10 days, 1X lost 10.6%, 3X&#xA;lost 26.3%, -1X gained 10.5% and -3X gained 34.4%? &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thanks for helping.&lt;/p&gt;&#xA;" OwnerUserId="1442" LastEditorUserId="1106" LastEditDate="2011-09-26T18:41:43.380" LastActivityDate="2020-09-16T00:35:58.610" Title="How to calculate compound returns of leveraged ETFs?" Tags="&lt;equities&gt;&lt;returns&gt;&lt;etf&gt;&lt;leverage&gt;" AnswerCount="5" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2029" PostTypeId="1" CreationDate="2011-09-26T15:44:42.220" Score="9" ViewCount="1802" Body="&lt;p&gt;You want to construct an optimal portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say you have an alpha signal that arrives with some period (say quarterly). The alpha signal predicts arithmetic returns one-year ahead. You have risk estimates that are updated daily. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The optimizer your utility function is maximizing is expected returns from the quarterly alpha signal (associated with a confidence level), minimizing risk from the daily risk model, and minimizing transaction costs. On Day 1 determining the optimal single-period strategy weights is easy -- just turn the crank on the optimizer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, let's say a week passes and you have an opportunity to re-balance. Security prices have changed partly reflecting noise and partly new information. Your alpha forecasts are increasingly stale until the next quarterly alpha signal. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question - what is the optimal optimal re-balancing procdedure? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a couple approaches and it is not obvious which is best - a Bayesian update of alpha signal, shrinkage towards a prior as the alpha signal is increasingly stale, or some other rule-of-thumb re-balancing rule. (Some form of simplification is necessary here since truly the optimal re-balancing would be a multi-period dynamic programming problem that is not practically solvable.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are some approaches:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Do nothing - ignore re-balancing opportunities. Cons: Security may have achieve the effective price targets or portfolio may have deviated from optimality (i.e. marginal returns per unit of risk is no longer balanced).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Naive case - At the next re-balancing period, optimize with the the beginning of period alpha forecasts and the new risk estimates. Drawback is that we have less confidence in the alpha forecast as time passes. Imagine a security that has impounded severe negative news -- your optimizer would load up on this security if you used your beginning-of-period alpha signal. This approach treats all price changes as non-informative.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Ratchet down the confidence of the alpha signal at each re-balancing period (until the next quarterly refresh) and allow the optimizer to shrink towards a prior such as the minimum variance portfolio.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Low the confidence in the alpha signal AND re-calibrate the alpha signal to account for security price changes. For example, if the original alpha forecast for a security is 8% annualized and the position is +10% already then your re-calibrated forecast would be -2% (short). Con: Alpha signals are never so precise. They are most effective at ranking opportunities and this approach might lead to scenarios where you are shorting your strongest candidates on an alpha signal sorted basis.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Somehow treat the price changes as informative and use Bayesian updating to adjust your alpha forecast after observing actual performance. Con: Lots of hand-waving here.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Do not use the optimizer in subsequent re-balancing -- just use your risk model. Specifically, sell securities that have a higher marginal contribution to risk, and buy securities that have a low marginal contribution to risk. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Ultimately this seems like an empirical question that has to be tested. The best answer would cite empirical research on asynchronous optimal re-balancing if it exists.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-09-26T16:23:18.570" LastActivityDate="2011-11-20T19:33:50.413" Title="optimal re-balancing strategy with asynchronous alpha signal" Tags="&lt;research&gt;&lt;portfolio-management&gt;&lt;optimization&gt;&lt;rebalancing&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2030" PostTypeId="2" ParentId="2029" CreationDate="2011-09-26T16:58:31.507" Score="1" Body="&lt;p&gt;I think this entire complicated-sounding problem can be shoe-horned into a traditional mean-variance optimization.  However, there are multiple embedded sub-problems, each worthy of specific attention (this is why I recommend you split the question up further into multiple smaller questions).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your expected returns can and should be updated as frequently as possible/feasible.  If the signal itself is only observable quarterly, you should use properties of the signal or relationships with higher-frequency variables to forecast the signal.  By the way, done naively you will get jumps when the new signal arrives.  There are multiple methods of dealing with this, and it is worthy of a separate question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The re-balancing frequency should be optimized depending on the magnitude of changes in risk and expected return as well as transaction costs.  This should include the &quot;nuisance cost&quot; of frequent rebalancing in an otherwise low-frequency strategy.  Essentially, this is classic utility maximization, where rebalancing has a fixed up-front monetary cost and a utility benefit in terms of expected risk/return.  Changing confidence in the signal can be incorporated directly into the utility function (proper design of this utility function is another worthy sub-question).  Any other approach is an &lt;em&gt;ad hoc&lt;/em&gt; approximation or rule of thumb.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-09-26T16:58:31.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2031" PostTypeId="2" ParentId="2028" CreationDate="2011-09-26T17:24:26.130" Score="4" Body="&lt;p&gt;To answer your questions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Yes, the above table is correct&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Your results are correct except..... 1X loss = 9.6%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you combine both positive and negative changes, it is the MEDIAN value that is of interest.    Here are some links:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.futuresmag.com/Issues/2010/March-2010/Pages/Trading-with-leveraged-and-iinverse-ETFs.aspx&quot; rel=&quot;nofollow&quot;&gt;http://www.futuresmag.com/Issues/2010/March-2010/Pages/Trading-with-leveraged-and-iinverse-ETFs.aspx&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://olympiainv.com/Memos/ETFs.pdf&quot; rel=&quot;nofollow&quot;&gt;http://olympiainv.com/Memos/ETFs.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://math.nyu.edu/faculty/avellane/LeveragedETF20090515.pdf&quot; rel=&quot;nofollow&quot;&gt;http://math.nyu.edu/faculty/avellane/LeveragedETF20090515.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.slcg.com/pdf/workingpapers/Leveraged%20ETFs,%20Holding%20Periods%20and%20Investment%20Shortfalls.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.slcg.com/pdf/workingpapers/Leveraged%20ETFs,%20Holding%20Periods%20and%20Investment%20Shortfalls.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://math.nyu.edu/faculty/avellane/LETFRISKPROF.pdf&quot; rel=&quot;nofollow&quot;&gt;http://math.nyu.edu/faculty/avellane/LETFRISKPROF.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="392" LastEditorUserId="392" LastEditDate="2011-09-26T17:35:02.577" LastActivityDate="2011-09-26T17:35:02.577" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2032" PostTypeId="1" AcceptedAnswerId="2034" CreationDate="2011-09-26T18:14:58.580" Score="8" ViewCount="4844" Body="&lt;p&gt;When looking at the Price-vs-Yield graph for a fixed rate instrument, we are often told that the duration is the slope of that curve. But is that really right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Duration is (change in price) divided by (price times change in yield). That's hardly the slope of the curve which would be (change in price) divided by (change in yield). Yield is expressed in percentage terms which makes it look relative, but going from 1% to 2% is a relative increase of 100%, because it's a 1% increase only in absolute terms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That added factor of price is not constant and so the slope and duration differ by different ratios for different prices!?&lt;/p&gt;&#xA;" OwnerUserId="1443" LastEditorUserId="1106" LastEditDate="2011-09-26T18:49:45.847" LastActivityDate="2012-01-19T04:11:15.680" Title="Is Duration really the slope of the Price-Yield curve?" Tags="&lt;interest-rates&gt;&lt;fixed-income&gt;&lt;duration&gt;&lt;yield-curve&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2033" PostTypeId="2" ParentId="986" CreationDate="2011-09-26T18:30:30.327" Score="7" Body="&lt;p&gt;In my mind, there are two questions here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) How does DB make money given a zero expense ratio?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is covered by Dirk and Lliane.  Basically, DB gets cheap funding and stock loan fees in return for paying marketing / index / hedging costs.  The ETF investor gets zero expense ratio in return for taking DB credit risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Why does it look like the etf outperforms the index in that plot?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dividends.  The plot compares against SX5E, which does not take into account dividend gains, but the etf does.  That's why there is a weird bulge in May, when most EU stocks pay out divs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Comaparing against the total return index (SX5T) shows the ETF still outpreforms by 32bps / year, but I think the comparison is not correct in that SX5T witholds taxes on the divs, whereas I'm not sure if the ETF does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Comparing against SX5E with divs taken into account and a similar tax treatment shows the ETF underperforms by 45bps / year.  Which is right?  I don't know.  But I'm fairly certain there's no arb.  99.99% of the time you think you've found an arb, you haven't.&lt;/p&gt;&#xA;" OwnerUserId="443" LastActivityDate="2011-09-26T18:30:30.327" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2034" PostTypeId="2" ParentId="2032" CreationDate="2011-09-26T19:13:57.867" Score="6" Body="&lt;p&gt;The Macaulay duration is a measure of how sensitive a bond's price is to changes in interest rates. Duration is related to, but differs from, the slope of the plot of bond price against yield-to-maturity. The slope of the price-yield curve is &#xA;$-\frac{D}{1+r}P,$&#xA;where $D$ is Macaulay duration, $P$ is bond price, and $r$ is yield. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's how the definition of duration arises. Let's expand the price of a bond, $P$, in terms of the yield-to-maturity, $r$, using Taylor's theorem:&#xA;$$\Delta P=P(r+\Delta r)-P(r)\approx\frac{\partial P(r)}{\partial r}\Delta r+\frac{1}{2}\frac{\partial^2 P(r)}{\partial r^2}(\Delta r)^2.$$&#xA;Since &#xA;$$P(r)=\sum_{t=1}^{T}\frac{C_t}{(1+r)^t},$$&#xA;where $C_t$ are the cash flows, we have that &#xA;$$\Delta P\approx -\frac{\Delta r}{1+r}\sum_{t=1}^{T}\frac{t\ C_t}{(1+r)^t}+\frac{(\Delta r)^2}{2(1+r)^2}\sum_{t=1}^{T}\frac{t(t+1)C_t}{(1+r)^t},$$&#xA;and dividing both sides by $P$, we arrive at the expression&#xA;$$\frac{\Delta P}{P}\approx -\frac{D}{1+r}\Delta r+\frac{\mathcal C}{2}(\Delta r)^2.$$&#xA;Here &#xA;$$D=\frac{1}{P} \sum_{t=1}^{T}\frac{t\ C_t}{(1+r)^t}$$&#xA;is the  Macaulay duration, and&#xA;$$\mathcal C= \frac{1}{P(1+r)^2}\sum_{t=1}^{T}\frac{t(t+1)C_t}{(1+r)^t}$$&#xA;is a measure of curvature, or convexity, in the plot of bond price against yield-to-maturity. &lt;/p&gt;&#xA;" OwnerUserId="70" LastEditorUserId="70" LastEditDate="2011-09-26T19:40:30.197" LastActivityDate="2011-09-26T19:40:30.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2035" PostTypeId="2" ParentId="2020" CreationDate="2011-09-26T19:29:19.370" Score="6" Body="&lt;p&gt;The most basic strategy is beta-based quantiles.  That is to say, you first control for losses on your individual stock versus overall market performance.  (Your trading strategy may or may not wish to hedge away the market factor using, say, SPX futures).  Then you choose a quantile, call it the 5th percentile, beyond which you consider a move to be significant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Symbolically, you are looking at an individual stock return $r_S$, a market return $r_M$, and a simple linear model that you have typically fitted historically&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ r_S = \beta r_M + \epsilon $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On any given day, you can now compute the idiosyncratic return $ r_i  = r_S - \beta r_M $ which will have come from the same distribution as $ \epsilon $.  You may or may not have turned your historically observed residuals $ \epsilon_i $ into a normal (or other continuous) distribution, but either empirically or normally it is now trivial to see if $ r_i $ is below the 5th percentile for $ \epsilon $.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-09-26T19:29:19.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2037" PostTypeId="2" ParentId="2028" CreationDate="2011-09-26T21:47:39.267" Score="2" Body="&lt;p&gt;Your example could be correct but you're on the wrong track.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Leveraged ETFs are designed for day trading, &lt;strong&gt;it isn't a leveraged 3x position that will return 3x the long term average of the name&lt;/strong&gt;. The leverage is reweighted each day which will affect your performance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Eg if the market goes 100-&gt;99-&gt;100 the market is unchanged over 2 days. But a 3x ETF will go 100-&gt;97-&gt;99.9394 ((1 + (100/99 - 1) * 3) * 97)&lt;/p&gt;&#xA;" OwnerUserId="1425" LastEditorUserId="-1" LastEditDate="2011-09-27T19:04:24.427" LastActivityDate="2011-09-27T19:04:24.427" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2038" PostTypeId="2" ParentId="1992" CreationDate="2011-09-26T22:40:53.930" Score="0" Body="&lt;p&gt;Honstly, I have to disagree.  I would almost always prefer sum of errors instead of squared sum of errors unless my holding periods were very short.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a good amount of vol in (especially closing) prices that would be real hedging errors .  Imagine a trading strategy that is a near perfect hedge.  Say trade SPY versus SH.  Would you rather have sum of squared errors or sum of hedging?&lt;/p&gt;&#xA;" OwnerUserId="1368" LastActivityDate="2011-09-26T22:40:53.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2039" PostTypeId="2" ParentId="2003" CreationDate="2011-09-26T22:53:39.617" Score="4" Body="&lt;p&gt;The risk implied by Euribor or EONIA (or their swaps)  is for lending to another prime rated bank. These rate indexes represent where contributor banks are offering funds to each other in the interbank market. Contributing banks are mostly rated P-1 (Moody’s) or A-1 (S&amp;amp;P).  You wouldn’t use these rates for govt discount curves because the risk doesn’t match.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there are no short term govt securities you would have only a constant forward rate up to the first data point.  Even when there are short term securities, you don’t necessarily want them in every application. A parametric curve fitting might do a poor job with them. Spreads between short term govt and other short term rates might be ill-behaved. &lt;/p&gt;&#xA;" OwnerUserId="987" LastActivityDate="2011-09-26T22:53:39.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2040" PostTypeId="2" ParentId="2019" CreationDate="2011-09-26T23:04:46.563" Score="25" Body="&lt;p&gt;If you need a primer covering various domains of math then &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0979757622&quot;&gt;Dan Stefanica's text&lt;/a&gt; will do the job. The text covers multivariable calculus, lagrange multipliers, black scholes PDF, greeks &amp;amp; hedging, newton's method, bootstrapping, taylor series, numerical integration, and risk neutral valuation. It also includes a mathematical appendix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want an introduction to risk analysis complete with geometric interpretations check out ATillio Meucci's &lt;a href=&quot;http://www.amazon.com/s/ref=nb_sb_noss?field-keywords=meucci%20risk&amp;amp;url=search-alias=stripbooks&amp;amp;x=0&amp;amp;y=0&quot;&gt;Risk and Asset Allocation&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hull's &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0131499084&quot;&gt;Options, Futures, and Derivatives&lt;/a&gt; is a classic that includes stochastic calculus and the topics in the title.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are the best applied statistics books:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rene Carmona's &quot;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0387202862&quot;&gt;Statistical Analysis of Financial Data in S-Plus&lt;/a&gt;&quot; covers a lot of ground with examples compatible with R. He starts with foundations and builds towards more complex models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want ready-to-apply solutions Eric Zivot's &quot;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0387279652&quot;&gt;Modeling Financial Time Series with S-Plus&lt;/a&gt;&quot; is encyclopedic in the range of topics covered. Whereas Carmona will focus on various modeling techniques, Zivot will cover portfolio optimization, factor analysis, and many other topics. It makes for a great reference rather than a cover-to-cover read.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to focus on time-series specifically with an applied bent - Shumway and Stoffer's &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/144197864X&quot;&gt;Time Series Analysis and Applications&lt;/a&gt; is also great. The solutions are compatible with R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are various theoretical statistics books (Hamilton, Ruey Tsay) but those will assume you understand the math.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-12-15T14:36:35.247" LastActivityDate="2011-12-15T14:36:35.247" CommentCount="2" CommunityOwnedDate="2013-07-22T11:12:50.077" ContentLicense="CC BY-SA 3.0" />
  <row Id="2041" PostTypeId="2" ParentId="2010" CreationDate="2011-09-27T02:03:09.443" Score="3" Body="&lt;ul&gt;&#xA;&lt;li&gt;Alpha is easier to measure and easier to obtain in the cross-section than in the time-series.&lt;/li&gt;&#xA;&lt;li&gt;Low information coefficient combined with high breadth still make for a decent information ratio.&lt;/li&gt;&#xA;&lt;li&gt;The breadth of your strategies is always lower than you think.&lt;/li&gt;&#xA;&lt;li&gt;When markets collapse, correlation goes to one.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-09-27T02:03:09.443" CommentCount="4" CommunityOwnedDate="2011-09-27T02:03:09.443" ContentLicense="CC BY-SA 3.0" />
  <row Id="2042" PostTypeId="2" ParentId="2020" CreationDate="2011-09-27T02:55:25.683" Score="7" Body="&lt;p&gt;Measuring expected shortfall (also known as conditional value-at-risk) answers the simpler question of &quot;what is my average expected loss at the i-th quantile?&quot; given the empirical distribution of returns. A variation is &lt;a href=&quot;http://en.wikipedia.org/wiki/Value_at_risk&quot; rel=&quot;nofollow&quot;&gt;value-at-risk&lt;/a&gt; which measures the loss at the i-th quantile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Arguably you could leave at this this and you have your answer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You probably want a more robust estimate of your risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case you can use the bootstrap methodology. When you compute confidence intervals from a random sample, the statistics are themselves random variables. Indeed, your sample of returns itself is one of many possible samples. Each possible sample gives a possible value of Value-at-Risk, mean returns, etc. Although we observe one set of statistics using all your data it was selected at random from many values so it is therefore a random variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Enough with the theory - the procedure is not very difficult.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Define some statistic(s) of interest. Let's say it is value-at-risk.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Create a re-sample. You do this by sampling from your distribution of returns WITH replacement. Sample 'n' times where n is the number of observations. (You can actually sample 2n, 3n... if you'd like)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Calculate the statistic of interest on the re-sample.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Repeat steps #2 and #3 a couple thousand times.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Since the re-samples are independent of each other (b/c we re-sampled with replacement), the statistic you calculate in #4 is itself a random variable. You can now construct a confidence interval for the statistic of interest by measuring the standard error of the estimate and the t-statistic.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The bootstrap let's you answer your qualification &quot;within a normal range&quot;. The bootstrap recognizes that the empirical distribution is itself a sample from an unknown population.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can read more about the bootstrap &lt;a href=&quot;http://en.wikipedia.org/wiki/Bootstrapping_%28statistics%29#Example%3a_Case_resampling_for_estimating_the_distribution_of_sample_mean&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-09-28T16:02:45.510" LastActivityDate="2011-09-28T16:02:45.510" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2043" PostTypeId="2" ParentId="2019" CreationDate="2011-09-27T06:54:47.317" Score="12" Body="&lt;p&gt;If you asked me for a single book as a starting point I'd probably go for:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://books.google.de/books?id=HtfetswOX30C&amp;amp;printsec=frontcover&amp;amp;source=gbs_atb#v=onepage&amp;amp;q&amp;amp;f=false&quot;&gt;Frequently Asked Questions in Quantitative Finance&lt;/a&gt; by Paul Wilmott&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-09-27T06:54:47.317" CommentCount="3" CommunityOwnedDate="2013-07-22T11:12:50.077" ContentLicense="CC BY-SA 3.0" />
  <row Id="2045" PostTypeId="2" ParentId="96" CreationDate="2011-09-27T12:00:28.560" Score="12" Body="&lt;p&gt;I'm just providing a global answer to the question, as I think it can be interesting for some beginners in quant finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The properties given by TheBridge:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Normalize&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\rho (\emptyset)=0$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means you have no risk in taking no position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Sub-addiitivity&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\rho(A_1+A_2) \leq \rho(A_1)+\rho(A_2)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having a position in two different can only decrease the risk of the portfolio (diversification)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Positive homogeneity&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\rho(\lambda A) = \lambda \rho(A)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Doubling a position in an asset A doubles your risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And finally,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Translation invariance&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\rho(A + x) = \rho(A)-x$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, adding cash to a portfolio only diminishes the risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So a risk-measure is said to be &lt;strong&gt;coherent&lt;/strong&gt; if and only if it has all these properties.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this is just a convention, but it is motivated by the fact that all these properties are the ones an investor expects to hold for a risk measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, notice that neither VaR nor Var are coherent risk measures, wherease the Expected Shortfall is.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2012-07-18T08:15:51.440" LastActivityDate="2012-07-18T08:15:51.440" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2046" PostTypeId="1" CreationDate="2011-09-27T12:43:59.723" Score="30" ViewCount="5260" Body="&lt;p&gt;I did check the related posts, like this one &lt;a href=&quot;https://quant.stackexchange.com/questions/111/how-can-i-go-about-applying-machine-learning-algorithms-to-stock-markets&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;However, given if one already has knowledge in finance, machine learning and statistics, and  wants to know something more advanced on machine learning based trading rather than the introductory. What would you recommend?&lt;/p&gt;&#xA;&lt;p&gt;I am looking for anything related: excellent books, research papers, posts, authors, as long as it is related to machine learning and trading in general, but the thing is, really looking for the sources with quality content rather than the ads sites.&lt;/p&gt;&#xA;" OwnerUserId="1446" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2014-07-22T19:57:39.897" Title="Excellent information source on advanced machine learning / data mining based trading?" Tags="&lt;automated-trading&gt;&lt;machine-learning&gt;" AnswerCount="8" CommentCount="5" FavoriteCount="45" CommunityOwnedDate="2014-07-23T16:34:06.740" ContentLicense="CC BY-SA 3.0" />
  <row Id="2047" PostTypeId="2" ParentId="96" CreationDate="2011-09-27T14:45:55.453" Score="3" Body="&lt;p&gt;I don't think that we should care if a risk measure is coherent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason that VaR is not coherent is because it need not be sub-additive.  I'm willing to stand corrected, but I doubt that VaR is very far from sub-additive in practical situations.  And I don't see a great deal of harm if it were.  I have several problems with VaR but non-coherent is not among them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The homogeneity condition is wrong.  I call this the Amaranth condition -- it turns out that being all of one side of a market is risky.&lt;/p&gt;&#xA;" OwnerUserId="249" LastActivityDate="2011-09-27T14:45:55.453" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2048" PostTypeId="1" CreationDate="2011-09-27T14:49:07.737" Score="11" ViewCount="3482" Body="&lt;p&gt;I have heard that the SABR volatility model was not good at pricing a constant maturity swap (CMS). How is that?&lt;/p&gt;&#xA;" OwnerUserId="1448" LastEditorUserId="15650" LastEditDate="2016-04-13T16:26:32.940" LastActivityDate="2016-04-13T16:26:32.940" Title="Why is the SABR volatility model not good at pricing a constant maturity swap (CMS)?" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;derivatives&gt;&lt;stochastic-volatility&gt;&lt;cms&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="2049" PostTypeId="2" ParentId="2046" CreationDate="2011-09-27T17:40:11.460" Score="14" Body="&lt;p&gt;As the others have already mentioned, this is a very broad question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, as a starting point there are some blogs that come to my mind that have some up to date high quality content on these issues from time to time:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://quantivity.wordpress.com/&quot;&gt;http://quantivity.wordpress.com/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://epchan.blogspot.com/&quot;&gt;http://epchan.blogspot.com/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.automated-trading-system.com/&quot;&gt;http://www.automated-trading-system.com/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://intelligenttradingtech.blogspot.com/&quot;&gt;http://intelligenttradingtech.blogspot.com/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-09-27T17:40:11.460" CommentCount="0" CommunityOwnedDate="2014-07-23T16:34:06.740" ContentLicense="CC BY-SA 3.0" />
  <row Id="2050" PostTypeId="2" ParentId="2048" CreationDate="2011-09-27T17:43:11.360" Score="10" Body="&lt;p&gt;Here's a &lt;a href=&quot;http://www.level3finance.com/cms.pdf&quot;&gt;research note&lt;/a&gt; devoted to pricing of CMS by means of a stochastic volatility model. The authors indicate in the Introduction that&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;an analysis of the coupon structure leads to the conclusion that CMS contracts are particularly sensitive to the asymptotic behavior of implied volatilities for very large strikes. Market CMS rates actually drive the option market in extreme strike regions and indicate that implied volatilities ﬂatten out and converge asymptotically to a constant. This behavior is not consistent with the rapidly diverging asymptotics which are implied by SABR.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="70" LastActivityDate="2011-09-27T17:43:11.360" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2051" PostTypeId="2" ParentId="328" CreationDate="2011-09-27T20:05:53.127" Score="2" Body="&lt;p&gt;Answering this question is impossible without making many significant assumptions regarding risk preferences, utility functions, a model of returns, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way to measure the risk aversion of the representative investor is to compare the market's expected return to expected volatility.  When applied to the allocation decision between equity and fixed income, this is known as the equity &lt;a href=&quot;http://en.wikipedia.org/wiki/Risk_premium&quot; rel=&quot;nofollow&quot;&gt;risk premium&lt;/a&gt;.  The &lt;a href=&quot;http://en.wikipedia.org/wiki/Equity_premium_puzzle&quot; rel=&quot;nofollow&quot;&gt;equity premium puzzle&lt;/a&gt;, first pointed out by &lt;a href=&quot;http://www.academicwebpages.com/preview/mehra/pdf/The%20Equity%20Premium%20A%20Puzzle.pdf&quot; rel=&quot;nofollow&quot;&gt;Mehra and Prescott (1985)&lt;/a&gt;, holds that this difference is too large to be explained by most reasonable models of investor risk preference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://ssrn.com/abstract=1274967&quot; rel=&quot;nofollow&quot;&gt;Damodaran&lt;/a&gt; details a number of ways in which equity risk premium is commonly measured.  For example, combining the implied equity risk premium with implied volatility from the VIX, one can directly obtain a measure of the market's current risk aversion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://faculty.chicagobooth.edu/john.cochrane/research/papers/AFA_pres_speech.pdf&quot; rel=&quot;nofollow&quot;&gt;Cochrane (2011)&lt;/a&gt; discusses the variation among and commonality between risk premia in different asset classes. &lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-09-28T09:13:07.447" LastActivityDate="2011-09-28T09:13:07.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2052" PostTypeId="2" ParentId="1707" CreationDate="2011-09-27T22:56:50.967" Score="9" Body="&lt;p&gt;The problem of the selecting the best portfolio (according to some risk measure) with a limited number of assets can be formulated as a mixed integer linear or quadratic program and is reviewed in the recent paper &quot;&lt;a href=&quot;http://arxiv.org/ftp/arxiv/papers/1105/1105.3594.pdf&quot;&gt;Portfolio selection problems in practice: a comparison between linear and quadratic optimization models&lt;/a&gt;&quot;. It can be solved for reasonable sizes by several of the best optimizers like CPLEX or XPRESS. However, in the case of 5 stocks out of 10 there are only 252 possible possible different subsets (namely 10 choose 5) and they could  be all exaustively explored with repect to the risk measure of preference by any personal computer.&lt;/p&gt;&#xA;" OwnerUserId="1451" LastActivityDate="2011-09-27T22:56:50.967" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2053" PostTypeId="2" ParentId="328" CreationDate="2011-09-28T09:26:03.263" Score="3" Body="&lt;p&gt;Suppose that you have a model of returns, and a representative agent whose form of utility function you have specified right off the bat. This RA can be constructed, under conditions, from a population that is defined to have heterogeneous utility objectives. This is the problem of aggregation, and it's treated in every good asset pricing theory text (e.g. Skiadas' &lt;a href=&quot;http://goo.gl/K5bxC&quot; rel=&quot;nofollow&quot;&gt;Asset Pricing Theory&lt;/a&gt; or Duffie's &lt;a href=&quot;http://books.google.com/books?id=f2Wv-LDpsoUC&quot; rel=&quot;nofollow&quot;&gt;Dynamic Asset Pricing Theory&lt;/a&gt;). @Dirk is unfortunately wrong: virtually all financial models (even B&amp;amp;S!) assume an RA; and the CAPM and market portfolio have nothing to do with the existence or not, in theory or in &quot;reality&quot;, of an RA in asset pricing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to estimate or otherwise assess risk aversion, you &lt;em&gt;have&lt;/em&gt; to have such a model explicitly spelled out. Otherwise you will have to estimate a &lt;em&gt;distribution&lt;/em&gt; of risk aversion coefficients, that is virtually impossible - unless you have data on the initial positions of every player in the market! You also need a measure of consumption growth - as &lt;a href=&quot;http://home.uchicago.edu/~asavov/index_files/AssetPricingWithGarbage.pdf&quot; rel=&quot;nofollow&quot;&gt;creative as possible&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now @Tal Fishman's answer is accurate. Lucas's (1978) &quot;Asset Prices in an Exchange Economy&quot; model, when applied to equity premium data predicts a coefficient of risk aversion for the utility function of the RA that is exorbitantly high - and hence &quot;unreasonable&quot;. This is the &lt;a href=&quot;http://ideas.repec.org/p/ebg/iesewp/d-0757.html&quot; rel=&quot;nofollow&quot;&gt;equity premium puzzle&lt;/a&gt; -- there is also a dual puzzle in the relevant literature, called &quot;risk-free puzzle&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Economists have tried to &lt;a href=&quot;http://ideas.repec.org/a/ucp/jpolec/v98y1990i3p519-43.html&quot; rel=&quot;nofollow&quot;&gt;resolve it&lt;/a&gt;. Currently, the consensus in the literature seems to accumulate on the solution proposed by &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/0304393288901729&quot; rel=&quot;nofollow&quot;&gt;Rietz&lt;/a&gt;, and put forward by &lt;a href=&quot;http://www.wcfia.harvard.edu/sites/default/files/Barro_RareEvents.pdf&quot; rel=&quot;nofollow&quot;&gt;Barro&lt;/a&gt; and his student, &lt;a href=&quot;http://www.stanford.edu/~iwrm/&quot; rel=&quot;nofollow&quot;&gt;Ian Martin&lt;/a&gt; in a series of very interesting papers. In sum, a model that is consistent with market anticipation of &quot;rare disasters&quot; in consumption growth can produce reasonable (i.e. low to the point of being manageable) coefficients of risk aversion in such an RA asset pricing model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the canonical theory. A Taleb kind of approach, commonly known as &quot;decision theoretic&quot; (cf.@richardh's comment above) can extend standard expected utility constructions in theoretical asset pricing into having different forms of utility objectives, probability assessments of future events, or what have you. Doing empirics with these models is very often impossible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a practical solution to all this, one would suggest to estimate the &lt;em&gt;changes&lt;/em&gt; in risk aversion of whatever model you predefine, and not its absolute level. But you certainly need an RA model, whose use is put to work every time you compute the beta of a stock or a market portfolio.&lt;/p&gt;&#xA;" OwnerUserId="114" LastEditorUserId="114" LastEditDate="2011-09-28T10:21:38.470" LastActivityDate="2011-09-28T10:21:38.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2054" PostTypeId="1" AcceptedAnswerId="2061" CreationDate="2011-09-28T12:02:41.457" Score="11" ViewCount="2159" Body="&lt;p&gt;There are a lot of Quantitative Finance models (e.g. Black-Scholes) which are formulated in terms of partial differential equations. What is a standard approach in Quantitative Finance to solve these equations? Do people use some general packages for solving differential equations (like Maple, MATLAB or Mathematica)? Or, do people use some standard packages tuned for financial equations? Is it common to program numerical methods from scratch (say in C++, Java or Python)?&lt;/p&gt;&#xA;" OwnerUserId="981" LastEditorUserId="1106" LastEditDate="2011-09-28T16:06:36.673" LastActivityDate="2011-09-29T13:06:44.437" Title="What tools are used to numerically solve differential equations in Quantitative Finance?" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;programming&gt;&lt;differential-equations&gt;&lt;numerical-methods&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="2055" PostTypeId="2" ParentId="2054" CreationDate="2011-09-28T12:37:14.307" Score="7" Body="&lt;p&gt;You may want to look into these two open source projects:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://quantlib.org/index.shtml&quot;&gt;QuantLib&lt;/a&gt; which is aimed at providing a comprehensive software framework for quantitative finance. This is written in C++.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.jquantlib.org/index.php/Main_Page&quot;&gt;JQuantLib&lt;/a&gt; the 100% Java implementation based on the first project.&lt;/p&gt;&#xA;" OwnerUserId="1446" LastActivityDate="2011-09-28T12:37:14.307" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2056" PostTypeId="2" ParentId="2054" CreationDate="2011-09-28T16:03:21.390" Score="4" Body="&lt;p&gt;As far as I know, differential equations such as the Black-Scholes PDE are solved once analytically and then the result is used directly.  If a given derivatives-pricing differential equation could not be solved analytically, it would probably be better to model it numerically using Monte Carlo methods than to derive a complicated PDE which must then be solved numerically.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-09-28T16:03:21.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2059" PostTypeId="1" AcceptedAnswerId="2060" CreationDate="2011-09-29T02:21:22.723" Score="13" ViewCount="6818" Body="&lt;p&gt;In theory, how should volatility affect the price of a binary option?  A typical out the money option has more extrinsic value and therefore volatility plays a much more noticeable factor. Now let's say you have a binary option priced at .30 as people do not believe it will be worth 1.00 at expiration. How much does volatility affect this price?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Volatility can be high in the market, inflating the price of all options contracts, but would binary options behave differently? I haven't looked into how they are affected in practice yet, just looking to see if they would be different in theory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, the CBOE's binaries are only available on volatility indexes, so it gets a bit redundant trying to determine how much the &quot;value&quot; of volatility affects the price of &lt;em&gt;binary&lt;/em&gt; options on volatility.&lt;/p&gt;&#xA;" OwnerUserId="1453" LastEditorUserId="1106" LastEditDate="2011-10-03T16:27:48.630" LastActivityDate="2014-06-10T21:26:13.133" Title="How does volatility affect the price of binary options?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;volatility&gt;&lt;binary-options&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2060" PostTypeId="2" ParentId="2059" CreationDate="2011-09-29T12:34:17.200" Score="12" Body="&lt;p&gt;The price of a binary option, ignoring interest rates, is basically the same as the CDF $\phi(S)$ (or $1-\phi(S)$ ) of the terminal probability distribution.  Generally that terminal distribution will be lognormal from the Black-Scholes model, or close to it.  Option price is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C =  e^{-rT} \int_K^\infty \psi(S_T) dS_T$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for calls and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ P = e^{-rT} \int_0^K \psi(S_T) dS_T$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for puts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Volatility widens the distribution and, under the Black-Scholes model, shifts its mode a bit.  Generally speaking, increased volatility will&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Increase the density in the &quot;payoff region&quot; for out-of-the-money options, thereby increasing their theoretical value.  Assuming your option was worth 0.30 due to probabilities and not high risk-free rates $ r $, more volatility will increase its value. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Increase the density in the &quot;no-payoff region&quot; for in-the-money options, thereby decreasing their theoretical value.  An option now worth 0.70 will lose value, as the probability of ending outside the payoff region is increased.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As volatility $\sigma$ approaches $ \infty $, all option prices converge toward 0 for calls and 1 for puts.  In Black-Scholes land, even though the term $ \frac{\log(S_0/K)}{\sigma \sqrt{T}} \to 0$ and the probability distribution is spreading out all the way to infinity on the positive as well as negative side of the exponential of its distribution, it concentrates lognormally on values less than any finite strike.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, out-of-the-money calls will take on a maximum value at some volatility that concentrates as much probability as possible below the strike before concentrating the distribution too close to zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/6JkoQ.png&quot; alt=&quot;Binary Call By Volatility, With Maximum&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit&lt;/em&gt;:  A huge thank-you to @Veeken to pointing out that it is out-of-the-money calls, rather than puts, which take on a maximum theoretical value.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2013-05-10T00:32:20.280" LastActivityDate="2013-05-10T00:32:20.280" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2061" PostTypeId="2" ParentId="2054" CreationDate="2011-09-29T13:06:44.437" Score="12" Body="&lt;p&gt;Except in highly unusual cases, financial PDEs lack analytic solutions.  The &lt;em&gt;mathematical&lt;/em&gt; tools used are Monte Carlo, plus the usual ones for solving PDEs on grids, almost always one of the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Trees, for very simple cases&lt;/li&gt;&#xA;&lt;li&gt;Explicit finite differencing, for throwaway projects or very specific cases&lt;/li&gt;&#xA;&lt;li&gt;Implicit or Crank-Nicolson finite differencing for robust projects&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The &lt;em&gt;software&lt;/em&gt; tools used are typically Matlab or C, especially for finite differencing.  It is common to prototype something in Matlab or Python/Numpy, then translate to C for the final solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PDE solving &quot;packages&quot; are relatively unused, mainly because they are set up to handle the kinds of boundary conditions you would encounter in, say, materials stress analysis and not what want you to work with in finance .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the problems you are referring to, essentially ones of option valuation, can be thought of as solving expectation problems.  In particular, if an option has european exercise then its time $t$ value $ V(t) $ can be written&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ E\left[ B(t,T) V(T) \right] $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $ B $ represents discounting and the expectation is taken over paths specified by a stochastic differential equation (SDE).  In this case, the problem is amenable to Monte Carlo integration, which can be slow but is very easy to program.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using either the Feynman-Kac theorem or arbitrage arguments one can arrive at the &quot;companion PDE&quot; to this expectation on a SDE. American exercise changes the expectation to something nastier&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \sup_\tau \left\{ E\left[ B(t,T) V(T) \right] \right\} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\tau$ is the set of all possible early exercise strategies.  From this perspective, trees and differencing schemes are essentially &quot;dynamic programming&quot; techniques for finding option values and optimal exercise strategies at the same time.  Monte Carlo cannot achieve that (though dynamic modifications of it such as LSMC exist).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Grid schemes are hard to code, but are usually the only way to handle early exercise.  Exchange-traded equity options, bermudan interest rate swaps, convertible bonds, and untold numbers of exotic payoffs have to be treated using them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A large investment bank will have at least three proprietary monster PDE grid solvers around, almost always more.  Each one will handle several kinds of options, but the basic categories go like this:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;A Black-Scholes solver for equity options and other payoffs on the Black-Scholes SDE&lt;/li&gt;&#xA;&lt;li&gt;A solver for their favorite interest rate model to handle callable bonds, bermudan swaptions and so on&lt;/li&gt;&#xA;&lt;li&gt;A jump-to-default Black-Scholes solver for convertible bonds&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;These will have some overlap in capabilities, for example the Black-Scholes solver and the jump-to-default Black-Scholes will both be able to handle american exercise equity options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Volatility exotics or the use of models such as stochastic volatility with jumps would require their own solvers in addition to the ones above.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-09-29T13:06:44.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2062" PostTypeId="2" ParentId="2046" CreationDate="2011-09-29T16:04:05.710" Score="6" Body="&lt;p&gt;In 2010 &lt;a href=&quot;http://dm.section.informs.org/&quot;&gt;Informs&lt;/a&gt; and Kaggle organized time series prediction contest. The methods used by competitors are described &lt;a href=&quot;http://www.kaggle.com/c/informs2010/forums/t/133/and-the-winner-is&quot;&gt;here&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="1110" LastActivityDate="2011-09-29T16:04:05.710" CommentCount="0" CommunityOwnedDate="2014-07-23T16:34:06.740" ContentLicense="CC BY-SA 3.0" />
  <row Id="2063" PostTypeId="2" ParentId="2010" CreationDate="2011-09-29T17:35:11.373" Score="3" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.bogleheads.org/forum/viewtopic.php?t=69175&amp;amp;sid=aba236c544030593768957b39df3913c&quot; rel=&quot;nofollow&quot;&gt;Average net worth&lt;/a&gt; of people at bogleheads forum is very strong argument.&lt;/li&gt;&#xA;&lt;li&gt;Also, &lt;a href=&quot;http://www.dogsofthedow.com/&quot; rel=&quot;nofollow&quot;&gt;Dogs of the Dow&lt;/a&gt; is interesting approach for long term investing.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1110" LastActivityDate="2011-09-29T17:35:11.373" CommentCount="0" CommunityOwnedDate="2011-09-29T17:35:11.373" ContentLicense="CC BY-SA 3.0" />
  <row Id="2064" PostTypeId="2" ParentId="2046" CreationDate="2011-09-29T19:48:56.723" Score="12" Body="&lt;p&gt;I think R's CRAN Task Views on Machine Learning is an excellent resource for beginners moving to advanced algorithm traders. It is well-structured, broad, up-to-date, and ready-to-use!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://cran.r-project.org/web/views/MachineLearning.html&quot;&gt;http://cran.r-project.org/web/views/MachineLearning.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe all advanced quantitative traders already know this. But I haven't seen anyone post it here and Flake's related post. &lt;/p&gt;&#xA;" OwnerUserId="1455" LastActivityDate="2011-09-29T19:48:56.723" CommentCount="2" CommunityOwnedDate="2014-07-23T16:34:06.740" ContentLicense="CC BY-SA 3.0" />
  <row Id="2065" PostTypeId="1" CreationDate="2011-09-30T00:18:47.970" Score="9" ViewCount="400" Body="&lt;p&gt;I am looking for data on market participants at a particular moment (or some proxy/approximation). For example, how can I tell whether mostly big players and HFTs are dominating the market in particular time frame or whether there is a considerable amount of &quot;human&quot; trading. I would like this data at as high a frequency as possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas/explanations/consideration/pointers to data providers would be highly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="1409" LastEditorUserId="1106" LastEditDate="2011-10-03T14:33:12.953" LastActivityDate="2011-10-15T22:50:54.367" Title="Is there data on market participants at a particular moment?" Tags="&lt;data&gt;&lt;trading&gt;&lt;market-data&gt;&lt;market&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2066" PostTypeId="2" ParentId="2065" CreationDate="2011-09-30T00:51:50.593" Score="6" Body="&lt;p&gt;the Commodity Traders report is the most useful for this, it lets you deduce large and small players on the stock index futures. This is only released weekly by the CFTC&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise you can use volume:price divergence and average volume moving average to further deduce whats happening. Finally you can use level 2's to get a feel for the speed of orders and liquidity in an equity.&lt;/p&gt;&#xA;" OwnerUserId="1453" LastActivityDate="2011-09-30T00:51:50.593" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2067" PostTypeId="2" ParentId="1895" CreationDate="2011-09-30T03:24:05.670" Score="5" Body="&lt;p&gt;Joel Greenblatt's &quot;magic formula&quot; is similar in spirit to classic value styles.  He has a discussion of why he thinks it will continue to work (despite it's simplicity and public knowledge) around p. 73 in his Little Book that Beats the Market (see &lt;a href=&quot;http://books.google.com/books?id=M5HxYZaNQEQC&amp;amp;lpg=PA68&amp;amp;dq=continue%20to%20work%20magic%20formula&amp;amp;pg=PA73#v=onepage&amp;amp;q=continue%20to%20work%20magic%20formula&amp;amp;f=false&quot; rel=&quot;noreferrer&quot;&gt;http://books.google.com/books?id=M5HxYZaNQEQC&amp;amp;lpg=PA68&amp;amp;dq=continue%20to%20work%20magic%20formula&amp;amp;pg=PA73#v=onepage&amp;amp;q=continue%20to%20work%20magic%20formula&amp;amp;f=false&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The basic argument seems to be that it doesn't always work so institutions with annual performance mandates who would be most likely to make the anomaly go away would be less likely to follow the approach.  It's a kind of patience arbitrage argument, i.e. there are excess returns available to those who are patient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This argument may apply more generally.&lt;/p&gt;&#xA;" OwnerUserId="915" LastActivityDate="2011-09-30T03:24:05.670" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2068" PostTypeId="2" ParentId="1895" CreationDate="2011-09-30T15:57:46.853" Score="2" Body="&lt;p&gt;In the stock market, successful companies are the most innovative ones (esp in biotech, tech) so their individual market is new and their individual market has not been arbitraged away by competitors and governments. Therefore upcoming competitors are going to be as optimistic and correlated to the market leaders. Just from trading shares and financial derivatives, you and the other traders will not be affecting the underlying book value of that market's assets.&lt;/p&gt;&#xA;" OwnerUserId="1453" LastActivityDate="2011-09-30T15:57:46.853" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2069" PostTypeId="1" AcceptedAnswerId="2097" CreationDate="2011-09-30T16:23:53.733" Score="8" ViewCount="1182" Body="&lt;p&gt;I have a process that estimates the parameters for the following function using the &lt;a href=&quot;http://people.sc.fsu.edu/~jburkardt/f77_src/nl2sol/nl2sol.html&quot;&gt;NL2SOL algorithm&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C-[\alpha+\frac{\beta-\alpha}{1+e^-\theta(y_t-\delta)} \vartriangle y_t]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The process currently holds $\alpha$ and $\beta$ constant, so only $C$, $\theta$, and $\delta$ are being estimated.  The parameters are generally stable over time ($\delta \approxeq 5$, $\theta \approxeq 2$, and $C \approxeq 0$).  The problem is that sometimes NL2SOL gives very poor estimates of these three parameters ($\delta &gt; 100$, $\theta = 0$, $C=-1$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm considering an ad-hoc solution that would re-estimate the parameters using new starting values and/or by setting $C$ to a constant.  Before I do that, I wanted to ask this fine community: what might be causing these poor estimates and what action should I take?  Should I use an algorithm other than NL2SOL?&lt;/p&gt;&#xA;" OwnerUserId="56" LastEditorUserId="56" LastEditDate="2011-09-30T16:30:41.133" LastActivityDate="2012-12-20T16:22:48.600" Title="Fitting a generalized logistic distribution" Tags="&lt;estimation&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2070" PostTypeId="1" AcceptedAnswerId="2072" CreationDate="2011-09-30T17:04:58.213" Score="13" ViewCount="5619" Body="&lt;p&gt;How do you use bond prices/yields to infer probabilities of default?  I would think of it as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Create a relationship between default free (e.g., Germany) and defaultable (e.g., Greece) bond prices and solve for $p$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{eqnarray}&#xD;&#xA;\tilde{B}(0,T)   =  B(0,T)rp + B(0,T)(1-p) \\&#xD;&#xA;      \frac{1}{1+\tilde{y}}   =  \frac{r}{1+y}p + \frac{1}{1+y}(1-p) \\&#xD;&#xA;       \left(\frac{1+y}{1+\tilde{y}} - 1\right)\frac{1}{r-1}   =  p,&#xD;&#xA;\end{eqnarray}$$&#xA;where $\tilde{B}(0,T)$ and $\tilde{y}$ are the defaultable bond price and associated yield respectively,  $r$ is the recovery rate and $p$ is the probability of default.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A) Is this something you would actually use in practice?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;B) How do you go about making an assumption on the recovery rate?&lt;/p&gt;&#xA;" OwnerUserId="826" LastEditorUserId="1106" LastEditDate="2011-10-02T13:24:06.483" LastActivityDate="2011-10-02T13:24:06.483" Title="How to estimate probability of default from bond prices?" Tags="&lt;probability&gt;&lt;fixed-income&gt;&lt;credit&gt;&lt;default&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2071" PostTypeId="2" ParentId="2065" CreationDate="2011-09-30T17:41:49.213" Score="5" Body="&lt;p&gt;Your question will be very difficult to answer, at least for equities. The best you can probably do in terms of accurate information are research reports from organizations like &lt;a href=&quot;http://www.tabbgroup.com/&quot; rel=&quot;nofollow&quot;&gt;Tabb&lt;/a&gt;. You can look at positioning of players from 13F reports, meaning you can see which players have large positions in a certain equity. You may not be able to discern why, especially for large players who run many different type of strategies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as daily information I know of no reliable way to see what type of player is trading what. Its easy to see which instruments HFT is in from the quote volume and patterns. Otherwise for equities the players are hidden behind the order books.&lt;/p&gt;&#xA;" OwnerUserId="373" LastActivityDate="2011-09-30T17:41:49.213" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2072" PostTypeId="2" ParentId="2070" CreationDate="2011-09-30T19:12:00.607" Score="8" Body="&lt;p&gt;In practice, I would &lt;em&gt;begin&lt;/em&gt; with the recovery assumption.  In the case of Greece, dealers are probably already quoting recovery swaps, allowing you to set this parameter directly.  In general, you have to be willing to make assumptions based on history or on conversations with bankruptcy experts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once I have the recovery assumption, I can take any instrument, CDS or bond, and solve for the hazard rate $h$ that makes its sum of expected cashflows agree with the market price.  once I have the hazard rate, the probability of defaulting before time $T$ is simply $e^{-hT}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I actually do, though, is choose a set of anchor times $t_i$ for step-function $h(t)$ and simultaneously fit it, as best I can, to all observable debt instrument prices. Usually $\vec{t}=\{0.5, 1, 2, 3, 5, 7, 10\}$. The probability of defaulting before time $T$ is now&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \exp\left( -\int_0^T h(s) ds \right) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note in particular that the &quot;yield&quot; has nothing to do with these calculations.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-09-30T19:12:00.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2074" PostTypeId="1" AcceptedAnswerId="2077" CreationDate="2011-10-01T16:06:49.727" Score="47" ViewCount="20666" Body="&lt;p&gt;I have a sample covariance matrix of S&amp;amp;P 500 security returns where the smallest k-th eigenvalues are negative and quite small (reflecting noise and some high correlations in the matrix). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am performing some operations on the covariance matrix and this matrix must be positive definite. What is the best way to &quot;fix&quot; the covariance matrix? (For what it's worth, I intend to take the inverse of the covariance matrix.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One approach proposed by &lt;a href=&quot;http://www.quarchome.org/correlationmatrix.pdf&quot; rel=&quot;noreferrer&quot;&gt;Rebonato&lt;/a&gt; (1999) is to decompose the covariance matrix into its eigenvectors and eigenvalues, set the negative eigenvalues to 0 or (0+epsilon), and then rebuild the covariance matrix. The issue I have with this method is that:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;the trace of the original matrix is not preserved, and&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;the method ignores the idea of &lt;a href=&quot;http://www.pas.rochester.edu/~rajeev/phy406/Symmetries10.pdf&quot; rel=&quot;noreferrer&quot;&gt;level repulsion&lt;/a&gt; in random matrices (i.e. that eigenvalues are not close to each other).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://eprints.ma.man.ac.uk/232/01/covered/MIMS_ep2006_70.pdf&quot; rel=&quot;noreferrer&quot;&gt;Higham&lt;/a&gt; (2001) uses an optimization procedure to find the nearest correlation matrix that is positive semi-definite. &lt;a href=&quot;http://staff.science.uva.nl/~spreij/stieltjes/pietersz.pdf&quot; rel=&quot;noreferrer&quot;&gt;Grubisic and Pietersz (2003)&lt;/a&gt; have a geometric method they claim outperforms the Higham technique. Incidentally, some more recent twists on Rebonato's paper are &lt;a href=&quot;http://www.ijpam.eu/contents/2009-55-3/2/2.pdf&quot; rel=&quot;noreferrer&quot;&gt;Kercheval&lt;/a&gt; (2009) and &lt;a href=&quot;http://imaman.oxfordjournals.org/content/18/1/55.short&quot; rel=&quot;noreferrer&quot;&gt;Rapisardo&lt;/a&gt; (2006) who build off of Rebonato with a geometric approach. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A critical point is that the resulting matrix may not be singular (which can be the case when using optimization methods).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What is the best way to transform a covariance matrix into a positive definite covariance matrix?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE: Perhaps another angle of attack is to test whether a security is linearly dependent on a combination of securities and removing the offender.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="26595" LastEditDate="2017-06-16T09:24:40.070" LastActivityDate="2017-06-16T09:24:40.070" Title="What is the best way to &quot;fix&quot; a covariance matrix that is not positive semi-definite?" Tags="&lt;risk&gt;&lt;statistics&gt;&lt;research&gt;&lt;correlation&gt;&lt;covariance&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="34" ContentLicense="CC BY-SA 3.0" />
  <row Id="2075" PostTypeId="2" ParentId="2074" CreationDate="2011-10-01T16:58:39.767" Score="7" Body="&lt;p&gt;The short answer is that I don't know, but your question gives some hints about how to find out.  The key thing for me is that you want a minimum variance portfolio.  I don't think you should be thinking about some abstract mathematical operation that is &quot;best&quot;, but rather look over a few mathematical operations and see which seems to work best for your application.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you can approximate the problem you have now with data in the past, then you can test different methods over time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some observations:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;if you have a long-only portfolio, then that already helps you out a lot.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you have lots of assets relative to time points, then it is harder: you want to use (if possible) Ledoit-Wolf shrinkage or a factor model to estimate the variance matrix.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You don't want the optimizer to see any portfolios that  have zero (or negative) risk.  That is the finance version of positive eigenvalues -- you want your epsilon to be non-trivial.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You don't say why you start out with a non-positive definite matrix.  If it is because of missing values and you have the original returns, then there is code to do Ledoit-Wolf shrinkage in such a case.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="249" LastActivityDate="2011-10-01T16:58:39.767" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2076" PostTypeId="1" AcceptedAnswerId="2107" CreationDate="2011-10-02T12:20:48.947" Score="25" ViewCount="13025" Body="&lt;p&gt;I ran a Johansen cointegration test on 3 instruments, A B and C.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The results that I got are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;R&amp;lt;=x |     Test Stat  90%    95%    99%&#xA;r=0 --&amp;gt;    36.7       18.9   21.1   25.8&#xA;r=1  --&amp;gt;   8.4        12.29  14.26  18.52&#xA;r=2  --&amp;gt;   0.21       2.7    3.8    6.6&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;EigenValues EigenMatrix &#xA;0.03     --&amp;gt;  0.25 | 0.512  |-0.79&#xA;0.007    --&amp;gt; -0.96 | -0.618 | 0.14&#xA;0.00017  --&amp;gt;  0.05 | 0.59   | 0.59     &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My question is how I interpret these results? How do I know there is a cointegration for the these instruments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to build a portfolio using the eigen vector? Which eigen vector should I choose to build my portfolio?&lt;/p&gt;&#xA;" OwnerUserId="1463" LastEditorUserId="743" LastEditDate="2015-08-22T21:25:58.453" LastActivityDate="2015-08-22T21:25:58.453" Title="How to interpret the eigenmatrix from a Johansen cointegration test?" Tags="&lt;statistics&gt;&lt;cointegration&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="2077" PostTypeId="2" ParentId="2074" CreationDate="2011-10-02T13:01:51.423" Score="20" Body="&lt;p&gt;Nick Higham's specialty is algorithms to find the nearest correlation matrix.  His older work involved increased performance (in order-of-convergence terms) of techniques that successively projected a nearly-positive-semi-definite matrix onto the positive semidefinite space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps even more interesting, from the practitioner point of view, is his extension to the case of correlation matrices with factor model structures.  The best place to look for this work is probably the &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.664.1881&quot; rel=&quot;noreferrer&quot;&gt;PhD thesis paper&lt;/a&gt; by his doctoral student Ruediger Borsdorf.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Higham's &lt;a href=&quot;https://nickhigham.wordpress.com/2013/02/13/the-nearest-correlation-matrix/&quot; rel=&quot;noreferrer&quot;&gt;blog&lt;/a&gt; entry covers his work up to 2013 pretty well.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2017-06-06T14:06:59.833" LastActivityDate="2017-06-06T14:06:59.833" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2078" PostTypeId="2" ParentId="47" CreationDate="2011-10-02T13:09:50.310" Score="0" Body="&lt;p&gt;To create a lognormal distribution (that is, to generate values from it), you need to start with normally distributed numbers and then exponentiate them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is to say, take a sample $z$ from the standard normal distribution, and form the lognormally distributed underlying value&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;U_T = U_0 \exp\left( (r-q-\sigma^2/2)T + \sigma \sqrt{T} z  \right)&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The probability density function of $U_T$ is formed from solving this for $z$ and then applying the normal PDF.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-10-02T13:09:50.310" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2079" PostTypeId="1" AcceptedAnswerId="2083" CreationDate="2011-10-02T23:50:54.793" Score="34" ViewCount="14536" Body="&lt;p&gt;It's not clear to me how to realize skewness.  In other words, how do you implement skew arbitrage? There seems to be no well-known recipe like in &lt;a href=&quot;http://en.wikipedia.org/wiki/Volatility_arbitrage&quot;&gt;volatility arbitrage&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Volatility arbitrage (or vol arb) is a type of statistical arbitrage implemented by trading a delta neutral portfolio of an option and its underlier. The objective is to take advantage of differences between the implied volatility and a forecast of future realized volatility of the option's underlier.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My hypothetical skew arbitrage definition:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Skew arbitrage is a type of statistical arbitrage implemented by trading a delta and volatility neutral portfolio. The objective is to take advantage of differences between the implied skew and a forecast of future realized skew of the option's underlier.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Is it possible to make such a skew-arb portfolio in practice? If I have great confidence in my skew forecast but not in my volatility forecast, I am tempted to engage in this type arbitrage. But again, this is just a hypothetical version of skew arbitrage. If you know a correct and more practical version, you are welcome to correct me!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same question but in a different voice: In practice, a skew bet is implemented through vertical spread, i.e. buying and selling options of different strikes. How do options traders hedge / realize the edge of the spread they trade that is indifferent to the underlying volatility?&lt;/p&gt;&#xA;" OwnerUserId="1455" LastEditorUserId="1106" LastEditDate="2011-10-03T14:44:18.260" LastActivityDate="2012-12-07T19:14:43.870" Title="Skew arbitrage: How can you realize the skewness of the underlying?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;trading&gt;&lt;hedging&gt;&lt;option-strategies&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="24" ContentLicense="CC BY-SA 3.0" />
  <row Id="2082" PostTypeId="2" ParentId="2079" CreationDate="2011-10-03T10:00:17.467" Score="8" Body="&lt;p&gt;The paper &lt;a href=&quot;http://www.princeton.edu/~yacine/comp.pdf&quot; rel=&quot;nofollow&quot;&gt;&quot;Do option markets correctly price the probabilities of movement of the underlying asset? &quot;&lt;/a&gt; by Yacine Aït-Sahalia, Yubo Wang, and Francis Yared should in my opinion provide many very usefull elements for this question (look in particular at section 3).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="92" LastEditDate="2011-10-03T19:19:23.983" LastActivityDate="2011-10-03T19:19:23.983" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2083" PostTypeId="2" ParentId="2079" CreationDate="2011-10-03T14:53:34.833" Score="16" Body="&lt;p&gt;Great question!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the most useful starting point is &lt;a href=&quot;http://people.umass.edu/nkapadia/docs/Bakshi_Kapadia_Madan_2003_RFS.pdf&quot;&gt;Stock Return Characteristics, Skew Laws, and the Differential Pricing of Individual Equity Options by Bakshi, Kapadia and Madan (2003)&lt;/a&gt;.  Their paper proposes a definition of model-free implied skewness (they originally called it risk-neutral skewness, but MFIS is more accurate), which they prove will have a P&amp;amp;L directly proportional to the realized skewness of the underlier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Subsequent papers (there are literally dozens) have thoroughly explored the properties of MFIS.  In particular, &lt;a href=&quot;http://ssrn.com/abstract=1572827&quot;&gt;Does Risk-Neutral Skewness Predict the Cross-Section of Equity Option Portfolio Returns?&lt;/a&gt; by Bali and Murray (2011) estimates the empirical average returns to delta-neutral and vega-neutral skewness portfolios, and they find a strong negative relation between implied risk-neutral skewness and the returns of a skewness portfolio, consistent with a positive skewness preference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, there are two different concepts involved here.  The first is options implied-volatility &lt;em&gt;skew&lt;/em&gt;, which relates to the way volatility changes as a function of price (reflected in options as a function of strike price).  The second is the &lt;em&gt;skewness&lt;/em&gt; of the underlier, which is a property of the returns distribution.  Since you talk about &quot;realizing skew,&quot; I believe you are referring to the second concept, which is the focus of BKM (2003).&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-10-06T22:52:41.147" LastActivityDate="2011-10-06T22:52:41.147" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2084" PostTypeId="2" ParentId="911" CreationDate="2011-10-03T15:04:36.980" Score="3" Body="&lt;p&gt;@amber - &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a general hint: try to solve a small-scale case first. Pick a two- or better three-asset $(\mu,\Sigma)$ and construct the objectives. Construct the &quot;skewness tensor&quot; (it's not a matrix, you can think of it like a &quot;cube&quot; or something - consult &lt;a href=&quot;http://goo.gl/eLTcz&quot; rel=&quot;nofollow&quot;&gt;this book&lt;/a&gt; on how you can actually represent it as a matrix, or &lt;a href=&quot;http://eu.wiley.com/WileyCDA/WileyTitle/productCd-0471699004,descCd-google_preview.html&quot; rel=&quot;nofollow&quot;&gt;Fabozzi et al's textbook&lt;/a&gt; for an accessible discussion to the whole idea of introducing skewness tensors).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, actually, it will be difficult to construct the feasible sets, since you don't seem to have a clear grasp of the optimization problem - there are many calls for clarifications. Try to spell them out explicitly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next, note that the skewness tensor alters &lt;em&gt;both&lt;/em&gt; the feasible sets &lt;em&gt;and&lt;/em&gt; the objective. It is easy to establish the monotonicity, once the tensor is explicitly introduced in both. To do so, you can even use the simple Karush-Kuhn-Tucker conditions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both inequalities are very easy to establish.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good luck with your thesis.&lt;/p&gt;&#xA;" OwnerUserId="114" LastActivityDate="2011-10-03T15:04:36.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2085" PostTypeId="2" ParentId="1777" CreationDate="2011-10-03T15:26:14.963" Score="3" Body="&lt;p&gt;Here's a paper by &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=887780&amp;amp;http://www.google.com/url?sa=t&amp;amp;source=web&amp;amp;cd=8&amp;amp;ved=0CFMQFjAH&amp;amp;url=http://papers.ssrn.com/sol3/Delivery.cfm?abstractid=887780&amp;amp;rct=j&amp;amp;q=dynamic%20linear%20models%20%2bequity&amp;amp;ei=RdOJTp3fFpHPgAe22pH6Cg&amp;amp;usg=AFQjCNEztIlf6rHcGTxnXT9AFIjp863K5Q&quot; rel=&quot;nofollow&quot;&gt;Dangl, Halling, and Randl (2006)&lt;/a&gt; that uses a dynamic linear model to forecast the equity risk premium.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2011-10-03T15:26:14.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2086" PostTypeId="1" AcceptedAnswerId="2089" CreationDate="2011-10-03T16:49:44.440" Score="20" ViewCount="6128" Body="&lt;p&gt;Sorry if the question sounds rough.&#xA;It's not my intention to devaluate something I've not yet understood like Quantitative Finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So to keep it simple:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;is Quantitative Finance a science, like Math or Physics?&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;Or is it something more similar to Technical Analysis, but&#xA;with much more math into it?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I know Technical Analysis is not a science, but an attempt to apply math to past financial data in order to find a way to predict the future movement of the same financial data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously things can mix up and create confusion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Formulas like a simple Moving Average are real math and they are still in the field of science. It's when people attempt to apply a moving average to predict the future that they trespass the border of science to enter the field of empirism (that unfortunately in worst cases might even lead to charlatanism).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It confuses me even more when I read on Wikipedia about &lt;a href=&quot;http://en.wikipedia.org/wiki/Quantitative_analyst&quot;&gt;&quot;Algorithmic trading quant&quot;&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Often the highest paid form of Quant, ATQs make use of methods taken&#xA;  from signal processing&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Well A T3 (the so called &lt;a href=&quot;http://www.etrading.sk/en/technical-analysis/44-indikatory-technickej-analyzy/150-t3-moving-average&quot;&gt;Tillson's moving average&lt;/a&gt;) comes from signal processing (low pass filter/differentiators digital filter) and it's used in Technical Analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if someone uses a simple Moving Average is a Technical Analyst, but when he uses a T3 moving average is a Quant, because the latter one is more complicated to be calculated?&lt;/p&gt;&#xA;" OwnerUserId="1466" LastEditorUserId="1466" LastEditDate="2011-10-03T19:16:04.143" LastActivityDate="2011-10-04T17:20:08.763" Title="At what point does someone using technical analysis become a Quant?" Tags="&lt;finance&gt;&lt;analysis&gt;&lt;technicals&gt;&lt;quantitative&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="2087" PostTypeId="1" AcceptedAnswerId="2094" CreationDate="2011-10-03T17:32:45.290" Score="15" ViewCount="1110" Body="&lt;p&gt;&lt;em&gt;Bakshi et al., (2006) Estimation of continuous-time models with an application to equity volatility dynamics&lt;/em&gt; (Table 2) estimate the following Cox-Ingersoll-Ross model for market variance, $\sigma^2_t$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathrm{d}\sigma^2_t = (\alpha_0 + \alpha_1\sigma^2_t)\mathrm{d}t + \sqrt{\beta_1}\sigma_t\mathrm{d}W_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To estimate their model they use $\left(\frac{VIX_t}{100}\right)^2$ as a proxy to $\sigma^2_t$, where $VIX_t$ is the daily VIX price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But VIX measures expected volatility (in percentage terms) of the market over the &lt;strong&gt;next 30-day period&lt;/strong&gt; (as implied by S&amp;amp;P index options). So $\left(\frac{VIX_t}{100}\right)^2$ is basically a moving average over future daily market variance. This extra MA structure makes it a poor proxy to the true instantaneous market variance $\sigma^2_t$---especially when trying to model daily market variance dynamics. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What am I missing? Have I misunderstood something? Or have I understood things correctly and using the $VIX_t$ proxy is considered a &quot;good enough&quot; approach?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NOTE: The authors do end up estimating $(\alpha_0, \alpha_1, \beta_1) = (0.3141, -8.0369, 0.1827)$, which implies a long-run market volatility of 0.20 in annualized terms. That more or less agrees with observations. So maybe &quot;good enough&quot;?&lt;/p&gt;&#xA;" OwnerUserId="1468" LastEditorUserId="1468" LastEditDate="2018-03-23T01:41:49.427" LastActivityDate="2018-03-23T01:41:49.427" Title="Can VIX be interpreted as a proxy for instantaneous volatility?" Tags="&lt;volatility&gt;&lt;research&gt;&lt;implied-volatility&gt;&lt;vix&gt;&lt;stochastic-volatility&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2088" PostTypeId="2" ParentId="2086" CreationDate="2011-10-03T19:18:43.797" Score="6" Body="&lt;p&gt;Hi Quantitative Finance has in my opinion two main streams. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first is about of valuation of some derivative contracts in a consistent way. This is a theory and once paradigms accepted it is coherent, it can considered as science at the same level as economy can pretend to this kind of terminology.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second is about making (or trying to) prediction(s) over some time horizon about the behaviour of some underlying asset(s) in a statistical way, and ultimately trying to get advantage of your modelisation to generate some profit with &quot;minimum risk taking&quot; (this is purposely left ambiguous). This is more grounded (IMO)than the first branch as it is more dependent of microstructure of the paricular market you are studying, but can be as technical if not more than the pricing some exotic option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The summum would be to reconcile both of course. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is some kind of duality between those areas of QF just as there some kind of duality between probability and statistics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards&lt;/p&gt;&#xA;" OwnerUserId="92" LastActivityDate="2011-10-03T19:18:43.797" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2089" PostTypeId="2" ParentId="2086" CreationDate="2011-10-03T20:09:19.947" Score="11" Body="&lt;p&gt;There is certainly much more to quantitative finance than technical analysis, and a &lt;a href=&quot;https://quant.stackexchange.com/q/350/1106&quot;&gt;previous question&lt;/a&gt; does a decent job of outlining the different areas, as does the wikipedia on &lt;a href=&quot;http://en.wikipedia.org/wiki/Quantitative_analyst&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;quantitative analyst&quot;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even for what wikipedia terms an &quot;algorithmic trading quant&quot; or what &lt;a href=&quot;http://www.markjoshi.com/downloads/advice.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Mark Joshi&lt;/a&gt; terms a &quot;statistical arbitrage quant&quot;, technical analysis is just one tool in a very broad tool chest.  Some quantitative trading strategies will make absolutely zero use of what would commonly be referred to as technical indicators, while others will rely on them quite heavily.  I would say that two things distinguish a &lt;em&gt;quant who uses technicals&lt;/em&gt; from a &lt;em&gt;technician&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;A &lt;strong&gt;rigorous approach&lt;/strong&gt;, which includes backtesting, statistics (t-statistics, confidence intervals), performance measurement (information ratios and information coefficients), optimization, and a large heap of broader understanding of what is driving returns.&lt;/li&gt;&#xA;&lt;li&gt;A &lt;strong&gt;balanced&lt;/strong&gt; use of technicals as well as other types of indicators and/or non-technical-analysis methods (e.g. mean-variance optimization for position sizing).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;An example of technical analysis as it would be applied by a quant is &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470008741&quot; rel=&quot;nofollow noreferrer&quot;&gt;Evidence-Based Technical Analysis&lt;/a&gt; by David Aronson.  Most other technical analysis books are garbage.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2011-10-03T20:09:19.947" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2090" PostTypeId="1" AcceptedAnswerId="2093" CreationDate="2011-10-03T23:06:03.150" Score="-2" ViewCount="252" Body="&lt;p&gt;Expectancy is defined as &quot;How much money gained for every $1 risked&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the expectancy for this particular series of trades?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Risked €1, won €2&lt;/li&gt;&#xA;&lt;li&gt;Risked €2, won €1&lt;/li&gt;&#xA;&lt;li&gt;Risked €3, won €6&lt;/li&gt;&#xA;&lt;li&gt;Risked €3, won €6&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="906" LastEditorUserId="16595" LastEditDate="2019-06-24T14:56:04.123" LastActivityDate="2019-06-24T14:56:04.123" Title="How do I calculate expectancy from a past series of trades in my trading account?" Tags="&lt;expected-return&gt;" AnswerCount="2" CommentCount="3" ClosedDate="2011-10-04T16:23:55.843" ContentLicense="CC BY-SA 3.0" />
  <row Id="2091" PostTypeId="2" ParentId="2090" CreationDate="2011-10-03T23:23:42.487" Score="0" Body="&lt;p&gt;Lets see if I have this right:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Expectancy = average win / average loss.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Risked €1, won €2 means total wins are now €1 for 1 trade.&lt;/li&gt;&#xA;&lt;li&gt;Risked €2, won €2 means total losses are now €1 in 1 trade.&lt;/li&gt;&#xA;&lt;li&gt;Risked €3, won €6 means total wins now rise to €4 over 2 trades.&lt;/li&gt;&#xA;&lt;li&gt;Risked €3, won €6 means total wins now rise to €7 over 3 trades.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Thus, average win = €7 / 2 = €3.50, average loss €1 / 1 = €1, so expectancy is 3.50 for this series of trades?&lt;/p&gt;&#xA;" OwnerUserId="906" LastActivityDate="2011-10-03T23:23:42.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2092" PostTypeId="1" AcceptedAnswerId="2102" CreationDate="2011-10-04T12:05:05.380" Score="18" ViewCount="2660" Body="&lt;p&gt;In recent months I've come to the conclusion that there are not only certain &lt;strong&gt;regimes&lt;/strong&gt; in the markets (like bear or bull) but phases where all models fail because we are in uncharted territory. The former are &lt;strong&gt;pockets of predictability&lt;/strong&gt;, as I like to call them, the latter are phases where it is best to stay out of the markets altogether.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another observation is that there seem to be variables that in and of themselves have very little forecasting power but seem to be &lt;strong&gt;useful in differentiating between different regimes&lt;/strong&gt;. I haven't tested that rigorously but an idea why this could be the case would be that the relationship is highly non-linear, but there nevertheless.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a very crude example lets take the &lt;em&gt;VIX&lt;/em&gt; as the so called barometer of fear. It doesn't seem to be that good at forecasting returns, yet it seems that different levels show different regimes, i.e. a certain tendency in the market (low -&gt; bull, high -&gt; bear).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when we have extreme readings the swings are extreme too, i.e. markets falling like a stone but sometimes very pronounced swing-backs too. That would be an example of complete unpredictability. There could also be a region between a real &quot;low&quot; and a real &quot;high&quot; reading where things are unpredictable too (even in probabilistic terms).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As another, more elaborate example take a look at this &lt;a href=&quot;http://www.ibb.ubs.com/mc/strategyindices/ubsrada/downloads/rada_factsheet.pdf&quot;&gt;quant trading model from UBS&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question&lt;/strong&gt;&lt;br&gt;&#xA;How would you proceed in building a model that identifies different regimes in the data and meta-models its own limits? Which mathematical &lt;em&gt;ansatz&lt;/em&gt; (approach) would you choose? How would you find the brackets (barriers/limits)? How would you test it?&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="1106" LastEditDate="2011-10-04T17:27:09.053" LastActivityDate="2011-10-06T01:27:30.937" Title="How to build a regime-switching model which knows its own limits?" Tags="&lt;backtesting&gt;&lt;quant-trading-strategies&gt;&lt;modeling&gt;&lt;market-regimes&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="2093" PostTypeId="2" ParentId="2090" CreationDate="2011-10-04T15:06:56.840" Score="1" Body="&lt;p&gt;Van Tharp addresses expectancy in his book, &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/007147871X&quot; rel=&quot;nofollow&quot;&gt;Trade Your Way to Financial Freedom&lt;/a&gt;.&#xA;Here is his definition of expectancy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{winPct * winAmt - losePct * loseAmt}{trades}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would recast your trades as follows:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Won €1&lt;/li&gt;&#xA;&lt;li&gt;Lost €1&lt;/li&gt;&#xA;&lt;li&gt;Won €3&lt;/li&gt;&#xA;&lt;li&gt;Won €3&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Your winning percentage is 75%. Your losing percentage is 25%. Your winning amount is €7. Your losing amount is €1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So your expectancy would be&#xA;$\frac{.75* €7 - .25 * €1}{4}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your expectancy, by Tharp's reckoning, would be €1,25. Tharp does not directly use the amount at risk. Rather, his definition takes into account that the trader or quant may choose a larger bet size when the odds are in his favor. &lt;/p&gt;&#xA;" OwnerUserId="343" LastActivityDate="2011-10-04T15:06:56.840" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2094" PostTypeId="2" ParentId="2087" CreationDate="2011-10-04T15:07:18.497" Score="7" Body="&lt;p&gt;You have to ask yourself what the ultimate purpose of this parameterization is.  In their case, they imply the &quot;end-goal is martingale pricing or maximum-likelihood estimation&quot;, both of which are ultimately about capturing long-period dynamics rather than intraday or interday behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For this reason, the fact that intraday variance may, ahem, vary around a smoother VIX estimate is not so material to any ultimate conclusions.  And the resulting model has the advantage of working off a much better-behaved estimator than you get by actually computing live variances of underlying price series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Someone trading options intraday might well avoid this parameterization, but for 1-week risk or exotics vauation I see it as sensible.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-10-04T15:07:18.497" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2095" PostTypeId="2" ParentId="2086" CreationDate="2011-10-04T17:20:08.763" Score="5" Body="&lt;p&gt;Quant in trading creates system that can be backtested, has a certain risk valuation. It is more like playing chess when you need to calculate multistep strategy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let say certain instrument moves 1% a day. Our goal is to create strategy for one year (250 step strategy). If we use stock + options we get 50 or more entries a day into our system for analysis. 250*50 = 12500 a year to analyze. So, in order to create strategy, we simulate dynamics of 12500 entries.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can quant trading be taught. I think it is not possible. Because you should know about the market something that is not in books and other don't know. So, it is more like a craft. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But other areas of quantitative analysis like risk management are more instructions friendly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the TA used in quant strategies. The answer yes. For example, price clusterization or levels in TA.   &lt;/p&gt;&#xA;" OwnerUserId="1110" LastActivityDate="2011-10-04T17:20:08.763" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2096" PostTypeId="2" ParentId="2074" CreationDate="2011-10-04T17:52:53.290" Score="8" Body="&lt;p&gt;In &lt;a href=&quot;http://www.oracle.com/us/products/applications/crystalball/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Oracle Crystal Ball&lt;/a&gt;, we use an old algorithm, that works pretty well and converges fast. It is from Iman-Conovar. Here is the reference:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Iman, R.L., Conover, W.J. 1982. A distribution-free approach to inducing rank &#xA;correlation among input variables. Commun. Statist.-Simula. Computa. 11, 311-334.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, Prof. Higham's method based on optimization works pretty good as well. He seems to have updated methods that were originally presented by Lurie and Goldberg, &lt;a href=&quot;http://dl.acm.org/citation.cfm?id=288753&quot; rel=&quot;nofollow noreferrer&quot;&gt;available at this link&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1442" LastEditorUserId="1442" LastEditDate="2017-06-05T11:22:26.267" LastActivityDate="2017-06-05T11:22:26.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2097" PostTypeId="2" ParentId="2069" CreationDate="2011-10-04T18:24:05.527" Score="6" Body="&lt;p&gt;Nonlinear optimization algorithms are very susceptible to starting points, so some problems with same structure can become difficult to solve compared to others. A few suggestions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;For a few instances where you are having difficulty in getting answers, try using another solver. You can try Excel, Matlab or R, all of which can be used for fitting.&lt;/li&gt;&#xA;&lt;li&gt;Try adding constraints to bind variables to specific ranges, e.g., -0.5 &amp;lt;= C &amp;lt;= 0.5, 1 &amp;lt;= theta &amp;lt;= 2 etc. You will have to switch to general purpose solvers which can accept constraints. Again, Excel, Matlab and R has those.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I think Excel might be the quickest to set up and test. You can try out a few instances where you know the answers, so that you are sure you are on the right track. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another note: I can't say much for the specific algorithm you are using, but the &lt;a href=&quot;http://en.wikipedia.org/wiki/Levenberg%E2%80%93Marquardt_algorithm&quot;&gt;Levenberg-Marquardt method&lt;/a&gt; is well-known in the fitting community.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps. Good luck.&lt;/p&gt;&#xA;" OwnerUserId="1442" LastActivityDate="2011-10-04T18:24:05.527" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2098" PostTypeId="1" CreationDate="2011-10-04T19:23:49.763" Score="19" ViewCount="1179" Body="&lt;p&gt;I am finishing the implementation of a limit order book for modeling NASDAQ. The order book works off of the ITCH feed. My question is what techniques are typically used for testing order books. I am considering two methods primarily.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Build a canned set of messages to test the functionality and test possible edge cases.&lt;/li&gt;&#xA;&lt;li&gt;Push large amounts of data through it and see if anything breaks.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I am also curious if there are any thoughts on validating the state of the book at any moment in time. I was thinking of using the L1 feed to at least validate that the top of book quotes are the correct prices and sizes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: Please don't suggest things like unit testing. I am specifically interested in techniques specific to order books.&lt;/p&gt;&#xA;" OwnerUserId="373" LastActivityDate="2011-10-04T21:23:03.160" Title="What techniques are used for testing order book implementations?" Tags="&lt;limit-order-book&gt;&lt;testing&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="2100" PostTypeId="2" ParentId="2098" CreationDate="2011-10-04T21:23:03.160" Score="8" Body="&lt;p&gt;Validating tops against the consolidated is a good method. Obviously the time stamps won't match up, but the event stream should. Bear in mind that this won't tell you much about whether you're getting the inner dynamics of the book correct (for example, did the newly inserted order go into the right spot within a given price level). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should build canned test scenarios for the basics of the book. For example, if you're order book reports trades, make sure the trade price is correctly reported by an Order Execute At is received (i.e., the price in the message should be reported, not the price of the resting order).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should also validate your handling of data feed gaps. What happens if you miss a Modify, or a Delete, or an Order Ex. How do you detect this. Sequence numbers can tell you that you missed something, but you don't know what you missed. Inject known errors into your data stream and verify your book manages it properly. Look for crossed/locked markets that result of missed messages and stale order state, inspect by hand and see if you did the right thing.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2011-10-04T21:23:03.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2101" PostTypeId="1" AcceptedAnswerId="2105" CreationDate="2011-10-05T00:30:38.173" Score="6" ViewCount="591" Body="&lt;p&gt;There's various research showing how priors such as the minimum variance portfolio turn out to be a surprisingly effective shrinkage target in portfolio construction. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The sell point of these priors is they do not require a return estimate. Therefore these shrinkage targets add ballast to otherwise noisy return estimates fed into &quot;error-maximizing&quot; optimizers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several candidate priors for shrinkage targets that do not require an expected returns term: i) minimum variance portfolio, ii) minimum risk, iii) equal risk , and iv) equal weight portfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there out-of-sample research on the return-risk performance of these portfolios for S&amp;amp;P 500 or other indices? Perhaps there is another prior that I have not considered.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2011-10-19T17:39:01.473" Title="Choice of prior as a shrinkage target in portfolio construction?" Tags="&lt;risk&gt;&lt;optimization&gt;&lt;risk-models&gt;&lt;variance&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="2102" PostTypeId="2" ParentId="2092" CreationDate="2011-10-05T01:03:05.650" Score="9" Body="&lt;p&gt;High VIX arguably leads to less predictability of the market factor (i.e. market timing), but high volatility does lead to greater predictability of the cross-section of returns. Indeed, linear risk factor models have higher explanatory power during bear markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, your goal is to build a better market timing model where the forecasts (and perhaps confidence levels) adjust to prevailing conditions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would take a look at &lt;a href=&quot;http://en.wikipedia.org/wiki/Linear-quadratic_regulator&quot;&gt;Linear Quadratic Regulators&lt;/a&gt; - also known as state-feedback controllers. Your analogy of &quot;meta-model&quot; matches the idea of &quot;controller&quot; in LQR systems. These LQR systems are best when you have a set of dynamics or differential equations that describe a system. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;These systems are popular in engineering and aerospace applications where you describe the evolution of a system in terms of physical laws such as the heat equation or fluid dynamics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But you can use this in finance if you start with some linear model to predict the market factor and then identify a tool to best estimate the parameters for your model (maximum likelihood, Newton's method, etc.). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A close cousin of LQR are partially observable Markov decision processes (&lt;a href=&quot;http://en.wikipedia.org/wiki/Partially_observable_Markov_decision_process&quot;&gt;POMDPs&lt;/a&gt;) which is also worth exploring. (I am actually exploring these models myself so we will have to trade findings!)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another approach to consider would be a Bayesian approach. When VIX is high, you shrink towards a prior (a cash position, or benchmark). When VIX is low you reduce the range of outcomes. A practical way to make this come together is Meucci's paper on &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1213325&quot;&gt;entropy-pooling&lt;/a&gt;. When you have a forecast in a high VIX state you can assign a high variance to your prediction to reduce your confidence in the estimate. Meucci also has fully commented code for implementing entropy-pooling on his www.symmys.com &lt;a href=&quot;http://www.symmys.com&quot;&gt;website&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that both LQR and POMDPs are special cases of state-space models.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-10-06T01:27:30.937" LastActivityDate="2011-10-06T01:27:30.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2104" PostTypeId="2" ParentId="1605" CreationDate="2011-10-05T14:14:07.553" Score="5" Body="&lt;p&gt;First, note that there are actually quite a few implied volatility curves...I am afraid there is no &quot;&lt;em&gt;the&lt;/em&gt;&quot; volatility curve.  Right off the bat I can think of&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The put and call bid and offer curves&lt;/li&gt;&#xA;&lt;li&gt;The put and call midmarket price curves&lt;/li&gt;&#xA;&lt;li&gt;The put and call midmarket vol curves&lt;/li&gt;&#xA;&lt;li&gt;The out-of-the-money bid, offer, midmarket price and midmarket vol curves&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;so that is 12 different curves right there.  You can probably already tell that getting a single functional form to fit them all is not going to be easy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most common function used is a parabola, though almost always on $\log(K)$ rather than on strike $K$.  The second most common choice is cubic splines, either with nodes at every strike or smoothing.  It is customary in these cases to specify &quot;cutoffs&quot;, which are limiting high and low strikes beyond which volatility is assumed to be constant.  That keeps the curve from going negative, or &quot;too&quot; positive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will occasionally see implementations based on modifications of the terminal probability distribution, such as &lt;a href=&quot;http://en.wikipedia.org/wiki/Edgeworth_series&quot; rel=&quot;nofollow&quot;&gt;Edgeworth expansions&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2011-10-06T16:57:37.097" LastActivityDate="2011-10-06T16:57:37.097" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2105" PostTypeId="2" ParentId="2101" CreationDate="2011-10-05T17:05:17.993" Score="6" Body="&lt;p&gt;I know you're really looking for some empirical work on this topic, but I think the following theoretical paper puts your question into proper perspective.*&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.google.com/url?sa=t&amp;amp;source=web&amp;amp;cd=1&amp;amp;sqi=2&amp;amp;ved=0CB0QFjAA&amp;amp;url=https://www.nb.com/WorkArea/DownloadAsset.aspx?id=8589941826&amp;amp;rct=j&amp;amp;q=risk%20based%20asset%20allocation%20wai%20lee&amp;amp;ei=b4uMTs-tFYSnhAfropWGBA&amp;amp;usg=AFQjCNEB7wqICK5lRHzCHiS42i9chtTSDg&amp;amp;cad=rja&quot; rel=&quot;nofollow&quot;&gt;Risk-Based Asset Allocation: A New Answer to an Old Question by Wai Lee,&lt;/a&gt; &lt;a href=&quot;http://www.iijournals.com/doi/abs/10.3905/jpm.2011.37.4.011&quot; rel=&quot;nofollow&quot;&gt;JPM 2011&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Overall, he finds that supposedly risk-based approaches to portfolio construction are really making implicit assumptions on expected returns, and if their performance is evaluated on a traditional mean-variance basis, then we must closely examine those implicit assumptions.  In other words, to evaluate a risk-based approach using risk-return metrics is fundamentally inconsistent with the use of such approaches to begin with.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;NEW:&lt;/strong&gt; A recent (10/13/2011 publication date) research piece from Deutsche Bank does an in-depth study of three major risk-based approaches to asset allocation:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Minimum variance&lt;/li&gt;&#xA;&lt;li&gt;Risk parity&lt;/li&gt;&#xA;&lt;li&gt;Maximum diversification&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;They find in favor of maximum diversification (see &lt;a href=&quot;http://www.iijournals.com/doi/abs/10.3905/JPM.2008.35.1.40&quot; rel=&quot;nofollow&quot;&gt;Choueifaty and Coignard (2008)&lt;/a&gt;, your list left this one out), which is also the only one of the three robust to the inclusion of redundant assets.  If you are a client, it is called &quot;Risk Parity and  Risk-Based Allocation,&quot; but I could not find it on the public internet.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;* Your question may be an instance of the &lt;a href=&quot;http://weblogs.asp.net/alex_papadimoulis/archive/2005/05/25/408925.aspx&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;Pounding A Nail: Old Shoe or Glass Bottle?&lt;/em&gt;&lt;/a&gt; problem.  The correct answer is that your shrinkage target should be determined by your objective function, and if your objective is mean-variance efficiency, then you shouldn't be shrinking towards a purely risk-based target to begin with.&lt;/sup&gt;&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-10-19T17:39:01.473" LastActivityDate="2011-10-19T17:39:01.473" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2106" PostTypeId="1" CreationDate="2011-10-05T17:51:15.707" Score="5" ViewCount="507" Body="&lt;p&gt;Even companies with just a single non-callable corporate bond outstanding will often have CDS quote spreads that differ from the bond quote spread.  During the 2008 crisis, there were dozens of cases where true arbitrages were available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could argue these arbitrages were due to forced selling of bond inventory (a funding premium), aversion to bond trading (looks like a liquidity premium) or depression of CDS spreads due to counterparty risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I want to risk model what may happen in another crisis, I would like a model of where such liquidity/funding spreads might go again.  To do that, I can look at history, but first I need to separate a price $V$ out into a &quot;true&quot; price $V_T$ plus liquidity and/or funding components $V_L$ and $V_F$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anybody found reasonable definitions and functional forms of these?  If you have, what was the influence of recovery rates on their stability?&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-12-03T21:39:23.840" Title="How to define and measure liquidity or funding premium in credit markets?" Tags="&lt;credit&gt;&lt;liquidity&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2107" PostTypeId="2" ParentId="2076" CreationDate="2011-10-05T19:18:42.667" Score="17" Body="&lt;p&gt;From remote memory,&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The first question is Yes/No question. Is there any stationary, i.e. I(0), time series for different levels of combination r? This question is answered by your first table. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;For example, if [r=2]'s test stat is say 7 while the critical value of 99% confidence is 6.6 like your example, then I have over 99% confidence to say that all instruments A, B, and C are stationary by themselves. You don't even need to build a co-integrated portfolio/combination. They are ready for mean-reversion strategy already. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Obviously, in your example, your [r=2] stat is way much lower than even 90% confidence critical value. Thus, you can't form a stationary time series without sort of combination. Your [r=1] is not close to acceptable threshold, too. Thus, no easy combination like A + Beta*B is stationary. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Now, your [r=0] stat looks interesting, test stat 36.7 &gt; 25.8. I have over 99% confidence to say that there is a stationary combination like A + Beta1*B + Beta2*C. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The next question is how to build your portfolio if one of the above hypothesis is positive. In your case is [r=0]. Simply read your corresponding eigenvector that comes with your largest eigenvalue: (0.25 | 0.512 | -0.79), i.e. 0.25*A + 0.512*B -0.79*C is the stationary portfolio you are looking for. You can draw portfolio time series to convince yourself. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Btw, I will be very grateful if someone can refresh me about how to interpret eigenvalues? like what is its unit? I can only remember big eigenvalue is better for the stationarity test above. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: FYI, I remember the test stat and critical values can be approximated by chi-squared? With this information, you can build a helper function to better interpret these statistic. Here is a quick example in R. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;# zero-root function, used for solve df (degree of freedom) of chi-square for given cvals (critical values)&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;fn_zero_root &amp;lt;- function (df, prob, cval) pchisq(cval, df) - prob&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;# solve for df&lt;br&gt;&#xA;# In [r=1] example: use prob = 90%, cval = 12.29 as the training point&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;r1.df &amp;lt;- uniroot(fn_zero_root, c(0, 12.29), tol = 0.001, prob = 90/100, cval= 12.29)$root&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;# Use the above df to calculate confidence for your test stats = 8.4&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;100*pchisq(8.4, r1.df)&lt;br&gt;&#xA;  [1] 68.23303&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;# Validation&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;pchisq(12.29, r1.df)&lt;br&gt;&#xA;  [1] 89.99978&lt;br&gt;&#xA;  pchisq(14.26, r1.df)&lt;br&gt;&#xA;  [1] 94.82474&lt;br&gt;&#xA;  pchisq(18.52, r1.df)&lt;br&gt;&#xA;  [1] 98.88713  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1478" LastEditorUserId="1478" LastEditDate="2011-10-05T20:16:24.513" LastActivityDate="2011-10-05T20:16:24.513" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2108" PostTypeId="2" ParentId="728" CreationDate="2011-10-05T19:30:19.107" Score="2" Body="&lt;p&gt;For me, the questions are &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;who is using R?  (large companies?)&lt;/li&gt;&#xA;&lt;li&gt;Who is hiring R programmers and does it look like a language of choice in a field (finance, medical, automotive) with a strong future?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I've been developing in C/C++ for almost 17 years now and it has easily kept me gainfully employed.  I started out writing small DOS applications, did a fair amount of CRUD GUI Windows development, and I'm currently in the embedded field doing work on ARM hardware.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For me, I see a very bright future in embedded.  ARM chips are now multi-core and this hardware, in my opinion, is showing up in everything from automobiles to TV sets to medical equipment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recently did an interview for Bloomberg (what a joke) and the whole interview was about testing my knowledge of C++.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know much about R but what I can say, in looking back at my 17 years in this field and in working for some very large companies (Fotune-5) and very small companies that the languages I see the most often are C/C++, J2EE and C# as the top languages.  And under these I see utility type languages in use such as Perl; mostly Perl in fact.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My compass check might be to do a DICE or MONSTER search and see who is looking for R programmers.  &lt;/p&gt;&#xA;" OwnerUserId="1487" LastActivityDate="2011-10-05T19:30:19.107" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2109" PostTypeId="2" ParentId="728" CreationDate="2011-10-05T19:38:30.310" Score="7" Body="&lt;p&gt;If I were starting fresh, I would choose &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;IPython&lt;/li&gt;&#xA;&lt;li&gt;Numpy+Scipy&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://pandas.pydata.org/&quot; rel=&quot;nofollow&quot;&gt;Pandas&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You can get a one-click install from Enthought, &lt;a href=&quot;http://enthought.com/&quot; rel=&quot;nofollow&quot;&gt;http://enthought.com/&lt;/a&gt;. [2015 edit: &lt;a href=&quot;http://docs.continuum.io/anaconda/index&quot; rel=&quot;nofollow&quot;&gt;anaconda&lt;/a&gt; is a better bet these days]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Python is hot on the heels of R as an exploratory data analysis solution for finance, and it's a heck of a lot more fun to write code in (imho:). Plus, python tends to play well with others within a larger software ecosystem.&lt;/p&gt;&#xA;" OwnerUserId="1490" LastEditorUserId="11807" LastEditDate="2015-10-18T03:40:09.633" LastActivityDate="2015-10-18T03:40:09.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2110" PostTypeId="2" ParentId="728" CreationDate="2011-10-05T19:40:44.787" Score="15" Body="&lt;p&gt;As a disclaimer, I'm a noted advocate of using Python to build production systems for quant finance (old talk but: &lt;a href=&quot;http://python.mirocommunity.org/video/1531/pycon-2010-python&quot;&gt;http://python.mirocommunity.org/video/1531/pycon-2010-python&lt;/a&gt;...). I've been very successful at doing it and largely as the result of my example many other quant shops have chosen the Python route to excellent results. The pandas Python library (http://pandas.sourceforge.net) is an open-source outgrowth of my proprietary work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see a another fan of my work has already posted here =)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: why program in C++? I don't think anyone will argue it's an insanely low productivity language relative to Python or R. But Python and R are slow for iterative, procedural code. The near panacea for Pythonistas is to use Cython (http://cython.org) to develop C speed code but take maybe only 1.5-2x longer than writing Python code (to get all the type declarations right etc.). You can also directly call methods in C / C++ libraries using Cython, so it really is the best of both world in my experience.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think in general that hybrid systems are best avoided if at all possible since debugging across &quot;the bridge&quot; is a thorny problem. You typically end up with more code than you planned in the higher-productivity language (e.g. R). I like Python because Python is good at all the things that R is not good at. Yes, Python's statistics libraries are very weak (though we're making progress in &lt;a href=&quot;http://statsmodels.sourceforge.net&quot;&gt;http://statsmodels.sourceforge.net&lt;/a&gt;) compared with CRAN, but in quant finance it turns out that 90% of the modeling and data analysis that you actually do isn't that statistically sophisticated. It's largely a relational data manipulation and time series processing problem (which pandas takes care of in spades-- has much better integrated data alignment features than just about anything in R, too).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Python is also excellent for building GUIs. I've used wxPython and PyQt and found that I could hack together a GUI in an afternoon that would have taken a week or more to do in Java or C++.&lt;/p&gt;&#xA;" OwnerUserId="1491" LastActivityDate="2011-10-05T19:40:44.787" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2111" PostTypeId="2" ParentId="1637" CreationDate="2011-10-05T19:45:16.207" Score="2" Body="&lt;p&gt;When speaking with quants, I call such things &lt;em&gt;Boundary Conditions&lt;/em&gt;.  With traders I tend to use &lt;em&gt;Terms&lt;/em&gt; or &lt;em&gt;Features&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-10-05T19:45:16.207" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2112" PostTypeId="2" ParentId="2092" CreationDate="2011-10-05T21:56:13.087" Score="2" Body="&lt;p&gt;I'd use a Hidden Markov Model.  Develop a statistical model of how the variables behave in different regime and establish transition probabilities between the regimes.  Solve with the Viterbi Algorithm.&lt;/p&gt;&#xA;" OwnerUserId="1496" LastActivityDate="2011-10-05T21:56:13.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2113" PostTypeId="2" ParentId="728" CreationDate="2011-10-05T22:13:04.390" Score="17" Body="&lt;p&gt;I am not an R advocate, but can witness that R is trivially very, very good at data analysis. It is essentially a LISP-like functional language domesticated enough to make you productive in one afternoon. It is unbeatable at getting data in your system, analyzing them, and producing high-quality output, be it latex reports or charts. I have used several languages (from SAS to Python), and none is close to R's productivity when it comes to advanced data analysis. It has an unparalleled suite of packages, with great redundancy: there are 4 packages on Kalman filter, and almost 10 packages on various regularized regression alone. Very often, the packages complement papers that are just being published, thus giving you access to the latest technology. It's not a problem to consume datasets of 100M rows or more, given sufficient memory. Those complaining about memory management in R should try MATLAB.&#xA;Sure, it's slow, but consider this:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Linear algebra is as fast as C++, and interfacing to LAPACK is a&#xA;whole lot easier in R than in C++;&lt;/li&gt;&#xA;&lt;li&gt;there are APIs to specific DBs, key-value stores, and ODBC);&lt;/li&gt;&#xA;&lt;li&gt;many packages are optimized for speed and written in C or Fortran;&lt;/li&gt;&#xA;&lt;li&gt;For 99% of applications it is fast enough;&lt;/li&gt;&#xA;&lt;li&gt;For the remaining 1% use in which you are not bottlenecked by&#xA;computation or data management, you can speed up things in C, C++,&#xA;Fortran, Java.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I would maintain that well-coded R can be faster and more robust than poor C++ code. R can be used in production, although with some care, and not as the main language. It is definitely not suited for doing GUIs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought the plug for Python was a bit off-topic, but I'll say that Python is without doubt among the most versatile and easy languages (I mean it as a compliment), and Cython is a great asset. Still, I believe languages, like people, should be judged based on what they're best at, not on what they're &lt;em&gt;good enough&lt;/em&gt; at. I'd assert that R is best at data analysis, and that its syntax is slighly better than Python for this purpose. It'll be a while until Python has the domain-specific packages and visualization packages of R, and most importantly the people behind them. But I'll agree on one very important point: most quant hedge funds do relatively elementary data analysis, and Python+Numpy+Pandas is a sensible choice as single language.&lt;/p&gt;&#xA;" OwnerUserId="194" LastActivityDate="2011-10-05T22:13:04.390" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2114" PostTypeId="2" ParentId="728" CreationDate="2011-10-06T01:25:55.807" Score="12" Body="&lt;p&gt;The greatest weakness and greatest strength of R is that it is not a strongly typed language. Therefore easy tasks in strongly typed languages such as re-factoring, auto-compiler checks, unit testing, etc. can be more difficult in R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, one can rapidly prototype in the R language. R is an interpreted language -- it will dynamically convert types. R is also an excellent tool for visualization and analysis (GGplot2 library). There is also a wonderful community of R developers that are creating new solutions for problems all the time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://www.burns-stat.com/pages/Tutor/R_inferno.pdf&quot;&gt;R Inferno&lt;/a&gt; is an essential read before you develop production code with R.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-10-15T00:07:48.203" LastActivityDate="2011-10-15T00:07:48.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2115" PostTypeId="1" AcceptedAnswerId="2119" CreationDate="2011-10-06T06:54:49.137" Score="9" ViewCount="837" Body="&lt;p&gt;I am backtesting an equity trading strategy which trades only once per day.  Is there a general rule of thumb for the reasonable upper bound on the rate of return of such a strategy?  For example, a 2000% return over a week might be unrealistic, but a 20% return is possible.  Identifying a reasonable limit may help me identify faulty strategies.&lt;/p&gt;&#xA;" OwnerUserId="1204" LastEditorUserId="1106" LastEditDate="2011-10-06T13:55:24.953" LastActivityDate="2011-10-06T14:08:06.170" Title="What is a reasonable upper bound on the performance of a daily trading strategy?" Tags="&lt;quant-trading-strategies&gt;&lt;equities&gt;&lt;trading-systems&gt;&lt;returns&gt;" AnswerCount="2" CommentCount="7" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2116" PostTypeId="1" AcceptedAnswerId="2120" CreationDate="2011-10-06T09:54:49.427" Score="8" ViewCount="355" Body="&lt;p&gt;I need to calculate the put-call ratio for an American option. But I'm a complete naïf: I don't know how. I &lt;em&gt;think&lt;/em&gt; I'd use the put open interest and the call open interest. I can imagine two ways to calculate PCR:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Simply (as some references tell me) take OI&lt;sub&gt;puts&lt;/sub&gt; divided by OI&lt;sub&gt;calls&lt;/sub&gt; and there's my number, right there:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PCR = OI&lt;sub&gt;puts&lt;/sub&gt; / OI&lt;sub&gt;calls&lt;/sub&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Or (as other sources seem to suggest) take OI&lt;sub&gt;puts&lt;/sub&gt; divided by the sum of OI&lt;sub&gt;puts&lt;/sub&gt; and OI&lt;sub&gt;calls&lt;/sub&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PCR =  OI&lt;sub&gt;puts&lt;/sub&gt; / (  OI&lt;sub&gt;puts&lt;/sub&gt; + OI&lt;sub&gt;calls&lt;/sub&gt; ) &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Further, I don't even know if the ratio can most usefully be expressed as a decimal (i.e.,  0.667) or as a fraction (i.e.,  2/3) or as the ratio notation I learned in grammar school (i.e., 2:3).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the usual, expected, and/or &quot;right&quot; way to calculate PCR?&lt;/p&gt;&#xA;" OwnerUserId="618" LastEditorUserId="1106" LastEditDate="2011-10-06T14:11:41.983" LastActivityDate="2011-10-06T14:19:55.673" Title="What do we really mean by put-call ratio and how should it be expressed?" Tags="&lt;options&gt;&lt;indicator&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2117" PostTypeId="2" ParentId="2116" CreationDate="2011-10-06T11:33:38.407" Score="2" Body="&lt;p&gt;&lt;a href=&quot;http://www.cboe.com/data/putcallratio.aspx&quot; rel=&quot;nofollow&quot;&gt;CBOE defines&lt;/a&gt; Put Call ratio as PCR = OIputs / OIcalls and I have always seen it defined this way.&#xA;You should express it in a decimal way, a fraction doesn't really make sense here if you have 9999 in OIcall and 9998 in OIput for instance.&lt;/p&gt;&#xA;" OwnerUserId="1181" LastActivityDate="2011-10-06T11:33:38.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2118" PostTypeId="2" ParentId="2115" CreationDate="2011-10-06T13:19:01.987" Score="2" Body="&lt;p&gt;Quite simply, no, you can't bound returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming you can invest in several assets, and that you can short-sell, you could quite easily make a huge return by simply getting (maybe even just by pure luck) the right directions on an especially volatile way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can't bound complex strategies daily return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you consider buying only a single asset, the is no bound either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you might be willing to do is to look at the distribution of past return, and take some quantile (99% for example) which would give you your limit, or basically some kind of confidence interval (and it would basically correspond to the VaR for losses). But this would be wrong anyway in my opinion, since you basically assume that all the data available right now fully characterizes the distributions of future returns, which has been proved wrong every time there has been a major crisis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keep in mind, seeing one billion white swans is not enough to prove that all swans are white, whereas seeing only one black swan is sufficient to prove that all of them aren't white.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But my main concern is: why on earth would you discard a strategy because it makes large returns or losses? I mean, how could your strategy be &quot;faulty&quot;???? Are you trying to detect fraud?&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2011-10-06T13:19:01.987" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2119" PostTypeId="2" ParentId="2115" CreationDate="2011-10-06T14:08:06.170" Score="7" Body="&lt;p&gt;I believe the concept you are looking for without really knowing it is the information coefficient (IC).  IC is the correlation between your forecast and actual subsequent returns.  If your IC is 1 (perfect correlation, also known in this context as perfect foresight), then your maximum return is the compounded sum of the greatest daily return of any stock in your universe (or of the difference between the greatest and lowest return, in case of a long-short strategy).  For a lower IC, you can simulate what returns are realistic by artificially constructing a signal starting with realized returns and adding noise to get the desired IC.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A separate question is what is a realistic IC.  I'm not sure, but I doubt any strategies can achieve higher than 0.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more details, see &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0070248826&quot;&gt;Active Portfolio Management by Grinold and Kahn&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-10-06T14:08:06.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2120" PostTypeId="2" ParentId="2116" CreationDate="2011-10-06T14:19:55.673" Score="4" Body="&lt;p&gt;There is, unfortunately, no broad agreement on this point.  In fact, put-call ratios may be constructed from volume as well as open interest, and they can even be constructed from certain subsets of the options chain (e.g., only certain strikes or tenors). I have usually used your option #2, because option #1 has a tendency to be extremely high or even undefined whenever call open interest is very low.  This nonlinearity is an undesirable feature for any indicator going into a trading model.  Most academic studies, such as &lt;a href=&quot;http://www.mit.edu/~junpan/volume.pdf&quot; rel=&quot;nofollow&quot;&gt;Pan and Poteshman (2006)&lt;/a&gt;, use this version as well.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-10-06T14:19:55.673" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2121" PostTypeId="1" CreationDate="2011-10-06T14:28:51.853" Score="10" ViewCount="1542" Body="&lt;p&gt;Where can I get data on performance metrics for volatility arbitrage funds? I am trying to compare the Sharpe ratio of my strategy to those of the major players.&lt;/p&gt;&#xA;" OwnerUserId="1501" LastEditorUserId="1106" LastEditDate="2011-10-06T16:21:47.237" LastActivityDate="2011-10-06T16:21:47.237" Title="What is the average Sharpe ratio of volatility arbitrage funds?" Tags="&lt;quant-trading-strategies&gt;&lt;arbitrage&gt;&lt;option-strategies&gt;&lt;performance&gt;&lt;sharpe-ratio&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2122" PostTypeId="2" ParentId="1605" CreationDate="2011-10-06T15:46:02.790" Score="4" Body="&lt;p&gt;Look at &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0471792519&quot; rel=&quot;nofollow&quot;&gt;The Volatility Surface by Jim Gatheral&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1502" LastEditorUserId="1106" LastEditDate="2011-10-06T16:16:36.993" LastActivityDate="2011-10-06T16:16:36.993" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2123" PostTypeId="2" ParentId="2121" CreationDate="2011-10-06T16:16:15.933" Score="8" Body="&lt;p&gt;This depends a little bit on your definition of volatility arbitrage but in general what is meant is a strategy that takes advantage of the difference between implied volatility and realized volatility. Normally you receive implied variance and pay realized variance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This strategy is the classical example of &lt;em&gt;picking up nickles in front of a steamroller&lt;/em&gt; because it generates quite high Sharp ratios over extended periods of time until it crashes and when not managed right even blows up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So just to give you some benchmarks you should search for &quot;Volatility Arbitrage Index&quot; (e.g. &lt;a href=&quot;https://www2.standardandpoors.com/spf/pdf/index/SP_500_Volatility_Arbitrage_Index_Factsheet.pdf&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;https://index.db.com/dbiqweb2/index/usvolharvesttr&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt; - with Sharpe ratios included) and there are even some investable products out there (e.g. &lt;a href=&quot;http://zertifikate.finanztreff.de/dvt_einzelkurs_uebersicht,i,1541467,seite,zertifikate.html&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt; - Sharp ratios included too).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it very much depends on the time range what Sharp ratio you will get - the following chart makes it clear what I mean (Source: &lt;a href=&quot;http://www.cboe.com/micro/vty/&quot; rel=&quot;noreferrer&quot;&gt;http://www.cboe.com/micro/vty/&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/yeFJY.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-10-06T16:16:15.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2124" PostTypeId="2" ParentId="2059" CreationDate="2011-10-06T16:46:38.340" Score="3" Body="&lt;p&gt;all of the volatility effects on a binary option struck at 105 with a one dollar  payoff &#xA;are approximately  the same as the volatility effects on the following portfolio of options:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;short 100 of the  104.99 calls / &#xA;long 200 of the    105 calls / &#xA;short 100 of the   105.01 calls&lt;/p&gt;&#xA;" OwnerUserId="1502" LastActivityDate="2011-10-06T16:46:38.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2125" PostTypeId="2" ParentId="747" CreationDate="2011-10-06T17:04:17.837" Score="5" Body="&lt;p&gt;This question has been answered at dsp.SE: &lt;a href=&quot;https://dsp.stackexchange.com/questions/208/what-should-be-considered-when-selecting-a-windowing-function-when-smoothing-a-ti&quot;&gt;Here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(P.S.: I don't know why the forum software converted babelproofreader's answer into a comment?!? Now it seems to have worked...)&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="-1" LastEditDate="2017-04-13T12:47:30.067" LastActivityDate="2011-10-06T17:04:17.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2126" PostTypeId="1" CreationDate="2011-10-06T20:06:35.750" Score="9" ViewCount="3306" Body="&lt;p&gt;I have a question considering Financial markets in discrete Time.&lt;/p&gt;&#xA;&lt;p&gt;One of the main theorems in discrete time is the following.&#xA;In finite discrete Time with trading times t={1,...,T} the following are equivalent:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The market &lt;span class=&quot;math-container&quot;&gt;$(S,\mathbb{F})$&lt;/span&gt; is complete, i.e every &lt;span class=&quot;math-container&quot;&gt;$F_T$&lt;/span&gt;-measurable random variable &lt;span class=&quot;math-container&quot;&gt;$U$&lt;/span&gt; is replicable&lt;br /&gt;&#xA;and&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;There is exactly one equivalent martingale measure.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Now I seem to come to a contradiction if I define the following framework (shortly: Black Scholes in discrete time):&lt;/p&gt;&#xA;&lt;p&gt;Let's assume we are in the Black-Scholes framework but we consider the model as discrete time model with (simplifying heavily) two trading dates &lt;span class=&quot;math-container&quot;&gt;$t=0$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$t=1$&lt;/span&gt;. The (discounted) stock price is denoted by &lt;span class=&quot;math-container&quot;&gt;$S_t$&lt;/span&gt;. &lt;span class=&quot;math-container&quot;&gt;$S_0$&lt;/span&gt; is constant and for &lt;span class=&quot;math-container&quot;&gt;$T=1$&lt;/span&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$$S_T=\exp((\mu-r-1/2\sigma^2)T-\sigma W_t).$$&lt;/span&gt; The Filtration &lt;span class=&quot;math-container&quot;&gt;$\mathbb{F}=(F_t)_{t=0,1}$&lt;/span&gt; is the natural one.&lt;/p&gt;&#xA;&lt;p&gt;It is clear that in this framework there is exactly one equivalent martingale measure, namely the one in which &lt;span class=&quot;math-container&quot;&gt;$\mu=r$&lt;/span&gt;. Applying the theorem from above, a call-option on that stock S should be replicable (in only one trading day, namely from &lt;span class=&quot;math-container&quot;&gt;$t=0$&lt;/span&gt; to &lt;span class=&quot;math-container&quot;&gt;$T=1$&lt;/span&gt;)&lt;/p&gt;&#xA;&lt;p&gt;Now this seems to me very doubtful and I don't really know where the Problem is.... ANY HELP IS WELCOME!!!!&lt;/p&gt;&#xA;" OwnerUserId="1503" LastEditorUserId="43227" LastEditDate="2020-12-02T14:19:42.787" LastActivityDate="2020-12-02T14:19:42.787" Title="Why doesn't Black-Scholes work in discrete time?" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;theory&gt;&lt;random-variables&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="2127" PostTypeId="2" ParentId="1895" CreationDate="2011-10-06T23:01:28.997" Score="3" Body="&lt;p&gt;&lt;a href=&quot;http://ssrn.com/abstract=1806137&quot; rel=&quot;nofollow&quot;&gt;Investing in Stock Market Anomalies&lt;/a&gt; by Bali, Brown, and Demirtas (2011) addresses some of my questions.  I will read this paper and report back on my findings.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-10-06T23:01:28.997" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2128" PostTypeId="1" CreationDate="2011-10-07T00:27:19.173" Score="3" ViewCount="1132" Body="&lt;p&gt;I'm reading a book titled &quot;A Trader's Money Management System&quot; and it discusses risk of ruin(ROR) tables. It says that you can have a zero probability of ROR with a payoff ratio of 2 to 1 and a win rate of 60%.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;My understanding is that the concept of ROR originated in gambling, but is it applicable to trading and more importantly, does it work in real world trading?&lt;/li&gt;&#xA;&lt;li&gt;The book says a zero percent probability of ROR means that ruin is extremely unlikely, but not impossible. Doesn't that go against the definition of a zero percent probability?&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How do you calculate ROR? The book only includes a sample table. I googled it and this came up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;((1 - Edge)/(1 + Edge)) ^ Capital_Units&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do you fit the payoff ratio and the win rate into the edge?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1504" LastActivityDate="2011-10-07T00:27:19.173" Title="How to Calculate Risk of Ruin" Tags="&lt;risk&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="2" ClosedDate="2011-10-07T12:40:37.350" ContentLicense="CC BY-SA 3.0" />
  <row Id="2129" PostTypeId="1" AcceptedAnswerId="2130" CreationDate="2011-10-07T00:56:15.470" Score="18" ViewCount="3638" Body="&lt;p&gt;I'm trying to find an optimal way to allocate capital among trading strategies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470284889&quot;&gt;&quot;Quantitative Trading&quot;&lt;/a&gt; by Ernie Chan claims on page 97 that the optimal fraction of capital to allocate to a given trading strategy can be calculated by the following formula.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;f = &amp;mu;/&amp;sigma;&lt;sup&gt;2&lt;/sup&gt;, where &amp;mu; is the mean and&#xA;  &amp;sigma;&lt;sup&gt;2&lt;/sup&gt; is the variance of the return of the trading&#xA;  strategy.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This assumes that the trading strategies are statistically independent and their returns have a normal distribution.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The formula looks deceptively simple. Does it actually work?&lt;/li&gt;&#xA;&lt;li&gt;Do professionals use it at all?&lt;/li&gt;&#xA;&lt;li&gt;The author calls this the Kelly formula. Is this correct? I thought the Kelly formula was $\frac{p(b + 1) - 1}b$?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1504" LastEditorUserId="1106" LastEditDate="2011-10-07T14:15:50.877" LastActivityDate="2014-09-16T09:17:13.577" Title="How to optimally allocate capital among trading strategies?" Tags="&lt;quant-trading-strategies&gt;&lt;position-sizing&gt;&lt;kelly-criterion&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="2130" PostTypeId="2" ParentId="2129" CreationDate="2011-10-07T01:13:28.210" Score="19" Body="&lt;p&gt;To respond to your questions in order:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The formula looks deceptively simple. Does it actually work?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;That depends on what you mean by &quot;work&quot;.  Chan spends the rest of the chapter discussing the pitfalls of investing at &quot;full Kelly&quot;.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Do professionals use it at all?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Professionals may maximize geometric growth, but I don't know anyone who does so with such a simple and unconstrained objective function.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The author calls this the Kelly formula. Is this correct? I thought the Kelly formula was (p(b + 1) - 1)/b?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The Kelly formula you cite is based on discrete events with known probabilities and outcomes.  As Chan says several times in that chapter, the formula from his book is an approximation of the Kelly formula for continuous outcomes.&lt;/p&gt;&#xA;" OwnerUserId="56" LastActivityDate="2011-10-07T01:13:28.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2131" PostTypeId="2" ParentId="2129" CreationDate="2011-10-07T08:13:47.183" Score="14" Body="&lt;p&gt;First of all a very warm welcome to &lt;em&gt;Quantitative Finance Stack Exchange&lt;/em&gt; :-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Concerning your question there are some basic points that seem to be unclear. In general &quot;Quantitative Trading&quot; by Ernie Chan is a good starting point for learning about quantitative trading strategies. The problem is of course that in this small book there are many concepts whose interrelation may not always be completely clear.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think it is always helpful to separate a trading system into three general levels:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Forecast&lt;/li&gt;&#xA;&lt;li&gt;Trading Rule&lt;/li&gt;&#xA;&lt;li&gt;Risk management&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Concerning the first point: You must have some idea about the market. If you thought everything was efficient you would not trade (even &quot;buy-and-hold&quot; reveals some forecast, be it the exact asset allocation, be it that you believe in a rising market in the long run).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Concerning the second point: When you think that you found some structure in the market the question is how to exploit it. The latter does not necessarily follow from the former (I won't go deeper into this matter here).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When talking about the &quot;Kelly rule&quot; this is normally referring to the third point, so it is about position or money management. But you must first have some edge (forecast) to use it! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To understand some of the intricacies of the Kelly formula I would recommend another excellent book (which is a real pageturner by the way):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://books.google.de/books?id=xz4y3u-qM04C&amp;amp;dq=fortune%27s%20formula%20poundstone&amp;amp;hl=de&amp;amp;ei=sLKOTpmqCcXh4QSUu-mgAQ&amp;amp;sa=X&amp;amp;oi=book_result&amp;amp;ct=result&amp;amp;resnum=1&amp;amp;ved=0CC0Q6AEwAA&quot;&gt;Fortune's Formula: The Untold Story of the Scientific Betting System That Beat the Casinos and Wall Street by William Poundstone&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2011-10-07T09:33:27.117" LastActivityDate="2011-10-07T09:33:27.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2132" PostTypeId="1" CreationDate="2011-10-07T09:35:31.247" Score="3" ViewCount="2150" Body="&lt;p&gt;I am a programmer and I have no finance background. I am looking for advice as to how to get started in the quant finance industry. My goal would be to have solid understanding about the industry and be able to program something interesting, side project projects. But so far I have no idea how to get started.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far I think I need to know:&#xA;math (Statistics in particular), finance (can someone elaborate? share market? economics? options? or are all these just the implementation of the finance theory?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also what are the different areas in quant finance. In computing there are say, web, desktop, windows based, linux based, database, business analyst, user interface, designer etc etc.&lt;/p&gt;&#xA;" OwnerUserId="1505" LastEditorUserId="467" LastEditDate="2011-10-07T09:56:49.800" LastActivityDate="2011-10-07T10:05:54.827" Title="How to get started in quant finance?" Tags="&lt;finance&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="3" ClosedDate="2011-10-07T12:29:19.700" ContentLicense="CC BY-SA 3.0" />
  <row Id="2133" PostTypeId="2" ParentId="2132" CreationDate="2011-10-07T10:05:54.827" Score="3" Body="&lt;p&gt;Well I guess as pure programmer, you could be looking to &quot;evolve&quot; to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;An algorithmic trader&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is in a nutshell a programmer designing algorithms which automatically trade in the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or a &lt;em&gt;Quantitative developper&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A &lt;em&gt;quant&lt;/em&gt; is basically a person with strong quantitative background looking, for example, to find models to apply to the financial markets. Such people sometimes want to have people implementing the models for them (sometimes they do it themselves).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think it will be very difficult to become an algo trader &quot;out of the box&quot;. You will first have to get into a financial institution (maybe as a quant developper) and find your way up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reading all the books will take ages if you do it as a side project, I would try either to get a master degree in financial engineering, or to look into programs such as the &lt;a href=&quot;http://www.cqf.com/&quot; rel=&quot;nofollow&quot;&gt;CQF&lt;/a&gt; &#xA;or the &lt;a href=&quot;https://www.cfainstitute.org/pages/index.aspx&quot; rel=&quot;nofollow&quot;&gt;CFA&lt;/a&gt;, the former being more focused on quantitative finance.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2011-10-07T10:05:54.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2135" PostTypeId="1" AcceptedAnswerId="2174" CreationDate="2011-10-07T15:55:23.920" Score="18" ViewCount="1813" Body="&lt;p&gt;I'm wading through the vast sea of literature on realized volatility estimation and expected volatility forecasting (see, e.g. &lt;a href=&quot;http://ssrn.com/abstract=1092203&quot; rel=&quot;nofollow noreferrer&quot;&gt;Realized Volatility&lt;/a&gt; by Andersen and Benzoni, which cites 120 other papers, and &lt;a href=&quot;http://faculty.chicagobooth.edu/federico.bandi/research/br_handbook.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Volatility&lt;/a&gt; by Bandi and Russell, which cites a slightly overlapping set of 120 papers).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm having a tough time finding research that specifically addresses the simultaneous estimation of a broad cross-section of equity volatility from high-frequency returns time-series.  I'm looking for something along the lines of &lt;a href=&quot;http://en.wikipedia.org/wiki/Vector_autoregression&quot; rel=&quot;nofollow noreferrer&quot;&gt;Vector Autoregression (VAR)&lt;/a&gt;, but applying both sophisticated techniques developed for large equity panel estimation (thousands of volatilities and potentially millions of correlations being estimated) and using recent advances developed for &lt;a href=&quot;https://quant.stackexchange.com/questions/751/how-to-forecast-volatility-using-high-frequency-data&quot;&gt;efficient estimation using high frequency data&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What papers address the specific problem of forecasting the cross-section of equity volatility from high frequency data?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2011-10-17T15:54:34.607" Title="How to forecast expected volatility from high-frequency equity panel data?" Tags="&lt;volatility&gt;&lt;time-series&gt;&lt;equities&gt;&lt;research&gt;&lt;forecasting&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="2136" PostTypeId="2" ParentId="2126" CreationDate="2011-10-07T17:21:13.153" Score="6" Body="&lt;p&gt;A discrete-time model only works in no-arbitrage land with discrete asset values.  Furthermore, the number of allowable asset values per timestep is limited by the number of available securities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The tree is the classic example of this.  Binomial trees &quot;work&quot;, but if you make a one-step trinomial tree, you will find that you can no longer form a risk-free portfolio from an option and its underlying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Of course, as a way of numerically solving the PDE, trinomial trees are still fine.)&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2011-10-11T14:30:09.703" LastActivityDate="2011-10-11T14:30:09.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2137" PostTypeId="1" CreationDate="2011-10-09T22:57:03.877" Score="11" ViewCount="1796" Body="&lt;p&gt;I have to implement option pricing in c++ using Markov chain Monte Carlo. Is there some paper which describes this in detail so that I can learn from there and implement?&lt;/p&gt;&#xA;" OwnerUserId="1511" LastEditorUserId="1106" LastEditDate="2011-10-10T13:41:10.127" LastActivityDate="2011-10-11T12:58:07.153" Title="Reference on Markov chain Monte Carlo method for option pricing?" Tags="&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;programming&gt;&lt;numerical-methods&gt;&lt;reference-request&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2138" PostTypeId="1" CreationDate="2011-10-10T17:28:42.957" Score="35" ViewCount="2942" Body="&lt;p&gt;I'm building an algorithmic trading business. I'd be grateful for informed comments and opinions on my trading strategy search methodology.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Goal&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Develop (profitable!) fully automated intra-day trading strategies. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Markets&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm focusing on FX futures and equity index futures on CME and LIFFE. Becuase:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I know these markets best&lt;/li&gt;&#xA;&lt;li&gt;I can get roundtrip times of 10s ms&lt;/li&gt;&#xA;&lt;li&gt;Futures margin means big leverage for my small account&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Data&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm buying in Level 1 tickdata from the exchanges. I don't think level 2 data would add anything because I wont have low enough latency to make use of it. A typical contract might have 1M data points per day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Search Strategy&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a bias towards machine learning specifically SVM/R. My plan goes like this&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Choose an instrument and forecast horizon (5-120 seconds)&lt;/li&gt;&#xA;&lt;li&gt;Assembly a large stable of features e.g.&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Resampled lagged time series and returns&lt;/li&gt;&#xA;&lt;li&gt;Wavelet transform of the above&lt;/li&gt;&#xA;&lt;li&gt;Measures of &lt;a href=&quot;http://www.unifr.ch/econophysics/papers/201011/7080368565.pdf&quot;&gt;information entropy&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Some indicators from &lt;a href=&quot;http://ssrn.com/abstract=208278&quot;&gt;Operators on Inhomogeneous Time Series&lt;/a&gt; (This is 11 years old now but I've yet to see anything that meaningfully expands on it)&lt;/li&gt;&#xA;&lt;li&gt;If can hold down the vomit some 'Traditional Technical Analysis' indicators&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Choose a subset of features with genetic search. The objective function is the MSE of the n-fold SVM cross validation&lt;/li&gt;&#xA;&lt;li&gt;Build the final SVM with the best parameter selection.&lt;/li&gt;&#xA;&lt;li&gt;Hope that the highest confidence predictions form the basis of a profitable trading strategy&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In your experience do you think a strategy developed like this can hope to make money on liquid equity index and FX futures? If not why not?&lt;/p&gt;&#xA;" OwnerUserId="1513" LastEditorUserId="1513" LastEditDate="2011-10-10T18:05:56.797" LastActivityDate="2011-10-12T14:17:27.373" Title="Is my trading strategy search methodology sound?" Tags="&lt;trading&gt;&lt;automated-trading&gt;&lt;machine-learning&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="28" ContentLicense="CC BY-SA 3.0" />
  <row Id="2139" PostTypeId="2" ParentId="2137" CreationDate="2011-10-10T21:01:58.573" Score="8" Body="&lt;p&gt;I believe this is a nice paper for you to start with. Check out what references it cited and who cited it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://wwwdocs.fce.unsw.edu.au/fce/Research/NHCPapers2007/BFIN7_Pollard.pdf&quot; rel=&quot;nofollow&quot;&gt;Markov Chain Monte Carlo Analysis of Option Pricing Models&lt;/a&gt;&lt;br&gt;&#xA;&quot;Use the Markov Chain Monte Carlo (MCMC) method to investigate a large&#xA;class of continuous-time option pricing models. These include: constant-volatility,&#xA;stochastic volatility, price jump-diﬀusions and volatility jump-diﬀusions. We propose a new&#xA;Bayesian method for estimation and model selection, the “Mixture Model MCMC”&#xA;algorithm.&quot;&lt;/p&gt;&#xA;" OwnerUserId="1516" LastActivityDate="2011-10-10T21:01:58.573" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2140" PostTypeId="2" ParentId="2137" CreationDate="2011-10-11T01:31:38.540" Score="6" Body="&lt;p&gt;Check this document out: &lt;a href=&quot;http://darwin.eeb.uconn.edu/mcmc++/latex/refman.pdf&quot; rel=&quot;nofollow&quot;&gt;link to pdf file&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, if you are concerned with actual performance of your code and want to implement efficient code then gsl libraries would be the first place look at: &lt;a href=&quot;http://www.gnu.org/software/gsl/manual/gsl-ref.html&quot; rel=&quot;nofollow&quot;&gt;link&lt;/a&gt;. It's got everything you need.&lt;/p&gt;&#xA;" OwnerUserId="428" LastActivityDate="2011-10-11T01:31:38.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2142" PostTypeId="2" ParentId="2137" CreationDate="2011-10-11T12:58:07.153" Score="4" Body="&lt;p&gt;Here are a few more papers about MCMC and alike methods for derivative pricing and co. :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Blanchet-Scalliet, Patras - Counterparty risk valuation for CDS&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Jasra, Del Moral - Sequential Monte Carlo Methods for Option Pricing&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Frey, Schmidt - Filtering and Incomplete Information in Credit Risk&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Peters, Briers, Shevchenko, Doucet - Calibration and Filtering for Multi Factor Commodity Models with Seasonality, Incorporating Panel Data from Futures Contracts&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rambharat, Brockwell - SMC Pricing of American-style Options under Stochastic Volatility Models&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most of those papers are available online (mostly on Arxiv)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards&lt;/p&gt;&#xA;" OwnerUserId="92" LastActivityDate="2011-10-11T12:58:07.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2143" PostTypeId="1" AcceptedAnswerId="2145" CreationDate="2011-10-11T16:50:26.433" Score="6" ViewCount="266" Body="&lt;p&gt;Sell-side analysts' earnings estimates for individual companies, typically reported by &lt;a href=&quot;http://thomsonreuters.com/products_services/financial/financial_products/a-z/ibes/&quot; rel=&quot;noreferrer&quot;&gt;I/B/E/S&lt;/a&gt;, are a key ingredient to many quantitative models.  However, revisions to analyst estimates tend to lag changes in market expectations.  Basing a model's recommendation on these estimates, particularly for valuation, can often lead to certain stocks seeming very cheap only because the stock price has declined dramatically and analyst estimates have not yet had a chance to catch up.  Likewise, for market timing, the entire market can seem cheap immediately after a crash ahead of a predicted recession.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How should one deal with the lag when constructing valuation indicators?  Should you attempt to correct for the lag by attempting to predict the coming changes in earnings estimates?  If so, how should you do this prediction?  Is there any available research on analyst earnings revisions?&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-10-13T02:02:08.687" Title="How do earnings estimates respond to changes in underlying fundamentals and economic conditions?" Tags="&lt;equities&gt;&lt;research&gt;&lt;reference-request&gt;&lt;valuation&gt;&lt;tactical-asset-allocation&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2144" PostTypeId="2" ParentId="2046" CreationDate="2011-10-11T16:56:06.963" Score="18" Body="&lt;p&gt;Stanford University has a &lt;a href=&quot;http://www.ml-class.org/course/auth/index&quot;&gt;free online course&lt;/a&gt; in machine learning with video lectures, problem sets, and even a promise of online help with coursework from Stanford faculty.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This course provides a broad introduction to machine learning, datamining, and statistical pattern recognition. Topics include: (i) Supervised learning (parametric/non-parametric algorithms, support vector machines, kernels, neural networks). (ii) Unsupervised learning (clustering, dimensionality reduction, recommender systems, deep learning). (iii) Best practices in machine learning (bias/variance theory; innovation process in machine learning and AI). (iv) Reinforcement learning. The course will also draw from numerous case studies and applications, so that you'll also learn how to apply learning algorithms to building smart robots (perception, control), text understanding (web search, anti-spam), computer vision, medical informatics, audio, database mining, and other areas. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It does not appear as of yet that trading is one of the applications they intend to cover, but you never know...&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-10-11T16:56:06.963" CommentCount="4" CommunityOwnedDate="2014-07-23T16:34:06.740" ContentLicense="CC BY-SA 3.0" />
  <row Id="2145" PostTypeId="2" ParentId="2143" CreationDate="2011-10-11T18:59:44.857" Score="5" Body="&lt;p&gt;I wouldn't put too much faith in IBES forecasts.   You may remember this situation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=889322&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=889322&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(In case the above link doesn't work, Google &quot;Rewriting History Alexander Ljungqvist&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll find lots of excuses for worthless forecasts:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.princeton.edu/~hhong/rje-analyst.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.princeton.edu/~hhong/rje-analyst.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is a graph that I saved from some study.  As I recall, their point was that analyst forecasts are typically nothing more than slightly modified naive forecasts (i.e. next year's earnings will be about the same as this year's earnings....and this was for analyst forecasts of S&amp;amp;P500 earnings).   I'll post a reference if I can find it again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/gN5Q6.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The bottom line is, you're better off if you ignore analysts.   From your own models you'll find that forecasting earnings for individual companies is a crap shoot.  And, by far, the easiest earnings sequence to forecast is for the S&amp;amp;P500.   However, that's by no means easy.   Structural shifts happen without warning and model inputs that were useful for decades can easily drift into bizarre territory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as your questions go, if you have evidence that some analyst's earnings forecasts have influence on a stock/index, your model would probably be more about the analyst than actual earnings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit 1 (10/11/2011) ===================================================&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additional information on IBES earnings data:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.olin.wustl.edu/docs/Faculty/Larocque%20paper.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.olin.wustl.edu/docs/Faculty/Larocque%20paper.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Analyst earnings expectations:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rady.ucsd.edu/faculty/directory/timmermann/docs/three_states_24May_2009_final.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://rady.ucsd.edu/faculty/directory/timmermann/docs/three_states_24May_2009_final.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://business.rice.edu/uploadedFiles/Faculty_and_Research/Academic_Areas/Accounting/papers/yeung_january_2011.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://business.rice.edu/uploadedFiles/Faculty_and_Research/Academic_Areas/Accounting/papers/yeung_january_2011.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.stanford.edu/group/knowledgebase/cgi-bin/2011/08/15/when-they-are-wrong-analysts-may-dig-in-their-heels/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.stanford.edu/group/knowledgebase/cgi-bin/2011/08/15/when-they-are-wrong-analysts-may-dig-in-their-heels/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.business.uconn.edu/Realestate/publications/pdf%20documents/407%20Do%20Investors%20See%20Through%20Mistakes%20in%20Reported%20Earnings.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.business.uconn.edu/Realestate/publications/pdf%20documents/407%20Do%20Investors%20See%20Through%20Mistakes%20in%20Reported%20Earnings.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="392" LastEditorUserId="392" LastEditDate="2011-10-11T23:34:43.080" LastActivityDate="2011-10-11T23:34:43.080" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2148" PostTypeId="1" AcceptedAnswerId="2154" CreationDate="2011-10-12T13:14:43.933" Score="18" ViewCount="2592" Body="&lt;p&gt;Suppose I have two asset time series, $X_t$ and $Y_t$, and I'm estimating their correlation from historical data. I'd like to apply some systematic criterion to estimate what time window I should use to estimate the correlation reliably, and also to spot &quot;regime changes&quot; (when the correlation jumps suddenly) after which I should discard old data completely (as opposed to rolling the window in a continuous manner). Can you recommend some approaches which have a decent theoretical background?&lt;/p&gt;&#xA;" OwnerUserId="89" LastEditorUserId="1106" LastEditDate="2011-10-17T15:31:18.570" LastActivityDate="2013-01-16T08:01:54.117" Title="How to detect regime change when estimating asset correlation from historical time series?" Tags="&lt;time-series&gt;&lt;correlation&gt;&lt;estimation&gt;&lt;market-regimes&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="2149" PostTypeId="2" ParentId="2138" CreationDate="2011-10-12T14:17:27.373" Score="19" Body="&lt;p&gt;This is a very interesting question.  I believe it is getting a lot of up-votes from people who have wondered the same thing and don't know where to begin, whereas you have at least laid out a reasonable-sounding plan.  I commend you for that.  However, it is not clear to me what you're trying to learn by posting this question.  In my opinion, the plan you laid out seems like a reasonable start but, by itself, will not lead you to a profitable trading strategy.  That is just my opinion, is there something else you'd like to know?  The rest of my answer consists of further comments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you haven't already, I recommend you read &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470284889&quot;&gt;Ernest Chan's Quantitative Trading&lt;/a&gt;.  He devotes an entire chapter to &quot;Fishing for Ideas: Where can we find good strategies?&quot;  I should mention, however, that he is skeptical of your bias towards machine learning:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;At the risk of oversimplification, we can characterize artificial intelligence&#xA;  (AI) as trying to fit past data points into a function with many, many parameters.&#xA;  This is the case for some of the favorite tools of AI: neural networks,&#xA;  decision trees, and genetic algorithms. With many parameters, we can for sure&#xA;  capture small patterns that no human can see. But do these patterns persist?&#xA;  Or are they random noises that will never replay again? Experts in AI assure&#xA;  us that they have many safeguards against fitting the function to transient&#xA;  noise. And indeed, such tools have been very effective in consumer marketing&#xA;  and credit card fraud detection. Apparently, the patterns of consumers and&#xA;  thefts are quite consistent over time, allowing such AI algorithms to work even&#xA;  with a large number of parameters. However, from my experience, these safeguards&#xA;  work far less well in financial markets prediction, and overfitting to&#xA;  the noise in historical data remains a rampant problem. As a matter of fact,&#xA;  I have built financial predictive models based on many of these AI algorithms in&#xA;  the past. Every time a carefully constructed model that seems to work marvels&#xA;  in backtest came up, they inevitably performed miserably going forward. The&#xA;  main reason for this seems to be that the amount of statistically independent&#xA;  financial data is far more limited compared to the billions of independent consumer&#xA;  and credit transactions available. (You may think that there is a lot of tickby-&#xA;  tick financial data to mine, but such data is serially correlated and far from&#xA;  independent.)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The primary reason I believe your plan is incomplete is that you haven't demonstrated an edge.  All the techniques you mention, machine learning, inhomogeneous time series, wavelets, are not new.  If you can demonstrate a novel yet useful way of combining these methods, then maybe you have something.  But be aware that there is &lt;strong&gt;huge&lt;/strong&gt; competition in FX and index equity futures, and it is &lt;em&gt;extremely&lt;/em&gt; unlikely that no one has tried something along the lines of what you are trying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, just because you think you know a market &lt;em&gt;best&lt;/em&gt; does not make it the &lt;strong&gt;best market for you.&lt;/strong&gt;  For that, I point you once again towards Chan's book.  He points out that your strategy should match your&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;working hours&lt;/li&gt;&#xA;&lt;li&gt;programming skills&lt;/li&gt;&#xA;&lt;li&gt;trading capital&lt;/li&gt;&#xA;&lt;li&gt;personal goals&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Think carefully about each of these.  Note that prior knowledge of a given market is not on the list.  That can be picked up relatively easily.  In fact, given that you already mention you have a small account, I really see no reason for you to be in such liquid markets, particularly as getting the sort of ultra-low latency to beat other market participants in a market-making type strategy will take an investment of many $100k.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-10-12T14:17:27.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2150" PostTypeId="2" ParentId="2148" CreationDate="2011-10-12T14:57:42.827" Score="7" Body="&lt;p&gt;I would suggest a multivariate garch model as a possibility.  We aren't exactly overrun with wonderful software for that, but with just bivariate data I would think that the in-sample correlation estimates would be reasonably robust over models and estimation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be good to try two or three ways of doing it to make sure I'm right about that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may find that the garch route is good enough to use as your solution if you aren't forecasting very far ahead.&lt;/p&gt;&#xA;" OwnerUserId="249" LastActivityDate="2011-10-12T14:57:42.827" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2152" PostTypeId="1" AcceptedAnswerId="2153" CreationDate="2011-10-12T19:33:32.393" Score="8" ViewCount="1244" Body="&lt;p&gt;From the text book &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/012088464X&quot;&gt;Quantitative Finance for Physicists: An Introduction (Academic Press Advanced Finance)&lt;/a&gt; I have this excercise:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Prove that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;\int_{t_1}^{t_2}W(s)^ndW(s)=\frac{1}{n+1}[W(t_2)^{n+1}-W(t_1)^{n+1}]-\frac{n}{2}\int_{t_1}^{t_2}W(s)^{n-1}ds&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hint: Calculate $d(W^{n+1})$ using Ito's lemma.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my calculation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use Ito's Lemma and use, as the text book does, the simplified case $\mu=0$, $\sigma=1$. So Ito's lemma reduces to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;dF=dt+2WdW&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I use the Ito Lemma here like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;\int_{t_1}^{t_2}W(s)^ndW(s)=\int_{t_1}^{t_2}W(s)^{n-1}W(s)dW(s)&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because $\mu=0$, $\sigma=1$, we have $F=W^2$ and therefore the integral equals:&#xA;$$&#xD;&#xA;\int_{t_1}^{t_2}F^\frac{n-1}{2}\frac{dF}{2}-\int_{t_1}^{t_2}F^\frac{n-1}{2}\frac{dt}{2}&#xD;&#xA;$$&#xA;Further simplification:&#xA;$$&#xD;&#xA;\frac{1}{2}\frac{2}{n+1}F^\frac{n+1}{2}]_{t_1}^{t_2}-\frac{1}{2}W^{n-1}(t)dt=\frac{1}{n+1}W^{n+1}]_{t_1}^{t_2}-\frac{1}{2}W(t)^{n-1}(t)dt&#xD;&#xA;$$&#xA;Putting everything together obviously yields:&#xA;$$&#xD;&#xA;\int_{t_1}^{t_2}W(s)^ndW(s)=\frac{1}{n+1}[W(t_2)^{n+1}-W(t_1)^{n+1}]-\frac{1}{2}\int_{t_1}^{t_2}W(s)^{n-1}ds&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second term lacks a factor $n$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong? Or is the book wrong? (By the way for $n=1$ this is consistent with the book. For $n=1$ I was also able to calculate the integral using summation $\lim_n\sum$.... But this seems too complicated for general case.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Besides I have problems understanding why I have to use the differential equation. Or do I have to see $W$ as $W=W(F,t)$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Removed some lines...&lt;/p&gt;&#xA;" OwnerUserId="41" LastEditorUserId="41" LastEditDate="2011-10-12T20:21:56.030" LastActivityDate="2011-10-13T12:59:46.727" Title="How to perform basic integrations with the Ito integral?" Tags="&lt;stochastic-calculus&gt;&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2153" PostTypeId="2" ParentId="2152" CreationDate="2011-10-12T19:55:57.490" Score="6" Body="&lt;p&gt;I think you should see the hint as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d(W_t^{n+1})=d(f(W_t))$$ with $$f(x)=x^{n+1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apply Ito:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d(W_t^{n+1}) = f'(W_t)dW_t + \frac{1}{2} f''(W_t) d&amp;lt;W&amp;gt;_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d(W_t^{n+1}) = (n+1) W_t^n dW_t + \frac{1}{2} n (n+1) W_t^{n-1} dt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you integrate, you get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$W_{t_2}^{n+1}-W_{t_1}^{n+1}=(n+1) \int_{t_1}^{t_2} W_t^n dW_t+ \frac{1}{2} n (n+1) \int_{t_1}^{t_2} W_t^{n-1} dt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You divide both sides by $(n+1)$ and you're done.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure how you use your Ito's lemma, maybe you've been fooled by some simplified version of some books. I'd recommend &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/9810235437&quot; rel=&quot;nofollow noreferrer&quot;&gt;Elementary Stochastic Calculus with Finance in View&lt;/a&gt; if you want a good introduction to the field.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for you assumptions, $\mu=0$ and $\sigma=1$ are the properties of a Brownian motion after just a single step $W_1$, by definition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here the purpose of the exercise is in my opinion to show you that by applying Ito's lemma, you might end up finding interesting properties (one of the most famous one was shown in &lt;a href=&quot;https://quant.stackexchange.com/questions/1330/what-is-itos-lemma-used-for-in-quantitative-finance/1345#1345&quot;&gt;this post&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2011-10-13T12:59:46.727" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2154" PostTypeId="2" ParentId="2148" CreationDate="2011-10-13T01:57:58.070" Score="16" Body="&lt;p&gt;You can use changepoint analysis to identify regime change. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also look at large angle differences in the eigenvectors between your most up-to-date/recent covariance matrix and the covariance matrix from the prior window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way to identify regime change is using a factor model. If the returns on a particular set of factors is X standard deviations from its usual terrain for a sustained period then you can call this regime change. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not believe you will find a single time window that is best. Regime duration is variable. Key here is identifying an estimation procedure for a covariance matrix that produces reasonable out-of-time forecasts. You will need to do some empirical testing, or develop a rule to re-estimate your model based on the how you identify regimes, or use  Garch (or other dynamic model) as Patrick suggests.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Technical side note: You probably don't want to discard old data completely but instead weight more recent data with exponential weighting, or re-scale the covariance matrix to reflect current volatility. The eigenvectors of the correlation matrix (after the 1st eigenvector which is the market factor) will correspond to sector and industry groups. These correlations will persist. When market flip from bull to bear market (let's call this a 1st order approximation of regime - as opposed to style and industry changes) what is happening is that the variance explained by the largest eigenvector has increased substantially.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-10-13T13:20:43.627" LastActivityDate="2011-10-13T13:20:43.627" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2155" PostTypeId="2" ParentId="2143" CreationDate="2011-10-13T02:02:08.687" Score="1" Body="&lt;p&gt;I would normalize valuation variables over the business cycle. These normalized variables exhibit mean-reversion. For example, use price-to-peak earnings rather than P/E. &lt;a href=&quot;http://www.hussmanfunds.com/popup/pricepeak.htm&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; is a good illustration of the idea.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2011-10-13T02:02:08.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2156" PostTypeId="2" ParentId="2129" CreationDate="2011-10-13T02:05:35.500" Score="3" Body="&lt;p&gt;If you have K strategies and each strategy has an expected return, a variance, and you can measure the covariance of your strategies performance then a mean-variance optimization would answer how to optimally allocate capital amongst your strategies. Key to this approach is accurate estimation of your the input parameters identified above.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2011-10-13T02:05:35.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2157" PostTypeId="1" AcceptedAnswerId="2162" CreationDate="2011-10-13T03:19:40.870" Score="7" ViewCount="1718" Body="&lt;p&gt;Assume a stock had an open of \$100 and a close of \$102. If the high of the day was \$103 and the low was \$99, the daily range is obviously \$4. What is the best way to express the daily range in terms of percentage?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you take the range and divide it by the open, you get 4.00%. If you take the high and divide it by the low you get 4.04%. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first method seems more intuitive but the second method is more computationally efficient and may be good enough. Is there an industry standard for this calculation?&lt;/p&gt;&#xA;" OwnerUserId="291" LastActivityDate="2011-10-14T05:23:42.677" Title="What is the denominator in calculating daily range as a percentage?" Tags="&lt;best-practices&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2158" PostTypeId="1" CreationDate="2011-10-13T18:44:14.267" Score="8" ViewCount="489" Body="&lt;p&gt;My data source for end of day prices only gives the prices of the trades during the day. If a stock stops trading/goes out/moves to another exchange|changes symbol. I never hear about this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question(s) are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is there a way to determine that a stock is no longer trading? Most stocks that I have, have daily updates to the price. Some stocks only have price listings once a month or once every blue moon. &lt;/li&gt;&#xA;&lt;li&gt;Is there a data source [preferably free, without parsing through news stories] that I can grab that can give updates on symbol changes/delistings/going to 0.0.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1204" LastActivityDate="2011-10-13T21:46:16.260" Title="Where can you find data on non-trading stocks?" Tags="&lt;data&gt;&lt;market-data&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2159" PostTypeId="2" ParentId="2158" CreationDate="2011-10-13T20:14:43.763" Score="3" Body="&lt;p&gt;It really depends on what you are trying to do with the data. It sounds like you are dealing in very illiquid stocks trading OTC or on the pink sheets, etc and if they only trade (&quot;have price listings&quot;) &quot;once every blue moon&quot;, you probably have a lot of manual intervention and research to do in building your data series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With that said...&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;It depends on the data source. If an issuer goes bankrupt, sometimes their shares move to the pink sheets to facilitate class action lawsuits, bankruptcy proceedings, etc. Further it depends on the how the data vendor treats such events. Some might sources show the price as $0, some might have a code for what has happened (bankruptcy, merger, change of symbol, etc.).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Chicago Booth's Center for Research in Securities Prices (http://www.crsp.com/) has very high quality historic data which contains the information you are looking for, albeit not for free. The type of data you are looking for would only come from a fairly high quality source. In my opinion you would be very hard pressed to find it standardized and delivered on a silver platter (or CSV file) for free.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1112" LastActivityDate="2011-10-13T20:14:43.763" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2160" PostTypeId="2" ParentId="2158" CreationDate="2011-10-13T21:46:16.260" Score="3" Body="&lt;p&gt;NASDAQ's website has a list of symbol changes.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.nasdaq.com/markets/stocks/symbol-change-history.aspx&quot; rel=&quot;nofollow&quot;&gt;http://www.nasdaq.com/markets/stocks/symbol-change-history.aspx&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking through a few of the listings, there are some Pink Sheet companies included, but I can't say if it's comprehensive.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, it doesn't seem like that have the data in an easily downloaded format.  You're probably stuck parsing it from the webpage.&lt;/p&gt;&#xA;" OwnerUserId="584" LastActivityDate="2011-10-13T21:46:16.260" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2161" PostTypeId="2" ParentId="2157" CreationDate="2011-10-13T22:12:53.223" Score="4" Body="&lt;p&gt;...and assuming the stock opens at 48 and closes at 50 with a high of 51 and a low of 47 the percentage ranges will be 8.3% and 8.5%, the point being that your percentage measure of the range is determined entirely by the price level(s) of the denominator(s). This is an important caveat as these levels will change as the price bar data becomes historical data and this historical data is adjusted to accommodate future stock splits, dividends etc. or in the case of back-adjusted futures contracts the data is continually changing levels with the addition of new forward month contracts. Of course you can compensate for this by keeping track of the adjusted close, but then you are adding a data management problem and more complexity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would hazard a guess that you are seeking a way to normalise the range so that you can compare ranges at different time periods within the same time series or compare ranges across different time series. If this assumption is correct I would suggest normalising the range by using an average of the immediately preceding n=? bars. This resulting normalised range will remain consistent despite the above mentioned changes in levels in the historical data. Furthermore, I think it intuitively makes more sense to relate any bar's range characteristics to a summary of those that occur immediately before said bar: there is a qualitative difference in nature between a bar with a range of 4 now at a level of 50 that is much bigger/smaller than the average preceding range compared to a bar with a range of 4 six months ago at the 50 level where a range of 4 was &quot;normal&quot; for that market at that time. Using price levels for the denominator would not distinguish between the bars.  &lt;/p&gt;&#xA;" OwnerUserId="252" LastActivityDate="2011-10-13T22:12:53.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2162" PostTypeId="2" ParentId="2157" CreationDate="2011-10-14T05:23:42.677" Score="4" Body="&lt;p&gt;It seems that the daily range would be based on the open. The close is just part of the range of that day (it must fall within the range, it just happens to be the last transaction of that day).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a practical perspective, if you were looking for non-normal price deviations, you could not calculate whether the price at time N is within its normal distribution of past price ranges as the day progresses if you were waiting for the closing price to get your denominator.&lt;/p&gt;&#xA;" OwnerUserId="1138" LastActivityDate="2011-10-14T05:23:42.677" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2163" PostTypeId="1" CreationDate="2011-10-14T15:51:54.003" Score="15" ViewCount="566" Body="&lt;p&gt;Seasonality is a big deal in the natural gas markets.  My understanding is that they are broadly divided into summer and winter, with seasonality in both price and the volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What does this translate into in terms of skews or volatility surfaces?  What implications are there for hedging?  And how do the options markets deal with the futures strips?&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2017-08-30T15:21:05.593" Title="What are the major characteristics of natural gas volatility and options?" Tags="&lt;volatility&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2164" PostTypeId="1" CreationDate="2011-10-14T19:30:01.903" Score="11" ViewCount="312" Body="&lt;p&gt;I'm using a binomial tree to price a bond that has an embedded call or put option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On every node that has a coupon payment, do you include the coupon payment then max/min out the value, or do you max/min out the value then apply the coupon?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My guess is that for a call option, the issuer will make sure the value to the lender doesn't go beyond the call price, so we include the coupon, THEN min it out. But for a put option, the lender will make sure the value doesn't go beyond the put price, so we exclude the coupon, max the price out, THEN apply the coupon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Effectively, that's sort of like saying: assuming a continuously exercisable option, try to exercise the option 1 sliver of time before getting the coupon, then try to exercise it again 1 sliver of time after getting the coupon.&lt;/p&gt;&#xA;" OwnerUserId="1443" LastEditorUserId="1106" LastEditDate="2011-12-06T21:47:18.330" LastActivityDate="2011-12-06T21:47:18.330" Title="How to handle coupon payments when pricing a bond with an embedded option?" Tags="&lt;options&gt;&lt;fixed-income&gt;&lt;binomial-tree&gt;&lt;pricing&gt;&lt;embedded-options&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2165" PostTypeId="2" ParentId="2164" CreationDate="2011-10-14T20:05:41.263" Score="4" Body="&lt;p&gt;You have to look at the terms and conditions on your individual bond.  The way the specifications &lt;em&gt;usually&lt;/em&gt; work is that a call will result in accrued interest being paid, effectively making up for the lost coupon.  Sometimes there's even an extra penalty.  A put will result in a loss of coupon in almost all cases, and so is almost always done just after a coupon payment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Exercise must usually be preceded by a 30 day notice period, and is usually only considered near coupon dates.  In many cases, a bond that &quot;should&quot; be called is left outstanding, either to keep the markets sweet or to avoid the headache and expense of a new issuance.  Also in many cases, a bond will be &quot;tendered for&quot; by a company wanting to remove it from the markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For these reasons, quantitative modeling of bond options and their interest rate dependence is only of approximate use.  Add that to the fact that credit modeling is often skipped, or is primitive when included, and you find that scenario considerations and human intuition play a bigger role in that market than many people expect.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-10-14T20:05:41.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2166" PostTypeId="2" ParentId="1895" CreationDate="2011-10-14T20:35:22.447" Score="17" Body="&lt;p&gt;A very conservative stand is to distinguish between &lt;em&gt;anomalies&lt;/em&gt; and &lt;em&gt;arbitrage opportunities&lt;/em&gt;. Roughly speaking, while an arbitrage opportunity is risk-free by definition, an anomaly allows  for unaccounted risk factors. It is the magnitude of these unidentified risk factors that might determine the long term persistence of certain anomalies. A good starting point is the &lt;a href=&quot;http://en.wikipedia.org/wiki/Limits_to_arbitrage&quot; rel=&quot;noreferrer&quot;&gt;&quot;limits to arbitrage&quot; entry in Wikipedia&lt;/a&gt;. This literature has developed to cover several aspects. I can provide more references and examples if needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: following Tal's comment, here are some more details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a working definition of &quot;Anomaly&quot; I use: &lt;em&gt;something&lt;/em&gt; which is not explained within a &lt;em&gt;model&lt;/em&gt;. That something is usually expected returns. Typical examples:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;short run momentum,&lt;/li&gt;&#xA;&lt;li&gt;long run reversal,&lt;/li&gt;&#xA;&lt;li&gt;cross-industry momentum,&lt;/li&gt;&#xA;&lt;li&gt;value effect,&lt;/li&gt;&#xA;&lt;li&gt;post-earnings drift, and&lt;/li&gt;&#xA;&lt;li&gt;many other instances of unexplained predictability of returns&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The first comment is the &lt;em&gt;model&lt;/em&gt; matters. Short run momentum (1) is an anomaly for the CAPM, but maybe not so much for Kyle's Model (Econometrica 85) sequential trading model. Resolving (1) within CAPM requires explaning why recent upward performance renders an asset riskier and more correlated with consumption.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second comment is that &lt;em&gt;unexplained&lt;/em&gt; is a keyword in (6). There is nothing anomalous with outsized returns here, it is the risk-adjusted returns that should be inline with the risk free rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The third comment is that anomalies are not the same as arbitrage opportunity. To classify as an arbitrage, a portfolio has to be costless and riskfree. While anomalies might look like arbitrage opportunities, they are not: arbitrage opportunities are a particular kind of anomalies. Therefore using &quot;arbitraged away&quot; when referring to anomalies is a misnomer and can create confusion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Back to the question: &lt;em&gt;Why do some anomalies persist while others fade away?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see two additional explanations to the other answers provided:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;An anomaly that persists might have &lt;em&gt;unexplained risk&lt;/em&gt; that distinguishes it from an arbitrage opportunity. For example: fleeting instances of mispricing across different trading venues might persist because of latency risk.&lt;/li&gt;&#xA;&lt;li&gt;An anomaly might persist because there are &lt;em&gt;limits to arbitrage&lt;/em&gt;: arbitrageuers face borrowing constraints, computational constraints, attention constraints, informational constraints etc. Often the word constraints above can be replaced with costs, and the categories I listed overlap.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1531" LastEditorUserId="1531" LastEditDate="2016-08-08T17:35:56.977" LastActivityDate="2016-08-08T17:35:56.977" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2168" PostTypeId="1" AcceptedAnswerId="2180" CreationDate="2011-10-14T21:14:17.893" Score="8" ViewCount="964" Body="&lt;p&gt;How can one determine approximately what percentage of options trades are buyer-initiated vs. seller-initiated?  What measures of order flow are available specifically for options, preferably for individual contracts covering specific strikes and maturities?&lt;/p&gt;&#xA;" OwnerDisplayName="user322" LastEditorUserId="1106" LastEditDate="2011-10-17T15:10:26.787" LastActivityDate="2011-10-17T15:24:30.737" Title="How can one determine approximately what percentage of options trades are buyer-initiated vs. seller-initiated?" Tags="&lt;options&gt;&lt;market-data&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2169" PostTypeId="2" ParentId="2168" CreationDate="2011-10-14T23:25:45.993" Score="2" Body="&lt;p&gt;For every option bought there is an equal quantity of options sold. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, when reporters say &quot;stocks dropped because of heavy selling&quot;, this is strictly speaking impossible. For every stock sold someone is on the other side of the trade -- so stocks dropped because of heavy buying as well with equal intensity. What is happening is that the &lt;em&gt;willingess to pay&lt;/em&gt; for stock (demand curve) has shifted to the left, therefore prices have dropped.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-10-15T00:22:23.067" LastActivityDate="2011-10-15T00:22:23.067" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2170" PostTypeId="2" ParentId="2065" CreationDate="2011-10-15T02:10:39.587" Score="2" Body="&lt;p&gt;A possible answer is the approach of Hendershott, Jones, and Menkveld in &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/j.1540-6261.2010.01624.x/full&quot; rel=&quot;nofollow noreferrer&quot;&gt;their&lt;/a&gt; JF2011 paper (this paper was mentioned also in &lt;a href=&quot;https://quant.stackexchange.com/questions/1658/has-high-frequency-trading-hft-been-a-net-benefit-or-cost-to-society/1682#1682&quot;&gt;this&lt;/a&gt; post). From the introduction:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We use a normalized measure of NYSE electronic message traffic as a proxy for AT. This message traffic includes electronic order submissions, cancellations, and trade reports. Because we normalize by trading volume, variation in our AT measure is driven mainly by variation in limit order submissions and cancellations. This means that, for the most part, our measure is picking up variation in algorithmic liquidity supply.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;They discuss their &lt;em&gt;proxy for AT&lt;/em&gt; (Algorithmic Trading) in section II.A. The main intuition - as stated in the intro - is that the ratio between messages and executions has increased because of AT, through the various practices it allows (e.g.: fast repositioning of limit orders and cancellations).&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;[F]or each stock each month we calculate our AT proxy, algo tradit, as the number of electronic messages per $100 of trading volume.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1531" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2011-10-15T22:50:54.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2172" PostTypeId="1" CreationDate="2011-10-15T19:40:39.380" Score="17" ViewCount="1150" Body="&lt;p&gt;A binary option with payout \$0/\$100 is trading at \$30 with 12 hours to &#xA;expiration. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming the underlying follows a geometric Brownian motion (hence volatility remains constant), what probability distribution &#xA;describes the option's maximum price between now and expiration? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for a generic &quot;formula&quot;. Even though I used price and &#xA;expiration, I'm assuming the generic formula is a function of &#xA;volatility (of course, price and expiration determine volatility). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;More concretely:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume short time to expiry and hence null interest rates and dividends are null.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The time $t$ Black price (underlying $S_t$ is a GBM $dS_t = \sigma S_t dW_t$, $\sigma&amp;gt;0$, constant number) of a $K$-strike cash-or-nothing binary (digital) call option paying $1_{\{S_T&amp;gt;K\}}$ dollars at expiry time $T$ is $$P_t\triangleq \Phi\left(\frac{\ln(S_t/K)-0.5\sigma^2(T-t)}{\sigma\sqrt{T-t}}\right).$$   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We are interested in the distribution (or just time $0$ expectation) of the variable:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\max_{t\in[0,T]} P_t, $$&#xA;(with fixed $T$, $K$ and $\sigma$)&#xA;much like one is interested in the distribution (or just time $0$ expectation) of &#xA;$$\max_{t\in[0,T]} S_t.$$&lt;/p&gt;&#xA;" OwnerDisplayName="user59" LastEditorUserId="6858" LastEditDate="2014-01-03T09:51:44.400" LastActivityDate="2016-12-23T17:49:44.717" Title="Probability distribution of maximum value of binary option?" Tags="&lt;stochastic-calculus&gt;&lt;derivatives&gt;&lt;binary-options&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2173" PostTypeId="2" ParentId="332" CreationDate="2011-10-16T00:38:55.280" Score="7" Body="&lt;p&gt;A cautionary tale on all these approaches it told by Tim Loughran and Bill MacDonald in the Journal of Finance, 2011 (When Is a Liability Not a Liability? Textual Analysis, Dictionaries, and 10-Ks, &lt;a href=&quot;http://www.afajof.org/journal/abstract.asp?ref=0022-1082&amp;amp;vid=66&amp;amp;iid=1&amp;amp;aid=3&amp;amp;s=-9999&quot;&gt;here&lt;/a&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In their analysis they show that the commonly used Harvard Psychosociological Dictionary is inadequate for sentiment classification in a financial context. Their findings are specific to the analysis of 10-k, but probably also indicative of the general difficulties with NLP in finance. Some findings:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Most misclassifications simply introduce noise in the estimates;&lt;/li&gt;&#xA;&lt;li&gt;Some misclassifications introduce &lt;em&gt;false positives&lt;/em&gt; (eg. &quot;cancer&quot; is normally negative, but in a financial context it is neutral, most likely it refers to an industry sector.&lt;/li&gt;&#xA;&lt;li&gt;A simple long-short strategy based on positive/negative words count yields small (positive) alphas which are not statistically significant. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;There are of course several caveats:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;This approach is &quot;mainstream&quot; academic finance, with all its pros and cons (pros: clean approach, reproducible, simplicity suggests a low chance of data-snooping; cons: not strictly speaking quantitative, and - in this case - it doesn't use cutting the edge technology);&lt;/li&gt;&#xA;&lt;li&gt;The results are based on long horizon portfolio returns (buy/short and hold strategy on a 12-month horizon);&lt;/li&gt;&#xA;&lt;li&gt;The textual analysis is limited to &lt;em&gt;low frequency information&lt;/em&gt; (10-Ks) as opposed to &lt;em&gt;medium/high frequency information&lt;/em&gt; provided by news feeds.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1531" LastActivityDate="2011-10-16T00:38:55.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2174" PostTypeId="2" ParentId="2135" CreationDate="2011-10-16T02:07:23.500" Score="7" Body="&lt;p&gt;As far as I know the short answer is negative: there isn't a well developed theory of how to &lt;em&gt;forecast&lt;/em&gt; cross-sectional realized volatility. From the perspective of statistics/econometrics, most of the recent research is still trying to find its way around &lt;em&gt;estimation&lt;/em&gt; of cross-sectional realized volatility, and so far even in these area the progress is slow. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bringing modern techniques to panel data amounts to being able to:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;extract information irregularly spaced transaction data (UHFT or tick level),&lt;/li&gt;&#xA;&lt;li&gt;deal with &quot;microstructure noise&quot;,&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;in a multivariate setting where the additional problems of non-synchronous trading and high-dimensionality complicates the analysis, together with the usual hassle that comes with HAC estimators (such as the dimensionality issues that @QuantGuy mentions).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two main tools for tackling estimation: (1) the pre/post averaging approach of Ait-Sahalia, Mykland, Renault (and others) and (2) the kernel smoothing of Barndorff-Nielsen, Hansen (and others) [the third child, i.e. VAR and its crew, seems on the sideline of late, but I'd be happy to be proven wrong here]. Of these two approaches, only the second has matured a technology (Multivariate realised kernels) that is published (&lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S0304407611000029&quot;&gt;here&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="1531" LastActivityDate="2011-10-16T02:07:23.500" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2175" PostTypeId="1" CreationDate="2011-10-16T10:51:34.163" Score="9" ViewCount="654" Body="&lt;p&gt;Beginner question. Having read a couple of papers and book chapters on high-frequency data forecasting, I'm surprised (and confused) that the same time series techniques can be applied to high-frequency/ tick data than for lower frequencies. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;High-frequency data seems to clearly not follow a normal distribution given that prices change in discrete steps, have a minimal tick size, lag-1 autocorrelation, etc. Thus how can researchers apply techniques on it which have strong normality assumptions? (e.g. analysing the mid-price evolution and signed volume of transactions using vector autoregression of Hasbrouck).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example [1] describes an autoregressive (VAR) quote-revision model which relates mid-price changes to signed trade size. Clearly, the difference in mid-prices are discrete and I would say ressembles count data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[1] Measuring the Information of Stock Trades&#xA;Joel Hasbrouck, Quantitative Finance, 1991, Journal of Finance &lt;a href=&quot;http://faculty.chicagobooth.edu/jeffrey.russell/teaching/finecon/readings/hasbrouck.pdf&quot; rel=&quot;noreferrer&quot;&gt;pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1364" LastEditorUserId="1364" LastEditDate="2011-10-16T20:02:15.607" LastActivityDate="2020-11-23T20:09:05.077" Title="Applying models with normality assumption on tick data?" Tags="&lt;time-series&gt;&lt;high-frequency&gt;&lt;tick-data&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2177" PostTypeId="1" CreationDate="2011-10-16T22:55:04.000" Score="9" ViewCount="532" Body="&lt;p&gt;Latency has been a hot topic for a while, first in the industry and more recently also in academia. It is very common to hear about milliseconds, even microseconds. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;While most of the media attention is on equity markets, latency is an important variable in options markets, futures markets, and FX markets (arguably, it is not so important when dealing with fixed income instruments - comments on this are more than welcome). Latency is different across markets for different products. Also, within a product class, latency changes across different infrastructures (co-location, DMA, various types of mediation).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question: &lt;em&gt;What are the typical latencies across different products and infrastructures?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: To address one of wburzyns concerns, I changed the title to &quot;realized latency&quot;. For lack of a better term, I use &quot;realized latency&quot; to mean &quot;the time from when the order is submitted locally to when it is processed&quot;. As an answer prototype, below is a fairly outdated illustration dug out from a SUN white-paper, where different markets and market activities are binned according to the typical latency they face. I would like to know where do the markets stand now and see a similar classification for markets and infrastructures (not so much market activities).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you think this question is too broad, how would you break it up?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZjY5L.png&quot; alt=&quot;2009: typical realized latencies.&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="1531" LastEditorUserId="1531" LastEditDate="2011-10-21T20:46:56.593" LastActivityDate="2011-12-11T04:32:41.103" Title="What are the typical &quot;realized latencies&quot; across different products and infrastructures?" Tags="&lt;latency&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2178" PostTypeId="2" ParentId="2177" CreationDate="2011-10-17T08:29:42.767" Score="7" Body="&lt;p&gt;If this question is about &lt;b&gt;matching engine latency&lt;/b&gt; then there are plenty of resources on the web. The short answer is that across various exchanges the latency is currently in range from hundreds of milliseconds to hundreds of microseconds. To name a few (as of 2010):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;NASDAQ: 250 us&#xA;&lt;li&gt;Australia Stock Exchange: 300 us&#xA;&lt;li&gt;Hong Kong Stock Exchange: 9 ms&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;AFAIK Singapore Stock Exchange is going to launch / already launched the world’s fastest matching engine with average round-trip time of 90 us.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've never heard about different values of latency for different classes of instruments on the same exchange. Although different classes, they are all serviced by the same matching engine. However I can imagine some internal prioritization/etc.&lt;/p&gt;&#xA;" OwnerUserId="493" LastActivityDate="2011-10-17T08:29:42.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2179" PostTypeId="2" ParentId="2101" CreationDate="2011-10-17T11:04:28.803" Score="1" Body="&lt;p&gt;First of all, I'm not sure I got it right. You're directly shrinking the final result (vector of asset weights), right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that's the case, it may not be exactly what you're looking for, but you may still have a look at some papers by &lt;em&gt;Ledoit&lt;/em&gt; and &lt;em&gt;Wolf&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, in &lt;a href=&quot;http://www.econ.upf.edu/docs/papers/downloads/691.pdf&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;Honey, I Shrunk the Sample Covariance Matrix&lt;/em&gt;&lt;/a&gt; they propose that shrinkage always be applied to the covariance matrix before proceeding with any further work. They then compare out-of-sample performance of different shrinkage targets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I suppose it is shrinkage applied in another phase of MVO than what you've mentioned, but it may still be of interest to you. By the way, you mind sharing some references you mentioned in the first sentence?&lt;/p&gt;&#xA;" OwnerUserId="38" LastActivityDate="2011-10-17T11:04:28.803" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2180" PostTypeId="2" ParentId="2168" CreationDate="2011-10-17T15:24:30.737" Score="2" Body="&lt;p&gt;&lt;a href=&quot;http://rfs.oxfordjournals.org/content/19/3/871.abstract&quot; rel=&quot;nofollow&quot;&gt;Pan and Poteshman (2006)&lt;/a&gt; were able to obtain a &quot;unique dataset from the Chicago Board Options Exchange (CBOE) which breaks down the daily trading volume of both call and put options into four categories according to whether a trade is initiated by a buyer or a seller, and whether the initiator opens a new option position or closes an existing option position.&quot;  I don't know where they got the data, but obviously this would answer your question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise, you could use the &lt;a href=&quot;http://www.jstor.org/pss/2328845&quot; rel=&quot;nofollow&quot;&gt;Lee and Ready (1991)&lt;/a&gt; algorithm to infer, with some noise, whether a trade is buyer or seller initiated.  In fact, &lt;a href=&quot;http://ssrn.com/abstract=2883&quot; rel=&quot;nofollow&quot;&gt;Amin and Lee (1997)&lt;/a&gt; did precisely this in a paper studying options trading around earnings announcements.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-10-17T15:24:30.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2181" PostTypeId="2" ParentId="2135" CreationDate="2011-10-17T15:49:02.187" Score="5" Body="&lt;p&gt;Check out &lt;a href=&quot;http://ssrn.com/abstract=1490414&quot; rel=&quot;nofollow&quot;&gt;A Blocking and Regularization Approach to High Dimensional Realized Covariance Estimation&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Abstract:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We introduce a blocking and regularization approach to estimate high-dimensional covariances using high-frequency data. Assets are first grouped according to liquidity. Using the multivariate realized kernel estimator of Barndorff-Nielsen et al. (2010), the covariance matrix is estimated block-wise and then regularized. The performance of the resulting blocking and regularization (‘RnB’) estimator is analyzed in an extensive simulation study mimicking the liquidity and market microstructure features of the S&amp;amp;P 1500 universe. The RnB estimator yields efficiency gains for varying liquidity settings, noise-to-signal ratios and dimensions. An empirical application of estimating daily covariances of the S&amp;amp;P 500 index confirms the simulation results. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1106" LastEditDate="2011-10-17T15:54:34.607" LastActivityDate="2011-10-17T15:54:34.607" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2182" PostTypeId="1" CreationDate="2011-10-17T23:52:17.607" Score="11" ViewCount="4853" Body="&lt;ul&gt;&#xA;&lt;li&gt;Which is the most extensible? &lt;/li&gt;&#xA;&lt;li&gt;Which is the most efficient in terms of a minimal learning curve while providing a meaningful degree of flexibility and performance? &lt;/li&gt;&#xA;&lt;li&gt;Any of these tools really limited in terms of customization and worth avoiding?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1540" LastActivityDate="2011-10-27T02:16:34.003" Title="What are your opinions on WEKA KnowledgeFlow, Rapidminer, and other rapid development environments for machine learning?" Tags="&lt;machine-learning&gt;&lt;visualization&gt;" AnswerCount="5" CommentCount="5" FavoriteCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="2183" PostTypeId="1" AcceptedAnswerId="2187" CreationDate="2011-10-18T00:26:52.093" Score="12" ViewCount="1143" Body="&lt;p&gt;I have some closing price data for two Australian banks which track each other very closely. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://dl.dropbox.com/u/12337149/stat/CBA.csv&quot; rel=&quot;noreferrer&quot;&gt;http://dl.dropbox.com/u/12337149/stat/CBA.csv&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://dl.dropbox.com/u/12337149/stat/WBC.csv&quot; rel=&quot;noreferrer&quot;&gt;http://dl.dropbox.com/u/12337149/stat/WBC.csv&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Code from &lt;a href=&quot;http://quanttrader.info/public/testForCoint.html&quot; rel=&quot;noreferrer&quot;&gt;this web page&lt;/a&gt; produces the following output&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assumed hedge ratio is 2.26&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ADF p-value is 0.47&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I plot the prices, I obtain a chart that looks cointegrated&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/HNvzw.png&quot; alt=&quot;http://dl.dropbox.com/u/12337149/stat/cointegration.png&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I don't understand is why my p-value is so high. My slightly adapted R code is below.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(zoo)&#xA;library(tseries)&#xA;&#xA;gld &amp;lt;- read.csv(&quot;C:\\...\\CBA.csv&quot;, stringsAsFactors=F)&#xA;gdx &amp;lt;- read.csv(&quot;C:\\...\\WBC.csv&quot;, stringsAsFactors=F)&#xA;&#xA;gld &amp;lt;- zoo(gld[,5], as.Date(gld[,1]))&#xA;gdx &amp;lt;- zoo(gdx[,5], as.Date(gdx[,1]))&#xA;&#xA;t.zoo &amp;lt;- merge(gld, gdx, all=FALSE)&#xA;t &amp;lt;- as.data.frame(t.zoo)&#xA;&#xA;cat(&quot;Date range is&quot;, format(start(t.zoo)), &quot;to&quot;, format(end(t.zoo)), &quot;\n&quot;)&#xA;&#xA;m &amp;lt;- lm(gld ~ gdx + 0, data=t)&#xA;beta &amp;lt;- coef(m)[1]&#xA;&#xA;cat(&quot;Assumed hedge ratio is&quot;, beta, &quot;\n&quot;)&#xA;&#xA;sprd &amp;lt;- t$gld - beta*t$gdx&#xA;ht &amp;lt;- adf.test(sprd, alternative=&quot;stationary&quot;, k=0)&#xA;&#xA;cat(&quot;ADF p-value is&quot;, ht$p.value, &quot;\n&quot;)&#xA;&#xA;if (ht$p.value &amp;lt; 0.05) {&#xA;    cat(&quot;The spread is likely mean-reverting\n&quot;)&#xA;} else {&#xA;    cat(&quot;The spread is not mean-reverting.\n&quot;)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1541" LastEditorUserId="1106" LastEditDate="2011-10-18T00:44:34.483" LastActivityDate="2011-10-18T08:42:04.143" Title="Why does the following data fail my cointegration test?" Tags="&lt;time-series&gt;&lt;statistics&gt;&lt;r&gt;&lt;cointegration&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2184" PostTypeId="2" ParentId="131" CreationDate="2011-10-18T01:32:12.397" Score="7" Body="&lt;p&gt;For reference, note that execution strategies for some types of futures contracts can be very different from equities. An example are Interest Rate Futures, e.g. &lt;a href=&quot;http://market-microstructure.institutlouisbachelier.org/presentations/Special%20Microstructural%20Features%20of%20Interest%20Rate%20Futures%20-%20Almgren.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main reason lies in microstructure differences. For some more details see the &lt;a href=&quot;http://quantitativebrokers.com/wp-content/uploads/2011/08/theRollReport.pdf&quot; rel=&quot;nofollow&quot;&gt;white paper&lt;/a&gt; &quot;US Treasury Futures Roll Microstructure Basics&quot; by Quantitative Brokers (I have no affiliation with QB). Very briefly:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Traders that don't want to take delivery roll over their positions,&lt;/li&gt;&#xA;&lt;li&gt;The matching algo for Treasury spread contracts is “Split FIFO/Pro-Rata.” Fills are allocated so that a percentage of every order is filled either FIFO or pro-rata.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Few consequences of the “Split FIFO/Pro-Rata” matching are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The optimal strategy is to oversize limit orders;&lt;/li&gt;&#xA;&lt;li&gt;Marketable limit orders are attractive (new top order is filled with FIFO);&lt;/li&gt;&#xA;&lt;li&gt;Empirically there are rapid variations in order size. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1531" LastEditorUserId="1531" LastEditDate="2011-10-18T16:41:17.603" LastActivityDate="2011-10-18T16:41:17.603" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2186" PostTypeId="2" ParentId="2182" CreationDate="2011-10-18T08:15:08.310" Score="5" Body="&lt;p&gt;Accordingly to &lt;a href=&quot;http://rapid-i.com/rapidforum/index.php/topic,362.0.html&quot; rel=&quot;nofollow&quot;&gt;this comparison&lt;/a&gt; (look for post written by Martin) Rapidminer is more powerful in terms of implemented mining algorithms and scales better for large datasets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Being originally a WEKA user my impression is that Rapidminer is also easier to use than WEKA.&lt;/p&gt;&#xA;" OwnerUserId="493" LastEditorUserId="493" LastEditDate="2011-10-18T14:58:45.063" LastActivityDate="2011-10-18T14:58:45.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2187" PostTypeId="2" ParentId="2183" CreationDate="2011-10-18T08:42:04.143" Score="7" Body="&lt;p&gt;Here is my code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;require(xts)&#xA;require(urca)&#xA;&#xA;# Load data&#xA;gld &amp;lt;- read.csv(&quot;~/Downloads/CBA.csv&quot;, stringsAsFactors = FALSE)&#xA;gdx &amp;lt;- read.csv(&quot;~/Downloads/WBC.csv&quot;, stringsAsFactors = FALSE)&#xA;&#xA;# Convert to xts&#xA;gld &amp;lt;- xts(gld[, 4], as.POSIXct(gld[, 1], tz = &quot;GMT&quot;, format = &quot;%Y-%m-%d&quot;, tzone =    &quot;GMT&quot;))&#xA;gdx &amp;lt;- xts(gdx[, 4], as.POSIXct(gdx[, 1], tz = &quot;GMT&quot;, format = &quot;%Y-%m-%d&quot;, tzone = &quot;GMT&quot;))&#xA;&#xA;# Plot original data&#xA;par(mfrow = c(2,1))&#xA;plot(gld)&#xA;plot(gdx)&#xA;par(mfrow = c(1,1))&#xA;&#xA;# Linear regression with fixed alpha&#xA;regress &amp;lt;- lm(as.numeric(gld) ~ as.numeric(gdx) + 0)&#xA;cat(&quot;Beta is&quot;, coef(regress)[1])&#xA;&#xA;# ADF test. We use drift type because we will an intercept&#xA;# in our data. &#xA;adf &amp;lt;- ur.df(residuals(regress), type = &quot;drift&quot;)&#xA;cat(&quot;ADF test statistic is&quot;, adf@teststat[1], &quot;critical value is&quot;, adf@cval[1], &quot;\n&quot;)&#xA;cat(&quot;Residuals are&quot;, ifelse(adf@teststat[1] &amp;lt; adf@cval[1], &quot;stationary&quot;, &quot;not stationary&quot;))&#xA;&#xA;# Plot residuals&#xA;plot(residuals(regress), type = &quot;l&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems like your series are not cointegrated in this sample, look at residuals.&#xA;What you can try to do is:&#xA; 1. Look at longer sample&#xA; 2. Try to construct a cointegrating vector using more than 2 price series. Hint: add Brent.&#xA;You can try Johansen procedure for that stuff.&lt;/p&gt;&#xA;" OwnerUserId="1544" LastActivityDate="2011-10-18T08:42:04.143" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2188" PostTypeId="2" ParentId="2182" CreationDate="2011-10-18T09:28:07.627" Score="5" Body="&lt;p&gt;Firstly, it may depend vastly on your choice of platforms (e.g. R, Python, or Java). Some of the most common ones:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Python&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Out of the box: &lt;a href=&quot;http://orange.biolab.si/&quot;&gt;Orange&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Self-customized: &lt;a href=&quot;http://scikit-learn.sourceforge.net/stable/&quot;&gt;Scikit-learn&lt;/a&gt; and &lt;a href=&quot;http://pybrain.org/&quot;&gt;PyBrain&lt;/a&gt; &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Java&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Out of the box:&lt;a href=&quot;http://rapid-i.com/&quot;&gt;RapidMiner&lt;/a&gt; and &lt;a href=&quot;http://www.knime.org/&quot;&gt;KNIME&lt;/a&gt; &lt;/li&gt;&#xA;&lt;li&gt;Self-customized-prone:&lt;a href=&quot;http://www.cs.waikato.ac.nz/ml/weka/&quot;&gt;Weka&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;R&lt;/strong&gt;: &#xA;&lt;a href=&quot;http://cran.r-project.org/web/views/MachineLearning.html&quot;&gt;Machine learning in R&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly, it vastly depends on your purpose while choosing whether to use out of the box platform or not.&#xA;&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main pro of the 'rapid' platforms is that they are really easy to learn and quick to generate some results. The major con is that not everything is implemented in these platforms. Due to the effort in making a tool very easy to use, customization is left behind. Sometime your may want to build your own system which only use machine learning as a component, you will probably find tools like scikits-learn are easier to adopt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I find it is very handy to use both. Using 'rapid' ones to generate the whole idea and do some experiments and tweaks, e.g. tuning the parameters, and adjusting the categories. And then, use a more customized tool to implement the whole system. E.g. I use both RapidMiner and Scikits-learn together.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Speaking of learning curve, RapidMiner as a tool and Python as a language may highly probable be the best.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Speaking of extensibility, though not very familiar with R, I think R and Python are quite good.&lt;/p&gt;&#xA;" OwnerUserId="1446" LastEditorUserId="1446" LastEditDate="2011-10-18T09:33:45.047" LastActivityDate="2011-10-18T09:33:45.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2189" PostTypeId="1" CreationDate="2011-10-18T11:02:38.697" Score="1" ViewCount="236" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Possible Duplicate:&lt;/strong&gt;&lt;br&gt;&#xA;  &lt;a href=&quot;https://quant.stackexchange.com/questions/1621/how-to-derive-the-implied-probability-distribution-from-b-s-volatilities&quot;&gt;How to derive the implied probability distribution from B-S volatilities?&lt;/a&gt;  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&#xA;&#xA;&lt;p&gt;Let's assume a stock price S, with volatility $\sigma$ constant, no dividend, and risk free interest rate $r$ we have :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ dS=\mu Sdt +\sigma SdW $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And therefore using ito's lemma we get that $\ln(S)$ follows the following normal distribution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \ln(S) \rightarrow \phi((r -\frac {\sigma^2}2)T,\sigma \sqrt(T))  $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in real life the volatility is not a constant, and he future volatility is actualy unknown.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now using black scholes equation I can calculate the implied volatility and I use it as an approximation of the expected volatility in the future. The implied vol will depend on the maturity T and the strike K (the current stock price and r are known).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get the actual distribution of S (or ln(S)) using the value implied volatility $\sigma(T,K)$ ? Or in another words, how does the volatility smile modify the expected distribution of S ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not sure my question is clear, If you need any more clarification tell me. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I read a question with a similar title but the actual question is different : &lt;a href=&quot;https://quant.stackexchange.com/questions/47/how-to-calculate-future-distribution-of-price-using-volatility&quot;&gt;How to calculate future distribution of price using volatility?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1038" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2011-10-18T11:02:38.697" Title="Getting the actual distribution of a stock price at time T using implied volatility" Tags="&lt;implied-volatility&gt;&lt;equities&gt;&lt;distribution&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="2" ClosedDate="2011-10-18T16:12:53.813" ContentLicense="CC BY-SA 3.0" />
  <row Id="2190" PostTypeId="2" ParentId="2175" CreationDate="2011-10-18T17:29:38.570" Score="4" Body="&lt;p&gt;I'm trying to formulate an answer for latter users of the site and, hopefully to lure some more experienced high frequency traders to further react to my post.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all, I'd notice that the paper you mentioned was published in 1991. I believe high-frequency trading has evolved a lot since then, and that nowadays HF strategies are more evolved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From what I know, high-frequency trading involves many different kinds of strategies, some of which are not related to normality assumptions. For example, if you want to trade arbitragist strategies, you will have to trade at high frequency in order to catch the arbitrage opportunity (otherwise, someone quicker might have taken advantage already, and the opportunity is gone), however this strategy clearly doesn't rely on the normality assumption. Trend following at high-frequency (which was the subject of my master thesis) doesn't rely on probabilistic assumption either, its more a technical or behavioral strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a more general point of view, you could also discuss the validity of the normal assumption, even at a higher frequency as Sornette quite brilliantly shows in  &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0691118507&quot; rel=&quot;nofollow&quot;&gt;his book&lt;/a&gt;. There is a quote from the &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/157851777X&quot; rel=&quot;nofollow&quot;&gt;Origin of Wealth&lt;/a&gt; that I quite fancy relating finance research always assuming unrealistic assumptions in finance &quot;bullshit in, bullshit out&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a matter of fact, you will have to add some noise to your model in order to make it realistic, but this noise might well be part of a framework which makes the overall distribution not really normal, or at least with a volatility that significantly evolve though time (&lt;a href=&quot;http://www.bgu.ac.il/~shalit/Publications/Garch_ApplFinEcon2.pdf&quot; rel=&quot;nofollow&quot;&gt;Asymmetric GARCH&lt;/a&gt; for example).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, I seriously doubt that any profitable strategy (on the long-term) really rely on pure normality assumptions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd be more than happy to be proven wrong.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2011-10-18T17:29:38.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2191" PostTypeId="1" CreationDate="2011-03-01T05:59:05.950" Score="8" ViewCount="2904" Body="&lt;p&gt;Let's say I have time series of stock prices for many stocks.  What's the best way to sort the stocks based on which have been going up/stayed the same relative to others?  Can this be done with a weighted average, putting more weight on the most recent numbers, to account for trends?&lt;/p&gt;&#xA;" OwnerDisplayName="user2664" LastEditorUserId="1106" LastEditDate="2011-10-18T18:44:56.843" LastActivityDate="2011-10-18T18:44:56.843" Title="How to compute momentum from equity time series?" Tags="&lt;time-series&gt;&lt;equities&gt;&lt;technicals&gt;" AnswerCount="4" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2192" PostTypeId="2" ParentId="2191" CreationDate="2011-03-01T21:50:02.553" Score="2" Body="&lt;p&gt;It sounds as if you would be interested in computing Relative Strength&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.investopedia.com/terms/r/relativestrength.asp&quot; rel=&quot;nofollow&quot;&gt;http://www.investopedia.com/terms/r/relativestrength.asp&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could either measure it against a benchmark index such as the Dow 30,  or compute your own index from your 50 stocks and measure each individual stock against the index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Ralph Winters&lt;/p&gt;&#xA;" OwnerUserId="520" OwnerDisplayName="Ralph Winters" LastActivityDate="2011-03-01T21:50:02.553" CommentCount="0" ContentLicense="CC BY-SA 2.5" />
  <row Id="2193" PostTypeId="2" ParentId="2191" CreationDate="2011-03-21T23:41:19.940" Score="3" Body="&lt;p&gt;you might want to rank stocks on the basis of standard dev of a forecast divided by the forecast. In this way the &quot;tighter&quot; the value the more predictable the stock.&lt;/p&gt;&#xA;" OwnerDisplayName="IrishStat" LastActivityDate="2011-03-21T23:41:19.940" CommentCount="3" ContentLicense="CC BY-SA 2.5" />
  <row Id="2194" PostTypeId="2" ParentId="2191" CreationDate="2011-10-18T17:31:07.147" Score="7" Body="&lt;p&gt;This entire approach hinges on how you define &quot;value.&quot;  Once you've defined value, you can define a metric for &quot;stability&quot; or &quot;risk.&quot;  A working hypothesis would be that stock that have been stably valuable in the past would continue to be valuable in the future.  Of course, this is a hypothesis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say (for sake of an example, this is not financial advice) you define value as &quot;mean of log returns&quot; and stability as &quot;standard deviation of log returns.&quot;  You could then sort your stocks by these metrics and pick ones with a high value and a low risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to get fancy, you can use another metric of risk, such as drawdown.  You can also do a rolling analysis or use bootstrap re-sampling to distributions around your &quot;value&quot; and &quot;stability&quot; metrics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's some code in R that illustrates my example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#Load Data&#xA;rm(list = ls(all = TRUE)) #CLEAR WORKSPACE&#xA;set.seed(1)&#xA;library(quantmod)&#xA;myStocks &amp;lt;- c('AAPL','MSFT','GOOG','F')&#xA;getSymbols(myStocks,from='01-01-2004')&#xA;Data &amp;lt;- na.omit(cbind(Cl(AAPL),Cl(MSFT),Cl(GOOG),Cl(F)))&#xA;names(Data) &amp;lt;- myStocks&#xA;&#xA;#Define value and risk&#xA;returns &amp;lt;- function(x) {diff(log(x))}&#xA;value &amp;lt;- function(x) {mean(returns(x))}&#xA;risk &amp;lt;- function(x) {sd(returns(x))}&#xA;&#xA;#Estimate value and risk&#xA;StockScreen &amp;lt;- data.frame(  risk=apply(as.matrix(Data),2,risk),&#xA;                            value=apply(as.matrix(Data),2,value))&#xA;round(StockScreen,6)&#xA;plot(StockScreen)&#xA;text(StockScreen$risk+.001,StockScreen$value,labels=row.names(StockScreen))&#xA;&#xA;#Estimate value and risk, different risk measure&#xA;library(PerformanceAnalytics)&#xA;risk &amp;lt;- function(x) {maxDrawdown(returns(x))}&#xA;StockScreen &amp;lt;- data.frame(  risk=apply(as.matrix(Data),2,risk),&#xA;                            value=apply(as.matrix(Data),2,value))&#xA;round(StockScreen,6)&#xA;&#xA;#Boostrap value and risk measure&#xA;library(meboot)&#xA;library(plyr)&#xA;&#xA;bootstrap &amp;lt;- function(x) {&#xA;    reps &amp;lt;- as.data.frame(meboot(as.ts(x), reps=100)$ensemble)&#xA;    valueDistribution &amp;lt;- apply(reps,2,value)&#xA;    riskDistribution &amp;lt;- apply(reps,2,risk)&#xA;&#xA;    valueMean &amp;lt;- mean(valueDistribution)&#xA;    valueSD &amp;lt;- sd(valueDistribution)&#xA;    riskMean &amp;lt;- mean(riskDistribution)&#xA;    riskSD &amp;lt;- sd(riskDistribution)&#xA;&#xA;    data.frame(valueMean=valueMean,valueSD=valueSD,riskMean=riskMean,riskSD=riskSD)&#xA;}&#xA;&#xA;bootstrapScreen &amp;lt;- ldply(as.list(Data),bootstrap,.progress = &quot;text&quot;)&#xA;row.names(bootstrapScreen) &amp;lt;- bootstrapScreen$.id&#xA;bootstrapScreen$.id &amp;lt;- NULL&#xA;round(bootstrapScreen,4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="500" OwnerDisplayName="Zach" LastActivityDate="2011-10-18T17:31:07.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2195" PostTypeId="2" ParentId="2191" CreationDate="2011-10-18T18:42:59.093" Score="1" Body="&lt;p&gt;What you are describing is &lt;a href=&quot;http://en.wikipedia.org/wiki/Momentum_investing&quot; rel=&quot;nofollow&quot;&gt;momentum investing&lt;/a&gt;.  It is typically done in two steps:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Compute a momentum statistic from past prices/returns.&lt;/li&gt;&#xA;&lt;li&gt;Compare momentum statistics across all equities in your universe.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Step 1 is typically done using a moving average of past returns (it is wrong to use prices because splits and dividends will skew the results).  This can be done using a simple moving average, or using &lt;a href=&quot;http://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average&quot; rel=&quot;nofollow&quot;&gt;exponentially weighted moving averages&lt;/a&gt;.  In either case, your results will depend strongly on the window/half-life of the moving average.  For equity momentum, most studies use momentum in the last 6-12 months excluding the most recent month or so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Step 2 may be done either using an &lt;em&gt;ad hoc&lt;/em&gt; sorting rule (&lt;a href=&quot;http://www.e-m-h.org/JeTi93.pdf&quot; rel=&quot;nofollow&quot;&gt;Jegadeesh and Titman (1993)&lt;/a&gt; use top/bottom deciles) or with the aid of a risk model.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-10-18T18:42:59.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2196" PostTypeId="1" CreationDate="2011-10-18T20:08:17.030" Score="4" ViewCount="2278" Body="&lt;p&gt;I'm looking for histocial weights of S&amp;amp;P 500 constituents. I have access to a Bloomberg terminal. Any thoughts on how/where I might calculate/find these data?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. I'm looking for as much data as possible but at least five consecutive years within the last 15 years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.P.S. Monthly data.&lt;/p&gt;&#xA;" OwnerUserId="1112" LastActivityDate="2011-10-19T01:52:29.397" Title="Historical S&amp;P 500 Stock Weights" Tags="&lt;data&gt;&lt;market-data&gt;" AnswerCount="0" CommentCount="7" ClosedDate="2011-10-21T10:43:08.223" ContentLicense="CC BY-SA 3.0" />
  <row Id="2199" PostTypeId="1" CreationDate="2011-10-19T03:09:22.740" Score="8" ViewCount="950" Body="&lt;p&gt;I was wondering if anyone could help me with the instantaneous forward rate equation for a Black-Karasinski interest rate model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was also after the Black-Karasinski Bond Option Pricing Formula.&lt;/p&gt;&#xA;" OwnerUserId="1549" LastEditorUserId="467" LastEditDate="2011-10-19T07:41:01.950" LastActivityDate="2011-10-20T13:47:28.750" Title="What is the forward rate for a Black-Karasinski interest rate model?" Tags="&lt;interest-rates&gt;&lt;modeling&gt;&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2201" PostTypeId="1" CreationDate="2011-10-19T17:04:26.990" Score="4" ViewCount="323" Body="&lt;p&gt;Hi I am looking for a clear explanation of T statistics concept. Especially in quantitative equity portfolio management context, what does T statistics of monthly Information Coefficient for one factor indicate? How can I tell if it is significant, and if it is, any useful information I could derive from that?&lt;/p&gt;&#xA;" OwnerUserId="1553" LastActivityDate="2011-10-19T17:04:26.990" Title="What does T statistics of Information Coefficient indicate?" Tags="&lt;time-series&gt;&lt;information&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2202" PostTypeId="1" AcceptedAnswerId="2203" CreationDate="2011-10-19T17:28:30.787" Score="15" ViewCount="2140" Body="&lt;p&gt;Since a market index is nothing more than a basket of stocks, you can create your own index by putting together stocks of your choice. The only difference is that you can trade options on major indexes unlike your custom index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I'm wondering if it's possible to use stocks and their options to replicate the option of a custom index, i.e. to closely match the profit/loss graph of a hypothetical option on that index. There are synthetic calls and puts on individual stocks, so I figured that it might be feasible to create synthetic calls and puts on a basket of stocks.&lt;/p&gt;&#xA;" OwnerUserId="1504" LastEditorUserId="1106" LastEditDate="2011-10-19T17:48:23.470" LastActivityDate="2013-04-19T17:48:00.430" Title="Can you replicate an option on an arbitrary basket of stocks?" Tags="&lt;options&gt;&lt;option-strategies&gt;&lt;index&gt;&lt;basket&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2203" PostTypeId="2" ParentId="2202" CreationDate="2011-10-19T17:44:13.400" Score="11" Body="&lt;p&gt;Interesting question.  Unfortunately for you, the answer is no, it cannot be done.  The principal difference between a basket of options and an option on the basket (or index) is correlation risk.  In fact, there is a systematic difference between the implied volatility of the basket and the (properly weighted) sum of implied volatilities on the components.  Trading this difference is known as dispersion trading (see &lt;a href=&quot;http://ssrn.com/abstract=1156620&quot; rel=&quot;nofollow noreferrer&quot;&gt;Deng (2008)&lt;/a&gt;).  You may also be interested in the answers to &lt;a href=&quot;https://quant.stackexchange.com/q/1515/1106&quot;&gt;this question&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the part of your question regarding synthetic replication of the option using the underlying (by which I assume you mean dynamic replication), this is only possible in theory.  In practice, the transaction costs are too large and the jump risk / discontinuity of trading prevents one from achieving perfect replication.  In fact, if it were so easy to replicate an option, there would be no reason to trade them.  It is all the more difficult to try to dynamically replicate an option on an entire basket of stocks.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2011-10-19T17:51:55.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2204" PostTypeId="2" ParentId="2199" CreationDate="2011-10-20T11:59:45.937" Score="4" Body="&lt;p&gt;Hi the forward rate equation is not dependent on the model it is calculated upon the prices of zero coupon bonds by the following equation :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;P(t,T)=exp{-\int_t^T f_t(u).du}&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have a continuum of zero coupon bond prices which are sufficiently smooth then you can deduce from it that :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f_0(T)=-\frac{\partial Ln(P(0,T))}{\partial T}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, I think that what you are really asking for, is what is the set of SDEs followed by those instantaneous forward rates under proper measure. I haven't done the calculations (it really bothers me) but I can indicae the following procedure,to wit  you have to reconcile HJM with BK, which are respectively given by :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d (ln r_t)= \kappa(\theta(t) - ln(r_t))dt +\sigma dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and :  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_t=f(0,t)+\int_0^t\sigma&amp;#39;(u,t)[\int_u^t\sigma&amp;#39;(u,s)ds]du+\int_0^t\sigma&amp;#39;(u,t)dW_u$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$df_t(u)=\sigma&amp;#39;(t,u)[\int_t^u\sigma&amp;#39;(t,s)ds]dt+\sigma&amp;#39;(t,u)dW_t$$&#xA;and $r_t=f(t,t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway there is no analytical (to my knowledge) Bond and Bond Option prices in this model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way that there are finite explosion time problems in this model. You should try Hull &amp;amp; white model or CIR model if you want your rates to stay positive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best Regards&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="92" LastEditDate="2011-10-20T13:47:28.750" LastActivityDate="2011-10-20T13:47:28.750" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2205" PostTypeId="1" CreationDate="2011-10-20T15:21:43.627" Score="15" ViewCount="153171" Body="&lt;p&gt;We know that there are 2 types of risk which are systematic and unsystematic risk. Systematic risk can be estimate through the calculation of β in CAPM formula. But how can we estimate the unsystematic risk quantitatively? is there any formula or calculation that can be related to the measurement of unsystematic risk?&lt;/p&gt;&#xA;" OwnerUserId="1557" LastActivityDate="2019-03-27T13:15:48.360" Title="How to calculate unsystematic risk?" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;risk-models&gt;&lt;risk-premium&gt;" AnswerCount="12" CommentCount="4" FavoriteCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="2206" PostTypeId="2" ParentId="2205" CreationDate="2011-10-20T17:20:35.817" Score="10" Body="&lt;p&gt;I'm not sure about the &quot;CAPM formula&quot; that you are referring to. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume you are referring to the estimated coefficient of a regression of a security on a market portfolio. That is to say&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\beta_{security,market} = \frac{\sigma_{security,market}}{\sigma^2_{market}}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idiosyncratic risk is the portion of risk unexplained by the market factor. The value of $1 - R^2$ of the regression will tell you this proportion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Empirically, the idiosyncratic risk in a single-factor contemporaneous CAPM model with US equities is around 60-70%.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="35" LastEditDate="2012-06-21T18:22:43.397" LastActivityDate="2012-06-21T18:22:43.397" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2207" PostTypeId="1" AcceptedAnswerId="2483" CreationDate="2011-10-20T20:18:00.683" Score="20" ViewCount="2979" Body="&lt;p&gt;I am exploring de-noising and cleansing of covariance matrices via &lt;a href=&quot;http://en.wikipedia.org/wiki/Random_matrix&quot;&gt;Random Matrix Theory&lt;/a&gt;. RMT is a competitor to shrinkage methods of covariance estimation. There are various methods expressed usually by the names of the authors: &lt;a href=&quot;http://www.science-finance.fr/papers/dublin.pdf&quot;&gt;LPCB&lt;/a&gt;, &lt;a href=&quot;http://polymer.bu.edu/hes/articles/pgrags02.pdf&quot;&gt;PG+&lt;/a&gt;, and so on. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For each method, one can start by filtering the covariance matrix directly, or filter the correlation matrix and then covert the cleansed correlation matrix into a covariance matrix. My question involves the latter case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have noticed that when cleaning a correlation matrix that the resulting diagonal is not a diagonal of 1s (as one would expect to see in a correlation matrix).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question -- when constructing a cleansed covariance matrix by first filtering its corresponding correlation matrix, does one:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&quot;Fix&quot; the diagonals of the intermediate cleansed correlation matrix to a diagonal of 1s before finally converting it back to a covariance matrix? This seems to be the case with the PG+ method, but not the LPCB method.  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Or does one convert the cleansed correlation matrix to a covariance matrix and then fix the diagonal of the resulting covariance matrix to the diagonal of the original covariance matrix?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In both cases the trace is preserved.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-01-24T21:10:38.693" LastActivityDate="2020-05-27T07:12:40.547" Title="Cleansing covariance matrices via Random matrix theory" Tags="&lt;correlation&gt;&lt;risk-models&gt;&lt;covariance&gt;&lt;random-matrix-theory&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="2208" PostTypeId="2" ParentId="1951" CreationDate="2011-10-20T22:17:24.173" Score="2" Body="&lt;p&gt;Here are some papers:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1524193&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1524193&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.rmi.nus.edu.sg/conferences/RMC2008/submission/papers/33.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.rmi.nus.edu.sg/conferences/RMC2008/submission/papers/33.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.iaeng.org/publication/WCE2011/WCE2011_pp433-438.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.iaeng.org/publication/WCE2011/WCE2011_pp433-438.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="392" LastActivityDate="2011-10-20T22:17:24.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2209" PostTypeId="1" AcceptedAnswerId="2211" CreationDate="2011-10-21T01:05:54.643" Score="5" ViewCount="717" Body="&lt;p&gt;I am tweaking a covered call algorithm. The short leg consists of out of the money call options. The goal is to collect the tim premium, but an equally favorable circumstance is when the call decreases in value due to the lower price of the underlying asset in the normal course of market fluctuations. The short leg can easily go from a 10% gain to a 60% gain because it shifts further out of the money, at this point the price decrease becomes much slower, as it will take several more standard deviations to take the 60% gain to an 80% gain, this is where I am contemplating closing the short leg in favor of selling the call that is now closer to the money.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any caveats of doing this? My risk profiles do not intuitively show me the caveats of rolling the short leg in the middle of a covered call.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Upon getting the second set of short options (and closing the first set of short options) , they will still be covered by a long leg. If price decreases, the short options approach $0 (100% gain), if price stagnates, the short options approach  (100% gain), if price increases I will collect only the time premium from the short options and my maximum gain with the long leg is limited.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I missing something? Insight appreciated&lt;/p&gt;&#xA;" OwnerUserId="1453" LastEditorUserId="1106" LastEditDate="2011-10-24T01:03:48.137" LastActivityDate="2011-10-24T01:03:48.137" Title="In a covered call strategy, should I hold the call or sell/roll if the delta becomes too small?" Tags="&lt;options&gt;&lt;equities&gt;&lt;option-strategies&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2210" PostTypeId="1" AcceptedAnswerId="2217" CreationDate="2011-10-21T01:51:10.837" Score="8" ViewCount="349" Body="&lt;p&gt;I've skimmed through more than one ETF prospectus trying to find the procedure for clamping losses at the limits of an ETF, and so far, no help.   Has anyone found a description of the &quot;clamping&quot; procedure?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if the S&amp;amp;P drops 35% in one day, how will Direxion's BGU (3X Bull ETF) &quot;clamp&quot; the loss to that 90% loss number that shows up in their prospectus?   I'm looking for some kind of outline of their plan/procedure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Page 146 of the &lt;a href=&quot;http://direxionshares.onlineprospectus.net/DirexionShares/MOB_library/MOB_data/LIB_SummaryProspectus/DirexionETFstatPro/DirexionETFstatPro.pdf&quot; rel=&quot;noreferrer&quot;&gt;Direxion ETF prospectus&lt;/a&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If the Fund’s benchmark moves more than 33% on a given trading day in&#xA;  a direction adverse to the Fund, you would lose all of your money.&#xA;  &lt;strong&gt;Rafferty will attempt to position the Fund’s portfolio to ensure that&#xA;  the Fund does not lose more than 90% of its net asset value on a given&#xA;  day.&lt;/strong&gt; The cost of such downside protection will be limitations on the&#xA;  Fund’s gains. As a consequence, the Fund’s portfolio may not be&#xA;  responsive to Index gains beyond 30% in a given day. For example, if&#xA;  the Index were to gain 35%, the Fund might be limited to a daily gain&#xA;  of 90% rather than 105%, which is 300% of the Index gain of 35%.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Again, I'm looking for a description of &lt;strong&gt;how&lt;/strong&gt; they expect to hold the loss to 90%.   A second, but related question is, does this &quot;clamp procedure&quot; start kicking-in when the S&amp;amp;P drops 10%, or even 5%?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit (10/24/2011) =========================&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After a little digging, it looks like BGU is currently made-up of about 9% in cash/treasuries, 4% in the Russell 1000 Index, and the rest (87%) in swaps.   So, they don't have to react to the market to hold the loss to the &quot;90% value&quot;.  And, this scheme is always active (assuming they keep similar percentages on a daily basis).&lt;/p&gt;&#xA;" OwnerUserId="392" LastEditorUserId="392" LastEditDate="2011-10-25T01:25:59.310" LastActivityDate="2011-10-25T01:25:59.310" Title="What procedure do leveraged ETFs use to limit losses?" Tags="&lt;etf&gt;&lt;rebalancing&gt;&lt;leverage&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2211" PostTypeId="2" ParentId="2209" CreationDate="2011-10-21T13:07:13.653" Score="1" Body="&lt;p&gt;&quot;I am contemplating closing the short leg in favor of selling the call that is now closer to the money. Are there any caveats of doing this?&quot;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The biggest caveat is the obvious issue of whip-saw.  Where right after you roll down, the market turns up again.&lt;/li&gt;&#xA;&lt;li&gt;Also, if you are starting with an out of the money call (delta &amp;lt; 50), and the stock declines, you will likely be losing more on the covering stock than you will be making in premium collection on the short call.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You can get as complex as you like by considering vol and theta, etc...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your choices in this strategy basically are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;close the short call option&lt;/li&gt;&#xA;&lt;li&gt;roll in the same month&lt;/li&gt;&#xA;&lt;li&gt;roll to a future month.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The easiest way to compare these options, and make a decision, is to look at the holding period return implied by collecting the premium for these options, and then choosing the one with the highest annualized return.  Then consider the risk as a tie-breaker.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you might roll down in the same month,  and the implied annual return is 24%, for example, and the alternative is rolling out to the next month at the same strike, with an annualized return of 29%.  (assuming that both strikes are within your risk criteria) This lets you make an apples-to-apples comparison of your choices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a practical matter, (and depending on the term structure of volatility and the time to expiration ) often rolling out to a later month is the optimal choice, given a specific set of risk constraints.&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-10-21T13:07:13.653" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2212" PostTypeId="1" AcceptedAnswerId="2214" CreationDate="2011-10-21T22:33:47.263" Score="14" ViewCount="784" Body="&lt;p&gt;Is there any published research on estimating the beta of a security with respect to one or more risk factors via Bayesian networks?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to see if this is a promising angle of research.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1106" LastEditDate="2011-10-22T23:48:20.757" LastActivityDate="2011-10-23T00:01:29.117" Title="Has any research used Bayesian networks to estimate risk factor betas?" Tags="&lt;statistics&gt;&lt;r&gt;&lt;machine-learning&gt;&lt;risk-models&gt;&lt;factor-models&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2213" PostTypeId="2" ParentId="613" CreationDate="2011-10-22T21:30:55.723" Score="10" Body="&lt;p&gt;If you are serious about performance and flexibility, you have to take a look at &lt;a href=&quot;http://cran.r-project.org/web/packages/data.table/index.html&quot;&gt;data.table&lt;/a&gt; package in R. Here is the &lt;a href=&quot;http://crantastic.org/packages/data-table&quot;&gt;crantastic review&lt;/a&gt;. It is lighting fast! I think this is the best package addressing performance and memory issues. &lt;/p&gt;&#xA;" OwnerUserId="1561" LastActivityDate="2011-10-22T21:30:55.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2214" PostTypeId="2" ParentId="2212" CreationDate="2011-10-23T00:01:29.117" Score="7" Body="&lt;p&gt;One relevant paper is:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Shenoy, C. and Shenoy, P.P., Bayesian network models of portfolio risk and return, 1999. &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.142.5138&amp;amp;rep=rep1&amp;amp;type=pdf&quot;&gt;&lt;strong&gt;PDF&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1562" LastActivityDate="2011-10-23T00:01:29.117" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2217" PostTypeId="2" ParentId="2210" CreationDate="2011-10-23T15:41:27.557" Score="3" Body="&lt;p&gt;It depends a lot on the structure of the ETF, it could be :&#xA;* In the &quot;terms and conditions&quot; of the (highly possible) total return swap of the fund&#xA;* Portfolio insurance&#xA;* Option combination (or cap &amp;amp; floor)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think it's in the swap details, already saw that a few times.&lt;/p&gt;&#xA;" OwnerUserId="1181" LastActivityDate="2011-10-23T15:41:27.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2218" PostTypeId="1" CreationDate="2011-10-23T16:50:42.773" Score="15" ViewCount="18201" Body="&lt;p&gt;The term &lt;em&gt;high frequency trading&lt;/em&gt; has been used quite often recently to refer to trading using real-time tick data (or data aggregated to few seconds) and having an intra-day holding period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How are medium and low frequency trading strategies defined? Do they use real-time data, or do they use end-of-day (OHLC, volume) data?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, why is there a lot more hype regarding high frequency trading?  I understand that strategies like statistical arbitrage require high frequency data. Are there no medium/low frequency strategies that are of similar interest to investors (in terms of number of articles, white papers, and blogs) or is &quot;making money fast&quot; part of the reason?&lt;/p&gt;&#xA;" OwnerUserId="1568" LastEditorUserId="1106" LastEditDate="2011-10-23T17:23:10.113" LastActivityDate="2017-02-03T12:01:38.323" Title="What is a medium to low frequency trading strategy and why is it less hyped?" Tags="&lt;automated-trading&gt;&lt;quant-trading-strategies&gt;&lt;high-frequency&gt;" AnswerCount="3" CommentCount="8" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="2219" PostTypeId="2" ParentId="2182" CreationDate="2011-10-23T19:49:34.113" Score="4" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Which is/are the most extensible?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;RapidMiner and R. Besides, RapidMiner offers extensions for seamlessly integrating R and Weka, hence can combine the power and extensibility of all three platforms within RapidMiner. And you can download RapidMiner and its extension for R and Weka for free.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Which is the most efficient in terms of a minimal learning curve&#xA;  while providing a meaningful degree of flexibility and performance?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;RapidMiner. RapidMiner provides an easy to use graphical user interface, a built-in online tutorial, built-in wizzards, and many free videos to get you started quickly:&#xA;&lt;a href=&quot;http://www.RapidMiner.com/&quot; rel=&quot;nofollow&quot;&gt;http://www.RapidMiner.com/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Any of these tools really limited in terms of customization and worth avoiding? &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;All mentioned tools can be customized.&lt;/p&gt;&#xA;" OwnerUserId="1570" LastActivityDate="2011-10-23T19:49:34.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2220" PostTypeId="2" ParentId="2182" CreationDate="2011-10-23T21:07:02.050" Score="4" Body="&lt;p&gt;The real contenders for a desktop based tool are RapidMiner and R. If you like Windows or Mac, you will like RapidMiner. If you like command line or Linux, you will like R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would say RapidMiner has a flatter learning curve. The previous lecturer in the course I teach used R and the students (MBAs) complained about the learning curve. They did not in my class with RapidMiner. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the server side, you can add Python as a general purpose machine learning language.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;RapidMiner also has the RapidAnalytics server, as well as the Radoop extension that uses Hadoop for big data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of extensibility, you can extend RapidMiner easily using Groovy (Java scripting language) as an operator, or Java itself (as an extension). &lt;/p&gt;&#xA;" OwnerUserId="74" LastActivityDate="2011-10-23T21:07:02.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2221" PostTypeId="2" ParentId="1683" CreationDate="2011-10-24T03:50:34.107" Score="5" Body="&lt;p&gt;Just saw this question and would like to bring to attention that QuantNet has released its 2011 ranking of MFE programs in North America&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.quantnet.com/mfe-programs-rankings/&quot; rel=&quot;noreferrer&quot;&gt;http://www.quantnet.com/mfe-programs-rankings/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Full disclosure: I run QuantNet.&lt;/p&gt;&#xA;" OwnerUserId="43" LastEditorUserId="43" LastEditDate="2011-10-24T17:14:01.747" LastActivityDate="2011-10-24T17:14:01.747" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2222" PostTypeId="2" ParentId="1683" CreationDate="2011-10-24T06:01:26.517" Score="6" Body="&lt;p&gt;A different point of view: &lt;a href=&quot;http://www.advancedtrading.com/articles/209102204&quot; rel=&quot;noreferrer&quot;&gt;The Top 10 Quant Schools, According to the Street&lt;/a&gt; I personally like a survey whose board members have no other incentives and conflicting interests with the schools they evaluate. &lt;/p&gt;&#xA;" OwnerUserId="1455" LastActivityDate="2011-10-24T06:01:26.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2224" PostTypeId="1" AcceptedAnswerId="2227" CreationDate="2011-10-24T08:41:34.647" Score="8" ViewCount="262" Body="&lt;p&gt;For most financial instruments we can go long or short and make a bet on the price. In the case of options we can bet on derivatives of price and other factors (e.g., interest rates).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an instrument or a strategy that can benefit from changes in trading volume, besides buying and selling equity in an exchange?&lt;/p&gt;&#xA;" OwnerUserId="1572" LastEditorUserId="1106" LastEditDate="2011-10-24T14:11:58.073" LastActivityDate="2011-10-24T17:19:52.503" Title="Are there financial instruments that make a bet on traded volume instead of price or its derivatives?" Tags="&lt;derivatives&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2225" PostTypeId="2" ParentId="1947" CreationDate="2011-10-24T08:50:48.720" Score="2" Body="&lt;p&gt;you could perhaps cluster the information in a candle stick manner and bin the price data into high, low and closing, instead of throwing some data out and keeping only its closing price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the high, low and closing prices you are able to make 3 separate estimates with regards to Profit and lost.  Obviously with a long position, profit calculated by entering at a high price while using a low price for its exit would be the pessimistic estimate of profit.&lt;/p&gt;&#xA;" OwnerUserId="1572" LastActivityDate="2011-10-24T08:50:48.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2226" PostTypeId="2" ParentId="1895" CreationDate="2011-10-24T09:17:46.663" Score="1" Body="&lt;p&gt;anomalies  like arbitrage tend to disappear once exploitation increases, once an anomaly is published if the underlying process is stationary it will get exploited, if it is non-stationary it will cease to be observed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What about anomalies that are not published, I guess we could use the analogy of the malingering employee who skips work to play golf, lands a hole in one and has no one to tell it to.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have an exploitable anomaly that has remained that way for a long time, this is your forum.&lt;/p&gt;&#xA;" OwnerUserId="1572" LastActivityDate="2011-10-24T09:17:46.663" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2227" PostTypeId="2" ParentId="2224" CreationDate="2011-10-24T10:56:26.523" Score="4" Body="&lt;p&gt;No, there isn't, there is no valuation model where volume plays a role, thus you can't make money from volume.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But you can buy NYSE-Euronext stocks, they will benefit from increased volume in the owned exchanges, that is if you hedge everything else that could make NYSE-Euronext stocks move.&lt;/p&gt;&#xA;" OwnerUserId="1181" LastActivityDate="2011-10-24T10:56:26.523" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2228" PostTypeId="1" AcceptedAnswerId="2229" CreationDate="2011-10-24T12:12:56.727" Score="17" ViewCount="15261" Body="&lt;p&gt;I'm trying to wrap my head around pricing a Constant Maturity Swap (CMS). Let's imagine the following deal: 6m LIBOR in one direction, 10y swap rate in the other. The discount curve is derived from OIS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Naively I would just price this by taking the difference between the present value of cash flows from the forward 6m LIBOR rates and the present value of the cash flows from the forward 10y swap rates. I assume the cash flow from the swap leg is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;10y swap rate * notional&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But apparently this is not right, as quoting from &lt;a href=&quot;http://www.fincad.com/derivatives-resources/wiki/cms-in-libor.aspx&quot;&gt;here&lt;/a&gt; &quot;the expected swap rate $\not=$ the forward swap rate&quot; and this is the origin of the famous convexity adjustment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But why does the expected rate not equal the forward rate and how might one compute the difference?&lt;/p&gt;&#xA;" OwnerUserId="1573" LastEditorUserId="1106" LastEditDate="2011-10-24T13:52:16.520" LastActivityDate="2011-10-24T15:44:53.563" Title="What is the reason for the convexity adjustment when pricing a constant maturity swap (CMS)?" Tags="&lt;interest-rates&gt;&lt;swaps&gt;&lt;pricing&gt;&lt;cms&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="2229" PostTypeId="2" ParentId="2228" CreationDate="2011-10-24T14:37:17.913" Score="11" Body="&lt;p&gt;CMS adjustments in single curve context can be roughly explained if you consider a CMS swaplet by the fact that there is a single payment at the CMS rate at a single date and not on the whole strip of the underlying CMS tenor schedule. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you are trying to hedge a CMS swaplet with the corresponding swap of CMS tenor length (with correct naïve nominal adjustment) then you end at the payment date with a swap that has a P&amp;amp;L different from the coupon you have to pay that day. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Theoretically, though, you can statically hedge this effect from the very beginning of the trade by using a &quot;continuous&quot; portfolio of swaptions. In this regard I strongly recommend that you read the excellent exposition of P. Hagan &quot; Convexity Conundrums : Pricing CMS Swap, Caps and Floors&quot; freely available on he web. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the OIS - Libor discounting effect, it is (IMO) a second (or third) order effect and doesn't differ from the single curve framework in a perceptible way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best regards&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="92" LastEditDate="2011-10-24T15:44:53.563" LastActivityDate="2011-10-24T15:44:53.563" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2230" PostTypeId="2" ParentId="2224" CreationDate="2011-10-24T17:19:52.503" Score="4" Body="&lt;p&gt;I can think of at least two problems with such a security, should one be devised:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;It is probably unhedgeable.  That means if you go long this contract, the market-maker is short unless he can hedge that risk away somehow (or sell it to someone else).&lt;/li&gt;&#xA;&lt;li&gt;Unless it is on something large like the volume traded on the NYSE in one day, such a contract may be prone to manipulation.  Suppose I buy such a contract on APPL and it gets close to hitting the strike on the contract.  I could send a large block order to push it over the top.  It's harder to do against the entire market, but with derivatives, it may be possible.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;But if, somehow, should such a contract ever be devised, brokers, who are naturally long volume (due to the positive correlation with commissions), may be interested in selling time premium to hedges some of their risk. &lt;/p&gt;&#xA;" OwnerUserId="1563" LastActivityDate="2011-10-24T17:19:52.503" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2231" PostTypeId="1" AcceptedAnswerId="2234" CreationDate="2011-10-24T17:51:33.303" Score="14" ViewCount="5999" Body="&lt;p&gt;Estimation of model-free implied volatility is highly dependent upon the extrapolation procedure for non-traded options at extreme out-of-the-money points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://ssrn.com/abstract=880459&quot;&gt;Jiang and Tian (2007)&lt;/a&gt; propose that the &lt;em&gt;slope&lt;/em&gt; at the lowest/highest moneyness traded point from a cubic spline interpolation be used to extrapolate Black-Scholes implied volatilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rfs.oxfordjournals.org/content/22/3/1311.abstract&quot;&gt;Carr and Wu (2008)&lt;/a&gt; propose that the Black-Scholes implied volatility be held fixed at the &lt;em&gt;level&lt;/em&gt; of the lowest/highest moneyness traded point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Procedures also differ as to whether the extrapolation is done in volatility/strike space (as the papers cited above do) or volatility/delta space (as suggested by &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S0378426601002278&quot;&gt;Bliss and Panigirtzoglou (2002)&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which of these procedures leads to the most accurate model-free implied volatilities when the range of available strikes is fairly limited?  Are there other extrapolation procedures which may yield better results?&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-10-24T19:00:46.627" LastActivityDate="2017-10-09T18:21:33.190" Title="How to extrapolate implied volatility for out of the money options?" Tags="&lt;options&gt;&lt;research&gt;&lt;black-scholes&gt;&lt;implied-volatility&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2232" PostTypeId="1" AcceptedAnswerId="2233" CreationDate="2011-10-24T20:04:47.840" Score="8" ViewCount="738" Body="&lt;p&gt;When doing cointegration tests should I use the adjusted close price or just close price for the time series?&#xA;The dividend of each stock is on different dates and can cause jumps in the data.&lt;/p&gt;&#xA;" OwnerUserId="1463" LastEditorUserId="1106" LastEditDate="2011-10-24T20:12:24.003" LastActivityDate="2011-10-24T20:12:28.387" Title="Should cointegration be tested using close or adjusted close prices?" Tags="&lt;cointegration&gt;&lt;returns&gt;&lt;pairs-trading&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2233" PostTypeId="2" ParentId="2232" CreationDate="2011-10-24T20:12:28.387" Score="6" Body="&lt;p&gt;Such tests should &lt;strong&gt;always&lt;/strong&gt; be done using &lt;em&gt;adjusted&lt;/em&gt; prices.  In fact, ideally, you should reconstruct your own price series using the total returns series.  To see this, suppose you have a 10:1 split rather than a relatively small cash dividend.  Then it is clear that the cointegration relationship can only hold with respect to the adjusted series.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-10-24T20:12:28.387" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2234" PostTypeId="2" ParentId="2231" CreationDate="2011-10-24T21:22:38.150" Score="8" Body="&lt;p&gt;Well as far as I know it is a really hard but interesting question. Asymptotics of smile in the strike direction is not known in a model free way as far as I know. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think I can remember that nevertheless you have upper and lower bounds if you know something about the underlying dynamics and especially the first moment of explosion. I can't remember the correct reference I have to look after it when I can.&#xA;Edit :&#xA;Here is the reference I was looking for &lt;a href=&quot;http://www.math.uchicago.edu/~rl/BFL2008v5.pdf&quot;&gt;Benaïm, Friz and Lee&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise, I haven't read the Car Wu article you mention but all that I can tell you is that holding volatilty fixed at the level of highest OTM strike traded option simply doesn't work in the context of interest rates where asymptotics in strike of implied vols are used (and usefull at strikes much higher than higest level of traded interest options), especially in the context of CMS convexity adjustements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway for the strikes beneath the traded area, the interpolation method question still demands arbitrage free interpolation, to do so I (again) think I can remember that you can find some constraints to be satisfied by any scheme in order for it to be arbitrage free, even if in my experience the resulting arbitrage you get from simpler method are useless because way to narrow. So it is more an intellectual matter (except for some particular cases which usually last for short time window) than a real practical issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit :&#xA;Here is a paper with constraints for arbitrage free interpolation methods, by &lt;a href=&quot;http://www.hiram-finance.eu/upl/interpolation.pdf&quot;&gt;Kahalé&lt;/a&gt;&#xA;but I think there are many other contributions aswell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, you can extend the question in small time and long time asymptotics aswell where I think it is a really active area of research and a very interesting (and technical) matter. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best regards.&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="92" LastEditDate="2011-10-25T09:30:53.307" LastActivityDate="2011-10-25T09:30:53.307" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2236" PostTypeId="2" ParentId="1424" CreationDate="2011-10-25T01:22:46.983" Score="3" Body="&lt;p&gt;It isn't clear from this post or your last post what data you want and what you want it for. The only thing you are going to get permission to distribute is the higher level data feeds like EOD data, or last sale (probably can't offer history).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Exchanges typically have this information available on their websites, for instance &lt;a href=&quot;http://www.nasdaqtrader.com/Trader.aspx?id=DPUSdata#db&quot; rel=&quot;nofollow&quot;&gt;NASDAQ Basic&lt;/a&gt; pricing. If you want to do something like put Level 2 data up on a website for anyone to look at I think you are going to find it hard to get someone to give you a license to do that. Any exchange that would give you a license would do it in a way that would put you out of business before the ink on the contract was dry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to be in the data vending business, sign some agreements with the exchanges, hire some sales people and get selling.&lt;/p&gt;&#xA;" OwnerUserId="373" LastActivityDate="2011-10-25T01:22:46.983" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2237" PostTypeId="2" ParentId="1683" CreationDate="2011-10-25T07:55:13.187" Score="5" Body="&lt;p&gt;&lt;a href=&quot;http://www.mines-paristech.fr/Actualites/PR/EMP-ranking.html&quot; rel=&quot;noreferrer&quot;&gt;http://www.mines-paristech.fr/Actualites/PR/EMP-ranking.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="134" LastActivityDate="2011-10-25T07:55:13.187" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2238" PostTypeId="1" CreationDate="2011-10-25T17:40:00.357" Score="13" ViewCount="4057" Body="&lt;p&gt;By &quot;exotic&quot; I mean anything that is not a plain vanilla swap, swaption, cap or floor. Also any IR hybrids if appropriate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Possible examples would be:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;CMS and CMS spread options&lt;/li&gt;&#xA;&lt;li&gt;Multi-callable swaps&lt;/li&gt;&#xA;&lt;li&gt;Range accruals and callable range accruals.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Any thoughts much appreciated.&lt;/p&gt;&#xA;" OwnerUserId="1573" LastEditorUserId="1573" LastEditDate="2011-10-28T08:40:31.117" LastActivityDate="2015-08-27T12:55:12.200" Title="What are the most common/popular exotics in the interest rate markets these days?" Tags="&lt;trading&gt;&lt;interest-rates&gt;&lt;market&gt;&lt;exotics&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2239" PostTypeId="1" CreationDate="2011-10-25T18:03:23.463" Score="8" ViewCount="530" Body="&lt;p&gt;What is the consensus on which risk measure to use in measuring portfolio risk? I am researching what is the best risk measure to use in a portfolio construction process for a long/short option-free equity portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the late '90s thru today, it seems that VaR is the dominant risk measure but is losing ground.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/1467-9965.00068/abstract&quot; rel=&quot;nofollow&quot;&gt;Artzner et al.&lt;/a&gt; (1997) suggested properties for a risk measure to be &lt;a href=&quot;http://en.wikipedia.org/wiki/Coherent_risk_measure&quot; rel=&quot;nofollow&quot;&gt;coherent&lt;/a&gt;: exhibit sub-additivity, translation invariance, positive homogeneity, and monotonicity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;VaR is not a coherent measure whereas conditional value-at-risk (CVaR) or expected shortfall meets these normative requirements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, Rama Cont et al (2007) argue in &quot;&lt;a href=&quot;http://www.cmap.polytechnique.fr/~rama/papers/robustrisk.pdf&quot; rel=&quot;nofollow&quot;&gt;Robustness and sensitivity analysis of risk measurement procedures&lt;/a&gt;&quot; that VaR produces more robust procedure for risk measurement. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One would think the debate is settled then. More recent risk research from &lt;a href=&quot;http://www.iqanalytics.com/prmia/newsletter2/JoseOttawa_09.pdf&quot; rel=&quot;nofollow&quot;&gt;Jose Garrido&lt;/a&gt; (2009) suggests that new families of risk measures be defined such as &quot;complete&quot; and &quot;adapted&quot; which addresses the fact that CVaR does not account for extreme losses with low frequency, and that VaR only accounts for loss severity as opposed to frequency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has there been further empirical research that argues for whether to use VaR or CVaR (or some other measure) in the construction of optimal portfolios?&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-10-26T14:26:40.087" LastActivityDate="2011-10-26T14:26:40.087" Title="Which is a more appropriate choice of risk measurement in a utility function, CVaR or VaR?" Tags="&lt;risk-management&gt;&lt;var&gt;&lt;coherent-risk-measure&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2240" PostTypeId="2" ParentId="2218" CreationDate="2011-10-25T18:42:46.230" Score="-3" Body="&lt;p&gt;A medium to low frequency trading strategy would be one with low latency (14.8 milliseconds) but a fewer number of intra-day trades (300 vs. thousands). &lt;/p&gt;&#xA;" OwnerUserId="1580" LastActivityDate="2011-10-25T18:42:46.230" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2241" PostTypeId="1" CreationDate="2011-10-25T18:51:43.030" Score="12" ViewCount="951" Body="&lt;p&gt;Imagine that you have the fastest connection to the exchange (receive quotes 1 ms earlier than everyone else) for both stocks and derivatives.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would you benefit from this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course almost any strategy would work better on a faster connection, but I'm looking for strategies that:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;will only work on the fastest connection (useless/doesn't work on an average connection)&lt;/li&gt;&#xA;&lt;li&gt;are as simple as possible&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Links to certain strategies are appreciated.&lt;/p&gt;&#xA;" OwnerUserId="1337" LastEditorUserId="1106" LastEditDate="2011-10-25T19:37:44.437" LastActivityDate="2011-10-27T16:32:07.153" Title="What strategy would benefit most from having the fastest connection to the exchange?" Tags="&lt;trading&gt;&lt;automated-trading&gt;&lt;high-frequency&gt;&lt;latency&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2242" PostTypeId="2" ParentId="2231" CreationDate="2011-10-25T18:52:16.273" Score="9" Body="&lt;p&gt;At strikes distant from the forward value, pretending that options &lt;em&gt;have&lt;/em&gt; some meaningful implied volatility gets kind of silly.  Options really have prices (both bids and offers), and we all just translate that to volatility because doing so provides a convenient normalization.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just to take one example, discrete price quoting completely obfuscates the volatility value (as opposed to intrinsic value) of deep options.   Using the offer price, or even the midpoint price of an exchange traded option automatically sends implied vols to infinity just because no is allowed to offer the option at less than a tick.  Is the implied vol really meaningful in that case?  Not to me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, since far from the money options are rarely quoted or traded, it might well make more sense to consider the psychology of their quotes rather than some model.  A trader will quote that option based essentially on what he expects the hedges to cost him, plus a margin corresponding to how much he likes you.  With that as the price consideration, what are you willing to infer about implied volatilities?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, we all find ourselves using models that end up exploring deep regions of the state space so at some level one ends up making an assumption about deep vols.  That usage is by definition in the context of a model.  But since you ask for model-free implied volatilities, I have to pose the question: for what purpose?&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2017-10-09T18:21:33.190" LastActivityDate="2017-10-09T18:21:33.190" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="2243" PostTypeId="2" ParentId="2218" CreationDate="2011-10-25T19:29:37.557" Score="11" Body="&lt;p&gt;This answer summarizes some of my comments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;HFT is certainly a very hot topic these days, but it's hard to point to any one reason. A large part of it is the mystery and the profits, but also part of it is the relative novelty. Note that there is no lack of papers about medium and low frequency strategies, it's just that they are not labeled as such. Medium and low frequency strategies had their day in the limelight back in the early to mid 2000s.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Medium/low frequency strategies, to name just a few, include momentum, reversal, earnings quality (accruals), post-earnings announcement drift, (low) volatility effect, as well as options strategies such as dispersion, volatility risk premium and futures/FX strategies such as the carry trade, momentum (again). So you see, there is no one type of medium/low frequency strategy, but most HFT strategies are relatively similar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to how &quot;high&quot; frequency must be to be considered high frequency, opinions tend to differ on this point (see &lt;a href=&quot;https://quant.stackexchange.com/q/310/1106&quot;&gt;earlier question&lt;/a&gt;), but I doubt most participants would label a trading strategy which must execute within a second and holds for a day to be &quot;low frequency.&quot; In fact, it may not be very high or ultra high, but most investment managers would broadly consider it to be &quot;mid-to-high&quot; frequency. Some surveys show (see &lt;a href=&quot;https://quant.stackexchange.com/questions/310/how-high-is-the-frequency-in-hft/315#315&quot;&gt;Shane's answer&lt;/a&gt;) a significant minority of managers (about 15%) consider even a week holding period to be high frequency. Back in the early days of academic research, high frequency was anything using daily (rather than monthly) close data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for data input, most low frequency strategies use daily or even less frequent data.  Although it is hard to define, IMO medium frequency requires intra-day data for execution, but only at the point at which market microstructure can be ignored (generally 5-15 minutes, depending on liquidity).  Anything which &lt;em&gt;requires&lt;/em&gt; data at a frequency lower than 5 minutes &lt;em&gt;must necessarily&lt;/em&gt; take microstructure into account, and that qualifies it as high frequency.  As an aside, I believe that the myriad of additional issues that arise when dealing with tick data make it entirely not worth the trouble for anything but truly high frequency strategies.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2011-10-26T21:31:37.873" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2244" PostTypeId="2" ParentId="1306" CreationDate="2011-10-26T02:46:35.940" Score="2" Body="&lt;p&gt;I would create separate estimates for volume and choice of debt instrument. There are tools to estimate these simultaneously but I do not see a compelling advantage here. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume the volume is conditional on the choice of debt issuance so you might start by predicting choice of debt issuance and use this as an input to the volume model. The volume model would have a dummy variable associated with the type of debt issuance (you need k-1 dummy variables where 'k' is the number of debt issuance types). You could choose to allocate the probabilities across each dummy variables, or predict the volume conditional on the type of debt issuance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For volume, there is a broad variety of regression models and ways to proceed. I will illustrate a conventional approach:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Develop hypotheses on which variables/factors drive your dependent variable. &#xA;2) Consider normalizing your variables (z-scores).&#xA;3) Identify interactions amongst variables - particularly economic variables. &#xA;4) Add dummy variables to represent covenants. &#xA;5) Perform variable selection if necessary. &#xA;6) Train a model and validate on a hold-out population to guard against over-fitting. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note there are quite a few details in the process : missing imputation, outlier treatment,  variable selection, seasonal &amp;amp; ARCH effects in traded volume, and functional form specification that are beyond the scope of this post.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It may be preferable to model volume for each type or segment debt issuance -- for example, I imagine US treasuries have the most volume traded when high-yield bond markets are frozen (flight to safety). Also, the model dynamics may vary based on the economic state variables. If that is the case, consider a regime switching model such as a dynamic linear model (for continuous states) or hidden markov model (for discrete states).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To estimate the probability of a particular debt instrument a multinomial model would work - so would k-means clustering, CART classification, SVM classification, or a variety of other tools. You could make a more informed decision among these if you had some theory relating attributes to your dependent variables.  In the absence of such a theory, an empirical examination informed by your hypotheses would likely reveal some insights.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will also want to consider the cost of mis-classification as you evaluate the confusion matrix from your classification model and tune this parameter in your classification model.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-10-26T14:17:15.603" LastActivityDate="2011-10-26T14:17:15.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2245" PostTypeId="2" ParentId="2239" CreationDate="2011-10-26T11:08:46.277" Score="1" Body="&lt;p&gt;If your problem is an equity portfolio without options, then I would vote for variance.  This uses all the information rather than just looking at the tail.  In 1999 the semi-variance became popular because it showed very small risk for telecom, media and tech stocks.  They were just going up -- how is that risky?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equities are pretty close to having symmetric distributions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you add options into the mix, then I think wondering about VaR, CVaR, Omega, ... is a useful project.&lt;/p&gt;&#xA;" OwnerUserId="249" LastActivityDate="2011-10-26T11:08:46.277" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2246" PostTypeId="1" CreationDate="2011-10-26T13:02:27.487" Score="12" ViewCount="662" Body="&lt;p&gt;I have a correlation matrix $A$ for an equity market that is not positive definite. Higham (2002) proposes the Alternating Projections Method, minimising the weighted Frobenius norm $||A-X||_W$ where $X$ is the resulting positive definite matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How should one choose the weight matrix $W$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The easy alternative is to weigh them equally (W is an identity matrix), but if one has exposures to a portfolio, wouldn't it be natural to weigh the correlations according to your weights of exposure in the different assets, in order to alter their historical correlation less than for those assets you have little exposure in? Or is there a more natural choice?&lt;/p&gt;&#xA;" OwnerUserId="1583" LastEditorUserId="1106" LastEditDate="2011-11-25T15:00:56.180" LastActivityDate="2011-11-25T15:12:02.150" Title="What weights should be used when adjusting a correlation matrix to be positive definite?" Tags="&lt;correlation&gt;&lt;risk-models&gt;&lt;numerical-methods&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2247" PostTypeId="1" CreationDate="2011-10-26T15:32:03.593" Score="5" ViewCount="434" Body="&lt;p&gt;When does an Exchange Traded Fund (ETF) take out expenses (for example 0,3% on a yearly basis)? Does it happen daily, or once yearly or according to some other scheme? Where does it take them from?&lt;/p&gt;&#xA;" OwnerUserId="1581" LastActivityDate="2011-10-26T17:39:02.397" Title="When does an ETF take out expenses?" Tags="&lt;etf&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2250" PostTypeId="2" ParentId="2247" CreationDate="2011-10-26T17:39:02.397" Score="6" Body="&lt;p&gt;In general, it depends on the particular ETF, and should be checked in the prospectus, but one standard way (e.g. SPY) is to do it on a daily basis based on NAV published after the close. E.g. NAV per share = X$, so the expenses taken out would be X*0.03/(100*252). Again usually ETF's have cash component (with aggregated dividends etc), so there's no problem with taking out the expenses. &lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2011-10-26T17:39:02.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2252" PostTypeId="2" ParentId="2241" CreationDate="2011-10-27T00:29:56.277" Score="3" Body="&lt;p&gt;You're specifically interested in latency arbitrage (see, for instance, &lt;a href=&quot;http://blogs.wsj.com/marketbeat/2009/03/09/measuring-arbitrage-in-milliseconds/&quot; rel=&quot;nofollow&quot;&gt;this old WSJ article&lt;/a&gt;).  This strategy is strictly about being faster than everyone else.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can imagine any number of instances when this would matter (see this discussion of &lt;a href=&quot;http://www.quora.com/What-are-the-most-popular-strategies-used-in-high-frequency-trading&quot; rel=&quot;nofollow&quot;&gt;popular algos&lt;/a&gt;).  For instance, if you can detect another algorithm trading (this is known as a &quot;sniffer&quot;), and others also detect this, then you may be competing over tiny amounts returns in front-running these algos.  Most orderbooks are first-in, first-out, so your position in the queue matters.  Similarly, competing for returns in more traditional arbitrage across trading venues depends on speed: your faster connection between exchanges can mean the difference between earning the arbitrage return and not.&lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2011-10-27T00:29:56.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2253" PostTypeId="2" ParentId="2182" CreationDate="2011-10-27T02:16:34.003" Score="5" Body="&lt;p&gt;I spent some time (a month or so) using RapidMiner at the start of the year; then I added the R plugin, thinking R was just a library of stats functions. Then I learned more R, discovered it also comes with loads of machine learning functions, and realized R is a superset of everything RapidMiner was giving me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Playing with RapidMiner drag and drop was fun, but when you stop &quot;trying it out&quot; and try to write some real code to &lt;em&gt;beat the market&lt;/em&gt;, with real (i.e. huge amounts) of financial data, suddenly all those icons are getting in the way, and it is very slow (to code in, and to run what I'd made).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Learning R is hard work, even for an experienced programmer like myself. I've put a serious amount of effort in studying it over the past 6+ months, but regard the time as a good investment. The C++ integration (Rcpp) is also very important for me: your R script can be embedded in a larger C++ program, or alternatively you can optimize just one bottleneck R function in C++, or link in your C++ legacy code to your R script.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However if your machine learning needs are only a small part of your job, and the data involved is not huge, and you are not really a programmer, then RapidMiner is a good choice.&lt;/p&gt;&#xA;" OwnerUserId="1587" LastActivityDate="2011-10-27T02:16:34.003" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2255" PostTypeId="2" ParentId="2241" CreationDate="2011-10-27T02:42:36.877" Score="2" Body="&lt;ul&gt;&#xA;&lt;li&gt;Market making (&lt;em&gt;to collect a liquidity rebate)&lt;/em&gt;?&lt;/li&gt;&#xA;&lt;li&gt;Flash trading &lt;em&gt;(when the order is displayed to internal market&#xA;participants prior to being distributed to the wider market)?&lt;/em&gt; &lt;strong&gt;*1&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I think more generally strategies that implement pure latency arbitrage are related to &lt;em&gt;transaction market making (providing liquidity within markets or securities)&lt;/em&gt; rather than price arbitrage (as they were more classically when you think of low latency market making.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Check out this &lt;a href=&quot;http://www.waterstechnology.com/waters/web-seminar/2119509/-frequency-trading-webcast&quot; rel=&quot;nofollow&quot;&gt;webinare&lt;/a&gt; - some of the subjects include:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;What role do data centers play in high-frequency trading?&lt;/li&gt;&#xA;&lt;li&gt;Are proximity and co-location the most critical factors in shaving&#xA;milliseconds for firms?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;1 - Of course it's my understand that most electronic markets now don't&#xA;   allow flash trading?&lt;/p&gt;&#xA;" OwnerUserId="913" LastEditorUserId="913" LastEditDate="2011-10-27T04:29:56.347" LastActivityDate="2011-10-27T04:29:56.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2256" PostTypeId="1" AcceptedAnswerId="2272" CreationDate="2011-10-27T02:45:09.843" Score="20" ViewCount="4897" Body="&lt;p&gt;Both for private projects, and for clients, I've been working on code a lot this year to evaluate automated trading strategies. This often ends up turning into the task of how to fairly compare apples and oranges. E.g. to use an FX example, some of the strategies just buy/sell 1 lot, in a single currency. Others are trading in three or four currencies and using different lot sizes, doubling up when losing, etc., etc. Then there are questions about do we consider margin ratios, trading costs, initial capital available. Interest earned when the full capital is not in the strategy? Tax, CGT, stamp duty... don't even go there! Some strategies have different results if we consider average losses of losing trades versus worst loss. (The latter is what decides the margin call.) Which is more important?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I'm often very disappointed by academic papers that assume no spread, unlimited capital, always getting the advertised price however many lots you want to buy, etc. Some strategies that look great with no spread, fall apart when I apply a pessimistic spread; other strategies are almost unaffected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So (finally!) my question is could someone point me to papers/books on accepted practice in strategy &lt;em&gt;evaluation&lt;/em&gt; and &lt;em&gt;comparison&lt;/em&gt;? General advice, discussion and opinion on this topic are also welcome, but the key thing I feel need currently is an &quot;&lt;a href=&quot;http://en.wikipedia.org/wiki/Edmond_Hoyle&quot;&gt;According to Hoyle&lt;/a&gt;&quot; reference I can not just use as a guide, but that also clearly explains the trade-offs involved and why most people choose to do it that way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE: Thanks for the replies so far, and I'm taking a look at the books suggested here and in other threads. I just wanted to clarify that (for the scope of this question) this is not about &lt;em&gt;designing&lt;/em&gt; strategies. I'm being given a set of trades for each of a set of strategies and being asked to say which is best. The trades may have come from algorithms, or from human traders. My preferred approach is detailed simulation: define how much cash at the start, include all costs, and see how much cash at the end. Others seem happy with just counting pip movements. For some strategies this gives a similar result, for others it gives a different result. I want to know how the Big Boys handle this, and why, so I can use that as the basic approach, and then argue intelligently for/against different approaches.&lt;/p&gt;&#xA;" OwnerUserId="1587" LastEditorUserId="1587" LastEditDate="2011-10-30T04:12:54.283" LastActivityDate="2011-11-01T15:30:58.810" Title="Evaluating automated trading strategies: accepted practice" Tags="&lt;backtesting&gt;&lt;quant-trading-strategies&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="25" ContentLicense="CC BY-SA 3.0" />
  <row Id="2257" PostTypeId="2" ParentId="2241" CreationDate="2011-10-27T03:17:47.020" Score="6" Body="&lt;p&gt;Jordan (@jordan.baucke) in his answer suggests that most latency arbitrages are actually market making strategies, as opposed to classical price arbitrage. While I generally agree, I can think of two exceptions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;em&gt;Equity price arbitrage in fragmented markets&lt;/em&gt; (See the &lt;a href=&quot;http://fragmentation.fidessa.com/&quot; rel=&quot;nofollow&quot;&gt;fragulator&lt;/a&gt; for more on this). In this environment, negative spreads can arise and the quickest can take a profit. This is certainly a possibility, but probably it is not sizable.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;em&gt;Triangular arbitrage&lt;/em&gt;. This is a classical example. It exists (see for example &lt;a href=&quot;http://people.maths.ox.ac.uk/howison/papers/fenn_fx_arbitrage.pdf&quot; rel=&quot;nofollow&quot;&gt;Fenn et al.&lt;/a&gt;, for a coarse analysis at 1 sec resolution) and it might be profitable and sizable at much higher frequencies. At the 0.1 sec horizon, such opportunities are already much more frequent. Unfortunately, there are no academic studies use UHF data and can confirm this.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1531" LastEditorUserId="1531" LastEditDate="2011-10-27T16:32:07.153" LastActivityDate="2011-10-27T16:32:07.153" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2258" PostTypeId="2" ParentId="2256" CreationDate="2011-10-27T09:34:48.690" Score="12" Body="&lt;p&gt;I'll not say how most people do it, but rather how I think most people should do it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should compare the actual strategy with a number of goes of randomly trading through the time period using the same constraints as the strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically this is a way of not mixing species of fruit and seeing what the distribution of luck is for the particular fruit of interest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More details (including how backtests can easily be misleading) can be found via &lt;a href=&quot;http://www.portfolioprobe.com/2010/11/05/backtesting-almost-wordless/&quot;&gt;http://www.portfolioprobe.com/2010/11/05/backtesting-almost-wordless/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="249" LastActivityDate="2011-10-27T09:34:48.690" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2259" PostTypeId="1" CreationDate="2011-10-27T15:19:12.540" Score="6" ViewCount="219" Body="&lt;p&gt;I know two applications of local time in option pricing theory.&lt;br&gt;&#xA;First, it allows a derivation of Dupire's formula on local volatility in a neat way (i.e. without resorting to differential operator theory which I'm not really acquainted with).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, it can be used to show that you can't perfectly replicate (for example) a call option final payoff by the naive strategy of letting conditional orders on the market consistent with the strike in a Black-Scholes context. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone is aware of other applications of local times in finance, answers with references would be most appreciated ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best regards&lt;/p&gt;&#xA;" OwnerUserId="92" LastActivityDate="2011-10-27T15:19:12.540" Title="Use of Local Times in Option Pricing" Tags="&lt;option-pricing&gt;&lt;numerical-methods&gt;&lt;reference-request&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2260" PostTypeId="1" CreationDate="2011-10-27T16:52:21.093" Score="56" ViewCount="86844" Body="&lt;p&gt;I have a basic question about annualized Sharpe Ratio Calculation: if I know the daily return of my portfolio, the thing I need to do is multiply the Sharpe Ratio by $\sqrt{252}$ to have it annualized.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know why is that, can any body explain?&lt;/p&gt;&#xA;" OwnerUserId="1553" LastEditorUserId="467" LastEditDate="2012-06-25T13:17:11.463" LastActivityDate="2020-12-03T08:43:29.170" Title="How to annualize Sharpe Ratio?" Tags="&lt;sharpe-ratio&gt;" AnswerCount="8" CommentCount="3" FavoriteCount="39" ContentLicense="CC BY-SA 3.0" />
  <row Id="2261" PostTypeId="2" ParentId="2260" CreationDate="2011-10-27T17:09:00.837" Score="45" Body="&lt;p&gt;Actually, that is not always the case. &lt;a href=&quot;https://www.researchgate.net/publication/228139699_The_Statistics_of_Sharpe_Ratios&quot; rel=&quot;noreferrer&quot;&gt;Here&lt;/a&gt; is a great paper by Andy Lo, &quot;The Statistics of Sharpe Ratios&quot;. He shows how monthly Sharpe ratios &quot;cannot be annualized by multiplying by &lt;span class=&quot;math-container&quot;&gt;$\sqrt{12}$&lt;/span&gt; except under very special circumstances&quot;. I expect this will carry over to annualizing daily Sharpe Ratios.&lt;/p&gt;&#xA;" OwnerUserId="1531" LastEditorUserId="1531" LastEditDate="2019-04-09T14:17:12.580" LastActivityDate="2019-04-09T14:17:12.580" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="2262" PostTypeId="2" ParentId="2260" CreationDate="2011-10-27T17:36:21.287" Score="29" Body="&lt;p&gt;@RYogi's answer is definitely far more comprehensive, but if you're looking for what the assumptions behind the common rule of thumb are, they are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The returns of the portfolio are a &lt;a href=&quot;http://en.wikipedia.org/wiki/Wiener_process&quot;&gt;Wiener process&lt;/a&gt;, in which volatility scales with the square-root of time.&lt;/li&gt;&#xA;&lt;li&gt;There are 252 trading days in a year.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;As &lt;a href=&quot;http://www.edge-fund.com/Lo02.pdf&quot;&gt;Lo's paper&lt;/a&gt; points out, assumption #1 is somewhat suspect.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-10-27T17:36:21.287" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2263" PostTypeId="1" AcceptedAnswerId="2265" CreationDate="2011-10-27T18:24:29.650" Score="19" ViewCount="6779" Body="&lt;p&gt;My goal is to find &lt;a href=&quot;http://en.wikipedia.org/wiki/Cluster_analysis&quot;&gt;clusters&lt;/a&gt; of stocks. The &quot;affinity&quot; matrix will define the &quot;closeness&quot; of points. This &lt;a href=&quot;http://arxiv.org/abs/1110.5847&quot;&gt;article&lt;/a&gt; gives a bit more background. The ultimate purpose is to investigate the &quot;cohesion&quot; within ETFs and between similar ETFs for arbitrage possibilities. Eventually if everything goes well this could lead to the creation of a tool for risk modelling or valuation. Currently the project is in the proposal/POC phase so resources are limited.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found this Python &lt;a href=&quot;http://scikit-learn.sourceforge.net/auto_examples/applications/stock_market.html&quot;&gt;example&lt;/a&gt; for clustering with related &lt;a href=&quot;http://scikit-learn.sourceforge.net/modules/clustering.html#affinity-propagation&quot;&gt;docs&lt;/a&gt;. The code uses correlations of the difference in open and close prices as values for the affinity matrix. I prefer to use the average return and standard deviation of returns. This can be visualised as a two dimensional space with the average and standard deviation as dimensions. Instead of correlation, I would then calculate the &quot;distance&quot; between data points (stocks) and fill the affinity matrix with the distances. The choice of the distance function is still an open issue. Is calculating the distance between data points instead of correlations valid?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it is can I extend this approach with more dimensions, such as dividend yield or ratios such as price/earnings?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did a few experiments with different numbers of parameters and different distance functions resulting in different numbers of clusters ranging from 1 to more than 300 for a sample size of 900 stocks. The sample consists of large and mid cap stocks listed on the NYSE and NASDAQ. Is there a rule of thumb for the number of clusters one should expect?&lt;/p&gt;&#xA;" OwnerUserId="50" LastEditorUserId="1106" LastEditDate="2011-11-01T15:05:36.907" LastActivityDate="2017-11-22T00:39:36.980" Title="How to cluster stocks and construct an affinity matrix?" Tags="&lt;equities&gt;&lt;machine-learning&gt;&lt;etf&gt;" AnswerCount="5" CommentCount="3" FavoriteCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="2264" PostTypeId="1" AcceptedAnswerId="2268" CreationDate="2011-10-27T19:20:47.990" Score="6" ViewCount="1437" Body="&lt;p&gt;For example I want to construct 2 time series, one for ES and the other for NQ and test for cointegration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ES one point equal to 50$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NQ one point equal to 20$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I have the following data:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ES[0]=1300;ES[1]=1307;ES[2]=1314...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NQ[0]=2700;NQ[1]=2692;NQ[2]=2715...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I normalize this data for cointegration test?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;TX in advance!&lt;/p&gt;&#xA;" OwnerUserId="1463" LastActivityDate="2011-10-28T03:25:54.377" Title="How to normalize Futures data(different leverage) for cointegration test?" Tags="&lt;time-series&gt;&lt;futures&gt;&lt;cointegration&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2265" PostTypeId="2" ParentId="2263" CreationDate="2011-10-27T21:41:23.430" Score="13" Body="&lt;p&gt;You should consider an unsupervised learning algorithm such as K-nearest neighbor ('KNN').&lt;/p&gt;&#xA;&#xA;&lt;p&gt;KNN will measure the distance amongst the observations in your space. You can and probably should consider alternative distance functions (besides euclidean) particularly if you are clustering on features such as returns which have outliers. There are quite a few unsupervised clustering algorithms out there - see &lt;a href=&quot;http://en.wikipedia.org/wiki/Unsupervised_learning&quot;&gt;here&lt;/a&gt;. You can certainly include features such as stock characteristics with these algorithms. You can also include the betas of the securities with respect to various risk factors as well. This would allow you to capture the distances in correlation space since a security based covariance matrix can be expressed as the : cross-product of (betas for factors) * covariance matrix of factor returns * transposed(betas for factors).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would spend time thinking about the appropriate choice of features (which features are stable? which features predict risk or return? which sets of features are contributing unique sources of information? what are the invariants?) and choice of distance function. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, if you are mixing features with different unit scales (i.e. returns, betas, variances) then you need to normalize/pre-process your inputs otherwise the features with the highest variance will be the primary basis for clustering. Alternatively, you can stick to one class of features for your your clustering so you have some more intuition on interpreting the results.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-10-30T16:26:24.607" LastActivityDate="2011-10-30T16:26:24.607" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2266" PostTypeId="2" ParentId="2264" CreationDate="2011-10-27T21:44:11.073" Score="3" Body="&lt;p&gt;In a co-integration test you rely on the original price series -- not transformations of the price series such as rate of change and so on. Seems to me there is no need for normalization.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2011-10-27T21:44:11.073" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2268" PostTypeId="2" ParentId="2264" CreationDate="2011-10-28T00:10:01.063" Score="5" Body="&lt;p&gt;Multiply each price series by its multiplier to get notional values.  Then proceed as if the notional value were the price of 1 share.&lt;/p&gt;&#xA;" OwnerUserId="508" LastActivityDate="2011-10-28T00:10:01.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2269" PostTypeId="2" ParentId="2264" CreationDate="2011-10-28T03:25:54.377" Score="1" Body="&lt;p&gt;It sounds like you want to look at constant volatility series.  Just divide the returns by some volatility measure on each series respectively (e.g. ($r_t * volatilitytarget)/\sigma(50 days)$).  Then the change in one will be equivalent in size to the change in the other.&lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2011-10-28T03:25:54.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2270" PostTypeId="2" ParentId="2260" CreationDate="2011-10-28T09:13:02.290" Score="17" Body="&lt;p&gt;Here's the idea of where that comes from:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To annualize the daily return, you multiply by 252 (the number of observations in a year).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To annualize the variance, you multiply by 252 because you are assuming the returns are uncorrelated with each other and the log return over a year is the sum of the daily log returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the annualization of the ratio is 252 / sqrt(252) = sqrt(252).&lt;/p&gt;&#xA;" OwnerUserId="249" LastActivityDate="2011-10-28T09:13:02.290" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2271" PostTypeId="2" ParentId="2260" CreationDate="2011-10-29T03:11:42.867" Score="17" Body="&lt;p&gt;You often see various financial metrics scale with the square root of time This stems from the process that drives the lognornmal returns in stock prices which is the Ito process &lt;span class=&quot;math-container&quot;&gt;$dS = \mu Sdt + \sigma SdZ$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The Wiener process assumes that each dt is IID and has constant &lt;span class=&quot;math-container&quot;&gt;$\mu$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$\sigma^2$&lt;/span&gt;, therefore the same expected value and variance at each increment. Because: &lt;span class=&quot;math-container&quot;&gt;$$\operatorname{Var}\left(\ln\left(\frac{S(T)}{S(T_0)}&#xA;\right)&#xA;\right) = \operatorname{Var}\left(\ln\left(\frac{S(t_n)}{S(t_{n-1})}&#xA;\right)&#xA;\right) + \operatorname{Var}\left(\ln\left(\frac{S(t_{n-1})}{S(t_{n-2})}&#xA;\right)&#xA;\right) + \dots + \operatorname{Var}\left(\ln\left(\frac{S(t_1)}{S(t_0)}&#xA;\right)&#xA;\right)$$&lt;/span&gt; &lt;span class=&quot;math-container&quot;&gt;$$ = ns^2 = s^2\frac{(T-T_0)}{dt}$$&lt;/span&gt; &lt;span class=&quot;math-container&quot;&gt;$$\text{where } n = \frac{(T-T_0)}{dt} $$&lt;/span&gt; &lt;span class=&quot;math-container&quot;&gt;$$\text{where } S(T_{n})=S_{0}e^{(u-\frac{1}{2}\sigma^2)T_n+\sigma W(T_n)}$$&lt;/span&gt; It follows that &lt;span class=&quot;math-container&quot;&gt;$s^2(T-T_0)$&lt;/span&gt;. Because the variance should be finite, in the &lt;span class=&quot;math-container&quot;&gt;$\lim_{dt \rightarrow 0}$&lt;/span&gt;, variance should be proportional to &lt;span class=&quot;math-container&quot;&gt;$dt$&lt;/span&gt;. Since &lt;span class=&quot;math-container&quot;&gt;$s^2$&lt;/span&gt; is 1 for a lognormally distributed process, the variance is &lt;span class=&quot;math-container&quot;&gt;$(T-T_0)$&lt;/span&gt;, the standard deviation is therefore &lt;span class=&quot;math-container&quot;&gt;$\sqrt{T-T_0}$&lt;/span&gt; or &lt;span class=&quot;math-container&quot;&gt;$\sqrt{T}$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The reason you see financial metrics scaled to the square root of time is because the metrics are usually calculated using stock returns, which are assumed to be lognormally distributed. Whether it's right or wrong really has to do with your assumption of how stock returns are really distributed.&lt;/p&gt;&#xA;" OwnerUserId="1112" LastEditorUserId="31263" LastEditorDisplayName="user4874" LastEditDate="2020-12-03T08:43:29.170" LastActivityDate="2020-12-03T08:43:29.170" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="2272" PostTypeId="2" ParentId="2256" CreationDate="2011-10-29T04:33:50.720" Score="14" Body="&lt;p&gt;I unfortunately can't point you to a great book on the exact subject that you're describing.  The closest thing for beginners is &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470284889&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;Quantitative Trading&quot;&lt;/a&gt;.  It's a reasonable introduction, but I really wouldn't recommend it as a primary source.  The author is at best incomplete (if not misleading) on a number of issues.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My favorite book at the moment is &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1119990726&quot; rel=&quot;nofollow noreferrer&quot;&gt;Expected Returns&lt;/a&gt; by Antti Ilamen with a foreward by Cliff Asness of AQR.  This really gets into the strategies employed by most quantitative managers, and presents it in a framework that allows you to move forward in your own investigations.  That said, while it can serve as a model, it won't directly address methodological issues.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the end of the day, nothing beats self-understanding.  If you want to succeed in quantitative investing, spend the time to understand statistical methods.  You can get reasonably far by understanding basic finance (modern portfolio theory, etc.), but a deeper understanding requires knowledge of economics and statistics.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, this site (along with Willmott and &lt;a href=&quot;http://www.nuclearphynance.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;NuclearPhynance&lt;/a&gt;) can serve as a guide.  See &lt;a href=&quot;https://quant.stackexchange.com/questions/147/what-are-the-key-risks-to-the-quantitative-strategy-development-process&quot;&gt;&quot;key risks in strategy development&quot;&lt;/a&gt; for starters.&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2011-10-29T04:33:50.720" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2273" PostTypeId="1" CreationDate="2011-10-29T09:20:55.003" Score="7" ViewCount="6170" Body="&lt;p&gt;I need to calculate the skewness and kurtosis of 2 asset portfolio, can someone please help me with the formulas and definition of terms? Thank you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been using the matrices method and I am not sure if that is correct.&lt;/p&gt;&#xA;" OwnerUserId="1596" LastActivityDate="2011-11-13T07:09:31.697" Title="Calculating Portfolio Skewness &amp; Kurtosis" Tags="&lt;time-series&gt;&lt;statistics&gt;&lt;portfolio-management&gt;&lt;skewness&gt;&lt;kurtosis&gt;" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2274" PostTypeId="1" CreationDate="2011-10-29T13:25:45.383" Score="7" ViewCount="707" Body="&lt;p&gt;Where can the specification of a creation unit basket for an ETF be found? This information is needed for calculating the arbitrage possible between the ETF instrument itself and the creation unit basket constituent instruments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ETF marketing material usually specifies what index or stocks it tracks, but it seems harder to find out what the exact instruments and ratios of the creation unit's baskets are. If a specific ETF can be used as example, that could be db x-trackers Euro Stoxx 50.&lt;/p&gt;&#xA;" OwnerUserId="1581" LastEditorUserId="1581" LastEditDate="2018-06-18T16:30:59.193" LastActivityDate="2018-06-18T16:30:59.193" Title="Where are creation unit baskets for ETFs published?" Tags="&lt;arbitrage&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="2275" PostTypeId="2" ParentId="2273" CreationDate="2011-10-29T13:29:32.383" Score="7" Body="&lt;p&gt;&quot;Skewness&quot; quantifies how asymetric a distribution is about the mean. &quot;Kurtosis&quot; quantifies how peaked or flat the distribution is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Skewness is defined as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E[ (X - mean)^3 ]  = \frac{(\sum (x_i - x_{mean})^3 )}{N}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and Kurtosis as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E[ (X - mean)^4 ]  = \frac{(\sum (x_i - x_{mean})^4 )}{N}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where X is your distro values (x_1, x_2, ... x_N), mean is the average of your distro values X (x_mean, a constant) and E[f(X)] is the Expectation of f(X) - i.e the mean of f(X).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So now you need to define your distributions. To be honest I don't know what the standards are for a given asset, but I imagine that if your asset price movements are ~ lognormal then you'll be wanting the daily (or whatever) percentage change in the value of the portfolio. These daily %age changes define your distribution X. Of course you'll need to consider how far back in time you go: 1 month data? 1 year?. So each daily %age change is your x_i. Calc the mean (probably close to zero), then your Skewness and Kurtosis per the formulas above. &lt;/p&gt;&#xA;" OwnerUserId="1573" LastEditorUserId="17" LastEditDate="2011-10-29T19:08:06.480" LastActivityDate="2011-10-29T19:08:06.480" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2276" PostTypeId="1" CreationDate="2011-10-29T13:33:34.300" Score="4" ViewCount="404" Body="&lt;p&gt;Large institutions can swap baskets of underlying securities for ETF shares that can then be traded on an exchange as part of arbitrage between the price of the basket and the ETF share price. These baskets are called &lt;em&gt;creation units&lt;/em&gt;. How often does the creation unit basket for a given ETF typically change? Hourly, daily or yearly?&lt;/p&gt;&#xA;" OwnerUserId="1581" LastEditorUserId="1581" LastEditDate="2011-10-29T13:51:12.827" LastActivityDate="2011-10-31T18:30:34.420" Title="How often do ETF creation units baskets change?" Tags="&lt;arbitrage&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2277" PostTypeId="1" CreationDate="2011-10-29T14:24:33.450" Score="2" ViewCount="421" Body="&lt;p&gt;What are the most popular probability distributions in quantitative finance and what are their applications?&lt;/p&gt;&#xA;" OwnerUserId="1112" LastActivityDate="2011-10-29T14:24:33.450" Title="Probability distributions in quantitative finance" Tags="&lt;distribution&gt;" AnswerCount="0" CommentCount="7" ClosedDate="2011-10-30T01:02:10.877" ContentLicense="CC BY-SA 3.0" />
  <row Id="2278" PostTypeId="1" CreationDate="2011-10-29T16:48:14.960" Score="25" ViewCount="9431" Body="&lt;p&gt;I'm sure there is a simple answer to this but I haven't had any luck with searches.  I'm just wondering when someone places a market order which order(s) from the limit order book are selected to fill that?  Let's say the order book has the highest bid at 100 and the lowest ask at 101 and I place a limit order to buy at 100.  I'm now bidding the same as all the other highest bids, so when market orders to sell come through get matched with highest bids, how are the bids selected?  Is it random, in order by time, size, or some other mechanism?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And just in case it is by time like FIFO, let's say I placed many limit orders long in advance at prices well out of the money 99, 98, 97, etc.  Could I get myself to the top of the list at all these prices that are out of the money just by placing my orders anticipating a possible drop?&lt;/p&gt;&#xA;" OwnerUserId="1597" LastActivityDate="2011-10-30T19:24:40.627" Title="How are limit orders selected from the order book?" Tags="&lt;limit-order-book&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2279" PostTypeId="2" ParentId="2278" CreationDate="2011-10-29T17:33:40.630" Score="23" Body="&lt;p&gt;This is determined through &lt;strong&gt;order precedence rules&lt;/strong&gt;. In most markets, these are &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;em&gt;Price priority&lt;/em&gt;: precedence goes to the best ask or bid offers.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;em&gt;Time precedence&lt;/em&gt;: precedence goes to who improves the current ask or bid offers. In computer-speak that's FIFO. It encourages the market participants to improve prices aggressively.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;em&gt;Public order precedence&lt;/em&gt;: public orders have precedence over hidden orders.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;As I pointed out before, rules for some futures markets can be quite different (see this &lt;a href=&quot;https://quant.stackexchange.com/questions/131/how-to-execute-a-large-futures-order/2184#2184&quot;&gt;answer&lt;/a&gt;). The pro-rata allocation used in some futures markets is sometimes referred to as &lt;em&gt;size precedence&lt;/em&gt;: when two or more orders are at parity (according to the enforced priority rules) orders fill in proportion to sizes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me add that precedence &lt;em&gt;across exchanges&lt;/em&gt; is determined by Regulation NMS. The NBBO (National best bid and offer) for a stock is the best bid or offer sent by a market center to the SIP (Security Information Processor). This best price has the precedence across exchanges, and market orders should be routed towards the venue which displays the NBBO. In practice this is hard to enforce (see &lt;a href=&quot;http://www.nanex.net/Research/IsNBBOIgnored.html&quot; rel=&quot;noreferrer&quot;&gt;Nanex&lt;/a&gt; on this and the now-banned &lt;a href=&quot;http://en.wikipedia.org/wiki/Flash_trading&quot; rel=&quot;noreferrer&quot;&gt;flash orders&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="1531" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2011-10-30T19:24:40.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2280" PostTypeId="2" ParentId="2278" CreationDate="2011-10-29T18:04:52.300" Score="12" Body="&lt;p&gt;As RYogi indicated, this depends on the exchange and product type.&lt;br&gt;&#xA;e.g. &lt;a href=&quot;http://ftp.cmegroup.com/globex/introduction/features-and-functionality/elements/matching-algorithms.html&quot;&gt;here is a summary of the matching algorithms at the CME&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answer to the second part of your question is yes.  Even in a market like the Eurodollar futures -- which is mostly pro-rata, but has a FIFO component -- a common strategy is to &quot;stack the book.&quot;  So that you will be first in queue.  This usually involves hiring a night clerk to pull orders as the market moves. ;-)&lt;/p&gt;&#xA;" OwnerUserId="508" LastActivityDate="2011-10-29T18:04:52.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2281" PostTypeId="2" ParentId="2278" CreationDate="2011-10-29T18:57:39.677" Score="14" Body="&lt;p&gt;All exchanges allocate to &lt;strong&gt;best price&lt;/strong&gt;. This is by law in the US, and it's unimaginable that an exchange would do otherwise in other jurisdictions. As for tie-breaks, there are two possibilities for public orders:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;Time&lt;/em&gt;: first-come first-served; used for most equities exchanges&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;Pro-rata&lt;/em&gt;: larger quote sizes get more of an incoming market order; common for futures and options exchanges, plus the PSX equities exchange&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Once the public orders are exhausted at the best price, the exchange may fill &lt;strong&gt;hidden limit orders&lt;/strong&gt;. (Note that not every exchange allows hidden limit orders.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some exchanges also incentivize the market maker who established the &lt;strong&gt;new best price&lt;/strong&gt;. That is, in a pro-rata allocation, the market maker who has set a new price that becomes the best may receive a larger share of an incoming market order than normal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, some exchanges have &lt;strong&gt;parity&lt;/strong&gt; rules. On the NYSE, for example, an order is usually allocated equally among the designated market maker, the first-come floor broker, and the first-come limit order from SuperDOT.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it should be clear from the above that every exchange has its own rules for allocation; there is no &lt;em&gt;one true path&lt;/em&gt; that every venue follows.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-10-29T18:57:39.677" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2282" PostTypeId="1" AcceptedAnswerId="2302" CreationDate="2011-10-29T20:30:18.967" Score="8" ViewCount="583" Body="&lt;p&gt;Say I have 6 possible investment options with the following probability of success and the corresponding returns:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Investment | Probability of Success | Return |&#xA;|    I1      |           0.5          |   2x   |&#xA;|    I2      |           0.3          |   6x   |&#xA;|    I3      |           0.1          |  10x   |&#xA;|    I4      |          0.06          |  20x   |&#xA;|    I5      |          0.02          |  40x   |&#xA;|    I6      |          0.02          |  40x   |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I wish to know what is the best 'investment portfolio' (i.e., the one with the least risk - i.e., there is not cut-off for least anything would do for now). I wish to 'simulate' such a portfolio and its expected return, for the investment. I don't know if it's possible but I'm trying to see if it answers some questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;If the initial investment capability is $100,000 how should I go about investing in these options i.e., how much to invest in which option so that I do end up with 'some' profit with minimal risk of loss?&lt;/li&gt;&#xA;&lt;li&gt;If it's not possible to do the above using a simulation then is it possible to 'see' what would be an optimal portfolio? i.e., where all to invest?&lt;/li&gt;&#xA;&lt;li&gt;If neither of the above are possible then what is the best way of simulating such a scenario to gauge the 'risk of investment'?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I basically want a graphical view of how things would look like i.e., the risk of such an investment. I'd like to simulate this in Excel using Monte-Carlo, but I just can't seem to understand 'what' to do so as to observe the associated risk with the portfolio or what would form a good portfolio with minimal risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; At any given point in time ONLY ONE investment will be a success since only 1 of the options can happen at time 't'. So if I invest \$1 in each initiative and it's I1 that comes out the winner, I'll land up with \$2 but a net loss of \$4. Implying a bad investment. But at the same time I could land up with \$40 too but with a very low probability. I basically wish to simulate something like that to see if it's even 'worth it' - basically a visual cue/proof of the same.&lt;/p&gt;&#xA;" OwnerUserId="1599" OwnerDisplayName="Nupul" LastEditorUserId="21023" LastEditDate="2016-12-22T18:18:40.730" LastActivityDate="2016-12-22T18:18:40.730" Title="How can I simulate portfolio risk (diversification) with a 'Wheel of Fortune' like investment options/returns?" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;&lt;asset-allocation&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2283" PostTypeId="2" ParentId="2263" CreationDate="2011-10-30T09:09:39.747" Score="5" Body="&lt;p&gt;Quant Guy's answer is quite informative for your question already.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just to add few other things: instead of figuring out the choice of features by your own brain, you could also use machine learning techniques to help in extracting the 'features' for your specific purpose, e.g. risk modeling or returns forecasting or portfolio construction as mentioned by Tal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take a look at &lt;a href=&quot;http://en.wikipedia.org/wiki/Principal_component_analysis&quot;&gt;Principal component analysis&lt;/a&gt; and manifold learning (e.g. &lt;a href=&quot;http://scholar.google.com/scholar?q=A%20Global%20Geometric%20Framework%20for%20Nonlinear%20Dimensionality%20Reduction&amp;amp;hl=en&amp;amp;btnG=Search&amp;amp;as_sdt=1,5&amp;amp;as_sdtp=on&quot;&gt;isomap&lt;/a&gt;).&#xA;Even more interesting, the &lt;a href=&quot;http://ufldl.stanford.edu/wiki/index.php/UFLDL_Tutorial&quot;&gt;Unsupervised Feature Learning and Deep Learning&lt;/a&gt;.&#xA;The first two methods both have implementation in the scikit-learn, the library you are currently looking into.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first two methods mentioned above, could help you not only to extract the more important components from you features, but also to visualize your clustering given your feature dimension is bigger than 2.&lt;/p&gt;&#xA;" OwnerUserId="1446" LastActivityDate="2011-10-30T09:09:39.747" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2284" PostTypeId="1" CreationDate="2011-10-30T15:11:23.890" Score="6" ViewCount="860" Body="&lt;p&gt;Certain bank loans pay a spread above a floating-rate interest rate (typically LIBOR) subject to a floor.  I would like to find the value of this floor to the investor.  Assume for this example that the loan does not have any default (credit) risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a first pass, the value of the floor could be approximated using the Black model to price a series of floorlets maturing on the loan's payment dates.  However, the borrower has a right to refinance (call) the loan (suppose it is callable at par), subject to a refinancing cost.  If interest rates decline and the floor is in the money, the borrower is more likely to call the loan.  Thus the floor (along with the rest of the loan) is more likely to go away precisely when the investor values it more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can this floor be valued?&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-12-14T20:10:36.320" LastActivityDate="2011-12-14T20:10:36.320" Title="How to value a floor when a loan is callable?" Tags="&lt;option-pricing&gt;&lt;interest-rates&gt;&lt;fixed-income&gt;&lt;embedded-options&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2286" PostTypeId="2" ParentId="2274" CreationDate="2011-10-30T16:45:49.747" Score="6" Body="&lt;p&gt;On Bloomberg. Go to ETF -&gt; holdings and type &quot;97 Enter&quot;.&lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2011-10-30T16:45:49.747" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2287" PostTypeId="2" ParentId="2256" CreationDate="2011-10-30T19:28:09.247" Score="4" Body="&lt;p&gt;You might also try looking at David Aronson's &lt;a href=&quot;http://www.evidencebasedta.com/&quot; rel=&quot;nofollow&quot;&gt;Evidence Based Technical Analysis&lt;/a&gt; book and the R &lt;a href=&quot;http://cran.r-project.org/web/packages/ttrTests/index.html&quot; rel=&quot;nofollow&quot;&gt;ttrTests&lt;/a&gt; package. Both outline testing regimes that will enable you to rule out blind luck etc. in system results.&lt;/p&gt;&#xA;" OwnerUserId="252" LastActivityDate="2011-10-30T19:28:09.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2290" PostTypeId="2" ParentId="2276" CreationDate="2011-10-31T18:30:34.420" Score="1" Body="&lt;p&gt;That depends a lot on the ETF you are talking about.  Some of them, for example in corporate debt, have pretty loose standards because so many names are illiquid and consequently  there is no single basket that they will or will not take.  Well, I suppose the nominal basket would always be taken but no one ever has that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, the liquid equity ETFs require a pretty close match, and therefore the acceptable basket changes monthly (or at whatever the predefined rebalance frequency is).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As Beatrice comments, in most cases the fund manager has wide discretion, and will be trying to maximize the popularity of an ETF by balancing ease of trading creation units versus tracking error.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-10-31T18:30:34.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2291" PostTypeId="2" ParentId="2284" CreationDate="2011-10-31T18:57:06.790" Score="7" Body="&lt;p&gt;As with most derivatives that have early exercise, you are going to want to price this using a grid scheme.  I have priced callable loans with floors using the Generalized Vasicek model at my old hedge fund, and it is fairly easy to handle.  As a matter of fact my students are doing that very problem as homework this week, and my reference implementation using explicit finite differences is 15 lines of Python/Numpy.  (Sorry, guys, I am not going to post it here).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Allow me to make the following suggestions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Do not ignore credit spread.  Instead, consider modeling (credit spread + interest rate) as your basic Vasicek &quot;short rate&quot; variable $r$.  Credit spread provides about half the rate volatility in your typical security so ignoring it severely mis-estimates option value.&lt;/li&gt;&#xA;&lt;li&gt;Just do an explicit FD scheme unless you really need speed.  It is actually easier than making a tree.  If speed becomes a problem go to Crank-Nicolson.&lt;/li&gt;&#xA;&lt;li&gt;If you are really only interested in the incremental value of the floor to the bondholder, then you can make a darn good approximation even if you ignore the term structure of interest rates.  That lets you revert to the straight Vasicek model which is super-simple to deal with.&lt;/li&gt;&#xA;&lt;li&gt;Use Neumann boundary conditions&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;As a reminder, to construct the Vasicek finite differencing scheme, you simply &lt;a href=&quot;http://en.wikipedia.org/wiki/Finite_difference&quot; title=&quot;finite difference&quot;&gt;finite-difference&lt;/a&gt; the PDE in $\tau=T-t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;\frac{\partial P}{\partial\tau} = \frac12 \sigma(\tau)^2 \frac{\partial^2 P}{\partial\tau^2} + \kappa(\theta(\tau)-r) \frac{\partial P}{\partial r} - rP&#xD;&#xA;$$&#xA;and then apply your exercise conditions at each timestep.  If you are willing to ignore term structures, then $\sigma$ and $\theta$ become constants.  You can estimate the volatility historically, and fit the $\theta$ to market rates using the best fit to the risky zero rate curve and the expectation formula&#xA;$$&#xD;&#xA;\widehat{E}\left[ \int_t^T r_s ds  \right] = \frac{1-e^{-\kappa \tau}}{\kappa} r_t + \left( \tau-\frac{1-e^{-\kappa \tau}}{\kappa} \right) \theta&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By Neumann boundary conditions, I mean essentially assuming that at the upper and lower short-rate limits, you should pretend that the second derivative is zero.  This is equivalent to setting $\sigma=0$ but &lt;em&gt;only at those limits&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-10-31T18:57:06.790" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2292" PostTypeId="2" ParentId="284" CreationDate="2011-10-31T21:26:59.510" Score="4" Body="&lt;p&gt;I can chime in with some figures and what it means for slippage to be significant. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, some figures, as discussed by Zoltan Eisler form CFM. CFM refers to some of its strategies as &quot;slow alpha&quot;. These models make directional (~0.1%) predictions over horizons from 1/2 to few hours. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to these parameters, their US long-short equity fund has a pure annual PnL of 30%/year. On a daily turnover of 0.5% of the market's, their impact costs are close to 15%/year (as estimated by the Barro's square-root law). Clearly, these numbers live somewhere in between the realms of fiction and reality, but are nonetheless illustrative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More details on this back-of-the-envelope calculation are &lt;a href=&quot;http://market-microstructure.institutlouisbachelier.org/presentations/The%20Price%20Impact%20of%20Order%20Book%20Events%20-%20Eisler.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, slippage is also significant in the sense that it should be optimal. Indeed, some quant funds &lt;em&gt;target&lt;/em&gt; an optimal slippage. Assume that the in-house best execution strategy is being used (exclude pure passive/market-making executions), so that there are no easy improvements there. Intuitively, if your slippage is too low, you should kick the market a bit more, and throw some more volume at it. If your slippage is too high, you should be a bit more gentle.&lt;/p&gt;&#xA;" OwnerUserId="1531" LastEditorUserId="1531" LastEditDate="2011-10-31T23:58:56.180" LastActivityDate="2011-10-31T23:58:56.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2293" PostTypeId="1" CreationDate="2011-10-31T21:43:14.210" Score="2" ViewCount="906" Body="&lt;p&gt;I'm a university student and I'm quite interested in High Frequency Trading Algorithms. What courses should I take and what skills should I acquire so that I can work in this field?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far, I've been developing web applications and Android apps as a software engineer.&lt;/p&gt;&#xA;" OwnerUserId="1681" OwnerDisplayName="user1606" LastEditorUserId="1681" LastActivityDate="2011-10-31T21:43:14.210" Title="What skills and education are required for HFT?" Tags="&lt;high-frequency&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="2" ClosedDate="2011-11-01T00:08:09.240" ContentLicense="CC BY-SA 3.0" />
  <row Id="2294" PostTypeId="1" AcceptedAnswerId="2296" CreationDate="2011-10-31T22:17:55.337" Score="11" ViewCount="4162" Body="&lt;p&gt;I only have means and standard deviations of samples of two random variables.  What technique can I use to determine how similar the distributions these describe are?  Assume that the values are built from very similar samples.  I'm looking for a mechanism to detect when the distributions deviate from one another by some threshold.  Access to historical observations is limited.&lt;/p&gt;&#xA;" OwnerUserId="1136" LastEditorUserId="1106" LastEditDate="2011-11-01T14:31:07.340" LastActivityDate="2015-08-22T15:11:11.750" Title="How can I compare distributions using only mean and standard deviation?" Tags="&lt;statistics&gt;&lt;distribution&gt;&lt;random-variables&gt;&lt;stationarity&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2295" PostTypeId="1" AcceptedAnswerId="2306" CreationDate="2011-10-31T23:05:46.640" Score="9" ViewCount="946" Body="&lt;p&gt;I'm trying to improve my methods for calculating real-time US Equity option portfolio risk.&lt;br&gt;&#xA;My main problem is volatility &quot;stability&quot; across all strikes in an option series.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The current implementation is similar to the OCC Haircut calculations, where I calculate volatility at current market prices and then calculate theoretical prices for all options at 10 equidistant percentage moves of the underlying up and down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem is generally with deep ITM/OTM options that have a short time to maturity and/or wide bid-ask spreads, no bids, etc. I often see call vs. put IV's severely out of whack which in turn causes deltas to be incorrect (especially for portfolios that do large reversals/conversions for dividend plays).&#xA;I'm using a dividend forecast feed in my current pricing models (Escrow method).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering if it would be better to extrapolate the skew curve from the ATM options to estimate volatility at further strikes? Are there any programmatic examples out there that describe and handle this situation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="1608" LastActivityDate="2011-11-02T15:44:30.417" Title="Option Portfolio Risk - Volatility/Skew - practical implementation" Tags="&lt;option-pricing&gt;&lt;implied-volatility&gt;&lt;skew&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2296" PostTypeId="2" ParentId="2294" CreationDate="2011-11-01T00:14:18.657" Score="12" Body="&lt;p&gt;There are a number of different tests that are generally used to compare samples to different distributions, such as &lt;a href=&quot;http://en.wikipedia.org/wiki/Jarque%E2%80%93Bera_test&quot; rel=&quot;nofollow noreferrer&quot;&gt;Jarque-Bera&lt;/a&gt;, &lt;a href=&quot;http://en.wikipedia.org/wiki/Anderson%E2%80%93Darling_test&quot; rel=&quot;nofollow noreferrer&quot;&gt;Anderson-Darling&lt;/a&gt;, and &lt;a href=&quot;http://en.wikipedia.org/wiki/Kolmogorov%E2%80%93Smirnov_test&quot; rel=&quot;nofollow noreferrer&quot;&gt;Kolmogorov–Smirnov&lt;/a&gt; (see &lt;a href=&quot;https://stats.stackexchange.com/questions/1645/appropriate-normality-tests-for-small-samples&quot;&gt;this related question&lt;/a&gt;).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, with just the standard deviation and mean, there isn't a whole lot to say.  You need to assume a distribution (e.g. normal).  You would be able to tell much more if you could at least get the &lt;a href=&quot;http://en.wikipedia.org/wiki/Skewness&quot; rel=&quot;nofollow noreferrer&quot;&gt;skewness&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/Kurtosis&quot; rel=&quot;nofollow noreferrer&quot;&gt;kurtosis&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2011-11-01T00:14:18.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2297" PostTypeId="2" ParentId="2263" CreationDate="2011-11-01T14:59:19.207" Score="2" Body="&lt;p&gt;Rather than suggesting alternative clustering techniques, as Quant Guy and Flake have (great advice, btw), I'll offer my thoughts on the method you've proposed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;On the characteristics used to cluster stocks:&lt;/em&gt;  You propose using sample statistics (mean and standard deviation of returns).  I would suggest you use the entire return (&lt;strong&gt;not&lt;/strong&gt; price) series.  For example, if stock A's returns on two successive days are (+1%,-1%) and B's returns are (-1%,+1%), your method would rank these two very closely based on mean and standard deviation, when in fact they should be quite far apart, particularly if most stock pairs in your sample are positively correlated (which I believe the vast majority are).  Potential elaborations on this method include volatility-adjusted returns, market-beta adjusted returns, and excess returns relative to some risk model.  I would shy away from using too many non-return characteristics, particularly fundamentals such as dividend yield or P/E, but you may want to introduce size (market cap) and industry.  If your sample is exclusively ETFs, I strongly reiterate my advice to shy away from all fundamentals, including size and industry (which are irrelevant for broad ETFs and potentially misleading for narrow ones).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;On the distance function:&lt;/em&gt; The function referenced in the paper you linked seems very complicated so I can't comment on it, but in general you should consider that if you use more than one type of input (e.g. returns and fundamentals), you should upweight differences which should be close together and downweight differences which are expected to be far apart, using something like Mahalanobis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;On the number of clusters:&lt;/em&gt; You will need to think more about your sample to figure out the optimal number of clusters.  If you are looking at the entire market, I think statistical techniques are generally good at identifying no more than about 5 independent sources of variation.  Assuming each one of these has 2 potential states, that implies $2^5=32$ clusters.  If you repeat the analysis using only ETFs in your sample, given all the overlap, I'd go for even fewer, perhaps 10 clusters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best of luck.  Your question does make sense to me now; the edits helped immensely.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-11-01T15:06:44.190" LastActivityDate="2011-11-01T15:06:44.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2298" PostTypeId="2" ParentId="2256" CreationDate="2011-11-01T15:30:58.810" Score="3" Body="&lt;p&gt;If you are looking for &quot;accepted practice,&quot; then in my opinion you must read &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0070248826&quot; rel=&quot;nofollow noreferrer&quot;&gt;Grinold and Kahn&lt;/a&gt;.  That book strongly advocates use of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Information_ratio&quot; rel=&quot;nofollow noreferrer&quot;&gt;information ratio&lt;/a&gt;, the successor to the closely-related &lt;a href=&quot;http://en.wikipedia.org/wiki/Sharpe_ratio&quot; rel=&quot;nofollow noreferrer&quot;&gt;Sharpe ratio&lt;/a&gt;.  See the wiki pages for lists of alternative ratios and performance evaluation measures, but none are nearly as widespread as these two.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just one note regarding your question: all performance evaluation should be applied at the portfolio level (i.e. pooling all trades) using mark-to-market (log) returns, probably daily.  If a portfolio has no trades, it is holding cash and thus is earning the risk-free rate (which will give a zero excess return for Information/Sharpe ratio).  Be careful to always simulate all aspects of your trading without look-ahead bias, including the limitation on the number of trades you can enter (see &lt;a href=&quot;https://quant.stackexchange.com/q/1947/1106&quot;&gt;How to “uncluster” a set of financial data?&lt;/a&gt; for an example of how this can be misunderstood).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A number of other questions on this site have already fleshed out various implementation issues, such as:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/q/955/1106&quot;&gt;Separating the wheat from the chaff: What quant methods separate skillful managers from lucky ones?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/q/1985/1106&quot;&gt;What papers have progressed the field of quantitative finance in recent years (post 2000)?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/q/1102/1106&quot;&gt;Should Sharpe ratio be computed using log returns or relative returns?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/q/1480/1106&quot;&gt;What is the ideal ratio of in-sample length to out-of-sample length?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/q/2115/1106&quot;&gt;What is a reasonable upper bound on the performance of a daily trading strategy?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2011-11-01T15:30:58.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2299" PostTypeId="1" CreationDate="2011-11-01T17:03:44.433" Score="3" ViewCount="6500" Body="&lt;p&gt;Could anyone explain the difference between STOXX and STOXXE?  Which is the right index for benchmarking European stocks? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="1553" LastEditorUserId="1652" LastEditDate="2011-11-15T16:07:01.910" LastActivityDate="2020-07-09T14:53:41.770" Title="What is the difference between STOXX and STOXXE?" Tags="&lt;index&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2300" PostTypeId="2" ParentId="2299" CreationDate="2011-11-01T18:28:33.043" Score="4" Body="&lt;p&gt;Stoxxe would be the benchmark for European stocks in Eur&lt;/p&gt;&#xA;&lt;p&gt;Different data providers are using different symbols.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Sx5e biggest 50 European Eur stocks&lt;/li&gt;&#xA;&lt;li&gt;Sx5p biggest 50 pan European stocks&lt;/li&gt;&#xA;&lt;li&gt;Sxxp biggest 60@ pan euro stocks - 200 large cap 200 mid cap and 200 small caps&lt;/li&gt;&#xA;&lt;li&gt;Sxxe would be all Eur stocks put of the sxxp - around 380 names&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1610" LastEditorUserId="43861" LastEditDate="2020-07-09T14:53:41.770" LastActivityDate="2020-07-09T14:53:41.770" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="2301" PostTypeId="1" CreationDate="2011-11-01T22:45:07.387" Score="2" ViewCount="268" Body="&lt;p&gt;I was wondering if someone has an implementation of the Tian third moment-matching tree (&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1030143&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1030143&lt;/a&gt;) with&#xA;smoothing in code (e.g. c++, vba, c#, etc.)?&#xA;It would help hugely if the implementation also shows how to handle discrete dividends and calculate greeks (delta, vega, gamma, theta, rho).&lt;/p&gt;&#xA;" OwnerUserId="1608" LastEditorUserId="467" LastEditDate="2011-11-02T00:03:00.143" LastActivityDate="2011-11-02T00:03:00.143" Title="Tian third moment-matching tree with smoothing - implementation" Tags="&lt;options&gt;&lt;option-pricing&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2302" PostTypeId="2" ParentId="2282" CreationDate="2011-11-01T23:57:46.873" Score="5" Body="&lt;p&gt;The general optimization problem for portfolio management is the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \min x Q x  $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $x$ is the allocation vector of your problem, and $Q$ is the covariance matrix of all your possible investments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your example, you can compute the expectation $E[x]$, the variance $Var[x]=E[x^2]-E[x]^2$ and the covariane $cov[x,y]=E[xy]-E[x]E[y]$ pretty easily for each bet $x$, the latter giving you the $Q$ needed for the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As @cardinal said in his comment, if you do not add any constraint, the optimal portfolio is in that case the one with the lowest variance and hence, the one with no position at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all, for the problem to make sense, you need to add:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$x_i \geq 0 \quad \forall i$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, you would want to add is a constraint which is the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sum_i x_i=n$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which means that you &lt;em&gt;must&lt;/em&gt; invest the total amount $n$ in the game.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this will still not give you an interesting example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact you want to put another constraint on the expected return of your portfolio of bets, which is given as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mu x \geq \bar{\mu}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $\mu$ is the vector of the expectations of all the bets and $\bar{\mu}$ is the minimum expected return you want from the portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, in order to have an interesting result, you would like to choose $\bar{\mu}$ to be equal to on of the expectation of the bets. You should be able to find that, for the same expected return, you could have a lower volatility by investing in different bets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can run this in MATLAB using &lt;a href=&quot;http://www.mathworks.ch/help/toolbox/optim/ug/fmincon.html&quot; rel=&quot;noreferrer&quot;&gt;fmincon&lt;/a&gt; for example, or you could simply create an excel spreadsheet and use the solver.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Monte-Carlo is not really useful here, it's just &lt;a href=&quot;http://en.wikipedia.org/wiki/Modern_portfolio_theory&quot; rel=&quot;noreferrer&quot;&gt;modern portfolio theory&lt;/a&gt;. For a graphical representation, just draw an &lt;a href=&quot;http://en.wikipedia.org/wiki/Efficient_Frontier&quot; rel=&quot;noreferrer&quot;&gt;efficient frontier&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2011-11-01T23:57:46.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2303" PostTypeId="1" AcceptedAnswerId="2305" CreationDate="2011-11-02T04:06:14.183" Score="16" ViewCount="3824" Body="&lt;p&gt;I have read the CBOE's white paper on the VIX and a lot of other things, but I need to honestly say, I don't really get it, or I am missing something important.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In semi-layman's terms, is the VIX simply the a measurement of the volume of protective options bought?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, individual contract volatility increases when the option has been bid up by buyers due to desirability. One contract alone only marginally increases the overall market volatility, but if all contracts were bid up, then the entire VIX would be recalculated (on the fly) to reflect the higher value of protective options as a speculative/hedge solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I understand this correctly, or do I really need to put more time into understanding that formula which comprises the VIX?&lt;/p&gt;&#xA;" OwnerUserId="1453" LastEditorUserId="1106" LastEditDate="2011-11-02T14:54:54.783" LastActivityDate="2018-01-28T01:46:09.023" Title="What does the VIX formula measure and how does it work?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;implied-volatility&gt;&lt;vix&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2304" PostTypeId="2" ParentId="141" CreationDate="2011-11-02T12:06:47.460" Score="5" Body="&lt;p&gt;Whether you are an institution or individual you if you want to find some data related to finance, you can check out from here:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://fundamentals.morningstar.com/&quot; rel=&quot;nofollow&quot;&gt;http://fundamentals.morningstar.com/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://equityapi.morningstar.com/&quot; rel=&quot;nofollow&quot;&gt;http://equityapi.morningstar.com/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1613" LastEditorUserId="1355" LastEditDate="2012-11-09T14:16:39.287" LastActivityDate="2012-11-09T14:16:39.287" CommentCount="0" CommunityOwnedDate="2011-11-02T12:06:47.460" ContentLicense="CC BY-SA 3.0" />
  <row Id="2305" PostTypeId="2" ParentId="2303" CreationDate="2011-11-02T14:11:12.017" Score="10" Body="&lt;p&gt;VIX is a measure of &lt;strong&gt;implied volatility&lt;/strong&gt;, specifically, &lt;strong&gt;model-free implied volatility&lt;/strong&gt;, a concept originally developed by &lt;a href=&quot;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CBsQFjAA&amp;amp;url=http://www.ederman.com/new/docs/gs-volatility_swaps.pdf&amp;amp;ei=1E2xTrT_MaTC0AHwtNigAQ&amp;amp;usg=AFQjCNGms5ZJEvKufozXjz5gy5dPqIVAbw&quot; rel=&quot;nofollow noreferrer&quot;&gt;Demeterfi et. al. at Goldman Sachs in the 1990s&lt;/a&gt;.  One of my recent questions, &lt;a href=&quot;https://quant.stackexchange.com/q/2231/1106&quot;&gt;How to extrapolate implied volatility for out of the money options?&lt;/a&gt;, addressed some aspects of MFIV, and the papers mentioned in the question and answers will give you some more background on the concept.  Also check out this &lt;a href=&quot;http://math.uchicago.edu/~sbossu/VarSwaps.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;JPMorgan research piece&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The VIX is the square root of the market-implied variance swap rate, calculated based on the exchange-traded options portfolio typically used to hedge an OTC variance swap.  It has &lt;strong&gt;nothing&lt;/strong&gt; to do with options volume.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to the effect of individual contracts (strikes) on the VIX, that depends on how far out of the money they are.  The CBOE's calculation uses exclusively OTM options.  If the implied volatility of an option near the money changes, it will have a much greater effect than a far OTM option.  All prices of all options are changing constantly in line with changes in the index, but the VIX calculation takes that into account in a very clever way (i.e., without resorting to the Black-Scholes model or its assumptions).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, (implied) volatility does not necessarily increase if an option's price increases, if the underlying has also been moving.  Further, since VIX is based on the mid quoted price, no actual trading needs to take place for the VIX to change.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2011-11-02T14:56:37.387" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2306" PostTypeId="2" ParentId="2295" CreationDate="2011-11-02T14:11:38.910" Score="5" Body="&lt;p&gt;Generally, you should ignore deep in-the-money option prices because they are far less liquid (due to their low leverage).  That lets you use just the calls on the high strikes and just the puts on the low strikes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your purposes, you can cap the volatility at, say, the highest mid-market volatility of all puts having both a bid and an offer.  This cut-off to the skew will keep your valuations and risk fairly sane.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You would not want to make markets off such an ugly skew but it is OK for doing risk and scenarios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a more involved approach, see here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/620/is-there-a-popular-curve-fitting-formula-of-options-skew-vs-strike-price-or-vs-d&quot;&gt;Is there a popular curve fitting formula of options skew vs strike price or vs Delta?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2011-11-02T15:44:30.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2307" PostTypeId="1" CreationDate="2011-11-02T15:07:17.733" Score="7" ViewCount="21036" Body="&lt;p&gt;What is the difference between Close price and Settlement Price for future contracts?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a defined rule for evaluating the settlement price or different rules are applied for each instrument/exchange?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example the CME Emini S&amp;amp;P500(ES) or ICE Russell 2000(TF).&lt;/p&gt;&#xA;" OwnerUserId="1463" LastEditorUserId="18950" LastEditDate="2016-02-01T06:53:40.780" LastActivityDate="2016-02-01T06:53:40.780" Title="The difference between Close price and Settelment Price for future contracts" Tags="&lt;futures&gt;&lt;pricing&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2308" PostTypeId="2" ParentId="2307" CreationDate="2011-11-02T15:23:35.840" Score="9" Body="&lt;p&gt;Not really a quant question, but a quick search led to this from the CME: &lt;a href=&quot;http://www.cmegroup.com/market-data/files/CME_Group_Settlement_Procedures.pdf&quot;&gt;http://www.cmegroup.com/market-data/files/CME_Group_Settlement_Procedures.pdf&lt;/a&gt;. Unfortunately it depends on the contract, for example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equity Futures: For S&amp;amp;P and NASDAQ, the settlement price of the lead* month contract is the midpoint of the closing range determined based on pit trading activity between 15:14:30-15:15:00 Central Time (“CT”). For all other equity indices, the Volume Weighted Average Price (VWAP) of trades executed on Globex between 15:14:30-15:15:00 CT is used to determine the settlement prices for the lead month contracts. Back month contract months are settled to traded or quoted spread relationships. E-mini S&amp;amp;P and Nasdaq are settled to the value derived from the Big S&amp;amp;P and Nasdaq.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, settlement price is important because futures accounts are marked to market every day. This means that gains and losses are offset and credited or debited to traders' accounts daily. This of course reduces risk of counterparty default. The closing price is usually considered the last price traded within trading hours and the settlement price is the official price of the contract used to mark traders' books to market.&lt;/p&gt;&#xA;" OwnerUserId="1112" LastActivityDate="2011-11-02T15:23:35.840" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2309" PostTypeId="1" CreationDate="2011-11-02T17:42:57.647" Score="7" ViewCount="4796" Body="&lt;p&gt;I'm creating some .Net libraries for bond pricing and verifying its correctness with a bond pricing excel spreadsheet (Bond Pricing and Yield from &lt;a href=&quot;http://www.chisholmroth.com&quot;&gt;Chrisholm Roth&lt;/a&gt;) but I believe it calculates the Yield to Horizon erroneously. This &lt;a href=&quot;http://financetutorials.com/Tourexcerpt2.htm&quot;&gt;site&lt;/a&gt; describes how to calculate the Yield to Horizon, with the example given defined below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Settlement: 1-Jan-2000&#xA;Maturity: 1-Jan-2007&#xA;Coupon: 0.08&#xA;Period: Semi-Annual&#xA;Clean Price: 0.97&#xA;=&amp;gt;&#xA;Yield to Maturity: 0.085789&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For this example the horizon &lt;em&gt;is&lt;/em&gt; the maturity date.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Horizon: 1-Jan-2007&#xA;Horizon Re-investment: 0.05&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The bond spreadsheet I'm using calculates equivalent annual Yield to Horizon as 7.831% but that doesn't tally with this formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;${Yield\ to\ Horizon} = ((\frac{Horizon\ PV}{Bond\ PV}) ^ \frac{1}{\#payments}) ^ {period} - 1  $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in this case&lt;/p&gt;&#xA;&#xA;&lt;p&gt;${Yield\ to\ Horizon} = ((\frac{1660.75811}{970}) ^ \frac{1}{14}) ^ {2} - 1 = 0.079847 $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone confirm that 7.9847% is the correct Yield to Horizon for this example? If not, can you show me where I've gone wrong? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="403" LastActivityDate="2014-03-28T03:02:44.750" Title="Correct way to calculate bond's Yield-to-Horizon" Tags="&lt;fixed-income&gt;&lt;pricing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2310" PostTypeId="1" AcceptedAnswerId="2313" CreationDate="2011-11-02T20:07:37.373" Score="9" ViewCount="1025" Body="&lt;p&gt;My objective is to show the distribution of a portfolio's expected utilities via random sampling.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The utility function has two random components. The first component is an expected return vector which is shocked by a random Gaussian variable ($ER$). The shock shifts the location parameter of the return distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second random component is a covariance matrix which is multiplied by a random scalar $S$. The scalar is drawn from a normal random variable, centered on $1$, where the variance of $S$ corresponds to our uncertainty in whether volatility increases or decreases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My initial plan was to take separate draws of the $S$ and $EV$ and simply calculate the utility. However, clearly these random variables are not conditionally independent. In particular, research suggests that when volatility is increasing (i.e. $S &gt; 1$), the  expected returns distribution has a lower overall mean. Or, if volatility is contracting rapidly it is likely that the expected returns distribution has a higher mean.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, I should be sampling from the joint distribution of $EV$ and $S$ as opposed to the marginal distributions of $EV$ and $S$ separately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What's a good technique to estimate and sample these random variables from their joint distribution?&lt;/strong&gt; The &quot;correct&quot; approach I can think of involves defining a set of states, estimating the transition probabilities between state pairs, and sampling $EV$ and $S$ conditional on random draws of a third state variable. Seems like overkill!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A crude variation of this would be to build a transition matrix such as [ High Vol to High Vol, Low to Low, Low to High Vol, High to Low Vol ] where  the location and scale parameters ($ER$ and $S$) are informed by an &quot;expert&quot; (i.e. casual inspection of the data).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there other techniques that I may be missing that provide a solid &quot;80/20 rule&quot; solution for sampling from this joint distribution, or is state-space (markov models and the like) the only way to go? For example, perhaps there is a non-parametric technique to estimate the relationship between these two variables.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1652" LastEditDate="2011-11-15T16:02:11.293" LastActivityDate="2011-11-15T16:02:11.293" Title="Monte carlo portfolio risk simulation" Tags="&lt;risk-management&gt;&lt;monte-carlo&gt;&lt;models&gt;&lt;simulations&gt;&lt;normal-distribution&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2311" PostTypeId="1" CreationDate="2011-11-03T02:11:29.787" Score="16" ViewCount="3135" Body="&lt;p&gt;Can social media sites, like Twitter, be used to analyze financial markets for algorithmic trading? How much research has been done on this topic?&lt;/p&gt;&#xA;" OwnerUserId="1681" OwnerDisplayName="user1606" LastEditorUserId="1106" LastEditDate="2012-02-10T16:34:17.313" LastActivityDate="2021-02-07T12:17:27.590" Title="Can social media be applied to algorithmic trading?" Tags="&lt;quant-trading-strategies&gt;&lt;automated-trading&gt;&lt;research&gt;" AnswerCount="7" CommentCount="5" FavoriteCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="2312" PostTypeId="2" ParentId="2311" CreationDate="2011-11-03T08:07:25.600" Score="6" Body="&lt;p&gt;I assume that by &quot;how much research&quot; you mean &quot;could you provide me with some links&quot;....&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, as @Shane mentioned in its comment, a hedge fund recently started and is focusing on twitter analysis (here is another &lt;a href=&quot;http://www.theatlantic.com/business/archive/2011/05/the-worlds-first-twitter-based-hedge-fund-is-finally-open-for-business/239097/&quot; rel=&quot;nofollow noreferrer&quot;&gt;link&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From what I understand they are basically implementing a trend-following strategy based on the &quot;mood&quot; of twitter users (I, of course, don't know the details, but it's surely more complicated than that).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the links, we already discussed the subject of speech recognition in trading in &lt;a href=&quot;https://quant.stackexchange.com/questions/1004/how-are-cryptography-and-speech-recognition-technology-applied-to-forecasting-fi&quot;&gt;this post&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2011-11-03T08:07:25.600" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2313" PostTypeId="2" ParentId="2310" CreationDate="2011-11-03T17:18:00.320" Score="5" Body="&lt;p&gt;Since both $ER$ and $S$ are gaussian random, why not just assume their dependence is captured by their covariance, and make your draws from the bivariate normal distribution?  It is hard to construct any &lt;em&gt;other&lt;/em&gt; way of making two marginal gaussians cointegrated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even if the variables were not gaussian, you would probably find yourself relating them using a gaussian copula anyway.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-11-03T17:18:00.320" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2315" PostTypeId="2" ParentId="2311" CreationDate="2011-11-03T22:20:56.080" Score="4" Body="&lt;p&gt;The original paper on using Twitter to predict the Dow can be found &lt;a href=&quot;http://arxiv.org/abs/1010.3003&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. The hedge fund the authors are working with on trading is called Derwent Capital. An interview with the gentleman in charge can be found &lt;a href=&quot;http://www.moneyscience.com/pg/blog/Admin/read/71794/video-interview-with-paul-hawtin-founder-of-derwent-capital-the-twitter-hedge-fund&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. A quick Googling for &quot;twitter analysis paper&quot; turns up a number of results, although I am not going to post links as I have not reviewed them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The search term factors for a model would be very interesting but very few people have access to the data in sufficient granularity for it to work. You could try licensing data from network providers such as Comcast or Verizon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most of the literature on traditional text mining will be applicable to Twitter although some work will be needed to normalize for document length and the unique vocabulary on Twitter.&lt;/p&gt;&#xA;" OwnerUserId="373" LastActivityDate="2011-11-03T22:20:56.080" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2316" PostTypeId="2" ParentId="2311" CreationDate="2011-11-03T22:48:41.447" Score="2" Body="&lt;p&gt;The was an article about how ten years ago some option market-makers were crawling online discussions forums (like the Yahoo! stock board) to see what people talked about. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If discussion about some ticker spiked, they assumed the volatility for that ticker will increase and factored this into their pricing models. Of course, most of the time is was because of news related to that stock, but not always (think about pump'n'dump schemes).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume that today they are much more sophisticated about this.&lt;/p&gt;&#xA;" OwnerUserId="225" LastActivityDate="2011-11-03T22:48:41.447" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2317" PostTypeId="2" ParentId="2311" CreationDate="2011-11-03T23:08:36.003" Score="7" Body="&lt;p&gt;Personally, I am very skeptical of the claims in &quot;&lt;a href=&quot;http://arxiv.org/pdf/1010.3003v1&quot;&gt;Twitter mood predicts the stock market&lt;/a&gt;&quot;. There are several other papers with similar claims, but not so much good quality research is available. Arguably, the sweet bits of these approaches are not public. A sounder approach is to dig at the relationship between social media activity and relate it to the stock market. One idea is take social media as a proxy for investors' attention and exploit this channel to say something sensible about the stock market.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The typical viewpoint is that social media mining provides info on the interests of individual investors, in contrast to big investment firms. Within this framework the hypothesis of Barber and Odean (2008, RFS, &quot;Do retail trades move markets?&quot;) makes a lot of sense: retail investors  buy popular and news-making stocks, pushing prices up. Interestingly, their investing activity is asymmetric: buy news-makers, but only sell what they own - rarely on news. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some fresh good work on the topic, based on google searches, is the paper &quot;In search of attention&quot; by Da, Engelberg, and Gao (2011, JF) (EDIT: this is the same work pointed out by wburzyns in his comment above).&lt;/p&gt;&#xA;" OwnerUserId="1531" LastEditorUserId="1531" LastEditDate="2011-11-03T23:22:13.820" LastActivityDate="2011-11-03T23:22:13.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2318" PostTypeId="1" AcceptedAnswerId="2322" CreationDate="2011-11-04T02:16:50.197" Score="4" ViewCount="679" Body="&lt;p&gt;Is there an understood way of determining how far out the money an option can be, before it starts/stops responding to the underlying asset price changes?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I usually look at the greeks, gamma, delta, theta and volatility to determine how an options price will change, but a certain many strikes out of the money (low gamma and low delta), the option will no longer increase or decrease with the underlying asset price, and instead only be affected by volatility and time decay&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the greeks clearly explain and illuminate how this phenomena is supposed to happen, but this behavior is different for different assets, and not the same. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One stock, for instance, may have options 10 strikes out of the money that do not experience pricing fluctuations with the underlying asset, while another stock may have options 20 strikes out of the money that reply very actively to the pricing of the underlying asset&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is there a way to determine, by just looking at an option chain, how many standard deviations out of the money that the options price will increase / decrease one:one with the underlying assets fluctuations?&lt;/p&gt;&#xA;" OwnerUserId="1453" LastActivityDate="2011-11-04T14:39:58.663" Title="Standard Deviations out the money where options will respond to underlying asset price changes" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;greeks&gt;&lt;gamma&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2320" PostTypeId="2" ParentId="2294" CreationDate="2011-11-04T12:43:11.643" Score="6" Body="&lt;p&gt;Be careful, remember that the mean and the standard deviation don't tell you the whole story: &lt;a href=&quot;http://en.wikipedia.org/wiki/Anscombe%27s_quartet&quot;&gt;http://en.wikipedia.org/wiki/Anscombe%27s_quartet&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1621" LastActivityDate="2011-11-04T12:43:11.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2321" PostTypeId="1" CreationDate="2011-11-04T14:22:42.540" Score="3" ViewCount="961" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Possible Duplicate:&lt;/strong&gt;&lt;br&gt;&#xA;  &lt;a href=&quot;https://quant.stackexchange.com/questions/141/what-data-sources-are-available-online&quot;&gt;What data sources are available online?&lt;/a&gt;&lt;br&gt;&#xA;  &lt;a href=&quot;https://quant.stackexchange.com/questions/1207/earnings-and-valuation-data-sources-online&quot;&gt;Earnings and valuation data sources online&lt;/a&gt;  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&#xA;&#xA;&lt;p&gt;I'd like to backtest some strategies involving earnings release surprises, as well as moves in correlated stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any sites that offer easy to 'scrape' tables/XML/JSON of all the past historical earnings, surprises etc dates?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The SEC.GOV site is a last resort as it's fairly convoluted to 'parse'.&lt;/p&gt;&#xA;" OwnerUserId="1623" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2011-11-04T15:07:13.047" Title="What is a good site to download historical stock 'events' such as earnings releases?" Tags="&lt;data&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="0" ClosedDate="2011-11-04T15:11:58.273" ContentLicense="CC BY-SA 3.0" />
  <row Id="2322" PostTypeId="2" ParentId="2318" CreationDate="2011-11-04T14:39:58.663" Score="3" Body="&lt;p&gt;At a high level, just look at the delta.  If it's so close to zero that it won't shift the price of the option by a penny, then you could say, &quot;the option no long responds to the price of the underlying&quot;  Any price it has more or less a function of theta and vega only.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice however, depending on the model you use, delta has some volatility input.&#xA;To answer your question to find the particular strike where the price of the option only responds to volatility, simply goal seek(or iterate starting from the at-the-money strike) until delta is within some tolerance (e.g. absolute value of delta &amp;lt; .01) while inputting a constant for volatility(and ttm etc..), and using strike price as your only dynamic variable.  &lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-11-04T14:39:58.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2323" PostTypeId="1" CreationDate="2011-11-04T16:03:40.470" Score="5" ViewCount="256" Body="&lt;p&gt;If we suppose an instrument goes up or down 1 tick per $\Delta t$ (binary&#xA;model), its long term distribution will be normal, per the Central&#xA;Limit Theorem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, suppose we model as follows:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The first tick is up or down with 50% probability.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Every future tick is: 60% likely to be in the same direction as&#xA;the previous tick, 40% likely to be in the opposite direction.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The Central Limit Theorem doesn't apply here, because these are no&#xA;longer &lt;em&gt;independent&lt;/em&gt; random variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, as &lt;a href=&quot;https://stats.stackexchange.com/questions/17519/random-walk-with-momentum&quot;&gt;this post&lt;/a&gt; shows us, the resulting distribution is still normal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question: can I construct a binary model that yields a non-normal&#xA;distribution, ideally a &quot;fat tailed&quot; distribution?&lt;/p&gt;&#xA;" OwnerDisplayName="user59" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2011-11-07T15:11:27.077" Title="Can binary model lead to non-normal distribution?" Tags="&lt;models&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2324" PostTypeId="1" CreationDate="2011-11-04T21:00:52.677" Score="2" ViewCount="314" Body="&lt;p&gt;I have been building a momentum pattern detection algo (essentially involves fitting curves in overlapping windows at different timeframes) and wanted to see if anyone has done/seen similar work. I was specifically looking into intraday movements (not HFT) and don't know if I will end up doing a glorified Roscher test - but would appreciate any feeback/pointers in right direction. I have spent couple of years in various areas including TA to market pschology mumbo jumbo. I feel like I need to shake up and redirect myself.&lt;/p&gt;&#xA;" OwnerUserId="1624" LastEditorUserId="16595" LastEditDate="2018-09-28T17:28:15.330" LastActivityDate="2018-09-28T17:28:15.330" Title="TA/Pattern algorithm analysis" Tags="&lt;algorithm&gt;&lt;analysis&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ClosedDate="2018-09-28T17:37:45.560" ContentLicense="CC BY-SA 3.0" />
  <row Id="2325" PostTypeId="1" CreationDate="2011-11-05T05:43:44.437" Score="7" ViewCount="1931" Body="&lt;p&gt;Can options volume affect the underlying asset price indirectly? I know that options buying/selling does not directly affect the price of the underlying asset (rather, the asset price contributes most to the option price). I do know of technical studies and alert systems that factor in options volume, and put/call ratios, but outside of some speculation, is there a known school of thought which revalues an asset based on the desirability of its options?&lt;/p&gt;&#xA;" OwnerUserId="1453" LastEditorUserId="1106" LastEditDate="2011-11-11T03:29:57.280" LastActivityDate="2011-11-11T16:36:07.823" Title="Can options volume have an impact on the price of the underlying asset?" Tags="&lt;options&gt;&lt;valuation&gt;&lt;asset-pricing&gt;&lt;volume&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2327" PostTypeId="1" AcceptedAnswerId="2363" CreationDate="2011-11-06T18:00:17.250" Score="5" ViewCount="563" Body="&lt;p&gt;I am developing an algorithm and it needs to know what to do in certain market conditions&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It takes on a Vertical Bull Call Debit Spread on LEAPS that are 12+ months out in the future. This means that a long OTM call is taken, and a short OTM call at a higher strike price is acquired as well. The net debit will usually be small, like .20 or .50 or 2.00  , this allows it to take on MANY contracts with very little capital&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It gives only minuscule downside protection (to the entire position I mean, the entire position can take a loss quickly but it is nothing in compared to if you were only long that many contracts), but you also pick up theta decay from the short options if things don't move fast enough in your time frame&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem is legging out, because it looks like too much leverage with my calculations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The trading plan:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Buy long OTM calls, sell short further OTM calls&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In the future, 6 months in, after some theta had some time to burn , if still bullish - close the short leg for 50-80% gain&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use the proceeds from closing the short leg to average down on the long leg  (the long leg will be loss making but acquirable for much cheaper, this gives you control over a lot more contracts)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;On the first uptick you make 50% gain (on the original principal used to open vertical position), on real bullish moves you make 4000% gains&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;If market direction turns against you, still max 100% loss on original position. Capped loss. May mitigate this with a stop loss, but stops may be too tight when you have 4 months to go.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The &quot;problem&quot; is how much leverage this appears to be. I am looking at 4000% to 10000% gain on original principle. Simple put, this many contracts would not have been affordable without collecting the premium from the short options. Yet the risk is still sound and limited to 100%, especially with any position sizing done in a larger portfolio. So I'm trying to find what I'm missing. This is a bullish strategy and it appears worthwhile to periodically buy small amounts of put protection because it will keep your losses near 0% when it is just a vertical.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have my backtest going that shows everything I just described (which is really what makes me skeptical), so I would like the community to illuminate some things about verticals that I haven't already considered&lt;/p&gt;&#xA;" OwnerUserId="1453" LastEditorUserId="1453" LastEditDate="2011-11-07T03:23:22.807" LastActivityDate="2011-11-12T12:21:45.117" Title="Options: Vertical LEAPS" Tags="&lt;option-strategies&gt;&lt;derivatives&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2328" PostTypeId="2" ParentId="2238" CreationDate="2011-11-07T11:32:24.067" Score="4" Body="&lt;p&gt;I don't know if these are the most commonly traded or most popular (for your definition of popular) but here are a few exotic products that I recall being supported by the flagship product at my former employers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Exotic Options:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Asian&lt;/strong&gt; - Strike price is dependant on average price throughout the deal, not just at expiry&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Bermudan&lt;/strong&gt; - So called because it's halfway between a European and an American option i.e. can be called at fixed intervals before the maturity date.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Digital&lt;/strong&gt; - Payoffs are a fixed amount payable iff the underlying reaches an agreed price at maturity.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Barrier&lt;/strong&gt; - A barrier can be a pre-condition that must be met before an option will payout or can be a condition that renders the option null and void. It takes the form of a price level that the underlying must (or must not) attain. For example, say that you're selling a 1y call option with a strike price of 120 for an underlying stock with a spot price of 100. You introduce a barrier that says the option will not payout if the spot price reaches 140 before maturity. Such a barrier is called an &lt;em&gt;up and out&lt;/em&gt;. This limits your exposure but reduces the value of the option. Other barriers are &lt;em&gt;up and in&lt;/em&gt;: option will only payout if the spot price goes above a certain value before maturity, &lt;em&gt;down and out&lt;/em&gt;: option will not payout if the spot price drops below a certain value before maturity and &lt;em&gt;down and in&lt;/em&gt;: option will only payout if the spot price drops below a certain value before maturity.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Window Barrier&lt;/strong&gt; - As above except that multiple different barriers can be defined throughout the lifetime of the option e.g. for the first year an &lt;em&gt;up and in&lt;/em&gt; barrier is defined, for the second year a &lt;em&gt;down and in&lt;/em&gt; etc.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;A good example of an IR hybrid is a &lt;strong&gt;Convertible Bond&lt;/strong&gt;. The trade owner buys a corporate bond that they can elect to convert into equity of that company at a later date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most exotic products though are collectively referred to as structured products, those whose payoffs contain some element of logic and state. Such products have generally been tailored to meet very specific hedging/speculation scenarios and owing to their complex nature have a significant quantitative pricing and sensitivity overhead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One class of structured products is the &lt;strong&gt;Snowball&lt;/strong&gt;: a coupon payment is dependent not just on some market condition but also whether the previous coupon payment was made. Coupon payments therefore &quot;snowball&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another class is &lt;strong&gt;Mountain Ranges&lt;/strong&gt;. These are options on baskets of underlyings e.g. a &lt;strong&gt;Himalayan&lt;/strong&gt; option pays out based on the best performing asset in the basket.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A couple of references can be found &lt;a href=&quot;http://en.wikipedia.org/wiki/Exotic_option&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;http://www.hsbcnet.com/treasury/structured-products/wms-global/struc_prod_glossary.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="403" LastActivityDate="2011-11-07T11:32:24.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2329" PostTypeId="2" ParentId="2323" CreationDate="2011-11-07T15:11:27.077" Score="2" Body="&lt;p&gt;Yes you can.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Begin by choosing your favorite stochastic differential equation with a fat-tailed terminal distribution, for example a local volatility model.  Use the usual techniques to convert to a partial differential equation (PDE). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Construct an explicit finite difference scheme for solving the PDE, and make your number $M$ of grid points in time $\tau$ sufficiently large compared to the number of grid points $N$ in asset price.  Specifically, you need &#xA;$$&#xD;&#xA;N\geq 2M.&#xD;&#xA;$$&#xA;Your choice of boundary conditions has no influence on the central node since the grid is so wide.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This explicit scheme is therefore trivially equivalent to a trinomial tree.  Now, noting that one step of a trinomial tree can be constructed from two steps of a binomial tree, insert those binomial half-steps to obtain a $2M$ step binomial tree whose terminal distibution matches that of your SDE.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-11-07T15:11:27.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2330" PostTypeId="1" AcceptedAnswerId="7022" CreationDate="2011-11-07T16:11:26.563" Score="24" ViewCount="3865" Body="&lt;p&gt;Are there libraries in R for estimating time-varying joint distributions via copulas?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hedibert Lopes has an excellent &lt;a href=&quot;http://faculty.chicagobooth.edu/hedibert.lopes/research/pdf/ausin-lopes-2010.pdf&quot;&gt;paper&lt;/a&gt; on the topic here. I know there is an existing packaged called &lt;a href=&quot;http://cran.r-project.org/web/packages/copula/index.html&quot;&gt;copula&lt;/a&gt; but it fits a static copula.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="956" LastEditDate="2012-02-25T14:32:28.973" LastActivityDate="2019-07-04T08:38:02.053" Title="Tools in R for estimating time-varying copulas?" Tags="&lt;r&gt;&lt;estimation&gt;&lt;covariance&gt;&lt;distribution&gt;&lt;joint-probability&gt;" AnswerCount="3" CommentCount="8" FavoriteCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="2331" PostTypeId="1" CreationDate="2011-11-07T18:40:27.840" Score="8" ViewCount="1163" Body="&lt;p&gt;I'm happy how we store a &lt;em&gt;single&lt;/em&gt; time series but we somehow lack a system that glues them all together.  I'm talking about a few million time series coming from ~50 data vendors and representing maybe a million contracts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It appears to me that hydrologists(!) have a pretty decent framework (KiTSM) but it takes &lt;em&gt;A LOT&lt;/em&gt; of imagination to apply their (GIS-based) system to financial time series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I imagine something with a comprehensive set of command line tools for batch processing, a neat web interface for tagging and generating custom compilations and maybe something to allow users to subscribe certain compilations, as well as some bindings for the big systems, maybe a matlab/R/octave/SAS/you-name-it plugin.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not particularly fixated on &lt;em&gt;exactly&lt;/em&gt; these features, my (daily) work flow in detail:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;schedule data retrieval plans (somewhat like cron jobs) and monitor them, i.e. get a list of time series that haven't been updated this morning&lt;/li&gt;&#xA;&lt;li&gt;get all back-adjustments and other corrections to time series&lt;/li&gt;&#xA;&lt;li&gt;inform research groups that currently use those time series about corrections&lt;/li&gt;&#xA;&lt;li&gt;provide fail-over time series/data vendors on request, e.g. resort to CSI settlement prices when CME's DataMine service is down&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Something like this is best given into the hands of the end-users because they probably have a better idea of what might suit their specific needs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does a tool like this exist?&lt;/p&gt;&#xA;" OwnerUserId="1040" LastEditorUserId="1040" LastEditDate="2011-11-07T20:04:50.483" LastActivityDate="2011-11-24T19:28:09.220" Title="time series management system" Tags="&lt;data&gt;&lt;time-series&gt;" AnswerCount="2" CommentCount="7" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2332" PostTypeId="1" AcceptedAnswerId="2333" CreationDate="2011-11-07T21:02:24.190" Score="20" ViewCount="8118" Body="&lt;p&gt;Is it possible to combine different algorithms so as to improve trading performance? In particular, I have read that social media sentiment tracking, digital signal processing and neural networks all can be used for trading algorithms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would it be possible to create a trading algorithm that combines elements from these three areas or are these methods mutually exclusive in that they are incompatible with each other? If you commit to one, can you use the other?&lt;/p&gt;&#xA;" OwnerUserId="1681" OwnerDisplayName="user1606" LastEditorUserId="1106" LastEditDate="2011-11-11T03:35:28.990" LastActivityDate="2015-04-13T05:43:40.070" Title="How to combine multiple trading algorithms?" Tags="&lt;trading&gt;&lt;automated-trading&gt;&lt;quant-trading-strategies&gt;&lt;performance&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="30" ContentLicense="CC BY-SA 3.0" />
  <row Id="2333" PostTypeId="2" ParentId="2332" CreationDate="2011-11-07T21:38:09.237" Score="18" Body="&lt;p&gt;Yes. First, it is much easier to proceed if you standardize the output of your forecast so they are in the same units (returns,  for example, or probabilities of an event/condition occurring). After you have done this, there are 3 general approaches:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Signal weighting: Then you need to define a weighting scheme for your factors. Richard Grinold has an one answer to this question in his paper &quot;&lt;a href=&quot;http://www.iijournals.com/doi/abs/10.3905/jpm.2010.36.4.024&quot;&gt;Signal Weighting&lt;/a&gt;&quot;. Note there are quite a few methods to weight signals (optimization, meta-models, forecast pooling, Bayesian model averaging, weighing based on out-of-sample performance, etc.). The general problem of &quot;Signal Weighting&quot; is attracting significant research lately, and it is a hard problem with no consensus in my view.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Entropy-pooling: Instead of weighing signals you can also integrate signals using entropy-pooling. Here you would assign confidence scores to each signal and develop a new posterior distribution. Entropy-pooling will mix signals in a way that imposes the least spurious structure on your forecast. Atillio Meucci has a &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1213325&quot;&gt;paper&lt;/a&gt; on how to do this.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Build a model using these independent signals as predictor variables. You might try PCA, regression, a hierarchical model, or an ensemble technique. You also do not have to ensure the signals are in the same units although it would aid your intuition. Naturally, you'd have to proceed thru some modelling procedure and consider co-linearity, non-stationarity, etc.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-11-07T23:19:24.243" LastActivityDate="2011-11-07T23:19:24.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2334" PostTypeId="1" CreationDate="2011-11-08T05:17:58.407" Score="4" ViewCount="207" Body="&lt;p&gt;One typically models the log returns of a portfolio of equities by some unimodal, symmetric (or nearly symmetric) distribution with parameters like the mean and standard deviation estimated by empirical estimators.  For example, the most basic model would be to assume the returns are normal (yes, I know the tails are not fat enough), then fit the mean and volatility. To get fancier, one might try to fit returns to a fat-tailed distribution like a Tukey g-and-h, or a J-transformation, Lambert W x Gaussian, whatever.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the commonly used approaches, I am wondering, for modeling the returns of portfolios of one-sided instruments. For example, a portfolio consisting entirely of long vanilla put and call options. When considered from purchase to expiration, the maximum loss is bounded, but the upside is theoretically unbounded (if you have call options). Fitting to an unbounded and symmetric distribution like a normal seems unsatisfactory. What are the most commonly used models for this? I like simple models as much as fancy ones.&lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2011-11-09T13:15:07.637" Title="What are some common models for one-sided returns?" Tags="&lt;models&gt;&lt;returns&gt;&lt;distribution&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2335" PostTypeId="2" ParentId="2332" CreationDate="2011-11-08T06:29:56.017" Score="5" Body="&lt;p&gt;Whatever method you use, I recommend you test your implementation with Monte Carlo simulations as well as real data (although doing the latter subjects you to data mining bias, it can give a sanity check on your Monte Carlo simulations.)  For most instances of multiple algorithms, the returns streams will not be independent, and you should take this into account in your tests.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as the combination method to use, I would suggest you start simple with an equal dollar allocation (akin to the &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=911512&quot; rel=&quot;noreferrer&quot;&gt;1/n rule&lt;/a&gt; which seems to work well for equity portfolios), or at least an 'equal risk' allocation.  By this I mean something along the lines of &quot;put a fixed amount of money into each strategy you are trading, let them hold their own portfolios, and rebalance the money on &lt;em&gt;e.g.&lt;/em&gt; a monthly schedule.&quot; &lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2011-11-08T06:29:56.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2336" PostTypeId="1" CreationDate="2011-11-07T23:45:12.783" Score="5" ViewCount="1561" Body="&lt;p&gt;Given a cointegrated set of price series, I am trying to compute the Hasbrouck's information share, as described in &lt;/p&gt;&#xA;&#xA;&lt;p&gt;page 12-13 of &lt;a href=&quot;http://www.jamesgoulding.com/Research_II/S&amp;amp;P%27s/S&amp;amp;P%20%28Price%20Dynamics%20in%20E-minis%20revised.pdf&quot; rel=&quot;nofollow&quot;&gt;this article&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;page 7-8 of &lt;a href=&quot;http://www.isb.edu/EMFConference/File/Pricediscovery%281%29.pdf&quot; rel=&quot;nofollow&quot;&gt;this article&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the vector error correction model (VECM) set up for the price series. But I am unable to understand how to derive the vector moving average from the VECM. Does anyone have an understanding on this, on how to compute the coefficients of VMA?&lt;/p&gt;&#xA;" OwnerUserId="2198" OwnerDisplayName="user862" LastEditorUserId="467" LastEditDate="2011-11-09T08:05:27.530" LastActivityDate="2018-03-11T12:44:28.873" Title="Hasbrouck's information share" Tags="&lt;time-series&gt;&lt;finance&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2337" PostTypeId="1" AcceptedAnswerId="2338" CreationDate="2011-11-08T09:18:30.323" Score="10" ViewCount="6807" Body="&lt;p&gt;I am writing a paper with a case study in financial maths. I need to model an interest rate $(I_n)_{n\geq 0}$ as a sequence of non-negative i.i.d. random variables. Which distribution would you advise me to use? Currently I am considering the exponential distribution, but I am not sure that it is the right choice, though it is quite easy to work with.&lt;/p&gt;&#xA;" OwnerUserId="464" LastEditorUserId="1106" LastEditDate="2011-11-24T18:43:53.723" LastActivityDate="2015-08-27T13:04:50.967" Title="What distribution to assume for interest rates?" Tags="&lt;interest-rates&gt;&lt;modeling&gt;&lt;distribution&gt;" AnswerCount="6" CommentCount="3" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2338" PostTypeId="2" ParentId="2337" CreationDate="2011-11-08T11:59:11.357" Score="4" Body="&lt;p&gt;Exponential distribution, although it's a good distribution for modeling non-negative numbers, doesn't make sense here since it's mode is 0. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a pure statistical point of view, without any knowledge of interest rate, I'd recommend log-normal as in modeling stock prices and inverse-gamma or gamma distribution which are used to model variance or other scale parameters which is a non-negative distribution with mode greater than zero.&lt;/p&gt;&#xA;" OwnerUserId="1620" LastActivityDate="2011-11-08T11:59:11.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2339" PostTypeId="2" ParentId="2334" CreationDate="2011-11-08T15:26:36.550" Score="4" Body="&lt;p&gt;These returns are almost always modeled by finding some fundamental two-sided variable and modeling that.  For options, we would model their prices as derivatives -- we would take the log-returns of underlying prices as the fundamental variable, possibly with other models for what would happen to volatilities and the like, and compute the consequences for option prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a vanilla call with expiration $T$, imagine that we assume the volatilities and stock prices follow exponential brownian motion (Ornstein Uhlenbeck would be the more common assumption for vols) up to some intermediate time $\tau$ for which we want to know this call's price distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The distribution of stock prices, based on a gaussian random variable $z \sim N(0,1)$ and ignoring variation on volatility before $\tau$, is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;S_\tau \sim S_0 \exp\left(\left(r- \sigma^2/2\right) \tau  + z\sigma\sqrt{\tau} \right)&#xD;&#xA;$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and similarly for volatilities with drift $\mu$, variability $\nu$ and another gaussian random variable $w \sim N(0,1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;\sigma_\tau \sim \sigma_0 \exp\left(\left(\mu- \nu^2/2\right) \tau  + w\nu \sqrt{\tau} \right)&#xD;&#xA;$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Define these distributions as $S(z)$ and $\sigma(w)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now given the Black-Scholes formula $BS(S, \sigma)$ we can then construct the distribution of option price at tine $\tau$ from $z$ and $w$ as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;V_\tau \sim BS(S(z), \sigma(w))&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you point out, this distribution for $V_\tau$ is very one-sided.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A more interesting one-sided example than options might be treasury bonds, whose value is bounded above.  In this case, one typically simulates interest rate curves, but of course it is counterintuitive for them to dip (much) below zero.  However, we can select distributions for the interest rates based on processes that, like Black-Scholes for stocks, don't go negative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, the bond prices are twice removed from the underlying two-sided variables.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2011-11-09T13:15:07.637" LastActivityDate="2011-11-09T13:15:07.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2341" PostTypeId="2" ParentId="2311" CreationDate="2011-11-08T17:54:09.797" Score="2" Body="&lt;p&gt;A related idea is to text mine news and use it for predicting movements of stock market. See this &lt;a href=&quot;http://www.nytimes.com/2010/12/23/business/23trading.html&quot; rel=&quot;nofollow&quot;&gt;NYTimes article&lt;/a&gt; for more information.&lt;/p&gt;&#xA;" OwnerUserId="1442" LastActivityDate="2011-11-08T17:54:09.797" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2342" PostTypeId="2" ParentId="2332" CreationDate="2011-11-09T09:44:00.533" Score="5" Body="&lt;p&gt;As you mention neural network, in general, you may like to look further into various machine learning techniques.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On that side, Quant Guy also mentioned ensemble learning which is the general term to combine different learning models. I'd like to elaborate on this point a bit further:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In machine learning, traditional ways to combine models are simple voting committee, bagging, boosting (adaboost), etc. All these, you can simply google the term to get a lot of information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ensemble_learning#Stacking&quot; rel=&quot;noreferrer&quot;&gt;Stacking generalization&lt;/a&gt;, also called blending lately, is getting more and more popular in practical machine learning tasks. For example, both top two teams in the famous &lt;a href=&quot;http://en.wikipedia.org/wiki/Netflix_Prize&quot; rel=&quot;noreferrer&quot;&gt;Netflix prize&lt;/a&gt; (1 million $) applied blending heavily, often optimizing the models with thousands of model combined by blending.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For blending, you could refer to this &lt;a href=&quot;http://pragmatictheory.blogspot.com/2008/07/blending-101.html&quot; rel=&quot;noreferrer&quot;&gt;blogpost&lt;/a&gt;, from the Netflix winning team. And also, and the &lt;a href=&quot;http://scholar.google.com/scholar?q=stacking%20generalization&amp;amp;hl=en&amp;amp;btnG=Search&amp;amp;as_sdt=1,5&amp;amp;as_sdtp=on&quot; rel=&quot;noreferrer&quot;&gt;original paper&lt;/a&gt; by D. H. Wolpert.&lt;/p&gt;&#xA;" OwnerUserId="1446" LastActivityDate="2011-11-09T09:44:00.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2344" PostTypeId="1" AcceptedAnswerId="2400" CreationDate="2011-11-09T17:24:00.557" Score="7" ViewCount="1653" Body="&lt;p&gt;Sorry if this is obvious, I am not a professional.  I like to trade 30 year treasury zero's.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have noticed that the price for a 30 year principal payment is never the same as a 30 year interest payment. The difference is small (~.3%), and I haven't tracked it long enough to confirm if one is always greater than the other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone tell me what is going on here? Is there a tax arbitrage at play here? Is it that the principal is considered slightly more guaranteed than the interest payment? (Or vice versa?)&lt;/p&gt;&#xA;" OwnerUserId="1647" LastEditorUserId="1106" LastEditDate="2011-11-11T14:22:07.587" LastActivityDate="2011-11-22T20:42:21.057" Title="Why is there a price difference between 30 year principal and interest STRIPS?" Tags="&lt;fixed-income&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2345" PostTypeId="2" ParentId="1985" CreationDate="2011-11-09T19:30:17.167" Score="6" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=673504&quot;&gt;Theta Calculus&lt;/a&gt;, a system for representation of complex financial instruments.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1557083&quot;&gt;Kupper &amp;amp; Drapeau's unification of risk concepts&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Several papers by Schmid, Bodnar, Okhrin on optimal portfolio weights and tests of same. For example, &lt;a href=&quot;http://ideas.repec.org/a/spr/metrik/v67y2008i2p127-143.html&quot;&gt;A test for the weights of the global minimum variance portfolio in an elliptical model&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Similarly, &lt;a href=&quot;http://mansci.journal.informs.org/content/54/7/1364&quot;&gt;Kan and Smith's work on the distribution of the efficient frontier&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="108" LastActivityDate="2011-11-09T19:30:17.167" CommentCount="0" CommunityOwnedDate="2011-11-09T19:30:17.167" ContentLicense="CC BY-SA 3.0" />
  <row Id="2348" PostTypeId="1" CreationDate="2011-11-10T00:52:11.210" Score="1" ViewCount="75" Body="&lt;p&gt;Some years ago there was a proliferation of new products touting the ability of active managers to take short bets on securities: 130/30 funds, 150/50 funds, and the like. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the empirical performance of these actively managed funds vs. their benchmarks? For funds with positive alpha, is the contribution to alpha primarily from the longs or the shorts?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally the performance would focus on quantitative equity funds only.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-11-10T01:12:18.410" LastActivityDate="2011-11-10T01:12:18.410" Title="Performance of 1X0/X0 funds vs. traditional benchmarks?" Tags="&lt;money-management&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2351" PostTypeId="1" AcceptedAnswerId="2352" CreationDate="2011-11-10T08:58:48.067" Score="8" ViewCount="2820" Body="&lt;p&gt;Could anyone show how this could be done in R? The &lt;code&gt;dlm&lt;/code&gt; package seems to be a good start, but I can't really find any good examples to learn from.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I have two timeseries of the closing prices for two stocks. I then do a rolling regression that gives me the corresponding timeseries of the beta between the two stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would I go about to implement a Kalman filter for this beta?&lt;/p&gt;&#xA;" OwnerUserId="478" LastActivityDate="2016-11-16T12:48:53.323" Title="How does Kalman filtering of beta in pairs trading model work in R?" Tags="&lt;beta&gt;&lt;pairs-trading&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="2352" PostTypeId="2" ParentId="2351" CreationDate="2011-11-10T13:48:04.150" Score="5" Body="&lt;p&gt;Have you checked out the vingette for &lt;a href=&quot;http://cran.r-project.org/web/packages/dlm/vignettes/dlm.pdf&quot; rel=&quot;noreferrer&quot;&gt;DLM&lt;/a&gt; by Petris? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Incidentally, Petris also has an &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0387772375&quot; rel=&quot;noreferrer&quot;&gt;R-book on the DLM package&lt;/a&gt; which includes estimation of beta as an example.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-11-10T14:54:47.873" LastActivityDate="2011-11-10T14:54:47.873" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2353" PostTypeId="1" AcceptedAnswerId="2356" CreationDate="2011-11-10T18:01:29.553" Score="1" ViewCount="542" Body="&lt;p&gt;Is there any way to calculate theta at X day in future based solely on knowing&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Total Current Option Price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Days Till Expiration&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would this be done? Thank you&lt;/p&gt;&#xA;" OwnerUserId="1453" LastActivityDate="2011-11-11T13:54:05.343" Title="Calculating Theta assuming other variables remain the same" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;greeks&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2354" PostTypeId="2" ParentId="2337" CreationDate="2011-11-10T18:36:40.137" Score="0" Body="&lt;p&gt;If you manage to get some data fitting your subject, one solution could be to try an empirical distribution.&lt;/p&gt;&#xA;" OwnerUserId="1649" LastActivityDate="2011-11-10T18:36:40.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2355" PostTypeId="1" CreationDate="2011-11-11T08:59:48.580" Score="5" ViewCount="5572" Body="&lt;p&gt;How do you price calendar spread options, that is, options on the same underlying and the same strike but different times to maturity?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clarification: I'm interested in the pricing of a a CSO (calender spread option) as defined by CME Group. Following their definition, the payout of the option at expiry is (price of long nearby futures contract (e.g. September 2008) - price of deferred futures contract (e.g. September 2009) ). (Thanks to user508 for the link and clarification below). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means the question is still open, and I would be really interested in an answer. &lt;/p&gt;&#xA;" OwnerUserId="1208" LastEditorUserId="1208" LastEditDate="2012-12-30T22:17:18.253" LastActivityDate="2015-06-11T11:23:24.170" Title="How to price a calendar spread option?" Tags="&lt;options&gt;&lt;option-pricing&gt;" AnswerCount="5" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2356" PostTypeId="2" ParentId="2353" CreationDate="2011-11-11T13:54:05.343" Score="3" Body="&lt;p&gt;No, there is not.  If you are willing to assume the stock price stays constant between now and then, you could do so using the standard formula.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-11-11T13:54:05.343" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2358" PostTypeId="2" ParentId="2325" CreationDate="2011-11-11T16:36:07.823" Score="2" Body="&lt;p&gt;Nearly every options trader - and every options marketmaker - will hedge their derivatives exposure by trading the underlying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So even if I buy a set of naked calls, my counterparty (e.g. whoever is writing me the options, usually a hedge fund or a bank) will have negative exposure to the stock and buy it to cancel out their risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Think of an option as something with a certain probability of turning into a stock and a certain probability of turning into nothingness.  The delta is a rough estimate of &quot;how much of a stock is it right now&quot; - a 0.5 delta option behaves 50% like the underlying stock.  If I buy a near-delta 1 option (e.g. extremely in the money, short expiry), then I've just bought the stock.  In an efficient market that should flow through to affect the price of the stock itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's theoretically possible for this not to be the case - my cousin writes me a call option on MSFT, we treat it as a side bet on the price of the stock, and we never think about it again until the decision/expiry date - but that doesn't happen in the real world.&lt;/p&gt;&#xA;" OwnerUserId="1653" LastActivityDate="2011-11-11T16:36:07.823" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2359" PostTypeId="1" CreationDate="2011-11-11T17:08:33.847" Score="7" ViewCount="348" Body="&lt;p&gt;If a thinly traded stock has not traded for the last few days (volume=0), is it better to use the last known trade price (i.e. roll over last non-missing trade price) or use last known bid/ask/valuation price?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is for stock chart application.&lt;/p&gt;&#xA;" OwnerUserId="1654" LastEditorUserId="1106" LastEditDate="2011-11-18T18:57:04.560" LastActivityDate="2011-11-18T18:57:04.560" Title="What close price to assume for thinly traded stocks?" Tags="&lt;equities&gt;&lt;market-data&gt;&lt;visualization&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2360" PostTypeId="1" AcceptedAnswerId="2361" CreationDate="2011-11-11T18:51:55.977" Score="30" ViewCount="8962" Body="&lt;p&gt;I see that term tossed around a lot, in articles relating to HFT, and ultra high frequency data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It says at higher frequencies, smaller intervals, microstructure noise is very dominant. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is this microstructure noise that they refer to?&lt;/p&gt;&#xA;" OwnerUserId="1456" LastEditorUserId="2299" LastEditDate="2013-10-27T09:02:55.683" LastActivityDate="2013-10-27T09:02:55.683" Title="What exactly is meant by &quot;microstructure noise&quot;?" Tags="&lt;volatility&gt;&lt;statistics&gt;&lt;high-frequency&gt;&lt;market-microstructure&gt;&lt;high-frequency-estimators&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="31" ContentLicense="CC BY-SA 3.0" />
  <row Id="2361" PostTypeId="2" ParentId="2360" CreationDate="2011-11-11T20:46:46.583" Score="18" Body="&lt;p&gt;The term has a different meaning to different people. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;to econometricians, microstructure noise is a disturbance that makes high frequency estimates of some parameters (e.g. realized volatility) very unstable. Generally this strand of the literature professes agnosticism as to the its origin;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;to market microstructure researchers, microstructure noise is a deviation from fundamental value that is induced by the characteristics of the market under consideration, e.g. bid-ask bounce, the discreteness of price change, latency, and asymmetric information of traders. The last example is frequently cited but I don't think it is accurate. Asymmetric information does not have to be a microstructure phenomena, although it can be partly driven by architectural properties of the market.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1531" LastEditorUserId="254" LastEditDate="2011-12-02T14:46:31.967" LastActivityDate="2011-12-02T14:46:31.967" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2362" PostTypeId="2" ParentId="2359" CreationDate="2011-11-12T01:35:41.147" Score="6" Body="&lt;p&gt;I don't trust either. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That a stock didn't trade carries information about its liquidity and about the magnitude of  innovations in its fundamental value. If it is feasible within your model, try to incorporate the framework of Rosett (1959, “&lt;a href=&quot;http://www.jstor.org/pss/1909447&quot; rel=&quot;nofollow&quot;&gt;A Statistical Model of Friction in Economics&lt;/a&gt;”, Econometrica). For a recent application of the friction model to financial data, see “&lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/j.1540-6261.2007.01203.x/full&quot; rel=&quot;nofollow&quot;&gt;Corporate Yield Spreads and Bond Liquidity&lt;/a&gt;” (JF, by Chen, L., D. A. Lesmond, and J. Wei). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The basic idea behind using a friction model of liquidity is the following: while &lt;em&gt;true returns&lt;/em&gt; are determined by many stochastic factors, &lt;em&gt;observed returns&lt;/em&gt; mirror changes in the true value only if the liquidity costs are less then the profit to the marginal trader. &lt;/p&gt;&#xA;" OwnerUserId="1531" LastEditorUserId="467" LastEditDate="2011-11-16T12:41:27.217" LastActivityDate="2011-11-16T12:41:27.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2363" PostTypeId="2" ParentId="2327" CreationDate="2011-11-12T12:21:45.117" Score="3" Body="&lt;p&gt;It works, I tested this using weeklies and the market whipsawed enough to get all the results I needed. You earn money for your time and use that earned money to buy more of your long at much cheaper prices, giving you much more leverage using less capital. The catch is that you have to be able to afford to leg-out of your short legs. You cant use the money tied up in the spread to buyback the short leg. The max risk becomes somewhere between 125%-150% of original principle risked.&lt;/p&gt;&#xA;" OwnerUserId="1453" LastActivityDate="2011-11-12T12:21:45.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2364" PostTypeId="2" ParentId="2360" CreationDate="2011-11-12T16:04:47.727" Score="13" Body="&lt;p&gt;There are rigorous econometric definitions, as has already been eluded to by others.  For practical purposes, microstructure noise is a component of a price process that exhibits mean reversion on some (possibly time-varying) frequency.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This reversion is particularly attractive to liquidity provisioners, who seek to profit from this noise component (along with other sources of revenue).  In a strict sense, liquidity providers do not want to take directional bets on an asset (though in practice this certainly need not be the case).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since high-frequency market makers are effectively today's liquidity providers in many electronic markets (replacing the traditional NYSE specialists that had a fiduciary responsibility to provide liquidity), it's quite common to see 'HFT' intrinsically linked to 'microstructure noise'.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Be sure to check out the late Fischer Black's article, 'Noise', from JoF, 1985:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.jstor.org/pss/2328481&quot;&gt;http://www.jstor.org/pss/2328481&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although the paper's direction differs somewhat from your question, it should be of interest.&lt;/p&gt;&#xA;" OwnerUserId="390" LastActivityDate="2011-11-12T16:04:47.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2365" PostTypeId="1" CreationDate="2011-11-12T18:59:12.333" Score="8" ViewCount="848" Body="&lt;p&gt;If an underlying doesn't pay dividends (for our purpose defined as any distribution to the underlying's holder) directly or indirectly (e.g. options on futures) how does put-call parity change from the usual assumption of a European option?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular, I'm thinking of bond options like the &lt;a href=&quot;http://www.cmegroup.com/trading/interest-rates/us-treasury/10-year-us-treasury-note_contractSpecs_options.html&quot;&gt;10-year Treasury Note&lt;/a&gt;.  Clearly options like these are worth more but how much more and what factors are required to evaluate put-call parity?&lt;/p&gt;&#xA;" OwnerUserId="1658" LastEditorUserId="1658" LastEditDate="2011-11-12T19:04:56.193" LastActivityDate="2011-11-18T16:08:46.087" Title="What changes to put-call parity are necessary when evaluating american options on non-dividend paying assets?" Tags="&lt;options&gt;&lt;put-call-parity&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2366" PostTypeId="1" CreationDate="2011-11-12T19:05:40.513" Score="10" ViewCount="952" Body="&lt;p&gt;Consider american options on interest rate futures such as the &lt;a href=&quot;http://www.cmegroup.com/trading/interest-rates/us-treasury/10-year-us-treasury-note_contractSpecs_options.html&quot;&gt;10-year treasury note&lt;/a&gt;.  When is early exercise optimal?&lt;/p&gt;&#xA;" OwnerUserId="1658" LastActivityDate="2015-12-11T23:31:13.073" Title="When is it rational to exercise a bond option early?" Tags="&lt;options&gt;&lt;american-options&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2367" PostTypeId="1" AcceptedAnswerId="2368" CreationDate="2011-11-12T19:40:18.167" Score="2" ViewCount="826" Body="&lt;p&gt;I have a simple stock market trading hypothesis ...  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something along these lines:  &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Based on a certain deviation from a stock market index over a 30-day&#xA;  period, 5 certain stocks tend to drift in a particular direction&#xA;  during the next 30-day period.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I'd like to run this hypothesis on historical data to see if there's any truth to this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I go about?&lt;/p&gt;&#xA;" OwnerUserId="1659" LastActivityDate="2011-11-12T20:50:32.367" Title="Testing a simple stock market trading hypothesis?" Tags="&lt;trading-systems&gt;&lt;testing&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ClosedDate="2011-11-12T21:29:39.577" ContentLicense="CC BY-SA 3.0" />
  <row Id="2368" PostTypeId="2" ParentId="2367" CreationDate="2011-11-12T20:50:32.367" Score="3" Body="&lt;p&gt;In terms of technology, I would suggest R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of specific actions, you need to decide what to do when the trigger event occurs and you need to decide how to close the positions.  Given that, you can then determine your profit and loss on the strategy over the data period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use the random portfolio idea by running your strategy a number of times except use 5 randomly selected stocks in place of your specific 5 stocks.  You will then get a distribution of profit and loss from the random stocks to compare against the result from your real strategy.  If your strategy is not in the upper tail, then don't do your strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But even if your strategy does look good in that test, that doesn't mean it is a real phenomenon.  You got your idea from looking at market data.  You don't want the test to be based on data that gave you the idea.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And of course even if your strategy passes a truly out-of-sample test, markets can (and do) change.&lt;/p&gt;&#xA;" OwnerUserId="249" LastActivityDate="2011-11-12T20:50:32.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2370" PostTypeId="2" ParentId="2273" CreationDate="2011-11-13T07:09:31.697" Score="3" Body="&lt;p&gt;Assuming you have return time series&#xA;$$&#xA;r_1(1), r_1(2), \ldots, r_1(T) \qquad \text{and} \qquad r_2(1), r_2(2), \ldots, r_2(T)&#xA;$$&#xA;for the 2 assets and asset weights $w_1$ and $w_2$, we can follow the calculation of the $N$-asset portfolio skewness laid out in &lt;a href=&quot;https://quant.stackexchange.com/questions/1557/how-do-i-calculate-the-skewness-of-a-portfolio-of-assets/1571#1571&quot;&gt;another answer for a similar question&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To extend it to include portfolio kurtosis, we need the co-kurtosis tensor&#xA;$$&#xA;K_{ijkl} = E \left[ r_i \times r_j \times r_k \times r_l \right] = \frac{1}{T} \sum_{t=1}^T r_i(t) \times r_j(t) \times r_k(t) \times r_l(t)&#xA;$$&#xA;and moment&#xA;$$&#xA;m_4 = \sum_{i=1}^N \sum_{j=1}^N \sum_{k=1}^N \sum_{l=1}^N w_i w_j w_k w_l K_{ijkl} \quad,&#xA;$$&#xA;then we can calculate portfolio kurtosis as&#xA;$$&#xA;K_p = \frac{1}{\sigma_p^4} \left[ m_4 - 4 m_3 m_1 +6 m_2 m_1^2 - 3m_1^4 \right] \quad.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the 2 asset portfolio case, the calculations of the higher-order tensors are not so daunting, as for the $2 \times 2 \times 2$ co-skewness tensor we only need to calculate&#xA;$$\begin{split}&#xA;S_{111} &amp;amp; \\&#xA;S_{112} &amp;amp;= S_{121} = S_{211} \\&#xA;S_{122} &amp;amp;= S_{212} = S_{221} \\&#xA;S_{222} &amp;amp;&#xA;\end{split}$$&#xA;and for the $2 \times 2 \times 2 \times 2$ co-kurtosis tensor we only need to calculate&#xA;$$\begin{split}&#xA;K_{1111} &amp;amp; \\&#xA;K_{1112} &amp;amp;= K_{1121} = K_{1211} = K_{2111} \\&#xA;K_{1122} &amp;amp;= K_{1212} = K_{1221} = K_{2112} = K_{2211} \\&#xA;K_{1222} &amp;amp;= K_{2122} = K_{2221} = K_{2212} \\&#xA;K_{2222} &amp;amp;&#xA;\end{split}$$&lt;/p&gt;&#xA;" OwnerUserId="1129" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2011-11-13T07:09:31.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2371" PostTypeId="2" ParentId="2365" CreationDate="2011-11-13T07:40:27.440" Score="7" Body="&lt;p&gt;In John Hull's &lt;em&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0132777428&quot;&gt;Option's, Futures and Other Derivatives&lt;/a&gt;&lt;/em&gt;, it states in the chapter &quot;Properties of Stock Options&quot; that from put-call parity, it follows for American options that&#xA;$$&#xD;&#xA;S_0 - K \le C - P \le S_0 - K e^{-rT}&#xD;&#xA;$$&#xA;where $C$ and $P$ are the American call and put prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the book, the derivation is left as an exercise.&lt;/p&gt;&#xA;" OwnerUserId="1129" LastActivityDate="2011-11-13T07:40:27.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2372" PostTypeId="1" CreationDate="2011-11-13T09:53:56.307" Score="19" ViewCount="36418" Body="&lt;p&gt;I'm using KPSS Method to check if the series is stationary, but I would also like to use another test to confirm if the series is stationary or not, what method coudl I use?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/jDPkm.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="1660" LastEditorUserId="1660" LastEditDate="2011-11-13T13:08:23.237" LastActivityDate="2019-01-10T11:02:38.970" Title="How to check if a timeseries is stationary?" Tags="&lt;time-series&gt;&lt;stationarity&gt;" AnswerCount="8" CommentCount="5" FavoriteCount="19" ContentLicense="CC BY-SA 3.0" />
  <row Id="2373" PostTypeId="2" ParentId="2372" CreationDate="2011-11-13T10:49:42.463" Score="9" Body="&lt;p&gt;You can use the (Adjusted) Dickey Fuller Test:&#xA;&lt;a href=&quot;http://en.wikipedia.org/wiki/Dickey%E2%80%93Fuller_test&quot;&gt;http://en.wikipedia.org/wiki/Dickey%E2%80%93Fuller_test&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm pretty sure your software package has a library or routine you can use to do  it.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2011-11-13T10:49:42.463" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="2374" PostTypeId="1" CreationDate="2011-11-13T17:37:37.157" Score="15" ViewCount="1429" Body="&lt;p&gt;I'll teach an introductory course on mathematical finance in the near future.  The course is intended to entertain and broaden some &lt;em&gt;well-prepared&lt;/em&gt; advanced undergrad mathematics majors, some physics majors may attend as well.  It need not cater the sort of poorly prepared students one typically finds in quantitate finance masters programs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have recommendations for textbooks, or other materials, that provides one or more of the following :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;A reasonably rigorous treatment of Itō calculous, Stochastic processes, and Black-Scholes.   &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;It should use the Riemann–Stieltjes integral, not the Lebesgue integral.  I found Baxter and Rennie very pleasant, but it isn't rigorous enough, and doesn't work as a textbook.  Björk assumes too much background.  I dislike Shreve because the mathematical point frequently gets lost amid numerical calculations.  Any opinions?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;A good introduction to the Black-Scholes PDE. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;There isn't imho nearly enough discussion of PDE approaches in most introductory texts on Itō calculous and Black-Scholes.  Any opinions about texts that do this well? &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Draws parallels with physical processes.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You can easily show that the Black-Scholes PDE is a Heat equation evolving backwards in time, but I wish to see how a physicist would discuss this.  Any entertaining treatments of other physical analogs are helpful as well. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Treats American put options using free boundary problem techniques.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'm content with almost any simplifying assumptions here, including doing only perpetual American put options.  I cannot discuss Sobolev spaces, but some elementary calculous of variations works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I considered making this into multiple questions, since there won't be a book that does exactly what I want, but asking all points simultaneously has advantages too.&lt;/p&gt;&#xA;" OwnerUserId="1431" LastEditorUserId="1431" LastEditDate="2011-11-13T18:11:29.587" LastActivityDate="2011-11-13T23:48:35.663" Title="Any recommendations for textbooks for an undergraduate course in mathematical finance?" Tags="&lt;books&gt;&lt;mathematics&gt;&lt;learning&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="11" ClosedDate="2011-11-18T04:09:46.650" ContentLicense="CC BY-SA 3.0" />
  <row Id="2375" PostTypeId="2" ParentId="2374" CreationDate="2011-11-13T23:48:35.663" Score="6" Body="&lt;p&gt;I like Zapatero &amp;amp; Cvitanic, &quot;Introduction to the Economics and Mathematics of Financial Markets&quot;;Steele, &quot;Stochastic Calculus and Financial Applications&quot; and also Mikosh, &quot;Elementary Stochastic Calculus with Fincial View&quot;. Shreeve is always a good choice too. If you are working with physicists, SCHMIDT, &quot;QUANTITATIVE FINANCE FOR PHYSICISTS: AN INTRODUCTION&quot;.&lt;/p&gt;&#xA;" OwnerUserId="1661" LastActivityDate="2011-11-13T23:48:35.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2377" PostTypeId="2" ParentId="2372" CreationDate="2011-11-14T01:55:50.057" Score="3" Body="&lt;p&gt;The &lt;code&gt;tseries&lt;/code&gt; package has GARCH models. Here is some simple code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quantmod)&#xA;library(tseries)&#xA;getSymbols(&quot;MSFT&quot;)&#xA;ret &amp;lt;- diff.xts(log(MSFT$MSFT.Adjusted))[-1]&#xA;arch_model &amp;lt;- garch(ret, order=c(0, 3))&#xA;garch_model &amp;lt;- garch(ret, order=c(3, 3))&#xA;plot(arch_model)                                  &#xA;plot(garch_model)                                  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also, Eric Zivot has &lt;a href=&quot;http://faculty.washington.edu/ezivot/econ584/notes/unitroot.pdf&quot; rel=&quot;nofollow&quot;&gt;good notes on time-series and R&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-11-14T01:55:50.057" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2378" PostTypeId="2" ParentId="2372" CreationDate="2011-11-14T02:33:47.257" Score="15" Body="&lt;p&gt;There are many different methods for this.  Most people rely on a &lt;a href=&quot;http://en.wikipedia.org/wiki/Unit_root_test&quot;&gt;unit root test&lt;/a&gt;.  Rmetrics has collected the most common unit root tests into &lt;a href=&quot;http://help.rmetrics.org/fUnitRoots/html/UnitrootUrcaInterface.html&quot;&gt;the fUnitRoots package&lt;/a&gt;, which  primarily provides a wrapper for Bernhard Pfaff's &lt;a href=&quot;http://cran.r-project.org/web/packages/urca/index.html&quot;&gt;urca&lt;/a&gt; package.  These include:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Augmented Dickey–Fuller (ADF) test &lt;/li&gt;&#xA;&lt;li&gt;Elliott–Rothenberg–Stock test &lt;/li&gt;&#xA;&lt;li&gt;KPSS unit root test&lt;/li&gt;&#xA;&lt;li&gt;Phillips–Perron test&lt;/li&gt;&#xA;&lt;li&gt;Schmidt–Phillips test &lt;/li&gt;&#xA;&lt;li&gt;Zivot–Andrews&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you want to understand these functions in more detail, I recommend Pfaff's book on &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0387279598&quot;&gt;&quot;Analysis of Integrated and Cointegrated Time Series with R&quot;&lt;/a&gt;.  &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0387773169&quot;&gt;&quot;Applied Econometrics with R&quot;&lt;/a&gt; also provides a nice short introduction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://faculty.washington.edu/ezivot/econ584/notes/unitroot.pdf&quot;&gt;Chapter 4 of Eric Zivot's book on time series analysis covers unit root tests&lt;/a&gt; and is available on his website.  He uses S-Plus, but the urca functions are almost identical.&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="17" LastEditDate="2011-11-14T02:40:47.790" LastActivityDate="2011-11-14T02:40:47.790" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2379" PostTypeId="2" ParentId="2372" CreationDate="2011-11-14T03:47:59.420" Score="6" Body="&lt;p&gt;Yet another alternative are wavelet based tests. With comparable size, they often have higher power, especially for &lt;em&gt;very near unit root&lt;/em&gt; alternatives. An example is &lt;a href=&quot;http://journals.cambridge.org/action/displayAbstract?fromPage=online&amp;amp;aid=7881756&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt; (free pre-print versions of this paper are available, &lt;a href=&quot;http://scholar.google.ca/scholar?q=unit%20root%20tests%20with%20wavelets&amp;amp;hl=en&amp;amp;btnG=Search&amp;amp;as_sdt=1,5&amp;amp;as_sdtp=on&quot; rel=&quot;noreferrer&quot;&gt;too&lt;/a&gt;). &lt;/p&gt;&#xA;" OwnerUserId="1531" LastActivityDate="2011-11-14T03:47:59.420" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2380" PostTypeId="1" CreationDate="2011-11-14T07:57:23.070" Score="7" ViewCount="7622" Body="&lt;p&gt;Below a R code wrote by the moderator &lt;strong&gt;@richardh&lt;/strong&gt; (whom I want to thank again) about ARCH/GARCH models.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;library(quantmod)&#xA;library(tseries)&#xA;getSymbols(&amp;quot;MSFT&amp;quot;)&#xA;ret &amp;lt;- diff.xts(log(MSFT$MSFT.Adjusted))[-1]&#xA;arch_model &amp;lt;- garch(ret, order=c(0, 3))&#xA;garch_model &amp;lt;- garch(ret, order=c(3, 3))&#xA;plot(arch_model)                                  &#xA;plot(garch_model)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;My focus is to understand if the volatility of the returns is constant during all the series.&#xA;I don't understand how ARCH/GARCH models could help me understading this kind of aspect, at the moment the operations I do are:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Calculate the % returns of the stocks&lt;/li&gt;&#xA;&lt;li&gt;Linear regressione like: lm(A~B) where A and B are the stocks returns (%)&lt;/li&gt;&#xA;&lt;li&gt;Passing the residuals of the linear regression to the unit root tests.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;now the problem is to understand if the volatility is constant (take a look at the chart below, that problem is clearly visible), so the question is:&lt;/p&gt;&#xA;&lt;p&gt;How can I understand if the volatility is not constant reading ARCH/GARCH model&#xA;&lt;img src=&quot;https://i.stack.imgur.com/2mOra.png&quot; alt=&quot;Non stationary volatility&quot; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;garch_model &amp;lt;- garch(rnorm(1000), order=c(3, 3))&#xA;&amp;gt; summary(garch_model)&#xA;&#xA;Call:&#xA;garch(x = rnorm(1000), order = c(3, 3))&#xA;&#xA;Model:&#xA;GARCH(3,3)&#xA;&#xA;Residuals:&#xA;      Min        1Q    Median        3Q       Max &#xA;-3.394956 -0.668877 -0.008454  0.687890  3.221826 &#xA;&#xA;Coefficient(s):&#xA;    Estimate  Std. Error  t value Pr(&amp;gt;|t|)&#xA;a0 7.133e-01   7.156e+00    0.100    0.921&#xA;a1 1.752e-02   3.750e-02    0.467    0.640&#xA;a2 6.388e-03   1.924e-01    0.033    0.974&#xA;a3 6.486e-14   1.711e-01    0.000    1.000&#xA;b1 7.396e-02   1.098e+01    0.007    0.995&#xA;b2 8.052e-02   1.120e+01    0.007    0.994&#xA;b3 8.493e-02   4.279e+00    0.020    0.984&#xA;&#xA;Diagnostic Tests:&#xA;        Jarque Bera Test&#xA;&#xA;data:  Residuals &#xA;X-squared = 1.4114, df = 2, p-value = 0.4938&#xA;&#xA;&#xA;        Box-Ljung test&#xA;&#xA;data:  Squared.Residuals &#xA;X-squared = 0.0061, df = 1, p-value = 0.9377&#xA;&#xA;&amp;gt; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;&lt;strong&gt;garch_model$fitted.values&lt;/strong&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/fjvUB.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/p&gt;&#xA;" OwnerUserId="1663" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2013-08-08T08:26:35.530" Title="How GARCH/ARCH models are useful to check the volatility?" Tags="&lt;time-series&gt;&lt;garch&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2381" PostTypeId="2" ParentId="2380" CreationDate="2011-11-14T09:22:56.223" Score="6" Body="&lt;p&gt;ARCH and GARCH are, by essence heteroskedastic models, that is, with non-constant volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you fit these models to your sample, it will provide you with a time series of the volatility for each point (you can construct it actually). If the values are not the same for all $t$, then the volatility is not constant, &lt;strong&gt;&lt;em&gt;according to these models&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you are looking to do here is to &lt;em&gt;fit&lt;/em&gt; the model (GARCH or ARCH) to your time series (look at the &lt;a href=&quot;http://en.wikipedia.org/wiki/Autoregressive_conditional_heteroskedasticity&quot;&gt;GARCH definition&lt;/a&gt;). That means that the algorithm in your &lt;code&gt;garch&lt;/code&gt; fonction basically finds the parameters that match the best your sample.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see on the &lt;a href=&quot;http://www.stat.ucl.ac.be/ISdidactique/Rhelp/library/tseries/html/garch.html&quot;&gt;description of the &lt;code&gt;garch&lt;/code&gt; function&lt;/a&gt;, you get different information on the returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With your parameters you can recreate your $\sigma_t^2$, which is the volatility at time $t$ (hence, it's a time series).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it's not constant (or say, relatively constant) you can see that you detected volatility clusters in your series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To say it differently, plot your time series of $\sigma_t^2$. If it is a straight line, the vol. is constant.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2011-11-14T09:54:56.130" LastActivityDate="2011-11-14T09:54:56.130" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="2382" PostTypeId="1" CreationDate="2011-11-14T15:37:31.100" Score="4" ViewCount="120" Body="&lt;p&gt;I subscribe to various blogs and twitter feeds which I use to parse for keywords. Many times these subscriptions do not include topics which are of the primary concern.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there multiplex channels to subscribe to which aggregate over a very diverse range of financial topics? Is the only solution for each person to search and hand pick these or is there a database listing possible features and statistics for feeds?&lt;/p&gt;&#xA;" OwnerUserId="803" LastActivityDate="2011-11-14T15:37:31.100" Title="single channel for multiple feeds of news?" Tags="&lt;data&gt;&lt;database&gt;&lt;information&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ClosedDate="2011-11-16T21:46:35.377" ContentLicense="CC BY-SA 3.0" />
  <row Id="2385" PostTypeId="2" ParentId="141" CreationDate="2011-11-15T22:44:44.273" Score="5" Body="&lt;p&gt;Mostly (macro-)economic but also stuff from &lt;a href=&quot;http://xignite.com&quot; rel=&quot;noreferrer&quot;&gt;xignite&lt;/a&gt; free (as of 2011-11-15): &lt;a href=&quot;http://datamarket.com&quot; rel=&quot;noreferrer&quot;&gt;http://datamarket.com&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1040" LastActivityDate="2011-11-15T22:44:44.273" CommentCount="0" CommunityOwnedDate="2011-11-15T22:44:44.273" ContentLicense="CC BY-SA 3.0" />
  <row Id="2386" PostTypeId="2" ParentId="2359" CreationDate="2011-11-15T23:53:13.433" Score="3" Body="&lt;p&gt;By &lt;em&gt;stock chart application&lt;/em&gt; you mean you are making a charting tool for traders? Typically there is a choice to plot trade, bid or ask, and almost all the time they will want to look at trade prices. If a stock hasn't been trading then the flatline (or gap) on the chart communicates that.&lt;/p&gt;&#xA;" OwnerUserId="1587" LastActivityDate="2011-11-15T23:53:13.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2387" PostTypeId="1" CreationDate="2011-11-15T23:47:42.463" Score="9" ViewCount="2827" Body="&lt;p&gt;I have recently undertaken a research into automated algorithmic trading algorithms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The aim of the research is to focus on studying algorithmic trading and trying to improve a basic implementation of an algorithm that exists.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The algorithms usually analyze past market data, social media events and other factors in near real time to find patterns and trends using an auto-regressive learning model with gradient descent and thus they attempt to predict market movements. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am currently reading through the book &quot;Algorithmic trading and DMA by Barry Johnson&quot; as this was suggested in one of the forums that I encountered.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I realize that there are various models that have been implemented.  Given the time frame for the project, which is 8 months, I would like to know if there are any good suggestions on starting points for this project.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, any books, papers that you can recommend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More specifically, it would be helpful if you could suggest a specific algorithm that I can look at to start with considering I am new to the field of algorithmic trading in particular.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since, the question appears vague, I have added a description of the project below&#xA;&lt;a href=&quot;http://algorithmic-trading-research.tumblr.com/post/12885213702/project-description&quot; rel=&quot;noreferrer&quot;&gt;http://algorithmic-trading-research.tumblr.com/post/12885213702/project-description&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1669" OwnerDisplayName="k9ty" LastEditorUserId="1669" LastEditDate="2011-11-16T17:31:36.507" LastActivityDate="2011-11-17T02:22:09.950" Title="Which algorithm should I look into to kick off my research in algorithmic trading?" Tags="&lt;trading&gt;&lt;high-frequency&gt;&lt;market-data&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="6" ClosedDate="2011-11-17T21:52:48.177" ContentLicense="CC BY-SA 3.0" />
  <row Id="2388" PostTypeId="2" ParentId="2387" CreationDate="2011-11-16T10:10:40.790" Score="4" Body="&lt;p&gt;Your question is &lt;strong&gt;&lt;em&gt;very&lt;/em&gt;&lt;/strong&gt; vague, which makes it almost off-topic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would suggest you to look into trend-following algorithms, as the most basic ones are very easy to understand; look for trading strategies involving &lt;a href=&quot;http://en.wikipedia.org/wiki/Moving_average&quot; rel=&quot;nofollow&quot;&gt;moving averages&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if you want to improve an algorithm within 8 months, alone, I think it will be pretty difficult.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is that for?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My educated guess: a master thesis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that's the case I'd suggest you to look to apply the trend-following strategies on different markets and see if they work everywhere (they don't) and explain why.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Algorithmic trading is not easy, it requires a lot of work, a good infrastructure and depending on the data required, a large amount of money.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2011-11-16T16:06:51.400" LastActivityDate="2011-11-16T16:06:51.400" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2389" PostTypeId="1" CreationDate="2011-11-16T18:41:09.823" Score="8" ViewCount="960" Body="&lt;p&gt;How sensitive are vertical spreads to changes in volatility / implied volatility in the money, at the money, and out of the money?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm thinking for 1 point spreads this would be very small / neutral for ITM, ATM, and OTM, but I'm not sure.  If you have thoughts on this, perhaps please confirm in a comment or answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For larger spreads, it would become larger / less neutral, but does it follow any specific &quot;formula&quot;?   Is it just a subtraction of vegas, with a large implied volatility skew causing a great difference?&lt;/p&gt;&#xA;" OwnerUserId="1675" LastEditorUserId="1106" LastEditDate="2011-11-24T16:25:52.053" LastActivityDate="2011-12-30T05:44:49.373" Title="How sensitive are vertical spreads to changes in implied volatility?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;implied-volatility&gt;&lt;spread&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2390" PostTypeId="2" ParentId="2387" CreationDate="2011-11-17T02:22:09.950" Score="6" Body="&lt;p&gt;The term &quot;algorithmic trading&quot;, as its most often used, refers to strategies that are used to optimally execute an existing view (this usually means trying to reduce &lt;a href=&quot;http://en.wikipedia.org/wiki/Market_impact&quot;&gt;market impact&lt;/a&gt;).  The most well-known benchmark strategy is &lt;a href=&quot;http://en.wikipedia.org/wiki/VWAP&quot;&gt;VWAP&lt;/a&gt;, which targets the &quot;volume weighted average price&quot; (similar to &lt;a href=&quot;http://en.wikipedia.org/wiki/TWAP&quot;&gt;TWAP&lt;/a&gt;, which instead tries to evenly space trades over time).  Other examples include things like Iceberg, Sniper, and Guerrilla.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a very big area of study.  The book you cite is a good source; I also really like &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0814407242&quot;&gt;&quot;Optimal Trading Strategies&quot;&lt;/a&gt;.  The classic paper on the subject is &lt;a href=&quot;http://www.cims.nyu.edu/~almgren/papers/optliq.pdf&quot;&gt;&quot;Optimal Execution of Portfolio Transactions&quot;&lt;/a&gt; (Almgren and Chriss 2000).  &lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2011-11-17T02:22:09.950" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2391" PostTypeId="1" CreationDate="2011-11-17T03:48:44.137" Score="18" ViewCount="3814" Body="&lt;p&gt;I'm interested to know what are the critical reference texts you rely on for portfolio or risk management? I mean those texts that you come back to because they are chock full of insight and know-how. For example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bernd Scherer - Portfolio Construction and Risk Budgeting (2005)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Grinold and Kahn - Active Portfolio Management (2002)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Meucci - Risk and Asset Allocation (2010)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Glasserman - Monte Carlo Methods in Financial Engineering (2003)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;John Cochrane - Asset Pricing (2005)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gregory Connor - Portfolio Risk Analysis (2010)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ruey Tsay - Analysis of Financial Time Series&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Friedman - Elements of Statistical Learning&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Geweke - Contemporary Bayesian Econometrics and Statistics&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="70" LastEditDate="2011-11-17T16:34:42.893" LastActivityDate="2011-11-17T17:34:21.927" Title="What books should any quantitative portfolio manager or risk manager have as reference?" Tags="&lt;risk-management&gt;&lt;portfolio-management&gt;&lt;reference-request&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="14" ClosedDate="2011-11-17T21:49:31.740" CommunityOwnedDate="2011-11-17T16:34:21.850" ContentLicense="CC BY-SA 3.0" />
  <row Id="2392" PostTypeId="2" ParentId="2391" CreationDate="2011-11-17T08:53:02.963" Score="3" Body="&lt;p&gt;I think that one is also pretty well-known:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NcNeil, Frei, Embrechts  - &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0691122555&quot; rel=&quot;nofollow&quot;&gt;Quantitative Risk Management&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Paul Wilmott - &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470748753&quot; rel=&quot;nofollow&quot;&gt;Frequently Asked Questions in Quantitative Finance&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2011-11-17T09:07:12.037" LastActivityDate="2011-11-17T09:07:12.037" CommentCount="0" CommunityOwnedDate="2011-11-17T16:34:21.850" ContentLicense="CC BY-SA 3.0" />
  <row Id="2393" PostTypeId="2" ParentId="2391" CreationDate="2011-11-17T08:55:11.677" Score="7" Body="&lt;p&gt;Hull - Options, Futures and other Derivatives.&lt;/p&gt;&#xA;" OwnerUserId="357" LastEditorUserId="467" LastEditDate="2011-11-17T09:13:32.493" LastActivityDate="2011-11-17T09:13:32.493" CommentCount="1" CommunityOwnedDate="2011-11-17T16:34:21.850" ContentLicense="CC BY-SA 3.0" />
  <row Id="2395" PostTypeId="2" ParentId="2391" CreationDate="2011-11-17T16:40:02.143" Score="4" Body="&lt;p&gt;Luenberger - Investment Science (1997)&lt;/p&gt;&#xA;" OwnerUserId="1112" LastActivityDate="2011-11-17T16:40:02.143" CommentCount="0" CommunityOwnedDate="2011-11-17T16:40:02.143" ContentLicense="CC BY-SA 3.0" />
  <row Id="2396" PostTypeId="2" ParentId="2372" CreationDate="2011-11-17T17:14:36.593" Score="1" Body="&lt;p&gt;Divide the time series into two sections (e.g. 1st half and 2nd half) and construct the CDF for each part.  The CDFs should be the same if the series is stationary.  Since the CDFs will never be &lt;em&gt;exactly&lt;/em&gt; the same you can apply Pearson's $\chi^{2}$ test comparing the value of the CDFs through several waypoints. I believe this test was created by the late &lt;a href=&quot;http://cliffordsherry.blogspot.com/&quot; rel=&quot;nofollow&quot;&gt;Cliff Sherry&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="47" LastActivityDate="2011-11-17T17:14:36.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2398" PostTypeId="2" ParentId="2391" CreationDate="2011-11-17T17:34:21.927" Score="3" Body="&lt;p&gt;I love Carol Alexander's &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470997990&quot; rel=&quot;nofollow&quot;&gt;Market Risk Analysis&lt;/a&gt;! &lt;/p&gt;&#xA;" OwnerUserId="1577" LastActivityDate="2011-11-17T17:34:21.927" CommentCount="0" CommunityOwnedDate="2011-11-17T17:34:21.927" ContentLicense="CC BY-SA 3.0" />
  <row Id="2400" PostTypeId="2" ParentId="2344" CreationDate="2011-11-18T03:46:53.420" Score="8" Body="&lt;p&gt;This really is an arbitrage. It is caused by differences in supply and demand between the interest cashflow and the principal cashflow and by differences in the financing rates on the two STRIPS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you noted, the price difference is small, and it would take 30 years to guarantee convergence. In addition, the outstanding amount of the 30-year coupon strip (the interest payment) is quite small, since the only source of this cashflow is the 30yr bond itself and therefore the amount available is only half of the annual interest amount of the bond - if you're talking about the current 30yr, only \$250mm can be stripped compared to a \$16 billion principal amount. Therefore, it is currently not particularly attractive as arbs go. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, if you were going to try to capture this arbitrage by shorting the principal strip and buying the coupon strip, you would need to borrow the principal strip and finance the coupon strip. A price difference of 1% is approximately equal to a yield differential on these two instruments of 3 basis points. As a result, if the interest you earned on your short proceeds was just 3bp less than the interest you paid to finance the purchase over the life of the trade, you would not make any money on the trade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally speaking, the principal strips or &quot;P&quot;s usually trade rich to the coupon strips, but this is not a hard and fast rule. At times this arbitrage can become quite large, as much as a 3-5% price difference between two bonds.&lt;/p&gt;&#xA;" OwnerUserId="1682" LastActivityDate="2011-11-18T03:46:53.420" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2401" PostTypeId="2" ParentId="2366" CreationDate="2011-11-18T03:49:21.797" Score="4" Body="&lt;p&gt;Since the treasury note future does not pay coupons or dividends, and is a future as opposed to a cash instrument that you purchase, it is never optimal to exercise early.&lt;/p&gt;&#xA;" OwnerUserId="1682" LastActivityDate="2011-11-18T03:49:21.797" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2402" PostTypeId="1" AcceptedAnswerId="2403" CreationDate="2011-11-18T09:47:10.300" Score="8" ViewCount="1520" Body="&lt;p&gt;I have a simple question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the Black-Scholes Formula convex with respect to Implied volatility  parameter $\sigma$ (for calls or put) ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I say Black-Scholes I mean for a call the following one (on Forward price $F_t$):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Call (F_t,T-t, K, \sigma^2) = F_t.N(d_1) - K.e^{-r.(T-t)}.N(d_2)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d_1=\frac{Ln(F_t/K)+1/2.\sigma^2.(T-t)}{\sigma.\sqrt{T-t}}$$&#xA;$$d_2=d_1 - \sigma.\sqrt{T-t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and for a put &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Put (F_t,T-t, K, \sigma^2) = K.e^{-r.(T-t)}.N(-d_2)-F_t.N(-d_1) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: I know the answer is no but is there a fancy way to prove this (i.e. no brutal force differentiation of the vega)&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="92" LastEditDate="2011-11-18T14:14:32.777" LastActivityDate="2014-03-21T20:18:13.790" Title="Convexity of BS Equation for Call and Put" Tags="&lt;black-scholes&gt;&lt;soft-question&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2403" PostTypeId="2" ParentId="2402" CreationDate="2011-11-18T14:41:26.950" Score="8" Body="&lt;p&gt;Sure.  The formula for vega (you probably recall) is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;v(\sigma) = S n( d_1(\sigma) )\sqrt{T-t}&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The gaussian PDF, $n(\cdot)$, is strictly non-convex, having a local maximum at zero.  There is therefore a corresponding maximum of vega occurring where the strike $K_\text{max}$ solves&#xA;$$&#xD;&#xA;d_1(\sigma)=0&#xD;&#xA;$$&#xA;which works out to&#xA;$$&#xD;&#xA;K_\text{max} = S \exp((r-q-\frac12\sigma^2)\sqrt{T-t}).&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, for this strike we have for any $\sigma_1,\sigma_2$ such that  $\sigma_1&amp;lt;\sigma&amp;lt;\sigma_2$, that&#xA;$$&#xD;&#xA;d_1(\sigma_1)&amp;lt;0=d_1(\sigma)&amp;lt;d_1(\sigma_2)&#xD;&#xA;$$&#xA;and since $0$ is the argmax of $n(\cdot)$&#xA;$$&#xD;&#xA;n(d_1(\sigma_{1,2}))&amp;lt;n(d_1(\sigma))=1.&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It follows that for any $\lambda \in [0,1]$&#xA;$$&#xD;&#xA;\lambda v(\sigma_{1})+(1-\lambda) v(\sigma_{2})&amp;lt;v(\sigma)&#xD;&#xA;$$&#xA;proving concavity of vega.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2011-11-21T19:31:10.733" LastActivityDate="2011-11-21T19:31:10.733" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2404" PostTypeId="2" ParentId="1162" CreationDate="2011-11-18T14:48:45.703" Score="9" Body="&lt;p&gt;If you are trying to arbitrage the put-call parity, then use your collateral interest rate for the options side, and your cost of funds on the stock side of the equation.  Yes, that's right, 2 different interest rates.  Also, don't forget to incorporate bid-ask spreads.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are trying to turn a put into a call for your own book, you don't actually need this computation, since the total delta is 1.0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are trying to infer volatilities, then you should use the customary interest rates and borrow costs of the market makers.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-11-18T14:48:45.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2405" PostTypeId="2" ParentId="2366" CreationDate="2011-11-18T15:50:09.730" Score="4" Body="&lt;p&gt;As OracleOfNJ said, there is never any advantage to early exercise of an American style &lt;em&gt;call&lt;/em&gt; option unless the underlying asset offers some advantage, usually dividends, which does not apply to interest rate futures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;American &lt;em&gt;put&lt;/em&gt; options were among the biggest open problems in finance until people learned how to treat them as &lt;a href=&quot;http://en.wikipedia.org/wiki/Free_boundary_problem&quot; rel=&quot;nofollow&quot;&gt;free boundary problems&lt;/a&gt;.  In other words, you'd first derive the Black-Scholes-like PDE that describes the equivalent European option product, but you'd solve it with a lower boundary condition described in terms of the PDE's solution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've never thought about American put options on interest rate futures specifically, but a Google search for &quot;&lt;a href=&quot;http://www.google.com/search?q=American+put+free+boundary+problem&quot; rel=&quot;nofollow&quot;&gt;American put free boundary problem&lt;/a&gt;&quot; yields some reasonable starting points, and an arxiv.org search for &quot;&lt;a href=&quot;http://arxiv.org/find/all/1/all:+AND+American+put/0/1/0/all/0/1&quot; rel=&quot;nofollow&quot;&gt;American put&lt;/a&gt;&quot; has many relevant articles.&lt;/p&gt;&#xA;" OwnerUserId="1431" LastActivityDate="2011-11-18T15:50:09.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2406" PostTypeId="2" ParentId="2365" CreationDate="2011-11-18T16:08:46.087" Score="4" Body="&lt;p&gt;There is an interesting article entitled &lt;a href=&quot;http://www.math.nyu.edu/research/carrp/papers/pdf/apcs2.pdf&quot; rel=&quot;nofollow&quot;&gt;American Put Call Symmetry&lt;/a&gt; from the mid 90s that might be what you want.&lt;/p&gt;&#xA;" OwnerUserId="1431" LastActivityDate="2011-11-18T16:08:46.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2407" PostTypeId="1" CreationDate="2011-11-20T11:23:01.017" Score="9" ViewCount="3151" Body="&lt;p&gt;How do you replicate the payoff of a constant maturity swap rate?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, if the payoff of a contract pays the 5-year swap rate every year for 10 years, how would you replicate this payoff using swaptions?&lt;/p&gt;&#xA;" OwnerUserId="983" LastEditorUserId="1106" LastEditDate="2011-11-24T18:27:20.730" LastActivityDate="2011-11-30T15:47:24.653" Title="What is the replicating portfolio of swaptions for a constant maturity swap (CMS)?" Tags="&lt;fixed-income&gt;&lt;derivatives&gt;&lt;replication&gt;&lt;cms&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2408" PostTypeId="2" ParentId="2029" CreationDate="2011-11-20T19:27:58.867" Score="2" Body="&lt;p&gt;I haven't completely followed your question.  Are you asking about the optimal rebalance frequency in the presence of t-costs and a changing alpha signal?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually you would include the t-cost estimate as another term in your optimization (to constrain the weights).  This acts to limit the trading &quot;aggressiveness&quot;.  In other words, you can think of the problem as (1) changing your rebalance frequency because trading too often will result in excess t-costs or (2) changing your trading aggressiveness, where aggressiveness simply denotes how far you trade toward your unconstrained portfolio.  They have equivalent effects, except that strictly rebalancing less frequently has the advantage/disadvantage of making you sensitive to end points (e.g. if you rebalance on month-end, then your results will be sensitive to behavior at that specific time).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I would suggest that you consider instead moving to a higher-frequency rebalance but adding a t-cost term into the portfolio optimization.  This is tricky, but you can look at these recent papers:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://pages.stern.nyu.edu/~lpederse/papers/DynamicTrading.pdf&quot; rel=&quot;nofollow&quot;&gt;Garleanu and Pedersen &quot;Dynamic Trading with Predictable Returns and&#xA;Transaction Costs&quot; 2009&lt;/a&gt;.  This paper provides a closed form solution to the optimization by assuming quadratic t-costs.  One major function of the paper is the additional focus on the alpha decay of the strategy, and the optimal combination of strategies with different alpha decay horizons.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.stanford.edu/~boyd/papers/pdf/dyn_port_opt.pdf&quot; rel=&quot;nofollow&quot;&gt;Skaf and Boyd &quot;Multi-Period Portfolio Optimization with Constraints and Transaction Costs&quot; 2009&lt;/a&gt;.  This is more directly related to the problem as you have described it as a multi-period optimization, except they add additional constraints and solve it without dynamic programming as a convex optimization problem.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="17" LastEditorUserId="17" LastEditDate="2011-11-20T19:33:50.413" LastActivityDate="2011-11-20T19:33:50.413" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2410" PostTypeId="2" ParentId="2407" CreationDate="2011-11-20T22:32:09.657" Score="4" Body="&lt;p&gt;A good place to start is Hagan's paper &lt;a href=&quot;http://www.wilmott.com/pdfs/050118_hagan.pdf&quot; rel=&quot;nofollow&quot;&gt;Convexity Conundrum&lt;/a&gt; ...available on the web.&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="467" LastEditDate="2011-11-30T15:47:24.653" LastActivityDate="2011-11-30T15:47:24.653" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2411" PostTypeId="1" CreationDate="2011-11-20T23:40:36.787" Score="4" ViewCount="582" Body="&lt;p&gt;I'm familiar with supervised learning algorithms like regression and neural networks which look at a bunch of input points and learn a function which outputs a value (the value varying depending on whether the algo is a classifier, logistic regression, or standard regression)..but I am facing a problem now where each observation I have is a couple of data points (TAQ data), and then after a fixed amount of these chronologically sorted events there is a spike and what appears to follow an exponential decay mean reversion. Every such instance described here is one of my observations and my goal is to predict/model this exponential decay mean reversion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What type of algorithms would do something like this? time series models a-la ARCH/GARCH followed by a prediction look-ahead of N steps after training them or what else?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you, any type of suggestions or advice/references are greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="1456" LastActivityDate="2011-11-20T23:40:36.787" Title="Algorithms for predicting a couple points in the future" Tags="&lt;time-series&gt;&lt;modeling&gt;&lt;machine-learning&gt;&lt;prediction&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2412" PostTypeId="1" AcceptedAnswerId="2414" CreationDate="2011-11-21T02:13:08.143" Score="8" ViewCount="7268" Body="&lt;p&gt;How can one compute the alpha decay of a systematic trading strategy?&lt;/p&gt;&#xA;" OwnerUserId="658" LastEditorUserId="1106" LastEditDate="2011-11-24T18:39:02.517" LastActivityDate="2011-11-30T11:10:52.057" Title="How to compute the alpha decay of a strategy?" Tags="&lt;backtesting&gt;&lt;quant-trading-strategies&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2413" PostTypeId="2" ParentId="2331" CreationDate="2011-11-21T09:21:13.747" Score="0" Body="&lt;p&gt;&lt;strong&gt;Like most software projects, your decision should be based on what your researchers intend to use the data for.&lt;/strong&gt;  Do they need mark-to-market for real-time or end-of-day reports or is it just for statistical analysis?  Do they need bid-ask data?  Tick data or minute bars?  Is the data periodic or aperiodic?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For statistical analysis, the data format should be amenable to S-Plus, R, Matlab, or whatever statistical software is being used.  For reports, your data might need to be stored in a column-based RDBMS or a kdb-type database.  For simulations, it will depend on what the simulations are written in (C++, Java?) - a binary format may be fastest here, but it wouldn't be very portable to other uses.  You may end up storing your data in multiple formats, but then you have to deal with keeping all your data in-sync.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The success of your project (measured by how much your data is used) will totally depend on how accessible your data is to your users.  So, as you briefly touched upon, the aptitude of your users towards software/data will factor into your decisions.  Talk to all your users to assess their needs - you need to discern their requirements clearly before you design your project into a sub-optimal direction.&lt;/p&gt;&#xA;" OwnerUserId="1563" LastActivityDate="2011-11-21T09:21:13.747" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2414" PostTypeId="2" ParentId="2412" CreationDate="2011-11-21T15:22:10.603" Score="9" Body="&lt;p&gt;The short answer (which represents one way of surely many ways to do it) is to watch the t-stat of a performance metric such as information coefficient vanish over time. IC is the correlation of predicted expected returns from your alpha strategy to the underlying benchmark.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Look at the expected returns your alpha strategy predicted over the past N time intervals and see how those predicted returns were correlated with the benchmark. This is the IC.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The crux of course is that you need to test if the IC is statistically different from zero or is just random noise. You would do this by computing the t-stat over time and watch it decay as the strategy you managed to build over hundreds of hours of research is unceremoniously drained of edge.&lt;/p&gt;&#xA;" OwnerUserId="1112" LastActivityDate="2011-11-21T15:22:10.603" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2416" PostTypeId="2" ParentId="2344" CreationDate="2011-11-22T20:42:21.057" Score="4" Body="&lt;p&gt;This may not apply in the US, but in some countries the interest income is taxed and the principal isn't, so in some markets the difference amounts to the implicit tax. &lt;/p&gt;&#xA;" OwnerUserId="1693" LastActivityDate="2011-11-22T20:42:21.057" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2417" PostTypeId="2" ParentId="38" CreationDate="2011-11-22T23:54:16.360" Score="2" Body="&lt;p&gt;Mortgage backed securities are valued by calculating the net present value (NPV) of cash flows they are expected to generate. These cash flows are predicted using a model that incorporates all the contractual characteristics of the security and the underlying loans, as well as assumptions on things like prepayment speed, default speed, loss severity, and forward interest rates. Discount rates are generally determined by adding a spread to the yields on the pricing yield curve. This spread is an observed or assumed market option adjusted spread (OAS) in the case of securities with embedded options or Z-spread in the case of option free bonds.&lt;/p&gt;&#xA;" OwnerUserId="1695" LastActivityDate="2011-11-22T23:54:16.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2418" PostTypeId="1" AcceptedAnswerId="2427" CreationDate="2011-11-23T01:53:54.277" Score="9" ViewCount="2208" Body="&lt;p&gt;I am working on an intraday strategy using 5/10 minute bars. I am getting a decent return and sharpe on the strategy. But on close examination I see that I am making about 1 cent per trade (I haven't taken transaction cost into account). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do you guys go about choosing a good intraday strategy ? I have always used sharpes and CGAR for long-hold time strategy but seems like evaluating intraday strategies is a different beast. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also notice that my strategy makes money for symbols in certain sector, and not for other ( this is my backtesting dataset). Do you normally throw out symbols with negative returns when doing a forward test as part of your portfolio ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDITED:&#xA;This strategy is based on US equities and yes I am using a combination of midprice and previously traded price. Question is quite simple I think, how do you guys evaluate intraday strategies ? How big of a factor is slippage intraday ( on a 10 minute scales for example). ?&lt;/p&gt;&#xA;" OwnerUserId="1696" LastEditorUserId="1696" LastEditDate="2011-11-24T01:41:07.017" LastActivityDate="2012-01-05T03:26:11.893" Title="How to vet an intraday strategy" Tags="&lt;automated-trading&gt;&lt;backtesting&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2420" PostTypeId="1" CreationDate="2011-11-23T16:38:53.180" Score="6" ViewCount="499" Body="&lt;p&gt;In a Barrier option (where the contract cancels when the underlying hits the barrier) I succesfully found the way to compute the probability of a single underlying touching the barrier (with constant volatility). The problem comes when I have an average basket of underlyings $B_t$&#xA;$$&#xD;&#xA;B_t = \sum_{i=1}^n \omega_iS_t,\qquad \sum_{i=1}^n\omega_i=1\ .&#xD;&#xA;$$&#xA;I don't know how to properly calculate the probability of the basket $B_t$ touching the barrier. I think I need to take into account the correlations $\langle dW_t^{i},dW_{t}^{j}\rangle=\rho_{ij}$ between assets but i just don't know how to do it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm considering constant volatility and constant correlation thoughout an arbitrary time step.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Extra: Same question if the basket is Best Of/Worst Of type.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not expecting a complete developement of the answer but I would find very helpfull any indications or references. Thanks a lot. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Yes, i'm considering that Stock prices follow geometric Brownian motions. I also forgot to say that the prices at the end of the time interval are known, so the probabilities are actually conditioned probabilitites. &lt;/p&gt;&#xA;" OwnerUserId="1702" LastEditorUserId="-1" LastEditDate="2011-11-23T19:23:23.757" LastActivityDate="2011-11-23T19:23:23.757" Title="Taking into account the correlation in Barrier options on a Basket" Tags="&lt;correlation&gt;&lt;basket&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2421" PostTypeId="1" AcceptedAnswerId="2423" CreationDate="2011-11-23T18:39:12.140" Score="4" ViewCount="2110" Body="&lt;p&gt;I've only recently begun working in the quantitative finance field, and I've noticed that some time series I'm given are labeled &quot;seasonally adjusted&quot;, and some labeled with &quot;seasonally adjusted annual rate&quot;. What's the difference between these two data transforms?&lt;/p&gt;&#xA;" OwnerUserId="1604" LastActivityDate="2011-11-23T19:38:43.393" Title="What's the difference between SA and SAAR?" Tags="&lt;time-series&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2422" PostTypeId="2" ParentId="569" CreationDate="2011-11-23T19:11:14.457" Score="4" Body="&lt;p&gt;Check out Advantage futures and the algoadvantage service they offer.  You'll need to colocate a server with them and either purchase exchange connectivity software or certify your own app (this is only for derivatives trading..)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also check out mbtrading.  No java api but they offer a FIX interface so you can use quickfix.  If you trade enough you can get a vps in their colo.. and you can probably colo a your own box there too, if needed.&lt;/p&gt;&#xA;" OwnerUserId="1703" LastActivityDate="2011-11-23T19:11:14.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2423" PostTypeId="2" ParentId="2421" CreationDate="2011-11-23T19:36:40.447" Score="3" Body="&lt;p&gt;Seasonal adjustments &lt;em&gt;per se&lt;/em&gt; are a topic in and by itself, see for example &lt;a href=&quot;http://en.wikipedia.org/wiki/Seasonal_adjustment&quot; rel=&quot;nofollow&quot;&gt;this Wikipedia page&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the added &quot;AR&quot;, imagine an event with an unconditional average of '100' (to pick a base) when measure monthly.  So the annual average is 1200, and similarly, a 'SAAR' series accounts for both recurring seasonal patterns (quarterly, monthly, weekly, daily, intra-daily, ...) and also scales the measurements to an annual total.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This wasn't really a quant finance question, maybe try &lt;a href=&quot;http://stats.stackexchange.com&quot;&gt;the Stats sister site&lt;/a&gt; next time around.&lt;/p&gt;&#xA;" OwnerUserId="69" LastActivityDate="2011-11-23T19:36:40.447" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2424" PostTypeId="2" ParentId="2421" CreationDate="2011-11-23T19:38:43.393" Score="2" Body="&lt;p&gt;A SAAR series is expressed as if period-over-period growth were to occur for an entire year.  Real GDP is reported this way.  A report of 3% GDP growth in a quarter does &lt;em&gt;not&lt;/em&gt; mean GDP grew 3% in that quarter.  It means GDP would be 3% higher in one year if this quarter's growth were to occur over 4 consecutive quarters.&lt;/p&gt;&#xA;" OwnerUserId="56" LastActivityDate="2011-11-23T19:38:43.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2427" PostTypeId="2" ParentId="2418" CreationDate="2011-11-24T16:06:30.493" Score="2" Body="&lt;p&gt;If you are making 1 cent per trade before slippage and commissions, I don't necessarily think this is a viable strategy - commissions alone might evaporate that edge. If you are adding liquidity (as defined by the exchanges) perhaps you can obtain rebates to offset commissions and slippage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Slippage can vary depending on the securities being traded. Further, it includes eating the spread and moving the market based on your size. For an intraday strategy, I assume you'll be trading the most liquid securities you can find that will reduce the spread slippage. When backtesting, use different size spreads for slippage estimation. For example, 1 cents, 2 cents, 3 cents, etc. See what your Sharpe ratio looks like at each level of spread so you can get an idea of how the strategy might perform in times of market stress (illiquidity).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of getting worse prices for your trades because of size, that really depends on your strategy. If you're trading one or two round lots of SPY, chances are you can get filled without moving the price. That's a bit harder to determine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, you can simulate your strategy with different parameters and assumptions and see what combination of parameters generate the highest Sharpe ratio. Build your backtest so it takes a variable input for slippage. As the slippage increases, your Sharpe ratio should decrease. When the Sharpe ratio gets to a certain unacceptable level, you should know what slippage you need to do better than.&lt;/p&gt;&#xA;" OwnerUserId="1112" LastActivityDate="2011-11-24T16:06:30.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2428" PostTypeId="2" ParentId="2412" CreationDate="2011-11-24T18:37:53.707" Score="2" Body="&lt;p&gt;You can come up with many specific answers depending on the application, such as high frequency vs. low frequency, or cross-sectional (e.g. single stock equity relative value) vs. time-series strategies (e.g. trading E-mini S&amp;amp;P 500) (strimp099's suggestion of using information coefficient is a good suggestion for equity relative value).  However, a general answer that is likely to at least give you some indication for any strategy is to look at the time series of returns over two adjacent periods and perform a t-test for difference in means.  If the later period has a statistically significantly lower mean return, then the alpha has likely decayed.  Measuring the precise degree of decay is going to be nearly impossible for anything but a relatively high frequency strategy with a very long time sample.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-11-24T18:37:53.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2429" PostTypeId="2" ParentId="2337" CreationDate="2011-11-24T18:52:55.623" Score="12" Body="&lt;p&gt;Interest rates in general are far from independent and identically distributed.  A high interest rate observation is quite likely to be followed by another high observation, and the volatility is likely to be higher as well.  Interest rates are also mean reverting, as in most real-world situations (at least for developed markets) interest rates rarely rise too high or dip too low.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you are looking for the simplest possible solution for a case study, I would recommend you start with a lognormal distribution, which implicitly assumes interest rates follow a geometric brownian motion.  The problem with this distribution is that it assumes the interest rate can get arbitrarily high.  The next simplest solution would be a Cox-Ingersoll-Ross process, which has a noncentral chi-squared distribution of innovations.  The following &lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/16670-simulate-a-cox-ingersoll-ross-process&quot;&gt;matlab function&lt;/a&gt; includes a simple simulation of a CIR process.  The underlying distribution the function uses is noncentral chi-square, and the algorithm itself is quite clear even if you don't use or know matlab.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-11-24T18:52:55.623" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2430" PostTypeId="2" ParentId="2331" CreationDate="2011-11-24T19:28:09.220" Score="1" Body="&lt;p&gt;I like couchdb + couchapp for this.  Each timeseries is a doc with a reference to a file somewhere, and you can just update with metadata as you go.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's nice because all of your web views / interfaces are just a pure JavaScript / HTML + the js map/reduce view.  Each one is small and self-contained, and doesn't require a separate app running somewhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, you build some views for finding datasets according to your criteria.  Everything is REST, so it's easy to wire up an app to query this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To run a simulation / analysis job, you search for the datasets, pick up the right files, and run.  Simulation results can then be stored in couch, with custom views to see results.  Because entries are versioned, you can store a reference to a given piece of data, and then if you update it later, future searches pick up the newest version but old results are still valid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, couch lets you subscribe to an event stream of updates.  So you can write something that listens for interesting updates / datasets and notifies the right people very easily.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Couchdb is good for availability but some pure js views are not extremely performant.  For those, you can write native erlang map/reduce functions that are faster. &lt;/p&gt;&#xA;" OwnerUserId="1703" LastActivityDate="2011-11-24T19:28:09.220" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2431" PostTypeId="2" ParentId="2246" CreationDate="2011-11-25T15:12:02.150" Score="1" Body="&lt;p&gt;You may want to have a look at a later paper by &lt;a href=&quot;http://eprints.ma.man.ac.uk/1523/01/covered/MIMS_ep2009_87.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Borsdorf, Higham, and Raydan (2010)&lt;/a&gt;.  I believe a variant of the same method may apply in your case.  That is, you may want to account for some of the factor structure of your correlation matrix before you apply an unweighted Frobenius norm.  Otherwise, using unweighted norms has often given me fine results anyhow, and this is often used only as a quick fix to slightly adjust matrices that are just barely not positive definite.  A full approach should definitely be applying some factor structure (see &lt;a href=&quot;https://quant.stackexchange.com/q/2000/1106&quot;&gt;a previous question of mine&lt;/a&gt;, as well as others on the site).&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2011-11-25T15:12:02.150" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2432" PostTypeId="1" AcceptedAnswerId="2433" CreationDate="2011-11-25T17:24:15.617" Score="4" ViewCount="1219" Body="&lt;p&gt;If you're hedging with a back month / leap option, what are good underlying / market conditions to move this option out even further in time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For simplicity, let's say you own a call with 6 months expiration.  What  conditions provide the best &quot;prices&quot;, for selling this option, and then buying another further out in time, perhaps 9 months or 1 year out?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I realize this might take different forms based on what the underlying is doing relative to the option, but perhaps those could be addressed as cases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;--------------- Added after CQM'S answer, an additional clarifying question  -------------&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does a leap with 6 months expiration, and then a leap with 1 year expiration (same strike), generally follow a ratio, regardless of implied volatility?    So, say the 6 month leap was \$5, and the 12 month leap was $8, at a given market volatility level, this would make a ratio of 8/5, the cost of the 12 month leap over the 6 month leap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the volatility of the equity &amp;amp; market subsequently changed, perhaps became quite a bit lower, would this ratio likely still be 8 / 5 between the 12 month leap and the 6 month leap?&lt;/p&gt;&#xA;" OwnerUserId="1675" LastEditorUserId="1675" LastEditDate="2011-11-26T16:58:39.587" LastActivityDate="2011-11-26T16:58:39.587" Title="What are good conditions to roll a leap further out in time?" Tags="&lt;options&gt;&lt;option-pricing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2433" PostTypeId="2" ParentId="2432" CreationDate="2011-11-26T08:24:30.743" Score="3" Body="&lt;p&gt;with leaps you have to consider market volatility and the equities volatility. market volatility increases the price of all options and is (merely) correlated with big market corrections. equity volatility can be due to a variety of factors, but with leaps it is after a big drop in that equity due to unfavorable news.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;leaps can get tricky due to their inverted pricing (due to volatility, stock drops, call increases in value, stock rises after volatility was high then call deflates in value before gaining intrinsic value back)*   *depends on gamma and delta of course too&lt;/p&gt;&#xA;&#xA;&lt;p&gt;when your leap has inflated volatility, less than 6 months left, that is a good time to roll&lt;/p&gt;&#xA;" OwnerUserId="1453" LastActivityDate="2011-11-26T08:24:30.743" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="2434" PostTypeId="1" CreationDate="2011-11-26T08:30:52.923" Score="14" ViewCount="12862" Body="&lt;p&gt;Are there comprehensive analyses of how much theta a weekly options loses in a day, per day?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know what the shape of theta decay looks like, in theory, where the decay towards zero happens more rapidly the closer you get to expiration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/8TSfZ.gif&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But with weeklies, an example question would be: do they lose 20% by first Friday (with the weekend theta decay getting priced in by market close), or is it 30%? 10%?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume the option is at the money, or 1 strike out of the money. This is the area where the extrinsic value will be greatest.&lt;/p&gt;&#xA;" OwnerUserId="1453" LastEditorUserId="26792" LastEditDate="2017-03-08T16:43:25.590" LastActivityDate="2018-02-24T02:31:56.523" Title="Are there comprehensive analyses of theta decay in weekly options?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;option-strategies&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2435" PostTypeId="1" CreationDate="2011-11-26T11:02:32.080" Score="10" ViewCount="12916" Body="&lt;p&gt;I'm working through different books about financial mathematics and solving some problems I get stuck.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose you define an arbitrary stochastic process, for example&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ X_t := W_t^8-8t $ where $ W_t $ is a Brownian motion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is, how could I deduce that this stochastic process is a martingale or not using Itô's formula?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only thing I know is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at the stochastic integral $ \int K dM $ where $ M=\{M_t\} $ is a martingale, which is right continuous with left limit, null at $0$ and satisfies $ sup_t E[M_t] &amp;lt; \infty$ and $ K $ a stochastic process bounded and predictable, then $ \int K dM $ is a martingale too. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I'm not sure if this is helpful in this situation. An example of how to solve such types of problems would be appreciated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just to be sure, I state Itô's formula which I know so far.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\{X_t\}$ a general $ \mathbb{R}^n $ valued semimartingale and $f: \mathbb{R}^n \to \mathbb{R}$ such that $ f\in C^2 $. Then $ \{f(X_t)\} $ is again a semimartingale and we get Itô's formula (in differential form):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ df(X_t) = \sum_{i=1}^n f_{x_i}(X_t)dX_{t,i} + \frac{1}{2}\sum_{i,j=1}^n f_{x_i,x_j}(X_t)d\langle X_i,X_j\rangle_t$$&lt;/p&gt;&#xA;" OwnerDisplayName="user1715" LastEditorUserId="467" LastEditDate="2013-05-16T08:59:07.307" LastActivityDate="2016-06-29T22:18:19.187" Title="How to use Itô's formula to deduce that a stochastic process is a martingale?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;martingale&gt;&lt;itos-lemma&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="2436" PostTypeId="1" AcceptedAnswerId="2443" CreationDate="2011-11-26T16:29:22.870" Score="0" ViewCount="1792" Body="&lt;p&gt;I'm trying to understand option pricing better. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say security ABC is \$40, and a 38 PUT option with 40% implied volatility (and 90 days till expiration) is priced at X.   If security ABC then drops to \$30, should the price of a $28 PUT option with 40% implied volatility (and 90 days till expiration), now have a price of:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   30&#xA;  -----  * price of $38 PUT?&#xA;   40&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Similarly, do stocks at around \$100 / share, have options whose time value is twice as much as a stock trading at \$50 a share, everything else (e.g. volatility) being equal? &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;P.S.  Another similar area of this question is selling covered calls.   For the static return, one of course divides the sale price of the option against the cost of the underlying security, and one is often seeking to maximize that return.  So, I guess one could say/ask, will a stock trading at \$40 a share, generate the same return ratio as a stock trading at \$30 a share, if those options have the same implied volatility? &lt;/p&gt;&#xA;" OwnerUserId="1675" LastEditorUserId="1675" LastEditDate="2011-11-26T18:52:56.670" LastActivityDate="2011-11-27T14:51:16.373" Title="Does an option's price &quot;ratio&quot; with the underlying security price?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;implied-volatility&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2437" PostTypeId="2" ParentId="1462" CreationDate="2011-11-26T17:00:33.047" Score="2" Body="&lt;p&gt;I've looked at Tradery and tried Collective2.  Collective2 made it real easy, but it's not free.  So I implemented the similar thing under Matlab by connecting to Google Finance Portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use the codes in the link below as a template; it's in matlab/java.  One downside is that Google Finance Portfolio only saves the transaction date (YYYYMMDD) but not time (HHmmss), so intraday orders in the transaction history will not have the transaction time.  If you use Matlab and want to try it out, use the 32-bit Matlab to run the codes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/32167-view-and-add-transaction-to-portfolios-on-google-finance&quot; rel=&quot;nofollow&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/32167-view-and-add-transaction-to-portfolios-on-google-finance&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/32260-get-price-of-stocks-with-google-stock-api&quot; rel=&quot;nofollow&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/32260-get-price-of-stocks-with-google-stock-api&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been lurking here for a while now... hope these codes will be of some use to the members here.  Happy (paper) trading.&lt;/p&gt;&#xA;" OwnerUserId="1381" LastActivityDate="2011-11-26T17:00:33.047" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2439" PostTypeId="1" AcceptedAnswerId="2440" CreationDate="2011-11-26T21:00:09.363" Score="4" ViewCount="1519" Body="&lt;p&gt;I'm wondering if there is some measurement or name to this notion, i.e.:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Markets typically fall fast, but rise slowly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems like this is the case -- get some bad news out of Europe on the debt crisis there, and things drop fast.  Then, in the absence of daily bad news, things tend to rise ... slowly.  Is this the way markets operate most of the time?   Do you know of data that backs this up, if it is true?&lt;/p&gt;&#xA;" OwnerUserId="1675" LastEditorUserId="1675" LastEditDate="2011-11-26T22:01:45.457" LastActivityDate="2012-01-29T22:06:46.837" Title="Do markets typically fall fast, and rise slowly" Tags="&lt;market-data&gt;&lt;market&gt;&lt;market-impact&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2440" PostTypeId="2" ParentId="2439" CreationDate="2011-11-26T21:42:39.283" Score="11" Body="&lt;p&gt;Equity returns have persistent negative skewness and excess kurtosis[1] over longer periods. So yes you're right: a majority of the daily returns is positive and small and a minority of the returns is negative and larger. This can be quite extreme, for example Black Monday.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't have the data right now but you can get returns on major indices freely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[1] There are two definitions of kurtosis, $K$ and $K&amp;#39;$ such that $K = K&amp;#39;-3$. The normal distribution has $K=3$. If a distribution or sample has $K&amp;gt;3$ we say it has excess kurtosis. This implies that the tails are fat compared to the normal distribution.&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="848" LastEditDate="2011-11-27T11:41:54.167" LastActivityDate="2011-11-27T11:41:54.167" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2442" PostTypeId="2" ParentId="2435" CreationDate="2011-11-27T13:39:38.483" Score="11" Body="&lt;p&gt;In general, if you have a process that you can write under the form $F(B_t,t)$ where $F$ is $\mathcal{C}^{2,1}$ then Itô's lemma gives you the drift term and diffusion term of $dF$. Then if the resulting SDE has a null drift (that's where Black Scholes PDE comes from), and you get a only &lt;strong&gt;local martingale&lt;/strong&gt;. For it to be a &lt;strong&gt;proper martingale&lt;/strong&gt; you can look at &lt;a href=&quot;http://almostsure.wordpress.com/2010/08/31/zero-hitting-and-failure-of-the-martingale-property/&quot;&gt;theorem 1&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But you have easier sufficient conditions, in particular if you only need martingale property over finite time intervals. Those conditions are about the integrability of the quadratic variation process, but as I can't remember them exactly, I won't try to derive them here. They must appear in any book over stochastic integration with respect to Brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best regards&lt;/p&gt;&#xA;" OwnerUserId="92" LastActivityDate="2011-11-27T13:39:38.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2443" PostTypeId="2" ParentId="2436" CreationDate="2011-11-27T14:51:16.373" Score="4" Body="&lt;p&gt;Almost. If you compare the price of a \$38 put option on a security worth \$40 and the price of a \$28.50 put option on a security worth \$30, then the price of the second option is indeed 3/4 of the price of the first option (assuming the other parameters are all the same).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason is that the unit of money does not matter. If the price of a put option with a strike of 38 dollars on a security worth 40 dollars is X dollars, then the price of a put option with a strike of 38 cents on a security worth 40 cents is X cents, and the price of a put option with a strike of 38 units of 0.75 dollar on a security worth 40 units of 0.75 dollar is X units of 0.75 dollar. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also see this from the Black-Scholes formula, but then you have to believe all the assumptions that are made in deriving the formula.&lt;/p&gt;&#xA;" OwnerUserId="812" LastActivityDate="2011-11-27T14:51:16.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2444" PostTypeId="2" ParentId="45" CreationDate="2011-11-27T22:05:56.557" Score="3" Body="&lt;p&gt;It depends on what the strategy does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a long/short signal on an equity symbol, one way is to look at the options prices / implied volatility for that symbol.  Your system should give an expected timeframe and profitability, so the risk involved could be quantified by the price of buying options to insure yourself against losses compared to your expected returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a more complicated symbol, you can attempt to approximate using a basket of options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a short-term microstructure trade (which is IMHO the arena in which ML/AI-type strategies are most useful, mainly because proper quant analysis often has little to say), there is very little you can in terms of principled risk estimates. Rather, you must rely on simulation, and backtesting.  I especially recommend adding in simulations for totally disastrous fictional scenarios.  For this kind of trade, any estimation is rough at best, so use a healthy dose of pessimism and superstition.&lt;/p&gt;&#xA;" OwnerUserId="1712" LastActivityDate="2011-11-27T22:05:56.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2445" PostTypeId="1" CreationDate="2011-11-28T07:22:04.467" Score="4" ViewCount="363" Body="&lt;p&gt;Per a previous question on this &lt;a href=&quot;https://quant.stackexchange.com/questions/2439/do-markets-typically-fall-fast-and-rise-slowly&quot;&gt;topic&lt;/a&gt; -- markets generally fall fast and rise slowly: what options strategies or other strategies can one use to take advantage of this common occurrence? &lt;/p&gt;&#xA;" OwnerUserId="1675" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2011-11-29T05:45:31.557" Title="Given markets usually fall fast and rise slowly, are there trading mechanisms to take advantage of this?" Tags="&lt;options&gt;&lt;trading&gt;&lt;market&gt;" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2446" PostTypeId="1" CreationDate="2011-11-28T10:54:09.537" Score="12" ViewCount="2287" Body="&lt;p&gt;I'm looking for a method to automatically detect structural breaks, I tried Chow test, It&#xA;works good but it doens't work for breaks in variance.&#xA;Do you know a test to check strucutural break in variance/volatility for financial timeseries?&lt;/p&gt;&#xA;" OwnerUserId="1663" LastEditorUserId="467" LastEditDate="2011-11-28T13:13:10.743" LastActivityDate="2013-01-30T14:08:43.053" Title="How to detect structural breaks in variance?" Tags="&lt;time-series&gt;&lt;finance&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2447" PostTypeId="2" ParentId="2445" CreationDate="2011-11-28T14:18:34.297" Score="2" Body="&lt;p&gt;Are you sure of what you advance ? Because I pay the same volatility for my 90% puts and my 90% calls.&lt;/p&gt;&#xA;" OwnerUserId="1181" LastEditorUserId="1181" LastEditDate="2011-11-28T14:34:33.587" LastActivityDate="2011-11-28T14:34:33.587" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2448" PostTypeId="1" AcceptedAnswerId="2450" CreationDate="2011-11-28T14:34:51.993" Score="6" ViewCount="272" Body="&lt;p&gt;Bill Sharpe &lt;a href=&quot;http://www.stanford.edu/~wfsharpe/art/active/active.htm&quot; rel=&quot;nofollow&quot;&gt;proves&lt;/a&gt; that the average alpha from active management is zero (and after transaction costs the average active manager returns less than passive funds). One active manager's gain is offset by equal losses among some other active managers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I stumbled across this paper &quot;&lt;a href=&quot;http://ssrn.com/abstract=1957783&quot; rel=&quot;nofollow&quot;&gt;Does Active Management Pay? New International Evidence&lt;/a&gt;&quot; by Alexander Dyck, Karl Lins and Lukasz Pomorski. They find that on average, net annual returns for active equity strategies exceed those of passive equity strategies by about 1.1% in markets outside the U.S.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this empirical finding contradict Sharpe's equilibrium argument that average active management returns are zero? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: As soon as I finished preparing the question, I realized how the two arguments can both be true without contradiction. Still this makes for an fun riddle. I'll post my answer in 24 hours or award it to whomever gets it first.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-11-28T19:03:32.267" LastActivityDate="2011-11-28T19:38:06.980" Title="zero-sum active management riddle" Tags="&lt;research&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2449" PostTypeId="2" ParentId="2445" CreationDate="2011-11-28T15:11:37.513" Score="2" Body="&lt;p&gt;Nassim Taleb has a strategy that he described in Active Trader magazine (partial interview &lt;a href=&quot;http://www.pma-corp.net/OT/OptionsTrader2006-02.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. As I recall, he would buy deep out-of-the-money puts, anticipating the faster fall. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;He is called the actions of some traders, to sell deep OTM puts, to be &quot;picking up pennies in front of steam rollers.&quot; In this case (buying those puts), he is the steam roller.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, he is losing money every day due to time decay, so this strategy is for those with a long-term view.&lt;/p&gt;&#xA;" OwnerUserId="343" LastActivityDate="2011-11-28T15:11:37.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2450" PostTypeId="2" ParentId="2448" CreationDate="2011-11-28T16:27:17.853" Score="2" Body="&lt;p&gt;Thanks for pointing out the article.  Their findings make for very interesting food for thought, particularly from a marketing and business strategy perspective.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure what you realized, but I think the way to reconcile the two statements is to recognize that the universe of equity investors does not break down precisely into active and passive fund managers.  There are a whole host of other investors (particularly in non-US markets), such as retail investors, governments, and other companies.  Some of these, particularly government, are not profit-motivated investors, and so may offer active returns to those managers betting against them.  Furthermore, retail investors have been shown in many contexts (such as Barber and O'Dean's papers) to have various systematic biases that give them a lower return than the &quot;average&quot; of all investors, and sophisticated active investors may profit from those biases as well.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-11-28T16:27:17.853" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2451" PostTypeId="2" ParentId="2448" CreationDate="2011-11-28T17:36:45.130" Score="3" Body="&lt;p&gt;Tal is correct that &quot;other&quot; investors can remove the zero-sum constraint.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But that is not the only possibility.  As the article linked to by &lt;a href=&quot;http://www.portfolioprobe.com/2011/11/07/some-new-ideas-in-financial-mathematics/&quot; rel=&quot;nofollow&quot;&gt;http://www.portfolioprobe.com/2011/11/07/some-new-ideas-in-financial-mathematics/&lt;/a&gt; points out, an index is just a trading strategy.  There is no reason to suppose that it is an optimal trading strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One reason we are deluded into thinking that something like the S&amp;amp;P 500 is optimal is because of the academic coercion to think of it as the &quot;market portfolio&quot; (which by definition is optimal).&lt;/p&gt;&#xA;" OwnerUserId="249" LastActivityDate="2011-11-28T17:36:45.130" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2452" PostTypeId="2" ParentId="2446" CreationDate="2011-11-28T18:09:58.367" Score="9" Body="&lt;p&gt;Have a look here:&lt;br&gt;&#xA;&lt;a href=&quot;http://www.climatelogic.com/&quot; rel=&quot;nofollow&quot;&gt;http://www.climatelogic.com/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The method is based on a sequential F-test, see also this paper:&lt;br&gt;&#xA;Rodionov, S.N., 2005b: &lt;a href=&quot;http://www.beringclimate.noaa.gov/regimes/rodionov_var.pdf&quot; rel=&quot;nofollow&quot;&gt;Detecting regime shifts in the mean and variance: Methods and specific examples&lt;/a&gt;. In: Large-Scale Disturbances (Regime Shifts) and Recovery in Aquatic Ecosystems: Challenges for Management Toward Sustainability, V. Velikova and N. Chipev (Eds.), UNESCO-ROSTE/BAS Workshop on Regime Shifts, 14-16 June 2005, Varna, Bulgaria, 68-72.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With R the following package can be used:&lt;br&gt;&#xA;&lt;a href=&quot;http://cran.r-project.org/web/packages/cpm/index.html&quot; rel=&quot;nofollow&quot;&gt;Sequential Parametric and Nonparametric Change Detection&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Vignette has more information:&lt;br&gt;&#xA;&lt;a href=&quot;http://cran.r-project.org/web/packages/cpm/vignettes/cpm.pdf&quot; rel=&quot;nofollow&quot;&gt;Parametric and Nonparametric Sequential Change Detection in R: The cpm package&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even more information can be found on the homepage of the author (incl. new developments and research): &lt;a href=&quot;http://gordonjross.co.uk/publications.html&quot; rel=&quot;nofollow&quot;&gt;Gordon J. Ross&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2013-01-30T14:08:43.053" LastActivityDate="2013-01-30T14:08:43.053" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2453" PostTypeId="1" AcceptedAnswerId="2701" CreationDate="2011-11-28T18:12:38.100" Score="17" ViewCount="3068" Body="&lt;p&gt;I want to generate a mock price series. I want it to be within a certain range and have a defined correlation with the original price series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I choose, say, oil, I want as many time series which have some similar characteristics in terms of correlation but not exact. I do not want the data to wander off in a completely different path from the historic path taken.  It is not necessarily co-integrated, correlation will suffice.  I would also like these to adhere to the original price range. The series should be random, e.g. each new realization should take a different path.&lt;/p&gt;&#xA;" OwnerUserId="909" LastEditorUserId="1106" LastEditDate="2011-12-05T20:42:32.340" LastActivityDate="2012-01-03T20:22:37.637" Title="How to generate a random price series with a specified range and correlation with an actual price?" Tags="&lt;time-series&gt;&lt;correlation&gt;&lt;simulations&gt;&lt;random-variables&gt;&lt;asset-pricing&gt;" AnswerCount="6" CommentCount="4" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="2454" PostTypeId="2" ParentId="2448" CreationDate="2011-11-28T19:38:06.980" Score="3" Body="&lt;p&gt;@Tal and @Patrick point out that there are more than two subsets of investors. If we divide the active investors into smart and dumb, we can reconcile their results (i.e., they only look at active, institutional investors).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But even if there are only two subsets, their measure is still different than Sharpe's. Sharpe's argument is an identity for stock &lt;em&gt;returns&lt;/em&gt;. If we divide the value-weighted market into two parts, then both parts &lt;em&gt;must&lt;/em&gt; have the same &lt;em&gt;return&lt;/em&gt;. But the other authors look at $\alpha$, which requires a model. True, they use an accepted international risk-adjusting model, but we could add an &quot;institutional investor&quot; factor and reduce the active $\alpha$ to zero. This is the unexplained risk story. But Sharpe's isn't a risk story, it's just a raw returns story. I don't think they contradict Sharpe's story.&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-11-28T19:38:06.980" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2455" PostTypeId="1" CreationDate="2011-11-28T19:43:01.673" Score="11" ViewCount="2654" Body="&lt;p&gt;There is quite a bit of art in constructing an equity risk model. This &lt;a href=&quot;http://www.iijournals.com/doi/abs/10.3905/jpm.2003.319921&quot;&gt;paper&lt;/a&gt; summarizes some of the key decisions: choice of factors, horizon matching, cross-sectional vs. time-series method, and regression procedure to name a few.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The risk vendors make available their methodologies to their customers (and in more recent years also patent protect their method). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to compile links to the whitepapers to the current equity risk models of the majors: Axioma, BARRA, Capital IQ, Northfield, and FinAnalytica so I can make a more informed decision on the strength/weaknesses of each approach. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By methodology, I mean the construction of the factor model and any related adjustments to the covariance matrix. For example, BARRA's most current model is the USE4 &lt;a href=&quot;http://qwafafew.org/images/uploads/MSCI%204_26_2011.pdf&quot;&gt;Eigenfactor Methodology&lt;/a&gt;. Here's a link to Axioma's &lt;a href=&quot;http://www.google.com/patents?id=wUHOAAAAEBAJ&amp;amp;printsec=description&amp;amp;zoom=4#v=onepage&amp;amp;q&amp;amp;f=false&quot;&gt;Alpha Alignment Factor&lt;/a&gt; patent (although it does not go into construction of factor model).&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-11-28T19:58:20.757" LastActivityDate="2015-01-17T10:42:25.080" Title="Links to the risk model methodologies of the major providers?" Tags="&lt;risk-management&gt;&lt;risk-models&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="10" CommunityOwnedDate="2011-11-28T22:32:47.360" ContentLicense="CC BY-SA 3.0" />
  <row Id="2456" PostTypeId="2" ParentId="2453" CreationDate="2011-11-28T19:43:22.607" Score="1" Body="&lt;p&gt;If you want to make the returns &quot;random&quot;, then you will have to generate the whole price paths that meet your correlation criteria and then discard results that don't fit your price criteria. This isn't random. If I know how prices evolve, then I can generate a killer trading rule.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suggest using historical data. These data are easy to obtain with the quantmod package in R.&lt;/p&gt;&#xA;" OwnerUserId="106" LastActivityDate="2011-11-28T19:43:22.607" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2457" PostTypeId="2" ParentId="2453" CreationDate="2011-11-29T00:46:09.960" Score="4" Body="&lt;p&gt;&lt;a href=&quot;http://www.wilmott.com/messageview.cfm?catid=19&amp;amp;threadid=4517&quot; rel=&quot;nofollow&quot;&gt;Wilmott Forums - &quot;How can I simulate correlated random numbers?&quot;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://comisef.wikidot.com/tutorial%3acorrelation&quot; rel=&quot;nofollow&quot;&gt;Generating correlated normal variates&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://beyondtheblueeventhorizon.blogspot.com/2011/02/random-correlated-series-generator.html&quot; rel=&quot;nofollow&quot;&gt;Random Correlated Series Generator (using R)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All found with a Google search for &quot;how to generate random correlated series&quot;.&lt;/p&gt;&#xA;" OwnerUserId="352" LastActivityDate="2011-11-29T00:46:09.960" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2459" PostTypeId="2" ParentId="2455" CreationDate="2011-11-29T02:02:13.723" Score="6" Body="&lt;p&gt;Also, RiskMetrics' 'granular approach' may be of interest (I have no affiliation):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.  &lt;a href=&quot;https://frontoffice.riskmetrics.com/wiki/images/7/72/Rmj1q07_equity_factor_model.pdf&quot;&gt;Developing an Equity Factor Model for Risk&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;II.  &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1420185&quot;&gt;The RiskMetrics 2006 Methodology, RM2006&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="390" LastActivityDate="2011-11-29T02:02:13.723" CommentCount="0" CommunityOwnedDate="2011-11-29T02:02:13.723" ContentLicense="CC BY-SA 3.0" />
  <row Id="2460" PostTypeId="2" ParentId="2445" CreationDate="2011-11-29T05:37:50.837" Score="4" Body="&lt;p&gt;To avoid confusion, this only applies to most equity/index option. In a return distribution, there's a measurement called skewness which measures the asymmetry of upside and downside. Let's define that as 30d Put Premium/ 30d Call Premium. It's already priced in because most of the time, skew &gt; 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if you trade commodities or companies that might get bought, you'll often see skew &amp;lt; 1. You'd expect skew &amp;lt; 1 for a commodity because it's the safe heaven when the market tanks. For companies that might get bought (especially for a big premium), people are willing to pay for calls in case of a big upside gap move. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typically mega cap companies have larger skew than a mid/small cap because it probably won't get taken out, doesn't have much upside because it's so established and so people are paying for the puts to protect against a black swam event like the BP spill.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you can't really &quot;take advantage&quot; of that statement given there's implied skew already. It comes down to what you think about skew versus implied skew.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After all, realized skew is generally lower than implied skew so you'd expect to make money by shorting skew. However, in crisis times like 2008 and now, you need a lot of capital to stay short skew.&lt;/p&gt;&#xA;" OwnerUserId="1726" LastEditorUserId="1726" LastEditDate="2011-11-29T05:45:31.557" LastActivityDate="2011-11-29T05:45:31.557" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2461" PostTypeId="1" AcceptedAnswerId="2463" CreationDate="2011-11-29T07:56:09.753" Score="4" ViewCount="234" Body="&lt;p&gt;Assuming I want to run an optimization over a short period, say 2 years, I would decide to take daily values in order to compute the efficient frontier of a portfolio. That works fine as long as I have classical assets with daily indices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For other asset classes, these indices might not exists. How would you then proceed?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you use monthly values? If so,  it looks like there won't be enough observations in the sample (only 24 for 2 years)... Would you then increase the period?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess one could try to do a linear interpolation of the points during the months, but it would be useless as the resulting series would have more &quot;generated&quot; points than original ones.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there another alternative?&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2011-11-29T10:38:58.160" LastActivityDate="2011-11-29T16:14:35.317" Title="How do you handle short-term asset allocation with Hedge-Funds?" Tags="&lt;risk-management&gt;&lt;asset-allocation&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2462" PostTypeId="2" ParentId="2453" CreationDate="2011-11-29T13:19:02.357" Score="3" Body="&lt;p&gt;You could create a rescaled stochastic indicator from your randomly generated, correlated series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) use whatever software/methodology you want to create your random series with 0.85 correlation to the original data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) find the maximum and minimum values of this new series and rescale the series to range between 0 and 1 using this formula; (series_value - min_series_value) / (max_series_value - min_series_value)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) decide on the range of your restriction e.g. prices range between 35 and 85 for a range of 50, so multiply each value from step 2) by 50 to transform the 0 to 1 range to a 0 to 50 range.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) add the minimum value of 35 to values from step 3) to shift the series upwards so that your final series has a minimum value of 35, a maximum value of 85 and within the range 35 to 85 your series is essentially the random series generated in step 1).&lt;/p&gt;&#xA;" OwnerUserId="252" LastActivityDate="2011-11-29T13:19:02.357" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2463" PostTypeId="2" ParentId="2461" CreationDate="2011-11-29T15:56:11.360" Score="3" Body="&lt;p&gt;I would not think of this in terms of modern portfolio theory at all, but rather include ideas that form the mathematical basis of MPT.  In particular, construct a joint distribution for the various assets using some kind of copula, but with non-normal marginals derived from some combination of empirical returns, bayesian estimates, and &quot;mapping&quot; of illiquid asset return distributions to liquid ones.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once the joint distribution is specified, you can choose your favorite objective (which needn't be the same utility function as found in MPT) and optimize it over the joint distribution, likely using Monte Carlo and a quasirandom sequence.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-11-29T15:56:11.360" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2464" PostTypeId="2" ParentId="2461" CreationDate="2011-11-29T16:14:35.317" Score="2" Body="&lt;p&gt;The alternative is hedge fund replication.  Many hedge funds' returns may be broken down into (possibly time-varying) exposures to known risk factors.  Andrew Lo has done much work on this topic.  In principle, one may perform a returns attribution over a rolling window for some number of months, then use the daily time-series for the risk factors to fill in the gaps.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-11-29T16:14:35.317" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2465" PostTypeId="1" AcceptedAnswerId="2466" CreationDate="2011-11-29T16:24:14.860" Score="3" ViewCount="482" Body="&lt;p&gt;A recent personal finance question asks &lt;a href=&quot;https://money.stackexchange.com/q/12212/4557&quot;&gt;when to hire an investment professional?&lt;/a&gt;  Given that many of us here are on the professional manager side of the business, how would you make the case?  What quantitative evidence would you show a potential client?  What research is there to guide one as to the right asset level at which to switch from do-it-yourself investing to hiring a professional wealth manager?  Are there reasons besides investment returns to make the switch (e.g., tax, retirement planning)?  Keep in mind that most investors, unlike us, are not interested in spending a significant chunk of their lives thinking about investment decisions.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="-1" LastEditDate="2017-04-13T12:25:30.743" LastActivityDate="2012-07-26T15:18:16.793" Title="What is the case for active management?" Tags="&lt;research&gt;&lt;portfolio-management&gt;&lt;investing&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2466" PostTypeId="2" ParentId="2465" CreationDate="2011-11-29T17:21:07.920" Score="8" Body="&lt;p&gt;There's a strong theoretical argument that makes the case for active management that is also supported by empirical research. First, check out Jonathan Berk's paper &quot;&lt;a href=&quot;http://www.knightsbridgesearch.com/site/downloads/27.pdf&quot; rel=&quot;noreferrer&quot;&gt;Five Myths of Active Management&lt;/a&gt;&quot;.  The paper reads like a clever Gedankenexperiment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Starting with a theoretical approach is better than starting with an empirical approach because as Berk points out: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;One might suppose that to measure skill, one simply needs to measure&#xA;  the manager’s return before fees. The problem with this reasoning is&#xA;  that the fee the manager charges for services is only a small part of&#xA;  the costs of managing money. To achieve high returns, management must&#xA;  identify undervalued securities and trade to exploit this knowledge&#xA;  without moving the price adversely. In doing so, managers expend&#xA;  resources and pay bid-ask spreads that diminish the return available&#xA;  to pay out to investors. At some point, these costs increase&#xA;  disproportionately, eventually driving the managers’ expected returns&#xA;  down to the benchmark. To measure a manager’s skill level, one would&#xA;  need to measure return absent these costs, clearly something that we&#xA;  cannot do directly.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Berk shows that in equilibrium, the following seemingly plausibly hypotheses are false:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ol&gt;&#xA;  &lt;li&gt;The return investors earn in an actively managed fund measures the&#xA;  skill level of the manager managing that fund.&lt;/li&gt;&#xA;  &lt;li&gt;Because the average return of all actively managed funds does not beat the market, the average manager is not skilled and therefore does not add value.&lt;/li&gt;&#xA;  &lt;li&gt;If managers are skilled, their returns should persist—they should be able to beat the market consistently.&lt;/li&gt;&#xA;  &lt;li&gt;In light of the evidence that there is little or no persistence in actively managed funds’ returns, investors who pick funds on the basis&#xA;  of past returns are not behaving rationally.&lt;/li&gt;&#xA;  &lt;li&gt;Because most active managers’ compensation does not depend on the return they generate, they do not have a performance-based compensation contract.&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;His point in a nutshell is that in equilbirium the excess returns (after fees) of active managers is driven down to the return from indexing/passive management. The first $XYX dollars under management generate alpha but at equilibrium the manager has taken on enough funds such that the marginal invested dollar does not. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Excerpt of the argument:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Imagine an economy with skilled investment managers with differential&#xA;  ability who can generate positive risk-adjusted excess returns.&#xA;  Managers and investors alike know who these managers are. Assume that&#xA;  managerial ability to generate excess returns cannot be effectively&#xA;  deployed at an arbitrarily large scale. Eventually, the amount of&#xA;  money under management grows so much that each additional dollar&#xA;  contributed reduces the expected return of the portfolio as a whole.&#xA;  Certainly, this assumption is consistent with the observed&#xA;  decentralization of the professional money management industry.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;How is the equilibrium determined in this economy? Who gets money to&#xA;  manage? Well, as investors know who the skilled managers are, money&#xA;  will flow to the best manager first. Eventually, this manager will&#xA;  receive so much money that it will impact the manager’s ability to&#xA;  generate superior returns, and expected return will be driven down to&#xA;  the second-best manager’s expected return. At that point, investors&#xA;  will be indifferent between investing with either manager, so funds&#xA;  will flow to both managers until their expected returns are driven&#xA;  down to the third-best manager.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This process will continue until the expected return of investing with&#xA;  any manager is driven down to the expected return investors can expect&#xA;  to receive by investing in a passive strategy of similar riskiness&#xA;  (the benchmark expected return). At this point, investors are&#xA;  indifferent between investing with active managers or just indexing,&#xA;  and an equilibrium is achieved. Notice that in this equilibrium all&#xA;  managers, regardless of their skill level, have the same expected&#xA;  return.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Berk goes on to relax the assumptions and offers a more realistic experiment. Then he proceeds to cite his 2004 paper &quot;&lt;a href=&quot;http://faculty-gsb.stanford.edu/berk/documents/MutualFundFlows_published.pdf&quot; rel=&quot;noreferrer&quot;&gt;Mutual Fund Flows and Performance in Rational Markets&lt;/a&gt;&quot; where he empirically models indirectly the value-added from managers and &lt;strong&gt;finds that &quot;the vast majority of active managers add value&quot; and &quot;80% of mangers generate value in excess of their fees&quot;.&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-11-30T04:46:50.807" LastActivityDate="2011-11-30T04:46:50.807" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2467" PostTypeId="2" ParentId="2453" CreationDate="2011-11-29T17:50:30.643" Score="2" Body="&lt;p&gt;I have seen a technique which uses frequency domain and does pretty much what (I think) you are trying to do. The author does not give the complete details, so you might have to contact him for that, or take a look at the (free) software he has developed.&#xA;Link here: &lt;a href=&quot;http://blog.quantumfading.com/2009/08/24/historical-data-randomization-using-the-frequency-domain-preview/&quot; rel=&quot;nofollow&quot;&gt;http://blog.quantumfading.com/2009/08/24/historical-data-randomization-using-the-frequency-domain-preview/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1442" LastActivityDate="2011-11-29T17:50:30.643" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2469" PostTypeId="2" ParentId="2453" CreationDate="2011-11-29T19:03:20.873" Score="9" Body="&lt;p&gt;Two ways: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Model the returns using an &lt;a href=&quot;http://en.wikipedia.org/wiki/Ornstein%E2%80%93Uhlenbeck_process&quot; rel=&quot;nofollow&quot;&gt;Ornstein-Uhlenbeck&lt;/a&gt; process&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can control the variance of the residual noise in the process to your desired level of correlation. Conceptually you inject gaussian noise into the synthetic OU process to satisfy your requirement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, let's say you have time-series A which is what you are modelling. Time-series B is your synthetic series. You model time-series A via the OU process. Now you have to parametrize the OU process. For example, you can choose how much variance to allow for in time-series B.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know that the correlation is simply the covariance(a,b)/[ stdev(a) * stdev(b) ]. Therefore, we can solve for this equation in terms of variance(b) so you can plug in your IC and crank out the appropriate level of variance for time-series 'b' in the OU process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The OU process will give you more flexibility but it is not as straightforward to setup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Use the Fundamental Law of Active Management&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BARRA performs a Monte Carlo for simulating alpha signals to a specific level of Information Coefficient using this technique. Simulating alpha signals with a specific correlation is the same idea as generating a time-series that correlates to a price. The difference is that you would have to convert your original price-series into a return series, apply the procedure to generate a correlated alpha signal, and then integrate the alpha series so it is in the form of price levels instead of returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find more about the approach &lt;a href=&quot;http://www.barra.com/newsletter/nl169/marketneutral169.asp&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have added some simple code to demonstrate injecting orthogonal gaussian noise so the resulting series has a specific level of correlation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# rho = desired correlation&#xA;# signals = a matrix where columns are asset returns and rows are periods&#xA;# covlist = a list of covariance matrixs corresponding to a given row (i.e. period)&#xA;# See example below for illustration&#xA;&#xA; simpleNormalNoise &amp;lt;- function( signals , covlist , rho ) # one noisy signal per each mu and covariance matrix&#xA;    {&#xA;    noise   = sapply( 1:ncol( signals ) , function(x) { normals = rnorm( nrow( covlist[[x]])) ; return( normals * sqrt(diag( covlist[[x]] ))) } )&#xA;    signals = sapply( 1:ncol( signals ) , function(x) { return( rho*signals[,x] + sqrt( 1-rho*rho ) * noise[,x] ) } )&#xA;    return( signals ) &#xA;    }&#xA;&#xA;# Example:&#xA;sd1 = 1 # asset1&#xA;sd2 = 1 # asset2&#xA;cor = 0.8&#xA;cov = cor * sd1 * sd2&#xA;sample  = matrix( c( sd1^2 , cov , cov , sd2^2 ) , 2 , 2 )&#xA;covs    = lapply( 1:1000000 , function(x) { return( sample ) } )&#xA;fakemus = sapply( 1:1000000 , function(x) { return( rnorm( 2 ) ) } )&#xA;&#xA;signals = simpleNormalNoise( fakemus, covs, .10 )&#xA;sd(t(signals)) #should be ~1&#xA;cor(t(signals)) #shoudl be ~0&#xA;cor(fakemus[1,],signals[1,]) #~.1&#xA;cor(fakemus[2,],signals[2,]) #~.1&#xA;mean(signals[1,]) #~ .05*.1&#xA;mean(signals[2,]) #~ .08*.1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-12-28T19:19:22.677" LastActivityDate="2011-12-28T19:19:22.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2474" PostTypeId="1" AcceptedAnswerId="2481" CreationDate="2011-11-30T00:40:50.613" Score="6" ViewCount="2997" Body="&lt;p&gt;Let's say I have a factor model which I am using for Performance Attribution. I'd like to separate returns from alpha vs. returns from exposure to various risk factors. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For each date, the factor model decomposes the returns of a security into its daily alpha (i.e. idiosyncratic component not explained by the factor model), as well as the daily return contribution from its component factors. The table below is a mock example with 1-factor and five non-overlapping periods. For simplicity let's assume the 5 periods span one year.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/NjTsW.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice that the 'arithmetic annual return' is 10.34% (11.03/10 - 1). Or equivalently via compounding, it is (1+security return period 1) * (1+security return period 2) &lt;em&gt;...&lt;/em&gt; (1+ security return period 5) - 1 = 10.34%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to generate an annualized view of the performance attribution. In other words, I'd like to de-compose the 10.34% as the sum of : annualized Alpha + annualized Returns from Factor Exposures + annualized Interaction Term contribution. (The interaction effect measures the combined impact of manager selection and allocation decisions. Algebraically, it is a consequence of binomial expansion: $$\textrm{Price(t+1)} = \textrm{Price}(t)*[ 1 + \alpha ]*[ 1 + \textrm{net factor contribution}]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I map the matrix of daily alphas, daily factor returns, and daily security returns into a sum of annualized alpha component + annualized factor return component + annualized interaction effect? I imagine there is a clever matrix algebra solution to this problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;2-period solution&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Security Return in period 1 = $R_1$; Alpha in period 1 = $\alpha_1$; Net Factor Contribution in period 1 = $NFC_1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know by definition: $R_1$ = $\alpha_1$ + $NFC_1$ and $R_2$ = $\alpha_2$ + $NFC_2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and Annual arithmetic return is = (1 + $R_1$) * (1 + $R_2$) - 1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Expanding terms we can find we can express annual arithmetric return as the sum of component annualized alpha, annualized net factor returns, and annualized interaction terms:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Annual arithmetic return (as a sum of the three components) = &lt;/p&gt;&#xA;&#xA;&lt;p&gt;( $\alpha_1$ + $\alpha_1$$\alpha_2$ + $\alpha_2$ ) + ( $NFC_2$ + $NFC_1$ + $NFC_1$*$NFC_2$ ) + ( $NFC_1$$\alpha_2$ + $\alpha_1$$NFC_2$ )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same solution in matrix algebra terms:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;vector1 = (1 + $R_1$) = (1 + $\alpha_1$ + $NFC_1$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;vector2 = (1 + $R_2$) = (1 + $\alpha_2$ + $NFC_2$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The annual arithmetic return is then the sum of the elements of the 3x3 matrix resulting from the outer cross-product of vector1 and vector2 - 1. The upper left portion of the matrix (see below) consists of the alpha contributions, and the top-right,bottom-left, and bottom-right contain the factor return contributions which can now be grouped with another matrix operation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{matrix}&#xA;1 &amp;amp; a{2} &amp;amp; NFC{2}\\&#xA;a{1} &amp;amp; a{1}*a{2} &amp;amp; a{1}*NFC{2}\\&#xA;NFC{1} &amp;amp; NFC{1}*a{2} &amp;amp; NFC{1}*NFC{2}\\&#xA;\end{matrix}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So -- what is a computationally clever way to scale this to 251 periods (assuming 251 trading days = 1 year) while grouping terms into the sum of 3 annualized components?&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-11-30T16:41:05.040" LastActivityDate="2012-03-12T16:17:38.683" Title="Performance Attribution : Annualizing alpha &amp; factor return contributions" Tags="&lt;risk&gt;&lt;risk-models&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2475" PostTypeId="1" CreationDate="2011-11-30T00:55:18.343" Score="1" ViewCount="329" Body="&lt;p&gt;I have a trading strategy that I use on single tickers.  I'd like to start using it with pairs as well.  However, I'm somewhat math challenged and not sure how to best calculate the stops of the individual tickers.  Could someone point me in the right direction? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I have a pair, ABC and DEF, that I'd like to go long on.  ABC is trading at 53 and DEF is trading at 50, the spread is 3.  My stop on the spread is $2.  How would I convert that spread stop price into individual ticker prices?  Sure, I could watch a chart of ABC-DEF and when it hits my stop, exit both.  However, my strategy is much more convoluted than this simple example.  I need to know the stop price on each issue separately, so that I can properly control risk prior to entering.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this even possible since the two issues aren't always moving at the same ratio to one another?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="1732" LastActivityDate="2011-11-30T00:55:18.343" Title="How would I calculate a stop on a pair trade?" Tags="&lt;risk&gt;&lt;pairs-trading&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ClosedDate="2011-11-30T14:49:20.157" ContentLicense="CC BY-SA 3.0" />
  <row Id="2476" PostTypeId="2" ParentId="2412" CreationDate="2011-11-30T11:10:52.057" Score="2" Body="&lt;p&gt;The blog post &lt;a href=&quot;http://www.portfolioprobe.com/2011/11/30/alpha-decay-in-portfolios/&quot; rel=&quot;nofollow&quot;&gt;http://www.portfolioprobe.com/2011/11/30/alpha-decay-in-portfolios/&lt;/a&gt; tells of one possible method:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generate two sets of random portfolios.  Both sets satisfy your portfolio constraints, and one set is additionally constrained to have high expected returns.  You can now look at the distribution of the difference in returns for various time frames.&lt;/p&gt;&#xA;" OwnerUserId="249" LastActivityDate="2011-11-30T11:10:52.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2477" PostTypeId="1" CreationDate="2011-11-30T12:47:51.010" Score="3" ViewCount="1459" Body="&lt;p&gt;Is there such a thing? Or is there a project around that aims to realize Quantlib in JS? I'm a JS coder and I'd like to get involved if so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe it seems futile or insane today, but who can doubt that's merely a calendrical issue?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I find no JS R but there's a JStat package that's advertised as &quot;like R:&quot; &lt;a href=&quot;http://www.readwriteweb.com/hack/2011/03/jstat-its-like-r-for-javascript.php&quot; rel=&quot;nofollow&quot;&gt;&lt;b&gt;Jstat&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make myself clear, I am looking for a way to run Quantlib on a web client.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anything happening along these lines?&#xA;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="618" LastEditorUserId="618" LastEditDate="2011-12-01T12:25:30.103" LastActivityDate="2011-12-01T12:25:30.103" Title="Quantlib in JavaScript?" Tags="&lt;quantlib&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ClosedDate="2011-12-01T18:55:19.583" ContentLicense="CC BY-SA 3.0" />
  <row Id="2478" PostTypeId="1" AcceptedAnswerId="2485" CreationDate="2011-11-30T12:59:11.313" Score="6" ViewCount="2705" Body="&lt;p&gt;I am trying to work out how to value the following transactions. It should be straight forward, since it breaks down into a series of well known instruments, yet I am not sure how to evaluate it:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Receive Cash payment amount of \$X&lt;/li&gt;&#xA;&lt;li&gt;Subsequent pay out \$Y per calendar month into perpetuity&lt;/li&gt;&#xA;&lt;li&gt;Have the option to &quot;close out&quot; the implied perpetuity, by paying the original received $X amount, any time after 1 year.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I would like to know how to value such an instrument, which consists of effectively:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a perpetuity&lt;/li&gt;&#xA;&lt;li&gt;an embedded option&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If I was to make such an instrument available to someone, how much would I sell it for?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an interesting aside, this is clearly a debt instrument, and would be recorded in the other parties 'liability column'. What value would be recorded in the books? Clearly, not the original $X ...?&lt;/p&gt;&#xA;" OwnerUserId="1733" LastEditorUserId="1106" LastEditDate="2011-12-06T22:18:27.593" LastActivityDate="2011-12-06T22:18:27.593" Title="How would I value a perpetual bond with an embedded option?" Tags="&lt;options&gt;&lt;fixed-income&gt;&lt;valuation&gt;&lt;embedded-options&gt;&lt;accounting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2479" PostTypeId="2" ParentId="2477" CreationDate="2011-11-30T14:30:11.313" Score="4" Body="&lt;p&gt;The formally supported way of adding extensions to &lt;a href=&quot;http://www.quantlib.org&quot; rel=&quot;nofollow&quot;&gt;QuantLib&lt;/a&gt; is by means of the &lt;a href=&quot;http://www.swig.org&quot; rel=&quot;nofollow&quot;&gt;Swig&lt;/a&gt; extension 'system' / library / tool.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And the &lt;a href=&quot;http://www.swig.org/compat.html&quot; rel=&quot;nofollow&quot;&gt;Swig site's page on compatibility&lt;/a&gt; has this to about Javascript:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;There is also &lt;a href=&quot;http://www.ultravioletconsulting.com/projects/swigjs&quot; rel=&quot;nofollow&quot;&gt;SwigJS&lt;/a&gt;, a JavaScript module for SWIG&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;so you could to familiarize yourself with a) how Swig works in the context of QuantLib and b) if/how you can get SwigJS to help you here.&lt;/p&gt;&#xA;" OwnerUserId="69" LastActivityDate="2011-11-30T14:30:11.313" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2481" PostTypeId="2" ParentId="2474" CreationDate="2011-11-30T14:56:57.023" Score="4" Body="&lt;p&gt;A simple top-down shortcut calculation :&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Set annualized alpha = compounded alpha = 1 + a1 + a2 + a1*a2 + ... = $\Pi$ (1 + $\alpha_t$)&lt;/li&gt;&#xA;&lt;li&gt;Set annualized return from factors = compounded factor return = $\Pi$ (1 + $factorReturn_t$)&lt;/li&gt;&#xA;&lt;li&gt;Interaction Term contribution is then = Compounded Security Return - Compounded alpha - Compounded factor return&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Therfore the annualized arithmetic return is de-composed into these three components.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: There is the text &quot;&lt;a href=&quot;http://books.google.com/books?hl=en&amp;amp;lr=&amp;amp;id=jQ_W-2vqw-4C&amp;amp;oi=fnd&amp;amp;pg=PR9&amp;amp;dq=duc%20and%20schorderet%202008&amp;amp;ots=OYSPbrirCL&amp;amp;sig=9AddIeZqmybn773YBOZY8I1ZXJU#v=onepage&amp;amp;q=duc%20and%20schorderet%202008&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;Market Risk Management for Hedgefunds&lt;/a&gt;&quot; (Duc &amp;amp; Schorderet) that addresses the issue of annualizing various risk measures in chapter 8 &quot;The Annualization Problem&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update 2 (3/12/2012):&lt;/strong&gt; Also, the following papers cover the annualization of performance attribution statistics: Bonafede, Forest, and Matheos (2002) and Carino (2002). Since the interaction term is significant, and various annualization methods satisfy different critieria (i.e. commutativity, metric consistency, etc.) the problem is not as straightforwards as it might seem.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-03-12T16:17:38.683" LastActivityDate="2012-03-12T16:17:38.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2482" PostTypeId="2" ParentId="2106" CreationDate="2011-11-30T15:22:43.793" Score="3" Body="&lt;p&gt;I just reviewed the paper &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1364635&quot; rel=&quot;nofollow&quot;&gt;Corporate Bond Liquidity Before and After the Onset of the Subprime Crisis&lt;/a&gt; by Dick-Nielsen, Feldhütter and Lando.  They define a liquidity measure $\lambda$ as a conglomerate of&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;price impact (Amihud) and its variability&lt;/li&gt;&#xA;&lt;li&gt;spread covariance (Roll) and its variability&lt;/li&gt;&#xA;&lt;li&gt;turnover&lt;/li&gt;&#xA;&lt;li&gt;imputed roundtrip cost (Feldhütter)&lt;/li&gt;&#xA;&lt;li&gt;zero trading days&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I rather like the last one, since it captures a lot of the ugliness in corporate bond markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having defined $\lambda$, they run some statistics to work out liquidity premia, including setting confidence bands using a &quot;wild cluster bootstrap&quot; which I am going to have study just because of the awesome name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question of perceived recovery rates is still outstanding.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-11-30T15:22:43.793" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2483" PostTypeId="2" ParentId="2207" CreationDate="2011-11-30T18:59:32.507" Score="4" Body="&lt;p&gt;I tested both procedures. The results are virtually indistinguishable - the decision is not consequential. I opted for approach #1.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2011-11-30T18:59:32.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2484" PostTypeId="2" ParentId="1725" CreationDate="2011-11-30T19:44:04.023" Score="4" Body="&lt;p&gt;In terms of system design, I learned the most by reading the developer guides and exchange connectivity specs for various exchanges.  You probably won't be connecting to these directly, but understanding how the sessions, book updates, snapshotting works, and what events can occur is very useful.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, google for the Max Dama automated trading PDF, which gives a brilliant and concise overview of what's involved in building a working automated trading system, including architecture, and a who you are vs what you need to build table.&lt;/p&gt;&#xA;" OwnerUserId="1712" LastActivityDate="2011-11-30T19:44:04.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2485" PostTypeId="2" ParentId="2478" CreationDate="2011-11-30T21:30:40.547" Score="9" Body="&lt;p&gt;There are &quot;perpetual&quot; bonds and preferred shares that are traded in the corporate credit markets that exactly match your conditions above.  They are recorded in the 10-K at notional value $X$. The &quot;close-out&quot; feature is an &lt;em&gt;embedded call&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should assume your favorite stochastic interest rate (and/or credit) model and run a PDE solver, tree, or other grid scheme from some time $T$ far in the future (we used to let $T$=70 years).  Basically, you want $T$ far enough away that, after discounting,  $X$ paid at time $T$ is negligible.  Most of the time your credit model has a pretty high probability of default within 100 years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many of these instruments have their embedded calls starting only past some date in the future, and in that case traders often tend to lend great consideration to the PV of payments only up to the first call date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main risks to your valuation (aside from model or calibration error in the credit and interest rate models) are&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Suspension of preferred coupon/dividend payments&lt;/li&gt;&#xA;&lt;li&gt;Mergers and takeovers&lt;/li&gt;&#xA;&lt;li&gt;Capital structure changes&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-11-30T21:30:40.547" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2487" PostTypeId="2" ParentId="631" CreationDate="2011-11-30T21:47:07.067" Score="1" Body="&lt;p&gt;There are many:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Marketctera&lt;/li&gt;&#xA;&lt;li&gt;iQuantTrader&lt;/li&gt;&#xA;&lt;li&gt;CEP Trader&lt;/li&gt;&#xA;&lt;li&gt;IQBroker&lt;/li&gt;&#xA;&lt;li&gt;Algo Trade&lt;/li&gt;&#xA;&lt;li&gt;ActiveQuant&lt;/li&gt;&#xA;&lt;li&gt;TradeLink&lt;/li&gt;&#xA;&lt;li&gt;Orc&lt;/li&gt;&#xA;&lt;li&gt;FlexTrade&lt;/li&gt;&#xA;&lt;li&gt;Portware&lt;/li&gt;&#xA;&lt;li&gt;Apama&lt;/li&gt;&#xA;&lt;li&gt;Aleri&lt;/li&gt;&#xA;&lt;li&gt;etc&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Try a Google search to find more.&lt;/p&gt;&#xA;" OwnerUserId="909" LastActivityDate="2011-11-30T21:47:07.067" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2489" PostTypeId="2" ParentId="569" CreationDate="2011-11-30T22:27:42.180" Score="4" Body="&lt;p&gt;For retail solution IB is pretty good. There are some discussions about many broker in &lt;a href=&quot;http://www.elitetrader.com/&quot; rel=&quot;nofollow&quot;&gt;Elite Trader&lt;/a&gt;. Lime brokerage (ex &lt;a href=&quot;http://www.tower-research.com/&quot; rel=&quot;nofollow&quot;&gt;Tower Res. Cap.&lt;/a&gt;, now associated with &lt;a href=&quot;http://www.wedbush.com/&quot; rel=&quot;nofollow&quot;&gt;wedbush&lt;/a&gt;) seam to be putting together a good offering. They have C++ API product called &lt;a href=&quot;http://www.cactustradingsystems.com/&quot; rel=&quot;nofollow&quot;&gt;Cactus&lt;/a&gt; and also has Apama and OneTick. They have their own co-located servers and have fast routing also. &lt;/p&gt;&#xA;" OwnerUserId="909" LastEditorUserId="909" LastEditDate="2012-02-09T22:10:39.420" LastActivityDate="2012-02-09T22:10:39.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2490" PostTypeId="1" CreationDate="2011-12-01T15:01:27.843" Score="8" ViewCount="287" Body="&lt;p&gt;I see the &lt;a href=&quot;http://www.kevinsheppard.com/images/5/56/Chapter5.pdf&quot;&gt;Generalized Method of Moments&lt;/a&gt; suggested in numerous academic papers as a way to &lt;a href=&quot;http://cims.nyu.edu/~almgren/timeseries/Vol_Forecast2.pdf&quot;&gt;calibrate&lt;/a&gt; stochastic volatility models.  However, any decent trading shop is going to calibrate to observable option prices instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any places that have used GMM in an actual trading context, say in some market where historical time series are obtainable and derivatives prices unavailable? &lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-12-04T19:29:43.640" Title="Are there &quot;live&quot; uses of the Generalized Method of Moments or are they all academic?" Tags="&lt;stochastic-volatility&gt;&lt;calibration&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2491" PostTypeId="2" ParentId="2360" CreationDate="2011-12-01T19:33:35.460" Score="17" Body="&lt;p&gt;Some cynical but functional definitions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It's what you can't model if you're not using tick by tick data&lt;/li&gt;&#xA;&lt;li&gt;It's what proper quant pricing theory doesn't know how to model yet &lt;/li&gt;&#xA;&lt;li&gt;It's information (order book behavior) that reflects momentary fluctuations in the supply/demand of a given contract, rather than its underlying value (eg an arbitrage free price)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The third is the most accurate but the first is the most useful, IMHO. The second is the most common meaning in academic papers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some examples:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;When prices hit certain levels (often round number prices eg multiples of 5), they might move suddenly as a large number of traders have punched in stops at these levels&lt;/li&gt;&#xA;&lt;li&gt;In the minutes before a news announcement, spreads widen as some market makers pull their orders in anticipation of upcoming volatility &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As you might expect, it is more significant in illiquid markets where there are insufficient players to make efficient market assumptions hold.&lt;/p&gt;&#xA;" OwnerUserId="1712" LastActivityDate="2011-12-01T19:33:35.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2492" PostTypeId="1" AcceptedAnswerId="2495" CreationDate="2011-12-01T20:18:31.420" Score="2" ViewCount="165" Body="&lt;p&gt;There's a relatively new product in the market / on the Nasdaq called &lt;a href=&quot;http://www.nasdaqomxtrader.com/Micro.aspx?id=Alpha&quot; rel=&quot;nofollow&quot;&gt;Alpha Indexes&lt;/a&gt;.  It lets one own a company -- e.g. Apple, GE, Google, etc -- as the difference between how that company does (the &quot;target&quot;), and a benchmark (e.g. SPY).  That seems like a &quot;stock analyst's dream&quot;, being able to say they believe company XYZ will grow their earnings and do better than the market by X%, rather than assigning a future price to something that could be greatly affected by other factors (e.g. Euro debt crisis or whatever next crisis), which frankly, seems highly incestuous: having to pick the &lt;strong&gt;price&lt;/strong&gt; of a particular instrument, that is affected greatly by other instruments in ways it should not be (vs. investing on relative performance).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question I have is, how closely can this return be done today with options. What are the parallels, and how close/far off are they?  Perhaps beyond company XYZ vs SPY, what if someone just wants to own gold against copper, or Apple against Microsoft, etc.  That seems like just substituting another benchmark in.  &lt;/p&gt;&#xA;" OwnerUserId="1675" LastEditorUserId="1675" LastEditDate="2011-12-01T20:33:53.873" LastActivityDate="2011-12-01T22:51:36.303" Title="Buying one company or index against another, is this readily possible with options, with an accurate return (also Alpha Indexes)" Tags="&lt;options&gt;&lt;correlation&gt;&lt;market&gt;&lt;market-making&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2493" PostTypeId="2" ParentId="1177" CreationDate="2011-12-01T20:36:15.213" Score="5" Body="&lt;p&gt;It is mean reverting due to the addition of new information into the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Imagine a very very simple case: the world only has two traders trading chicken feet. Trader A and B both think it's worth around \$10-\$11 per foot because historically, they have been trading that range all else constant. So vol is low.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suddenly, GSK announces chicken feet cause cancer, trader A thinks they're worthless and trader B thinks some people dont care so he thinks they're worth \$5. It'll trade in the \$0 - \$5 range (higher vol). As the truth slowly unfolds, their opinions will converge (lower vol).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Becareful though, this doesn't mean you can capitalize on shorting vol when vol is above the mean (vice versa), realized vol may kill you. And market usually reflects mean reversion if you look at the term structure during crisis, front few months gets bid way more than the back months so you'll have a very descending term structure.&lt;/p&gt;&#xA;" OwnerUserId="1726" LastEditorUserId="38" LastEditDate="2011-12-03T13:28:47.227" LastActivityDate="2011-12-03T13:28:47.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2494" PostTypeId="2" ParentId="2492" CreationDate="2011-12-01T22:01:44.073" Score="2" Body="&lt;p&gt;These Alpha Indexes are a bet on the &lt;strong&gt;excess returns&lt;/strong&gt; of the target instrument. Options are, ultimately, a bet on the &lt;strong&gt;volatility&lt;/strong&gt; of the underlying. The two are not related. If you wanted to replicate an Alpha Index of gold against copper, just buy gold and short copper (usually through the futures market). Again, this has nothing to do with options.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-12-01T22:01:44.073" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="2495" PostTypeId="2" ParentId="2492" CreationDate="2011-12-01T22:51:36.303" Score="1" Body="&lt;p&gt;My understanding is that this is a completely new product which is not perfectly statically replicable given current instruments.  The product, which your explanation does not make clear, is an &lt;em&gt;option&lt;/em&gt; on an index, where the index value is close to (but not exactly, due to dividends) the total return from a long-short position in the two underlyings.  It is not replicable with existing options because, for example, the deltas of options on the underlyings would change if the two underlyings moved in the same direction in lock-step, but the delta of this new option would not (the index value would remain at 100).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To use your example, simulating AVSPY (AAPL vs. SPY) is very easy using equal dollar positions long AAPL and short SPY.  However, that is not the point.  AVSPY is just an index underlying for a new options chain.  One &lt;em&gt;could&lt;/em&gt;, of course, replicate this option dynamically by trading the AAPL-SPY long-short pair, but that is subject to all the usual caveats of dynamic replication.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-12-01T22:51:36.303" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2496" PostTypeId="1" CreationDate="2011-12-02T05:34:04.773" Score="4" ViewCount="294" Body="&lt;p&gt;You can calculate the value of an option free bond or swap by using the spot curve and discounting cashflows accordingly. Alternatively, apparently you can use a single-factor short rate model in a binomial tree as you would for options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone explain why we refer to using short-rate models for pricing option-free instruments? For a swap, for example, I've seen the fixed side get valued by discounting cashflows, and the floating side estimated using the current curve and then discounted, to arrive at a value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it that short-rate models allow you to add flavor to how the rates may move, and therefore assume that you're not stuck with symmetric volatility around each point on the curve? Is the short-rate approach superior to the estimate and discount cashflows with the current, static term structure?&lt;/p&gt;&#xA;" OwnerUserId="1443" LastEditorUserId="1443" LastEditDate="2011-12-02T16:56:34.520" LastActivityDate="2011-12-19T03:10:39.290" Title="Value of option-free instruments with a short-rate model vs the spot curve" Tags="&lt;interest-rates&gt;&lt;valuation&gt;&lt;binomial-tree&gt;&lt;floating-rate&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2497" PostTypeId="2" ParentId="1177" CreationDate="2011-12-02T05:47:01.550" Score="15" Body="&lt;p&gt;Volatility is mean reverting because you can prove by contradiction that it cannot be otherwise. You have an intuitive understanding of why, but you need something closer to a proof.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume volatility is not mean reverting. At time t, the effect of the random component of the volatility on its level will be $\sigma \cdot \sqrt{t}$  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For an arbitrarily large &lt;code&gt;t&lt;/code&gt; (far enough into the future), the probability that the final volatility is in the same order of magnitude as where it started approaches 0. This means if you look at it evolve for long enough, you are certain it will eventually become arbitrarily large or arbitrarily small, which would be nonsense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore volatility cannot NOT be mean reverting.&lt;/p&gt;&#xA;" OwnerUserId="1443" LastEditorUserId="141" LastEditDate="2011-12-05T20:33:43.133" LastActivityDate="2011-12-05T20:33:43.133" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2500" PostTypeId="1" CreationDate="2011-12-02T21:38:35.247" Score="10" ViewCount="3934" Body="&lt;p&gt;My concern is how to handle a negative value for the Kelly formula. Even when you have a system that has positive expectancy, you can (and usually will) sustain a number of losses, sometimes consecutively. This is usually most relevant at the beginning of trading system signals, each loss has a large impact on the formula. How would one handle trade signals when the Kelly formula turns negative? This is assuming a long only system. It seems to me if you ignore the trade signal you would never recover back to a positive probability since your choice to not take the trade would negate any chance to recover.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some clarifications: I am writing software for a mechanical trading system. I can run backtest simulations to get a sense of historical &quot;edge&quot; and &quot;odds&quot;. My confusion is how to apply the Kelly formula once the system goes live and I am making trades based on the system signals. I want to use actual trade data to calculate the Kelly %. Should I use backtest data for the previous x trades and then walk that data forward as I make new trades? Should I just use backtest odds and edge until I have enough live data to use?&lt;/p&gt;&#xA;" OwnerUserId="1743" LastEditorUserId="1106" LastEditDate="2011-12-05T20:33:14.930" LastActivityDate="2011-12-05T20:33:14.930" Title="How to apply the Kelly criterion when expected return may be negative?" Tags="&lt;quant-trading-strategies&gt;&lt;expected-return&gt;&lt;kelly-criterion&gt;&lt;position-sizing&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2502" PostTypeId="2" ParentId="2500" CreationDate="2011-12-02T22:40:20.233" Score="5" Body="&lt;p&gt;You are trying to apply the Kelly Criterion, supposedly to maximize how aggressively to bet, and you are having trouble when the Kelly Value turns negative. The naive answer to your question is that when your kelly value turns negative, then $f=\frac{bp-q}{b}$ turning negative means the instantaneous expected return is negative, which means you should not bet any of your wealth at this moment if you don't have the ability to take the opposite bet (you said you're long only) or alter your instantaneous strategy or timing to change your estimated p, b and q.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The more accurate answer is that if your estimated probabilities are changing sufficiently for the calculated kelly ratio to turn negative and positive at various times, then that means you are violating one of the key assumptions of the strategy. The strategy only works if you are able to sustain both the edge and the odds (p and b) for the long term, and therefore maximize your long term wealth. You should aim to estimate probabilities for a longer time horizon for your strategy to make sense. In the case where that is negative too, then you should abstain from trading for that period of time, or find a way to reverse your strategy or go short.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, note that using such trade signals is likely to lead to large error rates in the odds (b) if you're able to eventually fit your system's behavior to produce accurate &quot;edge&quot; estimates (p).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you insist that your system has positive expectancy, then the only for you to have positive expectancy and negative kelly ratio is if your calculating those two on different maturity horizons. That is, with a positive expectancy over the longer horizon, if you want to keep trading, and want to know how aggressively to bet in the short term, then you need to estimate the kelly ratio for the probabilities and odds with appropriate maturity horizon, and the kelly ratio will NOT be negative, by definition.  You can work through the math to convince yourself by calculating expected payoff as a function of probability of the probability distribution of gains and losses.&lt;/p&gt;&#xA;" OwnerUserId="1443" LastActivityDate="2011-12-02T22:40:20.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2503" PostTypeId="1" CreationDate="2011-12-02T22:47:37.827" Score="5" ViewCount="332" Body="&lt;p&gt;Hello I am doing an analysis on covered calls with and extra amount of naked calls. Ignore the symbol and current macroeconomic events.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I couldn't find any reference to this strategy (unbalanced is an adjective I chose, referring to the non-equivalent legs), it looks favorable because of the amount of premium that can be collected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the covered call&#xA;-10 ATM calls&#xA;+1000 shares&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the additional naked calls&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-10 ATM calls&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is considered because of margin requirement for the naked calls isn't as much as completely covering them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example purposes, 65 strike is used and assume symbol shares were purchased at or near 65&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The risk profile of a normal covered call looks like this: The green line represents profit/loss at expiration, the &quot;hockey stick&quot; risk profile you may be familiar with.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/kwyfx.png&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do note: the premium collected here represents a maximum 7% gain on the entire position, which is mainly the shares.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note: the normal covered call becomes loss making at underlying price $60.55 (by expiration), this represents at 6.8% decline in the underlying asset. This represents 6.8% of downside protection.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The risk profile of an unbalanced covered call looks like this: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/IKdfV.png&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do note: the premium collected here represents a maximum 10% gain on the entire position, and the symbol would have to decrease or increase by 2 strikes on expiration (63/65 strike) or increase by for you to get the same 7% gain that the normal covered call would have provided in its best scenario.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note: the unbalanced covered call becomes loss making at underlying price $58.33 (by expiration), this represents a 10% decline in the underlying asset and 10% of downside protection. This is sort of favorable because all of the time premium will still be collected and more calls can be written for the next option series after expiration, so total account equity will still grow despite losses in the underlying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Again, the green line represents profit/loss at expiration day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the extra downside protection, and potential need for a stop order if the asset price rises too high, is the added risk of the naked leg justified? Mainly, what other variables should be considered in this analysis, especially related to the theoretically unlimited loss on asset price rise and how fast the delta will increase on the naked leg.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is similar to the risk profile of a diagonal, except that the underlying is still stock so after expiration, one could write new options at any strike price without changing margin considerations. (in a diagonal, the long leg's strike has to be subtracted from the short legs strike, resulting in potentially massive margin implications)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any insight&lt;/p&gt;&#xA;" OwnerUserId="1453" LastEditorUserId="26792" LastEditDate="2017-03-09T07:58:18.327" LastActivityDate="2020-10-02T18:12:40.057" Title="Analysis of Unbalanced Covered Calls" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;option-strategies&gt;&lt;skewness&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2504" PostTypeId="1" CreationDate="2011-12-02T23:25:15.160" Score="-1" ViewCount="4486" Body="&lt;p&gt;When someone wants to calculate a 30-day moving average of a commodity, do they mean 30 business days, or 30 calendar days?  I'm looking for the general consensus, not &quot;you could do it this way or that way&quot;.&lt;/p&gt;&#xA;" OwnerUserId="1744" LastEditorUserId="31239" LastEditDate="2018-01-05T20:01:01.727" LastActivityDate="2018-01-05T20:01:01.727" Title="When people say calculate moving average for 30 days include weekends or not?" Tags="&lt;moving-average&gt;" AnswerCount="1" CommentCount="3" ClosedDate="2011-12-06T18:50:15.607" ContentLicense="CC BY-SA 3.0" />
  <row Id="2505" PostTypeId="2" ParentId="2504" CreationDate="2011-12-03T00:43:28.443" Score="6" Body="&lt;p&gt;Trading days..................&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Days where there is pricing information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any moving average is a moving average of pricing information. Not the times where there can be no pricing information.&lt;/p&gt;&#xA;" OwnerUserId="1453" LastActivityDate="2011-12-03T00:43:28.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2506" PostTypeId="1" CreationDate="2011-12-03T10:04:10.443" Score="3" ViewCount="386" Body="&lt;p&gt;I have two cross and an account in EUR:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;EUR/USD&lt;/li&gt;&#xA;&lt;li&gt;GBP/USD&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I would like to do a balanced linear regression using R. With &quot;balanced&quot; I mean that I would like to normalize it by calculating the difference in pips from the previous day and the current, and then multiply by the respective (middle) pip value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do a simple example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The series are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EUR/USD&lt;/strong&gt;&#xA;1.3000&#xA;1.3050&#xA;1.3060&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;GBP/USD&lt;/strong&gt;&#xA;1.6000&#xA;1.6050&#xA;1.6060&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The differences are:&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EUR/USD&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;50 pips &lt;em&gt;(1.3000 - 1.3050)&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;10 pips &lt;em&gt;(1.3050 - 1.3060)&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;GBP/USD&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;50 pips &lt;em&gt;(1.6000 - 1.6050)&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;10 pips &lt;em&gt;(1.6050 - 1.6060)&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Now, calculate (the values are inventend) the middle pip values:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;(remember that account currency in EUR)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EUR/USD&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;13 €&lt;/strong&gt; pip value &lt;em&gt;(at middle pip: 1.3025)&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;13.5 €&lt;/strong&gt; pip value &lt;em&gt;(at middle pip: 1.3055)&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;GBP/USD&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;9 €&lt;/strong&gt; pip value &lt;em&gt;(at middle pip: 1.6025)&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;8.5 €&lt;/strong&gt; pip value &lt;em&gt;(at middle pip: 1.6055)&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Now the normalized series that I studied should be:&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EUR/USD&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;50(pip difference) * 13€ = 650&lt;/li&gt;&#xA;&lt;li&gt;10(pip difference) * 13.5€ = 135&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;GBP/USD&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;50(pip difference) * 9€ = 450&lt;/li&gt;&#xA;&lt;li&gt;10(pip difference) * 8.5€ = 85&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The normalized series are:&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EUR/ USD:&lt;/strong&gt; 650, 135&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;GBP/USD:&lt;/strong&gt; 450, 85&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&lt;strong&gt;What do you think of this type of procedure?&lt;/em&gt;&lt;/strong&gt;&#xA;(then I will use those series in the linear regression)&lt;/p&gt;&#xA;" OwnerUserId="1663" LastEditorUserId="1663" LastEditDate="2011-12-03T10:12:16.917" LastActivityDate="2011-12-03T10:12:16.917" Title="How to balance two Forex crosses correctly to do a linear regression?" Tags="&lt;r&gt;&lt;fx&gt;&lt;regression&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2507" PostTypeId="2" ParentId="879" CreationDate="2011-12-03T13:44:18.030" Score="9" Body="&lt;p&gt;Google for granger causality and its general version, transfer entropy, for a measure of whether a time series has a causal relationship with another (measured by calculating how much the conditional entropy of a time series decreases if we know another one, conditioned on everything else we know).&lt;/p&gt;&#xA;" OwnerUserId="1712" LastActivityDate="2011-12-03T13:44:18.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2508" PostTypeId="1" CreationDate="2011-12-03T14:57:04.713" Score="4" ViewCount="352" Body="&lt;p&gt;I'm trying to model interest rates, and will use the following equation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dr = \mu r dt + \sigma r dW $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm also being told that interest rates are 40% correlated to S&amp;amp;P returns.  How can I include correlation to the S&amp;amp;P into this equation?  (It is pretty weird that interest rates are being correlated to S&amp;amp;P returns)&lt;/p&gt;&#xA;" OwnerUserId="551" LastEditorUserId="467" LastEditDate="2011-12-04T14:26:17.543" LastActivityDate="2011-12-04T20:41:56.123" Title="Modeling interest rates with correlation" Tags="&lt;modeling&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2509" PostTypeId="2" ParentId="2434" CreationDate="2011-12-03T21:37:00.737" Score="5" Body="&lt;p&gt;While the time decay on the time value component of an option does not depend on how much the option is in the money, theta is the change in total option value not just the time value due to the passage of time. Time decay is higher for options that are out of the money assuming volatility and the risk free rate are held constant. This is because a greater proportion of the full option value is intrinsic value for an option that is in the money. An option that is out of the money has a greater proportion of its value in the time value of the option so the time decay will have a greater impact. If you don't want to work through the Black-Scholes model, you can also use the GBSCharacteristics function in the fOptions package within the R programming language to test for various input combinations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fundamental model of small changes in the derivative increasing to larger changes in the derivative as time to expiration decreases is true in all cases. What changes is the convexity. As volatility increases and all else is held constant, the change in the rate of time decay increases. Another way to look at it: as volatility approaches 0, the graph will approach a straight line but the top left portion will always have smaller changes than the bottom right.&lt;/p&gt;&#xA;" OwnerUserId="232" LastEditorUserId="232" LastEditDate="2011-12-15T16:50:20.143" LastActivityDate="2011-12-15T16:50:20.143" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2510" PostTypeId="2" ParentId="2106" CreationDate="2011-12-03T21:39:23.840" Score="1" Body="&lt;p&gt;The paper by Tavi Ronen is interesting in its analysis of the liquidity and price discovery. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1573535&quot; rel=&quot;nofollow&quot;&gt;Where Did All the Information Go? Trade in the Corporate Bond Market&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As I pointed out above a simple measure is the one by Boa et al in their &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&quot;Illiquidity of corporate bonds&quot; (see link in my comment to Brian's answer)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For a very different take on what being illiquid means, the paper by Rossi is very interesting&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;“&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1571437&quot; rel=&quot;nofollow&quot;&gt;Realized Volatility, Liquidity, and Corporate Yield Spreads&lt;/a&gt;”&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Even if it is not clear from the title, the gist of it is that from the low liquidity something can inferred about the value of the current misplacing in corporate bonds (simply put, the trading costs are larger than the mispricings). &lt;/p&gt;&#xA;" OwnerUserId="1531" LastActivityDate="2011-12-03T21:39:23.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2512" PostTypeId="1" AcceptedAnswerId="2522" CreationDate="2011-12-03T22:53:35.637" Score="7" ViewCount="621" Body="&lt;p&gt;I am working out a numerical integral for option pricing in which I'm simulating an interest rate process using a Cox-Ingersoll-Ross process.  Each step in my Monte Carlo generated path is a realization of a noncentral chi-squared random variable.  What variance reduction techniques may be applied in this case?  Can one, for example, generate antithetic variates that follow a CIR process?&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2017-07-04T18:44:14.537" Title="How to reduce variance in a Cox-Ingersoll-Ross Monte Carlo simulation?" Tags="&lt;option-pricing&gt;&lt;interest-rates&gt;&lt;monte-carlo&gt;&lt;simulations&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2513" PostTypeId="2" ParentId="1356" CreationDate="2011-12-03T22:57:19.293" Score="2" Body="&lt;p&gt;I believe the assumption here in the first quote is that returns are either strictly positive or strictly negative and the authors are comparing the effect of volatility on geometric returns to arithmetic. The issue of diversification benefits have little to do with this difference as opposed to a time varying covariance matrix. The benefits of diversification in volatile times assumes low correlation and the assumption that asset correlations do not have a strong positive correlation with volatility. This is a common simplification for teaching basic finance. The second quote will be true when the ratio of return to risk is approximately equal across assets and assets are not perfectly positively correlated. The third quote is true on a long time horizon because real interest rates are positive. This follows from the fundamental assumption that a dollar today is worth more than a dollar tomorrow.&lt;/p&gt;&#xA;" OwnerUserId="232" LastActivityDate="2011-12-03T22:57:19.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2514" PostTypeId="2" ParentId="2508" CreationDate="2011-12-04T16:05:54.330" Score="5" Body="&lt;p&gt;The model you assume for the interest rate process is a &lt;a href=&quot;http://en.wikipedia.org/wiki/Geometric_Brownian_motion&quot; rel=&quot;nofollow&quot;&gt;Geometric Brownian Motion&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As strimp099 highlights in his comments it is mainly used to model equities because you most of the time want your interest rate models to be &lt;em&gt;positive&lt;/em&gt; and &lt;em&gt;mean reverting&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few models have been developed: &lt;a href=&quot;http://en.wikipedia.org/wiki/Vasicek_model&quot; rel=&quot;nofollow&quot;&gt;Vasicek&lt;/a&gt;, &lt;a href=&quot;http://en.wikipedia.org/wiki/Cox%E2%80%93Ingersoll%E2%80%93Ross_model&quot; rel=&quot;nofollow&quot;&gt;CIR&lt;/a&gt;, &lt;a href=&quot;http://en.wikipedia.org/wiki/Hull%E2%80%93White_model&quot; rel=&quot;nofollow&quot;&gt;HW&lt;/a&gt;. You could have a pick in there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the correlation, the idea is to make your process $r_t$ rely on a &lt;em&gt;multi-dimensional&lt;/em&gt; Brownian motion, for example 2-dimension, where the first one is specific to the interest rate process and the other one is the brownian motion used in the equities model (representing your S&amp;amp;P 500).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dr_t=a(b-r_t)dt+\sigma(dW^1_t+dW^2_t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dS_t = \mu S_t dt + \sigma S_t dW^2_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is how you &quot;induce&quot; correlation; by having the same Brownian motion in the dynamics of the two processes. You could also have $r_t$ occuring somewhere in $dS_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your question, you discuss about the S&amp;amp;P, but it's really important to understand that including the correlation requires you to define a model for S&amp;amp;P as well, which is the $S_t$ in my example.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2011-12-04T20:41:56.123" LastActivityDate="2011-12-04T20:41:56.123" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2515" PostTypeId="2" ParentId="2490" CreationDate="2011-12-04T19:24:06.170" Score="3" Body="&lt;p&gt;GMM method is a powerful method to calibrate historically, only. Also, the historical Calibration is used in the banking industry for &lt;em&gt;forecast&lt;/em&gt; an asset’s performances and &lt;strong&gt;not&lt;/strong&gt; for &lt;em&gt;replicating&lt;/em&gt; them. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mathematically, it's known that historical vs options calibration is equivalent to observing an asset through two different probabilities (historical vs the neutral one). This is why you will observe Apple's trend around $\mu \approx 45\% $ under the historical proba instead of the lower interest rate in the neutral world.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/AwInb.png&quot; alt=&quot;Appl&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For an insight on what could be done with the two probabilities see the article &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1717163&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;P&quot; versus &quot;Q&quot;&lt;/a&gt; of Attilio Meucci.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are some articles who are interested in linking the two probabilities, i.e. the historical and the neutral one. The big advantage of this approach is indubitably the great amount of historical data which would provide an appreciable robustness to the neutral calibration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But at my knowledge this is so far not used in the banking industry for reasons linked to the change of probability (weird assumptions on the risk premia) and the resulting change of model.&lt;/p&gt;&#xA;" OwnerUserId="539" LastEditorUserId="539" LastEditDate="2011-12-04T19:29:43.640" LastActivityDate="2011-12-04T19:29:43.640" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2516" PostTypeId="1" AcceptedAnswerId="2519" CreationDate="2011-12-04T21:12:59.953" Score="11" ViewCount="2715" Body="&lt;p&gt;Do you evaluate a strategy in a backtest based on the cumulative returns generated by the strategy (i.e. looking at the cumulative returns of the trades that occur) or do you start with a certain dollar amount and look at the cash at end to compute the annualized return. The reason I ask is because things like position sizing and adding position to a certain trade are much easier to do when starting out with a dollar amount in a portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tend to look at a strategy as a collection of trades with particular entry and exit points. If using multiple entry &amp;amp; exit points are used for each signal (adding positions or taking off positions for each signal) it is much easier to calculate returns per trade if looking at a dollar amount that was invested due to each signal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have seen both approaches being used and personally prefer using returns rather than starting with a dollar amount. Just curious to see how people approach this and why.&lt;/p&gt;&#xA;" OwnerUserId="1696" LastEditorUserId="1106" LastEditDate="2011-12-06T19:02:29.753" LastActivityDate="2017-02-22T17:19:21.383" Title="How to properly evaluate backtest returns?" Tags="&lt;automated-trading&gt;&lt;quant-trading-strategies&gt;&lt;backtesting&gt;" AnswerCount="5" CommentCount="3" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2517" PostTypeId="2" ParentId="2516" CreationDate="2011-12-04T22:13:18.187" Score="4" Body="&lt;p&gt;I think your question may be getting at the difference between time weighted returns and dollar weighted returns. The only advantage I see to using a dollar amount is to simplify drawdown calculations. Both dollar weighted and time weighted returns are necessary to evaluate a strategy particularly when benchmarking against a competing strategy. Ignoring drawdowns by looking at a starting dollar amount and ending dollar amount will become problematic when you want to leverage the strategy and margin calls may occur.&lt;/p&gt;&#xA;" OwnerUserId="232" LastActivityDate="2011-12-04T22:13:18.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2518" PostTypeId="2" ParentId="2516" CreationDate="2011-12-04T23:36:35.707" Score="6" Body="&lt;p&gt;We don't give strategies a dollar amount during backtesting, rather backtesting shows how much capital would be required to successfully deploy a strategy. We also don't look just at returns but many different metrics including but not limited to, max drawdown, variance of draw downs, number of trades, holding period, correlation (or lack of) with various indexes, Sharpe ratio, commissions paid, share turnover, and numerous other measures of variance. I view position sizing as a somewhat separate problem that we currently don't completely tackle at backtesting time. There may be max position sizes that a strategy can use for a given opportunity but often this is somewhat dependent on security being traded.&lt;/p&gt;&#xA;" OwnerUserId="373" LastActivityDate="2011-12-04T23:36:35.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2519" PostTypeId="2" ParentId="2516" CreationDate="2011-12-04T23:51:49.500" Score="7" Body="&lt;p&gt;I'd say it depends on how close you want to be to reality and what the strategy entails.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance one scenario when actual currency makes sense is when you want to take contract sizes and position limits into account, for instance agricultural futures contracts nearly always impose a position limit for one party in one or all contracts.  If your strategy on the other hand wants to invest, say, all returns in one or more such contracts the strategy will either fail, well, not in the backtest but in the real world.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Representing hard limits like contracts sizes, position limits, minimum tick movement, etc. in terms of returns is impossible or at best questionable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm sure this scenario doesn't apply to you as you can obviously go with either approach, I just want to point this out to other people that may have a similar question in a different context.&lt;/p&gt;&#xA;" OwnerUserId="1040" LastActivityDate="2011-12-04T23:51:49.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2521" PostTypeId="2" ParentId="2516" CreationDate="2011-12-05T09:54:04.757" Score="6" Body="&lt;p&gt;&lt;a href=&quot;http://www.portfolioprobe.com/2010/11/05/backtesting-almost-wordless/&quot;&gt;http://www.portfolioprobe.com/2010/11/05/backtesting-almost-wordless/&lt;/a&gt; shows an example of how the results from a backtest can be deceiving.  This would be true with either returns or value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main issue is that the portfolio you start with can have an impact on what &quot;good&quot; means.&lt;/p&gt;&#xA;" OwnerUserId="249" LastActivityDate="2011-12-05T09:54:04.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2522" PostTypeId="2" ParentId="2512" CreationDate="2011-12-05T17:29:34.540" Score="5" Body="&lt;p&gt;The very easiest change you can make is to switch to &lt;a href=&quot;http://en.wikipedia.org/wiki/Low-discrepancy_sequence&quot;&gt;quasirandom sampling&lt;/a&gt;.  I favor the Niederreiter sequence, for which you can find implementations in most languages around the web.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also get a (sometimes tremendous) speed boost by running using a &lt;a href=&quot;http://www.math.nyu.edu/faculty/goodman/teaching/MonteCarlo2005/notes/VarianceReduction.pdf&quot;&gt;control variate&lt;/a&gt;.  Even a swap would probably reduce your variance somewhat.  I don't recall the CIR offering closed-form pricing formulas for anything more complicated than that, but it's been a very long time since I've seen the model in action.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are still trying to value the refinancing rights (as you were in the previous question), you will need to characterize the optimal exercise strategy for those rights.  Unless you want to just make some simple assumption about it, the exercise strategy needs to be found via dynamic programming. In the context of Monte Carlo, this requires you to use &lt;a href=&quot;http://www.opentradingsystem.com/quantNotes/Longstaff_Schwartz_technique_.html&quot;&gt;Least Squares Monte Carlo&lt;/a&gt; or one of its brethren.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-12-05T17:29:34.540" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2523" PostTypeId="1" AcceptedAnswerId="2525" CreationDate="2011-12-05T19:30:28.260" Score="12" ViewCount="1323" Body="&lt;p&gt;I was asked today to &quot;quantify&quot; the precision of an estimated the standard deviation from a small sample, I was not sure how to answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The case is quite simple, I have a sample of $n=25$ measures (returns as you would have guessed). I used the classic unbiased estimator for the standard deviation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma_x = \sqrt{\frac{1}{N-1}\sum_{n=1}^n (x_i-\bar{x})^2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The underlying question was : how much data do we need for the standard deviation to be statistically meaningful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I read &lt;a href=&quot;https://stats.stackexchange.com/questions/631/standard-deviation-of-standard-deviation&quot;&gt;here&lt;/a&gt; that computing the standard error of the standard deviation is difficult to estimate, but I wanted to know if there was a common procedure used by you guys in general?&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2012-06-10T17:47:20.177" Title="What is the precision of standard deviation estimates with small samples?" Tags="&lt;statistics&gt;&lt;econometrics&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2524" PostTypeId="2" ParentId="2523" CreationDate="2011-12-05T22:33:31.667" Score="5" Body="&lt;p&gt;Actually you should be interested by the Berry Essen's theorem which precises the rate of convergence of the central limit theorem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given i.i.d. $X_1,\dots, X_n \sim X$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) GLN : &#xA;   assuming $E(X)&amp;lt;\infty$ then  $\overline{X}_n-E(X)\to 0 $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) CLT (&quot;rate&quot; of the GLN) : &#xA;   assuming $E(X^2)&amp;lt;\infty$ then $\frac{\sqrt{n}}{\sigma^2} \big(\overline{X}_n-E(X)\big)\to N(0,1) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Berry Essen (&quot;rate&quot; of the CLT) : assuming $E(X^3)&amp;lt;\infty$ , then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sup_{x\in \mathbb{R}}\bigg| \,F_{\frac{\sqrt{n}}{\sigma^2} \big(\overline{X}_n-E(X)\big)}(x) - F_{N_{0,1}}(x) \bigg| \leq \frac{0.34445 E|X|^3 + 0.16844}{\sqrt{n}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $F_{}$ holds for the CDF.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is an upper bound (of the order $\sqrt{n}$) usable for your CLT approximation. &lt;/p&gt;&#xA;" OwnerUserId="539" LastActivityDate="2011-12-05T22:33:31.667" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2525" PostTypeId="2" ParentId="2523" CreationDate="2011-12-06T01:32:01.660" Score="9" Body="&lt;p&gt;Treat the estimate of standard deviation as a random variable. Then you can bootstap the sample estimate and generate t-statistics and associated confidence intervals for your statistics. I describe a generic boostrap process on this &lt;a href=&quot;https://quant.stackexchange.com/questions/2020/how-do-you-distinguish-significant-moves-from-noise&quot;&gt;post&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2011-12-09T12:57:44.710" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2526" PostTypeId="1" CreationDate="2011-12-06T01:33:33.163" Score="12" ViewCount="1737" Body="&lt;p&gt;I am trying to classify similar looking curves of a timeseries and was wondering what is the best algorithm to research. Reading R, it looks like k-means clustering could be applied - but I don't know if there are better algorithms. Any pointers is much appreciated. My concern is if k-means could group points around a neighborhood of specific mean, but what if two curves with similar mean show different variance.&lt;/p&gt;&#xA;" OwnerUserId="1624" LastEditorUserId="5654" LastEditDate="2013-12-20T08:19:40.283" LastActivityDate="2013-12-20T08:19:40.283" Title="How to group timeseries showing similar curve" Tags="&lt;statistics&gt;&lt;quantization&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2527" PostTypeId="2" ParentId="2526" CreationDate="2011-12-06T02:39:44.577" Score="12" Body="&lt;p&gt;If the means are similar, then K-means will not do a great job. I would generate new features, perhaps based on higher moments of the distribution or some other properties (auto-correlation, summary of spectral density, etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using this new set of features, If you see separation of two curves when you plot draws in feature space then k-means would be an effective grouping algorithm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's hard to diagnose the best classification tool without better understanding the data generating process. For example, it might make sense to use a mixture of gaussians model instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This R task view page on &lt;a href=&quot;http://cran.r-project.org/web/views/Cluster.html&quot;&gt;clustering&lt;/a&gt; will provide a broad list of various tools you can use.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2011-12-06T02:39:44.577" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2528" PostTypeId="1" AcceptedAnswerId="2534" CreationDate="2011-12-06T03:22:52.133" Score="5" ViewCount="1226" Body="&lt;p&gt;Following up on my recent question on &lt;a href=&quot;https://quant.stackexchange.com/q/2512/1106&quot;&gt;variance reduction in a Cox-Ingersoll-Ross Monte Carlo simulation&lt;/a&gt;, I would like to learn more about using a quasi-random sequence, such as Sobol or Niederreiter, to generate quasi-Monte Carlo interest rate paths.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As &lt;a href=&quot;https://quant.stackexchange.com/q/2284/1106&quot;&gt;before&lt;/a&gt;, the objective is to estimate the value of a path-dependent interest rate option.  I am evaluating the integral defined by my valuation equation independently for $N$ paths, each of which are $T$ periods long.  $T$ may be as high as 40 (quarters, or 10 years) or more in some cases.  Should I use the first $N$ $T$-dimensional sequences?  The particular Niederreiter implementation I found only allows up to 20 dimensions, which is too small for most securities in my sample.  Is this a limitation of the particular implementation or a general limitation of the Niederreiter algorithm?  Is it valid to append successive 20-dimensional sequences (with a different random seed each time)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've also seen some applications where the first 1000 or so numbers in the sequence are discarded, or where successive innovations to the time-series skip as many as 100 numbers in the sequence between time steps.  What is the basis for these modifications to the basic sequences, and does it improve convergence in practical applications?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, is there any research on the pros and cons of the various low-discrepancy sequence algorithms for financial applications?  Why does &lt;a href=&quot;https://quant.stackexchange.com/a/2522/1106&quot;&gt;Brian B favor Niederreiter&lt;/a&gt;, for example?&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2011-12-06T16:02:59.200" Title="How to apply quasi-Monte Carlo to path-dependent options?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;time-series&gt;&lt;monte-carlo&gt;&lt;numerical-methods&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2529" PostTypeId="1" AcceptedAnswerId="2580" CreationDate="2011-12-06T06:56:08.697" Score="24" ViewCount="3468" Body="&lt;p&gt;Say I want to calculate a correlation matrix for 50 stocks using 3-year historical daily data. And there are some stocks that were recently listed for one year. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is not technically challenging because the correlation function in R can optionally ignore missing data when calculating pair-wise correlation. But honestly it worried me after deep thought: all the correlations for the short listed stock will bias to the regime it live in. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, a stock that exists only in last few months will inevitably have higher correlation than the stocks that have full 3-year history. And I think it will cause bias and annoying problems in the following applications using this correlation matrix. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, my question is: how do I adjust my correlation matrix whose elements are generated from different market regimes? I feel a dilemma. In order to assure that the whole matrix live in the same regime, it seems that either I need to use least possible samples, or I have to throw that stock away. But either way looks a waste to me. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know the correlations for that stock got to be lower, but how much lower? Is there an approach or formula derived from solid arguments? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did some research and surprisingly found that all public research on correlation matrix assuming adequateness of data. How can it be possible in practice?! A mystery for me to see this seemingly common problem has not been publicly addressed. &lt;/p&gt;&#xA;" OwnerUserId="1455" LastActivityDate="2011-12-26T01:26:37.457" Title="How do I adjust a correlation matrix whose elements are generated from different market regimes?" Tags="&lt;market-regimes&gt;&lt;correlation-matrix&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="17" ContentLicense="CC BY-SA 3.0" />
  <row Id="2530" PostTypeId="2" ParentId="2529" CreationDate="2011-12-06T10:55:21.893" Score="9" Body="&lt;p&gt;There are two functions for estimating variance matrices with missing values (and aimed at finance, by the way) in the R package BurStFin.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Available via:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;install.packages('BurStFin', repos=&quot;http://www.burns-stat.com/R&quot;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but not yet for 2.14.x.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can of course get a correlation matrix from the variance matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One function estimates a statistical factor model, the other performs Ledoit-Wolf shrinkage to equal correlation.  The treatment of the missing values is rather ad hoc in the functions.  There has been some study of this (I don't remember references), but I agree not as much as one would expect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The thrust of the question is correct, I think: how missing values are treated can have a significant effect on results.  For example, in the factor model case you want to think about whether you want to shrink towards zero or shrink towards the factors.&lt;/p&gt;&#xA;" OwnerUserId="249" LastActivityDate="2011-12-06T10:55:21.893" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2531" PostTypeId="1" CreationDate="2011-12-06T14:11:38.347" Score="8" ViewCount="2943" Body="&lt;p&gt;Pricing of VIX futures is complicated, because it is not possible to use a standard&#xA;hedging argument to get a value similar to stock futures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What different approaches for pricing VIX futures exist? Which ones are used&#xA;in practice by traders and others?&lt;/p&gt;&#xA;" OwnerUserId="1208" LastActivityDate="2011-12-06T15:41:02.720" Title="What is the market standard for pricing VIX futures?" Tags="&lt;futures&gt;&lt;vix&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2532" PostTypeId="1" CreationDate="2011-12-06T14:54:42.183" Score="2" ViewCount="107" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Possible Duplicate:&lt;/strong&gt;&lt;br&gt;&#xA;  &lt;a href=&quot;https://quant.stackexchange.com/questions/1489/how-should-i-calculate-the-implied-volatility-of-an-american-option-in-a-real-ti&quot;&gt;How should I calculate the implied volatility of an American option in a real-time production environment?&lt;/a&gt;  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&#xA;&#xA;&lt;p&gt;I am starting a project and would be grateful for some practical advice. My focus is on the informational content of equity derivatives,  (index, ETF &amp;amp; stocks). A central metric here is obviously IVOL. My question is what are the “industry” standard models for backing out IVOL from equity option prices? By “industry” I mean widely used by market practitioners. And which models have the best robustness &amp;amp; ease of implementation / accuracy trade off? Are there any pitfalls I should avoid?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To date my reading is taking me towards CRR tree solutions. I am aware of stochastic vol models and have looked at variations on the Model Free IVOL theme. But what would be most appropriate in today’s market?&lt;/p&gt;&#xA;" OwnerUserId="1756" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2012-08-17T14:29:41.177" Title="What models for backing out Equity IVOL" Tags="&lt;volatility&gt;&lt;derivatives&gt;" AnswerCount="0" CommentCount="2" ClosedDate="2011-12-10T07:30:04.250" ContentLicense="CC BY-SA 3.0" />
  <row Id="2533" PostTypeId="2" ParentId="2531" CreationDate="2011-12-06T15:41:02.720" Score="10" Body="&lt;p&gt;The best theoretical model for pricing vix futures and options is a variance gamma model.&#xA;However in practice that class of models is difficult to get robust results...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, most floor traders in vix products base their hedging off of the SPX option chain.  Vix is calculated from those options, in the first place,  so this approach makes intuitive sense.  Isolating the variance component of those the SPX options is straightforward using several approaches, and does not require much sophisticated numerical work.&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-12-06T15:41:02.720" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2534" PostTypeId="2" ParentId="2528" CreationDate="2011-12-06T16:02:59.200" Score="6" Body="&lt;p&gt;For such high-dimensional path problems you will want to use the &lt;a href=&quot;http://www.jstor.org/pss/2653031&quot;&gt;Morokov&lt;/a&gt; technique (you can find the paper online), which takes QR samples for the &quot;important&quot; dimensions and then reverts to pseudorandom for the less important dimensions in an interest rate problem remarkably similar to yours.  (Similar principles apply to using QR sequences in factor model based simulations).  Effectively, each sample in $T$-dimensional space has $P$ of its dimensions from the QR sequence and $T-P$ dimensions from a pseudorandom sequence. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Skipping techniques are generally considered a good idea, though the need for them is mitigated by the Morokov ordering.  The general principle is to start-skip about as many sample points (in $T$ dimensional space) as you plan to take overall.  Intermediate skips are, in my opinion, pointless when Morokov ordering is used.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do not forget to form any normal samples from the uniform QR samples using &lt;a href=&quot;http://www.mathfinance.de/FF/cpplib.php&quot;&gt;Moro inversion&lt;/a&gt; rather than Box-Mueller.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for sequence preferences, my firm did a study on a sample set of equity derivatives and found Niederreiter sequences to perform better than Halton or Sobol, by a slight margin.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-12-06T16:02:59.200" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2535" PostTypeId="2" ParentId="2526" CreationDate="2011-12-06T18:00:49.673" Score="5" Body="&lt;p&gt;We have used Neural Networks for this purpose. What we did was this: select a set of characteristics which can be directly calculated from the time series (e.g., mean, standard deviation, skewness, kurtosis, p-value from a normal fit, ACF stats etc.), and then run an NN to learn from a set of timeseries about how to classify them. We were trying to classify which among a set of models would produce the best forecasts for a series. We had the forecast answers, since we used the M-Competition data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, the results weren't great. May be we were looking at wrong set of characteristics, may be our classification were wrong. But this is definitely an way to solve the problem you mention. I would be interested in knowing if you get any success in this work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would also be interested if someone wants to collaborate on this investigation. Please see my profile for contact information.&lt;/p&gt;&#xA;" OwnerUserId="1442" LastEditorUserId="1442" LastEditDate="2011-12-13T21:12:18.833" LastActivityDate="2011-12-13T21:12:18.833" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2536" PostTypeId="1" CreationDate="2011-12-06T21:46:51.980" Score="4" ViewCount="338" Body="&lt;p&gt;This question is most relevant to the evaluation of embedded options, such as the refinancing option granted to borrowers in the mortgage and bank loan markets, or the call option present in some corporate bonds, than to exchange traded options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Much more so than market participants in exchange traded options, which have purely market-based incentives, the borrowers and issuing entities which are granted embedded options often employ sub-optimal (irrational) exercise strategies.  Sometimes, these only appear irrational to the lender/investor, when, in fact, they are optimal when considering other factors such as the borrower's personal financial condition or other factors (such as a homeowner's desire to move to a new house).  In those cases, the difficulty from the modeler's perspective is that these factors are unobservable, and, hence, must be modeled as random.  Other times, decision makers make truly sub-optimal decisions based on a private evaluation of the value of exercise that differs from a &quot;correct&quot; market-implied decision rule.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Which modeling approach leads to better predictions and better relative value measures?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Rational: Option-holder follows a fully rational and optimal exercise strategy when deciding whether or not to exercise his option.  The modeler attempts to reproduce the holder's payoff function as faithfully as possible.&lt;/li&gt;&#xA;&lt;li&gt;Behavioral: Option-holder follows a simple reduced-form exercise strategy which may lead to sub-optimal decisions.  The modeler attempts to estimate the parameters of the exercise strategy, either from market data or from historical experience.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Under the rational approach, how do you treat unobserved characteristics?  Does the presence of unobserved characteristics make the rational approach ultimately equivalent to a market-implied behavioral approach?  Is it even possible to fit the unobserved information directly to market data?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Open-ended Bounty Offer:&lt;/strong&gt; We may not yet have a broad enough user base familiar with the pricing and modeling of embedded options to adequately answer this question.  As such, I pledge to offer a bounty of 100 points to any user who can adequately answer this question.  If you are a new user and you have come to this question long after activity has died down, then so long as I am still active on this site my offer remains in effect.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-12-18T04:00:54.097" LastActivityDate="2011-12-18T04:00:54.097" Title="Which approach is better for modeling option exercise strategies, rational or behavioral?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;fixed-income&gt;&lt;embedded-options&gt;&lt;calibration&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2537" PostTypeId="2" ParentId="2046" CreationDate="2011-12-06T22:30:14.147" Score="4" Body="&lt;p&gt;There is another artificial intelligence online course co-sponsored by Stanford&#xA;&lt;a href=&quot;http://www.ai-class.org/&quot; rel=&quot;nofollow&quot;&gt;http://www.ai-class.org/&lt;/a&gt;&#xA;The class is about to finish, but you can login as a visitor to access the lecture video and handouts. &lt;/p&gt;&#xA;" OwnerUserId="1577" LastActivityDate="2011-12-06T22:30:14.147" CommentCount="1" CommunityOwnedDate="2014-07-23T16:34:06.740" ContentLicense="CC BY-SA 3.0" />
  <row Id="2538" PostTypeId="2" ParentId="2434" CreationDate="2011-12-07T04:26:59.660" Score="12" Body="&lt;p&gt;Theta decay doesn't depend on the in the moneyness. A 70 delta call and a 30 delta call have very close theta decay at any given moment. They are slightly different because of skew with 70 delta put having slightly bigger theta. Theta is the decay of extrinsic value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practical trading, you can assume your decay distribution (using your graph is fine) using a fair volatility but nobody can say for sure what the theta decay distribution ought to be. To answer that question isn't all that useful anyway. In practical trading and in the weeklies, decays are slower than the theoretical because people still have bids out there to close their position or the asymmetry of buys and sells. (People don't really want to sell pennies/nickels unless they're long already). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And theta really depends on the stock events because for a weekly on monday and an announcement is coming out on friday, there'll be almost no decay until friday. It becomes more of a break even play since you don't expect to scalp your long gamma.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Think about theta as the token to play the gamma game, with so few days left it becomes a break even game since these options will have smaller and smaller deltas.&lt;/p&gt;&#xA;" OwnerUserId="1726" LastEditorUserId="1726" LastEditDate="2011-12-08T15:39:16.450" LastActivityDate="2011-12-08T15:39:16.450" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2539" PostTypeId="1" AcceptedAnswerId="3266" CreationDate="2011-12-07T19:58:50.770" Score="12" ViewCount="8363" Body="&lt;p&gt;I am trying to convert minute based volatility into annualized volatility in such a way that both are comparable. $Vol_{min} * \sqrt(t)$ does not seam to get them into the same scale if I annualize using daily data of minute data. What are the adjustments I can do to make volatility calculated using intra-day data more comparable to volatility calculated using daily data. &lt;/p&gt;&#xA;" OwnerUserId="909" LastEditorUserId="35" LastEditDate="2012-05-02T15:42:27.093" LastActivityDate="2013-08-06T02:41:42.050" Title="How to annualize intra-day volatility on minute data?" Tags="&lt;volatility&gt;&lt;high-frequency&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="2540" PostTypeId="2" ParentId="2539" CreationDate="2011-12-07T21:30:19.583" Score="11" Body="&lt;p&gt;Intraday seasonality is a major factor in comparing volatility at different times of day.  Most time series display significantly higher volatility in the morning EST than mid-day.  For US exchange-traded products, volatility picks up again just before 4:00 PM EST.  This is known as the u-shaped volatility pattern for exchange-traded products.  A proper annualization, which puts minutely volatility at one time of day on the same scale as volatility at another time, would require that you take into account all the systematic variation in volatility as a function of time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This effect is very well known and has been thoroughly researched and described in &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0122796713&quot; rel=&quot;nofollow noreferrer&quot;&gt;An Introduction to High Frequency Finance&lt;/a&gt;, an excellent textbook written by the &lt;a href=&quot;http://www.olsen.ch/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Olsen group&lt;/a&gt;, which also sells analytics based on the research described in their book.  Their chapters 5 and 6 deal explicitly with an approach to your issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FYI, this question is tangentially related to some previous questions, &lt;a href=&quot;https://quant.stackexchange.com/q/581/1106&quot;&gt;How to update an exponential moving average with missing values?&lt;/a&gt; and &lt;a href=&quot;https://quant.stackexchange.com/q/1684/1106&quot;&gt;How to generate synthetic FX data for backtesting?&lt;/a&gt;  This book is also on &lt;a href=&quot;https://quant.stackexchange.com/a/2021/1106&quot;&gt;my favorite list of books to understand the math in quantitative finance&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2011-12-07T21:35:36.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2543" PostTypeId="2" ParentId="628" CreationDate="2011-12-08T04:56:23.207" Score="4" Body="&lt;p&gt;Here are some practical application for trading illiquid names:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For pricing/forecasting:&#xA;You still still calculate fair volatility using stock print data. In an illiquid stock and there's a large open interest in the market where professional traders are long, vol might diminish since when stock goes up(down), all the vol traders would be selling(buying) stock to gamma scalp and thus diminish vol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For quoting:&#xA;You quote width for options should be correlated with the average width of the stock market. For example: for a 50d call, you would quote 0.3 - 0.32 when stock is: 1.00 - 1.01. In the case where market is wider for stock say 1.00 - 1.05 you should only be willing to quote 0.3 - 0.34. This is because in the first case, when someone lifts your .32 offer, you can buy 1.01 to hedge but in the latter case, you can only buy 1.05. &lt;/p&gt;&#xA;" OwnerUserId="1726" LastActivityDate="2011-12-08T04:56:23.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2544" PostTypeId="2" ParentId="549" CreationDate="2011-12-08T06:11:08.037" Score="1" Body="&lt;p&gt;download gnuplot &lt;a href=&quot;http://www.gnuplot.info/screenshots/index.html#demos&quot; rel=&quot;nofollow&quot;&gt;better then matlab , R and has almost every thing you will need&lt;/a&gt; It can also do everything mentioned in the other posts, and even visualize data in real time, at no cost as its open source and offers output to almost any format you want even LaTex for your thesis.&lt;/p&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="1764" LastEditDate="2011-12-08T06:38:39.397" LastActivityDate="2011-12-08T06:38:39.397" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2546" PostTypeId="1" CreationDate="2011-12-08T15:07:37.680" Score="18" ViewCount="599" Body="&lt;p&gt;An historical VaR measure is parameterized in terms of the confidence level and also number of periods. Specifically, the $\alpha$% T-period VaR is defined as the portfolio loss &lt;em&gt;x&lt;/em&gt; in market value over time &lt;em&gt;T&lt;/em&gt;  that is not expected to be exceeded with probability (1 - $ \alpha$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for empirical backtesting research on the choice of T-period and $\alpha$% for producing stock portfolios. Usually this backtest research involves looking at the # of &quot;exceptions&quot; (violations of the predicted risk), convergence tests, the Kupiec, and Kupier test, or involves looking at the realized risk of a portfolio constructed to minimize the VaR measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An illustrative example of this research is &lt;a href=&quot;http://www.risk.net/data/Pay_per_view/risk/technical/2003/0903_market.pdf&quot;&gt;here&lt;/a&gt; -- however, this study involves the Greek equity market and the sample consists of only 5 equities and my focus market is U.S. equity portfolios consisting of say 25+ securities for 3-month to 1-year holding periods. Another VaR study covering the Forex market is &lt;a href=&quot;http://www.ny.frb.org/research/epr/96v02n1/9604hend.pdf&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-12-09T14:00:44.220" LastActivityDate="2015-12-25T03:44:11.573" Title="performance of historical VaR parameters" Tags="&lt;risk&gt;&lt;research&gt;&lt;risk-models&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="2548" PostTypeId="2" ParentId="1226" CreationDate="2011-12-08T18:19:03.057" Score="5" Body="&lt;p&gt;Assuming that:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;limit prices of Long and Short orders are equally pre-calculated in all 3 strategies;&lt;/li&gt;&#xA;&lt;li&gt;there is no risk-free return;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;strategies 1 and 2 have equal quality, and strategy 3 is slightly better.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the only advantage that strategy 3 takes over 1,and 2, is better location of the orders in the price level queue. In case of FIFO (price-time priority) matching algorithm, the second order will be closer to the market, and execute with higher probability.&#xA;In some instruments this delta can negligible, in others - important.&lt;/p&gt;&#xA;" OwnerUserId="1515" LastActivityDate="2011-12-08T18:19:03.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2551" PostTypeId="2" ParentId="2529" CreationDate="2011-12-09T03:41:35.700" Score="18" Body="&lt;p&gt;There is some research that directly bears upon the issue of estimating covariance in the presence of unequal return histories and regime change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wharton professor Robert Stambaugh (of liquidity premia fame) wrote a paper in '97 called &quot;&lt;a href=&quot;http://www.cib.espol.edu.ec/Digipath/D_Papers/38608.pdf&quot;&gt;Analyzing Investments Whose Histories Differ in Length&lt;/a&gt;&quot;. Prior to the paper, most academics and practitioners would use &quot;truncation&quot; (i.e. restrict to equal history), or maximum-likelihood estimators (similar to the pairwise complete approach you mention). Some would also use regression to impute the missing variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Stambaugh goes on to propose a Bayesian approach popularly known as the &lt;a href=&quot;http://en.wikipedia.org/wiki/Expectation%E2%80%93maximization_algorithm&quot;&gt;Expectations-Maximization algorithm&lt;/a&gt; to impute returns of unequal length. He discusses covariance/correlation estimation in section 2.4.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On a practical note, it turns out there are great packages for performing this missing imputation method in R -- &lt;a href=&quot;http://cran.r-project.org/web/packages/Amelia/vignettes/amelia.pdf&quot;&gt;Amelia II: A Program for Missing Data&lt;/a&gt; (which uses the E-M algorithm). There is also a package &lt;a href=&quot;http://cran.r-project.org/web/packages/monomvn/index.html&quot;&gt;monomvn&lt;/a&gt; which estimates covariance matrices directly when the missings are of unequal length also via E-M. The E-M algorithm is the &quot;textbook&quot; answer for many academics and practitioners when generating a covariance matrix in the presence of missing data with unequal lengths.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in my own experience the E-M algorithm has short-comings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since this is an out-of-consensus view, I'd encourage you to test the algorithm and see if it conforms to your expectations. For example, you can start with a complete data set, artificially truncate histories and missings, fit a covariance matrix using monomvm or impute via Amelia, and compare the securities with missings to the pristine dataset. You should also explore this long vs. shorter periods of history. Side note: Since all covariance matrices are representations of &lt;em&gt;normal&lt;/em&gt; multi-variate distribution perhaps it's naive to expect great results from E-M. You could &lt;a href=&quot;http://demonstrations.wolfram.com/ExpectationMaximizationForGaussianMixtureDistributions/&quot;&gt;use the E-M algorithm to fit a mixture of gaussians&lt;/a&gt; (high-vol, low-vol, normal regime let's say) but then this becomes more of a research exercise rather than a band-aid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are some alternatives:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A simple reliable method is to impute the security returns to the average industry or sector returns (optionally with some gaussian noise to preserve the variance of the system). The rationale is that the sector return is the dominant factor in explaining the bulk of a security's price risk and return. If your missings are random, do not have structure, and the distribution of returns of security's with missings is not dissimilar to the distribution of returns of securities without missings then this merits consideration. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could also fit a cross-sectional factor model and impute the missings via stock's exposures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A more advanced (likely overkill) technique would be to use a machine learning method such as random forests or a clustering algorithm like k-nn to impute missings. (To assess whether these methods are necessary you can look into a body of literature called Influence Analysis and Robust Regression.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you go down the path of imputing missings, you can then estimate an exponentially weighted covariance matrix (use &lt;a href=&quot;http://stat.ethz.ch/R-manual/R-patched/library/stats/html/cov.wt.html&quot;&gt;cov.wt&lt;/a&gt; in R). The EW covariance matrix has a special relationship to GARCH models -- a desirable feature since volatility is auto-correlated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;These methods (as well as Ledoit-Wolf Shrinkage and RMT) out-perform estimation via the sample covariance matrix. The use of a simple exponentially weighted covariance matrix is quite common place. Popular choices of decay factors range from (.94 if you ask JP Morgan Risk Metrics, up to .99). The paper &quot;&lt;a href=&quot;http://www.fatih.edu.tr/~jesr/jesr.horasanli.pdf&quot;&gt;Portfolio Selection by Using Time Varying Covariance Matrices&lt;/a&gt;&quot; will help you explore exponentially weighted covariance matrices so you can better cope with regime change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way to create covariance matrices that cope with regime change is to develop a matrix for each regime and take expectations. Essentially you partition your data based on the euclidian (or &lt;a href=&quot;http://en.wikipedia.org/wiki/Mahalanobis_distance&quot;&gt;Mahalanabois&lt;/a&gt;) distance and build separate covariance matrices for each regime and take a probability weighted average of each. Mark Kritzman has an intuitive approach to this in his article &lt;a href=&quot;http://www.iijournals.com/doi/abs/10.3905/jod.2001.319155&quot;&gt;Risk, Regimes, and Overconfidence&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-12-12T01:42:24.180" LastActivityDate="2011-12-12T01:42:24.180" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2552" PostTypeId="1" CreationDate="2011-12-09T05:05:27.983" Score="6" ViewCount="446" Body="&lt;p&gt;Has there been any studies done on the correlation between etf vs cash (i.e. GLD vs GD) for example and how they should theoretically move together, and what fundamental reasons could cause them to diverge.&lt;/p&gt;&#xA;" OwnerUserId="1726" LastActivityDate="2011-12-10T15:02:33.823" Title="What are some quantitative method behind etf vs cash arbitrage?" Tags="&lt;automated-trading&gt;&lt;high-frequency&gt;&lt;market-data&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2554" PostTypeId="1" CreationDate="2011-12-09T10:04:51.033" Score="12" ViewCount="708" Body="&lt;p&gt;A lot of the tools/libraries out there seem to focus on close to close time series analysis. This is all fine but I typically do not trade close to close, I will use limit or stop orders that may or may not get filled. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for example if I get a buy signal at time t, I would place a buy limit for time t+1 at the level suggested by my model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering if there was an existing library or package out there that I could use for backtesting such a system. Ideally, it could handle signals based off a daily series, but move through using hourly bars so I can test different intraday trade management strategies as well. It would also be good if I could put OCO bracket orders for profit/loss stops. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using R at the moment but can use whatever has what I am after.&lt;/p&gt;&#xA;" OwnerUserId="489" LastEditorUserId="1106" LastEditDate="2011-12-16T13:34:21.850" LastActivityDate="2012-07-26T15:10:37.573" Title="What tools and libraries may be used to model limit/stop systematic trading?" Tags="&lt;backtesting&gt;&lt;programming&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2557" PostTypeId="2" ParentId="2536" CreationDate="2011-12-09T23:17:42.857" Score="2" Body="&lt;p&gt;honestly your question is hard to understand. Are these two questions the same?&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&quot;Does fitting sub-optimal option exercise strategies to market data yield better option values?&quot;&lt;/li&gt;&#xA;&lt;li&gt;&quot;which modeling approach leads to better predictions and better relative value measures?&quot;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I think you want to ask 1 and I think it is similar to  &lt;a href=&quot;https://quant.stackexchange.com/questions/1162/setting-the-r-in-put-call-parity&quot;&gt;Setting the r in put-call parity?&lt;/a&gt;&#xA;The variables C, P, S, and T−t are directly observable in the market place and contract definition. r is unobservable and it will definitely affect a deep ITM put holder's optimal early exercise strategy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Likewise here, I think which model you use depends on your purpose. Both model has its merit and application. &lt;/p&gt;&#xA;" OwnerUserId="1773" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2011-12-09T23:17:42.857" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2558" PostTypeId="2" ParentId="1177" CreationDate="2011-12-10T01:07:55.597" Score="7" Body="&lt;p&gt;This is a hard question because you have to explain i) why does volatility mean revert, AND the opposite effect ii) why does volatility exhibit clustering/persistence? GARCH models can describe this behavior but they do not explain.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We need a model of investor behavior that can explain both phenomenon. I think Rama Cont has a strong answer in his 2005 paper &lt;a href=&quot;http://www.proba.jussieu.fr/pageperso/ramacont/papers/clustering.pdf&quot;&gt;Volatility Clustering in Financial Markets:&#xA;Empirical Facts and Agent–Based Models&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Many market microstructure models – especially those with learning or&#xA;  evolution– converge over large time intervals to an equilibrium where&#xA;  prices and other aggregate quantities cease to fluctuate randomly. By&#xA;  contrast, in the present model, prices fluctuate endlessly and the&#xA;  volatility exhibits mean-reverting behavior. Suppose we are in a&#xA;  period of “low volatility”; the amplitude |rt| of returns is small.&#xA;  &lt;strong&gt;Agents who update their thresholds will therefore update them to small&#xA;  values, become more sensitive to news arrivals, thus generating higher&#xA;  excess demand and thus increasing the amplitude of returns.&#xA;  Conversely, in a period of high volatility, agents will update their&#xA;  threshold values to high values and become less reactive to the&#xA;  incoming signal: this increase in investor inertia will thus decrease&#xA;  the amplitude of returns&lt;/strong&gt;. The mean reversion time in the volatility&#xA;  corresponds here to the time it takes for agents to adjust their&#xA;  thresholds to current market conditions, which is of order τc = 1/q.&#xA;  When the amplitude of the noise is small it can be shown that&#xA;  volatility decays exponentially in time and increases through upward&#xA;  “jumps”. This behavior is actually similar to that of a class of&#xA;  stochastic volatility models, introduced by Barndorff-Nielsen and&#xA;  Shephard and successfully used to describe various econometric&#xA;  properties of returns.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2011-12-10T01:07:55.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2559" PostTypeId="2" ParentId="2552" CreationDate="2011-12-10T15:02:33.823" Score="6" Body="&lt;p&gt;A quick Google search gives a few hints:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://etf.about.com/od/etfinvestingstrategies/a/ETF_Arbitrage.htm&quot;&gt;http://etf.about.com/od/etfinvestingstrategies/a/ETF_Arbitrage.htm&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ftalphaville.ft.com/blog/2011/05/18/572086/how-profitable-is-etf-arbitrage/&quot;&gt;http://ftalphaville.ft.com/blog/2011/05/18/572086/how-profitable-is-etf-arbitrage/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.iijournals.com/doi/abs/10.3905/jii.2010.1.1.107&quot;&gt;http://www.iijournals.com/doi/abs/10.3905/jii.2010.1.1.107&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://seekingalpha.com/article/68064-arbitrage-opportunities-with-oil-etfs&quot;&gt;http://seekingalpha.com/article/68064-arbitrage-opportunities-with-oil-etfs&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Another quick search on &lt;a href=&quot;http://scholar.google.com&quot;&gt;scholar.google.com&lt;/a&gt; gives this &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1709599&quot;&gt;research&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So some work has been done on the topic. However, I'd warn you about the credit risk of the ETF, as countre-parties are various, often unknown and might be really unreliable, and you might end up with a portfolio of junk bonds rather than the underlying your were looking for in case of default.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2011-12-10T15:02:33.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2560" PostTypeId="2" ParentId="1379" CreationDate="2011-12-10T15:15:02.947" Score="5" Body="&lt;p&gt;F# provides you with many data structures for collections, but in functional programming, you try to have &lt;em&gt;immutable&lt;/em&gt; data structures, such as the F# &lt;code&gt;List&lt;/code&gt;. It becomes quite handy if you want to do some parallel computing, for example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can have a look at my &lt;a href=&quot;https://stackoverflow.com/questions/8028405/is-time-series-implementation-using-functional-programming-f-recommended&quot;&gt;post&lt;/a&gt; on &lt;a href=&quot;http://www.stackoverflow.com&quot;&gt;SO&lt;/a&gt; which is probably where you could ask your question in a more generic way such as &quot;What is the best data structure to use in F# if I need quick data access?&quot;&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2011-12-10T23:11:06.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2561" PostTypeId="1" AcceptedAnswerId="2562" CreationDate="2011-12-10T22:07:05.760" Score="8" ViewCount="1813" Body="&lt;p&gt;I have read some papers on quantitative trading strategies and it seems like strategies that focus on mean reversion or statistical arbitrage give signals that are dependent on some quantitative model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when you turn to momentum strategies, people start talking about moving averages to generate signals. Why is that? Isn't there a more quantitative method of detecting momentum than moving averages ? &lt;/p&gt;&#xA;" OwnerUserId="1696" LastActivityDate="2015-05-28T17:09:57.420" Title="Can momentum strategies be quantitative in nature?" Tags="&lt;quant-trading-strategies&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2562" PostTypeId="2" ParentId="2561" CreationDate="2011-12-10T23:09:14.560" Score="6" Body="&lt;p&gt;As jk3000 writes in his comment, moving averages &lt;em&gt;are&lt;/em&gt; quantitative.  Moving averages can be made quite sophisticated, if desired.  Besides simple moving averages, there are exponential moving averages, moving averages on inhomogenous (tick) data, and meta models incorporating multiple moving averages with time-varying weights.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, the canonical academic definition of momentum (&lt;a href=&quot;http://www.e-m-h.org/JeTi93.pdf&quot;&gt;Jegadeesh and Titman (1993)&lt;/a&gt;) looks at top/bottom performers over some time period, often relative to a model such as CAPM or Fama-French.  Momentum can mean different things to different people, but to serious quants, it is more often something along the lines of relative performance than moving averages.  See &lt;a href=&quot;http://momentum.behaviouralfinance.net/&quot;&gt;http://momentum.behaviouralfinance.net/&lt;/a&gt; to get a better idea.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-12-10T23:09:14.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2565" PostTypeId="1" AcceptedAnswerId="2603" CreationDate="2011-12-11T03:25:50.103" Score="14" ViewCount="5099" Body="&lt;p&gt;I am trying to construct a daily time series of prices and returns for some large universe of securities.  However, all I have available are a monthly time series of the prices/returns (as well as other characteristics) of the individual securities, a daily time series of a market-value-weighted index of all securities, and weekly time series of various sub-indices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The constructed time series will ultimately be used to estimate parameters of a more general model, such as the probability of a security's issuer taking some action (e.g. refinancing their debt) as a function of the security's price.  Therefore I feel it is not important to maintain causality.  The issuer presumably knows the true price when taking the action, even though I do not, and I need to construct a best guess as to what the price was given everything I know today.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: it is &lt;strong&gt;not possible&lt;/strong&gt; to obtain higher frequency data at the individual security level, either because the securities themselves do not trade that often, or because (AFAIK) nobody collects the data.  The goal is to interpolate a reasonable-looking set of daily prices and returns based on all available information.  Any advice on how to carry out this estimation would be appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have some of my own ideas, which I may share after a while, but right now I'm still in the exploratory phase and I'm looking for some additional inspiration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just to make it clear what I mean by way of example, suppose I wanted to find the daily prices of all 1500 stocks in the S&amp;amp;P 1500, but all I had were monthly prices for the stocks, weekly prices for the 10 GICS sector indices and for the large cap 500, mid cap 400, and small cap 600, and daily prices for the S&amp;amp;P 1500 as a whole.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The purpose, in that example, would be to fit a model of announcements of share buybacks and secondary offerings based on interpolated valuation metrics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;: One answer suggested applying the Expectation-Maximization algorithm.  As far as I can tell, EM is not applicable to this problem.  Applying EM to price, one gets a sawtooth-pattern where the filled values are on a different plane from the known values.  I can't figure out a way to apply EM to returns, since I'm not missing any monthly returns, and I'm missing all daily/weekly returns for the individual securities.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-12-13T20:15:08.613" LastActivityDate="2013-08-08T20:27:48.383" Title="How to interpolate gaps in a time series using closely related time series?" Tags="&lt;time-series&gt;&lt;statistics&gt;&lt;interpolation&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2566" PostTypeId="2" ParentId="2177" CreationDate="2011-12-11T04:32:41.103" Score="3" Body="&lt;p&gt;You may want to look at &lt;a href=&quot;http://www.stacresearch.com/&quot; rel=&quot;nofollow&quot;&gt;STAC research&lt;/a&gt;, &lt;a href=&quot;http://www.latencystats.com/&quot; rel=&quot;nofollow&quot;&gt;http://www.latencystats.com/&lt;/a&gt; and other sites that you can find by searching for &quot;latency&quot; and &quot;market data&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have no affiliation with those two links, however I am a principal in a company that measures and compares latency from exchanges.&lt;/p&gt;&#xA;" OwnerUserId="375" LastActivityDate="2011-12-11T04:32:41.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2567" PostTypeId="1" AcceptedAnswerId="2572" CreationDate="2011-12-11T07:10:20.253" Score="3" ViewCount="615" Body="&lt;p&gt;I want to create a random (quasi random) process which goes through pre determined points and constraints. E.g. I have a daily price series but want to generate intra-day prices with the same OHLC properties.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also I am exploring the possibility to control of the moments (mean, variance, skew, kurtosis, ...) of the process also.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Main problem here is I have low frequency data (daily) from which I want to construct high frequency data, going though all the lower frequency sampling points.&lt;/p&gt;&#xA;" OwnerUserId="909" LastEditorUserId="467" LastEditDate="2011-12-11T14:34:59.027" LastActivityDate="2013-12-25T16:03:31.167" Title="How to create a Stochastic Process through pre specified points?" Tags="&lt;stochastic-processes&gt;" AnswerCount="3" CommentCount="7" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2571" PostTypeId="2" ParentId="2529" CreationDate="2011-12-11T09:55:03.323" Score="3" Body="&lt;p&gt;How about adapting Ledoit-Wolf shrinkage to average correlation? You calculate the ratio of average correlations in two regimes to get a sense of the magnitude of regime shift. Use this ratio to adjust the correlations of short-lived stock with others. The method is simple and result will definitely make sense to you. &lt;/p&gt;&#xA;" OwnerUserId="1773" LastActivityDate="2011-12-11T09:55:03.323" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2572" PostTypeId="2" ParentId="2567" CreationDate="2011-12-11T14:28:56.213" Score="6" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I have low frequency data (daily) from which I want to construct high frequency data, going though all the lower frequency sampling points.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Bad idea in my opinion. I don't really know why you really want to do this (what's are you going to do with the generated data). If it's for backtesting purposes, it's a &lt;em&gt;really&lt;/em&gt; bad idea as there are so many mechanisms that occur at HF, it wouldn't be realistic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Back to your question on &quot;constrained&quot; Stochastic Process. Mathematically, the question is as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let the $\text{OLHC} = \{o,l,h,c\} $  be the open-low-high-close over a period $\Delta t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You would have to create a process $X$ which represents the increment of a process $Y$ such that $Y_{t+\Delta t}=X_{\Delta t}+Y_t$ with&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_0=0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_{\Delta t}=c-Y_t=Y_{t+1}-Y_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\max_{s \in \left[0;\Delta t\right]}(X_s)=h-Y_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\min_{s \in \left[0;\Delta t\right]}(X_s)=l-Y_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And this is quite complicated to do. I believe you wouldn't be able to use a &quot;straightforward&quot; process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The biggest task would be to make sure that $X$ hits the high and low. To do so, you could try and &quot;split&quot; $X$ in 3 phases represented by 3 processes:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;go and hit the high&lt;/li&gt;&#xA;&lt;li&gt;go and hit the low&lt;/li&gt;&#xA;&lt;li&gt;reach the close.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You could try and play around with these processes (inverting the two first ones to randomize a bit more).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An idea has been provided in answer (that was then deleted) for a model for each of these three processes: a &lt;a href=&quot;http://en.wikipedia.org/wiki/Brownian_bridge&quot; rel=&quot;nofollow&quot;&gt;Brownian Bridge&lt;/a&gt;.You can look at the &lt;em&gt;general case&lt;/em&gt; at the bottom of the article, it suits your needs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But again, I don't think it's a really good idea to do so.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2013-12-23T14:31:53.003" LastActivityDate="2013-12-23T14:31:53.003" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2573" PostTypeId="2" ParentId="2565" CreationDate="2011-12-11T15:16:56.283" Score="1" Body="&lt;p&gt;The basic rule to keep causality during resampling/interpolation of financial data is not to use information from future. &#xA;You need to use stepwise interpolation by &quot;dragging&quot; the last known information along new samples until the next monthly update. &#xA;You must know when exactly these monthly values where sampled/calculated. This guarantees causality, but not  correctness of the data in the gap points, because interpolation does not add any information to the original monthly data.&lt;/p&gt;&#xA;" OwnerUserId="1515" LastActivityDate="2011-12-11T15:16:56.283" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2578" PostTypeId="2" ParentId="2565" CreationDate="2011-12-12T17:33:23.137" Score="4" Body="&lt;p&gt;I think you need to say something about what you want to do with the &quot;filled in&quot; series. If you're interested in statistical properties, the usual technique is maximum likelihood estimation using the EM algorithm. That gives you something like a completion of the missing values, but only in the context of the statistic being extracted -- that is, you're &quot;not allowed&quot; to use the filled-in values for anything else, because they are just determined by the condition that you get the correct maximum likelihood value when you do conventional statistical calcs (e.g., pairwise covariances) on the completed series.&lt;/p&gt;&#xA;" OwnerUserId="1780" LastActivityDate="2011-12-12T17:33:23.137" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2579" PostTypeId="1" CreationDate="2011-12-12T17:48:09.390" Score="31" ViewCount="1817" Body="&lt;p&gt;It is known (see for example Joshi-Chan &amp;quot;Fast and Accureate Long Stepping Simulation of the Heston SV Model&amp;quot; available at SSRN) that for a CIR process defined as :&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$dY_t= \kappa(\theta -Y_t)dt+ \omega \sqrt{Y_t}dW_t$$&lt;/span&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$Y_0=Y$&lt;/span&gt;  together with a correct set of constraints on parameters' value.&lt;/p&gt;&#xA;&lt;p&gt;Then the law of &lt;span class=&quot;math-container&quot;&gt;$\int_0^T Y_t dt$&lt;/span&gt; conditionaly on &lt;span class=&quot;math-container&quot;&gt;$Y_0,Y_T$&lt;/span&gt; can be seen as the sum of three (rather complicated) independent random variables (see proposition 4 eq 2.10 in Joshi Chan article)&lt;/p&gt;&#xA;&lt;p&gt;NB :&#xA;The original result is coming from  Glassermann and Kim &amp;quot;Gamma Expansion of the Heston Stochastic Volatility Model&amp;quot; available at SSRN, but I'm more used to Joshi Chan's expression.&lt;/p&gt;&#xA;&lt;p&gt;So here is my question :&lt;/p&gt;&#xA;&lt;p&gt;Does the integrated CIR process itself by any chance has such a representation in the form of the sum of independent random variables ?&lt;/p&gt;&#xA;&lt;p&gt;PS:&#xA;The Laplace transform has a known closed-form expression but I couldn't infer directly from this such a representation.&lt;/p&gt;&#xA;&lt;p&gt;Edit : As Tal has opened a bounty on this here is the Laplace transform of the integrated CIR process :&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\mathcal{L}\left\{\int_0^t Y_s ds\right\}(\lambda)=\mathbb{E}\left[e^{-\lambda\int_0^t Y_s ds}\right]=e^{-A_\lambda(t)-Y_0.G_\lambda(t)}$$&lt;/span&gt;&#xA;with &lt;span class=&quot;math-container&quot;&gt;$A_\lambda(t)=-\frac{2\kappa.\theta }{\omega^2}. \mathrm{Ln}\left[\frac{2\gamma.e^{(\gamma+\kappa).t/2}}{\gamma.(e^{t.\gamma}+1)+\kappa.(e^{t.\gamma}-1)}\right]$&lt;/span&gt;&#xA;and&#xA;&lt;span class=&quot;math-container&quot;&gt;$G_\lambda(t)=\frac{2.\lambda.(e^{t.\gamma}-1)}{\gamma.(e^{t.\gamma}+1)+\kappa.(e^{t.\gamma}-1)} $&lt;/span&gt;&#xA;where &lt;span class=&quot;math-container&quot;&gt;$\gamma=\sqrt{\kappa^2+\omega^2.\lambda}$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;This is coming from Chesnay, Jeanblanc-Picqué, Yor &amp;quot;Mathematical Methods for Financial Markets&amp;quot; Proposition 6.3.4.1&lt;/p&gt;&#xA;&lt;p&gt;Best regards&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="92" LastEditDate="2020-07-31T08:56:51.900" LastActivityDate="2021-03-11T08:30:42.330" Title="Law of an integrated CIR Process as sum of Independent Random Variables" Tags="&lt;stochastic-calculus&gt;&lt;stochastic-volatility&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="12" ContentLicense="CC BY-SA 4.0" />
  <row Id="2580" PostTypeId="2" ParentId="2529" CreationDate="2011-12-12T20:01:22.393" Score="18" Body="&lt;p&gt;Quant Guy's list is really impressive! However, I am not sure they will readily solve your specific problem? I think there is one &lt;strong&gt;missing piece&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Please note that imputing missing data is a very broad topic. There are many recipes to impute missings but that's for their specific 'assumptions' and purposes. They do not necessarily intend to well address your specific problem: the regime change.&lt;/p&gt;&#xA;&lt;p&gt;To best address your specific problem, &lt;strong&gt;you have to quantitatively define the market regime&lt;/strong&gt; as a part of your adjusting formula. Otherwise, it wouldn't logically make sense that your model is aware of and able to react to it properly.&lt;/p&gt;&#xA;&lt;p&gt;In Stambaugh's '97 research (which I think is the most relevant reference Qaunt Guy listed), Stambaugh's formula actually used B = V21*V11^(-1), i.e. Beta, to make adjustment. I have to say that not soon after, the history has taught us how vulnerable the beta is for several times, especially in a rapidly changing market environment (but I guess the application of Beta was still novel and not that fragile in the epoch of '90s?).&lt;/p&gt;&#xA;&lt;p&gt;Now let's define market regime quantitatively. &lt;strong&gt;In common sense, average correlation is a pretty neat regime indicator&lt;/strong&gt;. Simple and intuitive, easy to employ in a proprietary model (and I feel that's why Ledoit-Wolf's model is that popular :)). But yes, as Branson pointed out in Ian's answer, there is possibility that we will get very undesirable results.&lt;/p&gt;&#xA;&lt;p&gt;One of the potential solutions is to &lt;strong&gt;map the intuitive indicator to proper space/dimension for operations, and then transform it back&lt;/strong&gt;. This is a very useful technique that is commonly employed in machine learning. Correlation lives in a very constrained space [-1,1] and this greatly restricts what we can do about it. (Please don't think covariance will be less constrained. When you put them together in a matrix, trust me, it will be as constrained as correlation. Correlation is actually easier to work with to see possible problems)&lt;/p&gt;&#xA;&lt;p&gt;Now, how about mapping correlation to an equally intuitive (at least to me) but less constrained space,&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Signal-to-Noise Ratio (SNR) = Correlation^2 / (1 - Correlation^2)&lt;/p&gt;&#xA;&lt;p&gt;** Correlation = sqrt(snr/(1+snr))&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;and refine my regime indicator as &lt;strong&gt;the median of SNR&lt;/strong&gt;. (*I rarely use average in financial applications)&lt;/p&gt;&#xA;&lt;p&gt;I don't know how people feel about SNR, but I feel very comfortable with a background in EE. In communication system, SNR is exactly the regime (environment) indicator that characterizes a channel. I feel a significant analogy here.&lt;/p&gt;&#xA;&lt;p&gt;The remaining work will be straightforward. I will use the ratio of my regime indicators as a multiplier to adjust young asset's pairwise SNRs against other assets. Then map the final adjustment back to correlations.&lt;/p&gt;&#xA;&lt;p&gt;You will at least gain the following benefits using this approach:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Correlations won't blow up as in your first attempt&lt;/li&gt;&#xA;&lt;li&gt;Original ranking of pairiwise correlation (with short-lived assets) is preserved&lt;/li&gt;&#xA;&lt;li&gt;Much easier to implement. No need to impute missing data.&lt;/li&gt;&#xA;&lt;li&gt;Intuitive (to me), east to understand what's going on in your code.&lt;/li&gt;&#xA;&lt;li&gt;This approach is &lt;strong&gt;compatible with many other techniques&lt;/strong&gt; in Quant Guy's references such as Ledoit-Wolf Shrinkage, RMT, and weighted representative covariance matrices.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Last but not least, this is a collaboratory idea with one of my most brilliant colleagues and close friend, Manish Agarwal.&lt;/p&gt;&#xA;" OwnerUserId="1089" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2011-12-12T20:09:40.657" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2581" PostTypeId="2" ParentId="2565" CreationDate="2011-12-12T21:25:56.593" Score="7" Body="&lt;p&gt;This answer only deals with obtaining higher frequency data from low frequency data. The second method is taken from the draft of a master thesis of a friend of mine, i.e. most of this is taken from an unpublished source.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.116.711&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow&quot;&gt;Jones (1998)&lt;/a&gt; propose an algorithm to this using something similar to Gibbs sampler to get the most likely parameter values for a diffusion given the data, in short:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ol&gt;&#xA;  &lt;li&gt;Choose some initial values for the parameters $\phi$ and the unobserved data $X^u$.&lt;/li&gt;&#xA;  &lt;li&gt;Redraw the unobserved paths, or “bridges”, in between the observed data and fill in any latent variables by cycling, point by point,&#xA;  through the elements of $X^u$.&lt;/li&gt;&#xA;  &lt;li&gt;Draw new parameters conditional on the augmented data set.&lt;/li&gt;&#xA;  &lt;li&gt;Go back to (2) or terminate the Markov chain if convergence has been determined.&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This model can then be used to obtain observations at any frequency using an Euler scheme. See Jones (1998) for further details. My friend modifies this method as follows:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ol&gt;&#xA;  &lt;li&gt;Choose initial parameters&lt;/li&gt;&#xA;  &lt;li&gt;Generate data conditional on observations and current parameters by cyclic MH&lt;/li&gt;&#xA;  &lt;li&gt;Optimize the likelihood for the chain generated in step (2)&lt;/li&gt;&#xA;  &lt;li&gt;Save optimal parameters of step (3), use them as input for step (2) and repeat&lt;/li&gt;&#xA;  &lt;li&gt;After a burn-in period average the saved parameters to obtain the final estimates&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My friend argues:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The original algorithm of Jones employs a Gibbs sampler instead of EM. Rather than&#xA;  optimizing in step (3), Jones draws new parameters out of some prior distribution and&#xA;  accepts or rejects these draws conditional on the chain generated in step (2). It is however very unlikely, to accept a certain draw, especially for higher dimensional parameter spaces. Furthermore computationally it is more efficient to optimize than to draw hundreds of chains for a single change of parameters. When using Gibbs sampling it is also impossible to impose restrictions on a combination of variables, such as forcing the distribution to be unimodal. A disadvantage is that we loose the favorable properties of Bayesian inference.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Unfortunately I can't provide you a full answer. I'm not sure if it has been done yet (publicly).&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="1106" LastEditDate="2011-12-13T20:40:47.560" LastActivityDate="2011-12-13T20:40:47.560" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2584" PostTypeId="2" ParentId="1392" CreationDate="2011-12-13T16:37:34.820" Score="4" Body="&lt;p&gt;mongodb seems to be a good opensource solution to store historical tick-by-tick. I am using it  here and it seems to be very simple to use. &lt;/p&gt;&#xA;" OwnerUserId="1360" LastActivityDate="2011-12-13T16:37:34.820" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2585" PostTypeId="2" ParentId="1807" CreationDate="2011-12-13T17:20:42.190" Score="1" Body="&lt;p&gt;Please be aware when you back out implied interest rate for stocks with uncertain dividend payout. &lt;/p&gt;&#xA;" OwnerUserId="1726" LastActivityDate="2011-12-13T17:20:42.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2586" PostTypeId="2" ParentId="1392" CreationDate="2011-12-13T18:48:34.740" Score="16" Body="&lt;p&gt;The reason that &quot;traditional&quot; NoSql databases will not get much up take in finance is that they are designed to solve a different problem. Most NoSql databases from the web world are designed with two central design parameters. First key lookups should be very fast. Second is that operations should be atomic at the row level and should not span records. This allows the  database to be sharded very effectively since no operation should span multiple machines and in turn this allows them to build scale out architectures. These databases are built for very write heavy workloads and to be able to have fast key lookups to render webpages. While it is possible to use them to store tick data its not really what they are good at.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Financial data tends to be small relative to large web companies data. So scale out in finance is less important. Also financial data tends to partition well (at the day, symbol, or almost any other key) so replica placement tends to be more explicit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Map reduce is the typical way to build analytical applications for these data stores either using hadoop (Cassandra) or internal map reduce (MongoDB has a java script MR API). This is typically not the ideal paradigm for analyzing time series data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Traditional column oriented stores with integrated time series analytics tools or custom built platforms will continue to be the preferred way to store and process time series data. I don't think that there will (or should) be much convergence between the databases built for running very high scale websites and the databases built to store and analyze time series information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All that being said we use mongodb extensively for metadata storage and as a sort of very large cache. But we don't use it to store or analyze financial data.&lt;/p&gt;&#xA;" OwnerUserId="373" LastActivityDate="2011-12-13T18:48:34.740" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="2587" PostTypeId="1" CreationDate="2011-12-13T19:21:23.460" Score="10" ViewCount="1072" Body="&lt;p&gt;I am looking for some info on how to estimate liquidity (intraday). I have read some researches and created intraday measurements of liquidity on time yet not on price. What I mean by this is that I am not looking for a liquidity profile based on time but a &lt;strong&gt;profile based on price&lt;/strong&gt;, i.e. how much liquidity there is at each &lt;strong&gt;price level&lt;/strong&gt;. For this I am assuming I need to look into adaptive algos that calculate real-time data.&#xA;However, I was looking at some Implementation Shortfall algos and couldn't find anything except that old article from 1988.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if I was an VWAP algo I would know the TIMES to send the orders (let's say there is an U-shaped historical volume profile), but I, as an extremely sophisticated investor (:P) would like to have an algo that &quot;looks&quot; at each level and estimates if it can transact orders here or not. I.e. looking at depth, volatility etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short, I am looking for a study or something to illuminate me on the basics of liquidity seeking algorithms to understand some more as I can't find anything!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for taking time.&lt;/p&gt;&#xA;" OwnerUserId="1784" LastEditorUserId="2299" LastEditDate="2013-10-27T09:02:18.743" LastActivityDate="2013-10-27T09:02:18.743" Title="Liquidity estimators: VWAP and IS" Tags="&lt;liquidity&gt;&lt;volume&gt;&lt;high-frequency-estimators&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2588" PostTypeId="1" AcceptedAnswerId="2591" CreationDate="2011-12-14T01:03:39.707" Score="10" ViewCount="20238" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;When you are &quot;long gamma&quot;, your position will become &quot;longer&quot; as the&#xA;  price of the underlying asset increases and &quot;shorter&quot; as the&#xA;  underlying price decreases.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;source: &lt;a href=&quot;http://www.optiontradingtips.com/greeks/gamma.html&quot;&gt;http://www.optiontradingtips.com/greeks/gamma.html&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My intuition tells me that if you're long gamma, all that means is that if gamma increases, so does the value of your portfolio.  Correct me if I'm wrong, but this seems to conflict with the quoted definition above (it is possible for gamma to decrease while the value of your portfolio goes up).  Am I totally wrong?  Does being long gamma simply mean your portfolio has a positive gamma as the quoted definition suggests?&lt;/p&gt;&#xA;" OwnerUserId="551" LastActivityDate="2015-06-14T20:40:26.267" Title="What does it mean to be long gamma?" Tags="&lt;greeks&gt;&lt;gamma&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="2589" PostTypeId="1" AcceptedAnswerId="2605" CreationDate="2011-12-14T01:50:04.200" Score="32" ViewCount="43770" Body="&lt;p&gt;Sorry for what must be a beginner question, but when I went to write code I realized I didn't understand &lt;em&gt;exactly&lt;/em&gt; how historical volatility, or statistical volatility, is defined. &lt;a href=&quot;http://en.wikipedia.org/wiki/Volatility_%28finance%29&quot; rel=&quot;noreferrer&quot;&gt;Wikipedia&lt;/a&gt; tells me &quot;volatility is the standard deviation of the instrument's logarithmic returns&quot;, and &lt;a href=&quot;http://en.wikipedia.org/wiki/Rate_of_return#Logarithmic_or_continuously_compounded_return&quot; rel=&quot;noreferrer&quot;&gt;logarithmic return is defined&lt;/a&gt; as $\ln\left(\frac{V_f}{V_i}\right)$, where $V_f$ is closing price and $V_i$ is opening price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I want to calculate the volatility of a minute bar, from the raw ticks, do I just use the first and last tick in that minute? If I use first and last ticks in the minute (i.e. bar open/close), I will have a single logarithmic return, so s.d. of that one value will be 0. In an answer to &lt;a href=&quot;https://quant.stackexchange.com/q/2539/1106&quot;&gt;this question&lt;/a&gt;, the intraday volatility chart is described as U-shaped. &lt;em&gt;Exactly&lt;/em&gt; what sums do I need to do to generate that intraday volatility chart from the day's ticks?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In R terms, is logarithmic return:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#x is xts object containing ticks&#xA;r = na.omit( lag(x)/x )&#xA;lnr = log(r)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Background: I have a stream of ticks, and as I turn them into minute (and higher period) bars (using R's xts module) I also calculate the mean and s.d.  Is the standard financial measure of volatility different from standard deviation? If not, can one be derived from the other?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the above definition of volatility is correct, my answer (based on eyeballing the plots, and on running cor) seems to be that they are really quite different; I'm still chewing over how that gels with the answers &lt;a href=&quot;https://quant.stackexchange.com/q/226&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1587" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-03-17T13:58:44.900" Title="How to calculate historical intraday volatility?" Tags="&lt;volatility&gt;&lt;high-frequency&gt;&lt;market-microstructure&gt;&lt;tick-data&gt;&lt;high-frequency-estimators&gt;" AnswerCount="7" CommentCount="3" FavoriteCount="35" ContentLicense="CC BY-SA 3.0" />
  <row Id="2590" PostTypeId="2" ParentId="2589" CreationDate="2011-12-14T02:37:31.437" Score="6" Body="&lt;p&gt;Statistical volatility is the standard deviation of a window of log returns. For example, 30-day statistical volatility is the standard deviation of 30, one-day log returns. The log return comes from the assumption that log stock returns are normally distributed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Statistical volatility differs from implied volatility which is the volatility input to some options pricing model (read: Black-Scholes) which sets the model price equal to the market, or observed price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Statistical and implied volatility are used for different purposes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Variance of course is the standard deviation of a random variable squared. Variance is has useful properties in the normal distribution (e.g. variance is additive while standard deviation is not) which is used extensively in modeling the dynamics of equity prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In measuring central tendencies of returns in the financial context, variance doesn't really make sense because variance is not in standardized units like standard deviation. Unless you're dealing with variance swaps or stochastic volatility models, you'll probably be dealing exclusively in standard deviation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So to answer your question in short, calculate lag-number of log returns, take the standard deviation and that's the lag-period statistical volatility of your returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With all that said, this is a fairly basic question for this group and I'm not sure it will last...&lt;/p&gt;&#xA;" OwnerUserId="1112" LastEditorUserId="1112" LastEditDate="2011-12-15T13:09:51.680" LastActivityDate="2011-12-15T13:09:51.680" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2591" PostTypeId="2" ParentId="2588" CreationDate="2011-12-14T14:54:28.530" Score="21" Body="&lt;p&gt;Gamma is the second partial derivative of the change in the price of the option wrt to the change in the underlying. Said another way, it is the change in delta. If you write down the Black-Scholes pricing formula, you's see the gamma term:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$...\frac{1}{2}\frac{\partial^2C}{\partial S^2}(\Delta S)^2...$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice that the $\Delta S$ (change in stock price) term is squared, meaning that the gamma term is positive when long regardless if $\Delta S$ is positive or negative. (This comes from the derivation of BS using Ito's Lemma.) What this means is that if you are long gamma (long a call or put option) then the P/L attributed to your position from gamma will increase regardless of the direction the stock moves.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gamma (convexity) is a gift from God in this regard when the payoff is nonlinear, but remember there is no free lunch. The theta of a long option position is negative and will erode your P/L at the same time - faster than you will accumulate P/L from gamma if you are not careful.&lt;/p&gt;&#xA;" OwnerUserId="1112" LastEditorUserId="6901" LastEditDate="2015-06-14T20:40:26.267" LastActivityDate="2015-06-14T20:40:26.267" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2592" PostTypeId="5" CreationDate="2011-12-14T15:24:25.383" Score="0" Body="" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-12-14T15:24:25.383" LastActivityDate="2011-12-14T15:24:25.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2593" PostTypeId="4" CreationDate="2011-12-14T15:24:25.383" Score="0" Body="The calculated approximation of a result which is usable even if input data may be incomplete or uncertain." OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-12-14T15:24:25.383" LastActivityDate="2011-12-14T15:24:25.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2594" PostTypeId="5" CreationDate="2011-12-14T15:32:25.310" Score="0" Body="" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-12-14T15:32:25.310" LastActivityDate="2011-12-14T15:32:25.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2595" PostTypeId="4" CreationDate="2011-12-14T15:32:25.310" Score="0" Body="Shares of stock traded in a stock market.  Equities represent the residual claim or interest of the most junior class of investors in assets, after all liabilities are paid." OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-12-14T15:32:25.310" LastActivityDate="2011-12-14T15:32:25.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2596" PostTypeId="5" CreationDate="2011-12-14T20:00:50.473" Score="0" Body="" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-12-14T20:00:50.473" LastActivityDate="2011-12-14T20:00:50.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2597" PostTypeId="4" CreationDate="2011-12-14T20:00:50.473" Score="0" Body="The foreign exchange market (forex, FX, or currency market) is a global, worldwide-decentralized financial market for trading currencies. Commonly traded instruments include spot, forward, swaps, futures, and options. The FX market is the most liquid financial market in the world. There is no unified or centrally cleared market." OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-12-14T20:00:50.473" LastActivityDate="2011-12-14T20:00:50.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2598" PostTypeId="5" CreationDate="2011-12-14T20:04:59.123" Score="0" Body="" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-12-14T20:04:59.123" LastActivityDate="2011-12-14T20:04:59.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2599" PostTypeId="4" CreationDate="2011-12-14T20:04:59.123" Score="0" Body="The professional management of an investment portfolio of various securities (shares, bonds and other securities) in order to meet specified investment goals.  The process includes the specification of investment objectives and constraints, choice of asset mix, formulation of portfolio strategy, selection of securities, execution, revision, and evaluation." OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-12-14T20:04:59.123" LastActivityDate="2011-12-14T20:04:59.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2600" PostTypeId="5" CreationDate="2011-12-14T20:09:09.523" Score="0" Body="" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-12-14T20:09:09.523" LastActivityDate="2011-12-14T20:09:09.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2601" PostTypeId="4" CreationDate="2011-12-14T20:09:09.523" Score="0" Body="Securities which obligate the borrower/issuer to make payments on a fixed schedule. Fixed income securities include sovereign, corporate and municipal bonds, corporate loans, and securitized lending (e.g., ABS). &quot;Fixed&quot; refers only to the schedule of obligatory payments, not the amount, and may include inflation linked bonds, variable-interest rate notes, and the like." OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-12-14T20:09:09.523" LastActivityDate="2011-12-14T20:09:09.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2602" PostTypeId="1" CreationDate="2011-12-14T20:09:46.277" Score="12" ViewCount="1279" Body="&lt;p&gt;I've recently begun working as a quant for a large bank, and one of my first tasks will be to improve the model determining the risk exposure of their insurance portfolio. The portfolio is fairly diverse, and contains a number of types of insurance policies; life, accident, property, terrorism, auto, mortgage, and a number of others. The model I'm working with is used to estimate economic capital (EC) for the portfolio. Currently, the model is simply the worst-case scenario, which is grossly overestimating the EC required. I'm supposed to improve the model to (more) accurately predict what the exposure risk actually is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm fairly new to the financial world (my background is modeling biological systems), so I'm curious &lt;strong&gt;(1) where I should search for published data on modeling insurance risk&lt;/strong&gt;, and &lt;strong&gt;(2) whether anyone here is familiar with any specific approaches with which I should be familiar&lt;/strong&gt;. I've found the &lt;a href=&quot;http://fic.wharton.upenn.edu/fic/papers.html&quot;&gt;Wharton financial institution&lt;/a&gt;, and I found a &lt;a href=&quot;http://http://fic.wharton.upenn.edu/fic/papers/97/9744.pdf&quot;&gt;paper&lt;/a&gt; which seems to be a good starting point, but I'm looking for other resources.&lt;/p&gt;&#xA;" OwnerUserId="1604" LastEditorUserId="467" LastEditDate="2011-12-14T20:37:00.300" LastActivityDate="2011-12-22T14:39:33.620" Title="Models for measuring insurance risk exposure" Tags="&lt;risk&gt;&lt;risk-models&gt;&lt;insurance&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2603" PostTypeId="2" ParentId="2565" CreationDate="2011-12-15T03:17:15.983" Score="3" Body="&lt;p&gt;You must apply the E-M algorithm to an invariant (time-homogenous i.i.d. variable) such as log-returns -- not prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The key to the E-M is is the simplifying assumption that the invariant (namely the distribution of returns) as well as the distribution of missings are i.i.d. Prices do not obey this property. The trick of assuming an i.i.d. invariant and then proceeding to impute originates with Little and Rubin (1987).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, clearly the distribution of missings is not random however. The literature refers to this case as &quot;Not Missing at Random&quot;. You can do some tests or rely on theory to determine whether assuming the distributions are &quot;Missing at Random&quot; or &quot;Missing Completely at Random&quot; (MCAR) is valid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The bibliography of the paper &lt;a href=&quot;http://www.csos.jhu.edu/contact/staff/jwayman_pub/wayman_multimp_aera2003.pdf&quot; rel=&quot;nofollow&quot;&gt;Multiple Imputation for Missing Data&lt;/a&gt; (2003) cites the key papers in this area.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I read your update and noticed that you have only monthly returns not daily/weekly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's one approach where you can still make the E-M method work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the monthly level, you have the security returns alongside the returns for the various indices and sub-indices. Measure the monthly covariance of the log returns and mean monthly log-returns of the various assets. Now project the monthly covariance to a daily level (simply divide both parameters by # of trading days in a month). You have daily returns for the S&amp;amp;P 1500. Now fill in the missing entries by replacing the missing values with their expected value conditional on the observations of daily prices for the S&amp;amp;P 1500 (using the E-M algorithm). The final step is to convert the log-returns back to arithmetic-returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that you are assuming that the correlation structure is stable over the estimation period. Your output would consist of normally-distributed well-behaved returns. These are the usual defects of the E-M approach.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-12-15T03:52:12.710" LastActivityDate="2011-12-15T03:52:12.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2604" PostTypeId="1" CreationDate="2011-12-15T14:12:43.600" Score="4" ViewCount="803" Body="&lt;p&gt;Im a software developer (freelance) working in investment banking, and I'm looking to improve my CV by gaining a better understanding of the financial quant role and the software used by quants to create and test models.&#xA;Ideally I'd like to write a high-performance desktop application in order to understand this area better.&#xA;My initial thoughts were to create an application that would be capable of consuming a variety of data feeds. The app would also include an F# code entry panel to allow the user to describe their model in a functional language. Then when the model is 'run' the output data stream is visualised as a real-time graphic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My background is writing low-latency apps for front office, so I should be able to create something useful&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone offer me advice about my project ? Is it a good idea or have I missed the point somehow ? would anyone like to help me (for a free copy of the resultant application) ? I would do it in my spare time (as Im current in a contract).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Im just trying to get into this space, and writing software is the best way for me to understand niche areas of this business.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in anticipation&lt;/p&gt;&#xA;" OwnerUserId="1786" LastEditorUserId="35" LastEditDate="2012-08-05T17:46:48.370" LastActivityDate="2012-08-05T17:46:48.370" Title="Help With Quant Modelling Software" Tags="&lt;modeling&gt;&lt;risk-models&gt;&lt;software&gt;&lt;models&gt;" AnswerCount="0" CommentCount="6" FavoriteCount="3" ClosedDate="2015-10-16T10:28:57.617" ContentLicense="CC BY-SA 3.0" />
  <row Id="2605" PostTypeId="2" ParentId="2589" CreationDate="2011-12-15T19:35:48.987" Score="14" Body="&lt;p&gt;The expression you have is fine. But more generally, for the intraday volatility, I don't think there &quot;the correct definition&quot;. More like, whatever works in the given context. I found the following notes by Almgren pretty useful: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://cims.nyu.edu/~almgren/timeseries/notes7.pdf&quot;&gt;http://cims.nyu.edu/~almgren/timeseries/notes7.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2011-12-15T19:35:48.987" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2606" PostTypeId="2" ParentId="2589" CreationDate="2011-12-16T02:59:04.923" Score="5" Body="&lt;p&gt;Your code for volatility seems correct, if you want minute volatility, but is that really what you want?  See &lt;a href=&quot;https://quant.stackexchange.com/q/2539/1106&quot;&gt;this recent question&lt;/a&gt; on annualizing volatility from intraday data.  Also, using first and last tick is what is generally done, but over very short time intervals such as a minute, you will have &lt;a href=&quot;https://quant.stackexchange.com/q/2360/1106&quot;&gt;microstructure issues&lt;/a&gt;. &lt;a href=&quot;https://quant.stackexchange.com/a/2174/1531&quot;&gt;Another question here&lt;/a&gt; deals with the state of the art in volatility estimation and forecasting. It doesn't really make sense to take SD of price. Vol is always something along the lines of SD of returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding your comment that there is only a single open/close observation for a given interval (e.g., bar), you must plot an entire days worth of minute open/close squared returns as a function of time to see the U-shape. The volatility is the mean of squared returns. Historical volatility is defined by two parameters, the interval over which you take returns and the lookback period over which you average those squared returns. In your case, you may also sum rather than average all the squared returns for one day to obtain the &quot;daily volatility measured over minute intervals.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note I have assumed that returns have a mean of zero in the above. This is a very reasonable assumption for returns over such a short horizon.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2011-12-16T09:26:49.633" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2607" PostTypeId="5" CreationDate="2011-12-16T03:06:00.450" Score="0" Body="" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-12-16T03:06:00.450" LastActivityDate="2011-12-16T03:06:00.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2608" PostTypeId="4" CreationDate="2011-12-16T03:06:00.450" Score="0" Body="For questions dealing with market data sampled at high frequencies, such as tick data and intraday data." OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-12-16T03:06:00.450" LastActivityDate="2011-12-16T03:06:00.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2609" PostTypeId="5" CreationDate="2011-12-16T03:21:28.303" Score="0" Body="" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-12-16T03:21:28.303" LastActivityDate="2011-12-16T03:21:28.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2610" PostTypeId="4" CreationDate="2011-12-16T03:21:28.303" Score="0" Body="Quantitative trading strategies use quantitative signals and a set of predefined systematic rules to make trading decisions.  Strategies operate within parameters based on historical analysis (backtesting) and real world market studies (forward testing). Strategies may be executed manually (by a human trader) or automatically (by a computer)." OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-12-16T03:21:28.303" LastActivityDate="2011-12-16T03:21:28.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2613" PostTypeId="2" ParentId="603" CreationDate="2011-12-17T20:49:04.720" Score="1" Body="&lt;p&gt;GARCH models were developed by Robert Engle precisely to deal with the problem of auto-correlated residuals (which occurs when you have volatility clustering for example) in time-series regression. To ask &quot;Why are GARCH models used to forecast volatility if residuals are often correlated?&quot; misses this point. &lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-04-06T01:56:17.123" LastActivityDate="2012-04-06T01:56:17.123" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2614" PostTypeId="1" AcceptedAnswerId="2625" CreationDate="2011-12-18T04:08:18.823" Score="10" ViewCount="2552" Body="&lt;p&gt;Discrete time series regression models, like ARIMA, are usually built around the assumption that we only have 1 available price for each period t, which I will call the Close.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In reality asset time series (bid, ask) are continuos processes and we might have more data than just the Close for each interval. Let's say we have, for each period, an Open, High, Low and Close price. t1(Low) will therefore be the lowest asset price during t1. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let's also assume we want to build a &lt;em&gt;mean reversion model&lt;/em&gt;. We have reasons to believe that some of our predictors have significant negative correlation to the next period price, although we can't be confident that mean reversion will materialize precisely at t1(Close). If we want to make R-squared more meaningful, does it make sense to use the next period Close as the DV? Shouldn't we use the Low/High? That is, if the asset price at interval t0 as travelled from an Open of 10 to a Close of 20, we will want to regress t0 IVs against t1(Low), not t1(Close).&lt;/p&gt;&#xA;" OwnerUserId="1791" LastEditorUserId="1791" LastEditDate="2011-12-19T16:55:25.607" LastActivityDate="2011-12-19T17:25:02.877" Title="Time series price prediction and linear regression: using high/low rather than last quotes price" Tags="&lt;time-series&gt;&lt;multivariate&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2615" PostTypeId="2" ParentId="1339" CreationDate="2011-12-18T08:10:06.490" Score="3" Body="&lt;p&gt;There are also the NIST tests used to examine the random number generators used in cryptographic systems. &lt;a href=&quot;http://csrc.nist.gov/groups/ST/toolkit/rng/index.html&quot; rel=&quot;nofollow&quot;&gt;http://csrc.nist.gov/groups/ST/toolkit/rng/index.html&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I played around with it a little bit, here is the first test, the monobit test.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(stats)&#xA;library(quantmod)&#xA;&#xA;code_input &amp;lt;- function(sym, fn=Cl) {&#xA;    return(na.omit(as.vector(ifelse(ROC(fn(sym)) &amp;gt;= 0, 1, -1))))&#xA;}&#xA;&#xA;#from help(stats)&#xA;erfc &amp;lt;- function(x) 2 * pnorm(x * sqrt(2), lower = FALSE)&#xA;&#xA;&#xA;monobit &amp;lt;- function(v) { &#xA;    sobs &amp;lt;- abs(sum(v))/sqrt(length(v)) ; &#xA;    return(erfc(sobs/sqrt(2)))&#xA;}&#xA;&#xA;run_test_block &amp;lt;- function(input, n=100) {&#xA;    nrand &amp;lt;- 0&#xA;    nnonrand &amp;lt;- 0&#xA;    cnt &amp;lt;- 0&#xA;    for (i in seq(1, length(input), n)) {&#xA;        if ((i + n) &amp;lt; length(input)) {&#xA;            cnt &amp;lt;- cnt + 1&#xA;            pval &amp;lt;- monobit(input[i:(i+n)])&#xA;            if (pval &amp;lt; 0.01) {&#xA;                nnonrand &amp;lt;- nnonrand + 1&#xA;            } else {&#xA;                nrand &amp;lt;- nrand + 1          &#xA;            }&#xA;        }&#xA;    }&#xA;    sprintf(&quot;%d tests %d random, %d nonrandom&quot;, cnt, nrand, nnonrand)&#xA;}&#xA;&#xA;run_test &amp;lt;- function(input, n=100) {&#xA;&#xA;    nrand &amp;lt;- 0&#xA;    nnonrand &amp;lt;- 0&#xA;    cnt &amp;lt;- 0&#xA;    for (i in 1:(length(input) - n)) {&#xA;        cnt &amp;lt;- cnt + 1&#xA;        pval &amp;lt;- monobit(input[i:(i+n)])&#xA;        if (pval &amp;lt; 0.01) {&#xA;            nnonrand &amp;lt;- nnonrand + 1&#xA;        } else {&#xA;            nrand &amp;lt;- nrand + 1          &#xA;        }&#xA;    }&#xA;&#xA;    sprintf(&quot;%d tests %d random, %d nonrandom&quot;, cnt, nrand, nnonrand)&#xA;&#xA;}&#xA;&#xA;getSymbols(&quot;^GSPC&quot;, from=&quot;1970-01-01&quot;)&#xA;run_test(code_input(GSPC))&#xA;#[1] &quot;10491 tests 10143 random, 348 nonrandom&quot;&#xA;run_test_block(code_input(GSPC))&#xA;#[1] &quot;105 tests 101 random, 4 nonrandom&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Make of that what you will. The NIST paper recommended that only the cases determined to be random by the monobit test be subject to the additional tests.&lt;/p&gt;&#xA;" OwnerUserId="489" LastActivityDate="2011-12-18T08:10:06.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2616" PostTypeId="1" AcceptedAnswerId="2624" CreationDate="2011-12-18T13:39:36.193" Score="11" ViewCount="1573" Body="&lt;p&gt;I was looking again at &lt;a href=&quot;https://quant.stackexchange.com/questions/2565/how-to-interpolate-gaps-in-a-time-series-using-closely-related-time-series&quot;&gt;this question&lt;/a&gt; which basically haunts every quant I believe, and I was thinking about the effect of these gaps when computing volatility of the series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's define the problem more specifically for clarity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say you're working on a simple mean variance optimization for asset allocation. You have different asset classes (Equities, Bonds, Hedge-Funds, ...) perhaps even separated by region (Equities &quot;=&quot; {&quot;Equities EU&quot;,&quot;Equities US&quot;, ... ) and you usually do this optimization using indices prices (e.g. S&amp;amp;P500 for Equities US).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming we use daily data for the optimization, as the different indices do not trade on the same dates, if you put the series altogether in a set you will have &quot;holes&quot; in some of them. As the series are still prices, you are looking for a policy to fill the gaps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;1) Removing data&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can decide to remove all the dates where one of the values is &lt;em&gt;null&lt;/em&gt;. If you do so, when computing the returns, you will have &quot;ignored&quot; a point for series that actually had the data, and hence the return which will be computed will possibly be of a higher magnitude than it should have been (because the two prices are actually separated by more than a single day).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2) Filling with data&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can decide to fill the prices, for example with the LVCF tactic (last value carried forward), but this would result in 0 returns which are not actually part of the real data. (2.1)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could also fill with some algorithm, but this will end up &quot;flattening&quot; the course of the returns (2.3)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do you usually tackle this issue to have a volatility that is not altered by these workarounds? Removing? LVCF? Interpolation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you think that maybe this effect is negligible?&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2011-12-20T20:44:20.747" Title="How do you estimate the volatility of a sample when points are irregularly spaced?" Tags="&lt;volatility&gt;&lt;interpolation&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="2617" PostTypeId="1" CreationDate="2011-12-18T15:46:57.637" Score="12" ViewCount="432" Body="&lt;p&gt;Daily data, such as open and close prices, is often available for much longer periods than high-frequency data. However, whenever backtesting any strategy that examines instruments traded in different time zones and at different exchanges, one faces the problem of how to account for market movement while one exchange was open and the other closed.  In other words, the open and close prices recorded by the exchanges and reported by most data providers do not line up.  Thus if major market-moving news comes out during the US day time but after Asian or European markets have closed, then the impact of that news will be reflected in the same day's returns, but won't be reflected in Asian/European markets' returns until the following day.  Consequently, any signals generated simultaneously from both markets' returns and/or open/close prices will be biased.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, suppose US markets rally strongly going into the close.  Then US markets may appear overvalued relative to European and Asian markets judging by index prices as of the US close, although in reality the latter markets have moved as well (as ETFs traded on US exchanges would clearly indicate).  Since no trading has occurred (yet) in non-US markets, index prices are not representative of true market prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What methods should one use to reconcile the open and close prices to be on a similar timescale? Would it be better to simply ignore the much longer history which has daily data but no high-frequency data? If you choose to interpolate, should you use the interpolated points to calculate other statistics, such as volatilities, as well?  Suppose one is dealing with a relatively short-horizon signal (decaying over 5-10 days), so that smoothing out these differences by looking at longer return periods (e.g. weekly) is not feasible.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-12-18T21:23:53.523" LastActivityDate="2014-10-03T06:11:46.183" Title="How to account for market movement when some exchanges are closed?" Tags="&lt;time-series&gt;&lt;backtesting&gt;&lt;estimation&gt;" AnswerCount="3" CommentCount="7" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2618" PostTypeId="2" ParentId="2617" CreationDate="2011-12-18T19:59:28.783" Score="0" Body="&lt;p&gt;Probably not the best solution, but an alternative approach would be to look at the data weekly, e.g. weekly open and close, hence eliminating the 'time zone bias'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;--&lt;br&gt;&#xA;Here is a plot of varying markets over a week, just for fun...&#xA;&lt;img src=&quot;https://i.stack.imgur.com/9dAEu.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="1381" LastEditorUserId="1381" LastEditDate="2011-12-18T20:17:33.417" LastActivityDate="2011-12-18T20:17:33.417" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2619" PostTypeId="2" ParentId="2617" CreationDate="2011-12-18T20:48:54.333" Score="2" Body="&lt;p&gt;You need to know timezone for each instrument. Then for each instrument convert its time data from local to UTC (or to any other timezone that is convenient to you).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Implementation hint: use the freely available Olson database. Timezone conversion routines are easy to find for every serious programming language.&lt;/p&gt;&#xA;" OwnerUserId="493" LastActivityDate="2011-12-18T20:48:54.333" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2620" PostTypeId="5" CreationDate="2011-12-18T20:52:58.130" Score="0" Body="" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-12-18T20:52:58.130" LastActivityDate="2011-12-18T20:52:58.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2621" PostTypeId="4" CreationDate="2011-12-18T20:52:58.130" Score="0" Body="For questions *about* being a quant, akin to questions on programmers.SE vs. SO.  Includes soft questions, career-related questions, questions about best practices, etc." OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-12-18T20:52:58.130" LastActivityDate="2011-12-18T20:52:58.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2622" PostTypeId="2" ParentId="2496" CreationDate="2011-12-19T03:10:39.290" Score="3" Body="&lt;p&gt;A condition for correct calibration of the short rate model is that it exactly reproduce the present values of fixed (option-free) cashflows - that is, that it give the same answer as ordinary discounting at the spot rate. If it doesn't, you've done something wrong - sort of like using a model that violates put-call parity. (Actually, it's exactly like that.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ordinarily you &lt;i&gt; wouldn't &lt;/i&gt; use a stochastic model to value an option-free security, if you knew ahead of time that it was really option-free. But if you have an option model lying around (e.g., a Hull-White implementation) and are pricing a general security, you might choose to use it and not worry about whether it happens to actually be option-free. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, you can show that a pure floater where the reference rate has the periodicity of the payments (e.g., 3m libor, pay in arrears) can be valued without using a stochastic model (I'm oversimplifying slightly). But if you want to value a quarterly-pay security where the interest rate references, say, 10 year CMS, you &lt;em&gt;do&lt;/em&gt; need a stochastic model. So it's simpler just to use it and not worry. &lt;/p&gt;&#xA;" OwnerUserId="1780" LastActivityDate="2011-12-19T03:10:39.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2624" PostTypeId="2" ParentId="2616" CreationDate="2011-12-19T15:51:17.230" Score="14" Body="&lt;p&gt;The usual technique of computing the mean and standard deviation of returns happens to coincide with the maximum likelihood estimate when the data are regularly spaced.  However, when the data are not regularly spaced, you can still do a maximum likelihood estimate.  It's just more computationally intensive than before.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is to say, assume you have observations of asset price $S_i$ at (possibly irregular) times $t_i$.  Let these time differences be $\Delta t_i$.  Then note that the transition probabilities are given by&#xA;$$&#xD;&#xA; p\left(S_{i+1}| S_i ; \alpha,\sigma \right) = \phi \left( \log(S_{i+1} / S_i ); (\alpha-\frac12 \sigma^2)\Delta t_i  ,  \sigma \sqrt{\Delta t_i} \right)&#xD;&#xA;$$&#xA;where $\phi$ is the gaussian density function.  This transition probability is from the Black-Scholes model, of course, which is the same one you are implicitly using when employing the standard volatility estimators.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you can run an optimization algorithm (such as &lt;a href=&quot;http://users.eecs.northwestern.edu/~nocedal/lbfgsb.html&quot;&gt;BFGS&lt;/a&gt;) to maximize the overall path probability.  That is, you create an objective function&#xA;$$&#xD;&#xA;F\left(\alpha,\sigma, \{S_i,t_i\} \right) = \sum_i \log( p\left(S_{i+1}| S_i; \alpha,\sigma \right) )&#xD;&#xA;$$&#xA;to find its maximum over all possible values of $\alpha$ and $\sigma$.  The corresponding value of $\sigma$ is your MLE estimate.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2011-12-20T20:44:20.747" LastActivityDate="2011-12-20T20:44:20.747" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2625" PostTypeId="2" ParentId="2614" CreationDate="2011-12-19T17:25:02.877" Score="6" Body="&lt;p&gt;High and low prices are frequently used in many contexts, such as estimating volatility.  See, for example, the Garman-Klass and Yang-Zhang estimators.  &lt;a href=&quot;http://www.investment-analytics.com/files/Articles/Brandt%20and%20Kinlay%20-%20Estimating%20Historical%20Volatility%20v1.2%20June%202005.pdf&quot;&gt;Brandt and Kinlay&lt;/a&gt; provide a nice summary of some of these estimators.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it sounds like you are more interested in using high/low information for evaluating whether mean reversion has taken place.  In that case, I would counsel against using the range to measure whether the predicted mean reversion materialized.  Having worked with real financial time series, I can tell you that the high/low quotes are &lt;em&gt;much&lt;/em&gt; less reliable.  The high or low of a given period is often only the active price for a very short period, and may not be tradeable, particularly in large size and/or without expensive high-frequency execution (for which you should really be using tick data, not OHLC data, anyhow).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, I would recommend that you use the VWAP over the interval (calculated from actual ticks) as a slightly more meaningful alternative to the close alone.  I've seen some research that approximates VWAP over short horizons for typical equities from OHLC data as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{O+C+\frac{H+L}2}3$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If OHLC data is all you have, this may be your best bet.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-12-19T17:25:02.877" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2627" PostTypeId="2" ParentId="2617" CreationDate="2011-12-20T09:22:04.490" Score="5" Body="&lt;p&gt;The blog post &lt;a href=&quot;http://www.portfolioprobe.com/2011/11/21/asynchrony-in-market-data/&quot;&gt;http://www.portfolioprobe.com/2011/11/21/asynchrony-in-market-data/&lt;/a&gt; explains a bit more about the problem and it also points to a paper that shows that a moving average model is the way to make the adjustment that Tal is seeking.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The paper is presented in the context of a multivariate garch model.  That is gratuitous, really -- the MA estimate is going to be just about the same whether or not garch effects are taken into account.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would think that getting one MA estimate for each pair of markets would be sufficient (and probably better) than an estimate for each pair of assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Caveat: the adjustment gives you an average.  So even if the MA estimate were perfect, it would still only give you the adjustment on average rather than (perhaps) a few big moves and lots of basically zero moves.  So I think you would want to do this for a reasonably long timespan if you do it at all.&lt;/p&gt;&#xA;" OwnerUserId="249" LastActivityDate="2011-12-20T09:22:04.490" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2628" PostTypeId="1" AcceptedAnswerId="2629" CreationDate="2011-12-20T14:22:52.907" Score="4" ViewCount="528" Body="&lt;p&gt;I have the following asset returns Y and the predictions for the same periods Y':&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Y = { 10, 200, -1000, -1, -7 }&#xA;Y' = { 1, 2, -3, -4, -5 }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The OLR R-squared for these 2 vectors is 0.11 and the F-statistic 0.39, so clearly the explained variance is not very high. However variance analysis does not show that all the predicitions in Y' matched the same return direction than Y. To capture this point I would have to run a separate study counting each (Yn, Y'n) pair that has the same sign.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there better ways to fit a model and optimize the IVs coefficients for return direction? Ideally I would like to fit a model that gives more weigth to assets direction, then variance.&lt;/p&gt;&#xA;" OwnerUserId="1791" LastActivityDate="2011-12-20T15:17:38.997" Title="Linear regression and assets direction prediction" Tags="&lt;time-series&gt;&lt;regression&gt;&lt;variance&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2629" PostTypeId="2" ParentId="2628" CreationDate="2011-12-20T15:17:38.997" Score="2" Body="&lt;p&gt;It sounds like all you need is to run a &lt;a href=&quot;http://en.wikipedia.org/wiki/Logistic_regression&quot; rel=&quot;nofollow noreferrer&quot;&gt;logistic regression&lt;/a&gt;, with the sign of $Y$ as your dependent variable instead of $Y$ itself.  This will &lt;em&gt;only&lt;/em&gt; give weight to the sign of the variable, and not to the magnitude.  Once you have reformulated your question in more general terms (sign and magnitude of $Y$, rather than direction and volatility), you may be able to get further help from &lt;a href=&quot;https://stats.stackexchange.com/&quot;&gt;Cross Validated&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2011-12-20T15:17:38.997" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2630" PostTypeId="2" ParentId="1599" CreationDate="2011-12-20T15:39:05.933" Score="2" Body="&lt;p&gt;Bloomberg Open Symbology precanned files are updated twice daily.  8am and 2pm est&lt;/p&gt;&#xA;" OwnerUserId="1808" LastActivityDate="2011-12-20T15:39:05.933" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2631" PostTypeId="2" ParentId="1019" CreationDate="2011-12-20T19:44:05.337" Score="8" Body="&lt;p&gt;You can use a matrix type seperability condition as well. This is similar but the equation has more flexibiliity. The rates are then markovian in some combinations of the Brownian motion. See More Mathematical Finance for details. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2011-12-20T19:44:05.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2632" PostTypeId="2" ParentId="464" CreationDate="2011-12-20T19:46:36.753" Score="7" Body="&lt;p&gt;The following paper, &lt;a href=&quot;http://ssrn.com/abstract=1461285&quot; rel=&quot;nofollow&quot;&gt;Interpolation Schemes in the Displaced-Diffusion LIBOR Market Model and the Efficient Pricing and Greeks for Callable Range Accruals&lt;/a&gt;, addresses this issue:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We introduce a new arbitrage-free interpolation scheme for the displaced-diffusion LIBOR market model. Using this new extension, and the Piterbarg interpolation scheme, we study the simulation of range accrual coupons when valuing callable range accruals in the displaced-diffusion LIBOR market model. We introduce a number of new improvements that lead to significant efficiency improvements, and explain how to apply the adjoint-improved pathwise method to calculate deltas and vegas under the new improvements, which was not previously possible for callable range accruals. One new improvement is based on using a Brownian-bridge-type approach to simulating the range accrual coupons. We consider a variety of examples, including when the reference rate is a LIBOR rate, when it is a spread between swap rates, and when the multiplier for the range accrual coupon is stochastic. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1809" LastEditorUserId="1106" LastEditDate="2011-12-20T20:16:39.027" LastActivityDate="2011-12-20T20:16:39.027" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2633" PostTypeId="5" CreationDate="2011-12-20T20:14:34.227" Score="0" Body="" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-12-20T20:14:34.227" LastActivityDate="2011-12-20T20:14:34.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2634" PostTypeId="4" CreationDate="2011-12-20T20:14:34.227" Score="0" Body="The LIBOR market model is a financial model of interest rates. It is used for pricing interest rate derivatives. The quantities that are modeled are a set of forward rates (also called forward LIBORs), which have the advantage of being directly observable in the market, and whose volatilities are naturally linked to traded contracts." OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2011-12-20T20:14:34.227" LastActivityDate="2011-12-20T20:14:34.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2635" PostTypeId="1" AcceptedAnswerId="2657" CreationDate="2011-12-20T21:24:26.030" Score="10" ViewCount="251" Body="&lt;p&gt;I am trying to write a Monte Carlo simulation to calculate risk associated with some property based products. What is the most reasonable stochastic process to model property price index? Do people simulate is together with some other factors? (GDP, consumer confidence, stock prices, etc.)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because I am after risk, I need to work in the real measure (as opposed to risk-neutral).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also this is needed for academic work, so please mention any citable materials if relevant.&lt;/p&gt;&#xA;" OwnerUserId="1810" LastActivityDate="2011-12-27T17:00:45.737" Title="Simulating property price index" Tags="&lt;monte-carlo&gt;&lt;stochastic-processes&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2636" PostTypeId="1" AcceptedAnswerId="2637" CreationDate="2011-12-20T22:00:21.247" Score="9" ViewCount="1628" Body="&lt;p&gt;There is a multidimensional process X defined via its SDE (we can assume that its a diffusion type process), and lets define another process by $g_t = E[G(X_T)|X_t]$ for $t\leq T$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to simulate process $g_t$, i.e. discretize to use in a Monte-Carlo simulation. What is the best way to do it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The two approaches I can think of is (i) use Feynman-Kac and Finite Differeces to get $g_t$ as a function of $X$ and $t$, simulate $X_t$ and calculate $g_t$ (ii) use some form of Longstaff-Schwarz algorithm&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any better/simpler method?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I think I was not clear enough with my question. I am trying to estimate a stopping time when the process $g_t$ hits a given barrier $b$, so in order to do that I need to simulate the whole path of $g_t$. It is easy to simulate $X_t$ for any time t, but then to get $g_t|X_t$ I would need to run another monte carlo (within the monte carlo) for every path and every time step of the original monte carlo, which is probably going to take too much time. Longstaff-Schwarz algorithm is used for american options exactly because of this reason - to use a quick heuristic instead of nested monte carlo simulations...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT 2: Let me include some pseudo-code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for(int i=0; i&amp;lt;NoRuns; ++i)&#xA;{&#xA;  X_t = initial value;&#xA;  g_t = g(0, X_t); //TODO - how to calculate g_t?&#xA;  t=0;&#xA;  for(int j=0; j&amp;lt;NoSteps; ++j)&#xA;  {&#xA;    t+=dt;&#xA;    X_t = move X_t by dt, using e.g. Euler scheme&#xA;    g_t = g(t, X_t); //TODO - how to calculate g_t?&#xA;    if (g_t&amp;lt;= barrier) report(t, X_t, g_t);&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The bits I am not sure how to implement are the lines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;g_t = g(0, X_t); //TODO - how to calculate g_t?&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1810" LastEditorUserId="1810" LastEditDate="2011-12-21T16:34:24.610" LastActivityDate="2011-12-21T16:34:24.610" Title="Simulating conditional expectations" Tags="&lt;monte-carlo&gt;&lt;simulations&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2637" PostTypeId="2" ParentId="2636" CreationDate="2011-12-21T08:11:21.293" Score="5" Body="&lt;p&gt;If you can simulate $N$ times independent realisations of $X_T|X_t$ then SLLN says that :&#xA;$\tilde{g}^N_t=\sum_{i=1}^N\frac{1}{N}G(X_T)|X_t\to \mathbb{E}[G(X_T)|X_t]$ almost surely this is classical and often the only way to get $\mathbb{E}[G(X_T)|X_t]$ for high dimensional process $X$. You can even use CLT to get a confidence interval for $\tilde{g}_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards&lt;/p&gt;&#xA;" OwnerUserId="92" LastActivityDate="2011-12-21T08:11:21.293" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2640" PostTypeId="1" CreationDate="2011-12-22T02:40:50.400" Score="3" ViewCount="3355" Body="&lt;p&gt;I'm currently reading through &lt;a href=&quot;http://www.iijournals.com/doi/abs/10.3905/jpm.1994.409472&quot; rel=&quot;nofollow&quot;&gt;an article&lt;/a&gt; on bond portfolio immunization against changes in the interest rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I learned that the immunization can be done against instant changes in interest rate etc., but the investor can also bet on small or big changes occurring in the interest rate, i.e. he profits if the interest rate changes by at most $\pm0.5\%$, and loses if it changes by more than $\pm0.5\%$, so in this example no risk-free profit would be possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could one set up a portfolio that will profit if the interest rate changes by $\pm4\%$, and lose otherwise? I believe no interest rate will change by more than 4%. What is the limitation here?&lt;/p&gt;&#xA;" OwnerUserId="1817" LastEditorUserId="1106" LastEditDate="2011-12-28T17:36:42.540" LastActivityDate="2012-07-02T17:15:05.107" Title="What are the limits of bond portfolio immunization against interest rate changes?" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;portfolio-management&gt;&lt;duration&gt;" AnswerCount="3" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2642" PostTypeId="1" CreationDate="2011-12-22T07:02:04.757" Score="4" ViewCount="3205" Body="&lt;p&gt;I am trying to make a theoretical hedge to a bull call spread. (buy out the money call, sell further out the money call)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I have now is almost effective but there is one possible 80% loss (amongst consistent 70% gains in an equally likely scenario, and 300% gains in an extreme scenario)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best case scenario: 70% gain&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Worst case scenario: 80% loss&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Black swan bearish scenario: 300+% gain  (this is a factor of the hedge)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I would like my hedge to do is mitigate the worst case scenario.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the rationale:&#xA;QQQ Bull Call Spread in near term, this is bullish (qqq represents the nasdaq composite)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FAZ long calls in back month (to mitigate theta), this is bearish as FAZ is a 3x leveraged ETF (albiet on the finance sector). FAZ will increase in value 3x for every 1 point move down QQQ makes. Calls will get intrinsic value very quickly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/r2Zcy.png&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For this site's sake, I'm not caring too much about the symbols. I am interested trying to find a cheap hedge that increases 3x faster if the other side of the trade fails. Right now I almost have that, but not yet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The key variables to manipulate are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Balance: How much of the hedge is held in proportion to the main trade.&#xA;This simulation shows 10 bull call spreads, hedged by 1 long call in an inverse ETF&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Theta: The front month expires faster than the back month. The back month hedge can be closed before the effects of theta become apparent. But the further out you go for the back month, the most expensive it gets&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Expense: the hedge ideally should not be more expensive than the potential profit of the main trade, but it is expected to cut into the theoretical max profit of the main trade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The key is to get the shape of the risk profile to have a smaller dip into the negative at any point on the graph.&lt;/p&gt;&#xA;" OwnerUserId="1453" LastEditorUserId="26792" LastEditDate="2017-03-08T16:08:09.143" LastActivityDate="2017-03-08T16:08:09.143" Title="How to hedge a bull call spread" Tags="&lt;hedging&gt;&lt;option-strategies&gt;&lt;spread&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2643" PostTypeId="2" ParentId="2602" CreationDate="2011-12-22T14:39:33.620" Score="4" Body="&lt;p&gt;Barrie and Hibbert might provide some help - they have a reputation based on understanding insurance risks &lt;a href=&quot;http://www.barrhibb.com/research_and_insights&quot; rel=&quot;nofollow&quot;&gt;http://www.barrhibb.com/research_and_insights&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1820" LastActivityDate="2011-12-22T14:39:33.620" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2647" PostTypeId="1" AcceptedAnswerId="2649" CreationDate="2011-12-23T17:25:07.950" Score="11" ViewCount="9840" Body="&lt;p&gt;I try to understand the derivation of the Black-Scholes equation based on the &quot;constructing a replicating portfolio&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From mathematical point of view it looks simple. We assume that:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Stock prices is given by Ito's process.&lt;/li&gt;&#xA;&lt;li&gt;The bond price grows exponentially.&lt;/li&gt;&#xA;&lt;li&gt;The derivative price is a function of time and stock price.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Then we apply Ito's lemma to get the stochastic differential equation for the derivative price. Then the logic is as following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;As far as I understand, we consider a derivative as a mixture (in certain proportions) of stock and bond.&lt;/li&gt;&#xA;&lt;li&gt;Then the differential of the derivative price can be expressed through the differential of the stock and bond prices.&lt;/li&gt;&#xA;&lt;li&gt;Then this equation is compared with the differential of the derivative price obtained from the Ito's lemma. We require that the two equations for the differential of the derivative price should be the same and get the Black-Scholes equation.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;What I do not understand, is why this procedure fixes the proportion of the stock and bond in the derivative. Why we cannot have a derivative consisting of an arbitrary amount of stock and bonds? We cannot have it because in this case the price of the derivative will not be given as a function of the stock price and time? So, why it is a problem? Why the derivative price should be a function of the stock price and time? I think that the root of my problem is that I do not know the concept of the self-financing and replicating portfolio. Could anybody, please, clarify this issue for me?&lt;/p&gt;&#xA;" OwnerUserId="981" LastActivityDate="2011-12-30T13:27:19.843" Title="What is a self-financing and replicating portfolio?" Tags="&lt;black-scholes&gt;&lt;derivatives&gt;&lt;replication&gt;&lt;portfolio&gt;&lt;derivation&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2649" PostTypeId="2" ParentId="2647" CreationDate="2011-12-23T21:28:37.447" Score="7" Body="&lt;p&gt;Specifically, we have a generic conditional claim, $C$, that is a function of the diffusion process for the underlying, $S(t)$, and time $t$ so $C = C(S(t), t)$. As you pointed out, $C$ is an Ito process becuase it is a function of a stochastic process so we use Ito's Lemma to determine how the contingent claim varies as a function of the diffusion process $S(t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually deriving the Black-Scholes PDE helps a lot in understanding how this all comes together, by the way. I will spare this group the derivation as one can easily find it elsewhere on the Web.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason we want a replicating portfolio is to hold fast the no-arbitrage assumption. This replicating portfolio is made up of a money market (or bond) that accrues interest as a function of time, $m(S(t), t)$ and a position in the stock as a function of time: $h(S(t), t)$ number of shares multiplied by $S(t)$ the underlying price. Note that the reason $m$ and $h$ are functions of the stock process is the dynamic nature of the replication. As the stock process diffuses, the number of shares and position in the money market changes. Also note that the function $h$ is called the hedge ratio, or &lt;em&gt;delta&lt;/em&gt; ($\frac{\partial C}{\partial S}$) because it represents the number of shares of stock required to replicate, or hedge changes in the price of the claim.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So to answer some of your questions more directly:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;why this procedure fixes the proportion of the stock and bond in the derivative?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It doesn't fix the proportion. This is a dynamic replicating portfolio where the hedge ratio, $h$ changes with the diffusion process. The money market (or bond) is there to dynamically finance the purchase (or sales) of shares based on the hedge ratio as the stock diffuses.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Why we cannot have a derivative consisting of an arbitrary amount of stock and bonds?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In essence, it kind of is arbitrary. The quantity of shares, determined by the stock process and denoted by the hedge ratio, $h$, depends on the random diffusion of the stock process. Geometric brownian motion is assumed for Black-Scholes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dS = \mu s dt + \sigma s dW$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $dW$ is a random Wiener process.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We cannot have it because in this case the price of the derivative will not be given as a function of the stock price and time? So, why it is a problem? &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I'm not entirely sure what you mean here... but think of the replicating portfolio as a closed system. You have an initial deposit of shares and cash to dynamically replicate the claim through time. We want the no-arbitrage assumption to hold, which is why we do this.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Why the derivative price should be a function of the stock price and time?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is the definition of a &lt;em&gt;derivative&lt;/em&gt;, a contract that's value is &lt;em&gt;derived&lt;/em&gt; from some other asset.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I think that the root of my problem is that I do not know the concept of the self-financing and replicating portfolio. Could anybody, please, clarify this issue for me?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Self-financing means we have an initial deposit of shares and cash which is meant to dynamically replicate the option through time. The self-replicating portfolio is holds the no-arbitrage argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If a call option was trading for 0.50 and the replicating portfolio (a portfolio that replicated the value through time) was trading at 0.55, one could buy the option and sell the portfolio to reap a risk-less profit (arbitrage).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These are the fundamental ideas of derivatives pricing: no-arbitrage and replicating portfolios.&lt;/p&gt;&#xA;" OwnerUserId="1112" LastEditorUserId="1112" LastEditDate="2011-12-30T13:27:19.843" LastActivityDate="2011-12-30T13:27:19.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2650" PostTypeId="2" ParentId="2640" CreationDate="2011-12-25T21:08:35.460" Score="1" Body="&lt;p&gt;you can set up sucha portfolio using options. However I doubt you can make any money unless you are going for some very volatile IR. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using Options you can both buy a call and sell a put at 4% difference to the current IR. You will loose the premiums you paid on the oprions, if IR stay within the 4% premium.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using bonds, it is easy. if IR rise, you will loose, no matter what bond you have.&lt;/p&gt;&#xA;" OwnerUserId="1832" LastActivityDate="2011-12-25T21:08:35.460" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2651" PostTypeId="1" CreationDate="2011-12-26T03:49:18.140" Score="3" ViewCount="1388" Body="&lt;p&gt;I understand that expected price changes of underlying assets are usually priced into options, but I don't understand how.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, before upcoming earning reports the option values are inflated to a point that represents any potential profit from an earnings price jump or decrease in the underlying stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I dont understand how people interpret the &quot;street estimates&quot; to price the options. I would appreciate any insight into this and I'm not just focusing on earnings reports&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for instance, if I believed a stock was going to drop 10% and nobody else did, I would still be unable to convince a market maker to accept my order for options at double their value - yet. I would have to buy and buy and buy and buy until the options were inflated in value that much, and that only happens if large parties or everyone expects a move like that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Options pricing isn't an exact science, but any insight or empirical analysis would be greatly appreciated&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I am 100% sure that this question doesn't belong on the basic personal finance site)&lt;/p&gt;&#xA;" OwnerUserId="1453" LastActivityDate="2013-08-07T00:01:16.707" Title="how expected moves are priced into options" Tags="&lt;options&gt;" AnswerCount="5" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2652" PostTypeId="1" AcceptedAnswerId="2654" CreationDate="2011-12-26T11:37:12.057" Score="9" ViewCount="733" Body="&lt;p&gt;One of the stylized facts of financial time series seems to be a fundamental asymmetry between smooth upward movements over longer periods of time followed by abrupt declines over relatively shorter time frames (&quot;crashes&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately I haven't found much literature on this yet and I am trying to answer two questions as a starting point:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;How can you test empirical time series for the degree of this kind of pattern?&lt;/li&gt;&#xA;&lt;li&gt;With which stochastic generating process can you simulate this kind of behavior?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Further research would go into the direction of how to exploit these patterns if they can really be corroborated empirically.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2011-12-29T19:35:07.083" Title="How to test for and how to simulate price rise/fall asymmetry in the stock market" Tags="&lt;time-series&gt;&lt;statistics&gt;&lt;simulations&gt;&lt;stochastic-processes&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="2653" PostTypeId="2" ParentId="2652" CreationDate="2011-12-26T15:25:02.793" Score="0" Body="&lt;p&gt;May you assess the goodness of some GEV distribution fit against a gaussian? You could also use this asymmetric curve to generate an iid sequence.&lt;/p&gt;&#xA;" OwnerUserId="1519" LastActivityDate="2011-12-26T15:25:02.793" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2654" PostTypeId="2" ParentId="2652" CreationDate="2011-12-26T17:29:29.240" Score="8" Body="&lt;p&gt;&quot;Treshold Garch&quot; or T-Garch models are designed to capture this asymmetry. See this &lt;a href=&quot;http://faculty.chicagobooth.edu/ruey.tsay/teaching/bs41202/tgarch.pdf&quot; rel=&quot;nofollow&quot;&gt;exposition&lt;/a&gt; by U. Chicago's Ruey Tsay who has a terrific text on time-series models in &quot;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470414359&quot; rel=&quot;nofollow&quot;&gt;Analysis of Financial Time Series&lt;/a&gt;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use the structure of the T-Garch models to simulate data with this property.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a package called &lt;a href=&quot;http://cran.r-project.org/web/packages/fGarch/index.html&quot; rel=&quot;nofollow&quot;&gt;fGarch&lt;/a&gt; that creates APARCH models. A T-GARCH model is a special case of an APARCH model where delta = 1. See Ruey's &lt;a href=&quot;http://faculty.chicagobooth.edu/ruey.tsay/teaching/bs41202/sp2011/&quot; rel=&quot;nofollow&quot;&gt;Lecture 5&lt;/a&gt; and associated R-code for using the fGarch library.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, there is some outstanding theoretical research by Capital Fund Management using the statistical physics approach on how to explain the negative-skewness and other features. I include a link and abstract to their research below:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;a href=&quot;http://www.science-finance.fr/images/stories/pdf/publication/financial_market/more_stylized_facts_of_financial_markets_leverage_effect_and_downside_correlations.pdf&quot; rel=&quot;nofollow&quot;&gt;More stylized facts of financial markets: leverage effect and&#xA;  downside correlations&lt;/a&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;We discuss two more universal features of stock markets: the so-called&#xA;  leverage effect (a negative correlation between past returns and&#xA;  future volatility), and the increased downside correlations. For&#xA;  individual stocks, the leverage correlation can be rationalized in&#xA;  terms of a new `retarded' model which interpolates between a purely&#xA;  additive and a purely multiplicative stochastic process. For stock&#xA;  indices a specific market panic phenomenon seems to be necessary to&#xA;  account for the observed amplitude of the effect. As for the increase&#xA;  of correlations in highly volatile periods, we investigate how much of&#xA;  this effect can be explained within a simple non-Gaussian one-factor&#xA;  description with time independent correlations. In particular, this&#xA;  one-factor model can explain the level and asymmetry of empirical&#xA;  exceedance correlations, which reflects the fat-tailed and negatively&#xA;  skewed distribution of market returns.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-12-28T02:23:26.240" LastActivityDate="2011-12-28T02:23:26.240" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2655" PostTypeId="2" ParentId="2651" CreationDate="2011-12-27T01:05:43.973" Score="1" Body="&lt;p&gt;What you say is not correct if I understand you correctly. Correct me if I'm wrong but your stating that before an event the price of both the call and put option increases in price and thus you cant profit from your expectation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case you think a stock will go down 10% you can buy a put and profit from the increase of the price of the option when it drops 10%, now your saying the price of options is very high before this event and it drops after the event. So if the price of all options is expensive, what you could do is sell a call option before this event. &lt;/p&gt;&#xA;" OwnerUserId="1835" LastEditorUserId="848" LastEditDate="2011-12-27T15:03:08.727" LastActivityDate="2011-12-27T15:03:08.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2656" PostTypeId="2" ParentId="2651" CreationDate="2011-12-27T16:56:19.097" Score="3" Body="&lt;p&gt;I think you may have an inconsistency in your use of the word &lt;em&gt;expected&lt;/em&gt;. In your example paragraph, the price movement is something &lt;em&gt;you&lt;/em&gt; expect (that is, you expect a 10% drop). But the market has its own notion of what will happen to price with, say, a drop in reported earnings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(J.M. Keynes likened the stock market to a beauty contest in a newspaper in which the winner did not choose the most attractive woman, but rather, the most attractive woman that &lt;em&gt;others&lt;/em&gt; chose. The winnder, by necessity, will figure out whom others are going to choose, not necessarily the one whom he thinks is the most beautiful.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let's put your question in the context of the beauty contest. Is the price going to go down 10% because of weaker earnings? Or will it go up 2% because the sellers have already discounted the news? Or will it go up 5% because the company's competitors are positioned even worse?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the few truly expected moves is when the stock price drops because it is going ex-dividend. (If the board of directors announces a 25 cent dividend, then the stock price will drop by 25 cents on the day that it trades without the dividend.) This is a well known phenomenon that is priced into all option-pricing models. Those who own deep in-the-money calls will exercise those calls before the stock goes ex-dividend, in order to capture the dividend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Calls will go up in price if there an expected increase in price, reflecting the increased volatility of the underlying price. Corresponding puts will also go up in price as arbitrageurs soak up the free money.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Incidentally, if I were you, I would not buy lots of options because I think the options are under priced. You may be taking what is called in poker &lt;em&gt;a sucker's bet.&lt;/em&gt; &lt;/p&gt;&#xA;" OwnerUserId="343" LastActivityDate="2011-12-27T16:56:19.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2657" PostTypeId="2" ParentId="2635" CreationDate="2011-12-27T17:00:45.737" Score="6" Body="&lt;p&gt;The best I have seen so far is &lt;a href=&quot;http://econ-www.mit.edu/faculty/wheaton/recent&quot;&gt;William Wheaton&lt;/a&gt;'s work in this area.  I don't know how much is described in his papers but he and Torto created a system that combined factor models for things like local and national price indexes with specific economics of commercial real estate ventures (such as balloon payments on construction milestones and the like).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The whole thing was probably overparameterized, but pretty neat.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously recreating that whole thing would be a huge burden for you, but the idea of tying a factor model to your favorite GDP predictors and so forth is fairly reasonable, especially for academic research.  (Actual investors are more likely to code a few hunches into some scenarios in a spreadsheet and leave it at that).&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-12-27T17:00:45.737" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2658" PostTypeId="2" ParentId="2642" CreationDate="2011-12-27T17:14:18.397" Score="2" Body="&lt;p&gt;I suggest searching all the possibilities using Excel.   Code the option pricing formulas into VBA functions (if you have not done so already) with cell to hold option strikes and quantities, and then set up your price scenarios for a grid of 1% moves in the underlying.  You have now reproduced the information contained in your Bloomberg plots pictured above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Excel Solver will let you do a search on the outcomes, and even set constraints such as never losing more than 40% (as opposed to the 80% you now have).  You will want to define a particular &quot;utility function&quot; cell for it to maximize, perhaps the peak profit or whatever else fits your personal desiderata.  Start the solver with the best scenario you have established so far, and let it improve your utility function within whatever constraints you have set.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously some hypothetical constraints will be impossible to satisfy, e.g. 0% downside and &gt;0% upside in all market scenarios.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2011-12-27T17:14:18.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2659" PostTypeId="2" ParentId="2651" CreationDate="2011-12-27T17:16:38.563" Score="2" Body="&lt;p&gt;This is not a direct answer, but an interesting way to understand what the options market thinks about an upcoming event is look at near-expiration ATM straddles (long call and long put in same underlying, same strike, same expiration). Being long a straddle is being long volatility in the underlying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say it's Wednesday before options expiration and earnings come out tomorrow, Thursday. If you pay 5.00 for the straddle, then the stock has to move up or down 5.00 for the position to make money. If the stock is trading at 50.00, then a 5.00 move on a 50.00 stock gives you an estimate of what the options market thinks the stock will move.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I haven't seen a study or paper on this but given time and data, I'm sure one could argue there is some level of edge here.&lt;/p&gt;&#xA;" OwnerUserId="1112" LastActivityDate="2011-12-27T17:16:38.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2660" PostTypeId="2" ParentId="2652" CreationDate="2011-12-27T17:23:51.297" Score="7" Body="&lt;p&gt;These patterns are of course well-known enough to have been &quot;priced in&quot; to the financial markets.  Jump diffusions are a classic way to capture the phenomenon, and often have closed-form option pricing formulas associated with them.  The implied option skew, for example, gets a lot flatter when you use a JD model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Jump diffusions are often combined with some kind of stochastic volatility model (e.g. as described by &lt;a href=&quot;http://www.math.nyu.edu/fellows_fin_math/gatheral/&quot; rel=&quot;nofollow&quot;&gt;Jim Gatheral&lt;/a&gt;) to obtain what many practictioners consider the most descriptive tractable modeling framework.  I happen to think this family of models is easily superior to a specific &quot;regime&quot; time series model like some of those described above, not least because I think GARCH is of only academic interest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The key difficulty in this type of work is not finding a plausible stochastic description, but rather achieving tractability and avoiding an explosion of parameters beyond what your data supports.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2011-12-29T19:35:07.083" LastActivityDate="2011-12-29T19:35:07.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2661" PostTypeId="2" ParentId="2640" CreationDate="2011-12-28T02:51:39.153" Score="1" Body="&lt;p&gt;The purpose of bond portfolio immunization is to protect against large interest rate movements.  Hence what you describe is really not immunization (a form of hedging), but rather speculation. Of course, the speculative bet you've laid out can be done with options, and the only limit is in the lower liquidity in deep out of the money options, such as would likely be the case for the 4% move you use as an example. &lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-12-28T02:51:39.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2662" PostTypeId="1" AcceptedAnswerId="2671" CreationDate="2011-12-28T05:37:03.163" Score="11" ViewCount="2635" Body="&lt;p&gt;Long-only &lt;a href=&quot;http://en.wikipedia.org/wiki/Risk_parity&quot;&gt;risk-parity portfolios&lt;/a&gt; have proliferated in recent years. An optimized long-only risk-parity portfolio requires that the asset weight * marginal contribution to risk of the asset is identical for all securities. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way to implement this idea is to find the solution to a dual-problem. For a long-only risk-parity solution one can find the weights that minimize the variance of each assets weights ($w$) * marginal contribution to risk ($\text{MCTR}=\frac{\partial \sigma(w)}{\partial w_i}=\partial_i \sigma(w)$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this manner, formally the problem is to choose weights (constrained to sum to one) using your favorite optimizer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\underset{w}{\arg \min} \quad \text{Risk} = \text{Var}( w_1 * \partial_1 \sigma(w) , w_2 * \partial_2 \sigma(w), ... , w_n * \partial_n \sigma(w)) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question -- are there any research articles or insights for constructing risk-parity portfolios assuming dollar-neutral (instead of long-only) weight constraints?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Implementing risk-parity in a dollar-neutral portfolio is not as trivial as applying the same objective function as above and simply changing the weight constraints. For example, because variance is symmetrical two solutions would be produced: optimal weights and -1*optimal weights. (Of course, a more complex objective function that included a maximize alpha objective would not result in symmetrical solutions.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, convergence in the long-only case is fairly rapid whereas in the dollar-neutral case the objective function conflicts with the constraint that i) cash weight + long weight + short weight = 1, and ii) long weight = -short weight. The combination of i) and ii) implies cash weight = 1 in dollar-neutral.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To flesh out the second point, intuitively, the optimizer objective function is minimized when $ w_n * \partial_n \sigma(w) $ is identical for all securities (i.e. the variance is zero). However, this is impossible when some weights must be positive and other weights must be negative to satisfy constraint (ii), and where nearly all securities have a positive MCTR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps there is a more suitable choice of objective function to minimize in the dollar-neutral case, or another way to construct a risk-parity portfolio in a dollar-neutral context?&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2011-12-28T16:51:27.693" LastActivityDate="2011-12-29T15:33:05.517" Title="How to apply risk-parity portfolio construction to a dollar-neutral portfolio?" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;optimization&gt;&lt;portfolio-selection&gt;" AnswerCount="2" CommentCount="7" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2663" PostTypeId="1" AcceptedAnswerId="2664" CreationDate="2011-12-28T10:18:24.500" Score="7" ViewCount="1037" Body="&lt;p&gt;Suppose I want to compute the time value of money (present value, future value, etc). I need to put an interest rate into the calculation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which real world interest rate would best be used here, assuming that I'm concerned with US securities?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should I use the Fed Funds rate? Should I use the T-bill/bond rates? If so, which period T-bill/bond rates should I use? Should I use the short-term interest rate or long-term interest rate?&lt;/p&gt;&#xA;" OwnerUserId="703" LastEditorUserId="1106" LastEditDate="2011-12-28T17:32:59.910" LastActivityDate="2011-12-28T17:32:59.910" Title="Which interest rate should I use for the discount rate in real-world pricing?" Tags="&lt;interest-rates&gt;&lt;valuation&gt;&lt;pricing&gt;&lt;yield-curve&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2664" PostTypeId="2" ParentId="2663" CreationDate="2011-12-28T10:49:07.613" Score="6" Body="&lt;p&gt;You should use the full yield curve, discounting cash flows at specific dates using the appropriate zero-coupon interest rate. As to which yield curve, that is often a matter of convention. Generally one uses the LIBOR/swaps curve for all but the most liquid products (in which case you use the treasury curve). The curve is constructed from LIBOR/Eurodollar futures at the short end and swaps at the long end. &lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2011-12-28T10:49:07.613" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2665" PostTypeId="2" ParentId="2662" CreationDate="2011-12-28T11:40:26.063" Score="2" Body="&lt;p&gt;I played around with this a little using Portfolio Probe.  The way to get risk parity portfolios (in the sense you are using) with that is to constrain the fractions of variance for each asset to be slightly more than one over the number of assets.  Slightly more because trading is done in integer amounts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I took 20 assets and tried forming dollar neutral portfolios.  Constraining risk fractions to less than .051 was on the edge of feasible (for long-only .0501 is okay).  The dollar neutral constraint seems to be in conflict with the risk parity constraint (net was constrained to be -100 to 100 dollars with a gross of 1e6).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously switching longs for shorts gets you another solution -- perhaps a bunch of other solutions.  But generating random portfolios with the looser constraint of .055 shows much more diversity than that in the size of positions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not convinced this is of practical interest, but it is intellectually interesting.&lt;/p&gt;&#xA;" OwnerUserId="249" LastActivityDate="2011-12-28T11:40:26.063" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2666" PostTypeId="2" ParentId="2663" CreationDate="2011-12-28T16:10:29.913" Score="3" Body="&lt;p&gt;Depends on circumstances - if you just trade futures intraday for yourself, secondary market T-bills (http://www.federalreserve.gov/releases/h15/data.htm#fn3) will be good enough. &lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2011-12-28T16:10:29.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2669" PostTypeId="1" AcceptedAnswerId="2676" CreationDate="2011-12-29T05:50:11.833" Score="2" ViewCount="513" Body="&lt;p&gt;What are the most important portfolio management theories you must know in order to competently manage an investment portfolio?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to keep the topic focused, I would like to narrow down the set of potential theories to theories that are aimed at the act of portfolio management itself. For example, knowing Keynesian economics may be &quot;nice&quot; for investing, but Keynesian economics is a rather broad theory that isn't directly aimed at portfolio management.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, Modern Portfolio Theory IS a theory that is directly aimed at investment/portfolio management.&lt;/p&gt;&#xA;" OwnerUserId="703" LastEditorUserId="56" LastEditDate="2011-12-29T14:44:13.200" LastActivityDate="2011-12-30T04:13:14.073" Title="What are some &quot;Must Know&quot; investment/portfolio management theories out there?" Tags="&lt;theory&gt;&lt;modern-portfolio-theory&gt;&lt;investment&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2671" PostTypeId="2" ParentId="2662" CreationDate="2011-12-29T15:33:05.517" Score="5" Body="&lt;p&gt;Just includling my thoughts and the link in a proper answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The goal function I suggest for this optimization is the following.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\underset{w}{\arg \min} \sum_{i=1}^N [\frac{\sqrt{w^T \Sigma w}}{N} - w_i\partial_i\sigma(w)]^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I added the square root compared to the comment as you are actually using the euler decomposition on $\sigma$ (not on $\sigma^2$) as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma(w)=\sqrt{w^T \Sigma w} = \sum_{i=1}^N w_i \partial_i \sigma(w)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All the properties of this setup are discussed in details in &lt;a href=&quot;http://www.thierry-roncalli.com/download/erc.pdf&quot; rel=&quot;noreferrer&quot;&gt;this paper&lt;/a&gt;, but mainly with the assumption of $w_i \geq 0 \quad \forall i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the long-only case, it works, I'm pretty sure. I think we might have to add an absolute value for the general case though....&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2011-12-29T15:33:05.517" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2673" PostTypeId="1" CreationDate="2011-12-29T19:17:56.920" Score="3" ViewCount="141" Body="&lt;p&gt;I have no experience in finance, but I've been playing around with a virtual portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to control the &quot;rank volatility&quot; distribution - that is, the volatility of a stock's daily rank in returns instead of of the volatility of the returns themselves. I'm particularly interested symmetric distributions on rank, more concentrated in high and low ranks than uniform distribution.&lt;/p&gt;&#xA;" OwnerUserId="1758" LastActivityDate="2011-12-29T19:17:56.920" Title="What is the relation between return volatility and return rank volatility, and how can I control the latter?" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;distribution&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2675" PostTypeId="2" ParentId="2651" CreationDate="2011-12-30T04:06:15.817" Score="1" Body="&lt;p&gt;You have to think about options prices and expected moves  'backwards'.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Option prices imply what the expected moves are.  Options are priced by trading by market participants with a myriad of expectations.&#xA;Options are NOT priced by using a 'forward' formula that begins with the 'cause' of the move in the underlying and then computing the option price.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of expected moves, option prices are only useful to make an assertion like this:&#xA;&quot;given that option A trades at price X in the market.  this implies that market participants expect that there will be a move in the underlying of Y with probability Z between now and the expiration of the option&quot;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You don't arrive at the option price via a fundamental valuation technique like discounted expected earnings or something similar which you might use to value a stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You use the option price to decide simply whether you think the market is over estimating or underestimating the likelyhood of some move in the underlying and making your trade (or not) accordingly.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you pair the market's expectation(from the option price) with what you think is likely to come from a specific event in the future you can decide whether or not the options are cheap enough to buy (or expensive enough to sell short) given what you think is likely to occur.&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-12-30T04:06:15.817" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2676" PostTypeId="2" ParentId="2669" CreationDate="2011-12-30T04:13:14.073" Score="6" Body="&lt;p&gt;If you look in the portfolio management sections of the CFA (chartered financial analyst) curriculum, you'll find a listing of commonly used portfolio management techniques.  It is by no means exhaustive, but the content in the CFA curriculum comes directly from industry professionals, so it is reasonable current and applicable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cfainstitute.org/cfaprogram/courseofstudy/curriculum/Pages/cbok.aspx&quot;&gt;CFA Candidate Body of Knowledge (curriculum)&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-12-30T04:13:14.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2677" PostTypeId="2" ParentId="2389" CreationDate="2011-12-30T05:44:49.373" Score="5" Body="&lt;p&gt;Net the vegas of the individual options in the spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Inherently, the closer together the strikes, in the spread are, the less sensitive to changes in implied vol the spread is.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The opposite is true for wider spreads.&lt;br&gt;&#xA;Technically, the wider the spread the more it follows the dynamics of the skew itself, depending on where the spread is relative to at-the-money. (which is to say that it varies)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Graphically, you can think of it this way...&lt;br&gt;&#xA;A general increase in implied vol causes the PnL line of the spread to flatten (move to the middle between the max profit/loss potential of the spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A general decrease in implied vol causes the PnL line of the spread to steepen (move towards the max profit potential of the spread.&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2011-12-30T05:44:49.373" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2678" PostTypeId="1" AcceptedAnswerId="2680" CreationDate="2011-12-30T06:23:50.077" Score="-4" ViewCount="16188" Body="&lt;p&gt;Since if the option's price is lower than its intrinsic value (eg. strike price - current stock price for puts), then an arbitrage opportunity arises from buying the option at bargain and then exercising it...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consequently, an option's price will always be greater than or equal to its intrinsic value&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I right or wrong in this? &lt;/p&gt;&#xA;" OwnerUserId="703" LastActivityDate="2016-07-31T09:39:28.277" Title="True or False? An option's price will always be greater than or equal to its intrinsic value" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;option-strategies&gt;&lt;investment&gt;" AnswerCount="5" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2679" PostTypeId="1" AcceptedAnswerId="2682" CreationDate="2011-12-30T06:24:52.873" Score="15" ViewCount="7290" Body="&lt;p&gt;Let's say that I have a universe of stocks from a certain sector. I want to compute the market portfolio of this sector. Beta is the covariance between each stock and the market. But how do you compute the market portfolio?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I read in several papers that a proxy for the market portfolio of a universe of securities is the portfolio with weights equal to the first principal component of the correlation matrix.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Why PCA? My concern is that PCA is maximizing the variance and I am not sure this is exactly what we want.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Are there other ways to choose the weights of this portfolio (apart from equally weighted or value weighted)? I am thinking, for instance, of minimizing the portfolio that is long a stock and short all others. Or I could use ANOVA.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="134" LastEditorUserId="134" LastEditDate="2012-01-02T02:28:02.857" LastActivityDate="2012-04-09T00:33:50.110" Title="Why is the first principal component a proxy for the market portfolio, and what other proxies exist?" Tags="&lt;statistics&gt;&lt;beta&gt;&lt;modern-portfolio-theory&gt;&lt;pca&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="16" ContentLicense="CC BY-SA 3.0" />
  <row Id="2680" PostTypeId="2" ParentId="2678" CreationDate="2011-12-30T07:36:03.530" Score="3" Body="&lt;p&gt;You answered your own question with the statement it began with: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Since if the option's price is lower than its intrinsic value (eg. strike price - current stock price for puts), then an arbitrage opportunity arises from buying the option at bargain and then exercising it...&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An options price cannot be lower than its intrinsic value (for any discernab,le amount of time - assuming markets remain open and transactions are occuring), for the simple reason that it will represent &quot;free money&quot; - it will be arbitraged away immediately, as you quite rightly noted in your question.&lt;/p&gt;&#xA;" OwnerUserId="1733" LastActivityDate="2011-12-30T07:36:03.530" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2682" PostTypeId="2" ParentId="2679" CreationDate="2011-12-30T15:04:21.707" Score="28" Body="&lt;p&gt;Yes, the weights of the first eigenvector of a covariance matrix represent the market factor and also the largest source of systematic risk (variation of returns).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why PCA? Well, PCA simply identifies the eigenvector that maximally explains the variance of the system. It turns out that this is the &quot;market factor&quot; - i.e. the tendency of securities to rise and fall together as an asset class. Why is this the market factor? If you examine the weights (factor loadings) of the first eigenvector in a histogram you will find they are generally all of the same sign whereas this is not the case for any of the subsequent eigenvectors (which represent sectors or style factors, that is to say other sources of systematic risk). In other words, it is empirically the case that there is a dominant systematic factor called the equity risk premium explaining the variance of returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is it empirically the case? Because macro variables such as monetary, fiscal policy, growth expectations, political risk, regulatory risk and other factors influence the returns of all stocks (although to varying degrees as measured by the security beta).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you say &quot;My concern is that PCA is maximizing the variance&quot;, it is more accurate to say that PCA is identifying that linear combination of security weights (i.e. an eigenvector) that has the highest variance which we call the market factor because the weights are generally the same sign. A portfolio constructed using these weights - an eigenportfolio - certainly would have high variance -- in fact it's the set of portfolio weights that produces the most volatility vs. any other set of portfolio weights since it loaded on the primary source of systematic risk. (As a side note, you could form a eigenportfolio that has minimum variance by identifying a principal component with a low eigenvalue.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed, if you plot the return of a portfolio based on the weights of the &quot;first eigenportfolio&quot; you will see the returns are highly correlated (but not equivalent to) the index itself as in the chart below from Marco Avellenada's paper:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/QErK8.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a distinction between the market portfolio and the market factor described above. The &quot;market portfolio&quot; in the CAPM sense is the sum of all assets in the universe which by definition is market-cap weighted (since all assets are held in aggregate). Beta attempts to estimate the covariance of a security with respect to the market portfolio where the S&amp;amp;P or MSCI is a typical proxy. The market portfolio is fully diversified of idiosyncratic risk so its variance is explained by exposures to systematic risk only. The conceptual connection is that the Beta is the measure of the systematic risk or common source of variation in returns. Therefore, the first eigenvector (which identifies that linear combination of assets of maximal variance) is sometimes used as a proxy for the market portfolio. Also, a given security's &quot;loadings&quot; on the first principal component is one way of measuring the security's beta to the market factor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the second question, another way to choose the weights of the basket is market-cap weighted in line with the the theoretical definition of market portfolio. However, it's not clear what your goal is to &quot;select weights of the basket&quot;. You correctly point out that you would simply be identifying a portfolio with pure exposure to systematic risk where idiosyncratic risk is diversified away.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-04-09T00:33:50.110" LastActivityDate="2012-04-09T00:33:50.110" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2683" PostTypeId="2" ParentId="2678" CreationDate="2011-12-30T17:04:38.017" Score="2" Body="&lt;p&gt;It is common for the Bid (and sometimes the average of the Bid/Ask) price of deep in the money options to be below the Intrinsic Price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Download some data and try it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cboe.com/delayedquote/QuoteTableDownload.aspx&quot; rel=&quot;nofollow&quot;&gt;http://www.cboe.com/delayedquote/QuoteTableDownload.aspx&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="392" LastActivityDate="2011-12-30T17:04:38.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2684" PostTypeId="1" AcceptedAnswerId="2686" CreationDate="2011-12-31T00:27:21.740" Score="9" ViewCount="371" Body="&lt;p&gt;I have an intraday equity returns linear model that, overall, shows good values in terms of $R^2$, p-value and other explained variance statistics. Around 70% of the stocks show consistent R-squared (in the range of 5% explained) and significance parameters, but the remaining 30% have degraded $R^2$ and p-values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would it help to include beta, liquidity and sector returns in the model to have a more consistent $R^2$ across all stocks?&lt;/p&gt;&#xA;" OwnerUserId="1791" LastEditorUserId="1106" LastEditDate="2012-01-03T16:25:03.793" LastActivityDate="2012-01-03T16:28:14.117" Title="How to improve the consistency of explained variance statistics in a linear equity model?" Tags="&lt;equities&gt;&lt;statistics&gt;&lt;modeling&gt;&lt;regression&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2685" PostTypeId="1" AcceptedAnswerId="2702" CreationDate="2011-12-31T00:44:58.937" Score="10" ViewCount="7001" Body="&lt;p&gt;How does an &lt;a href=&quot;http://en.wikipedia.org/wiki/Option_time_value&quot;&gt;option's time value&lt;/a&gt; (also known as &lt;em&gt;extrinsic&lt;/em&gt; or &lt;em&gt;instrumental&lt;/em&gt; value) depend on how far it is in the money or out of the money?  In other words, how does the time value change as the underlying price changes?&lt;/p&gt;&#xA;" OwnerUserId="703" LastEditorUserId="1106" LastEditDate="2012-01-05T18:24:34.673" LastActivityDate="2012-01-06T04:27:50.537" Title="How does an option's time value depend on moneyness?" Tags="&lt;options&gt;&lt;option-pricing&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2686" PostTypeId="2" ParentId="2684" CreationDate="2011-12-31T02:52:57.670" Score="5" Body="&lt;p&gt;Since you mention beta, I assume you're familiar with the &lt;a href=&quot;http://en.wikipedia.org/wiki/Capital_asset_pricing_model&quot;&gt;capital asset pricing model&lt;/a&gt; (CAPM). The concept is that an asset's expected returns are linearly correlated with the market's returns. Of course, there are other ways &quot;normalize&quot; returns, as you put it. We can extend CAPM with &lt;a href=&quot;http://en.wikipedia.org/wiki/Fama%E2%80%93French_three-factor_model&quot;&gt;Fama-French&lt;/a&gt;, which adds market cap and relative value to the equation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Within the realm of &lt;a href=&quot;http://en.wikipedia.org/wiki/Statistical_arbitrage&quot;&gt;statistical arbitrage&lt;/a&gt;, sector-neutrality is very common. Stocks are compared with their sector or industry peers. An added dimension is region or country affiliation, if you were to trade globally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then there's &lt;a href=&quot;http://en.wikipedia.org/wiki/Arbitrage_pricing_theory&quot;&gt;arbitrage pricing theory&lt;/a&gt; (APT), which defines an asset's price in terms of numerous possible factors. I wouldn't call it &quot;state of the art&quot;, but it takes a more realistic view of fair value. You'll need to define your own factors, which you can cull through either fundamental analysis or principal component analysis. You can also buy commercial &lt;strong&gt;risk models&lt;/strong&gt; from numerous vendors. In this case, you may find yourself balancing stocks within the portfolio according to their exposure to things like interest rates or the price of oil.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2011-12-31T02:52:57.670" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2688" PostTypeId="2" ParentId="2684" CreationDate="2011-12-31T10:16:52.667" Score="3" Body="&lt;p&gt;When trying to predict returns, I think you should never look at in-sample statistics like R-squared.  Only look at out-of-sample prediction results.  Cross validation is a useful tool in at least the initial phase of modelling.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition to over-enthusiasm, in-sample statistics easily lead to overfitting: &lt;a href=&quot;http://www.portfolioprobe.com/2011/03/28/the-devil-of-overfitting/&quot; rel=&quot;nofollow&quot;&gt;http://www.portfolioprobe.com/2011/03/28/the-devil-of-overfitting/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="249" LastActivityDate="2011-12-31T10:16:52.667" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2689" PostTypeId="1" AcceptedAnswerId="2699" CreationDate="2011-12-31T16:40:18.627" Score="8" ViewCount="1879" Body="&lt;p&gt;I am interested in doing some research on plain vanilla equity options and equity index options. I have historical data for these options. I also happen to have market maker 'fair price' (bid and ask) for SOME strikes for these options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to 'backfill' the missing 'fair prices' for the strikes for which there is no data. There are two exercise types for the options data I have - US and Euro(pean). For the Euro style options, I will be using a simple BS model, for the US style options, I will be using a Binomial model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To summarize, this is what I have:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Historical bid/ask prices for all (liquid) strikes and maturities&lt;/li&gt;&#xA;&lt;li&gt;MM 'fair value' bid/ask values for &lt;strong&gt;SOME&lt;/strong&gt; of the available strikes and maturities&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;What I want/need&lt;/p&gt;&#xA;&#xA;&lt;p&gt;MM 'fair value' bid/ask values accross &lt;strong&gt;ALL&lt;/strong&gt; of the available strikes and maturities&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the data that I have, how can I best 'backfill' the missing 'fair value' bid/ask prices?, so that I have 'fair value' bid/ask prices for all strikes and maturities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A practical note worth pointing out: I can estimate historical volatility of the underlying if need be (for the BSM), but I will not have access to prevailing rates, dividend yields (and all the other 'niceties' required by some models).&lt;/p&gt;&#xA;" OwnerUserId="1733" LastActivityDate="2012-01-03T02:55:18.587" Title="How to 'calibrate' simple pricing models for equity index options and equity options?" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;modeling&gt;&lt;calibration&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2691" PostTypeId="1" CreationDate="2012-01-02T01:05:38.427" Score="8" ViewCount="1070" Body="&lt;p&gt;Obviously, strategies like &quot;short everything&quot; did well during this period, but getting the future right is one thing and having a robust strategy is another.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular, many quantitative strategies rely on a lot of statistical and historical assumptions. The line usually goes &quot;well of course they're wrong but they work&quot;. But during 2008, many did not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What quantitative strategies and approaches were successful through 2008, and why?&lt;/p&gt;&#xA;" OwnerUserId="1758" LastEditorUserId="70" LastEditDate="2012-01-03T13:24:16.357" LastActivityDate="2012-01-05T01:27:04.993" Title="What quantitative strategies were successful through the 2008 crisis?" Tags="&lt;quant-trading-strategies&gt;&lt;finance&gt;&lt;big-list&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2692" PostTypeId="1" CreationDate="2012-01-02T17:30:21.203" Score="12" ViewCount="4700" Body="&lt;p&gt;According to my understanding the derivation of the Black-Scholes PDE is based on the assumption that the price of the option should change in time in such a way that it should be possible to construct such a self-financing portfolio whose price replicates the price of the option (within a very small time interval). And my question is: Why do we assume that the price of the option has this property?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will explain myself in more details. First, we assume that the price of a call option $C$ depends on the price of the underlying stock $S$ and time $t$. Then we use the Ito's lemma to get the following expression:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d C = (\frac{\partial C}{\partial t} + S\mu\frac{\partial C}{\partial S} + \frac{1}{2}S^2 \sigma^2 \frac{\partial^2C}{\partial S^2}) dt + \sigma S \frac{\partial C}{\partial S} dW$ (1) ,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\mu$ and $\sigma$ are parameters which determine the time evolution of the stock price:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS = S(\mu dt + \sigma dW)$ (2) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we construct a self-financing portfolio which consist of $\omega_s$ shares of the underlying stock and $\omega_b$ shares of a bond. Since the portfolio is self financing, its price $P$ should change in this way:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dP(t) = \omega_s dS(t) + \omega_b dB(t)$. (3)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we require that $P=C$ and $dP = dC$. It means that we want to find such $\omega_s$ and $\omega_b$ that the portfolio has the same price that the option and its change in price has the same value as the change in price of the option. OK. Why not? If we want to have such a portfolio, we can do it. The special requirements to its price and change of its price should fix its content (i.e. the requirement should fix the portion of the stock and bond in the portfolio ($\omega_s$ and $\omega_b$)).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we substitute (2) in (3), and make use of the fact that $dB = rBdt$ we will get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{\partial C}{\partial t} + S\mu\frac{\partial C}{\partial S} + \frac{1}{2}S^2 \sigma^2 \frac{\partial^2C}{\partial S^2} = \omega_s S \mu + \omega_b r B$ (4)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma S \frac{\partial C}{\partial S} = \omega_s S \sigma$ (5)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From last equation we can determine $\omega_s$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\omega_s = \frac{\partial C}{\partial S}$ (6)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, we know the portion of the stock in the portfolio. Since we also know the price of the portfolio (it is equal to the price of the option), we can also determine the portion of the bond in the portfolio ($\omega_b$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if we substitute the found $\omega_s$ and $\omega_b$ into the (4) we will get an expression which binds $\frac{\partial C}{\partial t}$, $\frac{\partial C}{\partial S}$, and $\frac{\partial^2 C}{\partial S^2}$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{\partial C}{\partial t} + rS \frac{\partial C}{\partial S} + \frac{1}{2} \sigma^2 S^2 \frac{\partial^2 C}{\partial S^2} = rC$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is nothing but the Black-Scholes PDE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I do not understand is what requirement binds the derivatives of $C$ over $S$ and $t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, we apply certain requirements (restrictions) to our portfolio (it should follow the price of the option). As a consequence, we restrict the content of our portfolio (we fix $\omega_s$ and $\omega_b$). But we do not apply any requirements to the price of the option. Well, we say that it should be a function of the $S$ and $t$. As a consequence, we got the equation (1). But from that we will not get any relation between the derivatives of $C$. We, also constructed a replicating portfolio, but why its existence should restrict the evolution of the price of the option?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks to me that the requirement that I am missing is the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The price of the option should depend on $S$ and $t$ in such a way that it should be possible to create a self-financing portfolio which replicates the price of the option.&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I right? Do we have this requirement? And do we get the Black-Scholes PDE from this requirement? If it is the case, can anybody, please, explain where this requirement comes from.&lt;/p&gt;&#xA;" OwnerUserId="981" LastEditorUserId="467" LastEditDate="2012-01-03T08:50:03.530" LastActivityDate="2012-01-06T09:48:56.753" Title="Why a self-financing replicating portfolio should always exist?" Tags="&lt;black-scholes&gt;&lt;derivatives&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2693" PostTypeId="1" CreationDate="2012-01-02T18:10:38.693" Score="4" ViewCount="378" Body="&lt;p&gt;I want to backtest several basic optimization methods (e.g. MVO, &quot;most-diversified portfolio&quot;), and I want to do this on a basket of different asset indexes.  To start with, I want to simulate a 60/40 portfolio (will use this as a benchmark).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What price series should I use, in particular, for bonds?  I want to use a free, open source of data, which usually means getting data off of Yahoo! or FRED.  I want a long history, back to the 80's if possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have an example of R code to fetch a good equity and bond portfolio and show the performance of a 60/40 portfolio?  &lt;/p&gt;&#xA;" OwnerUserId="658" LastEditorUserId="1106" LastEditDate="2012-01-03T15:33:58.573" LastActivityDate="2012-01-03T15:43:42.333" Title="Which indices to use for an equity vs. fixed-income portfolio simulation?" Tags="&lt;data&gt;&lt;backtesting&gt;&lt;asset-allocation&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2694" PostTypeId="1" AcceptedAnswerId="2696" CreationDate="2012-01-02T20:36:00.680" Score="3" ViewCount="494" Body="&lt;p&gt;I hope this is an appropriate question for this forum... for me it is an obvious query since it intrigues me for a long time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ok, assume there are 2 distinct classes of models: econometric (AR, MA, ARIMA, ARCH, GARCH, EGARCH, TGARCH, ...) and neural networks (MLP, RBF, BPTT, TDNN, Elman, NARX, ..., I'm putting even SVM and SVR into this group).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know it is a broad subject - depends on the market, assets, for a start... but under what conditions one is better than the other? Is there a general consensus over this? In terms of MSE, R&lt;sup&gt;2&lt;/sup&gt;, accuracy and so on? Is it fare to compare them? Does it make sense?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've seen many studies doing this kind of comparison, &lt;a href=&quot;http://www.eurojournals.com/irjfe_49_15.pdf&quot; rel=&quot;nofollow&quot;&gt;here is an example&lt;/a&gt; (sorry for this being biased towards one side). But none summarizing previous conclusions on this topic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, what is your experience with both of them? Do you have other articles running this kind of test (even if not published)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance, DBS.&lt;/p&gt;&#xA;" OwnerUserId="1519" LastEditorUserId="1519" LastEditDate="2012-01-02T20:42:46.177" LastActivityDate="2012-01-02T22:43:44.520" Title="Econometric vs ANN models for forecast?" Tags="&lt;forecasting&gt;&lt;econometrics&gt;&lt;neural-networks&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2695" PostTypeId="2" ParentId="2693" CreationDate="2012-01-02T22:38:33.827" Score="2" Body="&lt;p&gt;On the bond side, perhaps the yield on the 10-year constant maturity series available at the St. Louis Federal Reserve (FRED website).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the equities side, S&amp;amp;P 500 or a global index such as MSCI are good but you might not have history thru the early 80s on the latter.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2012-01-02T22:38:33.827" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2696" PostTypeId="2" ParentId="2694" CreationDate="2012-01-02T22:43:44.520" Score="6" Body="&lt;p&gt;They are not mutually exclusive. For example, the class you refer to as &quot;econometric&quot; are simply linear regression models that include as factors prior returns or residuals of the return series sometimes with weightings on the observations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could easily design a neural network with no hidden layers and the same inputs. So each of the econometric models are special cases of neural network models. Neural Networks offer a broader class of modeling options although for the same reason they are more difficult to train and avoid overfitting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the paper, the authors are not comparing neural networks &lt;em&gt;as a class&lt;/em&gt; to the econometric models. They are comparing a very specific neural network configuration to traditional time-series models.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2012-01-02T22:43:44.520" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2697" PostTypeId="1" AcceptedAnswerId="2858" CreationDate="2012-01-02T23:03:25.183" Score="2" ViewCount="347" Body="&lt;p&gt;I am curious about possibilities and theory here. Basically a &quot;problem&quot; with trying to get large positions is that it would move the market in the direction that you are loading up on, therefore making unloading of the position relatively unprofitable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But lets say your aim was to get a large share position, without placing a large bid. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In theory, couldn't an accumulation/distribution algorithm be used grab as many shares as you want undetected by market makers who would OTHERWISE move the bid after seeing the new demand. At the same time you could by buying options pretty cheaply in comparison, with the sole intent of exercising them after market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.interactivebrokers.com/en/trading/orders/accumulatedistribute.php&quot; rel=&quot;nofollow&quot;&gt;http://www.interactivebrokers.com/en/trading/orders/accumulatedistribute.php&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And then after having that large position, you could unload it as one single order knocking out an entire side of the tape. Useful for shaking out leveraged shorts in a squeeze or breaking down a support level in the other direction, because your opinion on price discovery is different than everyone else's - of course.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am curious about what other roadblocks exist to this scenario, that accumulation/distribution can easily get someone a large random volume weighted average price at the same price levels.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming you had that much capital at your disposal, this is pretty possible yes? I am assuming that without an accumulation/distribution algorithm this would be nearly impossible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;b&gt;I'm not looking for opinions about this level of advantage over other market participants&lt;/b&gt;, I am looking for theory.&lt;/p&gt;&#xA;" OwnerUserId="1453" LastActivityDate="2012-01-30T23:38:21.423" Title="accumulation/distribution and options to create excessive position to hit the tape with later" Tags="&lt;market&gt;&lt;algorithm&gt;&lt;market-making&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2698" PostTypeId="2" ParentId="2691" CreationDate="2012-01-03T01:04:18.457" Score="5" Body="&lt;p&gt;One simple way to approach this question is to look at what quantitative hedge funds did well during the crisis, and try to understand what strategies they employed.  As an example, you can look at the &lt;a href=&quot;http://s.wsj.net/public/resources/documents/TOP100-HEDGE-FUNDS-BA-100524.pdf&quot;&gt;Barron's 100 from 2009&lt;/a&gt;.  The top performing fund was RenTech's Medallion.  Their strategy is not publicly known.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There were only two broad hedge fund strategies that did well: short-bias and managed futures.  Many Global Macro firms also performed well (e.g. Soros), although they are less coherent as a category (and are typically not strictly quant).  Short-bias did well because this category must stay net short equities; as a category, this isn't primarily associated with quantitative strategies.  Managed futures is the largest systematic category that performed very well during the crisis.  This strategy is associated with trend following in the futures markets.  You can see many of the largest managed futures funds in the Barron's list, including BlueCrest, Graham, and Two Sigma.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another category that performed quite well during the crisis is short-term systematic traders, including high-frequency traders.  There are several examples in the Barron's 100 as well, such as QIM and Roy Niederhoffer (also have a look at the performance of the &quot;Short-Term Traders Index&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most of these general categories have not performed as well since the crisis, which is why they are often viewed as hedges (insurance) more than absolute return funds.&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="17" LastEditDate="2012-01-03T01:14:17.987" LastActivityDate="2012-01-03T01:14:17.987" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2699" PostTypeId="2" ParentId="2689" CreationDate="2012-01-03T02:55:18.587" Score="1" Body="&lt;p&gt;The starting point for your analysis should be to convert all your options bid/ask prices to implied volatilities, which are the invariant (time-homogeneous, i.i.d.) process in your case.  Even though you do not have the dividend yield and other factors necessary to back out the implied volatility, so long as you use the same assumptions (and they are reasonable assumptions) when converting back from your interpolated implied volatilities to prices, it should not greatly affect the results.  However, you should test this assumption.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you've done that, your case is highly relevant and similar to one I asked about recently:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/q/2565/1106&quot;&gt;How to interpolate gaps in a time series using closely related time series?&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Note: I actually have not (yet) been able to attempt to apply some of the methods mentioned in that post, but they at least sound like some reasonable starting points.  Your case may differ slightly in that the gaps occur irregularly, making a calculation of the covariance between &quot;historical&quot; and &quot;market maker&quot; quotes more involved (but still not impossible).&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2012-01-03T02:55:18.587" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2700" PostTypeId="1" AcceptedAnswerId="3045" CreationDate="2012-01-03T03:58:58.997" Score="4" ViewCount="2784" Body="&lt;p&gt;&lt;strong&gt;Note: This question was written for the &lt;a href=&quot;https://quant.meta.stackexchange.com/q/254/1106&quot;&gt;weekly topic challenge&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many of you who deal with asset allocation will probably already be familiar with &lt;a href=&quot;http://www.mebanefaber.com/timing-model/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Mebane Faber's Timing Model&lt;/a&gt;, based on one of SSRN's most popular papers of all time, &lt;a href=&quot;http://ssrn.com/abstract=962461&quot; rel=&quot;nofollow noreferrer&quot;&gt;A Quantitative Approach to Tactical Asset Allocation&lt;/a&gt;.  The crux of his approach is to apply the momentum approach to the decision of when to switch between major asset classes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are some of the other major contributions to market timing?  What other approaches do they use?&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="-1" LastEditDate="2017-03-16T15:46:50.533" LastActivityDate="2012-06-12T18:58:53.273" Title="What are some of the major quantitative approaches to tactical asset allocation?" Tags="&lt;research&gt;&lt;asset-allocation&gt;&lt;tactical-asset-allocation&gt;" AnswerCount="3" CommentCount="5" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="2701" PostTypeId="2" ParentId="2453" CreationDate="2012-01-03T13:09:55.393" Score="1" Body="&lt;p&gt;Further to my comments to Samik R's answer above, &lt;a href=&quot;http://dekalogblog.blogspot.com/2012/01/creating-synthetic-data-using-fast.html&quot; rel=&quot;nofollow&quot;&gt;here is the link&lt;/a&gt; to my blog post where my attempts to recreate the method linked to in said answer are given. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit to include more information per Tal Fishman's comment&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Octave .oct function code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#include &amp;lt;octave/oct.h&amp;gt;&#xA;#include &amp;lt;octave/dColVector.h&amp;gt;&#xA;#include &amp;lt;octave/CNDArray.h&amp;gt;&#xA;#include &quot;MersenneTwister.h&quot;&#xA;&#xA;DEFUN_DLD (permute_vector, args, , &quot;Input is a vector that is to be permuted once&quot;)&#xA;{&#xA;octave_value_list retval;&#xA;&#xA;int nargin = args.length () ;&#xA;int vec_length = args(0).length () ;&#xA;&#xA;// check the input arguments&#xA;    if ( nargin &amp;gt; 1 )&#xA;    {&#xA;    error (&quot;Invalid arguments. Input is a vector that is to be permuted once&quot;) ;&#xA;    return retval ;&#xA;    }&#xA;&#xA;    if (vec_length &amp;lt; 2 )&#xA;    {&#xA;    error (&quot;Invalid arguments. Input is a vector that is to be permuted once&quot;) ;&#xA;    return retval ;&#xA;    }&#xA;&#xA;    if (error_state)&#xA;    {&#xA;    error (&quot;Invalid arguments. Input is a vector that is to be permuted once&quot;) ;&#xA;    return retval ;&#xA;    }&#xA; // end of input checking&#xA;&#xA; ComplexNDArray input_vector = args(0).complex_array_value () ;&#xA; ComplexNDArray output_vector = args(0).complex_array_value () ;&#xA; int k1;&#xA; int k2;&#xA;&#xA; MTRand mtrand1; // Declare the Mersenne Twister Class - will seed from system time&#xA;&#xA;       k1 = vec_length - 1; // initialise prior to shuffling the vector&#xA;&#xA;       while (k1 &amp;gt; 0) // While at least 2 left to shuffle&#xA;         {          &#xA;         k2 = mtrand1.randInt( k1 ); // Pick an int from 0 through k1 &#xA;&#xA;           if (k2 &amp;gt; k1) // check if random vector index no. k2 is &amp;gt; than max vector    index - should never happen &#xA;              {&#xA;              k2 = k1 - 1; // But this is cheap insurance against disaster if it does happen&#xA;              }&#xA;&#xA;         output_vector(k1) = input_vector(k2) ; // allocate random pick k2 from input_vector to the k1 vector index of output_vector&#xA;         input_vector(k2) = input_vector(k1) ; // replace random pick k2 content of input_vector with content k1 of input_vector&#xA;         k1 = k1 - 1; // count down &#xA;         } // Shuffling is complete when this while loop exits&#xA;&#xA; retval(0) = output_vector ; &#xA;&#xA;return retval; // Return the output to Octave&#xA;} &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Octave script code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;clear all&#xA;&#xA;contract = input( &quot;Enter contract symbol e.g. sp: &quot;,&quot;s&quot;) ;&#xA;data = load(&quot;-ascii&quot;,contract) ;&#xA;n = rows(data)&#xA;index_begin = input( &quot;Enter index_begin: &quot;) ;&#xA;index_end = input( &quot;Enter index_end, value not greater than n: &quot;) ;&#xA;&#xA;close = data(index_begin:index_end,7) ;&#xA;&#xA;% detrend the close vector prior to applying the fft&#xA;slope = ( close(end) - close(1) ) / ( length(close) - 1 ) ;&#xA;v1 = (0:1:length(close)-1)' ;&#xA;detrended_close = close .- ( v1 .* slope ) ;&#xA;close_index_begin = close(1)&#xA;detrended_close_index_begin = detrended_close(1)&#xA;detrended_close_index_end = detrended_close(end)&#xA;&#xA;% create zero padded vector for fft&#xA;L2 = 2^nextpow2( length(close) ) ; half_L2 = L2/2 ;&#xA;y2 = zeros( 1,L2 ) ; y2( 1:length(close) ) = detrended_close ;&#xA;&#xA;% apply the fft&#xA;transform = fft( y2 ) ;&#xA;&#xA;% permute the first half of the transform vector in &quot;chunks&quot; of 10&#xA;max_ii_value = floor( half_L2 / 10 ) ;&#xA;for ii = 1:max_ii_value&#xA;transform( (ii*10):(ii*10)+9 ) = permute_vector( transform( (ii*10):(ii*10)+9 ) ) ;&#xA;endfor&#xA;&#xA;% take the inverse fft&#xA;ifft_vec = real( ifft( transform ) ) ;&#xA;&#xA;% retrend the ifft_permuted_vec&#xA;retrended_ifft_vec = ifft_vec( 1:length(close) )' .+ ( v1 .* slope ) ;&#xA;&#xA;% statistics&#xA;correl = corrcoef (close, retrended_ifft_vec)&#xA;spear = spearman (close, retrended_ifft_vec)&#xA;tau = kendall (close, retrended_ifft_vec)&#xA;&#xA;plot( close,'b',retrended_ifft_vec,'r' ) ; legend( 'close','permute' ) ; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;More information and charts in my blog post.&lt;/p&gt;&#xA;" OwnerUserId="252" LastEditorUserId="252" LastEditDate="2012-01-03T20:22:37.637" LastActivityDate="2012-01-03T20:22:37.637" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2702" PostTypeId="2" ParentId="2685" CreationDate="2012-01-03T13:58:53.243" Score="9" Body="&lt;p&gt;By definition, an option's premia is the sum of intrinsic value and time value. The time value of premia declines as the option goes more ITM (&quot;in-the-money&quot;) or OTM (&quot;out-of-the-money&quot;), ceteris paribus. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An intuitive explanation for this can be found by thinking of time value as the expected P&amp;amp;L of a long option position dynamically hedged by going short (long) Delta units of a call (put). Delta is the sensitivity of the option premia to the price of the underlying. It is a value between 0 and 1 and increases with moneyness. Delta of an ATM (&quot;at-the-money&quot;) option is approximately 0.5. Suppose that you are long 100 ATM calls struck at X and delta-hedged by being short 50 units of the underlying at price S=X. If S goes up to S', your option is ITM and delta goes up as well--let's say to 0.6. Now, to be hedged, you have to sell 10 more units of the underlying at S'. Now suppose that the price goes back from S' to S. Delta decreases back to 0.5 and you have to buy back 10 units of the underlying to be hedged again. You have made a S' - S profit on 10 units by holding a market neutral position. Over the interval of time between re-hedges, your delta-hedged position gets long in an up market and short in a down market, and as you re-hedge you are realising little profits from the re-hedges as the underlying goes up and down in price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a valuable property to have in a position that by construction takes no market risk. But there is no free lunch, and time value can be thought of as the price you have to pay in order to have exposure to this delta-hedging P&amp;amp;L over the life of your option position. (It is also why time value increases the more volatile the market expects the underlying to be--Implied Volatility--and time value erodes as the option's expiry gets closer. The sensitivity of option's premia--and therefore time value--to those two factors are called Vega and Theta, but that is another discussion.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So why does time value decline the more ITM or OTM the option is? The reason is that the change in Delta given a change in underlying price is not linear, but is rather a convex function of price. The change in delta is greatest when the option is ATM, but as the option goes more and more ITM (OTM), Delta gets closer and closer to 1 (0) and the changes in Delta get smaller and smaller. Therefore, so do the little re-hedging profits and so does time value. Delta-hedging a deep ITM or OTM option doesn't generate much P&amp;amp;L for the simple reason that Delta doesn't change very much. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The sensitivity of Delta to a change in underlying price is called Gamma, and Gamma is the reason why time value is worth so little in very ITM option but worth allot in an ATM option. A more formal answer can be given to your question, but given the nature of the question, I hope that this intuitive sketch will be more illuminating. &lt;/p&gt;&#xA;" OwnerUserId="1861" LastEditorUserId="1861" LastEditDate="2012-01-05T12:05:56.290" LastActivityDate="2012-01-05T12:05:56.290" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2703" PostTypeId="2" ParentId="2693" CreationDate="2012-01-03T15:43:42.333" Score="1" Body="&lt;p&gt;The answer to your question largely depends upon how you will be using the results of your simulation.  I strongly believe that you should match the index you choose for simulation as closely as possible to the actual mix of stocks and bonds in which you will ultimately be investing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having said that, the most popular indices for these asset classes are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Equity&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Russell 1000 - US large + mid cap - data since 1979&lt;/li&gt;&#xA;&lt;li&gt;Russell 3000 - US all cap - data since 1979&lt;/li&gt;&#xA;&lt;li&gt;MSCI USA/EAFE/World - International country/regional indices - data since 1970&lt;/li&gt;&#xA;&lt;li&gt;S&amp;amp;P 500 - US large cap - data since 1950s or earlier (backfilled)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Fixed Income&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Lehman/Barclays US Treasury - data since 1973&lt;/li&gt;&#xA;&lt;li&gt;Lehman/Barclays US Corporate - data since 1973&lt;/li&gt;&#xA;&lt;li&gt;Lehman/Barclays US Aggregate - data since 1976&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'm not sure where to get these data for free, but you should be able to get a monthly returns series at relatively low cost.  See our &lt;a href=&quot;https://quant.stackexchange.com/q/141/1106&quot;&gt;data question&lt;/a&gt; for suggestions and leads.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2012-01-03T15:43:42.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2704" PostTypeId="2" ParentId="2684" CreationDate="2012-01-03T16:28:14.117" Score="1" Body="&lt;p&gt;I suggest you look for common characteristics amongst the 70% of stocks with decent $R^2$ and the 30% with a degraded in-sample fit.  If you find that all the stocks that fit your model best were in one industry and all those that didn't fit were in another industry, then it may be that your model is actually picking up an industry effect.  Controlling for sector/industry explicitly as part of your model, whether by imposing sector neutrality in the weights for a hypothetical backtest portfolio or by including it as an additional factor in the linear model, may reveal what is really going on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short, these models can be quite complicated, and there is no shortcut around doing the dirty work and looking in depth at a lot of specific cases to learn more about what your model is really doing.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2012-01-03T16:28:14.117" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2705" PostTypeId="1" AcceptedAnswerId="2727" CreationDate="2012-01-03T18:18:11.743" Score="8" ViewCount="1137" Body="&lt;p&gt;The classic &lt;a href=&quot;http://en.wikipedia.org/wiki/Modern_portfolio_theory&quot; rel=&quot;noreferrer&quot;&gt;mean-variance&lt;/a&gt; optimization problem tries to minimize variance of a portfolio for a given expected return:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \underset{w}{\arg \min} \quad w^T \Sigma w \quad \text{s.t} \quad \mu^Tw \geq \bar{\mu} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However the expected returns $\mu$ are can be computed in many different ways, but many use very subjective estimations. The problem is that the result of the optimization is very sensitive to these expected returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What asset allocation strategies exist where the expected returns are removed from the framework or where the sensitivity of the result (to changes in expected returns) is limited?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the &quot;min-variance&quot; optimization removes the expected returns by return only the portfolio with minimum variance as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \underset{w}{\arg \min} \quad w^T \Sigma w$$&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2012-01-03T18:40:32.333" LastActivityDate="2012-12-22T18:46:00.570" Title="How do you remove expected returns from asset allocation strategies?" Tags="&lt;asset-allocation&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="2706" PostTypeId="1" AcceptedAnswerId="2709" CreationDate="2012-01-03T18:53:22.273" Score="5" ViewCount="182" Body="&lt;p&gt;&lt;strong&gt;Note: This question was written for the &lt;a href=&quot;https://quant.meta.stackexchange.com/q/254/1106&quot;&gt;weekly topic challenge&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many asset allocation funds presume the investor knows his target risk level, typically on some spectrum from conservative (mostly G7 fixed income) to aggressive (mostly equities, commodities, emerging markets).  Other types of asset allocation funds, known as target date funds, continuously vary the risk exposure as a function of age, or years left until retirement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Besides deep introspection (e,g, answering questions such as &quot;do you lay awake at night thinking about your investments?&quot;), how can one figure out his risk tolerance?  What advice can we offer to clients as to what their target risk level should be beyond simple rules of thumb such as &quot;invest a percentage of assets in low risk assets equal to your age&quot; or &quot;60% equity / 40% fixed income for all working age adults&quot;?  Is anyone familiar with quantitative work on measuring &quot;optimal&quot; risk tolerance as a function of other life circumstances, such as expected future income, current savings (both liquid investments and illiquid assets such as housing), expected future expenses (e.g. children's schooling), etc?  Even empirical work, measuring observed risk tolerances as a function of these characteristics, may be hugely beneficial (wisdom of crowds).&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="-1" LastEditDate="2017-03-16T15:46:50.533" LastActivityDate="2012-01-03T19:09:33.003" Title="Are there quantitative models which can guide one's choice of target risk?" Tags="&lt;risk&gt;&lt;research&gt;&lt;asset-allocation&gt;&lt;funds&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2707" PostTypeId="1" AcceptedAnswerId="2754" CreationDate="2012-01-03T18:58:50.850" Score="32" ViewCount="4852" Body="&lt;p&gt;Usually in asset allocation you have a quantitative approach (which can be from example mean-variance), but you (or you and your firm) also have a more qualitative approach given market-conditions, economic outlooks, or tactical indicators.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, you will eventually come up with 2 allocations, the ones strictly dictated by the numbers $w^*$ which is the result of your quantitative algorithm and the one you have in mind from your personal expectations $\bar{w}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are common the ways $f$ to mix them together such that $w=f(w^*,\bar{w})$ is your &quot;final&quot; allocation?&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2012-12-14T01:06:57.860" Title="How do you mix quantitative asset allocation with qualitative views?" Tags="&lt;asset-allocation&gt;" AnswerCount="3" CommentCount="12" FavoriteCount="47" ContentLicense="CC BY-SA 3.0" />
  <row Id="2708" PostTypeId="2" ParentId="2685" CreationDate="2012-01-03T19:04:54.250" Score="-6" Body="&lt;p&gt;The options value is dependent on the moneyness of the option. Taking the partial derivative of Theta w.r.t. term S/K (whole term) will give the sensitivity of Theta to moneyness.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;S/K is the moneyness.&lt;/p&gt;&#xA;" OwnerUserId="909" LastEditorUserId="909" LastEditDate="2012-01-06T04:27:50.537" LastActivityDate="2012-01-06T04:27:50.537" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2709" PostTypeId="2" ParentId="2706" CreationDate="2012-01-03T19:09:33.003" Score="1" Body="&lt;p&gt;I believe a nice way to discuss this is to set up a questionnaire which would put them in a situation where they have to make choices between different types of investments (which are abstract) in order to estimate their risk aversion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, you ask the people whether they prefer an investment making +10% (80% of the time) and -25% the rest of the time or something making +5%/-5% with equal probability. You repeat the experience with different magnitude and different signs (sometimes both are positive, sometime both are negative).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By looking at the results, you should be able to determine whether the person is risk-averse or not (essentially by estimating how much they discount &quot;risky&quot; investment), and also if they are sensible to the directions of the trade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not have any formal research about this, but that's the way I'd go. I could also suggest taking an initial amount of money corresponding to the wealth of the person being tested and speaking in terms of resulting amounts, not percentages.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2012-01-03T19:09:33.003" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2710" PostTypeId="1" AcceptedAnswerId="2781" CreationDate="2012-01-03T19:32:25.880" Score="19" ViewCount="4315" Body="&lt;p&gt;This is a question responding to &lt;a href=&quot;https://quant.meta.stackexchange.com/questions/254/weekly-topic-challenge-for-the-week-of-january-1-2012-asset-allocation&quot;&gt;weekly topic challenge&lt;/a&gt;. I happen to see an interesting question from &lt;a href=&quot;http://www.linkedin.com/groups/SYMMYS-Advanced-Risk-Portfolio-Management-3825142&quot; rel=&quot;noreferrer&quot;&gt;SYMMYS&lt;/a&gt; by Michael Kapler. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I always approached expected return and risk modeling as separate&#xA;  problems. Could you please point me to the literature that supports or&#xA;  contradicts this approach. &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;For example of the expected returns factor model, please see the&#xA;  Commonality In The Determinants Of Expected Stock Returns by R.&#xA;  Haugen, N. Baker (1996) (&#xA;  &lt;a href=&quot;http://www.quantitativeinvestment.com/documents/common.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.quantitativeinvestment.com/documents/common.pdf&lt;/a&gt; ) The up to&#xA;  date model performance is presented at Haugen Custom Financial&#xA;  Systems. (&lt;a href=&quot;http://www.quantitativeinvestment.com/models.aspx&quot; rel=&quot;noreferrer&quot;&gt;http://www.quantitativeinvestment.com/models.aspx&lt;/a&gt; ) &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;For example of the risk (covariance matrix) factor model, please see&#xA;  MSCI Barra Equity Multi-Factor Models (&#xA;  &lt;a href=&quot;http://www.msci.com/products/portfolio_management_analytics/equity_models/&quot; rel=&quot;noreferrer&quot;&gt;http://www.msci.com/products/portfolio_management_analytics/equity_models/&lt;/a&gt;)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I wonder how this community think about this question. &lt;/p&gt;&#xA;" OwnerUserId="1478" LastEditorUserId="-1" LastEditDate="2017-03-16T15:46:50.533" LastActivityDate="2012-01-16T20:33:03.667" Title="Why do expected return models and risk models use different factors?" Tags="&lt;portfolio-management&gt;&lt;asset-allocation&gt;&lt;factor-models&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="24" ContentLicense="CC BY-SA 3.0" />
  <row Id="2711" PostTypeId="2" ParentId="2710" CreationDate="2012-01-03T20:42:04.023" Score="12" Body="&lt;p&gt;I'll answer by way of example. Suppose I want to buy a stock that is &lt;em&gt;relatively cheap&lt;/em&gt;. Firstly, I need to define what is meant by &lt;em&gt;cheap&lt;/em&gt;, so I might choose to look at the price-to-earnings ratio. Then I need to define what is meant by &lt;em&gt;relative&lt;/em&gt;, so I might compare stocks only within a given sector.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This may work well at first, but then I notice that as I try to scale up, not all stocks follow their listed sectors at the same rate. So now I want to look for something other than just sector affiliation. Perhaps I start including &quot;exposure&quot; to the sector, kind of like a beta coefficient. So instead of saying that MSFT is a Technology stock, I can say that MSFT has a beta of $x$ to the cap-weighted Technology index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The beta to the index will give me a better explanation of a stock's &lt;em&gt;relative&lt;/em&gt; performance, but it doesn't explain all movement. Indeed, I might be better off ignoring sector affiliation and just look at macroeconomic metrics. XOM should have a high beta to the price of oil while BAC should have a high beta to interest rates. Perhaps an airline company has a high beta to both oil prices and interest rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So now I see that there can be multiple factors that define &lt;em&gt;relative&lt;/em&gt; performance, and each stock has a measurable exposure to these factors. It is these factors that constitute a &lt;strong&gt;risk model&lt;/strong&gt;. The factors can be picked through fundamental analysis or through principal component analysis. There are also a number of vendors that sell risk models, so a portfolio manager need not go through the trial and error if he doesn't have the expertise to do it himself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &lt;em&gt;relative&lt;/em&gt; finally defined, I can now focus on &lt;em&gt;cheap&lt;/em&gt;. My price-to-earning ratio isn't the only way to define value, so maybe I look at price-to-sales and price-to-book. Perhaps I want to see a change in these metrics, so I look for a stock whose earnings have recently risen faster than its price. I can look at other accounting scores, like profit margin or dividend yield. Eventually with all of these scores, I'll need to &quot;blend&quot; them somehow. (You'll note that this is the same problem the Bowl Championship Series has when it must determine who the best college football teams are in the US.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With my definition of &lt;em&gt;cheap&lt;/em&gt; in place, I now have my &lt;strong&gt;alpha model&lt;/strong&gt;. (The original question called this the &quot;return factor&quot;, but that's not common industry parlance.) Note that the term &quot;alpha&quot; refers to what gives a stock its excess return. This is in contrast to &quot;beta&quot;, which is a return that comes from an external source that applies to everyone.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The common source that is &quot;beta&quot; is often viewed as the market, but as explained above, there can be multiple external factors that move a stock. So to be more realistic, the &quot;beta&quot; actually comes from the &lt;strong&gt;risk model&lt;/strong&gt;. Therefore, the excess return (the &quot;alpha&quot;) must come from the &lt;strong&gt;alpha model&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So to answer the question of why &lt;strong&gt;alpha models&lt;/strong&gt; and &lt;strong&gt;risk models&lt;/strong&gt; are so different, it's because they measure two vastly different phenomenons. The &lt;strong&gt;risk model&lt;/strong&gt; explains what makes stocks alike, while the &lt;strong&gt;alpha model&lt;/strong&gt; explains what makes stocks different.&lt;/p&gt;&#xA;" OwnerUserId="35" LastEditorUserId="35" LastEditDate="2012-01-16T04:08:34.477" LastActivityDate="2012-01-16T04:08:34.477" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2713" PostTypeId="1" AcceptedAnswerId="2714" CreationDate="2012-01-04T00:57:51.390" Score="8" ViewCount="974" Body="&lt;p&gt;I am calculating betas on intraday trade data at 15-minute intervals. For simplicity sake, let's assume I am modeling&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;Y = \beta * X + c&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Y$ is the return of XLF and $X$ is the return of SPY.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I want to run this on five days of intraday data, should I remove the jump that happens due to opening gaps on the next day?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do you guys usually handle this jump in returns ? &lt;/p&gt;&#xA;" OwnerUserId="1696" LastEditorUserId="35" LastEditDate="2012-01-04T02:41:34.013" LastActivityDate="2012-01-04T17:13:40.843" Title="How to account for jumps in intraday data when calculating beta?" Tags="&lt;equities&gt;&lt;high-frequency&gt;&lt;modeling&gt;&lt;market-data&gt;&lt;beta&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2714" PostTypeId="2" ParentId="2713" CreationDate="2012-01-04T02:01:04.393" Score="6" Body="&lt;p&gt;I assume you're using &lt;em&gt;returns&lt;/em&gt; to compute beta, not the &lt;em&gt;prices&lt;/em&gt;. And yes, remove the &quot;jumps&quot;, though this should happen automatically since you're looking only at intraday returns. One final piece of advice: you'll get more meaningful results if you smooth the returns via a moving average.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2012-01-04T02:01:04.393" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2715" PostTypeId="2" ParentId="2713" CreationDate="2012-01-04T05:21:56.887" Score="3" Body="&lt;p&gt;In addition to the above I can suggest:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;ignore data point if returns are more than a certain threshold (2 s.d.)&lt;/li&gt;&#xA;&lt;li&gt;calculate at different sampling intervals and choose most stable beta with the best significance (certain longer intervals &quot;smooth out&quot; small to mid size jumps)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="909" LastActivityDate="2012-01-04T05:21:56.887" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2716" PostTypeId="2" ParentId="2710" CreationDate="2012-01-04T16:21:27.673" Score="6" Body="&lt;p&gt;My two cents - The risk models are used to &lt;strong&gt;explain&lt;/strong&gt; the &lt;strong&gt;variations&lt;/strong&gt; (volatility) while the alpha models try to &lt;strong&gt;forecast&lt;/strong&gt;  &lt;strong&gt;drifts&lt;/strong&gt; (mean). This explanation also works outside the framework of &lt;em&gt;relative&lt;/em&gt; valuation. &lt;/p&gt;&#xA;" OwnerUserId="1478" LastActivityDate="2012-01-04T16:21:27.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2717" PostTypeId="1" AcceptedAnswerId="2720" CreationDate="2012-01-04T16:51:07.527" Score="14" ViewCount="2053" Body="&lt;p&gt;Traditional portfolio optimization involves mean variance optimization, where only the mean and covariance matrix of returns are estimated. What asset allocation and portfolio optimization techniques make use of the higher order co-moments of the returns distribution?  Also, how would one compute the higher order matrices?&lt;/p&gt;&#xA;" OwnerUserId="909" LastEditorUserId="909" LastEditDate="2012-01-05T04:26:15.487" LastActivityDate="2012-09-07T02:53:24.003" Title="How can higher co-moments be applied to portfolio optimization in an asset allocation context?" Tags="&lt;optimization&gt;&lt;asset-allocation&gt;&lt;modern-portfolio-theory&gt;" AnswerCount="5" CommentCount="7" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2718" PostTypeId="2" ParentId="2713" CreationDate="2012-01-04T17:13:40.843" Score="1" Body="&lt;p&gt;You can run the regression separately for 5 days, and average the betas you get for different days.&lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2012-01-04T17:13:40.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2720" PostTypeId="2" ParentId="2717" CreationDate="2012-01-04T19:46:31.327" Score="6" Body="&lt;p&gt;The blog post &lt;a href=&quot;http://www.portfolioprobe.com/2011/10/03/predictability-of-kurtosis-and-skewness-in-sp-constituents/&quot;&gt;http://www.portfolioprobe.com/2011/10/03/predictability-of-kurtosis-and-skewness-in-sp-constituents/&lt;/a&gt; suggests that there is some predictability in kurtosis, but it isn't clear (to me at least) that there is enough predictabiilty to be useful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there is a place for higher moments, my guess is that it is in asset allocation problems where there are only a few assets rather than in equity portfolios.&lt;/p&gt;&#xA;" OwnerUserId="249" LastActivityDate="2012-01-04T19:46:31.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2721" PostTypeId="2" ParentId="2717" CreationDate="2012-01-04T20:13:13.030" Score="4" Body="&lt;p&gt;Yes, this is what the idea behind Omega as a portfolio optimization objective is all about.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keating and Shadwick (2002a, 2002b) first introduced this notion. An introduction by Keating is &lt;a href=&quot;http://finance.yendor.com/etfviz/2007/0928/Omega-intro.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, the &lt;a href=&quot;http://cran.r-project.org/web/packages/PerformanceAnalytics/index.html&quot; rel=&quot;nofollow&quot;&gt;Performance Analytics&lt;/a&gt; package in R includes a function to calculate Omega.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your second question, one can compute the moments of higher orders using &lt;a href=&quot;http://en.wikipedia.org/wiki/Moment_%28mathematics%29&quot; rel=&quot;nofollow&quot;&gt;linear algebra&lt;/a&gt;, although this is not computationally practical if you are optimizing a large portfolio on the order of say, 500 assets, since the terms required are approximately (excluding symmetries) N raised to the order of the moment where N is the number of assets (i.e. mean = N, standard deviation = N^2, skew = N^3 ...). I would suggest using the Omega function in Performance Analytics instead.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2012-01-04T20:13:13.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2722" PostTypeId="2" ParentId="2717" CreationDate="2012-01-04T22:18:32.137" Score="2" Body="&lt;p&gt;Morningstar recently came out with a piece entitled &lt;a href=&quot;http://morningstardirect.morningstar.com/clientcomm/iss/Tsai_Real_World_Not_Normal.pdf&quot; rel=&quot;nofollow&quot;&gt;The Real World is&#xA;Not Normal: Introducing the new frontier: an alternative to the mean-variance optimizer&lt;/a&gt;.  It essentially summarizes their views on Mean-CVaR optimization, based on Xiong and Idzorek (2011).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This research piece also contains their estimates for the first four moments (but does not list correlations, co-skewness, or co-kurtosis) for all the major asset classes typically considered in asset allocation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A Mean-CVaR Optimization will put much lower weight on investment grade bonds and hedge funds and much higher weight on international bonds, real estate, and small cap stocks.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2012-01-04T22:18:32.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2723" PostTypeId="2" ParentId="2717" CreationDate="2012-01-04T23:59:35.143" Score="5" Body="&lt;p&gt;Adding a bit to the references mentioned by &lt;em&gt;Quant Guy&lt;/em&gt; - apart from the aforementioned &lt;a href=&quot;http://www.isda.org/c_and_a/pdf/GammaPub.pdf&quot; rel=&quot;noreferrer&quot;&gt;paper&lt;/a&gt; by Keating and Shadwick, &lt;a href=&quot;http://faculty.fuqua.duke.edu/~charvey/Teaching/BA453_2006/Schneeweis_Omega_as_a.pdf&quot; rel=&quot;noreferrer&quot;&gt;Kazemi et al.&lt;/a&gt; introduce an alternative formulation of the Omega ratio (&lt;em&gt;Sharpe-Omega&lt;/em&gt;) similar to the Sharpe ratio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As noted by &lt;em&gt;Patrick Burns&lt;/em&gt;, higher moments could have some use when instruments other than equity are involved (hedge fund portfolios seem to be the most popular research topic: &lt;a href=&quot;http://www.fortigent.com/uploads/published_articles/07Monitor%20JulyAug%20Togher-Barsbay.pdf&quot; rel=&quot;noreferrer&quot;&gt;Togher &amp;amp; Barsbay&lt;/a&gt;, &lt;a href=&quot;http://www.performance-measurement.org/Favre-BullePache2003.pdf&quot; rel=&quot;noreferrer&quot;&gt;Favre-Bulle and Pache&lt;/a&gt;). However, you can also encounter some &lt;a href=&quot;http://www.ams.sunysb.edu/~frey/Research/Research/OmegaRatio/OmegaRatio.pdf&quot; rel=&quot;noreferrer&quot;&gt;skeptical views&lt;/a&gt; concerning the whole Omega ratio concept.&lt;/p&gt;&#xA;" OwnerUserId="38" LastActivityDate="2012-01-04T23:59:35.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2724" PostTypeId="2" ParentId="1658" CreationDate="2012-01-05T00:57:12.483" Score="0" Body="&lt;p&gt;The liquidity story is the one all hft use when asked what they actually give back to society and we've heard it all, there is just one more dimension that hasn't been discussed so far.&#xA;HFT has been expanding the last decade and the financial regulators haven't been able to catch up with the developments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The programs have inputs and generate an output based on those inputs. The most popular input is the price(change) itself and there are more like momentum for example. the output is a buy/sell. now we have a system where the output is effecting the input which shouldn't be a problem since one high frequency trader wont make a difference. However if you have thousands of these systems it does make a difference and now you have system interacting with each other.&#xA;According to the Securities and Exchange Commisson statement put out last year HFT had played a role in the may 6th flash crash.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Stability of financial markets is an important aspect to look in to if we are evaluating cost/benefit to society.    &lt;/p&gt;&#xA;" OwnerUserId="1835" LastEditorUserId="743" LastEditDate="2015-09-30T00:35:01.367" LastActivityDate="2015-09-30T00:35:01.367" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2725" PostTypeId="2" ParentId="2691" CreationDate="2012-01-05T01:27:04.993" Score="3" Body="&lt;p&gt;There are hedge funds out there that actually only make money when markets go down a lot. I think the strategies they use are what you are looking for and i must tell you i found it very interesting. There is this hedge fund called Universa, its run by Mark Spitznagel and advised by Nasim Tallib the writer of the book &quot;the Black Swan&quot;. &#xA;This hedge fund profits out of black swan events like the 2008 crash where he made a 100% return. &#xA;Spitznagel looks at the probability of the market falling for a certain percentage under several conditions, in his latest paper he looked at the Q ratio. what he did is he looked at the Q-ratio of the S&amp;amp;P500 companies in the last 110 years and for specific ranges of Q-ratios he looked at the left tail of the distribution of returns. he concluded the paper with a median and 20th percentile (99% conf. int.) return drawback of the S&amp;amp;P500 for the next three years.&#xA;Here is the paper:&#xA;&lt;a href=&quot;http://www.universa.net/UniversaSpitznagel_research_20110613.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.universa.net/UniversaSpitznagel_research_20110613.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1835" LastActivityDate="2012-01-05T01:27:04.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2726" PostTypeId="1" CreationDate="2012-01-05T01:33:57.147" Score="11" ViewCount="3103" Body="&lt;p&gt;I have always felt that equity market making was a speed game for HFTs. But recently I talked to someone on the buy side, who made a claim to the contrary. He argued that with the right market making model/strategy, you can generate good returns without having the speed advantage that HFTs have. He claims to be using a vendor product to make markets in equity.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I somehow find this hard to believe but I might be wrong. Any views on this? If this person is correct, are there any interesting research papers that would support this claim ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit: In addition, if speed is essential, what is the minimum latency needed to be effective at market making ? &lt;/p&gt;&#xA;" OwnerUserId="1696" LastEditorUserId="1696" LastEditDate="2012-01-08T03:11:22.923" LastActivityDate="2013-10-13T06:01:16.147" Title="Is equity market making a game of speed?" Tags="&lt;equities&gt;&lt;market-making&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2727" PostTypeId="2" ParentId="2705" CreationDate="2012-01-05T01:59:12.743" Score="11" Body="&lt;p&gt;There is a vast, growing body of literature on &lt;a href=&quot;http://en.wikipedia.org/wiki/Risk_parity&quot;&gt;&lt;em&gt;risk parity&lt;/em&gt;&lt;/a&gt;, much of which is predicated on this idea (i.e. of optimizing a portfolio allocation without including expected return).  As an example, &lt;em&gt;The Journal of Investing&lt;/em&gt; put out an entire issue dedicated to the subject last year: see &lt;a href=&quot;http://www.iijournals.com/page/RiskParity&quot;&gt;&quot;Latest Approaches to Risk Parity and Diversification&quot;&lt;/a&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &lt;a href=&quot;http://www.edhec-risk.com/edhec_publications/all_publications/RISKReview.2011-09-07.1203/attachments/EDHEC_Working_Paper_Risk_Parity_F.pdf&quot;&gt;&quot;Risk Parity – Rewards, Risks and Research Opportunities&quot; (2011)&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Risk Parity (RP) is a relatively simple idea. Very loosely defined, RP&#xA;  attempts to create a portfolio in which the various asset classes&#xA;  contribute equally to the overall risk of the portfolio.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is typically viewed against a 60/40 portfolio, and the argument is made that a 60/40 allocation actually allocates 90% of the risk to stocks.  There is a some amount of disagreement over whether risk parity is the best approach, as will be clear from reading a selection of these papers.  Some argue that there is no theoretical basis for why an RP portfolio should outperform an MVO-portfolio, and that it is inherently &lt;em&gt;inefficient&lt;/em&gt;; &lt;a href=&quot;http://www.econ.yale.edu/~af227/pdf/Leverage%20Aversion%20and%20Risk%20Parity%20-%20Asness%20,%20Frazzini%20and%20Pedersen.pdf&quot;&gt;&quot;Leverage Aversion and Risk Parity&quot;&lt;/a&gt; (2011) lays out a positive case based on leverage aversion.  There are also many different implementations of this idea (see &lt;a href=&quot;http://www.andreassteiner.net/consulting/downloads/ResearchNoteRiskParityForTheMasses.pdf&quot;&gt;&quot;Risk Parity for the Masses&quot;&lt;/a&gt; for an example).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some blog posts which have further references:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.portfolioprobe.com/2011/10/31/risk-parity/&quot;&gt;Portfolio Probe on &quot;Risk Parity&quot;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.mebanefaber.com/2011/11/13/risk-parity-etf-to-launch/&quot;&gt;World Beta on &quot;Risk Parity ETF Launch&quot;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;A related idea is the Most Diversified Portfolio (see, for example, &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1895459&quot;&gt;&quot;Properties of the Most Diversified Portfolio&quot;, 2011&lt;/a&gt;).  This optimizes the portfolio based on the diversification ratio, which is simply the sum of the individual asset volatilities over the portfolio volatility.&lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2012-01-05T01:59:12.743" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2728" PostTypeId="2" ParentId="2705" CreationDate="2012-01-05T03:25:08.493" Score="4" Body="&lt;p&gt;Do you know the &lt;a href=&quot;http://en.wikipedia.org/wiki/Black%E2%80%93Litterman_model&quot; rel=&quot;nofollow&quot; title=&quot;Black-Litterman Model&quot;&gt;Black-Litterman Model&lt;/a&gt;?&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In principle Modern Portfolio Theory (the mean-variance approach of Markowitz) offers a solution to this problem once the expected returns and covariances of the assets are known. While Modern Portfolio Theory is an important theoretical advance, its application has universally encountered a problem: although the covariances of a few assets can be adequately estimated, it is difficult to come up with reasonable estimates of expected returns. In other words, composing a portfolio based only upon statistical measures of risk and returns yields simplistic results; these are known as unconstrained optimizations.&#xA;  Black–Litterman overcame this problem by not requiring the user to input estimates of expected return; instead it assumes that the initial expected returns are whatever is required so that the equilibrium asset allocation is equal to what we observe in the markets. The user is only required to state how his assumptions about expected returns differ from the market's and to state his degree of confidence in the alternative assumptions. From this, the Black–Litterman method computes the desired (mean-variance efficient) asset allocation.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;More references on this Black-Litterman model can be found easily on Internet &lt;/p&gt;&#xA;" OwnerUserId="134" LastActivityDate="2012-01-05T03:25:08.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2729" PostTypeId="2" ParentId="2418" CreationDate="2012-01-05T03:26:11.893" Score="1" Body="&lt;p&gt;Your PnL is a function of traded volume, transaction costs and mills p/share (mills meaning $0.001 p/share). You also have to include exchange rebates and fees, a significant adjustment given your backtested results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 cent net p/share is actually a good return for high-frequency or market making strategies that trades in the millions shares p/day. However, given the time periods you indicate I doubt your strategy is trading that kind of volumes. Then there is adverse selection which of course will lower your net PnL. Finally you have to consider SEC taxes and your broker or proprietary infrastructures cost. Market impact (slippage) is a function of your order size, stocks liquidity and other factors. There are Phd treatises on the subject, it's impossible to give a valid answer in two sentences.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In any case Sharpe and profit p/share are good metrics for evaluation. That is what I use during model development.&lt;/p&gt;&#xA;" OwnerUserId="1791" LastActivityDate="2012-01-05T03:26:11.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2731" PostTypeId="2" ParentId="2685" CreationDate="2012-01-05T15:07:27.353" Score="8" Body="&lt;p&gt;Here is a plot of the time value for a typical call option as a function of spot. The image below was produced for a call option with the following parameters:&#xA;Strike = 100, risk free rate = 0, volatility = 30%, Time to maturity = 0.5.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/YzdrX.jpg&quot; alt=&quot;time value vs Spot&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, by the way, is theta, the time decay (derivative of &lt;em&gt;total&lt;/em&gt; value with respect to time) versus spot using the same parameters:  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/94Rg7.jpg&quot; alt=&quot;theta vs. spot&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;R Code for theta:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    BSOption &amp;lt;- function(S,K,r,v,T,type){&#xA;      d1 = (log(S/K)+(r+.5*v*v)*T)/(v*sqrt(T))&#xA;      d2 = d1 - v*sqrt(T)&#xA;      if(type == &quot;call&quot;||type == &quot;Call&quot;||type == &quot;C&quot;||type == &quot;c&quot;||type == 1)&#xA;      {&#xA;        delta = pnorm(d1)&#xA;        theta = (-S*dnorm(d1)*v/(2*sqrt(T))) - &#xA;          r*K*exp(-r*T)*pnorm(d2);&#xA;        price = S*pnorm(d1)- K*exp(-r*T)*pnorm(d2)&#xA;      }&#xA;      else{&#xA;        delta = -pnorm(-d1)&#xA;        theta = (-S*dnorm(d1)*v/(2*sqrt(T))) + &#xA;          r*K*exp(-r*T)*pnorm(-d2);&#xA;        price = K*exp(-r*T)*pnorm(-d2)-S*pnorm(-d1)&#xA;      }&#xA;      gamma = dnorm(d1)/(S*v*sqrt(T))&#xA;      vega = S*dnorm(d1)*sqrt(T)&#xA;      theta = theta/365&#xA;      BSoption = data.frame(price, delta, gamma, vega, theta)&#xA;      return(BSoption)&#xA;    }&#xA;&#xA;S = seq(80,120,1); &#xA;plot(S,BSOption(S,100,0,.3,.5,1)$theta,ylab=&quot;Theta&quot;,xlab=&quot;Spot&quot;); title(&quot;Theta vs Spot&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;R code for time value:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;S = seq(80,120,1); &#xA;intrinsic = array(0,c(length(S),1))&#xA;for(i in 1:length(intrinsic)){&#xA;    intrinsic[i] = max(S[i] - 100,0)&#xA;}&#xA;plot(S,BSOption(S,100,0,.3,.5,1)$price-intrinsic,ylab=&quot;Time Value&quot;,xlab=&quot;Spot&quot;);&#xA;title(&quot;Time Value vs Spot&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="826" LastEditorUserId="1106" LastEditDate="2012-01-05T15:45:44.833" LastActivityDate="2012-01-05T15:45:44.833" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2732" PostTypeId="2" ParentId="2692" CreationDate="2012-01-05T15:21:34.553" Score="3" Body="&lt;p&gt;You are quite correct that there are further assumptions in the replicating argument.&#xA;Once you are assuming your equation (2), that is, that&#xA;$$&#xD;&#xA;dS = S(\mu dt + \sigma dW)&#xD;&#xA;$$&#xA;along with the determinism of interest rates, the rest of the replication argument necessarily follows because you have constructed a mathematical world with nothing else in it.  Hence $S, t, r, \sigma$ and $q$ are sufficient to price the option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nothing in finance forces any of the assumptions to be true, and as a matter of fact they are false to certain degrees.  Consider for example a world in which $B(t)$ it itself stochastic, which of course we necessarily have to treat for itnerest rate options.  In that case, an American call option will have a pricing formula depending on $S$, $t$, and various interest rate variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, consider the case where&#xA;$$&#xD;&#xA;dS = S(\mu dt + \sigma dW + dJ)&#xD;&#xA;$$&#xA;for some jump process $J$.  Depending on how $J$ behaves it may be theoretically &lt;em&gt;impossible&lt;/em&gt; to replicate the option.  One can still get at valuations using diversification arguments and the like, but those valuations will depend on other parameters.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-01-05T15:21:34.553" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2733" PostTypeId="5" CreationDate="2012-01-05T16:00:08.897" Score="0" Body="" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2012-01-05T16:00:08.897" LastActivityDate="2012-01-05T16:00:08.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2734" PostTypeId="4" CreationDate="2012-01-05T16:00:08.897" Score="0" Body="The selection of a best element from some set of available alternatives.  Typically consists of maximizing or minimizing a real function by systematically choosing input values from within an allowed set and computing the value of the function." OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2012-01-05T16:00:08.897" LastActivityDate="2012-01-05T16:00:08.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2735" PostTypeId="5" CreationDate="2012-01-05T16:05:22.447" Score="0" Body="" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2012-01-05T16:05:22.447" LastActivityDate="2012-01-05T16:05:22.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2736" PostTypeId="4" CreationDate="2012-01-05T16:05:22.447" Score="0" Body="The study of the collection, organization, analysis, and interpretation of data.  Questions may deal with descriptive statistics, probability distributions, random variables, sampling, regression, density estimation, filtering, inference, estimation theory, or computational statistics." OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2012-01-05T16:05:22.447" LastActivityDate="2012-01-05T16:05:22.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2737" PostTypeId="5" CreationDate="2012-01-05T16:09:34.013" Score="0" Body="&lt;p&gt;For questions about programming languages, algorithm implementation, and packages related to  quantitative finance. Note: question must be specific to quantitative finance and must necessitate knowledge of quantitative finance in order to be considered on topic.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="8148" LastEditDate="2014-06-13T20:48:46.853" LastActivityDate="2014-06-13T20:48:46.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2738" PostTypeId="4" CreationDate="2012-01-05T16:09:34.013" Score="0" Body="For questions about programming languages, implementation, and packages in quantitative finance.  &#xD;&#xA;Note: question must be specific to quantitative finance and must necessitate knowledge of quantitative finance in order to be on topic." OwnerUserId="1106" LastEditorUserId="8148" LastEditDate="2014-06-13T20:48:57.690" LastActivityDate="2014-06-13T20:48:57.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2739" PostTypeId="5" CreationDate="2012-01-05T16:12:52.137" Score="0" Body="" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2012-01-05T16:12:52.137" LastActivityDate="2012-01-05T16:12:52.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2740" PostTypeId="4" CreationDate="2012-01-05T16:12:52.137" Score="0" Body="Most questions about books are off topic.  Please see past questions and read the FAQ before posting with this tag." OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2012-01-05T16:12:52.137" LastActivityDate="2012-01-05T16:12:52.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2741" PostTypeId="5" CreationDate="2012-01-05T16:14:40.247" Score="0" Body="" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2012-01-05T16:14:40.247" LastActivityDate="2012-01-05T16:14:40.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2742" PostTypeId="4" CreationDate="2012-01-05T16:14:40.247" Score="0" Body="Most questions with this tag are off topic.  Please see the FAQ before posting.  This site is intended for professionals and academics.  Students: questions must be at a Master in Quantitative Finance level or higher." OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2012-01-05T16:14:40.247" LastActivityDate="2012-01-05T16:14:40.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2743" PostTypeId="5" CreationDate="2012-01-05T16:18:27.540" Score="0" Body="" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2012-01-05T16:18:27.540" LastActivityDate="2012-01-05T16:18:27.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2744" PostTypeId="4" CreationDate="2012-01-05T16:18:27.540" Score="0" Body="Questions that do not require specific technical expertise in order to answer properly.  Questions must be of particular interest and usefulness to professionals and academics to qualify as on topic." OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2012-01-05T16:18:27.540" LastActivityDate="2012-01-05T16:18:27.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2745" PostTypeId="5" CreationDate="2012-01-05T16:20:36.460" Score="0" Body="" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2012-01-05T16:20:36.460" LastActivityDate="2012-01-05T16:20:36.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2746" PostTypeId="4" CreationDate="2012-01-05T16:20:36.460" Score="0" Body="Techniques for modeling and analyzing several variables, when the focus is on the relationship between a dependent variable and one or more independent variables." OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2012-01-05T16:20:36.460" LastActivityDate="2012-01-05T16:20:36.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2748" PostTypeId="2" ParentId="1658" CreationDate="2012-01-05T18:00:14.540" Score="1" Body="&lt;p&gt;Two important points going beyond the technical aspect that haven't been mentioned here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first is transparency. For example, I sometimes hear the NYSE DMM is an alternative market making model safer than the HFT liquidity frenziness. But what do we now of the additional cost incurred by investors when operating on NYSE DMM-controlled trades? Take a look at the charts of a NYSE specialist company like La Branche to see the evolution of their business as ECNs were growing the last 5/10 years. Dark pools are also sometimes praised for their fairness to investors, but how can we verify the fairness of transactions without order flow data: &lt;a href=&quot;http://www.tradersmagazine.com/issues/24_331/pipeline-sec-fine-109653-1.html?pg=2&quot; rel=&quot;nofollow&quot;&gt;http://www.tradersmagazine.com/issues/24_331/pipeline-sec-fine-109653-1.html?pg=2&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second point is a pratical consideration on the applicability of regulations aimed at reducing order entry flow. Is it possible to monitor the 1 second delay between order entry and cancel request given the number of transactions taking place in the equity markets? And what guarantees that the 1 second delay will be respected by all participants down to the millisecond precision? A millisecond can make a lot of difference these days.&lt;/p&gt;&#xA;" OwnerUserId="1791" LastActivityDate="2012-01-05T18:00:14.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2749" PostTypeId="2" ParentId="2726" CreationDate="2012-01-05T21:20:00.340" Score="5" Body="&lt;p&gt;Your friend might be right, if, for example, he was talking about making a market in a set of low liquidity stocks.  But that usually requires a market-making model where you're inventorying shares, for longer periods of time, which adds risk.  Returns can be 'good' though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are other scenarios, that are exchange-model dependent, that would also mitigate the speed advantage.&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2012-01-05T21:20:00.340" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2750" PostTypeId="2" ParentId="2707" CreationDate="2012-01-05T21:31:15.250" Score="3" Body="&lt;p&gt;One way to do it is to get a history of how your tweaks to a quantitative model's selection and weighting has performed in the past.  It sounds like you have this, or could generate it. (e.g. quantify the quality of your(or your firms) qualitative selections in the past)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then make your quantitative selection/weighting process 2 stage.&#xA;stage1: the raw portfolio suggested by the quantitative model&#xA;stage2: re-select/re-weight considering the factor that you computed that isolates your qualitative tweaks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The result is a quantitative model that factors in your selection/weighting abilities.&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2012-01-05T21:31:15.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2752" PostTypeId="2" ParentId="2692" CreationDate="2012-01-06T01:37:20.560" Score="12" Body="&lt;p&gt;I feel that the best way to answer your question is to first quote your problematic idea and then carefully explain the subtle alternative. :)&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The derivation of the Black-Scholes PDE is based on the assumption that the price of the option should change in time in such a way that ... And my question is: Why do we assume that the price of the option has this property?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The derivation of B-S PDE doesn't require the assumption above, though it will make derivation easier indeed. Besides, this is not an assumption. This is a natural &lt;strong&gt;consequence&lt;/strong&gt; that we can derive. We don't need to assume option price's properties (i.e. should change in time in such a way ... ). Instead, we derive it, the way option price must follow. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;To construct such a self-financing portfolio whose price replicates the price of the option (within a very small time interval).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You probably somewhat had this chicken-and-egg mystery in your mind: how can I replicate the price of the option before I ever know it? The truth is that (at least to me), for most of the time, my self-financing portfolio is trying to do/replicate something else irrelevant to the mysterious option price, and I found that the option price had better follow what I am doing, not the other way around. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Now we require that P=C and dP=dC. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Let's think a little deeper about the equation P=C: &lt;em&gt;who forces it? why? how they do it?&lt;/em&gt; The answer is somewhat subtle: it depends on when you ask these questions. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;At expiry (T): P$_T$ = C$_T$ is enforced by contract/exchange/law. If your counter-party default, buyer can sue the writer, or exchange will handle it and guarantee buyer's right. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Anytime between now and expiry: P$_t$ = C$_t$ is &lt;strong&gt;not&lt;/strong&gt; forced by contract/exchange/law. If there are markets for options, stocks, and bonds, B-S arbitragers will jump in to &quot;help&quot; (instead of force it) by trading against any price deviation. Arbitrager &lt;em&gt;will&lt;/em&gt; monetize the deviation by constantly rebalancing a self-financing portfolio P$_t$ that &lt;em&gt;will&lt;/em&gt; eventually replicate the option's payoff at expiry. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;See the difference? P$_T$ = C$_T$ is a requirement, i.e. boundary condition, enforced by law in reality, but P$_t$ = C$_t$ is not. P$_t$ = C$_t$ is more like a consequence than a requirement. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;It means that we want to find such ωs and ωb that the portfolio has the same price that the option and its change in price has the same value as the change in price of the option. OK. Why not?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;No, again we find the portfolio for something else. It's the option price that had better attach to our specially designed portfolio, not the other way around. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alright, then what is the self-financing portfolio supposed to do? It's easier to answer the question step-by-step backward. Let's live in a discrete world for a moment without losing generality. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;At $T-1$: The self-financing portfolio P$_{T-1}$ is designed to replicate the option's value at $T$, i.e. pay-off.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;At $T-2$: The self-financing portfolio P$_{T-2}$ is designed to replicate the most near future self-financing portfolio's value (which has been determined in the previous step) $P$ $_{T-1}$ that will replicate the option's pay-off in the further future $T$. There is nothing to do with $C$ $_{T-2}$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;At $T-3$: The self-financing portfolio $P$ $_{T-3}$ is designed to replicate the most near future self-financing portfolio $P$ $_{T-2}$ that will replicate $P$ $_{T-1}$ that will replicate the option's pay-off at $T$. Again, C$_{T-3}$ is irrelevant. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;...&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;At $T-n$: The self-financing portfolio $P$ $_{T-n}$ is designed to replicate the most near future self-financing portfolio $P$ $_{T-n+1}$ that will replicate $P$ $_{T-n+2}$ that will replicate ... (eventually option's pay-off at $T$). &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If I do every step correctly, I can hang on long enough to the expiry to let the contract/exchange/law enforce the arbitrage/convergence. Note that this is the only convergence (requirement) guaranteed in reality. C$_t$ = P$_t$ is not guaranteed. It is helped by the market/arbitrager, who are willing to (but they don't have to, nobody has to) diligently trade and hedge in order to secure the profit from the price difference. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In other words, we apply certain requirements (restrictions) to our portfolio (it should follow the price of the option). As a consequence, we restrict the content of our portfolio (we fix ωs and ωb). But we do not apply any requirements to the price of the option. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now you should be able to answer yourself. In any cases, your portfolio is not restricted by the option price. It's the other way around: the market/arbitrager help restrict the option price using the self-financing portfolio. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Well, we say that it should be a function of the S and t. As a consequence, we got the equation (1). But from that we will not get any relation between the derivatives of C. We, also constructed a replicating portfolio, but why its existence should restrict the evolution of the price of the option?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Let me give you another analogy. If I tell you that at $T$, apple$_T$ is guaranteed to equal to orange$_T$. Now at $t$, an orange$_t$ = \$5, what do you think about apple$_t$'s value? Should the existence of orange and its evolution restrict apple's price? What will you do if their price are different? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make my analogy more similar, let me also tell you this: &quot;Hey, you got to do something to your orange$&lt;em&gt;t$! Otherwise, it will become banana&lt;/em&gt;{t+1}!&quot; There is no guarantee between apple and banana at expiry $T$. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;What I do not understand is what requirement binds the derivatives of C over S and t. It looks to me that the requirement that I am missing is the following:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The price of the option should depend on S and t in such a way that it should be possible to create a self-financing portfolio which replicates the price of the option.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Am I right? Do we have this requirement? And do we get the Black-Scholes PDE from this requirement? If it is the case, can anybody, please, explain where this requirement comes from.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Is there still a missing requirement to you in my apple and orange analogy? Do you need any? :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Again, the market/arbitrager help option price depend on S and t. Their trading activities make things work like that. However, this is not a pre-request to create the self-financing portfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let me try to revise your argument: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The price of the option had better depend on S and t in such a way that it follows the value of a specially designed self-financing portfolio by volatility arbitrager. The arbitrager's self-financing portfolio is designed to replicate the most near future self-financing portfolio that &lt;em&gt;will&lt;/em&gt; eventually replicate the option's payoff at expiry.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In conclusion, the missing requirement you originally thought is actually, a natural consequence. :)&lt;/p&gt;&#xA;" OwnerUserId="1089" LastEditorUserId="1089" LastEditDate="2012-01-06T09:48:56.753" LastActivityDate="2012-01-06T09:48:56.753" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2753" PostTypeId="1" CreationDate="2012-01-06T02:37:10.353" Score="25" ViewCount="2755" Body="&lt;p&gt;I was going through the paper of &lt;a href=&quot;http://math.nyu.edu/faculty/avellane/AvellanedaLeeStatArb20090616.pdf&quot;&gt;Avellaneda (2008)&lt;/a&gt; on stat arb and I found it interesting that he uses asset returns vs. their respective ETFs to compute the s-score.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am wondering if anyone has tried this approach to pairs trading. How does it compare to &lt;a href=&quot;http://en.wikipedia.org/wiki/Johansen_test&quot;&gt;Johansen's method&lt;/a&gt;, where the actual price series is used? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't imagine this approach being stable if trying to trade intraday, due to all these return computations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I haven't tried either method so I would appreciate some feedback on your experience.&lt;/p&gt;&#xA;" OwnerUserId="1696" LastEditorUserId="20795" LastEditDate="2018-01-26T22:02:38.197" LastActivityDate="2018-01-26T22:02:38.197" Title="How do different methods and techniques used in pairs trading compare?" Tags="&lt;quant-trading-strategies&gt;&lt;arbitrage&gt;&lt;cointegration&gt;&lt;pairs-trading&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="24" ContentLicense="CC BY-SA 3.0" />
  <row Id="2754" PostTypeId="2" ParentId="2707" CreationDate="2012-01-06T16:17:54.283" Score="37" Body="&lt;p&gt;There are some cases where you can blend your portfolios using weights directly. One case involves &lt;a href=&quot;http://www.stanford.edu/~wfsharpe/mia/opt/mia_opt3.htm#Corner%20Portfolios&quot;&gt;corner portfolios&lt;/a&gt;. In this case a linear combination of weights is also efficient. Another case is where you can treat the two separate weights you have produced each as distinct portfolio under the assumption that the correlation between these portfolios is relatively stable. In this scenario, the problem reduces to a two-asset portfolio optimization problem (each asset is simply the linear combination of weights produced via your two methods).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other class of methods involves blending via the expected returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you arrived at the weights via a mean-variance utility optimization you can back-out the implied expected returns based on these weights and a risk aversion parameter. (Indeed, this is the approach Black-Litterman took to back-out the implied expected returns from a set of benchmark weights, and Jay Walters shows the simple linear algebra for this in the paper I cite below.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The approaches below require that you blend views on expected returns rather than weights. This is more natural since weights are product of some optimization (one might be short a security for hedging purposes despite having a positive expected return view for the security). Two sets of portfolio weights may each be on the efficient frontier but a generic convex blend of these two sets may be inefficient. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To blend your qualitative scores with quantitative views in return space you can:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Convert qualitative factors into quantitative scores&lt;/strong&gt;. Grinold &amp;amp; Kahn discuss various techniques in &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0070248826&quot;&gt;Active Portfolio Management&lt;/a&gt;, 2nd ed. Check out the section &quot;Information Processing&quot;. One straightforward technique is if you have a rating system such as &quot;Sell, Hold, Buy, Strong Buy&quot; then associate each rating with a dummy variable and build a linear (or non-linear) factor model including your quantitative forecasts as other factors. (Note: There is a more general question of &quot;signal weighting - how do I blend quantitative information efficiently?&quot; which might be worthy of another post.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;OR&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Express qualitative views in the form of confidences via Black-Litterman&lt;/strong&gt; (i.e. MSFT will rise more than APPL with 20% confidence). A Black-Litterman model - specifically the &lt;a href=&quot;http://faculty.fuqua.duke.edu/~charvey/Teaching/BA453_2006/Idzorek_onBL.pdf&quot;&gt;Idzorek&lt;/a&gt; variation which uses % confidences - is a good way to do this. Jay Walters has a nice reference paper on Black-Litterman &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1314585&quot;&gt;here&lt;/a&gt;. Also there is a package in R called &lt;a href=&quot;http://cran.r-project.org/web/packages/BLCOP/index.html&quot;&gt;BLCop&lt;/a&gt; that you can toy with.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Black-Litterman model has been refined over the last several years. Read the papers from &lt;a href=&quot;http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=1171776&quot;&gt;Wing Cheung&lt;/a&gt; (Nomura) on the &quot;Augmented Black-Litterman model&quot; if you want to see another explanation.  His implementation is quite flexible as it supports &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1395283&quot;&gt;generalized factor-view blending&lt;/a&gt; as well as other features.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OR&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet a more general technique is &lt;strong&gt;Entropy-pooling&lt;/strong&gt;. Whereas, Black-Litterman allows you to create views on expectations of asset performance (MSFT will return 8%), or relative views as in MSFT will-outperform APPL, you might have views on correlations, variance, views on the rankings of securities, or views on underlying risk-factors that are statistically related to your securities of interest. These views cannot be satisfied by the &quot;Pick Matrix&quot;/Omega construction in Black-Litterman. In this case Atillio Meucci's implementation of &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1213325&quot;&gt;Entropy-Pooling&lt;/a&gt; is the way to go. He has MATLAB code demonstrating the approach &lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/21307&quot;&gt;here&lt;/a&gt;. The Entropy Pooling framework applies to parametric or non-parametric problems. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;strong&gt;non-parametric version of Entropy Pooling&lt;/strong&gt; can handle scenarios which correspond to arbitrary probability distributions. Entropy pooling pooling will process a view with and update the probabilities for each scenario in a way that imposes the least amount of spurious structure on the original probabilities assigned to the scenarios. In this way Entropy pooling is perfectly Bayesian.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially you have a prior -- JxN panel of data furnished from historical data, a reference model, or a monte carlo simulation (J = number of scenarios; N = asset returns or risk factors -- anything you could take a view on.). This JxN panel ties to a vector 'p' of probabilities where one probability corresponds to each scenario. (If you are using historical data, the vector of probabilities could simply be 1/length(data), or exponentially weighted.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you can create a view  which contains your current qualitative scores. These views are expressed as constraints on probabilities. So you can setup a constraint which is interpreted as &quot;Buy implies the security is in the top quantile of returns&quot;. Or, perhaps you aren't sure exactly what the labels imply about expected returns but you believe it will be consistent with the prior. In this case you can assign the qualitative scores from the past to the historical empirical data (even if you only have partial coverage of the investment universe), and then create views consisting of your qualitative categorical assessments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Entropy pooling procedure will generate a revised set of probabilities for each of the scenarios. You can then take expectations (probability weighted average) with the new probabilities for expected portfolio returns, expected security returns, correlations, etc. You would then proceed to optimization with you revised expectations on returns and risk. &lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-08-09T15:56:53.363" LastActivityDate="2012-08-09T15:56:53.363" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2755" PostTypeId="1" AcceptedAnswerId="2761" CreationDate="2012-01-06T18:25:36.290" Score="12" ViewCount="1315" Body="&lt;p&gt;The derivation of the Black-Scholes model assumes no counterparty risk. Does the presence of counterparty risk invalidate the argument behind the model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: The question is about options in general, not just the exchange-traded ones. BS model is used to price FX options, or -- in a modified form known as &quot;Black 1976&quot; -- IR swaptions. They're (IR swaptions at least) OTC instruments and thus would not benefit from the central clearing mechanisms.&lt;/p&gt;&#xA;" OwnerUserId="89" LastEditorUserId="89" LastEditDate="2012-01-07T11:52:46.943" LastActivityDate="2012-01-08T05:27:40.330" Title="Can you fully hedge an option in the presence of counterparty risk?" Tags="&lt;options&gt;&lt;hedging&gt;&lt;counterparty-risk&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2756" PostTypeId="2" ParentId="2755" CreationDate="2012-01-06T21:42:39.733" Score="6" Body="&lt;p&gt;Keep in mind that most futures, equity, and index options, at least, are traded on exchanges where the counterparty risk is so tiny as to be negligible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, adding extra variables like this fails to invalidate the model.  For example, the fact that interest rates or volatilities are not constant just ends up leading to an extended model with extra stochastic factors (and hedges) corresponding to the extra terms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Counterparty risk is special, however, since it moves the price in opposite directions for the two entities making the trade.  That is to say, if BofA is trading an in-the-money swap with Goldman, then&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;B of A thinks it should get more money because the payments Goldman promised may never materialize, but&lt;/li&gt;&#xA;&lt;li&gt;Goldman thinks it should pay less money because the cashflows promised by BofA may never materialize.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Contrast this with the case of stochastic interest rates, where both parties can at least theoretically come to a consensus about the effect on the value of future cashflows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, for options, only one side of this conundrum is relevant.  For example if Goldman is buying an option from BofA for cash upfront, then BofA has no counterparty concerns about the deal.  Goldman still wants to pay less due to the credit risk of course, while from BofA's point of view the credit risk is meaningless.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The result of all this is that counterparty risk is an unavoidable error in the model.  I would not go so far as to say this risk &quot;invalidates&quot; it.  After all even the existence of quoted spreads on the underyling theoretically &quot;invalidates&quot; the model.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What it does mean is that trades happen only in cases where the counterparty risk is roughly the size of the option's bid/offer spread, or less.  Any more risk than that and BofA will be unwilling to accept such a large haircut, and Goldman will take its business elsewhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A common way to reduce the risk all around is in the use of margin accounts.  For example, Goldman obviously cares little about the BofA counterparty risk if the option looks valueless.  If the option becomes valuable, then Goldman can demand that BofA keep some money on deposit as a guarantee they will make good on the payments.  So long as any bankruptcy by BofA is sufficiently slow to evolve, the margin account updates will have grown to entirely cover the option value by the time default actually occurs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The margin accounts are the reason exchanges are willing to let members sell options, despite the obviously greater risk of any individual member's default. &lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-01-06T21:42:39.733" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2759" PostTypeId="1" CreationDate="2012-01-06T23:29:48.817" Score="2" ViewCount="204" Body="&lt;p&gt;I am new to investing. I understand that the P/E ratio along with other data can be used to determine whether a stock may or may not be undervalued. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there situations where a HIGH P/E is actually beneficial? Say for instance you have a stock with a P/E of 20. If the earnings-per-share on that stock increases by $1, you would expect that &lt;strong&gt;if the P/E ratio remains constant&lt;/strong&gt; then the price of the stock would increase by $20. It is somewhat counter-intuitive that a high P/E would be desirable, but it stands to reason that if the market is willing to pay 20x earnings when earnings are at X, why wouldn't the market be willing to pay 20x earnings (or perhaps even more) when earnings move to X + 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think I read something along these lines in Burton Malkiel's book but I am not positive, any thoughts on this concept or research in that area I could look into? What considerations can we make with respect to whether its reasonable to assume that the P/E ratio will remain constant, increase, or decrease?&lt;/p&gt;&#xA;" OwnerUserId="1876" LastEditorUserId="1876" LastEditDate="2012-01-06T23:44:40.977" LastActivityDate="2012-01-07T00:37:20.760" Title="Can a higher P/E ratio be beneficial under certain circumstances?" Tags="&lt;data&gt;&lt;equities&gt;&lt;trading&gt;&lt;fundamentals&gt;" AnswerCount="0" CommentCount="6" FavoriteCount="1" ClosedDate="2012-01-07T12:07:19.737" ContentLicense="CC BY-SA 3.0" />
  <row Id="2761" PostTypeId="2" ParentId="2755" CreationDate="2012-01-07T08:22:42.287" Score="10" Body="&lt;p&gt;Options are actually some of the least susceptible securities to the adverse impact of counterparty risk. I refer to listed options, such as those cleared through the OCC (Options Commodity Clearinghouse) in Chicago, IL. The OCC is a true &lt;strong&gt;central clearing counterparty&lt;/strong&gt; (CCC) because it bears all default risk, by distributing it evenly among its members. The default risk is distributed because all members &quot;pay in&quot; (provide collateral), mitigating the aggregate risk exposure in the event of a member default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;What if they don't want to pay?&lt;/code&gt; you may ask. Members are assessed a yearly fee to belong to the clearinghouse, which maintains these funds if needed (it is called the &quot;insolvency fund&quot;). Furthermore, each transaction is assessed a short-term collateral tithe, until the trade clears.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I couldn't find an example chart from the OCC, but here is one for the NSCC (National Securities Clearing Corp, now Depository Trust, DTCC), which is the other major central clearing counterparty in the U.S.A. NSCC/ DTCC acts as the CCC for listed equities, mutual funds, bonds, government securities etc. The OCC acts similarly, but for options. &lt;img src=&quot;https://i.stack.imgur.com/i9HoY.jpg&quot; alt=&quot;Trade Lifecycle under CCC&quot; title=&quot;Lifecycle for securities trading with the benefit of central counterparty clearing&quot;&gt;&lt;br&gt;&#xA;In the United States, true central counterparty clearing is no longer in place for all transactions. Instead of CCC, there is usually some form of separation between the clearing broker and the clearinghouse. This means that there will be multiple clearing brokers that must reconcile financial securities (shares, bonds, options etc.) and money against other clearing brokers. It also means that the clearing broker bears the risk of default on the leg of the transaction that he is servicing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the question, the counterparty risk &lt;strong&gt;IS&lt;/strong&gt; negligible as far as the risk to both parties in the transaction, the buyer and seller of the option. *** If the option is listed, the clearinghouse is in place to cover any default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the instance of non-CCC, there are the intermediate clearing brokers as I described above. The taxpayer is never liable here (that concern was expressed in a comment to another answer). Other than a situation of complete financial collapse, the effect of counterparty risk will not be an issue for traders. The &quot;buck stops&quot; with the clearinghouses and the clearing brokers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;*** The clearinghouse is adequately collateralized. It includes both an annual fee for members, plus a daily collateral margin based on each transaction cleared. There is also a secondary insolvency fund as back up, for coverage in the event of a catastrophic risk scenario.&lt;/p&gt;&#xA;" OwnerUserId="999" LastEditorUserId="999" LastEditDate="2012-01-08T05:27:40.330" LastActivityDate="2012-01-08T05:27:40.330" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2763" PostTypeId="1" AcceptedAnswerId="2768" CreationDate="2012-01-07T11:19:17.310" Score="12" ViewCount="963" Body="&lt;p&gt;The general idea of cleansing a correlation matrix via &lt;a href=&quot;http://en.wikipedia.org/wiki/Random_matrix&quot;&gt;random matrix theory&lt;/a&gt; is to compare its eigenvalues to that of a random one to see which parts of it are beyond normal randomness. These are then filtered out and one is left with the non-random parts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A one-dimensional analog would be to compare the return density distribution of a stock to the normal distribution and filter its normal volatility out. One should be left with the non-random distribution of that stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have two questions: Is my reasoning, i.e. the intuition behind using RMT and my analogy, correct and if yes, is something like the one-dimensional case done (or would it make sense to do it)?&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2012-01-11T23:22:51.190" Title="One dimensional analog of cleansing a correlation matrix via random matrix theory" Tags="&lt;volatility&gt;&lt;correlation-matrix&gt;&lt;random-matrix-theory&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="2765" PostTypeId="1" AcceptedAnswerId="2766" CreationDate="2012-01-09T05:04:50.857" Score="7" ViewCount="503" Body="&lt;p&gt;I'm investigating a situation where the chance for gain or loss is the same, but the amount gained is greater than the amount that is lost.  For example, the gain would be about 30% of the trade amount, and the loss would be 23% of the trade amount.  While there is slightly more to it than that, that is the core of it -- random/even chance for hitting the gain or the loss the way the trade is structured, and approximately the percentages indicated.  Please note either the gain or loss will be reached.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If one has amount &lt;strong&gt;&lt;em&gt;A&lt;/em&gt;&lt;/strong&gt;  to invest, what considerations need to be taken into account to make a situation like this profitable, or is it not possible for it to be profitable (e.g. due to many successive losses)?  &lt;/p&gt;&#xA;" OwnerUserId="1675" LastEditorUserId="1106" LastEditDate="2012-01-09T19:39:57.170" LastActivityDate="2012-01-09T19:39:57.170" Title="What is the optimal strategy when there is an equal chance for gain or loss but the size of the potential gain is larger?" Tags="&lt;risk-management&gt;&lt;strategy&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2766" PostTypeId="2" ParentId="2765" CreationDate="2012-01-09T08:20:33.850" Score="16" Body="&lt;p&gt;This is practically a textbook case begging for the &lt;a href=&quot;http://en.wikipedia.org/wiki/Kelly_criterion&quot;&gt;Kelly criterion&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your specific example, the optimal trade size is $f^*A$, where $f^*$ maximizes the average rate of return&#xA;$$\mathbb{E}[\log (X)]=0.5\log(1+0.3f)+0.5\log(1-0.23f).$$&#xA;Here $f$ is the fraction of the current capital to trade. A straightforward calculation yields that&#xA;$$f^*=\frac{0.3-0.23}{2\times 0.3\times 0.23}\approx 0.5072$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In general, if you expect to gain $gX$ with probability $p$ or lose $lX$ with probability $q$ on a trade of the size $X$, then the optimal (Kelly) bet is &#xA;$$f^*=\frac{pg-ql}{gl}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some caveats might be worth noting.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The Kelly framework assumes that sequential trades are (sufficiently) independent.  &lt;/li&gt;&#xA;&lt;li&gt;Since the exact payoffs  $g$, $l$ and probabilities $p$, $q$ are typically not known, it is safer to bet less than Kelly.  Betting double the optimal Kelly bet&#xA;reduces the growth rate of capital to zero (see e.g. &lt;a href=&quot;http://www.wilmott.com/pdfs/050316_ziemba.pdf&quot;&gt;&lt;em&gt;&quot;Good and Bad Properties &#xA;of the Kelly Criterion&quot;&lt;/em&gt;&lt;/a&gt; by Bill Ziemba).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="70" LastEditorUserId="70" LastEditDate="2012-01-09T14:13:47.163" LastActivityDate="2012-01-09T14:13:47.163" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2768" PostTypeId="2" ParentId="2763" CreationDate="2012-01-10T04:28:48.677" Score="10" Body="&lt;p&gt;This is correct: &quot;The general idea of cleansing a correlation matrix via random matrix theory is to compare its eigenvalues to that of a random one to see which parts of it are beyond normal randomness.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is not correct: &quot;These are then filtered out and one is left with the non-random parts.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The term &quot;filtering&quot;, although used extensively in the literature, is misleading because the eigenvectors from the original correlation (or covariance matrix) remain part of the matrix and the sum of the eigenvalues does not change. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In all RMT filtering procedures, the matrix is decomposed and re-built via the eigenvector decomposition theorem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ correlation \;\; matrix = eigenvectors * diag( eigenvalues ) * t(eigenvectors) $$&#xA;Notation: t() is the transpose operator,  * is matrix multiplication, and diag() is an operator that creates a diagonal matrix&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In RMT we only perform operations on the diagonal matrix of eigenvalues resulting from the decomposed matrix. The eigenvectors are left untouched. Also, the sum of the eigenvalues is preserved pre-and post cleansing. Since the sum of the eigenvalues also equals the trace of the covariance matrix, this ensures that the variance of the system is preserved. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To recap, all RMT procedures follow this four-step process:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The first step is, as you point out, identifying the upper noise band of eigenvalues predicted by a de-meaned random matrix of the same sigma using the Marcenko-Pastur law. Matrices that are exponentially weighted use a Power-law.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The matrix is decomposed via the eigenvector decomposition theorem&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The diagonal of eigenvalues is cleansed. For example, the method of Laloux (&lt;a href=&quot;http://prl.aps.org/abstract/PRL/v83/i7/p1467_1&quot; rel=&quot;nofollow&quot;&gt;1999&lt;/a&gt;, &lt;a href=&quot;https://www.math.nyu.edu/faculty/avellane/LalouxPCA.pdf&quot; rel=&quot;nofollow&quot;&gt;2000&lt;/a&gt;) is to assign the eigenvalues for all &quot;noisy&quot; eigenvalues beneath the upper-noise band to the average of all such noisy eigenvalues. There are several variations in what new eigenvalues you assign to the noisy eigenvalues (power-law method, Krzanowski, etc.). Regardless - in all RMT methods the sum of all the eigenvalues is preserved post-cleansing so you cannot set these to zero.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Now we re-build a &quot;cleansed&quot; or &quot;filtered&quot; covariance matrix using the same eigenvectors and the revised eigenvalue via the eigenvector decomposition theorem (in reverse this time with the same eigenvectors).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Digression: You could come up with your own techniques so long as the constraints above are  respected. For example, since we know that the principal/top eigenvectors have significant non-normal structure or skew, you could &quot;filter&quot; those eigenvalues that correspond to eigenvectors that exhibit normal structure. Also, for what it's worth, in my experience filtering methods that have a successively increasing distance from one eigenvalue value to the next perform better (i.e. for example a recursive definition such as the value of the 2nd smallest eigenvalue is twice the value of the smallest eigenvalue, the value of the 3rd smallest eigenvalues is twice the value of the 2nd smallest eigenvalue, etc. up to the last noisy eigenvalue). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, one of the most accessible &lt;a href=&quot;http://polymer.bu.edu/hes/articles/pgras00a.pdf&quot; rel=&quot;nofollow&quot;&gt;introductions to Random Matrix theory&lt;/a&gt; are the papers by V. Plerou et al. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://www.science-finance.fr/en/research/publications&quot; rel=&quot;nofollow&quot;&gt;Capital Fund Management&lt;/a&gt; Team - Bouchaud, Pafka, Potters, et al has more frontier research on RMT.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1531" LastEditDate="2012-01-11T23:22:51.190" LastActivityDate="2012-01-11T23:22:51.190" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2770" PostTypeId="1" AcceptedAnswerId="2771" CreationDate="2012-01-10T20:25:15.430" Score="16" ViewCount="6953" Body="&lt;p&gt;Before you mark question as off-topic, please read it - it &lt;em&gt;is&lt;/em&gt;, actually, quant-related.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, I'm working on an app that spits out a lot of C++ math. When it comes to simple things like exponents and trig, I can use an STL function. But when it comes to things like matrix operations or normal distributions or anything else that's not part of the STL, I'm not quite sure which library to support.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's the reason for this question - I'd like to know what kind of C++ libs quants typically use (in addition to the STL and such) most. My idea is to support those which are the most common. (I'm thinking of things like BLAS, MKL, Boost.Math, etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW, if anyone's interested, &lt;a href=&quot;http://vimeo.com/34905137&quot;&gt;here's an overview&lt;/a&gt; of what I'm building.&lt;/p&gt;&#xA;" OwnerUserId="1217" LastEditorUserId="1217" LastEditDate="2012-01-11T22:06:35.417" LastActivityDate="2018-10-10T03:33:59.387" Title="What C++ math libraries are typically used by quants?" Tags="&lt;programming&gt;" AnswerCount="7" CommentCount="2" FavoriteCount="27" ContentLicense="CC BY-SA 3.0" />
  <row Id="2771" PostTypeId="2" ParentId="2770" CreationDate="2012-01-10T21:32:13.980" Score="19" Body="&lt;p&gt;For linear algebra etc, I am partial to &lt;a href=&quot;http://arma.sf.net&quot;&gt;Armadillo&lt;/a&gt; with &lt;a href=&quot;http://eigen.tuxfamily.org&quot;&gt;Eigen&lt;/a&gt; as an alternative. Both are modern (eg templated), actively developed and fairly high-performance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I like my C++ together with R and stand behind a few projects like &lt;a href=&quot;http://dirk.eddelbuettel.com/code/rcpp.html&quot;&gt;Rcpp&lt;/a&gt; and &lt;a href=&quot;http://dirk.eddelbuettel.com/code/rinside.html&quot;&gt;RInside&lt;/a&gt; which facilitate that integration; &#xA;&lt;a href=&quot;http://dirk.eddelbuettel.com/code/rcpp.armadillo.html&quot;&gt;RcppArmadillo&lt;/a&gt; then brings &lt;a href=&quot;http://arma.sf.net&quot;&gt;Armadillo&lt;/a&gt; to R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For quant stuff, there is of course &lt;a href=&quot;http://www.quantlib.org&quot;&gt;QuantLib&lt;/a&gt; and my (too slow-moving :-/) &lt;a href=&quot;http://dirk.eddelbuettel.com/code/rquantlib.html&quot;&gt;RQuantLib&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="69" LastEditorUserId="1418" LastEditDate="2012-01-17T16:12:12.247" LastActivityDate="2012-01-17T16:12:12.247" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="2772" PostTypeId="2" ParentId="2770" CreationDate="2012-01-11T09:16:07.040" Score="10" Body="&lt;p&gt;What I use in my job:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;boost (the mathematical part)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Eigen&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;gsl&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;glpk&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;and some scary legacy code ;-)&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2012-01-11T09:16:07.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2773" PostTypeId="2" ParentId="2770" CreationDate="2012-01-11T14:23:03.780" Score="5" Body="&lt;p&gt;For many numerical procedures you can link against &lt;a href=&quot;https://www.gnu.org/software/octave/&quot;&gt;Octave&lt;/a&gt; libraries if Octave is installed.&lt;/p&gt;&#xA;" OwnerUserId="252" LastActivityDate="2012-01-11T14:23:03.780" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2774" PostTypeId="2" ParentId="2770" CreationDate="2012-01-13T14:23:02.593" Score="8" Body="&lt;p&gt;The &lt;a href=&quot;http://www.nag.co.uk/numeric/CL/cldescription.asp&quot;&gt;NAG&lt;/a&gt; library is quite commonly used&lt;/p&gt;&#xA;" OwnerUserId="1161" LastActivityDate="2012-01-13T14:23:02.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2775" PostTypeId="1" AcceptedAnswerId="2777" CreationDate="2012-01-13T16:26:03.947" Score="15" ViewCount="1634" Body="&lt;p&gt;What benchmark should I use for backtesting a model for when I should buy an option of a particular stock? For equities, one could say their portfolio outperformed the S&amp;amp;P 500. I would like to have a similar means of comparison for trading stock options. The only thing I've been able to find that I think is appropriate is the VIX. Is there a better or more appropriate way to do this, so I can see how my portfolio and strategy performs in a backtest?&lt;/p&gt;&#xA;" OwnerUserId="1900" LastEditorUserId="1106" LastEditDate="2012-01-14T23:17:35.470" LastActivityDate="2014-05-30T19:29:30.140" Title="What benchmark/index to use for backtesting a portfolio of stock options?" Tags="&lt;options&gt;&lt;backtesting&gt;&lt;option-strategies&gt;&lt;benchmark&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2777" PostTypeId="2" ParentId="2775" CreationDate="2012-01-13T17:35:44.043" Score="4" Body="&lt;p&gt;The best solution in most cases where one is backtesting from a non-standard universe is to construct your own index.  I believe that to also be true in your case, as there is no standard index tracking the &lt;em&gt;returns&lt;/em&gt; of a particular basket of options.  VIX, in particular, is more accurately thought of as a price index, not a return index, in the options world.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To construct your own index for a long-only strategy, just take the entire universe available to your strategy and find the returns of a market-value-weighted portfolio of every security.  If your strategy is both long and short, the correct index is cash.  The market value you use is a bit subjective, as you could use either the market value of the underlying stock or the open interest of the options.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2012-01-13T17:35:44.043" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2778" PostTypeId="2" ParentId="2775" CreationDate="2012-01-14T16:45:18.150" Score="6" Body="&lt;p&gt;When testing your strategy, what you need to pay particular attention to is performance attribution, in other words why did you see the returns you did?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me give you a simple example to illustrate what I mean. Suppose I have an algorithm to pick stocks and you have a testing database of stock prices for one year. Suppose also that in that year the market was down 15%. You test my algorithm and find it returned -2%, beating the average by 13%. Is my algorithm a good one?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now suppose I told you my algorithm was to take your money, charge a 2% management fee off the top and leave all the cash in a non interest bearing account. Does it sound as good now?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question then is not &lt;em&gt;if&lt;/em&gt; a strategy differs from a benchmark index, but rather &lt;strong&gt;why?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It could be because:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You selected from a different universe (comparing US equities to the DAX for example).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The risk profile of the stocks you selected differs from the universe (picking only low price stocks out of a universe of all stocks).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your &quot;universe&quot; differs from the universe from which the index was constructed. For example suppose you select a test dataset consisting of all the NYSE stocks on Jan. 1, 2011 and collect returns for 2011. This would differ from the NYSE index simply because new stocks are listed during the year which were not there on Jan 1, the day you fixed your universe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even if these sort of technical factors are fully accounted for, there still remain many great questions for which you would like to have insight. For example if a stock portfolio does well was it:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Invested in the right sectors, but underperformed in those sectors?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Invested in the under performing sectors but picking the high performing stocks in those sectors?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Some permutation of the above?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bottom line: don't just compare to an index.&lt;/p&gt;&#xA;" OwnerUserId="1842" LastEditorUserId="1842" LastEditDate="2012-01-14T23:38:39.600" LastActivityDate="2012-01-14T23:38:39.600" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2780" PostTypeId="2" ParentId="2048" CreationDate="2012-01-16T00:35:43.053" Score="7" Body="&lt;p&gt;The SABR model has an overly fat right tail. If you do the CMS replication using cash-settled swaptions you find that you need ridiculously high strikes. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2012-01-16T00:35:43.053" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2781" PostTypeId="2" ParentId="2710" CreationDate="2012-01-16T16:54:17.330" Score="14" Body="&lt;p&gt;+1 for asking an excellent question. I agree with the answers of @Owen and @chrisaycock - I'm late to the party but perhaps this will shed some light.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How practitioners or academics answer this question will tell you a lot about their view on the nature and sources of returns and risk. For example, the Fama-French &quot;equilibrium&quot; school of thought would argue that solely exposures to systematic risk exposures explain the security returns (and that idiosyncratic returns are random) and therefore the expected return model matches the risk model. In this view, the &quot;expected return&quot; is the &quot;required rate of return&quot; for the security. You could tilt your portfolio towards securities with high expected returns but Fama-French would say you are only picking up a risk premium as compensation for taking on greater systematic risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know many practitioners that subscribe in full to the equilibrium view (except maybe &lt;a href=&quot;http://www.dfaus.com/library/bios/kenneth_french/&quot; rel=&quot;noreferrer&quot;&gt;these guys&lt;/a&gt;) but conceptually it's an important special case answer to your question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My argument is that the expected return &quot;alpha&quot; model and the risk model have two different objectives and therefore are best designed separately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As @Owen and Markowitz points out, risk is the second-moment of returns whose dynamics can be summarized in a variance-covariance matrix. Given such a matrix we can define a number of risk-measures -- portfolio variance, cVaR, VaR, etc. -- and minimize portfolio risk accordingly using an optimizer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A risk factor model is a powerful way to build a covariance matrix. Since a covariance matrix is NxN and symmetric, the number of variance-covariance elements to estimate is N*(N+1)/2. The number of elements grows geometrically in the number of instruments, whereas our data grows only arithmetically in time. A risk-factor model allows to estimate only K &lt;em&gt;factors&lt;/em&gt; (where K &amp;lt;&amp;lt; N) and therefore far fewer factor variance &amp;amp; factor covariance elements. Separately we estimate the beta's of each security with respect to each risk factor and re-constitute the desired NxN covariance matrix. So the risk model helps us overcome the curse of dimensionality and strip-out the idiosyncratic sources of return from our hedging process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now there are a couple reasons why the same risk factor model is not used for expected returns modelling. First, the best factors to use in the risk model are those (generally orthogonal) factors that explain the &lt;em&gt;cross-section&lt;/em&gt; of returns. For example, book-to-market (Value), log of market-cap (Size), covariance with the index (Beta) and other factors are effective at explaining the cross-section of returns. In fact for most of empirical history the above factors have a monotonic relationship with returns like this factor [ x-axis is the factor with equal frequency binning, the Y-axis is the return at some horizon ] :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/YxoEu.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, there are plenty of other factors that do not explain the cross-section of returns well. They may only explain returns for a particular quantile or at the tails like the leverage factor below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/77nKt.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For various statistical reasons (lack of monotinicity in particular) a factor like the one above would not be picked up in a regression while in competition with other factors such as Value, Size, or Beta. Or taken to the extreme, imagine a stock-screener which filters stocks based on a constellation of factors. Suppose we had a screen for &quot;buyout targets&quot; that produced a &quot;1&quot; if the set of conditions was present and 0 otherwise. This would be a lousy factor in our risk model (but great for our alpha model which I'll get back to).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since our purpose with the risk-model is to hedge risk this is perfectly fine and desirable. If we are trying to minimize the variance of the portfolio we want a covariance matrix built on factors that explain the cross-section of returns -- not variables that predict idiosyncratic returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get a bit more technical, we might also want to use a time-series based factor model as opposed to a cross-sectional regression model so that the errors in the estimated betas of the securities diversify away in a large portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the objective of the alpha model is to find returns not explained by exposures to systematic risk factors captured in the risk model. On the alpha-side we have far more flexibility to build creative models to identify which securities are priced to deliver excess returns. We might use our &quot;buyout targets&quot; screen, in-house analyst research, or even non-linear models to identify attractive alpha opportunities. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some practitioners use linear factor models to identify return opportunities. In the example @chrisaycock cited a security's &quot;cheapness&quot; (perhaps proxied by book-to-market) as a factor that a PM would want to tilt towards. Here's where the philosophy comes into play. Fama-French would say that the book-to-market factor is throwing off a risk-premium as compensation for exposure to a systematic risk (namely &quot;financial distress&quot;). The PM is saying - &quot;I diagree - I see the returns from the value factor as anomaly offering compensation without the attending increased risk/volatility.&quot;. (Turns out there are several of these anomalies such as low volatility and low-beta stocks generate higher returns.). So this PM would include book-to-market in their alpha model which would happen to be a linear factor model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Earlier we said that the objective of the risk-model is to construct a covariance matrix and estimate betas for the purpose of hedging. A time-series regression is well-suited to this task under most conditions (stable fundamentals, long-enough time-series, etc.). However, in the alpha-case one is better off using a cross-sectional regression strategy to identify the security mispricings. The cross-sectional regression can identify which securities generate superior relative performance (however, the estimated beta's suffer from an errors-in-variables bias that is not diversifiable hence these models are not suited for risk). This point is lost by many in the industry but Bernd Scherer nails it in his &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1906348359&quot; rel=&quot;noreferrer&quot;&gt;Portfolio Construction and Risk Budgeting&lt;/a&gt; text. So this is another reason, albeit, technical for having a separate expected-returns and risk-model.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-01-16T20:33:03.667" LastActivityDate="2012-01-16T20:33:03.667" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2782" PostTypeId="2" ParentId="2126" CreationDate="2012-01-16T19:33:25.977" Score="3" Body="&lt;p&gt;Exact Discretization of the Solution to the Geometric Brownian Motion&#xA;Stochastic Differential Equation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $P_{t}$ represent the time series of market prices of the underlying,&#xA;$\mu$ be its mean continuous log-return, $\sigma$ be its instantaneous&#xA;volatility and $W_{t}$ be a Wiener process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the stochastic differential equation for the geometric Brownian&#xA;motion:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;\frac{dP_{t}}{P_{t}}=\mu dt+\sigma dW_{t}&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the exact solution to the equation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;\ln\left(\frac{P_{t}}{P_{0}}\right)=\left(\mu-\frac{\sigma^{2}}{2}\right)t+\sigma W_{t}&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The discretization of this solution over a small but finite interval&#xA;$\delta$ is given by the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;\ln\left(\frac{P_{t+\delta}}{P_{t}}\right)=\left(\mu-\frac{\sigma^{2}}{2}\right)\delta+\sigma W_{t}&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W_{t}$ amounts to a standard normal variate $Z_{t}$ times&#xA;the square root of the time interval $\delta$, so that $W_{t}=Z_{t}\sqrt{\delta}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the time to maturity is $T$, the number of time steps corresponding&#xA;to the time interval $\delta$ is given by $n=\frac{T}{\delta}$.&#xA;Thus,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;\ln\left(\frac{P_{T}}{P_{0}}\right)=\left(\mu-\frac{\sigma^{2}}{2}\right)T+\sigma\sqrt{\delta}\sum_{k=1}^{n}Z_{k}&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When one perform simulations, a path is represented by the foregoing&#xA;formula, but there are as many instances of this formula as there&#xA;are paths to simulate, so that even if the deterministic part of the&#xA;formula is the same from path to path, the stochastic part of the&#xA;formula, the $Z_{k}$, have to be generated anew for each instance&#xA;of the formula, so that there are n times the number of simulations&#xA;standard normal random numbers to generate in order to generate one&#xA;path per simulation. Of course, the bigger the number of simulated&#xA;paths and the smaller the $\delta$, the more realistic are the results&#xA;of the simulation.&lt;/p&gt;&#xA;" OwnerUserId="1903" LastEditorUserId="35" LastEditDate="2012-01-16T19:48:47.560" LastActivityDate="2012-01-16T19:48:47.560" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2783" PostTypeId="2" ParentId="1733" CreationDate="2012-01-17T00:15:16.307" Score="4" Body="&lt;p&gt;This is an interesting question. I'll make a guess on what may be the driving factors for &quot;ratings inflation&quot; based on these assumptions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Rating agencies compete among themselves to conduct bond rating business with issuers, since they are paid for their services by the issuer.&lt;/li&gt;&#xA;&lt;li&gt;Bond issuers choose the agency that promises the highest rating, since the issuers benefit from having higher ratings through lower costs of debt.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Let's suppose one issuer's bond has a true rating of BBB (I adopt S&amp;amp;P's scale) and rating agencies know this. Now each agency may have an incentive to promise an A rating, which is one notch higher, if the benefit from doing so (winning the business) exceeds the cost (harm to reputation if the bond performs poorly). But, then each rating agency may have an incentive to promise an AA if again benefits exceed costs, and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To cut the long story short, in this setting, we might have an equilibrium in which all agencies inflate ratings and issuers choose randomly among these agencies. Note that in this equilibrium, if any agency diverges by promising the true rating, which is lower, it loses all of its bond rating business to competitors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this explanation makes sense!&lt;/p&gt;&#xA;" OwnerUserId="1907" LastActivityDate="2012-01-17T00:15:16.307" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2785" PostTypeId="1" CreationDate="2012-01-17T07:58:40.403" Score="10" ViewCount="686" Body="&lt;p&gt;Has there been any rigorous study on stop loss ? When to apply it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has it been shown to work through proper statistical backtests? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am interested in Equities, preferably European stocks. &lt;/p&gt;&#xA;" OwnerUserId="1909" LastEditorUserId="467" LastEditDate="2012-01-17T12:42:20.230" LastActivityDate="2012-01-17T13:08:47.540" Title="Any research paper on stop loss?" Tags="&lt;equities&gt;&lt;backtesting&gt;&lt;research&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2786" PostTypeId="2" ParentId="2785" CreationDate="2012-01-17T13:08:47.540" Score="11" Body="&lt;p&gt;I find this one very helpful:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1123362&quot;&gt;Re-Examining the Hidden Costs of the Stop-Loss&#xA;by Wilson Ma, Guy Morita, Kira Detko&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Abstract:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In this paper, we present general implications of the impact of&#xA;  stop-losses to future returns. The use of stop-losses change return&#xA;  distributions, but not in the way that one would typically expect. We&#xA;  find that while stop-losses can reduce position volatility, hidden&#xA;  costs offset perceived benefits in terms of altering future returns.&#xA;  Use of both stop-losses and profit-taking stops separately or in&#xA;  conjunction offer no statistically significant difference in expected&#xA;  return but have a meaningful impact in returns with drift, as the&#xA;  expected return converges to that of the underlying.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="12" LastActivityDate="2012-01-17T13:08:47.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2787" PostTypeId="1" CreationDate="2012-01-17T17:12:25.843" Score="2" ViewCount="1213" Body="&lt;p&gt;I learned how to price a European call option using this &lt;a href=&quot;https://umconnect.umn.edu/fmpresentation1/&quot; rel=&quot;nofollow&quot;&gt;video lecture&lt;/a&gt;. The considered case is very simple. The call option gives the right to buy 100 Euros for 100 Dollars in one month from now. The 100 Euros cost 100 Dollars now but in 1 month they will cost either 105 Euros or 95 Euros (the probability of both prices is the same). The proposed strategy is the following: We, as the option seller, sell the option for \$2.97, then we borrow \$47.03 (the interest rate is 1% for 1 month). We use these \$50 (47.03 + 2.97) to buy 50 Euros. This procedure guarantees that in one month we will not lose/earn anything independently of the price of the Euros.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why do we need to borrow? To me it seems to not be beneficial. We take \$47.03 and we need to return \$47.50. So, in total we lose \$0.47 independently of the price of the Euro.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would propose another strategy. We use our own money (\$47.03) to buy the 50 Euros (we also use \$2.97 to pay for the option). In this case, in one month, we do not need to repay any loan. As a result, we can earn \$0.47 independently of the price of the Euros.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could say that the second strategy is worse because, if we pay our own \$47.03, we cannot use this money for a whole month. Hence, the money will not earn interest. But we can consider this an investment. We use \$47.03 to earn \$47 in one month. So, the interest rate is 1%. You could say, that lending provides the same interest rate, so we could use the first strategy, and then use the saved \$47.03 to lend them out and earn the same \$0.47.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what if we use the second strategy (we take no loan to buy the 50 Euros)? Since we do not need to repay more money, we can make our option cheaper. It could cost \$2.50 instead of \$2.97. If we set the price equal to \$2.60, we will get \$0.10 from every option (independently of the price of the Euro). Since our option is cheaper than the options provided by other companies, we can sell a lot of options. We may not earn \$0.47 cents from the option, we will earn only \$0.10 but may be we will sell 10 times more options. Is this possible?&lt;/p&gt;&#xA;" OwnerUserId="981" LastEditorUserId="1106" LastEditDate="2012-01-18T00:25:30.733" LastActivityDate="2012-01-18T00:25:30.733" Title="Can we replicate a call option without borrowing and make it cheaper in this way?" Tags="&lt;options&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2789" PostTypeId="2" ParentId="2787" CreationDate="2012-01-17T18:59:04.780" Score="2" Body="&lt;p&gt;The starting situation for the two strategies is different, in the first you start with nothing in the second you start with 47.03 dollars. In this model it doesn't matter whether you use your strategy or invest this amount.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2012-01-17T18:59:04.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2790" PostTypeId="2" ParentId="2787" CreationDate="2012-01-17T21:27:05.627" Score="4" Body="&lt;p&gt;Bootvis has it right -- you have to assume the same starting situation.  It is true that psychologically both companies and individuals view borrowing and lending differently, but it is very useful to have a model independent of initial capital position.&#xA; In practice, of course, lending is often more lucrative then borrowing...that's basically the business plan of prime brokers, who make decent money in the business most of the time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm going to go ahead and answer the question I thought your title was going to lead to: namely, can one use the option markets themselves to borrow or lend money without using a bank?  The answer is yes, by what is known in the business as buying or selling &quot;boxes&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider going long a 1000 call, and short an 1100 call, plus long a 1100 put and short a 1000 put.  Then no matter where the underlying goes, the payoff of this structure is 100.  Therefore, you should be able to trade this structure, worth 100 sometime in the future, for something less than 100 right now.  If you buy it, you are loaning money to the market.  If you sell it, you are borrowing.  And no bank is involved (though of course the box does eat into your margin requirements, etc).&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-01-17T21:27:05.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2791" PostTypeId="2" ParentId="2439" CreationDate="2012-01-18T09:35:16.127" Score="3" Body="&lt;p&gt;The blog post &quot;A slice of S&amp;amp;P 500 skewness history&quot; &lt;a href=&quot;http://www.portfolioprobe.com/2012/01/16/a-slice-of-sp-500-skewness-history/&quot; rel=&quot;nofollow&quot;&gt;http://www.portfolioprobe.com/2012/01/16/a-slice-of-sp-500-skewness-history/&lt;/a&gt; has a bit of data on this question.  It appears that log returns might have some negative skew, but symmetry is a possibility.&lt;/p&gt;&#xA;" OwnerUserId="249" LastActivityDate="2012-01-18T09:35:16.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2792" PostTypeId="1" AcceptedAnswerId="2803" CreationDate="2012-01-18T17:55:30.233" Score="3" ViewCount="1816" Body="&lt;p&gt;Worden Brothers Inc. advertise a proprietary indicator called &lt;a href=&quot;http://www.worden.com/legacy/TeleChartHelp/Content/Indicators/Time_Segmented_Volume.htm&quot; rel=&quot;nofollow&quot;&gt;&lt;b&gt;Time Segmented Volume&lt;/b&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This gizmo &lt;em&gt;seems&lt;/em&gt; closely to resemble &lt;a href=&quot;http://www.investopedia.com/terms/o/onbalancevolume.asp#axzz1jpgGAbP5&quot; rel=&quot;nofollow&quot;&gt;&lt;b&gt;On Balance Volume&lt;/b&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any reason to think that TSV might yield a more useful or timely signal than OBV?&lt;/p&gt;&#xA;" OwnerUserId="618" LastEditorUserId="618" LastEditDate="2012-01-18T21:34:46.317" LastActivityDate="2012-01-20T05:01:15.633" Title="How does &quot;time segmented volume&quot; differ from on-balance volume?" Tags="&lt;technicals&gt;&lt;indicator&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2793" PostTypeId="1" AcceptedAnswerId="2797" CreationDate="2012-01-18T18:20:18.660" Score="5" ViewCount="937" Body="&lt;p&gt;Can a mortgage loan be treated like a bond and its duration calculated using the bond duration formula?  More precisely, can I calculate the loan portfolio duration for duration gap analysis, with coupon payment instead of annuity payments, loan value instead of bond value, loan rate in place of yield, and using the bond duration formula?&lt;/p&gt;&#xA;" OwnerUserId="1179" LastEditorUserId="1106" LastEditDate="2012-01-18T20:56:30.610" LastActivityDate="2015-05-07T09:35:34.927" Title="Can duration gap analysis be applied to mortgages?" Tags="&lt;fixed-income&gt;&lt;duration&gt;&lt;mbs&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2794" PostTypeId="5" CreationDate="2012-01-18T18:29:06.463" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2012-01-18T18:29:06.463" LastActivityDate="2012-01-18T18:29:06.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2795" PostTypeId="4" CreationDate="2012-01-18T18:29:06.463" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2012-01-18T18:29:06.463" LastActivityDate="2012-01-18T18:29:06.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2796" PostTypeId="2" ParentId="675" CreationDate="2012-01-18T21:03:39.457" Score="2" Body="&lt;p&gt;You might look into &lt;a href=&quot;http://pandas.sourceforge.net/index.html&quot; rel=&quot;nofollow&quot;&gt;pandas&lt;/a&gt;. It is a library with various statistical and financial data manipulation and analysis functions.&#xA;The developer gave a &lt;a href=&quot;http://blip.tv/pygotham/powerful-pythonic-data-analysis-using-pandas-5585546&quot; rel=&quot;nofollow&quot;&gt;presentation&lt;/a&gt; at the pygotham conference in 2011, and &lt;a href=&quot;http://pyvideo.org/video/305/python-in-quantitative-finance-158&quot; rel=&quot;nofollow&quot;&gt;one&lt;/a&gt; in 2010 specifically on using pandas with quantitative finance.&lt;/p&gt;&#xA;" OwnerUserId="1916" LastEditorUserId="1418" LastEditDate="2012-08-20T23:33:25.210" LastActivityDate="2012-08-20T23:33:25.210" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2797" PostTypeId="2" ParentId="2793" CreationDate="2012-01-19T02:29:16.993" Score="4" Body="&lt;p&gt;You don't say which duration, but it's generally okay to use effective duration:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;duration (eff) = \frac{-1}{P(r)}*\frac{Price(r+b) - Price(r-b)}{2*b}&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $r$ = rate and $b$ = yield shock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although, to address Brian's point, the mortgage contains an embedded call option that creates negative convexity, so the three re-pricings, $P(r)$, $P(r+b)$, $P(r-b)$, need to reflect prepayment assumptions. This cannot be done analytically, to my knowledge (I am aware of no analytical duration with &quot;extra terms&quot; for the prepayment risk). Rather, the effects of prepayment are  numerically figured into the re-pricings (typically you increase the PSA a bit at the lower yield). So, you do have numerical inputs into the &quot;analytical&quot; effective duration. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Technically, the effective duration is okay (and has the same role as modified duration: to give a first-order/linear approximation of the price change) because, if you re-price the bond to include varying prepayment rates, then you are just computing the slope (rise/run) of the tangent to the P/Y curve. It is helpful to see how the above formula is merely a slope formula, such that in the case of effective duration applied to negative convexity, it's the slope of a secant line that approximates the tangent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reference: Veronesi, Fixed Income Securities, in FRM&lt;/p&gt;&#xA;" OwnerUserId="640" LastEditorUserId="35" LastEditDate="2012-01-19T04:34:29.117" LastActivityDate="2012-01-19T04:34:29.117" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2798" PostTypeId="2" ParentId="2032" CreationDate="2012-01-19T04:11:15.680" Score="2" Body="&lt;p&gt;You are correct: none of the durations are the slope of (the tangent to) the price/yield curve. Rather the slope is the &quot;dollar duration&quot; = modified duration * Price *-1. This will tend to betray rather large numbers; e.g., under continuous compounding the modified/Macaulay duration of a 100 par 10-year zero coupon bond is 10.0 years. The slope (of the tangent) at yield = 5% = -P(D) = 100[exp(-5%*10)]10 = -606. As a linear approximation, the price change is 606 for a 1 unit change in the x-axis, where 1.0 unit = 100% change (10,000 basis points).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this way, fwiw, the slope is the dollar duration is also DV01 (aka, PVBP) * 10,000 as Mod duration * Price / 10,000 = DV01&lt;/p&gt;&#xA;" OwnerUserId="640" LastActivityDate="2012-01-19T04:11:15.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2800" PostTypeId="2" ParentId="1172" CreationDate="2012-01-19T15:07:28.453" Score="2" Body="&lt;p&gt;I have struggled to find such a book. I got enthusiastic when I first heard about Taleb's &lt;em&gt;Dynamic Hedging&lt;/em&gt;, but I found it really disappointing. Doesn't give any market insight into vol trading at all. I just remember something about him saying that digitals are scary to risk manage so you should always price them as a call spread - but we all know that! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think there is space for just such a book.&#xA;As an effort to bridge the gap I wrote a post in my blog which explains a lot of the lingo you might hear on a fixed-income trading floor. Understanding the jargon is certainly one important step towards understanding what &lt;em&gt;really happens&lt;/em&gt; on the trading floor. (Click &lt;a href=&quot;http://fermatslastspreadsheet.wordpress.com/2011/11/30/mine-yours/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; to read)&lt;/p&gt;&#xA;" OwnerUserId="1920" LastEditorUserId="1920" LastEditDate="2012-01-30T07:50:09.717" LastActivityDate="2012-01-30T07:50:09.717" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2802" PostTypeId="2" ParentId="925" CreationDate="2012-01-20T01:21:50.480" Score="-1" Body="&lt;p&gt;Let us assume that you want to obtain the change in the price C of a plain vanilla call on a stock with price S varying with time t.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For trading, $\Delta$, $\Theta$ and $\Gamma$ matter, as in the&#xA;following Taylor series expansion of C in terms of S and t:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;dC\approx\Delta dS+\Theta dt+\frac{1}{2}\Gamma\left(dS\right)^{2}&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming a delta-neutral portfolio, gamma hedging consists of buying&#xA;or selling further derivatives to achieve a gamma neutral portfolio,&#xA;i.e. $\Gamma=0$. [...] Since [stocks and futures contracts]&#xA;both have a constant $\Delta$ and thus $\Gamma=0$, [... they]&#xA;can be used to make a gamma neutral portfolio delta neutral. [...]&#xA;From [the] Black-Scholes formula it follows for a delta neutral&#xA;portfolio consisting of stock options&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;rV=\Theta+\frac{1}{2}\sigma^{2}S^{2}\Gamma&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with V consisting of the portfolio value [and r the continuous risk&#xA;free interest rate]. $\Theta$ and $\Gamma$ depend on each other&#xA;in a straightforward way. Consequently, $\Theta$ can be used instead&#xA;of $\Gamma$ to gamma hedge a delta neutral portfolio.''&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The preceding is an excerpt from : Franke, J. Haerdle, W.K., Hafner,&#xA;C.M., ``Statistics of Financial markets - An Introduction'', Second&#xA;Edition, Springer, 2008, pp. 104-107&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following is an excerpt from page 110 of the same source.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for Vanna, the derivation of the Black Scholes formula yields:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;Vanna=\left(\sqrt{\tau+\frac{1}{\sigma}}\right)\varphi\left(d1\right)&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\varphi\left(\right)$ is the normal probability density function&#xA;and $d1$ is the familiar value from the Black-Scholes equation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;d1=\frac{\ln\left(\frac{S}{K}\right)+\left(b+\frac{\sigma^{2}}{2}\right)\tau}{\sigma\sqrt{\tau}}&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where, as is the custom,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$b$ is the continuous time equivalent of the dividend rate on the stock&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma$&#xA;  is the instantaneous volatility of the price of the stock&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$K$ is the exercise price of the option&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\tau$&#xA;  is the time to expiration of the option&lt;/p&gt;&#xA;" OwnerUserId="1903" LastEditorUserId="1903" LastEditDate="2012-03-04T02:32:45.707" LastActivityDate="2012-03-04T02:32:45.707" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2803" PostTypeId="2" ParentId="2792" CreationDate="2012-01-20T05:01:15.633" Score="3" Body="&lt;p&gt;It seems that this is the key difference between OBV and TSV:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Time segmented volume is the way to get consistent volume data and eliminate all the volume distortions that we discussed above. Here's the key to why time segmented volume works: Let's start with volume on a 5 minute chart and for this example, look at the 10:15 bar. Now take the average of only the 10:15 bars over the prior month and compare that average to the current 10:15 bar. The difference will give a true reading on whether today's 10:15 bar volume is higher or lower in comparison to the exact same time bars over the past month.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;from: &lt;a href=&quot;http://www.squidoo.com/Time_Segmented_Volume&quot; rel=&quot;nofollow&quot;&gt;http://www.squidoo.com/Time_Segmented_Volume&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OBV is based on a cumulative total volume, while TSV compares the current time period to a previous one, no running total.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to which is &quot;better&quot;, well that depends on a lot of things and it would be unrealistic to assume that one was better than the other in all cases.&lt;/p&gt;&#xA;" OwnerUserId="1842" LastActivityDate="2012-01-20T05:01:15.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2805" PostTypeId="1" AcceptedAnswerId="2814" CreationDate="2012-01-20T14:31:43.850" Score="13" ViewCount="2560" Body="&lt;p&gt;I am trying to understand how to use macroeconomic data in my trading. I understand that using such data could be used to gauge an overall view of the market and how it's doing as a whole. I have been trying to make sense of the information contained to infer weights for different equities/sectors but find myself stuck.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My end goal is to be able to incorporate the information in macroeconomic and other market indicators into my trading strategies(Long/Short Equity) - possibly weighting stocks differently based on this data or some sort of sector rotation strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you please suggest a typical usage example of macro data in trading and/or recommend some good reading material(books/research papers/etc) so that I may able to make good use of macro data in trading?&lt;/p&gt;&#xA;" OwnerUserId="1926" LastActivityDate="2012-01-22T10:51:11.863" Title="How to use macroeconomic indicators for long/short trading strategies?" Tags="&lt;quant-trading-strategies&gt;&lt;indicator&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="2807" PostTypeId="1" AcceptedAnswerId="2808" CreationDate="2012-01-21T00:58:26.730" Score="9" ViewCount="1191" Body="&lt;p&gt;Steps to replicate:&#xA;Take the correlation matrix of a sample of stocks in the SP500, or a set of ETF's that are include some that are highly correlated (0.7 and above).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Problem observed:&#xA;I observe that if there are clusters of high correlations the distributions of eigenvalues I see do not seem to follow the &quot;MP marchenko pastur&quot; distribution that RMT talks about. Essentially the first few eigenvalues are incredibly &quot;high&quot; and dwarf all the others, if I exclude these first few then it starts to look somewhat like an MP distribution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Questions:&#xA;1) Is RMT valid if high correlations are present, or does it presume &quot;independnet&quot; return series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Is it necessary to remove the &quot;market&quot; component or drop the first few eigenvalues before performing the &quot;cleaning&quot; procedure?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) In general is there any guidance on using covariance shrinkage vs RMT - which works best and when for the purposes of minimum variance optimization? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks very much, this is a fantastic forum.&lt;/p&gt;&#xA;" OwnerUserId="2186" LastActivityDate="2012-04-28T13:56:09.510" Title="Does random matrix theory (RMT) for returns' correlation matrices apply if there are high correlations?" Tags="&lt;correlation&gt;&lt;random-matrix-theory&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="2808" PostTypeId="2" ParentId="2807" CreationDate="2012-01-21T04:21:59.487" Score="8" Body="&lt;p&gt;This is a misunderstanding of how to apply RMT theory. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The point of the MP distribution is to describe the expected distribution of eigenvalues assuming a symmetric matrix whose elements are drawn from a normal distribution of mean zero and some sigma. So if you observe eigenvalues beyond the level predicted by MP this means you have found factors that are non-random.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, when applied to market data it is quite common to find several factors that are extraordinarily large vs. the upper noise band predicted by RMT. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&quot;Is RMT valid if high correlations present&quot; -- answered above. Short answer - yes.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Not n'ecy to remove the market component. And definitely do not remove the largest eigenvalues. The point is to preserve them and &quot;cleanse&quot; the remainder. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Covariance shrinkage is compelling as well. You have to do you own empirical study to compare the two given the nature of the data. The downside with RMT is you have more parameters to deal with (exponential decay factor, cleansing the correlation matrix vs. the covariance matrix, parameter Q, etc.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;A fuller description of the RMT process is &lt;a href=&quot;https://quant.stackexchange.com/questions/2763/one-dimensional-analog-of-cleansing-a-correlation-matrix-via-random-matrix-theor&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2012-01-21T22:36:27.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2809" PostTypeId="2" ParentId="2807" CreationDate="2012-01-21T09:01:50.150" Score="7" Body="&lt;p&gt;Regarding the optimization question: I haven't compared random matrix estimates to shrinkage estimates, but shrinkage seems to beat (statistical) factor models -- see a series of blog posts at &lt;a href=&quot;http://www.portfolioprobe.com/tag/ledoit-wolf-shrinkage/&quot;&gt;http://www.portfolioprobe.com/tag/ledoit-wolf-shrinkage/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, my guess is that random matrix estimates behave a lot like factor models, and hence that shrinkage is better.  Note: my guesses have been wrong before.&lt;/p&gt;&#xA;" OwnerUserId="249" LastActivityDate="2012-01-21T09:01:50.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2810" PostTypeId="1" AcceptedAnswerId="2811" CreationDate="2012-01-21T18:49:48.947" Score="5" ViewCount="369" Body="&lt;p&gt;I am seeing an issue when callibrating an MP distribution. Assume a log return series for the SP500 with the following dimensions&lt;/p&gt;&#xA;&#xA;&lt;p&gt;dim(xts.sp500.ret.stocksonly)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;==&gt; [1] 1133  478&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sp500.cor &amp;lt;- cor.empirical(xts.sp500.ret.stocksonly)&#xA;sp500.eigens &amp;lt;- eigen(sp500.cor)$values&#xA;sp500.eigen.density &amp;lt;-  density(sp500.eigens,n=5000)&#xA;plot(sp500.eigen.density,xlim=c(0,4),main=&quot;sp500 returns eigenvalue density&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I assume my 'Q' value is 1133/478 = &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://imgur.com/FC3OF.jpg&quot; alt=&quot;eigenvalues sp500&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt;&#xA;Even though the 'shape' and cutoffs seem OK -- the density value (y axis) seem vastly OFF. Peak of 1.5 for the real series - 5 or so for the theoretical, (note I am truncating the plot so the market eigenvalues are not shown, they are huge around 200).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question:&#xA;1) Is this expected?&#xA;2) How does this affect callibration? Should I trust the results and simply look at the cutoffs?&#xA;3) Also when 'cleansing' the matrix I see most code (e.g. filter.RMT in tawny) simply replaces values below Lambda+ with the average, what about Lambda- though?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks much!&lt;/p&gt;&#xA;" OwnerUserId="2186" LastEditorUserId="1800" LastEditDate="2012-01-24T21:09:49.037" LastActivityDate="2012-01-24T21:09:49.037" Title="RMT (Random Matrix Theory) issue with callibrating MP distribution -" Tags="&lt;correlation&gt;&lt;portfolio&gt;&lt;random-matrix-theory&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2811" PostTypeId="2" ParentId="2810" CreationDate="2012-01-21T22:35:08.207" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The plot function is smoothing the plot. You should show the distribution of eigenvalues via a bar chart. Because a bar chart is discrete you can better discern the separation of the top-most eigenvaules. The top-most eigenvalue (representing the market factor) should be substantially greater than bulk of the eigenvalue distribution. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I assume by &quot;calibration&quot; you mean &quot;eigenvalue cleansing&quot;. The approach would be to apply the RMT cleansing procedure on eigenvalues beneath the upper noise-band (lambda+)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The procedure of replacing eigenvalues below Lambda+ with the average will by definition also replace values below Lambda- as well. Replacing the eigenvalues by the average is one of many possible cleansing procedures.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2012-01-21T22:35:08.207" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2813" PostTypeId="2" ParentId="111" CreationDate="2012-01-22T05:01:38.260" Score="6" Body="&lt;p&gt;I'm currently working on this task, to apply machine learning to stock trading. However, the concerns raised in other answers are major obstacles. So, I'm taking a different tact.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My strategy is more akin to teaching a car to drive - the machine learning is not based on the underlying data, but rather on the driver's reaction to the data. So based on what the road looks like, the steering position of the wheel. The machine observes &quot;correct&quot; driving, and can very quickly mimic the driving actions. I think this is referred to as &quot;Supervised Learning&quot; (I'm very new to formal machine learning - taking the Stanford class on iTunes U).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To apply this tact to stock trading, you take the factors that you personally consider when trading stocks (price, moving average, volume, whatever) and make those measures available as inputs to your machine learning algorithm. Then, for a series of data points, you enter the &quot;right&quot; answer, which I prefer to organize as LONG/SHORT/FLAT. Of course this doesn't help if you are bad at trading stocks, but it does help create an agent who can do whatever you would do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The overall idea isn't to create a millionaire black box, but rather to free up your time from watching the market closely, or to allow you to apply your strategies to more stocks that you otherwise would be able. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If anyone would like to collaborate with me, please feel free to contact. I'm currently implementing the above as an iOS &amp;amp; Mac app.&lt;/p&gt;&#xA;" OwnerUserId="1931" LastActivityDate="2012-01-22T05:01:38.260" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2814" PostTypeId="2" ParentId="2805" CreationDate="2012-01-22T10:51:11.863" Score="4" Body="&lt;p&gt;I am not aware of a research specifically on integrating Macro view, but I'll give a shot at your question, hopefully it helps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe the answers depends on the initial trading strategies and on the macroeconomic indicators. From the way you formulate your question, I imagine that your trading strategy in based on quantitative asset allocation (mean-variance, for example). Let's denote the quantitative allocation $w_q$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, I would suggest you establish a framework for your macro-indicators which will output a macro-economic allocation $w_m$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You then have to mix them together to obtain your final allocation $w$, and &lt;a href=&quot;https://quant.stackexchange.com/users/1800/quant-guy&quot;&gt;Quant Guy&lt;/a&gt; provided a brilliant response in &lt;a href=&quot;https://quant.stackexchange.com/q/2707/467&quot;&gt;this post&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2012-01-22T10:51:11.863" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2815" PostTypeId="1" CreationDate="2012-01-22T11:26:14.120" Score="5" ViewCount="568" Body="&lt;p&gt;When preforming Johansen cointegration test for 2 time series (the simple case) you need to decide the lag you want to use. Doing the test for different lag levels returns different results: for some lag levels the null hypothesis can be rejected but for others it can't.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is what is the right method based on the input data to decide what lag I need to use?&lt;/p&gt;&#xA;" OwnerUserId="1463" LastEditorUserId="848" LastEditDate="2012-01-22T14:01:11.770" LastActivityDate="2014-06-12T03:19:27.773" Title="What is the correct procedure to choose the lag when preforming Johansen cointegration test?" Tags="&lt;cointegration&gt;&lt;auto-correlation&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2816" PostTypeId="1" CreationDate="2012-01-22T14:21:09.137" Score="2" ViewCount="1328" Body="&lt;p&gt;&lt;a href=&quot;http://amibroker.com/library/detail.php?id=358&quot; rel=&quot;nofollow&quot;&gt;&lt;b&gt;amibrokers&lt;/b&gt;&lt;/a&gt; has this calculation for TSV:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;_SECTION_BEGIN(&quot; Time Segmented Volume &quot;);&#xA;&#xA;t=(Sum(IIf( C&amp;gt;Ref(C,-1), (V*(C-Ref(C,-1))),IIf(C&amp;lt;Ref(C,-1),(V*(C-Ref(C,-1))),0)),13));&#xA;m=MA(t ,7 );&#xA;Plot(t, &quot;Time Segmented Volume 13&quot;, colorRed);&#xA;Plot(m, &quot; Simple Moving Average 7&quot; , colorYellow);&#xA;&#xA;_SECTION_END();&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Key: t is calculated TSV; read IIF as IF (happily, IIF has been defenestrated); C is the close on the current bar; (C,-1) is the close on the just-previous bar. @chrisaycock points out below that the usual trading day in the US has 13 half-hour periods, represented perhaps by the constant 13. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you comment on the correctness of the calculation? Or suggest a better one?&lt;/p&gt;&#xA;" OwnerUserId="618" LastEditorUserId="16595" LastEditDate="2019-06-24T14:56:12.527" LastActivityDate="2019-06-24T14:56:12.527" Title="How to calculate time-segmented volume?" Tags="&lt;volume&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ClosedDate="2012-02-06T21:31:04.413" ContentLicense="CC BY-SA 3.0" />
  <row Id="2818" PostTypeId="2" ParentId="2439" CreationDate="2012-01-24T08:38:14.530" Score="1" Body="&lt;p&gt;There is an ongoing trend in GARCH modeling that seeks explain the why of this phenomena. Some economic explanations iv'e read revolve around the effects of leveraged positions and flights to liquidity. The GARCH model derivatives used are usually classified as asymmetric power models I believe. &lt;/p&gt;&#xA;" OwnerUserId="1940" LastActivityDate="2012-01-24T08:38:14.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2820" PostTypeId="1" AcceptedAnswerId="9379" CreationDate="2012-01-24T17:52:22.527" Score="17" ViewCount="11081" Body="&lt;p&gt;Spectrum analysis is often used to analyse waveforms. A common configuration, for example, is to create a graph where X is time, Y is frequency, and the brightness of each position represents amplitude.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has spectrum analysis ever been used successfully as an indicator to analyse historical price data, for example the price of shares over time?&lt;/p&gt;&#xA;" OwnerUserId="1943" LastEditorUserId="35" LastEditDate="2012-01-24T18:47:02.677" LastActivityDate="2020-07-21T15:06:43.757" Title="Has spectrum analysis ever been used successfully to analyse historical price data?" Tags="&lt;market-data&gt;&lt;market&gt;&lt;theory&gt;&lt;trade&gt;&lt;price&gt;" AnswerCount="9" CommentCount="4" FavoriteCount="27" ContentLicense="CC BY-SA 3.0" />
  <row Id="2821" PostTypeId="2" ParentId="2820" CreationDate="2012-01-24T19:04:41.877" Score="7" Body="&lt;p&gt;I would recommend Marc Wildi's work on &lt;a href=&quot;http://web.archive.org/web/20150102135036/http://www.zhaw.ch/de/engineering/institute-zentren/idp/forschung/finance-risk-management-and-econometrics/signal-extraction-and-forecasting/signal-extraction.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;signal extraction&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The link above points to the web archive, since the site no longer appears to exist.  I've reproduced the relevant text below. I'm not sure the links on the archived page would work anyway.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h2&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;Signal extraction is about the definition and the estimation of interesting signals in time series. In practice, attention is often focussed on the current boundary of time series: does the seasonally adjusted unemployment rate increase or decrease, do we observe a turning-point in the business-cycle, should we keep, buy or sell an asset based on the current momentum? We here analyse the structure of prospective real-time signal extraction problems by emphasizing trend estimation and derive specific (efficient) solutions for level-approximations as well as or for the early detection of turning-points.&lt;/p&gt;&#xA;&lt;p&gt;Our contribution and therefore the novelty of our approach, lies in the scrupulous matching of optimization criteria and tests to the underlying problem structures. The latest iteration of the book on real-time signal extraction conveys a comprehensive treatment of the subject. Additionally, selected articles, projects, presentations and pieces of software code give access to more detailed aspects of our work on the topic. These techniques are currently in use in leading economic indicators, in governmental analysis tools as well as in trading algorithms. Current developments include very promising non-linear and multivariate extensions of our original approach.&lt;/p&gt;&#xA;&lt;h2&gt;Books&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;M. Wildi (Version as of 30 Jun 2008) Real-Time Signal Extraction - Beyond Maximum Likelihood Principles&lt;/li&gt;&#xA;&lt;li&gt;M. Wildi (Version as of 26 Nov 2007) Real-Time Signal Extraction - Beyond Maximum Likelihood Principles&lt;/li&gt;&#xA;&lt;li&gt;M. Wildi (Version as of 20 Oct 2007) Real-Time Signal Extraction - Beyond Maximum Likelihood Principles&lt;/li&gt;&#xA;&lt;li&gt;M. Wildi (2006) Signalextraction - Efficient Estimation, 'Unit-Root'-Tests and Early Detection of Turning-Points, Springer.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2&gt;Papers&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Wildi, M. (2008) Customized Forecasting Criteria or 'How to Win Forecasting Competitions?', IDP Working Paper, IDP-WP-08Sep-05&lt;/li&gt;&#xA;&lt;li&gt;Wildi, M. and Elmer, S. (2008) Real-Time Filtering and Turning-Point Detection: Application of Customized Criteria (DFA) to the US Business Cycle, IDP Working Paper, IDP-WP-08Sep-04&lt;/li&gt;&#xA;&lt;li&gt;Wildi, M. and Hoenecke, O. (2008) Real-Time Filtering: Non-Linear DFA and Asymmetry of the US Business Cycle, IDP-Working paper, IDP-WP-08Sep-03&lt;/li&gt;&#xA;&lt;li&gt;Wildi, M. and Sturm, J.-E. (2008) Real-Time Filtering: Using the Multivariate DFA to Monitor the US Business Cycle, IDP-Working paper, IDP-WP-08Sep-02&lt;/li&gt;&#xA;&lt;li&gt;Wildi, M. (2008) Efficient Multivariate Real-Time Filtering and Cointegration, IDP-Working paper, IDP-WP-08Sep-01&lt;/li&gt;&#xA;&lt;li&gt;Perrin, D. and Wildi, M. (2008) Statistical Modeling of Writing Processes, IDP Working Paper, IDP-WP-07Aug-01&lt;/li&gt;&#xA;&lt;li&gt;A collection of other papers on signal extraction by Marc Wildi&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2&gt;Software&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Case study on signal extraction with R-package source code&lt;/li&gt;&#xA;&lt;li&gt;Link to &lt;a href=&quot;https://cran.r-project.org/package=signalextraction&quot; rel=&quot;nofollow noreferrer&quot;&gt;CRAN package signalextraction&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2&gt;Selected Projects&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;KOF new economic barometer&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2&gt;Presentations at conferences and workshops&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;IASCA 2008 (5-8 December 2008)&lt;/li&gt;&#xA;&lt;li&gt;CIRET 2008 (8-11 October 2008)&lt;/li&gt;&#xA;&lt;li&gt;5th EUROSTAT Colloquium on modern tools in business cycle analysis (28 Sept - 1 Oct 2008)&lt;/li&gt;&#xA;&lt;li&gt;IDP Colloquium (27 November 2007)&lt;/li&gt;&#xA;&lt;li&gt;Beijing Academy of Sciences (12-19 November 2007)&lt;/li&gt;&#xA;&lt;li&gt;CIRANO Workshop Montréal (5-6 October 2007)&lt;/li&gt;&#xA;&lt;li&gt;KOF Conference on real-time series, Zurich (9 July 2007)&lt;/li&gt;&#xA;&lt;li&gt;Rmetrics Seminar Meielisalp, Switzerland (July 2007)&lt;/li&gt;&#xA;&lt;li&gt;International Symposium on Forecasting, New York, USA (24-27 June 2007)&lt;/li&gt;&#xA;&lt;li&gt;ERCIM Workshop Geneva 2007 (20-22 April 2007)&lt;/li&gt;&#xA;&lt;li&gt;German Ministry of Technology and Economy, Berlin (2007)&lt;/li&gt;&#xA;&lt;li&gt;Conference EUROSTAT on leading indicators (2007)&lt;/li&gt;&#xA;&lt;li&gt;Conference EUROSTAT on seasonal adjustment, Luxembourg (10-12 May 2006)&lt;/li&gt;&#xA;&lt;li&gt;International Symposium on Forecasting, Santander, Spain (2006)&lt;/li&gt;&#xA;&lt;li&gt;IFO Conference on Survey Data, Munich (14-15 October 2005)&lt;/li&gt;&#xA;&lt;li&gt;International Symposium on Forecasting, San Antonio, Texas, USA (2005)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="56" LastEditorUserId="56" LastEditDate="2020-07-21T15:06:43.757" LastActivityDate="2020-07-21T15:06:43.757" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="2822" PostTypeId="2" ParentId="2820" CreationDate="2012-01-24T19:59:42.803" Score="4" Body="&lt;p&gt;Yes. Check out &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1441921257&quot; rel=&quot;nofollow&quot;&gt;Time-Series Analysis&lt;/a&gt; by Shumway and Stoffer. Spectral Analysis and Filtering is covered in Chapter 4.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2012-01-24T19:59:42.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2823" PostTypeId="2" ParentId="103" CreationDate="2012-01-24T22:44:07.460" Score="11" Body="&lt;p&gt;The risk-netural measure has a massively important property which is worth making very clear:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The price of any trade is equal to the expectation of the trade’s winnings and losses under the risk-neutral measure.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This property gives us a scheme for pricing derivatives:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;take a collection of prices of trades that exist in the market (eg swap rates, bond prices, swaption prices, cap/floor prices),&lt;/li&gt;&#xA;&lt;li&gt;back out the set of risk-neutral probabilities that these prices imply,&lt;/li&gt;&#xA;&lt;li&gt;calculate the expectation of the derivative trade’s payoff under these risk-neutral proabilities,&lt;/li&gt;&#xA;&lt;li&gt;that is the price of the derivative.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The risk-neutral measure is in some sense the flip-side of the concept of &lt;em&gt;risk premium&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without even getting mixed up with stock and bond prices and suchlike, we can get a good sense of the risk-premium concept at work in a simple betting game.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The classic example, a game of coin tossing:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;a player hands over some money, say £X, to play,&lt;/li&gt;&#xA;&lt;li&gt;the host tosses an unbiased coin,&lt;/li&gt;&#xA;&lt;li&gt;if it comes up heads then the player is given £2,&lt;/li&gt;&#xA;&lt;li&gt;but if it comes up tails then nothing is given back.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;A textbook on probability will tell you that the price of £1 per go is fair for this game because the concept of fair is defined in probability textbooks to mean that the price paid should equal the value of the expected winnings. Clearly it does for this example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But let’s get savvy, step back from the theory, and ask how much would different players be prepared to pay for this game. Consider two different players:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;person A that has £1.50 in their pocket but is under pressure from a traffic warden to pay £2 for a parking ticket (and nothing less than £2 will do),&lt;/li&gt;&#xA;&lt;li&gt;person B that has £10 in their pocket and doesn’t really need anything more than that.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Don’t you think you could convince person A to pay up to their whole £1.50 for this game? Person B might be a harder sell, but perhaps they’d come around if we charged something like 50p a go and advertised the game as ‘potential 4 times returns on your investment’?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The important point is that the theoretical fair price may well be £1 for this game, but the actual price at which we sell the game may be something different since it will depend on the circumstances of the players we are selling it to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The difference between the actual and theoretical price is called the &lt;em&gt;risk premium&lt;/em&gt;. Throwing in a bit of market language, we can write this as:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;the &lt;strong&gt;risk premium&lt;/strong&gt; is the amount of premium (or discount) that needs to be added to the theoretical fair price in order to match the actual price of the trade in the market.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Remark:&lt;/strong&gt; The risk-neutral measure is &lt;em&gt;risk-neutral&lt;/em&gt; because in this alternative reality the price paid by player A for the game contains no risk premium — the price is &lt;em&gt;exactly equal&lt;/em&gt; to the value of the expected winnings of the game.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have written a little bit more on this in &lt;a href=&quot;http://fermatslastspreadsheet.wordpress.com/2012/01/24/what-is-the-risk-neutral-measure/&quot; rel=&quot;noreferrer&quot;&gt;my blog&lt;/a&gt; if you want to go see.&lt;/p&gt;&#xA;" OwnerUserId="1920" LastEditorUserId="1920" LastEditDate="2012-01-27T07:38:11.343" LastActivityDate="2012-01-27T07:38:11.343" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2824" PostTypeId="2" ParentId="2820" CreationDate="2012-01-25T01:40:50.743" Score="2" Body="&lt;p&gt;Fractal spectra are covered in &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0121500136&quot; rel=&quot;nofollow&quot;&gt;Multifractal Volatility: Theory, Forecasting, and Pricing&lt;/a&gt;. Also note that your run-of-the-mill moving average of a price series is a low-pass filter (filters out the higher frequencies), and moving averages are very used in basic financial analysis.&lt;/p&gt;&#xA;" OwnerUserId="1945" LastEditorUserId="1945" LastEditDate="2012-01-25T19:15:45.780" LastActivityDate="2012-01-25T19:15:45.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2825" PostTypeId="2" ParentId="2820" CreationDate="2012-01-25T02:27:41.773" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://www.amazon.ca/Introduction-Wavelets-Filtering-Methods-Economics/dp/0122796705/ref=sr_1_1?ie=UTF8&amp;amp;qid=1327458407&amp;amp;sr=8-1&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; is a gentle introduction to wavelet methods. &lt;/p&gt;&#xA;" OwnerUserId="1531" LastActivityDate="2012-01-25T02:27:41.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2828" PostTypeId="1" AcceptedAnswerId="34037" CreationDate="2012-01-25T13:32:07.137" Score="8" ViewCount="1480" Body="&lt;p&gt;I am preparing an undergraduate QuantFinance lecture. I want to demonstrate the ideas of &lt;a href=&quot;http://en.wikipedia.org/wiki/Ito_calculus&quot; rel=&quot;nofollow noreferrer&quot;&gt;Ito's correction term and Ito's lemma&lt;/a&gt; in the most accessible manner.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My idea is to take the &quot;working horse&quot; of Quantitative Finance, the &lt;a href=&quot;http://en.wikipedia.org/wiki/Binomial_options_pricing_model&quot; rel=&quot;nofollow noreferrer&quot;&gt;binomial model&lt;/a&gt; and demonstrate both concepts there. Unfortunately I haven't found any references and am encountering unanticipated difficulties myself in combining both views.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When these concepts can be found in the continuous version they must be hiding in the discrete version too - can anybody please demonstrate them this way or give some reference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;br&gt;&#xA;I found the following demonstration of a skewed Galton board which results in a lognormal distribution &lt;a href=&quot;http://stat.ethz.ch/~stahel/lognormal/lnboard/start_applet.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/13q05.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is described in this article too (p. 343): &lt;a href=&quot;http://stat.ethz.ch/~stahel/lognormal/bioscience.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://stat.ethz.ch/~stahel/lognormal/bioscience.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think that - if anywhere - Ito's lemma/correction term must hide here. But this has to be made exact!&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2015-02-27T15:58:37.290" LastActivityDate="2017-05-03T15:54:54.073" Title="Demonstration of Ito's correction term/lemma in binomial tree" Tags="&lt;binomial-tree&gt;&lt;itos-lemma&gt;&lt;lognormal&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2829" PostTypeId="2" ParentId="2828" CreationDate="2012-01-25T15:12:29.273" Score="2" Body="&lt;p&gt;I doubt you can do this. Correction term appears in Ito because Brownian motion has infinite variation (non zero quadratic variation). In discrete and therefore finite models you cannot observe this phenomenon.&lt;/p&gt;&#xA;" OwnerUserId="370" LastEditorUserId="370" LastEditDate="2012-01-25T15:53:02.410" LastActivityDate="2012-01-25T15:53:02.410" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2831" PostTypeId="1" AcceptedAnswerId="2834" CreationDate="2012-01-25T22:23:02.173" Score="18" ViewCount="1768" Body="&lt;p&gt;I have read about something like Kelly criterion for long term expectation maximization assuming a fixed starting bankroll. But if one can assume unlimited leverage, and one has a signal for a price movement..how could one go about deciding optimal trading sizes? It would seem to me like there are a lot of factors involved (things like transaction costs, inventories, etc..) - in practice would one come up with some intuitive model for this and run historical simulations for it? Or how would one tackle this? Is there any literature which I can read up on to understand this problem better?&lt;/p&gt;&#xA;" OwnerUserId="1456" LastEditorUserId="467" LastEditDate="2012-01-25T22:56:34.390" LastActivityDate="2013-03-29T20:32:13.730" Title="From a high frequency point of view, with a price prediction and assuming infinite leverage, how do you determine optimal trade size?" Tags="&lt;quant-trading-strategies&gt;&lt;high-frequency&gt;&lt;modeling&gt;&lt;position-sizing&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="2832" PostTypeId="1" CreationDate="2012-01-25T22:56:35.940" Score="7" ViewCount="153" Body="&lt;p&gt;to limit interest rate paths to a 'reasonable' range (if we could define reasonable).  Now we calibrate log-normal skew and mean reversion monthly to robust basket of atm swaptions and in and out caps.  Sometimes resulting in at least five percent of the paths exceeding 40% (1 month forward rate) and reaching over 250%.  Most / many months - the highest paths never exceed 50%.  Also - any recommendations on how to analyze how this affects resulting metrics such as OAS or effective duration for mortgage-related assets?&lt;/p&gt;&#xA;" OwnerUserId="1949" LastActivityDate="2012-01-27T04:58:02.837" Title="Should we apply practical constraints on the distribution of monte carlo paths?" Tags="&lt;option-pricing&gt;&lt;volatility&gt;&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;monte-carlo&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2833" PostTypeId="2" ParentId="2831" CreationDate="2012-01-25T23:03:08.170" Score="7" Body="&lt;p&gt;The investor's holdings is a consequence of an investor's utility function interacting with the investor's perceived trading opportunity subject to constraints. (Indeed, the Kelly criterion is also utility maximizing.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We produced trades by re-balancing -- that is to say, we have new expectations of alpha or risk and the optimal portfolio net of these factors and transactions costs produces a new set of optimal portfolio weights. The difference between the new target set of weights and current weights multiplied by the portfolio value produces a trade-schedule.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A utility function would likely include the following terms i) contribution from alpha (in % returns terms, or risk-adjusted terms), a ii) a penalty for taking on portfolio risk defined in some way (variance, cVaR, etc.), a iii) a penalty for incurring transactions costs (again, in % of the portfolio terms). The last term in particular would account for existing holdings, liquidity, bid-ask spreads, and market impact.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each one of these terms is a well-defined function of portfolio weights. For example, (i) is the cross-product of expected alphas and security weights; (ii) might be the variance of the portfolio given a covariance matrix and weights. Since the utility is a function of portfolio weights, an optimizer can be used to identify the utility-maximizing portfolio(s).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each portfolio objective would also have its own lambda associated with it based on the relative priority of the objectives. For example, in mean-variance optimization a frontier of efficient portfolios is identified and the investor's risk-aversion as expressed by the lambda identifies the optimal portfolio along the frontier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each function can also be tested and evaluated in isolation. For example, using real trade data you can update your transactions costs model to improve your overall portfolio construction process. So focusing on developing effective models at the objective level would be a reasonable research program before chaining them together in a utility function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several ways to implement these multiple goal objectives. Polynomial goal programming for example. Or you can find a optimizer that uses the method of lagrange multipliers and gradients to identify the optimal portfolio, or genetic algorithms.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2012-01-25T23:03:08.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2834" PostTypeId="2" ParentId="2831" CreationDate="2012-01-25T23:05:29.513" Score="14" Body="&lt;p&gt;There are few things to consider.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Trading moves the price, to minimize market impact and maximize return it is generally optimal to split an order in several child orders. See the &lt;a href=&quot;http://www.google.com/search?q=kyle%2085&amp;amp;ie=utf-8&amp;amp;oe=utf-8#hl=en&amp;amp;safe=off&amp;amp;sclient=psy-ab&amp;amp;q=kyle%20model&amp;amp;pbx=1&amp;amp;oq=kyle%20model&amp;amp;aq=f&amp;amp;aqi=g3g-v1&amp;amp;aql=&amp;amp;gs_sm=e&amp;amp;gs_upl=2629l7543l1l7631l19l11l7l0l0l0l86l514l11l18l0&amp;amp;bav=on.2,or.r_gc.r_pw.r_cp.r_qf.,cf.osb&amp;amp;fp=7a126c880c14be15&amp;amp;biw=1676&amp;amp;bih=918&quot; rel=&quot;nofollow&quot;&gt;Kyle model&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Splitting optimally dependents on specific assumptions that you make. The simplest (and first) approach is that of Berstsimas and Lo (&lt;a href=&quot;http://www.mit.edu/~dbertsim/papers/Finance/Optimal%20control%20of%20execution%20costs.pdf&quot; rel=&quot;nofollow&quot;&gt;Optimal Control of Execution Costs&lt;/a&gt;). Almagren improves on it considering more realistic price impact fuctions. You can find much of his work at his &lt;a href=&quot;http://cims.nyu.edu/~almgren/&quot; rel=&quot;nofollow&quot;&gt;homepage&lt;/a&gt;. More recently, the focus has shifted to optimal submission strategies in the limit order book (e.g.: &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=686168&quot; rel=&quot;nofollow&quot;&gt;Obizhaeva and Wang&lt;/a&gt;) and to latency cost (for example see &lt;a href=&quot;http://home.business.utah.edu/finmh/moallemi.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;From a consistency perspective, the work of Jim Gatheral (&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1292353&quot; rel=&quot;nofollow&quot;&gt;No dynamic arbitrage and market costs&lt;/a&gt;) details some price impact functions that don't allow dynamic arbitrage (for example, &quot;pump and dump&quot; strategies). The high brow approach to these ideas is contained in the Econometrica paper by Stanzl and Huberman (Quasi-arbitrage and Price Manipulation). This area is expanding rapidly as several groups are working on expanding these results to limit order book markets.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1531" LastEditorUserId="1531" LastEditDate="2013-03-29T20:32:13.730" LastActivityDate="2013-03-29T20:32:13.730" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2836" PostTypeId="2" ParentId="1409" CreationDate="2012-01-26T21:05:44.687" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://ci.columbia.edu/ci/premba_test/c0332/s6/s6_3.html&quot; rel=&quot;nofollow&quot;&gt;http://ci.columbia.edu/ci/premba_test/c0332/s6/s6_3.html&lt;/a&gt; contains an example with the percentage returns over the last 10 years (something like $r_{year N}=\frac{P_{end year N} - P_{start year N}}{P_{start year N}} \cdot 100$%).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and here is another link &lt;a href=&quot;http://academicearth.org/lectures/portfolio-diversification&quot; rel=&quot;nofollow&quot;&gt;http://academicearth.org/lectures/portfolio-diversification&lt;/a&gt;. This is an entire course from Yale University (including this subject).&lt;/p&gt;&#xA;" OwnerUserId="1868" LastEditorUserId="1868" LastEditDate="2012-01-26T21:30:19.870" LastActivityDate="2012-01-26T21:30:19.870" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2837" PostTypeId="1" CreationDate="2012-01-26T22:09:03.717" Score="1" ViewCount="1486" Body="&lt;p&gt;Given historical implied volatility and all other know variables (stock price, option strike price, option expiration date, dividend rate, interest rate) what is the best way to calculate the probability of an option being in the money at expiration?&lt;/p&gt;&#xA;" OwnerUserId="1954" LastActivityDate="2012-01-28T00:06:53.663" Title="what is the best way to calculate the probability of an equity option ending in the money?" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;probability&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2838" PostTypeId="2" ParentId="2832" CreationDate="2012-01-27T04:58:02.837" Score="2" Body="&lt;p&gt;If you start removing some of the paths, then the expectation of the bond prices that you calculate will not fit the market prices. &#xA;Since these paths are on the extremes, they should not be affecting your OAS or effective duration much (the probability on these paths are low, and all these statistics depend on the expectation).&lt;/p&gt;&#xA;" OwnerUserId="1215" LastActivityDate="2012-01-27T04:58:02.837" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2840" PostTypeId="2" ParentId="2837" CreationDate="2012-01-28T00:06:53.663" Score="4" Body="&lt;p&gt;N(d2) is near to the probability the option will expire in the money; I have a video showing how &lt;a href=&quot;http://www.youtube.com/watch?v=lV0ytJYbVzc&quot;&gt;d2 is similar to distance to default in the Merton here on youtube&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;N(d1) is the delta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The technical issue is that N(d2) is a risk-neutral probability; the input in d2 is the riskfree rate, although the theory is more involved. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, if you replace the riskfree rate with a realistic drift (mu) you have a reasonable estimate, however N(d2) of course assumes normally distributed log returns. So, as with BSM, your answer here still makes the limiting assumptions, namely normal log returns and constant volatility. (I don't know what &quot;historical implied volaility&quot; is: the input is a current, instantaneous volatility estimate, it can be historical or implied)&lt;/p&gt;&#xA;" OwnerUserId="640" LastActivityDate="2012-01-28T00:06:53.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2841" PostTypeId="1" AcceptedAnswerId="2849" CreationDate="2012-01-28T13:44:27.390" Score="13" ViewCount="5879" Body="&lt;p&gt;How to obtain true probabilities from Black-Scholes option pricing equation?&#xA;Suppose, that we know risk adjusted discount rate for the underlying asset (the drift term in the physical measure) and risk free rate. The task is to find a real (not risk neutral) expected payoff for a call option.&lt;/p&gt;&#xA;" OwnerUserId="1960" LastEditorUserId="467" LastEditDate="2012-01-28T15:27:17.403" LastActivityDate="2017-03-29T16:16:50.200" Title="How to obtain true probabilities from Black-Scholes?" Tags="&lt;options&gt;&lt;pricing-formulae&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2843" PostTypeId="2" ParentId="2841" CreationDate="2012-01-28T22:04:55.090" Score="5" Body="&lt;p&gt;You cannot get &quot;true probabilities&quot; (empirical distribution) from the BS model. Option price is required initial investment, which is risk neutral expectation of payout. “True probabilities” are irrelevant in Black-Scholes. However, you can estimate the risk-neutral probability distribution (i.e. implied risk-neutral density) of the stock returns through Breeden-Litzenberger formula.&lt;/p&gt;&#xA;" OwnerUserId="370" LastEditorUserId="370" LastEditDate="2012-01-30T16:23:25.567" LastActivityDate="2012-01-30T16:23:25.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2844" PostTypeId="1" CreationDate="2012-01-29T13:42:57.370" Score="3" ViewCount="1851" Body="&lt;p&gt;Say, I have hourly returns $r_1,r_2,...,r_T$, where $r_t$ = $ln(p_t)$ - $ln(p_0)$ for $t = 1...T$. So what is the value of $E[r_t]$? Would $r_T$ be the $\prod{(r_t)}$? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically $r_t$s are the returns w.r.t to a fixed point $t_0$. My question then is how can I mathematically prove that the $E[r_t]$ is $r_T$ or it isn't?&lt;/p&gt;&#xA;" OwnerUserId="1965" LastEditorUserId="467" LastEditDate="2012-02-12T21:21:42.793" LastActivityDate="2015-06-13T13:02:13.093" Title="How to model the daily return using intraday data?" Tags="&lt;returns&gt;&lt;expected-return&gt;" AnswerCount="3" CommentCount="5" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2845" PostTypeId="2" ParentId="1501" CreationDate="2012-01-29T14:12:18.110" Score="3" Body="&lt;p&gt;I don't see the difference in the 'statistical' and 'empirical' approaches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Statistical or Data Mining or Machine Learning approaches, which mostly are under the same umbrella, rely on inductive inference. On the other hand, the analytic approach, relies on some prior axioms which we assume to be true by definition, and beyond this step, the theory is constructed in a deductive manner - i.e. as the implications of the particular set of axioms about human behavior. Equilibrium approaches derive from economic theory, or financial economics. CAPM is linked to assumptions about utility, hetero/homogeneity of agents and their expectations. To what degree any of these assumptions are 'true' (or not), is something the testing of the theories has to answer (and to a certain extent what would be 'reasonable' to expect of human behavior).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The 'law of one price' is something which we can subscribe to more easily than say the alphas of a CAPM regression of stock returns on market returns, being jointly zero (in a statistical sense), the latter being a particular case of consumption covariance risk, and all consumption risk being proxied for by the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this sense, the applicability of analytic approaches is limited to operating within the confines of the axioms which lie beneath the theory - or expecting violations of those axioms in particular cases (which perhaps over time will expand that theory to a newer one).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, as more complex/realistic theories are devised, there is also the concern whether the theory itself was formed &lt;em&gt;after&lt;/em&gt; peeking at the data - i.e. devising theories to explain persistent patterns or anomalies which an earlier theory could not 'explain' away. In this context, Fama-French's model is not a theory - it spotted an empirical regularity which was not explained by CAPM, but it is not a theory in the deductive sense. However, CAPM is a theory - albeit one which does not explain (far less predict) accurately all aspects of real markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The application of analytic approaches to derivatives pricing is readily understood because the law of no arbitrage is easier to swallow as a 'law' than say equilibrium arguments about the market. The 'purest' analytic approach is the one which tells me to buy oranges in market A at price 'p1' and sell them in market B at price 'p2', where p2 &gt; p1. Short of this, we are always estimating some parameters even to use what is otherwise a deductive theory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I suspect that the statistical and analytic approaches are not always mutually exclusive. As an example, if we accept CAPM to hold more or less, the series constructed from the residuals could be then subjected to torture by machine learning methods to extract a signal, if any. In this case, the lines are blurred.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we think of this as a Bayesian, then the 'analytic' or theoretical arguments help us form our prior, and the data we have at hand is 'blended' with our prior to arrive at the posterior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At one extreme, 'pure' statistical/data mining approaches are left to function without any prior structure we impose on the market dynamics and solely on the detection of empirical regularities (though, even using a trader's inputs to a data mining approach would constitute becoming somewhat 'analytic' - as we expect the trader to have some sort of prior story to justify his inputs). At the other extreme, pure analytic example would be exploitation of LOP as in the oranges example - i.e. the inference holds by force of logic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the question of which approach is dominant - I suspect, as Dirk pointed, these things ebb and flood, and moreover, 'reasonable' assumptions giving some 'weak' structure to a 'data mining approach' is probably more profitable when we can posit some structure, instead of no structure at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;p.s: nice answers by QuantGuy &amp;amp; Dirk! as expected.&lt;/p&gt;&#xA;" OwnerUserId="139" LastActivityDate="2012-01-29T14:12:18.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2846" PostTypeId="2" ParentId="328" CreationDate="2012-01-29T15:32:02.740" Score="1" Body="&lt;p&gt;I second @DirkEddelbuettel here. Measuring aggregate risk aversion implies abstracting away and making an explicitly artificial theoretical construct. There does not 'exist' a representative investor. What we have are investors, traders, with varying risk aversions, utility functions with differing parameters (if not functional forms). The distribution of risk aversion coefficients which @Dimitris says is virtually impossible, is obviously closer to reality, complex yes, but more plausible. Masanao Aoki's work is on lines such as these [ econ.ucla.edu/faculty/regular/Aoki.html ], though not directly at the level of specificity in finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even as far as estimating the utility function of one investor is concerned, that is non-trivial, even as from a more recent text on the field [ &lt;a href=&quot;http://amzn.com/0521748682&quot; rel=&quot;nofollow&quot;&gt;http://amzn.com/0521748682&lt;/a&gt; ]. I am not sure how coming up with a summary statistic for a few million investors is any easier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, it might so happen that there are periods when a greater number of investors converge in their utility functions, and at other times, there is greater dispersion. i.e. if there is a distribution of the utility function parameters over the set of investors, the moments are constantly fluctuating in a non-trivial way. Also, the existence of a representative investor, I think, implies that we are concerned only with inter-temporal decision making, and hence investing/trading - whereas, the reality of trading is a mix of inter-temporal decision making coupled with heterogeneity of investor/traders.&lt;/p&gt;&#xA;" OwnerUserId="139" LastEditorUserId="139" LastEditDate="2012-03-29T10:21:18.490" LastActivityDate="2012-03-29T10:21:18.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2847" PostTypeId="2" ParentId="2820" CreationDate="2012-01-29T16:52:21.247" Score="2" Body="&lt;p&gt;Something like a moving average smoother is akin to a low pass filter, the 'stochastics' of technical analysis crudely akin to a band pass filter. Going up the ladder of sophistication, you can see something like &lt;a href=&quot;http://www.jstor.org/pss/3592665&quot; rel=&quot;nofollow&quot;&gt;http://www.jstor.org/pss/3592665&lt;/a&gt; or applications of wavelet decomposition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This paper from 1963 by GRANGER, CLIVE W. J., and MORGENSTERN, 0. titled “Spectral Analysis of New York Stock Market Prices,” Kyklos, XVI (January, 1963), I-27 should convince you that people have been more than thinking of applying frequency-domain analysis to this.&lt;/p&gt;&#xA;" OwnerUserId="139" LastActivityDate="2012-01-29T16:52:21.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2848" PostTypeId="2" ParentId="2439" CreationDate="2012-01-29T22:06:46.837" Score="3" Body="&lt;p&gt;Bootvis accurately describes the math - Skew plus Kurtosis.  What's interesting is that many of the efficient market theorists (example: Eugene Fama) observed this phenomenon too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I consider two intuitive reasons for this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1)  Behavioral - According to prospect theory, the mental benefit of gaining a dollar is lower than the fear of losing a dollar.  This means we're more likely to panic to avoid losing a dollar that irrationally join a gold rush.  This is just a matter of degree though - the high Kurtosis means we're more likely to do either than a Gaussian distro suggests.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2)  Leverage on Equity Bets - If you're levered up on equity 10 to 1, and your position drops 10%, you have to sell everything.  The reverse doesn't exist.  Many banks are leveraged even more than this.  This means when bad things happen, there's system pressure which doesn't exist when good things happen.  Or at least not as often - there are still short squeezes, but they seem small in comparison.&lt;/p&gt;&#xA;" OwnerUserId="1968" LastActivityDate="2012-01-29T22:06:46.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2849" PostTypeId="2" ParentId="2841" CreationDate="2012-01-29T22:37:37.317" Score="5" Body="&lt;p&gt;The true probabilities underlying the B-S equation are actually postulated.&#xA;The pricing process is assumed to follow the stochastic process $d S_t =\mu S_t d t + \sigma S_t dW_t$, where $W_t$ is the &lt;a href=&quot;http://en.wikipedia.org/wiki/Wiener_process&quot; rel=&quot;noreferrer&quot;&gt;Wiener process&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It means that (for simplicity, let's talk about European call)  $\ln S_T$ is distributed as $N(ln(S_0)+(\mu-\frac{1}{2}\sigma^2)T, \sigma^2 T)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Correct me if I'm wrong, you'd like to find $E_P(C) = e^{-rT} E_P[max(S_T-K,0)] $, where P is a &quot;physical&quot; probability measure. Just to make sure, this expected value won't represent the fair price of the option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If my calculations are correct, this expected value is equal to $S_0 N(d_1(\mu)) e^{(\mu-r)T} - K N(d_2(\mu))e^{-rT}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the terms $d_1$ $d_2$ are from the B-S formula, with the adjustment to replace risk-free rate $r$ there with &quot;risky&quot; $\mu$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Now, I write down some derivation steps, please check them. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's rewrite expectation as follows, $E_P[...]=E_P[\textbf{I}(S_T\geq K)(S_T-K)]$, where $\textbf{I}(.)$ is the indicator function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice that the inequality $S_T\geq K$ is equivalent to $\ln S_T \geq \ln K$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, $... = E_P[S_T \textbf{I}(\ln S_T \geq \ln K)]-E_P[K \textbf{I}(\ln S_T \geq \ln K)] $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$= E_P[e^{\ln S_T} \textbf{I}(\ln S_T \geq) \ln K)]- K N(d_2(\mu))$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To calculate the first term, use the following lemma: if X distributed as $N(a,s^2)$ then $E(e^X\textbf{I}(l&amp;lt;X))=e^{s+\frac{1}{2}s^2} N (\frac{\mu+s^2-l}{s})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take $\ln S_T$ as $X$ and $l$ as $\ln K$, obtain $E_P[S_T \textbf{I}(\ln S_T \geq \ln K)]=e^{\ln S_0 + (\mu - \frac{1}{2}\sigma^2)T + \frac{1}{2}\sigma^2 T}N(\frac{\ln S_0 + (\mu-\frac{1}{2}\sigma^2)T + \sigma^2 T - \ln K}{\sigma\sqrt T}) = S_0 e^\mu N(d_1(\mu))$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, discount it with the risk-free rate $r$ and we get the result.&lt;/p&gt;&#xA;" OwnerUserId="1969" LastActivityDate="2012-01-29T22:37:37.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2850" PostTypeId="2" ParentId="328" CreationDate="2012-01-29T22:39:11.127" Score="8" Body="&lt;p&gt;By definition, the average investor holds the market portfolio. Risk aversion can be measured as the slope (i.e. ratio of expected returns to volatility) on the efficient frontier. Therefore, the risk aversion of the average investor assuming the S&amp;amp;P500 is the proxy for the market portfolio is the expected returns of the S&amp;amp;P 500 divided by the volatility of the portfolio.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2012-01-29T22:39:11.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2851" PostTypeId="1" CreationDate="2012-01-30T02:10:30.223" Score="8" ViewCount="790" Body="&lt;p&gt;I am doing extensive research on portfolio replication and was hoping to get some help with some problems I am encountering. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am running a regression between 2 assets that I believe replicate another asset well. For example, let A be the asset we are replicating and let B and C be the assets we will use to mimic A. I want to run a regression on the returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would I run a regression such that I can include the returns on dividends paid on each of these assets. Would I just add in the amount of the dividend paid to the stock price on the day the dividend is paid? Would I then calculate a return based on those numbers?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, how would I use the regression output to find annualized volatility and return on asset A? What about assets B and C?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, what would be the difference between the standard error of each of my variables (B and C) vs. the standard error of the model as a whole?&lt;/p&gt;&#xA;" OwnerUserId="1970" LastEditorUserId="1106" LastEditDate="2012-02-06T15:48:05.543" LastActivityDate="2012-08-04T16:55:42.523" Title="How to run an asset replication regression?" Tags="&lt;portfolio-management&gt;&lt;regression&gt;&lt;replication&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2853" PostTypeId="2" ParentId="2851" CreationDate="2012-01-30T16:53:44.203" Score="3" Body="&lt;p&gt;Regarding the dividends:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to avoid jumps on ex-dividend date, you can make the simplifying assumption that dividends are paid continuously and adjust the returns of the assets. The size of dividends could be estimated from historical data or can be set proportionally to the asset price.&lt;/p&gt;&#xA;" OwnerUserId="370" LastActivityDate="2012-01-30T16:53:44.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2855" PostTypeId="2" ParentId="2841" CreationDate="2012-01-30T18:44:20.603" Score="7" Body="&lt;p&gt;You &lt;strong&gt;cannot&lt;/strong&gt; deduce the real-world probabilities from the option prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It may seem strange, but here is a simple example which might help you to understand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Suppose&lt;/em&gt; that everyone in the market agrees on the real-world probabilities, and that they are not changing for any external reason.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then &lt;em&gt;suppose&lt;/em&gt; that the investment board of a large pension fund decides that they need to increase the amount of options they have bought because they get a feeling that they would like to hold more protection against an adverse move (and since most pension funds are net long equities, this is likely to mean that they want to buy out-of-the-money equity put options to protect against a sell off in the equity market).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The pension fund will come to the dealers (investment banks probably) and will buy a whole load of put options, say. Naturally the price in the market will go up (simple law of supply/demand, and demand has increased), which implies that the implied vols will go up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In summary: no change in the &lt;em&gt;real-world&lt;/em&gt; probabilities, but a big change in the implied volatilities which will in turn lead to a change in the implied underlying probability distribution.&lt;/p&gt;&#xA;" OwnerUserId="1920" LastEditorUserId="1920" LastEditDate="2012-01-31T08:47:08.517" LastActivityDate="2012-01-31T08:47:08.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2856" PostTypeId="2" ParentId="955" CreationDate="2012-01-30T19:02:46.093" Score="2" Body="&lt;p&gt;My 2c worth.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Experience tells me that the better ways to get a feel for whether their strategy is based on something more than luck are amongst:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) `getting to know your traders' -- have a chat, pick their brains, try to get some insight into their methods;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) see how hard the market has been -- check whether you have just been part of a bull market which basically made pretty-much every strategy a winner, and discount performance accordingly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would be skeptical of anything too mathematical for measuring outperformance, since even a badly-designed strategy may have performed well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see an analogy with driving: many drivers will successfully get from A to B, but you'll get a much clearer picture of the sorts of risks a driver takes by sitting in the car with them, rather than trying some mathematical analysis of the race. Make sense?&lt;/p&gt;&#xA;" OwnerUserId="1920" LastEditorUserId="1920" LastEditDate="2012-02-07T07:50:17.250" LastActivityDate="2012-02-07T07:50:17.250" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2857" PostTypeId="1" AcceptedAnswerId="2866" CreationDate="2012-01-30T23:04:53.040" Score="12" ViewCount="463" Body="&lt;p&gt;I thought implied volatility, as well as the VIX, primarily increase due to increases in the underlying asset's volatility, as well as the options themselves being bid up because more people were buying that usual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, during an IV crush, usually people are selling the contract heavily. When IV is building, I thought people were buying the contract heavily.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Today, I was watching a spread and noticed a leg was becoming more expensive than predicted, yet the volume was low, the open interest was also low, and the VIX was unchanged. It wasn't just this contract; the entire side of the book for that month's contract had elevated volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't understand how this happens. Could someone shed some light on how the IV increases without people bidding things up?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There were no catalyst events coming up, and the underlying asset wasn't a corporation's stock. It was an ETN on an index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My next clue would be that the IV is based on historical volatility, such as when things start moving in one direction that things can really swing, so the pricing of the contracts were fixed to include this expected demand for their premium. But I could also be way off.&lt;/p&gt;&#xA;" OwnerUserId="1453" LastEditorUserId="1106" LastEditDate="2012-02-06T15:44:07.280" LastActivityDate="2012-02-06T15:44:07.280" Title="What drives changes in implied volatility on ETFs/ETNs?" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;vix&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2858" PostTypeId="2" ParentId="2697" CreationDate="2012-01-30T23:38:21.423" Score="-1" Body="&lt;p&gt;Upon further analysis, it seems this can be done with FLEX options or block trades if you know the right people.&lt;/p&gt;&#xA;" OwnerUserId="1453" LastActivityDate="2012-01-30T23:38:21.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2860" PostTypeId="1" AcceptedAnswerId="2863" CreationDate="2012-01-31T12:47:22.500" Score="4" ViewCount="775" Body="&lt;p&gt;Is there a standard (or maybe even intuitive?) way of ranking pairs of cointegrated time series so that one could make statements like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;series A is MOST cointegrated with series M&#xA;series A is NEXT MOST cointegrated with series Y&#xA;...&#xA;series A is NEXT, ... NEXT (i.e. LEAST) cointegrated with series J&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1733" LastActivityDate="2012-01-31T13:26:05.643" Title="Is there a measure for the 'degree' of cointegration" Tags="&lt;time-series&gt;&lt;cointegration&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2861" PostTypeId="1" AcceptedAnswerId="2862" CreationDate="2012-01-31T13:02:53.253" Score="0" ViewCount="1278" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Possible Duplicate:&lt;/strong&gt;&lt;br&gt;&#xA;  &lt;a href=&quot;https://quant.stackexchange.com/questions/219/what-is-the-intuition-behind-cointegration&quot;&gt;What is the intuition behind cointegration?&lt;/a&gt;  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&#xA;&#xA;&lt;p&gt;Although having a postgrad degree in mathematics, I haven't used any maths 'in anger' for quite a few years now, so I am quite rusty (actually, VERY rusty).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for a gentle introduction to cointegration, that will prepare me with the fundamentals/foundation before I start to read Market Models by Carol Alexander (which I bought a few years ago!).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could someone suggest a link to such a simple introductory note. Preferably, one which does not make too much of an assumption on the mathematical background of the reader.&lt;/p&gt;&#xA;" OwnerUserId="1733" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2012-02-04T14:59:15.403" Title="A gentle introduction to cointegration" Tags="&lt;cointegration&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ClosedDate="2012-02-03T23:31:19.357" ContentLicense="CC BY-SA 3.0" />
  <row Id="2862" PostTypeId="2" ParentId="2861" CreationDate="2012-01-31T13:22:45.350" Score="2" Body="&lt;p&gt;I'm not sure this post will survive, but Wikipedia's treatment is fairly gentle.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Cointegration&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Cointegration&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, EP Chan did a simple paper on cointegration as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://epchan.com/downloads/cointegration.pdf&quot; rel=&quot;nofollow&quot;&gt;http://epchan.com/downloads/cointegration.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1112" LastActivityDate="2012-01-31T13:22:45.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2863" PostTypeId="2" ParentId="2860" CreationDate="2012-01-31T13:26:05.643" Score="4" Body="&lt;p&gt;The Augmented Dickey–Fuller test is usually used for this purpose. Again, wikipedia does a decent treatment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would suggest using google for this before posting here. There is tons of information out there on cointegration.&lt;/p&gt;&#xA;" OwnerUserId="1112" LastActivityDate="2012-01-31T13:26:05.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2866" PostTypeId="2" ParentId="2857" CreationDate="2012-01-31T14:02:58.320" Score="5" Body="&lt;p&gt;I'm going to go ahead an assume the spread you were looking at involved exchange traded options.  As you presumably know, the actual implied volatility on your screen is a number derived from option prices by running the Black-Scholes model &quot;backwards&quot; from quoted option price to volatility.  Higher prices imply higher volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That last statement is the key: the quoted prices can go up, and so the implied volatility can go up, even if nobody trades (so that open interest remains unchanged).  It's kind of like the housing market in that the presumed asset value goes up even when nobody trades it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With an ETN this probably had to do with option prices taking off in one of the underlying components.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-01-31T14:02:58.320" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2868" PostTypeId="1" AcceptedAnswerId="2874" CreationDate="2012-02-01T00:23:07.493" Score="16" ViewCount="8307" Body="&lt;p&gt;I'm looking to convert some tickdata .csv files into a database on a local disk and then use R to call the data and do my various analytics and modelling.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are some best practices / implementation techniques that could be recommended to minimize any headaches?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Noted that packages such as &lt;code&gt;mmap&lt;/code&gt; help enormously, but would like to try and find a more 'permanent' solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which is the best db to play with? MySQL seems to be suboptimal as it's relational (rather than column-oriented). q/KDB seem to have a trial version to play with but has a very steep learning curve. Which is the best db to handle and serve up tick requests?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help much appreciated. Platform agnostic, but I suppose Linux is my preferred platform.&lt;/p&gt;&#xA;" OwnerUserId="1838" LastActivityDate="2012-02-08T01:08:54.107" Title="R: How feasible is it to store -- and work with -- tick data in a database connected to R?" Tags="&lt;data&gt;&lt;high-frequency&gt;&lt;r&gt;&lt;tick-data&gt;&lt;database&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="18" ContentLicense="CC BY-SA 3.0" />
  <row Id="2869" PostTypeId="2" ParentId="2868" CreationDate="2012-02-01T08:30:08.087" Score="1" Body="&lt;p&gt;I have had success using MySQL to store both OHLCV, Options data and metadata such as earnings dates in MySQL and accessing both for reads and writes from R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For me this works very nicely and is performant for daily data, if you are doing HFT you may want to consider a specialized tickdb, but at daily scales (252 returns per year per ticker - MySQL is plenty fast). Also, it's much better than flat files because you'll find at some point that you do want to issue relational queries to find time series that match certain aggregate patterns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Examples that I typically do are to JOIN OHLC data with Options data for a given ticker and merge by date, sure R's XTS::merge can help here as well but it's often more performant to issue SQL queries direcltly and use R's dataframes/XTS for 'fine tuning' once you narrow down from Gigs of data (which R is not great at) to a few MB.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there is interest - I could consider sharing my .R modules for interfacing with MySQL for both daily downloading and storing of data (e.g. from Yahoo for OHLC of course), as well as querying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My advice is don't overdesign it - if you don't need the perf of a specialized tick DB, and for daily scales I don't think you do - go with what's proven and simple. MySQL works.&lt;/p&gt;&#xA;" OwnerUserId="2186" LastActivityDate="2012-02-01T08:30:08.087" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2870" PostTypeId="1" AcceptedAnswerId="2875" CreationDate="2012-02-01T08:36:57.907" Score="42" ViewCount="28995" Body="&lt;p&gt;I've been a researching minimum variance portfolios (from this &lt;a href=&quot;http://quantivity.wordpress.com/2011/04/17/minimum-variance-portfolios/&quot;&gt;link&lt;/a&gt;) and find that by building MVPs adding constraints on portfolio weights and a few other tweaks to the methods outlined I get generally positive returns over a six-month to one year time scale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking to build some portfolios that are low risk, but have good long term (yearly) expected returns. MVP (as in minimum variance &lt;em&gt;NOT&lt;/em&gt; mean variance) seems promising from backtests but I don't have a good intuition for why this works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand the optimization procedure is primarily looking to optimize for reducing variance, and I see that this works in the backtest (very low standard deviation of returns).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I don't have an intuitive feel for is why optimizing variance alone (with no regards to optimizing returns, i.e. no &lt;em&gt;mean&lt;/em&gt; in the optimization as in traditional mean-variance optimization) gives generally positive returns.  Any explanations?&lt;/p&gt;&#xA;" OwnerUserId="2186" LastEditorUserId="1106" LastEditDate="2012-02-06T15:39:40.967" LastActivityDate="2015-10-26T16:56:34.747" Title="Why does the minimum variance portfolio provide good returns?" Tags="&lt;portfolio-management&gt;&lt;optimization&gt;&lt;modern-portfolio-theory&gt;&lt;covariance&gt;" AnswerCount="12" CommentCount="1" FavoriteCount="42" ContentLicense="CC BY-SA 3.0" />
  <row Id="2871" PostTypeId="1" CreationDate="2012-02-01T08:44:13.967" Score="2" ViewCount="2327" Body="&lt;p&gt;I've been researching algorithmic (non discretionary) trading at the several-day to month timescale, i.e. not HFT. I am not interested in voodoo i.e. no technical analysis, I am looking for solid quant type techniques that can have a positive edge at smaller capacities that are interesting to an individual but that a larger fund would ignore.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question: I always wonder, are people out there actually able to achieve profitable returns using a home algo trading setup? I realize you wouldn't give away your 'secret sauce' but I would be interested in some feedback as to w/not this can work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so what classes of strategy do you look at - stat arb? basic portfolio construction? something more exotic? Anyone care to share general experiences?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Much appreciated.&lt;/p&gt;&#xA;" OwnerUserId="2186" LastActivityDate="2012-02-01T15:48:41.147" Title="Home/hobbyist quant trading - possible to profitable or just an intellectual hobby?" Tags="&lt;research&gt;&lt;algorithm&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="4" ClosedDate="2012-02-01T16:34:08.120" ContentLicense="CC BY-SA 3.0" />
  <row Id="2872" PostTypeId="2" ParentId="2870" CreationDate="2012-02-01T12:36:42.423" Score="8" Body="&lt;p&gt;The minimum variance optimization framework does not guarantee positive return whatsoever.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a matter of fact what you are trying to do is something close to the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\underset{w}{\arg \min} \quad w' Q w \quad \text{s.t} \quad Aw \leq b,\quad \sum_i w_i=1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fact that you get positive return is a nice result that you get from your backtest (i.e a &lt;em&gt;coincidence&lt;/em&gt; in a sense), but it should &lt;strong&gt;not&lt;/strong&gt; be the reason why you choose this asset-allocation technique.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the main advantages of minimum variance is that it actually removes expected returns from the optimization (which are difficult to handle, see &lt;a href=&quot;https://quant.stackexchange.com/questions/2705/how-do-you-remove-expected-returns-from-asset-allocation-strategies&quot;&gt;this post&lt;/a&gt; for more details).&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2012-11-01T20:10:07.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2873" PostTypeId="2" ParentId="2355" CreationDate="2012-02-01T12:38:05.630" Score="4" Body="&lt;p&gt;Brian,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think there is a misunderstanding here. A calendar spread option is not a spread option as you mean it (an option on the spread between two underlying). As Tai explains, rightly, it is a strategy where you are long an option with a given maturity and short another option with a different maturity (same underlying, same strike).&#xA;&lt;a href=&quot;http://en.wikipedia.org/wiki/Calendar_spread&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Calendar_spread&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer Tai's question: there is no difficulty here. Pricing is linear: price the long option (use Black-Scholes for example), price the short option and take the difference long minus short. Just make sure you've got the right implied volatility for each.&lt;/p&gt;&#xA;" OwnerUserId="1986" LastActivityDate="2012-02-01T12:38:05.630" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2874" PostTypeId="2" ParentId="2868" CreationDate="2012-02-01T13:44:26.327" Score="14" Body="&lt;p&gt;There are many specialised products for HF tick data. In addition to KDB which you mentioned, there is OneTick, Vertica, Infobright, and some open-source ones like MonetDB etc. (see &lt;a href=&quot;http://en.wikipedia.org/wiki/Column-oriented_DBMS&quot;&gt;http://en.wikipedia.org/wiki/Column-oriented_DBMS&lt;/a&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My experience is that Column Oriented Databases are overrated when it comes to tick data, because very often you request the entire tick or bar record (as opposed to just one column of a record - i.e. what Column-Oriented DBs are optimised for). In my experience, the key to speed is much more that you use a clustered index for your database, thus defining the order in which the data is stored on the harddisk. If you primarily query the timeseries of a given instrument (as opposed to the latest prices of a group of instruments), then you want to cluster by (Instrument, TickTimestamp), making queries extremely fast even for huge table sizes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then there is also the school of thought that plays around with new alternatives out of the NoSQL corner, such as BigTable, MongoDB, etc. It's an interesting area, but my personal believe is that they are made primarily for flexible datamodels, which is not our core requirement. You can make them work, and they'll work very fast, but this comes at the cost of more archaic tool support, steeper learning curves, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been using many different databases (Oracle, MySQL, SQLServer, MongoDB, MonetDB) over the years, and my conclusion is that most of them work pretty decently for storing financial timeseries data if you understand them and design them accordingly. Currently, I'm using primarily SQLServer, which is somewhat faster than MySQL, free for smaller datasets, and does most of the things I want. Support for R (and Matlab and many other environments) is very decent through the ODBC R package.&lt;/p&gt;&#xA;" OwnerUserId="1988" LastEditorUserId="1988" LastEditDate="2012-02-01T15:17:57.520" LastActivityDate="2012-02-01T15:17:57.520" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2875" PostTypeId="2" ParentId="2870" CreationDate="2012-02-01T14:42:43.643" Score="33" Body="&lt;p&gt;The minimum variance solution loads up on securities that have low variances and co-variances. Theoretically you are correct that this should have a low expected return profile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it turns out - in contradiction to modern portfolio theory - that securities that have low-volatility or low-beta experience &lt;em&gt;higher&lt;/em&gt; returns than high-volatility or high-beta stocks. This is well-documented in the literature as the &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1585031&quot;&gt;low-volatility anomaly&lt;/a&gt;. As a result, many funds and ETFs have been launched in recent years to exploit this phenomenon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a couple arguments as to why the anomaly exists. The paper I cite above argues that institutional investor objectives and constraints create the anomaly:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Over the past 41 years, high volatility and high beta stocks&#xA;  have substantially underperformed low volatility and low beta stocks in&#xA;  U.S.markets. We propose an explanation that combines the average&#xA;  investor's preference for risk and the typical institutional&#xA;  investor’s mandate to maximize the ratio of excess returns and tracking&#xA;  error relative to a fixed benchmark (the information ratio) without&#xA;  resorting to leverage. Models of delegated asset management show that&#xA;  such mandates discourage arbitrage activity in both high alpha, low&#xA;  beta stocks and low alpha, high beta stocks. This explanation is&#xA;  consistent with several aspects of the low volatility anomaly including&#xA;  why it has strengthened in recent years even as institutional investors&#xA;  have become more dominant.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-03-07T20:16:36.433" LastActivityDate="2012-03-07T20:16:36.433" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2876" PostTypeId="2" ParentId="2870" CreationDate="2012-02-01T15:02:37.957" Score="11" Body="&lt;p&gt;Unlike the tangency portfolio on the efficient frontier (which represents the most efficient portfolio in terms of max expected sharp ratio), min var portfolios have no ex ante theory that suggests it should outperform a cap weighted market portfolio.  The same can be said about other risk-weighted portfolio construction schemes, including equal risk contribution portfolios or max diversity portfolios. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, however, expected returns are notoriously difficult to accurately forecast (the expected covar matrix is as well, but to a lesser extent).  This often leads to poor out-of-sample performance.  Risk-weighted portfolios ignore potentially error prone expected return forecasts.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, there is reason to believe high beta / high vol names get bid up as certain investors seek short-term large gains ('lottery ticket' effect in the behavioral finance literature).  As others have alluded to, this tends to result in 'cheaper' offers for lower beta names (beta puzzle, or low vol anomalies).  The unconstrained min var portfolio is (heavily) tilted towards lower vol names, and thus does not buy into rich high vol names.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Min var portfolios tend to be more resilient in market downturns.  As the business cycle eventually recovers, a min var portfolio tend to start compounding performance at a far higher capital base than a similar mkt cap weighted portfolio.&lt;/p&gt;&#xA;" OwnerUserId="390" LastActivityDate="2012-02-01T15:02:37.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2877" PostTypeId="2" ParentId="2589" CreationDate="2012-02-01T15:34:01.337" Score="7" Body="&lt;p&gt;On a theoretical level and for low frequency data (e.g. daily), your formula seems right. However, since you are talking about one minute bars, things may get a little messy. There is a vast literature on this, and empirically, things are complicated due to market micro-structure noise. Namely, you need to do consider jumps, errors, periods of low volume, high volume periods (e.g. market opening of US markets when you look at European markets), and many other things. A nice overview on the topic with some references to literature is here: &lt;a href=&quot;http://economics.ouls.ox.ac.uk/13045/1/2008OMI11.pdf&quot;&gt;http://economics.ouls.ox.ac.uk/13045/1/2008OMI11.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1988" LastActivityDate="2012-02-01T15:34:01.337" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2878" PostTypeId="2" ParentId="2871" CreationDate="2012-02-01T15:48:41.147" Score="3" Body="&lt;p&gt;I do recommend to you the chapter 8 of the Ernest Chan book &quot;Quantitative Trading: How to Build Your Own Algorithmic Trading Business&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The chapter's name is &quot;Conclusion: Can Independent Traders Succeed? &quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The conclusion is that yes but I now cant remember very well the chapter...&lt;/p&gt;&#xA;" OwnerUserId="1990" LastActivityDate="2012-02-01T15:48:41.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2879" PostTypeId="2" ParentId="1479" CreationDate="2012-02-01T16:19:09.377" Score="10" Body="&lt;p&gt;This is an evergreen. I've been discussing this with many people - without any clear-cut conclusion. The answer and the preferred solution depend on your trading style (e.g. frequency), your skills, the size of the team, and many other factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For simplicity, I call &quot;Research&quot; the Matlab/R/etc. environments, whereas &quot;Live&quot; refers to the re-programmed C++/Java/C# environments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The proponents of reprogramming usually claim that the two environments are very different in nature, namely:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Robustness:&lt;/strong&gt; Research is ad-hoc-ish by nature, your main concern is not speed, programming robustness and style. Production needs to be more robust and faster, and you want to reuse components such as e.g. a price stream.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Data&lt;/strong&gt; Research is usually done on a closed data-set: you have a set of in-sample data and wherever possible, you're running backtests with matrix functions (e.g. in Matlab or R). In live trading, you are working on incremental data, new information is popping in irregular spacing. Thus, live trading is much more event-driven (at least for higher frequencies).&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Assumptions&lt;/strong&gt; In a backtest, you need to make assumptions on the fill ratio and price, and very often you calculate positions asymptotically (i.e. as a percentage of your portfolio, regardless of the minimum size you can hold of a position). In live trading, you can't do that. You need to generate an order in terms of size of futures/shares/etc. Also, you will need to feed back in your actual position (which depends on the fills you got), which is something you don't have to worry about in research.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;People usually try to overcome these differences with different strategies, such as:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;The Python way&lt;/strong&gt; take the middle route by building everything in a high-level language that possibly fits both requirements. The opponents of this strategy claim that this way you won't end up with best-of-breed solutions, neither in research nor in live trading.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;The Matlab/R way&lt;/strong&gt; Research-centric shops try to build everything around Matlab. In my experience, this works well to a certain size, but with larger teams things can get very difficult to maintain. Re-usability of components among the team can become very difficult.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;The Reprogramming&lt;/strong&gt; This requires either very good skills or a dedicated re-programming team. This is usually expensive and difficult, and the risk is to add errors.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Integration&lt;/strong&gt; There are some platforms that allow you to deploy strategies in multiple languages (e.g. compiled matlab code, R automation, etc.). If done well, this may be the best solution.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For yourself, if you're the only one working on the strategy, and with the frequency you mention, the &lt;strong&gt;The Matlab/R way&lt;/strong&gt; sounds like the way to go.&lt;/p&gt;&#xA;" OwnerUserId="1988" LastEditorUserId="1988" LastEditDate="2012-02-01T17:17:38.490" LastActivityDate="2012-02-01T17:17:38.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2880" PostTypeId="2" ParentId="2355" CreationDate="2012-02-01T21:52:30.663" Score="7" Body="&lt;p&gt;First, a quote from Hull:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;A calendar spread could be created by selling a call option with a certain strike price and buying a longer maturity call option with the same strike price&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That means that you can decompose the calendar spread option as a combination of vanilla plain options, which you can price with B-S, trees etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, you succeed to represent your calendar spread option in the way the quote above directs, with $C_1$ being a call option with a shorter maturity $T_1$ to be selled and $C_2$ being a call option with a longer maturity $T_2$ to be bought.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, Price(calender spread option) = Price($C_2$) - Price($C_1$)&lt;/p&gt;&#xA;" OwnerUserId="1969" LastActivityDate="2012-02-01T21:52:30.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2881" PostTypeId="2" ParentId="1479" CreationDate="2012-02-02T00:11:52.813" Score="3" Body="&lt;p&gt;There is no advantage.  You &lt;em&gt;will&lt;/em&gt; introduce new bugs. It's a basic fact of software writing.  Just by wishing they weren't there you don't make bugs go away.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few years ago, I had a job (at medium to high frequency) where all code morphed from research / development to production, often with a translation.  It was a &lt;em&gt;huge&lt;/em&gt; issue, even at that rather advanced firm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My next job was higher/highest frequency where things happened in C++ only.  So to do more higher-level analysis in R, I needed to bring R and C++ closer together.  &lt;a href=&quot;http://dirk.eddelbuettel.com/code/rcpp.html&quot; rel=&quot;nofollow&quot;&gt;Rcpp&lt;/a&gt; makes that possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, language choice is both &lt;em&gt;personal&lt;/em&gt; (style, what you may have learned first, ...) and &lt;em&gt;institutional&lt;/em&gt; (whatever the shop has settled on) so this pairing can't and won't work for everyone.  But it did for me, and largely because it alleviated the split between &#xA;&lt;em&gt;research software&lt;/em&gt; and &lt;em&gt;trading software&lt;/em&gt;.  These were &lt;em&gt;the same&lt;/em&gt; C++ routines, simply deployed in different contexts.&lt;/p&gt;&#xA;" OwnerUserId="69" LastEditorUserId="69" LastEditDate="2012-02-02T01:46:47.433" LastActivityDate="2012-02-02T01:46:47.433" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2882" PostTypeId="1" CreationDate="2012-02-02T04:03:48.620" Score="8" ViewCount="1189" Body="&lt;p&gt;Lets assume that I have an equity strategy that generates signals intraday to buy and sell. I run this strategy across the SP500 names. Now within my strategy I want to incorporate a method to help me decide if I want to take a certain trade on or not, based on my current portfolio composition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I have a very simple idea of how to do this. I compute the beta of each symbol I want to trade against the market index and look at my beta exposure to the market. If I am above a certain threshold, I don't take long or short signals accordingly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just wondering if there are better methods out there which would help me measure my exposure to the market and various sectors ? My aim here is to make sure that I am not too exposed to one sector or the market in general , before taking on additional positions. &lt;/p&gt;&#xA;" OwnerUserId="1696" LastEditorUserId="2299" LastEditDate="2013-10-27T09:00:58.393" LastActivityDate="2013-10-27T09:00:58.393" Title="How to manage equity portfolio risk intraday?" Tags="&lt;risk&gt;&lt;high-frequency-estimators&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2888" PostTypeId="2" ParentId="2870" CreationDate="2012-02-02T16:32:51.040" Score="15" Body="&lt;p&gt;The following papers may help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://ssrn.com/abstract=1681306&quot;&gt;A New Look at Minimum Variance Investing by Bernd Scherer&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://ssrn.com/abstract=1549949&quot;&gt;Minimum Variance Portfolio Composition by Clarke, De Silva &amp;amp; Thorley&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under a multifactor risk-based model, if the global minimum variance portfolio dominates the market portfolio, the implication is that the market portfolio is not multifactor efficient and that the global minimum variance portfolio is picking up some risk-based anomaly. In this case, it shows up at beta / idiosyncratic volatility - however, that still needs to be connected with some underlying characteristics of the assets. (if low market beta beats high market beta stocks with less risk and more return, that's fishy)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may try these articles, both by John Cochrane to get some idea about how financial economists think about these issues. Particularly, see figure no. 2 of the 4th paper and the associated explanation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://faculty.chicagobooth.edu/john.cochrane/research/papers/ep3Q99_3.pdf&quot;&gt;New facts in finance by John H. Cochrane&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://faculty.chicagobooth.edu/john.cochrane/research/papers/ep3q99_4.pdf&quot;&gt;Portfolio advice for a multifactor world by John H. Cochrane&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Though they do not talk about your problem directly, you may get an idea about why the global min. variance portfolio may show the sort of behavior it does. (of course, this implies that you want to work with the mental model of mean-variance, CAPM, multifactor model, of some version of a risk-based explanation of returns - which you implicitly are, if you are concerned with the global min. var anyway)&lt;/p&gt;&#xA;" OwnerUserId="139" LastEditorUserId="139" LastEditDate="2012-02-02T16:53:38.120" LastActivityDate="2012-02-02T16:53:38.120" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2890" PostTypeId="1" CreationDate="2012-02-02T21:30:51.180" Score="8" ViewCount="2943" Body="&lt;p&gt;I constructed a model to forecast the prepayment rates for a mortgage loan portfolio (of mortgages in an emerging market) using probit regression on factors such as loan-to-value, PTI, time from settlement, and several characteristics of the borrower.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However when testing with historical data the forecast is not so accurate.  &lt;strong&gt;What is the best model to make accurate forecasts of prepayment rates for mortgage loans?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="1179" LastEditorUserId="1106" LastEditDate="2012-02-06T15:33:41.147" LastActivityDate="2012-02-06T15:33:41.147" Title="What is the best way to forecast prepayment rate in an emerging market mortgage loan portfolio?" Tags="&lt;statistics&gt;&lt;forecasting&gt;&lt;mbs&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2891" PostTypeId="2" ParentId="2890" CreationDate="2012-02-03T02:43:56.277" Score="6" Body="&lt;p&gt;Pre-payment rates are difficult to forecast because of &lt;a href=&quot;http://en.wikipedia.org/wiki/Path_dependence&quot; rel=&quot;nofollow&quot;&gt;path dependency&lt;/a&gt;. The historical interest rate path - not just current market conditions and borrower characteristics - matters because borrowers may have exercised their right to call the mortgage bond and re-finance if rates had previously been at lower levels than the current rate. None on the variables you have identified account for these interest rate paths. For example, if rates are at 4% and have generally been rising there is considerably less prepayment risk then if rates are at 4% and have been declining. In a probit model, you could try adding a variable such as the distance of the 30-yr fixed mortgage rate from the lowest mortgage rate over the last X periods. A more typical and sophisticated approach is to model pre-payments and MBS valuations by monte carlo simulations of many interest rate paths.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A simpler way to go about this would be to fit the terms to a &lt;a href=&quot;http://www.riskglossary.com/link/prepayment.htm&quot; rel=&quot;nofollow&quot;&gt;PSA model&lt;/a&gt;. There are far fewer parameters here. You could also use &lt;a href=&quot;http://www.ieor.columbia.edu/seminars/financialengineering/2006-2007/spring/Kalotay_Andrew/seminar.html&quot; rel=&quot;nofollow&quot;&gt;option-adjusted spread analysis&lt;/a&gt; to determine borrower's optimal refinancing/pre-payment decision. Finally, along the lines of the monte carlo approach indicated above you could apply the &lt;a href=&quot;http://www.mathworks.com/products/fixedincome/demos.html?file=/products/demos/shipping/finfixed/Demo_Prepayment.html&quot; rel=&quot;nofollow&quot;&gt;two-factor Hull White model&lt;/a&gt; to simulate various interest rate paths.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-02-04T17:34:43.487" LastActivityDate="2012-02-04T17:34:43.487" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2892" PostTypeId="1" AcceptedAnswerId="2895" CreationDate="2012-02-03T02:55:57.853" Score="7" ViewCount="2570" Body="&lt;p&gt;I have seen multiple instances where people try to explain the diversification effects of having assets with a certain level of correlation, especially in the &quot;most diversified portfolio&quot; literature.  A nice example is in the NewEdge's &lt;a href=&quot;http://www.newedge2009.com/images_newedgegroup/aig/PDF/Superstars_Versus_Teamwork.pdf&quot; rel=&quot;noreferrer&quot;&gt;&quot;Superstars vs. Teamwork&quot;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/bK7Fi.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can I simulate multiple random walk series that have a calibrated level of correlation to each other in order to demonstrate this?&lt;/strong&gt;  My thought is to have a random walk series $x$ and to add varied different levels of noise $n$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_i = \lambda x + (1 - \lambda) n_i$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $$0 \le \lambda \le 1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So less noise (large values of $\lambda$) will generate series with high correlation vs. more noise.  But is there are more theoretical way to calibrate a certain level of correlation?  I'm simulating this in R, so any R functions would be additionally helpful!&lt;/p&gt;&#xA;" OwnerUserId="658" LastEditorUserId="1106" LastEditDate="2012-02-06T21:06:10.763" LastActivityDate="2012-02-06T21:06:10.763" Title="How to simulate correlated assets for illustrating portfolio diversification?" Tags="&lt;correlation&gt;&lt;simulations&gt;&lt;diversification&gt;&lt;random-walk&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2893" PostTypeId="2" ParentId="2870" CreationDate="2012-02-03T02:57:12.360" Score="2" Body="&lt;p&gt;First, you find the (global) minimum variance portfolio, without any restriction on the expected return.  Second, you trace the efficient frontier above and to the right of the (global) minimum variance portfolio by finding the (local) minimum variance portfolio for each expected return above the expected return corresponding to the (global) minimum variance portfolio.  You do not consider portfolios with an expected return under that of the (global) minimum variance portfolio because each such portfolio is dominated by a portfolio above the (global) minimum variance portfolio for which the variance is the same as that of that portfolio under the (global) minimum variance portfolio. Third, you trace a half-line from the height corresponding to the risk free rate on the y axis through the point of tangency of that half line to the efficient frontier and choose a point on this line according to your aversion for risk.  Since you are presumed averse to risk, you want to get paid to endure it, so you will choose a point on this half line such that the expected return of the corresponding portfolio is higher than the risk free rate, thus ensuring a risk premium for yourself on average. Since the risk free rate is usually positive, the expected return of the chosen portfolio will also be positive. QED&lt;/p&gt;&#xA;" OwnerUserId="1903" LastActivityDate="2012-02-03T02:57:12.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2894" PostTypeId="2" ParentId="2870" CreationDate="2012-02-03T03:12:33.557" Score="5" Body="&lt;p&gt;Minimizing risk alone would not imply a positive expected return, except for the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The assets that are being included have positive expected returns.  If you took a portfolio of assets that had a negative expected return, and minimized their risks, you would probably still end up with a portfolio that has a negative expected return.  Most of these portfolios start by including equities and bonds, which each have embedded risk premium.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why should minimum variance outperform other portfolios, such as 60/40 or mean-variance?  &lt;a href=&quot;http://www.econ.yale.edu/~af227/pdf/Leverage%20Aversion%20and%20Risk%20Parity%20-%20Asness%20,%20Frazzini%20and%20Pedersen.pdf&quot;&gt;Asness, Frazzini, and Pedersen&lt;/a&gt; (2011) have laid out an arguement that minimum variance portfolios will typically require using leverage, and this introduces a leverage aversion risk premium.  &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We fill what we believe is a hole in the current arguments in favor of&#xA;  Risk Parity investing by adding a theoretical justification based on&#xA;  investors’ aversion to leverage and by providing broad empirical&#xA;  evidence across and within countries and asset classes.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Minimum variance and risk parity have the benefit of not requiring an estimation of expected return.  It turns out that volatility is one of the most predictable return characteristics, while expected return is inherently very difficult to study and unstable.  &lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2012-02-03T03:12:33.557" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2895" PostTypeId="2" ParentId="2892" CreationDate="2012-02-03T03:57:24.733" Score="9" Body="&lt;p&gt;Your formula looks like cointegration (between the price time series) rather than correlation (between the returns).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To simulate &quot;correlated random walks&quot;, i.e., random walks built from correlated innovations, you can just build the desired covariance matrix (for instance, put ones on the diagonal and $\rho$ everywhere else), take multivariate gaussian samples with this covariance matrix (in R, you can use the &lt;code&gt;mvtnorm&lt;/code&gt; package, or take independent gaussian variables and multiply them by the Choleski matrix), and take the cumulated sum to have an arithmetic random walk.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;k &amp;lt;- 10&#xA;rho &amp;lt;- .9&#xA;sigma &amp;lt;- matrix(rho, nc=k, nr=k)&#xA;diag(sigma) &amp;lt;- 1&#xA;n &amp;lt;- 100&#xA;library(mvtnorm)&#xA;x &amp;lt;- rmvnorm(n, rep(0,k), sigma)&#xA;x &amp;lt;- apply(x, 2, cumsum) &#xA;matplot(x, type=&quot;l&quot;, lty=1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1917" LastActivityDate="2012-02-03T03:57:24.733" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2896" PostTypeId="1" CreationDate="2012-02-03T10:35:03.897" Score="11" ViewCount="3108" Body="&lt;p&gt;An investor at time $t_0$ can invest his wealth $w_0$ in a risky asset $x$ for an amount $a$ and the remain part in the riskless asset $w_0-a$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the end of the period $t_1$, the investor will obtain the wealth $w$:&#xA;$$&#xD;&#xA;w = a(1+x)+(w_0-a)(1+r_f)&#xD;&#xA; =a(x-r_f)+w_0(1+r_f).&#xD;&#xA;$$&#xA;Using a CARA (exponential negative) utility function we have,&#xA;$$&#xD;&#xA;U(w)=-e^{-\lambda w}=-e^{-\lambda a(x-r_f)+w_0(1+r_f)}&#xD;&#xA;$$&#xA;where $\lambda$ is an exogenous parameter for the risk coefficient aversion.&#xA;Then taking its expectation, it is clear that its maximization it does not depend on $w_0$ that is a fixed quantity but from $a$,&#xA;$$&#xD;&#xA;\max_a\textrm{ }E[U(w)]=E[-e^{-\lambda a(x-r_f)}\times e^{w_0(1+r_f)}]&#xD;&#xA;$$&#xA;where $e^{w_0(1+r_f)}$ is a fixed quantity $\tilde{q}$,&#xA;$$&#xD;&#xA;\max_a\textrm{ }E[U(w)]=E[-e^{-\lambda a(x-r_f)}\times \tilde{q}]&#xD;&#xA;$$&#xA;Here is my problem,&#xA;$$&#xD;&#xA;\max_a\textrm{ }E[U(w)]=E[-e^{-\lambda a(x-r_f)}]&#xD;&#xA;$$&#xA;If $a$ is unbounded this expected function has no point of maxima. It goes to infinity. So $a$ must be bounded and depends from the budget constraint of the initial wealth $w_0$. &#xA;The professor by mail told me that is a well know result in finance and $a$ exists as an unique optimal solution. Where am I wrong?&lt;/p&gt;&#xA;" OwnerUserId="1998" LastEditorUserId="1998" LastEditDate="2012-02-03T11:20:00.643" LastActivityDate="2012-02-04T21:22:37.967" Title="Maximization of CARA utility function: unique solution with an unbounded parameter?" Tags="&lt;finance&gt;&lt;economics&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2897" PostTypeId="2" ParentId="2896" CreationDate="2012-02-03T12:07:42.083" Score="5" Body="&lt;p&gt;This looks like a general equilibrium model in Economics. It should be described in most of microeconomics textbooks (e.g. &lt;a href=&quot;http://books.google.ch/books?id=t9pSAlEMyDYC&amp;amp;lpg=PA209&amp;amp;dq=fundamental%20theorems%20of%20welfare%20economics&amp;amp;pg=PA142#v=onepage&amp;amp;q&amp;amp;f=false&quot;&gt;this&lt;/a&gt;). Yes, you need a budget constraint here for$\ a$, otherwise your optimization problem makes no sense. Moreover, the household prefers consumption today to consumption tomorrow and, hence, you may want to enhance your model by discounting next period’s utility. If you want to derive an equilibrium (along with household consumption problem) you also need to consider firm's profit maximization problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Can you point out a reference where you got this model from? In your framework investor is trying to maximize his wealth. Naturally he invests everything (using leverage) to get maximum return. If you want to run unconstrained optimization, I think that you target function should look a bit different, as you are solving multi-period optimization problem and investor want to maximize his total utility. Usually in economic theory they consider 2 period optimization problem like: $\ \mathop {\arg \max }\limits_a E[U({C_0}) + \frac{1}{{1 + DF }}U({C_1}))]\ $, where$\ C$ is his wealth/consumption,$\ DF$ is discount factor (investor prefers wealth today, rather than tomorrow).&lt;/p&gt;&#xA;" OwnerUserId="370" LastEditorUserId="370" LastEditDate="2012-02-03T14:13:31.567" LastActivityDate="2012-02-03T14:13:31.567" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2899" PostTypeId="2" ParentId="2861" CreationDate="2012-02-03T17:02:27.160" Score="1" Body="&lt;p&gt;This &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0133558924&quot; rel=&quot;nofollow&quot;&gt;book&lt;/a&gt; by Richard Harris is a great intro.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The book is short but informative and technically rigorous. As a primer, it's fine. For the advanced student or professional it's obviously lacking, but that's the definition of a primer. ECM and VECM are particularly well treated.&lt;/p&gt;&#xA;" OwnerUserId="1967" LastEditorUserId="56" LastEditDate="2012-02-04T14:59:15.403" LastActivityDate="2012-02-04T14:59:15.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2901" PostTypeId="2" ParentId="2896" CreationDate="2012-02-04T01:03:04.427" Score="10" Body="&lt;p&gt;This is the canonical Arrow-Pratt &quot;portfolio&quot; model. Couple of points on terminology:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;For a function $u$, we define the &lt;em&gt;risk aversion function&lt;/em&gt; by $r_u(x):=-\frac{u&amp;#39;&amp;#39;(x)}{u&amp;#39;(x)}$. In your utility function, $r_u(x) = \lambda$; hence, it is a &lt;em&gt;constant&lt;/em&gt; absolute risk aversion utility and $\lambda$ is the &quot;coefficient of risk aversion,&quot; not the &quot;risk coefficient aversion&quot;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The two points in time, $t_0,t_1$ can be seen as &quot;beginning of period&quot; and &quot;end of period&quot;, where &quot;period&quot; is here the time interval $[t_0,t_1]$. This may be important: you don't need a dynamic approach as was suggested by some people. The guy in your problem allocates $a$ to the risky asset and $w_0-a$ to the riskless, over a time interval included between $t_0$ and $t_1$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Your problem is the basic, canonical portfolio choice model with utility over final wealth. The guy in your problem just consumes what he has in the end of the time period. This is also important to bear in mind.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It's &quot;negative exponential&quot;, not &quot;exponential negative&quot;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Rewrite $w(a)$ for final wealth (end of period, or at $t_1$); it depends on $a$, i.e. the part of $w_0$ that is invested in the risky asset. Your problem is:&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;$$\max_a \;E[U(w(a)] = \max_a \;E[-e^{-\lambda(x-r_f)}]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\chi = x-r_f$, i.e. the &lt;em&gt;excess&lt;/em&gt; return of the risky asset (relative to the risk-free). Denote its distribution function by $dF(\chi)$ and hence&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \max_a \;E[-e^{-\lambda\chi}] = \max_a \;\int -e^{-\lambda z} dF(z)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $a^* = \arg\max_a \;E[U(w(a))]$. The following condition should hold in order for the (interior) optimum $a^*$ of this function to be bounded (note the redundancy in what I wrote just now):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Assumption (I) The values of the excess return random variable $\chi = x - r_f$  alternate in sign, i.e. $\chi$ takes values $\underline{\chi}\leq 0 \leq \overline{\chi}$ with positive probability.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If $\chi$ was positive &lt;em&gt;almost surely&lt;/em&gt;, then $a$ is unbounded precisely because the objective is unbounded, as you very well understood from the beginning. Hence, Assumption (I) should be retained.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Trust your intuition - your professor is wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Addendum:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if $a^*\rightarrow \infty$, i.e. if the optimal solution is unbounded, then the &lt;em&gt;derivative&lt;/em&gt; of the expected utility evaluated at the optimal solution is zero - and since this doesn't make any sense, you have to rephrase it as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \lim_{a\rightarrow\infty} E\left[\frac{d}{da}U(w(a)) \right] = 0 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now $U$ is concave. Hence, in order for $a^* \rightarrow \infty$ not to be a critical point, you have to have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \lim_{a\rightarrow\infty} E\left[\frac{d}{da}U(w(a)) \right] &amp;lt;0  $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and not positive. Replace the parametric form, take the derivative, and you will find a (strict) inequality relating the distribution function and the marginal utility at the limits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And since this is supposed to be a hint and not a homework helpdesk, I have to stop here :) Already, you were right in your original answer, but you have to &lt;em&gt;prove&lt;/em&gt; it as well.&lt;/p&gt;&#xA;" OwnerUserId="114" LastEditorUserId="114" LastEditDate="2012-02-04T21:22:37.967" LastActivityDate="2012-02-04T21:22:37.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2903" PostTypeId="1" CreationDate="2012-02-04T03:57:06.863" Score="12" ViewCount="1305" Body="&lt;p&gt;I have a daily rebalanced portfolio of several strategies. &#xA;After one month, I now want to attribute the performance to the different strategies. There are several ways to do it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance one could compute what each strategy has actually contributed. But it is not always fair as it is dependent on the path of other strategies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or one could compute the theoretical performance of each strategy as if it was standalone and then rebase it so that the sum of the contribution is equal to the actual realised performance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any other idea, or any preference between the two?&lt;/p&gt;&#xA;" OwnerUserId="134" LastEditorUserId="467" LastEditDate="2012-02-04T08:17:12.890" LastActivityDate="2012-02-08T21:18:28.487" Title="How to compute performance attribution between daily rebalanced strategies?" Tags="&lt;portfolio-management&gt;&lt;performance&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2904" PostTypeId="2" ParentId="2903" CreationDate="2012-02-04T04:24:45.750" Score="9" Body="&lt;p&gt;Perform a returns analysis by regressing the returns of your composite strategy on the returns of the component strategies. Constrain the beta coefficients to sum to 100% and bound them from 0 to 1. You will then have the % explained by each component.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-02-04T17:12:22.980" LastActivityDate="2012-02-04T17:12:22.980" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2905" PostTypeId="2" ParentId="2896" CreationDate="2012-02-04T15:55:04.803" Score="4" Body="&lt;p&gt;&lt;strong&gt;First&lt;/strong&gt;, your statement that your utility function goes to infinity is wrong. It's minus exponenta. You can think of it as a minimum of $e^{f(x)}$ which is bounded below by zero whatever $f(x)$ is. In other words, your utility function is bounded above by 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Second&lt;/strong&gt;, maximizing expected value, you need to calculate it before deploying maximization techniques. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, assume that $x-r_f$ is distributed as $N(0,1)$. Then $y:=-\lambda a (x-r_f)$ is distributed as &#xA;$N(-a \lambda,a^2\lambda^2)$. Then, $e^y$ follows the lognormal distribution which mean we can &lt;a href=&quot;http://en.wikipedia.org/wiki/Lognormal_distribution&quot; rel=&quot;nofollow&quot;&gt;look up&lt;/a&gt;, i.e. $E(e^y)=e^{-a\lambda+\frac{a^2\lambda^2}{2}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, we can rewrite initial maximization program as $\min_a \; [e^{-a\lambda+\frac{a^2\lambda^2}{2}}]$. Minimum is achieved at $a=\frac{1}{\lambda}$. If you face troubles calculating it, write it in the comment and I'll write down the steps&lt;/p&gt;&#xA;" OwnerUserId="1969" LastActivityDate="2012-02-04T15:55:04.803" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2906" PostTypeId="1" AcceptedAnswerId="2913" CreationDate="2012-02-04T19:15:18.690" Score="18" ViewCount="10988" Body="&lt;p&gt;I currently have a local volatility model that uses the standard Black Scholes assumptions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When calculating the volatility surface, what causes the difference between the call volatility surface, and the put surface?&lt;/p&gt;&#xA;" OwnerUserId="2004" LastEditorUserId="1106" LastEditDate="2012-02-06T15:29:11.807" LastActivityDate="2019-10-21T13:47:55.503" Title="What causes the call and put volatility surface to differ?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;local-volatility&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="2908" PostTypeId="2" ParentId="2906" CreationDate="2012-02-04T21:55:15.847" Score="0" Body="&lt;p&gt;Implied volatility is the same for European call and European put options (it can be seen from Put-Call parity). If you use non-parametric local volatility model and fit it to implied volatility surface, then you should get exact fit. Therefore, local volatility surface should be the same for call and put options.&lt;/p&gt;&#xA;" OwnerUserId="370" LastEditorUserId="370" LastEditDate="2012-02-05T10:36:03.953" LastActivityDate="2012-02-05T10:36:03.953" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="2909" PostTypeId="1" AcceptedAnswerId="2910" CreationDate="2012-02-06T09:08:46.877" Score="17" ViewCount="77485" Body="&lt;p&gt;I am trying to calculate the log returns of a dataset in R using the usual log differencing method. However, the calculated data is simply a vector of zeroes. I can't see what I'm doing wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the snippet showing what I'm doing&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; prices &amp;lt;- data$cl&#xA;&amp;gt; head(prices)&#xA;[1] 1108.1 1095.4 1095.4 1102.2 1096.3 1096.7&#xA;&amp;gt;&#xA;&amp;gt;&#xA;&amp;gt; lrets &amp;lt;- log(lag(prices)) - log(prices)&#xA;&amp;gt; head(lrets)&#xA;[1] 0 0 0 0 0 0&#xA;&amp;gt; summary(lrets)&#xA;   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. &#xA;      0       0       0       0       0       0 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="1733" LastEditorUserId="1733" LastEditDate="2012-02-06T12:59:13.710" LastActivityDate="2020-07-26T13:23:17.627" Title="Calculating log returns using R" Tags="&lt;r&gt;&lt;returns&gt;" AnswerCount="5" CommentCount="3" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="2910" PostTypeId="2" ParentId="2909" CreationDate="2012-02-06T10:12:21.393" Score="16" Body="&lt;p&gt;You are simply doing $log(S_t) - log(S_t) = 0$ for all $t$. Instead, try&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; n &amp;lt;- length(prices);&#xA;&amp;gt; lrest &amp;lt;- log(prices[-1]/prices[-n])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Should do the trick.&lt;/p&gt;&#xA;" OwnerUserId="1583" LastEditorUserId="1583" LastEditDate="2013-12-09T13:13:24.533" LastActivityDate="2013-12-09T13:13:24.533" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="2911" PostTypeId="2" ParentId="2909" CreationDate="2012-02-06T11:31:44.680" Score="7" Body="&lt;p&gt;I think the simplest method for calculating log returns is &lt;code&gt;ROC&lt;/code&gt; from the &lt;code&gt;TTR&lt;/code&gt; package:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; data(ttrc)&#xA;&amp;gt; roc &amp;lt;- ROC(ttrc[,&quot;Close&quot;])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://CRAN.R-project.org/package=TTR&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://CRAN.R-project.org/package=TTR&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2018-04-08T17:28:14.633" LastActivityDate="2018-04-08T17:28:14.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2912" PostTypeId="2" ParentId="2678" CreationDate="2012-02-06T14:54:17.240" Score="5" Body="&lt;p&gt;In kamikaze_pilot's defense, the question is not that naive or simple.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all, you need to define what options you are talking about. Consider a digital option for example (which is really fairly vanilla since you can proxy it as a combination of two European calls), which pays 1 of the stock is beyond a certain level at maturity and nothing otherwise. The intrinsic value of the option is just 1 or 0, but would you pay more than 1 to buy such an option ? (what's the point of paying more than whatever you would get at most as a payoff....)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, there is a general point here, a option with a limited upside &lt;em&gt;can&lt;/em&gt; have a price lower than the intrinsic value. And this may even apply to European vanilla options, although in very specific circumstances: take a European put option with 0.5y to maturity, 20% implied vol, 100 strike and 5% risk-free rate (ignore all dividends for this example). Now for various spot level, calculate the intrinsic value ( Max(0,strike - spot)) and compare to the option price which you can calculate using Black-Scholes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;spot = 90 --&gt; intrinsic = 10, option price = 11.04  --&gt; intrinsic &amp;lt; option price &lt;/p&gt;&#xA;&#xA;&lt;p&gt;spot = 50 --&gt; intrinsic = 50, option price = 47.55  --&gt; intrinsic &gt; option price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;spot = 10 --&gt; intrinsic = 90, option price = 87.53  --&gt; intrinsic &gt; option price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, this only happens for deep in-the-money put options. Also it can not happen for American options (there would definitely be an arbitrage here, since you could by the option and exercise it right away). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of arbitrage, consider the following: At time t = 0, your underlying spot is S(0). You buy the stock and a European put option with maturity T and strike K. At time T (maturity), the stock is worth S(T) and your portfolio is either&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) (K - S(T)) + S(T) = K, if S(T) &amp;lt; K&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) or S(T), if S(T) &gt; K&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If risk-free rate is r, the accrued cost of the portfolio you set up at time 0 is (P(0) + S(t)) * exp(rT).&#xA;To avoid arbitrage, you need this cost to be greater than the minimum of 1) and 2) above, which is K.&#xA;You get (P(0) + S(t)) * exp(rT) &gt; K --&gt; P(0) &gt; K*exp(-rT) - S(0). This is the actual arbitrage condition, which is close to saying the intrinsic value is a lower bound of the put option but not quite.&lt;/p&gt;&#xA;" OwnerUserId="1986" LastActivityDate="2012-02-06T14:54:17.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2913" PostTypeId="2" ParentId="2906" CreationDate="2012-02-06T15:09:28.417" Score="23" Body="&lt;p&gt;The reason for put and call volatilities to appear different is that the implied vol has been calculated using different drift parameters than those implied by the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's take everything in the model as given except the interest rate $r$ and the volatility $\sigma$.  For European options we have the Black-Scholes formula for put and call values $V_{P,C}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;V_{P,C}=BS_{P,C}(r,\sigma)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, although it is common practice to run this equation backwards to &quot;imply&quot; the volatility $\sigma$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\sigma_{\text{Imp}} = BS^{-1}_{\sigma}(r,V)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;we can see that from a mathematical point of view we could imply $r$ instead&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;r_{\text{Imp}} = BS^{-1}_{r}(\sigma,V).&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously, using a different $r$ affect options prices and therefore implied volatilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider now the consequences of receiving prices from someone using the Black-Scholes model.  For concreteness I will take $T=1, K=S=100$ and no carry cost. Let's say you think $r=1\%$. I give you put and call prices of $7.95$ and $11.80$.    You will get a put vol of $21.3\%$ and a call vol of $28.6\%$.  Seem familiar?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's because I actually generated those prices using $r=4\%$.  If you had used the same drift parameter $r$ as I had employed, you would have computed both volatilities to be $25\%$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally, risk-free interest rates are not too hard to pin down, but we have other effects on drift where the parameters are not so obvious.   This includes dividends, borrow costs and funding costs.  Each of these terms is typically treated as a deterministic &quot;carry cost&quot; but even in the simple case of European options it is not necessarily clear what values should be used for them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So to your answer your question, the difference between put and call volatility surfaces is a symptom of your drift parameters failing to match those of the market.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2015-01-29T20:34:12.490" LastActivityDate="2015-01-29T20:34:12.490" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2915" PostTypeId="1" CreationDate="2012-02-06T23:15:09.037" Score="13" ViewCount="1447" Body="&lt;p&gt;Where can I find disaggregated interbank lending data (i.e. bank A lends to bank B x money at y rate)? I could only find data on interest rates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would accept LIBOR market data as well as any national data of a country with an internationally important banking sector.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also checked some articles on the interbank market, but also faced difficulties finding such sources there. For instance &lt;a href=&quot;http://faculty.london.edu/jcocco/assets/documents/cgmart200407.pdf&quot;&gt;this paper&lt;/a&gt; uses data from 1997-2001 on the Portuguese market from the Portuguese Central Bank, which is of lesser interest for me.&lt;/p&gt;&#xA;" OwnerUserId="1969" LastEditorUserId="1106" LastEditDate="2012-02-07T15:27:42.453" LastActivityDate="2012-02-07T15:54:36.897" Title="Where can I find data on the interbank lending market?" Tags="&lt;data&gt;&lt;interest-rates&gt;&lt;market-data&gt;&lt;banks&gt;" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="2918" PostTypeId="1" CreationDate="2012-02-07T13:00:46.083" Score="7" ViewCount="827" Body="&lt;p&gt;Given that we want to find the Value at Risk for a portfolio of stocks only, there are two main methods to proceed. In the problem, we also assume that stocks follow a geometric Brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A full scale simulation: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;simulate normal deviates B; &lt;/li&gt;&#xA;&lt;li&gt;plug into $S_t = S_0 e^{(\mu-0.5\sigma^2)t + \sigma t B_t}$;&lt;/li&gt;&#xA;&lt;li&gt;pick the 1% highest portfolio value. Call this $V_p$ ;&lt;/li&gt;&#xA;&lt;li&gt;VaR is then $V_t - V_p$.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;where $V_t$ is the current value of portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This methodology is of course good, but can fail to give an accurate solution quickly. Therefore, one can use the quick fix of risk metrics and assume that aritmethic returns equals logreturns ( $\log(1+x) =x$ ) and one get their method:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Parametric version:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Return of portfolio is a linear combination of gaussians, and therefore univariat gaussian itself (Y).&lt;/li&gt;&#xA;&lt;li&gt;VaR is then $\Phi(0.01)\sigma_Y V_t$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Both methods can be justified seperately, but my problem is that I want to alternate to use the two methods (due to time constraints in some cases). A bright observer of this VaR-measure will then see that the amount jumps up and down depending on the method used (especially for high-volatile stocks). &lt;em&gt;Is it therefore possible in some way to modify the parametric VaR-measure to give better results?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Assumed Gaussian for simplicity. &lt;/li&gt;&#xA;&lt;li&gt;The multivariate case is of course the important question, but you can do the generalization yourself).&lt;/li&gt;&#xA;&lt;li&gt;Of course, better simulation techniques can be used (this is not the question adressed here).&lt;/li&gt;&#xA;&lt;li&gt;Also, simulating aritmetic returns will neither address the problem.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1583" LastEditorUserId="467" LastEditDate="2012-02-07T16:43:48.430" LastActivityDate="2012-02-07T23:31:04.650" Title="How to minimize the difference between a parametric VaR and a MC-VaR with lognormal assumption?" Tags="&lt;monte-carlo&gt;&lt;var&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2920" PostTypeId="2" ParentId="2915" CreationDate="2012-02-07T15:54:36.897" Score="4" Body="&lt;p&gt;Per the comments and conversation with &lt;a href=&quot;https://quant.stackexchange.com/users/1106/tal-fishman&quot;&gt;Tal&lt;/a&gt; in &lt;a href=&quot;http://chat.stackexchange.com/transcript/message/3298414#3298414&quot;&gt;chat&lt;/a&gt;, this question is on-topic.  Therefore, I'll formally take a stab at answering it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had to deal with requests like this when I was a research analyst at the Federal Reserve.  If you can't find anything via internet searches, the best thing to do is call institutions that may know where to find the data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We had a subscription to &lt;a href=&quot;http://www.haver.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;Haver Analytics&lt;/a&gt; and they were always very helpful even if they didn't have the data.  You might also try contacting the &lt;a href=&quot;http://www.bba.org.uk/&quot; rel=&quot;nofollow noreferrer&quot;&gt;BBA&lt;/a&gt; and/or the &lt;a href=&quot;http://www.bis.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;BIS&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even though this &lt;em&gt;technically&lt;/em&gt; doesn't answer your question, I hope it helps you find the data you're looking for.&lt;/p&gt;&#xA;" OwnerUserId="56" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2012-02-07T15:54:36.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2922" PostTypeId="2" ParentId="2918" CreationDate="2012-02-07T17:50:21.883" Score="5" Body="&lt;p&gt;A probabilistic view on your full scale simulation. In the steps 1-3 you calculate the 0.99 quantile of the lognormal distribution with parameters $\ln N(\ln S_0 +(\mu - \frac{\sigma^2}{2})t,\sigma^2 t^2)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://en.wikipedia.org/wiki/Lognormal_distribution#Cumulative_distribution_function&quot; rel=&quot;nofollow&quot;&gt;cdf of lognormal distribution&lt;/a&gt; is $\Phi(\frac{\ln x-\mu}{\sigma})$&#xA;Thus, you can calculate $V_p$ through $V_p=e^{\ln S_0 +(\mu - \frac{\sigma^2}{2})t + q_{0.99} \sigma t}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $q_{0.99}$ defined through $\Phi(q_{0.99})=0.99$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Replacing Monte-Carlo in steps 1-3 with this formula, you'll calculate VaR quick and accurate.&lt;/p&gt;&#xA;" OwnerUserId="1969" LastEditorUserId="1969" LastEditDate="2012-02-07T20:03:31.000" LastActivityDate="2012-02-07T20:03:31.000" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2923" PostTypeId="2" ParentId="1605" CreationDate="2012-02-07T22:43:25.960" Score="2" Body="&lt;p&gt;In the rates world (ie swaptions, caps and floors) I believe most banks are using some form of the &lt;em&gt;SABR&lt;/em&gt; model (Stochastic Alpha Beta Rho) for building the volatility smile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When we say 'use the SABR model' what we really mean is that the smile shape function is derived from the shape of the smile in a theoretical model of form:&#xA;$$&#xD;&#xA;\text{d} F_t = \sigma_t F_t^\beta \, \text{d} W^1_t&#xD;&#xA;$$&#xA;$$&#xD;&#xA;\text{d} \sigma_t = \alpha \sigma_t \, \text{d} W^2_t&#xD;&#xA;$$&#xA;$$&#xD;&#xA;\text{d}W^1_t \text{d}W^2_t = \rho \, \text{d}t&#xD;&#xA;$$&#xA;Some clever people found a way to get a good-quality closed-form approximation for the smile function, so effectively you can just plug in the parameters and get your volatity at a given strike for a given value of the forward.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, the formula is known to break down at low strikes -- producing negative values for the implied probability distribution. Therefore most houses have put resources into fixing this in one way or another.&lt;/p&gt;&#xA;" OwnerUserId="1920" LastActivityDate="2012-02-07T22:43:25.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2924" PostTypeId="2" ParentId="2918" CreationDate="2012-02-07T23:31:04.650" Score="2" Body="&lt;p&gt;If you are in a non-gaussian situation,&#xA;do not explicitely know the distribution of $S_t$,&#xA;and have to resort to either approximations (gaussian, mixture of gaussians, etc.)&#xA;or Monte Carlo simulations, &#xA;you can remove the noise of the Monte Carlo simulations &#xA;by reusing the same random numbers to generate the data.&#xA;This can usually be achieved by explicitely setting the random seed &#xA;before the computations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this is not a &quot;better&quot; result: &#xA;the variation in the data has just been hidden,&#xA;and a constant, unknown bias has been introduced.&#xA;Ideally, you should provide some form of confidence interval &#xA;on the VaR estimator: that will explain the variations.&#xA;To have a &quot;better&quot; result, you should reduce that interval.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you also want to hide the jumps resulting from the change &#xA;in the method used to compute the VaR,&#xA;you can estimate the difference between the two &#xA;(by computing the VaR using both methods, when time is available),&#xA;assume it is roughly constant,&#xA;and add it to the estimator you want to &quot;correct&quot;.&#xA;(I would refrain from doing that if the bias is too large, when compared to the confidence interval.)&lt;/p&gt;&#xA;" OwnerUserId="1917" LastActivityDate="2012-02-07T23:31:04.650" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2925" PostTypeId="1" AcceptedAnswerId="2933" CreationDate="2012-02-08T00:03:22.770" Score="5" ViewCount="154" Body="&lt;p&gt;Kept waiting in the bank yesterday, with no paint to watch dry, I found myself staring at the mortgage rates. (These are all annual interest rates):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Variable: 2.475%&lt;/li&gt;&#xA;&lt;li&gt;1 year: 2.90%&lt;/li&gt;&#xA;&lt;li&gt;2 years: 3.05%&lt;/li&gt;&#xA;&lt;li&gt;3 years: 3.15%&lt;/li&gt;&#xA;&lt;li&gt;5 years: 3.30%&lt;/li&gt;&#xA;&lt;li&gt;7 years: 3.35%&lt;/li&gt;&#xA;&lt;li&gt;10 years: 3.65%&lt;/li&gt;&#xA;&lt;li&gt;15 years: 4.25%&lt;/li&gt;&#xA;&lt;li&gt;20 years: 4.70%&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The longer the fixed rate the higher the interest rate; no surprise there, as the bank wants its reward for taking on the risk of rate movements. But the chart of those prices is neither a straight line, nor a simple curve, so it must represent more than risk. (?)&#xA;Does it represent this bank's predictions of how the central bank's benchmark interest rate will move?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so, how do I extract their prediction from that data? I.e. how do I remove the fixed-rate risk element. (BTW, the current benchmark interest rate is 0.00%, which may affect the calculations, as rates can only move in one direction.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As these are rates offered to consumers, could there there also be an element of marketing here? E.g. is the 7 year rate artificially low because they want to tie more people into the 7 year rate than the 5 year rate?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Rates are from Tokyo Mitsubishi UFJ bank; benchmark rate is from Bank Of Japan.)&lt;/p&gt;&#xA;" OwnerUserId="1587" LastActivityDate="2012-02-08T19:28:23.467" Title="How to remove the risk element from a set of fixed rate mortgage offerings?" Tags="&lt;interest-rates&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2926" PostTypeId="2" ParentId="2868" CreationDate="2012-02-08T01:08:54.107" Score="6" Body="&lt;p&gt;Using MySQL for financial data is not unreasonable. But for &lt;em&gt;tick data&lt;/em&gt; are you ever going to do anything except a query on a date range? For analyzing tick data in R I generally keep it in a disk file, one tick file per day, and load the files in as I need them. Using .RData files instead of csv files is quicker.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've also used custom C++ classes before, to really get quick, but if the data is then to be analyzed in R, there is not much point.&lt;/p&gt;&#xA;" OwnerUserId="1587" LastActivityDate="2012-02-08T01:08:54.107" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2927" PostTypeId="1" AcceptedAnswerId="2929" CreationDate="2012-02-08T01:15:58.187" Score="10" ViewCount="1781" Body="&lt;p&gt;I have an API that for an order routing platform that is in visual basic. The maximum frequency or orders to exchanges will be milliseconds, where the underlying systems are expected to be able to process a maximum of 1 order per millisecond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally I would like to write in C++ or Java when I have this level of speed in mind, and have a broad stigma against visual basic for being inherently slower.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But since 1 millisecond is a long time in computer time, is visual basic still fast enough?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The algorithm will be reading information from the exchanges, crunching a few numbers and determining an order to send back to the exchanges.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am estimating latency of 120 milliseconds, 1 millisecond to do the computational math, and then another 120 milliseconds back to the exchange. or less of course, but I know where the computers are geographically and this is about how long it should take.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to keep the computational time at 1 millisecond, this isn't really a stretch for visual basic on a modern computer correct? (the local machine won't be doing much processing, as it will be fed most relevant data from the clearing firms data feeds)&lt;/p&gt;&#xA;" OwnerUserId="1453" LastActivityDate="2012-04-13T00:53:00.917" Title="Is Visual Basic a fast enough for millisecond orders" Tags="&lt;quant-trading-strategies&gt;&lt;programming&gt;&lt;time-scale&gt;" AnswerCount="5" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2928" PostTypeId="2" ParentId="2927" CreationDate="2012-02-08T04:12:30.847" Score="11" Body="&lt;p&gt;The only way to find out is to try it!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It shouldn't take very long to write some simple code to simulate the computations you plan to do, and run it in a loop.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With current versions of Visual Basic (VB.net), performance should be comparable to Java in most cases because the basic technology (compiling to intermediate code and then running a just-in-time compiler) are roughly the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Performance in C or C++ may be faster. Then again, it may not. The only way to find out is to try!&lt;/p&gt;&#xA;" OwnerUserId="83" LastActivityDate="2012-02-08T04:12:30.847" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2929" PostTypeId="2" ParentId="2927" CreationDate="2012-02-08T10:10:20.910" Score="10" Body="&lt;p&gt;All .NET languages are perfectly able to compete with the speed of C and even FORTRAN. It all depends on if they are used the correct way. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Both Java and .NET have considerable longer startup times than most native app. Therefore, you will have to have the application running and not starting it over and over on request. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Memory management is crucial when using managed heaps and if you are in need of reliable peak performance. Make sure, not to allocate large arrays over and over, since this will stress the GC too much and produce larger latencies. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Consider using optimized libraries. Some are around for C#/Visual Basic (&lt;a href=&quot;http://ilnumerics.net/blog/fast-faster-performance-comparison-c-ilnumerics-fortran-matlab-and-numpy-part-ii/&quot;&gt;ILNumerics&lt;/a&gt;) and Java (f.e. &lt;a href=&quot;http://jblas.org&quot;&gt;jblas&lt;/a&gt;). Recent tests have shown very good performance for numeric managed algorithms compared to native implementations and other frameworks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) Test your implementation and profile it! If you are positive, you could reach the performance goal with a C implementation, you can reach it with .NET as well. &lt;/p&gt;&#xA;" OwnerUserId="2020" LastActivityDate="2012-02-08T10:10:20.910" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2930" PostTypeId="2" ParentId="1764" CreationDate="2012-02-08T10:56:34.127" Score="4" Body="&lt;p&gt;Its because the people still &quot;think&quot;, it must be faster and hence favor C++. Real arguments are sparse. Some of the most ideological arguments: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;'Bound checks on every array element access.' But in relevant loops they can be removed in C# and are automatically removed in Java (Hot Spot VM) and CLR often.&lt;/li&gt;&#xA;&lt;li&gt;'GC is slow.' Yes it is slower on collecting garbage. But allocations are much faster then in C++! And VM language developer are made to implement pooling strategies to circumvent allocations nearly completely. This, at the end, is even faster than the frequent new/delete in C. &lt;/li&gt;&#xA;&lt;li&gt;'SSE instructions only in C++.' Partly true for .NET. But instead of optimizing the very end of uniprocessor performance, one should rather optimize the memory usage, which is a real challenge for our common large datasets and by far the biggest reason for slow execution nowadays. &lt;/li&gt;&#xA;&lt;li&gt;'Superior parallelizm.' How that? OpenMP &amp;amp; Co use the same system resources and synchronization constructs which are available to, lets say, .NET as well. It is - as always - up to the user to utilize them in an efficient way. Especially if it comes to thread level parallelism higher level languages provide more comfort to be written. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;At the end, every system is heterogenious. The choice of a language for a specific task should not be biased by the personal experience too much, but rather reflect the abilities of the language to get the work done fast and reliable. I would not use C++ for user interfaces anymore. C# is better at that - and equally good for many tasks which were assigned to C++ uniquely in the past. &lt;/p&gt;&#xA;" OwnerUserId="2020" LastActivityDate="2012-02-08T10:56:34.127" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2931" PostTypeId="2" ParentId="1764" CreationDate="2012-02-08T12:53:54.650" Score="8" Body="&lt;p&gt;Not all will agree that &quot;the maintenance cost of the program [is] lower than the C++ one.&quot; For just one thing, when we use C# or similar, we have to wrestle with the C# &quot;framework,&quot; which aims, but often fails, to deliver a &quot;richer,&quot; &quot;more powerful&quot; development environment. But &quot;richer, more powerful&quot; is in the eye of the language designer or design committee and often translates, on the mat, to &quot;a briar patch of needless complexities, obstructions, irregularities, dead ends, unexpected stupidities, counterintuitive rules, and lazy, dumbass assumptions.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;C and C++ (and, yes, assembler) present no such hurdles, which considerably eases programming and maintenance.    &lt;/p&gt;&#xA;" OwnerUserId="618" LastEditorUserId="618" LastEditDate="2012-02-08T13:19:39.803" LastActivityDate="2012-02-08T13:19:39.803" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2932" PostTypeId="2" ParentId="2927" CreationDate="2012-02-08T13:43:25.100" Score="1" Body="&lt;p&gt;From the computational (math) prespective, VB.net should be able to compete with Java and  C/C++. The only possible problem can be the garbage collection (as in Java). Therefore don't forget to set &lt;a href=&quot;https://stackoverflow.com/questions/6146334/what-triggers-a-gen2-garbage-collection&quot;&gt;server-type garbage collector&lt;/a&gt; and carefully organize/manage your data structures.&lt;/p&gt;&#xA;" OwnerUserId="370" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2012-02-08T13:43:25.100" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2933" PostTypeId="2" ParentId="2925" CreationDate="2012-02-08T18:42:16.177" Score="3" Body="&lt;p&gt;Mortgage prices involve the following elements&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The cost of funds to the bank&lt;/li&gt;&#xA;&lt;li&gt;The risk of default by the borrower&lt;/li&gt;&#xA;&lt;li&gt;The price of any embedded optionality in the mortgage&lt;/li&gt;&#xA;&lt;li&gt;Anticipated administration costs&lt;/li&gt;&#xA;&lt;li&gt;Upfront payments (known as &quot;points&quot;)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;To first order, there isn't actually any premium associated with the risk of rate movements, because the bank can hedge those away by taking opposing positions in the swaps markets.  Higher-order rate risk effects related to optionality do exist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The cost of funds to the bank is essentially &quot;the&quot; risk-free rate plus a premium associated with the bank's own potential for default.  In the USA most mortgages are actually priced against FNMA's cost of funds, because most mortgages are securitized and sold to that agency.  Tokyo Mitsubishi would have a relatively low default risk and cost of funds like Fannie Mae.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Different countries have different customs about optionality.  In the USA, almost all mortgages allow the buyer to prepay without penalties but that's not the case in the UK.  Traditionally US mortgages had tended to be fixed-rate, so the embedded prepayment option enjoyed by the homeowner can be valuable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Floating rate mortgages, more common in the USA in the last decade and in Europe for many decades, entail less interest-rate risk for the issuer but the optionality of gradual rate increases, caps, and floors can be complicated.  In practice lot of that optionality is just plain ignored when setting the prices, particularly since borrower default is a more important element and simultaneously difficult to measure or estimate.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2012-02-08T19:28:23.467" LastActivityDate="2012-02-08T19:28:23.467" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2934" PostTypeId="2" ParentId="2903" CreationDate="2012-02-08T21:12:15.623" Score="1" Body="&lt;p&gt;If you are using the Bisons model the frequency of compounding should be as much as the the rebalance frequency of the portfolio. In your case to get meaningful results you will need to use daily compounding. One this to be careful is that you must take transaction effect into account when calculating the return. If you are using a software like FactSet it has the option to set frequency as well as to take transaction effect into account. If you want to do the calculations your self see these 2 references.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://corporate.morningstar.com/us/documents/MethodologyDocuments/MethodologyPapers/EquityPerformanceAttributionMeth.pdf&quot; rel=&quot;nofollow&quot;&gt;http://corporate.morningstar.com/us/documents/MethodologyDocuments/MethodologyPapers/EquityPerformanceAttributionMeth.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.mscibarra.com/research/articles/2010/Beyond%20Brinson%20Establishing%20the%20Link%20Between%20Sector%20and%20Factor%20Models%20(Apr%202010).pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.mscibarra.com/research/articles/2010/Beyond%20Brinson%20Establishing%20the%20Link%20Between%20Sector%20and%20Factor%20Models%20(Apr%202010).pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In case the portfolio is not balanced frequently (not in your case) you can do a one period attribution in excel it self without compounding. Assumptions: transaction costs are negligible within the period, there is no rebalancing or rebalance is negligible within the period thus the average weights represent the holdings approximately.&lt;/p&gt;&#xA;" OwnerUserId="909" LastEditorUserId="909" LastEditDate="2012-02-08T21:18:28.487" LastActivityDate="2012-02-08T21:18:28.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2935" PostTypeId="2" ParentId="1764" CreationDate="2012-02-08T21:35:36.157" Score="0" Body="&lt;p&gt;I do agree with the argument on historic reasons, speed and GC with regarding the original question. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To add my 2 cents to the rest of the discussion, I believe that Scala/Akka combination will gain a strong foothold in QF. Of course Languages like Erlang did exist long before Scala/Akka, but did not get much footing due to its esoteric nature and cryptic syntax (at least for people familiar with C/C++ like languages) and not many used it. Scala syntax is also cryptic but there is a growing user base and IB and funds have started using it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also another language to watch-out is F#.&lt;/p&gt;&#xA;" OwnerUserId="909" LastActivityDate="2012-02-08T21:35:36.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2936" PostTypeId="2" ParentId="2882" CreationDate="2012-02-08T22:09:26.693" Score="-1" Body="&lt;p&gt;Assuming you have an &quot;optimal&quot; target portfolio (Using BL model or otherwise), what you should be looking is that expected return enhancement from divergence from the previously computed &quot;optimal&quot; w.r.t. the marginal contribution to risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NB: optimal is in inverted commas.&lt;/p&gt;&#xA;" OwnerUserId="909" LastActivityDate="2012-02-08T22:09:26.693" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2937" PostTypeId="2" ParentId="2700" CreationDate="2012-02-08T22:21:33.060" Score="-4" Body="&lt;p&gt;I look at the slope of the natural log of the ratio between the asset class and composite, i.e., slope(ln(asset/composite)). Put this into 5 baskets and decide to over weight / under weight accordingly.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;As for references there there any many but I can give the following two pointers:&#xA; - Publication by &lt;a href=&quot;https://www.aninvestor.com/pdfs/Research_Abstracts.pdf&quot; rel=&quot;nofollow&quot;&gt;AI Investors&lt;/a&gt;&#xA; - &lt;a href=&quot;http://www.symmys.com/resources&quot; rel=&quot;nofollow&quot;&gt;Symmys&lt;/a&gt; (much of it is also in &lt;a href=&quot;http://ssrn.com&quot; rel=&quot;nofollow&quot;&gt;ssrn&lt;/a&gt;, but of course this has a broader scope.)&lt;/p&gt;&#xA;" OwnerUserId="909" LastEditorUserId="909" LastEditDate="2012-02-09T12:37:03.987" LastActivityDate="2012-02-09T12:37:03.987" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2938" PostTypeId="2" ParentId="2587" CreationDate="2012-02-08T22:44:43.607" Score="1" Body="&lt;p&gt;Major measures of liquidity is volume and the spread. I would look for correlation between returns and volume and the bid-ask spread. On each time there is a negative anticipation I would add the stock sizing by the POV target at that point and the difference between arrival price and current price and buy sell imbalances in the order book. The specifics on how these are done would be a differentiating factor between each execution algo implementation.&lt;/p&gt;&#xA;" OwnerUserId="909" LastActivityDate="2012-02-08T22:44:43.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2939" PostTypeId="2" ParentId="1764" CreationDate="2012-02-09T02:13:04.003" Score="8" Body="&lt;p&gt;The optimization possibilities offered by C++ templates can make code potentially very fast; faster than C, and faster than Java could ever hope to be. (A C programmer will typically use a function pointer and a compiler cannot inline that; a C++ functor can and will be inlined.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know C# has templates that look like C++'s but I cannot personally comment on speed benefits. C# is too closely tied in with Windows. And Windows is not a good platform to build financial systems on (IMHO, but also that of the LSE and others ;-) And don't get me started on DLL Hell when you try to mix APIs from two companies...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[Feb'13 UPDATE: Ironically I've done a lot more C# in the year since writing that. (And that is an indication of its growing support, even going so far as some companies offering a C# API &lt;em&gt;instead of&lt;/em&gt; a C++ API.) C#/Mono works well (but the people offering C# APIs are foolishly not testing on Mono and letting needless Windows dependencies in; foolish because it limits their potential audience). Finally, C# templates are instantiated at run-time, so it is not possible to do those the C++ compile-time optimizations.]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do agree with others that the tide may be turning against C++, but C++11 may give it a new lease of life. The speed and power is still all there, but the auto keyword and the built-in lambdas (to name but two) can make the code look much cleaner (meaning easier to maintain and harder to introduce bugs).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, as a reason to use C++ in finance, there is &lt;a href=&quot;http://cran.r-project.org/web/packages/Rcpp/index.html&quot; rel=&quot;noreferrer&quot;&gt;Rcpp&lt;/a&gt; and &lt;a href=&quot;http://cran.r-project.org/web/packages/RInside/index.html&quot; rel=&quot;noreferrer&quot;&gt;RInside&lt;/a&gt; !&lt;/p&gt;&#xA;" OwnerUserId="1587" LastEditorUserId="1587" LastEditDate="2013-02-13T04:35:03.530" LastActivityDate="2013-02-13T04:35:03.530" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2940" PostTypeId="1" AcceptedAnswerId="2950" CreationDate="2012-02-09T02:17:05.823" Score="7" ViewCount="2394" Body="&lt;p&gt;I overheard someone at work today talking about a commodity spread option pricing model and he was asking our quant if he should use price volatility instead of return volatility as the volatility input parameter. He was referring to volatility calculated on absolute price change as opposed to relative price change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have never heard of a model that would theoretically accept such a volatility parameter. Are there models that explicitly do? Are there other reasons why one might use volatility calculated on absolute price change as opposed to relative price change?&lt;/p&gt;&#xA;" OwnerUserId="1112" LastActivityDate="2012-02-10T15:54:28.237" Title="Price volatility instead of return volatility for spread option parameter" Tags="&lt;returns&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2942" PostTypeId="2" ParentId="1764" CreationDate="2012-02-10T09:12:38.187" Score="2" Body="&lt;p&gt;C is tought at courses at universities everywhere. And people invested many time and efford to get into it. Now we want to collect the fruits and not reinvest into any new platform/language. But the IT world is changing so fast as does the computer architecture. &quot;Next Generation&quot; developers are used to handle C# and Java even more than C++. And they are getting tired of changing platforms - if everything they need is already there. I have switched to Visual Basic 6 years ago and didn't regred so far. &lt;/p&gt;&#xA;" OwnerUserId="2030" LastActivityDate="2012-02-10T09:12:38.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2943" PostTypeId="2" ParentId="1764" CreationDate="2012-02-10T09:26:32.430" Score="11" Body="&lt;p&gt;People use C++ because it offers a balance between performance and convenience. It is true that you can get Java to be (almost) as fast as C++, but you need to put a lot of effort into it. On the other hand, an average-quality C++ code will be much faster than average-quality Java code. I know this from personal experience.&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2012-02-10T09:26:32.430" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2944" PostTypeId="1" CreationDate="2012-02-10T10:33:29.100" Score="5" ViewCount="626" Body="&lt;p&gt;There appears to be several ways of calculating volatility:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Price volatility (of which there are several variants):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;close to close&lt;/li&gt;&#xA;&lt;li&gt;high low range&lt;/li&gt;&#xA;&lt;li&gt;average of open, high, low and close&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Log returns volatility&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;My question(s) are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a). Why are there so many different ways of calculating volatility (since the method used sometimes changes the numbers dramatically)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b). When is a particular method preferred?&lt;/p&gt;&#xA;" OwnerUserId="1733" LastActivityDate="2012-02-10T10:56:13.837" Title="Why are there so many different ways of calculating historical volatility" Tags="&lt;volatility&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2945" PostTypeId="2" ParentId="2944" CreationDate="2012-02-10T10:56:13.837" Score="4" Body="&lt;p&gt;The question barely fits the Q&amp;amp;A format.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Volatility is something which is quite &lt;em&gt;abstract&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically the type of volatility you use depends on the model you chose to implement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you model asset prices, you will use price volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you model return prices, you will use returns volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;High-low price range can be used as a proxy for the volatility, but it's pretty unsophisticated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short, there is no real preferred method, the way you compute volatility depends on the model you use.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2012-02-10T10:56:13.837" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2946" PostTypeId="2" ParentId="2311" CreationDate="2012-02-10T13:00:38.750" Score="2" Body="&lt;p&gt;There is a product called &lt;a href=&quot;http://www.wallstreetbirds.com/&quot; rel=&quot;nofollow&quot;&gt;Wall Street Birds&lt;/a&gt; which can be used for trading. Still in invitation mode. Another sentiment based product is &lt;a href=&quot;http://www.piqqem.com/&quot; rel=&quot;nofollow&quot;&gt;Piqqem&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="909" LastActivityDate="2012-02-10T13:00:38.750" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2947" PostTypeId="1" AcceptedAnswerId="2948" CreationDate="2012-02-10T14:10:13.877" Score="2" ViewCount="1554" Body="&lt;p&gt;I went through the most advanced books on statistics and still can't find an answer. There is a well known formula for combining volatility of two correlating variables, but what about adding the actual amounts, which are already known?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a simply put problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know that the anticipated loss from factor X = 30%, anticipated loss from factor Y = 50%&#xA;It is also known, that the coefficient of correlation between factor X and Y = -0.6&#xA;What cumulative loss from both factors should we expect?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. A citation to a book or publication would be super appreciated&lt;/p&gt;&#xA;" OwnerUserId="2032" LastActivityDate="2012-02-11T09:02:25.643" Title="How to calculate cumulative loss from two factors that have negative correlation?" Tags="&lt;correlation&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2948" PostTypeId="2" ParentId="2947" CreationDate="2012-02-10T14:33:29.850" Score="0" Body="&lt;p&gt;Assuming the above return a log return (Simple returns are not additive)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(r .* w) * p * w'&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;r - expected loss&lt;/p&gt;&#xA;&#xA;&lt;p&gt;p - correlations&lt;/p&gt;&#xA;&#xA;&lt;p&gt;w - weights&lt;/p&gt;&#xA;&#xA;&lt;p&gt;' - transpose&lt;/p&gt;&#xA;&#xA;&lt;p&gt;.* - element-wise multiplication &lt;/p&gt;&#xA;" OwnerUserId="909" LastEditorUserId="909" LastEditDate="2012-02-11T09:02:25.643" LastActivityDate="2012-02-11T09:02:25.643" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2949" PostTypeId="1" CreationDate="2012-02-10T14:39:17.673" Score="7" ViewCount="711" Body="&lt;p&gt;I think there should be an obvious connection of the two implied vol curves from the SPX and SPY markets since the underlying of SPX is SP500, while the underlying of SPY is a ETF which tracks sp500 index &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A very simple idea would be : with the same expiration date (while one is AM and the other one is PM), for the strike at the same log moneyness, i.e. $\log(\frac{K}{F})$, I assume the vol should be the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone has any suggestions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Motivation: SPY is a much tighter market, if I know the vol curve of SPY, and I can somehow convert the vol of SPY to the vol of SPX, then I would claim I get a more accurate vol curve for SPX.&lt;/p&gt;&#xA;" OwnerUserId="1254" LastEditorUserId="1254" LastEditDate="2012-02-10T16:08:09.763" LastActivityDate="2012-02-13T19:40:07.397" Title="What's the connection between implied vol curve of SPX and SPY?" Tags="&lt;implied-volatility&gt;&lt;spx&gt;&lt;american-options&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2950" PostTypeId="2" ParentId="2940" CreationDate="2012-02-10T15:54:28.237" Score="4" Body="&lt;p&gt;Spreads between asset prices $A_1$ and $A_2$ are indeed the key here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since spreads can go negative, one certainly cannot model them with a geometric brownian motion.  The natural quant inclination is to model spreads as the difference between two GBMs.  Unfortunately, a difference of GBMs is not nearly so mathematically tractable as a GBM itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In contrast, if we consider the spread $S=A_1-A_2$ as an arithmetic brownian motion or other tractable process, life gets much easier.  In particular an ABM is actually &lt;em&gt;easier&lt;/em&gt; to deal with mathematically than a GBM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The attractiveness of using $S$ is especially high once you consider skew, since taking a difference of $A_1$ and $A_2$ in a way consistent with their skew is rather difficult, while just postulating a skew for $S$ is as simple to treat as any other skew.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is common practice, when using ABM, to avoid the term &lt;em&gt;volatility&lt;/em&gt; and use some other parameter name like &lt;em&gt;variability&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-02-10T15:54:28.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2951" PostTypeId="2" ParentId="2947" CreationDate="2012-02-10T18:13:17.343" Score="1" Body="&lt;p&gt;If the two factors are equally weighted, then the expected loss of the portfolio is just the average of the two expected losses.  The expected value of the sum of random variables is always the sum of the expected values.&#xA;If you want to compute tail risks of a portfolio, then you need more information (unless the correlation was -1).&lt;/p&gt;&#xA;" OwnerUserId="1418" LastActivityDate="2012-02-10T18:13:17.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2952" PostTypeId="2" ParentId="569" CreationDate="2012-02-10T18:45:44.857" Score="0" Body="&lt;p&gt;There is also &lt;a href=&quot;http://www.ften.com/&quot; rel=&quot;nofollow&quot;&gt;FTEN&lt;/a&gt;. I heard they offer risk control, multi-exchange access and, most important, ISO execution.&lt;/p&gt;&#xA;" OwnerUserId="1791" LastActivityDate="2012-02-10T18:45:44.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2953" PostTypeId="2" ParentId="2927" CreationDate="2012-02-10T21:00:41.000" Score="2" Body="&lt;p&gt;Short answer: Yes. I am using it frequently. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The stigma regarding Visual Basic comes from the time, where VB5 was COM based with some dirty language quirks. This time, VB was intended for/ to be used within / in conjunction with Office' macros. .NET substantially changed the technology behind the language as well as removed most 'quirks' regarding usability. It is now on par with C# and all other .NET languages regarding execution speed.&lt;/p&gt;&#xA;" OwnerUserId="2030" LastActivityDate="2012-02-10T21:00:41.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2954" PostTypeId="1" CreationDate="2012-02-12T00:04:07.757" Score="9" ViewCount="464" Body="&lt;p&gt;Is there any measure that is a non-trivial combination of VWAP and TWAP? For example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\textrm{VTWAP} = \frac{\textrm{VWAP}+\textrm{TWAP}}{2}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm thinking about something like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\textrm{VTWAP}_{\textrm{exp}}(\alpha,T) = \frac{\sum{P_i * V_i * e^{-i*\alpha}}}{\sum{V_i * e^{-i*\alpha}}}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $P_i$ is the price at time $T-i+1$ and $V_i$ is the volume at time $T-i+1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Influence of past volumes is exponentially decayed with factor $\alpha$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can see that $\textrm{VTWAP}_{\textrm{exp}}(0,T)=\textrm{VWAP}(T)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think that good point to start to analyse this problem is to find out types of existing TWAPs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second part of the question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any mathematical requirements or equations that measures like TWAP and VWAP should meet?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like that, but more advanced: $\textrm{VWAP}(T+1)=\textrm{VWAP}(T)$ for $V_T=0$ which state that there was no trade at time $T$.&lt;/p&gt;&#xA;" OwnerUserId="2037" LastEditorUserId="35" LastEditDate="2012-02-12T18:50:19.330" LastActivityDate="2012-04-15T10:55:17.680" Title="Is there any measure that is a non-trivial combination of VWAP and TWAP?" Tags="&lt;time-series&gt;&lt;trading&gt;&lt;volume&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2955" PostTypeId="1" AcceptedAnswerId="2957" CreationDate="2012-02-12T16:15:20.793" Score="16" ViewCount="8762" Body="&lt;p&gt;One can find many papers about estimators of the historical volatility of a geometric Brownian motion (GBM). I'm interested in the estimation of the &lt;strong&gt;drift&lt;/strong&gt; of such a process. Any link on this topic would be very helpful.&lt;/p&gt;&#xA;" OwnerUserId="2042" LastEditorUserId="35" LastEditDate="2012-02-12T18:54:12.087" LastActivityDate="2018-09-01T12:11:47.913" Title="Estimation of Geometric Brownian Motion drift" Tags="&lt;brownian-motion&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="2956" PostTypeId="1" AcceptedAnswerId="2973" CreationDate="2012-02-12T16:55:41.233" Score="4" ViewCount="507" Body="&lt;p&gt;I have a future on a two-year UK government bond that I wish to price.  The bond future expires in 3 months.  I was thinking of building a portfolio of 3-month deposit futures (1 x 3 month deposit starting in 3 months, 1 x 3 month deposit starting in 6 months and so on out to 2 years + 3 months).  My intuition leads me to think that when the bond future expires, its 2 year interest rate should be equal to the 2 year interest rate implied by the deposit portfolio, but I suspect I need to make some adjustments to take in to account the semi-annual coupon paid by the bond.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I thinking along the right lines?  Fixed income isn't something I have a massive amount of experience with.  &lt;/p&gt;&#xA;" OwnerUserId="2043" LastEditorUserId="467" LastEditDate="2012-02-14T09:33:57.760" LastActivityDate="2012-02-15T16:44:35.627" Title="Pricing a bond future with a basket of deposit futures" Tags="&lt;fixed-income&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2957" PostTypeId="2" ParentId="2955" CreationDate="2012-02-12T17:41:37.857" Score="15" Body="&lt;p&gt;One reference is &quot;The Econometrics of Financial Markets&quot; by John Y. Campbell, Andrew W. Lo, &amp;amp; A. Craig MacKinlay -- &lt;a href=&quot;https://press.princeton.edu/titles/5904.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://press.princeton.edu/titles/5904.html&lt;/a&gt;. In particular:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; 9.3.1 Parameter Estimation of Asset Price Dynamics 356&#xA; 9.3.4 The Effects of Asset Return Predictability 369&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You might also take a look at Chan (1992) &quot;An Empirical Comparison of Alternative Models of the Short-Term Interest Rate&quot; which discusses parameter estimation of several models including the GBM:&#xA;&lt;a href=&quot;http://rady.ucsd.edu/faculty/directory/valkanov/classes/mfe/docs/Longstaff_JoF_1992.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://rady.ucsd.edu/faculty/directory/valkanov/classes/mfe/docs/Longstaff_JoF_1992.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are also rather nice packages for R, 'sde' and 'yuima', which allow you (among many other things) to estimate the parameters of the SDE models. Take a look at the slides &quot;Statistical data analysis of financial time series and option pricing in R&quot; -- &lt;a href=&quot;http://past.rinfinance.com/agenda/2011/StefanoIacus.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://past.rinfinance.com/agenda/2011/StefanoIacus.pdf&lt;/a&gt; -- in particular, you may find the &quot;Estimation of Financial Models&quot; part quite useful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit (2018): Today I'd also take a look at &lt;a href=&quot;https://yuima-project.com/papers/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://yuima-project.com/papers/&lt;/a&gt; and &lt;a href=&quot;https://yuima-project.com/books/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://yuima-project.com/books/&lt;/a&gt; as well as &quot;MLEMVD: A R Package for Maximum Likelihood Estimation of Multivariate Diffusion Models&quot;: &#xA;&lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2944341&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2944341&lt;/a&gt;, &lt;a href=&quot;http://past.rinfinance.com/agenda/2017/talk/MatthewDixon.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://past.rinfinance.com/agenda/2017/talk/MatthewDixon.pdf&lt;/a&gt;, &lt;a href=&quot;https://channel9.msdn.com/Events/RFinance/RFinance-2017/MLEMVD-A-R-Package-for-Maximum-Likelihood-Estimation-of-Multivariate-Diffusion-Models&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://channel9.msdn.com/Events/RFinance/RFinance-2017/MLEMVD-A-R-Package-for-Maximum-Likelihood-Estimation-of-Multivariate-Diffusion-Models&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="893" LastEditorUserId="893" LastEditDate="2018-09-01T12:11:47.913" LastActivityDate="2018-09-01T12:11:47.913" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="2958" PostTypeId="2" ParentId="2844" CreationDate="2012-02-12T18:13:51.823" Score="-2" Body="&lt;p&gt;If you assume GBM, then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Expected Change in price = Stock * Drift * change in time&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Weiner term disappears.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This implies, E[r(T)] = drift * T&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use hourly return to estimate drift and plug it in the formula.&lt;/p&gt;&#xA;" OwnerUserId="909" LastEditorUserId="909" LastEditDate="2012-02-12T21:50:58.960" LastActivityDate="2012-02-12T21:50:58.960" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="2959" PostTypeId="1" AcceptedAnswerId="2964" CreationDate="2012-02-13T02:21:31.017" Score="3" ViewCount="991" Body="&lt;p&gt;(Here is a link to the &lt;a href=&quot;https://math.stackexchange.com/questions/107879/portfolio-optimization-problem-without-correlation-info&quot;&gt;original post&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I received this interesting problem from a friend today:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume that you are a portfolio manager with $10 million to allocate to hedge funds. The due diligence team has identified the following investment opportunities (here Expected Return and Expected StdDev stand for Expected Monthly Return and Expected Standard Deviation of Monthly Return and Price = Price of each investment unit):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hedge Fund 1: Expected Return = .0101, Expected StdDev = .0212, Price = $2 million&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hedge Fund 2: Expected Return = .0069, Expected StdDev = .0057, Price = $8 million&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hedge Fund 3: Expected Return = .0096, Expected StdDev = .0241, Price = $4 million&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hedge Fund 4: Expected Return = .0080, Expected StdDev = .0316, Price = $1 million&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the optimal allocation to each hedge fund (use MATLAB)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The responses to the original post were things I had considered, but the loss of correlation among assets still seems like a big issue. Under the assumption that the assets are independent, the covariance matrix is diagonal, and using the standard constrained portfolio allocation tools in MATLAB seem to fail. Should I be choosing a specific objective function like Mike Spivey suggested in the original post while assuming independence?&lt;/p&gt;&#xA;" OwnerUserId="2046" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2012-02-13T20:16:33.897" Title="Can I perform an asset allocation optimization if assets are perfectly uncorrelated?" Tags="&lt;portfolio-management&gt;&lt;optimization&gt;&lt;asset-allocation&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2960" PostTypeId="2" ParentId="2959" CreationDate="2012-02-13T02:49:05.333" Score="1" Body="&lt;p&gt;Of course you need an objective function otherwise you would optimally allocate 100% to the fund with the highest risk adjusted returns. &lt;/p&gt;&#xA;" OwnerUserId="2047" LastActivityDate="2012-02-13T02:49:05.333" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="2962" PostTypeId="1" CreationDate="2012-02-13T04:55:02.990" Score="3" ViewCount="495" Body="&lt;p&gt;I am able to retrieve prices for IVV using this code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quantmod)&#xA;getSymbols(&quot;IVV&quot;)&#xA;names(IVV)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;[1] &quot;IVV.Open&quot;     &quot;IVV.High&quot;     &quot;IVV.Low&quot;      &quot;IVV.Close&quot;    &quot;IVV.Volume&quot;&lt;br&gt;&#xA;[6] &quot;IVV.Adjusted&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to use other libraries/sources/functions to get a price at 10am, noon, and 2pm?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without paying for full API to companies like InteractiveBrokers.&lt;/p&gt;&#xA;" OwnerUserId="1822" LastActivityDate="2012-02-13T06:16:10.253" Title="How can I get intra-day prices via API into R?" Tags="&lt;r&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2963" PostTypeId="2" ParentId="2962" CreationDate="2012-02-13T06:16:10.253" Score="3" Body="&lt;p&gt;You dont pay anything for IB's API (they charge some for Fix through). It is a very simple and straightforward way to pull IVV through the IB API, either IVs directly (I dont recommend it because you inherently accept IB's dividend curves, model, what have you...). Better yet, pull in the prices of the options under consideration and back out the IV. You need a pricing model anyway otherwise why would you want to use IV and what for? However, IB's API only provides lookbacks of intra day data for a limited time frame, so if you need longer histories then you may need to look elsewhere. However, if you are purely interested in real-time data then IB is a fantastic source given you do not trade UHF models. &lt;/p&gt;&#xA;" OwnerUserId="2047" LastActivityDate="2012-02-13T06:16:10.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2964" PostTypeId="2" ParentId="2959" CreationDate="2012-02-13T08:35:47.873" Score="1" Body="&lt;p&gt;There is nothing wrong in using Mean-Variance with a collection of assets that would be uncorrelated (which is almost impossible by the way). The algorithm should converge.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mean-Variance optimization basically aims to take advantage of diversification, which is, trivially, impossible where asset are perfectly uncorrelated, so you won't get amazing results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to use MATLAB, I'd suggest you use &lt;a href=&quot;http://www.mathworks.ch/help/toolbox/finance/frontcon.html&quot; rel=&quot;nofollow&quot;&gt;frontcon&lt;/a&gt; which should enable you to compute an efficient frontier with your data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that your setup requires you to implement constraints, as you would like to spend the totality of the available 10M, but certain assets are available for a limited amount. You can define the constraints as follows, expressing them as a percentage of the total value of the portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbf{w}=(w_1,w_2,w_3,w_4)&amp;#39; \quad \text{and} \quad I_4 \mathbf{w} \leq (0.2,0.8,0.4,0.1)&amp;#39;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$w_i \geq 0 \quad \forall i$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since MV would not produce nice results (not well diversified), you could look at &lt;a href=&quot;http://www.thierry-roncalli.com/download/erc.pdf&quot; rel=&quot;nofollow&quot;&gt;equal risk contribution&lt;/a&gt; algorithms which would allow you to spread the risk over all your available assets. I understand it is commonly use in Hedge Fund allocation.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2012-02-13T10:01:02.187" LastActivityDate="2012-02-13T10:01:02.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2965" PostTypeId="2" ParentId="2949" CreationDate="2012-02-13T19:40:07.397" Score="3" Body="&lt;p&gt;They'll be correlated, and generally close to one another, but rarely identical.  In fact differences of 2 points in implied vol are common. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason for the differences comes down to the portfolio construction and tracking error of the SPY ETF.  While generally quite low over a long period of time, the tracking error on a 1-day or less basis can be noticeable.  Even though SPY is designed to track SPX, you can look at the SPY prospectus to see that the weights are slightly different. &#xA;(They don't say it explicitly, but they're most likely not trading all 500 stocks).  This is another source of differences in implied vol.&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2012-02-13T19:40:07.397" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2966" PostTypeId="2" ParentId="2959" CreationDate="2012-02-13T20:16:33.897" Score="2" Body="&lt;p&gt;There's no problem at all using mean-variance optimization when correlations are zero.  Any Quadratic Program solver will give you optimal weights.  The problem is that the optimal weight a QP will give you will not, in general, result in dollar allocations that are integer multiples of the Price.  To enforce that constraint, you could look into Integer Program solvers, which are designed to work with those type of constraints.  Though, given how small your problem is, it would likely be easier to just list all possible combinations of allocations (by my count, there are only a couple hundred feasible allocations), and calculate whatever criterion you use for allocation decision (Sharpe ratio?) for each possibility.&lt;/p&gt;&#xA;" OwnerUserId="2027" LastActivityDate="2012-02-13T20:16:33.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2970" PostTypeId="1" AcceptedAnswerId="2972" CreationDate="2012-02-14T11:16:54.993" Score="10" ViewCount="1349" Body="&lt;p&gt;I would like to know how Expected Shortfall $SF_\alpha$ and variance $\sigma^2$ are related.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I follow what &lt;a href=&quot;http://en.wikipedia.org/wiki/Aaron_C._Brown&quot;&gt;Aaron Brown&lt;/a&gt; answered in &lt;a href=&quot;http://www.wilmott.com/messageview.cfm?catid=4&amp;amp;threadid=4676&quot;&gt;this post&lt;/a&gt;, when the underlying distribution is Normal with standard deviation $\sigma$, then:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$VaR_\alpha=\Phi^{-1}(\alpha) \cdot \sigma$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$SF_\alpha= \frac{1}{\alpha \sqrt{2 \pi}} \exp \left( - \frac{VaR_\alpha^2}{2} \right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, if I take an $\alpha &amp;lt; 0.5$, I know that $\Phi^{-1}(\alpha) &amp;lt; 0$ and hence that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{d(VaR_\alpha)}{d \sigma} = \Phi^{-1}(\alpha) &amp;lt; 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{d(ES_\alpha)}{d \sigma} = SF_\alpha \frac{-1}{2} \Phi^{-1}(\alpha) 2 \sigma = \underbrace{SF_\alpha}_{&amp;gt;0} \underbrace{ (-1) \Phi^{-1}(\alpha)}_{&amp;gt;0} \sigma &amp;gt; 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, I know that if my volatilty grows, my shortfall will grow along with it, under the normality assumption.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I wonder if we can say the same in general.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume I have two large samples from an unknown population, and that I estimate the $ES_\alpha$ of the samples which give me values $r_1$ for sample 1 and and $r_2$ for sample 2. Assume that $s_1$ and $s_2$ are the sample standard deviations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, assume that $r_1&amp;lt;r_2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I say, looking only at the shortfall measures, that $s_1&amp;lt;s_2$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mathematically, with no prior assumptions, does  $r_1&amp;lt;r_2  \Rightarrow  s_1&amp;lt;s_2$ ? Or even $r_1&amp;lt;r_2  \Leftrightarrow  s_1&amp;lt;s_2$ (that seems unlikely)?&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2012-02-14T22:01:00.037" Title="How are Expected Shortfall and Variance related?" Tags="&lt;risk&gt;&lt;statistics&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2972" PostTypeId="2" ParentId="2970" CreationDate="2012-02-14T22:01:00.037" Score="4" Body="&lt;p&gt;Even if everything is truly normally distributed, once you are taking separate samples anything can happen.  In particular, your first sample may have gotten a small standard deviation but (by chance) a huge kurtosis, so you will have $s_1&amp;lt;s_2$ but $r_1&amp;gt;r_2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given your goal of finding an analog to the efficient frontier, you could try making your volatility dependent on weight/position sizes and forcing your sample populations to always have the same elements, just with different weights.  You should then be able to attain expected shortfall as a monotonic function of volatility.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-02-14T22:01:00.037" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2973" PostTypeId="2" ParentId="2956" CreationDate="2012-02-15T16:44:35.627" Score="2" Body="&lt;p&gt;Unfortunately it's not so straight forward.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's deal first with pricing the bonds from cash deposits:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The procedure would be to build a discount curve from the deposit rates (many different ways to do this) and then use discount factors derived from your curve to discount the bonds cash flows to get it's present value. The curve you built would need to be adjusted to take account of: term premium, credit premium (deposits more risky the govt bond) and technical factors in the cash market like 'the turn' where companies require cash at important dates for balance sheet dressing. So with all those adjustments the chance of coming up with a sensible answer is practically zero so it's best just to use the market rates of the bonds and accept them as is. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pricing a bond future from the price of the bonds in the delivery basket also requires some care. The futures price is largely determined by the repo value of the CTD (cheapest to deliver) bond from the basket. Also, due to the way the price of the delivered bond is calculated the CTD (cheapest to deliver) bond can change - this creates some optionality often referred to as the 'embedded delivery option'. This can become valuable in certain interest rate scenarios and affect the price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This book has a pretty good treatment IIRC &lt;a href=&quot;http://www.amazon.co.uk/Futures-Bond-Basis-Securities-Institute/dp/0470025891&quot; rel=&quot;nofollow&quot;&gt;The Futures Bond Basis&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it's not really practical to price a bond future from cash deposit rates. What happens in practice is that the bonds are actually priced from the futures after taking the repo rate into account.&lt;/p&gt;&#xA;" OwnerUserId="1513" LastActivityDate="2012-02-15T16:44:35.627" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2974" PostTypeId="1" CreationDate="2012-02-16T04:31:18.643" Score="4" ViewCount="651" Body="&lt;p&gt;The forward instrument vol curve is skewed to the downside (50 delta risk reversal, 25 put, 25 call) were trading several ticks to the put).&lt;br&gt;&#xA;Is there a smaller standard deviation (in price terms) to the upside vs. downside?&lt;br&gt;&#xA;How is this difference expressed in a model?&lt;/p&gt;&#xA;" OwnerUserId="2052" LastEditorUserId="1418" LastEditDate="2012-02-16T05:39:42.233" LastActivityDate="2012-02-16T05:39:42.233" Title="ATM volatility versus OTM volatility and directional standard deviation" Tags="&lt;option-pricing&gt;&lt;statistics&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2975" PostTypeId="1" AcceptedAnswerId="2991" CreationDate="2012-02-16T18:23:36.677" Score="12" ViewCount="1386" Body="&lt;p&gt;As all research on the momentum strategies are focused on the indicator, i.e. the entry point, there seems not much discussion on its expected return? Though there are some discussions on the exit rules, it still doesn't clearly quantify the expected profit in advance. Not like a mean-reversion strategy, where its expected profit is clearly pre-determined: abs(entry price - mean). This caused a problem to me in the MV optimization framework, which requires input of expected return in advance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the expected return I should use for the momentum strategy in MV optimization framework? Is there any classic reference for my question? &lt;/p&gt;&#xA;" OwnerUserId="1777" LastEditorUserId="1777" LastEditDate="2012-02-16T22:37:06.820" LastActivityDate="2013-03-14T02:28:03.207" Title="What is the expected return I should use for the momentum strategy in MV optimization framework?" Tags="&lt;quant-trading-strategies&gt;&lt;optimization&gt;&lt;expected-return&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="2977" PostTypeId="2" ParentId="2046" CreationDate="2012-02-18T04:27:34.557" Score="7" Body="&lt;p&gt;From this site's perspective, I think nothing would be better than a &lt;a href=&quot;http://machinelearning.stackexchange.com/&quot;&gt;ML.SE&lt;/a&gt;. Finally, we got one awhile ago. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; Unfortunately, Machine Learning is merging into Cross Validated. To learn more detail, click &lt;a href=&quot;http://meta.machinelearning.stackexchange.com/questions/44/the-future-of-machine-learning-as-a-stack-exchange-subject&quot;&gt;here&lt;/a&gt;.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have no idea why SE admin was rush to merge ML into CrossValidated. Not a fan of it (Orz). I personally prefer a separate site. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;FYI, &lt;a href=&quot;http://metaoptimize.com/qa/&quot; rel=&quot;nofollow&quot;&gt;http://metaoptimize.com/qa/&lt;/a&gt; is also a great Q&amp;amp;A community for ML, but I do hope we can have our own party room on SE. :)&lt;/p&gt;&#xA;" OwnerUserId="1089" LastEditorUserId="1089" LastEditDate="2012-02-21T21:40:30.777" LastActivityDate="2012-02-21T21:40:30.777" CommentCount="4" CommunityOwnedDate="2014-07-23T16:34:06.740" ContentLicense="CC BY-SA 3.0" />
  <row Id="2981" PostTypeId="1" CreationDate="2012-02-20T22:36:23.613" Score="3" ViewCount="398" Body="&lt;p&gt;How much vega in spx terms (straddle contracts) or dollar value is in 10 vix futures contacts and 10000 shares of tvix&lt;/p&gt;&#xA;" OwnerUserId="2083" LastActivityDate="2012-02-20T22:36:23.613" Title="vix futures vega per contract and tvix vega per share" Tags="&lt;vix&gt;&lt;spx&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2982" PostTypeId="1" CreationDate="2012-02-21T16:44:37.190" Score="23" ViewCount="13965" Body="&lt;p&gt;Multicurve setting has now become the new paradigm for vanilla swap valuation. For the record I give here (without getting into too much details) the methodoloy for pricing Euribor3M swaps in this setting.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Step 1-Get your discounting curve from OIS Swap Curve quotes, by standard bootstrapping method just like in the old days. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Step 2-Using Euribor3M swaps ATM quotes and the OIS discount curve of step 1, bootstrap a &quot;forward&quot; curve of discount factors that can be used to get &quot;adjusted&quot; Euribor3M forward rates such that those &quot;adjusted&quot; forwards discounted over OIS curve gives the Euribor3M ATM Swap quotes (the fixed rate cashflows are discounted with OIS Curve).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I hope I'm sufficiently clear if not let me know I will add extra explanations)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering about the corresponding setting (i.e. curve construction) for Cross Currency Swaps (CCY Swaps) products. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a setting for Cross Currency Swaps Euribor3M +Margin vs Libusd3M collateralized in USD (at Fed Fund rate) that I believe is correct. So here it is :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Step 1,2- Construct the USD curves as in Step 1 and Step 2 with Fed Fund Swap Rates and Libusd3M ATM Swaps quotes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Step 3- Then use Forward FX quotes over USD/EUR currency pair to bootstrap (together with the Fed Fund discounting curve) an $OIS^{usd}$ discount curve thank's to the spot/forward arbitrage argument where the unknowns are of course the $OIS^{usd}$  discount factors. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Step 4- Use Cross Currency ATM Swap Quotes, to build a &quot;$Euribor3M^{usd}$ adjusted&quot; curve using the 3 curves already built (with the spot Eur/USD exchange rate) so that all discounted cashflows (valued in USD) of those CCY ATM Swaps get a zero PV (in USD). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If anyone implied with CCY Swap valuation on a daily basis read this post, I would be grateful if he could confirm/infirm the relevance of this setting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best regards&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS 1 : &#xA;This is not really an option pricing question nevertheless such a setting is the basis for any Multicurve option derivative model for any Cross Curreny Interest Rate Options so it seems important to me to establish first the market practice over underlying instruments before going further.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS 2 :&#xA;You can rebuild step 1 to 4 using EUR as collateral (with EONIA rate) then you would shortly discover that ( even if all ATM instruments give the same ATM margin and rates by construction), when pricing OTM or ITM Cross currency swaps you get different Net PVs if you use one setting or the other. This does not entails arbitrage as this difference actually originate from the different collateral settings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best regards&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="92" LastEditDate="2012-02-21T20:45:49.603" LastActivityDate="2013-03-02T20:02:39.650" Title="Cross Currency Swap Pricing in nowadays environment" Tags="&lt;fx&gt;&lt;pricing&gt;&lt;swaps&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="17" ContentLicense="CC BY-SA 3.0" />
  <row Id="2983" PostTypeId="2" ParentId="1554" CreationDate="2012-02-21T23:55:22.387" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://www.fxcm.com/&quot; rel=&quot;nofollow&quot;&gt;FXCM&lt;/a&gt;'s new &lt;a href=&quot;http://www.fxcodebase.com/wiki/index.php/Download&quot; rel=&quot;nofollow&quot;&gt;ForexConnect API&lt;/a&gt; offers a C# version (in addition to C++ and Java; they also support all of Linux/Win/Mac/Android/iOS, though the C# version is Windows only, android is java-only and iOS is Objective-C/C++ only).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I find the online samples can be a mix of latest and old version code; however the SDK download contains a Samples directory with lots and lots of examples, so start there. The C++ API is very similar to the C# one. (In fact, the C# API seemed more natural than the C++ one; my guess is they started with C# and then ported it to C++.)&lt;/p&gt;&#xA;" OwnerUserId="1587" LastActivityDate="2012-02-21T23:55:22.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2988" PostTypeId="1" CreationDate="2012-02-23T22:17:06.570" Score="11" ViewCount="694" Body="&lt;p&gt;has there been any interesting work or advances on the copula-marginal algorithm (CMA) as proposed by &#xA;Attilio Meucci. I am unable to find anything on the web other then the original article, here is the &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1752702&quot;&gt;original article&lt;/a&gt; that i am referring too. I'm just curious if any one has built on his research or if this may be of any use at all&lt;/p&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="1764" LastEditDate="2012-03-02T06:06:24.610" LastActivityDate="2012-03-02T06:06:24.610" Title="copula-marginal algorithm" Tags="&lt;risk-management&gt;&lt;copula&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="2989" PostTypeId="1" CreationDate="2012-02-23T23:01:18.853" Score="12" ViewCount="872" Body="&lt;p&gt;I have been playing a quantitative investing game (instructions &lt;a href=&quot;http://www.salserver.tkk.fi/KtPeli/instructions.php&quot;&gt;here&lt;/a&gt;) that is actually quite interesting, teams have some time to decide their next moves. It requires all kind of knowledge such as spreadsheet -programming, residual -analysis, portfolion -management, allocation, XYZ -- variables and in the end the challenge is to develop the politics that maximize the utility in the game (and the utility functions change unexpectedly in the game) -- a real dynamic programming problem at the best. I feel it is quite fun and useful way to practice quantitative skills (besides extremely fast programming during sprints and good preparation drives analysis skills such as R and statistics/over-fitting/etc, besides a lot of fun-hectic time in a group).&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Can you come up with more &lt;code&gt;&quot;research labs&quot;&lt;/code&gt; (aka games) like that perhaps more realistic with historical data? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;They do not need to be like the above, they could be on a more specific segment such as speculation with inverse yield curve with historical-data-approximated values or anything like that, ideas?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I am thinking that there may be some sort of competitions in real-life on this kind of issues, are there? Experience?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I find this kind of games/challenges could be quite driving agent to teach and learn different kind of usually-low-profile quantitative issues, very well monopoly works but it is a bit too static to learn quantitative skills to analyze and synthesize information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;P.s. I am now not looking for mock &lt;code&gt;investing or financial&lt;/code&gt; games but games where you get a massive amount of data and you have some goal like in the example game, actually the massive amount of data is not essential -- just on some challenging quantitative issue.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="956" LastActivityDate="2012-09-10T12:47:48.840" Title="Quantitative Analysis Games on Investing?" Tags="&lt;education&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="2990" PostTypeId="2" ParentId="2988" CreationDate="2012-02-24T13:59:28.010" Score="6" Body="&lt;p&gt;The algorithm is certainly useful in that it is non-parametric, fast, and versatile. &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1752702&quot;&gt;Meucci&lt;/a&gt; summarizes the advantages nicely:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Unlike traditional copula techniques, CMA a) is not restricted to few&#xA;  parametric copulas such as elliptical or Archimedean; b) never&#xA;  requires the explicit computation of marginal cdf’s or quantile&#xA;  functions; c) does not assume equal probabilities for all the&#xA;  scenarios, and thus allows for advanced techniques such as importance&#xA;  sampling or entropy pooling; d) allows for arbitrary transformations&#xA;  of copulas. Furthermore, the implementation of CMA is also&#xA;  computationally very efficient in arbitrary large dimensions.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The paper was published 3Q last year so there are not many citations yet. Hard to see what features are lacking -- if anything, the algorithm corrects for the weaknesses of parametric copulas and offers far more versatility for stress-testing and mixing arbitrary copulas and marginals.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-02-24T14:05:07.850" LastActivityDate="2012-02-24T14:05:07.850" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2991" PostTypeId="2" ParentId="2975" CreationDate="2012-02-24T18:10:35.583" Score="5" Body="&lt;p&gt;If you don’t have any specific model which describes the behavior of the asset being traded, you can estimate the empirical distribution of returns by backtesting your momentum strategy. Then you can adjust this estimate during your strategy’s lifetime from your trading results. Additionally you can enhance this by accounting for different market regimes (e.g. “risk on/risk off”, volatility regime) or incorporate other external factors which influence the returns on your strategy (e.g. state of economy). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you assume a model for the traded assets and your strategy exploits some properties of that model (e.g. autocorrelation), you can try to come up with a closed-form expression for the expectation of returns. In case the analytical solution is not feasible, you can use Monte-Carlo to approximate the expected value.&lt;/p&gt;&#xA;" OwnerUserId="370" LastActivityDate="2012-02-24T18:10:35.583" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2993" PostTypeId="1" AcceptedAnswerId="3033" CreationDate="2012-02-26T01:59:43.177" Score="11" ViewCount="12341" Body="&lt;p&gt;I don't know if this is the right forum in which to ask this question, but here goes. I'm working through Luenberger's Investment Science. The form of CAPM model given in the book is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\bar{r}_i - r_f = \beta_i (\bar{r}_M - r_f)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It says that if your asset has a $\beta$ of zero, then $\bar{r}_i = r_f$. The book says that &quot;The reason for this [$\bar{r}_i = r_f$] is that the risk associated with an asset that is uncorrelated with the market can be diversified away. If we had many such assets, each uncorrelated with the others and with the market, we could purchase small amounts of them, and the resulting total variance would be small.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I agree with Luenberger's statement, but what bothers me is the part &quot;if we had many such assets&quot;. If we don't, $\bar{r}_i = r_f$ still holds! What would be the explanation then? Is there some theory behind CAPM that would say a statement like the following: &quot;if there exists one asset $i$ with $\beta_i = 0$, then there exist infinitely many assets with $\beta = 0$, that are uncorrelated with each other&quot;. This is a strong and sort of ridiculous statement, but it would imply the description quoted from Luenberger - I could make a portfolio with such assets whose variance approaches zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help wrapping my head around this concept would be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="2103" LastEditorUserId="2103" LastEditDate="2012-03-10T16:37:55.050" LastActivityDate="2016-05-22T14:23:50.527" Title="CAPM - Beta of zero and its implications on diversification" Tags="&lt;capm&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="2994" PostTypeId="1" AcceptedAnswerId="2996" CreationDate="2012-02-26T03:27:28.397" Score="9" ViewCount="432" Body="&lt;p&gt;I wanted to see how the stock price and volume relationship is locally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I tried ranking both the daily return (at day t) and volume (at day t) base on a 30 day rolling window with historical daily stock data and plotted the distribution as shown in the below figure (top).  The ranking is based on sorting values in ascending order, and as you can see, when volume is locally high the price return is either locally low or high.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have also plotted the distribution of ranking of the next day return (at day t+1) &#xA;and volume (at day t) to see if this &quot;shape&quot; remains, as shown in the figure (bottom), and it does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://lh3.googleusercontent.com/-SqCFFBaeMM8/T0mgb752K1I/AAAAAAAAHrk/kp9CjBnpXoU/s640/priceVolume.jpg&quot; alt=&quot;Figure&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone explain why this shape still remains for day t+1? This kind of price volume relationship must have been researched extensively... is there some classic papers that you  quant experts would recommend?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks. A screen shot of the code is provided &lt;a href=&quot;https://lh4.googleusercontent.com/-erXcDY4akJU/T0mkHnAcf2I/AAAAAAAAHrs/nfSvrQl-qvY/s800/priceVolumeCode.jpg&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1381" LastEditorUserId="1381" LastEditDate="2012-02-26T13:42:10.300" LastActivityDate="2012-02-29T00:18:03.547" Title="local price return and volume relationship" Tags="&lt;volume&gt;&lt;return&gt;&lt;price&gt;&lt;relationship&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="2996" PostTypeId="2" ParentId="2994" CreationDate="2012-02-26T19:57:50.010" Score="3" Body="&lt;p&gt;When volatility is high, daily volume is high. And when volatility is high, daily returns are high. That's why when volume is high, the price returns are high.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Volatility (like volumes) is autocorrelated. This is the phenomenon of volatility clustering (large changes tend to be followed by large changes, of either sign) and volume clustering (large volumes tend to be followed by large volumes).&#xA;It explains why when return is high (in absolute value) at day t it's likely to remain high (in absolute value) for day t+1. But of course it doesn't give you the sign of the return...&lt;/p&gt;&#xA;" OwnerUserId="1941" LastEditorUserId="1941" LastEditDate="2012-02-28T07:33:08.580" LastActivityDate="2012-02-28T07:33:08.580" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2997" PostTypeId="1" CreationDate="2012-02-26T22:16:55.647" Score="4" ViewCount="740" Body="&lt;p&gt;This is my first question in this forum. I am stuck with my current testing the Ho Lee model. I am having difficulty computing the perturbation factor $\Delta$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The ho lee model should be completely determined by the initial term structure $B(0,1),B(0,2),...$ its risk neutral probability of an up jump $p$ (which is independent of time and should be the same at each node through out the tree), and the perturbation factor $\Delta=\frac{h(1;u)}{h(1;d)}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I am given the task of knowing the initial term structure $B(0,1),B(0,2),...$,  $p$ and short rates $r(0)$ and $r(1;u)$, and have to compute the perturbation factor delta instead. Any help is much appreciated.&lt;/p&gt;&#xA;" OwnerUserId="1882" LastEditorUserId="848" LastEditDate="2012-02-27T15:08:32.227" LastActivityDate="2012-03-05T16:38:18.700" Title="Discrete time Ho lee model" Tags="&lt;fixed-income&gt;&lt;modeling&gt;&lt;risk-models&gt;&lt;delta-neutral&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="2998" PostTypeId="1" CreationDate="2012-02-27T06:36:36.310" Score="2" ViewCount="136" Body="&lt;p&gt;I am trying to evaluate weight of stocks in portfolio for an investor. For this purpose &#xA;I use SEC13F filings for particular quarters and historical prices from Yahoo. There are stocks in portfolio which have zero volume from time to time.  Is it correct to use price when volume is zero? Should I just ignore these stocks? &lt;/p&gt;&#xA;" OwnerUserId="2106" LastActivityDate="2012-02-27T06:36:36.310" Title="Calculating stock weight for SEC13F filers" Tags="&lt;portfolio&gt;&lt;price&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="2999" PostTypeId="1" AcceptedAnswerId="3044" CreationDate="2012-02-28T14:13:02.800" Score="3" ViewCount="339" Body="&lt;p&gt;Background: For a dissertation I have a multi-agent stock market model that I am using to assess different mechanisms for producing particular dynamic regimes. A key point is assessing how closely it reflects the real world, this will be done by comparing it with historical price data of 5 large-caps in 5 different sectorsn where the model simulates trading for 1 month.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to be able to say &quot;this is x% accurate/good&quot; etc. I hope to do this using a measure of volatility (&quot;the standard deviation of the instrument's yearly logarithmic returns.&quot;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is what should the function I use consist of? I believe an 'excellent' model produces prices that are no more or less volatile than the stock is, but they shouldn't go in opposite directions to the 'real' prices. So clearly the model needs to produce prices that are in line with the actual prices, with it expected to have greater deviations 30 days into the simulation compared to 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I believe the function for the 'fitness' of the model needs to use volatility and an exponential average or somesuch? How best do I combine these two... or perhaps there are better ways of doing this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help most appreciated!&lt;/p&gt;&#xA;" OwnerUserId="2110" LastActivityDate="2012-03-08T23:54:55.947" Title="How to use volatility to assess the accuracy of a stock market model?" Tags="&lt;volatility&gt;&lt;modeling&gt;&lt;moving-average&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3000" PostTypeId="1" CreationDate="2012-02-28T15:03:47.537" Score="-4" ViewCount="19175" Body="&lt;p&gt;I have daily log return from 01.01.2011 to 10.28.2011 and I'd like to compare the total return of that 10 months period (which is of -7.093%) to annual log returns of previous years.&#xA;I know it's really a simple question but I want to be sure not to make any mistake.&#xA;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="2111" LastActivityDate="2012-02-28T16:46:21.073" Title="How to annualize log returns?" Tags="&lt;finance&gt;&lt;returns&gt;" AnswerCount="1" CommentCount="2" ClosedDate="2012-02-28T17:39:53.707" ContentLicense="CC BY-SA 3.0" />
  <row Id="3001" PostTypeId="2" ParentId="3000" CreationDate="2012-02-28T16:46:21.073" Score="5" Body="&lt;p&gt;Log returns are additive. Just add the daily returns together. If you only have one average daily return you annualize simply by multiplying with an annualization factor. Often 252 is used but it depends on your specific use case. In your case you may want to multiply by (days per year / days in 10 months period)&#xA;Make sure you do not apply the same to volatility. Volatility scales with the square root of time. If you want to know why then Google for properties of Brownian motion. &lt;/p&gt;&#xA;" OwnerUserId="2047" LastActivityDate="2012-02-28T16:46:21.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3003" PostTypeId="2" ParentId="2994" CreationDate="2012-02-29T00:18:03.547" Score="2" Body="&lt;p&gt;The technical analysis point of view: an increase in volume (assuming the price has been in a downtrend) means the &lt;em&gt;crowd&lt;/em&gt; are throwing in the towel, i.e. everyone is dumping the stock and assuming that hoped-for rise is now never going to happen. The same on the way up: everyone jumps on the bandwagon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, high volume typically means crowd psychology dominated. And that takes time to work its way out. Out of a given crowd population, people who missed it at &lt;code&gt;t&lt;/code&gt;, will try and get in/out at &lt;code&gt;t+1&lt;/code&gt;, and those still left will get in/out at &lt;code&gt;t+2&lt;/code&gt;, etc. until the crowd is exhausted.&lt;/p&gt;&#xA;" OwnerUserId="1587" LastActivityDate="2012-02-29T00:18:03.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3005" PostTypeId="1" CreationDate="2012-02-29T08:20:56.377" Score="11" ViewCount="9304" Body="&lt;p&gt;My intuition says that both approaches, discrete time models and continuous time models will be &lt;em&gt;models&lt;/em&gt; (i.e. approximations) of reality. Therefore it should be possible to develop useful models in both domains. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Continuous time models&lt;/em&gt; have more mathematical elegance and can therefore probably bring more mathematical machinery to bear on the problem which presumably helps with deriving analytical solutions and asymptotic limits. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Discrete models&lt;/em&gt; more easily correspond to observed data and measurements and are easier to simulate on computers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been told that it is possible to discretise continuous time models and vice-versa but care has to be taken when performing this transformation. Could you please highlight what the common pitfalls are, in particular when modelling asset prices? If there are other differences in the dynamics between the two approaches (for example possibly something like non-linearities, chaos, ... in one and not the other) then I would like to know about that as well.&lt;/p&gt;&#xA;" OwnerUserId="142" LastActivityDate="2015-10-25T10:27:06.867" Title="What are the main differences between discrete and continuous time models when modeling asset price dynamics?" Tags="&lt;modeling&gt;&lt;asset-pricing&gt;&lt;continuous-time&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3006" PostTypeId="2" ParentId="3005" CreationDate="2012-02-29T09:15:36.527" Score="5" Body="&lt;p&gt;I mainly speak as market practitioner when I say that I believe in the end all models that are applied to data and real life pricing issues are discretized. Think about it, even the BS hedge argument is in the end just a &quot;theoretical continuous time overlay&quot; of actual discrete time steps and re-hedges. Thus some of the limiting assumptions re BS. You do not have continuous prices, even if ticks come in millisecond frequency they are still discretely timed. Thus you cannot hedge continuously but only re-hedge when you receive new price discovery. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Continuous pricing models are elegant to work with from a mathematical standpoint. However, in the end whatever derivative or mortgage security you attempt to price you must resort to discretized version of pricing algorithms. Thats my take of it. I would not waste too much time on trying to figure out how to move from one version to the other. I rather recommend you think about the problem at hand and what you actually want to solve for. From my experience 90% of pricing complexities boil down to finding a replication of the to-be-price asset in question. Monte Carlo simulators have become my best friend because their applicability is so versatile.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-02-29T09:15:36.527" CommentCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="3009" PostTypeId="1" AcceptedAnswerId="3017" CreationDate="2012-02-29T19:21:41.737" Score="7" ViewCount="1905" Body="&lt;p&gt;If I have calculated the sample mean, variance, skew and kurtosis of a set of data, how would I go about fitting a probability distribution to match these moments (i.e. choosing a probability distribution and optimizing its parameters to fit the sample moments). Are there any packages in R/MATLAB/etc. that are capable of this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For context, I believe I can calculate these moments for a portfolio's return distribution, but I actually need a whole probability density function for the portfolio's returns in order to perform additional analysis.&lt;/p&gt;&#xA;" OwnerUserId="2118" LastActivityDate="2012-03-02T02:42:29.923" Title="How to fit probability density function from sample moments?" Tags="&lt;statistics&gt;&lt;probability&gt;&lt;portfolio&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3010" PostTypeId="1" AcceptedAnswerId="3013" CreationDate="2012-02-29T19:54:21.290" Score="9" ViewCount="436" Body="&lt;p&gt;I want to know the joint dynamics of a stock and it's option for a finite number of moments between now and $T$ the expiration date of the option for a number of possible paths. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $r_{\mathrm{s}}$ and $r_{\mathrm{o}}$ denote the return on the stock and the option. Then I'm interested in knowing $\mathrm{E}_t([r_{\mathrm{s}}; r_{\mathrm{o}}])$ the expectation of the return from $t$ to $t+1$ and $\mathrm{Var}_t(r_{\mathrm{s}}, r_{\mathrm{o}})$ the variance from $t$ to $t+1$. The expected return and volatility of the stock are known.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first idea is to use Monte Carlo with the following pseudocode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;N &amp;lt;- number of paths&#xA;T &amp;lt;- number of moments&#xA;M &amp;lt;- number of subpaths&#xA;S &amp;lt;- current stock price&#xA;for i = 1 to N:&#xA;    S_0 &amp;lt;- S&#xA;    for t = 0 to T-1:&#xA;        for j = 1 to M:&#xA;            S_{t+1,j} = f(S_t)&#xA;            O_{t+1,j} = BSM(S_{t,j})&#xA;        S_{t+1} &amp;lt;- mean(S_{t+1,j})&#xA;        E_{i,j} &amp;lt;- mean(S_{t+1,j}, O_{t+1,j})&#xA;        V_{i,j} &amp;lt;- var(S_{t+1,j}, O_{t+1,j})&#xA;return (E, V)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where $S_t$ is the current stock price, $f(S_t)$ gives a realization of stock price at the next moment given the current stock price, let's assume geometric Brownian Motion, $\textrm{BSM}(S_t)$ gives the option price given the current stock price and some arbitrary parameters using the BSM formula and &lt;code&gt;E&lt;/code&gt; and &lt;code&gt;V&lt;/code&gt; the values I'm interested in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can probably be optimized by a number of clever ideas such as reusing the draws from the probability distribution and discretizing the state space and use a memoized BSM. This is, however, not what I'm looking for. I rather calculate the mean and variance directly, the question is: how?&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="848" LastEditDate="2012-02-29T20:49:30.223" LastActivityDate="2012-03-05T14:57:56.483" Title="Simulating the joint dynamics of a stock and an option" Tags="&lt;black-scholes&gt;&lt;monte-carlo&gt;&lt;probability&gt;&lt;joint-probability&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3011" PostTypeId="2" ParentId="3009" CreationDate="2012-02-29T20:06:45.223" Score="4" Body="&lt;p&gt;You should be able to do this with the &lt;code&gt;fitdistr&lt;/code&gt; function in the MASS package.  You will certainly be able to hold the mean and variance constant, but I'm less sure about skewness and kurtosis (they would need to be arguments to the density function).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://cran.r-project.org/web/packages/actuar/index.html&quot; rel=&quot;nofollow&quot;&gt;actuar&lt;/a&gt; package may also be useful, as it contains additional density functions.&lt;/p&gt;&#xA;" OwnerUserId="56" LastActivityDate="2012-02-29T20:06:45.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3012" PostTypeId="1" AcceptedAnswerId="3055" CreationDate="2012-02-29T22:28:46.793" Score="12" ViewCount="586" Body="&lt;p&gt;Brealey &amp;amp; Myers provide a certainty-equivalent version of the present value rule, using CAPM, as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$PV_0=\frac{C_1 - \lambda_m *cov(C_1, r_m)}{1 + r_f}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$PV_0$ - Present Value of cash flow 1 at time 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\lambda_m$ - Market price of risk = $\frac{r_m-r_f}{\sigma_m^2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$cov(C_1, r_m)$ - Covariance of the cash flow at time 1 with the return on the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to create an n-factor version of this same model. However, using Fama French 3-factor model as an example, the following doesn't seem to work on a toy example I've set up:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$PV_0=\frac{C_1 - \lambda_m *cov(C_1, r_m)- \lambda_{smb} *cov(C_1, r_{smb})- \lambda_{hml} *cov(C_1, r_{hml})}{1 + r_f}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\lambda_m$ = $\frac{r_m-r_f}{\sigma_m^2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\lambda_{smb}$ = $\frac{r_s-r_b}{\sigma_{smb}^2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\lambda_{hml}$ = $\frac{r_h-r_l}{\sigma_{hml}^2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question: what am I doing wrong? Is there some way I need to adjust for the covariance amongst the factors?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;===Update===&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In checking my toy example again, I realized that I might in fact have the right formula above. So points/checkmarks to anyone who can either prove the above right or wrong or provide a citation to the more general form:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$PV_0=\frac{C_1 - \displaystyle\sum_{i=1}^n\lambda_i *cov(C_1, r_i)}{1 + r_f}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for orthogonal risk factors $i_1,i_2,\dotsc,i_n$.&lt;/p&gt;&#xA;" OwnerUserId="2119" LastEditorUserId="2119" LastEditDate="2012-03-06T16:08:18.103" LastActivityDate="2018-06-26T13:36:07.110" Title="Creating an n-factor Certainty Equivalent Discounting Formula" Tags="&lt;valuation&gt;&lt;risk-premium&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3013" PostTypeId="2" ParentId="3010" CreationDate="2012-02-29T23:05:42.893" Score="8" Body="&lt;p&gt;In this scenario, the &quot;joint dynamics&quot; are trivially computed since the option value is a known deterministic function of stock price.  For example, the mean of the option value for time $\tau$ is&#xA;$$&#xD;&#xA;\mu_O = \int_0^\infty BSM( S_\tau ) p(S_\tau) dS_\tau&#xD;&#xA;$$&#xA;which is best computed using &lt;a href=&quot;http://mathworld.wolfram.com/LobattoQuadrature.html&quot; rel=&quot;nofollow&quot;&gt;quadrature&lt;/a&gt; as available in standard numerical libraries like &lt;a href=&quot;http://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.quadrature.html&quot; rel=&quot;nofollow&quot;&gt;scipy&lt;/a&gt;.  The function $p(S_\tau)$ would typically be the Black-Scholes probability density&#xA;$$&#xD;&#xA;  \frac{n( d_2(S_0,S_\tau) )}  {S_\tau  \sigma \sqrt{\tau} }.&#xD;&#xA;$$&#xA;with $S_\tau$ taking the place of strike $K$ in the formula for $d_2()$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, the variance of the option value for time $\tau$ is&#xA;$$&#xD;&#xA;\int_0^\infty (BSM( S_\tau ) - \mu_O)^2 p(S_\tau) dS_\tau&#xD;&#xA;$$&#xA;and covariance of option value with stock price would be&#xA;$$&#xD;&#xA;\int_0^\infty (BSM( S_\tau ) - \mu_O)(S_\tau-\mu_S) p(S_\tau) dS_\tau.&#xD;&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2012-03-05T14:57:56.483" LastActivityDate="2012-03-05T14:57:56.483" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3014" PostTypeId="1" CreationDate="2012-03-01T00:36:18.950" Score="2" ViewCount="612" Body="&lt;p&gt;Suppose you backtest the EUR/USD (or GBP/USD) forex pair with this system on the 1min timeframe:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Enter the market at any time n: go long if the &quot;future&quot; bar n+1 has a higher close as the close than bar n; go short otherwise&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Place a stop loss of 50 pips and a take profit target of 25 pips&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly, with this &quot;cheating&quot; system you get good results. Now assume you restrict the distance on the closes of bar n and n+1 to the interval [0 0.0002]. In this case you also get good results but clearly not as good as in the first case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the real world, if you could filter to take only trades where next bar is in the direction of your entry you would be the richest man in the world.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is, if there is a reasonable strategy what to do about the &quot;bad&quot; trades, where the next bar is in the opposite direction of your entry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tested this with the same system as above but this time the system only trades those &quot;bad&quot; trades so that the trade is in a loosing position right after the first bar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly, this system ends up as a loosing system. I wondered if it is possible to &quot;optimize&quot; those bad trades with a higher stop of 100 pips and a higher take profit of 10 pips.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To my surprise all attempts on the SL and TP parameters failed, there was no improvement on whatever settings.&#xA;All I could achieve was that the loosing range of this system was somehow less choppy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If only the very first bar after your entry bar goes in the wrong direction, there is nothing you can do about it(at least with my dumb backtesting). Why is this?&#xA;You cannot decrease/increase the SL; you cannot decrease/increase the TP.&#xA;Does this mean that one can see bad trades right after the first bar, even if your SL is still far away from it?&lt;/p&gt;&#xA;" OwnerUserId="2042" LastEditorUserId="1418" LastEditDate="2012-03-01T17:25:02.540" LastActivityDate="2012-04-10T09:21:35.283" Title="One bar look-ahead backtesting" Tags="&lt;backtesting&gt;&lt;fx&gt;&lt;trading-systems&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3015" PostTypeId="2" ParentId="3009" CreationDate="2012-03-01T03:16:41.680" Score="2" Body="&lt;p&gt;If you have a formula giving you the moments&#xA;as a function of the parameters of the distribution,&#xA;you can use &lt;code&gt;gmm&lt;/code&gt;, in the &lt;code&gt;gmm&lt;/code&gt; package:&#xA;there is a detailed example for the Gaussian distribution &#xA;in the documentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Of course, in this case, you are only solving a system of equations,&#xA;and could probably do it by hand:&#xA;the generalized method of moments (GMM) is typically used when&#xA;there are more moments than parameters.)&lt;/p&gt;&#xA;" OwnerUserId="1917" LastEditorUserId="1917" LastEditDate="2012-03-01T14:27:19.680" LastActivityDate="2012-03-01T14:27:19.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3016" PostTypeId="2" ParentId="3014" CreationDate="2012-03-01T05:46:53.653" Score="2" Body="&lt;p&gt;To be honest I dont fully comprehend your question. Not sure what you try to achieve. You should however not occupy yourself with questions that imply the impossible -&gt; looking ahead. You stand at time t and must make a decision to trade or not to trade and if you trade then in what direction, how much notional, what kind of stops/targets. You can adjust your stop losses and targets at any time after the trade. If you believe the next bar's result is a strong predictor of the total outcome of the trade then you may use that kind of information. But notice that you may not necessarily optimize for performance by exiting after the next bar in case you determined that an adverse move by the end of the next bar means that you will guaranteed end up with a loss (given that would be the result of your analysis). What if there was an unexpected spike between t and t+1? You may exit at the worst point, maximizing your loss as a result. Trading is all about expectancy. If you start to think in terms of probabilities, and test with such framework in mind then you will eventually find an algorithm that will give you positive expectancy. This will be your starting point. From there it's gonna be a rocky road ahead of you before you can run a successful algorithmic trading strategy. Are you sure you are prepared to go down that road? Hope this helped a little. I tried to word in in laymen's terms as I sensed you are pretty much a beginner in this game. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-03-01T05:46:53.653" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3017" PostTypeId="2" ParentId="3009" CreationDate="2012-03-01T21:38:22.980" Score="2" Body="&lt;p&gt;I asked an almost identical question on the Cross Validated site &lt;a href=&quot;https://stats.stackexchange.com/questions/9610/closed-form-formula-for-distribution-function-including-skewness-and-kurtosis&quot;&gt;here&lt;/a&gt;. I think my accepted answer, given by Whuber, might be what you are looking for.&lt;/p&gt;&#xA;" OwnerUserId="252" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2012-03-01T21:38:22.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3018" PostTypeId="2" ParentId="3009" CreationDate="2012-03-01T22:33:19.347" Score="2" Body="&lt;p&gt;Often, we are interested to check if our data is close to normal, then you can use the &lt;a href=&quot;http://en.wikipedia.org/wiki/Jarque%E2%80%93Bera_test&quot; rel=&quot;nofollow&quot;&gt;Jarque-Bera test&lt;/a&gt;, where skewness and kurthosis are directly deployed. Look up &lt;a href=&quot;http://www.mathworks.de/help/toolbox/stats/jbtest.html&quot; rel=&quot;nofollow&quot;&gt;Matlab implementation&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are not constrained to use the moments, you can calculate histogram and use &lt;a href=&quot;http://en.wikipedia.org/wiki/Kolmogorov%E2%80%93Smirnov_test&quot; rel=&quot;nofollow&quot;&gt;Komogorov-Smirnov test&lt;/a&gt;, which can test similarity to any distribution, not necessarily normal. Look up &lt;a href=&quot;http://www.mathworks.de/help/toolbox/stats/kstest.html&quot; rel=&quot;nofollow&quot;&gt;Matlab implementation&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1969" LastActivityDate="2012-03-01T22:33:19.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3019" PostTypeId="2" ParentId="3009" CreationDate="2012-03-02T02:42:29.923" Score="1" Body="&lt;p&gt;It may never have been done, but it seems to me that the Cornish-Fisher&#xA;expansion for moments up to 4 could be used to trace a density function&#xA;from a tabulation of the percentiles of the normal distribution, for&#xA;instance:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;w_{\alpha}\cong z_{\alpha}+\frac{1}{6}\left(z_{\alpha}^{2}-1\right)AS+\frac{1}{24}\left(z_{\alpha}^{3}-3z_{\alpha}\right)EKUR-\frac{1}{36}\left(2z_{\alpha}^{3}-5z_{\alpha}\right)AS^{2}&#xD;&#xA;$$&#xA;where $w_{\alpha}$ is the revised percentile, $z_{\alpha}$ is the&#xA;percentile for the standard normal distribution, AS is the skewness&#xA;coefficient and EKUR is the excess kurtosis coefficient (from a kurtosis&#xA;coefficient of 3 for a normal distribution).&lt;/p&gt;&#xA;" OwnerUserId="1903" LastActivityDate="2012-03-02T02:42:29.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3020" PostTypeId="1" CreationDate="2012-03-02T15:07:37.263" Score="6" ViewCount="976" Body="&lt;p&gt;My question is about the CBOE published index VIX and SKEW.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To start with, I consider working on the variance dynamics. I calibrate the market data (such as VIX and VIX futures) into the Heston model. After that it's not hard to derive the dynamics of VIX. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But how about SKEW, how could I relate the Heston Model to it? Or I shall employ further stochastic models for the higher moments of the underlying log return?&lt;/p&gt;&#xA;" OwnerUserId="2125" LastEditorUserId="848" LastEditDate="2012-03-02T21:06:15.150" LastActivityDate="2012-07-26T18:28:34.503" Title="SKEW and VIX relations?" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;stochastic-volatility&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3021" PostTypeId="2" ParentId="925" CreationDate="2012-03-03T08:48:30.450" Score="2" Body="&lt;p&gt;In trading, vanna relates to how much you are exposed to &lt;strong&gt;conditional, downside&lt;/strong&gt; insurance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It generally generates a good theta, as smile generally makes downside volatility higher than upside&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of PL attribution, beside this additional theta (which comes with 0 gamma !), you would be sensitive to smile change&lt;/p&gt;&#xA;" OwnerUserId="172" LastEditorUserId="172" LastEditDate="2012-03-07T14:31:16.957" LastActivityDate="2012-03-07T14:31:16.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3022" PostTypeId="1" AcceptedAnswerId="3026" CreationDate="2012-03-03T20:41:54.197" Score="6" ViewCount="2655" Body="&lt;p&gt;I am trying to calculate the implied volatility of an underlying given observed prices of call and puts. There are two scenarios:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The ATM strike is pinned by the market (i.e. underlying level == strike price)&lt;/li&gt;&#xA;&lt;li&gt;The price of the underlying lies between two strikes&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I have the following questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;How to combine the implied vols for same strike calls and puts&lt;/li&gt;&#xA;&lt;li&gt;How to interpolate between iVols for two strikes&lt;/li&gt;&#xA;&lt;li&gt;How to interpolate between iVols for calls and puts accross two strikes (Combination of 1 and 2 above) &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; For the sake of simplicity, I'll assume that the options are European style, and I am using the BSM to backout the ivols.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[[Edit]]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have changed the title to reflect the fact that it is a SINGLE (i.e. composite) value that I want to determine from the set of previously calculated IVols. Put simply, I want to know what is the most appropriate weighting scheme to apply, given the scenarios described above.&lt;/p&gt;&#xA;" OwnerUserId="1733" LastEditorUserId="1733" LastEditDate="2012-03-04T14:26:06.160" LastActivityDate="2012-03-04T14:26:06.160" Title="How to calculate COMPOSITE underlying implied volatility from ATM (near month) option prices?" Tags="&lt;options&gt;&lt;implied-volatility&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3023" PostTypeId="2" ParentId="1489" CreationDate="2012-03-04T05:28:44.927" Score="2" Body="&lt;p&gt;Without using any tricks or optimization, I wrote some C++ code that prices an American option with 5 different variations of the binomial method, including CRR.  It calculates all five prices and prints them on the console seemingly instantly (far less than 1 second; I didn't measure).  I would say if your computation is taking long time, the problem is the implementation, not the algorithm.    &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recommendation: get something coded specific to your needs.  This is high-level form of optimization.  For example, if you are usually working in a given time frame to expiration, you can experiment to find out the number of branchings needed to get your target precision.  Or, you might use a lower target precision on the full set of contracts, then &quot;zoom&quot; to a higher precision for contracts of interests.  &lt;/p&gt;&#xA;" OwnerUserId="47" LastEditorUserId="47" LastEditDate="2012-03-04T05:45:27.777" LastActivityDate="2012-03-04T05:45:27.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3024" PostTypeId="1" CreationDate="2012-03-04T09:09:41.117" Score="15" ViewCount="2374" Body="&lt;p&gt;Basically, I'm looking for a system which have trading(in a demo account), book keeping, profit/loss and risk calculation capability across different asset classes such as bond, repo, equity, foreign exchange, derivatives etc.&lt;/p&gt;&#xA;" OwnerUserId="2129" LastEditorUserId="467" LastEditDate="2012-06-10T17:44:08.327" LastActivityDate="2012-06-10T17:44:08.327" Title="Is there an open source alternative to Reuters Kondor+?" Tags="&lt;trading-systems&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="3025" PostTypeId="2" ParentId="3022" CreationDate="2012-03-04T09:23:25.627" Score="3" Body="&lt;p&gt;First, this question is barely on-topic because it's a very common topic and you can find the answer in basically any derivatives book.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the interpolation part is interesting so I'll give it a shot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all, what you are actually trying to compute is called the &lt;a href=&quot;http://en.wikipedia.org/wiki/Volatility_smile&quot; rel=&quot;nofollow noreferrer&quot;&gt;Volatility Smile&lt;/a&gt;. It is basically a graph which shows the implied volatility of an option vs its strike price. So you get 1 smile for the calls, and 1 smile for the puts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To compute the volatility, you basically have to run an algorithm which finds what $\sigma$ would have to be in order to get your pricing formula to give you the result which is provided by the market. For your setup,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma_i=\underset{\sigma}{\arg\min} \quad (\text{BS}(\sigma,\theta)- \hat{c})^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\hat{c}$ is the market price for the option with parameters $\theta=(K,S,T)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Kio6R.gif&quot; alt=&quot;The two volatility smiles&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not think you should interpolate between the values obtained from the puts and the values obtained from the calls.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Between the nodes, you can use a Gaussian Kernel with a &lt;a href=&quot;http://en.wikipedia.org/wiki/Kernel_density_estimation&quot; rel=&quot;nofollow noreferrer&quot;&gt;Kernel density estimation&lt;/a&gt;, I think it's quite an elegant way to get you complete line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, note that the fact that the smile are not equal for puts and calls, and that the graph are &quot;smiles&quot; and not &quot;straight lines&quot; demonstrate that the assumptions of the BS model are not supported by the market.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2012-03-04T09:23:25.627" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3026" PostTypeId="2" ParentId="3022" CreationDate="2012-03-04T12:11:15.850" Score="0" Body="&lt;p&gt;The more I think about this question, the more obvious it becomes to me (from a traders point of view) that both 'intra strike' and 'inter strike' averaging should be done by weighting by open interest - as this (open interest) is a measure of (putting it crudely), people &quot;putting their money where their mouth is&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unless there is a fundamental reason that makes sense from a practioners point of view, this is the way I will proceed. I find that sometimes the mathematics becomes too far removed from what actually happens in the markets.&lt;/p&gt;&#xA;" OwnerUserId="1733" LastActivityDate="2012-03-04T12:11:15.850" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3027" PostTypeId="1" AcceptedAnswerId="3028" CreationDate="2012-03-04T12:59:29.950" Score="6" ViewCount="1665" Body="&lt;p&gt;I am trying to work out the formula for calculating the implied volatility of an american option on a stock paying dividends (discrete payments or annualized yield).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On page 171 of &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0786312408&quot;&gt;Haug&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following code is provided for the Bisection algorithm, along with the comment: &quot;&lt;strong&gt;With small modifications, the function can also be used to find the implied volatility for American and exotic options&lt;/strong&gt;&quot;. However, I am unable to find further information in the book (or online), which provides instructions on the required modification(s).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I include the function code below, hopefully, someone may be able to suggest the required modifications:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function BisectionAlgorithm(CallPutFlag As String, S As Double, X as Double, T As Double,&#xA;                            r As Double, b as Double, cm As Double) As Double&#xA;   Dim vLow as Double, vHigh As Double, vi as Double&#xA;   Dim cLow As Double, cHigh As Double, epsilon as Double, tempval As Double&#xA;&#xA;   vLow=0.01&#xA;   vHigh=1&#xA;   epsilon=0.000001&#xA;   cLow = GBlackScholes(CallPutFlag,S,X,T,r,b,vLow)&#xA;   cHigh = GBlackScholes(CallPutFlag,S,X,T,r,b,vHigh)&#xA;   vi=vLow+(cm-cLow)*(vHigh-vLow)/(cHigh-cLow)&#xA;   tempval=GBlackScholes(CallPutFlag,S,X,T,r,b,vi)&#xA;&#xA;   While Abs(cm-tempval) &amp;gt; epsilon&#xA;       if tempval &amp;lt; cm Then&#xA;           vLow=vi&#xA;       Else&#xA;           vHigh=vi&#xA;       End If&#xA;&#xA;       cLow = GBlackScholes(CallPutFlag,S,X,T,r,b,vLow)&#xA;       cHigh = GBlackScholes(CallPutFlag,S,X,T,r,b,vHigh)&#xA;       vi=vLow+(cm-cLow)*(vHigh-vLow)/(cHigh-cLow)&#xA;       tempval=GBlackScholes(CallPutFlag,S,X,T,r,b,vi)&#xA;   Wend&#xA;&#xA;   BisectionAlgorithm=vi&#xA;End Function&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1733" LastActivityDate="2012-03-04T15:33:05.133" Title="Modified bisection formula for deriving implied volatility for a dividend paying american option" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;american-options&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3028" PostTypeId="2" ParentId="3027" CreationDate="2012-03-04T15:33:05.133" Score="4" Body="&lt;p&gt;The algorithm is the same, you just need to use appropriate (American/Exotic) pricer instead of black-scholes.&lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2012-03-04T15:33:05.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3029" PostTypeId="2" ParentId="2997" CreationDate="2012-03-05T16:38:18.700" Score="1" Body="&lt;p&gt;There is a relationship:&#xA;$ \log \delta^{-1} = \frac{\sqrt{Var[r(t)]}}{\sqrt{p(1-p)}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which relates the jump size to the volatility of short rate and risk neutral jump probability. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The vol of short rate is chosen to be const in basic model, could be time-varying, but makes things complicated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To solve for $\delta$ you do need the vol of short rate given initially. &#xA;What exactly are those $r(1;u)$ that you have? you have a populated interest rate tree?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you should be able to compute the variance of your short rate from them.&lt;/p&gt;&#xA;" OwnerUserId="647" LastActivityDate="2012-03-05T16:38:18.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3030" PostTypeId="2" ParentId="2982" CreationDate="2012-03-06T11:02:32.397" Score="6" Body="&lt;p&gt;I have a little more informations, so let me share it with you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even though I think that the frameworks I presented in my question are both corrects (i.e. aribtrage free), it happens to be the case that the market seems to have more &quot;structure&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a methodology that allows to retreive market quotes and which is the same as BBG (which is the best reference I could get in terms of market practice), so for a USD based investor :  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use step 1 and 2 to build multicurve US discount curve (based on Fed Funds) and forward curve for (LibUSD3M) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use again step 1 and 2 to build multicurve EUR discount curve (based on OIS) and forward curve for Euribor3M. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then forget about EUR discount curve and build a new discounting EUR curve in the following way, use :&lt;br&gt;&#xA;-Cross Currency ATM Swap&lt;br&gt;&#xA;-EUR forward Curve&lt;br&gt;&#xA;-USD Discount&lt;br&gt;&#xA;-USD forward curve&lt;br&gt;&#xA;-Spot FX rate     &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So that you can build a new EUR Discount curve that allows you to retrieve Cross Currency Swaps ATM Quotes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have made a few tests to compare my USD based framework and this one and the results are quite similar. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What this really says IMO, is that in whatever economy you are based you have $E^{FF_T}[Euribor3m(T-3m,T)]$ and $E^{OIS_T}[Euribor3m(T-3m,T)]$ that are almost equals for any $T$, where $E^{FF_T}$ is the USD-FF T-forward pricing measure and $E^{OIS_T}$ is the EUR-OIS T-forward pricing measure (this is what I meant by &quot;the market seems to have more structure&quot; at the beginning of my post). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This was quite surprising to me and if anyone has more insight on this subject I am all ears. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;NB :&#xA;The methodology presented here can be applied for an EUR Based investor aswell with the same conclusions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best regards&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="92" LastEditDate="2012-03-07T08:59:09.090" LastActivityDate="2012-03-07T08:59:09.090" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3031" PostTypeId="1" AcceptedAnswerId="3065" CreationDate="2012-03-06T14:08:40.843" Score="10" ViewCount="2532" Body="&lt;p&gt;I am trying to write a highly optimised limit order book and I wondered what sort of size I can expect for:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Range of limit prices&lt;/li&gt;&#xA;&lt;li&gt;Number of orders at each limit price&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I am developing custom hardware (FPGA) and thus have very limited amounts of memory available and very different data structures. (The typical pointer-based data structure is normally quite inefficient in an FPGA). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The application is an equities HF market-making strategy in which I require the current top of book from an ITCH data feed to decide inside prices.&lt;/p&gt;&#xA;" OwnerUserId="2137" LastEditorUserId="2299" LastEditDate="2012-08-08T12:21:33.280" LastActivityDate="2012-08-08T12:21:33.280" Title="Limit order book size" Tags="&lt;limit-order-book&gt;&lt;hardware&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3032" PostTypeId="1" AcceptedAnswerId="3046" CreationDate="2012-03-06T18:41:38.447" Score="10" ViewCount="990" Body="&lt;p&gt;These questions are in regards to the Kalman filter and the Hough Transform.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the Pros and Cons of using each method?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In what situations is it better to prefer one over the other?&lt;/p&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="16595" LastEditDate="2018-10-08T19:05:49.243" LastActivityDate="2018-10-08T19:05:49.243" Title="Kalman Filter Vs Hough Transform" Tags="&lt;algorithm&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="3033" PostTypeId="2" ParentId="2993" CreationDate="2012-03-06T18:42:49.987" Score="6" Body="&lt;p&gt;There is a rationale here and it has to do with the connection between diversification and the number of assets in a portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose we purchase an equal-weighted portfolio of &lt;em&gt;n&lt;/em&gt; stocks. The variance of the return is then:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma_{p}^2$  = $\sum$ $\sum$ $w_i$$w_j$Cov($R_i$,$R_j$) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the above notation, the sigmas are summing over $i$ and $j$ respectively each element of the variance-covariance matrix of asset returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since each weight is 1/n, then this equation is equal to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1/$n^2$ * $\sum$ $\sum$ Cov($R_i$,$R_j$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say the average variance across all stocks is $\sigma_{avg}^2$ and the average covariance between among all pairs of stocks is $Cov_{avg}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then this equation simplifies to the sum of two products (see &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0073530700&quot; rel=&quot;noreferrer&quot;&gt;&lt;em&gt;Investments&lt;/em&gt;, Bodie, Kane, and Marcus&lt;/a&gt; for the derivation):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma_{p}^2$ = $(1/n)$ *  $\sigma_{avg}^2$ + $[(n-1)/n]$ * $Cov_{avg}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's analyze the first product. As the number of stocks increases the contribution of the variance of the individual stocks becomes very small because the term $(1/n)$ *  $\sigma_{avg}^2$ approaches zero as $n$ becomes large.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let's analyze the second product. As the contribution of the average covariance across strocks to the portfolio variance stays non-zero because the term $[(n-1)/n] $ * $Cov_{avg}$ has a limit of $Cov_{avg}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So as the number of assets increases the portfolio variance is approximately equal to the average covariance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your above example, if there are many such assets then the contribution to variance is vary small. Also, if the assets are &quot;uncorrelated with others and the market&quot; then the second term is also small. Therefore the variance is nearly zero when both the conditions identified by Luenberger are met.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a more intuitive explanation. A Beta of 0 does not imply zero variance, securities still have idiosyncratic risk (i.e. a random component of return not explained by systematic exposure). A risk-free investment is still less risky than a security with a beta exposure of zero although they both have the same expected return. However, investing in a large portfolio with a beta exposure of zero is far less riskier than investing in a single security with a beta exposure of zero. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Adding the idiosyncratic error term 'e' to the formula you identify captures this idea of diversifying away residual risk. 'e' is a random variable whose expectation is 0 but variance is greater than zero. Only as one builds larger portfolios is this 'e' term increasingly diversified away (i.e. the variance of the error term approaches zero):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\bar{r}_i - r_f = \beta_i (\bar{r}_M - r_f) + e $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put another way, if the number of securities is large (and weights are small), the covariances become the most important driver of portfolio variance. Consider the variance-covariance matrix of the asset returns. For an 'n' asset portfolio there are 'n' variances (the diagonal), and n*(n-1)/2 covariances (the off-diagonal triangle). A portfolio of two stocks has 2 variances and 1 covariance (i.e. variances dominate). A large portfolio of 1,000 stocks has 1,000 variance terms but 499,950 co-variance terms (i.e. covariance dominates).&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-03-09T16:35:47.410" LastActivityDate="2012-03-09T16:35:47.410" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3034" PostTypeId="1" CreationDate="2012-03-07T14:40:36.147" Score="4" ViewCount="261" Body="&lt;p&gt;If I send a market order to an exchange with quantity greater than the quantity of the inside quote at this exchange, and if another exchange has quantity to fill the residual portion at NBBO, will my order by routed to that exchange? Will I be charged a routing fee? How does the exchange decide where to route the order in case of a tie?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What happens If I send it with an ISO instruction (&lt;a href=&quot;http://%5BISO%20order%5D%5B1%5D%20%28intermarket%20sweep%20order%29&quot; rel=&quot;nofollow&quot;&gt;intermarket sweep order&lt;/a&gt;) to not route it and avoid paying the routing fee. Would the residual be cancelled? Or is it filled on the same exchange at an inferior price? I guess that would be a RegNMS violation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, how is the exchange for the NBBO determined in case of tie? Is it based on the primary listing for the stock?&lt;/p&gt;&#xA;" OwnerUserId="2142" LastEditorUserId="1531" LastEditDate="2012-03-18T03:16:04.770" LastActivityDate="2012-03-18T04:17:43.493" Title="Market order quantity greater than quantity of the inside quote at the exchange" Tags="&lt;market-design&gt;&lt;market-microstructure&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3035" PostTypeId="2" ParentId="1847" CreationDate="2012-03-07T16:59:21.577" Score="2" Body="&lt;p&gt;I would calculate implied greeks based on the expectations for the underlying S&amp;amp;P option basket.  Unfortunately, these are just expectations as I have a database of 17 years of S&amp;amp;P options pricing that will tell you your expectations are likely wrong more often than not.  If you had a pricing model that had these expectations built in, I think the resulting greeks would be as correct as your pricing model.&lt;/p&gt;&#xA;" OwnerUserId="2136" LastActivityDate="2012-03-07T16:59:21.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3036" PostTypeId="1" AcceptedAnswerId="3037" CreationDate="2012-03-07T17:06:38.903" Score="8" ViewCount="330" Body="&lt;p&gt;I'm using Idzorek's version of the Black-Litterman model for estimating asset returns.  Idzorek's version bypasses the need to estimate directly the covariance matrix $\Omega$ of errors in the various views by allowing an investor to specify confidence levels for each view.  The entries in $\Omega$ can then be calculated from those confidence levels.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The confidence $C_k$ in view $k$ is expressed as a percentage between $0\%$ and $100\%$.  Thus, for example, an investor can say that she is $50\%$ confident that international bonds will outperform US bonds by 25 basis points.  This way of indirectly obtaining $\Omega$ has the advantage of being intuitive for the individual investor, but it's also fairly subjective, as the value of $C_k$ is really just the investor's opinion.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;What are some more &lt;em&gt;quantitative&lt;/em&gt; ways to obtain these confidences $C_k$? &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1036" LastActivityDate="2012-03-08T14:41:22.670" Title="What are some quantitative ways to obtain the view confidences in Idzorek's version of Black-Litterman?" Tags="&lt;models&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3037" PostTypeId="2" ParentId="3036" CreationDate="2012-03-07T19:14:33.730" Score="7" Body="&lt;p&gt;The primary alternative to Bayesian subjective probabilities is the frequentist approach. This would involve measuring the % of times where international bonds outperformed US bonds by 25 bps over the relevant period in market history and using that as your confidence level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A quantitative view in-between the Bayesian and frequentist approaches would be a regression model that forecasts the spread on international bonds vs. US treasuries using some macro factors (e.g. interest rate differentials, yield curve level and twist differences, growth forecasts, balance of payments data, monetary policy stance dummy variables, currency swap rates, etc.). Once you have the forecasted spread you can take a z-score of the predicted value and measure the probability of the forecast being above 25 bps given the standard error of the forecast. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively you could create a &lt;a href=&quot;http://en.wikipedia.org/wiki/Logistic_regression&quot; rel=&quot;nofollow&quot;&gt;binary logistic&lt;/a&gt; model or a &lt;a href=&quot;http://en.wikipedia.org/wiki/Probit_model&quot; rel=&quot;nofollow&quot;&gt;probit&lt;/a&gt; model that cranks out a likelihood of the spread being greater than 25 bps. In terms of speed and simplicity I would opt for the logistic model as a starting point as you won't have to be as concerned about serial correlation and heteroskedasticity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes fixed-income spreads have long-term mean reverting levels or exhibit patterns that lend themselves to time-series analysis. For example, check out this chart of &lt;a href=&quot;http://research.stlouisfed.org/fred2/series/BAMLEMELLCRPIEMEAUSOAS?cid=32297&quot; rel=&quot;nofollow&quot;&gt;EMEA bond-spreads&lt;/a&gt; over the US treasury spot curve. There appears to be a long-run avg spread in the 3-4% range (an auto-regressive effect) and a shock (moving average) effect. An &lt;a href=&quot;http://en.wikipedia.org/wiki/Autoregressive_integrated_moving_average&quot; rel=&quot;nofollow&quot;&gt;ARIMA&lt;/a&gt; model might help you predict - perhaps directionally - the spread in the next period(s). This is the easiest method to test but the performance will be lousy the more periods in the future you project and might not do better than a random walk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A more (perhaps overly) complex approach would be to develop a &lt;a href=&quot;http://ideas.repec.org/p/ihs/ihsesp/38.html&quot; rel=&quot;nofollow&quot;&gt;Markov regime switching model&lt;/a&gt;. The regimes might correspond to your outcomes of interest, or to states of the world that drive your outcomes of interest (i.e. global recession/flight to safety vs. growth/concern for inflation). Regime switching models return the probability of various states being true, as well as the transition probabilities amongst these states. The sum of the probabilities of the states that are favorable to your 25bps spread can be treated as a confidence.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another technique would be to define some assumptions around the volatility of interest rates and changes in spreads and perform a monte-carlo simulation to measure the % of times the international bonds out-performed by 25 bps. You can calibrate the Monte Carlo assumptions based on your own assumptions or use historical distributions. This approach is difficult unless you have access to international and domestic interest rate volatility models.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-03-08T14:41:22.670" LastActivityDate="2012-03-08T14:41:22.670" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3038" PostTypeId="2" ParentId="925" CreationDate="2012-03-08T14:53:07.260" Score="1" Body="&lt;p&gt;PL attribution is a sum of Greeks times [realized minus implied by the model]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gamma attribution is Gamma times [realized vol minus implied vol (vol used to price)]&#xA;Vanna attribution is Vanna times [realized asset/volatility covariance minus the asset/volatility covariance your model implies]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More or less, at least this should get you started&lt;/p&gt;&#xA;" OwnerUserId="2149" LastActivityDate="2012-03-08T14:53:07.260" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3039" PostTypeId="2" ParentId="1836" CreationDate="2012-03-08T15:01:35.963" Score="7" Body="&lt;p&gt;Yes, there is in fact a whole literature on this subject coming from the field of non-linear dynamics-- it is known as the method of surrogates. The idea is essentially to come up with a &quot;scrambled&quot; version of your original data set that preserves many of the basic statistical properties, though perhaps not the serial dependence structure which might be important for your purposes. I think the best way to do this is to apply a Fourier transform to your data to re-express it in the frequency domain, and then randomly shuffle the data in that form, then convert back by applying the inverse transformation. This Matlab code from the FileExchange does exactly that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/32621-phase-randomization/content/phaseran.m&quot; rel=&quot;noreferrer&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/32621-phase-randomization/content/phaseran.m&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2150" LastEditorUserId="2150" LastEditDate="2012-03-08T16:57:18.143" LastActivityDate="2012-03-08T16:57:18.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3040" PostTypeId="1" CreationDate="2012-03-08T19:21:16.347" Score="4" ViewCount="817" Body="&lt;p&gt;Are there any online tools (optionally with developer API, to spare me the scraping) that given an existing portfolio, calculate how well a new candidate position would score to increase combined diversification/decrease risk?**&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or perhaps Linux tools that given parameters, can look up historical prices and whatever else they need to for instance return correlation values of individual positions relative to the rest (of that portfolio only, not the broader market or sector)?  &lt;a href=&quot;http://dirk.eddelbuettel.com/code/beancounter.html&quot; rel=&quot;nofollow&quot;&gt;Beancounter&lt;/a&gt; was a great start.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Okay, I realize this may be vague, but I am also open-minded.&#xA;My goal is to reduce correlations.  For example if I already own SPY, then buying IWM (or shorting SDS) would be a poor choice for a new position, as &lt;a href=&quot;http://www.google.com/finance?chdnp=1&amp;amp;chdd=1&amp;amp;chds=1&amp;amp;chdv=1&amp;amp;chvs=maximized&amp;amp;chdeh=0&amp;amp;chfdeh=0&amp;amp;chdet=1331240400000&amp;amp;chddm=1173&amp;amp;chls=IntervalBasedLine&amp;amp;cmpto=NYSEARCA%3aSPY;NYSEARCA%3aIWM&amp;amp;cmptdms=0;0&amp;amp;q=NYSEARCA%3aSDS&amp;amp;ntsp=0&quot; rel=&quot;nofollow&quot;&gt;this chart&lt;/a&gt; shows.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A tool that computes covariances? of each equity pair in a portfolio, then the combined portfolio variance plus some other aggregate stats based on those, would be nice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A little bit more background perhaps.&#xA;Using only very basic investment concepts I have built a process that, at the highest level, uses &lt;em&gt;quantifiable&lt;/em&gt; fundamental analysis to screen out the universe of stocks and ETFs.  Including market_cap, analyst_recom, average_volume, dividend_yield, P/E, Insider &amp;amp; Inst Own %s, to name a few.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also daily at a lower level I further filter out candidates using more technical analysis, like short-term RSIs and performances, volatilities, exponential or simple_moving_averages, and average_true_range. (OK some are more for computing trade trigger parameters)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Somewhere in between, I'm looking to introduce criteria that actually considers the rest of the present portfolio and its positions' market values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found some websites like &lt;a href=&quot;http://www.macroaxis.com/invest/menu/pitchletHome/marketCorrelation?s=GOOG,MSFT,YHOO,F,T,A,CRM,JPM,MRK,XOM,DIS,M&amp;amp;ot=table&amp;amp;mode=i&quot; rel=&quot;nofollow&quot;&gt;Correlation Analysis&lt;/a&gt;  that take a stock basket to show a correlation matrix and some kind of &lt;em&gt;Intra-portfolio diversification&lt;/em&gt; which is key.  However that one doesn't factor in &lt;strong&gt;number of shares&lt;/strong&gt; or size of each position.&lt;/p&gt;&#xA;" OwnerUserId="1785" LastEditorUserId="1785" LastEditDate="2012-03-13T20:33:16.000" LastActivityDate="2017-03-03T06:32:03.123" Title="portfolio diversification tester" Tags="&lt;quant-trading-strategies&gt;&lt;correlation&gt;&lt;covariance&gt;&lt;diversification&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3041" PostTypeId="1" CreationDate="2012-03-08T19:58:28.497" Score="5" ViewCount="9776" Body="&lt;p&gt;In particular,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Algorithmic_trading#Algorithms&quot; rel=&quot;noreferrer&quot;&gt;http://en.wikipedia.org/wiki/Algorithmic_trading#Algorithms&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;has several name algorithms. I understand most HFT algorithms are proprietary but I am looking for examples of HFT strategies (even ones that don't make money anymore) just to get a sense of what it's like...&lt;/p&gt;&#xA;" OwnerUserId="1456" LastActivityDate="2013-01-02T11:38:43.837" Title="Where can I find some examples of high frequency or stat arb trading algorithms beyond basic textbook pairs trading?" Tags="&lt;high-frequency&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="3042" PostTypeId="2" ParentId="2205" CreationDate="2012-03-08T21:57:02.063" Score="11" Body="&lt;p&gt;I would use the identity and three step process that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\textrm{Total Variance} = \textrm{Systematic Variance} + \textrm{Unsystematic Variance}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can calculate systematic variance via:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\textrm{Systematic Risk} = \beta \cdot \sigma_\textrm{market} &#xA;\Rightarrow \; \textrm{Systematic Variance} = (\textrm{Systematic Risk})^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then you can rearrange the identity above to get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\textrm{Unsystematic Variance} = \textrm{Total Variance} - \textrm{Systematic Variance}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or if you want the number as &quot;risk&quot; (i.e. standard deviation), then:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\textrm{Unsystematic Risk} = \sqrt{(\textrm{Total Variance} - \textrm{Systematic Variance})}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NOTE: You're making assumptions here that that the Covariance of Unsystematic and Systematic is 0 (which in my experience holds up a good bit of the time).&lt;/p&gt;&#xA;" OwnerUserId="2153" LastEditorUserId="2153" LastEditDate="2014-11-08T02:33:12.570" LastActivityDate="2014-11-08T02:33:12.570" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3043" PostTypeId="2" ParentId="3040" CreationDate="2012-03-08T23:41:31.990" Score="2" Body="&lt;p&gt;Maybe I don't get your question well, but what it appears that your goal is to buy securities in order to reduce the correlation between your portfolio constituents.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So firstly you need a metric of diversification.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something simple you can use, is calculate the correlation matrix, and the weights of each position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A simple metric would be the sum of (correlation *((size pos 1 + size pos 2) /size(portfolio))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This would give you a sort of weighted average correlation (WAC)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you would need to compare previous WAC to new WAC for each potential security and buy only securities that give you a lower WAC.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another twist if you want to add a dimension of correlation aversion would be the sum of squared correlation (make sure your coefficients are stated as numbers &gt; 0, otherwise they will get smaller! and remember to keep the negative sign at the end (if applicable) so your &quot;diversification effects&quot; are present).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also remember that correlations are time dependent during market crashes this will increase. So you will need to adjust your sampling window according to your holding period.&lt;/p&gt;&#xA;" OwnerUserId="2154" LastActivityDate="2012-03-08T23:41:31.990" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3044" PostTypeId="2" ParentId="2999" CreationDate="2012-03-08T23:54:55.947" Score="1" Body="&lt;p&gt;A simple solution to what you may be looking for is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bollinger Bands: It is an a channel with the center being an MA with a roof of being K Stddevs and a floor of -K stdves.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also: &lt;a href=&quot;http://en.wikipedia.org/wiki/Bollinger_Bands&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Bollinger_Bands&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use this to see &quot;how far outside of the channel of &quot;reality&quot; does your model go, i.e. by creating a tight band around real prices and counting the periods outside of the band as a measure of accuracy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It combines volatility and an MA (you can use an EMA if you like).&lt;/p&gt;&#xA;" OwnerUserId="2154" LastActivityDate="2012-03-08T23:54:55.947" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3045" PostTypeId="2" ParentId="2700" CreationDate="2012-03-09T00:04:55.530" Score="1" Body="&lt;p&gt;Not Purely Tactical however some of this should answer your question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I included the minimum variance portfolio as a &quot;active&quot; (with lots of rebalancing)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Value and Momentum: &lt;a href=&quot;http://pages.stern.nyu.edu/~lpederse/papers/ValMomEverywhere.pdf&quot; rel=&quot;nofollow&quot;&gt;http://pages.stern.nyu.edu/~lpederse/papers/ValMomEverywhere.pdf&lt;/a&gt;&#xA;A tl;dr: long undervalued stocks (book/market) that have strong up momentum, short overvalued stocks (book/market) that have downwards momentum.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;130/30 New Long Only: &lt;a href=&quot;http://math.nyu.edu/faculty/avellane/Lo13030.pdf&quot; rel=&quot;nofollow&quot;&gt;http://math.nyu.edu/faculty/avellane/Lo13030.pdf&lt;/a&gt;&#xA;Uses a factor model to estimate expected returns, BARRA risk. You can find implementation of this in R. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Global Minimum Variance Portfolio: tons of papers on this topic a &quot;recent&quot; one &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1549949&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1549949&lt;/a&gt;, essentially a portfolio constructed to minimize variance (or downside volatility), you need to estimate the covariance matrix, as opposed to having to estimate returns and the covariance matrix.&lt;/p&gt;&#xA;" OwnerUserId="2154" LastActivityDate="2012-03-09T00:04:55.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3046" PostTypeId="2" ParentId="3032" CreationDate="2012-03-09T00:46:29.123" Score="4" Body="&lt;p&gt;I am not sure they are comparable as they serve for slightly different purposes. In robotics (specifically vision), Hough Transform is used for objects (or shape) detection. This can subsequently be used for objects tracking, but Hough Transform has no prediction phase. On the other hand, Kalman Filter is a two phase algorithm; measure and predict. With dynamic systems it can be used to find/predict &quot;hidden&quot; parameters like velocity and respectively predict the next move that subsequently can be adjusted with the measurement phase. However, Kalman Filter assumes that the system's dynamic is linear, though with some Gaussian noise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What else? Algorithm efficiency with regards to state space: exponential for Hough Transform and quadratic for Kalman Filter. And Kalman Filter (as far as I know) isn't applicable to multi-modal distribution cases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some useful links &lt;a href=&quot;http://www.ptgrey.com/newsletters/images/GreShaJas04.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.ptgrey.com/newsletters/images/GreShaJas04.pdf&lt;/a&gt; a work based on Hough Transform with with few complains:&#xA;&quot;Currently, the BHT does not include any predictive techniques. While predictive techniques such as Kalman ﬁltering do not respond well to arbitrary motions, they may improve precision&quot; and &quot;The beneﬁts of predictive techniques, such as Kalman and particle ﬁltering, will also be investigated&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And closer to finance one &lt;a href=&quot;http://www.r-bloggers.com/the-kalman-filter-for-financial-time-series/&quot; rel=&quot;nofollow&quot;&gt;http://www.r-bloggers.com/the-kalman-filter-for-financial-time-series/&lt;/a&gt; describing the pros and cons of the Kalman Filters.&lt;/p&gt;&#xA;" OwnerUserId="1868" LastActivityDate="2012-03-09T00:46:29.123" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3047" PostTypeId="2" ParentId="1836" CreationDate="2012-03-09T01:07:40.657" Score="1" Body="&lt;p&gt;In response to &lt;a href=&quot;https://quant.stackexchange.com/questions/2453/how-to-generate-a-random-price-series-with-a-specified-range-and-correlation-wit/2701#2701&quot;&gt;this question&lt;/a&gt;, I posted an answer which in turn links to &lt;a href=&quot;http://dekalogblog.blogspot.com/2012/01/creating-synthetic-data-using-fast.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;a post&lt;/a&gt; on my blog which uses the Fast Fourier Transform to create synthetic prices, in a similar vein to the code linked to in Doodles' answer above. The example screen shots in my blog post show terminal output which indicate high statistical similarity between the original time series and the synthetic series generated from it.  &lt;/p&gt;&#xA;" OwnerUserId="252" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2012-03-09T01:07:40.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3049" PostTypeId="2" ParentId="3020" CreationDate="2012-03-09T19:21:05.517" Score="2" Body="&lt;p&gt;In fact, even your VIX dynamics are not exact, since you can only obtain dynamics for an approximation of the actual VIX calculation (I presume you are just running the variance variable through a square root using Ito's rule).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;SKEW is even less tractable here since its calculation roughly goes as the third moment of the return distribution.  I doubt you can even get a closed form for that third moment, let alone the actual calculation (which, like VIX, depends on discrete strikes).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will add that the Heston model is notoriously bad at making plausible forward volatility skews, so the results of your endeavor are likely to be of academic interest only.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you still want to try, your best bet is to fourier transform the characteristic function (as is done to get the closed-form Heston option pricing equation).  You can probably obtain a closed form expression for the fourier transform of the third moment of returns.  Turning that into an actual approximation to SKEW will probably not have any analytic solution to the fourier integral so you will have to use FFT techniques to get numbers out of the whole process.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-03-09T19:21:05.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3050" PostTypeId="2" ParentId="3040" CreationDate="2012-03-09T21:33:39.767" Score="0" Body="&lt;p&gt;To address this top-down, what you're really trying to do is achieve consistent returns. The conventional wisdom approach to doing this is to find portfolio constituents that provide diversification and the conventional approach to doing this is to find constituents that have returns that are uncorrelated with each other. But the conventional way of doing this quantitatively leads to low predictability that future returns will match past returns. We did substantial research on this in the late 1980s and the result of that research led us to create portfolios that were balanced and diversified across multiple &quot;return drivers.' This also has the benefit of increasing the probability that your portfolio's returns will achieve a specific target return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I write about this in my book &lt;em&gt;&quot;Jackass Investing: Don't do it. Profit from it.&quot;&lt;/em&gt; You can see more at www.JackassInvesting.com&quot; &lt;/p&gt;&#xA;" OwnerUserId="2156" LastActivityDate="2012-03-09T21:33:39.767" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3051" PostTypeId="1" AcceptedAnswerId="3062" CreationDate="2012-03-10T00:22:03.117" Score="8" ViewCount="417" Body="&lt;p&gt;When it comes to comparing returns or prices of instruments like stocks/ETFs, are there any well-established formulas, or ones in common use, that place stronger emphasis on recent correlations more than on historical correlations farther in the past?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An analogy could be the relationship between a &lt;em&gt;simple moving average&lt;/em&gt; and an &lt;em&gt;exponential moving average&lt;/em&gt;, which weighs more recent prices more heavily.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Comments on relative usefulness also welcome.  Fresh in mind is some &lt;a href=&quot;https://quant.stackexchange.com/a/169/1785&quot;&gt;wisdom&lt;/a&gt; I read elsewhere on this site.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If possible try to point out &lt;em&gt;which&lt;/em&gt; correlation recipe it may be based off of (&lt;a href=&quot;https://quant.stackexchange.com/a/850/1785&quot;&gt;some examples&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="1785" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2012-03-14T11:57:40.353" Title="age-sensitive correlation measurements in finances" Tags="&lt;correlation&gt;&lt;asset-allocation&gt;&lt;covariance&gt;&lt;diversification&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3052" PostTypeId="2" ParentId="2844" CreationDate="2012-03-10T00:49:09.417" Score="3" Body="&lt;p&gt;Isn't this a simple mathematical rule?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta r_{t}=r_{t} - r_{t-1} = ln(p_{t}) - ln(p_{0}) - ln(p_{t-1}) + ln(p_{0})=ln(\frac{p_{t}}{p_{t-1}})$$&#xA;i.e. logarithmic or continuously compounded return. As a result:&#xA;$$E(\Delta r_{t})=\frac{1}{T}\sum_{t=1}^{T}\Delta r_{t} = \frac{1}{T}\sum_{t=1}^{T}ln(\frac{p_{t}}{p_{t-1}})=\frac{1}{T}ln(\prod_{t=1}^{T}\frac{p_{t}}{p_{t-1}})=\frac{1}{T}ln(\frac{p_{T}}{p_{0}})=\frac{1}{T}r_{T}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is hourly expectation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or&#xA;$$\frac{p_{T}}{p_{0}}\frac{p_{T-1}}{p_{0}}...\frac{p_{2}}{p_{0}}\frac{p_{1}}{p_{0}}=(\frac{p_{T}}{p_{0}})(\frac{p_{T-1}}{p_{0}}...\frac{p_{2}}{p_{0}}\frac{p_{1}}{p_{0}})$$&#xA;and &#xA;$$ln[\frac{p_{T}}{p_{0}}\frac{p_{T-1}}{p_{0}}...\frac{p_{2}}{p_{0}}\frac{p_{1}}{p_{0}}]= ln(\frac{p_{T}}{p_{0}}) + ln[\frac{p_{T-1}}{p_{0}}...\frac{p_{2}}{p_{0}}\frac{p_{1}}{p_{0}}]$$&#xA;or&#xA;$$ln[\frac{p_{T}}{p_{0}}\frac{p_{T-1}}{p_{0}}...\frac{p_{2}}{p_{0}}\frac{p_{1}}{p_{0}}] - ln[\frac{p_{T-1}}{p_{0}}...\frac{p_{2}}{p_{0}}\frac{p_{1}}{p_{0}}]= ln(\frac{p_{T}}{p_{0}})$$ &#xA;and if we assume convergence&#xA;$$T\cdot E(r_{t}) - (T-1)\cdot E(r_{t})\approx  r_{T}$$&lt;/p&gt;&#xA;" OwnerUserId="1868" LastEditorUserId="1868" LastEditDate="2012-03-12T13:49:19.167" LastActivityDate="2012-03-12T13:49:19.167" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3053" PostTypeId="2" ParentId="3034" CreationDate="2012-03-10T03:11:08.510" Score="5" Body="&lt;p&gt;Normally, an order is indeed routed to a different exchange to fill at NBBO. The exchange will then levy a fee for this routing. I'm not sure how the exchange actually chooses where to route in the case of a tie; I suspect that decision is up to the exchange operator so long as the SEC agrees.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for an ISO order, the sender is effectively taking responsibility for ensuring the correct price. So for a market order, the exchange is allowed to fill outside the NBBO. This isn't a RegNMS violation since the party that sent the order claims responsibility for it. (That's why there are very strict rules regarding what kind of party is allowed to send an ISO order.)&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2012-03-10T03:11:08.510" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3055" PostTypeId="2" ParentId="3012" CreationDate="2012-03-11T11:48:56.150" Score="2" Body="&lt;p&gt;Alright, here's the proof (I think):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Statement of APT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E(r_a)=r_f + \displaystyle\sum_{i=1}^n\lambda_i * cov(r_a, r_i)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Expand $E(r_a)$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{E(C_1)}{PV_0} - 1 =r_f + \displaystyle\sum_{i=1}^n\lambda_i * cov(\frac{C_1}{PV_0} - 1, r_i)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $PV_0$ doesn't have any covariance with $r_i$, we can reduce the above to the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{E(C_1)}{PV_0} - 1 =r_f + \displaystyle\sum_{i=1}^n\frac{\lambda_i * cov(C_1, r_i)}{PV_0}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rearrange:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{E(C_1) -\displaystyle\sum_{i=1}^n\lambda_i * cov(C_1, r_i)}{PV_0} = 1 + r_f $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And finally:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{E(C_1) -\displaystyle\sum_{i=1}^n\lambda_i * cov(C_1, r_i)}{1 + r_f} = PV_0 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;QED (until somebody points out a dumb error I've made).&lt;/p&gt;&#xA;" OwnerUserId="2119" LastEditorUserId="2119" LastEditDate="2018-06-26T13:36:07.110" LastActivityDate="2018-06-26T13:36:07.110" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="3056" PostTypeId="1" AcceptedAnswerId="3063" CreationDate="2012-03-11T13:03:47.490" Score="3" ViewCount="169" Body="&lt;p&gt;Quantitative finance formular are mostly based on martingales, Poisson jump, GBM, CEV, etc.. &#xA;The logic behind it is that martingale means the future could not be predicted, or, EMH (Efficient-market hypothesis).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;fair enough. however, EMH is only a hypothesis now, the other side of the story, that the market is inefficient, could also stands -- provided the inefficiency is always found and exploited then disappeared.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so, is there some theory / math model, that is based on non-martingale analysis?&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2012-03-12T13:59:33.367" Title="Assumptions based on non-martingale?" Tags="&lt;martingale&gt;&lt;emh&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3058" PostTypeId="1" AcceptedAnswerId="3059" CreationDate="2012-03-11T13:41:43.097" Score="10" ViewCount="692" Body="&lt;p&gt;Take the classic GBM (geometric Brownian motion) model for equities as an example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ds = mu * S * dt + sigma * S * dW.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It is the basis for the classic Black-Scholes formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The model says volatility is constant, which is apparently not true considering the volatility smile.  However, many practitioners use the formula, although they apply some interpolation scheme. For example, if the stock price is \$100, to price an option with strike price \$130, people may &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Ask big banks what Black-Scholes volatility they are using for strike prices of \$100, \$120, and \$140.&lt;/li&gt;&#xA;&lt;li&gt;Interpolate for a stock price of \$130.&lt;/li&gt;&#xA;&lt;li&gt;Plug that vol into Black-Scholes and calculate the option price.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Since everyone is applying the same formula, there's no risk or bad consequences to using an inaccurate formula, as long as it's &quot;smartly&quot; used, as in the example, with some interpolation to handle the volatility smile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's more, if there's any mispricing, it seems it's also hard to say what's the cause -- if a new model projected a different option price and the options on the market gradually converged to this value, it can be any reason, maybe the Black-Scholes model is not wrong but the users' interpolation is not accurate, maybe the whole environment changed so convergence is just by chance?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, if there's another model, for example, a modification to the GBM model leading to a formula slightly different from Black-Scholes, how could one argue it's better?&lt;/p&gt;&#xA;" OwnerUserId="2161" LastEditorUserId="1106" LastEditDate="2012-03-12T15:00:34.507" LastActivityDate="2012-03-13T13:36:17.187" Title="Is it possible to demonstrate that one pricing model is better than another?" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;modeling&gt;&lt;pricing-formulae&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3059" PostTypeId="2" ParentId="3058" CreationDate="2012-03-11T14:22:05.433" Score="11" Body="&lt;p&gt;There are many different ways a pricing model can be better :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;It can allow to reproduce the observed market price (Fit criterion)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It takes into account a specific recognized behaviour of the underlying S, say the forward smile dynamic. If you write a product whose value is mostly derived from said behaviour, you dont want to miss that aspect.  (Don't fill me up with 0 unpriced risk criterion )&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Then 2 quite similar criteria can be additionally noted&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;it generates more PL (Kerviel superiority criterion) &lt;/li&gt;&#xA;&lt;li&gt;it gets you more client (Building a great franchise criterion)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="172" LastEditorUserId="172" LastEditDate="2012-03-11T18:26:05.127" LastActivityDate="2012-03-11T18:26:05.127" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3060" PostTypeId="2" ParentId="3051" CreationDate="2012-03-11T17:11:03.207" Score="1" Body="&lt;p&gt;Try this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given some time horizon of K, which can be divided into subperiods of N, you will calculate a rolling correlation coefficient of length N, then you can use the EMA to weight the more recent correlation coefficient heavier (indirectly weighting the recent relationship more, vs the medium term part).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Never came up with this problem in my work so far however it inspired me to try some stuff out :)&lt;/p&gt;&#xA;" OwnerUserId="2154" LastActivityDate="2012-03-11T17:11:03.207" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3061" PostTypeId="2" ParentId="3058" CreationDate="2012-03-12T07:42:47.667" Score="5" Body="&lt;p&gt;Might be a bit overlapping with nicolas' answers, but here it goes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Id say you would have to look at the prediction-power of the model at hand. What if you do a backtest where you set a time t in the future? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Set a price range for the stock at time t, and check with market data how often the price have been within the range. Then, for each model calculate the probability that the price would be within this range.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should also probably test with different ranges, and put more weight on the ranges that are as wide as you would care. (There is no problem of defining a model saying that a stock has a value between 0 and infinity. It will always be correct but not very precise)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, if one is interested in the options, and one have derived hedging strategies for each model, one can backtest how good the hedging strategies are.&lt;/p&gt;&#xA;" OwnerUserId="1583" LastActivityDate="2012-03-12T07:42:47.667" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3062" PostTypeId="2" ParentId="3051" CreationDate="2012-03-12T07:48:27.317" Score="4" Body="&lt;p&gt;You can use the Exponentially Weighted Average directly aswell, finding the covariances and then normalizing back to the correlations:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \sigma_{t+1,jk} =  (1-\lambda) \sum_{n=0}^\infty \lambda^{n} r_{j,t-n} r_{k,t-n} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(this assumes average returns 0 etc etc. More general versions can be derived)&lt;/p&gt;&#xA;" OwnerUserId="1583" LastActivityDate="2012-03-12T07:48:27.317" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3063" PostTypeId="2" ParentId="3056" CreationDate="2012-03-12T13:59:33.367" Score="1" Body="&lt;p&gt;In the equilibrium models you can assume that there exists so called Alpha, i.e. an opportunity that can be exploited. Most of the buy side models (i.e. asset allocation, portfolio construction) are based on this idea. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a theoretical model, you can consider &lt;strong&gt;CAPM with heterogeneous beliefs&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Hedge funds claim to generate the “Alpha”, i.e., excess returns that cannot be explained by  market risk. ... The assumption of homogeneous beliefs was always under scrutiny among&#xA;  ﬁnance theorists. Removing it we can model the Alpha within the CAPM,&#xA;  i.e., as a property of ﬁnancial market equilibria! We show that in a&#xA;  &lt;strong&gt;CAPM with heterogeneous beliefs&lt;/strong&gt; every investor who holds beliefs&#xA;  diﬀerent to the average market belief, sees some Alpha.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;from &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/3540361464&quot; rel=&quot;nofollow&quot;&gt;Financial Economics: A Concise Introduction to Classical and Behavioral Finance&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the long-run the outcome of this model is consistent with the eﬃcient market hypothesis and also with the CAPM based on homogeneous beliefs, i.e. Alpha diminishes.&lt;/p&gt;&#xA;" OwnerUserId="370" LastActivityDate="2012-03-12T13:59:33.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3064" PostTypeId="2" ParentId="729" CreationDate="2012-03-13T06:32:06.253" Score="0" Body="&lt;p&gt;That bug sounds familiar to me, from when I implemented this myself in python.  I can't figure out what your code is doing (it's too wordy, with too much whitespace, too much fragmentation into functions, has strange indents, etc.)  But my guess is that either you're not actually using the regression results as quant_dev mentioned, or you're accidentally truncating a float to an int somewhere -- my recollection is that one of those two things is what bit me; using the same test data, I also got 4.0 the first time I ran it.  &lt;/p&gt;&#xA;" OwnerUserId="2168" LastActivityDate="2012-03-13T06:32:06.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3065" PostTypeId="2" ParentId="3031" CreationDate="2012-03-13T07:37:40.370" Score="5" Body="&lt;p&gt;A correct answer would depend on the instruments and markets you're trading, and whether this is for handling public or propietary orders.  For example, if I were to design for the simple case, US equities and a public market, I'd want the queue size at &lt;em&gt;each&lt;/em&gt; price level to be able to handle at least the maximum daily volume of, say, QQQ.  I know that's in no way &quot;highly optimized&quot;, but the worst time for your shiny fast book to have a meltdown is when something unexpected has happened somewhere.  Likewise for price ranges -- you need to be able to support prices that are at least several orders of magnitude higher than the highest price ever printed in that market.  Again taking equities as an example, some of the highly leveraged inverse ETFs have the potential to do things we've never seen before.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're dealing in currency pairs, for example, there are way too many ways that a series of political events can blow up your code if you try to make data structures too tight.  Use Hungary or Zimbabwe as your model when you're thinking this through; it's possible that squaring the total current value of a given country's money supply might not be a big enough number for a currency pair's future numerator or denominator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe the real correct answer is the one you probably don't want:  Optimize your data structures for speed by using the right algorithms, but don't try to optimize them for size if you want your code to survive interesting times.  You might even want to use the maximum size your platform comfortably allows; if you're trading anything that might be subject to hyperinflation, even 64 bits might not be enough for a price field.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It also comes down to the business model that you're planning on supporting; at some point the business needs to know where these limits are and when they might need to exit certain markets before their own systems fail catastrophically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way of approaching this would be to look at the data sizes of the applications which talk to the order book.  If you plan on supporting smaller data sizes than those client apps, then you'll want to guard against what will happen when a larger-than-expected value does arrive.  The worst case might not be a core dump -- it might be a large order filled at a price that overflowed and wrapped.  ;-)&lt;/p&gt;&#xA;" OwnerUserId="2168" LastEditorUserId="2168" LastEditDate="2012-03-13T20:32:10.883" LastActivityDate="2012-03-13T20:32:10.883" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3066" PostTypeId="2" ParentId="3058" CreationDate="2012-03-13T13:36:17.187" Score="7" Body="&lt;p&gt;In the way that you have posed the question, I would say that we are here discussing a &lt;em&gt;derivative-pricing&lt;/em&gt; model rather than a &lt;em&gt;predictive&lt;/em&gt; model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's an important distinction because a predictive model would be assessed by its ability to generate money.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In contrast, I think of derivative pricing as a fancy way of doing interpolation/extrapolation on prices of vanilla instruments to derive the 'fair' price of a derivative product. It does not attempt to be predictive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the main principle that underlies all derivatives pricing is &lt;em&gt;the ability to use those vanilla instruments as a dynamic hedge&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This implies that a &lt;em&gt;good model&lt;/em&gt; is one which generates a hedging strategy that works well and which therefore allows derivatives traders to sell the derivative product at a premium and know that they can effectively capture that premium by hedging with the vanillas.&lt;/p&gt;&#xA;" OwnerUserId="1920" LastActivityDate="2012-03-13T13:36:17.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3067" PostTypeId="1" CreationDate="2012-03-13T14:39:40.760" Score="2" ViewCount="96" Body="&lt;p&gt;Using quantitative finances techniques on limited information, how might one go about finding similar(highly correlated) assets whose public information &lt;em&gt;is&lt;/em&gt; available?  The only data offered on a list of funds are yesterday's Daily Unit Values alongside up/down arrows, and last quarter's average returns %. No historical data is offered, and can't find similar those funds' ratings elsewhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I plan to implement a daily scraper that logs in, catches the DUV prices and slowly begins building time series tables for each fund.&#xA;What would be the next step? Is it inevitable that I must also keep updated time series on all publicly available equities and funds data as well?&lt;/p&gt;&#xA;" OwnerUserId="1785" LastEditorUserId="1785" LastEditDate="2012-03-13T16:06:41.150" LastActivityDate="2012-03-13T16:06:41.150" Title="how to identify similar assets based only on a few price samples" Tags="&lt;correlation&gt;&lt;funds&gt;&lt;insurance&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3068" PostTypeId="1" CreationDate="2012-03-13T18:01:50.010" Score="14" ViewCount="655" Body="&lt;p&gt;I read a paper from &lt;a href=&quot;http://www.ledoit.net/jef_2008pdf.pdf&quot;&gt;Ledoit and Wolf&lt;/a&gt; that proposes a method to compare two Sharpe ratios and a paper from &lt;a href=&quot;http://www.ssc.wisc.edu/~bhansen/718/White2000.pdf&quot;&gt;White&lt;/a&gt; that proposes a method to compare $n$ trading rules.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: Can we use White's method to compare two Sharpe ratios? I prefer this method because it's computationally simpler.&lt;/p&gt;&#xA;" OwnerUserId="2169" LastEditorUserId="35" LastEditDate="2012-03-13T18:31:05.317" LastActivityDate="2020-03-22T01:02:50.413" Title="Can we use White's reality check to compare two Sharpe ratios?" Tags="&lt;time-series&gt;&lt;sharpe-ratio&gt;&lt;data-mining&gt;" AnswerCount="1" CommentCount="11" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3069" PostTypeId="1" CreationDate="2012-03-13T21:41:11.937" Score="8" ViewCount="2415" Body="&lt;p&gt;Does anyone know of any prior art for non-SQL data structures for high-frequency accounting, whether client, broker, or exchange-side?  I'm thinking specifically of the problem of booking individual trade data into proper transactions, with balanced debits and credits.  In my own case, I'll be doing this in or directly adjacent to a fast limit-order book, but I can see other reasons for such a beast existing.  And yes, I agree that none of the current raft of popular non-ACID nosql engines are at all right for this job.  I'm assuming I'm going to need to write this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A usable answer to this question might be as simple as a link to a paper on the subject of non-SQL or nosql accounting in a high-volume trading context -- I'm obviously using the wrong combinations of search terms, because I'm not finding much yet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I'm working on is a project that includes a limit-order book and accounting on each node in a distributed grid or fabric.  In my case, the traded instruments could best be described as real options or real derivatives, including some mild exotics.  The vast majority of the orders would be initiated by machines, and the data rate looks like it could easily hit 60k trades/sec on each node.  (Without going into a longer dissertation, it might help to explain that I'm in Silicon Valley these days; this is obviously for a new market, not any existing one.)  See &lt;a href=&quot;http://en.wikipedia.org/wiki/Real_options_valuation&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://en.wikipedia.org/wiki/Real_options_valuation&lt;/a&gt; if you haven't run across real options before.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Partial answers, based in part on feedback to this question so far:   &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;A purpose-built accounting mechanism would probably be log-structured, append-only, probably using a non-SQL API for insertion speed.  The engine itself might be a hypergraph database.  If running on multiple nodes, it would need a way of providing summary transactions to the other nodes in a peer-to-peer fashion.  The more I dig into this, the more it's starting to look like a distributed hypergraph. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://mathoverflow.net/questions/13750/what-are-the-applications-of-hypergraphs&quot;&gt;https://mathoverflow.net/questions/13750/what-are-the-applications-of-hypergraphs&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://martin.kleppmann.com/2011/03/07/accounting-for-computer-scientists.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://martin.kleppmann.com/2011/03/07/accounting-for-computer-scientists.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In the HFT world, it sounds like the standard procedure is still:  Log but do not index the trades, do simple arithmetic ignoring debits and credits, and then synthesize balanced summary transactions to the accounting RDBMS periodically.  Run MTM in batch.  Is there anything anyone can say about &lt;em&gt;how&lt;/em&gt; that &quot;simple math and local logging&quot; is done?   I know how we did this in the derivatives world 15 years ago, but frankly it and MTM were both slow and ugly, and involved NFS servers, flat files, and shell scripts.  Has &lt;em&gt;nothing&lt;/em&gt; changed?  ;-)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Okay, removing 'accounting' from the search terms just now found me this -- different question at first glance, covering both tick and financial data, but worth reading through -- looks like he had some of the same thoughts:  &lt;a href=&quot;https://quant.stackexchange.com/q/1392/2168&quot;&gt;Usage of NoSQL storage in Finance&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Looks like it would be worth repeating my searches in google, citeseer, etc., substituting &quot;finance&quot; for &quot;accounting&quot;.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Complex Event Processing (CEP) tries to solve some of the same problems -- it just occurred to me that including CEP in the same searches might be fruitful.  The first thing I found was this (skeptical but humorous) article discussing CEP's slow uptake and some of the nosql hype: &lt;a href=&quot;http://www.hftreview.com/pg/blog/darkstar/read/32333/whats-wrong-with-complex-event-processing&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.hftreview.com/pg/blog/darkstar/read/32333/whats-wrong-with-complex-event-processing&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2168" LastEditorUserId="-1" LastEditDate="2017-04-13T12:58:47.233" LastActivityDate="2013-06-06T02:22:27.597" Title="Non-SQL methods for high-frequency accounting?" Tags="&lt;data&gt;&lt;high-frequency&gt;&lt;limit-order-book&gt;&lt;database&gt;&lt;accounting&gt;" AnswerCount="2" CommentCount="9" FavoriteCount="5" CommunityOwnedDate="2012-03-15T01:30:32.350" ContentLicense="CC BY-SA 3.0" />
  <row Id="3070" PostTypeId="2" ParentId="1685" CreationDate="2012-03-13T22:15:08.417" Score="8" Body="&lt;p&gt;My favorite culprit is quote stuffing, which can be used for a lot of things, including mapping the topology of the exchange servers themselves.  The general idea is to look for bottlenecks which can then be lagged with more targeted quote-stuffing to create arb opportunities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nanex's flash crash analysis covers this to some extent:  &lt;a href=&quot;http://www.nanex.net/20100506/FlashCrashAnalysis_Intro.html&quot; rel=&quot;nofollow&quot;&gt;http://www.nanex.net/20100506/FlashCrashAnalysis_Intro.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only thing I've heard or thought of to deal with this arms race is either built-in execution delays or going back to session-based call auctions rather than continuous.  In either case, a 1 second delay or a 1 second call auction session would level the playing field in terms of speed of light (and might reduce data center rates in Brooklyn).   ;-)&lt;/p&gt;&#xA;" OwnerUserId="2168" LastEditorUserId="2168" LastEditDate="2013-02-22T22:06:09.253" LastActivityDate="2013-02-22T22:06:09.253" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3071" PostTypeId="2" ParentId="3069" CreationDate="2012-03-14T06:01:39.887" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I have to think that there are a lot of very fast, very optimized special-purpose&#xA;  accounting engines out there filling this role. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes and no. I do not think you are high volume at all - you just have a corporate-level server for the database, not a cheap low-end hosting. I do about 2000 transactions per second on a SQL Server with a mid-range database.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The core will be:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Decouple front and back with a message queue anyway.&lt;/li&gt;&#xA;&lt;li&gt;Take trade executions from a FIX backoffice link that reports from clearing / broker.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;it seems like a huge waste of data center horsepower when a more modern purpose-built, &#xA;  probably non-SQL accounting engine might be orders of magnitude faster.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;There is one thing amiss: SQL has data integrity, while NoSql is often written ignoring data integrity requirements. You can get away with a lack of data integrity for a LOT of stuff, but not with accounting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You also miss that accounting is a standardized commodity side. Large companies run something like SAP - and want all their data to be in there, regardless of costs. It is not a waste of time to upgrade the one central system doing your payroll, all invoices for the organization, etc. on top of trade accounting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also it is a question whether accounting really needs every trade - back office yes, to consolidate and check, but accounting is OK with synthesized balanced summaries. I do not do a lot of trading so far but submit monthly PNL totals with broker statement to my accountant (where it goes straight to my monthly profit / loss and tax calculations). I never will do different , even when volume ramps up - but will consolidate daily or hourly and correlate INTERNALLY, but not for accounting.&lt;/p&gt;&#xA;" OwnerUserId="2174" LastEditorUserId="35" LastEditDate="2013-06-06T02:22:27.597" LastActivityDate="2013-06-06T02:22:27.597" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="3072" PostTypeId="1" AcceptedAnswerId="3079" CreationDate="2012-03-14T08:31:16.367" Score="4" ViewCount="3102" Body="&lt;p&gt;Let's say I've developed a strategy that always outperforms the S&amp;amp;P-500, let call it the &quot;magic strategy&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I should be golden. All I need is to always have the S&amp;amp;P shorted with the same amount as I have in the magic strategy, and my outcome is bound to be positive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But how much better does my strategy have to be? Let's say that while the S&amp;amp;P returns 10% per year and my strategy returns 11% in the same period, then my set-up return would look like this:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;50% of my money invested in S&amp;amp;P shorts becomes 45.45% of the starting value&lt;/li&gt;&#xA;&lt;li&gt;50% of my money in the Magic Strategy becomes 55.5% of the starting value&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;making my collected results 1%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a world where everything is free, I could just leverage this 1:99 and the result would be 100%, not bad? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what would be the cost of this sort of strategy in the real world? How much do I have to outperform something in order to make a &quot;A outperforms B&quot; sort of bet?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I read papers they often show how this or that approach, outperforms some index -- how much do you need to outperform something to be able to make a hedged bet? &lt;/p&gt;&#xA;" OwnerUserId="1346" LastEditorUserId="467" LastEditDate="2012-03-14T10:19:23.440" LastActivityDate="2012-03-15T15:10:44.783" Title="What does leverage cost?" Tags="&lt;analysis&gt;&lt;leverage&gt;&lt;performance-evaluation&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3074" PostTypeId="2" ParentId="3051" CreationDate="2012-03-14T10:31:20.903" Score="3" Body="&lt;p&gt;1) Calculate exponential averages (EMA) for time series A &amp;amp; B.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Calculate exponential standard deviations for A &amp;amp; B. My little hack for this is to calculate an EMA of squared returns, then subtract the squared EMA of simple returns, then take the square root of this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;sqrt( ema(return^2) - ema(return)^2 )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Apply the same concept to calculating an exponentially weighted correlation. Instead of summing the products of the two time series' comovements and dividing by the product of their standard deviations you would take A's current return minus its EMA &amp;amp; multiply this with B's return minus EMA. Now take an EMA of this product and divide by (A's exponential stdev times B's exponential stdev).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sorry but I don't know LaTex, if someone would like to turn my wordy explanation into a much more elegant equation then please feel free to edit this.&lt;/p&gt;&#xA;" OwnerUserId="352" LastEditorUserId="352" LastEditDate="2012-03-14T11:57:40.353" LastActivityDate="2012-03-14T11:57:40.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3075" PostTypeId="1" AcceptedAnswerId="3080" CreationDate="2012-03-14T14:37:12.703" Score="1" ViewCount="199" Body="&lt;p&gt;How do I check whether the Option-adjust spread value I have retrieved from external calc utility is correct? Can you please tell me the steps to verify this?&lt;/p&gt;&#xA;" OwnerUserId="2175" LastActivityDate="2012-03-15T15:15:02.487" Title="How do I check whether OAS value is correct?" Tags="&lt;bond&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3076" PostTypeId="1" AcceptedAnswerId="3077" CreationDate="2012-03-14T15:33:27.683" Score="8" ViewCount="420" Body="&lt;p&gt;So as opposed to the normal structure using a reference temperature and HDD/CDD, I'm looking at pricing a call option with a structure similar to the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Daily option on maximum daily temperature over a particular threshold where said temperature maps to an incrementally increasing quantity to use when calculating payout against a price index average during a particular timeframe.  There is a &quot;strike price&quot; in that there is no payout unless the average price exceeds a threshold as well.  There is a daily and aggregate maximum payout (where this gets complicated for me).  So, for example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Day 1:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Max temp = 101 &lt;br&gt;&#xA;Corresponding quantity = 200 &lt;br&gt;&#xA;Avg price = 700 dollars per unit &lt;br&gt;&#xA;Payout = 700*200 = 14,000&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Day 2:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Max temp = 102 &lt;br&gt;&#xA;Corresponding quantity = 300 &lt;br&gt;&#xA;Avg price = 800 dollars per unit &lt;br&gt;&#xA;Payout = 800*300 = 21,000&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Day 3:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Max temp = 98 (does not exceed temperature strike - would not exercise) &lt;br&gt;&#xA;Corresponding quantity = 0 &lt;br&gt;&#xA;Avg price = 50 dollars per unit &lt;br&gt;&#xA;Payout = 0*50 = 0&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Day 4:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Max temp = 110 &lt;br&gt;&#xA;Corresponding quantity = 1000 &lt;br&gt;&#xA;Avg price = 2000 dollars per unit &lt;br&gt;&#xA;Payout = 1000*2000 = 2,000,000 -&gt; payout max of 500,000 = 500,000&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also recall that as we proceed through the contract period, there is some aggregate payout max as well per contract.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any thoughts on how to think about this from a pricing perspective?&lt;/p&gt;&#xA;" OwnerUserId="2176" LastEditorUserId="2176" LastEditDate="2012-03-14T16:16:19.267" LastActivityDate="2012-03-15T15:33:32.793" Title="How to think about pricing this weather call option" Tags="&lt;option-pricing&gt;&lt;derivatives&gt;&lt;commodities&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3077" PostTypeId="2" ParentId="3076" CreationDate="2012-03-14T18:56:07.790" Score="5" Body="&lt;p&gt;The common approach to temperature derivatives in their first run of popularity (in the late 1990's) was to use an &lt;a href=&quot;http://planetmath.org/encyclopedia/OrnsteinUhlenbeckProcess.html&quot; rel=&quot;noreferrer&quot;&gt;Ornstein-Uhlenbeck&lt;/a&gt; process to describe deviations of temperature from a seasonal average.  So far as I know, no major innovations have arisen since then.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Calibrating such a model is very simple, and so is valuing certain quantities such as degree day calls.  Your payoff is complex enough that you will need to price it using Monte Carlo simulation instead.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-03-14T18:56:07.790" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3078" PostTypeId="1" CreationDate="2012-03-15T15:06:38.660" Score="13" ViewCount="17096" Body="&lt;p&gt;I'm currently looking to hone a system using market depth however I am looking for a good source of historical level 2 data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As of right now the best source of historical I have found is &lt;a href=&quot;http://www.automatedtrader.net/tick_data.xhtm&quot; rel=&quot;noreferrer&quot;&gt;automated trader&lt;/a&gt;, however at 6 grand for 1 year I need to make some more money before that happens.  The other vendor I'm in talks with is &lt;a href=&quot;http://www.dxfeed.com/historical-tick-data/&quot; rel=&quot;noreferrer&quot;&gt;dxfeed&lt;/a&gt;, however I'm not sure if they offer level 2 historical data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For my platform I use DTN IQ feeding into matlab which sends trades to IB.  DTN IQ does not provide historical level 2 data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I can't find a good source I'm instead going to test by paper trading the same system on the current market to hone in a strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any other thoughts or opinions on how to get access to historical level 2 would be much appreciated.&lt;/p&gt;&#xA;" OwnerUserId="2178" LastEditorUserId="1418" LastEditDate="2012-08-16T16:24:29.983" LastActivityDate="2020-05-01T06:44:20.223" Title="Historical Level 2 Data (Market Depth)" Tags="&lt;market-data&gt;&lt;tick-data&gt;" AnswerCount="6" CommentCount="6" FavoriteCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="3079" PostTypeId="2" ParentId="3072" CreationDate="2012-03-15T15:10:44.783" Score="2" Body="&lt;p&gt;cost of leverage for equity only long/short investing is a function of the margin deal you can negotiate with your broker, if you have a large amount of capital.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't have significant capital to start with, then it's likely you'll only be able to get 2x leverage with a loan rate between 4% and 10% (retail reg-t margin rates at most brokers)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This would render your strategy unprofitable, since you'd be paying 2% to 5% loan for a portfolio that only generates 2% return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might get more traction by restating the question as:&#xA;Assuming a margin rate of X% with a leverage ratio of Y times capital, how much does a strategy have to out perform a hedge portfolio to earn a positive return.&lt;br&gt;&#xA;(simpler to estimate)&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2012-03-15T15:10:44.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3080" PostTypeId="2" ParentId="3075" CreationDate="2012-03-15T15:15:02.487" Score="3" Body="&lt;p&gt;The value it is giving you is incorrect.  This is known because every option-adjusted spread calculation in existence is incorrect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am joking here, but only a little bit.  They really are all terrible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In any case, there do exist different types of OAS calculations, so you have to know which stochastic model this external utility claims to be using.  Then, you must either implement that model yourself, or you must compare to an independent 3rd party implementation of that model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The real trick in either case will be ensuring that the yield curves, mean reversion and volatility parameters used by the various implementations are matched up.  In many third party utilities it is very tough to get an output of such parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If instead you are satisfied merely to know the OAS calculator is &quot;close&quot;, you could just check it on a variety of bonds, verifying that its OAS values are generally in line with, say, the ones on Bloomberg.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-03-15T15:15:02.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3081" PostTypeId="2" ParentId="3076" CreationDate="2012-03-15T15:33:32.793" Score="0" Body="&lt;p&gt;WARNING &lt;strong&gt;*&lt;/strong&gt; I'd seriously think carefully while pricing this especially using temperature as the underlying, becasue you need to nail a value to temperature. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How much does 1 degree cost? Weather markets are seriously incomplete.&#xA;What location / index would you use as the reference for temperature?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way have a read of H Gemans paper on pricing weather derrivates: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.emeraldinsight.com/journals.htm?articleid=1463233&amp;amp;show=abstract&quot; rel=&quot;nofollow&quot;&gt;http://www.emeraldinsight.com/journals.htm?articleid=1463233&amp;amp;show=abstract&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this little post of mine helps.&lt;/p&gt;&#xA;" OwnerUserId="2179" LastActivityDate="2012-03-15T15:33:32.793" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3082" PostTypeId="2" ParentId="3078" CreationDate="2012-03-15T16:19:03.823" Score="3" Body="&lt;p&gt;I use interactive brokers as well. What I do is I collect the data throughout the day with their API (reqMktDepth functionality) and I'm building my personal data warehouse. It may seem silly but I've been doing it for two years now and I have a good dataset to play with. Just get started and you'll see that it makes sense, the nice thing about it is that you only download whatever you really need and dont pay for the rest (actually you don't pay anything, period)&lt;/p&gt;&#xA;" OwnerUserId="2149" LastActivityDate="2012-03-15T16:19:03.823" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3083" PostTypeId="2" ParentId="925" CreationDate="2012-03-15T16:37:49.580" Score="0" Body="&lt;p&gt;Sorry, had to readd this&#xA; Option price is a function of risk factors, suppose we have just one risk factor, the spot price. Then, provided that you delta hedge your position, the PL explanation will be the difference between Gamma times dS squared (which is what I call realized vol in my comment) and Theta times dt. Incidentally Theta times dt is equal to Gamma times sigma squared times spot squared times dt which is what I call implied vol in my comment. If realized vol is higher than implied vol you make (lose) money if you are long (short) the option and viceversa. Same considerations apply to a model with two risk factors i.e. spot and vol. In that case you have to look at the convexity of the price with respect to spot (gamma) to vol (volga) and cross convexity (vanna). Each convexity has an associated theta. Explanation will be Convexity times dfactor squared (e.g. gamma times dS squared) minus theta times dt (which is equal to gamma times implied dS squared). For vanna everything works the same, look at the Heston PDE and see what terms multiplies the cross derivative. That term times dt is the theta term corresponding to the vanna. The convexity term is just the cross derivative multiplied by dS times dVol&lt;/p&gt;&#xA;" OwnerUserId="2149" LastActivityDate="2012-03-15T16:37:49.580" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3084" PostTypeId="1" CreationDate="2012-03-16T14:15:57.390" Score="4" ViewCount="323" Body="&lt;p&gt;Looking at Eurodollar IR options market data coming down from CME, I can see a whole host of options where the strike is &gt; 100 bps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My understanding in this case is that puts will always be in the money and calls always out, so I was wondering why these may exist?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any thoughts or facts of the subject would be appreciated. &lt;/p&gt;&#xA;" OwnerUserId="2184" LastEditorUserId="35" LastEditDate="2012-03-16T15:22:42.180" LastActivityDate="2012-03-20T07:31:47.230" Title="Eurodollar Options Stike Price &gt; 100 bps" Tags="&lt;options&gt;&lt;pricing&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3085" PostTypeId="2" ParentId="3078" CreationDate="2012-03-17T03:16:51.710" Score="5" Body="&lt;p&gt;Collect the data yourself and self-timestamp it or buy it from a vendor that timestamps on receipt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do buy data from the venues you should consider very strongly the fact that venue timestamps are never in agreement. Therefore, an event that INET reports at time A does not coincide with an event that BZX reports at time A. This makes buying this sort of data somewhat hazardous. You are better of collecting it yourself or buying it from a vendor who has collected it and self-timestamped the data on receipt.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2012-03-17T03:16:51.710" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3086" PostTypeId="2" ParentId="3031" CreationDate="2012-03-17T03:19:23.097" Score="6" Body="&lt;p&gt;If you're writing a &quot;highly-optimized&quot; book then you should be tailoring that book to the venues from which you will be receiving data. Max price, for example, is published in NASDAQ's Itch spec: 200,000.0000.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you plan on trading US equities you better go read each of the venues depth of book specs very carefully. You'll find all sorts of ways to optimize your book implementation. Same goes for other markets and instruments.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2012-03-17T03:19:23.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3087" PostTypeId="2" ParentId="1656" CreationDate="2012-03-17T03:36:11.483" Score="3" Body="&lt;p&gt;You won't find this data for free anywhere. Some data-feeds have it. For example, DTN's NxCore product includes CUSIP in their data files.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2012-03-17T03:36:11.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3089" PostTypeId="1" AcceptedAnswerId="3090" CreationDate="2012-03-17T22:22:42.677" Score="9" ViewCount="2020" Body="&lt;p&gt;I am aware of how to do mean-variance or minimum-variance portfolio optimization with constraints like&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;weights must add to 1.0&lt;/li&gt;&#xA;&lt;li&gt;no short sells&lt;/li&gt;&#xA;&lt;li&gt;max weight in any ticker&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;using basic quadratic programming techniques. However I am stumped by the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My universe of tickers consists of ETFs. Say I want constraints of the form:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;no more than 20% of the portfolio in bond funds (there are many possible bond funds)&lt;/li&gt;&#xA;&lt;li&gt;no more than 30% of the portfolio in funds of one asset class (e.g. real estate)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;How can I run such a portfolio optimization?&lt;/p&gt;&#xA;" OwnerUserId="2186" LastEditorUserId="35" LastEditDate="2012-03-18T01:41:58.000" LastActivityDate="2012-03-20T13:08:17.463" Title="Optimizing a portfolio of ETFs" Tags="&lt;optimization&gt;&lt;portfolio-selection&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3090" PostTypeId="2" ParentId="3089" CreationDate="2012-03-18T03:18:38.463" Score="8" Body="&lt;p&gt;Using solve.QP in R, a straightforward approach is to add a binary exposure vector as an inequality constraint to your &lt;em&gt;Amat&lt;/em&gt; matrix for each group that you want to constrain. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only catch is that values in the exposure and &lt;i&gt;b_0&lt;/i&gt; vectors should be negative, since the function is really satisfying the constraints: &lt;i&gt;A^T b &gt;= b_0&lt;/i&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a simple mean-variance example with two groups that we want to constrain:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quadprog)&#xA;library(MASS)&#xA;&#xA;# Generate some returns&#xA;set.seed(100)&#xA;n &amp;lt;- 100   # number of assets&#xA;m &amp;lt;- 200   # number of states of the world&#xA;rho &amp;lt;- 0.7&#xA;sigma &amp;lt;- 0.2&#xA;mu &amp;lt;- .1&#xA;Cov &amp;lt;- matrix(rho*sigma*sigma, ncol=n, nrow=n)&#xA;diag(Cov) &amp;lt;- rep(sigma*sigma, n)&#xA;S &amp;lt;- 1 + matrix(mvrnorm(m, rep(mu, n), Sigma=Cov), ncol=n)&#xA;&#xA;# Calculate a covariance matrix&#xA;Cov &amp;lt;- var(S)&#xA;&#xA;# Setup quadratic problem&#xA;mu &amp;lt;- apply(S, 2, mean)&#xA;mu.target &amp;lt;- mean(mu)&#xA;bLo &amp;lt;- rep(0, n)&#xA;&#xA;# Define group membership (arbitrary example)&#xA;group1 &amp;lt;- matrix(0,100)&#xA;group2 &amp;lt;- matrix(0,100)&#xA;group3 &amp;lt;- matrix(0,100)&#xA;&#xA;group1[mu &amp;lt;= mean(mu) - .005] &amp;lt;- -1    &#xA;group2[mu &amp;gt; (mean(mu) - .005) &amp;amp; mu &amp;lt;= (mean(mu) + .005)] &amp;lt;- -1&#xA;group3[mu &amp;gt; mean(mu) + .005] &amp;lt;- -1&#xA;&#xA;Amat &amp;lt;- rbind(1, mu)&#xA;dim(bLo) &amp;lt;- c(n,1)    &#xA;bvec &amp;lt;- t(rbind(1, mu.target, bLo))&#xA;zMat &amp;lt;- diag(n)&#xA;Amat &amp;lt;- t(rbind(Amat, zMat))&#xA;Dmat &amp;lt;- Cov&#xA;dvec &amp;lt;- rep(0, nrow(Amat))&#xA;meq &amp;lt;- 2  # the first two columns are equality constraints&#xA;&#xA;sol &amp;lt;- solve.QP(Dmat=Dmat, dvec=dvec, Amat=Amat, bvec=bvec, meq)&#xA;&#xA;cat(paste(&quot;Without group constraints:\n&quot;))&#xA;data.frame(Group1=sum(sol$solution * -group1), Group2=sum(sol$solution * -group2), Group3=sum(sol$solution * -group3))&#xA;&#xA;# Add group constraints:&#xA;#   Group1 &amp;lt;= 20%&#xA;#   Group2 &amp;lt;= 30%&#xA;Amat &amp;lt;- rbind(1, mu, t(group1), t(group2))&#xA;dim(bLo) &amp;lt;- c(n,1)    &#xA;bvec &amp;lt;- t(rbind(1, mu.target, -.20, -.30, bLo))&#xA;zMat &amp;lt;- diag(n)&#xA;Amat &amp;lt;- t(rbind(Amat, zMat))&#xA;Dmat &amp;lt;- Cov&#xA;dvec &amp;lt;- rep(0, nrow(Amat))&#xA;&#xA;sol &amp;lt;- solve.QP(Dmat=Dmat, dvec=dvec, Amat=Amat, bvec=bvec, meq)&#xA;&#xA;cat(paste(&quot;With group constraints:\n&quot;))&#xA;data.frame(Group1=sum(sol$solution * -group1), Group2=sum(sol$solution * -group2), Group3=sum(sol$solution * -group3))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Group weights:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;                     1      2      3  &#xA;Without constraints  26.4%  53.1%  20.4%  &#xA;With constraints     20.0%  30.0%  50.0%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="779" LastEditorUserId="779" LastEditDate="2012-03-20T13:08:17.463" LastActivityDate="2012-03-20T13:08:17.463" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3091" PostTypeId="2" ParentId="3034" CreationDate="2012-03-18T04:17:43.493" Score="1" Body="&lt;p&gt;Order entry protocols allow the sender to specify how they want their order routed. Some protocols such as NASDAQ's Ouch don't support routing where as others, such as RASH, do. How the order is entered and what flags are set will dictate how the exchange handles routing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of a no route order you'll simply receive a cancel for the un-executed shares.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2012-03-18T04:17:43.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3093" PostTypeId="2" ParentId="3084" CreationDate="2012-03-18T18:49:58.450" Score="3" Body="&lt;p&gt;You assume that interest rates are never negative, however, all kinds of strange things happened already in the recent years, e.g. the Euroswiss futures traded above 100 in August 2011, SARON is negative (&lt;a href=&quot;http://www.six-swiss-exchange.com/indices/swiss_reference_rates/reference_rates_en.html&quot; rel=&quot;nofollow&quot;&gt;http://www.six-swiss-exchange.com/indices/swiss_reference_rates/reference_rates_en.html&lt;/a&gt;), German short term debt (Schatz) traded with negative yields this winter (&lt;a href=&quot;http://www.bloomberg.com/quote/GDBR1%3aIND/chart/&quot; rel=&quot;nofollow&quot;&gt;http://www.bloomberg.com/quote/GDBR1:IND/chart/&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My understanding is that it's an unlikely situation, yet possible.&lt;/p&gt;&#xA;" OwnerUserId="1248" LastEditorUserId="1248" LastEditDate="2012-03-20T07:31:47.230" LastActivityDate="2012-03-20T07:31:47.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3094" PostTypeId="1" CreationDate="2012-03-18T23:18:03.877" Score="12" ViewCount="3129" Body="&lt;p&gt;I have a time series of data that is 300 days long. I compute PCA factor loadings on a moving window of 30 days. There are 7 stocks in the universe. Thus factors F1 through F7 are calculated on each PCA calculation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the signs on factor loadings change. This causes problems when interpreting factor price time series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the different approaches to deal with this problem?&lt;/p&gt;&#xA;" OwnerUserId="2195" LastEditorUserId="35" LastEditDate="2012-03-19T03:55:26.180" LastActivityDate="2015-06-16T16:43:52.503" Title="Time series of PCA - Sign change in factor loadings" Tags="&lt;pca&gt;" AnswerCount="5" CommentCount="4" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3095" PostTypeId="2" ParentId="3094" CreationDate="2012-03-19T14:31:44.160" Score="8" Body="&lt;p&gt;You can compute the PCA on overlapping windows,&#xA;and try to match the eigenvectors:&#xA;you may need to change not only their sign&#xA;(since only the eigenspaces are well-defined,&#xA;the sign of the eigenvectors is arbitrary)&#xA;but also their order.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is some (untested) R code to do this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Sample data&#xA;k &amp;lt;- 7&#xA;n &amp;lt;- 50&#xA;found &amp;lt;- FALSE&#xA;while(!found) {&#xA;  x &amp;lt;- matrix(rnorm(k*(n*1)),nc=k)&#xA;  e1 &amp;lt;- eigen(var(x[-1,]))&#xA;  e2 &amp;lt;- eigen(var(x[1:n,]))&#xA;  found &amp;lt;- e1$vectors[1,1] * e2$vectors[1,1] &amp;lt; 0&#xA;}&#xA;colnames(e1$vectors) &amp;lt;- LETTERS[1:k]&#xA;colnames(e2$vectors) &amp;lt;- letters[1:k]&#xA;&#xA;# Compare the eigenvectors, &#xA;# by computing the cosine of the angle they form.&#xA;d &amp;lt;- cor(e1$vectors, e2$vectors)&#xA;&#xA;# Permutation of the vectors&#xA;i &amp;lt;- apply(abs(d), 1, which.max)&#xA;e2$values  &amp;lt;- e2$values[i]&#xA;e2$vectors &amp;lt;- e2$vectors[,i]&#xA;&#xA;# Change the sign, if needed&#xA;j &amp;lt;- sign(diag(d[1:k,i]))&#xA;e2$vectors &amp;lt;- t( t(e2$vectors) * j )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1917" LastActivityDate="2012-03-19T14:31:44.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3096" PostTypeId="2" ParentId="3031" CreationDate="2012-03-19T18:34:23.453" Score="2" Body="&lt;p&gt;In regards to size: I assume that you would most likely want to structure the software to implement each 'book' as a unit of orders representing that particular security, and possibly (as mentioned above) further divide these structures into individual pricing structures such-structures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You would want to be able to scale each individual 'unit' to a pretty arbitrarily large size, for safety reasons, and assume that the system they were running on would have extremely large provision resources. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also you might want to consider the ability to 'buffer' large elements of the program's data by sending it to and from long-term storage, both for efficiency, and safety in the event of catastrophic failure at a memory level. The unit structure I'm alluding too lends itself to more quickly swapping elements in and out of memory, rather than having to write large contiguous sets of elements (orders, etc.) which is obviously a big resource suck.     &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been working (a little bit in my freetime) to generate source code for LOB's in various languages. I've also added some C++ implementations done by other authors (the quantcup entries from 2011)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other issues I've considered for the basic structure are: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Concurrency (inserting or removing orders in the correct order)&lt;/li&gt;&#xA;&lt;li&gt;Threading (this is where functional languages are valuable)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/jordanbaucke/Limit-Order-Book&quot; rel=&quot;nofollow&quot;&gt;https://github.com/jordanbaucke/Limit-Order-Book&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="913" LastEditorUserId="913" LastEditDate="2012-03-19T18:39:59.943" LastActivityDate="2012-03-19T18:39:59.943" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="3097" PostTypeId="2" ParentId="3078" CreationDate="2012-03-19T18:45:46.927" Score="0" Body="&lt;p&gt;I agree with @Louis Marascio and @chrisaycock, data is expensive! Going &lt;em&gt;directly to the exchanges&lt;/em&gt; is the safest way to obtain huge blocks of historical data, and real-time sources.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $6000 for a year is too much, than your not going to be able to afford the exchange's data sources, than your not going to be able to afford a big chunk of historical data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Louis's point about generating your own database by either downloading it from your broker is a good one. Or consider subscribing to a more cost-effective service ($60-$100 a month) and using that to build your database.&lt;/p&gt;&#xA;" OwnerUserId="913" LastActivityDate="2012-03-19T18:45:46.927" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3098" PostTypeId="2" ParentId="1236" CreationDate="2012-03-19T23:22:32.217" Score="3" Body="&lt;p&gt;Dukascopy publish free historical csv tick data but have a convoluted flash widget to access it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This website has a series of tutorial on developing a php script to download and extract all the compressed files.&#xA;&lt;a href=&quot;http://4xtutor.com/category/autotrade/market-data/&quot; rel=&quot;nofollow&quot;&gt;http://4xtutor.com/category/autotrade/market-data/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have written my own python scripts which I will upload if anyone wants it&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are &lt;strong&gt;samples&lt;/strong&gt; of NASDAQ ITCH data which can be used for checking parser implementations against the latest protocol here:&#xA;&lt;a href=&quot;ftp://emi.nasdaq.com/ITCH/&quot; rel=&quot;nofollow&quot;&gt;ftp://emi.nasdaq.com/ITCH/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2137" LastEditorUserId="2137" LastEditDate="2012-03-20T19:29:01.550" LastActivityDate="2012-03-20T19:29:01.550" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3099" PostTypeId="2" ParentId="3094" CreationDate="2012-03-20T10:44:06.683" Score="11" Body="&lt;p&gt;1) Eigenvector times minus one is also an eigenvector (with the same eigenvalue).&#xA;2) Distinct eigenvectors of a symmetrical matrix (i.e. covariance) are orthogonal.&#xA;1 and 2 imply that you can multiply a subset of all the eigenvectors of a symmetrical matrix by minus one an you still get a full set of eigenvectors&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which means, just impose that the first component of every factor is positive. If the PCA returns the first component as negative multiply all the vector by minus one. That will solve your problem.&lt;/p&gt;&#xA;" OwnerUserId="2149" LastActivityDate="2012-03-20T10:44:06.683" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3102" PostTypeId="2" ParentId="3069" CreationDate="2012-03-21T09:30:31.473" Score="4" Body="&lt;p&gt;I know this is probably a naive answer, but when I started doing data analysis for personal trading I looked for something much faster than SQL. I program in C++ and I found that HDF5 was the answer to all my problems&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.hdfgroup.org/HDF5/&quot; rel=&quot;nofollow&quot;&gt;http://www.hdfgroup.org/HDF5/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's not accounting oriented, but the nice thing about it is that you can do almost anything with it and it is very fast. A bit of a learning curve though&lt;/p&gt;&#xA;" OwnerUserId="2149" LastActivityDate="2012-03-21T09:30:31.473" CommentCount="2" CommunityOwnedDate="2012-03-21T09:30:31.473" ContentLicense="CC BY-SA 3.0" />
  <row Id="3103" PostTypeId="1" CreationDate="2012-03-21T20:12:50.647" Score="8" ViewCount="551" Body="&lt;p&gt;I am building a custom hash implementation for storing NASDAQ ITCH order messages. Obviously this is keyed on the order reference number and I am wondering if these numbers are sequential, random or exhibit any interesting characteristics in their distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The hash table will be on a relatively low memory device and knowing these characteristics will allow me to efficiently optimise the datastructure.&lt;/p&gt;&#xA;" OwnerUserId="2137" LastEditorUserId="2137" LastEditDate="2012-03-22T11:15:42.817" LastActivityDate="2012-03-23T12:36:15.113" Title="NASDAQ TotalView ITCH order reference number number characteristics" Tags="&lt;data&gt;&lt;equities&gt;&lt;automated-trading&gt;&lt;programming&gt;" AnswerCount="1" CommentCount="11" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3104" PostTypeId="1" AcceptedAnswerId="3106" CreationDate="2012-03-21T20:16:49.927" Score="3" ViewCount="1011" Body="&lt;p&gt;I typically do a JB (Jarque Bera) test and DW (Durbin Watson) tests for check for normality given skewness, kurtosis and autocorrelation of the data. However this requires a CHI distribution table lookup and some calculation. I was wondering if there is a simple less accurate test that I can do on the data to check if it is normal or not?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly How do I numerically test for I.I.D ?&lt;/p&gt;&#xA;" OwnerUserId="2198" LastActivityDate="2012-03-21T23:04:26.243" Title="a simpler test for normality given skewness, kurtosis and autocorrelation and size of time series" Tags="&lt;time-series&gt;&lt;normal-distribution&gt;&lt;testing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3105" PostTypeId="1" CreationDate="2012-03-21T20:26:13.803" Score="4" ViewCount="486" Body="&lt;p&gt;If I have a lot of data points and number of different dependent variables, can I use central limit theorem to assume data is multivariate normal and compute my VAR? Is this the appropriate use of central limit theorem for VAR calculation?&lt;/p&gt;&#xA;" OwnerUserId="2198" LastActivityDate="2012-03-22T15:55:01.007" Title="central limit theorem and VAR" Tags="&lt;time-series&gt;&lt;var&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3106" PostTypeId="2" ParentId="3104" CreationDate="2012-03-21T23:04:26.243" Score="0" Body="&lt;p&gt;There are simple visual tests for normality and i.i.d.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To test for nomality, simply look at the distribution of the observations and overlay the normal density function as in the following chart:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/zIjEM.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The blue line represents the normal distribution. The black bars are from the histogram representing the empirical distribution. Clearly the data is leptokurtotic is skewed to the right.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To test whether the data is i.i.d., simply partition the data set into different periods and plot the frequency distribution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/SdOLD.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice the distribution has shifted from Period 1 to Period 2 -- therefore this data is not i.i.d.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2012-03-21T23:04:26.243" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3107" PostTypeId="2" ParentId="3105" CreationDate="2012-03-21T23:14:45.593" Score="5" Body="&lt;p&gt;There are several methods to compute VAR: i) historical, ii) variance-covariance, and iii) monte carlo. iv) copula techniques. I assume you are asking about approach (ii).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the data are not multivariate normal and i.i.d. then the variance-covariance approach will not reflect true risk. For example, if there is serial correlation then risk is understated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your intuition around the use of the central limit theorem can be applied by using a &lt;a href=&quot;http://en.wikipedia.org/wiki/Bootstrapping_%28statistics%29&quot; rel=&quot;nofollow&quot;&gt;bootstrapping&lt;/a&gt; approach to estimating VAR. This approach treats VAR itself as a random variable which is estimated with confidence. VAR has some highly unusual properties since it is not a &lt;a href=&quot;http://en.wikipedia.org/wiki/Coherent_risk_measure&quot; rel=&quot;nofollow&quot;&gt;coherent risk measure&lt;/a&gt; - so good luck! There are various posts on this site on how to do bootstrapping.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-03-22T00:56:17.277" LastActivityDate="2012-03-22T00:56:17.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3108" PostTypeId="1" AcceptedAnswerId="3109" CreationDate="2012-03-22T05:33:52.983" Score="5" ViewCount="443" Body="&lt;p&gt;Both the Black-Scholes PDE and the Mass/Material Balance PDE have similar mathematical form of the PDE which is evident from the fact that on change of variables from Black-Scholes PDE we derive the heat equation (a specific form of Mass Balance PDE) in order to find analytical solution to the Black-Scholes PDE. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I feel there should be some physical similarity between the two phenomenon which control these two analogous PDE's (i.e. Black-Scholes and Mass/Material Balance). My question is whether you can relate these two phenomena physically through their respective PDE's? I hope my question is clear, if not please let me know. Thanks.&lt;/p&gt;&#xA;" OwnerDisplayName="user98" LastActivityDate="2013-10-25T20:38:42.547" Title="Can we explain physical similarities between Black Scholes PDE and the Mass Balance PDE (e.g. Advection-Diffusion equation)?" Tags="&lt;correlation&gt;&lt;black-scholes&gt;&lt;differential-equations&gt;&lt;relationship&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3109" PostTypeId="2" ParentId="3108" CreationDate="2012-03-22T09:28:57.633" Score="1" Body="&lt;p&gt;Physical equations tend to be forward equations, whereas in finance one deals with backward equations (e.g. Black-Scholes), so in my opinions analogies are a bit hard to make. The similarity is in the maths that you use, i.e. the PDE you need to solve.&lt;/p&gt;&#xA;" OwnerUserId="2149" LastActivityDate="2012-03-22T09:28:57.633" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3110" PostTypeId="1" CreationDate="2012-03-22T10:03:48.240" Score="3" ViewCount="1159" Body="&lt;p&gt;We are in the process of selecting the data center for deploying our high frequency strategies.&#xA;Does anyone has some questionnaire that can be used to figure out that what type of infrastructure (hardware, processor, cores, ram, network interface card, switch, OS, etc. etc.) will be the best for our strategies?&#xA;I know this is a big question but any useful input based on your past experience will be very helpful...&lt;/p&gt;&#xA;" OwnerUserId="2200" LastEditorUserId="35" LastEditDate="2012-08-05T17:47:18.433" LastActivityDate="2012-08-06T06:22:09.853" Title="How to choose a data center for deploying high frequency trading strategies?" Tags="&lt;automated-trading&gt;&lt;high-frequency&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3111" PostTypeId="2" ParentId="3105" CreationDate="2012-03-22T15:55:01.007" Score="0" Body="&lt;p&gt;If you are not taking a mean of many values (with finite variance) then the central limit theorem does not apply.&#xA;To calculate VaR anyway you can start taking the empirical quantile or use more sophisticated estimators, as the other answer mentioned.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sorry but it's not clear to me the role of those different dependent variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: please distinguish between VaR (Value at Risk) and VAR (vector autoregression)&lt;/p&gt;&#xA;" OwnerUserId="2201" LastActivityDate="2012-03-22T15:55:01.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3112" PostTypeId="1" AcceptedAnswerId="3113" CreationDate="2012-03-22T16:56:30.557" Score="5" ViewCount="738" Body="&lt;p&gt;After running a minimum variance portfolio optimization on a universe of ETF's I see the resulting portfolios tend to be composed of bond ETF or related treasuries/government ETFs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suppose that makes sense because bonds have had lower variance in the periods I'm looking at, however I'm wondering what is the best way to ensure my portfolio is not so 'correlated' in one general asset class?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it necessary to impose constraints on the 'class' of ETF in the portfolio, or is there something more natural that can be done to ensure the portfolios optimize for both minimum variance as well as low correlation between the names selected?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks much, awesome community here.&lt;/p&gt;&#xA;" OwnerUserId="2186" LastActivityDate="2020-08-03T00:18:12.477" Title="Reduce correlation in output of Minimum Variance Portfolio Optimization" Tags="&lt;portfolio-selection&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3113" PostTypeId="2" ParentId="3112" CreationDate="2012-03-22T19:00:14.517" Score="3" Body="&lt;p&gt;You are looking for a &lt;a href=&quot;http://en.wikipedia.org/wiki/Risk_parity&quot; rel=&quot;nofollow&quot;&gt;Risk Parity&lt;/a&gt; based utility function. Risk Parity assigns weights to assets in the portfolio such that the marginal contribution to risk of all assets is equal. As a result, Risk Parity penalizes assets with high volatility and high correlation. AQR has a multi-decade research on the performance of Risk Parity portfolios and it is quite favorable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some other utility functions you should consider are Maximum Diversification Portfolio described by Choueifaty and Coignard in “&lt;a href=&quot;http://www.iijournals.com/doi/abs/10.3905/JPM.2008.35.1.40&quot; rel=&quot;nofollow&quot;&gt;Toward Maximum Diversification&lt;/a&gt;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, Atillio Meucci has a paper on constructing portfolios by maximizing the number of independent bets by applying a PCA treatment. (I'll post the link if I can find that one).&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2012-03-22T19:00:14.517" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3114" PostTypeId="1" AcceptedAnswerId="3115" CreationDate="2012-03-22T21:00:12.267" Score="13" ViewCount="24175" Body="&lt;p&gt;If I would like to construct a fully invested long-only portfolio with two asset classes (Bonds $B$ and Stocks $S$) based on the concept of &lt;em&gt;risk-parity&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The weights $W$ of my portfolio would then be the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the weight of the bonds:&#xA;$$W_B = \textrm{Vol}(S)/[\textrm{Vol(S)}+\textrm{Vol(B)}]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the weights of the stocks $$W_S = 1 - W_B$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on this result, I am going to overweight the low-volatility asset and underweight the high-volatility asset.&lt;br&gt;&#xA;My question is: how do I calculate the weights for a portfolio with multiple asset classes, 5 for example, so that each asset class will have the same volatility and contribute the same amount of risk into my portfolio. From historical data I can extract the volatility of each asset class and the correlation between them.&lt;/p&gt;&#xA;" OwnerUserId="2203" LastEditorUserId="467" LastEditDate="2018-01-30T04:49:23.743" LastActivityDate="2019-07-25T21:41:00.070" Title="How to construct a Risk-Parity portfolio?" Tags="&lt;risk-management&gt;&lt;asset-allocation&gt;&lt;risk-parity&gt;" AnswerCount="4" CommentCount="4" FavoriteCount="22" ContentLicense="CC BY-SA 3.0" />
  <row Id="3115" PostTypeId="2" ParentId="3114" CreationDate="2012-03-23T07:10:08.537" Score="19" Body="&lt;p&gt;Risk Parity is not about &quot;having the same volatility&quot;, it is about having each asset contributing in the same way to the portfolio overall volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The volatility of the portfolio is defined as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma(w)=\sqrt{w' \Sigma w}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The risk contribution of asset $i$ is computed as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma_i(w)= w_i \times \partial_{w_i} \sigma(w)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then show that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma(w)=\sum_{i=1}^n \sigma_i(w)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The vector of the marginal contributions ($\partial_{w_i} \sigma(w)$) is computed as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$c(w)= \frac{\Sigma w}{\sqrt{w' \Sigma w}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then find the solution by running the following optimization:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\underset{w}{\arg \min} \sum_{i=1}^N [\frac{\sqrt{w^T \Sigma w}}{N} - w_i \cdot c(w)_i]^2$$&#xA;This &lt;a href=&quot;http://www.thierry-roncalli.com/download/erc.pdf&quot; rel=&quot;noreferrer&quot;&gt;article&lt;/a&gt; contains all the developments you require to understand how the formulas above are derived.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2013-08-07T14:21:26.500" LastActivityDate="2013-08-07T14:21:26.500" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="3116" PostTypeId="2" ParentId="3103" CreationDate="2012-03-23T12:36:15.113" Score="1" Body="&lt;p&gt;I don't work with ITCH, but I would do the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) ask the data provider.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) whenever a new order arrives, record it's ID separately, and then analyze for a pattern.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most probably they are sequentially growing numbers per instrument.&lt;/p&gt;&#xA;" OwnerUserId="1515" LastActivityDate="2012-03-23T12:36:15.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3117" PostTypeId="1" AcceptedAnswerId="3120" CreationDate="2012-03-23T17:58:15.897" Score="12" ViewCount="1339" Body="&lt;p&gt;On the surface, bid-ask spreads are far more narrow than even several years ago. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, during periods of financial stress liquidity seems to vanish. Also, the increasing amount of fragmentation (i.e. new exchanges, crossing markets / dark pools, etc.) is moving markets away from deep central pools of liquidity. Combined with ultra-HFT linkages across markets there seems to be a potential for increased systemic risk via contagion. There also seem to be glitches -- such as today's 9% &lt;a href=&quot;http://www.cnbc.com/id/46835129&quot;&gt;flash crash in Apple&lt;/a&gt; based on a 100-share trade. There's also research that at the micro-structure level price changes are now exhibiting non-normality (where previously this was observed only at lower frequencies).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The evidence seems mixed and anecdotal. How does this net out? Is there are any hard research on the effects of HFT on market depth, liquidity, and volatility during peacetime and periods of stress?&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="2299" LastEditDate="2012-04-18T01:54:13.107" LastActivityDate="2015-10-18T04:31:04.357" Title="What is the impact of high-frequency trading on market depth, liquidity, and volatility?" Tags="&lt;research&gt;&lt;high-frequency&gt;&lt;market-microstructure&gt;" AnswerCount="4" CommentCount="3" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3118" PostTypeId="2" ParentId="3117" CreationDate="2012-03-23T18:26:57.323" Score="3" Body="&lt;p&gt;I have been coming across a few of these research lately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't have access to it anymore but I remember reading the abstract of this &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S0927539897000030&quot; rel=&quot;nofollow&quot;&gt;article&lt;/a&gt;, but it's really outdated now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After a quick look, I found this &lt;a href=&quot;https://q-group.org/pdf/Kyle-paper-Q-group_flash_crash_01182011_small.pdf&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; which is much more recent (2011) as well as &lt;a href=&quot;http://www.nber.org/public_html/confer/2010/MMf10/Brogaard.pdf&quot; rel=&quot;nofollow&quot;&gt;this one&lt;/a&gt; (2010).&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2012-03-23T18:26:57.323" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3119" PostTypeId="2" ParentId="3117" CreationDate="2012-03-23T20:53:42.413" Score="4" Body="&lt;p&gt;&lt;a href=&quot;http://www.bis.org/review/r110720a.pdf&quot; rel=&quot;nofollow&quot;&gt;A race to zero&lt;/a&gt; by Andrew Haldane, Bank of England has some interesting content and references to research regarding this.&lt;/p&gt;&#xA;" OwnerUserId="993" LastEditorUserId="11807" LastEditDate="2015-10-18T03:39:38.577" LastActivityDate="2015-10-18T03:39:38.577" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3120" PostTypeId="2" ParentId="3117" CreationDate="2012-03-23T21:27:52.250" Score="10" Body="&lt;p&gt;Joel Hasbrouck (imho, a leading expert in market microstructure) has a paper on this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://people.stern.nyu.edu/jhasbrou/Research/Working%20Papers/HS10-11-10.pdf&quot;&gt;http://people.stern.nyu.edu/jhasbrou/Research/Working%20Papers/HS10-11-10.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the abstract: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Our conclusion is that increased low-latency activity improves traditional market quality measures such as short-term volatility, spreads, and displayed depth in the limit order book.&lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2012-03-23T21:27:52.250" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3122" PostTypeId="2" ParentId="175" CreationDate="2012-03-25T18:57:30.683" Score="0" Body="&lt;p&gt;The rule of thumb in one large derivatives group in the mid-90's was &quot;about 3 months&quot; before arbitrage starts causing serious damage.  One place to start might be to look for other (anecdotal or survey-based) timeframes like that, see if you can get any sort of curve, trend, or surface out of that raw data.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I suspect you might find that the valid half-life of any given model has more to do with overall market conditions than with the model itself.  I also suspect that you might find a strong correlation between model half-lives and the shape of the yield curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Restating as a wild guess:  If a model accurately describes some part of the market today, then it will likely do so tomorrow as well, with a probability of P.  Assume that there is some relationship between P and the yield curve.  For a first approximation, if your model is working with 2-year instruments, then use some factor multiplied by the 2-year yield curve slope to get P, and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the yield curve to get P might work better with macroeconomic models, and not so well with micro. There are some obvious cases where this won't work -- if the model depends on some HFT or microstructure feature such as an exchange or counterparty's server load factor, for instance.  A half-life rule for micro might be able to use something like VIX as an input though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Again, this is all wild guesses, I've done little research to see if anyone else has written any papers about this.  But a google search for &quot;economic market model half-life yield curve&quot; does look promising.&lt;/p&gt;&#xA;" OwnerUserId="2168" LastEditorUserId="2168" LastEditDate="2013-02-22T22:02:42.410" LastActivityDate="2013-02-22T22:02:42.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3123" PostTypeId="2" ParentId="181" CreationDate="2012-03-25T20:44:28.913" Score="4" Body="&lt;p&gt;The map is not the territory, any model is an abstraction and will never be complete, the only complete model of the market is the market itself, and so on.  I agree that this leads directly into Gödel, Turing, the halting problem, and other basic computability concepts.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try this thought experiment:  Imagine the market as a turing machine named M, reading and writing to a tape of infinite length.  All past and future news events are on the tape.  The market (our machine named M) reads a news event, and, based on its internal state and ruleset, writes a market data message to the tape.  Because of the halting problem etc., we can't use a different machine to predict ahead of time what the next market data message will be.  The only way to discover the next market data message is to execute M's next machine cycle.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Trying to write an exact model of the market is like trying to duplicate M's entire tape, including future news events, as well as M's internal ruleset.  And before we can begin executing our own model, we also need to grab a copy of M's internal state, which, in the case of a real-world market, includes the internal state of all counterparties.  Any turing machine that can do all of that is, in fact, identical to M.  We would have to recreate the entire market, including future news, in order to model M.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we try to write a macro-level model G that summarizes M's output, aggregating by timeframe, index, or somesuch, then we still run into the same problem:  Macromarket G is just another machine, still with an infinite tape.  We can assume that G's behavior is determined by a simpler ruleset, with smaller internal state than M.  That's the whole point of a model.  But again, in a real-world market, that internal state is stored amongst the counterparties, and the tape still includes future news events.  And the next (aggregated) market data message is still not decideable without executing G's next machine cycle.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can model this several other ways.  For instance, instead of one big machine M or G, we can use a bunch of smaller machines, each representing a counterparty, all sharing the same tape.  That just makes the complexity worse.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, Turing only claimed that a turing machine could compute any problem that was decideable &lt;em&gt;by machine&lt;/em&gt;.  A real-world market includes players who are not machines.  But even if we were to assume that humans are mechanistic in behavior, we'd still have the intractibility of getting a copy of their internal state in order to model M or G.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In reality we already know that no model is completely accurate, and no model's accuracy is constant over time.  The above thought experiments, I think, might be able to illustrate some of the reasons why.&lt;/p&gt;&#xA;" OwnerUserId="2168" LastActivityDate="2012-03-25T20:44:28.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3127" PostTypeId="1" CreationDate="2012-03-26T16:15:51.780" Score="4" ViewCount="364" Body="&lt;p&gt;Let's say I wanted to create my own financial market where people could buy with real money shares in a real physical product such as, for example, a rock band. If the value of the rock band goes up, so do the investors shares, if the value of the rock band goes down, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this feasible? Any links to resources on this?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT 1&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used the example of a rock band because I was inspired by &lt;a href=&quot;http://www.telegraph.co.uk/finance/2871738/Start-your-own-stock-exchange.html&quot; rel=&quot;nofollow&quot;&gt;this article&lt;/a&gt;, but I think this could apply to virtually anything. People value different things for different reasons. A rock band could be considered valuable because it gives returns on it's revenue, but also maybe just because a fan gives value to 'owning' a share in their favorite artist. Granted a rock band is maybe not the best example, so let's not go too far with this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How about an antique? This is something that people could make money on if they sell shares in an object whose worth has for whatever reason increased in value since the time of their initial investment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was thinking of something similar to ebay, but where the users bid on shares of an object that they never receive. An antique could sit in a museum and the shares could be sold to people who bid on it according to what they think it is currently worth.  &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT 2&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Okay, so there has already been a lot of great comments and answers to this question. And the explanations of the principals of the market system are helpful. But I guess what I was really wondering was if there are any legal limitations. This may be too broad to answer here, but any insights or links to resources would be appreciated. &lt;/p&gt;&#xA;" OwnerUserId="2209" LastEditorUserId="2209" LastEditDate="2012-03-26T22:16:37.377" LastActivityDate="2012-03-28T17:54:10.620" Title="Creating a financial market" Tags="&lt;market&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3128" PostTypeId="1" CreationDate="2012-03-26T16:59:19.743" Score="7" ViewCount="252" Body="&lt;p&gt;A friend of mine told me that their firm is using &lt;a href=&quot;http://en.wikipedia.org/wiki/Extreme_value_theory&quot; rel=&quot;noreferrer&quot;&gt;Extreme Value Theory&lt;/a&gt; (EVT) to compute value of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Expected_shortfall&quot; rel=&quot;noreferrer&quot;&gt;Expected Shortfall&lt;/a&gt; 99% of a portfolio for their asset allocation process. To do so, they try to fit the parameters of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Generalized_Pareto_distribution&quot; rel=&quot;noreferrer&quot;&gt;Generalized Pareto Distribution&lt;/a&gt; using the historical sample of their portfolio, and they use a formula to get the value of $ES_{0.99}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I they are using monthly data points, which means that the size of the sample is pretty (very) limited. When I asked what the minimum number of point required to performed the fitting was, I was told that their algorithm was asking for a minimum of 10 points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am wondering&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;if that's enough?&lt;/li&gt;&#xA;&lt;li&gt;how could we compute some kind of quantitative value indicating &quot;how wrong&quot; the fitting might be given the give size of the sample $N$? (this method could be specific to GPD, but of course a generic approach would be great).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="467" LastEditorUserId="70" LastEditDate="2012-03-26T17:19:19.907" LastActivityDate="2012-04-27T22:55:51.550" Title="How many data points are required to perform a fitting of GPD?" Tags="&lt;risk-management&gt;&lt;asset-allocation&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3130" PostTypeId="2" ParentId="3127" CreationDate="2012-03-26T18:01:23.480" Score="3" Body="&lt;p&gt;As Tal Fishman and chrisaycock said in their comments, you need to have a possible economic gain (or a physical delivery) coming from the underlying (in your example a rock band) that motivates the investor to acquire shares.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you suggest has already been done in France, through the website &lt;a href=&quot;http://www.mymajorcompany.com/&quot; rel=&quot;nofollow&quot;&gt;MyMajorCompany.com&lt;/a&gt; where you can buy a &quot;share&quot; of artists (music, comics designers, ...) which will give you the right to claim part of the artist's revenue from a concert, an album, and so on. There is also a website called &lt;a href=&quot;http://www.privatejoke.fr/&quot; rel=&quot;nofollow&quot;&gt;Private Joke&lt;/a&gt; where you can invest in the same way on humorists.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that you also have example of exchanges where the underlying is not really a &quot;share&quot; but a possible income in gifts or in money depending on whether an event occurs or not. A well-known example is &lt;a href=&quot;http://www.betfair.com/&quot; rel=&quot;nofollow&quot;&gt;Betfair&lt;/a&gt;, an exchange specialized on sports betting. Eurosport (a European sport TV channel) also had a contest for the football world cup where you could buy &quot;shares&quot; of football teams prior and during the tournament, and where the owners of the winning teams in the end received gifts such as cars or TVs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have not contact with the rock band, or the rock band is not willing to share its shares, you won't really be able to create such an exchange.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2012-03-26T18:01:23.480" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3133" PostTypeId="1" AcceptedAnswerId="3170" CreationDate="2012-03-28T15:50:17.633" Score="8" ViewCount="557" Body="&lt;p&gt;I'm analyzing trades from several participants in a trading competition, and I was wondering - are there known mechanisms for analysis and inference of the logic in a set of trades done by one participant? For example, I know that some participants would adopt the strategy of hedging an option-on-future O with the underlying future F, but I have no idea what greeks they are hedging and what other states in the system their strategy might be taking into account.&lt;/p&gt;&#xA;" OwnerUserId="1217" LastActivityDate="2012-04-06T21:01:14.207" Title="Means of inferring trading algorithms from competition trade data" Tags="&lt;trading&gt;&lt;programming&gt;&lt;hedging&gt;&lt;algorithm&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3135" PostTypeId="1" CreationDate="2012-03-28T19:06:13.937" Score="9" ViewCount="1246" Body="&lt;p&gt;I have a follow-on question to questions that appeared here and was not sure if the right way was to ask in the comments or post a new question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: how can I optimize a portfolio to suit &lt;em&gt;both&lt;/em&gt; minimum variance as well as max diversification. Essentially the minimum variance portfolio that is most diversified.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can formulate a quadratic optimization for either MVP (minimum variance) or MDP (max diversification) as per choueifaty et al.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I don't know how to craft a quadratic program that optimizes for both at the same time. Is it even possible with a quadratic program or do I have to use some other optimization procedure?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The source questions are here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/3112/reduce-correlation-in-output-of-minimum-variance-portfolio-optimization&quot;&gt;Reduce correlation in output of Minimum Variance Portfolio Optimization&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/1707/how-do-i-find-the-most-diversified-portfolio-or-least-correlated-subset-of-sto&quot;&gt;How do I find the most diversified portfolio, or least correlated subset, of stocks?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2186" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2013-05-22T22:54:33.793" Title="How to optimize a portfolio under *both* maximum diversity ratio and minimum variance" Tags="&lt;optimization&gt;&lt;portfolio-selection&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3136" PostTypeId="2" ParentId="3135" CreationDate="2012-03-28T19:37:48.607" Score="2" Body="&lt;p&gt;There is only one MVP and only one MDP portfolio so, unless these are the same, this will not be possible.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2012-03-28T19:37:48.607" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3137" PostTypeId="2" ParentId="3128" CreationDate="2012-03-28T19:46:30.657" Score="0" Body="&lt;p&gt;Given a sample you can estimate the parameters and calculate the standard deviation of these estimations. You could use this as a measure of quality. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Creating a measure given only the sample size $N$ seems very hard to me since the quality of the estimation may depend on the values of the parameters.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2012-03-28T19:46:30.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3139" PostTypeId="1" CreationDate="2012-03-29T07:14:47.150" Score="5" ViewCount="156" Body="&lt;p&gt;Short intro: We are developing pricing engines for the calculation of market risk in a Solvency II solution, including bonds, callable bonds, cds, options, futures and so on. Are there any canonical test cases which the engines have to solve?&lt;/p&gt;&#xA;" OwnerUserId="357" LastEditorUserId="357" LastEditDate="2012-03-29T09:10:35.710" LastActivityDate="2012-03-29T09:10:35.710" Title="Are there canonical test cases for testing of pricing engines" Tags="&lt;backtesting&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3140" PostTypeId="2" ParentId="3135" CreationDate="2012-03-29T08:31:09.187" Score="-2" Body="&lt;p&gt;Solve the system for constraints:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;minimize variance&lt;/li&gt;&#xA;&lt;li&gt;maximize returns&lt;/li&gt;&#xA;&lt;li&gt;for diversity : maximize sum of lengths of all the edges of a minimum spanning tree extracted from the distance matrix i.e. correlation matrix&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Would appreciate any kind of academic references with similar thoughts. &lt;/p&gt;&#xA;" OwnerUserId="2224" LastActivityDate="2012-03-29T08:31:09.187" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3142" PostTypeId="1" CreationDate="2012-03-29T20:26:18.710" Score="7" ViewCount="223" Body="&lt;p&gt;The &quot;&lt;a href=&quot;http://en.wikipedia.org/wiki/January_effect&quot;&gt;january effect&lt;/a&gt;&quot; is one of the most widely recognized market anomalies. In a nutshell, it refers to the empirical observation that January appears to have systematically higher returns than other months of the year. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the most common rationales for this anomaly?&lt;/p&gt;&#xA;" OwnerUserId="1531" LastActivityDate="2012-03-30T14:25:36.417" Title="what are the most common explanations of the January effect?" Tags="&lt;anomalies&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3143" PostTypeId="2" ParentId="3135" CreationDate="2012-03-29T23:26:23.483" Score="1" Body="&lt;p&gt;Hmmm ... my knowledge is limited to MPT ( &lt;a href=&quot;http://en.wikipedia.org/wiki/Modern_portfolio_theory&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Modern_portfolio_theory&lt;/a&gt; ) and according to it, this isn't really a problem or the problem isn't formulated correctly, because it is mathematically provable that more diversified a portfolio is, lower is the variance (or risk, have a look at this lecture for example &lt;a href=&quot;http://academicearth.org/lectures/portfolio-diversification&quot; rel=&quot;nofollow&quot;&gt;http://academicearth.org/lectures/portfolio-diversification&lt;/a&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another life example, Standard Life pension funds:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&quot;Pension 2 Managed Fund&quot; (variance = 0.207932, expected return =&#xA;0.054878)&lt;/li&gt;&#xA;&lt;li&gt;&quot;Pension 2 Stock Exchange Fund&quot; (variance = 0.200217, expected return&#xA;= 0.053171)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;are highly correlated ρ=0.996032, so MPT (at the optimal point, i.e. Portfolio return of those two = 0.050132 and lowest possible Portfolio variance = 0.194857 - reduced by the way) suggests:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Weight(&quot;Pension 2 Managed Fund&quot;) = -1.779723&lt;/li&gt;&#xA;&lt;li&gt;Weight(&quot;Pension 2 Stock Exchange Fund&quot;) = 2.779723&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I.e. short &quot;Pension 2 Managed Fund&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is actually easy to implement with Octave or MathLab:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.calculatinginvestor.com/2011/06/07/efficient-frontier-1/&quot; rel=&quot;nofollow&quot;&gt;http://www.calculatinginvestor.com/2011/06/07/efficient-frontier-1/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.calculatinginvestor.com/2011/06/14/efficient-frontier-part-2/&quot; rel=&quot;nofollow&quot;&gt;http://www.calculatinginvestor.com/2011/06/14/efficient-frontier-part-2/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;However, finding the best portfolio is quite of a task ( &lt;a href=&quot;http://rtybase.blogspot.co.uk/2011/11/search.html?showComment=1331035896847#c2577055848756808847&quot; rel=&quot;nofollow&quot;&gt;http://rtybase.blogspot.co.uk/2011/11/search.html?showComment=1331035896847#c2577055848756808847&lt;/a&gt; ).&lt;/p&gt;&#xA;" OwnerUserId="1868" LastActivityDate="2012-03-29T23:26:23.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3144" PostTypeId="1" AcceptedAnswerId="3183" CreationDate="2012-03-30T12:53:15.173" Score="7" ViewCount="2446" Body="&lt;p&gt;Besides of the &lt;a href=&quot;http://finance.yahoo.com/q/hp?s=%5EVIX%20Historical%20Prices&quot; rel=&quot;nofollow noreferrer&quot;&gt;VIX&lt;/a&gt; there is another vol datum publicly available for the S&amp;amp;P 500: the &lt;a href=&quot;http://www.cboe.com/micro/skew/introduction.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;SKEW&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you know a procedure with which one can extrapolate other implied vols of the S&amp;amp;P 500 smile with these data (or with other publicly available &lt;a href=&quot;http://www.cboe.com/micro/IndexSites.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;vol data&lt;/a&gt;)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Addendum:&lt;/strong&gt;&lt;br&gt;&#xA;I created a follow up question &lt;a href=&quot;https://quant.stackexchange.com/questions/3210/how-to-calculate-the-most-realistic-option-prices-with-additional-publicly-avail&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="19645" LastEditDate="2021-05-05T08:45:45.887" LastActivityDate="2021-05-05T08:45:45.887" Title="Constructing an approximation of the S&amp;P 500 volatility smile with publicly available data" Tags="&lt;options&gt;&lt;volatility&gt;&lt;implied-volatility&gt;&lt;volatility-smile&gt;" AnswerCount="2" CommentCount="7" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3145" PostTypeId="2" ParentId="3142" CreationDate="2012-03-30T14:25:36.417" Score="6" Body="&lt;p&gt;A new explanation that isn't well known (yet) has to do with human capital. Key employees are most likely to leave in January, after bonuses are paid. In anticipation of this risk, prices decline before January, and then if the key people don't leave, prices rise in January. And, &lt;em&gt;voila&lt;/em&gt;... the January effect. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://ssrn.com/abstract=1962910&quot; rel=&quot;noreferrer&quot;&gt;this paper&lt;/a&gt;. Their results work much better than explanations like tax-loss selling and such.&lt;/p&gt;&#xA;" OwnerUserId="1056" LastActivityDate="2012-03-30T14:25:36.417" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3146" PostTypeId="1" AcceptedAnswerId="8036" CreationDate="2012-03-30T14:51:08.510" Score="4" ViewCount="260" Body="&lt;p&gt;If the distribution of returns is symmetric then why not &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;use a coin toss to decide whether to buy or sell&lt;/li&gt;&#xA;&lt;li&gt;Calculate the average velocity of the market (ATR - in technical analysis)&lt;/li&gt;&#xA;&lt;li&gt;Place a stop loss on 0.5 ATR away from current price and take a profit 2 ATR away from the current price?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I tried it in FOREX and it doesn't seem to work. Why is this so?&lt;/p&gt;&#xA;" OwnerUserId="1231" LastEditorUserId="848" LastEditDate="2012-03-30T17:55:55.570" LastActivityDate="2013-05-21T01:54:03.713" Title="If the distribution of returns in symmetric, why not use a coin toss, small risk &amp; high reward?" Tags="&lt;random-walk&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3147" PostTypeId="2" ParentId="3144" CreationDate="2012-03-30T16:06:46.873" Score="4" Body="&lt;p&gt;Actually, closing options prices can be &lt;a href=&quot;ftp://ftp.cmegroup.com/pub/settle/stleqt&quot; rel=&quot;nofollow noreferrer&quot;&gt;downloaded&lt;/a&gt; from the exchange, so the data necessary to get the skew is available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If for some reason you don't want to use those closing prices, it &lt;em&gt;is&lt;/em&gt; possible to obtain a vol skew from VIX and SKEW.  You would need to fit the parameters of a stochastic volatility model (such as &lt;a href=&quot;http://www.math.umn.edu/~bemis/IMA/MMI2008/calibrating_heston.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Heston's&lt;/a&gt;) to the VOL and SKEW data.  It's &lt;a href=&quot;https://quant.stackexchange.com/questions/3020/skew-and-vix-relations&quot;&gt;hard to do carefully&lt;/a&gt; but easy to do approximately.   Then the S&amp;amp;P skew is whatever has been implied by that model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Edit:  if you are willing to include the VVIX, your fits will become much better.  The VVIX tels you the size of the volatility-of-volatility parameter in a stochastic vol model.)&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2012-04-10T12:51:54.960" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3148" PostTypeId="2" ParentId="3146" CreationDate="2012-03-30T16:53:29.453" Score="1" Body="&lt;p&gt;could this strategy be applied for real trading ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i mean, whatever a trade makes or loses money, trading incurs transaction-costs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thus, you cannot stand on that (perfect) bell-shaped distribution to trade profitably with any certainty.&lt;/p&gt;&#xA;" OwnerUserId="2220" LastEditorUserId="2220" LastEditDate="2012-03-30T17:28:31.767" LastActivityDate="2012-03-30T17:28:31.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3150" PostTypeId="1" AcceptedAnswerId="3151" CreationDate="2012-03-30T22:08:34.443" Score="5" ViewCount="397" Body="&lt;p&gt;I have historical trade data for every trade on a forex exchange, whcih includes the following data:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Time the trade was made&lt;/li&gt;&#xA;&lt;li&gt;Amount, in currency A&lt;/li&gt;&#xA;&lt;li&gt;Price, in currency B&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I have also used this to organize the data into candlestick data for periods, which includes:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Volume in currency A&lt;/li&gt;&#xA;&lt;li&gt;Volume in currency B&lt;/li&gt;&#xA;&lt;li&gt;Low price&lt;/li&gt;&#xA;&lt;li&gt;Open price&lt;/li&gt;&#xA;&lt;li&gt;Close Price&lt;/li&gt;&#xA;&lt;li&gt;High price&lt;/li&gt;&#xA;&lt;li&gt;Number of trades&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;How will I be able to use the data I have to infer the highest bid or lowest ask at a certain point in time? Also, is there any way I will be able to guess the volume of the high bid/low ask orders?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This won't be a perfect solution because I don't have access to historical market depth.&lt;/p&gt;&#xA;" OwnerUserId="807" LastActivityDate="2012-03-30T22:43:36.033" Title="Inferring highest bid and lowest ask from forex trade data" Tags="&lt;fx&gt;&lt;history&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3151" PostTypeId="2" ParentId="3150" CreationDate="2012-03-30T22:43:36.033" Score="3" Body="&lt;p&gt;what you are trying to do is not recommended; especially in FX market. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;here is why:&#xA;- The spread changes depending on time of day and trading venue.&#xA;- FX market is based on quotes. What you see is not what you get. This also depends on the broker you are using. &#xA;- FX market changes all the time; hence the spread today; may be different than same day last year. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suggest you gather statistics on the spread variance; and use the worst case scenario as a fix spread for all your data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You cannot infer the volume in FX market. It also depends on time of day; and all the stuff listed above.&lt;/p&gt;&#xA;" OwnerUserId="2232" LastActivityDate="2012-03-30T22:43:36.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3152" PostTypeId="2" ParentId="175" CreationDate="2012-03-30T22:47:47.243" Score="0" Body="&lt;p&gt;there could be a simple answer;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;observe the drawdown in backtesting results; double it to get a conservative estimate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if your model has exceed the theoritical drawdown; well; your strategy is breaking up with you.&lt;/p&gt;&#xA;" OwnerUserId="2232" LastActivityDate="2012-03-30T22:47:47.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3153" PostTypeId="2" ParentId="306" CreationDate="2012-03-30T23:18:56.940" Score="4" Body="&lt;p&gt;Java is the king!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i have done both C++ and Java. I have met two crowds:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;C++ gurus who turned Java Gurus: they all admitted that after knowing Java; they will never go back to C++ again. Although their code in Java was a bit clumpsy..:)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;C++ gurus who don't know Java; and don't want to know about it&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I personaly will never ever ever do C++ again. &lt;/p&gt;&#xA;" OwnerUserId="2232" LastActivityDate="2012-03-30T23:18:56.940" CommentCount="2" CommunityOwnedDate="2012-03-30T23:18:56.940" ContentLicense="CC BY-SA 3.0" />
  <row Id="3154" PostTypeId="1" CreationDate="2012-03-31T19:36:33.733" Score="6" ViewCount="223" Body="&lt;p&gt;A company's earnings release date significantly affects weekly or monthly option prices/implied volatility.   For companies that typically release earnings on the cusp of monthly options expiration, either a few days before expiration or a few days after, it would appear the day that the earnings release date is announced, may itself significantly affect monthly option prices.  (AAPL is an example of such a company, sometimes releasing before monthly options expire, and sometimes releasing after monthly options expire.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions are:  1) am I correct in this assertion, that the day a &quot;cusp company&quot; announces its earnings release date, can significantly affect option prices either that day or in the coming week or two, particularly if the &quot;market&quot; has guessed wrong about when the earnings release date will be?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) What factors go into a company such as this (on the cusp) picking the day it will release earnings.  Is it merely a function of work load, or are other factors involved?  More specifically, how might one gauge whether a company such as this (e.g. AAPL) will release earnings before monthly expiration or after.&lt;/p&gt;&#xA;" OwnerUserId="1675" LastEditorUserId="1675" LastEditDate="2012-04-02T03:25:00.390" LastActivityDate="2012-04-02T03:25:00.390" Title="How companies choose earnings release dates, &amp; effect on Implied Volatility" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;corporate-actions&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3155" PostTypeId="1" AcceptedAnswerId="3157" CreationDate="2012-03-31T23:42:00.217" Score="16" ViewCount="927" Body="&lt;p&gt;Here's an example by Marco Avellenada from NYU titled &quot;&lt;a href=&quot;http://www.math.nyu.edu/faculty/avellane/AvellanedaLeeStatArb20090616.pdf&quot;&gt;Statistical Arbitrage in the U.S. Equities Market&lt;/a&gt;&quot;. The idea of this paper involves capturing mean reversion in the residual returns of a security after removing the principle components of return. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As another example, here is some research by Mark Kritzman showing how spikes in the &quot;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1633027&quot;&gt;absorption rate&lt;/a&gt;&quot; are associated with drawdowns in the US equity market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder if there are other strategies involving the eigenportfolios or behavior of principal components other than the dominant eigenvector (i.e. the market portfolio) and non-random eigenvectors.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-04-01T16:52:01.170" LastActivityDate="2013-02-25T12:31:25.867" Title="What are some research articles on using principle components to generate alpha?" Tags="&lt;statistics&gt;&lt;modeling&gt;&lt;random-matrix-theory&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="16" ContentLicense="CC BY-SA 3.0" />
  <row Id="3156" PostTypeId="1" CreationDate="2012-04-01T08:23:20.013" Score="47" ViewCount="48507" Body="&lt;p&gt;thanks a lot for your discussions on the original post.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;following your suggestions, let me re-phrase a bit :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;kdb is known for its efficiency, and such efficiency comes at a terrible price. However, with computational power so cheap this days, there must be a sweet spot where we can achieve a comparable efficiency of data manipulation, at a more reasonable cost.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, if a KDB license cost a small shop $200K per year (I dont know how much it actually cost, do you know?), maybe there is a substitute solution: e.g., we pay 50K to build a decent cluster, storing all data onto a network file system, and parallelize all the data queries. This solution might not be as fast or as elegant as KDB, but it would be much more affordable and most important -- you take full control of it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;what do you think? is there anything like this?&lt;/p&gt;&#xA;" OwnerUserId="2235" LastEditorUserId="467" LastEditDate="2012-04-08T20:04:09.340" LastActivityDate="2021-05-13T13:40:09.617" Title="Is there any thing out there as a substitute for KDB?" Tags="&lt;programming&gt;&lt;database&gt;" AnswerCount="18" CommentCount="4" FavoriteCount="42" ContentLicense="CC BY-SA 3.0" />
  <row Id="3157" PostTypeId="2" ParentId="3155" CreationDate="2012-04-01T09:40:02.087" Score="9" Body="&lt;p&gt;Attilio Meucci does some very interesting things with PCA. See e.g. his paper on managing diversification which makes heavy use of it (and explains it very intuitively along the way):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1358533&quot;&gt;Managing Diversification by Attilio Meucci&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2012-04-01T09:40:02.087" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3158" PostTypeId="1" CreationDate="2012-04-01T16:03:05.553" Score="8" ViewCount="3867" Body="&lt;p&gt;I believe that most of us will agree that being able to compute values is only part of our job, as we would also like to be able to display them nicely in order to better understand or help co-workers/clients understand some concepts or results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We usually try to do this using charts, most of the time from MATLAB and R during development phase, but the charting libraries do not allow you easily to modify the chart after it has been created.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been occasionally using the Bloomberg Charting interface, and I must say I think it is particularly brilliant, as it allows you to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Zoom and scroll&lt;/li&gt;&#xA;&lt;li&gt;Add vertical/horizontal/... lines&lt;/li&gt;&#xA;&lt;li&gt;Compute performances between points&lt;/li&gt;&#xA;&lt;li&gt;Add technical indicators&lt;/li&gt;&#xA;&lt;li&gt;Possibility to export the graph to the clipboard&lt;/li&gt;&#xA;&lt;li&gt;And so on.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Most of the charting libraries I have been able to find so far for .Net only have a few of this features, but almost none allow the users to add/remove graphical elements from the cart easily.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering if somebody knew a good charting API which provides a control with which the user can interact extensively (like in Bloomberg) once the data is displayed?&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2014-08-06T04:30:49.643" Title="Is there a charting API which allows to replicate Bloomberg chart tool features?" Tags="&lt;programming&gt;&lt;visualization&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3159" PostTypeId="1" CreationDate="2012-04-01T17:38:20.680" Score="9" ViewCount="1290" Body="&lt;p&gt;in june 2009, GM has filed for bankruptcy. trading has moved from NYSE to OTC pink sheets, and the symbol changed to GMGMQ and later to MTLQQ. in november 2010 a new GM symbol started trading on NYSE. i am looking for the regulations regarding stock symbol reuse in the US. is there a minimum time that the symbol has to be out of use before it can be reused?&lt;/p&gt;&#xA;" OwnerUserId="1948" LastActivityDate="2012-04-02T13:26:55.427" Title="looking for regulations regarding stock symbol reuse in the US" Tags="&lt;equities&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3163" PostTypeId="1" CreationDate="2012-04-02T04:54:13.820" Score="5" ViewCount="2864" Body="&lt;p&gt;I have been trading for decades, and I have a solid knowledge of technical analysis but also VB as professional programmer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to start learning C++ from scratch, then specialised in C++ for quant. trading&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any hint about where to start from please ?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Learning C++ just enough to move to quant trading&lt;/li&gt;&#xA;&lt;li&gt;Learning C++ for quant trading&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2240" LastEditorUserId="467" LastEditDate="2012-04-02T06:57:10.173" LastActivityDate="2012-04-05T05:19:59.440" Title="C++ training from scratch to quantitative trading?" Tags="&lt;trading&gt;&lt;programming&gt;&lt;quantitative&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ClosedDate="2012-04-07T22:16:11.733" ContentLicense="CC BY-SA 3.0" />
  <row Id="3164" PostTypeId="2" ParentId="3163" CreationDate="2012-04-02T11:14:14.953" Score="6" Body="&lt;p&gt;&lt;strong&gt;C++&lt;/strong&gt;&lt;p&gt;&#xA;&lt;a href=&quot;http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html&quot;&gt;Think in C++&lt;/a&gt; can be a starting point. This is free. And, you might study &lt;strong&gt;Beginning Visual C++ 2010&lt;/strong&gt; by Ivan Horton&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;p&gt;&#xA;&lt;p&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Quantitative finance and C++&lt;/strong&gt; (if you are derivatives-oriented) &lt;p&gt;&#xA;You might find &lt;strong&gt;Mark Joshi&lt;/strong&gt; as well as &lt;strong&gt;Daniel Duffy&lt;/strong&gt;'s writings of (great) interest.&#xA;It is easy to find the references of both their books on a website such as Amazon.&#xA;You can also visit Mark Joshi's &lt;a href=&quot;http://www.markjoshi.com&quot;&gt;website&lt;/a&gt;, and Daniel Duffy's &lt;a href=&quot;http://www.datasimfinancial.com/&quot;&gt;one&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2220" LastEditorUserId="2220" LastEditDate="2012-04-02T11:20:48.547" LastActivityDate="2012-04-02T11:20:48.547" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3165" PostTypeId="2" ParentId="3159" CreationDate="2012-04-02T13:26:55.427" Score="5" Body="&lt;p&gt;I doubt it is regulated per se.  Tickers are part of the listing contract between a new entity and the primary listing exchange.  The exchange will seek to please the new client with a ticker they want, while also trying to please its existing members by assigning tickers in a logical, mnemonic way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since both the revitalized company and the markets expected a re-use of the &lt;strong&gt;GM&lt;/strong&gt; ticker, that's what happened.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-04-02T13:26:55.427" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3166" PostTypeId="2" ParentId="3155" CreationDate="2012-04-02T15:36:13.493" Score="4" Body="&lt;p&gt;If you know R; here is a very good tutorial with practical examples:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://zoonek2.free.fr/UNIX/48_R/05.html&quot; rel=&quot;nofollow&quot;&gt;http://zoonek2.free.fr/UNIX/48_R/05.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2232" LastActivityDate="2012-04-02T15:36:13.493" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3167" PostTypeId="2" ParentId="325" CreationDate="2012-04-02T15:38:49.980" Score="-3" Body="&lt;p&gt;IMHO, IB is one of the best retail brokers for HFT.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is indeed perhaps the only one that retail traders can use because:&#xA;- they provide an easy to use API to trade automatically.&#xA;- commissions are very competitive. I haven't found a cheaper broker then them&#xA;- IB is owned by HFT firm; and they seem to know what they are doing!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have not found any subtitute to them yet!!!!&lt;/p&gt;&#xA;" OwnerUserId="2232" LastActivityDate="2012-04-02T15:38:49.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3168" PostTypeId="2" ParentId="3158" CreationDate="2012-04-02T15:43:24.500" Score="3" Body="&lt;p&gt;if you are dealing with FX data only; i have found MetaTrader to be the best.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;my automated trading system is built in Java; and I output data files to MT4 folder; that get picked up automatically by a custom indicator that I have built; which simply reads the data file and plot it on the currency pair that I am viewing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;MT4 charts are extremely fast; zooming in and out; and you can literally plot anything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recent version of MT4 has new fancy features.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I trick MT4 to show charts for other symbols (that are not FX related) by drawing them in a separate window; on top of existing FX pair. simply minimize the FX pair chart; and view the other windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am interested if anyone here have a better suggestion.&lt;/p&gt;&#xA;" OwnerUserId="2232" LastActivityDate="2012-04-02T15:43:24.500" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3169" PostTypeId="2" ParentId="3156" CreationDate="2012-04-02T15:51:52.383" Score="11" Body="&lt;p&gt;KDB is useful for two reasons:&#xA;- Storage of data; and easy access to the data (i.e. querying ticks..etc)&#xA;- Rich query language that supports many Quant functions&lt;/p&gt;&#xA;&#xA;&lt;p&gt;however; what KDB does not do well; is the quant query language.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have evaluated KDB, Matlab, and R. So far R is the winner. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have not found any fast solution for storing and retrieving data; compared to using flat binary files; which are divided by month for ease of acces. My app can read 1 million of tick data in 3 seconds; and do backtesting accordingly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;for retail traders; i suggest you use flat files (binary instead of text; for quick read/write). MT4 data structure is a good example to follow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is cheap, free, and fast!!!&lt;/p&gt;&#xA;" OwnerUserId="2232" LastActivityDate="2012-04-02T15:51:52.383" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="3170" PostTypeId="2" ParentId="3133" CreationDate="2012-04-02T15:55:50.270" Score="4" Body="&lt;p&gt;Mathematically speaking that is an impossible thing to do. There are simply too many variables and randomness that you cannot do it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rather than analyzing competitors trade data; why don't you analyze the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can consider every bar; as a trade. If the bar was up; it means you went long and made a profit. If the bar was down; it means you went short and made a profit.&lt;/p&gt;&#xA;" OwnerUserId="2232" LastActivityDate="2012-04-02T15:55:50.270" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3171" PostTypeId="2" ParentId="3110" CreationDate="2012-04-02T16:04:09.747" Score="2" Body="&lt;ul&gt;&#xA;&lt;li&gt;Depends if your trading strategy requires co-location; based on speed of execution and latency. i.e. if your strategy is market data event driven; then yes; you do need to be co-located&lt;/li&gt;&#xA;&lt;li&gt;Co-location vs close proximity. &lt;/li&gt;&#xA;&lt;li&gt;Cost. Co-location usually more expensive than close proximity&lt;/li&gt;&#xA;&lt;li&gt;Services provided. i.e.; if your host provider have a market data API that you understand; it might be the only choice&lt;/li&gt;&#xA;&lt;li&gt;HFT strategies rely heavily on Market data. If you are trading on multiple exchanges; the chances that you colocated close to one exchange but not the others!&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;At the end of the day; it is all about cost. If colocating will make you 50% more money; then it is worth it. If you are going to make only 10% extra; it may not be worth it.&lt;/p&gt;&#xA;" OwnerUserId="2232" LastActivityDate="2012-04-02T16:04:09.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3172" PostTypeId="2" ParentId="613" CreationDate="2012-04-03T00:11:00.017" Score="3" Body="&lt;p&gt;Best is to learn from other software packages that have been in business for a while.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The common data structure is to store it in rows; each row contains: Date (as long), OHLC, Volume.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This way you will avoid human errors; or software bugs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The worst nightmare is to have look ahead bias in your data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the following software packages uses the above:&#xA;- R&#xA;- Tradestation&#xA;- MetaTrader&#xA;- MetaStocks&#xA;...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I personally store the data as above; in a binary file (not text file). reading from binary files is much faster; as the size of the file is much smaller compared to CSV.&lt;/p&gt;&#xA;" OwnerUserId="2232" LastActivityDate="2012-04-03T00:11:00.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3173" PostTypeId="1" CreationDate="2012-04-03T03:23:33.923" Score="14" ViewCount="1221" Body="&lt;p&gt;Let's say I am performing mean-variance optimization subject to some weight constraints.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to identify the set of corner portfolios so that I can interpolate the entire efficient frontier. A corner portfolio defines a segment on the minimum-variance frontier within which i) portfolios hold identical assets, and ii) the rate of change of asset weights in moving from one portfolio to another is constant. Incidentally, The Global Minimum Variance portfolio is a corner portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any convex combination of two adjacent corner portfolios is also a portfolio on the efficient frontier. So these corner portfolios can drastically improve the performance of tracing out the frontier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there tools in R to identify the corner portfolios, or a research paper on an efficient algorithm to identify the portfolios? Markowitz himself introduced the critical line algorithm, however, I recall Sharpe and others have some approaches as well. R or matrix calculus approaches are preferred but I'll take research citations as well.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-04-03T15:26:07.987" LastActivityDate="2015-03-08T11:21:41.780" Title="Are there any tools or useful algos for identifying corner portfolios?" Tags="&lt;portfolio-management&gt;&lt;r&gt;&lt;portfolio&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="3174" PostTypeId="1" AcceptedAnswerId="3187" CreationDate="2012-04-03T07:10:28.420" Score="4" ViewCount="1780" Body="&lt;p&gt;Currently, I have history data for 10 years. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most of the time, I only interested in getting EMA/ MACD for the last history point (means yesterday point). Instead of using entire 10 years history, I would only like to provide N data points, for fast calculation, yet get a reasonable accurate EMA. Currently, here is the way for me to determine how many N data.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;9 days SMA lookback = 8&#xA;9 days EMA lookback = 8&#xA;9 days 12/26 MACD lookback = 33&#xA;&#xA;final int scale = 2;&#xA;startIndex = historyDataSize - ((lookback + 1) * scale);&#xA;for (int i = startIndex; i &amp;lt; historyDataSize; i++) {&#xA;    // ...&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know I can further increase &lt;code&gt;scale&lt;/code&gt; to get a reasonable good EMA/ MACD outcome. The question is, how large I should increase, for fast calculation purpose, yet reasonable accurate?&lt;/p&gt;&#xA;" OwnerUserId="2244" LastActivityDate="2012-04-05T03:10:40.367" Title="What is the minimum history data size to get an accurate EMA/ MACD for latest history point" Tags="&lt;technicals&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3175" PostTypeId="1" AcceptedAnswerId="3176" CreationDate="2012-04-03T08:40:40.363" Score="5" ViewCount="238" Body="&lt;p&gt;&lt;em&gt;Please note: I posted this in nuclearphynance first, but didn't get any replies.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For desks which sell exotics it is common practice (as far as I know it) to calibrate the model (Stochastic Volatility, etc...) using implied vols of the plain vanillas. This seems totally fine as these are usually the hedging instruments.&#xA;But what is market standard for pricing plain vanillas? Is there anything else than estimating the hedging cost (historically)? How is this usually done? If a bank sells plain vanillas and underestimates the future vol, they'll get a problem, won't they?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above was meant as an example to a more general problem on which I'd like to find/read some survey paper/opinion (didn't find much yet): Platen writes in his paper (&quot;Alternative Defaultable Term Structure Models&quot;) the following: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;One can say that risk-neutral pricing is a kind of relative pricing. As soon as&#xA;some market participant places some derivative price in the market, others can&#xA;use it to calibrate their risk-neutral model and form consistent prices for fur-&#xA;ther derivatives. This does not prevent a development where over long periods&#xA;of time such prices can be way out from what may be realistically sustainable,&#xA;as observed prior to the recent subprime crisis.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This coincides with my first remark. What is the general problem of using historical data/economic estimates in a risk neutral model framework? As I see it, if real world expectations like default intensities are used for pricing the hedging instruments correctly, his argument should be pointless. Still, if you have a totally wrong opinion on how things evolve (say AIG on credit), you'll get into trouble.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for sharing your opinion!&lt;/p&gt;&#xA;" OwnerUserId="2217" LastActivityDate="2012-04-03T15:30:50.497" Title="Parameter estimation using martingale measures - include real world data?" Tags="&lt;option-pricing&gt;&lt;optimization&gt;&lt;numerical-methods&gt;&lt;martingale&gt;&lt;calibration&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3176" PostTypeId="2" ParentId="3175" CreationDate="2012-04-03T15:30:50.497" Score="1" Body="&lt;p&gt;In reality, you needn't bring exotics into consideration to think about this issue.  Consider the case of a shop that has fundamental analysts but also trades options on those equities.  The fact that the fundamental analysts trade stocks means they think those prices are somehow &quot;wrong&quot;.  So of course it seems from their point of view that the options traders are working off poor assumptions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, to the options traders, all that is really necessary is that the dynamics of the hedging instruments follow the model sufficiently well for the hedge ratios to work, regardless of direction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now consider your exotics book.  The vanilla hedging instruments need not have the &quot;right&quot; volatility for the book to make money, but any changes in their volatility had better follow the dynamics specified by the model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the model only has deterministic volatility, then a good manager will neutralize vega (vol sensitivity) in the portfolio as a whole, in order to avoid PL swings due to circumstances outside his trading writ.   The same is true in credit, though in that case the neutralization is necessarily far more approximate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice there are relatively few such &quot;good managers&quot;, and zillions of traders have gotten promotions and big bonuses because their portfolio had the right emergent exposure at the right time.  It's nice to gamble with the house's money.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-04-03T15:30:50.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3177" PostTypeId="1" CreationDate="2012-03-22T13:21:34.877" Score="4" ViewCount="1425" Body="&lt;p&gt;Was hoping somebody could help me with the following question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Prove that under the &lt;em&gt;risk-neutral probability&lt;/em&gt; $\tilde{\mathsf P}$ the &lt;em&gt;stock&lt;/em&gt; and the &lt;em&gt;bank account&lt;/em&gt; have the same average rate of growth. In other words, if $S_0$ and $S_N$ are the initial and final stock prices, and $B_0$ and $B_N$ the initial and final bank prices, show that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;\tilde{\mathsf E}\left[\frac{S_N}{S_0}\right]=\tilde{\mathsf E}\left[\frac{B_N}{B_0}\right]=c&#xD;&#xA;$$&#xA;and find the constant c.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that the risk neutral (or non risk neutral) expectation of the bank account will simply be $B_N/B_0$, as the expectation of any bank related investment will simply be the same as whatever is in the bracket (there is no uncertainty in the bank). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I know $B_N=B_0(1+r)^N$ ($B_N$ is equal to initial investment multiplied by interest rate to the power $N$), So I can simplify &#xA;$$&#xD;&#xA;\tilde{\mathsf E}\left[\frac{B_N}{B_0}\right]= B_N/B_0 = \frac{B_0(1+r)^N}{B_0}=(1+r)^N.&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem is trying to show that this is the case for the stock $\tilde{\mathsf E}\left[\frac{S_N}{S_0}\right] = (1+r)^N.$&#xA;As the stock is a martingale, I know I can say that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;S_0/(1+r)^0 = \text{(by multi step ahead property)} = \tilde{\mathsf E}\left[\frac{S_N}{S_0}\right]. &#xA;$$But I cannot work out what to do after this. I have found a way online that says this implies: $\tilde{\mathsf E}\left[\frac{S_N}{S_0}\right]=(1+r)^N$, but I cannot see how the previous statement implies this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would greatly appreciate any help.&lt;/p&gt;&#xA;" OwnerDisplayName="DFM" LastEditorUserId="467" LastEditDate="2012-04-03T19:33:32.227" LastActivityDate="2012-04-04T17:44:35.430" Title="Financial Mathematics - Martingales example" Tags="&lt;stochastic-calculus&gt;&lt;risk-neutral-measure&gt;" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3178" PostTypeId="2" ParentId="3174" CreationDate="2012-04-03T16:43:17.327" Score="2" Body="&lt;p&gt;You shouldn't recompute your EMA - just keep its old values, and apply your EMA formula to the last value to update.&lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2012-04-03T16:43:17.327" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3179" PostTypeId="2" ParentId="3158" CreationDate="2012-04-03T18:55:49.433" Score="3" Body="&lt;p&gt;Following on from alpha's answer, you might be able to use some of the ideas and tools described on &lt;a href=&quot;https://xmphforex.wordpress.com/2011/02/13/charting-mt4-quotes-in-r/&quot; rel=&quot;nofollow&quot;&gt;this blog&lt;/a&gt; to link R, and maybe also MATLAB/Octave, to the Metatrader platform to use the charting capabilities of Metatrader. Linked from this blog is &lt;a href=&quot;https://sites.google.com/site/prof7bit/r-for-metatrader-4&quot; rel=&quot;nofollow&quot;&gt;this page&lt;/a&gt; where there is a dll tool available, with downloadable open code, to call R directly from Metatrader, so presumably anything that can be calculated in R can be plotted in Metatrader.&lt;/p&gt;&#xA;" OwnerUserId="252" LastActivityDate="2012-04-03T18:55:49.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3180" PostTypeId="2" ParentId="3177" CreationDate="2012-04-03T19:44:08.287" Score="7" Body="&lt;p&gt;The classic argument using risk-neutral pricing is to assume that &lt;strong&gt;discounted&lt;/strong&gt; stock prices are $\tilde{P}$-martingales where $\tilde{P}$ is the risk-neutral probability measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, you know that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{S_t}{(1+r)^t}=\tilde{E}[\frac{S_T}{(1+r)^T} | \mathcal{F}_t]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;by definition of a martingale process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the discounts are non-stochastic, you can safely remove it from the expectation, and as $S_t$ is $\mathcal{F_t}$-measurable, you can also include it freely in the expectation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You then get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$(1+r)^{T-t}=\tilde{E}[\frac{S_T}{S_t} | \mathcal{F}_t]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With your setup $T=N$ and $t=0$ and you get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$(1+r)^{N}=\tilde{E}[\frac{S_N}{S_0} | \mathcal{F}_0]=\tilde{E}[\frac{S_N}{S_0}]$$&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2012-04-03T19:44:08.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3181" PostTypeId="2" ParentId="3133" CreationDate="2012-04-03T21:31:49.113" Score="2" Body="&lt;p&gt;Agree with the previous post, that it is very difficult to do, if not impossible. Having said that, I once saw a presentation on a (closed) project which was trying to use neural networks to train and form trading patterns. The group had access to a large lot of trading data and the profit (or losses) made from the trades over a certain time period (like, a year or so of data). They filtered that data to choose top few thousands trade streams (top as measured by profit at the end of the time period), and then used that as the training set. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not know the end result, so can't say if it was a successful project. Not to mention, I think, there are potential legal hazard in acquiring such trading streams, if they are available at all. But the idea is worth mentioning nevertheless.&lt;/p&gt;&#xA;" OwnerUserId="1442" LastEditorUserId="1442" LastEditDate="2012-04-03T23:02:23.120" LastActivityDate="2012-04-03T23:02:23.120" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3183" PostTypeId="2" ParentId="3144" CreationDate="2012-04-04T02:09:29.640" Score="4" Body="&lt;p&gt;There is a known expansion of &lt;em&gt;implied volatility&lt;/em&gt; in moments (I'll find the reference)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\textrm{IV} = \textrm{vol} * (1 + \frac{\textrm{skew}}{6} * \textrm{LMM} + \frac{\textrm{kurt}}{24}*(\textrm{LMM}^2-1))&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;em&gt;log-moneyness&lt;/em&gt; is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\textrm{LMM} = \frac{\log{\frac{\textrm{strike}}{\textrm{forward}}}}{\textrm{vol} * \sqrt{T}}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use VIX for vol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I remember correctly SKEW index is $100-100*\textrm{skew}$, so $\textrm{skew} = \frac{100-\textrm{SKEW}}{100}$.&#xA;Kurtosis is unknown, but you could try to use &lt;em&gt;VVIX&lt;/em&gt; index and re-scale it in some way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or maybe another way would be to take the equation and regress for multipliers for VIX, VIX*SKEW, and VIX*VVIX using IV smile data.&lt;/p&gt;&#xA;" OwnerUserId="185" LastEditorUserId="848" LastEditDate="2012-04-08T15:29:07.480" LastActivityDate="2012-04-08T15:29:07.480" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3184" PostTypeId="1" CreationDate="2012-04-04T03:49:54.410" Score="2" ViewCount="2722" Body="&lt;p&gt;I am currently using CQG for spread trading and have a spread trading strategy in CQG chart. I am trying to automate my spread trading strategy in CQG, but CQG told me to look at &lt;a href=&quot;http://www.cqg.com/Products/CQG-API/API-Samples.aspx&quot; rel=&quot;nofollow&quot;&gt;CQG API samples&lt;/a&gt; to build my own system or get third party software.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The CQG trade system doesn't allow you to automate your strategy in CQG IC. So, I need automated trading software to execute my strategy. CQG API should allow you to build your own execution system. Could you tell me which example in CQG API sample helps to start building a spread trading system? For example, buy A instrument and sell B instrument when the spread price goes below lower bollinger band, and put OCO limit order for stop loss and target exit. Would it be hard to make that kind of system using CQG's API?&lt;/p&gt;&#xA;" OwnerUserId="2248" LastEditorUserId="1106" LastEditDate="2012-08-03T14:39:43.893" LastActivityDate="2020-08-15T08:33:18.470" Title="How to build an execution trading system with CQG API?" Tags="&lt;automated-trading&gt;&lt;pairs-trading&gt;&lt;programming&gt;&lt;order-execution&gt;" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3185" PostTypeId="1" CreationDate="2012-04-04T14:20:00.460" Score="3" ViewCount="286" Body="&lt;p&gt;I'm not very well read in the area of high finance but I'm curious how forex brokerages are able to provide the backing for leverage that they can provide to customers. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to do this without charging interest, only making the return on the spread against the rates they can get?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there standard algorithms that can be used to this end?&lt;/p&gt;&#xA;" OwnerUserId="1017" LastActivityDate="2015-07-15T20:22:01.840" Title="what is a typical way forex brokerages can provide cheap leverage for their customers?" Tags="&lt;hedging&gt;&lt;fx&gt;&lt;market-making&gt;&lt;leverage&gt;" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3186" PostTypeId="2" ParentId="3177" CreationDate="2012-04-04T17:39:16.793" Score="0" Body="&lt;p&gt;$$&#xD;&#xA;\widetilde{E}[\frac{S_{N}}{S_{0}}]=\widetilde{E}[\frac{S_{N}}{S_{N-1}}\frac{S_{N-1}}{S_{N-2}}...\frac{S_{1}}{S_{0}}]=\widetilde{E}[\frac{S_{N}}{S_{N-1}}]\widetilde{E}[\frac{S_{N-1}}{S_{N-2}}]...\widetilde{E}[\frac{S_{1}}{S_{0}}]=(1+r)(1+r)...(1+r)=(1+r)^{N}&#xD;&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="2142" LastEditorUserId="2142" LastEditDate="2012-04-04T17:44:35.430" LastActivityDate="2012-04-04T17:44:35.430" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3187" PostTypeId="2" ParentId="3174" CreationDate="2012-04-05T03:10:40.367" Score="4" Body="&lt;p&gt;I implemented these algorithms just a few months ago! I would just double the number of data points that you need. If you need a 10 day EMA, take 20 data points. For the MACD, you need the EMA, so add them together then double it. Here is the algorithm including an Excel spreadsheet you can compare with:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:moving_averages&quot; rel=&quot;nofollow&quot;&gt;http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:moving_averages&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They claim on their charts to use 200+ days for accuracy, but remember that stock prices only have 2 decimals, and usually 4 significant digits, with a maximum of 4 decimals for penny stocks. So you wouldn't need anything more accurate than 2 decimals most of the time. Slippage would matter more! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to be super accurate, and have a dynamic 'scale' or 'lookback', you can calculate the indicator using increasing 'scale' or exponentially greater history samples (x2, x4, x8, ...) until the different between the final results is within 4 significant digits of each other. Then you would need no more accuracy. You could either do this every time or 'calibrate' it using maybe a year of data for the whole market, and take the average of your 'scale'.&lt;/p&gt;&#xA;" OwnerUserId="2139" LastActivityDate="2012-04-05T03:10:40.367" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3191" PostTypeId="1" CreationDate="2012-04-05T07:54:50.450" Score="7" ViewCount="599" Body="&lt;p&gt;Rating systems, as defined by the Basel II Accord, can be classified into two broad types - through-the-cycle (TTC) or point-in-time (PIT) - and the probability of default predicted by such a system can usually have different interpretations. In practice, no rating system is purely TTC or PIT.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One advantage of PIT systems are that they are easy to 'backtest' - if the PIT system predicts the 1 year probability of default, we can always &quot;score&quot; the obligors using the system 1 year back, and then compare the actual default rates against the predicted probability of default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since TTC systems predict the probability of default over different economic cycles, it is hard to backtest such a system as the realized default rates may not match with the probability depending on where we are in the economic cycle.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am having a hard time finding any existing research or literature on this topic. Most of them mention the standard measures like ROC, Gini, Accuracy Ratio, etc. which tells us whether the rating system can sufficiently differentiate the likelihood of default. However, this does not say if the probabilities output by the rating system make sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone point me out to any relevant research, books or documents which may help?&lt;/p&gt;&#xA;" OwnerUserId="2012" LastEditorUserId="467" LastEditDate="2012-04-05T08:11:12.083" LastActivityDate="2013-01-30T05:25:23.487" Title="Are there any well known methods of testing through-the-cycle rating systems?" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;default&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3192" PostTypeId="2" ParentId="1238" CreationDate="2012-04-05T09:24:37.500" Score="2" Body="&lt;p&gt;I recommend the book The Basel II Risk Parameters. This book is primarily a collection of articles on the development, validation and stress testing of the risk parameters. The good thing about this book is that it provides an overview of the methodologies used which should be easy to follow for an experienced credit risk professional. However, it does not cover each topic in great depth.&lt;/p&gt;&#xA;" OwnerUserId="2012" LastEditorUserId="70" LastEditDate="2012-04-05T17:00:14.680" LastActivityDate="2012-04-05T17:00:14.680" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3193" PostTypeId="2" ParentId="3158" CreationDate="2012-04-05T15:04:33.640" Score="3" Body="&lt;p&gt;I've been using &lt;a href=&quot;http://www.highcharts.com/products/highstock&quot; rel=&quot;nofollow&quot;&gt;HighStock&lt;/a&gt;, which produces very slick interactive charts with a relatively small amount of JavaScript.  Among other things, it can produce candlestick/OHLC charts with volume bars, take a look at the examples page.&lt;/p&gt;&#xA;" OwnerUserId="1039" LastActivityDate="2012-04-05T15:04:33.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3194" PostTypeId="2" ParentId="603" CreationDate="2012-04-05T15:37:59.483" Score="2" Body="&lt;p&gt;If you calculate a var swap using SPX term structure implied vol versus a GARCH(1,1) estimated on 2yrs of past prices, you may see the first 4-5 (non-weekly) expiries offer roughly constant premiums over realised (negative varswap value) which would suggest at least someone is pricing using GARCH in the market.&lt;/p&gt;&#xA;" OwnerUserId="2254" LastActivityDate="2012-04-05T15:37:59.483" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3196" PostTypeId="2" ParentId="1238" CreationDate="2012-04-06T01:59:01.953" Score="0" Body="&lt;p&gt;Take a look at the paper in the Journal of Finance - &quot;&lt;a href=&quot;http://www.iijournals.com/doi/abs/10.3905/jfi.2000.319253&quot; rel=&quot;nofollow&quot;&gt;On Default Correlation: A Coupula function approach&lt;/a&gt;&quot; and also their bibliography.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2012-04-06T01:59:01.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3197" PostTypeId="1" AcceptedAnswerId="3221" CreationDate="2012-04-06T07:08:28.653" Score="5" ViewCount="1279" Body="&lt;p&gt;Rho is the partial derivative of the value of call option, $C$, w.r.t the riskfree interest  rate $r$: $$\rho \equiv \frac{\partial C}{\partial r}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the standard B-S formula this term is positive, but &lt;strong&gt;what's the intuition&lt;/strong&gt;? I understand that two forces are at hand: one is that as $r$ increases future exercise price $K$ values less, so $C$ becomes more valuable. But on the other hand, increased $r$ also diminishes present value for future payoffs from the option, so $C$ becomes less valuable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Another question I'd like to know is how general could this result be for arbitrary distributions&lt;/strong&gt;? Since B-S formula is derived under certain assumptions about distributions of the price of the underlying asset (such as geometric Brownian motion with constant drift and volatility, etc). &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Edit: @Quant, I agree with you on BSM, for which the particular distribution of the underlying allows one to &lt;strong&gt;perfectly duplicate&lt;/strong&gt; the distribution of the call by shorting the riskfree bond and longing the underlying appropriately. But for arbitrary distributions, this may not be possible, so $C$ need not increase as $r_f$ increases. Consider a two period example: $S_0=1$, $S_1=1, 2, 4$ each with some strict positive probabilities (say $1/3, 1/3, 1/3$), strike price $K=3$ and gross riskfree rate $r_f=2$. In this case, no combination of $S$ and the bond would perfectly duplicate the call, and any $C \in (0,1/6)$ would be permissible. Hence an increase of $r_f$ need not increase the value of $C$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that only in binomial tree model (BSM being BTM in the limit) can we pin down the value of $C$ by no-arbitrage criterion alone.       &lt;/p&gt;&#xA;" OwnerUserId="2261" LastEditorUserId="2261" LastEditDate="2012-04-07T16:41:15.380" LastActivityDate="2012-04-10T13:05:46.283" Title="A few questions about signs of the Greek letters" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;arbitrage&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3199" PostTypeId="2" ParentId="3197" CreationDate="2012-04-06T11:44:48.703" Score="4" Body="&lt;p&gt;Here's the relationship of rho on calls and puts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you buy call options instead of the the underlying, you are effectively buying an indirect leveraged position in the underlying. A simple way to see this is buy re-arranging the terms of the Put-Call parity equation solving for the call price. The value of the call is equal to a synthetic position consisting of: i) long the underlying, ii) short a zero-coupon bond that matures at T with strike price K, and iii) long a put. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When interest rates are higher, buying the call instead of financing a direct leveraged position in the underlying is more attractive. Also, the investor by using call options saves more money by not paying for the underlying until a later date. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, for put options, the higher interest rates are are disadvantageous.  In this case, investors lose more interest while waiting to sell the underlying when using puts. Said another way, the opportunity cost of waiting is higher when interest rates are higher.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore the sign of rho is positive for calls, and negative for puts, although the effect is very weak especially compared to the impact of volatility on option prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These arguments hold true for arbitrary distributions (so long as interest rates are positive).&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-04-07T13:54:14.473" LastActivityDate="2012-04-07T13:54:14.473" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3201" PostTypeId="1" CreationDate="2012-04-06T14:17:42.997" Score="4" ViewCount="986" Body="&lt;p&gt;Say there is an American put option that expires $N$ months from today. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A call-on-put (CoP) option provides the owner the right to buy the American put option in exactly $M &amp;lt; N$ months (but no sooner). A corresponding put-on-put (PoP) option provides the owner the right to sell the American put option in exactly $M &amp;lt; N$ months (but no sooner).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the underlying option is American and the compound on top (PoP or CoP) is of European style.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now for usual single European options, the put-call parity holds and for single American options the put-call parity does not hold.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the compound option depends on an underlying American option, does this mean that the put-call parity does not hold for the compound option?&lt;/p&gt;&#xA;" OwnerUserId="2263" LastEditorUserId="467" LastEditDate="2012-04-06T15:46:22.653" LastActivityDate="2012-04-10T12:58:39.680" Title="Does put-call parity hold for a compound option with underlying American option?" Tags="&lt;options&gt;&lt;put-call-parity&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3202" PostTypeId="2" ParentId="3201" CreationDate="2012-04-06T16:01:15.963" Score="3" Body="&lt;p&gt;Put-call parity is a model free relationship, i.e. it makes no assumptions regarding the underlying. The underlying can be any trade-able asset. So it should hold in your case.&lt;/p&gt;&#xA;" OwnerUserId="370" LastActivityDate="2012-04-06T16:01:15.963" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3203" PostTypeId="2" ParentId="3133" CreationDate="2012-04-06T21:01:14.207" Score="2" Body="&lt;p&gt;This paper by R. Marschinski and H. Kantz may be able to help: &quot;&lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S0378437101001327&quot; rel=&quot;nofollow&quot;&gt;Learning the Optimal Trading Strategy&lt;/a&gt;&quot;. I have not read it but the authors have published other work which is quite innovative.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Within a realistic model of the stockmarket, we derive the most&#xA;  successful trading strategy. We first identify the agent who has&#xA;  realized the largest percentual gain and then analyze all the&#xA;  operations this trader has performed during the simulation run. We&#xA;  report them in a proper trading space and we extend the model,&#xA;  introducing an additional operator acting with the help of a look up&#xA;  table derived from a clusterization of space. We discuss the&#xA;  robustness of this optimal strategy, its performance and the&#xA;  applicability to real markets.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2012-04-06T21:01:14.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3205" PostTypeId="1" AcceptedAnswerId="3206" CreationDate="2012-04-07T16:17:34.613" Score="10" ViewCount="9304" Body="&lt;p&gt;The Black-scholes formula typically has time as $\sqrt{T-t}$ or some such. My questions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;What is the granularity of this? If we treat $t$ as the number of days, then logically on the day of expiry, d&lt;sub&gt;1&lt;/sub&gt; would involve division by zero.&lt;/li&gt;&#xA;&lt;li&gt;Given that $t$ is the number of days in the year, what value should we divide it by? 252 or 365? It is that important? It it worth using quantlib to take account of various calendars?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1217" LastEditorUserId="467" LastEditDate="2012-04-07T18:14:40.123" LastActivityDate="2017-07-05T21:45:37.437" Title="Ways of treating time in the BS formula" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3206" PostTypeId="2" ParentId="3205" CreationDate="2012-04-07T17:21:22.857" Score="12" Body="&lt;p&gt;Two quick points:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Recall that the derivation involves continuous time and $(t, t+\Delta t)$ arguments---so the granularity is (at the margin) infinite.  And hence time zero does not really get reached until we actually are at expiry.  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Generally speaking want the number of &lt;em&gt;business&lt;/em&gt; days, not calendar days, and holidays do matter. So one generally uses the 'number of trading days til expiry / 252'.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Here is a quick example moving maturity from 1 year to 0.9975 years &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;R&amp;gt; library('RQuantLib')&#xA;R&amp;gt; EuropeanOption(&quot;call&quot;, 100, 100, 0.01, 0.03, 1, 0.4)&#xA;Concise summary of valuation for EuropeanOption &#xA;   value    delta    gamma     vega    theta      rho   divRho &#xA; 16.5382   0.5927   0.0096  38.2821  -8.3458  42.7367 -59.2749 &#xA;R&amp;gt; EuropeanOption(&quot;call&quot;, 100, 100, 0.01, 0.03, 0.9975, 0.4)&#xA;Concise summary of valuation for EuropeanOption &#xA;   value    delta    gamma     vega    theta      rho   divRho &#xA; 16.5150   0.5926   0.0096  38.2332  -8.3578  42.6295 -59.0986 &#xA;R&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="69" LastEditorUserId="2183" LastEditDate="2017-07-05T21:45:37.437" LastActivityDate="2017-07-05T21:45:37.437" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3207" PostTypeId="2" ParentId="3205" CreationDate="2012-04-07T18:13:23.933" Score="3" Body="&lt;p&gt;If you assume a daily time step, then the day of expiry,the value of the option (a call in the following example) is &lt;strong&gt;known&lt;/strong&gt;, by definition:&#xA;$$C_T = (S_T - K)^+$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;About the number of days you want to use, keep in mind that you use the underlying BS assumptions that the underlying asset's prices are log-normally distributed, that is, that its return are normally distributed. This is highly unlikely when you consider business days values, and I believe it would be even more unlikely taking into account days where prices do not change (holidays).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I suggest you to use the 252 days convention. Note that if you choose not to take into account bank holidays, you should not include them in the data sample from which you estimate your daily volatility $\sigma$.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2012-04-08T08:21:15.907" LastActivityDate="2012-04-08T08:21:15.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3208" PostTypeId="2" ParentId="3205" CreationDate="2012-04-07T21:59:49.053" Score="4" Body="&lt;p&gt;For a scholar example, one shall use 250 or 252 days.&lt;p&gt;&#xA;As you noticed &lt;strong&gt;Dmitri&lt;/strong&gt;, the &lt;strong&gt;Quantlib&lt;/strong&gt; library includes a series of calendars.&lt;p&gt;&#xA;These classes are based on various well-known financial markets conventions, such as &lt;strong&gt;Actual365&lt;/strong&gt; and &lt;strong&gt;ISDA&lt;/strong&gt;.&lt;p&gt;&#xA;You might be interested in the following webpage: &lt;a href=&quot;http://quantlib.org/marketconventions.shtml&quot; rel=&quot;nofollow&quot;&gt;http://quantlib.org/marketconventions.shtml&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="2220" LastActivityDate="2012-04-07T21:59:49.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3209" PostTypeId="2" ParentId="3156" CreationDate="2012-04-07T22:26:56.570" Score="20" Body="&lt;p&gt;At discretelogics we just released a file format to store time series in flat files called &quot;&lt;strong&gt;TeaFiles&lt;/strong&gt;&quot;. In addition to raw data they can store the binary item layout and a description of the contents.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;C#, C++, Python APIs are available open source, licensed under the GPL, see&#xA;&lt;a href=&quot;http://discretelogics.com/teafiles&quot;&gt;discretelogics.com/teafiles/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using memory mapping, read performance reaches that of in-memory array processing for sequential usage of a file, as is the case for back testing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The C# API at Codeplex holds micro benchmarks. Summing up a file with a single 8 byte double reaches 500 million operations per second on an older test machine. Using a Tick Item with int64 / double / int for Time/Price/Volume is 100 million operations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Disclosure: self promotion + interest in discussing time series persistence&lt;/p&gt;&#xA;" OwnerUserId="1854" LastEditorUserId="1854" LastEditDate="2014-06-23T19:46:28.683" LastActivityDate="2014-06-23T19:46:28.683" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3210" PostTypeId="1" AcceptedAnswerId="3213" CreationDate="2012-04-08T09:17:56.767" Score="10" ViewCount="2941" Body="&lt;p&gt;This is a follow up question of &lt;a href=&quot;https://quant.stackexchange.com/questions/3144/constructing-an-approximation-of-the-sp-500-volatility-smile-with-publicly-avai&quot;&gt;this one&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My aim is to create the most realistic historical option prices possible with publicly available data. I want to do this for backtesting purposes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following paper gives a good master plan how to backtest option strategies with the standard Black Scholes formula. If you use the publicly available implied volatility indices (like &lt;a href=&quot;http://finance.yahoo.com/q/hp?s=%5EVIX%20Historical%20Prices&quot; rel=&quot;nofollow noreferrer&quot;&gt;VIX&lt;/a&gt;) for the vol parameter the results are pretty good for ATM options:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://oldleeds.colorado.edu/asset/burridge/backtestmadoffsclaims.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;How Students Can Backtest Madoﬀ’s Claims by Michael J. Stutzer (2009)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Problems arise when you want to backtest strategies with (deep) ITM or OTM options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question is:&lt;/strong&gt;&lt;br&gt;How can you produce even better historical option prices (for S&amp;amp;P 500 index options) with corrections for the smile with other &lt;a href=&quot;http://www.cboe.com/micro/IndexSites.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;publicly available data&lt;/a&gt; like &lt;a href=&quot;http://www.cboe.com/micro/skew/introduction.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;SKEW&lt;/a&gt; and &lt;a href=&quot;http://www.cboe.com/micro/VVIX/default.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;VVIX&lt;/a&gt;?&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="19645" LastEditDate="2021-05-05T08:45:29.667" LastActivityDate="2021-05-05T08:45:29.667" Title="How to calculate the most realistic historical option prices with additional publicly available parameters" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;backtesting&gt;&lt;option-strategies&gt;&lt;volatility-smile&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3211" PostTypeId="2" ParentId="3210" CreationDate="2012-04-08T12:22:54.333" Score="-1" Body="&lt;p&gt;Volatility is one of the inputs in the original &lt;strong&gt;Black-Scholes&lt;/strong&gt; formula. If the VIX index tells you much on the volatility to plug into your pricer for the estimation of the value of the options on the S&amp;amp;P500. Good for you!&lt;p&gt;&#xA;Now, one has to recall that &lt;strong&gt;Black-Scholes&lt;/strong&gt; world assumes &lt;strong&gt;log-normality&lt;/strong&gt; of the underlying as well as &lt;strong&gt;constant volatility&lt;/strong&gt;. From that, it is clear you have to resort on an extended version of the original &lt;strong&gt;Black-Scholes&lt;/strong&gt; framework for the corrections you wish.&lt;/p&gt;&#xA;" OwnerUserId="2220" LastActivityDate="2012-04-08T12:22:54.333" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3212" PostTypeId="2" ParentId="1150" CreationDate="2012-04-08T22:11:00.640" Score="24" Body="&lt;p&gt;The Black-Scholes 'normal-vol' formula leads quickly to a similar approximation to the one described by olaker.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Click &lt;a href=&quot;http://www.math.nyu.edu/phd_students/iwasawa/normal.pdf&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt; for a paper which contains a formal derivation of the call and put prices based on a normal model (ie a brownian motion rather than a geometric brownian motion).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The formula for the call price is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Call} = (F-K)N(d_1) + \frac{\sigma&#xA;\sqrt{T-t}}{\sqrt{2 \pi}} e^{-\frac{1}{2} d_1^2},$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d_1 = \frac{F-K}{\sigma\sqrt{T-t}}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW, I work in fixed income, so I always tend to write a version that is suitable for swaptions.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Options which are ATM&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;You can see that for $F=K$ this becomes $\text{ATMCall} = \frac{\sigma \sqrt{T-t}}{\sqrt{2 \pi}} \approx 0.4 \, \sigma \, \sqrt{T-t}$.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Options which are not ATM&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I have recently discovered a generalization of this formula which works very well for strikes which are not at the money too. See my &lt;a href=&quot;http://www.fermatslastspreadsheet.com/&quot; rel=&quot;noreferrer&quot;&gt;blog&lt;/a&gt; for a longer discussion, here are the main points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The standard decomposition for an option is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Option value} = \text{Intrinsic value} + \text{Time value}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the Black-Scholes normal formula above, if you investigate the term $(F-K)N(d_1)$ in a spreadsheet, you’ll see that for small levels of volatility and maturity (try, for example, $\sigma=0.0025$, Maturity=1) it is actually quite close to $\max(0,F-K)$ – which is the intrinsic value of the call.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consequently, the BS normal formula is &lt;em&gt;almost&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Call Price} = \text{Intrinsic Value} + \text{ATMPrice} \times e^{-\frac{1}{2} d_1^2},$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{ATMPrice} = \frac{\sigma \sqrt{T-t}}{\sqrt{2 \pi}}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if you compare this approximation to the true BS formula in a spreadsheet, you’ll see that around the strike (especially for larger values of $\sigma$) it gives too much value to the call: basically the term $\text{ATMPrice} \times e^{-\frac{1}{2}d_1^2}$, is too big when $d_1$ is non-zero and small. This is telling us that the difference between $(F-K)N(d_1)$ and $\max(0,F-K)$ gets important near the strike. As I say, have a look in a spreadsheet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nonetheless, this simple-but-wrong formula for the Call Price points us in the right direction: it shows that the time value of the option should be written &lt;em&gt;in terms of the price of the ATM option&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I call it &lt;em&gt;The Hardy Decomposition&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Call Price} = \text{Intrinsic Value} + \text{ATMPrice}\times\text{HardyFactor}$$&#xA;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{HardyFactor} = e^{-\frac{1}{2} d_1^2} + \frac{d_1}{0.4}N(d_1) – \max(\frac{d_1}{0.4},0).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far this is just a rearrangement of the original Black-Scholes 'normal-vol' formula.&#xA;The key result is that the $\text{HardyFactor}$ is well approximated by a simple expression:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{HardyFactor} \approx (1- 0.41 |d_1|) e^{-|d_1|}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you can actually use the following as a pretty-good approximation for call prices:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Call Price} = \text{Intrinsic Value} + \text{ATMPrice}\times (1- 0.41 |d_1|) e^{-|d_1|}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A similar result holds for put options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use this &lt;em&gt;Hardy Decomposition&lt;/em&gt; to calculate option prices in your head - you only need to remember a few values:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/M9ymm.png&quot; alt=&quot;Remember these few values&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="1920" LastEditorUserId="1920" LastEditDate="2012-09-07T20:57:50.497" LastActivityDate="2012-09-07T20:57:50.497" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3213" PostTypeId="2" ParentId="3210" CreationDate="2012-04-08T22:50:40.693" Score="5" Body="&lt;p&gt;I suggest you avoid using the VIX for implied vols. Why? One has to consider that the VIX is not simply solely dependant on the dynamics on the S&amp;amp;P 500 anymore because the VIX can be traded via options, etc. Thus many more parameters affect the trajectory of the VIX. The VIX has to equal the ATM option vol because this is where arbitrage assumption manifest; the price of a derivative on expiry has to be equal the spot price on the same date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you are back-testing, why can't you get the historical option prices and then calculate the implied vols (generate your volatility curve using inv) for your calculation?&lt;/p&gt;&#xA;" OwnerUserId="2179" LastEditorUserId="35" LastEditDate="2012-04-08T23:56:51.383" LastActivityDate="2012-04-08T23:56:51.383" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3214" PostTypeId="1" AcceptedAnswerId="3215" CreationDate="2012-04-09T13:08:12.787" Score="8" ViewCount="383" Body="&lt;p&gt;I want to experiment with some portfolio modelling and I was wondering if you guys could help me with something. If I try to estimate and implement the traditional two-fund portfolio consisting of one &quot;risk free&quot; and one risky asset, I will according to the theory end up with the following weight for the risky part of my portfolio:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;w^* =(μ-rf)/ λσ^2&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where lambda is the coefficient of risk aversion. My question is this: since my variance is inevitably gonna be a sample variance and thus have a bias equal to &#xA;$$&#xD;&#xA;-σ^2/T&#xD;&#xA;$$&#xA;How will this bias my weight and what should I do to correct for it?&lt;/p&gt;&#xA;" OwnerUserId="1128" LastEditorUserId="467" LastEditDate="2012-04-09T13:30:34.690" LastActivityDate="2012-04-09T14:56:58.333" Title="Do weights from portfolio theory contain bias?" Tags="&lt;modern-portfolio-theory&gt;&lt;variance&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3215" PostTypeId="2" ParentId="3214" CreationDate="2012-04-09T13:43:31.040" Score="13" Body="&lt;p&gt;Statistically you would apply &lt;a href=&quot;http://en.wikipedia.org/wiki/Bias_of_an_estimator&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bessel's correction&lt;/a&gt; to address the bias you point out.  However, that misses the point that the variance-covariance matrix is non-stationary, suffers from the curse of dimensionality, and that the noisy mean return estimates have significantly more impact than a biased covariance matrix on portfolio weights.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best ways to build a covariance matrix are to:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;build a multi-factor risk model (see &lt;a href=&quot;http://www.msci.com/products/portfolio_management_analytics/equity_models/&quot; rel=&quot;nofollow noreferrer&quot;&gt;BARRA&lt;/a&gt;, &lt;a href=&quot;http://www.axioma.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Axioma&lt;/a&gt;, &lt;a href=&quot;http://www.northinfo.com/documents/44.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Northfield&lt;/a&gt;, or &lt;a href=&quot;http://www.finanalytica.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Finanalytica&lt;/a&gt; literature for examples). There is quite a bit of nuance in building these properly (alpha and risk interactions, adjustments for out-of-sample bias, factor identification, errors-in-variables bias, etc.)&lt;/li&gt;&#xA;&lt;li&gt;cleanse the sample covariance matrix using &lt;a href=&quot;https://quant.stackexchange.com/questions/2763/one-dimensional-analog-of-cleansing-a-correlation-matrix-via-random-matrix-theor&quot;&gt;random matrix theory&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;estimate the matrix via some type of &lt;a href=&quot;http://faculty.fuqua.duke.edu/~charvey/Teaching/IntesaBci_2001/GS_Estimating_covariance_matrices.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;exponential weighting&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;use a &lt;a href=&quot;http://en.wikipedia.org/wiki/Shrinkage_estimator&quot; rel=&quot;nofollow noreferrer&quot;&gt;shrinkage estimate&lt;/a&gt; such as Ledoit and Wolf which blends the sample covariance with a prior (usually a constant covariance, constant correlation, or identity matrix)&lt;/li&gt;&#xA;&lt;li&gt;Or some combination of the above&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I would recommend taking a shrinkage approach as in Ledoit's aptly titled &quot;&lt;a href=&quot;http://www.ledoit.net/honey.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Honey I Shrunk the Covariance Matrix&lt;/a&gt;&quot; with a constant covariance prior since it is quite easy to implement and generates good results. There are over 200+ citations from the original approach which cover extensions such as how much weight to assign to the prior and the sample covariance matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that estimation error in expected returns has been estimated to be about 10x more important than the estimation error in variances and 20x times as important as estimation in covariances (see Ziemba 2003). So you may want to do a decent job on the risk side of the utility function, and then concentrate your efforts on addressing the noisiness in expected returns through robust Bayesian optimization procedures.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2012-04-09T14:56:58.333" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3216" PostTypeId="1" CreationDate="2012-04-09T16:13:35.803" Score="21" ViewCount="4293" Body="&lt;p&gt;Here's an interesting trading puzzle that I would love to get the community's input on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say there exists an alpha signal that does a good job of sorting equities expected excess returns over some number of weeks. If we bin the alpha forecast into 10 equally sized frequency bins, we find that bin 1 has the lowest (and negative) mean realized excess return and bin 10 has the highest (and positive) mean realized excess return. The middle bins have middling risk-adjusted returns and there is nice monotonic pattern on average over non-overlapping periods as in the chart below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/uhG2V.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It also turns out that empirically the bins with smaller expected alpha also have lower realized volatility as depicted in this chart:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ad2bh.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see there is considerable variance of returns in any given bin that the mean summary metric obscures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A typical market-neutral approach is to go long bin 10 and short bin 1, or simply drop all the forecasts into an optimizer since you have a nice monotonic pattern. That's all well and good but it leaves signal on the table. The weights produced via a typical approach will understandably not take significant large long/short positions in the middling bins despite the fact that there is considerable information in knowing that these securities have lower volatility and middling returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question is how to best exploit the signal in the middling bins? How to best exploit the ability to separate securities by their expected realized volatility?&lt;/strong&gt; For example, maybe one strategy is to generate premium income by writing straddles on the middle bins or somehow trade the volatility of one bin against another? It seems that the volatility on the tail bins are under priced, and the vol on the middle bins may be overpriced. Unfortunately, I do not have a similar chart showing the implied volatility for the various bins but they are all components of the S&amp;amp;P 500 so strategies relative to the Vix might be suitable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, these are mean risk-adjusted excess returns (with respect to the S&amp;amp;P 500 benchmark) so total returns may be all positive or all negative during turbulent periods. Ideally, I'd like to avoid introducing market exposure, net market vol exposure, or other unhedged risks except for exposure to the alpha signals or realized volatility estimates themselves.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thoughts?&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-04-10T01:37:50.533" LastActivityDate="2012-05-29T14:51:19.783" Title="statistical arbitrage option overlay strategies / volatility trading" Tags="&lt;volatility&gt;&lt;quant-trading-strategies&gt;&lt;trading&gt;&lt;option-strategies&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="17" ContentLicense="CC BY-SA 3.0" />
  <row Id="3217" PostTypeId="1" AcceptedAnswerId="3223" CreationDate="2012-04-09T19:50:42.913" Score="11" ViewCount="630" Body="&lt;p&gt;This may be more applied math rather than finance focused, but I'm curious about using linear algebra techniques for generating possible arbitrage signals among outright instruments and spreads/flies based off these outrights (take for instance, Eurodollar futures, and their calendar spreads and butterflies).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the general case, assuming there are prices (I'm assuming a single mid price for testing purposes) available for some subset of these of instruments, I'd like to come up with a simple algorithm for detecting arbitrages and, for outright instruments with no unique price solution, a range of arbitrage-free prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My initial hunch was to set up a weighting matrix MxN ( where M is the net number of instruments and N is the number of outrights ), and filter out all rows without market prices, filter out all columns with all 0s, and then solve the matrix (augmented with prices) to get the outright price values, or an inconsistency (=potential arbitrage). If the rank &amp;lt; M, then I'm a bit stumped on how to cleanly generate ranges given constraints on prices ( say &gt; 0  ).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, given 3 outrights A,B,C and two instruments A+B and A-B+C, the weight matrix is&#xA;[ 1 1 0; &#xA; 1 -1 1]&#xA;and prices are [10,35].&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solving this yields a free variable, which I can manually manipulate to get ranges for A,B,C (I get A:[0,10], B:[0,35], C:[0,5]), but is there a nicer mathematical way to generate ranges of values that solve a matrix subject to constraints? Thought about using some kind of LP but didn't jump out at me how.&lt;/p&gt;&#xA;" OwnerUserId="2274" LastActivityDate="2012-04-12T15:03:53.983" Title="calculating arbitrage-free ranges based off outright, spread, and fly prices" Tags="&lt;arbitrage&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3219" PostTypeId="2" ParentId="3014" CreationDate="2012-04-10T09:21:35.283" Score="0" Body="&lt;p&gt;I believe this is a variation on a classic roulette gambling system. We make a bet that seems likely to win, but has a chance of losing if some unlikely things happen. In roulette, the game is to raise your bet each time you lose to cover the losses from previous bets. As long as you win before you run out of money, you come out ahead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly here you are betting 25 pips up and 50 down; any trend will cost you twice as much in losses as you take in profits, so in the long run you are likely to lose. The only thing stopping that is if you can anticipate some pattern in the market. But that is exactly what traders and algorithms have been trying to do for a long time. Market traders have the edge on screen traders, because they have more information available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This algorithm seems to be failing you, just like the roulette algorithm will bankrupt all but a few who try it. You cannot consistently make money from a random process without a trend, particularly when your trading costs put the odds in the house's favour.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2012-04-10T09:21:35.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3220" PostTypeId="2" ParentId="3201" CreationDate="2012-04-10T12:58:39.680" Score="-1" Body="&lt;p&gt;It is important to think about what the contract really is. If you have a call-on-american-option where the underlying is the &quot;usual&quot; american option that could be exercised away, then put-call parity will not hold because the contract will presumably be cancelled in cases where the underlying has disappeared before the tenor of the compound.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, perhaps your contract is specified as an option-on-hybrid-option, where the underlying is an option whose american exercise window begins when the compound is exercised.  In this case, as with all assets that don't disappear, put-call parity will hold.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-04-10T12:58:39.680" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3221" PostTypeId="2" ParentId="3197" CreationDate="2012-04-10T13:05:46.283" Score="2" Body="&lt;p&gt;The main reason that rho term is positive is that we are using arbitrage-free pricing theory.  In particular, regardless of model, the value of a forward contract (for an asset paying no dividends) is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;F_T = S_0 e^{rT}&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, in &lt;em&gt;whatever&lt;/em&gt; option pricing model you choose, the center of its forward distribution for the asset price $S_T$ at time $T$ increases with increasing $r$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same increase does not of course apply to the strike $K$, so for a call this increase in distributional center results in higher option prices under all the common option pricing models, Black-Scholes included. &lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-04-10T13:05:46.283" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3222" PostTypeId="2" ParentId="1150" CreationDate="2012-04-10T13:26:58.067" Score="2" Body="&lt;p&gt;As other people have said, you need to approximate the cumulative. The problem is that wherever you look you will find that to approximate it you will need to use exponentials or trigonometric functions which are also very expensive.&#xA;What you can do is to build yourself a cubic spline with pre-cached values for the cumulative and calculate the value at other points x by (cubic) interpolation. That will make it much faster. Possibly you will also call this method with a series of ordered values so that you can avoid doing the binary search to locate the interval. You will have a cached index for the last interval located and look around that one.&lt;/p&gt;&#xA;" OwnerUserId="2149" LastActivityDate="2012-04-10T13:26:58.067" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3223" PostTypeId="2" ParentId="3217" CreationDate="2012-04-10T14:48:48.597" Score="6" Body="&lt;p&gt;Interesting question!  I don't think you will get very far just using mid prices, though...any sufficiently sensitive test will flag nearly every situation as an arbitrage since $A_\text{mid}+B_\text{mid} \neq (A+B)_\text{mid}$ in most cases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, what about viewing each price set as a dimension in $n$-dimensional space?  The arbitrages occur if the current price state corresponds to a point outside the $n$-dimensional polygon whose edges are defined by relations such as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;A_\text{ask}+B_\text{ask} \geq (A+B)_\text{bid}&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;corresponding to possible arbitrage relations.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2012-04-12T15:03:53.983" LastActivityDate="2012-04-12T15:03:53.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3225" PostTypeId="1" CreationDate="2012-04-11T09:24:47.633" Score="19" ViewCount="713" Body="&lt;p&gt;In an interview from '96 Bill Eckhardt points out that there are tests that any system must pass to be taken seriously.&#xA;That is: tests for (1) overfitting,  (2) post-dictiveness, (3) maldistribution of returns, (4) statistical artifacts and (5) the degree to which a system takes advantage of unusual and possibly nonrepeatable circumstances.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm aware of tests like White's RC or Hansen's (stepwise) SPA for data snooping..but there are obviously some testing procedures I haven't come across so far.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So which tests can be used to deal with the issues listed above?&lt;/p&gt;&#xA;" OwnerDisplayName="user2278" LastEditorDisplayName="user2278" LastEditDate="2012-04-11T09:57:43.317" LastActivityDate="2012-04-12T08:04:35.110" Title="Tests that any system must pass to be taken seriously" Tags="&lt;testing&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="3226" PostTypeId="2" ParentId="3225" CreationDate="2012-04-11T12:26:41.410" Score="5" Body="&lt;p&gt;I would add the Monte Carlo position permutation test to your list (see &lt;a href=&quot;http://www.evidencebasedta.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; for more details and book). The null in White's RC is that the system's returns are zero, but in the position permutation test the null is that the system's positioning (long, short or out of the market) is no better than random.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Incidentally, there is an R package, &lt;a href=&quot;http://cran.r-project.org/web/packages/ttrTests/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;ttrTests&lt;/a&gt;, which implements White's RC and Hansen's SPA, along with other useful tests.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Have also thought of the &quot;torture test.&quot; (see my answer &lt;a href=&quot;https://quant.stackexchange.com/questions/839/how-to-design-a-custom-equity-backtester/842#842&quot;&gt;here&lt;/a&gt;) If an otherwise acceptable system seriously degrades when subjected to this test, it shows that the system is highly reliant on getting good entries and/or exits.&lt;/p&gt;&#xA;" OwnerUserId="252" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2012-04-11T22:32:08.590" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3227" PostTypeId="1" AcceptedAnswerId="3230" CreationDate="2012-04-11T13:41:37.313" Score="8" ViewCount="788" Body="&lt;p&gt;Is there a technique to choose the time-frame for a cointegration test (eg Augmented Dickey-Fueller's)?&lt;/p&gt;&#xA;" OwnerUserId="2257" LastActivityDate="2012-04-11T21:25:57.727" Title="Choosing the time-frame to test for cointegration" Tags="&lt;time-series&gt;&lt;cointegration&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3228" PostTypeId="2" ParentId="3225" CreationDate="2012-04-11T19:20:54.887" Score="0" Body="&lt;p&gt;The best way IMO to validate a system is to walk the system forward, periodically re-optimizing. This will quickly tell you if you are over-fitting, the usual metrics can then be applied to the generated results.&lt;/p&gt;&#xA;" OwnerUserId="1397" LastActivityDate="2012-04-11T19:20:54.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3230" PostTypeId="2" ParentId="3227" CreationDate="2012-04-11T20:13:58.643" Score="4" Body="&lt;p&gt;I have never read about any formal procedure for this. And, I don't remember this issue is even treated in C.Alexander's book Market Risk Analysis, Practical Financial Econometrics that dedicate a whole part to the cointegration of financial time series. One may well find tests for cointegration succeeding (failing) for a certain time frame and failing (succeeding) for a longer (shorter) time length.&lt;p&gt;&#xA;This may be of interest to test for integration for different time lengths. And, one may argue the more often it succeed the better it is to take advantage of the paired-behavior of your time series.&lt;p&gt;&#xA;Another way around is to consider first the time frame &lt;b&gt;you&lt;/b&gt; wish, depending on the issue at stake (is that pure stats observation? do you want to ground trading decisions on these tests?).&lt;p&gt;&#xA;Finally, one may wish to choose time frames avoiding known in advance events likely to cause shocks in prices (company earnings season, ....).&lt;/p&gt;&#xA;" OwnerUserId="2220" LastActivityDate="2012-04-11T20:13:58.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3231" PostTypeId="2" ParentId="3227" CreationDate="2012-04-11T21:25:57.727" Score="3" Body="&lt;p&gt;Why not use the entire data. But before you do clean the data by checking for structural breaks (t / F statistic of a dummy variable). If there exist a functional break, then you know you have to perform the co-integration tests separately for each time frames.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use a preferable time then the question is what criteria will you be choosing this time-frame on.&lt;/p&gt;&#xA;" OwnerUserId="2179" LastActivityDate="2012-04-11T21:25:57.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3234" PostTypeId="2" ParentId="3225" CreationDate="2012-04-12T08:04:35.110" Score="3" Body="&lt;p&gt;To put your above mentioned points into perspective you should definitely consider this seminal paper from Attilio Meucci which develops a general framework for trading systems:&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1753788&quot; rel=&quot;nofollow&quot;&gt;‘The Prayer’ Ten-Step Checklist for Advanced Risk and Portfolio Management&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the abstract:&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;We present “The Prayer”, a recipe of ten sequential steps for all portfolio managers, risk managers, algorithmic traders across all asset classes and all investment horizons, to model and manage the P&amp;amp;L distribution of their positions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For each of the ten steps of the Prayer, we introduce all the key concepts with precise notation; we illustrate the key concepts by means of a simple case study that can be handled with analytical formulas; we point the readers toward multiple advanced approaches to address the non-trivial practical problems of real-life risk modeling; and we highlight a non-exhaustive list of common pitfalls.&quot;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2012-04-12T08:04:35.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3236" PostTypeId="1" AcceptedAnswerId="3240" CreationDate="2012-04-12T18:28:20.343" Score="2" ViewCount="801" Body="&lt;p&gt;Below is a spread built with two ETFs that pass the cointegration test i.e. Adjusted Dickey Fuller, adfTest(type=&quot;nc&quot;) in R's fUnitRoots with a p-value &amp;lt; 0.01.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The red line is the trendline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What test can I use to proove that: (1) both securities are cointegrated and (2) they are mean reversing and the mean is constantly 0 (i.e. stationary, not trended)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/u6NmJ.png&quot; alt=&quot;EWA and EZA spread&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2257" LastActivityDate="2012-05-13T01:17:34.407" Title="Two prices pass the cointegration test but there is a trend. How to check stationarity?" Tags="&lt;cointegration&gt;&lt;mean-reversion&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3237" PostTypeId="2" ParentId="2046" CreationDate="2012-04-12T18:33:42.083" Score="2" Body="&lt;p&gt;I think applying ML techniques to Finance is a work in progress and here are my arguments:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Things like fraud detection are already implemented using ML (personal experience). It should be possible to train a classifier that would tell you when to (or not to) trade.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Have a look at this site &lt;a href=&quot;http://www.kaggle.com/&quot; rel=&quot;nofollow&quot;&gt;http://www.kaggle.com/&lt;/a&gt;, from time to time you will find financial related competitions (another indication of the work in progress).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Big players are getting engaged into this game with commercial products:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.fico.com/en/Products/DMApps/Pages/FICO-Falcon-Fraud-Manager.aspx&quot; rel=&quot;nofollow&quot;&gt;http://www.fico.com/en/Products/DMApps/Pages/FICO-Falcon-Fraud-Manager.aspx&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.oracle.com/us/dm/h2fy11/advncdanalytics-1568353.html?msgid=3-6193843811&quot; rel=&quot;nofollow&quot;&gt;http://www.oracle.com/us/dm/h2fy11/advncdanalytics-1568353.html?msgid=3-6193843811&lt;/a&gt; &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1868" LastActivityDate="2012-04-12T18:33:42.083" CommentCount="0" CommunityOwnedDate="2014-07-23T16:34:06.740" ContentLicense="CC BY-SA 3.0" />
  <row Id="3238" PostTypeId="1" CreationDate="2012-04-12T19:57:13.310" Score="4" ViewCount="388" Body="&lt;p&gt;I have been playing around with autoregressive conditional duration (ACD) models and I have a nicely working R based implementation using real high frequency data  (trades only data).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, what's the point with modelling duration between trades? Or even volume durations?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea how this stuff could be used in practice? I would like to make a Master's thesis out of this.&lt;/p&gt;&#xA;" OwnerUserId="2290" LastEditorDisplayName="user13444" LastEditDate="2019-01-26T18:26:18.537" LastActivityDate="2019-01-26T18:26:18.537" Title="Application of ACD models" Tags="&lt;time-series&gt;&lt;modeling&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3239" PostTypeId="2" ParentId="985" CreationDate="2012-04-13T00:22:50.097" Score="0" Body="&lt;p&gt;Here is an empirical strategy to test for cointegration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FIRST, check whether both $X_t$ and $Y_t$ contain an unit root.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If they are both stationary then model $Y_t$ or $X_t$ in levels (and nothing is wrong).&lt;/li&gt;&#xA;&lt;li&gt;If one of the two is $I(1)$ (non-stationary for one level), then take differences to ensure stationarity.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If they are both non-stationary, and hence $I(1)$, then test for co-integration:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;if the residuals are $I(0)$, then we speak of the presence of cointegration. Estimate then an ECM model: $Y_t = \beta_0 + \beta_1 X_t + \eta_t$ obtaining $\hat{\beta_0}$ and  $\hat{\beta_1}$ and using it in: $\Delta Y_t = \Delta X_t&amp;#39;\phi - \psi(Y_{t-1}-\hat{\beta_0} - \hat{\beta_1}X_t) + \varepsilon_t$. When $\varepsilon_t \sim N(0,1)$ then both $\psi$ and $\phi$ are asymptotically valid.&lt;/li&gt;&#xA;&lt;li&gt;if the residuals are $I(1)$ then we speak of spurious regression. In that case you should model both variables by taking the first differences.&lt;/li&gt;&#xA;&lt;/ol&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2291" LastActivityDate="2012-04-13T00:22:50.097" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3240" PostTypeId="2" ParentId="3236" CreationDate="2012-04-13T00:29:20.277" Score="0" Body="&lt;p&gt;Here is an empirical strategy to test for cointegration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FIRST, check whether both $X_t$ and $Y_t$ contain an unit root.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If they are both stationary then model $Y_t$ or $X_t$ in levels (and nothing is wrong).&lt;/li&gt;&#xA;&lt;li&gt;If one of the two is $I(1)$ (non-stationary for one level), then take differences to ensure stationarity.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If they are both non-stationary, and hence $I(1)$, then test for co-integration:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;if the residuals are $I(0)$, then we speak of the presence of cointegration. Estimate then an ECM model ($Y_t = \beta_0 + \beta_1 X_t + \eta_t$ obtaining $\hat{\beta_0}$ and  $\hat{\beta_1}$ and using it in: $\Delta Y_t = \Delta X_t&amp;#39;\phi - \psi(Y_{t-1}-\hat{\beta_0} - \hat{\beta_1}X_t) + \varepsilon_t$. When $\varepsilon_t \sim N(0,1)$ then both $\psi$ and $\phi$ are asymptotically valid.&lt;/li&gt;&#xA;&lt;li&gt;if the residuals are $I(1)$ then we speak of spurious regression. In that case you should model both variables by taking the first differences.&lt;/li&gt;&#xA;&lt;/ol&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2291" LastActivityDate="2012-04-13T00:29:20.277" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3242" PostTypeId="2" ParentId="219" CreationDate="2012-04-13T00:40:41.307" Score="2" Body="&lt;p&gt;Here is an empirical strategy to test for cointegration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FIRST, check whether both $X_t$ and $Y_t$ contain an unit root.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If they are both stationary then model $Y_t$ or $X_t$ in levels (and nothing is wrong).&lt;/li&gt;&#xA;&lt;li&gt;If one of the two is $I(1)$ (non-stationary for one level), then take differences to ensure stationarity.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If they are both non-stationary, and hence $I(1)$, then test for co-integration:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;if the residuals are $I(0)$, then we speak of the presence of cointegration. Estimate then an ECM model ($Y_t = \beta_0 + \beta_1 X_t + \eta_t$ obtaining $\hat{\beta_0}$ and  $\hat{\beta_1}$ and using it in: $\Delta Y_t = \Delta X_t&amp;#39;\phi - \psi(Y_{t-1}-\hat{\beta_0} - \hat{\beta_1}X_t) + \varepsilon_t$. When $\varepsilon_t \sim N(0,1)$ then both $\psi$ and $\phi$ are asymptotically valid.&lt;/li&gt;&#xA;&lt;li&gt;if the residuals are $I(1)$ then we speak of spurious regression. In that case you should model both variables by taking the first differences.&lt;/li&gt;&#xA;&lt;/ol&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2291" LastActivityDate="2012-04-13T00:40:41.307" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3244" PostTypeId="2" ParentId="2927" CreationDate="2012-04-13T00:53:00.917" Score="-2" Body="&lt;p&gt;VBA is not useful for complex algorithms, in the sense that 1) coding is not efficient and 2) it has its limitations in terms of available resources on the net. You need to take into account that there are already a large number of institutions active in the high frequency segment, which means that they are your competitors. In order to ensure proper models (and to be faster than they are) you need to have excellent and efficient codes (COMPLEX!) optimized with the input of computer specialists. VBA is therefore a too simple language.&lt;/p&gt;&#xA;" OwnerUserId="2291" LastActivityDate="2012-04-13T00:53:00.917" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3245" PostTypeId="2" ParentId="450" CreationDate="2012-04-13T01:29:27.453" Score="7" Body="&lt;p&gt;You can consider the following two methods:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If you have Matlab, you can use the following code: &lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/36115-volume-weighted-average-price-from-intra-daily-data&quot;&gt;Volume Weighted Average Price from Intra-Daily Data&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This package allows you to [1] retrieve intra-daily stock price data from Google Finance, [2] calculate the VWAP at the end of each trading day and [3] transform intra-daily data to a daily format.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If you don't have MatLab you can replicate the code by yourself. As I understand, the package connects with Google Finance and downloads a spreadsheet from:&#xA;&lt;a href=&quot;http://www.google.com/finance/getprices?q=.DJI&amp;amp;x=INDEXDJX&amp;amp;i=60&amp;amp;p=10d&amp;amp;f=d,c,h,l,o,v&quot;&gt;http://www.google.com/finance/getprices?q=.DJI&amp;amp;x=INDEXDJX&amp;amp;i=60&amp;amp;p=10d&amp;amp;f=d,c,h,l,o,v&lt;/a&gt; with the date (intra-daily), closing price, high, low, open and volume.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You can adjust this to your own preferences by 'seeing' the code as:&#xA;&lt;a href=&quot;http://www.google.com/finance/getprices?q=TICKER&amp;amp;x=EXCHANGE&amp;amp;i=INTERVAL&amp;amp;p=PERIOD&amp;amp;f=d,c,h,l,o,v&quot;&gt;http://www.google.com/finance/getprices?q=TICKER&amp;amp;x=EXCHANGE&amp;amp;i=INTERVAL&amp;amp;p=PERIOD&amp;amp;f=d,c,h,l,o,v&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;TICKER: is the unique ticker symbol&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EXCHANGE: is where the security is listed on&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Hint: to track these inputs, for instance for the &lt;a href=&quot;http://www.google.com/finance?q=INDEXDJX%3a.DJI&quot;&gt;Dow Jones Industrial Average&lt;/a&gt;, you search the security of interest at Google Finance and then you can find at the top: (INDEXDJX:.DJI) which obviously refers to (EXCHANGE:TICKER).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;INTERVAL: defines the frequency (60 = 60 seconds)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PERIOD: is the historical data period (see also Google Finance), here 10d refers to the past 10 days (up to current time).&lt;/p&gt;&#xA;" OwnerUserId="2291" LastEditorUserId="2291" LastEditDate="2012-04-13T14:23:07.603" LastActivityDate="2012-04-13T14:23:07.603" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3246" PostTypeId="2" ParentId="2726" CreationDate="2012-04-13T01:39:57.863" Score="2" Body="&lt;p&gt;This question is for a part answered by a recently published article:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2013789&quot; rel=&quot;nofollow&quot;&gt;High-Frequency Technical Trading: The Importance of Speed&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This paper investigates the importance of speed for technical trading rule performance for three highly liquid ETFs listed on NASDAQ over the period January 6, 2009 up to September 30, 2009. In addition we examine the characteristics of market activity over the day and within subperiods corresponding to hours, minutes, and seconds. Speed has a clear impact on the return of technical trading rules. &lt;strong&gt;For strategies that yield a positive return when they experience no delay, a delay of 200 milliseconds is enough to lower performance significantly. On low volatility days this is already the case for delays larger than 50 milliseconds.&lt;/strong&gt; In addition, the importance of speed for trading rule performance increases over time. Market activity follows a U-shape over the day with a spike at 10:00AM due to macroeconomic announcements and is characterized by periodic activity within the day, hour, minute, and second.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2291" LastActivityDate="2012-04-13T01:39:57.863" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3247" PostTypeId="2" ParentId="2707" CreationDate="2012-04-13T01:49:25.543" Score="4" Body="&lt;p&gt;Very simple answer (in line with the second statement of Quant Guy): Bayesian modelling of the weights.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The data and the model provide the &lt;strong&gt;likelihood&lt;/strong&gt; function of the data $y$ as a function of the model parameters &#xA;$p(y|\theta)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The researcher then specifies the &lt;strong&gt;prior&lt;/strong&gt; distribution of the parameter or weight&#xA;$p(\theta)$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The combined view of the parameters then follows from the &lt;strong&gt;posterior&lt;/strong&gt; distribution&#xA;$p(\theta|y) = p(\theta) p(y|\theta)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• prior = qualitative view;&#xA;• Likelihood = quantitative view;&#xA;• posterior = mixed view&lt;/p&gt;&#xA;" OwnerUserId="2291" LastEditorUserId="2291" LastEditDate="2012-04-13T01:59:05.797" LastActivityDate="2012-04-13T01:59:05.797" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3248" PostTypeId="1" CreationDate="2012-04-13T01:51:04.370" Score="9" ViewCount="658" Body="&lt;p&gt;Has anyone in the quantitative finance or financial engineering community studied the effects of a bid or ask tax with actual or simulated data? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so, what were the quantitative results or predictions for the market? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The kind of data I am curious about could arise as part of a before/after study of a market adopting such a tax, or it could arise as part of a financial engineering simulation comparing various form of possible but as yet unimplemented market taxes.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Definitions:  A bid or ask tax is different from a transactions tax or stamp duty in that it is payable even on unexecuted limit orders.  In other words, submitting a buy order or sell order will create a tax cost even if the order is not accepted by a counterparty for execution. For example, if the market is trading at $20-$20.01, and you send in a limit order to buy at a lower price (e.g., $19, $20) and because the market moved up the limit order expires untraded at the end of the day -- you still owe the tax.  The tax might be small per limit order but would add up across participants, especially because it is owed even if someone doesn't successfully transact.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One research issue has been how it would affect behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am aware of two quantitative studies from the experimental economics literature: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Jamison and Plott, “Costly offers &amp;amp; the equilibration properties of the &#xA;multiple unit double auction under conditions of unpredictable shifts of &#xA;demand &amp;amp; supply” Journal of Economic Behavior and Organization,  V. 32, (1997)   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S0167268198000638&quot;&gt;Noussair, Robin, and Ruffieux, &quot;The effect of transaction costs on double auction markets&quot; Journal of Economic Behavior and Organization, V.36, (1998)&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The studies are similar.  In a human subject laboratory, supply and demand curves are established by secret limit orders from the experimenter to the subjects and the subjects are allowed to trade with each other on a computerized system. Bids, asks, and trades on the laboratory exchange are recorded.  The studies differ in that Jamison and Plott moved around the supply and demand parameters between repetitions of the experiment whereas Noussair, et.al. held the parameters constant for a while.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In both studies, the addition of the bid and ask tax lowered transaction volume and reduced a common measure of market efficiency that is measurable in laboratory markets [but perhaps not in the field]. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Noussair also reports that even with the lower volumes and efficiency, prices still converge to the competitive equilibrium. The competitive equilibrium in the lab is determined by the intersection of the supply and demand curves set by the experimenter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While these laboratory results are interesting, I am curious whether there are any quantitative results from financial markets or financial engineering studies seeking to advise governments or exchanges about policy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone in the quantitative finance or financial engineering community studied the effects of a bid or ask tax with actual or simulated data? &lt;/p&gt;&#xA;" OwnerUserId="627" LastEditorUserId="627" LastEditDate="2012-04-13T03:05:43.527" LastActivityDate="2013-04-14T06:01:48.107" Title="Quantitative before/after or financial engineering studies of a bid or ask tax?" Tags="&lt;research&gt;&lt;financial-engineering&gt;&lt;market-microstructure&gt;" AnswerCount="1" CommentCount="10" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3250" PostTypeId="2" ParentId="1172" CreationDate="2012-04-13T02:08:27.390" Score="-1" Body="&lt;p&gt;Perhaps the following title:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Market Risk Analysis&lt;/strong&gt; by &lt;em&gt;Carol Alexander (2007)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Market Risk Analysis is the most comprehensive, rigorous and detailed resource available on market risk analysis. Written as a series of four interlinked volumes each title is self-contained, although numerous cross-references to other volumes enable readers to obtain further background knowledge and information about financial applications.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Volume I: Quantitative Methods in Finance&lt;/strong&gt; covers the essential mathematical and financial background for subsequent volumes. Although many readers will already be familiar with this material, few competing texts contain such a complete and pedagogical exposition of all the basic quantitative concepts required for market risk analysis. There are six comprehensive chapters covering all the calculus, linear algebra, probability and statistics, numerical methods and portfolio mathematics that are necessary for market risk analysis. This is an ideal background text for a Masters course in finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Volume II: Practical Financial Econometrics&lt;/strong&gt; provides a detailed understanding of financial econometrics, with applications to asset pricing and fund management as well as to market risk analysis. It covers equity factor models, including a detailed analysis of the Barra model and tracking error, principal component analysis, volatility and correlation, GARCH, cointegration, copulas, Markov switching, quantile regression, discrete choice models, non-linear regression, forecasting and model evaluation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Volume III: Pricing, Hedging and Trading Financial Instruments&lt;/strong&gt; has five very long chapters on the pricing, hedging and trading of bonds and swaps, futures and forwards, options and volatility as well detailed descriptions of mapping portfolios of these financial instruments to their risk factors. There are numerous examples, all coded in interactive Excel spreadsheets, including many pricing formulae for exotic options but excluding the calibration of stochastic volatility models, for which Matlab code is provided. The chapters on options and volatility together constitute 50% of the book, the slightly longer chapter on volatility concentrating on the dynamic properties the two volatility surfaces  the implied and the local volatility surfaces  that accompany an option pricing model, with particular reference to hedging.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Volume IV: Value at Risk Models&lt;/strong&gt; builds on the three previous volumes to provide by far the most comprehensive and detailed treatment of market VaR models that is currently available in any textbook. The exposition starts at an elementary level but, as in all the other volumes, the pedagogical approach accompanied by numerous interactive Excel spreadsheets allows readers to experience the application of parametric linear, historical simulation and Monte Carlo VaR models to increasingly complex portfolios. Starting with simple positions, after a few chapters we apply value-at-risk models to interest rate sensitive portfolios, large international securities portfolios, commodity futures, path dependent options and much else. This rigorous treatment includes many new results and applications to regulatory and economic capital allocation, measurement of VaR model risk and stress testing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;a href=&quot;http://qoppasociety.org/compendium/books.html#risk-management&quot; rel=&quot;nofollow&quot;&gt;http://qoppasociety.org/compendium/books.html#risk-management&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2291" LastActivityDate="2012-04-13T02:08:27.390" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3251" PostTypeId="2" ParentId="156" CreationDate="2012-04-13T02:32:13.647" Score="6" Body="&lt;p&gt;In my opinion you should question EVERYTHING.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recently I read this article &lt;strong&gt;&lt;a href=&quot;http://repub.eur.nl/res/pub/20167/EI2010-49.pdf&quot;&gt;Ten Things We Should Know About Time Series&lt;/a&gt;&lt;/strong&gt; by Michael McAleer which is to my opinion a good summary of some common issues in time series analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These ten things are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Knowledge of Econometrics and Statistics is Essential&lt;/li&gt;&#xA;&lt;li&gt;Be Aware of Measurement Errors&lt;/li&gt;&#xA;&lt;li&gt;Test for Zero Frequency, Seasonal and Periodic Unit Roots&lt;/li&gt;&#xA;&lt;li&gt;Analyse Fractionally Integrated and Long Memory Processes&lt;/li&gt;&#xA;&lt;li&gt;Estimate VARFIMA Models&lt;/li&gt;&#xA;&lt;li&gt;Use and Interpret Cointegrating Models Carefully&lt;/li&gt;&#xA;&lt;li&gt;Choose Sensibly Among Univariate Conditional, Stochastic and Realized&#xA;Volatility Models&lt;/li&gt;&#xA;&lt;li&gt;Do Not Confuse Thresholds, Asymmetry and Leverage in Volatility&lt;/li&gt;&#xA;&lt;li&gt;Do Not Underestimate the Complexity of Multivariate Volatility Models&lt;/li&gt;&#xA;&lt;li&gt;Think Carefully About Forecasting Models and Expertise&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;See the &lt;a href=&quot;http://repub.eur.nl/res/pub/20167/EI2010-49.pdf&quot;&gt;article &lt;/a&gt; for a further description of each point.&lt;/p&gt;&#xA;" OwnerUserId="2291" LastActivityDate="2012-04-13T02:32:13.647" CommentCount="2" CommunityOwnedDate="2012-04-13T02:32:13.647" ContentLicense="CC BY-SA 3.0" />
  <row Id="3252" PostTypeId="2" ParentId="1683" CreationDate="2012-04-13T20:30:19.670" Score="1" Body="&lt;p&gt;Yes there is some research on it, take for example&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Ten Commandments for Ranking University Quality by Michael McAleer&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=785441&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=785441&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2291" LastActivityDate="2012-04-13T20:30:19.670" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3253" PostTypeId="2" ParentId="985" CreationDate="2012-04-13T20:33:38.613" Score="5" Body="&lt;p&gt;Your intuition is correct. $X_t$ and $Y_t$ are cointegrated if there exists &lt;em&gt;some&lt;/em&gt; linear combination $\alpha X_t + \beta Y_t$ that is stationary (or more generally, of lower cointegration index --- see for example, Hamilton, pag 571). If $X_t = Y_t$, the above linear combination is zero (hence stationary) whenever $\alpha = -\beta$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, most tests exclude this particular case. The exact reasons depend on the specific test you are using.&lt;/p&gt;&#xA;" OwnerUserId="1531" LastEditorUserId="1531" LastEditDate="2012-10-16T14:17:47.600" LastActivityDate="2012-10-16T14:17:47.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3255" PostTypeId="1" AcceptedAnswerId="3656" CreationDate="2012-04-14T11:35:40.093" Score="0" ViewCount="1810" Body="&lt;p&gt;Many academics argue that end-to-day trading, where you go long or short before opening and sell your security at the end of the day, is not profitable. Various explanations are given for this concern. For instance,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;macro-economic news during the day is likely to change the course of a share that day&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;in that sense, there is too much noise&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;due to algorithmic trading, the market is efficient making all profitable profits dissapear.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Still I wonder whether there exists evidence proving these statements wrong. What fo you know or think about this subject? Any good references or articles/reports on it?&lt;/p&gt;&#xA;" OwnerUserId="2291" LastEditorUserId="2291" LastEditDate="2012-04-14T12:16:51.963" LastActivityDate="2012-06-22T17:33:05.723" Title="Can end-to-day trading be profitable? If not, why?" Tags="&lt;quant-trading-strategies&gt;&lt;trading&gt;&lt;high-frequency&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ClosedDate="2012-06-21T22:16:57.493" ContentLicense="CC BY-SA 3.0" />
  <row Id="3256" PostTypeId="1" CreationDate="2012-04-14T12:00:45.697" Score="3" ViewCount="1303" Body="&lt;p&gt;Can you please advise which distribution to follow when your skewness is 0.28 and Kurtosis value is 51. Since it's leptokurtic and positively skewed I would like to fit distribution and also wanted to calculate distribution value at each time &quot;t&quot; just like we calculate Z score for Normal Distribution.&lt;/p&gt;&#xA;" OwnerUserId="926" LastActivityDate="2012-04-15T16:27:30.293" Title="Distribution for High Kurtosis" Tags="&lt;quant-trading-strategies&gt;&lt;distribution&gt;&lt;skewness&gt;&lt;kurtosis&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3258" PostTypeId="2" ParentId="3256" CreationDate="2012-04-14T13:13:05.843" Score="4" Body="&lt;p&gt;That can be a somewhat difficult question to answer, given that the context may yield different distributions. Nevertheless, I think that you could try to fit the best distribution algorithmically. For instance, lately I found this package at Matlab file exchange:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Finding the best distribution that fits the data&lt;/strong&gt;&#xA;&lt;a href=&quot;http://blogs.mathworks.com/pick/2012/02/10/finding-the-best/&quot; rel=&quot;nofollow&quot;&gt;Link&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(...) This is where Mike's allfitdist comes into play. Statistics Toolbox supports a long list of distributions, including parametric and nonparametric distributions. allfitdist fits all valid parametric distributions to the data and sorts them using a metric you can use to compare the goodness of the fit. (...)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Hope that this helps. Let me know whether it worked for you!&lt;/p&gt;&#xA;" OwnerUserId="2291" LastActivityDate="2012-04-14T13:13:05.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3261" PostTypeId="2" ParentId="2954" CreationDate="2012-04-15T10:28:20.537" Score="7" Body="&lt;p&gt;In fact if you make the time change &#xA;$$t\rightarrow \int_{\tau\leq t} V_\tau d\tau$$&#xA;a TWAP is a VWAP.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So just define the FWAP associate to a transform F: (you should ask to F to be an adapted stochastic process if you want to use models)&#xA;$$t\rightarrow \int_{\tau\leq t} F(\tau) d\tau$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will have a new benchmark. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The real question is &quot;what do you want to capture?&quot; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also see a VWAP as the expectation of a volume at price density $d\mu(P)$:&#xA;$${\rm VWAP} = \mathbb{E}_\mu (P)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In such a case just define a GWAP (associating a measure to a measure) as:&#xA;$${\rm GWAP} = \mathbb{E}_G(\mu) (P)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For $G$ transforming a measure into the uniform one over its support: a GWAP is a TWAP (and for G being identity, it is a VWAP).&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2012-04-15T10:55:17.680" LastActivityDate="2012-04-15T10:55:17.680" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3262" PostTypeId="2" ParentId="3256" CreationDate="2012-04-15T16:27:30.293" Score="1" Body="&lt;p&gt;I think the best answer is to test different distributions with your specific data set and see which fits the data the best... skewness and kurtosis are just a small piece of information , there is still a good deal of information we don't know and won't have with out having the data set in front of us&lt;/p&gt;&#xA;" OwnerUserId="1764" LastActivityDate="2012-04-15T16:27:30.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3263" PostTypeId="2" ParentId="2587" CreationDate="2012-04-15T22:29:25.607" Score="4" Body="&lt;p&gt;First: once you will have your liquidity indicator, you will need to know if the signal is worth the risk to go faster (or slower if it is a negative signal). Impulse control will tell you that: &lt;a href=&quot;http://www.ceremade.dauphine.fr/~bouchard/pdf/BML09.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.ceremade.dauphine.fr/~bouchard/pdf/BML09.pdf&lt;/a&gt;&#xA;&lt;em&gt;Optimal control of trading algorithms: a general impulse control approach&lt;/em&gt;, by Bruno Bouchard, Ngoc Minh Dang, Charles-Albert Lehalle &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to couple liquidity and price limits, you can use market making like techniques:&#xA;&lt;a href=&quot;http://arxiv.org/abs/1105.3115&quot; rel=&quot;nofollow&quot;&gt;http://arxiv.org/abs/1105.3115&lt;/a&gt;&#xA;&lt;em&gt;Dealing with the Inventory Risk. A solution to the market making problem&lt;/em&gt; by Olivier Guéant, Charles-Albert Lehalle, Joaquin Fernandez Tapia&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This second paper suggests to model liquidity vs price balance this way:&#xA;(1) the mid price $S_t$ dynamics is not directional (anyway if you have a trend detector, plug it in it, otherwise take a martingale); (2) put an order at distance $\delta$ of $S_t$; (3) the trade you get follows a Poisson process with intensity $A_t \exp -k_t \delta $. the pair $(A_t, k_t)$ is you liquidity signal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Estimate it on real,time and you will have a full framework.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2012-04-15T22:29:25.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3264" PostTypeId="2" ParentId="2589" CreationDate="2012-04-15T22:47:33.040" Score="21" Body="&lt;p&gt;The main issue measuring intraday volatility is called &quot;signature plot&quot;: when you zoom in, the volatility measure (i.e. empirical quadratic variations) explode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly you have the &quot;Epps effect&quot; for correlations: when you zoom in, the correlations collapse (it is at least a mechanical effect).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the volatility a lot of models can correct this:&#xA;- first a multiscale filter (use wavelets for instance)&#xA;- then an additive noise model (the ZAM estimator, see Almgren's note)&#xA;- or a random time observation (i.e. liquidity/tick based one) like this: &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1989281&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1989281&lt;/a&gt;&#xA;- an Hawks model is also a nice solution if you like point processes, see for instance: &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.187.1605&quot;&gt;http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.187.1605&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the most important is &lt;em&gt;what do you want to do with your volatility model?&lt;/em&gt;, &lt;em&gt;which market dynamics do you want to capture?&lt;/em&gt;&#xA;If it is market risk, it will not be the same if it is to compute the probability to cross a price barrier, or to compute a price interval for the price during the closing fixing.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="1355" LastEditDate="2012-11-24T14:56:22.823" LastActivityDate="2012-11-24T14:56:22.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3265" PostTypeId="2" ParentId="2882" CreationDate="2012-04-16T00:54:09.683" Score="4" Body="&lt;p&gt;The first issue you need to care about using intraday data to compute beta is the &lt;em&gt;Epps effect&lt;/em&gt; (collapse of correlation when you zoom in).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This effect comes from different parts, the first being that if you try to compute correlations at high frequency, above a given frequency the probability that your 2 secutities move simultaneously is zero. Consequently their empirical correl is zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To solve this, you need to use an enhanced estimator of correlations (like Yoshida's one, or using Hawkes process-oriented results).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, the best way to do that properly is to include your signal in a &quot;optimal liquidation portfolio&quot;. Have a look at &lt;a href=&quot;http://www.lehalle.free.fr/clog/down/microstructure_lehalle.pdf&quot; rel=&quot;nofollow&quot;&gt;Market Microstructure knowledge needed to  control an intra-day trading process&lt;/a&gt;. Section 4.1 you have optimal liquidation with arbitrage (on one stock for the sake of notations, but it is easy to extend to a basket). It is a chapter to be publish in the &lt;a href=&quot;http://www.citeulike.org/user/lehalle/article/10363469&quot; rel=&quot;nofollow&quot;&gt;Handbook of systemic risk&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2012-04-17T11:55:10.497" LastActivityDate="2012-04-17T11:55:10.497" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3266" PostTypeId="2" ParentId="2539" CreationDate="2012-04-16T00:59:03.610" Score="7" Body="&lt;p&gt;Let allow me to split your question in parts:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;How to estimate volatility using high frequency data, see this question&#xA;&lt;a href=&quot;https://quant.stackexchange.com/a/3264/2299&quot;&gt;https://quant.stackexchange.com/a/3264/2299&lt;/a&gt; and note that it rely on a stationnarity assumption of your PFP (Price Formation Process).&lt;/li&gt;&#xA;&lt;li&gt;You will have to add the overnight volatility to the intraday one.&lt;/li&gt;&#xA;&lt;li&gt;You can question the diffusive nature of the PFP, the Hawkes process are a convenient answer since they are not diffusive at small scales and asymptotically diffusive at larger ones.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2012-05-06T16:29:40.713" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3267" PostTypeId="2" ParentId="310" CreationDate="2012-04-16T11:05:17.633" Score="2" Body="&lt;p&gt;There is a very god paper by A Menkveld analyzing the activity of a huge HFT player during 2 years:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://ssrn.com/abstract=1624329&quot; rel=&quot;nofollow&quot;&gt;Jovanovic, Boyan and Menkveld, Albert J., Middlemen in Limit-Order Markets (October 24, 2011). Western Finance Association (WFA), 2011.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best is to read the full article. You will learn:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the percentage of trades that the HFT firm obtains as liquidity provider&lt;/li&gt;&#xA;&lt;li&gt;the profit coming from the bid-ask spread and the one coming from exploiting micro-trends&lt;/li&gt;&#xA;&lt;li&gt;breakdowns by liquidity buckets&lt;/li&gt;&#xA;&lt;li&gt;etc&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2012-04-17T01:52:47.653" LastActivityDate="2012-04-17T01:52:47.653" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3268" PostTypeId="2" ParentId="1658" CreationDate="2012-04-16T11:10:31.073" Score="5" Body="&lt;p&gt;HFT, when they implement market-making like strategies, are a key element of a fragmented market to build &quot;arbitrage bridges&quot; between trading venues.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a cost that for: we are all paying (probably around a fraction of the actual spread) to them, and the resiliency of the order books suffers because of their presence.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As usual, there are positive and negative elements because of their activity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, there is a serie of studies, call &quot;Navigating Liquidity&quot; analyzing the change in microstructure in Europe since the fragmentation of equity markets: &lt;a href=&quot;https://www.cheuvreux.com/pdf/NavigatingLiquidity6_January2012.pdf&quot; rel=&quot;nofollow&quot;&gt;https://www.cheuvreux.com/pdf/NavigatingLiquidity6_January2012.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, T Foucault wrote an interesting paper on this in the book: &lt;a href=&quot;http://Tinyurl.com/microstructurebook&quot; rel=&quot;nofollow&quot;&gt;Market microstructure, confronting many viewpoints&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2012-05-30T20:40:26.053" LastActivityDate="2012-05-30T20:40:26.053" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3269" PostTypeId="2" ParentId="1787" CreationDate="2012-04-16T11:18:57.990" Score="4" Body="&lt;p&gt;I agree with &lt;strong&gt;chrisaycock&lt;/strong&gt; who underlined that they are acting as market-makers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a market-marker: reward is bid-ask spread and cost is a combination of volatility $\sigma$ and trend $r$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course a market-marker keeping its inventory $\tau$ seconds, this risk is a combination of $\sigma\sqrt{\tau}$ and trend $r\tau$. So the smaller $\tau$, the smaller the risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course it is not that simple, because at &lt;em&gt;high frequency&lt;/em&gt;, the randomness in the price formation process is no more a diffusion (my formula $\sigma\sqrt{\tau}$  is not that true, you need to use other models, like Hawkes processes, or at least point  processes) and the trend is difficult to detect (we are speaking here about micro-trends, but it is not the hardest point since you can &lt;em&gt;unplug&lt;/em&gt; your strategy as soon as you are suffering from a trend).&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2012-04-16T11:18:57.990" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3270" PostTypeId="1" AcceptedAnswerId="3280" CreationDate="2012-04-16T12:12:01.423" Score="6" ViewCount="1696" Body="&lt;p&gt;We have had several posts on &lt;a href=&quot;http://en.wikipedia.org/wiki/Cointegration&quot;&gt;cointegration&lt;/a&gt;, and I must admit that I have only seen them mentioned here and there but I have no real experience using this concept.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is pretty simple: how do you use cointegration to create strategies?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, in what fields are you using this concept?&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2012-05-01T21:01:44.210" Title="What are the applications of cointegration?" Tags="&lt;cointegration&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3271" PostTypeId="1" CreationDate="2012-04-16T14:39:49.823" Score="11" ViewCount="4621" Body="&lt;p&gt;I am trying to get the implied volatility from options on commodity futures and I know it's possible to get it from the binomial american options (on an non-dividend paying stock).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe it is done using the bisection method. However, I can't seem to find a paper illustrating this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone point me to relevant paper/book? &lt;/p&gt;&#xA;" OwnerUserId="2301" LastEditorUserId="467" LastEditDate="2012-04-16T15:14:21.357" LastActivityDate="2012-08-08T07:15:51.303" Title="Implied Volatility from American options (binomial)" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;american-options&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3272" PostTypeId="2" ParentId="3270" CreationDate="2012-04-16T15:32:17.327" Score="9" Body="&lt;p&gt;Co-integration is a measure / indicator of the long running relationship between 2 or more time series.&#xA; &#xA;A short answer to how you can use it, is the pairs trading strategy or in Econometrics can be used to formulate a regression.&#xA; &#xA;using the classic example, you can use 2 stocks like Coke (C) and Pepsi (P) (or commodities such as Gold and Silver) in a pairs trading strategy. Your strategy will involve first finding out if the stocks are co-integrated; if they are then you will need to have a strat like:&#xA; &#xA;- If the spread (C - P) &gt; threshold then sell C and buy P&#xA;- If the spread (C - P) &amp;lt; threshold then buy C and sell P&#xA; &#xA;The idea here is that if the spread widens say C increases then eventually P will also increase or C will eventually revert to some long running value.&#xA; &#xA;The key challenge here is to determine when the spread is at its optimal value, so that you know when to enter / exit the trade&#xA; &#xA;Very quick and basic, there are tons of info on this strat on the web.&lt;/p&gt;&#xA;" OwnerUserId="2179" LastActivityDate="2012-04-16T15:32:17.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3276" PostTypeId="2" ParentId="3271" CreationDate="2012-04-16T22:01:53.877" Score="7" Body="&lt;p&gt;I guess if your American-style option is in no-exercise region, you can use exactly the same bisection method as for European option.The implied volatility will be different, but the method is still the same. See for example, &lt;a href=&quot;http://finance.bi.no/~bernt/gcc_prog/recipes/recipes.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;, chapter 9.3.3. The applicability of bisection method for American-style options is discussed in the book &quot;Binomial Models in Finance&quot; (John Van Der Hoek, Robert James), around page 274.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also you may find useful: &lt;a href=&quot;https://quant.stackexchange.com/questions/1489/how-should-i-calculate-the-implied-volatility-of-an-american-option-in-a-real-ti&quot;&gt;How should I calculate the implied volatility of an American option in a real-time production environment?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="370" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2012-04-16T22:19:12.497" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3277" PostTypeId="2" ParentId="2360" CreationDate="2012-04-17T01:40:29.790" Score="21" Body="&lt;p&gt;It seems that your question refers to the &lt;em&gt;microstructure noise&lt;/em&gt; defined in papers about intraday volatility estimates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Originally, it comes from the &lt;em&gt;bid-ask bounce&lt;/em&gt;, i.e. the fact that even if the volatility is zero, you have buyers and sellers at this price and consequently you observe prices at Bid or Ask prices, and not at mid-price. Because of that, if you use the classical quadratic variation estimate for the squared volatility: even with an underlying volatility of zero, you will measure a lot of time $(S_{ask}-S_{bid})^2$. If you model this using an additive &lt;em&gt;noise&lt;/em&gt; $\epsilon$, meaning that when the mid-price between $0$ and $T$ follows a discretized Arithmetic Brownian motion ($S_{(k+1)\delta}=S_{k\delta}+\sigma\sqrt{\delta}\xi_{k+1}$), the price you observe at $k\delta$ is $S_{k\delta}+\epsilon_k$ (remember that $\epsilon_k$ is something around half a bid-ask spread, &lt;em&gt;explaining&lt;/em&gt; why the traded price is not exactly the mid). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consequently when you sample $[0,T]$ in $N$ slices (i.e. $\delta=T/N$), the expectation of the quadratic variation, that should be an estimate of $\int_0^T \sigma_t^2 dt$ is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$U(N)=\mathbb{E}\left(\sum_{n=1}^{N} (S_{n\delta}+\epsilon_n - (S_{(n-1))\delta} +\epsilon_{n-1}))^2 \right)= \sum_{n=1}^{N} \mathbb{E}(S_{n\delta} - S_{(n-1))\delta} )^2 + \mathbb{E}(\epsilon_n -\epsilon_{n-1})^2$$&#xA;since the microstructure noise is assumed to be independent of the price, moroever it is centered and has a variance $v$ so $\mathbb{E}(\epsilon_n -\epsilon_{n-1})^2=2v$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Our estimate is now:&#xA;$$U(N)\mathop{\rightarrow}_{N\longrightarrow +\infty}\int_0^T \sigma_t^2 dt+2Nv$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It means that &lt;strong&gt;the estimate of the squared volatility increases linearly with the sampling rate!&lt;/strong&gt; And technically this comes only from the microstructure noise (with variance $v$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more information on microstructure in general (and volatility estimate specifically), you can read:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1119952417&quot;&gt;Market microstructure: confronting many view points (Abergel, Bouchaud, Foucault, Lehalle and Rosenbaum Ed)&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/9814566160&quot;&gt;Market Microstructure in Practice (Lehalle Laruelle Eds)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2013-09-14T08:55:59.937" LastActivityDate="2013-09-14T08:55:59.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3278" PostTypeId="2" ParentId="3110" CreationDate="2012-04-17T01:47:01.153" Score="3" Body="&lt;p&gt;be careful: if you want to implement a smart routing strategy (addressing more than one trading venue), you should at least have one component of your strategy located at the same distance (i.e. same time to each matching engine) from all the orderbooks you plan to interact with.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just say that you detect at $\tau_0$ that bid price in the matching engine $B$ is higher than the ask price in the matching engine $A$. The time to reach $B$ is $\tau_B$ and to reach $A$ is $\tau_A$. Your two orders will reach $A$ at $\tau_0+\tau_A$ and $B$ at $\tau_0+\tau_B$. The larger $|\tau_A-\tau_B|$, the higher the probability that one of the two quotes will have been removed one way or the other (cancelled or traded), and you will have to pay the full bid-ask spread to unwind your position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;In detail&lt;/strong&gt;,&#xA;if you have some tactics that can be run at one order-book only, it is good to be as close as possible from it; but for a simple bid-ask crossing arbitrage:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;say that you see a quantity of $Q_a$ at the best ask (at price $P_a$) on a trading venue $A$ and a quantity $Q_b$ at the best bid (at price $P_b=P_a+u$) on another venue $B$.&lt;/li&gt;&#xA;&lt;li&gt;You want to buy $Q=\min(Q_a,Q_b)$ on $A$ and sell it on $B$ (you will earn $Q \times u$).&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You send your two orders simultaneously to $A$ and $B$ at $\tau_0$, say that $\tau_A&amp;lt;&amp;lt;\tau_B$&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;It hits $A$ at $\tau_0+\tau_A$, assuming that $\tau_A$ is small, you bought $Q$ as you expected.&lt;/li&gt;&#xA;&lt;li&gt;in between the market participant who owns the order on $B$ realized that he crossed the spread without being executed: we sent a cancel.&lt;/li&gt;&#xA;&lt;li&gt;his cancel has $\tau_B-\tau_A$ milliseconds to reach $B$ before the order you sent at $\tau_0$, and your pair would be ruined. &lt;/li&gt;&#xA;&lt;/ol&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;More generally, any observer of the price formation process has $\tau_B-\tau_A - 2\tau_{ex}$ (where $\tau_{ex}$ is its average latency to $A$ and $B$) to remove $Q_b$ one way or the other and ruin your pair.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The lower $|\tau_A-\tau_B|$, the better, it is even sometime better to slow one of your message to ensure a small $|\tau_A-\tau_B|$. Of course, the larger $(\tau_A+\tau_B)/2$, the worst.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have to find the best balance between $\tau_A$ and $\tau_B$ such that $|\tau_A-\tau_B|$ &lt;strong&gt;and&lt;/strong&gt; $(\tau_A+\tau_B)/2$ are as small as possible.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2012-08-06T06:22:09.853" LastActivityDate="2012-08-06T06:22:09.853" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3279" PostTypeId="2" ParentId="3238" CreationDate="2012-04-17T01:52:15.233" Score="3" Body="&lt;p&gt;If you haven't already, I would check out Nikolaus Hautsch's book: Modelling Irregularly Spaced Financial Data [1]. I have just started reading it, but it looks like he devotes a good portion of the book to going through real world applications of ACD models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I work at a market maker and spend a bit of my time analyzing our liquidity, so I thought it could be worth looking at ACD models. Would you mind sharing your R code, btw?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[1] &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/3540211349&quot; rel=&quot;nofollow&quot;&gt;http://www.amazon.com/Modelling-Irregularly-Spaced-Financial-Data/dp/3540211349&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2303" LastActivityDate="2012-04-17T01:52:15.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3280" PostTypeId="2" ParentId="3270" CreationDate="2012-04-17T11:12:18.223" Score="9" Body="&lt;p&gt;Be careful: even if you have two processes $A_t$ and $B_t$ that you find to be cointegrated (ie as explained upper you have a linear combination of $A$ and $B$ that is iid), it does not mean that you can trade it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It means that if you identified two parameters $\theta_A$ and $\theta_B$ such that&#xA;$$C_t:=\theta_A A_t + \theta_B B_t \sim {\cal N}(0,v)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you can buy the residuals ($\epsilon_t = \theta_A A_t + \theta_B B_t - C_t$) of the regression against $C_t$ when they are cheap and sell them high, but only if you can trade it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, if $A$ is a stock or a future and $B$ is a macroeconomic indicator, you will not be able to buy and sell $B$. Some people nevertheless try to trade the cointegration just using $A$, because $C_t$ is &lt;em&gt;cheap&lt;/em&gt; means &lt;em&gt;cheap with respect to current economic conditions&lt;/em&gt; and because the macro variables are changing slower than stock prices, but they are exposed to macro trends or jumps.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2012-04-17T12:16:59.423" LastActivityDate="2012-04-17T12:16:59.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3281" PostTypeId="2" ParentId="45" CreationDate="2012-04-17T12:02:37.053" Score="1" Body="&lt;p&gt;The risk is not linked to the decision process but to your inventory, independently from the signals that triggered the buys and sells: you can monitor the inventory as usual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are talking of taking into account the fact that you change your inventory more often because you use computer-based signals, it is more complex. You need to control the dynamics of your trading algorithm to be sure that it will not take positions in one millisecond that will dramatically increase your risk.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2012-04-17T12:02:37.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3282" PostTypeId="1" CreationDate="2012-04-17T19:33:05.843" Score="2" ViewCount="214" Body="&lt;p&gt;What are some methods for optimizing stop-loss reinsurance? I've found an article on the minimization of the variance. I also know about the method of average-at-range. &#xA;Can we apply a method for single-level contract KNST stop-loss?&lt;/p&gt;&#xA;" OwnerUserId="2304" LastEditorUserId="35" LastEditDate="2012-04-17T19:39:19.927" LastActivityDate="2017-10-10T07:19:26.713" Title="Optimal stop-loss reinsurance" Tags="&lt;mathematics&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3283" PostTypeId="2" ParentId="310" CreationDate="2012-04-17T19:57:40.247" Score="5" Body="&lt;p&gt;&quot;Major exchanges now have “latencies” of around one millisecond (one thousandth of a second) or less. Exchanges and practitioners now routinely time stamp their messages to the millisecond.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;This is so fast that effects from &lt;a href=&quot;http://en.wikipedia.org/wiki/Special_relativity&quot; rel=&quot;noreferrer&quot;&gt;special relativity&lt;/a&gt; come into play!&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Rules that attempt to force uniform prices at one moment &#xA;in time over geographically decentralized places must take into account the fact that &#xA;information does not move faster than light. At the same moment in time, two geographically &#xA;separated participants may observe two different “best” prices.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All quotes are from this mind-boggling paper from the UK Government’s Foresight Project:&lt;br&gt;&#xA;&lt;a href=&quot;http://www.bis.gov.uk/assets/foresight/docs/computer-trading/11-1242-dr15-impact-of-special-relativity-on-securities-regulation&quot; rel=&quot;noreferrer&quot;&gt;Impact of special relativity on securities regulation by James J. Angel&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2012-04-17T19:57:40.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3284" PostTypeId="1" AcceptedAnswerId="3316" CreationDate="2012-04-17T23:36:00.110" Score="22" ViewCount="23646" Body="&lt;p&gt;Not sure if this is a relevant question for site, but I am looking to move to  &lt;a href=&quot;http://www.eoddata.com/&quot;&gt;www.eoddata.com&lt;/a&gt; as my data source.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If anyone has used it, can you tell me how the data quality is ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am currently parsing yahoo for my prices but its not a very efficient process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the other sources of equity data out there ( affordable for retail investors like me) ? I am willing to pay \$250-\$300 per year for it.&lt;/p&gt;&#xA;" OwnerUserId="1696" LastEditorUserId="467" LastEditDate="2012-04-18T07:41:32.080" LastActivityDate="2019-10-06T02:30:37.673" Title="Is &quot;eoddata&quot; a good data source?" Tags="&lt;data&gt;&lt;market-data&gt;" AnswerCount="20" CommentCount="4" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="3285" PostTypeId="5" CreationDate="2012-04-18T01:22:49.417" Score="0" Body="&lt;p&gt;Before asking any question about cointegration, please read this paper: &lt;a href=&quot;http://akson.sgh.waw.pl/~kp38166/lab.%209/Murray93DrunkAndDog.pdf&quot; rel=&quot;nofollow&quot;&gt;A Drunk and Her Dog: An Illustration of Cointegration and Error Correction by Michael P. Murray in The American Statistician, Vol. 48, No. 1 (Feb., 1994), pp. 37-39&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the viewpoint of the users of quant.stackexchange, questions on cointegration can be clustered in several categories:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;how to put in place arbitrage once cointegration is identified?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://quant.stackexchange.com/questions/3270/what-are-the-applications-of-cointegration&quot;&gt;What are the applications of cointegration?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://quant.stackexchange.com/questions/2753/how-do-different-methods-and-techniques-used-in-pairs-trading-compare&quot;&gt;How do different methods and techniques used in pairs trading compare?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://quant.stackexchange.com/questions/2232/should-cointegration-be-tested-using-close-or-adjusted-close-prices&quot;&gt;Should cointegration be tested using close or adjusted close prices?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://quant.stackexchange.com/questions/3451/cointegration-applied-to-portfolio-construction-risk-management&quot;&gt;cointegration applied to Portfolio Construction &amp;amp; Risk management&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;how to build a cointegrated relatinship between stochastic processes?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;general statistical questions&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://quant.stackexchange.com/questions/3236/two-prices-pass-the-cointegration-test-but-there-is-a-trend-how-to-check-statio&quot;&gt;Two prices pass the cointegration test but there is a trend. How to check stationarity?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://quant.stackexchange.com/questions/1369/variable-selection-in-factor-models&quot;&gt;Variable Selection in factor models&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;questions related to the time frame / window&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://quant.stackexchange.com/questions/3227/choosing-the-time-frame-to-test-for-cointegration&quot;&gt;Choosing the time-frame to test for cointegration&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://quant.stackexchange.com/questions/2815/what-is-the-correct-procedure-to-choose-the-lag-when-preforming-johansen-cointeg&quot;&gt;What is the correct procedure to choose the lag when preforming Johansen cointegration test?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://quant.stackexchange.com/questions/598/how-do-i-incorporate-time-variability-in-a-pair-trading-framework&quot;&gt;How do I incorporate time-variability in a pair trading framework?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;generic presentation / questions&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://quant.stackexchange.com/questions/2861/a-gentle-introduction-to-cointegration&quot;&gt;A gentle introduction to cointegration&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://quant.stackexchange.com/questions/1027/how-are-correlation-and-cointegration-related&quot;&gt;How are correlation and cointegration related?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://quant.stackexchange.com/questions/219/what-is-the-intuition-behind-cointegration&quot;&gt;What is the intuition behind cointegration?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://quant.stackexchange.com/questions/2860/is-there-a-measure-for-the-degree-of-cointegration&quot;&gt;Is there a measure for the &amp;#39;degree&amp;#39; of cointegration&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://quant.stackexchange.com/questions/2076/how-to-interpret-the-eigenmatrix-from-a-johansen-cointegration-test&quot;&gt;How to interpret the eigenmatrix from a Johansen cointegration test?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;practical and specific questions&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://quant.stackexchange.com/questions/2183/why-does-the-following-data-fail-my-cointegration-test&quot;&gt;Why does the following data fail my cointegration test?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://quant.stackexchange.com/questions/1706/why-does-this-co-integrated-basket-look-too-good-to-be-true&quot;&gt;Why does this Co-integrated basket look too good to be true?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Before asking a new question you should check that it has not been already asked, and at least look at the &lt;a href=&quot;http://en.wikipedia.org/wiki/Cointegration&quot; rel=&quot;nofollow&quot;&gt;associated wikipedia article&lt;/a&gt;. Please feel free to enrich the wikipedia page thanks to the answer found at stackexchange.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more bibliographic reference, see the &lt;a href=&quot;http://www.citeulike.org/search/all?q=cointegration&quot; rel=&quot;nofollow&quot;&gt;associated citeulike search&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2012-05-08T09:03:36.763" LastActivityDate="2012-05-08T09:03:36.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3286" PostTypeId="4" CreationDate="2012-04-18T01:22:49.417" Score="0" Body="Cointegration is often used in statistical abitrage as a way to identify how to combine some tradable instrument to obtain a *mean reverting* one." OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2012-04-18T07:10:37.903" LastActivityDate="2012-04-18T07:10:37.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3287" PostTypeId="2" ParentId="1226" CreationDate="2012-04-18T02:10:00.073" Score="8" Body="&lt;p&gt;There is a paper of mine answering To this question: &lt;a href=&quot;http://arxiv.org/abs/1105.3115&quot;&gt;Dealing with the Inventory Risk. A solution to the market making problem by Olivier Guéant, Charles-Albert Lehalle, Joaquin Fernandez Tapia&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2012-04-18T02:10:00.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3288" PostTypeId="5" CreationDate="2012-04-18T02:14:46.293" Score="0" Body="&lt;p&gt;&lt;strong&gt;Market microstructure for Quants&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Chapter &lt;em&gt;Market Microstructure Knowledge Needed for Controlling an Intra-Day Trading Process&lt;/em&gt; of the &lt;a href=&quot;http://www.cambridge.org/us/academic/subjects/mathematics/optimization-or-and-risk-analysis/handbook-systemic-risk&quot; rel=&quot;nofollow noreferrer&quot;&gt;Handbook on Systemic Risk&lt;/a&gt; states:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The market micro-structure of an asset class is a mix of the market&#xA;  design, the trading behaviours of trading agents, the regulatory&#xA;  environment, and the availability of correlated instruments (like&#xA;  Equity Traded Funds, Futures or any kind of derivative products). &#xA;  Formally, the micro-structure of a market can be seen as several&#xA;  sequences of auction mechanisms taking place in parallel, each of them&#xA;  having its specificity.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;To optimise his behaviour, a trader has to choose an abstract description of the micro-structure of the markets he will interact with: this will be his model of market micro-structure. It can be a statistical macroscopic one like in the widely used Almgren-Chriss framework, in which the time is sliced in 5 or 10 minutes long time intervals during which the interactions with the market are aggregated in two statistical phenomena: the market impact as a function of the ``participation rate'' of the trader and the volatility as a proxy of the market risk. It can also be a microscopic description of the order-book behaviour like in:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://arxiv.org/abs/1312.0563&quot; rel=&quot;nofollow noreferrer&quot;&gt;Simulating and analyzing order book data: The queue-reactive model&lt;/a&gt; where the way the first queue evolve with respect to the size of others (best opposite and second or third queues) are studied.&lt;/li&gt;&#xA;&lt;li&gt;a theoretical one explaining how stabilizing behaviours can emerge: Efficiency of the Price Formation Process in Presence of High Frequency Participants: a Mean Field Game analysis&lt;/li&gt;&#xA;&lt;li&gt;a PDE (Fokker-Planck) version of the order flows (with an intraday seasonality correction) &lt;a href=&quot;http://arxiv.org/abs/1304.6819&quot; rel=&quot;nofollow noreferrer&quot;&gt;A Fokker-Planck description for the queue dynamics of large tick stocks&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;another one focused on direct analysis of the link between the state of the orderbook and the next event (midprice change or trade) &lt;a href=&quot;http://arxiv.org/abs/1312.0514&quot; rel=&quot;nofollow noreferrer&quot;&gt;Trade arrival dynamics and quote imbalance in a limit order book&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;an economic view of agent behaviour (in a theoretic model) &lt;a href=&quot;http://webhost.hec.fr/rosu/research/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;A Dynamic Model of the Limit Order Book&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Cost of trading&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Questions regarding trading costs, slippage, etc.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/34737/cost-of-liquidation&quot;&gt;Cost of liquidation&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/18537/are-there-references-about-liquidation-transaction-market-impact-costs-in-port&quot;&gt;Are there references about liquidation, transaction, market impact costs in portfolio optimization&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/10544/optimal-executions-for-minimizing-slippage/10550#10550&quot;&gt;Optimal Executions for Minimizing Slippage&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/21316/impact-slippage-model-for-open-and-closing-crossing-auctions&quot;&gt;Impact / slippage model for open and closing crossing auctions?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Orderbook dynamics&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question about this (and the predictive power of imbalance)&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/22412/order-book-dynamics&quot;&gt;Order Book Dynamics&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/23137/is-order-flow-imbalance-more-or-less-correlated-with-price-movements-at-slower-f&quot;&gt;Is order flow imbalance more or less correlated with price movements at slower frequency?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/1379/implementing-data-structures-in-a-limit-order-book&quot;&gt;Implementing data-structures in a Limit order book&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/9168/price-functions-based-on-order-book-events&quot;&gt;Price functions based on order book events&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;High Frequency Trading (HFT)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Questions about HFT&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/1658/has-high-frequency-trading-hft-been-a-net-benefit-or-cost-to-society&quot;&gt;Has high frequency trading (HFT) been a net benefit or cost to society?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/310/how-high-is-the-frequency-in-hft&quot;&gt;How &amp;#39;High&amp;#39; is the frequency in HFT?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;High frequency / intraday volatility estimate&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Questions about this and microstructure noise&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/2589/how-to-calculate-historical-intraday-volatility&quot;&gt;How to calculate historical intraday volatility?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/2360/what-exactly-is-meant-by-microstructure-noise&quot;&gt;What exactly is meant by &amp;quot;microstructure noise&amp;quot;?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Sources of information&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Journals&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.worldscientific.com/page/mml/aims-scope&quot; rel=&quot;nofollow noreferrer&quot;&gt;Market microstructure and liqudity&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Conference proceedings and web sites&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a large overview of state of the art in microstructure in the talks of the conf held every two years (2010 and 2012 up to now, 2014 is planned) in Dec in Paris &lt;a href=&quot;http://market-microstructure.institutlouisbachelier.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;Market microstructure: confronting many viewpoints&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Books&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/r3eUD.jpg&quot; alt=&quot;enter image description here&quot;&gt;Another recent book: &lt;a href=&quot;http://www.worldscientific.com/worldscibooks/10.1142/8967#t=reviews&quot; rel=&quot;nofollow noreferrer&quot;&gt;Market Microstructure in Practice&lt;/a&gt;, describes why microstructure is important for trading, from a quantitative viewpoint.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A book on the 2010 eponym conference is available: &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1119952417&quot; rel=&quot;nofollow noreferrer&quot;&gt;Market microstructure: confronting many viewpoints (the book)&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2017-06-17T17:30:12.910" LastActivityDate="2017-06-17T17:30:12.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3289" PostTypeId="4" CreationDate="2012-04-18T02:14:46.293" Score="0" Body="Market microstructure is generally speaking the way markets are organized at the impact of there structure on the price formation process." OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2012-04-18T07:10:46.063" LastActivityDate="2012-04-18T07:10:46.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3290" PostTypeId="2" ParentId="3284" CreationDate="2012-04-18T08:04:35.577" Score="7" Body="&lt;p&gt;I have used eoddata for an analysis of open interest with a history of 10 years daily data. Since it was the only source, i can't comment on the data quality. What I comment on is that the interesting data could be extracted efficiently from the source files (which will give you a csv per day for the data of an exchange).&lt;/p&gt;&#xA;" OwnerUserId="357" LastActivityDate="2012-04-18T08:04:35.577" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3291" PostTypeId="2" ParentId="3024" CreationDate="2012-04-18T22:28:09.370" Score="3" Body="&lt;p&gt;The ones I know are&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.marketcetera.com/site/&quot; rel=&quot;nofollow&quot;&gt;Marketcetera&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://sourceforge.net/projects/mov/&quot; rel=&quot;nofollow&quot;&gt;Merchant of venice (mov)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;But I found &lt;a href=&quot;http://estefancivera.blogspot.com/2010/03/open-source-lkibrary-and-trading-system.html&quot; rel=&quot;nofollow&quot;&gt;this page&lt;/a&gt; with an interesting list on the internet.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2012-04-18T22:28:09.370" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3292" PostTypeId="2" ParentId="3248" CreationDate="2012-04-19T01:35:16.250" Score="1" Body="&lt;p&gt;It seems that you speak about a &quot;quote tax&quot;. In Europe some markets now ask for fees for orders even if they are not executed if you exceed an order to trade ratio to prevent them from cpu-harrassing flows. Let s wait and see what will append.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The effect should be similar to the One of a tax.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The real question is: how can you make the difference between an order inserted, not executed, but cancelled after 3 hours and a sequence of 60 orders inserted and cancelled after 3 seconds, 60 times more fees/taxes?&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2012-04-19T01:35:16.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3293" PostTypeId="1" AcceptedAnswerId="3436" CreationDate="2012-04-19T05:09:32.517" Score="9" ViewCount="1774" Body="&lt;p&gt;Given an expected returns vector and a covariance matrix, one can perform a joint draw and measure the average &lt;em&gt;cross-sectional&lt;/em&gt; variation as the standard deviation across returns for a particular joint draw. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Demonstrating the same idea using empirical/historical data, the cross-sectional variation is simply the standard deviation across returns at a point in time. For some intuition, here's a chart plotting cross-sectional dispersion vs. the VIX from a &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1444868&quot; rel=&quot;nofollow noreferrer&quot;&gt;paper&lt;/a&gt; by Gorman, Sapra, and Weigand:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/YyVkh.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since many shops have a well-designed covariance matrix, rather than looking at the empirical metric to measure dispersion which is noisy and time-varying, I'd rather produce the dispersion metric from an already existing covariance matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the analytical relationship between a given covariance matrix and expected returns vector (e.g., a multivariate normal distribution) and the &lt;em&gt;expectation&lt;/em&gt; of the cross-sectional dispersion?&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-04-20T16:31:04.917" LastActivityDate="2012-05-04T14:41:51.887" Title="Analytical relationship between a covariance matrix and cross-sectional dispersion" Tags="&lt;volatility&gt;&lt;covariance&gt;&lt;correlation-matrix&gt;" AnswerCount="2" CommentCount="7" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="3294" PostTypeId="2" ParentId="1233" CreationDate="2012-04-19T05:25:17.710" Score="2" Body="&lt;p&gt;Hedge the risk of low-volatility by engaging in a &lt;a href=&quot;http://en.wikipedia.org/wiki/Variance_swap&quot; rel=&quot;nofollow&quot;&gt;variance-swap&lt;/a&gt;. Peter Carr and Lurien Wu wrote &quot;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=577222&amp;amp;http://en.wikipedia.org/wiki/Variance_swap&quot; rel=&quot;nofollow&quot;&gt;Variance Risk Premia&lt;/a&gt;&quot; on the topic.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2012-04-19T05:25:17.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3295" PostTypeId="2" ParentId="3284" CreationDate="2012-04-19T09:06:24.973" Score="5" Body="&lt;p&gt;We are a new start-up (today actually) producing easy charting software for the lowest price we can. We are using EODData and we find it to be very good. There are no issues in the quality of the data for us, and it seems to update very timely for the charting purposes and our own investing purposes. Our software is distributed free, so if you want to check out the quality of their data without paying a cent, give it a go. The free version gives you 1 year of data for the ASX, NASDAQ, NYSE, LSE, World Indices, and FOREX. So plenty for you to explore. &lt;/p&gt;&#xA;" OwnerUserId="2308" LastActivityDate="2012-04-19T09:06:24.973" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3296" PostTypeId="1" AcceptedAnswerId="3299" CreationDate="2012-04-20T02:18:58.683" Score="4" ViewCount="1893" Body="&lt;p&gt;I need to estimate the daily VaR of a portfolio of various exposures in $n$ risky assets (say equity futures).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The simplest approach, I think, would be to just estimate VaR from a multivariate normal distribution using historical daily return covariances. Would this approach significantly underestimate the risk because of fat tails? Or is it still a reasonable estimate?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I were to use a copula, what would be the simplest approach? Would a Gaussian copula suffer from the same problems as simply estimating the multivariate normal distribution as above?&lt;/p&gt;&#xA;" OwnerUserId="2303" LastActivityDate="2012-04-20T14:24:45.260" Title="Do I need a copula to accurately estimate the VaR of a portfolio of risky assets?" Tags="&lt;var&gt;&lt;copula&gt;" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3297" PostTypeId="1" CreationDate="2012-04-20T03:05:57.753" Score="8" ViewCount="2910" Body="&lt;p&gt;Can some one kindly go over some of the applications and use of Lie groups in finance? The math is very rigorous and I don't fully understand it or the potential it could have.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me share some examples with you, I'm sure there are many more. There even is a financial math graduate program in Europe where there is required course work that teaches Lie groups.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S0096300308009156&quot;&gt;http://www.sciencedirect.com/science/article/pii/S0096300308009156&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://math.sut.ac.th/school/faculty/sergey/filespublic/2006/SrihirunMeleshkoSchultz2006_I.pdf&quot;&gt;http://math.sut.ac.th/school/faculty/sergey/filespublic/2006/SrihirunMeleshkoSchultz2006_I.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.phy.cuhk.edu.hk/~cflo/Finance/papers/publications/lie_QF.pdf&quot;&gt;http://www.phy.cuhk.edu.hk/~cflo/Finance/papers/publications/lie_QF.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="848" LastEditDate="2012-04-22T19:36:07.313" LastActivityDate="2012-07-14T06:03:57.940" Title="application of lie groups in finance" Tags="&lt;mathematics&gt;" AnswerCount="1" CommentCount="11" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3298" PostTypeId="2" ParentId="3296" CreationDate="2012-04-20T06:36:23.573" Score="3" Body="&lt;p&gt;It depends on the assets which copula is best and other methods may still be better and comparable in complexity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to use copula's for equities you can take a look at Clayton copula. While the Gaussian copula is symmetric the Clayton copula has asymmetric tail dependency. This makes modeling the increase in correlation during a crisis possible.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2012-04-20T06:36:23.573" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3299" PostTypeId="2" ParentId="3296" CreationDate="2012-04-20T07:05:55.050" Score="6" Body="&lt;p&gt;In general you don't need copulas to calculate VaR on portfolio. You can use historical method if you have time series of returns for the assets in your portfolio. If you have sufficiently enough data this will allow you to take into account correlation risk, non-normality of returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example of code in R for equally weighted portfolio without assuming any copula or distribution (using RMetrics package and the LPP indices data provided with this packages):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(fPortfolio)&#xA;lppData  &amp;lt;-  100*LPP2005.RET[,1:6]&#xA;eqWSpec  &amp;lt;- portfolioSpec();&#xA;nAssets &amp;lt;- ncol(lppData)&#xA;setWeights(eqWSpec)  &amp;lt;- rep(1/nAssets, times = nAssets)&#xA;setAlpha(eqWSpec)  &amp;lt;- 0.05&#xA;ewPorfolio  &amp;lt;- feasiblePortfolio (data = lppData, spec=eqWSpec);&#xA;print(ewPorfolio)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Target Return and Risks:&#xA;  mean     mu    Cov  Sigma   CVaR    VaR &#xA;0.0431 0.0431 0.3198 0.3198 0.7771 0.4472 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;(Note that this is most probably not the best way to calculate VaR of portfolio in R)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It worth mentioning that if you need to use copulas, you will have to do Monte Carlo VaR calculation (i.e. sample copula and calculate VaR on that data), as there are no closed form solutions available for VaR for most of the copula classes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And yes, Gaussian copula would suffer the same problems as estimating the multivariate normal distribution. Instead of Gaussian copula you can try elliptical t-copula (but note that it's symmetric) or empirical copula. Yes, Gaussian copula and other normality assumptions are highly criticized in many papers for underestimating the tail risks. &lt;/p&gt;&#xA;" OwnerUserId="370" LastEditorUserId="370" LastEditDate="2012-04-20T08:53:14.433" LastActivityDate="2012-04-20T08:53:14.433" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="3300" PostTypeId="2" ParentId="3296" CreationDate="2012-04-20T14:24:45.260" Score="-1" Body="&lt;p&gt;I would start by studying the distribution of the returns. Normal or not? (probably not). &lt;p&gt;&#xA;Then, study the behavior of your stocks one against the others.&#xA;Other actors to take into account are your data, and your requirements in terms computational time.&lt;p&gt;&#xA;All that will allow you to decide whether VaR or copula, and which particuliar methodology to follow.&lt;p&gt;&#xA;(Last time I recommended a book I had got a penalty, pero bueno ..) &lt;p&gt;&#xA;You will find hints in &lt;b&gt;Frequently Asked Questions in Quantitative Finance&lt;/b&gt; (P.Wilmott) and &lt;b&gt;Market Risk Analysis Vol.3&lt;/b&gt; (C.Alexander).&lt;/p&gt;&#xA;" OwnerUserId="2220" LastActivityDate="2012-04-20T14:24:45.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3301" PostTypeId="1" AcceptedAnswerId="4006" CreationDate="2012-04-20T15:35:16.767" Score="5" ViewCount="2873" Body="&lt;p&gt;I'm trying to understand how to combine two strategies dynamically in trading: one mean-reversion and the other momentum.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way (also the simplest one) of doing this is by scaling/normalizing values from both strategies and simply adding them. However, this doesn't seem to be a very smart way of doing things. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way (statistics/technical analysis/DSP/etc.) of separating momentum stocks from mean-reverting stocks and applying these strategies separately on those stocks based on whether they are more likely to be trending than mean-reverting? Or maybe some other way of utilizing both strategies in tandem to achieve a higher Sharpe?&lt;/p&gt;&#xA;" OwnerUserId="1926" LastEditorUserId="35" LastEditDate="2012-04-20T16:44:06.587" LastActivityDate="2012-08-24T23:35:59.903" Title="How are momentum and reversion long/short strategies dynamically combined in trading?" Tags="&lt;quant-trading-strategies&gt;&lt;quantitative&gt;&lt;mean-reversion&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3302" PostTypeId="1" AcceptedAnswerId="3303" CreationDate="2012-04-20T16:03:37.757" Score="7" ViewCount="10909" Body="&lt;p&gt;I've been experimenting with bond pricing using easily available data (treasury auction prices and treasury yield curves on treasury direct).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At first I assumed that I could use the components yield curve to price any (risk free) series of cash flows, but that doesn't work because the curve is of the yield-to-maturity of instruments with multiple payments over time, not spot rates for cash on a date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I feel like I should be able to approximate the spot rate curve from the treasury curve, but I'm not sure how. I feel like I need more than just the yield-to-maturity - wouldn't I also need the coupon rate for an instrument? Otherwise the equation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;PV_{\text{payments discounted with IRR}} = PV_\text{payments discounted at spot rates}&#xD;&#xA;$$&#xA;$$&#xD;&#xA;par*df_{IRR}+\sum_{c=coupons}c*df_{IRR} = par*df_{spot}(t_{par})+\sum_{c = coupons}c*df_{spot}(t_c)&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;has too many unknowns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there published coupon rates that go along with the treasury yield curve? Am I missing something fundamental here? Am I just working with the wrong data-set?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't have any formal background in finance, so if the answer is &quot;read book $x&quot; then that is okay with me.&lt;/p&gt;&#xA;" OwnerUserId="2315" LastActivityDate="2012-04-20T17:15:28.217" Title="Deriving spot rates from treasury yield curve" Tags="&lt;interest-rates&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3303" PostTypeId="2" ParentId="3302" CreationDate="2012-04-20T16:20:45.587" Score="5" Body="&lt;p&gt;First step is to decide what instruments you want to include in your process for estimating the spot curve. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You want to look at the following instruments for inclusion - treasury coupon strips, on-the-run treasury issues, and some off-the-run treasury issues (those not trading at liquidity discounts), or all treasury coupon securities and bills. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You want to ensure your selected instruments are not biased by credit risk, embedded options, pricing errors, or liquidity as noted above. You might want to filter securities that are on &quot;special&quot; (i.e. trading at a lower yield than their true yield in the repo market.)&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;If you select only Treasury coupon strips, then the process is simple since the yields on the coupon strips are by definition spot rates. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you select on-the-run Treasury issues with or without off-the-run Treasury issues then you use the &lt;a href=&quot;http://en.wikipedia.org/wiki/Bootstrapping_%28finance%29&quot; rel=&quot;nofollow&quot;&gt;bootstrap&lt;/a&gt; approach. Given the par yield curve, linear interpolation is used to fill in gaps for missing maturities. Bootstrapping is then used to construct the theoretical spot yield curve. Bootstrapping is a technique that repetitively applies &#xA;a no-arbitrage implied forward rate equation to yields on the estimated Treasury par yield curve. This post on &lt;a href=&quot;http://rebrained.com/?p=23&quot; rel=&quot;nofollow&quot;&gt;bootstrapping&lt;/a&gt; does a nice job illustrating several of these concepts.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you select all Treasury coupon securities and bills, then you must use techniques more complex than bootstrapping. See Vasicek and Fong, &quot;&lt;a href=&quot;http://219.225.6.7:8019/paper/Term%20Structure%20Modeling%20Using__%20Exponential%20Splines.pdf&quot; rel=&quot;nofollow&quot;&gt;Term Structure Modelling Using Exponential Splines&lt;/a&gt;&quot;, Journal of Finance, (May 1982).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Frank Fabozzi's &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0071358056&quot; rel=&quot;nofollow&quot;&gt;Handbook of Fixed Income Securities&lt;/a&gt; can help you understand the other methods as well. &lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-04-20T17:15:28.217" LastActivityDate="2012-04-20T17:15:28.217" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3304" PostTypeId="2" ParentId="303" CreationDate="2012-04-20T21:01:44.687" Score="5" Body="&lt;p&gt;F# is mainly a functional language, but it's also rich in OO features. This makes it very suitable, for example, for writing a pricing framework and at the same time make writing payoffs more straightforward. In the long run, it definitely saves a long time writing/debugging and maintaining models.&lt;/p&gt;&#xA;" OwnerUserId="2317" LastActivityDate="2012-04-20T21:01:44.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3305" PostTypeId="1" CreationDate="2012-04-21T00:16:28.347" Score="7" ViewCount="1057" Body="&lt;p&gt;Given a set of monthly alpha forecasts (i.e. standardized z-scores from a multi-factor return model) and a non-linear market impact model (or more specifically, its piecewise-linear approximation), is there a generally accepted &amp;quot;standard&amp;quot; method of setting their objective weights in an optimization so they are scaled appropriately?&lt;/p&gt;&#xA;&lt;p&gt;Based on historical returns of a back-test, some of the methods that have been suggested include:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;Let,&#xA;&#xA;a = average monthly gross portfolio alpha forecast&#xA;R = annual realized gross portfolio return&#xA;XO = average annual portfolio turnover&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Set t-cost objective &lt;span class=&quot;math-container&quot;&gt;$= (12 \times a) / R$&lt;/span&gt;, set alpha objective &lt;span class=&quot;math-container&quot;&gt;$= 1$&lt;/span&gt;. This effectively converts the arbitrary z-score to an actual return forecast (or set the alpha objective = the reciprocal of this value, and the t-cost &lt;span class=&quot;math-container&quot;&gt;$= 1$&lt;/span&gt;).&lt;/li&gt;&#xA;&lt;li&gt;Set t-cost objective &lt;span class=&quot;math-container&quot;&gt;$= (a / R) * XO$&lt;/span&gt;, set alpha objective &lt;span class=&quot;math-container&quot;&gt;$= 1$&lt;/span&gt;. This treats t-cost as an annual number, and adjusts the holding period horizon based on annual expected turnover.&lt;/li&gt;&#xA;&lt;li&gt;Set t-cost objective &lt;span class=&quot;math-container&quot;&gt;$=$&lt;/span&gt; the full period average of [stock-level alpha / forward return]. Cross-sectionally more accurate and removes the effect of large portfolio weights on long-term averages.&lt;/li&gt;&#xA;&lt;li&gt;Re-scale alphas using Grinold approach: &lt;span class=&quot;math-container&quot;&gt;$\alpha = IC \times \text{volatility} \times \text{z-score}$&lt;/span&gt;, then objective weight for both alpha and t-cost &lt;span class=&quot;math-container&quot;&gt;$= 1$&lt;/span&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="779" LastEditorUserId="41390" LastEditDate="2020-09-12T20:19:47.730" LastActivityDate="2020-09-12T20:19:47.730" Title="Is there a standard method of scaling alpha forecasts to t-cost estimates?" Tags="&lt;portfolio-management&gt;&lt;optimization&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="3308" PostTypeId="2" ParentId="3110" CreationDate="2012-04-21T10:46:26.560" Score="1" Body="&lt;p&gt;Ok firstly while i am only an amateur quant i just happen to be a professional data center designer in the UK. I design data centers from small N resilient rooms to multi megawatt co-location facilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ultimately the question of whether to move your equipment into a co-location facility depends entirely on your business needs. To properly understand this you need to assess the capabilities of your existing facilities with respects to the connectivity of the site, security, power availability, average external ambient conditions and the cost of floor space vs office space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simply put you should invest in a consultancy for an expert to perform a needs analysis and site assessment, with this information they can write a report with some indicative costing of building a new data centre and any site limitations. Using this information you can then quantify any decision on whether to co-locate or build a new facility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are serious about owning a data center then i urge you to contact a professional as soon as possible, the earlier the engagement the more effective the design and the more informed the business decisions. Retrospective designing is painful for everyone!!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="2321" LastActivityDate="2012-04-21T10:46:26.560" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3309" PostTypeId="2" ParentId="111" CreationDate="2012-04-21T11:12:29.510" Score="24" Body="&lt;p&gt;Two aspects of statistical learning are useful for trading&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; First the ones mentioned earlier: some &lt;strong&gt;statistical methods&lt;/strong&gt; focused on working on &lt;em&gt;live&lt;/em&gt; datasets. It means that you know you are observing only a sample of data and you want to &lt;strong&gt;extrapolate&lt;/strong&gt;. You thus have to deal with &lt;em&gt;in sample&lt;/em&gt; and &lt;em&gt;out of sample&lt;/em&gt; issues, &lt;em&gt;overfitting&lt;/em&gt; and so on... From this viewpoint, data-mining is more focused on &lt;em&gt;dead datasets&lt;/em&gt; (ie you can see almost all the data, you have an &lt;em&gt;in sample only&lt;/em&gt; problem) than statistical learning.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because statistical learning is about working on live dataset, the applied maths that deal with them had to focus on a &lt;em&gt;two scales problem&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\left\{\begin{array}{lcl}&#xA;X_{n+1} &amp;amp;=&amp;amp; F_\theta(X_n,\xi_{n+1})\\&#xA;{\hat\theta}_{n+1} &amp;amp;=&amp;amp; L(\pi(X_n),{\hat\theta}_n)&#xA;\end{array}\right.$$&#xA;where $X$ is the (multidimentional) state space to study (you have in it your explanatory variables and the ones to predict), $F$ contains the dynamics of $X$ which need some parameters $\theta$. The randomness of $X$ comes from the innovation $\xi$, which is i.i.d.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The goal of statistical learning is to build a methodology $L$ ith as inputs a partial observation $\pi$ of $X$ and progressively adjust an estimate $\hat\theta$ of $\theta$, so that we will know all that is needed on $X$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you think about using statistical learning to &lt;strong&gt;find the parameters of a linear regression&lt;/strong&gt;, we can model the state space like this:&#xA;$$\underbrace{\left( \begin{array}{c} &#xA;y_{n+1}\\ x_{n+1}&#xA;\end{array}\right)}_{X_{n+1}} = \left[ \begin{array}{ccc} &#xA;a &amp;amp; b &amp;amp; 1\\&#xA;1 &amp;amp; 0 &amp;amp; 0\\&#xA;\end{array}\right] \cdot \underbrace{\left( \begin{array}{c} &#xA;x_{n}\\1\\ \epsilon_{n+1}&#xA;\end{array}\right)}_{\xi_{n+1}}$$&#xA;which thus allows to observe $(y,x)_n$ at any $n$; here $\theta=(a,b)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you need to find a way to progressively build an estimator of $\theta$ using our observations. Why not a gradient descent on the L2 distance between $y$ and the regression:&#xA;$$C(\hat a, \hat b)_n = \sum_{k\leq n} (y_k - (\hat a \, x_k + \hat b))^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So we can build these dynamics:&#xA;$${\hat a}_{n+1} = {\hat a}_n - \gamma_{n+1} \,\frac{\partial\, C({\hat a}_n, {\hat b}_n)_{n+1}}{\partial\, {\hat a}_n}$$&#xA;and similarly for $\hat b$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here $\gamma$ is a weighting scheme.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually a nice way to build an estimator is to write properly the criteria to minimize and implement a gradient descent that will produce the learning scheme $L$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Going back to our original generic problem&lt;/strong&gt;: we need some applied maths to know when couple dynamical systems in $(X,\hat\theta)$ converge, and we need to know how to build estimating schemes $L$ that converge &lt;em&gt;towards the original&lt;/em&gt; $\theta$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To give you pointers on such mathematical results:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;on the first aspects (convergence of the coupled system), you have papers like &lt;a href=&quot;http://projecteuclid.org/DPubS?service=UI&amp;amp;version=1.0&amp;amp;verb=Display&amp;amp;handle=euclid.aoap/1029962603&quot;&gt;Stochastic approximation algorithms with constant step size whose average is cooperative, by Michel Benaïm and Morris W. Hirsch, in Ann. Appl. Probab. Volume 9, Number 1 (1999), 216-241.&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;and on the second one (study on the convergence of $\hat\theta$ to $\theta$), you have this kind of papers/results: &lt;a href=&quot;http://projecteuclid.org/DPubS?service=UI&amp;amp;version=1.0&amp;amp;verb=Display&amp;amp;handle=euclid.aoms/1177729586&quot;&gt;A Stochastic Approximation Method, by Herbert Robbins and Sutton Monro, in Ann. Math. Statist. Volume 22, Number 3 (1951), 400-407.&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Now we can go back to the second aspect of statistical learning that is very interesting for quant traders/strategists:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; The results used to prove the efficiency of statistical learning methods can be used to &lt;strong&gt;prove the efficiency of trading algorithms&lt;/strong&gt;. To see that it is enough to read again the coupled dynamical system that allows to write statistical learning:&#xA;$$\left\{\begin{array}{lcl}&#xA;M_{n+1} &amp;amp;=&amp;amp; F_\rho(M_n,\xi_{n+1})\\&#xA;{\hat\rho}_{n+1} &amp;amp;=&amp;amp; L(\pi(M_n),{\hat\rho}_n)&#xA;\end{array}\right.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now $M$ are market variables, $\rho$ is underlying PnL, $L$ is a trading strategy. Just replace &lt;em&gt;minimizing a criteria&lt;/em&gt; by &lt;em&gt;maximizing the PnL&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See for instance &lt;a href=&quot;http://arxiv.org/abs/0910.1166&quot;&gt;Optimal split of orders across liquidity pools: a stochatic algorithm approach by: Gilles Pagès, Sophie Laruelle, Charles-Albert Lehalle&lt;/a&gt;, in this paper, authors show who to use this approach to optimally split an order across different &lt;em&gt;dark pools&lt;/em&gt; simultaneously learning the capability of the pools to provide liquidity and using the results to trade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The statistical learning tools can be used to &lt;strong&gt;build iterative trading strategies&lt;/strong&gt; (most of them are iterative) and &lt;strong&gt;prove their efficiency&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2014-09-19T21:02:09.900" LastActivityDate="2014-09-19T21:02:09.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3310" PostTypeId="2" ParentId="111" CreationDate="2012-04-21T12:53:56.550" Score="7" Body="&lt;p&gt;People seem to think that using ML is going to circumvent the process of actually learning to trade, it doesn't. ML can be used to refine trading ideas, but it doesn't generate them, you need to use your brain for that.&lt;/p&gt;&#xA;" OwnerUserId="1397" LastActivityDate="2012-04-21T12:53:56.550" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3312" PostTypeId="1" CreationDate="2012-04-21T18:02:48.053" Score="8" ViewCount="2328" Body="&lt;p&gt;I would like to write a program that takes as input a list of CIK/year/quarter entries.  The program should iterate through the list and, for each entry, grab XBRL financial data from the SEC website for the given CIK/year/quarter combination.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can decipher some parts of the SEC file structure, but not all. For example, post fixing &lt;code&gt;Archives/edgar/data/1288776/11/&lt;/code&gt; to the SEC base address gives a directory listing of all filings for the year 2011, for the company with CIK 1288776. Unfortunately I cannot make sense of the naming convention within this directory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way around this is to simply use the SEC's search tool. However, this requires that I use a web crawler and I would prefer to use ftp directly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone clarify how accession numbers are assigned? How do others go about pulling financials from the SEC website?&lt;/p&gt;&#xA;" OwnerUserId="2323" LastEditorUserId="35" LastEditDate="2012-04-21T23:00:37.607" LastActivityDate="2018-12-26T17:34:53.080" Title="Automated 10-K XBRL data grab using the SEC file structure" Tags="&lt;data&gt;&lt;programming&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="3314" PostTypeId="2" ParentId="3312" CreationDate="2012-04-21T22:51:43.403" Score="7" Body="&lt;p&gt;Look in &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;edgar/full-index/{YYYY}/QTR{N}/xbrl.idx&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can grab the compressed version too:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;xbrl.{Z,sit,gz,zip}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will state what file you want.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For example, I want AOL's 10-K that was filed in the first quarter of 2012. So I download&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;edgar/full-index/2012/QTR1/xbrl.gz&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After decompressing, I see that AOL's 10-K is available at&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;edgar/data/1468516/0001193125-12-076633.txt&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="35" LastEditorUserId="35" LastEditDate="2012-04-21T22:59:14.067" LastActivityDate="2012-04-21T22:59:14.067" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3315" PostTypeId="2" ParentId="1274" CreationDate="2012-04-21T23:53:57.357" Score="5" Body="&lt;p&gt;I'm assuming that the algorithm is a black box. [You can't see any or all of the inner workings]. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You would reverse engineer it like you would anything else: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Collect evidence of events [Signals to buy/sell, quantities], and the environment that it operates in. &lt;/li&gt;&#xA;&lt;li&gt;Make theories, and then model them.&lt;/li&gt;&#xA;&lt;li&gt;For each of the theories: Make a convincing argument for the events, or a case to disprove the model. &lt;/li&gt;&#xA;&lt;li&gt;The strongest model that you have is your &quot;best believe&quot;. If you completely disprove a model, then eliminate it, and write up something on why. [This is so if you come back to the same question you can re verify the beliefs]&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Remember market data, and systems will always be noisy [as will human traders]. You can develop hyptohesis, but rarely ever can you prove something.&lt;/p&gt;&#xA;" OwnerUserId="1204" LastActivityDate="2012-04-21T23:53:57.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3316" PostTypeId="2" ParentId="3284" CreationDate="2012-04-21T23:59:08.177" Score="14" Body="&lt;p&gt;From my experience, EODData is pretty much that you get what you pay for. Its not a very sophisticated product. They email you the files you subscribe to, and thats that. I have had an issue before of where the emails didn't go through anymore and I never heard anything from them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On Quality,&#xA;I can't make a claim on its accuracy. It seems good. I find issue with three things about the data:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;There is no way to signal an exchange change&lt;/li&gt;&#xA;&lt;li&gt;It doesn't give you an easy way to grab the symbol info [Names, etc] &lt;/li&gt;&#xA;&lt;li&gt;If there is a stock split or dividend, it does not mention this in the data.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;That being said, it does do a good job with keeping a simple file format, and providing &quot;long term&quot; historical data.&lt;/p&gt;&#xA;" OwnerUserId="1204" LastEditorUserId="1204" LastEditDate="2018-04-30T22:21:32.587" LastActivityDate="2018-04-30T22:21:32.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3317" PostTypeId="1" AcceptedAnswerId="3325" CreationDate="2012-04-22T08:33:17.610" Score="3" ViewCount="210" Body="&lt;p&gt;I'm currently doing a course in derivatives pricing and I'm having some trouble wrapping my head around the sweet spot where theory meets reality in terms of Risk Neutral Pricing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that the first and second fundamental theorems of asset pricing lays the foundation for  the normal risk neutral pricing argument, and that part is fine. However my lecturer said that  for example if you have certain types of stochastic volatility, or the asset price follows a jump process you can no longer hedge all the risks from holding the option. But the way I understand it you need to be able to hedge all the risks from the asset price process in order to use the RNP framework.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question is this; when building a model for an asset price process (that you ideally want to be as realistic as possible), what specific characteristics (assumptions about sources of risk etc.) need to be in place in order to keep you within the RNP framework. Conversely, at what point does this machinery break down?&lt;/p&gt;&#xA;" OwnerUserId="1128" LastActivityDate="2012-04-23T18:16:18.743" Title="What mathematical characteristics are required from the asset price process in order to stay within the RNP framework?" Tags="&lt;option-pricing&gt;&lt;stochastic-processes&gt;&lt;risk-neutral-measure&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3318" PostTypeId="2" ParentId="3317" CreationDate="2012-04-22T11:40:55.757" Score="2" Body="&lt;p&gt;This depends. I am not aware of a general risk neutral pricing framework applying to all asset classes and/or stochastic processes. In order to reach more general statements about risk neutral pricing you need to consider jumps and autocorrelation depending on the asset regarded, maybe stochastic interest rates and/or volatility. If I remember correctly, in case of (autocorrelated) fractional Brownian Motion arbitrage opportunities occur. Thus standard assumptions do not hold anymore. So you need to compare with the assumptions of &quot;your&quot; risk neutral pricing framework. In case of the Black-Scholes-Model simply deviation from its assumptions need to be accounted for: normally distributed returns do not exhibit jumps nor autocorrelation, constant volatility does not account for shifts or clusters of volatility. Your asset might not be liquid (think of options on small single stocks) or interest rate might not be constant - gets more important with interest rate derivatives, but applies to longer dated euqity (index) options as well.&lt;/p&gt;&#xA;" OwnerUserId="2284" LastActivityDate="2012-04-22T11:40:55.757" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3319" PostTypeId="1" CreationDate="2012-04-22T18:58:16.470" Score="19" ViewCount="91070" Body="&lt;p&gt;I am preparing for the CFA level 2 exam, I got confused by the concept Z-spread and OAS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When a call option is added to a bond, since it is not favorable to the bond buyer, they would require more spread (which is the OAS) for this instrument in order to get more discount on the bond price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So to me, Z spread should be less than the OAS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this is not what has been discussed in the book. Can someone help with this?&lt;/p&gt;&#xA;" OwnerUserId="2326" LastEditorUserId="467" LastEditDate="2012-04-22T21:29:51.347" LastActivityDate="2017-11-20T23:04:34.297" Title="What is the difference between Option Adjusted Spread (OAS) and Z-spread?" Tags="&lt;fixed-income&gt;" AnswerCount="13" CommentCount="0" FavoriteCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="3320" PostTypeId="2" ParentId="3319" CreationDate="2012-04-22T19:45:12.077" Score="3" Body="&lt;p&gt;The z-spread and OAS both are measures of the difference in price between an ABS and a zero-risk bond.  The OAS and z-spread are not spreads that a bond with and without options &lt;em&gt;should&lt;/em&gt; require, they are two ways of looking at the same bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The CFA material states that the z-spread is equal to the OAS when&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;There is no prepayment option&lt;/li&gt;&#xA;&lt;li&gt;There is a prepayment option, but the borrowers tend not to exercise that option.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The z-spread essentially ignores the option, so a larger spread is needed to explain the price of a bond if there is an option that has a good chance of being exercised.&lt;/p&gt;&#xA;" OwnerUserId="1418" LastActivityDate="2012-04-22T19:45:12.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3321" PostTypeId="2" ParentId="3319" CreationDate="2012-04-22T21:28:13.000" Score="31" Body="&lt;p&gt;To sum up what is discussed in the CFA curriculum, it discusses 3 types of spreads. They are used to compare a risky bond to a Treasury bond (assumed to be risk-free).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Nominal spread&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simply computes the difference between the YTM of the risk-free bond and the YTM of the risky bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The major problem of this measure is that &lt;em&gt;it doesn't take into account the shape of the spot yield curve&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Zero-volatility Spread or Z-Spread&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This spread is actually a single value that needs to be added to every spot yield of the curve in order to make the present value of the risky bond equal to the present value of the risk-free bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, if the present value of the risky bond is $v_b$, then the Z-spread $z$ is the value such that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$v_b = \sum_{i=1}^N \frac{C}{(1+R_f(0,i)+z)^i}+\frac{FV}{(1+R_f(0,N)+z)^N}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $R_f(0,t)$ is the spot rate for maturity $t$ for a risk-free bond (not annualized).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This still doesn't take into account any embedded option to the risky bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Option-Adjusted Spread (OAS)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This last spread is used to measure the impact of the optionality in the bond. It is defined as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{OAS}=z-o$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $o$ is the the price of the embedded option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For callable bonds, the option benefits the issuer (it allows him to buy back the bonds if rates go down, i.e. bond prices go up), and $o&amp;gt;0$ hence $\text{OAS}&amp;lt;z$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For putable bonds, the option benefits the bond owner (it allows him to sell back the bonds if rates go up, i.e. bond prices go down), and $o&amp;lt;0$ hence $\text{OAS}&amp;gt;z$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It there is no embedded option, then $o=0$, $\text{OAS}=z$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe spreads are to be understood as being used to measure the risk inherent to the core bond, and not to the option that are embedded to it. Hence, if the bond was callable, you required more yield for the bond, but the &quot;core&quot; bond only required a spread equal to the OAS and not really the spread computed by the Z-Spread approach.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2012-04-23T06:16:06.663" LastActivityDate="2012-04-23T06:16:06.663" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3322" PostTypeId="1" CreationDate="2012-04-23T12:18:10.250" Score="2" ViewCount="473" Body="&lt;p&gt;What discount curve should be used for a swap with a fixed leg and variable leg, where the variable leg is based on rate other than Libor (in my case 1-year deposit rate). Hull (5th edition, page 595) say we always use Libor for discounting (his example however is a basis swap). That seems inconsistent to me, 1) the value of the swap won't be zero at inception 2) value of swap will change due to Libor/Swap rates. My case is somewhat more complicated by the fact that cash-flows are in RMB currency, while that's not the core of my question, any additional thoughts on that would be welcome.&lt;/p&gt;&#xA;" OwnerUserId="2329" LastEditorUserId="1800" LastEditDate="2012-04-23T14:07:31.123" LastActivityDate="2015-09-20T16:57:35.813" Title="How to value non-libor swaps (not basis swaps)?" Tags="&lt;swaps&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3323" PostTypeId="1" CreationDate="2012-04-23T14:20:50.097" Score="22" ViewCount="1904" Body="&lt;p&gt;Assume $X_t$ is a multivariate Ornstein-Uhlenbeck process, i.e.&#xA;$$dX_t=\sigma dB_t-AX_tdt$$&#xA;and the spot interest rate evolves by the following equation:&#xA;$$r_t=a+b\cdot X_t.$$&#xA;After solving for $X_t$ using $e^{tA}X_t$ and Ito and looking at $\int_0^T{r_s\;ds}$, it turns out that &#xA;$$\int_0^T{r_s\;ds} \sim \mathcal{N}(aT+b^{T}(I-e^{-TA})A^{-1}X_0,b^{T}V_Tb)$$&#xA;where $V_t$ is the covariance matrix of $\int_0^T(I-e^{-(T-u)A})A^{-1}\sigma dB_u$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This gives us the yield curve&#xA;$$y(t)=a+\frac{b^{T}(I-e^{-tA})A^{-1}X_0}{t}+\frac{b^{T}V_tb}{2t}$$&#xA;and by plugging in $A= &#xD;&#xA; \begin{pmatrix}&#xD;&#xA;  \lambda &amp;amp; 1  \\&#xD;&#xA;  0 &amp;amp; \lambda  \\&#xD;&#xA; \end{pmatrix}$&#xA;we finally arrive at&#xA;$$y(t)=a+\frac{1-e^{-\lambda t}}{\lambda t}C_0+e^{-\lambda t}C_1+\frac{b^{T}V_tb}{2t}.$$&#xA;The formula above without $\frac{b^{T}V_tb}{2t}$ is known as the Nelson-Siegel yield curve model. Could somebody clarify why neglecting $\frac{b^{T}V_tb}{2t}$ leads to arbitrage opportunities?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I am essentially asking the following question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is the above model (with $\frac{b^{T}V_tb}{2t}$) arbitrage free?&lt;/p&gt;&#xA;" OwnerUserId="2101" LastEditorUserId="1106" LastEditDate="2012-05-16T14:26:31.433" LastActivityDate="2015-10-01T12:48:06.823" Title="Why isn't the Nelson-Siegel model arbitrage-free?" Tags="&lt;interest-rates&gt;&lt;models&gt;&lt;arbitrage&gt;&lt;yield-curve&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3324" PostTypeId="1" CreationDate="2012-04-23T16:34:12.723" Score="3" ViewCount="323" Body="&lt;p&gt;I am reading &lt;a href=&quot;http://www.jds-online.com/file_download/353/JDS-746.pdf&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt; on Bayesian Estimation of CIR Model.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, it is about estimating parameters using Bayesian inference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It estimates this stochastic differential equation:&#xA;$$dy(t)=\{ \alpha-\beta y(t)\}dt+ \sigma \sqrt{y(t)}dB(t)$$&#xA;where $B(t)$ is standard Brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;by using this approximation:&#xA;$$y(t+ {\Delta}^{+})=y(t)+\{\alpha-\beta y(t) \}{\Delta}^{+}+\sigma \sqrt{y(t)} {\epsilon}_{t}$$&#xA;${\epsilon}_{t} \tilde{\ }N(0, {\Delta}^{+})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is:&#xA;Let $Y=({y}_{1},...,{y}_{T})$ denote observation data and&lt;br&gt;&#xA;${Y}^{*}=(y_{1}^{*},...,y_{T-1}^{*})$ be AUGMENTED data, where $y_{*}^{t}=\{ y_{t,1}^{*},..., y_{t,M}^{*} \}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is augmented data?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see that $y_{1}^{*}$ has elements  $y_{1,1}^{*},..., y_{1,M}^{*}$.  Is this what's so called augmented data?  Why do we need this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems like a finance concept I am missing.&lt;/p&gt;&#xA;" OwnerUserId="2330" LastEditorUserId="467" LastEditDate="2012-04-23T16:48:34.397" LastActivityDate="2012-04-23T18:29:42.860" Title="What is augmented data when simulating stochastic differential equations using Gibbs Sampler?" Tags="&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3325" PostTypeId="2" ParentId="3317" CreationDate="2012-04-23T17:54:29.207" Score="1" Body="&lt;p&gt;I assume that by &quot;this machinery breaks down&quot; you mean when it breaks down as theory, but not as a practical tool. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would say that the exact point where risk neutral pricing approach fails is when the payoff is no more attainable. There exist a precise mathematical characterization for attainable payoffs (see the book of Hans Föllmer, Alexander Schied, &quot;Stochastic Finance: An Introduction in Discrete Time&quot;). And as far as I know, there is no standard approach to valuation and hedging non-attainable payoffs (&lt;a href=&quot;http://books.google.ch/books?id=cHSdBaYmsCcC&amp;amp;lpg=PA306&amp;amp;ots=7VAIUypFzD&amp;amp;dq=hedging%20non-attainable%20payoff&amp;amp;pg=PA305#v=onepage&amp;amp;q=hedging%20non-attainable%20payoff&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;for example&lt;/a&gt;). Note also that there are many reasons for payoff to be non-attainable and it's hard to define them all precisely.   &lt;/p&gt;&#xA;" OwnerUserId="370" LastEditorUserId="370" LastEditDate="2012-04-23T18:16:18.743" LastActivityDate="2012-04-23T18:16:18.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3326" PostTypeId="2" ParentId="3324" CreationDate="2012-04-23T18:29:42.860" Score="4" Body="&lt;p&gt;This is not a finance concept. Augmented data is related to Bayesian inference. It's essentially a way to improve maximum likelihood estimation from incomplete  data. For details see the article &quot;&lt;a href=&quot;http://faculty.chicagobooth.edu/hedibert.lopes/teaching/ccis2010/1987TannerWong.pdf&quot; rel=&quot;nofollow&quot;&gt;The calculation of posterior distributions by data augmentation&lt;/a&gt;&quot; by Martin A.  Tanner  and  Wing  Hung Wong (it's referred in the paper you are reading).&lt;/p&gt;&#xA;" OwnerUserId="370" LastActivityDate="2012-04-23T18:29:42.860" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="3327" PostTypeId="2" ParentId="303" CreationDate="2012-04-23T20:00:21.090" Score="1" Body="&lt;p&gt;I know one shop which is doing some new projects in F# replacing some of their OCaml stuff, I asked the guy what they used it for and he replied &quot;mostly data cleaning&quot;.&lt;/p&gt;&#xA;" OwnerUserId="1397" LastEditorUserId="1397" LastEditDate="2012-04-23T23:06:45.040" LastActivityDate="2012-04-23T23:06:45.040" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3329" PostTypeId="1" AcceptedAnswerId="3334" CreationDate="2012-04-23T23:05:27.083" Score="17" ViewCount="8229" Body="&lt;p&gt;Let's assume I have an arbitrary option that I can price using Monte-Carlo simulation. What is the general approach (i.e. without relying on specific option type) to calculating the greeks in this case?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; I woud like to add a few links on the topic that I found useful:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://eprints.maths.ox.ac.uk/716/1/Thesis_SK.pdf&quot; rel=&quot;noreferrer&quot;&gt;Vibrato monte carlo and the calculation of greeks&lt;/a&gt; &lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.math.nyu.edu/faculty/avellane/ConqueringTheGreeks.pdf&quot; rel=&quot;noreferrer&quot;&gt;Conquering the Greeks in Monte Carlo&lt;/a&gt; &lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www2.gsb.columbia.edu/faculty/pglasserman/Other/RiskJan2006.pdf&quot; rel=&quot;noreferrer&quot;&gt;Smoking adjoints: fast Monte Carlo Greeks&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="370" LastEditorUserId="370" LastEditDate="2012-04-26T18:42:14.923" LastActivityDate="2014-11-13T00:21:40.537" Title="How to get greeks using Monte-Carlo for arbitrary option?" Tags="&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;greeks&gt;" AnswerCount="5" CommentCount="2" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="3330" PostTypeId="2" ParentId="3329" CreationDate="2012-04-24T01:10:19.270" Score="4" Body="&lt;p&gt;The most general answer is to shift your input to approximate the first derivative.  Given that you need Monte Carlo to price this, it may get expensive.  But that's the way it goes as when you have no analytical solutions as &lt;em&gt;there aint't no free lunch&lt;/em&gt; ...&lt;/p&gt;&#xA;" OwnerUserId="69" LastActivityDate="2012-04-24T01:10:19.270" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3331" PostTypeId="1" CreationDate="2012-04-24T07:01:33.173" Score="5" ViewCount="367" Body="&lt;p&gt;&lt;strong&gt;Setting the scene&lt;/strong&gt;: Assume a multivariate GBM with correlation matrix $\Sigma$. Further, one want to estimate the correlation between two of the assets. Assume one has a suitable estimator of the correlation, the exact estimator might not be directly relevant, so assume e.g. standard, 60 days moving average.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Identifying the issue&lt;/strong&gt;: If one look at the time series of the correlations, it is obvious that a correlation is not constant over time, as postulated by gbm. Is there any good measure of &quot;correlation volatility&quot;, i.e. a measure that says when a correlation seems stable? Alternatively, a measure that will quickly identify that the correlation is unrelieable?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Attempt&lt;/strong&gt;: Ive tried to look at the maximum (absolute) changes of the close the last 60 days, and then created a band around todays estimation equal to $(p_t + max, p_t-max)$, where p is the correlation estimate and max is the max absolute movement. Then I have said that if this spread is higher than some given value (say 0.15), then the correlation is &quot;unstable&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have also tried different variation as looking at the maximum return, highest vs. lowest value etc. I am a bit vary to over-model this, so I hesistate to start giving correlation coefficient a probability distribution etc...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the same time, I find my approach a bit unsatisfactory, and wondering if there is any &quot;well designed&quot; tests to see whether two variables satisfy such a linear dependence that correlation is...&lt;/p&gt;&#xA;" OwnerUserId="1583" LastEditorUserId="1583" LastEditDate="2012-04-24T07:19:17.190" LastActivityDate="2012-09-12T16:21:35.820" Title="Correlation: Test for linear dependence" Tags="&lt;correlation&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3332" PostTypeId="2" ParentId="3322" CreationDate="2012-04-24T10:25:03.060" Score="4" Body="&lt;p&gt;Discounting in &quot;post-crunch finance&quot; depends on collateral agreements, e.g. CSA. For fully collateralized transactions you discount off the curve corresponding to the rate you receive on collateral. For non-collateralized or partially collateralized transactions it's more tricky and it's not something I can explain in a short answer, have a look on the internet, try for example &quot;discounting csa&quot;. Forget about Hull, that's &quot;pre-crunch finance&quot;.&lt;/p&gt;&#xA;" OwnerUserId="2149" LastActivityDate="2012-04-24T10:25:03.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3333" PostTypeId="2" ParentId="3284" CreationDate="2012-04-24T13:21:03.257" Score="23" Body="&lt;p&gt;Don't use them.  I have used them for years because I couldn't find another source that would provide all stocks in all US exchanges -- till now.  But first, about eoddata:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;their data is very often missing elements, e.g., on any given day the SP500 index data my not be in their data set, even for a normal trading day&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;their ftp files are often out of date, meaning if you need the previous day's data, you might have to wait a day or more to get it&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;their customer support is absolutely useless.  You can't phone them (there is no phone  number on their website), all you can do is fill out a web form.  Most times I never got a response, and when I did, it was perfunctory and absolutely no help&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In order to cancel your &quot;subscription&quot;, they need a written cancellation notice.  I sent them just such a notice via certified mail.  I have verified that they received it on April 20, 2012, and yet today, 4/24/2012, I just received notice that they are billing me again for the coming month.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I found a phone number for eoddata on bbb.com, but no one never answers, all there is is a message, after 20 rings or so, saying &quot;try again later&quot; &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Bottom line: if you need your data to be there every day on schedule, DO NOT  use eoddata.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The good news: premiumdata.net is an excellent service in every way -- data quality, dependability, customer support.  They are more expensive than eoddata, but you get what you pay for.&lt;/p&gt;&#xA;" OwnerUserId="2334" LastActivityDate="2012-04-24T13:21:03.257" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3334" PostTypeId="2" ParentId="3329" CreationDate="2012-04-24T13:40:15.063" Score="11" Body="&lt;p&gt;You need to compute your greeks as &lt;a href=&quot;http://mathworld.wolfram.com/FiniteDifference.html&quot; rel=&quot;noreferrer&quot;&gt;finite differences&lt;/a&gt;, but the full procedure may be pretty tricky.  I will use vega $\aleph$ as the example here. Let's begin by designating your Monte Carlo estimator as a function $V(\sigma,s,M)$ where $\sigma$ is the volatility as usual, $s$ is the seed to your random number generator, and $M$ is the sample count.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To begin with, recall that the Monte Carlo estimate of &lt;em&gt;any&lt;/em&gt; value converges with the square root of the sample count.  In particular, if you choose, say, $M=100$, you can run your estimator $N=500$ times to get estimate $\{V_n\}_{i=1}^{500}$, obtaining the standard deviation $\Sigma_{100}$ of those estimates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having done this, we now know the standard error of the estimator for any $M$ to be&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;e_M \approx \Sigma_{100} \sqrt{\frac{100}{M}}&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are three possible cases:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You can control the random seed $s$, or the set of random samples, used by the Monte Carlo estimator&lt;/li&gt;&#xA;&lt;li&gt;You cannot control $s$.&lt;/li&gt;&#xA;&lt;li&gt;You cannot even control the sample count $M$.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In the first case, you can use the fact that $s$ has been controlled to get a reasonable estimate of vega with relatively little extra work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Find an $M$ such that the error in option price $e_M$ is tolerable.  Choose a seed $s_0$ and a small increment $\Delta\sigma$ in the volatility, and compute&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;\aleph^{(1)} = \frac{V(\sigma+\Delta\sigma,s_0,M)-V(\sigma-\Delta\sigma,s_0,M)}{2\Delta\sigma}&#xD;&#xA;$$&#xA;and&#xA;$$&#xD;&#xA;\aleph^{(2)} = \frac{V(\sigma+\frac12\Delta\sigma,s_0,M) - V(\sigma-\frac12\Delta\sigma,s_0,M)}{\Delta\sigma}&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $\aleph^{(1)} \approx \aleph^{(2)}$ then you have a good estimate and you are done.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason this works so nicely is that, by controlling the seed, our difference computations&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xD;&#xA;\delta=V(\sigma+\Delta\sigma,s_0,M)-V(\sigma-\Delta\sigma,s_0,M)&#xD;&#xA;$$&#xA;are direct Monte Carlo estimators of the vega, since the shared seed implies the samples $x_i$ match in the difference of sums.  That is&#xA;$$&#xD;&#xA;\delta = ( \frac1M \sum_{i=1}^M f(x_i, \sigma+\Delta\sigma) ) -( \frac1M \sum_{i=1}^M f(x_i, \sigma-\Delta\sigma) ) \\&#xD;&#xA;=\frac1M \sum_{i=1}^M f(x_i, \sigma+\Delta\sigma)-f(x_i, \sigma-\Delta\sigma)&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second case where you cannot control the seed, on the other hand, is rather more difficult.  Here, you will have a different error $e$ to the true value every time you run the function. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For brevity, let's let&#xA;$$&#xD;&#xA;e_\pm = V(\sigma\pm \Delta\sigma,s_\pm,M).&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course we do not know the value of $e_\pm$ or of $s_\pm$, but we do at least have our estimate of the size of $e_\pm$ as noted above.  Therefore, the error in $\delta$ is approximately $e_M \sqrt{2}$.  You need to choose $M$ so large that &#xA;$$&#xD;&#xA;\delta \gg e_M \sqrt{2}.&#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not knowing the value of $\delta$ &lt;em&gt;a priori&lt;/em&gt; makes this difficult, but usually in a trading context one can specify an acceptable absolute error $\epsilon$ in vega.  In that case, we can demand&#xA;$$&#xD;&#xA;\epsilon &amp;lt; \frac{e_M \sqrt{2}}{\Delta\sigma}&#xD;&#xA;$$&#xA;which translates to&#xA;$$&#xD;&#xA;M &amp;gt; \Sigma_{100}^2 {\frac{200}{\epsilon^2 \Delta\sigma^2}}. &#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The third case, where you can control neither the random seed $s$ nor the sample count $M$ should be treated as the second case above.  You simply treat each run of the algorithm as a single sample.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2012-04-25T12:56:23.160" LastActivityDate="2012-04-25T12:56:23.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3335" PostTypeId="1" AcceptedAnswerId="3337" CreationDate="2012-04-24T16:34:44.637" Score="2" ViewCount="1204" Body="&lt;p&gt;I'm developing a software to calculate the implied volatility of an option using the Black &amp;amp; Scholes formula and a trial-and-error method. The implied volatility values I get are correct, but I noticed that they are not the only possible ones.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, with a given set of parameters, my trial-and-errors lead me to an implied volatility of 43,21%, which, when used on B&amp;amp;S formula, outputs the price I started with. Great!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I realized this 43,21% value is just a fraction of a much wider range of possible values (let's say, 32,19% - 54,32%).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which value should I, then, pick as the 'best' one to show to my user?&lt;/p&gt;&#xA;" OwnerUserId="2335" LastEditorUserId="467" LastEditDate="2012-04-24T21:58:43.830" LastActivityDate="2012-04-24T21:58:43.830" Title="What precision do I need to calculate implied volatility?" Tags="&lt;black-scholes&gt;&lt;implied-volatility&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3336" PostTypeId="1" AcceptedAnswerId="3525" CreationDate="2012-04-24T18:03:26.823" Score="8" ViewCount="561" Body="&lt;p&gt;The VIX calculation is a weighted average of prices for front-month out-the-money options on the S&amp;amp;P index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for VIX futures, this makes sense for the front month vix futures (being based on a front month formula) but what about the months further out? It seems to gets kind of paradoxical, but are back month vix futures based on front month out-the-money options? Seems like we can make a better formula than that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(for a further conundrum, what does that mean for the back month options on an an ETF based on mid-long dated VIX futures based on front-month out-the-money options on the S&amp;amp;P - dont answer that)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;insight appreciated&lt;/p&gt;&#xA;" OwnerUserId="1453" LastActivityDate="2012-05-23T19:08:06.593" Title="What are VIX back-month futures based on?" Tags="&lt;options&gt;&lt;futures&gt;&lt;vix&gt;&lt;spx&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3337" PostTypeId="2" ParentId="3335" CreationDate="2012-04-24T20:32:36.967" Score="1" Body="&lt;p&gt;The reason why you get the same result (price) from the BS formula is because your are missing precision in the computations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you compute your trial and errors, you have certainly defined a constant $\epsilon$ which defines when the algorithm has to stop: $(p - \bar{p})^2 &amp;lt; \epsilon$ where $p$ is the market price and $\bar{p}$ is the price you got using the volatility estimate $\bar{\sigma}$ in the BS Formula : $\bar{p}=\text{BS}(\bar{\sigma},\cdot)$. If you want better precision, then you need to reduce $\epsilon$. Consider also that you might be lacking precision from the market price data $p$ that you use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually, you would use a global optimizer such as MATLAB's &lt;a href=&quot;http://www.mathworks.ch/help/toolbox/optim/ug/fmincon.html&quot; rel=&quot;nofollow&quot;&gt;fmincon&lt;/a&gt; where you can setup the precision at which you want the algorithm to stop.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2012-04-24T20:39:25.880" LastActivityDate="2012-04-24T20:39:25.880" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3338" PostTypeId="1" CreationDate="2012-04-24T22:10:10.033" Score="3" ViewCount="706" Body="&lt;p&gt;I have a model specifying a cointegration relationship on a number of transaction-level timeseries. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to specify entry and exit points for trades where these points ideally would be just before the turning points of the time series (bottoms for exit and tops for entry). The issue I am having is that the timeseries itself are very short -- usually around 1600 observations/seconds. Thus the usual +- 1/2 standard deviation entry points do not work because I do not know the standard deviation reliably before the window of opportunity is over.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see a number of solutions but perhaps there's better ones in the literature?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Rolling standard deviation: very unreliable at the beginning, and losing out on trading opportunities before having reliable results&lt;/li&gt;&#xA;&lt;li&gt;Rolling quantile: same problem like above&lt;/li&gt;&#xA;&lt;li&gt;Fixed level entry/exit points: could be very wrong since the series vary in magnitude&lt;/li&gt;&#xA;&lt;li&gt;High watermark entry/exit points&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here are some example series. You might notice the distortions at the beginning of the series, this is because I'm removing a quadratic trend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/9BaeN.png&quot; alt=&quot;first example&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/Ua4VA.png&quot; alt=&quot;second example&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="1364" LastActivityDate="2012-04-25T22:08:26.640" Title="Entry and exit points for very short mean-reverting timeseries" Tags="&lt;time-series&gt;&lt;cointegration&gt;&lt;mean-reversion&gt;&lt;tick-data&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3339" PostTypeId="1" CreationDate="2012-04-24T23:41:51.050" Score="4" ViewCount="237" Body="&lt;p&gt;Why, in general, is the variance of volume changes higher than variance of price changes? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that these two quantities are functions of some very different factors, but I don't understand fully why the variance of volume is changing so much. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've heard that even if one accounts for seasonal changes in volatility (by standardizing daily stock volume by daily volume of basket of stocks/volume of index), the variance of the volume changes is much higher.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edition&lt;/strong&gt; : I meant quantities measured in percentage. High jumps in volume are very common, whereas  high price changes aren't. &lt;/p&gt;&#xA;" OwnerUserId="2044" LastEditorUserId="2044" LastEditDate="2012-04-26T11:50:36.643" LastActivityDate="2012-04-26T11:50:36.643" Title="Why in general is the variance of volume changes higher than variance of price changes?" Tags="&lt;volatility&gt;&lt;volume&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3340" PostTypeId="1" AcceptedAnswerId="4116" CreationDate="2012-04-24T23:55:10.830" Score="4" ViewCount="277" Body="&lt;p&gt;Is there any research on whether the correlations among stocks rise when stock indices decline? Which model could account and test for that effect ? Maybe GARCH-BEKK, or some models using copulas?&lt;/p&gt;&#xA;" OwnerUserId="2044" LastEditorUserId="1800" LastEditDate="2012-04-25T01:13:09.943" LastActivityDate="2012-09-12T16:35:39.787" Title="Does the correlation amongst stocks rise when stock values decline?" Tags="&lt;volatility&gt;&lt;correlation&gt;&lt;correlation-matrix&gt;&lt;garch&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3341" PostTypeId="2" ParentId="2807" CreationDate="2012-04-25T00:08:49.410" Score="1" Body="&lt;p&gt;There seem to be natural clusters like different sectors/industries, so maybe you could make clusterization of the correlation matrix. This is a very interesting &lt;a href=&quot;http://pnas.org/content/105/52/20589.abstract&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; about sector rotation and clusterization of stock market time-series.&lt;/p&gt;&#xA;" OwnerUserId="2044" LastEditorUserId="848" LastEditDate="2012-04-28T13:56:09.510" LastActivityDate="2012-04-28T13:56:09.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3342" PostTypeId="1" AcceptedAnswerId="3352" CreationDate="2012-04-25T02:27:38.047" Score="1" ViewCount="742" Body="&lt;p&gt;I'm trying to understand how arbitrage works, but I'm having some difficulties based on some restrictions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I have markets A, B and C.&lt;/li&gt;&#xA;&lt;li&gt;The currencies that are traded are X &amp;lt;-&gt; Y, and X &amp;lt;-&gt; Z.&lt;/li&gt;&#xA;&lt;li&gt;The only thing that can be transferred between markets A, B and C is currency X.&lt;/li&gt;&#xA;&lt;li&gt;The time it takes to transfer the funds (in currency X) between any market is about 2-10 minutes.&lt;/li&gt;&#xA;&lt;li&gt;The opportunity for arbitrage last for about 1 hour.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The exchange rates on market A  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;1 X exchanges for 3.22 Y&lt;/li&gt;&#xA;&lt;li&gt;1 X exchanges for 5.11 Z&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The exchange rates on market B  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;1 X exchanges for 3.25 Y &lt;/li&gt;&#xA;&lt;li&gt;1 X exchanges for 5.07 Z&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The exchange rate on market C   &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Does not exchange X &amp;lt;-&gt; Y&lt;/li&gt;&#xA;&lt;li&gt;1 X exchanges for 4.98 Z&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Suppose that exchange A is the exchange with the highest volume and presumably the most accurate exchange rate. How can one take advantage of the arbitrage opportunities if the only thing that can be transferred between exchanges is currency X and it takes 2-10 minutes?&lt;/p&gt;&#xA;" OwnerUserId="78" LastActivityDate="2012-04-25T18:35:47.977" Title="Arbitrage between markets" Tags="&lt;trading&gt;&lt;arbitrage&gt;&lt;currency&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3344" PostTypeId="1" CreationDate="2012-04-25T05:49:50.433" Score="2" ViewCount="1095" Body="&lt;p&gt;I am willing to calculate and monitor the evolution of extreme-viscosity in the financial markets data series. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wikipedia says &quot;Put simply, the less viscous the fluid is, the greater its &lt;strong&gt;ease of movement&lt;/strong&gt; &quot;. So rather than looking for the mighty viscosity should I simply focus on ease-of-movement?  Well, the &quot;ease of movement - (EOM)&quot; is a catchy phrase since there is a well known indicator with the exact same name. That EOM indicator is defined in investopedia as: &quot;A technical momentum indicator that is used to illustrate the relationship between the rate of an asset's price change and its volume. This indicator attempts to identify the amount of volume required to move prices.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In elementary school mathematics it is as simple as:&#xA;EOM = (Close of today - Close of yesterday) / Volume&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do think &quot;extreme viscosity can be monitored by the extremes in EOM&quot;...&#xA;Or would you suggest something else to calculate viscosity?&lt;/p&gt;&#xA;" OwnerUserId="2338" LastEditorUserId="35" LastEditDate="2012-05-02T15:42:48.450" LastActivityDate="2012-05-02T15:42:48.450" Title="definition for &quot;the viscosity&quot; in financial market data series" Tags="&lt;market-data&gt;&lt;liquidity&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3346" PostTypeId="2" ParentId="3339" CreationDate="2012-04-25T16:06:49.003" Score="2" Body="&lt;p&gt;Not to over simplify, but there is the different scaling to consider here as well.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Volumes and volume changes are observed in 1000s  and 100s, while prices and price changes are observed in 100s and 1s. For most medium and smaller stocks prices and price changes are observed in 1s and 0.01s.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Clarify this through the identity &lt;strong&gt;Var(aX) = a²Var(X)&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Since the numerical values you are comparing are an order of magnitude in difference, naturally their variance, and thus changes in local variance, will also be quite different. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Additionally, price changes are directional and volume changes are not. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Quite possibly you are observing that many consecutive minutes are 'confused', being reported with high volume and comparatively little change in price.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Clarify this through the inequality &lt;strong&gt;|E[X]| &amp;lt;= E[|X|]&lt;/strong&gt;, and its relation to variance as &lt;strong&gt;Var(X) = E[X²] - E[X]²&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;This means that even if the volume was somehow scaled down to the same magnitude of price, that the expectation of volume (being non-negative) would always be higher than the expectation of price.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2342" LastActivityDate="2012-04-25T16:06:49.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3349" PostTypeId="2" ParentId="3344" CreationDate="2012-04-25T16:54:03.673" Score="-2" Body="&lt;p&gt;A standard definition of &quot;viscosity&quot; is &quot;stickiness. The MORE viscous something is, the LESS ease movement. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So &quot;viscosity&quot; in this context would refer to the &quot;stickiness&quot; of one price compared to another in a time series.&lt;/p&gt;&#xA;" OwnerUserId="2345" LastActivityDate="2012-04-25T16:54:03.673" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3350" PostTypeId="2" ParentId="3339" CreationDate="2012-04-25T16:57:00.940" Score="0" Body="&lt;p&gt;Volume changes LEAD to price changes. That is to say that prices go up or down because larger (or smaller) volumes of people want to buy or sell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So volumes change FIRST, and in larger amounts. It is as a result of those volume changes that prices change.&lt;/p&gt;&#xA;" OwnerUserId="2345" LastActivityDate="2012-04-25T16:57:00.940" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3351" PostTypeId="2" ParentId="3339" CreationDate="2012-04-25T18:09:46.030" Score="0" Body="&lt;p&gt;Volume is a flow, whereas price is a stock.  As &lt;a href=&quot;http://en.wikipedia.org/wiki/Stock_and_flow&quot; rel=&quot;nofollow&quot;&gt;wikipedia&lt;/a&gt; notes,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Stocks and flows have different units and are thus not commensurable – they cannot be meaningfully compared, equated, added, or subtracted.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It makes no sense to compare the variance of price to the variance of volume.  They are simply two fundamentally different things.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2012-04-25T18:09:46.030" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3352" PostTypeId="2" ParentId="3342" CreationDate="2012-04-25T18:35:47.977" Score="1" Body="&lt;p&gt;This is actually a stylized example of the classic &lt;a href=&quot;http://en.wikipedia.org/wiki/Arbitrage#Dual-listed_companies&quot; rel=&quot;nofollow&quot;&gt;dual-listed companies &quot;arbitrage&quot;&lt;/a&gt;, the most famous example of which is Royal Dutch Shell.  It is not a pure arbitrage, but rather is a case of &quot;statistical arbitrage&quot;, specifically &lt;a href=&quot;http://en.wikipedia.org/wiki/Pairs_trade&quot; rel=&quot;nofollow&quot;&gt;pairs trading&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, express the prices of Y and Z in terms of X, and let's rename X &quot;\$&quot; for convenience's sake.  Then Y costs about \$0.311 in market A and \$0.308 in market B.  Assuming no bid/ask spread, therefore you should buy Y in B and sell it in A.  Z costs \$0.196, \$0.197, \$0.201 in A, B, and C, respectively, so buy Z in A and sell it in C.  Since money (X) is transferable between markets, you can use one market as a funding source for another, so that all arbitrages can be set up to have zero cost at inception.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2012-04-25T18:35:47.977" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="3353" PostTypeId="2" ParentId="3338" CreationDate="2012-04-25T18:42:39.733" Score="2" Body="&lt;p&gt;This sounds like a case where you will need to apply some good old-fashioned judgment to determine what the standard deviation &quot;should be&quot; before you have enough data to measure it.  Surely this process repeats with some frequency, and perhaps given some attributes and more details you could make an educated guess as to the standard deviation (or quantiles, or whatever you want to use for your entry/exit points) before you have enough data for the specific series at hand.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2012-04-25T18:42:39.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3354" PostTypeId="2" ParentId="3338" CreationDate="2012-04-25T22:08:26.640" Score="2" Body="&lt;p&gt;Following on from Tal Fishman's idea of using &quot;some good old-fashioned judgment,&quot; you might find the idea of applying a &lt;a href=&quot;http://gunston.gmu.edu/708/frTukey.asp?E=0&quot; rel=&quot;nofollow&quot;&gt;Tukey chart&lt;/a&gt; and its related upper and lower control limits more useful than standard deviation.&lt;/p&gt;&#xA;" OwnerUserId="252" LastActivityDate="2012-04-25T22:08:26.640" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3355" PostTypeId="2" ParentId="1565" CreationDate="2012-04-26T13:07:38.013" Score="2" Body="&lt;p&gt;On conceptual level making cluster analysis or kmeans, for arbitrarily chosen k (in cluster analysis with hierarchical methods we simple would cut dendrogram into k pieces/subtrees) and then copmuting average correlations is much simpler then PCA. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But there are some problems with cluster analysis on correlation matrix of time series. If ,for each day, we have one correlation matrix of price changes with 15 minutes time resolution and then clusterize it into K pieces, then for each day we could have different sets of stocks in each cluster, we can fight or use it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fight it: if data are from the period of 6 months then we find clusters by merging daily time series of each stock into one time series and then clusterize and compute averages or some different measure. For Future data we can hold stocks memberships to clusters or merge new observations with previous set or make analysis in moving window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use it : compute total number of changes in membership of stocks - first day we have clusters A,B&#xA;&lt;code&gt;A={stock1,stock2} B={stock3,stock4,stock5}&lt;/code&gt;&#xA;next day :&#xA;&lt;code&gt;A={stock1,stock3,stock4} B={stock2,stock5}&lt;/code&gt;&#xA;so 3 stocks have changed its clusters. The more stocks have changed clusters the more market behaviour is unusual that day. This could be done easy with kmeans - we take means from day &lt;code&gt;T&lt;/code&gt;, and attribute memberships for stocks  &lt;code&gt;T&lt;/code&gt; and &lt;code&gt;T+1&lt;/code&gt;day, then count differences.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and distance matrix &lt;code&gt;=(2*(1-corelationMatrix))^0.5&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some cool visualizations of correlation matrix by networks analysis : &#xA;&lt;a href=&quot;http://www.maths.tcd.ie/~coelhor/Palermo_Presentation_v1.0.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.maths.tcd.ie/~coelhor/Palermo_Presentation_v1.0.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2044" LastEditorUserId="2044" LastEditDate="2012-04-26T13:15:07.363" LastActivityDate="2012-04-26T13:15:07.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3356" PostTypeId="1" CreationDate="2012-04-26T15:06:30.823" Score="4" ViewCount="1105" Body="&lt;p&gt;Given a bond and a stock issued by the same issuer, what is the appropriate ratio of bond-to-stock one should hold in order to minimize the specific risk to that issuer?  Equivalently, what is the expected change in the credit spread for a given change in equity?  Knowing this, one could then use the spread duration, or credit DV01, to derive the expected price change of the bond, which could be used as the hedge ratio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for professional or academic research that may inform the decision of how much equity to short against a given bond or credit default swap.  Any research that cites a correlation or regression coefficient between equity and credit spreads (could be OAS or CDS-equivalent spreads) would be helpful.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2016-08-07T21:31:56.603" Title="What is an appropriate hedge ratio for hedging a credit instrument with equity of the same issuer?" Tags="&lt;equities&gt;&lt;research&gt;&lt;fixed-income&gt;&lt;hedging&gt;&lt;credit&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3357" PostTypeId="1" CreationDate="2012-04-26T17:42:53.080" Score="8" ViewCount="314" Body="&lt;p&gt;In asset allocation, you usually send reports to your clients where you will report the volatility of its portfolio. Assuming you only have monthly returns, you will compute volatility over a considered period of $n$ months with the classic sample volatility estimate:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma_s=\sqrt{\frac{1}{n-1} \sum_{i=1}^n (x_i-\bar{x})^2}, \quad \bar{x}=\frac{1}{n}\sum_{i=1}^N x_i$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The result you will get for $\sigma_s$ depends very much on the number of months $n$ you decide to take into account. Hence, I think that this measure can become pretty abstract to unsophisticated investors and they might find it pretty different from the &quot;feeling&quot; the have of the volatility of their portfolio, what I call the &quot;experienced&quot; volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, has there been any research aiming to find out which $n$ is the best to make sure that the measure is closest to the experienced volatility?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe this is very much linked to behavioral finance and it might very well depend on the risk-aversion or the sophistication of the investor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to answer my question by proposing the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume that investors will be biased by the most recent events in the market; if they have been with you 10 years, they will remember 2008-2012 and would have forgot the quiet and lucrative early years. Hence, I took $n=36$, 3 years, as I thought is was taking a recent enough sample, yet had enough data ($n&gt;30$, intuitively... it might be arguable) to measure a properly the estimate $\sigma_s$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this make sense?&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2012-05-02T15:39:59.427" Title="How to measure investors' &quot;experienced&quot; volatility?" Tags="&lt;volatility&gt;&lt;asset-allocation&gt;&lt;behavioral-finance&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3358" PostTypeId="5" CreationDate="2012-04-26T17:51:33.333" Score="0" Body="&lt;p&gt;&lt;strong&gt;Behavioral Finance&lt;/strong&gt; aims to analyze the social, cognitive and emotional factors that affect human behavior in their interaction with the financial markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a link to the &lt;a href=&quot;http://en.wikipedia.org/wiki/Behavioral_economics&quot; rel=&quot;nofollow&quot;&gt;Wikipedia article&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A good introduction article to the field by Martin Sewell is available &lt;a href=&quot;http://www.behaviouralfinance.net/behavioural-finance.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="35" LastEditDate="2012-04-26T18:32:45.837" LastActivityDate="2012-04-26T18:32:45.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3359" PostTypeId="4" CreationDate="2012-04-26T17:51:33.333" Score="0" Body="Behavioral finance aims to understand and analyze the effects human behavior has when it interacts with financial markets." OwnerUserId="467" LastEditorUserId="35" LastEditDate="2012-04-26T18:32:45.883" LastActivityDate="2012-04-26T18:32:45.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3361" PostTypeId="1" CreationDate="2012-04-27T01:11:01.653" Score="2" ViewCount="204" Body="&lt;p&gt;I'm considering exchange traded options of futures on bonds. Options on bond futures are usually American, thus the Black model is out of question. Which is the most imporatant Greek with respect to update frequency? Delta or Rho or something else? Which model should I use for calculating this? Is CRR79-delta enough, if it is delta? I believe so, but would still love comments on it.&lt;/p&gt;&#xA;" OwnerUserId="2284" LastActivityDate="2012-04-27T01:11:01.653" Title="What is the highest frequency greek for options on futures on bonds?" Tags="&lt;options&gt;&lt;futures&gt;&lt;greeks&gt;&lt;bond&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3362" PostTypeId="2" ParentId="3357" CreationDate="2012-04-27T04:40:28.787" Score="3" Body="&lt;p&gt;Usually very good questions don't come with straight answers and I think this is the case here. I believe you have two (unfortunatly linked) problems  here. One is to get a sense of investors aversion to risk and the other is to get a statistically &quot;receivable&quot; estimate of volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1/ Different investors may be willing to take risk on significantly different time frames. This means that the answer is going to be very dependent on your client. Survey studies could seem to answer this question but will probably hide the problem that investors themselves don't really fully grasp the proper time horizon they are willing to take risk. In any cases you will need to introduce expected payoff to start getting an answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2/ As for the statistical estimate, you suggest n&gt;30. It is a fairly common number economists use but is based on strong stationnary hypothesis. This THEORETICAL number (based on the convergence of student to normal) will be very dependent on the model you use to describe your data (obviously driven by your data).  Unfortunatly, even returns exhibit non stationnary characterisics. Using weighting procedure (EWMA for example) might help you but will still not be parameter free and hence not fully answer the question. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good luck with this one.&lt;/p&gt;&#xA;" OwnerUserId="155" LastActivityDate="2012-04-27T04:40:28.787" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3363" PostTypeId="2" ParentId="3329" CreationDate="2012-04-27T14:42:02.397" Score="0" Body="&lt;p&gt;Another way to do this is to use dual numbers. &lt;a href=&quot;http://fmsdual.codeplex.com&quot; rel=&quot;nofollow&quot;&gt;http://fmsdual.codeplex.com&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;They let you calculate an arbitrary number of derivatives while running a single Monte Carlo. Here is an example of how to use it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;// Monte Carlo derivatives&#xA;void fms_test_monte(size_t N)&#xA;{&#xA;    ::srand(static_cast&amp;lt;unsigned int&amp;gt;(::time(0)));&#xA;&#xA;    double a = 0.5;&#xA;    dual::number&amp;lt;double,3&amp;gt; A(a, 1);&#xA;    dual::number&amp;lt;double,3&amp;gt; E(0.,1);&#xA;&#xA;    for (int i = 0; i &amp;lt; N; ++i) {&#xA;        double x = 1.0*rand()/RAND_MAX;&#xA;        E = E + (x - A)*(x - A);&#xA;    }&#xA;&#xA;    E = E/(1.*N);&#xA;&#xA;    // X uniform [0,1]&#xA;    // E(X - a)^2 = 1/3 - 2a 1/2 + a^2&#xA;    ensure (fabs(E._(0) - (1./3 - a + a*a)) &amp;lt; sqrt(1./N));&#xA;&#xA;    // d/da E(X - a)^2 = -2 E(X - a) = 2a - 1&#xA;    ensure (fabs(E._(1) - (2*a - 1)) &amp;lt; sqrt(1./N));&#xA;&#xA;    // d^2/da^2 E(X - a)^2 = 2&#xA;    ensure (fabs(E._(2) - 2) &amp;lt; sqrt(1./N));&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2357" LastActivityDate="2012-04-27T14:42:02.397" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3364" PostTypeId="1" CreationDate="2012-04-27T17:07:13.260" Score="8" ViewCount="248" Body="&lt;p&gt;Often in a quant process, one will generate a time series of return forecasts and use them in some sort of optimization to generate a portfolio. Generally, there will be a covariance matrix of market returns used in the optimization. I haven't seen any attention ever placed on the covariance of the return forecasts themselves, however. Since we could easily adjust the covariance of the forecasts to anything we'd like via: &#xA;$$\textrm{forecasts}_{\textrm{new}} = \Omega_{\textrm{new}} R_{\textrm{new}}^{1/2} R_{\textrm{old}}^{-1/2} \Omega_{\textrm{old}}^{-1} \textrm{forecasts}_{\textrm{old}}$$&#xA;where $\Omega$ are diagonal matrices of volatilities and $R$ are correlation matrices. I'm wondering if there is some optimal $\Omega_{new}$ and $R_{new}$ one would want to use, or if a transformation such as this would provably not matter?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wouldn't necessarily expect, for example, that the covariance of the raw return forecasts would be a good forecaster of the covariance of market returns, so another way of putting this question is, should we &quot;fix&quot; the covariance of forecasts in some way? If one had the true future covariance of market returns, for example, wouldn't we want to impose that, and by extension, wouldn't we want to use whatever our forecasted covariance to be? I have not been able to derive a proof or find a reference that it is good or inconsequential to do any such transform.&lt;/p&gt;&#xA;" OwnerUserId="2359" LastEditorUserId="1106" LastEditDate="2012-05-01T17:44:23.393" LastActivityDate="2012-05-01T19:02:27.680" Title="Is there an optimal covariance one would want forecasts to have?" Tags="&lt;forecasting&gt;&lt;covariance&gt;&lt;modern-portfolio-theory&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3365" PostTypeId="2" ParentId="3128" CreationDate="2012-04-27T22:55:51.550" Score="2" Body="&lt;p&gt;Playing around with some random numbers from the GPD, I'm not convinced that a sample of 10 will give anything like useful results. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/OcWA5.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code for generation was&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;require(&quot;gPdtest&quot;)&#xA;reps = 10000&#xA;ValuesAct = rgp(reps, 0.5,0.5)&#xA;plot(density(ValuesAct))&#xA;quantile(ValuesAct, probs=0.999)&#xA;&#xA;loops = 10000&#xA;results = matrix(rep(NA,2*loops), ncol = 2)&#xA;colnames(results) = c(&quot;shape&quot;, &quot;scale&quot;)&#xA;&#xA;for(i in 1:loops)&#xA;{&#xA;  ValuesSample = sample(ValuesAct,10,replace=F)&#xA;  results[i,] = gpd.fit(ValuesSample, &quot;amle&quot;)&#xA;}&#xA;&#xA;plot(density(results[,2]))&#xA;lines(density(results[,1]), col = &quot;green&quot;)&#xA;abline(v=0.5)&#xA;legend(&quot;topright&quot;, c(&quot;Shape&quot;, &quot;Scale&quot;), col = c(&quot;green&quot;, &quot;black&quot;), lwd=1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="357" LastActivityDate="2012-04-27T22:55:51.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3366" PostTypeId="2" ParentId="550" CreationDate="2012-04-28T05:03:32.803" Score="2" Body="&lt;p&gt;My vote is on StreamInsight too. We have used Esper but have dropped it in favor of StreamInsight as we find is much easier to work with. Less strange problems as we always had with Esper. StreamInsight seems to go the last mile with the implementation, everything just feels much more polished. &lt;/p&gt;&#xA;" OwnerUserId="2362" LastActivityDate="2012-04-28T05:03:32.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3367" PostTypeId="1" CreationDate="2012-04-28T13:17:27.270" Score="4" ViewCount="863" Body="&lt;p&gt;Is there any need for real time weighted volatility on a tick by tick basis for equities?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you had that access to that, what could you do with it?&lt;/p&gt;&#xA;" OwnerUserId="2363" LastEditorUserId="35" LastEditDate="2012-05-02T15:42:53.923" LastActivityDate="2012-05-02T15:42:53.923" Title="Real time stock volatility" Tags="&lt;volatility&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3368" PostTypeId="1" AcceptedAnswerId="3369" CreationDate="2011-10-13T16:04:56.883" Score="27" ViewCount="11711" Body="&lt;p&gt;Immediately preceding the worst of the financial crisis, my professors all pointed out to me that the yield curve had inverted -- short-term yields were more risky than 20-year or 30-year Treasury securities. My professors all seemed nervous about this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Aside from such a situation being generally counter-intuitive, why was this viewed so negatively? What kind of effects does this have, in a more macro sense?&lt;/p&gt;&#xA;" OwnerUserId="1092" OwnerDisplayName="Aarthi" LastActivityDate="2013-06-24T14:44:35.563" Title="Why is an inverted yield curve a problem?" Tags="&lt;theory&gt;&lt;yield-curve&gt;" AnswerCount="6" CommentCount="0" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="3369" PostTypeId="2" ParentId="3368" CreationDate="2011-10-13T22:11:05.287" Score="11" Body="&lt;p&gt;&lt;strong&gt;Nano answer&lt;/strong&gt;: declining yield curve is a symptom that the market expects the economy to worsen.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Short answer&lt;/strong&gt;: yield curve is built on expected future interest rates. Yield curve will be downward sloping if you expect interest rates to fall in the future. Interest rates fall because the central bank react to worsening economy. &lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if the yield curve is downward sloping it means the market expects the economy to worsen to the point that the central bank will have to intervene.&lt;/p&gt;&#xA;" OwnerDisplayName="CarrKnight" LastActivityDate="2011-10-13T22:11:05.287" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3370" PostTypeId="2" ParentId="3368" CreationDate="2011-10-13T22:57:46.357" Score="17" Body="&lt;p&gt;To explain why a negative sloping yield curve is bad, you have to start with a theory of the yield curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The dominant theories for the term structure of interest rates are the rational expectations, liquidity preference, and market segmentation. (The first two theories are quite compatible with each other and have more standing so let's assume that view.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally, we expect longer-term maturities to have correspondingly higher yields because the investor must bear more risk (inflation risk, bond price risk, interest rate risk, liquidity risk, credit risk). So it is indeed &quot;abnormal&quot; to observe an inverted yield curve -- why would an investor hold longer-term maturities in the face of these risks? The answer is that that long-term investors expect the term-structure of rates to drop even further. These expectations can be measured in the implied forward rates of the term structure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the negative slope mean for economic growth? The negatively sloped yield curve is a function of the short-rate and longer-rates. The Federal Reserve targets the short-rate thru open market operations (purchases and sales of short-term treasury bills). The Fed may raise the short-rate substantially to limit credit growth. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this world, bank have less incentive to lend long and fund capital or residential investment projects since banks can lend short and capture a higher rate. This reduces the pace of credit growth and the number of new projects financed by debt. Also, the risk-free rate is an asset class that competes with equities and other asset classes (housing, gold, etc.). The higher the short-term rate the less speculation in other asset classes which can lead to bubbles bursting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that banks will still continue to issue loans at longer maturities, however, they will focus on higher quality investment-grade credits. Firms that have marginal access to credit may experience re-financing difficulties and may not benefit from lower long-term risk free rates since credit spreads typically widen in a recession.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, there is research showing that long-term treasury rate is a proxy for nominal economic growth. If the long-rates are very low and the short-rate is high, the bond market is anticipating weak economic growth and future Fed rate cuts.&lt;/p&gt;&#xA;" OwnerUserId="1800" OwnerDisplayName="Quant Guy" LastActivityDate="2011-11-22T13:55:29.020" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3371" PostTypeId="2" ParentId="3368" CreationDate="2011-10-14T11:46:37.277" Score="4" Body="&lt;p&gt;Theoretically, a rising yield curve is compensation for the additional duration risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An inverted yield-curve is saying that the market thinks that:  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next-year's figures for: growth plus inflation&lt;br&gt;&#xA;is less than&lt;br&gt;&#xA;Ten years' time's figures for: growth plus inflation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which means that expectations are &lt;strong&gt;either&lt;/strong&gt; of a recession (some negative economic growth; and as far as the indicators are concerned, at least two consecutive quarters of negative growth), &lt;strong&gt;or&lt;/strong&gt; that inflation in 10 years time is expected to drop relative to what's in the rates now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The US had yield-curve inversions for less than three months in 1995 and 1998, without immediate subseequent recession, so it can be a false signal. The US yield curve inverted, when, mid 2005? So wasn't a reliable signal of &quot;when&quot;. The yield curve inverted in 1966, and was not followed by recession. But the three recessions before that were not preceded by a yield-curve inversion; the 1990/1 recession wasn't either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The UK yield curve spent a few years flat / inverted, in the noughties, during economic boom times (driven by high demand from pension funds for long-dated gilts).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So an inverted yield curve can be an unreliable indicator of recessions.&lt;/p&gt;&#xA;" OwnerUserId="2370" OwnerDisplayName="EnergyNumbers" LastActivityDate="2011-10-14T11:46:37.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3372" PostTypeId="2" ParentId="3368" CreationDate="2011-10-26T16:17:55.313" Score="2" Body="&lt;p&gt;An inverted yield curve basically means that interest rates will be higher for the coming year than for the years following.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That means that entities that need do borrow for short term purposes will do so at a greater cost that those borrowing for the long term. That is an unusual and &quot;unnatural&quot; relationship. All other things being equal, that will dampen economic activity in the coming year, likely producing a recession. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An interest rate &quot;curve&quot; functions something like a weather report. In the case of a inverted yield curve, it is forecasting &quot;stormy weather just ahead.&quot;&lt;/p&gt;&#xA;" OwnerUserId="2345" OwnerDisplayName="Tom Au" LastActivityDate="2011-10-26T16:17:55.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3373" PostTypeId="2" ParentId="3368" CreationDate="2011-11-22T15:54:39.820" Score="3" Body="&lt;p&gt;Samuelson once quipped that the yield curve had successfully predicted 9 of the last 5 recessions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Explanations for why the yield curve inverts have been covered adequately above.  But what does it mean for the economy?  For the yield curve inversion to predict stock market performance enough to make an actual decision, the bond market would have to be more efficient than the stock market (ignoring carry costs, etc.).  That seems like a pretty strong assumption.&lt;/p&gt;&#xA;" OwnerUserId="1184" OwnerDisplayName="gsk3" LastActivityDate="2011-11-22T15:54:39.820" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3374" PostTypeId="1" AcceptedAnswerId="3377" CreationDate="2011-10-11T19:49:05.547" Score="21" ViewCount="390" Body="&lt;p&gt;I hear a lot of debate over the removal of the U.S. Dollar's precious metal backing and the subsequent inflation rates, but is there any proven relationship between unbacked currency and extreme inflation or is fractional reserve banking by individual corporations more to blame?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short, what are the &lt;em&gt;real&lt;/em&gt; effects of the removal of precious metal backing from the U.S. money supply?&lt;/p&gt;&#xA;" OwnerUserId="2462" OwnerDisplayName="David Perry" LastActivityDate="2012-04-28T17:24:24.387" Title="What are the effects of turning a backed currency into a fiat currency?" Tags="&lt;currency&gt;" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3375" PostTypeId="2" ParentId="3374" CreationDate="2011-10-11T20:20:23.183" Score="9" Body="&lt;p&gt;In 1945 at Bretton Woods, the war-time allies agreed on an international gold standard to stabilise the world's economy.  Gold was fixed at \$35 / ounce and all other currencies were pegged to that price via the US dollar.  The US became the reserve currency of the world.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problems for the US began immediately.  In order to ensure liquidity – an availability of US dollars that other nations could use for exchange between each other – they had to run a massive deficit.  And, while the currencies had to maintain their pegged rates, gold was freely traded.  To ensure that continued price of \$35 / ounce was extremely expensive and, ultimately, futile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The dollar became extremely overvalued while, despite their now equal importance to the world's economy, Japan and Europe found their currencies undervalued.  In 1971 Richard Nixon unilaterally delinked the US dollar from gold and allowed it to float.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gold, freed from its constraints, began to run.  In 1971 gold was \$44/ounce, in 1972 it was \$70/ounce and – by 1980 – it was \$641/ounce.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fractional reserve is not a problem as far as inflation is concerned. Governments print money via their Central Banks.  Independent Central Banks are less likely to go on printing sprees (&quot;quantitative easing&quot; aside) and so accountable democracies are unlikely to suffer from hyperinflation.  Private banks are constrained by law in terms of the reserves they must hold in order to lend.  After the recent economic crisis, these laws are likely to tighten up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hyperinflation tends to start as deliberate government policies to pay debts through debasing the currency rather than through economic growth.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The real effects of the US dropping the gold standard was the longest and greatest period of economic growth in world history.&lt;/p&gt;&#xA;" OwnerUserId="2364" OwnerDisplayName="Turukawa" LastActivityDate="2011-11-19T15:44:02.190" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3376" PostTypeId="2" ParentId="3374" CreationDate="2011-10-11T21:21:25.553" Score="14" Body="&lt;p&gt;The quantity identity says &lt;br&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/blgmt.png&quot; alt=&quot;quantity theory of money&quot;&gt; &lt;br&gt; money times velocity equals prices times real gdp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fixing velocity,  inflation is the difference between changes in money and changes in gdp. (to see it take logarithms).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Now we need theory. Take simple monetarism. &lt;br&gt;&#xA;I'd argue: with gold-backed dollars changes in money (M) are fixed to gold discoveries. Once you switch to fiat currency central bankers can choose any M they want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;So, a priori, the change is neutral&lt;/em&gt;. If central bankers choose M to be lower than it would be with gold, fiat-currency would be deflationary. If central bankers choose higher M, it would be inflationary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is the choice of M that matters for inflation, rather than the backing. &lt;br&gt;&#xA;You can argue that Phillips curve targeting made central bankers choose very high M in the past, resulting in inflation.  &lt;br&gt;&#xA;But M is such a critical variable for the economy that you can argue pretty much what you want, as long as you have a theory to back it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Overall I'd say that fiat money gave a new important tool to whoever control the money supply to affect the economy. I'd also say that the benefits far outweigh the costs.&lt;/p&gt;&#xA;" OwnerDisplayName="CarrKnight" LastActivityDate="2011-10-11T21:21:25.553" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3377" PostTypeId="2" ParentId="3374" CreationDate="2011-10-12T02:55:50.813" Score="12" Body="&lt;p&gt;Let me answer your questions in reverse order:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;...or is fractional reserve banking by individual corporations more to blame?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The majority of money created in the US (and indeed, the world) is created by private banks through fractional reserve lending, not by central banks creating fiat money.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/5sOqn.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Monetary base refers to money that banks hold in their accounts at the federal reserve as well as currency in circulation -- in other words the money that the government has the most control over.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;M2 is a measure of money that includes bank lending. Although the ratio of M2:BASE has fallen in the last few years, M2 is still clearly far bigger than BASE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/M8SD1.png&quot; alt=&quot;Monetary Base&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/sgrmg.png&quot; alt=&quot;M2&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now back to the first part of your question:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;is there any proven relationship between unbacked currency and extreme inflation&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Depends what you mean. Unbacked currency doesn't lead to runaway inflation in all cases. Look at all of the major currencies today: slow and steady inflation for most of the last 100 years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a few cases, unbacked currency has been involved in runaway inflation. Typically runaway inflation is not strictly a monetary phenomenon, but also involves political factors. (See &lt;a href=&quot;http://en.wikipedia.org/wiki/Hyperinflation_in_Zimbabwe&quot; rel=&quot;noreferrer&quot;&gt;Zimbabwe&lt;/a&gt;). I wouldn't call this &quot;proven&quot;, however.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are also some instances of hard monies experiencing dramatic inflation throughout history. European monarchs accomplished this by debasing pure gold and pure silver coins with cheaper metal alloys. The US had a number of financial panics related to rapid increase and then collapse of money supply even when on a supposed &quot;gold standard&quot;, e.g. the &lt;a href=&quot;http://en.wikipedia.org/wiki/Panic_of_1819&quot; rel=&quot;noreferrer&quot;&gt;Panic of 1819&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Panic of 1819 is a controversial topic. Although it does indicate short comings of a &quot;gold standard&quot;, it is essential to remember that the government was still manipulating the money supply even in 1819, and therefore the gold-backed money was still not a free market money.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not aware of any cases in history where a commodity money or commodity-backed money experienced hyperinflation on the scale of Zimbabwe.&lt;/p&gt;&#xA;" OwnerDisplayName="mehaase" LastActivityDate="2011-11-28T17:10:50.960" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3378" PostTypeId="2" ParentId="3374" CreationDate="2011-11-03T04:43:04.463" Score="3" Body="&lt;p&gt;Rolnick and Weber of the Minneapolis Federal Reserve research department have a paper where they examine inflation during the classical gold standard and after the gold standard ended. They found that average inflation during the classical gold standard was somewhere between -.5 and 1% per annum. Average inflation after the end of the gold standard is 7.5-8.5% even when removing all cases of hyperinflation. That is a pretty significant upward bias in inflation rates during the era of central banking.&lt;/p&gt;&#xA;" OwnerDisplayName="Blake Johnson" LastActivityDate="2011-11-03T04:43:04.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3379" PostTypeId="1" AcceptedAnswerId="3380" CreationDate="2011-12-17T22:14:40.280" Score="7" ViewCount="114" Body="&lt;p&gt;Let me give you couple of examples. &lt;br&gt;&#xA;You're at a dinner and you order something. You could say:&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&quot;It's OK&quot;&lt;/li&gt;&#xA;&lt;li&gt;&quot;It's good&quot;&lt;/li&gt;&#xA;&lt;li&gt;&quot;It's great&quot;&lt;/li&gt;&#xA;&lt;li&gt;&quot;It's fantastic&quot;&lt;/li&gt;&#xA;&lt;li&gt;&quot;I've never ate something this good&quot;&lt;/li&gt;&#xA;&lt;li&gt;&quot;Goodlike&quot;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The similar grading can be made for bad food.&lt;br&gt;&#xA;The next example would be if you won the prize. We could look at the connection between the prize value and the satisfaction that you experience.&#xA;&lt;br&gt;&#xA;My assumption is that &lt;i&gt;quality of food&lt;/i&gt; vs &lt;i&gt;pleasure&lt;/i&gt; would look something like this: &lt;br&gt;&#xA;If you increase the quality of food the pleasure would rise fast, you would get to a point where you'd be satisfied that you've eaten well, after that there would be dampening of an effect, if you could increase the food quality to infinity, the pleasure would remain constant after one point.&lt;br&gt;&#xA;The same goes for wining a prize, if you won 1000$ and if you won a million dollars, the difference between satisfaction you would experience would be much larger then the difference if you won 100million vs 101million dollars.&lt;br&gt;&#xA;&lt;br&gt;&#xA;Has anybody made measurements of similar examples? How would that function look like, would it be linear and then started bending after some critical point. Would it be exponential at the beginning then get saturated after some critical point? Would it look something like &lt;i&gt;tanh&lt;/i&gt;, &lt;i&gt;Fermi-Dirac&lt;/i&gt;?&lt;br&gt;&#xA;What about the bad examples, bad food, paying taxes etc? I assume that it's not symmetric.&lt;br&gt;&#xA;&lt;br&gt;&#xA;Any differences in group effects? (Nations, sports, business teams etc?)&lt;/p&gt;&#xA;" OwnerUserId="2426" OwnerDisplayName="enedene" LastEditorUserId="467" LastEditDate="2012-04-29T13:47:46.010" LastActivityDate="2012-04-29T13:47:46.010" Title="Function that best describes intensity of human/(group of humans) emotions?" Tags="&lt;utility-theory&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3380" PostTypeId="2" ParentId="3379" CreationDate="2011-12-18T10:02:03.243" Score="7" Body="&lt;p&gt;I believe you should look into the field of &lt;a href=&quot;http://en.wikipedia.org/wiki/Utility&quot; rel=&quot;nofollow noreferrer&quot;&gt;Utility Theory&lt;/a&gt; which aims to model how people actually understand and feel about gains and losses. Usually, the most interesting cases are when the outcomes of the experiment are actually random, or when the payment can occur at different times.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A famous model for the utility function is &lt;a href=&quot;http://en.wikipedia.org/wiki/Risk_aversion&quot; rel=&quot;nofollow noreferrer&quot;&gt;Risk Aversion&lt;/a&gt;. You can start from there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would also like to say that this question could be answered more in details in &lt;a href=&quot;https://economics.stackexchange.com/&quot;&gt;Economics SE&lt;/a&gt; because it is a very important aspect of that field.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Besides, there is also some research done in &lt;a href=&quot;http://en.wikipedia.org/wiki/Rational_choice_theory&quot; rel=&quot;nofollow noreferrer&quot;&gt;Game Theory&lt;/a&gt; aiming to model people's preferences and designing voting mechanisms.&lt;/p&gt;&#xA;" OwnerUserId="467" OwnerDisplayName="SRKX" LastEditorUserId="-1" LastEditDate="2017-04-13T12:51:38.530" LastActivityDate="2011-12-18T10:02:03.243" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3381" PostTypeId="2" ParentId="3379" CreationDate="2011-12-22T11:35:52.083" Score="5" Body="&lt;p&gt;One can get some kind of absolute measure of satisfaction by working with &lt;a href=&quot;http://psychology.about.com/od/jindex/g/just-difference-threshold.htm&quot;&gt;just noticable differences&lt;/a&gt;. The idea is that a decision maker is indifferent between very similar choices but not indifferent between dissimilar choices. Here is an example: A decisonmaker likes sugar, and wants as much sugar as possible- with a caveat. Let $\epsilon&amp;gt;0$ be the just notable difference and $s_1$ and $s_2$ be two amounts of sugar. Then the consumer prefers $s_1$ weakly to $s_2$, in symbols $s_1\succeq s_2$, if $s_1$ isn't noticable smaller than $s_2$. That is, $s_1\succeq s_2$ if and only if $s_2-s_1&amp;lt;\epsilon$. The resulting preference relation is not transitive, but the assymetric part $\succ$, given by $s_1\succ s_2$ iff $s_1\succeq s_2$ and $\neg(s_2\succeq s_2)$, is transitive. With such preferences, one can get an absolute scale of measurement, based on the number of just-notable-differences from zero (if there is a zero). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A discussion of this approach can be found in section 6.4.1. in &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0521741238&quot;&gt;Theory of Decision under Uncertainty&lt;/a&gt; by Itzhak Gilboa.   &lt;/p&gt;&#xA;" OwnerDisplayName="Michael Greinecker" LastActivityDate="2011-12-22T11:35:52.083" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3382" PostTypeId="1" AcceptedAnswerId="3384" CreationDate="2012-04-30T07:28:05.560" Score="8" ViewCount="4403" Body="&lt;p&gt;In my (limited) understanding, the behavior of a stock price can be modeled using Geometric Brownian Motion (GBM). According to the Hull book I'm currently reading, the discrete-time version of this model is as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta S = \mu S \Delta t + \sigma S \varepsilon \sqrt{\Delta t}, \quad \varepsilon \sim N(0,1)$$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I'm performing a Monte Carlo simulation, could I use the term structure of a GARCH model to plug in a unique value for the volatility at each time step instead of using a constant value?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this a correct use of the GARCH model?&lt;/p&gt;&#xA;" OwnerUserId="914" LastEditorUserId="914" LastEditDate="2012-04-30T17:52:58.197" LastActivityDate="2017-07-03T05:16:08.630" Title="Stock Price Behavior and GARCH" Tags="&lt;monte-carlo&gt;&lt;stochastic-volatility&gt;&lt;garch&gt;" AnswerCount="4" CommentCount="6" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="3383" PostTypeId="1" AcceptedAnswerId="7141" CreationDate="2012-04-30T11:21:26.720" Score="4" ViewCount="3316" Body="&lt;p&gt;I am trying to achieve the following functionality using QuickFIX for FIX 4.2&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Send a couple of orders and make sure they’re filled.&lt;/li&gt;&#xA;&lt;li&gt;Then disconnect.&lt;/li&gt;&#xA;&lt;li&gt;Change the incoming (from Broker) sequence number to a lower number. Example if it is 300 i now change it to 260.&lt;/li&gt;&#xA;&lt;li&gt;Log back in.&lt;/li&gt;&#xA;&lt;li&gt;My Application should detect the sequence number from Broker, as lower than what is expected and my side should automatically send a type 2 (resend request) message to Broker.&lt;/li&gt;&#xA;&lt;li&gt;Broker will gap fill/send missing data.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;At the moment when i attempt the step 3 (i.e change to sequence number from broker to a lower value) and then attempt to login, my applications logs out immediately with the error message the MsgSeqNum is lower than what is expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am familiar with the ResetSequenceNumFlag, ResetOnLogon, ResetOnLogout flags but they don't seem to be the right choice for the above procedure.&lt;/p&gt;&#xA;" OwnerUserId="2369" LastActivityDate="2015-09-18T13:33:03.170" Title="Resequencing of MsgSeqNum in FIX 4.2" Tags="&lt;automated-trading&gt;&lt;research&gt;&lt;backtesting&gt;&lt;programming&gt;" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3384" PostTypeId="2" ParentId="3382" CreationDate="2012-04-30T12:48:14.673" Score="6" Body="&lt;p&gt;I'm guessing, and correct me if I'm wrong, you want to create a number of possible paths the stock price could follow with the local volatilty given by GARCH depending on the simulated history, or in pseudocode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;N &amp;lt;- numberOfPaths&#xA;T &amp;lt;- numberOfSteps&#xA;for (i in 1:N) {&#xA;    newSeries &amp;lt;- pastPrices&#xA;    for (t in 1:T) {&#xA;        epsilon &amp;lt;- normrnd(0,1)&#xA;        sigma &amp;lt;- calculateGARCHVol(pastPrices)&#xA;        newSeries.append(nextPrice(epsilon, sigma))&#xA;    }&#xA;    allSeries.append(newSeries)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Yes, you can do this and this is correct usage of GARCH.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2012-04-30T12:48:14.673" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3385" PostTypeId="2" ParentId="3382" CreationDate="2012-04-30T15:02:51.620" Score="10" Body="&lt;p&gt;Okay just to wind things down here, I think an important clarification is needed if readers might come and seek to a similar solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Geometric Brownian Motion (&lt;a href=&quot;http://en.wikipedia.org/wiki/Geometric_Brownian_motion&quot; rel=&quot;nofollow noreferrer&quot;&gt;GBM&lt;/a&gt;) is a model of asset prices dynamics which is usually given as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dS_t = \mu S_t dt + \sigma S_t dB_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $B_t$ is a &lt;a href=&quot;http://en.wikipedia.org/wiki/Brownian_motion&quot; rel=&quot;nofollow noreferrer&quot;&gt;standard brownian motion&lt;/a&gt; which has several important characteristics, mainly that it is stationary and $B_t \sim N(0,t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is very famous because it is pretty simple to find a closed form solution to $S_t$ and because it was used in the derivation of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Black%E2%80%93Scholes&quot; rel=&quot;nofollow noreferrer&quot;&gt;Black-Scholes formula&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you state is a dicretization of the GBM:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S_{t+\Delta t}-S_t= \Delta S_t = \mu S_t \Delta t + \sigma S_t \epsilon \sqrt{\Delta t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You just used the property from the Brownian motion (which is a random walk) and which says that $B_{t + \Delta t} - B_t = B_{\Delta t} \sim N(0,\Delta t)$ and created a similar variable $\underbrace{\epsilon}_{N(0,1)} \sqrt{\Delta t} \sim N(0,\Delta t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It this model, you assume volatility is constant $\sigma$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now &lt;a href=&quot;http://en.wikipedia.org/wiki/Autoregressive_conditional_heteroskedasticity&quot; rel=&quot;nofollow noreferrer&quot;&gt;GARCH&lt;/a&gt;(p,q) is different: the model tries to find a way to express the return at time $t+1$ given the the last returns. And it assumes that each new return is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_t=a_0 + z_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $z_t = \sigma_t \epsilon_t \sim N(0,\sigma_t^2)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The local volatility is assumed in the model to be &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma_t^2 = \alpha_0 + \sum_{i=1}^q \alpha_i z_{t-i} + \sum_{i=1}^p \beta_i \sigma_{t-i}^2$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what you do is that you choose 2 parameters $p$ and $q$, you fit the model to your historical data to get the parameters $a_0, \alpha_i, \beta_i$ (using a maximum likelihood estimator) and hence you can compute you estimated past $\sigma_i$ for $i \leq t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then &lt;em&gt;simulate&lt;/em&gt; different path of the stock in the future by using the equation of the models to generate the futures $\sigma_t$ and $r_t$ and it will differ on each generation because you need to generate an $\epsilon_t$ at each step. This is useful for Monte-Carlo simulation of options for example when you do not want to use the constant volatility of the discretized GBM.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2017-07-03T05:16:08.630" LastActivityDate="2017-07-03T05:16:08.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3386" PostTypeId="1" AcceptedAnswerId="3590" CreationDate="2012-04-30T15:24:10.017" Score="5" ViewCount="1184" Body="&lt;p&gt;There are many disciplines that have contributed to how one model's risk and return. Physics introduced Brownian motion and RMT. Machine learning has helped to solve complex portfolio construction problems, operations research has contributed to market making &amp;amp; risk management, and aerospace engineering has contributed the Kalman filter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for papers that use methods traditionally applied to bioinformatics and genetics to model the behavior of equities. For example, epidemiology makes extensive use of canonical regression -- Blackburn et al. apply canonical regression to tease out the co-movement of equities &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2024770&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not looking for links to neural network, SVM, or other machine learning papers. I am looking for &lt;strong&gt;creative and novel extensions&lt;/strong&gt; of methods used traditionally in the bioinformatics and genetics space that are applied to generate alpha or risk models in U.S. equities? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, bioinformatics has developed a variety of greedy search alorithms that identify which types of traits give rise to certain phenotypes. Is there a paper that applies some of the algorithms from the bioinformatics domain to U.S. equities where traits might be financial statement variables and phenotypes might be return outcomes? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know &lt;a href=&quot;http://www.chicagobooth.edu/faculty/bio.aspx?person_id=12824645632&quot; rel=&quot;noreferrer&quot;&gt;Carlos Carvalho&lt;/a&gt; (U. Chicago) has done both innovative work in the field of equities and also genetics and recall he had some research along these lines.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-04-30T20:05:27.233" LastActivityDate="2012-06-12T04:59:11.080" Title="What are some applications of bioinformatics or genetics to generating alpha in U.S. equities?" Tags="&lt;research&gt;&lt;modeling&gt;&lt;algorithm&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3388" PostTypeId="2" ParentId="3344" CreationDate="2012-04-30T21:04:14.763" Score="4" Body="&lt;p&gt;Using intra-day data, the concept of viscosity is easier to define. At the microstructure scale, you can see the price moves as a diffusion constrained by the quantities in the order books. Viscosity is a mix of pressure of volumes, rounding by the tick size, and bid-ask bounce.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See for instance &lt;a href=&quot;http://jfec.oxfordjournals.org/content/9/2/344.abstract?sid=d5f06872-1982-4469-8a3e-c8e502b195bf&quot; rel=&quot;nofollow&quot;&gt;A New Approach for the Dynamics of Ultra-High-Frequency Data: The Model with Uncertainty Zones, by M Rosenbaum and C Y Robert, In Jnl of Financial Econometrics Volume 9, Issue 2, pp 344-366&lt;/a&gt;. In this paper, authors present a way to estimate simultaneously the volatility and a &lt;em&gt;rounding adjustement level&lt;/em&gt; $\eta$ (eta). This parameter can be seen as the &lt;em&gt;viscosity&lt;/em&gt; of the studied stock.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2012-04-30T21:17:33.500" LastActivityDate="2012-04-30T21:17:33.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3389" PostTypeId="1" CreationDate="2012-05-01T13:27:20.120" Score="13" ViewCount="625" Body="&lt;p&gt;In the attached image I have a plot of the rolling correlation of 90-day historic volatility (using the Garman Klass estimator based on Sinclair's Volatility Trading) of JPM v. the S&amp;amp;P. As can be clearly seen, the correlation is generally somewhere near 1. However, there are times when the correlation degrades significantly (witness summer 2011). I'm curious of two things:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Trading strategies that may be implemented to exploit the breakdown using listed equity options (assuming one expects the correlation to revert back near the historic norm, in this case near 1)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How one might use the information to help predict future volatility&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/XHBdR.png&quot; alt=&quot;JPM v. S&amp;amp;P Volatility Correlation&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="1112" LastActivityDate="2012-07-20T12:18:29.493" Title="Exploiting breakdowns in correlation of estimated volatility" Tags="&lt;volatility&gt;&lt;trading&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3390" PostTypeId="1" CreationDate="2012-05-01T14:37:08.763" Score="2" ViewCount="195" Body="&lt;p&gt;I'm not a statistician but I'm writing my thesis on mathematical finance and I think it would be neat to have a short section about independence of stock returns. I need to get better understanding about some assumptions (see below) and have a good book to cite. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a model for stock prices $S$ in which the daily ($t_i - t_{i-1}=1$) log-returns&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X_n = \ln\left(\frac{S(t_n)}{S(t_{n-1})}\right), \ \ n=1,...,N$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;are normally distributed with mean $\mu-\sigma^2/2$ and variance $\sigma^2$. The autocorrelation function with lag 1 is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r = \frac{Cov(X_1,X_2)}{Var(X_1)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which I estimate by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\hat{r} = \frac{(n+1)\sum_{i=1}^{n-1} \bigl(X_i - \bar{X} \bigr)\bigl(X_{i+1} - \bar{X} \bigr)}{n \sum_{i=1}^{n}\bigl(X_i - \bar{X} \bigr)^2} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\bar{X} = \frac{1}{n}\sum_{i=1}^N X_i$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I understand that under some &lt;strong&gt;some assumptions&lt;/strong&gt; it holds that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\lim_{n \rightarrow \infty} \sqrt{n}\hat{r} \in N(0,1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would be very glad if someone could point me towards a good book which I can cite in my thesis and read about these assumptions (I guess it has something to do with the central limit theorem).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Crossposting at:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mathematics: &lt;a href=&quot;https://math.stackexchange.com/questions/139408/good-reference-on-sample-autocorrelation&quot;&gt;https://math.stackexchange.com/questions/139408/good-reference-on-sample-autocorrelation&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Statistics: &lt;a href=&quot;https://stats.stackexchange.com/questions/27465/good-reference-on-sample-autocorrelation&quot;&gt;https://stats.stackexchange.com/questions/27465/good-reference-on-sample-autocorrelation&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2376" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2012-05-01T17:16:15.767" Title="Good reference on sample autocorrelation?" Tags="&lt;time-series&gt;&lt;auto-correlation&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3391" PostTypeId="2" ParentId="3390" CreationDate="2012-05-01T17:16:15.767" Score="2" Body="&lt;p&gt;Three good references are the&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Asymptotic theory for econometricians, H. White&lt;/li&gt;&#xA;&lt;li&gt;Stochastic Limit Theory, Davidson&lt;/li&gt;&#xA;&lt;li&gt;Asymptotic Theory of Statistical Inference for Time Series, Taniguchi and Kakizawa&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;They are roughly in order of complexity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The crux of the matter is to balance the requirements of finiteness of higher moments of $X$ with its dependence structure, or, put it differently, to balance the thickness of the tails with the memory of the process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't peek into the abyss for too long.&lt;/p&gt;&#xA;" OwnerUserId="1531" LastActivityDate="2012-05-01T17:16:15.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3392" PostTypeId="2" ParentId="3364" CreationDate="2012-05-01T18:37:15.883" Score="4" Body="&lt;p&gt;Is the covariance of the raw return forecasts a good forecaster of the covariance of market returns? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you suggest, the covariance of the raw return forecasts is a lousy forecast of the covariance of market returns. Grinold &amp;amp; Kahn explain why quite eloquently in Active Portfolio Management, 2nd edition (pg. 275). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It might be tempting to augment the risk matrix with the correlations of the alpha signals, however, this &quot;line of thought confounds the notion of conditional means (i.e. the expected return on the S&amp;amp;P 500 taking into consideration research) and the notion of conditional covariance (i.e. how research should influence the forecasts of variance and covariance).&quot;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;It is surprising to note that forecasts of returns have negligible&#xA;  effects on forecasts of volatility and correlation. It is even more&#xA;  surprising to note that what little effect there is has &lt;em&gt;nothing&lt;/em&gt; to&#xA;  do with the &lt;em&gt;forecast&lt;/em&gt; and &lt;em&gt;everything&lt;/em&gt; to do with the &lt;em&gt;skill of the&#xA;  forecaster&lt;/em&gt;. This welcome news makes life easier. We can concentrate&#xA;  on the expected return part and not worry about the risk part.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Should we &quot;fix&quot; the forecasts in some way?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking a Bayesian line of argument, if you have a strong prior then you can and should fix (i.e. blend) the forecasts with the prior. Rather than use the covariance of market returns as the prior, some use market implied returns (i.e. Black Litterman) to update their forecasts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If these are indeed &quot;raw&quot; or un-refined raw forecasts, you could also use a multi-variate form of Grinold &amp;amp; Kahn's alpha = volatility * IC * score to update the raw forecasts. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another choice of optimal factor structure to blend with might be correlation structure derived from a industry or style multi-factor model.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-05-01T18:44:00.943" LastActivityDate="2012-05-01T18:44:00.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3394" PostTypeId="2" ParentId="3364" CreationDate="2012-05-01T19:02:27.680" Score="0" Body="&lt;p&gt;For a longer history of forecast returns their covariance should converge to the sample covariance. Else the forecast returns exhibit a systematic error with respect to their covariance. Thus, the transforming matrices should be chosen such that the history of forecasts (including the current forecast) exhibits the sample covariance. (In this process instead of the sample covariance matrix another [Bayesian] prior might be used, towards which the sample covariance matrix was shrunk in the first place, as well. This depends on your belief in the sample covariance matrix as being the true covariance matrix of your series or not.)&lt;/p&gt;&#xA;" OwnerUserId="2284" LastActivityDate="2012-05-01T19:02:27.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3395" PostTypeId="2" ParentId="1658" CreationDate="2012-05-01T19:38:35.000" Score="-2" Body="&lt;p&gt;we are all from science/engineering background. So let me put it this way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Algorithmic trading is an engineering product, which bring buyer and seller together. Essentially, there is nothing different between automated trading systems and eBay or Amazon. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Algo trading is not about providing liquidity. There are plenty of liq-taking-only strategies running in the market, and they seem to be still profitable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Algorithmic trading's contribution is---just like the contribution of eBay and Amazon--- is to replace expensive and unreliable human interventions. Just take a look at trading in Hongkong today, trading in Europe 5 years ago and trading in US 10 years ago. To produce the volume we take for granted today, we used to need tons of well-paid traders sitting there watching screens everyday. Please note that the average monthly cost for a desk (literally a desk with 4 legs) on a trading floor in Manhattan is USD 2000, a bloomberg terminal cost another 1800 a month. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;with Algo trading massively implemented these days. How many old school chart-reading traders are still profitable? The number of successful human day traders is going down every months, just like the number of book shops in the street dropped significantly in the past 10 years, thanks to Amazon. Algo trading thus makes the business of trading much cheaper than it used to be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might argue that Algo trading is expensive as well. True, all those colocations and MIT CS graduates need to be paid. But you must agree with me that such cost is still much lower than what we used to pay those so-called Big Dick traders, who make a phone call to buy/sell millions shares, who smash monitors with a bats when they make a bad trade, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are French, you might want some linear models here to make above arguments looks more 'quanty'. But this is really not rocket science, if we know how Orbitz works, we should also understand why algo trading is the future.&lt;/p&gt;&#xA;" OwnerUserId="2235" LastEditorUserId="2235" LastEditDate="2012-05-04T21:20:00.433" LastActivityDate="2012-05-04T21:20:00.433" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3398" PostTypeId="2" ParentId="3357" CreationDate="2012-05-01T20:39:49.603" Score="3" Body="&lt;p&gt;1) If you want to show an unsophisticated investor with like a real-time estimate of volatility, my main suggestion would be to fit a Garch model to the returns and use those estimates of the conditional volatility. Just provide a chart of it, rather than showing the model and all the details that go into calculating it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) If that is too complicated, you might try checking out GIPS performance standards for an industry standard approach to reporting performance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) People generally call it realized volatility rather than experienced volatility. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2012-05-01T20:39:49.603" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3399" PostTypeId="2" ParentId="3382" CreationDate="2012-05-01T20:57:50.330" Score="3" Body="&lt;p&gt;For the univariate case, consider X which is the log prices of some stock. First, fit X with an AR(p) model and collect the residuals. Next, fit a Garch(p,q) model and collect the conditional standard deviations. Scale the initial residuals by the conditional standard deviations to produce a new series that has mean of 0 and variance 1. For the sake of simplicity, assume this is normally distributed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the simulation a generic step would look like: 1) simulate from N(0,1) and collect that in a vector, 2) create a vector that would be the result of using the Garch model above to find the conditional standard deviation in each simulation, 3) Hadamard product the N(0,1) vector by the new vector of condition standard deviations, 4) add that to what you would get from the conditional mean from the AR(p) equation, 5) take the exp() of the vector to convert back to stock prices. If you do this each period and collect them to one matrix, then you will have the distribution of the prices over time.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2012-05-01T20:57:50.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3400" PostTypeId="2" ParentId="3270" CreationDate="2012-05-01T21:01:44.210" Score="3" Body="&lt;p&gt;If you fit a VAR(p) model to two or more securities in levels, then it will incorporate the cointegration effects. If you project this to the horizon and convert back into security prices, then you will be able to calculate the distribution of profits at the horizon. In this sense you could then perform a traditional optimization. This is useful in the case where one of the variables in the VAR(p) model is not traded. In this case, when the variable is cheap, you would only purchase it if it has favorable properties from perspective of the whole portfolio, rather than just individually.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2012-05-01T21:01:44.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3402" PostTypeId="2" ParentId="466" CreationDate="2012-05-02T02:56:26.627" Score="3" Body="&lt;p&gt;It is possible to price CRAs using the LMM using a Brownian bridge technique. You simulate&#xA;to each coupon date and then infer the expectation of the coupon given the values of &#xA;the rates at the start and end of the accrual period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://ssrn.com/abstract=1461285&quot; rel=&quot;nofollow&quot;&gt;http://ssrn.com/abstract=1461285&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interpolation Schemes in the Displaced-Diffusion LIBOR Market Model and the Efficient Pricing and Greeks for Callable Range Accruals&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Christopher Beveridge&lt;/p&gt;&#xA;&#xA;&lt;p&gt;University of Melbourne - Centre for Actuarial Studies&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mark S. Joshi&lt;/p&gt;&#xA;&#xA;&lt;p&gt;University of Melbourne - Centre for Actuarial Studies&lt;/p&gt;&#xA;&#xA;&lt;p&gt;August 25, 2009&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Abstract:&lt;br&gt;&#xA;We introduce a new arbitrage-free interpolation scheme for the displaced-diffusion LIBOR market model. Using this new extension, and the Piterbarg interpolation scheme, we study the simulation of range accrual coupons when valuing callable range accruals in the displaced-diffusion LIBOR market model. We introduce a number of new improvements that lead to significant efficiency improvements, and explain how to apply the adjoint-improved pathwise method to calculate deltas and vegas under the new improvements, which was not previously possible for callable range accruals. One new improvement is based on using a Brownian-bridge-type approach to simulating the range accrual coupons. We consider a variety of examples, including when the reference rate is a LIBOR rate, when it is a spread between swap rates, and when the multiplier for the range accrual coupon is stochastic. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2012-05-02T02:56:26.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3404" PostTypeId="1" CreationDate="2011-10-13T10:12:32.437" Score="10" ViewCount="64" Body="&lt;p&gt;The World Economic Forum &lt;a href=&quot;http://www.weforum.org/en/initiatives/gcp/Global%20Competitiveness%20Report/index.htm&quot;&gt;Global Competitiveness Report&lt;/a&gt; offers a comprehensive view of individual country risk/reward.  There has been an explosion of these types of indexes over the past few years.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The UN has its &lt;a href=&quot;http://hdr.undp.org/en/reports/global/hdr2010/&quot;&gt;Human Development Index&lt;/a&gt;, the World Bank has its &lt;a href=&quot;http://www.doingbusiness.org/economyrankings/&quot;&gt;Ease of Doing Business&lt;/a&gt; report and there are dozens of other organisations producing such analysis and rankings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given that there are over 200 country investment destinations and you might want to narrow that list down before conducting in-depth research which reports/indexes or data/comparisons are most useful (health, education, tax rates, employment levels, that sort of thing)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please ignore ratings agencies in your answer.  They produce useful scores but their methodology and underlying data is &quot;closed&quot; and proprietary, so difficult to evaluate or adjust to particular needs.  This question is about being able to evaluate the analysis and, potentially, reweight or reorientate the existing index.&lt;/p&gt;&#xA;" OwnerUserId="2364" OwnerDisplayName="Turukawa" LastActivityDate="2012-05-02T08:06:29.333" Title="What are useful indexes for rapid evaluation of country economic risk?" Tags="&lt;risk&gt;&lt;investment&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3405" PostTypeId="2" ParentId="3404" CreationDate="2011-10-13T21:37:47.250" Score="4" Body="&lt;p&gt;Off the top of my head, credit default swaps (CDS) on sovereign debt -- and perhaps on large companies in the sector you care about in that country, if the CDS's exist -- leap to mind. Check out the &lt;a href=&quot;http://en.wikipedia.org/wiki/Credit_default_swap&quot; rel=&quot;nofollow&quot;&gt;Wikipedia&lt;/a&gt; article on them. They are something along the lines of &quot;insurance rates&quot; (not exactly, but this is a reasonable first-pass understanding) on a country's debt. This is like a market-based way to think about likelihood of default.&lt;/p&gt;&#xA;" OwnerUserId="1356" OwnerDisplayName="Nate" LastActivityDate="2011-10-13T21:37:47.250" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3407" PostTypeId="2" ParentId="466" CreationDate="2012-05-02T09:03:30.077" Score="3" Body="&lt;p&gt;I know this may sound extreme, but in my experience for these kind of payoffs you do need a LMM and possibly with at least 8 factors. There is no shortcut unfortunately, even a 3 factor gaussian model, which you can use to price faster using trees, will not capture the possible dynamics of the curve implicit in an 8 factor LMM. Just my modest opinion obviously.&lt;/p&gt;&#xA;" OwnerUserId="2149" LastActivityDate="2012-05-02T09:03:30.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3408" PostTypeId="2" ParentId="3293" CreationDate="2012-05-02T14:23:01.690" Score="4" Body="&lt;p&gt;For the stationary multivariate normal case, the expected returns vector does not matter. This is because the cross-sectional mean is subtracted out before calculating the standard deviation. The cross-sectional mean can be more conveniently thought of as like the return on an equally weighted portfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, I would argue that the &lt;em&gt;expected&lt;/em&gt; cross-sectional standard deviation will equal the standard deviation of an equally weighted portfolio. In order to calculate the actual cross-sectional standard deviation, you can basically do the same thing and assume an equally weighted portfolio, so they should be analytically the same thing. I ran some tests for five variables and simulated 10,000 times and the numbers came close. They were not perfect, but I suspect that if I took the number of variables and simulations to infinity, then it would work. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2012-05-02T14:23:01.690" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3409" PostTypeId="2" ParentId="1658" CreationDate="2012-05-02T14:30:57.217" Score="-3" Body="&lt;p&gt;Links I've come across:&#xA;&lt;a href=&quot;http://pinboard.in/u:MichaelBishop/t:high_frequency_trading&quot; rel=&quot;nofollow&quot;&gt;http://pinboard.in/u:MichaelBishop/t:high_frequency_trading&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2382" LastActivityDate="2012-05-02T14:30:57.217" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3410" PostTypeId="2" ParentId="3357" CreationDate="2012-05-02T15:39:59.427" Score="5" Body="&lt;p&gt;There is a paper by &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=970480&quot; rel=&quot;noreferrer&quot; title=&quot;We Don't Quite Know What We are Talking About When We Talk About Volatility&quot;&gt;Goldstein and Taleb (2007)&lt;/a&gt; which tries to address this question of what number captures investors intuitive feelings of the volatility of series of returns and whether this coincides with the standard deviation of returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What they found was that &lt;a href=&quot;http://en.wikipedia.org/wiki/Median_absolute_deviation&quot; rel=&quot;noreferrer&quot;&gt;Median Absolute Deviation&lt;/a&gt; does a much better job of capturing this intuition in a small sample of investment professionals, even when the return series were sampled from a normal distribution.&lt;/p&gt;&#xA;" OwnerUserId="142" LastActivityDate="2012-05-02T15:39:59.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3412" PostTypeId="1" AcceptedAnswerId="3413" CreationDate="2011-10-12T13:01:41.113" Score="17" ViewCount="557" Body="&lt;p&gt;I was recently reading an article about how financial accounting has increasingly deviated from the ratios expected by Benford's Law. (&lt;a href=&quot;http://econerdfood.blogspot.com/2011/10/benfords-law-and-decreasing-reliability.html&quot;&gt;Benford's Law and Decreasing Reliability&lt;/a&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The author discusses the S&amp;amp;L crisis, but that's not enough to say that Benford's Law is a good predictor of performance. How reliable of a predictor is Benford's Law for anticipating crises or even for company failure on a case by case basis? If you could cite specific examples from history, that would be great. &lt;/p&gt;&#xA;" OwnerUserId="1275" OwnerDisplayName="BlackJack" LastEditorUserId="70" LastEditDate="2012-05-02T22:47:07.097" LastActivityDate="2012-05-02T22:47:07.097" Title="How reliable is  Benford's Law in forecasting crises?" Tags="&lt;statistical-finance&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3413" PostTypeId="2" ParentId="3412" CreationDate="2011-10-12T13:25:21.313" Score="11" Body="&lt;p&gt;A recent example is Greece. Greece's public accounts &lt;strong&gt;&lt;a href=&quot;http://timharford.com/2011/09/look-out-for-no-1/&quot;&gt;deviated significantly&lt;/a&gt;&lt;/strong&gt; from the distribution of values indicated by Benford's Law just before joining the Euro.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It has been suggested that Greece modified their numbers in order to remain compliant with the Maastrict Treaty. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can get the full article + statistics for all Euro members &lt;strong&gt;&lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/j.1468-0475.2011.00542.x/abstract&quot;&gt;here&lt;/a&gt;&lt;/strong&gt;. It shouldn't even be behind a pay wall.&lt;/p&gt;&#xA;" OwnerDisplayName="CarrKnight" LastActivityDate="2011-11-25T19:23:46.023" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3414" PostTypeId="2" ParentId="3412" CreationDate="2011-12-24T10:27:57.657" Score="4" Body="&lt;p&gt;Keep in mind that Benford's law is not a universal or natural law. A violation of Benford's law is neither a necessary nor a sufficient condition to prove a flaw or a quality issue in the data. At the best, it can give you a hint, but it should not be trusted blindly. Moreover, note that for some types of data the law will not work at all, such as e.g Likert scale variables or binary variables. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is also problematic to apply Benford's law to macroeconomic data. Structural breaks which can typically be found in economic data series can result in a rejection of Benford's law. There is an interesting article by two IMF statisticians on that topic: &#xA;&lt;a href=&quot;http://www.imf.org/external/pubs/ft/wp/2009/wp0910.pdf&quot; rel=&quot;nofollow&quot;&gt;Benford’s Law and Macroeconomic Data Quality&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2370" OwnerDisplayName="EnergyNumbers" LastActivityDate="2011-12-24T10:27:57.657" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3417" PostTypeId="2" ParentId="1224" CreationDate="2012-05-03T01:28:42.893" Score="2" Body="&lt;p&gt;Interactive Brokers does not offer historical data on expired options.  All IV calculations must be derived from options that have not expired yet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe historical volatility is calculated from the underlying security, and implied volatility is calculated from the option premium.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IB's API has a routine called calculateImpliedVolatility().  Never used it, so I can't give details.  IB's API also has a routine called calculateOptionPrice() to retrieve option Greeks.  Again, I've never used it, but they're out there.&lt;/p&gt;&#xA;" OwnerUserId="2388" LastEditorUserId="2388" LastEditDate="2012-05-03T01:36:53.540" LastActivityDate="2012-05-03T01:36:53.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3421" PostTypeId="1" AcceptedAnswerId="3450" CreationDate="2012-05-03T07:57:56.840" Score="7" ViewCount="3474" Body="&lt;p&gt;I am thinking of writing a VaR framework for my existing system, using quantlib to do the bulk of the calculations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Despite several searches, I have not as yet come across a quantlib VaR implementation. Is anyone aware of a quantlib based VaR implementation that I may be able to use a s a starting point (to prevent reinventing the wheel)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming that such a library/framework does not exist - could someone please outline the main steps involved in putting together such a system - so I can make sure that I am not missing anything obvious/ I am on the right track.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, I will have to map my current rate curves and instruments to the Quantlib objects. I will write adaptors to doing the mapping between the classes so assuming that is out of the way, it would be useful to get an outline of the steps required to put a VaR system together using quantlib (assuming there is no such library/framework to build from).&lt;/p&gt;&#xA;" OwnerUserId="1733" LastActivityDate="2014-09-22T19:43:51.410" Title="VaR implementation using quantlib?" Tags="&lt;programming&gt;&lt;var&gt;&lt;quantlib&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3422" PostTypeId="2" ParentId="3421" CreationDate="2012-05-03T08:09:52.500" Score="2" Body="&lt;p&gt;Why don't you try to contact them&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://quantlib.org/mailinglists.shtml&quot; rel=&quot;nofollow&quot;&gt;http://quantlib.org/mailinglists.shtml&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've worked with them in the past, they're very nice people and will help you for sure if they can.&lt;/p&gt;&#xA;" OwnerUserId="2149" LastEditorUserId="2149" LastEditDate="2012-05-03T12:36:00.460" LastActivityDate="2012-05-03T12:36:00.460" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3423" PostTypeId="2" ParentId="1224" CreationDate="2012-05-03T08:26:32.770" Score="0" Body="&lt;p&gt;For any enquiry about the IB API you will find more information (and open source code) here&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://finance.groups.yahoo.com/group/TWSAPI/&quot; rel=&quot;nofollow&quot;&gt;http://finance.groups.yahoo.com/group/TWSAPI/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2149" LastActivityDate="2012-05-03T08:26:32.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3427" PostTypeId="1" CreationDate="2012-05-03T14:44:13.697" Score="4" ViewCount="423" Body="&lt;p&gt;Few quick questions on how locates work.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;How do brokerages charge for locates?  They charge based on volume? &#xA;How long you need the locate (I assume an one day is max)?    &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Do the brokerages actually hold the underlier 1:1 with the&lt;br&gt;&#xA;potential short?  AKA: If I want the ability to short IBM 1 million&lt;br&gt;&#xA;shares, does the brokerage actually hold 1 million in order to cover?&#xA;Or do they just hold a certain ratio of the total?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How do brokerages hedge themselves against underlier price movement?  Do&#xA;they buy options?  I assume that would factor in to the cost of&lt;br&gt;&#xA;the locate.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2358" LastActivityDate="2012-05-03T16:13:59.120" Title="How do brokers charge for locates?" Tags="&lt;short-selling&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3428" PostTypeId="2" ParentId="3427" CreationDate="2012-05-03T14:56:01.697" Score="1" Body="&lt;p&gt;I'm not an expert on this topic by any means, but my impression is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Generally brokers will not charge for locates unless you start asking for a lot more than you end up using.  Locates are good for one day only.  I would imagine the brokers themselves are charged some small fee for the locate, but for the customer this fee is just part of the commission for executing the trade.  If you frequently locate but do not execute, then they are not earning commissions and will either drop you as a customer or start charging for locates.&lt;/li&gt;&#xA;&lt;li&gt;Brokerages do not hold anything when you request a locate.  They merely contract with someone who holds the shares to exclusively put aside the shares for potential short selling with that brokerage.  It is often arranged through an inter-dealer broker such as SSgA.  The holders are often long-term holders with no plans to sell the shares any time soon.&lt;/li&gt;&#xA;&lt;li&gt;There is no need for a brokerage to hedge itself, particularly if the broker is acting as a pure agency broker.  For orders executed as principal, the story may differ significantly from one broker to another.  Even if the brokerage is holding the shares, it is typically holding them on behalf of some other client, which obviously wants the risk associated with that stock.  The brokerage is then making a calculated bet that the majority of their clients will not all want to sell their shares on the same day.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2012-05-03T16:13:59.120" LastActivityDate="2012-05-03T16:13:59.120" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3429" PostTypeId="1" AcceptedAnswerId="3432" CreationDate="2011-10-12T15:37:38.817" Score="12" ViewCount="344" Body="&lt;p&gt;To quote Wikipedia:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In hyperbolic discounting, valuations fall very rapidly for small delay periods, but then fall slowly for longer delay periods. This contrasts with exponential discounting, in which valuation falls by a constant factor per unit delay, regardless of the total length of the delay.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Hyperbolic_discounting&quot; rel=&quot;nofollow&quot;&gt;Hyperbolic Discounting&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This concept has been viewed as a possible structure for the construction of utility functions, but I'm interested in its application to security valuation. As you may know, asset valuation - at least for equities - is dominated by discounted cash flow (DCF) analysis, which is a time-consistent method of valuation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do any models exist to value securities using hyperbolic discounting? If not, how would one go about creating such a model? &lt;/p&gt;&#xA;" OwnerUserId="1275" OwnerDisplayName="BlackJack" LastEditorUserId="848" LastEditDate="2012-05-11T19:04:13.570" LastActivityDate="2012-05-11T19:04:13.570" Title="Are there any valuation models of securities that use hyperbolic discounting?" Tags="&lt;modeling&gt;&lt;valuation&gt;" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3430" PostTypeId="2" ParentId="3429" CreationDate="2011-10-12T17:28:38.090" Score="4" Body="&lt;p&gt;To create such a model, you'd start with some data, and then start fitting curves to it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, let's take a company where there are reasonable consensus forecasts about the next few years' earnings; and let's assume you've got some time-series data on changes in those consensus forecasts, and changed in the price. You could then fit a model based on a set of constraints where your discount value decreased year on year, and where (for example), the ratio of your nth year discount rate to n+1th year discount rate is, say, greater than 1.3 (to pluck a factor out of the air). So a 1st-year discount rate of 26% would imply a second-year discount rate of less than 20% ... and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that here, your cost of carry would not reflect your discount rate. So you've got an assumption that your market price is arrived at by a systemic flawed valuation method, which suggests that a new entrant could come into the market with a discount rate that reflected cost of carry, and reap excess profits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is an argument for higher discounts on earnings forecasts for years 2-5 than on next years earnings, to reflect the greater uncertainties in far-ahead forecasts. To calibrate a model on that, might require some assumptions about consensus over how those uncertainties differ over time.  Getting data on that might be hard.&lt;/p&gt;&#xA;" OwnerUserId="2370" OwnerDisplayName="EnergyNumbers" LastActivityDate="2011-10-12T17:28:38.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3431" PostTypeId="2" ParentId="3429" CreationDate="2011-10-15T19:13:05.720" Score="2" Body="&lt;p&gt;This is definitely not my field of expertise, so you can take my answer with a grain of salt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, you might want to check out some research by &lt;a href=&quot;http://www.columbia.edu/~mw2230/&quot; rel=&quot;nofollow&quot;&gt;Robert Woodford&lt;/a&gt;. I know some people who are taking a class of his and a lot of papers that he reviews discuss imperfect rationality and their effect on macro models. His CV may be a good starting point. Andrei Shleifer is also a prolific researcher in the field and studies behavioral questions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope that helps!&lt;/p&gt;&#xA;" OwnerDisplayName="dchandler" LastActivityDate="2011-10-16T20:46:01.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3432" PostTypeId="2" ParentId="3429" CreationDate="2011-10-18T22:28:43.910" Score="3" Body="&lt;p&gt;A paper by &lt;a href=&quot;http://www.aeconf.net/Articles/Nov2007/aef080208.pdf&quot; rel=&quot;nofollow&quot;&gt;Gong, Smith, and Zou (2007)&lt;/a&gt; addresses your question exactly.  From the abstract:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This paper explores the implications of hyperbolic discounting for asset&#xA;  prices and rates of return. Hyperbolic discounting has no effect on the equity&#xA;  premium. However, by making people less patient, causes stock prices to&#xA;  be lower, and interest rates higher, than with exponential discounting. In&#xA;  addition, hyperbolic discounting dampens the marginal effect of risk on stock&#xA;  prices, relative to the exponential case.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1106" OwnerDisplayName="Tal Fishman" LastActivityDate="2011-10-18T22:28:43.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3433" PostTypeId="2" ParentId="3429" CreationDate="2011-10-27T16:08:24.937" Score="1" Body="&lt;p&gt;Hyberbolic discounting seems to be operative in &quot;bear&quot; or panicked markets. That's when utilities, and other companies with heavily &quot;front ended&quot; earnings do relatively well, while cyclicals do poorly. People &quot;know&quot; that the cyclicals will (probably) do well some day, but they discount &quot;delayed&quot; earnings that will follow poor near term ones more heavily than usual.&lt;/p&gt;&#xA;" OwnerUserId="2345" OwnerDisplayName="Tom Au" LastActivityDate="2011-10-27T16:08:24.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3434" PostTypeId="2" ParentId="557" CreationDate="2012-05-03T19:19:42.760" Score="3" Body="&lt;p&gt;We use internally optimized version of Quickfix. It gives us ~30 microsecond latency. Commercial products, like Onix or RapidAdvantage FIX will give you twice less.&lt;/p&gt;&#xA;" OwnerUserId="2390" LastActivityDate="2012-05-03T19:19:42.760" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3435" PostTypeId="2" ParentId="3383" CreationDate="2012-05-03T19:25:12.440" Score="3" Body="&lt;p&gt;Are you sure there is a practical use case behind this (especially step #3). Brokers don't switch sequence number back in the middle of the session. If you absolutely need to support this use Sesssion.setNextTargetMsgSeqNum() API&lt;/p&gt;&#xA;" OwnerUserId="2390" LastActivityDate="2012-05-03T19:25:12.440" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3436" PostTypeId="2" ParentId="3293" CreationDate="2012-05-04T04:30:49.617" Score="9" Body="&lt;p&gt;If $X \sim N(\mu, V)$ is multivariate gaussian,&#xA;you can write $X = \mu + C Y$&#xA;where $ Y \sim N(0,1) $ is a standard Gaussian&#xA;and $C$ is the lower-triangular Choleski matrix of $V$.&#xA;You can then express&#xA;$ v = \sum_{i=1}^n (X_i - S/n)^2 $,&#xA;where $ S = \sum_{i=1}^n X_i $,&#xA;in terms of $Y$ and $C$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I do not reproduce the computations: they are straightforward.)&#xA;If we just want the expectation, we get:&#xA;$$&#xD;&#xA;  E[v] =&#xD;&#xA;  \sum_i \mu_i^2&#xD;&#xA;  - \dfrac1n \sum_{ij} \mu_i \mu_j&#xD;&#xA;  + \sum_i C_i C_i&amp;#39;&#xD;&#xA;  - \dfrac1n \sum_{ij} C_i&amp;#39; C_j&#xD;&#xA;$$&#xA;where $C_i$ is the $i$th row of the Choleski matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be simplified:&#xA;$$&#xD;&#xA;  E[r] = \text{trace}( \mu \mu&amp;#39; + V ) + &#xD;&#xA;         \dfrac1n \mathbf{1}&amp;#39; (\mu\mu&amp;#39; + V) \mathbf{1} &#xD;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is some R code to check the result.&#xA;(You may want to divide the result by $n$ or $n-1$,&#xA;and take the square root of this expectation.)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Simulations&#xA;library(mvtnorm)&#xA;f1 &amp;lt;- function(V,mu, R=1000) {&#xA;  n &amp;lt;- length(mu)&#xA;  apply( rmvnorm(R, mu, V), 1, function(u) sum((u - mean(u))^2) )&#xA;}&#xA;&#xA;# Computations&#xA;f2 &amp;lt;- function(V,mu) {&#xA;  n &amp;lt;- length(mu)&#xA;  #var(mu)*(n-1) + sum(diag(V)) - sum(V)/n&#xA;  v &amp;lt;- mu %*% t(mu) + V&#xA;  sum(diag(v)) - sum(v)/n&#xA;}&#xA;&#xA;# Sample data&#xA;n &amp;lt;- 10&#xA;V &amp;lt;- matrix(rnorm(n*n),n,n)&#xA;V &amp;lt;- t(V) %*% V&#xA;mu &amp;lt;- rnorm(n)&#xA;&#xA;# Check that the value is the same&#xA;f2(V,mu) / mean(f1(V,mu,R=1e5)) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1917" LastEditorUserId="1917" LastEditDate="2012-05-04T14:41:51.887" LastActivityDate="2012-05-04T14:41:51.887" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3437" PostTypeId="1" CreationDate="2012-05-04T12:25:01.547" Score="2" ViewCount="1034" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;&quot;...a low volatility environment is usually a good environment for trend following strategies; see Jez Liberty’s state of trend following report here...&quot;&lt;/em&gt;&lt;br&gt;&#xA;  &lt;a href=&quot;http://quantumfinancier.wordpress.com/2010/08/27/regime-switching-system-using-volatility-forecast/&quot; rel=&quot;nofollow&quot;&gt;http://quantumfinancier.wordpress.com/2010/08/27/regime-switching-system-using-volatility-forecast/&lt;/a&gt;&lt;br&gt;&#xA;  (By the way the volatility is defined as the &quot;std. deviation of the price rate of change&quot; )&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I am not a professional quant with education on related subjects.&lt;br&gt;&#xA;Therefore I am not capable of testing the idea above thoroughly.&lt;br&gt;&#xA;Would you approve that &lt;strong&gt;trend following strategies(TFS) perform better under lower vol.?&lt;/strong&gt;&lt;br&gt;&#xA;If yes then what would be a suitable method to exploit this idea?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;==&gt; switching to TF strategies when the volatility is below a trigger value (e.g. mov. average)?&lt;br&gt;&#xA;==&gt; switching to TF strategies when the volatility is turning down from an extreme reading (e.g. going back under the upper bollinger band)?&lt;br&gt;&#xA;==&gt; none?  &lt;/p&gt;&#xA;" OwnerUserId="2338" LastActivityDate="2012-05-04T12:25:01.547" Title="Using volatility cycles to switch between trend following &amp; range bound trading?" Tags="&lt;volatility&gt;&lt;quant-trading-strategies&gt;&lt;stochastic-volatility&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="2" ClosedDate="2012-05-04T13:48:59.540" ContentLicense="CC BY-SA 3.0" />
  <row Id="3438" PostTypeId="1" CreationDate="2012-05-04T13:58:36.417" Score="13" ViewCount="24489" Body="&lt;p&gt;I have a question concerning interest yield curves. Many institutions use the Libor-swap rate curve as a yield curve. Let's be precise and say that we want the yield curve to be the curve that gives us the rate at which a well-rated bank can lend money for any tenor. When the tenor is less than 12 months then that's basically the Libor rate of this tenor. But when the tenor is greater than 1 year, then why should this be the swap-rate? Is there a theoretical justification that the swap-rate corresponds really to this rate?&lt;/p&gt;&#xA;" OwnerUserId="2396" LastEditorUserId="35" LastEditDate="2012-05-04T14:15:02.003" LastActivityDate="2018-06-18T08:25:09.583" Title="Why use swap-rates in a yield curve?" Tags="&lt;interest-rates&gt;" AnswerCount="6" CommentCount="1" FavoriteCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="3439" PostTypeId="1" AcceptedAnswerId="3444" CreationDate="2012-05-04T16:50:22.490" Score="4" ViewCount="927" Body="&lt;p&gt;I'm new to finance in general, and recently read about Modern Portfolio Theory. Now I'm wondering how to add the following constraint on asset weights:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Each asset weight $w_i$ should &lt;em&gt;either&lt;/em&gt; be $w_i = 0$, &lt;em&gt;or&lt;/em&gt; it should be $0.05 &amp;lt;= w_i &amp;lt;= 1.0$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(With 0.05 as the lower bound just being an example.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From doodling a bit, it looks to me as if that would give a non-convex problem, and thus the usual optimization approaches won't work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone point me into the right direction on how to efficiently solve this problem for a large number of assets?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Alternatively, I could reformulate the additional constraint as&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;For each asset weight $0.05 &amp;lt;= w_i &amp;lt;= 1.0$&lt;/li&gt;&#xA;&lt;li&gt;For each asset there is an indicator $I_i \in {0, 1}$&lt;/li&gt;&#xA;&lt;li&gt;The combined weight of the selected assets must be 1: $\sum I_i w_i = 1$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What optimization technique is suitable for this problem?&lt;/p&gt;&#xA;" OwnerUserId="2397" LastEditorUserId="2397" LastEditDate="2012-05-04T21:00:03.757" LastActivityDate="2012-05-05T15:02:57.727" Title="MPT: Adding constraint on minimum asset weight" Tags="&lt;optimization&gt;&lt;asset-allocation&gt;" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3440" PostTypeId="1" AcceptedAnswerId="3441" CreationDate="2012-05-04T19:38:40.233" Score="8" ViewCount="1830" Body="&lt;p&gt;Let's say you've got American options on a future of a stock index. There are no dividends, and no risk-free rate either (assume $r=0$). Can these options then be treated as European from the perspective of using Black-Scholes to price them and calculate the Greeks?&lt;/p&gt;&#xA;" OwnerUserId="1217" LastEditorUserId="848" LastEditDate="2012-05-05T08:14:09.210" LastActivityDate="2015-09-09T07:50:03.610" Title="Can American options with no dividends and zero risk-free rate be treated as European?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3441" PostTypeId="2" ParentId="3440" CreationDate="2012-05-04T20:16:48.703" Score="7" Body="&lt;p&gt;All this assumes the absence of arbitrage:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you probably know without dividends it's is never optimal to early exercise a call option on a non dividend paying stock because then the time value is lost, if $r$ is &lt;em&gt;non-negative&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Early exercise of an American put option can be optimal if the option is sufficiently far in the money and $r &amp;gt; 0$. Then you can earn interest on the money gained.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So yes, see also Hull, 7nd edition, chapter 9 'Properties of Stock Options', section 9.6 in particular.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the rare case that $r &amp;lt; 0$ it can be optimal to exercise call options. However $r$ rarely, if ever, goes sufficiently negative on its own.&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="1217" LastEditDate="2015-09-09T07:50:03.610" LastActivityDate="2015-09-09T07:50:03.610" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3442" PostTypeId="2" ParentId="3439" CreationDate="2012-05-04T21:07:17.177" Score="1" Body="&lt;p&gt;A very basic implementation using the quadprog package in R would look something like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quadprog)&#xA;library(MASS)&#xA;&#xA;# --------------------------------------------------------    &#xA;# Generate a set of random returns for a covariance matrix&#xA;# --------------------------------------------------------&#xA;&#xA;set.seed(100)&#xA;n &amp;lt;- 100   # number of assets&#xA;m &amp;lt;- 200   # number of states of the world&#xA;rho &amp;lt;- 0.7&#xA;sigma &amp;lt;- 0.2&#xA;mu &amp;lt;- .10&#xA;Cov &amp;lt;- matrix(rho*sigma*sigma, ncol=n, nrow=n)&#xA;diag(Cov) &amp;lt;- rep(sigma*sigma, n)&#xA;S &amp;lt;- 1 + matrix(mvrnorm(m, rep(mu, n), Sigma=Cov), ncol=n)&#xA;Dmat &amp;lt;- var(S)&#xA;&#xA;# --------------------------------------------------------&#xA;# Setup quadratic problem        &#xA;# --------------------------------------------------------&#xA;&#xA;# The weights must sum to 1&#xA;Amat &amp;lt;- matrix(1, n)&#xA;&#xA;# x &amp;gt;= 5%&#xA;bLo &amp;lt;- rep(0, n)&#xA;bvec &amp;lt;- c(1, bLo)&#xA;Amat &amp;lt;- cbind(Amat, diag(n))&#xA;&#xA;# x &amp;lt;= 5%&#xA;bHi &amp;lt;- rep(.05, n)&#xA;bvec &amp;lt;- c(bvec, -bHi)&#xA;Amat &amp;lt;- cbind(Amat, -diag(n))&#xA;&#xA;dvec &amp;lt;- rep(0, nrow(Amat))&#xA;meq &amp;lt;- 1  # the first column of Amat is an equality constraint&#xA;&#xA;sol &amp;lt;- solve.QP(Dmat=Dmat, dvec=dvec, Amat=Amat, bvec=bvec, meq)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="779" LastActivityDate="2012-05-04T21:07:17.177" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3443" PostTypeId="2" ParentId="3438" CreationDate="2012-05-04T21:36:33.267" Score="14" Body="&lt;p&gt;Recall that an interest rate swap has two legs, one fixed and one floating, each paid by one party to the transaction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, assume you go to a big bank like JPM, and want to borrow $100MM at fixed rate. JPM will have to fund that position, which because it is a big bank it will do at floating interest rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But maybe JPM is worried about the effect such interest rate variation has on its Sharpe ratio, so they want to lock in the profits they made from arranging the loan with you.  In this case, they will swap fixed for floating and be able to book the profits with certainty (modulo credit risk).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, the price of your loan was ultimately driven by JPMs cost of a fixed-float swap.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-05-04T21:36:33.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3444" PostTypeId="2" ParentId="3439" CreationDate="2012-05-04T23:54:03.633" Score="3" Body="&lt;p&gt;You can use a &lt;a href=&quot;http://en.wikipedia.org/wiki/Branch_and_cut&quot; rel=&quot;nofollow&quot;&gt;branch-and-cut&lt;/a&gt; &#xA;algorithm&#xA;(this is what mixed-integer solvers use).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea is to solve the problem recursively, &#xA;by considering subproblems in which the constraints are &#xA;$w_i=0$ for some stocks and $0.05 \leq w_i \leq 1$ for others.&#xA;This gives $2^n$ convex optimization problems, &#xA;and you want the best solution among them.&#xA;Even when $n$ is small, that too much, &#xA;but you can arrange those optimization problems in a tree,&#xA;and prune large parts of it, as follows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The root of the tree has constraints of the form $0 \leq w_i \leq 1$&#xA;(and gives a bound on the value of the optimal portfolio).&#xA;Its children add constraints on the first stock:&#xA;$w_1=0$ for the first child, &#xA;$0.05\leq w_1 \leq 1$ for the second.&#xA;The grand-children similarily add constraints on the second stock, and so on.&#xA;The fully constrained problems we are interested in &#xA;are the leaves of this tree.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First solve the problem at the root of the tree and one leaf:&#xA;this gives you two values that bound the value of the optimal portfolio.&#xA;Then, search the tree, depth-first, but discard a subtree &#xA;without exploring it&#xA;if its value is worse than the best leaf found so far.&lt;/p&gt;&#xA;" OwnerUserId="1917" LastEditorUserId="1917" LastEditDate="2012-05-05T15:02:57.727" LastActivityDate="2012-05-05T15:02:57.727" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3445" PostTypeId="2" ParentId="1004" CreationDate="2012-05-05T09:17:36.703" Score="3" Body="&lt;p&gt;As we all know, it will not be in the public unless academical research.&#xA;However there is a clue. We can search for the paper that current CEO of Renaissance published. That can be worked as a stepping stone. In my opinion,  voice recognition algorithm was used to eliminate noises to see the clear pattern.&#xA;For specific voice to be recognized, it has to eliminate a lot of noises.&#xA;Let's share the papers if anyone find written by current CEO of Renaissance.&#xA;Simons has retired and the current one is the one with voice recognition, if I am not mistaken.&lt;/p&gt;&#xA;" OwnerUserId="2398" LastActivityDate="2012-05-05T09:17:36.703" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3446" PostTypeId="1" AcceptedAnswerId="3447" CreationDate="2012-05-06T11:08:07.450" Score="10" ViewCount="2229" Body="&lt;p&gt;I have read and heard a lot about latency. But I can't find any solid information that explains how latency is defined and measured. When people say they have achieved millisecond or nanosecond latency, which two points is that between? And what methods are used to measure it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We are going to deploy one strategy in a colocated server and I have been given a task to report latency. I need assistance in defining and measuring latency.&lt;/p&gt;&#xA;" OwnerUserId="2200" LastEditorUserId="35" LastEditDate="2012-05-06T14:16:42.377" LastActivityDate="2015-08-27T05:31:44.347" Title="HFT - How to define and measure latency?" Tags="&lt;high-frequency&gt;&lt;latency&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3447" PostTypeId="2" ParentId="3446" CreationDate="2012-05-06T17:59:16.240" Score="12" Body="&lt;p&gt;There are typically two important metrics:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Order to Accept&lt;/strong&gt;. This measures the round-trip time it takes your application to send an order to the exchange and get an accept, cancel, or execute back. Think of it as the minimum amount of time required for you to ask the market to do something and know whether it's been done. This plays an important role when building execution logic in models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Order to Feed&lt;/strong&gt;. This measures the amount of time it takes for an order or action to be represented in the venue's multicast depth of book feed. Depending on venue and other factors this can be faster than Order to Accept.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other measures of latency can always be conjured. Some folks consider Model Latency, or the amount of time it takes a model to receive a piece of data, perform some calculation, and act upon it. Most numbers you see people discussing and passing around are worthless because you have no frame of reference as to what exactly they mean.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remember, latencies are almost always relative. For example, the above metrics will of course be impacted by your specific co-location situation relative to the venue. That means your Order to Accept measure will be different from someone else's unless they are co-located in the same place as you (which is not uncommon, of course).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Underlying all of this is transit latency that the network imposes. As you can imagine the move towards co-location was driven by the fact that eliminating transit latency was quite easy by increasing proximity to the matching engine. I don't consider transit latency to really be a first-order metric for a trading system since it is built into the important domain specific metrics like I described above. However, it's always measured to ensure the critical network paths are behaving properly.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2012-05-06T17:59:16.240" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3448" PostTypeId="1" AcceptedAnswerId="3474" CreationDate="2012-05-06T18:22:21.203" Score="8" ViewCount="418" Body="&lt;p&gt;I'm wondering if there's any point at all in double-precision calculations, or whether it's ok to just do everything in single-precision, seeing how the difference on non-Tesla GPUs for single and double-precision calculations appears to be large.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some of the operations where this is relevant are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;General option pricing (BS, uses numerical approximation of cumulative normal distribution)&lt;/li&gt;&#xA;&lt;li&gt;Calculating implied volatility (Newton-Raphson)&lt;/li&gt;&#xA;&lt;li&gt;Interpolating the volatility smile (Levenberg-Marquardt)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In particular I'm interested in whether initial pricing is worth doing using a 'better' CND formula rather the one with just 5 constants in it... I know there are more precise ones with lots more constants, but I've been reticent to use one so far.&lt;/p&gt;&#xA;" OwnerUserId="1217" LastEditorUserId="1217" LastEditDate="2012-05-07T09:03:16.890" LastActivityDate="2012-05-09T19:21:39.753" Title="When pricing options, what precision should I work with?" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;numerical-methods&gt;&lt;mathematics&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3449" PostTypeId="1" AcceptedAnswerId="3454" CreationDate="2012-05-07T11:07:05.873" Score="14" ViewCount="2604" Body="&lt;p&gt;So, I'm in need of some tips regarding a small project I'm doing. My goal is an implementation of a Fast Fourier Transform algorithm (FFT) which can be applied to the pricing of options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First concerns: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;-which FFT, there are a lot of differents Algorithms, which can be called FFT, the most famous one being Cooley-Tukey I guess.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My thoughts on this: I prefer the most simple one, since this is no thesis or a big project, just a course on Algorithms. But it has to be compatible with option pricing (in contrast with the most -well in our general literature- referenced application of images/sound processing). So it depends on the form of input that is provided (on which I need some advice). I'm familiar with the several improvements, like a Fractional FFT, mixed radix FFT etc. But these seem pretty complex and optimization/performance driven, which is not relevant for my project.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-which Pricing model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I Guess Black Scholes is a bit too 'flat' and I am aware of the several models that emerged after BS. So with the same objectives as stated above I'd initially prefer the Heston model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a lot of considerations, and truth is I just can't see the wood for the trees.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some background info:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My background is a B.Sc in Mathematics (Theoretical), so I have some understanding of fourier transforms. Goal is a working FFT implementation for caclulating option pricing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(!)It does not have to be the fastest (no extreme optimization). Goals are trying to understand the chosen FFT and having a real-world working application. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So could you give some advice on the choices?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've read a lot of papers on FFT + Option pricing, say all the decent hits on googles first few pages. But those studies were written with a much 'higher' cause.&lt;/p&gt;&#xA;" OwnerUserId="2402" LastActivityDate="2018-05-01T12:12:46.237" Title="Implementing a Fast Fourier Transform for Option Pricing" Tags="&lt;options&gt;&lt;models&gt;&lt;pricing&gt;&lt;heston&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3450" PostTypeId="2" ParentId="3421" CreationDate="2012-05-07T14:32:01.303" Score="7" Body="&lt;p&gt;I'm guessing you're simulating rate curves etc. inside your system, and you want to reprice your instruments over the simulated curves using QuantLib.  In this case, most of the logic is in your system already, and you have to plug pricing functionality in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so, I don't think there's many steps involved besides, well, pricing the instrument on the simulated scenarios.  My suggestion for doing that is to use the facilities provided by QuantLib (like quotes and the observer/observable pattern) to avoid repeat all the mapping work on each scenario.  For instance, you can instantiate a given instrument just once; for each scenario, you can then relink the relevant handles to the simulated curves and ask the instrument for its new price.  The machinery is already in place; you can look at the test suite (say, to testGreeks in the europeanoption.cpp file, where we perturb market quotes to trigger changes in price) to see it in action.  For a description of the framework, you can see &lt;a href=&quot;http://implementingquantlib.blogspot.com/p/the-book.html&quot; rel=&quot;nofollow&quot;&gt;http://implementingquantlib.blogspot.com/p/the-book.html&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For what is worth, the library provides the basic VaR functionality in its Statistics class; it's just the stats calculation given a set of numbers, but still it's one less small wheel to reinvent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you think that QuantLib might help somehow in simulating the curves, please comment here and I'll try to extend the answer.  But since you already have a trading system, you already have a curve builder, so I guess you want to keep using that.&lt;/p&gt;&#xA;" OwnerUserId="308" LastEditorUserId="308" LastEditDate="2014-09-22T19:43:51.410" LastActivityDate="2014-09-22T19:43:51.410" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3451" PostTypeId="1" CreationDate="2012-05-07T20:03:07.653" Score="7" ViewCount="1694" Body="&lt;p&gt;There are all sorts of applications of cointegration to generating alpha on mean-reverting timeseries: comparing spot vs. futures, bond spreads, identifying mean-reverting residuals, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But there is not much literature on applying co-integration to portfolio risk. Overwhelmingly, the variance-covariance matrix is used to measure and minimize portfolio risk. Cointegration imposes stricter requirements on the relationship between two time-series than mere correlation. There are also fewer false-but-useful assumptions in the variance-covariance method such as the i.i.d, homoskedasticity, and normal nature of returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;So are there any citations in the literature that describe portfolio construction procedures for &lt;em&gt;risk&lt;/em&gt; minimization using co-integration&lt;/strong&gt; (or a combination of cointegration and correlation)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found this paper - &lt;a href=&quot;http://www.icmacentre.ac.uk/pdf/cointegration.pdf&quot;&gt;Optimal Hedging Using Cointegration (1999)&lt;/a&gt; but it's more of an empirical case-study rather than a framework for thinking about risk thru the lens of cointegration.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-05-08T00:28:06.080" LastActivityDate="2018-06-21T14:38:40.200" Title="cointegration applied to Portfolio Construction &amp; Risk management" Tags="&lt;risk&gt;&lt;correlation&gt;&lt;portfolio-management&gt;&lt;cointegration&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="3452" PostTypeId="2" ParentId="3451" CreationDate="2012-05-07T20:37:11.340" Score="5" Body="&lt;p&gt;The following paper (Identifying Small Mean Reverting) is not directly related to portfolio risk minimization but it provides a method to build tradable mean reverting portfolios based on a multivariate co-integration approach. It has the advantages of providing a theoretical framework along with two algorithms. It also takes into account financial strict financial problems such as transactions costs.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cmap.polytechnique.fr/~aspremon/PDF/MeanRevVec.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.cmap.polytechnique.fr/~aspremon/PDF/MeanRevVec.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="155" LastActivityDate="2012-05-07T20:37:11.340" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3453" PostTypeId="2" ParentId="2975" CreationDate="2012-05-07T21:10:48.017" Score="3" Body="&lt;p&gt;Another possible approach is taking views a la Black-Litterman. There is a 2006 paper &quot;Incorporating Trading Strategies in the Black-Litterman Framework&quot; that discusses the methodology in more detail. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several practical issues that one should consider when implementing a momentum strategy with optimization. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I would pay careful attention to the time horizon of the optimization and the holding period of the momentum strategy. For instance, assume an optimization with a one-year time horizon, but with a momentum strategy that re-balances monthly. The Black-Litterman approach on an individual security basis would be more difficult in this case because your view isn't really over the whole one-year period. Rather it is only over the first month. The method that Alexey describes where one takes the momentum portfolio avoids this problem.&lt;/li&gt;&#xA;&lt;li&gt;The other model approach that Alexey describes is a model-based approach. There is a lot of latitude in what a model-based approach could consist of. I just want to note some practical issues with the Fama-Macbeth procedure as a modelling approach. This is a cross-sectional technique that is similar to constructing a momentum portfolio, but it also controls for other factors. This is not a problem if you want to calculate a momentum factor for 1000s of stocks, but it is more difficult if you want to calculate the returns to currency or asset class momentum since there are fewer entities to examine on a cross-sectional basis.&lt;/li&gt;&#xA;&lt;li&gt;It is also important to pay close attention to the trading costs in the optimization. For instance, if you allocate money to the momentum portfolio today, it means transaction costs today, but it also means transaction costs in the future. On the other hand, investments in the momentum portfolio may also be in the rest of the portfolio, so the overlap may help reduce trades. So it's not entirely clear to me what the best approach is to handle the transaction costs of a momentum portfolio, but I do know that you should pay close attention to it. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2012-05-07T21:10:48.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3454" PostTypeId="2" ParentId="3449" CreationDate="2012-05-08T08:27:30.637" Score="7" Body="&lt;p&gt;I would say&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Start with Black Scholes to look at accuracy. In particular, you have a closed formula and you know what the characteristic function for lognormal is. Running FFT and comparing FFT pricing with the closed formula will give you an idea of what are the convergence issues, what is the behaviour at the boundaries (extreme strikes) etcetera.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Then step forward to Heston with no correlation. In this case many people don't even bother with FFT but use Gauss-Legendre (or Gauss-Hermite or Gauss-Lobatto). Again, running FFT versus these alternative methods will teach you some lessons about convergence etcetera.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Finally try Heston with correlation and some simple Levy model like Variance Gamma for example and compare with a PDE implementation.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In my opinion a pricing algorithm is worth talking about only if it is superior to all the others. That's why if I look at an algorithm the first think I want to know is how it compares with the others, what are its limits and its strenghts.&lt;/p&gt;&#xA;" OwnerUserId="2149" LastActivityDate="2012-05-08T08:27:30.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3455" PostTypeId="2" ParentId="3329" CreationDate="2012-05-08T15:36:03.267" Score="2" Body="&lt;p&gt;Download the code from &lt;a href=&quot;http://fmsoption.codeplex.com&quot; rel=&quot;nofollow&quot;&gt;http://fmsoption.codeplex.com&lt;/a&gt; to see how to do that for vanilla options. You are right, you need implementations for transcendental functions that are written for dual numbers. You will find them in the fmsdual project.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you just want browse some source code, see &lt;a href=&quot;http://fmsoption.codeplex.com/SourceControl/changeset/view/10924#145366&quot; rel=&quot;nofollow&quot;&gt;http://fmsoption.codeplex.com/SourceControl/changeset/view/10924#145366&lt;/a&gt;. Note that &lt;code&gt;eps&lt;/code&gt; is machine epsilon ~= 2e-16. (!)&lt;/p&gt;&#xA;" OwnerUserId="2357" LastActivityDate="2012-05-08T15:36:03.267" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3456" PostTypeId="1" AcceptedAnswerId="3464" CreationDate="2012-05-08T15:42:19.717" Score="14" ViewCount="6882" Body="&lt;p&gt;I have been playing with mean reverting pairs, but seems that most of the low hanging fruit (ie pairs) have been squeezed already. I would like to start with mean reverting baskets (&gt;2 securities) in order to find unexplored, juicier strategies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please can you guide me recommending books, articles, etc., on how to build such mean reversing baskets?&lt;/p&gt;&#xA;" OwnerUserId="2257" LastEditorUserId="35" LastEditDate="2012-05-12T07:20:52.380" LastActivityDate="2015-01-20T02:33:08.940" Title="How to build a mean reverting basket?" Tags="&lt;mean-reversion&gt;&lt;pairs-trading&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="3458" PostTypeId="1" CreationDate="2012-05-08T16:03:01.890" Score="5" ViewCount="1018" Body="&lt;p&gt;In the standard MBA one-period binomial model, the value of an option is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$v = \frac{1}{R}\bigl(\frac{u - R}{u - d}V(sd) + \frac{R - d}{u - d}V(su)\bigr)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $R$ is the realized return over the period and the stock goes from $s$ down to $sd$ or up to $su$, where $d\lt R\lt u$, and $V$ is the option payoff. Note&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{dv}{ds} = \frac{1}{R}\bigl(\frac{u - R}{u - d}V&amp;#39;(sd)d + \frac{R - d}{u - d}V&amp;#39;(su)u\bigr)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is the &quot;delta&quot; hedge. Suppose $V$ is a call spread consisting of long a call struck at slightly higher than $sd$ and short a call struck slightly lower than $su$, then $V&amp;#39;(sd) = V&amp;#39;(su) = 0$, hence $dv/ds = 0$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wat?! How can that be???&lt;/p&gt;&#xA;" OwnerUserId="2357" LastEditorUserId="467" LastEditDate="2012-06-10T17:39:25.277" LastActivityDate="2013-03-13T12:39:16.410" Title="Is the binomial model wrong?" Tags="&lt;binomial-tree&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3459" PostTypeId="1" AcceptedAnswerId="3463" CreationDate="2012-05-08T16:03:10.800" Score="4" ViewCount="457" Body="&lt;p&gt;When I read about, say, some hedge fund wanting people with such-and-such Sharpe ratio, how is that ratio recorded and communicated to the interested party? I mean, do people just take it on faith that if I say my Sharpe ratio is X, is it so? Or is there some formal process where this can be recorded?&lt;/p&gt;&#xA;" OwnerUserId="1217" LastActivityDate="2012-05-08T21:33:19.330" Title="How is someone's Sharpe ratio recorded and communicated?" Tags="&lt;sharpe-ratio&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3460" PostTypeId="2" ParentId="3458" CreationDate="2012-05-08T16:14:22.663" Score="1" Body="&lt;p&gt;Binomial model is just a model, and a rather simplistic one. Think about it, anywhere you put the strikes of the call spread, provided that, as you did, they are between su and sd, you get the same value!&#xA;Also, to be fair to the binomial model, the delta hedge in the binomial model is not defined as the derivative of the value with respect to s, but rather as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(V(su)-V(sd))/(su-sd)&lt;/p&gt;&#xA;" OwnerUserId="2149" LastActivityDate="2012-05-08T16:14:22.663" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3461" PostTypeId="1" CreationDate="2012-05-08T16:19:45.693" Score="7" ViewCount="526" Body="&lt;p&gt;I am using ITCH protocol to get the Market Data information for Forex and trying to implement LOB on it and what i have noticed is that Bid and Ask prices are crossing very often.&#xA;Should that be happening in the normal circumstances for Forex trading? or Raw data from the ITCH data stream has to be filtered first manually?&lt;/p&gt;&#xA;" OwnerUserId="2369" LastActivityDate="2016-06-27T21:54:43.977" Title="Cross Bid and Ask prices for Forex trading" Tags="&lt;automated-trading&gt;&lt;research&gt;&lt;backtesting&gt;&lt;programming&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3462" PostTypeId="2" ParentId="3451" CreationDate="2012-05-08T16:39:11.493" Score="1" Body="&lt;p&gt;As far as your portfolio is a linear combination of instruments (for &lt;em&gt;non linear portfolios&lt;/em&gt;, this is more difficult to explain), the associated &lt;strong&gt;risk&lt;/strong&gt; you would like to monitor is the variation through time of this combination. You &lt;strong&gt;stress test&lt;/strong&gt; your portfolio when you measure its variations when the market conditions are &lt;em&gt;unexpected&lt;/em&gt; (in the sense that you can decide for instance to move a market factor) and measure its &lt;strong&gt;Value at Risk&lt;/strong&gt; when you estimate its value-level assciated to a given quantile given &lt;em&gt;usual conditions&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Usual market conditions&lt;/em&gt; are difficult to define, but it is often about &lt;strong&gt;stationarity&lt;/strong&gt; of the market context. If you identify a transformation of the market that is stationary, it is reasonnable to test the risk level of your portfolio for any realization of the market in this stationary state space.&#xA;It is there that you can find a link with cointegration. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mainly because when two variable are cointegrated, their combination is somehow &lt;em&gt;more stationary&lt;/em&gt; than each of them take alone. Of course links between stationarity and cointegration are in practice not easy to deal with (see for instance &lt;a href=&quot;http://homepage.univie.ac.at/robert.kunst/lausanne.pdf&quot; rel=&quot;nofollow&quot;&gt;Kunst, R. M., 2002. Testing for stationarity in a cointegrated system. Tech. rep., Institut für Höhere Studien (IHS)&lt;/a&gt;) but from a theoretical viewpoint it should be better to compute VaR using assumptions in a space in which no variable have remaining cointegrated relations.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2012-05-08T16:39:11.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3463" PostTypeId="2" ParentId="3459" CreationDate="2012-05-08T16:46:40.353" Score="3" Body="&lt;p&gt;The hedge fund will usually ask people to provide a time-series of their strategy's returns, preferable from live trading and preferably at a daily frequency.  Sometimes they will accept a mix of backtested and live results, so long as they are not too different from each other, both in theory and in practice.  Some funds break down their monthly returns by strategy, and people who have worked at such funds in the past can provide this information and indicate which strategy was their responsibility, but then it will be taken &quot;on faith&quot; that this person was, in fact, the primary person responsible for a given strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bottom line, I do not think there is any formal process for recording this information, and the standards of the potential employer/investor will vary widely.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2012-05-08T16:46:40.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3464" PostTypeId="2" ParentId="3456" CreationDate="2012-05-08T17:07:48.533" Score="12" Body="&lt;p&gt;There are multiple approaches that you could consider. The basic idea across all of them is that you want to find a portfolio that is stationary. In the two-asset case, it is well known how to accomplish this. This paper by Marcelo Perlin describes one approach:&#xA;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=952782&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=952782&lt;/a&gt;&#xA;but I am not particularly inclined to use this. Alternately, see Section 4 of this paper by Attilio Meucci:&#xA;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1404905&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1404905&lt;/a&gt;&#xA;which provides a more general framework. One way to think about it is that if you arrange the principal portfolios (through PCA) by variance, then the lowest variance ones would be more stationary than the highest variance ones. However, you have to offset the fact that since they have less variance, there is less opportunity to make profitable trades.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2012-05-08T17:07:48.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3465" PostTypeId="1" AcceptedAnswerId="3467" CreationDate="2012-05-08T17:09:17.913" Score="1" ViewCount="350" Body="&lt;p&gt;What are some good, preferably free, introductions to leveraged loans, also known as syndicated loans or bank loans? The introduction should describe the basic mechanics and &lt;em&gt;very importantly&lt;/em&gt; provide an understanding of the important attributes of these products and how they may be modeled.&lt;/p&gt;&#xA;" OwnerUserId="2407" LastEditorUserId="1106" LastEditDate="2012-05-17T17:27:35.757" LastActivityDate="2012-05-17T17:27:35.757" Title="Where to find introductory material on leveraged loans?" Tags="&lt;fixed-income&gt;&lt;reference-request&gt;&lt;floating-rate&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3466" PostTypeId="2" ParentId="3456" CreationDate="2012-05-08T17:10:13.960" Score="6" Body="&lt;p&gt;Pairs trading is just one type of &lt;a href=&quot;http://en.wikipedia.org/wiki/Statistical_arbitrage&quot; rel=&quot;nofollow&quot;&gt;statistical arbitrage&lt;/a&gt; (check out references on wikipedia page). It sounds like you are talking about trading &quot;&lt;a href=&quot;http://www.msci.com/products/portfolio_management_analytics/equity_models/&quot; rel=&quot;nofollow&quot;&gt;factors&lt;/a&gt;&quot; against each other. Factors could be industries, size, fundamentals, or purely &lt;a href=&quot;http://www.axioma.com/robust.htm&quot; rel=&quot;nofollow&quot;&gt;statistical&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Start with Ed Thorp's &lt;a href=&quot;http://www.edwardothorp.com/id9.html&quot; rel=&quot;nofollow&quot;&gt;Wilmott articles on statistical arbitrage&lt;/a&gt;.  Then read &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1404905&quot; rel=&quot;nofollow&quot;&gt;Attilio Meucci's Review&lt;/a&gt;.  An example stat arb strategy is studied by &lt;a href=&quot;http://math.nyu.edu/faculty/avellane/AvellanedaLeeStatArb20090616.pdf&quot; rel=&quot;nofollow&quot;&gt;Avellaneda and Lee&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="2892" LastEditDate="2015-01-20T02:33:08.940" LastActivityDate="2015-01-20T02:33:08.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3467" PostTypeId="2" ParentId="3465" CreationDate="2012-05-08T17:22:08.267" Score="4" Body="&lt;p&gt;Good leveraged loan tutorials are few and far between.  I've looked far and wide, and the best I ever found was a leveraged loan handbook published by citigroup (by William Deitrick) in 2006 which is free for clients.  Citi and Barclays also have two decent (but very different) bank loan models.  For Citi, search for Terry Benzschawel.  For Barclays, look in the &quot;Quantitative Credit Quarterly&quot; for 2011 Q3/Q4, an article on &quot;valuation and risk of floating-rate term loans with prepayment option and Libor floor&quot; by Claus Pedersen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are some links to other stuff I could find freely available on the web.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Start with &lt;a href=&quot;http://en.wikipedia.org/wiki/Syndicated_loan&quot; rel=&quot;nofollow&quot;&gt;wikipedia&lt;/a&gt; and links contained therein&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.docstoc.com/docs/112103064/The-U-S--Leveraged-Loan-Market--A-Primer&quot; rel=&quot;nofollow&quot;&gt;Milken Institute Primer&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.gulfstreammgmt.com/uploads/news/LoanMarketguide.pdf&quot; rel=&quot;nofollow&quot;&gt;S&amp;amp;P Guide to the Loan Market&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.lsta.org/&quot; rel=&quot;nofollow&quot;&gt;Loan Syndication and Trading Association&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2012-05-08T17:22:08.267" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3468" PostTypeId="2" ParentId="3459" CreationDate="2012-05-08T21:05:39.347" Score="5" Body="&lt;p&gt;The &lt;a href=&quot;http://gipsstandards.org/&quot;&gt;GIPS standards&lt;/a&gt; are increasingly used for presenting investment returns in a standardized fashion across equities, real estate, private equity, fixed income and other asset classes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The GIPS standards rely on, among other things, chain-linking time-weighted returns and they require specific disclosures including carve-outs, net or gross performance, treatment of discretionary accounts, and definitions of composites and benchmarks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no specific guidance on Sharpe ratio which is a shame since the ratio can be gamed by trading illiquid (serially correlated assets), by extending the measurement horizon, or engaging in a return swap where you pay out both the best and worst performing months to a dealer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, by presenting the returns in a GIPS compliant fashion an investor can evaluate against performance metrics of their choosing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A firm can also verify GIPS compliance by an independent third party.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-05-08T21:33:19.330" LastActivityDate="2012-05-08T21:33:19.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3471" PostTypeId="1" CreationDate="2012-05-09T12:20:53.760" Score="7" ViewCount="414" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Possible Duplicate:&lt;/strong&gt;&lt;br&gt;&#xA;  &lt;a href=&quot;https://quant.stackexchange.com/questions/1172/looking-for-a-recommendation-for-a-real-life-volatily-trading-book&quot;&gt;Looking for a recommendation for a real life volatily trading book.&lt;/a&gt;  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&#xA;&#xA;&lt;p&gt;I recently came in contact with a quant desk that traded volatility. The discussion only highlited my lack of knowledge on the subject. I have not been able to find good references on the web. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for information on the markets for listed options and tutorials, articles, books on the publicly known methods used to trade options (both market making an statistical arbitrage).   &lt;/p&gt;&#xA;" OwnerUserId="155" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2012-05-09T13:15:45.037" Title="Reference on Electronic volatility trading" Tags="&lt;option-pricing&gt;&lt;volatility&gt;&lt;market-making&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2012-05-16T14:37:55.553" ContentLicense="CC BY-SA 3.0" />
  <row Id="3472" PostTypeId="2" ParentId="3471" CreationDate="2012-05-09T13:15:45.037" Score="7" Body="&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470181990&quot;&gt;Volatility Trading&lt;/a&gt; by Euan Sinclair is a good book to get you started.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2012-05-09T13:15:45.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3473" PostTypeId="2" ParentId="3461" CreationDate="2012-05-09T16:35:47.283" Score="3" Body="&lt;p&gt;Where are you sourcing your data from? In the equities markets you will see crossed/locked markets at the NBBO if consuming direct feeds from each venue. You typically will not see it at a specific venue, however there are circumstances where you will (for example, NYSE pre-open or during LRP, etc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For FOREX I'd assume crossed/locked markets would be significantly more common since there is no central exchange or book, but rather a collection of books and market makers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an aside you reference &quot;ITCH&quot; so I presume you're taking data from some FOREX broker who's using ITCH to broadcast book changes. When referring to ITCH 99.99% of the people in the world assume you mean NASDAQ markets.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2012-05-09T16:35:47.283" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3474" PostTypeId="2" ParentId="3448" CreationDate="2012-05-09T19:21:39.753" Score="5" Body="&lt;p&gt;When you decide if the performance improvement is worth it you can add these to the downside ow using single precision:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;the result of your basic B-S pricer will eventually need to be multiplied with a notional and maybe a discount factor; For a sufficiently large notional you will see different results than the one calculated using double precision. Is that kind of a notional likely to occur in practice in your system?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;numerical stability. The straight-forward implementation of many algorithms (Newton-Raphson and probably Levenberg-Marquardt) may be unstable under the reduced precision of a single. Stable versions are slower and add complexity.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;validation. Many people use Excel or other similar software to quickly test the final results of a complex calculation. Due to the difference in precision between that and your software the results will not match, leading to head-scratching and an impossibility of validating your results. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2412" LastActivityDate="2012-05-09T19:21:39.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3475" PostTypeId="1" AcceptedAnswerId="3483" CreationDate="2012-05-09T21:50:17.497" Score="11" ViewCount="1443" Body="&lt;p&gt;Assume you want to create a security which replicates the implied volatility of the market, that is when $\sigma$ goes up, the value of the security $X$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The method you could use is to buy call options on that market for an amount $C$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know that call options have a positive vega $\nu = \frac{\partial C}{\partial \sigma}= S \Phi(d_1)\sqrt{\tau} &amp;gt; 0$, so if the portfolio was made of the call $X=C$, then the effect of $\sigma$ on the security is as we desired.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, there is of course a major issue: the security $X$ would also have embedded security risk, time risk and interest rate risk. You can use the &lt;a href=&quot;http://en.wikipedia.org/wiki/Greeks_%28finance%29&quot;&gt;greeks&lt;/a&gt; to hedge against $\Delta$, $\Theta$ and $\rho$ (which are the derivative of the call option &#xA;respective to each source of risk).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, I think you definitely need $X$ to be  $\Theta$-neutral and $\Delta$-neutral, but would you also hedge against $\rho$ or other greeks? Have the effect of these variable been really important on option prices to make a significant impact, or would the cost of hedging be too high for the potential benefit?&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2014-03-13T06:37:40.200" Title="Which greeks do you need to hedge if you want to implement an implied-volatility security?" Tags="&lt;greeks&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3476" PostTypeId="2" ParentId="527" CreationDate="2012-05-10T02:16:21.867" Score="6" Body="&lt;p&gt;There are all sorts of financial and non-financial risks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I define financial risk as all risks defined from events in the financial markets that affect all participants. Non-financial risks are all other forms of risk (including risks that a particular firm may face).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Financial:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Market value risk (interest rate risk, exchange prices, equity prices, commodity prices, etc.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Credit risk (downgrade, default, credit spread risk)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Liquidity risk &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Non-Financial:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Model Risk&lt;/li&gt;&#xA;&lt;li&gt;Operational Risk (fraud, misconduct, failure of internal controls or audit systems, natural disasters)&lt;/li&gt;&#xA;&lt;li&gt;Settlement risk&lt;/li&gt;&#xA;&lt;li&gt;Accounting risk (changes in GAAP/IFRS and comparability issues, managed earnings, etc.)&lt;/li&gt;&#xA;&lt;li&gt;Regulatory risk&lt;/li&gt;&#xA;&lt;li&gt;Legal risk (counterparty does not honor a contract)&lt;/li&gt;&#xA;&lt;li&gt;Tax risk&lt;/li&gt;&#xA;&lt;li&gt;Sovereign risk (if you are trading EM debt for example) &amp;amp; Political risk&lt;/li&gt;&#xA;&lt;li&gt;Performance netting risk&lt;/li&gt;&#xA;&lt;li&gt;Key Man risk&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-05-14T15:29:37.723" LastActivityDate="2012-05-14T15:29:37.723" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3477" PostTypeId="1" CreationDate="2012-05-10T07:48:14.157" Score="5" ViewCount="6293" Body="&lt;p&gt;Any idea how to estimate GJR-GARCH models in R? Is there any particular library like fGarch that supports such models?&lt;/p&gt;&#xA;" OwnerUserId="926" LastEditorUserId="35" LastEditDate="2012-05-10T15:59:24.873" LastActivityDate="2017-09-05T00:58:39.043" Title="GJR-GARCH Model In R" Tags="&lt;volatility&gt;&lt;trading&gt;&lt;programming&gt;&lt;r&gt;&lt;garch&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3478" PostTypeId="2" ParentId="3477" CreationDate="2012-05-10T13:30:39.467" Score="4" Body="&lt;p&gt;CRAN has a few:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://cran.rproject.org/web/packages/bayesGARCH/index.html&quot; rel=&quot;nofollow&quot;&gt;bayesGARCH&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://cran.rproject.org/web/packages/gogarch/index.html&quot; rel=&quot;nofollow&quot;&gt;gogarch&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://cran.rproject.org/web/packages/ccgarch/index.html&quot; rel=&quot;nofollow&quot;&gt;ccgarch&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1386" LastEditorUserId="848" LastEditDate="2012-05-10T14:06:05.130" LastActivityDate="2012-05-10T14:06:05.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3480" PostTypeId="2" ParentId="3421" CreationDate="2012-05-10T15:15:18.237" Score="7" Body="&lt;p&gt;There is experimental code available under &#xA;&lt;a href=&quot;https://sourceforge.net/tracker/?func=detail&amp;amp;atid=312740&amp;amp;aid=3413982&amp;amp;group_id=12740&quot; rel=&quot;noreferrer&quot;&gt;https://sourceforge.net/tracker/?func=detail&amp;amp;atid=312740&amp;amp;aid=3413982&amp;amp;group_id=12740&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically I tried to answer the question if you should do the riskfactor shifts on the level of the pricing engine or on the level of the market data. For me the answer is that one has to do it on the level of the market data. The code implements the shift on the level of the pricing engine. Its very experimental. Nevertheless I've checked the results with the output of some commerical software and found agreement. So it might be a starting point. &lt;/p&gt;&#xA;" OwnerUserId="2415" LastEditorUserId="1418" LastEditDate="2012-08-14T18:29:14.177" LastActivityDate="2012-08-14T18:29:14.177" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3481" PostTypeId="2" ParentId="3477" CreationDate="2012-05-10T15:22:48.137" Score="8" Body="&lt;p&gt;You can have a look at &lt;code&gt;rgarch&lt;/code&gt;. It's quite versatile. From what I remember, you have to get it explicitly from R-Forge, as it's not available from CRAN.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the &lt;a href=&quot;http://rgarch.r-forge.r-project.org/index.html&quot;&gt;rgarch website&lt;/a&gt; for more details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Last time I checked, usage was something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;spec.gjrGARCH = ugarchspec(variance.model=list(model=&quot;gjrGARCH&quot;, garchOrder=c(1,1)), mean.model=list(armaOrder=c(1,1), include.mean=TRUE), distribution.model=&quot;std&quot;)&#xA;gjrGARCH &amp;lt;- ugarchfit(data, spec=spec.gjrGARCH)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From what I see, it has been recently split into uni- and multivariate packages, so you would need to verify the syntax and install &lt;code&gt;rugarch&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="38" LastEditorUserId="38" LastEditDate="2012-05-10T16:39:22.650" LastActivityDate="2012-05-10T16:39:22.650" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3482" PostTypeId="1" AcceptedAnswerId="3501" CreationDate="2012-05-11T20:49:03.290" Score="7" ViewCount="506" Body="&lt;p&gt;I have some implementations of interest rate lattice models. I would like to verify their performance. What would be the best approaches?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I compare pricings of some interest rate dependent derivatives, but is there anything more direct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm more interested in accuracy and possibly hedging performance.&lt;/p&gt;&#xA;" OwnerUserId="188" LastEditorUserId="188" LastEditDate="2012-05-14T13:14:41.837" LastActivityDate="2012-05-15T17:08:54.530" Title="What's the best way to test/validate an interest rate lattice model" Tags="&lt;interest-rates&gt;&lt;risk-management&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3483" PostTypeId="2" ParentId="3475" CreationDate="2012-05-11T23:22:27.447" Score="5" Body="&lt;p&gt;For non-interest rate derivatives with not-so-long maturities worrying about rho is uncommon. Think about it: interest-rates do not change that often relative to options expiring next week, next month or at most next year. LEAPS are obviously another turf. You could think about gamma, but the intimate relation of gamma and vega (at least in BS model) makes hedging difficult from a standard model point of view.&lt;/p&gt;&#xA;" OwnerUserId="2284" LastActivityDate="2012-05-11T23:22:27.447" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3484" PostTypeId="1" AcceptedAnswerId="3568" CreationDate="2012-05-12T08:15:39.613" Score="12" ViewCount="1529" Body="&lt;p&gt;Is there a case, where due to illiquidity, exercising out-of-the-money options could be better than directly buying the stock?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When a stock is too illiquid, there are some costs because of this illiquidity. Ie, directly buying the stock through a market order could move the price too much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, if you exercise options that are out-of-the-money, you won't move the market and won't pay the cost due to the illiquidity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;There is a stock XYZ whose market price is \$10.00.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;You have 100 call options with a strike of \$10.08. (Assume they are very close&#xA;  to maturity, so that the premium is worth nothing or nearly nothing).&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If stock XYZ is too illiquid, buying 10,000 shares could move&#xA;  the market and you can end up buying it at an average price of \$10.15.&#xA;  In that case, exercising the option would have given you a better&#xA;  price, even thought they were out-of-the-money.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Is such a case possible? If so, exercising options that are out-of-the-money can be worth it, right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or am I missing something and my example is not possible (because there would be an arbitrage opportunity for example)?&lt;/p&gt;&#xA;" OwnerUserId="2160" LastEditorUserId="35" LastEditDate="2012-05-12T12:23:19.773" LastActivityDate="2012-06-01T13:40:30.083" Title="Is it ever possible that---because of illiquidity---exercising an out-of-the-money option is better than directly buying the stock?" Tags="&lt;options&gt;&lt;liquidity&gt;" AnswerCount="5" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3485" PostTypeId="2" ParentId="3484" CreationDate="2012-05-12T12:22:52.317" Score="4" Body="&lt;p&gt;That's an interesting question, and I believe your example does indeed show that the answer is &quot;yes&quot;. However, just because you paid a lower average price doesn't mean that there isn't market impact, especially if the writer of the option was &lt;em&gt;naked&lt;/em&gt; (didn't have the stock already and had to buy it himself on the open market). It's just that the holder of the option is the one not paying the transaction costs for that impact.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm also inclined to believe that if enough smart arbitrageurs notice the liquidity effect, they could bid-up the option's premium even if the contract is near expiration. That arbitrage would work in your favor, of course.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2012-05-12T12:22:52.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3486" PostTypeId="1" CreationDate="2012-05-13T18:43:29.343" Score="26" ViewCount="60459" Body="&lt;p&gt;I have seen the rationale behind why it is never optimal to exercise an American call option early, but have a question about it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the option strike price is $E=\$20$ and it expires at $T=1yr$, if the share price is $S=\$25$ at expiry, the profit will be $\$5$ per share.  However, what if at $T=0.5yr$ the share price was $S=\$40$ following a jump in the price. Exercising at this point would yield a profit of $\$20$ per share.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would it not be more optimal to exercise early, in this case?&lt;/p&gt;&#xA;" OwnerUserId="2286" LastActivityDate="2020-07-07T20:36:25.090" Title="Exercising an American call option early" Tags="&lt;american-options&gt;" AnswerCount="11" CommentCount="3" FavoriteCount="21" ContentLicense="CC BY-SA 3.0" />
  <row Id="3487" PostTypeId="2" ParentId="3486" CreationDate="2012-05-13T19:29:03.677" Score="15" Body="&lt;p&gt;If you think the stock is going to continue going up, just wait. If you think the stock has reached its peak, then short it in the open market. If the shorted stock continues to climb, you can always cover with your call option. If however the stock falls &lt;em&gt;below&lt;/em&gt; your strike price, then let the option expire and cover at the market price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's this very ability to choose the buying price (strike vs market) when covering a short sale that makes the option valuable. But of course, you can do the same thing with a European option! That's why the American option gives you no added value over the European option. There is no benefit to exercising an American call option early.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2012-05-13T19:29:03.677" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="3488" PostTypeId="2" ParentId="3486" CreationDate="2012-05-13T19:33:37.970" Score="4" Body="&lt;p&gt;Because if you sell, you will get a higher value than 20USD per share. You can think of the reason behind this added value is that having a deep ITM option is better than having a stock: your downside is limited. Therefore your option is worth more on the market than it's exercise value. This is why you are better off by selling it in your case (if you know that the price will drop to 25USD).&lt;/p&gt;&#xA;" OwnerUserId="370" LastEditorUserId="35" LastEditDate="2013-09-30T02:05:14.343" LastActivityDate="2013-09-30T02:05:14.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3489" PostTypeId="2" ParentId="3486" CreationDate="2012-05-14T03:26:06.043" Score="4" Body="&lt;p&gt;If you can &lt;strong&gt;&lt;em&gt;dynamically hedge&lt;/em&gt;&lt;/strong&gt; then you can monetize the value of your option without prematurely exercising it.  Before writing about Randomness and Black Swans, Taleb wrote a &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0471152803&quot; rel=&quot;nofollow&quot;&gt;book&lt;/a&gt; on the topic.  The short version of the story is find the DV01 of your position, and take an opposite position with the same DV01.  (&amp;amp; if you want, line up the rest of the greeks)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you can't dynamically hedge for whatever reason, then the &quot;Don't exercise early&quot; rule is not so black and white.  For example, executives have shorting restrictions on their companies.  In these cases, they may be restricted to exercising options early rather than dynamically hedging.&lt;/p&gt;&#xA;" OwnerUserId="1968" LastActivityDate="2012-05-14T03:26:06.043" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3491" PostTypeId="2" ParentId="3484" CreationDate="2012-05-14T14:17:24.343" Score="3" Body="&lt;p&gt;Whether or not to exercise an option when the underlying is near the money can be a very complicated problem that depends on much more than simply whether or not the underlying is just over or under the strike price.  Options traders refer to this as pinning, which tends to happen much more often than you might expect if stock price movements were truly random.  If you are interested in pinning, and particularly in the &quot;pin risk&quot; that a short options trader faces, I suggest you read Chapter 12 of &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470497106&quot; rel=&quot;nofollow&quot;&gt;Euan Sinclair's Option Trading&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, suppose one owns call options and actually wishes to be fully hedged against directional movements.  On the days prior to expiration, if the underlying is trading near the money, the holder would be short about half the shares represented by the option.  Then if in the minutes or hours leading up to the closing the underlying is trading below the strike, the holder may choose to cover the short and personally commit to not exercise the option.  If later on the underlying rises above the strike, but the commissions and market impact from reversing the trade (shorting the shares again) would likely push the underlying back below the strike, the holder may choose to &quot;sub-optimally&quot; not exercise an option that is in the money.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2012-05-14T14:17:24.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3492" PostTypeId="1" AcceptedAnswerId="3493" CreationDate="2012-05-14T17:20:22.930" Score="9" ViewCount="542" Body="&lt;p&gt;Consider a Markov Regime-switching process $X_{t}$ with $k$ regimes represented by $s_{t}$ such that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X_{t}=\mu\left(s_{t}\right)+\epsilon_{t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\epsilon_{t}\sim N\left(0,\sigma^{2}\left(s_{t}\right)\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with the probability of being in state $s_{t}$ represented by $p_{t}=Qp_{t-1}$ where $p_{t}$ is a $k \cdot 1$ vector containing the probabilities and &lt;strong&gt;Q&lt;/strong&gt; is a transition matrix conforming based on the number of regimes.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each state separately would be considered i.i.d. normal, but the regime-switching process exhibits autocorrelation. Is it possible to derive a closed-form solution for the partial autocorrelation function of $X_{t}$? If so, what is it?&lt;/p&gt;&#xA;" OwnerUserId="2379" LastEditorUserId="1106" LastEditDate="2012-05-16T14:28:58.047" LastActivityDate="2012-05-16T14:28:58.047" Title="Is there a closed-form solution for the partial autocorrelation function of a Markov regime-switching process?" Tags="&lt;stochastic-processes&gt;&lt;auto-correlation&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3493" PostTypeId="2" ParentId="3492" CreationDate="2012-05-14T20:42:48.270" Score="5" Body="&lt;p&gt;Apparently yes, (I haven't verified the math but have no reason to doubt it).&#xA;For this simple case you can find a closed form in the following paper: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.ee.washington.edu/techsite/papers/documents/UWEETR-2002-0003.pdf&quot;&gt;Jeff A. BILMES: What HMM can do&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The closed form is given on part 4.4 of the paper but the whole thing is worth reading as it clearly shows the main properties of these models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also note that contrary to your definition the observations in each state don't need to be IID (you an have other structures such as ARMA). The book by Kim and Nelson (State-Space Models with Regime-Switching) provides a lot of information on this class of models. &lt;/p&gt;&#xA;" OwnerUserId="155" LastEditorUserId="848" LastEditDate="2012-05-14T21:07:18.093" LastActivityDate="2012-05-14T21:07:18.093" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3494" PostTypeId="2" ParentId="3323" CreationDate="2012-05-14T21:24:02.033" Score="4" Body="&lt;p&gt;Let $P(t,T)$ be the time-$t$ price of the zero-coupon bond expiring at $T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The no-arbitrage condition forces:&#xA;$$e^{-\int_0^tr_sds}P(t,T)=\mathbb{E}[e^{-\int_0^Tr_sds}|\mathcal{F_t}],$$ where $\mathcal{F_t}$ is the filtration of the Brownian motion up to time $t$. Note that the expression on the right is a martingale by the tower property of expectations, so by the First Theorem of Asset pricing, there is no arbitrage.&#xA;It immediately follows that&#xA;$$P(t,T)=\mathbb{E}[e^{-\int_t^Tr_sds}],$$&#xA;which will further result in the yield curve specified as above (with $V_t$ term). Therefore neglecting the covariance term &lt;em&gt;could&lt;/em&gt; result in arbitrage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, I was told that there is a proof showing it is not indeed arbitrage-free, but I am not going to go into that.&lt;/p&gt;&#xA;" OwnerUserId="2101" LastEditorUserId="2101" LastEditDate="2012-05-14T21:37:30.723" LastActivityDate="2012-05-14T21:37:30.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3496" PostTypeId="2" ParentId="3323" CreationDate="2012-05-15T04:35:44.717" Score="8" Body="&lt;p&gt;The original &lt;a href=&quot;http://www.math.ku.dk/~rolf/teaching/NelsonSiegel.pdf&quot;&gt;Nelson Siegel paper&lt;/a&gt; describes a parsimonious model of the term structure using only four or three (if $\lambda_t$ is fixed). &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/1467-9965.00073/abstract&quot;&gt;Filipovic (1999)&lt;/a&gt; proves that this model can never be used in a arbitrage free context, paraphrasing the abstract:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We introduce the class of &lt;em&gt;consistent state space processes&lt;/em&gt;, which&#xA;    have the property to provide an arbitrage-free interest rate model&#xA;    when representing the parameters of the Nelson–Siegel (NS)&#xA;    family. (We show that) there exists no nontrivial interest rate&#xA;    model driven by a consistent state space Itō process.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This problem is solved by &lt;a href=&quot;http://www.frbsf.org/publications/economics/papers/2007/wp07-20bk.pdf&quot;&gt;Christensen et al. (2009)&lt;/a&gt;. They provide some ODE's which must hold for an AFNS and write that the &quot;key difference between Dynamic NS and AFNS is the maturity dependent &lt;em&gt;yield-adjustment&lt;/em&gt; term&quot; and show how to solve for this term.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They show that the yield adjustment term is empirically small and that their model &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;fares well in out-of-sample prediction, consistently outperforming, for example, the canonical $A_0(3)$ model (of &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.194.7118&amp;amp;rep=rep1&amp;amp;type=pdf&quot;&gt;Duffee 2002&lt;/a&gt;).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="848" LastActivityDate="2012-05-15T04:35:44.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3499" PostTypeId="2" ParentId="3484" CreationDate="2012-05-15T07:25:51.693" Score="1" Body="&lt;p&gt;It definelys happens and it strongly depends on the underlying market.&lt;br&gt;&#xA;In Europe the closing prices are created in an auction and in this process you might end up with partial fills (as you do not see bid/ask quantities, just crossed/uncrossed).&lt;/p&gt;&#xA;" OwnerUserId="1221" LastActivityDate="2012-05-15T07:25:51.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3501" PostTypeId="2" ParentId="3482" CreationDate="2012-05-15T17:08:54.530" Score="6" Body="&lt;p&gt;OK, so you need to validate a one factor model with mean reversion, here are the questions I would ask myself&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For calibration&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the model capable of calibrating to both coterminals and caplets? If not how do I intend to calibrate it when pricing Callable Cap Floaters?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the model capable of calibrating to skew? If not how do I intend to calibrate it when pricing Callable Range Accruals and Collars?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I going to price zero coupon swaptions? What kind of calibration am I going to use?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I going to calibrate mean reversion? If so how? If not what number do I use?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the calibration stable? I would try running through the end of 2008 and see how many failures I get.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For pricing&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the integration routine accurate? I would try pricing structures with OTM strikes and see when it breaks down. In particular, can I achieve convergence with a reasonable CPU time? Changing integration parameters (grid spacing, time steps) should give me an idea of the issues.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Connected to previous) What is the implied distribution of Libor rates? Does it have fat tails? If so, does the integration routine cover a sufficient range (number of standard deviations).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the calibration appropriate? I would try calibrating an OTM bermudan to both ATM coterminals and at the strike coterminals. Do I get different prices? Why? What is the appropriate strike to be used? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What kind of forward vols/skews does the model imply? Does it make sense?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For greeks&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are the greeks stable? Again, I would try backtesting the model through turbulent periods. And again, I would try changing the integration parameters and see if I get oscillations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does the integration routine cope with disontinuities in the payoff? Is anything sophisticated used for avoiding spurious oscillations? Here is a paper with a standard technique used for eliminating noise&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.risk.net/data/risk/pdf/technical/risk_1106_Wackertapp.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.risk.net/data/risk/pdf/technical/risk_1106_Wackertapp.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is anything like this employed in the integration routine?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I intend to calculate greeks? Am I planning to use model greeks or smile greeks (i.e. adjusted for movements in the vol surface) ? Which ones are better? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not being a model validator myself I must have missed some important points. For what concerns the hedging performance, I've spent some time in the past implementing a backesting framework for one factor interest rate models and I think that's the only way to check hedging performance. Plus it allows you to find answers to a lot of the questions above. Beware however, it takes a lot of time and effort to implement one.&lt;/p&gt;&#xA;" OwnerUserId="2149" LastActivityDate="2012-05-15T17:08:54.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3504" PostTypeId="2" ParentId="141" CreationDate="2012-05-16T09:51:41.003" Score="11" Body="&lt;p&gt;Somewhat more economic data can be found at e.g.:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://data.worldbank.org/&quot;&gt;The World Bank&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://data.un.org/&quot;&gt;The United Nations&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.oecd-ilibrary.org/statistics&quot;&gt;The OECD&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;More financial:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.imf.org/external/data.htm&quot;&gt;The IMF&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;European Union / EFTA / EMU data:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://epp.eurostat.ec.europa.eu/portal/page/portal/statistics/themes&quot;&gt;Eurostat&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.ecb.int/stats/html/index.en.html&quot;&gt;European Central Bank (financial)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Data from these sources is all freely available. You can also play with data from many of these sources using the &lt;a href=&quot;http://www.google.com/publicdata/directory&quot;&gt;Google Public Data Explorer&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2437" LastActivityDate="2012-05-16T09:51:41.003" CommentCount="0" CommunityOwnedDate="2012-05-16T09:51:41.003" ContentLicense="CC BY-SA 3.0" />
  <row Id="3507" PostTypeId="1" AcceptedAnswerId="3509" CreationDate="2012-05-18T08:26:46.013" Score="12" ViewCount="7316" Body="&lt;p&gt;I am really having a terrible time applying Girsanov's theorem to go from the real-world measure $P$ to the risk-neutral measure $Q$. I want to determine the payoff of a derivative based an asset which is paying dividends, so the dividends will affect the value of the asset by changing the drift negatively, but aren't considered when calculating the payoff because it's just derived from the asset prices over time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We begin in the real-world measure $P$. We are interested in some index, $S_t$, which I believe we can just treat as a single entity like a stock and which we can observe in the real world. It has volatility $\sigma$. We also know that this index is paying dividends continuously at a rate of $\delta$. The index is described as &quot;following a geometric Brownian motion&quot;, which to me says that the there is no other drift going on, so I take $\mu$ to be $0 - \delta$. First question: Is it normal to assume no other drift?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dSt = (-\delta) St dt + \sigma St dWt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $dWt$ are standard Wiener increments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So clearly under $P$, our index asset has drift $-\delta$ because it is paying dividends out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If someone actually holds the asset then they can reinvest those dividends, but we are only concerned with the value of the asset in order to determine the payoff of a derivative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what we want to do now is determine the expected value of the asset under the risk neutral measure, $Q$. We want this expected value, discounted by the value of a bond earning the risk free rate, to be a martingale in this measure, so the asset must also drift at the risk free rate. In this way, an asset under the risk neutral measure with volatility 0 is equivalent to a bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to achieve this, we want to change the drift of our process from $-\delta$ under $P$ to $r$ under $Q$. We define a new process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_t = \theta t + W_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\theta = \frac{(-\delta - r)}{\sigma}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we now consider the discounted asset price $S_t^* = S_t / Bt = S_t e^{-rt}$ we have the following.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dSt^* = (-\delta - r) St^* dt + \sigma St^* dWt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dSt^* = (-\delta - r) St^* dt + \sigma St^* (X_t - \theta)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dSt^* = (-\delta - r) St^* dt + \sigma St^* (X_t - \frac{-\delta - r}{\sigma})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dSt^* = \sigma St^* X_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where now we have the process $St^*$ as a geometric Brownian with no drift if we are under $Q$ and with the same drift as before under $P$. All we have done was put $(X_t-\theta)$ in for $W_t$ and these are equal by definition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So under $Q$, and without discounting, the process for the asset $S_t$ should follow&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dSt = r St dt + \sigma St dXt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The dividend being payed by the asset is thus somehow 'inside' the brownian motion $X_t$ and that's apparently all we see of it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At this point, I'd like to stop and ask &quot;at what point do we consider ourselves 'under $Q$'?&quot;. By google-fu, I found an example program in R where they make a binomial approximation to Brownian motion by taking constant size steps up or down with different propbabilities. The relevant portion of code looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;n = 2000&#xA;t = (0:n)/n  # [0/n, 1/n, .... n/n]&#xA;dt = 1/n&#xA;theta = 1&#xA;p = 0.5 * (1 - sqrt(dt) * theta)&#xA;&#xA;u = runif(n)  # Random uniform variates&#xA;dWP = ((u &amp;lt; .5) - (u &amp;gt; .5))*sqrt(dt)    # increments under P&#xA;dWQ = ((u &amp;lt; p) - (u &amp;gt; p))*sqrt(dt)      # increments under Q&#xA;&#xA;WP[1:n+1] = cumsum(dWP)&#xA;WQ[1:n+1] = cumsum(dWQ)&#xA;XP = WP + theta*t      # Theta exactly offsets the change in measure&#xA;XQ = WQ + theta*t      # Now XQ == WP&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I see that they are using $p$ instead of 0.5 to make decisions about the sign in the binary discretization, but if we have access to actual random normal variates is this necessary? Shouldn't it be a enough to simply define $\theta$ appropriately as above and then use it and $W_t$ to derive $X_t$, directly? Although, if we do that, then we go from $W$ to $X$ but I don't understand how we got from $P$, to $Q$ if that happened at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The payoff of our asset then, is the discounted expectation under the risk-neutral measure. So we evolve the process $S_t$ under measure $Q$ until expiry time T, calculate the payoff. Repeat this a few thousand times and then take the average and discount it back to $t = 0$ to get the price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought all of this seemed pretty reasonable and was making sense, but when I try to implement it, I get nothing like what I expect. Can anyone confirm that the story I just presented about how we arrive at the risk neutral measure is correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A more general question: $W_t$ is a martingale under $P$. We shift it and change measures to create $X_t$ and have &lt;em&gt;that&lt;/em&gt; be a martingale under $Q$. We then model the asset based on the process $X_t$ with drift r. If all we wanted was a process under which the stock drifts at the risk free rate, what do we gain by changing from $W$ to $X$ and $P$ to $Q$ if they exactly offset each other? Why don't we just use $W_t$? And what happened to the dividend?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the stock process is drifting downward at $-\delta dt$ under $P$, what does it really look like under $Q$? It can't just look like it's drifting at the risk-free-rate because then the dividend would have had no effect at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Further search produced some suggestions that it should be drifting at $r-\delta$, because we assume that the dividends are invested into bonds. Why would we make such an assumption? Is it because we want to consider a &lt;em&gt;portfolio&lt;/em&gt; containing the asset and not the asset itself?&lt;/p&gt;&#xA;" OwnerUserId="2440" LastEditorUserId="2440" LastEditDate="2012-05-18T09:35:32.543" LastActivityDate="2019-05-25T14:42:21.360" Title="How does one go from measure P to Q(risk-neutral) when modeling an asset paying dividends?" Tags="&lt;option-pricing&gt;&lt;stochastic-calculus&gt;&lt;stochastic-processes&gt;&lt;mathematics&gt;&lt;risk-neutral-measure&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3508" PostTypeId="1" CreationDate="2012-05-18T10:49:56.283" Score="7" ViewCount="419" Body="&lt;p&gt;Correlation measures how much two series move together over a fixed interval. Are there any techniques that measure co-movement over a variable time frame? One technique I am aware of is concordance.&lt;/p&gt;&#xA;" OwnerUserId="2448" LastActivityDate="2012-05-18T22:08:51.877" Title="Measuring co-movement at non-constant intervals" Tags="&lt;correlation&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3509" PostTypeId="2" ParentId="3507" CreationDate="2012-05-18T12:22:08.753" Score="3" Body="&lt;p&gt;ad) &quot;Is it normal to assume no other drift?&quot;&#xA;Under measure P you might have drift. You could use it as a working assumption, but in general indices drift every now and then. So, no, usually you do not assume away the drift.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;The index is described as &quot;following a geometric Brownian motion&quot;, which to me says that the there is no other drift going on&quot; &lt;a href=&quot;http://en.wikipedia.org/wiki/Geometric_Brownian_motion&quot; rel=&quot;nofollow&quot;&gt;geometric Brownian motion&lt;/a&gt;: S follows a gBm if it satisfies the well-known dS/S SDE, drift non-zero, contrary to your deduction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ad) &quot;at what point do we consider ourselves 'under Q '?&quot;.&#xA;Q is the &lt;a href=&quot;http://en.wikipedia.org/wiki/Risk-neutral_measure&quot; rel=&quot;nofollow&quot;&gt;risk-neutral measure&lt;/a&gt;: when you insert your X-expression for W, you switch to drift r and to Q. Btw, see the link for getting notation and derivation right.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ad) &quot;If the stock process is drifting downward at −δdt  under P , what does it really look like under Q ?&quot; Insert mu=mu*-delta in &lt;a href=&quot;http://en.wikipedia.org/wiki/Risk-neutral_measure#Example_2_.E2.80.94_Brownian_motion_model_of_stock_prices&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. This yields drift coefficient (r+delta)S_t under X.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ad) &quot;because we assume that the dividends are invested into bonds.&quot; Here the dividend is an average yield over the holding period. You reinvest it in the underlying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ad) &quot;I thought all of this seemed pretty reasonable and was making sense&quot;: Sounds good.&lt;/p&gt;&#xA;" OwnerUserId="2284" LastActivityDate="2012-05-18T12:22:08.753" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="3510" PostTypeId="2" ParentId="1241" CreationDate="2012-05-18T13:21:09.967" Score="2" Body="&lt;p&gt;There is a brief discussion of the two modelling frameworks in &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/190634809X&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;An Introduction to Economic Capital&lt;/em&gt;&lt;/a&gt; by Mohan Bhatia in the &quot;Insurance Risk&quot; chapter.  To pull a quote from the &quot;Solvency II versus Basel II&quot; section of that chapter:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Like the regulatory approach to internal models in Basel II, Solvency&#xA;  II aims to bring the internal modelling approaches within the&#xA;  regulatory framework by adopting the following best practices:&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;consistency in models being used for pricing and capital computation;&lt;/li&gt;&#xA;  &lt;li&gt;coverage of risks—all material risks to be captured, more granular assessment of risks; and&lt;/li&gt;&#xA;  &lt;li&gt;documentation of the model, covering theory, design, operation, compliance and shortcomings; and disclosure about the model to cover distribution and its variability, underlying data, calibration, appropriateness and fit.&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In the same section it also states that unlike Basel II, &quot;the correlation between risk components is explicitly recognized by Solvency II.&quot;  On p. 106 another comparison is made, saying that &quot;Solvency II has adopted the Basel II operational risk management framework.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some sets of presentation slides comparing the two frameworks can be found here:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.actuaries.org.uk/research-and-resources/documents/solvency-ii-and-basel-ii-what-can-actuaries-learn-copies-slides&quot; rel=&quot;nofollow&quot;&gt;Solvency II and Basel II—What can actuaries learn?&lt;/a&gt; (Omar Ripon and Martin Noble)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.actuaries.org.uk/system/files/documents/pdf/McNeil.pdf&quot; rel=&quot;nofollow&quot;&gt;Economic Capital Models for Basel/Solvency II, Pillar II&lt;/a&gt; (Alexander J. McNeil)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Finally, an overview of the Solvency II framework can be found in the Deutsche Bank Research publication &lt;a href=&quot;http://www.dbresearch.com/PROD/DBR_INTERNET_EN-PROD/PROD0000000000278734.pdf&quot; rel=&quot;nofollow&quot;&gt;Solvency II and Basel III: Reciprocal effects should not be ignored&lt;/a&gt;.  However, the main topic of this publication is how implementation of Solvency II and Basel III will affect insurance company investment behavior and capital allocation, along with affecting banks' funding.&lt;/p&gt;&#xA;" OwnerUserId="1129" LastActivityDate="2012-05-18T13:21:09.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3511" PostTypeId="2" ParentId="3508" CreationDate="2012-05-18T22:08:51.877" Score="3" Body="&lt;ol&gt;&#xA;&lt;li&gt;One approach is to simply calculate the correlations over a rolling window. Changing the window can provide an indication as to how the correlations are changing over time.&lt;/li&gt;&#xA;&lt;li&gt;A more sophisticated approach is to estimate a DCC-Copula model. This type of model beras some similarity with Garch in its structure, except that it is for the paremeters of a copula model (I believe they were an adjustment to initial work done on multivariate DCC Garch models). This type of model could also provide you with contemporaneous estimates of conditional correlations. There is a user-created Matlab toolbox that can estimate these models (site: &lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/29303-dynamic-copula-toolbox-3-0&quot; rel=&quot;nofollow&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/29303-dynamic-copula-toolbox-3-0&lt;/a&gt;). While it is user-friendly, you may need to adapt it to suit your needs...&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2012-05-18T22:08:51.877" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3512" PostTypeId="2" ParentId="9" CreationDate="2012-05-19T04:17:07.987" Score="3" Body="&lt;p&gt;We just made a video on CBOE-VIX Hope you like it &#xA;&lt;a href=&quot;https://vimeo.com/41915075&quot; rel=&quot;nofollow&quot;&gt;https://vimeo.com/41915075&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2454" LastEditorUserId="35" LastEditDate="2012-09-24T20:47:22.563" LastActivityDate="2012-09-24T20:47:22.563" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3514" PostTypeId="2" ParentId="3507" CreationDate="2012-05-20T11:10:26.507" Score="6" Body="&lt;p&gt;Just following &lt;a href=&quot;https://rads.stackoverflow.com/amzn/click/com/354061477X&quot; rel=&quot;noreferrer&quot; rel=&quot;nofollow noreferrer&quot;&gt;Musiela Rutkowski&lt;/a&gt; (the link redirects to Amazon). The risk neutral measure is derived form imposing that the present &lt;em&gt;value&lt;/em&gt; of a self financed portfolio (i.e.; no infusion or withdraw of money) is a martingale. A portfolio can be seen as a stochastic process where its &lt;em&gt;value&lt;/em&gt; at time &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt; is given by&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;V_t = \phi^0_tP_t + \phi^1_tS_t\ , &#xA;$$&lt;/span&gt;&#xA;this is, the value is equal to the number of bonds &lt;span class=&quot;math-container&quot;&gt;$\phi^0_t$&lt;/span&gt; times the growth of the bond &lt;span class=&quot;math-container&quot;&gt;$P_t=e^{rt}$&lt;/span&gt; plus the number of shares &lt;span class=&quot;math-container&quot;&gt;$\phi_t^1$&lt;/span&gt; times the value of the share &lt;span class=&quot;math-container&quot;&gt;$S_t$&lt;/span&gt; at time &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt;. If we assume a constant dividend yield &lt;span class=&quot;math-container&quot;&gt;$q$&lt;/span&gt; (proportional to the spot) the increment in value is given by&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;dV_t = \phi_t^0 dP_t + \phi_t^1dS_t + \phi_t^1qS_tdt&#xA;$$&lt;/span&gt;&#xA;that is the change of value of every component plus the dividend amount we receive &lt;span class=&quot;math-container&quot;&gt;$\phi_t^1qS_t$&lt;/span&gt; at every instant increment &lt;span class=&quot;math-container&quot;&gt;$dt$&lt;/span&gt;. We are assuming a geometric Brownian motion for the price of the share described by &lt;span class=&quot;math-container&quot;&gt;$dS_t=S_t(\mu dt + \sigma dW_t)$&lt;/span&gt; under the physical measure, therefore&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;dV_t = \phi_t^0 dP_t + \phi_t^1S_t((\mu + q)dt + \sigma dW_t)\ . &#xA;$$&lt;/span&gt;&#xA;Now just follow the same steps as the non dividend paying stock. To make the discounted value of our portfolio follow a martingale we will need&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;d(e^{-rt}V_t) = \phi_t^1dS^*_t\ ,\quad \mbox{with},\qquad dS_t^*=S_t^*\sigma dX_t &#xA;$$&lt;/span&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;S_t^*=\frac{1}{P_t}e^{qt}S_t&#xA;$$&lt;/span&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;X_t = W_t - \frac{r-q-\mu}{\sigma}t&#xA;$$&lt;/span&gt;&#xA;Replacing &lt;span class=&quot;math-container&quot;&gt;$dW_t=dX_t + \frac{1}{\sigma}(r-q-\mu)dt$&lt;/span&gt; in the equation of &lt;span class=&quot;math-container&quot;&gt;$dS_t$&lt;/span&gt; yields&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;dS_t = S_t((r-q)dt + \sigma dX_t)&#xA;$$&lt;/span&gt;&#xA;the evolution under the risk neutral measure.&lt;/p&gt;&#xA;" OwnerUserId="1704" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2019-05-25T14:09:11.100" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="3515" PostTypeId="1" CreationDate="2012-05-21T12:17:33.433" Score="3" ViewCount="413" Body="&lt;p&gt;Is there some research resource/group working on benchmarking of software products out there with automated trading and goals of &quot;Advanced alpha generation and execution strategies&quot; incorporating low latency data of the order of milli/micro/nano seconds ?&lt;/p&gt;&#xA;" OwnerUserId="2461" LastActivityDate="2012-05-27T13:52:31.670" Title="Resources for Benchmarking Automated Trading Systems available as deltix etc.?" Tags="&lt;automated-trading&gt;&lt;high-frequency&gt;&lt;benchmark&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3516" PostTypeId="1" AcceptedAnswerId="3535" CreationDate="2012-05-21T14:50:46.533" Score="8" ViewCount="691" Body="&lt;p&gt;How to model time series which are illiquid - 400 observations (transactions) per 8 hours ? Are there models suitable for this situation which incorporate not only size of the transactions but also their timing ? (or mayby incorporate even volume of transactions)  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm going to edit this in the next two days and give some details about models for irregulary spaced time-series which I know, but mayby someone give interesting point based only on below remarks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ok, I'm going to add more details in next two days (from the statistical and econometric side), but now I have to say a little about the goal of the model. There is a stock index (call it X20) based on behavior of 8 liquid (~2200 transactions per 8 hours) and 12 (~200-400 transactions per 8 hours) illiquid stosks and there is derivative(future - FX20) based on this stock index. I need to built &quot;warning system&quot; for the  FX20 and I want to create it using data from that 20 stocks - let leave alone other approaches based only on FX20/X20 time-series there will aslo be used. This 12 illiquid stocks make about 35% of value of index, for the 8 liquid stocks it's quite easy to produce results using common econometrics techniques GARCH/VAR for time-series (with 1-5 minute intervals) after seasonal decomposition (data for liquid stock exhibit strict U-shape daily volatility pattern) or moving averages. The goal is warning system which going to produce signals for trading system, at this point I don't know if signals from this warning system are going to be good indicators of trend reverse or mayby for spotting periods of anomalous markets activity at which trading system don't do well. And I'm &lt;strong&gt;expecially&lt;/strong&gt; interested in spotting periods which precede large swings of index value. All this I want to do using data of 20 stocks. For 12 illiquid stocks synchronized increase in activity - shorter periods between transaction, increasing volume, increasing price volatility, increased correlation of price changes are signs of some sort of movement that is going to happen, and now how to quantife is it anomaly from statistical point of view (in 5 minutes time horizont) ? Loosely speaking, from statistical point of view, it's anomaly if we need extremely unlikely realization of random variables to fit that new data.&lt;/p&gt;&#xA;" OwnerUserId="2044" LastEditorUserId="2299" LastEditDate="2013-10-27T09:00:41.237" LastActivityDate="2013-10-27T09:00:41.237" Title="How to model time series of illiquid stocks - 400 observations (transactions) per 8 hours?" Tags="&lt;statistics&gt;&lt;modeling&gt;&lt;econometrics&gt;&lt;liquidity&gt;&lt;high-frequency-estimators&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="3517" PostTypeId="1" CreationDate="2012-05-22T07:05:55.073" Score="2" ViewCount="105" Body="&lt;p&gt;I am trying to see if there is a correlation between the Environment, Social, and Governance (ESG) performance and the financial performance of Private Equity (PE) funds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any suggestions for good indicators of ESG performance of Private Equity Funds. These indicators should be at the fund level (i.e. not asset level). If possible it would be preferable to have indicators which can be observed in a pre-investment phase (e.g. relating to the General Partner).&lt;/p&gt;&#xA;" OwnerUserId="2437" LastEditorUserId="2437" LastEditDate="2012-05-22T16:37:29.477" LastActivityDate="2012-05-22T16:37:29.477" Title="Good Environment, Social, and Governance Indicators to correlate with financial performance of PE" Tags="&lt;research&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3518" PostTypeId="1" CreationDate="2012-05-22T13:02:13.040" Score="12" ViewCount="712" Body="&lt;p&gt;What is the gold standard econometric model for volume?  For example, a common model for price is the autoregressive (AR) model with GARCH(1,1) innovations.  Do you know of any good survey articles about econometric models used for modeling volume?&lt;/p&gt;&#xA;" OwnerUserId="2044" LastEditorUserId="467" LastEditDate="2012-05-27T09:57:05.133" LastActivityDate="2013-11-21T13:45:04.200" Title="What is a commonly accepted econometric model for volume?" Tags="&lt;time-series&gt;&lt;modeling&gt;&lt;volume&gt;&lt;econometrics&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3520" PostTypeId="2" ParentId="3515" CreationDate="2012-05-22T20:34:12.787" Score="2" Body="&lt;p&gt;There were a few vendors at the 2009/2010 Futures and Options Expo in Chicago that did exactly this. Two that I recall are &lt;a href=&quot;http://rtsgroup.net/&quot; rel=&quot;nofollow&quot; title=&quot;RTS Group&quot;&gt;RTS Group&lt;/a&gt; and &lt;a href=&quot;http://solacesystems.com/solutions/financial-services/&quot; rel=&quot;nofollow&quot; title=&quot;Solace Systems&quot;&gt;Solace Systems&lt;/a&gt; however their sites don't mention anything of bench marking. Perhaps I'm missing it or they're no longer doing it.&lt;/p&gt;&#xA;" OwnerUserId="1112" LastActivityDate="2012-05-22T20:34:12.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3521" PostTypeId="2" ParentId="3515" CreationDate="2012-05-23T15:58:52.203" Score="2" Body="&lt;p&gt;The fastest systems out there are mostly custom built hardware solutions and even the off the shelf solutions are evolving very rapidly right now. There is a company call &lt;a href=&quot;http://www.correlix.com/solution_buyside.html&quot; rel=&quot;nofollow&quot;&gt;Correlix&lt;/a&gt; which provides latency measurement of trading systems with extremely high resolution. I have not needed their services and thus I cannot comment on how effective they are.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One thing to keep in mind is that measuring milliseconds and nano seconds is very different and just because something is good a benchmarking milliseconds does not mean it will be good at nanoseconds. &lt;/p&gt;&#xA;" OwnerUserId="373" LastActivityDate="2012-05-23T15:58:52.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3522" PostTypeId="2" ParentId="3518" CreationDate="2012-05-23T17:10:33.460" Score="9" Body="&lt;p&gt;GARCH will work if volume has memory with some decay. AR will work if volume has mean reversion properties. Both of these are empirical questions and depend on the market. You should also consider if there are seasonal (day-of-week, monthly, quarterly effects) in which case you would want to add dummy variables. MA models will work well if volume behaves like a random-walk (not the case).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no &quot;gold standard&quot; since markets have different volume characteristics (for example, emerging markets have rising volumes; developed markets more recently are seeing less volume traded year-over-year with the rise of crossing networks and dark pools). I would start by observing the volume of interest to see what properties hold (i.e. trend, mean reversion, persistence, seasonality) for starters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may want to consider using the auto.arima function in the package &lt;a href=&quot;http://cran.r-project.org/web/packages/forecast/forecast.pdf&quot;&gt;forecast&lt;/a&gt; to fit a volume model to each security rather than looking for a global functional form for all securities.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-05-23T22:03:52.373" LastActivityDate="2012-05-23T22:03:52.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3523" PostTypeId="2" ParentId="1274" CreationDate="2012-05-23T18:43:00.443" Score="4" Body="&lt;p&gt;There is a research paper that attempts to do just that: &lt;a href=&quot;http://www.cs.ucr.edu/~cshelton/papers/docs/orderflow_emm.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.cs.ucr.edu/~cshelton/papers/docs/orderflow_emm.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;no personal experience implementing anything like that.&lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2012-05-23T18:43:00.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3524" PostTypeId="2" ParentId="2303" CreationDate="2012-05-23T19:04:51.047" Score="5" Body="&lt;p&gt;Simple explanation of VIX formula is that it is a square root of weighted sum of out of the money SPX options. If options are more expensive (implying that market is paying more for insurance from a major move) VIX will be higher, if options are cheap (implying that the market does not think that there will be a lot of movement in the SPX) VIX will be lower.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The weighting formula has a particular meaning - roughly corresponding to the area under the put and call curves. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/lrWGS.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/lrWGS.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to provide intuitive explanation of VIX formula in &lt;a href=&quot;http://onlyvix.blogspot.com/2011/09/intuitive-understanding-of-vix-formula.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://onlyvix.blogspot.com/2011/09/intuitive-understanding-of-vix-formula.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="185" LastEditorUserId="185" LastEditDate="2018-01-28T01:46:09.023" LastActivityDate="2018-01-28T01:46:09.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3525" PostTypeId="2" ParentId="3336" CreationDate="2012-05-23T19:08:06.593" Score="4" Body="&lt;p&gt;Yes, all of VIX futures are based on THEIR RESPECTIVE front month options, so you have to realize that for long-dated VIX futures these are long-dated options. So for example settlement value of VIX DEC 12 futures will be based on SPX JAN 13 options, which will be front-month options at the time of VIX futures expiration. &lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2012-05-23T19:08:06.593" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3526" PostTypeId="1" AcceptedAnswerId="3527" CreationDate="2012-05-23T19:57:35.933" Score="9" ViewCount="29997" Body="&lt;p&gt;I have two time-series a &amp;amp; b. The objective is to find out whether two series are cointegrated or not. I am using Johansen Test in R to find this out. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using &lt;a href=&quot;http://cran.r-project.org/web/packages/urca/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;urca package&lt;/a&gt; of R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the summary of test (trace test with constant intercept):&#xA;ca.jo(cbind(a,b), type=&quot;trace&quot;, ecdet = &quot;const&quot;, K = 2, spec =&quot;longrun&quot;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Summary:&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Johansen-Procedure&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Test type: trace statistic , without linear trend and constant in cointegration &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Eigenvalues (lambda):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[1] 1.729720e-02 4.118294e-03 1.294090e-19&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Values of teststatistic and critical values of test:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;             test  10pct 5pct  1pct&#xA;    r &amp;lt;= 1 | 2.46  7.52  9.24  12.97&#xA;    r = 0  | 12.88 17.85 19.96 24.60&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Eigenvectors, normalised to first column:&#xA;(These are the cointegration relations)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;            a.l2          b.l2         constant&#xA;a.l2        1.000000     1.0000000     1.000000&#xA;b.l2       -3.662895     0.6463026     1.725186&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;constant 1135.666923 -2889.4155208 -7862.128714&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Weights W:&#xA;(This is the loading matrix)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;       a.l2         b.l2        constant&#xA;a.d    0.002621493 -0.006226421 1.245608e-18&#xA;b.d    0.010169925 -0.001446919 2.187151e-18&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now my question how to interpret this result and determine whether a &amp;amp; b are cointegrated or not? What is a loading matrix in a cointegration test? How to interpret the critical values? How to determine whether to keep a constant intercept or zero intercept? Do I need to check individual series is an I(1) series before running johansen test?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a similar question which has been asked before &lt;a href=&quot;https://quant.stackexchange.com/questions/2076/how-to-interpret-the-eigenmatrix-from-a-johansen-cointegration-test&quot;&gt;here&lt;/a&gt; but it didn't answer my question completely.&lt;/p&gt;&#xA;" OwnerUserId="2469" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2015-08-22T21:25:46.820" Title="How to interpret results of Johansen Test?" Tags="&lt;r&gt;&lt;cointegration&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="3527" PostTypeId="2" ParentId="3526" CreationDate="2012-05-24T14:44:24.903" Score="6" Body="&lt;p&gt;Some of your question was already answered on the question you mention. Please read it carefully to understand better. In particular it answers very well how to conclude if there is co-integration or not. Also note that this question is not really relevant here both on level and subject (It is a pure statistical question and can be asked on stats.stackexchange.com). &#xA;If you need more detail and proofs on that subject you could read Johansen seminal article: Estimation and Hypothesis Testing of Cointegration Vectors in Gaussian Vector Autoregressive Models. (It is very technical though)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now Let's take the other one by one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1/The loading matrix is the matrix generaly reffered to as alpha (Check urca documentation).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2/ The critical values: If the null hypothesis (r=0, r&amp;lt;=1) is verified your test statistic follows a known distribution. Given the cumulative distribution you can find where lie 90%, 95%, 99% of the values. Here under the null your test statistic (the trace) is distributed a chi^2. Therefore if it's value is greater than some of the critical values you can reject the null at this confidence. Obviously in your case you cannot reject anything at any confidence (doesn't mean that you proved the null is verified). I'm not telling you if this means co-integration or not as it is much better that you find that out for yourself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3/ I'm not so sure about the intercept (in the VECM) but it is critical as it corresponds to a deterministic trend in the VAR representation and changes your test statistics. I suppose you could first fit a model with th intercept and test for it's significance. My belief is that deterministic trend is not very probable with financial time series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4/ Contrary to the tests (ADF and others) based on Engle and Granger methodology you do not need to test if your series are I(1) previously as this is one of the null in your trace test. Chek which one in the previous question you mentioned.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a rule I think anyone should try to apply : Don't use a statistical method if you don't understand it.   &lt;/p&gt;&#xA;" OwnerUserId="155" LastActivityDate="2012-05-24T14:44:24.903" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3530" PostTypeId="1" AcceptedAnswerId="3532" CreationDate="2012-05-25T12:22:01.683" Score="-2" ViewCount="1089" Body="&lt;p&gt;I do a simple example with the follow three series(stocks prices):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a = 1, 1.2, 1.8, 1.3, 0.9, 2&#xA;b = 56, 58, 63, 61.5, 57.6, 58&#xA;c = 105.6, 110, 106.9, 103, 101.2, 107&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;ok, so let assume those series are the prices of the three stocks, named &lt;strong&gt;A&lt;/strong&gt;, &lt;strong&gt;B&lt;/strong&gt; and &lt;strong&gt;C&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I do the linear regression doing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mod = lm(a ~ b + c + 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the result of the linear model is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Call:&#xA;lm(formula = a ~ b + c + 0)&#xA;&#xA;Coefficients:&#xA;        b          c  &#xA; 0.030570  -0.004095  &#xA;&#xA;&amp;gt; mod$residuals&#xA;         1          2          3          4          5          6 &#xA;-0.2795238 -0.1226474  0.3118110 -0.1583030 -0.4464512  0.6650691 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now we know the coefficients of &lt;strong&gt;b&lt;/strong&gt; and &lt;strong&gt;c&lt;/strong&gt; and here I have a doubt regarding, how can I understand reading these coefficients the weight of the stocks I need to buy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the weight I mean, example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;A: 10 stocks&#xA;B: 2 stocks&#xA;C: 16 stocks&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to create this spread and calculate the correct number of stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;IMPORTANT:&lt;/strong&gt; This is only an example, I know that I need more tests to check the stability etc etc but with this example I only would like to understand:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can I calculate the number of the stocks reading the linear regression coefficients?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="1663" LastActivityDate="2012-05-25T13:25:13.267" Title="How to calculate the weight of the stocks using the linear regression?" Tags="&lt;quant-trading-strategies&gt;&lt;regression&gt;&lt;pairs-trading&gt;&lt;spread&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3532" PostTypeId="2" ParentId="3530" CreationDate="2012-05-25T13:25:13.267" Score="1" Body="&lt;p&gt;If I understand correctly then you measure something that you actually do not look out for. Your regression tries to explain prices of stock A by using a linear combination of stocks B and C. The coefficients tell you the fraction of stocks you need to have in stocks B and C in order to arrive at the predicted price of stock A. Thus, 0.031 shares of stock B plus 0.0041 shares SHORT of stock C will output the predicted price of stock A. I doubt that is what you want UNLESS you are convinced that prices of stock B and C OVER TIME are a good predictor for prices in stock A. Generally I advise, however, you work with log returns and not absolute stock prices. Hope this helps. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-05-25T13:25:13.267" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3533" PostTypeId="2" ParentId="3389" CreationDate="2012-05-26T23:53:16.060" Score="1" Body="&lt;p&gt;There may be many reasons for such correlation breakdowns - quarterly earnings announcements that result in elevated volatility for JPM but not SPX, or systematic risk: JPM being a bank has more Euro-debt related risk than SPX. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having said that to trade options you should be looking at implied volatility time series.&lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2012-05-26T23:53:16.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3534" PostTypeId="1" CreationDate="2012-05-27T04:33:43.383" Score="3" ViewCount="218" Body="&lt;p&gt;Given the price of a call equals to 5 with Strike 100, please find the upper bound (sup) of the digital option with strike 105.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure about the solution, but I write the condition like this,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S\mathcal{N}(d_1)-Ke^{-rT}\mathcal{N}(d_2) = 5$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;what's the $\sup{N(d_1+\frac{\ln(\frac{100}{105})}{\sigma\sqrt{T}})}$?&lt;/p&gt;&#xA;" OwnerUserId="2479" LastEditorUserId="467" LastEditDate="2012-05-27T09:55:42.640" LastActivityDate="2012-05-27T09:55:42.640" Title="How to find the upper bound of a digital option given some market data?" Tags="&lt;options&gt;&lt;option-pricing&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3535" PostTypeId="2" ParentId="3516" CreationDate="2012-05-27T07:32:25.420" Score="6" Body="&lt;p&gt;From an academic viewpoint you do not have a lot of choices:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The Rosenbaum-Robert approach, the &lt;a href=&quot;http://www.citeulike.org/user/lehalle/article/8317402&quot;&gt;price model with uncertainty zones&lt;/a&gt; is a model of trades and duration between trades (implicitly). It is worthwhile to try it.&lt;/li&gt;&#xA;&lt;li&gt;You can also use an &lt;a href=&quot;http://www.citeulike.org/user/lehalle/article/9217792&quot;&gt;Hawkes process&lt;/a&gt;, it will have the nice effect of capturing clustering effects on trades.&lt;/li&gt;&#xA;&lt;li&gt;if you want to use correlation / dependency measurements, you will face the &lt;strong&gt;Epps effect&lt;/strong&gt;, so you should read at least &lt;a href=&quot;http://www.citeulike.org/user/lehalle/article/2904415&quot;&gt;one Yoshida paper&lt;/a&gt; on the topic.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Now if you want to go further, you should have to look also at the quotes on your illiquid stocks. You can probably find a way to build a &lt;em&gt;synthetic price&lt;/em&gt; using the first limit that will allow you to have a proxy of the price at the next trade if there will be a trade soon on the illiquid stocks. On &lt;strong&gt;order-flow viewpoint&lt;/strong&gt; can be useful that for. There is a very good suite of papers by &lt;a href=&quot;http://www.citeulike.org/user/lehalle/article/8531765&quot;&gt;Rama Cont and Adrien de Larrad&lt;/a&gt; on this topic.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2012-05-27T07:32:25.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3537" PostTypeId="2" ParentId="2844" CreationDate="2012-05-27T16:11:38.963" Score="4" Body="&lt;p&gt;It seems that your real question is: &lt;em&gt;is the PFP (Price Formation Process) diffusive from intraday to weekly sampling rate?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is a very good question since on intraday, some academics found some multifractal features into intraday returns, meaning that the PFP is not a Geometric Brownian Motion at small scales (even considering stochastic volatility).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have for instance successful modellings of the PFP using pint processes, and especially Hawkes ones (that are not diffusive and even not Markovian): &lt;a href=&quot;http://www.citeulike.org/user/lehalle/article/9217792&quot; rel=&quot;nofollow&quot;&gt;Modeling microstructure noise with mutually exciting point processes by: E. Bacry, S. Delattre, M. Hoffmann, J. F. Muzy (forthcoming in Quant. Finance)&lt;/a&gt;.&#xA;They obtained some formula to express characteristics of the diffusive limit of such processes with respect to ones of the underlying Hawkes process, like the large scale diffusive volatility:&#xA;$$\sigma=\frac{2\mu}{1-||\phi||_1}\,\frac{1}{(1+||\phi||_1)^2}$$&#xA;(with $\phi$ the kernel of the Hawks process linking its stochastic intensity with its realizations and $\mu$ is the deterministic part of its intensity).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But also more &quot;&lt;em&gt;classical&lt;/em&gt;&quot; multifractal approaches: &lt;a href=&quot;http://www.citeulike.org/user/lehalle/article/2868500&quot; rel=&quot;nofollow&quot;&gt;Modelling fluctuations of financial time series: from cascade process to stochastic volatility model&#xA;by: J. F. Muzy, J. Delour, E. Bacry in Euro. Phys. Journal B, Vol. 17 (2000), pp. 537-548&lt;/a&gt;.&#xA;In such cases, a classical &quot;&lt;em&gt;Hurst exponent&lt;/em&gt;&quot; allows zooming in or out.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2012-05-27T16:11:38.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3538" PostTypeId="1" CreationDate="2012-05-27T17:46:14.697" Score="7" ViewCount="4383" Body="&lt;p&gt;I have implemented a function for calculating historical volatility using close the close method as described by &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0071389970&quot;&gt;Haug&lt;/a&gt; on page 166.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I implemented the formula given by Haug, it resulted in some negative values for the variance. The data I am using is not suspect, so the fault must lie in either:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;my implementation or&lt;/li&gt;&#xA;&lt;li&gt;the formula itself.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here is a rough sketch of my implementation function (in Python)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# close_prices is a time sorted list of pricedata objects&#xA;# returns a list of calculated volatilities&#xA;def calc_volatility(close_prices, period):&#xA;    startpos, stoppos, raw_vols = (0, period, [])&#xA;    while True:&#xA;        subset = close_prices[startpos:stoppos+1]&#xA;        period_returns      = [ subset[i].close_price/subset[i-1].close_price for i in range(1,len(subset)) ]&#xA;        log_returns         = [ math.log(x) for x in period_returns ]&#xA;        log_squared_returns = [ math.log(pow(x,2)) for x in period_returns ]&#xA;&#xA;        sum_squares_1 = sum( log_squared_returns ) / (period-1)&#xA;        sum_squares_2 = pow( sum( log_returns ), 2) / (period * (period -1))&#xA;&#xA;        variance = sum_squares_1 - sum_squares_2&#xA;        print &quot;ss1: {0} - ss2: {1}. Variance: {2}&quot;.format(sum_squares_1, sum_squares_2, variance)&#xA;&#xA;        volatility = math.sqrt(variance)&#xA;&#xA;        raw_vols.append (volatility)&#xA;&#xA;        startpos += period&#xA;        stoppos  += period&#xA;&#xA;        if stoppos &amp;gt;= len(close_prices):&#xA;            break&#xA;&#xA;    return raw_vols&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there something wrong in my implementation, or is the formula I am using, incorrect?&lt;/p&gt;&#xA;" OwnerUserId="1733" LastEditorUserId="1733" LastEditDate="2012-05-27T17:56:57.367" LastActivityDate="2015-10-04T21:07:57.973" Title="Historical volatility from close prices (Haug pg 166)" Tags="&lt;volatility&gt;&lt;python&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3539" PostTypeId="1" CreationDate="2012-05-28T09:15:59.163" Score="2" ViewCount="798" Body="&lt;p&gt;I am referring to the article &lt;a href=&quot;http://www.figuide.com/dollar-cost-averaging-facts-and-myths-2.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. In a nutshell the article says that using data based on S&amp;amp;P 500 index going back as far as to 1950, dollar cost averaging is performing worse than a lump sump investment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, assuming that the market works according to &lt;a href=&quot;http://en.wikipedia.org/wiki/Random_walk_hypothesis&quot; rel=&quot;nofollow&quot;&gt;random walk hypothesis&lt;/a&gt;, is it possible to show mathematically that dollar cost averaging is always worse than lump sum investment, as far as the return on investment goes? &lt;/p&gt;&#xA;" OwnerUserId="129" LastActivityDate="2012-05-28T13:23:54.153" Title="Proof showing that dollar cost averaging always worse than lump sum alternative" Tags="&lt;random-walk&gt;&lt;investment&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3540" PostTypeId="2" ParentId="3539" CreationDate="2012-05-28T10:30:12.270" Score="3" Body="&lt;p&gt;You did not carefully read the article you yourself linked to. Dollar cost averaging is a generalized concept. What the author compares is a full-sized investment or time-specific partial investments. So, dca is a concept and you draw conclusions from one single approach to dca. There is no mathematical proof that dca works or not because it is one single concept that is only part of the overall investment process. Its as if I tell you that getting higher education does not pay off because those who undergo it and become philosophers do not recoup their investment. I did not include those who become lawyers, doctors, financiers,...the same applies to this article.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What if I told you that dca hugely outperforms a lump-sum investment approach if instead of investing the parts at time-shifted periods you instead disregards time and buy companies with great fundamentals but depressed stock prices because of overall market sentiment. Each time the stock price trades another 2% below your previous investment you invest another portion. It is one alternative approach from many but it clearly demonstrates that you are comparing apples and oranges here. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another example to debunk the point made in the link is if I claimed trend following strategies do not work because the market is 70% of times range-bound and the strategy cannot make money in a range bound environment thus it has to be inferior to a range-bound strategy approach. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope you got my point. So, in short, there is no mathematical proof. I could specify a strategy approach that hugely under-performs when investing in a dca way and another strategy that hugely outperforms a lump sum investment approach. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-05-28T10:30:12.270" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3542" PostTypeId="2" ParentId="3539" CreationDate="2012-05-28T13:23:54.153" Score="2" Body="&lt;p&gt;There are a number of papers in the literature which show that Dollar Cost Averaging is suboptimal, in the sense that, given a DCA investment strategy, then there exists an alternative investment strategy which will be strictly preferred by a utility maximising agent. This preferred strategy may not necessarily be a &quot;lump-sum&quot; strategy, but a better strategy can be given that beats DCA for any utility maximising investor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think that the original paper on this was by Constantinides, &quot;A note on the suboptimality of dollar-cost averaging as an investment policy&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.jstor.org/stable/2330513&quot; rel=&quot;nofollow&quot;&gt;http://www.jstor.org/stable/2330513&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(edit: The class of models that Constantinides considers is large, and should include the ones you want.)&lt;/p&gt;&#xA;" OwnerUserId="2485" LastActivityDate="2012-05-28T13:23:54.153" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3543" PostTypeId="1" AcceptedAnswerId="3560" CreationDate="2012-05-28T14:20:06.777" Score="7" ViewCount="319" Body="&lt;p&gt;I am curious to know if there have been studies on when selling occurs and if any useful patterns exist.  I am particularly interested in the behavior of sellers when they are under water on their purchase since while an asset may theoretically be unbounded on the profit side, they can only lose 100% of purchase which might make the loss side easier to study.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there data/research indicating some kind of curve?  E.G. x% sell when down 10%, y% sell when down 30%, z% ride it into oblivion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure if this kind of research would be the province of behavioral finance studies based on small group experiments or if market data (e.g. brokerage house records, clearing house data, etc.) has been made available to some group to study.&lt;/p&gt;&#xA;" OwnerUserId="2478" LastEditorUserId="467" LastEditDate="2012-05-28T17:58:18.983" LastActivityDate="2012-05-30T16:05:49.400" Title="Reseach on when people/institutions sell?" Tags="&lt;research&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3546" PostTypeId="2" ParentId="344" CreationDate="2012-05-29T00:42:59.797" Score="3" Body="&lt;p&gt;Implied volatility skew is simply collection of implied volatilities on the same underlying instrument for a given expiration. Term &quot;implied volatility skew&quot; is only loosely connected to statistical definition of skewness.&#xA;Implied volatility surface is the collection of implied volatilities on the same underlying for several expirations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If BS formula were to be true, you would expect implied volatility to be a constant across strikes and expirations. This is not true, and deviation (from constant) is referred to as skew.&lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2012-05-29T00:42:59.797" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3547" PostTypeId="2" ParentId="3475" CreationDate="2012-05-29T00:46:55.017" Score="1" Body="&lt;p&gt;You cannot be theta neutral: if your security has vega, then it has gamma and theta. &lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2012-05-29T00:46:55.017" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3548" PostTypeId="2" ParentId="3475" CreationDate="2012-05-29T02:07:11.237" Score="2" Body="&lt;p&gt;I somewhat disagree (partially) with the other answers so I offer my own. First, most importantly is that you specify exactly what underlying asset you really talk about. Even for non-interest bearing assets an unhedged rho can sometimes have devastating results on your profitability. Imagine a stock denominated in a highly inflated currency. If you buy options you need to finance such investment through borrowing cash or shorts in fixed income securities which directly expose you to interest rate risk. Some economies struggle with so high inflation rates that the impact of just a few days of lending/borrowing in such money markets expose you to significant inflation/interest rate risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You also want to pay close attention to fx risk. I know of some Kospi index options traders who lost a huge bunch of their positive pnl because they badly hedged fx risk through NDFs (= non-deliverable forwards). Well to be fair, I should not say they badly hedged it but hedging fx risk in certain markets can be extremely tricky especially when the currency is not freely convertible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You named the basic greeks so I wont get into this but may I point you to papers that introduce you to the mechanics of variance and volatility swaps? The replication of those may be exactly what you are looking for and some of those (especially the Deutsche Bank paper and &lt;a href=&quot;http://www.scribd.com/doc/19606780/JP-Morgan-Variance-Swaps&quot; rel=&quot;nofollow&quot;&gt;JPM&lt;/a&gt;) did a pretty good job at highlighting the basic greek hedges and residual higher order risk. Hope this helped a little. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="5086" LastEditDate="2014-03-13T06:37:40.200" LastActivityDate="2014-03-13T06:37:40.200" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3549" PostTypeId="2" ParentId="3543" CreationDate="2012-05-29T02:25:37.907" Score="7" Body="&lt;p&gt;I highly doubt there are useful studies around. Think about it, the answers of such data sets must be highly skewed simply because there are price takers in the market that are extremely secretive about profits and losses. You will only get one side of the story and it most likely skews the results by quite a bit. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, keep in mind many institutions do not cut positions themselves to stop out of trades but they put on hedges. The most recent trading error at JPM is a good example. Would they have cleaned up their CDS portfolio and traded out of their Series 9 positions they may have easily lost twice as much as is currently estimated. On the other side the book cleaning at SocGen was done as badly as could after Kerviel's trading blunders for the precise reason that they sold all positions as quickly as they could instead of first putting on broad market hedges for risk mitigation purposes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In summary, I do not believe you will get anything useful to work with by looking at such studies. Useful I mean in the context of making money in the market or setting up profitable trading strategies. If you want to just write an academic paper then go ahead, but there are enough out there who write a lot and even get Nobel prizes but could not generate 10% annual returns in actual markets. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would probably look at the issue at hand by investigating individual stock time series. There are inflection points that can be isolated. Look at statistically significant price jumps or large continuous moves in volume at the open or nearby market closes absent any company specific news releases/ratings changes/up/downgrades and also in isolation, meaning, times the stock moved in volume while sector indicies or broad market indicies did not correlate. Thats how I would look at it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why am I saying all that? Simple: Because there is a reason why many top ex-bank traders truly struggle right now to generate returns that keep AUM at stable levels. Such traders had a lot of information at their disposal inside the banks where they saw all the money flow of large institutional players. Prop bank trading was the biggest cash cow of the past couple decades in financial services and it will soon be entirely gone (until the pendulum starts to swing back ;-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: You may also want to look at pure OTC instruments that are not available to the masses. If you have access to swaptions pricing data this will give you a taste of how institutional players cut positions at times. Also, another idea could be to look at fx markets. Those guys at bank and broker desks are not the most iq blessed chaps out there in the trading world and as a result often openly share and disseminate information where they see stop loss levels lying around. Often you need to take it with a big grain of salt but there is definitely channels out there that provide very accurate levels and this is what you may want to focus and zero in on. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="1587" LastEditDate="2012-05-30T02:07:23.987" LastActivityDate="2012-05-30T02:07:23.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3550" PostTypeId="2" ParentId="3216" CreationDate="2012-05-29T03:42:02.600" Score="1" Body="&lt;p&gt;I am not sure why this seems a challenging question, so let me take a stab at it: So given I understand your presented data correctly in that past realized alpha ends on average up in the same bin as the expected alpha (implying co-integration between realized and expected excess returns). I make the assumption in the following that your excess returns are NOT volatility adjusted, but simply returns in excess of some benchmark rate (otherwise you should not call it alpha but Sharpe): &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would say the only motivation for anyone to trade the middle bins is the lower volatility. So, I would simply normalize the excess returns by volatility and then distribute the normalized results into bins again and then trade the extremes. Or, you may want to apply a different utility function in which volatility plays a role and which would result in you wanting to trade middle bins as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One needs to be careful to manage the balancing act of the distinction between realized volatility and realized alpha on one side and forecast volatility and expected excess returns on the other side. What I would find questionable in your question is that you give the impression away that you imply same future expected volatility than the measured realized volatility which is not correct as volatility is non constant. But for simplicity sake lets assume it is a good predictor of future volatility then I would go ahead with my suggested answer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise the problem turns into something much more complex and you need more empirical data to warrant an accurate answer, meaning, I would need to ask you for expected volatility figures of the same stocks (I assume we are talking stocks here) in addition to their realized vols. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-05-29T03:42:02.600" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3551" PostTypeId="1" AcceptedAnswerId="3557" CreationDate="2012-05-29T06:46:56.953" Score="11" ViewCount="3247" Body="&lt;p&gt;Suppose a fairly simple problem: You have to buy (resp sell) a given number of shares V in a fixed time horizon H with the aim to minimize your capital spent (resp maximize your revenue).&lt;br&gt;&#xA;There are some research papers on the web that claim that using reiforcement learning algorithms can help make decision. See for example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1/ Nevmyvaka and Kearns: Reinforcement Learning for Optimized Trade Execution &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;These papers employ dynamic allocation strategies based either on limit order book or bid ask spreads to do so. Contrary to the classical paper&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;2/Almgren and Chriss: Optimal Execution of Portfolio Transactions&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;they do not assume a the security prices dynamic from which they derive their strategy. Instead they use backtest results on a test set to measure the performance of their program. Of course this also supposes constraining hypothsesis on the Limit Order Book  dynamics which are difficult to test. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is twofold : Do you know good research papers using Reinforcement Learning (or other Machine Learning method) for this problem ? By good I mean that the test set is large (not just a few days of backtest) and there is a real effort to be clear about the hypothesis and to have as little as possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has any of you applied it in a live trading environment or know someone who did?  &lt;/p&gt;&#xA;" OwnerUserId="155" LastEditorUserId="155" LastEditDate="2012-05-29T21:20:44.017" LastActivityDate="2021-01-31T06:52:36.360" Title="Optimal execution and reinforcement learning" Tags="&lt;automated-trading&gt;&lt;optimization&gt;&lt;machine-learning&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="3552" PostTypeId="1" AcceptedAnswerId="3554" CreationDate="2012-05-29T09:56:46.577" Score="10" ViewCount="3371" Body="&lt;p&gt;I have been asked to perform a factor analysis on a given portfolio, assume it's a Swiss portfolio in CHF.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;First step&lt;/strong&gt;, I chose which factors I would like to see in my analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first factors I would add are components of the portfolio (and used the hedged performance)&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Performance of a global equity index &lt;/li&gt;&#xA;&lt;li&gt;Performance of a global fixed income index&lt;/li&gt;&#xA;&lt;li&gt;Performance of gold&lt;/li&gt;&#xA;&lt;li&gt;Performance of a commodity index&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Then I would like to have the forex factors so I add &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;EURCHF performance&lt;/li&gt;&#xA;&lt;li&gt;USDCHF performance&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Finally, I would like to have some macro-economics indicators:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Change in GDP of Switzerland&lt;/li&gt;&#xA;&lt;li&gt;Inflation Rate&lt;/li&gt;&#xA;&lt;li&gt;Unemployment rate.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Si I gave a large bunch of factors, my first question is, some time series have larger values in magnitude than others and I was wondering whether I should normalize them before going further?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you think it makes sense to split &quot;pure&quot; stock performance and forex components?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Second Step&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will eventually be looking to do the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Y_t = \alpha + \sum_{i=1}^k \beta_i {F_i}_t + \varepsilon_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $F_i, \quad 0&amp;lt;i \leq k$ is the i-th factor and $y_t$ is the return of the portfolio at time $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that for this to be meaningful we need the different $F_i$ to be independent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a general accepted method in our field to use to get a set of independent factors? (I asked the question &lt;a href=&quot;https://stats.stackexchange.com/questions/29002/how-to-select-significant-variables-for-multi-factor-regression&quot;&gt;here&lt;/a&gt; but I could not come up with a straight answer).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Third step&lt;/strong&gt;&#xA;Once this filter is done we have $l\leq k$ independent factors. I was thinking about running the regression over the remaining $l$ factors, and then look at their p-values to see which ones are significant and hence I want to keep. Is there a better usually used in factor analysis? &lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2012-05-29T13:25:10.060" Title="What are the steps to perform properly a risk factor analysis on a portfolio?" Tags="&lt;regression&gt;&lt;factor-models&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="3554" PostTypeId="2" ParentId="3552" CreationDate="2012-05-29T11:38:27.393" Score="13" Body="&lt;p&gt;The regression requires orthogonalization of factors. However, we need to maintain the interpretation of factors (so PCA and Factor Analysis are out). Also, we could apply an iterative method (indeed this is very common practice) but this will bias the factor loadings on the sequence of factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best approach is that of Klein and Chow in their paper &lt;a href=&quot;http://www.be.wvu.edu/div/econ/work/pdf_files/10-05.pdf&quot;&gt;Orthogonalized Equity Risk Premia and Systematic Risk Decomposition&lt;/a&gt;. They use this a methodology from Schweinler and Wigner (1970) in the quantum chemistry wavelet literature which relies on nothing more fancy than an eigenvector decomposition. As they describe:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This distinctive characteristic is essential for a proper&#xA;  decomposition, as we  need to treat all the factors on an equal&#xA;  footing. Thus, the &lt;strong&gt;orthogonal transformation of all factors has to be&#xA;  conducted jointly and simultaneously&lt;/strong&gt;.&#xA;        We choose the  symmetric form of orthogonalization, which minimizes the overall  difference between the original and the&#xA;  orthogonal  vectors, thus maximizing the resemblance between the two&#xA;  sets of data.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;We &lt;strong&gt;apply it to the demeaned original factors&lt;/strong&gt;, which ensures that the&#xA;  resulting vectors are not only mathematically orthogonal, but also&#xA;  uncorrelated.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;They have a nice case-study applying the approach to the original Fama-French paper. I have applied their method to a mix of fundamental and economic factors for return and risk decomposition and confirm that despite the orthogonalization, the pre and post correlation of the variables are high.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Left unstated in your question is how you will identify the economic factor returns. You might be taking the economic factor time-series as is (which essentially does not distinguish between expectations and surprise), or taking the residuals of an economic factor time-series after applying an AR(1) or similar time-series model (common), or you might produce the economic factor returns as an output of a cross-sectional regression. There is a bit of art and science in that step but it's something you want to at least consider.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="35" LastEditDate="2012-05-29T13:25:10.060" LastActivityDate="2012-05-29T13:25:10.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3555" PostTypeId="2" ParentId="3216" CreationDate="2012-05-29T14:51:19.783" Score="2" Body="&lt;p&gt;The implied volatility of an individual bin is not equal to the sum of the implied volatility of each stock in the bin.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a result it becomes difficult to think in terms of a portfolio of options on the bins. Since it is difficult to get an estimate of the implied volatility of a bin, it becomes difficult to determine whether the volatility is over-priced or under-priced.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nevertheless, if you had access to enough information it would be possible for an optimizer to crank out a portfolio that accounts for the full signal. For the sake of simplicity, assume that the length the equity is in the bin matches the horizon of the optimization. You would would need to model the risk-free rate and each equity and volatility surface in the bin (and probably the S&amp;amp;P500 as well for hedging). You would then simulate each distribution to the horizon and price all the relevant options using the future implied volatility. I would then form three portfolios, each with the same conditional Value at Risk and no net market exposure, given the: 1) base simulation, plus 2) views a la BL/EP for the returns of the bins, and finally 3) more views for the variances of the bins.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2012-05-29T14:51:19.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3556" PostTypeId="1" CreationDate="2012-05-29T16:55:19.277" Score="10" ViewCount="479" Body="&lt;p&gt;Dow Jones and UBS publish one of the most popular commodity index families, the Dow Jones-UBS Commodity Index and its subindices. They provide a detailed manual describing the composition of the index and its daily changes, available at &lt;a href=&quot;https://us.spindices.com/indices/commodities/dow-jones-commodity-index&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://us.spindices.com/indices/commodities/dow-jones-commodity-index&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;I have tried to implement code that follows the description in the manual, but given the closing prices of the various components, I can't match the end-of-day values published by DJUBS.&lt;/p&gt;&#xA;&lt;p&gt;Has anybody here succeeded in this task, and willing to share their work? Any programming language will probably do, the form of the computation is going to be the same however it's developed.&lt;/p&gt;&#xA;&lt;p&gt;-- for those who want more detail, see the below&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Proper computation methodology is described in the DJUBS Commodity Index Handbook, which is available on the page I link to above. The best summary of the process appears on page 13 of the book, where it reads &amp;quot;Once the Commodity Index Multipliers are determined, the calculation of the DJ-UBS CI is an arithmetic process whereby the CIMs for the Index Commodities are multiplied by the respective prices in U.S. dollars for the applicable Designated Contracts. The products are then summed. The daily percentage change in this sum is then applied to the prior day's DJ-UBS CI value to calculate the then current DJ-UBS CI value.&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;So we need to multiply the Commodity Index Multipliers (which are determined annually, and listed in the handbook) by the US Dollar prices for the designated contracts (the commodities in question are listed in the handbook, as is the table for selecting which future to own at any given time). Sum the CIM*DollarPrice for two dates and scale the index by the percentage change between the dates (assuming we are not in the roll period, which for the sake of simplicity, let's assume we're not).&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The CIMs appear on page 34 of the handbook.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The future selection table appears on page 35&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Multipliers for USD price conversion appear on page 36&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;My code is in Mathematica and here since people are asking:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;djubsCashFrom2012[dateList_List] := &#xA; Total[Table[&#xA;   preppedCIMs[[i]][[2]]*(1/&#xA;      preppedMultipliers[[i]][[2]])*&#xA;    priceFromDatabaseOrBBG[&#xA;     futureFromDate[dateList, preppedCIMs[[i]][[1]], &#xA;      calendar -&amp;gt; &amp;quot;djubs&amp;quot;, offset -&amp;gt; 0, rolloverRule -&amp;gt; &amp;quot;djubs&amp;quot;], &#xA;     dateList], {i, 1, Length[preppedCIMs]}]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;So you have an idea of the components, here's the list of contracts involved&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;{{&amp;quot;Aluminum&amp;quot;, &amp;quot;LAN2 Comdty&amp;quot;}, {&amp;quot;Brent Crude&amp;quot;, &#xA;  &amp;quot;COU2 Comdty&amp;quot;}, {&amp;quot;Coffee&amp;quot;, &amp;quot;KCN2 Comdty&amp;quot;}, {&amp;quot;Copper&amp;quot;, &#xA;  &amp;quot;HGN2 Comdty&amp;quot;}, {&amp;quot;Corn&amp;quot;, &amp;quot;C N2 Comdty&amp;quot;}, {&amp;quot;Cotton&amp;quot;, &#xA;  &amp;quot;CTN2 Comdty&amp;quot;}, {&amp;quot;Gold&amp;quot;, &amp;quot;GCQ2 Comdty&amp;quot;}, {&amp;quot;Heating Oil&amp;quot;, &#xA;  &amp;quot;HON2 Comdty&amp;quot;}, {&amp;quot;Lean Hogs&amp;quot;, &amp;quot;LHN2 Comdty&amp;quot;}, {&amp;quot;Live Cattle&amp;quot;, &#xA;  &amp;quot;LCQ2 Comdty&amp;quot;}, {&amp;quot;Natural Gas&amp;quot;, &amp;quot;NGN2 Comdty&amp;quot;}, {&amp;quot;Nickel&amp;quot;, &#xA;  &amp;quot;LNN2 Comdty&amp;quot;}, {&amp;quot;Silver&amp;quot;, &amp;quot;SIN2 Comdty&amp;quot;}, {&amp;quot;Soybean Oil&amp;quot;, &#xA;  &amp;quot;BON2 Comdty&amp;quot;}, {&amp;quot;Soybeans&amp;quot;, &amp;quot;S N2 Comdty&amp;quot;}, {&amp;quot;Sugar&amp;quot;, &#xA;  &amp;quot;SBN2 Comdty&amp;quot;}, {&amp;quot;Unleaded Gasoline (RBOB)&amp;quot;, &#xA;  &amp;quot;XBN2 Comdty&amp;quot;}, {&amp;quot;Wheat&amp;quot;, &amp;quot;W N2 Comdty&amp;quot;}, {&amp;quot;WTI Crude&amp;quot;, &#xA;  &amp;quot;CLN2 Comdty&amp;quot;}, {&amp;quot;Zinc&amp;quot;, &amp;quot;LXN2 Comdty&amp;quot;}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Here's the list of USD multipliers&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;{{&amp;quot;Aluminum&amp;quot;, 1}, {&amp;quot;Brent Crude&amp;quot;, 1}, {&amp;quot;Coffee&amp;quot;, &#xA;    100}, {&amp;quot;Copper&amp;quot;, 100}, {&amp;quot;Corn&amp;quot;, 100}, {&amp;quot;Cotton&amp;quot;, 100}, {&amp;quot;Gold&amp;quot;, &#xA;    1}, {&amp;quot;Heating Oil&amp;quot;, 1}, {&amp;quot;Lean Hogs&amp;quot;, 100}, {&amp;quot;Live Cattle&amp;quot;, &#xA;    100}, {&amp;quot;Natural Gas&amp;quot;, 1}, {&amp;quot;Nickel&amp;quot;, 1}, {&amp;quot;Silver&amp;quot;, &#xA;    100}, {&amp;quot;Soybean Oil&amp;quot;, 100}, {&amp;quot;Soybeans&amp;quot;, 100}, {&amp;quot;Sugar&amp;quot;, &#xA;    100}, {&amp;quot;Unleaded Gasoline (RBOB)&amp;quot;, 1}, {&amp;quot;Wheat&amp;quot;, &#xA;    100}, {&amp;quot;WTI Crude&amp;quot;, 1}, {&amp;quot;Zinc&amp;quot;, 1}};&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;And here's the Commodity Index Multipliers&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;{{&amp;quot;Aluminum&amp;quot;, 0.12200124`}, {&amp;quot;Brent Crude&amp;quot;, &#xA;    2.01846373`}, {&amp;quot;Coffee&amp;quot;, 49.71828827`}, {&amp;quot;Copper&amp;quot;, &#xA;    88.13795172`}, {&amp;quot;Corn&amp;quot;, 44.42764359`}, {&amp;quot;Cotton&amp;quot;, &#xA;    89.42000933`}, {&amp;quot;Gold&amp;quot;, 0.25961493`}, {&amp;quot;Heating Oil&amp;quot;, &#xA;    48.39480046`}, {&amp;quot;Lean Hogs&amp;quot;, 107.9219512`}, {&amp;quot;Live Cattle&amp;quot;, &#xA;    129.4759932`}, {&amp;quot;Natural Gas&amp;quot;, 148.9289604`}, {&amp;quot;Nickel&amp;quot;, &#xA;    0.00589452`}, {&amp;quot;Silver&amp;quot;, 4.1377227`}, {&amp;quot;Soybean Oil&amp;quot;, &#xA;    282.7408585`}, {&amp;quot;Soybeans&amp;quot;, 25.37581892`}, {&amp;quot;Sugar&amp;quot;, &#xA;    691.6310707`}, {&amp;quot;Unleaded Gasoline (RBOB)&amp;quot;, &#xA;    52.80986115`}, {&amp;quot;Wheat&amp;quot;, 34.03893139`}, {&amp;quot;WTI Crude&amp;quot;, &#xA;    4.07921265`}, {&amp;quot;Zinc&amp;quot;, 0.07223231`}};&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;For a simple test, take the commodity prices on 5/15 and 5/16 of this year&lt;/p&gt;&#xA;&lt;p&gt;5/15 prices&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;{{&amp;quot;Aluminum&amp;quot;, 2013.}, {&amp;quot;Brent Crude&amp;quot;, 111.45}, {&amp;quot;Coffee&amp;quot;, &#xA;  178.4}, {&amp;quot;Copper&amp;quot;, 351.75}, {&amp;quot;Corn&amp;quot;, 597.25}, {&amp;quot;Cotton&amp;quot;, &#xA;  79.16}, {&amp;quot;Gold&amp;quot;, 1557.1}, {&amp;quot;Heating Oil&amp;quot;, 293.86}, {&amp;quot;Lean Hogs&amp;quot;, &#xA;  86.4}, {&amp;quot;Live Cattle&amp;quot;, 116.425}, {&amp;quot;Natural Gas&amp;quot;, 2.568}, {&amp;quot;Nickel&amp;quot;, &#xA;  16977.}, {&amp;quot;Silver&amp;quot;, 28.08}, {&amp;quot;Soybean Oil&amp;quot;, 51.47}, {&amp;quot;Soybeans&amp;quot;, &#xA;  1413.}, {&amp;quot;Sugar&amp;quot;, 20.4}, {&amp;quot;Unleaded Gasoline (RBOB)&amp;quot;, &#xA;  289.16}, {&amp;quot;Wheat&amp;quot;, 608.5}, {&amp;quot;WTI Crude&amp;quot;, 94.35}, {&amp;quot;Zinc&amp;quot;, 1931.75}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;5/16 prices&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;{{&amp;quot;Aluminum&amp;quot;, 2023.}, {&amp;quot;Brent Crude&amp;quot;, 109.75}, {&amp;quot;Coffee&amp;quot;, &#xA;  178.}, {&amp;quot;Copper&amp;quot;, 347.8}, {&amp;quot;Corn&amp;quot;, 620.}, {&amp;quot;Cotton&amp;quot;, &#xA;  76.97}, {&amp;quot;Gold&amp;quot;, 1536.6}, {&amp;quot;Heating Oil&amp;quot;, 290.39}, {&amp;quot;Lean Hogs&amp;quot;, &#xA;  86.5}, {&amp;quot;Live Cattle&amp;quot;, 116.875}, {&amp;quot;Natural Gas&amp;quot;, 2.687}, {&amp;quot;Nickel&amp;quot;, &#xA;  16985.}, {&amp;quot;Silver&amp;quot;, 27.196}, {&amp;quot;Soybean Oil&amp;quot;, 50.43}, {&amp;quot;Soybeans&amp;quot;, &#xA;  1422.}, {&amp;quot;Sugar&amp;quot;, 20.73}, {&amp;quot;Unleaded Gasoline (RBOB)&amp;quot;, &#xA;  286.51}, {&amp;quot;Wheat&amp;quot;, 638.75}, {&amp;quot;WTI Crude&amp;quot;, 93.19}, {&amp;quot;Zinc&amp;quot;, 1895.75}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;The index change as published by DJUBS from June 15 to Jun 16 was +.328% but using my methodology I get -.866%.&lt;/p&gt;&#xA;" OwnerUserId="2491" LastEditorUserId="48272" LastEditDate="2020-08-19T21:35:50.273" LastActivityDate="2020-08-20T00:12:16.843" Title="generating (or tracking) the DJUBS commodity index" Tags="&lt;index&gt;&lt;commodities&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="3557" PostTypeId="2" ParentId="3551" CreationDate="2012-05-29T20:54:27.030" Score="11" Body="&lt;p&gt;First, we are few quants and academics to use the full toolkit of machine learning: stochastic algorithms, to optimal trading. Here are at least two papers:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://arxiv.org/abs/1112.2397&quot; rel=&quot;nofollow noreferrer&quot;&gt;Optimal split of orders across liquidity pools: a stochastic algorithm approach, Sophie Laruelle (PMA), Charles-Albert Lehalle, Gilles Pagès (PMA)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://arxiv.org/abs/0910.1166&quot; rel=&quot;nofollow noreferrer&quot;&gt;Optimal posting distance of limit orders: a stochastic algorithm approach, Sophie Laruelle (LPMA), Charles-Albert Lehalle, Gilles Pagès (LPMA)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Kearns and his co-authors are also providing a lot of useful research (see &lt;a href=&quot;https://dl.acm.org/doi/10.1145/1143844.1143929&quot; rel=&quot;nofollow noreferrer&quot;&gt;Reinforcement learning for optimized trade execution&lt;/a&gt;).&lt;/p&gt;&#xA;&lt;p&gt;Our approach is not only to try some machine learning techniques, but also to use the powerful mathematical tools that allowed to show their efficiency to prove that some algorithms are converging to optimal solutions.&lt;/p&gt;&#xA;&lt;p&gt;More quantitatively, most of machine learning come from a on-line gradient descent on a given criteria, giving birth to a stochastic gradient descent. The stochasticity comes from this:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You want to minimize &lt;span class=&quot;math-container&quot;&gt;$\mathbb{E}||y-f_{\theta}(x)||^2$&lt;/span&gt; with respect to &lt;span class=&quot;math-container&quot;&gt;$\theta$&lt;/span&gt;&lt;/li&gt;&#xA;&lt;li&gt;If you build:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\theta(n+1)=\theta(n)-\gamma(n)\times \frac{\partial \mathbb{E}||y-f_{\theta}(x)||^2}{\partial\theta(n)}$$&lt;/span&gt;&lt;/li&gt;&#xA;&lt;li&gt;Then if it exists, &lt;span class=&quot;math-container&quot;&gt;$\theta(\infty)$&lt;/span&gt; is a potential minimum for the criteria define at step 1&lt;/li&gt;&#xA;&lt;li&gt;Now just build &lt;span class=&quot;math-container&quot;&gt;$\theta(n)$&lt;/span&gt; simultaneously with the observation of pairs &lt;span class=&quot;math-container&quot;&gt;$(x_n,y_n)$&lt;/span&gt;:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\theta(n+1)=\theta(n)-\gamma(n)\times \frac{\partial ||y_n-f_{\theta}(x_n)||^2}{\partial\theta(n)}$$&lt;/span&gt;&lt;/li&gt;&#xA;&lt;li&gt;Under some ergodicity conditions, the limit of this &lt;span class=&quot;math-container&quot;&gt;$\theta$&lt;/span&gt; will be the same than the previous (batch) one (you also need that &lt;span class=&quot;math-container&quot;&gt;$\sum_n \gamma(n)&amp;gt;\infty$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$\sum_n \gamma(n)^2&amp;lt;\infty$&lt;/span&gt;; it is the celebrated &lt;a href=&quot;http://projecteuclid.org/DPubS?service=UI&amp;amp;version=1.0&amp;amp;verb=Display&amp;amp;handle=euclid.aoms/1177729586&quot; rel=&quot;nofollow noreferrer&quot;&gt;Robbins-Monro&lt;/a&gt; theorem).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;It is really suited for algo trading, but you need to apply this approach not blindly to any stochastic process &lt;span class=&quot;math-container&quot;&gt;$(x_n,y_n)$&lt;/span&gt;, but to ergodic ones.&lt;/p&gt;&#xA;&lt;p&gt;Order flow relatively to the mid point seems to be more ergodic the the price itself, consequently it should be more efficient to use machine learning on intraday data rather than on daily ones.&lt;/p&gt;&#xA;&lt;p&gt;[UPDATE in Jan 2020]&#xA;I wanted to make an addition around two papers&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;in &lt;a href=&quot;https://arxiv.org/abs/1911.02319&quot; rel=&quot;nofollow noreferrer&quot;&gt;Improving reinforcement learning algorithms: towards optimal learning rate policies&lt;/a&gt;, by Mounjid and L, we show the role of the learning rate in reinforcement learning and provide two illustrations in optimal trading: (1) optimal trade scheduling and (2) optimal placement in an orderbook. It shows that if you build carefully your algorithm, it can find the optimum. Moreover, we make the difference between '&lt;em&gt;original&lt;/em&gt;' RL (when you really discover the dynamics you have to control while you attempt to control them), and something that is closer to the old '&lt;em&gt;policy-value iterations&lt;/em&gt;' of Howard (see for instance &lt;a href=&quot;https://core.ac.uk/download/pdf/82518914.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Dynamic programming, Markov chains, and the method of successive approximations&lt;/a&gt;, by DJ White in 1964!) when you have access to a simulator. In the latter case, the &lt;a href=&quot;https://en.wikipedia.org/wiki/Multi-armed_bandit&quot; rel=&quot;nofollow noreferrer&quot;&gt;exploration-exploitation&lt;/a&gt; aspect of the learning is not a big issue.&lt;/li&gt;&#xA;&lt;li&gt;in &lt;a href=&quot;https://arxiv.org/abs/2006.09611&quot; rel=&quot;nofollow noreferrer&quot;&gt;Learning a functional control for high-frequency finance&lt;/a&gt; by Leal, Laurière and L.&#xA;We provide another way to extend optimal control of trading to machine learning: '&lt;em&gt;simply&lt;/em&gt;' write the optimal scheduling problem (for instance over 70 intervals of 5 minutes) with a closed loop controller emulated by a neural network, and wait for the (simulated) end of the day to back propagate over the 70 uses of your neural controller. No need to go through an approximation of a Q-function. It is straightforward and can be easily compared to a non-learning approach.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2021-01-31T06:52:36.360" LastActivityDate="2021-01-31T06:52:36.360" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="3558" PostTypeId="1" CreationDate="2012-05-30T08:54:27.197" Score="9" ViewCount="10446" Body="&lt;p&gt;As the title says, I am looking for a real world example where a forward interest rate is negative. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Theoretically this is not a problem at all, if I look for a 3M forward interest rate that starts in 3 months from now I just solve for $r_F$ in the equation&#xA;$$\operatorname{df}(Date1,Date1+3M,r_{3M})\cdot \operatorname{df}(Date1+3M,Date1+6M,r_{F}) = $$ &#xA;$$\qquad \operatorname{df}(Date1,Date1+6M,r_{6M}) $$&#xA;where $r_{kM}$ is the $k$M-yield curve interest rate ($k=3,6$) and $\operatorname{df}$ is the discount factor. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would also be interesting to see a reference to a negative yield curve interest rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A well known example of negative &lt;em&gt;deposit&lt;/em&gt; rate is given on &lt;a href=&quot;http://en.wikipedia.org/wiki/Interest_rate#Negative_interest_rates&quot; rel=&quot;noreferrer&quot;&gt;Wikipedia&lt;/a&gt; (Swedish Riksbank had an interest of -0,25% in July 2009).&lt;/p&gt;&#xA;" OwnerUserId="2492" LastEditorUserId="467" LastEditDate="2012-06-10T17:40:27.800" LastActivityDate="2012-06-25T16:55:12.393" Title="What is a real world example of negative forward interest rate?" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;reference-request&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3559" PostTypeId="2" ParentId="3558" CreationDate="2012-05-30T11:40:41.060" Score="6" Body="&lt;p&gt;Forward interest rates are negative whenever the yield curve is negatively sloped. The US term structure was inverted most recently around 2007. Hard to find bank deposits that have negative yields (find countries experiencing deflation and you may find it), however, treasury bills during recent times of financial stress have yielded a negative rate. The Treasury is considering rules to allow for &lt;a href=&quot;http://www.bloomberg.com/news/2012-02-01/negative-treasury-bill-auction-yields-would-avoid-grab-a-thon-crt-says.html&quot;&gt;auctions that clear at negative rates&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2012-05-30T11:40:41.060" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3560" PostTypeId="2" ParentId="3543" CreationDate="2012-05-30T16:05:49.400" Score="2" Body="&lt;p&gt;Barber and Odean are pretty famous for doing exactly this type of research on individual investors.  Now, individual investors are obviously not representative of market participants, so if you are looking for a generally applicable answer to your question, or for an answer specific to institutions, this is not it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example of their research is &lt;a href=&quot;http://faculty.haas.berkeley.edu/odean/papers/MutualFunds/mfund.pdf&quot; rel=&quot;nofollow&quot;&gt;The Behavior of Mutual Fund Investors&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2012-05-30T16:05:49.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3561" PostTypeId="2" ParentId="1810" CreationDate="2012-05-30T17:54:31.650" Score="0" Body="&lt;p&gt;If the risk free rate is lower than inflation, basically you are loosing money and then the rate used is not risk free. Best solution for risk free rate is government bonds adjusted for inflation + inflation rate&lt;/p&gt;&#xA;" OwnerUserId="2495" LastActivityDate="2012-05-30T17:54:31.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3562" PostTypeId="1" CreationDate="2012-05-31T10:43:12.103" Score="23" ViewCount="3114" Body="&lt;p&gt;I'm looking for concrete examples where a Finite Element method (FEM) provides a considerable advantages (e.g. in convergence rate, accuracy, stability, etc.) over the Finite Difference method (FDM) in option pricing and/or calculating sensitivities. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that in general Finite Element is more powerful numerical method for solving PDE's (e.g. it allows to work on complex geometries), but I'm specifically interested if we can fully utilize it for option pricing. I've skimmed through the book &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0471486906&quot;&gt;Financial Engineering with Finite Elements&lt;/a&gt;, but it  only states some general considerations about benefits of FEM in the introductory section, without going into details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I'm aware about only one case, when FEM outperforms FDM in convergence rate, namely in pricing under a Variance gamma model. But this advantage can be neglected by introducing certain enhancements in the FDM.&lt;/p&gt;&#xA;" OwnerUserId="370" LastEditorUserId="848" LastEditDate="2012-05-31T20:51:16.943" LastActivityDate="2013-10-03T03:34:48.630" Title="When do Finite Element method provide considerable advantage over Finite Differences for option pricing?" Tags="&lt;option-pricing&gt;&lt;numerical-methods&gt;&lt;greeks&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="3564" PostTypeId="1" CreationDate="2012-05-31T18:05:49.793" Score="-2" ViewCount="733" Body="&lt;p&gt;I often see trading strategies and portfolio construction that are based on cross-sectional regression. For example, I often see regressing some numbers against some factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering how cross-sectional regression is used in these scenarios? And how does a cross-sectional regression have forecasting power?  And how is the goodness-of-fit of the regression related to the forecasting power?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been reading some portfolio management books but couldn't find the application of cross-sectional regression and the relation between the regression and the forecasting power.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anybody please shed some light for me?&lt;/p&gt;&#xA;" OwnerUserId="2231" LastEditorUserId="35" LastEditDate="2012-05-31T18:50:11.737" LastActivityDate="2012-05-31T18:50:11.737" Title="Trading Strategies and Portfolio Constructions based on Cross Sectional Regression?" Tags="&lt;quant-trading-strategies&gt;&lt;portfolio-management&gt;&lt;regression&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="2" ClosedDate="2012-06-01T11:51:23.907" ContentLicense="CC BY-SA 3.0" />
  <row Id="3565" PostTypeId="2" ParentId="3564" CreationDate="2012-05-31T18:48:53.787" Score="3" Body="&lt;p&gt;A cross-sectional linear factor model would regress the returns of the securities of interest on attributes that are believed to be priced in. For instance, in period 1, you could regress the return of all the S&amp;amp;P500 stocks against their book-to-market ratios and market capitalizations. It may be appropriate to scale the independent variables to be like Z-scores. The coefficients to these regressions would be like the returns to value (book-to-market) and size (market capitalization) factors. You might also want to look into Fama-Macbeth regressions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The purpose is not necessarily forecasting as much as it is to understand what drives the returns and risk of the securities. It would still be possible to gather the returns to the factors and perform some sort of time series analysis to determine what their distribution will be in the future.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2012-05-31T18:48:53.787" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3568" PostTypeId="2" ParentId="3484" CreationDate="2012-06-01T03:23:41.890" Score="2" Body="&lt;p&gt;No, exercising an out-of-the money option is never worth it.  In your scenario, you should start buying at \$10.  Keep buying until you push the ask up to \$10.09, then exercise however many options it takes you to get to 10,000 shares.  This will get you your 10,000 shares at a lower cost than simply buying them all for $10.08 through exercising your options.&lt;/p&gt;&#xA;" OwnerUserId="2502" LastActivityDate="2012-06-01T03:23:41.890" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3569" PostTypeId="2" ParentId="3562" CreationDate="2012-06-01T13:06:48.847" Score="0" Body="&lt;p&gt;I have no personal experience comparing the two methods. However, I have heard that FEM might be preferable to FDM in connection with degenerate PDEs such as the ones that occur in the Hobson-Rogers model.&lt;/p&gt;&#xA;" OwnerUserId="2376" LastActivityDate="2012-06-01T13:06:48.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3570" PostTypeId="2" ParentId="344" CreationDate="2012-06-01T13:35:43.623" Score="5" Body="&lt;p&gt;First we must define what we mean by implied volatility. Let $c_{BS}(t,S(t),K,T;\sigma)$ denote the price of the call option with strike price $K$ and maturity $T$ in the Black-Scholes model with the volatility $\sigma$ (emphasized in the argument). Furthermore, let $c_{MA}(t,S(t),K,T;\sigma)$ denote the corresponding price on the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The volatility $\sigma_{imp}$ is defined by the specific volatility for which $$c_{BS}(t,S(t),K,T;\sigma) = c_{MA}(t,S(t),K,T)$$&#xA;for some fixed $t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This implied volatility is very much dependent on the strike price $K$ (which is quite intuitive). It is a well known phenomenon on the market that the maps $K \longmapsto \sigma_{imp}(K)$ have a so called smiley or skewed shape.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By smiley shape we mean that $\sigma_{imp}(K)$ has a convex shape with high values for both small and large values of $K$ and a minimum around the forward price $Se^{rt}$. This smiley phenomenon is very common in connection with options on currencies, but not so common for options on stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In connection to stocks we often observe a so called skewed shape of the maps $K \longmapsto \sigma_{imp}(K)$. Meaning that the implied volatility is high for low strikes and not as high for high strikes. It doesn't even have to have a minimum around the forward price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is an example of a so called smiley shape:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/TR046.png&quot; alt=&quot;Smiley shape&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is an example of a so called skewed shape:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/qHr0v.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2376" LastEditorUserId="2376" LastEditDate="2012-06-02T15:30:39.803" LastActivityDate="2012-06-02T15:30:39.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3571" PostTypeId="2" ParentId="3484" CreationDate="2012-06-01T13:40:30.083" Score="1" Body="&lt;p&gt;Another consideration here is whether the option is settled in cash or the security. For example S&amp;amp;P100 options listed on the CBOE are &lt;a href=&quot;http://www.cboe.com/micro/oex/faq.aspx&quot; rel=&quot;nofollow&quot;&gt;cash-settled&lt;/a&gt; which means that you will receive the cash difference between the strike and the price, and not the underlying security. In this case, there is clearly no benefit to exercising when the underlying is out-of-the-money.&lt;/p&gt;&#xA;" OwnerUserId="2485" LastActivityDate="2012-06-01T13:40:30.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3573" PostTypeId="1" AcceptedAnswerId="3574" CreationDate="2012-06-03T10:26:42.517" Score="16" ViewCount="2155" Body="&lt;p&gt;I am simulating a market for my trading system. I have no ask-bid prices in my dataset and use adjusted close for both buy and sell price. To account for this I plan to use a relative transaction cost. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is how large such a relative transaction cost should be to be realistic? &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;I trade stocks only from Dow Jones Industrial average (read that it might be around 0.2% in this &lt;a href=&quot;http://kvenkataraman.cox.smu.edu/papers/BVEQF.pdf&quot;&gt;paper&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I trade only on day-to-day (no intraday) thus I can assume to buy at close prices (adjusted close?)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I simulate trades in the time period 2000-2012&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;By transaction cost I am interested in any cost related to a real trade, e.g., brokerage fee, spread, slippage (thanks @chrisaycock)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1247" LastEditorUserId="1106" LastEditDate="2012-06-14T13:40:15.153" LastActivityDate="2012-10-31T11:10:00.367" Title="How to account for transaction costs in a simulated market environment?" Tags="&lt;automated-trading&gt;&lt;backtesting&gt;&lt;simulations&gt;&lt;implementation-shortfall&gt;&lt;transaction-costs&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3574" PostTypeId="2" ParentId="3573" CreationDate="2012-06-03T15:59:12.643" Score="9" Body="&lt;p&gt;We cannot give you a relative bid-ask spread that would make sense. The reason for that is that it really depends on several parameters:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The type of financial asset you invest in (futures, funds, index, options, ...)&lt;/li&gt;&#xA;&lt;li&gt;The period during which you're trading (I think the liquidity in markets hasn't been the same over time).&lt;/li&gt;&#xA;&lt;li&gt;If you trade intraday, it depends on the time you trade at.&lt;/li&gt;&#xA;&lt;li&gt;If you assume you trade close price, you would submit MOC (market on close) orders. Your broker is most likely to be able to sometimes execute your orders at a better price than the close, and sometimes the opposite. I think that some brokers will have some terms that allow you to make sure that your trade will be exactly the close price, I've seen this for some commodity futures.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Finally, bid-ask spreads are not transaction cost per-say; they are the market price of liquidity in a sense. Your transaction costs would be more a fee that is charged by the broker for executing the order. It depends more on the quantity you trade and the terms you manage to negotiate with your broker.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2012-06-03T15:59:12.643" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3575" PostTypeId="2" ParentId="3024" CreationDate="2012-06-03T19:54:59.520" Score="1" Body="&lt;p&gt;The OpenGamma platform (&lt;a href=&quot;http://www.opengamma.com&quot; rel=&quot;nofollow&quot;&gt;www.opengamma.com&lt;/a&gt;) is probably the most comprehensive trading and risk analytics offer in the open source world. It supports the interest rate, forex and equity products you mentioned. It contains also a strong quantitative finance library.&lt;/p&gt;&#xA;" OwnerUserId="2513" LastActivityDate="2012-06-03T19:54:59.520" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3576" PostTypeId="1" CreationDate="2012-06-04T09:57:58.890" Score="7" ViewCount="1931" Body="&lt;p&gt;We're developing an HFT strategy for highly liquid futures traded at Eurex. We are planning to colocate our server and to use data feed of QuantHouse and execution API of ObjectTrading. Backtesting is performed on tick data bought from QuantHouse, where timestamps have millisecond resolution (BTW, trades and quotes are sorted separately, so if trades and quotes have a same timestamp, they are not sorted). My question is about latency we should use for backtesting. I define latency as:&#xA;data feed latency + internal processing time (several microseconds) + execution latency.&#xA;We simulate this by adding X ms to the feed time (T) of the tick that triggered the trade, then if the last tick with the feed time not later than T + X was a quote we use its book for execution, otherwise (if the last tick with the feed time not later than T + X was a trade) we wait for an incoming quote and its book is used for execution.&#xA;So my questions are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is our execution model reasonable?&lt;/li&gt;&#xA;&lt;li&gt;What X should be used for our setup?&lt;/li&gt;&#xA;&lt;li&gt;Could you suggest other (not too expensive) setup in order to reduce any kind of latency?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2514" LastEditorUserId="467" LastEditDate="2012-06-10T17:43:15.300" LastActivityDate="2019-07-16T13:52:03.157" Title="What latency should I use for backtesting a high-frequency strategy?" Tags="&lt;backtesting&gt;&lt;high-frequency&gt;&lt;latency&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3577" PostTypeId="1" CreationDate="2012-06-04T14:42:59.350" Score="7" ViewCount="1829" Body="&lt;p&gt;I'm looking for a commercial delayed quote feed that will allow us to distribute delayed US stock market quotes to the public (ie. that will allow us to display US delayed quotes on the Internet).  We are only interested in stocks listed on the NYSE, AMEX, and NASDAQ. The best that I could find were Xignite and BarChartMarketData.  Virtually all other companies that I found only supply data for individual use or use inside a company, but not for the public.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We are targeting delayed data because the redistribution fees the stock exchanges charge us are cheaper for delayed US market data: &lt;a href=&quot;http://www.barchartmarketdata.com/solutions_datafeed_exchfees.php&quot;&gt;http://www.barchartmarketdata.com/solutions_datafeed_exchfees.php&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BATS is not an option for us because my boss wants data from NYSE, AMEX, and NASDAQ.  Yahoo and Google Finance data are not an option either because that data cannot be redistributed to the public.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've already read several stackexchange questions on this but neither have answers to a commerical delayed market data feed that can be redistributed.  Are Xignite and BarChartMarketData the only options out there?  Who else has a website or application that is display delayed quotes and which vendor are you using?&lt;/p&gt;&#xA;" OwnerUserId="2517" LastActivityDate="2012-09-11T11:02:54.470" Title="Commerical delayed stock quote feed that is redistributable?" Tags="&lt;equities&gt;&lt;quote&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3578" PostTypeId="2" ParentId="3576" CreationDate="2012-06-05T21:57:07.070" Score="4" Body="&lt;p&gt;First the kind of strategy you plan to implement is of importance:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it is &lt;strong&gt;scaling&lt;/strong&gt; (arbitraging spread crosses: buy at one ask one one venue that is cheaper than one bid in another venue), the kind of approach you plan to use is rational. Nevertheless you should take into account:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the fact that the latency is somehow not deterministic, use a Poisson process for the duration between two messages,&lt;/li&gt;&#xA;&lt;li&gt;the latency is not the same at any time during the day, more or less proportional to the activity (U shaped in the US, with an increase when NY is open in Europe).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If it is a &lt;strong&gt;stat arb&lt;/strong&gt; based strategy, your PnL should not be too sensitive tonthe ordering of the messages. Instead of adding latency, you should backtest with local perturbations on the order of the messages (with for instance a radius of 1 to 10 messages). &lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2012-06-09T06:16:19.343" LastActivityDate="2012-06-09T06:16:19.343" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3579" PostTypeId="2" ParentId="529" CreationDate="2012-06-07T03:55:20.177" Score="-2" Body="&lt;p&gt;The upper bound on BC correlation would be 1 for the example given.  B=C would correlate to 1.  If AB and Ac are different, I don't know off the top of my head.&lt;/p&gt;&#xA;" OwnerUserId="2522" LastActivityDate="2012-06-07T03:55:20.177" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3580" PostTypeId="1" AcceptedAnswerId="3923" CreationDate="2012-06-07T14:26:01.233" Score="16" ViewCount="12948" Body="&lt;p&gt;What is the best/cheapest service to get real-time (as real-time as you can get) on stock options?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for the fastest update on the ENTIRE market, with a few stocks prioritized, so I need the data to come in as fast as my internet connection will let it.&#xA;The API can be in any language, although I would prefer C++.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, a trial service would be great.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently, I am looking at &lt;a href=&quot;http://www.iqfeed.net/index.cfm?displayaction=data&amp;amp;section=services&quot;&gt;IQFeed&lt;/a&gt; which seems to be exactly what I am looking for. It is cheap, has a free trial, gives out 1ms ticks and has a C++ API. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any other options like this one?&lt;/p&gt;&#xA;" OwnerUserId="2524" LastEditorUserId="467" LastEditDate="2012-06-10T17:37:45.857" LastActivityDate="2012-08-08T14:48:08.637" Title="What is the best live options data API?" Tags="&lt;options&gt;&lt;programming&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="3584" PostTypeId="2" ParentId="3078" CreationDate="2012-06-08T14:08:13.533" Score="3" Body="&lt;p&gt;dxFeed does offer level 2 historical data on demand. You can try it out for free. For example, to see how all market makers pulled out their quotes on ACN (Accenture) during May 6, 2010 Flash Crash go to the following URL: &lt;a href=&quot;http://demo.dxfeed.com:7070/onDemand/data?categories=E-M&amp;amp;symbols=ACN&amp;amp;start=20100506-1447&amp;amp;end=20100506-1449&quot; rel=&quot;nofollow&quot;&gt;http://demo.dxfeed.com:7070/onDemand/data?categories=E-M&amp;amp;symbols=ACN&amp;amp;start=20100506-1447&amp;amp;end=20100506-1449&lt;/a&gt; and use demo/demo when prompted to login. Add &quot;&amp;amp;format=csv&quot; at the end to download the data in Excel-friendly comma-separated values format. Demo access it limited to this particular day and to 1 second conflation interval.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unless you host your own servers close to exchange and engage in nanosecond-level HFT, you don't have to build your own data warehouse. You can request the data you need from a vendor with adequate precision even for strategies on millisecond scale.&lt;/p&gt;&#xA;" OwnerUserId="2530" LastActivityDate="2012-06-08T14:08:13.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3585" PostTypeId="2" ParentId="3573" CreationDate="2012-06-08T14:50:41.850" Score="4" Body="&lt;p&gt;When I simulate, I can usually narrow my trades down to the minute.  So I set my Open price at the HIGHEST price for the minute, and my close price to the LOWEST price for the minute.&#xA;The goals is to be as conservative as possible.  You don't want to go live and find that you were too optimistic in your fills.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you cannot narrow it down to smaller than a day, then your open should be at the highest price of the day, and the close at the lowest price of the day.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like I stated above, simulating should be as conservative as possible.  As there will be enough real-time surprises when you start trading live.&lt;/p&gt;&#xA;" OwnerUserId="2532" LastEditorUserId="1247" LastEditDate="2012-06-10T07:40:53.327" LastActivityDate="2012-06-10T07:40:53.327" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3587" PostTypeId="1" CreationDate="2012-06-03T15:57:09.277" Score="7" ViewCount="290" Body="&lt;p&gt;I defined such a model for stock price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1)....&#xA;$$dS = \mu\ S\ dt + \sigma\ S\ dW + \rho\ S(dH - \mu)  $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;, where $H$ is a so-called &quot;resettable poisson process&quot; defined as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2)....&#xA;$$dH(t) = dN_{\lambda}(t) - H(t-)dN_{\eta}(t) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;, and $\mu := \frac{\lambda}{\eta}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to derive some analytic results similar to Black-Scholes equation (3)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(3)....&#xA;$$ \frac{\partial V}{\partial t} + r\ S \frac{\partial V}{\partial S} + \frac{\sigma^2S^2}{2}\frac{\partial^2 V}{\partial S^2} - r\ V = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even better, could we derive something similar to Black-Scholes formula for call/put option prices?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried but failed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In classic GBM model, to get Black-Scholes euqation (3), the essential steps are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By Ito's lemma,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(4)...&#xA;$$df = (f_x+\mu f_x+\sigma^2/2\cdot f_{xx})dt + \sigma f_x dW$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on GBM stock price model (5),&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(5)... $$ds = \mu S dt + \sigma S dW$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(6)....&#xA;$$dV = \left( \frac{\partial V}{\partial t} +\mu S \frac{\partial V}{\partial S}+\frac{\sigma^2 S^2}{2}\frac{\partial^2 V}{\partial S^2}\right)dt + \sigma S \frac{\partial V}{\partial S}dW$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Putting (5) in (6) again we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(7)....&#xA;$$dV - \sigma S \frac{\partial V}{\partial S}dS = \left( \frac{\partial V}{\partial t}  +\frac{\sigma^2 S^2}{2}\frac{\partial^2 V}{\partial S^2}\right)dt $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then we can define &#xA;(8)...&#xA;$$\Pi = V - \frac{\partial V}{\partial S} S$$&#xA;, so the LHS of (7) is just $d\Pi$ and it's not related to any random effect, so we have &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(9)...&#xA;$$d\Pi = r \Pi dt$$&#xA;then we get (3).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After I introduce the &quot;resettable Poisson process&quot; $H_{\lambda, \eta}(t)$ in the model, I couldn't find a way to cancel both the $dW$ and $dN$....&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you know how to solve this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions are appreciated, I'm stuck here...&lt;/p&gt;&#xA;" OwnerUserId="2161" OwnerDisplayName="athos" LastEditorUserId="467" LastEditDate="2012-06-08T22:53:25.087" LastActivityDate="2014-08-31T02:10:30.547" Title="How to get an analytic result for option price based on this model?" Tags="&lt;differential-equations&gt;&lt;stochastic-processes&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3590" PostTypeId="2" ParentId="3386" CreationDate="2012-06-09T05:36:13.590" Score="4" Body="&lt;p&gt;You question is quite strange: so you do not want to use methods inspired by bioinfo and genetics (neural networks, GA, geometry of folding, etc) but methods that are used in these fields?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of modeling, the problematics in bioinfo and genetics are mainly:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;tree or graph matching (to build metrics in the space of molecules), like in &lt;a href=&quot;http://www.citeulike.org/user/lehalle/article/10772996&quot; rel=&quot;nofollow&quot;&gt;SIGMA: a Set-cover-based Inexact Graph Matching Algorithm, by: Misael Mongiovi, Raffaele Di Natale, Rosalba Giugno, Alfredo Pulvirenti, Alfredo Ferro, Roded Sharan, Journal of Bioinformatics and Computational Biology, Vol. 8, No. 2. (2010), pp. 199-218&lt;/a&gt; &lt;/li&gt;&#xA;&lt;li&gt;fitting of dynamical systems (to identify the dynamics of chemical transformations), like in &lt;a href=&quot;http://www.citeulike.org/user/lehalle/article/2791501&quot; rel=&quot;nofollow&quot;&gt;Modeling in biological chemistry. From biochemical kinetics to systems biology, by: Peter Schuster, Monatshefte für Chemie / Chemical Monthly, Vol. 139, No. 4. (1 April 2008), pp. 427-446&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;prediction in discrete state space (to associate the formula of a molecule, to one of its properties), like in &lt;a href=&quot;http://www.citeulike.org/user/lehalle/article/5787765&quot; rel=&quot;nofollow&quot;&gt;Molecular Modeling Of Proteins And Mathematical Prediction Of Protein Structure, by: Arnold Neumaier, In SIAM Review, Vol. 39 (1997), pp. 407-460&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;It is close to &lt;em&gt;usual&lt;/em&gt; data mining, statistical or applied math problematics, so the main differences are heuristics, to take into account some specificities of the problems to avoid some local minima or increase the convergence rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think that you not find anything &lt;em&gt;new&lt;/em&gt; as you think to expect. It would be more efficient for you to identify your problems precisely, for instance trying to put each of them in one of these jars:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;continuous optimization&lt;/li&gt;&#xA;&lt;li&gt;discrete optimization (the state space has no obvious metric)&lt;/li&gt;&#xA;&lt;li&gt;estimation in presence of uncertainty&lt;/li&gt;&#xA;&lt;li&gt;continuous prediction (including backward and forward PDE problems, ARMA, GARCH, etc)&lt;/li&gt;&#xA;&lt;li&gt;identification of outliers&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Then review the classical methods (remind that even in &lt;a href=&quot;http://www.citeulike.org/user/lehalle/article/10773024&quot; rel=&quot;nofollow&quot;&gt;Der Mann Ohne Eigenschaften, by: Robert Musil (1930)&lt;/a&gt;, you have clear descriptions by &lt;em&gt;Ulrich&lt;/em&gt; of his day-to-day job as a mathematician, you have descriptions of such modelings, so &lt;strong&gt;nothing is really new in all this&lt;/strong&gt;), and try to develop heuristics adapted to the specificities of &lt;strong&gt;your real situations&lt;/strong&gt;. My opinion that it is better to know very well the theoretical pitfalls and essential points of the methods to develop adapted heuristics rather than to read about heuristics developed for other fields.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2012-06-12T04:59:11.080" LastActivityDate="2012-06-12T04:59:11.080" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3591" PostTypeId="1" AcceptedAnswerId="3592" CreationDate="2012-06-09T15:35:07.633" Score="12" ViewCount="1580" Body="&lt;p&gt;I am hoping any answers can be threaded somewhere between &quot;don't be naive&quot; and starting a quasi-political flame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Transparency is suppose to be good for markets and also a social good.  The market reflecting the availability of all known information is a premise accepted by many.  Why then is the disparity between access to available information based on what a market participant can afford so widely and readily accepted?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I acknowledge that there is some cost involved in transmitting real-time data, order flow, etc., for instance, but how significant is it?  Is it impractical technically or financially when it is amortized over all market players?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Less controversial, why is tick data, etc., not made available free to the public at the end of day?  Why is this any more proprietary or the property of a market than the outcome of a baseball game?  If by making it freely available data brokers have less incentive to store data why not make that the responsibility of the regulatory agencies (e.g. SEC or whatnot)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there technical or other reasons, aside from powerful financial incentives, to keep things the way they are?&lt;/p&gt;&#xA;" OwnerUserId="2478" LastActivityDate="2012-06-10T14:09:10.517" Title="Why isn't all market data free?" Tags="&lt;data&gt;&lt;market-data&gt;" AnswerCount="3" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3592" PostTypeId="2" ParentId="3591" CreationDate="2012-06-09T20:18:20.343" Score="4" Body="&lt;p&gt;On the paper you are right: the market data are close to a &lt;em&gt;public good&lt;/em&gt; and could be free because of that. Nevertheless in a fragmented landscape, each trading venue is contributing specifically to the price formation process. Each of them invest that for, and it is thus not unfair to get revenue that for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you look at Europe (I am not speaking here about the Reg NMS-driven context for the US), only the historical markets actual ask revenue for their market data. BATS Europe announced that it will ask for fees soon. Nevertheless in the MiFID review actually under scrutiny in Europe, a consolidated post trade tape (i.e. of trades) will have to be free after 15 minutes. It seems to be a good balance. But pre trade data (i.e. orderbooks) are not in the scope of this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may know that if the US has a pre trade consolidated tape (in fact three tapes A, B and C), in Europe it is not the case. MiFID could not structure the market microstructure that way because of the numerous clearing and settlement prices across Europe, where you have only one in the US. Consequently if you see a best price in the orderbooks in US: it is your best price for sure. In Europe it is not 100% sure because for a buyer the best ask can be cheaper on NYSE-EuroNext than on BATS-Chi-X, but after considering the clearing and settlement prices, it could be no more the case.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2012-06-10T08:03:57.280" LastActivityDate="2012-06-10T08:03:57.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3593" PostTypeId="1" AcceptedAnswerId="3594" CreationDate="2012-06-09T21:10:56.923" Score="7" ViewCount="2155" Body="&lt;p&gt;I have a pair trading strategy with positions that last 3-5 days and trades 2-3 times a month. By design, all the trades are profitable until the cointegration is broken.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Should I calculate the Sharpe ratio with daily or monthly returns?&lt;/strong&gt; (annualizing afterwards in each case)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With monthly returns, most positions will be closed so I will have mostly profits (and maybe a loss if there's an open position at the end of the month).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With daily returns, I will have partial profit and losses each day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I haven't done the calculations yet, but seems to me that the annualized Sharpe ratio of the monthly returns will be higher than the one with the daily returns, even with the difference of the annualization factors $\sqrt{12}$, $\sqrt{252}$ respectively.&lt;/p&gt;&#xA;" OwnerUserId="2257" LastEditorUserId="467" LastEditDate="2012-06-10T17:33:49.607" LastActivityDate="2020-02-14T04:57:10.673" Title="How should I compute the Sharpe Ratio for mid-frequency pair trading strategy?" Tags="&lt;pairs-trading&gt;&lt;sharpe-ratio&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3594" PostTypeId="2" ParentId="3593" CreationDate="2012-06-10T05:28:22.183" Score="6" Body="&lt;p&gt;Sharpe should only be computed from daily returns because finer granularity leads to a larger sample size. The larger sample makes the standard deviation metric more accurate. As a counter-example, how reliable would the Sharpe be using yearly returns?&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2012-06-10T05:28:22.183" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3595" PostTypeId="2" ParentId="3593" CreationDate="2012-06-10T11:34:58.430" Score="2" Body="&lt;p&gt;I think that it is better to look at t-stat than at the Sharpe Ration itself with data using different frequencies (thus different df) in order to determine which Sharpe Ratio stat is more accurate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The calculation can be found in this paper: &lt;a href=&quot;https://alo.mit.edu/wp-content/uploads/2017/06/The-Statistics-of-Sharpe-Ratios.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Statistics of Sharpe Ratios&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="909" LastEditorUserId="909" LastEditDate="2020-02-14T04:57:10.673" LastActivityDate="2020-02-14T04:57:10.673" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="3597" PostTypeId="2" ParentId="3591" CreationDate="2012-06-10T14:03:31.773" Score="6" Body="&lt;p&gt;I think Lehalle answer is very good but I would like to answer in a slightly different manner, maybe from an economical point of view.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the real question is &lt;em&gt;What are market data fees charged for?&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume the whole data was available to anybody for free, then nobody would be willing to pay for it. There are essentially two main reasons why the data costs something:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The data itself is the property of someone and is not available for free (limited supply resulting in monopolistic environment).&lt;/li&gt;&#xA;&lt;li&gt;If the raw data was publicly available then you would have to identify the added value from a provider for which you are required to pay a fee.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;1) Data availability&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Market data is provided by exchanges, it's not there for anybody to observe. If there were no exchange, there would be no real single price for a security. So the exchange is providing a service allowing investor to trade at some centralized price. They basically own this data in a sense. You could try setting up an exchange providing live data for free, but you would see that it costs money (from an infrastructure point of view) so you need to generate money from all possible sources to make it interesting to have an exchange. You could arguably remove market data fees but you would increase transactions costs or some subscription fee to be able to participate to the exchange. So basically, you want to use the service offered by the exchange (which includes market data) and you hence pay for that service.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2) Added value&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is some added value to the raw data of an exchange. Essentially, the provider will apply filters to the data thus removing possible misprints to make sure that the data is actually correct. Besides, the data has to be collected and stored using some IT infrastructure which you have to pay for. This is particularly important for tick data and you can see pretty quickly that you wouldn't be able to manage live ticks if you do not have yourself a huge IT department ready to handle this. You also pay for the way data is delivered to you; setting up a real-time push service to deliver data does cost money.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, you actually pay for the services of the data providers and because setting up an exchange would not be possible without charging fees (you pay the existence of the exchange).&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2012-06-10T14:03:31.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3598" PostTypeId="2" ParentId="3591" CreationDate="2012-06-10T14:09:10.517" Score="3" Body="&lt;p&gt;Exchanges are becoming increasingly for profit enterprises and cost of technology and infrastructure to support the vast amount of data generated needs to be covered. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you look at the financials of NYSE you see data related services does not generate much revenue, perhaps just to cover the cost of providing the services though more detail analysis on this is needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So nominal fees to coves part of the technology costs is justifies and is needed in the business sense.&lt;/p&gt;&#xA;" OwnerUserId="909" LastActivityDate="2012-06-10T14:09:10.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3599" PostTypeId="1" AcceptedAnswerId="3621" CreationDate="2012-06-10T15:56:58.523" Score="8" ViewCount="4698" Body="&lt;p&gt;I have two backtesting algorithms:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;One that uses bid and ask prices for signal generation. For example: Buy when $ask &amp;lt; threshold_1 $ and sell when $bid &amp;gt; threshold_2$. Bid and ask prices are calculated from the closing price using a 20 basis-point spread.&lt;/li&gt;&#xA;&lt;li&gt;One that uses closing prices for signal generation. For example: Buy when $price &amp;lt; threshold_1$ and sell when $price &amp;gt; threshold_2$. The 20 basis-points bid-ask spread is taken as a transaction cost and subtracted from the P&amp;amp;L.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The two alternatives give me different results. I guess that the first backtesting algorithm is closer to reality, but the second (i.e. considering bid-ask spread as a transaction cost) is common among the literature.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the rationale of considering bid-ask spread as a transaction cost and which of the two alternatives should I use?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: I'm backtesting a mean-reverting pair-trading strategy of liquid ETFs.&lt;/p&gt;&#xA;" OwnerUserId="2257" LastEditorUserId="1106" LastEditDate="2012-06-14T13:36:59.883" LastActivityDate="2012-09-21T09:43:04.783" Title="How should I include the bid-ask spread as a transaction cost in a backtest?" Tags="&lt;quant-trading-strategies&gt;&lt;backtesting&gt;&lt;implementation-shortfall&gt;&lt;transaction-costs&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3600" PostTypeId="2" ParentId="3599" CreationDate="2012-06-10T16:36:10.777" Score="5" Body="&lt;p&gt;We discussed the validity of using bid-ask spreads as transaction costs in this &lt;a href=&quot;https://quant.stackexchange.com/questions/3573/transaction-cost-in-a-simulated-market-environment&quot;&gt;post&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially the bid-ask spread represents the cost of &lt;em&gt;liquidity&lt;/em&gt; which can be seen only as part of the transaction cost you will have to pay in live trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a lot of things to be considered if you want to include transaction cost in your backtest. The main factor you do not include in your model is simply the &lt;em&gt;transaction fee&lt;/em&gt; that the broker will charge you. Another aspect that can drive you crazy is the &lt;em&gt;slippage&lt;/em&gt; (see the post previously mentioned) which is very difficult to model. And that's just the beginning, you can then add market impact, bugs in your execution system, and so on...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, the problems that arise during live trading are grouped in the &lt;a href=&quot;http://en.wikipedia.org/wiki/Implementation_shortfall&quot; rel=&quot;nofollow noreferrer&quot;&gt;implementation shortfall&lt;/a&gt; concept. I think you will never be able to take everything into consideration during the backtest and you should always expect that things can go wrong when you're live. Arguably, that's part of the beauty of trading.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2012-06-10T16:36:10.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3601" PostTypeId="2" ParentId="2700" CreationDate="2012-06-10T21:33:30.563" Score="2" Body="&lt;p&gt;Here's an &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2066848&quot; rel=&quot;nofollow&quot;&gt;approach&lt;/a&gt; by Kritzman et al on Tactical Asset Allocation using Markov regime switching models. Here's another approach that uses &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2025699&quot; rel=&quot;nofollow&quot;&gt;relative strength in TAA&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-06-12T18:58:53.273" LastActivityDate="2012-06-12T18:58:53.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3602" PostTypeId="1" AcceptedAnswerId="3606" CreationDate="2012-06-11T20:57:46.300" Score="2" ViewCount="6863" Body="&lt;p&gt;Looking at quant roles I keep seeing 'Flow Interest Rates' or 'Interest Rate Flow' - what does this refer to?&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2014-10-07T16:30:30.887" Title="What is &quot;Flow Interest Rates&quot;?" Tags="&lt;career&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3604" PostTypeId="1" AcceptedAnswerId="3605" CreationDate="2012-06-12T03:42:09.680" Score="4" ViewCount="431" Body="&lt;p&gt;Today I was speaking with someone involved in high frequency trading. They were mentioning hidden orders, queue positions (which can be lost in the orderbook based on certain order modifications), partial cancels, fills, uncrossing the book. What would be a good hopefully consolidated source to learn about all of this short of trying to read the Pitch/Itch protocol specs?&lt;/p&gt;&#xA;" OwnerUserId="1456" LastActivityDate="2012-06-12T03:58:53.210" Title="What is a good source to learn the different nuances of electronic orders and their nature?" Tags="&lt;high-frequency&gt;&lt;limit-order-book&gt;&lt;algorithmic-trading&gt;&lt;electronic-trading&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3605" PostTypeId="2" ParentId="3604" CreationDate="2012-06-12T03:58:53.210" Score="5" Body="&lt;p&gt;Each venue will allow diferent order types, and will have different matching rules (the queue positions you mentioned), so this is not general to the whole market, but this is a paper from Nyse that is pretty much explains most of the order types I have heard of:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.nyse.com/pdfs/fact_sheet_nyse_orders.pdf&quot;&gt;http://www.nyse.com/pdfs/fact_sheet_nyse_orders.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, one factsheet/regulation from the BMF&amp;amp;Bovespa (Brazilian exchange):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.bmfbovespa.com.br/en-us/rules/download/Operational-Regulations-Chapter13.pdf&quot;&gt;http://www.bmfbovespa.com.br/en-us/rules/download/Operational-Regulations-Chapter13.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2543" LastActivityDate="2012-06-12T03:58:53.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3606" PostTypeId="2" ParentId="3602" CreationDate="2012-06-12T05:45:13.020" Score="5" Body="&lt;p&gt;The above posts are incorrect in that it has nothing to do with a distinction between prop trading or client facing trading. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Flow trading simply means that the underlying products are &quot;commodity products&quot; in the sense that they are easy to value, high turnover products. Thus rates flow trading involves the trading of cash sovereign government bonds, corporate bonds, overnight index swaps, interest rate swaps, all the way up to caps, floors, and swaptions. Those are rate flow products. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other side of the spectrum are &quot;hard-to-value structures&quot; that are not considered flow products, such as exotic derivatives, MBS, ABS, CDOs, CMOs,...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please note that all products whether flow or not are products traded in client facing roles, thus my first comment that I disagree with Tal's earlier comment. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-06-12T05:45:13.020" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3607" PostTypeId="1" CreationDate="2012-06-12T18:30:28.753" Score="26" ViewCount="21316" Body="&lt;p&gt;What are the advantages/disadvantages of using the arithmetic Sharpe Ratio vs the geometric Sharpe Ratio?  Is one more correct?  Or is one better in certain circumstances?&lt;/p&gt;&#xA;" OwnerUserId="2544" LastEditorUserId="467" LastEditDate="2016-12-09T15:36:01.580" LastActivityDate="2019-07-26T06:40:37.810" Title="Should I use an arithmetic or a geometric calculation for the Sharpe Ratio?" Tags="&lt;statistics&gt;&lt;returns&gt;&lt;sharpe-ratio&gt;&lt;calculation&gt;" AnswerCount="10" CommentCount="1" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="3608" PostTypeId="2" ParentId="3607" CreationDate="2012-06-12T19:48:07.393" Score="11" Body="&lt;p&gt;I'm not sure it makes sense to think of one as more correct than another. However, they do have significant differences. It may help to distinguish between ex-post evaluation of a strategy and ex-ante prediction of what the strategy's performance will be. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For simplicity, let's assume the log returns of the strategy are approximately i.i.d. univariate normal and the risk-free rate is a constant. If you were a mean-variance investor deciding between the risk-free rate and the strategy, you would estimate the mean and variance of the log returns, project it to the investor's horizon, and convert the normal to lognormal to obtain the arithmetic returns. So if you were calculating a Sharpe ratio that is consistent with the way it was originated in financial theory, i.e. the slope of the efficient frontier, would be this arithmetic ex ante expected Sharpe ratio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the Sharpe ratio is also used in performance evaluation in different ways. I think one major reason that the geometric version is used is that the numerator will correspond with what the investor actually earned, the CAGR. This might be useful to some people, but personally I prefer to look at the CAGR by itself rather than in the Sharpe ratio. Further, the CAGR is the median of the lognormal distribution under some assumptions. I find it more intuitive to use the mean and keep ex-post consistent with ex-ante, which would bring me back to the arithmetic Sharpe. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another reason to use the geometric version might be that it avoids the distributional issues with the lognormal distribution (since it has skewness/kurtosis). However, &lt;a href=&quot;https://www.researchgate.net/publication/313782495_Comparing_Sharpe_Ratios_-_Excel_Workbook_Implementation_of_Opdyke_2007&quot; rel=&quot;nofollow noreferrer&quot;&gt;Opdyke (2007)&lt;/a&gt; provides the asympototic distribution of the Sharpe ratio under fairly general assumptions.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastEditorUserId="22053" LastEditDate="2019-07-26T06:40:37.810" LastActivityDate="2019-07-26T06:40:37.810" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="3609" PostTypeId="1" CreationDate="2012-06-12T20:40:20.057" Score="2" ViewCount="1219" Body="&lt;p&gt;I am attempting to write a function that will calculate the annualized rate of return for individual dividends made by illiquid investments. These dividends are paid at varying intervals and the illiquid investment does not have an observable market price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have looked at using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    [(1 + YTD ROR)1/(#of days/365)] – 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this does not seem valid if this dividend is one of many that have been made this year.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below are 3 sample cases:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;A Investment&#xA;$10 / 1 unit&#xA;    1/31/2011 - $0.11 div / 1 unit  - 1.1% ROI - 4.4% annualized ROI&#xA;    4/30/2011 - $0.08 div / 1 unit  - 0.8% ROI - 3.2% annualized ROI&#xA;    7/31/2011 - $0.10 div / 1 unit  - 1.0% ROI - 4% annualized ROI&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For investment A the assumption is being made that each dividend paid was being paid on a quarterly basis&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;B Investment&#xA;$10 / 1 unit&#xA;    1/31/2011 - $0.11 div / 1 unit  - 1.1% ROI - 13.2% annualized ROI&#xA;    2/27/2011 - $0.10 div / 1 unit  - 1.0% ROI - 12% annualized ROI&#xA;    3/30/2011 - $0.10 div / 1 unit  - 1.0% ROI - 12% annualized ROI&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For investment B the assumption is being made that each dividend paid would be paid monthly.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C Investment&#xA;$10 / 1 unit&#xA;    5/30/2011 - $2.00 / 1 unit - 20% ROI - 48.6% annualized ROI (assuming 365 days in a year)&#xA;    6/30/2011 - $0.10 / 1 unit - 1.0% ROI - 12% Annualized ROI (assuming monthly dividend)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So the problems I'm coming across are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I won't always know what dividend schedule the current dividend is. For example, is this a monthly or quarterly dividend, or a special one time return of capital, etc.&lt;/li&gt;&#xA;&lt;li&gt;Sometimes more than 1 dividend is paid per year and sometimes not. Should extra weight be given to those that are the first to occur in that year (which effectively is what happens when using the formula at the top)?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Use Case:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All of this is to reconcile an investment's actual performance with its stated/projected performance. If in the prospectus it is estimated this investment will pay an 8% dividend each year, I need to quantify each paid dividend in annual terms to see if it meets, exceeds, or falls short of the projected performance.&lt;/p&gt;&#xA;" OwnerUserId="2547" LastEditorUserId="1106" LastEditDate="2012-06-14T13:59:31.877" LastActivityDate="2013-06-20T06:33:18.007" Title="How to annualize dividends paid at varying intervals?" Tags="&lt;time-series&gt;&lt;returns&gt;&lt;performance&gt;&lt;performance-evaluation&gt;" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3610" PostTypeId="2" ParentId="3607" CreationDate="2012-06-12T20:42:11.777" Score="13" Body="&lt;p&gt;In addition to John's answer and just to make things clear:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The arithmetic mean is given by &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mu_a = \frac{1}{n} \sum_{i=1}^n x_i$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The geometric mean is given by &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mu_g = \sqrt[n]{\prod_{i=1}^n (1+x_i)} -1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And we have that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mu_g \leq \mu_a$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So not only would the geometric sharp ratio be taking into account the &quot;actual&quot; return of the portfolio, but it is also a more conservative measure.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="22698" LastEditDate="2016-07-25T19:58:23.533" LastActivityDate="2016-07-25T19:58:23.533" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3611" PostTypeId="2" ParentId="3607" CreationDate="2012-06-12T21:08:06.743" Score="7" Body="&lt;p&gt;There are many variants proposed; some useful, some not so much. As an investor, the most important thing is to compare the exact same ratio, calculated in the exact same way, for each prospect. As the prospect/fund the most important thing is to be clear about the statistic you are reporting so your investors make well informed decisions. So let's start with some definitions specific to your question. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Sharpe ratio&lt;/strong&gt;, sometimes called the &quot;Modified Sharpe&quot; ratio, is the arithmetic average of excess returns divided by the standard deviation of those returns, $r_t\in R$.&#xA;&lt;blockquote&gt;$Sharpe Ratio = \frac{E[R_t - R_{free}]}{\sigma}$ &lt;br&gt; where  $R_t\in[-1,\infty)$, which is a percentage, and $R_{free}$ is the risk-free return rate, typically taken as the current T-Bill rate.&lt;/blockquote&gt; &#xA;It is commonly calculated over annual periods, but monthly, or daily periods are common too. It is a class of signal-to-noise ratio indicating the expected reward per unit of risk. This is the most commonly cited variant and is the measure proposed by professor Sharpe in 1994.&lt;/li&gt;&#xA;&#xA;&lt;li&gt;The &lt;strong&gt;Geometric Sharpe ratio&lt;/strong&gt; is the geometric average of compounded excess returns divided by the standard deviation of those compounded returns. This is equivalent to the arithmetic average and standard deviation of $log(1+r_t)$, which is the more convienient calculation.&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The difference&lt;/strong&gt; is mostly in the use of the average of the excess returns for the period or the compounded returns. Because the log returns are generally smaller, the &quot;Geometric Sharpe ratios&quot; generally suggests a higher number; about 12.5% higher for samples from a uniform distribution. Naturally, it is completely bogus to compare dissimilar ratios...so be sure you know which measure you are digesting.&lt;/p&gt;&#xA;" OwnerUserId="2342" LastActivityDate="2012-06-12T21:08:06.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3612" PostTypeId="1" CreationDate="2012-06-13T02:51:14.027" Score="4" ViewCount="1805" Body="&lt;p&gt;I am new to this. I am confused on what consists of a tick data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a trading platform in which I could collect data of exchange traded product like futures and stocks. While I am intending to use the platform for trading, I think I could collect the data directly from platform. The data consist of:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Every traded quantity + time of transaction at exchange&lt;/li&gt;&#xA;&lt;li&gt;Every changes in the bid quantity, bid price, ask quantity, ask price + time at which these data reach my computer&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;While referring to some websites and literature regarding tick data, I am not sure:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is tick data consist of 1 or 2 or the combination of 1 and 2? Which data should I build my model on?&lt;/li&gt;&#xA;&lt;li&gt;Also, if I am using the combination of 1 and 2, any ideas on how to combine the two series as the timestamp of 1 and 2 is different (there is time lag between the traded time and the changes to bid and ask QUANTITY reflected on my comp)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="6216" LastActivityDate="2012-06-21T00:19:13.910" Title="Tick data collection" Tags="&lt;data&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3613" PostTypeId="2" ParentId="3612" CreationDate="2012-06-13T04:09:52.250" Score="3" Body="&lt;p&gt;It completely depends on your specific strategy model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tick data are generally not just trades but changes on the bid and offer as well. You can go a step further and define tick data for stocks as any change in the bid and offer in the whole order book, not just best bid/offer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding your second question, you can treat trades as simply a field for traded price and traded volume, thats it. Bid/Offer changes you use other fields such as bid price change/offer price change, bid volume change, offer volume change. If you manage the whole order book you would need to manage simply more fields if several order book internals change at the same time stamp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally I advise you to always work off deltas, meaning you just look at changes from previous prices/volume or some use changes from market bid and offer prices. This will shrink the volume you need to deal with significantly. CPU resources are always cheaper than I/O resources. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-06-13T04:09:52.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3615" PostTypeId="2" ParentId="3602" CreationDate="2012-06-13T15:20:00.463" Score="-4" Body="&lt;p&gt;Floating interest rate is the &lt;a href=&quot;http://www.moneylistings.com/forexuniversity/interest-rates&quot; rel=&quot;nofollow&quot;&gt;interest rate&lt;/a&gt; that private markets determine, based on demand and supply data. If the demand of a currency goes down, it leads to expensive imports, which leads an extra room for local jobs and services and so on. That is opposed to a fixed interest rate that is set and maintained by a  government’s central bank.&lt;/p&gt;&#xA;" OwnerUserId="2551" LastActivityDate="2012-06-13T15:20:00.463" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3618" PostTypeId="2" ParentId="3599" CreationDate="2012-06-14T01:39:19.207" Score="5" Body="&lt;p&gt;The bid/offer spread is informative about a narrow range of transaction sizes, i.e. the quote depth. E.g. if we see a bid/offer of 99/101 with quantities of 1000/1500 shares respectively then we know that doing a trade to sell upto 1000 shares will get an execution of 99 and doing a trade to buy upto 1500 will get an execution of 101.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the trades that you might like to do include many values far beyond this narrow range (from -1000 to +1500).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Modern electronic markets show the full order book which is a whole new perspective on liquidity. Given good datafrom a modern electronic exchange, you can simulate the execution obtained by any one single market order. This is a whole new world in terms of the observability of transactions costs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://ajayshahblog.blogspot.in/2012/05/costs-in-buying-versus-costs-in-selling.html&quot; rel=&quot;noreferrer&quot;&gt;http://ajayshahblog.blogspot.in/2012/05/costs-in-buying-versus-costs-in-selling.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2510" LastActivityDate="2012-06-14T01:39:19.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3619" PostTypeId="1" CreationDate="2012-06-14T07:38:46.260" Score="-2" ViewCount="170" Body="&lt;p&gt;Is it possible to have different stocks with the same stock code on different stock exchanges.&lt;/p&gt;&#xA;" OwnerUserId="2557" LastEditorUserId="848" LastEditDate="2012-06-14T10:05:42.580" LastActivityDate="2012-06-14T10:05:42.580" Title="Different stocks with the same stock code" Tags="&lt;equities&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2012-06-14T14:03:25.410" ContentLicense="CC BY-SA 3.0" />
  <row Id="3620" PostTypeId="2" ParentId="3619" CreationDate="2012-06-14T09:55:11.137" Score="4" Body="&lt;p&gt;There is no reason that two different exchanges would be prevented from using the same code, although they usually have different conventions. So if you're writing code or spreadsheets that depend on a unique stock code, consider creating a unique code that combines the exchange identifier with the stock code. If this is in a database, use multiple keys in the table; include the exchange ID as one of the key fields.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the answer is yes, it is possible.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2012-06-14T09:55:11.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3621" PostTypeId="2" ParentId="3599" CreationDate="2012-06-14T13:30:48.263" Score="6" Body="&lt;p&gt;Other answers all give helpful advice, but none actually answer your question, so I will try.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First off, backtesting based on close is reasonable only as a poor-man's first approximation, and before committing serious capital I would recommend collecting some higher frequency data.  Having said that, it is actually quite common to investigate ideas quickly using close price data, and what you suggest is not unreasonable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The differences between the two strategies you mention actually has little to do with transaction/liquidity costs.  Rather, especially given the mechanical way in which you construct bid/ask prices, the difference will primarily be driven by the increased difference between the two thresholds for buying and selling.  Ultimately, it does not matter whether you consider yourself to always be buying at the &quot;ask&quot; and selling at the &quot;bid&quot;, or whether you adjust the thresholds and add the bid-ask spread at the end.  It is more important to just understand exactly what you are assuming so you can replicate it as closely as possible in live trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FYI, the way you have set up your strategy also appears prone to look-ahead bias.  Keep in mind that you do not know the close price until &lt;em&gt;after&lt;/em&gt; the close, by which time it is too late to decide whether you are buying or selling.  This is a problem for &lt;em&gt;either&lt;/em&gt; of your two proposed strategies.  Be careful to &lt;strong&gt;never use the same data point for signal generation and execution&lt;/strong&gt;. When working with daily close data, common practice is to execute on the &lt;em&gt;next day's close.&lt;/em&gt;  This is a very hard barrier to overcome, though, and is yet another reason to invest in higher frequency data.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2012-06-14T13:30:48.263" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3622" PostTypeId="2" ParentId="3609" CreationDate="2012-06-14T14:02:01.873" Score="0" Body="&lt;p&gt;I believe you will have to conjecture from observations what the correct frequency of dividend payment is, then annualize in the standard manner, by assuming the same dividend is paid out for the rest of the year at the presumed frequency.  If over time your conjecture is proven wrong, or the company changes its policy, then adjust your estimate.  Without more information, it is impossible to completely answer your question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, once a year has passed, you could always take the trailing twelve month dividend yield.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2012-06-14T14:02:01.873" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3623" PostTypeId="1" AcceptedAnswerId="3654" CreationDate="2012-06-15T00:40:52.497" Score="9" ViewCount="643" Body="&lt;p&gt;Let's say we have an equity liquidity-providing model that was fitted on 1 minute bar periods. The model forecasts the 1-min next period return given the activity of the previous bars. Now, when we move to trading strategy implementation the forecasted returns can be calculated at any time, say once every second. This is what I call the continuous forecast.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Order entry seems fairly trivial: the strategy will calculate trading signals every second and possibly enter a new long or short order for each forecast, up to some maximum open orders number and/or position net exposure parameters. Open orders that were not immediately filled will have to be re-evaluated at most after, say, 30 seconds, because the forecast window expires at the 60th second after the original forecast time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question, or confusion, I have is about positions. How do we manage positions when we have overlapping signals? For example, let's say at $t_1$ we are filled long 100 shares, then at $t_5$ we forecast a short signal. Because we have a conflicting signal in the same window, we might decide to close the long position by entering a sell order at $t_5$. This would also match our order entry logic. But in theory the asset price could go up until $t_{60}$, that is the end of the first signal window, and then collapse from there to $t_{65}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, we covered $t_1,...,t_5$ in virtue of the first order and $t_5,...,t_{60}$ by offsetting the initial long position with a short position, while $t_{60},...,t_{65}$ does not have any short position to match the $t_5$ signal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The forecast has 3 main levels: hold, sell (or short) and long. The signal in the example is calculated every second to simplify, but it could be produced anytime based on trading activity.&lt;/p&gt;&#xA;" OwnerUserId="1791" LastEditorUserId="56" LastEditDate="2012-06-18T05:10:05.643" LastActivityDate="2012-06-21T15:44:18.750" Title="Position management in presence of continuous forecast" Tags="&lt;equities&gt;&lt;high-frequency&gt;&lt;forecasting&gt;&lt;position-sizing&gt;&lt;continuous-time&gt;" AnswerCount="4" CommentCount="4" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="3624" PostTypeId="2" ParentId="3623" CreationDate="2012-06-15T14:47:56.657" Score="2" Body="&lt;p&gt;The answer depends on the reasoning behind your forecast.  Is this a mean-reversion signal?  If so, perhaps the presence of a short signal shortly after a long signal indicates that the long signal was very profitable, and you should take profits immediately. Is it a momentum signal?  If so, then perhaps the momentum of this stock is very choppy at the moment, and one should stay out altogether (flat position).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, if this is a very volatile signal, you could consider aggregating all signals over a short time frame and trading in bulk less frequently, such as every 15 or 30 seconds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ultimately, though, your question is an empirical question, and the only way to answer it is to backtest all possibilities.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2012-06-15T14:47:56.657" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3625" PostTypeId="2" ParentId="1157" CreationDate="2012-06-16T03:12:23.473" Score="20" Body="&lt;p&gt;There is a very good reason why the ratio&#xA;$$\frac {mean(HIGH-LOW)}{mean(|CLOSE-OPEN|)} \approx 2$$&#xA;on various financial series.  If the price of a security evolves according to a &lt;strong&gt;Wiener process&lt;/strong&gt; beginning at the opening bell and throughout the day, and the drift is negligible for that period of time, i.e.$\mu=0$, then the denominator of the above ratio closely approximates the &lt;strong&gt;average absolute deviation&lt;/strong&gt;, $$AAD=\frac{2\sigma}{\sqrt{2\pi}}\int_0^\infty xe^{-x^2/2}dx=\sqrt {2/\pi}\cdot\sigma$$ for a normal distribution, where $\sigma$ is the standard deviation.  On the other hand&#xA;$$\mathbb E(HIGH-OPEN) = \sqrt{2/\pi}\cdot\sigma$$&#xA;$$\mathbb E(LOW-OPEN) = -\sqrt{2/\pi}\cdot\sigma$$(See &lt;a href=&quot;http://en.wikipedia.org/wiki/Wiener_process#Running_maximum&quot;&gt;the running maximum of a Wiener process on Wikipedia&lt;/a&gt;.)&#xA;So we have for such an idealized Wiener process:&#xA;$$\frac {\mathbb E(HIGH-LOW)}{\mathbb E(|CLOSE-OPEN|)}&#xA;= \frac{\sqrt{2/\pi}\cdot\sigma-\left(-\sqrt{2/\pi}\cdot\sigma\right)}{\sqrt {2/\pi}\cdot\sigma} = 2.$$&#xA;It should not be too surprising to see this more or less borne out by observation.&lt;/p&gt;&#xA;" OwnerUserId="2561" LastActivityDate="2012-06-16T03:12:23.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3627" PostTypeId="2" ParentId="1865" CreationDate="2012-06-16T08:46:20.370" Score="5" Body="&lt;p&gt;&lt;a href=&quot;http://lobster.wiwi.hu-berlin.de/forum/viewtopic.php?f=4&amp;amp;t=30&quot;&gt;http://lobster.wiwi.hu-berlin.de/forum/viewtopic.php?f=4&amp;amp;t=30&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;R code, pictures and discussion, it's easy to modify it&lt;/p&gt;&#xA;" OwnerUserId="2044" LastActivityDate="2012-06-16T08:46:20.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3630" PostTypeId="2" ParentId="3623" CreationDate="2012-06-17T05:55:15.253" Score="2" Body="&lt;p&gt;You could try net positions: where you continuously buy and sell depending on the signals generated.  Net positions may lead to unnecessary commissions/spread nickel-and-diming your profits away.  Once you have picked a direction and already have trade entry, your system should instead continue looking for new signals in the BACKGROUND.  New signals while in the middle of an existing trade(cycle) are discarded until the existing tradecycle completes. This gives you much greater clarity to judge in real time whether a strategy is valid or needs to be refined.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you switch directions constantly in a non-swing trading method or any category method; you either have a very good scalper or you have incredible foresight as to how each signal will play out.   Or try reversing your trades (sell when your signal says buy, buy when your signal says sell).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rather than backtest all possibilities, which consumes too much time with over-optimization, why not instead backtest (on tick data if possible) only to verify the validity of the trading logic, and then FORWARD test your strategy to verify it works.  If you can do &quot;walk-forward&quot; testing, such as market replay of clean tick data, that would be even better from a visual standpoint because you get to actually see your strategy play out on a chart (or you could do it from a spreadsheet with just raw tick data).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do the reversing trades technique, try to incorporate cost averaging, to spread out your risk over the direction you pick.  Combined this with a tiered equity take-profit approach (smaller total positions, smaller TP; larger total position, larger TP).  In forex, there is an equity monitoring tool that takes profit based on total equity increases called &lt;a href=&quot;http://www.forex-tsd.com/expert-advisors-metatrader-4/30748-profitkeeper-automated-closeall-take-profit-tool.html&quot; rel=&quot;nofollow&quot; title=&quot;Profitkeeper closeAll TakeProfit tool&quot;&gt;ProfitKeeper&lt;/a&gt;.  It's for the metatrader 4 platform, but I'm sure you could develop something similar for stocks or whatever platform you are using.&lt;/p&gt;&#xA;" OwnerUserId="2566" LastActivityDate="2012-06-17T05:55:15.253" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3635" PostTypeId="2" ParentId="3623" CreationDate="2012-06-18T16:25:24.690" Score="1" Body="&lt;p&gt;One solution I have been considering is to add a target position parameter with a time decay. For example, given the $t_1$ buy and $t_2$ short signals described in the question and assuming a 5 seconds signal window to simplify, we would have the following time-based target positions:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;╔════════════════╦═══════╦═══════╦═══════╦═══════╦═══════╦═══════╦════╗&#xA;║      Time      ║  t1   ║  t2   ║  t3   ║  t4   ║  t5   ║  t6   ║ t7 ║&#xA;╠════════════════╬═══════╬═══════╬═══════╬═══════╬═══════╬═══════╬════╣&#xA;║ Long Pos       ║ 100   ║ 100   ║ 100   ║ 100   ║ 100   ║ 0     ║ 0  ║&#xA;║ Long Avg Price ║ 32.45 ║ 32.45 ║ 32.45 ║ 32.45 ║ 32.45 ║ NA    ║ NA ║&#xA;║ Short Pos      ║ 0     ║ 100   ║ 100   ║ 100   ║ 100   ║ 100   ║ 0  ║&#xA;║ Short Avg Pos  ║ NA    ║ 33.11 ║ 33.11 ║ 33.11 ║ 33.11 ║ 33.11 ║ NA ║&#xA;║                ║       ║       ║       ║       ║       ║       ║    ║&#xA;║ Net Target Pos ║ 100   ║ 0     ║ 0     ║ 0     ║ 0     ║ -100  ║ 0  ║&#xA;╚════════════════╩═══════╩═══════╩═══════╩═══════╩═══════╩═══════╩════╝&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The strategy would then have a &quot;view&quot; over the next 5 seconds target position and could adjust the size of each order accordingly. At $t_2$ the strategy would enter an order to sell 100 shares to match the target position. Then at $t_6$ it would enter a new order to short 100 shares at $33.11, knowing that the forecast window will only last for 1 second though.&lt;/p&gt;&#xA;" OwnerUserId="1791" LastActivityDate="2012-06-18T16:25:24.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3637" PostTypeId="2" ParentId="3158" CreationDate="2012-06-19T16:28:32.437" Score="2" Body="&lt;p&gt;Take a look at &lt;a href=&quot;http://www.modulusfe.com/stockchartsl/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.modulusfe.com/stockchartsl/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They have a nice &lt;a href=&quot;http://platform.modulusfe.com/stockchartxsl.rtw/TestChartTestPage.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;demo&lt;/a&gt; (requires Microsoft Silverlight plugin). You can zoom and scroll, add lines and technical indicators, save image etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also see this &lt;a href=&quot;https://stackoverflow.com/questions/1110105/financial-charts-in-net-best-library-to-display-a-live-streaming-1-min-stock-c&quot;&gt;SO question&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="370" LastEditorUserId="-1" LastEditDate="2017-05-23T11:33:46.017" LastActivityDate="2012-06-19T16:28:32.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3638" PostTypeId="1" AcceptedAnswerId="3639" CreationDate="2012-06-19T16:45:30.313" Score="14" ViewCount="485" Body="&lt;p&gt;If two time series follow a GARCH process, and a third is a linear combination of them, is the third also GARCH process?&lt;/p&gt;&#xA;" OwnerUserId="2044" LastEditorUserId="1106" LastEditDate="2012-06-20T15:35:53.950" LastActivityDate="2017-05-12T17:24:03.600" Title="Is a linear combination of GARCH processes also a GARCH process?" Tags="&lt;time-series&gt;&lt;mathematics&gt;&lt;garch&gt;&lt;econometrics&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3639" PostTypeId="2" ParentId="3638" CreationDate="2012-06-19T19:02:04.963" Score="12" Body="&lt;p&gt;I think there are a lot of different ways to specify this problem. For simplicity, consider independent Garch processes&#xA;$$&#xA;r_{1,t}	\sim	N\left(0,\sigma_{1,t}^{2}\right)&#xA;$$&#xA;$$&#xA;\sigma_{1,t}^{2}	=	\beta_{1,1}+\beta_{1,2}\varepsilon_{1,t-1}^{2}+\beta_{1,3}\sigma_{1,t-1}^{2}&#xA;$$&#xA;and &#xA;$$&#xA;r_{2,t}	\sim	N\left(0,\sigma_{2,t}^{2}\right)&#xA;$$&#xA;$$&#xA;\sigma_{2,t}^{2}	=	\beta_{2,1}+\beta_{2,2}\varepsilon_{2,t-1}^{2}+\beta_{2,3}\sigma_{2,t-1}^{2}&#xA;$$&#xA;where $\left[\begin{array}{cc}&#xA;\varepsilon_{1,t} &amp;amp; \varepsilon_{2,t}\end{array}\right]\sim N\left(0,\left[\begin{array}{cc}&#xA;1 &amp;amp; 0\\&#xA;0 &amp;amp; 1&#xA;\end{array}\right]\right)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, the linear combination equals&#xA;$$&#xA;r_{3,t}	=	\alpha_{1}r_{1,t}+\alpha_{2}r_{2,t}&#xA;	\sim	N\left(0,\alpha_{1}^{2}\sigma_{1,t}^{2}+\alpha_{2}^{2}\sigma_{2,t}^{2}\right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming the coefficients in the Garch equations are constrained to be positive and sum to less than or equal to one on the lagged values, then $r_{3,t}$ will also follow a Garch process as a result of inheriting the Garch variances of the other variables.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2012-06-19T19:02:04.963" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="3640" PostTypeId="1" CreationDate="2012-06-19T21:48:18.070" Score="4" ViewCount="3086" Body="&lt;p&gt;Is there a way to determine a government bill's or bond's maturity date by looking at its CUSIP?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the CUSIP for US T-Bills with a maturity of 12/1/11 is 9127953V1. As you probably know, the first six characters of a CUSIP represent the item in question (e.g. US TBills); the last digit is an error correction code; the seventh and eighth characters are specific to the maturity. So in this case, &quot;3V&quot; maps to 12/1/11.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you know the algorithm that's used to map the two digit code to a maturity? I can obtain the maturity by hand using the internet or Bloomberg but would prefer to have an algorithm if possible. Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="2578" LastEditorUserId="16595" LastEditDate="2018-09-24T20:58:51.177" LastActivityDate="2018-09-25T01:10:15.470" Title="How do I determine the maturity date from a T-bill's CUSIP?" Tags="&lt;bond&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3641" PostTypeId="1" CreationDate="2012-06-20T09:15:46.527" Score="1" ViewCount="287" Body="&lt;p&gt;I am new to this. I trained and tested my data using SVM in Matlab with the autoscale option true =&gt; the data would be normalized with unit SD.  Let's say the training data have the price around 200.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;During real time, let's say the price is around 300. I am wondering what is the practise in obtaining the mean and standard deviation in real time so that I could normalize the data for the model I built previously?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="6216" LastEditorUserId="6216" LastEditDate="2012-06-20T09:32:23.183" LastActivityDate="2012-07-20T13:42:42.103" Title="Normalized data" Tags="&lt;data&gt;&lt;modeling&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3642" PostTypeId="2" ParentId="3641" CreationDate="2012-06-20T13:30:28.213" Score="2" Body="&lt;p&gt;You must use the same scaling parameters out of sample as you did during training. Do otherwise will give you incorrect results. If the distribution of your out of sample observations different significantly from your training data then you need to address that by gathering more training data.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2012-06-20T13:30:28.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3643" PostTypeId="2" ParentId="1501" CreationDate="2012-06-20T19:22:30.527" Score="1" Body="&lt;p&gt;As best I can tell, the primary difference between traditional approaches (be they classical or Bayesian) and the newer &quot;predictive analytics&quot; is that the traditional approaches make a few explicit (and testable) assumptions, and then give you quantified estimates of your potential errors.  The newer methods exchange a chance at more sophisticated (and accurate) prediction for a &quot;black box&quot; where you can't know anything about the error bars in any given application of the method.&lt;/p&gt;&#xA;" OwnerUserId="2583" LastActivityDate="2012-06-20T19:22:30.527" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3644" PostTypeId="2" ParentId="3612" CreationDate="2012-06-21T00:19:13.910" Score="3" Body="&lt;p&gt;The phrase &lt;em&gt;tick data&lt;/em&gt; can be a bit ambiguous (so double-check what you are getting when buying historical data). I would assume that &quot;tick data&quot; only means trade ticks, number 1 in your list. Number 2 would be called &quot;bid/ask data&quot; or &quot;bid/ask ticks&quot;. Number 3, mentioned by Freddy, I hear called the order book, or &quot;market depth data&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your second question, record the time you receive the trade tick notification, and use that time in your model. Then the combined trade/bid/ask data is consistent. (Or use the difference to estimate latency, and subtract that from your bid/ask data timestamps - that has the advantage that it should match the official exchange data, if you need to patch data later.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Going back to your first question, I'd suggest you build your model on just trade tick data initially. Then when you later add in bid/ask data it will take more CPU (much more data to deal with), but you may get better results. Or you may not. (There is an element of bluff in bid/ask prices, and even more so in market depth data, but a trade tick is real as it means someone has put their money where their mouth is).&lt;/p&gt;&#xA;" OwnerUserId="1587" LastActivityDate="2012-06-21T00:19:13.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3645" PostTypeId="1" AcceptedAnswerId="3655" CreationDate="2012-06-21T03:34:36.323" Score="6" ViewCount="3054" Body="&lt;p&gt;I'm attempting to construct a spot rate and forward rate curve from the 2011 daily treasury yield curve rates provided by the US Treasury.  All US Treasury securities (1m, 3m, 6m, 1y, 2y, 3y, 5y, 7y, 10y, 20y, 30y) are being taken into consideration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the bootstrapping process, step 1 is to obtain all of the spot rates.  In working through this step, I'm getting stuck when calculating the spot rate for the 2y Treasury Note.  To get the spot rate for the 2y Treasury Note, I need the spot rates for the 6m, 1y, and 1.5y terms.  The problem is that there is no observable 1.5y Treasury security.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I work through this?  I've spent a great amount of time browsing the web trying to find the answer, and have come up empty.  I found &lt;a href=&quot;https://quant.stackexchange.com/questions/3302/deriving-spot-rates-from-treasury-yield-curve&quot;&gt;this&lt;/a&gt; topic while creating this post.   Is linear interpolation the answer?  Can someone point me to a good resource for learning this technique?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for your time.&lt;/p&gt;&#xA;" OwnerUserId="2586" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2012-06-21T18:33:12.490" Title="Bootstrapping spot rates from treasury yield curve" Tags="&lt;yield-curve&gt;&lt;bootstrapping&gt;&lt;spot-rate&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3646" PostTypeId="1" AcceptedAnswerId="3690" CreationDate="2012-06-21T07:54:29.030" Score="11" ViewCount="8505" Body="&lt;p&gt;I am thinking about the time-scaling of &lt;strong&gt;Cornish-Fisher VaR&lt;/strong&gt; (see e.g. page 130 &lt;a href=&quot;http://cran.r-project.org/web/packages/PerformanceAnalytics/PerformanceAnalytics.pdf&quot;&gt;here&lt;/a&gt; for the formula). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It involves the &lt;strong&gt;skewness&lt;/strong&gt; and the &lt;strong&gt;excess-kurtosis&lt;/strong&gt; of returns. The formula is clear and well studied (and criticized) in various papers for a single time period (e.g. daily returns and a VaR with one-day holding period).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anybody know a reference on how to scale it with time? I would be looking for something like the square-root-of-time rule (e.g. daily returns and a VaR with &lt;em&gt;d&lt;/em&gt; days holding period). But scaling skewness, kurtosis and volatility separately and plugging them back does not feel good. Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="35" LastEditDate="2012-06-21T11:01:18.037" LastActivityDate="2012-09-07T02:47:58.143" Title="How does Cornish-Fisher VaR (aka modified VaR) scale with time?" Tags="&lt;var&gt;&lt;value-at-risk&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3647" PostTypeId="2" ParentId="3646" CreationDate="2012-06-21T12:09:36.203" Score="4" Body="&lt;p&gt;Skewness decays with time, but the rate of that skewness decay will vary based on the instruments and how they are traded, so a simple estimator such as the square root of time rule is not appropriate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I typically recommend that to scale VaR or ES it makes more sense to &lt;em&gt;lower&lt;/em&gt; your confidence level (raise the alpha parameter) to one that makes sense for your holding period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, for example, assume that we are working with daily returns, as in your question.  Now assume that I have a one-month holding period, and I want a 'monthly VaR'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would argue that a rational confidence level for this is 95%, or 1 in 20, corresponding approximately to the loss that will be exceeded about 1 day a month.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For monthly returns, as in a hedge fund portfolio, a confidence of 92% may be most appropriate, to specify the VaR that will be exceeded, on average, once a year.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think that this is a much more rational approach than asking 'what loss level will be exceeded once in 10000 years?', as many papers and standards bodies recommend.  These numbers aren't very useful, as many &lt;a href=&quot;http://en.wikipedia.org/wiki/Nassim_Nicholas_Taleb&quot; rel=&quot;nofollow&quot;&gt;other authors&lt;/a&gt; have pointed out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, extension to Cornish Fisher Expected Shortfall (also called CVaR or Expected Tail Loss) with the same approach as above, helps scale these numbers in a rational way, asking what the &lt;em&gt;mean&lt;/em&gt; loss is when the loss exceeds the VaR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More information on this is available in our published work including &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1024151&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt; from the Journal of Risk which also covers additive/coherent portfolio decomposition of Cornish Fisher VaR and Expected Shortfall.&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="35" LastEditDate="2012-06-21T13:16:16.630" LastActivityDate="2012-06-21T13:16:16.630" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3648" PostTypeId="1" CreationDate="2012-06-21T13:52:08.183" Score="-3" ViewCount="176" Body="&lt;p&gt;How I can solve the following Quadratic Programming Problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Min[X’VX+X’GX]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, X is a list of coefficient to be solved for, V is a square matrix of Price returns, and G is a square matrix of Income returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, in this case, both V and G should normally be uncorrelated, but in cases where they are correlated, is there a straight forward way to make them orthogonal?&lt;/p&gt;&#xA;" OwnerUserId="2589" LastEditorUserId="1418" LastEditDate="2012-08-14T18:28:47.467" LastActivityDate="2012-08-14T18:28:47.467" Title="Quadratic Programming Problem" Tags="&lt;optimization&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3649" PostTypeId="1" AcceptedAnswerId="3651" CreationDate="2012-06-21T13:57:19.290" Score="12" ViewCount="37090" Body="&lt;p&gt;I am looking for a mathematical proof in terms of differentiating the BS equation to calculate Delta and then prove it that ATM delta is equal to 0.5. &#xA;I have seen many books quoting delta of ATM call option is 0.5, with explanations like the probability of finishing in the money is 0.5, but I am looking for a mathematical proof. &lt;/p&gt;&#xA;" OwnerUserId="928" LastEditorUserId="467" LastEditDate="2012-06-21T18:35:11.893" LastActivityDate="2019-10-13T19:31:30.297" Title="Why do some people claim the delta of an ATM call option is 0.5?" Tags="&lt;options&gt;&lt;black-scholes&gt;" AnswerCount="5" CommentCount="7" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="3650" PostTypeId="2" ParentId="3648" CreationDate="2012-06-21T14:35:10.083" Score="2" Body="&lt;p&gt;Just add V and G together and treat like an ordinary quadratic programming problem.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2012-06-21T14:35:10.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3651" PostTypeId="2" ParentId="3649" CreationDate="2012-06-21T14:37:29.783" Score="12" Body="&lt;p&gt;Your question is not really well formulated since you do not specify at which time the delta is equal to 0.5. What you claim is in fact only true for an ATM call option at the time of maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the Black-Scholes model the price of a call option on the asset S with with strike price $K$ and time of maturity $T$ equals&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$c(t,S(t),K,T) = S(t)\Phi\left(\frac{\ln\frac{S(t)}{K} + \left(r+\frac{\sigma^2}{2} \right)\tau}{\sigma \sqrt{\tau}} \right) - Ke^{-r \tau}\Phi\left(\frac{\ln\frac{S(t)}{K} + \left(r-\frac{\sigma^2}{2} \right)\tau}{\sigma \sqrt{\tau}} \right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $r$ is the risk-free rate, $\sigma$ the volatility and $\tau = T-t$. The &quot;delta&quot; in the Black-Scholes model is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta(t,S(t),K,T) = \frac{\partial c}{\partial S}(t,S(t),K,T) = \Phi\left(\frac{\ln\frac{S(t)}{K} + \left(r+\frac{\sigma^2}{2} \right)\tau}{\sigma \sqrt{\tau}} \right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of an at the money call option we have $K=S(t)$ which means that we get &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\ln\frac{S(t)}{K} = \ln(1) = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and we are left with&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta(t,S(t),S(t),T) = \Phi\left(\frac{\left(r+\frac{\sigma^2}{2} \right)\tau}{\sigma \sqrt{\tau}} \right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This expression equals $0.5$ when $\tau = 0$ that is when $t=T$. This is because $\Phi(x)=0.5$ if and only if $x=0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps you understand. Otherwise, do not hesitate to ask again!&lt;/p&gt;&#xA;" OwnerUserId="2376" LastActivityDate="2012-06-21T14:37:29.783" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3652" PostTypeId="2" ParentId="3649" CreationDate="2012-06-21T14:43:02.533" Score="11" Body="&lt;p&gt;If you look at the BS formula as you find it e.g. in &lt;a href=&quot;http://en.wikipedia.org/wiki/Black%E2%80%93Scholes&quot;&gt;wikipedia&lt;/a&gt; straight forward differentiation of the call price gives the call's Delta. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You find the formula for the Delta on the wikipedia page under &quot;The Greeks&quot;. $\Delta=\Phi(d_1)$ where $\Phi$ is the standard normal cdf and $d_1$ is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d_1 = \frac{\ln(\frac{S}K)+(r+\frac{\sigma^2}2)(T-t)}{\sigma \sqrt{T-t}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where I assume that all parameters are clear. You also find it on wikipedia.&#xA;If $d_1=0$ then $\Phi(d_1)=\frac12$ per the definition of the normal cdf.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When people refer to ATM options having 50 delta they usually mean ATMF, or at the money forward, given by&#xA;$$S=Ke^{-r(T-t)}$$&#xA;Note that sometimes forward prices are derived from put-call parity. Then the forward price can be different)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, when the stock is ATMF, $\ln(\frac{S}K)+r(T-t) = 0$, but the terms with sigma remain.&#xA;In this case $d_1$ is very small but not exactly zero, and $\Delta$ is close to 1/2.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="1106" LastEditDate="2012-06-21T15:00:44.403" LastActivityDate="2012-06-21T15:00:44.403" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3654" PostTypeId="2" ParentId="3623" CreationDate="2012-06-21T15:44:18.750" Score="2" Body="&lt;p&gt;If you designed the model to predict direction only, I would just use the current signal.  You could test whether this is correct by calculating the signals and their 5-second lags, then regress 1-minute forward returns (or 55-second fwd returns) on them both, and see if the coeff on the 5-second lagged signal is significant. If it's not significant, just trade on the current signal.  If it is significant, you might want to adjust your model so the current signal takes this dependence explicitly into account.&lt;/p&gt;&#xA;" OwnerUserId="2027" LastActivityDate="2012-06-21T15:44:18.750" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3655" PostTypeId="2" ParentId="3645" CreationDate="2012-06-21T18:24:18.370" Score="2" Body="&lt;p&gt;You are going to need to interpolate in some way shape or form....&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Linear is the easiest and most basic, however it may not capture the curvature, you can use splines to better capture the curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A nice guide to doing so is here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's a guide to bootstrapping and it has all the components.&#xA;&lt;a href=&quot;http://www.business.mcmaster.ca/finance/deavesr/yieldcur.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.business.mcmaster.ca/finance/deavesr/yieldcur.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2154" LastEditorUserId="2154" LastEditDate="2012-06-21T18:33:12.490" LastActivityDate="2012-06-21T18:33:12.490" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3656" PostTypeId="2" ParentId="3255" CreationDate="2012-06-21T21:50:57.503" Score="0" Body="&lt;p&gt;Theoretically (EMH), No trading or active management is profitable consistently over time as all of those opportunities have already been exploited.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice: If you reduce the problem to a gambling problem.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Equity of K&lt;/li&gt;&#xA;&lt;li&gt;Txn cost of C&lt;/li&gt;&#xA;&lt;li&gt;Stock S&lt;/li&gt;&#xA;&lt;li&gt;with Price at each point of time Pt&lt;/li&gt;&#xA;&lt;li&gt;X - Quantity of Shares Bought&lt;/li&gt;&#xA;&lt;li&gt;Target Threshold = TT&lt;/li&gt;&#xA;&lt;li&gt;Target Price = Pt + TT&lt;/li&gt;&#xA;&lt;li&gt;Stop Threshold = ST&lt;/li&gt;&#xA;&lt;li&gt;Stop Price = Pt - ST&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Case 1. Assume C = 0, TT = ST&#xA;Enter at at Price Pt (Long at Pt)&#xA;Max win = TT&#xA;Max Loss = ST&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Risk to Return ratio = 1&#xA;The probability that makes this gamble a fair bet is 50% (prob that each side is hit first).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Case 2. Assume C = C &#xA;TT= ST&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Max win = TT -2C&#xA;Max loss = TT + 2C&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Risk to Return here is (TT-2C)/(TT+2C) &amp;lt; 1 for any positive C&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So your probability to win needs to be large enough such that p(win)&lt;em&gt;(TT-2c) -((1-p(win))&lt;/em&gt;(TT+2C)&gt;1&#xA;which simplifies to&#xA;2p(win)TT-TT-2C &gt; 1&#xA;Recall P(win) here is bounded by 1.&#xA;Certainty Case P(win) = 1&#xA;2TT-TT-2C &gt; 1&#xA;TT-2C &gt; 1&#xA;This must hold for profitability, this long expression implies that when you win you get The threshold less transaction costs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now to solve for the probability that which the game is fair&#xA;2p(win)TT-TT-2C = 1&#xA;p(win)= (1+TT+2C)/2TT&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The probability of you being right MUST be greater than (1+TT+2C)/2TT.&#xA;or&#xA; 1/2 + C/TT +1/2TT&#xA;Where C/TT is the ratio of cost to win.&#xA;So the marginal probability over 50% in a 1 to 1 bet is equal to the ratio of Cost to win, + 1/(2*TT)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some toy numbers from IB. if C = 2.50 (fx trade cost)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3.50+TT/2TT &#xA;Becomes,&#xA;1/2 + 3.50/2TT&#xA;So the probability of you winning is equal to 1 half + 3.50/2TT, where 2TT is the threshold.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you see here you will need to be more accurate than 50%, assume that TT = 10$&#xA;3.50/20&lt;/p&gt;&#xA;&#xA;&lt;p&gt;gives you a &quot;fair game&quot; probability of 67.5%, meaning to actually make money you need to be more than 67.5% accurate. An interesting fact is if TT was 175$&#xA;1/2+3.50/350 = 51%, however the market probably does not move far enough to generate these types of profits per trade as the WIDER your target the closer the probability goes to 50% assuming fixed transaction costs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So The lesson from this is if you aren't accurate, Have a WIDE target (in a 1 to 1 bet) as your chance of being wrong is lower, however your losses as a % of equity can be higher, given that people are more risk averse and do not have infinite capital the MAX DD's may not be tolerable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now with the specific case you mentioned of day to close.&#xA; 1/2 + C/TT +1/2TT&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The level of gains possible must be unrealistically high relative to transaction costs for it to be profitable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore unless you have a serious edge over the market, chances are you will not be profitable.&lt;/p&gt;&#xA;" OwnerUserId="2154" LastEditorUserId="2154" LastEditDate="2012-06-22T17:33:05.723" LastActivityDate="2012-06-22T17:33:05.723" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3657" PostTypeId="2" ParentId="3558" CreationDate="2012-06-22T13:46:10.287" Score="4" Body="&lt;p&gt;I have come across 2 markets where rates can be negative:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Inflation protected bonds. These bonds are pricd with real interest rates. You can think of them as (this is the &lt;a href=&quot;http://en.wikipedia.org/wiki/Fisher_equation&quot; rel=&quot;nofollow&quot;&gt;Fisher equation&lt;/a&gt;:&#xA;$$&#xA;r = n - i&#xA;$$&#xA;where $r$ is the real interest rate and $n$ is then nominal interest rate (the normal one) and $i$ is the (estimated or priced) inflation. Real rates for short maturities are often negative. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;NDF implied yields. Some currencies can not be exchanged freely for off-shore investors (see &lt;a href=&quot;http://en.wikipedia.org/wiki/Non-deliverable_forward&quot; rel=&quot;nofollow&quot;&gt;NDF&lt;/a&gt; for examples). In these markets forward FX rates are traded and you can calculated implied interest rates from the traded forward (input: the forward FX rate, the domestic interest rate, the FX spot rate; output: an implied yield of the foreign currency that fits the inputs). Again for short maturities I have seen negative yields there.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2012-06-22T13:46:10.287" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3658" PostTypeId="1" CreationDate="2012-06-22T18:48:07.640" Score="4" ViewCount="849" Body="&lt;p&gt;I need to backfill the price of bonds for testing a startegy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The method employed is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Regressing the YTM of the bond against a benchmark.&lt;/li&gt;&#xA;&lt;li&gt;Using the regression estimates to calculate the YTM for the period in which the bond data is not available.&lt;/li&gt;&#xA;&lt;li&gt;Using the &quot;price&quot; function in excel to calculate the bond price with the earliest backfill date as the issue date.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;However, using this method, there is a big difference in price at the point where my backfill data begins.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could somebody please suggest any alternative?&lt;/p&gt;&#xA;" OwnerUserId="2591" LastEditorUserId="467" LastEditDate="2012-06-24T12:41:10.053" LastActivityDate="2012-06-26T16:20:14.997" Title="How do I backfill the price of bonds for backtesting?" Tags="&lt;backtesting&gt;&lt;fixed-income&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3659" PostTypeId="2" ParentId="3648" CreationDate="2012-06-22T18:49:58.320" Score="1" Body="&lt;p&gt;$$ M=X^{T} VX+X^{T} GX= X^{T} (V+G)X $$&#xA;$$ \frac{\partial M}{\partial X}=(V+V^{T}+G+G^{T} )X$$&#xA;$$ \frac{\partial^{2} M}{\partial X^{2}}=(V+V^{T}+G+G^{T} ) &amp;gt; 0 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If V and G are positive definite the under such conditions the minimum exists and it is a matter of solving the linear system $$(V+V^{T}+G+G^{T} )X=0 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the solutions for this equation is a trivial solution and the other requires you to reduce the matrix to row-echolon form&lt;/p&gt;&#xA;" OwnerUserId="2142" LastEditorUserId="2142" LastEditDate="2012-06-22T18:58:10.247" LastActivityDate="2012-06-22T18:58:10.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3660" PostTypeId="1" CreationDate="2012-06-23T07:39:04.270" Score="5" ViewCount="952" Body="&lt;p&gt;Where can I find derivation of formula for portfolio skewness and kurtosis? I can find formulas everywhere, but not their derivations?&lt;/p&gt;&#xA;&lt;p&gt;For example, the &lt;strong&gt;portfolio variance&lt;/strong&gt; formula, &lt;span class=&quot;math-container&quot;&gt;$\sigma_P = w^\top \Sigma w$&lt;/span&gt; is well known, where &lt;span class=&quot;math-container&quot;&gt;$\Sigma$&lt;/span&gt; is the covariance matrix, and I can find the derivation of that formula in a lot of books,  but I can't find anything on the formuals for:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;portfolio skewness&lt;/strong&gt;, &lt;span class=&quot;math-container&quot;&gt;$s_P = w^\top M_3 (w\otimes w)$&lt;/span&gt;, and&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;portfolio kurtosis&lt;/strong&gt;, &lt;span class=&quot;math-container&quot;&gt;$k_P = w^\top M_4 (w\otimes w\otimes w)$&lt;/span&gt;,&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;where &lt;span class=&quot;math-container&quot;&gt;$M_3$&lt;/span&gt; is the co-skewness matrix and &lt;span class=&quot;math-container&quot;&gt;$M_4$&lt;/span&gt; is the co-kurtosis matrix.&lt;/p&gt;&#xA;&lt;p&gt;They are just given the way they are. I'm not strong enough at probability theory to use it to derive the formulas from the expectations operator.&#xA;Who was the first person to derive them?  Where were they first published?&lt;/p&gt;&#xA;" OwnerUserId="2593" LastEditorUserId="41390" LastEditDate="2020-11-16T16:47:14.867" LastActivityDate="2020-11-16T16:47:14.867" Title="Derivation of portfolio skewness and portfolio kurtosis" Tags="&lt;portfolio&gt;&lt;mean-variance&gt;&lt;skewness&gt;&lt;kurtosis&gt;&lt;derivation&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="3661" PostTypeId="1" CreationDate="2012-06-23T07:57:03.523" Score="2" ViewCount="116" Body="&lt;p&gt;What are some of the best ways to effectively measure headwinds for an open ended fund?  Headwinds in this case refers to the amount of volatility contributed by a factor or a set of factors to a portfolio.&lt;/p&gt;&#xA;" OwnerUserId="2594" LastActivityDate="2012-06-23T07:57:03.523" Title="How to Quantify Headwinds" Tags="&lt;portfolio-management&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3662" PostTypeId="2" ParentId="3660" CreationDate="2012-06-23T12:17:07.637" Score="1" Body="&lt;p&gt;What is the data basis that you start from? If you just have the covariance matrix, then you can only calculate portfolio variance or volatility by $$ w^T \Sigma w$$ where $w$ are the portfolio weights and $\Sigma$ is the covariance matrix. If you have the individual asset continuously compounded returns $r^j_t$ where $j$ indexes assets, $j=1,\ldots,N$, and $t$ stands for time, $t=1,\ldots,T$, then you can also calculate the portfolio returns for each points in time $$r_t = \sum_{j=1}^N w_j r^j_t$$ and then apply the standard variance estimator on $(r_t)_{t=1}^T$. &#xA;Coming back to your question, having $(r_t)_{t=1}^T$ you can calculate skewness and kurtosis on this sample. You find the formulas on wikipedia.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2012-08-20T20:08:54.273" LastActivityDate="2012-08-20T20:08:54.273" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3664" PostTypeId="1" CreationDate="2012-06-24T02:24:21.770" Score="2" ViewCount="83" Body="&lt;p&gt;It's not too long since Berkshire Hathaway got its 10-year warrants in Bank of America alongside its \$5 billion purchase of preferred stock.  At the time I saw some discussion about the value of these 700,000,000 &quot;free&quot; warrants (exercisable at \$7.13) as being worth up to 65% of B of A's stock price which was about \$7 at the time.  So, the argument went that for his \$5,000,000,000 Berkshire got \$5,000,000,000 of redeemable preferred and \$3,185,000,000 worth of warrants.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have looked to see how both Berkshire Hathaway and Bank of America may be carrying the respective assets and liabilities regarding these warrants and can't find it in their financials.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This isn't a heavy quant question, but I would welcome any insight.  Thanks&lt;/p&gt;&#xA;" OwnerUserId="2598" LastEditorUserId="1917" LastEditDate="2012-06-24T04:41:03.980" LastActivityDate="2012-06-24T04:41:03.980" Title="Any thoughts on how Warren Buffet's B of A warrants might be &quot;marked-to-market&quot; by either counterparty?" Tags="&lt;options&gt;&lt;option-pricing&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3665" PostTypeId="2" ParentId="3607" CreationDate="2012-06-24T05:14:05.810" Score="1" Body="&lt;p&gt;For any real world applications, the difference between the arithmetic and geometric Sharpe ratios is likely to 'fall under the noise floor', &lt;em&gt;i.e.&lt;/em&gt; be smaller, typically much smaller, than a standard error. This is even under the generous assumptions of stationarity and absence of omitted variables.&lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2012-06-24T05:14:05.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3666" PostTypeId="1" CreationDate="2012-06-24T11:10:24.527" Score="8" ViewCount="372" Body="&lt;p&gt;I developed an optimization algorithm that uses returns (among other parameters) as input and basically output an allocation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I'm pretty happy with the results, I am in the process of putting the algorithm in production. As a matter of fact, I have to embed some checks into the algorithm to make sure that the input was right and that the output makes sense. For example, I check that the allocation sums to 1, I check that the time series provided are all of the same length and so on...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to add another test which allows me to display a warning if the input time series appear to be prices instead of returns (and people &lt;strong&gt;will&lt;/strong&gt; do this mistake one day I'm sure). So, I would like to setup a statistical test on my set of points $x=x_1, ... , x_n$ to determine whether they are likely to be prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Formally the statistical test if a function defined as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$A(x) \rightarrow \{0,1\}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally we would like to find a test that is sufficient and necessary for a time series to be returns (as compared to prices, not to &quot;a random time series&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are three types of interesting statistical tests:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Type I (necessary and sufficient)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$A(x)=1 \iff x ~ \text{are returns}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Type II (sufficient)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$A(x)=1 \Longrightarrow x ~ \text{are returns}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Type III (necessary)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$A(x) \neq 1 \Longrightarrow x ~ \text{are prices}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following test is a dummy one:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$A_{\text{dummy}}(x)=\frac{1}{n} \sum_{i=1}^n x_i &amp;gt; 1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is not good because a Forex time series are prices of a currency expressed in the base currency of the portfolio, and such a series would produce a result of 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I came up with a Type II test:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$A_\text{Type II}(x) = \exists i ~ x_i&amp;lt;0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that I assume that the input could be &lt;em&gt;either prices or returns&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A series of prices with non-negative returns would fool this test so it is not necessary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe it is impossible to come up with a Type I test, which implies that I can't come up with a Type III test either (otherwise I could construct a Type I test easily).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would be looking for extra Type II tests to improve the probability of wrong input detection.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have you ever had to do such test? What method would you recommend?&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2012-06-24T14:26:11.447" LastActivityDate="2012-06-25T22:22:00.837" Title="How do I statistically differentiate a series of prices from a series of returns?" Tags="&lt;returns&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3667" PostTypeId="1" AcceptedAnswerId="3678" CreationDate="2012-06-24T13:16:04.150" Score="21" ViewCount="7513" Body="&lt;p&gt;Returns possess non-zero skewness and excess kurtosis. If these assets are temporally aggregated both will disappear due to the law of large numbers. To be exact, if we assume IID returns skewness scales with $\frac{1}{\sqrt{n}}$ and kurtosis with $\frac{1}{n}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm interested in a concise, clear and openly accessible proof for the above statement preferably for all higher moments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question is inspired by this &lt;a href=&quot;https://quant.stackexchange.com/questions/3646/how-does-cornish-fisher-var-aka-modified-var-scale-with-time&quot;&gt;question&lt;/a&gt; by Richard which&#xA;deals with, among other things, the behaviour of the higher&#xA;moments of returns under temporal aggregation. I know about two&#xA;papers that answer this question. &lt;a href=&quot;http://journals.cambridge.org/action/displayAbstract;jsessionid=3755223AF410BE9A33AC715C57C860C5.journals?fromPage=online&amp;amp;aid=4491512&quot; rel=&quot;noreferrer&quot;&gt;Hawawini (1980)&lt;/a&gt; is wrong and &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/j.1540-6288.1989.tb00340.x/abstract&quot; rel=&quot;noreferrer&quot;&gt;Hon-Shiang and Wingender (1989)&lt;/a&gt; is behind a paywall and a bit inscrutable.&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2012-11-14T02:43:48.950" Title="Skewness and Kurtosis under aggregation" Tags="&lt;statistics&gt;&lt;returns&gt;&lt;skew&gt;&lt;kurtosis&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="3668" PostTypeId="2" ParentId="3666" CreationDate="2012-06-24T13:35:33.877" Score="3" Body="&lt;p&gt;I think that can never be 100% sure, and the most you could do is raise a warning, and your approach makes perfect sense to me.&lt;/p&gt;&#xA;&lt;p&gt;I want to point out one thing though. While prices cannot be negative, they are sometimes recorded with a negative sign, where negative sign conveys some other information. For example in CRSP:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Price&lt;/p&gt;&#xA;&lt;p&gt;Usually, the CRSP price is the closing price, the price of the last reported trade on any given day. However, if no trade is recorded&#xA;on a given trading day, the reported price will be the negative of the&#xA;average of the bid and asked prices for that day. The price reported&#xA;in CRSP monthly files is the price of the last trading day of the&#xA;month.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.library.hbs.edu/helpsheets/wrdscrspstock.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;link&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2512" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2012-06-24T13:35:33.877" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3669" PostTypeId="2" ParentId="3649" CreationDate="2012-06-24T16:30:11.617" Score="8" Body="&lt;p&gt;Given that the mathematical proofs have already been given above, let me stress the intuitive aspects of it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use a normal model, then you will find that the delta of an ATM option is equal to 50%, and at the same time, the probability of ending ITM (in the money) is also 50%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, with a lognormal model, there is a difference between the probability and the delta. The reason is actually very simple. Imagine you run a Montecarlo to figure the delta of an ATM call option. Say you've got around half the paths ending above the strike, and half below. Then clearly, if you were to rerun the Montecarlo, but starting from a slightly higher spot (say 1% because you want to calculate the delta so you 'bump' the spot up), then roughly speaking&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;all the paths that finished below the strike in the original MC will probably still finish below in the bumped MC. So for these the payoff of the option is unchanged. &lt;/li&gt;&#xA;&lt;li&gt;for those paths which ended in the money, given that your original spot is 1% higher, that means that the simulated spot is also 1% higher, but that 1% if obviously larger than 1% of spot because the simulated spot is ITM. So for these the payoff is increased by more than 1% of spot.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you combine the 2 points above, the price impact of bumping spot up by 1% is going to be 50% x 0 + 50% x (something &gt; 1% ), so the delta is going to be higher than the probability of ending ITM. You can even see that the 'something' is itself very tied to that actual value of the call option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously this relationship works irrespective of whether the option is ATM or not.&lt;/p&gt;&#xA;" OwnerUserId="2599" LastActivityDate="2012-06-24T16:30:11.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3671" PostTypeId="1" AcceptedAnswerId="3677" CreationDate="2012-06-24T21:14:04.850" Score="3" ViewCount="2163" Body="&lt;p&gt;I have a limited financial background but I'm trying to figure out the usefulness of buying size-n arbitrages (n &gt; 3), and I wonder the kind of risks - if any - associated with such a strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say that I simultaneously detect :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a triangular arbitrage with currencies A, B and C (one intermediate currency) ;&lt;/li&gt;&#xA;&lt;li&gt;a quadrangular arbitrage with currencies A, B, C and D (two intermediate currencies) ;&lt;/li&gt;&#xA;&lt;li&gt;a quintangular arbitrage with currencies A, B, C, D and E (three intermediate currencies) ;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Now suppose that I decide to buy all these arbitrage opportunities at the same time and buy, for each of them, the same amount of the first currency. If I get I right, I'll actually be buying 3 times the first size-3 arbitrage, 2 times the second one and 1 time the last one. Despite triangular arbitrage being theoretically risk-free, we know that we may encounter potential issues here when facing real market conditions, ie. latency, not to mentions transaction costs and finite (limited) margin.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Plus, buying the quadrangular arbitrage would also mean that we could possibly be buying up to 4 different triangular arbitrages opportunities instead (i.e. one, some or all of the following permutations : A, B, C / B, C, D / A, C, D / A, B, D).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reasoning goes on for all size n arbitrages opportunity where I could potentially be simultaneously buying at least &lt;strong&gt;n - 2&lt;/strong&gt; arbitrage opportunities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both theoretically and practically speaking, would it be wise to filter out some (or all) of these size &gt; 3 arbitrage opportunities, and if so, why ? Or, in the contrary, would a strategy actually benefit from simultaneously buying all these arbitrage opportunities ? The maths behind this puzzles me !&lt;/p&gt;&#xA;" OwnerUserId="2600" LastActivityDate="2012-06-30T18:48:16.643" Title="Usefulness of simultaneously buying triangular and multiple arbitrages on the Forex" Tags="&lt;risk-management&gt;&lt;fx&gt;&lt;arbitrage&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3672" PostTypeId="1" CreationDate="2012-06-25T14:40:19.200" Score="-3" ViewCount="1012" Body="&lt;p&gt;Can you recommend a good tutorial for working with tick data for the purpose of algorithmic trading?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the data normally stored in a database and only bits are read into memory at a time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some useful software that's easy to get?&lt;/p&gt;&#xA;" OwnerUserId="2603" LastActivityDate="2012-06-25T15:19:28.497" Title="Tutorial for working with tick data?" Tags="&lt;modeling&gt;&lt;arbitrage&gt;&lt;high-frequency&gt;&lt;tick-data&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="0" ClosedDate="2012-06-25T15:20:48.713" ContentLicense="CC BY-SA 3.0" />
  <row Id="3673" PostTypeId="2" ParentId="3672" CreationDate="2012-06-25T15:19:28.497" Score="5" Body="&lt;p&gt;Yes, there is a software application that you can purchase for $39.99 which stores all your tick data in a highly compressed format while still allowing maximum throughput and lowest latency data queries that I have ever seen. The package provides APIs to all languages under the sun but because they have a special sale going on it comes with the complete back testing and trading system in one single package. And guess what, they have thrown in a CEP engine for free as well. Its too hard to pass up if you ask me. Here is the link: do-your-own-damn-work-because-what-you-are-asking-for-is-something-others-worked-years-on-and-it-sounds-you-are-just-in-for-the-low-hanging-fruits-please-ask-elsewhere.com&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But seriously, dude, do a little homework on your own, google couple terms, get some basic information because you come across as being incredibly lazy, at the very least incredibly uninformed. You are asking others to give away information and to put in the time to respond to you intelligently, would be nice to see you show a little respect by doing a bit of the leg work beforehand. I am more than happy to walk you through everything but only when you ask specific questions that show you have done a bit work upfront. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this makes sense!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S.: I guess I am just a little fed up with more and more newbie questions ending up on this site. I thought this was a forum for people working in the industry, I am not saying this is a requirement but I would appreciate it if the previously higher standard of information sharing can be again maintained. Questions like &quot;please deliver the holy grail to my door steps&quot; really drive me nuts...;-)&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-06-25T15:19:28.497" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3674" PostTypeId="2" ParentId="3558" CreationDate="2012-06-25T16:49:06.530" Score="6" Body="&lt;p&gt;A concrete example of negative forward rates is provided by the 3M CHF LIBOR futures. They're all trading above a price of 100, which implies negative forward rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the prices &lt;a href=&quot;http://www.euronext.com/trader/summarizedmarketderivatives/summarizedmarketderivatives-2564-EN.html?euronextCode=S-LON-FUT&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;. Despite the prices of the forwards, CHF libor hasn't actually fixed negative yet. But the forwards are certainly all below zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, your formula for the forward rate doesn't strictly hold in today's interest rate world as the 3v6 basis spread can't be ignored. If you simply took 3M Libor, a 3Mx6M FRA, and the 6M Libor rate, that relationship would be violated.&lt;/p&gt;&#xA;" OwnerUserId="371" LastEditorUserId="371" LastEditDate="2012-06-25T16:55:12.393" LastActivityDate="2012-06-25T16:55:12.393" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3675" PostTypeId="2" ParentId="2260" CreationDate="2012-06-25T16:50:09.757" Score="2" Body="&lt;p&gt;The units of Sharpe ratio are 'per square root time', that is, if you measure the mean and standard deviation based on trading days, the units are 'per square root (trading) day'. It should be obvious then, how to re-express Sharpe ratio in different units. For example, to get to 'per root month', multiply by $\sqrt{253/12}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason why Sharpe has these units is because the drift term has units of 'return per time', while variance is 'returns squared per time'.&lt;/p&gt;&#xA;" OwnerUserId="108" LastActivityDate="2012-06-25T16:50:09.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3676" PostTypeId="2" ParentId="3666" CreationDate="2012-06-25T22:22:00.837" Score="4" Body="&lt;p&gt;You could test for whether the input series is I(0) vs the alternative of I(1).  Specifically, regress the input series on its own lag, and test whether the coefficient on the lag is significantly different from zero.  Price series should have a coefficient close to 1, while return series should have a coefficient close to 0.&lt;/p&gt;&#xA;" OwnerUserId="2027" LastActivityDate="2012-06-25T22:22:00.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3677" PostTypeId="2" ParentId="3671" CreationDate="2012-06-26T02:37:43.853" Score="7" Body="&lt;p&gt;I am not sure why your question had so many upvotes because in currency markets anything else but triangular arbitrage does not exist. What is a quadrangular arb, I have never heard of it despite having traded fx among other asset classes for over ten years now. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Think about it: Lets say you observe the price of EUR/USD. You can build triangular arbs by trading in 2 other pairs that flatten your exposure in EUR and USD in total, such as through EUR/CHF, and USDCHF. If trading in the other two pairs yields a synthetic price of EUR/USD where the bid is higher than the offer in outright EUR/USD and those prices are tradable and you can get filled without slippage (all grand assumptions) then selling the synthetic and buying the outright would yield you an instantaneous arbitrage profit. Likewise if the synthetic offer was lower than the outright bid then buying the synthetic and selling the outright would yield an arb profit. Its a very simple concept, whether you spot such opportunities often is an entirely different question. (I can tell you with confidence that it rarely ever happens, at least in a way that you not only spot the opportunity but also be able to successfully execute it)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would say, judging from your question, that you think of this concept as way too complicated. Given you are trading arbs you should engage in as many as possible (given you can execute it with an edge) because by definition you will always be hedged. Do not make it more complicated than it is, I do not care whether some &quot;coaches&quot; or &quot;books&quot; tell you that quintangular arb exists or not, it does not, but it sounds fancy. Fact remains especially in quant modeling, pricing, and quant trading: Always break concepts down to the simplest elements and level then it all makes sense. Of course it can happen that you spot two arbs at the same time and that this would entail to buy 2x EUR/USD or for that matter a multiple of any currency pair if this is what the sum of your arb trades dictates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not sure what puzzles you, because I think it shames the Mathematicians to call this &quot;math&quot;. So to answer: YES, engage in as many arb trades as you possibly can, if you spot more than 1-2 a day which you can actually execute in size then you are my hero and I will worship you. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this makes sense. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-06-26T02:37:43.853" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3678" PostTypeId="2" ParentId="3667" CreationDate="2012-06-26T03:59:39.577" Score="19" Body="&lt;p&gt;Just to be painfully clear, it only seems to make sense to consider the logarithm of returns, i.e. $X=\log (1+\frac r{100})$ for a simple return of $r\%$ in an arbitrary period because this is what sums when returns are temporally aggregated.  A basic property of &lt;strong&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Cumulant&quot;&gt;cumulants&lt;/a&gt;&lt;/strong&gt; is that cumulants of all orders are additive under convolution, for which a proof &lt;a href=&quot;http://www-biba.inrialpes.fr/Jaynes/cappc1.pdf&quot;&gt;can be found here here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if $X_1$, $X_2$, ... $X_n$ are &lt;strong&gt;i.i.d.&lt;/strong&gt;, then all the cumulants of $$Y_n = \sum_{i=1}^nX_i$$ scale linearly with $n$, i.e. $$\kappa_k(Y_n)=n\kappa_k(Y_1).$$  However, I suspect that you are normalizing this sum so that the variance (or volatility) remains constant with increasing $n$.  So instead let us consider $$Z_n=\frac{Y_n}{\sqrt n}= \frac 1 {\sqrt n} \sum_{i=1}^nX_i.$$  Another basic property of cumulants is that the $k$th cumulant is homogeneous of order $k$ as to scale.  Using both properties together we have $$\kappa_k(Z_n)=\left(\frac 1 {\sqrt n}\right)^k\kappa_k(Y_n)=\left(\frac 1 {\sqrt n}\right)^kn\kappa_k(Y_1)=\frac {\kappa_k(Z_1)}{n^{(k-2)/2}}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Don't forget that $Z_1=Y_1=X_1$.) Now we can show that the statistics scale as you have described: $$\textrm{variance}=\kappa_2(Z_n)=\kappa_2(Z_1)\propto 1;$$&#xA;$$\textrm{skewness} =\frac{\kappa_3(Z_n)}{\kappa_2(Z_n)^{3/2}}=\frac{\frac{1}{n^{1/2}}\kappa_3(Z_1)}{\kappa_2(Z_1)^{3/2}}\propto \frac 1{\sqrt n};$$&#xA;$$\textrm{ex. kurtosis}=\frac{\kappa_4(Z_n)}{\kappa_2(Z_n)^2}=\frac{\frac{1}{n}\kappa_4(Z_1)}{\kappa_2(Z_1)^{2}}\propto \frac 1 n.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no reason this cannot be extended to higher orders, although it works out more directly in terms of cumulants than of moments.  &lt;/p&gt;&#xA;" OwnerUserId="2561" LastEditorUserId="35" LastEditDate="2012-11-14T02:43:48.950" LastActivityDate="2012-11-14T02:43:48.950" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3679" PostTypeId="2" ParentId="3658" CreationDate="2012-06-26T16:20:14.997" Score="1" Body="&lt;p&gt;First of all, you should be using OAS, not YTM, as the risk-free interest rate component of YTM is known and should be imposed rather than estimated.  Second, rather than regressing OAS against a benchmark, regress &lt;em&gt;changes in&lt;/em&gt; OAS against changes in a benchmark OAS.  Then calculate a fitted OAS series from the change series, which naturally will not have any jumps where the backfill begins.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2012-06-26T16:20:14.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3683" PostTypeId="1" AcceptedAnswerId="3684" CreationDate="2012-06-26T19:05:53.080" Score="2" ViewCount="437" Body="&lt;p&gt;Do you know how to decompose the risk of index linked bonds? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To value a inflation linked bond, one plugs the real zero curve into the bond PV calculation, the real interest rate is as the fisher equation tells us: $r_{real}=r_{nom}-r_{be}$, where $r_{be}$ is the break even inflation rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say we hava a portfolio of inflation linked bonds and I want to decompose the risk into risk of the nominal interest rate and the break-even rate, or even derive risk contributions for the indidual bonds.  How can i achieve this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you have any ideas or any papers covering this topic?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much!&lt;/p&gt;&#xA;" OwnerUserId="2608" LastActivityDate="2012-06-26T21:35:12.187" Title="Risk Decomposition of Index linked Bonds" Tags="&lt;fixed-income&gt;&lt;risk-management&gt;&lt;inflation&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3684" PostTypeId="2" ParentId="3683" CreationDate="2012-06-26T21:35:12.187" Score="2" Body="&lt;p&gt;What I'm writing is based on the methodology in &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1565134&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1565134&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You observe the nominal and real bond prices/YTMs. Transform them to zero or forward curves. Estimate the multivariate dynamics and project them to your horizon, let's call this $X$. Use the distribution of zero/forward rates to obtain the distribution of prices at the horizon (and make assumptions about how your re-invest coupons or how you use cash at maturity), call this $R(X)$. For some holdings $h$, the distribution of portfolio returns at the horizon would be $h'R(X)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you followed the above approach, you can still apply the Fisher equation to obtain the breakeven inflation curve at your horizon. Alternately, you could also have the distribution of the individual bonds. Ultimately, you're gathering together some factors, call them $Z$, that you want to explain the returns of the portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You would then perform the optimization to minimize the residuals&#xA;$$&#xA;d_{w}	\equiv	argmin\left\{ E\left(\left(h'R\left(X\right)-d'Z\right)^{2}\right)\right\} &#xA;$$&#xA;and solve for d, subject to whatever constraints are appropriate. Note that to compute these residuals requires the conditional distribution between X and Z, refer to the Meucci paper for more details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, this is also complicated by the fact that sometimes linkers will have imbedded options. For instance, the U.S. Tips have an embedded option so that you get your principal back. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2012-06-26T21:35:12.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3685" PostTypeId="1" CreationDate="2012-06-27T00:20:37.740" Score="4" ViewCount="338" Body="&lt;p&gt;I have written a simulation that matches buy and sell orders, keeps track of an order book and simulates trades.  My first pass at order submission was to generate random orders around the bid/ask spread.  This does not produce a random walk in trade prices.  What happens is the orders are distributed evenly but around the bid/ask spread they get traded out but beyond this they start clumping together thereby forming 'price resistance'for want of a better word.  Is there an algorithm I can use that will result in a random walk for trade prices?&lt;/p&gt;&#xA;" OwnerUserId="1541" LastActivityDate="2012-07-02T19:16:26.987" Title="What sort of order submission strategy would result in a random walk of trade prices?" Tags="&lt;monte-carlo&gt;&lt;random-walk&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3686" PostTypeId="2" ParentId="3685" CreationDate="2012-06-27T05:10:31.817" Score="0" Body="&lt;p&gt;Analyzing this question theoretically, I think the following strategy will result in a random walk. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;the average size of limit orders is much smaller than the average size of market orders;&lt;/li&gt;&#xA;&lt;li&gt;the size of market order is random, and subjects to a kind of distribution;&lt;/li&gt;&#xA;&lt;li&gt;market buy orders and market sell orders arrive at random but evenly;&lt;/li&gt;&#xA;&lt;li&gt;the size of limit order subjects to a kind of distribution.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I do not know your strategy by detail, so I am not sure if your have considered the above items already. But by guess, it may be the first requirement that bothers you. Too many limit orders on the best-bid / best-ask seems tend to prevent market prices from change. In fact, as long as limit orders at best-bid / best-ask have the opportunity to be exhausted, the simulation strategy will generate a random walk, you just need a longer time to watch the price to walk away. Any way, it can still be called a &quot;random walk&quot;.&lt;/p&gt;&#xA;" OwnerUserId="2612" LastEditorUserId="848" LastEditDate="2012-06-27T05:28:28.153" LastActivityDate="2012-06-27T05:28:28.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3687" PostTypeId="1" AcceptedAnswerId="3696" CreationDate="2012-06-27T10:14:20.353" Score="7" ViewCount="1463" Body="&lt;p&gt;This question is meant as a sanity check whether i got the workflow right for pricing callable bonds. If anyone finds a mistake, or has a suggestion, please answer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The workflow is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;For every call date calculate:&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The probability that the bond is called&lt;/li&gt;&#xA;&lt;li&gt;The plain vanilla price of the bond as if it had a maturity to the call date&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Calculate the weighted average price of the bond with the following code&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;`&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Assume a callable with call dates t = 1...T-1 and normal maturity T&#xA;# CallProps - Vec of Probabilities that the bond is called at times t&#xA;# FullPrices - Vec of prices of a bond if it had maturity at t, T.&#xA;NoCallProps = 1-CallProps&#xA;CumNoCallProps = c(1,cumprod(NoCallProps))&#xA;WeightedPrice = 0&#xA;&#xA;for(i in 1:length(FullPrices))&#xA;{&#xA;WeightedPrice = WeightedPrice + CumNoCallProps[i] * (CallProps[i] * FullPrices[i])&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;`&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The call propabilities are calculated by Monte Carlo:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;take the current yield and simulate rate development between now and the call date with a CIR process (taken from the MATLAB library and adapted to R)&lt;/li&gt;&#xA;&lt;li&gt;compare the yield at the call date with the coupon of the bond, and call, if the yield is lower than the coupon&lt;/li&gt;&#xA;&lt;li&gt;Calculate the average of the calls for the number of replications. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="357" LastEditorUserId="357" LastEditDate="2012-07-02T08:05:03.390" LastActivityDate="2012-07-02T08:05:03.390" Title="Sanity check - How to price callables" Tags="&lt;monte-carlo&gt;&lt;pricing&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3689" PostTypeId="1" AcceptedAnswerId="3693" CreationDate="2012-06-27T23:24:39.323" Score="16" ViewCount="1721" Body="&lt;p&gt;Can someone shed some light on optimal ways to execute medium sized orders ~2000 shares in the market? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately the execution algo I have access to is very dumb. It follows the top-of-book price and hence I can see that the algo I am using is getting gamed by some predatory algo. For example, if the spread is 2 cents wide, a tiny order (say 100 shares) comes in to tighten the spread to 1 cent and is immediately canceled. Meanwhile my order moves its price to be top-of-book, but then sits alone after the cancel. My order gets hit and the market price moves against me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I switched over to using a TWAP / VWAP algo, but I want to get a better grasp of order execution. What rules should one follow to not get adversely selected or gamed like that?&lt;/p&gt;&#xA;" OwnerUserId="1696" LastEditorUserId="35" LastEditDate="2012-06-28T11:15:50.570" LastActivityDate="2021-02-05T08:10:15.667" Title="Optimal execution strategy" Tags="&lt;order-execution&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="3690" PostTypeId="2" ParentId="3646" CreationDate="2012-06-27T23:50:07.227" Score="6" Body="&lt;p&gt;If $z_\alpha$ is the so-called standard normal $z$-score of the significance level $\alpha$ such that&#xA;$$&#xA;\frac 1 {\sqrt{2\pi}}\int_{-\infty}^{z_\alpha} e^{-\xi^2/2}d\xi=\alpha&#xA;$$ &#xA;and we assume normality, (ignoring skewness and kurtosis,) then we can estimate the $\alpha$ quantile of a distribution with cdf $\Phi$ as $$\Phi^{-1}(\alpha)=\mu + \sigma z_\alpha.$$&#xA;The Cornish-Fisher expansion is an attempt to estimate this more accurately directly in terms of the first few cumulants as $$\Phi^{-1}(\alpha)=y_\alpha,$$ where (before we have applied any scaling)&#xA;$$y_\alpha= \kappa_1&#xA;+ \frac {z_\alpha}2&#xA;+ \frac {z_\alpha \kappa_2 }2&#xA;+ \frac {(z_\alpha^2-1) \kappa_3}6&#xA;+ \frac {(z_\alpha^3-3z_\alpha) \kappa_4}{24}&#xA;- \frac  {(2z_\alpha - 5z_\alpha) \kappa_3^2}{36}.&#xA;$$ (Note that $\mu=\kappa_1$ and $\sigma^2=\kappa_2$.) Expressed directly in terms of cumulants, let us try to scale this directly with time as the convolution of infinitely divisible, independent identically distributed random variables.  Cumulants of all orders scale linearly with time in this case, since they are simply additive under convolution.&#xA;$$y_\alpha[t] = \kappa_1t&#xA;+ \frac {z_\alpha}2&#xA;+ \frac {z_\alpha \kappa_2 t}2&#xA;+ \frac {(z_\alpha^2-1) \kappa_3 t}6&#xA;+ \frac {(z_\alpha^3-3z_\alpha) \kappa_4 t}{24}&#xA;- \frac  {(2z_\alpha - 5z_\alpha) \kappa_3^2 t^2}{36}.&#xA;$$ but we want $y_\alpha[t] = \mu t + (\sigma\sqrt t )x_\alpha[t]$ where $x_\alpha[t]$ is the quantile function of a random variable with zero mean and unit variance.  First the term $\kappa_1t$ drops off as our $\mu t$ since all the other cumulants are shift-invariant.  Second we need to divide each remaining cumulant $\kappa_kt$ by $(\sigma\sqrt t)^k=(\kappa_2t)^{k/2}$ (because the $k$th cumulant is homogeneous of order $k$.) So:&#xA;$$y_\alpha[t] = \mu t + \sigma\sqrt t \left[&#xA;z_\alpha&#xA;+ \frac {(z_\alpha^2-1) \kappa_3 t}{6(\kappa_2t)^{3/2}}&#xA;+ \frac {(z_\alpha^3-3z_\alpha) \kappa_4 t}{24(\kappa_2t)^2}&#xA;- \frac  {(2z_\alpha - 5z_\alpha) \kappa_3^2 t^2}{36(\kappa_2t)^3}\right].&#xA;$$&#xA;$$y_\alpha[t] = \mu t + \sigma\sqrt t \left[&#xA;z_\alpha&#xA;+ \frac {(z_\alpha^2-1) \kappa_3}{6\sigma^3t^{1/2}}&#xA;+ \frac {(z_\alpha^3-3z_\alpha) \kappa_4}{24\sigma^4 t}&#xA;- \frac  {(2z_\alpha - 5z_\alpha) \kappa_3^2}{36\sigma^6t}\right].&#xA;$$&#xA;but generally we write $\gamma_1=\kappa_3/\sigma^3$ and $\gamma_2=\kappa_4/\sigma^4$ for the skewness and the kurtosis respectively, so that&#xA;$$y_\alpha[t] = \mu t + \sigma\sqrt t \left[&#xA;z_\alpha&#xA;+ \frac {(z_\alpha^2-1) \gamma_1}{6\sqrt t}&#xA;+ \frac {(z_\alpha^3-3z_\alpha) \gamma_2}{24t}&#xA;- \frac  {(2z_\alpha - 5z_\alpha) \gamma_1^2}{36t}\right].&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Value-at-Risk is then&#xA;$$\mathrm{VaR} = K_0 \left( 1 - {\exp (y_{\alpha}[t]-rt})\right),$$&#xA;where $K_0$ is the initial capital, $\alpha$ is some level of &lt;a href=&quot;http://en.wikipedia.org/wiki/Statistical_significance&quot; rel=&quot;noreferrer&quot;&gt;significance&lt;/a&gt;, say 1 to 5% or so, and $r$ is some instantaneous risk-free rate, appropriate discount rate, or required rate of return, however one chooses to define it. (This expression ought to become negative for a long enough time, because in the long run one will almost surely make money if $\mu&amp;gt;0$.)&lt;/p&gt;&#xA;" OwnerUserId="2561" LastEditorUserId="2561" LastEditDate="2012-06-28T02:13:11.247" LastActivityDate="2012-06-28T02:13:11.247" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3691" PostTypeId="1" AcceptedAnswerId="3706" CreationDate="2012-06-28T04:20:08.083" Score="12" ViewCount="1415" Body="&lt;p&gt;I have a question regarding the proof of the Musiela parametrization for the dynamics of the forward rate curve.  If $T$ is the maturity, $\tau=T-t$ is the time to maturity, and $dF(t,T)$ defines the dynamics of the forward rate curve, then the Musiela parametrization defines the forward rate dynamics $$d\bar{F}(t,\tau)=dF(t,t+\tau)$$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is regarding the next step in the working of the Musiela parametrization.  All of the literature I've looked at explains the next line by simply stating that a &quot;slight variation&quot; of Ito is applied.  The line reads:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d\bar{F}(t,\tau)=dF(t,T)+\frac{\partial F}{\partial T}dt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone please clarify what variation of Ito is being used here?  I'm not following.  The parameters to $d\bar{F}$ do not include an Ito drift/diffusion process, so why is Ito being used?&lt;/p&gt;&#xA;" OwnerUserId="2586" LastEditorUserId="848" LastEditDate="2012-06-28T10:39:43.270" LastActivityDate="2012-07-01T17:15:58.503" Title="Musiela parameterization" Tags="&lt;estimation&gt;&lt;yield-curve&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3692" PostTypeId="2" ParentId="3671" CreationDate="2012-06-28T04:43:40.370" Score="6" Body="&lt;p&gt;While triangular arbitrages exists, they are a rare, short lived, and shallow. In several academic datasets they are very rarely seen, mainly for two reasons, market efficiency aside: (1) the time resolution of the data is not tick by tick but aggregated at some level (for example at 1 second intervals), (2) the dataset doesn't include all available quotes and transactions, but only those at a particular venue. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A overview and some analysis of the problem is done by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;D. Fenn, S. Howison, M. Mcdonald, S. Williams, and N. Johnson. The mirage of triangular arbitrage in the spot foreign exchange market. International Journal of Theoretical and Applied Finance, 12(08):1105– 1123, 2009.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They document that some triangular arbitrage opportunities do exist, but that have short durations (they disappear quickly, either because they are traded or because quotes are adjusted) and small magnitudes (the volume at the arbitragable quotes is thin). Fleeting duration is a vague term that depends on the time period considered. If in the late 90s this opportunities lasted 10s on average, as reported by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Y. Aiba, N. Hatano, H. Takayasu, K. Marumo and T. Shimizu, Triangular arbitrage as an interaction among foreign exchange rates, Physica A 310(3–4) (2002) 467–479;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;more recently these numbers are significantly lower (maybe 0.2 secs in 2010). As to the depth,  very rarely one can trade more than one or two lots (ballpark \$1M) on platforms such as &lt;a href=&quot;http://www.icap.com/markets/electronic-markets/ebs.aspx&quot; rel=&quot;nofollow&quot;&gt;EBS&lt;/a&gt;. Assuming no inventory exposure, an arbitrage of 1 pip (net of transaction costs and bid-ask spreads and latency risk) will pocket you $100.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bottom line, if its there its elusive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the topic of arbitrages involving more than 3 currency pairs, the first and foremost worry are trading costs, in particular the number of times that as a taker of liquidity you have to pay the spread. The direct consequence of having to pay higher effective trading costs is that the number of tradable arbitrage opportunities is much lower. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That being said, there are some theories (most notably the work of &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/j.1467-999X.2011.04140.x/abstract;jsessionid=A930E1CC9592972AF4D81918EC79E853.d03t03?deniedAccessCustomisedMessage=&amp;amp;userIsAuthenticated=false&quot; rel=&quot;nofollow&quot;&gt;Rod Ross et al&lt;/a&gt;) that suggest that arbitrage chains in currency markets involving 4 or more pairs might display a periodicity pattern. These claims are, to the best of my knowledge, completely academic and with no empirical support.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, the situation you describe is not realistic. Even in case of contemporaneous arbitrage opportunity, the amount of liquidity available is fairly limited and constrains your actions to trying to complete one arbitrage trade sequence as quickly as possible.&lt;/p&gt;&#xA;" OwnerUserId="1531" LastEditorUserId="1531" LastEditDate="2012-06-30T18:48:16.643" LastActivityDate="2012-06-30T18:48:16.643" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3693" PostTypeId="2" ParentId="3689" CreationDate="2012-06-28T11:11:44.753" Score="7" Body="&lt;p&gt;If your original algo's goal was the follow the top-of-book quote, then it should have had some &lt;em&gt;minimums&lt;/em&gt; before it would join a new quote. For example, the reference quote must have a minimum size shown and must be live for a minimum amount of time before you'll join.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, it helps to &quot;stack the book&quot; by breaking your quote into smaller orders at worse prices. So instead of submitting a bid of 2000 shares at \$25, submit one bid of 1000 shares at \$25 and another bid of 1000 shares at \$24.99.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2012-06-28T11:11:44.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3694" PostTypeId="2" ParentId="3689" CreationDate="2012-06-28T19:08:39.363" Score="6" Body="&lt;p&gt;If you want to be more aggressive without revealing your hand, place your orders as hidden orders inside the bid/ask.  Algos on the other side will fish with small size orders to see what is hidden however.   The fishing will not reveal the size of your order, but reveal that something is there.  Can get some size done this way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The advice above regarding when to join the bid or ask as well as stacking is good as well.  You may want to float at some spread with jitter to the inside price if it looks like there is enough noise to cross into the orderbook periodically.  This assumes that the market is trading sideways and you have time to get in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are chasing momentum then you need to cross or be positioned more aggressively.  Being clever with how you cross when aggressive is another art.&lt;/p&gt;&#xA;" OwnerUserId="51" LastActivityDate="2012-06-28T19:08:39.363" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3695" PostTypeId="1" AcceptedAnswerId="3861" CreationDate="2012-06-29T14:06:49.607" Score="6" ViewCount="822" Body="&lt;p&gt;It is well known that the standard estimator of the covariance matrix can lose the property of being positive-semidefinite if the number of variables (e.g. number of stocks) exceeds the number of observations (e.g. trading days). I think the matrix can become singular. I have a clear idea why (inspired by the geometry of the problem) but does anybody have a short but rigorous proof for this fact?&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2012-07-27T07:20:39.933" Title="Proof for non-positive semi-definite covariance matrix estimator" Tags="&lt;covariance&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3696" PostTypeId="2" ParentId="3687" CreationDate="2012-06-29T14:10:51.403" Score="7" Body="&lt;p&gt;You have the right intuition but the approach is not quite right.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The issuer has the right to call back the bond at a pre-defined call price. So your decision criterion is &quot;call when the value of the bond &gt;= contractual call price&quot;. We are comparing prices in the decision rule, not the YTM of the callable bond with the coupon of the bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that typically the call price is above par value (reflecting a call premium).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you need to value the bond under various interest rate scenarios according to your Monte Carlo simulation. After you simulate your interest rate paths, you will also need to use a recursive backward induction algorithm to value the callable bond at each node in a binomial tree. Take a weighted average of bond prices along each interest rate path to arrive at the value of the bond (first starting at the terminal nodes at maturity then working to back to the present day) remembering to use the discount rate prevailing at that point in time. Also, at any node you assign the call value in lieu of an otherwise option-free bond value wherever the option-free bond value is greater than the callable price (since these are the cases where it is rational for the issuer to call the bond). This is depicted in Node(D,D) below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is best visualized by a binomial tree:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/PyQmN.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some examples are in the attached &lt;a href=&quot;http://www.faculty.fairfield.edu/nlaopodis/ModelforvaluingBondswEmbeddedOptions.pdf&quot; rel=&quot;noreferrer&quot;&gt;paper by Frank Fabozzi&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-07-01T14:37:00.903" LastActivityDate="2012-07-01T14:37:00.903" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3697" PostTypeId="1" AcceptedAnswerId="3698" CreationDate="2012-06-29T14:53:53.973" Score="0" ViewCount="6794" Body="&lt;p&gt;I am trying to find out what &lt;em&gt;Exotics Trade Capture&lt;/em&gt; entails. I can't find anything on Google that isn't a job posting, which is where I saw this term.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say you did this for a living, how would you explain it to someone that didn't know anything about it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What references on the internet would you point them to find out more information about it?&lt;/p&gt;&#xA;" OwnerDisplayName="user2620" LastEditorDisplayName="user2620" LastEditDate="2013-12-02T01:53:51.130" LastActivityDate="2013-12-02T01:53:51.130" Title="Can someone explain what &quot;Exotics Trade Capture&quot; capture means in layman's terms?" Tags="&lt;trade&gt;&lt;exotics&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3698" PostTypeId="2" ParentId="3697" CreationDate="2012-06-29T16:14:27.070" Score="1" Body="&lt;p&gt;From &lt;a href=&quot;http://www.wilmott.com/messageview.cfm?catid=3&amp;amp;threadid=86072&quot; rel=&quot;nofollow&quot;&gt;Wilmott&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Trade capture is the process of booking (or capturing) the trade into&#xA;  the systems used within a financial organisation. This may sometimes have to happen multiple times&#xA;  depending on the complexity of the trades and the ability of the&#xA;  systems to be able to capture the economic, non-economic and static&#xA;  details surrounding the deal.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The ideal situation is to STP (Straight through process) these deals&#xA;  from the point of execution through to all of the banks systems with&#xA;  no manual touch points. Obviously the more vanilla the product, and&#xA;  the greater the volume, the more automated it will be. FX and cash&#xA;  equity for example, is highly automated, with only &quot;exceptions&quot;&#xA;  manually handled. Listed equity derivative trading is now heavily&#xA;  automated/ STP, although not entirely. One of the expected outcomes of&#xA;  increased regulation/ standardisation of credit/rate trades will be&#xA;  not only to force them onto clearing houses and exchanges, but also to&#xA;  increase the opportunity for STPing these deals into the risk systems&#xA;  of the financial institutions. In fact, it will almost certainly be&#xA;  expected and required.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And from &lt;a href=&quot;http://en.wikipedia.org/wiki/Exotic_derivatives&quot; rel=&quot;nofollow&quot;&gt;Wikipedia&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Exotic derivatives, in finance, refer to derivative instruments which&#xA;  have features making them more complex than commonly traded,&#xA;  &quot;vanilla&quot;, products, usually relating to determination of payoff.&#xA;  The category may also include derivatives with a non-standard subject&#xA;  matter (i.e. underlying), developed for a particular client or a&#xA;  particular market.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Note that the term has no precise meaning: the definition is dependent&#xA;  on time and place. Interest rate- and currency-swaps were exotic when&#xA;  they first appeared in the 1980s, but are now standard financial&#xA;  tools. Similarly, proprietary products originally developed by&#xA;  merchant banks or other financial institutions to meet the needs of&#xA;  particular clients may in time diffuse more widely into the market.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&quot;Exotics trade capture&quot; would presumably mean trade capture of exotics. &lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2012-06-29T16:14:27.070" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3699" PostTypeId="1" AcceptedAnswerId="7828" CreationDate="2012-06-29T16:49:10.040" Score="1" ViewCount="193" Body="&lt;p&gt;Assume we have two instruments &lt;code&gt;A&lt;/code&gt; and &lt;code&gt;B&lt;/code&gt;. Also time is increasing from 1 to n. Let's say that &lt;code&gt;A1&lt;/code&gt; is price of instrument &lt;code&gt;A&lt;/code&gt; at time &lt;code&gt;1&lt;/code&gt;. Let's assume that &lt;code&gt;A&lt;/code&gt; and &lt;code&gt;B&lt;/code&gt; are highly correlated instruments. Then we can try to compute &lt;code&gt;TruePrice&lt;/code&gt; of stock &lt;code&gt;B&lt;/code&gt; from stock &lt;code&gt;A&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then if &lt;code&gt;Bn&lt;/code&gt; is more enough than &lt;code&gt;TruePrice&lt;/code&gt; we sell &lt;code&gt;B&lt;/code&gt;, and if &lt;code&gt;Bn&lt;/code&gt; is less enough than &lt;code&gt;TruePrice&lt;/code&gt; we buy &lt;code&gt;B&lt;/code&gt;. I think that would be so-called &lt;code&gt;statistical arbitrage&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would prefer not to discuss pronse and cons of this scheme in general. Cause it proved to work cause I'm using it for a long time and still profitable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I really want to discuss is how can we compute &lt;code&gt;TruePrice&lt;/code&gt; having what we have. Let me describe two algorithms:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;TruePrice = Bn * ( (A1 + A2 + .... + An) / (B1 + B2 + .. + Bn) )&lt;/li&gt;&#xA;&lt;li&gt;TruePrice = Bn / n * (A1 / B1 + A2 / B2 + .... An / Bn)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Also please note that &lt;code&gt;Ai&lt;/code&gt; and &lt;code&gt;Bi&lt;/code&gt; are measurements of price. This could be &lt;code&gt;median&lt;/code&gt; &lt;code&gt;low&lt;/code&gt; &lt;code&gt;close&lt;/code&gt; or anything else of the certain interval (i'm using &lt;code&gt;median&lt;/code&gt; now). The last items &lt;code&gt;An&lt;/code&gt; and &lt;code&gt;Bn&lt;/code&gt; are &lt;code&gt;life&lt;/code&gt; i.e. changing while trading to reflect current situation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is what are prons and cons of each of these (&lt;code&gt;1&lt;/code&gt; and &lt;code&gt;2&lt;/code&gt;) algorithms? Probably you can suggest something else?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I'm using &lt;code&gt;1&lt;/code&gt; but I'm not satisfied with it. When instrument &lt;code&gt;A&lt;/code&gt; grow (so &lt;code&gt;An&lt;/code&gt; increase, other &lt;code&gt;Ai&lt;/code&gt; are fixed as they in &quot;past&quot;) &lt;code&gt;TruePrice&lt;/code&gt; is not changing enough. And you can see from formula that &lt;code&gt;TruePrice&lt;/code&gt; of stock &lt;code&gt;B&lt;/code&gt; depends a lot on &lt;code&gt;Bn&lt;/code&gt; what is actually &lt;code&gt;current B price&lt;/code&gt;. So &lt;code&gt;TruePrice&lt;/code&gt; of stock &lt;code&gt;B&lt;/code&gt; depends on stock &lt;code&gt;B&lt;/code&gt; too much what is not good. I think TruePrice of stock &lt;code&gt;B&lt;/code&gt; should more depends on correlated &lt;code&gt;An&lt;/code&gt;, but it doesn't.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure if &lt;code&gt;2&lt;/code&gt; would solve this problem.&lt;/p&gt;&#xA;" OwnerUserId="1337" LastActivityDate="2013-04-25T00:43:53.520" Title="help me compare methods to compute one instrument price from another instrument price" Tags="&lt;statistics&gt;&lt;arbitrage&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3701" PostTypeId="1" CreationDate="2012-06-30T20:06:29.350" Score="1" ViewCount="563" Body="&lt;p&gt;I'm trying to adapt tools from portfolio theory for another use, and I have a question about how I might do so. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose that instead of having normally distributed returns, the return $R_i$ is either, say, 3 or 0. So, $E(R_i)=3P(R_i=3)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the wiki page for Modern Portfolio, it says &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Note that the theory uses standard deviation of return as a proxy for risk, which is valid if asset returns are jointly normally distributed or otherwise elliptically distributed.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I'm mainly interested in computing expected returns and risk a la &lt;a href=&quot;http://en.wikipedia.org/wiki/Modern_portfolio_theory#Risk_and_expected_return&quot; rel=&quot;nofollow&quot;&gt;wiki&lt;/a&gt;. I'd like to use those as metrics in comparing a relatively small number of possible portfolios. But obviously in the case I'm interested in, the returns aren't normally distributed. What are the consequences of still using standard deviation of returns as a &quot;proxy for risk&quot;? Is there an alternative measure that makes more sense? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How bad would it be to pretend that the returns are normally distributed, centered at the mean of the bernoulli return, with the same variance? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The stakes aren't particularly high and currently the only tool for what I'm trying to do is human judgment and experience (the application isn't in finance). &lt;/p&gt;&#xA;" OwnerUserId="2624" LastEditorUserId="2624" LastEditDate="2012-07-01T00:16:56.777" LastActivityDate="2012-07-01T08:44:50.703" Title="Proxy for risk in portfolio theory when return can take only two values" Tags="&lt;risk-models&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio-selection&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3703" PostTypeId="2" ParentId="26" CreationDate="2012-06-30T21:20:01.613" Score="6" Body="&lt;p&gt;For pricing, there are a few products whose prices are sensitive to the &lt;em&gt;forward smile&lt;/em&gt; and when you compute that with just local vol, it is not realistic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you are a seller, you go to the next church and find something that looks kindof reasonable, and that kind of can reconstruct a reasonnable forward smile structure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The game in pricing is to not sell for 0 something that you know can't be 0.&#xA;Especially if 90% of the product price comes from this particular effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For hedging one could try to add this and that dependency, but the chance are you are off big time on 2 other things.&lt;/p&gt;&#xA;" OwnerUserId="172" LastActivityDate="2012-06-30T21:20:01.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3704" PostTypeId="2" ParentId="3701" CreationDate="2012-06-30T23:11:24.083" Score="0" Body="&lt;p&gt;Here is an example where using standard deviation as a measure of risk does not make sense:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say that &#xA;Case 1:&#xA;Probability of getting 3 is 0.5, and probability of getting 0 is 0.5. Your expected return is &lt;code&gt;1.5&lt;/code&gt;, and you expected standard deviation is &lt;code&gt;1.5&lt;/code&gt; (I hope my calculation is right). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Case 2:&#xA;Probability of getting 5 is 0.5, and probability of getting 0 is 0.5. Your expected return is &lt;code&gt;2.5&lt;/code&gt;, and you expected standard deviation is &lt;code&gt;2.5&lt;/code&gt; (I hope my calculation is right). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But does Case 2 really have higher risk? If so how? Would anyone ever prefer option in Case 1 because it is less riskier? In the above case increasing standard deviation when going from Case 1 to Case 2 has only positive effect and no negative effect, and option in Case 2 is clearly a better choice. Something like this will not happen in we have normal distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Value_at_risk&quot; rel=&quot;nofollow&quot;&gt;Value at Risk&lt;/a&gt; is an alternative risk measure you could look at.&lt;/p&gt;&#xA;" OwnerUserId="2512" LastActivityDate="2012-06-30T23:11:24.083" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3705" PostTypeId="1" CreationDate="2012-07-01T00:42:11.827" Score="7" ViewCount="537" Body="&lt;p&gt;If I understand right, Itô's lemma tells us that for any process $X$ that can be adapted to an underlying standard normal Wiener measure $\mathrm dB_t$, and any twice continuously differentiable function $f$,&#xA;$$\mathrm df(X_t) = f'(X_t)\mathrm dX_t + \frac 1 2 f''(X_t)\mathrm d[X_t] ,$$&#xA;where $$[X_t]=\lim_{\|\Pi\|\rightarrow0}\sum_{i=1}^{n}\left(X_{t_i}-X_{t_{i-1}}\right)^2,$$&#xA;$0=t_0 &amp;lt; \cdots &amp;lt; t_n=t$, and $\|\Pi\|=\max_{1\le k\le n}|t_k-t_{k-1}|$, is the quadratic variation.  We are allowed to ignore all higher power variations because all cumulants higher than the second vanish for the normal distribution.  But &lt;a href=&quot;https://quant.stackexchange.com/questions/3667/skewness-and-kurtosis-under-aggregation&quot;&gt;the additivity of cumulants under convolution&lt;/a&gt; leads us naturally to consider a stochastic process based on an arbitrary distribution subject only to the requirements that it be infinitely divisible and possess a moment-generating function.  So if we let $A_t$ be the constant-linear-drift+martingale process having such a distribution, and we define the higher power variations&#xA;$$[A_t]_n=\lim_{\|\Pi\|\rightarrow0}\sum_{i=1}^{n}\left(A_{t_i}-A_{t_{i-1}}\right)^n,$$&#xA;then these all exist and are equal to the corresponding &lt;em&gt;cumulants&lt;/em&gt; of the distribution of $A_t$.  This complicates Itô's lemma, which, again if I understand right, must now be written:&#xA;$$\mathrm df(X_t) = f'(X_t)\mathrm dX_t + \sum_{k=2}^{\infty}\frac 1{n!} f^{(n)}(X_t)\mathrm d[X_t]_n ,$$ but this is not so bad, because all these higher power variations converge in probability and scale linearly with time, except that now we need $f$ to be infinitely differentiable.  So, starting off from here, what are the most important consequences to stochastic calculus of refusing to assume that a process can be adapted to a measure based on a normal distribution?&lt;/p&gt;&#xA;" OwnerUserId="2561" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-05-13T17:53:06.403" Title="How to measure a non-normal stochastic process?" Tags="&lt;stochastic-calculus&gt;&lt;stochastic-processes&gt;&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3706" PostTypeId="2" ParentId="3691" CreationDate="2012-07-01T01:36:32.513" Score="3" Body="&lt;p&gt;$dF(t,T)$ describes the dynamics of the rate of a particular forward contract as time $t$ moves forward to a fixed expiration $T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d\bar F(t,\tau)$ describes the dynamics of the rate at a particular point on the yield curve as time moves forward.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The differential $\frac{\partial F}{\partial T}dt$ is simply the difference between holding the expiration time $T$ constant in the case of $F$ and moving it ahead with time $t$ to stay at the same point $t+\tau$ on the yield curve in the case of $\bar F$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Somewhere underlying all this is a drift-diffusion process, but it isn't stated explicitly in your equations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dF(t,t+\tau)$ is a &quot;total&quot; differential of $F$ with respect to a simultaneous change in both its arguments.  This becomes the sum of a partial differential w.r.t. change in the first argument only, $dF(t,T)$, and a partial differential w.r.t. change in the second argument only, $\frac{\partial F}{\partial T}dt$, as time moves forward.&lt;/p&gt;&#xA;" OwnerUserId="2561" LastEditorUserId="2561" LastEditDate="2012-07-01T17:15:58.503" LastActivityDate="2012-07-01T17:15:58.503" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3707" PostTypeId="2" ParentId="3705" CreationDate="2012-07-01T08:31:58.833" Score="4" Body="&lt;p&gt;The standard method to manage your kind of problem (i.e. dealing with stochastic processes that are note presented or built thanks to a Brownian motion) is to use a measure change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The power of Brownian motion is that you have a lot of representation theorems (Doob-Meyer theorem, Wold theorem, etc) that allows to (thanks to a change of measure or a localization method), provides you a way to define a space in which your process (or the residual of your process once you &lt;em&gt;removed&lt;/em&gt; easy to deal with components) behaves like a martingale. So you can use Itô on it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only effects that can &lt;em&gt;change&lt;/em&gt; the Itô formula should be:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;jumps (but you have an Itô semi-martingale formula as far as the Jumps are of Lévy-type, see for instance &lt;a href=&quot;http://books.google.fr/books?hl=fr&amp;amp;id=sUgXKpUIdHwC&quot; rel=&quot;nofollow&quot;&gt;Jacod-Shiryaev&lt;/a&gt; or &lt;a href=&quot;http://books.google.fr/books?id=bVlieV8GBrIC&quot; rel=&quot;nofollow&quot;&gt;Cont-Tankov&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;li&gt;fractional Brownian motion (but here again you have an Itô-like formula, see form instance &lt;a href=&quot;http://kuscholarworks.ku.edu/dspace/bitstream/1808/278/1/dhp.pdf&quot; rel=&quot;nofollow&quot;&gt;Stochastic Calculus for Fractional Brownian Motion, I. Theory, by Duncan&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For others you should first think about the proper &lt;em&gt;cleaning&lt;/em&gt; of the process and change of measure before doing something fancy I think.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="92" LastEditDate="2012-07-02T11:02:14.303" LastActivityDate="2012-07-02T11:02:14.303" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3708" PostTypeId="2" ParentId="3701" CreationDate="2012-07-01T08:44:50.703" Score="3" Body="&lt;p&gt;First you need to define what you need a risk measure for. It is usually to take a decision, so you have an operational criterion that defines your risk. You should go back at this point and see what is the impact of a change of distribution on it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just say for instance that you need a risk measure to take decisions according to a &lt;strong&gt;Sharpe ratio&lt;/strong&gt; and define it like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$${\cal S}(R) = \frac{R-R_0}{\sigma(R)} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In such a case the Sharpe ratio is useful because it can be read as a straightforward proxy of the probability that your returns are greater than $R_0$ assuming that $R$ follows a &lt;strong&gt;Gaussian process&lt;/strong&gt; (here we are), because if you define $\Phi$ the repartition function of a Gaussian (i.e. $\mathbb{P}(G&amp;gt;g)=\Phi(g)$) you have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{P}(R&amp;gt;R_0)=\Phi( {\cal S}(R)) = \Phi\left( \frac{R-R_0}{\sigma(R)} \right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So now &quot;&lt;em&gt;what if $\tilde R$ is no more Gaussian?&lt;/em&gt;&quot;. For the same operational criterion (i.e. probability to be greater than a base $R_0$), you can find the answer very easily:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;if $R_0$ is greater than 3: &#xA;$$\mathbb{P}({\tilde R}&amp;gt;R_0)=0$$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;if $R_0$ is lower than 0: &#xA;$$\mathbb{P}({\tilde R}&amp;gt;R_0)=1$$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;else&#xA;$$\mathbb{P}({\tilde R}&amp;gt;R_0)=1-\mathbb{P}({\tilde R}=3)$$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So you have the answer (it can be reproduced for any other distribution that your toy example):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;go back to your operational criterion&lt;/li&gt;&#xA;&lt;li&gt;write its meaning for your distribution&lt;/li&gt;&#xA;&lt;li&gt;you have the answer&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2012-07-01T08:44:50.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3709" PostTypeId="2" ParentId="3689" CreationDate="2012-07-01T09:01:42.510" Score="9" Body="&lt;p&gt;There is a wide literature on optimal execution, among others:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.iijournals.com/doi/abs/10.3905/JOT.2009.4.3.040&quot; rel=&quot;nofollow noreferrer&quot;&gt;Rigorous Strategic Trading: Balanced Portfolio and Mean-Reversion, by Lehalle, 2009, Vol. 4, No. 3: pp. 40-46&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://epubs.siam.org/doi/abs/10.1137/090777293&quot; rel=&quot;nofollow noreferrer&quot;&gt;Optimal Control of Trading Algorithms: A General Impulse Control Approach, by Bouchard, Dang, Lehalle, in SIAM J. Finan. Math., 2(1), 404–438&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://arxiv.org/abs/1205.3482&quot; rel=&quot;nofollow noreferrer&quot;&gt;Optimal starting times, stopping times and risk measures for algorithmic trading, by Labadie, Lehalle (Journal of Investment Strategies v3, n2 (Dec 2014) pp:3-33)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://epubs.siam.org/doi/abs/10.1137/090780596&quot; rel=&quot;nofollow noreferrer&quot;&gt;Optimal Split of Orders Across Liquidity Pools: A Stochastic Algorithm Approach, by Laruelle, Lehalle, Pagès, SIAM J. Finan. Math., 2(1), 1042–1076.&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://arxiv.org/abs/1106.3279&quot; rel=&quot;nofollow noreferrer&quot;&gt;Optimal Portfolio Liquidation with Limit Orders, by Guéant, Lehalle, Fernandez-Tapia (SIAM Journal on Financial Mathematics 3.1 (2012): 740-764.)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Practically, you will need knowledge of market microstructure to take the good decision on a market-by-market basis (for instance some markets accept native icebergs, other not; some markets offers dark pools or fully hidden orders, etc). I would recommend the reading of &lt;a href=&quot;https://rads.stackoverflow.com/amzn/click/com/1119952417&quot; rel=&quot;nofollow noreferrer&quot; rel=&quot;nofollow noreferrer&quot;&gt;Market Microstructure: Confronting Many Viewpoints (The Wiley Finance Series, 2012), Abergel, Bouchaud, Foucault, Lehalle, Rosenbaum, Eds&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;That being said, you need to take car of two effects to design a trading algo:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;risk control (not going too fast to impact the orderbook dynamics and to avoid adverse selection, not going too slow to be protected against adverse moves of the price), that for use max and min participation ratios or something similar&lt;/li&gt;&#xA;&lt;li&gt;opportunities: look at the orderbook, use statistical learning, look at &lt;em&gt;reference prices&lt;/em&gt; (like index moves), etc.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;[UPDATE]&#xA;The 2nd edition of &amp;quot;&lt;a href=&quot;https://www.worldscientific.com/worldscibooks/10.1142/10739&quot; rel=&quot;nofollow noreferrer&quot;&gt;Market Microstructure in Practice&lt;/a&gt;&amp;quot; (Lehalle, Laruelle and contributions from Burgot, Lasnier and Pelin) provides a coverage of a lot of practical aspects of optimal trading.&lt;/p&gt;&#xA;&lt;p&gt;Two other books are covering the topic:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.cambridge.org/fr/academic/subjects/mathematics/mathematical-finance/algorithmic-and-high-frequency-trading?format=HB&amp;amp;isbn=9781107091146&quot; rel=&quot;nofollow noreferrer&quot;&gt;Algorithmic and High-Frequency Trading&lt;/a&gt;, by Álvaro Cartea, Sebastian Jaimungal, José Penalva&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.routledge.com/The-Financial-Mathematics-of-Market-Liquidity-From-Optimal-Execution-to/Gueant/p/book/9781498725477&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Financial Mathematics of Market Liquidity&lt;/a&gt;, By Olivier Gueant&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2021-02-05T08:10:15.667" LastActivityDate="2021-02-05T08:10:15.667" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="3710" PostTypeId="2" ParentId="3685" CreationDate="2012-07-01T09:26:20.887" Score="4" Body="&lt;p&gt;You have intense academic research on orderbook dynamics simulations, just cite:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://arxiv.org/abs/0909.1974&quot; rel=&quot;nofollow&quot;&gt;Econophysics: Empirical facts and agent-based models, by Anirban Chakraborti, Ioane Muni Toke, Marco Patriarca, Frederic Abergel (Arxiv 2010)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://books.google.fr/books?id=7vfJq2DiuyMC&amp;amp;lpg=PA73&amp;amp;dq=lehalle%20razafinimanana&amp;amp;pg=PA73#v=onepage&amp;amp;q=lehalle%20razafinimanana&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;High Frequency Simulations of an Order Book: a Two-Scales Approach&#xA;by: Charles-Albert Lehalle, Olivier Guéant, Julien Razafinimanana, In Econophysics of Order-Driven Markets (2010) edited by: F. Abergel, B. K. Chakrabarti, A. Chakraborti, M. Mitra&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://arxiv.org/abs/1011.6402&quot; rel=&quot;nofollow&quot;&gt;The Price Impact of Order Book Events, by Rama Cont, Arseniy Kukanov, Sasha Stoikov (Arxiv 2011)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;(1) is a generic survey, (2) provides you a way to build consistent simulations and different scales (i.e. controlling the volatility, the bid-ask spread and their relation along the whole day), (3) is more local but allow to simulate a consistent way the order flow dynamics and the price one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One simple way to improve you simulations is to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;have a model for the bid-ask spread&lt;/li&gt;&#xA;&lt;li&gt;choose Point processes (Poisson or better: &lt;a href=&quot;http://arxiv.org/abs/1202.0842&quot; rel=&quot;nofollow&quot;&gt;Hawkes&lt;/a&gt;) to model the input and output in the queues&lt;/li&gt;&#xA;&lt;li&gt;use Rama's model to generate a price: when a queue (Bid or Ask) equals zero, move the price (down or up)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you want to have proofs that the diffusive limit of a point process will be a Brownian motion, you can read for example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1735338&quot; rel=&quot;nofollow&quot;&gt;Price Dynamics in a Markovian Limit Order Market, by Cont, Larrard&lt;/a&gt; - using order flow model&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://arxiv.org/abs/1101.3422&quot; rel=&quot;nofollow&quot;&gt;Modeling microstructure noise with mutually exciting point processes, by E. Bacry, S. Delattre, M. Hoffmann, J.F. Muzy&lt;/a&gt; - for Hawkes processes use&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2012-07-02T19:16:26.987" LastActivityDate="2012-07-02T19:16:26.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3711" PostTypeId="1" AcceptedAnswerId="3713" CreationDate="2012-07-01T13:26:54.437" Score="2" ViewCount="756" Body="&lt;p&gt;I just saw the question &lt;a href=&quot;https://quant.stackexchange.com/questions/3210/how-to-calculate-the-most-realistic-historical-option-prices-with-additional-pub&quot;&gt;How to calculate the most realistic historical option prices with additional publicly available parameters&lt;/a&gt; and I am interested in the step before that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I calculate historical ATM option prices for the SP500 using VIX prices and other publicly available data? Can I just use VIX as implied volatility? can I go slightly out of the money (to 2% or 5%)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any links to examples or code will be appreciated!&lt;/p&gt;&#xA;" OwnerUserId="262" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2012-07-01T14:26:10.307" Title="Calculate historical (ATM) option prices with public data" Tags="&lt;options&gt;&lt;volatility&gt;&lt;vix&gt;&lt;pricing&gt;&lt;spx&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3712" PostTypeId="2" ParentId="2402" CreationDate="2012-07-01T14:07:09.197" Score="1" Body="&lt;p&gt;The vega is quite linear for ATM options. It's convex mostly for OTM and ITM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An intuitive explanation is that an OTM option with zero volatility will be worth zero. If you increase the volatility by 1% then most likely the price is still close to zero. Therefore the vega is zero (or tiny). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if you increase the volatility sufficiently, clearly at some point the option is going to have a reasonable value, and a positive vega. Therefore as you increased volatility, vega increased (from zero to something), which shows the convexity. &lt;/p&gt;&#xA;" OwnerUserId="2599" LastActivityDate="2012-07-01T14:07:09.197" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3713" PostTypeId="2" ParentId="3711" CreationDate="2012-07-01T14:26:10.307" Score="2" Body="&lt;p&gt;I don't know if I understand your question correctly but the procedure how to calculate ATM option prices with publicly available implied volatility indices (like VXO) for the vol parameter can be found in the mentioned paper on pages 5-7:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://leeds.colorado.edu/asset/burridge/backtestmadoffsclaims.pdf&quot; rel=&quot;nofollow&quot;&gt;How Students Can Backtest Madoﬀ’s Claims by Michael J. Stutzer (2009)&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2012-07-01T14:26:10.307" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3714" PostTypeId="2" ParentId="3205" CreationDate="2012-07-01T17:16:45.557" Score="9" Body="&lt;p&gt;&lt;strong&gt;Regarding conventions&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One thing to keep in mind in all questions about &quot;what's right and what's not?&quot; is that conventions don't always matter as much as one would think.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When a trader marks his vols by looking up option prices on the market, he is going to mark them using the pricing model which his quants implemented. So whether he uses one convention or the other, he's still going to get the same price for these options and most likely similar prices for other options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, to answer your question, when it comes to time conventions, neither calendar nor business days are really correct. If you use calendar days then your options will have 3 days time decay on Monday which you can't do anything against. And yet in some cases one can think that the market moves more between Fri close and Mon close than other days so biz days would not be appropriate either. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What some desks, especially in equities implement is an elastic time. That means they weight time depending on much they believe the market will move relative to other days. So for instance any day with foreseeable volatility due to some number announcements (results or nonfarm payroll) will have a heavier weight. That means that on these days your options will have more decay, which is fair given that the market is expected to move more as well. However these are very subtle considerations for large volume market-making desks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Regarding expiry date&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is customary to model the option as equal to the intrinsic value on the day of expiry. Risk managing expiring options is a known headache, and again this is usually done by market-making specialists. Most options traders will avoid having options expiring in their books which are too close to the strike, and if they have them they will have to do a lot of adhoc delta hedging.&lt;/p&gt;&#xA;" OwnerUserId="2599" LastActivityDate="2012-07-01T17:16:45.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3717" PostTypeId="2" ParentId="2640" CreationDate="2012-07-02T14:52:01.133" Score="2" Body="&lt;p&gt;There are a couple limitations to bond portfolio immunization.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's start by analyzing cash-flow matching which is a dedication strategy that is the alternative to immunization. Cash-flow matching can completely eliminate interest rate risk. The cash-flow match is setup such that the liabilities (outflows) are precisely offset by portfolio inflows on the same dates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The challenge is that it is not easy to find bonds with the precise cash-flow payoff patterns. Moreover, bonds are subject to credit risk and potentially contingent claims risk (i.e. callable bonds) so the immunization is not risk-free presenting some limitations. Cash-flow matching will protect against any change in the shape of the yield curve including large interest rate changes (since the key rate durations of the liabilities precisely match the key rate durations of the assets).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, cashflow matching is more expensive than alternatives such as contingent immunization or optimizing a portfolio that minimizes a measure such as IRS (interest rate sensitivitiy). For example, if I have a view that rates are rising I would not want to use a zero-coupon bond to cash-flow match a single liability -- I'd rather receive some coupons that I can re-invest at a higher rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Contingent immunization can provide some scope for active management which can potentially lower the cost of immunizing a portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are multiple immunization strategies -- single period immunization, multiple liability immunization, and immunization for general cash flows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The necessary conditions for a successful immunization are that i) the PV of the Assets = the PV of the Liabilities, ii) the portfolio duration = duration of the Liabilities, and iii) the distribution of the durations of the assets must have higher variance than the distribution of liabilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a result, some of the limitations of immunization are that:&#xA;- works for parallel shifts only (so you are exposed to yield curve risk. (Use of optimization with the Interest Rate Sensitivity measure can address this)&#xA;- Needs continuous monitoring and re-balancing of portfolio duration levels &#xA;- This re-balancing creates transaction costs&#xA;- If any bond defaults a major rebalancing or cash infusion is required&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One can use derivatives (such as binary options or credit spread options) to construct portfolios that payoff if the interest rate changes by +/- 4%. &lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-07-02T17:15:05.107" LastActivityDate="2012-07-02T17:15:05.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3720" PostTypeId="2" ParentId="3438" CreationDate="2012-07-03T07:48:48.987" Score="6" Body="&lt;p&gt;Nobody is saying that the swap rate is used as such in calculations of funding rates. What happens is that the yield curve is constructed using a &lt;strong&gt;series of instruments&lt;/strong&gt;, together with their &lt;strong&gt;current market prices&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These instruments are usually &lt;strong&gt;short term futures&lt;/strong&gt;, &lt;strong&gt;deposits&lt;/strong&gt;, ... and &lt;strong&gt;swaps&lt;/strong&gt;. The &lt;strong&gt;yield curve is constructed by solving&lt;/strong&gt; so that each of these instruments returns the current market price. For practical reasons this is usually done by bootstrapping, i.e. trying to find the front of the yield curve to satisfy the shortest maturity and then using that to determine the curve further back.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So swap and swap rates are used mostly because they are the most liquid long-term instrument, but people could choose to calibrate using other instruments if they were quoted on the market.&lt;/p&gt;&#xA;" OwnerUserId="2599" LastActivityDate="2012-07-03T07:48:48.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3721" PostTypeId="1" CreationDate="2012-07-03T08:25:42.613" Score="8" ViewCount="4121" Body="&lt;p&gt;I am trying to get my hands on Entropy Pooling which was introduced by Meucci in this &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1542083&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, assume I want to construct a portfolio with five stocks and I have my view on CVaR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I use Entropy-Pooling method to manage my portfolio?&lt;/p&gt;&#xA;" OwnerUserId="2635" LastEditorUserId="467" LastEditDate="2012-11-26T18:59:49.837" LastActivityDate="2012-11-26T18:59:49.837" Title="How can I use Entropy-pooling of Atillio Meucci to constuct a portfolio?" Tags="&lt;risk&gt;&lt;portfolio-management&gt;&lt;optimization&gt;&lt;asset-allocation&gt;&lt;entropy-pooling&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3722" PostTypeId="1" CreationDate="2012-07-03T12:46:51.713" Score="1" ViewCount="168" Body="&lt;p&gt;If Libor is found to be fraudulently fixed, are any of the derivative contracts with a floating libor leg still valid?&lt;/p&gt;&#xA;" OwnerUserId="2363" LastActivityDate="2012-07-12T13:51:00.573" Title="Derivatives with a floating Libor leg" Tags="&lt;floating-rate&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3723" PostTypeId="2" ParentId="3721" CreationDate="2012-07-03T13:01:05.193" Score="7" Body="&lt;p&gt;Meucci covers this example precisely in his paper &quot;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1213325&quot;&gt;Fully Flexible Views: Theory &amp;amp; Practice&lt;/a&gt;&quot;. You can find his code &lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/21307&quot;&gt;here&lt;/a&gt; for three examples related to the paper. The Butterfly Trading example covers the CVAR scenario.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-07-03T13:30:29.443" LastActivityDate="2012-07-03T13:30:29.443" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3724" PostTypeId="1" AcceptedAnswerId="3807" CreationDate="2012-07-03T14:48:26.467" Score="2" ViewCount="673" Body="&lt;p&gt;I'm looking at automating the calculation of margin requirements for a portfolio of Eurex markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Eurex describe the margin calculations in &lt;a href=&quot;http://www.eurexclearing.com/download/documents/publications/rbm_final_en.pdf&quot; rel=&quot;nofollow&quot;&gt;this document&lt;/a&gt;. However, the only tool I can find is a Windows only, UI driven &lt;a href=&quot;http://www.eurexclearing.com/customer_service/training/margin_calculator_en.html&quot; rel=&quot;nofollow&quot;&gt;application&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can go ahead and implement the algorithm as described, but are there other tools used to calculate Eurex margin requirements?&lt;/p&gt;&#xA;" OwnerUserId="2637" LastEditorUserId="1106" LastEditDate="2012-07-13T13:37:03.153" LastActivityDate="2012-07-13T13:37:03.153" Title="How to automate the margin requirements for Eurex markets?" Tags="&lt;derivatives&gt;&lt;market&gt;&lt;eurex&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3725" PostTypeId="5" CreationDate="2012-07-03T14:50:26.573" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Margin_(finance&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Margin_(finance&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="2637" LastEditorUserId="2637" LastEditDate="2012-07-03T15:00:59.967" LastActivityDate="2012-07-03T15:00:59.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3726" PostTypeId="4" CreationDate="2012-07-03T14:50:26.573" Score="0" Body="Margin is the collateral that the holder of a financial instrument must deposit to cover some or all of the credit risk to its counterparty (most often the broker or an exchange)." OwnerUserId="2637" LastEditorUserId="35" LastEditDate="2012-07-03T15:00:48.717" LastActivityDate="2012-07-03T15:00:48.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3727" PostTypeId="1" AcceptedAnswerId="3813" CreationDate="2012-07-03T18:13:42.660" Score="4" ViewCount="887" Body="&lt;p&gt;I have looked at the Variance Swap Papers published by &lt;a href=&quot;http://elis.sigmath.es.osaka-u.ac.jp/research/gs-volatility_swaps.pdf&quot; rel=&quot;nofollow&quot;&gt;GS-VarSwap&lt;/a&gt; and &lt;a href=&quot;http://sbossu.com/docs/VarSwaps.pdf&quot; rel=&quot;nofollow&quot;&gt;JPM-VarSWap&lt;/a&gt; where they talk about approximation to VarSwap strike using ATMF vol and Skew (slope of the volatility skew for 90-110 strikes).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, I have also come across another 'skew measure' which is defined as&#xA;$$&#xA;\mathrm{skew} = \frac{\sqrt{T}(\sigma_1 - \sigma_2)}{\log(K_1/K_2)}.&#xA;$$&#xA; I understand that $\sqrt{T}$ makes the vol difference 'normalized' in maturity-space. And to my surprise, this measure remains almost constant for mid-to-long term maturities (&gt;6M).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions are&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What could be the assumption behind taking log-strikes instead of absolute strikes?&lt;/li&gt;&#xA;&lt;li&gt;What is the intuition behind this measure being constant for different maturities for a given underlying?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2011" LastEditorUserId="2011" LastEditDate="2014-11-10T16:49:01.677" LastActivityDate="2014-11-10T16:49:01.677" Title="Why does Skew measure remain more-or-less constant for Listed Expiries?" Tags="&lt;implied-volatility&gt;&lt;skew&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3728" PostTypeId="1" CreationDate="2012-07-03T18:30:06.063" Score="8" ViewCount="2047" Body="&lt;p&gt;I am trying to use fundamental factors such as PE, BV, &amp;amp; CFO in a multivariate linear regression with the response variable being the rolling 1 month returns. But this approach seems flawed as the autocorrelation of the residuals is to high and the Durbin Watson test points also to such flaws. What is the best what to use long time horizon rolling returns in a linear regression?&lt;/p&gt;&#xA;" OwnerUserId="2642" LastEditorUserId="467" LastEditDate="2012-07-08T11:08:40.040" LastActivityDate="2015-07-09T16:56:29.530" Title="Using rolling returns in a multivariate linear regression?" Tags="&lt;returns&gt;&lt;regression&gt;&lt;multivariate&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3730" PostTypeId="2" ParentId="3722" CreationDate="2012-07-04T20:28:20.350" Score="1" Body="&lt;p&gt;I assume that rate derivatives refers to a given underlying libor index that is published by either BBA, EBF or so and that than no counterparty can deny its liability wrt the contract. As such contracts are still valid between the counterparties eventhough one counterparty can suite the responsible of the fraud itself.&lt;/p&gt;&#xA;" OwnerUserId="2619" LastActivityDate="2012-07-04T20:28:20.350" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3731" PostTypeId="1" CreationDate="2012-07-04T22:25:19.843" Score="7" ViewCount="468" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Pricing an IR swap doesn't require any stochastic model but calculation of the PFE for an IR swap would require the Hull White Model or any other stochastic short rate or forward rate model.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Is this statement correct and if so, why?&lt;/p&gt;&#xA;" OwnerUserId="928" LastEditorUserId="1106" LastEditDate="2012-07-09T14:51:49.967" LastActivityDate="2012-07-12T21:01:44.040" Title="Is it true that pricing an IR swap doesn't require any stochastic model but calculation of the PFE of an IR swap would?" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;derivatives&gt;&lt;pricing&gt;&lt;swaps&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3732" PostTypeId="1" CreationDate="2012-07-04T23:04:43.373" Score="3" ViewCount="240" Body="&lt;p&gt;In this portfolio optimization utility (and others), mean return, standard deviation and correlation among assets are required inputs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://finance.wharton.upenn.edu/~stambaugh/portopt.html&quot; rel=&quot;nofollow&quot;&gt;http://finance.wharton.upenn.edu/~stambaugh/portopt.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the same time, I've seen other portfolio optimizers that start with historical price data and a covariance matrix is calculated as a step in optimizing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://investexcel.net/215/mean-variance-portfolio-optimization-with-excel/&quot; rel=&quot;nofollow&quot;&gt;http://investexcel.net/215/mean-variance-portfolio-optimization-with-excel/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the same underlying data set is used, and the definition of the optimal portfolio is the same in both optimizers, will the results be the same?&lt;/p&gt;&#xA;" OwnerUserId="2647" LastEditorUserId="467" LastEditDate="2012-07-05T06:32:23.660" LastActivityDate="2012-07-05T11:02:29.367" Title="What is the difference between these two optimization procedures?" Tags="&lt;optimization&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3733" PostTypeId="1" CreationDate="2012-07-05T00:14:14.647" Score="8" ViewCount="887" Body="&lt;p&gt;I am looking to get a better understanding of an output from a trading strategy. Basically I have a daily equity curve lets call it $Y_t$. I have defined a bunch of independent variables $X_{it}$ that I think can explain the movement in the daily PnL. The independent variables are not used in trading signal generation directly.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) How can I go about deducing which independent variables explain my $Y_t$ , assuming that the relationship could be non-linear? I can start out with PCA but from what I understand it assumes a linear relationship.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Using a reduced independent variable set $X_{it}$ from 1) how do I go about defining a non-linear relationship with $Y_t$ . Neural Nets maybe?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that doing 1) and 2) might result in overfitting but I just want to understand the equity curve better. &lt;/p&gt;&#xA;" OwnerUserId="1696" LastActivityDate="2014-08-29T09:20:03.867" Title="How to better understand trading signals?" Tags="&lt;machine-learning&gt;&lt;data-mining&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3737" PostTypeId="2" ParentId="3732" CreationDate="2012-07-05T06:31:33.630" Score="4" Body="&lt;p&gt;You know that the correlation between 2 assets is defined as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Corr(X,Y) = \frac{Cov(X,Y)}{\sigma_X \sigma_Y}$$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you provide the algorithm with either the correlation matrix and the standard deviation of the components or with the covariance matrix alone, is has the same information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The formula that will be used for the optimization algorithm will be something like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\underset{w}{\arg \min} \quad w \Sigma w' \quad \text{s.t} \quad \mu w' \geq \bar{\mu}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $\Sigma$ is the covariance matrix and hence $w \Sigma w'$ is the variance of the portfolio with allocation $w$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This problem is specified slightly differently in your examples, but yield equivalent results:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\underset{w}{\arg \max} \quad \mu w' - \rho w \Sigma w'\ $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $\rho$ is the risk aversion coefficient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that providing correlation as input means nothing... It simply was computed previously.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="35" LastEditDate="2012-07-05T11:02:29.367" LastActivityDate="2012-07-05T11:02:29.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3738" PostTypeId="1" CreationDate="2012-07-05T07:49:44.573" Score="1" ViewCount="415" Body="&lt;p&gt;Does anyone know how to connect IQFeeds with Matlab. It seems the datafeed toolbox only accepts Reuters, Bloomberg, Yahoo and one or two more. I've been looking all over the place for a Matlab toobox or some code because I'm using IQFeeds. It's weird because on here I've read many posts of people talking about their IQFeeds into MAtlab as if its just normal and their question instead focusses on the API conncetion with IB or something. Can anyone please help me since I feel totally on my own here?&lt;/p&gt;&#xA;" OwnerUserId="2649" LastActivityDate="2018-12-27T16:51:18.160" Title="Matlab toolbox for IQFeeds" Tags="&lt;automated-trading&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3739" PostTypeId="1" AcceptedAnswerId="3773" CreationDate="2012-07-05T09:59:12.210" Score="8" ViewCount="1275" Body="&lt;p&gt;After years of mathematical finance I am still not satisfied with the idea of a risk premium in the case of stocks. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I agree that (often) there is a premium for long dated bonds, illiquid bonds or bonds with credit risk (which in fact they all have). I can explain this to my grandmother. My question is very much in the vein of &lt;a href=&quot;https://quant.stackexchange.com/questions/1279/debunking-risk-premium-via-hedging-argument-or-why-even-in-the-real-world&quot;&gt;this one&lt;/a&gt;. &#xA;Yes, investors want to earn more than risk free but do they always get it? Or does the risk premium just fill the gap - sometimes positive sometimes negative? &#xA;Finally: Do you know any really good publications where equity risk premium is explained and made plausible in the case of stocks? Does it make any sense to say &quot;with $x\%$ volatility I expect a premium of $y\%$&quot;? Sometimes stocks are just falling and there is risk and no premium. What do you think? &lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2019-09-04T19:03:57.807" Title="Why should there be an equity risk premium?" Tags="&lt;equities&gt;&lt;risk&gt;&lt;research&gt;&lt;theory&gt;&lt;risk-premium&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="3742" PostTypeId="2" ParentId="3738" CreationDate="2012-07-05T19:24:07.067" Score="1" Body="&lt;p&gt;you could create your own socket code to connect to it.  You need to have developer rights to get an understanding of the socket api.  They have said they would come up with something &quot;prebuilt&quot; on the next release of matlab 2012b (2nd half of year)&lt;/p&gt;&#xA;" OwnerUserId="2654" LastActivityDate="2012-07-05T19:24:07.067" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3743" PostTypeId="2" ParentId="3739" CreationDate="2012-07-06T03:57:59.763" Score="6" Body="&lt;p&gt;This is the &lt;strong&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Equity_premium_puzzle&quot; rel=&quot;noreferrer&quot;&gt;equity premium puzzle.&lt;/a&gt;&lt;/strong&gt; (See that article for references.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My thoughts are that individual investors are rational to be risk-averse and demand a premium for bearing a type of market risk that cannot be diversified away.  This risk is actually worse and more insidious than it appears, because &quot;personal&quot; circumstances tend to correlate in undesirable ways with the market:  when times are booming and people have steady incomes and money to invest, it's likely to go into the market at a high, and not much premium is demanded; conversely, when times are a little tougher, with wages and income tight and stagnating, and costs of education, healthcare, gas etc. skyrocketing, people are likely to forgo even a substantial equity premium in favor of a conservative rainy day fund, simply because they feel that money subject to market risk is not likely to be there when they are likely to need it the most, (in the event things get even worse.)  In other words, rational investors may be concerned that market crashes correlate with mass layoffs, or other possible losses to their own businesses or livelihoods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is puzzling to me that even long-term bonds are to all appearances at negative real yields, when these are more market-determined than affected by central bank policies anyways.  It either reflects profoundly low long-term expectations for economic growth, or extreme long-term risk aversion, and the two are almost impossible to tell apart.  In fact, substantial losses will be incurred by bondholders if interest rates revert to the mean or rise even moderately, but investors in the long bond must be willing to pay this price for some protection in the event of a Japan-like secular bear market with perpetual ZIRP, and if the bonds do lose value in the medium term, (and they most likely will,) that will most likely be because the economy will have recovered, and with it the stock market, and many other opportunities to recoup those losses.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Despite the Orwellian proclamations of the &quot;new normal&quot; by the elite economic punditry, and even though health care and education are outrageously out of reach of the &quot;middle class&quot; and are still subjected to double-digit cost increases every year, no, they have not always been so exorbitantly expensive, and in fact there was a time when a young man could work his way through college by a summer job, and even see the doctor once in a while, and not even that long ago, there was even a time when you could teach children thrift by the virtues of compound interest without being scoffed at.  And even though they say we've always been at war with Eastasia, I believe that tomorrow will bring an even newer normal, and the economy will in time heal.  I have to conclude that there is at present a substantial equity risk premium.&lt;/p&gt;&#xA;" OwnerUserId="2561" LastActivityDate="2012-07-06T03:57:59.763" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3744" PostTypeId="2" ParentId="3739" CreationDate="2012-07-06T08:21:15.463" Score="3" Body="&lt;p&gt;Another observation that the connection between return and risk is not that straightforward (and in contradiction to modern portfolio theory!) is the &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1585031&quot; rel=&quot;nofollow noreferrer&quot;&gt;low-volatility anomaly&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It turns out empirically that stocks that have low-volatility or low-beta show &lt;em&gt;higher&lt;/em&gt; returns than high-volatility or high-beta stocks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also this question and answers:&lt;br&gt;&#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/2870/why-does-the-minimum-variance-portfolio-provide-good-returns&quot;&gt;Why does the minimum variance portfolio provide good returns?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&lt;br&gt;&#xA;See also my new answer here: &lt;a href=&quot;https://quant.stackexchange.com/a/25724/12&quot;&gt;https://quant.stackexchange.com/a/25724/12&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2016-04-29T17:42:18.487" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3745" PostTypeId="1" AcceptedAnswerId="3747" CreationDate="2012-07-06T09:29:13.980" Score="2" ViewCount="5610" Body="&lt;p&gt;I'm currently working with historical index data from Yahoo Finance and would like to plot the GARCH(1,1) volatility of these indexes. I'm working with the Datafeed and Finance Tollboxes in Matlab right now, and I'm able to get the data and plot the indexes. However I'm having some difficulty understanding the following methodology to get the GARCH sigmas.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;clf;&#xA;clear all;&#xA;%close all;&#xA;format short;&#xA;&#xA;t = cputime;&#xA;Connect = yahoo;&#xA;dataFTSE=fetch(Connect,'^FTSE','Jan 1 1990',today, 'd');&#xA;dataN225=fetch(Connect,'^N225','Jan 1 1990',today, 'd');&#xA;dataGSPC=fetch(Connect,'^GSPC','Jan 1 1990',today, 'd');&#xA;close(Connect);&#xA;tsFTSE=fints(dataFTSE(:,1),dataFTSE(:,end),'FTSE100','d','FTSE100');&#xA;tsN225=fints(dataN225(:,1),dataN225(:,end),'NiKKEI225','d','NiKKEI225');&#xA;tsGSPC=fints(dataGSPC(:,1),dataGSPC(:,end),'SP500','d','SP500');&#xA;subplot 311;&#xA;plot(tsFTSE)&#xA;xlabel('Time (date)')&#xA;ylabel('Adjusted Close price ($)')&#xA;subplot 312;&#xA;plot(tsGSPC)&#xA;xlabel('Time (date)')&#xA;ylabel('Adjusted Close price ($)')&#xA;subplot 313;&#xA;plot(tsN225)&#xA;xlabel('Time (date)')&#xA;ylabel('Adjusted Close price ($)')&#xA;yt = get(gca,'YTick');&#xA;set(gca,'YTickLabel', sprintf('%.0f|',yt))&#xA;e = cputime - t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From then on I get the indexes in financial objects, where the prices are in cell arrays. What I think needs to happen is to fit the GARCH(1,1) model like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ugarch(U,1,1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where U is a vector with just the prices of the index?&#xA;I don't have a lot of experience with Matlab's data structures so any info or references will be greatly appreciated. &#xA;The reason I don't want to use the R script is to have some uniformity of plots in my thesis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;--EDIT--&#xA;I'm appending some more code which I think produces the plot I was after. It should be relatively easy to vectorize the index inputs and produce different plots.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dataGSPCret = [0.0 price2ret(dataGSPC(:,end))'];&#xA;retGSPC=fints(dataGSPC(:,1),dataGSPCret','retSP500','d',...&#xA;    'retSP500');&#xA;[coeff3, errors3, LLF3, innovations3, sigmas3] = ...&#xA;    garchfit(dataGSPCret);&#xA;sigmaGSPC = fints(dataGSPC(:,1),sigmas3','retSP500',...&#xA;    'd','retSP500');&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then plot the GARCH variance over the daily returns.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;figure(2);&#xA;subplot 311; hold on;&#xA;plot(retFTSE); plot(sigmaFTSE); hold off;&#xA;subplot 312; hold on;&#xA;plot(retN225); plot(sigmaN225); hold off;&#xA;subplot 313; hold on;&#xA;plot(retGSPC); plot(sigmaGSPC); hold off;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2658" LastEditorUserId="2658" LastEditDate="2012-07-12T08:20:35.480" LastActivityDate="2017-05-11T11:19:42.373" Title="How do I model GARCH(1,1) volatility for historical indexes in Matlab?" Tags="&lt;programming&gt;&lt;garch&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3746" PostTypeId="1" AcceptedAnswerId="3774" CreationDate="2012-07-06T13:11:20.410" Score="18" ViewCount="7245" Body="&lt;p&gt;I was asked yesterday by a colleague why we are doing asset allocation using optimizers which target, for a minimum expected return:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the portfolio with the minimum variance&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the portfolio with the minimum expected shortfall&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;and why nobody uses drawdown optimizations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do know that the list above is not exhaustive, but I have never seen an allocation method which was aiming to minimize the drawdown for a given expected return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first thing that came to my mind is that the drawdown problem would not be convex and hence it would be difficult to find an optimal allocation using classic optimization model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also wanted to point out that drawdown measure are based on past measures and are not useful to &quot;predict&quot; the future -- drawdowns are history. So, an optimization based on drawdowns would probably result in data mining bias.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you see a point I missed?&#xA;Is one of my points wrong?&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2014-05-19T10:24:53.877" Title="Why is the Drawdown measure not used for portfolio optimization?" Tags="&lt;risk&gt;&lt;optimization&gt;&lt;asset-allocation&gt;" AnswerCount="5" CommentCount="3" FavoriteCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="3747" PostTypeId="2" ParentId="3745" CreationDate="2012-07-06T14:22:55.517" Score="2" Body="&lt;p&gt;You would want to use garchfit if you have it. If you don't have access to that you could use the &lt;a href=&quot;https://www.kevinsheppard.com/MFE_Toolbox&quot; rel=&quot;nofollow noreferrer&quot;&gt;MFE toolbox&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, as for the inputs, it could be a vector with a constant mean of zero. This would be like fitting an AR(p) model to the prices and then estimating the Garch parameters on the residuals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Matlab has updated the Econometrics toolbox in recent years so that one would no longer use the garchfit function. &lt;a href=&quot;https://www.mathworks.com/help/econ/converting-from-garch-functions-to-models.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;These&lt;/a&gt; are instructions on how to convert the older garchfit code into the current code. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastEditorUserId="2379" LastEditDate="2017-05-11T11:19:42.373" LastActivityDate="2017-05-11T11:19:42.373" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3748" PostTypeId="2" ParentId="3746" CreationDate="2012-07-06T14:33:58.123" Score="7" Body="&lt;p&gt;Actually, Ralph Vince's &lt;a href=&quot;http://eu.wiley.com/WileyCDA/WileyTitle/productCd-0470455950.html&quot;&gt;Leverage Space Trading Model&lt;/a&gt; does utilise draw down. A short introductory pdf is available &lt;a href=&quot;http://www.automated-trading-system.com/wp-content/uploads/2010/03/Vince-LeverageSpaceModel.pdf&quot;&gt;here&lt;/a&gt;, and the R-forge package is &lt;a href=&quot;http://r-forge.r-project.org/projects/lspm/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Briefly, a genetic algorithm is used to model the maximum expected portfolio return based on a joint probability distribution of the portfolio component returns, subject to an overall maximum draw down constraint.&lt;/p&gt;&#xA;" OwnerUserId="252" LastActivityDate="2012-07-06T14:33:58.123" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3749" PostTypeId="2" ParentId="3746" CreationDate="2012-07-06T14:36:24.627" Score="5" Body="&lt;p&gt;With minimum variance, the covariance matrix does not change when you change the holdings. So all the optimizer needs to do is change the weights. This makes it easy to calculate the gradients.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To construct the drawdown statistic, you would need the distribution of returns in each period to your horizon. You would then need to calculate the path of profits given your holdings and then calculate the drawdown. You would not be able to write a function for the gradients, which means that you could potentially get into trouble during the optimization.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One alternative is to construct a mean-variance frontier and then using those portfolios calculate the drawdowns. You could then choose the optimal portfolio based on some measure that incorporates drawdown. This can also be done with expected shortfall. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2012-07-06T14:36:24.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3750" PostTypeId="1" CreationDate="2012-07-06T15:47:58.617" Score="2" ViewCount="462" Body="&lt;p&gt;I am new to corporate finance and I ask myself why an investor is interested in being &lt;em&gt;short&lt;/em&gt; an option? He can only can win a premium but he can lose much more. I understand with being a short, I  cap the profits on a stock like this:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/hTA3M.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;I think this is a quite theoretical case, right? I'd like to understand the possible benefits in practice.&lt;/p&gt;&#xA;" OwnerUserId="2660" LastEditorUserId="31748" LastEditDate="2020-07-05T15:37:52.603" LastActivityDate="2020-07-05T15:37:52.603" Title="What is the benefit of holding a short option?" Tags="&lt;options&gt;&lt;option-strategies&gt;&lt;derivatives&gt;" AnswerCount="6" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="3751" PostTypeId="2" ParentId="3750" CreationDate="2012-07-06T16:36:00.593" Score="13" Body="&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Market_maker&quot;&gt;Market makers&lt;/a&gt;, obviously, have to be willing to short an option. They will &lt;a href=&quot;http://en.wikipedia.org/wiki/Delta_neutral&quot;&gt;delta hedge&lt;/a&gt; their positions to limit risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for investors, they can aim for a &lt;a href=&quot;http://en.wikipedia.org/wiki/Buy-write&quot;&gt;buy-write strategy&lt;/a&gt; to collect extra income in lieu of unlimited upside.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And lastly, someone who owns a stock he can't sell right away (such as an entrepreneur still under a vesting period after his firm has been acquired) can limit the price range by creating a &lt;a href=&quot;http://en.wikipedia.org/wiki/Collar_%28finance%29&quot;&gt;collar&lt;/a&gt;. The income from selling the call will offset the cost of buying the put.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2012-07-06T16:36:00.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3752" PostTypeId="2" ParentId="3750" CreationDate="2012-07-06T17:35:48.933" Score="5" Body="&lt;p&gt;As a complement to chrisaycock's answer, I would also say that shorting options is useful when you want to create option strategies. Buying and shorting options on the same underlying with different strike prices allows the investor to create products with elaborate payoff which allows them to be more on a range of the underlying's price rather than on its direction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well known examples are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Straddle&quot; rel=&quot;nofollow&quot;&gt;Straddle&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Straddle&quot; rel=&quot;nofollow&quot;&gt;Reverse straddle&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Butterfly_%28options%29&quot; rel=&quot;nofollow&quot;&gt;Butterfly&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Iron_condor&quot; rel=&quot;nofollow&quot;&gt;Iron condor&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2012-07-07T09:25:51.747" LastActivityDate="2012-07-07T09:25:51.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3753" PostTypeId="1" CreationDate="2012-07-06T18:50:57.713" Score="8" ViewCount="6587" Body="&lt;p&gt;A common and oft repeated belief regarding options volatility is that implied volatility increases due to people bidding up a contract, usually related to anticipation of the outcome of an expected event. After the event, volatility drops because more people are selling the contracts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I have noticed contracts with ZERO volume with an increase in IV, and after the event those same contracts with ZERO volume now are quoted at lower prices after IV has dropped. The only market participants that are &quot;bidding up&quot; or &quot;bidding down&quot; are the market makers, and they never fill each other, just change their quotes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fallacy is that nobody is interested in those contracts therefore IV should not increase. The market makers' computers simply change their bid and ask because the IV has changed, not the other way around.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a more comprehensive options volatility study I can read that more accurately addresses change in volatility? I have reservations about what is commonly said about volatility vs what I see in the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On these illiquid contracts, perhaps the long standing idea of implied volatility is simply of no use here, and if people really think these contracts are worth what they are, then the portion of the contract's price that is based on IV should be spread out amongst the other variables, mainly theta.&lt;/p&gt;&#xA;" OwnerUserId="1453" LastEditorUserId="1106" LastEditDate="2012-07-09T14:44:41.427" LastActivityDate="2013-03-27T19:13:07.810" Title="What really drives option implied volatility?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;implied-volatility&gt;&lt;market-making&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3754" PostTypeId="2" ParentId="3753" CreationDate="2012-07-06T20:58:17.030" Score="0" Body="&lt;p&gt;The implied volatility as its name suggests, is implied from a price, be it the last traded price, a bid or an ask price. In the case where there has been no trade for an option, the implied volatility is likely to have been calculated from the bid/ask (or the mid-quote). &lt;/p&gt;&#xA;" OwnerUserId="2663" LastActivityDate="2012-07-06T20:58:17.030" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3757" PostTypeId="1" AcceptedAnswerId="3758" CreationDate="2012-07-07T16:05:14.633" Score="1" ViewCount="2667" Body="&lt;p&gt;I'd like to calculate portfolio allocation beta on a portfolio that has different asset classes.  The portfolio may be made up of:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Short term bond fund (with beta tied to Barclays U.S. Aggregate Bond Index)&#xA;Sector fund 1 (with beta tied to DOW)&#xA;SP500 fund (with beta tied to SP500 index)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I understand how to calculate portfolio beta if all assets are benchmarked off the same index but not when beta is heterogenous.  Can anyone provide a formula(s) of how it is calculate along with some simple examples?&lt;/p&gt;&#xA;" OwnerUserId="2666" LastActivityDate="2012-07-07T17:32:30.703" Title="Calculating portfolio allocation beta with different asset classes?" Tags="&lt;modeling&gt;&lt;portfolio-management&gt;&lt;risk-management&gt;&lt;beta&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3758" PostTypeId="2" ParentId="3757" CreationDate="2012-07-07T17:32:30.703" Score="5" Body="&lt;p&gt;Let's first restate the formula of the beta of a portfolio $P$ relative to a benchmark $B$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\beta_P=\frac{Cov(r_P,r_B)}{Var(r_B)} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As chrisaycock said in his comment, the key thing to understand is that the beta is a statistical measure computed relative to a benchmark. Hence, I believe that the real question you should be asking is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Which benchmark should I choose to compute a $\beta$ for a global portfolio?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no real answer to that question; it depends who you want to present it to and what you are trying to demonstrate. The easy (and naive) answer would be to use a global equity index such as MSCI World. I believe that it is better to look into a factor analysis where you estimate the sensitivity of your portfolio to different risk factors, as I discussed in this &lt;a href=&quot;https://quant.stackexchange.com/questions/3552/what-are-the-steps-to-perform-properly-a-risk-factor-analysis-on-a-portfolio&quot;&gt;post&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The different factors you will choose will then be several indices of the different asset classes (MSCI  World, Bonds Global Aggregate, etc).&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2012-07-07T17:32:30.703" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3759" PostTypeId="2" ParentId="3753" CreationDate="2012-07-07T21:37:59.710" Score="12" Body="&lt;p&gt;The way market makers mark their volatility curves is by using models which 'fill in the gaps', i.e. they will make a price for a given option even if they do not believe this option is going to get a lot of volume. They are still willing to go long/short because they have a strategy to hedge their overall position (i.e. by managing their greeks and expiries).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So they make some assumption on what the overall vol curve is (as function of time / strike), and also of how the ATM vol relates to perhaps some more liquid underlier (for example they will use the vol for a sector index as a proxy to vol for a single underlier).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, the price (and therefore the implied vol) may change even when there are no transactions, just because some of assumptions or market parameters have changed. If the implied vol increases for one particular option, it may be not because demand for that option has gone up, but just because demand for other options (which are considered related) has gone up.&lt;/p&gt;&#xA;" OwnerUserId="2599" LastActivityDate="2012-07-07T21:37:59.710" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3760" PostTypeId="1" AcceptedAnswerId="3761" CreationDate="2012-07-07T22:08:50.130" Score="-3" ViewCount="164" Body="&lt;p&gt;Are there any methods/techniques that cover distributing cash into a specific percent of a portfolio asset class while gaining the best average price?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a simple example, a portfolio starts with 100k cash.  It eventually disburses its cash into four asset classes.  This means 25k goes to purchase assets in each class.  If one of these classes is the SP500 index, you might decide to divide the 25k into four purchases, getting a better price with each purchase.  For example, assuming the SP500 is dropping, purchase might be made at:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    $6250 buy 1350&#xA;    $6250 buy 1325&#xA;    $6250 buy 1300&#xA;    $6250 buy 1275&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For an average price of 1312.50 in your SP500 allocation of the portfolio.  However, in the real world, you will not be so lucky.  You might buy 1350, the SP500 drops to 1339, then bounces to 1362 and remains above 1350 for the next few weeks.  You only made one purchase and was not able to take better advantage of gains in the SP500. Or, it may continue dropping to 1225.  You spent all your 25% allocation for this class at 1275 and are not able to take advantage of a much better average price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Funds are available upfront.  Shorting isn't allowed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What area covers techniques that deal with this topic?&lt;/p&gt;&#xA;" OwnerUserId="2666" LastEditorUserId="2666" LastEditDate="2012-07-08T01:52:19.423" LastActivityDate="2012-07-08T03:51:21.497" Title="Methods for distributing cash into allocation" Tags="&lt;equities&gt;&lt;portfolio-management&gt;&lt;returns&gt;&lt;portfolio-selection&gt;" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3761" PostTypeId="2" ParentId="3760" CreationDate="2012-07-08T03:51:21.497" Score="3" Body="&lt;p&gt;Even if some buy side funds are not allowed to short sell it does not mean they must buy. They could long sell, they can do nothing and stand on the sidelines and they can hedge, selling index futures or buy put protection on broad indexes or on the underlying of core holdings. Why this is an important point becomes apparent when you start to think about your question. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are basically asking what a fund should do when it thinks prices go down and what a fund should do when it thinks prices go up. You may disagree but in the end this is what every fund, every trader, portfolio manager has to ask him/herself. Most of the times when market move in your favor you will not be as fully invested as you wished and often times markets simply trade against your position. Dollar cost averaging is one of the worst investment techniques and lead to the poor house, long term, no matter what some academic papers have to say. Its simply stupid to bet against the market. If you believe markets will ease and you cannot short then simply do nothing or buy protection but DONT BUY. So, I am not sure what further guidance beyond what I mentioned you really look at. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's funny but academicians love to make things very complex and complicated, maybe because they are partly forced to do so by remaining generic in their research. However, trading and investing has not much to do with complexity. In the end it is very simple math and a very keen interest in human psychology that made a very small group of traders incredibly rich over time. I do not know of a whole lot of quant desks which did not blow up in a 10 year period. I know only less than 10 very successful traders personally in my 13 years in this industry who scored consistent but high returns at very manageable draw downs and return volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, my friend I think you are asking the right question but in the completely incorrect context. There is a reason that most &quot;long-only&quot; (sorry Chris ;-) traditional buy-side guys have very little to show for, one big reason being that successful hedge fun managers buy into strength and sell into weakness, while a lot of traditional buy side guys love to play their dollar cost averaging game and believe cheap stocks are not cheap for a reason. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-07-08T03:51:21.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3762" PostTypeId="2" ParentId="3728" CreationDate="2012-07-08T06:19:20.480" Score="1" Body="&lt;p&gt;It simply points to the fact that your model as stands does not have much explanatory power of monthly returns. One reason could be of a observation period mismatch. I am not a fundamental type of guy, but I imagine that the monthly returns are measured over too short a period (1 month) while most fundamental factors are updated on a quarterly basis (sometimes semi-annually or annually depending on local market regulations). Thus, changes or absolute levels in cash flows on a quarterly basis may not be able to explain changes in monthly returns. Can you run the same model again but use quarterly returns (or match the periodicity of the independent variables periodicity) and report back? &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-07-08T06:19:20.480" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3763" PostTypeId="1" CreationDate="2012-07-09T01:25:24.060" Score="2" ViewCount="160" Body="&lt;p&gt;I am developing a market-data engine that receives market-data from different futures exchanges. So I need a general format to deal with sources from different exchanges. Protocols like FIX only specifies the transportation but not the format itself. Like which fields should be included, how many fields are there in a piece of market-data, how they are named, etc... &#xA;Although I can define a general format myself to accommodate the needs to store them and to define an interface to manipulate them, a existing standard or a de facto standard would be best for the problem.&lt;br/&gt;&#xA;So is there already a (de facto) standard or widely used form for the format and the interface for futures market-data? &lt;/p&gt;&#xA;" OwnerUserId="2611" LastEditorUserId="2611" LastEditDate="2012-07-09T01:52:08.927" LastActivityDate="2012-07-09T01:52:08.927" Title="Is there a general format for various sources of futures market-data?" Tags="&lt;market-data&gt;&lt;futures&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3764" PostTypeId="1" CreationDate="2012-07-09T03:16:52.887" Score="13" ViewCount="5852" Body="&lt;p&gt;I often hear that &lt;a href=&quot;http://en.wikipedia.org/wiki/Column-oriented_DBMS&quot; rel=&quot;nofollow noreferrer&quot;&gt;column-oriented databases&lt;/a&gt; are the best choice method for storing time series data in finance applications. Especially by people selling expensive column-oriented databases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet, at first glance it seems a poor choice. You want to append new ticks, or new bars, at the end (and you need to do this a lot and quickly). That is a classic row operation: you append to one file. In a column DB you have to update three files for a tick (timestamp/price/trade size), or five to six for a bar (datestamp, open, high, low, close, volume). (I said 5-6, as for regularly spaced bar data I suppose datestamp could be implicit from row number.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For reading I don't normally want to just grab one column; I want to grab the whole bar so I can draw a candlestick (for instance). OK, I may just want the close column, or just want the volume column (but I still need two reads to also get the datestamps in a column-oriented DB, don't I?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what seems even more important is that when I want to read historical data I generally want to grab a sub-period, and that will be stored contiguously in the row-oriented DB.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q1: Is there any good reason to go with column-oriented over row-oriented if all you store is trade ticks?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q2: Is there any good reason to go with column-oriented over row-oriented if all you store is OHLCV bars?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q3: If you think &lt;em&gt;no&lt;/em&gt; for Q1 and Q2 what kind of columns do you need to have for column-oriented DBs to be the clearly superior choice?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks to Chris Aycock for links to similar questions. Some of the reasoning why column-oriented DBs are better is still not making sense to me, but from the first part of &lt;a href=&quot;https://quant.stackexchange.com/a/949/1587&quot;&gt;https://quant.stackexchange.com/a/949/1587&lt;/a&gt; I think people may be using row-oriented DBs differently. So, for the purposes of this question, please assume I have only one symbol per database table (as opposed to one huge table with a 'symbol' column). So, following the example in the above answer, the raw on-disk storage looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;09:30:01 | 164.05; 09:30:02 | 164.02; ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1587" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-09-02T09:55:11.397" Title="Why use a column database for tick/bar data?" Tags="&lt;data&gt;&lt;database&gt;&lt;column-oriented&gt;" AnswerCount="2" CommentCount="8" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3765" PostTypeId="2" ParentId="3764" CreationDate="2012-07-09T05:12:32.727" Score="-3" Body="&lt;p&gt;Like everything, which solution is most suitable completely depends on your specific case. But first I think you confuse couple concepts here. One thing is how fast a DB can retrieve data/read. Another is storing raw data. And an entirely different issue is analytics, queries. Columnar databases shine at reading and writing raw time series based data. Col DBs are not good at performing analytics. Keep in mind that even KDB itself does not shine at aggregating data, KDB itself is just a smart file system with index structures. Its the built-in query language that adds a lot of firepower in terms of query capabilities. Please keep this in mind. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Yes, think about how you generally read data. Think about Key/Value, which is essentially what columnar databases are all about (Edit: There is a very close connection, they are not identical). You want to retrieve a specific point in time or a time frame and its associated values. Columnar dbs are very fast at handling such requests. Once such data is in memory it can be operated upon much faster. &#xA;2) Same here: Essentially you want to read bars in the same way than raw ticks or any other time series for that matter. You want to acquire bars from Monday 9am to Tuesday 2pm. Whats the difference here? You store each value in its own column. &#xA;3) You mean if I answered &quot;yes&quot; to Q1 and/or Q2? Columns are symbol or symbol + open or whatever you chose. Keys are date/time/ticks...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remember what I said first: Your use case is all that matters. If you constantly need to get prices/bars/... of many different symbols at a specific time point then a row-based database cannot be beat (well given you setup the schema in an intelligent way within an RDBMS). But if you pull out data over time of a single metric (or 4 metrics such as o/h/l/c of bars) then a columnar database is way faster than RDBMS. Why? Because I/O is the most expensive operation and having to only read the columns, needed, is way faster than having to read whole rows. Keep in mind your assertion that each column is stored in a different file is incorrect. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would read the very same Wiki article you linked to because it answers most of your own question. Also, look at some open source structured, non-SQL, columnar databases to get started on the concepts. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you ask me to summarize my points in one sentence then here goes: Columnar databases are optimized for read-operations of time series like data, while row-based databases are more optimized for write operations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For clarification purposes, what I meant with &quot;Think about Key/Value, which is essentially what columnar databases are all about&quot; is the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used the term &quot;key-value&quot; because its essentially the simplest No-SQL data storage approach. The point being is that one cannot run queries on values, cannot aggregate values or search by values such as one could in a purely RDBMS through schemata and indexes. This I think (and I am not alone here) is what sets RDBMS apart from &quot;No-SQL&quot; solutions. My point was that once this concept is understood that No-SQL databases are generally schema-less, lack tables (generally not always), and that, and here is the key similarity between key value and columnar dbs, queries are limited to just by keys, so that the DB knows exactly what node a query can run on. Please note that I am making the comparison looking at things from above 30,000 feet, not a detailed key-value store vs. columnar DB comparison. I just believe that once one understands the concept of key-value and the way key-values are queried then I find it much easier to understand columnar database concepts, EVEN THOUGH on the surface columnar databases look very similar to RDBMS which could not be any further from the truth. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2012-07-11T02:14:45.707" LastActivityDate="2012-07-11T02:14:45.707" CommentCount="17" ContentLicense="CC BY-SA 3.0" />
  <row Id="3766" PostTypeId="1" CreationDate="2012-07-09T10:03:08.453" Score="3" ViewCount="187" Body="&lt;p&gt;This may not be the most appropriate SE site to ask this question, but I can't seem to find a better place to ask, so here goes:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Do Puttable Bonds' put dates always fall on Coupon Dates? When they do, are the bonds puttable before or after the coupon?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Coupon Schedule. How are coupon payment dates usually calculated? Say if a semi-annual bond is issued on Jan 5, 2010, then are payment dates always on Jul 5 and Jan 5. What happens when they fall on weekend?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2668" LastEditorUserId="467" LastEditDate="2012-07-09T11:49:34.447" LastActivityDate="2015-12-15T14:41:48.587" Title="Do Bond Put Dates always fall on Coupon Dates (for non-zero coupon bonds). Calculation rules for Coupon Dates" Tags="&lt;options&gt;&lt;fixed-income&gt;" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3767" PostTypeId="5" CreationDate="2012-07-09T11:54:42.523" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2012-07-09T11:54:42.523" LastActivityDate="2012-07-09T11:54:42.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3768" PostTypeId="4" CreationDate="2012-07-09T11:54:42.523" Score="0" Body="Market-data includes all questions relative to data acquisition for the different financial products. It can also include questions about how market data are computed." OwnerUserId="467" LastEditorUserId="467" LastEditDate="2012-07-09T12:38:24.827" LastActivityDate="2012-07-09T12:38:24.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3769" PostTypeId="5" CreationDate="2012-07-09T11:57:37.530" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2012-07-09T11:57:37.530" LastActivityDate="2012-07-09T11:57:37.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3770" PostTypeId="4" CreationDate="2012-07-09T11:57:37.530" Score="0" Body="The CFA is a famous designation that is very common and desired in the financial industry. The  curriculum includes all the global subjects of Finance, Ethics, Economics and Accounting." OwnerUserId="467" LastEditorUserId="467" LastEditDate="2012-07-09T12:38:23.327" LastActivityDate="2012-07-09T12:38:23.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3771" PostTypeId="2" ParentId="3753" CreationDate="2012-07-09T14:37:42.620" Score="2" Body="&lt;p&gt;The mistaken belief you refer to is a common confusion between stating that the price went up because demand went up and/or supply went down (tautologically true, but meaningless statement) or because buyers entered the market and/or sellers exited the market (usually false).  This has nothing to do with options or implied volatility.  I see such confused statements in the popular press regarding all sorts of markets, financial or otherwise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All it takes to make a market is one buyer and one seller.  Sometimes these can even be the same person, willing to buy or sell at different prices.  If new information comes along, such as the arrival and passage of an &quot;expected event&quot;, then all market participants, buyers and sellers, will rationally change their prices.  This was true before computers and would be true even if there were only one listed option with no possibility to reference to other options.  What you say has absolutely no bearing on the value of a concept such as implied volatility, which is nothing but a theoretical construct people use to communicate.  At the end of the day, every trade, even trades quoted on implied volatility, are transacted at a real price in some real currency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for what to read regarding options volatility, I'd recommend Hull's Options, Futures and Other Derivatives, and stop reading the popular press about options or markets in general.  They will just confuse you.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2012-07-09T14:46:12.610" LastActivityDate="2012-07-09T14:46:12.610" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3772" PostTypeId="2" ParentId="3731" CreationDate="2012-07-09T14:42:45.593" Score="7" Body="&lt;p&gt;A swap does not require a model because its price can be derived from the yield curve without any assumptions about how the yield curve may move in the future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The PFE however is an indication of by how much the swap's mark-to-market may move between now and a moment in the future. It is of course influenced by how volatile rates are. The more volatile rates are, the higher the PFE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's a bit like saying that the price of a portfolio of stocks does not require models, but the VaR does.&lt;/p&gt;&#xA;" OwnerUserId="2599" LastActivityDate="2012-07-09T14:42:45.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3773" PostTypeId="2" ParentId="3739" CreationDate="2012-07-09T16:12:17.883" Score="7" Body="&lt;p&gt;If you have the mathematical sophistication, you should review the original papers referenced on the &lt;a href=&quot;http://en.wikipedia.org/wiki/Equity_premium_puzzle&quot;&gt;Equity Premium Puzzle&lt;/a&gt; page, particularly &lt;a href=&quot;http://www.academicwebpages.com/preview/mehra/pdf/The%20Equity%20Premium%20A%20Puzzle.pdf&quot;&gt;Mehra and Prescott (1985)&lt;/a&gt;.  Note, however, that contrary to other opinions on this page, the puzzle is &lt;strong&gt;NOT&lt;/strong&gt; that there is an equity risk premium.  On the contrary, the puzzle is that the premium had been so high, at least empirically up to the point in time those papers were written.  More recently, it has been in vogue to claim that the risk premium has recently been &lt;em&gt;too low&lt;/em&gt;, or perhaps even &lt;em&gt;nonexistent&lt;/em&gt;.  Some also question whether there is a monotonic relationship between risk and reward in the markets (see, e.g., &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1585031&quot;&gt;low volatility anomaly&lt;/a&gt;).  But no serious thinker believes there should be no risk premium at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The explanation you can &quot;tell your grandmother&quot; is that all stocks are issued by companies to raise money.  Since companies fail a lot more often than governments, particularly governments such as the US that can control their own currency, they must at least promise to investors to pay them more than what they can get &quot;risk-free&quot; from the government.  In practice, of course, some companies will fail, and sometimes entire economies will &quot;fail&quot; in the sense of underperforming expectations, and actual returns to investors may not match what was promised.  That does not change the fact that what was promised is &lt;strong&gt;always&lt;/strong&gt; greater than what could be gotten &quot;risk-free&quot; from a large, stable government.  &lt;em&gt;That&lt;/em&gt; is the equity risk premium.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2012-07-09T16:12:17.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3774" PostTypeId="2" ParentId="3746" CreationDate="2012-07-09T19:12:13.153" Score="16" Body="&lt;p&gt;I can think of three reasons.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, and simplest, is that people care about variance.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, if you really do care about draw-downs, if returns are close to normally distributed, the distribution of draw-downs is just a function of the variance, so there's no need to include draw-downs explicitly in your portfolio construction objective.  Minimizing variance is the same as minimizing expected draw-downs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Third, (and here's the main point) if returns are very non-normal and you really do want to find portfolio weights that minimize expected draw-downs, you still wouldn't choose weights that minimize historical draw-down. Why? Because minimizing historical draw-down is effectively the same as taking all your returns that weren't part of a draw-down, and hiding them from your optimizer, which, as Tal mentioned, will lead to portfolio weights that are a lot less accurately estimated than if you let your optimizer see all the data you have.  Instead, you might just include terms in your optimization objective that penalize negative skew and penalize positive kurtosis.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or, if you wanted to get fancy, you could use all your historical data to fit your favorite fat-tailed distribution.  As far as I know, none of those distributions have both finite variance and are closed under linear combinations, so your portfolio returns wouldn't have the same distribution.  So to get optimal portfolio weights, you'd have to simulate some very large number of returns from each of these distributions, and then calculate (let's say) the 99th percentile portfolio draw-down for each set of portfolio weights, and use that function in your optimization.  I would think that would give you more robust results.   Though since you're trying to estimate a tail event, it would probably require a huge amount of simulated data and take a long long time to run.  After you finish, you might fairly conclude that the entire exercise wasn't worth the effort, and just go back to mean variance optimization...&lt;/p&gt;&#xA;" OwnerUserId="2027" LastActivityDate="2012-07-09T19:12:13.153" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3778" PostTypeId="1" CreationDate="2012-07-10T08:03:53.090" Score="2" ViewCount="8180" Body="&lt;p&gt;Is there any common trading system that is implemented by hedge fund, especially for equity or forex automated trading? I know some big names like Sungard and Bloomberg. Is there any other choices which the including API?&lt;/p&gt;&#xA;" OwnerUserId="2534" LastEditorUserId="2534" LastEditDate="2012-07-10T11:11:25.513" LastActivityDate="2017-08-01T14:00:50.120" Title="What are the common trading systems for hedge fund automated trading?" Tags="&lt;trading&gt;&lt;trading-systems&gt;" AnswerCount="5" CommentCount="7" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3779" PostTypeId="2" ParentId="3778" CreationDate="2012-07-10T11:19:22.007" Score="4" Body="&lt;p&gt;There are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bloomberg: TOMS, SSEOMS, AIM, EMSX&lt;/p&gt;&#xA;&#xA;&lt;p&gt;TT Trading Systems (X-Trader, mostly for futures, spreads,...)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Orc Group: Orc (often used for listed options)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And uncountable others, really depends on which product you look to trade. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But please note that you asked specifically about automated trading and to be honest, most shops code up their own order execution platforms and hook them up to Fix adapters or APIs of brokers, banks,...&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2012-07-10T12:34:14.740" LastActivityDate="2012-07-10T12:34:14.740" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3781" PostTypeId="2" ParentId="3728" CreationDate="2012-07-10T17:59:20.940" Score="2" Body="&lt;p&gt;Why not fit an ARMA model to the rolling returns first, and then model the residuals in your regression equation? That way you should be removing most of the effects of auto-correlation.&lt;/p&gt;&#xA;" OwnerUserId="2677" LastActivityDate="2012-07-10T17:59:20.940" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3782" PostTypeId="1" CreationDate="2012-07-10T18:30:16.977" Score="7" ViewCount="3705" Body="&lt;p&gt;how would you estimate your order in the exchange order book? The order of order events and acks is not deterministic or guaranteed. How could you write an algo to estimate accurately your position in the order queue? Note that when we send an order to exchange, we get acknowledgement back from exchange, followed by market data add order event for our order. At the same time, we will receive order events for other orders. The order of these is not guaranteed. The goal is to estimate our position in the order queue.&lt;/p&gt;&#xA;" OwnerUserId="2678" LastActivityDate="2012-07-14T07:01:56.713" Title="how do we estimate position of our order in order book?" Tags="&lt;limit-order-book&gt;&lt;market-microstructure&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3783" PostTypeId="1" CreationDate="2012-07-10T18:35:40.823" Score="56" ViewCount="35162" Body="&lt;p&gt;What is an efficient data structure to model order book of prices and quantities to ensure:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;constant look up&lt;/li&gt;&#xA;&lt;li&gt;iteration in order of prices&lt;/li&gt;&#xA;&lt;li&gt;retrieving best bid and ask in constant time&lt;/li&gt;&#xA;&lt;li&gt;fast quantity updates&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2678" LastEditorUserId="848" LastEditDate="2012-07-10T20:45:02.810" LastActivityDate="2021-04-28T07:35:49.413" Title="What is an efficient data structure to model order book?" Tags="&lt;limit-order-book&gt;&lt;market-microstructure&gt;" AnswerCount="9" CommentCount="0" FavoriteCount="45" ContentLicense="CC BY-SA 3.0" />
  <row Id="3784" PostTypeId="1" CreationDate="2012-07-10T18:52:42.380" Score="8" ViewCount="340" Body="&lt;p&gt;I'm working on backtesting a number of stock trading strategies and need to estimate how much the execution price will likely deviate from the historical close price for that asset using daily data; which would be used to calculate an optimal position size and estimate probable slippage. Ideal would be a rough equation to get started with, that would justify spending the time/money on historical market depth data and more extensive research.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I intend to use Market on Close orders where possible, but would appreciate any rules of thumb, experiences or literature references that any of you may have.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. would an equation like price_change_per_volume = (log(high) - log(low))/volume where volume is not more than 5% of total volume traded that day (as suggested elsewhere) be worse than nothing? How can I do better using only OHLCV daily data?&lt;/p&gt;&#xA;" OwnerUserId="2677" LastActivityDate="2012-07-11T14:02:44.750" Title="Estimate price movement per unit of volume for daily data" Tags="&lt;equities&gt;&lt;research&gt;&lt;trading&gt;&lt;market-microstructure&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3785" PostTypeId="2" ParentId="3783" CreationDate="2012-07-10T19:34:00.477" Score="25" Body="&lt;p&gt;Since &lt;a href=&quot;https://web.archive.org/web/20140529180725/http://www.quantcup.org/&quot; rel=&quot;noreferrer&quot;&gt;Quant Cup 1&lt;/a&gt;'s objective was an efficient price/time matching engine, the data structure of the &lt;a href=&quot;https://web.archive.org/web/20141222151051/https://dl.dropboxusercontent.com/u/3001534/engine.c&quot; rel=&quot;noreferrer&quot;&gt;winning implementation&lt;/a&gt; might partly be what you are looking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Else the setup of &lt;a href=&quot;https://lobsterdata.com/&quot; rel=&quot;noreferrer&quot;&gt;LOBSTER&lt;/a&gt; is supposed to be quick.&lt;/p&gt;&#xA;" OwnerUserId="2284" LastEditorUserId="2284" LastEditDate="2019-07-15T14:08:33.933" LastActivityDate="2019-07-15T14:08:33.933" CommentCount="11" ContentLicense="CC BY-SA 4.0" />
  <row Id="3786" PostTypeId="2" ParentId="3766" CreationDate="2012-07-10T19:38:47.040" Score="3" Body="&lt;p&gt;Not all bonds have coupons, of course, especially in the world of convertible bonds (where puts are more common).  I have yet to see a bond with a put date other than a coupon date.  It is typical to forfeit a coupon in case of a put, but that's not universal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to coupon dates, there's usually a &quot;next business day&quot; clause.  Generally speaking, the world of interest rates contains a whole slew of conventions for interest payments and business days.  In principle, any contract might follow any of the available conventions, though in practice they group by country.  Bloomberg and other data services will tell you which convention any given bond is following, or you can read the prospectus yourself.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="35" LastEditDate="2012-07-10T23:49:37.457" LastActivityDate="2012-07-10T23:49:37.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3787" PostTypeId="2" ParentId="864" CreationDate="2012-07-10T21:02:53.200" Score="0" Body="&lt;p&gt;I recall reading a paper that showed trading strategies based on bollinger bands got more effective if they've worked for that asset in the past. In other words, each time the price 'bounced' of the bands it got more likely that it would 'bounce' in the future, and hence the strategy got more profitable. Unfortunately I can't find the reference to the paper, and have not yet gotten around to backtesting it myself. Hope this random addition is useful to someone.&lt;/p&gt;&#xA;" OwnerUserId="2677" LastActivityDate="2012-07-10T21:02:53.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3788" PostTypeId="2" ParentId="864" CreationDate="2012-07-11T03:25:09.130" Score="2" Body="&lt;p&gt;Let's approach the answer to your question from a pure trading and risk management perspective because looking at it from a mathematical standpoint nor quant standpoint does not yield you much here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Bollinger bands are nothing else than standard deviation envelopes around the mean of past prices of the underlying. So, as far as simple probabilities go, the bollinger bands are not supposed to be broken more often on average than the volatility of past price moves indicates. Therefore, nobody should be surprised to see assets to trade most of the time in between their 2 or 3 standard deviation wide bands (only difference here is that the bands are around the mean and not the actual current price). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) &quot;Research points to price changes in stocks as a random walk. Also, most people believe that past news, and other factors have little if any impact on future price movements.&quot;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-&gt; First of all stocks nor ANY other asset follows a random walk. A random walk is as close as the lazy academician gets to modeling stock prices. It is far from being accurate. Its the same as saying interest rates are constant and volatility has non random components when valuing option prices with Black Scholes. A random walk is an incredibly weak tool in my opinion to model stock prices. Actually a very often asked question to aspiring junior traders is whether they believe in efficient markets. Believe it or not but a huge number of highly accomplished quants who want to move on to trading desks do not make it because they answered yes in one way or the other to above question. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;-&gt; Past performance, price movements, volatility behavior is one of the most often used and most important component in ANY pricing, modeling, trade evaluation and risk management approach. Care to forecast volatility without past datapoints? Care to make an educated guess about buying or selling stocks only by knowing its fundamentals? Care to make markets in options without knowledge of previously traded levels (you will lose your job faster than you can blink with your eyes)? My point is that its one thing to comfortably sit in your quant seat and model time series with KDB and price up your exotics using Monte Carlo or other non-closed form techniques and hand it over to the trader. Its an entirely different thing to be in the hot seat day in day out and show prices worth sometimes hundreds of millions, knowing the market is sometimes HIGHLY INEFFICIENT which was sadly an often forgotten but very important risk aspect on quant desks. I am not trying to rant against quants but I simply hugely disagree with many quants that past prices are close to being irrelevant, such belief would get you instantaneously fired from any trading desk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) My short answer to your last paragraph is, it depends: The only thing I agree with one quant who also submitted an answer here is that you need to rigorously test your ideas especially if they can be tested. I am willing to bet there are people who make a killing trading one or the other variation of bollinger bands, and there are on the other hand 1000s of others who lose money day in day out with such approach. Why? Because some are willing to put in the work, test, refine, test, start over, test, verify, trade small, build, re-test, optimize, add size,.... Most are not willing to do that. That is the simple but my honest answer. Those who spend the effort to test and verify ideas and are willing to risk money on promising strategies will be rewarded, others not. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2012-07-11T03:31:11.993" LastActivityDate="2012-07-11T03:31:11.993" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3789" PostTypeId="1" CreationDate="2012-07-11T09:01:37.840" Score="11" ViewCount="329" Body="&lt;p&gt;This may seem like a strange question, but for my particular application we need to actually add synthetic microstructure noise to real time charts. The signal should still be representative of the aggregate market direction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I expect that a good technique would be something related to signal processing in electronics or sound engineering. They have white noise generators that can be restricted to a band. I would rather something far less complicated though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it perhaps good enough to take a random percentage of the actual change from the last difference?&lt;/p&gt;&#xA;" OwnerUserId="1017" LastEditorUserId="1017" LastEditDate="2012-07-13T09:47:45.723" LastActivityDate="2012-07-13T09:47:45.723" Title="Are there any standard techniques for adding realistic synthetic microstructure noise to a price series?" Tags="&lt;time-series&gt;&lt;simulations&gt;&lt;market-microstructure&gt;&lt;random-variables&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3790" PostTypeId="2" ParentId="3784" CreationDate="2012-07-11T14:02:44.750" Score="2" Body="&lt;p&gt;You'll have a more transparent and reproducible result if you use volume-weighted average prices (VWAP) in your backtesting instead.  Many brokers guarantee performance of their accumulation algorithms within a certain range of VWAP.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-07-11T14:02:44.750" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3791" PostTypeId="1" AcceptedAnswerId="3796" CreationDate="2012-07-11T14:15:15.707" Score="4" ViewCount="480" Body="&lt;p&gt;I know what the NBBO is but I've seen mention of ABBO and I'm not sure what it means?&lt;/p&gt;&#xA;" OwnerUserId="1456" LastActivityDate="2012-07-11T18:53:27.163" Title="What does ABBO (Away best bid and offer) refer to?" Tags="&lt;limit-order-book&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3793" PostTypeId="2" ParentId="3297" CreationDate="2012-07-11T14:26:36.673" Score="3" Body="&lt;p&gt;I didn't read the papers you linked but I can understand that lie groups may be used much as there are used in quantum field theories to build up gauge theories for interaction of particles. The purpose is to have a model that is invariant according to a given transformation group. This introduce interaction terms in the equations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can imagine that the same technique can be used in financial stochastic processes to force the introduction of new terms in the equations.&lt;/p&gt;&#xA;" OwnerUserId="2619" LastActivityDate="2012-07-11T14:26:36.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3794" PostTypeId="2" ParentId="3791" CreationDate="2012-07-11T16:41:19.513" Score="1" Body="&lt;p&gt;Well it's the best away from the market quote on the bid and ask side.  Or put in terms of level 2 quotes, the highest bid below the top level and the lowest ask above the top level.&lt;/p&gt;&#xA;" OwnerUserId="1040" LastActivityDate="2012-07-11T16:41:19.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3795" PostTypeId="2" ParentId="3789" CreationDate="2012-07-11T17:12:39.747" Score="0" Body="&lt;p&gt;Why not use a Fair value model to predict prices and then randomly sample from the difference of the model and actual prices. The errors would be as good as your model&lt;/p&gt;&#xA;" OwnerUserId="2142" LastActivityDate="2012-07-11T17:12:39.747" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3796" PostTypeId="2" ParentId="3791" CreationDate="2012-07-11T18:53:27.163" Score="2" Body="&lt;p&gt;From the Turquoise &lt;a href=&quot;http://www.tradeturquoise.com/membership/Turquoise_Trading_Service_Description_V2.1.pdf&quot; rel=&quot;nofollow&quot;&gt;features document&lt;/a&gt;: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;6.3. Away Market Best Bid and Offer (ABBO)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;6.3.1. The ABBO is defined as the Best Bid and Offer prices as represented by an aggregation of relevant  European Order Books as&#xA;  defined by Turquoise. An external market’s Best Bid and Offer will&#xA;  only be  part of the ABBO when that market is in Continuous Trading.&#xA;  Turquoise will advise for each security  which external markets will&#xA;  be included in ABBO by a Market Notice and on the Turquoise Website. Turquoise will provide a reasonable period of notice prior to&#xA;  implementing any change.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;6.3.2. If there are no orders in the relevant European Order Books as defined by Turquoise or if the markets  are closed the ABBO is deemed&#xA;  to be undefined.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;6.3.3. The ABBO can be set in smaller tick sizes than Turquoise tick size.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In other words, it's the best price from all other exchanges. Ie, NBBO minus this exchange.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2012-07-11T18:53:27.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3798" PostTypeId="1" AcceptedAnswerId="3817" CreationDate="2012-07-12T04:03:18.277" Score="3" ViewCount="344" Body="&lt;p&gt;Is a risk-neutral probability a special case of an invariant measure?&lt;/p&gt;&#xA;" OwnerUserId="2682" LastActivityDate="2012-07-15T21:41:21.647" Title="Risk Neutral Probability and invariant measure" Tags="&lt;risk-neutral-measure&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3799" PostTypeId="2" ParentId="3722" CreationDate="2012-07-12T13:51:00.573" Score="1" Body="&lt;p&gt;I read &lt;a href=&quot;http://dealbreaker.com/2012/06/libor-can-be-whatever-you-want-it-to-be/&quot; rel=&quot;nofollow&quot;&gt;this dealbreaker post&lt;/a&gt; (via a link from &lt;a href=&quot;http://blog.rivast.com/?p=6052&quot; rel=&quot;nofollow&quot;&gt;Deus Ex Macchiato&lt;/a&gt;), which explains that many (most?) contracts detail something like 'the number on the Libor01 Reuters page' rather than 'the rate published by the BBA as the 3m LIBOR'. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, as Levine argues, if the BBA rephrase Libor as something else, even a trade-driven value, many of those agreements would still be valid. As he also points out, that could step into territory arguable as a change of contract, if it was a significantly different rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note also that Libor is just the BBA's fixings. Everyone other than UK, US and some Euro participants who use Libor instead of Euribor should be ok until Euribor undergoes &lt;a href=&quot;http://webcache.googleusercontent.com/search?q=cache:VOoF32TycesJ:online.wsj.com/article/BT-CO-20120706-708982.html+&amp;amp;cd=8&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;gl=uk&quot; rel=&quot;nofollow&quot;&gt;the same crisis&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Frankly, the value of Libor has already diverged so far from the risk-free rate for so long that instrument holders must have already had to reprice everything. One more change might just instigate a round of revaluations, depending on which way the fixing went.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Presumably the SEC-defined swaps will be stricter on the floating rate, or at least detail some eventualities for Libor ceasing to function.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2012-07-12T13:51:00.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3800" PostTypeId="2" ParentId="3789" CreationDate="2012-07-12T18:04:12.947" Score="3" Body="&lt;p&gt;I assume, this is not for real-time display, so you can use the price from future.&#xA;If this is not the case, this answer is irrelevant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know about a standard technique, but this is my suggestion:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$p_{noise} = p_{current} + \nu * (p_{future} - p_{current})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $p_{future}$ is future price for some horizon, and $\nu$ is a zero-mean Gaussian noise.&lt;/p&gt;&#xA;" OwnerUserId="1515" LastActivityDate="2012-07-12T18:04:12.947" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3801" PostTypeId="2" ParentId="3789" CreationDate="2012-07-12T19:17:46.303" Score="1" Body="&lt;p&gt;Maybe the accepted answer to &lt;a href=&quot;https://quant.stackexchange.com/questions/2453/how-to-generate-a-random-price-series-with-a-specified-range-and-correlation-wit/2462#2462&quot;&gt;this earlier thread&lt;/a&gt; and the more &lt;a href=&quot;http://dekalogblog.blogspot.com/2012/01/creating-synthetic-data-using-fast.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;detailed description&lt;/a&gt; on my blog might be of use to you. Within the FFT you could just manipulate the higher frequency components to create your synthetic microstructure noise.&lt;/p&gt;&#xA;" OwnerUserId="252" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2012-07-12T19:17:46.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3802" PostTypeId="1" AcceptedAnswerId="3805" CreationDate="2012-07-12T20:30:01.767" Score="5" ViewCount="439" Body="&lt;p&gt;I am curious why a lot of market hours are something like 9 to 3 or 9 to 4 pm when there is such demand and so many prop shops and more out there. I know certain markets are continuous trading but a lot of very large famous ones seem to stick to this incredibly short schedule. Why would they do that?&lt;/p&gt;&#xA;" OwnerUserId="1456" LastActivityDate="2012-07-13T01:56:01.220" Title="With there being such a high demand for electronic trading or just trading in general why are market hours so limited?" Tags="&lt;trading&gt;&lt;market-data&gt;&lt;electronic-trading&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3803" PostTypeId="2" ParentId="3731" CreationDate="2012-07-12T21:01:44.040" Score="1" Body="&lt;p&gt;Fully support the prior comment. &#xA;Swaps can basically be priced off the current Yield curve in an arbitrage free manner. &#xA;The PFE as the name &quot;potential&quot; future exposure suggests refers to a value something (i.e. the swap) could potentially realize. Hence one needs to decide upon a simulation method to derive this potential value. &#xA;The PFE as a measure of future (mark-to-market) credit exposure is often also referred to as the &quot;Upside VaR&quot;, which is another hint in that direction, since VaR methods are usually also parametric (in the sense that price/value changes are assumed to follow certain distributions) or simulation based.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers.  &lt;/p&gt;&#xA;" OwnerUserId="2683" LastActivityDate="2012-07-12T21:01:44.040" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3805" PostTypeId="2" ParentId="3802" CreationDate="2012-07-13T01:50:56.943" Score="6" Body="&lt;p&gt;I think there is a straightforward answer to this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The associated costs of changing trading hours need to be justified by the benefits. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Exchanges, regulators, and large market participants such as banks, hedge funds, buy side long-only funds very closely communicate and weigh pros and cons when considering changes to trading hours. Obviously motivations at times between those participants are opposing. Exchanges argue they may transact more volume through longer trading hours (which is actually not proven). Some investors believe that continuous trading hours in some assets benefit price discovery and that they smooth out liquidity spikes throughout the day. Other market participants believe that its better to transact only for a few hours when everyone trades and thus liquidity is much more concentrated. There are in fact exchanges that are only open for 30 minutes or 1 hour for precisely that reason, even though some of such assets have very high turn over. This is as far as motivations and participants in such discussions goes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the key aspect is cost-benefit when considering a change in trading hours. The cost are very high by having to adjust algorithms, trading applications, back office systems, data streams, and such forth. It is not an easy process and such changes are sometimes announced months if not a year ahead. In some cases such as liquid index futures pressure to expand trading hours are mainly motivated by competition. Nikkei futures trade a lot longer now compared to a short while ago mainly because of Japan's drive to not lose sight of remaining one of the most advanced exchanges (plus often what comes out of the US and proves itself is imitated in Japan). Imagine if you could trade the same Nikkei contract in Singapore round the clock but not in Osaka. What if price and liquidity patterns would not disfavor Singapore? Would anyone want to trade in Osaka? I doubt it. But my assumption of similar price or liquidity patterns when expanding trading hours is what it is, an assumption. Volume and liquidity profiles change drastically when changing trading hours. I remember that all the banks had to completely re-write/update their VWAP algorithms when trading hours in HK were adjusted. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keep in mind that especially in the financial community one mantra goes: &quot;If it ain't broke don't fix it&quot;. The fear of changes in liquidity, price discovery often scare portfolio managers and traders more than keeping things as they are. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally do not forget, lunch breaks are a great way to stretch your legs, get out of your lazy Herman Miller, catch up on the latest gossip and get back to the office. Some do not appreciate this being taken away from them at least not if they can voice their opinion and can hold on to it :-)&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2012-07-13T01:56:01.220" LastActivityDate="2012-07-13T01:56:01.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3806" PostTypeId="1" AcceptedAnswerId="4053" CreationDate="2012-07-13T09:25:10.193" Score="4" ViewCount="7888" Body="&lt;p&gt;Can one deem an FX float-to-float swap and a FX forward equivalent on dates immediately after repricing? The reason I am asking, I am hedging something that can be modeled via an FX forward, I was given an FX basis swap to hedge it. I want to safe myself some work and claim that they are equivalent on repricing days (or immediately after) when effectiveness of the hedge would be assessed. I believe, it comes down to how forward points are reflected in the the two instruments. An FX forward is valued as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ (F_{t_i,t_M}-F_C) \times N \times \text{df}_{\text{FWD}} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know how to do the classic &quot;where&quot; block, so in a sentence, the above means: (FX forward rate at time $i$ until time $M$ (maturity) $F_{t_i,t_M}$ minus FX contracted forward rate $F_C$) times notional $N$ times discount factor $\text{df}_{\text{FWD}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A swap's value would be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sum_{i=k}^{n}{N_{\text{DC}}\times \frac{r_{\text{DC}}}{\text{days}}\times \text{df}_{\text{i,SWP,DC}}} - S_{0}&#xA;\left(\sum_{i=k}^{n}{N_{\text{FC}}\times \frac{r_{\text{FC}}}{\text{days}}\times \text{df}_{\text{i,SWP,FC}}}\right)  $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where &quot;DC&quot; = domestic currency, &quot;FC&quot; = foreign ccy, $r$ the applicable &lt;strong&gt;interest&lt;/strong&gt; forward rate and &quot;df&quot; = discount factor. You might have notices I ommitted the final exchange of principal which would add some more complexity and is not important for the question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The point is that the formulas are obviously different, yet I am trying to claim that the values will be equivalent immediately after repricing. Here's why:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know that the value of each variable leg will be $100$ in their respective currencies (as any floating bond would be, where forward and discount rates are interconnected. So one could claim that the FX swap's value will be primarily driven by the spot rate $S$, used to translate the foreign currency leg. At this point one would say that the forward will be driven by the difference between the actual forward rate $F$ and the contracted rate so they should NOT be the same. But. Here comes my twisted thinking (or lack thereof). I found out, that in the reality of markets, the forward rate difference in the swap would be hidden in the discount factors as the &lt;strong&gt;basis spread&lt;/strong&gt;, and I am wondering if that, somehow, would make the value equivalent to the forward. Unfortunately don't have access to SWPM to test the &quot;theory&quot;. Thoughts?&lt;/p&gt;&#xA;" OwnerUserId="2685" LastEditorUserId="2727" LastEditDate="2012-08-27T12:27:04.280" LastActivityDate="2012-09-19T12:34:05.590" Title="Equivalency of FX forwards and FX basis swaps for risk-management purposes" Tags="&lt;fx&gt;&lt;swaps&gt;&lt;forward&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3807" PostTypeId="2" ParentId="3724" CreationDate="2012-07-13T10:30:06.223" Score="1" Body="&lt;p&gt;Actually it turned out to be simpler than I had expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.eurexclearing.com/risk/parameters_en.html&quot; rel=&quot;nofollow&quot;&gt;Eurex provides Margin Parameters&lt;/a&gt; in an xls file that includes the initial margin. This can be multiplied-out by the net position to get the requirement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My only open issue is that this mechanism doesn't take into account cross-margining.&lt;/p&gt;&#xA;" OwnerUserId="2637" LastEditorUserId="35" LastEditDate="2012-07-13T11:13:58.317" LastActivityDate="2012-07-13T11:13:58.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3810" PostTypeId="2" ParentId="3782" CreationDate="2012-07-14T06:41:57.737" Score="6" Body="&lt;p&gt;You have two ways to estimate your position in an order book:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;first if you have access to an ITCH feed, you can recognize your order into the ITCH updates, and know &lt;em&gt;exactly&lt;/em&gt; where you are, but you will have to build an &lt;em&gt;engine&lt;/em&gt; to translate an order-by-order ITCH feed to a limit order book;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;or you have to use estimates; the easiest way to build one is to follow this process:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;you are right on the fact that the synchronisation of the messages you have back from the market on your own orderbook and the feed describing the state of the market (the public orderbook) is often far from perfect. You can nevertheless build an &lt;strong&gt;estimate of the delay $\hat \delta$ between these two feeds&lt;/strong&gt;. You can do this when you obtain a &lt;em&gt;fill&lt;/em&gt; or &lt;em&gt;partial fill&lt;/em&gt;, you know when you have it back via a direct message from the market (say, at time $t_1$) and when you can see it on the public feed (say, at time $t_2$), you know at such events that for your $n$th event like that $\delta(n)=t_2-t_1$. Any smoothing of the $\delta(n)$ (like a exponential moving average) can be used to obtain $\hat \delta$.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;when you insert an order of size $Q_i$ at price $P_i$ (or modify, but in general modifications are slower than inserts), just note the time of the acknowledge of it $t_i$ and look for an increate of the volume $Q_i$ at your price $P_i$ around $t_i+\hat\delta$: once it is done (say that you found it at time ${\hat t}_i$) you now have an estimate ${\hat V}_-(0)$ of the volume before you in the queue (by the way you aslo obtained one more $\delta(n)$ to adjust your $\hat\delta$). Of course you miss the hidden orders if any, but in general they will not disturb you that much:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the non-disclosed part icebergs do not have in general more priority than visible orders&lt;/li&gt;&#xA;&lt;li&gt;fully hidden orders like instance LiS (Large in Scale) orders integrated in European Lit books have a different priority anyway&lt;/li&gt;&#xA;&lt;li&gt;the only issue you will have is that some trading venues provide &lt;em&gt;internalisation services&lt;/em&gt;, meaning that if a broker pay specific fees, he will be able to obtain a match between a sell market order and a buy limit orders he owns even if the buy order is not the first in the queue (you can see that as a &lt;em&gt;cheap broker crossing service&lt;/em&gt; provided by the venue)&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;now you just need to update the quantity $\hat V_-(0)$, that for you need to monitor the quantity ${\cal Q}$ on the queue of price $P_i$:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;at ${\hat t}_i$, it was ${\cal Q}(0)=\hat V(0)+Q_i$&lt;/li&gt;&#xA;&lt;li&gt;you will have to maintain a quantity $\hat V_+$, the quantity at the same price $P_i$ but with a lower priority than your order&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;let say that you just saw the $n$th event on ${\cal Q}$, which value is now ${\cal Q}(n)$, few milliseconds later you observe that now its value is ${\cal Q}(n+1)$&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;for an &lt;strong&gt;increase of the quantity&lt;/strong&gt;: ${\cal Q}(n+1)&amp;gt;{\cal Q}(n)$, you have to assume that it has a lower rank in the queue than your order: increase $\hat V_+(n)$ by the increase:&#xA;$$\hat V_+(n+1)=\hat V_+(n)+({\cal Q}(n+1) - {\cal Q}(n) )$$&lt;/li&gt;&#xA;&lt;li&gt;for a &lt;strong&gt;decrease of the quantity&lt;/strong&gt;: ${\cal Q}(n+1)&amp;lt;{\cal Q}(n)$, you have to make an assumption on the probability that is affects $\hat V_+$ rather than $\hat V_-$; you have three ways to do this, choose one ($[\cdot]_{-/+}$ means the negative or positive part):&#xA;$$\Delta V = {\cal Q}(n) - {\cal Q}(n+1)$$&#xA;&lt;ol&gt;&#xA;&lt;li&gt;a &lt;em&gt;risk-averse version&lt;/em&gt;, put all that you can on $\hat V_+$&#xA; $$\left\{\begin{array}{lcl}&#xA;       \hat V_+(n+1)&amp;amp;=&amp;amp; [ \hat V_+(n)-\Delta V_+]_+\\&#xA;       \hat V_-(n+1)&amp;amp;=&amp;amp; \hat V_-(n) + [ \hat V_+(n)-\Delta V_+]_-&#xA;\end{array}\right.$$&lt;/li&gt;&#xA;&lt;li&gt;a &lt;em&gt;neutral version&lt;/em&gt;: you first compute the probability that the decrease is on $\hat V_+$ or $\hat V_-$ according the their relative size:&#xA; $$\mathbb{P}_+(n) =\frac{f(\hat V_+(n))}{f(\hat V_+(n))+f(\hat V_-(n))}$$&#xA;where $f$ is any increasing function (you can take the identity to make it simple):&#xA; $$\left\{\begin{array}{lcl}&#xA;       \hat V_+(n+1)&amp;amp;=&amp;amp; [ \hat V_+(n)- \mathbb{P}_+(n) \Delta V_+]_+\\&#xA;       \hat V_-(n+1)&amp;amp;=&amp;amp; \hat V_-(n) - (1-\mathbb{P}_+(n)) \Delta V_+ + [ \hat V_+(n)-\mathbb{P}_+(n) \Delta V_+]_-&#xA;\end{array}\right.$$&lt;/li&gt;&#xA;&lt;/ol&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Of course from time to time you have have small inconsistencies, take some simple assumptions and adjust $\hat\delta$ when it is the case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks to this procedure you will have an estimate of the quantity before you $\hat V_-$ and after you $\hat V_+$ at any time.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2012-07-14T07:01:56.713" LastActivityDate="2012-07-14T07:01:56.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3811" PostTypeId="1" CreationDate="2012-07-14T20:38:25.393" Score="12" ViewCount="1808" Body="&lt;p&gt;During our daily jobs as quants, we tend to be willing to develop all the quantitative libraries ourselves. While I know that we need to develop specific algorithms which are the foundations of our strategies, I believe there are 2 major disadvantages in implementing quantitative libraries (including statistics such as performance, standard deviation, etc) in-house:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You take the risk of making a mistake in the implementation&lt;/li&gt;&#xA;&lt;li&gt;You waste a lot of time implementing and testing functions that already exist&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I have hence been considering using available libraries as a foundation to develop a new quantitative analysis platform. Although I know there are a few open-source libraries, I think  most companies would be ready (and would prefer) to pay for the guarantee of continued support and maintenance. I also would like to have a library that I can use from .Net. So I started looking and I found:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;NAG&lt;/li&gt;&#xA;&lt;li&gt;MATLAB (as it can be compiled)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Is there something wrong in my argument, and do you know any other commercial library I could consider?&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2012-07-14T23:28:12.020" LastActivityDate="2020-05-25T10:49:13.397" Title="What commercial financial libraries are available to outsource implementation risk?" Tags="&lt;programming&gt;" AnswerCount="4" CommentCount="9" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3812" PostTypeId="2" ParentId="3811" CreationDate="2012-07-15T03:46:52.560" Score="4" Body="&lt;p&gt;How about a commercial company with an open-source product?  &lt;a href=&quot;http://www.opengamma.com/&quot; rel=&quot;nofollow&quot;&gt;OpenGamma&lt;/a&gt; was a R/Finance sponsor this year, and I've considered using some of their code.&lt;/p&gt;&#xA;" OwnerUserId="56" LastActivityDate="2012-07-15T03:46:52.560" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3813" PostTypeId="2" ParentId="3727" CreationDate="2012-07-15T13:31:30.847" Score="1" Body="&lt;p&gt;This is a common convention. If your spot is $S$ and you're looking at options maturity in $T$, it is natural to look at the the strikes $S_\pm=S.exp^{-\frac12\sigma^2T\pm\alpha\sigma\sqrt T}$ for a fixed $\alpha$. So your skew measure will be something like&#xA;$$ \frac{\sqrt T(\sigma_{S_+} -\sigma_{S_-} )}{\log (S_+/S_-)} =&#xA;\frac{\sqrt T(\sigma_{S_+} -\sigma_{S_-} )}{2\alpha\sigma\sqrt T} =  &#xA;\frac{\sigma_{S_+} -\sigma_{S_-}}{2\alpha\sigma}  $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which is as intrinsic as could be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Think about it this way: 1 week before expiry a 110% call is way more OTM than a 110% call expiring in one year, just because 110% is very far if you've only got one week left. Another way to look at it is that you want to compare the difference in vol for a given change in delta rather than in % of the spot. And clearly the $\alpha$ is strongly tied to the delta.&lt;/p&gt;&#xA;" OwnerUserId="2599" LastActivityDate="2012-07-15T13:31:30.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3814" PostTypeId="1" AcceptedAnswerId="3816" CreationDate="2012-07-15T14:54:31.773" Score="15" ViewCount="7286" Body="&lt;p&gt;I have it in mind to build a Multilayer Perceptron for predicting financial time series. I understand the algorithm concepts (linear combiner, activation function, etc). But while trying to build the input, hidden and output layers, I'm running into some questions about the basics. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;A)&lt;/strong&gt; I'm confused about the input vs. hidden layer. Is it the input or hidden layer neurons that have the i) linear combiner and ii) activation function. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Example: for 1 tick of USDEUR trade data, say my input vector is [ time, bid, ask, bid-volume, ask-volume ] . If my input layer has 5 neurons, does that entire set go to each neuron in the input layer? Or is &quot;bid&quot; input to one neuron, &quot;ask&quot; is input to another neuron, etc.&lt;/em&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;B)&lt;/strong&gt; What are the values of the hidden-layer neurons ? If we have a fired value from our input neurons, how do we translate that into the values that we ultimately want to predict [ bid-percent-change, ask-percent-change ] ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Ie: Ultimately, I'd like the output layer to give me a vector of 2 [ bid-percent-change, ask-percent-change ]&lt;/em&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;C)&lt;/strong&gt; For a financial time series, a &quot;sliding window&quot; is suggested as an input vector. How would that input vector fit in with the other inputs: bid, ask, time, etc ? &lt;/p&gt;&#xA;" OwnerUserId="2690" LastEditorUserId="467" LastEditDate="2012-07-15T20:06:27.277" LastActivityDate="2013-12-29T15:21:14.847" Title="Multilayer Perceptron (Neural Network) for Time Series Prediction" Tags="&lt;machine-learning&gt;&lt;prediction&gt;&lt;neural-networks&gt;&lt;artificial-intelligence&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="16" ContentLicense="CC BY-SA 3.0" />
  <row Id="3815" PostTypeId="1" AcceptedAnswerId="3820" CreationDate="2012-07-15T17:24:51.927" Score="5" ViewCount="1517" Body="&lt;p&gt;I'm trying to create a risk-parity portfolio in C# using the Extreme Optimization routines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm mostly trying them out to see if I like them or not before I buy them (I'm a student so money is tight).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My idea was to implement this new kind of portfolio optimization called risk-parity. It basically says that in order to diversify your portfolio you should give equal risk to each of its components.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm getting a null error when running &lt;code&gt;np1.Solve()&lt;/code&gt; and I don't understand why. I thought that everything else was calculated by Extreme Optimization.  &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;What am I doing wrong?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is there a faster way to do this optimization that I'm not aware of?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you don't know the EO Libraries, but could implement this with something else, could you please drop a comment on how you would go about solving this?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;By the way, the details on the portfolio construction are in the comments of the distance function, in case you're interested.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;using System;&#xA;using System.Collections.Generic;&#xA;using System.Linq;&#xA;using System.Text;&#xA;using Extreme.Statistics;&#xA;using Extreme.Mathematics;&#xA;using Extreme.Mathematics.Optimization;&#xA;&#xA;namespace TestingRiskParityOptimization&#xA;{&#xA;    class Program&#xA;    {&#xA;&#xA;        static void Main(string[] args)&#xA;        {&#xA;&#xA;            NonlinearProgram np1 = new NonlinearProgram(2);&#xA;            Func&amp;lt;Vector, double&amp;gt; distance = DistanceFunction;&#xA;            np1.ObjectiveFunction = distance;&#xA;            np1.InitialGuess = Vector.CreateConstant(2, 1.0 / ((double)2));&#xA;&#xA;            np1.AddNonlinearConstraint(x =&amp;gt; x[0] + x[1], ConstraintType.GreaterThanOrEqual, 0);&#xA;            Vector solution = np1.Solve();&#xA;&#xA;            Console.WriteLine(&quot;Solution: {0:F6}&quot;, solution);&#xA;            Console.WriteLine(&quot;Optimal value:   {0:F6}&quot;, np1.OptimalValue);&#xA;            Console.WriteLine(&quot;# iterations: {0}&quot;, np1.SolutionReport.IterationsNeeded);&#xA;&#xA;            Console.Write(&quot;Press Enter key to exit...&quot;);&#xA;            Console.ReadLine();&#xA;&#xA;        }&#xA;&#xA;        private static double DistanceFunction(Vector Weights)&#xA;        {&#xA;            Matrix Sigma = Matrix.Create(new double[,] {&#xA;                  {0.1, 0.2},&#xA;                  {0.2, 0.4}&#xA;                });&#xA;            // if VarP = Weights' * CovarMatrix * Weights and VolP = sqrt(VarP)&#xA;            // Then the marginal contribution to risk of an asset is the i-th number of&#xA;            // Sigma*Weights*VolP&#xA;            // And thus the contribution to risk of an asset is simply Weights . (Sigma*Weights/VarP)&#xA;            // we need to find weights such that Weights (i) * Row(i) of (Sigma*Weights/VarP) = 1/N&#xA;&#xA;            // that is we want to minimize the distance of row vector (Weights (i) * Row(i) of (Sigma*Weights/VarP)) and vector 1/N&#xA;&#xA;            double Variance = Vector.DotProduct(Weights, Sigma * Weights);&#xA;&#xA;            Vector Beta = Sigma * Weights / Variance;&#xA;&#xA;            for (int i = 0; i &amp;lt; Beta.Length; i++)&#xA;            {&#xA;                // multiplies row of beta by weight to find the percent contribution to risk&#xA;                Beta[i] = Weights[i] * Beta[i];&#xA;            }&#xA;&#xA;            Vector ObjectiveVector = Vector.CreateConstant(Weights.Length, 1.0 / ((double)Weights.Length));&#xA;            Vector Distance = Vector.Subtract(Beta, ObjectiveVector);&#xA;&#xA;            return Math.Sqrt(Vector.DotProduct(Distance, Distance));&#xA;&#xA;        }&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2691" LastEditorUserId="467" LastEditDate="2012-07-15T20:03:36.563" LastActivityDate="2012-09-12T03:35:20.437" Title="Risk-Parity Portfolio Optimization using Extreme Optimization in C#" Tags="&lt;programming&gt;&lt;portfolio-management&gt;&lt;portfolio-selection&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3816" PostTypeId="2" ParentId="3814" CreationDate="2012-07-15T20:40:11.910" Score="23" Body="&lt;p&gt;First, let's speak about perceptrons in general:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;their &lt;strong&gt;input&lt;/strong&gt; $X_0$ is a $K$-dimensional vector. So if you want to use $(P_{bid}(t),P_{ask}(t), Q_{bid}(t),Q_{ask}(t))$, it would mean that without any effort (but later we will see that is would be better to do some efforts, as usual):&#xA;$$X_0(t)=(P_{bid}(t),P_{ask}(t), Q_{bid}(t),Q_{ask}(t))'\in\mathbb{R}^4$$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;then the &lt;strong&gt;hidden layer&lt;/strong&gt; is made of $N$ &lt;strong&gt;hidden neurons&lt;/strong&gt; $(Z_n)_{1\leq n\leq N}$, each of them is associated to &lt;em&gt;weights&lt;/em&gt; $(w^h_{k,n})_{1\leq k\leq K}$ and a &lt;em&gt;biais&lt;/em&gt; $b^h_n$: the &lt;strong&gt;activation&lt;/strong&gt; of one hidden unit $Z_n$ is&#xA;$$Z_n(t)=\Phi\left( \sum_k w^h_{k,n}\cdot X_k(t) + b^h_n\right)$$ &#xA;where $\Phi(\cdot)$ is the &lt;strong&gt;activation function&lt;/strong&gt; of the perceptron; if you want to do something fancy, you can use different activation functions, but the regular one is a &lt;em&gt;sigmoid&lt;/em&gt; (i.e. $\rm th$).&#xA;Note that $Z=(Z_n)_{1\leq n\leq N}$ is in $\mathbb{R}^N$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It means that each hidden unit $Z_n(t)$ will receive a combination of &lt;strong&gt;all the inputs&lt;/strong&gt;. In your example:&#xA;$$Z_n(t)=\Phi\left( w^h_{1,n} \,P_{bid}(t) + w^h_{2,n} \,P_{ask}(t)+w^h_{3,n} \, Q_{bid}(t)+ w^h_{4,n} \,Q_{ask}(t) + b^h_n\right)$$ &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;last but not least the &lt;strong&gt;output layer&lt;/strong&gt; $Y$ is made of what you want to predict, let say that you target $(\rho_{ask}(t+1),\rho_{bid}(t+1))$ (i.e. the pct of change in volume), then you take:&#xA;$$Z(t)=(\rho_{ask}(t+1),\rho_{bid}(t+1))'\in\mathbb{R}^2$$&#xA;you also need weights and biais for the output so that ($U$ is the number of outputs):&#xA;$$Y_n(t)=\Phi\left( \sum_{u=1}^U w^o_{u,n}\cdot Y_n(t) + b^o_u\right)$$&#xA;sometimes people do not take any activation function for the output, but I would not recommend that.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;All this put together, you can express the outputs as a function of the inputs with:&#xA;$$Y_n(t)=\Phi\left( \sum_{u=1}^U w^o_{u,n}\cdot \Phi\left( \sum_k w^h_{k,n}\cdot X_k(t) + b^h_n\right) + b^o_u\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How does it work?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The perceptron has to be &lt;strong&gt;trained&lt;/strong&gt; on a database of a sample of $T$ associations of inputs and outputs $(X(t),Y(t))_{1\leq t\leq T}$. Its training is made of finding the weights and biais minimizing the $L2$ distance between the expected outputs and the obtained ones:&#xA;$$\left\vert\begin{array}{ll}&#xA;\mbox{Minimize}&amp;amp; \mathbb{E}_t \left\| Y(t) - \Phi\left( \sum_{u=1}^U w^o_{u,n}\cdot \Phi\left( \sum_k w^h_{k,n}\cdot X_k(t) + b^h_n\right) + b^o_u\right)\right\|^2\\&#xA;\mbox{Variable}&amp;amp; (w^h_{k,n},b^h_n,w^o_{u,n},b^o_u)_{1\leq u\leq U, 1\leq n\leq N,1\leq k\leq K}&#xA;\end{array}\right.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What people liked in perceptron is that as far as you use &lt;em&gt;usual&lt;/em&gt; quadratic minimization methods, the training is quite fast, and the associated computations are easy to do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After the training, you obtain an estimate for $Y$ that is &lt;em&gt;optimal&lt;/em&gt; in the sense of your minimization program (i.e. the $L2$ distance statistical sense).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How to use perceptrons?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I like your question because I think that what you are asking is close to &quot;ok but can it be that simple? just throwing my inputs in $X$, asking for my outputs in $Y$, and all will work in few seconds?&quot;. Of course the answer is no.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;First you can note that you need to normalize your inputs a little (center and reduce them for instance, i.e. $X_k(t)\rightarrow (X_k(t) - \mathbb{E}_t(X_k))/\sqrt{\mathbb{V}_t(X_k)}$), more than that you can preprocess the inputs thanks to your understanding of the modelling problem. For instance in your case you could use:&#xA;$$X(t)=\left(\frac{P_{ask}(t)-P_{bid}(t)}{P_{ask}(t)+P_{bid}(t)}, \frac{Q_{bid}(t)}{Q_{bid}(t)+Q_{ask}(t)}\right)'$$&#xA;your input will be somehow &lt;em&gt;homogeneous&lt;/em&gt; with your outputs (I am not guaranteeing any good result, it is just an improvement of your toy example)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You also need to pay attention to the outputs you ask to the perceptron you predict. Ask you the question &quot;&lt;em&gt;why not using $U$ perceptrons if I have $U$ outputs?&lt;/em&gt;&quot;. The only good reason is that you are convinced that sharing the same hidden units to try to predict simultaneously the $U$ outputs will stabilize the weights: &lt;strong&gt;the outputs should be deeply linked to a same underlying phenomenon&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What about the &lt;em&gt;time&lt;/em&gt; in all this? I made as if the association $(X,Y)$ was i.i.d. with respect to time. If it is not the case you can try to use a more &lt;em&gt;sliding&lt;/em&gt; approach like TDNN (&lt;a href=&quot;http://en.wikipedia.org/wiki/Time_delay_neural_network&quot; rel=&quot;noreferrer&quot;&gt;Time Delayed Neural Networks&lt;/a&gt;). It is to the perceptron what GARCH models are to linear regressions (more or less)...&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Of course you need to take care of &lt;strong&gt;over-fitting&lt;/strong&gt; and all other &lt;a href=&quot;http://en.wikipedia.org/wiki/VC_dimension&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;VCdimension&lt;/strong&gt;-like&lt;/a&gt; topics of statistical learning.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Last remark: you seem to try to use perceptrons for intraday prediction. In the context of high frequency trading, do never forgot that you will interact with the orderbook dynamics, so you will be in a &lt;strong&gt;control-oriented&lt;/strong&gt; framework rather than a prediction one. What I mean is that by sending orders in the LOB, you will change it, but continue to use the changed state of the orderbook for the next step of your prediction... It is called &lt;a href=&quot;http://www.wiley.com/buy/1119952417&quot; rel=&quot;noreferrer&quot;&gt;&lt;em&gt;market impact&lt;/em&gt;&lt;/a&gt; and it implies that you try to control the LOB.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some special techniques have been developed to use perceptrons in the scope of control, like in &lt;a href=&quot;http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=796624&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;How piecewise affine neural networks can generate a stable nonlinear control&lt;/strong&gt;, by Lehalle and Azencott, in &lt;em&gt;Proceedings of the 1999 IEEE International Symposium on Intelligent Control/Intelligent Systems and Semiotics&lt;/em&gt;, 1999&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="263" LastEditDate="2013-12-29T15:21:14.847" LastActivityDate="2013-12-29T15:21:14.847" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3817" PostTypeId="2" ParentId="3798" CreationDate="2012-07-15T21:41:21.647" Score="5" Body="&lt;p&gt;No, you obtain a risk-neutral measure by any change of measure; invariance is far more restrictive. Because in your formula $\mu\circ f^{-1} (A)=\mu(A)$, it has to be for &lt;em&gt;any&lt;/em&gt; $A$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Risk-neutrality can be seen as a way to inject into your model a list of &lt;em&gt;market prices&lt;/em&gt; you really want to not be exposed to: once they are taken into account (i.e. once you made your change of measure), the remaning is martingale.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2012-07-15T21:41:21.647" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3818" PostTypeId="1" CreationDate="2012-07-16T16:14:03.083" Score="6" ViewCount="200" Body="&lt;p&gt;Let $X_t$ be an american style financial derivative with random exercise time $T$&#xA;where $t$ and $T$ belongs to some finite set $A$.&lt;br&gt;&#xA;Buying this derivative requires the buyer to pay $p_t$ up to time $T$.&lt;br&gt;&#xA;Let $\Omega$ be the sample space of $X_t$, $p=(p_t)_{t \in A}$ the price process&#xA;and $B={\left(C^A \right)}^\Omega$ the value space of $p$ for some set $C \subset \mathbb{R}$.&lt;br&gt;&#xA;Assume expectation are taken under the risk-neutral measure with $R_t$ as the risk-free discounting factor from times $0$ to time $t$.&lt;br&gt;&#xA;Is the no-arbitrage pricing process of the derivative given by &#xA;$$&#xA;\arg_{p \in B} \left( \sup_{T \in A} E(X_T R_T - \int_0^T p_t R_tdt)=0  \right) \text{ (1)}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;when $B$ requires that $p_t(\omega) \ne 0, t&amp;gt;0$ for some $\omega \in \Omega$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My knowledge of finance tells me the no-arbitrage price would be &#xA;$$&#xA;\sup_{T \in A} E(X_T R_T) \text{ (2)}&#xA;$$&#xA;when B is degenerated to $p_0=k$ for some $k \in \mathbb{R}$ and $p_t=0,t \ne 0$.&lt;br&gt;&#xA;Intuitively, I would expect (1) to be the natural extension to (2).&lt;br&gt;&#xA;But is it theoretically true?&lt;br&gt;&#xA;I searched, but I couldn't find any source confirming my hypothesis.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I asked this question on mathoverflow and I was guided here.&lt;/p&gt;&#xA;" OwnerDisplayName="user2688" LastActivityDate="2012-07-16T16:14:03.083" Title="Arbitrage free price of a derivative when the price is collected over the lifetime of the derivative" Tags="&lt;options&gt;&lt;arbitrage&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3820" PostTypeId="2" ParentId="3815" CreationDate="2012-07-16T22:27:29.467" Score="2" Body="&lt;p&gt;In case anyone is interested, I solved it using Nelder-Mead's algorithm instead. The performance could be better, but I didn't want to waste any more time in it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the final solution:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;using System;&#xA;using System.Collections.Generic;&#xA;using System.Linq;&#xA;using System.Text;&#xA;using Extreme.Statistics;&#xA;using Extreme.Mathematics;&#xA;using Extreme.Mathematics.Optimization;&#xA;&#xA;namespace TestingRiskParityOptimization&#xA;{&#xA;    class Program&#xA;    {&#xA;&#xA;        static void Main(string[] args)&#xA;        {&#xA;            Func&amp;lt;Vector, double&amp;gt; distance = DistanceFunction;&#xA;&#xA;&#xA;            NelderMeadOptimizer nm1 = new NelderMeadOptimizer();&#xA;            nm1.ObjectiveFunction = DistanceFunction;&#xA;            nm1.ContractionFactor = 0.5;&#xA;            nm1.ExpansionFactor = 2;&#xA;            nm1.ReflectionFactor = -2;&#xA;            nm1.SolutionTest.AbsoluteTolerance = 1e-15;&#xA;            nm1.InitialGuess = Vector.CreateConstant(2, 1.0 / ((double)2));&#xA;            nm1.ExtremumType = ExtremumType.Minimum;&#xA;            Vector solution = nm1.FindExtremum();&#xA;&#xA;            Console.WriteLine(&quot;Solution: {0:F6}&quot;, solution);&#xA;            Console.WriteLine(&quot;  Estimated error: {0}&quot;, nm1.EstimatedError);&#xA;            Console.WriteLine(&quot;  # iterations: {0}&quot;, nm1.IterationsNeeded);&#xA;            Console.WriteLine(&quot;  # function evaluations: {0}&quot;, nm1.EvaluationsNeeded);&#xA;            Console.Write(&quot;Press Enter key to exit...&quot;);&#xA;            Console.ReadLine();&#xA;&#xA;&#xA;        }&#xA;&#xA;&#xA;        private static double DistanceFunction(Vector Weights)&#xA;        {&#xA;            Matrix Sigma = Matrix.Create(new double[,] {&#xA;                  {0.1, 0.23},&#xA;                  {0.23, 0.7}&#xA;                });&#xA;            // if VarP = Weights' * CovarMatrix * Weights and VolP = sqrt(VarP)&#xA;            // Then the marginal contribution to risk of an asset is the i-th number of&#xA;            // Sigma*Weights*VolP&#xA;            // And thus the contribution to risk of an asset is simply Weights . (Sigma*Weights/VarP)&#xA;            // we need to find weights such that Weights (i) * Row(i) of (Sigma*Weights/VarP) = 1/N&#xA;&#xA;            // that is we want to minimize the distance of row vector (Weights (i) * Row(i) of (Sigma*Weights/VarP)) and vector 1/N&#xA;&#xA;            double Variance = Vector.DotProduct(Weights, Sigma * Weights);&#xA;&#xA;            Vector Beta = Sigma * Weights / Variance;&#xA;&#xA;            for (int i = 0; i &amp;lt; Beta.Length; i++)&#xA;            {&#xA;                // multiplies row of beta by weight to find the percent contribution to risk&#xA;                Beta[i] = Weights[i] * Beta[i];&#xA;            }&#xA;&#xA;            Vector ObjectiveVector = Vector.CreateConstant(Weights.Length, 1.0 / ((double)Weights.Length));&#xA;            Vector Distance = Vector.Subtract(Beta, ObjectiveVector);&#xA;&#xA;            return Math.Sqrt(Vector.DotProduct(Distance, Distance));&#xA;&#xA;        }&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2691" LastActivityDate="2012-07-16T22:27:29.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3821" PostTypeId="1" AcceptedAnswerId="4827" CreationDate="2012-07-17T08:51:15.570" Score="13" ViewCount="502" Body="&lt;p&gt;An observation in capital markets is that the connection between return and risk (measured as volatility) is not that straightforward (at least not as modern portfolio theory assumes). One interesting instance is the so called &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1585031&quot;&gt;low-volatility anomaly&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It turns out empirically that stocks that exhibit low volatility show &lt;em&gt;higher&lt;/em&gt; returns than high-volatility stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I stumbled upon some articles which try to explain this anomaly away with the simple relationship between geometric and arithmetic means with continuous compounding:$$GM=AM-\frac{\sigma^2}{2},$$ see e.g. &lt;a href=&quot;http://cssanalytics.wordpress.com/2012/03/12/understanding-the-link-between-volatility-and-compound-returns/&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;http://falkenblog.blogspot.de/2012/01/is-arithmetic-return-bias-basis-of-low.html&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question&lt;/strong&gt;&lt;br&gt;&#xA;Can it be that easy? It looks almost insultingly simple to use this well known identity as the basis for the anomaly (which wouldn't be an anomaly after all). Do you know of any low-vol studies that control for that effect?&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2012-12-22T23:39:33.307" Title="Is Arithmetic Return Bias Basis of Low Vol Anomaly?" Tags="&lt;volatility&gt;&lt;risk-premium&gt;&lt;return&gt;&lt;capm&gt;&lt;anomalies&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3822" PostTypeId="1" CreationDate="2012-07-17T15:24:33.533" Score="5" ViewCount="590" Body="&lt;p&gt;I have been confused about many things concerning the princing of securities with collateral. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can prove that today's price of a security( fully collateralized and within the same currency) is the expectation under the risk neutral measure of the discounted(with the collateral rate) payoff. This first application of this theorem is the introduction of the zero coupon bond collateralized . &#xA;Now, for a matter of simplicity , we would like to work with this zero coupon bond as a numéraire to price classic derivatives such as cap/floor and swaptions. We all remember how to proceed to price those derivatives, change to the T forward measure, the forward libor is a martingale under the T forward measure , assuming a simple log normal process, we have Black's formula. &#xA;We apply the same thing for the swaption working with the annuity as a numeraire. &#xA;My confusion is that we often use the rule that says that for all tradable asset and a given numeraire, their ratio is a martingale under the measure related to the numeraire. &#xA;Let apply this rule to the Zero coupon bond collateralized,... it does not work because it would mean that the zero coupon collateralized and the risky zero coupon have the same price. &#xA;The result was kind of expected because it is (i think), &quot;all tradable asset without any intermediate payments.....&quot; Under the collateralization , there are intermediate payments . &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, we can see that for the pricing of swaption with collateral , the swap rate can be written as a ratio between a floating leg with collateralization( which is tradable) and the annuity with collateralization . In some papers I have read, they quickly conclude that because the floating leg is a tradable asset, its ratio with the annuity collateralized is a martingale under the measure related to this annuity. Why??? We saw a counter example with the zero coupon bond collateralized. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Shall we say : For all collateralized tradable asset, its ratio with a numeraire collateralized at the same collateral rate as the tradable asset is a martingale under the measure related to this numeraire? &#xA;What about when the tradable asset is collateralized with one currency, and the numeraire with another one ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks&lt;/p&gt;&#xA;" OwnerUserId="2698" LastEditorUserId="20454" LastEditDate="2017-10-09T15:41:48.970" LastActivityDate="2017-10-09T15:41:48.970" Title="Pricing with collateral" Tags="&lt;option-pricing&gt;&lt;collateral&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3823" PostTypeId="1" AcceptedAnswerId="3825" CreationDate="2012-07-17T16:24:31.770" Score="7" ViewCount="857" Body="&lt;p&gt;What is the relationship between the axioms of Artzner et al (1999) for coherent risk measures and the axioms of von Neumann-Morgenstern (1944) for the expected utility theory?&lt;/p&gt;&#xA;" OwnerUserId="494" LastActivityDate="2012-07-25T15:28:24.987" Title="Does a coherent risk measure satisfy the four axioms of von Neumann–Morgenstern?" Tags="&lt;coherent-risk-measure&gt;&lt;utility-theory&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3824" PostTypeId="2" ParentId="3811" CreationDate="2012-07-17T18:52:42.923" Score="0" Body="&lt;p&gt;You can consider the Oracle Crystal Ball API which is available in .NET. The basic product is an add-in to MS Excel for MC simulation, stochastic optimization and time-series forecasting. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the API, you can run MC simulation and time-series forecasting (for stochastic optimization you will need a separate license from another vendor).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The product (and the underlying API) is very stable (we are in existence for around 20 years now), has strong development and support team, mature documentation to get you started quickly and very large user base.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the product/API is not specific to finance, but there are lots of clients in financial domain, who use it for risk simulation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Disclaimer: I work for Oracle Crystal Ball and am one of the math developers.&lt;/p&gt;&#xA;" OwnerUserId="1442" LastEditorUserId="467" LastEditDate="2012-07-18T07:59:20.257" LastActivityDate="2012-07-18T07:59:20.257" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3825" PostTypeId="2" ParentId="3823" CreationDate="2012-07-17T21:06:52.577" Score="7" Body="&lt;p&gt;The von Neumann-Morgenstern utility axioms are normative criteria for rational choice. In contrast, he Artzner/Uryasev axioms are normative criteria that some argue must hold for any measure that aims to measure portfolio risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What they have in common is simply that they are normative criteria. The substance of the axioms are different, however, since they cover different domains.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of utility theory, the axioms represent constraints on preferences that hold for rational agents. An investor that did not hold one of the axioms could be deprived of their wealth thru a series of gambles or choices. (The easiest way to see this is to imagine gaming an individual whose preferences are not transitive.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Coherent risk measures are normative claims that some argue must be satisfied by a risk measure. For example, most of us would quite readily agree to the axiom of &quot;sub-additivity&quot; which states that the risk of two portfolios combined cannot have greater risk than the two risks separately (by virtue of diversification). Some measures such as Value-at-Risk do not satisfy this property, while others such as conditional value-at-risk do. At worst, the portfolios are perfectly correlated so there is no diversification benefit. So Artzner/Uryasev would argue that any risk measure (such as Value-at-Risk) that can show an increase in portfolio risk when two assets are combined is incoherent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are other axioms that govern related fields such as the axioms of euclidean geometry or the three axioms of probability. In all cases the axioms i) create a foundation for developing theories that are functions of the axioms (such as the pythagorean theorem, conditional probability, or utility of money theories), ii) the axioms allow us to test that our beliefs conform to normative expectations which has applied, practical value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Digression: Interestingly, in each case there are scenarios where one axiom is relaxed and new branches of science are opened up. For example, eliminating the requirement that &quot;parallel lines never intersect&quot; opens up the idea of &lt;a href=&quot;http://en.wikipedia.org/wiki/Riemannian_geometry&quot; rel=&quot;nofollow noreferrer&quot;&gt;Riemannian&lt;/a&gt; geometry. You can argue behavioral finance and bounded rationality involve relaxing one or more of the VNM utility axioms. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For completness, the von Neumann-Morgenstern utility axioms are completeness, transitivity, continuity, and independence.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Completeness implies that for every pair of choices, the agent prefers A over B, B over A, or is indifferent&lt;/li&gt;&#xA;&lt;li&gt;Transitivity implies that if an investor prefers A&gt;B, and B&gt;C, then the investor prefers A&gt;C&lt;/li&gt;&#xA;&lt;li&gt;Continuity requires that investor's preferences are continuous&lt;/li&gt;&#xA;&lt;li&gt;Independence assumes that preferences (say between a gamble A and gamble B) hold independently even if a third independent gamble is introduced. Note this one is somewhat controversial -- see the Ellsberg Paradox to see why&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The Coherent Risk Measures are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Normalized -- holding no assets entails zero risk&lt;/li&gt;&#xA;&lt;li&gt;Monotonicity -- if in any scenario Portfolio A results in less loss than Portfolio B, then Portfolio A is less risky than Portfolio B&lt;/li&gt;&#xA;&lt;li&gt;Sub-additivity -- portfolio risk cannot increase when adding two risks separately&lt;/li&gt;&#xA;&lt;li&gt;Positive homogeneity -- doubling your position size doubles your risk&lt;/li&gt;&#xA;&lt;li&gt;Translation invariance -- anytime you add cash to a portfolio you reduce portfolio risk&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;See also this &lt;a href=&quot;https://quant.stackexchange.com/questions/96/what-is-a-coherent-risk-measure&quot;&gt;post&lt;/a&gt; for some more insight on the Coherent Risk measure properties.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2012-07-18T00:57:05.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3826" PostTypeId="2" ParentId="3811" CreationDate="2012-07-18T04:48:52.253" Score="0" Body="&lt;p&gt;if you are serious about commerical risk software &lt;a href=&quot;http://www.finanalytica.com&quot; rel=&quot;nofollow&quot;&gt;FinAnalytica&lt;/a&gt; is worth looking into. It is a full software suite , and has implemented everything you will need and more for risk management, it also includes many cutting edge techniques that the other solutions do not.&lt;/p&gt;&#xA;" OwnerUserId="1764" LastActivityDate="2012-07-18T04:48:52.253" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3827" PostTypeId="1" CreationDate="2012-07-18T09:39:39.930" Score="5" ViewCount="667" Body="&lt;p&gt;I apologise for being brief, but I don't understand how is Euler equation used in the Ramsey growth model. I am reading a textbook &quot;Dynamic General Equilibrium Modeling&quot; and there is mentioned about it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am modeling the Ramsey model using the Kuhn-Tucker theorem, and I have a set of first-order conditions. I think this is good enough, as I can use a standard constrained optimization method to solve this Ramsey model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why do we need the Euler equation, which is a second-order different equation? It is not used in the constrained optimization method.&lt;/p&gt;&#xA;" OwnerUserId="2700" LastActivityDate="2019-03-05T02:43:19.847" Title="What is the use of the Euler equation in the Ramsey growth model?" Tags="&lt;optimization&gt;&lt;macro-economics&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3828" PostTypeId="1" CreationDate="2012-07-18T11:29:37.960" Score="2" ViewCount="529" Body="&lt;p&gt;A new Danish hedge fund has received quite a large amount of attention in the last month or so. They are launching a new investment fund that uses proprietary AI to select stocks to invest in. They claim to on the forefront of this. However, looking a bit on what research exists, it seems as if it is not as cutting-edge as they try to make it to be. I'm not an expert though which is why I would like to hear other's opinions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://translate.google.com/translate?hl=en&amp;amp;sl=da&amp;amp;tl=en&amp;amp;u=http%3A%2F%2Fwww.majinvest.com%2FForside%2FNyheder%2F2012%2F~%2Fmedia%2FMaj_Invest%2FPM_20120620_sinAI.ashx&quot; rel=&quot;nofollow&quot;&gt;Press release about the fund&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://translate.google.com/translate?sl=da&amp;amp;tl=en&amp;amp;js=n&amp;amp;prev=_t&amp;amp;hl=en&amp;amp;ie=UTF-8&amp;amp;layout=2&amp;amp;eotf=1&amp;amp;u=http%3A%2F%2Fwww.computerworld.dk%2Fart%2F218126%2Fkurt-har-kodet-et-system-der-saetter-verdens-investorer-til-vaegs%2Fkurt-har-kodet-et-system-der-saetter-verdens-investorer-til-vaegs%3Fop%3Dprint&amp;amp;act=url&quot; rel=&quot;nofollow&quot;&gt;Interview&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas of similar funds already existing? They seem pretty confident in their solution so any ideas of what it is they are doing (different)?&lt;/p&gt;&#xA;" OwnerUserId="1966" LastActivityDate="2012-07-18T14:21:14.587" Title="Use of AI in portfolio optimization" Tags="&lt;modern-portfolio-theory&gt;&lt;learning&gt;&lt;machine&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ClosedDate="2019-04-06T07:17:55.407" ContentLicense="CC BY-SA 3.0" />
  <row Id="3829" PostTypeId="2" ParentId="3828" CreationDate="2012-07-18T14:21:14.587" Score="3" Body="&lt;p&gt;Such an article, if written in English, would get laughed at so hard by the blogosphere the authors would be shamed into doing a bit more research on Wikipedia next time before claiming a fully automated AI system is &quot;the first of its kind.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This guy's main competitive advantage is in pitching to non-English speaking Danes who don't have a clue what's really going on out there.  Why do you think he refused to moved to London?  He knew he couldn't make it in a globally competitive landscape.  He may raise some money in the short term, but it looks highly unlikely he will be successful at investing in the US stock markets.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2012-07-18T14:21:14.587" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3830" PostTypeId="2" ParentId="3811" CreationDate="2012-07-18T14:51:42.873" Score="3" Body="&lt;p&gt;I use both NAG and Matlab a great deal.  They are both excellent choices for exactly the reasons you describe.  Having solid technical support and maintenance is a very serious concern for most reasonable-sized firms, and that tends to rule out open-source products.  I have generally also observed much greater reliability (albeit at the cost of less features) in commercial products, and in NAG and Matlab in particular.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also would not underestimate the value of professionally written documentation, something both NAG and Matlab excel at, and which competitors (such as R) are horrible at.  In fact, particularly for quantitative work, having an adequate description of the statistical techinque you are about to use, along with cross-references to similar alternative techniques which may be a better fit, right there beside you as you code, is invaluable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think you will often find die-hard advocates of open-source software online, and particularly in forums such as stack overflow and various stack exchange sites, but I have found people in the real-world to be far more likely to go for commercial software, and as with anything else, ultimately you get what you pay for.  While the turnaround time for eliminating bugs may be much shorter for open-source software, I think it also speaks volumes that I have never in my 5-year career as a quant plus 5 years as a grad student found a bug in Matlab.  Every time I thought I found a bug, it turned out to be my code that was the culprit.  Eliminating that nagging feeling that the bug in your code is really the fault of the software package or library is worth paying for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having said that, I &lt;strong&gt;do&lt;/strong&gt; use open-source software for non-core aspects of my work, such as the database, version control, file compression, etc.  We also use Java for coding the front-end and for working with some commercial risk vendors that only provide a Java interface.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2012-07-18T14:51:42.873" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3831" PostTypeId="1" CreationDate="2012-07-19T12:37:30.820" Score="6" ViewCount="1229" Body="&lt;p&gt;I'm doing some work for a company and one of my tasks is to research credit default swaps on banks and to write a page about them explaining what they are and how they're used to evaluate the banks' credit-worthiness.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After doing a bit of research on them I have a few questions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;What are the terms of a standard CDS contract? I know they were standardised after the financial crisis but is there a standard size / length now?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I've been looking at some data for countries' CDS spreads and I'm pretty sure that sometimes the CDS spread went over 10000 basis points, which is over 100% per annum. Surely that can't be right, or have I completely mis-read it?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Does anyone know where I can find CDS spread data for different banks in the UK? The information doesn't seem to be searchable on Bloomberg and it's very difficult to find elsewhere.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What are the other ways that companies / banks look at the credit-worthiness of other banks in order to protect their exposures apart from CDSs?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerDisplayName="user2706" LastEditorUserId="1106" LastEditDate="2012-07-19T14:00:01.607" LastActivityDate="2015-06-06T00:45:34.037" Title="What is a standard credit default swap contract and where can I find spread data? What alternatives exist to judge creditworthiness?" Tags="&lt;derivatives&gt;&lt;swaps&gt;&lt;credit&gt;&lt;banks&gt;&lt;cds&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3832" PostTypeId="1" CreationDate="2012-07-19T12:59:01.210" Score="3" ViewCount="108" Body="&lt;p&gt;Maybe more of a programming question,&#xA;Is there a Ruby gem to facilitate conversion of an option symbol notation from one form to another?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, one source provides &lt;strong&gt;TZA1220J18&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;but an API for a brokerage strictly goes by &lt;strong&gt;TZA^^^121020C00018000&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;whose description is &lt;strong&gt;TZA Oct12 18 Call&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I figure out how to do this indirectly, by invoking R from with Ruby for example, which R library would I need that given the first form, can return one of the later two notations as strings?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that exact days-of-month for option expiration may be irregular, so perhaps some website has an API to assist showing option symbols under different conventions?&lt;/p&gt;&#xA;" OwnerUserId="1785" LastActivityDate="2012-07-19T12:59:01.210" Title="Option symbol conversion" Tags="&lt;options&gt;&lt;r&gt;&lt;programming&gt;" AnswerCount="0" CommentCount="1" ClosedDate="2012-09-24T20:56:43.777" ContentLicense="CC BY-SA 3.0" />
  <row Id="3833" PostTypeId="1" AcceptedAnswerId="3834" CreationDate="2012-07-19T13:44:46.330" Score="3" ViewCount="1204" Body="&lt;p&gt;Assuming that I performed a multivariate regression and I found a set of $k$ coefficients $\alpha_1, ..., \alpha_k$ for each of the factors $F_1, ... F_k$. I have then computed the following relationship:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$y_t = \sum_{i=1}^k \alpha_i F_{i,t} + \epsilon_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far, I only looked at this equation to understand where the risk is coming from.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering if we could use this approach to create a portfolio made of funds $F_i$ which aims to match a benchmark (and hence $y$ are the returns of the benchmark).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We cannot use the correlation coefficient directly, as we do not have $\sum_{i=1}^k \alpha_i=1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe there is no real way to convert this result into a portfolio, am I right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I would normally use an optimizer that minimize the tracking error, I am just wondering if this approach is possible.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2012-07-19T14:05:28.647" LastActivityDate="2012-07-19T14:32:27.447" Title="How to compute portfolio weights from multivariate regression results?" Tags="&lt;asset-allocation&gt;&lt;regression&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3834" PostTypeId="2" ParentId="3833" CreationDate="2012-07-19T14:32:27.447" Score="3" Body="&lt;p&gt;If $\sum_{i=1}^k \alpha_i&amp;lt;1$, then you could just leave the remainder of the portfolio in cash.  If $\sum_{i=1}^k \alpha_i&amp;gt;1$, that means you will have to take on some leverage in order to minimize tracking error.  If you have a leverage constraint, then you can run this as a quadratic program with bounds on your coefficients.  A regression should give the same result as an optimizer with no bounds.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2012-07-19T14:32:27.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3837" PostTypeId="2" ParentId="3389" CreationDate="2012-07-20T12:18:29.493" Score="3" Body="&lt;p&gt;There is a simple explanation in this specific case (SPX vs JPM rolling 90-day realized vol). When you look at the specific daily price series of SPX and JPM during August 2011 (a very bad month for most hedge funds) you will notice 2 main differences between each series:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) JPM was already in a down trend and thus negative returns (or lower closing prices vs. previous day closing prices) in August did not push up its 90-day rolling vol up by too much. On the other side traded at very lofty levels all the way into July 22 2011 when market participants started to dump shares. Thus the negative returns (lower prices) pushed up volatility in SPX by much more than the vol measure of JPM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) During the days when the market generated the biggest losses for both JPM, and SPX the key difference here is that JPM traded very large intraday ranges while the closed to previous close was only elevated at 3-4 occasions in August while SPX traded relatively similar large intraday ranges but the close to previous close was also very large. This leads me to an observation of the GK formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GK=0.5(ln(h/l)^2)-.39(ln(ct/ct-1)^2&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where h=hi, l=lo, ct=close today, ct-1=close yest&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You notice that GK favors high intraday ranges and penalizes for large close to close ranges. When factoring points 1) and 2) into the formula one sees that the effects are partially offsetting each other, but my hunch is that the change in vol profile in SPX (point 1) are overshadowing the higher GK vols in JPM due to relatively higher intraday vol vs close to close vols. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get to your questions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Someone pointed out you need to make sure you understand the differences between your historic vol measures and implied vols. You mentioned you look for strategies on the listed options side making this a lot more difficult to exploit. Let's say you are good at forecasting a breakdown in your specific correlation figures. This in itself does not give you anything. You need to test for auto correlation in order to benefit from such ability looking forward. Also evenif you correctly predict a breakdown in correlations you need to be right on which asset's vol profile outperforms the other (the sign of GK(SPX , 90) - GK (JPM, 90) for example). Given you are able to do so your only way through listed options is to trade gamma differentials. You buy gamma in one underlying and dell the gamma of the other. You are much luckier on the OTC side because you can trade correlation swaps, soft exotic correlation/dispersion baskets to express views in changes in correlation profiles. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) I touched on it but your task is basically to test for autocorrelation. Observing historical variables has zero bearing on the future in the absence of auto correlation. Fortunately certain implied volatility metrics display high auto correlation but you need to test for it in a rigorous fashion. This is how many professional options traders utilize realized vols to make inferences on expected changes in implied vols. Some traders explicitly look at dispersion between realized and implied vols. But the key again here is that you need to establish a link between the two through auto correlation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps a bit. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-07-20T12:18:29.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3838" PostTypeId="2" ParentId="1197" CreationDate="2012-07-20T15:00:52.347" Score="3" Body="&lt;p&gt;The OpenGamma Analytics Library definitely does have a Local Volatility model available. In addition, in our &lt;a href=&quot;https://strata.opengamma.io/quant_research/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Quantitative Papers&lt;/a&gt; page there's a link to the full mathematics and basis for our Local Volatility implementation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd be interested to know why you decided to write your own rather than using one of the above.&lt;/p&gt;&#xA;" OwnerUserId="2695" LastEditorUserId="18748" LastEditDate="2020-05-19T04:58:19.237" LastActivityDate="2020-05-19T04:58:19.237" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="3839" PostTypeId="1" AcceptedAnswerId="3840" CreationDate="2012-07-20T15:25:44.737" Score="10" ViewCount="443" Body="&lt;p&gt;Say I have a limited sample, a month of daily returns, and I want to estimate the 99.5th percentile of the distribution of absolute daily returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because the estimate will require extrapolation, I will need to make a distributional assumption. Is there a standard approach to take here if I want to include the higher kurtosis in my estimate?&lt;/p&gt;&#xA;" OwnerUserId="2303" LastEditorUserId="1106" LastEditDate="2012-07-20T20:07:59.653" LastActivityDate="2012-07-20T20:08:17.720" Title="What distribution should I apply to estimate the likelihood of extreme returns?" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;probability&gt;&lt;estimation&gt;&lt;distribution&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3840" PostTypeId="2" ParentId="3839" CreationDate="2012-07-20T16:00:23.227" Score="7" Body="&lt;p&gt;What you refer to as the 99.5th percentile is known as the &quot;Value-at-Risk.&quot;  You are correct that you will need to make a distributional assumption, and there is a popular and well-researched approach to this problem, though I'm not certain it could be called &quot;standard.&quot;  I would recommend you use the &quot;truncated Levy flight&quot; distribution.  James Xiong at Morningstar has written a few &lt;a href=&quot;http://corporate.morningstar.com/ib/documents/MethodologyDocuments/IBBAssociates/UsingTruncatedLevyFlightToEstimateDownsideRisk.pdf&quot; rel=&quot;noreferrer&quot;&gt;papers&lt;/a&gt; on this topic, and you can find more by googling him and this topic.  &lt;a href=&quot;http://corporate.morningstar.com/ib/documents/MethodologyDocuments/IBBAssociates/NailingDownsideRisk.pdf&quot; rel=&quot;noreferrer&quot;&gt;Here&lt;/a&gt; is a less technical, more introductory piece on the topic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, you should consider other risk measures, most notably Expected Shortfall (ES), also known as Conditional-Value-at-Risk (CVaR), which examines not just what the 99.5% percentile is, but what the conditional expected return is beyond that point.  I also recommend you read this &lt;a href=&quot;http://www.mscibarra.com/research/articles/2010/Extreme_Risk_Analysis_JPM_Spring_2010.pdf&quot; rel=&quot;noreferrer&quot;&gt;MSCI piece&lt;/a&gt; on the topic.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2012-07-20T20:08:17.720" LastActivityDate="2012-07-20T20:08:17.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3841" PostTypeId="1" CreationDate="2012-07-20T18:38:53.370" Score="-5" ViewCount="318" Body="&lt;p&gt;Currently, the federal reserve interest rate is 0-0.25%, and the inflation is 2-3%. Does this contradict the no-arbitrage principle? (The arbitrage being: borrow money at 0.25% and invest it in the &quot;basket of goods&quot; or other non-inflating assets). Essentially, the borrower gets paid to hold assets. Why?&lt;/p&gt;&#xA;" OwnerUserId="2711" LastActivityDate="2012-07-20T20:12:44.143" Title="inflation &gt; interest rate?" Tags="&lt;interest-rates&gt;&lt;no-arbitrage-theory&gt;&lt;inflation&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2012-07-21T01:35:37.557" ContentLicense="CC BY-SA 3.0" />
  <row Id="3842" PostTypeId="2" ParentId="3841" CreationDate="2012-07-20T20:03:10.207" Score="6" Body="&lt;p&gt;This is not an arbitrage because the transaction costs of the basket of goods is too high.  Ever try to sell an item on eBay?  I doubt you'll get 2-3% more for it next year, even new in box.  Some of the items in the basket are current consumption goods. Good luck selling those fresh fruits and vegetables next year for 2-3% more than you paid.  Others are mere estimates of costs people incur, not actual goods.  How on earth are you going to resell a year's rent?  Also, the 0.25% interest rate only applies for overnight loans if you are a prime bank.  For individuals borrowing &quot;unsecured&quot; (as I doubt your basket of goods counts as proper collateral), the rate is much higher.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Separately, this is also not an arbitrage because it is doing exactly what the Fed is trying to encourage, namely more borrowing and more current consumption.  This is known as having a policy of negative real interest rates, and it has happened many times in many places in the past.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for &lt;em&gt;why&lt;/em&gt; the Fed is trying to encourage this behavior, that is a very complicated question on the goals of monetary policy, and is out of the scope of this site.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastEditorUserId="1106" LastEditDate="2012-07-20T20:12:44.143" LastActivityDate="2012-07-20T20:12:44.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3844" PostTypeId="2" ParentId="3823" CreationDate="2012-07-22T12:22:06.643" Score="2" Body="&lt;p&gt;See the paper &quot;On the conditional value at risk Probability dependent utility function&quot; by Alexandre Street, on Theory and Decision, 2010. It shows that the well know CVAR fails in the independence axiom but it also provides good insights for that. The CVAR (redefined for revenues and not for losses - see the above paper) is convex in the probability set. This is the main reason why this measure does not follow the independence axiom.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't have access to that journal, you can find a manuscript on the &lt;a href=&quot;https://sites.google.com/site/alexandrestreet2/artigosecongressos&quot; rel=&quot;nofollow&quot;&gt;authors page&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2716" LastEditorUserId="2716" LastEditDate="2012-07-25T15:28:24.987" LastActivityDate="2012-07-25T15:28:24.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3845" PostTypeId="1" AcceptedAnswerId="3847" CreationDate="2012-07-22T19:19:37.137" Score="15" ViewCount="652" Body="&lt;p&gt;I am looking to evaluate the hypothetical advantage one trading system has over another in terms of the possible returns given their latency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Irene Aldridge wrote a piece (&lt;a href=&quot;http://www.finalternatives.com/node/9271&quot;&gt;How Profitable Are High-Frequency Trading Strategies?&lt;/a&gt;) which describes how to relate holding time to Sharpe ratio, although her approach seems somewhat arbitrary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I am investigating the effect of latency on market making strategies, I have modified this approach to use the maximal spread in a time frame to be the return and the spread's variance as risk (as the spread proxies for the risk of the market maker).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any other metrics I can make use of? Does my approach thus far seem reasonable?&lt;/p&gt;&#xA;" OwnerUserId="2137" LastEditorUserId="1106" LastEditDate="2012-07-23T13:53:16.977" LastActivityDate="2012-07-23T16:18:41.803" Title="How does one measure the effect of latency on potential returns?" Tags="&lt;quant-trading-strategies&gt;&lt;trading-systems&gt;&lt;market-making&gt;&lt;sharpe-ratio&gt;&lt;latency&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3846" PostTypeId="2" ParentId="390" CreationDate="2012-07-22T19:38:29.233" Score="9" Body="&lt;p&gt;The issues pointed out in the various footnotes and references here do not seem to address this issue. There are numerous situations where detailed intelligent binning is not only appropriate, but adds value to the model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's break it down to the basics, which is that in a digital world every thing is categorical. We never measure AGE down to the second, minute, day, week or even month. Why not? Because we assume that at those minute intervals the response variable is the same. How is tat different from assuming that the response variable is the same for those between ages of 25 and 27, If the data shows that the credit risk for people with 10-15 years of credit history is the same, why would we assume there is a linear relationship there?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Isn't that just trying to impute more in the data than exists?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is true that by discretizing the data we increase the available degrees of freedom, but only if we assume each interval is defined by a separate variable AND with large data sets (thousands of observations are not only common, but on the low side of many data sets). I think the problem with many comments here are from areas where sample sizes are small, biomed, social sciences, ... In the marketing and financial and other consumer worlds there is more data than you can shake a stick at.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, binning has been an accepted and proven practice in the consumer industry since Fair, Isaac first started building scorecards, back in the 1960's. FICO still uses complex binning techniques for almost all of their models today. One of the current top data mining tools, TreeNet from Salford, is essentially based on binning techniques.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, anyone who considers binning to not be best practice as a potential transformative technique is not behind the technology curve, way behind.&lt;/p&gt;&#xA;" OwnerUserId="2717" LastActivityDate="2012-07-22T19:38:29.233" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3847" PostTypeId="2" ParentId="3845" CreationDate="2012-07-22T19:59:40.073" Score="15" Body="&lt;p&gt;An interesting starting point is &lt;a href=&quot;http://moallemi.com/ciamac/papers/latency-2009.pdf&quot; rel=&quot;noreferrer&quot;&gt;The Cost of Latency&lt;/a&gt; by Moallemi and Saglam. After setting up a simple order execution problem --- in which a trader must chose between a market order and a limit order and guarantee execution over a fixed interval $[0,T]$, they proceed to derive a (complex) close form solution for the optimal strategy and evaluate the impact of latency on trading costs. In particular, they derive a simple expression to approximate the cost of latency when the latency is small (i.e. in the limit $\Delta t \to 0$, where $\Delta t$ denotes some measure of the latency of the trading system). In terms of price volatility $\sigma$, the bid-ask spread $\delta$, the cost of latency is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\sigma\sqrt{\Delta t}}{\delta}\sqrt{\log \frac{\delta^2}{2 \pi \sigma^2 \Delta t}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The profile of the latency cost according to their model is (Fig 7, &lt;a href=&quot;http://moallemi.com/ciamac/papers/latency-2009.pdf&quot; rel=&quot;noreferrer&quot;&gt;The Cost of Latency&lt;/a&gt; by Moallemi and Saglam)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/EmJDZ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The proceed to evaluate the historical cost of latency and the implied latency for a basket of NYSE stocks (Figs 8 and 9, &lt;a href=&quot;http://moallemi.com/ciamac/papers/latency-2009.pdf&quot; rel=&quot;noreferrer&quot;&gt;The Cost of Latency&lt;/a&gt; by Moallemi and Saglam)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/eoTSl.png&quot; alt=&quot;enter image description here&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/FPbQo.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="1531" LastEditorUserId="1531" LastEditDate="2012-07-23T16:18:41.803" LastActivityDate="2012-07-23T16:18:41.803" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3848" PostTypeId="1" AcceptedAnswerId="3905" CreationDate="2012-07-23T17:10:34.720" Score="13" ViewCount="910" Body="&lt;p&gt;I would like to get and idea of how people use GPUs in finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can find some specific papers or books on the subject.&lt;br&gt;&#xA;GPUs in binomial model, finite difference, monte carlo,...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I couldn't find any recent survey papers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you know some recent survey paper?&lt;br&gt;&#xA;Or any kind of reference which try to gives a birdview on GPUs in finance?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Added&lt;/strong&gt;&lt;br&gt;&#xA;Reference I found:&lt;br&gt;&#xA;&lt;a href=&quot;http://arxiv.org/abs/1101.3228&quot; rel=&quot;nofollow&quot;&gt;Pagès, Wilbertz, 2011, GPGPUs in computational finance: Massive parallel computing for American style options&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://arxiv.org/abs/1102.4666&quot; rel=&quot;nofollow&quot;&gt;Labart, Lelong,2011,A Parallel Algorithm for solving BSDEs - Application to the pricing and hedging of American options&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://books.google.ca/books?hl=en&amp;amp;lr=&amp;amp;id=LsNVFUnzcVMC&amp;amp;oi=fnd&amp;amp;pg=PA307&amp;amp;dq=finance+gpu&amp;amp;ots=vZicVQqCiF&amp;amp;sig=puCAbalkpaW42L-2yrJtsyGKyxw&amp;amp;redir_esc=y#v=onepage&amp;amp;q=finance%20gpu&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;Bradley, 2012, State of GPU computing in computational finance&lt;/a&gt;&lt;br&gt;&#xA;The paper digs deep in current GPU method in QF, but the general survey is very short. &lt;/p&gt;&#xA;" OwnerDisplayName="user2688" LastEditorUserId="2299" LastEditDate="2012-08-17T20:46:24.243" LastActivityDate="2017-05-13T00:18:16.897" Title="Reference request: Survey article on GPU in Finance" Tags="&lt;programming&gt;&lt;hardware&gt;&lt;gpgpu&gt;" AnswerCount="4" CommentCount="12" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3849" PostTypeId="1" CreationDate="2012-07-24T13:40:39.127" Score="10" ViewCount="2499" Body="&lt;p&gt;I am following an article by Mohamed Elsaiid (MFTA) about Volatility-Based Envelopes - a quite new technical indicator he has introduced, that is being used by Bloomberg. My goal is to get a simple and accurate formula to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have encountered a few issues while trying to formalize the ideas presented in the article.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;In &quot;Step 1&quot; of the calculations, one should calculate the standard deviation over duration of 21 daily percent change values. I was wondering how percent change values are calculated: according to the change from open to close? From low to high? From close of previous day to close of current day?&lt;/li&gt;&#xA;&lt;li&gt;&quot;Step 2&quot; of the calculations is presented with an example. $\mu$ is said to be the simple average of the percent change (I guess it is over the same period that was used in the first step?), $S$ is said to be the last given price (close?), and $d$ is said to be the standard deviation of the percent change (calculated in &quot;step 1&quot;). Then: the lower and upper row VBE are at $S\cdot (1+\mu-2d)$ and $S\cdot (1+\mu+2d)$ respectively. I guess 2 here is a parameter to be played with?&lt;/li&gt;&#xA;&lt;li&gt;&quot;Step 3&quot; is called &quot;Smooth the raw VBE using weighted moving averages&quot;. In the article, Mohamed says we will use &quot;centered weighted moving average (CWMA)&quot;, but does not explain any further; in general, weighted moving averages should have some weighing function. If I understand correctly, it is a common abuse of notation in the world of technical analysis to say &quot;weighted moving average&quot; when one really means that the weights decrease in arithmetic progression. I also assume that the arithmetic progression factor is 1. Though, even assuming so I am not sure it is clear to me what does he mean by CWMA - is the decreasing arithmetic progression applied to both sides, and to each with the same arithmetic progression factor (1)?&quot; If that so, and the time period in question is $n$, I guess the system needs $n/2$ values from the future. Though, Mohamed later claims that for $n=21$ there are exactly 5 missing data points.&lt;/li&gt;&#xA;&lt;li&gt;&quot;Step 4&quot; is completely unclear to me, so I am not sure I can even ask a proper question about it. The aim  of that step is to provide a method of forecasting the missing values (the ones &quot;from the future&quot;). It starts by calculating the correlation coefficients (?) of percentage change over a few different time spans (21, 17, 13, 9, 5 and 2 days) over the recent 63-actual data points (?). Correlation between what? Without doing the forecast first, how can one even calculate the CWMA, of &lt;em&gt;any&lt;/em&gt; period? He keeps doing something a bit clearer with the results later, but I think that this stage was not understood enough to keep writing about it.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I'd appreciate any help in trying to understand this interesting indicator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reference: &lt;a href=&quot;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CE8QFjAA&amp;amp;url=http://ifta.org/public/files/journal/d_ifta_journal_12%28md010312%29.pdf&amp;amp;ei=w6QOUO-yAoqirAGi3ID4DQ&amp;amp;usg=AFQjCNG0lMxU2DU4XlEDFS_lruVHb1-6hA&quot;&gt;The article&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2723" LastEditorUserId="2723" LastEditDate="2012-07-24T14:03:59.423" LastActivityDate="2014-01-10T08:49:37.570" Title="Volatility-Based Envelopes" Tags="&lt;volatility&gt;&lt;algorithm&gt;&lt;indicator&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3851" PostTypeId="1" CreationDate="2012-07-26T11:06:54.773" Score="2" ViewCount="52" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Possible Duplicate:&lt;/strong&gt;&lt;br&gt;&#xA;  &lt;a href=&quot;https://quant.stackexchange.com/questions/1891/how-much-data-is-needed-to-validate-a-short-horizon-trading-strategy&quot;&gt;How much data is needed to validate a short-horizon trading strategy?&lt;/a&gt;  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&#xA;&#xA;&lt;p&gt;Suppose I have daily returns for a trading strategy against one month of data. Before starting trading on small quantities or buying further data, I would like to understand the worth of any such action. I am basically looking at the returns per day and the standard deviation between these returns.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Is there a standard theory that tells me about the &lt;em&gt;minimum number of data points&lt;/em&gt; based on these factors  i.e. daily returns, mean return and standard deviation? A minimum number of data points that gives me some sort of a confidence range to invest further for data.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is there a standard theory that lets me infer some results into the future based on a standard approach?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1651" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2012-07-26T12:02:58.247" Title="Inferring Returns From Minimal Data Points" Tags="&lt;time-series&gt;&lt;risk&gt;&lt;quant-trading-strategies&gt;&lt;backtesting&gt;&lt;expected-return&gt;" AnswerCount="0" CommentCount="3" ClosedDate="2012-07-26T15:14:54.713" ContentLicense="CC BY-SA 3.0" />
  <row Id="3852" PostTypeId="2" ParentId="2465" CreationDate="2012-07-26T13:35:07.023" Score="2" Body="&lt;p&gt;Directly from the Berk paper &lt;a href=&quot;http://www.knightsbridgesearch.com/site/downloads/27.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Five Myths of Active Portfolio Management&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&amp;quot;Even more surprising is the extent of what the average manager adds. The mean of the distribution in the Exhibit is 6.5%. Given a management fee of 1.5%, this means that the data are consistent with an alpha of 5% for the average manager.&lt;/p&gt;&#xA;&lt;p&gt;&amp;quot;Of course, investors themselves never see this. Competition among them increases the size of the fund and drives the alpha to zero. Instead the managers themselves capture this value through the fees they charge.&amp;quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;The second paragraph is especially telling. From the investor's perspective, active managers provide no value in terms of return. Berk himself is saying exactly this. With this conclusion there are then many reasons why active management is a negative for investors (style drift, fees, etc.). This paper only serves to strengthen the argument that participating in active management is a loser's game for investors.&lt;/p&gt;&#xA;" OwnerUserId="2731" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2012-07-26T14:44:57.400" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3853" PostTypeId="2" ParentId="3831" CreationDate="2012-07-26T14:58:49.120" Score="4" Body="&lt;p&gt;Markit is a pretty good source for CDS information, and their prices are pretty much the standard the industry goes by.  Your best bet for finding large spreads would be to look at some of the European Banks or possibly TEPCO after the Japan Tsunami.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Derivatives by default aren't &quot;standard,&quot; the instruments are designed to be flexible, but the closest thing to a standard I've seen in CDS is cost to insure 10M or 10,000.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Relating to your last question, &lt;a href=&quot;http://www.panopticon.com/demo/13&quot; rel=&quot;nofollow&quot;&gt;this demo of Panopticon's counterparty risk software&lt;/a&gt; will show you some other ways banks hedge counterparty exposure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.markit.com/assets/en/docs/commentary/markit-movers/2011/BigMovers250712.pdf&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; is a daily report on the biggest movers you can subscribed to have e-mailed everyday:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://blog.creditlime.com&quot; rel=&quot;nofollow&quot;&gt;Another good CDS site.&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2732" LastEditorUserId="1106" LastEditDate="2012-07-26T15:20:49.177" LastActivityDate="2012-07-26T15:20:49.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3854" PostTypeId="2" ParentId="2554" CreationDate="2012-07-26T15:10:37.573" Score="1" Body="&lt;p&gt;The &lt;a href=&quot;http://r-forge.r-project.org/R/?group_id=316&quot; rel=&quot;nofollow&quot;&gt;quantstrat&lt;/a&gt; R package (which seems to be a part of TradeAnalytics) might be a good solution if you're already using R for analysis. This &lt;a href=&quot;http://blog.fosstrading.com/2011/08/introduction-to-quantstrat.html&quot; rel=&quot;nofollow&quot;&gt;introductory blog post&lt;/a&gt; explains some of the features. There was a presentation at R/Finance 2011 by Brian Peterson about developing quantitivate strategies in R, &lt;a href=&quot;http://www.rinfinance.com/agenda/2011/BrianPeterson.pdf&quot; rel=&quot;nofollow&quot;&gt;here is the PDF&lt;/a&gt; of the talk.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2012-07-26T15:10:37.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3855" PostTypeId="2" ParentId="2465" CreationDate="2012-07-26T15:14:45.027" Score="3" Body="&lt;p&gt;An active manager can be good for a few reasons.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;They can scale resources much better than an individual investor, and as a result can get better execution prices and access to assets that would be impractical for some individual investors(unsponsored foreign listings comes to mind).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Better firms will have tax professionals available to minimize taxes and therefore increase returns - whatever it takes to beat the benchmark, right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, it might be worthwhile to look at a manager who has a contrary style to your own.  This can offer a hedge of sorts and may supply opportunities you otherwise wouldn't undertake.&lt;/p&gt;&#xA;" OwnerUserId="2732" LastActivityDate="2012-07-26T15:14:45.027" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3856" PostTypeId="1" AcceptedAnswerId="3884" CreationDate="2012-07-26T15:52:20.097" Score="3" ViewCount="2156" Body="&lt;p&gt;Ever since I work in finance I was wondering what accrued interest (AI) are good for (&lt;a href=&quot;http://en.wikipedia.org/wiki/Accrued_interest&quot; rel=&quot;nofollow&quot;&gt;see the wikipedia article&lt;/a&gt; for a short introduction). I think I have a clear picture in mind now and the usual explanations are misleading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clean prices (=quoted prices) are needed to show a smooth price evolution and they prevent the zig-zag that I get in dirty prices after the coupon payment- alright, I understand that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I sell a bond I get the cash (=dirty = full) price which is &#xA;$$&#xA;\text{full price} = \text{clean price} + \text{AI},&#xA;$$&#xA;where &#xA;AI is some defined fraction of the coupon that is zero on a coupon date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most explanation say something like &quot;AI are the compensation if I sell the bond before the coupon payment&quot;. But isn't that wrong? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get the full price for my bond - the discounted cashflows. So I also get the discounted value of the next coupon. It is the discounted coupon - but the &lt;strong&gt;&lt;em&gt;whole&lt;/em&gt;&lt;/strong&gt; discounted coupon - that's it.&#xA;I get the full price on the first day after the preceding coupon payment all the way to the last day before the next payment. When there is a trade, discounted cashflows as a whole are traded i.e. not a fraction of any of them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My summary&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;dirty prices are the object of interest (they tell you the yield-to-maturity, they are traded &lt;strong&gt;but&lt;/strong&gt; they have a drop after the coupon payment).&lt;/li&gt;&#xA;&lt;li&gt;clean prices are there for quotation and for graphing prices - no drop because of coupon payments.&lt;/li&gt;&#xA;&lt;li&gt;AI are &lt;strong&gt;one&lt;/strong&gt; way to remove the drop at a coupon payment date. Of course there must be a &#xA;convention for AI in order that every market participant can go from dirty to clean and back. But the usual explanation as a reward is misleading.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What do you think about this interpretation of these terms?&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2012-08-01T09:10:19.187" Title="How to properly interpret accrued interest of bonds" Tags="&lt;fixed-income&gt;&lt;bond&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3857" PostTypeId="1" CreationDate="2012-07-26T17:06:56.010" Score="8" ViewCount="492" Body="&lt;p&gt;Given an implied volatility surface (on equity indexes) and a calibrated model, what is the range of error on implied volatility a trader would accept ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This obviously depends on the model used to calibrate. I am interested in classical stochastic volatility models (Heston, SABR, e.g.) to begin with.&lt;/p&gt;&#xA;" OwnerUserId="2411" LastEditorUserId="848" LastEditDate="2012-07-26T19:55:13.410" LastActivityDate="2012-09-25T18:27:45.453" Title="What is an acceptable error on implied volatility?" Tags="&lt;equities&gt;&lt;implied-volatility&gt;&lt;market-data&gt;&lt;stochastic-volatility&gt;&lt;calibration&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3858" PostTypeId="2" ParentId="3020" CreationDate="2012-07-26T18:28:34.503" Score="3" Body="&lt;p&gt;I assume no interest rates to clarify the approach. The Heston model is written under the risk-neutral probability as&#xA;$$ \frac{dS_t}{S_t} = \sqrt{v_t}dW_t $$&#xA;$$ dv_t = -\kappa(v_t-\eta)dt + \theta \sqrt{v_t}dZ_t $$&#xA;with $d\langle W,Z\rangle_t = \rho dt$ and $v_0 = \sigma_0^2$. Using Itô's lemma we can derive&#xA;$$ \log\left(\frac{S_t}{S_0}\right) = \int_0^t \sqrt{v_s}dW_s - \frac{1}{2} \int_0^t v_s ds $$&#xA;According to the CBOE &lt;a href=&quot;http://www.cboe.com/micro/skew/documents/SKEWwhitepaperjan2011.pdf&quot; rel=&quot;nofollow&quot;&gt;white paper&lt;/a&gt;, the SKEW index is computed from&#xA;$$ SKEW = 100 - 10 \mathbb{E}\left[ \left(\frac{R-\mu}{\sigma}\right)^3\right]$$&#xA;with $R$ being the 30-day log return of the S&amp;amp;P500 and $\mu$, $\sigma$ its mean and variance. You can -not without some work- rewrite the SKEW as a function of $v_t$ moments. Indeed you will have to use :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Itô's lemma with $f(x)=x^\alpha$ to get $\mathbb{E}(X_t^\alpha)$ with $X_t := \int_0^t \sqrt{v_s} dW_s$&lt;/li&gt;&#xA;&lt;li&gt;Itô's lemma with $f(x,y)=xy$ to get mixed expectation of form $\mathbb{E}(X_t^\alpha v_t^\beta)$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Eventually you will only worry about finding $v_t$ moments, which can be obtained by using the classical&#xA;$$v_t - \mathbb{E}(v_t) = \theta\int_0^t e^{-k(t-s)}\sqrt{v_s}dW_s $$&#xA;and the above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case you need fractional moments (as you are looking at the VIX as well), the following should be of interest.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Let X be a random variable with Laplace transform $\mathcal{L}$. Then if $n\in\mathbb{N}$ and $\alpha&amp;gt;0$ then&#xA;  $$ \mathbb{E}[X^{n-\alpha}] = \frac{(-1)^n}{\Gamma(\alpha)}\int_0^\infty \frac{\partial^{(n)}\mathcal{L}}{\partial \lambda}(\lambda)\lambda^{\alpha-1}d\lambda $$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This can be applied to find $\mathbb{E}[\sqrt{v_t}]$, $\mathbb{E}[v_t^{3/2}]$, etc. The Laplace transform of a CIR process has a closed-form of affine type and can be easily found in the litterature.&lt;/p&gt;&#xA;" OwnerUserId="2411" LastActivityDate="2012-07-26T18:28:34.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3859" PostTypeId="2" ParentId="3856" CreationDate="2012-07-27T01:49:55.510" Score="0" Body="&lt;p&gt;I'm not quite sure what the question is - are you asking if your explanations are correct?  Are you wondering why the full discounted coupon cash flow is accrued up to the settlement date?  It sounds like you are implying there may be some arbitrage opportunity by collecting the full discounted value of the next coupon payment immediately following receipt of a coupon.  This wouldn't work out for a multitude of reasons, most notably transaction costs and reinvestment risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, it might be worth mentioning that not all countries trade cum-coupon, some country's bonds trade ex-coupon for a certain period until the next coupon payment date.&lt;/p&gt;&#xA;" OwnerUserId="2732" LastActivityDate="2012-07-27T01:49:55.510" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3860" PostTypeId="2" ParentId="3856" CreationDate="2012-07-27T02:42:05.187" Score="-2" Body="&lt;p&gt;Your interpretation is not correct. When you sell a bond you get the &quot;clean price&quot;, not the dirty price. That's just how it is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And if you think about it, that's also the only logical way to do it. Otherwise, no one would ever be able to buy or sell bonds except right on or near the coupon date which would be the only time that the price would be fair to both parties.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you buy a coupon bond, you must (1) pay for bond itself (the dirty price) and (2) compensate (&quot;prepay&quot;) the seller for the pro-rated part of the coupon that they are entitled to (but that you will be getting instead of them in the future). Part (2) is a very real cash flow to/from your broker and not some theoretical construction. All in all you will be paying the clean price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in other words, the &quot;clean&quot; price is the value you would get for the bond if you sold it today in the market. The dirty price is just the sum of clash flow (i.e. the value of the bond itself if you were to steal it or obtain it for free).&lt;/p&gt;&#xA;" OwnerUserId="1628" LastActivityDate="2012-07-27T02:42:05.187" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3861" PostTypeId="2" ParentId="3695" CreationDate="2012-07-27T05:28:28.923" Score="6" Body="&lt;p&gt;The standard estimator of the covariance matrix is:&#xA;$$\widehat{ \mathrm{cov}}(X) = \frac 1 {n-1} \sum_{i=1}^n (X_i-\bar X)(X_i-\bar X)^T,$$&#xA;where $X_i$ is the column vector containing the $i$th observation of all the observables.  Each summand is an outer product of a vector with itself, i.e., a square matrix having rank at most one.  Therefore&#xA;$$\mathrm{rk\;}\widehat{\mathrm{cov}}(X) \le n$$&#xA;and the matrix not only can be but is always singular if&#xA;$$n \lt \dim X,$$&#xA;i.e., if the number of observations is less than the number of variables.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Edit: regarding positive-semidefiniteness:  $\widehat{ \mathrm{cov}}(X)$ is always positive-&lt;em&gt;semidefinite&lt;/em&gt; because it is &lt;a href=&quot;http://en.wikipedia.org/wiki/Gram_matrix&quot; rel=&quot;noreferrer&quot;&gt;Gramian&lt;/a&gt;, even if its rank is not full.  It loses the property of being positive-&lt;em&gt;definite&lt;/em&gt; if and only if it is singular.&lt;/p&gt;&#xA;" OwnerUserId="2561" LastEditorUserId="2561" LastEditDate="2012-07-27T07:20:39.933" LastActivityDate="2012-07-27T07:20:39.933" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3862" PostTypeId="2" ParentId="3857" CreationDate="2012-07-27T08:30:39.937" Score="0" Body="&lt;p&gt;Euh... why don't you ask him? You better make sure that the error is smaller than the bid-offer probably smaller than half of that. Now bid offer can vary on maturity and underlyer and can go from 0.1% to 5%...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyhow - the trader will look at the vega of any trade he needs to price and multiply that by the vol error and perhaps add the result to the price so he won't care really whether it's 0.01% of 0.5%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And btw what product are you pricing, that requires stoch vol?&lt;/p&gt;&#xA;" OwnerUserId="2599" LastActivityDate="2012-07-27T08:30:39.937" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3863" PostTypeId="1" CreationDate="2012-07-28T01:26:18.913" Score="6" ViewCount="1219" Body="&lt;p&gt;I am wondering about studies regarding the uncanny options pricing into public company's earnings reports.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The phenomenon being that the price of a straddle before earnings costs near exactly the positive or negative move that the stock makes after the earnings is released to be unprofitable or breakeven&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is curious because for example, the stock will frequently move 5% in either direction after earnings, but nobody knows which direction, the options aren't priced for a 2% move down and a 5% move up, they are priced for a 5% move up or down. You can look at the price of the straddles before earnings to determine how much the stock may move in either direction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the stock price after the earnings release related to a hedging strategy that large market participants must do? Has anyone done any real study on this and compared to issues that don't have active options contracts? I've &quot;heard&quot; that it is a reaction to things said in the earnings call and I've heard a lot of things, but this doesn't explain the predictive nature of the options&lt;/p&gt;&#xA;" OwnerUserId="1453" LastEditorUserId="1453" LastEditDate="2012-07-29T19:19:08.143" LastActivityDate="2012-07-30T20:08:51.640" Title="Science behind options pricing into Earnings event" Tags="&lt;options&gt;&lt;volatility&gt;&lt;equities&gt;&lt;hedging&gt;&lt;earnings&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3864" PostTypeId="1" CreationDate="2012-07-28T15:02:48.880" Score="15" ViewCount="866" Body="&lt;p&gt;Could anyone suggest some literature or have any practical advice for marking a market in thinly traded assets with the following characteristics:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;0-10 trades per day.&lt;/li&gt;&#xA;&lt;li&gt;Open limit-order book with 0-5 resting orders.&lt;/li&gt;&#xA;&lt;li&gt;Almost no correlation with more liquid assets&lt;/li&gt;&#xA;&lt;li&gt;Relatively high volatility.&lt;/li&gt;&#xA;&lt;li&gt;Small number of market participants.&lt;/li&gt;&#xA;&lt;li&gt;Very wide spreads that will hopefully make the risk worthwhile.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I am most interested in price discovery. How should I best use the limited information available and how should I protect myself against predatory traders who may take advantage of my algorithms by moving the market?&lt;/p&gt;&#xA;" OwnerUserId="2303" LastActivityDate="2015-12-30T03:19:02.327" Title="Market making in thinly traded assets" Tags="&lt;market-making&gt;&lt;market-microstructure&gt;&lt;liquidity&gt;" AnswerCount="3" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3865" PostTypeId="1" CreationDate="2012-07-29T01:09:24.613" Score="5" ViewCount="201" Body="&lt;p&gt;I'm rather new to the actual practice of this kind of analysis, but it just seems wrong to me to throw Mondays' returns in with the rest without accounting for the passage of time on the weekend when the market was closed, and yet I seem to come across analyses from time to time that do exactly that for daily returns, and simply assume so many trading days per month or per year.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To correct for this, I would take the difference in the natural logarithm of an adjusted security price from one trading day to the next, divide it by $\sqrt d$, and assign that data point a weight of $\sqrt d$, where $d$ is the number of calendar days elapsed.  Then I could express the mean, variance, and all other moments (if they exist!) on a calendar day basis.  Is this a standard practice?&lt;/p&gt;&#xA;" OwnerUserId="2561" LastActivityDate="2012-07-29T01:09:24.613" Title="Is it more accurate to analyze returns on a calendar day basis than a trading day basis?" Tags="&lt;statistics&gt;&lt;returns&gt;&lt;statistical-finance&gt;" AnswerCount="0" CommentCount="8" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3867" PostTypeId="2" ParentId="3864" CreationDate="2012-07-29T16:55:14.743" Score="-2" Body="&lt;p&gt;This might not be as thinly traded as your looking for, but &lt;a href=&quot;http://sharespost.com&quot; rel=&quot;nofollow&quot;&gt;SharesPost&lt;/a&gt; might have some useful information for you, at least on the price discovery part.&lt;/p&gt;&#xA;" OwnerUserId="2732" LastActivityDate="2012-07-29T16:55:14.743" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3868" PostTypeId="1" AcceptedAnswerId="3982" CreationDate="2012-07-29T23:53:24.657" Score="9" ViewCount="1461" Body="&lt;p&gt;Here's an interesting cocktail puzzle related to the term structure of interest rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the primary competing theories for explaining the term structure of rates is the Rational Exepctations Hypothesis (REH).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now generally we test a theory by examining the empirical data and seeing which theory explains the data parsimoniously. For example, if the REH is correct then the test is that implied forward rates are an &lt;em&gt;unbiased&lt;/em&gt; predictor (regardless of the quality of the prediction). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My claim is that you can show the REH has a bias on &lt;em&gt;a priori&lt;/em&gt; grounds and therefore can be rejected. Is the argument correct or is there a flaw?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Premises:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A. REH asserts that implied forward rates are unbiased predictors of future spot rates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;B. Implied forward rates are always above spot rates when the term structure is upward sloping, and similarly implied forwards are always below spot rates when the term structure is inverted. (This is true by the mathematics of calculating implied forward rates although you can see it by conceptually by considering that implied forward rates can be &quot;&lt;a href=&quot;http://www.scribd.com/doc/52447918/SalomonBrothersFixedIncome1&quot; rel=&quot;nofollow noreferrer&quot;&gt;locked-in&lt;/a&gt;&quot;.). A depiction of forward rates and the spot curve is depicted here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/M1mao.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;a href=&quot;http://www.scribd.com/doc/52447918/SalomonBrothersFixedIncome1&quot; rel=&quot;nofollow noreferrer&quot;&gt;Salomon Brothers Fixed Income Research (1995)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;C. By premises #1 and #2, REH will never predict term structure flattening.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;D. By #3, REH expectations are biased since the probability distribution of implied rates assigns zero chance to term structure inversion (although we know empirically there are non-zero chances). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simply put, REH biases future term structure changes upwards when term structure is upward sloping, and biases future term structure changes downwards when the term structure is inverted. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Conclusion:&#xA;REH is a biased predictor of future rates and therefore the theory is flawed. In particular, the REH biases future predictions of rates upwards when the term structure is upward sloping. Note: This is not to say that implied forward rates cannot predict an inversion with upward term structure. Indeed the chart above shows precisely this case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Postscript:&#xA;The Salomon Brothers research team sets up a cross-sectional regression experiment to identify which hypothesis holds up. Turns out they find that the bond risk premium hypothesis does out-performs the REH hypothesis.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-07-31T03:52:27.040" LastActivityDate="2012-08-21T19:23:53.857" Title="Implied forward rates puzzle" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3869" PostTypeId="1" AcceptedAnswerId="3871" CreationDate="2012-07-30T07:17:16.997" Score="3" ViewCount="366" Body="&lt;p&gt;I've never understood the purpose of patents in the financial industry.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What would be the pros and cons of applying for a patent on some financial model or trading system?&lt;/li&gt;&#xA;&lt;li&gt;What would be the motivating factors behind this?&lt;/li&gt;&#xA;&lt;li&gt;What sort of protection does this offer?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="1355" LastEditDate="2012-07-31T12:58:28.297" LastActivityDate="2012-07-31T12:58:28.297" Title="What are the pros and cons of applying for a patent on a financial model or trading system?" Tags="&lt;research&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3870" PostTypeId="1" CreationDate="2012-07-30T08:10:17.183" Score="4" ViewCount="584" Body="&lt;p&gt;I am using QuantLib to calculate implied volatilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to understand the calculated figures (especially, when compared to historical volatility). The calculated implied volatility numbers are seldom below 0.5, whilst the historic volatility numbers* is never above 0.5.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an output from my program:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;DEBUG: 20 day historic volatility: 0.10&#xA;DEBUG: 20 day implied vol: 0.519485358338&#xA;DEBUG: 30 day historic volatility: 0.10&#xA;DEBUG: 30 day implied vol: 0.515820883886&#xA;DEBUG: 40 day historic volatility: 0.12&#xA;DEBUG: 40 day implied vol: 0.624451849413&#xA;DEBUG: 50 day historic volatility: 0.16&#xA;DEBUG: 50 day implied vol: 0.692403434852&#xA;DEBUG: 60 day historic volatility: 0.30&#xA;DEBUG: 60 day implied vol: 0.492372372425&#xA;DEBUG: 70 day historic volatility: 0.27&#xA;DEBUG: 70 day implied vol: 0.544712487074&#xA;DEBUG: 80 day historic volatility: 0.31&#xA;DEBUG: 80 day implied vol: 0.579945073422&#xA;DEBUG: 90 day historic volatility: 0.12&#xA;DEBUG: 90 day implied vol: 0.489174212819&#xA;DEBUG: 100 day historic volatility: 0.31&#xA;DEBUG: 100 day implied vol: 0.563068062254&#xA;DEBUG: 110 day historic volatility: 0.24&#xA;DEBUG: 110 day implied vol: 0.608231639138&#xA;DEBUG: 120 day historic volatility: 0.38&#xA;DEBUG: 120 day implied vol: 0.62748262992&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can anyone explain why the ivol figures are generally, several multiples higher than the historic vol figures?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;*Note: Historic vols shown are annualized and calculated as the square root of the variance of log returns.&lt;/p&gt;&#xA;" OwnerUserId="1733" LastEditorUserId="1733" LastEditDate="2012-07-30T10:46:21.950" LastActivityDate="2012-08-30T18:01:56.783" Title="Interpreting QuantLlib implied volatility numbers" Tags="&lt;option-pricing&gt;&lt;implied-volatility&gt;&lt;quantlib&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3871" PostTypeId="2" ParentId="3869" CreationDate="2012-07-30T13:23:24.530" Score="5" Body="&lt;p&gt;Risk vendors need to provide a high-level of transparency and disclose their methods to their customers. BARRA's initial risk model was not accompanied by a patent. They claim, perhaps rightly so, that competing risk vendors lifted their ideas in their own products as a result.  I know their most recent risk model using the &quot;Eigenfactor methodology&quot; does have patent protection from other risk shops. It's hard to say how this would protect BARRA from private in-house risk organizations incorporating those insights.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2012-07-30T13:23:24.530" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3872" PostTypeId="1" AcceptedAnswerId="4111" CreationDate="2012-07-30T19:23:19.310" Score="4" ViewCount="4009" Body="&lt;p&gt;I'm a relatively small investor, and I'm interested in building my own fully-automated quantitative trading strategy. I also read about dark pools, and how difficult it is to get good prices on orders.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, in the context of the other players on the market, how much capital is necessary to create a viable trading strategy? I realize that getting a high profit margin will be nearly impossible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The kind of trading strategy I'm referring to would hold securities anywhere from a day to a year. I'm not looking to do HFT or scalping.&lt;/p&gt;&#xA;" OwnerUserId="1204" LastEditorUserId="1106" LastEditDate="2012-07-31T18:03:24.830" LastActivityDate="2013-11-21T03:16:46.620" Title="How much capital do I need to create a competitive automated trading strategy?" Tags="&lt;quant-trading-strategies&gt;&lt;automated-trading&gt;&lt;trading-systems&gt;" AnswerCount="3" CommentCount="7" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3873" PostTypeId="2" ParentId="3863" CreationDate="2012-07-30T20:08:51.640" Score="4" Body="&lt;p&gt;You discuss the behavior of stock prices after an earnings announcement. There is a significant amount of academic research on this topic (called post-earnings-announcement drift). It basically finds that stock prices tend to move sharply initially, but continue to gradually follow in the same direction as the initial move for several weeks thereafter. I'm not sure if this behavior can necessarily be connected to options markets. For instance, there is research into the size of the PEAD when firms have options on their stock and when they don't. The stocks that have options tend to move to the &quot;correct&quot; price faster than the ones without options. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the direction of the stock price move, markets typically look to whether the firm beats estimates or not. If the firm beats estimates, then the stock price rises, and vice-versa. Hence, it is not unrealistic to expect stocks to either go up or down sharply following earnings. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you say that options aren't priced for a 2% move down and a 5% move up, that's like saying the implied volatility curve is not as skewed before earnings announcements. Normally, implied volatility will have a skew/smile as a result of out of the money put contracts being expensive (people are buying protection to hedge themselves against a decline in prices). This presentation: &lt;a href=&quot;http://users.iems.northwestern.edu/~armbruster/2007msande444/presentation4.pdf&quot; rel=&quot;nofollow&quot;&gt;http://users.iems.northwestern.edu/~armbruster/2007msande444/presentation4.pdf&lt;/a&gt; suggests that there is no clear pattern of the behavior of implied volatility before and after earnings announcements. If there were movement, it could be informed trading in anticipation of a better/worse earnings release and call, or it could be due to a broader change in market risk appetites, or it could just be noise trading. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nevertheless, there's a lot of research related to options pricing around earnings, such as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.uic.edu/cba/accounting/Documents/VanBuskirk-paper.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.uic.edu/cba/accounting/Documents/VanBuskirk-paper.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/j.1911-3846.1997.tb00531.x/abstract&quot; rel=&quot;nofollow&quot;&gt;http://onlinelibrary.wiley.com/doi/10.1111/j.1911-3846.1997.tb00531.x/abstract&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://andromeda.rutgers.edu/~vdimitr/DIFOPN.pdf&quot; rel=&quot;nofollow&quot;&gt;http://andromeda.rutgers.edu/~vdimitr/DIFOPN.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1858881&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1858881&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1512046&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1512046&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1508174&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1508174&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2012-07-30T20:08:51.640" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3874" PostTypeId="2" ParentId="3872" CreationDate="2012-07-30T21:31:11.540" Score="7" Body="&lt;p&gt;As a starting point to my answer, I would say that reading a book is not sufficient to start doing automated trading on your own as chrisaycock suggests in his comment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would answer your questions in 3 different ways.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, building your &quot;AI bot&quot; which I would rather call a systematic algorithm not only requires programming skills, it also means having access to market data and, if you want to make it fully automatized, access to brokers APIs to send your orders. All this costs money, so if you're not a big, big investor or a firm, it's not likely that you will have the sufficient fund to really tackle the world of systematic trading. Don't even start thinking about feeding prices manually to a systematic strategy as an individual; you'll go on holidays or get drunk some night and forget to do it which will screw it up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, building an automated trading strategy which looks good in a backtest does not mean that it will do well in the live markets. This phenomenon is called the &lt;a href=&quot;http://en.wikipedia.org/wiki/Implementation_shortfall&quot;&gt;Implementation Shortfall&lt;/a&gt; and it adds to all the usual biases such as data-mining, survivorship bias and so on. Essentially, depending on the amount you wish to invest, you'll just give away your gains in transaction costs. What do you do if there are bugs? What do you do if you have no internet for some time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, even if you're successful for some time, keep in mind what Nassim Thaleb calls &quot;Monkeys on typewriters&quot; in his book &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/B001FA0W5W&quot;&gt;Fooled by Randomness&lt;/a&gt; (which I suggest you should read if you haven't already). Basically, this concept explains that out of billions of monkeys who would decide to write randomly on a typewriter, one will finally end up writing the Odyssey of Homer. So, it is possible that you will start by making profit, and it is possible that you know someone who's been doing so on his spare time for 10 years but bare in mind that it might just be luck. Being successful in systematic trading requires a lot of experience which comes with making mistakes and hence loosing money (so, if you're not ready to lose some big amount of your own cash it's gonna be difficult). Also keep in mind that even the most brilliant minds combined together to from systematic systems sometimes get it wrong - very wrong, so being alone won't help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm assuming here that your strategy would be looking to generate alpha rather than beta. If you want to do an asset allocation system trying to optimize your risk-adjusted return as a small investor, then it makes more sense to me.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2012-07-30T21:31:11.540" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3875" PostTypeId="1" AcceptedAnswerId="4180" CreationDate="2012-07-31T04:39:25.237" Score="4" ViewCount="400" Body="&lt;p&gt;I have been looking for a low cost solution to effectively store and query tick and bar data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Databases like kdb+ and Streambase are too expensive for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Building a custom solution with SSAS (&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms175609%28v=sql.90%29.aspx&quot; rel=&quot;nofollow&quot;&gt;Sql Server Analysis Services&lt;/a&gt;) is one of the options that can think off. Has anyone attempted this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you did attempt this, how did you organize your data? Any ideas in that direction would be helpful.&lt;/p&gt;&#xA;" OwnerUserId="2741" LastEditorUserId="467" LastEditDate="2012-07-31T08:59:54.813" LastActivityDate="2012-09-24T05:09:49.343" Title="Should I use SSAS to store Tick and bar data?" Tags="&lt;data&gt;&lt;analysis&gt;&lt;tick-data&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3876" PostTypeId="2" ParentId="3870" CreationDate="2012-07-31T17:42:06.650" Score="2" Body="&lt;p&gt;What you are observing is a natural occurence in the options market. If you think of PUT options as insurance, the premium is based on what the historical volatility of the underlying is. If option writers sold you the options at or below historical volatility they on average would loose money. So therefore, they &quot;mark up&quot; the historical volatility and that is how they make the money.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;HTH&lt;/p&gt;&#xA;" OwnerUserId="892" LastActivityDate="2012-07-31T17:42:06.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3879" PostTypeId="1" CreationDate="2012-08-01T04:26:12.253" Score="21" ViewCount="27083" Body="&lt;p&gt;I am looking to convince someone that an annualized Sharpe Ratio of 7 is 'extremely high' for a low frequency (daily rebalancing, say) long-short technical strategy on U.S. equities. I was hoping for a published source (preferably a journal article or conference paper) that either&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Provides a scale for interpreting Sharpe (&lt;em&gt;e.g.&lt;/em&gt; &quot;&gt; 1 is good, &gt; 2 is excellent, ... &quot;), based on observed Sharpe ratios of, say, active managers, or some such. (I can imagine this being rejected as &quot;biased&quot; or &quot;underinformed&quot;)&lt;/li&gt;&#xA;&lt;li&gt;Preferrably, presents statistics on achieved Sharpe ratios of Hedge Funds and other active managers, perhaps by strategy class, with long-ish histories, even with some back-fill bias, that would allow one to estimate what quantile a given Sharpe ratio would fall at. (&lt;em&gt;e.g.&lt;/em&gt; &quot;the cutoff for top 1% of Convertible Arb. funds achieved Sharpe is 1.5&quot; (I am making that up.))&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;edit:&lt;/strong&gt; I reiterate that &lt;em&gt;I&lt;/em&gt; have no doubts the number is bogus, but am trying to convince someone &lt;em&gt;else&lt;/em&gt;, someone without much market experience, that this is way outside of normal. &lt;/p&gt;&#xA;" OwnerUserId="108" LastEditorUserId="108" LastEditDate="2012-08-02T02:57:10.320" LastActivityDate="2021-05-01T10:43:52.043" Title="How high of a Sharpe ratio is implausibly high for a low-frequency equity strategy?" Tags="&lt;research&gt;&lt;reference-request&gt;&lt;performance&gt;&lt;sharpe-ratio&gt;&lt;performance-evaluation&gt;" AnswerCount="6" CommentCount="9" FavoriteCount="20" ContentLicense="CC BY-SA 3.0" />
  <row Id="3881" PostTypeId="2" ParentId="3879" CreationDate="2012-08-01T06:02:54.270" Score="12" Body="&lt;p&gt;Here are couple references. Especially the first link to Andy Lo's paper contains a list of Sharpe ratios of popular mutual and hedge funds:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.researchgate.net/profile/Andrew_Lo/publication/228139699_The_Statistics_of_Sharpe_Ratios/links/54998be00cf2d6581ab14cb7/The-Statistics-of-Sharpe-Ratios.pdf?origin=publication_detail&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Statistics of Sharpe Ratios&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.theinsidersfund.com/2011/11/the-dow-jones-credit-suisse-hedge-fund-indexes-performance-data-for-oct-2011/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Dow Jones Credit Suisse Hedge Fund Index&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.523.5419&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Generalized Sharpe Ratios and Portfolio&#xA;Performance Evaluation&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would go with the first paper. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2018-08-29T07:02:24.700" LastActivityDate="2018-08-29T07:02:24.700" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="3882" PostTypeId="2" ParentId="3879" CreationDate="2012-08-01T06:28:01.540" Score="5" Body="&lt;p&gt;I would even stick to the original paper by Sharpe (1966):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://finance.martinsewell.com/fund-performance/Sharpe1966.pdf&quot; rel=&quot;nofollow&quot;&gt;Mutual Fund Performance. The Journal of Business Vol. 39, No. 1, Part 2 pp.119--138&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you look at the numbers on Page 6 you can see that the funds sharpe ratios roughly are between $0$ and $1$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the Sharpe ratio already adjusts for the risk-free rate, you cannot really argue about its change. And if you do, you have to take into account that markets have become more efficient since 1966 (computers) so one would suspect the Sharpe ratio to have a tendency to be lower.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you know facts about the calculation methodology of the backtest (which timeseries are involved) you could also look for signs of bias (look-ahead?) or to re-calculate the strategy for yourself.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastEditorUserId="35" LastEditDate="2012-08-01T11:13:09.220" LastActivityDate="2012-08-01T11:13:09.220" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="3883" PostTypeId="2" ParentId="3879" CreationDate="2012-08-01T06:53:09.723" Score="11" Body="&lt;p&gt;The answer your are looking for might be the story in &lt;em&gt;&quot;Benchmarking Measures of Investment Performance with Perfect-Foresight and Bankrupt Asset Allocation Strategies&quot;&lt;/em&gt;, by Grauer (Journal of Portfolio Management). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;While this work main concerns are the differential ranking of various performance measures and with negative betas for market timing strategies, its analysis of perfect foresight allocation is relevant to the point you want to make. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The punch line is that even perfect foresight strategies that grow an investment more than trillion-fold over ~60 years have a sharpe ratio that is barely in excess of 1.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The table below describes summarily the low frequency strategies considered (I believe monthly, but it might be quarterly) and reports the wealth accumulated from 1934 to 1999 assuming an initial investment of 1 dollar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/C1Asl.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some selected performance measures for this strategies are in the next table:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/vcr88.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &quot;Industry No Margin&quot; perfect foresight strategy multiplies the initial investment by a factor of $\mathbf{1.4x10^{14}}$ over 65 years, yet it achieves a Sharp ratio of 1.14.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These observations don't settle the question, but they should instill enough doubts about any claim of a 7+ sharpe ratio for a low frequency strategies.&lt;/p&gt;&#xA;" OwnerUserId="1531" LastEditorUserId="1531" LastEditDate="2012-08-01T21:26:45.460" LastActivityDate="2012-08-01T21:26:45.460" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3884" PostTypeId="2" ParentId="3856" CreationDate="2012-08-01T09:10:19.187" Score="0" Body="&lt;p&gt;I found the following reference &lt;a href=&quot;http://www.financetrainer.com/fileadmin/inhalte/TOOLS_SKRIPTEN/0302_fie.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.financetrainer.com/fileadmin/inhalte/TOOLS_SKRIPTEN/0302_fie.pdf&lt;/a&gt;&#xA;(page 18,19)&#xA;which clearly states that with ISMA and Moosmüller method my explanation (hopefully clearly written) is correct. &#xA;In a summary:&#xA;There is no compensation for holding the bond between coupon dates by AI (at least in the German market). &#xA;AI is just one way to make the jump at coupon dates disappear. &#xA;The dirty price is the real thing, clean is just quoted.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2012-08-01T09:10:19.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3887" PostTypeId="2" ParentId="3879" CreationDate="2012-08-01T16:22:44.840" Score="3" Body="&lt;p&gt;This is a very common and serious problem among academic papers and with some hedge fund marketing materials, I can almost guarantee that the high ratio of 7 was &lt;strong&gt;without&lt;/strong&gt; transaction costs and that when these are included this 7 will drop down somewhere between 0 and 1.&lt;/p&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="55094" LastEditDate="2021-05-01T10:43:52.043" LastActivityDate="2021-05-01T10:43:52.043" CommentCount="9" ContentLicense="CC BY-SA 4.0" />
  <row Id="3888" PostTypeId="1" CreationDate="2012-08-01T17:48:08.770" Score="2" ViewCount="221" Body="&lt;p&gt;We want start using FpML within our organisation; where message will be sent using FpML. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;What are best practices to do this ?&lt;/li&gt;&#xA;&lt;li&gt;If anyone who have used Tools as well as; i want to use FpML for messaging as well as capturing trade details...&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2750" LastActivityDate="2012-08-01T17:48:08.770" Title="Looking for FpML best practices" Tags="&lt;programming&gt;&lt;fixed-income&gt;&lt;portfolio-management&gt;&lt;order-handling&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3891" PostTypeId="1" AcceptedAnswerId="3892" CreationDate="2012-08-02T13:30:30.880" Score="5" ViewCount="672" Body="&lt;p&gt;Is there any research on the equity return performance of hard-to-borrow securities?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many shops will simply screen for hard-to-borrow and eliminate these names from their short book. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anecdotally, it seems that these names have a tendency to rally on account of short-covering effects and future demand. I know there is research on 'short interest %' as a quant equity factor, but is there any research on the performance of hard-to-borrow securities?&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1106" LastEditDate="2012-08-02T15:35:46.530" LastActivityDate="2012-08-02T19:02:00.993" Title="What is the relative performance of hard-to-borrow securities?" Tags="&lt;equities&gt;&lt;research&gt;&lt;reference-request&gt;&lt;short-selling&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3892" PostTypeId="2" ParentId="3891" CreationDate="2012-08-02T16:45:45.497" Score="3" Body="&lt;p&gt;I think this paper (which I skimmed once a long time ago and no longer have access to) may provide some insight:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.joim.com/abstract.asp?IsArticleArchived=1&amp;amp;ArtID=308&quot; rel=&quot;nofollow&quot;&gt;Cohen, Lauren, Karl B. Diether, and Christopher J. Malloy. &quot;Shorting Demand and Predictability of Returns.&quot; Journal of Investment Management 7, no. 1 (2009): 36-52.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems to consider stock loan fees which may be a proxy for &quot;hard to borrow&quot;.&lt;/p&gt;&#xA;" OwnerUserId="915" LastEditorUserId="35" LastEditDate="2012-08-02T19:02:00.993" LastActivityDate="2012-08-02T19:02:00.993" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3894" PostTypeId="1" CreationDate="2012-08-03T10:50:57.530" Score="9" ViewCount="418" Body="&lt;p&gt;I'm trying to derive the valuation equation under a general stochastic volatility model.&#xA;What one can read in the literature is the following reasoning:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One considers a replicating self-financing portfolio $V$ with $\delta$ underlying and $\delta_1$ units of another derivative $V_1$. One writes Ito on one hand, and the self-financing equation on the other hand, and then one identifies the terms in front of the two Brownian motions and in front of $dt$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first two identifications give $\delta$ and $\delta_1$, and the last identification gives us a PDE in $V$ and $V_1$. Then what is commonly done is to write it with a left hand side depending on $V$ only, and a right hand side depending on $V_1$ only. So you get $f(V) = f(V_1)$. We could have chosen $V_2$ instead of $V_1$ so one gets $f(V) = f(V_1) = f(V_2)$. Thus $f(W)$ does not depend on the derivative $W$ one chooses, and is called the market price of the volatility risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I cannot understand in this reasoning is why $V$ does not depend on the derivative $V_1$ you choose to hedge the volatility risk in your portfolio with. As far as I see it, one should write $V(V_1)$ instead of $V$. Then one has $f(V(V_1)) = f(V_1)$ and $f(V(V_2)) = f(V_2)$ so one gets no unique market price of the volatility risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know why the price of a derivative does not depend on the derivative you choose to hedge against the volatility risk?&lt;/p&gt;&#xA;" OwnerUserId="2760" LastEditorUserId="1106" LastEditDate="2012-08-03T14:46:58.037" LastActivityDate="2018-04-08T03:23:14.070" Title="Why does the price of a derivative not depend on the derivative with which you hedge volatility risk?" Tags="&lt;volatility&gt;&lt;derivatives&gt;&lt;stochastic-calculus&gt;&lt;stochastic-volatility&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3895" PostTypeId="1" CreationDate="2012-08-03T06:53:49.523" Score="3" ViewCount="2623" Body="&lt;p&gt;I am looking for some tips on how to run a simple backtest on a pairtrading strategy intraday using eg. 30minute bars.&lt;/p&gt;&#xA;&lt;p&gt;I have calculated the spread, &lt;code&gt;beta(=ratio/hedgeweight)&lt;/code&gt;, and standard deviation.&lt;/p&gt;&#xA;&lt;p&gt;I tried treating the spread as a simple instrument which I buy and sell, but realised I cannot do it because the returns from eg. 0 to 0.2 becomes infinite. The spread crosses zero multiple times.&lt;/p&gt;&#xA;&lt;p&gt;I tried using the quantstrat package, but unfortunately it seems a bit complex and overkill at this point.&lt;/p&gt;&#xA;&lt;p&gt;After lots of looking around and trial and error I ran into the PairTrading package. This works great for daily data and especially with the included data. With intraday data it seems to have problems calculating the returns correctly. It calculates the returns for the legs independently but somewhere it goes wrong.&lt;/p&gt;&#xA;&lt;p&gt;What would be the easiest way to get the returns from a simple intraday pairtrading strategy?&lt;/p&gt;&#xA;&lt;p&gt;Here is some sample code I have where I try to use the PairTrading package.&lt;/p&gt;&#xA;&lt;h1&gt;Backtesting code below&lt;/h1&gt;&#xA;&lt;pre&gt;&lt;code&gt;sig &amp;lt;- ifelse(sprd &amp;lt; -2*standarddev, 1, NA)&#xA;sig &amp;lt;- ifelse(sprd &amp;gt; 2*standarddev, -1, sig)&#xA;sig &amp;lt;- na.locf(sig)&#xA;&#xA;&#xA;ret &amp;lt;- Return(pair, lag(sig), lag(beta))&#xA;ret &amp;lt;- (100 * cumprod(1 + ret))&#xA;plot(ret)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Unfortunately this doesnt give right results.&#xA;In the picture can be seen how the returns just continue up although spread still increases.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/lPgkK.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/p&gt;&#xA;" OwnerUserId="2867" OwnerDisplayName="nikke" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2012-08-03T12:26:48.147" Title="Backtest pair trade strategy in R" Tags="&lt;r&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3896" PostTypeId="1" CreationDate="2012-08-03T12:52:27.773" Score="4" ViewCount="220" Body="&lt;p&gt;Consider a stochastic volatility model. As there are two sources of risk and one asset only, this is an incomplete market. One can complete the market by considering a derivative V1 used to hedge the volatility risk. My question is: Do derivatives prices depends on the derivative V1 one chooses to complete the market? And if no, why?&lt;/p&gt;&#xA;" OwnerUserId="2760" LastEditorUserId="1418" LastEditDate="2012-08-14T18:29:08.013" LastActivityDate="2012-08-14T18:29:08.013" Title="market completion under stochastic volatility model" Tags="&lt;volatility&gt;&lt;market&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3899" PostTypeId="1" CreationDate="2012-08-04T09:04:27.980" Score="3" ViewCount="272" Body="&lt;p&gt;I am using a trend following strategy in the stock market. If you look at the price chart, you can tell one stock's trend is stronger than the other. Now I want to develop an index to calculate the 'strength' of the trend, is there any good method for this?&lt;/p&gt;&#xA;" OwnerUserId="2765" LastEditorUserId="16595" LastEditDate="2018-10-01T06:32:24.443" LastActivityDate="2018-10-01T06:32:24.443" Title="Is there any quantitative index to describe the strength of a 'trend'?" Tags="&lt;index&gt;&lt;trends&gt;" AnswerCount="0" CommentCount="4" ClosedDate="2012-08-07T14:20:44.627" ContentLicense="CC BY-SA 4.0" />
  <row Id="3900" PostTypeId="1" AcceptedAnswerId="3904" CreationDate="2012-08-04T15:26:15.457" Score="3" ViewCount="164" Body="&lt;p&gt;Say I have access to logs of all trades executed on an ECN with the price maker and taker named.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These traders are only executing some of their flow on this ECN (anywhere from 5%-80% of their volume). I do not have any information about their trades done elsewhere, so I can not say for sure what their positions are and therefore what their P&amp;amp;L is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I can still get an idea of who is buying low and selling high. Is there any standard approach or literature on how to analyze the profitability of an incomplete set of trades like this?&lt;/p&gt;&#xA;" OwnerUserId="2303" LastEditorUserId="2303" LastEditDate="2012-08-04T20:07:59.600" LastActivityDate="2012-08-06T06:32:52.367" Title="Analyzing an incomplete set of trades" Tags="&lt;trading&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3901" PostTypeId="1" AcceptedAnswerId="3902" CreationDate="2012-08-04T23:38:55.617" Score="6" ViewCount="1171" Body="&lt;p&gt;I was recently at a seminar by a top hedge fund manager at a top university for finance students, when one of the finance professors asked him what do you think are important areas of research for my PhD students. The hedge fund manager responded solve the &lt;a href=&quot;http://en.wikipedia.org/wiki/Riemann_hypothesis&quot; rel=&quot;nofollow&quot;&gt;Riemann hypothesis&lt;/a&gt;.  My question is, what would be the implications if this were proved true?&lt;/p&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="1652" LastEditDate="2012-08-24T13:59:36.970" LastActivityDate="2018-09-04T16:33:20.290" Title="Implications of the Riemann hypothesis in finance?" Tags="&lt;mathematics&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3902" PostTypeId="2" ParentId="3901" CreationDate="2012-08-05T02:56:46.367" Score="13" Body="&lt;p&gt;I think he was jokingly suggesting to breed top PhD candidates in pure mathematics. I often heard complaints that a lot of PhDs in Mathematical disciplines lack a rigorous base in pure Mathematics. Obviously the hedge fund manager was not suggesting that the proof of the hypothesis will be in any way relevant to trading or financial pricing applications. On the other side the Riemann Integral is a basic building block of discrete time stochastic calculus which is very much relevant to financial mathematics and pricing derivatives products. But I doubt he was at all thinking about the integral when he explicitly mentioned the hypothesis. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, I would chalk it up as a joke and invitation to send top level candidates his way. Its funny but hard core mathematicians learn to go all the way to the basics (or are supposed to) in order to devote their time to the studies and research of entirely abstract concepts. What they UN-learn is the ability to spot the underlying currents and humor. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My friend, I suggest you are reading way too much into his comments. I would take it as a suggestion to have the professor's students focus on the core of pure Math and that he is interested in top candidates. Not more not less. Thats my take of it. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-08-05T02:56:46.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3904" PostTypeId="2" ParentId="3900" CreationDate="2012-08-05T16:37:56.183" Score="2" Body="&lt;p&gt;There is no standard way in quant finance to do this. Nevertheless you can use:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;standard ways in statistics to deal with incomplete data sets;&lt;/li&gt;&#xA;&lt;li&gt;specific points to take into account that you are dealing with transactions.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The &lt;em&gt;standard statistical&lt;/em&gt; way to manage incomplete data is to use a Bayesian method: you model the usual cross-dependences between the variables and replace missing points by the max likely one (like in &lt;a href=&quot;http://biomet.oxfordjournals.org/content/63/3/581.short&quot; rel=&quot;nofollow&quot;&gt;Inference and missing data&#xA;by Donald B. Rubin&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can add some specific considerations like the fact that &lt;em&gt;short selling is probably not allowed&lt;/em&gt; (except if you are working on a market where it is possible). more generally, it means that you have to compute some characteristics of what you see from the strategies, like the PnL, the risk, the time to unwind positions, etc. You should do it a &lt;em&gt;sliding&lt;/em&gt; way (i.e. over a sliding window of few days / weeks), so that you would be able to detect some full sequences you have. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Practically&lt;/strong&gt;, it means that you need:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;to isolate some full sequences you have&lt;/li&gt;&#xA;&lt;li&gt;infer the joint distribution of all your variables&lt;/li&gt;&#xA;&lt;li&gt;use it to fill gaps that you will have identified in your dataset &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2012-08-06T06:32:52.367" LastActivityDate="2012-08-06T06:32:52.367" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3905" PostTypeId="2" ParentId="3848" CreationDate="2012-08-05T16:41:46.397" Score="7" Body="&lt;p&gt;The &lt;em&gt;Pagès-Wilbertz&lt;/em&gt; paper is a very good one. &#xA;To answer more directly to you underlying question that is: &quot;&lt;em&gt;in which quant finance area to use hardware acceleration?&lt;/em&gt;&quot;; the points to take into account are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;GPU is very good for parallel computations (already underlined in &lt;em&gt;remarks&lt;/em&gt;)&lt;/li&gt;&#xA;&lt;li&gt;but bad for memory sharing between the master software and the GPU-hosted library&lt;/li&gt;&#xA;&lt;li&gt;FPGA is good for parallel computations too (but harder to use compared to GPU)&lt;/li&gt;&#xA;&lt;li&gt;FPGA works well for working on data flows&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Consequently:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;if you need to solve numerically a PDE with few parameters (coefficients of the derivative terms): GPU is nice;&lt;/li&gt;&#xA;&lt;li&gt;if you need to compute on the flight analytics for high frequency trading: FPGA is nice.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2012-08-05T16:48:55.793" LastActivityDate="2012-08-05T16:48:55.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3906" PostTypeId="5" CreationDate="2012-08-05T17:16:41.490" Score="0" Body="&lt;p&gt;&lt;em&gt;Hardware programming&lt;/em&gt; is a term that refers to the design and configuration of FPGAs, ASICs, and other digital circuits. The process usually starts through a hardware description language.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This tag is limited to the applications of &lt;em&gt;hardware programming&lt;/em&gt; to quantitative finance.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="35" LastEditDate="2012-08-05T17:59:42.100" LastActivityDate="2012-08-05T17:59:42.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3907" PostTypeId="4" CreationDate="2012-08-05T17:16:41.490" Score="0" Body="Hardware programming is a term that refers to the design and configuration of FPGAs, ASICs, and other digital circuits. The process usually starts through a hardware description language." OwnerUserId="2299" LastEditorUserId="35" LastEditDate="2012-08-05T17:59:42.100" LastActivityDate="2012-08-05T17:59:42.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3909" PostTypeId="2" ParentId="3896" CreationDate="2012-08-06T15:56:48.750" Score="2" Body="&lt;p&gt;Of course. The whole point of pricing derivatives is that it is an interpolation exercise. Saying that the market is incomplete means there are not enough constraints to determine the price of all derivatives. It's a bit as if you had a polynomial of degree 2 but you gave only 2 points rather than 3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So yes, the price of your V1 will be vital because if you need to use it to hedge your position then for sure you need to know how much it costs...&lt;/p&gt;&#xA;" OwnerUserId="2599" LastActivityDate="2012-08-06T15:56:48.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3910" PostTypeId="1" CreationDate="2012-08-06T19:45:26.447" Score="1" ViewCount="232" Body="&lt;p&gt;I am creating classes out of 5.1 FPML specification but I get following error.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Group 'Events.model' from targetNamespace='http://www.fpml.org/FpML-5/confirmation'&#xA;has invalid definition: Circular group reference.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I get rid of this?&lt;/p&gt;&#xA;" OwnerUserId="2750" LastEditorUserId="848" LastEditDate="2012-08-07T10:02:23.043" LastActivityDate="2012-08-07T12:37:39.440" Title="FpML class generation gives error" Tags="&lt;programming&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3911" PostTypeId="2" ParentId="3894" CreationDate="2012-08-06T19:52:54.767" Score="3" Body="&lt;p&gt;Consider the following analogy: you can hedge a derivative in a deterministic-volatility model using either futures, or spot underlying.  The hedge ratio will change, but all the mathematics to effectively eliminate stochastic portfolio PL is the same, and must work out to be equivalent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A similar situation applies here: any triangle of (nontrivial) derivative securities can be shown to have an equivalent set of hedge ratios from any two of them (assumed observable, liquid etc) to form a price of the third.  Basically the hedge ratio for $V_2$ in terms of $V_1$ is perfectly symmetric to the one for $V_1$ in terms of $V_2$.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-08-06T19:52:54.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3913" PostTypeId="2" ParentId="3910" CreationDate="2012-08-07T08:28:02.803" Score="2" Body="&lt;p&gt;This is clearly StackOverflow question related to technical aspects of XSD. Please see  “&lt;a href=&quot;https://stackoverflow.com/questions/2388844/xsd-exe-and-circular-group-references&quot;&gt;XSD.exe and Circular Group references&lt;/a&gt;”, &lt;a href=&quot;https://stackoverflow.com/questions/4831116/removing-circular-group-references-from-xsd-schema-files&quot;&gt;&quot;removing circular group references from xsd schema file&quot;&lt;/a&gt; and &lt;a href=&quot;http://connect.microsoft.com/VisualStudio/feedback/details/637855/xsd-exe-fails-to-handle-circular-group-references&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;xsd.exe fails to handle circular group references&quot;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="370" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2012-08-07T08:28:02.803" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3914" PostTypeId="2" ParentId="3910" CreationDate="2012-08-07T12:37:39.440" Score="0" Body="&lt;p&gt;Are you using xds.exe to autogenerate the class for deserializing this fpml. In my project I tried the same and had this issue. In the end I wrote my own class from scratch for this. &#xA;a similar approach is mentioned &lt;a href=&quot;http://devio.wordpress.com/2012/05/22/dealing-with-circular-group-reference-errors-in-xsd-exe/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; and is worth looking at. Else if you post your sample FPML I can try to repro and give you a class definition in C# / C++.&lt;/p&gt;&#xA;" OwnerUserId="1386" LastActivityDate="2012-08-07T12:37:39.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3915" PostTypeId="1" AcceptedAnswerId="3926" CreationDate="2012-08-07T17:53:06.097" Score="13" ViewCount="743" Body="&lt;p&gt;After the Knight Capital incident, I decided to read into the new &lt;a href=&quot;http://www.nyse.com/nysenotices/nyse/rule-changes/detail;jsessionid=F6AB2E23D8C5CD5E83924962114D0B01?memo_id=12-19&quot;&gt;Rule 107C&lt;/a&gt; that NYSE pushed-out August 1st for a one-year pilot.  From what I've read, Knight claims that new code rolled out for this rule was the cause of Knight's system going haywire.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Today two ETF bond funds, &lt;a href=&quot;http://finance.yahoo.com/q?s=emcd&amp;amp;ql=1&quot;&gt;SPDR BofA Merrill Lynch Emerging Markets Corporate Bond ETF&lt;/a&gt;  and &lt;a href=&quot;http://finance.yahoo.com/q?s=vrd&amp;amp;ql=1&quot;&gt;SPDR Nuveen S&amp;amp;P VRDO Municipal Bond ETF&lt;/a&gt; were halted due to erratic trading.  There's not much detail about this right now, so whether this could be linked is purely speculative, probably just a fat finger trade with terrible timing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm no expert on the rules of the exchange, but it seems to me that the only relevant &quot;change&quot;  would be the following, taken from the NYSE site.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A &quot;Retail Price Improvement Order&quot; or &quot;RPI&quot; consists of non-displayed interest in Exchange-traded securities that is priced better than the best protected bid (&quot;PBB&quot;) or best protected offer (&quot;PBO&quot;), by at least $0.001 and that is identified as such. Exchange systems will monitor whether RPI buy or sell interest, adjusted by any offset and subject to the ceiling or floor price, is eligible to interact with incoming Retail Orders. An RPI remains non-displayed in its entirety. An RLP shall only enter and RPI for securities to which it is assigned as RLP. Member organizations other than RLPs are permitted, but not required, to submit RPIs. An RPI may be an odd lot, round lot, or PRL. (Rule 107C(a)(4))&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It follows that the only time a RPI is executed is if the market maker can beat the PBB or PBO by at least $.001.  I just don't see how this change could cause the erratic trading that occurred.  My understanding is Knight's loss was caused by having to unwind a massive position they accidentally took on, not by market making activities.  Any thoughts on this? Am I missing something obvious here (besides that bugs can have lots of unintended consequences)?&lt;/p&gt;&#xA;" OwnerUserId="2732" LastEditorUserId="35" LastEditDate="2012-08-07T18:58:20.520" LastActivityDate="2012-08-14T16:41:04.053" Title="How credible is Knight pointing the finger at Rule 107C?" Tags="&lt;high-frequency&gt;&lt;market-making&gt;" AnswerCount="2" CommentCount="7" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3917" PostTypeId="2" ParentId="3271" CreationDate="2012-08-08T07:15:51.303" Score="3" Body="&lt;p&gt;Bisection method is rather fast but it has only linear convergence. &lt;a href=&quot;http://en.wikipedia.org/wiki/Newton%27s_method&quot; rel=&quot;nofollow&quot;&gt;Newton's method&lt;/a&gt; offers quadratic convergence but it requires the knowledge of Vega (which AFAIK is only accessible numerically with binomial model). However, the convergence of Newton's method can suffer from poor initial approximation. In this case &lt;a href=&quot;http://en.wikipedia.org/wiki/Brent%27s_method&quot; rel=&quot;nofollow&quot;&gt;Brent's method&lt;/a&gt; tends to perform better. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally I found the following scheme quite useful: analytical closed-form solution result serves as an initial approximation for Newton's method and if it fails to converge (which is unlikely and pretty rare), Brent's method is used. &lt;/p&gt;&#xA;" OwnerUserId="2781" LastActivityDate="2012-08-08T07:15:51.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3918" PostTypeId="1" AcceptedAnswerId="3919" CreationDate="2012-08-08T08:10:51.437" Score="10" ViewCount="2367" Body="&lt;p&gt;What is called &quot;high frequency quoting&quot; or &quot;quote spam&quot; in the context of high frequency trading?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why do some people consider that as a problem for the market? &lt;/p&gt;&#xA;" OwnerUserId="1003" LastEditorUserId="2299" LastEditDate="2014-05-04T16:53:02.410" LastActivityDate="2015-12-30T06:25:41.217" Title="What is &quot;high frequency quoting&quot; or &quot;quote spam&quot;?" Tags="&lt;trading&gt;&lt;high-frequency&gt;&lt;market-microstructure&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3919" PostTypeId="2" ParentId="3918" CreationDate="2012-08-08T09:57:39.997" Score="12" Body="&lt;p&gt;&quot;&lt;em&gt;quote spam&lt;/em&gt;&quot;, &quot;&lt;em&gt;book colouring&lt;/em&gt;&quot;, &quot;&lt;em&gt;quote stuffing&lt;/em&gt;&quot;, etc encompass any mechanism to modify the shape of the orderbook by a market participant who does not intend to really buy or sell shares thanks to these orders.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It means that someone fills the bid side of the book with 10,000 shares at different levels of price and does not want to buy at all, or only 100 shares. Worst he may want to sell shares.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is not a good practice because the orderbooks are not only the live mechanism of the PFP (price formation process) but one of the only way to disseminate information on the PFP to all market participants. If you modify this information in a way that is not compliant with what you intend to do: your are misleading the market participants. You &lt;strong&gt;manipulate the price formation process&lt;/strong&gt;. &lt;a href=&quot;http://www.youtube.com/watch?v=jyaLZHiJJnE&quot;&gt;This is bad&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some links:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://online.wsj.com/article/SB10001424052748704358904575477921338633984.html&quot;&gt;SEC in WSJ&lt;/a&gt;, SEC at Reuters (with examples or regulations)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1958281&quot;&gt;Quote Stuffing, an SSRN paper by Jared F. Egginton, Bonnie F. Van Ness and Robert A. Van Ness&lt;/a&gt; &lt;/li&gt;&#xA;&lt;li&gt;about &lt;a href=&quot;http://www.efinancialnews.com/story/2012-05-07/europe-trading-regulation-criminalise&quot;&gt;European regulation on this topic&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;more recently Joel HASBROUCK has made this talk &lt;a href=&quot;http://market-microstructure.institutlouisbachelier.org/Uploads/42_1-%20HFQ03_OK.pptx&quot;&gt;High Frequency Quoting&lt;/a&gt; at the &lt;a href=&quot;http://market-microstructure.institutlouisbachelier.org&quot;&gt;Market Micrstructure Conf in Dec 2012&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2013-08-26T12:01:30.520" LastActivityDate="2013-08-26T12:01:30.520" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3920" PostTypeId="5" CreationDate="2012-08-08T12:28:06.703" Score="0" Body="&lt;p&gt;Numerical computations widely used in quantitative finance can be harassing for standard servers and CPUs. Hence it is natural to consider to use dedicated hardware. The names that come often that for are &quot;FPGA&quot; and &quot;GPU&quot;. Here are some first simple facts about these two kind of hardware:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;GPU is very good for parallel computations (already underlined in &lt;em&gt;remarks&lt;/em&gt;)&lt;/li&gt;&#xA;&lt;li&gt;but bad for memory sharing between the master software and the GPU-hosted library&lt;/li&gt;&#xA;&lt;li&gt;FPGA is good for parallel computations too (but harder to use compared to GPU)&lt;/li&gt;&#xA;&lt;li&gt;FPGA works well for working on data flows&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Consequently:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;if you need to solve numerically a PDE with few parameters (coefficients of the derivative terms) or to run intense Monte Carlo simulations: GPU is nice;&lt;/li&gt;&#xA;&lt;li&gt;if you need to compute on the flight analytics for high frequency trading: FPGA is nice.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For DPE solving using GPU, one must carefully think about how to parallelize such computations; this is not a straightforward question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More information:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://people.maths.ox.ac.uk/gilesm/talks/pp10_key.pdf&quot; rel=&quot;nofollow&quot;&gt;Computational ﬁnance on GPUs, slides by Mike Giles&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2012-08-08T12:49:43.527" LastActivityDate="2012-08-08T12:49:43.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3921" PostTypeId="4" CreationDate="2012-08-08T12:28:06.703" Score="0" Body="Numerical computations widely used in quantitative finance can be harassing for standard servers and CPUs. Hence it is natural to consider to use dedicated hardware. The names that come often that for are &quot;FPGA&quot; and &quot;GPU&quot;." OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2012-08-08T12:49:42.900" LastActivityDate="2012-08-08T12:49:42.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3922" PostTypeId="1" CreationDate="2012-08-08T12:30:54.267" Score="9" ViewCount="6254" Body="&lt;p&gt;I'm trying to think on a way to normalize stocks to be on the same scale depending on their recent volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some theoretical reference on the subject or and experience you can share?&lt;/p&gt;&#xA;" OwnerUserId="1463" LastEditorUserId="35" LastEditDate="2012-08-08T12:54:42.100" LastActivityDate="2019-10-24T08:15:23.673" Title="How to normalize different instruments by volatility?" Tags="&lt;volatility&gt;&lt;equities&gt;" AnswerCount="4" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3923" PostTypeId="2" ParentId="3580" CreationDate="2012-08-08T13:24:01.763" Score="7" Body="&lt;p&gt;&lt;a href=&quot;http://nanex.net/nxcore.html&quot;&gt;Nanex NxCore&lt;/a&gt; will give you a full market view of the options market. The feed is full market, meaning you won't subscribe to specific options or stocks, so it may or may not fit your &quot;prioritization&quot; requirement. You can subscribe to events for specific symbols, however, once the data has reached your local NxCore application.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The data is not sampled so you get event by event and the API is C based, but they might have a C++ wrapper, I'm not sure. The code is quite clean and easy to use.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastEditorUserId="35" LastEditDate="2012-08-08T14:48:08.637" LastActivityDate="2012-08-08T14:48:08.637" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3924" PostTypeId="2" ParentId="3922" CreationDate="2012-08-08T17:29:33.123" Score="3" Body="&lt;p&gt;With a simple diffusion model (i.e. $dX_i=X_i \cdot (r_i \,dt+\sigma_i dW_i)$ for $i\in\{1,2\}$), you would probably want to normalize the returns (i.e. $dX_i$) and not the levels (i.e. $X_i=\int_t dX_i(t)$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most natural way to do it is to assume that the trends are structurally nulls (i.e. $r_i=0$ for all $i$) and just divide each return by an empirical estimate of $\sigma_i$, replacing $dX_i/X_i$ by $d{\tilde X}_i=dX_i/(X_i \sigma_i)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Renormalization&lt;/strong&gt; can be seen as a rescaling on each variable you consider (as I proposed), but also a multi-dimensional way.&#xA;You can operate sophisticated changes of measure or of coordinates, to obtain two stochastic processes $Y_1$ and $Y_2$ that are more homogeneous and related to the original $X_1$ and $X_2$. It is a way to &lt;em&gt;renormalize&lt;/em&gt; in the sense that your $Y$s will contain essential components of the $X$s that are easier to compare. But what would mean observe some relationships between these two $Y$ and your original $X$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, just imagine that you try a PCA (Principal Component Analysis) on the de-trended parts of the returns (i.e. in the $(dX_1/X_1-r_1\,dt,dX_2/X_2-r_2\,dt)$ space). You will find a change of coordinate in the space of $(\sigma_1\, dW_1,\sigma_2\, dW_2)$ so that in this new space, the two processes are more &lt;em&gt;orthogonal&lt;/em&gt; (in the L2 statistical sense in the increment space, i.e. independents in the space of the returns). It will be one step further than dividing each $dX_i/X_i-r_i\,dt$ by $\sigma_i$: the new $d{\tilde W}_i$ will now be &lt;em&gt;independent&lt;/em&gt;. Of course it is an interesting property, but each time you will observe them, you will also have to go back in the original space and understand what it means. Namely you will have:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;to understand the meaning of the new components, analyzing the contribution of each $X_i$ (via its returns) to each of them;&lt;/li&gt;&#xA;&lt;li&gt;to monitor how the original $X_i$ are decomposed in a linear combination of ${\tilde W}_i$ through time.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For only two original instrument; is it worthwhile? Of course if you have 100 of them, it would be interesting.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2012-08-23T05:51:51.100" LastActivityDate="2012-08-23T05:51:51.100" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3925" PostTypeId="2" ParentId="3184" CreationDate="2012-08-08T17:37:56.150" Score="1" Body="&lt;p&gt;Based on the conditions you set forth this would be relatively simple in the CQG API. You can, for example, set up condition triggers in the IC. All you're really asking is for an API action following one of the triggers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pseudo code would be something like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Handles event trigger: &lt;br&gt;&#xA;If (additional conditions) then &lt;br&gt;&#xA;execute trade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are you just shopping for an API?&lt;/p&gt;&#xA;" OwnerUserId="2782" LastActivityDate="2012-08-08T17:37:56.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3926" PostTypeId="2" ParentId="3915" CreationDate="2012-08-08T22:03:50.673" Score="12" Body="&lt;p&gt;The best explanation/theory that I have heard about Knight's erratic trading was put forth by &lt;a href=&quot;http://www.nanex.net/aqck2/3525.html&quot; rel=&quot;noreferrer&quot;&gt;Nanex&lt;/a&gt;. I have pasted their summary of findings below.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;We believe Knight accidentally released the test software they used to verify that their new market making software functioned properly, into NYSE's live system.&lt;/p&gt;&#xA;&lt;p&gt;In the safety of Knight's test laboratory, this test software (we'll call it, the Tester) sends patterns of buy and sell orders to its new Retail Liquidity Provider (RLP) Market Making software, and the resulting mock executions are recorded. This is how they could ensure their new market making software worked properly before deploying to the NYSE live system.&lt;/p&gt;&#xA;&lt;p&gt;When the time comes to deploy the new market making software, which is likely handled by a different group, the Tester is accidentally included in the release package and started on NYSE's live system. On the morning of August 1st, the Tester is ready to do its job: test market making software. Except this time it's no longer in the lab, it's running on NYSE's live system. And it's about to test any market making software running, not just Knights. With real orders and real dollars. And it won't tell anyone about it, because that's not its function.&lt;/p&gt;&#xA;&lt;p&gt;For stocks where Knight is the only one running market making software as a RLP, and the Tester is the only algo trading that's crossing the bid/ask spread, then we'll see consistent buy and sell patterns of trade executions, all marked regular, and all from the NYSE, and all occurring at prices just above the bid or just below the ask. Examples include EXC and NOK and you can see these patterns in charts &lt;a href=&quot;http://www.nanex.net/aqck2/3522.html&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;. The Tester is functioning just as it did in the lab, and Knight's market making software is intercepting these orders and executing them. Knight won't lose any money on these trades, but they will be generating a lot of wash sales.&lt;/p&gt;&#xA;&lt;p&gt;For stocks where Knight is not the only market maker, or when there are other algos actively trading (and crossing the bid/ask spread), then some, or all of the orders sent by the Tester will be executed by someone other than Knight, and Knight will now have a position in the stock. Meaning it could be making or losing money. The patterns generated for these stocks will depend greatly on the activity of the other players.&lt;/p&gt;&#xA;&lt;p&gt;Because the Tester indiscriminately buys at the ask and sells at the bid, and because the bid/ask spreads are very wide during the open, we now understand why many stocks moved violently at that time. The Tester was simply hitting the bid or offer, and the side it hit first, determined whether the stock opened sharply up or down.&lt;/p&gt;&#xA;&lt;p&gt;Since the Tester doesn't think it's dealing with real dollars, it doesn't have to keep track of its net position. It's job is to send buy and sell orders in test pattern waves. This explains why Knight didn't know right away that it was losing a lot of money. They didn't even know the Tester was running. When they realized they had a problem, the first likely suspect would be the new market making software. We think the two periods of time when there was a sudden drop in trading (9:48 and 9:52) are when they restarted the system. Once it came back, the Tester, being part of the package, fired up too and proceeded to continue testing. Finally, just moments before an economic news release at 10am, someone found and killed the Tester.&lt;/p&gt;&#xA;&lt;p&gt;We can fully appreciate the nightmare their team must have experienced that morning.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="508" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2012-08-08T22:13:04.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3928" PostTypeId="1" CreationDate="2012-08-09T08:43:18.683" Score="2" ViewCount="246" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Possible Duplicate:&lt;/strong&gt;&lt;br&gt;&#xA;  &lt;a href=&quot;https://quant.stackexchange.com/questions/1891/how-much-data-is-needed-to-validate-a-short-horizon-trading-strategy&quot;&gt;How much data is needed to validate a short-horizon trading strategy?&lt;/a&gt;  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&#xA;&#xA;&lt;p&gt;How far back do people usually backtest trading systems? months? years?&lt;/p&gt;&#xA;" OwnerUserId="2777" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2012-08-09T09:20:05.997" Title="How far back is normal to backtest an ATS ?" Tags="&lt;automated-trading&gt;&lt;backtesting&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2012-08-09T11:20:33.523" ContentLicense="CC BY-SA 3.0" />
  <row Id="3929" PostTypeId="2" ParentId="3928" CreationDate="2012-08-09T09:20:05.997" Score="0" Body="&lt;p&gt;I think this question has been asked before, but it's not about time-frames per se, but about having enough results to satisfy whatever statistical criteria you have decided to adopt.&lt;/p&gt;&#xA;" OwnerUserId="1397" LastActivityDate="2012-08-09T09:20:05.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3930" PostTypeId="1" CreationDate="2012-08-09T13:44:22.107" Score="11" ViewCount="2838" Body="&lt;p&gt;Is there any simple way to simulate cointegrated prices?&lt;/p&gt;&#xA;" OwnerUserId="2784" LastEditorUserId="848" LastEditDate="2012-08-09T14:28:20.263" LastActivityDate="2020-04-13T09:48:26.120" Title="How to simulate cointegrated prices" Tags="&lt;time-series&gt;&lt;simulations&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3931" PostTypeId="1" AcceptedAnswerId="3944" CreationDate="2012-08-09T18:02:46.560" Score="6" ViewCount="855" Body="&lt;p&gt;I've read the FAQ and I know that this question may be considered off-topic by the standards set forth but I think a topic such as this is a valid exception. Questions like this one have been permitted on various StackExchanges before, despite &quot;not a real question.&quot; Opinions and &quot;answers&quot; can be useful to both novices and professionals alike and it's absolutely possible that somebody &quot;earning a living at this&quot; could benefit from the perspective of others in this regard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I apologize if this reads like a resume. I'm interested in quantitative finance and data-driven market decision and would like to position myself for a future career in that field.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a BS in Physics and Statistics&lt;br&gt;&#xA;I am soon to complete an MS Finance&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been developing enterprise software for almost ten years. In my current position I develop analytics and portfolio management software for the alternatives space. I enjoy the work and am doing quite well here. I have no intention of leaving in the short term, but after a few more years as I expand my education and expertise the company may sell or relocate... you never know.&#xA;I also have a small amount of market experience as an independent commodities trader using basic technical analysis (I was financially successful enough where I didn't think more exotic approaches were necessary at that time).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What do you recommend to prepare or in general to develop individual craftsmanship? &lt;br&gt;&lt;/strong&gt;&#xA;Should a PhD be considered? If so, what mastery? &lt;br&gt;&#xA;Should additional certifications be obtained? Which ones? &lt;br&gt;&#xA;Are there any targeted training courses or literature to familiarize?&lt;/p&gt;&#xA;" OwnerUserId="2782" LastEditorUserId="1368" LastEditDate="2012-08-09T18:44:53.097" LastActivityDate="2012-08-13T03:09:07.510" Title="How to develop journeymanship and mastery in the field Quantitative Finance?" Tags="&lt;soft-question&gt;&lt;career&gt;&lt;research&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3932" PostTypeId="2" ParentId="3930" CreationDate="2012-08-09T20:29:30.563" Score="7" Body="&lt;p&gt;One way to construct cointegrated timeseries it to use the error-correction representation (see &lt;a href=&quot;http://www.jstor.org/discover/10.2307/1913236?uid=3739576&amp;amp;uid=2&amp;amp;uid=4&amp;amp;uid=3739256&amp;amp;sid=21100972215273&quot; rel=&quot;noreferrer&quot;&gt;Engle, Granger 1987&lt;/a&gt; for details of the equivalence).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To generate two timeseries that are cointegrated, start with your cointegrating vector $(\alpha_1, \alpha_2)$ so that you want $\alpha_1x_t + \alpha_2y_t$ to be stationary; choose initial values $x_0, y_0$ and a parameter $\gamma\in (0,1)$ that controls how strongly cointegrated the series are.  Then generate each timestep as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$x_{t+1} = x_t - \gamma  (x_t + (\alpha_2/\alpha_1)y_t) + \epsilon_{1t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$y_{t+1} = y_t - \gamma  (y_t + (\alpha_1/\alpha_2)x_t) + \epsilon_{2t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For price series, it's generally the cumulative returns that you want to be cointegrated.  To generate prices, as John mentioned in his comment above, follow the above procedure for log-prices, then exponentiate.&lt;/p&gt;&#xA;" OwnerUserId="2027" LastActivityDate="2012-08-09T20:29:30.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3933" PostTypeId="2" ParentId="3930" CreationDate="2012-08-09T20:30:22.777" Score="9" Body="&lt;p&gt;Consider a $T \times N$ matrix of potentially cointegrating prices $P$. Define $Y_{t}\equiv ln\left(P_{t}\right)$. In the multivariate framework, there are two basic methods to estimate the cointegrating relationships. The first is an error correction framework of the form&#xA;$$\Delta Y_{t}	=	\beta_{0}+\beta_{1}\Delta Y_{t-1}+\beta_{2}Y_{t-1}+\varepsilon_{t}$$&#xA; that is most convenient when attempting to perform statistical tests on the coefficients. The alternate approach is a vector autoregressive model of the form &#xA;$$Y_{t}	=	\beta_{0}+\beta_{1}Y_{t-1}+\varepsilon_{t}.$$&#xA;For the purposes of simulation, they are effectively equivalent. One must estimate $\beta_{0}$ and $\beta_{1}$ and solve for $\varepsilon_{t}$. There are many potential distribution assumptions that one could make about the behavior of $\varepsilon_{t}$, but a simple one would be that it follows a multivariate normal distribution with a mean of zero and a covariance matrix equal to the sample covariance matrix. More complicated assumptions might be that the variances and correlations are time-varying or that there are fat tails. For financial time series, these may be important to consider. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To simulate $\widetilde{Y}_{t+1}$, you thus obtain $\widetilde{\varepsilon}_{t+1}$ by whatever means are appropriate and calculate &#xA;$$\widetilde{Y}_{t+1}	=	\beta_{0}+\beta_{1}Y_{t}+\widetilde{\varepsilon}_{t+1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For $i&amp;gt;1$, one would need to be careful to incorporate the simulated values from the previous period so that&#xA;$$\widetilde{Y}_{t+i}	=	\beta_{0}+\beta_{1}\widetilde{Y}_{t+i-1}+\widetilde{\varepsilon}_{t+i}$$ in order to ensure the autoregressive features in each simulated path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After calculating the simulated values of $\widetilde{Y}_{t+i}$, one would want to convert them back to prices by calculating $\widetilde{P}_{t+i}\equiv \mathrm{exp}\left(\widetilde{Y}_{t+i}\right)$.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastEditorUserId="848" LastEditDate="2012-08-10T05:04:50.637" LastActivityDate="2012-08-10T05:04:50.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3934" PostTypeId="1" AcceptedAnswerId="3938" CreationDate="2012-08-10T04:56:14.380" Score="21" ViewCount="14147" Body="&lt;p&gt;I would like to optimize a portfolio allocation (maximizing the exposure or the expected return), but with VaR or CVaR contraints. (some parts of my portfolio cannot exceed a certain VaR)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I achieve that? Is there a way to turn the problem into a linear programming problem? or to approximate the results?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any links or ideas are welcome.&lt;/p&gt;&#xA;" OwnerUserId="134" LastEditorUserId="41390" LastEditDate="2020-10-21T12:32:34.433" LastActivityDate="2020-10-21T12:32:34.433" Title="Portfolio optimisation with VaR or CVaR constraints using linear programming" Tags="&lt;portfolio-management&gt;&lt;portfolio-optimization&gt;&lt;optimization&gt;&lt;var&gt;" AnswerCount="5" CommentCount="2" FavoriteCount="17" ContentLicense="CC BY-SA 4.0" />
  <row Id="3935" PostTypeId="2" ParentId="3934" CreationDate="2012-08-10T12:15:25.950" Score="4" Body="&lt;p&gt;I think what you're looking for is a type of solver called a second-order cone program (&lt;a href=&quot;http://en.wikipedia.org/wiki/Second-order_cone_programming&quot; rel=&quot;nofollow&quot;&gt;SOCP&lt;/a&gt;) solver.  This is just like a quadratic program (QP) solver, except the constraints can be quadratic as well as the objective function.  There is an open-source implementation in python via the &lt;a href=&quot;http://abel.ee.ucla.edu/cvxopt/userguide/coneprog.html#second-order-cone-programming&quot; rel=&quot;nofollow&quot;&gt;CVXOPT&lt;/a&gt; module.&lt;/p&gt;&#xA;" OwnerUserId="2027" LastEditorUserId="2027" LastEditDate="2013-01-13T13:29:54.133" LastActivityDate="2013-01-13T13:29:54.133" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3936" PostTypeId="2" ParentId="3934" CreationDate="2012-08-10T12:39:43.580" Score="3" Body="&lt;p&gt;You could define your optimization problem as a typical linear risk/return optimization problem(1), then use some predicted return as the return component and VaR or cVaR as the risk component. This will not be linear, however you can use an evolutionary algorithm, or some other exotic search algorithm, to maximize for return given a limit on VaR or cVar. The tricky part is to make a good utility/fitness function, i.e., a smooth one. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In essence what you will be doing is to generate a bunch of random feasible portfolios, making sure to throwing out any that have too large of a VaR. The remaining feasible portfolios are ranked based on the utility/fitness function. Keep some of the best once (survival of the fittest) and based on these make small random alterations to the portfolios (mutations). Then re-rank the portfolios. Redo this for several generations. Eventually you should be optimizing based on VaR. There are many tools and frameworks that can do this for you. I used Encog last time I did something like it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(1) Utility(portfolio) = PredictedReturn(portoflio) - VaR(portoflio)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2792" LastActivityDate="2012-08-10T12:39:43.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3937" PostTypeId="2" ParentId="3934" CreationDate="2012-08-10T13:20:53.173" Score="4" Body="&lt;p&gt;You can find a good example on CVaR optimization in the book &quot;&lt;a href=&quot;https://www.rmetrics.org/ebooks-portfolio&quot; rel=&quot;nofollow&quot;&gt;Portfolio Optimization with R/Rmetrics&lt;/a&gt;&quot; By Diethelm Wuertz, Yohan Chalabi, William Chen, Andrew Ellis.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#load library fPortfolio&#xA;library(fPortfolio)&#xA;&#xA;#use indicies LPP2005, see http://www.pictet.com/en/home/lpp_indices.html&#xA;lppData  &amp;lt;-  100*LPP2005.RET[,1:6]&#xA;&#xA;#create portfolio specification&#xA;frontierSpec  &amp;lt;- portfolioSpec();&#xA;&#xA;#optimization criteria - CVaR&#xA;setType(frontierSpec)  &amp;lt;- &quot;CVAR&quot;&#xA;&#xA;#set optimization algorithm&#xA;setSolver(frontierSpec)  &amp;lt;- &quot;solveRglpk&quot;&#xA;&#xA;#set confidence level CVaR&#xA;setAlpha(frontierSpec)  &amp;lt;- 0.05&#xA;&#xA;#number of portfolios in efficient frontier&#xA;setNFrontierPoints(frontierSpec)  &amp;lt;- 25&#xA;&#xA;#optimize, without shortselling&#xA;frontier &amp;lt;- portfolioFrontier(data = lppData, spec = frontierSpec, constraints=&quot;LongOnly&quot;);&#xA;&#xA;#build efficient frontier graph&#xA;tailoredFrontierPlot(object=frontier,mText=&quot;Mean-CVaR Frontier (Long only)&quot;,risk=&quot;CVaR&quot;);&#xA;weightedReturnsPlot(frontier)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't recommend you to use VaR optimization for two reasons:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;VaR is not a subbaditive risk measure, therefore your portfolio could be highly&#xA;undiversified. &lt;/li&gt;&#xA;&lt;li&gt;It's more challenging computationally than CVaR&#xA;    optimization &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="370" LastEditorUserId="1587" LastEditDate="2012-08-15T00:42:10.583" LastActivityDate="2012-08-15T00:42:10.583" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3938" PostTypeId="2" ParentId="3934" CreationDate="2012-08-10T14:53:36.410" Score="11" Body="&lt;p&gt;In my experience, a VaR or CVaR portfolio optimization problem is usually best specified as minimizing the VaR or CVaR and then using a constraint for the expected return. As noted by Alexey, it is much better to use CVaR than VaR. The main benefit of a CVaR optimization is that it can be implemented as a linear programming problem. Another option I have tried is the technique in this paper: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.math.uwaterloo.ca/~tfcolema/articles/bank_article.pdf&quot;&gt;http://www.math.uwaterloo.ca/~tfcolema/articles/bank_article.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another option is the two-step heuristic where one first finds the mean-variance efficient frontier and then you could calculate whatever are the relevant portfolio statistics on only the mean-variance efficient portfolios. In this way you could exclude portfolios that have too high a VaR or CVaR (or mixed CVaR deviation) for your consideration. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, as you say you are particularly concerned about the VaR or CVaR of certain parts of your portfolio. As noted above, VaR constraints for different different groups of assets would require non-linear constraints. However, CVaR constraints for different assets could be calculated using linear constraints (though it would also be possible to implement a relatively slower methodology using non-linear constraints). For guidance on how to implement this as a linear constraint, it might help to follow&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.soa.org/library/proceedings/arch/2008/arch-2008-iss1-cox-lin.aspx&quot;&gt;http://www.soa.org/library/proceedings/arch/2008/arch-2008-iss1-cox-lin.aspx&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with the only difference that you would want to calculate the CVaR over the relevant groups of securities.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2012-08-10T14:53:36.410" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3939" PostTypeId="2" ParentId="3934" CreationDate="2012-08-10T14:54:15.623" Score="8" Body="&lt;p&gt;The VaR constraint is convex and quadratic and can be handled with any solver supports quadratic constraints, like &lt;a href=&quot;http://www.gurobi.com&quot;&gt;Guribi&lt;/a&gt;,  &lt;a href=&quot;http://www-01.ibm.com/software/integration/optimization/cplex-optimizer/&quot;&gt;cplex&lt;/a&gt; (from IBM) or &lt;a href=&quot;http://www.fico.com/en/Products/DMTools/xpress-overview/Pages/Xpress-Optimizer.aspx&quot;&gt;xpress&lt;/a&gt; (from FICO).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The CVaR can be formulated as a &lt;a href=&quot;http://www.ise.ufl.edu/uryasev/files/2011/11/VaR_vs_CVaR_INFORMS.pdf&quot;&gt;linear program&lt;/a&gt; if you are able to perform monte-carlo simulations on the returns.  Briefly, the LP model is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray*}&#xA;c &amp;amp;\ge&amp;amp; \alpha + {1 \over (1-\beta)|J|} \sum_{j\in J} z_j \\&#xA;z_j &amp;amp;\ge&amp;amp;  \sum_{i \in I} r_{ij} x_i - \alpha  \hspace{0.2in} \forall j \in J&#xA;\end{eqnarray*}&#xA;Where c is the cvar at $\beta$ confidence, $I$ is the set of investments, $x_i$ is the level of investment in $i$, $J$ is the set of monte-carlo scenarios, $r_{ij}$ is the unexpected loss of investment $i$ in simulation $j$.  $\alpha$ is the loss of the $100 \cdot \beta$ percentile scenario, and ${1 \over (1-\beta)|J|} \sum_j z_j$ is the average unexpected loss (in excess of alpha) of the worst $(1-\beta)|J|$ scenarios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The resulting LP instances are very dense and large, so it requires delayed column and constraint generation for non-trivial problems.&lt;/p&gt;&#xA;" OwnerUserId="1418" LastEditorUserId="1418" LastEditDate="2012-08-15T18:01:48.827" LastActivityDate="2012-08-15T18:01:48.827" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3941" PostTypeId="1" AcceptedAnswerId="3945" CreationDate="2012-08-12T11:56:12.313" Score="1" ViewCount="836" Body="&lt;p&gt;Damodaran's historical data on 10-year T-note returns (&lt;a href=&quot;http://www.stern.nyu.edu/~adamodar/pc/datasets/histretSP.xls&quot; rel=&quot;nofollow&quot;&gt;found here&lt;/a&gt;) uses the following formula to calculate the 1-period total return on a T-note ($R_1$) given the 10-year constant maturity yield-to-maturity in the prior year ($Y_0$) and the current year ($Y_1$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$R_1=(Y_0*\frac{1-(1+Y_1)^{-10}}{Y_1}+\frac{1}{(1+Y_1)^{10}})-1+Y_0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where can I find a derivation or description of this formula? It seems very odd to me that the only two data points I would need to calculate the total return to a T-note are the beginning and ending yield-to-maturities.&lt;/p&gt;&#xA;" OwnerUserId="2119" LastActivityDate="2014-01-09T02:22:20.047" Title="T-note returns from T-note yields ... derivation of Damodaran's formula" Tags="&lt;fixed-income&gt;&lt;returns&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3943" PostTypeId="2" ParentId="3922" CreationDate="2012-08-13T02:38:12.417" Score="0" Body="&lt;p&gt;May I recommend you first think what you try to achieve. As with almost anything in life there is no single answer. So, let me go ahead with an assumption and attempt to answer your question under given assumption. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The assumption is that you attempt to rank stocks and their price levels/return levels in comparison to other stocks. But just to be safe I consider you also want to just look at a single time series and observe how the volatility price levels/ returns evolved:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With that in mind I disagree with Lehalle in that it is preferable to scale price returns by return volatility. Quite a number quants scale price levels by price volatility. Mathematically such approach is in no way sub optimal. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is also very important is whether you look at daily volatility measures or intraday volatility measures. Depending on such you will need to look into completely different ways to compute and scale volatility. Computational models for intraday measures include Garman Klass, DU, Symmetry measures, open/close, among others. Here are couple references I personally like regarding intraday volatility measures:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.hedgeworld.com/research/download/Efficient_Estimation.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.hedgeworld.com/research/download/Efficient_Estimation.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://erasmus-mundus.univ-paris1.fr/fichiers_etudiants/3963_dissertation.pdf&quot; rel=&quot;nofollow&quot;&gt;http://erasmus-mundus.univ-paris1.fr/fichiers_etudiants/3963_dissertation.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are some (in my humble opinion) excellent theoretical references for volatility measures in general, as requested:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://arxiv.org/pdf/cond-mat/0202527.pdf&quot; rel=&quot;nofollow&quot;&gt;http://arxiv.org/pdf/cond-mat/0202527.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://polymer.bu.edu/hes/articles/ymhbs05.pdf&quot; rel=&quot;nofollow&quot;&gt;http://polymer.bu.edu/hes/articles/ymhbs05.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.nobid.com/mta/newsletter.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.nobid.com/mta/newsletter.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And here my personal experience: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all, with so many different approaches to measuring volatility out there I do not believe that one measure is always better than the other. My personal experience as market practitioner is that its much more important to look at the dynamics of a single measure over time rather than comparing absolute levels between different vol measures. For example, I could not care less whether the historical (or even implied for this particular matter) vol levels of a given stock are annualized 30% or 80%. What I care much more about is how they compare relative to levels at other times in the history of this particular stock's time series. So, imho, it is completely irrelevant whether Garman Klass intrday vol gives you a daily vol of 2.00% and another mesure 1.80%. I highly recommend you do some reading of posted references (or whatever readings you find helpful), settle on a measure and go with it and start digging into the dynamics of how such volatility measures evolved during different market cycles. I do not want to digress too much into what particular measures I am using and what exactly I am looking at but I hope this helps to get you started and to not get bogged down by the sheer number of different approaches to measuring volatility. Even on the intraday volatility modeling side of whole implied vol surfaces there are at least 5-6 different core approaches used out there and I know some excellent index vol traders who use completely different approaches and each of those buddies generate excellent risk adjusted returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an aside, I do admit that Garman Klass, for instance, highlights slightly different aspects of intraday volatility than looking at a different measure. Just look at the formulae and it should become apparent whether the open, high, low, or close is weighted more heavily vs. others. Again it comes down to what you exactly want to achieve. However, its a small aside, and generally I re-iterate that the different levels are less important than the dynamics over time. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2012-08-14T01:49:08.227" LastActivityDate="2012-08-14T01:49:08.227" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="3944" PostTypeId="2" ParentId="3931" CreationDate="2012-08-13T03:09:07.510" Score="4" Body="&lt;p&gt;&quot;Individual Craftsmanship&quot;...I am not sure how you want to apply this skill set later. Craftsman to me means someone who simply applies a tool set, it does not imply (according to the dictionary definition) whether professionally to earn money or in order to teach or treat it as a personal hobby. So please let me comment on all three:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Professionally in the financial industry:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While academic achievements can greatly help to get the foot in the door, it could not matter less whether you got a PhD or finished high school in the day-to-day business. I have seen excellent traders who were made MD when they were 25-26 years old. True wizards in the craft of generating excellent risk-adjusted returns rather than just people swinging for the fences. If you have an inclination to high level math and want to get into modeling and pricing exotic derivatives I would rather hire a kid who learned it all by himself than a mid 30s who had to go through his BS, MS, and PhD math program to achieve the same level. I think most on the street would concur with this opinion. As long as you got the tools and skills how you acquired such skills does not matter in the slightest. I often times come across extremely &quot;academically arrogant&quot; people who interview for a job. Most always arrogance masks other weaknesses and I prefer to spend the time during the interview to dig deeper into such weaknesses than having to listen to rehearsed derivations of Black-Scholes or the HW model. Having said that, given you are looking to acquire a quant finance skill set, and you finish your MS I would probably need to know of what quality your MS program was. To give you an example: If you did the MSCF program at Carnegie Mellon I would consider that as a stamp of approval (not because of the school name but just because the program is excellent) to sit you at a derivatives desk given all your other credentials match up. A generalized MS program where you have done very little to no programming, stochastic calculus and derivatives pricing would make me much more cautious. So it depends again what you actually know not the school you went to. If you believe your MS cannot land you at a tier one investment bank (regardless of where you actually want to work) then I would consider applying for a top PhD program given you have a passion for a particular subject matter that you could imagine spending 2-3 years on intensively researching. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Teaching:&#xA;Well, simple, go straight for the PhD program. Not much else to say.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hobby: &#xA;If you believe a PhD program gives you more (maybe because of available resources, grants, professors, peers) than just learning on your own then go for the PhD program. Otherwise there are endless ways to further your skill set in quant finance, you could pick up/improve your C++ skill set and writing pricers or applicable algorithms yourself which you could potentially monetize later. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helped. Sorry I can speak most about the professional track because I worked for 13 years in this field and also underwent an MS program (wont comment on the specific one but it was a door opener plus really pushed me to the limits and actually beyond in what I ever imagined I was capable of doing). I enjoy practicing my skills and being measured competitively vs other traders by the PnL I generate rather than trying to impress others with geek talk. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-08-13T03:09:07.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3945" PostTypeId="2" ParentId="3941" CreationDate="2012-08-13T03:44:13.940" Score="2" Body="&lt;p&gt;First term in parens is the annuity formula applied to a 10 year stream of coupon payments at rate y0, second term in parens is discounted one dollar of principal payable at ten year maturity.  Then subtract $1 invested today and add a current cash coupon at rate y0.&lt;/p&gt;&#xA;" OwnerUserId="2805" LastActivityDate="2012-08-13T03:44:13.940" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3946" PostTypeId="2" ParentId="3922" CreationDate="2012-08-13T12:53:43.673" Score="3" Body="&lt;p&gt;One more answer from my side in case you are interested in risk management.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In historical simulation (for details please see the references below) past returns are sometimes scaled by (i.e. devided by) some local volatility measure (this can e.g. be GARCH or EWM) such that the resulting scaled returns are theoretically stationary (with respect to volatility). This procedure is sometimes calles &lt;em&gt;filtering&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then at a later stage, when one considers scenarios, the filtered returns are multiplied by the most recent volatility measure. This gives (historically) simulated returns on the present volatility level that preserve historically seen correltions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would be happy to give you more details if an application to risk management is your aim.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;References are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.rotman.utoronto.ca/~amackay/fin/hwvar2.pdf&quot; rel=&quot;nofollow&quot;&gt;INCORPORATING VOLATILITY UPDATING INTO THE HISTORICAL&#xA;SIMULATION METHOD FOR  VALUE AT RISK, John Hull and Alan White&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;For an SDE approach: &lt;a href=&quot;http://arxiv.org/abs/0904.0624&quot; rel=&quot;nofollow&quot;&gt;A new approach for scenario generation in Risk management, Juan-Pablo Ortega, Rainer Pullirsch, Josef Teichmann, Julian Wergieluk&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2012-08-13T12:53:43.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3947" PostTypeId="2" ParentId="3284" CreationDate="2012-08-13T21:03:51.057" Score="13" Body="&lt;p&gt;Don't use them. Their data is very spotty. They offer &quot;minute by minute&quot; data on commodities markets and forex which should be technically 24hrs yet it usually starts from 9 or 11 o clock and the &quot;minutes&quot; end around 3 or 4. I emailed their support alias asking why this was the case. I also copied and pasted the opening and closing times of the exchanges and here is a response i got&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Sorry but the website you are referring to is not our website, the&#xA;  times stated on the website you have mentioned do not reflect the data&#xA;  we provide.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Kind Regards, Nick Kruger | Customer Service EODData, LLC 444 N.&#xA;  Michigan Ave, Suite 1200 Chicago, IL 60611 www.eoddata.com&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Good luck also finding a phone number to reach them at.&lt;/p&gt;&#xA;" OwnerUserId="2777" LastActivityDate="2012-08-13T21:03:51.057" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3948" PostTypeId="1" CreationDate="2012-08-14T00:08:59.107" Score="1" ViewCount="211" Body="&lt;p&gt;i am developing a simulation trading in US stocks.&#xA;i have 1 transaction a day per stock, assumed for simplicity to be executed at the daily closing price. &#xA;in order to determine a reasonable maximal size for the transaction, i need some assumption concerning the liquidity of the stock.&#xA;if the stock's daily turnover is X USD, i would like to know what would be a reasonable assumption for the transaction size relative to X, so that the transaction is considered small enough to be executed at the historical daily price.&#xA;e.g. is 0.1X good enough?&lt;/p&gt;&#xA;" OwnerUserId="1948" LastEditorUserId="1948" LastEditDate="2012-08-14T00:16:15.077" LastActivityDate="2012-08-17T17:04:28.990" Title="transaction size and liquidity in simulation of US stocks" Tags="&lt;equities&gt;&lt;simulations&gt;&lt;liquidity&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3949" PostTypeId="2" ParentId="3915" CreationDate="2012-08-14T16:41:04.053" Score="3" Body="&lt;p&gt;Update via &lt;a href=&quot;http://www.bloomberg.com/news/2012-08-14/knight-software.html&quot; rel=&quot;nofollow&quot;&gt;Bloomberg&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Knight Capital Group Inc. (KCG)’s $440 million trading loss stemmed from an old set of computer software that was inadvertently reactivated when a new program was installed, according to two people briefed on the matter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once triggered on Aug. 1, the dormant system started multiplying stock trades by one thousand, according to the people, who spoke anonymously because the firm hasn’t commented publicly on what caused the error. Knight’s staff looked through eight sets of software before determining what happened, the people said.&lt;/p&gt;&#xA;" OwnerUserId="2732" LastActivityDate="2012-08-14T16:41:04.053" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3950" PostTypeId="1" AcceptedAnswerId="3953" CreationDate="2012-08-14T18:12:27.343" Score="16" ViewCount="1021" Body="&lt;p&gt;While I spend most of my StackExchange time on MathematicaSE,  I'm in the business and follow the questions and answers on this site with great interest.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recently questions like the following (and some others):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/848/time-series-similarity-measures&quot;&gt;Time-series similarity measures&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/1027/how-are-correlation-and-cointegration-related&quot;&gt;How are correlation and cointegration related?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/879/can-the-concept-of-entropy-be-applied-to-financial-time-series&quot;&gt;Can the concept of entropy be applied to financial time series?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/219/what-is-the-intuition-behind-cointegration&quot;&gt;What is the intuition behind cointegration?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And even something like this from the Wolfram blog:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://blog.wolfram.com/2012/06/01/graph-theory-and-finance-in-mathematica/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Graph Theory and Finance in Mathematica&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;have me thinking about the different approaches available to analyze time-series similarity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These approaches could include:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;covariance, &lt;/li&gt;&#xA;&lt;li&gt;correlation, &lt;/li&gt;&#xA;&lt;li&gt;co-integration,&lt;/li&gt;&#xA;&lt;li&gt;PCA,&lt;/li&gt;&#xA;&lt;li&gt;factor analysis,&lt;/li&gt;&#xA;&lt;li&gt;entropy,&lt;/li&gt;&#xA;&lt;li&gt;graph theory, &lt;/li&gt;&#xA;&lt;li&gt;cluster analysis, and &lt;/li&gt;&#xA;&lt;li&gt;probably others&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;They certainly have different uses and apply to different aspects of time-series.  They all seem to have something to contribute to understanding time-series similarity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this leads me to a number of questions (or maybe just restatements of the same question):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;Can anyone provide a good intuition describing how they all relate to one another?&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I hope here for something beyond things like some of the excellent discussion of the differences between correlation and co-integration and the kinds of series to which they apply that have appeared elsewhere on this site.  I hope for something more along the line of...&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;em&gt;Does some point of view or insight exist that provides a better idea of all of these measures?&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;em&gt;From some meta-perspective could one view these approaches as aspects of some broader idea?&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;em&gt;Could some meta-perspective recast all of these approaches so one could view them in similar units of measure?&lt;/em&gt; &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Not even certain this is possible.  Even as I write out this post it seems like asking someone to deliver something like a unified field theory of time-series similarity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still, if possible it might prove useful so, maybe the questions will spark an interesting answer or two.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, any recommendations of papers or other resources that explore any of this appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Updated 15 Aug 2012 2:00 PM EDT&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following paper gives an example of the kind of thinking that moves in the direction of a broader answer to this question: &lt;a href=&quot;http://papers.cnl.salk.edu/PDFs/Empirical%20Entropy%20Manipulation%20and%20Analysis%201995-3125.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Empirical Entropy Manipulation and Analysis&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The section on casting (at least some) PCA problems as entropy maximization problems follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/2EuH0.png&quot; alt=&quot;enter image description here&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/1MXE4.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And yes PCA can be done by eigenvalue decomposition of a data covariance (or correlation) matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, clearly some of these kinds of analysis have some kind of relationship.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps some view can include more of them.  Maybe an entropy or information description of correlation or cointegration.  I'm not sure, but to me it seems a interesting question.&lt;/p&gt;&#xA;" OwnerUserId="2789" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2012-08-17T17:10:38.717" Title="Meta-view of different time-series similarity measures?" Tags="&lt;time-series&gt;&lt;correlation&gt;&lt;cointegration&gt;&lt;factor-models&gt;&lt;pca&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="16" ContentLicense="CC BY-SA 3.0" />
  <row Id="3952" PostTypeId="2" ParentId="3948" CreationDate="2012-08-15T23:13:35.087" Score="4" Body="&lt;p&gt;The common practices are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;if you trade less than 8% of the Average Daily Volume, you can use a VWAP or Implementation Shortfall algo.&lt;/li&gt;&#xA;&lt;li&gt;you need to &quot;add&quot; a slippage of 1/3 of the bid ask spread of the stock.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Your only issue is that you want to use the close price instead of the VWAP one. Best option is to use the daily VWAP as a proxy. Otherwise measure the std between the close and the VWAP and add a multiple of it to your &quot;liquidity premium&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find more details in &lt;a href=&quot;https://www.cheuvreux.com/dl.aspx?filter=159088&quot; rel=&quot;nofollow&quot;&gt;&quot;Navigating Liquidity 6: A global menu for optimal trading&quot;&lt;/a&gt; pages 42 and more.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2012-08-17T17:04:28.990" LastActivityDate="2012-08-17T17:04:28.990" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3953" PostTypeId="2" ParentId="3950" CreationDate="2012-08-15T23:28:25.530" Score="11" Body="&lt;p&gt;Here is a structured list of your bullet points:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;covariance, &lt;/li&gt;&#xA;&lt;li&gt;correlation,&lt;/li&gt;&#xA;&lt;li&gt;PCA,&lt;/li&gt;&#xA;&lt;li&gt;factor analysis,&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Are similar. They are based on Gaussian assumptions (i.e. correlations means dependencies) and try to identify common &lt;em&gt;factors&lt;/em&gt; (i.e. a variable in small dimension) explaining the observed relationships.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;co-integration&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;is more specific in the sense that you focus on capturing relationships which residuals are &lt;em&gt;stationnary&lt;/em&gt; (say i.i.d. to make it simpler).&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;entropy,&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;is the non linear version of the first list. The only bad point is that when a &lt;em&gt;mutual information&lt;/em&gt; (it is the correct term) analysis is positive, you have no guarantee that you will be able to build the adequate model to capture the identified relationship. Entropy gives you the existence of a non linear model, but no clue to find it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, there is a possible mix between entropy and PCA: the ICA (Independent Component Analysis). It focuses on finding not few orthogonal factors but few independent factors.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;graph theory, &lt;/li&gt;&#xA;&lt;li&gt;cluster analysis,&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;are more adequate for discrete relationships: they will given you homogenous groups of stocks with respect to binary variables (increasing vs decreasing for instance and not take into account the intensity of the vatiations). It is a good complement to a factor or PCA analysis, to help you to understand the meaning of the factors.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2012-08-17T17:10:38.717" LastActivityDate="2012-08-17T17:10:38.717" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3954" PostTypeId="1" CreationDate="2012-08-16T01:37:04.857" Score="8" ViewCount="258" Body="&lt;p&gt;&quot;If at least 10% of an option's value is time value (ie. time value &gt;= 0.1*call price), it has a delta less than 90&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice and after doing many tests with an option pricing calculator, this statement seems to hold true. Can anyone mathematically prove or disprove this?&lt;/p&gt;&#xA;" OwnerUserId="2812" LastActivityDate="2012-08-18T19:35:01.827" Title="Prove or disprove &quot;If at least 10% of an option's value is time value, it has a delta less than 90&quot;" Tags="&lt;options&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3955" PostTypeId="1" CreationDate="2012-08-16T11:42:54.663" Score="1" ViewCount="2183" Body="&lt;p&gt;I am using FIX4.3 and QuickFIX/n v1.0.0 for its implementation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I came across a situation where i had subscribed for Market Data and was successfully receiving Snapshot message then suddenly all communication with the Market Session stopped and i didn't receive any more snapshot from the server on the Market Data Session. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When i asked the support they said that they didn't receive any heartbeat from my end so they closed the connection. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When i look at my FIX log files i see that time between my last heartbeat and the last snapshot from the server is under 60 seconds. And i didn't receive any logout message from the server either. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also during all this time my Order Session stayed connected with proper heartbeat message. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My Questions are: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;What might have caused the system to not send out a Heartbeat&#xA;message?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is it normal for the server to close connection on missing 1&#xA;heartbeat message? My understanding was that in case there is no&#xA;heartbeat from the client, server will send a test request.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Using QuickFIX/n how can i ensure my periodic heartbeat message?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Whats the best time interval for heartbeat? (Mine is currently set&#xA;to 60 seconds)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2369" LastActivityDate="2012-09-19T01:03:19.807" Title="FIX Heartbeat message not sent" Tags="&lt;automated-trading&gt;&lt;research&gt;&lt;programming&gt;&lt;fix&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3956" PostTypeId="1" AcceptedAnswerId="3957" CreationDate="2012-08-16T13:58:27.823" Score="6" ViewCount="11570" Body="&lt;p&gt;I'm trying to annualize the four moments based on a string of daily returns (continuously compounded) for 11 years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The formulas for the annualization of the mean and the standard deviation I did find, but unfortunately the formulas for the skewness and kurtosis and the way to apply them not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anybody help me? I'd would be appreciated a lot!&lt;/p&gt;&#xA;" OwnerUserId="2815" LastEditorUserId="999" LastEditDate="2012-11-12T12:36:35.537" LastActivityDate="2012-11-12T12:36:35.537" Title="How to annualize skewness and kurtosis based on daily returns" Tags="&lt;returns&gt;&lt;skewness&gt;&lt;kurtosis&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3957" PostTypeId="2" ParentId="3956" CreationDate="2012-08-16T19:47:05.250" Score="5" Body="&lt;p&gt;In my opinion you have two choices:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;You calculate annual returns from the daily returns that you have - I guess it is clear how. Subsequently you calculate your statistics on these $11$ data points. When I look at your comment above, this could be what you want to achieve. Then you have the ex-post statistics on your data. The drawback is that $11$ data points are not that many and the error of your estimator is rather large.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The other approach that people mostly do is to use data at a higher frequency (e.g. daily, weekly or monthly) and then apply the scaling rules that are mentioned in Bob Jansens comment. In order to avoid any spurious auto-correlations that could result from trading hours and similar effects often a lower frequency than daily is used - e.g. weekly if there have not been gathered that many data points yet, or monthly. In your example I would use monthly data and then apply the scaling rules with $n=12$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The assumption of this approach is that your weekly/monthly returns are stationary and independent (in fact a bit less is assumed but this would go too far).&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2012-08-16T19:47:05.250" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="3958" PostTypeId="2" ParentId="3728" CreationDate="2012-08-16T21:56:36.170" Score="1" Body="&lt;p&gt;Try fitting a model with ARMA errors?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if by &quot;rolling returns&quot; you imply a moving average of returns or some QoQ or YoY return series, which has much persistence, I am not so sure what the right way to proceed really is (with the exception that you can apply some corrections suggested in econometrics literature).&lt;/p&gt;&#xA;" OwnerUserId="139" LastActivityDate="2012-08-16T21:56:36.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3960" PostTypeId="1" AcceptedAnswerId="3963" CreationDate="2012-08-17T16:03:10.993" Score="4" ViewCount="995" Body="&lt;p&gt;I hope this is the correct site for this question, as it is rather theoretical...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In their famous paper, Delbaen and Schachermayer proved that the No Free Lunch with Vanishing Risk condition is equivalent to the existence of the Equivalent Local Martingale Measure. Are there any stronger no-arbitrage type conditions that guarantee that this measure is a true martingale measure (i.e. that all discounted asset prices are true martingales as opposed to merely local ones)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would be grateful for (academic) references.&lt;/p&gt;&#xA;" OwnerUserId="1810" LastActivityDate="2014-11-29T22:24:29.690" Title="Equivalent (true) Martingale Measures and no-arbitrage conditions" Tags="&lt;no-arbitrage-theory&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3961" PostTypeId="1" CreationDate="2012-08-17T16:18:15.900" Score="3" ViewCount="237" Body="&lt;p&gt;When (under what assumptions on the model) does a &lt;a href=&quot;http://en.wikipedia.org/wiki/Stochastic_discount_factor&quot; rel=&quot;nofollow&quot;&gt;Stochastic Discount Factor&lt;/a&gt; need to be &lt;a href=&quot;http://almostsure.wordpress.com/2009/12/22/class-d-processes/&quot; rel=&quot;nofollow&quot;&gt;of Class D&lt;/a&gt;? What would be the implications if it was not? Is it connected to one of the no-arbitrage notions?&lt;/p&gt;&#xA;" OwnerUserId="1810" LastActivityDate="2012-08-17T16:18:15.900" Title="Stochastic discount factor (aka deflator or pricing kernel) and class D processes" Tags="&lt;stochastic-calculus&gt;&lt;pricing&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3962" PostTypeId="2" ParentId="1916" CreationDate="2012-08-17T19:52:28.140" Score="1" Body="&lt;p&gt;Even if this is maybe a bit off-topic as you ask for an example in the context of insurance I want to give you two different examples:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Credit risk: In the Credit Risk Plus model the number of credit defaults in a portfolio is modelled by a Poisson distribution. If you model the loss given default as an independent random sequence then the total loss is compound Poisson. See e.g. &lt;a href=&quot;http://www.fam.tuwien.ac.at/~schmock/Stable_Panjer_Recursion.html&quot; rel=&quot;nofollow&quot;&gt;http://www.fam.tuwien.ac.at/~schmock/Stable_Panjer_Recursion.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Operational risk: in the same vein as in credit risk. If you model the number of operational losses of a bank by a Poisson distribution and the size of losses as an independent sequence then again you have a compound Poisson model. See e.g. works of Pavel Shevchenko: &lt;a href=&quot;http://arxiv.org/abs/1008.1108&quot; rel=&quot;nofollow&quot;&gt;Calculation of aggregate loss distributions&lt;/a&gt; or &lt;a href=&quot;http://arxiv.org/abs/0904.1805&quot; rel=&quot;nofollow&quot;&gt;Implementing Loss Distribution Approach for Operational Risk&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2012-08-17T19:52:28.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3963" PostTypeId="2" ParentId="3960" CreationDate="2012-08-17T20:44:11.877" Score="2" Body="&lt;p&gt;(If I remember well,) the &lt;em&gt;local&lt;/em&gt; nature of the equivalent measure in the NFLVR theory comes from the fact that the market $S$ is a &lt;em&gt;locally bounded&lt;/em&gt; semi-martingale. If it is &lt;em&gt;bounded&lt;/em&gt;, you obtain an equivalent martingale measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should be in &lt;a href=&quot;http://www.springerlink.com/content/gk1r1262r4061018/&quot; rel=&quot;nofollow&quot;&gt;A general version of the fundamental theorem of asset pricing, by Freddy Delbaen and Walter Schachermayer&lt;/a&gt; (thanks to Richard's remark, your answer seem to be theorem 1.1 of the paper).&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2012-08-30T13:21:20.907" LastActivityDate="2012-08-30T13:21:20.907" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3965" PostTypeId="2" ParentId="3954" CreationDate="2012-08-18T19:35:01.827" Score="7" Body="&lt;p&gt;This claim is false.  A deep in-the-money option with very high volatility can have both large time value and high delta.  As a counterexample, consider a call option with:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;K = 100 (strike price)&lt;/li&gt;&#xA;&lt;li&gt;S = 300 (spot price)&lt;/li&gt;&#xA;&lt;li&gt;r = 0&lt;/li&gt;&#xA;&lt;li&gt;T = 1&lt;/li&gt;&#xA;&lt;li&gt;vol = 150%&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This gives a Black-Scholes value of approximately \$230, so the time value is \$30, but the delta is 93.1%.&lt;/p&gt;&#xA;" OwnerUserId="2825" LastActivityDate="2012-08-18T19:35:01.827" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3966" PostTypeId="2" ParentId="1937" CreationDate="2012-08-18T22:07:59.597" Score="16" Body="&lt;p&gt;Dynamic Time Warping, recursive, time-delayed feedforward neural networks, wavelets, empirical mode decomposition, ..., there's plenty of it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;BUT&lt;/strong&gt; If you want my advice, don't go this way, I wasted too much time doing things like that. Neither big nor small players (profitably and &lt;strong&gt;consistently&lt;/strong&gt;) trade this way and for a good reason. Technical analysis is a technology of prehistoric pre-computer era and those patterns are only there after the fact. All those websites, books etc. on that is just a way of incapable people trying to make money on the market in a secondary way. There's few empirical reasons for anyone to share his trading knowledge if it works. Once you have your own stuff, you surely won't be giving it away. And if, why would you as a successful trader try to sell expensive books or trading recommendations? Most of the stuff, starting with technical analysis, is basically a scam or useless spam. You certainly won't make money if you do things too many people know about, that's in the nature of what market is. Go real science.&lt;/p&gt;&#xA;" OwnerUserId="2826" LastActivityDate="2012-08-18T22:07:59.597" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3967" PostTypeId="1" AcceptedAnswerId="3971" CreationDate="2012-08-19T05:23:23.147" Score="0" ViewCount="334" Body="&lt;p&gt;I'm trying to price an option with payoff $\max\{a\cdot S_t - K,0\}$ where $a$ is a known constant.  Ideally I'm looking for a closed form, continuous-time solution.  Where should I begin?&lt;/p&gt;&#xA;" OwnerUserId="788" LastEditorUserId="1418" LastEditDate="2012-08-20T05:47:31.570" LastActivityDate="2012-08-20T05:47:31.570" Title="Exotic option pricing" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;exotics&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3970" PostTypeId="1" AcceptedAnswerId="3974" CreationDate="2012-08-19T12:41:48.977" Score="3" ViewCount="6926" Body="&lt;p&gt;I am developing a trading strategy for currencies. I am trying to find an indication for risk, something like Sharpe ratio or Sterling ration; for that, I thought of using the (maximum) drawdown measurement, but have encountered a problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The drawdown (at least according to Wikipedia), saves a peak's value, and for every value later which is lower than the value of the peak, calculated:&#xA;$DD = {(peak - value) \over peak}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem arises when the first &quot;peak&quot; of the trading strategy is of value 0. That forces me to divide by 0. For backtesting purposes, I always assume the net value of the &quot;robot&quot; is 0, and from that point on it makes profits or losses. Other assumptions may solve the problem, but arbitrarily; different decisions for initial value will lead to different drawdown calculation results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A second thought about drawdowns regard their effectiveness; do you think that simple variation calculation might give a better insight regarding the strategy's risk? And even then - how would you combine average profit and variance? And how would you calculate the variance - every trade? Every day? Around 0 or around the line connecting the final profit with 0 during the period? Or around the linear regression?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And if linear regression is involved - why variance and not, say, standard error?&lt;/p&gt;&#xA;" OwnerUserId="2723" LastEditorUserId="1418" LastEditDate="2012-08-20T00:16:06.120" LastActivityDate="2012-08-20T01:15:22.130" Title="Drawdown calculation for strategies" Tags="&lt;risk&gt;&lt;drawdown&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="3971" PostTypeId="2" ParentId="3967" CreationDate="2012-08-19T17:10:58.847" Score="8" Body="&lt;p&gt;The payoff $\max\{a\cdot S_t - K,0\}$ can be re-written as $a\cdot\max\{S_t - K/a,0\}$. Therefore it can be priced as a regular call option with the strike $K/a$.&lt;/p&gt;&#xA;" OwnerUserId="370" LastActivityDate="2012-08-19T17:10:58.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3973" PostTypeId="2" ParentId="3955" CreationDate="2012-08-20T00:53:07.207" Score="1" Body="&lt;p&gt;Taking the information given in your question and subsequent follow up, I believe the following is the issue at hand:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The heart beats you send out are good practice but are irrelevant in regards to your specific problem. It looks like your brokers sends out periodic &quot;heart beats&quot; (= test requests) on its own and if your application does not respond then it disconnects. I would not entirely rely on the specific Fix version (build) but rather inquire with the broker what specific message is sent through FIX and what they expect back to keep you alive. You most likely need to reply with a message to acknowledge the &quot;test request&quot;. That most likely will solve your problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding your other questions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) You answered that yourself, you actually sent out the heartbeats and the broker received them, thus no problems here. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) ...which the server did (sending out a test request). Make sure you understand there is a difference between you sending out heart beats and the broker sending out his own heartbeats. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) See 1) no problem there, you sent them out, they were received&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) It entirely depends on your trading frequency. Obviously before sending out FIX messages you want to make sure the connection is alive, other than that if you trade high frequency 60 seconds is way too infrequent. If your trade frequency is a lot lower then 60 seconds may be sufficient. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-08-20T00:53:07.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3974" PostTypeId="2" ParentId="3970" CreationDate="2012-08-20T01:15:22.130" Score="4" Body="&lt;p&gt;I concur with Richard here. Generally draw downs are measured on invested capital not raw pnl. Thus if you start out with 1 million xyz currency units and suffer a loss on the first trade of 100,000 xyz then you suffered a 10% draw down. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Make sure you understand that going practice is that most draw down calculations apply a moving window which means your maximum draw down is a function of the local maximum within the observation window not a global maximum. Also, generally your max draw down is not a function of your current wealth unless it is a local minimum or similar local minimum metric, according to standard market practice. There are different definitions out there but the following makes it probably clearer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.stat.columbia.edu/~vecer/maxdrawdown3.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.stat.columbia.edu/~vecer/maxdrawdown3.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following up on your subsequent questions: I can most certainly assure you that max draw down alone is not enough to measure risk. A very important metric in close combination to draw down is the time it takes to recover from draw downs. A strategy that generally recovers from a max draw down of 10% within days is imho much more favorable than a strategy with a max draw down that, however, takes weeks or months to recover. Additionally, many who do not manage risk and trade over emphasize draw downs in a way that they look at such draw downs in an isolated fashion: For example, your strategy may show a max draw down of 20% and some cite such figures as way too high to manage institutional funds. However, if it can be shown that the recovery is fast and that draw downs of such magnitude are far in between while the strategy displays strong growth factors then it is not enough to just judge a strategy's performance from draw down figures. I could not care less if I made a 100% annualized return over several years with max draw downs of 20% if such draw downs are quickly recovered. It hurts to see wealth vanish by max draw down figures at the initiation of the strategy (then it comes down to the confidence you place in the strategy and your back tested results) but it would matter a lot less if your annualized returns are predicted to be a multiple of the draw down figure with fast recovery. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Never look at just one metric is I guess all I want to say. Never forget about risk-reward, risk-adjusted return, that is all that matters in this game. Large returns generally come at larger risk. Thus, Sharpe ratio is an often cited metric, though I do not like it too much because you are penalized for out-sized positive returns while I would only define negative returns as risk. So, look at recovery rates from draw downs, look at risk adjusted returns, look at the frequency of draw downs, and above all look at your return distribution and how returns are skewed. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-08-20T01:15:22.130" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3976" PostTypeId="2" ParentId="141" CreationDate="2012-08-20T05:13:59.410" Score="3" Body="&lt;p&gt;For the best historical data on options, go to &lt;a href=&quot;http://www.optionsdatamine.com&quot; rel=&quot;nofollow&quot;&gt;OptionsDatamine&lt;/a&gt;. It has options prices, OHLCV, and open interest over two years historical. Graphs and charts are available too.&lt;/p&gt;&#xA;" OwnerUserId="2836" LastEditorUserId="35" LastEditDate="2012-10-15T22:49:54.657" LastActivityDate="2012-10-15T22:49:54.657" CommentCount="0" CommunityOwnedDate="2012-08-20T05:13:59.410" ContentLicense="CC BY-SA 3.0" />
  <row Id="3977" PostTypeId="1" CreationDate="2012-08-20T05:45:40.043" Score="-3" ViewCount="749" Body="&lt;p&gt;I have $2000 that I can risk losing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to get started with Forex Trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some place where I can open an account, get free API access, and write basic programs to play with the data? [I'd prefer a Java interface as I'd like to use Clojure.]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="2837" LastActivityDate="2012-08-20T06:45:20.667" Title="Getting started with Forex Trading" Tags="&lt;fx&gt;" AnswerCount="1" CommentCount="2" ClosedDate="2012-08-20T10:25:49.047" ContentLicense="CC BY-SA 3.0" />
  <row Id="3978" PostTypeId="2" ParentId="3977" CreationDate="2012-08-20T06:28:08.977" Score="2" Body="&lt;p&gt;www.interactivebrokers.com&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They have a Java API, they have a paper trading account once you funded your account. But I guess this question will not make it too long on this forum as this forum is more quant focused. I recommend you go to www.elitetrader.com and ask such questions there. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2012-08-20T06:45:20.667" LastActivityDate="2012-08-20T06:45:20.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3979" PostTypeId="1" CreationDate="2012-08-21T09:15:35.620" Score="4" ViewCount="7858" Body="&lt;p&gt;I have a cumulative profit/loss time series below for a trading strategy, what is the appropriate way to calculate the returns in percentage for such a series? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My issue is the appropriate calculation for when the strategy becomes negative and going forward. I can't take log of a negative number and I am not sure if the arithmetic calculation is appropriate. I would appreciate any suggestions. I am using matlab. Thanks&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; 1.0e+003 *&#xA;&#xA;    5.2735&#xA;    4.3922&#xA;    3.1878&#xA;    3.6250&#xA;    3.6982&#xA;    5.3774&#xA;    5.5748&#xA;    5.0108&#xA;    1.0355&#xA;   -2.4639&#xA;   -4.6589&#xA;   -4.2990&#xA;   -3.8678&#xA;   -3.1051&#xA;   -4.5356&#xA;   -4.8130&#xA;   -8.9671&#xA;   -9.0438&#xA;   -7.2986&#xA;   -7.1849&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2642" LastActivityDate="2017-08-20T13:12:17.003" Title="Appropriate method for calculating negative returns on a trading strategy?" Tags="&lt;quant-trading-strategies&gt;&lt;returns&gt;&lt;trading-systems&gt;&lt;strategy&gt;" AnswerCount="5" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3980" PostTypeId="2" ParentId="3979" CreationDate="2012-08-21T10:14:15.297" Score="8" Body="&lt;p&gt;So those are cumulative pnl figures and you are interested in the percent changes in pnl from one data point to the next? Don't use log returns, simply generate the percent changes through r(t)/r(t-1)-1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4.3922/5.2735-1 = -16.71% (in your example time series I made the assumption that the time series is in ascending order. Given your description of the above time series data points, the change of your pnl from absolute 5.2735 -&gt; 4.3922 constitutes a decrease by 16.71% of generated pnl. (I am not sure why you wanna get to those numbers this way but this is how you described it, nonetheless). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using arithmetic returns is completely fine, in fact its preferable over log returns in some instances. I would consider return calculation for return attribution purposes such situation. I know I will probably be down voted by someone for this comment but I am happy to defend this statement if being asked.   &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2012-08-21T14:14:57.583" LastActivityDate="2012-08-21T14:14:57.583" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="3982" PostTypeId="2" ParentId="3868" CreationDate="2012-08-21T19:23:53.857" Score="5" Body="&lt;p&gt;There are two flaws in the argument. The simpler one is that expectations give information about probability distributions (premise D). I think this is what John was referring to in his comment. The fact that the expectation of a forward rate in period X is Y% tells us nothing about the implied probability distribution in that period, and certainly doesn't preclude the possibility that the rate could be 0% or 100% with non-zero probability. Y% is merely the expectation of that distribution. For a more concrete example, consider a little normal distribution around each forward, representing its probability distribution. The forward rate tells us the mean (center) of that distribution, but tells us nothing about how far it stretches in either direction. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second flaw is that premise (C) does not follow from (A) and (B). Premise (C) states that REH will never predict term structure flattening, but, as you knowledge in your conclusion, the picture provided to illustrate (B) shows a term structure that will not only flatten but invert.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To demonstrate why this is so, note that while it is true that an monotonically increasing term structure requires forwards that are everywhere higher than spot rate, that does not mean that the structure does not flatten. A counterexample is trivial to construct: 5% forward rate in the first period, and 10% forward rates thereafter. The resulting spot curve starts at 5% and monotonically increases toward 10%, a level it never reaches (as of day 0). But every successive day will yield a flatter curve, ceteris paribus, reaching a limit of a 10% flat curve in the absence of new information that impacts expectations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words: if the forward rates flatten, so will the spot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a more complex counterexample, refer again to the image in your post, which shows a monotonically increasing spot curve with forwards that imply a future inversion (an act which necessitates an intermediate flattening).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, don't forget that there are many possible term structures with non-monotonic slopes. In such structures, the forward curve will be sometimes higher and sometimes lower than spot. Therefore, (B) is incomplete, as it only considers two cases, and (C) can not be absolute.&lt;/p&gt;&#xA;" OwnerUserId="2843" LastActivityDate="2012-08-21T19:23:53.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3983" PostTypeId="5" CreationDate="2012-08-21T23:49:12.533" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://quantlib.org&quot; rel=&quot;nofollow&quot;&gt;Quantlib&lt;/a&gt; is an open-source C++ library for quantitative finance.  It has interfaces to many other programming languages, including C#, &lt;a href=&quot;http://caml.inria.fr/&quot; rel=&quot;nofollow&quot;&gt;Objective Caml&lt;/a&gt;, Java, &lt;a href=&quot;http://www.perl.org&quot; rel=&quot;nofollow&quot;&gt;Perl&lt;/a&gt;, &lt;a href=&quot;http://python.org&quot; rel=&quot;nofollow&quot;&gt;Python&lt;/a&gt;, &lt;a href=&quot;http://www.r-project.org/&quot; rel=&quot;nofollow&quot;&gt;R&lt;/a&gt;, &lt;a href=&quot;http://www.ruby-lang.org/&quot; rel=&quot;nofollow&quot;&gt;Ruby&lt;/a&gt;, and &lt;a href=&quot;http://www.schemers.org/&quot; rel=&quot;nofollow&quot;&gt;Scheme&lt;/a&gt;.  It includes modules for interest rate modeling, pricing of options and swaps, and monte-carlo simulation.&lt;/p&gt;&#xA;" OwnerUserId="1418" LastEditorUserId="1418" LastEditDate="2012-08-22T03:08:56.787" LastActivityDate="2012-08-22T03:08:56.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3984" PostTypeId="4" CreationDate="2012-08-21T23:49:12.533" Score="0" Body="Quantlib is an open-source C++ library for quantitative finance." OwnerUserId="1418" LastEditorUserId="1418" LastEditDate="2012-08-22T03:08:43.480" LastActivityDate="2012-08-22T03:08:43.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3985" PostTypeId="2" ParentId="3979" CreationDate="2012-08-22T03:14:31.157" Score="1" Body="&lt;p&gt;This is a very interesting problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I disagree with the use of any form of percent returns -- conventional or logarithmic -- simply because they are nonsensical for negative equity values (I am assuming this price series is from some sort of margined position?). You are forced to choose between the mathematically &quot;correct&quot; returns for those which are &quot;correct&quot; from the point of view of the account holder.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the final two results: a negative equity balance of -7.30 followed by an improvement to a negative balance of -7.18. Conventionally, that's a -1.64% move (-7.18 / -7.30 - 1), even though of course we can see that the account balance is moving positively (in the account holder's favor).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it &quot;right&quot;? Sure, mathematically -7.18 is -1.64% from -7.30. But if you try to calculate any statistics off these returns, the winning and losing days will be reversed -- so it's not right from a practicality standpoint and will ruin your perception of the account's performance (like average return, trend, risk). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is correct, however, if we consider that it is the return experienced by whomever is &quot;in the money&quot; with regard to this margin account at that time. When the account balance is positive, the account holder is (presumably) experiencing gains. When the balance is negative, the margin lender is experiencing gains. Percent returns calculated conventionally are a reflection of their respective positions times the sign of their cumulative profit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Logarithmic returns suffer from exactly the same problem -- moving toward zero is always considered a &quot;negative&quot; return, disregarding the fact that there is a negative equity balance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, for the sake of answering part of your question, you can in fact calculate logarithmic returns for your negative price series, with the exception of the one point where it crosses zero. Note that log(x) - log(y) = log(x/y). Therefore, instead of differencing the log of two numbers, just take the logarithm of their ratio. The example I gave above becomes log(-7.18 / -7.30) = -1.65%, which is very close to the arithmetic result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the crossing point, this method will fail, and you may have to fall back on an arithmetic calculation (with all the caveats above).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best way to do this is to use a margin balance or risk capital position. Add that to the price series to de-lever it and avoid negative balances. Then either method of calculating returns will work as normal.&lt;/p&gt;&#xA;" OwnerUserId="2843" LastEditorUserId="2843" LastEditDate="2012-08-22T04:10:53.217" LastActivityDate="2012-08-22T04:10:53.217" CommentCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="3986" PostTypeId="1" AcceptedAnswerId="3988" CreationDate="2012-08-22T03:55:25.603" Score="12" ViewCount="1367" Body="&lt;p&gt;As an aside on his answer &lt;a href=&quot;https://quant.stackexchange.com/a/3974/1587&quot;&gt;on another question&lt;/a&gt; Freddy said:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Sharpe ratio is an often cited metric, though I do not like it too&#xA;  much because you are penalized for out-sized positive returns while I&#xA;  would only define negative returns as risk.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;At first glance this seems like a good point, but a quick hunt around the site found no mention of it. (To clarify: &quot;It&quot; means calculating variance of just the strategy losses and using that as the divisor.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the arguments against? Does it have a name and is anyone using it? Is there any R function that already implements it?&lt;/p&gt;&#xA;" OwnerUserId="1587" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2012-08-23T04:12:01.763" Title="Is this a common variation of sharpe ratio?" Tags="&lt;sharpe-ratio&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3987" PostTypeId="2" ParentId="3986" CreationDate="2012-08-22T04:25:40.043" Score="2" Body="&lt;p&gt;The statement is accurate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &quot;argument against&quot; is that some investors prefer stability of returns over time instead of returns with high variance, even if all returns in the series are positive.  For example if a manager has a 5 year track record with no losing years and averages 20%, but one of the years he has a 2% return that's a important for the investor to understand.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, excluding positive returns from the variance calculation can hides information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a good paper on &quot;down side risk adjusted performance measures&quot;.  These are a class of information measures that can be setup to incorporate a variety of factors, including separating out upside return variance from the measure...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://corporate.morningstar.com/us/documents/MethodologyDocuments/ResearchPapers/UnifiedApproach.pdf&quot; rel=&quot;nofollow&quot;&gt;http://corporate.morningstar.com/us/documents/MethodologyDocuments/ResearchPapers/UnifiedApproach.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2012-08-22T04:25:40.043" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3988" PostTypeId="2" ParentId="3986" CreationDate="2012-08-22T06:22:41.057" Score="8" Body="&lt;p&gt;Darren, you could have asked me directly in that related question but here goes :-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The measure you are looking for is called &quot;Sortino Ratio&quot;, here a quick wiki and a rather excellent (as its concise but to the point) treatise of the issue at hand:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Sortino_ratio&quot;&gt;http://en.wikipedia.org/wiki/Sortino_ratio&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.edge-fund.com/Hard02.pdf&quot;&gt;http://www.edge-fund.com/Hard02.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and yes there is an R library:&#xA;&lt;a href=&quot;http://braverock.com/brian/R/PerformanceAnalytics/html/SortinoRatio.html&quot;&gt;http://braverock.com/brian/R/PerformanceAnalytics/html/SortinoRatio.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe that the more risk metrics one looks at in order to evaluate a strategy or portfolio the better. However, if one had to chose Sharpe over Sortino ratio I would not hesitate a second to recommend focusing on Sortino, basically on downside risk. Mathematically it is possible that portfolio1 with no negative but stable low returns results in a higher Sharpe ratio than portfolio2 with no negative returns either but much higher despite more volatile returns, even if portfolio2 has much higher total returns. Obviously there is no one-size-fits-all answer but risk in a portfolio and performance return context is for me still a measure of potential downside, a.k.a. losses. But you need to decide for yourself. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-08-22T06:22:41.057" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="3989" PostTypeId="2" ParentId="3986" CreationDate="2012-08-22T12:30:43.337" Score="5" Body="&lt;p&gt;There are several arguments against using the Sharpe ratio. First is that the Sharpe ratio can be gamed by managers:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Illiquid stocks or infrequent marking-to-market raises the sharpe ratio. An example of this is using the NACREF appraisal index to measure the return &amp;amp; volatility of real-estate assets as opposed to the NAREIT index which is marked-to-market much more frequently.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Lengthening the measurement interval (to monthly instead of daily returns, for example). This lowers the estimated volatility. Longer holding periods increase the ratio by approximately the square root of time. Digression: This practice is quite pervasive. Whenever I see a strategy tear-sheet I immediately flip to the definition of sharpe ratio and often find that the manager uses monthly sharpe ratios instead of daily.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Several strategies such as buy-write have high sharpe ratios that mask severe downside risk for several years. For example, writing out of the money puts and calls generates premium which has a high sharpe in good times. Similarly, strategies that take on default risk, liquidity risk, have the ability to bias upwards the sharpe ratio in normal times (see Long-Term Capital Management)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Engage in a return swap with a broker dealer to eliminate the highest returning and lower returning months in the portfolio will increase Sharpe by eliminating extreme returns&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Smoothing of returns with derivatives&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The Sharpe ratio can be gamed by adjusting the universe of analysis. For example, a manager with a Sharpe ratio of 1.5 performing security selection the S&amp;amp;P 500 universe has better active management skill than a manager who achieves the same Sharppe ratio on the Russell 5000.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;To use Sharpe ratio to compare manager performance across strategies there is an assumption that i) investors care about the 1st two moments of returns, and ii) that when the Sharpe ratio is used to compare across strategies that strategy returns are normally distributed.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;There are various non-parametric and monte carlo techniques that can improve upon the limitations identified above. Also there are other measures such as Sterling Ratio, Return over Max Drawdown (RAMOD), that can inform one's perspective when used in concert with the Sharpe ratio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, attached is a &lt;a href=&quot;http://www.alphasimplex.aaredfreshred.com/pdfs/FAJSharpe.pdf&quot; rel=&quot;nofollow&quot;&gt;paper by Andrew Lo&lt;/a&gt; that is a nice critique of the Sharpe ratio. His conclusion:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The results presented in this article provide one way to gauge the&#xA;  accuracy of these estimators, and it should come as no surprise that&#xA;  the statistical properties of Sharpe ratios depend intimately on the&#xA;  statistical properties of the return series on which they are based.&#xA;  This suggests that a more sophisticated approach to interpreting&#xA;  Sharpe ratios is called for, one that incorporates information about&#xA;  the investment style that generates the returns and the market&#xA;  environment in which those returns are generated. For example, hedge&#xA;  funds have very different return characteristics from the&#xA;  characteristics of mutual funds; hence, the comparison of Sharpe&#xA;  ratios between these two investment vehicles cannot be performed&#xA;  naively.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;As mentioned above, the R &lt;a href=&quot;http://cran.r-project.org/web/packages/PerformanceAnalytics/index.html&quot; rel=&quot;nofollow&quot;&gt;Performance Analytics&lt;/a&gt; package has a number of performance measurement tools.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-08-23T04:12:01.763" LastActivityDate="2012-08-23T04:12:01.763" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="3993" PostTypeId="2" ParentId="3986" CreationDate="2012-08-22T16:27:37.577" Score="2" Body="&lt;p&gt;In addition to the Sortino ratio, another option is calculating the excess return to conditional Value at Risk (CVaR or also called ES) ratio. CVaR is a common measure of tail risk that effectively measures the expected loss (or return) below a certain percentile. You may need to take the absolute value of CVaR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is possible to use a weighted average of CVaRs at several different percentiles in the ratio. This is called mixed CVaR and it enables you to express your preferences on different amounts of downside risk. In addition, subtracting out the expected return from CVaR is called CVaR deviation (you can also create a mixed CVaR deviation). This metric is perhaps closer to the standard deviation and can be a better alternative since it will not change signs (it is possible for CVaR to change signs). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;CVaR can be calculated in the same library as the Sortino ratio using the ES function.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2012-08-22T16:27:37.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="3995" PostTypeId="2" ParentId="3979" CreationDate="2012-08-23T13:21:24.457" Score="4" Body="&lt;p&gt;For me, I would calculate daily returns for such a series by backing out the daily PnL and dividing by some volatility number. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;lets define your cumsum as &quot;c_pnl&quot;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;daily_pnl   = c_pnl - [0; c_pnl(1:length(c_pnl-1)]&#xA;max_draw    = max(cummax(c_pnl) - c_pnl)&#xA;pct_returns = daily_pnl / max_draw # in terms of drawdown&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Don't you have capital already in the assumptions of your backtest?  Why not just use capital?  log((capital + pnl)/capital). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you trade through time with constant capital or are you compounding on PnL?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit: jlowin points out margin as another good way.  Margin is probably better because capital as it incorporates some level of risk of the strategy and you can compare pnl /margin more easily.&lt;/p&gt;&#xA;" OwnerUserId="1368" LastEditorUserId="1368" LastEditDate="2012-08-27T13:14:31.680" LastActivityDate="2012-08-27T13:14:31.680" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3996" PostTypeId="2" ParentId="675" CreationDate="2012-08-23T13:35:05.573" Score="3" Body="&lt;p&gt;I know this is an old question, but Wes McKinney, the developer of &lt;a href=&quot;http://pandas.pydata.org/&quot; rel=&quot;nofollow&quot;&gt;pandas&lt;/a&gt; (mentioned in another answer) is releasing a new Python package called RapidQuant that I think might meet the OP's stated needs. It appears to &lt;a href=&quot;http://www.rapidquant.com/features&quot; rel=&quot;nofollow&quot;&gt;include&lt;/a&gt; both non-standard risk definitions and portfolio optimization. However, it is not open source. While the OP didn't specifically mention that as a dealbreaker, it's an important distinction. Also, Wes has demonstrated cvxopt + pandas in the &lt;a href=&quot;http://wesmckinney.com/blog/?p=301&quot; rel=&quot;nofollow&quot;&gt;past&lt;/a&gt;, so it is possible that RQ wraps it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please note I have no connection with Lambda Foundry (the company that makes this product), I'm just a fan of Wes's work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;...and I completely agree, 1.5 years after this question was posted, that the lack of a widely-adopted financial library is a sore point for Python. While I'm sure most of us have written our own (though talk about a biased sample...), and yes, any optimization package will suffice, I think there's definitely room for improvement here.&lt;/p&gt;&#xA;" OwnerUserId="2843" LastEditorUserId="11807" LastEditDate="2015-10-17T20:37:08.623" LastActivityDate="2015-10-17T20:37:08.623" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="3997" PostTypeId="1" AcceptedAnswerId="4000" CreationDate="2012-08-23T14:06:18.877" Score="5" ViewCount="1089" Body="&lt;p&gt;In &lt;a href=&quot;http://www.math.nyu.edu/research/carrp/papers/pdf/FRLarticle.pdf&quot; rel=&quot;nofollow&quot;&gt;Carr and Madan (2005)&lt;/a&gt;, the authors give sufficient conditions for a set of call prices to arise as integrals of a risk-neutral probability distribution (See &lt;a href=&quot;http://faculty.baruch.cuny.edu/lwu/890/BreedenLitzenberger78.pdf&quot; rel=&quot;nofollow&quot;&gt;Breeden and Litzenberger (1978)&lt;/a&gt;), and therefore be free of static arbitrage (via the &lt;a href=&quot;http://en.wikipedia.org/wiki/Fundamental_theorem_of_asset_pricing&quot; rel=&quot;nofollow&quot;&gt;Fundamental Theorem of Asset Pricing&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These conditions are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Call spreads are non-negative&lt;/li&gt;&#xA;&lt;li&gt;Butterflies spreads are non-negative&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In the case that we have a full range of call prices:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$C(K)$ is monotically decreasing&lt;/li&gt;&#xA;&lt;li&gt;$C(K)$ is convex&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Or if $C(K)$ is twice differentiable:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$$C'(K) \leq 0 \tag1$$&lt;/li&gt;&#xA;&lt;li&gt;$$C''(K) \geq 0\tag2$$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Carr and Madan do not mention the following constraints, thought they may be implied (?):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$$C(K) \geq 0\tag3$$&lt;/li&gt;&#xA;&lt;li&gt;$C(0)$ is equal to the discounted spot price $\tag 4$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Other authors do mention the constraints (1-4) together. For example &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1910737&quot; rel=&quot;nofollow&quot;&gt;Fengler and Hin (2012)&lt;/a&gt; call these the &quot;standard representation of no-arbitrage constraints&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1619844&quot; rel=&quot;nofollow&quot;&gt;Reiswich (2010)&lt;/a&gt;, the author presents the following condition:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$$\frac{\partial P}{\partial K} \geq 0\tag{5a}$$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Or equivalently, via &lt;a href=&quot;http://en.wikipedia.org/wiki/Put%E2%80%93call_parity&quot; rel=&quot;nofollow&quot;&gt;Put-Call Parity&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$$\frac{\partial C}{\partial K} \geq  \frac{C(K) - e^{-r\tau}S}{K}\tag{5b}$$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Reiswich claims that (5) is stricter than what is implied by (1-4) (i.e. there are sets of call prices which satisfy (1-4) but not (5)). Is this really true? If so, how do we reconcile this with Carr and Madan's claim of sufficiency?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Alternately, if (5) must hold is a no-arbitrage setting, and if (1-4) are sufficient, then how do we derive (5) from (1-4)?&lt;/p&gt;&#xA;" OwnerUserId="2327" LastEditorUserId="2327" LastEditDate="2012-08-23T15:05:46.040" LastActivityDate="2012-08-23T15:39:30.747" Title="Sufficient conditions for no static arbitrage" Tags="&lt;option-pricing&gt;&lt;arbitrage&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="3999" PostTypeId="2" ParentId="3609" CreationDate="2012-08-23T14:39:16.433" Score="1" Body="&lt;p&gt;Can we make the assumption that the amount of each dividend is directly correlated to the amount of time between dividends? This would be the case if there were a fixed dividend payout ratio, or whatever the equivalent vocabulary is for this instrument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so, you could annualize each dividend by the number of days since the previous dividend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason this is sound is that if the dividend payout ratio is fixed, then each dividend only represents income earned since the last dividend was paid. Since we know with certainty the length of the period in which the income was generated, we can annualize on that basis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fact that you mention a &quot;special one time return of capital&quot; makes me think this assumption might not be valid for all dividends, but perhaps it will apply to some.&lt;/p&gt;&#xA;" OwnerUserId="2843" LastActivityDate="2012-08-23T14:39:16.433" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4000" PostTypeId="2" ParentId="3997" CreationDate="2012-08-23T15:39:30.747" Score="4" Body="&lt;p&gt;I think that you are missing one key condition on the call prices that I would say is standard, namely that the call prices should be bounded below by an &quot;intrinsic&quot; value. Specifically, we would expect $C(K) \ge (S-e^{-rT}K)_+$, and this can easily be seen to yield a static arbitrage if violated. This condition (in a slightly different form) can be found for example in the paper of &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/j.1467-9965.2007.00291.x/abstract&quot; rel=&quot;nofollow&quot;&gt;Davis and Hobson&lt;/a&gt; which is very relevant to this question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So why is this enough? Let's suppose that we work in the classical risky asset case (the paper by Reiswich is in FX markets, so your equation (5b) has an interest rate which is the foreign rate, lets take this to be zero), so in fact we want to show $$\frac{\partial C}{\partial K} \ge \frac{C(K)-S}{K}. $$ But now think of the call price as a function of $K$, we know this is a convex function, which lies above the line $(S-e^{-rT}K)$, and if we take a tangent at $K$, this is a line with gradient $\frac{\partial C}{\partial K}$ passing through the point $(K,C(K))$. At zero, this line (by the convexity of the call price function) must lie below the call price curve, but the line passes the $y$-axis at the point $C(K)-K \frac{\partial C}{\partial K}$, and this must be less than $S$. Rearranging gives the inequality of Reiswich.&lt;/p&gt;&#xA;" OwnerUserId="2485" LastActivityDate="2012-08-23T15:39:30.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4001" PostTypeId="1" CreationDate="2012-08-24T04:53:20.097" Score="3" ViewCount="448" Body="&lt;p&gt;In the derivation of the Black Scholes equation, the value of the portfolio at time $t$ is given by&lt;br&gt;&#xA;$$P_t = -D_t + \frac{{\partial D_t}}{{\partial S_t}}S_t $$ &#xA;where $P_t$ is the value of the portfolio at time $t$, $D_t$ the price of the derivative and $S_t$ the price of the stock.&lt;br&gt;&#xA;I guess $D_t$ means the price of the premium, i.e., the right to by a call/put option.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Why is that the value of the portfolio is equal to the value of the premium?&lt;br&gt;&#xA;2) Does this equation assume that the underlying derivative is a call option?&lt;/p&gt;&#xA;" OwnerUserId="1454" LastActivityDate="2012-08-27T12:17:54.107" Title="Basic question about Black Scholes derivation" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;derivatives&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4002" PostTypeId="1" CreationDate="2012-08-24T07:26:36.430" Score="4" ViewCount="289" Body="&lt;p&gt;I am trying to replicate results from Engle and Manganelli (2004). The following is one of their specifications,&#xA;$q_t(\theta)=\gamma_0+\gamma_1q_{t-1}(\theta)+\alpha|r_{t-1}|$,&#xA;$q$ is the quantile of return distribution, $r$ is the return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not know how to use quantile regression to estimate this process, since we have quantiles on both sides of equation. Any suggesions?&lt;/p&gt;&#xA;" OwnerUserId="1589" LastEditorUserId="16595" LastEditDate="2018-09-24T20:59:05.757" LastActivityDate="2021-04-09T01:22:18.003" Title="How to estimate CAViaR (Engle and Manganelli 2004) using non linear quantile regression?" Tags="&lt;regression&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4003" PostTypeId="2" ParentId="4001" CreationDate="2012-08-24T07:28:20.937" Score="0" Body="&lt;p&gt;&lt;br&gt; You are refering to a portfolio consisting of a call option and $\frac{\partial D_t}{\partial S_t}$ (the so-called Delta) &quot;shares&quot; of the &quot;stock&quot; $S_t$. &lt;br&gt; This strategy is used to &quot;replicate a bond&quot; in the derivation. &lt;br&gt;&lt;br&gt; Since $P_t$ should replicate a bond you will have to use this in your further derivation (an thus get an equation). Just continue to read the derivation and it will all come out.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2012-08-24T07:28:20.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4004" PostTypeId="2" ParentId="675" CreationDate="2012-08-24T15:45:13.677" Score="4" Body="&lt;p&gt;I reproduced Ledoit and Wolf's experiment outlined in their paper &quot;Honey I Shrunk the Covariance Matrix&quot; in Python which includes an implementation of their method to shrink the covariance matrix (can be found &lt;a href=&quot;https://github.com/strimp099/covshrink/blob/master/core/portfolio.py&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; see the &lt;code&gt;get_shrunk_covariance_matrix()&lt;/code&gt; method on line 417).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All the code for the entire thing is on Github &lt;a href=&quot;https://github.com/strimp099/covshrink&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. I make use of the cvxopt module in this process as well. My results are not exactly consistent with Ledoit and Wolf's probably because I was under tremendous time pressure to get this done and I didn't fully utilize cvxopt. Despite this, I use a lot of the functions and techniques you're looking for (I think) plus a lot of other methods that may prove useful for finance people.&lt;/p&gt;&#xA;" OwnerUserId="1112" LastEditorUserId="1112" LastEditDate="2012-08-27T21:09:49.143" LastActivityDate="2012-08-27T21:09:49.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4005" PostTypeId="2" ParentId="4001" CreationDate="2012-08-24T16:21:08.110" Score="2" Body="&lt;p&gt;&lt;strong&gt;1)&lt;/strong&gt; Instead of asking why the portfolio is equal to the premium, ask why create it at all? I say that because it actually isn't equal to the premium, since that would just be D, and also because the actual value isn't as important as what the portfolio represents.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We form this particular portfolio because the laws of no-arbitrage guarantee it has a certain rate of return (within a set of necessary assumptions). That gives us a constant point which we can exploit to solve the equation; without this observation, the equations aren't grounded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, the portfolio consists of a short derivative paired with an amount of stock such that the change in the derivative price due to the stock moving is exactly offset by these shares. That amount, represented here by the $\frac{{\partial D_t}}{{\partial S_t}}$ term, is called &quot;delta&quot;. Because of this pairing, the resulting portfolio is not exposed to risk (i.e. it has been hedged) and therefore we know it must return the risk-free rate. In a later step of the derivation, we will differentiate the portfolio value with respect to time and use this information to figure out what that is (unsurprisingly, it is simply a proportionate piece of the risk-free rate).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in sum: the portfolio is set up in such a way that we know how it behaves, a fact which we later use to anchor the differential equation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2)&lt;/strong&gt; This equation is valid for any derivative that is differentiable twice with respect to S (the stock price) and once with respect to t (time). We have made no assumptions yet about put or call. As you will see, delta for puts is between -1 and 0, so if the derivative were a put the stock component of this portfolio would be negative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0132777428&quot; rel=&quot;nofollow&quot;&gt;Hull's book&lt;/a&gt; really does a great job of explaining this, I suggest you pick up a copy if you haven't already.&lt;/p&gt;&#xA;" OwnerUserId="2843" LastActivityDate="2012-08-24T16:21:08.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4006" PostTypeId="2" ParentId="3301" CreationDate="2012-08-24T21:36:14.980" Score="2" Body="&lt;p&gt;Momentum and mean reversion are labels to describe the behavior of a stock relative to the time period under consideration. That means same stock can be a momentum stock at one point in time and mean reverting stock at different point in time. Similarly at same time, a stock can be both a momentum stock and mean reverting stock depending on which time frame one is looking at.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what helps is an objective criteria to determine when a stock is in momentum state and when it is in mean reversion state relative to your time frame. Detecting this can be as complicated or simple as you want to be. The precision would be the trade off. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't know if I can post a link but otherwise following link has one simple study of detecting momentum and mean reversion phases of a stock dynamically and trading them in tandem for lower draw down and higher return compared to individual strategies.&#xA;&lt;a href=&quot;http://www.atraderjournal.com/2012/07/study-strategy-diversification.html&quot; rel=&quot;nofollow&quot;&gt;Study: Strategy_Diversification&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2859" LastActivityDate="2012-08-24T21:36:14.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4007" PostTypeId="2" ParentId="3301" CreationDate="2012-08-24T23:30:30.223" Score="4" Body="&lt;p&gt;If you have a fairly good model of regime separation (of course requiring a good quantitative measure of regime state classifications -- momentum and reverting) and predictive likelihood (using something like a markov state transition matrix)-- one could weight contributions corresponding to next state probabilities.  Of course, you will rarely get a specific answer that is implemented because of the secretive nature of the business.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, there is ample evidence of funds using proprietary strategies, cloaked in vague terminology ( like trend neutral) that is testament to the idea that similar strategies are deployed in practice-)&lt;/p&gt;&#xA;" OwnerUserId="2860" LastEditorUserId="2860" LastEditDate="2012-08-24T23:35:59.903" LastActivityDate="2012-08-24T23:35:59.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4011" PostTypeId="1" CreationDate="2012-08-26T04:42:02.710" Score="2" ViewCount="1279" Body="&lt;p&gt;If i am considering the 0-5 year irs spread for the USD market, would it be more accurate to use the fed funds rate or the OIS rate? I believe the OIS rate is calculated based on the fed funds rate, but am not sure how the dynamics of the relation work.&lt;/p&gt;&#xA;" OwnerUserId="2865" LastEditorUserId="2814" LastEditDate="2012-08-27T06:56:44.547" LastActivityDate="2012-08-27T06:56:44.547" Title="Question on OIS and fed funds rate" Tags="&lt;interest-rates&gt;&lt;modeling&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4013" PostTypeId="1" CreationDate="2012-08-27T03:02:29.970" Score="11" ViewCount="14145" Body="&lt;p&gt;The subadditivity reads:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\rho(X_1+X_2) \leq \rho(X_1) + \rho(X_2)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the meaning of this condition? I can vaguely accept that one should diversify the investment portfolio. Or, I can understand that $\rho(X_1+X_2)$ describes the situation of two assets $X_1$ and $X_2$ held together. Then what is the meaning of $\rho(X_1) + \rho(X_2)$? One person holds $X_1$ and another person holds $X_2$? I am having difficulty to interpret the right-hand-side. &lt;/p&gt;&#xA;" OwnerUserId="494" LastActivityDate="2012-08-27T14:30:48.883" Title="What is the meaning of subadditivity in a risk measure?" Tags="&lt;coherent-risk-measure&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4014" PostTypeId="2" ParentId="4013" CreationDate="2012-08-27T04:01:01.940" Score="3" Body="&lt;p&gt;Rewriting the condition as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\rho\left({X_1+X_2 \over 2}\right) \leq {\rho(X_1) + \rho(X_2) \over 2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can interpret it as a portfolio containing the average holdings of two other portfolios has at most the risk of the average risk of the two other portfolios.  There is no need to have any concept of anyone actually holding any of the portfolios.&lt;/p&gt;&#xA;" OwnerUserId="1418" LastEditorUserId="1418" LastEditDate="2012-08-27T14:30:48.883" LastActivityDate="2012-08-27T14:30:48.883" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4015" PostTypeId="2" ParentId="4013" CreationDate="2012-08-27T04:42:02.313" Score="9" Body="&lt;p&gt;As you inferred, this is related to the concept of diversification as a risk-mitigation tool.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short, think of $\rho$ as representing some risk measure, and $\rho(x)$ as the risk of asset $x$ under that measure. If subadditivity holds, then the risk of holding assets 1 and 2 simultaneously must be less than or equal to the sum of their individual risks: $\rho(x_1 + x_2) \leq \rho(x_1) + \rho(x_2)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, volatility (standard deviation) is a subadditive risk measure. We know this intuitively from diversification: a portfolio is less volatile than the sum of its component volatilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As it relates to finance, subadditivity is one of the four axioms characterizing &quot;coherent&quot; measures of risk. This class of risk measures was introduced in &lt;a href=&quot;http://www.math.ethz.ch/~delbaen/ftp/preprints/CoherentMF.pdf&quot;&gt;Artzner et al, 1998&lt;/a&gt;, see the bottom of page 6. Think of these as risk measures with desirable properties that won't be subverted by strange-behaving portfolios. It's important to note that subadditivity is not a statement of fact -- it's easy to define risk measures that are not subadditive -- but rather an axiom that risk measures must satisfy in order to be coherent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Artzner describes subadditivity nicely as the idea that &quot;a merger does not create extra risk,&quot; and lists a number of practical points which follow from it. One interesting one is that if risk were &lt;strong&gt;not&lt;/strong&gt; subadditive, then a person wanting exposure to asset 1 and asset 2 would be better off opening a separate account for each asset, as the (risk-based) margin requirement would be lower than if he held both in the same account. (Note this can be seen as a very literal interpretation of the right hand side of the equation.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most (in)famous risk measure that does &lt;strong&gt;not&lt;/strong&gt; satisfy this axiom is VaR. The VaR of a portfolio of two assets can be greater than the sum of their individual VaRs. This is because VaR is a quantile-based measure; see the Artzner paper for examples.&lt;/p&gt;&#xA;" OwnerUserId="2843" LastEditorUserId="2843" LastEditDate="2012-08-27T11:54:49.793" LastActivityDate="2012-08-27T11:54:49.793" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4016" PostTypeId="2" ParentId="4011" CreationDate="2012-08-27T06:56:08.960" Score="1" Body="&lt;p&gt;The OIS rate is simply the price of an interest rate swap where you're swapping the fed funds rate (paid daily) for a fixed rate. For example if a 3 month OIS pays 2%, and the fed funds rate is currently 0.5% then what we're saying is you can enter into a swap (at zero price) where you will receive 2% and pay fed funds. If the fed funds rate goes up you pay more, if it goes down you pay less.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fed funds rate is quoted only as an overnight rate; if you're looking for a USD overnight rate you should use that. If you want a longer rate then you should look at OIS rates, which are quoted all the way out to 50 years (although I doubt there's much liquidity out there, it does appear on Bloomberg).&lt;/p&gt;&#xA;" OwnerUserId="2814" LastActivityDate="2012-08-27T06:56:08.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4017" PostTypeId="2" ParentId="4001" CreationDate="2012-08-27T12:17:54.107" Score="0" Body="&lt;p&gt;Say you have a portfolio with $\alpha$ dollars in cash and $\beta$ stocks at time $t=0$. The value of your portfolio at time $t$ is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P_t = \alpha e^{rt} + \beta S_t \tag{1} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Black-Scholes approach solve the following problem&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Can we find $(\alpha,\beta)$ such that the portfolio is self-financing and has final value equal to the payoff of the option ? If yes then -no arbitrage argument- the fair price of the option is the initial value of the portfolio.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The self-financing equation is (in continuous time) :&#xA;$$ dP_t = \alpha r e^{rt} dt + \beta dS_t \tag{2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value of $\alpha$ and $\beta$ are found using a purely mathematical derivation. We assume that $P_t=P(t,S_t)$ and use Itô formula :&#xA;$$ dP_t = \frac{\partial{P_t}}{{\partial t}} dt + \frac{\partial P_t}{\partial S} dS_t + \frac{1}{2}  \frac{\partial^2 P_t}{{\partial S^2}} d\langle S,S \rangle_t \tag{3}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking $\beta=\frac{\partial P_t}{\partial S}$ in $(2)$ and equalizing $(2)$ and $(3)$ yields the Black-Scholes PDE. The value of $P_t$ is the solution of this PDE, and the delta is the derivative of this solution w.r.t. its second argument, $S$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This approach does not use the fact that the option is a call option. You actually only need a payoff of form $f(S_T)$. If the payoff involves two underlying e.g. you can use similar approaches with $\alpha, \beta$ and $\gamma$ for the second underlying.&lt;/p&gt;&#xA;" OwnerUserId="2411" LastActivityDate="2012-08-27T12:17:54.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4018" PostTypeId="2" ParentId="3879" CreationDate="2012-08-27T14:59:28.420" Score="3" Body="&lt;p&gt;Pardon the lack of an actual link, and the formatting, but in footnote 6 of &lt;em&gt;&quot;Alpha is Volatility times IC times Score&quot;, Grinold, Richard C.,&lt;br&gt;&#xA;Journal of Portfolio Management, Summer 1994 v20 n4 p9(8)&lt;/em&gt;, Grinold suggests that &quot;a truly outstanding manager&quot; might have an information ratio of 1.33:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(6) A rough guideline for determining the required IC comes from Grinold&#xA;!1989^. If you have N stocks, then a truly outstanding manager who has&#xA;an information ratio of IR = 1.33 (corresponding to a t-stat of 3 over&#xA;five years) will need an IC (for each stock!) given approximately by IC&#xA;= {IR}/!(# of Stocks).sup.1/2^ = 1.33/!(500).sup.1/2^ = 0.06. Top quartile&#xA;might have (let's be generous) an information ratio of IR = 0.90 (t-stat&#xA;of 2 over five years); thus the IC of 0.04 = 0.9/!(500).sup.1/2^. These&#xA;numbers are rough guidelines. The guideline can tell us that for 500 stocks&#xA;and a quality manager ICs of 0.3 or 0.001 are out of range. The rough guideline&#xA;will not help us tell if 0.03 or 0.04 is a better choice.&lt;/p&gt;&#xA;" OwnerUserId="2871" LastActivityDate="2012-08-27T14:59:28.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4019" PostTypeId="1" CreationDate="2012-08-27T15:11:10.157" Score="15" ViewCount="5382" Body="&lt;p&gt;For a project, I am interested to model the impact of recently negative interest bonds on the portfolio.  The literature on modelling negative interest rates is limited, and the only theory I could find was the &quot;liquidity trap&quot; one and the plasma currency (software money taking place of the regular cash). Here there are some points (which might contradict themselves) about which I am asking for some actual formulae/algorithms, if you happen to know any: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value of higher presently outgoing cash flows is less important than the value of future incoming cash flows. This sounds to be the case for intertemporal rate marginal substitution (eg:  pensions), a model to model a margin and not the whole rate. From computational point of view, it can be seen as marking to the future market rather than marking to the presently observed market prices; with calculations to be done not in the base currency but into a different unit, not even necessarily a currency, and fit the number of such units at future times.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The discounting curves are generally inferred from zero coupon bonds, especially for short rates, where such zero coupon bonds exist. Given the recent governmental interest rate bonds, this implies that the discounting curve has to be negative, at least for short rates. It might be a possibility for their modelling to follow the one for positive rates, without taking care of the sign, modelling just the magnitude, via imaginary rates, that become negative the moment they are observed. But the negative interest rates modelling with a inversed(/mirrored in the region of negativity) Japanese style yield curve might not be optimal, given that it is based on the historically known inverse curves. The historical Japanese curves were due to short rates becoming larger than the longs ones and short positive rates stopped to increase by the government stepping in and lowering them. Such a move (lower the magnitude of negative rates) is difficult to be done, due to reserves constrains. In addition, the credit quality of the issuer might not be constant at the terms considered when comparing short-term to long-term interest rates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because the increase in magnitude of negative interest rate can be justified by an increase in the perceived credit risk, the momentum profitability will drive the future investments, leading at the observed market rate. For the high risk, momentum profitability decreases with size, so the A1 available volume might be capped by the specific credit rating of the portfolio's owner (entity).Moreover, the amount which can be borrowed by an entity is limited. Depositing now might be treated as collateral to borrowing in the future, therefore involved in calculations with an associated haircut. This might lead to a maximum depositing amount, with the magnitude of negative interest rates increment depending on the left size of the deposit-able amount. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The magnitude of the negative interested rate is correlated with the increase in fixed assets prices and with cross-currency basis spreads. Their volatility / correlation coefficients could be historically fitted. If credit  risk is to be considered completed integrated in the actually observed market prices, the change in the credit rate will trigger the change in the interest rate/market value, and no additional credit risk needs to be calculated, having an integrated market and credit risk. &#xA;Two options might be considered here: the negative interest rates evolution continues to be smooth, with rating states neglected in practice and only reflected in continuous spreads, or has jumps, reflecting the discrete credit rating system. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hoping that you could give your opinion and come with an actual mathematical documentation or ideas on how to model the influence of future negative rates on risk at the portfolio level, I am very much looking forward for your answer.&lt;/p&gt;&#xA;" OwnerUserId="2872" LastEditorUserId="2872" LastEditDate="2012-10-10T14:54:18.060" LastActivityDate="2014-07-16T17:01:06.507" Title="Modelling with negative interest rates " Tags="&lt;interest-rates&gt;&lt;modeling&gt;&lt;risk-management&gt;&lt;portfolio&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="4021" PostTypeId="1" CreationDate="2012-08-28T10:10:40.693" Score="9" ViewCount="218" Body="&lt;p&gt;I am a statistician (no solid background in finance). Please forward me to a book \ chapter \ paper to resolve the following general question.&#xA;Suppose we have a stock with the following monthly return distribution: P(R=1%)=0.999, P(R=10000%)=0.001. The mean monthly return is about 11%, which is very good. Still, for typical investors with short horizon (say, 1-2 years), the probability to get anything over 1% per month is very small, so the stock is not that attractive as the average return would imply. That means, the price of such a stock should go down until it reaches a more acceptable profile P(R=3%)=0.99; this stock will tend to have a lower P/E because of its uncomfortable return distribution. &#xA;Now suppose there is a thousand of such stocks, and their returns are independent. In this case, taken as a group, they have a good return profile (return jumps are no longer rare), so the group should not be punished with lower P/E. &#xA;So, should such a stock be priced individually (based on its return profile), or in a group of similar stocks?&lt;/p&gt;&#xA;" OwnerUserId="2874" LastEditorUserId="2843" LastEditDate="2012-08-29T04:00:59.900" LastActivityDate="2012-08-29T04:02:02.307" Title="St Petersburg lottery pricing &amp; short investing horizons" Tags="&lt;expected-return&gt;&lt;diversification&gt;&lt;asset-pricing&gt;&lt;risk-neutral-measure&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4022" PostTypeId="1" CreationDate="2012-08-28T11:00:19.703" Score="2" ViewCount="379" Body="&lt;p&gt;Are the inverted (Japanese style) governmental yield curves being a sign a recession/credit risk or should they be modelled as being due to a  lack of liquidity? (...with such curves evolving into a normally/positively-shaped yield curve, having more negative values for shorter horizons)&lt;/p&gt;&#xA;" OwnerUserId="2872" LastEditorUserId="2872" LastEditDate="2014-07-16T15:39:30.933" LastActivityDate="2014-12-13T17:29:36.427" Title="Is inverted Japanese style curve persistent when negative rates are real / market - observed?" Tags="&lt;risk-models&gt;&lt;negative&gt;&lt;interest&gt;&lt;rates&gt;" AnswerCount="1" CommentCount="6" CommunityOwnedDate="2012-10-10T10:15:40.603" ContentLicense="CC BY-SA 3.0" />
  <row Id="4023" PostTypeId="1" CreationDate="2012-08-28T11:16:33.063" Score="1" ViewCount="63" Body="&lt;p&gt;Observing the negative interest bonds in Switzerland, Denmark, GErmany the value of higher presently (credit-free) outgoing cash flows seems less important than the value of lower future (credit-free) incoming cash flows, when the time of the flows is chosen. This is also the case for intertemporal rate marginal substitution (eg: pensions), but such a model is used to model a margin rate and not the whole rate.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When using an utility function for example, does it make sense to optimize the portfolio not to maximize prezent value in base currency, but to minimize the error to get future liquidities right in the currencies of interest. Or you do not scale your prices to the base currency at all, but to future number units of a bond, which is the number you try to maximize. &lt;/p&gt;&#xA;" OwnerUserId="2872" LastEditorUserId="2872" LastEditDate="2012-10-10T14:41:29.027" LastActivityDate="2012-10-10T14:41:29.027" Title="Should portfolio be optimized by marking to the future than marking to market (excluding currencies)?" Tags="&lt;risk-models&gt;&lt;calibration&gt;&lt;negative&gt;&lt;interest&gt;&lt;rates&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4024" PostTypeId="1" AcceptedAnswerId="4062" CreationDate="2012-08-28T11:28:49.067" Score="1" ViewCount="100" Body="&lt;p&gt;The physical cash presence in the final transactions is one of the issues in the presently observed negative interest rates bonds. Such a situation has historically been modelled within the &quot;liquidity trap&quot; theory, forecasting the introducing of a unique plasma currency in order to solve inflational problems. But currently one is observing both  electronic-trading /credit cards/checks based- (software-) and physical money flows, with country-specific interchange rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the present netting system an additional netting is therefore showing up: the one of software cash flows. From the perspective of limited monetary mass, all the pricing instruments should have different formulae for the software and non-software settlement. The evolution of interest rates allowing for negative values need to be portfolio-specific and modeled taking into account not only the time, but also the frequency and the magnitude of the overall non-software flows. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would, in your opinion, dedicated pricing and modelling of the two different forms of cash flows make a difference? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought of seeing this extra netting in place, from the portfolio's owner point of view, by having the physical flows considered as observed values. The negatives (outgoing principals) will be discounted at the effective funding rate (the by-principal-weighted average of all the incoming/positive non-software flows) and the positives (deposited) should be discounted at the average opportunity of investing rate (the weighted-by-principal return rate of all the non-software future flows). The treasury's rates (where they exist) might be taken as a proxy for effective funding and opportunity of investing rates when calculating present value of non-software cash flows. This might be treated as a technical detail of what to do if differentiating the two, so not necessarily within this topic.      &lt;/p&gt;&#xA;" OwnerUserId="2872" LastEditorUserId="2872" LastEditDate="2012-08-31T13:41:07.093" LastActivityDate="2012-08-31T13:41:58.467" Title="Separated software and physical cash flows modelling and pricing to be used with negative interest rates?" Tags="&lt;interest-rates&gt;&lt;risk-models&gt;&lt;liquidity&gt;&lt;negative&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4029" PostTypeId="1" CreationDate="2012-08-28T12:44:01.043" Score="2" ViewCount="105" Body="&lt;p&gt;The magnitude of the negative interested rate should vary correlated with the increase in fixed assets prices and with cross-currency basis spreads. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could their volatility / correlation coefficients, as historically fitted for all the previous non-negative observed interest rates be reliable and considered in backtesting the model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would it not be better to consider low data sampling analysis and fit them only since negative interest rates (not negative forward ones) have been observed on the market? &lt;/p&gt;&#xA;" OwnerUserId="2872" LastEditorUserId="2872" LastEditDate="2012-09-07T12:48:21.817" LastActivityDate="2012-09-07T12:48:21.817" Title="Neglect the positive values in negative interest rates modelling?" Tags="&lt;interest-rates&gt;&lt;factor-models&gt;&lt;negative&gt;&lt;correlation-matrix&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4032" PostTypeId="1" AcceptedAnswerId="4035" CreationDate="2012-08-28T17:19:06.383" Score="2" ViewCount="1033" Body="&lt;p&gt;Retail trading platforms typically offer equity charts but only instantaneous quotes on options. It seems like even a few minutes of historical data would be useful when entering an order. Are charts not offered because traders don't use them, or do options traders typically subscribe to third party data sources for charts?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm aware of charts as devices to explain the value of an option contract with respect to the underlying. I'm interested in learning about why charts that show the historic price of a specific contract over time seem hard to find.&lt;/p&gt;&#xA;" OwnerUserId="2811" LastEditorUserId="2811" LastEditDate="2012-08-28T22:14:32.997" LastActivityDate="2012-08-29T04:39:50.823" Title="Why don't options traders use charts? Or do they?" Tags="&lt;options&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4033" PostTypeId="2" ParentId="2337" CreationDate="2012-08-28T18:00:29.907" Score="6" Body="&lt;p&gt;You could try using the Gaussian Affine Term Structure Models (GATSM), with the right boundary conditions to stop rates being negative (in the style of their Black implementation). See, for example, &lt;a href=&quot;http://www.stanford.edu/~piazzesi/s.pdf&quot; rel=&quot;noreferrer&quot;&gt;Monika Piazzesi, the &quot;Affine Term Structure Models&quot;&lt;/a&gt; if you want to enter/modify the basis or the work of Krippner, for example &lt;a href=&quot;http://www.rbnz.govt.nz/research/discusspapers/dp12_04.pdf&quot; rel=&quot;noreferrer&quot;&gt;&quot;Measuring the stance of monetary policy in zero lower bound environments&quot;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2872" LastEditorUserId="848" LastEditDate="2012-08-30T16:13:58.360" LastActivityDate="2012-08-30T16:13:58.360" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4035" PostTypeId="2" ParentId="4032" CreationDate="2012-08-29T01:02:04.317" Score="2" Body="&lt;p&gt;I suppose there is no right answer (and I'm not entirely sure this questions fits here) but try these two:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Given options are derivatives, their value is dependent on the underlying. So if you are taking a directional bet using options, you can use charts of the underlying because the option will follow.&lt;/li&gt;&#xA;&lt;li&gt;Professional options traders (and even serious ones) generally use options for risk management or taking bets that you cannot take with the underlying - such as on volatility. Therefore they will combine two or more contracts together making a chart of this type of position relatively worthless.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If you think about it, the &quot;hockey stick&quot; charts can really be considered a chart in time if you add a plot of BSM or some other pricing model. Also, you've probably seen surface charts associated with options positions. These often have an axis in time as well.&lt;/p&gt;&#xA;" OwnerUserId="1112" LastActivityDate="2012-08-29T01:02:04.317" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4036" PostTypeId="2" ParentId="647" CreationDate="2012-08-29T02:01:58.730" Score="3" Body="&lt;p&gt;There is a Python library for this that you may want to take a look at: &lt;a href=&quot;http://gbeced.github.com/pyalgotrade/&quot; rel=&quot;nofollow&quot;&gt;http://gbeced.github.com/pyalgotrade/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2879" LastActivityDate="2012-08-29T02:01:58.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4037" PostTypeId="2" ParentId="647" CreationDate="2012-08-29T03:11:42.890" Score="1" Body="&lt;p&gt;I'm a big fan of python over the competitors as well. I use the pysci &amp;amp; matplotlib libraries heavily which are all open source albeit not specifically designed for optimizations but solid for visualizations &amp;amp; fast analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another part of making a transition for me, was the ease of use on the Mac. It's native although I do use macports (very easy install) for several other projects &amp;amp; it augments my development environment nicely. Macports provides a huge catalogue of modules easily installed with 1 command &amp;amp; dependency resolution (no *nix package mgmt. hell) &amp;amp; of course all of the IDE's work nicely (I use VIM). Git is native, debugging is very mature, &amp;amp; if you can get over strict indentation (macros or IDE's help) then it's typically quite readable code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Never posted before but have lurked for months so hopefully this contribution helps.&lt;/p&gt;&#xA;" OwnerUserId="2880" LastActivityDate="2012-08-29T03:11:42.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4038" PostTypeId="2" ParentId="4021" CreationDate="2012-08-29T03:50:50.713" Score="3" Body="&lt;p&gt;What a great question -- it touches on many issues at the core of quantitative finance. This answer might be a lot more than you bargained for, but it's too interesting to pass up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mostly, this subject falls somewhere at the intersection of these three highly-interrelated topics: &lt;a href=&quot;http://en.wikipedia.org/wiki/Risk-neutral_measure&quot; rel=&quot;nofollow&quot;&gt;risk-neutral valuation&lt;/a&gt;, &lt;a href=&quot;http://en.wikipedia.org/wiki/Rational_pricing&quot; rel=&quot;nofollow&quot;&gt;rational pricing&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/Fundamental_theorem_of_asset_pricing&quot; rel=&quot;nofollow&quot;&gt;the fundamental theorem of asset pricing&lt;/a&gt;. &lt;em&gt;In short: the prices investors are willing to pay depend on perceived risks. So, how can we decide what risks determine prices?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As your question illustrates, risk-neutral pricing is one of the most difficult areas to grasp, as it often defies intuition. As such, it is rather hard to find papers that aren't full of math or that require little knowledge of finance. However, I think these three may fit the bill:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=290044&quot; rel=&quot;nofollow&quot;&gt;Risk Neutral Valuation: A Gentle Introduction (Part 1)&lt;/a&gt; -- This appropriately-titled but lengthy piece uses a situation similar (but not the same! see below) to the one you describe to motivate its analysis.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.ams.org/notices/200405/what-is.pdf&quot; rel=&quot;nofollow&quot;&gt;What is... a Free Lunch?&lt;/a&gt; -- A very quick, largely non-academic introduction to the arbitrage-free pricing and the fundamental theorem of asset pricing. It's brevity may make it a tempting starting place, but it might be better to read it second, as it is more applied than the first reference. Note also that the words &quot;risk-neutral&quot; don't appear anywhere in it despite forming the crux of its argument; remember I said these topics are quite related.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1395390&amp;amp;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1395390&quot; rel=&quot;nofollow&quot;&gt;Risk-Neutral Probabilities Explained&lt;/a&gt; -- This one is probably the most complete treatment, and starts in a more traditional manner using Arrow securities. In disclosure, I wasn't familiar with this one before answering your question, but I found it paired with my first choice on the Wikipedia page for rational pricing, and after reading it thought it would be appropriate.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Some Background&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if you're still reading -- or still care --  I'll try to flesh out why these fields are related to your question. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You hit the nail on the head: people have subjective judgements of value, based on risk aversion or their own reads of outcome probabilities. Moreover, these opinions are swayed by context (as you set up with a portfolio, or a short horizon). That's hardly the basis for an objective pricing framework, and yet we know that risk impacts price. How can we make claims about pricing if we can't even agree on where to start?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Our jumping-off point is the idea that a security's price is the expectation of its future value. To a single investor, that value is conditional on a set of subjectively-determined probabilities. The motivation for rational or risk-neutral pricing is to find the set of probabilities under which any investor becomes indifferent to risky outcomes (hence, &quot;risk-neutral&quot;). While that may sound like replacing one problem with another one, there are actually very few ways to do that consistently across all securities in the market, meaning without allowing arbitrage opportunities to arise. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;More explicitly, a risk-neutral probability measure makes the expected return on an asset equal to the prevailing risk-free rate. As long as a market is &quot;complete&quot;, then the risk-neutral probability measure can be derived for all assets at once, resulting in a unified -- and objective -- pricing framework. The lightbulb really went off in 1979, when Cox, Ross and Rubenstein first &lt;a href=&quot;http://en.wikipedia.org/wiki/Binomial_options_pricing_model&quot; rel=&quot;nofollow&quot;&gt;used these ideas to price options&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note -- I don't expect to have convinced anyone with these few paragraphs; please see the attached references for a complete explanation!&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, the truth is that your question is somewhat boring, in an asset pricing sense, because you have specified the complete return distribution of the security in question. (In fact, I would argue that in many ways, the role of a quant comes down to estimating return distributions.) The fundamental theorem tells us that the asset price must therefore be its (objective) expected value, or arbitrage opportunities would result. Things become much more interesting if we didn't know the probabilities, or the future prices, or both -- and that's the reason risk-neutral pricing was developed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;A more direct answer, kind of...&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, though risk-neutral probabilities are derived from the many securities in a market, I don't consider that the same as your question's &quot;price as a portfolio&quot; option. It is rare to find a security that prices completely in isolation; interest rates or other underliers usually play some role. Generally, as long as those components are known to be arbitrage-free, there is no need to go through the risk-neutral exercise when pricing someone that derives from them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, I interpret your question as using the portfolio as a means to alter perceived risk; you could have as easily increased horizon and not invoked other securities. So to be clear, I'm treating your question as asking &quot;how do different perceived risks impact security prices&quot; rather than &quot;are securities priced in isolation or in a portfolio context?&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the answer might actually be (c) none of the above: securities are priced individually, but in risk-neutral market contexts. For all intents and purposes, I believe this resolves to your &quot;individual&quot; pricing, but perhaps for a different reason than you expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;...and a Little MPT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, as a statistician you may be interested in how to quantify the subjective aspects of your question. This comes down to the increasingly-misnamed &quot;modern portfolio theory&quot;, introduced in 1952 and for which Harry Markowitz won a Nobel Prize. Note that while these concepts are very important, I'd be surprised if you found a professional using them in practice today.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's generalize your question by saying that these securities, call them $S$, have a binomial distribution with probability $p$. If we consider multiple holding periods then they would be Bernoulli-distributed, but since that will come out to a linear scale I disregard it here. One security's expected return is therefore $p$ with variance $p(1-p)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Compare that to holding a portfolio of $n$ such securities, allocating $\frac{1}{n}$ of your capital to each. The expected portfolio return is&#xA;$$E[ \sum^n\frac{1}{n}S] = E[S] = p$$&#xA;and its variance is&#xA;$$Var[\sum^n\frac{1}{n}S] = \frac{Var[S]}{n} = \frac{p(1-p)}{n}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is diversification at work! Same expected return, but lower volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You ask: if this new portfolio is obviously better, shouldn't I pay more for it? And traders immediately start lining up to sell it to you in a particularly expensive illustration of the law of no-arbitrage.&lt;/p&gt;&#xA;" OwnerUserId="2843" LastEditorUserId="2843" LastEditDate="2012-08-29T04:00:22.150" LastActivityDate="2012-08-29T04:00:22.150" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4039" PostTypeId="2" ParentId="4021" CreationDate="2012-08-29T04:02:02.307" Score="1" Body="&lt;p&gt;This may or may not be helpful, since I don't have anything to point you to that specifically addresses the high skewness of the distribution you mention.  However, this sounds like it is probably an idiosyncratic risk, and that certainly has bearing on whether or not it would be priced.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the standard capital asset pricing model, the marginal investor holds something close to the market portfolio and so all that matters is an asset's covariance with the market portfolio.  So as long as the probability of the good event is independent of the overall performance of the market portfolio, the textbook finance answer is that an idiosyncratic risk like this would be diversified away and therefore the stock would be priced based on expected value (as long as it is small relative to the market portfolio).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice things aren't quite so clear, and idiosyncratic risk might be priced after all (so the stock would trade at a discount).  See for instance Malkiel and Xu (2006): &lt;a href=&quot;http://www.utdallas.edu/~yexiaoxu/IVOT_H.PDF&quot; rel=&quot;nofollow&quot;&gt;http://www.utdallas.edu/~yexiaoxu/IVOT_H.PDF&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then again others have found that stocks with high idiosyncratic volatility actually have lower expected returns, as in Ang, Hodrick, Xing and Zhang (2006).&lt;/p&gt;&#xA;" OwnerUserId="2825" LastActivityDate="2012-08-29T04:02:02.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4040" PostTypeId="2" ParentId="4032" CreationDate="2012-08-29T04:39:50.823" Score="0" Body="&lt;p&gt;I think the answer depends on the trader's methodology and who you mean by &quot;option trader&quot;. For example, some traders place directional bets using options/leaps when the structure of market points to early trend stage on longer time frame. Or when a market is over extended but no clear point to place a stop. In both these cases, chart of the underlying market is more useful to plan and decide the trade. Option price chart here is more to refine the order price (if needed).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On other hand, I suspect traders whose methodology relies on capturing premiums for positive edge would probably use various option charts besides option price chart and also rely on math more. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in short, there is no one right answer as suggested by above two excellent comments.&lt;/p&gt;&#xA;" OwnerUserId="2859" LastActivityDate="2012-08-29T04:39:50.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4042" PostTypeId="1" AcceptedAnswerId="4107" CreationDate="2012-08-29T12:48:18.503" Score="5" ViewCount="201" Body="&lt;p&gt;After the 1987 crash, the S&amp;amp;P500 index implied volatility changed from nearly flat to negatively sloped. According to &lt;a href=&quot;http://www.haas.berkeley.edu/groups/finance/WP/rpf232.pdf&quot; rel=&quot;nofollow&quot;&gt;Rubinstein&lt;/a&gt; the Black-Scholes model was not so wrong when applied to the S&amp;amp;P500 before 1986-87.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am wondering if there are still indexes or stocks around the world that present almost flat implied volatility. I have the feeling this should be true in emerging countries where the risk of crash is lower (no electronic-trading, less globalization of exchanges and thus less systematic risk) but I did not find any evidences online yet.&lt;/p&gt;&#xA;" OwnerUserId="2411" LastEditorUserId="2411" LastEditDate="2012-08-29T14:36:44.243" LastActivityDate="2012-09-11T20:42:51.923" Title="Indexes/stocks with flat implied volatilities" Tags="&lt;equities&gt;&lt;implied-volatility&gt;&lt;index&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4043" PostTypeId="1" CreationDate="2012-08-29T13:38:03.047" Score="4" ViewCount="749" Body="&lt;p&gt;Suppose most investors have very short investing horizons and use appropriate (for them) strategies, but investor X has a very long horizon. He would like to trade some advantages (early withdrawal option, low draw-downs, etc) for the long-term return. What are theoretical approaches to model and answer this question? How should it be quantified? What are practical ways to do this?&lt;/p&gt;&#xA;" OwnerUserId="2874" LastActivityDate="2013-11-24T03:20:36.787" Title="Long-term vs short-term strategies \ investing" Tags="&lt;risk&gt;&lt;risk-models&gt;&lt;general&gt;&lt;investing&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4044" PostTypeId="2" ParentId="5" CreationDate="2012-08-29T15:35:20.870" Score="5" Body="&lt;p&gt;Via Liquidity Horizons $LH$ (which have to be taken into consideration anyway when modelling for $Basel_3$) as function of the specific concentrations $c$'s. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Increasing the effective maturity of the contract, $M_0+LH_0$, by a quantity proportional to its concentrations with respect to different slicings magnifies the credit risk. $M_0$ is the maturity specified for the contract, $LH_0$ is the LH originally assigned (in the absence of concentration risk/interactions with other contracts).   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The maturity is simullated to be within $[M_0+LH_0, M_0+ LH_0 + {\Delta}LH)$ having, let's say,&#xA;${\Delta}LH=w_{creditState}*c_{creditState} + w_{industry}*c_{industry}+w_{region}*c_{region}+...$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The weights $w$s are to be chosen as per $Basel_3$ directives. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The presence of a horizon $LH$s selling period has to get reflected anyway/icebergs detection while deterministic selling point in time time/maturity of the contract as a point in time generates modelling risk.&lt;/p&gt;&#xA;" OwnerUserId="2872" LastEditorUserId="2872" LastEditDate="2014-07-16T15:52:43.620" LastActivityDate="2014-07-16T15:52:43.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4045" PostTypeId="1" CreationDate="2012-08-29T15:59:20.597" Score="4" ViewCount="1252" Body="&lt;p&gt;I am interested in hearing about the practitioner state of the art for testing the time independence of a VaR model (i.e. that VaR violations are independent in time).  There are a number of tests in the literature.  What do people actually use?  Which are viewed as the most powerful and useful in the real world?  I'm interested in hearing about what kinds of specific quantitative criteria people might use to cause them to re-evaluate their VaR model's current ability to handle violation clustering.&lt;/p&gt;&#xA;" OwnerUserId="915" LastEditorUserId="92" LastEditDate="2012-12-03T19:15:24.347" LastActivityDate="2017-06-16T23:52:50.150" Title="Backtesting VaR model violation independence" Tags="&lt;volatility&gt;&lt;var&gt;&lt;garch&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4046" PostTypeId="2" ParentId="4045" CreationDate="2012-08-30T08:23:37.223" Score="3" Body="&lt;p&gt;The following thesis deals with VaR back testing procedures in the Basel framework &lt;a href=&quot;http://essay.utwente.nl/59173/1/scriptie_G_van_Roekel.pdf&quot; rel=&quot;nofollow&quot;&gt;link&lt;/a&gt;. In chapter 7 tests for violation clustering are presented.&#xA;An R implementation of the runs test is e.g. given in the &lt;a href=&quot;http://cran.r-project.org/web/packages/tseries/tseries.pdf&quot; rel=&quot;nofollow&quot;&gt;tseries package&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2012-08-30T08:23:37.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4047" PostTypeId="1" AcceptedAnswerId="4058" CreationDate="2012-08-30T08:36:02.837" Score="7" ViewCount="762" Body="&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Benford%27s_law&quot;&gt;Benford's law&lt;/a&gt; has been applied in various ways for detecting fraud (e.g. elections or accounting). But what are the most useful applications of Benford in quantitative finance? Are there any? I have seen papers trying to apply Benford in this context but it often feels a bit &quot;forced&quot;.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2012-08-31T14:50:57.250" Title="Benfords law and quantitative finance" Tags="&lt;distribution&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4048" PostTypeId="2" ParentId="4042" CreationDate="2012-08-30T10:03:06.983" Score="1" Body="&lt;p&gt;The negative slope is not just because people think there is going to be a crash, it is also just function of supply and demand on options:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Many investors want to buy protection on their portfolio, and there is no natural seller so it's the speculator who end up taking that side of the bet, but obviously only if there is a sufficient premium&lt;/li&gt;&#xA;&lt;li&gt;with low interest rate, people have less money to spend when they do capital guaranteed structures, so whenever they buy puts they will usually also sell calls to cheapen the total option price. This again will create extra supply&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Besides, the thing about lack of automated trading in some emerging markets might be true, but that might not necessarily mean reduced crash risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the reasons that the vol of an index goes up when the index goes down is that people just trade all the constituents without much discrimination, which pushes the correlation up, hence the vol of the index. That might actually be worse when performed manually by humans than when done by machines which could potentially correct for imbalances between shares (i.e. sell bad ones and refrain from selling good ones).&lt;/p&gt;&#xA;" OwnerUserId="2599" LastActivityDate="2012-08-30T10:03:06.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4049" PostTypeId="1" CreationDate="2012-08-30T10:26:43.190" Score="9" ViewCount="2168" Body="&lt;h1&gt;Summary&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;For Heston model parameters that render the variance process constant, the solution should revert to plain Black-Scholes. Closed from solutions to the Heston model don't seem to do this, even though the dynamics clearly do. Can anyone see how to resolve this? I care because I'm getting incorrect results for four independent implementations spanning three completely different methods of approaching the problem, but &lt;em&gt;not&lt;/em&gt; getting incorrect results for Monte Carlo pricing based on time evolution of the SDEs.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Details&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I am implementing some option pricers based on the Heston model and using different methods:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Monte Carlo simulation&lt;/li&gt;&#xA;&lt;li&gt;The original closed-form solution presented in Heston 1993&lt;/li&gt;&#xA;&lt;li&gt;The Green's function as presented in &lt;a href=&quot;http://eprints.maths.ox.ac.uk/718/1/Sensen_Lin_thesis.pdf&quot;&gt;this very nice MSc thesis&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Fourier methods&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Unfortunately what I am finding is that while the final three (semi-)analytical solutions agree with one another, they do not agree with the Monte Carlo simulation and my intuition about the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the Heston dynamics:&#xA;$$&#xA;    dS_t = \mu S_t,dt + \sqrt{\nu_t} S_tdW^S_t,\\&#xA;    d\nu_t = \kappa(\theta - \nu_t)dt + \sigma \sqrt{\nu_t}dW^{\nu}_t,\\&#xA;    dW^S_t dW^{\nu}_t = \rho dt\\&#xA;$$&#xA;it is clear that if we simply choose our parameters for the variance process $\nu_t$ such that it remains constant ($d\nu_t = 0, \nu_t = \nu_0$), we should return to the plain Black-Scholes dynamics&#xA;$$&#xA;    dS_t = \mu S_tdt + \sqrt{\nu_0} S_tdW^S_t .&#xA;$$&#xA;From this we can derive the analytical solution in the usual way and up with the following&#xA;$$&#xA;    C(S,t) = \mathcal{N}(d_1)~S-\mathcal{N}(d_2)~K e^{-r \tau} \\&#xA;    d_1 = \frac{\ln(\frac{S}{K})+(r+\frac{\nu_0}{2})(\tau)}{\sqrt{\nu_0}\sqrt{\tau}} \\&#xA;    d_2 = \frac{\ln(\frac{S}{K})+(r-\frac{\nu_0}{2})(\tau)}{\sqrt{\nu_0}\sqrt{\tau}} = d_{1}-\sqrt{\nu_0}\sqrt{\tau}.&#xA;$$&#xA;This is all well and good and is the reason that I feel comfortable in claiming that my three different implementations of the semi-analytical Heston solution must be wrong, despite their accord with one another. Further, the Monte Carlo simulation of the model &lt;em&gt;does&lt;/em&gt; give the same price as the Black-Scholes equation in this case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Analogous to the Black-Scholes model, the solution of Heston model as given in the original paper is of the form&#xA;$$&#xA;    C(S,v,t) = S P_1 - K e^{-r(\tau)} P_2,&#xA;$$&#xA;where&#xA;$$&#xA;    P_j = \frac{1}{2} + \frac{1}{\pi} \int^\infty_0 Re [ \frac{e^{-i \phi ln(K)} f_j(x,\nu,T,\phi)}{i \phi} ] d \phi, \\&#xA;    f_j = e^{C + D \nu + i \phi x}, \\&#xA;    C = r \phi i \tau + \frac{\kappa \theta}{\sigma^2} {(b_j - \rho \sigma \phi i + d)\tau - 2 \log [\frac{1-ge^{d \tau}}{1-g} ] }, \\&#xA;    D = \frac{b_j - \rho \sigma \phi i + d}{\sigma^2} [ \frac{1-e^{d \tau}}{1-ge^{d \tau}} ], \\&#xA;    g = \frac{b_j - \rho \sigma \phi i + d}{b_j - \rho \sigma \phi i - d}, \\&#xA;    d = \sqrt{(\rho \sigma \phi i - b_j)^2 - \sigma^2(2 u_j \phi i - \phi^2)}, \\&#xA;    b_1 = \kappa - \rho \sigma \; \; \; b_2 = \kappa, \\&#xA;    u_1 = \frac{1}{2} \; \; \; u_2 = - u_1.&#xA;$$&#xA;so it seems rather apparent that for cases where the Heston model is equivalent to Black-Scholes, we must have $P_1 = \mathcal{N}(d1)$ and $P_2 = \mathcal{N}(d2)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To demonstrate, let's take $ \theta = \nu_0, \sigma = 0 $, implying $\forall \nu_0, d\nu_t = 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When just considering the Heston dynamics, these parameters work nicely and everything is well behaved. The semi-analytical solutions, however, are plagued with division-by-zero (ex. $g$) and can't be handled directly. So instead we simply want to take them in the limit as $\sigma \to 0$. This is where it gets tricky now, as we're left with some very complicated formulas and no apparent link to $\mathcal{N}(d_j)$. I tried Mathematica's rather powerful symbolic calculus capabilities, but it was unable to show equality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Testing some other limiting cases, I've made the following observations:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;For $\nu_0 \to 0$, all methods converge on the correct price (Black Scholes).&lt;/li&gt;&#xA;&lt;li&gt;For low strikes, $K \to 0$, all methods converge on the correct price ($S_0$).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;To me, this suggests that the problem is in $P_2$, but that's all I have so far.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What direction should I take next?&lt;/p&gt;&#xA;" OwnerUserId="2440" LastEditorUserId="2440" LastEditDate="2012-08-30T14:54:59.433" LastActivityDate="2014-03-04T16:43:22.613" Title="Can the Heston model be shown to reduce to the original Black Scholes model if appropriate parameters are chosen?" Tags="&lt;option-pricing&gt;&lt;modeling&gt;&lt;black-scholes&gt;&lt;stochastic-volatility&gt;&lt;heston&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="4050" PostTypeId="2" ParentId="998" CreationDate="2012-08-30T11:28:20.187" Score="6" Body="&lt;p&gt;Given their choice in hiring mainly academics from the fields of NLP and cryptography(at least in their early days), my guess is that they have been using something derived from information theory and/or hidden markov models.&lt;/p&gt;&#xA;" OwnerUserId="2886" LastActivityDate="2012-08-30T11:28:20.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4051" PostTypeId="1" CreationDate="2012-08-30T12:50:41.363" Score="2" ViewCount="163" Body="&lt;p&gt;I am trying to locate historical volatility data (5+ years) for Brent Crude?  Does anyone know where I might be able to source such data?&lt;/p&gt;&#xA;" OwnerUserId="2887" LastEditorUserId="35" LastEditDate="2012-08-30T13:17:17.747" LastActivityDate="2012-08-30T13:17:17.747" Title="Brent Crude Data" Tags="&lt;options&gt;&lt;volatility&gt;&lt;data&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4052" PostTypeId="2" ParentId="4051" CreationDate="2012-08-30T13:05:54.643" Score="2" Body="&lt;p&gt;Perhaps this site can help &lt;a href=&quot;http://www.eia.doe.gov/&quot; rel=&quot;nofollow&quot;&gt;http://www.eia.doe.gov/&lt;/a&gt;. It is a little confusing to navigate, but the prices are here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://tonto.eia.doe.gov/dnav/pet/pet_pri_spt_s1_d.htm&quot; rel=&quot;nofollow&quot;&gt;http://tonto.eia.doe.gov/dnav/pet/pet_pri_spt_s1_d.htm&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2512" LastActivityDate="2012-08-30T13:05:54.643" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4053" PostTypeId="2" ParentId="3806" CreationDate="2012-08-30T15:16:07.013" Score="3" Body="&lt;p&gt;The two are not equivalent, because of the cross-currency basis spread (CCBS), which became a risk factor in itself sice 2007, and does depend on term. This practically leeds to a difference in your constantly-assumed notionals (the notional is not constant anymore). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What it happens is that you assume having a constant notional cross-currency swap that exchanges a risk-free overnight rate in one curreny for a risk-free overnight rate in another currency. In reality, one exchanges benchmark rates (say LIBOR), so you should imagine having three swaps: a cross-currency basis spread overnight risk-free rates, a money market basis swap of domestic LIBOR versus domestic overnight risk-free rates and a money market basis swap of foreign LIBOR versus foreign overnight risk-free rates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This change in notional can actually be seen when doing a mark-to-market cross currency swap instead of your standard one. &lt;/p&gt;&#xA;" OwnerUserId="2872" LastEditorUserId="2872" LastEditDate="2012-09-19T12:34:05.590" LastActivityDate="2012-09-19T12:34:05.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4054" PostTypeId="2" ParentId="970" CreationDate="2012-08-30T19:38:04.427" Score="1" Body="&lt;p&gt;The weights are, by definition, positive, and add to do normalization to the total amount the wights are calculated for.  The title of the question does not make sense. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, what it happend in your case is that you have bought 4 and sold 2, and in the end, you have remained with 2 bought ones.  Between T0 and T_final you have paid $P&amp;amp;L= -4*100+ 2*120 = -400 + 240 =-160$ and you are left with 2. Therefore their (net) price is $-160/2=-80$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question here is more about the fact of selling the TWO actions because you HAD FOUR actions and because you wanted to be left with TWO actions in the end. And selling them at 110 because you have bought them at 100. In practice you have 100=100(4) and 120=120(2) - the number you buy/sell does influence the price. The events are not indipendent, so you can not apply &quot;normal&quot; averaging and weighting, but you have to work with bayesian statistics. &lt;/p&gt;&#xA;" OwnerUserId="2872" LastActivityDate="2012-08-30T19:38:04.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4055" PostTypeId="2" ParentId="4045" CreationDate="2012-08-30T19:45:11.497" Score="2" Body="&lt;p&gt;The Kupiec test is frequently used to back test VaR values. I would refer you to read this article from the federal reserve&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.federalreserve.gov/pubs/feds/2005/200521/200521pap.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.federalreserve.gov/pubs/feds/2005/200521/200521pap.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="1764" LastEditDate="2012-09-04T16:47:59.787" LastActivityDate="2012-09-04T16:47:59.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4057" PostTypeId="1" CreationDate="2012-08-31T07:06:34.927" Score="12" ViewCount="1699" Body="&lt;p&gt;Here is a very interesting question that I found at &lt;a href=&quot;http://www.nuclearphynance.com/Show%20Post.aspx?PostIDKey=162594#162596&quot;&gt;Nuclear Phynance&lt;/a&gt; (original author: &lt;a href=&quot;http://www.nuclearphynance.com/User/Show%20User%20Details.aspx?UserIDKey=63&quot;&gt;Strange&lt;/a&gt;); I though it is so interesting that it is worthwhile to ask it here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have $N$ strategies, across a variety of assets and time frames (from intra-day to month holding times). Each strategy is sort-of-kind-of market-neutral and mostly carrying idiosyncratic risk. Since we all know it's not really true, I do evaluate the market-factor risk for each strategy position (delta, vega, correga, whatever applicable) to get an understanding of my gap/systemic risk. On the other hand, strategies do go boom because of idiosyncratic reasons - some stock goes bust like Enron in one of my single name strategies or maybe Obama decides to sell tons of S&amp;amp;P skew to improve the morale. This is non-controllable risk that I simply need to diversify away.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, this brings multiple questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;assuming that I got the market-risk modeling under control, how do I assign an idiosyncratic risk value to a strategy? I was thinking of some sort of Poisson process, but can't even think of how to properly combine multiple distributions in that case.&lt;/li&gt;&#xA;&lt;li&gt;is there a clean way to construct a portfolio allocation model that on one hand will neutralize market risk but on the other hand would keep idiosyncratic risk diverse enough for me to sleep at night?&lt;/li&gt;&#xA;&lt;li&gt;how do i include the dynamic nature of each strategy in the allocation process? For example, some strategies are expiration-date specific, some fire fairly infrequently etc. Do I allocate hard dollars? Do I look at the new signals and allocate given the current risk in the portfolio? &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2017-08-15T12:56:00.097" Title="Strategy Risk and Portfolio Allocation Model (copy from nuclear phynance)" Tags="&lt;portfolio-selection&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="4058" PostTypeId="2" ParentId="4047" CreationDate="2012-08-31T07:14:08.347" Score="3" Body="&lt;p&gt;By accident i stumbled upon a new work submitted yesterday (http://arxiv.org/abs/1208.5896).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems most papers are talking about a specific dataset following Benfords law. But that seems not to be what you are looking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should look into this bibliography here ( about Benford's law in general):&#xA;&lt;a href=&quot;http://arxiv.org/abs/math/0607168&quot; rel=&quot;nofollow&quot;&gt;http://arxiv.org/abs/math/0607168&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are also some (quantitative) finance related works in there (although rare). Most publications are pure mathematics though...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit:&#xA;Here are some references out of the bibliography related to the subject &lt;br&gt;&#xA;&lt;a href=&quot;http://www.google.at/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;frm=1&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;ved=0CCQQFjAA&amp;amp;url=http%3A%2F%2Fwww.uic.edu%2Fclasses%2Factg%2Factg315zhang%2Froundmkt.pdf&amp;amp;ei=PcdAUPDxGdCb1AX06ICoBQ&amp;amp;usg=AFQjCNHOBSqQ0ZEKGCOVHIul3k9zE5KZrA&quot; rel=&quot;nofollow&quot;&gt;http://www.google.at/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;frm=1&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;ved=0CCQQFjAA&amp;amp;url=http%3A%2F%2Fwww.uic.edu%2Fclasses%2Factg%2Factg315zhang%2Froundmkt.pdf&amp;amp;ei=PcdAUPDxGdCb1AX06ICoBQ&amp;amp;usg=AFQjCNHOBSqQ0ZEKGCOVHIul3k9zE5KZrA&lt;/a&gt;&#xA;(Das, S. and H. Zhang (2001). The stock market’s under-reaction to rounding-up in EPS)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the hypothesis of psychological barriers in stock markets and Benford's Law&#xA;&lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S0927539897000248&quot; rel=&quot;nofollow&quot;&gt;http://www.sciencedirect.com/science/article/pii/S0927539897000248&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Doucouliagos, C. (2004). Number preference in Australian stocks. Applied Financial&#xA;Economics 14(1), 43-54.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Herrmann, D. and W.B. Thomas (2005). Rounding of analyst forecasts. The Accounting&#xA;Review&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Those were the first i found.&#xA;Ley, E. (1996). On the peculiar distribution of the U.S. Stock Indices Digits. The American&#xA;Statistician 50(4), 311-313.&#xA;&lt;a href=&quot;http://www.jstor.org/discover/10.2307/2684926?uid=3738032&amp;amp;uid=2&amp;amp;uid=4&amp;amp;sid=21101183172427&quot; rel=&quot;nofollow&quot;&gt;http://www.jstor.org/discover/10.2307/2684926?uid=3738032&amp;amp;uid=2&amp;amp;uid=4&amp;amp;sid=21101183172427&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://libra.msra.cn/Publication/2739922/are-there-psychological-barriers-in-the-dow-jones-index&quot; rel=&quot;nofollow&quot;&gt;http://libra.msra.cn/Publication/2739922/are-there-psychological-barriers-in-the-dow-jones-index&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Several more interesting sources can be found in there - but they are more method-related (i found time series, machine learning and various other mathematical subjects). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most of the publications seem to deal with fraud in reporting/accounting and experimental data though. &lt;/p&gt;&#xA;" OwnerUserId="2727" LastEditorUserId="2727" LastEditDate="2012-08-31T14:50:57.250" LastActivityDate="2012-08-31T14:50:57.250" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4060" PostTypeId="1" CreationDate="2012-08-31T08:24:38.860" Score="3" ViewCount="572" Body="&lt;p&gt;Several sources (online and offline) that discuss the delta of a listed vanilla option, state that its delta is a (guesstimate?) of the probability of said option expiring ITM (in the BSM framework).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, looking at the derivation of delta from the BS model (and its variants), it is not obvious (atleast to me), that the delta can be used as a proxy for the probability of ITM expiry. I want to know if there is any supporting evidence (theoretical or otherwise), that lends at least some credence to this assertion - or is it just an &quot;old wives tale&quot; ?&lt;/p&gt;&#xA;" OwnerUserId="1733" LastActivityDate="2012-08-31T14:22:42.043" Title="Is there any evidence that an option delta approximates ITM expiry probability?" Tags="&lt;options&gt;&lt;greeks&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4061" PostTypeId="1" CreationDate="2012-08-31T08:42:12.107" Score="4" ViewCount="2026" Body="&lt;p&gt;I am running an options book containing listed options across multiple products. I trade mostly equity and index related options - with a preference for European expiration products. I trade products listed across multiple continents - so there is an FX risk component as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have lots of spreadsheets etc which I use for adhoc risk management controls - typically, looking at the sensitivities of a single product (e.g. SPY book). Typically, I have a single workbook detailing the positions for a single product, and I use the greeks for risk management purposes. However, as my portfolio increases, I have decided it is time to implement a more &#xA;consolidated approach to risk management.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like some guidance on how to:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Consolidate option sensitivities (i.e. across the entire portfolio as opposed to single products)&lt;/li&gt;&#xA;&lt;li&gt;Get a handle on FX exposure risks in the portfolio&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Ideally, I would like to create a single report that outlines the entire portfolio risk (i.e. option sensitivities and FX risk).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would be grateful for any guidance or links to information that will help me extract data that I am already generating, and put that data together in a framework as the one described above, with the aim of obtaining a more global view of my portfolio risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I am not looking for third party system, I simply want to know how to aggregate the data I already have, in a meaningful and practical way (hopefully with some theoretical/empirical underpinning), in order to manage my portfolio risk better.&lt;/p&gt;&#xA;" OwnerUserId="1733" LastActivityDate="2012-08-31T17:30:02.407" Title="Multi asset option portfolio risk management (greeks and FX exposure)" Tags="&lt;options&gt;&lt;portfolio-management&gt;&lt;risk-management&gt;&lt;fx&gt;&lt;greeks&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4062" PostTypeId="2" ParentId="4024" CreationDate="2012-08-31T13:35:48.443" Score="1" Body="&lt;p&gt;No. The shadow pricing of goods theory can explain the presently observed negative interest rates bonds. A shadow interest rate shows when the expected return is greater than interest rate (as firms wish to borrow more at given interest rate than they can) and opportunity cost of funds is greater than interest rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Considering two additional ulimate local nettings (over the software- and physical-money) at the level of the modelled portfolio, the treasury department does the asset versus liability management. Frequency, magnitude, settlement methods do get involved in such a modelling. &lt;/p&gt;&#xA;" OwnerUserId="2872" LastEditorUserId="2872" LastEditDate="2012-08-31T13:41:58.467" LastActivityDate="2012-08-31T13:41:58.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4063" PostTypeId="2" ParentId="4060" CreationDate="2012-08-31T14:22:42.043" Score="3" Body="&lt;p&gt;Actually the delta corresponds to &lt;em&gt;risk-neutral&lt;/em&gt; probability of expiring in-the-money (up to a factor of carry cost).  This is very different from the real-world probability of expiring in-the-money.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to the derivation, if you write the risk-neutral expectation equation for in-the-money expiration, it comes to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\int_{K}^{\infty} 1 \cdot  p(S_\tau) dS_\tau&#xA;$$&#xA;where $p(S_\tau)$ is the risk-neutral Black-Scholes probability density&#xA;$$&#xA;  \frac{n( d_2(S_0,S_\tau) )}  {S_\tau  \sigma \sqrt{\tau} }.&#xA;$$&#xA;and the answer works out to the delta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this can be viewed as taking the derivative of the option pricing expectation equation&#xA;$$&#xA;C=\int_{K}^{\infty} (S-K) \cdot  p(S_\tau) dS_\tau&#xA;$$&#xA;through the integral sign.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-08-31T14:22:42.043" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4064" PostTypeId="2" ParentId="4057" CreationDate="2012-08-31T15:19:01.753" Score="1" Body="&lt;p&gt;One way to think about it would be to model each strategy like it were a stock or index. Even if the strategies themselves have during holding periods or assets, they all fundamentally have a PnL every day that you can look at. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you would model the strategies and any other risk factors that you are worried about your exposure to. The strategies have potentially time-varying exposures to markets that you would need to account for, such as by a DCC copula. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could then apply portfolio optimization for some generic time horizon with constraints on the total risk and risk factors to ensure market or factor neutrality.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2012-08-31T15:19:01.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4065" PostTypeId="2" ParentId="4057" CreationDate="2012-08-31T15:32:33.687" Score="1" Body="&lt;p&gt;About the 3rd point (i.e. &lt;em&gt;how to include the dynamic nature of each strategy&lt;/em&gt;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best and rigorous way to do it is to use stochastic control:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;you need a utility function (to balance expectation with risk)&lt;/li&gt;&#xA;&lt;li&gt;you have stopping times to enter or exit from your strategies (in fact you have probably laws of the stopping times, at first you can assume they are independent Poisson processes)&lt;/li&gt;&#xA;&lt;li&gt;and you know the law of the returns to expect (because of your backtests)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So you can implement a backward scheme to obtain a good mix of your strategies. Ideally (and to maintain your computations easy) you need an end time, take a multiple of all the expectations of your Poisson processes.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2012-08-31T15:32:33.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4066" PostTypeId="2" ParentId="4061" CreationDate="2012-08-31T16:52:53.677" Score="3" Body="&lt;p&gt;The most successful market risk management frameworks separate &lt;strong&gt;calculations&lt;/strong&gt; from &lt;strong&gt;products&lt;/strong&gt;. This makes them centralized, scalable and allows easy aggregation. Please note I'm referring to the aggregation of security-level exposures; not computing new portfolio-level metrics. Speaking &lt;strong&gt;very&lt;/strong&gt; generally, such an infrastructure requires the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;A library of risk calculations.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A separate product database for tracking the various indicatives of each security.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A layer of aggregation logic to group similar results across different products: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Calculations X and Y both yield vega, but for different products&lt;/li&gt;&#xA;&lt;li&gt;Calculations X and Y both yield JPY exposure, but for different products&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A report that displays the (optionally aggregated) results of some set of calculations on another set of products.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The key idea is to produce your exposures in some centralized infrastructure and pull only what you need into a report. This way you let the reports just filter and aggregate and avoid the redundancy of making each one perform calculations as well (additionally it minimizes the operational risk of having a calculation defined differently in two spreadsheets).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given your current setup, the simplest way to start might be by putting all your securities and calculations on a single spreadsheet, making sure that calculations with the same type of result are in the same column, and then use pivot tables to filter and aggregate the information. So one table shows all risk calculations broken out across a certain product, reproducing your current set up; another shows a single calculation (say, vega) summed across all products, giving you a portfolio-level view. This may not be ideal, but you could implement it almost immediately. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Depending on your level of development experience, you can build more sophisticated infrastructures that don't require jamming everything into a spreadsheet -- or using spreadsheets at all!&lt;/p&gt;&#xA;" OwnerUserId="2843" LastActivityDate="2012-08-31T16:52:53.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4067" PostTypeId="2" ParentId="1490" CreationDate="2012-08-31T17:08:34.797" Score="2" Body="&lt;p&gt;(a) From the dealers perspective, single stock vol swap is much easier to hedge. &#xA;(b) From the clients perspective, vol swap is nearly impossible to unwind with anyone but the original dealer&#xA;(c) Var&gt;Vol spread trades in the IBD market all the time and is the only truly liquid product with vol of realized vol exposure (options on realized var don't really trade these days).&lt;/p&gt;&#xA;" OwnerUserId="2906" LastActivityDate="2012-08-31T17:08:34.797" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4068" PostTypeId="2" ParentId="4057" CreationDate="2012-08-31T17:16:17.780" Score="1" Body="&lt;p&gt;Yeah, I initially thought of modeling each strategy as an asset and simply trying to allocate using some sort of efficient frontier. This is a bit scary, as you end up using strategy performances and &quot;your biggest loss is ahead of you&quot;.&lt;/p&gt;&#xA;" OwnerUserId="2906" LastActivityDate="2012-08-31T17:16:17.780" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4069" PostTypeId="2" ParentId="4061" CreationDate="2012-08-31T17:30:02.407" Score="1" Body="&lt;p&gt;I was running a very similar book just a month ago. On the market/option risks, your best bet is to convert all sensitivities into something &quot;familiar&quot;. For example, I converted all deltas into SPX delta using index/stock beta, converted all vega to SPX vega using vol-beta etc. FX is the unpleasant one, you end up looking at a list of pair exposures and usually end up doing nothing. &lt;/p&gt;&#xA;" OwnerUserId="2906" LastActivityDate="2012-08-31T17:30:02.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4070" PostTypeId="1" CreationDate="2012-09-02T23:12:49.790" Score="8" ViewCount="3754" Body="&lt;p&gt;ok, so let assume I can predict the daily change in the VIX itself (in points) every day. what would be the best way to play this with OPTIONS? well, obviously VIX options, but if I can look at the VIX as the implied volatility of the S&amp;amp;P (?) can I now project from that on the change in Vega of the SPX options? so if my prediction tells me VIX is going down today, I should be able to make money by selling both call and put of the S&amp;amp;P (same strike and expiration) to maintain a Delta-neutral position, and being &quot;short Vega&quot;, making money on the decline in the implied volatility of these options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I right?  &lt;/p&gt;&#xA;" OwnerUserId="2897" LastActivityDate="2012-09-18T13:24:46.770" Title="VIX = Vega of S&amp;P500 options?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;vix&gt;&lt;spx&gt;&lt;vega&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4071" PostTypeId="1" AcceptedAnswerId="4072" CreationDate="2012-09-02T23:51:13.940" Score="7" ViewCount="5798" Body="&lt;p&gt;I would like to find the allocations that would minimize some user-defined metric (Sortino, minimum drawdown, etc) for a portfolio of assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would one go about formulating the objective functions to pass to the optimizer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have experience in portfolio optimization for minimum variance and Sharpe, but when the objective is different, how would one go about tackling and formulating the problem?&lt;/p&gt;&#xA;" OwnerUserId="2318" LastEditorUserId="1418" LastEditDate="2012-09-04T15:02:59.847" LastActivityDate="2012-09-04T16:48:14.293" Title="How to define the objective function for a custom optimization problem?" Tags="&lt;optimization&gt;&lt;portfolio-selection&gt;&lt;sharpe-ratio&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4072" PostTypeId="2" ParentId="4071" CreationDate="2012-09-03T00:10:44.937" Score="11" Body="&lt;p&gt;Minimum variance can be solved simply and efficiently via a quadratic optimizer as the only key input is a covariance matrix. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Drawdown or Sortino cannot be optimized via a covariance matrix unless you assume some functional relationship between co-variances/variances and your risk metric of interest. Likely you'll wind up with a similar portfolio to the minimum-variance under this strategy anyway since under the assumption of a joint normally distributed return, securities with the highest co-variance/variances will also have the highest drawdown.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The optimizer is solving for what set of weights maximizes or minimizes an objective function.  So you need to formulate an objective function that represents the expected utility of your portfolio given a set of weights. The utility function would be the sum of its expected alpha and have a penalty for drawdown/sortino. A simple (crude?) way to express the expected drawdown or sortino is to assume that the expected drawdown or or sortino for a security is proxied by the historical drawdown / sortino. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could use the &lt;a href=&quot;http://cran.r-project.org/web/packages/PerformanceAnalytics/PerformanceAnalytics.pdf&quot; rel=&quot;nofollow&quot;&gt;PortfolioAnalytics&lt;/a&gt; package in R to measure the historical risk (drawdown, sortino, etc.) for a function and pass it to an optimizer. This is a bit risky since historical drawdown may not be a good predictor for future drawdown (and you have to account for interactions amongst assets). Now that you have a function for risk, use an optimizer that searches across weight space to see where your objective function is minimized. You need an optimizer that searches across weight space (such as a genetic algorithm or a random portfolio generator) rather than a quadratic or gradient-based optimizer as your drawdown function can probably not be differentiated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Brian Peterson and Peter Carl have a nice illustration of taking arbitrary objective functions and using a search-based algorithm to solve them &lt;a href=&quot;http://www.rinfinance.com/agenda/2010/Carl+Peterson+Boudt_Tutorial.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. I think their presentation will help you make the ideas suggested above more concrete in practice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update:&#xA;If your objective function is convex then a quadratic optimizer such as &lt;a href=&quot;http://cran.r-project.org/web/packages/quadprog/index.html&quot; rel=&quot;nofollow&quot;&gt;quadprog&lt;/a&gt; or a machine-learning algorithm such as stochastic gradient descent will guarantee a solution. If your objective function is non-convex then you will need to use an alternative optimization strategy (genetic algos, trust-region methods, non-linear optimizers such as &lt;a href=&quot;http://cran.r-project.org/web/packages/nloptr/index.html&quot; rel=&quot;nofollow&quot;&gt;NLOPTR&lt;/a&gt;, etc.). Several of these other methods do not guarantee convergence (indeed they might find only local optima). They are also considerably more time-consuming. The severity of this issue depends on the nature of your objective function, the time to iterate and ability to solve the optimization in parallel with random seeds, the level of precision you require given the noisiness of your inputs. For example, non-convex optimizers in general are too slow and unnecessary for applications such as High-Frequency Trading. Also, you may find solutions that are inferior to solving simpler quadratic problems where at least you can guarantee an optimum. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tip: If you choose to use genetic algorithms such as &lt;a href=&quot;http://cran.r-project.org/web/packages/DEoptim/index.html&quot; rel=&quot;nofollow&quot;&gt;DEOptim&lt;/a&gt;, you may want to consider seeding your initial population with solutions to a mean-variance quadratic optimization (along different points of the frontier) to speed convergence.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also accelerate the process if you invest in a CUDA GPU to handle parallel operations.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-09-04T16:48:14.293" LastActivityDate="2012-09-04T16:48:14.293" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="4073" PostTypeId="1" AcceptedAnswerId="4076" CreationDate="2012-09-03T02:33:10.823" Score="4" ViewCount="3723" Body="&lt;p&gt;Using the ROC function in the R package TTR, there is a choice between continuous (the default) and discrete, but with no guidance on which you choose when. In the code the difference is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;roc &amp;lt;- x/lag(x) - 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;versus:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;roc &amp;lt;- diff(log(x))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I admit my maths is weak but aren't they the same thing?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cbind(ROC(x,type='continuous'),ROC(x,type='discrete'),log(x))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;gives:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;2012-08-16 19:00:00             NA             NA 8.673855&#xA;2012-08-17 07:00:00  0.00008549566  0.00008549932 8.673940&#xA;2012-08-17 08:00:00  0.00000000000  0.00000000000 8.673940&#xA;2012-08-17 09:00:00 -0.00085528572 -0.00085492006 8.673085&#xA;2012-08-17 10:00:00  0.00034220207  0.00034226063 8.673427&#xA;2012-08-17 11:00:00 -0.00102695773 -0.00102643059 8.672400&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is a subtle difference, but is it a real difference or an artifact of floating point calculation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems like &lt;a href=&quot;https://quant.stackexchange.com/q/1079/1587&quot;&gt;Quantmod: what&amp;#39;s the difference between ROC(Cl(SPY)) and ClCl(SPY)&lt;/a&gt; is almost asking the same thing. But the answers there seem to be saying that with one you would sum the returns, and with the other you multiply them. That is clearly not going to be the case for the above numbers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(BTW, no-one answered his question (in the comments) as to which form is expected by the PerformanceAnalytics package, which might have given a clue as to which you choose when.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the test data for the above:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;structure(c(5848, 5848.5, 5848.5, 5843.5, 5845.5, 5839.5), class = c(&quot;xts&quot;, &#xA;&quot;zoo&quot;), .indexCLASS = c(&quot;POSIXct&quot;, &quot;POSIXt&quot;), .indexTZ = &quot;&quot;, tclass = c(&quot;POSIXct&quot;, &#xA;&quot;POSIXt&quot;), tzone = &quot;&quot;, index = structure(c(1345143600, 1345186800, &#xA;1345190400, 1345194000, 1345197600, 1345201200), tzone = &quot;&quot;, tclass = c(&quot;POSIXct&quot;, &#xA;&quot;POSIXt&quot;)), .Dim = c(6L, 1L), .Dimnames = list(NULL, &quot;Close&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1587" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2012-09-03T14:40:48.783" Title="ROC: difference between discrete and continuous?" Tags="&lt;r&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4075" PostTypeId="2" ParentId="4073" CreationDate="2012-09-03T14:32:30.167" Score="2" Body="&lt;p&gt;The difference is real, though it is very small if your return on capital is small. Let's say value of your asset went up from 10.03 to 10.05:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my python code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; from math import log&#xA;&amp;gt;&amp;gt;&amp;gt; 10.05 / 10.03 - 1&#xA;0.001994017946161719&#xA;&amp;gt;&amp;gt;&amp;gt; log(10.05) - log(10.03)&#xA;0.001992032531240806&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The ROC is small, and difference between two methods is small. But if the price of your stock went up from 100 to 500:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; 500.0/100.0 - 1&#xA;4.0&#xA;&amp;gt;&amp;gt;&amp;gt; log(500) - log(100)&#xA;1.6094379124340996&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;ROC is large, and the difference between the methods is large.&lt;/p&gt;&#xA;" OwnerUserId="2512" LastActivityDate="2012-09-03T14:32:30.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4076" PostTypeId="2" ParentId="4073" CreationDate="2012-09-03T14:39:42.090" Score="5" Body="&lt;p&gt;The difference is not an artifact of floating point arithmetic; it's a difference in compounding frequency.  The returns in your example are fairly close to zero, so they don't look that different.  Larger changes in price will cause larger differences between the two calculation methods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pat Burns wrote a nice blog post about the difference between arithmetic and log returns called, &lt;a href=&quot;http://www.portfolioprobe.com/2010/10/04/a-tale-of-two-returns/&quot; rel=&quot;noreferrer&quot;&gt;A tale of two returns&lt;/a&gt;.  I suggest you read the entire thing, but the relevant portions are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;log returns are always smaller than simple returns&lt;/li&gt;&#xA;&lt;li&gt;simple returns aggregate across assets&lt;/li&gt;&#xA;&lt;li&gt;log returns aggregate across time&lt;/li&gt;&#xA;&lt;li&gt;The log return of a short position is the negative of the log return of the long position.  The relationship of the simple return of a short position relative to that of the long position is a little more complicated: $-R / (R + 1)$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So, the difference between summing and multiplying the returns clearly &lt;strong&gt;is&lt;/strong&gt; a big difference between the two methods.  Regarding PerformanceAnalytics, it seems that most of the functions assume arithmetic returns.  Remember, you have the source code, so you can always see the exact calculations being used to generate each functions' results.&lt;/p&gt;&#xA;" OwnerUserId="56" LastActivityDate="2012-09-03T14:39:42.090" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4077" PostTypeId="2" ParentId="4071" CreationDate="2012-09-03T14:41:07.163" Score="5" Body="&lt;p&gt;If you're using Python, you may want to take a look at &lt;a href=&quot;https://quant.stackexchange.com/questions/675/python-library-for-portfolio-optimization?rq=1&quot;&gt;this question&lt;/a&gt;, to which the &lt;a href=&quot;http://abel.ee.ucla.edu/cvxopt/&quot; rel=&quot;nofollow noreferrer&quot;&gt;cvxopt&lt;/a&gt; library was the most popular answer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, or if you don't want to use cvxopt, then the basic setup is no different than using mean-variance optimization. You will almost always characterize your problem as a function taking a single vector argument (the portfolio weights) and returning a scalar value (the risk/reward score). A generic optimizer can find the weights which maximize that score.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do bear in mind that any optimization may be more representative of your algorithm's ability to curve-fit than something real.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's highly abstracted pseudocode for optimizing a Sortino ratio in Python, using SciPy's &lt;a href=&quot;http://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html#scipy.optimize.minimize&quot; rel=&quot;nofollow noreferrer&quot;&gt;minimize&lt;/a&gt; optimizer. Other languages will follow a similar path, and by browsing the documentation you can introduce more sophisticated things like weight boundaries, other constraints, etc. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#First set up any global variables you don't need to compute each time&#xA;import numpy as np&#xA;import scipy&#xA;&#xA;stock_returns = ...&#xA;risk_free = ...&#xA;&#xA;#Next define your risk/reward function for a set of portfolio returns&#xA;def sortino(portfolio_returns):&#xA;    downside_returns = portfolio_returns[:]&#xA;    downside_returns[portfolio_returns &amp;gt; 0] = 0&#xA;    return np.mean(portfolio_returns) / np.mean(zeroed_returns)&#xA;&#xA;#Now set up your optimization problem,&#xA;#returning a negative value because we will use a minimization optimizer&#xA;def fn_to_optimize(weightsVector):&#xA;    portfolio_returns = np.dot(weightsVector, stock_returns) &#xA;    sortino_ratio = sortino(portfolio_returns - risk_free)&#xA;    return -1 * sortino_ratio&#xA;&#xA;#Finally, use a generic solver like SciPy's minimize to optimize the weights&#xA;initial_weights = np.ones(10) * 0.1 &#xA;solution = scipy.optimize.minimize(fn_to_optimize,  initial_weights, ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2843" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2012-09-03T14:41:07.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4078" PostTypeId="2" ParentId="4070" CreationDate="2012-09-03T15:00:25.773" Score="4" Body="&lt;p&gt;The VIX is designed to &quot;represent the implied volatility of a hypothetical at-the-money [SPX] option with exactly 30 days to expiration.&quot; (via the &lt;a href=&quot;http://www.cboe.com/micro/vix/faq.aspx&quot; rel=&quot;nofollow&quot;&gt;CBOE&lt;/a&gt;) The calculations are available from the CBOE in &lt;a href=&quot;http://www.cboe.com/micro/vix/vixwhite.pdf&quot; rel=&quot;nofollow&quot;&gt;this white paper&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that your question is wrong -- it is the implied volatility, not the vega. Moreover, you wouldn't predict a change in vega (which is a second derivative...), you'd predict the change in volatility and seek to profit through vega.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Replacing your use of vega with implied volatility, your assumption becomes correct in theory -- but it's a tough theory to put into practice... even if we suppose for a moment that you can in fact predict the VIX. It is extremely rare that you can actually purchase an ATM option with 30 days to maturity, meaning your proxy security necessarily deviates from the VIX calculation. Moreover, the transaction costs of maintaining a delta-neutral position are not insignificant (you can't just sell a put and a call, it won't stay delta-neutral).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You wouldn't do it with VIX options because they reflect the forward value of the VIX at maturity, and if you look at the term structure of VIX futures you'll see that forward values, even one month out, are far less volatile than spot.&lt;/p&gt;&#xA;" OwnerUserId="2843" LastEditorUserId="2843" LastEditDate="2012-09-03T15:05:49.790" LastActivityDate="2012-09-03T15:05:49.790" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="4079" PostTypeId="1" AcceptedAnswerId="4080" CreationDate="2012-09-04T14:43:37.373" Score="16" ViewCount="32344" Body="&lt;p&gt;Data is normally adjusted for splits/reverse splits, etc.  The current shares outstanding is usually available.  Is there a data repository that captures the shares outstanding for any point in the past?&lt;/p&gt;&#xA;" OwnerUserId="2478" LastActivityDate="2021-03-26T15:06:02.740" Title="Data source for historical Share Outstanding totals for individual stocks?" Tags="&lt;data&gt;&lt;market-data&gt;" AnswerCount="9" CommentCount="2" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="4080" PostTypeId="2" ParentId="4079" CreationDate="2012-09-04T20:57:37.597" Score="15" Body="&lt;p&gt;That information is available in the SEC's &lt;a href=&quot;http://www.sec.gov/edgar/searchedgar/companysearch.html&quot;&gt;EDGAR database&lt;/a&gt;, though there can be many flavors of &quot;shares outstanding&quot;. It is reported quarterly in a company's 10-Q/K, sometimes on a weighted-average basis. If you don't want to get it manually, a service like Bloomberg will let you access the historical levels quite easily, or you can parse the EDGAR &lt;a href=&quot;http://xbrl.sec.gov/&quot;&gt;XML feeds&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should note that the &quot;current&quot; number you refer to is just the most recent quarterly number -- the data isn't available with finer granularity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you need to reconcile splits, one (free) option is to use a service like Yahoo Finance -- their &quot;Adjusted Close&quot; normalizes historical prices for dividends and splits. You could back out the dividend impact and use the ratio of &quot;Close&quot; to your new &quot;dividend-excluding Adjusted Close&quot; to get the necessary scaling factor. Alternatively, you can download a table of just dividend/split information and parse it to get the required factors for splits only. To get that table, choose the misleadingly-named &quot;Dividends Only&quot; option.&lt;/p&gt;&#xA;" OwnerUserId="2843" LastEditorUserId="2843" LastEditDate="2012-09-05T16:19:51.217" LastActivityDate="2012-09-05T16:19:51.217" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4081" PostTypeId="1" AcceptedAnswerId="4082" CreationDate="2012-09-05T07:12:28.903" Score="9" ViewCount="10181" Body="&lt;p&gt;When computing an FX forward rate for an expiry that is not explicitly quoted, it seems to me that a reasonable way to do it is log-linear interpolation of the two nearest outright forward rates, which would correspond to assuming continuous compounding at a constant rate in both currencies.  However, it seems that it is common to calculate this rate by&#xA;linear interpolation (e.g., see &lt;a href=&quot;http://www.financetrainer.com/fileadmin/inhalte/TOOLS_SKRIPTEN/0102_forwarde.pdf&quot; rel=&quot;noreferrer&quot;&gt;this tutorial&lt;/a&gt;, page 12).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is most commonly done in practice by FX traders?&lt;/p&gt;&#xA;" OwnerUserId="1039" LastEditorUserId="1039" LastEditDate="2012-09-05T09:33:28.823" LastActivityDate="2012-09-06T09:54:04.603" Title="Interpolating FX forward points" Tags="&lt;fx&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4082" PostTypeId="2" ParentId="4081" CreationDate="2012-09-05T08:29:40.977" Score="8" Body="&lt;p&gt;Most common practise is to linearly interpolate. Log-linear would be wrong; forward points are commonly negative, and are merely a delta on the Spot. Closer would be log-linear on the outrights (Spot plus forward points), but even that is not worth bothering with.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have some idea of the shapes of the underlying yield curves, you can work out which are the more and less expensive days in the run and price accordingly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't know the relative yield curve shape, then there's no point in doing anything but linear interp since you're already approximating, and the convention is linear. I believe the phrase is 'you can't polish a ...'&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The interesting question is really 'which underlying yield curves?'&lt;/p&gt;&#xA;" OwnerUserId="1314" LastEditorUserId="1314" LastEditDate="2012-09-05T08:35:32.793" LastActivityDate="2012-09-05T08:35:32.793" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4083" PostTypeId="1" CreationDate="2012-09-05T13:12:19.000" Score="7" ViewCount="497" Body="&lt;p&gt;Does the NYSE provide a list of rules for determining when to close at 1:00 for a holiday?  I have found a list of upcoming half-days &lt;a href=&quot;http://www.nyx.com/en/holidays-and-hours/nyse&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; but I would like to know the rules so that I don't have to hard-code them in my application.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found a list of all of the dates on which the NYSE closed early in its history &lt;a href=&quot;http://www.nyse.com/pdfs/closings.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;*.  I could discern three rules for half-days that I would like to verify:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Thanksgiving: the Friday after Thanksgiving is always a half day (close at 1:00).&lt;/li&gt;&#xA;&lt;li&gt;Christmas: if Dec 24th is a Mon, Tues, Wed, or Thur, close at 1:00.&lt;/li&gt;&#xA;&lt;li&gt;July 4th: if July 4th is a Tues, Wed, or Fri, close at 1:00 on the previous day.  If July 4th is a Thur, close at 1:00 on the next day.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The list of upcoming holidays shows that Wednesday, July 3, 2013 is a half-day.  This conflicts with what looks like their previous policies.  I'm guessing that in the future, July 5th will never be a half-day and that July 3rd will be a half-day if it falls on a Mon, Tues, Wed, or Thur (similar to the Dec 24th rule).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;*According to that historic list I linked, the NYSE used to be open on Saturdays.  I thought that was interesting.&lt;/p&gt;&#xA;" OwnerUserId="2904" LastEditorUserId="16595" LastEditDate="2018-07-22T20:36:44.450" LastActivityDate="2018-07-22T20:36:44.450" Title="NYSE Early Close Rules (July 4th and Dec. 25th)" Tags="&lt;exchange&gt;&lt;nyse&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4084" PostTypeId="1" CreationDate="2012-09-05T19:12:39.233" Score="2" ViewCount="1192" Body="&lt;p&gt;I have a question regarding the strike price that is given on OptionMetrics. My goal is to primarily retrieve options prices of a specific maturity with strike prices that are 20% in-the-money, at-the-money and 20% out-the-money. In order to do so I need to use the direct relationship between the strike price $K$ and the spot price $S_t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The exact definition as given by Investopedia.com is:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;For a call option, when the option's strike price is below the market price of the underlying asset, an option is In-The-Money.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;When I use the date from OptionMetrics I find that my strike price is given in the form '257000' for instance, hence with header 'Strike price times 1000'. However the index price (market price) at that particular point in time is about 9580. This large difference holds for all observations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How do I then calculate the amount that the option is in- or out-of-the money?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am therefore wondering whether someone has experience with working with OptionMetrics and more specific on filtrating options that are say 20% in-the-money.&lt;/p&gt;&#xA;" OwnerUserId="2905" LastActivityDate="2012-09-06T18:55:38.727" Title="Question on OptionMetrics: &quot;Strike Price times 1000&quot; differs too much from Index price" Tags="&lt;option-pricing&gt;&lt;derivatives&gt;&lt;optionmetrics&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4086" PostTypeId="1" AcceptedAnswerId="4087" CreationDate="2012-09-06T02:21:42.850" Score="5" ViewCount="4054" Body="&lt;p&gt;I'm looking for a precise definition of how FX outright delivery dates are computed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Chapter 1 of the book 'Foreign Exchange Option Pricing: A Practitioners Guide' (this chapter can be found &lt;a href=&quot;http://ebooks.narotama.ac.id/files/Foreign%20Exchange%20Option%20Pricing/Chapter%201%20Introduction%20-%20Foreign%20Exchange%20Option%20Pricing.pdf&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;) outlines quite precisely the rules for calculating expiry and deliver dates for FX options in Section 1.5, but it is not clear to me whether or not these rules also apply to calculation of delivery dates of FX outrights?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular, the above reference (along with &lt;a href=&quot;http://en.wikipedia.org/wiki/Foreign_exchange_date_conventions&quot; rel=&quot;noreferrer&quot;&gt;Wikipedia&lt;/a&gt;) state that for outrights less than a month (terms of days or weeks), the delivery date is obtained by adding the number of days to TODAY, and then adjusting the resulting date forward.  However &lt;a href=&quot;http://www.financetrainer.com/fileadmin/inhalte/TOOLS_SKRIPTEN/0102_forwarde.pdf&quot; rel=&quot;noreferrer&quot;&gt;other&lt;/a&gt; &lt;a href=&quot;http://www.jenner.com/lehman/docs/barclays/LBEX-LL%203356480-3356609.pdf&quot; rel=&quot;noreferrer&quot;&gt;sources&lt;/a&gt; indicate that you should instead add the number of days to the SPOT date, and then adjust the resulting date forward.  Which is correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a golden source for these rules for outrights/swaps, perhaps something along the lines of &lt;a href=&quot;http://www.newyorkfed.org/fmlg/icomgiu.pdf&quot; rel=&quot;noreferrer&quot;&gt;The 1997 ICOM Master Agreement Guide&lt;/a&gt; document for FX options?&lt;/p&gt;&#xA;" OwnerUserId="1039" LastEditorUserId="1039" LastEditDate="2012-09-06T07:28:37.897" LastActivityDate="2020-08-14T07:05:47.080" Title="Computing FX forward delivery dates" Tags="&lt;fx&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4087" PostTypeId="2" ParentId="4086" CreationDate="2012-09-06T08:11:36.643" Score="4" Body="&lt;p&gt;Firstly, in FX, it all depends on the currencies. As an example, CAD is generally traded t+1 against USD, but is also frequently traded t+2. A EUR/CHF forward can take into account USD holidays (to permit arbitrage or take into account a position via USD), or ignore them.&lt;/p&gt;&#xA;&lt;p&gt;Basically it's an OTC market and the less common the trade, the more variable the specifics.&lt;/p&gt;&#xA;&lt;p&gt;Variables (non-exhaustive):&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Country of trade&lt;/li&gt;&#xA;&lt;li&gt;Inclusion of major currency holidays (USD, EUR)&lt;/li&gt;&#xA;&lt;li&gt;Holidays of traded currencies&lt;/li&gt;&#xA;&lt;li&gt;Spot (t+?) for both currencies&lt;/li&gt;&#xA;&lt;li&gt;Weekend days&lt;/li&gt;&#xA;&lt;li&gt;Deliverable or non-deliverable (non deliverable can choose to ignore currency holidays)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;It is down to the traders (or these days their e-trading platform) to decide exactly which dates they want to trade for.&lt;/p&gt;&#xA;&lt;p&gt;If you're thinking 'then how can I interpret market data', then you're on the right lines; there are striaghtforward conventions, but I'm afraid not all sources quote the same way. G10/11 are fairly standard (except CAD), but outside that it's down to market knowledge.&lt;/p&gt;&#xA;&lt;p&gt;Generally: Use t+2 except for specific pairs, include USD holidays, include holidays and weekends for both currencies. And check your sources.&lt;/p&gt;&#xA;&lt;h2&gt;SW, 2w...&lt;/h2&gt;&#xA;&lt;p&gt;For a term stated in days or weeks, jump to that offset from the start date (e.g. SW, 7 calendar days from the spot date) and then adjust (usually rolling forward) for holidays in either currency (or again USD if required).&lt;/p&gt;&#xA;&lt;h2&gt;1m, 2m... 1y, 2y&lt;/h2&gt;&#xA;&lt;p&gt;Calendar periods in whole months or years follow a similar procedure to weeks except if the end date lands in a following month - then there is a choice of month end rule to use. A common one in G11 currencies is end-end, where you roll back to the last business day of the matching month (so 1m goes 31 Jan - 28 Feb not Mar).&lt;/p&gt;&#xA;&lt;p&gt;Often this is used to match end-ness of the start date, so 28 Feb 1m would land 31 Mar, or even 26 Feb to 31 Mar if 26th is a Friday.&lt;/p&gt;&#xA;&lt;h2&gt;Why end of month rules?&lt;/h2&gt;&#xA;&lt;p&gt;Holding money in one or other currency (particularly USD) over a month end is usually different to other days, as a result of accounting and regulatory requirements, and whether the required currency is in demand or not. So to ensure that the trade correctly covers month ends or not, end of month rules ensure that small differences in calendars from one month or year to another don't result in additional exposures, i.e. no surprises.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastEditorUserId="1314" LastEditDate="2020-08-14T07:05:47.080" LastActivityDate="2020-08-14T07:05:47.080" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="4088" PostTypeId="2" ParentId="4081" CreationDate="2012-09-06T09:54:04.603" Score="1" Body="&lt;p&gt;As Phil H mentioned, linearly interpolate them is what many traders will do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, if you look at deposit rates, you can try to imply either a spread on one leg or a rate on one leg and interpolate this rate. I did not do this since quite a long time but you should find that the results are not too different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I remember correctly usually the bid ask is fairly large for longer maturities, so you have not much chances to cross someone.&lt;/p&gt;&#xA;" OwnerUserId="2908" LastActivityDate="2012-09-06T09:54:04.603" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4089" PostTypeId="1" CreationDate="2012-09-06T16:03:37.877" Score="2" ViewCount="250" Body="&lt;p&gt;The bonds which Greece has paid had been valued by market as junk once, just before their payment. Given that the observed market value is the net present value of the instrument, why were they so low?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because the value to be received has been discounted by the market via a huge credit spread related to the issuer=Greece? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or because they have been reflecting the optionality of Greece between paying this debt and defaulting for everything(=cost of default)? When you consider the probability (of survival) to be/get the amount $K_\text{up}$, and the probability of default to be/get $K_\text{down}$, it is valuable as an option (with its associated NPV/price). The cash flows to come to be considered as a barrier basket option (with multiple cash settlements).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Shouldn't be bonds better priced with options'theory, than with fix income's one?&lt;/p&gt;&#xA;" OwnerUserId="2872" LastEditorUserId="2872" LastEditDate="2015-04-20T04:40:41.397" LastActivityDate="2021-05-18T03:04:50.477" Title="Observed market price for the August-Greece-paid bonds were the NPV of the bond or of an option?" Tags="&lt;embedded-options&gt;&lt;bond&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4090" PostTypeId="2" ParentId="4084" CreationDate="2012-09-06T18:44:11.600" Score="1" Body="&lt;p&gt;The strike price provided by OptionMetrics is simply strike x 1000, so in order to calculate moneyness of the option you have to divide the strike by 1000 and then proceed in a standard manner.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of filtering the moneyness of the option, there are few options. The easiest is using VOLATILITY_SURFACE table in the OptionMetrics database.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Amount of the moneyness is measured by the delta of an option. Delta of an option is between 0% to 100%. VOLATILITY_SURFACE provides delta column along with strike for that moneyness. Given this strike you can filter the options around that strike. Just remember that these are interpolated strikes in that table.&lt;/p&gt;&#xA;" OwnerUserId="2909" LastEditorUserId="2909" LastEditDate="2012-09-06T18:55:38.727" LastActivityDate="2012-09-06T18:55:38.727" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4091" PostTypeId="5" CreationDate="2012-09-06T19:44:26.263" Score="0" Body="&lt;p&gt;Questions about OptionMetrics data, quality, database structure, calculations (specifically, implied volatility and volatility surface calculations), models, asset class and countries coverage.&lt;/p&gt;&#xA;" OwnerUserId="2909" LastEditorUserId="2909" LastEditDate="2012-09-06T20:44:52.410" LastActivityDate="2012-09-06T20:44:52.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4092" PostTypeId="4" CreationDate="2012-09-06T19:44:26.263" Score="0" Body="Questions about OptionMetrics data, structure, coverage and calculations." OwnerUserId="2909" LastEditorUserId="2909" LastEditDate="2012-09-06T20:44:46.327" LastActivityDate="2012-09-06T20:44:46.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4093" PostTypeId="2" ParentId="3646" CreationDate="2012-09-07T02:47:58.143" Score="2" Body="&lt;p&gt;The time scaling of higher moments for ordinary (discrete) returns as per the Wingender paper is illustrated in Excel and VBA in the following spreadsheet demonstration files:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Terminal-Wealth-Time-Horizon-Calcs-Normal-and-Modified-VBA and;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Liqudity-VaR-With-Correct-Time-Scaling-of-Higher-Moments&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Available &lt;a href=&quot;http://www.scribd.com/peter_urbani&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more on the weaknesses of the Cornish Fisher expansion see the presentation on &#xA;Why-Distributions-Matter-16-Jan-2012&lt;/p&gt;&#xA;" OwnerUserId="2911" LastActivityDate="2012-09-07T02:47:58.143" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4094" PostTypeId="2" ParentId="2717" CreationDate="2012-09-07T02:53:24.003" Score="0" Body="&lt;p&gt;For an small demonstration of the calculation of higher order co-skewness and co-kurtosis tensor matrices in Excel and VBA see;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Portfolio-Analytics-Coskew-and-CoKurt-VBA3&lt;/p&gt;&#xA;&#xA;&lt;p&gt;available from &lt;a href=&quot;http://www.scribd.com/peter_urbani&quot; rel=&quot;nofollow&quot;&gt;enter link description here&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2911" LastActivityDate="2012-09-07T02:53:24.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4095" PostTypeId="2" ParentId="4089" CreationDate="2012-09-07T10:15:11.693" Score="0" Body="&lt;p&gt;Bonds are traditionally valued using the discount curve, the credit spread to determine the probability of default and usually you still have to adjust the price using a spread because bonds can become illiquid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you ignore the last spread the price is sum of discounted cashflows except that at every point of time you need to compute the implied probability of default. If the bond defaults, the market assumes that you receive a recovery. By computing the value of the coupon leg conditionally on survival and the default leg for the default case, you should obtain a NPV which is much closer to the traded price of this security.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually you still need to adjust this price by a spread as the market can trade the security at a different price than your theoretical price and this is especially true for illiquid bonds. You could generalise this by saying that the market tries to anticipate what is the distribution of the expected cashflows and asks for a premium for uncertainty.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming a flat rate, the basic NPV of the cashflows is:&#xA;$$&#xA;B = P_T \frac{1}{(1 + r)^T} + \sum C_t \frac{1}{(1 + r)^t}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some would try to assume that you need to add a credit spread over the discounting rate:&#xA;$$&#xA;B = P_T \frac{1}{(1 + r + c)^T} + \sum C_t \frac{1}{(1 + r +c)^t}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is still incorrect as the implied default probability from the CDS spread. You would want to compute:&#xA;$$&#xA;B = P_T \frac{1}{(1 + r)^T)}surv(T) + \sum C_t \frac{1}{(1 + r +c)^t}surv(t)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $surv(t)$ is a function the cumulative probability of survival at time t.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But you are still incorrect, the bonds actually pay you a recovery in the form of cash or new bonds in the case of default. Assuming that this recovery is represented by an amount $R$ and the instantaneous default probability at time t is represented by a function $q(t)$:&#xA;$$&#xA;B = P_T \frac{1}{(1 + r)^T)}surv(T) + \sum C_t \frac{1}{(1 + r)^t}surv(t) + R \int_{t=0}^T \frac{1}{(1 + r)^t} \cdot q(t)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even with all these adjustments, you will still not be matching the market price of a security, you can consider the difference is likely to be due to some liquidity issues or error in your estimation of your recovery or other parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are various basis methods which will yield different results, the best is to find which one the people who trade this market seems to be using and try to match the market in addition to calculate a fair theoretical value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;HTH&lt;/p&gt;&#xA;" OwnerUserId="2908" LastEditorUserId="2908" LastEditDate="2012-09-07T16:55:00.147" LastActivityDate="2012-09-07T16:55:00.147" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4096" PostTypeId="1" CreationDate="2012-09-07T16:57:10.857" Score="3" ViewCount="241" Body="&lt;p&gt;I would like to backtest a short-equity strategy. I'm looking for historical data on the availability of shares and cost to short certain stocks. Does anyone know of such data being available anywhere? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, has anyone seen an academic paper describing a short equity strategy (or the short leg of a long/short equity strategy) where the authors bothered to check whether their stocks could be shorted? And deduct their short costs?&lt;/p&gt;&#xA;" OwnerUserId="2917" LastEditorUserId="35" LastEditDate="2012-09-07T17:51:21.423" LastActivityDate="2012-10-07T20:04:37.070" Title="Historical data on short rates" Tags="&lt;data&gt;&lt;equities&gt;&lt;short-selling&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4097" PostTypeId="2" ParentId="4096" CreationDate="2012-09-07T19:33:31.193" Score="1" Body="&lt;p&gt;Reach out to your prime broker and ask them for a history of borrows and rebates. Another realistic source of borrow rates can be imputed from the options data (though, then you would be restricted to the optionable stock universe).&lt;/p&gt;&#xA;" OwnerUserId="2906" LastActivityDate="2012-09-07T19:33:31.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4098" PostTypeId="1" AcceptedAnswerId="4104" CreationDate="2012-09-07T20:14:19.643" Score="3" ViewCount="936" Body="&lt;p&gt;I'm an aspiring computer scientist who want to move into algorithmic trading at some point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the moment I'm mostly focusing on courses in machine learning/data analysis etc. but I've noticed that my uni offers modules in stochastic analysis covering the topics mentioned in the question title.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is if this would be useful given my career aspirations. &#xA;Hope this isn't off topic, and thanks for reading :)&lt;/p&gt;&#xA;" OwnerUserId="1128" LastActivityDate="2012-09-10T17:51:58.027" Title="Does Ito/Malliavin calculus have any applications helpful for direction based trading?" Tags="&lt;stochastic-calculus&gt;&lt;research&gt;&lt;algorithmic-trading&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4100" PostTypeId="2" ParentId="2337" CreationDate="2012-09-09T01:46:02.427" Score="2" Body="&lt;p&gt;General rate trading wisdom shows that if anything, normal distribution fits developed markets better. For example, most swaption traders talk about implied volatilities in basis points (per day or annualized).&lt;/p&gt;&#xA;" OwnerUserId="2906" LastActivityDate="2012-09-09T01:46:02.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4101" PostTypeId="1" CreationDate="2012-09-09T08:07:56.650" Score="3" ViewCount="1406" Body="&lt;p&gt;I am confused on how to compute the spread ratio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, this is example I came across with my broker -&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider 2 contracts Bobl and Euribor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The DV01 of Bobl i 44.8 and Euribor is 25. To equalize DV01, we need 44.8/25=1.792 contracts of Euribor for every 1 contract of Bobl.&#xA;However, tick sizes are different. 1 Bobl Tick is 10 Euros and similar Euribor tick is 25. So the ratio will be for 1 Bobl we need 1.79*(25/10) = 4.475 contracts of Euribor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand DV01 sensitivity to compute the hedge ratio. However, I don't understand how is he using tick sizes. If he related tick sizes to basis points, it would have made more sense to me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does someone understand this?&lt;/p&gt;&#xA;" OwnerUserId="2678" LastEditorUserId="467" LastEditDate="2013-01-11T20:00:22.987" LastActivityDate="2017-09-09T16:26:59.440" Title="How to compute interest rate futures spread ratio?" Tags="&lt;futures&gt;&lt;spread&gt;" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4102" PostTypeId="2" ParentId="4101" CreationDate="2012-09-09T16:07:59.083" Score="-1" Body="&lt;p&gt;Tick size relates to the notional value of the contracts, so first you need to look at the equinotional hedge ratios and then adjust them by the ratio of the notional values to arrive at the relative number of contracts.&lt;/p&gt;&#xA;" OwnerUserId="2906" LastActivityDate="2012-09-09T16:07:59.083" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4103" PostTypeId="2" ParentId="2989" CreationDate="2012-09-10T09:29:59.583" Score="3" Body="&lt;p&gt;Try this: if you win this, you are really good ;)&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The &lt;strong&gt;Heritage Health Prize&lt;/strong&gt;, is a contest to predict the admission of patients. The company provides you historical data. This is a very interesting exercise where you can apply AI and statistics/econometrics &lt;a href=&quot;http://www.heritagehealthprize.com/c/hhp&quot; rel=&quot;nofollow&quot;&gt;http://www.heritagehealthprize.com/c/hhp&lt;/a&gt; &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;if you are looking for different projects, why not join &lt;strong&gt;Kaggle&lt;/strong&gt; (http://www.kaggle.com) ? Kaggle is a crowdsourcing website trying to match people/companies which have problems to solve with data scientists. There are often prizes.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The Heritage Health Prize has started a long time ago and the level of competition is quite high, so I would not expect to even have a chance to win the prize if I started now, but it can be interesting nevertheless especially that your research on the patients admissions will have real world impact if useful !&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are serious about this and preferably living in London, drop me a message, I would like to do some research but I would like to be part of a group.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Heritage Health Prize is not an investment game per se, but is kind of related to actuarial sciences and the skillset require overlaps with financial timeseries analysis.&lt;/p&gt;&#xA;" OwnerUserId="2908" LastEditorUserId="2908" LastEditDate="2012-09-10T12:47:48.840" LastActivityDate="2012-09-10T12:47:48.840" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4104" PostTypeId="2" ParentId="4098" CreationDate="2012-09-10T17:51:58.027" Score="4" Body="&lt;p&gt;it depends on how applied the class is. A deep understanding of stochastic calculus is not required for &quot;P-Quants&quot;, the type of person that lives in the physical word of forecasting and risk. That being said understanding the type of models that get used by the Q-Side (requiring lots of stochasic theory) is a useful skill to have. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like John said, if you wanted to forecast option returns, you need to have a good understanding of the statistical properties of options timeseries/cross sections to build either a risk model or a forecast model. Understanding the depths of stochastic calculus is not required here, but understanding black scholes (and the underlying assumptions) could be useful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this regard a stochastic calculus class will help you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a better distinction between p-quants and q-quants take a look at some of the work attilio maucci has done.&#xA;article here:&#xA;&lt;a href=&quot;http://symmys.com/node/62&quot; rel=&quot;nofollow&quot;&gt;http://symmys.com/node/62&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;p-quant class here:&#xA;&lt;a href=&quot;http://symmys.com/arpm-bootcamp/program&quot; rel=&quot;nofollow&quot;&gt;http://symmys.com/arpm-bootcamp/program&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1105" LastActivityDate="2012-09-10T17:51:58.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4105" PostTypeId="1" CreationDate="2012-09-10T17:52:55.410" Score="13" ViewCount="715" Body="&lt;p&gt;It appears to me that the answer is no, because Hurst exponent measures persistence in terms of autocorrelation, which is a linear measure. So even if a time series of asset returns is driven by nonlinear or chaotic dynamics, the dependence would not be captured by Hurst exponent as long as the ACF isn't significant at any lag.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is my understanding correct?&lt;/p&gt;&#xA;" OwnerDisplayName="user2163" LastActivityDate="2015-04-22T23:33:04.410" Title="Can Hurst exponent be used to characterize nonlinear dependence in time series?" Tags="&lt;time-series&gt;&lt;hurst-exponent&gt;&lt;nonlinear&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4106" PostTypeId="2" ParentId="3331" CreationDate="2012-09-11T12:55:05.703" Score="0" Body="&lt;p&gt;If you have time seria you could postulate a linear equation for them: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;x(t)=a*t+b giving a=x(t+1)-x(t)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are lots of methods to deal with the hypothesis that a is zero or not, including low sample statistics to boost your confidence (levels) in the final result. In addition, by b-estimation you could see the &quot;volatility&quot; of your correlations. &lt;/p&gt;&#xA;" OwnerUserId="2872" LastActivityDate="2012-09-11T12:55:05.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4107" PostTypeId="2" ParentId="4042" CreationDate="2012-09-11T19:30:03.177" Score="5" Body="&lt;p&gt;Options on almost all Korean equities today present flat implied volatility, as well as options on some Japanese equities, especially in 60-90 days maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here how the smile looks for T&amp;amp;D Holdings (ISIN:JP3539220008):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/aaQXn.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2909" LastEditorUserId="2909" LastEditDate="2012-09-11T20:42:51.923" LastActivityDate="2012-09-11T20:42:51.923" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4108" PostTypeId="1" CreationDate="2012-09-11T21:08:00.250" Score="2" ViewCount="185" Body="&lt;p&gt;I am modelling an option value model of retirement, see for instance Stock and Wise (1990). I am however not sure to which class of problems this model falls into and hence which optimization method I should consider to solve for the issue. To clarify what I mean, I will first describe the model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The objective is to find probabilities of retiring in a specific year, and the parameters $\rho$, $\gamma$, $k$, $\beta$ in:&#xA;\begin{eqnarray}&#xA;Pr[\text{retire}_t] &amp;amp; = &amp;amp; Pr[ g_t( r^{*}_t ) / K_t( r^{*}_t ) &amp;lt; - v_t ], \\&#xA;v_{s} &amp;amp; = &amp;amp; \rho v_{s-1} + \epsilon_t \\&#xA;g_t(r_t) &amp;amp; = &amp;amp; \sum^{r-1}_{s=t} \beta^{s-t} \pi(s|t) E_t(Y_s^{\gamma}) + \sum^{S}_{s=r} \beta^{s-t} \pi(s|t) E_t( [k B_s(r)]^{\gamma} )  \\ &#xA;&amp;amp; - &amp;amp; \sum^{S}_{s=r} \beta^{s-t} \pi(s|t) E_t( [ k B_s(t)]^{\gamma} ), \\&#xA;K_t( r_t ) &amp;amp; = &amp;amp; \sum^{r-1}_{s=t} \beta^{s-t} \pi(s|t) \rho^{s-t}, \\&#xA;v_t &amp;amp; = &amp;amp; (\omega_t - \xi_t )&#xA;\end{eqnarray}&#xA;Here $Y_s$ are future wages and $B_s(t)$ are retirement incomes with $\pi(s|t)$ the probability that a person will live in year s given that she or he lives in year $t$. $r^{*}_t$ is the year in which the value of future stream of income is maximized. The value of future stream of income if retirement is at age $r$ is given by:&#xA;\begin{eqnarray}&#xA; V_t(r) &amp;amp; = &amp;amp; \sum^{r-t}_{s=t} \beta^{s-t} U_w(Y_s) + \sum^{S}_{s=r} \beta^{s-t} U_r[B_s(r)], \\&#xA; U_w(Y_s) &amp;amp; = &amp;amp; Y_s^{\gamma} + \omega_s, \\&#xA; U_r(B_s) &amp;amp; = &amp;amp; [ k B_s(r)]^{\gamma} + \xi_s, \\&#xA; \omega_s &amp;amp; = &amp;amp; \rho \omega_{s-1} + \epsilon_{\omega,s}  \\&#xA; \xi_s &amp;amp; = &amp;amp; \rho \xi_{s-1} + \epsilon_{\xi, s}&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually one could solve such issues by considering it as a dynamic factor model or with maximum likelihood. However the summation $\sum$ makes it tricky as the 'optimal' date of retirment $r$ is a parameter itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in short, how would you classify this problem and which optimization techniques do you recommend? Do you perhaps know packages or know where I can find a code to solve for this?&lt;/p&gt;&#xA;" OwnerUserId="2291" LastEditorUserId="2291" LastEditDate="2012-09-11T21:43:24.687" LastActivityDate="2012-09-25T18:32:32.120" Title="How can I estimate the parameters of an option value model of retirement?" Tags="&lt;optimization&gt;&lt;numerical-methods&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4111" PostTypeId="2" ParentId="3872" CreationDate="2012-09-11T23:30:57.457" Score="8" Body="&lt;p&gt;Ha, interesting, so many responses with &quot;negative&quot; expectations. There are plenty of people that have successfully gone down this road and are producing pretty nice returns, so obviously it is possible. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A trader with a smaller capital has better chances of producing good ROC with very reasonable risk parameters, simply because he's would not be constrained by liquidity and ability to deploy capital. In fact, for someone trying to deploy a million or two, there is a number of capacity-constrained opportunities that can easily produce high double digit returns with Sharpe ratio north of 2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Market data and hardware are pretty cheap these days. You can get tick-level data for 10k and you can get 1 min bar (all that most non-HFT systems would need) for under 5k. A reasonably powerful box will run you another 2k. Pretty much all software need are covered by FOSS. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, to answer your own question, assume that you can produce returns around 30 percent with Sharpe of 2 (a very reasonable assumption for small capital deployment) and that you need about $500 a month in data fees and various fixed costs (e.g. co-location, brokerage charges, new hardware etc). In short, if you have the requisite IT and quant skills plus the requires market experience, you can do it on a very tight budget. In fact, I know people who do this sort of stuff and they started at 300k.&lt;/p&gt;&#xA;" OwnerUserId="2934" LastActivityDate="2012-09-11T23:30:57.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4113" PostTypeId="1" CreationDate="2012-09-12T08:44:50.370" Score="2" ViewCount="117" Body="&lt;p&gt;Look at ACCT 340 @ &lt;a href=&quot;http://www.gsb.stanford.edu/research/courses/acctg.html&quot; rel=&quot;nofollow&quot;&gt;http://www.gsb.stanford.edu/research/courses/acctg.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've read some of the research papers written by the Professor, and the material is very interesting. However, I'm looking for more in-depth, deeper examples (i.e. not only the theory, but also practical examples.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any good textbook / technical report on this material?&lt;/p&gt;&#xA;" OwnerDisplayName="user2936" LastActivityDate="2012-09-12T08:44:50.370" Title="Textbook / Reports on Alphanomics" Tags="&lt;reference-request&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4114" PostTypeId="2" ParentId="3331" CreationDate="2012-09-12T12:18:29.643" Score="3" Body="&lt;p&gt;Are you trying only to identify unstable correlations, or are you trying to incorporate time-varying correlation into your model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the latter, you may want to check out Engle's &lt;a href=&quot;http://weber.ucsd.edu/~mbacci/engle/391.PDF&quot; rel=&quot;nofollow&quot;&gt;Dynamic Conditional Correlation&lt;/a&gt;, which is an extent of GARCH modeling. In simplest terms, DCC models time-varying correlation parametrically via the GARCH residuals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another, slightly more exotic option is to consider a time-varying or conditional copula, such as those introduced by Andrew Patton. See for example his paper &lt;a href=&quot;http://public.econ.duke.edu/~ap172/Patton_IER_2006.pdf&quot; rel=&quot;nofollow&quot;&gt;Modelling Asymmetric Exchange Rate Dependence&lt;/a&gt;. Patton has also introduced goodness-of-fit measures for copulas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that by inspecting the parameters of such models, you could evaluate the hypothesis that correlations are stable.&lt;/p&gt;&#xA;" OwnerUserId="2843" LastEditorUserId="2843" LastEditDate="2012-09-12T16:21:35.820" LastActivityDate="2012-09-12T16:21:35.820" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4115" PostTypeId="1" AcceptedAnswerId="4117" CreationDate="2012-09-12T15:12:44.763" Score="10" ViewCount="5532" Body="&lt;p&gt;The weights of the nine S&amp;amp;P equity sector indexes vary over time.  One can find measures of them in a number of different formats:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://thoughtsoninvestment.blogspot.com/2011/09/s-500-sector-spdrs-historical-sector.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;S&amp;amp;P 500 Sector SPDRs - historical sector weights&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Here's an interesting way of looking at sector weights, and their&#xA;  relative performance.  It's easy to do - just take the 9 sector SPDR&#xA;  ETFs, one for each sector, and divide each by the sum of all 9.  The&#xA;  graph shows the history of this since 1999.  This analysis leaves out&#xA;  dividends (which I know is not fair, since sectors like Utilities may&#xA;  have disproportionate dividends), but it gets the idea across.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/DPfBw.png&quot; alt=&quot;Sector weightings&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not bad, but perhaps not as accurate as one would like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One sometimes see tables of this data such as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://seekingalpha.com/article/320168-s-p-500-historical-sector-weightings&quot; rel=&quot;nofollow noreferrer&quot;&gt;S&amp;amp;P 500 Historical Sector Weightings&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/QhmT5.png&quot; alt=&quot;Historical sector weightings&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The column heading &quot;3/09&quot; in the above table raised some questions with us as we have begun studying the S&amp;amp;P sector indexes for possible inclusion in our portfolios and specific product development.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The questions came up:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Do the weightings get driven purely by trading (as one sector rises relative to the others its percentage weight rises)?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Does S&amp;amp;P reset the weighting of the sectors by some other method (&quot;3/09&quot; got us wondering about this)? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Does some combination of both occur?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Dow Jones, for instance, resets the weights (and members) of its indexes.  What does S&amp;amp;P do and if they do this what methodology do they use?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If S&amp;amp;P does reset the sector weights, can anyone refer us to an authoritative source of data for the historical weights and the dates of the resets?  Perhaps it would merit addition to: &lt;a href=&quot;https://quant.stackexchange.com/questions/141/what-data-sources-are-available-online&quot;&gt;What data sources are available online?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've asked this question of S&amp;amp;P's Index Services group, but haven't received a timely reply.  I thought it worthwhile to ask here.  If I do hear back from them I post their answer.&lt;/p&gt;&#xA;" OwnerUserId="2789" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-10-11T07:53:46.880" Title="SP500 sector weights - how do they change?" Tags="&lt;equities&gt;&lt;index&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4116" PostTypeId="2" ParentId="3340" CreationDate="2012-09-12T16:35:39.787" Score="1" Body="&lt;p&gt;You will probably be interested in the following papers:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Ang &amp;amp; Chen: &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=219495&quot; rel=&quot;nofollow&quot;&gt;Asymmetric Correlations of Equity Portfolios&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Longin &amp;amp; Solnik: &lt;a href=&quot;http://www.clsbe.lisboa.ucp.pt/resources/documents/PROFESSORES/seminarios/JoFLonginBSolnik.pdf&quot; rel=&quot;nofollow&quot;&gt;Extreme Correlation of International Equity Markets&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Hong et al: &lt;a href=&quot;http://www.afajof.org/pdfs/2004program/updf/p660_asset_pricing.pdf&quot; rel=&quot;nofollow&quot;&gt;Asymmetric Correlation of Stock Returns:&#xA;Statistical Tests and Economic Evaluation&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The last paper goes further into exploring the implications of asymmetric correlation on portfolio selection and investor utility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you mention, GARCH-based methods like BEKK or DCC can address time-varying correlation and copulas are a good way to capture asymmetric dependence more generally.&lt;/p&gt;&#xA;" OwnerUserId="2843" LastActivityDate="2012-09-12T16:35:39.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4117" PostTypeId="2" ParentId="4115" CreationDate="2012-09-12T17:07:53.007" Score="9" Body="&lt;p&gt;S&amp;amp;P finally did respond to our query with a 100 page document.  The part relevant to this question follow:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Select Sector Index Calculations&lt;/strong&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;With the exception of the weighting constraints described above, each&#xA;  Select Sector Index is calculated using the same methodology utilized&#xA;  by S&amp;amp;P in calculating the S&amp;amp;P 500. In particular:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Each Select Sector Index is calculated using a base-weighted aggregate&#xA;  methodology; that means the level of the Select Sector Index reflects&#xA;  the total market value of all of its Component Stocks relative to a&#xA;  particular base period. Statisticians refer to this type of index, one&#xA;  with a set of combined variables (such as price and number of shares),&#xA;  as a composite index.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The total market value of a company is determined by multiplying the&#xA;  price of the stock by the number of common shares outstanding. An&#xA;  indexed number is used to represent the results of the aggregate&#xA;  market value calculation in order to make the value easier to work&#xA;  with and track over time.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The daily calculation of each Select Sector Index is computed by&#xA;  dividing the total market value of the companies in the Select Sector&#xA;  Index by a number called the “Index Divisor.” By itself, the Index&#xA;  Divisor is an arbitrary number. However, in the context of the&#xA;  calculation of the Select Sector Index, it is the only link to the&#xA;  original base period value of the Select Sector Index. The Index&#xA;  Divisor keeps the Select Sector Index comparable over time and&#xA;  adjustments to the Index Divisor ensure that there are no changes in&#xA;  the Select Sector Index level as a result of non-market forces&#xA;  (corporate actions, replacements of stocks in a Select Sector Index,&#xA;  weighting changes, etc.).&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Four times a year on a Friday close to the end of each calendar&#xA;  quarter, the share totals of the companies in the S&amp;amp;P 500 are updated&#xA;  by S&amp;amp;P. This information is utilized to update the share totals of&#xA;  companies in each Select Sector Index. After the totals are updated,&#xA;  the Index Divisor is adjusted to compensate for the net change in the&#xA;  market value of the Select Sector Index.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Once a week the database containing the current common shares&#xA;  outstanding for the S&amp;amp;P 500 companies is compared by S&amp;amp;P against the&#xA;  shares outstanding used to actually calculate the S&amp;amp;P 500. Any&#xA;  difference of 5% or more is screened for review by S&amp;amp;P. If&#xA;  appropriate, a share change will be implemented by S&amp;amp;P after the close&#xA;  of trading on the following Wednesday. Preannounced corporate actions&#xA;  such as restructurings and recapitalizations can significantly change&#xA;  a company's shares outstanding. Any changes over 5% are reviewed by&#xA;  S&amp;amp;P and, when appropriate, an immediate adjustment is made to the&#xA;  number of shares outstanding used to calculate the Select Sector&#xA;  Index. Any adjustment made by S&amp;amp;P in shares outstanding will result in&#xA;  a corresponding adjustment to each affected Select Sector Index.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;S&amp;amp;P handles corporate actions which may arise from time to time and&#xA;  which may have an impact on the calculation of the S&amp;amp;P 500 and,&#xA;  consequently, on the calculation of the Select Sector Index. Corporate&#xA;  actions such as a merger or acquisition, stock splits, spin- offs,&#xA;  etc., require adjustments in the Select Sector Index calculation.&#xA;  Index Divisor adjustments, calculated when necessary, are handled by&#xA;  S&amp;amp;P in its maintenance of the S&amp;amp;P 500. In the event a merger or&#xA;  acquisition changes the relative importance of a company's&#xA;  participation in two or more sectors in a major way, the Select Sector&#xA;  Index assignment of the stock may change. In any event, a new Index&#xA;  Divisor for affected Select Sector Indexes will be disseminated&#xA;  promptly by S&amp;amp;P.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If anyone wants the entire S&amp;amp;P document feel free to contact me by email.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note this answer still does not provide a source for the data of when changes to the weightings (other than those by trading) occur.&lt;/p&gt;&#xA;" OwnerUserId="2789" LastActivityDate="2012-09-12T17:07:53.007" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4118" PostTypeId="1" CreationDate="2012-09-12T20:44:11.980" Score="3" ViewCount="1917" Body="&lt;p&gt;What are the calculations for calculating greek exposures in a portfolio of equities and equity options?  I think I have them but I want to be sure.  Are these correct (for vanilla options)?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;deltaDollars = delta * quantity * 100&#xA;&#xA;gammaDollars = gamma * quantity * 100&#xA;&#xA;vegaDollars = vega * quantity * 100&#xA;&#xA;thetaDollars = theta * quantity * 100&#xA;&#xA;rhoDollars = rho * quantity * 100&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think that for calculating exposures for a whole portfolio, I can sum up these values for each position in the whole portfolio.  Is this correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure about summing gammaDollars in this way because gamma is a second derivative.  If my portfolio has only these positions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;23 MSFT options (gamma = 0.1, gammaDollars = $230)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;29 AAPL options (gamma = 0.2, gammaDollars = $580)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Can I say that my portfolio's gammaDollars are \$810 (\$230 + \$580)?  Or can I not add the numbers in this way?&lt;/p&gt;&#xA;" OwnerUserId="2904" LastEditorUserId="2904" LastEditDate="2012-09-13T15:52:51.170" LastActivityDate="2012-09-17T16:28:32.577" Title="Portfolio Greek Exposure Equations" Tags="&lt;options&gt;&lt;greeks&gt;&lt;gamma&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4119" PostTypeId="2" ParentId="4118" CreationDate="2012-09-12T23:35:39.247" Score="1" Body="&lt;p&gt;I, personally, like to see gamma as change in dollar delta per percent (most systems have it as &quot;GammaP&quot;). This way, it's much easier to think about you delta position as the market is moving around.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The number above is the BS gamma which is an unscaled 2nd derivative of delta. You need to rescale it to get gammap (delta change per percent). In general, it is also a good idea to calculate your delta and especially gamma using sticky strike volatilities - the easiest way to do so is to look at implied vol on the adjusted strikes and reprice your option using that vol and spot bumped up/down by the strike spread.&lt;/p&gt;&#xA;" OwnerUserId="2906" LastEditorUserId="2906" LastEditDate="2012-09-17T16:28:32.577" LastActivityDate="2012-09-17T16:28:32.577" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4121" PostTypeId="1" CreationDate="2012-09-13T20:35:47.993" Score="4" ViewCount="950" Body="&lt;p&gt;I am trying to develop my own MBS prepayment model.  I am confused by the terms SMM and CPR.  Are they estimates/models in themselves or are they ACTUAL data for the MBS pool.  where can I find actual historical MBS prepayment data?&lt;/p&gt;&#xA;" OwnerUserId="2944" LastActivityDate="2015-11-02T22:08:36.397" Title="mortgage prepayment model" Tags="&lt;data&gt;&lt;research&gt;&lt;models&gt;&lt;market&gt;&lt;mbs&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4122" PostTypeId="2" ParentId="4121" CreationDate="2012-09-13T22:07:46.243" Score="6" Body="&lt;p&gt;SMM stands for &lt;em&gt;single-month mortality&lt;/em&gt; and CPR stands for &lt;em&gt;constant&lt;/em&gt; (or &lt;em&gt;conditional&lt;/em&gt;) &lt;em&gt;prepayment rate&lt;/em&gt;.  They're both units of voluntary prepayment rates ($CPR = 1-(1-SMM)^{12}$). They could be based on either estimated or actual prepayments. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where to get actual MBS prepayment data will depend on what type(s) of MBS pools you're modeling (e.g. agency, specified, etc.).  &lt;a href=&quot;http://www.cprcdr.com/&quot; rel=&quot;nofollow&quot;&gt;CPR&amp;amp;CDR&lt;/a&gt; is one source I can think of off the top of my head.&lt;/p&gt;&#xA;" OwnerUserId="56" LastEditorUserId="35" LastEditDate="2012-09-28T04:06:36.897" LastActivityDate="2012-09-28T04:06:36.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4123" PostTypeId="1" CreationDate="2012-09-14T00:12:27.437" Score="2" ViewCount="638" Body="&lt;p&gt;I am trying to evaluate a forecasting algorithm for stock price prediction. However, the performance of the algorithm may be very much tied to the trading strategy.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a systematic way for decoupling these two, and evaluating the forecasting algorithm only? Perhaps, something not related to &lt;a href=&quot;http://en.wikipedia.org/wiki/Mean_squared_error&quot; rel=&quot;nofollow&quot;&gt;MSE&lt;/a&gt;, as it does not give much of an idea on how well or bad the algorithm will do about return of investment. &lt;/p&gt;&#xA;" OwnerUserId="1454" LastEditorUserId="467" LastEditDate="2012-09-15T08:52:50.660" LastActivityDate="2012-10-19T14:04:36.457" Title="Evaluating forecasting algorithm" Tags="&lt;quant-trading-strategies&gt;&lt;trading&gt;&lt;forecasting&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4124" PostTypeId="1" AcceptedAnswerId="4141" CreationDate="2012-09-14T13:18:13.980" Score="4" ViewCount="1943" Body="&lt;p&gt;I would like to model &lt;a href=&quot;http://www.cboe.com/micro/VIX/vixintro.aspx&quot; rel=&quot;nofollow&quot;&gt;VIX futures&lt;/a&gt;. The aim is not pricing but risk management. Thus I want to get risk measures like volatility right and be able to accurately calculate correlations when the VIX futures is analyzed in portfolio context.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure whether the Heston approach that is sometimes used is suitable for this aim. Another approach would be to approximate the VIX futures by the historical returns of the VIX index. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the approach most useful in risk management?&#xA;Do you know any useful software implementation for VIX (e.g. in R)?&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2012-09-18T09:09:52.420" LastActivityDate="2013-02-12T06:35:34.180" Title="Modelling VIX Futures for risk management" Tags="&lt;portfolio-management&gt;&lt;risk-management&gt;&lt;risk-models&gt;&lt;vix&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4125" PostTypeId="1" CreationDate="2012-09-14T13:47:55.120" Score="2" ViewCount="1729" Body="&lt;p&gt;I am sorry if this is not appropriate here. We are building a wealth management system and I really would like to know whether amortization of bond start accumulating on trade date or settlement date according to common accounting standard. &#xA;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="2948" LastActivityDate="2018-10-23T16:45:42.740" Title="Does amortization of bond start accumulating on trade date or settlement date?" Tags="&lt;portfolio-management&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4126" PostTypeId="2" ParentId="4125" CreationDate="2012-09-16T15:02:57.740" Score="2" Body="&lt;p&gt;&lt;a href=&quot;http://gipsstandards.org/&quot; rel=&quot;nofollow&quot;&gt;Global Investment Performance Standards&lt;/a&gt; state that bond amortization performance evaluation starts on trade date rather than settlement date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the &lt;a href=&quot;http://www.cfapubs.org/doi/pdf/10.2469/ccb.v2010.n5.1&quot; rel=&quot;nofollow&quot;&gt;attached&lt;/a&gt; see 1.A.5 which states:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;1.A.5 For periods beginning on or after 1 January 2005, FIRMS MUST use TRADE DATE ACCOUNTING.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;1.A.6 ACCRUAL ACCOUNTING MUST be used for fixed-income securities and all other investments that earn interest income. The value of&#xA;  fixed-income securities MUST include accrued income.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-09-16T22:25:12.897" LastActivityDate="2012-09-16T22:25:12.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4127" PostTypeId="1" CreationDate="2012-09-16T15:04:08.003" Score="2" ViewCount="798" Body="&lt;p&gt;What is the instantaneous P&amp;amp;L of a variance swap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it $(\sigma^{2}_{t}-\sigma^{2}_{implied})dt$?&lt;/p&gt;&#xA;" OwnerUserId="2959" LastEditorUserId="467" LastEditDate="2012-09-28T15:21:21.157" LastActivityDate="2013-03-27T20:57:56.270" Title="What is the instantaneous P&amp;L of a Variance Swap?" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;swaps&gt;&lt;variance&gt;&lt;replication&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4128" PostTypeId="2" ParentId="681" CreationDate="2012-09-16T16:10:49.553" Score="3" Body="&lt;p&gt;Variance swap basis is the basis between theoretical value of the variance strip and the actual strikes traded in the brokers' market.&lt;/p&gt;&#xA;" OwnerUserId="2906" LastEditorUserId="35" LastEditDate="2012-09-16T20:42:06.320" LastActivityDate="2012-09-16T20:42:06.320" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4129" PostTypeId="1" AcceptedAnswerId="4130" CreationDate="2012-09-16T20:47:23.887" Score="3" ViewCount="4712" Body="&lt;p&gt;I have a little question and need some help with the notation. So, the question goes as follows:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A bond with a maturity of ten years that pays annual coupons of 8% has a price of \$90. A bond with a maturity of ten years and annual coupons of 4% has a price of \$80. What is the ten year zero rate?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I don't actually know what the ten-year zero rate is. I set up a system of equations with the information that is given: Is it just all about finding $y$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;\$90 =&amp;amp; \sum_{i=1}^{10} e^{-yi} (0.08 Z) &amp;amp;+&amp;amp; e^{-y\cdot 10}Z\\&#xA;\$80 =&amp;amp; \sum_{i=1}^{10} e^{-yi} (0.04 Z) &amp;amp;+&amp;amp; e^{-y \cdot 10}Z\\&#xA;\Leftrightarrow \$10 =&amp;amp; \sum_{i=1}^{10} e^{-yi} (0.04 Z)\\&#xA;\Rightarrow \$70 =&amp;amp; e^{-y\cdot 10}Z&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And is there any way to solve for the zero rate by hand? (This is the reason why I'm wondering; to solve this system, a calculator is necessary, but all the other homework problems were solvable by hand!)&lt;/p&gt;&#xA;" OwnerUserId="1817" LastEditorUserId="1355" LastEditDate="2012-09-19T13:31:08.747" LastActivityDate="2016-06-03T14:29:46.577" Title="Calculate the &quot;ten year zero rate&quot;  given two bonds with two prices" Tags="&lt;interest-rates&gt;&lt;yield-curve&gt;&lt;bond&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4130" PostTypeId="2" ParentId="4129" CreationDate="2012-09-17T00:07:37.517" Score="2" Body="&lt;p&gt;The way you are trying to solve these equations makes assumptions about the rates less than 10 years and therefore the shape of the yield curve.&#xA;\$90 is the value of 8% coupons plus a 10-year zero-coupon bond.&#xA;\$80 is the value of the 4% coupons plus a 10-year zero-coupon bond.&#xA;8% coupons are worth twice 4% coupons over the same period, regardless of the interest rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So &#xA;    90 - 2*80  = value of 8% coupons - 2( value of 4% coupons) - 10-year zero-coupon bond&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;\$70 &amp;amp;= e^{-10y} \cdot 100 \\&#xA;0.7 &amp;amp;= e^{-10y} \\&#xA;\ln(0.7) &amp;amp;= -10 y \\&#xA;0.35667 &amp;amp;= 10y \\&#xA;y &amp;amp;\approx 3.57 \% \quad\quad\\&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="1418" LastEditorUserId="924" LastEditDate="2016-06-03T14:29:46.577" LastActivityDate="2016-06-03T14:29:46.577" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4131" PostTypeId="1" AcceptedAnswerId="4134" CreationDate="2012-09-17T04:46:49.567" Score="4" ViewCount="142" Body="&lt;p&gt;Aftcast is a way of simulating equity curves for different start years, usually from a large sample data ~100 years. Its kind of like start date sensitivity testing but in my case, I incorporated withdrawals from portfolio. What I am trying to see is how sustainable a portfolio would be if I were to withdrawal at different fixed rate percentages of initial portfolio starting value. (Withdrawals are also adjusted for inflation)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After adjusting portfolio return for inflation, I extracted the return and then looped over each day to calculate next period portfolio value (previous portfolio value * 1+return), and if the next period is the withdrawal period (every december of each year), i subtracted the fixed amount (0.06 if 6%). The equity curve...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/UZkpq.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not very sustainable from first glance. The problem I am having is to generate an aftcast for this entire stream of return. By this I mean I will extract the daily return and then find the equity series for each rolling 40 year period. So 1900-1940 will give me one equity series, and 1901-1941 another....etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the problem comes in here...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Qvq2G.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The returns are normal until around 1925 when there is great volatility in return (+-100%). This is caused by the relationship between withdrawal rate and portfolio value. As the portfolio value approaches zero in 1925, the fixed withdrawal rate becomes a big percentage of portfolio value. This gives aftcast scenarios way out of whack..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/jmwhg.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sorry for the long post. Is there anyone out there that have experience with generating aftcast scenarios? Am I misinterpreting some aspect of calculating portfolio value after withdrawals as if I lower the withdrawal rate to 0.01, everything is normal.. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/KfL9g.png&quot; alt=&quot;enter image description here&quot;&gt;&#xA;This is very urgent, any suggestions might help! Thanks so much.&lt;/p&gt;&#xA;" OwnerUserId="2318" LastActivityDate="2012-09-17T15:36:39.103" Title="Aftcast Generation" Tags="&lt;r&gt;&lt;backtesting&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4132" PostTypeId="1" CreationDate="2012-09-17T08:54:16.673" Score="10" ViewCount="6102" Body="&lt;p&gt;I hear it said a lot that standard MV optimization &quot;maximizes errors&quot;. But I can't find a good explanation for what exactly they mean by this &quot;maximization&quot; of estimation error. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that if you simulate $500$ matrices of returns $T-t$ months into the future from $t$ (now) to $T$ (future), and you do MV optimization on each matrix at $T$ to arrive at $500$ frontiers, then these will differ wildly from the MV optimization at $t$. (Figure 1 &lt;a href=&quot;http://compute.newfrontieradvisors.com/Research/Articles/documents/Estimation%20Error%20and%20Portfolio%20Optimization%20JOIM.pdf&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;). But what's this saying?&lt;/p&gt;&#xA;" OwnerDisplayName="user2921" LastEditorDisplayName="user2921" LastEditDate="2012-09-17T11:31:37.197" LastActivityDate="2019-07-03T23:32:42.320" Title="Markowitz mean-variance optimization as &quot;error maximization&quot;" Tags="&lt;optimization&gt;&lt;mean-variance&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="4133" PostTypeId="2" ParentId="4132" CreationDate="2012-09-17T11:09:08.607" Score="11" Body="&lt;p&gt;I think the original reference of mean-variance portfolios being “error maximizing portfolios” is:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Michaud, R. (1989). “The Markowitz Optimization Enigma: Is&#xA;  Optimization Optimal?” Financial Analysts Journal 45(1), 31–42.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The reason is that even small changes in the estimated means can result in huge changes in the whole portfolio structure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have a look at this new piece from Andrew Ang which explains this quite well (&quot;4.1 Sensitivity to Inputs&quot;, p. 26-27):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2131932&quot; rel=&quot;noreferrer&quot;&gt;Mean-Variance Investing by Andrew Ang&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;br&gt;&#xA;For a different perspective see this paper from&lt;br&gt;&#xA;&lt;a href=&quot;http://www.iijournals.com/doi/abs/10.3905/jpm.2006.644197&quot; rel=&quot;noreferrer&quot;&gt;Mark Kritzman (2006): Are Optimizers Error Maximizers? Hype versus reality?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the abstract:&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Small input errors to mean-variance optimizers often lead to large&#xA;  portfolio misallocations when assets are close substitutes for one&#xA;  another. In fact, when the assets are close substitutes, the return&#xA;  distribution of the presumed optimal portfolio is actually similar to&#xA;  the distribution of the truly optimal portfolio. Contrary to&#xA;  conventional wisdom, therefore, mean-variance optimizers usually turn&#xA;  out to be robust to small input errors when sensitivity is measured&#xA;  properly.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;A free version can be found on pages 165-168: &lt;a href=&quot;http://harrykatz.com/Final_Printer_Proof.pdf&quot; rel=&quot;noreferrer&quot;&gt;Here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT 2&lt;/strong&gt; &lt;br&gt;&#xA;A nice summary of this line of reasoning can be found in&lt;br&gt;&#xA;&lt;a href=&quot;http://www.iijournals.com/doi/abs/10.3905/pa.2014.1.3.intro?journalCode=pa&quot; rel=&quot;noreferrer&quot;&gt;Mark Kritzman (2014): Six Practical Comments About Asset Allocation&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;The Myth of Estimation Error&lt;/em&gt;:&lt;br&gt;&#xA;  Cynics often refer to mean-variance&#xA;  optimizers as error maximizers because they believe that small input&#xA;  errors lead to large output errors. This cynicism arises from a&#xA;  misunderstanding of sensitivity to inputs. Consider optimization among&#xA;  assets that have similar expected returns and risk. Errors in the&#xA;  estimates of these values may substantially misstate optimal&#xA;  allocations. Despite these misallocations, however, the return&#xA;  distributions of the correct and incorrect portfolios will likely be&#xA;  quite similar. Therefore, the errors do not matter because the&#xA;  resultant incorrect portfolio is nearly as good as the correct&#xA;  portfolio.&lt;br&gt;&#xA;  Now consider optimization among assets that have&#xA;  significantly dissimilar expected returns and risk. Errors in these&#xA;  estimates will have little impact on optimal allocations; hence again&#xA;  the return distributions of the correct and incorrect portfolios will&#xA;  not differ much. There may be some cases in which small input errors&#xA;  matter, but in most cases sensitivity to estimation error is more hype&#xA;  than reality [...]&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;(Unfortunately I haven't found a free version of the paper - if you find one let me know in the comments and I will update the post).&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2015-12-25T09:24:51.443" LastActivityDate="2015-12-25T09:24:51.443" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="4134" PostTypeId="2" ParentId="4131" CreationDate="2012-09-17T13:47:58.733" Score="2" Body="&lt;p&gt;When I first looked at this problem in the year 1999 using Monte Carlo, I realized that MC simulation do not work for modeling market events, especially when withdrawals are present; well, for several reasons (see my articles for that at my website). Thus, I developed my aftcast model in 2001 while writing my book &quot;High Expectations and False Dreams&quot;. After suggestions of fellow advisors, I made it available to fellow/advisors and general public in 2004. It might be easier for to download it and use it instead of reinventing the wheel.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yes, toward the end of the portfolio life, once the withdrawal rate exceeds a certain threshold, some parameters (asset mix, rebalancing, and so on) become irrelevant and you might get transient and  -at times- unbounded results. Don't use percentages, it is irrelevant to the client. Use dollar amounts. That solves this problem, the portfolio disappeares smoothly, the client is broke, and the advisor has no more trailer fees from it. It is similar to cutting the proverbial chicken's head (Nicholas Taleeb's chicken in his  &quot;Black Swan&quot; book) and then holding the chicken and waiting until the chicken dies, instead of measuring the blood pressure of that chicken while it dies trying to figure out if the chicken is indeed dying. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your objective is to calculate the sustainable withdrawal amounts for various time horizons, asset mixes, equity benchmarks, real yields for IIB's and so on, use my calculator, it is a &quot;single-button&quot; answer. Enter $1 million in current retirement assets, and then push the &quot;How much can I have?&quot; button, it will run a few seconds and tell you the amounts for worst case (green zone) and unlucky case (bottom decile).&lt;/p&gt;&#xA;" OwnerUserId="2962" LastEditorUserId="35" LastEditDate="2012-09-17T15:36:39.103" LastActivityDate="2012-09-17T15:36:39.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4136" PostTypeId="2" ParentId="4132" CreationDate="2012-09-17T21:05:08.563" Score="2" Body="&lt;p&gt;Let $\mu$ and $\Sigma$ be the expected mean and covariance matrices for a mean-variance optimization. For a standard, unconstrained, utility-based optimization, it can be shown that the optimal weights will equal&#xA;$$&#xA;w=\frac{1}{\lambda}\Sigma^{-1}\mu&#xA;$$&#xA;where $\lambda$ is an arbitrary risk aversion coefficient. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to measure the sensitivity of the weights to the expected return, you could calculate $$\frac{\partial w}{\partial\mu}=\frac{1}{\lambda}\Sigma^{-1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a result of the nature of the inverse of the covariance matrix, this formula suggests that arbitrary changes in $\mu$ tend to lead to large changes in portfolio weights.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2012-09-17T21:05:08.563" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4139" PostTypeId="1" CreationDate="2012-09-18T11:30:28.267" Score="3" ViewCount="994" Body="&lt;p&gt;I have 8 country stock indexes and 1 world stock index. I do not actually have time series data but I'm given the following data: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$\mu$, the vector of expected future returns for all 8 country indexes and world index (9 indexes).&lt;/li&gt;&#xA;&lt;li&gt;$\Omega$, the variance covariance matrix of all 9 indexes.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'm forming a MV efficient and Michaud resampling portfolio over the 8 country indexes - the world index is not considered an investable asset class. I want to compare the two portfolios by looking at the systematic risk and unsystematic risk of both portfolios w.r.t. the world market index. So we have the two weights vectors produced by the two methodologies:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$_1w$ (MV)&lt;/li&gt;&#xA;&lt;li&gt;$_2w$ (REF, Resampled Efficient Frontier).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;We can calculate the betas of both portfolios by going $_j\beta_p = \sum_{i=1}^8 (_jw_i )\frac{\sigma_{i,world}}{\sigma^2_{world}}$ for $j = 1,2$. Being able to sum the coefficients like this follows from OLS. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I get from here to the unsystematic and systematic risk of the portfolios? I can't get the error from the specification that generates the betas so it seems I'm stuck?&lt;/p&gt;&#xA;" OwnerDisplayName="user2921" LastEditorDisplayName="user2921" LastEditDate="2012-09-18T12:44:46.430" LastActivityDate="2012-09-18T21:09:06.543" Title="Unsystematic and systematic risk of a portfolio" Tags="&lt;beta&gt;&lt;mean-variance&gt;&lt;capm&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4140" PostTypeId="2" ParentId="4127" CreationDate="2012-09-18T13:05:05.433" Score="1" Body="&lt;p&gt;A variance swap has a set of fixing times, and the volatility between those times has no specified effect.  Therefore you end up wanting to apply a model.  For a model-free approximation, though, your formula works up to a constant.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-09-18T13:05:05.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4141" PostTypeId="2" ParentId="4124" CreationDate="2012-09-18T13:12:49.883" Score="1" Body="&lt;p&gt;Your idea of using the empirical (historical) distribution makes the most sense for risk management.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For one thing, it ensures you are working with real-world probabilities, whereas obtaining a distribution from an option pricing model (say by fitting Heston to the VIX options) would put you in risk-neutral probability space.  For another, the common stochastic vol models all do a poor job of matching VIX dynamics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, any continuous stochastic process looks like a brownian motion in sufficiently short timespans.  So the commercial providers are not &lt;em&gt;necessarily&lt;/em&gt; crazy to model VIX like equity index futures.  However, the dynamics of VIX can be far jumpier than equity index futures, and so I think they are making a mistake by ignoring that aspect.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-09-18T13:12:49.883" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4142" PostTypeId="2" ParentId="4070" CreationDate="2012-09-18T13:24:46.770" Score="1" Body="&lt;p&gt;Generally speaking, volatilities at all points of the vol surface are (positively) correlated in both empirical and theoretical models.  So if you feel you have a prediction strategy for the VIX, you have an associated directional prediction for other volatilities, and you can take advantage of that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Directional volatility bets are most often expressed (as you infer in your question) by buying/selling both a call and a put.  This is called a &lt;a href=&quot;http://en.wikipedia.org/wiki/Straddle&quot; rel=&quot;nofollow&quot; title=&quot;straddle&quot;&gt;straddle&lt;/a&gt;.  If you want to spend less time hedging, you might instead trade a &lt;a href=&quot;http://en.wikipedia.org/wiki/Iron_condor%20Iron%20Condor&quot; rel=&quot;nofollow&quot;&gt;few more options&lt;/a&gt; at the same time.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-09-18T13:24:46.770" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4143" PostTypeId="2" ParentId="4139" CreationDate="2012-09-18T14:17:50.040" Score="2" Body="&lt;p&gt;Assuming those are arithmetic returns and covariances at the horizon, calculate a $9\times1$ vector containing the betas with respect to the world index using the covariance matrix, call it $\beta$. The covariance resulting from the world index can be described as $\beta\sigma_{world}^{2}\beta'$. The matrix $\Sigma_{residual}\equiv\Omega-\beta\sigma_{world}^{2}\beta'$ will then reflect the residual covariance. Note that this residual covariance matrix is not necessarily a diagonal matrix, as some CAPM-like models would require. To get a measure of the residual risk of the portfolio, you would then calculate $w'\Sigma_{residual}w$. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastEditorUserId="2379" LastEditDate="2012-09-18T21:09:06.543" LastActivityDate="2012-09-18T21:09:06.543" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4144" PostTypeId="2" ParentId="4123" CreationDate="2012-09-18T19:31:12.230" Score="0" Body="&lt;p&gt;If you're talking about the &lt;em&gt;performance&lt;/em&gt; as the &lt;em&gt;speed&lt;/em&gt; in which the software algorithm can be executed on your hardware, then my suggestion would be to work with an averaged historical-data array. This way you can still make realtime or close-to-realtime calculations on incoming data feeds without having to consider the whole past data-density, while staying on a close-to-zero deviation from the effective values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're talking about the &lt;em&gt;performance&lt;/em&gt; as in &lt;em&gt;'outperforming the market'&lt;/em&gt; then your problem is tightly dependent on the forecasting algorithm itself and the parameters it takes to operate. The only viable way to decouple the two would be to create a bold dependency-management layer between your strategy and the algorithm that allowed its user to connect arguments from their strategy to parameters of the forecasting algorithm. This will very probably have a strong influence on the speed in which the algorithm can execute, because of all the indirection and checks that the system has to perform to remain stable and rolling.&lt;/p&gt;&#xA;" OwnerUserId="2464" LastActivityDate="2012-09-18T19:31:12.230" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4145" PostTypeId="1" AcceptedAnswerId="4146" CreationDate="2012-09-18T22:48:11.650" Score="2" ViewCount="306" Body="&lt;p&gt;I'm hand rolling some visualization algorithms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Extracting the min/max of a time series is $O(n)$, for n entries.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I want the 25% and 75% mark, I could use an $O(n \log n)$ time sort, then get the 25% and 75% marks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, is there a way to do this in linear time?&lt;/p&gt;&#xA;" OwnerDisplayName="user2936" LastEditorUserId="35" LastEditDate="2012-09-19T03:12:45.900" LastActivityDate="2012-09-19T03:12:45.900" Title="Fastest algorithm for extracting 25% and 75% marks" Tags="&lt;algorithm&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4146" PostTypeId="2" ParentId="4145" CreationDate="2012-09-18T23:01:12.800" Score="2" Body="&lt;p&gt;Yes there is a way to find kth largest element in an unsorted list in linear time &lt;a href=&quot;https://stackoverflow.com/questions/251781/how-to-find-the-kth-largest-element-in-an-unsorted-array-of-length-n-in-on&quot;&gt;here&lt;/a&gt;. However, depending on what program you are using, implementing the algorithm might not increase performance. The built-in &lt;code&gt;sort&lt;/code&gt; function is probably optimized in C, and hence is very fast.&lt;/p&gt;&#xA;" OwnerUserId="2512" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2012-09-18T23:01:12.800" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4147" PostTypeId="1" CreationDate="2012-09-19T03:33:50.403" Score="2" ViewCount="254" Body="&lt;p&gt;I'm attempting to model asset performance to Bitcoin revenue, which is a driving force in the Bitcoin community. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any model, or research being done that tracks &quot;hashes per second&quot; (MHz) to BTC earned over time?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If no prior work exists, what is the best way for me to model:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://bitcoin.stackexchange.com/q/4760/1878&quot;&gt;Various&lt;/a&gt; non-linear interdependencies&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The range of possible outcomes&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The likelihood of the particular outcome&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'm also aware of certain market forces that will occur in the near future (technology changes, valuation adjustments, etc) that I'd like to include.&lt;/p&gt;&#xA;" OwnerUserId="1098" LastEditorUserId="-1" LastEditDate="2017-04-13T12:47:38.443" LastActivityDate="2012-09-19T03:33:50.403" Title="Modeling asset performance to Bitcoin revenue" Tags="&lt;risk&gt;&lt;modeling&gt;&lt;forecasting&gt;&lt;probability&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4148" PostTypeId="1" AcceptedAnswerId="4151" CreationDate="2012-09-19T05:58:05.063" Score="5" ViewCount="533" Body="&lt;p&gt;I have developed an analytic platform in .NET, but I now have to tackle the problem of data cleaning which first starts by finding holes in time series, before actually looking to find inconsistent data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the universe I considered, there is no intraday data. I store the last prices each day and month. So, first step, how can I make sure that there are no holes?&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I generate a vector of all the dates that should have a point&lt;/li&gt;&#xA;&lt;li&gt;I check that all these dates have a point in the DB&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This is ok for monthly data because you just take the last day of the month. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what about for daily data? Exchange holidays, bank holidays, country specific holidays, etc now come into play.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do you handle this in .NET? or even in general.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="1355" LastEditDate="2012-09-19T13:29:00.543" LastActivityDate="2012-09-19T13:29:00.543" Title="How do you handle Calendars in a .NET quant system?" Tags="&lt;data&gt;&lt;programming&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4149" PostTypeId="2" ParentId="4148" CreationDate="2012-09-19T07:01:57.723" Score="2" Body="&lt;p&gt;Simple, just import one of the many publicly available holiday calendars (may need to do some import conversion through Excel or RegEx within .Net) such as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.roboforex.com/analytics/national-holidays/&quot; rel=&quot;nofollow&quot;&gt;http://www.roboforex.com/analytics/national-holidays/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and store in a custom collection such as List, where Holiday is a class that has members such as &quot;Market&quot;, &quot;Date&quot;, ...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You then just need to iterate over your historical data and generate a price point if the date is not included in the collection for the specific market in question. Note that you can easily accomplish the look up through Linq. Let me know if you are there and have issues with Linq. Happy to help out. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S.: Its obviously much better if you have access to Bloomberg or other analytical databases then you can easily import the data through their APIs. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-09-19T07:01:57.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4150" PostTypeId="2" ParentId="4108" CreationDate="2012-09-19T10:35:00.823" Score="2" Body="&lt;p&gt;Have you tried a swaption having a marked to market of the notional N at t_1=retirement age? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From t_0=contract signing untill t_1, you receive the rate r_payments and pay the risk-free/investment rate. Then you pay out a predifined rate r_retirement and you pay in the risk-free/investment rate untill t_2=death time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From your point of view, you are exposed to the default risk of the counterparty (death) given by the survival rate, with the recovery notional being N. If you do not invest at the risk-free rate, you are sensitive, in addition, to the credit risk of the counterparty you invest in. You are generating the credit risk of (defaulting) yourself. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;All the entering parameters are practically known, especially if you do not make use of the risk-free interest rate, with credit risk modellable via the spreads.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The notional N could, in addition be a nicer function which, due to missing payments, is not necessarily proportional with (t_1-t_0) and which you might overpass also by an adjustment to r_payments. &lt;/p&gt;&#xA;" OwnerUserId="2872" LastEditorUserId="2872" LastEditDate="2012-09-19T16:47:59.583" LastActivityDate="2012-09-19T16:47:59.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4151" PostTypeId="2" ParentId="4148" CreationDate="2012-09-19T12:01:43.443" Score="7" Body="&lt;p&gt;As Freddy mentioned, it's not usually a problem to get the holiday data.  &lt;strong&gt;But&lt;/strong&gt; there's a few more caveats:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;sometimes the market where the security is listed doesn't observe the local holidays&lt;/li&gt;&#xA;&lt;li&gt;sometimes the market &lt;em&gt;does&lt;/em&gt; observe the holiday but the security &lt;em&gt;doesn't&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;sometimes it's the other way around&lt;/li&gt;&#xA;&lt;li&gt;not all securities listed on one particular market follow the same rules&lt;/li&gt;&#xA;&lt;li&gt;different market places might offer the same security but with different holiday rules&lt;/li&gt;&#xA;&lt;li&gt;a lot of markets/securities have half-days too (it's like half a holiday)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;A lot of these caveats apply to intraday data only, that's why I'm not going into too much detail here, it depends on where your platform will go.  But as you can see, it's more of a classifcation problem in the long run.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We solved the &quot;holiday problem&quot; by inverting it, i.e. we keep track of trading days/hours.  In our system the basic entity is a session.  A market to us is a collection of these sessions.  A security on the other hand has an OPOL market (primary listing) and possibly other markets, and for each such listing there's a collection of (possibly overlapping) sessions.  If at a given date/time there is an active session for a security on any market, data should be there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, holidays might either affect markets or sessions.  If the market is affected no sessions will be active on that day for securities listed on that market.  If a session is affected, all securities attributed with that session will stay inactive (for the duration of that session).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in this system the rules for sessions clearly dictate if there are and how to find holes in the data (and also the opposite: data comes in even though there's no active trading session).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the programmatical bit: we use bitsets and edge triggers, whenever a session becomes active its bit is set, whenever it goes inactive the bit is cleared.  So for any point in time we can immediately say what sessions are active and through the security&amp;lt;-&gt;session association we have immediately all the securities affected.&lt;/p&gt;&#xA;" OwnerUserId="1040" LastActivityDate="2012-09-19T12:01:43.443" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4152" PostTypeId="2" ParentId="4148" CreationDate="2012-09-19T13:28:07.930" Score="3" Body="&lt;p&gt;You can try using the .Net port of QuantLib.  &lt;a href=&quot;http://www.resolversystems.com/products/quantlib-binary/&quot; rel=&quot;nofollow&quot;&gt;Here is a version of QuantLib with C# bindings&lt;/a&gt;.  QuantLib has calendars for many countries and some countries have multiple calendars (stocks vs. bonds).  It's pretty simple to check if a date is a trading day given a calendar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This solution will not address some of the points brought up by hroptatyr.&lt;/p&gt;&#xA;" OwnerUserId="2904" LastActivityDate="2012-09-19T13:28:07.930" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4153" PostTypeId="1" CreationDate="2012-09-19T23:30:19.040" Score="2" ViewCount="5245" Body="&lt;p&gt;I'm faced with the formula shown in the image below, which I just don't understand, in part because I've no grounding in stats, and in part because I don't even understand the notation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/VadxD.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's going on here? Is this showing in the first line how to compute the VaR, and then in the second line how to derive the annualized volatility from some of the variables used in the first computation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't even understand the &quot;T time intervals of 1/m years&quot; part. What's an &quot;mth&quot; of a year? And what does $\sigma_{\frac{1}{m}}$ mean? Is that the volatility for one time period? If so, then don't we need to aggregate the values for all the discrete time periods somehow? I'd expect to see a &quot;sum from 1 to m&quot; somewhere...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm totally confused, and any help would be very gratefully received.&lt;/p&gt;&#xA;" OwnerUserId="2972" LastEditorUserId="370" LastEditDate="2012-09-20T11:28:27.023" LastActivityDate="2012-09-20T11:28:27.023" Title="What does this formula (to derive annualized volatility from VaR) mean?" Tags="&lt;volatility&gt;&lt;var&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4154" PostTypeId="1" CreationDate="2012-09-20T00:35:20.893" Score="6" ViewCount="1954" Body="&lt;p&gt;I recently purchased &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470008741&quot; rel=&quot;noreferrer&quot;&gt;http://www.amazon.com/Evidence-Based-Technical-Analysis-Scientific-Statistical/dp/0470008741&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an open source repository that contains (or contains as close as possible):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;the code used&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;the data used?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The main thing is that -- reading is great, but playing with data is even more fun.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerDisplayName="user2936" LastEditorUserId="370" LastEditDate="2012-09-20T12:07:50.270" LastActivityDate="2012-09-20T17:51:27.737" Title="Code for Evidence Based Technical Analysis" Tags="&lt;books&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4155" PostTypeId="1" AcceptedAnswerId="4159" CreationDate="2012-09-20T02:44:25.037" Score="3" ViewCount="86" Body="&lt;p&gt;I am trying to wrap my head around the proper way to do this. I would like to simulate the portfolio value adjusted for inflation with a fixed withdrawal rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To simulate withdrawal rate, I will need to adjust my portfolio nominal return series to real return using CPI. After getting real return series, assume that my fixed withdrawal amount is 5% of initial equity. If my initial equity is, say, $1, then my withdrawal rate is 0.05. Since my simulation is real return based, do I need to adjust my fixed withdrawal rate for inflation or do I just keep it fixed at 0.05 and withdrawal this amount each period?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I do adjust it, I am using the following equation: &#xA;if inflation is 1% then&#xA;current withdrawal rate = 0.05 + (0.05 * 0.01) = 0.0505&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which is correct?&lt;/p&gt;&#xA;" OwnerUserId="2318" LastEditorUserId="1418" LastEditDate="2012-09-20T03:10:01.547" LastActivityDate="2012-09-20T13:45:39.943" Title="Accounting for Withdrawals" Tags="&lt;returns&gt;&lt;inflation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4156" PostTypeId="1" CreationDate="2012-09-20T07:49:56.660" Score="8" ViewCount="1360" Body="&lt;p&gt;&lt;a href=&quot;http://www.quickfixengine.org/&quot; rel=&quot;noreferrer&quot;&gt;QuickFIX&lt;/a&gt; is a well-known open-source implementation of the FIX protocol. This library has been ported to numerous languages, though for the moment I am concentrating the on C/C++ implementation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, I do not know C++ at all but my knowledge in C is rather high (professional level). My goal is to develop an order management system that will be based on QuickFIX. I would be glad to have my system both as fast as possible and well designed. Because I do not want to produce a messy product, I would prefer to implement it in C.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, my question is pretty simple: Is it possible to use QuickFIX in C project? I have been trying to figure this out with no success. I did not manage to find any information online. I would appreciate it if someone could provide her/his experience or at least point me in the right direction.&lt;/p&gt;&#xA;" OwnerUserId="1439" LastEditorUserId="35" LastEditDate="2012-09-20T11:17:59.347" LastActivityDate="2018-07-31T03:24:04.170" Title="Using QuickFIX in a C project" Tags="&lt;programming&gt;&lt;fix&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4157" PostTypeId="2" ParentId="4153" CreationDate="2012-09-20T10:44:22.960" Score="1" Body="&lt;p&gt;I guess you want to calculate vola pa for SRRI.&#xA;The logic is the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;If you have a VaR Limit for $1/m$ th of a year (e.g. if $m = 12$ then for one month which is  equivalent to $20$ banking days) and the risk free interest rate for a $1/m$ th of a year, this is $rf_{1/m}$ in the formula (e.g. $1$ month LIBOR), then $T=20$ and you can calculate the volatility for $20$ days, this is $\sigma_{1/m}$ ,which is implied by your VaR Limit.&lt;/li&gt;&#xA;&lt;li&gt;You calculate a vola pa from it. If you calculate with $20$ days in step 1 then you have $1/m = 1/12$ and you can calculate your annual volatility by multiplying the $20$-days volatility by $\sqrt{12}$ because the year has $12$ months. Take care: this assumes uncorrelated monthly returns all having the same volatility.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;EDIT: There is mix up in this answer between $T$ and $m$. Calculating the VaR with daily data we need $T=20$ and then we annualize the volatility implied by the VaR-Limit by scaling with $\sqrt{250}$.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2012-09-20T10:54:48.153" LastActivityDate="2012-09-20T10:54:48.153" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="4158" PostTypeId="2" ParentId="4156" CreationDate="2012-09-20T11:13:09.900" Score="4" Body="&lt;p&gt;The canonical QuickFIX is very C++. It has classes for the message types and uses factory patterns for a lot of the auxiliary components. It requires users to override virtual functions to define the communication callbacks. It even uses exceptions to signal certain desired state changes, whether there is an error or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most other language bindings for QuickFIX are wrappers to the C++ version. (The exception is Java, for which there is a &lt;a href=&quot;http://www.quickfixj.org/&quot; rel=&quot;nofollow&quot;&gt;complete rewrite&lt;/a&gt;.) There definitely aren't any C bindings that come with the canonical source code. So if you can't find an existing set of bindings online, you'll have to write your own.&lt;/p&gt;&#xA;" OwnerUserId="35" LastEditorUserId="35" LastEditDate="2012-09-20T11:19:25.163" LastActivityDate="2012-09-20T11:19:25.163" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4159" PostTypeId="2" ParentId="4155" CreationDate="2012-09-20T13:45:39.943" Score="1" Body="&lt;p&gt;Let real wealth at time $t$ be defined as $W_{t}^{R}\equiv\frac{W_{t}^{N}}{P_{t}}$ where $W_{t}^{N}$ is nominal wealth and $P_{t}$ is the price level indexed to one at the initial period. You want to withdraw a $x_{t}$ percent of real wealth. This would give $$x_{t}W_{t}^{R}=x_{t}\frac{W_{t}^{N}}{P_{t}}$$.You could then consider a withdrawal rate in nominal terms $y_{t}\equiv\frac{x_{t}}{P_{t}}$ (ie. that you multiply by the nominal wealth) that would effectively mimic the real withdrawal rate. When wealth grows faster than inflation, the nominal withdrawal rate should decline and vice-versa.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2012-09-20T13:45:39.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4160" PostTypeId="1" AcceptedAnswerId="7245" CreationDate="2012-09-20T15:46:24.843" Score="23" ViewCount="17804" Body="&lt;p&gt;There have been similar posts here already but nevertheless I find the question worth posting: why do some people claim that log returns of assets are more suitable for statistics than discrete returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. in the &lt;a href=&quot;http://www.esma.europa.eu/system/files/10_673.pdf&quot;&gt;ESMA CESR guidliens about SSRI&lt;/a&gt; log returns are used. I personally think that discrete returns are as good for means of risk management as continuous returns. Furthermore in portfolio context I can calculate the portfolio return by weighting the discrete returns of the assets which does not work with log returns. The time-aggregation of log returns is easier that's true. But people rather think in discrete returns. If my NAV drops from $100$ to $92$ then I have lost $8\%$ and that's it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any study on this - any good reference? Anything that I can tell my regulator why I stick to discrete returns.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2021-04-21T10:04:09.977" Title="Discrete returns versus log returns of assets" Tags="&lt;asset-returns&gt;&lt;log-returns&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="4161" PostTypeId="2" ParentId="4154" CreationDate="2012-09-20T15:50:48.423" Score="3" Body="&lt;p&gt;The companion website to the book &lt;a href=&quot;http://evidencebasedta.com/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; has a PDF download (&quot;Monte Carlo Permutation Evaluation of Trading Systems&quot;) on pages 18-20 of which there is C++ code for the permutation routine. Code for White's Reality Check test is available&#xA;from the &lt;a href=&quot;http://cran.r-project.org/web/packages/ttrTests/&quot; rel=&quot;nofollow&quot;&gt;ttrTests&lt;/a&gt; package for R.&lt;/p&gt;&#xA;" OwnerUserId="252" LastActivityDate="2012-09-20T15:50:48.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4162" PostTypeId="1" CreationDate="2012-09-20T15:51:16.413" Score="3" ViewCount="610" Body="&lt;p&gt;I have a contingent claim and I want to find out what is the best structure to meet the continent claim, how to price it and how to hedge it. I am looking more for a qualitative answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose I want to best replicate this claim $H$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given a stock $S_t$, $\text{exp} = 1$ (yrs), I need a payoff $H$ in which,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Conditional on $S_\text{exp} / S_0 \leq 0.8$, i.e the stock price decreased $20\%$ one year from now relative to the current price, then $H = \max{(0, V_\text{exp} - 0.17)}$, where $V_\text{exp}$ is the realized volatility one year from now. If the stock price did not meet the first criteria, the payout is just zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I decided to to use a stochastic vol process. I found the parameters of the stochastic vol process by running Monte Carlo simulations and simulating stock paths, and trying to find the parameters such that I am able to best fit the market prices. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An important assumption is that I can only trade the stock and options on the stock. I cannot trade volatility. Clearly, the market is incomplete because I have two uncertainties (Brownian motion in the stock and in the stochastic volatility).&#xA;I am having difficulty deciding what is the best structure to best fulfill this contingent claim and yet be able to sufficiently hedge it using stocks and options. &lt;/p&gt;&#xA;" OwnerUserId="2973" LastEditorUserId="2727" LastEditDate="2012-09-25T07:23:51.627" LastActivityDate="2012-11-24T09:03:34.727" Title="How would you hedge this structure?" Tags="&lt;hedging&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4163" PostTypeId="2" ParentId="4154" CreationDate="2012-09-20T17:51:27.737" Score="2" Body="&lt;p&gt;The Automated Trading System-blog has a few posts about the book with a helpful tool at the end:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.automated-trading-system.com/evidence-based-technical-analysis-aronson-book/&quot; rel=&quot;nofollow&quot;&gt;http://www.automated-trading-system.com/evidence-based-technical-analysis-aronson-book/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.automated-trading-system.com/bootstrap-test/&quot; rel=&quot;nofollow&quot;&gt;http://www.automated-trading-system.com/bootstrap-test/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;and here the conclusion with the free tool for the bootstrap-test:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.automated-trading-system.com/bootstrap-take-2-data-mining-bias-code-and-using-geometric-mean/&quot; rel=&quot;nofollow&quot;&gt;http://www.automated-trading-system.com/bootstrap-take-2-data-mining-bias-code-and-using-geometric-mean/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="12" LastActivityDate="2012-09-20T17:51:27.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4164" PostTypeId="2" ParentId="594" CreationDate="2012-09-20T18:08:23.297" Score="3" Body="&lt;p&gt;XVIX volume today was 11k shares. Back month VIX futures volume is almost 2k contracts in Mar13 and higher from there as you get nearer in time. Given the multiplier in the futures I don't see the problem, esp. now that the back month bid/ask spreads are usually one or two ticks wide.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the ETN product did really take off, UBS could do what Credit Suisse did with TVIX and negotiate OTC variance swaps to hedge their issuance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Until recently, UBS also had a suite of individual month VIX ETNs, which it could have netted against XVIX. They closed those in September.&lt;/p&gt;&#xA;" OwnerUserId="2378" LastActivityDate="2012-09-20T18:08:23.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4165" PostTypeId="1" CreationDate="2012-09-20T22:08:36.110" Score="15" ViewCount="13832" Body="&lt;p&gt;I'm trying to get an intuition as to why the adjusted closing price includes a dividend adjustment:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;1 - \frac{dividend}{close}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand why the adjusted closing price &quot;undoes&quot; the effect of a split on a stock. A stock split hasn't changed the economics of a company so the adjustment effectively removes the split so that the adjusted closing prices before and after the split can be compared. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A dividend does change the underlying economics however so why does the adjusted price account for it? Lastly, &lt;a href=&quot;http://ycharts.com/glossary/terms/total_return_price&quot;&gt;the formula&lt;/a&gt; also doesn't make sense.&lt;/p&gt;&#xA;" OwnerUserId="2975" LastEditorUserId="35" LastEditDate="2012-09-21T03:40:56.580" LastActivityDate="2015-11-19T10:05:42.420" Title="Why does the adjusted closing price take into account dividends?" Tags="&lt;equities&gt;&lt;adjusted&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4166" PostTypeId="2" ParentId="4162" CreationDate="2012-09-21T01:07:21.043" Score="1" Body="&lt;p&gt;So just to clear the payoff, it's an option on realized volatility (not variance) conditional on the stock? Are you sure it's not a conditional variance swap or a knock-in variance swap?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(a) I hope you are doing it in some sort of index, cause I'd hate to hedge this in single stock. &#xA;(b) In an index this would be very  costly (the skew would make the probability pretty rich. &#xA;(c) No model properly replicates the volatility dynamics, you are going to have be super-conservative about your hedging assumptions.&lt;/p&gt;&#xA;" OwnerUserId="2906" LastActivityDate="2012-09-21T01:07:21.043" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4167" PostTypeId="2" ParentId="4165" CreationDate="2012-09-21T03:37:19.563" Score="19" Body="&lt;p&gt;Let's assume there is no adjustment and that a stock's price is the same after a dividend payment as before. Then I could get free money simply by buying a stock the day before the ex-date and then selling the stock right after the dividend distribution. Clearly no such arbitrage opportunity exists. Therefore, the price of the stock &lt;em&gt;after&lt;/em&gt; the dividend payment must be the same as the price &lt;em&gt;before&lt;/em&gt; the payment minus the dividend amount. That is, the &lt;strong&gt;adjusted&lt;/strong&gt; price is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;adj = close - dividend&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other argument, as you point-out in your question, is that the fundamentals have indeed changed and that a company with less cash on hand must have a lower market cap. That is, the number of shares outstanding hasn't changed (unlike in a split), so the share price must change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get the ratio you asked about, divide both sides of the above equation by $close$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\frac{adj}{close} = \frac{close}{close} - \frac{dividend}{close} = 1 - \frac{dividend}{close}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, I can get the adjusted price simply by multiplying the closing price by $1 - \frac{dividend}{close}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To conclude: when looking at a stock's &lt;em&gt;returns&lt;/em&gt; from one day to the next, the historical share &lt;em&gt;price&lt;/em&gt; must be adjusted for all corporate actions (splits, dividends, and name changes) to present a coherent picture of returns. Otherwise, the returns will appear to have unrealistic gaps.&lt;/p&gt;&#xA;" OwnerUserId="35" LastEditorUserId="35" LastEditDate="2012-09-21T11:06:35.270" LastActivityDate="2012-09-21T11:06:35.270" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4168" PostTypeId="2" ParentId="4156" CreationDate="2012-09-21T08:25:46.460" Score="4" Body="&lt;p&gt;It's not exactly QuickFIX but look at &lt;a href=&quot;https://github.com/penberg/libtrading&quot; rel=&quot;nofollow&quot;&gt;libtrading&lt;/a&gt;.  Maybe you can tailor it to your needs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the README:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;libtrading is a library for electronic trading. Its purpose is to support market data and order entry network protocols used by trading venues across the world.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1040" LastActivityDate="2012-09-21T08:25:46.460" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4169" PostTypeId="2" ParentId="3599" CreationDate="2012-09-21T09:43:04.783" Score="4" Body="&lt;p&gt;IMO, there is only one satisfactory answer to your question. You must measure the actual total cost of implementation. Spread, slippage, comish. Test what you trade/trade what you test.&lt;/p&gt;&#xA;" OwnerUserId="2979" LastActivityDate="2012-09-21T09:43:04.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4170" PostTypeId="5" CreationDate="2012-09-21T15:00:19.123" Score="0" Body="&lt;p&gt;Dividends may be in the form of cash, stock or property. The dividend is most often quoted in terms of the dollar amount each share receives (dividends per share). It can also be quoted in terms of a percent of the current market price, referred to as dividend yield.&lt;/p&gt;&#xA;" OwnerUserId="2909" LastEditorUserId="2909" LastEditDate="2012-09-21T15:17:40.523" LastActivityDate="2012-09-21T15:17:40.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4171" PostTypeId="4" CreationDate="2012-09-21T15:00:19.123" Score="0" Body="Dividends are payments made by a corporation to its shareholder members. It is the portion of corporate profits paid out to stockholders." OwnerUserId="2909" LastEditorUserId="2909" LastEditDate="2012-09-21T15:17:23.740" LastActivityDate="2012-09-21T15:17:23.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4172" PostTypeId="1" AcceptedAnswerId="4219" CreationDate="2012-09-22T09:48:15.130" Score="5" ViewCount="370" Body="&lt;p&gt;I have 1 year time series data of 300 constituents of the Australian All Ordinaries index (which is composed of 491 firms). The missing firms are mostly smaller firms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I run the market model $R_{it} = a_i + b_i R_{mt} + e_t$ for $i \in \{1,...,300\}$. Then I take $\textrm{mean}(\hat{b}_i)$ and it's equal to $0.60$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it a problem that it isn't approximately $1.0$? $0.6$ seems a bit low. Is a potential explanation that the AORD is market capitalization weighted, but I'm taking the unweighted mean of $\hat{b}_i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Concern is heightened when reading &quot;Stock market crashes, firm characteristics, and stock returns&quot; which took a similar mean over NASDAQ and got 1.20 average market model slope estimate (however they use CRSP). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;All data is from Datastream.&lt;/p&gt;&#xA;" OwnerDisplayName="user2921" LastEditorDisplayName="user2921" LastEditDate="2012-09-29T10:04:11.553" LastActivityDate="2012-09-29T10:16:55.947" Title="Average beta of index consitutents w.r.t. the index is 0.60" Tags="&lt;time-series&gt;&lt;beta&gt;&lt;index&gt;&lt;capm&gt;&lt;market-model&gt;" AnswerCount="1" CommentCount="15" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4173" PostTypeId="1" CreationDate="2012-09-22T09:49:37.793" Score="2" ViewCount="823" Body="&lt;p&gt;I am looking for a way to take an accumulation/distribution indicator and normalize it&#xA;so I can compare a bunch of stocks with stock prices that have no relationship with each other.&#xA;  EDIT: This would be straightforward on interday data, but the problem is with intraday data:  you can't get an intraday normalized volume measure, because the volume is always skewed where there is huge volume in the first and last half out, and &lt;em&gt;relatively&lt;/em&gt; meaningless volume otherwise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I am currently doing is dividing the different AD measures by 1,000 and then capping at +/-80 anything above/below that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;closeVsLow = (close - low) ;&#xA;closeVsHigh = (high - close) ;&#xA;closeVsOpen = (close - open) ;&#xA;myrange = (high - low) ;&#xA;myVolume = volume;&#xA;&#xA;AD= ((closeVsLow - closeVsHigh) / myrange) * volume;&#xA;pvalue = acdOne / 1000;&#xA;if (pvalue &amp;gt; 80) then pValue = 80;&#xA;if (pvalue &amp;lt; -80) then pValue = -80;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a better way of normalizing this?&lt;/p&gt;&#xA;" OwnerUserId="2983" LastEditorUserId="2983" LastEditDate="2012-09-23T18:34:49.487" LastActivityDate="2012-09-23T18:34:49.487" Title="normalized accumulation distribution" Tags="&lt;quant-trading-strategies&gt;&lt;normal-distribution&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4174" PostTypeId="1" CreationDate="2012-09-22T12:05:08.587" Score="5" ViewCount="796" Body="&lt;p&gt;I am aware of: &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0471668265&quot; rel=&quot;nofollow&quot;&gt;Encyclopedia of Chart Patterns&lt;/a&gt;, &#xA;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0070120579&quot; rel=&quot;nofollow&quot;&gt;Encyclopedia of Technical Analysis&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Question&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I'm wondering if there's something similar, but in the form of:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Encyclopedia of Statistical Backtesting to see if you're being fooled by randomness&quot; and &quot;Encyclopedia of techniques for generating random forex patterns.&quot;&lt;/p&gt;&#xA;" OwnerDisplayName="user2936" LastEditorUserId="467" LastEditDate="2012-09-26T11:34:46.620" LastActivityDate="2013-03-05T22:16:58.813" Title="Encyclopedia of Statistical Tests" Tags="&lt;backtesting&gt;&lt;statistics&gt;" AnswerCount="6" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4175" PostTypeId="2" ParentId="450" CreationDate="2012-09-22T12:23:40.430" Score="4" Body="&lt;p&gt;Stooq has intraday data for the stock market&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://stooq.com/db/h/&quot; rel=&quot;nofollow&quot;&gt;http://stooq.com/db/h/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.quantshare.com/sa-426-6-ways-to-download-free-intraday-and-tick-data-for-the-us-stock-market&quot; rel=&quot;nofollow&quot;&gt;http://www.quantshare.com/sa-426-6-ways-to-download-free-intraday-and-tick-data-for-the-us-stock-market&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2862" LastActivityDate="2012-09-22T12:23:40.430" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4176" PostTypeId="1" AcceptedAnswerId="4178" CreationDate="2012-09-22T23:24:27.180" Score="1" ViewCount="248" Body="&lt;p&gt;Is historical information on the counts of trades in single stocks, futures, options etc. available somewhere for download or purchase? If not, which ways can you think of to gather it?&lt;/p&gt;&#xA;" OwnerUserId="2284" LastActivityDate="2012-09-23T03:54:08.050" Title="Trade Count Time Series" Tags="&lt;trade&gt;&lt;time&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4177" PostTypeId="2" ParentId="4176" CreationDate="2012-09-23T00:41:15.813" Score="1" Body="&lt;p&gt;Its not available for free anywhere that I know of.  Your only option is to purchase tick data for the instruments you're interested in and then count the ticks per trading session (or whichever timeframe you want to use).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: This link might be interesting for you regarding how to get market data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.quantshare.com/sa-426-6-ways-to-download-free-intraday-and-tick-data-for-the-us-stock-market&quot; rel=&quot;nofollow&quot;&gt;http://www.quantshare.com/sa-426-6-ways-to-download-free-intraday-and-tick-data-for-the-us-stock-market&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2987" LastActivityDate="2012-09-23T00:41:15.813" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4178" PostTypeId="2" ParentId="4176" CreationDate="2012-09-23T03:54:08.050" Score="1" Body="&lt;p&gt;Interactive Brokers provides it as a field called &lt;code&gt;count&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;a href=&quot;http://www.interactivebrokers.com/en/software/api/apiguide/c/historicaldata.htm&quot; rel=&quot;nofollow&quot;&gt;this page&lt;/a&gt; of the &lt;a href=&quot;http://www.interactivebrokers.com/en/software/api/api.htm&quot; rel=&quot;nofollow&quot;&gt;IB API Reference Guide&lt;/a&gt; &lt;code&gt;count&lt;/code&gt; is described as follows&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When TRADES historical data is returned, represents the number of trades that occurred during the time period the bar covers.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="508" LastActivityDate="2012-09-23T03:54:08.050" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4179" PostTypeId="2" ParentId="4173" CreationDate="2012-09-23T16:00:08.087" Score="1" Body="&lt;p&gt;If I understand well, one part of your analytic is already &lt;em&gt;normalized&lt;/em&gt; (&lt;code&gt;(closeVsLow - closeVsHigh) / myrange&lt;/code&gt;), but not the other (&lt;code&gt;volume&lt;/code&gt;). &#xA;If you just aim to compare the values of &lt;code&gt;AD&lt;/code&gt; from any stock with the other, why not normalizing &lt;code&gt;volume&lt;/code&gt;by the &lt;em&gt;usual daily volume&lt;/em&gt; (median of the daily volume) of the stock during the last 60 days?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, if you really want to detect &lt;em&gt;outliers&lt;/em&gt; in terms of relative positioning of open, high, low and close, I suggest you read the following paper by Garman and Klass: &lt;a href=&quot;http://www.fea.com/resources/a_estimation_of_security_price.pdf&quot; rel=&quot;nofollow&quot;&gt;On the Estimation of Security Price Volatility from Historical Data&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course the volume will not be taken into account (they just use a diffusive assumption on the price). But if you &lt;em&gt;consider that volume should be homogenous to time&lt;/em&gt; in usual conditions, then you can extract from their paper an interesting theoretical statistic on how &lt;em&gt;normal&lt;/em&gt; is the value of the conjunction of (open,high,low,close,volume). There is a paper by Jemery Large: &lt;a href=&quot;http://www.uclouvain.be/cps/ucl/doc/core/documents/Large.pdf&quot; rel=&quot;nofollow&quot;&gt;Estimating Quadratic Variation When Quoted Prices Change by a Constant Increment&lt;/a&gt; that could be useful to read too.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2012-09-23T16:00:08.087" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4180" PostTypeId="2" ParentId="3875" CreationDate="2012-09-24T02:40:53.803" Score="1" Body="&lt;p&gt;As you said, this sort of financial data can be well aggregated using cubes; &lt;a href=&quot;http://www.icCube.com&quot; rel=&quot;nofollow&quot;&gt;icCube&lt;/a&gt; is for example a fast in-memory OLAP server you can access via XMLA clients or JAVA or Javascript native API (on top of the MDX language and HTTP protocol).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[edit after comment] open/close/high/low are types of aggregation supported by icCube; so creating this kind of 'bars' feature in icCube is a matter of defining several measures (with their own aggregation type) from the tick data (lowest granularity and only one to be persisted). Then around these measures several dimensions can be built (time, financial instrument types, etc...). Quite a classic star schema actually with no specific requirements.&lt;/p&gt;&#xA;" OwnerUserId="2990" LastEditorUserId="2990" LastEditDate="2012-09-24T05:09:49.343" LastActivityDate="2012-09-24T05:09:49.343" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4181" PostTypeId="1" CreationDate="2012-09-24T09:44:22.300" Score="12" ViewCount="7548" Body="&lt;p&gt;I am looking to start developing a trend following strategy and have been looking to do something in either C# or Java and wondered if there was a library or framework out there that would make backtesting a bit easier?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have looked at NinjaTrader(NT7) and it has some good API methods to allow you to run say a Donchian Channel/ATR on the stock data and use the values in your calculations of order entries and I wondered if there were similar libraries around that would do this in the programming world outside of an application like NT7?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know about things like quantlib but these are more mathematical based and I know these can be programmed in but I didn't want to reinvent the wheel if there was already a chunk of these indicator style things already written somewhere?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance and I hope this question is within the guidelines for posting here.&lt;/p&gt;&#xA;" OwnerUserId="2991" LastActivityDate="2016-06-08T03:08:19.337" Title="Library of basic indicators" Tags="&lt;programming&gt;&lt;indicator&gt;&lt;library&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4182" PostTypeId="2" ParentId="4181" CreationDate="2012-09-24T10:16:21.923" Score="9" Body="&lt;p&gt;Yes, there are. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For pure technical indicator libraries I would first check out:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.ta-lib.org/&quot;&gt;http://www.ta-lib.org/&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Its open source and they provide APIs for both C# and Java among others.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me know if you look for commercial ones but this one is definitely the most comprehensive in terms of open source code. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-09-24T10:16:21.923" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="4184" PostTypeId="2" ParentId="3857" CreationDate="2012-09-25T10:46:04.827" Score="1" Body="&lt;p&gt;Dealing with model error under stochastic volatility (in a more formal way) you could use the UVM (Uncertain Volatility Framework). Here are what i think are the most seminal references:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Avellenada et al (1995) Pricing And Hedging Derivative Securities In Markets With Uncertain Volatilities&#xA;&lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.50.3736&quot; rel=&quot;nofollow&quot;&gt;http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.50.3736&lt;/a&gt;&#xA;&lt;br&gt;&#xA;Lyons (1995) Uncertain Volatility and the risk-free synthesis of derivatives&#xA;&lt;a href=&quot;http://it.scribd.com/doc/40177754/Lyons-Uncertain-Volatility-and-Risk-Free-Synthesis-of-Derivatives-Appl-math-Finance&quot; rel=&quot;nofollow&quot;&gt;http://it.scribd.com/doc/40177754/Lyons-Uncertain-Volatility-and-Risk-Free-Synthesis-of-Derivatives-Appl-math-Finance&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But you can also find some review of the topic (just google UVM).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This answers somehow lead you into the field of stochastic control problems which can be quite technical. One thing i remembered is: If you assume your volatility to be bounded $\sigma_t \in [\sigma_{\min}, \sigma_{\max}]$ you can price a contingent claim under two different viewpoints. One that is beneficial for the long side and one that is beneficial for the short side (by simply assuming in each case that the &quot;true&quot; volatility always has the most beneficial value for the respective side). All else being equal this should give you the arbitrage-free bid/ask prices in this framework. &lt;br&gt; &lt;br&gt;&#xA;So if you turn the problem around here you could price an existing contingent claim by means of your stochastic volatility model and end up somewhere between the bid and the ask i would say you should be okay.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2012-09-25T10:46:04.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4185" PostTypeId="2" ParentId="4181" CreationDate="2012-09-25T17:37:50.447" Score="2" Body="&lt;p&gt;I believe the R library &lt;a href=&quot;http://www.quantmod.com/examples/&quot; rel=&quot;nofollow&quot;&gt;quantmod&lt;/a&gt; has some pre-packaged tools.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2012-09-25T17:37:50.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4186" PostTypeId="2" ParentId="3857" CreationDate="2012-09-25T18:27:45.453" Score="0" Body="&lt;p&gt;I presume you are trying to do that so you can price exotic variance? The general thought process is that no matter how hard you try, you would not be able to perfectly fit the wings using one of these models (not within the bid/offer). However, most probably you are just trying to replicate the dynamics, so best thing is to come up with some sort of adjuster framework. Anyway, my 0.02 Vega.&lt;/p&gt;&#xA;" OwnerUserId="2906" LastActivityDate="2012-09-25T18:27:45.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4187" PostTypeId="2" ParentId="4108" CreationDate="2012-09-25T18:32:32.120" Score="0" Body="&lt;p&gt;In principle, this seems to be a job for &lt;a href=&quot;http://webdocs.cs.ualberta.ca/~sutton/book/4/node4.html&quot; rel=&quot;nofollow&quot; title=&quot;policy iteration&quot;&gt;policy iteration&lt;/a&gt;.  In options pricing, we can use policy iteration for early exercise conditions (or other intermediate stopping times) as seen, for example, &lt;a href=&quot;http://webdocs.cs.ualberta.ca/~dale/papers/ewrl08.pdf&quot; rel=&quot;nofollow&quot; title=&quot;here&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;http://arxiv.org/pdf/1012.4976v4&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, since your problem of identifying $r^*$ is just one-dimensional and integer-valued, you may find it quicker and easier to simply iterate potential values of $r^*$ to identify the optimal one as an inner loop of your optimization process for $\rho, \gamma, k, \beta$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is to say, the code for the objective function you fit in determining the parameters looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;myObj(rho, gamma, k, beta, observedProb) {&#xA;  for r in (1:100) {&#xA;    retireValue[r] = V_t(r)&#xA;  }&#xA;  rStar = argmax( retireValue )&#xA;  dist = modelRetirePro(rStar, rho, gamma, k, beta) - observedProb&#xA;  return dist*dist&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-09-25T18:32:32.120" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4188" PostTypeId="1" AcceptedAnswerId="4193" CreationDate="2012-09-25T18:59:09.440" Score="9" ViewCount="427" Body="&lt;p&gt;In the recent time-series of bonds issued by (for example) Germany, Austria and France we see an unfamiliar phenomenon: negative yields. This is mainly the issue on the short end of the yield curve. For a picture see: &#xA;&lt;a href=&quot;http://www.ecb.europa.eu/stats/money/yc/html/index.en.html&quot;&gt;http://www.ecb.europa.eu/stats/money/yc/html/index.en.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, why banks or possibly other companies are willing to pay a government for holding their money?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would it not make more sense to simply hold the cash instead? Stuffing cash under the mattress may be risky and costly for an individual but not for a financial institution. A bank may park money in an ECB account and get a minimal but positive overnight rate for doing so, right? &lt;/p&gt;&#xA;" OwnerUserId="2822" LastActivityDate="2012-09-28T08:28:23.490" Title="Government bonds with negative yield" Tags="&lt;interest-rates&gt;" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4189" PostTypeId="2" ParentId="4188" CreationDate="2012-09-25T19:07:54.857" Score="0" Body="&lt;p&gt;Overnight and repo rates might be even less favorable when counterparty risk, and the hedging that goes with it, is considered.  Strange world these days...&lt;/p&gt;&#xA;" OwnerUserId="2732" LastActivityDate="2012-09-25T19:07:54.857" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="4190" PostTypeId="2" ParentId="4181" CreationDate="2012-09-25T20:32:36.130" Score="3" Body="&lt;p&gt;You might have a look into the CRAN's &quot;Empirical Finance&quot; task view. It lists a whole bunch of R packages for time-series analysis and construction of automatic trading rules. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Link: &lt;a href=&quot;http://cran.r-project.org/web/views/Finance.html&quot; rel=&quot;nofollow&quot;&gt;http://cran.r-project.org/web/views/Finance.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2822" LastActivityDate="2012-09-25T20:32:36.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4191" PostTypeId="2" ParentId="2820" CreationDate="2012-09-25T23:22:55.867" Score="0" Body="&lt;p&gt;Singular Spectrum Analysis ( SSA ) is a relatively new technique ( although Lorenz suggested something similar 1956 ) that is starting to be more widely used. The jury is still out on just how much underlying structure, if any, there actually is in financial time series. Nonetheless a very powerful and easy to use data smoothing and filtering/de-noising technique. A very basic Excel and VBA demonstration available &lt;a href=&quot;http://www.scribd.com/peter_urbani&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="2911" LastActivityDate="2012-09-25T23:22:55.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4192" PostTypeId="2" ParentId="4188" CreationDate="2012-09-26T11:01:53.123" Score="3" Body="&lt;p&gt;By holding the bond, you can fund yourself cheaper with repos, so the fair comparison is to check that if you are still negative after taking in account the repo rate you save from the funding rate by posting collateral.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition to that, as a bank you may have to hold the securities as a hedge/replication for another trade or you may have to hold a minimum of securities as part of a market making activities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are as well many financial institutions which do not have access directly to the ECB, did you factor all of this in your analysis ?&lt;/p&gt;&#xA;" OwnerUserId="2908" LastActivityDate="2012-09-26T11:01:53.123" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4193" PostTypeId="2" ParentId="4188" CreationDate="2012-09-26T11:33:15.563" Score="5" Body="&lt;p&gt;Taking the case of companies other than the bank, when you have a large amount of cash, you won't stock it in your backyard as there would be insurance and logistics costs that would cost you more than the negative government yield.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe the main reason why people are willing to accept the negative yield is essentially for counterparty risk diversification reasons. Putting your money in a single bank makes you vulnerable to the default risk of that bank (and don't even think it doesn't exist). So you can diversify through several banks but you're still exposed to the overall banking sector risk. So, the next step is to diversify using government bonds, which are likely to be safer than banks. I've seen it used for foreign exchange trades where you don't want to take the risk of a bank for example.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2012-09-26T11:33:15.563" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4194" PostTypeId="2" ParentId="4174" CreationDate="2012-09-26T11:38:25.590" Score="1" Body="&lt;p&gt;I believe this is very difficult to do because of the different nature of statistical tests. Some of them are used to test the assumption of normality, some of them allow you to compare the volatility of different samples, some of them allow you to determine the suitability of a specific model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially you will find the basic ones on any good statistical book with a hypothesis testing chapter. For the more advanced one, you will need an introduction to the topic first which require ... a book by itself.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2012-09-26T11:38:25.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4195" PostTypeId="2" ParentId="4174" CreationDate="2012-09-26T12:22:30.457" Score="0" Body="&lt;p&gt;There is &quot;A Review of Backtesting and Backtesting Procedures&quot; by Sean D. Campbell. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is related to VaR backtesting, but the article discusses the general properties of unconditional coverage and independence, giving the statistical power properties of different backtests. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do hope it helps.&lt;/p&gt;&#xA;" OwnerUserId="2872" LastActivityDate="2012-09-26T12:22:30.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4196" PostTypeId="2" ParentId="4188" CreationDate="2012-09-26T12:30:53.410" Score="0" Body="&lt;p&gt;Cash is not unlimited. And, if everybody invested in cash while cash getting unlimited, in the end one is in a world filled with papers, which lose their value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly, but now last, banks, governmental institutions etc are obliged by (inter)national agreements to keep a percentage of their assets in such type of sure assets (A1 assets as per Basel III definitions). And this percentage has been recently increased, on a background of governments scheduling a decrease in their debt/emmited bonds. &lt;/p&gt;&#xA;" OwnerUserId="2872" LastEditorUserId="2872" LastEditDate="2012-09-28T08:28:23.490" LastActivityDate="2012-09-28T08:28:23.490" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4198" PostTypeId="2" ParentId="4174" CreationDate="2012-09-26T19:44:57.313" Score="0" Body="&lt;p&gt;If you run enough tests, you are guaranteed to find something that &quot;works&quot; in a backtest.   The problem is.....Does it work in real time trading?   If not, then you were &quot;fooled by the backtest&quot;.    If it does work, the next question is.....For how long?    Markets evolve 100% of the time.   So, when the thing that &quot;works&quot; eventually dies out, was it really there or were you just lucky?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The bottom line is.....Is it reasonable to assume that what you're looking for is predictable?   If not, then why waste your time.   If so, then what advantage do you have over others in exploiting that predictability?&lt;/p&gt;&#xA;" OwnerUserId="392" LastActivityDate="2012-09-26T19:44:57.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4199" PostTypeId="1" AcceptedAnswerId="4209" CreationDate="2012-09-27T08:20:35.223" Score="7" ViewCount="3818" Body="&lt;p&gt;This question follows up my answer and the related comment to this &lt;a href=&quot;https://quant.stackexchange.com/questions/4188/government-bonds-with-negative-yield&quot;&gt;post&lt;/a&gt; and in general relates to counterparty risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you buy a financial asset, this asset goes in your account at your &lt;a href=&quot;http://en.wikipedia.org/wiki/Custodian_bank&quot; rel=&quot;nofollow noreferrer&quot;&gt;custodian bank&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So assume you bought some Swiss Government bond and that your custodian is, say, JP Morgan. What happens if JP Morgan goes bankrupt like Lehman Brothers?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are you sure to keep your bond? Are you sure to lose it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The underlying question is: to the Swiss government, who is the bond holder? You, or the bank?&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2012-09-28T10:29:48.027" Title="What happens if a custodian bank defaults?" Tags="&lt;counterparty-risk&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4200" PostTypeId="2" ParentId="4174" CreationDate="2012-09-27T12:07:35.840" Score="1" Body="&lt;p&gt;You probably would do well to understand the question you are asking. Read the seminal text &quot;Subset Selection In Regression&quot; on the subject. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An encyclopedia of statistical tests applied without understanding would be as damaging to your wealth as both the Encyclopedias you mention above - if I read into your question correctly.&lt;/p&gt;&#xA;" OwnerUserId="3006" LastActivityDate="2012-09-27T12:07:35.840" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4201" PostTypeId="1" AcceptedAnswerId="10063" CreationDate="2012-09-27T16:51:14.747" Score="10" ViewCount="4686" Body="&lt;p&gt;This question is only tangentially related to quantitative finance. Scott Patterson's book The Quants describes how a quant at Kidder Peabody figured out a strategy to playing Liar's Poker in the late 80s. This strategy spread among quants at investment banks and led to it not being played any more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a simple description of the basics of the game for those not familiar:&#xA;&lt;a href=&quot;http://www.investopedia.com/terms/l/liars-poker.asp#axzz27gZIYnwx&quot;&gt;http://www.investopedia.com/terms/l/liars-poker.asp#axzz27gZIYnwx&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The strategy described in Patterson's book was more or less to use the information from your own bill to have more confidence in making large bets. For instance, if you have two 3s on your bill when the previous bid was four 9s, then rather than bid five 3s you should bid 10 or more 3s (when there were 10 players). How much you should increase your bet in the strategy was likely based on Bayesian reasoning, though the book does not go into that much detail. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this really the best strategy or only the best strategy under some conditions?&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2014-01-27T16:51:12.260" Title="Strategies for Liar's Poker" Tags="&lt;probability&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4202" PostTypeId="1" AcceptedAnswerId="4204" CreationDate="2012-09-27T17:49:03.250" Score="6" ViewCount="3144" Body="&lt;p&gt;I am using &lt;code&gt;quadprog&lt;/code&gt; in MATLAB for very simple mean-variance optimization, with less than 100 assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is quite fast but if I run a strategy with daily rebalancing, the execution time can add up very quickly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know any faster solver, particularly in MATLAB?&lt;/p&gt;&#xA;" OwnerDisplayName="user2163" LastEditorUserId="467" LastEditDate="2012-09-27T20:51:27.840" LastActivityDate="2016-01-08T11:03:13.867" Title="Fastest solver possible for portfolio optimization" Tags="&lt;programming&gt;&lt;optimization&gt;&lt;mean-variance&gt;" AnswerCount="5" CommentCount="6" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4203" PostTypeId="1" CreationDate="2012-09-27T19:24:43.980" Score="0" ViewCount="778" Body="&lt;p&gt;I am researching the past five year return for the securities in the top and bottom 10 percentile of the S&amp;amp;P 500 on date 5 years ago.  I used Bloomberg to get this data.  When I searched for the top 10 percent of stocks based on P/E ratio in the S&amp;amp;P 500 5 years ago, my searched returned 48 stocks.  Why was it 48 instead of 50?&lt;/p&gt;&#xA;" OwnerUserId="2944" LastActivityDate="2013-04-26T19:04:21.493" Title="S&amp;P 500 P/E percentile" Tags="&lt;research&gt;&lt;market-data&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4204" PostTypeId="2" ParentId="4202" CreationDate="2012-09-27T20:47:57.187" Score="6" Body="&lt;p&gt;I believe there are several ways you can tackle your problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, you mentioned that your perform several optimizations. One solution that comes to mind instead of speeding up the optimization itself is to perform the optimizations in parallel, so you could look at Mathwork's &lt;a href=&quot;http://www.mathworks.ch/products/parallel-computing/index.html;jsessionid=9729f07ec7b94c177d648e664590&quot; rel=&quot;nofollow&quot;&gt;Parallel Computing Toolbox&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, providing the optimizer with a good initial guess reduces the execution time, by how much depends on the problem. In this case the optimal weights for the previous day can be such a guess.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Third, if you want to speed up the optimization, you have basically two approaches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Either you can use the same method but with a package that is implement in a more optimal fashion, and you could look at packages such as &lt;a href=&quot;http://www.nag.co.uk/&quot; rel=&quot;nofollow&quot;&gt;NAG&lt;/a&gt;'s.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise, you believe that there is another method that would be better at finding a solution. I've seen people use &lt;a href=&quot;http://en.wikipedia.org/wiki/Conic_optimization&quot; rel=&quot;nofollow&quot;&gt;Conic Optimization&lt;/a&gt; for this kind of problems and I know that &lt;a href=&quot;http://www.mosek.com/&quot; rel=&quot;nofollow&quot;&gt;MOSEK&lt;/a&gt; have a MATLAB package for that method. You can also  have a look at their &lt;a href=&quot;http://docs.mosek.com/whitepapers/portfolio.pdf&quot; rel=&quot;nofollow&quot;&gt;white paper&lt;/a&gt; for more details about this approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more theory on numerical optimizations such as quadratic programming you could take a look at &lt;a href=&quot;http://www.springer.com/mathematics/book/978-0-387-30303-1&quot; rel=&quot;nofollow&quot;&gt;Numerical Optimization by Nocedal and Wright&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="848" LastEditDate="2012-09-29T08:19:48.580" LastActivityDate="2012-09-29T08:19:48.580" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4205" PostTypeId="2" ParentId="708" CreationDate="2012-09-27T23:40:38.403" Score="1" Body="&lt;p&gt;Timeserieses of pre-play betting markets look quite different than classical stock markets or forex-like stuff. Monitoring exchanges like betfair, the volume kind of skyrockets in the last 15 minutes before the start. The long hours before the race start there are basically no bets matched and the bid-ask-spread is enormous. In the last minutes there is ten fold the volume traded then in the whole hours before. Price fluctuation increases in amplitude and frequency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given that, applying classical WMAs for example won't work. To make it more comparable with its predecessing timeline, probably some kind of constantly increasing sample ratio could help.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Since very little about the event in question actually changes before&#xA;  it starts the movement in price must be down to pure market forces.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;True. Nevertheless, statistic shows, that the final market price reflects the win probabilities much better than the price the hours before. So if you want to predict short term market movements, you should also consider some final estimate for the odds and the estimated winning probability to give you some idea, where the travel will go in the long run. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Besides that - it's close to a random walk. Trying to find an edge, it helps, that the fees for trading are calculated on the total result of your bets on a race market. Nevertheless, it's a lot, so at least we couldn't find any useful edge there. Good luck on that!&lt;/p&gt;&#xA;" OwnerUserId="3012" LastActivityDate="2012-09-27T23:40:38.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4206" PostTypeId="2" ParentId="708" CreationDate="2012-09-28T05:10:24.967" Score="3" Body="&lt;p&gt;Increased volatility towards the event start is definitely from increased order flow.  There are some papers specifically on &quot;prediction markets&quot;, the ones with practical applications are on market making which I suspect is generally a loss-making operation conducted by the exchanges themselves when a market is opened.  Given the short-time periods and small ranges you probably want to be looking at market microstructure and HFT.&lt;/p&gt;&#xA;" OwnerUserId="3013" LastActivityDate="2012-09-28T05:10:24.967" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4207" PostTypeId="1" AcceptedAnswerId="4233" CreationDate="2012-09-28T06:12:08.577" Score="1" ViewCount="439" Body="&lt;p&gt;I have to price what my lecturer calls &quot;Bull and Bear Equity Performance Bonds&quot;. Basically there's dates $t_i \in [0,T]$, where $t_i - t_{i-1}$ is the same for all choice of $i$. On each date the bull bond will pay coupon $C_i := max\{C_{min},C_{min}(1+R_i)\}$, where $R_i = \frac{S_t}{S_{t-1}}-1$, $S_t$ is the stock price process. The coupon for the bear bonds are similarly defined. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do any of you know any references/books that deal with the pricing of this derivative? I went through the indexes of 20+ derivatives books in my library and could find 0 mentions of equity-linked notes, bull/bear performance bonds. Best I found was a 1 page qualitative dicsussion of &quot;notes&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerDisplayName="user2921" LastActivityDate="2012-10-08T01:37:00.940" Title="equity linked notes (bull/bear equity performance bonds)" Tags="&lt;equities&gt;&lt;derivatives&gt;&lt;bond&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4208" PostTypeId="1" CreationDate="2012-09-28T06:43:57.443" Score="9" ViewCount="3581" Body="&lt;p&gt;My question: How can I compare the Resampled Frontier (REF) to the standard MVO frontier when I have been provided with $\mu$, $\Omega$, and don't have access to true future data to test real out of sample performance (i.e. these parameters are &quot;current&quot;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for some way to determine which one is superior (based on whatever measure(s) of &quot;superiority&quot; is(are) used in the literature). &lt;/p&gt;&#xA;" OwnerDisplayName="user2921" LastEditorDisplayName="user2921" LastEditDate="2012-09-28T15:45:54.423" LastActivityDate="2013-05-30T01:17:13.663" Title="Comparing MVO with Resampled Efficient Frontier" Tags="&lt;portfolio-management&gt;&lt;optimization&gt;&lt;modern-portfolio-theory&gt;&lt;mean-variance&gt;&lt;bootstrapping&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="4209" PostTypeId="2" ParentId="4199" CreationDate="2012-09-28T10:22:38.640" Score="8" Body="&lt;p&gt;The short answer is that it depends ;-) The long answer is complicated because it is a complicated topic. Disclaimers:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I am not a lawyer (feel free to comment if I have overlooked anything)&lt;/li&gt;&#xA;&lt;li&gt;I believe the information below to be fairly standard, but&lt;/li&gt;&#xA;&lt;li&gt;counterparty risk is eventually driven by contracts and has to be envisaged on a case by case basis&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Cash is a counterparty risk&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Imagine that you are a fund and your assets are held at a &lt;a href=&quot;http://en.wikipedia.org/wiki/Prime_brokerage&quot;&gt;prime broker (PB)&lt;/a&gt;. Your cash balances will typically be comingled with other clients' cash balances on the PB balance sheet. In case of a bankrupcy, this cash will form part of the liquidation process and &lt;strong&gt;you will rank as one of the PB's general creditors&lt;/strong&gt; (= you will probably not recoup all of your cash, if at all - and even if you do, it will take time).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way to mitigate that risk is to invest the cash in securities, which are not comingled with the bank's assets. Unless...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Some of your other assets might be at risk too: rehypothecation&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A typical prime brokerage agreement would also include &lt;a href=&quot;http://en.wikipedia.org/wiki/Hypothecation#Rehypothecation&quot;&gt;a rehypothecation clause&lt;/a&gt; under which the PB has the right to &lt;em&gt;use your assets&lt;/em&gt;, in other words to transfer some of your assets from your account to their account.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main purpose of rehypothecation is to enable the PB to finance the cost of providing your fund with leverage: the PB will typically use those securities as collateral to raise some cash which they can then lend to you, which in turn enables you to leverage your portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, if the Swiss bonds you just bought are part of the assets that have been used by your PB, and your PB goes bankrupt, those bonds will represent a potential loss - unless you can net them with liabilities that you owe to your PB (i.e. assuming there is a master netting agreement, which there generally is).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The amount that the PB can rehypothecate is generally a function of how much indebtedness you have with them. The PB will then use some of your assets, for an amount up to x% of that indebtedness. How the indebtedness is calculated and how x is determined depends on various factors (x = 140% seems to be standard).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How to mitigate the risk?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are various ways to mitigate the counterparty risk, such as:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Negotiation! Getting better terms on the rehypothecation side helps. If counterparty risk in an absolute concern, you can even negotiate to completely remove the possibility that your PB use your assets. But they will charge you more to offset that financing loss&lt;/li&gt;&#xA;&lt;li&gt;Reducing your indebtedness (think resetting OTC derivatives transactions for example)&lt;/li&gt;&#xA;&lt;li&gt;If you are in a situation where your PB can't rehypothecate your assets because you don't have any indebtedness, buying government bonds instead of holding cash will reduce your risk - &lt;strong&gt;that is the typical situation where buying securities with negative yields can make sense&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;Using cash protection schemes, such as the FSA Client Money Rules, which enable you to diversify the banks at which your cash is held&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2393" LastEditorUserId="2393" LastEditDate="2012-09-28T10:29:48.027" LastActivityDate="2012-09-28T10:29:48.027" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4210" PostTypeId="1" CreationDate="2012-09-28T12:19:41.423" Score="5" ViewCount="723" Body="&lt;p&gt;Of course the issue here is dependence: can it be removed or accounted for (in independence tests too, which of course would be troublesome)? There's a lot of literature on regression in this setting, but little (and unconvincing) on VaR backtesting...&#xA;We don't want to use near horizons for various (mostly obvious) reasons.&lt;/p&gt;&#xA;" OwnerUserId="3015" LastActivityDate="2012-09-28T12:19:41.423" Title="VaR backtesting with overlapping time intervals" Tags="&lt;backtesting&gt;&lt;var&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4212" PostTypeId="2" ParentId="4203" CreationDate="2012-09-28T15:20:37.483" Score="1" Body="&lt;p&gt;This is possible for many reasons; one of which was explained by John. Another reason could be what you used for your P/E multiple. If it was a direct field providing you the ratio, then there is a possibility that a couple of those stocks had a negative EPS that period. Bloomberg (and many similar data vendors) do not calculate a ratio if the denominator is negative. A workaround to this is to have the P/E calculated yourself by looking at Price and EPS individually.&lt;/p&gt;&#xA;" OwnerUserId="932" LastActivityDate="2012-09-28T15:20:37.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4213" PostTypeId="2" ParentId="4208" CreationDate="2012-09-28T16:28:54.337" Score="8" Body="&lt;p&gt;Bernd Scherer has done exactly this test in his text &quot;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1906348359&quot;&gt;Portfolio Construction and Risk Budgeting 4th Edition&lt;/a&gt;&quot;. There is an SSRN paper by Scherer called &quot;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=796625&quot;&gt;Resampled Efficiency and Portfolio Choice (2004)&lt;/a&gt;&quot; you can take a look at as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would suggest you skip re-sampling (especially if you have a long-only portfolio) and take a look at Meucci's &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=681553&quot;&gt;Robot Bayesian Allocation&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In summary there are a couple pitfalls:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;there is no theoretical basis for re-sampling. It looks a Bayesian bootstrap procedure but upon closer inspection it is not. For example, uncertainty about the the mean shows up a shortening of the maximum expected return (and hence the efficient frontier). This is not theoretically consistent with a Bayesian approach&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The interaction of the averaging rule and the long-only constraint results in higher weights to more volatile assets. So an asset with an inferior Sharpe ratio can have a higher weight. The reason why is that in a long-only portfolio assets are either in or out but never have a negative weight. The long-only rule creates an &quot;optionality&quot; for the more volatile security when averaging over long-only portfolios&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The re-sampled efficient frontier can have upward bending components. This is also a serious theoretical problem&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The re-sampling changes the structure of the maximum Sharpe ratio portfolio because of re-sampling tendency to weight more volatile assets. One way to see this is that in modern portfolio theory, the tangency portfolio will never contain cash. However, the re-sampled portfolio will always contain cash (as it sampled in some trials)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Biggest critique is that the there is no statistical foundation -- all re-sampling are derived from the same vector and covariance matrix. And since the true distribution is unknown all re-sampled protfolios suffer from the deviation in estimated return vector and covariance matrix in the same way. Averaging will not remove this bias and so all portfolio will inherit this estimation noise.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-09-28T16:45:09.927" LastActivityDate="2012-09-28T16:45:09.927" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="4214" PostTypeId="2" ParentId="4208" CreationDate="2012-09-28T19:05:04.100" Score="5" Body="&lt;p&gt;There is a great deal of misinformation and out-of-date information on this site.  Many of the references in this discussion and elsewhere have serious research flaws.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Michaud efficient frontier was invented and patented by Robert Michaud and Richard Michaud, U.S. patent #  6,003,018. The alternatives discussed here are not patented nor in many cases refereed.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer the original question, Monte Carlo simulation tests are the standard method in modern statistics used to determine the superiority of one statistical procedure over another.  Such a study was used to prove that Michaud optimization is superior to MVO.  These are mathematical proofs.  There is no doubt of the result.  But if you need reassurance you can listen to the world’s greatest authority on portfolio optimization, Harry Markowitz, who has said in print:  Michaud optimization beats Markowitz optimization.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The simulation tests for Michaud vs. MVO are published in Michaud (1998, Harvard, Chs. 6 and 9) and Michaud and Michaud (2008, Oxford Chs. 6 and 9).   The tests were reproduced in Markowitz and Usmen (2003, Journal Of Investment Management).  It is important to note that simulation tests are far superior to back tests.  A back test proves absolutely nothing. It only tells you what happened during some time period.  A different time period may have very different results.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Markowitz-Usmen tests took for granted that the resampling process we introduced (note: this is not the Morningstar Encorr procedure), is superior to MVO.  What Markowitz and Usmen wanted to prove is whether better information beats a better optimizer?  They tested MVO and better information against Michaud with much less information.  They performed 30 tests and found that their superior information never beat the superior optimizer.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;People who have played with Michaud optimization have noted features about the resampled optimizer that are different from MVO.  In almost all cases these anomalies are actually very consistent with real investor behavior once properly understood.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recommend visiting www.newfrontieradvisors.com for much more information on the procedure, various tests and many extensions of the resampling procedure, rejoinders to flawed studies and ideas, and how extensively it is being used around the world in practice today.   Many billions of dollars are being managed with Michaud optimization globally.  Michaud optimization remains the only portfolio optimizer with a rigorous mathematical proof of investment effectiveness in the world today.  &lt;/p&gt;&#xA;" OwnerUserId="5455" LastEditorUserId="35" LastEditDate="2013-05-30T01:17:13.663" LastActivityDate="2013-05-30T01:17:13.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4215" PostTypeId="2" ParentId="4202" CreationDate="2012-09-28T21:50:56.837" Score="1" Body="&lt;p&gt;I'd suggest checking out MOSEK, I used it at my last firm (medium frequency stat arb) and I also know it's used at another large hedge fund.&lt;/p&gt;&#xA;" OwnerUserId="122" LastActivityDate="2012-09-28T21:50:56.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4218" PostTypeId="1" CreationDate="2012-09-29T08:05:30.950" Score="1" ViewCount="657" Body="&lt;p&gt;I was asked to use idiosyncratic volatility as a regressor in a cross-sectional regression upon cross-sectional returns as the dependent variable. Returns can be thought of as the raw log stock return over some event. So,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$returns_i = a_i + b_i*X_i + error_i$, where $X$ is the matrix of regressors and idiosyncratic volatility one of the them. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the market model is: $R_{it} = a_i + b_i R_{mt} + e_{it}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I calculate this? I see papers that use it only in a time series context, i.e. I've seen $I.V._{it} = \sqrt{e_{it}^2}$. But I can't use this, I need a cross-sectional variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's also this Quant.SE thread &lt;a href=&quot;https://quant.stackexchange.com/questions/2205/how-to-calculate-unsystematic-risk&quot;&gt;here&lt;/a&gt; but my supervisor asked me to specifically use $e_{it}$. Is $\frac{\sum_{i=1}^T \sqrt{e_{it}^2}}{T}$ wrong?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;((Note: I've just found the Pacific-Basin Finance Journal paper &quot;Idiosyncratic volatility, fundamentals, and institutional herding: Evidence from the Japanese stock market&quot; to define it as $ln(\frac{\sum_{i=1}^T \sqrt{e_{it}^2}}{T})$))&lt;/p&gt;&#xA;" OwnerDisplayName="user2921" LastEditorUserId="-1" LastEditorDisplayName="user2921" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2013-12-24T17:31:24.220" Title="Unsystematic/Idiosyncratic/Firm-specific volatility/variance in the market model?" Tags="&lt;volatility&gt;&lt;time-series&gt;&lt;risk&gt;&lt;capm&gt;&lt;market-model&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4219" PostTypeId="2" ParentId="4172" CreationDate="2012-09-29T10:02:57.000" Score="1" Body="&lt;p&gt;What I did was I got the constituent data for multiple indexes from Datastream. I made 3 constituent datasets for each index, &lt;code&gt;P&lt;/code&gt;,&lt;code&gt;PI&lt;/code&gt; and &lt;code&gt;RI&lt;/code&gt; datatypes in datastream. I also got the index-level price data from multiple sources - Datastream as well as Yahoo Finance. I also got weekly and daily data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the end I always arrived at a mean market model beta of 0.6-0.9, even after market capitalization weighted. The mean beta was always around 0.6 before 2004 and generally around 0.7-0.9 around 2008 (all 1 to 8 year estimation windows).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My supervisor says that he had this problem with the EUROSTOXX 600 and the only way that he and his co-author could get the mean beta to 1.0 was using a massive estimation window (30 years) and market capitalization weights.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I guess it's not that much of an issue when I'm using a shorter window with worse rounding (because All ords has a lot of small stocks which trade to 3 dp that datastream cuts off). &lt;/p&gt;&#xA;" OwnerDisplayName="user2921" LastEditorDisplayName="user2921" LastEditDate="2012-09-29T10:16:55.947" LastActivityDate="2012-09-29T10:16:55.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4220" PostTypeId="1" CreationDate="2012-09-29T16:55:05.287" Score="4" ViewCount="763" Body="&lt;p&gt;The usual log normal model in differential form is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS = \mu S dt + \sigma S dX$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $dX$ is the stochastic part, so&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{dS}{S} = \mu dt + \sigma dX$      (1)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and we normally solve this by subbing in $Y=\log(S)$. What's to stop us just integrating (1) to get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S = \exp\left(\mu t + \sigma\mathcal{N}(0,1)\right)$    ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why do we have to through all the business of subbing in for $Y$ and using Ito's lemma?&lt;/p&gt;&#xA;" OwnerUserId="3024" LastActivityDate="2012-09-29T19:02:32.320" Title="Integrating log-normal" Tags="&lt;stochastic-calculus&gt;&lt;lognormal&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4221" PostTypeId="2" ParentId="4220" CreationDate="2012-09-29T19:02:32.320" Score="3" Body="&lt;p&gt;What you have to start with is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dS_t=\mu S_t dt + \sigma S_t dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W_t$ is a standard brownian motion (&lt;a href=&quot;http://en.wikipedia.org/wiki/Wiener_process&quot; rel=&quot;nofollow&quot;&gt;SBM&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You want to solve for $S_t$, so how would you proceed?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you integrate both sides of the equation between 0 and $T$, you get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S_T - S_0= \mu \int_0^T S_t dt + \sigma \int_0^T S_t dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Okay and then what? The fact that you have $S_t$ in both integral is problematic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The thing is, to solve for $S_t$, you in fact need to use a bit of trickery, and the substitution and the application of Ito's lemma allows you to get rid of the $S_t$ as you get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dY = d(\ln S_t)=\left(\mu - \frac{\sigma^2}{2} \right) dt +\sigma dWt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The integration afterwards is straightforward.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, you use the trick to get rid of the $S_t$ in the integrals an to be able to solve easily.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2012-09-29T19:02:32.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4222" PostTypeId="1" AcceptedAnswerId="4224" CreationDate="2012-09-30T04:41:27.940" Score="3" ViewCount="963" Body="&lt;p&gt;I am importing historical intraday tick data from Bloomberg and I noticed the Bloomberg API allows users to import &lt;em&gt;best bid&lt;/em&gt;, &lt;em&gt;best ask&lt;/em&gt;, &lt;em&gt;bid&lt;/em&gt;, and &lt;em&gt;ask&lt;/em&gt; prices&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I am backtesting a trading strategy, what advantages would having the bid and ask prices provide over the best bid and ask prices? &lt;/p&gt;&#xA;" OwnerUserId="3026" LastEditorUserId="467" LastEditDate="2012-09-30T15:38:45.657" LastActivityDate="2012-09-30T15:38:45.657" Title="What are the advantages of knowing the bid and ask over the best bid and ask?" Tags="&lt;backtesting&gt;&lt;market-data&gt;&lt;tick-data&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4223" PostTypeId="1" CreationDate="2012-09-30T12:21:10.357" Score="5" ViewCount="186" Body="&lt;p&gt;I'm doing my undergraduate thesis on firm-level contagion. Specifically I look at a measure of performance over a financial crisis (e.g. raw stock returns), then run cross-sectional regressions with this response variable upon some regressors that we hypothesise will &quot;explain&quot; this performance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have about 5000 words left and I am looking for some additional analysis to do. Any suggestions are much appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can handle all the programming and econometrics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for something really original that I can test. All papers seem to stick on this standard question &quot;what explains individual stocks' crisis performance&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This post may be against Quant.SE's rules but I wasn't sure, so feel free to delete if it is!&lt;/p&gt;&#xA;" OwnerDisplayName="user2921" LastEditorDisplayName="user2921" LastEditDate="2012-09-30T12:48:58.387" LastActivityDate="2014-06-02T04:46:21.407" Title="Economic contagion to individual stocks (ideas for analysis)" Tags="&lt;time-series&gt;&lt;equities&gt;&lt;research&gt;&lt;econometrics&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4224" PostTypeId="2" ParentId="4222" CreationDate="2012-09-30T14:06:41.487" Score="4" Body="&lt;p&gt;As explained in the comments &lt;em&gt;best bid&lt;/em&gt; and &lt;em&gt;best offer&lt;/em&gt; (best ask) are the &lt;em&gt;best prices&lt;/em&gt; at which you can respectively &lt;em&gt;sell&lt;/em&gt; and &lt;em&gt;buy&lt;/em&gt; &lt;strong&gt;at least one unit&lt;/strong&gt; of the asset your are considering.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When backtesting a strategy, most people usually either use &lt;em&gt;best bid&lt;/em&gt; and &lt;em&gt;best offer&lt;/em&gt; or even worse &lt;em&gt;last price&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that these prices are only available for a limited amount of units. Therefore if you start trading a substantive amount of lots, you might not have enough liquidity in the market (i.e. enough units available at &lt;em&gt;best bid/offer&lt;/em&gt;), and you would then trade at a prices which is not as good as the one provided by the &lt;em&gt;best bid/offer&lt;/em&gt;. This is all part of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Implementation_shortfall&quot; rel=&quot;nofollow&quot;&gt;implementation shortfall&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, if you use &lt;em&gt;best bid/offer&lt;/em&gt; prices for your backtest, you have to keep in mind that the result you get did not take into account the size of your trades and hence that the results are only significant for a small size; you always assume full liquidity and hence the best price possible for each and every trade. This is not a very realistic scenario, even more when you consider that the smaller the size, the larger the transaction costs in relative terms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, you should first perform your backtest using &lt;em&gt;best price/offer&lt;/em&gt; to see if your strategy is profitable &lt;strong&gt;in the best scenario&lt;/strong&gt;. If you're happy with that, you can carry on taking into account the &lt;em&gt;market depth&lt;/em&gt; (bid and ask beyond the best) and transaction costs. Anyway, backtest is never perfect and you should expect that a live execution of the strategy would not perform the same, and most of the time not as well as in the simulation.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2012-09-30T14:06:41.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4225" PostTypeId="2" ParentId="4223" CreationDate="2012-09-30T14:29:04.423" Score="1" Body="&lt;p&gt;What could be interesting would be to try and categorize what type of stocks react most to your indicators (small/large cap, country-specific).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also see across asset classes what the reaction was. How did equities do compared to commodities or bonds or hedge funds (who are supposed to benefit from falling markets).&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2012-09-30T14:29:04.423" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4226" PostTypeId="1" CreationDate="2012-09-30T22:39:34.433" Score="1" ViewCount="956" Body="&lt;p&gt;This is a follow-on question from this post I made, &lt;a href=&quot;https://quant.stackexchange.com/questions/3814/multilayer-perceptron-neural-network-for-time-series-prediction&quot;&gt;&quot;Multilayer Perceptron (Neural Network) for Time Series Prediction&quot;&lt;/a&gt;, a few months back.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm constructing a feed-forward artificial neural network, using resilient propagation training. At the moment, I'm trying to implement an individual neuron input's weight update algorithm. For the life of me, I can't seem to find a clear and straightforward answer on how to calculate the partial derivative of the error for a given weight. The only thing I can find on the web, is the fact that a neuron's weight update is a function of $\frac{dE}{dW}$ (cf. the &lt;a href=&quot;http://paginas.fe.up.pt/~ee02162/dissertacao/RPROP%20paper.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;original Paper&lt;/a&gt; [p. 2 &amp;amp; 3], or &lt;a href=&quot;http://ejournals.uofk.edu/index.php/engineering/article/download/115/126&quot; rel=&quot;nofollow noreferrer&quot;&gt;this one&lt;/a&gt; [p. 4]).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However none of these papers actually outlines how to calculate this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand the concept of a partial derivative in &lt;a href=&quot;http://answers.yahoo.com/question/index?qid=20080506020512AARuMSB&quot; rel=&quot;nofollow noreferrer&quot;&gt;a mathematical sense&lt;/a&gt;. And I assume that the current neuron input's weight change calculation is the operation at hand, while all other neuron input values are held constant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for each of these neurons below, I calculate each inputs' individual error by taking a total error ( &lt;strong&gt;-0.3963277746392987&lt;/strong&gt; ), that's been multiplied by that neuron input's weight (each :calculated-error is the sum of the individual inputs' error).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For both neurons, what would be the weight change for each input?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my data structure:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;&#xA;    :input-layer                                                                                                                                                                                                     &#xA;     ({:calculated-error -1.0991814559154283,                                                                                                                                                                         &#xA;       :calculated-value 0.9908633780805893,                                                                                                                                                                            &#xA;       :inputs                                                                                                                                                                                                          &#xA;       ({:error -0.07709937922001887,                                                                                                                                                                                   &#xA;         :calculated 0.4377023624017325,                                                                                                                                                                                  &#xA;         :key :avolume,                                                                                                                                                                                                   &#xA;         :value 2.25,                                                                                                                                                                                                     &#xA;         :weight 0.19453438328965889,                                                                                                                                                                                     &#xA;         :bias 0}                                                                                                                                                                                                         &#xA;        {:error -0.19625185888745333,                                                                                                                                                                                    &#xA;         :calculated 1.4855269156904067,                                                                                                                                                                                  &#xA;         :key :bvolume,                                                                                                                                                                                                   &#xA;         :value 3.0,                                                                                                                                                                                                      &#xA;         :weight 0.4951756385634689,                                                                                                                                                                                      &#xA;         :bias 0}                                                                                                                                                                                                         &#xA;        {:error -0.3072203938672436,                                                                                                                                                                                     &#xA;         :calculated 1.0261589301119642,                                                                                                                                                                                  &#xA;         :key :ask,                                                                                                                                                                                                       &#xA;         :value 1.32379,                                                                                                                                                                                                  &#xA;         :weight 0.7751674586693994,                                                                                                                                                                                      &#xA;         :bias 0}                                                                                                                                                                                                         &#xA;        {:error -0.36920086975057054,                                                                                                                                                                                    &#xA;         :calculated 1.2332848282147972,                                                                                                                                                                                  &#xA;         :key :bid,                                                                                                                                                                                                       &#xA;         :value 1.3239,                                                                                                                                                                                                   &#xA;         :weight 0.9315543683169403,                                                                                                                                                                                      &#xA;         :bias 0}                                                                                                                                                                                                         &#xA;        {:error -0.14940895419014188,                                                                                                                                                                                    &#xA;         :calculated 0.5036129016361643,                                                                                                                                                                                  &#xA;         :key :time,                                                                                                                                                                                                      &#xA;         :value 1.335902400676,                                                                                                                                                                                           &#xA;         :weight 0.37698330460468044,                                                                                                                                                                                     &#xA;         :bias 0}),                                                                                                                                                                                                       &#xA;       :id &quot;583c10bfdbd326ba525bda5d13a0a894b947ffc&quot;},&#xA;      ...)&#xA;&#xA;    :output-layer                                                                                                                                                                                                   &#xA;    ({:calculated-error -1.1139741279964241,                                                                                                                                                                        &#xA;      :calculated-value 0.9275622253607013,                                                                                                                                                                         &#xA;      :inputs                                                                                                                                                                                                       &#xA;      ({:error -0.2016795955938916,                                                                                                                                                                                 &#xA;        :calculated 0.48962608882549025,                                                                                                                                                                            &#xA;        :input-id &quot;583c10bfdbd326ba525bda5d13a0a894b947ffb&quot;,                                                                                                                                                        &#xA;        :weight 0.5088707087900713,                                                                                                                                                                                 &#xA;        :bias 0}                                                                                                                                                                                                    &#xA;       {:error -0.15359996014735702,                                                                                                                                                                                &#xA;        :calculated 0.3095962076691644,                                                                                                                                                                             &#xA;        :input-id &quot;583c10bfdbd326ba525bda5d13a0a894b947ffa&quot;,                                                                                                                                                        &#xA;        :weight 0.38755790024342773,                                                                                                                                                                                &#xA;        :bias 0}                                                                                                                                                                                                    &#xA;       {:error -0.11659507401745359&#xA;&#xA;        :calculated 0.23938733624830652,                                                                                                                                                                            &#xA;        :input-id &quot;583c10bfdbd326ba525bda5d13a0a894b947ff9&quot;,                                                                                                                                                        &#xA;        :weight 0.2941885012312543,                                                                                                                                                                                 &#xA;        :bias 0}                                                                                                                                                                                                    &#xA;       {:error -0.2784739949663631,                                                                                                                                                                                 &#xA;        :calculated 0.6681581686752845,                                                                                                                                                                             &#xA;        :input-id &quot;583c10bfdbd326ba525bda5d13a0a894b947ff8&quot;,                                                                                                                                                        &#xA;        :weight 0.7026355778870271,                                                                                                                                                                                 &#xA;        :bias 0}                                                                                                                                                                                                    &#xA;       {:error -0.36362550327135884,                                                                                                                                                                                &#xA;        :calculated 0.8430641676611533,                                                                                                                                                                             &#xA;        :input-id &quot;583c10bfdbd326ba525bda5d13a0a894b947ff7&quot;,                                                                                                                                                        &#xA;        :weight 0.9174868039523537,                                                                                                                                                                                 &#xA;        :bias 0}),                                                                                                                                                                                                  &#xA;      :id &quot;583c10bfdbd326ba525bda5d13a0a894b947ff6&quot;})&#xA;&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="2690" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2012-10-03T04:32:00.683" Title="Howto Calculate An Error's Partial Derivative in ANN" Tags="&lt;machine-learning&gt;&lt;prediction&gt;&lt;neural-networks&gt;&lt;artificial-intelligence&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4227" PostTypeId="2" ParentId="4223" CreationDate="2012-10-01T02:20:45.563" Score="1" Body="&lt;p&gt;How do securities of companies with outsized margins as compared to competitors fare in financial crisis? This would be the best way, in my opinion, to quantify the largest portion of decrease in stocks in crisis. Risk is generally exacerbated (or that's my hypothesis). Good luck!&lt;/p&gt;&#xA;" OwnerUserId="3032" LastEditorUserId="2345" LastEditDate="2014-06-02T04:46:21.407" LastActivityDate="2014-06-02T04:46:21.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4228" PostTypeId="1" AcceptedAnswerId="4229" CreationDate="2012-10-01T05:10:48.933" Score="5" ViewCount="3742" Body="&lt;p&gt;I will be putting ALL my account points on bounty to whoever answers this question [if your answer is crap but it's the only answer, you're getting the 165 points]. You will have to wait 2 days or so from now to receive the points. Yes, all $165$ points!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I purchased Michaud &amp;amp; Michaud's 1998 book called &quot;Effective Asset Management&quot;. In it they detail their Resampled Efficient Frontier (REF) methodology. In chapter 6 they present an out of sample simulation test. I'm trying to replicate this test but am having difficulty understanding what they mean because I am not good with a completely wordy explanation of how to do a simulation study. I'll place snippets of their simulation instructions into &lt;code&gt;code&lt;/code&gt; and what I think I have to do to replicate the simulation into enumeration/dot-points. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: &lt;strong&gt;&lt;em&gt;Have I interpreted their instructions correctly?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;In a simulation study, the referee is assumed to know the true set of&#xA;risk-returns for the assets.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;1)&lt;/em&gt;&lt;/strong&gt;  I have $\mu$ and $\Omega$, these are considered &quot;true&quot;/population. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;The referee does not tell investors the true values but provides a set of Monte Carlo simulated returns consistent with the true risks and returns. In the base&#xA;case data set, each simulation consists of 18 years of monthly returns&#xA;and represents a possible out-of-sample realization of the true values of&#xA;the optimization parameters.&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;2)&lt;/em&gt;&lt;/strong&gt; I simulate $\mathbf{r}\sim MVN(\mu,\Omega)$, which will be a $T\textrm{x}(\textrm{Number of assets})$ matrix. Here, they are setting the matrix dimensions to be $(18 years*12 months)\textrm{x}(\textrm{Number of assets})$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Each set of simulated returns results in an estimate (with estimation error) of the optimization parameters and an MV efficient frontier. Each MV efficient frontier and set of estimated optimization parameters defines an RE optimized frontier.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;3)&lt;/em&gt;&lt;/strong&gt; This is what I'm most confused about. I'll try to guess at what they're saying here. Here's my guess: Estimate $\hat{\mu}$ and $\hat{\Omega}$ based on the simulated $\mathbf{r}$. Then &lt;em&gt;(i)&lt;/em&gt; do MVO optimization over $\hat{\mu}$ and $\hat{\Omega}$, and &lt;em&gt;(ii)&lt;/em&gt;  Do REF optimization by simulating $500$ futures from $\hat{\mu}$ and $\hat{\Omega}$, resulting in $\hat{\mathbf{r}}_i\sim MVN(\hat{\mu},\hat{\Omega})$,$i \in \{1,...,500\}$. Using $\hat{\mathbf{r}}_i$ to find $\hat{\hat{\mu}}_i$ and $\hat{\hat{\Omega}}_i$, and then find the REF based on these $500$ estimates. This will result in two frontiers, one for &lt;em&gt;(i)&lt;/em&gt; and one for &lt;em&gt;(ii)&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;This process is repeated many times.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;4)&lt;/em&gt;&lt;/strong&gt; Repeat steps &lt;strong&gt;&lt;em&gt;2)&lt;/em&gt;&lt;/strong&gt; to &lt;strong&gt;&lt;em&gt;3)&lt;/em&gt;&lt;/strong&gt; $N$ times, at each step storing both the MVO and REF frontier weights matrices that you calculate in &lt;strong&gt;&lt;em&gt;3)&lt;/em&gt;&lt;/strong&gt; (it's a weights matrix because it's a bunch of vectors at each point along the frontier). This will result in $N$ matrices of weights for MVO, where each $n \in \{1,...,N\{$ is the results of one of the simulations &lt;strong&gt;&lt;em&gt;2)&lt;/em&gt;&lt;/strong&gt;$\rightarrow$&lt;strong&gt;&lt;em&gt;3)&lt;/em&gt;&lt;/strong&gt;. The same for the REF. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;In each of the simulations of MV and RE optimized frontiers, the referee uses the true risk-return values to score the actual risks and returns of the optimized portfolios.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;5)&lt;/em&gt;&lt;/strong&gt; For each $n \in \{1,...,N\}$, we have weights matrices $_nw_{RE}$ and $_nw_{MV}$. Taking $_nw_{{RE},i}$ as one vector in the matrix of weights $_nw_{RE}$, find $_nw_{{RE},i}' \mu$ and $_nw_{{RE},i}' \Omega_nw_{{RE},i}$ for each $i$. This will result in a graph in $(\sigma,\mathbb{E}r)$ space. Do the same for $_nw_{{MV},i} \forall i \forall n$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;The averaged results of the simulation study are displayed in Exhibit 6.3.&#xA;The upper dotted curves display the in-sample averaged MV and RE&#xA;frontiers that were submitted to the referee for scoring. The higher dotted&#xA;curve is the MV efficient frontier; the lower dotted curve is the REF. The&#xA;portfolios are plotted based on the simulated risks and returns. However,&#xA;the referee knows the true risks and returns for each simulated optimized&#xA;portfolio. The bottom solid curves in Exhibit 6.3 display the average of&#xA;the true, out-of-sample, risks and returns of the optimized portfolios. The&#xA;higher solid curve represents the RE optimized results, the lower solid&#xA;curve the Markowitz optimized results.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/qilfS.png&quot; alt=&quot;]&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;6)&lt;/em&gt;&lt;/strong&gt; Massive confusion. What are these &quot;&lt;code&gt;average results&lt;/code&gt;&quot;? I'm guessing they do the unweighted mean of each of the $(\sigma,\mathbb{E}r)$ results (for all $N$) in step &lt;strong&gt;&lt;em&gt;5)&lt;/em&gt;&lt;/strong&gt; for both methodologies and then plot both frontiers. However what's this OOS/in-sample business? Does steps &lt;strong&gt;&lt;em&gt;1)&lt;/em&gt;&lt;/strong&gt; to &lt;strong&gt;&lt;em&gt;5)&lt;/em&gt;&lt;/strong&gt; result in the OOS frontiers? Is the in-sample frontier the standard REF and MVO calculated from the true $\mu$ and $\Omega$?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here's an alternative explanation from Michaud and Michaud, in 2008 paper &quot;ESTIMATION ERROR AND PORTFOLIO OPTIMIZATION: A RESAMPLING SOLUTION&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Following Jobson and Korkie (1981) and Michaud&#xA;(1998, Ch. 6), we perform a simulation test to&#xA;compare RE vs. MV optimization. In a simulation&#xA;test, a referee is assumed to know the true values&#xA;of asset risks and returns. The 20 stock risk-return&#xA;data, shown in the Appendix, serves as the “truth”&#xA;in our simulation experiments. The referee creates&#xA;a simulated history and provides returns that are&#xA;statistically consistent with the true risk-return estimates.&#xA;These returns can either be thought of as&#xA;historical observations of a stationary return distribution,&#xA;or a number of noisy estimates of next&#xA;period’s return. The Markowitz and RE investors&#xA;compute their efficient portfolios based on the referee’s&#xA;supplied returns. The referee uses the true&#xA;risk-return values to score the optimized portfolios.&#xA;Figure 4 gives the average of the results after many&#xA;simulation tests.&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;The curves displayed in Figure 4 represent the averaged&#xA;results from the simulation test. The left-hand&#xA;panel displays the average MV and RE efficient frontiers computed from the referee’s returns, the&#xA;portfolios that were submitted to the referee for&#xA;scoring. The higher (red) dotted curve is the MV&#xA;efficient frontier; the lower (blue) dotted curve is&#xA;the REF. The left-hand panel represents what the&#xA;Markowitz and RE investors see on average given&#xA;the referee’s data. The right-hand panel of Figure 4&#xA;illustrates the average results of how the submitted&#xA;efficient frontier portfolios performed when the referee&#xA;applied the true risk-returns. The higher (blue)&#xA;solid curve represents the RE optimizer results; the&#xA;lower (red) solid curve the Markowitz optimizer&#xA;results. The right-hand panel of Figure 4 shows&#xA;that the RE optimizer, on average, achieves roughly&#xA;the same return with less risk, or alternatively more&#xA;return with the same level of risk, relative to the&#xA;Markowitz optimizer.&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user2921" LastEditorDisplayName="user2921" LastEditDate="2012-10-01T11:43:04.770" LastActivityDate="2012-10-03T06:51:21.383" Title="Michaud's Resampled Efficient Frontier - Out of Sample Simulation Testing" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;simulations&gt;&lt;portfolio&gt;&lt;mean-variance&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4229" PostTypeId="2" ParentId="4228" CreationDate="2012-10-01T11:25:55.457" Score="4" Body="&lt;p&gt;Before answering your questions directly i would like to briefly restate the idea of the resampled efficent frontier:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the problem with classical mean variance optimization is (even if the multivariate normal assumption holds) that you cant estimate $\mu$ and $\Omega$ (which is usually denoted as $\Sigma$) exactly. Thats why you incur estimation errors $\hat{\mu}-\mu$ and $\hat{\Omega}-\Omega$ when you deviate from the &quot;population means&quot;. This error can change your portfolio dramatically (since MVO is not very robust in general). So the idea is to estimate $\mu$ and $\Omega$ to end up with $\hat{\mu}$ and $\hat{\Omega}$ and sample from the $\text{MVN}(\hat{\mu},\hat{\Omega})$ distribution. From all these samples, calculate the efficient frontier and the optimal portfolio. The RE frontier and RE optimal portfolio will be the mean of those.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This method is a bootstrapping method (where you strangely gain information for adding uncertainty).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another nice way to think of it is (and here i quote the paper you mentioned):&#xA;&quot;Every simulated MV efficient frontier [...] is the right way to invest given a set of inputs. But the inputs are highly uncertain. How should an investor deal with portfolio optimality uncertainty?&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And the answer is: One should use the REF to obtain a sub-optimal (for one estimated set of parameters) portfolio which is more prone to estimation error and therefore should result in a better portfolio than from estimation alone. (look at Figure 4 in the paper you mentioned!)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for your questions, you got everything correct up to step 3.):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3.) I don't know what you mean by futures. I would call them assets. What you should do is you take your values $\hat{\mu}$ and $\hat{\Omega}$ and calculate the RE frontier. To do that you draw lots of samples from $\text{MVN}(\hat{\mu},\hat{\Omega})$, do MV optimization on each of them and compute the mean (both of the optimized pf and the frontiers).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4.) As you said, repeat the steps several times.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5.) You are right here. Just &quot;score&quot; all the portfolios (i think you meant $\Omega$ instead of $\Omega_n$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;6.) The plot shows the average in-sample and out-of-sample efficient frontiers.&#xA;in-sample: You take all MV efficient frontiers for $\hat{\mu}$ and $\hat{\Omega}$ and build the average. That gives you the &quot;Classical in-sample&quot; curve. Computing the average over the REFs for the same parameters gives you the &quot;REF in-sample&quot; efficient frontiers. In the chart this means that if you consider the average of your sampled parameters as the true population parameter, the MV efficient frontier is always abvoe the resampled efficient frontier. &#xA;out-of-sample: You take all calculated MV and REF weights but now you calculate the efficient frontier with respect to the true population parameters $\mu$ and $\Omega$. Of course (since they are optimal for another parameter set) this efficient frontiers are lower then their in-sample counterparts. &#xA;Now comes the important point: The MV efficient frontier is now inferior to the REF. Thats what the whole point of the bootstrapping technique was.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope that enlightened you.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastEditorUserId="2727" LastEditDate="2012-10-01T11:51:56.580" LastActivityDate="2012-10-01T11:51:56.580" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="4230" PostTypeId="1" AcceptedAnswerId="4231" CreationDate="2012-10-01T11:54:18.250" Score="1" ViewCount="304" Body="&lt;p&gt;I was provided with a VBA program from my lecturer that applies the resampled efficient frontier. We have an investment horizon $T$ (6 years) and he uses a multivariate normal distribution with parameters $\mu$ and $\Sigma$ and the code simulates $12$ years of monthly data. He does this a few hundred times, but only takes the top half of the returns matrix, $R$, (i.e. takes a $6$ year slice of it) to calculate the estimates of $\mu$ and $\Sigma$ in the REF procedure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does it make any difference whether we simulate $6$ years or $12$ years under MVN if we're just going to be slicing off $6$ years of simulated returns from the top of the simulated $R$ no matter what?&lt;/p&gt;&#xA;" OwnerDisplayName="user2921" LastActivityDate="2012-10-01T12:19:38.930" Title="Resampled efficient frontier length of simulation" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4231" PostTypeId="2" ParentId="4230" CreationDate="2012-10-01T12:19:38.930" Score="0" Body="&lt;p&gt;It doesnt make any difference. Of course with 12 years under MVN your estimates will be closer to the &quot;true&quot; values of the population.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe you want to use the second part of $R$ to perform an out of sample test of the REF to show that the strength of the REF lies not in its in-sample performance (where it must be inferior to MV optimization) but rather in its out-of-sample performance but we can only guess on this part. It could also be an error in the code but I think to hold half of the data back for the out-of-sample test should be the reason.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2012-10-01T12:19:38.930" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4233" PostTypeId="2" ParentId="4207" CreationDate="2012-10-01T18:34:29.193" Score="1" Body="&lt;p&gt;Just to clarify, the periodic coupon is $C_{\min} + \max(0, \text{perf}_i -1) $ or is it actually $\max(C_{\min}, C_{\min}\cdot(1+\text{perf})) $? I don't think the multiplicative version makes sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In either case, it's a bond plus a forward striking option. The simple solution is to price it using Black Scholes with forward volatility $\sigma(t_i,t_j)$. This way, however, you will ignore the forward skew issue, but given that it's ATM, the correction is going to be fairly small. The &quot;proper&quot; way is to build a persistent skew surface for your underlying and price it using persistent skew, but I doubt your lecturer is actually asking for that level of detail. &lt;/p&gt;&#xA;" OwnerUserId="2906" LastEditorUserId="2727" LastEditDate="2012-10-01T19:10:42.313" LastActivityDate="2012-10-01T19:10:42.313" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4234" PostTypeId="2" ParentId="4226" CreationDate="2012-10-01T21:49:37.847" Score="2" Body="&lt;p&gt;It's a bit unclear to me what you're trying to do, and maybe a better place to ask your question is &lt;a href=&quot;https://stats.stackexchange.com/&quot;&gt;Stats.SE&lt;/a&gt; but I would encourage you to go and have a look at this &lt;a href=&quot;https://class.coursera.org/ml-2012-002/class/index&quot; rel=&quot;nofollow noreferrer&quot;&gt;online class&lt;/a&gt; on machine learning which provides an implementation of the backpropagation algorithm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can either register or hit preview and go to the NN:Learning chapter, but I would recommend you to register and do the programming exercise on NN. Maybe this is not exactly what you are trying to do, but I think you might find a basic example of how to compute the partial derivative of the error term.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2012-10-01T21:49:37.847" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4235" PostTypeId="1" AcceptedAnswerId="4254" CreationDate="2012-10-02T01:55:38.783" Score="2" ViewCount="1057" Body="&lt;p&gt;I'm looking for some direction on testing whether a simple entry signal has statistical significance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say this is my simple entry signal: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Buy&lt;/strong&gt; when some indicator has a positive slope and is above zero on 3 time frames (5M,15M,60M)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Sell&lt;/strong&gt; when the indicator has a negative slope and is below zero on 3 time frames.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I go about statistically testing this signal to see if there's any alpha to be extracted?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was thinking something along these lines:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;plot the P&amp;amp;L distribution for the signal should it exit 1,2,3, N bars after the entry.&lt;/li&gt;&#xA;&lt;li&gt;plot the P&amp;amp;L distribution if the entry point had been random and the exit had been again 1,2,3, N bars after the entry.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I'm not really sure where to go from there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I go about creating a &quot;random&quot; entry signal? Perhaps taking the time difference between the first and last quote and creating a pseudo random time to enter. The number of entries would have to be equal to the number of non-random signals created from the indicator. Also, I say pseudo random because it probably wouldn't be desirable if all these &quot;random&quot; signals happened to cluster in one short time interval. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, what characteristics of these distributions should I be looking for to establish if the indicator signal has any statistical significance in terms of potential alpha that can be extracted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any direction or reference would be appreciated. Being that there are so many different types of statistical tests that can be done, it's hard to find anything particularly relevant.&lt;/p&gt;&#xA;" OwnerUserId="3038" LastActivityDate="2012-10-04T03:12:02.867" Title="Running a simple alpha estimation test for statistical significance of a signal" Tags="&lt;trading-systems&gt;&lt;statistical-finance&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4236" PostTypeId="2" ParentId="4174" CreationDate="2012-10-02T03:22:57.040" Score="0" Body="&lt;p&gt;I'm also looking for something like this, a book with setups and examples of statistical tests specifically for trading strategies. I picked up &quot;Probability and Statistics for Finance&quot; (Frank Fabozzi Series).  I'm still reading it but I have not yet encountered an example of an application to an actual trading strategy/backtest. However, it's relevance and examples in general finance does help give it a context for the statistics/probability concepts described.  &lt;/p&gt;&#xA;" OwnerUserId="3038" LastActivityDate="2012-10-02T03:22:57.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4237" PostTypeId="1" CreationDate="2012-10-02T07:49:15.000" Score="8" ViewCount="316" Body="&lt;p&gt;The literature has well established methods for testing stock market herding over a decent time window. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any ways that have appeared in the literature to test for stock market herding over a short time span (e.g. 5 days)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps something a bit more than just applying the identical time series models to intraday data (I don't necessarily see anything wrong with this, but would like to know if there's dedicated research on this topic). &lt;/p&gt;&#xA;" OwnerDisplayName="user2921" LastEditorDisplayName="user2921" LastEditDate="2012-10-06T03:18:35.063" LastActivityDate="2016-01-03T21:57:56.940" Title="Testing for stock market herding over short periods" Tags="&lt;equities&gt;&lt;econometrics&gt;&lt;economics&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4238" PostTypeId="1" CreationDate="2012-10-02T09:25:21.127" Score="4" ViewCount="31805" Body="&lt;p&gt;There's two studies that test the same thing in different markets (i.e. they apply the identical methodology). They state:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;1)&lt;/strong&gt; &quot;$R_{mt}$ is the equally weighted average stock return in the dual-listed portfolio.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2)&lt;/strong&gt; &quot;$R_{mt}$ is the average return of the equal-weighted market portfolio.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To find the equally weighted portfolio do I average the prices of each constituent and THEN take the log returns of this averaged price? Or, do I just average the log returns of each stock at each $t$ to get this $R_{mt}$? Pretty sure I average the returns based on what they've said but want to be 100\% sure before making all my results!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They both give very similar results.&lt;/p&gt;&#xA;" OwnerDisplayName="user2921" LastActivityDate="2018-02-22T14:03:43.490" Title="How to calculate equally weighted market portfolio" Tags="&lt;equities&gt;&lt;returns&gt;&lt;return&gt;&lt;asset-returns&gt;&lt;log-returns&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4239" PostTypeId="1" CreationDate="2012-10-02T09:37:26.293" Score="21" ViewCount="994" Body="&lt;p&gt;I want to know if there are some standardized measures to evaluate how irrationally human a portfolio manager is. Are there any performance measures or scorings for behavioral finance effects? How &quot;human&quot; is the manager of a portfolio?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What kind of ratios are there and which data do we need to compute them? (do we only need portfolio and benchmark or the P+L of each single position for example)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Possible effects I can think of right now are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-) In a benchmarked mandate: Tracking Error is larger if portfolio underperforms (gambling on the losses) than when it outperforms (securing the profits).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-) Volatility decreases when fund ytd performance close to zero (out-)performance (afraid of the &quot;sign effect&quot; because for the average investor it will make less a difference if performance decreases from +0.03% to +0.01% than from +0.01% to -0.01%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any measures of (these) behavioral effects you can think of? How would you measure things like that? Any standard works on this topics I am missing here? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please note that I dont want to know which effects there are but how to measure them objectively and to secure comparability of the measure to some extent.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastEditorUserId="2727" LastEditDate="2012-10-03T06:45:22.563" LastActivityDate="2015-02-12T18:37:30.830" Title="Measuring Behavioral Finance Effects in Fund/Portfolio Manager Analysis" Tags="&lt;performance-evaluation&gt;&lt;behavioral-finance&gt;&lt;manager-analysis&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="4240" PostTypeId="1" AcceptedAnswerId="4243" CreationDate="2012-10-02T14:52:03.867" Score="10" ViewCount="7529" Body="&lt;p&gt;I've been using Monte Carlo simulation (MC) for pricing vanilla options with non-lognormal underlyings returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm tempted to start using MC as my primary option-valuating technique as I can get sound results without relying on the assumptions of the analytical methods (Black-Scholes, for example).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Computational costs aside, when to use MC simulation over analytical methods for options pricing?&lt;/p&gt;&#xA;" OwnerUserId="2257" LastActivityDate="2012-10-02T16:12:11.523" Title="When to use Monte Carlo simulation over analytical methods for options pricing?" Tags="&lt;options&gt;&lt;monte-carlo&gt;&lt;simulations&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="4241" PostTypeId="2" ParentId="4240" CreationDate="2012-10-02T14:59:31.773" Score="5" Body="&lt;p&gt;Normally, one uses MC methods when:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Analytical solutions do not exist&lt;/li&gt;&#xA;&lt;li&gt;PDE style solutions also don't work (they are usually still faster than MC)&lt;/li&gt;&#xA;&lt;li&gt;You need to price some exotic, but computation time does not matter (MC methods are easy(-ier) and fast to code-up)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Note: Using MC is not free of assumptions: you always assume a distribution for the driving asset, as well as structure for its volatility, absence or existence of jumps...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having analytic solutions gives you an easy way to calibrate your model parameters to market prices - if you use MC, then... try calibrating your model to 50, 100 option quotes - this does not work within seconds... unless you're using FPGAs, GPUs, etc... &lt;/p&gt;&#xA;" OwnerUserId="647" LastActivityDate="2012-10-02T14:59:31.773" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4242" PostTypeId="2" ParentId="4238" CreationDate="2012-10-02T15:56:18.680" Score="3" Body="&lt;p&gt;It looks like 1 and 2 are different portfolios of companies.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1 is a portfolio of dual-listed companies, and &#xA;2 is a portfolio of everything in the &quot;market&quot;. &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Once you have constructed these these portfolios, let's say you put the returns for every time step into a vector, call it &lt;code&gt;r&lt;/code&gt;, then the average return would be &lt;code&gt;mean(r)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need some clarification as to what &quot;equally-weighted portfolio&quot; means in this case in order to construct your portfolios.  For example, if you simply assume to buy the same # of shares of every stock, you may have a situation like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume the whole market consists of stocks A, B, and C.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;stock            price&#xA;A                 10&#xA;B                 25&#xA;C                 50&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;if you buy 1 share of each stock, then your total portfolio will worth 85 dollars, with $50 (59%) being from stock C, $25 (29%) from stock B, and $10 (12%) from stock A.  So you can see even if you bought the same % of shares, you do not have an equally weighted portfolio.  Your portfolio is much more sensitive to fluctuations in stock C than it is to fluctuations in stock A.  If stock A goes to zero, you only lose 12% of your portfolio, but if stock C goes to zero, you lose 59%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I can tell they do ask you to use log-returns.  I don't think it is necessary to use log returns calculate average portfolio returns.  If you do use log returns, remember there is a difference between log returns and arithmetic returns: &lt;a href=&quot;http://en.wikipedia.org/wiki/Rate_of_return#Arithmetic_and_logarithmic_return&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Rate_of_return#Arithmetic_and_logarithmic_return&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Easiest way to find the returns of the equally weighted portfolio would be to adjust your prices so that start price of each asset is equal to 1.  Then you pretend that you buy one of each asset and look at the returns for you time period.  This would be the same as assuming that you are investing the same $ amount in each asset regardless of the share price.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If these are your prices for asset A and the first 4 time points:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;50.50 @ t = 1&#xA;50.75 @ t = 2&#xA;50.80 @ t = 3&#xA;50.95 @ t = 4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;after adjusting the prices you would have&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1       @ t = 1&#xA;1.00495 @ t = 2&#xA;1.00594 @ t = 3&#xA;1.00891 @ t = 4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So no you can see that your return for this asset over the first 4 time periods is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1.00891 - 1 = 0.00891 or 0.89%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do this for all the assets and you will have your equally weighted portfolio.&lt;/p&gt;&#xA;" OwnerUserId="3002" LastEditorUserId="3002" LastEditDate="2012-10-03T12:48:14.957" LastActivityDate="2012-10-03T12:48:14.957" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4243" PostTypeId="2" ParentId="4240" CreationDate="2012-10-02T16:12:11.523" Score="24" Body="&lt;p&gt;Monte Carlo is most useful when you lack analytic tractability or when you have a highly multidimensional problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, even using simple lognormal and poisson models, there exist path-dependent payoffs or multi-asset computations such that no analytic solution exists and such that any PDE finite difference solution would require 3 or more dimensions.   Other times, you are employing a model where the SDE is not solvable, so an apparently one-dimensional problem still ends up forcing you to generate many incremental paths using Euler or Milstein integration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Cases Where Monte Carlo Is A Poor Idea&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;Weakly path-dependent options&lt;/em&gt; (e.g. lookbacks): Use PDE or series solutions&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;Single-dimensional cases&lt;/em&gt;:  If your problem is just one dimensional, such as pricing a payoff along the terminal distribution, you should never use Monte Carlo, since numerical quadrature is far superior in this case, even if you just use Riemann sums. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Cases Where Monte Carlo Is A Good Idea&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;Strongly path-dependent options&lt;/em&gt; such as ratchet range options&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;Portfolio risks and exotic baskets&lt;/em&gt; where high dimensionality comes into play.  CDO tranche protection is a classic example.  So are tail risk computations, especially for multi-asset portfolios.&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;Intractable models&lt;/em&gt; where the terminal distribution cannot be computed, such as some stochastic vol models&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;To the point about single-dimensional cases -- it sounds like this describes your usage, perhaps because you are using some kind of implied distributional fit to agree with volatility skew.  In this case Monte Carlo seems easy, but using a trapezoid rule integrator (or similar) will be as easy and far higher quality by about any measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now Monte Carlo does make it tricky to accurately compute greeks.  As with any model, we can compute greeks by using a finite difference &quot;parameter bump&quot;, computing our greek&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;g_\mu =\frac{ V(\dots,\mu+\Delta \mu,\dots) - V(\dots, \mu,\dots)}{\Delta \mu}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but if there is a lot of random noise in those two separate computations of $V()$ then our $g_\mu$ will be inaccurate.  Instead it is important to bring the differencing &lt;em&gt;inside&lt;/em&gt; the Monte Carlo formula.  That is, we don't want to be doing&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\hat{g}_\mu =\frac{ \frac1M \sum_{i=1}^M V(x_i,\dots,\mu+\Delta \mu,\dots) - \frac1M \sum_{i=1}^MV(y_i, \dots, \mu,\dots)}{\Delta \mu}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for two separate sample sets $x_i$ and $y_i$.  Instead, we want to use the &lt;em&gt;same&lt;/em&gt; $x_i$ for both sums, meaning we effectively compute &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;g_\mu =\frac1{M {\Delta \mu}}  \sum_{i=1}^M V(x_i,\dots,\mu+\Delta \mu,\dots) -V(x_i, \dots, \mu,\dots)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and end up with a far more accurate estimate, typically better than our estimate of option value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll make one final note, which is that you feel you &quot;get sound results without relying on the assumptions of the analytical methods&quot;.  If your terminal distributions are empirically generated, then you are likely to misprice any options because you are not using anything close to a risk-neutral measure.  For example, you almost certainly find yourself pricing a forward contract $F$ far higher than the true, arbitrageable value range $F \in [S_0 e^{r_L T}, S_0 e^{r_b T}]$ where $r_b, r_L$ are standard borrow-lend rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;(Vytautas beat me to some of these points)&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-10-02T16:12:11.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4245" PostTypeId="2" ParentId="4226" CreationDate="2012-10-03T04:32:00.683" Score="0" Body="&lt;p&gt;The calculation of the gradient depends on the activation functions of your neurons (and, more specifically, their derivatives). Moreover, the gradient of any individual weight depends on weights and activations appearing later in the network -- that's the key idea behind the backpropagation algorithm, which takes advantage of that fact to compute gradients. You can find a very detailed description of backprop in &lt;a href=&quot;http://page.mi.fu-berlin.de/rojas/neural/chapter/K7.pdf&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt;. Note that the examples use sigmoid activation functions, but the method is applicable to any differentiable activation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note also that the principal difference between backprop and rprop is that backprop requires the value of the weight gradient and rprop only requires its sign. Though rprop may seem simpler in that regard, I advise you to make sure you completely understand backprop first.&lt;/p&gt;&#xA;" OwnerUserId="2843" LastActivityDate="2012-10-03T04:32:00.683" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="4247" PostTypeId="1" AcceptedAnswerId="4249" CreationDate="2012-10-03T12:46:18.493" Score="2" ViewCount="850" Body="&lt;p&gt;Assume a US-based company has sold something to a Norwegian company. It will receive 1M Norwegian Kroner in two months, and would like to hedge this future cash flow against currency exchange risk. &#xA;It's not possible to hedge Kroner and Dollars directly, but the company can hedge with Euros, since Euros behave similarly to Kroner. Following data is given:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Exchange rates: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;0.164\$/Kroner $=: K$; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;0.625\$/€ $=: M$;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;0.262€/Kroner.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;correlation coefficient between $K,M: \sigma_{K,M}=0.8$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;standard deviations:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma_{M}= 3\%$, $\sigma_{K}=2.5\%$ per month.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am confused since we actually have not two assets, where we have to find the optimal weights in the portfolio, but we have only one asset, which is the futures between Euros and Dollars. Can someone show me how I work with this data, and explain the solution?&lt;/p&gt;&#xA;" OwnerUserId="1817" LastEditorUserId="35" LastEditDate="2012-10-05T17:22:48.480" LastActivityDate="2012-10-05T17:22:48.480" Title="constructing a minimum variance portfolio" Tags="&lt;portfolio-management&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4248" PostTypeId="2" ParentId="4247" CreationDate="2012-10-03T13:24:29.967" Score="0" Body="&lt;p&gt;The reason for hedging the exchange risk is that the deal was made given the current exchange rate, and the company wants to make sure that they receive the same amount of dollars (or more) in 2 months that they agreed to now.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming that the exchange rates stay the same, when they get paid:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;K 1M = $ 164,000 or € 262,000&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The variance that you want to minimize is the $/K variance, which is the variance of our future cash flow to be paid in 2 months.  We are saying that we can't just buy the NOK/USD futures, and since the Euro is highly correlated with Kroners, we can use Euro.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remember you also have dollars, so you actually have 2 assets.  If you buy all Euros then you are exposed to the risk of the Dollar gaining on the Euro, if you just keep all dollars, you are exposed to the Euro (and Kroner) gaining on the dollar.  So I think the minimum variance  of your future cash flow will be attained by buying some combination of dollars and euros.&lt;/p&gt;&#xA;" OwnerUserId="3002" LastEditorUserId="3002" LastEditDate="2012-10-03T18:23:27.800" LastActivityDate="2012-10-03T18:23:27.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4249" PostTypeId="2" ParentId="4247" CreationDate="2012-10-03T14:12:55.780" Score="6" Body="&lt;p&gt;Strictly speaking, this is a proxy hedging problem. You have to hedge one currency with another. The one period covariance matrix is assumed to be $$\Sigma_{1}=\left[\begin{array}{cc}&#xA;0.03 &amp;amp; 0\\&#xA;0 &amp;amp; 0.025&#xA;\end{array}\right]\left[\begin{array}{cc}&#xA;1 &amp;amp; 0.8\\&#xA;0.8 &amp;amp; 1&#xA;\end{array}\right]\left[\begin{array}{cc}&#xA;0.03 &amp;amp; 0\\&#xA;0 &amp;amp; 0.025&#xA;\end{array}\right]&#xA; $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you can calculate the two period covariance matrix as $$\Sigma_{2}=2\Sigma_{1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By your assumptions, you have a portfolio that is effectively $-100\%$ short the Krona. You could set this up an optimization problem to find $$w\equiv argmin\left\{ \left(w-w_{b}\right)'\Sigma_{2}\left(w-w_{b}\right)'\right\} $$ where $w_{b}\equiv\left[\begin{array}{c}&#xA;0\\&#xA;-1&#xA;\end{array}\right]$ and constrain to weights so that $w$ makes no investment in the Krona. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in this case, you can do it more simply. You can write out the portfolio variance (using values from $\Sigma_{2}$) as &#xA; $$\sigma^{2}=w_{1}^{2}\sigma_{1}^{2}+w_{2}^{2}\sigma_{2}^{2}+2w_{1}w_{2}\sigma_{1,2}$$&#xA;and since $w_{2}$ is already known to equal $-100\%$ you can minimize that directly to find&#xA;$$w_{1}=-w_{2}\frac{\sigma_{1,2}}{\sigma_{1}^{2}}&#xA; $$ which works out to $w_{1}=\frac{2}{3}$. Then you would just convert that weight into an amount of euros to buy. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2012-10-03T14:12:55.780" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4250" PostTypeId="1" AcceptedAnswerId="4256" CreationDate="2012-10-03T14:52:18.387" Score="7" ViewCount="11685" Body="&lt;p&gt;Just was just looking at the various interest rates and noticed this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;         Tenor         Rate&#xA;&#xA; LIBOR:&#xA;          3M          0.3585%&#xA;          6M          0.6359%   &amp;lt;-- sticks out above others&#xA;&#xA; ED Futures:&#xA;&#xA;      Z2 (Dec 12)     99.680   =&amp;gt; approx  0.320%&#xA;      H3 (Mar 13)     99.675   =&amp;gt; approx  0.325%&#xA;      M3 (Jun 13)     99.660   =&amp;gt; approx  0.340%&#xA;         ...            ...&#xA;&#xA; 3M&amp;lt;-&amp;gt;Fixed Swap Rates:&#xA;          2Y          0.3665%&#xA;          3Y          0.4390%&#xA;         ...            ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that the 6M LIBOR rate (0.6359%) seems to stick out quite a bit above the Eurodollar Future rates and 2Y swap rates, all of which are around 0.35% give or take.  This seems to create an &quot;obvious&quot; arbitrage opportunity, and yet this persists.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why?&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2012-10-03T15:18:03.793" LastActivityDate="2012-10-10T11:24:03.600" Title="Why would a 6M LIBOR rate be significantly above 3M LIBOR, ED futures and swap rates?" Tags="&lt;interest-rates&gt;&lt;arbitrage&gt;&lt;rates&gt;&lt;libor&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4252" PostTypeId="1" CreationDate="2012-10-04T00:28:24.217" Score="7" ViewCount="3873" Body="&lt;p&gt;I'm backtesting an algorithm for trading nasdaq stocks, and would like to take into account the spread. I am using historical data from yahoo, which contains:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;open, high, low, close, volume, adj. close&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All of my trading signals are based off of those prices as they are (without regard to whether they are bid, ask, best bid, best ask, etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To attempt to take into account the bid/ask spread when executing a trade, I have treated all the prices above as the bid prices. To estimate the ask price, I decided to set the spread always equal to 1% of the previous day's high. So the ask price is just estimated by adding that spread to the bid price (and again, the bid price is equal to the yahoo prices given).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under what conditions is this a reasonable estimate for the spread? For example, very low priced stocks have larger spread percentages so I exclude those stocks completely from my backtesting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any better way to do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="3045" LastActivityDate="2012-10-10T00:51:05.140" Title="How to account for bid/ask spread when backtesting?" Tags="&lt;backtesting&gt;&lt;spread&gt;&lt;nasdaq&gt;&lt;bid&gt;&lt;ask&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4253" PostTypeId="2" ParentId="4250" CreationDate="2012-10-04T01:20:57.263" Score="0" Body="&lt;p&gt;Well, 6m Libor isn't directly tradeable, none of the products above would use it for pricing. ED uses 3m, ir swaps floating leg also uses quarterly payments (hence 3m). How would you arbitrage 6m Libor?&lt;/p&gt;&#xA;" OwnerUserId="3046" LastActivityDate="2012-10-04T01:20:57.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4254" PostTypeId="2" ParentId="4235" CreationDate="2012-10-04T03:12:02.867" Score="1" Body="&lt;p&gt;I think the simplest way to achieve what you're looking for is through regression coefficient hypothesis testing.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Perform linear regression on returns (y-axis) vs. dates (x-axis) over the desired time frames (do it once for 5 months, once for dataset w/15 months worth of data, and once for 60 months worth of data).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;As a result of regression, you will get coefficients for $y = mx + b$.  To check if the slope is significantly different from 0.0, you would perform a t-test on m:&#xA;$$ t = \frac{m - 0.0}{SE(m)} = \frac{m}{SE(m)},$$ where $SE(m)$ is standard error of $m$.  Depends on how you're doing the regression, but it may be reported by the software.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Using $n-2$ degrees of freedom (where $n$ is the number of points included in regression, look up $t$ values for the desired confidence level (typ., $\alpha=0.05$ for 95% confidence interval, CI).  Let this value be $t_{critical}$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$m$ is significantly different from 0.0 if $t &amp;gt; t_{critical}$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Slope's sign can be determined by adjusting the null hypothesis ($m &amp;gt; 0$, $m &amp;lt; 0$) &amp;amp; picking different $t_{critical}$ values.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;...unless I misunderstood your question, that's one of the ways I see achieving what you're after.  &lt;/p&gt;&#xA;" OwnerUserId="2878" LastActivityDate="2012-10-04T03:12:02.867" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4255" PostTypeId="1" AcceptedAnswerId="4257" CreationDate="2012-10-04T04:42:49.493" Score="1" ViewCount="118" Body="&lt;p&gt;There is never enough market data for testing. And sampling from user defined distribution is a hotly debated subject as which distribution does the market really go with?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are many ways to generate synthetic data series for sensitivity testing but the methods should be sound. Does the follow method warrant further investigation? Extract daily returns from n different instruments. Mix and match them from sampling with replacement. After each new series, mix them again before generating another one. To avoid major differences in the underlining characteristics, the pool of return should come from one asset class. For example, synthetic data from stocks should come from the pool of equities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this make sense? Or is it too naive?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;" OwnerUserId="2318" LastActivityDate="2012-10-04T21:40:21.273" Title="Generating Return Streams for stress testing" Tags="&lt;data&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4256" PostTypeId="2" ParentId="4250" CreationDate="2012-10-04T09:39:26.437" Score="7" Body="&lt;p&gt;The main problem is that you cannot achieve Libor in the markets. So the old-fashioned method of discounting at Libor doesn't work any more. As an example, if you compound up the 3m Libor with today's price on a 3x6 FRA, you won't get 6m Libor. Traditionally, that would mean arbitrage, but these days it's just a fact of life. You cannot achieve 3m Libor for the first 3m months, so the PV of that cashflow comes through a funding curve (e.g. OIS curve). At 3x6, because FRAs pay at the start discounted at the quoted rate, you can't achieve 3m Libor on that cash flow either. So the expectation that you could borrow the cashflow for the 3x6 FRA at today's 3m Libor, and lend the 6m at 6m Libor just doesn't work. You come up short, and that amount is the basis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These days, it is safer to treat 3m and 6m Libor as two indices to which you have exposure, and which are correlated but not bound together. So doing 3m IRS gives you exposure to 3m Libor, which you can only correctly hedge or arbitrage using 3m instruments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In USD this is simple enough, because most things are 3m. In EUR, GBP etc, longer term IRS are 6m, and short term IR is 3m, and you end up with a 3/6 basis exposure.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2012-10-04T09:39:26.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4257" PostTypeId="2" ParentId="4255" CreationDate="2012-10-04T21:40:21.273" Score="1" Body="&lt;p&gt;You can look into block bootstrapping as one alternative to mitigate loss of any serial dependency effects.&lt;/p&gt;&#xA;" OwnerUserId="3040" LastActivityDate="2012-10-04T21:40:21.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4258" PostTypeId="1" CreationDate="2012-10-05T00:05:39.603" Score="-1" ViewCount="1028" Body="&lt;p&gt;What constitutes &quot;stealing&quot; when it comes to publicly posted financial data?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think there are three instances of this that we can individually vet:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a.) you physically broke into a location or physically broke into a computer to take the information. this is wrong. this is not ok.&lt;/li&gt;&#xA;&lt;li&gt;b.) you're getting the information off of sites like google finance and yahoo finance, etc, using some automated scraping tools you've written that use things like, say, wget and ruby, and do daily scrapes to each and every company&lt;/li&gt;&#xA;&lt;li&gt;c.) you're getting the information off of a paid service like x.com that sells financial data. you have told these people that you are using the data for some purpose other than what you're using the data for (because these people are salespeople and they don't actually have quoted rates, they sell data access like they sell cars), and they have agreed to sell it to you at a reasonable rate because you're not re-syndicating it. In reality, even, you're not re-syndicating the data, you're just using it to create a product that uses, say, 1% of that data at any given moment and does not sell it to others in any string-readable-format.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'm not interested in ethics here. My ethics state that this information should be free already in a readily accessible format. I'm interested in the legality (and practical reality of) data-acquisition on the internet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I legally allowed to take and use factual data (viz. non-creative content) for my own commercial purposes? Can I just take information? Is it considered &quot;intellectual property&quot;? Is data on publicly traded financial companies property at all? Could it ever be? I'm not trying to load the discussion, but I do have an opinion on this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Opinions, however, are not what I'm asking for, though you're welcome to share them. I'm interested in&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a.) legality&lt;/li&gt;&#xA;&lt;li&gt;b.) the practical reality of data-acquisition (what do companies like Accenture and McKinsey do to get their data?)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;edge cases (&quot;would it be legal if&quot;):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;you scraped a public site's data and used it in the making of a commercial project&lt;/li&gt;&#xA;&lt;li&gt;you scraped a private (paid, premium) site's data and used it in the making of a commercial project&lt;/li&gt;&#xA;&lt;li&gt;you used a public REST API to get data and used that in the making of a commercial project&lt;/li&gt;&#xA;&lt;li&gt;you used a private/premium/paid REST API to get data and used that in the making of a commercial project&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="3051" LastEditorUserId="3051" LastEditDate="2012-10-05T17:08:03.577" LastActivityDate="2012-10-06T16:40:05.020" Title="Is it possible to “steal” financial data on publicly traded companies off the internet? Legally, I mean, what is the truth about “data” as a property" Tags="&lt;data&gt;&lt;research&gt;&lt;programming&gt;&lt;market-data&gt;&lt;soft-question&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4259" PostTypeId="1" AcceptedAnswerId="4330" CreationDate="2012-10-05T03:04:03.053" Score="15" ViewCount="12410" Body="&lt;p&gt;What are some of the commonly used techniques to analyze tick data? &#xA;I am looking at tick data to see how the quotes/ mid-price evolves due to certain events in the market. Since tick data is asynchronous one can't really apply traditional time series models to explain these price movements. Some people have proposed that I create price bars based on either clock-time or trade-time but I think that tends to miss out on information happening in between the bars. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions on how I can approach this ? &lt;/p&gt;&#xA;" OwnerUserId="1696" LastActivityDate="2012-10-14T19:47:34.647" Title="Analyzing tick data" Tags="&lt;data&gt;&lt;market-microstructure&gt;&lt;tick-data&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="17" ContentLicense="CC BY-SA 3.0" />
  <row Id="4260" PostTypeId="1" AcceptedAnswerId="4263" CreationDate="2012-10-05T10:57:26.647" Score="2" ViewCount="485" Body="&lt;p&gt;Consider an economy with assets with return processes $A$, $B$, $C$, $D$. Consider a weighted index with return process $I=aA + bB + cC + dD$ where $a,b,c,d$ are coefficients, and $a+b+c+d = 1$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose I want to find $cov(I,A)$. Is this possible given that I know the covariance between all possible pairs of $A,B,C,D$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, suppose I have some asset $E$. Suppose I know $cov(A,E),cov(B,E),cov(C,E),cov(D,E)$. How do I find $cov(I,E)$. &lt;/p&gt;&#xA;" OwnerDisplayName="user2921" LastActivityDate="2012-10-05T13:57:06.970" Title="Combining covariances?" Tags="&lt;correlation&gt;&lt;covariance&gt;&lt;variance&gt;&lt;factor-models&gt;&lt;factor-loading&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4261" PostTypeId="2" ParentId="4259" CreationDate="2012-10-05T12:43:41.927" Score="1" Body="&lt;p&gt;In case of Tick Data, you can use the RTAQ package in R. &#xA;The standard techniques for analyzing tick data can be seen in Haustch or Frederi G. Viens &lt;/p&gt;&#xA;" OwnerUserId="3053" LastActivityDate="2012-10-05T12:43:41.927" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4262" PostTypeId="1" CreationDate="2012-10-05T12:55:27.107" Score="6" ViewCount="1239" Body="&lt;p&gt;Suppose the trade is between Index Options of two Indices X and Y which are quite similar (but not exactly). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for the equivalent strikes, one can quote option on Index X and cover in Index Y.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But these indices will have basis movements. How can one build a trading model to price options in say Index X based on Options of Index Y. How can one manage the risks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assumption (Volatility of Both Indices can be assumed to be same). For Simplicity assume, they  have equally spaced Strikes. &lt;/p&gt;&#xA;" OwnerUserId="3053" LastActivityDate="2013-05-11T22:07:32.767" Title="Pair Trading Index Options" Tags="&lt;options&gt;&lt;pairs-trading&gt;&lt;index&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4263" PostTypeId="2" ParentId="4260" CreationDate="2012-10-05T13:57:06.970" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Covariance&quot; rel=&quot;nofollow&quot;&gt;Wikipedia gives&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma(x,y) = E[xy] - E[x]E[y]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma(ax+by,cz) = ac\, \sigma(x,z) + bc\, \sigma(y,z)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(paraphrasing the $\sigma(ax+by,cW+dV)$ rule).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma(I,A) = \sigma([aA+bB+cC+dD],A)$&#xA;$\sigma(I,A) = a\,\sigma(A,A) + b\,\sigma(B,A) + c\,\sigma(C,A) + d\,\sigma(D,A)$&#xA;$\sigma(I,A) = a\,\sigma^2(A) + b\,\sigma(B,A) + c\,\sigma(C,A) + d\,\sigma(D,A)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you know the covariances between all the pairs and presumably the variance ($\sigma^2$) of A, you can thus calculate $\sigma(I,A)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same holds for $\sigma(I,E)$, only you won't get a variance term:&#xA;$\sigma(I,E) = a\,\sigma(A,E) + b\,\sigma(B,E) + c\,\sigma(C,E) + d\,\sigma(D,E)$&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2012-10-05T13:57:06.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4264" PostTypeId="1" CreationDate="2012-10-05T14:29:12.077" Score="2" ViewCount="757" Body="&lt;p&gt;I am trying to do some performance attribution for a few portfolios we manage. What I am trying to examine are three different sources of returns:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The general asset allocation&lt;/li&gt;&#xA;&lt;li&gt;Security Selection&lt;/li&gt;&#xA;&lt;li&gt;The performance of our tactical allocation&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I am quite familiar with the textbook way of performance attribution, categorizing assets and then selecting category benchmarks (easier said than done sometimes) and then comparing alpha and beta. But when you are constantly making portfolio security and weighting changes then this simplistic approach doesn't hold (unless I could calculate returns on a daily basis, which I don't have data for.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was thinking of making a replica portfolio and then entering trades every time a &lt;em&gt;real&lt;/em&gt; trade is done. That way the replica portfolio will have an updated asset allocation (benchmark) to compare with my actual portfolio and the difference should be my security selection alpha. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideas or knowledge of papers/books/research in this area would be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="3055" LastEditorUserId="35" LastEditDate="2012-10-05T14:51:15.900" LastActivityDate="2012-12-16T03:20:02.007" Title="performance attribution" Tags="&lt;tactical-asset-allocation&gt;&lt;performance-evaluation&gt;&lt;performanceanalytics&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4266" PostTypeId="1" AcceptedAnswerId="4270" CreationDate="2012-10-05T15:03:14.220" Score="10" ViewCount="3976" Body="&lt;p&gt;Usimg the put-call parity&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C - P = S - K · e^{-rt}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to estimate the value of $e^{-rt}$, the present value of a zero-coupon bond that matures to 1 in time $t$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$e^{-rt} = (P - C + S) / K$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $C$ and $P$ are call and put prices, respectively, calculated as the average between bid and ask prices; $S$ is the price of the underlying and $K$ is the strike price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried this with the SPX options with expiration Dec 2013.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/F3WgJ.png&quot; alt=&quot;decreasing e-rt&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I expected to get a constant $e^{-rt}$, but I got a decreasing $e^{-rt}$ instead. Why is this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: &lt;a href=&quot;http://www.filedropper.com/putcallparityinterestratespxdec2013&quot; rel=&quot;noreferrer&quot;&gt;The spreadsheet that generated the chart&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2257" LastActivityDate="2012-10-29T19:49:52.080" Title="Why the interest rate for put-call parity is not constant?" Tags="&lt;options&gt;&lt;interest-rates&gt;&lt;put-call-parity&gt;" AnswerCount="4" CommentCount="6" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="4268" PostTypeId="2" ParentId="4262" CreationDate="2012-10-05T15:42:47.103" Score="3" Body="&lt;p&gt;Are you trying to trade RV in delta (that is, conditional out-performance of one over the other) or identify RV in volatility (that is, you want to cover a delta-neutral vol position in one index with vol position in another index)? You approach would be very different for these two trades.&lt;/p&gt;&#xA;" OwnerUserId="2906" LastActivityDate="2012-10-05T15:42:47.103" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4269" PostTypeId="2" ParentId="4266" CreationDate="2012-10-05T15:59:29.190" Score="1" Body="&lt;p&gt;In the Put-Call parity you assume that a risk-free rate $r$ exists, but that's not the case in reality; there is no using risk-free rate. But I can't tell you why it's decreasing, but it's not surprising that it's not constant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's more surprising though, is that $e^{-rt}&amp;gt;1$ is should be smaller. Could you plot $r$ only?&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2012-10-05T15:59:29.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4270" PostTypeId="2" ParentId="4266" CreationDate="2012-10-05T16:25:59.667" Score="10" Body="&lt;p&gt;To answer a question with a question - are you assuming proportional or constant dividends? :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The general consensus of the market is that dividends are somewhere between proportional (fixed yield) and constant (fixed dollar). The carry embedded into the forward prices at different strikes reflects that consensus, in fact you can establish the &quot;constantness&quot; of the dividends based on the slope of the curve (and you will see that it's mostly constant).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mathematically, you should think of it this way. In a fixed yield dividend model, you have $F_t = S_0e^{t(r-y)}$ where $y$ is your dividend yield. Conversely, for a fixed dollar dividend model, your you have $F_t = S_0e^{tr} - D$ where $D$ is your constant dollar dividend. If you assume the second is true in the market, inverting the first one will give you different dividend yields for different levels of forwards, with dividend yield decreasing as your forward strike is increasing.&lt;/p&gt;&#xA;" OwnerUserId="2906" LastEditorUserId="2379" LastEditDate="2012-10-05T17:10:49.647" LastActivityDate="2012-10-05T17:10:49.647" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4271" PostTypeId="1" CreationDate="2012-10-05T20:30:20.017" Score="6" ViewCount="1072" Body="&lt;p&gt;How to calculate probability of touching a take-profit without touching a stop-loss (no-dividend stock, infinite time)?&lt;/p&gt;&#xA;" OwnerUserId="3056" LastEditorUserId="70" LastEditDate="2012-10-05T21:46:52.757" LastActivityDate="2019-11-12T09:06:47.397" Title="How to calculate probability of touching a take-profit without touching a stop-loss?" Tags="&lt;equities&gt;&lt;stochastic-processes&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4272" PostTypeId="1" CreationDate="2012-10-05T23:30:37.147" Score="4" ViewCount="236" Body="&lt;p&gt;Assume you want to forecast the correlation matrix of a stocks' basket (say 15 ~ 20 stocks from different sectors); assume you need to forecast at $T$ days because you will use the forecast ouput with options written on that basket: these options have maturity equal to $T$ days.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What would you choose between these two ways and why?&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Rolling window Kendall's $\tau$, with window's width $= T$ days;&lt;/li&gt;&#xA;&lt;li&gt;Generalized Orthogonal APARCH(1,1) forecasting.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Rank correlation is usually more robust than linear correlation, but ARCH family models accounts for heteroskedasticity of financial time series; in both ways mean reversion of variance and covariance does exist because of window's width in 1. and unconditional (co)variance in 2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which estimator would you use and why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, if you think a better estimator does exist, please tell me your opinion.&lt;/p&gt;&#xA;" OwnerUserId="3058" LastActivityDate="2012-10-05T23:30:37.147" Title="Rolling window Kendall's tau against APARCH(1,1) correlation" Tags="&lt;volatility&gt;&lt;correlation&gt;&lt;forecasting&gt;&lt;garch&gt;&lt;correlation-matrix&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4274" PostTypeId="1" CreationDate="2012-10-06T03:59:24.630" Score="5" ViewCount="344" Body="&lt;p&gt;For every buyer, there is a seller. Money can't 'flow' in and out of a stock, only the price changes. Is this applicable in the context of asset classes, for example, money market funds versus stocks? If a portfolio manager sells stocks and buys a money market fund, then wouldn't it mean that money 'flows out of stocks'? Or does the same logic apply, that is, since someone bought the stocks from the portfolio manager, there is technically the same amount of money in the stocks? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this is true and money flow is impossible unless it is an IPO, then why is money flow cited and considered relevant, everywhere?&lt;/p&gt;&#xA;" OwnerUserId="3059" LastEditorUserId="999" LastEditDate="2012-10-06T10:48:04.717" LastActivityDate="2020-06-20T11:55:06.847" Title="Can money technically flow in and out of stocks or asset classes?" Tags="&lt;equities&gt;&lt;finance&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4275" PostTypeId="2" ParentId="4274" CreationDate="2012-10-06T14:22:01.993" Score="8" Body="&lt;p&gt;Correct. All outstanding issues are held. Money only flows into an asset class via the primary market (such as an IPO, secondary offering, etc.) not on the secondary markets which are publicly traded. What is actually changing is people's willingness to buy and sell securities at various prices. When market commentators talk about money flowing into or out of an asset class they are missing this point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Money flow can be defined in many ways - changes in dealer inventories, changes in inventories of some group of investors (say, at the investment bank publishing the research), or as a technical indicator. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best argument you can make in favor of money flow is that there is some information content based on who owns assets (i.e. dealers, commercial hedgers, informed speculators, retail money). Understanding how certain players or groups of players are positioned might also generate some useful information (for example, certain pension funds that target a strategic policy allocation might have to buy equities on the margin if their portfolio allocation is off target).&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-10-06T14:36:31.260" LastActivityDate="2012-10-06T14:36:31.260" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4276" PostTypeId="2" ParentId="4274" CreationDate="2012-10-06T15:56:10.233" Score="2" Body="&lt;p&gt;Adding onto Quant Guy, money can technically flow in and out with dividends, buybacks and secondary issues.  In the case of a cash dividend, money flows out without any shares trading(depending on outstanding shares obviously).  While secondary issues can basically be thought of as a followup IPO if you will. Buyback is a purchase of a company of its own shares on the marketplace which can be funded by cash or debt.&lt;/p&gt;&#xA;" OwnerUserId="2732" LastEditorUserId="28784" LastEditDate="2020-06-20T11:55:06.847" LastActivityDate="2020-06-20T11:55:06.847" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="4278" PostTypeId="2" ParentId="4201" CreationDate="2012-10-06T16:27:45.573" Score="4" Body="&lt;p&gt;The strategy was discussed in the book &quot;The Poker Face of Wall Street&quot; by Aaron Brown (p258-267).  Let's say that $20 bills are put into a hat and then drawn randomly.  The serial number on the bill becomes your &quot;hand.&quot;  According to Brown the key to the game was the position of the betters.  The hierarchy determined the betting order.  So, the senior people bet first and junior traders always bet last. This was a disadvantage for the juniors if they played a naive strategy.  What Brown discovered was a system that didn't require cooperation between people but escalated the bids very quickly thus jamming the early bidders when the betting came back around to them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an aside, I liked Brown's book.  It's a quick, fun read.  He seems like an interesting guy who'd kill me at poker.&lt;/p&gt;&#xA;" OwnerUserId="3065" LastActivityDate="2012-10-06T16:27:45.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4279" PostTypeId="2" ParentId="4258" CreationDate="2012-10-06T16:40:05.020" Score="4" Body="&lt;p&gt;there is no stealing of data unless you delete it from the original source. Let me elaborate, as the semantics are very important here. Stealing, even with quotes around it, &quot;Stealing&quot; requires that something is removed from the original place. You steal car. You copy a file, as such data is protected via copyright when it can and other subsequent acts that essentially provide remedies for unauthorized use outside the scope of copyright.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, financial data on public filings is protected by copyright, and it doesn't matter if it is posted in the SEC's database or a site reselling it. The question you are asking is about copyright infringement and what rights you have. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This very question was challenged by the International Swaps and Derivatives Association, Inc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.pattishall.com/pdf/8-17-10_Copyright_Infringement_in_Edgar_Docs_Blog_Post.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.pattishall.com/pdf/8-17-10_Copyright_Infringement_in_Edgar_Docs_Blog_Post.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and it was determined by a court that the entity was infringing on the copyrights of the International Swaps and Derivatives Association.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so, as it was suggested, you would need to talk to the data vendor to determine if your specific application is legitimate to them and you may need to cut a deal (Accenture and McKinsey do). Because it absolutely will not be state-sanctioned by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This should help answer your question.&lt;/p&gt;&#xA;" OwnerUserId="1453" LastActivityDate="2012-10-06T16:40:05.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4280" PostTypeId="1" AcceptedAnswerId="4281" CreationDate="2012-10-06T18:57:22.823" Score="4" ViewCount="204" Body="&lt;p&gt;I'm using SVM binary classification to predict movement of NASDAQ stock prices. My question is regarding cross-validation. I will divide the training data into V subsets. Training will be performed on (V-1) subsets and then prediction on the V-th subset is recorded. This will be done V times.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) Is the best measure of accuracy the average of all V outcomes? Or perhaps the minimum?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) Should subsets be equal length? Random?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2a) Can subsets overlap?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(3) Do I need to ensure that each subset has at least some minimum percentage of each class outcome (1 or 0) for the results to be valid?&lt;/p&gt;&#xA;" OwnerUserId="3045" LastActivityDate="2012-10-06T20:51:06.113" Title="How to properly cross-validate when optimizing SVM classification?" Tags="&lt;nasdaq&gt;&lt;svm&gt;&lt;classifier&gt;&lt;kernel&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4281" PostTypeId="2" ParentId="4280" CreationDate="2012-10-06T19:38:49.853" Score="1" Body="&lt;p&gt;The cross-validation procedure does not turn on the choice of algorithm.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Yes - calculate the prediction error of the fitted models when predicting the V'th part of the data. Combine the V estimates of prediction average using a simple average.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Subsets should be randomly sampled (roughly equally sized). 2a. Subsets should not overlap.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;No. As long as the sampling is random you are OK.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-10-06T20:51:06.113" LastActivityDate="2012-10-06T20:51:06.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4284" PostTypeId="1" AcceptedAnswerId="4285" CreationDate="2012-10-07T20:40:14.773" Score="2" ViewCount="1365" Body="&lt;p&gt;In &lt;a href=&quot;http://finance.yahoo.com/&quot; rel=&quot;nofollow&quot;&gt;Yahoo! Finance&lt;/a&gt;, we see the following quotes among others:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Nasdaq  3,136.19     -13.27 -0.42%&#xA;Oil        89.879997  -1.83 -2.00%&#xA;EUR/USD     1.3031     0.00 +0.11%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What determines the number of decimals displayed?&lt;/p&gt;&#xA;" OwnerUserId="3000" LastActivityDate="2012-10-07T21:29:42.950" Title="In Yahoo! Finance, what determines the number of decimals for a stock/index quote?" Tags="&lt;finance&gt;&lt;visualization&gt;&lt;yahoo&gt;&lt;price&gt;&lt;quote&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4285" PostTypeId="2" ParentId="4284" CreationDate="2012-10-07T21:29:42.950" Score="2" Body="&lt;p&gt;This is an example of &lt;em&gt;minimum price variation&lt;/em&gt; (also known as the minimum price &lt;em&gt;increment&lt;/em&gt; or the minimum price &lt;em&gt;fluctuation&lt;/em&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All &lt;em&gt;public&lt;/em&gt; quotes for US equities are displayed to the nearest penny. (Hidden quotes may be entered at sub-penny increments.) US stock indices follow this convention and thus quote to the nearest penny.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The oil listing is odd indeed. If I click through to the full oil page, I only see that the price is listed to the nearest penny. Indeed, I see that this price represents the NYMEX crude (CL) contract. From the CME Group's &lt;a href=&quot;http://www.cmegroup.com/trading/energy/crude-oil/light-sweet-crude_contract_specifications.html&quot; rel=&quot;nofollow&quot;&gt;contract specification&lt;/a&gt;, the minimum fluctuation is one penny per barrel. So it's bizarre that Yahoo's front page is showing something else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the Euro, that's a spot price. I can't see exactly where Yahoo is getting their data, but they do describe it as &quot;bank rates&quot;. (&lt;a href=&quot;http://www.google.com/intl/en/help/currency_disclaimer.html&quot; rel=&quot;nofollow&quot;&gt;Google gets theirs from Citi&lt;/a&gt;.) I suspect the convention is 0.0001 dollars increment per euro since that's what &lt;a href=&quot;http://www.cmegroup.com/trading/fx/g10/e-mini-euro-fx_contract_specifications.html&quot; rel=&quot;nofollow&quot;&gt;CME Group uses in the futures market&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2012-10-07T21:29:42.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4286" PostTypeId="1" AcceptedAnswerId="4304" CreationDate="2012-10-07T23:48:59.850" Score="2" ViewCount="3510" Body="&lt;p&gt;I'm looking to conduct hypothesis tests on some of my trading signals to see if the signal returns are statistically significant enough to falsify my null hypothesis that the signal has no predictive power.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A signal's returns can be distorted by 2 things:&#xA;(1) the signal's long/short position bias, and&#xA;(2) the market's net trend during the back-test period. Both of these components can apparently be eliminated by de-trending the data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An excerpt from &quot;Evidence Based Technical Analysis&quot; : &quot;To perform the detrending transformation, one first determines the average daily price change of the market being traded over the historical test period. This average value is then subtracted from each day's price change.&quot; He goes on to say to use log returns over percentage-based returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few question arise:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) What if my strategy is intraday, should I still be using the average DAILY price change to detrend the data, or should I go down to the frequency on which I trade and calculate the average 1 minute price changes (strategy trades on 1M)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Should I really be using a future statistic (the average price change of the market over the backtest period) that is not known until the backtest is complete to detrend past data, post-backtest? I fear this will result in a statistical conclusion that is only valid for the backtest period. Or should I calculate the detrended market return every bar? In that case should I use a cumulative or rolling window to calculate the average market return (to be subtracted from the current return)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) I know there's other ways to detrend data other than:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;( Log(CurrentPrice/LastPrice) - Average(Log(CurrentPrice/LastPrice)) )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know of a method that is particularly better suited for my problem domain? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="3038" LastActivityDate="2018-02-23T02:51:37.173" Title="Detrending price data for analysis of signal returns" Tags="&lt;statistics&gt;&lt;stationarity&gt;&lt;statistical-finance&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4287" PostTypeId="1" CreationDate="2012-10-07T23:49:26.587" Score="4" ViewCount="356" Body="&lt;p&gt;I am wondering if anybody could point me to any literature that talks about a discrete time version of the jump-diffusion model, I am aware that there is a paper by Amin (1993) that shows a discrete version of this model that converges, however it is very inefficient and does not recombine, there are a few other papers that try to improve this but they still do not recombine efficiently.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another related question is, are there any models that introduce jumps but are fully recombining?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you,&lt;/p&gt;&#xA;" OwnerUserId="3072" LastActivityDate="2012-10-07T23:49:26.587" Title="Discrete-time Jump-Diffusion Model" Tags="&lt;models&gt;&lt;jump&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4289" PostTypeId="2" ParentId="4286" CreationDate="2012-10-08T03:33:26.707" Score="2" Body="&lt;p&gt;You should de-trend to whatever frequency scale you are testing. I.e. 1 min means de-trend 1 min data. Merely by moving to higher frequency data, you are eliminating much of the systematic bias present at higher scales -- as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) you have many more samples to compare (minimizing standard error)&#xA;2) At smaller intervals, the drift component also shrinks progressively smaller.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are trading at much higher sampling interval scales, e.g. 1 month, it would make more sense to compare returns over the higher period to be consistent in comparisons.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Log scale return transformations are often preferred as they can be more stationary (and closer to IID assumptions for parametric based statistical testing).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The choice of using a rolling window vs. all historical is a bit of art vs. pure science. Nowadays (post 'Evidedence Based TA'), there is a lot more focus being given to out of sample performance and ability to generalize (cross-validation is one way to approach this).&lt;/p&gt;&#xA;" OwnerUserId="3040" LastEditorUserId="3040" LastEditDate="2012-10-08T10:36:51.367" LastActivityDate="2012-10-08T10:36:51.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4290" PostTypeId="2" ParentId="4259" CreationDate="2012-10-08T04:26:34.827" Score="0" Body="&lt;p&gt;I suggest checking out some of the research from &lt;a href=&quot;http://www.nanex.net/FlashCrash/OngoingResearch.html&quot; rel=&quot;nofollow&quot;&gt;Nanex&lt;/a&gt;.  You should be able to pick up some methods just by going through some of their event analysis.&lt;/p&gt;&#xA;" OwnerUserId="2732" LastActivityDate="2012-10-08T04:26:34.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4291" PostTypeId="2" ParentId="4252" CreationDate="2012-10-08T11:38:45.437" Score="0" Body="&lt;p&gt;This recent &lt;a href=&quot;http://www.statalgo.com/2012/10/07/market-microstructure-3-the-roll-model-1984/&quot; rel=&quot;nofollow&quot;&gt;Statalgo blog post&lt;/a&gt; outlines a simple theoretical model of bid/ask prices: the Roll model, and also shows how the bid/ask spread can be derived from prices using this model. Included in the post are links to papers that show how this model might be improved.&lt;/p&gt;&#xA;" OwnerUserId="252" LastEditorUserId="252" LastEditDate="2012-10-09T20:03:15.417" LastActivityDate="2012-10-09T20:03:15.417" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4293" PostTypeId="2" ParentId="4264" CreationDate="2012-10-08T15:40:09.313" Score="2" Body="&lt;p&gt;There are a number of issues here. First, there are a number of methodologies called “performance attribution” each providing answers to different questions.  So I am not sure what type of question you wish to address.&#xA;I will here assume that you wish to evaluate the effects of investment decisions as opposed to the effects of market factors. I will also assuming that your distinction between “general asset allocation” (as different than Security Selection) and “tactical allocation” means that you are not simply nesting asset allocations but incorporating “tactical” decisions that are not instantiated in the actual weights implemented by the fund.  Then the “textbook way of (decision) performance attribution” needs to be expanded/adjusted in order to incorporate “tactical allocation”.  Similarly, if one wishes to evaluate the effects ON beta, since “textbook” decision mythologies only meaningfully address active return.  Alternately, if you want to evaluate the effects OF beta then this would have to be correctly formulated as a decision or one might consider other types of attribution, such as market factor attribution, instead of decision attribution. &#xA;Finally, all methodologies need to be tailored to the content of the data you provide.  Since you say that you do not have daily data, to properly answer your question, I would need a clearer understanding of what data you do have. &#xA;The level of seriousness that you seem to have regarding getting “performance attribution” correct indicates that you need an industrial strength solution. Such are not buildable as a small project, but takes years of careful thought and implementation. This suggests that you look into buying a robust solution rather than trying to build one yourself.&lt;/p&gt;&#xA;" OwnerUserId="3075" LastActivityDate="2012-10-08T15:40:09.313" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4294" PostTypeId="1" AcceptedAnswerId="4296" CreationDate="2012-10-09T02:27:16.850" Score="5" ViewCount="4553" Body="&lt;p&gt;In the same spirit as this question: &lt;a href=&quot;https://quant.stackexchange.com/questions/139/trading-a-synthetic-replication-of-the-vix-index&quot;&gt;Trading a synthetic replication of the VIX index&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://www.cboe.com/micro/vvix/default.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;VVIX&lt;/a&gt; tracks the volatility of the VIX.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One cannot directly buy and sell the VVIX index and, as opposed to VIX, there are no futures or options to trade it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to synthetically replicate the VVIX index using VIX options and futures (or other tradable instruments)?&lt;/p&gt;&#xA;" OwnerUserId="2257" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2012-12-23T05:56:06.957" Title="Trading a synthetic replication of the VVIX (volatility of VIX)" Tags="&lt;volatility&gt;&lt;vix&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4295" PostTypeId="2" ParentId="139" CreationDate="2012-10-09T03:34:18.443" Score="4" Body="&lt;p&gt;to match the constant 30-day VIX horizon, I think you would want to trade two straddles in the first and second expiration cycles and delta hedge, gradually rolling the weight towards the second month straddle and then finally to a new straddle at/near expiration each month. Here are some problems I can imagine for this approximation. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Hedging error - the details of the delta hedging regime matter as there seems to be a wide range of BSM etc. hedging errors in the literature. &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1678460&quot; rel=&quot;nofollow&quot;&gt;This paper&lt;/a&gt; looks promising.&lt;/li&gt;&#xA;&lt;li&gt;Missing the boat on large moves - beyond a certain % move in the underlying, the hedged straddles just become a synthetic long or short position, i.e. they &quot;run out&quot; of gamma. This matters in cases of a major rally or crash, where the VIX is priced with the most weight at some strike at 80% or 120% of the moneyness of the strike of your existing straddles. This would also be a problem for a replication of VXO.&lt;/li&gt;&#xA;&lt;li&gt;Skew changes - There are also those cases where the market is moving modestly, price-wise, and yet VIX changes not because traders are repricing volatility but because the IV skew is changing. Even though OTM options have less weight, they can cause the index to move if the bids change enough to steepen or flatten the curve. Here a replication of VXO would be easier.&lt;/li&gt;&#xA;&lt;li&gt;There are some calendar and calculation quirks with VIX and its component indices &lt;a href=&quot;http://www.cboe.com/micro/vin/&quot; rel=&quot;nofollow&quot;&gt;VIN and VIF&lt;/a&gt; that can be ignored if your replication needs are relaxed enough, but otherwise would introduce some tracking error, esp. intraday.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The CFE is (re)listing its &lt;a href=&quot;http://cfe.cboe.com/Products/Products_VA.aspx&quot; rel=&quot;nofollow&quot;&gt;S&amp;amp;P 500 variance futures&lt;/a&gt; soon. Those also have fixed settlement dates, so you would need to roll them continuously to maintain a constant time exposure matching VIX, but if they attract liquidity I expect they'll be a better fit than the straddles.&lt;/p&gt;&#xA;" OwnerUserId="2378" LastActivityDate="2012-10-09T03:34:18.443" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="4296" PostTypeId="2" ParentId="4294" CreationDate="2012-10-09T03:59:53.743" Score="3" Body="&lt;p&gt;It is &lt;a href=&quot;http://en.wikipedia.org/wiki/Variance_swap&quot; rel=&quot;nofollow&quot;&gt;variance swap&lt;/a&gt;, so obviously, it's possible, but what's the point?&lt;/p&gt;&#xA;" OwnerUserId="2906" LastEditorUserId="35" LastEditDate="2012-10-15T22:44:51.760" LastActivityDate="2012-10-15T22:44:51.760" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4297" PostTypeId="2" ParentId="4266" CreationDate="2012-10-09T04:07:46.857" Score="1" Body="&lt;p&gt;In the Put-Call parity  r is assumed to be  risk-free interest rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In reality, the interest rate the is rate at which interest is paid by a borrower for the use of money that they borrow from a lender. Its behavior is similar to  price in the market , which price fluctuation depends on the news in the market.  It is usually higher than risk-free interest rate. because of the consideration of inflation mainly controlled by money supply and risk-premium that the lenders may not receive the money returned from the borrowers.&lt;/p&gt;&#xA;" OwnerUserId="3022" LastActivityDate="2012-10-09T04:07:46.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4298" PostTypeId="2" ParentId="4259" CreationDate="2012-10-09T10:56:58.970" Score="2" Body="&lt;p&gt;In order to use methods for equidistant time series:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;simply disregard timestamps&lt;/li&gt;&#xA;&lt;li&gt;separate trade and clock time (like 1: clock time increments as time series)&lt;/li&gt;&#xA;&lt;li&gt;create [sparse] equidistant time series with tiny time increment ([implicitly] repeating prices when necessary)&lt;/li&gt;&#xA;&lt;li&gt;aggregate equidistant bars&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Although some above are blatant, they would get you going. Besides that, I have had &lt;a href=&quot;http://www.irinaclimbs.com/Papers/HFT_DATA_engle.pdf&quot; rel=&quot;nofollow&quot;&gt;Engle, Russell, 2004, &quot;Analysis of High Frequency Financial Data&quot;&lt;/a&gt; waiting for me to read it for some time now. &lt;a href=&quot;http://www.amazon.co.uk/gp/product/0122796713?ie=UTF8&amp;amp;tag=quantifinanc-21&amp;amp;linkCode=as2&amp;amp;camp=1634&amp;amp;creative=6738&amp;amp;creativeASIN=0122796713#_&quot; rel=&quot;nofollow&quot;&gt;An Introduction to High-frequency Finance&lt;/a&gt; might be relevant, too.&lt;/p&gt;&#xA;" OwnerUserId="2284" LastEditorUserId="2284" LastEditDate="2012-10-14T00:06:46.877" LastActivityDate="2012-10-14T00:06:46.877" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4299" PostTypeId="1" AcceptedAnswerId="4301" CreationDate="2012-10-09T12:37:11.670" Score="4" ViewCount="333" Body="&lt;p&gt;If a linear sum of options is constructed such that the premium payout is zero, then does it mean that resultant greeks of the cumulated options positions will be nearly zero. For simplicity, lets consider only single expiry case. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;a*(Put@X1) + b*(Call@X2) + c*(Put@X2) = 0, for integer values of a,b,c, then the greeks from such a position should result in nearly zero greeks.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If they result in providing us with non-zero greeks, then there is a possibility of being able to build positions such that we only have greeks exposure, without any premium outlay. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can this question be better worded?&lt;/p&gt;&#xA;" OwnerUserId="3053" LastActivityDate="2016-02-16T20:51:08.460" Title="Greeks and Option Premium" Tags="&lt;options&gt;&lt;derivatives&gt;&lt;option-strategies&gt;&lt;greeks&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4300" PostTypeId="1" AcceptedAnswerId="4320" CreationDate="2012-10-09T13:37:29.850" Score="4" ViewCount="187" Body="&lt;p&gt;I'm trying to do some risk analysis on a portfolio of bonds, currency, stocks and short calls. The short calls expire in approximately 15-30 days and I've only got around 20 days of pricing data on them. Can I extrapolate the call positions into the past on a rolling maturity basis so that I can look at how a portfolio containing calls would've performed in the past? How are extreme risks generally measured with limited data e.g. 30 day options?&lt;/p&gt;&#xA;" OwnerUserId="3079" LastActivityDate="2012-10-10T17:49:39.753" Title="How do I model risks for specific short-term short calls in a portfolio with limited data?" Tags="&lt;options&gt;&lt;risk&gt;&lt;var&gt;&lt;portfolio&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4301" PostTypeId="2" ParentId="4299" CreationDate="2012-10-09T13:38:03.077" Score="3" Body="&lt;p&gt;It might not work the way you think.  Note first that nobody sells options for free so at least one of your integers ($a,b,c$) is negative, meaning you will have nonzero risk of losing money on your short option leg.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More specifically, let's pretend $b \geq |c|$.  Then since the value of a forward contract is the same as the call minus the put plus strike $X_2$ you can also think of yourself as owning&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;a P(X_1) + b C(X_2) + e^{-rt} (b-|c|) (F - X_2)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously you can only make money on the first two components, but that forward contract could end up costing you a ton.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you really don't want to pay upfront, it is quite simple to choose $a$ and $b$, look at the prices of the three options in the market, and then set&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;c =- \frac{a P(X_1) + b C(X_2)}{P(X_2)}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which of course results in no upfront cost to the combination.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may be interested in a well-known combination called the &lt;a href=&quot;http://en.wikipedia.org/wiki/Butterfly_%28options%29&quot; rel=&quot;nofollow&quot;&gt;butterfly&lt;/a&gt;.  It is (theoretically) possible to trade a butterfly for no &lt;em&gt;initial&lt;/em&gt; premium, by choosing just the right strikes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ignoring bid-offer spreads, and assuming the Black-Scholes model for calls and puts as a function of strike is given by $C(K)$ and $P(K)$, the way to find some strikes for a zero premium is to&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Choose a central strike $K_C$, perhaps the current undelying price $S_0$&lt;/li&gt;&#xA;&lt;li&gt;Use a &lt;a href=&quot;http://mathworld.wolfram.com/SecantMethod.html&quot; rel=&quot;nofollow&quot;&gt;root finder&lt;/a&gt; to solve for a in the equation&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;0 = P(K_C-a) - 2 P(K_C) + P(K_C+a)&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2012-10-09T17:52:07.520" LastActivityDate="2012-10-09T17:52:07.520" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4304" PostTypeId="2" ParentId="4286" CreationDate="2012-10-09T17:11:28.463" Score="1" Body="&lt;p&gt;In answer to your question 2, you should detrend over the entire range of the back test period. The purpose of the detrending is to satisfy/create the null hypothesis for the boot strap test (it's not strictly necessary for the permutation test). This hypothesis is that the return from your strategy is zero. To create this zero null hypthesis you have to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) detrend over the entire data set to eliminate any long term trend, in effect removing the return that could be obtained from simple buy and hold, and this also removes the long/short bias of your system&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) then remove the average return of your system on this detrended data from above to create the null hypothesis distribution for boot strapping&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your concern about &quot;future statistic&quot; does not apply here - none of the above informs the decision making process of the system as this test is run &lt;em&gt;after&lt;/em&gt; you have generated your signal vector. It is simply a statistical test run on data after it has been collected.&lt;/p&gt;&#xA;" OwnerUserId="252" LastActivityDate="2012-10-09T17:11:28.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4305" PostTypeId="1" CreationDate="2012-10-09T17:22:23.623" Score="3" ViewCount="89" Body="&lt;p&gt;Why does dividing daily returns by daily range eliminates fat tails and results in an (almost) gaussian distribution?&#xA;And how could that distribution be exploited to enter trades?&lt;/p&gt;&#xA;" OwnerUserId="3081" LastActivityDate="2012-10-09T17:22:23.623" Title="How to trade risk-adjusted returns?" Tags="&lt;volatility&gt;&lt;quant-trading-strategies&gt;&lt;normal-distribution&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4307" PostTypeId="1" CreationDate="2012-10-09T18:36:16.530" Score="2" ViewCount="1191" Body="&lt;p&gt;I have been trying to undestand how the expected utility for a CARA negative exponential Utility function is calculated. In my particular case the variable has normally distributed returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could someone help me?&lt;/p&gt;&#xA;" OwnerUserId="3082" LastEditorUserId="16595" LastEditDate="2018-09-04T20:16:07.610" LastActivityDate="2018-09-04T20:16:07.610" Title="CARA Utility function expected utility" Tags="&lt;utility-theory&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4308" PostTypeId="2" ParentId="4307" CreationDate="2012-10-09T19:52:03.307" Score="3" Body="&lt;p&gt;&lt;a href=&quot;http://economics.about.com/library/glossary/bldef-cara-utility.htm&quot; rel=&quot;nofollow&quot;&gt;CARA Utility function&lt;/a&gt; $u(c)=\frac{-e^{-ac}}{a}$ for $a&amp;gt;0.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Expected_value&quot; rel=&quot;nofollow&quot;&gt;Expected&lt;/a&gt; utility $E(u(c))=\int_{-\infty}^{\infty} u(c) f(c) dc,$ where f is a &lt;a href=&quot;http://en.wikipedia.org/wiki/Probability_density_function&quot; rel=&quot;nofollow&quot;&gt;density&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example f(10)=0.3, f(20)=0.7, else f=0 and a=2.&#xA;Then&#xA;$E(u(c))=0.3\times u(10)+0.7\times u(20)=0.3\times \frac{-e^{-2*10}}{2}+0.7\times \frac{-e^{-2*20}}{2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, for normal density $f(c)=\frac{1}{\sqrt{2\pi}}\; e^{-c^2/2}$ we have $E(u(c))=\int_{-\infty}^{\infty} u(c) f(c) dc=\int_{-\infty}^{\infty} \frac{-e^{-ac}}{a} \frac{1}{\sqrt{2\pi}}\; e^{-c^2/2} dc=\frac{-1}{a\sqrt{2\pi}}\; \int_{-\infty}^{\infty} e^{-ac} e^{-c^2/2} dc=\frac{-1}{a\sqrt{2\pi}}\; \int_{-\infty}^{\infty} e^{-ac-c^2/2} dc.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here the integral $\int_{-\infty}^{\infty} e^{-ac-c^2/2} dc$ can be solved with help of the solution $\int_{-\infty}^{\infty} e^{-Ax^2} e^{-2Bx}\,dx=\sqrt{\frac{\pi}{A}}e^{\frac{B^2}{A}} \quad (A&amp;gt;0)$ from the &lt;a href=&quot;http://en.wikipedia.org/wiki/List_of_integrals_of_exponential_functions&quot; rel=&quot;nofollow&quot;&gt;list of integrals of exponential functions.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Comparison yields A=0.5, B=0.5a, thus $E(u(c))=\frac{-1}{a\sqrt{2\pi}}\sqrt{\frac{\pi}{0.5}}e^{\frac{(0.5a)^2}{0.5}}=\frac{-1}{a\sqrt{2\pi}}\sqrt{2\pi}e^{\frac{0.25a^2}{0.5}}=\frac{-e^{0.5a^2}}{a}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And this can be &lt;a href=&quot;http://www.wolframalpha.com/input/?i=-e%5E%280.5%2aa%5E2%29/a%20%28a%20from%200%20to%203%29&quot; rel=&quot;nofollow&quot;&gt;nicely plotted with Wolfram alpha.&lt;/a&gt; Does your solution confirm this?&lt;/p&gt;&#xA;" OwnerUserId="2284" LastActivityDate="2012-10-09T19:52:03.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4310" PostTypeId="2" ParentId="4252" CreationDate="2012-10-10T00:51:05.140" Score="3" Body="&lt;p&gt;As @babelproofreader mentioned, I &lt;a href=&quot;http://www.statalgo.com/2012/10/07/market-microstructure-3-the-roll-model-1984/&quot; rel=&quot;nofollow&quot;&gt;recently blogged about the Roll model&lt;/a&gt; (see the &lt;a href=&quot;http://www.bauer.uh.edu/rsusmel/phd/roll1984.pdf&quot; rel=&quot;nofollow&quot;&gt;original paper&lt;/a&gt;), which provides a very simple method for inferring the bid/ask spread based on trade prices.  In short, you can estimate the cost using using the covariance: $c = \sqrt{\gamma_1}$.  Where $\gamma_1$ is the $Cov(r_t, r_{t-1})$. (The R code is provided &lt;a href=&quot;http://www.statalgo.com/2012/10/07/market-microstructure-3-the-roll-model-1984/&quot; rel=&quot;nofollow&quot;&gt;in my post&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Roll model makes many simplifying assumptions and is an empirical failure (although still &lt;em&gt;theoretically&lt;/em&gt; important), so I would not advise using it as a real proxy for costs.  There have been many advancements since that original paper.  Two better options:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Joel Hasbrouck (2009) &lt;a href=&quot;http://people.stern.nyu.edu/jhasbrou/Research/GibbsCurrent/HasbrouckJF.pdf&quot; rel=&quot;nofollow&quot;&gt;&quot;Trading costs and returns for U.S. equities: Estimating effective costs from daily data&quot;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Shane Corwin and Paul Shultz (2012) &lt;a href=&quot;http://www.nd.edu/~scorwin/documents/high-low_spreads.pdf&quot; rel=&quot;nofollow&quot;&gt;&quot;A Simple Way to Estimate Bid-Ask Spreads from Daily High and Low Prices&quot;&lt;/a&gt; &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;[I may blog further on this topic in the future, but it doesn't seem as important as other topics given the ready availability of actual bid/ask spread data.]&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2012-10-10T00:51:05.140" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4312" PostTypeId="1" CreationDate="2012-10-10T02:29:51.167" Score="3" ViewCount="552" Body="&lt;p&gt;I was wondering if this mean(160)-reverting/oscillatory time series &quot;SUM&quot; can be considered chaotic &amp;amp; forecastable to some extend short-term?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://sg.myfreepost.com/sgTOTO_analysispower.php?draws=60&amp;amp;fn0=Sum&quot; rel=&quot;nofollow&quot;&gt;http://sg.myfreepost.com/sgTOTO_analysispower.php?draws=60&amp;amp;fn0=Sum&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there time-series forecasting methods that give a broader &quot;range&quot; prediction structure rather than &quot;exact/precise&quot; future numbers (e.g, neural network which can be totally off since it is just trying to curve-fit)? &#xA;Is fuzzy logic method able to give a prediction interval for the immediate next period in a discrete time series?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would appreciate if anyone can provide some insight to this case study.&lt;/p&gt;&#xA;" OwnerUserId="3085" LastEditorUserId="3085" LastEditDate="2012-10-10T02:41:48.487" LastActivityDate="2013-01-14T11:13:44.890" Title="Oscillatory time-series forecasting" Tags="&lt;time-series&gt;&lt;forecasting&gt;&lt;prediction&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4315" PostTypeId="2" ParentId="4250" CreationDate="2012-10-10T11:24:03.600" Score="2" Body="&lt;p&gt;If a bank lends 6m Libor and finances it by borrowing 3m Libor and borrowing forward 3x6 libor, this is not arbitrage, as the bank is assuming 6m credit risk whilst his financing is 3m credit risk. (There are also other factors like regulatory capital, tying up balance sheet for 6m, etc.) So the text book case where the 3x6 FRA (or front Eurodollar) is equal to the implied 3m forward rate derived from 3m and 6m libor fixings is an academic fiction. In reality the 3x6 FRA will always be lower than the impled forward calculated from the 3m and 6m fixings. This is &quot;the basis&quot;. In the past it was negligible, but since 2008 it is significant. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(NB. Hardly any interbank lending takes place at 6m nowadays.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the swap rates that you cite are vs 3m floating rates, the fixed rate on those swaps reflects expectations of future 3m fixings, &lt;em&gt;not&lt;/em&gt; 3x6, 6x9, ... &lt;em&gt;implied forwards&lt;/em&gt;. That is why the 2y swap is about 37bps. If the 2y swap were vs 6m floating, it would probably trade around 60-70bps. In other words, the swap rates reflect the money market basis on the tenor of the floating leg. &lt;/p&gt;&#xA;" OwnerUserId="3088" LastActivityDate="2012-10-10T11:24:03.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4316" PostTypeId="1" AcceptedAnswerId="4319" CreationDate="2012-10-10T11:38:25.240" Score="6" ViewCount="4042" Body="&lt;p&gt;Let say I have &lt;span class=&quot;math-container&quot;&gt;$n$&lt;/span&gt; assets and their returns over &lt;span class=&quot;math-container&quot;&gt;$m$&lt;/span&gt; periods which are represented by a matrix &lt;span class=&quot;math-container&quot;&gt;$X \in \mathbb{R}^{m \times n}$&lt;/span&gt;, and I have some other asset with return over the same period which is represented by a vector &lt;span class=&quot;math-container&quot;&gt;$y \in  \mathbb{R}^m$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;My objective is to find a vector of weights &lt;span class=&quot;math-container&quot;&gt;$w$&lt;/span&gt; such that&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$w^* = \underset{w}{\arg \min} ~ \text{TE}(w)$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;where &lt;span class=&quot;math-container&quot;&gt;$\text{TE}(w)$&lt;/span&gt; is the &lt;a href=&quot;http://en.wikipedia.org/wiki/Tracking_error&quot; rel=&quot;noreferrer&quot;&gt;tracking error&lt;/a&gt; defined as follows:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\text{TE}(w) = \sqrt{\text{Var}(Xw - y)}$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ \sum_{i=1}^n w_i =1 $$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;In short, I want to replicate &lt;span class=&quot;math-container&quot;&gt;$y$&lt;/span&gt; using a portfolio of assets &lt;span class=&quot;math-container&quot;&gt;$X$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;My idea was to use the exact definition of the tracking error mentioned above through an optimizer.&lt;/p&gt;&#xA;&lt;p&gt;However, somebody suggested to use the following:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ w^* = \underset{w}{\arg \min} ~ \sum_{i=1}^m (Xw-y)_i^2 $$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;I tried both and I get a better tracking error with the first one.&lt;/p&gt;&#xA;&lt;p&gt;It seems clear to me that both should return exactly the same if indeed there exists some &lt;span class=&quot;math-container&quot;&gt;$w$&lt;/span&gt; which perfectly replicates &lt;span class=&quot;math-container&quot;&gt;$y$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;What if it's not the case?&lt;/p&gt;&#xA;&lt;p&gt;Is there another approach?&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2012-10-20T05:05:28.150" Title="Which objective function should I choose to minimize tracking error?" Tags="&lt;optimization&gt;&lt;replication&gt;&lt;tracking-error&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="4317" PostTypeId="1" CreationDate="2012-10-10T13:04:02.643" Score="3" ViewCount="157" Body="&lt;p&gt;On 10.10.2012, I have looked at the bond-rates and, both for Switzerland and Denmark, there is a discontinuity/spike at 1Y, as per below&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Switzerland: ON= -0.09, 1W= -0.180, 1M= -0.230, 3M= -0.2, 6M= -0.01, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1Y= +0.250, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2Y= -0.124, 4Y= -0.077, 5Y= 0.060, etc (normal curve)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Denmark: 1M= -0.350, 2M= -0.300, 3M= -0.150, 6M= -0.150, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1Y= +0.320, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2Y= -0.028, 3Y= +0.114, etc (normal curve)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could somebody hint why? They are no artificial rates (obtained by compunding with FRAs) but actually traded ones.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I mean the governmental bonds, which seemed to be &quot;live&quot; on Denmark &lt;a href=&quot;http://www.forexpros.com/rates-bonds/denmark-government-bonds?maturity_from=10&amp;amp;maturity_to=290&quot; rel=&quot;nofollow&quot;&gt;http://www.forexpros.com/rates-bonds/denmark-government-bonds?maturity_from=10&amp;amp;maturity_to=290&lt;/a&gt; for Denmark and &lt;a href=&quot;http://www.forexpros.com/rates-bonds/switzerland-government-bonds?maturity_from=10&amp;amp;maturity_to=290&quot; rel=&quot;nofollow&quot;&gt;http://www.forexpros.com/rates-bonds/switzerland-government-bonds?maturity_from=10&amp;amp;maturity_to=290&lt;/a&gt; for Switzerland. Right now the charts links appear to be not working :(this is a window I used to have opened today)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Denmark - Government Bonds&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pair     Yield    Prev.  High  Low     Chg.  Chg. % Time &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Denmark 1-Month -0.350 -0.350 -0.200 -0.350 0.000 0.00% 7:44:14 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Denmark 2-Month -0.300 -0.120 -0.250 -0.350 -0.180 -150.00% 16:01:03 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Denmark 3-Month -0.150 -0.150 -0.150 -0.200 0.000 0.00% 16:01:03 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Denmark 6-Month -0.150 -0.150 -0.150 -0.200 0.100 -40.00% 10/10 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Denmark 1-Year 0.370 0.370 0.370 0.200 0.050 15.62% 6:52:14 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Denmark 2-Year -0.021 -0.021 -0.005 -0.040 0.011 36.36% 15:00:39 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Denmark 3-Year 0.086 0.093 0.130 0.056 -0.007 -7.53% 18:10:46 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Denmark 5-Year 0.289 0.290 0.319 0.264 -0.001 -0.34% 17:00:12 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Denmark 8-Year 0.897 0.924 0.945 0.865 -0.027 -2.92% 18:21:17 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Denmark 10-Year 1.540 1.541 1.552 1.483 -0.001 -0.06% 15:04:48 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Denmark 15-Year 1.490 1.489 1.512 1.422 0.001 0.07% 18:23:15 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Denmark 30-Year 2.143 2.166 2.176 2.101 -0.023 -1.06% 18:23:43 &lt;/p&gt;&#xA;" OwnerUserId="2872" LastEditorUserId="2872" LastEditDate="2012-11-30T18:47:04.927" LastActivityDate="2012-11-30T18:47:04.927" Title="Why for one year (and not two or three) government bonds (there is a spike for Switzerland &amp; Denmark)?" Tags="&lt;interest-rates&gt;&lt;negative&gt;&lt;interpolation&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4319" PostTypeId="2" ParentId="4316" CreationDate="2012-10-10T16:42:26.313" Score="2" Body="&lt;p&gt;When performing a tracking error optimization, you will obtain the same result by using the tracking error squared, which is just the variance of the relative portfolio weights. This would be just finding the minimum variance portfolio, but with conditions on the weights. For instance, it would be equivalent to instead set up the variance minimization assuming you have a fixed -100% weight on the benchmark and optimize with the overall sum of weights equal to zero. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a short time horizon, if you can assume that the expected return is approximately zero, then your second formula is equivalent to minimizing the variance. When the time horizon is longer and it is no longer approximately true that the expected return on each asset is zero, then the second formula will not produce the same weights.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2012-10-10T16:42:26.313" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4320" PostTypeId="2" ParentId="4300" CreationDate="2012-10-10T17:49:39.753" Score="5" Body="&lt;p&gt;It doesn't make sense to use option price series data for computing option risk anyway.  Since they are derivatives (i.e. their value is derived from other securities) it is more basic and reasonable to handle the underlying risks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As hinted by John, the risks to an option portfolio are generally considered in the context of inputs to a pricing model (which may be as simple as the &lt;a href=&quot;http://en.wikipedia.org/wiki/Black%E2%80%93Scholes#Black.E2.80.93Scholes_formula&quot;&gt;Black-Scholes formula&lt;/a&gt;).  The most important of these is underlying price, and the second most important is volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When options are short-dated like yours, there is not usually much volatility value left in them.  Therefore the risk could reasonably be captured simply by making sure your risk model considers changes in the option underlying, and repricing options accordingly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you had longer-dated options, you would certainly want some model of volatility surface dynamics linked to stock prices.  That is a far more complex undertaking.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-10-10T17:49:39.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4321" PostTypeId="1" AcceptedAnswerId="4340" CreationDate="2012-10-10T19:20:39.997" Score="6" ViewCount="517" Body="&lt;p&gt;I read an &lt;a href=&quot;http://www.automatedtrader.net/articles/my-machine/50701/the-automated-trader-interview&quot;&gt;interview today with Stephane Coquillaud&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;He talked about this idea of formulating a data set of the G5 currencies as a pentahedron. The obvious benefit is the fact that there is more information contained in the data and you'll no longer be testing on marginal price movements of single pairs but rather on the entire major currency spectrum. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;He mentioned the other benefit of complexifying the data set from a simple 2 dimensional time series to a 5 dimensional cascade of multiple currency pairs is that the complexity itself reduces the tendency of over fitting parameters in back-tests.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone here attempted anything like this? I'm having a hard time wrapping my head around the data structure needed for this pentahedron &quot;message&quot; and how to calculate it from a collection of 2 dimensional currency pair time series. In the past, I've built a relative currency strength indicator that took incremental market returns from currency pairs and adjusted the relative strength of each individual currency component of the pair. For example if EUR/USD goes up 2%, then I add 2% to EUR and subtract 2% from USD and factor in the movement from over 24 pairs. However, I don't think this is quite the same thing. Suggestions and insight are wholly welcome!&lt;/p&gt;&#xA;" OwnerUserId="3038" LastEditorUserId="35" LastEditDate="2012-10-10T20:32:28.287" LastActivityDate="2012-10-15T14:49:01.603" Title="Major FX pairs - Pentahedron Data Structure" Tags="&lt;time-series&gt;&lt;multivariate&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4322" PostTypeId="1" AcceptedAnswerId="4334" CreationDate="2012-10-10T20:40:06.043" Score="5" ViewCount="1490" Body="&lt;p&gt;Let there be $n$ stock symbols.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let each stock symbol have exactly $t$ ticks (with all ticks miraculously aligned.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We are now searching for potential pairs for pair trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A brute-force solution involves looking at all $\frac{n(n-1)}{2}$ pairs and for each pair, doing an $O(t)$ operation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can we get an approximate solution in sub $O(n^2 t)$ time? [I.e. something like fourier transforms for pair trading].&lt;/p&gt;&#xA;" OwnerDisplayName="user2936" LastEditorUserId="1418" LastEditDate="2012-10-12T03:45:56.417" LastActivityDate="2013-08-18T16:32:20.090" Title="Searching for pairs-trading in sub O(n^2 t) time" Tags="&lt;algorithm&gt;&lt;pairs-trading&gt;&lt;correlation-matrix&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4323" PostTypeId="2" ParentId="4322" CreationDate="2012-10-12T01:49:22.490" Score="9" Body="&lt;p&gt;For years, I performed this brute-force search daily on my universe of tradable stocks and futures. It is a waste of time. If your computer discovers that hog futures and MSFT are cointegrated, for example, do you really care? I would never trade that pair. There is no economic connection between hogs and Microsoft, so I must assume that the reported, small p-value merely identifies a spurious cointegration (yes, there is such a &lt;a href=&quot;http://www.lmgtfy.com/?q=spurious%20cointegration&quot;&gt;thing&lt;/a&gt;) and the trade is a loser.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;John, above, gave the right answer: Partition your universe into groups of related stocks that could be sensibly traded in pairs. Check for cointegrated pairs &lt;em&gt;within&lt;/em&gt; each group, and don't bother checking &lt;em&gt;between&lt;/em&gt; groups. After all, if the trade does not make sense, why bother?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And, to address your problem, that will take much less time.&lt;/p&gt;&#xA;" OwnerUserId="37" LastActivityDate="2012-10-12T01:49:22.490" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4324" PostTypeId="1" AcceptedAnswerId="4326" CreationDate="2012-10-13T11:06:17.190" Score="8" ViewCount="2446" Body="&lt;p&gt;I apologize if this is supposed to be obvious, but ... . Libor spot rates are quoted up to a year, beyond that one can use Eurodollar futures to continue to build the curve. Let's say up to 3 years. Beyond that one can ... well that is what I don't know. Google says &quot;benchmark swaps&quot;, but that is the &quot;chicken or egg&quot; problem. Presumbably swap rates can be derived from Libor forward rates and vice versa. But where are they coming from? It can't be Treasuries due to lack of AA credit risk. It can't be corporates. They're not quoted with the BBA (unless I'm wrong). So if you had to trade the first and only swap in the world, where would you get the swap rate for say 5 to 30 years?&lt;/p&gt;&#xA;" OwnerUserId="2685" LastActivityDate="2012-10-14T04:51:58.477" Title="Where do swap rates and/or long-term forward rates come from?" Tags="&lt;swaps&gt;&lt;yield-curve&gt;&lt;libor&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4325" PostTypeId="1" CreationDate="2012-10-13T15:46:21.473" Score="3" ViewCount="296" Body="&lt;p&gt;I'm looking for an online resource to study the usual performance statistics (CAGR, MaxDD, Payoff Ratio, Win/Loss Ratio, etc.) of trading systems, preferably trend-following systems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that &lt;a href=&quot;http://collective2.com/&quot; rel=&quot;nofollow&quot;&gt;Collective2&lt;/a&gt;&#xA; is a great resource for trading systems and their performance statistics...but are there also any other useful websites offering these kind of data?&lt;/p&gt;&#xA;" OwnerDisplayName="user2278" LastEditorDisplayName="user2278" LastEditDate="2012-10-13T19:36:44.760" LastActivityDate="2014-03-05T06:05:33.637" Title="Resources for performance statistics of trading systems" Tags="&lt;resource&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4326" PostTypeId="2" ParentId="4324" CreationDate="2012-10-14T04:51:58.477" Score="7" Body="&lt;p&gt;The short answer is that Libor swap rates come from the market. They represent a series of cashflows in the future whose value is determined by the fixing, which the market participants have their own valuations of.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the actual cash flows are now discounted using a separate funding curve, the swap prices embed both a prediction of future fixings and a measure of counterparty risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Libor no longer represents the actual cost of funding in the market, so Libor instruments involve buying or selling exposure to this Libor fixing index, which is now only correlated to funding costs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are asking for the arbitrage path/replication basket, for which there is only a series of FRAs funded with your funding curve - nothing else will give you the Libor exposure you need in the resulting basket.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Swaps &lt;em&gt;are&lt;/em&gt; the market's medium to long term interest rate instrument.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2012-10-14T04:51:58.477" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4329" PostTypeId="1" AcceptedAnswerId="4332" CreationDate="2012-10-14T13:13:36.697" Score="1" ViewCount="990" Body="&lt;p&gt;In high frequency and low latency trading, decisions are done on the spot by servers colocated in stock exchanges. This implies that those servers have immediate access to the information they need to take decisions right at the stock exchange.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What data feeds do these servers have access to on-site? Is it all provided by the stock exchange? Does everyone receive the same bulk data, or are the feeds customisable? Is there a prevalent delivery system, such as the FIX protocol, for all feeds?&lt;/p&gt;&#xA;" OwnerUserId="3098" LastActivityDate="2013-04-06T22:24:56.437" Title="What information do stock exchange colocated servers have access to?" Tags="&lt;high-frequency&gt;&lt;information&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4330" PostTypeId="2" ParentId="4259" CreationDate="2012-10-14T18:13:22.687" Score="17" Body="&lt;p&gt;Your question is very vague (e.g. what are you trying to measure, and what &quot;tick data&quot; do you have), but I'll give you some pointers:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;In general, when people consider how prices evolve, they will tend to think about things like volatility and correlation dynamics.  So I would start by defining exactly what you want to measure.  The irregularity of time series data is not a problem in itself, except in so far as you are making assumptions in your calculations about things like dispersion in time.  The amount of variation over 1 millisecond will generally be different than over 1 second (and will also vary by asset), so you need to arrange your statistics to account for this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1.1. There is a vast literature on measuring volatility using high-frequency tick data.  Search for papers on realized variance, volatility, and correlation from people like Neil Shepard (&lt;a href=&quot;http://realized.oxford-man.ox.ac.uk&quot;&gt;see his institute&lt;/a&gt;) or &lt;a href=&quot;http://public.econ.duke.edu/~boller/&quot;&gt;Tim Bollerslev&lt;/a&gt;.  One feature of this literature is that it is actually optimal to &lt;em&gt;not use tick-by-tick data&lt;/em&gt; because of what is known as microstructure noise (e.g. bid-ask bounce), and you're generally better making estimates off something like 5-minute data.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1.2 There is also a literature on dealing with unevenly spaced data (see, for instance, papers by Muller and Zumbach).  A recent paper on the subject is &lt;a href=&quot;http://www.eckner.com/papers/ts_alg.pdf&quot;&gt;&quot;Algorithms for Unevenly-Spaced Time Series: Moving Averages and Other Rolling Operators&quot;&lt;/a&gt;.  There is a nice section in &lt;a href=&quot;http://faculty.washington.edu/ezivot/econ589/manual.pdf&quot;&gt;Eric Zivot's book on time series analysis&lt;/a&gt; that covers this (look for irregularly spaced high frequency data or inhomogeneous operators).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Looking at statistics in clock time or trade time is an important distinction.  For instance, the number of quotes or trades can vary dramatically across assets, with illiquid assets only trading a few times a day vs. liquid assets which trade many times each second.  Using trade time to measure things like volatility can partly address this problem (as well as things like the significance of your estimate), although you will need to consider whether there are other clock time effects (such as open or close time seasonalities) even when you work in trade time.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;For tick data, are you working with level 1 (top of the book quotes and trades) or level 2 (full order book) data?  If it's level 2, then you may not only want to consider changes through time, but also across the book.  &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="17" LastEditorUserId="35" LastEditDate="2012-10-14T19:47:34.647" LastActivityDate="2012-10-14T19:47:34.647" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4332" PostTypeId="2" ParentId="4329" CreationDate="2012-10-14T19:54:09.277" Score="4" Body="&lt;p&gt;Servers co-located at exchanges for the purposes of low latency algo trading would primarily listen to the exchange's feeds. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The feeds would generally be disseminated via multicast on a fibre network. Certain exchanges charge a proximity fee based on the length of the fibre to the trading server and others make all the fibre cables equally long. The feeds would generally use a low latency protocol such as ITCH. Obviously if the algo requires certain financial indicators it can fed to the server via external feeds into the co-location space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If multicast feeds are used the feed can be subscribed to on a router / software level at a multicast group level. If the exchange disseminates Level 1 on 1 multicast group and Level 2 on a separate group, you can elect only to receive Level 2. This can also be on a partition level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If TCP is used feeds can be subscribed to on a security level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FIX market feeds are generally never used for low latency trading. Certain exchanges such as the LSE however do provide Level 1 in FIX using FAST. Even though still owned by the NYSE, ITCH is becoming a prevalent standard in exchange level market feed data dissemination. Other feeds such as the FTSE index feed are gravitating toward FIX over FAST.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the private message flow side there is definitely a move towards standardizing the message flow to approximate FIX even if it uses a native protocol for speed. Ie All new exchange trading systems will generally always have a New Order message that results in an Execution report being returned. Look at the JSE just gone live or Eurex system going live in December. Both have native layer that maps very easily to FIX.&lt;/p&gt;&#xA;" OwnerUserId="3103" LastActivityDate="2012-10-14T19:54:09.277" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4333" PostTypeId="1" CreationDate="2012-10-14T20:03:10.873" Score="7" ViewCount="1660" Body="&lt;p&gt;Let's say we have a trading system that trades daily, holding for one day, but uses an indicator that looks back over the last 5 years. A simple example could be the percent change in price of an asset over that 5-year period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There will be a high degree of serial correlation in the indicator values from one day to the next, due to the overlap of the lookback.  Are there standard ways of taking this into account when assessing the performance of a trading system?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuitively, it seems that for a fixed length of backtest data (say 10 years) we should have more certainty of our performance metrics, such as Sharpe, when we have short lookbacks, since then the samples of the indicator distribution are more independent. How do we quantify this? Or is it more of a rule-of-thumb situation?&lt;/p&gt;&#xA;" OwnerUserId="3104" LastEditorUserId="35" LastEditDate="2012-10-14T20:06:17.710" LastActivityDate="2012-10-20T14:36:12.970" Title="Statistical significance of trading systems that use indicators with long lookbacks" Tags="&lt;quant-trading-strategies&gt;&lt;backtesting&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4334" PostTypeId="2" ParentId="4322" CreationDate="2012-10-15T06:58:23.947" Score="8" Body="&lt;p&gt;Theoretically, the answer to the question is yes, a correlation matrix for potential pairs trades can be computed in $O\left((n^2t)^{(\omega+\epsilon)/3}\right)$ time, for any $\epsilon &amp;gt; 0$, where $\omega &amp;lt; 2.38$ is the so-called &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.65.1070&quot;&gt;&lt;b&gt;exponent of matrix multiplication&lt;/b&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, these algorithms have a reputation for having a very large constant factor hidden in the big-O notation, and moreover being extraordinarily difficult to implement and apply in practice.  No comment on state-of-the-art, but apparently people have researched this:&#xA;&lt;a href=&quot;http://ieeexplore.ieee.org/xpl/login.jsp?tp=&amp;amp;arnumber=1434876&amp;amp;isnumber=30915&quot;&gt;http://ieeexplore.ieee.org/xpl/login.jsp?tp=&amp;amp;arnumber=1434876&amp;amp;isnumber=30915&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whether or not it is advisable to trade on a supposed regression to the mean of an ex-post least-squares linear pairwise correlation of tick data is a whole other matter, but I'd assume if your trading algorithm is known and profitable, it's already been pretty well arbitraged away by the &quot;big boys&quot;.&lt;/p&gt;&#xA;" OwnerUserId="3106" LastEditorUserId="3106" LastEditDate="2012-10-15T07:05:20.537" LastActivityDate="2012-10-15T07:05:20.537" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4336" PostTypeId="1" AcceptedAnswerId="4341" CreationDate="2012-10-15T10:38:33.657" Score="8" ViewCount="2453" Body="&lt;p&gt;I am working in the area of building credit risk models. Upto this point, the model I have been focused on using the Asymptotic Single Factor Model, more popularly known as Vasicek Single Factor Model. The single factor being representative of the state of the economy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I want to evaluate a more elaborate multiple factor model as used in KMV etc. I am looking specifically for guidance on the following &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Are their any fundamental papers/references on multi factor credit risk models (A very popular one seems to be one by Michael Pykhtin available &lt;a href=&quot;http://www.ressources-actuarielles.net/ext/isfa/1226.nsf/9c8e3fd4d8874d60c1257052003eced6/e9c944cf9ab30ac9c12577b4001e0342/%24FILE/Pykhtin-Multi-fractor%20adjustment.pdf&quot;&gt;here&lt;/a&gt; And also one by algorithmics available &lt;a href=&quot;http://www.algorithmics.com/EN/media/pdfs/Algo-RA0302-ARQ-CreditRiskModelling.pdf&quot;&gt;here&lt;/a&gt;.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What should the multiple factors be - geographical location/industry/sector etc.?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What would be the expected benefit of multiple factors over a single factor model? Would the Expected Loss, Unexpected Loss and ECAP be expected to be lower/higher compared to a single factor model?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Looking for academicians, industry practitioners, modeling experts for any guidance.&#xA;Thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="2504" LastEditorUserId="35" LastEditDate="2012-10-15T11:07:07.450" LastActivityDate="2014-03-04T11:12:46.113" Title="Multi Factor Credit Risk Models" Tags="&lt;risk-models&gt;&lt;factor-models&gt;&lt;credit&gt;" AnswerCount="4" CommentCount="3" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4337" PostTypeId="1" CreationDate="2012-10-15T13:04:22.647" Score="4" ViewCount="2262" Body="&lt;p&gt;The requirement I am given is to implement a web ppplication which utilizes Interactive Brokers's API to fetch data. I went through the IB API web page and came across two viable methods: TWS and IB Gateway. But both method require proprietary executables to be running. This doesn't make sense from a web perspective as my hosting provider will not allow to run an executable on their infrastructure. Is it not possible to just access their API using Username/Password or some API Key or something similar from a Web Server?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it's not possible could you please share what other companies (like IB) have web friendly APIs.&lt;/p&gt;&#xA;" OwnerUserId="3108" LastActivityDate="2019-01-06T12:49:00.107" Title="Does Interactive Brokers (IB) have a Web friendly API?" Tags="&lt;trading&gt;&lt;automated-trading&gt;&lt;trading-systems&gt;&lt;interactive-brokers&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4338" PostTypeId="1" CreationDate="2012-10-15T13:56:41.307" Score="2" ViewCount="531" Body="&lt;p&gt;My portfolio comprises of 3 assets A,B,C that are correlated and the variance-covariance structure is known. At any given point in time, my position in Asset A say is given to me. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need to construct a variance minimizing hedge using both B and C, given this position in A.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically I am approaching the problem by directly constructing the Variance, as a function of say x and y, the positions in B and C, and minimizing the function by setting the partials w.r.t x and y to 0. This gives me 2 equations in x and y and I can solve them for x and y.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is that, is this approach sound? What notion of risk is this really minimizing? I did not explicitly construct a risk model here?&lt;/p&gt;&#xA;" OwnerUserId="3109" LastActivityDate="2012-10-15T14:30:35.590" Title="Minimum variance hedge with more than one asset" Tags="&lt;portfolio-management&gt;&lt;variance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4339" PostTypeId="2" ParentId="4338" CreationDate="2012-10-15T14:30:35.590" Score="2" Body="&lt;p&gt;If the variances are known to be $\sigma_0$, $\sigma_1$ and $\sigma_2$ and the correlations are $\rho_{01}$, $\rho_{02}$ and $\rho_{12}$ then you can do exactly as you suggest - write down the variance of the total portfolio as a function of your holdings $x_0$, $x_1$ and $x_2$ and set the partial derivatives with respect to $x_1$ and $x_2$ to zero. You end up with the following matrix equation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\left[&#xA;\begin{matrix}&#xA;\sigma_1^2 &amp;amp;&amp;amp; \rho_{12}\sigma_1\sigma_2 \\&#xA;\rho_{12}\sigma_1\sigma_2 &amp;amp;&amp;amp; \sigma_2^2&#xA;\end{matrix}&#xA;\right]&#xA;\left[&#xA;\begin{matrix}&#xA;x_1\\x_2&#xA;\end{matrix}&#xA;\right]&#xA;=&#xA;\left[&#xA;\begin{matrix}&#xA;\rho_{01}\sigma_1 \\&#xA;\rho_{o2}\sigma_2&#xA;\end{matrix}&#xA;\right] \sigma_0 x_0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which you can solve by inverting the matrix, as long as $\rho_{12}\neq \pm 1$ (ie your hedging assets aren't perfectly correlated or anticorrelated).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to whether this is sound - well, it depends what you mean by &quot;sound&quot;. You are minimizing the total variance of your portfolio, conditional on you knowing the covariance matrix. That's about all you can say. Your &quot;risk model&quot; is a single dimension - you are saying that the only notion of risk that you care about is the total variance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A full risk evaluation would need a procedure for determining the covariance matrix, and some level of backtesting to determine if your forecast risk after the hedge is a reflection of the true risk you would see if you were to hold this portfolio.&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2012-10-15T14:30:35.590" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4340" PostTypeId="2" ParentId="4321" CreationDate="2012-10-15T14:49:01.603" Score="4" Body="&lt;p&gt;Since pentahedrons are 3d shapes, but there is no reason to think currencies live in a 3d world, you can just treat the 'pentahedron' as a weighted node graph of the 5 currencies. A graph edge from one currency to another represents an exchange of those two currencies. So in the same fashion as usual vectors, I can go from currency A to C via B by executing AC,CB. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we also know some cross-currency prices for AC, we can construct a triangle ABC where we know the price of each edge. In geometry, we get the hypotenuse from the sides via Pythagoras, but the price of AC = AB/BC (or multiplied, depending on the quoting). So you need to do some translation to get from cross currency pricing to the geometry/topology of the graph, but the basic idea is there; if you update the price for a particular trade, that alters the graph in ways that imply changes to other prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the nub of the problem, though, is to know how 'stiff' the edges are. For example, suppose EUR/DKK is liquid, EUR/TRY less so, and DKK/TRY much less so; so seeing a change in EUR/TRY probably means that TRY is moving, not EUR, so you expect DKK/TRY to change rather than EUR/DKK. Do you pin USD and EUR in space, and let the rest of the geometry move around them?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can probably perform some kind of dimensional reduction like PCA on the 5d structure to see the main axes of variance, but since none of the currencies is entirely dependent on the others, there will always be extra factors that prevent you eliminating any dimensions entirely; every government and domestic market is a source of information, and thus an unpredictable input into the currency's martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ultimately, it's about what you want to measure. If you have a reason to pick out a specific weighted basket of currencies, then you can just price that basket to see movements. In finance there are no absolutes, only relative values. So you have to have a reason to look at a particular basket; there is no independent view of the market, and neither do you need one.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2012-10-15T14:49:01.603" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4341" PostTypeId="2" ParentId="4336" CreationDate="2012-10-16T13:32:35.473" Score="4" Body="&lt;p&gt;Most of the credit risk models are some derivative of survival models.  &lt;a href=&quot;http://en.wikipedia.org/wiki/Proportional_hazards_models&quot; rel=&quot;nofollow&quot;&gt;Cox Proportional Hazard&lt;/a&gt; is one of the early and more popular models,  &lt;a href=&quot;http://en.wikipedia.org/wiki/Kaplan%E2%80%93Meier_estimator&quot; rel=&quot;nofollow&quot;&gt;Kaplan-Meier&lt;/a&gt; and Logrank tests are others you may have heard of.  There are a few ways to go from here.  The simplest is to model the sample as binomial with one population as current and the other as in default.  A more complex method would be along the lines of an actuarial approach that takes levels of ability to pay into account.  A good analogy is levels of sickness to predict potential insurance payouts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for what factors used to model, I can't make any suggestions unless I know exactly what asset it is your modeling and what kind of data you have access to - consumer loans is a rather broad description.  I'm assuming you're dealing with some type of ABS.  If so, then ultimately all you care about is ability to make coupon payments.  Credit scores, MSA employment, HPI, LTV, etc. could be of interest - but without more info I can't help much past that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The goal of a multiple factor model is similar to a single factor, you're just trying to build more confidence in your prediction by explaining more of the variance. Strive for parsimony and don't blindly build on correlations.&lt;/p&gt;&#xA;" OwnerUserId="2732" LastActivityDate="2012-10-16T13:32:35.473" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4342" PostTypeId="2" ParentId="4337" CreationDate="2012-10-16T14:32:07.423" Score="2" Body="&lt;p&gt;&lt;strong&gt;Don't try to capture LIVE tick data using a WebApp.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not saying it can't be done, I'm just saying you would get &lt;strong&gt;zero benefits&lt;/strong&gt; and you would have to work way harder to make it functional. Web servers are designed with a premise, serve the user the requested data as fast as possible and free that resource up. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;You would have to fight the server logic (as it is not designed to run that way)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You would have to fight your provider (as it may interpret the server as crashed and close it)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;In order to capture tick-data using IB use Java and look into VPS&lt;/strong&gt; (virtual private servers) where you are allowed to run whatever process you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Over the last 4 years I've been using the following companies for several long-polling apps (both finance and non-finance related) with great success.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.linode.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;linode&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.slicehost.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;slicehost&lt;/a&gt; &amp;amp;&amp;amp; &lt;a href=&quot;http://www.rackspace.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;rackspace&lt;/a&gt; (slicehost will be absorved by rackspace)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You can even run X on these headless systems (and you will need X to run Interactive Brokers API - both on the TWS version and on the Gateway one).&lt;/p&gt;&#xA;" OwnerUserId="1731" LastEditorUserId="16717" LastEditDate="2019-01-06T12:49:00.107" LastActivityDate="2019-01-06T12:49:00.107" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="4343" PostTypeId="2" ParentId="4266" CreationDate="2012-10-16T18:17:54.247" Score="6" Body="&lt;p&gt;&lt;strong&gt;Dividends are the key.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For simplicity, let's include a single dividend at the time of expiration, and assume that the options are European and expire ex.  (There is really no reason not to assume that an option on a market index is European. &lt;strong&gt;EDIT:&lt;/strong&gt; not quite true; that's discussed &lt;a href=&quot;https://quant.stackexchange.com/questions/2365/what-changes-to-put-call-parity-are-necessary-when-evaluating-american-options-o&quot;&gt;&lt;strong&gt;here&lt;/strong&gt;&lt;/a&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S+P = e^{-rt}K+C + e^{-rt}D$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a certain fixed dividend, but that is not material to our purposes.  Whether or not the dividend is subject to market risk and to what degree, or whether or not the dividend is correlated with a change in price of the underlying, it doesn't matter, because in any event, the present value of dividend(s), or what the market expects it to be, has absolutely nothing to do with the strike price of an option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;All is not lost:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$e^{-rt} = \dfrac{S+P-C}{K+D}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take your spreadsheet, and solve for a fixed $D$ that makes that line flat.  Then you will have $e^{-rt}&amp;lt;1$ as expected, and $e^{-rt}D$ is the present value the market places on underlying dividends from now to expiration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT #2&lt;/strong&gt; alternate way to work this out:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S+P_1 = e^{-rt}K_1+C_1 + e^{-rt}D; \\ S+P_2 = e^{-rt}K_2+C_2 + e^{-rt}D.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Subtract the first equation from the second:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P_2-P_1 = e^{-rt}(K_2-K_1) + C_2 - C_1.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rearranging terms&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C_1-C_2+P_2-P_1 = e^{-rt}(K_2-K_1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;we have created a &lt;strong&gt;synthetic bond&lt;/strong&gt; from options at two different strikes which has an unambiguous interest rate because the value of any underlying dividends has cancelled out.&lt;/p&gt;&#xA;" OwnerUserId="3106" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2012-10-29T19:49:52.080" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4344" PostTypeId="1" AcceptedAnswerId="4346" CreationDate="2012-10-16T21:39:08.160" Score="1" ViewCount="821" Body="&lt;p&gt;A simple and lazy approach to implementing an order and position management (OPM) component  in a (semi-)automated trading system: leave most OPM to counter party (broker/exchange). Even then funds and positions need to be checked once orders are supposed to be dispatched. Else it is unkown whether one has funds or already the intended position in a symbol.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Certainly such requests/responses do not fit ultra high frequency trading (uhft), or are optimistic approaches with respect to order execution used? If not, &lt;strong&gt;what is the uhft OPM [software] design approach?&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;Is the lazy approach good enough for lower frequency trading? Or are &lt;strong&gt;other [software] design patterns favorable? Which and why?&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Although the title &lt;a href=&quot;https://quant.stackexchange.com/questions/492/what-approaches-are-there-to-order-handling-in-automated-trading&quot;&gt;What approaches are there to order handling in automated trading?&lt;/a&gt; is promising, answers were geared towards a specific difficulty. &lt;a href=&quot;https://quant.stackexchange.com/questions/1725/references-for-developing-an-automated-trading-system&quot;&gt;The references for developing an automated trading system&lt;/a&gt; do not discuss OPM in detail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A refined OPM component should reflect almost all account details (funds, transmitted orders, fills) reliably. I believe software design patterns of banking/exchange platforms should apply. &lt;strong&gt;References for reliable messaging/databases accessible to the non-expert developer would be nice.&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="2284" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2012-10-20T14:50:53.637" Title="Order and position management in (semi-)automated trading system" Tags="&lt;order&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4346" PostTypeId="2" ParentId="4344" CreationDate="2012-10-16T23:55:38.130" Score="4" Body="&lt;p&gt;Regardless of frequency, every firm should track its own fills to ensure that the exchange's &lt;em&gt;drop copy&lt;/em&gt; is accurate. Now it is true that the positions can be stored in a simple database for later retrieval if real-time execution isn't a goal. But it is extremely dangerous (and fiduciary irresponsible) to just &quot;take the counter-party's word for it&quot;.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2012-10-16T23:55:38.130" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4347" PostTypeId="1" CreationDate="2012-10-17T12:55:41.710" Score="12" ViewCount="3051" Body="&lt;p&gt;I am trying to price an option using the Monte Carlo method, and I have the price process simulations as an inputs. The underlying is a forward contract, so at all times the mean of the simulations is current forward price (also the starting point of the simulations). There is no drift. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, these simulations are calibrated on market data and exhibit i.e. mean reversion and other best estimates of market behavior. So even though they have zero drift, I believe they are not risk neutral and cannot be used in Monte Carlo valuation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there any way how to convert arbitrary market simulations (in market measure) to risk neutral measure?&lt;/strong&gt; Without knowledge of the SDE that generated them, since it may have been SDE with some further arbitrary postprocessing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason I believe I cannot use them directly, is that some simulations (particularly simulations of commodity spreads) exhibit mean reverting properties, just like in real market. This means, that the variance of terminal prices for larger times does not rise linearly, but slows down or even approaches a constant. This lowers the option price in comparison to standard GBM model. But for a process with similar properties, i.e. Ohrenstein-Uhlenbeck, the option price rises with the mean reversion speed (claimed by &lt;a href=&quot;http://web.mit.edu/wangj/www/pap/LoWang95.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://web.mit.edu/wangj/www/pap/LoWang95.pdf&lt;/a&gt;), which is just the opposite effect. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that I am missing something obvious, because everywhere the Monte Carlo method is promoted as a best method for valuating the options on very complex price processes, but it seems that these cannot be completely arbitrary (have to be risk-neutral) and I haven't found any source on how to verify and/or ensure this.&lt;/p&gt;&#xA;" OwnerUserId="3120" LastEditorUserId="467" LastEditDate="2014-07-01T15:11:02.960" LastActivityDate="2014-07-01T15:11:02.960" Title="How to transform process to risk-neutral measure for Monte Carlo option pricing?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;risk-neutral-measure&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="4348" PostTypeId="2" ParentId="4347" CreationDate="2012-10-17T14:17:54.283" Score="5" Body="&lt;p&gt;The use of risk-neutral measure is based on the ability to arbitrage away the instantaneous risk of contingent claims.  Although for forward contracts the hedge quantity is 1.0, in the general contingent claims case we must assume it varies instantaneously with the market state.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://en.wikipedia.org/wiki/Girsanov_theorem&quot;&gt;Girsanov Theorem&lt;/a&gt; tells us what the difference is, instantaneously, between real-world &quot;market measure&quot; (of which your historical paths are realizations) and risk-neutral measure suitable for pricing contingent claims.  The difference comes in the form of a drift adjustment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the adjustment is market state dependent, it is inappropriate to simply multiply all your path values by the same constant in order to achieve any particular terminal distribution.  Instead, you need to have a way of adjusting instantaneously.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, I believe you have two choices:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Work with some model, e.g. a &lt;a href=&quot;http://www.ederman.com/new/docs/smile-lecture8.pdf&quot;&gt;local volatility model&lt;/a&gt;, with the local vols calibrated to agree with local vols observed on your paths&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rfs.oxfordjournals.org/content/14/1/113.abstract&quot;&gt;Group your paths&lt;/a&gt; to represent the universe of possible outcomes as a discrete distribution.  You can then discretize the Girsanov theorem drift adjustment by the local variance, and modify their drift accordingly.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-10-17T14:17:54.283" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4349" PostTypeId="1" CreationDate="2012-10-17T18:15:59.040" Score="5" ViewCount="2803" Body="&lt;p&gt;How do you construct something that lets you buy &quot;vol of vol&quot;? not necessarily for VIX, but any particular stock or index.&lt;/p&gt;&#xA;" OwnerUserId="2893" LastEditorUserId="2893" LastEditDate="2012-10-17T19:14:20.263" LastActivityDate="2015-05-21T02:56:13.760" Title="Construction of &quot;vol of vol&quot;" Tags="&lt;volatility&gt;" AnswerCount="5" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4350" PostTypeId="2" ParentId="4349" CreationDate="2012-10-17T19:26:02.423" Score="3" Body="&lt;p&gt;It depends on whether the second term in &quot;vol of vol&quot; refers to realized or implied. If realized, I don't know. If implied, you could &quot;DIY it&quot; by buying straddles on a volatility product and hedging deltas with the underlying futures. There are options on VIX, GVZ (gold), OVX (oil) and the other CFE futures although only the VIX options are active.&lt;/p&gt;&#xA;" OwnerUserId="2378" LastActivityDate="2012-10-17T19:26:02.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4351" PostTypeId="2" ParentId="4347" CreationDate="2012-10-17T20:08:33.430" Score="1" Body="&lt;p&gt;You don't have to believe anything. The simulations are risk-neutral if the expectation at any date divided by the spot price is the return of a risk free zero-coupon bond. That's everything (the only exception being the dividend paying stocks where you have to subtract the dividends in the period.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another issue is if you want to model other features such as mean reversion, stochastic volatility, stacionality, etc. but that does not has anything to do with the pricing measure, only with the model SDE. As long as the expected return is risk-free at every time $T&amp;gt;0$ you are in the risk neutral world.&lt;/p&gt;&#xA;" OwnerUserId="1704" LastActivityDate="2012-10-17T20:08:33.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4352" PostTypeId="2" ParentId="4349" CreationDate="2012-10-17T20:14:38.150" Score="0" Body="&lt;p&gt;There are really only a few ways to trade vol of vol even in the index space. In the implied space, you can trade options on VIX. In the realized space, you can trade options on realized variance (illiquid these days) or trade var&gt;vol spreads.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, vol of implied vol in equities is linked to the slope of the skew, so going long or short risk reversals is a proxy.   &lt;/p&gt;&#xA;" OwnerUserId="2906" LastActivityDate="2012-10-17T20:14:38.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4353" PostTypeId="1" CreationDate="2012-10-18T03:34:10.487" Score="3" ViewCount="1159" Body="&lt;p&gt;This should be a basic question but I have not been able to find a satisfying explanation. In the simplest binomial model, the risk neutral probability is computed using the up/down magnitude and the risk-free rate. But why is the risk neutral probability simply &quot;assumed&quot; to be 0.5 in the context of short rate models?&lt;/p&gt;&#xA;" OwnerDisplayName="user2163" LastEditorDisplayName="user2163" LastEditDate="2012-10-18T15:53:33.400" LastActivityDate="2012-10-18T16:11:37.900" Title="Risk neutral probability in binomial short rate model assumed to be 0.5?" Tags="&lt;binomial-tree&gt;&lt;risk-neutral-measure&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4354" PostTypeId="2" ParentId="3778" CreationDate="2012-10-18T07:54:33.840" Score="0" Body="&lt;p&gt;There are lots of automated trading system in forex like:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;EA Shark 7.0&lt;/li&gt;&#xA;&lt;li&gt;EA Sigma 4.0&lt;/li&gt;&#xA;&lt;li&gt;FX Pulse 1.0&lt;/li&gt;&#xA;&lt;li&gt;ProFx 2.0.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="3126" LastEditorUserId="467" LastEditDate="2012-11-12T23:07:35.753" LastActivityDate="2012-11-12T23:07:35.753" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4355" PostTypeId="2" ParentId="1746" CreationDate="2012-10-18T08:09:00.593" Score="0" Body="&lt;p&gt;Calculating standard deviation is a little bit complex. Standard deviation is used for prediction from past data. For calculating it firstly calculate mean of group of data, than subtract mean from each data, take square of each result and create sum, than divide this by the total number of data minus one. The sum of all the squared differences is then divided this by number less than total data. The square root of this number is called standard deviation.&lt;/p&gt;&#xA;" OwnerUserId="3126" LastEditorUserId="35" LastEditDate="2012-10-18T11:10:35.193" LastActivityDate="2012-10-18T11:10:35.193" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4357" PostTypeId="2" ParentId="3848" CreationDate="2012-10-18T15:10:47.623" Score="2" Body="&lt;p&gt;There are few surveys atm as people are still relatively secretive about it because of the various challenges a production system poses. Actually a major bank even backstepped after some initial efforts. So there is now quite some activity in the field but not so much as the initial hype suggested. You can also try asking in the dedicated Linkedin group.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I could give you various additional references on specific applications if you want to get an idea of the field anyway.&lt;/p&gt;&#xA;" OwnerUserId="3015" LastEditorUserId="3015" LastEditDate="2012-10-18T15:48:34.783" LastActivityDate="2012-10-18T15:48:34.783" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4358" PostTypeId="2" ParentId="4353" CreationDate="2012-10-18T15:54:46.703" Score="2" Body="&lt;p&gt;I'll take a stab.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short rate modelling we start by postulating dynamics under pricing measure $Q$ and then calibrating our model to market prices. General short rate dynamics under $Q$ can be described as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dr(t)=b(t_0+t,r(t))dt+\sigma(t_0+t,r(t))dW(t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;, where $W$ is $Q$ Brownian motion. Note that the short rate process itself is not a $Q$-martingale (short rate is not a traded asset). However, all contingent claims can be priced by taking $Q$-expectations of their discounted payoffs with respect to the short rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When we approximate this model with binomial tree, we don't need to find probabilities as we have already specified the $Q$-dynamics. We discretize Brownian motion increment $dW(t)$ which is symmetrically distributed around 0. Therefore, we use 0.5 as a probability in the binomial tree. Then all we need is to set nodes values that we match the drift $b$ and volatility $\sigma$ of $r(t)$. This approach is illustrated in the book &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0943205530&quot; rel=&quot;nofollow&quot;&gt;&quot;Term-Structure Models Using Binomial Trees&quot;&lt;/a&gt; by Gerald W. Buetow Jr  and James Sochacki. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this there is another approach when you assign probabilities in your binomial model to match continuous prices process. See a book &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0691118949&quot; rel=&quot;nofollow&quot;&gt;&quot;Interest Rate Models: An Introduction&quot;&lt;/a&gt; by Andrew J. G. Cairns, Chapter 10.2.3, page 163. There he fixes the increment and varies the probabilities. &lt;/p&gt;&#xA;" OwnerUserId="370" LastEditorUserId="370" LastEditDate="2012-10-18T16:11:37.900" LastActivityDate="2012-10-18T16:11:37.900" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4359" PostTypeId="2" ParentId="4329" CreationDate="2012-10-18T16:27:34.080" Score="1" Body="&lt;p&gt;According to &lt;a href=&quot;https://www.youtube.com/watch?feature=player_embedded&amp;amp;v=pNUfvhMV-Co#!&quot; rel=&quot;nofollow&quot;&gt;this video&lt;/a&gt; there are basically four kinds of messages available in the feeds:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Order is added to the book&lt;/li&gt;&#xA;&lt;li&gt;Order is removed from the book&lt;/li&gt;&#xA;&lt;li&gt;Execution of an order displayed in the book&lt;/li&gt;&#xA;&lt;li&gt;Execution of an order not displayed in the book&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The speaker goes on to say that these messages are sufficient to reconstruct the publicly available market information.&lt;/p&gt;&#xA;" OwnerUserId="3098" LastActivityDate="2012-10-18T16:27:34.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4360" PostTypeId="2" ParentId="4123" CreationDate="2012-10-19T14:04:36.457" Score="1" Body="&lt;p&gt;Are you talking about forecast performace?&#xA;You should do a number of back tests on the intervals shifted by 1-2 weeks (or days, depends on trading frequensy you use) and collect the average of all &quot;back test vs market&quot; results.&#xA;NetProfit, WinTrade percent  and any other statistics could be used as a performance metrics.&lt;/p&gt;&#xA;" OwnerUserId="2246" LastActivityDate="2012-10-19T14:04:36.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4361" PostTypeId="1" CreationDate="2012-10-19T16:08:02.760" Score="1" ViewCount="1380" Body="&lt;p&gt;What open source or commercial .NET statistical package would you guys recommend? I am doing statistical arbitrage in options. The functions I need mainly are regressions, optimizations..etc. It would be better if the package has some built-in functions specifically for options, but it's fine if it doesn't. Quality, speed, easy-to-do of statistical analysis, good compatibility with C++/C# are my priorities.     &lt;/p&gt;&#xA;" OwnerUserId="3131" LastActivityDate="2012-10-20T15:04:58.067" Title=".NET statistical packages recommendation" Tags="&lt;trading&gt;&lt;statistics&gt;&lt;arbitrage&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4362" PostTypeId="2" ParentId="4361" CreationDate="2012-10-19T20:02:48.307" Score="0" Body="&lt;p&gt;Python is really a good idea. You could even optimize it with PyPy for better performance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://abel.ee.ucla.edu/cvxopt/index.html&quot; rel=&quot;nofollow&quot;&gt;Python Software for Convex Optimization&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://morepypy.blogspot.com.br/2011/02/pypy-faster-than-c-on-carefully-crafted.html?spref=tw&quot; rel=&quot;nofollow&quot;&gt;PyPy Status Blog&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://image.diku.dk/shark/sphinx_pages/build/html/rest_sources/tutorials/tutorials.html&quot; rel=&quot;nofollow&quot;&gt;But if you really like C++ try this&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it is just my opinion.&lt;/p&gt;&#xA;" OwnerUserId="1360" LastEditorUserId="35" LastEditDate="2012-10-19T20:06:23.927" LastActivityDate="2012-10-19T20:06:23.927" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4363" PostTypeId="2" ParentId="4316" CreationDate="2012-10-20T04:58:59.077" Score="1" Body="&lt;p&gt;It is better to use a factor model, if one is available. Are you asking this question because you don't have access to one?   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, what is the nature of the asset you want to track? Is it an index or a single security? What asset class? What risk factors is it exposed to (e.g. interest rate and credit risk vs. stock market volatility and other equity factors)? The answer to your question depends on what you are tracking.&lt;/p&gt;&#xA;" OwnerUserId="3011" LastEditorUserId="3011" LastEditDate="2012-10-20T05:05:28.150" LastActivityDate="2012-10-20T05:05:28.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4364" PostTypeId="1" AcceptedAnswerId="4372" CreationDate="2012-10-20T07:39:11.593" Score="5" ViewCount="1265" Body="&lt;p&gt;For a Long/Short Strategy, I have two stocks with different volatilities. How can I calculate the right position size for each leg?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;*&lt;em&gt;The pair trading is not coming from co-integration but more as a hedge (protection)&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="1463" LastEditorDisplayName="user3137" LastEditDate="2012-10-21T21:03:21.470" LastActivityDate="2012-10-22T23:03:13.747" Title="Calculating the right portfolio(position size for each leg) in a Long/Short Strategy" Tags="&lt;portfolio-management&gt;&lt;portfolio&gt;&lt;pairs-trading&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4365" PostTypeId="2" ParentId="4336" CreationDate="2012-10-20T13:05:40.843" Score="1" Body="&lt;p&gt;For corporate credit portfolios, sector, rating, and maturity are the usual suspects that go into the credit portion of risk model structure, which usually also have interest rates and liquidity pieces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0471332119&quot; rel=&quot;nofollow&quot;&gt;book&lt;/a&gt; is slightly outdated but will give you a good general introduction.&lt;/p&gt;&#xA;" OwnerUserId="3134" LastEditorUserId="35" LastEditDate="2012-10-20T14:00:12.070" LastActivityDate="2012-10-20T14:00:12.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4366" PostTypeId="2" ParentId="4364" CreationDate="2012-10-20T14:06:53.183" Score="0" Body="&lt;p&gt;Assuming you have the &lt;em&gt;beta&lt;/em&gt; of the hedging asset to the original asset, then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mbox{amount}_{hedge} = - \beta \times \mbox{amount}_{original}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As long as the relative volatility between the two assets is constant, then the beta should do the trick.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2012-10-20T14:06:53.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4367" PostTypeId="2" ParentId="4333" CreationDate="2012-10-20T14:36:12.970" Score="2" Body="&lt;p&gt;Running a look back of 5 years on a daily system equates to about 1260 look back points which seems awfully large. Obviously you will encounter serial correlation between indicator values when moving from one data point to the next. I highly recommend lowering the amount of data points that go into your indicator calculations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A trading system has to first and foremost make intuitive sense before you perform any quantitative analysis. You also do not look back 50 days when looking to generate indicators for an intra day trading strategy. This has nothing to do with serial correlation yet or how you can quantify the optimal look back parameter. It has to do with your having to really understand what you actually try to measure and which dynamics you try to capture and how relevant the data points in the past are and how you want to weigh the different data points (because obviously the importance of the most recent data points is higher than older data points).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You seem to confuse the relationship of the amount of historical data over which you like to back test and its impact on your predictive power and rigor of analyzing a given strategy with the actual amount of data you utilize to calculate a single indicator data point. They are unrelated, completely unrelated from each other. I recommend you really attempt to segregate each concept and treat them entirely different. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) The amount of data available to back test will need to be sufficient in order to give you the confidence that you tested the strategy over sufficiently different market cycles and market internals, in order to arrive at a better prediction of future performance as a function of past performance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) The amount of data point you utilize in the computation of an indicator point has a direct bearing on the performance and quality of your indicator signal and has nothing to do with the the relationship between a historical back test and its predictive power on future performance. This is an issue of optimization which in itself comes with a host of pitfalls that you need to pay attention to. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Only after a clear distinction between the two concepts do I recommend you to proceed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my 2 cents from years of strategy development from anything mid-frequency to high frequency. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-10-20T14:36:12.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4368" PostTypeId="2" ParentId="4337" CreationDate="2012-10-20T14:43:37.173" Score="0" Body="&lt;p&gt;I second parts of Frankie's answer here but for a different reason and with additional caveats:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First yes, do not run a process that does not serve content you already provide as a web application. The point of a web app is to simply make content available on a standardized medium for &lt;strong&gt;distribution purposes and not for computational or data gathering purposes&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have seen people implementing a whole strategy testing and trading platform on a web app, which imho makes zero sense. Its a very inefficient and prone to error process. The point is that if a single of your computations goes down it essentially renders the whole web app useless. The correct way to run this is to gather your data through the API on a server or local machine (whatever you prefer) and to then offer the gathered data (raw or cleaned or otherwise processed) to users through a web application. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You actually answered the question yourself, you often need other processes that run in order to gather the data you inquire and you don't want to have to mess with this on a web app and or even worse force the user of the web app to run other processes just in order to make it work. Gather the data on a machine, process the data, make the data available through a web server and use the web app as interface. Simple as that. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-10-20T14:43:37.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4369" PostTypeId="2" ParentId="4344" CreationDate="2012-10-20T14:50:53.637" Score="1" Body="&lt;p&gt;1) The uhf/hf approach is to run dedicated order management modules, position managers, and risk checks in dedicated processes in-house and NEVER rely for any of this on outside applications. For uhf some or all of those processes may run on hardware chips, but most on the hf side and lower frequency side runs within software modules that are dedicated to only manage orders, only manage risk, only manage positions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) No, its not enough. Example: You submit an order, you get the acknowledgement of the receipt of the order and then your app or connection to the broker goes down. Fact is that you have submitted an order and fact is that your broker received the order and confirmed it. You must account for that submitted order yourself before your app reconnects or before you get any fill confirmation at a later point. Just one of the many tons of issues that may go wrong or occur and which may be completely outside of your control. Even if everything goes as planned its standard practice to run your own OMS and other components and to frequently sync it with what your execution partners show. If there is a misalignment then something is wrong and thats exactly what you want, the knowledge of something being wrong. Or would you like to continuously shoot orders into the market and get filled in size that you never anticipated just because your broker does not send you fills for whatever reason? &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-10-20T14:50:53.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4370" PostTypeId="2" ParentId="4361" CreationDate="2012-10-20T15:04:58.067" Score="4" Body="&lt;p&gt;Not sure why Python is recommended when you clearly ask for a .Net solution (well you may look at IronPython but I do not recommend it given there are much better options, see below), aside the fact that Python is horribly slow even when performing non-mission-critical data analysis and research. Even C# easily runs circles around most python scripts, given your coding skills are average or better. I understand its the language of choice aside Matlab and R by most quants, mostly because they have a standardized approach in terms of access to data sets, and anyway the language is most often dictated by the trading desk or head quant which means its not necessarily the most optimal choice. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would recommend you to look at the following for managed C# or otherwise C++ implementation. You can run both in .Net and if not directly you could wrap C++ code in order to have access through a library (following is not in the order of significance):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.boost.org/&quot;&gt;http://www.boost.org/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://root.cern.ch/drupal/&quot;&gt;http://root.cern.ch/drupal/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.mathdotnet.com/&quot;&gt;http://www.mathdotnet.com/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://rtmath.net/products/finmath/&quot;&gt;https://rtmath.net/products/finmath/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.alglib.net/&quot;&gt;http://www.alglib.net/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And here you get another host of packages:&#xA;&lt;a href=&quot;http://en.wikipedia.org/wiki/List_of_numerical_libraries#C.2B.2B&quot;&gt;http://en.wikipedia.org/wiki/List_of_numerical_libraries#C.2B.2B&lt;/a&gt; (not all come with statistical tools and may focus on math, but I included the link as its a comprehensive source of packages)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also directly link to Matlab or R out of .Net but again I would argue it will be at the expense of speed given how you implement the link. A raw library will always serve you the best in terms of performance given it offers the algorithms you look for. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good luck. Hope this helps. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-10-20T15:04:58.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4371" PostTypeId="1" CreationDate="2012-10-20T15:17:44.587" Score="10" ViewCount="548" Body="&lt;p&gt;I'm going to write the MSc thesis on flight-to-liquidity phenomenon in stock markets and I'm interested in liquidity measures other than &lt;a href=&quot;http://www.google.nl/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;ved=0CCEQFjAA&amp;amp;url=http://www.cis.upenn.edu/~mkearns/finread/amihud.pdf&amp;amp;ei=7Q6EUKbKO8TJ0QXN5IGgBA&amp;amp;usg=AFQjCNFhjmVoFIT-CsRtnRIOjquQwlqhOg&quot;&gt;Amihud&lt;/a&gt; or bid-ask spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are some other popular measures of liquidity?&lt;/p&gt;&#xA;" OwnerUserId="3135" LastEditorUserId="848" LastEditDate="2012-10-21T15:07:15.373" LastActivityDate="2012-10-21T20:50:57.983" Title="Alternative liquidity measures" Tags="&lt;equities&gt;&lt;market-microstructure&gt;&lt;liquidity&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="4372" PostTypeId="2" ParentId="4364" CreationDate="2012-10-20T15:25:12.707" Score="3" Body="&lt;p&gt;I would concur with Chrisaycock if the volatility between two assets is constant, but because it never is I find there are way better approaches. Generally correlations fly all over the map once things start to become interesting in the market, even for generally highly correlating assets. I would look to generate an algorithm that can determine a range of correlation coefficients within a given standard error at a minimum of xx% of all data points. For example, if your two assets do not correlate within a [0.7..0.8] correlation coefficient range at least 70% of the times (70% of all observations) then you probably deal with a very bad hedging instrument anyway. So, again, as I recommend just pretty much all the time: Before running analyses and tests, think intuitively what you try to achieve. You want to look for a very stable hedge instrument. Obviously all of what I said applies equally to intraday as well as longer frequency data points. No beta in the world will produce the desired/anticipated results if it is not stable, no matter how sophisticated you design your research approach. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly, I would then look to cover the remaining data points and research why correlations broke down during those periods. If you can derive a mathematical relationship you could possibly formulate an approach in which you make adjustments to the hedge ratio through an adjustment in your beta/correlation coefficient. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thirdly, you may want to &quot;re-calibrate&quot; at an optimal frequency in order to updated regime shifts in volatility/correlations. I could write pages about this approach because I have spent a lot of work on optimizing this approach as part of a bigger strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Those are by far not exhaustive nor did I elaborate but I hope it serves as food for thought to actually first make you acknowledge that any assumption that even hints at constant relationships between assets in most markets is utterly flawed. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-10-20T15:25:12.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4373" PostTypeId="2" ParentId="4271" CreationDate="2012-10-20T15:32:15.613" Score="6" Body="&lt;p&gt;a) you can run a Monte Carlo simulation in which you model stock price movements and then you can look at the future pay off as a function of path dependency into which you incorporate your stop losses and take profits. Done this over many iterations you will be able to derive your probabilities. Caveat here is your result will be strongly dependent on your model assumption of how you derive stock price movements. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) you could run back tests over actual pricing data. You generate trading signals, associated stops and take-profit targets and you derive your probabilities through simple counting processes of how often your stop loss was hit vs take profit targets. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would strongly prefer the latter approach, this is by the way a very common way to also calculate the quality of entry and exit signals (not using stop loss and target levels but by keeping track of how prices performed after the entry/after the exit).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. I find the question correctly worded and I think it actually makes sense. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-10-20T15:32:15.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4374" PostTypeId="1" CreationDate="2012-10-21T11:59:49.403" Score="12" ViewCount="11222" Body="&lt;p&gt;Can the Hurst exponent be greater than one? Does it mean that the time series follows a random walk or that it's not stationary?&lt;/p&gt;&#xA;" OwnerUserId="926" LastEditorUserId="35" LastEditDate="2012-10-21T15:29:00.400" LastActivityDate="2015-02-01T18:25:56.617" Title="Can the Hurst exponent be greater than one?" Tags="&lt;statistics&gt;&lt;quantitative&gt;&lt;hurst-exponent&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="4375" PostTypeId="2" ParentId="4371" CreationDate="2012-10-21T20:50:57.983" Score="10" Body="&lt;p&gt;There are several. This list is from Giyenko et al (2008)---in their work they compare all these different measures--- and includes spread proxies and price impact proxies. As for spread proxies:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&quot;Effective Tick&quot; (Holden 2007, Giyenko et al 2008)&lt;/li&gt;&#xA;&lt;li&gt;&quot;Holden measure&quot; (Holden 2007)&lt;/li&gt;&#xA;&lt;li&gt;&quot;LOT Y-split&quot; (Giyenko et al 2008)&lt;/li&gt;&#xA;&lt;li&gt;&quot;Roll measure&quot; (Roll 1984)&lt;/li&gt;&#xA;&lt;li&gt;&quot;Gibbs measure&quot; (Hasbrouck 2004)&lt;/li&gt;&#xA;&lt;li&gt;&quot;LOT mixed&quot; (Lesmond et al 1999)&lt;/li&gt;&#xA;&lt;li&gt;&quot;Zeros&quot; and &quot;Zeroes2&quot; (Lesmond et al 1999)&lt;/li&gt;&#xA;&lt;li&gt;&quot;Amihud measure&quot; (Amihud 2002)&lt;/li&gt;&#xA;&lt;li&gt;&quot;Pastor and Stambaugh&quot; (Pastor and Stambaugh 2003)  &lt;/li&gt;&#xA;&lt;li&gt;Amivest Liquidity Ratio&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Some of these can be interpreted and modified to proxy for price impact. Indeed, any model of price impact is closely linked with liquidity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a Macro and theoretical perspective, Tirole has something good to say (as always)&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Tirole, J. (2011). &lt;em&gt;Illiquidity and all its friends&lt;/em&gt;. Journal of&#xA;  Economic Literature 49(2), 287–325.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If I remember correctly it established a simple link between the common intuition that Repos, leverage ratios, and other borrowing measures bear relevance to the problem of measuring illiquidity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically on flight to quality (theoretical, but with an empirical application):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Brunnermeier, M. and L. Pedersen (2009). &lt;em&gt;Market liquidity and funding&#xA;  liquidity&lt;/em&gt;. Review of Financial Studies 22(6), 2201–2238.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Bonus reading:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Brunnermeier, M. (2009). &lt;em&gt;Deciphering the liquidity and credit crunch&#xA;  2007-2008&lt;/em&gt;. Journal of Economic Perspectives 23(1), 77–100.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1531" LastActivityDate="2012-10-21T20:50:57.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4376" PostTypeId="1" CreationDate="2012-10-21T21:33:08.953" Score="2" ViewCount="1852" Body="&lt;p&gt;Is there a data feed provider that has a REST (http) API?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Preferably real-time and historical, at least for US equities.&lt;/p&gt;&#xA;" OwnerUserId="1384" LastActivityDate="2018-09-15T01:33:29.890" Title="Data feed API that uses REST?" Tags="&lt;data&gt;&lt;market-data&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4377" PostTypeId="2" ParentId="4376" CreationDate="2012-10-21T21:49:13.273" Score="2" Body="&lt;p&gt;I'm working on building one! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the short answer is no, I haven't found one. There are some good SOAP web-services from: &lt;a href=&quot;http://www.xignite.com&quot; rel=&quot;nofollow&quot;&gt;Xignite&lt;/a&gt;, they are the defacto standard for web-based data-service APIs, or at least the biggest as of recently. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.nanex.net&quot; rel=&quot;nofollow&quot;&gt;Nanex&lt;/a&gt; also offers a more robust API offering that is delivered via the web, but it's not rest. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are lots of questions here about data-services, and I think the moderators have mixed feelings about the relevance of this topic. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've asked around Quora, and a few other places. Feel free to contact me directly if you'd like to hear more.&lt;/p&gt;&#xA;" OwnerUserId="913" LastActivityDate="2012-10-21T21:49:13.273" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4378" PostTypeId="2" ParentId="4374" CreationDate="2012-10-22T02:34:29.010" Score="7" Body="&lt;p&gt;A hurst exponent, H, between 0 to 0.5 is said to correspond to a mean reverting process (anti-persistent), H=0.5 corresponds to Geometric Brownian Motion (Random Walk), while H &gt;= 0.5 corresponds to a process which is trending (persistent).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The hurst exponent is limited to a value between 0 to 1, as it corresponds to a fractal dimension between 1 and 2 (D=2-H, where 0 &amp;lt; H &amp;lt; 1). I often think of it more along the lines of how much space the 'wandering' fills up (between 1 to 2 dimensions) and also how jagged or noisy the process may be (more noisy-&gt; lower hurst, more smooth -&gt; higher hurst).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could calculate an H&gt;1, but it would not have any meaning using the accepted definition and fractal dimension boundaries (fractions between integer dimensions must always be less than one).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, &#xA;from &quot;&lt;a href=&quot;http://mosaic.mpi-cbg.de/docs/Racine2011.pdf&quot; rel=&quot;nofollow&quot;&gt;Estimating the Hurst Exponent&lt;/a&gt;,&quot; R. Racine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Applied to financial data such as stock prices, the Hurst Exponent can&#xA;be interpreted as a measure for the trendiness: H &amp;lt; 0:5 high volatility, stock&#xA;price is anti trended, H = 0:5, stock price behaves like a brownian process, no&#xA;trend, H &gt; 0:5 stock price has a trend.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;*For more insight, any of Benoit Mandelbrot's books are easily accessible and instructive on the topic. &lt;/p&gt;&#xA;" OwnerUserId="3040" LastEditorUserId="15189" LastEditDate="2015-01-27T20:58:04.577" LastActivityDate="2015-01-27T20:58:04.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4379" PostTypeId="2" ParentId="4376" CreationDate="2012-10-22T04:47:37.233" Score="2" Body="&lt;p&gt;To be honest, I think of most purposes data feeds that peruse SOAP or REST are pretty useless. The only applications that benefit from that would be web-based charting tools that deal with historical prices as well as parts of an application that is not speed or performance critical such as static data (symbol lists and the like). However, anything real-time I strongly advise against such technologies and rather go with solid APIs, direct access to liquidity providers, brokers, data vendors or Fix/Fast. Anything web-based in relation to real-time pricing data sounds very sketchy to me and I would not spend much time looking for such solutions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you mind elaborating what you really like to do? In most all situations I probably can recommend an alternative technology that proves a lot more stable and faster. Try me ;-)&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-10-22T04:47:37.233" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="4383" PostTypeId="1" CreationDate="2012-10-22T09:57:51.343" Score="0" ViewCount="285" Body="&lt;p&gt;Do you guys know if a paper has been published that discusses forward- and backward adjusted stockprices, and the look ahead bias coming from backward adjusted data?&lt;/p&gt;&#xA;" OwnerUserId="3140" LastActivityDate="2012-10-22T09:57:51.343" Title="forward- and backward adjusting stockprices" Tags="&lt;corporate-actions&gt;" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="4385" PostTypeId="1" AcceptedAnswerId="4407" CreationDate="2012-10-22T16:12:19.817" Score="8" ViewCount="1122" Body="&lt;p&gt;I am preparing an undergraduate lecture in quantitative finance and I am looking for material that combines the topics:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Random_walk&quot;&gt;random walk&lt;/a&gt; and&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Heat_equation&quot;&gt;heat equation&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The material should be accessible (intuitive!), give some background (so not only proving that the random walk is the solution to the heat equation) and could also address adjacent and/or supporting topics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question&lt;/strong&gt;&lt;br&gt;&#xA;Could you provide me with references, links etc.?&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2013-11-08T15:21:27.393" Title="Connections between random walk and heat equation (Material for ~)" Tags="&lt;reference-request&gt;&lt;differential-equations&gt;&lt;random-walk&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4388" PostTypeId="1" CreationDate="2012-10-22T19:52:36.667" Score="5" ViewCount="2115" Body="&lt;p&gt;I am trying to create a simple risk calculation for the portfolio (ignoring correlations for the moment). I have some corporate bonds with limited daily price changes. Any one have ideas how I can get a VaR (95%) for these assets given their limited pricing history? Is there any easy way to use CDS for the name instead of corporate bond prices (if i can find a long enough history)&lt;/p&gt;&#xA;" OwnerUserId="3055" LastActivityDate="2014-07-18T22:43:17.520" Title="VaR for corporate bonds" Tags="&lt;fixed-income&gt;&lt;var&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4390" PostTypeId="2" ParentId="4364" CreationDate="2012-10-22T23:03:13.747" Score="3" Body="&lt;p&gt;Here is a link to a paper with concrete details of calculating the hedge ratio for your position: &lt;a href=&quot;http://quanttrader.info/public/betterHedgeRatios.pdf&quot; rel=&quot;nofollow&quot;&gt;http://quanttrader.info/public/betterHedgeRatios.pdf&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Certainly, you want to check that it is reasonable to hedge one position with the other, as Freddy warns. But assuming it is, the paper suggests that using total least squares is better than using ordinary least squares (OLS). It contains R code to implement the calculation.&lt;/p&gt;&#xA;" OwnerUserId="37" LastActivityDate="2012-10-22T23:03:13.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4391" PostTypeId="1" CreationDate="2012-10-23T00:22:29.147" Score="5" ViewCount="542" Body="&lt;p&gt;I recall reading a paper, but can't remember where I found it. In short, there was a parametric form for volatility smile/skew that fit both index and single stock vol slices &lt;em&gt;and&lt;/em&gt; had intuitive parameters that were consistent in time. It was something like ATM vol + skew + convexity + 2 or 3 parameters to take care of the OTM quirks and the whole thing was based on log(K/S)/sqrt(t) axis so the parameters were more or less consistent in time. Yet, at the same time it was not a stochastic volatility model, simply a parametric form for implied volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone remember this paper or have heard of a parametric form that fits these requirements? &lt;/p&gt;&#xA;" OwnerUserId="2906" LastActivityDate="2013-08-14T06:31:42.017" Title="self-consistent parametric form for equity implied volatility" Tags="&lt;options&gt;&lt;implied-volatility&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4393" PostTypeId="2" ParentId="559" CreationDate="2012-10-23T03:41:31.250" Score="0" Body="&lt;p&gt;Just read their &lt;a href=&quot;http://www.bloomberg.com/careers/&quot; rel=&quot;nofollow&quot;&gt;jobs section&lt;/a&gt;. They use a lot of C++, use Javascript for the terminal interface, and sometimes Java/Ruby for other random stuff.&lt;/p&gt;&#xA;" OwnerUserId="2139" LastEditorUserId="35" LastEditDate="2012-10-23T11:17:34.937" LastActivityDate="2012-10-23T11:17:34.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4394" PostTypeId="2" ParentId="3609" CreationDate="2012-10-23T03:49:16.233" Score="0" Body="&lt;p&gt;You have to know the payout schedule. If you don't know, then take the TTM (trailing twelve months) of total dividends, and use that as a moving average.&lt;/p&gt;&#xA;" OwnerUserId="2139" LastActivityDate="2012-10-23T03:49:16.233" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4395" PostTypeId="2" ParentId="4325" CreationDate="2012-10-23T04:16:29.743" Score="2" Body="&lt;p&gt;Yes, &lt;a href=&quot;http://www.wealth-lab.com/Charting/Strategies/Default.aspx?id=gKDpXpVy81Vq3g3Dz8jVELPmHEf1H/WdfgCeS3SsdHTtI4OmdcIziEAoFucRQ3E9&quot; rel=&quot;nofollow&quot;&gt;Wealth Lab&lt;/a&gt; used to have rankings and scores. Maybe it is only for registered users now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.portfolio123.com/app/opener/ptf&quot; rel=&quot;nofollow&quot;&gt;Portfolio123&lt;/a&gt; also has systems with rankings, but you definitely have to be a member to see them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://equametrics.com&quot; rel=&quot;nofollow&quot;&gt;Equametrics&lt;/a&gt; also has algorithmic trading systems with free signups.&lt;/p&gt;&#xA;" OwnerUserId="2139" LastEditorUserId="2139" LastEditDate="2014-03-05T06:05:33.637" LastActivityDate="2014-03-05T06:05:33.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4396" PostTypeId="1" CreationDate="2012-10-23T05:32:23.827" Score="6" ViewCount="370" Body="&lt;p&gt;This &lt;a href=&quot;http://arxiv.org/pdf/1208.2658v1.pdf&quot; rel=&quot;noreferrer&quot;&gt;paper&lt;/a&gt; mentions the &lt;em&gt;elliptic Heston operator&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Av:= -\frac y2(v_{xx}+2\rho\sigma v_{xy} + \sigma^2v_{yy}) - (c_0 - q - \frac y2)v_x + \kappa(\theta -y)v_y + c_0v$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then  boundary value problem are discussed:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Au=f \text{ on } \Omega \\ u = g \text{ on } \partial\Omega$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to know how people use such Dirichlet conditions in mathematical finance. &lt;/p&gt;&#xA;" OwnerUserId="3139" LastEditorUserId="35" LastEditDate="2012-10-23T13:08:43.070" LastActivityDate="2012-10-26T17:57:19.290" Title="What is Heston's equation?" Tags="&lt;mathematics&gt;&lt;heston&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4397" PostTypeId="1" CreationDate="2012-10-23T11:30:02.760" Score="2" ViewCount="208" Body="&lt;p&gt;How would one price a derivative denominated in EUR that pays in USD?&lt;/p&gt;&#xA;" OwnerUserId="2908" LastEditorUserId="35" LastEditDate="2012-10-23T13:31:41.820" LastActivityDate="2012-10-23T13:41:25.117" Title="How is a quanto priced?" Tags="&lt;fx&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4398" PostTypeId="2" ParentId="4396" CreationDate="2012-10-23T13:16:13.393" Score="5" Body="&lt;p&gt;From this &lt;a href=&quot;http://arxiv.org/abs/1206.0831&quot; rel=&quot;noreferrer&quot;&gt;abstract&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The Heston stochastic volatility process is a degenerate diffusion process where the degeneracy in the diffusion coefficient is proportional to the square root of the distance to the boundary of the half-plane. The generator of this process with killing, called the elliptic Heston operator, is a second-order, degenerate-elliptic partial differential operator, where the degeneracy in the operator symbol is proportional to the distance to the boundary of the half-plane. In mathematical finance, solutions to obstacle problem for the elliptic Heston operator correspond to value functions for perpetual American-style options on the underlying asset.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;A simple &lt;a href=&quot;https://www.google.com/search?q=elliptic+Heston+operator&quot; rel=&quot;noreferrer&quot;&gt;Google search&lt;/a&gt; shows that there are only a handful of academics who even use this term. Your best bet may be to contact one of them directly for support. (They are unlikely to entertain a broad &quot;what do I use this for&quot; question, however.)&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2012-10-23T13:16:13.393" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4400" PostTypeId="2" ParentId="4388" CreationDate="2012-10-23T14:37:21.317" Score="7" Body="&lt;p&gt;It's very common to work in spreads rather than price for this calculation.  The simplest approach would be to get an implied spread for each bond, and then allow the spreads to vary in simulation according to an equity-style factor model.  Each spread simulation can then be mapped back to bond prices by reversing the formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few points:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If you can, you should use &lt;a href=&quot;https://quant.stackexchange.com/questions/3319/what-is-the-difference-between-option-adjusted-spread-oas-and-z-spread&quot;&gt;option adjusted spreads&lt;/a&gt;, but that involves somewhat complicated interest rate models.  Z spreads are a simpler choice.&lt;/li&gt;&#xA;&lt;li&gt;Be sure to allow for default in your simulations, since a default will have a large negative effect on portfolio value.&lt;/li&gt;&#xA;&lt;li&gt;Importance sampling will get better resolution.&lt;/li&gt;&#xA;&lt;li&gt;Many people prefer Expected Shortfall to VaR because VaR is not a coherent risk measure.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="254" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2012-10-23T14:37:21.317" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4401" PostTypeId="2" ParentId="4396" CreationDate="2012-10-23T14:48:14.953" Score="4" Body="&lt;p&gt;Expanding a bit on chrisaycock's answer, and noting in particular from the abstract &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In mathematical finance, solutions to obstacle problem for the elliptic Heston operator correspond to value functions for perpetual American-style options on the underlying asset.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;we can see that this would be used to price those few rare cases of perpetual options.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only traded examples I know of are perpetual convertible preferred securities, for example from &lt;a href=&quot;https://www.wellsfargo.com/invest_relations/overview&quot; rel=&quot;nofollow&quot;&gt;Wells Fargo's offerings&lt;/a&gt;.  Such securities are lightly traded by the market players and therefore not always analyzed using the full machinery of a stochastic vol model, even if they should be in principle.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, these &quot;perps&quot; are so bond-like that it is often more useful to think of them as fixed-income instruments.  The main concern with them is that the issuer will stop paying the dividends or change capital structure, so it is a bit ridiculous to spend one's time on a fancy stochastic vol model when all the interesting stochastic events have to do with unrelated variables such as alterations in capital structure.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2012-10-26T17:57:19.290" LastActivityDate="2012-10-26T17:57:19.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4402" PostTypeId="2" ParentId="4391" CreationDate="2012-10-23T15:01:49.743" Score="2" Body="&lt;p&gt;It's extremely common in the industry to have a parabolic skew of this type with some cutoff parameters.  At it's simplest, such a model looks like this&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\sigma_{ATM}(t) = \sigma_0 + s(t)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $s(t)$ is a vol term structure function and can be further simplified to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;s(t) = \frac{s}{\sqrt{t}}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if you are willing to accept the inaccuracies.  Usually at-the-money is ATM forward (i.e. for the strike equal forward price $F(t)$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, base vol $\hat\sigma$ can be characterized by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\hat\sigma(K,T) = \sigma_{ATM}(t) + \gamma \frac{\log(K/F(t))}{\sigma\sqrt{t}} + \lambda \left(\frac{\log(K/F(t))}{\sigma\sqrt{t}}\right)^2&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and then we window the vol to keep it from going too crazy:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\sigma(K,T) = \max(\min(\hat\sigma(K,T), \sigma_{max}), \sigma_{min}))&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Zillions of minor variations on this scheme exist, going back to the 1980s.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-10-23T15:01:49.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4403" PostTypeId="2" ParentId="4391" CreationDate="2012-10-23T15:45:53.727" Score="1" Body="&lt;p&gt;You might want to look at &lt;a href=&quot;http://www.risk.net/risk-magazine/technical-paper/1530398/if-skew-fits&quot; rel=&quot;nofollow&quot;&gt;&quot;If the skew fits&quot;&lt;/a&gt; article by Gregory Brown and Curt Randall from Risk magazine (April, 1999).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Their parameterization has the following form:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\sigma(S,t) = \sigma_{ATM}(t) + \\ \sigma_{skew}(t) * tanh(\gamma_{skew} (t) * {\log(S/S_{0})}  - \theta_{skew}(t)) + \\ \sigma_{smile}(t) * [1 - sech (\gamma_{smile}(t) * {\log(S/S_{0})-\theta_{smile}(t)})]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They also give a brief explanation of the model and a way to calibrate it. &lt;/p&gt;&#xA;" OwnerUserId="15" LastEditorUserId="15" LastEditDate="2012-10-24T08:18:52.867" LastActivityDate="2012-10-24T08:18:52.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4404" PostTypeId="1" AcceptedAnswerId="4423" CreationDate="2012-10-23T18:18:40.227" Score="5" ViewCount="5348" Body="&lt;p&gt;I'm curious about how to construct the five basic greeks for an equity option portfolio when there are shares of the underlying in the portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, a portfolio of 100 call options and 100 put options has a portfolio delta of &lt;code&gt;100 * call_delta + 100 * put_delta&lt;/code&gt; (assuming the 100 calls are the same and 100 puts are the same). A portfolio of 100 short call options and 100 short put options has a portfolio gamma of &lt;code&gt;-100 * call_gamma - 100 * put_gamma&lt;/code&gt; (again assuming the 100 calls are the same and 100 puts are the same).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What about a portfolio of 100 call options and 100 put options and 10 shares of the underlying? How would one include for the other greeks (gamma, theta, rho, vega)?&lt;/p&gt;&#xA;" OwnerUserId="1112" LastActivityDate="2020-03-13T12:59:17.437" Title="Equity option portfolio greeks with underlying" Tags="&lt;options&gt;&lt;greeks&gt;&lt;portfolio&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4405" PostTypeId="2" ParentId="2870" CreationDate="2012-10-23T19:49:29.120" Score="5" Body="&lt;p&gt;Any explanations? Yes. Within each asset category we find that stocks may be:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Unattractively underperforming the category norm &lt;/li&gt;&#xA;&lt;li&gt;Attractive as they meet the expected norm&lt;/li&gt;&#xA;&lt;li&gt;Unsustainable as their returns exceed the category norm and may suffer mean reversion&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;By focusing on low variance, we exclude type (3) stocks that damage portfolio performance through high variance and so we achieve index-beating returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2143425&quot;&gt;posted a paper&lt;/a&gt; that recommends portfolio optimisation through holding only stocks seen as attractive: type (2). The paper includes an investment coefficient for ranking stocks according to strength of EMA less the price premium to the EMA. This ranking serves as a value for expected returns.&lt;/p&gt;&#xA;" OwnerUserId="3147" LastEditorUserId="35" LastEditDate="2012-10-23T20:20:30.073" LastActivityDate="2012-10-23T20:20:30.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4406" PostTypeId="1" CreationDate="2012-10-23T21:54:32.267" Score="1" ViewCount="557" Body="&lt;p&gt;Let's assume I am classifying every trading day as a 1 or a 0. Exactly what I am classifying doesn't matter, but for the sake of this question let's say I am predicting direction of price change. So, for a particular stock like GOOG:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For day N:&lt;br&gt;&#xA;1: close day N+1 &gt; close day N&lt;br&gt;&#xA;0: close day N+1 &amp;lt;= close day N  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For every day N, I want to predict whether it is a 1 or 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let's assume that, as input, I want to use a time series (previous 10 days) of:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Closing price  &lt;/li&gt;&#xA;&lt;li&gt;EMA closing price  &lt;/li&gt;&#xA;&lt;li&gt;Intra-day volatility&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;That will give me 30 attributes as input. My question, is what makes more sense:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Generate three different classification models (one for each of the above attribute types). Then perform one last classification which will give me a final prediction, which takes the predicted class of each model as input. I.E. This final classification will contain three attributes as input, like [1,0,1] or [1,1,1] etc.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Perform one classification which has all 30 attributes as input.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="3045" LastEditorUserId="467" LastEditDate="2012-11-01T19:52:10.817" LastActivityDate="2012-11-01T20:07:22.497" Title="Choosing attributes for SVM classification?" Tags="&lt;machine-learning&gt;&lt;svm&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4407" PostTypeId="2" ParentId="4385" CreationDate="2012-10-23T21:59:23.310" Score="5" Body="&lt;p&gt;I would start with explaining random walk (this should be fairly simple) and then making a connection to heat equation in discrete time. This &lt;a href=&quot;http://www.math.uchicago.edu/~lawler/reu.pdf&quot; rel=&quot;noreferrer&quot;&gt;paper&lt;/a&gt; is doing exactly this and by leaving out technicalities you should make this pretty intuitive for students. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically the intuition is as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At each integer time unit, the heat at each point is spread evenly among its nearest neighbors. If one of those neighbors is a boundary point, then the heat that goes to that site is lost forever.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Probabilistic view of the heat is given by imagining that the temperature is controlled by a very large number of “heat particles”. These particles perform random walks until they leave the object at which time they are killed. The temperature at each point and time, is given by the density of particles at this point.&lt;/p&gt;&#xA;" OwnerUserId="370" LastActivityDate="2012-10-23T21:59:23.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4410" PostTypeId="1" AcceptedAnswerId="4428" CreationDate="2012-10-24T12:16:55.573" Score="14" ViewCount="7578" Body="&lt;p&gt;I'm starting on a project that involves correlating and forecasting Forex time series to news releases. I'm aware of sources such as Thomson Reuter's machine readable news and Dow Jone's Newswire services. However, they both require expensive subscriptions. Does anyone know of any similar but free equivalent that I can use to develop a proof of concept? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the news releases do not have to be strictly real time, and some delay is fine as well but the timestamp is essential. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I think shouldn't have limited my question to just machine readable news which are preprocessed. What I'm interested in is more along the lines of Ransquawk's live headlines service which provides text-based news headlines updates. The text data aren't in a &quot;machine readable&quot; but that's fine as I can apply some simple NLP techniques on my side to extract information. The main issues is how to tap into these live feeds since most of them don't provide an API. And since what I'm working on is more a proof of concept, I think an archive timestamped news article can do as well.&lt;/p&gt;&#xA;" OwnerUserId="2886" LastEditorUserId="1652" LastEditDate="2012-11-02T14:40:44.230" LastActivityDate="2020-10-08T23:43:38.180" Title="Sources of Machine Readable News" Tags="&lt;automated-trading&gt;&lt;news&gt;&lt;modelling&gt;" AnswerCount="8" CommentCount="2" FavoriteCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="4411" PostTypeId="2" ParentId="4404" CreationDate="2012-10-24T14:36:12.060" Score="0" Body="&lt;p&gt;Delta is a derivative of the price with respect of the price of underlying, so for the unit stock position delta is 1 and gamma is obviously 0. As for theta, rho and vega of the stock position, they do not make sense, at least not in the Black-Scholes setting they don't. You would not be able to hedge say vega or theta risk with stock positions.&lt;/p&gt;&#xA;" OwnerUserId="3049" LastEditorUserId="3049" LastEditDate="2012-10-24T15:50:13.717" LastActivityDate="2012-10-24T15:50:13.717" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4412" PostTypeId="2" ParentId="4410" CreationDate="2012-10-24T14:52:54.553" Score="2" Body="&lt;p&gt;News is not free, and hence you won't find a company offering machine readable news services for free. My best suggestion is to ask a machine readable news company for a day's worth of historical data. Even that might not work, however, as they won't waste their time if they don't think you're going to buy their service.&lt;/p&gt;&#xA;" OwnerUserId="3150" LastActivityDate="2012-10-24T14:52:54.553" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4413" PostTypeId="1" CreationDate="2012-10-24T22:33:53.463" Score="2" ViewCount="234" Body="&lt;p&gt;&lt;strong&gt;Could anyone please help me with the following?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need to generate a histogram (resp. probability density) of returns of a bonus-certificate.&#xA;A bonus-certificate can be replicated by an underlying and a down-and-out-put option.&#xA;I tried to do that with Matlab but not by calculating the right PDE using conditional probability. Instead I've chosen a far easier way. I derive the wanted histogram (BC-histogram) from the histogram of stock returns. At first log-returns (that are normally distributed) are considered only. Then a transformation of log-returns to simple returns generates the BC-histogram of lognormally distributed returns.&#xA;To achieve that following steps had to be made:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;divide the probability density of stock returns in a certian amount&#xA;of bins (so the histogram gets a certain bin width),&lt;/li&gt;&#xA;&lt;li&gt;sum up all the bins that are between the bonus-level and the&#xA;barrier-level and remove them from the generated BC-histogram,&lt;/li&gt;&#xA;&lt;li&gt;mirror the bins at the point of the barrier to take into account&#xA;that if the stock touches the barrier the investor gets the exact payment &#xA;as someone  would get by simply buying the underlying stock&lt;/li&gt;&#xA;&lt;li&gt;and finally subtract the sum of the mirrored bins in point 3. from&#xA;the sum of point 2. to get the bin height of the bonus bin.&lt;/li&gt;&#xA;&lt;li&gt;In order to transform from log- to ordinary returns simply calculate&#xA;the exponential of log-returns and subtract one.&lt;/li&gt;&#xA;&lt;li&gt;Finally in addition to 5. subtract the premium payed for the&#xA;down-and-out-put and divide by the Premium (in percent of the&#xA;underlying stock) plus one to account for the decrease in return&#xA;because of the option component of the bonus-certificate that had to&#xA;be payed.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;I've generated a plot that shows BC-Returns for various barrier- and bonus-levels.&#xA;Could anyone please verify the validity of the plot and the steps I've mentioned above?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Link to the plot:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://s7.directupload.net/images/121016/x37oi9ro.png&quot; rel=&quot;nofollow&quot;&gt;http://s7.directupload.net/images/121016/x37oi9ro.png&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Perhaps someone could post a plot he has generated using his own solution, like PDE-solution for instance. I would like to compare the results of the plots especially for a given bonus-level of 1.22 (i. e. 222% of current underlying price) and a given barrier-level of -0.01 (i. e. 99% of current underlying price).&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Any useful help will be greatly appreciated.&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="3155" LastActivityDate="2012-10-24T22:33:53.463" Title="Probability Density of Returns of Bonus Certificates" Tags="&lt;option-pricing&gt;&lt;returns&gt;&lt;probability&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4414" PostTypeId="2" ParentId="4410" CreationDate="2012-10-25T01:58:20.717" Score="8" Body="&lt;p&gt;Concur with Thomas for most part, though I would recommend you to sign up for a trial with Dow Jones Newswire. I like the API and app that Newsware ( &lt;a href=&quot;http://www.newsware.com/&quot;&gt;http://www.newsware.com/&lt;/a&gt;) makes available. It is not suitable for hft but I use it in order to stay informed and look up often used mnemonics. I think they have a pretty capable API and I remember they offer trials. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may peruse it in order to calculate historical reactions to certain economic releases, however I am willing to bet you won't find ways to successfully (meaning, sustainable) forecast future price moves based on past news releases. I believe the only way to monetize price reaction to news and economic releases is through hft and employing a host of highly skilled linguists, programmers and economists. To my knowledge all software that is capable of analyzing text and deriving trading signals from news releases is stricly proprietary for the very reason that it costs a fortune to develop something that has an edge. Not exactly the playground for people on the retail side, and not even the playground for most investment banks, simply for lack of very specialized resources that are needed to be successful in this particular endeavor.   &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-10-25T01:58:20.717" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4415" PostTypeId="1" CreationDate="2012-10-25T07:07:40.697" Score="4" ViewCount="443" Body="&lt;p&gt;I would like to make a comparison between some multi asset class strategies and some kind of benchmark.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this situation, the classic benchmarks like MSCI World (for Equitites), GSCI (for commodities) or Barcap (for Fixed Income) are not an option anymore; I would like to find any global multi asset class index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I tried to look out on Bloomberg for such an index but I was unsuccessful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you have an index that you would recommend?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise, is there a common way of creating one (like an equally-weighted portfolio of the indices mentioned above)?&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2012-11-21T10:38:52.670" Title="Whare are the common Global Asset Allocation indices?" Tags="&lt;asset-allocation&gt;&lt;benchmark&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4416" PostTypeId="1" CreationDate="2012-10-25T09:32:40.153" Score="3" ViewCount="626" Body="&lt;p&gt;I'm looking for a set of exercises that teach how to build a project finance spreadsheet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I accept there may be no &lt;strong&gt;&lt;em&gt;typical&lt;/em&gt;&lt;/strong&gt; project finance, but there are a lot of principles are shared in common across a lot of projects. The debt/ equity split, setting hurdle rates, calculating IRR, looking at how yields vary depending on various outcomes, tiered senior debt / subordinate debt / different types of bonds (deep-discount, income, convertible, etc) / equity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm working my way through various books on the subject: Yescombe's &quot;Principles of project finance&quot;, Tan's &quot;Principles of Project and Infrastructure Finance&quot;, Merna &amp;amp; Njiru's &quot;Financing Infrastructure Projects&quot;, and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I'm looking for some electronic resources: specifically, a way to start building example project-finance spreadsheets, to analyse the structure of project-finance deals, to teach myself, in stages, how to build such a thing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please can you point me at some suitable resources?&lt;/p&gt;&#xA;" OwnerUserId="2370" LastActivityDate="2012-10-29T19:21:42.897" Title="Where can I find exercises on building a project finance spreadsheet?" Tags="&lt;reference-request&gt;&lt;financial-engineering&gt;&lt;structured-finance&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4417" PostTypeId="2" ParentId="4416" CreationDate="2012-10-25T09:59:28.167" Score="1" Body="&lt;p&gt;I'm not aware of any exercises. You do not mention whether you tried Google. A good set of spreadsheets is on the &lt;a href=&quot;http://pages.stern.nyu.edu/~adamodar/&quot; rel=&quot;nofollow&quot;&gt;Home Page for Aswath Damodaran&lt;/a&gt;. You could convert it into &quot;exercises&quot; by first working through them yourself and then comparing to Damodaran's solution (or whether it gives the same results).&lt;/p&gt;&#xA;" OwnerUserId="2685" LastEditorUserId="1531" LastEditDate="2012-10-29T18:47:58.903" LastActivityDate="2012-10-29T18:47:58.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4418" PostTypeId="1" CreationDate="2012-10-25T10:25:23.887" Score="2" ViewCount="1524" Body="&lt;p&gt;I have a trading strategy that generates returns $R_{t}$. I want to test the strategy by looking at the alpha:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$R_t - R_{f,t} = \alpha + \beta (R_{m,t} - R_{f,t}) + e_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I compare my alpha against the strategy of just doing an equally weighted portfolio over my assets universe. I also use an analogous method for factor models with more regressors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does it matter that my $\hat{\alpha}$ is always insignificant at the $10\%$ level? I've tested many strategies using this type of factor model and $\hat{\alpha}$ is never significant at $10\%$. However I usually find that my $\hat{\alpha}$ is much larger for the strategies than for an unweighted portfolio. &lt;/p&gt;&#xA;" OwnerUserId="3156" LastActivityDate="2012-10-25T18:35:03.170" Title="Using alpha to evaluate trading strategy" Tags="&lt;quant-trading-strategies&gt;&lt;portfolio-management&gt;&lt;portfolio&gt;&lt;capm&gt;&lt;performance-evaluation&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4419" PostTypeId="1" CreationDate="2012-10-25T13:36:08.293" Score="2" ViewCount="200" Body="&lt;p&gt;I may have every particular detail of this wrong, including the exchange, but years ago, maybe as long as 20, there was a successful suit against NASDAQ based on research by academics showing their bid-ask spreads were too wide.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone recall the suit, the academics who were involved, and maybe where the research appeared ?&lt;/p&gt;&#xA;" OwnerUserId="3539" LastEditorUserId="467" LastEditDate="2012-11-12T22:55:10.200" LastActivityDate="2012-11-12T22:55:10.200" Title="Looking for analysis of NASDAQ suit?" Tags="&lt;market-data&gt;&lt;market-making&gt;&lt;market-microstructure&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4422" PostTypeId="2" ParentId="4406" CreationDate="2012-10-25T16:53:19.253" Score="2" Body="&lt;p&gt;&lt;em&gt;Use all the attributes in a single model.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you build three separate models, you will be throwing away all all information that might be contained in combinations of different features.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, for example, it might be the case that prices are more likely to go up tomorrow if today's closing price was above the ema and volatility was high, but it is more likely to go down with the same price action if volatility was low. The individual models wouldn't be able to capture that correlation, because no single SVM would be able to see all the required data, but a single SVM with all the attributes could detect it (with a non-linear kernel). &lt;/p&gt;&#xA;" OwnerUserId="2027" LastEditorUserId="467" LastEditDate="2012-11-01T19:54:15.300" LastActivityDate="2012-11-01T19:54:15.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4423" PostTypeId="2" ParentId="4404" CreationDate="2012-10-25T17:20:49.887" Score="3" Body="&lt;p&gt;Ok so for completeness, assuming Black-Scholes and an example portfolio of 100 long &lt;span class=&quot;math-container&quot;&gt;$C_1$&lt;/span&gt;, 100 long &lt;span class=&quot;math-container&quot;&gt;$C_2$&lt;/span&gt; (both on the same underlying), and 10 long shares of the same underlying, &lt;span class=&quot;math-container&quot;&gt;$S$&lt;/span&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Portfolio delta:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\frac{\partial}{\partial S} (100C_1 + 100C_2 + 10S) = 100\frac{\partial C_1}{\partial S} + 100\frac{\partial C_2}{\partial S} + 10\frac{\partial S}{\partial S}$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where &lt;span class=&quot;math-container&quot;&gt;$10\frac{\partial S}{\partial S}$&lt;/span&gt; term is 10. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Portfolio gamma:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\frac{\partial^2}{\partial S^{2}} (100C_1 + 100C_2 + 10S) = 100\frac{\partial^2 C_1}{\partial S^2} + 100\frac{\partial^2 C_2}{\partial S^2} + 10\frac{\partial^2 S}{\partial S^2}$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where &lt;span class=&quot;math-container&quot;&gt;$10\frac{\partial^2 S}{\partial S^2}$&lt;/span&gt; term is 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Portfolio theta:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$-\frac{\partial}{\partial \tau} (100C_1 + 100C_2 + 10S) = -100\frac{\partial C_1}{\partial \tau} - 100\frac{\partial C_2}{\partial \tau} - 10\frac{\partial S}{\partial \tau}$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where &lt;span class=&quot;math-container&quot;&gt;$10\frac{\partial S}{\partial \tau}$&lt;/span&gt; term is 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Portfolio vega:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\frac{\partial}{\partial \sigma} (100C_1 + 100C_2 + 10S) = 100\frac{\partial C_1}{\partial \sigma} + 100\frac{\partial C_2}{\partial \sigma} + 10\frac{\partial S}{\partial \sigma}$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;span class=&quot;math-container&quot;&gt;$10\frac{\partial S}{\partial \sigma}$&lt;/span&gt; term is 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Portfolio rho:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\frac{\partial}{\partial r} (100C_1 + 100C_2 + 10S) = 100\frac{\partial C_1}{\partial r} + 100\frac{\partial C_2}{\partial r} + 10\frac{\partial S}{\partial r}$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;span class=&quot;math-container&quot;&gt;$10\frac{\partial S}{\partial r}$&lt;/span&gt; term is 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note this assumes the options are on the same underlying. This is important because the partials assume a small (or at least constant) change in the underlying across the portfolio. If &lt;span class=&quot;math-container&quot;&gt;$C_1$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$C_2$&lt;/span&gt; were on different underlyings, we cannot necessarily assume that a small change in the underlying of &lt;span class=&quot;math-container&quot;&gt;$C_1$&lt;/span&gt; will be the same small change in the underlying of &lt;span class=&quot;math-container&quot;&gt;$C_2$&lt;/span&gt;&lt;/p&gt;&#xA;" OwnerUserId="1112" LastEditorUserId="17101" LastEditDate="2020-03-13T12:59:17.437" LastActivityDate="2020-03-13T12:59:17.437" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="4424" PostTypeId="2" ParentId="4416" CreationDate="2012-10-25T18:27:35.190" Score="3" Body="&lt;p&gt;In my estimation, you are best-served by creating these sheets from scratch. There are a number of reasons for this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;You will thoroughly understand the underlying machinations of each calculation&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can customize to your specific needs, and so on...&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If you are looking for some decent introductory texts, I have benefited from &lt;a href=&quot;http://www.swlearning.com/finance/moyer/excel.html&quot; rel=&quot;nofollow&quot;&gt;Moyer Excel Templates&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally, I would consult Excel/VBA texts as they will show you some useful tools on how to streamline some of your spreadsheets, assuming you want them to be in .xls format.&lt;/p&gt;&#xA;" OwnerUserId="3153" LastEditorUserId="1652" LastEditDate="2012-10-29T19:21:42.897" LastActivityDate="2012-10-29T19:21:42.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4425" PostTypeId="1" CreationDate="2012-10-25T18:28:56.393" Score="4" ViewCount="205" Body="&lt;p&gt;I want to create a position that either multiplies with $1+u$ (outcome $U$) or $1-d$ (outcome $D$). The probability of $U$ is denoted by $P(U) = \pi$. The initial value of the position is $V_0$. Given outcome $U$ the value of the position is $V_U = (1+u)V_0$, and given outcome $D$ it is $V_D = (1-d)V_0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More specifically, I am trying to create a doubling or halving position with more or less equal probability of $U$ and $D$ occurring, i.e. $\pi \approx 0.50$. I was thinking of using binary options that pay 1 when $U$ is the outcome. I was also thinking the position could be created using binaries and holding cash. So, $V_U = 2V_0 = \frac{V_0}{2} + N*P_U = \frac{V_0}{2} + N, P_U = 1$ where $N$ is the number of options in the position and $P_U$ is the option payout at success. $V_D = \frac{1}{2}V_0 = V_0 - NP_0$ where $P_0$ is the initial price of the binary option. I want to find $N$ and $P_0$ such that the value is doubled at success and halfed at non-success.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We find that $N = \frac{3}{2}V_0$ and that $P_0 = 1/3$. However, this breaches the $\pi$ condition. If I am purchasing daily binary options on whether S&amp;amp;P 500 closes above its last close, one would assume that the binary option would be priced near $0.50$ at the beginning of the day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How should I construct this portfolio?&lt;/p&gt;&#xA;" OwnerUserId="3160" LastEditorUserId="3160" LastEditDate="2012-10-25T19:25:59.920" LastActivityDate="2012-10-27T18:14:55.543" Title="Creating a doubling and halving position" Tags="&lt;options&gt;&lt;binary-options&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4426" PostTypeId="2" ParentId="4418" CreationDate="2012-10-25T18:35:03.170" Score="1" Body="&lt;p&gt;I'm not sure what you mean exactly by &quot;does it matter...&quot;, but generally speaking it should not surprise you that your alpha is not significant, as many trading strategies are more or less &quot;transformations&quot; of beta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the purest sense, alpha is not easy to accomplish, and various forms of the EMH would say that it is nearly impossible to achieve it for a sustainable time period, at least without some non-public information advantage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many trading strategies show positive alpha by a combination of tricks and mis-representations, such as: using an irrelevant benchmark, calculating alpha gross of fees/expenses/trading costs, etc., simply calculating it as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\alpha=R_t-\beta R_i$ where $R_i$ is the index return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have seen so many bastardizations of what alpha is truly meant to be that you should not read anything into the results that you have &quot;insignificant&quot; alpha.&lt;/p&gt;&#xA;" OwnerUserId="3153" LastActivityDate="2012-10-25T18:35:03.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4428" PostTypeId="2" ParentId="4410" CreationDate="2012-10-27T03:30:31.300" Score="7" Body="&lt;p&gt;It would be relatively trivial to implement a web scraper for any website you were interested in gathering news from - see &lt;a href=&quot;http://www.crummy.com/software/BeautifulSoup/&quot; rel=&quot;noreferrer&quot;&gt;Beautiful Soup&lt;/a&gt; for Python. This would allow you to gather and analyse news data from multiple sources in a way that may be more robust than relying on a single service. For example, you could screen scrape a certain website for the news headlines it's reporting, and then use a variety of statistical techniques to cluster and analyse the stories. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure if this would fit with the terms of use of certain websites, so not going to comment on that.&lt;/p&gt;&#xA;" OwnerUserId="3171" LastActivityDate="2012-10-27T03:30:31.300" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4429" PostTypeId="1" CreationDate="2012-10-27T09:21:51.207" Score="4" ViewCount="460" Body="&lt;p&gt;I have estimated sGARCH, EGARCH and TGARCH, which some for particular models are significant. For others, the alpha remain insignificant using various innovations such as the skewed variants of the normal or student $t$ distributions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am tempted to rely on the models that give significant estimates and then ignore the ones that do not. For instance, if the EGARCH-std is not significant in terms of alpha and the EGARCH-sstd is significant, I prefer to focus on the later for further analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please let me know if I am on the right path.&lt;/p&gt;&#xA;" OwnerUserId="3173" LastEditorUserId="35" LastEditDate="2012-10-27T16:26:56.877" LastActivityDate="2013-01-27T19:59:59.237" Title="Volatility models using Rugarch" Tags="&lt;volatility&gt;&lt;garch&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4430" PostTypeId="2" ParentId="4425" CreationDate="2012-10-27T18:14:55.543" Score="2" Body="&lt;p&gt;First of all, don't forget that there are two different probability measures at play here: the frequentist market measure that reflects actual observation of the market &quot;in the long run&quot; and the market-neutral martingale measure which is pertinent for pricing options.  More or less, we can take the frequentist measure, and &quot;back out&quot; the effects of market beta in order to arrive at a martingale measure that avoids counting a position as an arbitrage solely because it is long in the market and participates in the natural tendency of the market to go up over time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, as for creating a doubling and halving position, it is actually &lt;a href=&quot;http://en.wikipedia.org/wiki/Kelly_criterion&quot; rel=&quot;nofollow&quot;&gt;Kelly's criterion&lt;/a&gt;---with the odds stated (available to bet) in a market-neutral martingale measure but the true odds in a frequentist market measure---that determines the optimal fraction of $V_0$ to bet on the binary option each day, and whether you really want to double or halve, or if some other fraction is more appropriate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, remember at the beginning of the day, at least 17.5 hours in most cases have elapsed since the last close, the market in all likelihood has already gapped significantly up or down, and only 6.5 hours remain till close.  Whatever time remains in the day, that is the arbitrage you have to take advantage of, but if the option is at or near the money, there is still time to take full advantage of it.  In this case, though, it seems that the arbitrage consists of simply being long in the market, at least on an elementary theory that markets are efficient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But then again, I'm a skeptic of &quot;quant,&quot; and I believe that markets are generally more efficient than people give them credit for.&lt;/p&gt;&#xA;" OwnerUserId="3106" LastActivityDate="2012-10-27T18:14:55.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4433" PostTypeId="1" CreationDate="2012-10-28T14:20:10.560" Score="8" ViewCount="5040" Body="&lt;p&gt;I am reading a paper (reference below) that states &quot;&lt;strong&gt;The conditional volatility for each underlying security (or for a market index) can be estimated using the standard deviation of the stock’s periodic returns.&lt;/strong&gt; &lt;em&gt;However, since volatilities are persistent, as we have learned from the ARCH literature, such an estimator of volatility will be biased and inefficient, as shown by Chou (1988).....&lt;/em&gt;&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is this a &quot;&lt;em&gt;conditional&lt;/em&gt;&quot; volatility? To me it seems like you can't possibly get any more &lt;em&gt;unconditional&lt;/em&gt; than taking a simple standard deviation over past returns. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&quot;Investigating the Behavior of Idiosyncratic Volatility&quot; by Xu and Malkiel in the Journal of Business (2003).&lt;/p&gt;&#xA;" OwnerUserId="3174" LastEditorUserId="2727" LastEditDate="2012-10-31T07:26:25.587" LastActivityDate="2013-02-20T20:22:08.230" Title="Conditional or unconditional volatility?" Tags="&lt;volatility&gt;&lt;risk&gt;&lt;variance&gt;&lt;garch&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4434" PostTypeId="1" CreationDate="2012-10-28T21:10:39.913" Score="10" ViewCount="7944" Body="&lt;p&gt;For other algorithms (like support vector machines), it is recommended that input attributes are scaled in some way (for example put everything on a [0,1] scale). I have googled extensively and can't find any information on whether this needs to be done for boosting methods, and in particular gradient tree boosting.&lt;/p&gt;&#xA;" OwnerUserId="3045" LastEditorDisplayName="user13444" LastEditDate="2019-01-26T18:26:22.597" LastActivityDate="2019-01-26T18:26:22.597" Title="Gradient tree boosting -- do input attributes need to be scaled?" Tags="&lt;machine-learning&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4435" PostTypeId="1" CreationDate="2012-10-29T04:05:35.517" Score="9" ViewCount="1004" Body="&lt;p&gt;I've recently stumbled on something that really surprised me. These papers (&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1585031&quot; rel=&quot;nofollow&quot;&gt;1&lt;/a&gt;, &lt;a href=&quot;http://papers.ssrn.com/sol3/Papers.cfm?abstract_id=980865&quot; rel=&quot;nofollow&quot;&gt;2&lt;/a&gt;) find that past standard deviation of returns is inversely related to future returns. That is, portfolio of low historical variance constituents (stocks) $\to$ better returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;My question:&lt;/em&gt; Are there any studies that contradict these findings for any market(s)? Or is this pretty much the consensus view at the moment? Is this anomaly as well established as the size, momentum, B/M anomalies?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I'm talking specifically about historical return standard deviation, and not idiosyncratic volatility. I already know that the results for idiosyncratic volatility are ambiguous and there are findings either way.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1585031&quot; rel=&quot;nofollow&quot;&gt;1&lt;/a&gt;    &quot;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1585031&quot; rel=&quot;nofollow&quot;&gt;Benchmarks as Limits to Arbitrage: Understanding the Low-Volatility Anomaly&lt;/a&gt;&quot;, Baker, Bradley &amp;amp; Wurgler, (2011), Financial Analysts Journal. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/Papers.cfm?abstract_id=980865&quot; rel=&quot;nofollow&quot;&gt;2&lt;/a&gt; &quot;&lt;a href=&quot;http://papers.ssrn.com/sol3/Papers.cfm?abstract_id=980865&quot; rel=&quot;nofollow&quot;&gt;The Volatility Effect&lt;/a&gt;&quot; by Blitz and Vliet, (2007), Journal of Portfolio Management.&lt;/p&gt;&#xA;" OwnerUserId="3174" LastEditorUserId="467" LastEditDate="2012-12-26T00:13:03.280" LastActivityDate="2013-01-25T18:05:49.750" Title="Why do low standard deviation stocks tend to have superior future returns?" Tags="&lt;volatility&gt;&lt;equities&gt;&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;variance&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4436" PostTypeId="2" ParentId="4429" CreationDate="2012-10-29T18:56:08.457" Score="1" Body="&lt;p&gt;The answer depends on what you will use the models for. For example, if you care about prediction, you should use different metrics (model fit, prediction accuracy on hold-out samples, etc) to determine what works best.&lt;/p&gt;&#xA;" OwnerUserId="1531" LastActivityDate="2012-10-29T18:56:08.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4437" PostTypeId="2" ParentId="4410" CreationDate="2012-10-29T23:59:10.737" Score="2" Body="&lt;p&gt;If you are an academic interested in this field I would suggest contacting Sirca. Thomson Reuters is active with academics through their partnership with Sirca in Australia (www.sirca.org.au). Sirca has other machine readable text products available. &lt;/p&gt;&#xA;" OwnerUserId="1391" LastActivityDate="2012-10-29T23:59:10.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4438" PostTypeId="1" CreationDate="2012-10-30T00:09:16.530" Score="2" ViewCount="203" Body="&lt;p&gt;I am obtaining bid/ask price and volume market data from two different sources for the same ticker and for the same day and checking to see that at time intervals X they are &quot;roughly the same&quot;. The timestamps from the two different sources are not exactly the same, though, and so what I am doing is dumping the price every time the timestamps span a different second of the day. Sometimes the price varies in between that second, sometimes it doesn't, but regardless I dump the way it looks at the beginning of that second (or millisecond). After doing this for both sources, I did a simple plot of the results and things are looking consistent graphically:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/B0QZ4.png&quot; alt=&quot;All the ask observations throughout the day for source 1&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/qxQeO.png&quot; alt=&quot;All the ask observations throughout the day for source 2&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The time stamps do not always align, though when I intersect the time stamp columns and get a subset of the observations, and cross correlate them I get relatively poor values. Worse at higher granularities, probably due to time stamp lag-like discrepancies. I'm not sure if I should be looking at some other metric to convince myself that both sources are providing me with similar information about the ask/bid throughout the day, or what the appropiate methodology is to compare these two time series with each other. Is it cointegration between them that I am looking for? What I care to confirm is that, say, assuming the first source I know to be accurate data from which I build my view of the bid/ask throughout the day - that the second source is not too off.&lt;/p&gt;&#xA;" OwnerUserId="1456" LastActivityDate="2014-07-23T06:36:14.350" Title="What are the proper metrics to look at for checking discrepancies in these two time series" Tags="&lt;time-series&gt;&lt;data&gt;&lt;statistics&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4439" PostTypeId="1" CreationDate="2012-10-31T09:55:52.650" Score="2" ViewCount="275" Body="&lt;p&gt;I am designing a backtesting system to test an algorithm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to have a benchmark / control test results &#xA;to compare to the results of a custom algorithm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A limited &quot;set&quot; of stocks is selected to invest in.&#xA;The algorithm can choose to buy one or more stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In an effort to have a benchmark to measure against, the backtest system can:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Buy some or all of the stocks on the first day of the test period.&lt;/li&gt;&#xA;&lt;li&gt;Sell all of the positions of the set at the end of the test period.&lt;/li&gt;&#xA;&lt;li&gt;Include transaction fees and slippage costs during the test period.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;To test the algorithm, the backtest system can:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Allow the algorithm to choose to buy one or all stocks on the first&#xA;test day.&lt;/li&gt;&#xA;&lt;li&gt;Loop the algorithm through time for until the last day of the testing&#xA;period.&lt;/li&gt;&#xA;&lt;li&gt;Include similar transaction fees and slippage costs during the test&#xA;period.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The profit percentage of the &quot;set test&quot; and &quot;algo test&quot; are recorded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &quot;set test profit&quot; is deducted from the &quot;algo test profit&quot; to rank the test.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;QUESTION 1: &lt;strong&gt;Should the algorithm be optimized to outperform the benchmark test&lt;/strong&gt; (rather than simply optimizing for the algorithm's profit)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;QUESTION 2:  &lt;strong&gt;What test results should be compared?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;A. Buying and selling the entire set VS. ALL the positions the algo&#xA;bought.&lt;/li&gt;&#xA;&lt;li&gt;B. Buying and selling the entire set VS. EACH individual position the&#xA;algo bought.[1]&lt;/li&gt;&#xA;&lt;li&gt;C. Buying and selling the set of stocks the blackbox bought VS. The&#xA;algo results.&lt;/li&gt;&#xA;&lt;li&gt;D. Buying THE stock the algo bought for the position VS. the algo&#xA;position result.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;QUESTION 3:  &lt;strong&gt;How should the profits of the tests be calculated?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;A. Buying and selling all positions on both the &quot;set test&quot; and &quot;algo&#xA;test&quot;.[2]&lt;/li&gt;&#xA;&lt;li&gt;B. Buying and selling the &quot;set test&quot; VS. Allowing the algo to keep&#xA;unsold stocks.&lt;/li&gt;&#xA;&lt;li&gt;C. Buying the set and selling stocks that end the algo test sold VS.&#xA;algo results.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="3185" LastActivityDate="2012-10-31T09:55:52.650" Title="Backtesting benchmark / control test design" Tags="&lt;backtesting&gt;&lt;benchmark&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4440" PostTypeId="1" CreationDate="2012-10-31T10:38:08.323" Score="8" ViewCount="4460" Body="&lt;p&gt;Since modeling leaves complete freedom we can assume both market and credit risks can enter the picture. However the minimum requirement is (migrations and) defaults simulation, how does this configure as &quot;pure&quot; market risk (especially in the latter IDRC case), as various people claim? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why would CVA be more credit-related than IRC? After all CVA is about prices and IRC about exposures and defaults (yeah, of course this is incorrect, but let's play the devil's advocate), even though they are both &lt;em&gt;motivated&lt;/em&gt; by adverse market moves. (Atleast Brigo calls them both credit risks iirc.) Is it simply because of spreads simulation? Or because we're patching a market risk measure? Or is there a more sound reason? And why isnt IRC just a liquidity-enhanced credit VaR?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been given very odd and contradictory answers, and wont state here my understanding of the issue to avoid introducing more confusion and hoping to hear a clear definition of the two risks. Which is not so easy given the blurring boundary.&lt;/p&gt;&#xA;" OwnerUserId="3015" LastEditorUserId="3015" LastEditDate="2012-11-01T08:56:22.090" LastActivityDate="2016-10-09T11:38:16.360" Title="What makes IRC a market risk?" Tags="&lt;credit-risk&gt;&lt;market-risk&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4441" PostTypeId="2" ParentId="3573" CreationDate="2012-10-31T11:10:00.367" Score="3" Body="&lt;p&gt;For the brokerage fee, consider coding a system that calculates the fees for several brokerages (so that you can compare brokerages).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the slippage (and other issues), consider coding that in as well. &#xA;Adjust prices based on the slippage percentage. Once you do that, you can vary the slippage and determine how much slippage will break your algo.&lt;/p&gt;&#xA;" OwnerUserId="3185" LastActivityDate="2012-10-31T11:10:00.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4442" PostTypeId="1" CreationDate="2012-10-31T12:47:10.283" Score="5" ViewCount="724" Body="&lt;p&gt;&lt;a href=&quot;http://www.quantwolf.com/calculators/recurrencetime.html&quot; rel=&quot;nofollow&quot;&gt;Coin Toss Runs Calculator&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The expected number of runs for two consecutive heads or tails is 3. Is there an edge if we place a progressive constant size bet(limited to 3 times)for consecutive appearance of H or T only after pattern HTH or THT appears, Or is &lt;code&gt;prob=0.5&lt;/code&gt; always?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say Dow is on a daily bar chart 'uptrend', i.e. 50MA above 100&amp;amp;200MA,&#xA;Is it a better to long (a day duration each time), e.g. mini-Dow futures until two days UP in a row the day after a 'Up,down,up' daily bar pattern occurred?&lt;/p&gt;&#xA;" OwnerUserId="3085" LastEditorUserId="3085" LastEditDate="2012-11-04T02:54:21.987" LastActivityDate="2012-11-04T02:54:21.987" Title="Coin Toss System" Tags="&lt;statistics&gt;&lt;modeling&gt;&lt;forecasting&gt;&lt;probability&gt;&lt;random-walk&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4443" PostTypeId="1" AcceptedAnswerId="4445" CreationDate="2012-10-31T15:06:00.073" Score="4" ViewCount="2289" Body="&lt;p&gt;I am new to the topic of &lt;a href=&quot;http://en.wikipedia.org/wiki/Asian_option&quot; rel=&quot;nofollow&quot;&gt;Asian options&lt;/a&gt;. Assume I want to price an Asian put (fixed strike, discrete average) in the Black Scholes world. I know implementations to calculate the value but what is the best way to find the implied volatility parameter? Is there a usual way to derive it from the option market of plain vanilla products, e.g. European calls or puts of a certain range of maturities?&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2021-04-20T10:36:21.793" Title="Implied Volatility for Asian option" Tags="&lt;implied-volatility&gt;&lt;exotics&gt;&lt;asian-option&gt;" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4444" PostTypeId="2" ParentId="4442" CreationDate="2012-10-31T16:00:49.173" Score="3" Body="&lt;p&gt;1) The probability of a H or T of any next coin toss (fair coin) is always 0.5 because coin tosses are independent of each other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Stock markets, or for that matter any asset, are an entirely different game. First of all the expectancy is not 0.5 of, for example, experiencing an up or down day tomorrow in a stock simply because the distribution is different and because stock prices exhibit a drift component. Additionally, financial asset returns and especially their volatility exhibit co-integration properties of varying degrees. Thus, it does not pay to compare coin toss expectancy with asset return expectancy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Changes in stock index levels as well as individual stock prices are the strict result of supply-demand imbalances and such imbalances are partly a function of varying and shifting sentiment on the macro side, industry sector side, and individual company side. Sometimes stock price imbalances can carry on for a prolonged period, at other times the market exhibits a strong drive to move the price back into what the market views as fair value regimes.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Such switches from momentum back to &quot;mean reversion&quot; and again back to momentum are what experienced traders are the most concerned with and attempt to assess in order to maximize the expectancy of their placed bets. I have not heard of long-term successful &quot;market operators&quot; to generate profits off the back of predicting what the next tick/bar/day is gonna be purely as a function of the up/down pattern of past returns. What I observed on the other hand makes a successful trader is the ability to assess as early as possible shifts in co-integration patterns after they occurred. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just my 2 cents. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2012-11-01T10:15:56.670" LastActivityDate="2012-11-01T10:15:56.670" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="4445" PostTypeId="2" ParentId="4443" CreationDate="2012-10-31T16:26:27.310" Score="3" Body="&lt;p&gt;The easiest way is to use single-expiry volatility that you would get from your volatility surface. It is usually good enough for government work (e.g. to get a sense if you are getting fleeced by a dealer or to understand your vega risk).&lt;/p&gt;&#xA;&lt;p&gt;A better way is to use local volatility model and the whole volatility surface up to the date of expiry. There is also a bunch of semi-analytical approximations that use weighted volatilities up to there expiry date. Unless you are a dealer and trying to quote these in competition, you don't need to bother with these.&lt;/p&gt;&#xA;" OwnerUserId="2906" LastEditorUserId="35546" LastEditDate="2021-03-05T12:02:58.003" LastActivityDate="2021-03-05T12:02:58.003" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="4447" PostTypeId="2" ParentId="2567" CreationDate="2012-10-31T23:50:28.083" Score="4" Body="&lt;p&gt;I think a simple solution is to try to construct a Brownian motion $W_t$ through known points (e.g., $W_0 = W_1 = 0$); it is also known as a Brownian Bridge [ &lt;a href=&quot;http://en.wikipedia.org/wiki/Brownian_bridge&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Brownian_bridge&lt;/a&gt; ].&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also question 3 in &lt;a href=&quot;http://www.math.nyu.edu/faculty/goodman/teaching/StochCalc2012/assignments/assignment4.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.math.nyu.edu/faculty/goodman/teaching/StochCalc2012/assignments/assignment4.pdf&lt;/a&gt; .&lt;/p&gt;&#xA;" OwnerUserId="3188" LastActivityDate="2012-10-31T23:50:28.083" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4450" PostTypeId="1" AcceptedAnswerId="4451" CreationDate="2012-11-01T04:43:15.233" Score="2" ViewCount="479" Body="&lt;p&gt;Does anyone know of any model to estimate the distribution of drawdown length and depth assuming a certain portfolio dynamics? The arcsine law seems to suggest that a portfolio can spend a large portion of time under water if it follows a Brownian motion. I am wondering whether there are research papers that generalize similar concepts under different assumptions of the dynamics. For example, what would be the expected time spent under water if a portfolio follows a GBM with mean mu and variance sigma?&lt;/p&gt;&#xA;" OwnerDisplayName="user2163" LastActivityDate="2012-11-01T05:10:21.883" Title="Expected length and depth of drawdown" Tags="&lt;portfolio-management&gt;&lt;drawdown&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4451" PostTypeId="2" ParentId="4450" CreationDate="2012-11-01T05:10:21.883" Score="0" Body="&lt;p&gt;Here you go, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://arxiv.org/pdf/cond-mat/9808295.pdf&quot; rel=&quot;nofollow&quot;&gt;http://arxiv.org/pdf/cond-mat/9808295.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cs.rpi.edu/~magdon/talks/mdd_NYU04.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.cs.rpi.edu/~magdon/talks/mdd_NYU04.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.intelligenthedgefundinvesting.com/pubs/rb-kwcmlr.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.intelligenthedgefundinvesting.com/pubs/rb-kwcmlr.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, you mentioned you make an assumption of the portfolio dynamics. That means you either have historical data available about your portfolio returns and standard deviation or you must be able to formulate a model of your specific portfolio under question that allows you to construct portfolio dynamics to be used in a monte carlo simulation. Either case, I strongly recommend you to look as closely as possible at the specific portfolio dynamics assumptions and go from there, because most likely you will never be able to even come close to mimic diversified asset portfolio dynamics with standard distributions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You mentioned in the end an example. If you assume your portfolio valuations follow a GBM then you can most easily construct a mc simulation. Hope this helps. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-11-01T05:10:21.883" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4452" PostTypeId="1" CreationDate="2012-11-01T12:45:53.723" Score="3" ViewCount="113" Body="&lt;p&gt;There's quite a bit of research (example, [1]) teasing out the fact that home/casual/individual investors prefer stocks with large positive skewness. It surprised me, as I was reading a bunch of these papers, that no point is made about whether casual investors like to hold stocks with high visibility characteristics (e.g. well known in news, large size, &quot;safe&quot;, &quot;blue chip&quot; stocks). My expectation is that there is a bias towards large stocks ... Just going off people in my family, but I would like to see a study of this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;: Are you aware of any empirical study that addresses this question?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;[1] Household Portfolio Diversification: A case for rank-dependent preferences, by Polkovnichenko (2005)&lt;/p&gt;&#xA;" OwnerUserId="3174" LastActivityDate="2012-11-01T12:45:53.723" Title="Individual/casual investors and the bias towards blue-chip stocks?" Tags="&lt;equities&gt;&lt;research&gt;&lt;market&gt;&lt;anomalies&gt;&lt;behavioral-finance&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4453" PostTypeId="2" ParentId="4419" CreationDate="2012-11-01T18:28:56.003" Score="6" Body="&lt;p&gt;Are you after the famous paper from Christie and Schultz?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Christie,W., Schultz,P., 1994. Why do NASDAQ market makers avoid odd-eighth quotes? Journal of Finance 49,1813–18 40.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;From the abstract:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;On May 26 and 27, 1994 several national newspapers reported the findings of Christie and Schultz (1994) who cannot reject the hypothesis that market makers of active NASDAQ stocks implicitly colluded to maintain spreads of at least $0.25 by avoiding odd-eighth quotes. On May 27, dealers in Amgen, Cisco Systems, and Microsoft sharply increased their use of odd-eighth quotes, and mean inside and effective spreads fell nearly 50 percent. This pattern was repeated for Apple Computer the following trading day. Using individual dealer quotes for Apple and Microsoft, we find that virtually all dealers moved in unison to adopt odd-eighth quotes. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2908" LastEditorUserId="35" LastEditDate="2012-11-02T13:57:39.127" LastActivityDate="2012-11-02T13:57:39.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4454" PostTypeId="2" ParentId="4406" CreationDate="2012-11-01T20:07:22.497" Score="2" Body="&lt;p&gt;You are confronted here in the common &quot;bottom-up&quot; or &quot;top-down&quot; problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think there is no final answer to your question, as both approach have their pros and cons.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the &quot;bottom-up&quot;, you first classify for each feature, then classify again. This give you the ability to get a better understanding of the decision of your algorithm by splitting the decision in 2 steps. However, as Marc Shivers explains in his answer, you will lose part of the precision the method could have once you have completed step one, and hence your algorithm can be less precise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the &quot;top-down&quot;, you straightaway run the SVM over the full set of parameters. The first advantage is that it is simpler, and it is the plain-vanilla way of applying the algorithm. A problem is that the algorithm might be tempted to overfit the data, i.e. to give you a solution that is &quot;too precise&quot;, and hence wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Choosing between &lt;em&gt;underfitting&lt;/em&gt; or &lt;em&gt;overfitting&lt;/em&gt; is very difficult. &lt;strong&gt;You should try both methods and really assess which ones performs the best in the conditions you are considering&lt;/strong&gt;. Indeed, the performance of a method can vary depending on the amount of data you have and other characteristic which are difficult to guess a priori. Andrew Ng provides a fantastic &lt;a href=&quot;https://class.coursera.org/ml-2012-002/lecture/index&quot; rel=&quot;nofollow&quot;&gt;online class&lt;/a&gt; on coursera where you can see different ways of evaluation your algorithm in chapter 10.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2012-11-01T20:07:22.497" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4455" PostTypeId="2" ParentId="1888" CreationDate="2012-11-02T05:15:44.723" Score="3" Body="&lt;p&gt;Martingale and Markov process are both stochastic processes where the sequences of random variables are not entirely independent, and their differences are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;In martingale, the expectation of the next value IS the present value, so this property is sometimes called 'fair game'.&lt;/li&gt;&#xA;&lt;li&gt;In Markov process, the expectation of the next value only DEPENDS ON the present value. In others words,  the future of the process is solely based upon the present state, not on the sequence of events that preceded it, so the Markov property is 'memoryless'.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In general, martingale does not imply Markov, and vice versa. &lt;/p&gt;&#xA;" OwnerUserId="2712" LastEditorUserId="848" LastEditDate="2012-11-02T06:34:24.243" LastActivityDate="2012-11-02T06:34:24.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4456" PostTypeId="1" CreationDate="2012-11-02T05:16:43.920" Score="7" ViewCount="1442" Body="&lt;p&gt;&lt;strong&gt;What I'm working with:&lt;/strong&gt;&#xA;I have a collection of prices that has very few to no repeating values (depending on the look back period) ie each price value is unique, some prices are clustered and some can be spread apart by great distances.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because there is only one count for each price, each price therefore has an equal probability weight.  This type of data produces a flat (pdf).  I'm looking for a curvy linear (pdf), so I can find levels of interest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&#xA;How do I construct a curvy-linear (p.d.f.) from data that have the same frequency/count and probability distribution of (1)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Potential Solutions:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1)  Some of the values are clustered, and they look like they could be grouped to generate an aggregate-frequency/count.&lt;br&gt;&#xA;I like this idea, but what technique do you use?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2)  I could use volume or ticks to weight the notional price value.&lt;br&gt;&#xA;For my work, I'm not  interested in the influence that volume or tick weighted distributions would have.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Recommendations of papers or other resources is greatly appreciated.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;@vanguard2k&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;First, I assume that your price data are all from the same asset but spread over a certain time range.&lt;/strong&gt;&#xA;Correct, all prices are from one symbol the S&amp;amp;P500 futures, intraday price.&#xA;As a first step you could make a histogram of your data. &#xA;It's because of the 'lack' of shape of my histogram (it's flat, like a rug plot) that I'm looking for a technique to tease out a curvy-linear (pdf).&#xA;Due to the infrequency of similar price values in my data set, the probability weight of any price is equal to all other price probability values, P($price)=1/sample qty.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My histogram looks similar to this wiki picture:&#xA;&lt;a href=&quot;http://upload.wikimedia.org/wikipedia/commons/thumb/4/4c/Fair_dice_probability_distribution.svg/200px-Fair_dice_probability_distribution.svg.png&quot; rel=&quot;noreferrer&quot;&gt;http://upload.wikimedia.org/wikipedia/commons/thumb/4/4c/Fair_dice_probability_distribution.svg/200px-Fair_dice_probability_distribution.svg.png&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;You could look into the topic of density estimation here.&lt;/strong&gt;&lt;br&gt;&#xA;I've spent the day reviewing your links, and the method of kernel density estimation (kde) looks promising.  But I don't completely comprehend how to construct a (kde).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've started a list of how to plot a (kde).&#xA;What steps have to be taken to implement a kernel density estimations with real world price examples?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Procedure?:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 Determine what type of partitioning/clustering method to apply to a financial time series (5 categories/methods: partitioning, hierarchical, density, grid-based, and model-based).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2 Apply the clustering technique to partition observations into groups.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3 Calculate a Practical Estimate of a kernel bandwidth, h = (1.06*StDev*qtySampled)¯¹/5, or MISE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4 Determine what kernel function to use (Epanechnikov, Quartic, Triangular, Gaussian, Cosine, etc)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5 Calculate a kernel density estimation for each price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;6 Sum the kernels to make the kernel density estimate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&#xA;Does the (kde) assign a probability value to the prices that were not in the price data set?&#xA;The first (kde) example image on Wikipedia suggest that it does.&#xA;&lt;a href=&quot;http://en.wikipedia.org/wiki/File:Comparison_of_1D_histogram_and_KDE.png&quot; rel=&quot;noreferrer&quot;&gt;http://en.wikipedia.org/wiki/File:Comparison_of_1D_histogram_and_KDE.png&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;If you dont have time series data but only price data and you want to cluster it (you are speaking of &quot;price level clusters&quot;) you should look into the topic of unsupervised learning.&lt;/strong&gt; &#xA;I don't understand the difference between 'time series data' and 'price data'?&lt;/p&gt;&#xA;" OwnerUserId="3196" LastEditorUserId="3196" LastEditDate="2012-11-05T18:32:40.490" LastActivityDate="2012-11-07T00:00:36.207" Title="How do you synthesize a probability density function (pdf) from equally weighted price data?" Tags="&lt;forecasting&gt;&lt;probability&gt;&lt;kernel&gt;&lt;cluster&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4457" PostTypeId="2" ParentId="2028" CreationDate="2012-11-02T07:41:54.483" Score="2" Body="&lt;p&gt;Even in a perfect world, a 3X leveraged ETF cannot achieve a compound return three times that of the underlying.  In the case of periodic discrete rebalancing, we call this effect the &quot;arithmetic of loss and recovery,&quot; but even in the limit of continuous rebalancing, this effect does not disappear.  Ito's formula tells us that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathrm d \log(S_\textrm{Index})=\sigma \mathrm d B +\left(\mu-\dfrac 1 2 \sigma^2\right).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming continuous rebalancing, and zero borrowing costs and other expenses,&#xA;$$\mathrm d \log(S_\textrm{3X Bull})= 3\sigma\mathrm d B + \left(3\mu-\dfrac 9 2 \sigma^2 \right).$$&#xA;Therefore the compound performance of a &quot;3X Bull&quot; ETF that &quot;perfectly&quot; tracks its index must be less than triple that of the underlying index by $3\sigma^2,$ where $\sigma^2$ is the variance (here equal to the quadratic variation per unit time interval) of the price process of the underlying index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if $\sigma=15\%/\textrm{yr}^{1/2}$, which is within the order of magnitude of that assumed for a general stock market index, then we are talking about a rather unavoidable performance shortfall (due strictly to the mathematics of volatility) of $3\sigma^2=6.75\%/\textrm{yr}$ in logarithmic terms for a triple-leveraged ETF.&lt;/p&gt;&#xA;" OwnerUserId="3106" LastActivityDate="2012-11-02T07:41:54.483" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4458" PostTypeId="2" ParentId="4456" CreationDate="2012-11-02T10:52:24.810" Score="3" Body="&lt;p&gt;First, I assume that your price data are all from the same asset but spread over a certain time range.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are looking for the distribution of the price of this asset on the real axis, you have plenty of methods (several fields in mathematics and statistics deal with this topic).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a first step you could make a &lt;a href=&quot;http://en.wikipedia.or/wiki/Histogram&quot; rel=&quot;nofollow&quot;&gt;histogram&lt;/a&gt; of your data. There you can see about the clusters you were talking about. It gives you a good impression of the distribution of the data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Answer to question&lt;/strong&gt;:There are lots of ways how to get a density out of your discrete dataset. You could look into the topic of &lt;a href=&quot;http://en.wikipedia.org/wiki/Density_estimation&quot; rel=&quot;nofollow&quot;&gt;density estimation&lt;/a&gt; here. The free software R (www.r-project.org) has lots of packages that helps you achieve this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally, in the case of time-dependent data (financial time series) you will soon realize other effects(&lt;a href=&quot;http://en.wikipedia.org/wiki/Time_series#Prediction_and_forecasting&quot; rel=&quot;nofollow&quot;&gt;see time series&lt;/a&gt;). One notices for example that the density changes over time (due to seasonality, for example). That still not being enough, a lot of (financial) time series appear to be dependent on the past (see for example the topic &lt;a href=&quot;http://en.wikipedia.org/wiki/Autocorrelation&quot; rel=&quot;nofollow&quot;&gt;autocorrelation&lt;/a&gt;). The approach to estimate a single density from the data is often not advisable as it changes over time! One tries to model the dependence of the data over time. It is therefore often necessary to speak of &quot;conditional density at time $t$&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you see, there is a lot you can do here and this is just a small sample of the possible methods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you dont have time series data but only price data and you want to cluster it (you are speaking of &quot;price level clusters&quot;) you should look into the topic of &lt;a href=&quot;http://en.wikipedia.org/wiki/Unsupervised_learning&quot; rel=&quot;nofollow&quot;&gt;unsupervised learning&lt;/a&gt;. But please be aware of possible changes of your results over time!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general all mentioned topics are widely used and interrelated. &#xA;I hope this answers your question (and I got the meaning of your question right) at least to &lt;em&gt;some&lt;/em&gt; extent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;EDIT:&lt;/em&gt; Just some remarks to the comments you posted in your question. I hope I found all of them:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;As far as the histograms are concerned: The &quot;art&quot; of nice histogramps partly depends on how you choose your intervals. If you take as interval length between 2 and 5 points of your futures contract (for example) you will get a different picture and you should be able to spot something that more resembles a density. You divide your price data in 5 point intervals and count how many of your price data are in each interval. Then you can say $5\% $of the data was between $1408$ and $1410$. I have to stress again here that it would be more than brave to say that there is a $5\%$ probability of future S&amp;amp;P-future values to lie in this interval!&lt;/li&gt;&#xA;&lt;li&gt;I am not sure how you should link the topics of clustering and density estimation here. For both topics you could definitely look into this resource: &lt;a href=&quot;http://www-stat.stanford.edu/~tibs/ElemStatLearn/&quot; rel=&quot;nofollow&quot;&gt;Elements of Statistical Learning&lt;/a&gt;. It is a free book and is widely used for teaching and learning of (but not only) these topics. &lt;/li&gt;&#xA;&lt;li&gt;Answer to &lt;em&gt;new&lt;/em&gt; question: The density estimation in your picture (or Fig. 6.13 of the book I mentioned) assigns a probability to every value - including those not in the dataset. Just that this is not a property of kernel density estimation in gereral but rather of the kernel used (here it is Gaussian).&lt;/li&gt;&#xA;&lt;li&gt;Difference between time series data and price data: In mathematics a random sample consists of indipendent random variables with identical distributions. There is overwhelming evidence that the distribution of financial returns varies over time and that they are not independent. Financial time series should not be viewed as random sample because they are neither independent nor identically distributed. That was what I wanted to say here.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2727" LastEditorUserId="2727" LastEditDate="2012-11-05T15:34:49.753" LastActivityDate="2012-11-05T15:34:49.753" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4459" PostTypeId="1" AcceptedAnswerId="4491" CreationDate="2012-11-02T14:23:35.240" Score="7" ViewCount="2048" Body="&lt;p&gt;Is there software (or Python / R / ... scripts) to generate (pseudo) tick data from candlestick data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have candlestick data (CSV format) from monthly timeframe (MN) to minute timeframe (M1) but time range can be different. Filenames are :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;SYMBOL1.csv&lt;/code&gt; for M1 timeframe (1 minute)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;SYMBOL5.csv&lt;/code&gt; for M5 timeframe (5 minutes)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;SYMBOL15.csv&lt;/code&gt; for M15 timeframe (15 minutes)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;SYMBOL30.csv&lt;/code&gt; for M30 timeframe (30 minutes)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;SYMBOL60.csv&lt;/code&gt; for H1 timeframe (1 hour)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;SYMBOL240.csv&lt;/code&gt; for H4 timeframe (4 hours)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;SYMBOL1440.csv&lt;/code&gt; for D1 timeframe (1 day)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;SYMBOL10080.csv&lt;/code&gt; for W1 timeframe (1 week)&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;SYMBOL43200.csv&lt;/code&gt; for MN timeframe (1 month)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I would like to feed software or script with every csv file.&#xA;I would like to give start datetime and end datetime and software will output a csv file with ticks data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ticks data will be generated from the longest timeframe to the shortest timeframe (if data exists). For example the software will output ticks data from M1 candlestick timeframe if data exists for the requested time interval. If there is no data in M1 timeframe, software will try to find data in M5 timeframe to generate ticks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that the generated ticks will be generated using interpolation (so they won't be exacts)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Such ideas are implemented in Metatrader Strategy Tester &lt;a href=&quot;http://www.metatrader5.com/en/terminal/help/tester/tester_using/tick_generation&quot;&gt;http://www.metatrader5.com/en/terminal/help/tester/tester_using/tick_generation&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ head _FRA401.csv &#xA;2010.11.16,08:01,3818.0,3820.0,3817.5,3820.0,41&#xA;2010.11.16,08:02,3820.0,3823.0,3801.0,3823.0,38&#xA;2010.11.16,08:03,3823.0,3825.0,3823.0,3823.5,28&#xA;&#xA;$ tail _FRA401.csv &#xA;2012.11.01,18:32,3477.0,3477.0,3474.0,3474.5,37&#xA;2012.11.01,18:33,3474.5,3476.0,3474.5,3475.5,25&#xA;2012.11.01,18:34,3475.5,3476.0,3471.5,3472.5,62&#xA;&#xA;$ head _FRA4043200.csv &#xA;2010.11.01,00:00,3818.0,3906.0,3589.5,3620.0,168480&#xA;2010.12.01,00:00,3629.0,3940.5,3618.5,3853.5,227760&#xA;2011.01.01,00:00,3848.0,4081.5,3605.5,4019.5,266725&#xA;&#xA;$ tail _FRA4043200.csv &#xA;2012.02.01,00:00,3310.5,3490.5,3305.5,3456.5,514738&#xA;2012.03.01,00:00,3441.0,3593.0,3343.0,3420.5,353738&#xA;2012.04.01,00:00,3428.0,3475.5,2974.5,3128.5,247351&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2838" LastActivityDate="2012-11-07T00:26:10.917" Title="Generate tick data from candlestick" Tags="&lt;data&gt;&lt;r&gt;&lt;python&gt;&lt;tick&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4460" PostTypeId="2" ParentId="4459" CreationDate="2012-11-02T18:03:10.373" Score="1" Body="&lt;p&gt;I do not know of anything that is already made and works out of the box, but I would recommend writing a small script in Python using &lt;a href=&quot;http://docs.python.org/2/library/csv.html&quot; rel=&quot;nofollow&quot;&gt;csv.reader&lt;/a&gt;, this would probably be as fast as trying to plug something on your csv, especially if your format is a bit exotic ?&lt;/p&gt;&#xA;" OwnerUserId="2908" LastActivityDate="2012-11-02T18:03:10.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4461" PostTypeId="1" AcceptedAnswerId="4463" CreationDate="2012-11-02T18:19:30.910" Score="5" ViewCount="1270" Body="&lt;p&gt;What is the role of quants in trade execution in high frequency trading? AFAIR in &quot;normal&quot; trading trade execution is considered a very mundane task. What role can quantitative modelling play in trade execution in HFT?&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2012-11-03T13:49:17.920" Title="Trade execution in HFT - role of quants" Tags="&lt;high-frequency&gt;&lt;order-execution&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4462" PostTypeId="2" ParentId="4459" CreationDate="2012-11-03T03:18:05.883" Score="4" Body="&lt;p&gt;You said:&quot;I understand that the generated ticks will be generated using interpolation (so they won't be exacts)&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are very optimistic, they will not only be far away from being exact, they (the tick data) will be completely removed from reality, the only parameters known for the tick data will be boundary conditions, such as open high low close. You make a completely wild guess about how many ticks each bar contains and where the market traded/quoted at which point in time within the limits of the candle open and close times and candle high and low. Of course you can do that and Python is most likely the best tool to get the job done quickly. (I recommend &lt;a href=&quot;http://pandas.pydata.org/&quot; rel=&quot;nofollow&quot;&gt;http://pandas.pydata.org/&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I highly question the usefulness of this approach. You obviously want to use the tick data for some sort of analysis or back test. However, the results will be completely random if you attempt to peruse such tick data for higher frequency analysis/back tests. If you are not interested in such high frequency testing then you should just stick to your (assumed) accurate compressed time series (1minute bars or what have you).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In summary I question the usefulness of generating higher frequency time series from lower frequency time series in general. The opposite obviously makes a lot more sense because you know exactly how 1-hour compressed data points look like from generating those from higher frequency time series such as 1-minute compressed data points. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just my 2 cents, feel free to elaborate what you want to use the generated tick data for, maybe I miss something here. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2012-11-03T10:19:58.827" LastActivityDate="2012-11-03T10:19:58.827" CommentCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="4463" PostTypeId="2" ParentId="4461" CreationDate="2012-11-03T03:33:23.297" Score="7" Body="&lt;p&gt;Re the first part of the question: Quants play no role whatsoever in the actual execution tasks of trading regardless of frequency or whether we talk systematic trading or not. Its done by traders/execution traders (especially on the discretionary side) and not by quants. As your title suggests your focus is on hft, I still would claim quants do not really monitor the execution of hft trades. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, on the hft side the definitions of quants and traders somewhat merge and the job description becomes somewhat opaque. On the hft side the whole life cycle of a trade on the systematic trading side is highly quantitative in nature and thus a deep knowledge of programming, execution venues, order types, optimizations and a lot more is required of all participating parties. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume you mean with quant a person who analyzes, profiles, and tests strategies and works together with programmers to implement trading strategies. Trading strategies can also mean a focus on an execution technique of cash equity on the Nasdaq exchange, for example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In summary, depending on your definition of &quot;quant&quot;, such practitioners are definitely closely involved in the development and implementation of hft execution algorithms, while they probably do not sit there to keep an eye on the actual executions and risk exposures I (it otherwise would be a huge inefficiency and under utilization of core talent). Though most all hft shops fully automatized risk monitoring, I have not come across a single shop who would not have managers and traders constantly monitor exposures and risk limits on top of the systematized risk checks. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2012-11-03T13:49:17.920" LastActivityDate="2012-11-03T13:49:17.920" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="4466" PostTypeId="1" AcceptedAnswerId="31218" CreationDate="2012-11-03T14:54:08.557" Score="9" ViewCount="10064" Body="&lt;p&gt;Suppose I downloaded the closing price of a company, say Google or whatever, I want to use GARCH model to model and forecast the volatility of the return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To simplify, I only have two questions. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;As we know, GARCH is used to predict volatility. But, after we get the new return(or price) data, how well is the GARCH prediction? Is there any quantitative method to evaluate this? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Once we decided to use GARCH(p,q), how do we choose the order p and q?(for example, if we choose (p,q)=(1,1), then why we do not choose(2,2) or whatever) &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;To be more specific,&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;If I use GARCH(1,1) to model the returns, how do we know that the result fit the real data very well? Is there any way to evaluate this thing? (Is this the goodness-of-fit problem? )&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;When I was thinking about the previous problem, a new one came to me. Suppose I use the ARMA-GARCH model to model the return data. ARMA is to model the return, and GARCH to model the volatility. In this way, how do we evaluate the fitted ARMA-GARCH result? Suppose I use the data up to last week to forecast the return and its volatility in this week. Then, I can use this week's price to calculate real return, and then compare with the predicted return by ARMA, to see how well it works. BUT, how do we know how well is the predicted volatility by GARCH???I mean, the return in this week is a random variable in the view of last week, and it has a standard deviation, which is the volatility, and we can use the GARCH to forecast it. However, after I know the real return in this week, it becomes a constant, and there is no volatility since there is no randomness. Thus, I do not have the real volatility...In this way, how do I evaluate the result of GARCH? I do not have a standard to compare with.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How do we determine the orders of GARCH. Once I download the data, how do I know whether I need to use ARMA(1,1)-GARCH(1,1) or ARMA(20,30)-GARCH(40,50)? Or, is there any theory or function in Matlab help us to do the selection?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3206" LastEditorUserId="3206" LastEditDate="2012-11-05T13:27:21.790" LastActivityDate="2016-11-27T19:30:42.960" Title="How do I evaluate the suitability of a GARCH model?" Tags="&lt;garch&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4467" PostTypeId="2" ParentId="4374" CreationDate="2012-11-03T18:09:03.097" Score="2" Body="&lt;p&gt;&lt;strong&gt;The Hurst value can be coded to plot values &gt;1.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example of how to tame Hurst values &gt;1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.ual.es/~jgarcia/index_archivos/HURST.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.ual.es/~jgarcia/index_archivos/HURST.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following Weron, once (2) is calculated, the Hurst exponent H will be 0.5 plus the slope of (R/S)n −E(R/S)n. However, if&#xA;we calculate this modified R/S analysis in this way, results show a Hurst exponent, for some random series, with &lt;strong&gt;values&#xA;higher than 1, which makes no sense&lt;/strong&gt;. For this reason, we have followed a different procedure than in Ref. [29]. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This&#xA;procedure lies in adding a final step to the classical R/S analysis which consist in calculating&lt;/p&gt;&#xA;&#xA;&lt;p&gt;log Hn = log (R/S)n − log E (R/S)n + log(n)/2&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where E (R/S)n is given by (2).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then find H by linear regression on&#xA;log Hn = log c + H log n. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(3)&#xA;The distribution for the Hurst exponent calculated as stated previously (which we will note by R/S-AL), resembles in this&#xA;case a normal one with a mean of 0.49 and a standard deviation of 0.04 (with n = 16). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the distribution of the&#xA;Hurst exponent calculated using standard R/S analysis cannot be approximated by a normal distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We would like to remark that since formula (2) was derived for the series with underlying normal distribution, modified&#xA;R/S analysis should be studied deeply to check its correctness for other series (for example, the series with Hurst exponent&#xA;different from 0.5).&lt;/p&gt;&#xA;" OwnerUserId="3196" LastActivityDate="2012-11-03T18:09:03.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4468" PostTypeId="2" ParentId="4374" CreationDate="2012-11-03T18:37:59.590" Score="-1" Body="&lt;p&gt;&lt;strong&gt;In every case only Whittle gives an estimation for Hurst which is always .99. Also the Periodogram estimates Hurst to be greater than 1&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://wisonets.wordpress.com/tag/stationary-process/&quot; rel=&quot;nofollow&quot;&gt;http://wisonets.wordpress.com/tag/stationary-process/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long-Range Dependence  in a Changing Internet Traffic Mix &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The concepts and definitions for self-similarity and long-range dependence given in section 1 assume that the time series of arrivals is  second-order stationary (a.k.a.  weakly stationary). Loosely speaking, this means that the variance of the time series (and more generally, its covariance structure) does not change over time, and that the mean is constant (so the time series can always be transformed into a zero-mean stochastic process by simply subtracting the mean). The obvious question this raises is whether Internet traffic  is stationary. This is certainly not the case at the scales in which the time-of-day effects are important (traffic sharply drops at night), so Internet traffic is usually characterized as self-similar and long-range dependent only for those scales between a few hundred milliseconds and a few thousand seconds. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the UNC link showed an increase in traffic intensity during morning hours as more and more people become active Internet users. However, it is still useful to study time series using the self-similarity and long-range dependence framework, and this is possible using methods that are robust to non-stationarities in the data (i.e., methods that first remove trends and other effects from the data to obtain a second-order stationary time series). &lt;strong&gt;In some cases, non-stationarities are so complex, that conventional models fail to accommodate them, which can result in estimates of the Hurst parameter greater than or equal to 1.&lt;/strong&gt;  We examine some of these cases in section 5.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The wavelet-based tools for analysis of time series  are important because they have been shown to provide a better estimator (and confidence intervals) than other approaches for the Hurst parameter [14].  These methods also are robust in the presence of certain non-stationary behavior (notably linear trends) in the time series. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;SiZer provides a useful method for finding statistically significant local trends in time series and is especially useful for finding important underlying structure in time series with complex structure.  SiZer is based on local linear smooths of the data, shown as curves corresponding to different window widths in the top panel of Figure 4 (a random sample of time series values is also shown using dots).  These curves are very good at revealing potential local trends in the time series, and provide a visualization of structure in the time series at different scales, i.e. at different window widths used for smoothing.  See [10] for an introduction to local linear smoothing.  Two important issues are: which of these curves (i.e., scales) is the right one, and which of the many visible trends (at a variety of different scales) are statistically significant (thus representing important underlying structure) as opposed to reflecting natural variation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Summary: This paper provide an insight into the Sizer tool which can used to detect tends in the traffic. however, I need to look further into this paper and see how actually this tool be used. there is also an indication that trends can be the part of the analysis. but i am a bit confused here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wavelet Analysis  of Long-Range-Dependent Trafﬁc &#xA;Patrice Abry and Darryl Veitch&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can be implemented very efﬁciently allowing the direct analysis of very large data sets, and is highly robust against the presence of deterministic trends, as well as allowing their detection and identification. &#xA;There are always come conflicting studies regarding the nature of independence in the dataset. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Statistical Methods for Data with Long-Range Dependence&#xA;by Jan Beran&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;A Practical Guide to Measuring the Hurst Parameter&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Richard G. Clegg&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This paper describes, in detail, techniques for measuring the Hurst parameter. Measurements are given on artificial data both in a raw form and corrupted in various ways to check the robustness of the tools in question. Measurements are also given on real data, both new data sets and well-studied data sets. All data and tools used are freely available for download along with simple “recipes” which any researcher can follow to replicate these measurements.&#xA;2Measuring the Hurst Parameter&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While the Hurst parameter is perfectly well-defined mathematically, measuring it is problematic. The data must be measured at high lags/low frequencies where fewer readings are available. Early estimators were biased and converged only slowly as the amount of data available increased. All estimators are vulnerable to trends in the data, periodicity in the data and other sources of corruption. Many estimators assume specific functional forms for the underlying model and perform poorly if this is misspecified. The techniques in this paper are chosen for a variety of reasons. The R/S parameter, aggregated variance and periodogram are well-known techniques which have been used for some time in measurements of the Hurst parameter. The local Whittle and wavelet techniques are newer techniques which generally fare well in comparative studies. All the techniques chosen have freely available code which can be used with free software to esti- mate the Hurst parameter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problems with real-life data are worse than those faced when measuring artificial data. Real life data is likely to have periodicity (due to, for example, daily usage patterns), trends and perhaps quantisation effects if readings are taken to a given precision. The naive researcher taking a data set and running it through an off-the-shelf method for estimating the Hurst parameter is likely to end up with a misleading answer or possibly several different misleading answers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Various techniques are tried to filter real-life traces in addition to making measurements purely on the raw data. These methods have been selected from the literature as commonly used by researchers in the field. Often in such cases, a high pass filter would be used to remove periodicity and trends, however, since LRD measurements are most important at low-frequency that is an obvi- ously inappropriate technique. The techniques used to pre-process data before estimating H are listed below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• Transform to log of original data (only appropriate if data is positive). &#xA;• Removal of mean and linear trend (that is, subtract the best fit line Y = at + b for constant a and b). &#xA;• Removal of high order best-fit polynomial of degree ten (the degree ten was chosen after higher degrees showed evidence of over-fitting). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long-Range Dependence: Now you see it, now you don’t! &#xA;By Thomas Karagiannis CSE Dept., UC Riverside tkarag@cs.ucr.edu&#xA;Michalis Faloutsos CSE Dept., UC Riverside michalis@cs.ucr.edu&#xA;Rudolff H. Riedi ECE Dept., Rice University riedi@rice.edu&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This paper is very good in illustrating the possible difficulties that one may face in realizing the real goals of achieving LRD and SS. Some of the main focus of this paper are:&#xA;Not one single estimator is good in estimating LRD. for example, Whittle although provides robust result. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;All of most of the estimator wrongly judge Hurst value in case of periodicity present in the data. The results are obscure by the presence of such signal. &#xA;Using interpolation one can smooth the time series that is affected by missing data, removal outliers etc. &#xA;It is very important to remove the periodic component. This can be done by processing and decomposing the signal. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Authors recommend to plot the signal at various scales to reveal different characteristics. &#xA;Over the last few years, the network community has started to make heavy use of novel concepts such as self- similarity and Long-Range Dependence (LRD). Despite their wide use, there is still much confusion regarding the identifi- cation of such phenomena in real network traffic data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this paper, we show that estimating Long-Range Dependence is not straightforward: there is no systematic or definitive methodol- ogy. There exist several estimating methodologies, but they can give misleading and conflicting estimates. More specifically, we arrive at several conclusions that could provide guidelines for a systematic approach to LRD. First, long-range dependence may exist even, if the estimators have different estimates of the Hurst exponent in the interval 0.5-1. Second, long-range dependence is unlikely to exist, if there are several estimators that fail to es- timate the Hurst exponent. Third, we show that periodicity can obscure the analysis of a signal giving partial evidence of long- range dependence. Fourth, &lt;strong&gt;the Whittle estimator is the most accurate in finding the exact value when LRD exists, but it can be fooled easily by periodicity.&lt;/strong&gt; As a case-study, we analyze real round-trip time data. We find and remove a periodic component from the signal, before we can identify long-range dependence in the remaining signal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To extract the useful information from the raw RTT data, we applied typical time series methodologies like, interpola- tion to recover from loss (so that our signal would not have discontinuities), removal of outliers and smoothing. Ap- plying the estimators in the RTT signal, resulted in non- consistent estimations, in the sense that some of the estima- tors showed long-range dependence for some of our datasets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The evaluation of each estimator is achieved through three different Fractional Gaussian Noise (FGN) generators. FGN generators are often used to synthesize long-range depen- dence series with a specific Hurst value. The first is devel- oped by Paxson [12], while the second is described in [13]. The third is based in the Durbin-Levinson coefficients. Due to space limitation, we only present results from the genera- tor developed by Paxson. However, findings are similar for the other two generators.&#xA;We show that the estimators are quite sensitive and can be deceived to report LRD. In particular we apply the esti- mators in synthesized signals such as cosine functions with noise or signals that show trend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The definition of LRD assumes stationary sig- nals. In this case, we intend to identify the impact of non-stationarity on the estimators. Thus, we created various signals with slow and fast decaying or increas- ing trends. Such signals include combination of White Gaussian Noise and cosine functions with trend. &lt;strong&gt;In every case only Whittle gives an estimation for Hurst which is always .99. Also the Periodogram estimates Hurst to be greater than 1.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A reporting of the Hurst exponent is meaningful, only if it is accompanied by the method that was used, as well as the confidence intervals or correlation coefficient.&#xA;•Researchers should not rely only on one estimator in deciding the existence of long-range dependence (e.g. [14]). As we saw, several of the estimators (Whittle, Pe- riodogram) can be overly optimistic in identifying long- range dependence.&#xA;•For efficient characterization, it may be necessary to process and decompose the signal.&#xA;•A visual inspection of the signal can be very useful, pro- viding a qualitative analysis and revealing many of its features, like periodicity. We recommend plotting the signal at several different scales, since each scale can reveal different characteristics.&lt;/p&gt;&#xA;" OwnerUserId="3196" LastEditorUserId="3196" LastEditDate="2012-11-03T18:45:49.303" LastActivityDate="2012-11-03T18:45:49.303" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4470" PostTypeId="1" AcceptedAnswerId="4472" CreationDate="2012-11-03T21:10:55.943" Score="-4" ViewCount="4094" Body="&lt;p&gt;European call options with strikes 90, 100 and 110 on the same underlying asset and with the same maturity are trading for 22.50, 18.84 and 13.97 respectively. show that the convexity of the call price as a function of the strike is violated, hence leading to an arbitrage opportunity. Describe in detail a trading strategy that makes a riskless profit.&lt;/p&gt;&#xA;" OwnerUserId="3209" LastEditorUserId="35" LastEditDate="2012-11-19T15:44:02.433" LastActivityDate="2012-11-19T15:44:02.433" Title="Show that convexity of call price as a function of the strike is violated" Tags="&lt;options&gt;&lt;risk&gt;&lt;arbitrage&gt;&lt;strategy&gt;" AnswerCount="1" CommentCount="3" ClosedDate="2012-11-04T13:52:03.257" ContentLicense="CC BY-SA 3.0" />
  <row Id="4471" PostTypeId="1" CreationDate="2012-11-03T21:47:38.937" Score="2" ViewCount="282" Body="&lt;p&gt;When you strip your rate curves using CSA, what kind of convexity effects might appear as a result when computing the CSAed curve from one fixing to another ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example if you are valuing an USD trade collateralised in EUR LIBOR 3M, is there an effect caused by the correlation between the FX rates you use to convert the forward cashflows and the discount factors in the EUR fixings used for collateral ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there is, how can you take it in account ?&lt;/p&gt;&#xA;" OwnerUserId="2908" LastEditorUserId="20454" LastEditDate="2017-10-09T15:48:23.607" LastActivityDate="2017-10-09T15:48:23.607" Title="Do taking in account the CSA create convexity effects in your stripping?" Tags="&lt;convexity&gt;&lt;collateral&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4472" PostTypeId="2" ParentId="4470" CreationDate="2012-11-03T22:35:12.670" Score="2" Body="&lt;p&gt;The price of payoff is &lt;a href=&quot;http://en.wikipedia.org/wiki/Convex_function&quot; rel=&quot;nofollow&quot;&gt;convex&lt;/a&gt; if for every $0\le\lambda\le 1$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V(\lambda K_1 + (1-\lambda)K_3 )\le \lambda V(K_1) + (1-\lambda)V(K3)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;, where $V(K)$ is the price of an option with strike $K$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We want that $\lambda K_1 + (1-\lambda)K_3 = K_2$. Solving it for $\lambda$ we get $\lambda=0.5$. Substituting $\lambda$ back to our inequality, we see that the convexity property doesn't hold.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We see that the portfolio of options with strike $K_1$ and $K_3$ is too cheap. Therefore, we can form an arbitrage portfolio by purchasing 0.5 of $K_1$-strike options and 0.5 of $K_3$-strike options. To finance this purchase we sell one option with strike $K_2$. By checking the payouts of our portfolio for stock prices $S$ in intervals $S&amp;lt;K_1,K_1\le S &amp;lt; K_2, K_2 \le S&amp;lt; K_3$ and $S \ge K_3$ we convince ourselves that this is indeed an arbitrage opportunity.&lt;/p&gt;&#xA;" OwnerUserId="370" LastActivityDate="2012-11-03T22:35:12.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4473" PostTypeId="2" ParentId="4471" CreationDate="2012-11-03T22:47:24.120" Score="2" Body="&lt;p&gt;Yes, because you're entering into an implicit currency swap. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There was an article in &quot;Risk&quot; some time ago on this topic: &lt;a href=&quot;http://www.risk.net/risk-magazine/technical-paper/1935412/choice-collateral-currency&quot; rel=&quot;nofollow&quot;&gt;http://www.risk.net/risk-magazine/technical-paper/1935412/choice-collateral-currency&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2012-11-03T22:47:24.120" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4474" PostTypeId="1" AcceptedAnswerId="4485" CreationDate="2012-11-04T04:01:17.307" Score="1" ViewCount="1011" Body="&lt;p&gt;$\hat{\epsilon}'\hat{\epsilon}$ from the market model: $R_{it} - \hat{\alpha} - \hat{\beta}R_{mt} = \hat{\epsilon}$, or from a factor model such as the Fama-French 3 factor model, is often used in the literature to capture the idiosyncratic risk of stock $i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What risk is this measuring? Who cares if the disturbances are high variance? All this means is that you've excluded relevant factors from your specification of the returns generating process, right? Or does its interpretation as &quot;risk&quot; come from an a priori assumption that the returns generating process has been correctly specified?&lt;/p&gt;&#xA;" OwnerUserId="3174" LastEditorUserId="3174" LastEditDate="2012-11-04T13:20:56.540" LastActivityDate="2012-11-05T08:40:51.163" Title="Why does $\hat{\epsilon}'\hat{\epsilon}$ of a factor model measure risk?" Tags="&lt;volatility&gt;&lt;time-series&gt;&lt;risk&gt;&lt;beta&gt;&lt;market-model&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4477" PostTypeId="1" AcceptedAnswerId="4481" CreationDate="2012-11-04T07:14:37.447" Score="1" ViewCount="1564" Body="&lt;p&gt;Can someone explain to me why the delta-hedging of ATM options near expiry is difficult?&lt;/p&gt;&#xA;" OwnerUserId="3209" LastEditorUserId="35" LastEditDate="2012-11-13T19:55:50.973" LastActivityDate="2012-11-13T19:55:50.973" Title="Why is delta-hedging of ATM options near expiry difficult to do?" Tags="&lt;hedging&gt;&lt;finance&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ClosedDate="2012-11-04T13:53:55.347" ContentLicense="CC BY-SA 3.0" />
  <row Id="4481" PostTypeId="2" ParentId="4477" CreationDate="2012-11-04T08:54:29.837" Score="6" Body="&lt;p&gt;This is usually called &lt;a href=&quot;http://en.wikipedia.org/wiki/Pin_risk_%28options%29&quot; rel=&quot;noreferrer&quot;&gt;Pin Risk&lt;/a&gt;. It's difficult because there is a high degree of uncertainty regarding the whether the options you sold are exercised or not. If you don't hedge, your short options could be exercised and you are left with risky net short position in the underlying. If you hedge and your short options are not exercised, then you have a long position in underlying after expiry. Alternatively, you can partially hedge. However, in any case, you are potentially exposed to risk of adverse underlying movement.&lt;/p&gt;&#xA;" OwnerUserId="370" LastActivityDate="2012-11-04T08:54:29.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4485" PostTypeId="2" ParentId="4474" CreationDate="2012-11-05T07:45:47.177" Score="3" Body="&lt;p&gt;I think one should look at the problem from two different angles to get an answer to this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Firstly, you can look (as you said you did) look at $\hat{\epsilon}$ in terms of a &lt;em&gt;disturbance&lt;/em&gt; like you said, meaning the returns $R_{it}$ are depending linearly on the $R_{mt}$ - the market or factor returns. Then you can figure there is some regression involved an the theory of linear regression assumes the model like you stated it above where $\hat{\epsilon}$ is some disturbance with a normal distribution with mean $0$. So in order to find your true parameters $\hat{\alpha}$ and $\hat{\beta}$ you take a look at the &lt;em&gt;disturbed&lt;/em&gt; data and fit a line through it so that the vector of the remaining &lt;em&gt;disturbances&lt;/em&gt; (residuals) is minimized with respect to its sum of squares ($\ell^2$-norm).&#xA;So the more your returns $R_i$ resemble your market returns $R_m$, the smaller the disturbances are according to your model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly, you can look at the problem from a more practical viewpoint. We say that the asset returns $R_{it}$ are some returns of a markets assets. Take a stock which is a constituent of a stock index with the stock index returns being $R_{mt}$. Now one wants to know which part of the variance corresponds to the market risk and which part of the variance corresponds to the stocks individual properties (idiosyncratic risk caused by earnings quality, debt ratios or whatelse you can think of - just not your other factors ;-) ). Since one often assumes market risk and idiosyncratic risk to be uncorrelated you can decompose the stocks variance: &#xA;$$ \sigma_{i}^2 = \sigma_{m}^2 + \sigma_{id}^2 $$&#xA;where $\sigma_{id}^2=\hat{\epsilon}^\prime\hat{\epsilon}$.&#xA;The more the $R_i$'s resemble your market ($R_m$'s), the smaller the idiosyncratic risk will be. One speaks of the idiosyncratic risk as being &lt;em&gt;diversified away&lt;/em&gt; when this happens.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastEditorUserId="2727" LastEditDate="2012-11-05T08:40:51.163" LastActivityDate="2012-11-05T08:40:51.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4486" PostTypeId="2" ParentId="4466" CreationDate="2012-11-05T17:25:37.230" Score="9" Body="&lt;p&gt;The general procedure is to start out simple, real simple, and build your model up only as necessary.  AR(q), q=0 to start with.  Test the lagged autocorrelations of the error terms, and increase q until they are no longer significant.  Test for ARCH, and if it's significant, you have an ARCH(q) model.  Then move on with GARCH(1,q), GARCH(2,q), and when the GARCH errors are no longer significant you have GARCH(p,q) where increasing p or q would have little additional explanatory power.  Perhaps you could even reduce q with GARCH as compared to ARCH.  Test and see if it's significant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Every one of these models has standard tests for errors.  Test and make sure it's &lt;em&gt;significant&lt;/em&gt; each time before you throw in a new effect or increase the order of the model.  This is somewhat subjective; it's not a canned procedure.&lt;/p&gt;&#xA;" OwnerUserId="3106" LastActivityDate="2012-11-05T17:25:37.230" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4488" PostTypeId="1" AcceptedAnswerId="4489" CreationDate="2012-11-06T17:24:24.317" Score="6" ViewCount="840" Body="&lt;p&gt;Are there any methods of prediction (machine learning, regression, etc.) which are designed to maximize the rank correlation (spearman correlation, kendall's tau, etc.) of your prediction with your independent variable?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to predict a continuous numerical variable with a given set of inputs, and I am more concerned that the rank-correlation of predictions is high than the pearson correlation.&lt;/p&gt;&#xA;" OwnerUserId="2118" LastActivityDate="2012-11-06T18:53:28.977" Title="Rank Correlation Based Prediction" Tags="&lt;correlation&gt;&lt;learning&gt;&lt;machine&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4489" PostTypeId="2" ParentId="4488" CreationDate="2012-11-06T18:30:21.523" Score="3" Body="&lt;p&gt;The simplest way is to transform your dependent variable from returns into rank-space and then use ordinary least squares regression. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A more complex technique would involve setting up an optimization problem where you maximize the spearman correlation between your vector of predictions and actuals. More explicitly, the objective function in the optimizer is the spearman rank correlation function. The optimizer will search over the set of parameters to some model specification (for example, if you use a linear factor model it will identify a set of betas) that maximize the spearman correlation. Of course, there are many potential model specifications so this approach is a bit open ended.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another simple approach would be to use a &lt;a href=&quot;http://www2.cs.uregina.ca/~dbd/cs831/notes/lift_chart/lift_chart.html&quot; rel=&quot;nofollow&quot;&gt;cumulative gains and lift chart&lt;/a&gt; to select amongst competing regression models. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or you can use a discrete dependent variable to attempt to predict which quantiles an instrument is likely to fall within. A simple example would be to develop a logistic regression model where you predict 1 or 0 (let's say 1 means Up, and 0 means down). Then you can use the probability outputs generated when you score data using your logistic model to rank-order your predictions (vs. using regression outputs which may be more sensitive to outliers).&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="1800" LastEditDate="2012-11-06T18:53:28.977" LastActivityDate="2012-11-06T18:53:28.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4490" PostTypeId="2" ParentId="4456" CreationDate="2012-11-07T00:00:36.207" Score="2" Body="&lt;p&gt;One simple approach is&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Construct the cumulative probability function (CDF), which will be a step-function.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Smooth the CDF; for example, by using splines or a kernel smoothing function.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Calculate the slope of the smoothed CDF, giving a curvy linear PDF.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In R, this could be done using the ecdf function and one of the kernel smoothers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Again, as vanguard2k warned, this procedure assumes your distribution is stationary over time.&lt;/p&gt;&#xA;" OwnerUserId="37" LastActivityDate="2012-11-07T00:00:36.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4491" PostTypeId="2" ParentId="4459" CreationDate="2012-11-07T00:26:10.917" Score="2" Body="&lt;p&gt;We've done this before (*), but it is trivial: one tick for open, one tick for high, one tick for low, one tick for close. For tick timestamps, open is 08:01:00, close is 08:01:59.999, high is 08:01:20 and low is 08:01:40.&#xA;(Or if that gives strange results, open is 08:01:00.001 and close is 08:02:00.000; it depends how your system makes bars.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want volume to match too, then create N-4 ticks at the mean of open and close, and space out the ticks evenly throughout the minute. You could interpolate a straight line from open to close if you want; you could also set all N-4 ticks equal to high, etc. All choices are fabrications, so it doesn't matter which you choose. I like to fix at the mean, as anyone looking at it will instantly know it is artificial data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;*: This was with a system where we could only patch outages and backfill historical data with tick data; that system would then make the intraday bars. I.e. we couldn't patch intraday bars directly.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you want it to look like real ticks, because your trading algorithm is only designed to work from the ticks, then you start with straight line interpolation from open to close, then jitter them. Then filter to make sure none exceed high and low, and then choose two ticks to be the high and low and alter their values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another variation, specific to R, is to put in the open/close ticks, and use NA for all the others. Then choose 2 ticks randomly to be high and low. Then use R's na.approx or na.spline function. Then jitter. Then filter for high and low again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If doing this, I strongly suggest you make multiple data sets, each with a different random seed, and run your backtest on each data set. If different data sets get different results, your algorithms are sensitive to the random noise you've introduced. (I.e. your results are meaningless and you need to go and buy real tick data!) &lt;/p&gt;&#xA;" OwnerUserId="1587" LastActivityDate="2012-11-07T00:26:10.917" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="4492" PostTypeId="1" AcceptedAnswerId="4495" CreationDate="2012-11-08T07:39:31.330" Score="3" ViewCount="10449" Body="&lt;p&gt;I am trying to calculate the Hurst Exponent using Excel. I am facing a problem where the exponent value sometime goes beyond 1. Can someone share a link / material so that it will help me to calculate accurate values using Excel.&lt;/p&gt;&#xA;" OwnerUserId="926" LastEditorUserId="1355" LastEditDate="2012-11-08T13:28:30.480" LastActivityDate="2020-04-07T20:58:41.027" Title="Hurst Exponent Calculation" Tags="&lt;statistics&gt;&lt;mathematics&gt;&lt;quantitative&gt;&lt;hurst-exponent&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4495" PostTypeId="2" ParentId="4492" CreationDate="2012-11-08T13:44:42.020" Score="5" Body="&lt;p&gt;A detailed description of the Hurst Exponent can be found &lt;a href=&quot;http://www.bearcave.com/misl/misl_tech/wavelets/hurst/index.html&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;. A further (rather short search of Google) turned up &lt;a href=&quot;http://jonathankinlay.com/index.php/2011/03/long-memory-and-regime-shifts-in-asset-volatility/volatility-and-nonlinear-dynamics-2/&quot; rel=&quot;noreferrer&quot;&gt;this site&lt;/a&gt; claiming to provide an Excel Workbook with, among other things, Hurst Exponent estimation.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2012-11-08T13:44:42.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4496" PostTypeId="1" CreationDate="2012-11-09T01:39:11.983" Score="10" ViewCount="3060" Body="&lt;p&gt;Is there a version of Girsanov theorem when the volatility is changing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example Girsanov theorem states that Radon Nikodym (RN) derivative for a stochastic equation is used to transform the expectation where the sampling is done in one mesaure to an expectation  where sampling is done in another measure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's see an example&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dX_t(w) = f(X_t(w))dt + \sigma(X_t(w))dW_t^P(w)$ in P measure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In P* measure, drift is $f^{*}(X_t(w))$. We multiply the internals of expectation in P measure with RN derivative to get expectation of X in P* measure&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E^{P^*}[X] = E^P[X \frac{dP^*}{dP}]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{dP^*}{dP}=e^{-0.5 \int (\frac{ f^{*}(X_s(w)) - f(X_s(w))}{\sigma(X_s(w))})^2ds + \int \frac{ f*(X_s(w)) - f(X_s(w))}{\sigma(X_s(w))} dW_s^P(w)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I am looking for is in P* measure, not only drift but also the volatility changes&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dX_t(w) = f^{*}(X_t(w))dt + \sigma^{*}(X_t(w))dW_t^P(w)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then what is $\frac{dP^*}{dP}$?&lt;/p&gt;&#xA;" OwnerUserId="1215" LastActivityDate="2012-12-08T22:07:43.127" Title="Version of Girsanov theorem with changing volatility" Tags="&lt;risk-neutral-measure&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4497" PostTypeId="1" AcceptedAnswerId="4501" CreationDate="2012-11-09T04:28:10.567" Score="1" ViewCount="131" Body="&lt;p&gt;Something that's bugged me since I've ever learned anything about finance: Philosophically(?) speaking, why does growth subtract from a perpetuity's return?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know the &lt;i&gt;mathematical&lt;/i&gt; explanation, but it's so counter-intuitive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why should a perpetuity with 0% expected growth be valued at the same proportion as one with high growth when holding the natural (risk free) rate constant?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe if one uses the stock market as a transposition, you see that P/Es are higher with higher expected growth companies, reducing the net rate, explaining the $r - g$  in the denominator, but what about a natural rate of $X$ and a growth rate $g &amp;gt; X$?  So, we're supposed to get paid for the privilege of holding this asset now?&lt;/p&gt;&#xA;" OwnerDisplayName="user3232" LastEditorUserId="1355" LastEditDate="2012-11-09T14:13:29.557" LastActivityDate="2012-11-09T22:10:21.790" Title="Exposition of Growth in a Perpetuity" Tags="&lt;valuation&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4498" PostTypeId="1" AcceptedAnswerId="4508" CreationDate="2012-11-09T04:47:47.277" Score="2" ViewCount="233" Body="&lt;p&gt;I want to group Mutual Funds by their volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally, I would like to end up with the mutual funds beings attached to different groups:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;High volatility&lt;/li&gt;&#xA;&lt;li&gt;Medium volatility&lt;/li&gt;&#xA;&lt;li&gt;Low Volatility&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;My questions is : &lt;em&gt;What numbers could be consider like low , medium , high volatility ?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe some intervals: 0 -5 % is low 5 - 15% is Medium and Higher is High......&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm  little bit confused on how to tackle this problem...&lt;/p&gt;&#xA;" OwnerUserId="3233" LastEditorUserId="467" LastEditDate="2012-11-11T10:23:45.673" LastActivityDate="2012-11-11T10:51:11.267" Title="How to group mutual funds by volatility?" Tags="&lt;volatility&gt;&lt;returns&gt;&lt;machine-learning&gt;&lt;cluster&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="4500" PostTypeId="2" ParentId="4101" CreationDate="2012-11-09T06:21:21.283" Score="1" Body="&lt;p&gt;DV01 is your cash exposure to a BP change. Once you have €45 and €25 as DV01s for Bobl and Euribor respectively, you simply divide the two to figure out your DV01 neutral position sizes. In my particular example buy 180 Euribors to sell 100 Bobls for no raw duration risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also choose weighing schemes that account for varying  volatilities and correlations of the two rates. For example Bobl rates are currently more volatile than Euribor, hence the hedge ratio will be closer to 200 ER for 100 Bobls.&lt;/p&gt;&#xA;" OwnerUserId="3237" LastActivityDate="2012-11-09T06:21:21.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4501" PostTypeId="2" ParentId="4497" CreationDate="2012-11-09T08:30:22.993" Score="2" Body="&lt;p&gt;I think the formula you refer to is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ PV=\frac{C}{r-g} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that's the case, then you do not &lt;em&gt;subtract&lt;/em&gt; growth, the minus sign has an advantage on the present value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The initial formula $PV=\frac{C}{r}$ assumes no evolution in $C$, but the other one assumes the that the payment will grow in time hence yes, you get paid for that.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2012-11-09T08:30:22.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4503" PostTypeId="1" CreationDate="2012-11-09T03:47:21.600" Score="27" ViewCount="18686" Body="&lt;p&gt;Does anyone have an explanation for the currently naturally forming volatility smile (and the variations) in the market?&lt;/p&gt;&#xA;" OwnerDisplayName="user5850" LastEditorDisplayName="user3232" LastEditDate="2013-02-13T13:54:07.760" LastActivityDate="2019-09-12T19:58:23.667" Title="How do you explain the volatility smile in the Black-Scholes framework?" Tags="&lt;black-scholes&gt;&lt;implied-volatility&gt;" AnswerCount="6" CommentCount="4" FavoriteCount="20" ContentLicense="CC BY-SA 3.0" />
  <row Id="4505" PostTypeId="2" ParentId="4503" CreationDate="2012-11-09T17:55:46.150" Score="6" Body="&lt;p&gt;The volatility smile is made out of &lt;strong&gt;implied&lt;/strong&gt; volatilities. This means that you take as input $K,S,r,T$ and the price of the option $p$ and you use it to find $\sigma$ such that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ p = BS(K,S,r,T,\sigma)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But $p$ is defined by the market, so the $\sigma$ you find are the estimated volatilities by market participants, &lt;strong&gt;if they believe in the Black Scholes framework&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The shape of the graph (a smile) shows that, in the BS framework, market participants estimate different volatilities for a same asset depending on the moneyness of the option. This means that the BS framework does not hold in reality (at least market participants don't believe in it), as for the same asset, it assumes that $\sigma$ is constant.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2012-11-09T17:55:46.150" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4506" PostTypeId="2" ParentId="4503" CreationDate="2012-11-09T19:30:01.727" Score="7" Body="&lt;p&gt;The Black-Scholes model is based on the assumption of lognormal returns of the underlying asset.  There is much evidence and argument that stock market returns are not normal on a logarithmic basis, and there is no particular reason to assume a normal distribution, either.  In particular an implied volatility smile is evidence of &quot;fat tails&quot; in the returns expected by market participants---excess kurtosis, if you will.  It's been pointed out by Taleb that with over 100 years of history, we simply don't have enough data to estimate the tails or the higher moments of the distribution of stock market returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: in R:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; library(&quot;moments&quot;)&#xA;&amp;gt; SPX &amp;lt;- read.csv(&quot;http://ichart.finance.yahoo.com/table.csv?s=%5EGSPC&amp;amp;d=10&amp;amp;e=10&amp;amp;f=2012&amp;amp;g=d&amp;amp;a=10&amp;amp;b=10&amp;amp;c=1992&amp;amp;ignore=.csv&quot;)&#xA;&amp;gt; kurtosis(diff(log(SPX$Adj.Close)))&#xA;[1] 11.36604&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That's for the last twenty years less a day of data, and does not include the crash of 1987.  For a normal distribution, we would expect the kurtosis to be 3.  The excess kurtosis in this case is $11.36604-3=8.36604$, which is still quite significantly not normal.  Excess kurtosis means that a distribution has a more peaked center and fatter tails than a normal distribution, which means in the case of options a higher probability that the underlying will take on values far away from its current value come expiration time.  This is why, when excess kurtosis is not taken into account, options further from the money appear to imply a higher volatility for the underlying asset.&lt;/p&gt;&#xA;" OwnerUserId="3106" LastEditorUserId="3106" LastEditDate="2012-11-10T01:02:19.770" LastActivityDate="2012-11-10T01:02:19.770" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4507" PostTypeId="2" ParentId="4503" CreationDate="2012-11-10T12:11:52.247" Score="11" Body="&lt;p&gt;Implied volatility has very little to do with any particular pricing model, especially not much with BS. BS is a translation tool between prices and volatility, with its own many model deficiencies. I won't get into such model assumptions because my point is an entirely different one. Even the smile/smirk is entirely unrelated to the Black-Scholes model and I read your question that you like to understand why IVs, far from the money, are higher than close to the money ones. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My point is that IVs are entirely supply and demand driven. Whether its the IVs of an option that expires a year from now or tomorrow, whether its the IV of a 90 put (equity option), 30 delta strike (fx), or any other rates option, commodity option, what have you...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Someone correctly pointed out that most of the origin of the smile/smirk can be traced back to the October 1987 shock ( &lt;a href=&quot;http://en.wikipedia.org/wiki/Black_Monday_(1987&quot;&gt;http://en.wikipedia.org/wiki/Black_Monday_(1987&lt;/a&gt;) )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before pretty much all IVs regardless of moneyness were priced equally. However, the market after the stock market crash found that primarily downside protection was priced way too cheaply. Now I guess the core of the question is why: Most can be attributed to those who generally wrote such options such as sell-side trading desks but especially also floor traders who made markets in such options. They suffered steep losses and found out that they were not enough compensated for writing options such deep out of the money. &lt;strong&gt;It has to do with the fact that the market under-estimated the probability of such extreme events happening.&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, another important finding that causes many market makers to trade IVs far away from the money higher than at the money ones has to do with the belief that &lt;strong&gt;return volatility far away from current price levels tends to be a lot higher than current return volatility&lt;/strong&gt;. For example, return volatility is expected to be higher at 20% lower market levels than current return volatility. I guess the rational behind that is in a sense a paradox: Nobody generally would need to care about an instantaneous move 10% or so lower from current levels, thus in a sense it does not matter which implied volatilies are attached to a 90 put. However, should the unexpected happen than the expectation is for sharply higher return volatility 10% below current levels. Keep in mind the smile/smirk is dynamic and only reflects current expectations. I have seen on numerous occasions &quot;inverted smirks&quot; in equity index and stock options in that out of the money calls exhibited higher IVs than out of the money puts. But generally in this asset class space out of the money puts exhibit higher IVs than equally spaced out of the money calls. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another point that supports this general shape of the &quot;smirk&quot;  is that empirically stock markets exhibit much higher down-side return volatility than up-side return volatility. Panic and fear in a sense causes more irrational behavior in people than exuberance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, in summary, all has to do with how the market prices the probability of shocks (to the down and upside) occurring and their severity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Please keep in mind that most all IVs away from current spot/forward levels exhibit the property of being more richly priced than ATM IVs. On the call side this is the case because nowadays options are often utilized as leveraged bets instead of buying the underlying outright. Put IVs that are struck below current spots/forwards are bought more aggressively because of the desire to protect long positions in the underlying (buy-side fund industry especially). IVs away from the money are simply more demanded than ATM ones because of the above reasons. I recommend you do not read a whole lot more into it than this because trading volatility in the end of the day is nothing else than trading any other asset, prices are set as a pure function of supply and demand, the only difference is that most underlying assets exhibit linear pay off functions where as volatility is non-linear in nature and market participants can exactly define how this non-linearity is structured by trading different strikes or option combinations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Research suggests that there is a relationship between how pronounced the smirk is and future return expectations in the underlying. This hardly surprises me because in a sense it reinforces what I explained above in that people either protect with down side puts if they expect the underlying to exhibit future negative returns and equally buy upside calls (often as a leveraged bet instead of the underlying) if they expect future returns in the underlying to be positive, hence the smile = higher IVs away from the money. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2012-11-12T02:59:19.657" LastActivityDate="2012-11-12T02:59:19.657" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4508" PostTypeId="2" ParentId="4498" CreationDate="2012-11-11T10:18:02.213" Score="3" Body="&lt;p&gt;What you are looking for is an &lt;a href=&quot;http://en.wikipedia.org/wiki/Unsupervised_learning&quot; rel=&quot;nofollow&quot;&gt;unsupervised learning&lt;/a&gt; algorithm algorithm: i.e an algorithm that will by itself determine the 3 most rational groups from your dataset. This method will allow you to choose the boundaries of the groups based on the dataset you provide and not by choosing some given fixed values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The algorithm I suggest you to use is the &lt;a href=&quot;http://en.wikipedia.org/wiki/K-means_clustering&quot; rel=&quot;nofollow&quot;&gt;K-means&lt;/a&gt; algorithm. You provide it with the data, and the number $k$ of clusters (groups) that you want to have. The algorithm will then split the data into the $k$ groups you would like. Note that this algorithm can handle points with several features, whereas you will be using only one (volatiliy).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an idea of how it works in Matlab:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;test=[0 1 2 3 100 105 98 1000 1001 997]';&#xA;[idx,C] = kmeans(test,3);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The value returned for &lt;code&gt;idx&lt;/code&gt; is a vector where each point in &lt;code&gt;test&lt;/code&gt; is attributed a cluster number (representing its group):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;idx =&#xA;&#xA; 2&#xA; 2&#xA; 2&#xA; 2&#xA; 3&#xA; 3&#xA; 3&#xA; 1&#xA; 1&#xA; 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can then look at the variable &lt;code&gt;C&lt;/code&gt; which contains the mean of each cluster which could be undrestood as &quot;the perfect point for each cluster&quot;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;c =&#xA;&#xA;  999.3333&#xA;  1.5000&#xA;  101.0000&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So it found three groups in &lt;code&gt;test&lt;/code&gt; one around 999.33, one around 1.5, and one around 101.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That should do the trick.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2012-11-11T10:51:11.267" LastActivityDate="2012-11-11T10:51:11.267" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4509" PostTypeId="2" ParentId="141" CreationDate="2012-11-11T12:34:35.303" Score="6" Body="&lt;p&gt;Miscellaneous data, extending back hundreds of years in some cases, is available from &lt;a href=&quot;http://www.globalfinancialdata.com/index.html&quot; rel=&quot;noreferrer&quot;&gt;Global Financial Data&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="252" LastActivityDate="2012-11-11T12:34:35.303" CommentCount="0" CommunityOwnedDate="2012-11-11T12:34:35.303" ContentLicense="CC BY-SA 3.0" />
  <row Id="4512" PostTypeId="1" AcceptedAnswerId="4527" CreationDate="2012-11-12T08:51:25.503" Score="2" ViewCount="1054" Body="&lt;p&gt;I am trying to solve the Portfolio Optimization Problem using a &quot;Multi-objective Evolutionary Algorithm&quot;. After obtaining the efficient frontier, I would like to know if we can infer for each point of the efficient frontier the corresponding risk tolerance parameter (which is related to the investor's preference). Thanks. &lt;/p&gt;&#xA;" OwnerUserId="3248" LastEditorUserId="3248" LastEditDate="2012-11-14T04:13:15.540" LastActivityDate="2012-11-14T15:35:50.233" Title="Is it possible to derive the &quot;risk tolerance&quot; from the portfolio efficient frontier?" Tags="&lt;risk&gt;&lt;modern-portfolio-theory&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4513" PostTypeId="1" AcceptedAnswerId="4517" CreationDate="2012-11-12T09:21:05.930" Score="7" ViewCount="2214" Body="&lt;p&gt;I have few questions about using OAS as a measure of risk:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;does OAS allow for comparison between bonds with and without embedded options (e.g. a callable bond against a plain vanilla one against a floating rate one)?&lt;/li&gt;&#xA;&lt;li&gt;Is the OAS of plain vanilla bond equal to its Z-Spread?&lt;/li&gt;&#xA;&lt;li&gt;If 'yes', building an OAS curve to compare all issuer's bonds having same seniority  is a correct way to seek cheap vs. expensive bonds?&lt;/li&gt;&#xA;&lt;li&gt;We know that $\frac{\Delta P}{P}\cong-\frac{D}{(1+y)}\Delta y+\frac{1}{2}C(\Delta y)^{2}$, where $D$ and $C$ are bond's Duration and Convexity, while $y$ stands for yield; if one uses Option Adjusted Duration/Convexity, is he allowed to use this second order approximation to estimate bond's price variation?&lt;/li&gt;&#xA;&lt;li&gt;If you have a callable bond, is Delta the risk neutral probability the issuer will call its bond?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;" OwnerUserId="3058" LastActivityDate="2012-11-12T17:09:43.453" Title="About Option Adjusted Spread, rate curves and bonds comparison" Tags="&lt;fixed-income&gt;&lt;derivatives&gt;&lt;yield-curve&gt;&lt;spread&gt;&lt;embedded-options&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4515" PostTypeId="1" CreationDate="2012-11-12T15:16:37.367" Score="4" ViewCount="1042" Body="&lt;p&gt;&lt;strong&gt;Cointegration trading question&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the state of the art when it comes to choosing proper subsets of stocks/assets where cointegrating relationships aren't ignored as (likely to be) spurious? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, we wouldn't want to trade a Chinese stock of a fast food franchise with an Australian mining company because a cointegrating relationship could too easily be due to a type I error. But you might want to trade two Australian mining stocks because they share risk factors, reducing the probability that your cointegrating relationship is spurious. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the best way to approach this? Informed opinions welcome. &lt;/p&gt;&#xA;" OwnerUserId="3174" LastActivityDate="2012-12-16T03:06:48.950" Title="Cointegration trading: Ignoring pairs that aren't economically related" Tags="&lt;equities&gt;&lt;quant-trading-strategies&gt;&lt;cointegration&gt;&lt;pairs-trading&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4517" PostTypeId="2" ParentId="4513" CreationDate="2012-11-12T17:09:43.453" Score="5" Body="&lt;p&gt;The answer to your first four questions is affirmative.  Option-adjusting the spread makes an equivalence between everything theoretically possible, but the quality of results depends significantly on the quality of your interest rate model and its calibration.  My personal opinion, though, is that the results need to be treated carefully because the OAS model does not (typically) include stochastic credit spreads and potential capital structure changes, and therefore tends to underprice the embedded options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a bond with a single call date, Delta would be the risk-neutral exercise probability, but that situation is nearly nonexistent.  Since the interest rate model used for OAS can easily compute the exercise probability alongside valuation, you should just use the model to get it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are not computing OAS yourself, you are probably working with pretty pathetic numbers because most commercial sources are poorly calibrated (I'm looking at you, Bloomberg).&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-11-12T17:09:43.453" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4518" PostTypeId="2" ParentId="4503" CreationDate="2012-11-12T17:28:13.863" Score="18" Body="&lt;p&gt;Consider a more financially plausible model than Black-Scholes: one where the stock can suddenly go bankrupt due to fraud, and the volatility varies over time.  Neither model is perfect, but the new one (call it SVJ) will be &quot;less wrong&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mathematically, we no longer have the Black-Scholes SDE based on a single stochastic generator $W$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{dS}{S} = \mu dt + \sigma dW&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but rather an SDE with 3 generators: $W,Z$ and a jump process $J$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{dS}{S} = \mu dt + \sigma dW - dJ \\&#xA;d\sigma^2= \kappa(\bar{\sigma}^2-\sigma^2) dt + \eta \sigma^2 dZ&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is possible (though not particularly easy) to fit this more complicated, realistic model to the market.  Big banks do it all the time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any model, including both BS and SVJ, can be run &quot;backwards&quot;, by which I mean that it can &lt;em&gt;start&lt;/em&gt; with an option price and derive an &lt;em&gt;implied&lt;/em&gt; parameter.  If the model has $M$ parameters $p_1, p_2, \dots, p_M$ that are normally used to find a model price $V$, then we can also choose any one of the parameters, call it $p_n$, to derive from an observed price $P$ (normally by root-finding techniques).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say we run backwards from market prices to get implied values of $\sigma$ for both Black-Scholes and SVJ.  You will observe a far flatter skew for the SVJ.  This is true even if we remove either the jumps $J$ or stochastic volatility $Z$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, for example, is a skew in Black-Scholes volatilities arising from pricing an array of options in a proprietary jump-diffusion model with flat (by strike) volatility of 20%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/336Ll.png&quot; alt=&quot;Jump-implied skew&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We see that a constant volatility parameter in the jump-diffusion is equivalent to a skew of Black-Scholes volatilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Conclusion: the smile comes from the model being too strong a simplification of reality.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2014-02-10T18:32:02.833" LastActivityDate="2014-02-10T18:32:02.833" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4519" PostTypeId="2" ParentId="4496" CreationDate="2012-11-12T17:56:59.000" Score="0" Body="&lt;p&gt;The Girsanov theorem applies to any compatible change of measure, including a volatility change.  The version you have written above is a simplified version for drift changes only, but if you look in any good stochastic calculus book, you will see that full version just requires that you be able to compute the cross-variation of the two processes.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-11-12T17:56:59.000" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4521" PostTypeId="1" CreationDate="2012-11-13T11:39:56.727" Score="2" ViewCount="122" Body="&lt;p&gt;I'm hoping that someone can lend a hand. I have been reading various papers on how to combine multiple forecast time series. The main paper is Granger and Bates 1969. The suggestion here is that there is a closed form solution for combining independent forecast time series (eg returns on FTSE).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm hoping someone can shed some light on a query I have. Most of these papers suggest a budget constraint of 1, meaning that if I have two forecast time series and wish to combine them to make a superior forecast time series then it will have the form CombinedForecast = k * Forecast1 + (1-k) * Forecast2. In other words the combined forecast is a linear combination of individual forecasts such that the coefficients (ie (k) and (1-k)) sum to 1. Intuitively this doesn't make sense to me, despite being common across many papers on combining forecasts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have prepared an Excel example which will hopefully highlight the problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://sdrv.ms/RszqML&quot; rel=&quot;nofollow&quot;&gt;http://sdrv.ms/RszqML&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will notice I have two prediction time series being Pred1 and Pred2. Each of these has zero bias and the two are independent of each other. The TS time series is the time series we wish to predict. You can ignore the Err column.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, given Pred1 and Pred2 are predictions of TS, literature would expect that the optimal weightings should be 0.5 and 0.5. However if we use solver to find W1 and W2 to minimise MSE we find that the optimal weightings sum to 1+1=2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm sure there is something obvious that I am overlooking here. Why should the sum of all prediction weightings be 1?&lt;/p&gt;&#xA;" OwnerUserId="3254" LastActivityDate="2012-11-13T11:39:56.727" Title="Combining Mulitple Forecasts? Budged Constraints?" Tags="&lt;forecast&gt;" AnswerCount="0" CommentCount="10" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4522" PostTypeId="1" CreationDate="2012-11-13T15:23:29.163" Score="3" ViewCount="303" Body="&lt;p&gt;I have rather a challenging question.  I'm hoping that someone can share their experience.  I will build up the problem in steps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's start our thinking with the idea of a buy and hold strategy of an stock whose returns are expected to be 10% (annualised) in excess of the market and a standard deviation of 20% (annualised).  If we have £1000 to invest, Chan suggests an optimal leverage to maximise expected growth of mean/stdev^2 = 0.10/0.04 = 2.5 times.  In other words we should borrow £1500 to invest along with our £1000 in order to get the best growth.  Yes there is a chance that this may blow up so in reality we may choose a smaller multiple such as half of that.  So far so good.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ok, so now let's consider the next step.  We have just hired a guru quant who believes that each day he can provide an estimate of the next day's mean and standard deviation of returns.  Assuming there are no transaction costs, it actually simulates well if we use our same formula of mean/stdev^2 to resize each day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ok, next we discover that we need to pay a transaction cost of 2bp on any changes we make to position size.  This condition actually changes things substantially.  Clearly in this case we don't want to be chopping and changing our position size too much otherwise it will get expensive quickly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We think about the problem for a while and decide that in order to beat this, we need to look further into the future, not just at the next bar's forecast.  We give our guru quant a payrise and he's able to now not just give us an estimate for the mean and stdev of the next bar, but also n bars ahead, all the way out to N days.  Each day he gives us N mean predictions and N stdev predictions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question becomes, how do we optimally size based on this information?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One simple solution is each day to examine the mean and standard deviation predictions at each of N bars in the future.  For each we calculate the Sharpe Ratio, ie mean/stdev, for each incorporating transaction costs and chose the highest.  We then trade this in quantity mean/stdev^2 for that duration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="3254" LastEditorUserId="3196" LastEditDate="2012-11-13T19:54:44.547" LastActivityDate="2012-11-13T19:54:44.547" Title="Optimal Position Size with Transaction Costs given Forecast Mean and StDev" Tags="&lt;position-sizing&gt;&lt;money-management&gt;&lt;transaction-costs&gt;&lt;forecast&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4524" PostTypeId="1" CreationDate="2012-11-14T02:17:45.597" Score="3" ViewCount="883" Body="&lt;p&gt;The &lt;a href=&quot;http://en.wikipedia.org/wiki/Root_mean_square_deviation&quot; rel=&quot;nofollow&quot;&gt;root mean squared error (RMSE)&lt;/a&gt; is &lt;a href=&quot;https://research.mbs.ac.uk/accounting-finance/Portals/0/docs/2006/patton_robust_apr06.pdf&quot; rel=&quot;nofollow&quot;&gt;considered by some to be the best measure of how good a variance estimate is&lt;/a&gt;.  You often see it quoted as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$RMSE=\sqrt{\frac{1}{n}\sum_{i=1}^n(\hat{\sigma_i} - \sigma_i)^2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $\hat{\sigma}$ is the estimate of the volatility while $\sigma$ is the actual volatility.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: what is $\sigma$ in this case?  Suppose that $\hat{\sigma}$ is the prior day's realized volatility (i.e. $RV = \sum_{t=0}^N r_t$ where $r_t$ is the 5-minute return), is the actual volatility just the next day's absolute return?&lt;/p&gt;&#xA;" OwnerUserId="3257" LastActivityDate="2020-09-06T06:04:05.450" Title="Measuring unbiased estimator for variance with RMSE?" Tags="&lt;volatility&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4525" PostTypeId="2" ParentId="3778" CreationDate="2012-11-14T05:17:04.360" Score="3" Body="&lt;p&gt;You might want to take a look at the &lt;a href=&quot;http://www.waterstechnology.com/buy-side-technology/news/2221586/buyside-technology-awards-2012-the-winners&quot; rel=&quot;nofollow&quot;&gt;Waters Technology buy side technology awards&lt;/a&gt;, especially for &lt;a href=&quot;http://en.wikipedia.org/wiki/Execution_management_system&quot; rel=&quot;nofollow&quot;&gt;execution management systems&lt;/a&gt; (EMS).  Most hedge funds want to use multiple counterparties so they would want a broker-neutral trading system.  As far as I'm aware, the most popular platforms are &lt;a href=&quot;http://www.portware.com/&quot; rel=&quot;nofollow&quot;&gt;Portware&lt;/a&gt; and &lt;a href=&quot;http://www.flextrade.com/&quot; rel=&quot;nofollow&quot;&gt;Flextrade&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2012-11-14T05:17:04.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4526" PostTypeId="2" ParentId="1903" CreationDate="2012-11-14T10:18:23.380" Score="4" Body="&lt;p&gt;One could say that a CDS price is determined by the physical default probability and the risk premium.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The physical PD (PPD) is the actual probability of company defaulting within the given period of time. It is purely a theoretical concept as no one really knows what this probability is. We could estimate it using some models or credit ratings, but those are just guesses.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, if you'd known a PPD precisely you'd be able to calculate a break-even CDS price. If you write a lot of CDSs at break-even prices (on different underlyings), some will be triggered, some won't - but on average you will not make or lose money.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, there is no point in doing this. So you would actually add a margin to each break-even price, so that you will make money on average (again assuming that PPDs are perfectly known to you). This margin is exactly the risk premium.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In reality, you are financially constrained. If all underlyings default you'll have to default yourself. If you are responsible you'll make your best to ensure this risk is tiny.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the real world there's peer pressure. If you are a CEO of a company A and you see the company B is getting tons of money by writing CDSs you can start thinking along the lines of &quot;Why are we not doing it already?&quot;. Best case you'll make money and become a great CEO, worst case you'll get your golden parachute...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Getting back to the original question. If you use credit ratings to calculate physical PDs you will find that a lot of variation in CDS prices is due to changes in risk premiums. Is it actually the case or is it that the credit ratings-based PDs are inaccurate and do not reflect all the information available up to date?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Risk premium filtered in such a way are not easily explained by other macroeconomic or financial indicators. For instance, it is highly correlated with VIX, but still is quite different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a valid area in academic research in Finance. You could check &quot;Measuring Default Risk Premia from Default Swap Rates and EDFs&quot; by Berndt, Douglas et. al. There are slides and the paper itself online (look for the latest versions).&lt;/p&gt;&#xA;" OwnerUserId="3258" LastEditorUserId="3258" LastEditDate="2012-11-14T11:08:47.733" LastActivityDate="2012-11-14T11:08:47.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4527" PostTypeId="2" ParentId="4512" CreationDate="2012-11-14T15:35:50.233" Score="3" Body="&lt;p&gt;Strictly speaking the risk aversion coefficient depends on the form of investor preferences. Your &quot;multi-objective evolutionary algorithm&quot; may or may not be easy to place in this format. However, it becomes easy if you think about the risk aversion coefficient in mean/variance space if you were a mean-variance variance investor. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case you would have utility $$U\left(w\right)\equiv w'\mu-\frac{1}{2}\lambda w'\Sigma w&#xA; $$ with the first order condition $$\mu-\lambda\Sigma w=0$$ multiplying both sides by $w'$ and solving for $\lambda$ gives $$\lambda=\frac{w'\mu}{w'\Sigma w}=\frac{\mu_{p}}{\sigma_{p}^{2}}&#xA; $$ or that the implied risk aversion coefficient given portfolio holdings if you were a mean-variance investor is the ratio between the portfolio mean to portfolio variance.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2012-11-14T15:35:50.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4528" PostTypeId="1" CreationDate="2012-11-15T16:16:36.810" Score="3" ViewCount="3193" Body="&lt;p&gt;I am trying to price a  30 yr bond maturing in December 15, 2035.  The bond is rated A- (S&amp;amp;P).  Where can I find the spreads for corporate bonds rated A- maturing in 23 years (December 2035)?  I have access to Bloomberg, but so far all I was able to find was individual bond yields.  Is the 23 yr corporate spread available?  Lastly, just to be sure.  I use the 23 year spread + 23 treasury, and not the 30 year for a bond maturing in 2035?&lt;/p&gt;&#xA;" OwnerUserId="3262" LastActivityDate="2017-05-16T21:31:44.350" Title="Where can I find corporate bond spreads?" Tags="&lt;fixed-income&gt;&lt;spread&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4529" PostTypeId="1" AcceptedAnswerId="4533" CreationDate="2012-11-15T17:06:19.967" Score="3" ViewCount="757" Body="&lt;p&gt;Let $\gamma$ be the expected return, in terms of its exponential growth rate, of the market asset.  If we set $\gamma=\mu-\sigma^2/2$ as explained by the &lt;a href=&quot;http://en.wikipedia.org/wiki/Dol%C3%A9ans-Dade_exponential&quot; rel=&quot;nofollow noreferrer&quot;&gt;Doléans-Dade exponential&lt;/a&gt;, then the expected return of a balanced portfolio with fraction $\beta$ invested in the market asset, and the remainder lent or borrowed at risk-free rate, is $$R = r_f + \beta(\mu-r_f) - \beta^2\sigma^2/2.$$  I have plotted $R$ against $\beta$ in the following chart,&#xA;&lt;img src=&quot;https://i.stack.imgur.com/EG6v7.png&quot; alt=&quot;plot1&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where for purposes of the chart $r_f=0.04$, $\gamma=0.13$, and $\sigma=0.2$.  I know this effect is not my imagination, because Fernholz and others have quantified the &quot;excess returns&quot; of a balanced portfolio (where the green line lies above the red line) in their framework of &quot;stochastic portfolio theory&quot;, and I myself have noticed this and alluded to it in my answer to &lt;a href=&quot;https://quant.stackexchange.com/questions/2028/how-to-calculate-compound-returns-of-leveraged-etfs&quot;&gt;How to calculate compound returns of leveraged ETFs?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Risk aversion notwithstanding, I find it absurd to think that unlimited expected gains are available simply by being highly leveraged in the market.  So why does the CAPM use a straight line as if this were the case?&lt;/p&gt;&#xA;" OwnerUserId="3106" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2012-11-15T19:43:21.267" Title="Why is the CAPM securities market line straight?" Tags="&lt;stochastic-calculus&gt;&lt;modern-portfolio-theory&gt;&lt;capm&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4530" PostTypeId="1" AcceptedAnswerId="4538" CreationDate="2012-11-15T17:36:19.583" Score="2" ViewCount="567" Body="&lt;p&gt;Me and a friend is trying to settle and argument in relation to the following quote by Nassim Nicholas Taleb: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I don’t want to spend too much time on Buffett. George Soros has 2 million times more statistical evidence that his results are not chance than Buffett does. Soros is vastly more robust. I am not saying Buffett doesn’t have skill—I’m just saying we don’t have enough evidence to say Buffett isn’t doing it by chance.&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I told him I would rather go with a guy who did 10 000 small good calls than 10 large good calls given that their return history was the same, to which he replied that this reasoning has no basis in maths, finance logic etc. Is he right, or is there a rigorous way of showing that a strategy that has a larger sample size of &quot;decisions made&quot; is more robust to potentially being lucky?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sorry if this is off-topic.&lt;/p&gt;&#xA;" OwnerUserId="1128" LastActivityDate="2012-11-17T21:14:17.390" Title="Proof that the number of trades done (successfully) matters for whether or not a strategy was lucky" Tags="&lt;probability&gt;&lt;strategy&gt;" AnswerCount="4" CommentCount="4" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4531" PostTypeId="2" ParentId="4529" CreationDate="2012-11-15T17:42:39.220" Score="0" Body="&lt;p&gt;The CAPM is just a model, not the truth nobody believes it.  So you shouldn't apply it blindly. As a model it is useful but it has larger defects than this.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2012-11-15T17:42:39.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4532" PostTypeId="2" ParentId="4529" CreationDate="2012-11-15T17:47:38.667" Score="0" Body="&lt;p&gt;It is straight line because it is defined by y=mx+c equation. No other reason. It is not adequate and certainly something that you can to gain infinite returns. You want to make a model that accounts for convexity like you have , or use a multi factor model like Fama French or your own model which is evolving and is a N factor polynomial function ,please do so . Only reason why a linear approximation is used is because it is simple and sort of works. You can read about fama french model  &lt;a href=&quot;http://en.wikipedia.org/wiki/Fama%E2%80%93French_three-factor_model&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; . &lt;/p&gt;&#xA;" OwnerUserId="1386" LastActivityDate="2012-11-15T17:47:38.667" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4533" PostTypeId="2" ParentId="4529" CreationDate="2012-11-15T19:43:21.267" Score="1" Body="&lt;p&gt;The efficient frontier should be expressed in terms of arithmetic returns since only these returns can account for cross-sectional aggregation. Hence, if you assume the log returns of the risky portfolio are $X_{p} \sim N(\mu,\sigma^{2})$, then you first have to convert it to log-normal moments before combining it with the risk-free rate, $r_{f}$. However, it should be noted that while the median equals the mean for the normal distribution, that is not the case for the log normal distribution. Hence, the median arithmetic return will not show the same linear relationship against the standard deviation that the mean does. Similarly, if using CVaR as a measure of risk, then the risk will increase by even more as leverage increases due to the non-normality of the log normal distribution.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2012-11-15T19:43:21.267" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4534" PostTypeId="2" ParentId="4515" CreationDate="2012-11-15T21:25:14.240" Score="1" Body="&lt;p&gt;Simple pairs trading yield is falling every year. It is now at the level when &quot;spurious&quot; cointegration cases become a last resort. &lt;/p&gt;&#xA;" OwnerUserId="2297" LastEditorUserId="467" LastEditDate="2012-11-15T23:05:22.237" LastActivityDate="2012-11-15T23:05:22.237" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4535" PostTypeId="1" AcceptedAnswerId="4537" CreationDate="2012-11-15T21:49:51.100" Score="9" ViewCount="14994" Body="&lt;p&gt;What kind of rate of return can an average, equities-focused algorithmic trading firm expect to achieve today?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I come from a background of control and optimization, working in the industry in China, but I also work with a team to do investments and trading on the side.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In our market, which has a very different set of rules, it seems that the most profitable investment strategies are medium-term in time horizon. The yearly rate of return, for skillful private investors with several million USD, can be about 50% or so, but this number does, of course, vary from year to year.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recently a trader working at an investment bank, with a mixed background working with investment funds and as a quant developing high-frequency trading models, tried to persuade us to try algorithmic trading in the western markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;He claims that with several million USD's investment he can achieve a yearly return rate of 100% in the US stock market with the strategies he developed recently.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just want to know if this is possible? I know his algorithm is quite different than those that can be found in the published journal papers on finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although this seems to be OK (I doubt any good strategies will ever be published and we sure won't publish ours), but he failed to explain his strategies in much detail. From his point of view this is understandable, but it has certainly created a lot of doubt on our part.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One detail I learned from talking with him is that his method involves event-driven trades and requires a lot of text-mining.&lt;/p&gt;&#xA;" OwnerUserId="3264" LastEditorUserId="1355" LastEditDate="2012-11-18T14:38:31.650" LastActivityDate="2019-12-29T11:50:53.827" Title="What kind of return can an average algorithmic trading firm achieve today?" Tags="&lt;high-frequency&gt;&lt;returns&gt;&lt;algorithmic-trading&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4536" PostTypeId="2" ParentId="4535" CreationDate="2012-11-15T22:57:13.740" Score="5" Body="&lt;p&gt;You will struggle to put a number on the potential returns of  high-frequency trading (HFT) and I think it wouldn't make any sense anyway if you don't take into consideration its risk and its leverage. Achieving 100% return with low volatility seems highly improbable; so ask the trader in question his &lt;a href=&quot;http://en.wikipedia.org/wiki/Sharpe_ratio&quot; rel=&quot;noreferrer&quot;&gt;Sharpe ratio&lt;/a&gt; to start with and compare it with yours.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a more economical - or even philosophical - point of view, you can notice that, to trade at higher frequencies you need to invest more money in sophistication of your trading form. Moreover, I believe this cost will look more exponential than linear.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the question might be &lt;strong&gt;is there a payoff in the markets for this kind of sophistication?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the answer to that is &lt;em&gt;yes&lt;/em&gt;, because by getting to higher frequencies, your are able to trade different kind of strategies and different kinds of events. According to the efficient market hypothesis (&lt;a href=&quot;http://en.wikipedia.org/wiki/Efficient-market_hypothesis&quot; rel=&quot;noreferrer&quot;&gt;EMH&lt;/a&gt;), inefficiencies should disappear instantly as market participants notice them. So, the fewer participants you have at a higher frequency, the better the chance you'll have to get a large piece of the cake.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: you can do algorithmic-trading at a lower frequency as well, but then my point above is not really valid anymore, although it is still about payoff for sophistication&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2012-11-15T22:57:13.740" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4537" PostTypeId="2" ParentId="4535" CreationDate="2012-11-15T23:36:22.910" Score="7" Body="&lt;p&gt;Whether its possible? Absolutely. However, you should probably keep in mind a couple points:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;*&lt;/em&gt; Many people claim a lot while proving very little to none. This is fine if the issue is a small-talk conversation. Believe it or not, no harm done. However, this is about money, and from my experience I cannot stress enough how important it is to do a very intensive due diligence on your part. Ask him to prove that he is worthy of your investments. Ask him for audited broker statements which detail his past trades so that you can build a more credible risk/return profile and see whether the statistical results speak in favor of funding him. Ask him to somehow send you live execution notifications of his currently live running strategies. Its very simple to code up a small application, especially for people active in algorithmic trading. If he rejects to show any sort of proof or verification then I would be more than careful. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;*&lt;/em&gt; Should you ever invest with him then I recommend you make sure your funds are segregated from any other of his funds. Its very simple in a professional &quot;umbrella fund structure&quot;. You basically open an account in your own name while giving him trading authorization in your account. In that way he is unable to withdraw or transfer funds out of your account. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;*&lt;/em&gt; Keep in mind China is still a very inexperienced wild-west market in terms of financial investments. I say this because I spent almost my entire career in East Asia, Tokyo, HK, Singapore, Shanghai, now Tokyo. Chinese investors are a very special kind of breed when it comes to investments. Most are still having completely irrational expectations. They want a guy to generate 50% return, if at year end he generates 45% then they kick him out, and move all their money overnight into real estate. Then when the real estate market cooled down they moved all their funds into commodities and gold, and such forth. There is no loyalty, no trust, no nothing in China when it comes to investments. Expectations of achievable returns are exaggerated and so are promised by those who manage funds. Thus, I would be very careful about claims of someone able to generate 100% returns. Its doable, sure, but the risk of blowup grows exponentially, and the draw downs in between may be a lot larger than you can stomach. Do you feel comfortable waking up one morning and reading in your email inbox that your investment overnight tanked by 15-20% just because your fund manager concentrated all in that &quot;hot&quot; stock that he got some secret tips about and invested in? Be my guest, but I would ask very hard and potentially challenging questions in terms of what his thoughts are on risk/reward. If I speak to someone managing money and he mentions &quot;returns&quot; earlier than &quot;risk&quot; then he is OUT, SIMPLY OUT. Believe me, someone who promises you something without first mentioning the risk behind it should be avoided int his particular industry. Why all those comments about China and Chinese investors? Because I get the sense that you also have slightly unrealistic expectations of achievable returns within the framework of sane and sound risk management. If you get all crazed up by someone promising 100% then something is wrong, or do most people get excited when they watch a telemarketer on TV promising that the USD 3.99 gem can really heal sicknesses? My advice to you: Be realistic what to expect. The US stock market is not the Chinese real estate market 10-15 years ago. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take my advise or leave it, its your choice, but I would be very careful about someone who says he can generate 100% returns. It sounds extremely fishy and unprofessional. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good luck!!! (i hope you dont need it)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S.: After I finished writing this and read your question again, I smirked, then shrugged, then felt pain. I actually recommend you to run, do not invest with such person, I am almost willing to bet (not the farm but a significant amount) that currently its close to impossible to generate 100% returns on a significant investment in US stocks on event based strategies. The probability of me being wrong is probably somewhere between 0.02%-0.5%. Just my 2 cents. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2012-11-15T23:42:23.630" LastActivityDate="2012-11-15T23:42:23.630" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4538" PostTypeId="2" ParentId="4530" CreationDate="2012-11-15T23:51:34.267" Score="1" Body="&lt;p&gt;Of course there is a rigorous way to prove that with larger sample sizes the sample statistic converges to the population statistic, if you pick the mean then the average value of a sample set will converge to its expected value over larger and larger sample sizes. Take a dice. Take a die, denote 6 as best and 1 as worst. Then roll it 10 times, then calculate the average face number you rolled across the 10 rolls. Let's say you got a 5.xx. So, does this mean the die is not a fair die because you scored so high? Maybe, maybe not. You are not sure, luck may be in place here. It actually most certainly is. Now roll the same die 1000 times. If you don't get an average close to 3.5 you can be almost certain that the die is not fair. You can now adjust your confidence interval the larger you make the sample size. Pretty easy and basic concept imho. Hope it makes sense. Here the proof:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take a look at the concept of the law of large numbers: &lt;a href=&quot;http://en.wikipedia.org/wiki/Law_of_large_numbers&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Law_of_large_numbers&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The proof is on the same page and directly relates to your problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, I concur with Nassim Taleb on this one (though I disagree with his style of trading and some of his opinions on options trading). George Soros has proven many more times than Buffet that his investment and trading skills are highly skilled and that his returns were not the outcome by mere luck. Its that most people only know about his BOE play but hardly anything else. Buffet in turn has done a lot bigger deals but fewer in between, simply because his investment style is much more longer term oriented than Soros's. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2012-11-16T13:52:45.847" LastActivityDate="2012-11-16T13:52:45.847" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4539" PostTypeId="1" CreationDate="2012-11-16T00:00:54.020" Score="5" ViewCount="2875" Body="&lt;p&gt;If I have a time series that exhibits mean reverting properties, does it necessarily mean that the time series is mean stationary?&lt;/p&gt;&#xA;" OwnerUserId="3267" LastEditorUserId="12" LastEditDate="2012-11-16T18:48:26.990" LastActivityDate="2012-11-16T19:07:58.393" Title="Does mean reverting imply mean stationary?" Tags="&lt;mean-reversion&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4541" PostTypeId="1" AcceptedAnswerId="4544" CreationDate="2012-11-16T06:06:45.307" Score="2" ViewCount="304" Body="&lt;p&gt;I am developing a factor model to predict monthly returns. One of the factors alone accounts for an R squared of 0.3 to 0.4 for many single periods that has surprised me. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, for some periods the direction of the factor reverse completely  and if I run a single regression for all the periods this factor alone accounts for an R squared of 0.1 which means that the factor is robust but I am missing another factor, correct me if there is another explanation.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have any opinion on how to isolate the explanatory power of this factor in the panels in order to eliminate the effect of missing factor or any analytical way to flag the other factor? &lt;/p&gt;&#xA;" OwnerUserId="3245" LastEditorUserId="1355" LastEditDate="2012-11-16T14:05:55.680" LastActivityDate="2012-11-16T14:50:08.553" Title="Missing factor in the factor model" Tags="&lt;factor-models&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4542" PostTypeId="2" ParentId="4530" CreationDate="2012-11-16T09:52:25.310" Score="6" Body="&lt;p&gt;You can point out to your friend that, statistically speaking, having more observations reduces uncertainty in estimators.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mathematically,  $SE_\bar{x}\ = \frac{s}{\sqrt{n}}$, showing that the standard error of a statistical estimator decreases with increased observations.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This argument is concise and consistent with the Taleb quote.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Standard_error&quot;&gt;From wikipedia on standard error.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a simple way to think about it is to imagine you had to determine if a coin was un-biased or not. Would it be more robust to draw conclusions over 10,000 (empirical) flips or only 10?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="3040" LastEditorUserId="3040" LastEditDate="2012-11-16T10:44:00.213" LastActivityDate="2012-11-16T10:44:00.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4543" PostTypeId="2" ParentId="4530" CreationDate="2012-11-16T13:51:44.987" Score="2" Body="&lt;p&gt;His friend is an very serious and high level former physicist turned quant and he'll tell you for free that this is not a debate about the law of large numbers (which was last interesting before I hit puberty) or any of the other elementary statistical explanations listed above - none of these things are relevant or revealing. It's essentially a debate about the nature of a &quot;trade&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The original debate was whether Jim Simmons or Warren Buffet was a better investor, and the crux of the debate came down to my good friend asserting that Simmons was a better (read: less lucky / more &quot;skillful&quot;) investor because he had done a (much) greater absolute number of trades than Buffet over the course of his career, despite Buffet's career being substantially longer (almost double the length). This is because Renaissance tend to run computer driven trading strategies that are often very high frequency and use complex and quick dynamic portfolio rebalancing techniques based on live, noisy, incoming signals - lots of very small and funny trades with a very short life span and no objective purpose other than because the computer deems them necessary as part of its greater objectives. The majority of these trades, on their own, do not even intend to be profitable - rather, they're geared towards preventing potential unprofitability.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Buffet, on the other hand and as we all well know, does infrequent and enormous trades based on months of fundamental research. These positions are usually held in perpetuity (he has been a major stockholder in Coca Cola for more than 20 years) and are often intended to maximize dividend and other cash flow income, although he is also fond of distressed opportunities as well (LTCM). Consequently, it should be exceedingly obvious that Buffet does far fewer trades, but all of them are intended to be profitable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The assertion that this makes him less skillful than Simmons (or Soros, which is an entirely different kettle of fish completely and one only brought up in said debate because my good friend revers Taleb to an unhealthy degree and believes anything he has said can be used to crush an argument) is completely ridiculous. I really shouldn't have to explain why, but my essential point is that 1 trade does not directly equal another. Me buying shares in Anglo American on my dinky little online broker is in no way reminiscent of RBS bundling up 10,000 mortgages and selling the multi-billion securitization to an SPV - yet both are single trades. So applying the law of large numbers to the absolute number of trades done by these titans of the game over their careers (and thus assuming all trades are equal) to establish luck is really, astonishingly, stupid. Its the same as saying all pieces of string are the same length. A more intelligent appraisal would be to look at absolute returns, drawdowns, running costs and receivables. Both have delivered outrageous returns for a very long time, though Buffet has done so for far longer with fewer, smaller drawdowns and at considerably less expense. Additionally, if Simmons turns off the machine tomorrow, profit will instantly become negative and stay so in perpetuity - he has no receivables. Buffet hasn't had to get out of bed for 30 years and he would still earn hundreds of millions for himself and his shareholders in dividend income alone, not counting his other cash streams. Performance wise, they are historically comparable, but it is worth pointing out that performance wise Buffet beats Soros into the dust in every metric you care to pick, except the breadth of securities he traded and the number of absolute trades he did. Some of his misses and drawdowns are gargantuan, and it does surprise me that he never blew Quantum up at one stage or another.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The notion that he was in any way lucky over the course of his 50 year career as the most successful investor who has ever lived is so preposterous that it speaks to an astonishing lack of common sense, and the application of the law of large numbers to this comparison has no basis in mathematics, logic or finance. This debate is ultimately about fundamental vs quantitative analysis, and if there was a clear winner in that debate one or other side would cease to exist quite quickly. &lt;/p&gt;&#xA;" OwnerUserId="3270" LastActivityDate="2012-11-16T13:51:44.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4544" PostTypeId="2" ParentId="4541" CreationDate="2012-11-16T14:50:08.553" Score="3" Body="&lt;p&gt;The best option is to identify the other missing factors and include them in your analysis. Depending on your data and assumptions, PCA is a good place to start. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your data also shows signs of a time-varying correlation with your factor. Hence, it $may$ also be appropriate to allow for time-varying regression coefficients or some other technique to account for this feature of the data. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2012-11-16T14:50:08.553" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="4545" PostTypeId="2" ParentId="4539" CreationDate="2012-11-16T17:43:19.877" Score="6" Body="&lt;p&gt;As pointed out by Brian, the question is vague because generally mean reversion requires a well defined mean. Nevertheless, there are processes which are not mean stationary (mean is not homogenous across observations) for which a concept of mean exists. Let $\mu_t = E(x_t)$. In general you can have $\mu_t \neq \mu_s$ (i.e. violate mean stationarity) but have a well defined long run mean, i.e. the limit &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac1n \sum_{t=1}^n \mu_t \to \bar \mu$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;exists. In such a situation, you can define a concept of mean reversion to the long run mean that applies to non mean stationary processes.&lt;/p&gt;&#xA;" OwnerUserId="1531" LastEditorUserId="1531" LastEditDate="2012-11-16T19:07:58.393" LastActivityDate="2012-11-16T19:07:58.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4547" PostTypeId="2" ParentId="4528" CreationDate="2012-11-16T22:07:27.843" Score="1" Body="&lt;p&gt;You may wish to consider this process a little more generally.  That is to say, you are defining a cohort of comparable bonds as 23-year A- rated bonds.  Bloomberg doesn't supply a long-dated A- curve, so no matter how you approach this, you will effectively be modeling this bond spread against others in its cohort.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suggest redefining the cohort to be 20-30 year bonds in the same industry with any level of A rating.  Find the average spread $ s $ to treasuries and then apply $s$ to the 23-year point on the treasury curve to come up with a value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Needless to say, if you have views on recovery rate, capital structure changes, or other hard-to-model criteria you should consider them.  The whole process is very fuzzy so you won't be introducing any extra error.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-11-16T22:07:27.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4549" PostTypeId="1" AcceptedAnswerId="4551" CreationDate="2012-11-17T08:05:48.443" Score="7" ViewCount="776" Body="&lt;p&gt;Somebody was telling me that if you buy randomly and assuming no transaction costs in todays market place, you wont make money 50% of the time and lose 50% of the time because of adverse selection. Im not quite sure I follow, does anyone know what this could be about?&lt;/p&gt;&#xA;" OwnerUserId="1456" LastEditorUserId="1355" LastEditDate="2012-11-17T13:16:25.953" LastActivityDate="2012-11-18T10:02:29.417" Title="Why is random trading minus transaction costs not zero expected value?" Tags="&lt;quant-trading-strategies&gt;&lt;automated-trading&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4550" PostTypeId="1" AcceptedAnswerId="4560" CreationDate="2012-11-17T14:00:13.230" Score="8" ViewCount="1324" Body="&lt;p&gt;&lt;strong&gt;The Setup&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume the inside market is $15.15 \times 15.16$ and there is a very large bid order imbalance. For example, 30,000 shares bid across 100+ orders, 200 shares offered across 1 order; however, it is not always this extreme.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Approximately 10-1000$\mu$s prior to a tick up I've seen numerous occasions where a single order is &quot;flickered&quot; at the bid very quickly. By flicker I mean an order with the same size is quickly added and canceled, over and over again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The flickering persists until the spread widens and the market goes to $15.15 \times 15.17$. Orders then rush to improve the bid to $15.16$ narrowing the spread back down to $0.01$. I've noticed that an order with the same size as the order being flickered at $15.15$ joins the new bid level very quickly after the tick, often achieving a queue position of 3 or better. Sometimes the new level is joined with an $Add Order$ and sometimes with a $Replace Order$, presumably to coincide with the state of the order being managed at the time of the widening of ths spread ($Add Order$ if the order was deleted immediately prior  the widening, $Replace Order$ if the order was added immediately prior to the widening).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Additional observations and notes:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;While the flickering is happening the market is relatively quiet making it easy to &quot;see&quot; the effect if one is scanning data visually.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The venue involved seems to always be INET (Q). At least, when I have noticed or gone looking for the flicker this is where I always see it. I've not done an exhaustive search.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In line with the above, I've not searched across more than CSCO for the flicker. It may behave differently (or not be present) in other symbols.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My Question and Ideas&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What purpose does flickering the order serve? Or perhaps it serves no purpose and it is simply an order execution algorithm unsure about where to place the next bid?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would seem to be disadvantageous to do this because it resets the priority of your resting bid. Granted, the tick up is very probable given the imbalance at the inside, but it is not guaranteed. Further, resetting priority works against the trader if the midpoint reverts quickly after the tick up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps there are latency advantages to doing the flicker, but I can't puzzle out what they might be. One could simply leave their order unmolested, wait for the tick, and proceed to do a $Replace Order$ improving the bid and joining the new level. However, perhaps there is a small latency advantage to using $Add Order$ over $Replace Order$ on INET and the flicker allows the trader to &lt;em&gt;sometimes&lt;/em&gt; be able to do this: use $Add Order$ if the tick happens immediatley following a $Cancel Order$, and the flicker serves to allow the trader to stay at the bid while hoping for the right timing of the tick.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, some might suggest quote stuffing, but the amount of traffic generated by this one order is inconsequential in the grand scheme. No ticker plant worth its salt would care about a few hundred more messages that might be caused by this flicker.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What other possibilities are there? What's the best motivation to flicker an order in this fashion? Of course there is the simplistic explanation of: it serves no purpose and happens due to negligence (bug in the trader's software) or is meant to be confusing, and without a better explanation I suppose I must accept this. However, I'm curious if there is a more positive motivation for this order execution behavior.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastEditorUserId="1355" LastEditDate="2012-11-17T17:20:27.473" LastActivityDate="2012-11-19T08:34:38.703" Title="Why would a trader quickly flicker an order immediately preceding a tick away?" Tags="&lt;high-frequency&gt;&lt;limit-order-book&gt;&lt;order-execution&gt;&lt;electronic-trading&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4551" PostTypeId="2" ParentId="4549" CreationDate="2012-11-17T15:41:08.337" Score="4" Body="&lt;p&gt;Assuming the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You consider bid/ask spread to be a transaction cost.&lt;/li&gt;&#xA;&lt;li&gt;That you're interested in passive trading since you mentioned adverse selection.&lt;/li&gt;&#xA;&lt;li&gt;As a random passive trader you simply place a bid to buy and an offer to sell at price $P$ and $P + Spread$, respectively.&lt;/li&gt;&#xA;&lt;li&gt;You do no active order management and are therefore a naive trader with respect to order execution. You simply place your bid and offer and wait.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Given your question this would appear to be the only realistic scenario that makes sense. It would not make much sense to consider the case where you can, &lt;em&gt;on demand&lt;/em&gt; buy at the bid and sell at the ask since it is impossible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can conceptually convince yourself that you will lose money given a random placement of passive, non-managed limit orders if you assume there are both informed and uninformed traders in the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, define &quot;adverse selection&quot; as an uninformed participant trading with a more informed participant. An informed participant trades because he believes, rightly or not, that he has information relevant to the future price. As an uninformed trader you have no information that might impact your belief about the future price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, consider that as a naive liquidity adder randomly placing bids and asks you will often only trade when it is worst to do so. Your bid at price $P$ will be hit with when the market is about to go down and your ask at price $P + Spread$ will be lifted when the market is about to go up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given this you'll typically start in a hole when comparing to the midpoint, having bought at the bid immediately prior to a tick down, or sold at the ask immediate prior to a tick up. This is why passive traders place a premium on queue position. The less orders in front of them the better, and the more orders behind them the better.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To illustrate, on average your starting unrealized $PnL$ for your bid order will be the future midpoint minus your current bid:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$PnL_{start} = P_{mid_{t+1}} - P_{bid}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you believe the above that the future midpoint, $P_{mid_{t+1}}$ will typically be &lt;strong&gt;below&lt;/strong&gt; your current bid due to adverse selection, then you can see that you will always have a negative starting $PnL$ for the majority of your trades.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastEditorUserId="1355" LastEditDate="2012-11-17T16:14:57.287" LastActivityDate="2012-11-17T16:14:57.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4554" PostTypeId="2" ParentId="4530" CreationDate="2012-11-17T21:14:17.390" Score="1" Body="&lt;p&gt;I think Taleb oversimplifies the concept (very unusual for him, since he likes to make things unnecessarily complex). It's a much more complex issue then it appears on the surface, as it touches on number of questions - actual returns, time at risk, percent winners, etc. &lt;/p&gt;&#xA;" OwnerUserId="2906" LastActivityDate="2012-11-17T21:14:17.390" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4555" PostTypeId="2" ParentId="4549" CreationDate="2012-11-18T02:42:30.263" Score="6" Body="&lt;p&gt;The first formal model to explain this was &lt;a href=&quot;http://faculty.fuqua.duke.edu/~qc2/BA532/1985%20EMA%20Kyle.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Kyle (1985)&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Oversimplifying, imagine there is a group uninformed traders and an informed trader active in the market for a given security. Uninformed traders cannot make correct directional predictions. The informed trader knows --- with some uncertainty --- what the price will be at the end of a certain time horizon (e.g. he has inside information about earnings). The informed trader wants to profit maximally from his knowledge and achieves that by slowly trading in the direction he predicted. His profit will be equal to the aggregated returns of the uninformed traders.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bottomline: As an uninformed trade, you trade randomly. If you are lucky, you counterparty is just as uninformed and if there are no transaction costs you stand a 50% of making a profitable trade. If you are not so lucky, you are ''adversely selected'' and your counterparty is an informed trader and your transaction will very likely a losing one. All in all, your returns from trading randomly will be less that the benchmark lucky case. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Several details need to be hammered out to make this intuition consistent, the most important ones are (1) that uniformed traders are &lt;a href=&quot;https://quant.stackexchange.com/q/2360/1531&quot;&gt;noise traders&lt;/a&gt; and (2) how the interaction between these two groups and revisions to the price are mediated by a market maker. This intuition extends to toy models of the limit order book (for example, &lt;a href=&quot;http://webhost.hec.fr/rosu/research/limit.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Rosu (2010)&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="1531" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2012-11-18T02:42:30.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4556" PostTypeId="2" ParentId="4549" CreationDate="2012-11-18T10:02:29.417" Score="0" Body="&lt;p&gt;I would actually venture to say it will be very close to 50% over many transactions. Of course given you do not consider any transaction costs, meaning you buy and sell at the mid-point of cash equity traded prices, without slippage, or any other execution related expense. Also, my claim only holds if you consider cash equities, which are NOT a zero-sum &quot;game&quot;. This assumption leads to the logical conclusion that even if there are &quot;informed&quot; (a.k.a. illegally acting on insider information) market participants in the market this does not necessarily stack the odds against a randomly picking trader. I am aware and have browsed through the papers which brought about &quot;adverse selection bias&quot; however, I find their cited empirical evidence very weak and do not believe that it necessarily means the rest of the uninformed traders trade at worse than 50% odds. The story can be quite different in options and futures markets. But regarding cash equities I would be very careful in supporting adverse selection. In that I would first like to make sure which asset class we are exactly talking about. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-11-18T10:02:29.417" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4558" PostTypeId="1" CreationDate="2012-11-19T02:07:13.937" Score="0" ViewCount="8723" Body="&lt;p&gt;&lt;a href=&quot;https://www.google.com/finance?q=NYSE%3AAOL&amp;amp;ei=yZCpUODEMsKqqgHPzQE&quot; rel=&quot;nofollow&quot;&gt;https://www.google.com/finance?q=NYSE%3AAOL&amp;amp;ei=yZCpUODEMsKqqgHPzQE&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Previously, I assumed &quot;Inst. Owned&quot; meant the percentage of the company's stock that was owned by the company (viz. not floated), then I started to believe it meant the percentage of the stock which was owned by institutional investors. I still believe/assume that, but now I see AOL is 103% &quot;Inst. Own&quot;, which carries me to the temporary assumption that AOL is being shorted right now? &lt;/p&gt;&#xA;" OwnerUserId="3051" LastEditorUserId="1355" LastEditDate="2012-11-19T16:30:10.367" LastActivityDate="2012-11-19T16:30:10.367" Title="What does &quot;Inst. Own&quot; mean on Google Finance, and how can AOL be 103% &quot;Inst. Own&quot;'d?" Tags="&lt;investing&gt;&lt;short-selling&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4559" PostTypeId="1" CreationDate="2012-11-19T05:25:46.673" Score="-2" ViewCount="140" Body="&lt;p&gt;You can't calculate an actual/real angle with the sine function with discrete market data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need a substitute value for inputs that require an angle value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're only calculating the angle between two adjacent bars, is it possible to use the distance formula as a proxy (x=1)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Distance between two points:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;c = SquareRoot((Xa-Xb)^2 + (Ya-Yb)^2);&lt;/p&gt;&#xA;&#xA;&lt;p&gt;c =distance&lt;/p&gt;&#xA;&#xA;&lt;p&gt;X=interval (time) = 1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Y=price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Distance between two points&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.mathsisfun.com/algebra/distance-2-points.html&quot; rel=&quot;nofollow&quot;&gt;http://www.mathsisfun.com/algebra/distance-2-points.html&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="3196" LastEditorUserId="16595" LastEditDate="2019-06-28T11:15:46.930" LastActivityDate="2019-06-28T11:15:46.930" Title="Proxy for a trigonometric angle function" Tags="&lt;mathematics&gt;" AnswerCount="1" CommentCount="3" ClosedDate="2012-11-19T17:22:46.693" ContentLicense="CC BY-SA 3.0" />
  <row Id="4560" PostTypeId="2" ParentId="4550" CreationDate="2012-11-19T08:34:38.703" Score="10" Body="&lt;p&gt;The flickered orders are postonly bid at 15.16. The exchange slides it back to 15.15 to avoid a locked market. Submitting firm sees the slideback and cancels. Then tries again. When the 15.16 offer is executed or cancelled out, the offer moves to 15.17 then the postonly bid at 15.16 goes through at the targeted price and gains good queue position. &lt;/p&gt;&#xA;" OwnerUserId="2270" LastActivityDate="2012-11-19T08:34:38.703" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4561" PostTypeId="2" ParentId="4559" CreationDate="2012-11-19T14:47:27.560" Score="2" Body="&lt;p&gt;You don't compute angle between points, but between vectors. If you want a proxy for a cos of the angle between vectors (x1, y1), (x2, y2), take their dot product x1 * x2 + y1 * y2. This has nothing to do with quantitative finance.&lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2012-11-19T14:47:27.560" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4562" PostTypeId="2" ParentId="4558" CreationDate="2012-11-19T15:00:30.553" Score="3" Body="&lt;p&gt;'Inst. Owned' almost surely means &quot;Institutionally Owned&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With respect to the 103% ownership reported:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Discrepancies caused by varying time lags in reporting ownership may skew the results&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Second, and perhaps most likely, is due to short selling. I might own 100 shares, lend them to Bill, and Bill might sell (short) the stock to Nancy. In this case both I and Nancy might report owning 100 shares.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2012-11-19T15:00:30.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4564" PostTypeId="2" ParentId="1260" CreationDate="2012-11-19T17:15:38.017" Score="5" Body="&lt;p&gt;You can also use the &lt;a href=&quot;http://cran.r-project.org/web/packages/Sim.DiffProc/index.html&quot; rel=&quot;noreferrer&quot;&gt;Sim.DiffProc&lt;/a&gt; package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have a look at this document:&lt;br&gt;&#xA;&lt;a href=&quot;http://hal.archives-ouvertes.fr/docs/00/62/98/41/PDF/R-SimDiffProc.pdf&quot; rel=&quot;noreferrer&quot;&gt;Sim.DiffProc: A Package for Simulation of Diffusion Processes in R&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See esp. chapter 2.1.2&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is even a Graphical User Interface (GUI) available for some functions:&lt;br&gt;&#xA;&lt;a href=&quot;http://cran.r-project.org/web/packages/Sim.DiffProcGUI/index.html&quot; rel=&quot;noreferrer&quot;&gt;http://cran.r-project.org/web/packages/Sim.DiffProcGUI/index.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See chapter 4 in the above document for details.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2012-11-19T17:21:04.763" LastActivityDate="2012-11-19T17:21:04.763" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4565" PostTypeId="2" ParentId="1260" CreationDate="2012-11-19T19:12:40.040" Score="12" Body="&lt;p&gt;The code of &lt;a href=&quot;http://en.wikipedia.org/wiki/Euler%E2%80%93Maruyama_method&quot;&gt;Euler Maruyama simulation method&lt;/a&gt; is pretty simple (&lt;code&gt;nu&lt;/code&gt; is long run mean, &lt;code&gt;lambda&lt;/code&gt; is mean reversion speed):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ornstein_uhlenbeck &amp;lt;- function(T,n,nu,lambda,sigma,x0){&#xA;  dw  &amp;lt;- rnorm(n, 0, sqrt(T/n))&#xA;  dt  &amp;lt;- T/n&#xA;  x &amp;lt;- c(x0)&#xA;  for (i in 2:(n+1)) {&#xA;    x[i]  &amp;lt;-  x[i-1] + lambda*(nu-x[i-1])*dt + sigma*dw[i-1]&#xA;  }&#xA;  return(x);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="370" LastEditorUserId="1355" LastEditDate="2012-11-19T19:16:23.163" LastActivityDate="2012-11-19T19:16:23.163" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4567" PostTypeId="2" ParentId="631" CreationDate="2012-11-19T21:07:32.823" Score="5" Body="&lt;p&gt;I can share my own experience working with the Deltix product suite. As a research and development platform it's very feature rich with support for every back-testing mode there is (BBO, Trade, Midprice, Bar, Level 2 Order Book) and advanced optimization modes (walk-forward, genetic, mean-variance, portfolio optimization, etc). I have built components and external back-office tools to integrate with my strategies. This is easy by building around their central data warehouse (TimeBase) from which a strategy receives input (market data) and can optionally send output to for other strategies and components to pick-up in real time (custom data and inter-strategy event handling). As far as the cost of integrating it into an existing ecosystem, they now have a retail offering (which I'm currently using for freelance development) that is cheaper and a good place to start learning the APIs and porting existing strategies. You'll then have a clear cut upgrade path to the full blown product suite when your work is re-qualified as &quot;institutional&quot;.&lt;/p&gt;&#xA;" OwnerUserId="3038" LastActivityDate="2012-11-19T21:07:32.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4568" PostTypeId="1" CreationDate="2012-11-19T23:20:20.260" Score="7" ViewCount="486" Body="&lt;p&gt;I am writing a white paper in which I am trying to compare a strategy to different well-known - and classic - asset allocation optimization approaches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the methods I chose is the minimum variance portfolio $w_\text{MV}$ defined as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$w_\text{MV} = \underset{w}{\arg \min} ~ w' \Sigma w$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\Sigma$ is the covariance matrix of the assets and under the linear constraints $Aw \leq b$ and $E w = d$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have always heard that the MV portfolio was unique, and I know that this problem is linked to &lt;a href=&quot;http://en.wikipedia.org/wiki/Quadratic_programming&quot;&gt;quadratic programming&lt;/a&gt; which I believe guarantees a unique solution as long as $\Sigma$ is &lt;a href=&quot;http://en.wikipedia.org/wiki/Positive-definite_matrix&quot;&gt;positive-definite&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wanted to add a reference to another paper where this uniqueness was discussed (proved), and I found several ones written quite recently. However, I was wondering if there was one paper thas was more famously known for discussing that particular property?&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2013-01-17T01:54:46.460" Title="What is the canonical reference for Minimum Variance Portfolio's uniqueness?" Tags="&lt;optimization&gt;&lt;asset-allocation&gt;&lt;reference-request&gt;&lt;minimum-variance&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4569" PostTypeId="2" ParentId="4568" CreationDate="2012-11-20T01:54:38.733" Score="1" Body="&lt;p&gt;If short sell is allowed, I remember there's a unique analytical solution, otherwise it has to be solved numerically. Is your approache different? IMHO the issue of min variance approach is really not how to solve this constrained optimization problem, but how to estimate asset return and var/covar matrix accurately.&lt;/p&gt;&#xA;" OwnerUserId="3286" LastActivityDate="2012-11-20T01:54:38.733" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4571" PostTypeId="1" AcceptedAnswerId="4573" CreationDate="2012-11-20T07:17:00.010" Score="3" ViewCount="689" Body="&lt;p&gt;&lt;a href=&quot;http://falkenblog.blogspot.de/&quot; rel=&quot;nofollow&quot;&gt;Falkenblog&lt;/a&gt; reports an interesting finding: All of the stock returns since 1993 are from overnight returns and cross-sectionally, volatility receives a positive overnight risk premium, a negative intraday one:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://falkenblog.blogspot.de/2012/11/another-overnight-return-puzzle.html&quot; rel=&quot;nofollow&quot;&gt;Another Overnight Return Puzzle&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My questions&lt;/strong&gt;&lt;br&gt;&#xA;Is this a known anomaly (At least I have never heard of it)? Is there a name for it? Is this documented in the literature? Is this effect exclusive to the US or also true for Europe and Asia?&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2012-11-20T21:33:14.590" Title="When gains are made: Overnight or during trading hours? What is the connection to volatility?" Tags="&lt;volatility&gt;&lt;returns&gt;&lt;risk-premium&gt;&lt;anomalies&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4572" PostTypeId="2" ParentId="4568" CreationDate="2012-11-20T07:22:46.970" Score="2" Body="&lt;p&gt;This article by &lt;a href=&quot;http://falkenblog.blogspot.de/&quot; rel=&quot;nofollow&quot;&gt;Eric Falkenstein&lt;/a&gt; is exactly what you are looking for:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://falkenblog.blogspot.de/2012/05/early-low-vol-literature-now-everywhere.html&quot; rel=&quot;nofollow&quot;&gt;Early Low Vol Literature Now Everywhere&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;EDIT&lt;/em&gt;&lt;br&gt;&#xA;Falkenstein has a new post out on the academic origins of the approach: &lt;a href=&quot;http://falkenblog.blogspot.de/2013/01/bob-haugen-rip.html&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2013-01-09T09:33:04.660" LastActivityDate="2013-01-09T09:33:04.660" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4573" PostTypeId="2" ParentId="4571" CreationDate="2012-11-20T08:28:11.730" Score="5" Body="&lt;p&gt;The study you cited seems to be exaggerating slightly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) &quot;An interesting fact of returns is that all of the stock returns since 1993 are from overnight returns&quot; -&gt; This is simply factually incorrect. Why don't you pick the S&amp;amp;P 500 names, you calculate the log returns taking into account price changes from the open to the close, then you do the same for the close-open, you will notice that the chart on that website MUST be incorrect. Returns during the US trading sessions contributed much more returns than indicated in this study. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) &quot;If you take all the tickers, the top 1000 non-etfs over the past 2 years, and rank them by prior daily volatility, and then look at their overnight returns, you see that volatility is strongly positively correlated with subsequent overnight returns, which then reverse over the next day session.&quot; -&gt; Also that does not seem to be accurate (such results with such low p-value). I ran the same study over a small subset of names of different sectors and groups and nowhere find such clean delineation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I cannot prove my point other than encourage those who want to make sure to simply run their own studies. Its extremely simple to run in R, you even get the price data off several websites free of charge. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-11-20T08:28:11.730" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4574" PostTypeId="1" CreationDate="2012-11-20T08:52:34.917" Score="9" ViewCount="2030" Body="&lt;p&gt;I'd like to do a portfolio optimization of a set of ETF's but want to avoid traditional problems with normality assumptions in returns etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there techniques that let me sample 'draws' from the emprirical distribution and apply those to a monte-carlo style optimization?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I reviewed the question on monte carlo sampling from predicive distributions - this question is different -- I don't have a predictive distribution, and don't want to assume a gaussian.&lt;/p&gt;&#xA;" OwnerUserId="2186" LastEditorUserId="12" LastEditDate="2012-11-20T09:28:53.020" LastActivityDate="2012-11-21T04:12:05.853" Title="portfolio optimization from empirical return distributions" Tags="&lt;optimization&gt;&lt;monte-carlo&gt;&lt;portfolio&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="4575" PostTypeId="2" ParentId="4574" CreationDate="2012-11-20T11:12:51.763" Score="6" Body="&lt;p&gt;You can use empirical distribution and use Mean-CVaR as a target function. CVar (&quot;Expected shortfall&quot;) is considered a better risk metrics than VaR if we depart from the light-tailed normal distribution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code below is in R and is taken from the book &quot;Portfolio Optimization with R/Rmetrics&quot; By Diethelm Wuertz, Yohan Chalabi, William Chen, Andrew Ellis. It does Mean-CVaR optimization without any assumptions on distribution using open source Rmetrics package.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(fPortfolio)&#xA;&#xA;#use indicies LPP2005 see http://www.pictet.com/en/home/lpp_indices.html&#xA;lppData  &amp;lt;-  100*LPP2005.RET[,1:6]&#xA;&#xA;#create a portfolio description&#xA;frontierSpec  &amp;lt;- portfolioSpec();&#xA;&#xA;#optimization type - CVaR&#xA;setType(frontierSpec)  &amp;lt;- &quot;CVAR&quot;&#xA;&#xA;#optimization solver&#xA;setSolver(frontierSpec)  &amp;lt;- &quot;solveRglpk&quot;&#xA;&#xA;#confidence level for CVaR&#xA;setAlpha(frontierSpec)  &amp;lt;- 0.05&#xA;&#xA;#number of portfolios in efficient frontier&#xA;setNFrontierPoints(frontierSpec)  &amp;lt;- 25&#xA;&#xA;#optimize with long only constraints&#xA;frontier &amp;lt;- portfolioFrontier(data = lppData, spec = frontierSpec, constraints=&quot;LongOnly&quot;);&#xA;&#xA;#plot the graphs&#xA;tailoredFrontierPlot(object=frontier,mText=&quot;Mean-CVaR Frontier (Long only)&quot;,risk=&quot;CVaR&quot;);&#xA;weightedReturnsPlot(frontier)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm sure if it's good idea to sample from your empirical distribution. By doing this you probably end up with an analogue of &lt;a href=&quot;http://www.newfrontieradvisors.com/Research/Articles/documents/Estimation%20Error%20and%20Portfolio%20Optimization%20JOIM.pdf&quot; rel=&quot;noreferrer&quot;&gt;resampling technique&lt;/a&gt; for classical MV. This may improve the stability the optimization and provide smooth transition between portfolios for different risk levels.&lt;/p&gt;&#xA;" OwnerUserId="370" LastActivityDate="2012-11-20T11:12:51.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4576" PostTypeId="2" ParentId="4574" CreationDate="2012-11-20T11:26:45.250" Score="0" Body="&lt;p&gt;Monte Carlo generates random walk which is z ~N(0,1) which you dont want to use so that is out of the way .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are looking at portfolio optimization where returns are non normal I also suggest that you have a look at &lt;a href=&quot;https://digital.lib.washington.edu/researchworks/bitstream/handle/1773/16268/PhD%20Dissertation%20Minfeng%20Zhu%202010.pdf?sequence=1&quot; rel=&quot;nofollow&quot;&gt;this paper.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if you want to look at CVar then you can look at &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1856476&quot; rel=&quot;nofollow&quot;&gt;this one&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1386" LastActivityDate="2012-11-20T11:26:45.250" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4578" PostTypeId="1" AcceptedAnswerId="4588" CreationDate="2012-11-20T15:42:15.197" Score="4" ViewCount="854" Body="&lt;p&gt;I have been searching online for a few days regarding how to calculate portfolio VaR for a portfolio consisting of leveraged products - but so far, I have not been able to come up with anything remotely useful and practical (i.e. so that I can implement it in a spreadsheet for example).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trading custom leveraged products, and my PnL movements are based on the following two criteria:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The gearing with respective to a point movement in the market (At the point at which the transaction is created, I get to choose the gearing - for example, I can choose to risk 100 cents for every point move in the underlying market).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The margin gearing which relates to how much margin the broker requires in order to establish a position (actually this may be irrelevant in risk calculation, as margining appears to be ignored in futures VaR calculation).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;My questions are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;How can I build a VaR model that takes into account the fact that each trade (i.e. transaction) may have a different gearing?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What would be the steps required to build a simple Excel model to help me calculate a VaR for my portfolio?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1733" LastActivityDate="2012-11-21T20:01:54.800" Title="Calculating portfolio VaR for (custom) leveraged products" Tags="&lt;risk-management&gt;&lt;var&gt;&lt;leverage&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4580" PostTypeId="2" ParentId="4574" CreationDate="2012-11-20T19:30:08.367" Score="4" Body="&lt;p&gt;The Portfolio Analytics package of R is an excellent package that can perform non-parametric portfolio optimization:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://r-forge.r-project.org/R/?group_id=579&quot; rel=&quot;nofollow&quot;&gt;https://r-forge.r-project.org/R/?group_id=579&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="37" LastActivityDate="2012-11-20T19:30:08.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4581" PostTypeId="2" ParentId="4574" CreationDate="2012-11-20T19:40:59.443" Score="1" Body="&lt;p&gt;The method described in &lt;a href=&quot;http://docentes.fe.unl.pt/~psc/condport.pdf&quot; rel=&quot;nofollow&quot;&gt;Brandt &amp;amp; Santa-Clara (2006)&lt;/a&gt; is somewhat different then that of the current answers and requires a bit more work but might be of interest nonetheless. Their ideas are further developed in a number of other papers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Their &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;approach relies on sample moments of the long-horizon returns&#xA;  of the expanded set of assets&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;in a Markowitz context.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2012-11-20T19:40:59.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4582" PostTypeId="2" ParentId="4571" CreationDate="2012-11-20T21:33:14.590" Score="1" Body="&lt;p&gt;This was documented in &lt;a href=&quot;http://www.krannert.purdue.edu/faculty/hgulen/Day_and_Night.pdf&quot; rel=&quot;nofollow&quot;&gt;this working paper&lt;/a&gt; about 6 years ago. I wonder why it was never published... may be some problem with the results.&lt;/p&gt;&#xA;" OwnerUserId="1056" LastActivityDate="2012-11-20T21:33:14.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4583" PostTypeId="1" CreationDate="2012-11-20T22:46:44.540" Score="2" ViewCount="420" Body="&lt;p&gt;Bakshi et. al. (1997) analyzes the empirical performance of some alternative option pricing models. I am interested to do this as well - hence applying different models - but I am unsure how to handle the OptionMetrics data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something that stood out from the article for instance is that they adjust the spot stock price for discrete dividends of European call options. My first question is then immediately, when does this need to be done? And does anybody knows whether OptionMetrics does this automatically. Also which other adjustments (beside the filters) are needed? How can I know which adjustments need to be done and is there any documentation on this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, does anybody know a good guide on starting to work with OptionMetrics (i.e. what to watch out for and how to handle the data). &#xA;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="2291" LastActivityDate="2012-11-21T16:34:51.320" Title="Question on OptionMetrics: when are adjustments for discrete dividends needed?" Tags="&lt;options&gt;&lt;optionmetrics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4584" PostTypeId="1" CreationDate="2012-11-21T02:50:27.920" Score="3" ViewCount="242" Body="&lt;p&gt;This is not a homework or assignment exercise.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I'm trying to evaluate $\displaystyle \ \ I := E_\beta \big[\frac{1}{\beta(T_0)} K \mathbf{1}_{\{B(T_0,T_1) &amp;gt; K\}}\big]$, where $\beta$ is the savings account, $B$ is the present value (at some time $t$) of the zero coupon bond paying $\$1$ at maturity, $\mathbf{1}$ is the indicator function, $r(s)$ is the short rate, and $f(t,T)$ is the instantaneous forward rate (i.e. $f(t,T,T)$). Expanding on this a bit more:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \displaystyle \ \ \beta(T_0) = e^{\int_0^{T_0} r(s)d(s)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \displaystyle \ \ B(t,T) = e^{-\int_t^T f(t,s)d(s)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first step is to do a measure change as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\displaystyle \ \ I = E_{T_0} \big[\frac{1}{\beta(T_0)} K \mathbf{1}_{\{B(T_0,T_1) &amp;gt; K\}} \frac{\beta(T_0)B(0,T_0)}{\beta(0)B(T_0,T_0)}\big]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is &lt;strong&gt;why is this correct&lt;/strong&gt;? For a density process to be a valid change of measure we need to to be a Doleans-Dade exponential local martingale, but I can't see why this is the case in this example, because:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\displaystyle \ \ \frac{\beta(0)B(T_0,T_0)}{\beta(T_0)B(0,T_0)} = 1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is not in the usual form of a Doleans exponential?&lt;/p&gt;&#xA;" OwnerUserId="3174" LastEditorUserId="3174" LastEditDate="2012-11-21T12:52:05.797" LastActivityDate="2012-11-21T12:52:05.797" Title="Measure change in a bond option problem" Tags="&lt;stochastic-calculus&gt;&lt;stochastic-processes&gt;&lt;mathematics&gt;&lt;risk-neutral-measure&gt;&lt;martingale&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4585" PostTypeId="2" ParentId="4574" CreationDate="2012-11-21T04:12:05.853" Score="4" Body="&lt;p&gt;You can use Michaud's Resampled Efficient Frontier as a technique, or Atillio Meucci's Entropy Pooling.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Michaud's approach you can sample returns with replacement for each of your assets. Based on these draws you can calculate the expectations, variances, and covariances for each simulation. You can then construct, say, a 1,000 efficient frontiers and use an averaging process to combine them. In my view there are some &lt;a href=&quot;https://quant.stackexchange.com/questions/4208/comparing-mvo-with-resampled-efficient-frontier&quot;&gt;theoretical flaws&lt;/a&gt; with this technique although it tends to work in practice. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Meucci has several case-studies where he implements Entropy Pooling. Under this approach, I would create, say, a 1,000 expected return estimates for your various assets. Each of these can be represented with a view. The probability of each view being correct is 1/1000. You can then blend those views and construct a portfolio using a utility function of your choice (mean-variance, VaR, c-VaR). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Doug Martin has also published exciting work on tail-risk budgeting. If you want to take a portfolio construction approach to handling non-normality his &lt;a href=&quot;http://www.cfasociety.org/seattle/Educational%20Presentations/2011-05-20%20Tail%20Risk%20Budgeting%20Doug%20Martin%20Ph%20D.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;slides&lt;/a&gt; are worth taking a look at.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some interesting related literature for you would be Meucci's &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=681553&quot; rel=&quot;nofollow noreferrer&quot;&gt;Robust Bayesian Allocatio&lt;/a&gt;n which will help you develop a robust optimization solution which I think is your ultimate objective.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to implement these ideas are discussed elsewhere on the site:&#xA;- &lt;a href=&quot;https://quant.stackexchange.com/questions/2707/how-do-you-mix-quantitative-asset-allocation-with-qualitative-views&quot;&gt;Entropy Pooling&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1800" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2012-11-21T04:12:05.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4586" PostTypeId="2" ParentId="4415" CreationDate="2012-11-21T10:38:52.670" Score="4" Body="&lt;p&gt;I encountered the same problem as I needed an index including equity, fixed income and alternative assets for my master thesis research. I needed to estimate the beta of my optimal portfolios with a representative index in order to compare the portfolios by treynor and Jensen measure. Combining for instance, the MSCI and Barcap is no option as the I already used these indexes for optimizing my portfolios on strategic level (then I would get a beta of 1 if I combined all general indexes for each asset class).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I now used the BlackRock Global allocation fund as a benchmark (Datastream name: BLACKROCK GLB.ALOCN.A; Datastream-code:134831), which is one of the largest and most broadly invested funds. It is not optimal, but the best I could find.&lt;/p&gt;&#xA;" OwnerUserId="3292" LastActivityDate="2012-11-21T10:38:52.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4587" PostTypeId="2" ParentId="4583" CreationDate="2012-11-21T16:34:51.320" Score="4" Body="&lt;p&gt;I've always been skeptical of the quality of OptionMetrics' dividend information in the first place.  Furthermore, subtracting out discounted dividends is an inaccurate way to deal with cashflows while pricing options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OptionMetrics also does not control for borrow/lend spreads, and their American option pricing model is not the best.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My recommendation would be to use OptionMetrics only for price information, and back out your own volatilities using better-designed models and some good dividend information.  OptionMetrics vols are good enough for the back office, but not really for serious work.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-11-21T16:34:51.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4588" PostTypeId="2" ParentId="4578" CreationDate="2012-11-21T20:01:54.800" Score="3" Body="&lt;p&gt;First of all you need a model to generate future returns, I assume you already have this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since its just a model, there will be an unexplained component in the predictions made for every period $t$ and for every asset $i$. Let $\varepsilon_{t, i}$ denote this random innovation and $\mathrm{E}[r_{t, i}] = f(\varepsilon_{t, i})$ the expected asset return as a function of the innovation. In a Monte Carlo you pseudo-randomly generate the innovations, apply $f$ to obtain a random sample from your return distribution, in pseudo code, for one period:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;r = zeros(1, N)&#xA;for i=1:N&#xA;    eps = draw_from_distribution()&#xA;    r(i) = f(eps)&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with &lt;code&gt;N&lt;/code&gt; the number of simulations. This is all there is to it, to find the 5% VaR just take the 5% quantile from &lt;code&gt;r&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An advantage of Monte Carlo simulation is that it is easy to take an asset return model of a high frequency and apply it to a VaR of a lower frequency. In that case you repeat the code above for every period and calculate the cumulative return from the one period returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a number of ways to do a &lt;code&gt;draw_from_distribution&lt;/code&gt;. You can simply use a distribution like the normal or the student-t or perform &lt;a href=&quot;http://en.wikipedia.org/wiki/Historical_simulation&quot; rel=&quot;nofollow&quot;&gt;Filtered Historical Simulation&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2012-11-21T20:01:54.800" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4589" PostTypeId="1" AcceptedAnswerId="4591" CreationDate="2012-11-22T07:53:46.073" Score="32" ViewCount="59642" Body="&lt;p&gt;I want to simulate stock price paths with different stochastic processes. I started with the famous geometric brownian motion. I simulated the values with the following formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R_i=\frac{S_{i+1}-S_i}{S_i}=\mu \Delta t + \sigma \varphi \sqrt{\Delta t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mu= $ sample mean &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma= $ sample volatility&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Delta t = $ 1 (1 day)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\varphi=$ normally distributed random number&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used a short way of simulating:&#xA;Simulate normally distributed random numbers with sample mean and sample standard deviation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Multiplicate this with the stock price, this gives the price increment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Calculate Sum of price increment and stock price and this gives the simulated stock price value. (This methodology can be found &lt;a href=&quot;http://www.jpmorgan.com/tss/General/Risk_Management/1159380637650&quot;&gt;here&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I thought I understood this, but now I found the following &lt;a href=&quot;http://en.wikipedia.org/wiki/Geometric_Brownian_motion&quot;&gt;formula&lt;/a&gt;, which is also the geometric brownian motion:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$  S_t = S_0 \exp\left[\left(\mu - \frac{\sigma^2}{2}\right) t + \sigma W_t \right] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not understand the difference? What does the second formula says in comparison to the first? Should I have taken the second one? How should I simulate with the second formula?&lt;/p&gt;&#xA;" OwnerUserId="3298" LastEditorUserId="848" LastEditDate="2014-12-30T07:13:30.173" LastActivityDate="2020-06-25T20:34:18.363" Title="How to simulate stock prices with a Geometric Brownian Motion?" Tags="&lt;equities&gt;&lt;simulations&gt;&lt;stochastic-processes&gt;&lt;brownian-motion&gt;" AnswerCount="5" CommentCount="9" FavoriteCount="20" ContentLicense="CC BY-SA 3.0" />
  <row Id="4590" PostTypeId="1" CreationDate="2012-11-22T08:23:19.527" Score="1" ViewCount="873" Body="&lt;p&gt;This is something I've been thinking about for a while but I can't reach a clear conclusion. When we calculate, for example, the profit factor for a pairs trading strategy, do we treat each pairs trade as a single result or each of the separate trades on each instrument as a single result? For example, lets say we are trading 2 instruments A and B and we have the following results...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A: -2, 1, 3&lt;/p&gt;&#xA;&#xA;&lt;p&gt;B: 1,-2,1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Profit factor for each trade separably -&gt; 5/4&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Profit factor for each pair added together -&gt; 4/2&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we treat each pairs trade as a single trade we get a better result, the same would apply when trying to calculate a Sharpe ratio. I guess one could ask the same question of hedged options trades, what do people generally do?&lt;/p&gt;&#xA;" OwnerUserId="1397" LastActivityDate="2012-11-22T09:09:24.160" Title="Performance Stats of Pairs Trades" Tags="&lt;pairs-trading&gt;&lt;sharpe-ratio&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4591" PostTypeId="2" ParentId="4589" CreationDate="2012-11-22T08:37:10.817" Score="29" Body="&lt;p&gt;The way you do it in the first place is a &lt;a href=&quot;http://en.wikipedia.org/wiki/Discretization&quot; rel=&quot;noreferrer&quot;&gt;discretization&lt;/a&gt; of the Geometric Brownian Motion (GBM) process. This method is most useful when you want to compute the path between $S_0$ and $S_t$, i.e. you want to know all the intermediary points $S_i$ for $0 \leq i \leq t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second equation is a closed form solution for the GBM given $S_0$. A simple mathematical proof showed that, if you know the initial point $S_0$ (which is $a$ in your equation), then the value of the process at time $t$ is given by your equation (which contains $W_t$, so $S_t$ is still random). However, this method will not tell you anything about the path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As mentioned in the comments below, you can also use the close form to simulate each step of the paths.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2015-04-27T03:02:51.390" LastActivityDate="2015-04-27T03:02:51.390" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4592" PostTypeId="2" ParentId="4590" CreationDate="2012-11-22T09:09:24.160" Score="3" Body="&lt;p&gt;Of course you get through diversification effects different return variation and thus Sharpe ratios depending on whether you calculate the standard deviation on an individual asset or a portfolio standard deviation on a collection of assets. A pairs trade is a small portfolio so with favorable correlation properties you should generally get a better risk adjusted return on the pair than on each asset individually. Market practice is to treat a pair as a portfolio for risk attribution and performance attribution purposes. The whole point of the pairs trade was exactly that, the attempt at capturing a temporary deviation from a presumed co-integration pattern, correct?&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-11-22T09:09:24.160" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4593" PostTypeId="1" CreationDate="2012-11-22T09:12:40.780" Score="8" ViewCount="2506" Body="&lt;p&gt;I want to simulate stock prices with the variance gamma process. The model is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_T=S_0 e^{ {[}(r-1)T + \omega + z{]}} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_0= $ starting value&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$T= $ Time&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\omega=\frac{T}{\nu}ln(1-\theta \nu - \sigma^2 \frac{\nu }{2})$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r= $ interest rate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$z= $ normally distributed variable with mean $\theta g$ and standard deviation $\sigma \sqrt{g}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know, that I have to simulate first the g values by a random generator (using gamma function with parameters), then generate random numbers z using the g's. But my problem is, how does I specify the three parameters $\nu$ and  $\theta$ and r? The T means years, so if I have e.g. 10 trading days, this would be 10 divided by 365. I had a another simulation with the geometric brownian motion before, there I used the sample mean, sample standard deviation, 22 trading days, and starting value 20. So I thought to make it comparable:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$T=22/365$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_0=20$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nut what about $\theta$, $\nu$ and r? Is r just the sample mean? &lt;/p&gt;&#xA;" OwnerUserId="3298" LastEditorUserId="467" LastEditDate="2012-11-22T14:42:02.840" LastActivityDate="2020-08-09T08:48:49.693" Title="How to simulate stock prices using variance gamma process?" Tags="&lt;stochastic-processes&gt;&lt;variance-gamma&gt;" AnswerCount="5" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4594" PostTypeId="2" ParentId="4593" CreationDate="2012-11-22T09:42:51.467" Score="1" Body="&lt;p&gt;If you say stock prices are following GBM then you can say &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS_t = \mu S_tdt + \sigma S_t dW_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;solving which it brings&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/jwKeh.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\sigma$ is volatility and $r$ is risk free rate . &lt;/p&gt;&#xA;&#xA;&lt;p&gt;**EDITED &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a Variance Gamma process&#xA;theta is the deterministic drift in subordinated Brownian motion and sigma standard deviation  in subordinated Brownian motion. I choose mu in (0.1,0.3) and volatility estimate by GARCH or around 15% lower to 30% upper for a typical simulation &lt;/p&gt;&#xA;&#xA;&lt;p&gt;HTH&lt;/p&gt;&#xA;" OwnerUserId="1386" LastEditorUserId="1355" LastEditDate="2012-11-22T15:53:31.257" LastActivityDate="2012-11-22T15:53:31.257" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="4595" PostTypeId="1" AcceptedAnswerId="4639" CreationDate="2012-11-22T10:24:48.540" Score="5" ViewCount="10901" Body="&lt;p&gt;The theory of delta hedging a short position in an option is based on trades in the stock and cash, i.e. I get the option premium and take positions in the stock and cash.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the classical no-arbitrage theory, I have the following if I am short an option, get the premium and hedge the structure with the stock:&#xA;$$&#xA; marketvalue(stock trading) + premium received = marketvalue(option)&#xA;$$&#xA;which is equivalent to&#xA;$$&#xA; marketvalue(stock trading) = marketvalue(option) - premium received &#xA;$$&#xA;where I assume zero interest rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus if I delta hedge an option that I did not short, the premium of which I did not receive, then the relationship must be the same as the left hand side of the equation does not change. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I want to &quot;generate an option payoff&quot;, I trade the underlying:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA; marketvalue(stock trading) = marketvalue(option) - premium received &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I do this with futures then all costs must be included in the pricing of futures and the margin payments. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;To summarize&lt;/strong&gt;, replicating the option without actually trading it, I will replicate it &quot;minus&quot; the premium ... I will get less than the pay-off. Is this correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What happens if I do the hedge with futures? Then I don't need cash, except for the margin account.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To ask the question differently: if I replicate a put or a call with futures can I make money (the pay-off) from nothing? Obviously not: I will miss the option premium. Furthermore, I have a hedging error and additional risk (basis risk). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anything that I missed? Is the premium and the hedging error the only difference? &lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="999" LastEditDate="2014-01-07T08:08:29.163" LastActivityDate="2014-01-07T08:08:29.163" Title="How to Delta Hedge with Futures?" Tags="&lt;options&gt;&lt;hedging&gt;&lt;futures&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4597" PostTypeId="2" ParentId="4595" CreationDate="2012-11-22T12:54:06.550" Score="10" Body="&lt;p&gt;You are missing the futures basis and roll cost. Futures expire, and need to be rolled into the new expiry. The basis is not static and can vary considerably, depending on the specific underlying and contract. Quants may have a hard time to appreciate this but the basis is not at all fully quantifiable at all times: It can hugely vary entirely due to shifts in demand and supply. Those are the things you are definitely missing. I may in turn miss out on more but those two come to mind right away.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But more importantly, I sense from how you asked the question that you are not really fully on top of options pricing and hedging theory. To hedge part of an option exposure you need to fully understand which part you specifically do not want to take exposure to through implementing a hedge. You also need to understand that most all greeks are dynamic, which means that you need to consider re-hedging, specifically by how much and more importantly how often. I recommend you spend time reading through Taleb's &quot;Dynamic Hedging&quot; because it describes hedging from the practitioner's perspective. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Per request links to provide the replication approach for futures options:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://ferrari.dmat.fct.unl.pt/personal/mle/DocCPG/Marek/LECS.pdf&quot;&gt;http://ferrari.dmat.fct.unl.pt/personal/mle/DocCPG/Marek/LECS.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and here one more interesting paper that shows how to deal with basis risk:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.edhec-risk.com/edhec_publications/all_publications/RISKReview.2011-02-21.3709/attachments/EDHEC%20Working%20Paper%20Option%20Pricing%20and%20Hedging%20F.pdf&quot;&gt;http://www.edhec-risk.com/edhec_publications/all_publications/RISKReview.2011-02-21.3709/attachments/EDHEC%20Working%20Paper%20Option%20Pricing%20and%20Hedging%20F.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2012-11-26T12:12:00.160" LastActivityDate="2012-11-26T12:12:00.160" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="4598" PostTypeId="1" CreationDate="2012-11-22T13:33:45.030" Score="2" ViewCount="685" Body="&lt;p&gt;How do you calculate the &lt;a href=&quot;http://en.wikipedia.org/wiki/Potential_future_exposure&quot; rel=&quot;nofollow&quot;&gt;Potential Future Exposure&lt;/a&gt; (PFE) for a swaption?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you incorporate the dynamics of implied volatility when you are running your simulations? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a standard way to model the real-world joint dynamics of rates and volatilitiess?&lt;/p&gt;&#xA;" OwnerUserId="3306" LastEditorUserId="467" LastEditDate="2012-11-22T22:35:06.390" LastActivityDate="2012-11-22T22:35:06.390" Title="How to calculate a the PFE for a Swaption?" Tags="&lt;options&gt;&lt;swaps&gt;&lt;cva&gt;&lt;counterparty-risk&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4599" PostTypeId="1" CreationDate="2012-11-22T18:55:04.383" Score="23" ViewCount="9170" Body="&lt;p&gt;A question from an interview book:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When can hedging an options position make you take on more risk?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The answer provided is the following:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Hedging can increase your risk if you are forced to both buy short-dated options and hedge them.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And it gives an example that you short the stock to hedge, and the stock price rises up to strike so the option expires worthless, then you lose on both the options and the short stock position. Therefore you are worse off than if you had not hedged.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I don't quite understand is that, in that example, if the stock price goes down, I would gain on my short stock position, why didn't it being taken into account?&#xA;Also, I hope to have an analytical formula to see the &quot;risk&quot; more clearly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anyone help me with this one?&lt;/p&gt;&#xA;" OwnerUserId="3304" LastEditorUserId="20795" LastEditDate="2019-09-08T10:11:09.477" LastActivityDate="2019-09-08T10:11:09.477" Title="When does delta hedging result in more risk?" Tags="&lt;options&gt;&lt;risk&gt;&lt;hedging&gt;" AnswerCount="7" CommentCount="1" FavoriteCount="9" ContentLicense="CC BY-SA 4.0" />
  <row Id="4600" PostTypeId="2" ParentId="4599" CreationDate="2012-11-22T20:28:28.460" Score="13" Body="&lt;p&gt;E.g. on Monday you get forced to buy some Friday expiry OTM puts, say 95% strike S&amp;amp;P weeklies. Of course, you go and buy some delta against them to &quot;hedge&quot; yourself. Next thing you know, the the market tanks. Unfortunately, by Friday it's only down 3.5%, so it's does not fall far enough to reach the strike.  So, on Friday expiration, you are out your premium and down money on your delta.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Overall, it's a pretty typical &quot;painful moment&quot; for a market maker. Usually, in this case you are better off selling some ATMish gamma and leaving the tinys to decay in peace. Should the market really take a dive, you got some lottery tickets.&lt;/p&gt;&#xA;" OwnerUserId="2906" LastActivityDate="2012-11-22T20:28:28.460" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4601" PostTypeId="1" CreationDate="2012-11-22T21:09:34.427" Score="1" ViewCount="358" Body="&lt;p&gt;Is there a absolute dollar form of the Kelly equation $f=\frac{m}{s^2}$? (i.e. one that does not use percent returns).&lt;/p&gt;&#xA;" OwnerUserId="1397" LastEditorUserId="35" LastEditDate="2012-11-23T03:49:04.503" LastActivityDate="2012-11-30T23:06:17.303" Title="Absolute Dollar Form Of Kelly Criterion" Tags="&lt;kelly-criterion&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4603" PostTypeId="2" ParentId="4599" CreationDate="2012-11-23T08:34:40.803" Score="7" Body="&lt;p&gt;You are absolutely right, I would say that how the interview question was posed and the example given is very misleading, if not outright incorrect. Here is why:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hedging does not increase your risk in this particular example: You take on delta exposure by buying the short dated option outright. Thus buying/selling underlying (put/call) in any case will reduce your delta exposure, hence risk of changes in the underlying, given you hedge the right amount and at the right timing (this i venture is impossible to generalize as it applies differently to each case). Now, you are long gamma but being long gamma does not guarantee at all that you end up better off not hedging initially. If your boss instructs you to be at all times almost perfectly delta hedged (most French bosses are anal about this, probably because they are horrible delta traders) then you hedge, period. It reduces your delta exposure, hence risk in moves in the underlying. It is complete nonsense to start arguing in retrospect that no hedge may have resulted in a better payoff because the underlying followed a price path not anticipated earlier. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I concur with Strange that there are often better ways to hedge than always going through the underlying but I disagree with him that it poses a &quot;painful moment&quot; to market markers. Market makers who are dependent on the market moving in specific ways are probably very bad volatility traders. Your job as market maker is to earn money from the bid/offer spread and to reduce your risk exposure to lower moment greeks, given it is feasible and cost-efficient. The other times you, as market maker, attempt to benefit from what you perceive as mispricings in the option valuation. Thus, hedging the long options position with the underlying reduces your risk, period. There are obviously exceptions to this, for example, when the underlying is so extremely illiquid that it would be prohibitive to hedge/re-hedge frequently. But it has to really be analyzed in context. But if the interview book looked for a straight forward answer which applies to most cases then hedging reduces your risk, simple as that. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-11-23T08:34:40.803" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="4604" PostTypeId="2" ParentId="4601" CreationDate="2012-11-23T08:41:46.600" Score="1" Body="&lt;p&gt;Well, the first formula on the wiki page gives you a straight forward answer in absolute terms (you do know your bankroll so its pretty much absolute):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Kelly_criterion&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Kelly_criterion&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simple as that, sometimes it does not pay but only causes headaches to overcomplicate things :-) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Happy Thanksgiving!!!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update as requested by OP:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.math.washington.edu/~morrow/336_10/papers/jane.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.math.washington.edu/~morrow/336_10/papers/jane.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and here an application using R&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://braverock.com/brian/R/PerformanceAnalytics/html/KellyRatio.html&quot; rel=&quot;nofollow&quot;&gt;http://braverock.com/brian/R/PerformanceAnalytics/html/KellyRatio.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2012-11-25T10:05:53.220" LastActivityDate="2012-11-25T10:05:53.220" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4605" PostTypeId="1" CreationDate="2012-11-23T08:55:20.843" Score="6" ViewCount="7486" Body="&lt;p&gt;I am talking about the Merton Jump Diffusion model, on this &lt;a href=&quot;http://www.thetaris.com/wiki/Jump_Diffusion&quot;&gt;page&lt;/a&gt;, where they give the following formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dS_t = \mu S_t dt + \sigma S_t dW_t + (\eta-1) dq$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W_t$ is a standard brownian motion, and $dq$ is an independent Poisson process (its value is 1 with probability $\lambda dt$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On that page you can find some example code. However, it does not match the formula. I want to simulate stock paths with the MJD model but I do not know how to do it. What formula do they use for their simulation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have looked up a lot of papers, but they just give general from of the model and say this is the result, but they do not explain how to simulation goes in detail. What formula I have to use and how to implement the model. I am really frustrated because I do not know how to do this.&lt;/p&gt;&#xA;" OwnerUserId="3298" LastEditorUserId="467" LastEditDate="2012-11-23T09:22:26.467" LastActivityDate="2012-11-23T14:34:57.497" Title="How to simulate a Merton Jump Diffusion process?" Tags="&lt;simulations&gt;&lt;stochastic-processes&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4607" PostTypeId="1" AcceptedAnswerId="4628" CreationDate="2012-11-23T10:24:26.667" Score="8" ViewCount="2575" Body="&lt;p&gt;I have question regarding final loading of data back to original variables. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for example:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I have 10 variable from a,b,c....j using returns for last 300 days i got return matrix of 300 X 10. &#xA;  Further I have normalized returns and calculated covariance matrix of 10 X 10. &#xA;  Now I have calculated eigen values and eigen vectors, So I have vector of 10 X 1 and 10 X 10 corresponding eigen values.&#xA;  Screeplot says that 5 component explain 80% of variation so now there are 5 eigenvectors and corresponding eigenvalues.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now further how to load them back to original variable and how can i conclude which of the variable from a,b,c.....j explain the maximum variation at time &quot;t&quot;&lt;/p&gt;&#xA;" OwnerUserId="926" LastEditorUserId="467" LastEditDate="2012-11-26T16:18:32.120" LastActivityDate="2012-11-26T16:36:50.140" Title="How to make the final Interpretation of PCA?" Tags="&lt;statistics&gt;&lt;pca&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="4608" PostTypeId="1" CreationDate="2012-11-23T10:56:52.407" Score="3" ViewCount="529" Body="&lt;p&gt;I'm trying to price a &quot;power contract&quot; and would appreciate guidance on the next step. The payoff at time $T$ is $(S(T)/K)^\alpha$, where $K &amp;gt; 0$, $\alpha \in \mathbb{N}$, $T &amp;gt; 0$. $S$ is adapted to $\mathscr{F}$, and we are currently at time $t \in [0,T)$. Let $Q$ denote the risk-neutral measure and $\beta(t) = e^{\int_0^t r(s)ds}$ be the domestic savings account/discount factor. Also, $W(t)$ is standard Brownian Motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's my progress:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\displaystyle \ \ \text{value}_t = E^Q[\frac{\beta(t)}{\beta(T)}(S(T)/K)^\alpha \big|\mathscr{F}_t]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\displaystyle \ \ = \frac{\beta(t)}{\beta(T)K^\alpha}E^Q[S(T)^\alpha \big|\mathscr{F}_t]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We take $\displaystyle \ \ S(T)^\alpha = S(t)^\alpha \exp{\{\bigg[ (r-\frac12 \sigma^2)(T-t)+\sigma(W(T)-W(t))\bigg]\alpha  \}}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\displaystyle \ \ \text{value}_t = \frac{\beta(t)S(t)^\alpha}{\beta(T)K^\alpha}\exp{\{ \alpha(r-\frac12 \sigma^2)(T-t) + \frac12 \alpha^2 \sigma^2(T-t)  \}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;by the fact that $E[e^z] = e^{\mu + \frac12 \sigma^2}$ when $z \sim \mathscr{N}(\mu,\sigma^2)$.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;This is homework but is not graded.&lt;/p&gt;&#xA;" OwnerUserId="3174" LastEditorUserId="3174" LastEditDate="2012-11-24T02:06:20.240" LastActivityDate="2012-11-24T02:06:20.240" Title="Pricing a Power Contract derivative security" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;valuation&gt;&lt;risk-neutral-measure&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4609" PostTypeId="1" AcceptedAnswerId="4613" CreationDate="2012-11-23T13:50:49.887" Score="3" ViewCount="360" Body="&lt;p&gt;Please tell me where I've gone wrong (if I did in fact make a mistake). I'm pricing a long forward on a stock. The usual setup applies:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;This has payoff $S(T) - K$ at time $T$. &lt;/li&gt;&#xA;&lt;li&gt;We are at $t$ now.&lt;/li&gt;&#xA;&lt;li&gt;$S(T) = S(t)e^{(r-\frac12 \sigma^2)(T-t)+\sigma(W(T)-W(t))}$. &lt;/li&gt;&#xA;&lt;li&gt;$W(t)$ is a Wiener process.&lt;/li&gt;&#xA;&lt;li&gt;$K \in \mathbb{R}_+$.&lt;/li&gt;&#xA;&lt;li&gt;$Q$ is the risk-neutral measure.&lt;/li&gt;&#xA;&lt;li&gt;$\beta(t) = e^{rt}$ is the domestic savings account, a tradable asset. $r$ is the constant riskless rate.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My Attempt&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$f(t,S) = E^Q[\frac{\beta(t)}{\beta(T)}(S(T)-K)|\mathscr{F}_t]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ = E^Q [\frac{\beta(t)}{\beta(T)}S(T)|\mathscr{F}_t] - E^Q [\frac{\beta(t)}{\beta(T)}K|\mathscr{F}_t]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ = E^{P_S}[\frac{\beta(t)}{\beta(T)}S(T) \frac{\beta(T)S(t)}{\beta(t)S(T)}|\mathscr{F}_t] - \frac{\beta(t)}{\beta(T)}K$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ = S(t) - K\frac{\beta(t)}{\beta(T)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ = S(t) - Ke^{-r(T-t)}$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;This isn't graded homework or assignment. (It is ungraded homework)&lt;/p&gt;&#xA;" OwnerUserId="3174" LastEditorUserId="3174" LastEditDate="2012-11-24T02:11:39.283" LastActivityDate="2014-04-04T21:45:54.307" Title="Pricing forward contract on a stock" Tags="&lt;equities&gt;&lt;derivatives&gt;&lt;pricing&gt;&lt;risk-neutral-measure&gt;&lt;forward&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4610" PostTypeId="2" ParentId="4605" CreationDate="2012-11-23T13:52:00.017" Score="4" Body="&lt;p&gt;I take it you want to do a Monte-Carlo simulation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You just need to decide of an unit of time $dt$ and then start simulating the path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dW_t$ is simulated using a random normal value. In Excel $N\left(\mu, \sigma\right)$ would be simulated by &lt;code&gt;NORMINV(rand(), mu , sigma)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your Poisson process you just have to simulate random numbers between 0 and 1 and compare against your probability of a jump and create jumps if needed ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The page you linked used a formula linking $S_t$ and $S_{t+\Delta t}$&lt;/p&gt;&#xA;" OwnerUserId="2908" LastEditorUserId="2908" LastEditDate="2012-11-23T14:34:57.497" LastActivityDate="2012-11-23T14:34:57.497" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4611" PostTypeId="1" AcceptedAnswerId="4678" CreationDate="2012-11-23T15:51:48.123" Score="3" ViewCount="1023" Body="&lt;p&gt;Given the nominal bond yield and the inflation index bond yield (earning yield), how would one calculate the discounted inflation rate (discounted earning growth rates)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;These two factor seems to explain a lot of the return of asset classes which I like to explore more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From an article that I couldn't find anymore, here is a a simple chart that shows the discounted growth rate index. A small quote I saved &quot;...by comparing nominal Treasury bond yields with inflation indexed bond yields, we can see the discounted inflation rates...by comparing nominal bond yield to earnings yield, we can calculate the discounted earnings growth rate; by looking at credit spreads, we can calculate the discounted rate of credit problem&quot; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/HlUuP.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2318" LastEditorUserId="2318" LastEditDate="2012-12-04T03:51:15.677" LastActivityDate="2012-12-06T05:16:47.177" Title="How to calculate discounted inflation and growth?" Tags="&lt;fixed-income&gt;&lt;inflation&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4612" PostTypeId="1" CreationDate="2012-11-23T16:05:54.310" Score="4" ViewCount="4228" Body="&lt;p&gt;From the formula of the delta of a call option, i.e. $N(d1)$, where $d_1 = \frac{\mathrm{ln}\frac{S(t)}{K} + (r + 0.5\sigma^2)(T-t)}{\sigma\sqrt{T-t}}$, the delta of an ATM spot call option is slightly bigger than 0.5. However, this is unintuitive to me... can anyone explain why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, is there any way to interpret what does $d_1$, and $d_2$ represent where $d_1$ is shown above and $d_2 = d_1 - \sigma(T-t)$&lt;/p&gt;&#xA;" OwnerUserId="2973" LastEditorUserId="848" LastEditDate="2012-11-23T16:16:06.393" LastActivityDate="2012-11-24T14:28:07.920" Title="Why do ATM call options have a delta of slightly bigger than 0.5 and not 0.5 exactly?" Tags="&lt;options&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4613" PostTypeId="2" ParentId="4609" CreationDate="2012-11-23T20:32:31.043" Score="2" Body="&lt;p&gt;In my mind you are simply right: you arrive at&#xA;$$&#xA;f(t,S) =  S(t) - K e^{-r(T-t)}.&#xA;$$&#xA;Assume that $t=0$, so we are at the inception of the contract, then&#xA;$$&#xA;f(0,S) = S(0) - Ke^{-r T}.&#xA;$$&#xA;If you choose $K = S(0) e^{r T}$ then the contract value at inception is zero. This simply means that the fair price for the forward is given by $K= S(0) e^{r T}$ which is the formula that you find in text books. Does this answer your question?&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2012-11-23T22:20:06.377" LastActivityDate="2012-11-23T22:20:06.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4614" PostTypeId="2" ParentId="4612" CreationDate="2012-11-23T20:58:08.660" Score="6" Body="&lt;p&gt;In the no-arbitrage pricing the log return of the stock price does not have expected return $0$ but $r$, the risk free rate. This is strongly related to the pricing of &lt;a href=&quot;http://en.wikipedia.org/wiki/Forward_contract&quot; rel=&quot;nofollow&quot;&gt;forward contracts&lt;/a&gt;. There you could follow the steps to see that in the arbitrage free world the spot price grows with the risk-free rate in expectation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus if you price an option then the probability (in the martingale measure) that the log return is positive is greater than $1/2$ if there are positive interest rates.  If you calculate with a dividend yield then this yield is substracted from the risk-free rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All the things that I have said hold for the log-return. If you take the exponential:&#xA;$$&#xA; S_0 \exp( X_t ) = S_0 (1 + X_t + \frac12 X_t^2 + \cdots) &#xA;$$&#xA;where $X_t$ is the log return process, and take the expectation then you get the terms $E[X_t] = r t$ for $E[X_t^2]/2 = t \sigma^2/2$ considering terms up to $2nd$ order. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the Bachelier model, where the stock price is modelled as arithmetic Brownian motion, there you don't have this $\sigma^2$ term.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="35" LastEditDate="2012-11-23T23:53:42.363" LastActivityDate="2012-11-23T23:53:42.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4615" PostTypeId="2" ParentId="1162" CreationDate="2012-11-24T00:06:17.920" Score="6" Body="&lt;p&gt;Look at it the way you would have to realize it, whatever your position in the market is, as the price of a synthetic bond that pays $K$ at time $T$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{array}{c}Ke^{-r(T-t)} &amp;amp; = &amp;amp; S &amp;amp; + &amp;amp; P &amp;amp; -&amp;amp; C \\&#xA;(\text{bid}) &amp;amp;=&amp;amp; (\text{bid}) &amp;amp;+&amp;amp; (\text{bid}) &amp;amp;-&amp;amp; (\text{ask})\\&#xA;(\text{ask}) &amp;amp;=&amp;amp; (\text{ask}) &amp;amp;+&amp;amp; (\text{ask}) &amp;amp;-&amp;amp; (\text{bid})&#xA;\end{array}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are other ways to construct a synthetic bond:&#xA;\begin{array}{c}(K_2-K_1)e^{-r(T-t)} &amp;amp; = &amp;amp; C_1 &amp;amp; - &amp;amp; C_2 &amp;amp; + &amp;amp; P_2 &amp;amp; -&amp;amp; P_1\\&#xA;(\text{bid}) &amp;amp;=&amp;amp; (\text{bid}) &amp;amp;-&amp;amp; (\text{ask}) &amp;amp;+&amp;amp; (\text{bid})&amp;amp;-&amp;amp; (\text{ask})\\&#xA;(\text{ask}) &amp;amp;=&amp;amp; (\text{ask}) &amp;amp;-&amp;amp; (\text{bid}) &amp;amp;+&amp;amp; (\text{ask})&amp;amp;-&amp;amp; (\text{bid})&#xA;\end{array}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's a lot of spread when it's all said and done, and the &quot;risk-free rate,&quot; however you define it, will be right in the middle of that spread.  There is likely only an arbitrage here if you're a bookie and make a market in all these options.&lt;/p&gt;&#xA;" OwnerUserId="3106" LastActivityDate="2012-11-24T00:06:17.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4616" PostTypeId="2" ParentId="4612" CreationDate="2012-11-24T01:31:33.317" Score="4" Body="&lt;p&gt;The reason you find it counter intuitive is that because you think of it as the probability of ending in the money at the maturity which is not exactly right. Even with a interest rate of $0\%$ where the stock has no tendency to rise or fall you see that delta is slightly higher than $0.5$ for calls ( $\Delta = \sigma * \sqrt T$ ) and here is the reason:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Think of delta as number of shares to hedge. Even when $r=0\%$ because the stock moves with a geometric brownian motion higher stock prices have larger movements so in order to hedge against a call you need more shares than hedging against a put.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, for dual delta which is the probablity of ending in the money you see that for at the money options where $r=0\%$ dual delta is $0.5$ &lt;/p&gt;&#xA;" OwnerUserId="3245" LastEditorUserId="1355" LastEditDate="2012-11-24T14:28:07.920" LastActivityDate="2012-11-24T14:28:07.920" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4617" PostTypeId="2" ParentId="1307" CreationDate="2012-11-24T09:31:10.587" Score="4" Body="&lt;p&gt;To answer the more general question that seems to be giving you trouble, Ito's lemma is the stochastic version of the chain rule of standard calculus.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is it useful for?  That's like asking what the chain rule is useful for.  Calculus is useful in quantitative finance, and in particular, for stochastic processes, you need to use the stochastic version of calculus.  To compute the derivatives in this stochastic calculus, you need a chain rule, and that's what Ito's lemma provides.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suspect you never really thought out what the chain rule in normal calculus is useful for.  Once you understand that, it's clear what you need Ito's lemma for.&lt;/p&gt;&#xA;" OwnerUserId="2477" LastActivityDate="2012-11-24T09:31:10.587" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4618" PostTypeId="1" AcceptedAnswerId="4620" CreationDate="2012-11-24T16:50:17.307" Score="5" ViewCount="2745" Body="&lt;p&gt;It is relatively easy to estimate the parameters of an autoregressive $AR(p)$ process. How do I do with a moving average $MA(q)$ process?&lt;/p&gt;&#xA;" OwnerUserId="89" LastEditorUserId="1355" LastEditDate="2012-11-24T22:46:01.747" LastActivityDate="2012-11-24T22:46:01.747" Title="How do I estimate the parameters of an MA(q) process?" Tags="&lt;time-series&gt;&lt;estimation&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4619" PostTypeId="1" CreationDate="2012-11-24T17:17:05.747" Score="2" ViewCount="86" Body="&lt;p&gt;In Russia, options on futures on the RTS index are priced in &lt;em&gt;points&lt;/em&gt; instead of currency, with points being directly related to the value of the US dollar such that, for example, if the dollar rises, the index drops by that amount.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question: would I need to factor this into the model when pricing options on futures on this index, and if so, how?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="1217" LastActivityDate="2012-11-24T17:17:05.747" Title="Changes to option valuation for dollar-pegged underlying" Tags="&lt;black-scholes&gt;&lt;pricing&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4620" PostTypeId="2" ParentId="4618" CreationDate="2012-11-24T18:22:11.590" Score="6" Body="&lt;p&gt;Estimating $MA(q)$ models is significantly harder than $AR(p)$ models. Eviews, MATLAB and R can use multiple algorithms which are all based on some form of maximum likelihood estimation.  You can look at the source of MATLAB and R or the excellent Eviews documentation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I strongly advise &lt;em&gt;against&lt;/em&gt; rolling your own since efficient and well tested algorithms are widely available. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the interested, this &lt;a href=&quot;http://statistics.berkeley.edu/classes/s244/as154.pdf&quot;&gt;paper&lt;/a&gt; describes the method (with code) used by the &lt;a href=&quot;http://stat.ethz.ch/R-manual/R-devel/library/stats/html/arima.html&quot;&gt;R arima package&lt;/a&gt;. You can see from the abstract the method it is quite complicated.&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="1355" LastEditDate="2012-11-24T21:01:11.990" LastActivityDate="2012-11-24T21:01:11.990" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4621" PostTypeId="1" AcceptedAnswerId="4622" CreationDate="2012-11-25T15:30:59.173" Score="2" ViewCount="602" Body="&lt;p&gt;I have written an algorithmic trading program which relies heavily on low spreads in the 0.1-0.3 PIP region. I was now wondering if it would be a good idea to place bid/ask offers instead of limit orders to guarantee a low enough spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem I see with that is that of course I can't be sure that the trade goes trough. This is also really hard to simulate in backtesting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my questions are:&#xA;1. How likely is it that my trade remains in the market without anyone &quot;buying&quot; it? (Say my offer will be put exactly between the bid/ask prices)&#xA;2. How can I simulate that?&lt;/p&gt;&#xA;" OwnerUserId="3314" LastEditorUserId="467" LastEditDate="2012-11-26T19:06:10.957" LastActivityDate="2012-11-26T19:06:10.957" Title="Is making a bid/ask offer a good way to lower the spreads?" Tags="&lt;backtesting&gt;&lt;spread&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4622" PostTypeId="2" ParentId="4621" CreationDate="2012-11-25T16:29:26.410" Score="3" Body="&lt;p&gt;First, I assume that when you say:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;And I was no wondering if it would be a good idea to place bid/ask offers instead of limit orders...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You mean that you are going to be placing non-marketable limit orders inside the posted bid/ask spread; whereas before you were sending marketable limit orders that crossed the spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You didn't mention the type of market data your counter party is giving you, but I'll assume you have some view of a limit order book.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To your first question, the length of time your bid/offer rests in the spot FX market is going to be fairly impossible to estimate. Order flow and matching rules are fragmented and inconsistent and may also be exclusitory (meaning, trader A does not wish to match with trader B, even if possible given the LOB). You might attempt to estimate trade frequency and extrapolate that to the amount of time you can expect to rest assuming an optimistic matching algorithm with your broker/ECN. You might also try to condition your estimate with spread, trying to construct some conditional probabilities based on observed spread. Presumably, as you narrow the spread someone will be more likely to trade with you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for simulation, you're going to end up with a very optimisitic estimate. But, simplisticly, consider your order matched if observed trade price is worse than your posted price. If you have access to the LOB you should attempt to estimate your position in the book. Doing so will allow you to tighten up your assumed match critera to be any time an order below your estimated position in the book is executed. Of course, your estimate of position is going to be highly dependent on several assumptions, most notably latency to your counter party.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you go from taking liquidity to posting it, the cost of simulation in terms of time and complexity increases. Further, the more accurate you want those simulations to be will further drive the cost up.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2012-11-25T16:29:26.410" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4623" PostTypeId="2" ParentId="2079" CreationDate="2012-11-25T17:55:36.780" Score="4" Body="&lt;p&gt;I just thought it is worth mentioning that the skew of the underlier implied by traded option prices and the options implied-volatility skew are indeed related by no-arb relation. The point is that you can integrate implied variance over the strike prices to get the unconditional implied variance (and hence volatility) of the underlier and the skewness of the underlier gives you the extent to which the integral is different from the integrands.&lt;/p&gt;&#xA;" OwnerUserId="3315" LastEditorUserId="35" LastEditDate="2012-11-25T18:20:26.247" LastActivityDate="2012-11-25T18:20:26.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4624" PostTypeId="2" ParentId="3879" CreationDate="2012-11-25T18:22:47.843" Score="3" Body="&lt;p&gt;Perhaps check out &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1354495&quot; rel=&quot;nofollow&quot;&gt;Poti and Levich&lt;/a&gt; (2009), or in a different setting but from one of the same authors, Poti and Wang (2010) &quot;The coskewness puzzle&quot; in JBF. They directly address the issue of what level of SR is plausible.&lt;/p&gt;&#xA;" OwnerUserId="3315" LastEditorUserId="35" LastEditDate="2012-11-26T00:21:46.820" LastActivityDate="2012-11-26T00:21:46.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4625" PostTypeId="2" ParentId="2079" CreationDate="2012-11-26T01:36:14.550" Score="8" Body="&lt;p&gt;Skew &quot;arbitrage&quot; is a pretty broad term. When you are trading the skew, there are 3 principal risks (or sources of P&amp;amp;L, if you will):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(a) the actual change in the slope of the skew in the implied space. e.g. if you are trading 95% strike against 105% strike and your underlying stays in place, all of your instantaneous P&amp;amp;L would be due to the changes in the implied vol at each strike times the vega per leg&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(b) realisation of volatility across the strike space. that is, if the underlying drifts to one of the strikes, what would be the volatility realized along the way and how it relates to the original diference in vols that you locked in&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(c) the implied volatility of across the realized strike space. that is, if the underlying goes to the viscinity of one of the two strikes, what would be the implied volatility that you have to buy back or sell&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, what you are going to trade is either going to be some sort of risk reversal/collar or a 1 by N put or call spread in a delta-neutral manner. It is, however, very hard to separate the 3 risks above from each other using vanilla structures, assuming that your underlying actually moves. You can try to play different risk factors by selecting your maturities and/or strikes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS. I, unfortunately, run a number of skew-related strategies, so it's going to be hard to discuss specific strategies without revealing much of my proprietary methods.&lt;/p&gt;&#xA;" OwnerUserId="2906" LastActivityDate="2012-11-26T01:36:14.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4626" PostTypeId="1" CreationDate="2012-11-26T15:15:27.913" Score="13" ViewCount="443" Body="&lt;p&gt;I have a returns process that is drawn from a normal distribution with a nonlinear time-varying drift, so I was wondering if the entropy pooling method still applies or if I need an invariant ? &lt;/p&gt;&#xA;" OwnerUserId="3319" LastEditorUserId="467" LastEditDate="2012-11-26T18:57:14.840" LastActivityDate="2012-11-27T05:36:29.843" Title="Does entropy pooling apply to distributions with time-varying drift?" Tags="&lt;risk&gt;&lt;portfolio-management&gt;&lt;entropy-pooling&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4627" PostTypeId="2" ParentId="4607" CreationDate="2012-11-26T15:56:47.633" Score="3" Body="&lt;p&gt;If you are asking which of the 10 variables is contributing most to the principle component, then look at your first eigenvector; each value reflects a single variable, so the largest value (by magnitude) in that eigenvector should give the variable with the largest contribution. Note that a large negative number means anticorrelation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The matrix you have is in fact mapping from the 10d space of your variables onto the eigenspace of the matrix; the first eigenvector represents one of the basis vectors of this new eigenspace, in the space of your 10d vectors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The analogy is that if you had 2 variables, x and y, then you could construct a similar 2d matrix, and calculate its eigenvectors. The eigenvectors would show you the axes of the new space, and the first eigenvector is its principle component (axis).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Caveat: I know a lot more about eigenvectors than I do about PCA, so there may be a subtlety I'm missing.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2012-11-26T15:56:47.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4628" PostTypeId="2" ParentId="4607" CreationDate="2012-11-26T16:36:50.140" Score="7" Body="&lt;p&gt;To make things really clear, you have an original matrix $X$ of size $300 \times 10$ with all your returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now what you do is that you choose the first $k=5$ eigenvectors (i.e. enough to get 80% of the variation given your data) and you form a vector $U$ of size $10 \times 5$. Each of the columns of $U$ represents a portfolio of the original dataset, and all of them are orthogonal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PCA is a dimensionality-reduction method: you could use it to store your data in a matrix $Z$ of size $300 \times 5$ by doing:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Z = X U$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then recover an approximation of $X$ which we can call $\hat{X}$ as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \hat{X} = Z U^\intercal $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that as your 5 eigenvectors only represent 80% of the variation of X, you will not have $X=\hat{X}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice for finance application, I don't see why you would want to perform these reduction operations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of factor analysis, you could sum the absolute value for each row of $U$; the vector with the highest score would be a good candidate I think.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2012-11-26T16:36:50.140" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4629" PostTypeId="2" ParentId="4626" CreationDate="2012-11-26T18:56:58.100" Score="3" Body="&lt;p&gt;I can't get access to the full version to Meucci's original paper on Entropy Pooling (EP), &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1213325&quot; rel=&quot;nofollow&quot;&gt;Fully Flexible Views: Theory and Practice&lt;/a&gt;, and I hence had a look again at the abstract:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We propose a unified methodology to input non-linear views from any number of users in fully general non-normal markets, and perform, among others, stress-testing, scenario analysis, and ranking allocation. We walk the reader through the theory and we detail an extremely efficient algorithm to easily implement this methodology under fully general assumptions. As it turns out, no repricing is ever necessary, hence the methodology can be readily applied to books with complex derivatives. We also present an analytical solution, useful for benchmarking, which per se generalizes notable previous results. Code illustrating this methodology in practice is available through author's homepage.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This confirmed my initial thought that one of the great advantage of EP is that the approach is very general and can adapt to various models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I think the answer is &lt;em&gt;yes&lt;/em&gt;, I believe you can use EP even with nonlinear time-varying drift.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2012-11-26T18:56:58.100" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4630" PostTypeId="2" ParentId="4626" CreationDate="2012-11-26T23:41:57.537" Score="2" Body="&lt;p&gt;Meucci's original paper doesn't state any limitations on prior distribution to which Entropy Pooling (EP) is applied. However, I see two possible issues. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first problem is that it currently seems to be no place for incorporating time changing parameters or views on a prior distribution in the EP. Therefore, some additional work is required to apply it in your case (although it doesn't look not very complicated).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming that your goal is to include complex views in order to use the posterior distribution in portfolio optimization, another potential problem is that you most probably  want to have a market invariant (as per my understanding it's still the cornerstone of the (strategic) asset allocation theory)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The invariants are market variables that can be modeled as the realization of a set of independent and identically distributed random variables at least over the investment horizon. For example, equity invariants are compounded returns, ﬁxed-income invariants are changes in yield to maturity (for a detailed treatment, see the book &quot;Risk and Asset Allocation&quot; by Meucci, chapter 3). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nonlinear time-varying drift definitely can violate the assumption of identical distribution, therefore making the asset allocation under such distribution meaningless (unless you constantly rebalance your portfolio to make it optimal under the updated drift).&lt;/p&gt;&#xA;" OwnerUserId="370" LastActivityDate="2012-11-26T23:41:57.537" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4632" PostTypeId="2" ParentId="4626" CreationDate="2012-11-27T05:36:29.843" Score="4" Body="&lt;p&gt;So long as it is possible to simulate the distribution of log returns to the investor's horizon and convert them to prices that serve as an input into the portfolio optimization, it is possible to apply the general Entropy Pooling algorithm to either the log returns or the prices. Whatever care needs to be taken when applying the EP algorithm in its traditional use, should be applied here as well (e.g., the numerical procedure does not work well when you take extreme views and have not simulated the extreme parts of the distribution). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can also be applied to the slightly more complicated case of multiple period optimization (e.g., if you want to account for the fact that in the short-run you might be in a bad regime but in the long-run it will go to the steady state). I have not seen it in the literature, but I have set up EP problems that account for this by treating the distribution at every horizon as one distribution and then applying the EP algorithm. Whatever time dependence that results from the simulation should be accounted for in this fashion.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2012-11-27T05:36:29.843" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4634" PostTypeId="2" ParentId="1554" CreationDate="2012-11-27T13:56:16.760" Score="4" Body="&lt;p&gt;&lt;a href=&quot;http://www.lmax.com/&quot; rel=&quot;nofollow&quot;&gt;LMAX Exchange&lt;/a&gt; has a nicely written &lt;a href=&quot;http://www.lmax.com/trading-tech/access&quot; rel=&quot;nofollow&quot;&gt;.NET API&lt;/a&gt; which is free and can be used to in demo environment. However, note that LMAX is mostly a FX platform with few CFDs on equities and commodities. &lt;/p&gt;&#xA;" OwnerUserId="370" LastEditorUserId="370" LastEditDate="2012-11-27T14:01:49.967" LastActivityDate="2012-11-27T14:01:49.967" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4635" PostTypeId="2" ParentId="1307" CreationDate="2012-11-27T14:52:37.563" Score="1" Body="&lt;p&gt;If we have some function $f(a,b,c,...)$, where $a,b,c,...$ can be stochastic or otherwise, then Ito's lemma is used to find $df(a,b,c,...)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;1)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can simply do raw Monte Carlo. Consider a contingent claim maturing in $6$ months. Then for each $i$-th simulation you can calculate:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S(T)_i = S(t)e^{(r-q-\frac12 \sigma^2)0.5 + \sigma \sqrt{0.5}z_i)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $z_i \sim N(0,1)$, and $\sqrt{\Delta t}(z_i)$ is equal in distribution to $W_{\Delta t}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use the above methodology but create a sample path. For example you might want to generate a 6-point sample path. That is;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S(t_i) = S(t_{i-1})e^{(r-q-\frac12 \sigma^2)\frac{0.5}{6} + \sigma \sqrt{\frac{0.5}{6}}z_i)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for $i \in \{2,3,4,5,6,7\}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;3)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can discretize the SDE itself using Euler-Marayama.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Delta S(t_i) = a(t,S)\Delta t + b(t,S)\Delta W(t_i)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;4)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can discretize the SDE using Milstein:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\displaystyle \ \ \Delta S(t_i) = a(t,S)\Delta t + b(t,S)\Delta W(t_i) + 0.5b(t,S)\frac{\partial b(t,S)}{\partial S}\bigg((\Delta W(t_i))^2 - \Delta t\bigg)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;5)&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the above methodologies to be the function $f(v)$, where $v$ are your random numbers. You can use a control variate $g(v)$ in the following fashion:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac1N \sum_{i=1}^N [ f(v_i) - g(v_i) ] + E[g(v)]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice you want to use correlations and other stuff to improve the outcome; however this is how it's presented to students. $E[g(v)]$ might be the closed-form BS price, $g(v_i)$ might be the monte carlo BS price for a simple instrument, $f(v_i)$ might be some really complicated instrument that's closely correlated with $g(.)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;6)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use antithetic sampling. That is, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\text{MC estimate} = \frac12 [ f(v) + f(-v)]$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are some technical conditions you need to satisfy to make this worth the extra computation. &lt;/p&gt;&#xA;" OwnerUserId="3174" LastActivityDate="2012-11-27T14:52:37.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4636" PostTypeId="2" ParentId="3562" CreationDate="2012-11-27T21:17:44.693" Score="5" Body="&lt;p&gt;FDMs represent PDEs over a simple grid shape; the different implementations are just different recurrence relations to approximate the solutions to the PDE between boundary values (e.g., for options pricing, $T=[t_\mathrm{now},t_\mathrm{maturity}]$ and $S=[\mathrm{deep\_itm},\mathrm{deep\_otm}])$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;FEM is a general name for a lot of different implementations of &quot;adaptable&quot; grids, where approximations in different regions are not necessarily the same over the entire (e.g., T,S) space.  One (of many) examples where such approaches are important is path-dependent option valuations (e.g., Asian Options, see &lt;a href=&quot;http://web.hku.hk/~jinzhang/finance/Research.html&quot;&gt;Zhang, 2001/3&lt;/a&gt; which is FDM, imagine if we wanted to better model the smoothing effect of the averaging over time, or jump processes as described by Merton).&lt;/p&gt;&#xA;" OwnerUserId="3330" LastEditorUserId="3330" LastEditDate="2012-11-28T15:51:28.450" LastActivityDate="2012-11-28T15:51:28.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4637" PostTypeId="2" ParentId="74" CreationDate="2012-11-28T00:32:42.237" Score="4" Body="&lt;p&gt;There is one more solution available now to backtest option strategies: &lt;a href=&quot;http://www.oscreener.com/options_strategy_backtester&quot; rel=&quot;nofollow&quot; title=&quot;Options backtester&quot;&gt;www.oscreener.com&lt;/a&gt;!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This tool allows to screen and backtest bull put spreads, long calls, short puts, debit spreads etc and validate these strategies in seconds.&lt;/p&gt;&#xA;" OwnerUserId="3333" LastActivityDate="2012-11-28T00:32:42.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4638" PostTypeId="1" AcceptedAnswerId="4652" CreationDate="2012-11-28T03:00:42.683" Score="4" ViewCount="821" Body="&lt;p&gt;Here is my question: This is a question about Black-Scholes model, but it may be applicable to more complicated models. Throughout the discussion, the strike price $K$, interest rate $r$ and volatility $\sigma$ will be assumed to be constant. The thing we are interested in is the time decay of the option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First consider a perpetual American put problem. This has an optimal exercising level which I will call $b$ and this is given by $b=\frac{K}{1+\sigma^2/2r}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now consider any $x&amp;gt;b$, this $x$ is a level, for which it would not be optimal to exercise in a perpetual option. In this case, does this necessarily mean, there exist a $T$ such that $t\in (0,T)$, the equation below holds&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb{E}_x e^{-r(t\hat{}\tau_b)}(K-X_{t\hat{}\tau_b})^+ &amp;gt; (K-x)^+$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;here $\tau_b$ denotes the first hitting time of level $b$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think I have shown this is the case for some $t$. Here is my proof:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Denote $V(x)=\mathbb{E}_x e^{-r\tau_b}(K-X_{\tau_b})^+$. It is widely known that $V(x)&amp;gt;(K-x)^+$. Assume the statement above is false, then &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb{E}_x e^{-r(t\hat{}\tau_b)}(K-X_{t\hat{}\tau_b})^+ \leq (K-x)^+$ for all $t&amp;gt;0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then we can take the limit as $t\uparrow\infty$ on the left-hand side and apply the dominated convergence theorem, we see that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V(x)\leq (K-x)^+$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Contradicting the inequality $V(x)&amp;gt;(K-x)^+$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I have struggled to show $\mathbb{E}_x e^{-r(t\hat{}\tau_b)}(K-X_{t\hat{}\tau_b})^+ &amp;gt; (K-x)^+$ for small value of $t$. I believe this conjecture is true for all $t&amp;gt;0$ but struggled to prove it. Anyone has any ideas? &lt;/p&gt;&#xA;" OwnerUserId="3334" LastEditorUserId="3334" LastEditDate="2012-11-28T03:09:31.353" LastActivityDate="2012-11-29T18:31:34.737" Title="Black-Scholes American Put Option" Tags="&lt;black-scholes&gt;&lt;american-options&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4639" PostTypeId="2" ParentId="4595" CreationDate="2012-11-28T14:11:11.247" Score="1" Body="&lt;p&gt;I have implemented the set-up in the Black-Scholes world (setting $r=0$). The answer is yes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I just take positions in the stock according to delta then the result (pathwise, i.e. in each realisation, not only on average) is the option pay-off minus the option premium. That is to say, if the option expires out of the money (pay-off is zero), then the result of the hedging is given by the negative of the option premium. In &quot;formulas&quot; this is:&#xA;$$&#xA; market\ value(stock\ trading)=market\ value(option)−premium\ received&#xA;$$&#xA;so that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA; market\ value(stock\ trading)=−premium\ received&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In an ideal setting, the trade loses money. This is the theoretical answer in an unrealistic setting without transaction cost, with continuous hedging, no basis risk, no contango nor clearinghouse concerns. In a realistic setting, the trade loses a lot more money. But at least the setting in the &quot;perfect world&quot; is now clear to me.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="999" LastEditDate="2013-12-01T07:09:57.800" LastActivityDate="2013-12-01T07:09:57.800" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4640" PostTypeId="2" ParentId="2330" CreationDate="2012-11-28T14:55:07.000" Score="2" Body="&lt;p&gt;Once we start building time-varying copulas like Lopes suggests in that paper, I think we are better off venturing into the world of state space models.  When &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0387947256&quot; rel=&quot;nofollow&quot;&gt;viewed in a bayesian context&lt;/a&gt;, the similarities between the approaches are striking to me.  The advantage of the copula, as I understand it, is that it is a quick and dirty way to understand the structure of your marginal distributions by simplifying the dependence structure over time.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did not find anything in the Lopes paper to suggest what algo he uses to estimate the params of his time-varying copulas and marginals, but I expect that this is done using something like a forward/backward algorithm (used in ssm estimation) since he mentions that the marginals and copulas are estimated in the same &quot;step&quot;.  There are great open source ssm packages that you could extend in R and python, if this approach interests you: &lt;code&gt;sspir&lt;/code&gt;, &lt;code&gt;dlm&lt;/code&gt;, &lt;code&gt;MARSS&lt;/code&gt;, &lt;code&gt;rbugs&lt;/code&gt;, &lt;code&gt;pyssm&lt;/code&gt;, &lt;code&gt;pymcmc&lt;/code&gt;, etc.  &lt;/p&gt;&#xA;" OwnerUserId="3330" LastActivityDate="2012-11-28T14:55:07.000" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4641" PostTypeId="2" ParentId="3562" CreationDate="2012-11-28T15:12:35.970" Score="8" Body="&lt;p&gt;As far as PDEs (deterministic) are concerned we have the notion of a &quot;strong solution&quot; (directly solving the differential operator in the strong formulation of the problem) and the &quot;weak solution&quot; that deals with a weak formulation of the problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the strong formulation, finite differences are the way to go since they are the natural discretization of the differential operator. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the weak formulation, finite element methods are the way to go since they directly tackle the weak formulation of the problem by restricting it to a finite dimensional space (depending on which type of &quot;element-functions&quot; or basis-functions you choose for this space). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The finite difference method has problems with complex geometries and adaptive meshes - the geometry will not be a problem in option pricing since you always consider the rectangle $[0,T]\times[S_\text{min}, S_\text{max}]$. Local refinement &lt;em&gt;can&lt;/em&gt; be a problem - but it depends on the equation and the initial/boundary condition. Further more, for some (nonlinear) differential equations, problems with disconutities occur and you can end up with oscillation effects. There are schemes that circumvent problems like this but you have to invest into the algorithm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The finite element method is a more general notion. Since SPDEs are defined by their (Ito-) integral formulation an approach that approximates an integral-formulation will feel more natural. Thats because the payoff of a European Call (S-Variable) and the Brownian motion paths (t-Variable) are both not differentiable. Using finite difference methods for SPDEs most natural discretizations for &quot;differential operators&quot; does not give you the right scheme as far as I know. That would be another hint that points into the finite element direction a little bit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One problem with comparing the performance of the two is definitely that there are so many different schemes (implicit/explicit of different ordes for finite differences and choices of basis functions and local refinement techniques for finite elements) that it is impossible to say.&#xA;Maybe for some choice of model and initial/boundary condition one method will outperform the other but I think its hard to generalize.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastEditorUserId="2727" LastEditDate="2012-11-28T15:33:23.260" LastActivityDate="2012-11-28T15:33:23.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4643" PostTypeId="1" AcceptedAnswerId="4646" CreationDate="2012-11-28T19:37:32.673" Score="6" ViewCount="3755" Body="&lt;p&gt;Does anyone know if I can access interest rates series from the treasury using R? I tried yahoo! Finance and it doesn't seem to have this kind of information.&lt;/p&gt;&#xA;" OwnerUserId="228" LastEditorUserId="467" LastEditDate="2012-11-28T22:30:08.513" LastActivityDate="2012-11-28T22:30:08.513" Title="Treasury Bond Yield Curves in R" Tags="&lt;programming&gt;&lt;fixed-income&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4644" PostTypeId="2" ParentId="4643" CreationDate="2012-11-28T19:50:04.383" Score="3" Body="&lt;p&gt;Try the Fed's H15 series. Daily data is here, with links to historical: &lt;a href=&quot;http://www.federalreserve.gov/releases/h15/update/&quot; rel=&quot;nofollow&quot;&gt;http://www.federalreserve.gov/releases/h15/update/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1780" LastActivityDate="2012-11-28T19:50:04.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4645" PostTypeId="2" ParentId="4643" CreationDate="2012-11-28T21:07:29.940" Score="3" Body="&lt;p&gt;There are some interest rates accessible through the R package &lt;a href=&quot;http://cran.r-project.org/web/packages/YieldCurve/YieldCurve.pdf&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;YieldCurve&lt;/code&gt;&lt;/a&gt;. I don't think they contain the latest available interest rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another alternative is the package &lt;a href=&quot;http://cran.r-project.org/web/packages/FRBData/&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;FRBData&lt;/code&gt;&lt;/a&gt;. Using the function &lt;code&gt;GetInterestRates&lt;/code&gt; you can download various of the latest interest rates published by the FRB.&lt;/p&gt;&#xA;" OwnerUserId="1531" LastActivityDate="2012-11-28T21:07:29.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4646" PostTypeId="2" ParentId="4643" CreationDate="2012-11-28T22:10:03.480" Score="6" Body="&lt;p&gt;&lt;a href=&quot;http://www.quantmod.com/examples/intro/&quot; rel=&quot;noreferrer&quot;&gt;Quantmod&lt;/a&gt; package claims to support downloading data from Federal Reserve Bank of St. Louis Economic database, which contains plenty of &lt;a href=&quot;http://research.stlouisfed.org/fred2/categories/22&quot; rel=&quot;noreferrer&quot;&gt;rates time series&lt;/a&gt;. It should be pretty simple to get them into R using function &lt;code&gt;getSymbols&lt;/code&gt;, in the same manner as &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;getSymbols(&quot;DEXJPUS&quot;,src=&quot;FRED&quot;) # FX rates from FRED&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="370" LastActivityDate="2012-11-28T22:10:03.480" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4647" PostTypeId="1" AcceptedAnswerId="4659" CreationDate="2012-11-28T22:10:49.070" Score="1" ViewCount="1289" Body="&lt;p&gt;For a case study I have to work on for a university course, about a real-estate-development project, I need to simulate the financing with different proportions of equity (40%), senior loan (35%), junior loan (15%) (both from banks), and mezzanine financing (10%) (over 5 years, starting now). I tried to do research, mostly on the net, but did not find any credible sources. Can you give a hint where this can be found (I only need approximate values, to have an estimate)? Is there some national or international index or something similar?&lt;/p&gt;&#xA;" OwnerUserId="1817" LastActivityDate="2012-12-01T06:22:58.027" Title="What are current interest rates on senior/junior/mezzanine loans for e.g. real estate developers?" Tags="&lt;interest-rates&gt;&lt;banks&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4649" PostTypeId="1" CreationDate="2012-11-29T01:00:25.920" Score="4" ViewCount="719" Body="&lt;p&gt;&lt;em&gt;I posted this on Cross Validated a month ago, but I didn't get any answers.  Sorry for the second post!&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm wondering about the whole process of testing/data-mining for a strategy and THEN testing on bootstrapped data. Does it make sense to bootstrap your data first and then data-mine for the best result?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This came to me because my current strategy had significant decay when I tested it against the bootstrapped data. The initial strategy is one that re-balances between the SPY and the TLT on a monthly basis. Back-tested on 6 years worth of data (or 72 total trades), the strategy has a Sharpe of 2.06. But when I test it against the bootstrapped data, the Sharpe ratio drops significantly to 1.04.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems like I'm ultimately looking to raise the 1.04 number, and to do that I'll need to &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;start the data-mining process over again to find a new back-tested strategy&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;test again against the bootstrapped data.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So can I skip step #1? Obviously this will require some significant computational power.&lt;/p&gt;&#xA;" OwnerUserId="3278" LastEditorUserId="467" LastEditDate="2012-11-29T11:36:07.940" LastActivityDate="2012-11-29T11:36:07.940" Title="Bootstrapping first, then data mine?" Tags="&lt;backtesting&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4650" PostTypeId="2" ParentId="4649" CreationDate="2012-11-29T02:19:25.777" Score="2" Body="&lt;p&gt;It's good in the sense that the bootstrap will give you a more sobering view of reality. However, it is fairly difficult to perfectly capture all the relationships of financial assets via bootstrapping (dynamic auto and cross correlations, etc..). It would be great to see some comments on what people have been using.  From a data mining perspective, you might want to look into cross validation techniques as it helps you to avoid over-fitting.&lt;/p&gt;&#xA;" OwnerUserId="3040" LastActivityDate="2012-11-29T02:19:25.777" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4651" PostTypeId="2" ParentId="2019" CreationDate="2012-11-29T05:57:03.473" Score="9" Body="&lt;p&gt;I'd say to read Prof. Shreve's well-known two-volume textbook Stochastic Calculus for Finance I and II.&lt;/p&gt;&#xA;" OwnerUserId="3188" LastActivityDate="2012-11-29T05:57:03.473" CommentCount="0" CommunityOwnedDate="2013-07-22T11:12:50.077" ContentLicense="CC BY-SA 3.0" />
  <row Id="4652" PostTypeId="2" ParentId="4638" CreationDate="2012-11-29T18:31:34.737" Score="1" Body="&lt;p&gt;I had some thought about this. This assertion is false. The reason is the following.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a finite horizon problem with the time to maturity $t$, then there exists an optimal stopping boundary $B(t)$, such that if the stock price is at this level, we should exercise the option. Notice, this $B(t)&amp;gt;b$ and it is an increasing function of $t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we start our process, at $B(t)$ with amount of time $t$ left to run, then since we started at the optimal stopping boundary so $(K-x)^+ &amp;gt; \mathbb{E}_{B(t)} (K-X_\tau)^+$ for any stopping time $\tau&amp;lt;t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, the result I asked for is totally ridiculous, because as $t$ goes to $0$, $B(t) \uparrow K$. For small times, it is a lot better to stay where you are than let the process run on.&lt;/p&gt;&#xA;" OwnerUserId="3334" LastActivityDate="2012-11-29T18:31:34.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4653" PostTypeId="1" CreationDate="2012-11-29T21:17:15.407" Score="3" ViewCount="253" Body="&lt;p&gt;I need your point of view in evaluating the monthly performance of a desk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the daily &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;credit risk capital requirement (A);&lt;/li&gt;&#xA;&lt;li&gt;the net banking income or GNP (B).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What is the best measure of the performance:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;(B) at the end of the month /  (A) at the end of the month&lt;/li&gt;&#xA;&lt;li&gt;sum( (B) daily /(A) daily)&lt;/li&gt;&#xA;&lt;li&gt;sum( (B) daily /  average((A) daily))&lt;/li&gt;&#xA;&lt;li&gt;else?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3340" LastEditorUserId="848" LastEditDate="2012-11-30T16:10:21.660" LastActivityDate="2012-12-30T18:32:43.033" Title="desk's performance" Tags="&lt;backtesting&gt;&lt;fixed-income&gt;&lt;performance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4654" PostTypeId="2" ParentId="4317" CreationDate="2012-11-30T11:43:33.087" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://uk.reuters.com/article/2012/11/27/efsf-bond-idUKL5E8MR6I220121127&quot; rel=&quot;nofollow&quot;&gt;http://uk.reuters.com/article/2012/11/27/efsf-bond-idUKL5E8MR6I220121127&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nov 27: The order book on the European Financial Stability Facility one-year syndicated issue is over EUR 5bn according to a bookrunner on the deal. The eurozone rescue fund opened books this morning via JP Morgan, Morgan Stanley and Natixis at guidance of 0.23% to 0.25% with pricing scheduled for later on Tuesday. The transaction will be rated A-1+/P-1/F1+, which are EFSF's short-term debt ratings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The one year spike can be explained if it has been known few months in advance that eurozone large issue, with positive rates, was going to come, in one year eurobonds exactly, and not with longer maturities (Mario Draghi spoke in September about one up to three years). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Switzerland is staying positive for 1Y (the mass of EUR money was &quot;parked&quot;) while Denmark became a bit negative for 1Y as well (there is still scepticisme regarding the 1Y-EUR with Denmark continued to be considered a better option that Switzerand, which is not in the European Union).  &lt;/p&gt;&#xA;" OwnerUserId="2872" LastEditorUserId="2872" LastEditDate="2012-11-30T18:24:04.563" LastActivityDate="2012-11-30T18:24:04.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4655" PostTypeId="2" ParentId="4653" CreationDate="2012-11-30T18:01:48.460" Score="1" Body="&lt;p&gt;Practically, the best metric is the one your boss wants you to use. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternately, you can think of the return of the desk like a leveraged security, as described &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1675067&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. This would suggest that the daily performance would be calculated as the profit divided by the basis. If you want to express the return in terms of the capital requirement, then that's one option but you have the flexibility to use others. Once you have the returns, link them together as you normally would to obtain the monthly performance.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2012-11-30T18:01:48.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4656" PostTypeId="1" CreationDate="2012-11-30T20:00:29.733" Score="0" ViewCount="5332" Body="&lt;p&gt;I would like to, for example, access (and later, upload), for example, historical financial data for the S&amp;amp;P500.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If a piratebay for databases existed, maybe we could freely share information that deserves to be free already. Does such a site exist already? Mainly I'm just looking for financial data, but I'm developing data visualization software and would happily feast on as many datasets as I can download.&lt;/p&gt;&#xA;" OwnerUserId="3051" LastActivityDate="2014-08-24T20:59:47.613" Title="Is there a piratebay for data(bases)? (here, talking about historical financial data)" Tags="&lt;market-data&gt;&lt;data-mining&gt;&lt;historical-data&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ClosedDate="2012-12-01T04:33:05.550" ContentLicense="CC BY-SA 3.0" />
  <row Id="4657" PostTypeId="2" ParentId="4656" CreationDate="2012-11-30T23:02:41.923" Score="11" Body="&lt;p&gt;No - clearly you've not seen the licensing agreements the exchanges force you to sign (one way or the other). Generally such firms and individuals have greater utility from the money they'll make working with the data than risking going to jail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Market data is a 5bn / yr business. You're pushing the proverbial up-hill.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, you can get financial index data for free - with API access, no less, from sites as simple as Yahoo. Heck, if you're using R, you even get nice wrappers to the Yahoo Finance API via the &lt;code&gt;quantmod&lt;/code&gt; package. That will cover most of your use case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want good quality commercial data, it is stupid cheap from TickData and they have a nice db import front-end to make your life simple. The cost of the data is truly insignificant. Even for individuals / hobbyists. Comment: it will cost $98,800 for the whole package.&lt;/p&gt;&#xA;" OwnerUserId="1838" LastEditorUserId="-1" LastEditDate="2014-08-24T20:59:47.613" LastActivityDate="2014-08-24T20:59:47.613" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="4658" PostTypeId="2" ParentId="4601" CreationDate="2012-11-30T23:06:17.303" Score="1" Body="&lt;p&gt;See Ralph Vince's excellentbook: &lt;em&gt;Handbook of Portfolio Mathematics&lt;/em&gt; where he goes through explicit, worked examples of using an appropriate modified-Kelly system in dollar / contract terms (Optimal F). He even gives Excel examples for the programmatically uninitiated.&lt;/p&gt;&#xA;" OwnerUserId="1838" LastActivityDate="2012-11-30T23:06:17.303" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4659" PostTypeId="2" ParentId="4647" CreationDate="2012-12-01T06:22:58.027" Score="1" Body="&lt;p&gt;The answer to this is, unfortunately, not straightforward due to the number of moving parts and no strong reference point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These types of interest rates can vary highly -- which, during the course of your studies, you will discover is partly a function of the risk-free rate and the risk-premium the project attracts with respect to similar projects. There is also a high degree of variability with respect to the real-estate developer's perceived credit risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can certainly back out much of the data you need using Aswath Damodaran's corporate finance database under the &quot;Updated Data&quot; tab:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://pages.stern.nyu.edu/~adamodar/&quot; rel=&quot;nofollow&quot;&gt;http://pages.stern.nyu.edu/~adamodar/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By point of reference, Senior Secureds generally represent 1x Assets or EV. Senior subs about 4-5x and Jnr Subs around 7-8x.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you really want to find is the spread these products currently have over LIBOR. As you're a student, you should be able to get access to Bloomberg where you can use the &lt;code&gt;YCRV&lt;/code&gt; function or any of the enormous cap structure / fixed income functions. Likewise via CapitalIQ.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Failing that you could try ValueLine - your school will almost certainly have a subscription - and again back out the implied rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a last ditch attempt, use the implied rates priced into ETFs of corporate bonds of differing grades. BarCap has quite a few of these listed in the US.&lt;/p&gt;&#xA;" OwnerUserId="1838" LastActivityDate="2012-12-01T06:22:58.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4660" PostTypeId="1" AcceptedAnswerId="4706" CreationDate="2012-12-01T18:35:55.190" Score="9" ViewCount="1786" Body="&lt;p&gt;Since the distribution of daily returns are obviously not lognormal, my bottom line question is has BS been reworked for a better fitting distribution?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Google searches give me nada.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best dist I've ever made fit is a double-sided exponential, but I'd easily settle for a regular exponential distribution for simplicity's sake.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there aren't any papers showing what the net result could be, can the cumulative distribution function of the standard normal distribution simply be replaced with the cdf of the the exponential distribution?  If so, do $d_1$ and $d_2$ have to be reworked?&lt;/p&gt;&#xA;" OwnerDisplayName="user3232" LastEditorUserId="35" LastEditDate="2013-02-16T19:24:59.493" LastActivityDate="2013-02-16T19:24:59.493" Title="How to improve the Black-Scholes framework?" Tags="&lt;black-scholes&gt;&lt;stochastic-processes&gt;" AnswerCount="5" CommentCount="9" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4661" PostTypeId="1" CreationDate="2012-12-01T21:45:47.100" Score="8" ViewCount="1859" Body="&lt;p&gt;I have a yield curve constructed using linear interpolation with data points every 3-months for US treasuries.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to use that calibrate a Ho-Lee model, but I can't wrap my head around how to calibrate theta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any implementation that I could use (preferably matlab, r or c++) or a detailed description of the algorithm that I could use for reference? I have found some notes on the optimal form of theta*, but it's described in continuous rather than discrete terms, so it's of limited use in my case.&lt;/p&gt;&#xA;" OwnerUserId="788" LastActivityDate="2016-06-09T17:47:14.977" Title="How does one estimate theta in the Ho-Lee model from a yield curve?" Tags="&lt;interest-rates&gt;&lt;yield-curve&gt;&lt;calibration&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4662" PostTypeId="2" ParentId="4660" CreationDate="2012-12-01T22:33:03.487" Score="5" Body="&lt;p&gt;Check out these resources:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The book &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470851562&quot; rel=&quot;nofollow&quot;&gt;Levy Processes in finance&lt;/a&gt;.  &lt;/li&gt;&#xA;&lt;li&gt;This paper basically enabling you to use any distribution for asset prices: &lt;a href=&quot;http://www.math.nyu.edu/~atm262/files/fall06/compmethods/a1/FFT_CarrMadan.pdf&quot; rel=&quot;nofollow&quot;&gt;Option Valuation Using the Fast Fourier Transform&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="3245" LastEditorUserId="467" LastEditDate="2012-12-02T21:47:06.983" LastActivityDate="2012-12-02T21:47:06.983" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4664" PostTypeId="1" AcceptedAnswerId="4685" CreationDate="2012-12-02T15:24:44.660" Score="12" ViewCount="598" Body="&lt;p&gt;I want to plot the density of the GBM in a 3d plot. So I have on one axis the stock price, on the other the time and on the z axis the density. At the end I want to produce this &lt;a href=&quot;http://de.wikipedia.org/w/index.php?title=Datei%3aGBM_density_develop.png&amp;amp;filetimestamp=20110102214317&quot;&gt;graph&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The formula I tried to implement can be found on &lt;a href=&quot;http://en.wikipedia.org/wiki/Geometric_Brownian_motion#Properties_of_GBM&quot;&gt;Wikipedia&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my approach:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mu &amp;lt;- 0.1&#xA;sigma &amp;lt;- 0.1&#xA;S0 &amp;lt;- 100&#xA;&#xA;color &amp;lt;- rgb(85, 141, 85, maxColorValue=255)&#xA;&#xA;x &amp;lt;- seq(100, 112, length=40)&#xA;y &amp;lt;- seq(0.25, 1.1, length=25)&#xA;&#xA;f &amp;lt;- function(s, t) {&#xA;  dlnorm(s, meanlog=log(S0) + ((mu - 1/2 * sigma^2) * t), &#xA;         sdlog=sigma * sqrt(t))&#xA;}&#xA;&#xA;z &amp;lt;- outer(x, y, f)&#xA;&#xA;persp(x, y, z, theta=160, phi=25, expand=0.75, col=color,&#xA;      ticktype=&quot;detailed&quot;, xlab=&quot;s&quot;, ylab=&quot;time&quot;, zlab=&quot;density&quot;&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But it looks clearly wrong. So where is my mistake?&lt;/p&gt;&#xA;" OwnerUserId="3298" LastEditorUserId="848" LastEditDate="2012-12-02T21:12:49.747" LastActivityDate="2012-12-05T07:29:36.807" Title="GBM 3d plot with R" Tags="&lt;r&gt;&lt;brownian-motion&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4668" PostTypeId="2" ParentId="4660" CreationDate="2012-12-02T22:33:53.013" Score="1" Body="&lt;p&gt;I would like to provide an answer with a bit more embedded details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The weaknesses of the Black-Scholes framework you refer come from the fact that it assumes that stock prices are following a &lt;a href=&quot;http://en.wikipedia.org/wiki/Geometric_Brownian_motion&quot; rel=&quot;nofollow&quot;&gt;Geometric Brownian Motion&lt;/a&gt; (GBM). This model assumes that stock prices evolve as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dS_t = \mu S_t dt + \sigma S_t dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can solve this differential equation and get that, given $S_t$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ S_T = S_t e^{(\mu - \frac{\sigma^2}{2})(T-t) + \sigma (W_T-W_t)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means that stock prices are log-normally distributed, and that returns are normally distributed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, if you simply look at historical data, you can clearly see that returns do not seem to be normal. So it seems like GBM is an over-simplistic model for stock prices. Indeed, it fails to model (and this list is not exhaustive):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Skewness&lt;/li&gt;&#xA;&lt;li&gt;Excess kurtosis (i.e. it underestimates the probability of rare events)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Heteroscedasticity&quot; rel=&quot;nofollow&quot;&gt;Heteroskedasticity&lt;/a&gt; (the fact that, unlike in the GBM framework, it seems like $\sigma$ is not constant)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you want to find improvements to the BS model, you could google for derivative pricing methods which assume models including the features listed above. For example, you could look at Monte-Carlo approach using the &lt;a href=&quot;http://en.wikipedia.org/wiki/Autoregressive_conditional_heteroskedasticity&quot; rel=&quot;nofollow&quot;&gt;GARCH&lt;/a&gt; model.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2012-12-02T22:33:53.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4669" PostTypeId="2" ParentId="4503" CreationDate="2012-12-03T09:51:46.817" Score="2" Body="&lt;p&gt;I agree with some arguments above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One can find several explanattion to volatility smile:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Against the BS framework assumption, volatility is not constant and traders don't expect it to be constant&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;This is a matter of option supply and demand&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;volatility smile incorporates the kurtosis seen in the underlying&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;One can find hints on this issue in P.Wilmott's &lt;em&gt;Frequently asked question in quantitative finance&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="2220" LastActivityDate="2012-12-03T09:51:46.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4670" PostTypeId="2" ParentId="3094" CreationDate="2012-12-03T12:23:40.640" Score="3" Body="&lt;p&gt;If you're referring to &lt;a href=&quot;https://stats.stackexchange.com/questions/34396/im-getting-jumpy-loadings-in-rollapply-pca-in-r-can-i-fix-it&quot;&gt;this problem&lt;/a&gt; then there is a very complete answer on the cross validated stack exchange.  &lt;/p&gt;&#xA;" OwnerUserId="954" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2012-12-03T21:33:52.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4671" PostTypeId="2" ParentId="1374" CreationDate="2012-12-03T15:54:36.257" Score="1" Body="&lt;p&gt;It helps to think about what the Kelly criterion is attempting to achieve. The purpose of the Kelly criterion is to find a betting strategy that maximizes the geometric growth rate. In a portfolio management context where the investment universe contains a risk-free asset, it would be equivalent to (ignoring constraints)&#xA;$$&#xA;w\equiv argmax\left\{ median\left(\mu_{p}\right)\right\} &#xA;$$&#xA;where $\mu_{p}$ is the arithmetic return of the portfolio over the horizon and $w$ is a vector of weights.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When one adds the assumption that all security prices are log-normally distributed, people will often say that the above is equivalent to&#xA;$$&#xA;w\equiv argmax\left\{ w'm-\frac{1}{2}w'Vw\right\} &#xA; $$&#xA;where $m$ is the mean log return and $V$ is the log covariance matrix. This is typically considered to be equivalent to the mean-variance optimization with a risk aversion coefficient equivalent to 1. While it is true in the univariate case that by accounting for the formula for the median of the log normal distribution and how to convert a normal distribution and log distribution a version of this formula would be created, there are aggregation issues when switching from the multivariate normal to multivariate log normal. Also, when extending this to a non-normal case, it is inconvenient even if you assume away the aggregation issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another option is to instead optimize the arithmetic mean-variance problem (which is the second formula, but with the arithmetic mean and covariance matrices replacing the log versions) to construct the efficient frontier. Then, using the discrete points on the frontier, one can calculate the median return given each efficient portfolio (this is easy to do once the portfolio has been transformed into a univariate mean and variance, the problem above is the aggregataion of the whole portfolio). The investor would then select the optimal portfolio as the one with the largest median return. It would also be trivial to add constraints to the mean-variance problem in case the investor does not wish to have too much leverage (equivalent to a fractional Kelly-like solution). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can easily be extended to the non-normal case. The investor would calculate the efficient frontier as above, but when calculating the median return could use a simulation-based set of returns at the horizon. All that is required is to calculate the median of each portfolio using these returns and then find the portfolio with the largest median. A simple approach to non-normal Kelly.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2012-12-03T15:54:36.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4672" PostTypeId="1" AcceptedAnswerId="4694" CreationDate="2012-12-04T03:07:46.147" Score="7" ViewCount="676" Body="&lt;p&gt;When a researcher in economics or finance wants to apply a linear regression model but suspects a non-linear relationship between one of the regressors and the dependent variable, it is typical to also include the square of that regressor, then (maybe, but usually not) do something like a Ramsey RESET test afterwards.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is; why square it? Why not take the exponent (call it $x$) to be $x \in [1.5,2.5]$, for example? Getting the right &quot;shape&quot; of the line is impotant to make the assumption $E[\epsilon_i | \mathbf{X}]=0$ hold; there may be cases where $x=2$ does this well but in other cases something like $x=1.8$ might me more sensible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, of course, I'm talking about variables that assume strictly positive values so we don't get complex outcomes. An example is $Age$ in education$\to$income studies.&lt;/p&gt;&#xA;" OwnerUserId="3174" LastEditorUserId="3174" LastEditDate="2013-08-07T09:42:25.210" LastActivityDate="2013-08-07T09:42:25.210" Title="Why are regressors squared and not ^1.5 or ^2.2 or ^2.5?" Tags="&lt;research&gt;&lt;regression&gt;&lt;econometrics&gt;&lt;economics&gt;&lt;nonlinear&gt;" AnswerCount="2" CommentCount="8" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4673" PostTypeId="2" ParentId="4664" CreationDate="2012-12-04T04:10:39.647" Score="0" Body="&lt;p&gt;It looks like the wikipedia graph was made with a much smaller value for the volatility $\sigma$.  Try 0.01.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-12-04T04:10:39.647" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4674" PostTypeId="1" AcceptedAnswerId="4675" CreationDate="2012-12-04T07:09:03.647" Score="7" ViewCount="1900" Body="&lt;p&gt;Let's say stock price follows following process: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dS(t) = \sigma dW(t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W(t)$ is Standard Brownian motion. The initial level for the stock is $S(0)$. Define the average of stock price $Z(t)$ as: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Z(t) = \frac{1}{T}\int_0^T S(t)dt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the distribution of $Z(t)$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note: this was asked in one of quant interviews and I could not find any reference to it on the web and on this form.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you please help me on how to get started?&lt;/p&gt;&#xA;" OwnerUserId="3360" LastEditorUserId="467" LastEditDate="2012-12-04T15:52:48.583" LastActivityDate="2013-05-11T04:12:44.853" Title="What is the average stock price under the Bachelier model?" Tags="&lt;stochastic-calculus&gt;&lt;stochastic-processes&gt;&lt;brownian-motion&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4675" PostTypeId="2" ParentId="4674" CreationDate="2012-12-04T08:24:36.780" Score="7" Body="&lt;p&gt;The model for the stock is the Bachelier model with the solution&#xA;$$&#xA;S(t) = S(0) + \sigma W(t)&#xA;$$&#xA;Thus the law of the stock $S(t)$ is Gaussian with mean $S(0)$ and variance $\sigma^2 t$.&#xA;For average process $Z(T)$ is thus the average of linear Brownian motion, we can rewrite this as&#xA;$$&#xA; Z(T) = \frac{1}{T} \int_0^T S(0) + \sigma W(t) dt = S(0) + \frac{\sigma}{T}\int_0^T W(t) dt&#xA;$$&#xA;Thus all you need is the law of the average of Brownian motion. Is is clearly Gaussian. The mean is $S(0)$ and all you need is the variance. Using integration by parts you get the following expression for the integral of Brownian motion w.r.t. time. You can Google this on the web and find e.g. this &lt;a href=&quot;http://www.wiley.com/legacy/wileychi/brownianmotioncalculus/supp/BMC_slides_3_8.pdf&quot; rel=&quot;noreferrer&quot;&gt;document&lt;/a&gt; where it says that $\int_0^T W(t) dt $ is Gaussian with mean $0$ and variance $T^3/3$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, the distribution of the $Z(T)$ is Gaussian with mean $S(0)$ and variance $\sigma^2 T/3$ (as we devide by $T$ and it enters the variance with a square). Note that the variance of the average of Brownian motion is a third of the variance of BM itself.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="35" LastEditDate="2012-12-04T12:56:00.257" LastActivityDate="2012-12-04T12:56:00.257" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4676" PostTypeId="1" CreationDate="2012-12-04T08:38:13.193" Score="0" ViewCount="297" Body="&lt;p&gt;I recently found the following question: What is your profit estimate throwing a dice in the long run if you get 10 dollars for each time you hit 6 and lose 1 dollar for any other number?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to use probabilistic &quot;common sense&quot; to arrive to the following wrong answer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Probability tells me that every 6 throws I get one 6 and 5 different numbers. So every 6 throws my profit will be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;10x1 - 1x5 = $5&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if i keep throwing the dice forever i will have a steady flow of 5 bucks and I will eventually become a millionaire.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where am I wrong in my thinking?&lt;/p&gt;&#xA;" OwnerUserId="2762" LastActivityDate="2012-12-13T00:14:39.727" Title="Profit estimation with a dice: 10 dollars for 6, -1 dollar for anything else" Tags="&lt;statistics&gt;&lt;probability&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4677" PostTypeId="2" ParentId="4676" CreationDate="2012-12-04T08:47:19.300" Score="6" Body="&lt;p&gt;Its a simple expected value question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Probability of throwing a 6 is 1/6&#xA;Probability of not throwing a 6 is 5/6&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thus expected pay off per roll: 10 dollars * 1/6 + (-1 dollar) * 5/6 = 5/6 dollars&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: And several of your above assumptions are plain wrong:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&quot;Probability tells me that every 6 throws I get one 6 and 5 different numbers.&quot; -&gt; That is NOT what &quot;probability&quot; tells you. The result is an expected value, meaning, something you can expect on average given a large enough sample set. (please google &quot;law of large numbers&quot;)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Your profit will not necessarily be 5 dollars after 6 throws. -&gt; please see above&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&quot;So if i keep throwing the dice forever i will have a steady flow of 5 bucks and I will eventually become a millionaire.&quot; -&gt; No, you will end up with infinitely large wealth if you get to roll infinitely many times. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2012-12-04T09:20:18.873" LastActivityDate="2012-12-04T09:20:18.873" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="4678" PostTypeId="2" ParentId="4611" CreationDate="2012-12-04T15:18:54.790" Score="2" Body="&lt;p&gt;The problem is more that the article you read uses language that is not consistent with the way most people in finance talk. People typically call the difference between the nominal Treasury yield and an inflation-linked bond the breakeven inflation rate. When people look at the difference between the earnings yield and the nominal interest rate, they might say they are drawing conclusions based on the fed model. I don't think this difference necessarily deserves its own name, but people are familiar with the term fed model. Similarly when comparing the earnings yield to credit spreads, this is also similar to a different type of fed model, see the paper by Asness called &quot;Fight the Fed Model.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, these approaches are about identifying long-run relationships and investigating how they impact other variables (like stock or bond returns). The more general approach is to apply the Error Correction methodology (or VAR in levels). This approach will extract the long-run trends and account for mean-reversion, whereas using these differences is like imposing constraints on the regression coefficients.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2012-12-04T15:18:54.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4682" PostTypeId="1" CreationDate="2012-12-04T19:19:51.397" Score="7" ViewCount="5775" Body="&lt;p&gt;Some time ago I was talking to a representative of one of the leading quantitative hedge funds. We talked about recruitment and the following had me stunned:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The representative explained that they used to hire graduate statisticians and PhDs from Maths, Physics, CS but have not done so in recent years. They claimed that they found that the statistical techniques the firm was using were too advanced and that the learning curve for new hires from that category was too step. Unfortunately they were not prepared to give examples.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can somebody explain to me what techniques they might have been referring to? I am not looking for detailed insights into the strategies but rather the &quot;toolbox&quot; that firms use that would be too advanced for graduate statisticians or physics PhDs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would graphical models fall in that category?&lt;/p&gt;&#xA;" OwnerUserId="3364" LastEditorUserId="3364" LastEditDate="2012-12-04T21:15:46.990" LastActivityDate="2012-12-05T10:08:50.457" Title="What advanced statistical techniques are quant researchers using?" Tags="&lt;statistics&gt;" AnswerCount="3" CommentCount="8" FavoriteCount="3" ClosedDate="2012-12-05T10:56:08.507" ContentLicense="CC BY-SA 3.0" />
  <row Id="4683" PostTypeId="2" ParentId="4682" CreationDate="2012-12-05T00:34:25.067" Score="6" Body="&lt;p&gt;I'm converting my comment into an answer because, as far as I can tell from your question, it's an explanation based on &quot;real world&quot; experience with managers....&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I've found, in writing analytics software, is that many analysts &quot;abuse&quot; statistics to form invalid conclusions. I presume that when trained statisticians (or well published algorithms) disagree with their conclusions that the managers assume their methods are too advanced... when, in reality, they're just fallacious.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My theory is that many managers have avoided bringing in advanced mathematicians because they don't want applied math to expose just how much risk they're taking. They'd rather just call it alpha.&lt;/p&gt;&#xA;" OwnerUserId="2782" LastActivityDate="2012-12-05T00:34:25.067" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4684" PostTypeId="2" ParentId="4682" CreationDate="2012-12-05T05:53:32.953" Score="7" Body="&lt;p&gt;I believe your conversation counter party did not mean to say that the theoretical nature of the applied statistical techniques are too advanced for a graduate math/stats/CS level student to master. I venture to assume what he/she meant was that the applied tool sets specifically to financial trading at that specific firm are/were too advanced for someone fresh out of school to learn and apply in a short period of time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually, I believe this to be sometimes true as well, in case this is what he/she meant. First of all, I think the term and stigma attached to &quot;PhD&quot; level kind of work is hopelessly overrated. A PhD program, dissertation, and defense, means nothing else but that the candidate/holder has specialized on a topic and performed studies/reading in order to familiarize him/herself with the topic in order to do work on his/her own that deepens the understanding of the community which applies similar techniques. Having said that, one does not have to undergo such program in order to amass profound knowledge and add value by performing work in a particular area on his/her own. I have seen guys without college degree but an amazing knowledge (or should I say insight) of mass psychology and expertise in market intrinsics achieving promotion after promotion at major trading desks because of their superior return performance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Trading and also quant research requires a basic/advanced set of tools in order to understand the subject matter. But real success, from my experience, does not correlate with which school or academic program one underwent but highly correlates with an extraordinary passion for the particular job (as with everything in life), constant learning on the job and from others, an insight into how market players think and behave, time spent to study market structure, a healthy risk appetite but above all a deep respect and understanding of the risk-reward relationship. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Such skills and learned knowledge can often be as complex if not more complex than what PhD level students study and expose themselves to in the ivory towers of the world. Those skills and abilities, imho, often are lacking in many students who pursued relatively theoretical work in university. I loved to ask incoming PhD or science grad school students at my previous trading desks on the sell side what strategy ideas they had, what they think may be worthwhile pursuing, research wise. I asked them what ideas they would pitch to me on the spot. Most of the time there was a shocking silence afterwards and I immediately knew that such student hardly at all spent time on applying any of his/her knowledge to financial markets/time series/assets before. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This bridge/gap, imho, is what is much harder to overcome than learning the tool sets required to study and research financial markets. Additionally, many of such candidates lack a commercial way of thinking, they believe they are paid to perform research like the 1960s/1970s Bell lab guys. The life cycle of what works and does not work in finance is much shorter than in other disciplines and that is something that is very hard to teach and punch into a PhD who comes along with a somewhat academic arrogance, thinking he can conquer the world. Personally I have met countless top traders from universities I have hardly ever heard about, while I most never came across (personally) someone with a highly specialized advanced degree from a top school who beat the rest of the pack. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long story short, I believe that is what your representative may have meant and referred to. Knowing the theoretical tool is one thing, applying them to finance and extracting alpha requires a much vaster knowledge and is an entirely different thing. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2012-12-05T06:06:21.353" LastActivityDate="2012-12-05T06:06:21.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4685" PostTypeId="2" ParentId="4664" CreationDate="2012-12-05T07:29:36.807" Score="2" Body="&lt;p&gt;I think there is no mistake on your part, if you set &lt;code&gt;sigma &amp;lt;- 0.0045&lt;/code&gt; and &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x &amp;lt;- seq(100, 112, length=100) // Lower values produce jagged edges&#xA;y &amp;lt;- seq(0.25, 1.1, length=60)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;you'll get this:&lt;img src=&quot;https://i.stack.imgur.com/wFlVq.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With these parameters the density has about the same peak and the maximum of the density function also has a similar direction. Alas, a number of things are wrong with this plot: the sigma parameter has been changed and the maximum of the density function seems to decrease more slowly. However, the code produced is correct, since we can assume that plnorm is implemented correctly and the sdlog parameter is obviously correct. The mean parameter is also correct, the proof of that is left as an exercise ;) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can imagine you're not satisfied with the above argument but the plot from Wikipedia must be wrong. The volatility of a lognormal is given by $\sqrt{(e^{\sigma^2}-1) e^{2 \mu + \sigma^2}}$. For $t=1$ this evaluates to $11.08$, this is clearly much wider than the plot on Wikipedia, maybe the author forgot to include the stock price in his calculation of $\mu$. Compare with this &lt;img src=&quot;https://i.stack.imgur.com/ZsECh.png&quot; alt=&quot;enter image description here&quot;&gt; generated by&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mu &amp;lt;- 0.1&#xA;sigma &amp;lt;- 0.1&#xA;&#xA;S0 &amp;lt;- 100&#xA;&#xA;color &amp;lt;- rgb(85, 141, 85, maxColorValue=255)&#xA;&#xA;x &amp;lt;- seq(80, 130, length=100)&#xA;y &amp;lt;- seq(0.25, 1.1, length=60)&#xA;&#xA;f &amp;lt;- function(s, t) {&#xA;  dlnorm(s, meanlog=log(S0) + ((mu - 1/2 * sigma^2) * t), &#xA;         sdlog=sigma * sqrt(t))&#xA;}&#xA;&#xA;z &amp;lt;- outer(x, y, f)&#xA;&#xA;persp(x, y, z, theta=180, phi=25, expand=0.75, col=color,&#xA;      ticktype=&quot;detailed&quot;, xlab=&quot;s&quot;, ylab=&quot;time&quot;, zlab=&quot;density&quot;&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="848" LastActivityDate="2012-12-05T07:29:36.807" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4686" PostTypeId="2" ParentId="4682" CreationDate="2012-12-05T07:33:53.620" Score="8" Body="&lt;p&gt;I spoke to a quant trader from one of the leading quant proprietary trading firms about a year ago. Apparently, there was a point in time when they looked into applying machine-learning techniques to modelling problems. That would include things like neural networks, SVRs, graphical models and a bunch of other related stuff. These are essentially a kind of statistical approach much like the more mainstream quantitative models but arguably more advanced. However, they have since lost interest in this direction due to various difficulties.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These machine-learning approaches have their roots in the engineering and computer science domain in areas like computer vision, controls and AI. The problems dealt with in these fields are of a different nature as compared to those in modelling financial markets and thus really requires a different paradigm. Too many people who attempt to apply these techniques to finance does it blindly without examining whether the underlying assumptions are suitable for markets, and are simply using them &quot;out of the box&quot;. Essentially these quants have poor understanding of how these tools work and cannot apply them well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fact that many of these machine-learning techniques are presented as black-box models(they aren't really total black-boxes) don't help either. No decent firm in their right mind will place their trust in a black-box model when conventional methods are better understood and open to examination -- which is the whole point of quant trading anyway, to apply the scientific method to markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is not to say that machine-learning can't be used for such purposes, I believe there are firms and people that have found success with these methods. However this requires people with the proper expertise, which is rare. It is much easier to find people with working knowledge of conventional statistical techniques than those who are able to properly apply machine-learning. When you can't get good people, you can't build up the proper expertise in your firm and you're better off pursuing other ways. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think these difficulties however are not something inherent to machine-learning but because it is still in its infancy in this domain. Orthodox quantitative finance encountered its equivalent of these issues in its beginning as well but became more accepted as things became more widely understood. Machine-learning in finance is a promising direction and I think there's a good chance its potential will be realized in the near future.&lt;/p&gt;&#xA;" OwnerUserId="2886" LastEditorUserId="2886" LastEditDate="2012-12-05T10:08:50.457" LastActivityDate="2012-12-05T10:08:50.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4687" PostTypeId="1" CreationDate="2012-12-05T09:41:08.133" Score="5" ViewCount="1439" Body="&lt;p&gt;I'm looking for a forex brokerage that allows me to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;add limit orders to the order book and&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;trade against other clients&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I look at the looks of fxcm, alpari, robofx, ... it appears all that they do is:&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;1) take my order (only as a market order)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) take the prime they get from their liquidity&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) add 1 pip on it on either direction&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) process my order&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally, I'd like to be able to place orders to trade against other clients on the same brokerage/ECN.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any brokers that let me do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I'm looking for the smallest brokerage that'll let me test some algorithms before I get eaten alive by the teams of Stats PhDs, CS PhDs, and FPGA-weilding PhDs).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bonus points if it supports the FIX protocol.&lt;/p&gt;&#xA;" OwnerDisplayName="user2936" LastActivityDate="2020-07-14T05:03:40.610" Title="Forex ECN for Algorithmic Trading" Tags="&lt;fx&gt;&lt;high-frequency&gt;" AnswerCount="5" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4688" PostTypeId="2" ParentId="4687" CreationDate="2012-12-05T10:11:13.340" Score="2" Body="&lt;p&gt;I have recently been looking for the same type of broker. &lt;a href=&quot;http://www.100forexbrokers.com/stp-ecn-brokers&quot; rel=&quot;nofollow&quot;&gt;This link&lt;/a&gt; gives a list of brokers with the minimum deposit required and commission charged. It also gives a concise helpful descriptions of NDD, STP, ECN (right at the bottom).  &lt;/p&gt;&#xA;" OwnerUserId="3347" LastEditorUserId="35" LastEditDate="2012-12-07T19:16:14.293" LastActivityDate="2012-12-07T19:16:14.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4689" PostTypeId="1" CreationDate="2012-12-05T12:53:22.747" Score="4" ViewCount="909" Body="&lt;p&gt;General wrong way risk (GWWR) is defined as due to a positive correlation between the level of exposure and the default probability of the counterparty, due to general market factors. (Specific wrong way risk is when they are positively correlated anyway). According to the “Risk Concentration Principles” (bcbs63) “different entities within the conglomerate could be exposed to the same or similar risk factors or to apparently unrelated risk factors that may interact under some unusual stressful circumstances.” &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given that the different market factors tend have a stronger positive correlation when one is talking about the same country/region(mainly the base curves), the same industry (mainly the spreads), etc, should be the concentration risk (per region, industry,..) be used to model the general wrong way risk?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With 5 regions (Americas, UK, Europe(ex UK), Japan, Asia-Pacific(ex Japan) and 10 sectors (Energy, Basic Materials ,Industrails, consumer Cyclical, consumer Non-Cyclical, Health Care, Financials, Information Techniology, Telecomunication Services and Utilities), you should be able to get the GWWR from a sort of variance of the concentration from the average_of_sectors(ideally 10%) and average_of_regions (ideally 20%). When you have 40% of your exposure in Energy, 30% in Financials 20% in Telecomunication services and 10% in whatever else; well diversified. What I mean is, assuming that the rest of the parameters is all the same (same maturities, types of instruments=bonds -to simplify, pricipals, etc), the GWWR should be much larger for 40-10-40-10 than for 30-30-30-10.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ex1: A Swiss company receives CHF, buys materials in EUR and takes a loan in EUR to pay them. In case the EUR increases with respect to CHF, both the probability of default of the company (raw materials increase in price) and its exposure in CHF increase. As the default is a statistical property, having 40% of your portfolio as loans provided to many of such companies will make you notice the default (which does not any longer behave idiosyncraticly, as when you would have one company). Assume the lender does not structure its business around the EUR/CHF exchange risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ex2: You are a European lender 10 years ago. People buy houses and earn salaries in the local currency and take mortgages in CHF, as CHF had very low/the lowest interest rates. The CHF rises by 1.25, and the exposure rises by 25%. The probability of default rises, as the price of the house/collateral does not rise in the local currency and the monthly rate to pay goes well over the allowed indebtment percentage.If you are providing many of such mortgages, you are exposed to GWWR proportional to their concentration with respect to your portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is if general wrong way risk is not a form of double counting (Should'nt wrong way risk include only the specific wrong way risk?) Could someone,please, give an example of GWWR where concentration is not a factor?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess that one can regress credit risk/hazard rates on market factors and look for strong correlations, but this should already be accounted for by the stressed VaR.&lt;/p&gt;&#xA;" OwnerUserId="2872" LastEditorUserId="2872" LastEditDate="2014-08-20T01:17:41.363" LastActivityDate="2015-05-17T06:42:05.460" Title="Is it possible to model general wrong way risk via concentration risk?" Tags="&lt;basel&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4691" PostTypeId="2" ParentId="4687" CreationDate="2012-12-05T17:44:50.680" Score="4" Body="&lt;p&gt;You did not give an indication of how much you intend to fund your &quot;operations&quot; with thus disregarding this, I can recommend the following from personal experience:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Interactive Brokers (Excellent fx executions/fills, zero to extremely manageable slippage, highly competitive spreads and commission structure for what you get, FIX protocol, ECN based business model. Minus: Snapshot data, no true tick based data. )&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Lmax (one of the best APIs I have seen and interesting business model, ECN)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;FXAll (superior executions and liquidity, tight spreads, manageable commission structures, FIX connectivity, ECN&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;DukasCopy (pretty well established Swiss broker, tight spreads, ok liquidity,FIX connectivity, ECN based business model)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Caveat: It all depends on how much size you intend to trade (not all brokers/ECNs offer equally superior liquidity), which pairs you want to trade (not everyone offers competitive emerging market currency executions), what exact connectivity you seek, and even more importantly what trade frequency you target (= whether you want to be co-located or not). &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-12-05T17:44:50.680" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4693" PostTypeId="1" CreationDate="2012-12-05T17:57:26.197" Score="4" ViewCount="126" Body="&lt;p&gt;&lt;em&gt;Subtitle: Estimating the correlation of the shocks driving two commodities in&#xA;two multi-factor models&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am fitting two 2-factor models to electricity and gas futures, respectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to extend this framework to a multi-commodity model I have to&#xA;integrate correlation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The models are (&lt;a href=&quot;http://en.wikipedia.org/wiki/Heath%E2%80%93Jarrow%E2%80%93Morton_framework&quot; rel=&quot;nofollow&quot;&gt;HJM-type model from forward interest rate models&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{dF_{E} (t,T)}{F_{E} (t,T)} =σ_{1,E} (t,T) dW_{1,E} (t)+σ_{2,E} (t,T) dW_{2,E} (t) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \frac{dF_{G} (t,T)}{F_{G} (t,T)}=σ_{1,G} (t,T) dW_{1,G} (t)+σ_{2,G} (t,T)dW_{2,G} (t) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $dW$ are Brownian Motion increments and $F(t,T)$ are the futures prices at $t$ with maturity $T$ for electricity (E) and gas (G). That is, the logarithmic return on&#xA;the futures is modeled (fraction on the left side of equation).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I estimate the volatility functions σ via Principal Component&#xA;Analysis, so $dW_{1,E} (t)$ and $dW_{2,E} (t)$ are independent by&#xA;definition. &#xA;The same applies for the two Brownian Motions driving the&#xA;futures price changes for gas futures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But since electricity and gas futures prices are correlated, I would&#xA;like to model this correlation by correlating the Brownian Motions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for 4 correlation coefficients:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dW_{1,E} (t) $ to $ dW_{1,G} (t) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dW_{1,E} (t) $ to $ dW_{2,G} (t) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dW_{2,E} (t) $ to $ dW_{2,G} (t) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dW_{2,E} (t) $ to $ dW_{1,G} (t) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I wanted to estimate which shocks $dW$ led to a specific original&#xA;(observed) return series $\frac{dF(t,T)}{F(t,T)}$ and then calculate how these&#xA;shocks are correlated. Then I would just use BMs with that&#xA;correlations in my model. The problem I have is that I have two shocks&#xA;to estimate, for electricity $dW_{1,E} (t)$ to $dW_{2,E} (t)$, but&#xA;only one return data point and thus only one equation. Nevertheless, I&#xA;know $dW_{1,E} (t)$ to $dW_{2,E} (t)$ are independent standard&#xA;normally distributed. Does that help?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have any ideas how to solve that equation for the shocks?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or any ideas how else the correlation could be integrated into this model?&lt;/p&gt;&#xA;" OwnerUserId="3373" LastEditorUserId="3373" LastEditDate="2012-12-05T20:10:29.063" LastActivityDate="2012-12-05T20:10:29.063" Title="Estimating two normal random numbers with one equation" Tags="&lt;futures&gt;&lt;factor-models&gt;&lt;brownian-motion&gt;&lt;pca&gt;&lt;multivariate&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4694" PostTypeId="2" ParentId="4672" CreationDate="2012-12-05T18:21:37.350" Score="6" Body="&lt;p&gt;I basically agree with @John, let me expand:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We want to model $y$ using a simple linear model, the most basic setup is&#xA;$$&#xA;y = c + \mathbf{X}\beta&#xA;$$&#xA;with $y$ the $N$ observations, $c$ a constant, $\mathbf{X}$ the $N \times M$ matrix of regressors and $\beta$  a $M$-dimensional vector of coefficients. This model has $M$ parameters, the elements of $\beta$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above model is estimated and the Ramsey RESET test finds that the model to be misspecified and the researcher wants to fix this. As you propose the above model is easily extended&#xA;$$&#xA;y = c + \mathbf{X}\beta + \mathbf{X}'\gamma&#xA;$$&#xA;where $\mathbf{X}'_{i, j} = \mathbf{X}_{i, j}^{e_i}$, $\mathbf{e}$ is a $M$-dimensional vector and $\gamma$ a $M$-dimensional vector of coefficients. This model has $3M$ parameters, the elements of $\beta$, $\gamma$ and $e$ and much harder to estimate because of the nonlinearity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be easily solved by fixing all $e_i$ a priori. This yields another question: to which value do we fix it? As @pat notes, raising to a non-integer is a bad idea in the general case. But, as you note, one could use the absolute of the regressor raised to a rational exponent since $f(q) = |a^q|$ is continuous and real for all real $q \in \mathbb{Q}$. So why the insistence on integer valued exponents? One simple reason is laziness: it is much simpler to compute $x^2$ than $x^{1.95}$, a second reason is convention. A third reason is that small changes in the exponent have a small impact on the model. These arguments do not apply to the case where a rational exponent would yield a significant improvement. Unfortunately this has severe methodological problems: as argued above, making the exponent parameters makes estimation much harder and, perhaps more importantly, reduces parsimony. The last option of fixing the exponent is possible. However it would require a strong economic argument to defend this particular choice. If your application is such that it is absolutely clear that exponentiation with $q \in \mathbb{Q}$ is justified then you're free to do that. There are no methodological problems that I know of. But prepared for your critics who will notice and wil require justification of your particular choice for $q$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another reason to choose $e_i = 2$ is the symmetry with taking cross products of the regressors, from this perspective is a square is a cross product with itself.&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="848" LastEditDate="2012-12-06T20:18:19.183" LastActivityDate="2012-12-06T20:18:19.183" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4695" PostTypeId="1" CreationDate="2012-12-05T23:12:25.827" Score="3" ViewCount="299" Body="&lt;p&gt;I have a few different questions on topics involving an doing risk management in life insurance. If someone could shed some light on these issues, I would be very thankful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) How does an actuary do the solvability calculations as imposed by Solvency II in practice? What does this look like?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) What does an internal model in life insurance look like?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;c) What does the implementation of risk limit systems look like?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;d) What are the most important risks that life insurance companies face? Obviously, the fluctuation of interest rates is one such risk. What are others?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e) Why is it worse for a life insurance company if the market's interest rate rises? If the interest rate grows, then the bonds are worth less. But if the interest rate drops, then the company's investments don't generate as much revenue. So why is it worse if the interest rates rise?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would be very grateful for some resources, where these subjects are explained, in an easy to understand language.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few other questions on different topics:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;For which casualty lines are heavy tail distributions used, except fire and liability (industry)?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Similarly, where are light tail distributions usually used?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is ruin theory used in practice? How strong are ruin probabilities dependent on the distribution class used in calculations?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What are the similarities and differences between Solvency II and MaRisk (VA)?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How do you determine the rating of a specific financial position if you know its VaR?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;As I said, if you can contribute in any way, so that I can get some answers to these questions, please do so. Your input is priceless for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much for your time! &lt;/p&gt;&#xA;" OwnerUserId="3375" LastEditorUserId="5883" LastEditDate="2016-02-24T19:30:21.517" LastActivityDate="2016-02-24T19:30:21.517" Title="Risk management insurance (Solvency II / MaRisk)" Tags="&lt;risk-management&gt;&lt;insurance&gt;&lt;solvency-ii&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4696" PostTypeId="2" ParentId="2079" CreationDate="2012-12-05T23:19:07.483" Score="1" Body="&lt;p&gt;Hi this is only an &quot;arbitrage&quot; if your vol forecast is accurate to the dot, which is not very practical. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The closest thing to vol arb is the &lt;a href=&quot;http://matdays.blogspot.co.nz/2011/09/dispersion-trade-explained-trading.html&quot; rel=&quot;nofollow&quot;&gt;dispersion trade&lt;/a&gt;, which gets you the return in the &quot;implied skew&quot;. &lt;/p&gt;&#xA;" OwnerUserId="3384" LastEditorUserId="35" LastEditDate="2012-12-07T19:14:43.870" LastActivityDate="2012-12-07T19:14:43.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4698" PostTypeId="2" ParentId="4611" CreationDate="2012-12-06T05:16:47.177" Score="0" Body="&lt;p&gt;Fisher's equation is what you need.&#xA;&lt;a href=&quot;http://en.wikipedia.org/wiki/Fisher_equation&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Fisher_equation&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2508" LastActivityDate="2012-12-06T05:16:47.177" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4700" PostTypeId="2" ParentId="4676" CreationDate="2012-12-06T05:39:26.027" Score="1" Body="&lt;p&gt;The key here lies in risk management. The dice player must survive the long strings of losing throws to make that money. Due to the high volatility of the expected return, even with Kelly's bet sizing, you wouldn't be able to put on huge bets with respect to bankroll.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kelly's formula&#xA;&lt;a href=&quot;http://matdays.blogspot.co.nz/2011/04/kelly-bet-sizing-equity-growth.html&quot; rel=&quot;nofollow&quot;&gt;http://matdays.blogspot.co.nz/2011/04/kelly-bet-sizing-equity-growth.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3384" LastActivityDate="2012-12-06T05:39:26.027" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4701" PostTypeId="1" AcceptedAnswerId="4764" CreationDate="2012-12-06T07:40:13.253" Score="6" ViewCount="23202" Body="&lt;p&gt;I am looking out for some material where I can study about Kalman Filter applied to Equity using Excel or R?&lt;/p&gt;&#xA;" OwnerUserId="926" LastEditorUserId="848" LastEditDate="2012-12-15T00:18:45.677" LastActivityDate="2014-12-01T15:13:40.033" Title="Kalman Filter Equity Example" Tags="&lt;statistics&gt;&lt;r&gt;&lt;quants&gt;&lt;kalman&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="22" ContentLicense="CC BY-SA 3.0" />
  <row Id="4702" PostTypeId="2" ParentId="4695" CreationDate="2012-12-06T10:11:44.833" Score="4" Body="&lt;p&gt;Well, 2 answers I knew right away :-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;d) That depends on what is insured. In classical life insurance (person gets sum insured in case of death only) one risk would be large catastrophes with many insured people involved (like 9/11, for example). A &quot;larger&quot; risk is, as you said, change in interest rate, though. In Germany (I don't know about other countries) there are mixed life insurance treaties where you get also money when reaching a certain age. For those contracts, longevity is a huge risk. That is, if people live longer in general, for example because of better medical care and therefore old/false probabilities are used for calculation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e) I think it is because the market interest rate is used as a benchmark in the portfolio management of the insurance company. On all the money you have from people insured, you have to earn (and pay them or write as benefit to their contract) the market interest rate. When it rises, but you have too many bonds etc. at a lower interest rate it is difficult to reach the rising interest rate on your overall assets / portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take care, regulations on life insurance are different in different countries...&lt;/p&gt;&#xA;" OwnerUserId="3381" LastActivityDate="2012-12-06T10:11:44.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4703" PostTypeId="2" ParentId="4701" CreationDate="2012-12-06T12:11:58.040" Score="13" Body="&lt;p&gt;A simple google search should get your started:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I like this one the best because it compares different packages: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stat-www.berkeley.edu/~brill/Stat248/kalmanfiltering.pdf&quot;&gt;http://stat-www.berkeley.edu/~brill/Stat248/kalmanfiltering.pdf&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;and here couple more:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.r-bloggers.com/the-kalman-filter-for-financial-time-series/&quot;&gt;http://www.r-bloggers.com/the-kalman-filter-for-financial-time-series/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://cran.r-project.org/web/packages/dlm/index.html&quot;&gt;http://cran.r-project.org/web/packages/dlm/index.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://cran.r-project.org/web/packages/FKF/index.html&quot;&gt;http://cran.r-project.org/web/packages/FKF/index.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://cran.r-project.org/web/packages/KFAS/index.html&quot;&gt;http://cran.r-project.org/web/packages/KFAS/index.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://cran.r-project.org/web/packages/schwartz97/index.html&quot;&gt;http://cran.r-project.org/web/packages/schwartz97/index.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.jstatsoft.org/v41/i04&quot;&gt;http://www.jstatsoft.org/v41/i04&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;But I highly recommend you to also read up on unscented kalman filters and particle filters because they are much more applicable to financial time series (handle non-normality):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Kalman_filter&quot;&gt;http://en.wikipedia.org/wiki/Kalman_filter&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://signal.hut.fi/kurssit/s884221/ukf.pdf&quot;&gt;http://signal.hut.fi/kurssit/s884221/ukf.pdf&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Particle_filter&quot;&gt;http://en.wikipedia.org/wiki/Particle_filter&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://user.uni-frankfurt.de/~muehlich/sci/TalkBucurestiMar2003.pdf&quot;&gt;http://user.uni-frankfurt.de/~muehlich/sci/TalkBucurestiMar2003.pdf&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://perso.uclouvain.be/michel.verleysen/papers/ffm07sd2.pdf&quot;&gt;http://perso.uclouvain.be/michel.verleysen/papers/ffm07sd2.pdf&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www2.mccombs.utexas.edu/faculty/carlos.carvalho/teaching/lopes-tsay-2010.pdf&quot;&gt;http://www2.mccombs.utexas.edu/faculty/carlos.carvalho/teaching/lopes-tsay-2010.pdf&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-12-06T12:11:58.040" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4704" PostTypeId="1" CreationDate="2012-12-06T22:17:14.880" Score="3" ViewCount="191" Body="&lt;pre&gt;&lt;code&gt;        +++++++ returns+++++++        === Coupon Return======///////  OAD  /////////&#xA;    Muni_return HY_return IG_return  Muni_coup HY_coup  IG_coup Muni_oad HY_oad IG_oad&#xA;11/30/07    1.11    -2.17   0.60    0.39    0.67    0.49    6.37    4.60    6.21  &#xA;12/31/07    0.28    0.29    0.16    0.38    0.70    0.49    6.39    4.55    6.23&#xA;01/31/08    2.03    -1.33   1.02    0.38    0.69    0.49    6.56    4.62    6.24&#xA;02/29/08    -4.15   -1.36   0.11    0.38    0.72    0.49    6.78    4.61    6.25&#xA;03/31/08    2.57    -0.34   -1.27   0.39    0.73    0.49    6.76    4.54    6.23&#xA;04/30/08    0.59    4.31    0.91    0.38    0.74    0.50    6.62    4.43    6.28&#xA;05/30/08    0.50    0.36    -0.95   0.38    0.71    0.50    6.52    4.39    6.20&#xA;06/30/08    -1.04   -2.80   -0.64   0.38    0.72    0.51    6.53    4.45    6.21&#xA;07/31/08    0.77    -1.33   -0.75   0.39    0.74    0.51    6.62    4.41    6.14&#xA;08/29/08    1.40    0.35    0.72    0.39    0.79    0.52    6.61    4.39    6.13&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hey guy I am stuck on a homework for one of my financial engineering classes. I apologize for the data formatting but I am trying to optimize by using Mean-Variance optimization of a portfolio of 3 assets of fixed income bond index securities (Muni, HighYield, InvestmentGrade). First Column is the date, the next 3 columns are the monthly percentage  returns, the next three are the coupon rates at the point in time of Muni,HY,IG, respectively. The last three are the option adjusted duration at the point in time of the bond, all he same order.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know how to do MVO optimization on any number of securities with returns. my problem are the coupons, how do I include the coupons into the MVO optimization?? These aren't stocks and I need to include the coupons in the optimization somehow. Anyone have any idea? Thank you!&lt;/p&gt;&#xA;" OwnerUserId="3388" LastEditorUserId="3388" LastEditDate="2012-12-06T23:37:56.393" LastActivityDate="2012-12-06T23:37:56.393" Title="Opimization on a Bond Portfolio" Tags="&lt;fixed-income&gt;&lt;optimization&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4705" PostTypeId="2" ParentId="4496" CreationDate="2012-12-06T22:44:00.287" Score="5" Body="&lt;p&gt;I don't think Girsanov's formula works when the volatilities are different between the P measure and P* measure.  P and P* will be singular with respect to each other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please see Prof. Goodman's class notes on page 11 at &lt;a href=&quot;http://www.math.nyu.edu/faculty/goodman/teaching/StochCalc2012/notes/Week10.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.math.nyu.edu/faculty/goodman/teaching/StochCalc2012/notes/Week10.pdf&lt;/a&gt; .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, from [ &lt;a href=&quot;http://ocw.mit.edu/courses/sloan-school-of-management/15-450-analytics-of-finance-fall-2010/lecture-notes/MIT15_450F10_lec02.pdf&quot; rel=&quot;nofollow&quot;&gt;http://ocw.mit.edu/courses/sloan-school-of-management/15-450-analytics-of-finance-fall-2010/lecture-notes/MIT15_450F10_lec02.pdf&lt;/a&gt; ] page 54:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;a probability measure assigns relative likelihood to different &#xA;  trajectories of the Brownian motion. Variance of the Ito process can be &#xA;  recovered from the shape of a single trajectory (quadratic variation), so it &#xA;  does not depend on the relative likelihood of the trajectories, hence, does not &#xA;  depend on the choice of the probability measure. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="3188" LastEditorUserId="3188" LastEditDate="2012-12-08T22:07:43.127" LastActivityDate="2012-12-08T22:07:43.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4706" PostTypeId="2" ParentId="4660" CreationDate="2012-12-06T23:16:33.913" Score="2" Body="&lt;p&gt;You're not gonna find much off google, since nobody's gonna go public with anything they develop to make money. Power Law distributions are a much better fit for financial returns than normal, also if you apply variance instead, it'd explain the OTM option values in a more practical manner. &lt;/p&gt;&#xA;" OwnerUserId="3384" LastActivityDate="2012-12-06T23:16:33.913" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4707" PostTypeId="1" AcceptedAnswerId="4710" CreationDate="2012-12-07T02:46:07.647" Score="0" ViewCount="4640" Body="&lt;p&gt;This is a simple problem but I'm not sure about one aspect of it.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A company has 15 year bonds outstanding, with a 5% annual coupon, a face value of \$1000, and a current market value of \$1100.  What is the company's pre-tax cost of debt?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm tempted to think it's just 5%, as when the company originally sold the bonds it received $1000 and is paying 5% coupons on that original face value, but the inclusion of the current market value is confusing me.  I'd appreciate any help you can give me.  &lt;/p&gt;&#xA;" OwnerUserId="3390" LastEditorUserId="467" LastEditDate="2012-12-12T23:18:44.173" LastActivityDate="2013-03-19T20:05:40.267" Title="Calculating pre-tax cost of debt" Tags="&lt;fixed-income&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4708" PostTypeId="1" AcceptedAnswerId="4941" CreationDate="2012-12-07T06:57:26.243" Score="5" ViewCount="1407" Body="&lt;p&gt;I am using a Hull &amp;amp; White model to simulate forward rates on US swap curve from the 1.10.2012. This is a part of a bigger picture, and I am interested in some reasonable values for the parameters alpha and gamma. Exactly calibrated values are not needed, so I thought it would be faster to ask here :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i.e. I want alpha and gamma so that the HJM-volatility is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma(t_i,t_j) = \alpha * e^{-\gamma (t_j-t_i)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and gives a reasonable shape. Top of the head-answers are encouraged.&lt;/p&gt;&#xA;" OwnerUserId="1583" LastEditorUserId="1583" LastEditDate="2012-12-07T08:56:11.953" LastActivityDate="2013-01-08T10:29:37.970" Title="Reasonable Hull &amp; White parameters" Tags="&lt;fixed-income&gt;&lt;hullwhite&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4709" PostTypeId="1" AcceptedAnswerId="4711" CreationDate="2012-12-07T12:05:19.383" Score="6" ViewCount="2129" Body="&lt;p&gt;I was reading a BMO paper which offered the following example of passive rebate arbitrage:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;For example, if BBD.b is trading at &lt;code&gt;$4.71&lt;/code&gt; - &lt;code&gt;$4.72&lt;/code&gt; with multiple players on each side, one might place a 'passive' order on TSX to buy 5000 shares at &lt;code&gt;$4.71&lt;/code&gt; Upon receiving a fill, then proceed to place a 'passive' offering on another marketplace that does not have a bid at &lt;code&gt;$4.71&lt;/code&gt;, thus locking the market:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;Bid                         Offer&#xA;TSX 5,000 $4.71           $4.71 5,000 Pure&#xA;TSX 10,000 $4.70          $4.72 15,0000 TSX&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Counting on one of the bidders on the TSX to move their order to Pure and buying their stock. This achieves buying and selling at 4.71 and collecting passive rebates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I understand correctly this would only work without Reg NMS? So you place a passive bid in TSX, lets say. And then as you get filled, you place a corresponding best offer at the same price level in a different exchange. This locks the market and without Reg NMS in place you could be getting filled in both places? Is this one of the reasons why Reg NMS bans locked markets? And also, if a market is locked with Reg NMS - is the only way of it unlocking by a match happening in the same venue or by a price slide?&lt;/p&gt;&#xA;" OwnerUserId="1456" LastEditorUserId="35" LastEditDate="2012-12-07T14:16:35.767" LastActivityDate="2012-12-07T14:16:35.767" Title="Understanding Passive Rebate Arbitrage" Tags="&lt;quant-trading-strategies&gt;&lt;arbitrage&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4710" PostTypeId="2" ParentId="4707" CreationDate="2012-12-07T14:03:10.087" Score="1" Body="&lt;p&gt;It's a simple TVM problem - solve for the interest rate.  The &quot;current&quot; cost of debt would be market determined, so that's why you use the market value.  It ties into how bond accounting works - the premium of the bond is amortized until maturity.  The amortization amount would be the difference between the coupon and the interest expense(market rate at issuance)&lt;/p&gt;&#xA;" OwnerUserId="2732" LastEditorUserId="2732" LastEditDate="2013-03-19T20:05:40.267" LastActivityDate="2013-03-19T20:05:40.267" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4711" PostTypeId="2" ParentId="4709" CreationDate="2012-12-07T14:15:56.530" Score="5" Body="&lt;p&gt;You are correct that this cannot happen under America's RegNMS. Of course, TSX is in Canada. This &quot;strategy&quot; also makes generous assumptions about the likelihood of getting filled on passive orders. I doubt the author of this paper ever had much success with this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If a passive order were to lock the market in RegNMS, then that order is usually routed to the exchange with the best price for an immediate fill. This information is then disseminated as a trade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if the order contains special instructions to only provide liquidity at that particular venue, then the order is either hidden or slid.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2012-12-07T14:15:56.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4712" PostTypeId="1" CreationDate="2012-12-07T19:37:22.683" Score="2" ViewCount="298" Body="&lt;p&gt;While using Merton (or any other) model, is the model-implied yield spread on bonds greater than actual yield spread? And is it possible to estimate actual probablities of default?&lt;/p&gt;&#xA;" OwnerUserId="3005" LastActivityDate="2012-12-10T15:06:05.467" Title="Model-implied yield spread on corporate bonds" Tags="&lt;spread&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4713" PostTypeId="2" ParentId="4674" CreationDate="2012-12-08T07:34:28.667" Score="7" Body="&lt;p&gt;I like Richard's answer, but I think we can compute the mean and the variance of $\int_0^T W_t dt$ by ourselves using Ito's lemma.  Let $f(W_t, t) = t W_t$.&#xA;$$&#xA; d( t W_t ) = W_t dt + t dW_t .&#xA;$$&#xA;Integrating both sides, and re-arranging the terms, we get&#xA;$$&#xA;  \int_0^T W_t dt = T W_T -  \int_0^T t dW_t \, .&#xA;$$&#xA;We'll be using Ito's isometry formula $\mathbb{E} \left[ \int_0^T f_t dW_t \int_0^T g_t dW_t \right] = \int_0^T \mathbb{E} \left[f_t g_t \right] dt$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The integral $\int_0^T W_t dt$ is a Gaussian random variable with zero mean&#xA;$$&#xA; \mathbb{E} \left[ \int_0^T W_t dt \right] = T \mathbb{E} \left[ W_T \right] - \mathbb{E} \left[ \int_0^T t dW_t \right] = 0,&#xA;$$&#xA;and variance&#xA;$$&#xA; \mathbb{E} \left[ \left(\int_0^T W_t dt \right)^2 \right] = T^2 \mathbb{E} [W_T^2] - 2 T \mathbb{E} \left[W_T \int_0^T t dW_t \right] + \mathbb{E} \left[ \left(\int_0^T t dW_t \right)^2 \right]&#xA;$$&#xA;$$&#xA;  = T^3-2 T \int_0^T t dt + \int_0^T t^2 dt = \frac{T^3}{3}. &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, continuing with Richard's derivations, $Z(T)$ is a Gaussian random variable with mean $S(0)$ and variance $\sigma^2 T/3$.&lt;/p&gt;&#xA;" OwnerUserId="3188" LastEditorUserId="3188" LastEditDate="2013-05-11T04:12:44.853" LastActivityDate="2013-05-11T04:12:44.853" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4715" PostTypeId="1" CreationDate="2012-12-08T22:33:32.730" Score="2" ViewCount="10458" Body="&lt;p&gt;I am having a difficulty conceptualizing the meaning of &quot;Macaulay duration&quot; - I want to note I completely understand the math, this isn't the issue. Modified duration &amp;amp; Efficitive Duration make total sense to me as they are refer to a first order approximation of a change in yield on the price of a bond (eg, a 100 bp change in yield causes price to increase/decrease 110 bp). But Macaulay duration is usually quoted in years/time. How does one interpret this? What does it mean for a bond to have a duration of 6 yrs? Can someone help enlighten me? Thank you!&lt;/p&gt;&#xA;" OwnerUserId="3388" LastEditorUserId="3388" LastEditDate="2012-12-09T18:59:17.023" LastActivityDate="2016-02-06T17:08:28.450" Title="Interpretation of Macaulay Duration" Tags="&lt;fixed-income&gt;&lt;duration&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4716" PostTypeId="2" ParentId="4715" CreationDate="2012-12-08T23:49:04.350" Score="7" Body="&lt;p&gt;Maccauly Duration means nothing else than that after the given amount of years, you will have your capital investment back as nominal amount.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have \$100 invested, and you have a duration of two years, after two years you will have gotten \$100 repaid, not directly dependent of interest rate or payment scheduling (indirectly they are of course!). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found &lt;a href=&quot;http://upload.wikimedia.org/wikipedia/en/1/17/Macaulay_duration_example.jpeg&quot; rel=&quot;noreferrer&quot;&gt;this image&lt;/a&gt; helpful:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/zJLt6.jpg&quot; alt=&quot;Macaulay duration example&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this example, the bond will be valued at 130.45, which is the sum of PV's of all CF's. After the MD - 1.78 years - you will have received exactly your capital investment, which was the nominal amount of the bond. You are investing the nominal amount and this series of cashflows is valued higher (which is economically reasonable, due to risk exposure!). So while the value of the bond is 130.45, after 1.78 years you will have exactly 100 in your hands, and receive the remainder - 30.45 - in the remaining lifetime of the bond (here thats 0.22 years). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see how the small payments sum up to the invested amount, and why the Macaulay Duration is always shorter than the period of payments of the bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course this number is not exact! You will not have 100 on your account after 1.78 years, but less. You will have to wait for the coupon payment after the MD to actually surpass the 100\$ (in the example thats the final payment.) &lt;/p&gt;&#xA;" OwnerUserId="1976" LastEditorUserId="1976" LastEditDate="2012-12-09T13:14:28.257" LastActivityDate="2012-12-09T13:14:28.257" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="4718" PostTypeId="2" ParentId="908" CreationDate="2012-12-09T07:19:27.953" Score="5" Body="&lt;p&gt;The answers above are good, but I suspect they will be unsatisfactory if you are looking for implementations that are successful in &lt;strong&gt;practice.&lt;/strong&gt; The sort of bottom-up analysis championed by Soros is very difficult to carry out in a rigorous, quantitative manner. This is true very generally, not just in finance. There are certainly models of financial markets that explicitly consider beliefs and actions of individual market participants (see &lt;a href=&quot;http://en.wikipedia.org/wiki/Game_theory&quot; rel=&quot;nofollow&quot;&gt;game theory&lt;/a&gt;), but these always rely on extreme oversimplifications of actual human cognition and behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, many seem to be able to develop a good intuitive sense for what sort of beliefs and biases are driving the behavior of financial market participants and exploit this knowledge. Soros is often counted among their ranks. Although this approach may be sophisticated, it is usually not considered quantitative. Soros often claims that he looks for a sort of &quot;turning point&quot; where market participants realize the flaws in their beliefs. This is in contrast with most quantitative models that implicitly assume that whatever structure is observed in the data will persist long enough for a profit to be extracted. &lt;/p&gt;&#xA;" OwnerUserId="3398" LastEditorUserId="467" LastEditDate="2012-12-12T18:42:31.327" LastActivityDate="2012-12-12T18:42:31.327" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4719" PostTypeId="2" ParentId="4715" CreationDate="2012-12-09T10:39:10.643" Score="3" Body="&lt;p&gt;The simple but accurate answer should be that Macaulay Duration is the weighted average maturity of cash flows (in years). That is how it is defined in almost every text book and looked at by most market practitioners. That is why its quoted in years and it gives an indication of when, on a weighted basis, cash flows are paid out (mature). For example, in the image of phi, the pv of cash flow at t1 (9.61) is paid out/matures at t1. In his example MD is 1.78 meaning the bulk of the maturity of cash flows occurs close to t2, simply because the last coupon is paid at t2 plus the par value is returned to the investor. I would not make it more complicated than it really is. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: The following link may make it clearer in case there is still confusion out there: &lt;a href=&quot;http://www.econ.ohio-state.edu/jhm/ts/duration.htm&quot; rel=&quot;nofollow&quot;&gt;http://www.econ.ohio-state.edu/jhm/ts/duration.htm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just keep in mind the MD of a zero-coupon bond equals the maturity of the bond.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2012-12-10T03:08:01.710" LastActivityDate="2012-12-10T03:08:01.710" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4721" PostTypeId="1" AcceptedAnswerId="4722" CreationDate="2012-12-09T13:23:18.677" Score="2" ViewCount="1805" Body="&lt;p&gt;I want to do a cross-sectional study where the historical, medium-long run volatility of some return series (call it $R_t$) is included as a regressor. Which of the following two estimates of volatility is superior in this context?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;$$\text{Option 1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, the simple standard deviation of historical returns over some window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\boxed{\text{std.dev.}(R_t) = \sqrt{E[(R_t-E[R_t])^2]}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Option 2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's set up the GARCH(1,1) as an example of an alternative;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Mean equation:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$R_t = \mu + \epsilon_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\epsilon_t = z_t \sigma_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$z_t \sim N(0,1)$, $\epsilon_t \sim N(0,\sigma_t)$&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Variance equation:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$\sigma_t^2 = \omega + k_1 \epsilon_{t-1}^2 + k_2 \sigma_{t-1}^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then we have that $E[\sigma_t^2] = \omega + k_1 E[\epsilon_{t-1}^2] + k_2 E[\sigma_{t-1}^2]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\implies E[\sigma_t^2] = \omega + k_1 E[\sigma_t^2] + k_2 E[\sigma_t^2]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\implies \boxed{E[\sigma_t^2] = \frac{\omega}{1-k_1-k_2}}$&lt;/p&gt;&#xA;" OwnerUserId="3174" LastActivityDate="2012-12-10T07:18:57.337" Title="Should I use GARCH volatility or standard deviation in cross-sectional regression?" Tags="&lt;volatility&gt;&lt;variance&gt;&lt;estimation&gt;&lt;garch&gt;&lt;econometrics&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4722" PostTypeId="2" ParentId="4721" CreationDate="2012-12-09T14:55:04.767" Score="2" Body="&lt;p&gt;I would recommend to use simple standard deviation (among the 2 options you offered). You are performing time series analysis of historical data points, you are not forecasting. Thus, why exposing yourself to a much more computationally intensive method? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;May I also point you to a related (not duplicate) thread: &#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/603/why-are-garch-models-used-to-forecast-volatility-if-residuals-are-often-correlat&quot;&gt;Why are GARCH models used to forecast volatility if residuals are often correlated?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2012-12-09T14:55:04.767" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4723" PostTypeId="1" CreationDate="2012-12-09T16:48:01.973" Score="0" ViewCount="1353" Body="&lt;p&gt;Let's say the characteristics that I am interested in are &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;FX &lt;/li&gt;&#xA;&lt;li&gt;Country&lt;/li&gt;&#xA;&lt;li&gt;Security selection&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I have the benchmark weights and returns, the FX returns, and the portfolio weights and returns. Can someone give a few pointers on how I would be able to get the performance attributions for 1,2,3? &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;" OwnerUserId="3400" LastEditorUserId="3400" LastEditDate="2012-12-09T18:18:13.680" LastActivityDate="2016-04-30T10:08:08.663" Title="How to do performance attribution for a few characteristics?" Tags="&lt;performanceanalytics&gt;" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4724" PostTypeId="2" ParentId="4723" CreationDate="2012-12-09T22:57:44.697" Score="1" Body="&lt;p&gt;You can approach this in two ways:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could calculate what is known as a naive currency attribution to measure the value added due to currency decisions.  This would give you one portion of the manager's value added.  You could then use a single factor Brinson model to calculate attribution in the local markets, which would give you a country allocation and a security selection.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you could, measure the manager's value added from currency decisions using the Karnosky Singer model. This would give you multiple components, including a value added due to currency decisions on the physical securities, and a value added due to hedging of currency.  Attribution if the local market value added would then be done using a Brinson style approach, after separating local Eurodeposit rates from local returns (these would be included in the currency part of the attribution).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Either approach could be done using arithmetic or geometric math.&lt;/p&gt;&#xA;" OwnerUserId="3402" LastEditorUserId="35" LastEditDate="2012-12-10T14:40:33.117" LastActivityDate="2012-12-10T14:40:33.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4725" PostTypeId="1" AcceptedAnswerId="4730" CreationDate="2012-12-10T01:32:10.207" Score="2" ViewCount="2030" Body="&lt;p&gt;Is there a way to make a hedged portfolio using two bonds, one is in EUR, the other one is in USD and FX forward contract? Assume that FX rate follows geometric Brownian motion movement. &lt;/p&gt;&#xA;" OwnerUserId="3378" LastActivityDate="2012-12-11T01:33:37.590" Title="hedging two bonds in different currencies with FX forward" Tags="&lt;fx&gt;&lt;hedging&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4726" PostTypeId="2" ParentId="4721" CreationDate="2012-12-10T07:18:57.337" Score="1" Body="&lt;p&gt;Neither of the options is strictly superior over the other. I agree with Freddy about the disadvantages of GARCH. On the other hand, correcting for heteroskedasticity can help your model and forecasts* if it is present and &lt;em&gt;persistent&lt;/em&gt;. Whether GARCH is your best choice is debatable. You could look at other sources to determine the volatility or, as an option 3, use &lt;a href=&quot;http://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average&quot; rel=&quot;nofollow&quot;&gt;EWMA&lt;/a&gt; on the data you already have to estimate volatility. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I assume you want to do forecasts at some point.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="848" LastActivityDate="2012-12-10T07:18:57.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4727" PostTypeId="2" ParentId="111" CreationDate="2012-12-10T11:59:43.470" Score="5" Body="&lt;p&gt;One possibility worth exploring is to use the support vector machine learning tool on the Metatrader 5 platform. Firstly, if you're not familiar with it, Metatrader 5 is a platform developed for users to implement algorithmic trading in forex and CFD markets (I'm not sure if the platform can be extended to stocks and other markets). It is typically used for technical analysis based strategies (i.e. using indicators based on historical data) and is used by people looking to automate their trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &quot;Support Vector Machine Learning Tool&quot; has been developed by one of the community of users to allow support vector machines to be applied to technical indicators and advise on trades. A free demo version of the tool can be downloaded &lt;a href=&quot;http://www.mql5.com/en/market/product/442&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt; if you want to investigate further. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I understand it, the tool uses historical price data to assess whether hypothetical trades in the past would have been successful. It then takes this data along with the historical values from a number of customisable indicators (MACD, oscillators etc), and uses this to train a support vector machine. Then it uses the trained support vector machine to signal future buy/sell trades. A better desciption can be found at the link.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have played around with it a little with some very interesting results, but as with all algorithmic trading strategies I recommend solid back/forward testing before taking it to the live market.&lt;/p&gt;&#xA;" OwnerUserId="3403" LastEditorUserId="35" LastEditDate="2012-12-10T14:42:12.883" LastActivityDate="2012-12-10T14:42:12.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4728" PostTypeId="2" ParentId="4712" CreationDate="2012-12-10T13:03:42.233" Score="1" Body="&lt;p&gt;First some remarks in a model agnostic sense. Credit spread is actually thought to be significantly &lt;em&gt;smaller&lt;/em&gt; than the actual one (some even say about 1/3 only, for corporates Longstaff 2005 reports the range 5%-25% for the default component), as there are many other factors such as liquidity. For PDs it might be slightly better to use CDS spreads. In any case what you'll get are risk neutral implied PDs, not objective ones; disentangling the &quot;actuarial&quot; credit spread from the proper credit premium is not easy (and beware that many improperly call &quot;premium&quot; the full risk neutral credit spread).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If a model returns a higher spread than the actual one, something has probably gone wrong. What are you calibrating to?&lt;/p&gt;&#xA;" OwnerUserId="3015" LastEditorUserId="3015" LastEditDate="2012-12-10T15:06:05.467" LastActivityDate="2012-12-10T15:06:05.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4729" PostTypeId="1" CreationDate="2012-12-10T17:42:33.713" Score="4" ViewCount="735" Body="&lt;p&gt;Given a fixed time period,say 3 days, the stock/market can go up,down or stay sideways. A hedge fund can long, short or use rangebound(options strategy) to bet for that 3 days closing level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hedge fund manager A opened long position the stock/market on monday.&#xA;On tuesday, there is some major news/economic data/earnings call that can be interpreted either way so the stock/market will breakout of the trading range to move in one unknown direction(3rd door is out).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hedge fund manager B comes along immediately after the news. Should he&#xA;(1) randomly pick one direction? &#xA;(2) instead of analysing market direction, find out fund manager A's position and bet the opposite?&lt;/p&gt;&#xA;" OwnerUserId="3085" LastActivityDate="2012-12-10T17:42:33.713" Title="Monty Hall Model" Tags="&lt;research&gt;&lt;modeling&gt;&lt;probability&gt;&lt;mathematics&gt;&lt;learning&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4730" PostTypeId="2" ParentId="4725" CreationDate="2012-12-11T01:02:41.283" Score="3" Body="&lt;p&gt;You can mitigate your fx exposure (hedge fx risk by engaging in an fixed/fixed fx swap. Let's setup an example: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You want to invest in two bonds, one EUR denominated and one USD denominated bond. Each bond pays semi-annual coupons (at the same dates for simplicity purposes) for the next two years. You are a US-based investor and thus want to earn returns on your investments in USD and not take exposure to fx fluctuations. You can trade an fx swap with the following cash flows:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;At initiation you provide USD based funding to your swap counter party in exchange for EUR based funding which you use to purchase the EUR bond (I do not go into the details of the exact amounts, if desired, we can go through the detailed math later). &lt;/li&gt;&#xA;&lt;li&gt;During the life time of the swap, every 6 months on the bond coupon payment settlement dates you receive a fixed payment denominated in USD and surrender a fixed (known) payment in euros to your counterparty. The euro amount equals the amount you receive as coupon payment from your eur bond investment. &lt;/li&gt;&#xA;&lt;li&gt;At maturity you receive back the USD swap notional and return the EUR notional you received at the outset of the swap agreement. This EUR notional is the amount you receive from the repayment of par of your EUR bond investment. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Now, obviously there will either be a mismatch of notional amounts either at the beginning or maturity of the bonds. As mentioned we can walk through a numerical example but obviously you want to match the notional exchanges at maturity and rather engage in a simple fx spot cash trade at the beginning to match notional amounts between swap notionals and bond cash present value (market prices). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please keep in mind that standard fx swaps only exchange cash flows at the initiation of the swap agreement and final settlement. But the swap can be structured, as above to exchange periodic cash flows in between. Also, note that you can trade forward-starting swaps in case you already own the bonds and want to have the swap cash flow dates match the bond coupon payment dates. Additionally, you may want to look at an un/mis-matched fx swaps, which basically allows you to exchange different notionals in the spot and forward transactions of the swap. Thus you can greatly customize the swap. But as with everything in life, the more you customize the more you will pay up to get the deal done with your counter party.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2012-12-11T01:33:37.590" LastActivityDate="2012-12-11T01:33:37.590" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4731" PostTypeId="2" ParentId="4723" CreationDate="2012-12-11T01:22:18.830" Score="0" Body="&lt;p&gt;I am not sure you need to setup complicated models to achieve what you try to get to (unless I misunderstand your question):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;FX: Let's say your portfolio base currency is USD and you want to know what the performance attribution is of changes in xxx/USD or USD/xxx rates. You simply identify assets in your portfolio that are denominated in non-USD currencies, such as EUR denominated bonds or European stocks denominated in EUR. You know the returns of EUR/USD and you know the assets' returns over your measure period. Simply strip the fx returns off the total asset's return and you get your relative fx attribution for that particular asset. You do that for all assets in your portfolio and aggregate the fx attribution to get a portfolio fx attribution. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Country : Not sure what you exactly mean but if you have a country benchmark then you can apply the above in similar ways: Just identify the assets that would be part of that country &quot;bucket&quot;, isolate the country benchmark return from your total asset's return and proceed as above.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Security selection? You mean asset class or individual asset? Either way, same as above. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The assumption of all that is that the residual return of each asset (after stripping off all other return attributions is the alpha (excess return) generated in each asset. This assumes you identify all return attribution that are not directly attributable to the asset itself (fx, country, industry, sector, ...).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example, you have a EUR denominated stock holding. You reduce the usd converted return of the stock over the observed period by eur/usd returns. If stock price changed between t0 -&gt; t1 from euro 100 -&gt; euro 150, and eur/usd rate changed from 1.30 -&gt; 1.40 then your usd denominated return is (150*1.4 / 100*1.3 - 1 =  61.5%) and has to be reduced by about 7.7% -&gt; 53.8% return. So fx attribution here is about 7.7% for this particular asset. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please clarify in case I misunderstood anything about your question. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-12-11T01:22:18.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4733" PostTypeId="1" AcceptedAnswerId="4734" CreationDate="2012-12-11T16:36:07.213" Score="2" ViewCount="318" Body="&lt;p&gt;What is the equivalent of product rule for stochastic differentials? I need it in the following case: Let $X_t$ be a process and $\alpha(t)$ a real function. What would be $d(\alpha(t)X_t)$?&lt;/p&gt;&#xA;" OwnerUserId="3378" LastEditorUserId="848" LastEditDate="2012-12-11T19:03:29.280" LastActivityDate="2012-12-11T19:03:29.280" Title="Simple question about stochastic differential" Tags="&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4734" PostTypeId="2" ParentId="4733" CreationDate="2012-12-11T17:34:30.400" Score="6" Body="&lt;p&gt;If $\alpha(t)$ is of finite variation, then the product rule is the same as in ordinary calculus:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;d(\alpha(t)X_t) = \alpha(t) dX_t + X_t d\alpha(t).&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you had $X_t$ and $Y_t$ as processes, you would get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;d(X_t Y_t) = X_t dY_t + Y_t dX_t + d [X,Y]_t.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $Y$ has finite variation, the last quadratic covariation term is zero.  The second equation is just applying Ito's Formula to $f(x,y) = xy$.&lt;/p&gt;&#xA;" OwnerUserId="3415" LastActivityDate="2012-12-11T17:34:30.400" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4735" PostTypeId="2" ParentId="519" CreationDate="2012-12-12T00:52:04.013" Score="3" Body="&lt;p&gt;Do his first step first; integrate both sides:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\displaystyle \ \ \int_0^T \frac{dS(t)}{S(t)} = \mu T - 0 \,\,\,\,\,\,\,\,\,\,\,(1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With zero diffusion, we know that $\langle S_.\rangle_t = 0$. Therefore, by applying Ito's lemma (or actually normal calculus):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d\ln{S(t)} = \frac{1}{S(t)}dS(t)\,\,\,\,\,\,\,\,\,\,\,(2)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sub this into $(1)$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\displaystyle \ \ \int_0^T d\ln{S(t)} = \mu T$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\therefore \ln{S(T)} = \ln{S(0)} + \mu T$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\therefore e^{\ln{S(T)}} = e^{\ln{S(0)}}e^{\mu T}$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\therefore \boxed{S(T) = S(0)e^{\mu T}}$$&lt;/p&gt;&#xA;" OwnerUserId="3174" LastActivityDate="2012-12-12T00:52:04.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4736" PostTypeId="1" AcceptedAnswerId="4767" CreationDate="2012-12-12T09:56:17.313" Score="1" ViewCount="624" Body="&lt;p&gt;When placing a trade with Stop Loss and Take Profit orders in a hypothetical random market (i.e. 0.5 probability of up tick and 0.5 probability of down tick), assuming:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;x is the distance in ticks of the SL order from the entry price.&#xA;y is the distance in ticks of the TP order from the entry price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do we calculate the probability of x being triggered first?&lt;/p&gt;&#xA;" OwnerUserId="3417" LastEditorUserId="3417" LastEditDate="2012-12-12T20:08:30.517" LastActivityDate="2012-12-17T02:40:41.780" Title="Probability of trade's exit orders being triggered in random-walk market" Tags="&lt;probability&gt;&lt;random-walk&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4737" PostTypeId="2" ParentId="3382" CreationDate="2012-12-12T11:14:37.747" Score="6" Body="&lt;p&gt;I am going to supply an answer that is quite similar to SRKX's (which is very very good) because I want to discuss in more detail a few important things. First, you cannot use a stochastic volatility model for the SDE that you've provided as that's GBM with constant diffusion. However, based on what you've said it's obvious you wish to model a discretized version of the following process:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\boxed{dS(t) = S(t)(\mu dt + \sigma(t)dW(t))}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W(t)$ is a standard scalar Brownian motion under the real-world probability measure, $\mu$ is its constant drift and $\sigma(t)$ is its volatility process which we assume to follow GARCH dynamics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Doing what we always do most of the time in finance research, I'm going to define returns as $R(t):= \ln{\frac{S(t)}{S(t-1)}}$. In the univariate setting, the mean equation of a ARCH/GARCH type model generally follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\boxed{R(t) = \mu + \sum_{i=1}^N a_i R(t-i) + b \sigma(t) + \mathbf{c}\mathbf{X(t)} + \sigma(t) (W(t)-W(t-1))}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $a_i$ are the AR(i) coefficients, $b$ is the coefficient of the garch-in-mean, $\mathbf{c}$ is a row vector of coefficients to some exogenous variables represented by column vector $\mathbf{X(t)}$. However, given the process that you've specified, we are restricted to a very specific mean equation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\boxed{R(t) = \mu + \sigma(t)(W(t)-W(t-1)) }$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W(t)-W(t-1) \overset{d}{=} W(1) \sim N(0,1)$. This restriction is not automatically troubling as it is prevalent when modelling DCC-fGARCH (time-varying correlations with family GARCH). However most studies that look to things such as bivariate variance spillovers (e.g., contagion research) or that are doing a study where univariate GARCH is involed (e.g., exchange rate exposure research where market returns and exchange rate returns are exogenous variables in the mean equation) will find this process to be inappropriate for their usage. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ignoring the empirical issues with the mean equation that follow from the proposed SDE, we can see that the mean equation representation follows from the fact that, at $\mathcal{F}_{0}$ and under real-world $\mathbb{P}$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S(t) = e^{\mu t + \sigma(t) W(t)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\therefore \ln{\frac{S(t)}{S(t-1)}} = \mu + \sigma(t) (W(t) - W(t-1))$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\, \overset{d}{=}\mu + \sigma(t) W(1) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Luckily, the variance equation is unconstrained, and we can use the GARCH model whose process is defined &lt;a href=&quot;http://en.wikipedia.org/wiki/Stochastic_volatility&quot;&gt;here&lt;/a&gt;. For a discretized econometric representation of GARCH(1,1) we have, as SRKX lays out;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\boxed{\sigma_t^2 = \omega + \alpha (W(t-1)-W(t-2))^2\sigma(t-1)^2 + \beta \sigma(t-1)^2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you should then proceed with your plan of discretization &lt;strong&gt;while using the correct mean equation that I boxed&lt;/strong&gt;. This is the default in R packages &lt;code&gt;ccgarch&lt;/code&gt;, &lt;code&gt;rugarch&lt;/code&gt; and &lt;code&gt;fGarch&lt;/code&gt;, so it's your lucky day!&lt;/p&gt;&#xA;" OwnerUserId="3174" LastActivityDate="2012-12-12T11:14:37.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4738" PostTypeId="1" AcceptedAnswerId="4761" CreationDate="2012-12-12T11:53:50.263" Score="8" ViewCount="8217" Body="&lt;p&gt;I would like to learn how to price options written on basket of several underlyings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've never tried to do it and I would appreciate if you can provide some documents, papers, web sites and so on in order I can collect materials to build my own step by step guide.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know the first step should be Black &amp;amp; Scholes formula, then I found out other methods exist like Beisser, Gentle, Ju, Milevsky etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the end of my studies, I would like to price basket options in &lt;code&gt;R&lt;/code&gt; building my own index by weighted sum of several assets' prices.&lt;/p&gt;&#xA;" OwnerUserId="3058" LastEditorUserId="848" LastEditDate="2012-12-12T13:08:40.067" LastActivityDate="2018-08-03T07:21:03.240" Title="Basket option pricing: step by step tutorial for beginners" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;basket&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="4740" PostTypeId="1" CreationDate="2012-12-12T15:22:17.230" Score="9" ViewCount="2396" Body="&lt;p&gt;For equity options, the pricing of options depends on the existence of a replicating portfolio, so you can price the option as the constituents of that replicating portfolio. However, I am not seeing how the same analysis can be applied to value interest rate options. Does the concept of replication apply to interest rate derivatives? If so, what would a replicating portfolio look like? &lt;/p&gt;&#xA;" OwnerDisplayName="user2163" LastActivityDate="2015-04-30T03:13:05.343" Title="Replicating portfolio and risk-neutral pricing for interest rate options" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;interest-rates&gt;&lt;replication&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4741" PostTypeId="1" CreationDate="2012-12-12T18:22:17.077" Score="-1" ViewCount="117" Body="&lt;p&gt;I'm trying to find extensions for my regression and obviously would like to use PE, BV and CFO. But I've got monthly data, while all company's fundamentals are semi-annually... Can I deal with it somehow? &lt;/p&gt;&#xA;" OwnerUserId="3418" LastEditorUserId="2379" LastEditDate="2012-12-12T21:49:11.903" LastActivityDate="2013-04-07T13:30:25.613" Title="Regression extensions" Tags="&lt;finance&gt;&lt;regression&gt;&lt;econometrics&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4742" PostTypeId="2" ParentId="4676" CreationDate="2012-12-13T00:14:39.727" Score="0" Body="&lt;p&gt;If you want to model this using probability theory, you can define a stochastic variable $X$ as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ X = \left\{ &#xA;  \begin{array}{l l}&#xA;    10 &amp;amp; \quad \text{with probability $p=\frac{1}{6}$}\\&#xA;    -1 &amp;amp; \quad \text{with probability $1-p=\frac{5}{6}$}&#xA;  \end{array} \right.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X$ models  the payoff of a trow of dice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As Freddy said, this is an expectation problem, so let's compute the expectation of $X$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbb{E}[X]  = 10 \cdot p + (-1) \cdot (1-p) = \frac{10}{6} + \frac{-5}{6} = \frac{5}{6} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, on average, you make on a single throw a profit of $\frac{5}{6}=0.83$ USD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, the term &quot;on the long run&quot; is a bit ambiguous in the question. To stay abstract and general, assume we make $n$ throws and we denote the $i$-th throw as $X_i$. We can model the result of $n$ throws as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S_n= \sum_{i=1}^n X_i$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To know the expected value of your wealth after $n$ throws, you need to compute the expectation of the variable $S_n$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbb{E} [S_n] = \mathbb{E} \left[ \sum_{i=1}^n X_i \right] = \sum_{i=1}^n \mathbb{E} \left[ X_i \right] = \sum_{i=1}^n \frac{5}{6} = n \cdot \frac{5}{6}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, over the long run (assumed to be $n$ throws), you can expect to make $ n \cdot \frac{5}{6}$ USD &lt;strong&gt;on average&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means that you could very well throw $n$ dices and get no 6, ending up with a wealth of $-n$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this is basic statistics, so I'll ask the question to be moved to Stats.SE.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2012-12-13T00:14:39.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4743" PostTypeId="1" AcceptedAnswerId="4744" CreationDate="2012-12-13T02:01:05.403" Score="0" ViewCount="227" Body="&lt;p&gt;How would one go about cloning/replicating returns of a hedge fund or a strategy. That is given a return series of the object to be clone, is it possible to decompose return and reconstruct another different passive strategy that generates return that are correlated above 75%+? &lt;strong&gt;Perfect replication is definitely not possible&lt;/strong&gt;, but I wanted to understand the process and possibly the success people have had in this area.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My initial thought on such subject would be to decompose its return using factor models...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some pictures (source: bwater):&#xA;Edit: 2012-12-14&lt;img src=&quot;https://i.stack.imgur.com/H8vur.png&quot; alt=&quot;enter image description here&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/vA2aN.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/4YY4j.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/iiat9.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2318" LastEditorUserId="2318" LastEditDate="2012-12-14T17:12:12.713" LastActivityDate="2012-12-14T17:12:12.713" Title="Cloning Return Streams" Tags="&lt;replication&gt;" AnswerCount="1" CommentCount="11" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4744" PostTypeId="2" ParentId="4743" CreationDate="2012-12-13T10:11:33.890" Score="4" Body="&lt;p&gt;You are treading controversial waters. It's hard to summarize, but at the risk of oversimplifying, there are three broad schools of thought:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&quot;Linear Models&quot;: Classic Examples are a string of papers from Jasmina Hasanhodzic&#xA;and Andy Lo at MIT (scholar.google.com should give you plenty). For similar work related to Mutual Funds that you may be able to repurpose you should look at the classic &quot;Sharpe Returns Based Style Analysis (aka RBSA)&quot; upon which most linear approaches are based.&lt;/li&gt;&#xA;&lt;li&gt;&quot;Non Linear and 'Mystery' models': (i.e. details undisclosed) models. Classic example is from the infinitely entertaining Harry Kat et al (examples include &quot;Tell Me What You Want, What You Really, Really Want!&quot; but if you google it, you'll need to add some sort of hedge fund replication tag to avoid getting nothing but Spice Girls references)&lt;/li&gt;&#xA;&lt;li&gt;&quot;It's not easy&quot;: Classic examples here are hard to find, but the most eloquent (and imho unbiased) are from Amenc et al at EDHEC. Examples include &quot;Performance of Passive Hedge Fund Replication Strategies&quot;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The short version, sadly, is that the general feeling (amongst the majority of academics, at least imho) is that what you are asking about is not easy to truly &quot;clone&quot; :-( but check out the references above anyway, perhaps you'll spot something new and interesting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having said that, many academics (and, apparently, some of your commenters) feel that most hedge fund &quot;alpha&quot; is really beta disguised as alpha. In that case, depending on what you mean by &quot;replicating returns of a hedge fund&quot; you may or may not have an plausible task on your hands. Replicating the &quot;beta&quot; portion of a hedge fund may indeed be possible. The classic reference here is probably any of the string of papers by Fung and Hsieh (again, scholar.google.com is your best friend).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bottom Line: it's a matter of opinion and if you had a more precisely stated question, you might get a more precise answer. I hope that helps at least a little :-)&lt;/p&gt;&#xA;" OwnerUserId="3425" LastEditorUserId="3425" LastEditDate="2012-12-13T11:57:10.930" LastActivityDate="2012-12-13T11:57:10.930" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4745" PostTypeId="2" ParentId="522" CreationDate="2012-12-13T10:40:45.700" Score="4" Body="&lt;p&gt;I'll throw this in as an &quot;application of RMT&quot; ... EDHEC and FTSE use RMT to decide the optimal number of principal components in their covariance estimation procedure for which they use PCA (Principal Component Analysis). For details look &lt;a href=&quot;http://ftse.jp/pdf/tokyo_equity_indices_and_benchmarks.pdf&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt; or &lt;a href=&quot;http://www.ftse.com/Indices/FTSE_EDHEC_Risk_Index_Series/Downloads/FTSE_EDHEC_Risk_Efficient_Index_Series_Rules.pdf&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt; in Appendix C section 4 for details.&lt;/p&gt;&#xA;" OwnerUserId="3425" LastActivityDate="2012-12-13T10:40:45.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4746" PostTypeId="2" ParentId="3458" CreationDate="2012-12-13T10:53:20.720" Score="0" Body="&lt;p&gt;OK, I'm going to be slightly facetious but I hope marginally helpful, by quoting legendary Prof. George E. P. Box: &quot;all models are wrong, but some are useful.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, yes, certainly, the binomial model is wrong. It is also incredibly useful!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where you are going wrong is using it as a continuous model (and using differential calculus) when it is intended to be a simplified discrete model of the world. The only changes that matter in this discrete model are discrete changes. If you look at everything as differences in value between t to t+1 then it all makes sense. Anything between t and t+1 (including at time t+$\delta$t) is undefined.&lt;/p&gt;&#xA;" OwnerUserId="3425" LastActivityDate="2012-12-13T10:53:20.720" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4747" PostTypeId="2" ParentId="565" CreationDate="2012-12-13T12:15:33.360" Score="2" Body="&lt;p&gt;This take into account three components:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Dynamic model for hazard rates (and thus cds). The dynamic is chosen to be lognormal (so it is always positive and arbitrage free) with constant volatility and mean reversion.&lt;/li&gt;&#xA;&lt;li&gt;The FX spot follows a BS dynamic with Jump at time of default. More complex dynamic for the model are not essential given that quanto CDS is a quasi linear payoff as function of the FX.&lt;/li&gt;&#xA;&lt;li&gt;Correlation between the hazard rate and FX spot.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;All these parameters are important for the pricing of quanto cds:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The jump size affect the overall level of the ratio quanto CDS/CDS. Example: jump size of 40% mean that the quanto CDS will be traded at -40% of CDS premium level (in absence of correlation between hazard rate and FX spot).   &lt;/li&gt;&#xA;&lt;li&gt;The correlation between hazard rates and FX spot affect more the long dated quanto CDS as the short dated quanto CDS are not affected too much by this correlation.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Calibration of the model parameters. The model is calibrated to two components:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The FX spot volatility is calibrated to ATM FX volatilities. The paper describe a calibration algorithm using forward PDE. However the paper about pricing quanto FTD which is a generalization of the pricing of quanto cds describe another calibration algorithm which is more simple to implement.&lt;/li&gt;&#xA;&lt;li&gt;Calibration of lognormal hazard rate process to a CDS curve. The calibration is done using forward PDE (could be done using a trinomial tree).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I think that those are the main risks embedded in quanto CDS trades. We could add to that stochastic interest rates if the trades are long dated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I said that this paper is very interesting, it is because it answers exactly the initial question posted here. I hope this will help answering the original question.&lt;/p&gt;&#xA;" OwnerUserId="3426" LastEditorUserId="848" LastEditDate="2012-12-13T18:08:46.360" LastActivityDate="2012-12-13T18:08:46.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4750" PostTypeId="1" CreationDate="2012-12-13T13:22:39.493" Score="0" ViewCount="479" Body="&lt;p&gt;I'm benchmarking some software and am looking for cards that are better at parallel multiplication vs parallel addition.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Is there any prior work that may have this information?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What GPU features should I look for?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1098" LastEditorUserId="35" LastEditDate="2012-12-14T04:29:04.213" LastActivityDate="2020-08-20T16:45:29.103" Title="Using OpenCL video cards to offload Quant Finance calculations, what features should I look for?" Tags="&lt;modeling&gt;&lt;hardware&gt;&lt;development&gt;" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4751" PostTypeId="1" CreationDate="2012-12-13T15:39:29.397" Score="5" ViewCount="939" Body="&lt;p&gt;I'm trying to figure out how one would apply the stress scenarios defined under the interest rate risk sub module of Solvency II. I understand that all future cash flows of an interest rate sensitive asset (e.g. a coupon bond) have to be discounted using shocked rates. The magnitude of shock to be applied for each maturity is provided by EIOPA for the up- and downward scenario. I'm not sure, however, to which rates the shocks should be applied. Regarding liabilities this seems to be the risk-free rate, but what about the asset side? Official documents don't seem very explicit on that. Could anyone clarify on that?&lt;/p&gt;&#xA;" OwnerUserId="3382" LastEditorUserId="5883" LastEditDate="2016-02-24T19:30:18.190" LastActivityDate="2016-02-24T19:30:18.190" Title="Applying interest rate shocks under Solvency II" Tags="&lt;risk-management&gt;&lt;insurance&gt;&lt;solvency-ii&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4753" PostTypeId="1" AcceptedAnswerId="4758" CreationDate="2012-12-14T11:41:27.130" Score="1" ViewCount="19255" Body="&lt;p&gt;I have two time series. One with monthly returns on an asset and one with monthly returns on a benchmark index. I have calculated the covariance using the &lt;code&gt;=COVARIANCE.P()&lt;/code&gt; formula in excel.&#xA;Further I want to look at the Beta and $R^2$ and therefore wonder:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any reasons to annualize the covariance? And if, how to do so? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Beta is the: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;... slope of the regression equation&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;so does it make any sense to annualize it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What about $R^2$?&lt;/p&gt;&#xA;" OwnerUserId="3337" LastEditorUserId="848" LastEditDate="2012-12-14T12:24:55.627" LastActivityDate="2012-12-14T15:30:23.803" Title="Annualized Covariance" Tags="&lt;covariance&gt;&lt;beta&gt;&lt;annualized&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4754" PostTypeId="2" ParentId="4753" CreationDate="2012-12-14T11:53:07.237" Score="0" Body="&lt;p&gt;Can you Annualize Covariance , Beta and R^2 ? Mathematically yes you can. For example you can multiple monthly returns by 12 for asset and benchmark. But Beta is slope regression equation as you pointed out so it will come back as exact same as non-annualized beta.&#xA;I cannot come up with any reason why you would like to annualize Covariance or R^2 as well.&lt;/p&gt;&#xA;" OwnerUserId="1386" LastActivityDate="2012-12-14T11:53:07.237" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4755" PostTypeId="2" ParentId="4750" CreationDate="2012-12-14T12:13:33.587" Score="1" Body="&lt;p&gt;That depends on your application, obviously. If you intend to run Matlab or Python on a single machine, and you're looking into which graphics card to buy, multiplication vs addition should not matter much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I that situation I would recommend an Nvidia card which features &lt;a href=&quot;http://en.wikipedia.org/wiki/CUDA&quot; rel=&quot;nofollow&quot;&gt;CUDA&lt;/a&gt;. For CUDA, there are lot of libraries available which make it easy to adapt existing code to run on the GPU. Of course you can add more GPUs for more performance using SLI whatever your Card requires.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mathworks has a nice &lt;a href=&quot;http://www.mathworks.de/discovery/matlab-gpu.html&quot; rel=&quot;nofollow&quot;&gt;overview&lt;/a&gt; that will help you getting started. For Python there is &lt;a href=&quot;http://mathema.tician.de/software/pycuda&quot; rel=&quot;nofollow&quot;&gt;PyCUDA&lt;/a&gt;, but i have only very limited experience with that. For Java and C++ there are options as well, bu I've never used those.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The downside of all this is that your code will be less portable as you will need to use gpuArrays (in Matlab), so if someone without a CUDA-Configuration attempts to run the code, it will fail. I have yet to find an elegant way around this (!= my boss sitting at my desk...)&lt;/p&gt;&#xA;" OwnerUserId="1976" LastActivityDate="2012-12-14T12:13:33.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4756" PostTypeId="2" ParentId="4753" CreationDate="2012-12-14T14:09:03.443" Score="0" Body="&lt;p&gt;Why not use correlation coefficient instead of covariance?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \rho_{x,y} = \frac{Cov_{x,y}}{std.dev_x * std.dev_y} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An issue with covariance is that it has units; correlation coefficient is unitless.&lt;/p&gt;&#xA;" OwnerUserId="2512" LastEditorUserId="2512" LastEditDate="2012-12-14T14:14:07.100" LastActivityDate="2012-12-14T14:14:07.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4757" PostTypeId="1" AcceptedAnswerId="4759" CreationDate="2012-12-14T15:02:35.937" Score="-2" ViewCount="208" Body="&lt;p&gt;In a campus library or other public place, typically many people share the same PC with the Bloomberg terminal software. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to prevent users from creating new logins? Is there a way to delete logins not authorised anymore?  &lt;/p&gt;&#xA;" OwnerUserId="3434" LastEditorUserId="3434" LastEditDate="2015-03-14T12:57:59.090" LastActivityDate="2015-03-14T12:57:59.090" Title="Managing Bloomberg logins in a campus library" Tags="&lt;bloomberg&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ClosedDate="2012-12-17T02:55:09.703" ContentLicense="CC BY-SA 3.0" />
  <row Id="4758" PostTypeId="2" ParentId="4753" CreationDate="2012-12-14T15:18:54.197" Score="1" Body="&lt;p&gt;If you assume that your monthly returns are independent from each other, then the annualized variance of each series, and the covariance can be annualized. This assumption allows you to use V(x1+X2+...+x12) = V(x1) + V(x2) + ... + V(x12) where xi is the return for the month &quot;i&quot;. Actually, for this to happen you only need a weaker assumption: that is that interperiod returns correlation or covariance be zero since V(x1 + .. + x12) = Sum(i=1..12,j=1..12,Cov(xi,xj)).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then if you add the &quot;identically distributed&quot; assumption which means that x1, ... , x12 are just the repetition of the same experiment and follows the same probabilistic law: you get in particular&#xA;E(x1) = ... = E(x12)     (same expected returns)&#xA;V(x1) = V(x2) = ... = V(x12)   (same variance)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, V(x1 + .. X12) = V(x1) + ... + V(x12) = 12 * V(x1)&#xA;That is: V(annual returns) = 12 times the variance of monthly returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Beta and R² are already &quot;normalized&quot; so no need to &quot;annualize&quot; them. Under the same assumptions, you are trying to explain one series of returns with the other using a linear model. Whatever the relation of monthly returns, you will have the same on annual returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Final remark: not that assuming independent expected returns means that your monthly returns have no memory. But sometimes, they do: the returns from month i and returns from month i+1 are correlated (see Markov chains for example).&lt;/p&gt;&#xA;" OwnerUserId="3435" LastEditorUserId="3435" LastEditDate="2012-12-14T15:30:23.803" LastActivityDate="2012-12-14T15:30:23.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4759" PostTypeId="2" ParentId="4757" CreationDate="2012-12-14T15:28:04.250" Score="4" Body="&lt;p&gt;No there is no way to restrict anyone from creating a new login and password. The point of this particular subscription is to have one local terminal that anyone with access to the terminal can use. Other subscriptions allow only one user access but in exchange offers that one user through a BB Anywhere addon (at no extra charge) can access the terminal from anywhere. So, I do not see your point why you would want to restrict anyone from accessing the terminal in your library. Creating new logins does not add any overhead, not memory wise, not CPU wise, and not hard drive disk space wise. Its not like a windows user where the machine sets up an entirely new path with tons of files and user configs. All configs of a BB users are saved and kept on the BB servers. I share this information because I know someone who works at BB. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If illegal content is disseminated over BB-chat or messages then you would want to talk to BB to get the users information so that you can follow up with the user yourself, but you would need to be an account authorized person to do so. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-12-14T15:28:04.250" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4761" PostTypeId="2" ParentId="4738" CreationDate="2012-12-14T21:37:46.513" Score="4" Body="&lt;p&gt;Once you have slogged through all the relatively useless theoretical literature, &lt;a href=&quot;https://www.feweb.vu.nl/en/Images/AmericanBasketOptions_tcm258-194676.pdf&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt; is a rediscovery (and pretty good write-up) of how basket option pricing is really done in serious quant packages at the big banks.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2016-03-02T17:11:35.580" LastActivityDate="2016-03-02T17:11:35.580" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4762" PostTypeId="1" AcceptedAnswerId="4763" CreationDate="2012-12-14T23:56:17.440" Score="-4" ViewCount="892" Body="&lt;p&gt;At the end of the academic year I will graduate with a Computer Science degree (hopefully) and I would like to peruse a career in quantitative finance. What is the dest way of doing this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it worth doing a doctorate like &lt;a href=&quot;http://www.findaphd.com/search/PhDDetails.aspx?CAID=384&amp;amp;LID=1626&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; from UCL or just get a job in the city with a hedge fund or bank. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where is the best place to start looking  for quant openings, websites, reciters, or other places?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I live just south of london so commuting is not a problem.  &lt;/p&gt;&#xA;" OwnerUserId="3347" LastEditorUserId="16595" LastEditDate="2018-09-06T07:33:37.507" LastActivityDate="2018-09-06T07:33:37.507" Title="How to get a Quant Job" Tags="&lt;career&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ClosedDate="2012-12-15T08:06:11.950" ContentLicense="CC BY-SA 3.0" />
  <row Id="4763" PostTypeId="2" ParentId="4762" CreationDate="2012-12-15T00:09:05.323" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://www.markjoshi.com/&quot; rel=&quot;nofollow&quot;&gt;Mark Joshi&lt;/a&gt; has a great collection of tips and interview questions on this topic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: A bit harder to spot, so here it is directly: &lt;a href=&quot;http://www.markjoshi.com/downloads/advice.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.markjoshi.com/downloads/advice.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1976" LastEditorUserId="1976" LastEditDate="2012-12-15T00:27:15.693" LastActivityDate="2012-12-15T00:27:15.693" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4764" PostTypeId="2" ParentId="4701" CreationDate="2012-12-15T00:55:40.740" Score="9" Body="&lt;p&gt;A great example of kalman filtering is in the Kyle Model. I have attached a presentation on the application of R to the kalman filter in the Kyle Model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.rinfinance.com/RinFinance2009/presentations/microstructure-tutorial.pdf&quot;&gt;http://www.rinfinance.com/RinFinance2009/presentations/microstructure-tutorial.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically in the Kyle Model, a market maker finds the likelihood an asset is ending up at a certain price given that a person is an informed trader. Given this, you update what the final price will be by each successive trade through a kalman filter&lt;/p&gt;&#xA;" OwnerUserId="3440" LastActivityDate="2012-12-15T00:55:40.740" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4765" PostTypeId="2" ParentId="4660" CreationDate="2012-12-15T00:59:43.847" Score="2" Body="&lt;p&gt;Stochastic vol models with jumps are an updated version of Black-Scholes model. Because of volatility clustering and jumps in equity prices, stochastic vol models with jumps make sense (however, indicies do seem to follow a diffusion process with just stochastic vol as they do not have jumps, especially if you look at it from a point of view of trade time). &lt;/p&gt;&#xA;" OwnerUserId="3440" LastActivityDate="2012-12-15T00:59:43.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4766" PostTypeId="1" CreationDate="2012-12-15T06:51:28.373" Score="5" ViewCount="1138" Body="&lt;p&gt;Suppose the application is linear models in financial econometrics. If we want to analyze stocks, the standard approach is to take the continuous/log return: $\ln{ \frac{P_t}{P_{t-1}} }$. Suppose, however, that I want to include &lt;em&gt;interest rates&lt;/em&gt; ($=:I_t$) as a regressor in my explanatory framework. How should I construct my regressor?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;$\ln{ \frac{I_t}{I_{t-1}} }$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$\frac{I_t}{I_{t-1}} - 1$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$I_t - I_{t-1}$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;They all result in $I(0)$ series at the $\alpha = 0.03$ level according to Augmented Dickey Fuller testing. The frequency is either daily (overnight rates) or monthly (monetary policy rates).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Edit: The variable $I_t$ is non-stationary (for monthly frequency) for most countries. &lt;/p&gt;&#xA;" OwnerUserId="3174" LastEditorUserId="3174" LastEditDate="2012-12-28T08:08:18.030" LastActivityDate="2013-01-12T21:51:19.913" Title="Regressor: Nominal return, continuous return or first difference?" Tags="&lt;time-series&gt;&lt;interest-rates&gt;&lt;regression&gt;&lt;econometrics&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4767" PostTypeId="2" ParentId="4736" CreationDate="2012-12-16T01:03:44.150" Score="2" Body="&lt;p&gt;The answer can be found &lt;a href=&quot;http://www.columbia.edu/~ks20/stochastic-I/stochastic-I-GRP.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; under &lt;em&gt;1.3) Random Walk Hitting Probabilities&lt;/em&gt; (when events have equal probability of $\frac{1}{2}$ each).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;p(a) = \frac{b}{a+b}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$p(a)$ would be the probability of take-profit hit first. To look at probability of stop-loss being hit first, just take 1 minus the above, resulting with $a$ on the top (where $a$ is take profit and $b$ is hit stop loss level, respectively).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can run this script I wrote in R, to verify:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;tw&amp;lt;-0; d&amp;lt;-function() sample(c(-1,1),size=1)&#xA;&#xA;#x=sl; y=tp&#xA;walk&amp;lt;-function(x,y){&#xA;for(i in 1:1000){&#xA;tw&amp;lt;- sum(tw+d())&#xA;if(tw== x || tw==y) break()}&#xA;return(tw)}&#xA;&#xA;sl&amp;lt;- -10; tp&amp;lt;- 20&#xA;res&amp;lt;-replicate(1000,walk(sl,tp))&#xA;resx&amp;lt;-length(res[res==sl])&#xA;resy&amp;lt;-length(res[res==tp])&#xA;resx/(resx+resy)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Result for hitting &lt;code&gt;x&lt;/code&gt; (stop loss first, where &lt;code&gt;x= -10&lt;/code&gt;) is &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;resx/(resx+resy) = 0.673716&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;while, &lt;code&gt;tp/(tp+stop) = 20/(20+10)&lt;/code&gt; gives &lt;code&gt;0.6666667&lt;/code&gt;, in agreement.&lt;/p&gt;&#xA;" OwnerUserId="3040" LastEditorUserId="35" LastEditDate="2012-12-17T02:40:41.780" LastActivityDate="2012-12-17T02:40:41.780" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4769" PostTypeId="2" ParentId="4515" CreationDate="2012-12-16T03:06:48.950" Score="1" Body="&lt;p&gt;You want to find combinations (2+) of securities with strong economic ties, e.g. WTI/Brent crude, gold/goldMiners, DJIA futures / component stocks, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The theoretical edge would come from the break down in correlation between the combinations in the short run, if their long run correlations remain robust. It's likely that once you understand where the money is, you'd see that cointegration doesn't really add any value. &lt;/p&gt;&#xA;" OwnerUserId="3384" LastActivityDate="2012-12-16T03:06:48.950" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4770" PostTypeId="2" ParentId="4738" CreationDate="2012-12-16T03:16:21.997" Score="1" Body="&lt;p&gt;To develop it from scratch, you could simulate the portfolio of the security combination, and utilize the portfolio's notional value, volatilities into Black Scholes Merton for fair values of ATM options. &lt;/p&gt;&#xA;" OwnerUserId="3384" LastActivityDate="2012-12-16T03:16:21.997" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4771" PostTypeId="2" ParentId="4264" CreationDate="2012-12-16T03:20:02.007" Score="0" Body="&lt;p&gt;&quot; ...making a replica portfolio and then entering trades every time a real trade is done.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can do this in excel with free historical data off yahoo finance. I'm giving you a link to some example data analysis with excel, &#xA;&lt;a href=&quot;http://matdays.blogspot.com/2012/11/excel-data-analysis-10-basic.html&quot; rel=&quot;nofollow&quot;&gt;http://matdays.blogspot.com/2012/11/excel-data-analysis-10-basic.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3384" LastActivityDate="2012-12-16T03:20:02.007" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4772" PostTypeId="2" ParentId="4766" CreationDate="2012-12-16T12:31:01.027" Score="2" Body="&lt;p&gt;&lt;em&gt;See edit and comments, this response might not be applicable to the question:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When performing regression you would tend to want your regressors to be of similar type, or at the very least range. Assuming you use log return for price changes I would recommend using the untransformed interest rate. The reason for this is that they are the same type of entity, rate of returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$R_t = \ln\frac{P_t}{P_{t-1}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$R_{t+1} = \theta_0 + \theta_1R_{t} + \theta_2I_{t} + \epsilon$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can of course use more fancy transformations, but this would be the natural starting point. Personally I use an evolutionary algorithm to evolve the regressor transformations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't worry about the interest rate being always positive. If this matters at all it will be pushed in to the intercept weight.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given that the interest rate and data resolution you are looking at displays tendencies to be non-stationary I would retract my recommendation above. However, this does make me wonder if you have enough data since I would intuitively expect interest rates to not trend in the long run. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your shoes I might have attempted to try evolutionary symbolic regression to transform the interest rate data, as discussed in the comment section. When doing this you could try to use your ADF test results as a fitness measure. The resulting transformation function can be used prior to your linear regression model. Remember to split in to test and training datasets in order to detect overfitting.&lt;/p&gt;&#xA;" OwnerUserId="2792" LastEditorUserId="2792" LastEditDate="2013-01-12T21:51:19.913" LastActivityDate="2013-01-12T21:51:19.913" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4773" PostTypeId="2" ParentId="4766" CreationDate="2012-12-16T15:29:24.943" Score="0" Body="&lt;p&gt;I guess you want your regressor to be a market invariant. The invariants are market variables that can be modeled as the realization of a set of independent and identically distributed random variables at least over the investment horizon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For equities, the invariant is the compound return. For fxed-income, changes in yield to maturity are considered as invariants. Thus you should use them in your regression. See the book &quot;Risk and Asset Allocation&quot; by Meucci, chapter 3.&lt;/p&gt;&#xA;" OwnerUserId="370" LastActivityDate="2012-12-16T15:29:24.943" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4774" PostTypeId="1" CreationDate="2012-12-16T20:02:12.873" Score="2" ViewCount="1106" Body="&lt;p&gt;How to calculate to calculate daily interest accruals and cashflows for the full term of the swap, given notional, effective date, maturity date: (total one year), accrual: ACT/360&#xA;payment: semi-annual, 2 day lag, fixed leg: [], floating leg: receive fed funds effective rate, daily reset, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I omitted the actual parameters since i want to perform the calculations myself, I just need formulas and explanation to get started. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks &lt;/p&gt;&#xA;" OwnerUserId="770" LastActivityDate="2012-12-16T20:02:12.873" Title="How to calculate cf and interest accruals of the swap?" Tags="&lt;swaps&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4775" PostTypeId="1" AcceptedAnswerId="4781" CreationDate="2012-12-16T22:43:41.360" Score="22" ViewCount="15380" Body="&lt;p&gt;What are some of the most prominent journals, conferences and publishing venues in Quantitative Finance research? Where can I find information more information about them? (e.g. impact factor and categorization by topic)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I went to ArXiv and found this: &lt;a href=&quot;http://arxiv.org/archive/q-fin&quot; rel=&quot;noreferrer&quot;&gt;http://arxiv.org/archive/q-fin&lt;/a&gt;, which is a good start, but I imagine that there are many other venues. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, in other disciplines such as machine learning, optimization, NLP, computer vision, we have various well-established journals and conferences that researchers and people in academia follow and where we publish our work, e.g.: NIPS, CVPR, ICCV, PAMI, STOC, ICML, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Aré there any equivalent journals or conferences that cover applications of machine learning and optimization (i.e. mathematical programming) to finance?&lt;/p&gt;&#xA;" OwnerUserId="2029" LastEditorUserId="2029" LastEditDate="2015-10-12T12:48:28.530" LastActivityDate="2021-03-18T08:15:33.233" Title="What are the best Journals &amp; Conferences in Quantitative Finance?" Tags="&lt;research&gt;" AnswerCount="7" CommentCount="6" FavoriteCount="26" ContentLicense="CC BY-SA 3.0" />
  <row Id="4776" PostTypeId="2" ParentId="4723" CreationDate="2012-12-16T23:20:52.107" Score="0" Body="&lt;p&gt;Enhancing the Karnosky/Singer model with a good approach to temporal compounding will give you a good analysis for a Brinson-type attribution at the fund level.&lt;/p&gt;&#xA;" OwnerUserId="3437" LastActivityDate="2012-12-16T23:20:52.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4777" PostTypeId="1" CreationDate="2012-12-17T07:17:31.937" Score="5" ViewCount="330" Body="&lt;p&gt;I am referring to an &lt;strong&gt;electricity production&lt;/strong&gt; company. Company is located in AsiaPac. The power is generated using  Natural Gas fired combined-cycle power plants. Then this electricity is distributed to a main power grid company authorized for delivering the electricity to each house-hold or factory/indutries out there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The electricity company buys Natural Gas from an authority who exports Liquified Natural Gas and stores in terminal tanks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the electricity futures market is relatively illiquid, these contracts are only traded in OTC market. There are other electricity producting companies who are competitors in the same production space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;As for the search I have done, basic futures contracts this company takes are:-&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;LNG futures contract with their LNG supplier&lt;/li&gt;&#xA;&lt;li&gt;Electricity futures contracts with their bidders from industrial players to power ditribution agents who then supply electricity to house-holds etc.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;UPDATED AS INITIAL SET OF QUESTIONS WERE VERY BROAD&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;So it's great if someone could point out,&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;how to diversify a basic electricity portfolio?&lt;/li&gt;&#xA;&lt;li&gt;how does this portfolio differ from any other energy portfolio?&lt;/li&gt;&#xA;&lt;li&gt;how does bidding, hedging and risk is managed for this electricity port? &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Given we do not hear much about electricity options in our market, it's great to hear about some effective strategies these companies would use to hedge their over all market risk.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Initial question approach&lt;/em&gt;:-&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;how to build a basic portfolio for this company?&lt;/li&gt;&#xA;&lt;li&gt;how does this portfolio differ from any other energy portfolio?&lt;/li&gt;&#xA;&lt;li&gt;how does bidding, hedging and risk is managed?&lt;/li&gt;&#xA;&lt;li&gt;hegding strategies that can be used?&lt;/li&gt;&#xA;&lt;li&gt;how to diversify this basic electricity portfolio?&lt;/li&gt;&#xA;&lt;li&gt;how does speculation and arbitrage opportunities identified&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Following are some references I have been reading,&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://lwvea.org/files/portfolio-4.pdf&quot; rel=&quot;nofollow&quot;&gt;building an energy portfolio&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ideas.repec.org/p/dgr/eureri/1765010775.html&quot; rel=&quot;nofollow&quot;&gt;electricity portfolio management&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.ifor.math.ethz.ch/publications/2002_diss_unger.pdf&quot; rel=&quot;nofollow&quot;&gt;hedging with electricity futures&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.mercatusenergy.com/utility-energy-hedging-risk-management/&quot; rel=&quot;nofollow&quot;&gt;natural gas hedging electricity hedging&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If my question is too broad, &lt;strong&gt;please comment&lt;/strong&gt; so it will help me to break it down to specific parts. :)&lt;/p&gt;&#xA;" OwnerUserId="3178" LastEditorUserId="3178" LastEditDate="2012-12-20T20:01:15.163" LastActivityDate="2014-06-09T17:10:55.173" Title="How to build an electricity portfolio for an electricity production company?" Tags="&lt;portfolio-management&gt;&lt;risk-management&gt;&lt;hedging&gt;&lt;speculation&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4778" PostTypeId="5" CreationDate="2012-12-17T07:56:32.737" Score="0" Body="&lt;p&gt;The act of trading in an asset, or conducting a financial transaction, that has a significant risk of losing most or all of the initial outlay, in expectation of a substantial gain. With speculation, the risk of loss is &lt;strong&gt;more than offset&lt;/strong&gt; by the possibility of a huge gain; otherwise, there would be very little motivation to speculate. While it is often confused with gambling, the &lt;strong&gt;key difference is that speculation is generally tantamount to taking a calculated risk and is not dependent on pure chance&lt;/strong&gt;, whereas gambling depends on totally random outcomes or chance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.investopedia.com/terms/s/speculation.asp#ixzz2FIDGUaXR&quot; rel=&quot;nofollow&quot;&gt;Reference:1&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Speculators play one of four primary roles in financial markets, along with hedgers who engage in transactions to offset some other pre-existing risk, arbitrageurs who seek to profit from situations where fungible instruments trade at different prices in different market segments, and investors who seek profit through long-term ownership of an instrument's underlying attributes. The role of speculators is to absorb excess risk that other participants do not want, and to provide liquidity in the marketplace by buying or selling when no participants from the other categories are available. Successful speculation entails collecting an adequate level of monetary compensation in return for providing immediate liquidity and assuming additional risk so that, over time, the inevitable losses are offset by larger profits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Speculation&quot; rel=&quot;nofollow&quot;&gt;Reference:2&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3178" LastEditorUserId="3178" LastEditDate="2012-12-17T11:24:56.597" LastActivityDate="2012-12-17T11:24:56.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4779" PostTypeId="4" CreationDate="2012-12-17T07:56:32.737" Score="0" Body="Transaction of a financial instrument with a calculated risk in hopes of obtaining a commensurate gain that offsets more than the possible loss. " OwnerUserId="3178" LastEditorUserId="3178" LastEditDate="2012-12-17T11:24:40.480" LastActivityDate="2012-12-17T11:24:40.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4780" PostTypeId="1" CreationDate="2012-12-17T09:13:51.747" Score="2" ViewCount="119" Body="&lt;p&gt;I have a few time series of models to analyse in terms of how far/close they are to their underlying limit. The limit is a simple value on the y-axis (always positive), and the series can act arbitrary with respect to that - it can be negative for most of the time, then jump up and oscillate, or stay close under the limit, or even break the limit a couple of times... My question is how to best capture the &quot;closeness&quot; of the time series?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current idea is as follows: for each data point we calculate distance = (limit - curr_value)/limit. This can be very big, if the values are negative (far from limit), close to zero and negative if breaching. I would then compute a weighted average of all values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this make sense at all, or perhaps a different strategy should be used? Thanks a lot for your opinions.&lt;/p&gt;&#xA;" OwnerUserId="2159" LastActivityDate="2012-12-17T15:21:17.917" Title="Limits analysis" Tags="&lt;returns&gt;&lt;limit-order-book&gt;&lt;analysis&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4781" PostTypeId="2" ParentId="4775" CreationDate="2012-12-17T10:14:59.223" Score="8" Body="&lt;p&gt;Though it is not an extensive list , this is what I know of. Other may add more.&#xA;Journals&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Journal of Financial and Quantitative Analysis (&lt;a href=&quot;http://www.jfqa.org/&quot; rel=&quot;noreferrer&quot;&gt;JFQA&lt;/a&gt;) &lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.risk.net/journal&quot; rel=&quot;noreferrer&quot;&gt;Risk&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Papers&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.ssrn.com/&quot; rel=&quot;noreferrer&quot;&gt;SSRN&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://arxiv.org&quot; rel=&quot;noreferrer&quot;&gt;ARXIV&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Conferences&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.quantcongresseurope.com/&quot; rel=&quot;noreferrer&quot;&gt;quantcongresseurope&lt;/a&gt; &lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.risk.net/conferences&quot; rel=&quot;noreferrer&quot;&gt;More at Risk Website&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.flaggmgmt.com/hpc/&quot; rel=&quot;noreferrer&quot;&gt;HPC and Wall Street&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.garp.org/events/conferences.aspx&quot; rel=&quot;noreferrer&quot;&gt;GARP&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1386" LastEditorUserId="1764" LastEditDate="2012-12-22T19:47:48.407" LastActivityDate="2012-12-22T19:47:48.407" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4782" PostTypeId="1" CreationDate="2012-12-17T11:25:31.583" Score="2" ViewCount="317" Body="&lt;p&gt;I used to trade German and US govt. bond futures and I am now having trouble understanding the price difference of these markets against the cash market.&#xA;For example, the 10 year german government bund cash is trading at 101.19 while the front month future is at 144.86.&#xA;To my mind the difference can't be attributed to expectations of changes in the yield curve&#xA;or any quotation convensions to do with bond prices&#xA;I can only think it is a carry cost but would have thought the coupon would cause the futures to trade lower than the cash.&#xA;Any ideas?&#xA;Thanks&lt;/p&gt;&#xA;" OwnerUserId="3450" LastActivityDate="2012-12-17T13:40:45.763" Title="Price difference between bond cash and futures" Tags="&lt;fixed-income&gt;&lt;pricing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4784" PostTypeId="2" ParentId="4766" CreationDate="2012-12-17T12:47:33.840" Score="0" Body="&lt;p&gt;I'm thinking the first difference is the most sensible. If we take the Ho-Lee short-rate model for example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dr(t) = \theta(t)dt + \sigma dW(t).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking the log-return or the continuous-return doesn't admit a very nice or intuitive representation, because we get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d(\ln r(t)) = r^{-1}(t)dr(t) - \frac12 r^{-2}(t)d\langle r\rangle(t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I expect a similarly messy expression would hold for the nominal returns. However taking the simple difference that I proposed is quite nice:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Delta r(t) = \theta(t)\Delta t + \sigma \Delta W(t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W(t)-W(t-1)\overset{d}{=}W(1) \overset{iid}{\sim} \mathcal{WN}(0,1)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This would apply to the other short-rate models. Of course I'm assuming $\Delta (\ln r(t))$ doesn't simplify to something nice, which I haven't gone through.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, there is also nothing wrong econometrically as the series is $I(0)$ with a size $\alpha = 0.03$ test for all countries in the sample. At least that's where I'm at now.&lt;/p&gt;&#xA;" OwnerUserId="3174" LastEditorUserId="3174" LastEditDate="2012-12-17T16:46:30.143" LastActivityDate="2012-12-17T16:46:30.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4785" PostTypeId="2" ParentId="4782" CreationDate="2012-12-17T13:40:45.763" Score="7" Body="&lt;p&gt;I think the reason is the following:&#xA;The bund future refers to the price of a fictituous $10$-year $6\%$ coupon bond.&#xA;The current ctd bond has a smaller coupon I think ($2\%$ 01/04/2022) - that would account for the price difference right? &lt;/p&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2012-12-17T13:40:45.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4786" PostTypeId="2" ParentId="4780" CreationDate="2012-12-17T15:21:17.917" Score="1" Body="&lt;p&gt;Despite the rather unconventional terminology used I would say you are pretty much spot on with what you are doing and what you try to achieve. I would, however use log returns in order to get an identical percentage no matter whether you measure the distance from 100 -&gt; 90 or 90 -&gt; 100, for example. You can also standardize the value you capture by differencing the observed distance and mean distance and then divide the difference by the observed standard deviation of the distances over a specified amount of data points, similar to z-value. That gives you the difference in terms of standard deviations. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-12-17T15:21:17.917" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4789" PostTypeId="1" CreationDate="2012-12-17T19:12:32.487" Score="3" ViewCount="3971" Body="&lt;p&gt;I'm trying to calculate the 'true value' of a stock listed on an exchange. I have access to the limit order-book (containing all bid/ask quotes) and also all trades which have taken place (which contain price, amount, date etc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The context is from the POV of designing a market-making algorithm with positive expected profit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried taking:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The VWAP of recent trades &lt;/li&gt;&#xA;&lt;li&gt;The mid-point of the bid-ask spread&lt;/li&gt;&#xA;&lt;li&gt;The SMA of the mid-point of the bid-ask spread&lt;/li&gt;&#xA;&lt;li&gt;The mean over all prices in the order-book&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;All these attempts have resulted in an overall loss, or no-trading taking place at all. I must be approaching this from the wrong angle and I think the primary suspect is incorrect true value calculation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have any advice, or good reference to read-up on?&lt;/p&gt;&#xA;" OwnerUserId="3457" LastActivityDate="2013-11-27T17:08:19.167" Title="Calculating true value of a stock given the order-book and recent trades" Tags="&lt;quant-trading-strategies&gt;&lt;limit-order-book&gt;&lt;algorithmic-trading&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4791" PostTypeId="1" AcceptedAnswerId="4797" CreationDate="2012-12-17T20:09:30.300" Score="2" ViewCount="2085" Body="&lt;p&gt;I know that MATLAB has mechanisms for generating code, but I've never used them. Have you? If you have - is it good enough (=fast enough, I guess) to be used in live trading systems? Anything one needs to watch out for?&lt;/p&gt;&#xA;" OwnerUserId="1217" LastActivityDate="2012-12-19T10:38:07.427" Title="Is MATLAB-generated code good enough for use in live trading?" Tags="&lt;trading&gt;&lt;programming&gt;&lt;matlab&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4792" PostTypeId="2" ParentId="4789" CreationDate="2012-12-17T21:25:22.200" Score="2" Body="&lt;p&gt;One way to think about this is as a missing data problem. You observe the order book constantly, but trades only occur infrequently. One way to resolve this is to perform full information maximum likelihood (other techniques, such as multiple imputation, may be too slow for your needs but it might be useful to look into them), which has analytical formula for the multivariate normal distribution. This would be equivalent to regressing trade prices on the order book (or just the bid and ask or some weighted least squares that accounts for the volume at each price) and then predicting what price trades would have occurred at.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nevertheless, my guess is that performing these regressions will not help your trading strategy. Taking the mid-point of the bid/ask spread is a convenient approach to begin your analysis. The fact that several indicators produced similar results, suggests that you have other problems. You might need to re-evaluate more than just this. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2012-12-17T21:25:22.200" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4793" PostTypeId="1" CreationDate="2012-12-17T21:49:52.117" Score="2" ViewCount="51" Body="&lt;p&gt;I need help with understanding how does a covered bond characteristics compare to a mortgage security for credit enhancement?  &lt;/p&gt;&#xA;" OwnerUserId="770" LastActivityDate="2012-12-17T21:49:52.117" Title="How does a covered bond characteristics compare to a mortgage security for credit enhancement?" Tags="&lt;fixed-income&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4794" PostTypeId="1" AcceptedAnswerId="4795" CreationDate="2012-12-18T03:26:04.390" Score="1" ViewCount="1074" Body="&lt;p&gt;I have an issue about rounding price to tick size.&#xA;Suppose there is price tick table below. what is tick size for price 1001, 1002 ... 1004? In other words, how to handle the price in between upper range of first level and the lower range of next level?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;range tick&#xA;0 - 50 1&#xA;51 - 1000 5&#xA;1005 - 1000000 10&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;EDIT:&#xA;The tick table is created by myself which is based on the exchange spec.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;50 or less: 1&#xA;Over 50 up to 1,000: 5&#xA;Over 1,000: 10&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3460" LastEditorUserId="3460" LastEditDate="2012-12-18T03:54:15.233" LastActivityDate="2012-12-18T05:37:09.020" Title="round price to tick size" Tags="&lt;tick&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4795" PostTypeId="2" ParentId="4794" CreationDate="2012-12-18T04:13:02.147" Score="1" Body="&lt;p&gt;That exchange spec implies that there isn't a legal price of 1001, 1002, ..., 1009. The next available price after 1000 is just 1010.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your pricing engine determines a fair value of, say, 1005, then your application will need to apply some rounding logic. For example, you can always round away from the inside price, or you can simply round to the nearest tick in either direction.&lt;/p&gt;&#xA;" OwnerUserId="35" LastEditorUserId="35" LastEditDate="2012-12-18T04:22:01.700" LastActivityDate="2012-12-18T04:22:01.700" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4797" PostTypeId="2" ParentId="4791" CreationDate="2012-12-18T05:19:58.077" Score="13" Body="&lt;p&gt;Of course it is fast enough. But what is fast enough? I know guys who trade off Excel sheets and they make millions, but those guys are clearly not active in high frequency space. So, it entirely depends on your trading frequency and average holding period. I also know of shops that run live trading systems by calling R functions, so, obviously Matlab generated code is fast enough for a lot of algorithms. Chrisaycock is right in saying that it depends mostly on what you actually try to achieve and your own framework. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2012-12-19T09:47:45.137" LastActivityDate="2012-12-19T09:47:45.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4798" PostTypeId="2" ParentId="4794" CreationDate="2012-12-18T05:30:28.737" Score="0" Body="&lt;p&gt;As long as you adhere to the exchange specs you will be good. But keep in mind that while the rounded price is good to place your quotes in the market, its vital you use the information of how far away your valuation price is from the rounded/quoted price. This is why you see most quoting engines, especially in the listed options market, flip back and forth between two price levels at one frequency, and another at other times. They do it as a function of how far away their valuation price is from the rounded price and especially as a function of other order book intrinsics, such as volumes posted, trades done by others.... What I am trying to say is that one rounding logic is just that, there are different ways to determine your quoted price you shoot into the market. Keep in mind that you most likely will be subject to certain modify/cancel charges, different tiers apply for different types of market participants and also how often you modify/cancel. So, rounding is one thing, whether you strictly consider the rounded price as the price you want to quote an entirely different, your valuation model and rounding algorithm may change the rounded price a multiple of times in a very short period of time when there are new information coming in at high frequency. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2012-12-18T05:37:09.020" LastActivityDate="2012-12-18T05:37:09.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4799" PostTypeId="1" AcceptedAnswerId="4800" CreationDate="2012-12-18T17:38:07.137" Score="-1" ViewCount="976" Body="&lt;p&gt;I'm designing a market-making algorithm, I was wondering what a decent ROI / day would be to aim for in such a system?&lt;/p&gt;&#xA;" OwnerUserId="3457" LastActivityDate="2012-12-18T19:07:31.197" Title="Target daily ROI for a market-making algorithm" Tags="&lt;quant-trading-strategies&gt;&lt;market-making&gt;&lt;algorithmic-trading&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4800" PostTypeId="2" ParentId="4799" CreationDate="2012-12-18T19:07:31.197" Score="6" Body="&lt;p&gt;The best options AMM guys are rumored to capture roughly 1/3tick per round trip, net of transaction costs + implementation shortfalls. I had worked for a regional index options MM. With the growth of competition in the recent years, expected returns are actually much lower than that today. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So realistically, in today's environment, you could net maybe 1/5tick per round trip. Estimate the average number of round trips expected per day, and you have all variables needed to work out ROI. good luck.&lt;/p&gt;&#xA;" OwnerUserId="3384" LastActivityDate="2012-12-18T19:07:31.197" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4802" PostTypeId="2" ParentId="4791" CreationDate="2012-12-18T20:02:49.060" Score="4" Body="&lt;p&gt;If I understand you right, you are talking specifically about Matlab's embedded code generation facility (see here: &lt;a href=&quot;http://www.mathworks.ch/embedded-code-generation/&quot; rel=&quot;nofollow&quot;&gt;http://www.mathworks.ch/embedded-code-generation/&lt;/a&gt;). In my view,  the answer to your question is clearly yes. This feature allows you to generate hardware specific code, e.g. for deployment on GPU's (video cards). It's used for aerospace systems, among other. In our area of expertise, this is probably as fast as it gets today, at least for some types of models. As a rule of thumb: the more complex your model, the more you get a competitive advantage with this technology. In my opinion, this favors mid- to high-frequency strategies (ultra-HF models are usually much simpler, so the overhead of routing calls to secondary hardware is usually too slow; for slow models, it's not worth the trouble because you have enough time to run it on a well-equipped desktop).&#xA;A typical example where this would really pay off is a monte carlo simulation to calculate a VaR for the risk-sizing of an intraday trading strategy.&#xA;In my view, even without code generation, Matlab is also a very robust and fast tool for production use. For example, you can compile code and, if well done, this is much faster then R. In fact, the company I work for does technology and trading strategy implementation for quant hedge funds, and Matlab is one of the technologies we use very often. The code generation, on the other hand, is still seen as leading edge by many. Thus, the time might still be right to gain a comparative advantage by using it ;-) &lt;/p&gt;&#xA;" OwnerUserId="1988" LastActivityDate="2012-12-18T20:02:49.060" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4803" PostTypeId="2" ParentId="4294" CreationDate="2012-12-18T22:44:27.873" Score="1" Body="&lt;p&gt;You could simply trade the vega off VIX options with the heaviest weighting according to the VVIX calculation. &lt;/p&gt;&#xA;" OwnerUserId="3384" LastActivityDate="2012-12-18T22:44:27.873" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4804" PostTypeId="1" AcceptedAnswerId="10335" CreationDate="2012-12-19T02:22:06.997" Score="6" ViewCount="1625" Body="&lt;p&gt;I'm looking to run portfolio optimizations using various optimization goals - e.g. minimum variance, max diversification etc. My challenge is if I want to do this on ETF's which ones do I pick to run the optimization on?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say there is a universe of 200 or so ETF's - is there some form of clustering I can do to reduce this down to a smaller set of 20 or so to optimize? Or is this best handled by letting the portfolio optimizer itself apply the appropriate weights out of the larger set?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What techniques should I consider for clustering - i.e. what metrics make sense is it correlation, mean return (I doubt it since that's so noisy), anything else?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Updates:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To clarify what I'm trying to do is whittle down the 500 names in the SP500 to 20 or so clusters and then from each cluster take the most representative stock to get 20 names. I would then do portfolio opt on the 20 names&#xA;Following a series from the amazing systematic investor blog I've been able to get really nice results doing some clustering as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Try various clustering schemes on xrets (log returns matrix)&#xA;xrets.scaled &amp;lt;- scale(xrets)&#xA;xrets.euclid.dist &amp;lt;- dist(t(xrets.scaled))&#xA;&#xA;xrets.correlation.distance &amp;lt;- as.dist(1-cor(xrets))&#xA;&#xA;fit &amp;lt;- hclust(xrets.correlation.distance, method=&quot;ward&quot;)&#xA;plot(fit)&#xA;k.numclusts &amp;lt;- 30&#xA;groups &amp;lt;- cutree(fit, k=k.numclusts)&#xA;rect.hclust(fit, k=k.numclusts, border=&quot;red&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However all this gives me is clusters e.g. in the SP500 it found clusters of the following form (illustrating just one cluster):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; CAG : ConAgra Foods Inc. : [1] NA CL : Colgate-Palmolive Co. : [1] NA&#xA;&amp;gt; CPB : Campbell Soup Co. : [1] NA GIS : General Mills Inc. : [1] NA HNZ&#xA;&amp;gt; : H. J. Heinz Company : [1] NA HRL : Hormel Foods Corp. : [1] NA K :&#xA;&amp;gt; Kellogg Company : [1] NA KMB : Kimberly-Clark Corporation : [1] NA KO&#xA;&amp;gt; : The Coca-Cola Company : [1] NA MKC : McCormick &amp;amp; Co. Inc. : [1] NA&#xA;&amp;gt; PEP : Pepsico Inc. : [1] NA PG : Procter &amp;amp; Gamble Co. : [1] NA SJM :&#xA;&amp;gt; The J. M. Smucker Company : [1] NA&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This still doesn't tell me though which stock in each cluster is the most optimal to select for further portfolio opt. Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="2186" LastEditorUserId="848" LastEditDate="2012-12-31T22:34:49.033" LastActivityDate="2014-02-22T19:07:11.703" Title="How to cluster ETFs to reduce cardinality for portfolio selection" Tags="&lt;optimization&gt;&lt;portfolio-selection&gt;&lt;etf&gt;&lt;cluster&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4805" PostTypeId="2" ParentId="4804" CreationDate="2012-12-19T03:15:01.140" Score="4" Body="&lt;p&gt;I would look to run a pre-optimization routine over the whole universe of 200+ ETFs. I would use this pre-optimization to reduce the universe to a cardinality that provides optimal diversification effects. You can do that by first looking at pair-wise correlations and then also run optimizations to reduce portfolio variance by utilizing the covariance matrixes. In that way you will already filter out highly correlated assets that are useless to combine in a portfolio. You could use additional constraints such as minimum liquidity requirements to decide which assets to keep and which to toss out. But in any case, try to eliminate highly correlated assets and those assets that do not reduce portfolio variance in a meaningful way. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following may help doing that: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.rinfinance.com/RinFinance2009/presentations/yollin_slides.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.rinfinance.com/RinFinance2009/presentations/yollin_slides.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.rmetrics.org/files/freepdf/PortfolioOptimizationSample.pdf&quot; rel=&quot;noreferrer&quot;&gt;https://www.rmetrics.org/files/freepdf/PortfolioOptimizationSample.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://ccnet.stanford.edu/cgi-bin/course.cgi?cc=msande242h&amp;amp;action=handout_download&amp;amp;handout_id=ID131921138820714&quot; rel=&quot;noreferrer&quot;&gt;https://ccnet.stanford.edu/cgi-bin/course.cgi?cc=msande242h&amp;amp;action=handout_download&amp;amp;handout_id=ID131921138820714&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-12-19T03:15:01.140" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4806" PostTypeId="2" ParentId="4804" CreationDate="2012-12-19T03:34:15.167" Score="2" Body="&lt;p&gt;When I select assets for a portfolio given an universe, I tend to pick ones that span the beta spectrum, given your selected benchmark. I find that if your portfolio of assets have varying volatility or correlation, you can achieve better diversification.  I didn't come up with the idea but it comes from a rotational system's framework from the link below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://cssanalytics.wordpress.com/2010/02/26/rotation-part-3-beta-surfing/&quot; rel=&quot;nofollow&quot;&gt;http://cssanalytics.wordpress.com/2010/02/26/rotation-part-3-beta-surfing/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One thing to be careful is to avoid randomly throwing assets in to a optimization procedure as you may find the ending portfolio allocation concentrated with risk that is hidden from a portfolio level. It may be useful to first manually separate the etfs in to their respective categories.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: I am not sure the relevance to your research but CSS analytics just started a 2 part post about Cluster Risk Parity which has some ideas that talk about subsetting assets from portfolio universe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;HTH,&lt;/p&gt;&#xA;" OwnerUserId="2318" LastEditorUserId="2318" LastEditDate="2013-01-04T07:56:16.307" LastActivityDate="2013-01-04T07:56:16.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4807" PostTypeId="2" ParentId="4791" CreationDate="2012-12-19T10:38:07.427" Score="1" Body="&lt;p&gt;We were using Matlab with the Java Builder for numerical optimization and the results were very poor. Fmincon was taking about 30 seconds to converge, now we are using a native java library and the optimization takes from 0.1sec to 0.5 seconds&lt;/p&gt;&#xA;" OwnerUserId="3470" LastActivityDate="2012-12-19T10:38:07.427" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4808" PostTypeId="1" AcceptedAnswerId="4817" CreationDate="2012-12-19T19:24:55.437" Score="4" ViewCount="1640" Body="&lt;p&gt;I am attempting to use the function estim_nss from the termstrc package in R to find the spot curve from constant maturity rates published by the Fed. I am using this package because I will need to deal with variable rate coupon bonds in the future. The function requires an object of class &quot;couponbonds&quot; but I cannot figure out how to create this class. I tried creating a list object with similar data but the function rejects this object with the following message:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Error in UseMethod(&quot;estim_nss&quot;) : &#xA;  no applicable method for 'estim_nss' applied to an object of class &quot;list&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any assistance would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="232" LastActivityDate="2013-01-01T14:39:04.100" Title="Using the termstrc package in R" Tags="&lt;r&gt;&lt;yield-curve&gt;&lt;spot-rate&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4809" PostTypeId="2" ParentId="4808" CreationDate="2012-12-20T06:09:41.203" Score="3" Body="&lt;p&gt;You can create the data using the procedure described in the &lt;a href=&quot;http://cran.r-project.org/web/packages/termstrc/termstrc.pdf&quot; rel=&quot;nofollow&quot;&gt;reference manual&lt;/a&gt; on pages 31 and 32. The necessary code is copied below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# The following code may be used to generate an empty data set,&#xA;# which can then be filled with bond data:&#xA;ISIN &amp;lt;- vector()&#xA;MATURITYDATE &amp;lt;- vector()&#xA;STARTDATE &amp;lt;- vector()&#xA;COUPONRATE &amp;lt;- vector()&#xA;PRICE &amp;lt;- vector()&#xA;ACCRUED &amp;lt;- vector()&#xA;CFISIN &amp;lt;- vector()&#xA;CF &amp;lt;- vector()&#xA;DATE &amp;lt;- vector()&#xA;CASHFLOWS &amp;lt;- list(CFISIN,CF,DATE)&#xA;names(CASHFLOWS) &amp;lt;- c(&quot;ISIN&quot;,&quot;CF&quot;,&quot;DATE&quot;)&#xA;TODAY &amp;lt;- vector()&#xA;&#xA;mycountry1 &amp;lt;- list(ISIN,MATURITYDATE,STARTDATE,&#xA;                   COUPONRATE,PRICE,ACCRUED,CASHFLOWS,TODAY)&#xA;mycountry2 &amp;lt;- list(ISIN,MATURITYDATE,STARTDATE,&#xA;                   COUPONRATE,PRICE,ACCRUED,CASHFLOWS,TODAY)&#xA;names(mycountry1) &amp;lt;- c(&quot;ISIN&quot;,&quot;MATURITYDATE&quot;,&quot;STARTDATE&quot;,&quot;COUPONRATE&quot;,&#xA;                       &quot;PRICE&quot;,&quot;ACCRUED&quot;,&quot;CASHFLOWS&quot;,&quot;TODAY&quot;)&#xA;names(mycountry2) &amp;lt;- c(&quot;ISIN&quot;,&quot;MATURITYDATE&quot;,&quot;STARTDATE&quot;,&quot;COUPONRATE&quot;,&#xA;                       &quot;PRICE&quot;,&quot;ACCRUED&quot;,&quot;CASHFLOWS&quot;,&quot;TODAY&quot;)&#xA;mybonds &amp;lt;- list(mycountry1,mycountry2)&#xA;names(mybonds) &amp;lt;- c(&quot;mycountry1&quot;,&quot;mycountry2&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Finally set the class of the object just created:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;class(mybonds)=&quot;couponbonds&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="848" LastEditorUserId="848" LastEditDate="2013-01-01T14:39:04.100" LastActivityDate="2013-01-01T14:39:04.100" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4810" PostTypeId="1" CreationDate="2012-12-20T16:16:17.103" Score="7" ViewCount="7493" Body="&lt;p&gt;I'm stuck with one homework problem here: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Assume there is a geometric Brownian motion \begin{equation} dS_t=\mu S_t dt + \sigma S_t dW_t \end{equation} Assume the stock pays&#xA;  dividend, with the cont. compounded yield $q$.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;a) Find the risk-neutral version of the process for $S_t$.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;b) What is the market price of risk in this case?&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;c) Assume no yield anymore. Now, there is a derivative written on this&#xA;  stock paying one unit of cash if the stock price is above the strike&#xA;  price $K$ at maturity time $T$, and 0 else (&lt;em&gt;cash-or-nothing binary call option&lt;/em&gt;). Find the PDE followed by&#xA;  the price of this derivative. Write the appropriate boundary&#xA;  conditions.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;d) Write the expression for the price of this derivative at time $t&amp;lt;T$&#xA;  as a risk-neutral expectation of the terminal payoff.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;e) Writte the price of this option in terms on $N(d_2)$, where $d_2$&#xA;  has the usual Black-Scholes value.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Here is what I came up with by now:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for a): This should become $dS_t'=(r-q)S_t'dt + \sigma S_t'dW_t^\mathbb{Q}$ (is this correct?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for b): This would be $\zeta=\frac{\mu-(r-q)}{\sigma}$ (?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for c): The boundary conditions should be: Price at $t=T$ is $0$ if $S&amp;lt;K, 1$ else; I have no idea what to write for the PDE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for d): I can only think of $C(S_t,t)=e^{-r(T-t)}\mathbb{E}[C(S_t),T]$, where $C(S_t,T)$ is the value at time $T$, i.e. the payoff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for e): I don't know how to start here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anybody help me and solve this with me?&lt;/p&gt;&#xA;" OwnerUserId="1817" LastEditorUserId="1817" LastEditDate="2012-12-20T18:36:44.557" LastActivityDate="2013-05-20T01:38:21.737" Title="price of a &quot;Cash-or-nothing binary call option&quot;" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4811" PostTypeId="2" ParentId="2069" CreationDate="2012-12-20T16:22:48.600" Score="0" Body="&lt;p&gt;I've been using Excel's Solver to fit the generalized logistic curve.&#xA;I get the best results (best fit) when I:&#xA;1. Bind all the variables (upper and lower)&#xA;2. Use non-linear GRG.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On 200 observations it takes about a minute to estimate.&#xA;The objective was minimising sum of squares (maximising R2).&lt;/p&gt;&#xA;" OwnerUserId="3475" LastActivityDate="2012-12-20T16:22:48.600" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4812" PostTypeId="1" CreationDate="2012-12-21T03:29:39.657" Score="2" ViewCount="333" Body="&lt;p&gt;Let's say I have $n$ assets and their returns are stored in a matrix $X \in \mathbb{R}^{m \times n}$ (i.e. I have $m$ returns for each of them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The covariance matrix of the returns is $\Sigma \in \mathbb{R}^{n \times n}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I define a portfolio $w \in \mathbb{R}^{n}$ and I want that $\sum_{i=1}^n w_i=1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My goal is to find all the portfolios such that the volatility of the portfolio is some target $\sigma^*$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my problem looks like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Find all $w$ such that: $\sqrt{w' \Sigma w}=\sigma^*$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think that in most cases, I would have an infinity of solutions as long as $\sigma^*$ was chosen decently with regards to the assets available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What algorithm could help me to find them all? How would the result be represented? I was thinking it should give me some kind of vector space.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2012-12-22T21:39:56.297" Title="How to enumerate all the possible portfolios with a given target volatility?" Tags="&lt;volatility&gt;&lt;asset-allocation&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4813" PostTypeId="1" CreationDate="2012-12-21T05:14:41.717" Score="5" ViewCount="2909" Body="&lt;p&gt;If I have 4 optionable stocks A,B,C,D and each different implied volatilies,IV-A,IV-B,IV-C,IV-D.  How do get the implied volatility for a basket option on A,B,C,D where the basket weights are w-A=.6, w-B=.3, w-C=.09,w-D=.01&#xA;?&lt;/p&gt;&#xA;" OwnerUserId="214" LastActivityDate="2012-12-21T06:14:54.903" Title="what is the implied volatility on a basket of options" Tags="&lt;option-pricing&gt;&lt;basket&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4814" PostTypeId="2" ParentId="4813" CreationDate="2012-12-21T06:14:54.903" Score="6" Body="&lt;p&gt;I think you should not just ask what the implied vol is of a basket of equity derivatives but you should aim to generate a volatility surface. A spot implied vol gives you nothing to work with. What you need is an implied vol surface in order to understand the smile and skew effects when you quote basket options in the market and/or as price taker. Take a look at the following to get started:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.wilmott.com/pdfs/100826qu.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.wilmott.com/pdfs/100826qu.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://relativity.phys.lsu.edu/postdocs/matt/papers/sv.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://relativity.phys.lsu.edu/postdocs/matt/papers/sv.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-12-21T06:14:54.903" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="4816" PostTypeId="1" AcceptedAnswerId="4825" CreationDate="2012-12-21T09:05:37.720" Score="8" ViewCount="505" Body="&lt;p&gt;One of the most serious shortcomings of covariance/correlation are the assumptions of linearity and normality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the most natural generalization of these measures of dependence when you want to model the dependence structure of extreme events using heavy-tailed distributions, e.g. the &lt;a href=&quot;http://en.wikipedia.org/wiki/Generalized_extreme_value_distribution&quot; rel=&quot;nofollow noreferrer&quot;&gt;Generalized extreme value distribution&lt;/a&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &quot;most natural generalization&quot; I mean that the classical covariance/correlation is included as a special case when the usual assumptions hold.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Disclosure: This question was posted at &lt;a href=&quot;https://stats.stackexchange.com/questions/45481/most-natural-generalization-of-covariance-correlation-to-model-dependence-of-ext&quot;&gt;Cross Validated&lt;/a&gt; nearly two weeks ago, yet didn't receive any answers)&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2020-11-17T15:51:46.713" Title="Most natural generalization of covariance/correlation to model dependence of extreme events" Tags="&lt;correlation&gt;&lt;covariance&gt;&lt;dependence&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4817" PostTypeId="2" ParentId="4808" CreationDate="2012-12-21T21:21:33.513" Score="1" Body="&lt;p&gt;It turned out to be more simple than I thought. First, be sure to replace &quot;STARTDATE&quot; with &quot;ISSUEDATE&quot; when building the list. Once the list is build simply reclassify it using the following command:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;class(mybonds)=&quot;couponbonds&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That's it!&lt;/p&gt;&#xA;" OwnerUserId="232" LastActivityDate="2012-12-21T21:21:33.513" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4818" PostTypeId="2" ParentId="4132" CreationDate="2012-12-22T01:14:26.970" Score="4" Body="&lt;p&gt;One of the most salient empirical examples of &quot;error maximization&quot; is provided by Chopra and Ziemba (1993):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Chopra, Vijay K., and William T. Ziemba. 1993. “The Effect of Errors in Means, Variances, and Covariances on Optimal Portfolio Choice.” Journal of Portfolio Management, vol. 19, no. 2 (Winter):6–11.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The authors compare the performance of mean-variance optimization using (a) historical data and traditional sample estimators against a portfolio formed with (b) perfect information of the future.  The authors find after comparing the performance of (a) relative to the clairvoyant portfolio (b),&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Using historical returns to estimate the covariance matrix is sufficient.&lt;/li&gt;&#xA;&lt;li&gt;Using historical returns to estimate the mean return incurs a massive performance shortfall.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thus, using a shrinkage estimator, or simply setting all returns equal to a constant $\hat{\mu}_i = c$ $\forall i$ (equivalent to the minimum variance portfolio), is a superior alternative. &lt;/p&gt;&#xA;" OwnerUserId="3478" LastActivityDate="2012-12-22T01:14:26.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4819" PostTypeId="2" ParentId="4775" CreationDate="2012-12-22T01:17:45.350" Score="2" Body="&lt;p&gt;&lt;a href=&quot;http://www.q-group.org/&quot; rel=&quot;nofollow&quot;&gt;Q Group&lt;/a&gt; holds some of the better conferences.&lt;/p&gt;&#xA;" OwnerUserId="3478" LastEditorUserId="35" LastEditDate="2013-01-21T01:50:03.690" LastActivityDate="2013-01-21T01:50:03.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4820" PostTypeId="2" ParentId="1773" CreationDate="2012-12-22T01:39:35.113" Score="3" Body="&lt;p&gt;The controversy surrounding commodity futures flows from Gorton and Rouwenthorst (2004).  The authors show an equal-weight portfolio of long positions in commodity futures provides a Sharpe ratio greater than the one earned by holding a cap-weighted portfolio of U.S. stocks (beginning in the 1950's through 2004 or so).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In essence, why should holding a basket of futures contracts earn a risk premia of similar magnitude to holding claims on risky streams of future consumption?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keynes floated the idea of &quot;normal backwardation&quot;, a situation where the futures price trades at a discount to the expected spot price (an insurance premium provided by producers attempting to hedge future sales).  This is, however, an unobservable phenomena regardless of whether commodity futures prices are in actual market backwardation or contango (downard or upward sloping price term structures).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the search goes on to explain why a simple basket of commodity futures performs the way it does.  Evidence points to the equal-weight portfolio having favorable exposure to roll yields during the 20th century.  Similarly, time series momentum also seems to &quot;work&quot; in commodity futures, moreso with winners than losers.  Hence, holding a long-only portfolio of commodity futures gives exposure to the time-series momentum effect of winners.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It may be beneficial to hold commodities, however a long-only strategy may indeed be an inefficient vehicle for accessing premia associated with roll yields and time series momentum.&lt;/p&gt;&#xA;" OwnerUserId="3478" LastEditorUserId="3478" LastEditDate="2012-12-22T18:50:32.787" LastActivityDate="2012-12-22T18:50:32.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4821" PostTypeId="2" ParentId="2870" CreationDate="2012-12-22T18:28:48.187" Score="2" Body="&lt;p&gt;If one performs a simulation of the historical performance of the minimum variance portfolio in U.S. and global stocks, there is no statistically significant alpha remaining after projecting the portfolio's excess returns onto common risk factors (e.g. Fama French).  See &lt;a href=&quot;http://www.rallc.com/Our%20Ideas/Insights/Papers/Documents/FAJ_SeptOct_2011_A_Survey_of_Alternative_Equity_Index_Strategies.pdf&quot; rel=&quot;nofollow&quot;&gt;Tzee-man Chow, Jason Hsu, Vitali Kalesnik, and Bryce Little.&#xA;&quot;A Survey of Alternative Equity Index Strategies&quot;, Financial Analysts Journal,&#xA;September/October 2011, Vol. 67, No. 5: 37–57&lt;/a&gt; for the results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What this suggests is minimizing the variance of a portfolio of stocks systematically provides positive loadings on size and value factors.  That explains the lion's share of why a minimum variance portfolio performs well in stocks.  Note my explanation does not touch on the &quot;low-beta&quot; anomaly which controls for size and value, however, I omit that because it is less relevant to the explanation of the returns of the minimum variance portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interestingly, a minimum variance portfolio in Treasury bills, for example, doesn't provide an analogous result.  In this asset class, picking government securities with the lowest volatility will almost surely decrease your returns.  It is an odd feature of equities that we see such desirable factor loadings in stocks with low sensitivity to the overall market.&lt;/p&gt;&#xA;" OwnerUserId="3478" LastActivityDate="2012-12-22T18:28:48.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4822" PostTypeId="2" ParentId="2705" CreationDate="2012-12-22T18:46:00.570" Score="2" Body="&lt;p&gt;Enclosed is a longer comment on risk parity:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A risk parity portfolio is one with the objective to equalize each asset's marginal contribution to the portfolio's total risk.  At first glance, this objective function does not require returns estimates to construct portfolio weights, only estimates of returns variance, which is a feasible task.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it is impossible to entirely divorce portfolio construction from making key assumptions about the returns of assets in your portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, one has to &lt;em&gt;choose&lt;/em&gt; which assets to include in a risk parity portfolio.  Amongst the numerous choices of assets, one would intuitively hope to end up with a mixture with the same properties desirable for any portfolio: (1) positive expected returns and (2) imperfect correlation amongst one another.  The higher the returns, and the lower the correlation, the better the outcome.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So be mindful of this when thinking of risk parity.  If you believe you can select a robust mix of assets with both (1) and (2) without relying on statistical estimates, then risk parity may be the best way forward.&lt;/p&gt;&#xA;" OwnerUserId="3478" LastActivityDate="2012-12-22T18:46:00.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4823" PostTypeId="1" AcceptedAnswerId="4833" CreationDate="2012-12-22T20:42:14.513" Score="2" ViewCount="742" Body="&lt;p&gt;I have the following question. Consider that you have a stock currently trading at 100\$. In one month it can jump to 120\$ with probability 99% and go to 80\$ with probability 1%. How much is call option with strike at 110$ worth now?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So when you do replication portfolio consisting of 0.25 stock and -20\$ gives exactly the same payoff as the option, hence the option should be worth 5\$. But again consider someone who wants to sell you security that in 99% cases gives you 10\$ and in remaining 1% gives you 0\$. How much would you be willing to pay for it? My whole intuition says it should be close to 10\$, but again replication tells 5\$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone comment on this? I feel really annoyed by this, as I tend to believe the replication model (because it replicates option with certainty), but it contradicts my intuition.&lt;/p&gt;&#xA;" OwnerUserId="3378" LastActivityDate="2012-12-24T19:36:59.407" Title="easy one step option replication" Tags="&lt;replication&gt;" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4824" PostTypeId="2" ParentId="4823" CreationDate="2012-12-22T21:01:50.997" Score="1" Body="&lt;p&gt;the reason the derivative is worth that much is because it is replicating it with stock. in your example, you have a security that in 99% cases gives you \$10 and else \$0. However, what is the underlying that you use to hedge? Nothing. Therefore it must be worth the expected value or 9.90&lt;/p&gt;&#xA;" OwnerUserId="3440" LastActivityDate="2012-12-22T21:01:50.997" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4825" PostTypeId="2" ParentId="4816" CreationDate="2012-12-22T21:24:52.363" Score="4" Body="&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Mutual_information&quot; rel=&quot;nofollow&quot;&gt;Mutual information&lt;/a&gt; measures  how much knowing one variable reduces uncertainty about another variable. It considers any type of dependency (linear or non-linear), it's measured in bits, and it is widely used in machine learning, computer vision NLP and other fields.&lt;/p&gt;&#xA;" OwnerUserId="2029" LastActivityDate="2012-12-22T21:24:52.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4826" PostTypeId="2" ParentId="4812" CreationDate="2012-12-22T21:39:56.297" Score="1" Body="&lt;p&gt;Let's say you have $N$ available portfolio elements, and you have (arbitrarily) chosen a weight vector $w^{(i_3,\dots,i_{N})}$ for $N-2$ of them.  At this point, the equation &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$w^{\prime}\Sigma w={\sigma^*}^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;becomes a simple quadratic equation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ a {w^{(1)}}^2 +b {w^{(1)}} +c =0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in the final weight $w^{(1)}=1-w^{(2)}$ for the last remaining indexes.  If it has any real roots, then you have one of your family of solutions.  If not, then your initial choice was not on a linear subspace intersecting the hypersurface of solutions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is actually pretty trivial to handle, even symbolically, for $N=3$.  For higher dimensions, I'm not sure if one obtains a nice matrix-algebra formula or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can take the eigenvectors/principal components $p_i$ of your correlation matrix, and consider the problem in that space.  Here, the overall variance is going to be&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \sum_{i=1}^N a_i \nu_i^2 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for eigenvalues $\nu_i$.  Given weights on a subset of $N-2$ of them (without loss of generality, indexes 3 through $N$), you can take &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \sum_{i=3}^N a_i \nu_i^2 = s^2 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and you are then solving&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ a_1 \nu_1^2 + (1-a_1) \nu_2^2 = {\sigma^*}^2-s^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for $a_1$, which manifests the explicit restriction ${\sigma^*}^2&amp;gt;s^2$ and solves to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ a_1  = \frac{ {\sigma^*}^2-s^2 -\nu_2^2 }{(\nu_1^2  - \nu_2^2)}$$.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2012-12-22T21:39:56.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4827" PostTypeId="2" ParentId="3821" CreationDate="2012-12-22T23:39:33.307" Score="2" Body="&lt;p&gt;No, the &quot;low-beta&quot; anomaly is not the result of the difference between arithmetic and geometric mean returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Statistical tests verifying the existence of the anomaly rely on models employing the arithmetic mean returns, $$\mu_a = \mu_g + \frac{\sigma^2}{2}$$, hence the penalty excess volatility incurs when compounding returns over time does not explain the difference.&lt;/p&gt;&#xA;" OwnerUserId="3478" LastActivityDate="2012-12-22T23:39:33.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4828" PostTypeId="2" ParentId="4435" CreationDate="2012-12-22T23:45:28.267" Score="0" Body="&lt;p&gt;Yes, there are contradictions in other markets.  Think of U.S. government debt securities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Building a low volatility portfolio would result in holding T-Bills, earning a meager return and experiencing very little volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Building a high volatility portfolio would result in holding longer duration T-Bonds, and would deliver appreciably higher returns than the T-Bill portfolio over time.&lt;/p&gt;&#xA;" OwnerUserId="3478" LastActivityDate="2012-12-22T23:45:28.267" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4829" PostTypeId="2" ParentId="3173" CreationDate="2012-12-22T23:55:09.057" Score="2" Body="&lt;p&gt;This piece of research provides everything you need:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://faculty.washington.edu/ezivot/econ424/portfoliofunctions.pdf&quot; rel=&quot;nofollow&quot;&gt;http://faculty.washington.edu/ezivot/econ424/portfoliofunctions.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3478" LastActivityDate="2012-12-22T23:55:09.057" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4830" PostTypeId="2" ParentId="4823" CreationDate="2012-12-23T04:49:14.573" Score="0" Body="&lt;p&gt;The reason is because we can hedge out uncertainty by using the stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In our case, let's say a stock is trading at 100, with 75% chance it will be 110, and with 25% chance it will be 90. How much would you sell a 100 strike call for?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In 75% of cases, the payoff is 10 else 0. You would think the value of this should be 7.50. Wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, now view it from the following perspective:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second I buy the call, I can short the stock. We can derive what the risk-neutral probabilities are and in our case, it will be 50% up and 50% down. Now we can evaluate the value of the call as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$(S_{up} -K)^+ * p_{up} + (S_{down} -K)^+ * p_{down}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In our case, it will be $(110-100)*.5 = 5$. After I sell this asset for 5 dollars, I do the following: borrow half a share of stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case that it goes up to 110, I will lose exactly 5 dollars because I now have to buy back half a share of stock at 110 when I sold it at 100. $(110-100)*.5 = 5$, but I sold it to you for 5. I break even. Now in the case that the stock goes down to 90, I make exactly 5 dollars from the stock, but I have to pay you 10 dollars. However, I sold it to you originally for 5 and I also made 5. Again I break even. Therefore, ALL uncertainty is lost and the value of this option MUST be 5 or else, if you are willing to buy it for 7.50, I will sell it to you all day (quite literally :) ).&lt;/p&gt;&#xA;" OwnerUserId="3440" LastEditorUserId="467" LastEditDate="2012-12-24T11:48:44.753" LastActivityDate="2012-12-24T11:48:44.753" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4831" PostTypeId="2" ParentId="139" CreationDate="2012-12-23T05:05:58.260" Score="2" Body="&lt;p&gt;the true way to replicate the vix is to use an infinite strip of out of the money calls and puts and actually, this is the definition of vix. it is $\sqrt{\int^{T+\Delta}_T v_s ds}$ where $v_s$ is realized variance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Peter Carr showed that we can value any exotic payoff, free of any option model by using the spanning formula. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $g(S_T)$ be the exotic payoff that you are trying to replicate, then:&#xA;$\mathbb{E} [g(S_T)] = g(F) + \int^F_0 dK \tilde{P}_K g''(K) + \int^\infty_F dK \tilde{C}_K g''(K)$ where $C_K, P_K$ are the values of the call options and put options which we can get from the market. Now, the funky payoff that turns out the most interesting is $log\frac{S_T}{S_0}$  since this payoff replicates the total variance. If you are familiar with stochastic calculus, you can perform ito's lemma on this and then you can value exactly the vix spot index. I know for a fact that this is what many banks are doing :).&lt;/p&gt;&#xA;" OwnerUserId="3440" LastActivityDate="2012-12-23T05:05:58.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4832" PostTypeId="2" ParentId="4294" CreationDate="2012-12-23T05:56:06.957" Score="3" Body="&lt;p&gt;you definitely can track this not even by just using vix options, but even by using spx options. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $g(S_T)$ be the exotic payoff that you are trying to replicate, then:&#xA;$\mathbb{E} [g(S_T)] = g(F) + \int^F_0 dK \tilde{P}_K g''(K) + \int^\infty_F dK \tilde{C}_K g''(K)$ where $C_K, P_K$ are the values of the call options and put options which we can get from the market. Now, the funky payoff that turns out the most interesting is $log\frac{S_T}{S_0}$  since this payoff replicates the total variance. If you are familiar with stochastic calculus, you can perform ito's lemma on this and then you can value exactly the vix spot index. In your case, if you let $S_T$ be the vix index, then you would need a few vix options to replicate vvix. &lt;/p&gt;&#xA;" OwnerUserId="3440" LastActivityDate="2012-12-23T05:56:06.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4833" PostTypeId="2" ParentId="4823" CreationDate="2012-12-23T07:22:28.640" Score="6" Body="&lt;p&gt;While another user touched on the hedging argument in order to reconcile your intuition with the correct value of the option he went off track (imho). I like to focus entirely on the hedging issue because it is key in understanding the differences in intuition and the fair price of such option. Unfortunately I have hardly ever found a simple 1-2 paragraph explanation in any of the PhD level papers. (should grad school students not start with the most basic understanding and be able to communicate such basics?). Anyway, here it goes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2 important concepts apply that make all the difference:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) In order to apply the fundamentals of derivatives pricing in a discrete space several conditions have to be met. One such condition is the condition of complete markets (or in the binomial case, completeness of the binomial model). The theorem of completeness states that &quot;every derivative security can be replicated by trading in the underlying stock and money market. In a complete market, every derivative security has a unique price that precludes arbitrage&quot; (Shreve, Stochastic Calculus for Finance I, p. 14, ed. 2004). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, as long as those conditions are met, especially the one that requires the ability to trade in the underlying asset then you can price a derivative security as the discounted expected value applying risk-neutral probabilities. Thus, in your example the price of the option should be &lt;code&gt;$5&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Now, why should the price be &lt;code&gt;$5&lt;/code&gt; regardless of the real-world probabilities of attaining each future stock node? I think this is exactly where the intuition leads most astray. The answer is that if you use real-world probabilities to price an option then you also must discount the future expected payoffs at the appropriate real-world discount rate. An option of a stock that has a probability of 99% of going from 100-&gt; 120 and 1% of going from 100-&gt; 80 requires a much higher return and thus the option on such asset must be discounted at a much higher rate. Obviously it is hard to estimate the required returns investors demand on specific investment opportunities, and even hard to estimate the required return, used to discount future expected values, for the option of such underlying assets. That is the whole point of trying to price derivatives with the construct of risk-neutral probabilities because the discounting will be done through the risk-free interest rate one can receive as yield by investing in the money market/bond market (much can even be discussed about what risk-free nowadays means...). The finding that has been rewarded with a Nobel Price has exactly been that: The proof that using risk-neutral probabilities and constructing risk-less portfolios that make one indifferent about future outcomes will lead to the same solution than going the hard way by using real-life probabilities and discounting future expected cash flows at investors' required returns. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2012-12-24T05:42:07.977" LastActivityDate="2012-12-24T05:42:07.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4834" PostTypeId="1" CreationDate="2012-12-23T12:16:42.737" Score="8" ViewCount="1516" Body="&lt;p&gt;I am trying to figure-out an optimal policy for buying a unit when its price follows a mean-reverting price process (Ornstein–Uhlenbeck), when I have a finite time deadline for buying the unit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to search the literature for it, but couldn't find anything. I would very much appreciate any help.&lt;/p&gt;&#xA;" OwnerUserId="3485" LastEditorUserId="37" LastEditDate="2013-05-16T01:58:27.970" LastActivityDate="2013-05-16T16:15:19.953" Title="Threshold calculation for buying a mean-reverting asset" Tags="&lt;mean-reversion&gt;&lt;price&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4835" PostTypeId="1" CreationDate="2012-12-23T18:43:46.797" Score="2" ViewCount="177" Body="&lt;p&gt;Can I take liquidity risk determinant as a dimension of it in order to examine the impact of liquidity risk on performance of banks? For example in a literature, Tangibility i.e., ratio of fixed assets to total assets was used as a determinant of liquidity risk and results found to have significant relationship of this tangibility ratio with liquidity risk. So based on these findings can i take this tangibility ratio as a measure or dimension of liquidity risk in order to examine the impact of liquidity risk on performance of banks?&lt;/p&gt;&#xA;" OwnerUserId="3487" LastActivityDate="2012-12-27T03:52:23.793" Title="Can determinant of liquidity risk be used as a dimension or measure of liquidity risk" Tags="&lt;dimensions&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4838" PostTypeId="1" AcceptedAnswerId="4840" CreationDate="2012-12-24T15:28:31.187" Score="1" ViewCount="78" Body="&lt;p&gt;I'm a developer writing a system for a startup.  Without giving away too much of the business model, here are the basics of how it works:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The web site has two forms of &quot;currency&quot;: &lt;em&gt;tickets&lt;/em&gt; and &lt;em&gt;credits&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;Tickets&lt;/em&gt; are basically like &lt;a href=&quot;http://en.wikipedia.org/wiki/Chinese_auction&quot; rel=&quot;nofollow&quot;&gt;Chinese auction&lt;/a&gt; tickets: there are many prize items on the site, and you can cash in your tickets on any prize to try and win that prize.&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;Credits&lt;/em&gt; are more like currency: the site has an online store section, and you can use your credits to buy things in the store.&lt;/li&gt;&#xA;&lt;li&gt;Tickets and credits are purchased together, as part of one package.  For simplicity, we'll say that if you spend $1, you will get 1 ticket and 1 credit.&lt;/li&gt;&#xA;&lt;li&gt;We do sometimes give away free tickets and credits in promotions.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Now I need to draw up several different profit &amp;amp; loss reports:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Per prize item, I need to calculate the internal costs of the item (purchase price, shipping, etc.) against the income attributable to that prize item (value of tickets cashed in on that item).&lt;/li&gt;&#xA;&lt;li&gt;Per store sale, I need to calculate the internal costs of the item, against the income (value of credits cashed in to buy that item).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I do have a database field to store the income attributable to each ticket or credit.  My question is, what value should I use there?  I could say that each ticket purchased with actual money is worth 50c, as is each credit, since for every dollar you get one ticket and one credit.  But this doesn't tell the full P&amp;amp;L story, since one of the factors we're counting on for the site to be profitable is that, like frequent flyer miles, many people will not fully exploit their tickets and/or credits i.e. abandon them.  So when I look at a prize item, if I only count 50c of income for each ticket, then I lose the possibility that the user abandoned his credits.  Likewise, if I only count 50c of each credit spent in the store as income, I lose the possibility that the user abandoned his tickets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is correct accounting practice for this situation?&lt;/p&gt;&#xA;" OwnerUserId="3490" LastActivityDate="2012-12-24T17:30:15.840" Title="How to attribute income that incurs a double liability in a P&amp;L?" Tags="&lt;programming&gt;&lt;accounting&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4839" PostTypeId="2" ParentId="4593" CreationDate="2012-12-24T17:13:23.607" Score="3" Body="&lt;p&gt;This &lt;a href=&quot;http://www.hiebs.hku.hk/working_paper_updates/pdf/wp1041.pdf&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; seems to outline what you are looking for.  You want to be careful about mean/variance/kurtosis to make sure you are working in the correct measure.&lt;/p&gt;&#xA;" OwnerUserId="3491" LastEditorUserId="467" LastEditDate="2012-12-25T23:55:15.077" LastActivityDate="2012-12-25T23:55:15.077" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4840" PostTypeId="2" ParentId="4838" CreationDate="2012-12-24T17:30:15.840" Score="3" Body="&lt;p&gt;This is the framework for what you need to do, depending on whether you'll be following IFRS, GAAP, or some bogus Groupon accounting method will decide what rules/methods you'll have to follow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you want to create are contra accounts for each.  This works similar to a &quot;bad debt expense&quot; in accounts receivable.  You need to estimate the probability that a ticket isn't utilized and use that value as an estimated contra against Cost of Goods Sold.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Per Prize Cost = Price of Prize - tickets collected on that item - expected value of unused tickets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Per store sale would work in the same fashion but I doubt the probability of unused tickets vs. unused credits would be the same.  I assume you're using SQL or some other relational DB, so make sure you're using computed columns and not actually adjusting the raw data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an aside, the accounting estimates required for this kind of business model will set off red flags everywhere to any analyst worth their salt.&lt;/p&gt;&#xA;" OwnerUserId="2732" LastActivityDate="2012-12-24T17:30:15.840" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4841" PostTypeId="2" ParentId="4823" CreationDate="2012-12-24T19:36:59.407" Score="0" Body="&lt;p&gt;You simply have to think about this enough to become convinced, it is unintuitive but correct.  Next you convince yourself that this does not mean you cannot believe options to be cheap or expensive, if you have a different opinion about the future return distribution of the underlying.&lt;/p&gt;&#xA;" OwnerUserId="3491" LastActivityDate="2012-12-24T19:36:59.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4842" PostTypeId="1" AcceptedAnswerId="4844" CreationDate="2012-12-25T07:59:20.680" Score="1" ViewCount="2783" Body="&lt;p&gt;The parametric VaR is defined as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$VaR=Z_a*Vol$$&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Is this the best way to interpret how much risk is being taken on for a particular asset?&lt;/li&gt;&#xA;&lt;li&gt;How does one interpret volatility on its own if its not converted into a percent figure?&lt;/li&gt;&#xA;&lt;li&gt;Therefore, wouldn't be better if sharp ratios were expressed in VaR's?&lt;/li&gt;&#xA;&lt;li&gt;I mean, what does it really mean if a Portfolio Manager is gaining 2% return for 1 unit of risk. What does 1 unit of risk mean?&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Shouldn't risk only be defined only in percentage terms -- having a hard time wrapping my head around this concept of volatility as a risk measure.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;What do you guys think?&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="3388" LastEditorUserId="467" LastEditDate="2012-12-26T00:02:57.510" LastActivityDate="2012-12-26T00:02:57.510" Title="How to interpret/use VaR and Standard Deviation?" Tags="&lt;volatility&gt;&lt;var&gt;&lt;value-at-risk&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4844" PostTypeId="2" ParentId="4842" CreationDate="2012-12-25T09:06:37.977" Score="3" Body="&lt;p&gt;VaR is not a good measure of risk taking, in my opinion. It suffers from inherent faulty assumptions (check out VaR Wiki to start) and it omits many other important aspects of risk measurement. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I evaluate an asset's risk and return I like to start looking at the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Historical risk and returns of an asset. This leads to the Sharpe Ratio, though I prefer a slightly different ratio which does not penalize for excess performance to the upside (Sharpe Ratio does penalize)&lt;/li&gt;&#xA;&lt;li&gt;Expected returns and risk. Can I have confidence that historical risk and return figures are a reasonable predictor of future risk and return. If not then, is there a way to make adjustements? If not then I should not take into consideration historical risk and return values when evaluating future expected risk and returns. &lt;/li&gt;&#xA;&lt;li&gt;Drawdowns of an asset's return. Alongside the drawdown I want to know how long it took for the asset's subsequent returns to make it back to the pre-drawdown return. &lt;/li&gt;&#xA;&lt;li&gt;Correlation of the asset with other assets. Is the asset uncorrelated or potentially even negatively correlated with other assets? &lt;/li&gt;&#xA;&lt;li&gt;Contribution of the asset to the portfolio overall. Does the asset contribute to a lower portfolio risk and portfolio risk adjusted returns. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Regarding your points:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&quot;How does one interpret volatility on its own&quot;: It is a measure of variation around a certain mean, either historically around a historical mean or around expected value. Standard deviation is expressed in percentage terms if it is calculated using returns as input. If you calculate volatility on prices or other metrics then you need to convert to percentage figures.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&quot;What does the 1 unit of risk mean&quot;: The one unit of risk you refer to is in percentage terms so Sharpe Ratio expresses the excess return in percent per percent of risk. Its a very clear cut and simple way to comprehend risk, in my opinion.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-12-25T09:06:37.977" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="4845" PostTypeId="1" CreationDate="2012-12-25T19:48:00.410" Score="1" ViewCount="234" Body="&lt;p&gt;Trying to understand the Eurdollar market a little better. I understand it's the market for dollar denominated deposits outside the US (not just in Europe). They are unregulated and not subject to reserve requirements, unlike traditional deposits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The players that engage in the Eurodollar futures are wide reaching institutions but they are predominately banks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets say we have two banks: Bank A: JP Morgan, a bank with over a trillion dollar of deposits and has plenty of excess reserves surplus to reserves requirments and the loans they have made to households/companies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bank B: Goldman Sachs: Investment Bank with a small deposit base and highly dependent on the open market for funding the banks operations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If JP Morgan were to engage in a 3M ED contract with Goldman their essentially lending Goldman their surplus deposit at a higher yield to treasuries (3M Libor) and Goldman is borrowing those funds to run their operations. However, is there any money that is actually exchanged when entering the ED contract or is it purely notional of 1M per contract. If its notional what is the purpose of the ED contract other than for hedging. It sounds silly but at the end of the day these futures market were made for producers to not only hedge their risk but to sell their produce to users. Shouldn't their be money exchanged in the idea that one party needs money and the other has it? Are the sellers of ED contracts hedgers or borrowers &amp;amp; users of the funds. &lt;/p&gt;&#xA;" OwnerUserId="3388" LastActivityDate="2014-11-20T13:03:13.847" Title="Eurdollar Futures" Tags="&lt;interest-rates&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4846" PostTypeId="1" CreationDate="2012-12-25T23:49:21.660" Score="7" ViewCount="1911" Body="&lt;p&gt;I am dealing with a strategy that is &lt;strong&gt;not&lt;/strong&gt; high-frequency based.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The strategy consumes normalized data from Bloomberg and Reuters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For US equity market, can someone recommend some real-time data sources - other than Bloomberg/Reuters/IB - that are known to be reliable?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, subscription cost is not an issue.  &lt;/p&gt;&#xA;" OwnerUserId="3497" LastEditorUserId="467" LastEditDate="2012-12-26T00:07:46.680" LastActivityDate="2015-06-17T17:07:02.433" Title="What sources would you recommend for Real Time Market Data other than Bloomberg/Reuters?" Tags="&lt;market-data&gt;" AnswerCount="6" CommentCount="5" FavoriteCount="5" CommunityOwnedDate="2014-06-30T15:32:03.123" ContentLicense="CC BY-SA 3.0" />
  <row Id="4848" PostTypeId="2" ParentId="4846" CreationDate="2012-12-26T00:23:32.560" Score="5" Body="&lt;p&gt;I used to work in a hedge fund who was using different software from &lt;a href=&quot;http://www.sungard.com/&quot; rel=&quot;noreferrer&quot;&gt;Sungard&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We use one of their software which had an embedded data stream for live trading purposes, but I think there is a product in which you might be more interested: &lt;a href=&quot;http://www.sungard.com/financialsystems/brands/glmarketmap.aspx&quot; rel=&quot;noreferrer&quot;&gt;MarketMap&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;MarketMap has a whole UI and different tools for analysis, but I think you're looking for something you can also access from an API. You'll have to contact Sungard about that, but I remember that MarketMap was not very expensive and quite good.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2012-12-26T00:32:12.630" LastActivityDate="2012-12-26T00:32:12.630" CommentCount="0" CommunityOwnedDate="2014-06-30T15:32:03.123" ContentLicense="CC BY-SA 3.0" />
  <row Id="4849" PostTypeId="2" ParentId="4834" CreationDate="2012-12-26T07:33:12.837" Score="2" Body="&lt;p&gt;I think a good way to think about your problem is the example of finding an optimal VWAP trading strategy. You basically have a finite point in time by which you must have performed your transaction and you trade a similar asset than the one you are considering, one with the same underlying assumptions of mean-reversion (I make such assumption in the same way than you make the assumption of mean-reversion). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With this assumption in mind and given you must at some point in time transact you are now faced with the following optimization problem: By how much does the asset have to traverse away from whatever you define as mean point in order to induce you to transact and in what size?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, contrary to a pairs trading strategy you do not want to transact at the point where an asset moved away from its mean but in the same direction as your order direction. You believe in mean-reversion and assume you can transact the asset more optimally at a later point. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I cannot provide an optimization function (because its very closely related to something I have been working on in the past and do not want to make it public) but here couple points I would consider:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Does the asset really mean-revert more often than it trends in order to overcome each and every cost of execution, including commission, market impact,...? Does it pay to consider implementing a hybrid strategy in which you measure regime changes and only employ a mean-reversion approach when price dynamics favor such approach? &lt;/li&gt;&#xA;&lt;li&gt;Get a firm grasp at how volatile the asset is. By how many standard deviations does the asset trade away from its mean? &lt;/li&gt;&#xA;&lt;li&gt;Are you willing to take on more proprietary risk in that you are willing to potentially transact the full size of your order at once given the asset diverted sufficiently much away from your defined mean? Or do you want to split the order into many child orders and trade smaller sizes at smaller diversions? &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I would first try to answer and consider those points before proceeding. Please note I am sharing my own experience here and do not present an academic approach. I implemented a VWAP strategy with systematic proprietary overlay that performed at a close to zero tracking error over a longer period of time in several Asian equity markets, including names that were generally not considered to be executed through standard DMA engines either for lack of liquidity, or other anomalies.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-01-28T00:42:17.213" LastActivityDate="2013-01-28T00:42:17.213" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4850" PostTypeId="2" ParentId="4835" CreationDate="2012-12-26T07:52:19.050" Score="1" Body="&lt;p&gt;Friend, take a step back and think what you really want to measure. During normal times you should never care about liquidity risk or credit risk of banks, EVER, at least what concerns the text book definitions of liquidity and credit risk. During times of stress you want to throw all accounting gimmicks and monkey numbers aboard and focus on one single number. CASH available to pay off short-term liabilities. NOTHING ELSE. Walk me through one single bank run or bank blowup scenario where any other numbers mattered. So, if accounting numbers during stressed times and accounting numbers during regular market cycles do not matter then why do you want to focus on those? I understand if you want to become an accountant but if you truly show interest in understanding solvency then forget each and every last one concept of what CFA or other accounting related sources teach you regarding liquidity or credit risk of banks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Believe it or not, but before Lehman went belly up none of the analysts who evaluated the solvency of LEH cared about the inputs to measuring credit or liquidity risk. They all cared about whether LEH can satisfy today's and tomorrow's margin calls and expected redemptions as well as the probabilities of having further credit lines pulled. Those who sat on the other end of the table did not evaluate LEH's credit in any traditional sense. Those decision makers had all ears on T.S. Paulson and also what the FED had up its sleeve, the probability of a bailout, in summary, political decisions where all that mattered. Same with Bear Sterns, same with every other bank prior to having gone belly up. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, even if you looked at liquidity and credit risk way earlier before the last days of LEH' life may I remind you that their liquidity numbers (however faked they were) did not point to a default within days. Lights went out when JPM pulled their lines (for debatable but completely legitimate reasons). Sure, liquidity and credit risk numbers deteriorated over months prior to the crisis but so did everything else. Its like saying that &quot;hey, I told you my 'economic-feel-good-index' went down the river since October 2007, so you have to watch that each time you care about evaluating bank risk&quot;. As long as any metric is anchored to a mix of economic, market, sentiment numbers then obviously you observe the higher correlation between such metric and market risk the more overall market stress feeds into the ingredients of such metric. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;//beginning of rant(please stop here if not interested)//&#xA;I recommend you diligently study this &quot;stuff&quot; to get your As in your MBA courses and CFA exams. However, keep in mind that most of the accounting numbers are there for one reason: To feed a whole industry of people who would not exist without this construct and to provide CFOs and CEOs with ever more ways to mask their real numbers. Nobody trading CDSs cares about traditional credit risk evaluations. It is generally those who continuously emphasize the importance WHO DO NOT HAVE A SKIN IN THE GAME, such as accountants, analysts, fund managers, educators, the media. Why I include fund managers? Because I cannot take someone seriously who comes out in 2008 and arrogantly tells the world that his fund performed 5% better than the benchmarks....it is &quot;only&quot; down 37%. //end of rant//&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2012-12-27T03:52:23.793" LastActivityDate="2012-12-27T03:52:23.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4851" PostTypeId="2" ParentId="4846" CreationDate="2012-12-26T08:00:20.143" Score="6" Body="&lt;p&gt;What sources?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What about: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;CQG &lt;/li&gt;&#xA;&lt;li&gt;Telvent DTN&lt;/li&gt;&#xA;&lt;li&gt;NXCore (though it caters to high frequency trading)&lt;/li&gt;&#xA;&lt;li&gt;Esignal&lt;/li&gt;&#xA;&lt;li&gt;Kinetick&lt;/li&gt;&#xA;&lt;li&gt;all direct exchange feeds&lt;/li&gt;&#xA;&lt;li&gt;all direct alternative venue feeds&lt;/li&gt;&#xA;&lt;li&gt;various otc fx feeds&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Those are that come to mind for now. Please be aware the quality of the data and API design varies widely among the ones I mentioned. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-12-26T08:00:20.143" CommentCount="0" CommunityOwnedDate="2014-06-30T15:32:03.123" ContentLicense="CC BY-SA 3.0" />
  <row Id="4852" PostTypeId="1" AcceptedAnswerId="4858" CreationDate="2012-12-26T10:47:27.727" Score="16" ViewCount="6484" Body="&lt;p&gt;I have started reading about HMM it gives an intuitive idea about what HMM is all about. I am looking out for example where its applied to Equity model using R / Excel. The material which I read so far is about its application to speech recognition.&lt;/p&gt;&#xA;" OwnerUserId="926" LastEditorUserId="2727" LastEditDate="2012-12-27T10:22:50.630" LastActivityDate="2016-11-10T08:04:59.127" Title="Hidden Markov Model &amp; Its Application" Tags="&lt;statistics&gt;&lt;r&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="4853" PostTypeId="1" AcceptedAnswerId="4860" CreationDate="2012-12-26T14:29:08.660" Score="4" ViewCount="305" Body="&lt;p&gt;If some conditions are met (stop loss, trailing stop, take profit...) we will close ours positions (sell/buy) to avoid having more loss or to ensure profit. In an automatic trading system, it is easy to set-up these rules.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But is there an automated strategy / rule to re-activate our strategies? For example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;simulate our P&amp;amp;L if we have no risk management rule; and then reactivate ours positions if the simulated drawdown or run up reaches a certain value&lt;/li&gt;&#xA;&lt;li&gt;reactivate after two days&lt;/li&gt;&#xA;&lt;li&gt;reactivate at the end of the current month?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Or is this part of an &quot;automated&quot; trading in fact manually done?&lt;/p&gt;&#xA;" OwnerUserId="3500" LastEditorUserId="2246" LastEditDate="2013-03-27T17:15:09.727" LastActivityDate="2013-03-27T17:15:09.727" Title="How to reactivate a risk mangement rule in an automated process" Tags="&lt;backtesting&gt;&lt;automated-trading&gt;&lt;risk-management&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4854" PostTypeId="2" ParentId="4852" CreationDate="2012-12-26T16:45:15.550" Score="15" Body="&lt;p&gt;The clearest and most intuitive article I have seen so far is &lt;br&gt;&#xA;&lt;a href=&quot;http://www.cfapubs.org/doi/abs/10.2469/faj.v68.n3.3&quot; rel=&quot;noreferrer&quot;&gt;Kritzman et al., Regime Shifts: Implications for Dynamic Strategies in FAJ (May / June 2012)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It not only shows how you can use HMM for financial modelling but it also goes through the actual estimation algorithm (Baum-Welch) step-by-step and even gives full MATLAB-code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the abstract:&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Regime shifts present significant challenges for investors because&#xA;  they cause performance to depart significantly from the ranges implied&#xA;  by long-term averages of means and covariances. But regime shifts also&#xA;  present opportunities for gain. The authors show how to apply&#xA;  Markov-switching models to forecast regimes in market turbulence,&#xA;  inflation, and economic growth. They found that a dynamic process&#xA;  outperformed static asset allocation in backtests, especially for&#xA;  investors who seek to avoid large losses.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I brought the paper to the attention of the renowned blog &lt;a href=&quot;http://quantivity.wordpress.com/&quot; rel=&quot;noreferrer&quot;&gt;Quantivity&lt;/a&gt; and they started a series on reproducing the results in R: &lt;a href=&quot;http://quantivity.wordpress.com/2012/11/09/multi-asset-market-regimes/&quot; rel=&quot;noreferrer&quot;&gt;Here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I am not aware of a freely accessible copy of the paper - if you find one, please include it in a comment - I will change the answer accordingly.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your own experiments with HMM in R you can use the &lt;a href=&quot;http://cran.r-project.org/web/packages/RHmm/index.html&quot; rel=&quot;noreferrer&quot;&gt;RHmm package&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Addendum&lt;/strong&gt;&lt;br&gt;&#xA;Unfortunately the RHmm package has been deprecated. A good alternative seems to be the &lt;a href=&quot;http://cran.r-project.org/web/packages/depmixS4/index.html&quot; rel=&quot;noreferrer&quot;&gt;depmixS4 package&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2014-09-25T13:19:22.707" LastActivityDate="2014-09-25T13:19:22.707" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4855" PostTypeId="2" ParentId="4816" CreationDate="2012-12-26T17:40:53.410" Score="3" Body="&lt;p&gt;The answer of user27915816 led me into the right direction, yet I think I found an even better generalization:&lt;br&gt;&#xA;&lt;a href=&quot;http://en.wikipedia.org/wiki/Distance_correlation&quot; rel=&quot;nofollow noreferrer&quot;&gt;Distance Correlation (dCor)&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;There are several reasons for that:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;It generalizes classical (i.e. linear) correlation in the sense that linearity is a special case. It gives identical readings for linear dependence.&lt;/li&gt;&#xA;&lt;li&gt;There are analogs for variance, covariance and standard deviation, so these identities hold: &lt;span class=&quot;math-container&quot;&gt;$$\operatorname{dVar}^2_n(X) := \operatorname{dCov}^2_n(X,X)$$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$$\operatorname{dCor}(X,Y) = \frac{\operatorname{dCov}(X,Y)}{\sqrt{\operatorname{dVar}(X)\,\operatorname{dVar}(Y)}}$$&lt;/span&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$dCor=0$&lt;/span&gt; implies true independence, all other readings imply linear or non-linear dependence - Compare the following readings, first linear correlation (&lt;a href=&quot;http://en.wikipedia.org/wiki/File:Correlation_examples2.svg&quot; rel=&quot;nofollow noreferrer&quot;&gt;source&lt;/a&gt;):&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/FJQAW.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;and distance correlation (&lt;a href=&quot;http://en.wikipedia.org/wiki/File:Distance_Correlation_Examples.svg&quot; rel=&quot;nofollow noreferrer&quot;&gt;source&lt;/a&gt;):&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/h3xHG.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;Beware, oversimplification ahead: The reason it shows this behavior is basically that it is the correlation of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Characteristic_function_%28probability_theory%29&quot; rel=&quot;nofollow noreferrer&quot;&gt;characteristic functions&lt;/a&gt; of the random variables, i.e. the Fourier transforms of the probability density functions, i.e. a rotation from the time into the frequency domain. Therefore not only linear dependence is being tested but basically all functional dependencies which can be represented by the (periodic) complex exponential function. To get an intuition read also this article: &lt;a href=&quot;https://archive.is/7TVzZ&quot; rel=&quot;nofollow noreferrer&quot;&gt;Here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;There are implementations in &lt;a href=&quot;http://www.neustats.com/neuda/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Excel&lt;/a&gt; and &lt;a href=&quot;http://cran.us.r-project.org/web/packages/energy/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;R&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2020-11-17T15:51:46.713" LastActivityDate="2020-11-17T15:51:46.713" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="4856" PostTypeId="2" ParentId="4810" CreationDate="2012-12-26T17:50:20.167" Score="7" Body="&lt;p&gt;a. is correct, but you should derive it using appropriate logic, not just guessing the answer. Ie the drift of discounted stock should be 0. Define a bond dB = rBdt. d(S/B) should have no drift. This can help you find the correct mu. You can find the sde for S/B using two dimensional ito&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b. don't really know about market price of risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;c. In this case the pde is the same as the black scholes pde using your risk neutral process. Can you think of why this is? Does the type of call option change how the underlying changes? What are the other boundary conditions ie (for S = 0 and S = infinity). Take a look at dirichlet (also known as zero gamma condition) and other types of boundary conditions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;d. That is the right start, but what is the expectation? Lets define C = cash on payout. Then the payout(S) = C*I(S&gt;K). Plug this into your formula. The expectation now looks like C*E(I(S&gt;K)). The problem is that this expectation is in real probability space and you want it in your risk neutral space. You can use girsanov's theorem. &#xA;Best proof (result to use) I found is (1) in &lt;a href=&quot;http://math.ucsd.edu/~pfitz/downloads/courses/spring05/math280c/girsanov.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://math.ucsd.edu/~pfitz/downloads/courses/spring05/math280c/girsanov.pdf&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;e. In d you will basically find that E(I(S&gt;K)) a function(t)*P(S&gt;K) in your risk neutral space. You need to find P(S&gt;k) this turns out to be N(d2). You can define a new variable (S-E(S))/std(S) = Normal(0,1) to transform P(S&gt;k) into N(d2)&lt;/p&gt;&#xA;" OwnerUserId="1105" LastEditorUserId="1105" LastEditDate="2013-01-31T00:50:24.163" LastActivityDate="2013-01-31T00:50:24.163" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4857" PostTypeId="2" ParentId="4846" CreationDate="2012-12-26T20:10:32.440" Score="0" Body="&lt;p&gt;We have used TradingPhysics and been happy with them. They offer a variety of feeds from bars to full orderbook data. The also offer futures, options, consolidated orderbook, etc...&lt;/p&gt;&#xA;" OwnerUserId="373" LastActivityDate="2012-12-26T20:10:32.440" CommentCount="0" CommunityOwnedDate="2014-06-30T15:32:03.123" ContentLicense="CC BY-SA 3.0" />
  <row Id="4858" PostTypeId="2" ParentId="4852" CreationDate="2012-12-26T23:48:12.790" Score="8" Body="&lt;p&gt;Systematic Investor also did a two part series implementation in R which is also quite helpful as he details the pitfalls too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Post One:&#xA;&lt;a href=&quot;http://systematicinvestor.wordpress.com/2012/11/01/regime-detection/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://systematicinvestor.wordpress.com/2012/11/01/regime-detection/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Part Two:&#xA;&lt;a href=&quot;http://systematicinvestor.wordpress.com/2012/11/15/regime-detection-pitfalls/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://systematicinvestor.wordpress.com/2012/11/15/regime-detection-pitfalls/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Updated version after the 'RHmm' library was taken down from CRAN repository:&#xA;&lt;a href=&quot;http://systematicinvestor.github.io/Regime-Detection-Update&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://systematicinvestor.github.io/Regime-Detection-Update&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2318" LastEditorUserId="25225" LastEditDate="2016-11-10T08:04:59.127" LastActivityDate="2016-11-10T08:04:59.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4859" PostTypeId="1" CreationDate="2012-12-27T01:23:35.603" Score="1" ViewCount="78" Body="&lt;p&gt;Say swap would be used to convert the payments of its portfolio of fixed-rate residential mortgage loans into a floating payment.  Why might a manager consider using an interest-rate in which the notional principal amount declines over time?&lt;/p&gt;&#xA;" OwnerUserId="770" LastActivityDate="2012-12-27T03:49:13.943" Title="Why might a manager consider using an interest-rate in which the notional principal amount declines over time?" Tags="&lt;fixed-income&gt;&lt;swaps&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4860" PostTypeId="2" ParentId="4853" CreationDate="2012-12-27T03:43:27.450" Score="2" Body="&lt;p&gt;I strongly assume you are talking about a simulated environment, only. Risk management rules are there for a purpose, adhere to them or throw them overboard entirely at your own peril. Having said that if you want to purely simulate how P&amp;amp;L, equity curve, and draw-down among others would have behaved had you not squared the positions due to targets or stops reached then you could do the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simply run identical strategies in parallel, same strategy logic inside except that one generates orders with attached targets and stops and the other generates orders without the bracket order. In that sense you will generate the same trade entries (given you are not subjecting your system to constraints that would prevent the system from generating orders because certain risk limits would otherwise be breached) but the exits will be different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in the end you still need to set a mechanism of how to close positions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are merely after investigating how P&amp;amp;L had traversed n-time units post the trade closure, given the trade was not closed, then there are way easier things to run for example in R. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-12-27T03:43:27.450" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4861" PostTypeId="2" ParentId="4859" CreationDate="2012-12-27T03:49:13.943" Score="3" Body="&lt;ul&gt;&#xA;&lt;li&gt;Maybe because the underlying portfolio's notional may decrease over time? &lt;/li&gt;&#xA;&lt;li&gt;Maybe because the loans are part of a private transaction in which the deal stipulates that notional is paid off over time? &lt;/li&gt;&#xA;&lt;li&gt;Maybe its a pay-through structure in which the original mortgage loan notional is paid off over time and the notional portions are passed down the structure. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;There can be a million reasons but to answer your question very directly:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The manager would engage in such swap in order to match the decreasing notional of the underlying loan portfolio. Simple as that. Life is often not that complicated. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-12-27T03:49:13.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4862" PostTypeId="2" ParentId="2148" CreationDate="2012-12-27T10:22:55.520" Score="3" Body="&lt;p&gt;One approach would be Engle (2002) dynamic conditional correlations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking your $Y_t$ and $X_t$, I will make the simplifying assumption that the mean equation of these is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\boxed{Y_t = \mu_y + \varepsilon_{y,t}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\boxed{X_t = \mu_x + \varepsilon_{x,t}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $\varepsilon_{y,t} = z_{y,t} \sigma_{y,t} \sim N(0,\sigma_{y,t})$, $\varepsilon_{x,t} = z_{x,t} \sigma_{x,t} \sim N(0,\sigma_{x,t})$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice you might want to specify a GARCH-M, or a GARCH with exogenous variables inside the mean equation. For example if $Y_t$ and $X_t$ are individual stocks in the same market, you might want to include $R_{M,t}$ so that you don't detect any correlation due to this shared factor. If you're looking across borders GARCH-M terms may become important if you want to control for portfolio rebalancing due to changing relative risks or something. The mean equations can be written in vector form as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\boxed{ Z_t = \mathbf{\mu} + \mathbf{\varepsilon}_t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $Z_t := [Y_t,X_t]'$, $\mathbf{\varepsilon} \sim N(0,H_t)$, $H_t := D_t R_t D_t$. Here, $R_t$ is the (possibly) time-varying correlation matrix and $D_t$ is simply $\text{diag}(\sigma_{y,t},\sigma_{x,t})$ when we assume no news or variance spillovers in the variance equation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The DCC estimator in the &lt;code&gt;rmgarch&lt;/code&gt; package will provide you with the dynamics of $R_t$ with no effort on your part. You can then visually inspect for a break in the correlation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, for an objective approach withing the DCC framework, take a look at &lt;a href=&quot;http://www.smurfitschool.ie/academicsampresearch/workingpapers/wp_08_10.pdf&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt; for the ability to hypothesis test structural breaks in the correlation.&lt;/p&gt;&#xA;" OwnerUserId="3174" LastEditorUserId="3174" LastEditDate="2013-01-16T08:01:54.117" LastActivityDate="2013-01-16T08:01:54.117" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4864" PostTypeId="2" ParentId="4766" CreationDate="2012-12-27T15:42:59.130" Score="1" Body="&lt;p&gt;Economically, the interest rate should be stationary. Unlike a price series, where a price of $10 may not have had the same meaning for a given stock many years ago as it does today, an interest rate of 10% always means the same thing.  Hence I side with Andre's earlier answer that you should use the untransformed interest rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, you need to think more about the hypothesis you are trying to test, and whether it should depend on the level or the change (however you represent that change).  Your model should not just be about trying to pick up some statistical correlation.  Think about the purpose of running this regression.&lt;/p&gt;&#xA;" OwnerUserId="1106" LastActivityDate="2012-12-27T15:42:59.130" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4866" PostTypeId="2" ParentId="4127" CreationDate="2012-12-27T19:01:19.233" Score="1" Body="&lt;p&gt;definition of a variance swap is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \int^{T+\Delta}_T \mathbb{E}_t[v_s] ds $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $v_s$ is the variance and $\mathbb{E}_t[v_s]$ is the expectation of the variance of time s at time t.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;therefore, pnl is:&#xA;$ (\int^{T+\Delta}_T \mathbb{E}_t[v_s] ds - \int^{T+\Delta}_{T} \mathbb{E}_{t-\delta}[v_s] ds)*d\delta $&lt;/p&gt;&#xA;" OwnerUserId="3440" LastActivityDate="2012-12-27T19:01:19.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4867" PostTypeId="1" AcceptedAnswerId="4869" CreationDate="2012-12-28T01:29:16.737" Score="3" ViewCount="2381" Body="&lt;p&gt;Currently we compute portfolio risk and return via our own C# program. Historical data is stored in a SQL database. We want to compute the risk and return parameters - &lt;strong&gt;given&lt;/strong&gt; a portfolio (i.e. not computing the efficient frontier). It's the R syntax that we're not familiar with (Vs the theory of computing the risk-return).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, how would one go about computing portfolio risk-return in R?&lt;/p&gt;&#xA;" OwnerUserId="3509" LastEditorUserId="3509" LastEditDate="2012-12-29T22:36:17.263" LastActivityDate="2012-12-30T05:18:12.097" Title="Determining portfolio risk return in R given historical data for individual holdings?" Tags="&lt;portfolio-management&gt;&lt;risk-management&gt;&lt;risk-models&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4868" PostTypeId="2" ParentId="4867" CreationDate="2012-12-28T05:27:42.310" Score="7" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Step 1: Get your data from SQL into R -&gt; &lt;a href=&quot;http://www.r-bloggers.com/?s=SQL&quot;&gt;http://www.r-bloggers.com/?s=SQL&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Step 2: Run your analysis/optimizations like -&gt; &lt;a href=&quot;http://www.r-bloggers.com/portfolio-optimization-in-r-part-1/&quot;&gt;http://www.r-bloggers.com/portfolio-optimization-in-r-part-1/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;or &lt;a href=&quot;http://blog.streeteye.com/blog/2012/01/portfolio-optimization-and-efficient-frontiers-in-r/&quot;&gt;http://blog.streeteye.com/blog/2012/01/portfolio-optimization-and-efficient-frontiers-in-r/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or via RMetrics: &lt;a href=&quot;http://www.statistik.wiso.uni-erlangen.de/lehre/bachelor/datenanalyse/Refcard3.pdf&quot;&gt;http://www.statistik.wiso.uni-erlangen.de/lehre/bachelor/datenanalyse/Refcard3.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It cannot get that much easier. You would have found those yourself faster on google than the time it took to post your question here. Plus there are a dozen duplicate questions you could have gotten similar information&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-12-28T05:27:42.310" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4869" PostTypeId="2" ParentId="4867" CreationDate="2012-12-28T10:11:01.393" Score="5" Body="&lt;p&gt;There are a lot of code in Eric Zivots recent class in computational finance. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://spark-public.s3.amazonaws.com/compfinance/R%20code/portfolio.r&quot; rel=&quot;nofollow&quot;&gt;http://spark-public.s3.amazonaws.com/compfinance/R%20code/portfolio.r&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://spark-public.s3.amazonaws.com/compfinance/R%20code/testport.r&quot; rel=&quot;nofollow&quot;&gt;http://spark-public.s3.amazonaws.com/compfinance/R%20code/testport.r&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://spark-public.s3.amazonaws.com/compfinance/R%20code/rollingPortfolios.r&quot; rel=&quot;nofollow&quot;&gt;http://spark-public.s3.amazonaws.com/compfinance/R%20code/rollingPortfolios.r&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Also, you can google some slides in his class where he provides a lot of examples:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://spark-public.s3.amazonaws.com/compfinance/Lecture%20Notes/PortfolioTheoryMatrixPowerpoint.pdf&quot; rel=&quot;nofollow&quot;&gt;http://spark-public.s3.amazonaws.com/compfinance/Lecture%20Notes/PortfolioTheoryMatrixPowerpoint.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sample Code:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Standard Deviation of Return series:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sd(x)  #where x = portfolio return series&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Rolling Analysis&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;rollapplyr(x,days,function) #rolling analysis given function&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Calculate Return&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;require(PerformanceAnalytics)    #heaps of functions for portfolio analytics&#xA;require(TTR)     #package with indicator functions&#xA;ROC(x,days)      #given equity series, get log return&#xA;ROC(x,days,type=&quot;discrete&quot;) #given equity series, get discrete return series&#xA;findDrawdowns(R) #find drawdown for time series&#xA;Return.annualized(R,n)   #R = return series, N = number of periods in year&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2318" LastEditorUserId="2318" LastEditDate="2012-12-30T05:18:12.097" LastActivityDate="2012-12-30T05:18:12.097" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4870" PostTypeId="1" CreationDate="2012-12-28T11:01:19.900" Score="3" ViewCount="212" Body="&lt;p&gt;Let's say I have an arbitrary set of $n$ period returns for $k$ assets, and a given $k \times k$ correlation matrix (of asset returns), which is known a priori. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does it makes sense, or is it even possible, to think about constructing some kind of measure of whether the set of $n$ returns is consistent with the known correlation matrix (or if they suggest some sort of outlier set)?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can we rank one set of $n \times k$ returns as being a better match to the given correlation matrix than another set?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does it make more sense to ask this if one assumes each asset has the same standard deviation of returns?&lt;/p&gt;&#xA;" OwnerUserId="3297" LastEditorUserId="35" LastEditDate="2012-12-28T14:00:07.507" LastActivityDate="2013-01-07T19:03:35.780" Title="How to see if a set of asset returns corresponds to a known correlation matrix?" Tags="&lt;statistics&gt;&lt;modern-portfolio-theory&gt;&lt;correlation-matrix&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4871" PostTypeId="1" CreationDate="2012-12-28T11:24:46.967" Score="3" ViewCount="1032" Body="&lt;p&gt;Let you have several issuers, and let each issuer have its yield curve built up with liquid plain vanilla fixed rate bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each yield curve has its slope and its curvature, and they obviously change over time (if the yield curve didn't change its shape over time, you would be able to predict with great accuracy the price variation of each bond which belongs to the yield curve).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let you have few bonds that (you think) will gain +1% during the next month, and you produce this forecast according to the yield curve assuming it won't change much its shape over the next month.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let your forecast is correct and let you have to choose just one of these bonds: they have different durations and convexity, but it's rational to choose the one with the smallest duration in order to minimize mark-to-market risk due to interest rates volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let your forecast is affected by estimation error: the main noise source here is the yield curve volatility, that is changing over time of its three principal components (level, slope and curvature according to literature).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I asked you to choose one of those bonds to gain +1% over the next month, you would probably answer me you have to consider:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the smallest duration&lt;/li&gt;&#xA;&lt;li&gt;the smallest yield curve level volatility&lt;/li&gt;&#xA;&lt;li&gt;the smallest yield curve slope volatility&lt;/li&gt;&#xA;&lt;li&gt;the smallest yield curve curvature volatility&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What a suitable criterion to consider all of these factors would be? That is: what a global to-be-minimized function would be?&lt;/p&gt;&#xA;" OwnerUserId="3058" LastEditorUserId="3058" LastEditDate="2012-12-28T12:53:47.043" LastActivityDate="2012-12-28T12:53:47.043" Title="Yield Curve Volatility" Tags="&lt;volatility&gt;&lt;interest-rates&gt;&lt;fixed-income&gt;&lt;yield-curve&gt;&lt;duration&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4873" PostTypeId="2" ParentId="4852" CreationDate="2012-12-28T13:37:31.083" Score="4" Body="&lt;p&gt;Have a look at the following two papers, one from Chris Rogers and Liang Zhang where they introduce a model using HMM which captures stylized facts of financial returns. And the second where we extended this model to risk measures. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Implementation in R is strait forward using ML as mentioned in the paper. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.statslab.cam.ac.uk/~chris/papers/UAR.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.statslab.cam.ac.uk/~chris/papers/UAR.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://arxiv.org/pdf/1212.4126.pdf&quot; rel=&quot;nofollow&quot;&gt;http://arxiv.org/pdf/1212.4126.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2608" LastActivityDate="2012-12-28T13:37:31.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4874" PostTypeId="2" ParentId="4870" CreationDate="2012-12-28T19:43:28.193" Score="0" Body="&lt;p&gt;One possibility would be to use a similarity based comparison between sets. There are simple geometric distance based measures that work well (euclidean distance is common).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've seen papers whereby the authors simply run a histogram of all of the correlations and compare to out of sample histograms to determine if the mean of correlations are statistically different or not (can use t-test or ANOVA for instance). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been trying to work on generating reliable synthetic multi-asset data (not so easy), so that I can run many such comparison experiments with some kind of confidence intervals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would think that comparison measures across different samples and local temporal stability is what ultimately matters.&lt;/p&gt;&#xA;" OwnerUserId="3040" LastEditorUserId="3040" LastEditDate="2012-12-28T20:11:45.563" LastActivityDate="2012-12-28T20:11:45.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4875" PostTypeId="1" CreationDate="2012-12-29T00:39:01.590" Score="-4" ViewCount="909" Body="&lt;p&gt;I read somewhere that derivatives are the biggest weapons of financial destruction. Why do we need derivatives? If exploiting risk-proneness of people to make profit is the goal, why don't we stop with stocks alone? Derivatives also entail complicated math for their pricing while stock prices are usually modelled as Brownian motion. Why do we go for such a dangerous complication? Is it possible to understand their necessity in simple terms?&lt;/p&gt;&#xA;" OwnerUserId="3511" LastActivityDate="2012-12-29T04:02:10.363" Title="Why do we need derivatives?" Tags="&lt;derivatives&gt;&lt;history&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2012-12-29T20:01:49.197" ContentLicense="CC BY-SA 3.0" />
  <row Id="4876" PostTypeId="2" ParentId="4875" CreationDate="2012-12-29T04:02:10.363" Score="5" Body="&lt;p&gt;One of the largest misconceptions of derivatives is that they destroy wealth.  In fact, derivatives cannot destroy wealth by their construction, rather, they merely &lt;em&gt;transfer&lt;/em&gt; wealth from one party to another.  This is because generally, derivatives are voluntary contracts between two parties, where one side's gain exactly matches the other's loss.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The utility of derivatives flows from their enabling investors to purchase insurance against adverse states of the world, or conversely, to allow investors the opportunity to earn a premium providing providing insurance to those who need it.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Part of what happened in the 2007-2008 financial crisis was certain financial institutions assumed the role of insurance providers, earning small premiums in exchange for bearing risk.  They took this practice to an &lt;em&gt;unsafe&lt;/em&gt; extreme as it seemed to generate large profits while times were good, at the same time creating risks far beyond what common sense would suggest.  When times turned bad, the losses some institutions faced were crippling, causing turmoil in financial markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That social malady was not caused by derivatives, but rather poor risk management.  Derivatives are simply financial technology, amazing tools when used appropriately, but are neither inherently good or bad.  The research which should have prevented the financial crisis goes back decades to when Harry Markowitz first introduced the mathematical formalization of diversification.  Even though it is obvious to most that one should not put all of their eggs in one basket, that does not mean everyone will act accordingly.&lt;/p&gt;&#xA;" OwnerUserId="3478" LastActivityDate="2012-12-29T04:02:10.363" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4877" PostTypeId="2" ParentId="4870" CreationDate="2012-12-29T04:20:04.790" Score="2" Body="&lt;p&gt;See &quot;Some hypothesis tests for the covariance matrix when the dimension is large compared to the sample size&quot; by Ledoit and Wolf.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://projecteuclid.org/DPubS?service=UI&amp;amp;version=1.0&amp;amp;verb=Display&amp;amp;handle=euclid.aos/1031689018&quot; rel=&quot;nofollow&quot;&gt;http://projecteuclid.org/DPubS?service=UI&amp;amp;version=1.0&amp;amp;verb=Display&amp;amp;handle=euclid.aos/1031689018&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3478" LastActivityDate="2012-12-29T04:20:04.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4878" PostTypeId="2" ParentId="226" CreationDate="2012-12-29T05:36:24.143" Score="5" Body="&lt;p&gt;Suppose X is a random variable representing the returns of an asset having finite mean $\mu$ and variance $\sigma^2&amp;gt;0$.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Variance $\sigma^2$ represents the expected squared deviation of $X$&#xA;from $\mu$.  Intuitively, this is a measure of how dispersed returns&#xA;are about the mean.  If returns are measured in $\%$, then the units&#xA;of variance are $\%^2$.  However, for many people $\%^2$ is difficult&#xA;to interpret.&lt;/li&gt;&#xA;&lt;li&gt;Volatility $\sigma$ is the square root of variance, and has units&#xA;$\%$. This change in units makes volatility more interpretable,&#xA;furthermore a better tool for analysis.  If we further assume $X$&#xA;follows a Gaussian distribution, then $\sigma$ provides many more&#xA;additional insights.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Volatility is a tool commonly used in univariate cases, e.g. when speaking of returns of one stock, one bond, or one portfolio.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the multivariate setting, variance is used, e.g. a covariance matrix, because taking the square root of a matrix is an unecessary additional layer of complexity.&lt;/p&gt;&#xA;" OwnerUserId="3478" LastActivityDate="2012-12-29T05:36:24.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4879" PostTypeId="2" ParentId="103" CreationDate="2012-12-29T09:51:33.440" Score="9" Body="&lt;p&gt;A market is said to be &lt;em&gt;complete&lt;/em&gt; if any contingent claim can be replicated by an admissible (i.e. with value process bounded from below) self-financing (i.e. all gains and losses exactly offset each other) trading strategy, a so-called &lt;em&gt;replicating strategy&lt;/em&gt;. This strategy being constructed from primary securities - the market prices of which are unique - it must be that its price is identical to everyone, and the strategy is therefore independent of any assumptions on risk aversion. Any discrepancy between the replicating strategy's price and its underlying primary securities would be wiped out by arbitrage trades by market participants, &lt;strong&gt;&lt;em&gt;regardless of their risk preferences&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, suppose you want to price a contingent claim, e.g. a European option on an equity security. Assuming the market is complete, the payoff of this security can be perfectly replicated using existing securities. Again, by the same arguments as above, the market price of the option and of the replicating strategy must be exactly the same under a no-arbitrage condition, &lt;strong&gt;&lt;em&gt;regardless of risk preferences&lt;/em&gt;&lt;/strong&gt;. Therefore, neither a positive nor a negative risk premium can be embedded into the equilibrium market price of the option, or equivalently of the replicating strategy (actually, a sort of &quot;aggregate&quot; risk premium is already included in the prices of the replicating strategy's primary securities, but no further risk premium is added when pricing the contingent claim).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have shown that if the market has no arbitrage opportunities and is complete, then it must be that the option's market price is exactly equal to that of the replicating strategy, and that this price is in fact unique. This is essentially what the (Second) Fundamental Theorem of Asset Pricing (FTAP) says. Since the replicating strategy does not depend on any assumptions concerning risk preferences, it does not matter what assumptions are made on the risk preferences of the market participants. Therefore, the price in the real-world market (where risk-averse, risk-neutral and risk-seeking participants meet) must equal that in a risk-neutral market. Since it is much more convenient (and mathematically powerful, e.g. martingale theory) to work in a risk-neutral world, this is the standard pricing approach used in mathematical finance.&lt;/p&gt;&#xA;" OwnerUserId="2165" LastActivityDate="2012-12-29T09:51:33.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4881" PostTypeId="2" ParentId="647" CreationDate="2012-12-29T10:15:04.197" Score="0" Body="&lt;p&gt;MATLAB has a trading and backtesting toolbox which offers similar functionality to other retail trading packages. &lt;a href=&quot;http://www.tadeveloper.com&quot; rel=&quot;nofollow&quot;&gt;http://www.tadeveloper.com&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3516" LastActivityDate="2012-12-29T10:15:04.197" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4882" PostTypeId="1" AcceptedAnswerId="4884" CreationDate="2012-12-29T13:20:21.790" Score="4" ViewCount="448" Body="&lt;p&gt;Why is it so popular to use market capitalization weighted indices instead of taking the first principle component that explains the most variation of the constituents? I haven't yet seen an academic study that does the latter. What's the reason for this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the correct answer varies based on application then feel free to address the question on a case by case basis.&lt;/p&gt;&#xA;" OwnerUserId="3174" LastActivityDate="2012-12-30T02:43:30.920" Title="Why use market capitalization weighted index over PCA?" Tags="&lt;factor-models&gt;&lt;index&gt;&lt;pca&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4883" PostTypeId="2" ParentId="4846" CreationDate="2012-12-29T13:39:36.057" Score="0" Body="&lt;p&gt;If you trade on the US equity market, one option is to subscribe right to the &lt;a href=&quot;http://nysetechnologies.nyx.com/en/global-market-data/data-products/&quot; rel=&quot;nofollow&quot; title=&quot;market data services&quot;&gt;market data services&lt;/a&gt; of NYSE Euronext.&lt;/p&gt;&#xA;" OwnerUserId="2220" LastActivityDate="2012-12-29T13:39:36.057" CommentCount="0" CommunityOwnedDate="2014-06-30T15:32:03.123" ContentLicense="CC BY-SA 3.0" />
  <row Id="4884" PostTypeId="2" ParentId="4882" CreationDate="2012-12-29T15:13:21.427" Score="5" Body="&lt;p&gt;a) because it does not matter how you weigh each constituents as long as the methodology is publicly accessible and as long as it more or less reflects the original intent. That is why there are market cap weighted indexes but also why there are indexes that apply different weighting methodologies. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) because PCA is computationally way more expensive. Why would you chose to do things the most complicated way if results can be had more efficiently. The point with such indexes is not to derive the most accurate results in terms of attribution but to set a standard on which options can be written, portfolios bench-marked against, and relative performance evaluated. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-12-29T15:13:21.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4885" PostTypeId="2" ParentId="4882" CreationDate="2012-12-30T02:43:30.920" Score="5" Body="&lt;p&gt;The first principal component of a large covariance matrix is &lt;em&gt;extremely&lt;/em&gt; expensive to replicate in a real portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While it is true principal components provide true (ex post) orthogonal factors, this is not necessarily relevant to the business of risk management.  The market index is what most investors are benchmarked by, and is furthermore often available to trade through cheap technology like futures, swaps, or ETFs.&lt;/p&gt;&#xA;" OwnerUserId="3478" LastActivityDate="2012-12-30T02:43:30.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4886" PostTypeId="1" CreationDate="2012-12-30T05:17:12.137" Score="15" ViewCount="14915" Body="&lt;p&gt;Simple question - what would be the fastest algorithm for calculating retrospective maximum drawdown ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've found &lt;a href=&quot;http://forumserver.twoplustwo.com/47/science-math-philosophy/mathematical-definition-algorithm-drawdown-47752/&quot;&gt;some interesting talks&lt;/a&gt; but I was wondering what people thought of this question here.&lt;/p&gt;&#xA;" OwnerUserId="2600" LastEditorUserId="2600" LastEditDate="2012-12-30T15:26:05.513" LastActivityDate="2019-04-10T16:38:59.533" Title="Fastest algorithm for calculating retrospective maximum drawdown" Tags="&lt;algorithm&gt;&lt;drawdown&gt;&lt;maximum-drawdown&gt;" AnswerCount="8" CommentCount="4" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="4887" PostTypeId="2" ParentId="4886" CreationDate="2012-12-30T13:09:45.840" Score="8" Body="&lt;p&gt;I won't give you the answer delivered on a silver platter but hopefully the following will get your started:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) you need to define exactly over which look-back period you aim to derive the maximum drawdown.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) you need to keep track of the max price while you iterate the look-back window. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;c) you need to keep track of the min price SUBSEQUENT to any NEW max, thus each time you make a new max you need to reset the max low to zero (relatively speaking as a divergence from the max value)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;this should get you pretty easily to where you want to get without having to iterate the time series more than once. I disagree that a vectorized approach will solve this problem (@Pat, please provide an answer if you disagree I would be curious how you would approach this in a vectorized manner because the algorithm here is path-dependent).&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2012-12-30T13:09:45.840" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4888" PostTypeId="2" ParentId="4886" CreationDate="2012-12-30T15:24:11.103" Score="1" Body="&lt;p&gt;(After the clarification, this answer is no longer relevant)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Expected maximum drawdown is going to be highly sensitive to your choice of SDE, and to your calibration of it.  Therefore you should play with a variety of parameterizations to estimate your model error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far as efficient computation goes, we can regard this as a payoff very similar to a lookback option (much as in the PDF you linked).  As with lookback options, the first instinct is to price them using Monte Carlo techniques, but one can actually do so much more quickly using a multi-level PDE solver, at least for sufficiently simple SDEs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way a 2-level PDE solver works for a payoff like this is that, rather than having a grid of $(S,t)$ values on which you run your difference equations and boundary conditions, you have a grid of $( \{M,S\}, t )$ values, where $M$ represents the maximum achieved so far.  Obviously there are some new boundary conditions that go with it, for example that $\frac{\partial M}{\partial S}=1$ at and above the line $S=M$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Differencing and updating on this grid, you ultimately end up with a value $V_{0,0}$ corresponding to today's maximum $M_0$ and stock price $S_0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See section 5.3.2 of &lt;a href=&quot;http://www.math.nus.edu.sg/~matdm/ma4257/chapter5.pdf&quot; rel=&quot;nofollow&quot;&gt;this pdf&lt;/a&gt; for how it works with lookbacks.  Max drawdowns will be very similar.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2012-12-30T15:29:50.537" LastActivityDate="2012-12-30T15:29:50.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4889" PostTypeId="1" CreationDate="2012-12-31T04:12:28.487" Score="4" ViewCount="1357" Body="&lt;p&gt;I am testing various optimization methods for a currency-only portfolio. I have a vector of expected returns for the major developed currencies vs. the USD each week (based on a proprietary model). I then take the annualized vol of each currency and dump it all into an optimizer, looking to run a portfolio of currency bets that maximize my return for a given level of risk. I have multiple issues and would appreciate any insights:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Firstly, the forecast model will sometimes generate across-the-board short positions in all currencies in my model against the USD. Since currencies are a relative value game, how do I incorporate exposure to the USD in the optimizer? Should the expected returns and the vol on the USD simply be an unweighted inverse average of all the other currencies? Also, since I cannot be net long or short the currency market, do I impose the constraint that the weights must sum to zero? Am I even thinking about this problem correctly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly, when I do the above, the weights swing dramatically and often assign positive weights when the model of expected returns is indicating a short (and vice versa). It's typically happens for positions with a low expected return and one could argue these are hedging positions. Is the ideal solution here to impose a constraint that the sign of the weight needs to match the sign of the expected returns?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively should I try Black Litterman? What are the market equilibrium returns for currencies?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or should I drop the vector of expected returns from the optimizer, use it to simply generate long-short positions, and then simply run the optimizer to minimize my risk?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Appreciate any suggestions&lt;/p&gt;&#xA;" OwnerUserId="3521" LastEditorUserId="35" LastEditDate="2012-12-31T14:18:17.380" LastActivityDate="2013-01-04T20:38:47.130" Title="Optimizing a currency only portfolio with negative weights" Tags="&lt;portfolio-management&gt;&lt;optimization&gt;&lt;currency&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4890" PostTypeId="2" ParentId="4889" CreationDate="2012-12-31T05:30:45.213" Score="2" Body="&lt;p&gt;A partial answer…&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Black-Litterman, an equilibrium no arbitrage condition such as interest rate parity suggests investors would be indifferent between investing in either the foreign or domestic currency. Thus, you could use a constant zero return for all currencies in your opportunity set as the equilibrium model.  What this ultimately would do is act like a shrinkage estimator for your active views on the currency markets. This could actually improve the performance of your forecasts measurably.&lt;/p&gt;&#xA;" OwnerUserId="3478" LastActivityDate="2012-12-31T05:30:45.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4891" PostTypeId="1" CreationDate="2012-12-31T07:37:24.587" Score="1" ViewCount="613" Body="&lt;p&gt;I have two related questions concerning Black Scholes and delta hedging. I thought about this two questions, but I could not come up with an answer, so maybe you guys &amp;amp; girls can help me:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;If an option is at the money, how can the Black Scholes price be calculated in a very fast way (possibly without any big calculations)?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If an option is at the money, how many shares do you have to buy in order to delta-hedge?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3298" LastEditorUserId="848" LastEditDate="2012-12-31T11:12:51.707" LastActivityDate="2012-12-31T12:28:37.623" Title="BS and delta hedging questions" Tags="&lt;black-scholes&gt;&lt;hedging&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4893" PostTypeId="2" ParentId="4891" CreationDate="2012-12-31T08:22:27.093" Score="3" Body="&lt;ol&gt;&#xA;&lt;li&gt;See &lt;a href=&quot;https://quant.stackexchange.com/questions/1150/what-are-some-useful-approximations-to-the-black-scholes-formula&quot;&gt;this question&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;You have to buy/sell $\Delta$ shares. $\Delta_{ATM} \approx 0.5$.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1217" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2012-12-31T08:22:27.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4894" PostTypeId="2" ParentId="4891" CreationDate="2012-12-31T09:46:27.740" Score="3" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;stock price * volatility * 0.4 * sqt(T), where T denotes time to expiration in years and 0.4 is coming from sqt(1/(2*pi)). The simplifying assumption here is (and that is very important and you will most likely be asked to state the assumptions should such question be asked in the interview): strike price equals underlying asset price AND asset prices are NORMALLY DISTRIBUTED (unlike the assumption in B-S) which assumes the asset price to follow an ARITHMETIC Brownian motion. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;As the delta is approximately (stress, not equal) 0.5, you need to hedge with about 1/2 the amount of the underlying asset that the options contract stipulates.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2012-12-31T12:28:37.623" LastActivityDate="2012-12-31T12:28:37.623" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="4895" PostTypeId="2" ParentId="4889" CreationDate="2012-12-31T10:03:40.607" Score="2" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;first of all, there is nothing wrong in a currency-only portfolio to be dollar long and short the cross currencies. If that is what your model predicts and if you have a high confidence in the predictions and standard error being low then why do you have issues being dollar long and short the other currencies?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can implement boundary conditions, such as a maximum exposure per currency, so I do not see anything wrong with optimizing expected risk-adjusted return. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Of course you can be net long or short any of the currencies you trade in your portfolio, hence there is no logical reason why the weights have to sum to zero. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I assume you make mistakes in your optimization. I do not see a way how your expected returns can be negative but the recommended weight is positive for a given currency. your expected returns are inputs to the optimization, the weight the output, if they are not of equal sign then you are doing something wrong. But beware, if the expected returns are on fx pairs and not on the currencies themselves then it could happen that you get an expected return of -1% for USD/JPY, 2% for USD/EUR, and 1% for GBP/JPY, given those are the only currencies you trade. Then your optimization will most likely assign a positive weight to USD/JPY (if you do the optimization right) because the net expected return in USD alone is positive and the net expected return in JPY alone is negative (this is all under a lot of simplifying assumptions...)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Think about this and if this does not resolve most of your questions please elaborate, happy to help...&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-01-02T03:20:57.157" LastActivityDate="2013-01-02T03:20:57.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4900" PostTypeId="2" ParentId="3041" CreationDate="2013-01-02T11:38:43.837" Score="4" Body="&lt;p&gt;Haim Bodek worked for Goldman and UBS and then had his own trading firm. He has started Consulting on HFT strategies and has been mentioned in Dark Pools by Scott Patterson. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some of his white papers are on: &lt;a href=&quot;http://haimbodek.com/research.html&quot; rel=&quot;nofollow&quot;&gt;http://haimbodek.com/research.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Check out the introduction to the '0+' strategy. As a previous answer stated, no one will give away a winning strategy. &lt;/p&gt;&#xA;" OwnerUserId="3461" LastActivityDate="2013-01-02T11:38:43.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4902" PostTypeId="2" ParentId="4804" CreationDate="2013-01-03T14:35:59.623" Score="1" Body="&lt;p&gt;I've used the &lt;a href=&quot;http://www-stat.stanford.edu/~tibs/glasso/index.html&quot; rel=&quot;nofollow&quot;&gt;graphical lasso&lt;/a&gt; for exactly this kind of thing in the past. You can control the degree of shrinkage, which determines the how tight the clusters become. &lt;/p&gt;&#xA;" OwnerUserId="356" LastEditorUserId="848" LastEditDate="2013-01-03T16:23:40.733" LastActivityDate="2013-01-03T16:23:40.733" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4906" PostTypeId="2" ParentId="4870" CreationDate="2013-01-04T08:45:26.533" Score="0" Body="&lt;p&gt;First, creating a covar matrix from a set of series of unequal lengths is non-trivial and several approaches (eg: one factor or two factor models) will yield different covar matrices. I do see that you said all asset classes have same length (n periods) meaning the above won't apply, but I thought I'd still say this because unless you cherry pick &lt;strong&gt;&lt;em&gt;n&lt;/em&gt;&lt;/strong&gt; while working with many assets, most likely you will run into assets with have unequal time series (eg: some company started recently). The point is you need to be consistent about your covar calc technique especially if the covar comes from different sources.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another warning when fitting returns to covar matrices; I wouldn't advise it since you can have inconsistent results if you use observed returns with a &quot;given&quot; covar matrix for portfolio construction. Returns are observed 'facts' and the covar matrix embodies the relationships, so to avoid inconsistent portfolio results it's best to compute the covar from the raw result info (and always do so with the same technique)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With that out of the way, lets explore measures of &quot;degree of match&quot;. Lets define:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;C = computed covar matrix (from your return series) and &lt;/li&gt;&#xA;&lt;li&gt;C' = given covar matrix that you got from 'somewhere' that you're trying to see if it &quot;fits&quot;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Different measures:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Principle component analysis. Basically determine the eigenvectors and eigenvalues for the COVAR matrix (there will be N of each for an NxN covar matrix). The largest eigenvalues tell you the eigenvectors (or principle components) that capture the strongest 'features' of the COVAR matrix. &lt;a href=&quot;https://www.riskprep.com/all-tutorials/36-exam-22/123-eigenvectors-eigenvalues-and-orthogonality&quot; rel=&quot;nofollow&quot;&gt;An introduction to eigenvectors/values&lt;/a&gt;. You then compare them in C vs C' to see if the features have changed. If changed, the returns likely do NOT correspond to your 'given COVAR' matrix. Comparison details for C and C': &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Find the largest eigenvalue of C =&gt; pick corresponding eigenvector&lt;/li&gt;&#xA;&lt;li&gt;Find the largest eigenvalue of C' =&gt; pick corresponding eigenvector&lt;/li&gt;&#xA;&lt;li&gt;$\theta$ is angle between those two vectors. &lt;/li&gt;&#xA;&lt;li&gt;Absolute value of $\theta$ less than 2-4 degrees =&gt; C and C' are similar (&quot;2-4&quot; depends on asset volatility and time period). &lt;/li&gt;&#xA;&lt;li&gt;If &quot;no change&quot; then the returns likely represent the &quot;given&quot; CoVAR (and vice versa)&lt;/li&gt;&#xA;&lt;li&gt;You can tighten the checks by doing the above for not just the largest but also for the smaller components (higher order components) by then checking the 2nd largest, then 3rd largest and so on. If iterate over all N eigenvectors, then you have checked all N dimensions, progressively going from the strongest dimension (at iteration #1) to the weakest dimension (in iteration N).&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;|C - C'| is a decent choice. Although it's simple, there is no direct physical significance to it because it nets too many individual covars; you are essentially collapsing N dimensions into a single scalar quantity with no prioritization of &quot;strong features&quot; (like above)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Another decent heuristic would be signs and magnitudes of elements within the C-C' matrix. i.e.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;best = have C-C' as zero i.e. identical covars (duh! :) )&lt;/li&gt;&#xA;&lt;li&gt;ok-to-good = &lt;em&gt;all&lt;/em&gt; elements of C-C' are either slightly positive (incl 0) or all slightly negative (incl 0). The actual sign (+/-) is unimportant as compared to the &lt;em&gt;consistency&lt;/em&gt; of the signs.&lt;/li&gt;&#xA;&lt;li&gt;bad-to-worst  = large absolute values with 1/2 positives and 1/2 negatives &lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Note that C-C' is a &lt;em&gt;relative&lt;/em&gt; measure, so you will need to define your own min-max bounds and then your own intervals for &quot;almost no change&quot;. Easiest to do so is look at historical min-max's and adjust them for forward looking (and like every forward looking projection in quant finance, it's art+science). For no change, look at recent times when you recall things being ok in your portfolio and use those values.&lt;/p&gt;&#xA;" OwnerUserId="3509" LastEditorUserId="3509" LastEditDate="2013-01-07T19:03:35.780" LastActivityDate="2013-01-07T19:03:35.780" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4907" PostTypeId="2" ParentId="857" CreationDate="2013-01-04T09:03:10.307" Score="2" Body="&lt;p&gt;You still want to perform portfolio optimization. Put everything into one bucket, run 'global' portfolio optimization, build the portfolio. Even if you prefer Sharpe ratios, you should do that on the overall portfolio - not just on individual ones. Be careful of sharpe ratios for low risk, low return assets. Dividing one small number by another small number can sometimes give you a giant number and you can't always lever that up as you please (you hit the friction of overleverage =&gt; higher borrowing rate)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if you &lt;em&gt;must&lt;/em&gt; pick only one over the other (I'm assuming you've questioned why this limitation applies to you), then you should run a monte carlo simulation or perform some back testing of both portfolios. In a temporal way, the world is similar (same management, similar human attributes etc) but not exact (tech bust won't be &lt;em&gt;exactly&lt;/em&gt; played out next time). Therefore I prefer Monte Carlo (using historical distributions from which to draw simulation outcomes) over straight up back testing (&quot;In 2001, this portfolio would have looked like ...&quot;)&lt;/p&gt;&#xA;" OwnerUserId="3509" LastEditorUserId="3509" LastEditDate="2013-01-05T02:05:13.540" LastActivityDate="2013-01-05T02:05:13.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4909" PostTypeId="1" AcceptedAnswerId="4910" CreationDate="2013-01-04T15:18:13.313" Score="3" ViewCount="1708" Body="&lt;p&gt;When working with risky bonds, i.e. corporate bonds, what is usually defined as the yield of such a bond? Is it the yield calculated as if the bond was riskless, or is it calculated by properly taking into account the default risk in this case? And what about (risky and riskless) floating rate notes?&lt;/p&gt;&#xA;" OwnerUserId="1810" LastActivityDate="2013-01-07T09:07:23.033" Title="Yield of a risky bond" Tags="&lt;bond&gt;" AnswerCount="4" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4910" PostTypeId="2" ParentId="4909" CreationDate="2013-01-04T15:53:26.670" Score="6" Body="&lt;p&gt;As John already mentioned the formula for calculating yield to maturity is independent of any risk-related numbers. Its just the connection between coupons, time and price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In theory, default-risk can be seen as already incorporated in the yield. The &lt;em&gt;yield spread&lt;/em&gt; between the bond and a comparable investment without default risk is a measure for the default risk premium. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For FRNs there is no way to compute a yield since coupon payments are unknown. You can only estimate the price/yield by forecasting the interest rates at the coupon dates. But the notion of yield is the same - one just estimates the coupons first.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastEditorUserId="2727" LastEditDate="2013-01-07T09:07:23.033" LastActivityDate="2013-01-07T09:07:23.033" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4911" PostTypeId="2" ParentId="4909" CreationDate="2013-01-04T15:58:14.523" Score="0" Body="&lt;p&gt;No matter what is the risk profile of the issuer the yield is computed as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;yield =   Gross (pre-tax) coupon x 100&#xA;          ---------------------------&#xA;               Price in market&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Price a bond can be found using one of short rate models. e.g Black Derman and Toy (BDT). One of the papers &lt;a href=&quot;http://www2.math.uu.se/research/pub/NaveedNazir1.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; talks about how a single stochastic factor model can be used. Once the bond is priced the yeild is backed out from it not the other way round.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;HTH&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&lt;strong&gt;&lt;/em&gt;**&lt;em&gt;*&lt;/em&gt;**&lt;em&gt;*&lt;/em&gt;**&lt;em&gt;*&lt;/em&gt;**&lt;em&gt;*&lt;/em&gt;*&lt;/strong&gt;&lt;em&gt;EDITED &lt;strong&gt;&lt;/em&gt;**&lt;em&gt;*&lt;/em&gt;**&lt;em&gt;*&lt;/em&gt;**&lt;em&gt;*&lt;/em&gt;**&lt;em&gt;*&lt;/em&gt;***&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reading the questions again I agree with Freddy.&#xA;The risky bond is a risky loan and yield on that is higher to compensate for risk premium. So I think in context of question Freddy response is correct. Now I am researching how to mathematically quantity that risky bonds carry this risk premium in their yield. Cheers Freddy I did not get the question right in first instance . &lt;/p&gt;&#xA;" OwnerUserId="1386" LastEditorUserId="1386" LastEditDate="2013-01-05T19:16:19.743" LastActivityDate="2013-01-05T19:16:19.743" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="4912" PostTypeId="2" ParentId="4886" CreationDate="2013-01-04T16:44:37.313" Score="3" Body="&lt;p&gt;Zipline, the opensource python backtester, has a batch and iterative implementation for max drawdown. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the batch: &lt;a href=&quot;https://github.com/quantopian/zipline/blob/master/zipline/finance/risk.py#L284&quot; rel=&quot;nofollow&quot;&gt;https://github.com/quantopian/zipline/blob/master/zipline/finance/risk.py#L284&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the iterative:&#xA;&lt;a href=&quot;https://github.com/quantopian/zipline/blob/master/zipline/finance/risk.py#L578&quot; rel=&quot;nofollow&quot;&gt;https://github.com/quantopian/zipline/blob/master/zipline/finance/risk.py#L578&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;disclosure: I'm one of the zipline maintainers&lt;/p&gt;&#xA;" OwnerUserId="799" LastActivityDate="2013-01-04T16:44:37.313" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4913" PostTypeId="2" ParentId="4889" CreationDate="2013-01-04T20:38:47.130" Score="0" Body="&lt;p&gt;I agree with much of what Freddy has said, but I just want to flesh out some issues with regards to multi-currency portfolio optimization. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I find it helpful to think in terms of one currency, the currency that your investor is evaluating you based on. In your case, this would be U.S. dollars. &lt;/li&gt;&#xA;&lt;li&gt;The general approach to portfolio optimization is to first forecast the distribution of your invariants/risk factors to the horizon and then to convert them into prices at the horizon. For your application, the invariants would be log changes in currencies AND the interest rates you would receive by borrowing or lending in those currencies (you may need to incorporate different borrowing or lending rates, but for the sake of simplicity we can assume them to be equal).  You would then need to convert the currency/interest rate distributions at the horizon into positions that represent the return at the horizon in dollars of changing dollars to foreign currency today, earning the foreign interest rate, and then changing back to dollars at the horizon. Similarly, investing in U.S. dollars would avoid the currency component, but maintain the domestic interest rate. You would then consider these to be your universe, find the mean and covariance matrix, and optimize as appropriate (avoiding leverage would require weights to sum to 1, i.e. you either invest in the U.S. asset or convert dollars to foreign assets). This approach can also easily be adapted to forward currency contracts. &lt;/li&gt;&#xA;&lt;li&gt;The above discussion primarily focused on simple currency allocation, but it is a useful framework for international equity and bond portfolio optimization as well. The investor would convert dollars to equities/bonds in foreign currency and then convert back to dollars at the horizon. One major difficulty is when the investor wishes to hedge their foreign currency exposure. The problem is that the foreign currency exposure is different in every time period (it grows or shrinks as the underlying asset grows or shrinks). So you have some options for how to handle this in practice. Perhaps the simplest is a two-step approach to find the optimal portfolio excluding the hedge and then put on the hedge in a second step given the optimal portfolio. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2013-01-04T20:38:47.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4914" PostTypeId="1" CreationDate="2013-01-04T22:18:42.533" Score="3" ViewCount="262" Body="&lt;p&gt;I found this comment in a book I bought about risk management: &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470019131&quot; rel=&quot;nofollow&quot;&gt;Risk Management in Banking&lt;/a&gt; by Joel Bessis.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This is the well-known rule that states that the sum of individual&#xA;  risks is less than the risk of the sum, or, that risks should be&#xA;  sub-additive. Risks do not add up algebraically because of&#xA;  diversification.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Doesn't he really mean the opposite, namely that the &lt;strong&gt;risk of the sum is less than the sum of the individuals&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \rho(A+B) \leq \rho(A) + \rho(B) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or is his wording just odd?&lt;/p&gt;&#xA;" OwnerUserId="3544" LastEditorUserId="467" LastEditDate="2013-01-04T22:28:32.873" LastActivityDate="2013-01-04T22:37:48.830" Title="Is this comment right about subadditivity?" Tags="&lt;risk&gt;&lt;diversification&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4915" PostTypeId="2" ParentId="4914" CreationDate="2013-01-04T22:37:48.830" Score="3" Body="&lt;p&gt;You're right, I &lt;em&gt;hope&lt;/em&gt; he meant exactly the opposite, and the formula you provided is indeed part of the definition of a &lt;a href=&quot;http://en.wikipedia.org/wiki/Coherent_risk_measure&quot; rel=&quot;nofollow&quot;&gt;coherent risk measure&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, I would say that &lt;em&gt;the risk of the sum is less than &lt;strong&gt;or equal&lt;/strong&gt; to the sum of the individuals&lt;/em&gt; as in some cases you would like your model to accept no diversification effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As John mentioned in his comment, Value at Risk typically is not coherent, just as Volatility, but other measures such as the Expected Shortfall are.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2013-01-04T22:37:48.830" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4916" PostTypeId="2" ParentId="4909" CreationDate="2013-01-05T03:00:25.277" Score="3" Body="&lt;p&gt;Despite seeing one of the answers as having been chosen as the desired one, I like to offer a different perspective:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whether the yield to maturity can be derived from a bond's price in a rather identical fashion, regardless of the inherent risks is, imho, not the point of the OP, given I understood the question correctly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The yield of a bond with risk components can be seen as an &quot;internal rate of return&quot;, basically a discount rate at which future cash flows need to be discounted at in order to arrive at the current market price (fair price?) of the bond. Therefore, the discount rate or ytm very much incorporates each and every perceived risk inherent in the bond because the bond price also reflects each and every risk notion investors perceive. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As some users pointed out the yield to maturity is a rather straight forward translation of bond prices. I think the much more useful approach is to start with the yield to maturity (or total internal risk of return), then strip off the risk premiums, in order to arrive at isolated risk attributional factors. This, I think is how many rating agencies approach corporate bond valuations and the derivative of that, CDS valuation of which an important input is the default probabilities (of course they use additional models on top of that to model CDS, most of the time copula probability-of-default related models).&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-01-07T08:41:52.390" LastActivityDate="2013-01-07T08:41:52.390" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4918" PostTypeId="1" CreationDate="2013-01-05T08:11:38.647" Score="4" ViewCount="1340" Body="&lt;p&gt;I am working on Rubinsteins IBT and use the following paper to implement this into excel:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=541744&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=541744&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;the original paper can be found here:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.haas.berkeley.edu/groups/finance/WP/rpf232.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.haas.berkeley.edu/groups/finance/WP/rpf232.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;I am stuck in the last step: I calculated the path probabilities, denoted by &amp;quot;Q&amp;quot;. In the paper &amp;quot;Implied Binomial Trees in Excel without VBA&amp;quot; page 7 and 17.&lt;/p&gt;&#xA;&lt;p&gt;So I have now the results of Panel B on page 17. These are the Q at the last node, now I calculate the Q at the nodes before with &lt;span class=&quot;math-container&quot;&gt;$Q=Q^+ + Q^-$&lt;/span&gt;. So I have the resulting path probabilities Q shown in the uploaded and attached picture (the numbers are a bit different from the paper, because my excel solver was not that accurate, but the numbers should be the same).&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/xOJNP.png&quot; alt=&quot;implied binomialtree&quot; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;So now I want to calculate the &amp;quot;R&amp;quot;. These are the cumulative returns. In the paper it says on page 7: &lt;span class=&quot;math-container&quot;&gt;$R=(qR^+ + (1-q)R^-)/r$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I know that the small qs are the up probabilities, calculated by &lt;span class=&quot;math-container&quot;&gt;$q=Q^+/Q$&lt;/span&gt;. Ok, the small r is a discounting factor, ok. But what are the &lt;span class=&quot;math-container&quot;&gt;$R^+$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$R^-$&lt;/span&gt;. Where do I get them? Are these just the original prices form the CRR binomial tree?&lt;/p&gt;&#xA;&lt;p&gt;Thanks a lot!&lt;/p&gt;&#xA;&lt;p&gt;(in the excel file which can be downloaded, this step is not implemented)&lt;/p&gt;&#xA;&lt;p&gt;edit:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;It should be in the paper, though, for example &amp;quot;a 20% growth in the underlying gives R = 1.20&amp;quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;My underlying, values u and d calculated by CRR? So the values of the underlying are:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/ptYSl.png&quot; alt=&quot;underlying asset, values calculated by CRR&quot; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;@ Freddy Could you please use my example and do an example calculation? The comment is to general and not specific enough....&lt;/p&gt;&#xA;" OwnerUserId="3298" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2013-01-06T09:44:30.700" Title="Rubinsteins Implied Binomial Tree - how to calculate the cumulative returns" Tags="&lt;binomial-tree&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4919" PostTypeId="2" ParentId="723" CreationDate="2013-01-05T09:52:05.507" Score="6" Body="&lt;p&gt;If you assume that you do not have any market risk (a strange assumption, but it would hold for example if you are fully hedged), then a (correctly) collaterlized derivative does not have any &lt;strong&gt;net&lt;/strong&gt; future cash flow. Clearly: if the derivative contract has a cash flow of -X, its value will go down by X and the collateral account will have a cash flow of +X (the corresponding collateral will be returned).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there is no future cash flow, there is no discounting (in the sense of funding costs). However there is a new question now: what is the correct amount of collateral C we should post in t=0 to collaterlize the cash flow in t=T?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since collateral is accrued according to the collateral contract by the OIS rate we would like to have that the &lt;strong&gt;accrued&lt;/strong&gt; collateral account matches the cash-flow, that is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;C * (1 + r * T) = X&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where r is the OIS rate. That is we determine the collateral by OIS discounting&lt;/p&gt;&#xA;&#xA;&lt;p&gt;C = X / (1 + r * T).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OIS discounting is the way to determine the amount of collateral we have to post.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(You can make this argument mathematically correct (under some general assumptions) and show that collateralization is like having a different currency which has its own interest rate, I have some stuff on this (paper, spreadsheet for OIS bootstrapping, source code) here: &lt;a href=&quot;http://www.finmath.net/spreadsheets/curvecalibration/&quot; rel=&quot;noreferrer&quot;&gt;http://www.finmath.net/spreadsheets/curvecalibration/&lt;/a&gt; )&lt;/p&gt;&#xA;" OwnerUserId="3548" LastActivityDate="2013-01-05T09:52:05.507" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4920" PostTypeId="2" ParentId="2982" CreationDate="2013-01-05T16:37:42.067" Score="10" Body="&lt;p&gt;Assume you have an USD-EUR Cross Currency Swap (3M-FloatUSD+SpreadUSD vs 3M-FloatEUR+SpreadEUR) (spread on USD side is usually zero), collateralized by USD-OIS (Fed Fund)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume you know the USD-OIS discount curve, then you know the discount curve for USD cash flows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I further assume that you know the USD-3M forwards collateralized w.r.t. USD-OIS (from corresponding single-currency swaps).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the cross currency swap has still two unknowns:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the discount curve for EUR cash flows collateralized w.r.t. USD-OIS&lt;/li&gt;&#xA;&lt;li&gt;the forward of the EUR-3M index collateralized w.r.t. USD-OIS&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;It is important to understand that the forward of an index may depend on its collateralization.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In theory you can determine both from&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a) the cross currency swap quotes and&lt;/li&gt;&#xA;&lt;li&gt;b) a single currency EUR swap, collateralized in USD-OIS&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Usually you do not have a quote for the second instrument, but sometimes you have, e.g. if an USD institution trades EUR swaps with another USD institution and collateralizes this in USD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do not have instrument b) you can use some approximating assumption, e.g.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the EUR-3M forward w.r.t. to USD-OIS collateral is approximated by the EUR-3M forward w.r.t. EUR-OIS collateralization, or, &lt;/li&gt;&#xA;&lt;li&gt;the EUR-3M market rate w.r.t. to USD-OIS collateral is approximated by the EUR-3M market rate w.r.t. EUR-OIS collateralization.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The different assumptions will lead to slightly different results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Remark: For curve calibration (bootstrapping) implementing both ways see &lt;a href=&quot;http://www.finmath.net/topics/curvecalibration/&quot;&gt;http://www.finmath.net/topics/curvecalibration/&lt;/a&gt; - the spreadsheet there depicts the difference between the two approximations).&lt;/p&gt;&#xA;" OwnerUserId="3548" LastEditorUserId="3548" LastEditDate="2013-03-02T20:02:39.650" LastActivityDate="2013-03-02T20:02:39.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4921" PostTypeId="2" ParentId="4918" CreationDate="2013-01-05T17:20:04.723" Score="1" Body="&lt;p&gt;R denotes the implied risk-neutral cumulative growth which is different for each note. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You get them through: 1 + cumulative risk-neutral return through the tree to a particular node. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It should be in the paper, though, for example &quot;a 20% growth in the underlying gives R = 1.20&quot;&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-01-05T17:20:04.723" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4922" PostTypeId="2" ParentId="4909" CreationDate="2013-01-05T18:38:09.080" Score="0" Body="&lt;p&gt;Generally people price bonds as if they were riskless and then the option adjusted spread is used as a measure of credit spread.  There are methods for stripping CDS curves to get hazard rates and then solving for the price of the bond given uncertain survival to cash flows, which produces a new yield that ought to take into account the CDS-implied default probabilities.  I have worked with them before, but I don't know how popular they are elsewhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Floating rate notes don't present any credit-specific problems, one projects the coupons using the relevant forward curve + quoted yield margin.  I suppose in theory if a company financed much of its working capital with floating rate debt, there might be a correlation between forward interest rates and the firm's credit quality, which might be an interesting angle, but I don't even know if that's been addressed in literature, let alone in practice.&lt;/p&gt;&#xA;" OwnerUserId="3491" LastActivityDate="2013-01-05T18:38:09.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4923" PostTypeId="2" ParentId="729" CreationDate="2013-01-05T21:40:19.400" Score="2" Body="&lt;p&gt;As noted by others, the code is very hard to read. What I spotted: is the discounting done right? I see you discount the continuation value only to calculate Y, but does the discounting enter the recursion?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I have an implementation of the LS in Java here: &lt;a href=&quot;http://www.finmath.net/java&quot; rel=&quot;nofollow&quot;&gt;http://www.finmath.net/java&lt;/a&gt; )&lt;/p&gt;&#xA;" OwnerUserId="3548" LastActivityDate="2013-01-05T21:40:19.400" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4924" PostTypeId="1" AcceptedAnswerId="4925" CreationDate="2013-01-06T03:30:37.840" Score="4" ViewCount="12805" Body="&lt;p&gt;Let us consider an American call option with strike price K and the time to maturity be T.  Assume that the underlying stock does not pay any dividend. Let the price of this call option is C$^a$ today (t = 0). Now, suppose that at some intermediate time t ($&amp;lt;$T), I decide to exercise my call option. Hence the profit is: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;P1 = S(t) - K - C$^a$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could then earn the interest on this profit and hence at maturity i will have: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;P2 = P1*e$^{r(T-t)}$ = (S(t) - K - C$^a$)e$^{r(T-t)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, I could have waited and exercised it at maturity. My profit would then be: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;P3 = S(T) - K + Ke$^{rT}$ - C$^a$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I write this because i could have kept $K in the bank at t = 0 and earned a risk-free interest on it till maturity time T. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So here is my question: Merton (in 1973) said that it an American call on a non-dividend paying stock should not be exercised before expiration. I am just trying to figure out why it is true. Because there might be a possibility that P2 &gt; P3. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S: I am not contesting that what Merton said is wrong. I totally respect him and am sure what he is saying is correct. But I am not able to see it mathematically. Any help will be appreciated!. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank You.&lt;/p&gt;&#xA;" OwnerUserId="3552" LastActivityDate="2017-05-25T19:56:07.427" Title="Early execise of American Call on Non-Dividend paying stock." Tags="&lt;black-scholes&gt;&lt;american-options&gt;&lt;put-call-parity&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4925" PostTypeId="2" ParentId="4924" CreationDate="2013-01-06T04:20:36.147" Score="3" Body="&lt;p&gt;You compare apples and oranges here. You can't possibly compare the profit generated involving S(t) on one side and S(T) on the other side. at time t you do not know what the stock will be worth at time T. Merton made the statement in the context of deciding whether &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;to exercise the call option at any time before expiration &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;OR&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;to simply sell the call option in the market&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;and came to the conclusion that it is sub-optimal to exercise the option before expiration, but in light of the fact that he meant a comparison between exercise vs. selling the option, not between exercising and waiting till expiration. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-01-06T04:20:36.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4926" PostTypeId="1" CreationDate="2013-01-06T13:08:15.693" Score="12" ViewCount="6533" Body="&lt;p&gt;I am uncertain as to how to calculate the mean and variance of the following Geometric Ornstein-Uhlenbeck process. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d X(t) = a ( L - X_t ) dt + V X_t dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is anyone able to calculate the mean and variance of this process as well as include the calculations for the solution?&lt;/p&gt;&#xA;" OwnerUserId="3554" LastEditorUserId="467" LastEditDate="2013-01-07T07:49:54.687" LastActivityDate="2013-01-18T13:15:14.087" Title="What is the mean and the standard deviation for Geometric Ornstein-Uhlenbeck Process?" Tags="&lt;stochastic-calculus&gt;&lt;stochastic-processes&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="4927" PostTypeId="1" AcceptedAnswerId="4928" CreationDate="2013-01-06T14:35:26.007" Score="2" ViewCount="422" Body="&lt;p&gt;In which markets are inflation swaps considered liquid enough to be the primary instrument for measuring market inflation expectations (compared to say, inflation-linked bonds)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there specific biases that will cause implied inflation rates from the bonds to diverge significantly from the swap rates?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;many thanks!&lt;/p&gt;&#xA;" OwnerUserId="3556" LastActivityDate="2013-01-06T16:05:37.393" Title="Inflation swap liquidity versus inflation-linked bonds" Tags="&lt;inflation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4928" PostTypeId="2" ParentId="4927" CreationDate="2013-01-06T16:05:37.393" Score="1" Body="&lt;p&gt;Ironically I would say that in any market in which inflation does not matter but fat investment banks roam and harvest. Japan for example, who cares about inflation in this country...(until recently, thank you PM Abe). Thus, in markets such as Japan you hardly see a single TIPS like security crossing the counter, while your snake oil salesmen lurk around to push OTC inflation swaps and all sorts of other off-market instruments to unassuming clients. That is when such instruments are more liquid than liquid government bond-linked/ stripped inflation securities. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-01-06T16:05:37.393" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="4929" PostTypeId="2" ParentId="4202" CreationDate="2013-01-06T23:19:23.890" Score="0" Body="&lt;p&gt;I would suggest Ipopt, it is a very robust quadratic and non-linear solver and has matlab interface:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://projects.coin-or.org/Ipopt/wiki/MatlabInterface&quot; rel=&quot;nofollow&quot;&gt;https://projects.coin-or.org/Ipopt/wiki/MatlabInterface&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3230" LastActivityDate="2013-01-06T23:19:23.890" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4930" PostTypeId="2" ParentId="4926" CreationDate="2013-01-06T23:28:38.087" Score="1" Body="&lt;p&gt;An OU process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$&#xA;dx_t = \theta(\mu - x_t)dt + \sigma dW_t&#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where W follows standard Wiener  process then mean is $ \mu $ and variance is $ \sigma^2/2\theta $ . &#xA;You can substitute your factors. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using mathematica &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;mean  = Mean[OrnsteinUhlenbeckProcess[&lt;/code&gt;$ \mu,\sigma,\theta $&lt;code&gt;]]&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;variance = Variance[OrnsteinUhlenbeckProcess[&lt;/code&gt;$ \mu,\sigma,\theta $&lt;code&gt;]]&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="1386" LastActivityDate="2013-01-06T23:28:38.087" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4932" PostTypeId="2" ParentId="4926" CreationDate="2013-01-07T10:06:03.660" Score="8" Body="&lt;p&gt;Okay so I'll take Jase answer and format it properly so that it answers your question and it will be useful for users in the future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For clarity, let me restate the dynamics of the &lt;strong&gt;Modified Ornstein-Uhlenbeck&lt;/strong&gt; model using the more common notation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dS_t = \theta (\mu-S_t)dt + \sigma S_t dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This blog &lt;a href=&quot;http://fxpaul.wordpress.com/2011/05/27/closed-form-solution-of-modified-ornstein-uhlenbeck-process/&quot; rel=&quot;noreferrer&quot;&gt;post&lt;/a&gt; provides a closed form solution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ S_t = S_0 \exp(- \alpha t + \sigma W_t) + \frac{\theta \mu}{\alpha} (1+ \exp(-\alpha t))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\alpha=\theta+\frac{1}{2} \sigma^2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So first, the expectation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}[S_t] = \mathbb{E}[ S_0 \exp(- \alpha t + \sigma W_t) + \frac{\theta \mu}{\alpha} (1+ \exp(-\alpha t))]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}[S_t] = \mathbb{E}[ S_0 \exp(- \alpha t + \sigma W_t)] + \mathbb{E}[\frac{\theta \mu}{\alpha} (1+ \exp(-\alpha t))]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}[S_t] =  S_0  \mathbb{E}[\exp(- \alpha t + \sigma W_t)] + \frac{\theta \mu}{\alpha} (1+ \exp(-\alpha t))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, note that $\exp(- \alpha t + \sigma W_t)$ can be expressed as $\exp(- \alpha t + \sigma \sqrt{t} Z)$ (with $Z \sim \mathcal{N}(0,1)$) hand is log-normally distributed: $\sim \ln \mathcal{N} (-\alpha t, \sigma^2 t) $, so you can apply the formulas of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Log-normal_distribution&quot; rel=&quot;noreferrer&quot;&gt;log-normal distribution&lt;/a&gt; for mean and variance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}[\exp(- \alpha t + \sigma \frac{1}{\sqrt{t}} Z)]= \exp(- \alpha t + \frac{1}{2} \frac{\sigma^2}{t})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, we get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}[S_t] =  S_0   \exp(- \alpha t + \frac{1}{2} \sigma^2 t) + \frac{\theta \mu}{\alpha} (1+ \exp(-\alpha t))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now for the variance:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ Var[S_t]= Var[S_0 \exp(- \alpha t + \sigma W_t) + \frac{\theta \mu}{\alpha} (1+ \exp(-\alpha t))]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the second term is constant, we get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ Var[S_t]= Var[S_0 \exp(-\alpha t + \sigma W_t)]$$&#xA;$$ Var[S_t]= S_0^2 Var[\exp(- \alpha t + \sigma W_t)]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using again the log-normal formula&#xA;$$ Var[S_t]= S_0^2  (\exp(\sigma^2 t)-1) \exp(-2 \alpha t+\sigma^2t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To sum up, and substituting  $\alpha$ with $\theta+\frac{1}{2} \sigma^2$ we get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}[S_t] =  S_0   \exp(- \theta t) + \frac{\theta \mu}{\theta+\frac{1}{2} \sigma^2} (1+ \exp(- (\theta+\frac{1}{2} \sigma^2) t))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ Var[S_t]= S_0^2  (\exp(\sigma^2 t)-1) \exp(-2 \theta t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hopefully this should answer your question.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2013-01-18T13:15:14.087" LastActivityDate="2013-01-18T13:15:14.087" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4933" PostTypeId="2" ParentId="4202" CreationDate="2013-01-07T12:22:53.713" Score="-2" Body="&lt;p&gt;&lt;strong&gt;Pyalogtrade&lt;/strong&gt; &#xA;pyalgotrade.optimizer.local module: &#xA;&lt;a href=&quot;http://gbeced.github.com/pyalgotrade/docs/v0.9/html/tutorial.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://gbeced.github.com/pyalgotrade/docs/v0.9/html/tutorial.html&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main idea is to take advante of &lt;strong&gt;Google’s cloud computing&lt;/strong&gt; services to optimize your strategies, which is &#xA;specially helpful when you don’t have access to a cluster of computers to optimize your strategies in parallel. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that you should run only one server and one or more workers in different computers. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Google App Engine support &#xA;&lt;a href=&quot;http://gbeced.github.com/pyalgotrade/docs/v0.9/html/googleappengine.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://gbeced.github.com/pyalgotrade/docs/v0.9/html/googleappengine.html&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pyalogtrade Down Load Here: &#xA;&lt;a href=&quot;http://gbeced.github.com/pyalgotrade/downloads/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://gbeced.github.com/pyalgotrade/downloads/index.html&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Google App Engine SDK for Python &#xA;&lt;a href=&quot;https://developers.google.com/appengine/downloads&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://developers.google.com/appengine/downloads&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Related topic:&#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/647/switching-from-matlab-to-python-for-quant-trading-and-research&quot;&gt;Switching from Matlab to Python for Quant Trading and Research&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3196" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2013-01-07T12:29:18.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4934" PostTypeId="2" ParentId="431" CreationDate="2013-01-07T20:03:43.257" Score="8" Body="&lt;p&gt;While not strictly quantitative finance, for the first year in the PhD I found this Youtube-Channel extremely helpful:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.youtube.com/user/mathematicalmonk&quot;&gt;http://www.youtube.com/user/mathematicalmonk&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I covers almost only math, but does a very good job at explaining the basics of probability theory. Most people will already have mastered that stuff, but it will surely help those unfamiliar with the basics.&lt;/p&gt;&#xA;" OwnerUserId="1976" LastActivityDate="2013-01-07T20:03:43.257" CommentCount="0" CommunityOwnedDate="2013-01-07T20:03:43.257" ContentLicense="CC BY-SA 3.0" />
  <row Id="4936" PostTypeId="1" AcceptedAnswerId="4937" CreationDate="2013-01-08T02:40:22.023" Score="4" ViewCount="11872" Body="&lt;p&gt;Why do short term implieds move more than long term?&lt;/p&gt;&#xA;" OwnerUserId="3184" LastActivityDate="2013-01-13T05:08:55.713" Title="Why is short term implied volatility typically higher?" Tags="&lt;options&gt;&lt;implied-volatility&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4937" PostTypeId="2" ParentId="4936" CreationDate="2013-01-08T03:47:39.127" Score="3" Body="&lt;p&gt;Implied volatility represents the market expectation of &quot;stuff happening in the future&quot;.  Over long periods, all that stuff tends to cancel out a bit, so long-term vols are much more stable.  In the short term, a single news item may be enough to drastically increase (or decrease) return uncertainty.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a quant point of view, we think of volatility as &quot;mean-reverting&quot;.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2013-01-08T03:47:39.127" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4938" PostTypeId="2" ParentId="4936" CreationDate="2013-01-08T05:09:01.740" Score="3" Body="&lt;p&gt;Actually, short term implied volatility is higher at high volatility periods and lower at low realized volatility periods. From a quantitative perspective, the explanation for this is usually that short-term implied volatility is more influenced by the recent realized volatility, while longer-term is more influenced by the long term average. From a market perspective, it probably has to do with squeezes and reaching for protection at the time of need (so it's higher then longer term) and option over-writing in the front during the quiet times.  &lt;/p&gt;&#xA;" OwnerUserId="2906" LastActivityDate="2013-01-08T05:09:01.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4939" PostTypeId="2" ParentId="4775" CreationDate="2013-01-08T06:06:57.877" Score="1" Body="&lt;p&gt;For conference we have &lt;a href=&quot;http://www.icbi-derivatives.com/&quot; rel=&quot;nofollow&quot;&gt;Global derivatives&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="3564" LastActivityDate="2013-01-08T06:06:57.877" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4940" PostTypeId="1" AcceptedAnswerId="42592" CreationDate="2013-01-08T07:00:15.873" Score="5" ViewCount="322" Body="&lt;p&gt;I was looking at this video today:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cmegroup.com/education/interactive/webinars-archived/implied-price-functionality.html&quot; rel=&quot;nofollow&quot;&gt;http://www.cmegroup.com/education/interactive/webinars-archived/implied-price-functionality.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;on implied pricing. And am aware that implied orders/pricing exists in ICE as well. I found it difficult to follow (the video) beyond the vanilla examples and was wondering what other resources might break this down a little more that I can search for or reference to understand implied orders/pricing/book in these markets.&lt;/p&gt;&#xA;" OwnerUserId="1456" LastEditorUserId="12" LastEditDate="2013-01-08T07:58:53.653" LastActivityDate="2018-11-11T20:43:55.267" Title="Resources to read more about/learn how implied pricing works" Tags="&lt;futures&gt;&lt;pricing&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4941" PostTypeId="2" ParentId="4708" CreationDate="2013-01-08T10:29:37.970" Score="0" Body="&lt;p&gt;With Fairmat Academic / Data-Link we obtain the following values: alpha=0.022, sigma=0.009.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fairmat Academic can be freely downloaded from &#xA;&lt;a href=&quot;http://www.fairmat.com/downloads&quot; rel=&quot;nofollow&quot;&gt;http://www.fairmat.com/downloads&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While the code used to calibrate the hull and white model can be found on GitHub:&#xA;&lt;a href=&quot;https://github.com/fairmat/InterestRatesModels&quot; rel=&quot;nofollow&quot;&gt;https://github.com/fairmat/InterestRatesModels&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3230" LastActivityDate="2013-01-08T10:29:37.970" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4942" PostTypeId="2" ParentId="729" CreationDate="2013-01-08T11:02:33.393" Score="1" Body="&lt;p&gt;I think that you are simply discounting the cash flows incorrectly (j is an index):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nearly at the end of your listing, instead of writing&lt;/p&gt;&#xA;&#xA;&lt;p&gt;discValue = discValue + CashFlow(i, j)*exp(-0.06*j);&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you should write&lt;/p&gt;&#xA;&#xA;&lt;p&gt;discValue = discValue + CashFlow(i, j)*exp(-0.06*j*dt);&lt;/p&gt;&#xA;" OwnerUserId="3230" LastActivityDate="2013-01-08T11:02:33.393" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4943" PostTypeId="1" AcceptedAnswerId="4947" CreationDate="2013-01-08T15:37:41.387" Score="2" ViewCount="2055" Body="&lt;p&gt;Following up on this question: &lt;a href=&quot;https://quant.stackexchange.com/questions/4909/yield-of-a-risky-bond&quot;&gt;Yield of a risky bond&lt;/a&gt;, what is the definition of clean and dirty prices for a risky (defaultable, catastrophe, etc.) bond? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would think the dirty price should basically be the discounted cashflows. Then the clean price should be dirtyPrice-accruedAmount. What is the accruedAmount though? At what rate does it accrue?&lt;/p&gt;&#xA;" OwnerUserId="1810" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2013-01-12T11:53:54.580" Title="What is the clean price and dirty price of a risky bond?" Tags="&lt;fixed-income&gt;&lt;risk-premium&gt;&lt;bond&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4944" PostTypeId="1" AcceptedAnswerId="4949" CreationDate="2013-01-07T13:56:36.387" Score="4" ViewCount="1265" Body="&lt;p&gt;Let you have a mean reverting stochastic process with a statistically significant autocorrelation coefficient; let it looks like you can well model it using an $ARMA(p,q)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This time series could be described by a mean reverting stochastic process like&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS=k(\theta-S_{t})dt+\sigma S_{t}^{\beta}dz$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\theta$ is the mean reversion level, $k$ is the speed of mean reversion and $\beta$ determines the structural form of diffusion term (so $\beta=0$ yields the normally distributed mean reversion model, aka the Ornstein-Uhlenbeck process).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regardless of the actual value of $S_{0}$, we know $S_{t}$ will go $\theta$ in the long run, right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let there's an unlikely event which can drastically change $\theta$'s value: e.g. let $\theta=100$, you model the process, ok, then... &lt;em&gt;bang&lt;/em&gt;! Starting from $t=\tau$ it happens that $\theta=30$ and you will have to deal with this new scenario.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question:&#xA;is there any model which can deal with such a situation?&lt;/p&gt;&#xA;" OwnerUserId="3058" OwnerDisplayName="Lisa Ann" LastActivityDate="2015-10-30T23:11:54.500" Title="Regime switching in mean reverting stochastic process" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4945" PostTypeId="2" ParentId="4943" CreationDate="2013-01-08T16:19:20.703" Score="0" Body="&lt;p&gt;The standard definitions and formulas of clean price and dirty price apply for your &quot;risky&quot; bonds.&lt;/p&gt;&#xA;" OwnerUserId="2220" LastActivityDate="2013-01-08T16:19:20.703" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4946" PostTypeId="1" CreationDate="2013-01-08T16:20:28.593" Score="4" ViewCount="2032" Body="&lt;p&gt;I am looking for a nice and readable description of how to implement BDT model:  $d log(r(t)) = [\theta(t)-\frac{\sigma'(t)}{\sigma(t)}log(r(t))]dt + \sigma(t) dW$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume I already have steady-state IR curve $r^*(t)$ and volatility curve $\sigma^*(t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It makes no difference whether it would be binomial tree or Monte-Carlo or FDM implementation.&#xA;Monte-Carlo seems to be easy but I'm not sure whether I can use $\theta(t) = r^*(t)$ and $\sigma(t)=\sigma^*(t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I went thru &lt;a href=&quot;http://ederman.com/new/docs/faj-one_factor_model.pdf&quot; rel=&quot;nofollow&quot;&gt;Derman's article&lt;/a&gt; and Haug's &quot;Options pricing formulas&quot; but found no answer.&lt;/p&gt;&#xA;" OwnerUserId="2870" LastActivityDate="2015-06-28T00:12:13.510" Title="BDT model implementation" Tags="&lt;interest-rates&gt;&lt;monte-carlo&gt;&lt;binomial-tree&gt;&lt;bdt&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4947" PostTypeId="2" ParentId="4943" CreationDate="2013-01-08T16:35:32.147" Score="3" Body="&lt;p&gt;Dirty bond price refers to the price of a bond that reflects the interest that has accrued since the issuance of the bond or last coupon payment. It has nothing to do with how you discount cash flows but just whether accrued interest is priced in or not. Thus, dirty and clean bond prices apply to all bonds that pay intermittent cash flows. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-01-08T16:35:32.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4948" PostTypeId="1" CreationDate="2013-01-08T17:17:50.787" Score="22" ViewCount="61159" Body="&lt;p&gt;I am currently working on ARMA+GARCH model using R. I am looking out for example which explain step by step explanation for fitting this model in R. I have time series which is stationary and I am trying to predict n period ahead value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have worked on this model but I am looking out for example where auto.arima() function is used for selecting best ARMA(p,q) based on AIC value. &lt;/p&gt;&#xA;" OwnerUserId="926" LastEditorUserId="467" LastEditDate="2013-01-08T19:56:21.950" LastActivityDate="2020-01-17T07:17:52.320" Title="How to fit ARMA+GARCH Model In R?" Tags="&lt;time-series&gt;&lt;statistics&gt;&lt;r&gt;" AnswerCount="6" CommentCount="3" FavoriteCount="18" ContentLicense="CC BY-SA 3.0" />
  <row Id="4949" PostTypeId="2" ParentId="4944" CreationDate="2013-01-08T19:16:20.910" Score="2" Body="&lt;p&gt;As far as I can tell, you've essentially written the model that you are concerned with. The only difference is that you would instead have $\theta_{i}$ when $s_{t}=i$ where $s_{t}$ is a latent variable that reflects the probability of being in state $i$.  You would also need to include the dynamics that drive the probability transitions as another part of the model. You could set them up as standard Markov Regime-Switching models are set up, though there are other options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the question becomes what do you want to do with the model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are concerned with estimating the parameters of such a model, you would begin by setting this up as a regime-switching AR(p) model (these are more popular to use than ARMA models). You could set it up in levels and allow the coefficients on all the variables (and the variance) to switch between states. You could also set it up in differences and include the lag of the level as an independent variable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To estimate the parameters, the simplest approach is to apply maximum likelihood using the Hamilton filter. There is a &lt;a href=&quot;https://sites.google.com/site/marceloperlin/matlab-code/ms_regress---a-package-for-markov-regime-switching-models-in-matlab&quot; rel=&quot;nofollow&quot;&gt;Matlab implementation&lt;/a&gt; that I have used to implement this approach. You could also estimate the regime-switching model by Bayesian MCMC.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2013-01-08T19:16:20.910" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="4950" PostTypeId="1" AcceptedAnswerId="4952" CreationDate="2013-01-08T20:40:08.463" Score="3" ViewCount="876" Body="&lt;p&gt;How would you handle a negative interest rate in index/equity options valuation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example would be &lt;a href=&quot;http://www.global-rates.com/interest-rates/libor/swiss-franc/swiss-franc.aspx&quot; rel=&quot;nofollow&quot;&gt;negative rates&lt;/a&gt; for short term maturities for Swiss Frank (CHF).&lt;/p&gt;&#xA;" OwnerUserId="2909" LastActivityDate="2013-01-09T01:00:37.103" Title="Value options when the currency’s risk free rate is negative?" Tags="&lt;options&gt;&lt;interest-rates&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="4951" PostTypeId="2" ParentId="4946" CreationDate="2013-01-09T00:50:00.113" Score="3" Body="&lt;p&gt;All you need is to use the discretization to implement the MC approach. The following links should get you started: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.lcy.net/files/BDT_Seminar_Paper.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.lcy.net/files/BDT_Seminar_Paper.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www-2.rotman.utoronto.ca/~hull/TechnicalNotes/TechnicalNote23.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www-2.rotman.utoronto.ca/~hull/TechnicalNotes/TechnicalNote23.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.iorcf.unisg.ch/Forschung/~/media/Internet/Content/Dateien/InstituteUndCenters/IORCF/Abschlussarbeiten/Frey%202008%20MA%20Monte%20Carlo%20methods%20with%20application%20to%20the%20pricing%20of%20interest%20rate%20derivatives.ashx&quot; rel=&quot;nofollow&quot;&gt;http://www.iorcf.unisg.ch/Forschung/~/media/Internet/Content/Dateien/InstituteUndCenters/IORCF/Abschlussarbeiten/Frey%202008%20MA%20Monte%20Carlo%20methods%20with%20application%20to%20the%20pricing%20of%20interest%20rate%20derivatives.ashx&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the last paper check from section 6.2&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following papers show examples of BDT model calibration:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://belkcollegeofbusiness.uncc.edu/wtian1/bdt.pdf&quot; rel=&quot;nofollow&quot;&gt;http://belkcollegeofbusiness.uncc.edu/wtian1/bdt.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.csie.ntu.edu.tw/~lyuu/finance1/2012/20120530.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.csie.ntu.edu.tw/~lyuu/finance1/2012/20120530.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.iam.fmph.uniba.sk/studium/efm/phd/urbanova/urbanova-thesis.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.iam.fmph.uniba.sk/studium/efm/phd/urbanova/urbanova-thesis.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-01-17T16:01:33.137" LastActivityDate="2013-01-17T16:01:33.137" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4952" PostTypeId="2" ParentId="4950" CreationDate="2013-01-09T01:00:37.103" Score="2" Body="&lt;p&gt;A realistic alternative is to set all CHF rates out till 3 months equal to zero. The differential is so insignificant that for practical pricing valuation purposes it makes zero difference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please note that I am in particular talking about the valuation of index/equity options such as you indicated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But even plugging negative rates in should work fine for BS-models (read a paper on that by  Espen Gaarder Haug). However, you need to be more careful when working with interest rate models. Some are not happy with negative rates. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-01-09T01:00:37.103" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="4953" PostTypeId="2" ParentId="431" CreationDate="2013-01-09T01:31:05.707" Score="14" Body="&lt;p&gt;Eric Zivot's &lt;a href=&quot;https://www.coursera.org/course/compfinance&quot;&gt;Introduction to Computational Finance and Financial Econometrics&lt;/a&gt; on Coursera.&lt;/p&gt;&#xA;" OwnerUserId="3287" LastActivityDate="2013-01-09T01:31:05.707" CommentCount="0" CommunityOwnedDate="2013-01-09T01:31:05.707" ContentLicense="CC BY-SA 3.0" />
  <row Id="4954" PostTypeId="1" AcceptedAnswerId="4957" CreationDate="2013-01-09T02:45:01.323" Score="11" ViewCount="22004" Body="&lt;p&gt;I've read the so-called &quot;leverage-effect&quot; for stocks models the fact that if a company is leveraged, its volatility should increase as the stock price moves lower and closer to the level of debt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone please explain this to me?&lt;/p&gt;&#xA;" OwnerUserId="3184" LastActivityDate="2021-04-08T23:54:44.637" Title="What is the &quot;leverage effect&quot; for stocks?" Tags="&lt;volatility&gt;&lt;leverage&gt;" AnswerCount="5" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="4955" PostTypeId="2" ParentId="4948" CreationDate="2013-01-09T04:04:20.090" Score="15" Body="&lt;p&gt;I don't know how to select ARMA lag length when doing ARMA-GARCH. Perhaps someone can edit it into this answer.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For the univariate case you want &lt;code&gt;rugarch&lt;/code&gt; package. If you're doing multivariate stuff you want &lt;code&gt;rmgarch&lt;/code&gt;. The reason these are better than other packages is threefold; (i) Support for exogenous variables which I haven't seen in any other package, (ii) support for dynamic conditional correlations, (iii) support for a huge multitude of fGARCH variants.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;install.packages(&quot;rugarch&quot;)&#xA;require(rugarch)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Let's construct the data to be used as an example. Using $N(0,1)$ will give strange results when you try to use GARCH over it but it's just an example.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;data &amp;lt;- rnorm(1000)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We can then compute the ARMA(1,1)-GARCH(1,1) model as an example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;spec &amp;lt;- ugarchspec(variance.model = list(model = &quot;sGARCH&quot;, &#xA;                                         garchOrder = c(1, 1), &#xA;                                         submodel = NULL, &#xA;                                         external.regressors = NULL, &#xA;                                         variance.targeting = FALSE), &#xA;&#xA;                   mean.model     = list(armaOrder = c(1, 1), &#xA;                                         external.regressors = NULL, &#xA;                                         distribution.model = &quot;norm&quot;, &#xA;                                         start.pars = list(), &#xA;                                         fixed.pars = list()))&#xA;&#xA;garch &amp;lt;- ugarchfit(spec = spec, data = data, solver.control = list(trace=0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Retrieve ARMA(1,1) and GARCH(1,1) coefficients:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;garch@fit$coef&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Retrieve time-varying standard deviation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;garch@fit$sigma&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Retrieve standardized $N(0,1)$ ARMA(1,1) disturbances:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;garch@fit$z&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See what else you can pull out of the fit:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;str(garch)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3174" LastEditorUserId="15868" LastEditDate="2016-01-09T16:11:58.923" LastActivityDate="2016-01-09T16:11:58.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4956" PostTypeId="1" CreationDate="2013-01-09T06:23:00.803" Score="3" ViewCount="1343" Body="&lt;p&gt;Clearly there is a strong relationship between credit spreads and equity prices (both theoretically and empirically).  But how would one go about formulating a regression which seeks to explain this relationship?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To keep it narrow, let's say we have the following time series data;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;S&amp;amp;P500, daily % changes&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Generic 5 year swap yields, daily differences &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Generic 5 year high yield credit spread index, daily differences&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The objective is to explain the daily movements in credit spreads by the changes in swap yields and equity prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm interested more in how one might think about structuring the regression (eg transforming the variables) to get the best fit from a linear regression, rather than the theoretical economic underpinnings or choice of data comprising this particular problem.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular i want to know how one might transform the inputs to be able to cover the case of when credit spreads are high (sensitivity to equity changes is also high) and when credit spreads are low (sensitivity to equity changes is also low), or if a different approach is warranted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Among the potential other issues are that equity price changes are fat tailed, and have negative skew. Swap yields and credit spreads are both mean reverting (and lower bounded).  Credit spreads depend on swap yields and equity prices, but swap yields also depend on equity prices.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does it make sense to maybe do something like;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;transform each series by dividing by it's volatility (or it's implied volatility - additional non-linear issues with that?)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;regression on ranks rather than underlying data&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;transform each series with a sigmoid function, possibly in combination any of the above&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;other suggestions?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I appreciate this might be a wide topic, but am very interested to here how people with knowledge of time series statistics and finance might approach it.&lt;/p&gt;&#xA;" OwnerUserId="3297" LastEditorUserId="35" LastEditDate="2013-01-09T12:15:35.457" LastActivityDate="2013-01-13T17:44:35.247" Title="What data transformations to use in regression of credit spreads on equity prices?" Tags="&lt;time-series&gt;&lt;regression&gt;&lt;asset-returns&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="4957" PostTypeId="2" ParentId="4954" CreationDate="2013-01-09T07:14:21.510" Score="21" Body="&lt;p&gt;The key to this is to think about the enterprise value of a business separately from how it is financed.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For simplicity sake, consider a business that comprises a sole gold bar (no workers, no extraction costs, etc).  The value of the business is clearly just the value of the gold bar.  If it were a listed company, with no debt, then the equity capitalization would be the value of the gold bar, and the volatility of the share price would be equal to the volatility of the gold price.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now consider the same company financed with $50\%$ debt (at zero interest) and $50\%$ equity.  The enterprise value of the geared company remains the same as before, but the equity capitalization is half as much (since the debt holders are owed the other half).  However, whereas the claims of debt holders is fixed in nominal dollars, the equity holders get the benefit/cost of a higher/lower gold price.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. If the gold bar is initially worth $\$100$ (financed with $\$50$ equity and $\$50$ debt), but then rises to $\$110$, then the value of equity becomes $\$60$, while the value of debt remains at $\$50$.  Equity holders enjoy a $20\%$ increase ($=\frac{10}{50}$) in share value, against $10\%$ ($=\frac{10}{100}$) in the unlevered case.  In moving from $0\%$ gearing to $50\%$ gearing, the volatility of equity value has doubled.&lt;/p&gt;&#xA;" OwnerUserId="3297" LastEditorUserId="2727" LastEditDate="2013-01-09T07:37:58.920" LastActivityDate="2013-01-09T07:37:58.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="4959" PostTypeId="2" ParentId="4956" CreationDate="2013-01-09T09:19:10.690" Score="1" Body="&lt;p&gt;I am a bit confused about your question in that you say at one point that you want to explain the relationship between credit spreads and equity prices. Is that what you really want to know? Why? I thought you already have empirical evidence that supports the relationship between the two? Or are you after something else?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, I would actually recommend you to run the principal components and only after that hack away with regression tests. You may also want to introduce other time series as Strange suggested (implied vols,...). You are severely limiting yourself if you only test the three mentioned time series. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you cant help it to dive into regressions then I would normalize the data rather than working with percent returns. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-01-09T09:19:10.690" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="4960" PostTypeId="2" ParentId="4956" CreationDate="2013-01-09T15:49:49.807" Score="0" Body="&lt;p&gt;In short, I would not make any of the transformations you suggest and rely on traditional statistical tools like Vector Autoregressions and Garch.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastEditorUserId="2379" LastEditDate="2013-01-09T18:01:08.280" LastActivityDate="2013-01-09T18:01:08.280" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="5961" PostTypeId="2" ParentId="431" CreationDate="2013-01-10T05:52:05.140" Score="4" Body="&lt;p&gt;Coursera had a Computational Investing course by Prof. Tucker Balch as well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.coursera.org/course/compinvesting1&quot; rel=&quot;nofollow&quot;&gt;https://www.coursera.org/course/compinvesting1&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looks like it is being offered again in February 2013. Useful for someone who wants to learn basic finance and coding for Finance in Python. They use a software developed for the same course in GeorgiaTech.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this is useful.&lt;/p&gt;&#xA;" OwnerUserId="3461" LastActivityDate="2013-01-10T05:52:05.140" CommentCount="0" CommunityOwnedDate="2013-01-10T05:52:05.140" ContentLicense="CC BY-SA 3.0" />
  <row Id="5962" PostTypeId="2" ParentId="431" CreationDate="2013-01-10T10:18:37.130" Score="4" Body="&lt;p&gt;Plenty of useful cources can be found at &lt;a href=&quot;https://www.coursera.org/courses&quot; rel=&quot;nofollow&quot;&gt;https://www.coursera.org/courses&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example: &lt;a href=&quot;https://www.coursera.org/course/dataanalysis&quot; rel=&quot;nofollow&quot;&gt;Data Analisys&lt;/a&gt;, &lt;a href=&quot;https://www.coursera.org/course/compmethods&quot; rel=&quot;nofollow&quot;&gt;Computational Methods for Data Analysis&lt;/a&gt;, &lt;/p&gt;&#xA;" OwnerUserId="2246" LastActivityDate="2013-01-10T10:18:37.130" CommentCount="0" CommunityOwnedDate="2013-01-10T10:18:37.130" ContentLicense="CC BY-SA 3.0" />
  <row Id="5963" PostTypeId="2" ParentId="431" CreationDate="2013-01-10T13:31:32.547" Score="5" Body="&lt;p&gt;Also there are some interesting videos from &lt;a href=&quot;http://www.icbi-derivatives.com/page/eventtv/ch/11298812/v/0GJ4Dr3_zww&quot; rel=&quot;noreferrer&quot;&gt;Global Derivatives 2011-2012&lt;/a&gt; confernces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Particularly this one: &lt;a href=&quot;http://www.youtube.com/watch?v=FK8MjpGKIkk&quot; rel=&quot;noreferrer&quot;&gt;http://www.youtube.com/watch?v=FK8MjpGKIkk&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2246" LastActivityDate="2013-01-10T13:31:32.547" CommentCount="0" CommunityOwnedDate="2013-01-10T13:31:32.547" ContentLicense="CC BY-SA 3.0" />
  <row Id="5964" PostTypeId="1" CreationDate="2013-01-10T21:56:16.190" Score="6" ViewCount="1310" Body="&lt;p&gt;I want to generate a random vector $z$ of dimension $k+m$ with some given correlation matrix $\Sigma$, such that the first $k$ elements of the vector are distributed normally and the last $m$ elements follow the Gamma distribution with some given parameters $a,b$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stats.stackexchange.com/questions/7515/what-are-some-techniques-for-sampling-two-correlated-random-variables&quot;&gt;Hier&lt;/a&gt; is suggested (applied to this case) to generate a normal r.v. Z as $N(0,\Sigma)$ and then solve&#xA;$G_{[a,b]}(Y_i)=\Phi_{[0,\Sigma]}(Z_i), i\geq m$ and replace the last m elements of Z with Ys, however it's not guaranteed that the vector $(Z_1, ... , Z_k, Y_{k+1}, ..., Y_{k+m})$ will still have the correlation matrix $\Sigma$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some nice copula out there that does the job or some other approach?&lt;/p&gt;&#xA;" OwnerUserId="1969" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2013-01-16T02:54:06.867" Title="Generate correlated random variables from Normal and Gamma distributions" Tags="&lt;monte-carlo&gt;&lt;copula&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5965" PostTypeId="2" ParentId="4936" CreationDate="2013-01-10T23:25:25.537" Score="1" Body="&lt;p&gt;I think your question is ambiguous, in the subject you ask why short term implied volatility is higher, in the body you ask why do short term &quot;implieds&quot; move more than long term, which indicates you are asking more about the short-term vol-of-vol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a), short term implied vols are not typically higher at the money.  They might be at the wings, due to many reasons depending who you ask, but I typically favor the vol-of-vol-leading-to-kurtosis explanation.  This explanation ALSO covers why ATM short-term vols are LOWER (higher peak of probability at-the-money due to the excess kurtosis).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For b), why is short-term vol-of-vol higher, I believe it's as mentioned above because on short time scales the variance of volatility overwhelms the mean-reversion of volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's worth pointing out that &quot;implied volatility&quot; is just a model output of market prices, so it gets a bit dangerous to try and understand why &quot;it&quot; does things, when its sometimes more fruitful to think, &quot;why do traders demand higher prices for options in these regimes or those?&quot;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found Nassim Taleb's Dynamic Hedging a pretty good read for these sorts of questions.&lt;/p&gt;&#xA;" OwnerUserId="3491" LastActivityDate="2013-01-10T23:25:25.537" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5968" PostTypeId="2" ParentId="5964" CreationDate="2013-01-11T15:37:08.017" Score="4" Body="&lt;p&gt;Look here&#xA;for multivariate distribution on the positive quadrant ... quite difficult.&#xA;&lt;a href=&quot;http://xianblog.wordpress.com/tag/multivariate-analysis/&quot; rel=&quot;nofollow&quot;&gt;http://xianblog.wordpress.com/tag/multivariate-analysis/&lt;/a&gt;&#xA;I have been thinking about this for weeks and months in the context of credit risk (modelling default intensities jointly) and I think this does not work.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2013-01-11T15:37:08.017" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5969" PostTypeId="1" CreationDate="2013-01-11T18:13:35.283" Score="6" ViewCount="1286" Body="&lt;p&gt;I am currently writing a paper on asymmetric volatility modeling of brent, gold, silver, wheat, soybean and corn from 1986-2012 and divided them into 4 sub-sample periods (i.e. 1986-1991, 1991-1997, 1997-2005, 2005-2012 and where the no. of observations are: 1515, 1515, 2000, 2000, respectively) and I have some questions to ask regarding it. I hope you guys can help me out here. Thank you so much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A summary of what I have done so far:&#xA;- Box.test on squared returns and ARCH-LM tests for conditional heteroskedasticity. If null is rejected, I proceed with GARCH(1,1) modeling&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Using the rugarch package, if sign bias test (based on paper done by Engle and Ng - &lt;a href=&quot;http://www.jstor.org/discover/10.2307/2329066?uid=3738992&amp;amp;uid=2129&amp;amp;uid=2&amp;amp;uid=70&amp;amp;uid=4&amp;amp;sid=21101646509647&quot;&gt;http://www.jstor.org/discover/10.2307/2329066?uid=3738992&amp;amp;uid=2129&amp;amp;uid=2&amp;amp;uid=70&amp;amp;uid=4&amp;amp;sid=21101646509647&lt;/a&gt;)&#xA;is statistically significant then I propose three asymmetric vol models (i.e. EGARCH(1,1), GJR-GARCH(1,1) and APARCH(1,1), d=1)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The final model is then chosen based on BIC, Q-statistics on standardized residuals and its squared terms and ARCH LM tests across 4 distributions (i.e. norm, std, sstd and ged)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;My questions are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;If the gamma coefficient (leverage effect) of GJR is insignificant but the news impact curve show that negative return shocks does induce greater increment in conditional variance than positive return shocks and the sign bias test from GARCH(1,1) is significant and model checks deem the GJR model suitable for this particular period then how should one conclude on news impact and leverage effect for this period? Does it mean a better model can be proposed for it?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Related to question 1., if leverage effect, alphas and betas are insignificant but model checks suggest that this model is indeed suitable. What can we conclude from it and how can we improve the model? Since alphas and betas are insignificant, what can we say about its persistence and unconditional variance? Are they still statistically meaningful?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Amongst all the models, there is one particular model - APARCH(1,1) for wheat (2nd sub-sample) has a persistence of 0.8ish and theoretically, this just means its rate of decay is higher as compared to the rest. But apart from this, are there any more information that we can glean from the result?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The QQ-plots for all sub-samples for corn, using GARCH(1,1) with ged show that it's a terrible fit and presence of quite a number of outliers. But its coefficients are significant and BIC value is the lowest compared to the other 3 distributions. However, the QQ-plot of std shows a much better fit. I suspect there's convergence problem with ged distribution. How can we prevent that or should just stick to std distribution?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If ARCH test conducted before GARCH(1,1) was modeled fail to reject null, what can we do about modeling the volatility without including more data points?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Your help is greatly appreciated. Thank you!&lt;/p&gt;&#xA;" OwnerUserId="3586" LastEditorUserId="35" LastEditDate="2013-01-11T19:40:42.063" LastActivityDate="2013-01-11T19:40:42.063" Title="Asymmetric Volatility Modeling (Interpretation)" Tags="&lt;volatility&gt;&lt;time-series&gt;&lt;statistics&gt;&lt;research&gt;&lt;finance&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5970" PostTypeId="1" CreationDate="2013-01-11T20:44:52.857" Score="1" ViewCount="1120" Body="&lt;p&gt;For a college project I'm tasked with implementing prediction market. Which model of it I'd better choose? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want something useful and simple enough for other people to quickly understand and use. (This project is to be used in campus internally).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For now on I'm considering binary option model, but as I understand buying in such model would require me to solve some kind of combinational optimization problem: if I want to buy up to x$ of contracts and there are available contracts with returns r_1, r_2, ... and prices p_1, p_2, ... which looks like a classical  knapsack problem to me. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would it be better to go with some model which uses market-maker? &lt;/p&gt;&#xA;" OwnerUserId="3587" LastActivityDate="2013-01-21T21:27:21.083" Title="Which prediction market model is efficient and simple to use?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;market&gt;&lt;market-making&gt;&lt;prediction&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="5972" PostTypeId="2" ParentId="5970" CreationDate="2013-01-12T05:23:23.550" Score="4" Body="&lt;p&gt;There are two excellent choices for implementing prediction markets:&#xA;(1) Use book orders that stand until filled, just as intrade.com does.&#xA;(2) Use an automated market maker (like Robin Hanson's) that stands ready to make trades.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The book orders model is very simple to implement, but can suffer from very wide Bid/Ask spreads.  And, it can be tough to bet people to book orders that may never get filled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hanson's market maker, on the other hand, supports instant trades for anybody.  The downside of automated market makers are two-fold:  they often require a fair bit of sophisticated math, and they can lose (a bounded amount of) money.  See &lt;a href=&quot;http://blog.oddhead.com/2006/10/30/implementing-hansons-market-maker/&quot; rel=&quot;nofollow&quot;&gt;http://blog.oddhead.com/2006/10/30/implementing-hansons-market-maker/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use book orders and a market-maker together, but it complicates some things.  Hanson's market maker moves the prices continuously which makes things a little funny when you hit the price of a standing book order.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pennock also has one or two market makers, but Hanson's is the only one that I'm well-versed in.  I don't know if Pennock's market makers have fixed loss like Hanson's.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Short selling relies on the notion of borrowing shares, which is outside the scope of most prediction markets.  When you have a market maker, you can always purchase the securities that represent the opposite outcome to the one you wanted to short, so there's really no need to short sell---another advantage to having a market maker.&lt;/p&gt;&#xA;" OwnerUserId="3588" LastEditorUserId="3588" LastEditDate="2013-01-12T23:11:05.423" LastActivityDate="2013-01-12T23:11:05.423" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5973" PostTypeId="2" ParentId="4943" CreationDate="2013-01-12T11:53:54.580" Score="1" Body="&lt;p&gt;The discount rate that you use to compute the price of the bond is &lt;strong&gt;a parameter that you use during the computation of both types of valuations&lt;/strong&gt; (clean or dirty); it is the rate you use to  discount the cash flows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only difference between clean and dirty price is that the clean price removes the accrued interest since the last coupon. Hence, &lt;strong&gt;the discount rate used for clean price computation should be the same you used as input for the dirty calculation&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2013-01-12T11:53:54.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5974" PostTypeId="2" ParentId="431" CreationDate="2013-01-12T22:23:10.423" Score="5" Body="&lt;p&gt;To brush up on some of the basics, Yale has the following: &lt;a href=&quot;http://oyc.yale.edu/economics&quot; rel=&quot;noreferrer&quot;&gt;http://oyc.yale.edu/economics&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Three of four are financial.&lt;/p&gt;&#xA;" OwnerUserId="2792" LastActivityDate="2013-01-12T22:23:10.423" CommentCount="0" CommunityOwnedDate="2013-01-12T22:23:10.423" ContentLicense="CC BY-SA 3.0" />
  <row Id="5976" PostTypeId="2" ParentId="4936" CreationDate="2013-01-13T05:08:55.713" Score="2" Body="&lt;p&gt;While everyone touched on the subject of short term volatility, I believe Jim Gatheral and Bruno Dupire provides a great explanation about the term structure of volatility. Generally, we see that the ATM implied vol have a term structure roughly of the form $\sqrt{\tau}$ and we see that the term structure of ATM skew has a term structure roughly of the form $a - b\sqrt{\tau}$ where you can get the coefficients from fitting your data. The reason that we see that shorter to maturity options typically are quoted at higher volatility is because of jumps (which is equivalent to &gt; 0 excess kurt). The longer the maturity, the more and more gaussian the gamma of your option is and therefore the jump costs you less. Whereas for short term maturities, the gamma converges to a dirac delta function. This implies that if there were a jump, the slippage is much higher for shorter to maturity functions. &lt;/p&gt;&#xA;" OwnerUserId="3440" LastActivityDate="2013-01-13T05:08:55.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5977" PostTypeId="1" CreationDate="2013-01-13T11:22:14.653" Score="2" ViewCount="3483" Body="&lt;p&gt;I am reading a chapter on bond futures in Fabozzi's book. It states that without CF (conversion factor) the CTD (cheapest to deliver) would be the bond with the longest maturity and highest coupon. Why is this? Higher coupon means higher PV (present value).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone assist?&lt;/p&gt;&#xA;" OwnerUserId="3593" LastEditorUserId="3593" LastEditDate="2013-01-15T07:14:43.823" LastActivityDate="2013-01-17T15:38:42.593" Title="CTD and bond futures" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;present-value&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5978" PostTypeId="2" ParentId="4568" CreationDate="2013-01-13T13:27:22.920" Score="3" Body="&lt;p&gt;For academic references, you will likely have to look in the very early optimization literature.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Uniqueness of the MV portfolio follows immediately from the lemma that a strictly convex function on a convex set has no local minima.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The standard textbook reference is Convex Optimization by Boyd and Vandenberghe. See section 4.2.2 in particular. A free online copy is available at &lt;a href=&quot;http://stanford.edu/~boyd/cvxbook/bv_cvxbook.pdf&quot; rel=&quot;nofollow&quot;&gt;stanford.edu/~boyd/cvxbook/bv_cvxbook.pdf&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2027" LastEditorUserId="2027" LastEditDate="2013-01-15T11:40:49.073" LastActivityDate="2013-01-15T11:40:49.073" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="5980" PostTypeId="2" ParentId="4956" CreationDate="2013-01-13T17:44:35.247" Score="4" Body="&lt;p&gt;The most common transformations you see for these three variables on credit desks is to compute &quot;returns&quot; on the credit variables.  So, rather than taking the straight daily differences $\Delta s_t$ of swap spreads and $\Delta H_t$ of the high yield index (by which I assume here you mean on-the-run CDX HY), practitioners will transform to $\frac{\Delta s_t}{s_t}$ and $\frac{\Delta H_t}{H_t}$. (This works in the case of CDX HY because of the &lt;em&gt;100-upfront&lt;/em&gt; quoting convention).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, there's no good evidence for any particular model of the $\Delta s_t$ and $\Delta H_t$, which means this lognormal-like approach is unsupported by the data, but not really much worse than anything else one might choose.  It has the advantage of providing positive regression coefficients and never sending $s$ below zero, though it can send $H$ above it's theoretical maximum value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you'll find, however, is that over macroscopic periods the credit and equity markets exhibit ``regimes'' of correlation and anticorrelation between equity prices and credit spreads, not least because special dividends, share buybacks and mergers go in and out of fashion. This is easily observable from 2000-2010. Thus, no model you make is going to be particularly trustworthy.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2013-01-13T17:44:35.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5981" PostTypeId="1" AcceptedAnswerId="7033" CreationDate="2013-01-13T22:22:09.117" Score="28" ViewCount="20016" Body="&lt;p&gt;I would like to know if someone could provide a summarized view of the advantages and disadvantages of the approaches on the volatility surface issues, such as:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Local vol &lt;/li&gt;&#xA;&lt;li&gt;Stochastic Vol (Heston/SVI)&lt;/li&gt;&#xA;&lt;li&gt;Parametrization (Carr and Wu approach)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3595" LastEditorUserId="35" LastEditDate="2013-01-14T12:12:40.310" LastActivityDate="2014-11-10T22:09:28.087" Title="What are the advantages/disadvantages of these approaches to deal with volatility surface?" Tags="&lt;volatility&gt;" AnswerCount="5" CommentCount="1" FavoriteCount="33" ContentLicense="CC BY-SA 3.0" />
  <row Id="5982" PostTypeId="1" CreationDate="2013-01-13T22:29:00.350" Score="2" ViewCount="967" Body="&lt;p&gt;What are the approaches available to price a swaption (either European or American style)? So far it seems Black method is the only one used. Thanks!&lt;/p&gt;&#xA;" OwnerUserId="3595" LastActivityDate="2013-01-14T07:02:51.220" Title="Pricing swaptions" Tags="&lt;pricing&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="5984" PostTypeId="2" ParentId="5982" CreationDate="2013-01-14T07:02:51.220" Score="6" Body="&lt;p&gt;The question should not be about the swaption pricing formula, its well established and widely accepted and utilized every single day. The question you SHOULD be asking, however, is which underlying volatility model you are using. Its idential to you questioning the use of B-S in transforming vols -&gt; prices, and prices -&gt; vols in the equity world while you should be asking how to model volatility. In general, you should be thinking about the Brownian motion variables and not deterministic ones when modeling and choosing which model to select in pricing derivatives. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Current going practice to price swaptions is to use the Stochastic Apha, Beta, Rho (SABR) model and its derivatives (such as dynamic SABR,...).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the wiki:&#xA;&lt;a href=&quot;http://en.wikipedia.org/wiki/SABR_volatility_model&quot; rel=&quot;noreferrer&quot;&gt;http://en.wikipedia.org/wiki/SABR_volatility_model&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But more importantly here is the original Hagan paper:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.wilmott.com/pdfs/021118_smile.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.wilmott.com/pdfs/021118_smile.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-01-14T07:02:51.220" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="5985" PostTypeId="2" ParentId="5981" CreationDate="2013-01-14T07:12:55.783" Score="17" Body="&lt;p&gt;I do not have the time right now to write up a summary concise enough but at the same time trying to really touch on all the points that have to be made to delineate the above. Instead I point you to couple papers that are concise enough to skim over in a matter of minutes in order to understand the differences.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Jim Gatheral on Local vs Stoch Vols:&#xA;&lt;a href=&quot;http://www.math.ku.dk/~rolf/teaching/ctff03/Gatheral.1.pdf&quot;&gt;http://www.math.ku.dk/~rolf/teaching/ctff03/Gatheral.1.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here a great paper that touches on pretty much all the models out there (the widely published ones obviously):&#xA;&lt;a href=&quot;http://wiredspace.wits.ac.za/bitstream/handle/10539/1495/lisa.pdf;jsessionid=CD3D69EBEFFD957D0B7BB5293E92C7DA?sequence=1&quot;&gt;http://wiredspace.wits.ac.za/bitstream/handle/10539/1495/lisa.pdf;jsessionid=CD3D69EBEFFD957D0B7BB5293E92C7DA?sequence=1&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, stochastic and parameterized models are often not clearly divided, there are a number of stochastic vol models that use parameterization and calibration techniques. What you may want to instead focus on is on what kind of volatility the model is based, for example, unobserved integrated volatility or instantaneous volatility. &lt;strong&gt;Also you want to really focus on the volatility dynamics and whether the dynamics of a certain model correspond with the observed market dynamics. This very reason was one of the major reasons the SABR model came about.&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just my two cents ;-)&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-01-14T17:20:09.020" LastActivityDate="2013-01-14T17:20:09.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="5986" PostTypeId="2" ParentId="5977" CreationDate="2013-01-14T07:24:05.133" Score="2" Body="&lt;p&gt;First, I am not sure which exact statement was made. Also, you cannot just say &quot;without CF&quot; because you are essentially creating an artificial market with messed-up utility. In summary the cheapest-to-deliver bond is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The bond that results in the smallest loss or greatest profit for the futures seller.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Futures sellers have to buy the bonds they are going to deliver against the contract. So, it is the bond with the lowest price relative to the invoice price. You see, you do not get around applying conversion factors if you really want to figure out the CTD bond. There is no &quot;CFD do not apply here&quot; type of argument. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But to come to your question, to say &quot;It states that without CF (conversion factor) the CTD (cheapest to deliver) would be the bond with the longest maturity and highest coupon.&quot; &lt;strong&gt;is definitely incorrect&lt;/strong&gt;. I highly doubt this is what Fabozzi ever said, either it was a very bad typo or you misunderstood. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-01-14T07:24:05.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6984" PostTypeId="2" ParentId="5981" CreationDate="2013-01-14T20:19:10.910" Score="14" Body="&lt;p&gt;I can comment since Jim Gatheral is actually my mentor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The advantages and disadvantages of Stochastic Vol, Local Vol and Parameterized Vol really depends on what you are using it for. If you are using it to price exotic options, Stochastic vol is generally a more accepted principle than local vol. The reason because stochastic vol assumes time homogenous volatility surfaces whereas local vol assumes that the forward vol skew that you calculate today is what the vol skew will look like in the future + some stochastic term. Parameterized vol is generally recommended to use to price VIX options/variance swaps as well as for market makers. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One example to show the difference between local vol and stochastic vol is to hedge a one touch option which is the equivalent to a american binary option. The hedge for this would be to buy a call spread maturing shortly and keep buying the call spread until the one touch expires or it is exercised. Because we assume the atm skew in the future will be what we see the forward skew today in local vol, the price will be lower for the call spread. Whereas under stochastic vol, we assume the atm skew today is what we will see in the future, therefore, the price of the call spread will be more expensive under stochastic vol than local vol. &lt;/p&gt;&#xA;" OwnerUserId="3440" LastActivityDate="2013-01-14T20:19:10.910" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="6985" PostTypeId="2" ParentId="2355" CreationDate="2013-01-14T21:06:26.650" Score="2" Body="&lt;p&gt;I think the definition that the CME has is not what is mentioned here.  The pricing is actually occurring on the spread value (between two DIFFERENT underlying futures).  Therefore, you can have negative strikes and negative underlying values as inputs into you pricing model equation.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't think it's as simple as pricing two separate expirations with same strike and underlying.&lt;/p&gt;&#xA;" OwnerUserId="4598" LastActivityDate="2013-01-14T21:06:26.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6986" PostTypeId="1" CreationDate="2013-01-15T03:14:56.453" Score="1" ViewCount="218" Body="&lt;p&gt;Among the several weighting schemes used for constructing volatility indices, which ones are the best for forecasting (realized) volatility? I've constructed a volatility index for emerging markets using a (very simple) trade-weighted approach, which has 84% correlation with the VIX (2007-2012). The construction procedure is much more simple, and I'm still running my regression analysis, so I can't say yet which one has better predicting power.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After reading some articles I've seen lots of critics to the VIX methodology. Is the VIX methodology the best one or there are competitive alternatives for weighting schemes?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;TY&lt;/p&gt;&#xA;" OwnerDisplayName="user3596" LastActivityDate="2013-01-15T03:41:38.640" Title="Volatility Index Weighting Scheme" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;index&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6987" PostTypeId="2" ParentId="6986" CreationDate="2013-01-15T03:41:38.640" Score="2" Body="&lt;p&gt;Just couple points to ponder about:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Weighting schemes are not a magic bullet and none of them in isolation will give you higher predictive power (aka. edge). Do not rely on how you weigh components. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Why would you want to be highly correlated with VIX? Its a poorly constructed index and I find the whole rational behind the implementation details quite questionable. VIX has a very low predictive power. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Markets are dynamic, most surely weights change, predictive power changes as everything else does: I encourage you to look a lot deeper than just how index components are weighted. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-01-15T03:41:38.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6988" PostTypeId="1" AcceptedAnswerId="6990" CreationDate="2013-01-15T08:11:01.590" Score="33" ViewCount="7376" Body="&lt;p&gt;In quantitative finance, we know we have a lot of option price models such as geometric Brownian motion model (Black-Scholes models), stochastic volatility model (Heston), jump diffusion models and so on, my question is how can we use these models to make money in practice?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My comments: Because we can read option price from the market, by these models (Black-Scholes), we can get the implied volatility, then we may use this implied volatility to compute other exotic option price, then we can make money by selling/buying this exotic option as a market maker, is this the only way to make money? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For stocks, we know that if we have a better model to predict future stock prices, then we can make money, but for option, it seems that we didn't use these models to predict the future option prices? so how can we make money with these models?&lt;/p&gt;&#xA;" OwnerUserId="4601" LastEditorUserId="467" LastEditDate="2013-01-15T10:42:30.427" LastActivityDate="2020-12-09T18:34:58.630" Title="How do we use option price models (like Black-Scholes Model) to make money in practice?" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;models&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="25" ContentLicense="CC BY-SA 3.0" />
  <row Id="6990" PostTypeId="2" ParentId="6988" CreationDate="2013-01-15T09:23:36.757" Score="36" Body="&lt;p&gt;In general there are two basic ways to make money out of your option pricing models:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sell side (market maker, risk neutral): You use these models to calculate your greeks to hedge your portfolio, so that you live on the spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Buy side (market/risk taker): You use your model to find mispriced options in the market and buy/sell accordingly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(A third possibility would be to write fancy books and papers about these models and get rich and/or tenure this way ;-)&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2013-01-15T09:51:45.550" LastActivityDate="2013-01-15T09:51:45.550" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="6991" PostTypeId="1" CreationDate="2013-01-15T10:06:03.837" Score="1" ViewCount="1173" Body="&lt;p&gt;In technical analysis, we may use confluence of direction for 3 timeframes to roughly gauge bias of market now.&#xA;Similarly, if we use time series forecasting methods to predict(say daily data-whether S&amp;amp;P is going higher tomorrow), how much historical daily data would be optimal(bet 2 weeks-1month-3 months)? Too much or too little past data does not give accurate prediction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) generate results in 5 days intervals(within 3 months) until you get the best interval prediction that is closest to yesterday's closing value...Then use this interval for predicting tomorrow's close?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) combine 3 months forecasting and backcasting(reverse data) until there is a result that coincides...then use this day as starting reference point for forecasting?&#xA;&lt;a href=&quot;http://www.spiderfinancial.com/support/documentation/numxl/tips-and-tricks/backward-forecast&quot; rel=&quot;nofollow&quot;&gt;http://www.spiderfinancial.com/support/documentation/numxl/tips-and-tricks/backward-forecast&lt;/a&gt;&#xA;http://pakaccountants.com/what-is-backcasting-and-difference-forecasting/&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other suggestions?&lt;/p&gt;&#xA;" OwnerUserId="3085" LastEditorUserId="3085" LastEditDate="2013-01-15T13:10:54.770" LastActivityDate="2013-01-15T13:10:54.770" Title="Selecting timeframe for time series analysis" Tags="&lt;time-series&gt;&lt;quant-trading-strategies&gt;&lt;trading&gt;&lt;forecasting&gt;&lt;prediction&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="6992" PostTypeId="2" ParentId="692" CreationDate="2013-01-15T10:12:21.693" Score="3" Body="&lt;p&gt;Fourier Transform seems a good method for option pricing by take advantage of Fast Fourier Transform technique, such as the following paper written by Peter Carr and Dilip B. Madan: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://portal.tugraz.at/portal/page/portal/Files/i5060/files/staff/mueller/FinanzSeminar2012/CarrMadan_OptionValuationUsingtheFastFourierTransform_1999.pdf&quot; rel=&quot;nofollow&quot;&gt;http://portal.tugraz.at/portal/page/portal/Files/i5060/files/staff/mueller/FinanzSeminar2012/CarrMadan_OptionValuationUsingtheFastFourierTransform_1999.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="4601" LastActivityDate="2013-01-15T10:12:21.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="6993" PostTypeId="2" ParentId="6988" CreationDate="2013-01-15T12:10:13.487" Score="16" Body="&lt;p&gt;Agree with all of vonjd's points though I like to add the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;First of all, market practitioners do not read options prices or set options prices in the market, they price the option through models primarily on the basis of implied volatility. Im plied volatility is actually traded, options prices is what comes out on the other side. I know there was a discussion in which some others disagreed with such notion but just imagine you are to trade a listed index option written on the Nikkei 225 index. How do you know whether the March 2013, 10500 put is correctly priced at 300 yen, or 5000 yen or 10 yen? My point is you dont know until you make implied volatility your starting point. You know that Nikkei 225 2-3 month implied vols certainly do not trade at 50 right now, not 30, but more like in the 12-20 range. You form an opinion where the implied vol should specifically lie and then price the option using a translation tool such as B-S. That is how most all market practitioners trade options. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So you need to strictly differentiate between volatility modeling tools and on the other side option pricing models. Each model is more applicable to certain asset classes than others which is why you have different models in the first place. Also, you may have a different opinion on how implied vols drive the option price or form certain opinions about other dynamics and thus chose a model that fits your mindset or alter certain models and customize one to fit your style. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do you make money with such models? Well as I said you need to make sure you delineate volatility forecasting and modeling tools from pricing tools. If you are better at forecasting volatility than others then you have a clear edge in this market. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But at the same time it can also happen that different pricing tools make the difference between someone making 20-50 million USD a year and someone who barely breaks even: Because of the non-linearity of derivatives (but also because of other factors), different models do give you different prices even you plug in the same implied volatility. Its harder to make a difference in plain vanilla products but it can make a huge difference when you price exotic derivatives. Such exotics are places where it really shows whether a trader and quant group truly understands how to model and calculate the standard greeks and higher order moments. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to start with the basic tenet that what you see on the screen is not an efficient market, thus there are times when the prices you see are away from fair value because a) people use imperfect models to translate vols -&gt; prices, and b) because people input poorly determined implied vols into their machines. That is what makes the difference between someone making and the other losing money&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-01-15T12:10:13.487" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="6995" PostTypeId="2" ParentId="6991" CreationDate="2013-01-15T12:20:12.687" Score="2" Body="&lt;p&gt;You should never start out asking how much data you should incorporate in your research effort. You should start with the following points:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Make sure you understand the difference between sampling size to specify your model and data used to run back tests over. Those are entirely different animals. &lt;/li&gt;&#xA;&lt;li&gt;First, think about your end goal, what are you trying to achieve. Do you look to develop a high frequency trading model? If yes it makes no sense to incorporate price intelligence from 1 month ago. &lt;/li&gt;&#xA;&lt;li&gt;What dynamics are you trying to capture? If you look to trade market cycles then you want to incorporate the amount of data that covers different market cycles.&lt;/li&gt;&#xA;&lt;li&gt;What type of data are you trying to analyze? Tick, compressed, bid/ask vs. trades, order book dynamics? &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;When you answer those question you should most likely have a very good idea how much data you need, at what frequency. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-01-15T12:20:12.687" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="6996" PostTypeId="2" ParentId="5981" CreationDate="2013-01-15T13:55:48.383" Score="8" Body="&lt;p&gt;The best overview I have seen so far (in terms of theory AND practicality) is in&lt;br&gt;&lt;a href=&quot;http://books.google.de/books/about/Paul_Wilmott_on_Quantitative_Finance_3_V.html?id=xKpOlK2oHKwC&amp;amp;redir_esc=y&quot;&gt;Paul Wilmott On Quantitative Finance Second Edition&lt;/a&gt;, pp. 826 - 830:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find the start: &lt;a href=&quot;http://books.google.de/books?id=Y_R3Y4jkp_IC&amp;amp;lpg=PA826&amp;amp;ots=5d9M9npkvZ&amp;amp;dq=%22Much%20of%20the%20rest%20of%20this%20part%20of%20the%20book%20focuses%20on%20sophisticated%22&amp;amp;pg=PA826#v=onepage&amp;amp;q=%22Much%20of%20the%20rest%20of%20this%20part%20of%20the%20book%20focuses%20on%20sophisticated%22&amp;amp;f=false&quot;&gt;Here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;...and the closing overview and summary: &lt;a href=&quot;http://books.google.de/books?id=r3JLiQMxifYC&amp;amp;lpg=PA221&amp;amp;ots=J_XpiFq2vo&amp;amp;dq=%22Derivatives%20are%20all%20about%20volatility%22&amp;amp;pg=PA221#v=onepage&amp;amp;q=%22Derivatives%20are%20all%20about%20volatility%22&amp;amp;f=false&quot;&gt;Here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Unfortunately I haven't found the whole excerpt on the web but I would be happy to include a link in this answer [as long as it is referring to a legal copy] - just let me know in the comments).&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2013-01-15T13:55:48.383" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="6997" PostTypeId="1" AcceptedAnswerId="7001" CreationDate="2013-01-15T14:25:57.533" Score="4" ViewCount="823" Body="&lt;p&gt;Can anyone tell me whether results as predicted by Brownian Motion for a given mean and std, match what you get by measuring actual drawdown from simulated results over a number of iterations?&lt;/p&gt;&#xA;" OwnerUserId="4603" LastActivityDate="2018-10-05T06:03:47.653" Title="Comparison of Brownian Motion Expected Drawdown and simulated results" Tags="&lt;brownian-motion&gt;&lt;maximum-drawdown&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="6998" PostTypeId="2" ParentId="6997" CreationDate="2013-01-15T16:26:04.013" Score="3" Body="&lt;p&gt;Take a look at the following paper about the Maximum Drawdown distribution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://alumnus.caltech.edu/~amir/drawdown-jrnl.pdf&quot; rel=&quot;nofollow&quot;&gt;On the Maximum Drawdown of a Brownian Motion&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The authors end up with an approximative series for the density. It is implemented in the function &lt;em&gt;maxdd&lt;/em&gt; of the R-package &lt;em&gt;fBasics&lt;/em&gt;. There are convenient functions &lt;em&gt;dmaxdd&lt;/em&gt;, &lt;em&gt;pmaxdd&lt;/em&gt; and &lt;em&gt;rmaxdd&lt;/em&gt;. Calculating the Expected Drawdown should be easy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just compare your results with the output of this package (mean, quantiles, etc.) and you should be fine. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually, there is no need to &quot;simulate&quot; drawdowns of a brownian motion then - just take random samples with &lt;em&gt;rmaxdd&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you say &quot;match&quot; or &quot;close&quot; you probably mean that the means converge if sample size increases?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the law of large numbers, the means of the sampled maximum drawdowns will converge to the expected maximum drawdown (although convergence maybe slow - expecially if the distribution does not have finite variance). Actually, the empirical distributions &quot;approach&quot; the maximum drawdown distribution.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastEditorUserId="2727" LastEditDate="2013-01-16T08:42:07.040" LastActivityDate="2013-01-16T08:42:07.040" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="6999" PostTypeId="1" CreationDate="2013-01-15T16:26:55.237" Score="3" ViewCount="922" Body="&lt;p&gt;I have a binomial option-pricing model (I don't think the details of how its implemented are relevant). However, when I go to calculate &lt;em&gt;vega&lt;/em&gt;, I am essentially running the model a second time with new volatility input we call $\sigma + \epsilon$, where $\sigma$ is the volatility used to calculate the price. I then have two prices $p1$ and $p2$, the first of which is a function of $\sigma$, and the second a function of $\sigma + \epsilon$. I then calculate &lt;em&gt;vega&lt;/em&gt; to be $\frac{(p2 - p1)}{\epsilon}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm having trouble coming up with a good value of $\epsilon$ to avoid floating-point underflows and overflows in the resulting calculation. Any suggestions on how to choose it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some things that I have available to me at the time of the choice of $\epsilon$:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;expiration&lt;/li&gt;&#xA;&lt;li&gt;strike&lt;/li&gt;&#xA;&lt;li&gt;volatility&lt;/li&gt;&#xA;&lt;li&gt;risk-free rate&lt;/li&gt;&#xA;&lt;li&gt;underlying price&lt;/li&gt;&#xA;&lt;li&gt;current time&lt;/li&gt;&#xA;&lt;li&gt;option price (as calculated by my model)&lt;/li&gt;&#xA;&lt;li&gt;delta (as calculated by my model)&lt;/li&gt;&#xA;&lt;li&gt;gamma (as calculated by my model)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="4605" LastEditorUserId="35" LastEditDate="2013-01-16T14:02:50.243" LastActivityDate="2013-03-17T22:42:28.700" Title="Choice of epsilon for numerical calculation of vega in binomial option pricing model" Tags="&lt;options&gt;&lt;option-pricing&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7000" PostTypeId="1" CreationDate="2013-01-15T16:35:58.613" Score="3" ViewCount="9288" Body="&lt;p&gt;I've always wondered why do one use squared or absolute returns to determine if volatility modeling is required for the return series? We understand that there are various tests for its autocorrelation and conditional heteroskedasticity. However, I don't quite grasp the concept behind it. Can anyone kindly explain what's the statistical intuition behind using squared/abs returns to determine if vol representation is needed? Thank you.&lt;/p&gt;&#xA;" OwnerUserId="3586" LastActivityDate="2020-03-24T17:45:37.887" Title="Squared and Absolute Returns" Tags="&lt;volatility&gt;&lt;time-series&gt;&lt;statistics&gt;&lt;auto-correlation&gt;&lt;stationarity&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7001" PostTypeId="2" ParentId="6997" CreationDate="2013-01-15T16:52:21.617" Score="1" Body="&lt;p&gt;Its very simple, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of Brownian Motion (a.k.a. Wiener process in Mathematics) properties is that each increment from s-&gt;t is normally distributed with mean = 0 and sd = t-s.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, if the process that drives your simulated results is ~N(0, t-s) distributed for each increment s-&gt;t with 0&amp;lt;=s&amp;lt;=t then yes, your simulated draw downs should match the ones predicted by a Wiener process (one which is driven by a Brownian Motion). Otherwise, it is not. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-01-15T16:52:21.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7003" PostTypeId="2" ParentId="7000" CreationDate="2013-01-15T18:04:55.237" Score="6" Body="&lt;p&gt;To simplify, consider the errors rather than the returns. The variance is effectively the average of the squared errors, while absolute deviation is the average of the absolute errors. So plotting the squared errors or absolute errors over time could give an indication of whether the variance or absolute deviation is constant over time. Since variance is more commonly the practical focus, one approach would be to simply regress the squared errors on p of its lags. This is the ARCH(p) model. GARCH(p,q) introduces an additional term, which has the effect of reducing the need of p to be large.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2013-01-15T18:04:55.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7006" PostTypeId="1" CreationDate="2013-01-16T01:44:43.500" Score="12" ViewCount="883" Body="&lt;p&gt;I have been looking into ways to better understand how the dependencies/correlations/etc between two time series can vary over time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I first thought about using a Kalman/particle filter over a linear model to get a time-varying slope estimate. However, I'm worried that this will also pick up changing relative variances between the two time series and an increasing slope estimate doesn't actually mean a stronger relationship between the two time-series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have looked into time-varying quantile regression but am unconvinced that a changing slope parameter means much, even if it accounts for asymmetry over the various quantiles. The same thing goes for the new &lt;a href=&quot;http://econ.la.psu.edu/~hbierens/TVCOINT.PDF&quot;&gt;time-varying cointegration&lt;/a&gt; technology.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have other reservations about DCC-GARCH because to the best of my knowledge it's a time-varying estimate of the Pearson estimator and is therefore not able to pick up non-linear dependencies (since it's essentially the time-varying square root of the $R^2$ of a linear regression). I'm concerned that the DCC-GARCH correlation estimate might decrease because linear dependencies are reducing, even if non-linear dependencies are increasing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what else is there and how can it help me to pick up the time-varying dependencies between two time series that accounts for both linear and non-linear relationships? Something like a time-varying Kendall tau or time-varying mutual information would be nice.&lt;/p&gt;&#xA;" OwnerUserId="3174" LastEditorUserId="3174" LastEditDate="2013-01-16T03:49:32.437" LastActivityDate="2016-01-22T22:49:47.560" Title="Alternative ways to understand time-varying comovement between two time-series?" Tags="&lt;time-series&gt;&lt;correlation&gt;&lt;cointegration&gt;&lt;relationship&gt;&lt;dependence&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7007" PostTypeId="2" ParentId="7000" CreationDate="2013-01-16T02:48:02.753" Score="4" Body="&lt;p&gt;Simple...because you are interested in deviations from a metric, and not whether it deviates above or below. The very definition of volatility is a &quot;measure of deviation&quot;. Squaring returns or using the absolute values just eases the calculation to arrive at a deviation measure. Otherwise volatility would have to be calculated in other ways as positive and negative returns would introduce side effects that will affect the volatility computation.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-01-16T02:48:02.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7008" PostTypeId="2" ParentId="5964" CreationDate="2013-01-16T02:54:06.867" Score="1" Body="&lt;p&gt;In Oracle Crystal Ball (or in a few other Excel based MC simulation add-ins), we can do this without much hassle: define $k$ normal distribution and $m$ gamma distributions. Define (or load) the correlation matrix $\Sigma$ and then generate the random variates. Each trial run would give you one random vector $z$ of dimension $k+m$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We use normal copula to generate correlated random numbers from risk distributions in Oracle Crystal Ball. &lt;/p&gt;&#xA;" OwnerUserId="1442" LastActivityDate="2013-01-16T02:54:06.867" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7009" PostTypeId="2" ParentId="6999" CreationDate="2013-01-16T19:51:36.840" Score="2" Body="&lt;p&gt;Let $\beta$ denote the relative machine precision, usually $\beta = 1E-16$. Assume the you can evaluate the value V up to precision $\alpha$. The best you can get is $\alpha = \beta \cdot V$ if $V$ is not underflow or overflow.&#xA;Then you can calculate the finite difference up to precision $4 \alpha / \epsilon$ (the 4 might be a rough estimate, but it comes from the fact that there may be an additional cancelation in the finite difference of relative order $\beta$ and we use $\alpha &amp;gt; \beta \cdot V$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus you can calculate the finite difference up to  $4 \alpha / \epsilon$.&#xA;On the other hand, from Taylor expansion, the approximation error of a finite difference is $C \epsilon$, where $C$ is a bound on the second derivative. The best choice of $\epsilon$ is the minimum of $\epsilon \mapsto 4 \alpha / \epsilon + C \epsilon$, which is attained for $-4\alpha/\epsilon^2 + C = 0$, i.e. $\epsilon = 2 \cdot \sqrt{\alpha/C}$. If your tree achieves machine accuracy, i.e., $\alpha = \beta V$, then you should choose&#xA;$\epsilon = 2 \sqrt{\frac{V}{V''}} \cdot \sqrt{\beta} = 2 \sqrt{\frac{V}{V''}} 1E-8$. In the last equation V denote &quot;the order of magnitude of the value and $V''$ the order of magnitude of the second derivative. Clearly, if the second derivative is small, you can use larger shifts.&lt;/p&gt;&#xA;" OwnerUserId="3548" LastEditorUserId="3548" LastEditDate="2013-01-16T22:02:01.267" LastActivityDate="2013-01-16T22:02:01.267" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7010" PostTypeId="7" CreationDate="2013-01-16T20:42:23.177" Score="0" Body="&lt;ul&gt;&#xA;&lt;li&gt;securities valuation&lt;/li&gt;&#xA;&lt;li&gt;risk modeling&lt;/li&gt;&#xA;&lt;li&gt;market microstructure&lt;/li&gt;&#xA;&lt;li&gt;portfolio management&lt;/li&gt;&#xA;&lt;li&gt;financial engineering&lt;/li&gt;&#xA;&lt;li&gt;econometrics&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="-1" LastEditorUserId="967" LastEditDate="2013-01-16T20:42:23.177" LastActivityDate="2013-01-16T20:42:23.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7013" PostTypeId="1" AcceptedAnswerId="7014" CreationDate="2013-01-17T02:00:34.733" Score="3" ViewCount="1124" Body="&lt;p&gt;Should I include or not the days a strategy has no open positions (thus no returns) in the Sharpe ratio calculation?&lt;/p&gt;&#xA;" OwnerUserId="2257" LastActivityDate="2014-07-15T15:47:15.363" Title="Sharpe ratio in days with no open positions" Tags="&lt;sharpe-ratio&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7014" PostTypeId="2" ParentId="7013" CreationDate="2013-01-17T03:09:04.820" Score="5" Body="&lt;p&gt;No, don't include them. Otherwise you'll just wind-up with zero-value returns (or worse, forward-filled returns), which will make your Sharpe ratio reflect a performance that didn't actually occur.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2013-01-17T03:09:04.820" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7015" PostTypeId="1" AcceptedAnswerId="7017" CreationDate="2013-01-17T03:10:41.193" Score="12" ViewCount="1413" Body="&lt;p&gt;I am a one-man operation, and would like to hire a quant for around 4 weeks or work.  I am worried that the person I hire might copy my data or the indicators that I have him work on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What have others done to protect their assets from re-use by employees and contractors?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additional info:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I work from home, so not able to provide a locked-down PC/environment.&lt;/li&gt;&#xA;&lt;li&gt;I don't need to give them access to code, but to very particular historical data that can't be acquired anywhere else, in which I've identified opportunities that need further refinement.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Maybe my only option is to use the quant to educate me... &quot;if I have X and Y, how would I produce Z?&quot;  Painful for both me and the quant.&lt;/p&gt;&#xA;" OwnerUserId="4611" LastEditorDisplayName="user13444" LastEditDate="2019-01-26T18:26:05.683" LastActivityDate="2019-01-26T18:26:05.683" Title="When hiring a quant, how can I protect my IP?" Tags="&lt;data&gt;&lt;historical-data&gt;" AnswerCount="7" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7016" PostTypeId="2" ParentId="7015" CreationDate="2013-01-17T04:33:33.533" Score="3" Body="&lt;p&gt;Non-Disclousre agreement? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;if your really paranoid you can try&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Using a computer with no internet access?&lt;/li&gt;&#xA;&lt;li&gt;not allowing use of a personal computer? &lt;/li&gt;&#xA;&lt;li&gt;Using a modified compiler and or proprietary libraries/API?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="1764" LastEditDate="2013-01-17T04:38:47.543" LastActivityDate="2013-01-17T04:38:47.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7017" PostTypeId="2" ParentId="7015" CreationDate="2013-01-17T04:50:36.733" Score="10" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Non-disclosure agreements work on the legal side but not in reality, no agreement prevents someone with intent to still steal code or ideas. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Protect core code in obfuscated code bases, through APIs installed on the local machine or have it on a server that others do not have access to to and provide access through function calls.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Make sure the local machine does not have any hardware access to the hard drive, other storage media, and no open USB ports&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Install monitoring software to gauge what the user is doing&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Install web surfing web site blocking service in order to prevent users from uploading things (though this only works in well capitalized IT and compliance departments where there is staff that constantly updates the filters. Better to just disable internet access. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Some are in my opinion radical measures, I recommend you pay more attention to whom you actually hire. And above all, only expose the resources to someone that this person really needs. No access to other drive folders, no access to code bases unless that person really needs it for his/her core work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; &#xA;What often works for me (for coding projects) is to hire people with zero knowledge of financial markets. This obviously only applies to projects where such domain knowledge is not needed. Someone without knowledge nor motivation to lay praying eyes on your strategy code or ideas has much less incentive to steal than someone who is closely connected to this industry and may know people who could potentially capitalize on your ideas and code.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-01-17T16:15:15.817" LastActivityDate="2013-01-17T16:15:15.817" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7018" PostTypeId="2" ParentId="7013" CreationDate="2013-01-17T04:54:28.747" Score="3" Body="&lt;p&gt;If you really think about the actual meaning of Sharpe ratios then you should come to the right conclusion yourself:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It is a measure of excess risk-adjusted return (whether realized or unrealized) &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In that you obviously only want to calculate actual returns. You do not have any actual returns on days with no open positions. Hence, why would you want to include such days?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;=&gt; The core thought here is to only measure the nature of the returns not whether returns occurred or not. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-01-18T06:23:38.060" LastActivityDate="2013-01-18T06:23:38.060" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7020" PostTypeId="2" ParentId="5977" CreationDate="2013-01-17T15:38:42.593" Score="2" Body="&lt;p&gt;The conversion factor associated with each bond the futures' delivery basket is constructed such that the invoice prices of the bonds are identical &lt;em&gt;under the assumption that the yield curve is flat at the level of the futures' notional coupon&lt;/em&gt;. Therefore, the bond with the highest duration will be the CTD when yields are above the notional coupon and the bond with the lowest duration will be the CTD when yields are below the notional coupon. (In reality, bonds are rich or cheap vis-a-vis the yield curve--e.g., an on-the-run bond may be several basis points rich to an older bond with identical maturity and coupon--so there other factors that come into play as well, but duration is usually the dominant factor.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This doesn't directly answer your question, which I believe to be confused. But I think it might answer the question that you really want to ask.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ignoring the conversion factors / invoice prices, I don't know why you or Fabozzi would think that &quot;the bond with the longest maturity and highest coupon&quot; would be cheapest. For two bonds with identical coupons, the longer maturity bond will be cheaper; for two bonds with identical maturity, the bond with the higher coupon will be more expensive. The two properties are offsetting so there is absolutely no reason to conclude that the bond with the longest maturity and the highest coupon would be cheapest. &lt;/p&gt;&#xA;" OwnerUserId="3088" LastActivityDate="2013-01-17T15:38:42.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7022" PostTypeId="2" ParentId="2330" CreationDate="2013-01-17T21:30:11.870" Score="6" Body="&lt;p&gt;I think an extremely interesting strand of research on this topic is represented by extensions of vine copulas with time-varying parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For vine copulas in general have a look at this site from the Technische Universität München:&lt;br&gt;&#xA;&lt;a href=&quot;http://www-m4.ma.tum.de/en/research/vine-copula-models/&quot; rel=&quot;nofollow&quot;&gt;Vine Copula Models&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of their research projects, which is the most relevant in this context, is:&lt;br&gt;&lt;a href=&quot;http://www-m4.ma.tum.de/forschung/projekte/project-stoeber/&quot; rel=&quot;nofollow&quot;&gt;Time varying vine copula models&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is well worth keeping an eye on since they implement their research models in R, concerning the current status of the implementation please have a look at this presentation here:&lt;br&gt;&#xA;&lt;a href=&quot;http://www-m4.ma.tum.de/fileadmin/w00bdb/www/veranstaltungen/CDVine_presentation.pdf&quot; rel=&quot;nofollow&quot;&gt;CDVine: An R-package for statistical inference of C- and D-vines&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll find the respective package CDVine on CRAN: &lt;a href=&quot;http://cran.r-project.org/web/packages/CDVine/index.html&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The vignette can be found in the &lt;a href=&quot;http://www.jstatsoft.org/v52/i03&quot; rel=&quot;nofollow&quot;&gt;Journal of Statistical Software&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;(I will update this post when the new code for the time-varying parameters becomes available.)&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2013-02-03T14:22:58.573" LastActivityDate="2013-02-03T14:22:58.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7023" PostTypeId="2" ParentId="998" CreationDate="2013-01-18T13:25:26.477" Score="10" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;There is no secret sauce!&quot;&#xA;  - Inside the Black Box: The Simple Truth About Quantitative Trading, by Rishi K.Narang&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In this book, which is well worth reading to get a good conceptual overview of the different components of a quant trading system, the author tells about &quot;one of the most successful&quot; quant funds hiring only the best academic researchers and outperforming competitors every year. However, he claims (by quoting a former employee of the fund if I am not mistaken) that what makes the fund so profitable is the constant and meticulous improvement of every aspect of the system. From technological aspects such as hardware and software platforms, to extremely well researched parts of the system which others may not traditionally focus greatly on. Of course, they have a rock solid alpha model, but order execution algorithms, data streams/cleaning processes, and transaction cost models are considered (at least) equally important. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The point being made by the author is in other words that the strategy itself, although naturally very advanced and &quot;top-notch&quot;, is merely one part of a very well oiled machinery where extreme focus is put by every single component, to shape something that is bigger than the sums of the individual constituents.&lt;/p&gt;&#xA;" OwnerUserId="3383" LastActivityDate="2013-01-18T13:25:26.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7024" PostTypeId="1" AcceptedAnswerId="7028" CreationDate="2013-01-18T16:56:52.323" Score="3" ViewCount="188" Body="&lt;p&gt;I need to generate one-minute bars out of one-day bars to test the performance of an algorithm (speed, memory usage, etc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't need them to resemble real data, but they should be consistent with the one-day bars (e.g. the higher price of any of the minute bars for a day is the same as the high price of the one-minute bars, etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="2257" LastActivityDate="2013-01-20T12:31:08.263" Title="How to simulate one-minute bars data from one-day bars?" Tags="&lt;algorithm&gt;&lt;price&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7025" PostTypeId="1" CreationDate="2013-01-18T19:37:24.110" Score="2" ViewCount="3674" Body="&lt;p&gt;This &lt;a href=&quot;http://www.ericbenhamou.net/documents/Encyclo/volga.pdf&quot; rel=&quot;nofollow&quot;&gt;source (PDF)&lt;/a&gt; gives the closed-form for vomma (or volga, i.e. the second derivative of price w.r.t. volatility) of the Black Scholes option pricing model as: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S_{0}e^{-qT}\sqrt{T}\frac{1}{\sqrt{2\pi}}e^{-\frac{d_{1}^{2}}{2}}\frac{d_{1}d_{2}}{\sigma}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d_{1} = \frac{ln(S_{0}/K)+(r-q)T + \sigma^{2}/2T}{\sigma\sqrt{T}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d_{2} = \frac{ln(S_{0}/K)+(r-q)T - \sigma^{2}/2T}{\sigma\sqrt{T}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Two questions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Is this correct?  Please provide additional source and/or proof. &lt;/li&gt;&#xA;&lt;li&gt;What is $q$? (it's not defined in the referenced document)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: I think there's a missing set of parentheses around $\sigma^{2}/2$ in the formulas for $d_{1}$ and $d_{2}$.  E.g. $d_{1}$ should be&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d_{1} = \frac{ln(S_{0}/K)+(r-q)T + (\sigma^{2}/2)T}{\sigma\sqrt{T}}$$&lt;/p&gt;&#xA;" OwnerUserId="4605" LastEditorUserId="4605" LastEditDate="2013-01-22T15:54:48.693" LastActivityDate="2013-04-22T17:04:06.763" Title="How to calculate Vomma of Black Scholes model" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;greeks&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7026" PostTypeId="1" CreationDate="2013-01-18T21:08:36.873" Score="5" ViewCount="426" Body="&lt;p&gt;I am using the paper &quot;A Sharper Angle on Optimization&quot; by Golts and Jones (2009) as a basis for my (minor) masters thesis in mathematical finance. The paper focuses on the mean-variance analysis of Markowitz but instead turns attention to the vector geometry of the returns vector and vector of resultant portfolio weights.  As it is a working paper, most of the concepts are not elaborated on well enough to make sense or for one to implement by him/herself.  The paper may be accessed on this link: &lt;a href=&quot;http://ssrn.com/abstract=1483412&quot; rel=&quot;nofollow&quot;&gt;http://ssrn.com/abstract=1483412&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the ideas I am struggling with is the angle between the returns vector and vector of weights and how this angle can be related to the condition number of the covariance matrix.  The authors then employ robust optimization techniques to control this angle (i.e. minimize it) to obtain more intuitive investment portfolios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The authors state that the angle between the returns and positions vector, call it $\omega$,  is bounded from below as:&#xA;$\cos(\omega)=\frac{\alpha^{T}\Sigma^{-1}\alpha}{\sqrt{\alpha^{T}\alpha}\sqrt{\alpha^{T}\Sigma^{-2}\alpha}} \geq \frac{\theta_{\max}\theta_{\min}}{(\theta_{\max}^{2}+\theta_{\min}^{2})/2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\alpha$ is the vector of returns and $\Sigma$ is the covariance matrix with spectral decomposition given by  $\Sigma=Q^{T}\mbox{diag}(\theta_{1}^{2},...,\theta_{n}^{2})Q$ where $\theta_{1}^{2} \geq \theta_{2}^{2} \geq ... \geq \theta_{n}^{2} &amp;gt; 0$ are the eigenvalues in decreasing order and where we let $\theta_{\max}^{2}=\theta_{1}^{2}$ and $\theta_{\min}^{2}=\theta_{n}^{2}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If anyone has any ideas on how the authors may have arrived at this, as well as what it means graphically, I would really appreciate it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="4618" LastEditorUserId="4618" LastEditDate="2013-01-20T21:20:59.707" LastActivityDate="2013-01-20T21:20:59.707" Title="Analyzing the angle between vector of weights and vector of returns in mean-variance optimization" Tags="&lt;portfolio-management&gt;&lt;optimization&gt;&lt;covariance&gt;&lt;mean-variance&gt;&lt;eigenvalue&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7027" PostTypeId="1" AcceptedAnswerId="7030" CreationDate="2013-01-18T22:43:03.043" Score="2" ViewCount="2771" Body="&lt;p&gt;I came across some graphs depicting the delta of a down-and-out call. They show that, if the risk free rate of return is 0, the delta is constant at 1. However, if the rate of return is for example 5%, the delta rises as the stock price approaches the barrier. I can't figure out why. &lt;/p&gt;&#xA;" OwnerUserId="4621" LastActivityDate="2013-01-19T04:01:42.817" Title="Delta of a Down and Out Call" Tags="&lt;options&gt;&lt;delta&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7028" PostTypeId="2" ParentId="7024" CreationDate="2013-01-18T22:49:01.607" Score="4" Body="&lt;p&gt;Perhaps construct a Brownian Bridge between the day's open and close, then scale it according to the day's high and low.&lt;/p&gt;&#xA;" OwnerUserId="56" LastActivityDate="2013-01-18T22:49:01.607" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7029" PostTypeId="2" ParentId="7025" CreationDate="2013-01-19T02:33:17.357" Score="1" Body="&lt;p&gt;That looks about right&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Volga: S*Sqrt(T)*d1*d2*N'(d1)/σ&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I provided a link to a pdf of the following book: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://books.google.co.jp/books/about/The_complete_guide_to_option_pricing_for.html?id=tuoJAQAAMAAJ&amp;amp;redir_esc=y&quot; rel=&quot;nofollow&quot;&gt;http://books.google.co.jp/books/about/The_complete_guide_to_option_pricing_for.html?id=tuoJAQAAMAAJ&amp;amp;redir_esc=y&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but took it off because it was a scanned version and I was not sure it infringes on copyrights. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-01-20T14:34:53.557" LastActivityDate="2013-01-20T14:34:53.557" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7030" PostTypeId="2" ParentId="7027" CreationDate="2013-01-19T03:00:15.750" Score="0" Body="&lt;p&gt;You can find an accurate delta graph on page 62 of the following document:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.ederman.com/new/docs/insoutbarriers1.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.ederman.com/new/docs/insoutbarriers1.pdf&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you wrote is definitely incorrect. With a down and out call delta drops as the stock price approaches the barrier, it reaches zero smoothly as it approaches the barrier for close to expiration options and exhibits much more of discontinuous jump from values around 0.5 down to 0 at the barrier level for longer dated options.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-01-19T03:00:15.750" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7031" PostTypeId="2" ParentId="7027" CreationDate="2013-01-19T04:01:42.817" Score="-1" Body="&lt;p&gt;I am not sure if any numeric comment about the dynamics could be made without knowing the relative strike and the barrier. In general, however, you would expect delta to approach zero as you are approaching the barrier and delta approaching one as you go away from the barrier and deep into the money. In general, CDO and PUO are fairly easy to manage, since as the underlying approaches the barrier, the delta is already fairly low and the discontinuity is small. For obvious reasons, the discount to vanilla is fairly small and these products trade far less frequently then CUO/PDO and PDI/CUI. &lt;/p&gt;&#xA;" OwnerUserId="2906" LastActivityDate="2013-01-19T04:01:42.817" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7032" PostTypeId="2" ParentId="1888" CreationDate="2013-01-19T12:08:10.713" Score="0" Body="&lt;p&gt;How about neither? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A martingale process simply implying the expections of future is the same as present state, if the stock price process are martingales then  a collection of stocks over a long time should not show the trends we saw now in the stock market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A markov process is a process where future is independent of the past, again, not likely, at the very least, stock price movement is a result of supply and demand with performance expection adjustments, if it is a markov process then the stock holder should make the same kind of decisions despite of how much the stock he and the investment combinations he hold and, yet we always try to make different kind of decsions under different conditions that try to optimizing our returns, well, if you hold most of the tradeable stock of a listed company, you can even largely determine the price movement of the stock and this is something many investment agencies have been doing all the time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The two are all too elemental to represent stock price process, althrough the two were often used (althrough with somewhat doubtful success since there are better alternatives out there) as compoents to build stock and other more complicate process/time series models.&lt;/p&gt;&#xA;" OwnerUserId="3264" LastEditorUserId="3264" LastEditDate="2013-01-19T12:26:53.687" LastActivityDate="2013-01-19T12:26:53.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7033" PostTypeId="2" ParentId="5981" CreationDate="2013-01-19T18:02:18.870" Score="33" Body="&lt;p&gt;The &lt;em&gt;volatiltiy surface&lt;/em&gt; is just a representation of European option prices as a function of strike and maturity in a different &quot;unit&quot; - namely implied volatility (while the term implied volatility has to be made precise by the model used to convert prices (quotes) into implied volatilities - for example: we may consider log-normal vols and normal vols). Volatility is often preferred over prices, e.g., when considering interpolations of European option prices (although this may introduce difficulties like arbitrage violations, see, e.g., &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1964634&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1964634&lt;/a&gt; ).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A &lt;strong&gt;local volatility model&lt;/strong&gt; can generate a perfect fit to the implied volatility surface via Dupire's formula as long as the given surface is arbitrage free. In other words: the model can calibrate to a surface of European option prices. Since this calibration is done by an analytic formula the calibration is exact and fast.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Parametric models, like &lt;strong&gt;stochastic volatility&lt;/strong&gt; models, usually are more difficult to calibrate to Europen option price. The formulas that are derived for calibration are usually more complex and often the model does not produce an exact fit. Obviously, the reason to use a stochastic volatility model (or parametric model) is not given by the need to calibrate to European options. The reason is to capture other effects of the model. An important effect to be considered is the &lt;em&gt;forward volatility&lt;/em&gt;. Let $t=0$ denote today. Given the model is calibrated to the implied volatitliy surface. How does the volatlity surface generated by the model look like in $t=t_1$ at state $S(t_1) = S_1$? The forward volatility will describe the option price conditional to a future point in time. It is important for &quot;Options on Options&quot; and &quot;Forward Start Options&quot;. In other words: More exotic products depend on this feature. While European option only depend on the terminal distributions conditional to today, such a feature depends on the dynamics (conditional transition probabilities). In a local volatility model the forward volatility shows a possibly unrealistic behavior: it flattens out. The smile is vanishing. A stochastic volatility model can produce a more realistic forward volatility surface, where the smile is almost self similar..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another aspect are sensitivities (hedge ratios): Using a local volatility model may imply a too rigid assumption on how the volatiltiy surface depends on the spot. This then has implications on the calculation of sensitivities (greeks). Afaik, this was the main motivatoin to introduce the SABR model (which is a stochastic volatility model used to interpolate the implied volatility surface): to have a more realistic behavior w.r.t. Greeks).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To summarize:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Local Volatility Model&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Advantage: Fast and exact calibration to the volatility surface.&lt;/li&gt;&#xA;&lt;li&gt;Suitable for products which only depend on terminal distribution of the underlying (no &quot;conditional properties&quot;).&lt;/li&gt;&#xA;&lt;li&gt;Not suitable for more complex products which depend heavily on &quot;conditional properties&quot;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Stochastic Volatility Model&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Advantage: Can produce more realistic dynamics, e.g. forward volatility. Can produce more realistic hedge dynamics.&lt;/li&gt;&#xA;&lt;li&gt;Disadvantage: For products which depend only on terminal distributions the fit of the volatility surface may be too poor.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="3548" LastEditorUserId="3548" LastEditDate="2013-01-20T20:11:04.267" LastActivityDate="2013-01-20T20:11:04.267" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7034" PostTypeId="2" ParentId="1888" CreationDate="2013-01-19T23:36:37.540" Score="2" Body="&lt;p&gt;Let $(\Omega,\mathcal{F},\mathbb{F},\mathbb{\mu})$ be a filtered probability space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Market efficiency implies that the stock price process is Markov with&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb{E}[f(X_t)|\mathbb{F}_s] = g(X_s)$ for $0 \leq s \leq t$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $f$ and $g$ are Borel measurable functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It additionally implies that the discounted stock price process is a martingale w.r.t. probability measure $\mathbb{\mu}$ and filtration $\mathbb{F}$ with&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb{E}^{\mathbb{\mu}}[X_t^*|\mathbb{F}_s] = X_s^*$ for $0 \leq s \leq t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While the discounted stock price process is a martingale the stock price process itself should be a submartingale w.r.t. probability measure $\mathbb{\mu}$ and filtration $\mathbb{F}$ with&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb{E}^{\mathbb{\mu}}[X_t|\mathbb{F}_s] \geq X_s$ for $0 \leq s \leq t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I agree with the others Markov does not imply martingale and vice versa.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are many sources on empirical tests for these properties.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my opinion these assumptions are not unreasonable. Markov property only says that all past information about the stock price process (historical prices, historical volume, etc.) is incorporated in the current price and therefore only the current price is relevant. I believe that it is logical to assume that publicly available historical information is already priced in. For instance even the anomalies violating weak form efficiency (e.g. the January effect) tend to disappear over time as market participants trade on the information thereby incorporating the information into the price. Assuming that the stock price process is a submartingale only says that in expectation the future stock price should be greater than or equal to today's price. Intuitively, investors would not participate (long positions) in the stock market if prices were expected to decline. Take stock price process&#xA;$$&#xA;dX = \alpha Xdt + \sigma XdW&#xA;$$&#xA;A submartingale implies $\alpha \geq 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For most assets I don't believe that that is an unreasonable assumption.&lt;/p&gt;&#xA;" OwnerUserId="4628" LastEditorUserId="4628" LastEditDate="2013-01-20T06:31:17.373" LastActivityDate="2013-01-20T06:31:17.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7036" PostTypeId="2" ParentId="4775" CreationDate="2013-01-20T06:07:21.133" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://www.wiley.com/WileyCDA/WileyTitle/productCd-MAFI.html&quot; rel=&quot;nofollow&quot;&gt;Mathematical Finance&lt;/a&gt; is a good journal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are also some interesting mathematical finance articles in the &lt;a href=&quot;http://www.journals.elsevier.com/journal-of-mathematical-economics/&quot; rel=&quot;nofollow&quot;&gt;Journal of Mathematical Economics&lt;/a&gt; though clearly the journal covers many other topics as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would also recommend reading some math journals as many times articles are published in these journals where the primary applications are intended for mathematical finance. For instance the article &quot;Changes of Numeraire, Changes of Measure, and Option Pricing&quot; by Nicole El Karoui, Helyette Geman, and Jean-Charles Rochet was published in the &lt;a href=&quot;http://www.appliedprobability.org/content.aspx?Group=journals&amp;amp;Page=apjournals&quot; rel=&quot;nofollow&quot;&gt;Journal of Applied Probability&lt;/a&gt; and &quot;A General Version of the Fundamental Theorem of Asset Pricing&quot; by Freddy Delbaen and Walter Schachermayer was published in &lt;a href=&quot;http://www.springer.com/mathematics/journal/208&quot; rel=&quot;nofollow&quot;&gt;Mathematische Annalen&lt;/a&gt;. These are of course just two examples.&lt;/p&gt;&#xA;" OwnerUserId="4628" LastEditorUserId="4628" LastEditDate="2013-01-21T02:55:39.907" LastActivityDate="2013-01-21T02:55:39.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7037" PostTypeId="2" ParentId="4660" CreationDate="2013-01-20T06:17:02.863" Score="2" Body="&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/B007N3IKXG&quot; rel=&quot;nofollow&quot;&gt;Non-Gaussian Merton-Black-Scholes Theory&lt;/a&gt; would be a possible source of information on this type of model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I have glanced through this book, but have not read it thoroughly. However I can say that if you want to read this book you should be very comfortable with partial differential equations (especially the theory of pseudodifferential operators).&lt;/p&gt;&#xA;" OwnerUserId="4628" LastEditorUserId="35" LastEditDate="2013-01-21T01:48:54.923" LastActivityDate="2013-01-21T01:48:54.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7038" PostTypeId="2" ParentId="7024" CreationDate="2013-01-20T12:31:08.263" Score="1" Body="&lt;p&gt;Regarding Joshua's inspired answer, I'm still not sure how you guarantee that scaling gives you the &lt;em&gt;exact&lt;/em&gt; high and low values. I suppose that you could simulate until you get a result that is close enough. But that could be hard when, e.g., Open is near High and far from Low. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An alternative solution is to construct a Brownian Bridge between Open and High, High and Low, and Low and Close with probability p; construct a Brownian Bridge between Open and Low, Low and High, and High and Close with probability (1 - p); and make p a function of where Open falls inside the range and where close falls inside the range. &lt;/p&gt;&#xA;" OwnerUserId="3088" LastActivityDate="2013-01-20T12:31:08.263" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7039" PostTypeId="2" ParentId="7015" CreationDate="2013-01-20T13:57:21.477" Score="1" Body="&lt;p&gt;Hire someone you know (family / a close friend).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sounds silly, but what works for the mafia should work for you. If you trust someone you don't need to take many precautions. Sometimes it's even worth compromising on skill.&lt;/p&gt;&#xA;" OwnerUserId="2285" LastActivityDate="2013-01-20T13:57:21.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7040" PostTypeId="1" AcceptedAnswerId="7064" CreationDate="2013-01-20T19:05:19.710" Score="4" ViewCount="1691" Body="&lt;p&gt;This question was originally posted on Stackoverflow:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As part of the Formula.js project, I'm trying to re-implement Excel's ACCRINT function (in JavaScript, but the language should not matter). I've been trying to find a proper description for how it's supposed to work (especially with respect to the &lt;strong&gt;first_interest&lt;/strong&gt; parameter), but could not find anything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interestingly enough, Excel, Google Spreadsheets, Apple Numbers, Gnumeric, and OpenOffice all disagree on the way to implement it, even though all three major versions of Excel (Win, Mac, Web) seem to agree with each other. Some more context can be found on this &lt;a href=&quot;http://sutoiku.com/post/41023542181/issues-with-accrint&quot; rel=&quot;nofollow&quot;&gt;blog post&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dozens of tests cases and my current (flawed) implementation can be found &lt;a href=&quot;http://stoic.com/formula/function.html?name=ACCRINT&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help (code, pseudocode, or description) would be greatly appreciated!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE: to be clear, the issue is &lt;strong&gt;not&lt;/strong&gt; related to the day count convention, which we implemented using David Wheeler's &lt;a href=&quot;http://www.dwheeler.com/yearfrac/excel-ooxml-yearfrac.pdf&quot; rel=&quot;nofollow&quot;&gt;pseudocode&lt;/a&gt; for &lt;a href=&quot;http://stoic.com/formula/function.html?name=YEARFRAC&quot; rel=&quot;nofollow&quot;&gt;YEARFRAC&lt;/a&gt;, which itself was validated by over 32 million tests, covering all five basis options. The issue comes from the &lt;code&gt;first_interest&lt;/code&gt; parameter, which nobody seems to really understand. As far as we can tell, this parameter is simply ignored by many alternative spreadsheets, including OpenOffice (it's commented out in the source code). And this parameter really behaves in strange ways. If you use Excel and you change its value, you will see that it will change the results given by the ACCRINT function, but in ways that seem chaotic. Try changing the &lt;code&gt;first_interest&lt;/code&gt; date by a full century, and you'll see the accrued interest changing, but not by much. I really can't make sense of that. If anyone can, I'm all ears, because ACCRINT must be used for calculating interest on billions or trillions of dollars every year, and I find it fascinating that nobody outside of a few people at Microsoft seem to know how it's really supposed to work...&lt;/p&gt;&#xA;" OwnerUserId="4634" LastEditorUserId="4634" LastEditDate="2013-01-22T02:30:31.527" LastActivityDate="2017-05-04T09:47:47.023" Title="What's the algorithm behind Excel's ACCRINT?" Tags="&lt;fixed-income&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7041" PostTypeId="2" ParentId="4433" CreationDate="2013-01-21T04:06:01.137" Score="4" Body="&lt;p&gt;In terms of ARCH conditional variance is the variance conditional on past information (i.e. the history of the process). This is useful for modeling a process that exhibits volatility clustering. Perhaps he means that starting with the standard deviation (unconditional volatility) of stock returns one can then use that as an input to estimate the conditional volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Some &lt;a href=&quot;http://pages.stern.nyu.edu/~churvich/Forecasting/Handouts/ARCH.pdf&quot; rel=&quot;nofollow&quot;&gt;notes on ARCH models and conditional volatility&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="4628" LastEditorUserId="4628" LastEditDate="2013-01-21T20:17:30.367" LastActivityDate="2013-01-21T20:17:30.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7042" PostTypeId="2" ParentId="7040" CreationDate="2013-01-21T09:42:46.230" Score="1" Body="&lt;p&gt;The formula implemented by ACCRINT is documented on &lt;a href=&quot;http://office.microsoft.com/en-us/excel-help/accrint-HP005208979.aspx&quot; rel=&quot;nofollow&quot;&gt;office.microsoft.com&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to this page it is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ACCRINT = par \times \frac{rate}{frequency} \times \sum_{j=1}^{NC} \frac{A_j}{NL_j}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$A_j$ = number of accrued days for the ith quasi-coupon period within odd period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$NC$ = number of quasi-coupon periods that fit in odd period. If this number contains a fraction, raise it to the next whole number.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$NL_i$ = normal length in days of the ith quasi-coupon period within odd period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume the biggest part of &quot;logic&quot; in the function is the implementation of the various daycounting conventions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have implemented a bunch of standard day count conventions (as well as the non-standard Excel YEARFRAC for act/act) at &lt;a href=&quot;http://finmath.net/topics/daycountingandschedules/&quot; rel=&quot;nofollow&quot;&gt;http://finmath.net/topics/daycountingandschedules/&lt;/a&gt; - see also  &lt;a href=&quot;http://www.christian-fries.de/blog/files/2013-yearfrac.html&quot; rel=&quot;nofollow&quot;&gt;http://www.christian-fries.de/blog/files/2013-yearfrac.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3548" LastEditorUserId="3548" LastEditDate="2013-09-19T19:31:18.330" LastActivityDate="2013-09-19T19:31:18.330" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7043" PostTypeId="2" ParentId="7015" CreationDate="2013-01-21T09:48:49.023" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Break the code into parts. (unit tests, error checking, algo)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Decide what code is sensitive and what code can be shared.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Create a &quot;fake&quot; version of the sensitive code for testing.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Have the programmer work on the part that is not sensitive.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Code the sensitive part (the algo) yourself.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;(Example: There is no reason a programmer cannot work on the part of the code that calculates and tracks slippage. Put that in the part of the code that is 'public'.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note:&#xA;The same concept works with data . . . for example:&#xA;You could loop through the data and have it altered.&#xA;The altered data can be used for testing purposes.&#xA;Then, YOU can run the code on the real data once the system works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The key is simply not to expose anything significantly sensitive.&lt;/p&gt;&#xA;" OwnerUserId="3185" LastActivityDate="2013-01-21T09:48:49.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7044" PostTypeId="1" AcceptedAnswerId="7057" CreationDate="2013-01-21T12:41:28.870" Score="7" ViewCount="1586" Body="&lt;p&gt;In the process of my research I very often come across academic papers regarding modelling and trading strategies that in one way or another incorporate some technical indicators. For example in some papers, rather than taking the raw time-series as input to the model, things like MACD, SMA, EMA and RSI of the time-series is used instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have however never come across a single paper that states the basis for applying these technical indicators. My question is why are these technical indicators so commonly seen in researches in this area even though technical analysis has a bad rep for being a pseudo-science. Are the above papers simply lacking in rigor or are there some deeper reasons for this phenomenon?&lt;/p&gt;&#xA;" OwnerUserId="2886" LastActivityDate="2013-01-22T02:51:12.493" Title="The Basis of Using Technical Indicators as Inputs" Tags="&lt;time-series&gt;&lt;forecasting&gt;&lt;technicals&gt;&lt;modelling&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7045" PostTypeId="2" ParentId="7044" CreationDate="2013-01-21T13:15:45.050" Score="3" Body="&lt;p&gt;Typically &quot;average&quot; lines are used to get rid of noise in the original data. It seems pretty logical to smooth intra week fluctuations when working with a year of data.&lt;/p&gt;&#xA;" OwnerUserId="2246" LastActivityDate="2013-01-21T13:15:45.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7046" PostTypeId="2" ParentId="7044" CreationDate="2013-01-21T14:54:00.743" Score="7" Body="&lt;p&gt;I think the answer to your question is very dependent on the respective indicators. It can be argued for example that moving averages not only smooth out time series but because they are a shifted version of the original series &lt;a href=&quot;http://en.wikipedia.org/wiki/Moving_average_crossover&quot;&gt;signals on crossovers&lt;/a&gt; make use of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Momentum_investing&quot;&gt;momentum factor&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general you might want to check out the book &lt;a href=&quot;http://books.google.de/books?id=jbD47VkOHAEC&amp;amp;lpg=PP1&amp;amp;pg=PP1#v=onepage&amp;amp;q&amp;amp;f=false&quot;&gt;Evidence Based Technical Analysis&lt;/a&gt; by David Aronson.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In it he applies statistical techniques to determine whether certain technical analysis indicators have any predictive power. It's an interesting read and should equip you with some ideas on how to differentiate between folklore and statistical rigor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find a good overview and summary of the book on &lt;a href=&quot;http://www.cxoadvisory.com/2526/technical-trading/evidence-based-technical-analysis-applying-the-scientific-method-and-statistical-inference-to-trading-signals-chapter-by-chapter-review/&quot;&gt;CXO Advisory&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also find further material on the &lt;a href=&quot;http://www.evidencebasedta.com/&quot;&gt;webpage of the author&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2013-01-21T15:12:21.217" LastActivityDate="2013-01-21T15:12:21.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7047" PostTypeId="1" AcceptedAnswerId="7058" CreationDate="2013-01-21T16:21:43.797" Score="7" ViewCount="2664" Body="&lt;p&gt;When applying the Heston model to generate the sample volatility surface, some of the volatility value will be negative. I am just wondering what do practioners normally do with these negative value. Do you &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;simply ignore it;&lt;/li&gt;&#xA;&lt;li&gt;set negatives to 0; or&lt;/li&gt;&#xA;&lt;li&gt;square it, take absolute values, or something else?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3595" LastEditorUserId="467" LastEditDate="2014-10-23T04:07:45.947" LastActivityDate="2014-10-23T04:07:45.947" Title="How to avoid having negative volatility when applying Heston model?" Tags="&lt;volatility&gt;&lt;negative&gt;&lt;heston&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7048" PostTypeId="1" AcceptedAnswerId="7100" CreationDate="2013-01-21T16:29:53.450" Score="3" ViewCount="2013" Body="&lt;p&gt;I understand that the simplest way of calibrating a Heston model for volatility surface is to use Monte-Carlo to simulate the vol and stock price trajectories and then use the observed price to do a optimization.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I am just wondering if there is a more &quot;clean&quot; way to calibrate the model and how would it be better compare to the MC method?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, what might be the potential issues of calibrating Heston models using MC? And what would be some variance reduction techniques that could be used during the calibration?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="3595" LastEditorUserId="4645" LastEditDate="2013-01-22T20:06:39.417" LastActivityDate="2013-01-25T14:13:27.650" Title="Other means of calibrating Heston models" Tags="&lt;monte-carlo&gt;&lt;calibration&gt;&lt;heston&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7049" PostTypeId="1" CreationDate="2013-01-21T16:35:49.660" Score="7" ViewCount="5526" Body="&lt;p&gt;The square-root model is widely used to model equity market impact. It assumes that volatility, traded volume, total volume, and a spread cost are the drivers of slippage. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Jim Gatheral has an excellent summary of the process &lt;a href=&quot;http://faculty.baruch.cuny.edu/jgatheral/JOIM2011.pdf&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a coefficient that is estimated via regression on a realized trade schedule. This is defined as a constant (alpha) on the page I excerpt below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/pP7b2.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are typical values of alpha as estimated via regressions on realized trade schedules? Jim uses 3/4 later in the paper but this seems a bit high, and I have seen another paper by Rob Almgren that assumes 1/2.&lt;/p&gt;&#xA;" OwnerUserId="1800" LastActivityDate="2016-01-01T11:03:45.693" Title="Typical coefficients uses in square-root model for market impact" Tags="&lt;models&gt;&lt;transaction-costs&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="7050" PostTypeId="1" CreationDate="2013-01-21T18:03:27.863" Score="10" ViewCount="374" Body="&lt;p&gt;In Basel III the CVA VaR &lt;em&gt;“is restricted to changes in the counterparties’ credit spreads and does not model the sensitivity of CVA to changes in other market factors, such as changes in the value of the reference asset, commodity, currency or interest rate of a derivative.”&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, in the general dependent case (WWR/RWR), shall spread changes then be conditioned on market factors or independence be forced? Asking for both current practice and regulators' view...&lt;/p&gt;&#xA;" OwnerUserId="3015" LastActivityDate="2013-01-21T18:03:27.863" Title="Basel CVA VaR with R/WWR" Tags="&lt;cva&gt;&lt;basel&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7051" PostTypeId="2" ParentId="7048" CreationDate="2013-01-21T19:09:43.820" Score="3" Body="&lt;p&gt;Doesn't the Heston model have some Fourier transform formulae for pricing vanillas?  I think one could use those to calibrate to the vanillas. Can't provide references at this moment, on the road.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: check out &lt;a href=&quot;http://www.visixion.com/dok/Visixion_Calibrating_Heston.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.visixion.com/dok/Visixion_Calibrating_Heston.pdf&lt;/a&gt; -- I haven't read this closely but it sounds familiar &lt;/p&gt;&#xA;" OwnerUserId="3491" LastActivityDate="2013-01-21T19:09:43.820" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7053" PostTypeId="1" CreationDate="2013-01-21T21:56:51.197" Score="7" ViewCount="20346" Body="&lt;p&gt;How do the in-sample estimates and out-of-sample estimates I so often hear authors refer to in emperical analysis of MVO differ?&lt;/p&gt;&#xA;" OwnerUserId="4640" LastEditorUserId="467" LastEditDate="2013-01-29T13:45:34.680" LastActivityDate="2016-09-28T04:19:07.637" Title="What do the terms in-sample and out-of-sample estimates mean in MVO?" Tags="&lt;statistics&gt;&lt;portfolio-management&gt;&lt;optimization&gt;&lt;modern-portfolio-theory&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7054" PostTypeId="2" ParentId="7025" CreationDate="2013-01-21T23:39:07.640" Score="1" Body="&lt;p&gt;&lt;strong&gt;Vomma&lt;/strong&gt;, or &lt;strong&gt;Volga&lt;/strong&gt; or &lt;strong&gt;DvegaDvol&lt;/strong&gt; is the second derivative of the option w.r.t volatility. In other words, it is the sensitivity of vega to changes in implied volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A simple way to remember how Vomma is computed in the &lt;strong&gt;Black-Scholes&lt;/strong&gt; framework is as follows:&#xA;$$\frac{\partial^2 C}{\partial \sigma^2}  = Vega \left(\frac{d_1d_2}{\sigma}\right) $$&lt;/p&gt;&#xA;" OwnerUserId="2220" LastActivityDate="2013-01-21T23:39:07.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7055" PostTypeId="2" ParentId="7040" CreationDate="2013-01-22T02:18:01.627" Score="2" Body="&lt;p&gt;The formula to calculate accrued interest used in Excel is 100% correct (but the day count convention is not). What is not correct and not sufficiently accounted for is &lt;strong&gt;the exact day count convention&lt;/strong&gt; that must be used for the specific asset you try to value its accrued interest on. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here couple points that may cause your errors:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;I highly recommend you to do in any language, whether compiled or scripted, is to implement Enums for your switch statement for the day count convention in order to avoid ambiguity or errors by your future users; Do not use integers or strings because its a great source for errors. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In your link, how did you derive the &quot;required&quot; values against which you measure whether your computation was correct or incorrect? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Did you implement bank holiday schedules? Did you account that such bank holidays are potentially different for every market, even sometimes different for different exchanges in the same market. I do not see any accounting of bank holidays in your source code at all. Is that the issue? Why this is important to pay attention to becomes evident when you check out the following link:&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Date_rolling&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Date_rolling&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-01-22T03:40:16.853" LastActivityDate="2013-01-22T03:40:16.853" CommentCount="18" ContentLicense="CC BY-SA 3.0" />
  <row Id="7056" PostTypeId="2" ParentId="7047" CreationDate="2013-01-22T02:39:51.853" Score="2" Body="&lt;p&gt;Negative volatility means something some where along the lines something is inherently wrong with your model, double check your code and theory&lt;/p&gt;&#xA;" OwnerUserId="1764" LastActivityDate="2013-01-22T02:39:51.853" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7057" PostTypeId="2" ParentId="7044" CreationDate="2013-01-22T02:51:12.493" Score="7" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The only &quot;indicators&quot; that I believe add value in academic research are time series smoothing functions. ( I don't call them indicators because they are all lagging thus do not indicate anything into the future). &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;There is clear empirical evidence and a number of academic papers have been published that show that none of the common indicators (common defined maybe in pseudo-bibles such as Murphy book &quot;Technical Analysis of the financial markets&quot;) in isolation and even in combination perform equally well throughout different cycles, market dynamics, volatility regimes, or price patterns. Thus, for many it becomes a self-fulfilling prophesy. They are very silent when such indicators do not work and point to the &quot;technical analysis is an art&quot; aspect and remind every last soul that indicators &quot;just work&quot; during regimes when, for example an RSI indicator indicated oversold conditions and price action indeed picked up. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So, yes I believe not few in the academic community already make wrong choices in the tool selection of their research efforts. Please let us not confuse &quot;financial technical indicators&quot; with sound statistical modeling techniques and tools. A Kalman filter is doing exactly what it is supposed to do at ALL TIMES. An RSI indicator actually very rarely does what it is supposed to do, which is to indicate &quot;oversold&quot; or &quot;overbought&quot;conditions. In fact I ran tests a long time ago and showed that a strategy which shorts the asset on which an asset's RSI reaches oversold territory for the first time as well as the reciprocal almost always outperforms a strategy in which someone uses RSI in the general prescribed way. (this incorporated &quot;prudent&quot; trading, meaning realistic risk-management and stop loss levels). I ran many such tests in my junior quest for the holy grail which I soon figured does not exist. Unfortunately, technical financial indicators suggest to many that they are second best thing after the holy grail. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In summary, your question can lead to the never-ending discussion of pro and cons of technical indicators. I believe they do not belong into any serious academic research for the simple reason that they can be interpreted in all sorts of ways. A research tool should be applicable to a specific approach and it should output results that can be relied on with certain margins for error that are themselves well defined.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-01-22T02:51:12.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7058" PostTypeId="2" ParentId="7047" CreationDate="2013-01-22T03:11:12.607" Score="4" Body="&lt;p&gt;It is not necessarily something that must be wrong with your model. Inherent in the Heston discretization methods of its continuous time dynamics is the possibility of negative values in the variance process. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are couple solutions you can look at in order to &quot;fix&quot; your problem:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Usage of different Euler schemes, such as the Full Truncation scheme. &lt;/li&gt;&#xA;&lt;li&gt;Making the discretization grid smaller. &lt;/li&gt;&#xA;&lt;li&gt;approximate Fourier inversions needed to simulate the integrated variance process. &lt;/li&gt;&#xA;&lt;li&gt;Moment-matching techniques (for example, approximating the non-centrally chi-squared distribution by a related distribution whose moments are (locally) matched with those of the exact distribution).&lt;/li&gt;&#xA;&lt;li&gt;Using drift interpolation instead of Fourier inversion&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-01-22T03:11:12.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7059" PostTypeId="2" ParentId="7048" CreationDate="2013-01-22T03:26:34.847" Score="5" Body="&lt;p&gt;I highly recommend you to stick with the error function (RMSE) value minimization approach. I love MC techniques for this and related problem solving and thus do not recommend you to use anything else because of its simplicity and transparency. It comes down to using the right discretization function and to possibly implement variance reduction approaches. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Re variance reduction have you tried the standard approaches ? (Common random numbers, antithetic variates, control variates, importance sampling and stratified sampling)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here a reference to a paper that I find quite neatly describes potential pitfalls and model calibration around the Heston model: &#xA;&lt;a href=&quot;http://www.math.umn.edu/~bemis/IMA/MMI2008/calibrating_heston.pdf&quot;&gt;http://www.math.umn.edu/~bemis/IMA/MMI2008/calibrating_heston.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and another one for its elegance to describe in simple terms:&#xA;&lt;a href=&quot;http://ta.twi.tudelft.nl/mf/users/oosterle/oosterlee/chen.pdf&quot;&gt;http://ta.twi.tudelft.nl/mf/users/oosterle/oosterlee/chen.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here a link to actually implement the calibration in Matlab: &#xA;&lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/29446-heston-model-calibration-and-simulation&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/29446-heston-model-calibration-and-simulation&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-01-22T03:26:34.847" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7060" PostTypeId="2" ParentId="7049" CreationDate="2013-01-22T03:35:36.090" Score="1" Body="&lt;p&gt;Find out yourself? -&gt; why not solving for alpha as a function of the difference between the model delta and your true market impact of past trades and subsequent market impact. You obviously need the accompanying data to run such computation but it should be rather straight forward. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From my own research I have not found &quot;stiff&quot; formulae to fit the bill at most times. Market impact between highly liquid stocks and other stocks that trade at a daily huge percentage of public float follow completely different dynamics in my opinion. To be honest I chuckle each time I see similar to above formula because, come on, even you and I, sitting drunk at the bar counter and being asked to come up with a formula will at least account for a) spread cost, b) PLUS something, c) a constant &quot;to save our ass&quot; * , d) some volatility adjusted ratio of our to be traded quantity to some sort of daily measure of trading volume. There are way smarter ways to approach this, but again, I think you will not end with one formula that fits it all. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-01-22T03:35:36.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7061" PostTypeId="2" ParentId="7053" CreationDate="2013-01-22T04:10:39.367" Score="2" Body="&lt;p&gt;I do not think they are directly applicable to MVO because inherently you always model the efficient frontier or asset selection on in-sample data and the result is measured out-of-sample. You can't say, &quot;hey I model it in-sample over 2005 data and then I measure the performance of the portfolio over 2006 data and compare that with results derived from 2010 data.&quot; 2010 returns may be derived from the &quot;most efficient&quot; portfolio that may be completely different from the &quot;most efficient&quot; portfolio you built in 2005. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually one inherent weakness of MVO is that it &quot;treats return as a future expectation and uses volatility as a proxy for risk, the flaw being that volatility is a historical parameter and you cannot assume that today’s prices provide an accurate forecast for the future.&quot; (Mean–Variance Optimization: A Primer). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously there is connection between in-sample and out-of-sample data as indicated in above quote but as I mentioned I would not consider its usage in the same way as in-sample and out-of-simple data are used, for example in those optimization where the optimization is done once, in-sample, and results are comparable across different out-of-sample time frames. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-01-22T04:10:39.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7062" PostTypeId="1" AcceptedAnswerId="7068" CreationDate="2013-01-22T07:37:54.523" Score="3" ViewCount="379" Body="&lt;p&gt;I am looking for overview references on software companies that develop applications in the following domains:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;asset and portfolio management&lt;/li&gt;&#xA;&lt;li&gt;risk management&lt;/li&gt;&#xA;&lt;li&gt;derivatives pricing&lt;/li&gt;&#xA;&lt;li&gt;trading&lt;/li&gt;&#xA;&lt;li&gt;quant modelling&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I am also interested in different approaches, like:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;buy and sell side products&lt;/li&gt;&#xA;&lt;li&gt;commercial and open source products&lt;/li&gt;&#xA;&lt;li&gt;big established players and agile innovative new players&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The references should give an idea about what the products are capable of and their position in the industry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt; &lt;br&gt;&#xA;I am interested in references that give a balanced overview (advertising links to individual companies will not be tolerated here! If the answers as such give a balanced overview themselves this is of course fine).&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2013-08-27T16:59:14.950" Title="Overview of software companies in the industry" Tags="&lt;reference-request&gt;&lt;software&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7064" PostTypeId="2" ParentId="7040" CreationDate="2013-01-22T09:58:54.143" Score="3" Body="&lt;p&gt;Take a look at Excel Financial Functions for .Net, it looks like there is source code available:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://archive.msdn.microsoft.com/FinancialFunctions&quot; rel=&quot;nofollow&quot;&gt;http://archive.msdn.microsoft.com/FinancialFunctions&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2013-01-22T09:58:54.143" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7065" PostTypeId="1" AcceptedAnswerId="7067" CreationDate="2013-01-22T10:47:12.960" Score="12" ViewCount="12936" Body="&lt;p&gt;How to create charts for market data in WPF?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any charting controls provided by microsoft or you need to use only third party controls?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which are the popular third party charting controls used predominantly by banks?&lt;/p&gt;&#xA;" OwnerUserId="3506" LastEditorUserId="467" LastEditDate="2013-04-30T21:29:48.200" LastActivityDate="2020-05-25T08:58:09.157" Title="How to create charts in WPF finance applications?" Tags="&lt;programming&gt;&lt;charts&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="7066" PostTypeId="2" ParentId="7047" CreationDate="2013-01-22T10:55:39.647" Score="6" Body="&lt;p&gt;First, to make that clear: The Heston model does not generate negative volatility, but - for example - an Euler discretization of the Heston model may generate negative volatility (or variance). It is not a problem of the model. It is a problem of the numerical scheme.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use an Euler scheme which generates negative volatility and then use any of the methods quoted in you question (e.g. floor volatility, take absolute value of volatility, etc.), then you are effectively modifying the model. As a consequence, the calibration quality of the model may suffer since analytic formulas are no longer valid. Working with a finer time-discretization may heal this, since the probability to hit zero gets smaller.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, I assume the question here rather is: &lt;em&gt;Which numerical scheme should be used for Heston model?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here it may be useful to take a look at the paper by Broadi and Kaya:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Broadie, M.; Kaya, O.: Exact Simulation of Stochastic Volatility and other Affine Jump Diffusion Processes. &lt;em&gt;Operations Research&lt;/em&gt;, 2006, Vol.54, No.2, 217-231.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also &lt;a href=&quot;http://finmath.stanford.edu/seminars/documents/Broadie.pdf&quot; rel=&quot;nofollow&quot;&gt;http://finmath.stanford.edu/seminars/documents/Broadie.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3548" LastEditorUserId="3548" LastEditDate="2013-01-22T21:09:27.467" LastActivityDate="2013-01-22T21:09:27.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7067" PostTypeId="2" ParentId="7065" CreationDate="2013-01-22T11:16:19.670" Score="9" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.scichart.com/&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;SciChart&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I used SciChart and was happy with it. This is extremely rich charting library&#xA;($500 per licence; \$1000 with source code).&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.infragistics.com/products/wpf/samples&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Infragistics&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;A premium UI library. I haven't tried Infragistics charts particularly, but I'm sure they are as much perfect as their other controls (grids, ribbons etc).&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.microsoft.com/en-us/download/details.aspx?id=14422&quot; rel=&quot;nofollow&quot;&gt;MS Chart&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://wpftoolkit.codeplex.com/&quot; rel=&quot;nofollow&quot;&gt;Extended WPF Toolkit&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;SciChart vs Infragistics Chart&lt;/strong&gt;.&#xA;I should add that Infragistics are mostly concentrated on the overall usability and esthetics of the charts while SciChart focuses on functionality and performance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;SciChart vs &lt;a href=&quot;http://www.visiblox.com/&quot; rel=&quot;nofollow&quot;&gt;VisiBlox&lt;/a&gt;&lt;/strong&gt;. The comparison between SciChart and Visiblox says that &lt;a href=&quot;http://www.abtsoftware.co.uk/News/tabid/93/articleType/ArticleView/articleId/28/SciChart_vs_Visiblox_Performance_Battle_Update.aspx&quot; rel=&quot;nofollow&quot;&gt;SciChart is 30%-250% faster&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Unsafe code in SciChart&lt;/strong&gt;. SciChart uses unsafe code to write to bitmap in the fastest possible way. Once we were developing the app for Bloomberg Store we had to use WPF Toolkit instead because Bloomberg didn't allow unsafe calls.&lt;/p&gt;&#xA;" OwnerUserId="2246" LastEditorUserId="2246" LastEditDate="2016-06-20T08:43:27.530" LastActivityDate="2016-06-20T08:43:27.530" CommentCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="7068" PostTypeId="2" ParentId="7062" CreationDate="2013-01-22T11:36:10.333" Score="3" Body="&lt;p&gt;So, I dont even know of comprehensive SW lists; one of the best ones probably being &lt;a href=&quot;http://www.bobsguide.com/directory.html&quot; rel=&quot;nofollow&quot;&gt;bobsguide directory&lt;/a&gt; (subdivided in specific topics). Another one is at &lt;a href=&quot;http://www.marketswiki.com/mwiki/Category%3aIndependent_Software_Vendors&quot; rel=&quot;nofollow&quot;&gt;Marketwiki&lt;/a&gt;. &lt;a href=&quot;http://www.lepus.com/research/system-selection/&quot; rel=&quot;nofollow&quot;&gt;Lepus&lt;/a&gt; also offers a through comparison of software in some of the mentioned areas, and keeps lists with features. For HFT there's &lt;a href=&quot;http://www.hftreview.com/pg/main/solutions-directory&quot; rel=&quot;nofollow&quot;&gt;HFTReview's&lt;/a&gt; directory.&lt;/p&gt;&#xA;" OwnerUserId="3015" LastEditorUserId="3015" LastEditDate="2013-08-27T16:59:14.950" LastActivityDate="2013-08-27T16:59:14.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7069" PostTypeId="1" AcceptedAnswerId="7070" CreationDate="2013-01-22T13:00:50.137" Score="6" ViewCount="1807" Body="&lt;p&gt;I have encountered numerous copula estimators that can estimate time-invariant and time-varying linear and non-linear correlations on the interval $[-1,1]$, and these estimators are fully consistent with arbitrary univariate marginals and different forms of the bivariate joint distribution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have also encountered copulas (Gumbel, Clayton, and others) that can estimate time-varying lower and upper tail dependence on the interval $[0,1]$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I believe that these tail dependence measures can only detect positive dependence.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Does there exist a time-invariant OR time-varying copula estimator that can detect negative dependence in the tails?&lt;/strong&gt; &lt;/p&gt;&#xA;" OwnerUserId="3174" LastActivityDate="2015-05-15T10:37:56.370" Title="Is there a copula that can estimate negative tail dependence?" Tags="&lt;correlation&gt;&lt;relationship&gt;&lt;copula&gt;&lt;dependence&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7070" PostTypeId="2" ParentId="7069" CreationDate="2013-01-22T14:47:11.033" Score="5" Body="&lt;p&gt;Here is a &lt;a href=&quot;http://www.essex.ac.uk/ccfea/research/WorkingPapers/2010/CCFEA%20WP044-10.pdf&quot;&gt;working paper&lt;/a&gt; that you may be interested in.&lt;/p&gt;&#xA;" OwnerUserId="4628" LastActivityDate="2013-01-22T14:47:11.033" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7071" PostTypeId="2" ParentId="7048" CreationDate="2013-01-22T15:54:28.260" Score="2" Body="&lt;p&gt;Here's a decent study of calibration performance using fast fourier transforms versus other techniques.  It concludes Gaussian quadrature works better than other techniques.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.frankfurt-school.de/dms/publications-cqf/CPQF_Arbeits6.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.frankfurt-school.de/dms/publications-cqf/CPQF_Arbeits6.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: AZhu points out the link above is dead and that a working link is &lt;a href=&quot;http://mpra.ub.uni-muenchen.de/2975/1/MPRA_paper_2975.pdf&quot; rel=&quot;nofollow&quot;&gt;http://mpra.ub.uni-muenchen.de/2975/1/MPRA_paper_2975.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2013-01-22T19:04:21.723" LastActivityDate="2013-01-22T19:04:21.723" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7072" PostTypeId="2" ParentId="7015" CreationDate="2013-01-22T16:31:52.577" Score="0" Body="&lt;p&gt;You have a choice of approach, trust or distrust. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you can find someone you can trust, then you can focus on getting the right result. One way to induce such a trustful partnership is to include stock or options as incentive, a la Apple. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you will only distrust your quant, then your best bet is to hire an office space that you can both travel to, and sit together with him/her to work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think you need to work out whether you need the quant for their financial knowledge or their development ability. A generic developer can do development given the requirements and unit tests. A quant can work with synthetic/fuzzed data as long as it is reasonable, and could spend time explaining things to you rather than necessarily doing it all by themselves.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are paranoid (as in, overly distrustful), then don't give them access to the data. The cheapest and simplest option is to find someone you can trust. &lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2013-01-22T16:31:52.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7073" PostTypeId="2" ParentId="3156" CreationDate="2013-01-22T20:48:53.987" Score="14" Body="&lt;p&gt;You could look into &lt;a href=&quot;http://pandas.pydata.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Pandas&lt;/a&gt;, a Python library that integrates with &lt;a href=&quot;http://www.pytables.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;PyTables&lt;/a&gt;. It was created by someone at AQR and has some similar features as KDB.&lt;/p&gt;&#xA;" OwnerUserId="35" LastEditorUserId="17487" LastEditDate="2016-04-25T09:11:34.317" LastActivityDate="2016-04-25T09:11:34.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7074" PostTypeId="2" ParentId="7015" CreationDate="2013-01-22T23:25:41.527" Score="0" Body="&lt;p&gt;Have you thought about using one of the cloud service providers? For example for data you can setup a free MongoDB instance with &lt;a href=&quot;https://mongolab.com/products/pricing/&quot; rel=&quot;nofollow&quot;&gt;https://mongolab.com/products/pricing/&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also setup a free (or relatively cheap) Linux/Windows virtual machine with Amazon &lt;a href=&quot;http://aws.amazon.com/ec2/pricing/&quot; rel=&quot;nofollow&quot;&gt;http://aws.amazon.com/ec2/pricing/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just few options to isolate your home environment (with sensitive information) from the development ...&lt;/p&gt;&#xA;" OwnerUserId="1868" LastActivityDate="2013-01-22T23:25:41.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7075" PostTypeId="2" ParentId="7015" CreationDate="2013-01-22T23:46:47.130" Score="1" Body="&lt;p&gt;For algorithms/strategies/indicators, the way this is normally done is you describe the general algorithm, but leave out the parameters. They are then taken from an settings file. So we do all the testing, including acceptance tests using x=12, y=18. But then you run it yourself using your secret numbers, x=10.56 and y=21.22.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is in the context of coding an existing trading strategy. If you want the person to find the optimal values of x and y, you could give them the algorithm as a pre-compiled black-box function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your case of historical data is harder; unless there is some way you can sanitize it without making it useless. But if it is hard to obtain, maybe anything they learn will not be useful, going forward, anyway?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Above all, you do need to feel trust in the person you work with. The NDAs and other paperwork are just to make it clear to each other what the agreement is; legally enforcing anything there is unlikely to work. It is the person's sense of ethics that enforces it.&lt;/p&gt;&#xA;" OwnerUserId="1587" LastActivityDate="2013-01-22T23:46:47.130" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7076" PostTypeId="2" ParentId="7049" CreationDate="2013-01-23T03:24:53.197" Score="0" Body="&lt;p&gt;There are many ways to calibrate the coefficient for the square root impact. One of the easiest ways is to actually just run a regression between the Q, number of shares to be traded, and V (you can use 20 day average for this) to show how much the market moved. First, you should however do a log log plot to show first that it is indeed a square root market impact. Another thing you can do is actually use the roll model as a way of predicting market impact as well. Jim mentions this in some of his other lectures I believe. Also, the coefficient for the market impact really can depend largely on when you ran the regression as well. &lt;/p&gt;&#xA;" OwnerUserId="3440" LastActivityDate="2013-01-23T03:24:53.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7077" PostTypeId="1" AcceptedAnswerId="7279" CreationDate="2013-01-23T08:43:07.710" Score="17" ViewCount="1828" Body="&lt;p&gt;There is a vast literature on copula modelling. Using copulas I can describe the joint law of two (and more) random variables $X$ and $Y$, i.e. $F_{X,Y}(x,y)$.&#xA;Very often in risk management (credit risk, operational risk, insurance) the task is to model a sum $$Z=X+Y$$ and find its distribution $$F_Z(z) = F_{X+Y}(z)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know several approaches that do not directly use copulas (e.g. commons shock models and mixed compound Poisson models) but how can I elegantly combine a copula model and a model for the sum (without Monte Carlo of course - otherwise it would be easy).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some useful Fourier-transform approach? I had the feeling that in the case of Archimedian copulas there could be a chance (looking at this mixture representation as in e.g. in Embrechts, Frey, McNeil). Who has an idea? Are there any papers on this? &lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="9336" LastEditDate="2014-11-24T14:37:59.223" LastActivityDate="2014-11-24T14:37:59.223" Title="Copula models and the distribution of the sum of random variables without Monte Carlo" Tags="&lt;copula&gt;" AnswerCount="2" CommentCount="7" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7078" PostTypeId="2" ParentId="1332" CreationDate="2013-01-23T09:47:45.720" Score="3" Body="&lt;p&gt;Cliff Asness's PhD thesis was based on Momentum and Value.&#xA;AQR has a lot of interesting research.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.aqrindex.com/AQR_Momentum_Indices/Momentum_Research/Content/default.fs&quot; rel=&quot;nofollow&quot;&gt;http://www.aqrindex.com/AQR_Momentum_Indices/Momentum_Research/Content/default.fs&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://aqr.com/Research/ByTopic.aspx&quot; rel=&quot;nofollow&quot;&gt;http://aqr.com/Research/ByTopic.aspx&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Jegadeesh and Titman (Returns to Buying Winners...- first paper linked in the above answer ) seems to be the standard reference. &lt;/p&gt;&#xA;" OwnerUserId="3461" LastActivityDate="2013-01-23T09:47:45.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7079" PostTypeId="2" ParentId="1332" CreationDate="2013-01-23T11:47:38.057" Score="3" Body="&lt;p&gt;Renowned &lt;a href=&quot;http://www.cxoadvisory.com/&quot; rel=&quot;nofollow&quot;&gt;CXO Advisory Group&lt;/a&gt; have created a research compendium exclusively on momentum investing. This is the most exhaustive treatment of the topic I have ever seen:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cxoadvisory.com/momentum-investing-research-compendium/&quot; rel=&quot;nofollow&quot;&gt;The Momentum Investing Research Compendium&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With $25 the price is reasonable.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2013-01-23T11:47:38.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7080" PostTypeId="1" AcceptedAnswerId="7087" CreationDate="2013-01-23T13:58:36.257" Score="5" ViewCount="596" Body="&lt;p&gt;Suppose we are in the mean-variance optimization setting with a vector of returns $\alpha$ and a vector of portfolio weights $\omega$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a robust setting, the returns are assumed to lie in some uncertainty region.&#xA;I came accross a paper which lets this region, call it $U$,  be given by the sphere centered at $\alpha$ with radius $\chi|\alpha|$ where $\chi$ lies between 0 and 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The authors then turn their attention to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\min_U r_{p}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and end up with the following solution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\min_U r_{p}=\alpha^\intercal\omega-\chi|\alpha||\omega|$ ... ... ... (1)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They do not provide much detail as to how they arrive at this but mention the following:&#xA;&quot;this uncertainty region corresponds to a one-sigma neighborhood under a Bayesian prior of an uncertain $\alpha$ distributed normally about the estimated $\alpha$, with $\sigma=\chi|\alpha|$...&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know how they might have arrived at equation (1)???&#xA;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="4618" LastEditorUserId="4618" LastEditDate="2013-01-23T18:43:28.810" LastActivityDate="2013-01-24T22:56:51.120" Title="Robust-Bayesian optimization in Markowitz framework" Tags="&lt;mean-variance&gt;&lt;robust-optimization&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7081" PostTypeId="2" ParentId="325" CreationDate="2013-01-23T15:54:13.320" Score="5" Body="&lt;p&gt;Data over IB's API is not real time. You can't even match up bid, asks, and lasts with their appropriate sizes.  It's actually a 200 ms snapshot. For more reliable data go with B-PIPE, DTN or eSignal (they all have APIs) and a high speed co-located Ethernet or T1 connection to your vendor. Lots of additional coding is required.&lt;/p&gt;&#xA;" OwnerUserId="4646" LastEditorUserId="35" LastEditDate="2013-01-23T19:40:23.500" LastActivityDate="2013-01-23T19:40:23.500" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7082" PostTypeId="1" AcceptedAnswerId="7084" CreationDate="2013-01-23T16:27:42.260" Score="2" ViewCount="229" Body="&lt;p&gt;Are there any derivatives which pay amount $a(p-b)^{2}-c$ where $p$ is the price of underling asset ? (or in the case of options $max(0,a(p-b)^{2}-c)$) I'm not very strict here but I only want to know if there are any derivatives which profile of profits is quadratic function of price of underling assets (quadratic on some subset of set of all $p$ )?&lt;/p&gt;&#xA;" OwnerUserId="2044" LastEditorUserId="2044" LastEditDate="2013-01-23T21:58:04.580" LastActivityDate="2014-04-04T21:53:01.657" Title="Are there any derivatives which pay amount $a(p-b)^{2}-c$ where $p$ is the price of underling asset?" Tags="&lt;derivatives&gt;&lt;models&gt;" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7084" PostTypeId="2" ParentId="7082" CreationDate="2013-01-23T18:23:50.877" Score="4" Body="&lt;p&gt;You can ask for a quote from a bank as I am sure they will create it for you. If you want to create this kind of payoff yourself, you can use the following paper from Peter Carr where he introduces the spanning formula for replicating any twice differentiable payoff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.math.nyu.edu/research/carrp/papers/pdf/twrdsfig.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.math.nyu.edu/research/carrp/papers/pdf/twrdsfig.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3440" LastActivityDate="2013-01-23T18:23:50.877" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7085" PostTypeId="1" AcceptedAnswerId="7094" CreationDate="2013-01-23T20:17:19.577" Score="4" ViewCount="2461" Body="&lt;p&gt;If it exists, has been agreed on, and F# programmers have used it extensively, I would like to know what is the industry standard Quant Finance library for F#. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What typical finance scenario(s) have you had success with for this library?&lt;/p&gt;&#xA;" OwnerUserId="3424" LastEditorUserId="467" LastEditDate="2013-01-23T22:28:09.237" LastActivityDate="2013-01-24T15:02:06.387" Title="What is the industry standard Quant Finance modeling library for F#" Tags="&lt;programming&gt;&lt;library&gt;" AnswerCount="4" CommentCount="9" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7086" PostTypeId="2" ParentId="7085" CreationDate="2013-01-23T21:09:34.000" Score="0" Body="&lt;p&gt;Unfortunately, the most there is seems to be the C++ QuantLib. I am not overly familiar with F#, but i assume there is a way to access C++ libraries. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Its documentation is pretty much nonexistent, however Mark Joshi has published a very good book on Design Patterns with C++, which will help you get started. You may be able to utilize the methods from QL in your system, but implement your own code in F#, but that heavily depends on your usage scenario (maybe you could elaborate on that a bit more?). Another way would be to write most of your system in C++ (or anything else, Java or Python offer decent implementations of QL) and only write only some modules in F#, depending on your needs. This, however, can quickly become a huge mess, and needs to be planned carefully. Weight the advantages of using an at least commonly used library.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On a different note, Microsoft has a case study on F# in banking, but unfortunately they do not answer your question, however it may serve you as a resource for further research:&#xA;&lt;a href=&quot;http://www.microsoft.com/casestudies/Case_Study_Detail.aspx?casestudyid=4000006794&quot; rel=&quot;nofollow&quot;&gt;http://www.microsoft.com/casestudies/Case_Study_Detail.aspx?casestudyid=4000006794&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1976" LastActivityDate="2013-01-23T21:09:34.000" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7087" PostTypeId="2" ParentId="7080" CreationDate="2013-01-23T22:15:18.350" Score="3" Body="&lt;p&gt;In robust optimization, the true return is not known, we just have a prior $\alpha$ and you have to take into account a possible misestimate which can lower the true return. This is done under the assumption that the posterior return will be within the prior return $\alpha$ plus minus the error being in some $\sigma$-interval.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now a try for a more formal answer: The posterior return vector is estimated as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\vec{\alpha} +\vec{\chi}\cdot|\alpha|$ (1)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $|\vec{\chi}|\leq 1$, or equivalently $\vec{\chi}^{2} \leq 1$. This exactly describes a sphere around $\vec{\alpha}$. Now the return is the product of the return vector $\vec{\alpha}+\vec{\chi}\cdot|\alpha|$ times the weight vector $\vec{\omega}$ :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r=(\vec{\alpha}+\vec{\chi}\cdot|\alpha|)\cdot\vec{\omega}=\alpha^{T}\omega+\chi^{T}\omega|\alpha|$. (2)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, $\vec{\chi}$ can have any orientation. We want the minimum of the second term. $\alpha^{T}\omega$ is minimal if $\vec{\alpha}$ and $\vec{\omega}$ look in opposite direction (property of the dot product), therefore &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\min_U r_P=\alpha^{T}\omega-\chi|\alpha| |\omega|$. (3) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first term is just the dot product of $\vec{\alpha}$ and $\vec{\omega}$, so it can be written as $|\alpha||\omega|\cos(\phi)$ where $\phi$ is the angle between the two vectors (in n dimensions). This is the next equation in the Golts and Jones working paper:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\min_U r_P=|\alpha||\omega|(\cos(\phi)-\chi)$. (4)&lt;/p&gt;&#xA;" OwnerUserId="560" LastEditorUserId="560" LastEditDate="2013-01-24T22:56:51.120" LastActivityDate="2013-01-24T22:56:51.120" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7088" PostTypeId="2" ParentId="7085" CreationDate="2013-01-23T22:21:42.760" Score="3" Body="&lt;p&gt;F# is a relatively recent programming language: it was only included with Visual Studio since the 2010 version. Therefore, there is little chance that programmers had the time to agree on a common library, especially given the fact that Quantitative Finance is a broad field and hence different libraries might be better in specific areas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I still think the question deserves an answer because F# is being more and more used in Quantitative Finance and I guess programmers in the field will start wondering about a reference library in the future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all, it is important to remember that F# is part of the .Net framework. Hence, you have to keep in my that any library being used nowadays in another language of the framework (I'm especially thinking about C#) can be used from F#. For example, as mentioned by phi, you will be able to use &lt;a href=&quot;http://quantlib.org/index.shtml&quot; rel=&quot;nofollow&quot;&gt;Quantlib&lt;/a&gt;. The thing is, to be able to leverage the advantage of the functional programming paradigm which is the main advantage of F#, you would have to create a wrapper around a library that hasn't been done especially for that language. Some of the existing libraries, such as &lt;a href=&quot;http://www.nag.com/&quot; rel=&quot;nofollow&quot;&gt;NAG&lt;/a&gt;, are starting to make F# wrappers so there is a good chance that more wrappers will be available in the future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, let's just say again that in order to make profitable strategies, you will not be able to solely rely on available libraries, you will have to implement extensions in-house.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2013-01-23T22:21:42.760" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7089" PostTypeId="1" CreationDate="2013-01-23T22:39:25.423" Score="1" ViewCount="1669" Body="&lt;p&gt;&lt;a href=&quot;http://www.dbresearch.de/PROD/DBR_INTERNET_EN-PROD/PROD0000000000269468.pdf&quot; rel=&quot;nofollow&quot;&gt;This article&lt;/a&gt; contains the following statement.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In terms of liquidity detection, traders intend to decipher whether&#xA;  there are large orders existing in a matching engine by sending out&#xA;  small orders (pinging) to seek for large orders. When a small order&#xA;  is filled quickly, there is likely to be a large order behind it.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Am I right to suppose that by pinging the mean difference between the time of sending the order and time of posting it on LOB? Or maybe it's something else?&lt;/p&gt;&#xA;" OwnerUserId="2044" LastEditorUserId="35" LastEditDate="2013-01-24T03:40:53.233" LastActivityDate="2013-01-24T03:40:53.233" Title="Liquidity detection based strategy in HFT" Tags="&lt;high-frequency&gt;&lt;strategy&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7090" PostTypeId="2" ParentId="7082" CreationDate="2013-01-23T23:12:33.297" Score="1" Body="&lt;p&gt;Variance swaps are arguably a little like that.  As mentioned, power contracts too, but sometimes only by virtue of correlation/cross-gammas between volatilities and underlyings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I haven't personally seen a contract with an exponent in it.&lt;/p&gt;&#xA;" OwnerUserId="3491" LastActivityDate="2013-01-23T23:12:33.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7091" PostTypeId="2" ParentId="7082" CreationDate="2013-01-24T00:59:32.420" Score="1" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;There are probably currently none out there right now with the exact same pay off structure (not sure how you would set b and c and what rational you would apply thus I said variants may exist but probably not the exact same ones)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Having said that you can request a bank to price you ANY derivative you like, they will quote you for sure. You better be very confident that you are able to price them yourself correctly or you will get ripped off royally. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-01-24T00:59:32.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7092" PostTypeId="2" ParentId="7085" CreationDate="2013-01-24T01:15:22.157" Score="5" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;In my opinion F# will never ever take off in ways C++ or C# has become popular. There are way too many competitive functional languages out there and if you program functionally why would you ever want to lock yourself into a MS product, at least that is an argument I have heard multiple times. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;There is no comprehensive F# library out there right now that tackles derivatives pricing algorithms or quantitative methods applied to financial modeling, period. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I highly recommend you to look at C++ libraries and some C# libraries (which perform more and more closely to their C++ brothers, throughput and latency wise). There is just not enough support for functional language libraries in the broader finance community yet, and to be honest I do not think there will ever be sufficient interest in order to make it worthwhile to run a whole architecture on a functional language. The reason I say that is because I already see lots of effort put in by MS and other vendors to open up C++ and especially C# more and more to handle work loads that were the core domain of functional languages before. Examples that show how C# (.Net) really pushes onto the turf of other competing languages:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Actor model (and IPC communication)&lt;/li&gt;&#xA;&lt;li&gt;State machine compile time creation (async, await type concurrent programming)&lt;/li&gt;&#xA;&lt;li&gt;want static typing? check; strong typing? check; dynamic typing? check; object type inference? check&lt;/li&gt;&#xA;&lt;li&gt;tpl dataflow, concurrent data flow processing&lt;/li&gt;&#xA;&lt;li&gt;complex event processing (MS has its own product out there that tightly integrates with .Net and got pretty good reviews)&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;A lot of that stuff was previously the domain of Haskell or Erlang, not so anymore. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-01-24T01:40:07.517" LastActivityDate="2013-01-24T01:40:07.517" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="7093" PostTypeId="2" ParentId="7089" CreationDate="2013-01-24T01:26:47.133" Score="1" Body="&lt;p&gt;With all due respect, the referenced pdf is nothing but a glossy write up of standard terms that you even hear about on TV nowadays, not much more. I assume its targeting totally uninformed clients (Japanese buy side funds? ;-) who in 2012/2013 still have not caught on with algorithmic execution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Pinging&quot; is so outdated that I would claim the information content you derive from shooting small orders into the market in expectation of learning about larger orders looming is gonna be close to zero. We have reached a stage where predatory algorithms have become pray to even more intelligent bits and bytes. The biggest edge I see a hft algo can currently gain over others is paying cash in exchange for &quot;special new&quot; order types. Its another way of letting big spenders gain an advantage over others who are not willing to pay up. Its the same regulators-chase-hft-firms/exchanges-to-fill-loopholes game that has been played for close to 10 years now.  &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-01-24T01:26:47.133" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7094" PostTypeId="2" ParentId="7085" CreationDate="2013-01-24T14:47:22.070" Score="5" Body="&lt;p&gt;I'm not aware of an industry-standard Quant Finance library in the F# space, but there are plenty of high-quality commercial and open source alternatives. See the F# Software Foundation's &lt;a href=&quot;http://fsharp.org/math/&quot;&gt;Math Stacks page&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;F# is used in a wide range of finance scenarios.You can read some experience reports from the F# Software Foundation &lt;a href=&quot;http://fsharp.org/&quot;&gt;home page&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="4649" LastEditorUserId="35" LastEditDate="2013-01-24T15:02:06.387" LastActivityDate="2013-01-24T15:02:06.387" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7095" PostTypeId="1" CreationDate="2013-01-24T02:15:25.890" Score="12" ViewCount="1012" Body="&lt;p&gt;I'm working in order to compare the calculation of the VaR between the methodology of copulas and kernel density, all this by using the software r.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The process that I follow is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Obtain a sample (which is bivariate)&lt;/li&gt;&#xA;&lt;li&gt;Estimate the density of the data by kernel of Epanechnikov (for X1 and X2 as marginals)&lt;/li&gt;&#xA;&lt;li&gt;Calculate the bandwith with the rule of thumb (Silverman)&lt;/li&gt;&#xA;&lt;li&gt;Fix a copula (Gumbel or Clayton)&lt;/li&gt;&#xA;&lt;li&gt;I calculate the VaR (quantile 0.95)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;But if I do this I obtain a value that correspond to the estimated data, I have found a working paper that in relation with the process add another step:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Estimate the pdf of the jth order statistic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Agarwal, Ravi Kumar and Ramakrishnan, Vignesh, Epanechnikov Kernel Estimation of Value at Risk (January 14, 2010).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Page 9)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1537087&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1537087&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;set.seed(1)&#xA;data&amp;lt;-rnorm(518,10,3)&#xA;&#xA;#Calculate rule-of-thumb bandwidth&#xA;sx&amp;lt;-apply(data,2,sd)&#xA;b1 &amp;lt;-1.06*sx[1,]*n^(-1/5)&#xA;b2 &amp;lt;-1.06*sx[2,]*n^(-1/5)&#xA;&#xA;#Kernel density estimation &quot;epanechnikov&quot;&#xA;d1=density(data[,1],bw=b1,kernel=&quot;epanechnikov&quot;)&#xA;d2=density(data[,2],bw=b2,kernel=&quot;epanechnikov&quot;)&#xA;&#xA;&#xA;data_E &amp;lt;- cbind(d1$y,d2$y)&#xA;&#xA;#Fixing a copula (Gumbel)&#xA;&#xA;r&amp;lt;-Kendall(data_E)&#xA;&#xA;P&amp;lt;-1/(1-r[1,2])&#xA;m1&amp;lt;- fit.norm(data_E[,1])&#xA;m2&amp;lt;- fit.norm(data_E[,2])&#xA;&#xA;rep &amp;lt;- 100000&#xA;gcopula &amp;lt;- rcopula.gumbel(rep,theta=P, d=2)&#xA;c1 &amp;lt;- qnorm(gcopula[,1],mean=m1$mu,sd=sqrt(m1$Sigma))&#xA;c2 &amp;lt;-qnorm(gcopula[,2],mean=m2$mu,sd=sqrt(m2$Sigma))&#xA;dataGUM&amp;lt;-cbind(c1, c2)&#xA;&#xA;alfa=0.95&#xA;quantile(dataGUM, alfa)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As I have exposed the value of the quantile at 0.95 correspond to my estimated data &quot;data_E&quot; and not to the original one &quot;data&quot;, there is a way that I could find it?&lt;/p&gt;&#xA;" OwnerDisplayName="Michelle" LastActivityDate="2013-08-09T23:00:31.187" Title="A non parametric study of VaR with kernel density" Tags="&lt;r&gt;&lt;statistics&gt;&lt;finance&gt;&lt;risk-management&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7097" PostTypeId="1" CreationDate="2013-01-25T02:23:14.850" Score="1" ViewCount="266" Body="&lt;p&gt;I'm curious as to how many academic studies and industry white papers are actually using daily data to report intramonth drawdowns; specifically, when the papers are often reporting monthly signals, statistics, and performance. I would think it would be obvious that honest reporting would report risk statistics using daily data granularity, but considering they do not often explicitly state such, it is hard to say with certainty.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many of the daily data series themselves are hard to gather and guarantee same results (dividends, etc) over the long term. But there are numerous papers on topics such as multi-asset momentum strategies going back to the seventies. There would be a large difference in some risk metrics like drawdown if only monthly closing data points were sampled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any first-hand experience or references on the matter are appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit: Thanks for replies so far.  Just for clarification; I'm not really asking about the merits or pitfalls of sampling at different intervals-- I'm well aware of that. I'm asking more about experiences with various papers(academic) and white-papers(industry) that show monthly statistics back to the seventies (or more) and whether or not you've found that they divulge risk metrics (esp. drawdowns) based on daily or only monthly granularity.  It's important for comparison purposes to understand if they are underestimating risk measures in such old data. If some paper, displaying only monthly results, charts, and tables, tells me that the worst drawdown over 40 + years was -25% (some use data going back to twenties), I want to know if that included daily granularity or not. Unfortunately, I don't often see that clarification and so I'm wondering if it is the norm to only use monthly sampling for long term systematic studies with potentially sparse daily data available on total return series. There are some high low data available from CRSP and IDSI going back to the 60s, so I agree with Freddy that it can be done, just more interested in what has actually been applied in papers with older data, so they can be compared reliably.&lt;/p&gt;&#xA;" OwnerUserId="3040" LastEditorUserId="3040" LastEditDate="2013-01-25T20:33:42.720" LastActivityDate="2013-01-25T20:33:42.720" Title="Are Papers and Funds reporting Monthly drawdowns using daily granularity?" Tags="&lt;drawdown&gt;&lt;funds&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7098" PostTypeId="2" ParentId="7097" CreationDate="2013-01-25T06:21:27.630" Score="-2" Body="&lt;p&gt;You're right to recognize that the sampling interval of your risk metrics could make a huge difference. For drawdown, there's no reason not to use the same granularity as the data that one has, unless the author is deliberately shaping the curve to appear better than it actually is. A trivial example of this would be if you had a buy-and-hold portfolio in cash equities through May 6, 2010.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, for Sharpe ratio, VaR etc., it is difficult to get a meaningful value at high resolution.&lt;/p&gt;&#xA;" OwnerUserId="4614" LastActivityDate="2013-01-25T06:21:27.630" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7099" PostTypeId="2" ParentId="7077" CreationDate="2013-01-25T10:47:07.847" Score="5" Body="&lt;p&gt;If the density of $(X,Y)$ is known, then you may obtain the density of the sum $X+Y$ simply by applying the Jacobi's transformation formula, which describes the density of the transformed random variable $g(X,Y)$ for $g(x,y) = (x+y, x)$. Integrating out the $x$-component yields the density of $X+Y$. See Jacod/Protter Probability Essentials ch. 12 for details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure, if this is an answer you are expecting. Perhaps you could provide us with some more specific description of your modelling task. &lt;/p&gt;&#xA;" OwnerUserId="2822" LastActivityDate="2013-01-25T10:47:07.847" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7100" PostTypeId="2" ParentId="7048" CreationDate="2013-01-25T12:33:15.147" Score="5" Body="&lt;p&gt;You can find the derivation of the Heston characteristic function (its Fourier Transform) in &lt;a href=&quot;http://www.amazon.de/The-Volatility-Surface-Practitioners-Finance/dp/0471792519/ref=sr_1_1?ie=UTF8&amp;amp;qid=1359116448&amp;amp;sr=8-1&quot;&gt;Gatheral (2006)&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the characteristic function, you can optimize the model on the prices. There are multiple approaches to optimize, among others pattern search (which is very slow) and stochastic optimization (randomly jump around and stop after n iterations), but i recommend a mix of both. I often use adaptive simulated annealing for an inital calibration and then run a pattern search. Depending on the language you use, these are available as functions and its pretty simple to implement.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If I recall correctly, the Fourier transform/characteristic function of the Heston model is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \phi_T(u) = \exp\{C(u,\tau)\theta + D(u,\tau)v_0\}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ C(u,\tau)=\ \kappa \left[r_{-} \tau - \frac{2}{\eta^2}\log\left(\frac{1-g e^{-d\tau}}{1-g}\right) \right] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$D(u,\tau)=\ r_{-} \frac{1-e^{-d\tau}}{1-ge^{-d\tau}} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$g =\ \frac{r_{-}}{r_{+}} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_{\pm} =\ \frac{b\pm d}{\eta^2} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d =\ d=\sqrt{b^2-4ac} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$c =\ \frac{\eta^2}{2} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$b =\ \kappa-\rho\eta iu$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$a =\ -\frac{u^2}{2} - \frac{iu}{2} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gatheral provides derivations for SVJ, SVJJ, VarG, etc as well. &lt;/p&gt;&#xA;" OwnerUserId="1976" LastEditorUserId="35" LastEditDate="2013-01-25T14:13:27.650" LastActivityDate="2013-01-25T14:13:27.650" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7102" PostTypeId="2" ParentId="4435" CreationDate="2013-01-25T18:05:49.750" Score="1" Body="&lt;p&gt;Here is a piece on trying to replicate the results of low vol anomaly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://systematicedge.wordpress.com/2012/07/06/low-volatility/&quot; rel=&quot;nofollow&quot;&gt;http://systematicedge.wordpress.com/2012/07/06/low-volatility/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2318" LastActivityDate="2013-01-25T18:05:49.750" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7103" PostTypeId="1" CreationDate="2013-01-25T19:40:07.420" Score="5" ViewCount="819" Body="&lt;p&gt;What are some good ways to estimate the capacity of a strategy from historical data (including full market depth)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously, a naive approach is that you want the strategy's returns to exceed its market impact. PBs mostly provide their institutional clients with software packages that estimate market impact for large orders. However, many strategies have unique and more intricate entries/exit than large-order-buy-and-hold. Moreover, there are strategies that are low-capacity and contingent on market depth events, both of which I'm guessing require very different underlying assumptions than the market impact models used for large orders.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="467" LastEditDate="2015-03-13T06:12:08.770" LastActivityDate="2015-03-13T06:12:08.770" Title="How do you estimate the capacity of a strategy from historical data?" Tags="&lt;backtesting&gt;&lt;automated-trading&gt;&lt;historical&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7104" PostTypeId="1" CreationDate="2013-01-25T23:39:05.663" Score="5" ViewCount="672" Body="&lt;p&gt;Assume that you are given an arbitrary payoff profile for European vanilla position (e.g. butterfly). How  to make a back of the envelope sketch of a second order greek profile for it (i.e. plot showing dependency of a greek w.r.t. to spot or vol)? I'm interested in major second order greeks like &lt;code&gt;Dvega/Dvol&lt;/code&gt;, &lt;code&gt;Dgamma/Dspot&lt;/code&gt;, &lt;code&gt;Dgamma/Dvol&lt;/code&gt;, &lt;code&gt;Dvega/Dspot&lt;/code&gt;. The sketch should at least correctly show signs and relative value (i.e. highs/lows) of the greek.  &lt;/p&gt;&#xA;" OwnerUserId="370" LastActivityDate="2013-01-26T16:54:13.420" Title="How to quickly sketch a second order greek profile for a vanilla position?" Tags="&lt;options&gt;&lt;greeks&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7105" PostTypeId="2" ParentId="7104" CreationDate="2013-01-26T07:41:14.793" Score="2" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Use a pen, paper, lower the pen to touch the paper, and start sketching your intuition. ;-)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If that sounds &lt;strong&gt;too&lt;/strong&gt; simplistic then you could shift spot or implied vols by a percentage or point value and recalculate the shift impact either on spot or otherwise apply the shift to the closed form solution of those greeks you attempt to evaluate. As you evaluate a basic option and its greeks this should be a fairly easy exercise. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-01-26T07:41:14.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7106" PostTypeId="2" ParentId="7104" CreationDate="2013-01-26T09:14:26.450" Score="4" Body="&lt;p&gt;If your &quot;European vanilla options&quot; are restricted to piece-wise linear pay-offs, then the following may help:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remark: I assume you are looking for a rule of thumb to get the profiles without the use of a computer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All piece-wise linear pay-offs can be decomposed into a sum of digital options and call options with different notional (possibly negative) and strike. Thus you may learn the greek profile of these two by heart and then geometrically add the profiles according to the decomposition of your vanilla option.&lt;/p&gt;&#xA;" OwnerUserId="3548" LastEditorUserId="848" LastEditDate="2013-01-26T16:54:13.420" LastActivityDate="2013-01-26T16:54:13.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7107" PostTypeId="1" AcceptedAnswerId="7111" CreationDate="2013-01-26T09:57:37.363" Score="4" ViewCount="1367" Body="&lt;p&gt;I would like to ask about maybe obvious thing for many people, but cannot find a good answer for it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In many, many places I see &lt;a href=&quot;http://en.wikipedia.org/wiki/Open-high-low-close_chart&quot; rel=&quot;nofollow&quot;&gt;OHLC&lt;/a&gt; data along with OHLC analysis tools.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I deduce step by step in my calculation I think the Volume Weighted Average Price (VWAP) is the better choice. I see OHLC as a lossy compression of price and VWAP as a lossless compression of price information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand OHLC is faster for CPU/memory to process, but what are the other advantages/disadvantages of using OHLC and VWAP?&lt;/p&gt;&#xA;" OwnerUserId="4662" LastEditorUserId="467" LastEditDate="2013-01-29T13:31:29.157" LastActivityDate="2013-01-29T13:31:29.157" Title="What are the advantages/disadvantages of OHLC over VWAP?" Tags="&lt;vwap&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7108" PostTypeId="1" AcceptedAnswerId="7114" CreationDate="2013-01-26T10:50:59.113" Score="6" ViewCount="1660" Body="&lt;p&gt;I am working through &lt;a href=&quot;http://ssrn.com/abstract=1483412&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to implement the robust Bayesian optimization (see pages 6 onward) in Matlab using &lt;a href=&quot;http://www.mathworks.com/help/optim/ug/fmincon.html&quot; rel=&quot;nofollow&quot;&gt;fmincon&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a brief overview of my problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\alpha$ be the vector of returns and let $w$ be ta set of weights representing a portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, our usual mean-variance problem is to find the resultant portfolio weights that minimize the portfolio variance $\sigma^2(x)=w' \Sigma w$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the robust framework, the vector of returns is assumed to lie in some &lt;em&gt;uncertainty region&lt;/em&gt;, call it $U$. Here, the authors define that region to be the sphere centered at $\alpha$ with radius equal to $|\chi| \cdot \alpha$ with $\chi \in [0,1]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, our optimization problem now becomes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\min_\omega\omega'\Sigma\omega$  subject to $\min_Ur_p \geq r_0$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\Sigma$ is a positive definite matrix and $\omega$ is a vector of weights that sum to 1.&lt;br&gt;&#xA;Also:  $r_p=\alpha'\omega$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The authors show that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\min_U r_p=|\alpha||w|[cos(\phi)-\chi]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\phi$ is the angle between the two vectors $\alpha$ and $\omega$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They give the formula for the &quot;the robust covariance matrix family&quot; - (see page 7, eq. 13) as well as the formula for the optimized weights (see page 7, eq. 12).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to implement this in Matlab. However, one cannot use equations (12) or (13) as both equations require the optimized weights to be known. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is therefore, is there a method to implement a robust optimization such as this OR any suggestions as to how I could go about doing this???&lt;/p&gt;&#xA;" OwnerUserId="4618" LastEditorUserId="20913" LastEditDate="2016-10-24T09:43:21.687" LastActivityDate="2016-10-24T09:43:21.687" Title="Robust Bayesian portfolio optimization in matlab?" Tags="&lt;programming&gt;&lt;portfolio-management&gt;&lt;robust-optimization&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7109" PostTypeId="2" ParentId="7107" CreationDate="2013-01-26T12:11:18.560" Score="3" Body="&lt;p&gt;You are comparing apples and oranges here. OHLC is a concept of representing compressed data, the 4 data points representing the beginning, end, and extremes prices (or any other metric) traversed in between a specific time frame. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;VWAP is a concept of expressing price in combination with traded volume. It has nothing to do with time compression. In fact you can get a value for VWAP at any millisecond during the trading day. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Two entirely unrelated concepts. I am happy to delve more into the topic of each if you so wish but you first should really delineate each from the other. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-01-26T12:11:18.560" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7110" PostTypeId="2" ParentId="7103" CreationDate="2013-01-26T14:05:56.743" Score="2" Body="&lt;p&gt;I believe you approach this whole issue from the wrong end.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Market impact is a huge function of the size of your orders and therefore you cannot start to ask what strategies outperform certain market impact.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Instead you should start to think about required returns and associated risk tolerance. Also define prudent risk management rules. From that results an idea about the approximate trading size you are willing to put at risk. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;After you clearly defined your risk/reward you will start looking which asset classes, market, holding periods, most likely satisfy your requirements.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;After that you fine-tune your strategy approach and start thinking about particular strategies. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;And when you have done all that you start thinking about market impact on your orders as a function of all the above plus your estimated position sizes. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Without any other information on your end I find it impossible to help you further. I am not asking for anything related to your strategy but its very hard to make an educated guess whether your particular strategy's expected gross return exceeds transaction related cost, including market impact. You rejected to volunteer any other information with a condescending attitude. Maybe others appreciate your particular approach to asking for help more than I do. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-01-26T17:01:35.963" LastActivityDate="2013-01-26T17:01:35.963" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7111" PostTypeId="2" ParentId="7107" CreationDate="2013-01-26T15:18:08.037" Score="6" Body="&lt;p&gt;Both are for aggregating tick data, but they have very different uses. OHLC is generally for &lt;em&gt;visualizing&lt;/em&gt; price movements, while VWAP is often a &lt;em&gt;target price&lt;/em&gt; in an algo order. That is, an asset manager may wish to get filled at the VWAP by submitting an order to an algorithmic execution service. The asset manager will then see OHLC bars on his screen throughout the day.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2013-01-26T15:18:08.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7112" PostTypeId="1" AcceptedAnswerId="7115" CreationDate="2013-01-27T11:44:03.660" Score="16" ViewCount="4293" Body="&lt;p&gt;Recently a promising start-up (&lt;a href=&quot;http://www.ayasdi.com/&quot;&gt;Ayasdi&lt;/a&gt;) has made headlines. They are a spin-off of the Applied and Computational Algebraic Topology group of Stanford University (&lt;a href=&quot;http://comptop.stanford.edu/&quot;&gt;ComTop&lt;/a&gt;). What they basically do is visualizing the topological structure of &lt;a href=&quot;http://en.wikipedia.org/wiki/Big_data&quot;&gt;Big Data&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I know that this idea of applied (algebraic) topology crops up from time to time also in finance, see e.g. this blog post from Quantivity: &lt;a href=&quot;http://quantivity.wordpress.com/2011/05/08/manifold-learning-differential-geometry-machine-learning/&quot;&gt;Manifold learning&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is even an R-package with which you can play around (the concept behind it is persistent homology which is a robust variant of the topological invariant): &lt;a href=&quot;http://cran.r-project.org/web/packages/phom/index.html&quot;&gt;Phom&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question&lt;/strong&gt;&lt;br&gt;&#xA;I am interested in applications of topological methods in finance, i.e. references (books, papers, articles) and software applications, that you can use to do some tests on your own.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2016-01-01T01:08:32.383" Title="Topological methods in finance" Tags="&lt;reference-request&gt;&lt;software&gt;&lt;application&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="7113" PostTypeId="1" CreationDate="2013-01-27T14:07:01.307" Score="5" ViewCount="323" Body="&lt;p&gt;I have successfully chosen and estimate a copula for the ranks of the log-returns of my actions. My question is, &lt;strong&gt;since I have worked with the ranks instead of directly the log-returns&lt;/strong&gt; (in order to be in $[0,1]$) &lt;strong&gt;how can I simulate new data for the log-returns from my copula?&lt;/strong&gt;   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be more clear, here is the code commented:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(copula)&#xA;library(quantmod)&#xA;#stocks chosen: Microsoft, General Electric&#xA;stocks&amp;lt;-c(&quot;MSFT&quot;,&quot;GE&quot;)&#xA;start=&quot;1996-01-01&quot;&#xA;end=&quot;2000-12-31&quot;&#xA;ALL&amp;lt;-NULL&#xA;dailyLogReturns&amp;lt;-NULL&#xA;cours&amp;lt;-NULL&#xA;for(i in stocks){&#xA;  #get quotes from Yahoo&#xA;  temp&amp;lt;-getSymbols(i,from=start,to=end,auto.assign=FALSE)&#xA;  #store adjusted quotes&#xA;  #adjusted quotes are used due to split actions in the past&#xA;  cours&amp;lt;-cbind(cours,Ad(temp))&#xA;  #calculate daily log return for adjusted quotes&#xA;  dailyLogReturns&amp;lt;-cbind(dailyLogReturns,coredata(dailyReturn(Ad(temp),type='log')))&#xA;}&#xA;colnames(cours)&amp;lt;-stocks&#xA;colnames(dailyLogReturns)&amp;lt;-stocks&#xA;#ALL is the ranks of the log-returns, in [0,1]&#xA;ALL&amp;lt;-pobs(dailyLogReturns)&#xA;&#xA;#Here is the graph of the daily log-returns&#xA;plot(dailyLogReturns)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/swGDC.png&quot; alt=&quot;Plot of bivariate log-returns&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#Here is the graph of the ranks of the daily log-returns&#xA;plot(ALL)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/7Vsoe.png&quot; alt=&quot;Plot of bivariate ranks&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#Estimate the copula&#xA;#here i only show the Student, others have been tried without success.&#xA;#degres of freedom have been chosen independently&#xA;tc&amp;lt;-tCopula(param=c(0),dim=2,dispstr=&quot;un&quot;,df=7, df.fixed=TRUE)&#xA;ftc &amp;lt;- fitCopula(tc,ALL,method=&quot;mpl&quot;)&#xA;&#xA;#Goodness of fit for the copula, p-value is about 40%&#xA;time.start=Sys.time()&#xA;GOF&amp;lt;-gofCopula(tc, ALL, estim.method=&quot;mpl&quot;, simulation=&quot;mult&quot;)&#xA;Sys.time()-time.start&#xA;(GOF$p.value&amp;gt;0.05)&#xA;&#xA;#New data sample from the copula&#xA;Copula.data&amp;lt;-rCopula(1000,tCopula(0.417,df=7))&#xA;plot.new()&#xA;par(oma=c(1,1,1,1),mar=c(1,1,1,1))&#xA;plot(Copula.data,main=&quot;&quot;,xlab=&quot;&quot;,ylab=&quot;&quot;,col=&quot;red&quot;,pch=&quot;*&quot;);points(ALL,col=&quot;blue&quot;,pch=&quot;*&quot;)&#xA;&#xA;#Here is the plot: new data from copula (red) vs initial data (blue)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/gI3XV.png&quot; alt=&quot;Comparaison of data from copula (red) vs initial data (blue)&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;&lt;strong&gt;So, what have I tried?&lt;/strong&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I used the quantile function based on 1000 observations of daily log-returns to calibrate and 263 observations for back-testing&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;nb.calibration&amp;lt;-1000&#xA;nb.backtesting&amp;lt;-nrow(dailyLogReturns)-nb.calibration&#xA;a&amp;lt;-matrix(0,nb.backtesting,nb.calibration)&#xA;b&amp;lt;-matrix(0,nb.backtesting,nb.calibration)&#xA;for(i in 1:nb.backtesting){&#xA;  j=1+i;k=nb.calibration+i&#xA;  a[i,]=dailyLogReturns[j:k,1]&#xA;  b[i,]=dailyLogReturns[j:k,2]&#xA;  rmtc&amp;lt;-quantile(a[i,],Copula.data[,1])+quantile(b[i,],Copula.data[,2])&#xA;}&#xA;&#xA;plot(rmtc,type='l')&#xA;lines(dailyLogReturns[,1],col='red')&#xA;lines(dailyLogReturns[,2],col='blue')&#xA;#Here is the plot obtained: new data from the copula (black), Microsoft (blue), GE (red)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/bboTI.png&quot; alt=&quot;Comparaison of log-returns generated vs historical&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;&lt;strong&gt;Finally: Am I doing the right thing, is that correct ?&lt;/strong&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Sources:&lt;/strong&gt;&lt;br&gt;&#xA;- &lt;a href=&quot;http://www.rbi.org.in/scripts/PublicationsView.aspx?id=13336&quot; rel=&quot;noreferrer&quot;&gt;Estimation of Portfolio Value-at-Risk using Copula&lt;/a&gt;&lt;br&gt;&#xA;- &lt;a href=&quot;http://www.uclouvain.be/cps/ucl/doc/stat/documents/slides_kojadinovic_200511.pdf&quot; rel=&quot;noreferrer&quot;&gt;Some nonparametric tests for copulas with emphasis on goodness-of-fit tests&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2721" LastActivityDate="2013-01-27T14:07:01.307" Title="Estimation of ranks of log-returns via copula" Tags="&lt;estimation&gt;&lt;copula&gt;&lt;log-returns&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7114" PostTypeId="2" ParentId="7108" CreationDate="2013-01-27T14:32:51.527" Score="3" Body="&lt;p&gt;From a general point of view and to answer directly to your &lt;em&gt;originial&lt;/em&gt; question, you should only have to modify the inputs to the MATLAB function you refer to. As a matter of fact, &lt;code&gt;fmincon&lt;/code&gt; is an optimizer looking to process a broad variety of problems as explained in the documentation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;fmincon&lt;/code&gt; attempts to find a constrained minimum of a scalar function of several variables starting at an initial estimate. This is generally referred to as constrained nonlinear optimization or nonlinear programming.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You will not have to modify anything to the algorithm per say. You just need to make sure to get the inputs right which in this case is the target function you pass to &lt;code&gt;fmincon&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if you only want to use a shrinked matrix (given by equation 9 on page 5)  to obtain a more robust mean variance portfolio, you can do the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;SigmaHat=...;&#xA;robustMinVar = fmincon(@(x)(x' * SigmaHat * x), ...);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;SigmaHat&lt;/code&gt; is the shrinked covariance matrix you previously computed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume you are willing to compute the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\underset{w}{\arg \min} ~ \sigma^2(w) \quad \text{s.t.} \quad \underset{U_\alpha}{\arg \min} ~ r_P \geq r_0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to generate two functions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$f(w)$, the target function&lt;/li&gt;&#xA;&lt;li&gt;$c(w)$ a constraint function.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The constraint function is supposed to return the value of $\underset{U_\alpha}{\arg \min} ~ r_P$ and can be computed as mentioned in the formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in your script, simply do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% Here I define my variables&#xA;alpha=...;&#xA;chi=...;&#xA;r0=...;&#xA;function r=bayesConst(w)&#xA;  r= -(alpha' * w - chi* sqrt(sum(alpha.^2))*sqrt(sum(w.^2))-r0);&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note here that you create a function within the script to inject the variable &lt;code&gt;alpha&lt;/code&gt; and &lt;code&gt;chi&lt;/code&gt; and &lt;code&gt;r0&lt;/code&gt;. Notice also that I set up the function such that it has the form $c(w) \leq 0$. You have to input this in &lt;code&gt;fmincon&lt;/code&gt; as a non-linear constraint (the &lt;code&gt;nonloncon&lt;/code&gt; argument).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the other function is just computing the minimum variance with $w$, but I don't know if we should use the shrinked covariance matrix (of page 7) or not I would say yes intuitively.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2013-02-04T10:33:11.440" LastActivityDate="2013-02-04T10:33:11.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7115" PostTypeId="2" ParentId="7112" CreationDate="2013-01-27T14:41:46.330" Score="6" Body="&lt;p&gt;Check &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1420239&quot;&gt;Noncommutative Geometry and Stochastic Calculus: Applications in Mathematical Finance&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="370" LastActivityDate="2013-01-27T14:41:46.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7116" PostTypeId="2" ParentId="2446" CreationDate="2013-01-27T17:24:34.470" Score="2" Body="&lt;p&gt;The Bering Climate web site has the older version of the software that has some bugs when calculating regime shifts in variance. Those bugs appear to be fixed in the newer version available at &lt;a href=&quot;http://www.climatelogic.com&quot; rel=&quot;nofollow&quot;&gt;www.climatelogic.com&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="4667" LastActivityDate="2013-01-27T17:24:34.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7117" PostTypeId="2" ParentId="4834" CreationDate="2013-01-27T20:33:27.017" Score="1" Body="&lt;p&gt;you find theoretical results for the Ornstein-Uhlenbeck process if you search for &quot;pairs trading&quot;. In pairs trading it is assumed that the ratio of the pair is mean reverting. Then one often models this ratio as Ornstein–Uhlenbeck process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You find something on page 11 &lt;a href=&quot;http://www.yats.com/doc/cointegration-en.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Further theoretical results that might be of interest can be found &lt;a href=&quot;http://www.ms.unimelb.edu.au/publications/RampertshammerStefan.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All these results are theoretical and you can play with them. I don't know how much they help you in practice.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2013-01-27T20:33:27.017" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="7118" PostTypeId="1" AcceptedAnswerId="7145" CreationDate="2013-01-27T20:46:35.230" Score="2" ViewCount="298" Body="&lt;p&gt;I would like to model liquidity effects in my risk model which is based on historical simulation. I would like to develop a practical solution that still captures liquidity effects.&#xA;Most probably I have to treat equity markets and bonds markets separately but finally I would like to be able to apply some procedure for all assets in my multi-asset universe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For stocks: historical simulation here is based on historical returns from market prices (taking into account capital changes and so on). What can I add here to either incorporate liquidity as an additional factor or to attribute parts of the return to liquidity risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For bonds: historical simulation here is based on zero-rate-curves and spreads mainly. What can I add here?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking forward to an enlightening discussion. References and personal experiences are most welcome.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2013-01-29T16:07:08.457" Title="Liquidity in a market risk model based on historical simulation" Tags="&lt;risk-management&gt;&lt;risk-models&gt;&lt;market-risk&gt;&lt;liquidity-risk&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7121" PostTypeId="2" ParentId="728" CreationDate="2013-01-27T23:37:12.700" Score="7" Body="&lt;p&gt;&lt;strong&gt;Is it worth it to learn R?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Switching from C/C++ to R has increased my productivity and shrunk code line-counts for similar tasks by roughly an order of magnitude.  To give a small flavor of why, consider one of the most common patterns of iteration over some collection, selection and action:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    declare iterator for collection&#xA;    for element in collection&#xA;        if (element meets condition)&#xA;            do something with element&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In R this construct typically shrinks to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    collection[condition] &amp;lt;- new_values&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where &lt;code&gt;new_values&lt;/code&gt; is a vector expression as well.  And this is not only limited to arrays/vectors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In R, there's no need to declare iterator-variables and write loops to iterate over them because when acting on vectors (or higher dimensional data-structures) the loops are &lt;strong&gt;&lt;em&gt;implied&lt;/em&gt;&lt;/strong&gt;.  Similarly, there's no need to use &lt;strong&gt;&lt;em&gt;if&lt;/em&gt;&lt;/strong&gt; because subsetting via &lt;strong&gt;[ ]&lt;/strong&gt; implies a condition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Add to this the fact that off-by-one bugs, outside-array and null dereferences are no longer an issue, that hashes (using &lt;strong&gt;&lt;em&gt;$&lt;/em&gt;&lt;/strong&gt; list member references) are compact and part of the language, that visualizing data by turning it into a chart (see my avatar as an example of visualizing a 3-dimensional continuous-value table) is trivial, and you can start seeing the tremendous productivity jump.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Add ~4000 libraries in CRAN covering state-of-the-art statistics, data-mining and machine-learning libraries mean you often don't need to write code at all, just use what's out there.  Many of these libraries (where it matters) are already written in a compiled language (C or Fortran) so efficiency is largely taken care of.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&lt;strong&gt;Are 1 million values in R an issue?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The OP question mentions working on data-sets of 0.5 million values and whether this may be an issue with R.  Let's run a quick check:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;R&amp;gt; million.random.values.array &amp;lt;- rnorm(1e6, mean=5, sd=2)&#xA;R&amp;gt; mean(million.random.values.array)&#xA;[1] 5.000186&#xA;R&amp;gt; sd(million.random.values.array)&#xA;[1] 2.000551&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above 3 lines of R code complete instantaneously on my desktop. Memory consumption of all of R loaded with the session shows 120 MB virtual and 37 MB resident, so the answer is that ~1M element size of data-sets shouldn't generally be an issue.  I've used 1B-items data-set sizes on big memory 64-bit machines.  Reading data from a database using &lt;strong&gt;&lt;em&gt;RODBC&lt;/em&gt;&lt;/strong&gt; for example, or from a flat data file (csv, tsv, text), using &lt;strong&gt;&lt;em&gt;read.table/read.csv&lt;/em&gt;&lt;/strong&gt; or similar, instead, is trivial as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&lt;strong&gt;Inherent inefficiencies in R &amp;amp; possible remedies&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having said that, it &lt;strong&gt;&lt;em&gt;is&lt;/em&gt;&lt;/strong&gt; easy to write inefficient R code, both in terms of memory and speed.  The most common cause I've seen is building a data-frame iteratively (adding one column at a time, using cbind() or similar) because the copy-arguments on every call makes this $O(n)$ process become an $O(n^2)$ process.  Similarly, passing big data-structures as function arguments, like a full data-frame, when you only want to pass one or a subset of the columns, has its (pass by value copy) undesired cost.  If the last issue is your #1 slowness cause, you want to look at &lt;strong&gt;&lt;em&gt;data.table&lt;/em&gt;&lt;/strong&gt; library which allows passing args by reference using &lt;strong&gt;&lt;em&gt;:=&lt;/em&gt;&lt;/strong&gt;, and learning about the &lt;strong&gt;&lt;em&gt;&amp;lt;&amp;lt;-&lt;/em&gt;&lt;/strong&gt; operator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reading &lt;em&gt;Patrick Burns&lt;/em&gt; &lt;strong&gt;&lt;em&gt;&quot;The R inferno&quot;&lt;/em&gt;&lt;/strong&gt; (124 pages, available for free as PDF) is an excellent time investment as mentioned by &lt;em&gt;Quant Guy&lt;/em&gt; above if you're serious about learning R and avoiding the pitfalls.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also seconding &lt;em&gt;Dirk's&lt;/em&gt; comment that by using &lt;strong&gt;&lt;em&gt;Rcpp&lt;/em&gt;&lt;/strong&gt; it is possible to avoid the above pitfalls where it matters and write the low level critical loop code in C/C++ where needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&lt;strong&gt;Bottom line:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yes, time spent learning R is well worth it, but there's no one hammer to fit all needs.  Use the tool that's best for the job.&lt;/p&gt;&#xA;" OwnerUserId="4669" LastEditorUserId="4669" LastEditDate="2013-01-31T20:12:10.490" LastActivityDate="2013-01-31T20:12:10.490" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7122" PostTypeId="1" CreationDate="2013-01-28T00:51:56.727" Score="0" ViewCount="329" Body="&lt;p&gt;In [1], the authors state that &quot;Although some studies apply the curve-fitting method directly to option prices, the severely nonlinear relationship between option price and strike price often leads to numerical difficulties. [...], we apply the curve fitting method to implied volatilities instead of option prices&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've seen this kind of statement made in many other places before, but I haven't yet seen an explanation of why this is the case. Precisely what kind of numerical difficulties can one encounter when fitting a curve to option prices? Isn't the relationship between implied volatilities and strike prices also severely nonlinear?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[1] Jiang, E J. and Tian, G S., The Model-Free Implied Volatility and Its Information Content ( 2005). The Review of Financial Studies, Vol. 18, Issue 4, pp. 1305-1342, 2005. www.u.arizona.edu/~gjiang/JiangTian-RFS05.pdf&lt;/p&gt;&#xA;" OwnerUserId="2327" LastEditorUserId="2327" LastEditDate="2013-01-28T04:17:25.123" LastActivityDate="2013-01-28T04:51:54.663" Title="Numerical difficulties in fitting option prices" Tags="&lt;option-pricing&gt;&lt;modeling&gt;&lt;implied-volatility&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7123" PostTypeId="2" ParentId="7118" CreationDate="2013-01-28T01:01:32.097" Score="3" Body="&lt;p&gt;Couple points for your consideration:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;At the time of order execution: You are most likely a liquidity taker and thus are rendered a service by those that provide liquidity and you compete for taking liquidity with other takers in the market. As such you need to have a firm grasp at the market impact of your order. &lt;/li&gt;&#xA;&lt;li&gt;Liquidity can be extremely dynamic even intra-day and thus it is a major concern for anyone occupied with getting done optimal execution. &lt;/li&gt;&#xA;&lt;li&gt;It is very important to understand the free float of a stock and how trading volume relates to such free float. A free float may suggest that a stock is highly liquid but if not many of its holders are willing to surrender the stock then traded volume may be extremely thin. &lt;/li&gt;&#xA;&lt;li&gt;Even if trading volume is sufficient it may just mean that a stock is flipped without much accompanying price change. Think of it in this way: If there is a demand/supply equilibrium then the current price is a fair price and won't change much. So you may possibly see high trading volume but not much price change. &lt;/li&gt;&#xA;&lt;li&gt;Liquidity in the fundamental sense really becomes important when a stock exhibits a high short sale ratio. Someone may place a tender offer for the outstanding shares and every last short seller will scramble to buy back the shares in order to return their borrows. An excellent example what happens at such times is the Volkswagen/Porsche story a while back. Just pull up a daily or weekly chart and you will see what I am talking about. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-01-28T01:01:32.097" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7124" PostTypeId="2" ParentId="7122" CreationDate="2013-01-28T02:31:31.073" Score="1" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;There is a market accepted standard to translate vanilla option prices to implied vols and backward which is the Black Scholes (BS) options pricing formula. There is no ambiguity here, everyone knows of the deficiencies of BS yet its what people use to translate between iVols &amp;lt;-&gt; prices. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The numerical difficulty I see is to make more realistic assumptions and to incorporate them into your model&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The real challenge in trading options is a) the relaxing of unrealistic but simplifying assumptions and b) to predict volatility which in turn enables you to determine whether you believe implied vols (or option prices) are trading too rich or too cheap. This in fact I believe is the true skill of a successful option trader. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Edit: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case you refer to the commends in section 1.2, first of all there is really no model-free implied volatility. I find it ironic how they use this term throughout the paper and at the same time mention about B-S, SVJ Volatility model, and what have you. There is always an underlying &quot;model&quot; or translation engine at work to convert from implied vols to options prices and vice versa. Also when only considering vols and strike prices you must assume an underlying model. They go into detail in 1.2.4 but they make less and less sense: They concern themselves with curve fitting techniques but at the same time make the assumptions of &quot;zero interest rates, zero dividends, model prices instead of market prices&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I am a market practitioner, I have to make my living pricing and trading this stuff. I would claim I am able to follow most academic papers targeting quant finance space, but it does not mean I agree with them all. From the abstract I do not understand what they actually try to achieve, and even throughout the paper I am not sure which goal they actually try to reach. Everyone in the market interpolates and applies curve fitting techniques to vol surfaces and such. So what, and as I mentioned above &quot;model free&quot; does not exist in options world, imho. Otherwise options traders would be paid on about the same pay scale as a part-time convenience store employee. It takes a little more than model-free. Thats my take of this. I would concern myself with more interesting and challenging topics and not read too much into this particular paper. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just my 2 cents&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-01-28T04:51:54.663" LastActivityDate="2013-01-28T04:51:54.663" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7125" PostTypeId="1" AcceptedAnswerId="7128" CreationDate="2013-01-28T11:00:24.580" Score="9" ViewCount="4777" Body="&lt;p&gt;I have a question regarding the simulation of a GBM. I have found similar questions here but nothing which takes reference to my specific problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given a GBM of the form &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS(t) = \mu S(t) dt + \sigma S(t) dW(t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;it is clear that this SDE has a closed form solution in &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S(t) = S(0) exp ([\mu - \frac{1}{2}\sigma^2]t + \sigma W(t))$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for a given $S(0)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I have found sources claiming that in order to simulate the whole trajectory of the GBM, one needs to convert it to its discrete form (e.g., a similar question here or Iacus: &quot;Simulation and Inference for Stochastic Differential Equations&quot;, 62f.). Yet, in Glasserman: &quot;Monte Carlo Methods in Fin. Eng.&quot;, p. 94, I find that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S(t_{i+1}) = S(t_i) exp ([\mu - \frac{1}{2}\sigma^2](t_{i+1}-t_i) + \sigma\sqrt{t_{i+1}-t_i} Z_{i+1})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $i=0,1,\cdots, n-1$ and $Z_1,Z_2,\cdots,Z_n$ are independent standard normals is an exact method (i.e., has no apprximation error from discretization).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I really don't understand what the difference between the two is, or put differently, if the exact method lets me simulate the whole trajectory, why would I bother converting it to the discrete form?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe I'm just not seeing the point here but I'm really confused and grateful for any help!&lt;/p&gt;&#xA;" OwnerUserId="4674" LastEditorUserId="4674" LastEditDate="2013-01-28T13:27:10.773" LastActivityDate="2018-06-04T10:37:09.877" Title="Simulation of GBM" Tags="&lt;monte-carlo&gt;&lt;stochastic-processes&gt;&lt;simulations&gt;&lt;brownian-motion&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7126" PostTypeId="2" ParentId="7125" CreationDate="2013-01-28T12:37:35.853" Score="5" Body="&lt;p&gt;&lt;strike&gt;Note: There is a typo in your third equations. Instead of $S(u)$ it should be $S(t_{i})$ and in place of $S(t)$ there should be $S(t_{i+1})$.&lt;/strike&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, given $S(t_{i})$ we have that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S(t_{i+1}) = S(t_{i}) \exp\left( (\mu - \frac{1}{2} \sigma^2) (t_{i+1} - t_{i}) + \sigma (W(t_{i+1}) - W(t_{i})) \right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is the &lt;em&gt;exact&lt;/em&gt; solution of the SDE. Hence, the discretization is exact (which is a special case here).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that $W(t_{i+1})$ is not independent of $W(t_{i})$ but $W(t_{i+1})-W(t_{i})$ is independet from  $W(t_{i})-W(t_{i-1})$. So in order to simulate the discrete points $S(t_{j})$ for different $j$ you use the representation above with i.i.d. random variable $Z_{j}$ with $W(t_{j})-W(t_{j-1}) = \sqrt{t_{j}-t_{j-1}} Z_{j}$ and not the representation &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S(t_{i+1}) = S(0) \exp\left( (\mu - \frac{1}{2} \sigma^2) t_{i+1} + \sigma W(t_{i+1}) \right)$$.&lt;/p&gt;&#xA;" OwnerUserId="3548" LastEditorUserId="3548" LastEditDate="2013-01-28T20:14:54.240" LastActivityDate="2013-01-28T20:14:54.240" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7127" PostTypeId="1" AcceptedAnswerId="7129" CreationDate="2013-01-28T13:02:35.917" Score="3" ViewCount="974" Body="&lt;p&gt;&lt;strong&gt;How can I test the significance of a pair trading strategy&lt;/strong&gt;, i.e. that the H0 is &quot;The strategy has no predicting power&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was considering to use the technique in &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470008741&quot; rel=&quot;nofollow&quot;&gt;Evidence Based Technical Analysis&lt;/a&gt; that test the strategy against a benchmark built by detrending the price series, but I think that this doesn't work in the pair trading strategy because the linear combination of the two price series is already detrended.&lt;/p&gt;&#xA;" OwnerUserId="2257" LastActivityDate="2013-01-28T18:29:47.453" Title="Statistical significance of a pair trading strategy" Tags="&lt;statistics&gt;&lt;pairs-trading&gt;&lt;mean-reversion&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7128" PostTypeId="2" ParentId="7125" CreationDate="2013-01-28T13:14:21.990" Score="6" Body="&lt;p&gt;For completeness, let's restate that the discrete case goes like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta S_t = S_{t+\Delta t}- S_t = \mu S_t \Delta t + \sigma S_t \sqrt{\Delta t} Z_t $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $Z_t \sim \mathcal{N}(0,1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you are doing in your case is to use the exact solution of the SDE to model the movement between two points of $S$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Essentially, you are doing the same thing with the 2 approaches.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually, if you choose a $\Delta t$ small enough, you shall have almost no difference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your question can be reversed: &lt;em&gt;if you can simply simulate the path using the discrete version, why would you care about solving the SDE to get the closed-form formula&lt;/em&gt;?&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="34518" LastEditDate="2018-06-04T10:37:09.877" LastActivityDate="2018-06-04T10:37:09.877" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="7129" PostTypeId="2" ParentId="7127" CreationDate="2013-01-28T14:00:27.603" Score="3" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;if you just want to test for significance of the generation of returns exceeding a hurdle rate then you can just setup a standard hypothesis test where you test whether your returns you generate from back tests exceeds a certain return. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;if you are more interested in testing for co-integration then you should consider the Johansen and/or Engle-Granger tests for starters.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-01-28T14:00:27.603" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7130" PostTypeId="2" ParentId="7127" CreationDate="2013-01-28T18:29:47.453" Score="0" Body="&lt;p&gt;Do you have a specific strategy in mind? If so can use past data to identify the pairs you want to trade, and parameters (e.g. how big should the spread be before you buy/short) using your strategy, then use this results on the out of sample period. For example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have 1000 daily observations. You use 0 to 250 to select pairs and parameters, than you use test how they perform in period 250 to 500. Then you use 250 to 500 to select pairs and parameters and test them in 500 to 750 and so on...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see how well your strategy performed by recording performance of every pair and testing that the mean of those performances is different from 0 (if you want to test against 0). Make sure that you are taking bid-ask spread into account. &lt;/p&gt;&#xA;" OwnerUserId="2512" LastActivityDate="2013-01-28T18:29:47.453" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7131" PostTypeId="2" ParentId="3284" CreationDate="2013-01-28T18:33:38.403" Score="5" Body="&lt;p&gt;I'm dissatisfied with the intraday minute data. I've found bad gaps, particularly on Fridays' data. They won't answer complains and they won't fix it either. &lt;/p&gt;&#xA;" OwnerUserId="4677" LastEditorUserId="35" LastEditDate="2013-01-29T14:10:26.467" LastActivityDate="2013-01-29T14:10:26.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7132" PostTypeId="2" ParentId="4083" CreationDate="2013-01-28T18:50:35.423" Score="2" Body="&lt;p&gt;I emailed one of my contacts at NYSE, who replied that there is no rule or policy governing half days (other than that the exchange must be opened for a full day on the last day of the year).&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2013-01-28T18:50:35.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7134" PostTypeId="1" CreationDate="2013-01-29T01:55:20.340" Score="12" ViewCount="1603" Body="&lt;p&gt;I have a degree in mathematics, and I've worked as a statistician and done some programming work. I'm very strong in my math/stats/programming background and have browsed some QF books, and I'm very interested. I'm American, but I'm currently out of the country, and I don't know if seeking a hedge fund/firm where I am is so practical.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I need a fat bank roll to get started, or are there fields of finance that I can perhaps get involved with assuming I put in the time to study and (hopefully) develop killer software.&lt;/p&gt;&#xA;" OwnerUserId="4683" LastEditorUserId="1418" LastEditDate="2013-01-30T06:38:09.390" LastActivityDate="2019-05-07T05:10:16.877" Title="What are the options for a mathematician to break into QF without working for a fund?" Tags="&lt;trading&gt;&lt;mathematics&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="6" ClosedDate="2019-05-09T04:24:35.020" ContentLicense="CC BY-SA 3.0" />
  <row Id="7135" PostTypeId="2" ParentId="557" CreationDate="2013-01-29T02:18:20.357" Score="5" Body="&lt;p&gt;Compared to commercial offerings, Quickfix isn't that bad - considering you can pay $10000's for the very best ULL engines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have conducted side by side testing of Quickfix and &lt;a href=&quot;http://www.fix8.org&quot; rel=&quot;nofollow&quot;&gt;Fix8&lt;/a&gt; measuring encode/decode latency for NewOrderSingle(D) messages, see &lt;a href=&quot;http://fix8.org/performance.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="4685" LastEditorUserId="848" LastEditDate="2013-01-29T09:54:57.127" LastActivityDate="2013-01-29T09:54:57.127" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7136" PostTypeId="2" ParentId="7134" CreationDate="2013-01-29T03:02:17.697" Score="13" Body="&lt;ul&gt;&#xA;&lt;li&gt;At the top of this list I still recommend you to seek employment in order to learn from others in QF space. Could you possible work in a quant team within an investment bank where you currently reside?&lt;/li&gt;&#xA;&lt;li&gt;Start to reach out to the quant finance community so you are connected once you decide to locate to where you can practice this discipline.reach out to alumni, friends, anyone who may work in this field.&lt;/li&gt;&#xA;&lt;li&gt;have you considered an academic career in quantitative finance?&lt;/li&gt;&#xA;&lt;li&gt;Spend sufficient time in figuring out which part of quant finance you really like: Risk management, time series modeling, high frequency trading, proprietary trading, discretionary trading, fundamental quantitative research...&lt;/li&gt;&#xA;&lt;li&gt;make sure you are on top of the latest developments at the R front and know which packages are utilized. Refresh your skills in the mathematical and statistical modeling aspects. Are you familiar with new C++ libraries such as AMP, .net 4.0 or 4.5, you can use Python? Those are just examples but knowing well the tools of the trade is a basic requirement.&lt;/li&gt;&#xA;&lt;li&gt;You then could proceed to start reading books which may help you to better understand what quants really do. I like &quot;my life as a quant&quot; by Derman but personally I think nothing beats direct contact with alumni who work in the industry. Also get your hands on &quot;quantitative Finance interview questions&quot; ( I think that was the title but not 100% sure, but I am sure it's by falcon crack)&lt;/li&gt;&#xA;&lt;li&gt;How about you start profiling and modeling financial time series? This will sharpen your skills to analyze potential strategy opportunities as well as force you to use the tools you would be expected to know.&lt;/li&gt;&#xA;&lt;li&gt;you could develop a trading architecture (or extend existing open source ones) to demonstrate to others later on that you indeed have a passion for this field and want to work there. Does not have to be a trading architecture if you find tools that let you test strategy ideas then I think nothing beats approaching employers in the future with strategies in your hand that could be profitably employed. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Good luck in your quest&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-01-29T03:07:49.240" LastActivityDate="2013-01-29T03:07:49.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7137" PostTypeId="2" ParentId="7134" CreationDate="2013-01-29T03:12:59.497" Score="13" Body="&lt;p&gt;&lt;em&gt;Edit:  Freddy's answer is good -- we wrote concurrently.  He rightly points out that QF is a broad field, and that it is among other things a community.  Here, I describe a practical, down-to-earth path for getting your feet wet in one key piece of it -- software and model development for derivatives analysis, starting with vanilla options.  Your best bet would be to take any advice you find here with a grain of salt, and find your own path, which you will need to do anyway if you're going to survive in this industry.&lt;/em&gt;  ;-)&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Get set up with a brokerage which has a good paper-trading interface (one identical to their live interface).  Stay away from the web-only interfaces.&lt;/li&gt;&#xA;&lt;li&gt;Don't believe anything the broker's interface tells you about greeks.  Assume everything is wrong (you'll find much of it is).  Do your own work, write your own code.  &lt;/li&gt;&#xA;&lt;li&gt;Paper trade your code, starting with plain vanilla options. &lt;/li&gt;&#xA;&lt;li&gt;Assume that much of what you find in books and papers is wrong as well (you still need to know it, if only for reference in conversations with others, and to know what you need to improve upon).  &lt;/li&gt;&#xA;&lt;li&gt;Continue past the first and second order derivatives quickly -- don't waste your time trying to over-optimize for those.  Things start getting more interesting as you go up the scale, and as you get out of vanillas and into exotics.&lt;/li&gt;&#xA;&lt;li&gt;Finally, once you think you're doing well on paper, open a real account, and prepare to be impressed with how quickly you're able to destroy capital -- you will.  It's tuition cost, and you really don't start learning until your own money is on the line.  Whether you actually take this step or not will have a lot to do with what sort of manager will hire you -- whether they want academic versus real-world skillset (there are advantages to both).&lt;/li&gt;&#xA;&lt;li&gt;Wash, rinse, repeat.   &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2168" LastEditorUserId="2168" LastEditDate="2013-01-29T05:06:02.567" LastActivityDate="2013-01-29T05:06:02.567" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7138" PostTypeId="2" ParentId="303" CreationDate="2013-01-29T07:35:18.620" Score="7" Body="&lt;p&gt;I work at Trayport, the leading provider of European energy trading solutions. We use F# alongside C# in our trading screen &lt;a href=&quot;http://www.trayport.com/uk/products2/joule&quot; rel=&quot;nofollow noreferrer&quot;&gt;Joule&lt;/a&gt;. F# is used for our calculation engine, domain, high performance components and for handling concurrency.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The calculation engine leverage's F#'s union types, pattern matching and &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/dd233243.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;units of measure&lt;/a&gt; feature.&lt;/li&gt;&#xA;&lt;li&gt;The domain leverages F#'s rich object orientated constructs.&lt;/li&gt;&#xA;&lt;li&gt;F# is particularly strong at concurrency with first class events, built-in &lt;a href=&quot;http://www.developerfusion.com/article/139804/an-introduction-to-f-agents/&quot; rel=&quot;nofollow noreferrer&quot;&gt;agents&lt;/a&gt;, asynchronous workflows and immutability as a default.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As a statically typed .Net language F# has similar performance characteristics to C#, with additional optimizations including tail calls and &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/dd548047.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;inline functions&lt;/a&gt;. Performance of the system is comparable to the previous highly optimized C++ implementation and on some key components it is significantly faster.&lt;/p&gt;&#xA;" OwnerUserId="4649" LastEditorUserId="-1" LastEditDate="2017-01-13T09:16:04.390" LastActivityDate="2017-01-13T09:16:04.390" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7139" PostTypeId="2" ParentId="303" CreationDate="2013-01-29T08:12:42.520" Score="18" Body="&lt;p&gt;I help organize the &lt;a href=&quot;http://meetup.com/fsharplondon&quot;&gt;F#unctional Londoners Meetup group&lt;/a&gt;. A good number of our 450+ members work in London's finance sector. Over the past 2 years we have hosted a number of talks related to F# in trading:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://skillsmatter.com/podcast/open-source-dot-net/fsharp-in-the-enterprise&quot;&gt;Simon Cousins on F# in the Enterprise&lt;/a&gt; -  F# at E.ON Energy Trading&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://skillsmatter.com/podcast/home/alea-cuda-combining-the-computational-power-of-gpus-with-the-functional-elegance-of-f&quot;&gt;Daniel Egloff - F# on the GPU with Alea.CUDA&lt;/a&gt; - developed for derivative pricing&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://skillsmatter.com/podcast/home/fsharp-numerics&quot;&gt;Adam Mlocek on GPU enabled F# numerics&lt;/a&gt; - includes pricing a euro option by Monte Carlo&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://skillsmatter.com/podcast/scala/fsharp-finance&quot;&gt;Tomas Petricek on F# Domain Specific Languages for Finance&lt;/a&gt; - including modelling and evaluating contracts&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="4649" LastActivityDate="2013-01-29T08:12:42.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7140" PostTypeId="1" CreationDate="2013-01-29T09:14:31.153" Score="14" ViewCount="588" Body="&lt;p&gt;I am interested in references on research regarding the consistency of economic scenarios in nested stochastics for risk measurement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Background:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Pricing by Monte-Carlo:&#xA;For pricing complex derivatives Monte-Carlo simulation is a well established method. It works by generating iid samples of the underlying risk-factors, evaluating and discounting the pay-off in each sample path and finally calculating the average over all samples. The distribution used for sampling is a &quot;risk-neutral&quot; distribution. The process of deriving and calibrating those distributions is technically difficult but well understood on a conceptual level.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Risk Measurement&#xA;There are several approaches to measuring the risk of such a position. One approach, which is employed in an insurance and banking regulation context, works by estimating the distribution of position prices after a prescribed period (such as one year for insurance) and applying a risk measure such as Value at Risk to the resulting p&amp;amp;l, which is just the difference in value between t=1 and t=0, say.Of course the change in the underlying risk factors over the measurement period is modeled by a distribution. This distribution is different from the distribution for valuation under 1. on the interval [0;1] and is called the real-world distribution of market states.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Nested Stochastics for risk measurement:&#xA;Creating sample paths for risk measurement using Monte-Carlo simulation, now works in a two-step process. &#xA;i) Generate a sample of market states at t=1 according to the/a real world distribution (these are called outer nodes or outer samples)&#xA;ii) For each of those samples of market states, generate risk neutral samples of paths from t=1 onwards which are consistent with the market state. (called inner samples) The actual distribution of prices at t=1 is then calculated by applying the Monte-Carlo valuation as described in 1. for each set of inner samples created in ii).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Question of consistency: &#xA;There is one straightforward question of market consistency at each outer node, i.e. how to ensure that risk neutral scenarios are consistent with the market states of the outer node. But except for practical issues, I think this is just the same question as the calibration at t=0, i.e. how to ensure pricing consistent with current market parameters. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I see another issue with consistency, which is harder for me to understand. Already at t=0 risk neutral and real world measures are constrained by well defined consistency conditions. They are equivalent measures connected by a change of measure involving the current price of risk.For nested stochastics, you need to have some sort of consistency between the t=0 risk neutral measure and the sample of measures, each being contingent on the market states at t=1. Already in plain-vanilla processes, there are straightforward consistency requirements, such as expectation at t=0 being the integral of expectations at t=1. But the case here is more difficult, due to the mix of measures over the first and subsequent periods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So here is my question: Do you know of any research such as textbooks or papers explaining or discussing these questions? Note that I am currently neither concerned with the formidable practical questions of the approach nor with potential alternatives or any simplifications to it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any hints are highly appreciated&lt;/p&gt;&#xA;" OwnerUserId="482" LastEditorUserId="848" LastEditDate="2013-01-29T11:59:30.030" LastActivityDate="2019-08-25T21:00:55.083" Title="Consistency of economic scenarios in nested stochastics simulation" Tags="&lt;risk-management&gt;&lt;monte-carlo&gt;&lt;stochastic-processes&gt;&lt;risk-neutral-measure&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7141" PostTypeId="2" ParentId="3383" CreationDate="2013-01-29T11:29:25.750" Score="2" Body="&lt;p&gt;I am using QuickFIX/n, initially there were no methods to change the sequence number but we requested the QuickFIX/n developer community for adding methods to change the sequence numbers and in the later builds &lt;strong&gt;Session.NextTargetMsgSeqNum&lt;/strong&gt; and &lt;strong&gt;Session.NextSenderMsgSeqNum&lt;/strong&gt; were added to change the sequence number.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And i was able to easily change the sequence numbers according to my requirements using the methods &lt;strong&gt;Session.NextTargetMsgSeqNum&lt;/strong&gt; and &lt;strong&gt;Session.NextSenderMsgSeqNum&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2369" LastActivityDate="2013-01-29T11:29:25.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7142" PostTypeId="2" ParentId="7134" CreationDate="2013-01-29T11:40:19.763" Score="7" Body="&lt;p&gt;I think one of the best (and very current) articles about how to break into QF (for any kind of background) is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://web.archive.org/web/20181107185625/http://www.markjoshi.com/downloads/advice.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;On becoming a Quant&quot; by Mark Joshi&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your special background in mathematics see this excerpt from section 9:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The main challenge for a pure mathematician is to be able to get one’s&#xA;  hands dirty and learning to be more focussed on getting numeric&#xA;  results than on fancy theories. The main way to do this is to&#xA;  implement pricing models for practice. If this doesn’t appeal you&#xA;  aren’t suited to being a quant. There are quite a few ex-pure&#xA;  mathematicians working in the city so it can certainly be done but&#xA;  there is some prejudice in favour of applied maths and physics people.&#xA;  Generally, people tend to hire people who are like them so if you can&#xA;  ﬁnd anyone with a similar background working in the city, apply to&#xA;  them.&lt;br&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;I sometimes get asked by people whether they should do a pure maths&#xA;  PhD or a ﬁnancial maths one. If you are absolutely sure you want to do&#xA;  derivatives pricing then you should do it in ﬁnancial maths. (Yes, I&#xA;  am taking PhD students but have no capacity at the moment.) If you&#xA;  aren’t sure then don’t. A good compromise is to do stochastic&#xA;  calculus, this is a hard area which will give plenty of intellectual&#xA;  stimulation and leave you very well placed for working in derivatives&#xA;  if you ever want to make the switch.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2019-05-07T05:10:16.877" LastActivityDate="2019-05-07T05:10:16.877" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="7143" PostTypeId="2" ParentId="303" CreationDate="2013-01-29T11:45:09.590" Score="3" Body="&lt;p&gt;We use it in sports trading. Mostly because our quantitive analysts creating the mathematical models understand F# quite easily, while they completely gave up on C# :D&lt;/p&gt;&#xA;" OwnerUserId="4687" LastActivityDate="2013-01-29T11:45:09.590" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7144" PostTypeId="2" ParentId="7053" CreationDate="2013-01-29T13:57:36.533" Score="8" Body="&lt;p&gt;The term &lt;em&gt;in sample&lt;/em&gt; and &lt;em&gt;out of sample&lt;/em&gt; are commonly used in any kind of optimization or fitting methods (MVO is just a particular case).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you make the optimization, you compute optimal parameters (usually the weights of the optimal portfolio in asset allocation) over a given data sample, for example, the returns of the securities of the portfolio for the past 5 years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The thing is, if you run your strategy over the given data set (over the last five years), you do it &lt;em&gt;in-sample&lt;/em&gt; i.e you evaluate your result &lt;strong&gt;over the sample you used to fit it&lt;/strong&gt;. This should technically give you the best possible result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you evaluate the strategy over the next two months, then you will do it &lt;em&gt;out of sample&lt;/em&gt;, i.e you evaluate &lt;strong&gt;on a period which is different from the one you optimized the strategy on&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In asset allocation, it is important to use out of sample backtesting because you will only be able to invest &lt;em&gt;today&lt;/em&gt; the result of an optimization made &lt;em&gt;today&lt;/em&gt;. Hence you will earn &lt;em&gt;tomorrow's&lt;/em&gt; strategy performance; not &lt;em&gt;yesterday&lt;/em&gt;'s.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2013-01-29T13:57:36.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7145" PostTypeId="2" ParentId="7118" CreationDate="2013-01-29T16:07:08.457" Score="5" Body="&lt;p&gt;&lt;strong&gt;Autocorrelation of returns can be used as a proxy measure for liquidity of the asset.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The degree of serial correlation in an asset’s returns can be viewed as a proxy for the magnitude of the frictions, and illiquidity is one of the most common forms of such frictions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A strongly liquid asset should reveal no serial autocorrelation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can perhaps build it into your model.&lt;/p&gt;&#xA;" OwnerUserId="4675" LastActivityDate="2013-01-29T16:07:08.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7146" PostTypeId="2" ParentId="4751" CreationDate="2013-01-29T17:11:55.783" Score="3" Body="&lt;p&gt;In my opinion &quot;risk-free rate&quot; and &quot;of Solvency II&quot; are still not entirely defined terms. This is why the answer to your question is not entirely defined as well. As Solvency II is not yet in force the only specific information available is from the various impact studies and subject to change. The most recent impact study is the LTGA. You find the specs for this &lt;a href=&quot;https://eiopa.europa.eu/consultations/qis/insurance/long-term-guarantees-assessment/technical-specifications/index.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several base rates to be tested, all found &lt;a href=&quot;https://eiopa.europa.eu/fileadmin/tx_dam/files/consultations/QIS/Preparatory_forthcoming_assessments/final/A/Appendix_DC5_Risk-free_curves.zip&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I understand it, interest-sensitive assets under stress are to be valued according to the respective stressed curve applied to the unstressed base rate from above. Of course, without applying adjustments like matching or transitional measures.&lt;/p&gt;&#xA;" OwnerUserId="482" LastEditorUserId="35" LastEditDate="2013-01-29T18:10:14.760" LastActivityDate="2013-01-29T18:10:14.760" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7147" PostTypeId="1" AcceptedAnswerId="7148" CreationDate="2013-01-29T17:32:51.463" Score="8" ViewCount="4252" Body="&lt;p&gt;My question is rather intuitive than formal and circles around the derivation of Ito's Lemma. I have seen in a variety of textbooks that by applying Ito's Lemma, one can derive the exact solution of a geometric Brownian Motion. So, if one has &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS = a(S,t)dt + b(S,t)dZ$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the first part on the right side of the equation is the (deterministic) drift rate and the second term is the stochastic component. Now I have read that ordinary calculus cannot handle the stochastic integral because for example &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{dZ}{dt} = \phi \frac{1}{\sqrt{dt}}\\&#xA;\rightarrow \infty \text{ as } dt \rightarrow 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But Ito came along and proposed something which culminated in his famous Ito Lemma which helped calculate the stochastic integral. What I don't understand is the step taken from realizing that ordinary calculus does not work in this context to proposing a function $G = G(S,t) \text{ of } S(t)$, Taylor-expaning it, etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or more precisely: What did Ito realize and propose that helped solve the stochastic integral?&lt;/p&gt;&#xA;" OwnerUserId="4674" LastActivityDate="2015-03-04T16:53:14.517" Title="Derivation of Ito's Lemma" Tags="&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;&lt;itos-lemma&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7148" PostTypeId="2" ParentId="7147" CreationDate="2013-01-29T19:11:27.603" Score="16" Body="&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0521552893&quot;&gt;Baxter and Rennie&lt;/a&gt; say it better than me, so I will summarize them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose that $N_t$ is not stochastic and $f(.)$ is a smooth function then the Taylor expansion is&#xA;$$&#xA;df(N_t) = f'(N_t)dN_t + \frac{1}{2}f''(N_t)(dN_t)^2 + \frac{1}{3!} f'''(N_t)(dN_t)^3 + \ldots&#xA;$$&#xA;and the term $(dN_T)^2$ and higher terms are zero. Ito showed that this is &lt;em&gt;not&lt;/em&gt; the case in the stochastic case. Suppose $W_t$ follows a Brownian motion and let &#xA;$$&#xA;Z_{n, i} = \frac{W\left(\frac{ti}{n}\right) - W\left(\frac{ti}{n}\right)}{\sqrt{t/n}}&#xA;$$&#xA;now consider&#xA;$$&#xA;\int_0^t (dW_t)^2 \approx t \sum_{i=1}^n \frac{Z^2_{n,i}}{n}.&#xA;$$&#xA;If $n \to \infty$ then $\sum_{i=1}^n \frac{Z^2_{n,i}}{n} \to 1$ and thus $\int_0^t (dW_t)^2 = t \neq 0$. Thus the second order term does not cancel (but higher order terms do) and we have an extra term in our derivative.&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="848" LastEditDate="2013-01-29T19:19:12.483" LastActivityDate="2013-01-29T19:19:12.483" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7149" PostTypeId="1" AcceptedAnswerId="7154" CreationDate="2013-01-29T19:56:48.667" Score="3" ViewCount="308" Body="&lt;p&gt;I am very confused about why different volatility estimators (RV, RAV, BPV, etc) exist. If the goal is to find the best estimator for stock volatility, and volatility is latent, how do I know which estimator performs the best when the mathematical definition for these estimators are all different?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Realized variance = sum[(return at t)^2] in a day&#xA;Realized absolute value = sum|return at t| in a day&#xA;Bipower variation = sum |return at t-1|*|return at t| in a day&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I use a linear model and substitute each of these estimators as the regressor, doesn't this mean I can't compare the results directly, but I can only compare how well the linear model is able to predict itself based on MSE, R^2, and so on?&lt;/p&gt;&#xA;" OwnerUserId="4692" LastActivityDate="2013-01-30T06:13:14.617" Title="Why are there different estimators for stock volatility? (realized variance, RAV, etc)" Tags="&lt;volatility&gt;&lt;variance&gt;&lt;econometrics&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7151" PostTypeId="2" ParentId="7134" CreationDate="2013-01-30T01:20:06.837" Score="7" Body="&lt;p&gt;The other answers are useful and sensible. I have worked full time in equity research for nearly two decades, so very much a &quot;qualitative&quot; rather than a quantitative approach. However, all the firms for which I have worked had quants and because of my casual interest in the area I've spent a lot of time talking to quant teams over the years, often over a beer or two. Thinking back to those conversations, two things stand out.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Go where the money is. I mean that both in terms of what is popular at the moment (quant seems to have fashions like everything else) and also geographically if you can. Sure, quant can be done anywhere in theory but there will be places where there is more of it than in other locations. If you're working in a location with little demand and on techniques that are not in vogue, you will probably be paid less than others in the &quot;right&quot; place and pushing the &quot;right&quot; techniques. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Evolve. You're just trying to get in to the business, so it will be tempting - if you succeed - to think &quot;Made it!&quot; Actually, that's just the beginning. Whatever you do, assume it has a limited shelf-life and that you will have to continuously pick up new skills. Even on my side of the street, the changes over the past 10 years have been very significant and quantitative trading is developing far more rapidly. So cultivate and maintain an attitude of mental fluidity.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2912" LastEditorUserId="35" LastEditDate="2013-01-30T02:36:14.297" LastActivityDate="2013-01-30T02:36:14.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7152" PostTypeId="1" CreationDate="2013-01-30T04:29:37.490" Score="4" ViewCount="162" Body="&lt;p&gt;Consider $X= \left( X_t \right)_{t\geq 0}$ is a Lévy process whose characteristic triplet is $\left(  \gamma,  \sigma ^2, \nu \right)$ and where its Lévy measure is&#xA;$$ \nu \left( dx\right) = A \sum_{n=1} ^{\infty} p^n \delta_{-n}\left( dx \right) + Bx^{\beta-1}\left( 1+x \right)^{-\alpha -\beta}e^{-\lambda x } \mathbf{1}_{\left ]0,+\infty \right[}\left( x\right)dx.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to know how to show that a price process $S_t = S_0 \exp\left( r t + X_t \right)$ of a risky actif under interest rate $r &amp;gt;0$ is well defined and admits first and second order moments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Someone could help on it, please?&lt;/p&gt;&#xA;" OwnerUserId="3534" LastEditorUserId="3534" LastEditDate="2013-01-30T18:31:29.190" LastActivityDate="2013-01-30T18:31:29.190" Title="Simple question concerning Jump process (Lévy process) model for a risky actif price process" Tags="&lt;stochastic-calculus&gt;&lt;stochastic-processes&gt;&lt;jump&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ClosedDate="2013-02-24T23:51:04.573" ContentLicense="CC BY-SA 3.0" />
  <row Id="7153" PostTypeId="2" ParentId="3191" CreationDate="2013-01-30T05:09:01.320" Score="4" Body="&lt;p&gt;I think the national regulators are more concerned with downturn LGD (sort of TTC LGD) rather than a TTC PD. Therefore most rating systems which I encounter are closer to being PIT and thereby &lt;em&gt;easier&lt;/em&gt; to validate using the techniques you mentioned and also to backtest. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in any case, model validation is a very subjective field despite the various quantitative tools that exist and the expert judgement of the analyst must come through.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, some of the best research on model validation remains as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.bis.org/publ/bcbs_wp14.htm&quot; rel=&quot;nofollow&quot;&gt;http://www.bis.org/publ/bcbs_wp14.htm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.risk.net/digital_assets/5028/jrm_v1n1a4.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.risk.net/digital_assets/5028/jrm_v1n1a4.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will add more references as I track their urls ;)&lt;/p&gt;&#xA;" OwnerUserId="4675" LastEditorUserId="4675" LastEditDate="2013-01-30T05:25:23.487" LastActivityDate="2013-01-30T05:25:23.487" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7154" PostTypeId="2" ParentId="7149" CreationDate="2013-01-30T06:13:14.617" Score="1" Body="&lt;p&gt;I would not call them &quot;estimators&quot; but rather measures because this is volatility on historical returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason why there are different such measures is because each one represents volatility in different ways in order to measure the volatility of different dynamics, be it price, return, upside price moves only, down side price moves only, intraday dynamics. For example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;There are measures of intra-day price volatility, such as Parkinson or Garman-Klass&lt;/li&gt;&#xA;&lt;li&gt;Measure that only concerns itself with deviation without regard to signage, such as variance on absolute values or squared deviations&lt;/li&gt;&#xA;&lt;li&gt;Measure that represents variability of an asset relative to a benchmark, Beta&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;There are a lot more but I guess you get the point. In Summary, different measures of volatility in order to capture variation of different dynamics. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-01-30T06:13:14.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7158" PostTypeId="2" ParentId="2355" CreationDate="2013-01-30T16:59:58.173" Score="2" Body="&lt;p&gt;Notice that in their paper &lt;a href=&quot;http://www.icmacentre.ac.uk/files/analytic_spread_options.pdf&quot; rel=&quot;nofollow&quot;&gt;Analytic Approximations for Spread Options&lt;/a&gt;, the authors define a &lt;strong&gt;spread option&lt;/strong&gt; as follows:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A spread option is an option whose pay-off depends on the price spread between two correlated underlying assets. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2220" LastActivityDate="2013-01-30T16:59:58.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7159" PostTypeId="1" CreationDate="2013-01-30T20:14:44.717" Score="2" ViewCount="2692" Body="&lt;p&gt;Can anyone kindly point out if I made any mistakes in making predictions using quadratic regression model in time series? I called the predict() function with the appropriate data vector and model, but the predictions do not sit well with what I observe on the time plot. I will like to know if there's anything wrong with my commands or is there something more to it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are my commands and data vectors:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sales &amp;lt;- c(99,99,96,101,99,105,101,106,107,106,105,112,112,118,121,126,127,128,133)&#xA;year &amp;lt;- 1985:1986&#xA;year.sq &amp;lt;- year^2&#xA;sales.df &amp;lt;- data.frame(Year=year,Year.Squared=year.sq,Sales=sales)&#xA;quad.reg.model &amp;lt;- lm(sales.df$Sales ~ sales.df$Year + I(sales.df$Year.Squared), &#xA;                     data=sales.df)&#xA;&#xA;year &amp;lt;- sales.df$Year&#xA;year.sq &amp;lt;- sales.df$Year.Squared&#xA;&#xA;# Creating a data.frame to be an argument for predict.lm() function&#xA;newdata &amp;lt;- data.frame(year=2004,year.sq=2004^2) &#xA;&#xA;# Prediction for Sales (1-year ahead)&#xA;sales.pred &amp;lt;- predict.lm(quad.reg.model,newdata,interval='predict')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;and the output from the last line of command gave:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;         fit       lwr      upr&#xA;1   98.53383  93.00996 104.0577&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I plotted the sales series and overlaid with the quadratic graph, it clearly shows that the trend is increasing and it seems like the 1-year ahead prediction does not sit well empirically. Why is this so?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/rl6yZ.png&quot; alt=&quot;Plot of Sales &amp;amp; Best Fit Curve (Quadratic)&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="3586" LastEditorUserId="848" LastEditDate="2013-01-30T21:33:35.517" LastActivityDate="2013-05-30T23:14:52.157" Title="Predict Quadratic Trend in Time Series" Tags="&lt;time-series&gt;&lt;statistics&gt;&lt;econometrics&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7160" PostTypeId="2" ParentId="7159" CreationDate="2013-01-30T21:08:16.833" Score="1" Body="&lt;p&gt;I can' read your lm lines but I think this works:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;pre&gt;&lt;code&gt;&#xA;mymodel = lm(sales~year+I(year^2))&#xA;plot(sales)&#xA;lines(fitted.values(mymodel))&#xA;&lt;/pre&gt;&lt;/code&gt;&#xA;Or you try just&#xA;&lt;pre&gt;&lt;code&gt;&#xA;mymodel = lm(sales~I(year^2)) &#xA;&lt;/pre&gt;&lt;/code&gt;&#xA;Finally&#xA;&lt;pre&gt;&lt;code&gt;&#xA;new.data = list(year=2004)&#xA;predict.lm(mymodel,new.data)&#xA;&lt;/pre&gt;&lt;/code&gt;&#xA;gives a useful value.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2013-01-30T21:17:27.193" LastActivityDate="2013-01-30T21:17:27.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7162" PostTypeId="1" CreationDate="2013-01-31T00:44:28.367" Score="3" ViewCount="1256" Body="&lt;p&gt;So far, I have been performing computations either on my own computer, or using an in-house scheduler that basically chooses a one of the employees' available workstations to run tasks in the background.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As we are now performing more and more lengthy computations, our personal stations begin to be used all the times partially (or even entirely) by background computations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, I have been thinking about moving to a Grid Computing infrastructure. Let's say that I call each computation a &lt;em&gt;task&lt;/em&gt;. Each task can:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;have different necesary packages available, for example:&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the MATLAB runtime&lt;/li&gt;&#xA;&lt;li&gt;the .Net Framework 4.5&lt;/li&gt;&#xA;&lt;li&gt;the MATLAB runtime and the .Net Framework 4.5)&lt;/li&gt;&#xA;&lt;li&gt;and so on...&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;have a specific priority&lt;/li&gt;&#xA;&lt;li&gt;require different kind of resources, for example:&#xA;&lt;ul&gt;&#xA;&lt;li&gt;several cores because the code of a specific task is well parallelized&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;depend on the success of another task&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a task may require to be executed only after another task has completed, and only if that other task ran successfully&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;a maximum duration so that we can detect and even stop a task which might have ended up in a infinite loop.&lt;/li&gt;&#xA;&lt;li&gt;time at which the task has to be executed&#xA;&lt;ul&gt;&#xA;&lt;li&gt;or the time by which the task has to be completed&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I want to have a software which will be fed with our tasks and their properties (listed in the bullet points above) and which will choose what to do with them using the resources available in the infrastructure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Notice here that I never talked about how the grid is implemented. From a business point of view, this is not interesting.&lt;/em&gt; For example, &lt;strong&gt;I want my indicators to be computed in a task that should be completed every monday at 6am&lt;/strong&gt;. I don't care whether it went on workstation 1 or 2 or on some server. I'm just talking about tasks with requirements having to be completed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would also like to be able to see what is going on during the execution: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;which tasks benefits from what resource&lt;/li&gt;&#xA;&lt;li&gt;since when a particular task started&lt;/li&gt;&#xA;&lt;li&gt;who scheduled the task&lt;/li&gt;&#xA;&lt;li&gt;and so on.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Now, I know that the infrastructure behind the software depends on the amount of resources we need to have.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I was wondering how much such the software would cost &lt;strong&gt;by itself&lt;/strong&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or how much would such an infrastructure cost with a very small setup of 16 cores and a fair amount of memory (RAM)?&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;EDIT&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Considering the answers that were given, my main focus was maybe unclear. I found a few different software that could possibly to what I want. I am trying to roughly estimate the cost for a small architecture of that kind. The products I found online do not provide pricing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially, I'm trying to determine whether it will cost something like USD 10k? 100k? 500k? or 1m?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's about it.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2013-02-01T09:43:21.323" LastActivityDate="2014-02-13T06:54:48.237" Title="How much does a Grid Computing software cost?" Tags="&lt;programming&gt;" AnswerCount="4" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7163" PostTypeId="2" ParentId="7162" CreationDate="2013-01-31T02:25:29.770" Score="3" Body="&lt;p&gt;Take a look at the following, it does not indicate cost but I found it an interesting starting point into estimating the cost (whether you can implement open-source components or have to go completely proprietary):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://boinc.berkeley.edu/trac/wiki/DesktopGrid&quot; rel=&quot;nofollow&quot;&gt;http://boinc.berkeley.edu/trac/wiki/DesktopGrid&lt;/a&gt; and an implementation example &lt;a href=&quot;http://desktopgrid.hu/&quot; rel=&quot;nofollow&quot;&gt;http://desktopgrid.hu/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I like this site because you get information targeting beginners as well as experts as well: &lt;a href=&quot;http://www.gridcafe.org/grid-in-30-sec.html&quot; rel=&quot;nofollow&quot;&gt;http://www.gridcafe.org/grid-in-30-sec.html&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;by the way have you considered cloud grids as an alternative, I have played with the Amazon grids and was pleasantly surprised. On the other side, MS's Azure was a huge turn-off because of its complication to set up instances and maintaining them. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here some comparisons: &lt;a href=&quot;http://www.ibm.com/developerworks/library/wa-cloudgrid/&quot; rel=&quot;nofollow&quot;&gt;http://www.ibm.com/developerworks/library/wa-cloudgrid/&lt;/a&gt;  and &#xA;&lt;a href=&quot;http://www.cloudscaling.com/blog/cloud-computing/grid-cloud-hpc-whats-the-diff/&quot; rel=&quot;nofollow&quot;&gt;http://www.cloudscaling.com/blog/cloud-computing/grid-cloud-hpc-whats-the-diff/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While the following does not give you pricing information either but it is a service provider who offers the underlying grid engine:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.univa.com/products/grid-engine.php?_kk=computational%20grid&amp;amp;_kt=841ea12a-5cf9-46f7-ab79-7b06c294baf2&amp;amp;gclid=CLam1sHFkbUCFQcipQod3gsASw&quot; rel=&quot;nofollow&quot;&gt;http://www.univa.com/products/grid-engine.php?_kk=computational%20grid&amp;amp;_kt=841ea12a-5cf9-46f7-ab79-7b06c294baf2&amp;amp;gclid=CLam1sHFkbUCFQcipQod3gsASw&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and an interesting paper, though its a bit dated:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://s-space.snu.ac.kr/bitstream/10371/6804/1/A%20Pricing%20Information%20Service%20for%20Grid%20Computing.pdf&quot; rel=&quot;nofollow&quot;&gt;http://s-space.snu.ac.kr/bitstream/10371/6804/1/A%20Pricing%20Information%20Service%20for%20Grid%20Computing.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-01-31T02:25:29.770" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7164" PostTypeId="2" ParentId="7162" CreationDate="2013-01-31T03:08:59.800" Score="6" Body="&lt;p&gt;I can't really comment on the total cost of software as we've rolled our own grid in-house and just leased a big rack that's located in a server room. What you need to consider though is that if you intend to utilize your grid 24/7 it can become quite expensive to use external services such as Amazon and/ or rackspace. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We've done a few scenarios and found you're mostly better off leasing/ purchasing your own hardware - depending on where you're based depreciation reduces your taxable income so that's a consideration as well. Given our utilization of the grid, we found that we'd have to pay monthly to external providers what we're now paying annually for a lease (including the cost to power it). I think Amazon/ rackspace are OK if you have occasional, one-off jobs but become very expensive if you run (a large number of) jobs continuously. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I said before we rolled our own grid which I think is preferable and doesn't take too long to get to a working state. I heard good things about &lt;a href=&quot;http://research.cs.wisc.edu/htcondor&quot;&gt;http://research.cs.wisc.edu/htcondor&lt;/a&gt; and it seems to cover your requirements but have no personal experience with it.&lt;/p&gt;&#xA;" OwnerUserId="1754" LastActivityDate="2013-01-31T03:08:59.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7165" PostTypeId="1" CreationDate="2013-01-31T06:18:18.650" Score="8" ViewCount="712" Body="&lt;p&gt;As we converge on the minute time scale and below for our unit time interval, the return distributions tend to be leptokurtotic and more discretized (due to fixed values such as minimum price increment of a security, commission and liquidity rebate). Moreover, if we are analyzing the VaR/CVaR of a model or strategy for a small number of securities, it is common to have no open position (and hence zero exposure and return) for a significant fraction of the total duration of the backtest, resulting in an artificially large peak at zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What adjustments can we make to calculate a meaningful VaR/CVaR and improve its out-of-sample accuracy on high frequency data and returns?&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Avoid the problem altogether by sampling returns in larger intervals, e.g. daily basis and above. Problem: We lack a meaningful measure of intraday risk, which is our main emphasis since we are pursuing strategies whose holding periods are comparable to the unit time interval.&lt;/li&gt;&#xA;&lt;li&gt;Use the empirical distribution, but discard the returns when there is no exposure.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2013-08-31T18:57:48.253" Title="Calculating VaR/CVaR on high frequency data and returns" Tags="&lt;risk&gt;&lt;var&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7167" PostTypeId="1" CreationDate="2013-01-31T13:16:50.077" Score="2" ViewCount="240" Body="&lt;p&gt;In fitting a curve I found that people are using the following tenors:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;U1  Z1  H2  M2  U2  Z2  2Y&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you please let me know what exact time periods they stand for? Is there a web page describing them?&lt;/p&gt;&#xA;" OwnerUserId="4706" LastEditorUserId="467" LastEditDate="2013-01-31T14:24:49.970" LastActivityDate="2013-02-01T09:29:10.883" Title="What do these maturity codes mean?" Tags="&lt;yield-curve&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7168" PostTypeId="2" ParentId="7167" CreationDate="2013-01-31T14:28:21.617" Score="3" Body="&lt;p&gt;I think they are using the same convention as the future exchanges for delivery months.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find a complete mapping on the &lt;a href=&quot;http://en.wikipedia.org/wiki/Delivery_month&quot; rel=&quot;nofollow&quot;&gt;wiki page&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The letter corresponds to a month and the number corresponds to the last digit of the year. So for example to understand &lt;code&gt;U1&lt;/code&gt; you find &lt;code&gt;U&lt;/code&gt;=&gt;September and &lt;code&gt;1&lt;/code&gt;=&gt;&lt;code&gt;2011&lt;/code&gt; (you have to &quot;guess&quot; the relevant decade, it's quite annoying).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe the &lt;code&gt;2Y&lt;/code&gt; would stand for 2 years from now. But not sure.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2013-01-31T18:13:39.183" LastActivityDate="2013-01-31T18:13:39.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7169" PostTypeId="1" CreationDate="2013-01-31T14:45:16.023" Score="16" ViewCount="38917" Body="&lt;p&gt;I am looking for &lt;strong&gt;one line formula&lt;/strong&gt; ideally in Excel to calculate stock move probability based on option implied volatility and time to expiration?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have already found a few complex samples which took a full page of data to calculate.&#xA;Is it possible to simplify this calculation in one line formula with the following variables:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Current stock price&lt;/li&gt;&#xA;&lt;li&gt;Target Target Price &lt;/li&gt;&#xA;&lt;li&gt;Calendar Days Remaining &lt;/li&gt;&#xA;&lt;li&gt;Percent Annual Volatility&lt;/li&gt;&#xA;&lt;li&gt;Dividend=0, Interest Rate=2%&lt;/li&gt;&#xA;&lt;li&gt;Random value to get something similar to Monte Carlo model?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I need these results:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Probability of stock being above Target Price in %&lt;/li&gt;&#xA;&lt;li&gt;Probability of stock being below Target Price in %&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;similar to optionstrategist.com/calculators/probability&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any recommendations?&lt;/p&gt;&#xA;" OwnerUserId="4707" LastActivityDate="2017-03-02T03:54:17.210" Title="How to calculate stock move probability based on option implied volatility and time to expiration? (Monte Carlo simulation)" Tags="&lt;options&gt;&lt;probability&gt;&lt;calculation&gt;" AnswerCount="6" CommentCount="0" FavoriteCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="7170" PostTypeId="2" ParentId="7169" CreationDate="2013-01-31T15:05:22.163" Score="6" Body="&lt;p&gt;If you are happy with the OptionStrategist probability values, why don't just do it exactly how they do it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function Covered() { &#xA;&#xA;form=document.callreturn;&#xA;p=form.price.value;&#xA;q=form.strike.value;&#xA;t=form.days.value/365;&#xA;v=form.volatility.value/100;&#xA;&#xA;vt=v*Math.sqrt(t);&#xA;lnpq=Math.log(q/p);&#xA;d1=lnpq / vt;&#xA;&#xA;y=Math.floor(1/(1+.2316419*Math.abs(d1))*100000)/100000;&#xA;z=Math.floor(.3989423*Math.exp(-((d1*d1)/2))*100000)/100000;&#xA;y5=1.330274*Math.pow(y,5);&#xA;y4=1.821256*Math.pow(y,4);&#xA;y3=1.781478*Math.pow(y,3);&#xA;y2=.356538*Math.pow(y,2);&#xA;y1=.3193815*y;&#xA;x=1-z*(y5-y4+y3-y2+y1);&#xA;x=Math.floor(x*100000)/100000;&#xA;&#xA;if (d1&amp;lt;0) {x=1-x};&#xA;&#xA;pabove=Math.floor(x*1000)/10; &#xA;pbelow=Math.floor((1-x)*1000)/10;&#xA;&#xA;form.pbelow.value=pbelow;&#xA;form.pabove.value=pabove;&#xA;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is JavaScript, but it should be rather straightforward to do it in Excel.&lt;/p&gt;&#xA;" OwnerUserId="370" LastActivityDate="2013-01-31T15:05:22.163" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="7171" PostTypeId="2" ParentId="7169" CreationDate="2013-01-31T15:40:56.107" Score="3" Body="&lt;p&gt;You can certainly calculate the probability of changes in variation but I have not come across a model that only looks at an isolated iVol and its associated term and then deriving a directional probability. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, what you can do, and what options traders do all the time is to look at changes in skew which involves a range of implied data points. In Fx traders look at risk reversals. Also, in the short term, where trades in the option relative to the book take place has a bearing on directional probabilities. I am not gonna provide a formula, because I use some of that as part of my own business, just trying to push you into the right direction. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-01-31T15:40:56.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7172" PostTypeId="2" ParentId="7167" CreationDate="2013-01-31T15:45:12.527" Score="0" Body="&lt;p&gt;I concur with SRKX, though I am also slightly puzzled by the 2Y here. Have you possibly mixed up futures expiration codes with the series numbers of index options expiration codes? In the exchange's infinite quest for more volume they introduced weekly or bi-weekly series and 2Y looks like the code of one of them. Check it out, its either an odd futures expiration code (2Y, I mean) or an options series code, referring to the expiration as well. But surly, the others refer to standard futures expirations. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-01-31T15:45:12.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7173" PostTypeId="1" CreationDate="2013-01-31T16:13:59.053" Score="2" ViewCount="160" Body="&lt;p&gt;This is a cross-post from &lt;a href=&quot;https://stats.stackexchange.com/questions/48490/using-regression-splines-for-values-outside-of-the-calibration-range&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my &lt;a href=&quot;https://stats.stackexchange.com/questions/47519/load-forecast-model-with-temperature-data&quot;&gt;question&lt;/a&gt; on a load forecast model using temperature data as covariates I was advised to use regression splines. This really seems to be a/the solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I face the following problem: if I calibrate my model on winter data (for technical reasons calibration can not be done on a daily basis, rather every second month) and slowly spring arises I will have temperature data outside of the calibration set.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although load forecasting is not a financial topic per se the same issues arise in quantitative finance at certain points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there good techniques to make the regression spline fit robust for values outside of the calibration range? &#xA;The members of cross-validated already proposed natural splines where extrapolation is done  linear. &#xA;What do you do if you have to do something? And please don't hate me for this question - I am aware that anything outside of the training set is &lt;em&gt;bad&lt;/em&gt; but what is a good solution if I have to do something ... ?&#xA;Any experiences or references? Thanks!&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2013-01-31T16:13:59.053" Title="What to do with linear regression or regression splines outside of the training range?" Tags="&lt;regression&gt;&lt;calibration&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7174" PostTypeId="1" CreationDate="2013-01-31T16:25:13.810" Score="5" ViewCount="286" Body="&lt;p&gt;I am trying to work out how to determine weights for the assets in order to form a portfolio. The ratio I am using is EV/EBIT, hence the smaller the better. The problem is I don't know how to handle it when EV &amp;lt; 0. Obviously that is kind of a 'free lunch' mathematically speaking and I realise the discontinuity at x/0 is what messes things up in a way. Would anyone be able to suggest something?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="4710" LastEditorUserId="4710" LastEditDate="2013-01-31T16:46:33.680" LastActivityDate="2015-10-13T14:11:10.977" Title="How to work out weights for a portfolio based on an inverse ratio with positive and negative values?" Tags="&lt;portfolio&gt;" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7175" PostTypeId="2" ParentId="7167" CreationDate="2013-01-31T17:10:20.963" Score="3" Body="&lt;p&gt;Standard 3m curve interpretation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;H, M, U, Z = Mar, Jun, Sep, Dec IMM dates in the futures convention (see SRKX's answer), and 2Y would be just the calendar 2y point. Assuming that what you found was done in 11th July 2011:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;U1   21 Sep 11 - 21 Dec 11 (IMM = 3rd Wednesday to following IMM)&#xA;Z1   21 Dec 11 - etc&#xA;H2   21 Mar 12&#xA;M2   20 Jun 12&#xA;U2   19 Sep 12&#xA;Z2   19 Dec 12 - 20 Mar 13&#xA;2Y   11 Jul 11 - 11 Jul 13 (calendar from 11 Jul 11 start)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you saw those today, U1 would mean Sep 2021 (as Sep 2011 has passed), but that's too far out to use at present, so I'm going with the 2011 thesis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2y is a reasonable point to splice into swaps. You also want the 3m fixing, or nothing will be right.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastEditorUserId="1314" LastEditDate="2013-02-01T09:29:10.883" LastActivityDate="2013-02-01T09:29:10.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7177" PostTypeId="1" AcceptedAnswerId="7183" CreationDate="2013-01-31T19:29:49.733" Score="2" ViewCount="2161" Body="&lt;p&gt;Ok, obviously I am buying lower strike put and selling higher strike put. What is the recommended volatility and greeks to consider in my trade?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Volatility:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Average volatility between both legs?&lt;/li&gt;&#xA;&lt;li&gt;Long volatility minus short volatility&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Delta/gamma/theta/vega:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Average Delta/gamma/theta/vega between both legs?&lt;/li&gt;&#xA;&lt;li&gt;Long Delta/gamma/theta/vega minus short Delta/gamma/theta/vega?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I think option one for volatility and option two for greeks. Any thoughts?&lt;/p&gt;&#xA;" OwnerUserId="4707" LastActivityDate="2013-02-01T02:54:06.840" Title="How to calculate implied volatility and greeks in Bull Put Spread option strategy?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;greeks&gt;&lt;calculation&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7178" PostTypeId="2" ParentId="839" CreationDate="2013-01-31T20:23:21.627" Score="2" Body="&lt;p&gt;It depends on what do you need. Basically, an efficient backtester allows you to study all the market microstructure. In other words, you have to simulate a scenario that gives you all the information of bid-ask prices, volumes, traded price, volume traded, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Two years ago I developed my own market in Python. I used a Poisson process to simulate trades. I also analyse the supply and demand to define the aggressiveness of the volumes and the size of the spread.&lt;/p&gt;&#xA;" OwnerUserId="4701" LastEditorUserId="35" LastEditDate="2013-01-31T23:32:21.020" LastActivityDate="2013-01-31T23:32:21.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7179" PostTypeId="2" ParentId="7162" CreationDate="2013-01-31T20:33:15.063" Score="4" Body="&lt;p&gt;Consider constructing some VMs, and letting the tasks involve starting the VM and running the task on that. This should clear up the trickiest part, scheduling jobs to run on the right machine with the right requirements, as you'd build VM images with all the needed pieces installed, and it wouldn't depend on which machine was requesting the job.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do decide to switch to 'cloud' solutions, or add some hardware to take some load, the VMs will be easy to put wherever, so it scales nicely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is free VM software around (e.g. VirtualBox), so that would be free. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dedicated hardware is by far the simpler solution; you have more control and you can install all the necessary software. If you do go down that route, get an SSD for Windows to speed up the page file (or switch off the page file), and a separate SSD or RAID array for data so they don't die together. I would guess at £7k for a 16C machine. This would evade any need for complex queueing and querying, and will be more reliable without a network to worry about.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main point of grid software I've used has been to balance the needs of multiple users, and ensure the right environment is set up on the target node. But in heterogeneous Windows-based environments which can't be altered and without any contention, I can't really see much benefit in costly grid software.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastEditorUserId="1314" LastEditDate="2013-02-01T09:31:15.953" LastActivityDate="2013-02-01T09:31:15.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7181" PostTypeId="1" AcceptedAnswerId="7184" CreationDate="2013-01-31T23:32:19.920" Score="19" ViewCount="10961" Body="&lt;p&gt;I have a question about Random forests and how they could be utilized in trading?&#xA;I heard Random forests are used for classification, is that accurate? If so, could someone give an example of what sort of classification does it help with?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, what are Random forests used for in Quant finance?&lt;/p&gt;&#xA;" OwnerUserId="4713" LastEditorUserId="467" LastEditDate="2013-02-01T09:21:20.550" LastActivityDate="2018-08-10T10:03:08.757" Title="Usage of Random forests in Quantitative analysis of stocks" Tags="&lt;quant-trading-strategies&gt;&lt;machine-learning&gt;&lt;statistical-finance&gt;&lt;classifier&gt;" AnswerCount="10" CommentCount="1" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="7182" PostTypeId="2" ParentId="7169" CreationDate="2013-01-31T23:42:05.603" Score="4" Body="&lt;p&gt;I think that you may be looking for &#xA;$$&#xA;\mathbb{P}(S_T&amp;lt;K) = \frac{\partial P}{\partial K}(K) = 1 + \frac{\partial C}{\partial K}(K)&#xA;$$&#xA;where $P(K)$ and $C(K)$ are the european put and call &lt;strong&gt;undiscounted&lt;/strong&gt; price functions for the maturity $T$.&#xA;The proof goes (roughly) as this: &#xA;$$&#xA;\begin{eqnarray}&#xA;\frac{\partial P}{\partial K} &amp;amp;=&amp;amp; \frac{\partial}{\partial K}\int_{0}^{\infty} (K-S_T)^+p(S_T,T,S_0,t_0) \\&#xA;&amp;amp;=&amp;amp; \int_{0}^{\infty} \frac{\partial}{\partial K}(K-S_T)^+p(S_T,T,S_0,t_0) \\&#xA;&amp;amp;=&amp;amp; \int_{0}^{\infty} \textbf{1}_{\{S_T&amp;lt;K\}}p(S_T,T,S_0,t_0) \\&#xA;&amp;amp;=&amp;amp; \mathbb{P}(S_T&amp;lt;K) .&#xA;\end{eqnarray}&#xA;$$&#xA;The one-line formula goes as &#xA;$$&#xA;\begin{eqnarray}&#xA;\frac{\partial P(K,\sigma(K))}{\partial K} &amp;amp;=&amp;amp; \frac{\partial P}{\partial K} + \frac{\partial P}{\partial \sigma}\times\frac{\partial \sigma}{\partial K} \\&#xA;&amp;amp;=&amp;amp; \Phi(d_-) + K\phi(d_-)\sqrt{T}\times\frac{\partial \sigma}{\partial K} .&#xA;\end{eqnarray}&#xA;$$&#xA;Where &#xA;$$&#xA;d_- = \frac{\log(F_T/K) - \frac{1}{2}\sigma(K)^2T}{\sigma(K)\sqrt{T}} ,&#xA;$$&#xA;being $F_T$ the forward price of the stock at time $T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that if you have a flat volatility (Black-Scholes model), then the probability is simply &#xA;$$&#xA;\mathbb{P}(S_T&amp;lt;K) = \Phi(d_-) .&#xA;$$&#xA;For a market with non flat implied volatilities you still have to find the term $\frac{\partial \sigma}{\partial K}(K)$ doing some sort of interpolation/extrapolation of the volatility surface. Also, you should have to make sure that when interpolating or extrapolating you get admissible cdf's, otherwise a static arbitrage is guaranteed.&lt;/p&gt;&#xA;" OwnerUserId="1704" LastActivityDate="2013-01-31T23:42:05.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7183" PostTypeId="2" ParentId="7177" CreationDate="2013-02-01T02:54:06.840" Score="2" Body="&lt;p&gt;The delta, gamma, theta and vega exposure is just the sum of the individual positions, thus you sum up the greeks of your two puts, simple as that. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding implied volatility you cannot just average implied vols and say this is the implied vol of my structure (multi asset position). You can assign your own volatility expectations and compare that with its historical realized volatility or compare with the expectation other market participants have (many spreads are listed, this one I dont think so), but you can't in a linear fashion combine implied volatility figures. Why would you want the implied volatility of the structure anyway?&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-02-01T02:54:06.840" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7184" PostTypeId="2" ParentId="7181" CreationDate="2013-02-01T03:04:05.727" Score="5" Body="&lt;p&gt;I have not used random forests myself but I know of a guy who applied this classification technique to machine learning algorithms applied to pattern recognition. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus I think its advantages over classic regression approaches can be applied to discern patterns in financial data, though I get the impression that it vastly overfits the data and thus you end up with the classical trade-off that many quants are faced with. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also read that it is used by the SEC where they apply it in their quest to analyze trading patterns to flag insider trading violations. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-02-01T03:04:05.727" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7186" PostTypeId="2" ParentId="839" CreationDate="2013-02-01T10:26:48.583" Score="1" Body="&lt;p&gt;I recommend to check tradestation.com Their EasyLanguage allows to build and backtest much more advanced strategies. They also have pre-build indicators and data for many years. &#xA;It is not cheap, about $100 a month but most of the time they have a special offers for first 3 or 6 month free and monthly fee is dropped if you reach a certain level of trading.&#xA;Here is a brief video: &lt;a href=&quot;http://www.tradestation.com/education/university/school-of-easylanguage/video-tutorials&quot; rel=&quot;nofollow&quot;&gt;http://www.tradestation.com/education/university/school-of-easylanguage/video-tutorials&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="4707" LastActivityDate="2013-02-01T10:26:48.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7187" PostTypeId="2" ParentId="839" CreationDate="2013-02-01T10:48:23.467" Score="4" Body="&lt;p&gt;Having developed many custom backtesting programs in the past, I wish I would have just started out by purchasing a decent commercial backtester for a few hundred dollars.  The cost of buying one already completed will save you hours of time on learning the nuances and problems that come with backtesting implementation. Once you are adept at the ins and outs and limitations of the software, you can move on to more flexible programming. At the very least, you have a production implementation (with thousands of professional man-hours of effort) to compare your own custom software results and debug issues that surface. The cost of buying an actual professional product to learn the ins and outs is trivial in the long run.&lt;/p&gt;&#xA;" OwnerUserId="3040" LastEditorUserId="3040" LastEditDate="2013-02-01T11:00:32.507" LastActivityDate="2013-02-01T11:00:32.507" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7188" PostTypeId="2" ParentId="7169" CreationDate="2013-02-01T11:02:33.487" Score="10" Body="&lt;p&gt;If you use a risk-neutral pricing model and consider the probability there, then you get the probability with respect to &lt;em&gt;a&lt;/em&gt; risk neutral measure, in addition that probability depends on the chosen numeraire. For example, in Black-Scholes model  taking the risk-neutral measure with respect to the bank account $B$ gives&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P(S(T)&amp;lt;K) = Q^{B}(S(T)&amp;lt;K) = \Phi(d_{-})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and taking the risk-neutral measure with respect to the asset $S$ you get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P(S(T)&amp;lt;K) = Q^{S}(S(T)&amp;lt;K) = \Phi(d_{+})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you like to have a real world probability you have to consider the market price of risk and a real estimate for the volatility (not the implied one). Both are not listed in your parameters. If you like to get this probability use the first formula, but replace the interest rate $r$ with the drift of the stock (which contains the market price of risk) and the implied volatility with an appropriate estimate (you might consider historic volatility or assume that implied vol is an appropriate estimate or have a different view).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you mentioned Monte-Carlo simulation: I have a spreadsheet implementing a Monte-Carlo simulation of a Black-Scholes model (using multiple time-steps). The calculation of $d_{-}$ can be found in this sheet too. The sheet is here: &lt;a href=&quot;http://www.christian-fries.de/finmath/spreadsheets/&quot;&gt;http://www.christian-fries.de/finmath/spreadsheets/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3548" LastActivityDate="2013-02-01T11:02:33.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7189" PostTypeId="1" AcceptedAnswerId="7203" CreationDate="2013-02-01T15:33:02.183" Score="7" ViewCount="3197" Body="&lt;p&gt;Suppose, there is a HF strategy (agent) that is based on order book microstructure, and it is able to make good executions locally. More formally, in average its execution price is better than asset price $\tau$ sec. after the execution. Suppose, we manage two such agents: one for long orders, another for short orders. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is how to develop a controller that synchronizes between two and manages their mutual position given position limit &lt;code&gt;N&lt;/code&gt; on each side, and maximal order size &lt;code&gt;n&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume, this is a very broadly studied problem, especially among market makers. Can you please recommend relevant articles and ideas that provide overview of this topic and most sophisticated approaches. I'm especially interested in the very details such as: 1) Timing. is it prudent to generate random time intervals between last execution and new orders placement? 2) Pricing. How many orders can be executed on the same price? Thank you.&lt;/p&gt;&#xA;" OwnerUserId="1515" LastEditorUserId="1515" LastEditDate="2013-02-01T15:39:46.990" LastActivityDate="2013-05-12T21:39:09.450" Title="Position management and market-making techniques" Tags="&lt;market-making&gt;&lt;market-microstructure&gt;&lt;position-sizing&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7190" PostTypeId="1" CreationDate="2013-02-01T18:08:31.310" Score="-4" ViewCount="275" Body="&lt;p&gt;I have calculated my optimal portfolio weights following the mean-variance framework where I go $w_1$ in the risky asset and $1-w_1$ in the risk free rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get the following result: $w_1$ = 1.5, 1-$w_1$ = -0.5&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, how can I interpret this? Obviously I need to short the risk-free rate and go long in the risky asset. &lt;strong&gt;However, if I have 100 dollars to use for my portfolio, how do I allocate this amount in practice?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, it should follow that I go long with 150 dollars and short 50, but the question is, where does this money come from? How is it possible that I get money when I go short? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;One option would be to standardize the sum of the weights. Hence this is not possible as then you never will invest in the risk-free rate.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="4719" LastEditorUserId="35" LastEditDate="2013-02-01T18:15:40.233" LastActivityDate="2013-02-02T05:13:01.550" Title="How to use mean-variance weights in practice (when going short is allowed)?" Tags="&lt;portfolio-management&gt;&lt;asset-allocation&gt;" AnswerCount="2" CommentCount="2" ClosedDate="2013-02-02T12:47:34.757" ContentLicense="CC BY-SA 3.0" />
  <row Id="7191" PostTypeId="2" ParentId="7190" CreationDate="2013-02-01T23:21:26.383" Score="1" Body="&lt;p&gt;You borrow the money against the risk free rate.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2013-02-01T23:21:26.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7192" PostTypeId="2" ParentId="7189" CreationDate="2013-02-02T01:53:03.543" Score="3" Body="&lt;p&gt;You first need to clearly define your constraints first: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;max single position size&lt;/li&gt;&#xA;&lt;li&gt;max net exposure&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I am not sure why you want to limit order size. The whole idea of hft strategies is to maximize turnover. As long as your strategy generates alpha you should allow it to trade as often as the strategy prescribes. All you need to then do is to constrain the strategy and OMS to adhere to your position and exposure limits. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-02-02T01:53:03.543" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7193" PostTypeId="2" ParentId="7190" CreationDate="2013-02-02T05:13:01.550" Score="2" Body="&lt;p&gt;In your set up where you have just two assets, risky asset and risk-free asset, where weight of risky asset is w1, and consequently weight of risk-free asset is 1 - w1:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;w1 = 1,  =&gt;&lt;/strong&gt; You invest all your money in the risky asset. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;w1 = 0,  =&gt;&lt;/strong&gt; You invest all your money in the risk-free asset&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;0 &amp;lt; w1 &amp;lt; 1, =&gt;&lt;/strong&gt; You invest some of your money in the risky asset and some of it&#xA;in the risk-free asset&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;w1 &gt; 1, =&gt;&lt;/strong&gt; Your case :  you invest all you money (100) in the risky asset, plus you borrow (50) at risk free-rate and invest it in the risky asset. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;w1 &amp;lt; 0, =&gt;&lt;/strong&gt; implies that you short the risky asset to invest in the risky free rate, &#xA;this behavior is irrational, because we can find combinations of risky asset and risk-free asset that yield higher mean return at lower variance, thus w1 &amp;lt; 0, should never happen.&lt;/p&gt;&#xA;" OwnerUserId="2512" LastActivityDate="2013-02-02T05:13:01.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7197" PostTypeId="1" AcceptedAnswerId="7199" CreationDate="2013-02-03T03:17:40.047" Score="17" ViewCount="10770" Body="&lt;p&gt;Whats the relationship between the Kelly criterion and the Sharpe ratio?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;f=\frac{p(b+1)-1}{b}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $f$ is a percentage of how much capital to place on a bet, $p$ is the probability of success, and $b$ is the payout odds (eg. 3 dollars for ever 1 dollar bet).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is $b$ (the payout ratio) also the Sharpe ratio? I am having a hard time understanding what &lt;a href=&quot;http://epchan.blogspot.com/2012/11/the-importance-of-2-as-sharpe-ratio.html&quot;&gt;Ernie is refering to when he is connecting the two concepts&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="4729" LastEditorUserId="35" LastEditDate="2013-02-03T14:08:51.430" LastActivityDate="2017-10-15T10:13:42.280" Title="Kelly criterion and Sharpe ratio" Tags="&lt;sharpe-ratio&gt;&lt;kelly-criterion&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="7199" PostTypeId="2" ParentId="7197" CreationDate="2013-02-03T05:50:29.240" Score="14" Body="&lt;p&gt;The Sharpe ratio $S_i$ of a strategy indexed by $i$ is given by the ratio of the mean excess return $m_i$ to the standard deviation of returns $\sigma_i$, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The formula you have quoted is the &lt;strong&gt;discrete&lt;/strong&gt; Kelly criterion. That's not so useful in trading, where the outcomes are &lt;strong&gt;continuous&lt;/strong&gt;. The &lt;strong&gt;continuous&lt;/strong&gt; Kelly criterion states that for every $i$th strategy with Sharpe ratio $S_i$ and standard deviation of returns $\sigma_i$, you should  be leveraged $f_i = m_i/\sigma_i^2 = S_i/\sigma_i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note of difference between the discrete and continuous criteria: The Kelly criterion is designed to protect your equity from &quot;ruin&quot;, so it will never tell you to bet more than what you have in the discrete case - because when you &quot;lose&quot;, you lose the complete bet you've placed. The leverage $f_i$ will always be $&amp;lt;1$ in the discrete case. On the other hand, in the continuous case, your leverage can be $&amp;gt;1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us assume we have a portfolio with an overall Sharpe ratio $S$. What Ernie is talking about is that the maximum compounded growth rate $g$ is given by $g = r + S^2/2$. We usually drop the risk-free rate (unless we post treasuries for margin), so we have $g = S^2/2$. &lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2013-02-03T05:50:29.240" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7200" PostTypeId="2" ParentId="7197" CreationDate="2013-02-03T07:57:38.830" Score="5" Body="&lt;p&gt;I would not put too much weight on any relationship between Sharpe ratio and Kelly criterion. The two are simply not logically related other than they both share common inputs.  Kelly relates to sizing your position while Sharpe ratios relate your excess returns to the volatility of those. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As long as you find common inputs you can always setup a mathematical relationship between two equations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yes, both relate to risk but thats as far as I would go in relating one concept to the other. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="35" LastEditDate="2013-02-03T19:34:18.677" LastActivityDate="2013-02-03T19:34:18.677" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7201" PostTypeId="2" ParentId="3901" CreationDate="2013-02-03T17:05:56.020" Score="1" Body="&lt;p&gt;Riemann Hypothesis is a very import conjecture in mathematics, but it also an extremely hard problem, top mathematicians have worked on it for over 100 years and could not solve it. Moreover, one cannot start to really think about it without proper understanding of the problem; it might take years to understand what is going on even for people with strong math background.  Therefore, if someone is telling you to solve Riemann Hypothesis they can't be seriously suggesting you to work on it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As Freddy and user2303 suggested, it could've been a hint to work on math skills. Or maybe he was hinting at that the research is really not that important, &quot;It doesn't matter what you work on&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wasn't there and I did not feel the mood of the seminar, but I am sure the manager did not suggest students to go after the Riemann Hypothesis!&lt;/p&gt;&#xA;" OwnerUserId="2512" LastActivityDate="2013-02-03T17:05:56.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7202" PostTypeId="1" AcceptedAnswerId="7204" CreationDate="2013-02-03T19:54:06.810" Score="11" ViewCount="2389" Body="&lt;p&gt;I have 5 bonds (with maturities 1,2,3,4,5 years) which I calculated the yield curve for 10 days. I also calculated the forward rates from the yield rates. Now I've been told to calculate the covariance of the yield rates and the forward rates, as well as their eigenvalues/eigenvectors. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm assuming the covariance of the yield rates tell me how the bonds with different maturities move along with each other over time? But I'm not sure what the forward rates tell me.&lt;/p&gt;&#xA;" OwnerUserId="4692" LastActivityDate="2013-02-04T08:12:05.113" Title="What do eigenvalues/eigenvectors of the yield/forward rates covariance matrices mean?" Tags="&lt;covariance&gt;&lt;rates&gt;&lt;forward&gt;&lt;eigenvalue&gt;&lt;yield&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7203" PostTypeId="2" ParentId="7189" CreationDate="2013-02-03T20:29:43.967" Score="11" Body="&lt;p&gt;This paper &lt;a href=&quot;http://arxiv.org/abs/1105.3115&quot;&gt;Dealing with the Inventory Risk. A solution to the market making problem&lt;/a&gt;, has a full bibliography and explains the intra day market making mechanism.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The model is made of two components:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a diffusion of the &lt;em&gt;fair price&lt;/em&gt; (to model the market risk)&lt;/li&gt;&#xA;&lt;li&gt;a point process (with an intensity in $A \exp -k \delta$ (where $\delta$ is the distance to the fair price) to model the probability to be hit once you choose  quote price&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Then a stochastic control framework is set up to continuously adjust the quotes: distances (bid / ask) to the faire price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks to a tricky change of variable, the problem is solved.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2013-02-03T20:29:43.967" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="7204" PostTypeId="2" ParentId="7202" CreationDate="2013-02-03T20:36:48.603" Score="13" Body="&lt;p&gt;The PCA analysis does not really tell you what the bonds do but it tells you how the rates move together. The variations of $n$ rates (i.e. 1 y, 2y, ...) are split up in (at first) abstract factors like&#xA;$$&#xA;\Delta R_i = \sum_{j=1}^n e_{i,j} f_j&#xA;$$&#xA;where $\Delta R_i$ is the change in the rate $i$ and $f_j$ is factor $j$ and $e_{i,j}$ is the (factor loading=) influence of factor $j$ to the rate $i$. The factors coming from PCA are uncorrelated and ordered by the size of their variance (largest first).&#xA;Then it turns out that usually all rates have $e_{i,1}$, the influence of the first factor, with the same sign. This means that a change in this factor is in the same direction for all rates. The $e_{i,2}$ have a different sign for short terms as opposed to longer terms. Thus the second factor influences short and long rates differently - this is interpreted as steepening/flattening factor. For the third one often sees a curvature pattern (same sign for short and long and another sign for the middle terms). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mathematical detail: the factor loadings are the eigenvectors of the covariance matrix of $\Delta R_i,i=1,\ldots,n$ and the variances of the factors are the squared eigenvalues.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at the total variance explained by these it often turns out that $n$ rates can be described by the loadings to these 3 factors and the variances of these factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can do this with spot rates and with forward rates. It would be interesting how a PCA of spot and forward rates together looks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that such a reduction of dimensionality is an approximation and as always - take care doing it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the first Google hits points to an &lt;a href=&quot;http://www.finmod.co.za/pca.pdf&quot;&gt;article with more mathematical details:PRINCIPAL COMPONENT ANALYSIS by GRAEME WEST&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Problems of the interpretation are described here in&lt;a href=&quot;http://www.econstor.eu/dspace/bitstream/10419/40185/1/605238634.pdf&quot;&gt;Potential PCA interpretation problems&#xA;for volatility smile dynamics&lt;/a&gt; by Reiswich and Tompkins.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2013-02-04T08:12:05.113" LastActivityDate="2013-02-04T08:12:05.113" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7208" PostTypeId="1" AcceptedAnswerId="7209" CreationDate="2013-02-04T09:04:21.747" Score="5" ViewCount="659" Body="&lt;p&gt;How useful are quantitative techniques for the risk analysis/management of a open real estate fund? &#xA;I am thinking about an approach for Europe (US and other markets are probably quite different - usually more transparent).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several factors for the valuation of an object in the fund:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Income stream from rent payments. &lt;/li&gt;&#xA;&lt;li&gt;Valuation of the sales prices of the object.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The data basis for (2) is certainly an issue.&#xA;Do people use historical simulation or Monte Carlo approaches? What are your experiences in this field? Can you point out any good references? &lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2013-02-04T13:07:02.837" Title="Quantitative risk model for an open real estate mutual fund in Europe" Tags="&lt;risk-management&gt;&lt;risk-models&gt;&lt;real-estate&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7209" PostTypeId="2" ParentId="7208" CreationDate="2013-02-04T11:28:06.907" Score="3" Body="&lt;p&gt;First of all, usually these models are heavily adapted to a specific country (even for Europe), real estate class (housing, commercial) and market (secondary, primary). In general I would say it's very hard to directly apply standard quantitative tools (like MC) from finance for real estate market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The models I've seen were not heavily quantitative. The most common approach is to build an equilibrium (supply/demand) model which also accounts for macroeconomic factors (interest rates, exchange rates, etc). For example, people try to estimate and forecast the purchasing power (credit availability) and capacity of new development projects. This may include many subtle things as modelling possible delays in development, taxes, policies, etc. Ideally liquidity and credit risks should be taken into account. This approach to modelling and forecasting is sometimes called top-down/bottom-up:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Top-down and bottom-up approaches to forecasting are commonly used in&#xA;  the real estate industry. Macroeconomic (top-down) factors, such as&#xA;  employment growth, gross domestic product (GDP), household formation,&#xA;  and median household income drive both space-using demand and&#xA;  long-term supply. Market construction pipeline data (bottom-up)&#xA;  provides short-term supply information. Current vacancy (bottom-up) is&#xA;  assessed, while future vacancy is derived from forecasted demand,&#xA;  supply, and estimated total market inventory. Current rent (bottom-up)&#xA;  is surveyed, while rent growth is forecast based on forecasted demand&#xA;  and vacancy. Quantitative models built on long-term trends generate&#xA;  baseline results, while adjustments are made to incorporate local&#xA;  knowledge and short-term phenomena.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;from &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470485027&quot; rel=&quot;nofollow&quot;&gt;Active Private Equity Real Estate Strategy&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An important feature that one should account for while doing quantitative modelling in real estate is auto-correlation. Many researchers have documented the unusually strong predictable auto-correlation component. However, as I mentioned before, due to numerous unique features of the market this is hard to exploit on practice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also I'm aware about GIS-based and spatial models (e.g. spatial autocorrelation) for valuation of the real estate objects. But I've never seen them implemented in practice. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are some articles on application of Monte Carlo methods in real estate valuation: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.swissfinanceinstitute.ch/rp148.pdf&quot; rel=&quot;nofollow&quot;&gt;Monte Carlo Simulations for Real Estate Valuation&lt;/a&gt; &lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://hal-essec.archives-ouvertes.fr/docs/00/67/10/67/PDF/WP1115.pdf&quot; rel=&quot;nofollow&quot;&gt;Combining Monte Carlo Simulations and Options to Manage the Risk of&#xA;Real Estate    Portfolios&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;However, I cannot comment on how good they are.&lt;/p&gt;&#xA;" OwnerUserId="370" LastEditorUserId="370" LastEditDate="2013-02-04T13:07:02.837" LastActivityDate="2013-02-04T13:07:02.837" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7212" PostTypeId="2" ParentId="4181" CreationDate="2013-02-04T12:28:12.040" Score="-2" Body="&lt;p&gt;RightEdge offers a C#/VB (.net) framework with backtesting that might have what you want: &lt;a href=&quot;http://www.rightedgesystems.com/&quot; rel=&quot;nofollow&quot;&gt;http://www.rightedgesystems.com/&lt;/a&gt; It attaches to a number of broker APIs including the one offered by Interactive Brokers.&lt;/p&gt;&#xA;" OwnerUserId="4737" LastActivityDate="2013-02-04T12:28:12.040" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7214" PostTypeId="1" CreationDate="2013-02-04T20:35:28.190" Score="3" ViewCount="579" Body="&lt;p&gt;The data product &quot;TAQ NYSE Order Imbalances&quot; from the New York Stock Exchange is in a format that is described pretty well in sections 4.8, 4.9, 4.10, and 5 of &lt;a href=&quot;http://www.nyxdata.com/doc/5977&quot; rel=&quot;nofollow&quot;&gt;the document &quot;NYSE Order Imbalances Client Specification&quot;, version 1.12&lt;/a&gt;, q.v. Briefly, it's a mix of ASCII and binary: stock symbols, for example, are in plain text, but padded by null bytes, while numerical fields are in binary digits represented by a byte with that binary value. All fields are fixed-width, so data rows simply follow one another.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know how to convert this to, say, a comma-separated file?&lt;/p&gt;&#xA;" OwnerUserId="4607" LastActivityDate="2013-02-05T20:00:49.937" Title="NYSE binary data, convert to ASCII" Tags="&lt;market-data&gt;&lt;software&gt;" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="7215" PostTypeId="1" CreationDate="2013-02-04T20:57:47.410" Score="2" ViewCount="363" Body="&lt;p&gt;I keep struggling with testing 9 samples if they are stationary. Each of these samples is a real valued time series with 714.000 values. If I use the KPSS test with the each compleete sample set, the hypothesis is rejected. But, if I split each sample in 20 parts of equal size, then test all these sample parts with KPSS in all most all cases KPSS accepts the sample parts to be stationary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, I cannot find any good explanation for this behaviour. Can you give me any explanation for it and maybe a reference?&lt;/p&gt;&#xA;" OwnerUserId="4743" LastEditorUserId="1531" LastEditDate="2013-02-04T21:45:16.643" LastActivityDate="2013-02-05T12:11:29.890" Title="Testing for stationarity in large sample sizes" Tags="&lt;time-series&gt;&lt;stationarity&gt;&lt;testing&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7216" PostTypeId="1" AcceptedAnswerId="7217" CreationDate="2013-02-04T21:02:16.260" Score="15" ViewCount="13331" Body="&lt;p&gt;I want to chart the daily returns of a stock, and I'm using Yahoo finance data to download historic data.  I was told to use Adjusted Close, but there seems to be an issue with this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For &lt;a href=&quot;http://finance.yahoo.com/q/hp?s=ANTO.L&amp;amp;a=04&amp;amp;b=5&amp;amp;c=2006&amp;amp;d=05&amp;amp;e=25&amp;amp;f=2006&amp;amp;g=d&quot;&gt;ANTO.L&lt;/a&gt;, you can see that on 19 Jun 2006 there was a 5:1 split.  The adjusted close reflected this, and went from 71.97 to 365.36. This of course skews my daily returns, as it represents a 400%+ return!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should I be using adjusted close to calculate returns?  It makes sense when considering dividends, but whenever there is a stock split there is then a huge skew.  Is there something else I'm missing that I need to look into?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think there's lots of examples of the same bad calculations.  &lt;a href=&quot;http://finance.yahoo.com/q/hp?s=SRP.L&amp;amp;a=03&amp;amp;b=5&amp;amp;c=2000&amp;amp;d=03&amp;amp;e=25&amp;amp;f=2000&amp;amp;g=d&quot;&gt;SRP.L&lt;/a&gt; shows the same for example.  Problem is the Close is wrong, and the AdjClose is wrong, so I can't trust anything.  Can anyone point me towards a good reliable free (or reasonably priced) provider of historic stock data, so I can use for comparisons?&lt;/p&gt;&#xA;" OwnerUserId="4742" LastEditorUserId="4742" LastEditDate="2013-02-06T07:22:38.147" LastActivityDate="2017-04-06T15:54:58.267" Title="Daily returns using adjusted close" Tags="&lt;returns&gt;&lt;yahoo&gt;&lt;adjusted&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="7217" PostTypeId="2" ParentId="7216" CreationDate="2013-02-04T21:45:26.117" Score="9" Body="&lt;p&gt;Hmm, this table looks wrong. &lt;a href=&quot;http://finance.yahoo.com/q/hp?a=&amp;amp;b=&amp;amp;c=&amp;amp;d=1&amp;amp;e=4&amp;amp;f=2013&amp;amp;g=d&amp;amp;s=gild&amp;amp;ql=1&quot;&gt;Here's what it should look like.&lt;/a&gt; After the most recent corporate action, the Close and Adjusted Close should be the same; only prices from before the most recent action should have a different Adjusted Close. &lt;a href=&quot;http://finance.yahoo.com/q/hp?a=&amp;amp;b=&amp;amp;c=&amp;amp;d=1&amp;amp;e=4&amp;amp;f=2013&amp;amp;g=d&amp;amp;s=NKE%2C+&amp;amp;ql=1&quot;&gt;Here's another example.&lt;/a&gt; I think Yahoo just has the wrong information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you wanted to derive your own adjustments for calculating returns, you'll need to know the date and nature of every corporate action. Then you'll fake the prices of the &lt;em&gt;future&lt;/em&gt; rather than the prices of the &lt;em&gt;past&lt;/em&gt;. Ie, you'll add back dividends and undo splits going forward. This is the opposite of what Yahoo is doing in their table; the reason for adjusting closes in the future is to prevent negative prices, which can happen if you subtract dividends from the values in the past. Once you have the adjusted prices, you can compute your returns without worry.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2013-02-04T21:45:26.117" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="7218" PostTypeId="2" ParentId="7215" CreationDate="2013-02-04T21:57:24.460" Score="3" Body="&lt;p&gt;Here is a possible explanation. Consider $X_t \sim N(0,1)$ and $Y_t \sim N(1,1)$. Then $(X_t)_0^n$ and $(Y_t)_0^n$ are realizations from stationary time series and I would expect the null hypothesis of stationarity not to be rejected (compatibly with the size of your test). Instead, the sample $(Z_t)_1^{2n} = (X_1, \dots, X_n, Y_1, \dots, Y_n)$ is drawn from a non-stationary process (the mean is not constant) and a test with enough power will in general reject the null of stationarity.&lt;/p&gt;&#xA;" OwnerUserId="1531" LastEditorUserId="1531" LastEditDate="2013-02-05T04:42:12.667" LastActivityDate="2013-02-05T04:42:12.667" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7219" PostTypeId="2" ParentId="7216" CreationDate="2013-02-05T03:35:33.443" Score="11" Body="&lt;p&gt;Concerning adjusted price series: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Free yourself from terminology and definitions, as you can clearly see, Yahoo Finance got it wrong on the stock split you linked to (and as chrisaycock correctly pointed out). You need to focus on the problem not the term people use to describe the problem: You need to adjust time series for the stock split, period. So, it does not matter whether the standard terminology is to use &quot;adjusted price&quot;, &quot;split adjusted price&quot;, or just &quot;price&quot; (some price adjustment converters in fact backward-adjust and thus the splits are reflected in the pure &quot;price&quot; columns rather than in any &quot;adjusted price&quot; column. (of course here in this example Yahoo is inconsistent which is incorrect).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The standard (still now) for adjusting price time series for corporate actions is still backward adjustment &lt;strong&gt;not&lt;/strong&gt; forward adjustment. Forward adjustment benefits you if you have past prices locked in for some reason and cannot adjust those but need to preserve the true price changes going forward, however, it suffers from couple other deficiencies in comparison to backward adjustment. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You need to be extremely careful adjusting prices for dividends. If you are exposed to the discontinuous price differential due to dividend payments but you are &lt;strong&gt;not&lt;/strong&gt; the holder of the stock on the ex-date of the dividend announcement then you will &lt;strong&gt;not&lt;/strong&gt; benefit from any dividend payments but you are still fully exposed to the price adjustment.(I am just making the point here and am not saying this is possible or impossible, what I try is to sharpen your sense of segregating different issues here). Thus, you ought to &lt;strong&gt;not&lt;/strong&gt; adjust the price time series, otherwise you will manipulate your true returns. If you are being paid dividends then yes, you should adjust the price series. For that very reason professionals who really work with historical time series do not adjust time series at all, they keep a special schedule of corporate actions and attach corporate action codes to them and thus they can later adjust price time series on the fly depending on the exact circumstances they find themselves in. Adjusting a price time series for good and storing such data is a very suboptimal exercise imho. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-02-05T03:35:33.443" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7220" PostTypeId="2" ParentId="7214" CreationDate="2013-02-05T03:56:23.040" Score="1" Body="&lt;p&gt;I think you do not need to be a &quot;Systems Programmer&quot;, certainly not an experienced one, to solve this problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Focus on the header, its your legend to the file structure. It describes the format and essentially already tells you how to decode the following messages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Depending on your choice of language you then process each message in binary format and convert each item to the numeric format. In C#, some use &quot;BitConverter&quot; but obviously C# is not the language of choice here. If you can tell me which specific language you use to make the conversion then that would be helpful. A lot of people use Python to convert this kind of stuff to a higher level text based format such as csv or any delimiter-delimited structure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Before you convert you may want to think carefully whether you may want to perform operations on the byte array representations of your numeric values (I am not familiar with your mentioned specific feed, though some feeds only output the &quot;alpha&quot; rather than full spread, for example, thus you need to perform add/subtract operations which can in certain cases be more optimal to perform on the byte array itself). Here is an example :&#xA;&lt;a href=&quot;https://stackoverflow.com/questions/3641274/c-sharp-int-byte-conversion&quot;&gt;https://stackoverflow.com/questions/3641274/c-sharp-int-byte-conversion&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are couple Python examples just to show you how a simple byte[]-&gt; int conversion could be done:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/386753/how-do-i-convert-part-of-a-python-tuple-byte-array-into-an-integer&quot;&gt;https://stackoverflow.com/questions/386753/how-do-i-convert-part-of-a-python-tuple-byte-array-into-an-integer&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/444591/convert-a-string-of-bytes-into-an-int-python&quot;&gt;https://stackoverflow.com/questions/444591/convert-a-string-of-bytes-into-an-int-python&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S.: It won't help you but I find mixed message formats very inefficient but that is not your fault. Most efficient streams only ship byte arrays, nothing else. A symbol should anyway never be in string format internally, but rather be assigned an int32 or int64 code. Mapping internally is much faster than converting each symbol of each message from byte array to string. Also, even if the symbol is decoded in ASCII that is very inefficient and blows up message size. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="-1" LastEditDate="2017-05-23T11:33:46.017" LastActivityDate="2013-02-05T07:21:12.877" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7221" PostTypeId="2" ParentId="1658" CreationDate="2013-02-05T09:12:11.683" Score="0" Body="&lt;p&gt;There has been a significant interest in evaluation of role of HFT. I wonder if this is the correct question. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The study of their roles should be in a scenario where HFT is present and where HFT is not present. Earlier Specialists and Market Makers used to make that profit, now it is shared between them and HFT. So ideally the pie has remained the same (if ceteris paribus is markets is assumed) , the turnover &quot;would&quot; increase because of HFT. (Assumption being HFT turnover is more than Specialists + MM) As a result, more tax is generated for the governments. &lt;/p&gt;&#xA;" OwnerUserId="3053" LastActivityDate="2013-02-05T09:12:11.683" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7224" PostTypeId="2" ParentId="3640" CreationDate="2013-02-05T14:44:36.653" Score="0" Body="&lt;p&gt;CUSIP Global Services gives &lt;a href=&quot;https://www.cusip.com/pdf/CUSIP_Intro_03.14.11.pdf&quot; rel=&quot;nofollow&quot;&gt;the following explanation regarding fixed incomes&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The issue identifier assigned to an issuer’s fixed income securities&#xA;  may consist of two alphabetic characters (AA etc.), one alphabetic&#xA;  character followed by one digit (A2 etc.), or one digit followed by&#xA;  one alphabetic character (2A etc.), assigned in that order. A separate&#xA;  issue identifier is assigned to each rate and/or maturity for each&#xA;  issue of bonds—thus a serial bond having 40 different maturities is&#xA;  assigned 40 separate issue identifiers—but general obligations of a&#xA;  municipality having the same issue date, rate and maturity are&#xA;  normally assigned the same identifier regardless of purpose. The&#xA;  alphabetic letter “I” and numeric “1” as well as the alphabetic “O”&#xA;  and numeric zero are not used in the assignment of issue identifiers&#xA;  to fixed income securities.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;There is no algorithm, unfortunately. The Treasury simply purchases CUSIP numbers from Global Services. There's no guarantee that the code will even be an increment from the previous issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you are stuck with looking up codes from a data vendor.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2013-02-05T14:44:36.653" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7225" PostTypeId="1" AcceptedAnswerId="7226" CreationDate="2013-02-05T15:03:07.423" Score="0" ViewCount="214" Body="&lt;p&gt;How is it possible for a Futures contract to have an intangible underlying? For example, to my knowledge, there exist Futures that have interest rates as their underlying, come delivery date, how is the seller suppose to &quot;deliver&quot; interest rates?&lt;/p&gt;&#xA;" OwnerUserId="4747" LastActivityDate="2013-02-05T16:07:34.440" Title="Intangible assets as underlying for Futures contracts" Tags="&lt;futures&gt;&lt;fundamentals&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7226" PostTypeId="2" ParentId="7225" CreationDate="2013-02-05T15:13:12.320" Score="2" Body="&lt;p&gt;It's just cash settled, like a bet on a sports game.  This was somewhat controversial when the financial index futures were first invented.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2013-02-05T15:13:12.320" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7227" PostTypeId="2" ParentId="7225" CreationDate="2013-02-05T16:07:34.440" Score="2" Body="&lt;p&gt;Examples for cash-settled futures are: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Interest Rate futures&lt;/li&gt;&#xA;&lt;li&gt;Futures on implied Volatility (e.g. on VIX)&lt;/li&gt;&#xA;&lt;li&gt;Futures on Commodity Indices: Indices such as the Dow Jones UBS consist of futures themselves. Furthermore in asset management you usually don't want physical delivery of the underlying (oil, gas, coal, pig, ... ;)&lt;/li&gt;&#xA;&lt;li&gt;Futures on Equity Indices&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The pricing and the risk models differ for all these depending on whether you can trade the underlying or not. With VIX it becomes especially tricky.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2013-02-05T16:07:34.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7228" PostTypeId="2" ParentId="7214" CreationDate="2013-02-05T19:55:11.833" Score="1" Body="&lt;p&gt;I wrote the &lt;a href=&quot;http://cran.r-project.org/web/packages/pack/index.html&quot; rel=&quot;nofollow&quot;&gt;pack R package&lt;/a&gt; (based on Perl's pack function), to do this for opentick (now defunct) data.  You can look at the &lt;a href=&quot;http://cran.r-project.org/src/contrib/Archive/opentick&quot; rel=&quot;nofollow&quot;&gt;opentick package&lt;/a&gt; (in the CRAN archives) to see how I used it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just noticed that you said you're comfortable with Perl in your SO post.  In that case, I'd recommend you use Perl's &lt;a href=&quot;http://perldoc.perl.org/functions/unpack.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;unpack&lt;/code&gt;&lt;/a&gt; function.&lt;/p&gt;&#xA;" OwnerUserId="56" LastEditorUserId="56" LastEditDate="2013-02-05T20:00:49.937" LastActivityDate="2013-02-05T20:00:49.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7229" PostTypeId="1" AcceptedAnswerId="7234" CreationDate="2013-02-05T20:48:12.850" Score="6" ViewCount="959" Body="&lt;p&gt;I strictly store UTC time stamps inside time series files or databases, mainly to allow processing several time series together. Timezone information is kept with each time series file or item, so conversion to local time is always possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I also see local times stored in time series files and wondered if there are any good reasons to do anything different than UTC in a general universal database (for ad hoc single time series analysis local time is indeed reasonable).&lt;/p&gt;&#xA;" OwnerUserId="1854" LastActivityDate="2013-02-06T05:09:43.003" Title="time in time series database - UTC or local" Tags="&lt;time-series&gt;&lt;data&gt;&lt;historical-data&gt;&lt;time&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7230" PostTypeId="1" CreationDate="2013-02-05T22:31:09.577" Score="2" ViewCount="2242" Body="&lt;p&gt;I am looking for some inputs on a pair trading strategy that I am trying to improve with some semi-fundamental input.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The basic idea is to use multiple linear regression to estimate the price of a stock ($Y$) based on fundamentals:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;Y(t) = \beta_0 + \beta_1*x_1(t) + \beta_2*x_2(t) + \cdots&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just to give you an idea of a case:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$Y$ = Stock price, e.g. Starbucks &lt;/li&gt;&#xA;&lt;li&gt;$x_1$ = Market, e.g. S&amp;amp;P500 &lt;/li&gt;&#xA;&lt;li&gt;$x_2$ = Coffe price&lt;/li&gt;&#xA;&lt;li&gt;$x_3$ = Competitor something.. &lt;/li&gt;&#xA;&lt;li&gt;$x_4$ = Forex something..&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;My idea would be to only trade in the direction of the residual at the last date of the regression, meaning that if starbucks is at 55 and the regression gives a &quot;fundamental&quot; price at 60 I would only go long. And, since this is a part of a larger pair trading strategy I would short something else and include all the commonly used pair trading parameters. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After some extensive googling I have not been able to find any similar approaches. Anybody who has seen anything similar somewhere? Does it make any sense? Or is this just way off?&lt;/p&gt;&#xA;" OwnerUserId="4749" LastEditorUserId="467" LastEditDate="2013-02-06T02:44:05.213" LastActivityDate="2013-11-03T10:43:53.163" Title="Multiple (linear) regression" Tags="&lt;arbitrage&gt;&lt;regression&gt;&lt;pairs-trading&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7232" PostTypeId="1" CreationDate="2013-02-06T01:25:00.047" Score="7" ViewCount="736" Body="&lt;p&gt;On wikipedia, there is a formula to calculate the Altman Z-score for private companies:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Z-score estimated for private firms:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;T1 = (Current Assets − Current Liabilities) / Total Assets&lt;br&gt;&#xA;T2 = Retained Earnings / Total Assets&lt;br&gt;&#xA;T3 = Earnings Before Interest and Taxes / Total Assets&lt;br&gt;&#xA;T4 = Book Value of Equity / Total Liabilities&lt;br&gt;&#xA;T5 = Sales/ Total Assets&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Z' Score Bankruptcy Model:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Z' = 0.717T1 + 0.847T2 + 3.107T3 + 0.420T4 + 0.998T5&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Zones of Discrimination:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Z' &gt; 2.9 -“Safe” Zone&lt;br&gt;&#xA;1.23 &amp;lt; Z' &amp;lt; 2. 9 -“Grey” Zone&lt;br&gt;&#xA;Z' &amp;lt; 1.23 -“Distress” Zone&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;b&gt;&#xA;Is there a mapping from this Z', a dimensionless number, to something like, &quot;BBB&quot; or &quot;12% of default in one year&quot;?&lt;/b&gt;&lt;/p&gt;&#xA;" OwnerUserId="4751" LastActivityDate="2019-10-11T23:02:50.420" Title="is there a mapping from Altman Z-score for private companies to bond ratings or probability of default?" Tags="&lt;fixed-income&gt;&lt;credit-ratings&gt;&lt;default&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7233" PostTypeId="2" ParentId="7230" CreationDate="2013-02-06T03:08:12.390" Score="3" Body="&lt;p&gt;I personally would not do that!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your regression model has been &lt;strong&gt;fitted&lt;/strong&gt; to approximate $Y(t)$ (the reality) as much as possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I understand you well, you say:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;at the previous period $Y(t)=55$ (Starbucks traded at 55 USD)&lt;/li&gt;&#xA;&lt;li&gt;the last period's estimate from the regression is $\hat{Y}(t)=60$ &lt;/li&gt;&#xA;&lt;li&gt;Since $\hat{Y}(t)-Y(t) &amp;gt; 0$, you want to invest.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This does not make sense to me because you are &lt;strong&gt;trusting more the model than the actual process&lt;/strong&gt; $Y$ and the model has been optimized (fitted) on $Y$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you computed the regression parameters, you found the best linear relationship between $Y$ and your different dependent variables $X$. Yet, your model does not perfectly fit the data (it has residuals: 60-55=5). So in a sense, the model hasn't been able to completely understand Starbuck's price process. And yet, you are willing to trade in the direction of the residual, which is the &lt;strong&gt;error&lt;/strong&gt; of the regression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Besides, beware of the dependent variables $X$ you use. Multiple linear regression requires them to be uncorrelated. This would generate problem if you look at the statistical significance of the estimated parameters $\beta_1, ... \beta_k$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, under the assumptions of the multiple regression, the residuals (which you trade on) are supposed to be normally distributed with mean 0! So this means that you are in fact  trading on an indicator that is just &lt;strong&gt;random&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2013-02-06T03:16:04.930" LastActivityDate="2013-02-06T03:16:04.930" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="7234" PostTypeId="2" ParentId="7229" CreationDate="2013-02-06T05:09:43.003" Score="5" Body="&lt;p&gt;I think storing in UTC format is good practice. Here couple ideas that may motivate someone to deviate from that:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Some markets are subject to day light saving time shifts and thus it introduces additional computations to convert back and forth, having to keep track of the 2 times a year the shifts occur. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Some only limit themselves to an individual market, hence, there is no need to store data in UTC format. Any conversion add computational inefficiencies. So, if one only trades and analyzes Japanese data, then it may make sense for such person to only concern him/herself with local Japan time zone time stamps. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;UTC is maybe the standard but nothing speaks against to ref all time stamps to any other agreed time zone. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-02-06T05:09:43.003" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7237" PostTypeId="1" CreationDate="2013-02-07T13:11:38.747" Score="4" ViewCount="111" Body="&lt;p&gt;I have an equal-weighted index on a number of different Indices (from US, Europe and Asian markets). This compound index is constructed from a time series that has missing values (for example, those regions have different banking holidays). This problem will affect about 10 days out of 250 per year of data. What strategy should I choose to handle those imputed values?&lt;/p&gt;&#xA;" OwnerUserId="4726" LastEditorUserId="35" LastEditDate="2013-02-07T14:24:35.137" LastActivityDate="2013-02-07T14:59:32.833" Title="Imputed values in a multi-index" Tags="&lt;time-series&gt;&lt;index&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7238" PostTypeId="2" ParentId="7237" CreationDate="2013-02-07T13:56:01.373" Score="2" Body="&lt;p&gt;What is the aim of your calculation - rather risk analyis or performance comparison? In either case an easy and valid approach would be to replace missing values with the most recent nonmissing. In R &lt;a href=&quot;http://rss.acs.unt.edu/Rdoc/library/zoo/html/na.locf.html&quot; rel=&quot;nofollow&quot;&gt;na.locf&lt;/a&gt; from the package zoo does this.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2013-02-07T13:56:01.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7239" PostTypeId="2" ParentId="7237" CreationDate="2013-02-07T14:46:58.227" Score="4" Body="&lt;p&gt;I think the simple advice here is to keep the indexes unchanged from the previous closing day (you basically assume unchanged prices). &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;A bad idea is to compute essentially a &quot;new&quot; index in that you drop out the index which does not trade and recalculate the denominator. It will greatly skew the results, bad thing to do.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A better idea would be not only keep the missing index unchanged but to calculate a beta at any given time in the past between the index in question and the other indexes and to then estimate a value for the non-trading index based on the beta and that day's return of the other indexes. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;But again, I bet most would simply use the previous day's closing value. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-02-07T14:59:32.833" LastActivityDate="2013-02-07T14:59:32.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7240" PostTypeId="1" AcceptedAnswerId="7241" CreationDate="2013-02-07T15:06:02.637" Score="2" ViewCount="49206" Body="&lt;p&gt;I would like to automate my trading strategies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My strategies are not high-frequency and are written in Python.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a trading account in Interactive Brokers, and I know some non-official Python libraries (such as &lt;a href=&quot;https://github.com/blampe/IbPy&quot; rel=&quot;nofollow noreferrer&quot;&gt;ibPy&lt;/a&gt; and &lt;a href=&quot;http://pypi.python.org/pypi/swigibpy&quot; rel=&quot;nofollow noreferrer&quot;&gt;swigPy&lt;/a&gt;) that are an interface to the Java API and are not officially supported.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there another broker that has a better stock trading API for Python?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Inspired by &lt;a href=&quot;https://quant.stackexchange.com/questions/1554/which-brokers-offer-a-net-stock-trading-api&quot;&gt;Which brokers offer a .NET stock trading API?&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2257" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2013-05-20T15:28:05.917" Title="Which brokers offer a Python stock trading API?" Tags="&lt;programming&gt;&lt;algorithmic-trading&gt;&lt;python&gt;&lt;broker&gt;&lt;interactive-brokers&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="7241" PostTypeId="2" ParentId="7240" CreationDate="2013-02-07T15:35:32.930" Score="2" Body="&lt;p&gt;I know of no broker that provides an official, supported Python API. If you are at Interactive Brokers you can consider using their FIX gateway, but that comes with additional cost. &lt;a href=&quot;http://quickfixengine.org&quot; rel=&quot;nofollow&quot;&gt;QuickFix&lt;/a&gt; provides a Python API.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastEditorUserId="1355" LastEditDate="2013-02-07T21:47:30.473" LastActivityDate="2013-02-07T21:47:30.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7243" PostTypeId="1" AcceptedAnswerId="7256" CreationDate="2013-02-07T18:04:59.577" Score="3" ViewCount="312" Body="&lt;p&gt;What are the formulae for &lt;code&gt;d1&lt;/code&gt; &amp;amp; &lt;code&gt;d2&lt;/code&gt; using a &lt;a href=&quot;http://en.wikipedia.org/wiki/Laplace_distribution&quot; rel=&quot;nofollow&quot;&gt;Laplace distribution&lt;/a&gt;?&lt;/p&gt;&#xA;" OwnerDisplayName="user3232" LastEditorUserId="467" LastEditDate="2013-02-15T08:00:27.010" LastActivityDate="2013-02-15T08:00:27.010" Title="What are $d_1$ and $d_2$ for Laplace?" Tags="&lt;black-scholes&gt;&lt;probability&gt;&lt;stochastic-processes&gt;&lt;distribution&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7245" PostTypeId="2" ParentId="4160" CreationDate="2013-02-07T19:28:36.350" Score="19" Body="&lt;p&gt;Arithmetic returns allow for easier cross-sectional aggregation and log returns allow for easier time-aggregation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason people use log returns (for equities) is that they are approximately invariant and hence easier to work with in estimating distributions. Meucci does better justice in describing invariance &lt;a href=&quot;http://symmys.com/node/85&quot;&gt;here&lt;/a&gt;. The basic idea (again, for equities) is that the distribution of security prices is log-normal, so the arithmetic returns will also be. However, making a log transformation results in approximately normal returns, which are easier to work with. Also, if you do assume them to be normally distributed, then there are convenient results for the convolution of multivariate normal series. This is what allows for easier time-aggregation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, you shouldn't take log returns and use them to obtain the arithmetic portfolio return. This is because while you can link them through time, the math doesn't work out, particularly at long horizons, cross-sectionally. Hence, after estimating the distribution of the log returns, proper procedure is to convert the them to arithmetic returns for the purposes of portfolio optimization and risk management.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2013-02-07T19:28:36.350" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7246" PostTypeId="1" AcceptedAnswerId="7247" CreationDate="2013-02-07T22:30:30.403" Score="14" ViewCount="6194" Body="&lt;p&gt;There are several methods available between data vendors and associated software programs to adjust futures contract data for historical simulations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some of the methods are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Back or forward Adjust by iterative level shifting of historical data at rollover points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Back or forward Adjust by iteratively using ratio of historical series to current series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Using next contract with highest volume instead of front contract as the next contract to be joined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some of the problems associated with different methods can be&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) negative price series&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) inconsistency in rollover dates (one person may use first notice day e.g. commodities, another might use 20 days prior to settlement, another 7 etc..)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) adjustment methods vary by instrument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) There could be true price gaps between the rollover period that have been filtered out by the method of adjustment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The list is nowhere near exhaustive* Could anyone elaborate on what methods you or your firm are actually using to systematically adjust a broad portfolio of futures contracts (for simulations) in practice?  Also, what pros and cons are there to using your method vs. some of the other methods that exist? Any references to expand on your method are also appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;*There are some papers e.g. &lt;a href=&quot;http://www.tradingrecipes.com/files/cntcontr.pdf&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;http://www.ipedr.com/vol29/48-CEBMM2012-R00003.pdf&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;http://www.automated-trading-system.com/what-everybody-ought-to-know-about-continous-futures-contracts/&quot;&gt;blogs&lt;/a&gt; that discuss pros and cons, but I'm more interested in best practices and approaches by large portfolio managers.&lt;/p&gt;&#xA;" OwnerUserId="3040" LastEditorUserId="3040" LastEditDate="2013-02-08T00:32:06.743" LastActivityDate="2016-12-06T17:40:37.663" Title="What continous adjustment methods are firms using for futures backtesting?" Tags="&lt;futures&gt;&lt;adjustments&gt;&lt;historical&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7247" PostTypeId="2" ParentId="7246" CreationDate="2013-02-08T00:46:26.723" Score="7" Body="&lt;p&gt;As you pointed out there are many ways to adjust for the roll overs. Hence, I guess you would agree that there is no one-size-fits-all answer to this. It really depends on the usage of the data:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;First think about how the trades in your back test are structured. If they are longer-term trades and you hold over roll overs then think what you would do if you traded the contract. Meaning, would you try to trade the basis? Would you simply close out and open a day before expiration? Whatever you intend to do you also then need to apply to the futures roll over in your back test. Thats why I said there is no general answer that fits it all. But here couple other points to consider:&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you strictly peruse the data for intraday analysis/back tests then you do not and probably should not make any adjustments to the data itself. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you need to create a &quot;continuous contract&quot; (I just use the terminology loosely) then I would generally backward-adjust which is what most reputable data vendors do. Though I also have worked with un-adjusted data and simply adjusted, ratio-wise, on the fly. I do not think there is a strict right or wrong answer. But if must make up my mind I would say, backward adjust. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Regarding trading I would roll over to trade the next contract when volume in the new contract exceeds the one of the old contract. I would potentially not trade the current month beyond first-notice in case I am subject to receiving notice. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I would potentially skip the next contract if a contract another 1-2 months out trades at much more volume. Obviously this does not apply if your strategy relies on the specific contract month (for example as hedge in an options book or because you trade basis or there could be many other reasons). &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-02-08T00:46:26.723" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7249" PostTypeId="1" AcceptedAnswerId="7250" CreationDate="2013-02-08T05:45:42.013" Score="2" ViewCount="472" Body="&lt;p&gt;I am having trouble understanding how to calculate two-time scale variance as I do not have a strong mathematical background. Suppose I want to calculate the TSRV at 5 min intervals. Do I calculate the RV at t = 0,5,10,15min...etc. Then shift the time interval and calculate RV at t = 1,6,11,16min, ....RV at t = 4,9,14,19...and finally take the average of the 5 RVs I have calculated?&lt;/p&gt;&#xA;" OwnerUserId="4692" LastActivityDate="2013-02-08T12:23:16.193" Title="How to calculate two-time scale variance?" Tags="&lt;volatility&gt;&lt;forecasting&gt;&lt;variance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7250" PostTypeId="2" ParentId="7249" CreationDate="2013-02-08T06:37:39.943" Score="3" Body="&lt;p&gt;&lt;a href=&quot;http://books.google.co.jp/books?id=6DGUEw-AfbwC&amp;amp;pg=PA451&amp;amp;lpg=PA451&amp;amp;dq=tsrv%20variance&amp;amp;source=bl&amp;amp;ots=piI33OVWZe&amp;amp;sig=df8NwVwwYGjWpXdp7mxGgeH_D2U&amp;amp;hl=en&amp;amp;sa=X&amp;amp;ei=AJsUUZvYCYrllAW84oGwBw&amp;amp;redir_esc=y#v=onepage&amp;amp;q=tsrv%20variance&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;Here are the exact steps to calculate TSRV&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also like &lt;a href=&quot;http://www.princeton.edu/~yacine/liquidity.pdf&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="35" LastEditDate="2013-02-08T12:23:16.193" LastActivityDate="2013-02-08T12:23:16.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7252" PostTypeId="1" AcceptedAnswerId="7257" CreationDate="2013-02-08T12:43:46.407" Score="4" ViewCount="2012" Body="&lt;p&gt;I put together a &lt;a href=&quot;https://gist.github.com/nesteruk/fa9dfd6aa1059c65dd93&quot;&gt;simple simulation&lt;/a&gt; of delta hedging a set of options with an underlying and it seems that the fluctuations of the price still seem to affect the final outcome. The reason, I understand it, is because when we rehedge, we assume that $\Delta_{S}=1$ but we don't factor in the fact that the price keeps changing. Is this a normal consequence of delta hedging practices?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Incidentally, my approach to keeping track of the amount of underlying bought or sold is to keep information related to total underlying position and the &lt;em&gt;recalculated price&lt;/em&gt; which is&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If position is increased, we recalculate the price based on the increased position, i.e. average out the prices.&lt;/li&gt;&#xA;&lt;li&gt;If position is decreased, we keep the entry price the same, reduce the number of underlyings and calculate the p/l of the underlyings we bought/sold as cash.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So, another question - is this the right way to recalculate the portfolio position?&lt;/p&gt;&#xA;" OwnerUserId="1217" LastActivityDate="2013-02-09T00:53:07.360" Title="Why doesn't a simulated delta hedging process go to zero?" Tags="&lt;options&gt;&lt;delta-hedging&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7253" PostTypeId="1" CreationDate="2013-02-08T14:30:52.240" Score="0" ViewCount="477" Body="&lt;p&gt;We are developing an algorithm that models twitter users and groups of words that may indicate real world events.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One application is modelling elections, i.e which party is likely going to win. Another application is modelling the stock market. In addition, we are also interested in how the tweets, elections and stock markets correlate with each other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With regard to stock market, what would be sensible indicators to model? One obvious metric would be the index price movement. Another we were thinking about is volume of trade and perhaps volatility. Anyway, not really sure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I'm looking for is a list if indicators that would be sensible to model. What I have so far:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Index price &lt;/li&gt;&#xA;&lt;li&gt;Specific stock prices &lt;/li&gt;&#xA;&lt;li&gt;Price differences&lt;/li&gt;&#xA;&lt;li&gt;Trend &lt;/li&gt;&#xA;&lt;li&gt;Expected future returns&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Any additions that would make sense?&lt;/p&gt;&#xA;" OwnerUserId="1681" LastEditorUserId="1681" LastEditDate="2013-02-08T15:10:00.650" LastActivityDate="2013-02-09T13:07:07.400" Title="What stock market indicators to model based on twitter feed?" Tags="&lt;correlation&gt;&lt;forecasting&gt;" AnswerCount="2" CommentCount="1" ClosedDate="2013-02-09T16:56:06.443" ContentLicense="CC BY-SA 3.0" />
  <row Id="7254" PostTypeId="2" ParentId="7253" CreationDate="2013-02-08T14:33:00.253" Score="2" Body="&lt;p&gt;You may be interested in the &lt;a href=&quot;http://www.finalternatives.com/node/20582&quot; rel=&quot;nofollow&quot;&gt;twitter based hedge&lt;/a&gt; fund that recently fell under, but what you will be looking to model is market sentiment from the tweets and there are different ways to do this and a whole field of literature on this topic. Here is a decent &lt;a href=&quot;http://people.csail.mit.edu/azar/wp-content/uploads/2011/09/thesis.pdf&quot; rel=&quot;nofollow&quot;&gt;thesis&lt;/a&gt; from MIT on the topic&lt;/p&gt;&#xA;" OwnerUserId="1764" LastActivityDate="2013-02-08T14:33:00.253" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7255" PostTypeId="2" ParentId="7252" CreationDate="2013-02-08T16:26:04.087" Score="2" Body="&lt;p&gt;I think you incorrectly calculate portfolio values. For me the easiest way to keep track of portfolio positions and avg price is to separately calculate the sum of volume traded on the long and short side and to also calculate an average price separately for buys and sells. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You obviously must update the avg price and size of the particular side (long/short) at which you traded each time in order to in exchange have the ability to query pnl and exposure (unrealized and realized) at any time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&#xA;About your hedge error, I think Christian got it right, you can't get to zero tracking error by running different dynamics in the evolution of the underlying vs the hedge origination. Also I hope we all agree this only works in theory. In reality the simplifying assumptions made will cause the tracking error to always be non zero. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-02-09T00:53:07.360" LastActivityDate="2013-02-09T00:53:07.360" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7256" PostTypeId="2" ParentId="7243" CreationDate="2013-02-08T16:38:43.410" Score="2" Body="&lt;p&gt;Your question is interesting because I thought that the only chance with Lévy-processes is to use Fourier-transform approaches (see e.g. Cont,Tankov).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in the paper &lt;a href=&quot;http://www.cmss.monash.edu.au/assets/files/KlebanerLandsman2007.pdf&quot; rel=&quot;nofollow&quot;&gt;Option Pricing for Log-Symmetric&#xA;Distributions of Returns by Fima C. Klebaner· Zinoviy Landsman&lt;/a&gt; they consider models, where the log of the price has a symmetric distribution. In Corollary 3.2 they propose an approximate formula if the log of the price follows the Laplace distribution where&#xA;$$&#xA;d_{1,2} = \frac{\ln(S_0/K) + (r \pm log(1-\sigma^2/2))T}{\sigma \sqrt{T}}.&#xA;$$&#xA;They write $\log$ but I guess this is just an $\ln$ as before. But please try yourself and/or read the first pages of the paper to be sure.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2013-02-08T16:38:43.410" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7257" PostTypeId="2" ParentId="7252" CreationDate="2013-02-08T22:15:11.067" Score="9" Body="&lt;p&gt;I assume you mean that the hedge error should go to zero when the time-step size goes to zero. This is the case!&#xA;I have a BS delta hedge simulator here: &lt;a href=&quot;http://www.christian-fries.de/finmath/applets/HedgeSimulator.html&quot;&gt;http://www.christian-fries.de/finmath/applets/HedgeSimulator.html&lt;/a&gt; and the source code here: &lt;a href=&quot;http://www.finmath.net/java/&quot;&gt;http://www.finmath.net/java/&lt;/a&gt;&#xA;which shows that the delta hedge converges.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in order to have that result, the underlying stock must follow the model which is assumed in the calculation of the hedge. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your MatLab code it looks like you are simulating stocks as Brownian motion but are calculating delta from Black-Scholes (which assumes Geometric Brownian motion). Is this intentional or a bug?&lt;/p&gt;&#xA;" OwnerUserId="3548" LastActivityDate="2013-02-08T22:15:11.067" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7260" PostTypeId="1" AcceptedAnswerId="14408" CreationDate="2013-02-09T06:27:56.813" Score="4" ViewCount="6116" Body="&lt;p&gt;I'm trying to compute the standard &lt;code&gt;ARMA(1,1)-GARCH(1,1)&lt;/code&gt; as shown in this &lt;a href=&quot;https://quant.stackexchange.com/a/4955/1764&quot;&gt;answer&lt;/a&gt; for an entire index,just to store in a database to quickly lookup values for back testing purposes. There is just one problem that the optimization method used by rugarch doesn't always converge giving and yields the error. I'm using minute equity data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;failed to invert hessian&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an easy work around or evasive solution to guarantee that it will always converge?&lt;/p&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2014-08-16T21:36:21.923" Title="R ARMA-GARCH rugarch package doesn't always converge" Tags="&lt;r&gt;&lt;garch&gt;&lt;arma&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7261" PostTypeId="2" ParentId="7253" CreationDate="2013-02-09T13:07:07.400" Score="1" Body="&lt;p&gt;I implemented (purely for testing purposes, no real world application) a similar system which was based on Google Trends, where you get data on relative search query volume for a given keyword over time (weekly intervals). The important point is that you cannot directly link social media buzz to an up- or downmove. It will however give you an idea about larger-than-usual movements in any direction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We used a list of companies we wanted to look into, build a list of related keywords (like 'Apple' and 'iPhone'), and then aggregated the search query volume over the keywords and used a slightly modified version of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Average_directional_movement_index&quot; rel=&quot;nofollow&quot;&gt;ADX Indicator&lt;/a&gt;. We only considered up-movements to have means to recognize when the search volume would rise exceptionally. The idea behind this was that when the search volume goes up, something is happening, or going to, without knowing whether its good or bad news, so this had to be interpreted in combination with something else, in that case we used a momentum based indicator I believe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a simple backtest (daily data, weekly rebalancing) it worked actually fine, but the timeseries where too short, and its pretty hard to get the required data for a sensible test, as most of it is buried in the databases of google or twitter and I'm not sure whether API-Access is possible. &lt;/p&gt;&#xA;" OwnerUserId="1976" LastActivityDate="2013-02-09T13:07:07.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7263" PostTypeId="1" CreationDate="2013-02-10T20:10:50.073" Score="0" ViewCount="180" Body="&lt;p&gt;If there's better vocabulary, forgive me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you were required to ignore variance as risk, how would you quantify non-fundamental risk?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks in advance!&lt;/p&gt;&#xA;" OwnerDisplayName="user3232" LastEditorDisplayName="user3232" LastEditDate="2013-02-12T02:50:20.977" LastActivityDate="2013-02-12T02:50:20.977" Title="how to quantify non-fundamental risk if variance is 100% discounted?" Tags="&lt;risk-management&gt;&lt;stochastic-processes&gt;&lt;investing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7264" PostTypeId="2" ParentId="7263" CreationDate="2013-02-11T04:55:33.467" Score="3" Body="&lt;p&gt;Here couple points that at least helped to formulate a daily guide for myself:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Losses are just what they are, losses. You return tomorrow to play again. But bankruptcy means game over, you are done. Thus such event is to be avoided at all cost. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Long-term, equities exhibit positive drift and have outperformed other competing asset classes. However, the path in between can lead any manager, investor, or trader to bankruptcy.  Volatility and draw downs can easily bring down any portfolio no matter how little it is leveraged. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Past performance ironically is often our best predictor of future performance. However, if the conditions that define performance are altered or adjusted to such extent that the prediction stands on shaky grounds then all bets are off. We have entered into an environment that is unprecedented (inability to service government debt without incurring huge amounts of new debt on a global scale; consumers with empty pockets unless they borrow by incurring liabilities in the form of HELs, mortgage debt, credit card debt; a new emerging super power which has not yet shown its true face,...). Point being, there is only 1 or 2 companies remaining in the Dow30 of those that comprised the index a century ago. Look at the S&amp;amp;P500 members 50 years ago and count how many of those companies are still in business today. We are entering uncharted territory and there is no guarantee that any particular asset class will outperform. There is not even a guarantee that inflation will cause damage. Hyper inflation generally went in hand with lose monetary policy (check), a great business environment with high capital expenditures (no), wage growth (no), and consumer price inflation (no but potentially yes). I do not think history will repeat itself or prevail. Thus, more care and respect for risk should be in order. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I want to protect my assets at all cost, any time, and always put priority on capital preservation over engaging in high risk-high payoff type of trades. I consider myself an opportunist. I have no problem (ideally) sitting on my hands for weeks and not putting capital at risk while searching for the trade that gives me a clear edge. What is the point of exposing myself to potentially catastrophic events over prolonged periods of time if I can wait and enter a trade when probabilities favor such position the most? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I think Peter Lynch greatly idealized his investment approach. He put in more research and care than anyone else but reading his book and comments it sometimes sounds like he is fine with prolonged draw-downs because he believes he bought something of value. Selling tops and buying bottoms has so far never worked out, nor have I seen academic papers that would suggest such approach is profitable, &lt;strong&gt;unless&lt;/strong&gt; you have so deep pockets or are a public figure that you can either move the market yourself or entice others (Ackman, Icahn, ...) to join your position. Trading against momentum is a losing proposition and I am sure that is not what Lynch advocated. But many self-proclaimed value investors interpret his wisdom in exactly this way. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I finally do not agree with your statement that value investors ignore risk. They do not and should not ignore risk (whether you call it variance risk or anything else does not matter). I simply have not come across a single successful trader or portfolio manager or investor who took the luxury to ignore risk (draw downs, return variations, ...). The smartest and at the same time most successful traders are not the ones who spot the best opportunities but the ones who exhibit the balance between being fearful and vigilant about exposing themselves beyond stringent risk limits and being aggressive and forceful when opportunities of high risk-return value present themselves. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-02-11T05:05:00.570" LastActivityDate="2013-02-11T05:05:00.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7266" PostTypeId="1" CreationDate="2013-02-11T20:04:47.653" Score="8" ViewCount="2625" Body="&lt;p&gt;(I'm quite new to quant finance so I'm not sure if this is an eligible question.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've decided I want to backtest pairs trading on the Nordic stockmarket. So I would guess there exists different methods of selecting the pairs (not just guess, I've heard and read some about them). For example the 'most written about' selection based on cointegration which seems most straight forward (which was used by Gatev et al in their paper called Pairs Trading: Performance of a Relative-Value Arbitrage Rule), but also some extended versions of this based on forecasting (tried reading about it but it was a bit to advanced for me). I've also heard about pairs trading calender time (or something like that), which I tried to find some articles about without succeeding (my guess would be that the selection and trades are done 'in calender time', meaning they are based on opening/closing prices rather than intraday. Please correct me if I'm wrong).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question is basically what different methods of pairs selection exists? I wouldn't want a full description of them, just some keywords to search (it's hard to find something when you don't really know what you're looking for.. sort of). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe if someone has come across some recent finding in this area or if someone who is actually working with this could give me some ideas on what is 'hot' (meaning what is used in the industry today) it would be great. I tried to contact a few hedgefunds, however they didn't really have time for students (maybe it was naive of me think they would).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance for your help!&lt;/p&gt;&#xA;" OwnerUserId="4709" LastActivityDate="2013-02-13T01:45:55.717" Title="What different methods of pairs selection exists? (For Pairs trading)" Tags="&lt;backtesting&gt;&lt;pairs-trading&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7268" PostTypeId="2" ParentId="2360" CreationDate="2013-02-12T05:55:28.983" Score="0" Body="&lt;p&gt;Noise is a data anomaly that typically occurs in the absence of signal. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the context of HFT it may refer to order activity (microstructure) motivated by a competing methodology, such as the rebalancing of a mutual fund portfolio to match the composition of the S&amp;amp;P.  &lt;/p&gt;&#xA;" OwnerUserId="4637" LastActivityDate="2013-02-12T05:55:28.983" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7269" PostTypeId="2" ParentId="1094" CreationDate="2013-02-12T06:31:14.627" Score="1" Body="&lt;p&gt;Most simply look to the German Mark as a proxy. It should suffice, assuming you don't require detail greater than what OHLC daily periodicity data offers. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A composite of Marks(75%), Francs(15%), Lira(5%) and Pesos(5%) would offer greater granularity if necessary. &lt;/p&gt;&#xA;" OwnerUserId="4637" LastActivityDate="2013-02-12T06:31:14.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7272" PostTypeId="1" AcceptedAnswerId="33609" CreationDate="2013-02-12T22:10:31.670" Score="8" ViewCount="1736" Body="&lt;p&gt;I am looking for a &lt;strong&gt;R&lt;/strong&gt; library for modeling a &lt;strong&gt;Markov-Switching E-GARCH&lt;/strong&gt; process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other questions at &lt;em&gt;StackExchange&lt;/em&gt; related to &lt;strong&gt;GARCH&lt;/strong&gt; models, the package &lt;strong&gt;rugarch&lt;/strong&gt; is often mentionned. Do you recommend it in my case?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like that &lt;strong&gt;R&lt;/strong&gt; library I am seeking had the following features:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;allows to observe/control the volatility term structure&lt;/li&gt;&#xA;&lt;li&gt;allows to impose long-term volatility&lt;/li&gt;&#xA;&lt;li&gt;has calibration routines&lt;/li&gt;&#xA;&lt;li&gt;includes forecasting procedures&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In fact, I would like to carry out a volatility analysis work &lt;em&gt;à la&lt;/em&gt; Carole Alexander, as described in her book &lt;a href=&quot;http://www.carolalexander.org/mra_vol_2.html&quot; rel=&quot;noreferrer&quot;&gt;Market Risk Analysis Volume II: Practical Financial Econometrics&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="2220" LastActivityDate="2017-04-10T19:43:16.030" Title="Markov-Switching E-GARCH with R" Tags="&lt;volatility&gt;&lt;r&gt;&lt;garch&gt;&lt;markov-switching&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7273" PostTypeId="1" CreationDate="2013-02-12T23:50:43.923" Score="1" ViewCount="236" Body="&lt;p&gt;I have computed PC1 and PC2 wts on future contracts derived from cumulative log differences. How can I use them to get back the theoretical price of each contract using those 2 pcs?  Thanks in advance.  &lt;/p&gt;&#xA;" OwnerUserId="4779" LastEditorUserId="4779" LastEditDate="2013-02-13T00:00:31.380" LastActivityDate="2013-02-13T21:37:53.737" Title="Interpretation of PCs" Tags="&lt;statistics&gt;&lt;trading&gt;&lt;pca&gt;&lt;multivariate&gt;" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7274" PostTypeId="2" ParentId="7266" CreationDate="2013-02-13T01:45:55.717" Score="5" Body="&lt;p&gt;The basic idea of pair trading is to find two symbols (I'll use that to mean stocks, futures, anything you can trade) that historically have correlated price movements. Then if just one of them increases in price you short that symbol, and buy its pair, on the &lt;em&gt;assumption&lt;/em&gt; that they will soon go back in sync.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However when you think there is a genuine reason for just one to move then you skip the trade; this is why trading stocks is nice, as most of the time when one stock moves but its pair does not, it is due to some news item. You can then quickly make a judgement how stock-specific it is (E.g. BP and the Deepwater accident affected BP more than SHEL).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find candidates with brute force: run correlations between all pairs of symbols in your database. But once you've found the correlation the next step is to find a &lt;em&gt;story&lt;/em&gt;. An explanation for why their prices move in step. Without that you won't know when to ignore a move. If you cannot find a story either you have discovered data mining noise, or you haven't tried hard enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is why usually you find pairs by starting with the story, and &lt;em&gt;then&lt;/em&gt; looking for a correlation:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Two stocks in the same industry. The &lt;a href=&quot;http://en.wikipedia.org/wiki/Pairs_trade&quot; rel=&quot;noreferrer&quot;&gt;Wikipedia page&lt;/a&gt; has a few stock examples.&lt;/li&gt;&#xA;&lt;li&gt;Two industries or stock market indices that have a lot in common. E.g. FTSE100 and FTSE250 correlate fairly well, because both are driven by the same general economic news.&lt;/li&gt;&#xA;&lt;li&gt;You might also consider pair-trading one stock with its industry ETF.&lt;/li&gt;&#xA;&lt;li&gt;You might even consider pairing an exchange rate with a stock or an index. E.g. the Nikkei 225 and USD/JPY. The story there being that as the yen weakens the big manufacturers become more competitive overseas. However raw material costs, in yen terms, also go up, so there is a counter-story there too.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;IIRC, Ernie Chan's &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/B001FA0GGC&quot; rel=&quot;noreferrer&quot;&gt;Quantitative Trading book&lt;/a&gt; had a chapter on pair trading.&lt;/p&gt;&#xA;" OwnerUserId="1587" LastActivityDate="2013-02-13T01:45:55.717" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="7275" PostTypeId="2" ParentId="7273" CreationDate="2013-02-13T03:24:21.853" Score="3" Body="&lt;p&gt;Yes you can, how depends fully on your required accuracy and also whether PC1 and PC2 are sufficient in explanatory power of the log differences of your futures contract. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, make sure you understand the signs of the eigenvalues (sign of the PC) can be different from one experiment to the next as they are arbitrary (the values are obviously not). Here some comments on that which I found when I tried to find supporting documents: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stats.stackexchange.com/questions/30348/acceptable-to-reverse-score-a-principal-component&quot;&gt;https://stats.stackexchange.com/questions/30348/acceptable-to-reverse-score-a-principal-component&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following describes in a somewhat theoretical way how to PCA-Reverse but they also bring up couple neat examples. You are not presented here with a off-the-shelf R code toolbox that gets you to your results in the next 5 minutes but I think anyone using PCA should actually first understand the related math and stats behind it first. I am sure you will be able to easily reverse the PCA post reading this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cs.columbia.edu/~stratos/research/pca_cca.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.cs.columbia.edu/~stratos/research/pca_cca.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: &#xA;I was actually so intrigued by the above paper's examples that I currently play with PCA and the PCA-Reverse in regards to image manipulation. Sorry that comment is not quant finance related but just wanted to share my excitement with math that sometimes overcomes me when playing with some interesting stuff. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2013-02-13T09:56:32.787" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7276" PostTypeId="1" AcceptedAnswerId="7278" CreationDate="2013-02-13T03:30:59.227" Score="20" ViewCount="12545" Body="&lt;p&gt;What makes GARCH(1,1) so prevalent in modeling volatility, especially in academia?&lt;br&gt;&#xA;What does this model offer that makes it significantly better than the others?&lt;/p&gt;&#xA;" OwnerUserId="4781" LastEditorUserId="19645" LastEditDate="2016-08-14T14:39:08.247" LastActivityDate="2016-08-14T14:39:08.247" Title="Why is GARCH(1,1) so popular, especially in academia?" Tags="&lt;garch&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="16" ContentLicense="CC BY-SA 3.0" />
  <row Id="7277" PostTypeId="2" ParentId="7276" CreationDate="2013-02-13T03:51:24.030" Score="0" Body="&lt;p&gt;Volatility tends to cluster and mean revert... garch incorporated the behavior the best.....  Ema doesn't do that..  its a step beyond exponential smoothing and weighting to replicate vol behavior&lt;/p&gt;&#xA;" OwnerUserId="4764" LastActivityDate="2013-02-13T03:51:24.030" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7278" PostTypeId="2" ParentId="7276" CreationDate="2013-02-13T04:31:55.367" Score="22" Body="&lt;p&gt;First, Garch models stochastic volatility. Thus its use should be limited to estimating the volatility component. The difference in some of the volatility models is the assumption made of the random variance process components. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe it has been popular because it is an extension of the ARCH family of models and it is relatively easy to setup and calibrate because it relies on past observations. Think of it this way: If you are to pinpoint your PhD dissertation topic would you take the risk to delve into deriving a new model, taking the risk you utterly fail and get nowhere over your x years of research or are you more likely to work on extensions or improvements of what currently exists? The same applies here GARCH is an extension of ARCH and there are numerous extensions of GARCH as well, such as GARCH-M, IGARCH, NGARCH...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I disagree with cdcaveman that it is the best model out there because it suffers from major deficiencies. Every model makes assumptions but there are better models out there for sure which is why I do not know of too many volatility traders that rely primarily on GARCH models in their quest to forecast volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Deficiencies: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It depends heavily on past variances&lt;/li&gt;&#xA;&lt;li&gt;The definition of &quot;long-term variance&quot; is at best arbitrary&lt;/li&gt;&#xA;&lt;li&gt;making the assumption of the randomness originating from a normal distribution&lt;/li&gt;&#xA;&lt;li&gt;The weights are just a result of optimization (MLE or other optimizers) of past data and make up the bulk of the calibration process. Volatility dynamics are changing in the same way as most other inputs to asset prices are dynamic thus making the assumption that an optimization of past variances, which results in the weights that make up the bulk of the current variance estimate, will yield anything that produces excess returns is a horrible assumption, imho. &lt;/li&gt;&#xA;&lt;li&gt;Though most multivariate models can get quickly complex, multivariate GARCH can be tricky in regards to specifying the covariances (VECH or BEKK come to mind). (credit to Bob Jansen for pointing out this aspect of GARCH). &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Volatility models that are originating from trading desks and that are rarely to be found in academic paper or the public domain often&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;do not make a normal distribution assumption of the variance dynamics&lt;/li&gt;&#xA;&lt;li&gt;heavily incorporate regime shifts&lt;/li&gt;&#xA;&lt;li&gt;rarely rely on functions of linear nature&lt;/li&gt;&#xA;&lt;li&gt;incorporate correlation structures with other asset classes and even non-price return related inputs. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In summary, its a neat model to output something to show off within minutes. Whether the results are usable is an entirely different question and again I do not know of too many pure index vol traders who embrace GARCH. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A look at the SABR model (or dynamic SABR) might be beneficial when searching for better models, though the &quot;backbone&quot; dynamics of the SABR model are more applicable for some derivatives than others.  &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-02-13T11:36:46.977" LastActivityDate="2013-02-13T11:36:46.977" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="7279" PostTypeId="2" ParentId="7077" CreationDate="2013-02-13T14:15:31.163" Score="5" Body="&lt;p&gt;In general setting this is quite a tough problem and it looks like just switching from regular multivariate probability to copulas doesn't make it easier. In general case you need to rely on numerical methods for integration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a nice overview of the problem in &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/364212464X&quot; rel=&quot;nofollow&quot;&gt;Copula Theory and Its Applications: Proceedings of the Workshop Held in Warsaw, 25-26 September 2009&lt;/a&gt;, Part I, Section 5.3, &quot;The Calculation of the Distribution of the Sum of Risks&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to avoid Monte Carlo methods, you can look at a new deterministic method &lt;a href=&quot;http://www.math.ethz.ch/~baltes/ftp/AEP08.pdf&quot; rel=&quot;nofollow&quot;&gt;AEP&lt;/a&gt;, which was specially designed to tackle this problem. Recursive and FFT methods are compared &lt;a href=&quot;http://www.math.ethz.ch/~baltes/ftp/PanjerVsFFTcorrected.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I haven't seen any work that deals with this problem specifically for Archimedean copulas.&lt;/p&gt;&#xA;" OwnerUserId="370" LastEditorUserId="370" LastEditDate="2013-02-13T20:21:29.897" LastActivityDate="2013-02-13T20:21:29.897" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7280" PostTypeId="1" AcceptedAnswerId="7282" CreationDate="2013-02-13T16:18:24.170" Score="3" ViewCount="1398" Body="&lt;p&gt;Using the recombining tree model as described in Haug's Option Pricing Forumla one can factor in multiple future discrete dividends when calculating the option value and greeks.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's unclear is how does one handle a stock that pays a regular quarterly dividend but has only declared (as is standard) the next quater's dividend.  If the option expires in one year, the next dividend is know, but the remaining three dividends have not yet been declared.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should one use past dividends as a reference?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you only use the [single] declared dividend (even though it's assumed there will be 4 dividends during the life of the option)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My &lt;em&gt;assumption&lt;/em&gt; is they you'd plug in the known and use the past dates / amounts as a reference for the other 'future' dividends' and revise those with the actual information when they are finally declared, but that's only an assumption. &lt;/p&gt;&#xA;" OwnerUserId="4786" LastActivityDate="2018-06-04T12:24:29.443" Title="Multiple Discrete Dividends" Tags="&lt;option-pricing&gt;&lt;discrete-dividends&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7281" PostTypeId="2" ParentId="1764" CreationDate="2013-02-13T17:24:32.397" Score="3" Body="&lt;p&gt;I will focus on some of the many reasons why we prefer C++ to Java, while I dont have much experience with C#. First of all various answers here have brought up valid points on why C++11 is way more practical than other languages, once the learning phase for advanced features is mastered, especially for large numerical projects, so I need not repeat things like why having control over GC is a significant advantage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Java is mostly geared towards an OO paradigm, while C++ additionally offers functional programming and a very powerful template metaprogramming framework (Java generics are not really comparable, neither do C#'s templates do significantly better afaik).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For numerics various Java issues can be a burden, such as the absence of unsigned integers (although this has been corrected at last) or slow performance of trigonometric functions.&#xA;Let alone access to SSE/AVX, and the lack of control over bounds checking. And operator overloading in Java is also not really supported: can you really write any numerical code without that?&#xA;And every Java object occupies at least 8 bytes, which has become a significant overhead with memory access becoming slower (especially in machine learning, but I bet in HFT too).&#xA;Missing adressing also renders many data structures unnecessarily heavy, and some are even impossible to implement in Java.&#xA;The virual machine sometimes pollutes the code cache too, then there's class loading and other overheads...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also the absence of function pointers is an issue, and the &quot;alternative&quot; Java idioms have their drawbacks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore afaik multithreading in Java is not so practical, and is shifted down to multiprocessing (please correct me here).&#xA;Interfacing to other languages through JNI is a real pain (or atleast so was at the time when I had to).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I know there's no advanced library comparable to Eigen in Java or C#, for example; new HPC projects are still dominated by C++, and these are only some of the reasons.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Java and C# for sure are more convenient for other tasks and have a much softer learning curve, but so do even VBA or plain old Excel.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also check &lt;a href=&quot;https://stackoverflow.com/a/145559/1706460&quot;&gt;this related comment&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3015" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2013-02-15T13:01:11.330" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7282" PostTypeId="2" ParentId="7280" CreationDate="2013-02-13T18:30:03.207" Score="4" Body="&lt;p&gt;I found that sometimes going back to the source gets me the farthest. Here is what you are probably looking for: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.finanzaonline.com/forum/attachments/econometria-e-modelli-di-trading-operativo/1390259d1298451714-qualche-idea-per-una-tesi-odd.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.finanzaonline.com/forum/attachments/econometria-e-modelli-di-trading-operativo/1390259d1298451714-qualche-idea-per-una-tesi-odd.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Discrete dividends that have not been declared yet need to be estimated. Estimating and updating dividend expectations is part of the job of every single stock vol trader. You are asking how: Well, most traders use street estimates, Bloomberg and other data providers provide dividend estimates. The funny thing is that such estimate perceptions are very similar to the Black-Scholes perceptions. Everyone knows the assumptions are wrong but as long as everyone more or less agrees on the setup then traders are fine with faulty assumptions. It is all about beating peers (but do not make the mistake in assuming the battle is fought over dividend assumptions) and (at least on the sell-side) directing traffic to your book. In fact, the short time I traded single stock vol a long time ago I frequently discussed the dividend assumptions with my counter parties at DB, GS, ..., in order to arrive at a pricing level that made sense to both parties. Obviously different implied volatility assumptions make up for the largest pricing difference between counter parties thus most are happy to share their dividend curves in a more or less subtle way. If you do not have access to such data services or counter parties then I recommend you build your own dividend curves by extrapolating from past dividend payments. You can get fancy if you want and take into account changes in the company's guidance in regards to revenues or earnings but I would not go overboard with that if I were you. However, what &lt;strong&gt;is&lt;/strong&gt; important is that you get the equation right as soon as dividends have been declared and adjustments have to be made on known information, especially that you are always aware of the ex-date of any underlying whose options you price/trade. There is no magic formula or one way as in most things in pricing financial assets, so a little imagination on your end is in order. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="6621" LastEditDate="2018-06-04T12:24:29.443" LastActivityDate="2018-06-04T12:24:29.443" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="7283" PostTypeId="2" ParentId="7273" CreationDate="2013-02-13T21:21:20.440" Score="1" Body="&lt;p&gt;I found a &lt;a href=&quot;http://basepub.dauphine.fr/bitstream/handle/123456789/5471/A%20matter%20of%20principal.pdf?sequence=1&quot; rel=&quot;nofollow&quot;&gt;link&lt;/a&gt; and I have to repeat: I don't think that PCA helps you to find a price ... it helps to model the movements of prices but not their values. You get something like a factor model ... this does not directly give you a price ... maybe you also want to have a look at this link &lt;a href=&quot;http://www.cereg.dauphine.fr/cahiers_rech/cereg200402.pdf&quot; rel=&quot;nofollow&quot;&gt;where PCA is applied to the oil market&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2013-02-13T21:37:53.737" LastActivityDate="2013-02-13T21:37:53.737" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7284" PostTypeId="1" CreationDate="2013-02-13T21:50:30.133" Score="6" ViewCount="308" Body="&lt;p&gt;Consider a non-negative continuous process $X = \left (X_t  \right)_ {t\geq 0}$ satisfying $ \mathbb E \left \{ \bar X \right\}&amp;lt; \infty $ (where $ \bar X  =\sup _{0\leq t \leq T} X_t $) and its Snell envelope&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \hat {X_\theta} = \underset {\tau \in \mathcal T _{\theta,T} } {\text{ess sup}} \ \mathbb E \left\{  X_\tau | \mathcal F_\theta \right \}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to understand how justify the following inequality:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb E \left\{ \sup_{0\leq t \leq T} \hat X_t^p\right \} \leq \mathbb E \left\{ \sup_{0\leq t \leq T} \bar X_t^p\right  \}  $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\bar X_t = \mathbb E \left\{  \bar X | \mathcal F_t \right \}$ &lt;/p&gt;&#xA;" OwnerUserId="3534" LastActivityDate="2013-02-19T12:18:35.923" Title="Upper bound concerning Snell envelope" Tags="&lt;option-pricing&gt;&lt;stochastic-calculus&gt;&lt;stochastic-processes&gt;&lt;american-options&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7288" PostTypeId="1" CreationDate="2013-02-14T12:11:26.630" Score="2" ViewCount="465" Body="&lt;p&gt;I am trying to calculate model free implied volatility $\sigma_{MF}$ for a relative performance index using the following method:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma_{MF}^2=2\sum_{i} [\frac{C(T,K_{i})}{K_{i}^2} - \frac{max(0,F-K_{i})}{K_{i}^2}]\Delta K_{i}$, where $F=Ie^{(\frac{\sigma_{M}^2-\sigma_{S}^2+\sigma_{MF}^2}{2})T}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only unknown here is $\sigma_{MF}$.How can I implement this using Matlab? I am confused as to how I can use nonlinear optimization functions when the unknown $\sigma_{MF}$ is itself inside a loop.&lt;/p&gt;&#xA;" OwnerUserId="3005" LastActivityDate="2013-02-14T13:25:19.583" Title="Implementing nonlinear optimization to find model free implied volatility using Matlab" Tags="&lt;matlab&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7289" PostTypeId="2" ParentId="7288" CreationDate="2013-02-14T12:31:59.567" Score="4" Body="&lt;p&gt;Write the equation as $\sigma_{MF} \to G(\sigma_{MF}) = 0$ (by subtracting $\sigma_{MF}^2$) and use a root finder. As how to solve $G(\sigma_{MF}) = 0$ in MatLab check the MatLab documentation (see e.g. &quot;solver&quot; there).&lt;/p&gt;&#xA;" OwnerUserId="3548" LastEditorUserId="3548" LastEditDate="2013-02-14T13:25:19.583" LastActivityDate="2013-02-14T13:25:19.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7290" PostTypeId="1" CreationDate="2013-02-14T17:38:44.400" Score="10" ViewCount="4256" Body="&lt;p&gt;The building blocks of the Sharpe ratio—expected returns and volatilities—are unknown quantities that must be estimated statistically and are subject to estimation error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main problem I have is how to compute the return. Simple return or Log-return? As it concerns financial returns, I am personally think log-returns, but this dampens the volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using a weekly return index (with dividend reinvestment) of Asian REITs. Reason for this that if I use daily, there are some 'missing' values due to holiday or non trading days that differ per Asian country. I've seen other researchers use the same method (Ooi et al. 2006). I suppose to annualize this data I have to multiply the average return by $\sqrt{52}$. But should I use geometric or arithmetic means?&lt;/p&gt;&#xA;" OwnerUserId="4796" LastEditorUserId="35" LastEditDate="2013-02-14T20:53:59.037" LastActivityDate="2017-06-24T13:54:35.667" Title="Computing the Sharpe Ratio" Tags="&lt;risk&gt;&lt;sharpe-ratio&gt;&lt;performance-evaluation&gt;&lt;asset-returns&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7291" PostTypeId="2" ParentId="7290" CreationDate="2013-02-14T18:00:07.403" Score="3" Body="&lt;p&gt;I think you need to exactly define which ratio you are talking about. For example the ex-post Sharpe ratio's components are all well known. You have your realized returns, risk free returns (or whatever other benchmark you define your excess returns against) and realized volatility of returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For realized asset returns you should not use log returns but simple returns such as x(t+1)/x(t)-1. Standard is to use daily returns and use daily observations of realized volatility but if you concern yourself with intraday risk then obviously you want to drill down. On non-trading days you should not include such observations in your sharpe ratio calculations because you are essentially not taking risk on such days. If the benchmark does not generate returns on specific days but your portfolio does then you have some leeway in how you generate a return of the benchmark against which to compare in order to derive your excess returns. You could possibly derive an average return of the benchmark and plug that in. And yes do not forget to annualize both returns and volatility numbers in order to compare apples with apples.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some may disagree whether or not to include holidays or other non trading days but that is what this forum is for, to present different ideas. I go actually a step further and do not include days in which the portfolio does not take any exposure to risk whether holiday or not. I make that very clear in my reports and audited statements and so far potential as well as actual investors never had an issue with that. But some quants seem to have issues with such concept and way of thinking. I am trading and managing risk and not having the luxury to sit and watch markets thus I have and want my returns and risk to be benchmarked against relative risk in the market and thus when the portfolio is not exposed to risk and hence also does not generate returns then such days should not be included in my Sharpe ratio calculations. That's how I hold it and what works for me.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-02-14T18:00:07.403" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="7292" PostTypeId="2" ParentId="7290" CreationDate="2013-02-15T01:37:03.577" Score="6" Body="&lt;h2&gt;Edited Comments:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Sharpe Ratio covers both future and historical time frames (as @Freddy points out).  Referencing the &lt;a href=&quot;http://www.treasury.govt.nz/publications/research-policy/wp/2003/03-28&quot;&gt;&quot;Geometric Return and Portoflio Analysis&quot;&lt;/a&gt;, for the &lt;strong&gt;historical&lt;/strong&gt; calculation, you want to make as few assumptions as possible (in my opinion).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $m_i \triangleq$ the monthly return for period $i$ and $r_t \triangleq$ annual return, for $i\in[1,12]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then making &lt;strong&gt;no&lt;/strong&gt; assumptions about $m_i$, except that $m_i~\textrm{i.i.d.} \forall i$ and that variance is finite, we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$(1+r_t) = \prod_{i=1}^{12}(1+d_i)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking $log$ of both sides we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\log(1+r_t)  = \log( \prod_{i=1}^{12} (1+d_i) )&#xA; = \sum_{i=1}^{12}\log(1+d_i)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the Central Limit Theorem, we know that $\log(1+r_i)\sim N(\mu,\sigma^2)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From this you get your &lt;strong&gt;historical values&lt;/strong&gt; to calculate Sharpe Ratio, because you want to know the amount of return per unit risk that &lt;em&gt;was taken&lt;/em&gt; (I convert continuously compounded returns into geometric return, because you want to know the per unit growth per unit volatility you have taken).  Take note, you have calculated volatility on the $\log$ returns, not linear.  Note also, you are &lt;em&gt;able&lt;/em&gt; to use a time scaling factor, because $\sum_{i=1}^{12}\log(1+d_i)$ is summing i.i.d. random variables. When you use linear returns, you are taking the variance of $\prod_{i=1}^{12}(1+d_i)$.  As you use smaller and smaller increments (daily and less), you can argue that $\log(\frac{p_t}{p_{t-1}})~\sim \frac{p_t}{p_{t-1}}-1$, but as the time frame grows, and &lt;strong&gt;definitely&lt;/strong&gt; for weekly, you cannot apply the time scale factor of  of $\sqrt{52}$ to come up with annual variance values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you then want to calculate &lt;strong&gt;expected&lt;/strong&gt; sharpe ratio, you could follow a standard $\log()$ transformation to determine the expectation and variance of a lognormally distributed random variable with the parameters that you just calculated above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbb{E}[r_t] = \mathbb{E}[1+r_t] - 1 = e^{\mu + \frac{1}{2}\sigma^2} - 1 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbb{V}[r_t] = \mathbb{V}[1+r_t] = \mathbb{E}[1+r]^2 \cdot e^{\sigma^2}-1 $$&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Original Post&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;There is actually a really &lt;a href=&quot;http://www.treasury.govt.nz/publications/research-policy/wp/2003/03-28&quot;&gt;good paper&lt;/a&gt; on this entitled &quot;Geometric Return and Portfolio Analysis&quot; by Brian McCulloch, but the gist is that &quot;Geometric Returns scale across assets, Log Returns Scale across time.&quot;  Therefore,&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Calculate log returns, and then volatility of log returns.  You can then apply your time scaling factor of &lt;code&gt;\sqrt(52)&lt;/code&gt; to the volatility to come up with a &quot;time appropriate&quot; volatility estimate.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Then transform your &lt;strong&gt;also time scaled&lt;/strong&gt; log returns to a linear geometric return (as the prior user stated), via &lt;code&gt;exp(log_return) - 1&lt;/code&gt; (so if you had weekly returns, multiply by 52 to get annualized values).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Then the ratio of one over the other (assuming a zero risk free rate) can be used for the Sharpe Ratio.`&lt;/p&gt;&#xA;" OwnerUserId="2153" LastEditorUserId="2153" LastEditDate="2013-02-15T20:54:36.837" LastActivityDate="2013-02-15T20:54:36.837" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="7293" PostTypeId="1" CreationDate="2013-02-15T03:22:41.300" Score="4" ViewCount="194" Body="&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/7243/d1-d2-for-laplace&quot;&gt;What are $d_1$ and $d_2$ for Laplace?&lt;/a&gt; may be running before walking.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I tried to use the equations provided, the pricing became extremely lopsided, with the calls being routinely double puts.  This is extremely unrealistic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My guess was correct that a distribution closer to the ideal (whatever it is) would remove the volatility smile, proven here with European options assuming logLaplace (formula 1 page up):  &lt;a href=&quot;http://books.google.com/books?id=cb8B07hwULUC&amp;amp;pg=PA297&amp;amp;lpg=PA296#v=onepage&amp;amp;q&amp;amp;f=false&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://books.google.com/books?id=cb8B07hwULUC&amp;amp;pg=PA297&amp;amp;lpg=PA296#v=onepage&amp;amp;q&amp;amp;f=false&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it looks like the fundamental assumptions even going back to risk-neutral have to be changed because all BS depends upon lognormality at some point whatever the derivation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've searched and searched, but I can't find anything that's worked out American option prices assuming a logLaplace distribution and not lognormality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the American option price formula for a call assuming a logLaplace Distribution and not lognormality?&lt;/p&gt;&#xA;" OwnerDisplayName="user3232" LastEditorUserId="-1" LastEditorDisplayName="user3232" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2013-02-16T00:11:03.557" Title="American Option price formula assuming a logLaplace distribution?" Tags="&lt;option-pricing&gt;&lt;stochastic-processes&gt;&lt;risk-neutral-measure&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7294" PostTypeId="2" ParentId="7293" CreationDate="2013-02-15T04:24:03.620" Score="4" Body="&lt;p&gt;Have you looked at using Laplace in a Monte Carlo simulation? Here is how you price American style options within a MC framework: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www2.math.uu.se/research/pub/Jia1.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www2.math.uu.se/research/pub/Jia1.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the Longstaff, Schwartz paper: &lt;a href=&quot;http://escholarship.org/uc/item/43n1k4jb#page-1&quot; rel=&quot;nofollow&quot;&gt;http://escholarship.org/uc/item/43n1k4jb#page-1&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the discretization of a process that draws its random variables from a Laplace distribution I can only suggest ideas as I have not myself worked with those in regards to a MC discretization:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can draw RV from a uniform distribution and generate a laplace distributed RV &lt;code&gt;X = μ - b * sgn(U) * ln(1-2 * |U|)&lt;/code&gt;. This only concerns the RV generation itself. You need to make other transformations as well but I am not aware this distribution has been much applied to pricing financial derivatives. The following may help, though they use a mixture of Normal-Laplace distributions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://asianfa2012.mcu.edu.tw/fullpaper/10305.pdf&quot; rel=&quot;nofollow&quot;&gt;http://asianfa2012.mcu.edu.tw/fullpaper/10305.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-02-15T04:29:32.397" LastActivityDate="2013-02-15T04:29:32.397" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7296" PostTypeId="1" CreationDate="2013-02-15T05:40:58.607" Score="2" ViewCount="220" Body="&lt;p&gt;This only applies to options that do not have marketable equivalents since margin can be marked to them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've never been able to find this on my goog.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How is margin typically calculated for OTC equity options?  I guess mostly, in the contract, how is IV determined?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, are the OTC equity option markets liquid enough to provide &quot;constant&quot; bids and asks for &quot;standardized&quot; (whatever that is) contracts?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does the same go for cash-settled options?  Are cash-settled options as liquid as their deliverable counterparts?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Addition&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are the platforms (if they even exist) as well structured as your common broker java platform, or is everything ad hoc, bulletin board, over the phone?&lt;/p&gt;&#xA;" OwnerDisplayName="user3232" LastEditorDisplayName="user3232" LastEditDate="2013-04-07T17:14:29.483" LastActivityDate="2013-04-07T17:14:29.483" Title="OTC Equity Options' Dynamics" Tags="&lt;options&gt;&lt;equities&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7297" PostTypeId="1" CreationDate="2013-02-15T06:36:16.973" Score="3" ViewCount="541" Body="&lt;p&gt;i've heard several ways to put a metric on liquidity of options..  obviously liquidity isn't a constant..  things like the Bid/Asks spread, liquidity of the underlying..   Trying to find a way to parameterize &quot;liquidty&quot;  for scans...  instead of contracts traded.. would some average of total dollar amount traded in some front part of the term structure work?  does open interest say something as well? &lt;/p&gt;&#xA;" OwnerUserId="4764" LastActivityDate="2019-08-09T18:41:32.353" Title="how to define liquidity in equity, index, and etf options" Tags="&lt;options&gt;&lt;liquidity&gt;&lt;term-structure&gt;&lt;open-interest&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7298" PostTypeId="2" ParentId="7297" CreationDate="2013-02-15T08:30:38.227" Score="4" Body="&lt;p&gt;I would look at the following metrics when quantifying &quot;liquidity&quot; in listed options:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;bid/offer spread&lt;/li&gt;&#xA;&lt;li&gt;number contracts traded and from that follows notional traded (in the option not underlying)&lt;/li&gt;&#xA;&lt;li&gt;frequency of bid/offer adjustments relative to changes in the underlying delta. &lt;/li&gt;&#xA;&lt;li&gt;frequency of liquidity added/removed on the bid and offer side even when no trades occur &lt;/li&gt;&#xA;&lt;li&gt;amount of liquidity added/removed on the bid and offer  side even when no trades occur&lt;/li&gt;&#xA;&lt;li&gt;frequency of changes in spread dynamics&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Most of the points above pertain to the fact that a lot of liquidity behind a contract is not shown on the screen, it shows however in the participation rate and dynamics of market makers and those who qualify for waivers of cancel/modify charges. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an aside, I would not look at liquidity in the underlying. The underlying may be highly liquid without much interest in the options. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-02-15T08:30:38.227" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7299" PostTypeId="2" ParentId="7296" CreationDate="2013-02-15T08:39:14.273" Score="2" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Margin is determined by those who are in the business of settling options contracts. In the OTC that would be those who make markets in OTC options. (Subject to regulatory requirements if imposed)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;IV is determined by market forces, supply and demand. The same applies to options written on bananas and chimps. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;liquidity depends again on supply and demand of the specific product. There is no &quot;standardized&quot; way to determine this. FX OTC options on the liquid pairs are more liquid than anything listed in this particular space. In Asia, most equity options are traded OTC (you can count the number contracts on one hand that change hands in listed options at the TSE at any given day). Other OTC options, especially exotics (such as PRDCs) trade sometimes 4-5 times in a week even at tier 1 houses in Tokyo. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;cash-settled or deliverable depends on the agreement between the OTC counter parties. If I want to exercise the underlying of my ITM call options in gold delivered into my vault then I can ask Goldman to do so (I am sure they will happily oblige for a negligible add-on fee). &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-02-15T08:39:14.273" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7302" PostTypeId="1" AcceptedAnswerId="7309" CreationDate="2013-02-15T23:43:57.533" Score="8" ViewCount="2250" Body="&lt;p&gt;A Short question would be &quot;Which type of model from GARCH family is most suitable for modeling 5-minute data returns ?&quot; but I've added some story to it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A Long time ago I was preparing my thesis, one part of it was to model 5-minute log-returns of the stock market index. That was the first time when difficulties of modeling real data hit me quite hard. That time I was using STATA. I set overnight returns as missing values, but optimization of GARCH was painful due to constant lack of convergence of BFGS and DFP algorithms (error like: &quot;flat part of likelihood surface approached&quot; = constant value of log-likelihood per many iterations ), I've overridden this by setting max number of iterations = 50. I've find out that best model was GARCH(1,1)-ARMA(1,1) but alfa+beta=0.81 was far from the usual value which is one (perhaps due to ARMA part - but I don't think so) and for my experience alfa=0.14 was strangely high because it's usually about 0.05 for daily log-returns.  0.81  is very low because I've read numerous times that &lt;a href=&quot;https://editorialexpress.com/cgi-bin/conference/download.cgi?db_name=SNDE2008&amp;amp;paper_id=91&quot; rel=&quot;nofollow&quot;&gt;alfa+beta tends to one in probability as the sampling frequency is increased&lt;/a&gt; so IGARCH should be tried. I was searching for intraday patterns of seasonal volatility as a cause of my trouble, but I only spotted it in first and last 15 minutes of each session - I've first removed it, but it didn't improve convergence of algorithm and value of alfa+beta, then I've added exogenous variable (which contained pattern of seasonality) to variance equation, it also didn't work. I've tried to deal with overnight returns in many different ways thinking that maybe these cause the problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Today I think that alfa+beta=0.81 isn't a problem at all, but maybe this gap of 0.19 makes place for stochastic volatility process? The lack of convergence in STATA ( and also in SAS and EViews which I've tried) still looks strange for me, could it be only due to numerical limitations of PC or maybe something else ? (I've also tried to fit model for shorter periods of times, I've tried many different things in many combinations). If you have some interesting general remarks or stories please write them - it's only soft question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(AFRIMA didn't work at all, EGARCH was very weak and t-GARCH gave no improvement at all, value of &lt;code&gt;t&lt;/code&gt; was high which is really surprising, without some kind of GARCH there was always autocorrelation of residuals, modeled stock market index consisted of 20 stocks with 5000 trades per day in total , I could provide data).&lt;/p&gt;&#xA;" OwnerUserId="2044" LastEditorUserId="13311" LastEditDate="2016-02-21T05:57:25.237" LastActivityDate="2016-02-21T05:57:25.237" Title="Problems with dealing with GARCH models and intra-day data" Tags="&lt;volatility&gt;&lt;modeling&gt;&lt;high-frequency&gt;&lt;garch&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7308" PostTypeId="1" CreationDate="2013-02-16T12:56:47.183" Score="1" ViewCount="379" Body="&lt;p&gt;Assuming that one doesn't have any kind of priveleged data feed (i.e. info is depth of book and volume executed at bid and ask), is it inherently easier to more accurately estimate position in queue in a limit order book that is &lt;em&gt;strictly&lt;/em&gt; FIFO (as opposed to those where orders can receive priority according to any factor other than time of submission)?&lt;/p&gt;&#xA;" OwnerUserId="4807" LastEditorUserId="-1" LastEditDate="2013-02-17T13:26:57.860" LastActivityDate="2013-02-17T13:28:20.200" Title="PIQ estimation for FIFO limit order book" Tags="&lt;limit-order-book&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7309" PostTypeId="2" ParentId="7302" CreationDate="2013-02-16T20:34:28.467" Score="4" Body="&lt;p&gt;To quickly answer and address your first question. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ARMA - Fractionally integrated GARCH or FIGARCH&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is one of the more common methods used at higher frequencies, it handles some properties required for higher frequency that standard &lt;code&gt;ARMA-GARCH&lt;/code&gt; does not&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are also a few other so called long memory volatility models, and there are other models which i am not familiar with, that take a different approach.&lt;/p&gt;&#xA;" OwnerUserId="1764" LastActivityDate="2013-02-16T20:34:28.467" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7310" PostTypeId="1" AcceptedAnswerId="7316" CreationDate="2013-02-17T09:00:57.237" Score="7" ViewCount="722" Body="&lt;p&gt;Due to some economics/regime problem, I can only have access to non full-tick data from an exchange.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make the problem precise, a full tick data $X$ is a series of $(t_i,p_i,v_i)$ for $0 \leq i \leq N$ where $t_i$ is the timestamp, $p_i$ is the price, $v_i$ is the deal volume.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The data that I could only see is a lower resolution $\hat{X}$ of $X$, in the sense that,&#xA;I can only observe the market in a sequence $j_1 &amp;lt; j_2 &amp;lt; \ldots &amp;lt; j_m$&#xA;and get the data like: (the sequence is not necessary deterministic or in fixed interval)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(\hat{t_{j_k}},\hat{p_{j_k}},\hat{v_{j_k}})$ where $\hat{t_{j_k}} = t_{j_k}, \hat{p_{j_k}} = p_{j_k}$, but &#xA;$$\hat{v_{j_k}} = \sum_{i=j_{k-1}+1}^{j_k} v_i$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, if the true data $X$ is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(0,100,1) \\&#xA;(1,102,2) \\&#xA;(2,101,1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I may only see the lower resolution one $\hat{X}$ as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(0,100,1) \\&#xA;(2,101,3)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(1,102,3) \\&#xA;(2,101,1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is..&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Suppose I only have one source of $\hat{X}$, what is the best way to recover most missing tick? I know this may be a bad question, as information has already been lost. I think I need to add some model assumption for this problem from Bayesian point of view, any reference for this?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Suppose I have two different source of $\hat{X}$, and because of random nature of the missing ticks, two source would be different. Any method to recover it?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;P.S. I think I can think the tick data as a one-dimensional image, and lower resolution data is a pixelized version of real image data, and apply some image processing technique on it, any idea?&lt;/p&gt;&#xA;" OwnerUserId="4812" LastActivityDate="2013-02-18T20:43:47.333" Title="Recover full tick data from missing tick data" Tags="&lt;high-frequency&gt;&lt;market-microstructure&gt;&lt;tick-data&gt;&lt;algorithmic-trading&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7311" PostTypeId="1" AcceptedAnswerId="7318" CreationDate="2013-02-17T11:55:53.137" Score="4" ViewCount="14329" Body="&lt;p&gt;Most widely used Interbank Rates are LIBOR, EURIBOR. Then I read online on SIBOR (Singapore).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It says Canda, US are following LIBOR as well. So for Australia, is there a dedicated interbank rate like &lt;em&gt;AUSIBOR&lt;/em&gt; or &lt;em&gt;AUDIBOR&lt;/em&gt;? If not what is the correct interbank rate for Australian bond and interest market?&lt;/p&gt;&#xA;" OwnerUserId="3178" LastActivityDate="2017-02-26T19:35:40.673" Title="Is there an Australian Interbank Rate?" Tags="&lt;interest-rates&gt;&lt;libor&gt;&lt;interbank-rates&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7312" PostTypeId="5" CreationDate="2013-02-17T12:02:32.203" Score="0" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;a href=&quot;http://www.investopedia.com/terms/i/interbankrate.asp&quot; rel=&quot;nofollow&quot;&gt;Banks borrow and lend money in the interbank market in order to manage liquidity and meet the requirements placed on them. The interest rate charged depends on the availability of money in the market, on prevailing rates and on the specific terms of the contract, such as term length.&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Most widely used interbank rates are &lt;a href=&quot;http://www.investopedia.com/terms/l/libor.asp#axzz2L9mXXaKH&quot; rel=&quot;nofollow&quot;&gt;LIBOR&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/Euribor&quot; rel=&quot;nofollow&quot;&gt;EURIBOR&lt;/a&gt;. Other regionally found interbank rates are HIBOR and SIBOR.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.investopedia.com/video/play/london-interbank-offered-rate-libor/#axzz2L9mXXaKH&quot; rel=&quot;nofollow&quot;&gt;Video explanation of LIBOR.&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="3178" LastEditorUserId="35" LastEditDate="2013-02-17T13:26:39.420" LastActivityDate="2013-02-17T13:26:39.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7313" PostTypeId="4" CreationDate="2013-02-17T12:02:32.203" Score="0" Body="The rate of interest charged on short-term loans made between banks.&#xD;&#xA;" OwnerUserId="3178" LastEditorUserId="3178" LastEditDate="2013-02-17T13:25:33.947" LastActivityDate="2013-02-17T13:25:33.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7315" PostTypeId="2" ParentId="7308" CreationDate="2013-02-17T13:28:20.200" Score="1" Body="&lt;p&gt;Yes, it's easier to estimate position if there are fewer rules to worry about.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2013-02-17T13:28:20.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7316" PostTypeId="2" ParentId="7310" CreationDate="2013-02-17T13:32:49.290" Score="5" Body="&lt;p&gt;If you're missing ticks, then no technique will get those ticks back.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have two sources, then designate one source as the primary feed and then fill-in gaps from the secondary feed. Of course, you'll have to mind the timestamps when determining whether the secondary feed can be used properly.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2013-02-17T13:32:49.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7318" PostTypeId="2" ParentId="7311" CreationDate="2013-02-17T13:56:19.657" Score="2" Body="&lt;p&gt;Here are your Australian LIBOR rates:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.homefinance.nl/english/international-interest-rates/libor/libor-interest-rates-aud.asp&quot; rel=&quot;nofollow&quot;&gt;http://www.homefinance.nl/english/international-interest-rates/libor/libor-interest-rates-aud.asp&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Couple points in addition:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Every major financial market has an established rates market at which banks are borrowing and lending among themselves. In fact such transactions are performed every single day in order to settle overnight transactions. The settlement of such inter-bank loans are usually the responsibility of each bank's treasury department and the respective currency's libor rates are used. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;As long as the loan is denominated in Australian dollar and is cleared and settled in Australian dollars by a bank (the bank needs to be meeting LIBOR credit requirements otherwise spreads above the pertaining LIBOR rate are applied as direct function of credit risk), regardless of whether it is a US ,Australian, or Japanese institution, then Australian libor rates are applied. Despite all the media and scandal reporting, LIBOR is by far the prevailing rate applied to interbank-loans even today and into the foreseeable future.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;You changed your original question by quite a bit.&lt;/strong&gt; My answer above pertains to the interbank market, financial institutions lending/borrowing amongst each other. You now broadened your question to cover general interest rates and bond markets, meaning, including agreements between banks and non-bank counter parties. In that I would add that the most often used reference rate is &lt;strong&gt;BBSW&lt;/strong&gt;. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-02-21T15:14:20.433" LastActivityDate="2013-02-21T15:14:20.433" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="7320" PostTypeId="2" ParentId="7310" CreationDate="2013-02-17T21:20:46.210" Score="5" Body="&lt;p&gt;Obviously merging two streams is harmless and it should be done. But it's hard to advise you regarding the &quot;interpolation&quot; methods you can use to generate the ticks without knowing why you need this. The reason is that any method will introduce a certain bias to the data. Therefore, it very much depends on what are you going to do with your altered data on the next step.    &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some links regarding the interpolation methods that you can find useful:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Take a look at the book &lt;a href=&quot;http://books.google.ch/books?id=dobO95EBcqsC&amp;amp;lpg=PA37&amp;amp;ots=albpLc6wP1&amp;amp;dq=interpolating%20tick%20data&amp;amp;pg=PA37#v=onepage&amp;amp;q=interpolating%20tick%20data&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;An Introduction to High-Frequency Finance&lt;/a&gt; (preview in Google Books available)&lt;/li&gt;&#xA;&lt;li&gt;Olsen Data is using &lt;a href=&quot;http://www.olsendata.com/data_products/all_about_data/&quot; rel=&quot;nofollow&quot;&gt;linear interpolation&lt;/a&gt;  &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="370" LastEditorUserId="370" LastEditDate="2013-02-18T20:43:47.333" LastActivityDate="2013-02-18T20:43:47.333" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7321" PostTypeId="2" ParentId="7311" CreationDate="2013-02-18T00:01:58.740" Score="3" Body="&lt;p&gt;The reference rate used in Australia is the &lt;a href=&quot;http://www.afma.com.au/data/bbsw/bbswexplained.html&quot; rel=&quot;nofollow&quot;&gt;Bank Bill Swap Rate&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to Investopedia &quot;The bank bill interest rate is the wholesale interbank rate within Australia and is published by the Australian Financial Markets Association (AFMA). It is the borrowing rate among the country's top market makers, and is widely used as the benchmark interest rate for financial instruments.&quot;&lt;/p&gt;&#xA;" OwnerUserId="3287" LastActivityDate="2013-02-18T00:01:58.740" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7323" PostTypeId="1" AcceptedAnswerId="7326" CreationDate="2013-02-18T04:36:56.350" Score="5" ViewCount="474" Body="&lt;p&gt;Generally speaking, I know when implied vol increases, option prices increase for calls. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, does the same occur for puts?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I am expecting implied volatility to increase for an option on an underlying asset (let's say a stock) and I believe the price will decline as implied vol rises, would the best strategy be to buy a put, as opposed to buying a call (forget strangle/straddles for the moment being)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible for a long put position to be profitable if the gain on vega, due to increase in implied vol on either the upside or downside, is larger enough to offset the short delta position?&lt;/p&gt;&#xA;" OwnerUserId="4729" LastEditorUserId="1976" LastEditDate="2013-02-18T22:07:42.557" LastActivityDate="2013-02-20T11:29:11.023" Title="Can a long put trade be profitable through Vega even if the underlying moves upwards?" Tags="&lt;options&gt;&lt;vega&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7324" PostTypeId="2" ParentId="7311" CreationDate="2013-02-18T12:28:11.480" Score="4" Body="&lt;p&gt;Regarding &lt;em&gt;swaps&lt;/em&gt;, the current preferred fixings for IRS in various currencies are given below. As with all OTC instruments, you're free to use whatever you like when you agree a deal, though most banks will stick to particular fixings. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Ccy    Dom     Int     Alt Int&#xA;AUD    BBSW    BBSW    LIBOR&#xA;CAD    CDOR&#xA;CHF    LIBOR&#xA;CZK    PRIBOR &#xA;DKK    CIBOR&#xA;EUR    EURIBOR EURIBOR LIBOR&#xA;GBP    LIBOR   LIBOR&#xA;HKD    HIBOR   ?       LIBOR&#xA;HUF    BUBOR&#xA;JPY    TIBOR   LIBOR   TIBOR   (LIB/TIB spreads traded)&#xA;NOK    OIBOR   NIBOR           (OIBOR == NORIBOR)&#xA;NZD    LIBOR&#xA;PLN    WIBOR&#xA;RUB    MOSIBOR/MOSPRIME&#xA;SEK    STIBOR&#xA;USD    LIBOR   LIBOR   EURIBOR&#xA;ZAR    JIBAR   LIBOR   JIBAR&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;General fixings available via the FT: &lt;a href=&quot;http://markets.ft.com/RESEARCH/Markets/Interest-Rates&quot; rel=&quot;nofollow&quot;&gt;http://markets.ft.com/RESEARCH/Markets/Interest-Rates&lt;/a&gt; &lt;br /&gt;&#xA;Quick look at what's traded in London via LCH: &lt;a href=&quot;http://www.lchclearnet.com/swaps/volumes/settlement_prices.asp&quot; rel=&quot;nofollow&quot;&gt;http://www.lchclearnet.com/swaps/volumes/settlement_prices.asp&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.afma.com.au/data/bbsw.html&quot; rel=&quot;nofollow&quot;&gt;BBSW (AFMA) delayed data&lt;/a&gt; &lt;br /&gt;&#xA;&lt;a href=&quot;http://www.m-x.ca/marc_terme_bax_cdor_en.php&quot; rel=&quot;nofollow&quot;&gt;CDOR (TMX)&lt;/a&gt; &lt;br /&gt;&#xA;&lt;a href=&quot;http://www.nasdaqomxnordic.com/obligationer/danmark/cibor/&quot; rel=&quot;nofollow&quot;&gt;CIBOR (NASDAQ OMX)&lt;/a&gt; &lt;br /&gt;&#xA;&lt;a href=&quot;http://en.wikipedia.org/wiki/Euribor&quot; rel=&quot;nofollow&quot;&gt;EURIBOR (wikipedia)&lt;/a&gt; &lt;br /&gt;&#xA;&lt;a href=&quot;http://en.wikipedia.org/wiki/Johannesburg_Interbank_Agreed_Rate&quot; rel=&quot;nofollow&quot;&gt;JIBAR (wikipedia)&lt;/a&gt; &lt;br /&gt;&#xA;&lt;a href=&quot;http://bank.hangseng.com/1/2/rates/hibor&quot; rel=&quot;nofollow&quot;&gt;HIBOR (Hang Seng)&lt;/a&gt; &lt;br /&gt;&#xA;&lt;a href=&quot;http://en.wikipedia.org/wiki/Libor&quot; rel=&quot;nofollow&quot;&gt;LIBOR (wikipedia)&lt;/a&gt; &lt;br /&gt;&#xA;&lt;a href=&quot;http://www.arb.ru/site/v2/download/files/StandDoc/2009_Standard_Terms_of_Interest_Rate_and_Swaption_Transactions.pdf&quot; rel=&quot;nofollow&quot;&gt;MOSIBOR/MOSPRIME (arb.ru)&lt;/a&gt; &lt;br /&gt;&#xA;&lt;a href=&quot;http://www.cnb.cz/en/financial_markets/money_market/pribor/daily.jsp&quot; rel=&quot;nofollow&quot;&gt;PRIBOR (Czech National Bank)&lt;/a&gt; &lt;br /&gt;&#xA;&lt;a href=&quot;http://nordic.nasdaqomxtrader.com/trading/fixedincome/Sweden/stibor/&quot; rel=&quot;nofollow&quot;&gt;STIBOR (NASDAQ OMX)&lt;/a&gt; &lt;Br /&gt;&#xA;&lt;a href=&quot;http://www.zenginkyo.or.jp/en/tibor/rate/index.html&quot; rel=&quot;nofollow&quot;&gt;TIBOR (JBA)&lt;/a&gt; &lt;br /&gt;&#xA;&lt;a href=&quot;http://www.money.pl/pieniadze/depozyty/zlotowe/&quot; rel=&quot;nofollow&quot;&gt;WIBOR (money.pl)&lt;/a&gt; &lt;br /&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At Freddy's suggestion, here are the overnight swap (OIS) fixings for a few currencies, along with the instruments available for curve construction:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Ccy    Fixes on         Instruments&#xA;USD    Fed effective    FedFund contracts, then OIS&#xA;EUR    EONIA            Meeting to meeting (ECB) and IMM-dated fwd OIS, then spot OIS&#xA;GBP    SONIA            Meeting to meeting (MPC) fwd OIS, then spot OIS&#xA;AUD    RBA IBOC         30 day IB contracts (like FedFunds), then OIS&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The following all just have spot OIS available, as far as I know:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Ccy    Fix&#xA;CAD    (COInS) BoC Overnight MM finance rate (I think)&#xA;CHF    TOIS&#xA;DKK    DKKOIS&#xA;JPY    TONAR&#xA;PLN    POLONIA&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Depending on your role in the market and access to market data etc, the spot OIS past a year or two may be available either as quoted OIS rates or as OIS-3m basis swaps.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastEditorUserId="1314" LastEditDate="2013-02-22T09:20:32.123" LastActivityDate="2013-02-22T09:20:32.123" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="7326" PostTypeId="2" ParentId="7323" CreationDate="2013-02-18T19:04:45.657" Score="3" Body="&lt;p&gt;First, notice that the two &lt;a href=&quot;http://en.wikipedia.org/wiki/Greeks_%28finance%29&quot; rel=&quot;nofollow&quot;&gt;greeks&lt;/a&gt; you mentioned in your question are simply the partial derivatives of the value of the option $V$ with respect to two different variables $S$ (the price of the underlying) and $\sigma$ (the volatility of the underlying):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta = \frac{\partial V}{\partial S} \quad \text{and} \quad \nu=\frac{\partial V}{\partial \sigma}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As mentioned in the comments, volatility is not per-say a sign of declining prices, but, at least under the Black-Scholes model, $\nu$ is positive for both puts and calls meaning that the value of both types of options is expected to rise if $\sigma$ goes up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, from a mathematical point of view, if only $\sigma$ goes up (i.e. $S$ stays the same) then yes the trade would be profitable even by buying a put option. However, it is fair to say that this situation is not very realistic and that in real-world you would be exposed to wild moves in $S$ which would affect the price of the option through the $\Delta$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a result, what you would like to do is to is to perform &lt;a href=&quot;http://en.wikipedia.org/wiki/Delta_neutral&quot; rel=&quot;nofollow&quot;&gt;delta hedging&lt;/a&gt; which consists in offsetting your  exposure to $S$ by buying or selling an amount of the underlying $S$ corresponding to  $\Delta$. In the case of the put, you know that $\Delta&amp;lt;0$ (i.e. the price of the put $V$ decreases as the price of the underlying $S$ increases) and you hence need to buy $\Delta$ of $S$ to make your resulting portfolio have a $\Delta=0$: it is &lt;strong&gt;delta-neutral&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you've done that, you've removed your exposure to changes in $S$ and you could consider that your put position is mainly determine by the remaining $\nu$. Some funds such as the &lt;a href=&quot;http://www.amundi-funds.com/priv/product/?isin=LU0319687124&amp;amp;doc=FP&quot; rel=&quot;nofollow&quot;&gt;Amundi Volatility Funds&lt;/a&gt; do exactly that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This reasoning though is really perfectly working only for small changes in $S$, as bigger changes would also be sensitive to other greeks such as $\Gamma = \frac{\partial^2V}{\partial S^2}$. You can also hedge against this kind of move using a similar reasoning.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2013-02-20T11:29:11.023" LastActivityDate="2013-02-20T11:29:11.023" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7327" PostTypeId="2" ParentId="7284" CreationDate="2013-02-19T12:18:35.923" Score="3" Body="&lt;p&gt;I am not sure (had only a quick look), but isn't it that we have $\hat{X} \leq \bar{X}$ and hence we have the same for the $sup$ and given that $p \geq 1$ we have this for the power-of-$p$.&lt;/p&gt;&#xA;" OwnerUserId="3548" LastActivityDate="2013-02-19T12:18:35.923" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7328" PostTypeId="1" CreationDate="2013-02-19T17:07:14.517" Score="1" ViewCount="316" Body="&lt;p&gt;I have this regression equation: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;R_{stock} = 3,28\% + 1,65*R_{market}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $R_{stock}$ is the expected return on a stock and $R_{market}$ being the market risk premium.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a one-year T-bill rate of 4,8% and a 30-year T-bond rate of 6,4%.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What is the expected return on the stock the nearest year?&lt;/li&gt;&#xA;&lt;li&gt;Would the expected return change if we were to compute the discount rate to value cash flow, and if so, how?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I do not know if I just assume an $R_{market}$ rate?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Swap the 3,28% for the T-bill rate in (1) and the T-bond rate in (2) to get an expected return. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how do you estimate $R_{market}$, just by assuming or is there a way to find out? And do I let $\beta$ (1,65) go to 1 as we calculate with a T-bond rate for 30 years and $\beta$ is assumed to fluctuate around 1 in the long term.&lt;/p&gt;&#xA;" OwnerUserId="4822" LastEditorUserId="35" LastEditDate="2013-02-19T18:36:55.010" LastActivityDate="2013-02-19T22:22:10.703" Title="Regression giving the return on a stock" Tags="&lt;equities&gt;&lt;risk&gt;&lt;regression&gt;&lt;return&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7329" PostTypeId="1" AcceptedAnswerId="7332" CreationDate="2013-02-19T20:19:04.460" Score="11" ViewCount="14944" Body="&lt;p&gt;For the SIP feeds, there is the CTA and the UTP plan and they cover Tapes A,B and Tape C respectively. Is there an easy way to check on google what tape a stock would belong to? Particularly when it comes to disambiguating A and B?&lt;/p&gt;&#xA;" OwnerUserId="1456" LastActivityDate="2020-08-01T08:03:19.747" Title="Quick way to check what 'tape' a stock belongs to?" Tags="&lt;equities&gt;&lt;market-data&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7330" PostTypeId="2" ParentId="7329" CreationDate="2013-02-19T21:40:50.813" Score="1" Body="&lt;p&gt;As far as I know, Tape A, if it's a NYSE proper stock, Tape C, if listed on NASDAQ, else Tape B (e.g. including those, which finance.google.com shows as NYSEARCA)&lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2013-02-19T21:40:50.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7331" PostTypeId="2" ParentId="7329" CreationDate="2013-02-19T21:41:17.810" Score="7" Body="&lt;p&gt;Tape A is NYSE-listed stocks. Tape C is NASDAQ-listed stocks. Tape B is the &lt;em&gt;regionals&lt;/em&gt;, ie. everything else. Most of Tape B is on ARCA now days, though some of it is still on the NYSE MKT, formerly known as AMEX.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to use Google Finance, just note that they prepend every symbol with the exchange its on. For example, if I search for &quot;AAPL&quot;, Google will change this to &quot;NASDAQ:AAPL&quot; automatically, which means its on Tape C. Likewise, &quot;SPY&quot; becomes &quot;NYSEARCA:SPY&quot; (Tape B) and &quot;BAC&quot; becomes &quot;NYSE:BAC&quot; (Tape A).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A fun fact: most of ARCA's products are exchange-traded funds (ETFs), and most ETFs are listed on ARCA. So ETFs and Tape B have become synonymous. (A glaring exception is that QQQ is listed on NASDAQ.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, up until a few years ago, all NYSE-listed symbols had three or fewer letters, while all NASDAQ-listed symbols had exactly four characters. This has changed recently and now all exchanges allow any symbology (to poach competitors' listings), but the trend is still pretty common.&lt;/p&gt;&#xA;" OwnerUserId="35" LastEditorUserId="35" LastEditDate="2013-02-20T01:38:47.433" LastActivityDate="2013-02-20T01:38:47.433" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7332" PostTypeId="2" ParentId="7329" CreationDate="2013-02-19T21:47:19.997" Score="11" Body="&lt;p&gt;You can pull a list of all stocks easily. See &lt;a href=&quot;https://quant.stackexchange.com/questions/1640/where-to-download-list-of-all-common-stocks-traded-on-nyse-nasdaq-and-amex&quot;&gt;this question&lt;/a&gt;. You can get &lt;code&gt;nasdaqlisted.txt&lt;/code&gt; and &lt;code&gt;otherlisted.txt&lt;/code&gt; from here. &lt;code&gt;nasdaqlisted.txt&lt;/code&gt; is clearly Tape C. &lt;code&gt;otherlisted.txt&lt;/code&gt; contains an &lt;code&gt;Exchange&lt;/code&gt; column which can be used to determine Tape A or B. If it is &lt;code&gt;N&lt;/code&gt; it's listed at NYSE and therefore Tape A, otherwise it's Tape B.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, NYSE publishes a symbol list these days as well. FTP to &lt;code&gt;ftp.nyxdata.com&lt;/code&gt; and look at the &lt;code&gt;NYSESymbolMapping&lt;/code&gt; and &lt;code&gt;ARCASymbolMapping&lt;/code&gt; directories.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2013-02-19T21:52:35.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7333" PostTypeId="2" ParentId="7328" CreationDate="2013-02-19T22:22:10.703" Score="2" Body="&lt;p&gt;The basic CAPM - which is what your regression estimates - says &#xA;$$&#xA; R_S = R_f + \beta_S (R_{Market}-R_f)&#xA;$$&#xA;where &#xA;$$&#xA; \beta_S = \frac{Cov(R_M,R_S)}{Var(R_M)}&#xA;$$&#xA;i.e. the return of a certain stock depends only on the correlation with the market portfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your pricing equation to work, you will need to have an idea about the expected market (excess) return. In practice, often the historical mean return of an index (such as S&amp;amp;P 500, ...) is used, but that is very far from perfect. Only that assuming seems like an even worse idea to me...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keep in mind that, if you want to estimate the regression, you need to use excess returns for the market, otherwise your intercept will be the wrong one (though beta should be fine).&lt;/p&gt;&#xA;" OwnerUserId="1976" LastActivityDate="2013-02-19T22:22:10.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7334" PostTypeId="1" CreationDate="2013-02-20T07:13:52.257" Score="1" ViewCount="435" Body="&lt;p&gt;I am trying to understand how factor loadings in a general factor model are computed. For simplicity sake, lets assume a simple model: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;R = B \times F + \epsilon&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;R = N \times 1&#xA;$$&#xA;$$&#xA;B = N \times K&#xA;$$&#xA;$$&#xA;F = K \times 1&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $B$ are the factor loadings and $F$ is the factor return and $N$ is the number of securities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way this equation is setup, a factor that is common to all $N$ assets, like GDP, inflation, or market index, can easily be plugged in as a factor return ($F$) into the above equation. But how about financial ratios? Let's say for example the PE ratio. The PE ratio is different for each security, which would in turn give us a different factor loading for each security. But how can we plugin a factor return for PE ratio into $F$; its different for each security.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or is my understanding of using fundamental ratios in a factor model totally off?&lt;/p&gt;&#xA;" OwnerUserId="1696" LastEditorUserId="35" LastEditDate="2013-02-20T12:17:28.913" LastActivityDate="2013-08-02T09:02:35.473" Title="How to use financial ratios in a factor model?" Tags="&lt;factor-models&gt;&lt;factor-loading&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7336" PostTypeId="1" CreationDate="2013-02-20T13:43:38.737" Score="10" ViewCount="1274" Body="&lt;p&gt;I think option chains are not represented in the best way. With more and more options products coming out and trading on the various exchanges, I see vendors struggling to keep up with a good way to represent the option chain.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;examples of this in the USA are the Weekly options that trade now, Weekly options being listed for the next 5 weeks now, the super leaps that last for 3 or more years, and the mini-options that will begin trading in March 2013. These are all intermingled amongst quarterly options, and others.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a summary of the chain for SPY (Standard and Poors ETF) , by next month there will also be mini-options listed on this options chain, somehow&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://dl.dropbox.com/u/27608349/Screen%20Shot%202013-02-20%20at%208.48.33%20AM.png&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each individual expiration has a list (chain) of calls, across from puts&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://dl.dropbox.com/u/27608349/Screen%20Shot%202013-02-20%20at%208.50.42%20AM.png&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The typical option chain is simply cluttered now, and selecting by month or expiration date from a drop down list (google finance's way) is also less intuitive now in my opinion. My opinion is that there are other possible ways to display the option chain that are better&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've seen even less intuitive ooption chains that don't separate weekly's from monthly's and have them all on the same chain, just with different symbol identifiers, listed alphabetically at the same strike price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One idea I was playing around with was a zoomable sunburst chart, but I haven't yet hashed out what dimensions the sunburst chart would display and how it would be helpful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;interact with this example here &lt;a href=&quot;http://www.jasondavies.com/coffee-wheel/&quot; rel=&quot;noreferrer&quot;&gt;http://www.jasondavies.com/coffee-wheel/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://dl.dropbox.com/u/27608349/sunburstzoom.png&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was thinking something along the lines of having shorter expirations at the edges and longer expirations in the middle, or vice versa&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or maybe showing which expirations had highest implied volatility away from the center.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;each individual node could represent one contract, and visually show volume or open interest over time for that one contract. clicking that node reveals a zoomed in version of it where the volume/oi stats could be more obvious. mousing over could reveal more information, or individual contract information could appear alongside of the graph to the left&lt;/p&gt;&#xA;&#xA;&lt;p&gt;anyone, I would like to at least get some input on a sunburst visualization for options so I can expand upon or scrap the idea within a few days time&lt;/p&gt;&#xA;&#xA;&lt;p&gt;can you think of any utility behind this quantitative analysis of an option chain? there are other visualizations too. This would be mainly for analyzing options, not necessarily making quick trading decisions in some current software you are familiar with&lt;/p&gt;&#xA;&#xA;&lt;p&gt;=====================&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;b&gt;UPDATE&lt;/b&gt;: so mini options are listed now. Here is a comparison of the Standard &amp;amp; Poors ETF (SPY) option chain in 2009 vs 2013&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2009: no Weekly options (options that expire in a week). Those were invented in 2010 and only one weeklies contract series traded at a time. There were only 3-month monthly contracts, LEAPs that expired on a certain interval (which could also be monthlies once their expiration date wasshort but did not trade parallel to them), and quarterly options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://dl.dropbox.com/u/27608349/Screen%20Shot%202013-03-17%20at%2010.00.11%20PM.png&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2013: Weekly options that trade for the current week and the next five weeks. Monthly contracts, quarterlies, LEAPs, SUPER LEAPS, &lt;em&gt;and&lt;/em&gt; mini options for most types.&#xA;&lt;img src=&quot;https://dl.dropbox.com/u/27608349/Screen%20Shot%202013-03-17%20at%2010.00.21%20PM.png&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Again, my main supposition is that there is possibly a way to display option chains that can better illuminate the data presented.&lt;/p&gt;&#xA;" OwnerUserId="1453" LastEditorUserId="1453" LastEditDate="2013-03-18T02:13:23.687" LastActivityDate="2013-03-18T02:13:23.687" Title="option chain data visualization, sunburst" Tags="&lt;options&gt;&lt;data&gt;&lt;derivatives&gt;&lt;visualization&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7339" PostTypeId="2" ParentId="3040" CreationDate="2013-02-20T16:23:51.033" Score="-1" Body="&lt;p&gt;You can calculate correlations, volatility, beta and other statistical metrics for a multi-holdings portfolio on &lt;a href=&quot;http://www.ivnestspy.com/calculator&quot; rel=&quot;nofollow&quot;&gt;InvestSpy&lt;/a&gt;, which is free of charge. For example, analyzing an evenly weighted portfolio of sector ETFs, it's clear that different sectors carry very different levels of risk. At the first glance, Health Care (XLV), Consumer Staples (XLP) and Utilities (XLU) appear to be the best diversifiers, whilst Financials (XLF) and Energy (XLE) - the worst. Similar analysis could be applied at a country level.&lt;/p&gt;&#xA;" OwnerUserId="4828" LastActivityDate="2013-02-20T16:23:51.033" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7340" PostTypeId="1" CreationDate="2013-02-20T16:39:14.003" Score="10" ViewCount="10034" Body="&lt;p&gt;I've been curious why vanilla options are quoted (and traded) in terms of volatility. Considering that every financial institution has its own options pricing model, volatility as an input would cause different prices for the same option. It would be obvious if the contracts were standardized and the models were explicitly specified. This, however, is not the case because the FX products are quoted in the same way, and the FX markets are OTCs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could someone shed some light on this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="4829" LastActivityDate="2018-12-12T20:27:09.337" Title="Why FX Vanilla Options are quoted in volatility" Tags="&lt;options&gt;&lt;volatility&gt;&lt;fx&gt;&lt;quote&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7342" PostTypeId="2" ParentId="7340" CreationDate="2013-02-20T23:36:36.660" Score="0" Body="&lt;p&gt;You are referring to implied volatility, more specifically, Black-Scholes implied volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Black-Scholes framework is, even though its extremely simplifying, common knowledge and does not depend on any other than generally known assumptions. Therefore option prices can be quoted in terms of their BS-IV, which is sometimes more convenient. So to answer your question, the model is actually specified to be BS. For other products, this would be to complicated, so it is rarely used.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, many interpolation procedures are performed on BS-IV surfaces due to numerical biases.&lt;/p&gt;&#xA;" OwnerUserId="1976" LastActivityDate="2013-02-20T23:36:36.660" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7343" PostTypeId="1" CreationDate="2013-02-21T01:56:15.063" Score="3" ViewCount="283" Body="&lt;p&gt;Does any one have a good tutorial , introduction or overview on the web for different ways of representing financial data as a spatial process? Such as those spatial processes often used in geo-statistics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&lt;strong&gt;EDIT&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I am looking for is going from financial time series data to fit the following general framework for spatial processes &lt;/p&gt;&#xA;&#xA;&lt;p&gt;let $s \in \Re$ be a generic data location in $d$-dimensional Euclidian space and suppose the potential datnum $Z(s)$ at spatial location $s$ is a random quantity. Let $D$ be a random set. Now let $s$ vary over index $D \subset \Re^d$ so as to generate a multivariate field or process:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\qquad \qquad \qquad \qquad \qquad \qquad \qquad  \{ Z(s):\in D \}; $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This may also be more commonly referred to as a random field&lt;/p&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="1764" LastEditDate="2013-02-22T04:57:29.320" LastActivityDate="2013-02-22T04:57:29.320" Title="how to represent financial data as a spatial process" Tags="&lt;statistics&gt;&lt;modeling&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7345" PostTypeId="2" ParentId="7340" CreationDate="2013-02-21T04:17:43.193" Score="11" Body="&lt;p&gt;You kind of answered the question yourself. Precisely because different market participants use different inputs to their pricing models, it is much easier to quote one single input (implied vols) than the output of 5 different inputs (BS option price). What is important is that you clearly differentiate between quoting and agreeing on the trade vs. the final settlement price. The process generally goes like this:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;You ask interdealer-brokers (if you are a market maker) or sell-side desks (in case you are a price taker such as prop side) for a quote, you generally are given an implied vol quote. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You then compare those and settle on who you want to deal with. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Only then when you agreed on the trade with the counter party both of you then look at the &quot;fine print&quot;, meaning you settle on the precise price of the option. Not seldom it happens that the counter party sends you a confirmation and you figure out that the stated price is not what you see in your system, so you call back and figure out what caused the discrepancy. Sometimes it is different dividend curves (in the case of single stock options), sometimes different settlement days possibly due to bank holidays or misunderstanding of settlement conventions, or anything else, but the implied vol quote is agreed and I have hardly ever heard that the vol quote is later on adjusted. Sometimes when an implied vol quote sounds and looks too &quot;juicy&quot; then it probably was an honest mistake by the counter party and if you intend to deal with the same party in the future then you would &quot;let them out&quot; as a courtesy. But in border line cases, I sometimes insisted on the trade, pointing to the fact that generally the &quot;done&quot; point in time when implied vols are agreed then that is the equivalent of the handshake or signature on a contract. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here couple additional thoughts:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Most OTC options, not all but most are quoted in implied volatility terms. I can say so with confidence about single stock options, equity index options, caps, floors, swaptions. I am still flabbergasted about why some seasoned quants disagree with this fact. Now, again the final price is in currency terms (unless you create a new coin called &quot;implied vol&quot;) but I find this just a trivial distraction from the actual fact that what matters when you trade options is the implied volatility at which those options are quoted. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Make sure you understand the local market habits and terms. Often single stock options and even index options are understood to be traded &lt;strong&gt;with the delta&lt;/strong&gt;, meaning, as part of the deal you exchange the delta in order to have the option initially delta hedged. That is why aside the implied vol quote agreement often the delta level is agreed on as well at the time of agreeing on the quote. In that way both counter parties know exactly at which spot level they are delta hedged, even though the deal is not yet settled. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-02-21T04:17:43.193" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7346" PostTypeId="1" AcceptedAnswerId="7347" CreationDate="2013-02-21T16:18:14.723" Score="0" ViewCount="127" Body="&lt;p&gt;Are there reference on SDE driven by jump proccesses? e.g. Shepard-Nielson Model&lt;/p&gt;&#xA;" OwnerUserId="3334" LastActivityDate="2013-02-22T09:45:37.710" Title="Reference on SDE driven by jump processes" Tags="&lt;option-pricing&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7347" PostTypeId="2" ParentId="7346" CreationDate="2013-02-21T16:51:02.147" Score="3" Body="&lt;p&gt;I don't have the original reference here but what about Merton's &lt;a href=&quot;http://financelab.nctu.edu.tw/Students/chiu/jd.pdf&quot; rel=&quot;nofollow&quot;&gt;Jump-Diffusion model&lt;/a&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.amazon.de/Stochastic-Calculus-Finance-II-Continuous-Time/dp/0387401016/ref=pd_sim_eb_7&quot; rel=&quot;nofollow&quot;&gt;Stochastic Calculus for Finance II: Continuous-Time Models&lt;/a&gt; by Steven Shreve has some chapters about modelling with jump-processes. I think it is a slightly easier introduction to the topic than Cont/Tankov.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2013-02-22T09:45:37.710" LastActivityDate="2013-02-22T09:45:37.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7348" PostTypeId="1" AcceptedAnswerId="7349" CreationDate="2013-02-21T20:40:27.117" Score="6" ViewCount="9393" Body="&lt;p&gt;I am currently reading &lt;a href=&quot;http://www.amazon.co.uk/Volatility-Trading-Wiley-Euan-Sinclair/dp/0470181990&quot;&gt;Volatility Trading&lt;/a&gt;, I have only just started, but I am trying to understand a &quot;derivation from first principles&quot; of the BSM pricing model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand how the value of a long call ($C$) and delta-hedged short position ($\Delta S$) in the underlying is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;C - \Delta S_t&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$C$ is the value of the long call option&lt;/li&gt;&#xA;&lt;li&gt;$S_t$ is the spot price of the underlying at time $t$&lt;/li&gt;&#xA;&lt;li&gt;$\Delta$ is the hedge ratio.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;On page 9, I also understand that the change in the value of said portfolio, as the underlying moves from $S_{t}$ to $S_{t+1}$ is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;(1.2)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;C(S_{t+1}) - C(S_t) -\Delta(S_{t+1} - S_t) + r(C-\Delta S_t)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the last term is money earned from reinvesting net received funds obtained in establishing the position at a rate $r$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The change in the option value is then obtained via a second-order Taylor series approximation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;(1.3)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\Delta(S_{t+1} - S_t) + \frac{1}{2}(S_{t+1} - S_t)^2\frac{\partial^2C}{\partial{S}^2} + \theta - \Delta(S_{t+1}-S_t) + r(C- \Delta S_t)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\theta$ is time decay.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't see how the author moves from equation &lt;strong&gt;1.2&lt;/strong&gt; to equation &lt;strong&gt;1.3&lt;/strong&gt;, as it is not clear (at least to me) what function $f(x)$ he is approximating in &lt;strong&gt;1.3&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would be grateful if someone could explain how the author makes the leap from equation &lt;strong&gt;1.2&lt;/strong&gt; to the Taylor approximation (&lt;strong&gt;1.3&lt;/strong&gt;) given on page 9.&lt;/p&gt;&#xA;" OwnerUserId="1733" LastEditorUserId="35" LastEditDate="2013-02-21T22:06:27.873" LastActivityDate="2013-02-23T20:57:20.003" Title="Taylor series expansion (Volatility Trading book) explanation sought" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7349" PostTypeId="2" ParentId="7348" CreationDate="2013-02-21T22:22:59.400" Score="5" Body="&lt;p&gt;He is approximating $C(S_{t+1})$ around $t$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C(S_{t+1})=C(S_{t}) + \frac{\partial C(S_{t})}{\partial S_{t}}(S_{t+1}-S_{t})+\frac{(S_{t+1}-S_t)²}{2}\frac{\partial^{2}C(S_{t})}{\partial S_{t}^{2}} + ...$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, he takes the time value of $C(S_t)$ into account &#xA;(and I look only at the time contribution here):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C(S_{t+1})-C(S_t)=\Delta t\frac{\partial C}{\partial t}+...=\Delta t\cdot\theta+..$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There, the first equation is just the derivative of the option with regard to t. Usually, $\theta$ is the loss of the option value in a day, so it is just a question of normalization here. If you put everything together, you get the step you are looking at.&lt;/p&gt;&#xA;" OwnerUserId="560" LastEditorUserId="560" LastEditDate="2013-02-23T20:57:20.003" LastActivityDate="2013-02-23T20:57:20.003" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7350" PostTypeId="1" AcceptedAnswerId="7436" CreationDate="2013-02-22T18:04:01.130" Score="3" ViewCount="138" Body="&lt;p&gt;I'm currently working on an application that, among other things, computes a one-day parametric VaR for security positions.  I understand that the parametric method of computing VaR is a poor fit for non-linear instruments, such as options and fixed income.  Thus my question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can I evaluate how poor a fit a parametric VaR result would be for a given holding?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm interested in both rules of thumb - for example, &quot;credit default swaps are always a poor fit for a parametric VaR computation&quot; and guidelines, such as &quot;fixed income securities become increasingly non-linear as duration increases, and are a poor fit for a parametric VaR computation once duration is above X&quot;  &lt;em&gt;I have no idea if either of those statements are true.  I made them up.&lt;/em&gt; &lt;/p&gt;&#xA;" OwnerUserId="3365" LastEditorUserId="848" LastEditDate="2013-03-04T19:32:05.650" LastActivityDate="2013-03-04T19:32:05.650" Title="How can I evaluate how poor a fit a parametric VaR result would be for a given holding?" Tags="&lt;correlation&gt;&lt;var&gt;&lt;covariance&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7351" PostTypeId="1" AcceptedAnswerId="7352" CreationDate="2013-02-22T19:51:38.827" Score="6" ViewCount="6050" Body="&lt;p&gt;I have implemented the following model:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;daily_vol(t+1) = A*daily_vol(t) + B*weekly_vol(t) + C*monthly_vol(t) + error&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where vol means volatility, and A, B, C are parameters to be estimated using OLS. However, the predicted model is not very accurate, and in &lt;a href=&quot;http://www.core.ucl.ac.be/~laurent/SL_fichiers/LSE/pdf/A%20Simple%20Long%20Memory%20Model%20of%20Realized%20Volatility.pdf&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt; the author mentions the Newey-West covariance correction to improve the estimates. However, I don't understand how exactly I would use this to change A, B, C. Can anyone explain what I should do?&lt;/p&gt;&#xA;" OwnerUserId="4692" LastEditorUserId="35" LastEditDate="2013-02-22T23:15:27.283" LastActivityDate="2013-02-22T23:15:27.283" Title="How to use Newey West covariance corrector?" Tags="&lt;volatility&gt;&lt;time-series&gt;&lt;regression&gt;&lt;covariance&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7352" PostTypeId="2" ParentId="7351" CreationDate="2013-02-22T21:03:16.920" Score="5" Body="&lt;p&gt;The Newey-West procedure is meant to adjust the covariance matrix of the parameters to account for autocorrelation and heteroskedasticity. It is typically used in financial applications when one estimates the alpha (a parameter in a regression model) of a portfolio or strategy. One would adjust the standard errors using the Newey-West procedure in order to obtain a better t-statistic to determine whether the strategy generates significant returns. In the case of multivariate regression, one can calculate the covariance matrix of the parameters, e.g. the covariance matrix that measures the uncertainty in your estimates of alpha and the beta in the above example. The standard error is merely derived from this matrix. Hence, correcting this covariance matrix of the estimates, leads to changing standard errors, and different results to t-tests. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the paper you linked to, they specifically refer to Newey-West standard errors, which is essentially the same thing as what I described above. They are worried about the impact of overlapping periods on the test statistic. This would not impact the regression coefficients, which is what seems to be your problem. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2013-02-22T21:03:16.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7353" PostTypeId="1" CreationDate="2013-02-23T01:56:56.923" Score="3" ViewCount="387" Body="&lt;p&gt;I just had a quick look at the &lt;strong&gt;daily&lt;/strong&gt; returns for a few pairs of leveraged ETFs - it appears that the percent daily returns do not match perfectly. For instance, looking at FAS/FAZ, the returns for the two can diverge as much as 15 bps per day. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reading the summary, the language appears very clear:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;FAZ&lt;/strong&gt;:&lt;em&gt;The investment seeks daily investment results, before fees and expenses, of 300% of the inverse (or opposite) of the performance of the Russell 1000Â® Financial Services Index.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;FAS&lt;/strong&gt;:&lt;em&gt;The investment seeks daily investment results, before fees and expenses, of 300% of the performance of the Russell 1000Â® Financial Services Index.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Seems to me that the process has to be fairly simple - every day, managers of these ETFs submit MOC orders that will make the notional exposure to the underlying index is equal to the leverage. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I am missing something in understanding how these products function like mandate does not have to followed exactly and the manager uses his discretion in matching the returns (e.g. he does not need to match the close to close returns)?&lt;/li&gt;&#xA;&lt;li&gt;Is the divergence is daily returns driven by the managers inability&#xA;to execute order directly at MOC or some sort of expences (e.g.&#xA;comissions/borrow/fees or maybe execution mismatches) are passed into the ETF price?&lt;/li&gt;&#xA;&lt;li&gt;I am understanding the concept of &quot;300% of the performance&quot;&#xA;incorrectly (I assume that means R(ETF) = R(Index) * Leverage, so&#xA;R(ETF 3x) == -R(ETF -3x) by definition? I assume that under performance they mean percentage return of the index.&lt;/li&gt;&#xA;&lt;li&gt;It's a problem with the data - I used Yahoo data for this little&#xA;study. Can I assume that the closes should be correct (I know opens,&#xA;high/lows are sometimes not).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;PS. I do know that the re-balancing process creates negative exposure to the variance (by virtue of buying on the up days and selling at the close of the down days) but the daily percentage returns should not be affected, at least that's how I understand the replication process.&lt;/p&gt;&#xA;" OwnerUserId="4838" LastActivityDate="2013-02-24T02:14:38.127" Title="Leveraged and inverse leveraged ETFs - what is the exact defintion?" Tags="&lt;equities&gt;&lt;etf&gt;&lt;leverage&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7354" PostTypeId="2" ParentId="7353" CreationDate="2013-02-23T03:19:19.117" Score="1" Body="&lt;p&gt;There are three prices to consider when discussing an ETF:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;the ideal price as represented by the index,&lt;/li&gt;&#xA;&lt;li&gt;the NAV of the fund based on that day's holdings, and&lt;/li&gt;&#xA;&lt;li&gt;the market value traded on a stock exchange.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This third price is what you see.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your example, Russell has calculated a cap-weighted value based on the &lt;a href=&quot;http://www.russell.com/indexes/documents/Membership/Russell1000FinancialServices_Membership_List.pdf&quot; rel=&quot;nofollow&quot;&gt;annual membership&lt;/a&gt;. Direxion then determines &lt;a href=&quot;http://www.direxionshares.com/holdings_fas.csv&quot; rel=&quot;nofollow&quot;&gt;daily holdings&lt;/a&gt; to mimic the index returns as best as possible. As you point-out, there is transaction cost associated with the daily rebalance, plus Direxion is subtracting their management fee. This slippage is reflected in the holdings; Direxion may liquidate some assets and claim a portion of the cash in order to satisfy these costs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once Direxion releases the daily holdings, market markers will provide liquidity &lt;em&gt;with the goal of making a profit&lt;/em&gt;. They do this by quoting prices that give them a slight arbitrage to the underlying assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the effect you see isn't a misunderstanding or the result of nefarious activity; it's merely the by-product of how ETFs work.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2013-02-23T03:19:19.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7355" PostTypeId="2" ParentId="7353" CreationDate="2013-02-23T04:16:27.280" Score="1" Body="&lt;p&gt;The key reason why you observe divergent performance patterns is related mostly to the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The biggest reason is the different cost to hedge those products. The costs to implement and especially maintain the hedge on the long vs short side can be very different. Either the hedge is implemented through an index replication in which case the manager has to buy/sell stocks (different costs involved in borrowing shares vs simply buying the shares outright) or through derivatives contracts in which case the manager is subject to opposing effects of being long vs. short contango/normal backwardation, different costs of the roll. So, even though some ETFs may attempt to track an index (many actually track the futures traded on the underlying, such as VXX), what matters for the performance is the hedging costs as well, and if the hedge is done through futures contracts then there is a direct link between the question at hand and my mentioning futures. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Even for simple stock investments the costs associated with long and short positions are vastly different. Long non-margined holdings do not incur any cost. However, short positions incur borrowing cost plus the cost inherent in the risk of borrowed shares being called. Even  if both products' underlyings are margined there is a difference between the costs on the long and short side as borrow and loan rates are different. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In summary, the simple answer is &lt;strong&gt;different cost of hedging are mainly responsible for the divergence in performance&lt;/strong&gt;. Another more trivial reason is that each ETF's price is subject to supply demand. The answer thus is different costs of hedging under which no-arbitrage arguments still hold. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-02-23T12:44:04.673" LastActivityDate="2013-02-23T12:44:04.673" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7358" PostTypeId="2" ParentId="7353" CreationDate="2013-02-24T02:14:38.127" Score="0" Body="&lt;p&gt;to more concise i will answer the question..  There is a known mathematical decay from volatility. For this reason companies like Proshares will state that these investments are not good long term investments.    i'll go over an example below.&lt;br&gt;&#xA; (extrapolate this... 50% gain on 100 = 150,    50% loss on 150 = 75, there for to get back to 100 from 150 you have to lose 66.6666..%)  = fact... empirically.. just something to note.. on to my example&lt;/p&gt;&#xA;&#xA;&lt;p&gt;lets say index A goes up 10 percent on day and then drops 9.09 percent the next day. for a two day return of zero percent.. Simultaneously a leveraged short fund based on the index would go up 20 percent ,then on day two would jump down 18.18 percent... (second days index drop in percentage times 2)   but because the rise would be from a base equaling to 80 percent of your original investment you would now have less then 95 percentage of what you had put up.. so even though the index is sitting right where it started out at your sitting on a loss of like 5.46% ... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;simply math... index day one: 100(1.1)=120         (ten percent gain)&#xA;               index day two: 120(.9090..)= 100    thats a loss of approx  9.09 percent&lt;/p&gt;&#xA;&#xA;&lt;p&gt;now the leveraged fun&#xA;               short ETF day one: 100(.80)= 80   (this is the 80 base mentioned above)&#xA;               short ETF day two: 80(1.1818)=94.54  (at this point your sitting on the 5.46% los) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;this happens outside of any other fees and or replication intervention&lt;/p&gt;&#xA;" OwnerUserId="4764" LastActivityDate="2013-02-24T02:14:38.127" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7360" PostTypeId="2" ParentId="1685" CreationDate="2013-02-25T09:08:33.107" Score="1" Body="&lt;p&gt;Based on my experience trading DJ Eurostoxx 50 (FESX), the HFTs place and delete the orders almost immediately to fool other algorithms which are based on limit order quantity at various prices. I have used a technique to scalp of a few ticks when such a phenomena occurs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance if the HFt places an order for 1000 lots at 2000 and immediately it disappears, but the market price moves up and down by a few ticks. This is because other algorithms are designed to operate on certain order imbalance etc. Hence if I see a huge order on bid side, I used to sell some lots and immediately scalp off a a couple ticks. I used to do this and make some money during such hours. This stuff mostly happened during dull hours. My 2 cents. &lt;/p&gt;&#xA;" OwnerUserId="4847" LastActivityDate="2013-02-25T09:08:33.107" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7361" PostTypeId="1" AcceptedAnswerId="7362" CreationDate="2013-02-25T09:17:12.640" Score="5" ViewCount="9602" Body="&lt;p&gt;I happened to get this question for Fixed Income Swap contract. (let's assume it's it's not cross currency). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the fixed leg is paying 10% interest rate in this contract, but in the market the rates have gone down to 5%..&#xA;How can the payer of fixed leg can reduce paying extra when market has gone down and vise versa.. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should he go for a futures or what is the suitable financial product?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;PS: I didn't have the chance to speak and ask a fin-analyst around. So I am asking here although this site is meant for professional quants. Hope this is a valid question.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="3178" LastActivityDate="2013-03-01T11:40:03.047" Title="How to hedge the fixed leg of a swap contract?" Tags="&lt;interest-rates&gt;&lt;fixed-income&gt;&lt;hedging&gt;&lt;derivatives&gt;&lt;swaps&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7362" PostTypeId="2" ParentId="7361" CreationDate="2013-02-25T09:51:02.200" Score="2" Body="&lt;p&gt;You would simply hedge with a floating rate leg. That is the whole idea of swaps though. A price taker is paying fixed and receiving floating then such price taker usually is hedging the risk of interest rates increasing, meaning he is not concerned with the risk of decreasing rates. Generally such participant has floating rate liabilities. Let's say the floating rates thus cancel out (he pays floating on other liabilities and receives floating on the floating leg of the swap), however he/she still has got to pay fixed on the fixed swap leg. I guess that is where you stand right now, correct? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would argue such player generally receives fixed on other assets and is thus fully hedged. Otherwise it would not make sense for such participant to leave a fixed rate open, if he/she was not comfortable in paying such fixed rate. Thus, the assumption is generally that the motivation why such person entered into a fixed for floating swap agreement was to transfer risk. But for pure argument's sake, lets say he/she now still wanted to offset the fixed rate liability. Either he/she could enter into another swap agreement or transfer the risk from the fixed rate away into any other stream of cashflow liability. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But again, please make sure you understand the original intentions of the swap trader. It was to transfer a floating rate liability into a fixed rate liability, thus mission accomplished. Otherwise such person would not have traded a fixed for floating rate swap in the first place. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-02-25T09:51:02.200" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7363" PostTypeId="2" ParentId="3155" CreationDate="2013-02-25T12:31:25.867" Score="2" Body="&lt;p&gt;The Systematic Investor has a series of articles on using PCA and clustering to improve on traditional Risk Parity approaches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The series of posts start here:&#xA;&lt;a href=&quot;http://systematicinvestor.wordpress.com/2012/12/22/visualizing-principal-components/&quot; rel=&quot;nofollow&quot;&gt;http://systematicinvestor.wordpress.com/2012/12/22/visualizing-principal-components/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="4824" LastActivityDate="2013-02-25T12:31:25.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7364" PostTypeId="2" ParentId="1685" CreationDate="2013-02-25T14:57:31.227" Score="0" Body="&lt;p&gt;For example, high frequency market makers use all the market microstructure to take decisions of how many stocks put in each side. This microstructure can be a 5 level data (ten prices, 5 bids and 5 asks with the quote amount or quantity) so they calculate and quantify the order book imbalance or other type of measure of the supply/demand of the order book.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To modify the market they post some limit orders and send orders in different prices to try to balance the book order and also because they use this type of orders for the risk management of the strategy.&lt;/p&gt;&#xA;" OwnerUserId="4701" LastActivityDate="2013-02-25T14:57:31.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7365" PostTypeId="1" AcceptedAnswerId="7367" CreationDate="2013-02-25T15:42:11.570" Score="8" ViewCount="5242" Body="&lt;p&gt;The Dow Jones elementized news feed API seems to stand out but are there any other machine readable news feeds out there that provide very low latencies that high frequency operations may peruse? I am especially targeting US based economic news releases and US stock related news feeds. I am looking to collocate several of my fx based hft strategies in New York with a very capable fx aggregation platform but also look into US based equities trading based on economic news releases. I am a price taker and have successfully implemented similar solutions on currency pairs in The Asian time zone but look to expand to trade US news releases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The news feed must originate from one of the major news agencies and the feed must be released &#xA;anywhere between Washington DC and NYC for latency purposes. Generally the news item of economic releases that the department of labor, for example, releases is prepared but quarantined until the dept actually releases their numbers. There have been couple changes enacted recently in order to prevent pre release leakages and I am looking for a solution that optimizes current news flow. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2015-02-23T12:22:57.130" Title="Fastest news feed APIs targeting high frequency trading?" Tags="&lt;programming&gt;&lt;high-frequency&gt;&lt;news&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7366" PostTypeId="1" CreationDate="2013-02-25T08:48:07.467" Score="8" ViewCount="624" Body="&lt;p&gt;Futures closely mirror their underlying, as can be seen in the charts below. Eventually, at expiration, they reach the value of the underlying. However, they seem to show no extra information about the underlying's future; i.e. they don't trend any closer to the underlying's value at expiration than the underlying itself does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is an underlying, &lt;a href=&quot;http://en.wikipedia.org/wiki/S%26P_500&quot; rel=&quot;nofollow noreferrer&quot;&gt;SPY&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/fcXto.png&quot; alt=&quot;SPY chart&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And below is the &lt;a href=&quot;http://en.wikipedia.org/wiki/E-mini_S%26P&quot; rel=&quot;nofollow noreferrer&quot;&gt;ES&lt;/a&gt; futures Dec 2012 contract.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/mv2zp.png&quot; alt=&quot;ES chart&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it is possible to calculate how often a given future has been directionally correct. For instance, SPY closed at 142.79 on Dec 21, 2012. To determine the directional predictive power of the ES future, one would run the following pseudocode in a backtesting system:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$SPY_close = 142.79&#xA;$future_predicted_direction = 0&#xA;$days = 0&#xA;FOR $day (2012-01-01 .. 2012-12-21) {&#xA;  $days++&#xA;  IF $EOD_quotes[&quot;SPY&quot;][$day] &amp;gt; $SPY_close&#xA;      THEN $future_predicted_direction += $EOD_quotes[&quot;ES&quot;][$day] &amp;lt;= $EOD_quotes[&quot;SPY&quot;][$day]&#xA;      ELSE $future_predicted_direction += $EOD_quotes[&quot;ES&quot;][$day] &amp;gt;= $EOD_quotes[&quot;SPY&quot;][$day]&#xA;}&#xA;&#xA;print &quot;ES futures correctly predicted direction $future_predicted_direction out of $days days, that is, &quot;&#xA;+ int($future_predicted_direction / $days * 100) + &quot;% of the time.&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Are there any studies on this? Do futures have any predictive power?&lt;/p&gt;&#xA;" OwnerUserId="4848" OwnerDisplayName="Gascoyne" LastEditorUserId="4848" LastEditDate="2015-09-03T08:08:07.563" LastActivityDate="2015-09-03T08:08:07.563" Title="Do futures have predictive value?" Tags="&lt;futures&gt;&lt;prediction&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7367" PostTypeId="2" ParentId="7365" CreationDate="2013-02-25T16:02:47.187" Score="8" Body="&lt;p&gt;What you are looking for is generally called &quot;machine-readable news&quot;. Here are the ones I know about off hand:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.dowjones.com/salesandtrading/low-latency-feeds.asp&quot;&gt;Dow Jones Elementized News Feed&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://thomsonreuters.com/products_services/financial/financial_products/a-z/news_feed_direct/&quot;&gt;Thompson Reuters News Feed Direct&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.bloomberg.com/enterprise/enterprise_products/data_optimization/data_feeds/&quot;&gt;Bloomberg Event-Driven Trading Feed&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.nasdaqtrader.com/Trader.aspx?id=EDA&quot;&gt;NASDAQ OMX Event-Driven Analytics&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Good luck getting reliable latency figures from any of those vendors though.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2013-02-25T16:02:47.187" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7368" PostTypeId="2" ParentId="7361" CreationDate="2013-02-25T16:57:50.200" Score="3" Body="&lt;p&gt;Assume the swap is collateralized, say with OIS accuring collateral account (plain swaps usually are collaterlized). In that case you will not &quot;pay extra&quot; since your collateral account already contais the amount you have to pay: whenever the swap triggers a net payment the collateral acocunt changes according to this payment. If you were hedged against interest rate movements before the market move, your hedges (or the other instruments) have generated that collateral.&#xA;However, you do have an exposure to the OIS rate (because the swap is OIS collateralized), which you have to hedge (dynamically) by OIS swaps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume the swap is not collateralized, then you have to fund all future values. The net payments in the swap are then payed by corresponding the maturing of the corresponding funding contracts (which you created dynamically in your hedge).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put differently: If you are hedged agains interest rate movements (forward curve and discounting curve) your hedges will change in value such that all futures cash-flows can be paied. Just dynamically adjust the hedges...&lt;/p&gt;&#xA;" OwnerUserId="3548" LastEditorUserId="3548" LastEditDate="2013-02-26T06:51:11.710" LastActivityDate="2013-02-26T06:51:11.710" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7369" PostTypeId="1" CreationDate="2013-02-25T17:57:20.327" Score="3" ViewCount="66" Body="&lt;p&gt;Reading &lt;a href=&quot;http://iruizconsulting.com/wp-content/uploads/2012/08/iRuiz_Spreads_Mean_Reversion_v1.0.4.pdf&quot; rel=&quot;nofollow&quot;&gt;this note&lt;/a&gt; it strikes me that credit spreads and defaults seem not to be commonly modeled jointly (e.g. more or less directly in structural models), but at best with some kind of &quot;ex post&quot; dependency adjustment in a strictly intensity oriented fashion. Can someone here confirm/rebutt or even detail on his approach and on what he has seen done by peers?&lt;/p&gt;&#xA;" OwnerUserId="3015" LastActivityDate="2013-02-25T17:57:20.327" Title="Credit spreads vs default events dependence" Tags="&lt;simulations&gt;&lt;default&gt;&lt;dependence&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7370" PostTypeId="2" ParentId="7365" CreationDate="2013-02-25T18:45:45.093" Score="5" Body="&lt;p&gt;Since you mentioned economic number releases you may be interested in &lt;a href=&quot;http://www.alphaflash.com/&quot;&gt;AlphaFlash&lt;/a&gt;. For trading economic releases they have a fiber that runs into the NY4 data center an supposedly shaves a couple of milliseconds off. &lt;/p&gt;&#xA;" OwnerUserId="373" LastEditorUserId="373" LastEditDate="2013-02-25T23:36:36.950" LastActivityDate="2013-02-25T23:36:36.950" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7371" PostTypeId="2" ParentId="7366" CreationDate="2013-02-25T19:27:21.133" Score="7" Body="&lt;p&gt;No I believe there is no directional predictive value derived from looking at divergences between futures and their underlying price value. The reason for divergences are of the no-arbitrage argument type. Futures could be arbitraged (and are immediately if such arbitrage opportunities surface, even those opportunities may only fill the stomach of a single person, not a whole family.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, one may argue that there is reason to believe that when futures trade in contango or normal backwardation that this tells something where the market believes price will tend to trade. That is absolutely true but I would argue that there is no alpha to be generated from such knowledge. How farther out futures trade vs near months is something everyone knows and it comes down to the same old risk/reward equation since mankind was created: do you believe an asset is overvalued for a reason and thus go against what most market participants believe will happen or do you sell tops and buy bottoms , which is another way of saying that you want to be a value investor. The choice is yours, in fact if done right both approaches can work. There are a few highly successful traders/investors in either camp. So it comes down, IMHO, to not whether prices will converge to what you define their long term mean and thus whether futures lead their underlyinging asset prices but it comes down how you time your own trades, and particularly how you manage your capital and positions. I believe an understanding of futures pricing is similar to you reading in the newspaper how to hold a tennis racket, you don't win Wimbledon with that. It's a basic ingredient but not a recipe for success.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would not invest too much time in searching for academic studies in this realm, after all have you ever seen a single academician who published a study in this particular field who struck it rich? I have not. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-02-25T19:27:21.133" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7374" PostTypeId="1" AcceptedAnswerId="8614" CreationDate="2013-02-26T13:07:11.230" Score="9" ViewCount="2933" Body="&lt;p&gt;Recently I started working in a bank as a modeler, one of the possible topic is FTP - Fund Transfer Pricing.&#xA;After I studied that subject a little on wiki and read a website or two in that field I gained a little knowledge in that area.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But apparently very little.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I mean, when I understood is the purpose of FTP, and the approach in general, such as find representative products to decide the points on the grid, choose interpolation method, then do some qualitative adjustments due to business needs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I feel that their language is yet unclear.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for a book that bridges this gap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope it could explain where modelling come into place, and what are the industry practices. for example, how to&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Derive an appropriate bank credit spread for funds which are 12&#xA;Months and below?&lt;/li&gt;&#xA;&lt;li&gt;Obtain an appropriate bid ask spread for the Bank’s funding curve?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Also I hope it gives some more detailed part on the business side, such as how the approaches shall change according to each bank/financial institute's main business.&lt;/p&gt;&#xA;" OwnerUserId="2161" LastEditorUserId="2161" LastEditDate="2013-08-01T04:06:24.113" LastActivityDate="2018-08-07T13:39:31.900" Title="Looking for a recommendation for a Fund Transfer Pricing modelling book" Tags="&lt;modeling&gt;&lt;pricing&gt;&lt;books&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7375" PostTypeId="1" CreationDate="2013-02-26T13:10:16.113" Score="10" ViewCount="2276" Body="&lt;p&gt;I'm trying to implement Black-Litterman for an arbitrary selection of assets. &#xA;One of the input for BL is the &quot;Equilibrium market capitalization weights for each asset&quot;.&#xA;In most examples I've seen, the assets are represented by different market sector so the market capitalization is based on the sector share.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What should I use as market weight for an arbitrary selection of assets (stocks, bonds etc)?&lt;/p&gt;&#xA;" OwnerUserId="4856" LastEditorUserId="16595" LastEditDate="2018-07-18T19:30:28.180" LastActivityDate="2018-07-18T19:30:28.180" Title="Market weights for Black-Litterman" Tags="&lt;black-litterman&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7376" PostTypeId="1" AcceptedAnswerId="7407" CreationDate="2013-02-26T13:58:43.780" Score="2" ViewCount="4061" Body="&lt;p&gt;Recently I came across the problem of amortizing swaps. This is an agreement, where fixed payments and floating payments (e.g. 3-months LIBOR + spread) are exchanged based on a notional that is reduced (=amortized) according to a fixed schedule. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Are there good references for a precise formula?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Are there simple formulas, maybe approximations to derive a fair swap rate for the amortizing swap from the plain vanilla swap? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Are there calculators online or on Bloomberg for such agreements?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2013-02-26T14:12:28.470" LastActivityDate="2013-03-01T11:51:13.273" Title="Fair swap rate of an amortizing swap" Tags="&lt;interest-rates&gt;&lt;swaps&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7377" PostTypeId="1" AcceptedAnswerId="7379" CreationDate="2013-02-26T14:12:02.417" Score="28" ViewCount="28669" Body="&lt;p&gt;What are fashionable applications of &lt;a href=&quot;http://en.wikipedia.org/wiki/Fourier_transform&quot;&gt;Fourier analysis&lt;/a&gt; in trading? I have heard vague ideas of applications in High Frequency Trading but can somebody provide an example, maybe a reference?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just for clarification: The approach to split up a stock price in its cosines and to apply this for forecasts or anything similar seems theoretically not justified as we can not assume the stock price to be periodic (outside of the period of observation). So I don't really mean such applications.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put differently: are there useful, theoretically valid applications of Fourier theory in trading? I am curious for any comments, thank you!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I am aware of (theoretically $100\%$ valid) applications in option pricing and calculation of risk measures in the context of Lévy processes (see e.g. &lt;a href=&quot;http://arxiv.org/pdf/1212.4126v1.pdf&quot;&gt;here&lt;/a&gt; p.11 and following and references therein). This is well established, I guess. What I mean are applications in time series analysis. Sorry for any confusions.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2013-02-26T14:44:38.370" LastActivityDate="2017-02-02T19:26:21.690" Title="Applications of Fourier theory in trading" Tags="&lt;trading&gt;&lt;high-frequency&gt;" AnswerCount="6" CommentCount="2" FavoriteCount="31" ContentLicense="CC BY-SA 3.0" />
  <row Id="7378" PostTypeId="2" ParentId="7377" CreationDate="2013-02-26T14:38:16.227" Score="8" Body="&lt;p&gt;The main application I know of is in option pricing. Peter Carr has done some research here. For an introductory article see this one:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.math.nyu.edu/research/carrp/papers/pdf/jcfpub.pdf&quot;&gt;Option valuation using the fast Fourier transform&lt;/a&gt; by Peter Carr and Dilip B. Madan:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In this paper the authors show how the fast Fourier transform may be used to value&#xA;  options when the characteristic function of the return is known analytically.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="12" LastActivityDate="2013-02-26T14:38:16.227" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7379" PostTypeId="2" ParentId="7377" CreationDate="2013-02-26T14:41:21.360" Score="15" Body="&lt;p&gt;I can think of an application in options pricing. I came across the following paper a long time ago but think it explains FT very eloquently as applied to pricing options under BS:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://maxmatsuda.com/Papers/2004/Matsuda%20Intro%20FT%20Pricing.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://maxmatsuda.com/Papers/2004/Matsuda%20Intro%20FT%20Pricing.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fun starts on page 112 but it relies on the 1998 paper by Madan and Carr. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I like about the paper is that it gives a thorough introduction to FT and only when the groundwork is set it applies it to option pricing. Not a bad approach vs many other papers which make a lot of assumption and assume the reader can jump right into it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit to reflect OP's clarification&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There was a question on SO (curious why there but nonetheless its there):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/4479463/using-fourier-analysis-for-time-series-prediction&quot;&gt;https://stackoverflow.com/questions/4479463/using-fourier-analysis-for-time-series-prediction&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the following couple papers I came across, some more applicable to engineering (signal processing) but I think you have to make very similar assumptions when applying those to financial time series analysis:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.le.ac.uk/users/dsgp1/SIGNALS/FIVESTAT.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.le.ac.uk/users/dsgp1/SIGNALS/FIVESTAT.pdf&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.le.ac.uk/users/dsgp1/SIGNALS/ECONSIGS.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.le.ac.uk/users/dsgp1/SIGNALS/ECONSIGS.pdf&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://people.ds.cam.ac.uk/pka24/Teaching/M310/M310_Spectral_Analysis_Philipp_Andres.PDF&quot; rel=&quot;noreferrer&quot;&gt;http://people.ds.cam.ac.uk/pka24/Teaching/M310/M310_Spectral_Analysis_Philipp_Andres.PDF&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Applied to hft:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://editorialexpress.com/cgi-bin/conference/download.cgi?db_name=sce2007&amp;amp;paper_id=21&quot; rel=&quot;noreferrer&quot;&gt;https://editorialexpress.com/cgi-bin/conference/download.cgi?db_name=sce2007&amp;amp;paper_id=21&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.essex.ac.uk/ccfea/research/WorkingPapers/2008/GNC%20-%20Advanced%20Fourier%20Transforms.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.essex.ac.uk/ccfea/research/WorkingPapers/2008/GNC%20-%20Advanced%20Fourier%20Transforms.pdf&lt;/a&gt; (this one had some interesting reference attached to it, worth going through!)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2013-02-26T15:36:42.123" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7380" PostTypeId="2" ParentId="7376" CreationDate="2013-02-26T14:51:57.153" Score="2" Body="&lt;p&gt;The following is an excellent Hagan paper (I just love his writing style and approach to explain). It covers amortizing swaps as well. A bit hard to find paper but here is a link:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.docin.com/p-414687649.html&quot; rel=&quot;nofollow&quot;&gt;http://www.docin.com/p-414687649.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keep in mind most amortizing swaps have embedded call-features and if I remember correctly the origin dates to the desire to hedge floating rate mortgage books where the mortgage originator or investor pays floating and receives fixed on an amortized principal. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-02-26T14:57:21.580" LastActivityDate="2013-02-26T14:57:21.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7381" PostTypeId="2" ParentId="522" CreationDate="2013-02-26T15:23:56.203" Score="3" Body="&lt;p&gt;Beware that the assumptions usually made are not consistent with the practical applications, especially when heavy tails are considered. For the extension to a more realistic setting see &lt;a href=&quot;http://arxiv.org/abs/physics/0503007&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; nice paper.&lt;/p&gt;&#xA;" OwnerUserId="3015" LastActivityDate="2013-02-26T15:23:56.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7386" PostTypeId="1" CreationDate="2013-02-26T22:51:14.087" Score="0" ViewCount="656" Body="&lt;p&gt;Why C is still in use especially in area of numerical optimization (instead of C++) ?&#xA;C and C++ aren't fully compatible so mayby you know some differances that make the difference ?&lt;/p&gt;&#xA;" OwnerUserId="2044" LastActivityDate="2013-02-27T02:26:58.490" Title="Why C is still in use especially in area of numerical optimization (instead of C++)?" Tags="&lt;programming&gt;&lt;numerical-methods&gt;" AnswerCount="3" CommentCount="7" ClosedDate="2013-02-27T12:19:09.633" ContentLicense="CC BY-SA 3.0" />
  <row Id="7387" PostTypeId="2" ParentId="7386" CreationDate="2013-02-26T23:27:36.437" Score="4" Body="&lt;p&gt;who told you that ? I am used to create new trade systems in C++ to make the customers requirements feasible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CERN used C++ to prove higgs boson particle. I see people using C to program embedded like microwaves or fridges :D&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but it is just my opnion, I would like to hear others.&lt;/p&gt;&#xA;" OwnerUserId="1360" LastActivityDate="2013-02-26T23:27:36.437" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7388" PostTypeId="2" ParentId="7386" CreationDate="2013-02-27T00:08:15.973" Score="5" Body="&lt;p&gt;C is not used for any particular reason in numerical optimizations other than for legacy reasons. However, there are areas where C is preferred over C++ though even C is not the preferred language of choice. To mind comes programming FPGAs. Though VHDL and Verilog are by far the standards. But &quot;behavioral synthesis&quot; allows to utilize C or C relatives such as SystemC to transfer logic to HDL. In that C is the preferred choice over C++. (Though having started working with FPGAs I start to get the sense that VHDL and Verilog are so popular for good reasons; even though the learning curve is a lot steeper they are much closer to the core of the particular hardware logic (Gate Arrays have a vastly different structure than a CPU). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, C has its applications and is the preferred choice of weapon in some areas but more often than not people prefer using what they are best at. At least in numerical optimization I do not see a single reason why C would be preferred over C++ and actually I doubt such claim. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-02-27T02:26:58.490" LastActivityDate="2013-02-27T02:26:58.490" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7389" PostTypeId="2" ParentId="7386" CreationDate="2013-02-27T02:09:42.947" Score="2" Body="&lt;p&gt;I don't know how widely used C is over C++ when it comes to doing numerical optimization; however, if there is a preference towards C it likely comes from the fact that C++ name mangling is not standard making C++ libraries very hard to integrate into other languages and environments. With C you get a well known calling convention making it straightforward to integrate which is why you see C (and Fortran) libraries that are used in Python, R, Ruby, Java, C#, etc.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2013-02-27T02:09:42.947" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7393" PostTypeId="1" CreationDate="2013-02-27T09:28:29.877" Score="7" ViewCount="531" Body="&lt;p&gt;When making simple agent-based models of banking systems to look at global properties (say systemic risk) one of the basic decisions you have to make is how to model returns on external (to the banking network) assets. The goal is to have as simple (and general) of a model as possible, without it being fundamentally unreasonable. &lt;strong&gt;What are some standard approaches?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I was trying the first thing that comes to mind then I would assume that returns on different assets are independently and normally distributed. This is tempting because of the central-limit theorem and how easy Gaussians are to work with, but unfortunately it is also considered &lt;a href=&quot;https://quant.stackexchange.com/a/158/1218&quot;&gt;one of the most dangerous assumptions in finance&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, it seems that &lt;a href=&quot;https://quant.stackexchange.com/a/2011/1218&quot;&gt;distributions with fatter tails are preferred&lt;/a&gt;. For instance &lt;a href=&quot;http://www.pnas.org/content/early/2011/07/13/1105882108.abstract&quot; rel=&quot;nofollow noreferrer&quot;&gt;this recent paper&lt;/a&gt; (which is written at a level of abstraction that I'd be interested in working at) uses student's t-distribution (with df = 1.5) to sample returns. However, I've been told by some quants that even this distribution doesn't have a heavy enough tail. Further, distributions with full support on $(-\infty, +\infty)$ simply don't make sense as models of returns for me. How could you possibly lose more money than your original investment? But if you simply truncate the distribution on the left though then the fat tail you cut off will result in a significant effect (as compared to truncating something like a Gaussian).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are typical distributions used to model returns in work that needs to discuss external assets but is not primarily focused on them? &lt;strong&gt;Is there a good survey paper discussing advantages and limitations of simple return models?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="1218" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2013-02-27T09:58:50.350" Title="Toy models of asset returns" Tags="&lt;research&gt;&lt;returns&gt;&lt;theory&gt;&lt;asset-returns&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7394" PostTypeId="2" ParentId="7393" CreationDate="2013-02-27T09:58:50.350" Score="5" Body="&lt;p&gt;Some of the used heavy-tail distributions are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Log-Cauchy and Log-Gamma&lt;/li&gt;&#xA;&lt;li&gt;Lévy&lt;/li&gt;&#xA;&lt;li&gt;Burr and Weibull&lt;/li&gt;&#xA;&lt;li&gt;Mixed normal&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here two papers that cover some of them and others:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://ect-pigorsch.mee.uni-bonn.de/data/research/papers/Financial_Economics,_Fat-tailed_Distributions.pdf&quot;&gt;http://ect-pigorsch.mee.uni-bonn.de/data/research/papers/Financial_Economics,_Fat-tailed_Distributions.pdf&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.rff.org/RFF/Documents/RFF-DP-11-19-REV.pdf&quot;&gt;http://www.rff.org/RFF/Documents/RFF-DP-11-19-REV.pdf&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-02-27T09:58:50.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7395" PostTypeId="1" AcceptedAnswerId="7399" CreationDate="2013-02-28T01:40:54.637" Score="2" ViewCount="1057" Body="&lt;p&gt;I am wondering which method makes more sense when computing log returns. I am trying to compute log returns for realized variance, and I have the opening and closing prices for every minute.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the log return is defined as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_{t+1} = \ln \left(\frac{p_{t+1}}{p_t} \right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;should I take the average of the open and closing prices at every point as use that as $p_t$? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or should I find $r_{t+1}$ at every $t$ by assuming $p_{t+1}$ = closing price and $p_t$ = opening price?&lt;/p&gt;&#xA;" OwnerUserId="4692" LastEditorUserId="467" LastEditDate="2013-02-28T13:20:04.213" LastActivityDate="2013-02-28T13:20:04.213" Title="Logarithmic returns for realized variance?" Tags="&lt;volatility&gt;&lt;return&gt;&lt;log-returns&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7396" PostTypeId="2" ParentId="1937" CreationDate="2013-02-28T09:22:26.377" Score="2" Body="&lt;p&gt;Regarding trading, it depends upon one's style and temperament. Don't rely solely on Aronson's book and his views and a phrase quoted by Andrew Lo in his study. The formula posted by Tal Fishman of Head and Shoulders as quoted by Lo, Mamaysky and Wang (2000) is not exhaustive. There is a lot of scope for further improvement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, there are many studies which have proved that profits can be made trading the patterns. You can read them. They are as follows:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Bulkowski, T.N. (2000) Encyclopedia of Chart Patterns, John Wiley and Sons, NewYork.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Laedermann, S. (2000), “Head-and-Shoulders Accuracies and How to Trade Them.” IFTA Journal, Vol. 2000 Edition, pp 14-21&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Lo, A., Mamaysky, H. and Wang, J. (2000), “Foundations of Technical Analysis: Computational Algorithms, Statistical Inference, and Empirical Implementation.” Journal of Finance, Vol. 55, pp. 1705-1765&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Osler, C. L., and Chang, P. H. K., (1995) “Head and Shoulders: Not Just a Flaky Pattern.” Federal Reserve Bank of New York, Staff Reports, Report No. 4.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="4865" LastEditorUserId="35" LastEditDate="2013-02-28T12:16:42.787" LastActivityDate="2013-02-28T12:16:42.787" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7397" PostTypeId="2" ParentId="7395" CreationDate="2013-02-28T10:06:07.933" Score="0" Body="&lt;p&gt;You should find r at every t by assuming p(t+1) = closing price and p(t) = Last period closing price.&lt;/p&gt;&#xA;" OwnerUserId="4865" LastActivityDate="2013-02-28T10:06:07.933" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7398" PostTypeId="2" ParentId="7395" CreationDate="2013-02-28T12:13:25.957" Score="0" Body="&lt;p&gt;It took me a while to figure-out what you were asking. If I understand you correctly, you have minute-level OHLC market data and you want to compute the returns from this time series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Returns are normally computed close-to-close. Whether you have one-minute bins or you have daily aggregates, you should ignore the opens and just compute returns from one close to the next.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2013-02-28T12:13:25.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7399" PostTypeId="2" ParentId="7395" CreationDate="2013-02-28T13:17:19.643" Score="1" Body="&lt;p&gt;It depends on your investment strategy. The most common approach is to use the close price of $p_t$ and $p_{t+1}$. The volatility you measure using this method implies the &quot;assumption&quot; that your are able to trade at close every day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you choose to compute the daily returns from open to close, then you assume that you are selling your position every night and buying it back every morning: you have no overnight exposure which is unlikely unless you are fairly sophisticated.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2013-02-28T13:17:19.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7400" PostTypeId="1" CreationDate="2013-02-28T15:20:33.513" Score="13" ViewCount="626" Body="&lt;p&gt;I was wondering if those who used the entropy pooling &lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/21307&quot; rel=&quot;noreferrer&quot;&gt;code&lt;/a&gt; provided by Attilio Meucci had issues with the optimization procedure (especially regarding the fminunc function in Matlab). When I stress for example the expectation and the volatility, I get weird results for some stress values &lt;img src=&quot;https://i.stack.imgur.com/gVYyi.png&quot; alt=&quot;Stock price distribution with stress values 100 for expectation and 20 for volatility, prior in blue, posterior in red&quot;&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the following warning:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Local minimum possible:&#xA;fminunc stopped because the final change in function value relative to &#xA;its initial value is less than the selected value of the function tolerance.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can one deal with this ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For information, the image represents a stock price distribution with stress values 100 for expectation and 20 for volatility, prior in blue, posterior in red.&lt;/p&gt;&#xA;" OwnerUserId="3319" LastEditorUserId="467" LastEditDate="2013-03-03T23:06:50.033" LastActivityDate="2013-03-03T23:06:50.033" Title="Optimization procedure for entropy pooling" Tags="&lt;risk&gt;&lt;portfolio-management&gt;&lt;entropy-pooling&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7402" PostTypeId="1" AcceptedAnswerId="7957" CreationDate="2013-03-01T01:52:04.803" Score="25" ViewCount="54653" Body="&lt;p&gt;According to some textbooks, to derive the yield curve, quote &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;overnight to 1 week: rates from interbank money market deposit, &lt;/li&gt;&#xA;&lt;li&gt;1 month to 1 year: LIBOR;&lt;/li&gt;&#xA;&lt;li&gt;1 year to 7 years: Interest Rate Swap;&lt;/li&gt;&#xA;&lt;li&gt;7 years above: government bond.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'm a bit lost here: how can an IRS rate be used to derive yield curve?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yield rate is the discount rate, if $ yield (5 years) = 4.1 \% $ , it means the NPV of 1 dollar 5 years later is $ NPV ( 1 dollar, 5 years) = 1/[(1+4.1\%)^5] = 0.818 $.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While interest rate swap is a contract among to legs. Assume a 5 years' IRS contract is&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;leg A pays fixed rate to B @ 8.5%, while A receives floating rate  @ LIBOR +1.5%&lt;/li&gt;&#xA;&lt;li&gt;leg B pays floating rate to A @ LIBOR +1.5%, B receives fixed rate@ 8.5%.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;, how could this swap contract help deriving the 5 years' yield rate?&lt;/p&gt;&#xA;" OwnerUserId="2161" LastEditorUserId="20795" LastEditDate="2019-09-20T19:15:30.943" LastActivityDate="2019-09-20T19:15:30.943" Title="how to derive yield curve from interest rate swap?" Tags="&lt;interest-rates&gt;&lt;swaps&gt;&lt;yield-curve&gt;&lt;interest-rate-swap&gt;&lt;irs&gt;" AnswerCount="6" CommentCount="2" FavoriteCount="23" ContentLicense="CC BY-SA 3.0" />
  <row Id="7403" PostTypeId="2" ParentId="7402" CreationDate="2013-03-01T06:14:31.480" Score="25" Body="&lt;p&gt;I like to present to you a slightly different approach:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Historically, only one single yield curve was derived from different instruments, such as OIS, deposit rates, or swap rates. However, market practice nowadays is to derive multiple swap curves, optimally one for each rate tenor. This idea goes against the idea of one fully-consistent zero coupon curve, however the last paper I referenced below explains how a Libor Market model can be generalized to account for the new practice of deriving different curves.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Here the original approach: &lt;a href=&quot;http://www.bankofcanada.ca/wp-content/uploads/2010/01/wp00-17.pdf&quot;&gt;http://www.bankofcanada.ca/wp-content/uploads/2010/01/wp00-17.pdf&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Here a paper that introduces a hybrid: &lt;a href=&quot;http://www.fsa.go.jp/frtc/nenpou/2009/07-1.pdf&quot;&gt;http://www.fsa.go.jp/frtc/nenpou/2009/07-1.pdf&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;And here an excellent (I think) paper that explains the generalization of LMM: &lt;a href=&quot;http://www.worldscientific.com/doi/pdf/10.1142/S021902491000570X&quot;&gt;http://www.worldscientific.com/doi/pdf/10.1142/S021902491000570X&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;P.S.: Mercurio is on the rigor level pretty much on par with Carr, Rebonato and other outstanding quants. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-03-01T06:14:31.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7405" PostTypeId="2" ParentId="7402" CreationDate="2013-03-01T10:37:42.973" Score="8" Body="&lt;p&gt;To elaborate on Freddy's answer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These days you need to maintain a separate funding (usually OIS) curve to your Libor* type curves. Once you have this discounting curve, you can calculate from Libor instrument market data what the market estimations of that Libor are: 3m instruments like Interest Rate Futures, IRS with a 3m float leg, 3m FRAs can be used to create the 3m Libor curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To price an instrument, you use your Libor curve to estimate the Libor fixing, and your funding curve to calculate NPV. This way you can calculate the price of a given instrument even though the old assumptions of zero coupon curves are no longer valid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The short answer to the original question is: Swaps are quoted at par, i.e. what fixed coupon rate has a matching present value to the floating coupons. Its level therefore contains information about the quoter's estimates of Libor; if they think it will be higher, they would need a higher fix rate to balance the values of the legs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;* Libor can be replaced with whatever fixing is being used in the market; Euribor etc.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastEditorUserId="1314" LastEditDate="2014-04-10T08:13:12.677" LastActivityDate="2014-04-10T08:13:12.677" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7406" PostTypeId="2" ParentId="7361" CreationDate="2013-03-01T11:30:33.273" Score="3" Body="&lt;p&gt;In case the question is about closing an open position as a retail trader:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose this is a 3y swap, and the holder is paying fixed, receiving float. The fix leg is paying 10%, but the float index is now at 5%, so assuming the index is not expected to change in the future, the position is now significantly out of the money. The main exposure is to the difference between the float leg and the fix leg, because that's the point of a swap, as Freddy said. To back it out, we do either the reverse swap with a different counterparty (pay float, receive fixed) or call the original counterparty and ask for a price to tear up the original swap. As we are out of the money, both of these will cost money; the tear up will cost money now, the swap will cost money in the future (you'll be down the difference between the two fix rates).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the market expects floating rates to rise significantly, then the swap may not be so far out of the money. In that case, you should be able to do the reverse swap for not too much spread between the fix rates, and similarly the tear-up should be cheap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose instead that we are doing arbitrage, and the swap is one we're thinking of buying rather than one we've already bought. To get rid of the floating rate risk on a quarterly swap (fixing on 3m Libor), we would need to buy a series of FRAs or Futures on the appropriate dates. The FRAs will pay out in the future, so we would net the difference between the swap fix rate and the FRA rate. A future will pay or require margin as soon as you buy it, and the account will vary all the way to the contract's effective date. This is the source of the convexity, which we need to adjust for to get the future's embedded rate expectation. But, as Christian points out, swaps these days are collateralised. So assuming standard daily cash collateralisation using the OIS index for interest, we will need to maintain a cash account with the moneyness balance of the swap. The future margin account will be dependent on the volatility of the futures, but the swap collateral account will be dependent only on the swap moneyness, so there is a risk that these will not match. We also need to keep in mind our relative cost of funding compared to OIS; if we are retail, we will get a spread over OIS, which raises the cost of the collateralisation. But I don't know whether retail institutions collateralise in the same way as interbank... if not then it's just back to open counterparty risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another embedded risk in all this is counterparty risk; if the swap counterparty defaults, we will lose the float payments, and will be down the value of a Floating Rate Note if the swap was in the money. If it was out of the money, the counterparty's creditors will demand the value of the swap (or the continued payments), so we don't lose the downside either. Thus we need some kind of default protection; either a deep out of the money put (DOOM options) to cover against the counterparty's value disappearing - good for messy defaults - or a CDS. If we do a second swap to offset the first, we have the same risk of that counterparty defaulting too. And yes, the scenarios where one defaults are correlated with the scenarios where both default. For collateralised swaps, the risk is really down to the day-to-day movements (volatility!) as the collateral accounts will be up to date for the previous day. So the risk again, is dependent on the volatility of the swap's moneyness.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The alternative to all the counterparty risk is to do a cleared swap via a clearing house or a swap future via an exchange. These leave you exposed to the theoretically lower risk that the central counterparty will default. At least multiple trades may net out with a central counterparty. But you're back to a margin account and volatility exposure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As AIG demonstrated, counterparties that sell CDS can also default, and they too are the scenarios where everyone else is more likely to default. But you have to wonder if anything will be sensible if all your counterparties die at once, particularly your CDS vendor. It wasn't sensible in 2008.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short, if you're stuffed on a trade, get a realistic estimate of the costs of reversing it, then call up the original counterparty and tear it up. &lt;/p&gt;&#xA;" OwnerUserId="1314" LastEditorUserId="1314" LastEditDate="2013-03-01T11:40:03.047" LastActivityDate="2013-03-01T11:40:03.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7407" PostTypeId="2" ParentId="7376" CreationDate="2013-03-01T11:51:13.273" Score="2" Body="&lt;p&gt;If there are no call features that Freddy describes, we might be able to approximate an amortizing swap from vanilla par swap rates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A 3m Libor + spread swap should price at roughly the par swap + the spread. An amortising swap is equivalent to a series of overlapping swaps of slightly different lengths. Given all the market data for par swaps, then, we could approximate the value of the float leg using a curve generated with the swaps, from which we price the overlapping mini-coupon floating rate notes.  The sum of their PVs should give the overall PV of the float leg, for which we can find the equivalent fix leg given the fix leg payment schedule. Since the notional for both legs is reducing in step, this should result in a weighted average of the interpolated swap rates, with the weighting defined by the float leg PVs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The success of that method will strongly depend on the shape of your yield curve between the market swap points. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Again, this assumes no optionality. &lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2013-03-01T11:51:13.273" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7408" PostTypeId="1" CreationDate="2013-03-01T21:27:56.903" Score="5" ViewCount="1264" Body="&lt;p&gt;Say I'm building an order book and two bids come in at price $p$ and volumes $v_1$ and $v_2$. Which option is better&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;To store the order as $\{p, v_1+v_2\}$ or&lt;/li&gt;&#xA;&lt;li&gt;To store the order as $\{p,v_1\}$ and $\{p,v_2\}$ and then manually aggregate orders when I need, say, a &lt;code&gt;bestBid&lt;/code&gt; value&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Is there any analytical insight that can be gained from the actual size of the orders? If there is, can you point me to some literature in this field? Thanks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Please note&lt;/em&gt;: there is nothing in the feed to indicate who the order came from and what order has been filled - all I have are the prices and volumes.&lt;/p&gt;&#xA;" OwnerUserId="1217" LastEditorUserId="1217" LastEditDate="2013-03-03T17:40:06.590" LastActivityDate="2013-03-03T17:40:06.590" Title="Is it worth preserving orderbook structure when building it from individual orders?" Tags="&lt;trading&gt;&lt;order-handling&gt;&lt;order&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7409" PostTypeId="2" ParentId="1379" CreationDate="2013-03-01T21:30:30.353" Score="2" Body="&lt;p&gt;I would actually not bother with F# data structures for this - many of them are actually &lt;em&gt;slower&lt;/em&gt; than ordinary .NET collections. My approach is to use &lt;code&gt;SortedDictionary&amp;lt;price,volume&amp;gt;&lt;/code&gt; for bids and asks. That way, you always know the best prices on the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, the above assumes that you're not concerned with thread safety and are building the order book on the same thread, which is generally a sensible assumption.&lt;/p&gt;&#xA;" OwnerUserId="1217" LastActivityDate="2013-03-01T21:30:30.353" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7410" PostTypeId="1" CreationDate="2013-03-02T01:50:31.197" Score="2" ViewCount="818" Body="&lt;p&gt;I am trying to find a good book which focuses on the model calibration. I just want to know generally, what are the most common methods of model calibration(such as Black-Scholes Model, Stochastic Volatility Model(Heston), Jump-Diffusion Model, Hull-White Model and so on, all the models which are at a master level of Mathematical finance program)? But it seems all mathematical finance books didn't discuss a lot about the model calibration, is there a good book/paper on model calibration?&lt;/p&gt;&#xA;" OwnerUserId="4601" LastEditorUserId="4601" LastEditDate="2013-03-02T07:27:27.393" LastActivityDate="2013-03-02T11:33:29.380" Title="Good Model Calibration Books/Papers for Common Option Pricing Models" Tags="&lt;option-pricing&gt;&lt;models&gt;&lt;calibration&gt;&lt;books&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7412" PostTypeId="2" ParentId="7408" CreationDate="2013-03-02T09:20:04.150" Score="2" Body="&lt;p&gt;I have never implemented an order book, but I don't see immediate benefits from this aggregation. If you merge the volumes, then during the actual execution you'll have additionally to take into account that these orders came from different market participants. This seems to add additional complexity to your implementation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the point of view of market liquidity measures it makes a difference if you have one large order of volume $v$ or many small orders with total volume $v$. &lt;/p&gt;&#xA;" OwnerUserId="370" LastActivityDate="2013-03-02T09:20:04.150" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7413" PostTypeId="2" ParentId="7410" CreationDate="2013-03-02T11:33:29.380" Score="3" Body="&lt;p&gt;&lt;a href=&quot;http://www.amazon.de/The-Volatility-Surface-Practitioners-Finance/dp/0471792519/ref=sr_1_1?ie=UTF8&amp;amp;qid=1362223742&amp;amp;sr=8-1&quot; rel=&quot;nofollow&quot; title=&quot;Volatility Surface&quot;&gt;Jim Gatherals Book&lt;/a&gt; deals with the models you mention and gives an intuitive understanding about calibration and issues that arise. Mostly basic stuff, but very useful if you're just starting out. Also very understandable without an extensive math background.&lt;/p&gt;&#xA;" OwnerUserId="1976" LastActivityDate="2013-03-02T11:33:29.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7414" PostTypeId="2" ParentId="7408" CreationDate="2013-03-03T01:34:16.447" Score="8" Body="&lt;p&gt;The &quot;correct&quot; way is the way best suited to your trading. Regardless as to your data structure of choice, you have to maintain a list of all orders active on your book. That's because subsequent messages reference Order ID and you have to look up the corresponding order to determine the price level being acted upon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given that you have to maintain a reference of all orders and their properties, it makes sense to not aggregate until you need to (at the api level).&lt;/p&gt;&#xA;" OwnerUserId="1355" LastEditorUserId="35" LastEditDate="2013-03-03T02:07:32.440" LastActivityDate="2013-03-03T02:07:32.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7415" PostTypeId="2" ParentId="7408" CreationDate="2013-03-03T02:21:10.690" Score="5" Body="&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/a/7414/35&quot;&gt;Louis's answer&lt;/a&gt; hints at the problem. Most market-data feed formats only use the order's &lt;em&gt;reference ID&lt;/em&gt; for cancel, replace, or execute; they do not list the symbol or side. So you'll need a way to look-up the particular order by ID alone just to make adjustments. You can aggregate by price if your application requires it, but just know that the &quot;level book&quot; will be a separate container from the order book.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;new order 1: buy IBM $202.91 100 shares&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;new order 2: buy IBM $202.91 200 shares&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;new order 3: buy IBM $202.91 100 shares&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;cancel 2&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;execute 1&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The only way to know that 100 shares are remaining is if you had stored the orders separately.&lt;/p&gt;&#xA;" OwnerUserId="35" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2013-03-03T02:21:10.690" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="7417" PostTypeId="2" ParentId="303" CreationDate="2013-03-03T11:13:19.807" Score="4" Body="&lt;p&gt;I've worked in about 10 financial institutions over my career. 6 top tier banks in the front office building low latency trading platforms. F# is rare, these places are huge so I cant say I've seen every team but where I've seen it be used (twice) the project has been dire. This was &lt;a href=&quot;http://blog.oxfordknight.com/?p=269&quot; rel=&quot;nofollow&quot;&gt;a decent overview&lt;/a&gt; from an experienced city recruiter.&lt;/p&gt;&#xA;" OwnerUserId="4882" LastEditorUserId="-1" LastEditDate="2013-03-03T19:40:30.080" LastActivityDate="2013-03-03T19:40:30.080" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7418" PostTypeId="1" AcceptedAnswerId="7419" CreationDate="2013-03-03T15:31:07.900" Score="0" ViewCount="280" Body="&lt;p&gt;assume I have implied FX volatility Delta-Term table from broker. I have time noticed as 2M, 3M. what do I have to put into BS formula, is it 2/12 or &quot;count the business days&quot;/&quot;daycount basis&quot;?&#xA;I am confused with the notion of time.&lt;/p&gt;&#xA;" OwnerUserId="2017" LastEditorUserId="2017" LastEditDate="2013-03-03T15:43:04.487" LastActivityDate="2013-03-03T15:54:21.373" Title="volatility Table and BS formula" Tags="&lt;volatility&gt;&lt;black-scholes&gt;&lt;implied-volatility&gt;&lt;fx&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7419" PostTypeId="2" ParentId="7418" CreationDate="2013-03-03T15:54:21.373" Score="2" Body="&lt;p&gt;Its 2months and 3 months, respectively, adjusted for banking holidays that may fall on the sought after day and the local convention of whether you then move to the next or previous business day. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-03-03T15:54:21.373" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7421" PostTypeId="1" CreationDate="2013-03-03T20:33:38.130" Score="3" ViewCount="841" Body="&lt;p&gt;Can I use DOM information from Interactive Brokers? Does it make sense? &#xA;I assume that it makes sense to apply some volume based algorithms only then when you know this order book, that you can get info about is really market book.  If it represents the main part of the market, otherwise this information is negligible in front of all big names doing trading and in light of their orders which you are not aware of.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What information gives me volume info from IB? Can I make assumption about FX order flow based on their data feed?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can see &lt;a href=&quot;http://www.interactivebrokers.com/en/?f=%2Fen%2Fgeneral%2Fwhyib%2FPDF-GlobalOfferings.php#america&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; that IB covers all important exchanges, but what is their volume? The sum of the all noticed volumes on exchanges? Please could you clarify this issue a little as it was always confusing to me.&lt;/p&gt;&#xA;" OwnerUserId="2017" LastEditorUserId="2017" LastEditDate="2013-04-04T20:54:11.720" LastActivityDate="2013-05-04T21:05:57.363" Title="Does DOM trading using broker data make any sense?" Tags="&lt;fx&gt;&lt;limit-order-book&gt;&lt;interactive-brokers&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7422" PostTypeId="1" AcceptedAnswerId="7424" CreationDate="2013-03-03T23:35:40.420" Score="6" ViewCount="2223" Body="&lt;p&gt;I believe that one of the most compelling case of long-term trade is the long position on oil. Fundamentally, it seems quite clear that demands is going to grow in the future as emerging markets start using more and more energy, whereas supply is likely to be limited as the resource are vanishing or at least are more expensive to extract.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am aware that the oil prices are fluctuating a lot and that now might not be a good time to enter the trade, but my question is more abstract. Assume that oil reaches a price that can be considered interesting to get in. I assume I want to make a long-term trade, i.e. over 5 to 10 years. I can see essentially 3 possibilities:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Buy physical oil and store it&lt;/li&gt;&#xA;&lt;li&gt;Buy oil futures and carry it&lt;/li&gt;&#xA;&lt;li&gt;Buy oil firms' stocks&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The first alternative is costly and requires quite an infrastructure for storage. The seconds will suffer from the contango situation and the cost of rolling. The third one suffers from the equity risk of the underlying firms which is not related to the oil prices per say.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there another implementation I didn't think about which could be a good way to get exposure to energy prices.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2016-01-24T04:20:02.797" Title="How to implement a long-term trade on oil?" Tags="&lt;trading&gt;&lt;commodities&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7423" PostTypeId="2" ParentId="7422" CreationDate="2013-03-04T00:51:02.013" Score="4" Body="&lt;p&gt;What about a total return swap on the price of oil? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, search for things with a high correlation or cointegrated with oil and check what risks you would take on compared to physically holding oil and see how you can minimize them. For instance, in the oil stocks case, you could short equity futures to only take energy stock risk instead of general equity risk. There are some currencies that are correlated with oil, but it is rather indirect. Alternately, you could create a basket that is correlated with oil and try to minimize the non-oil risks of the basket. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could also consider an options strategy. If you think oil will be significantly higher, then you could use a knock-in call to reduce the initial cost. Then again, you will also face risks with an option strategy.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2013-03-04T00:51:02.013" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7424" PostTypeId="2" ParentId="7422" CreationDate="2013-03-04T00:55:59.297" Score="5" Body="&lt;p&gt;If I may share some wisdom that was passed to me and that I insisted I test empirically and through painful lessons learned to take seriously and trust in:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;There is nothing that is guaranteed in life (aside us all having to die). You already sound like you made up your mind on the long side of the oil trade. Have you considered that not the demand for oil of emerging markets will be the biggest variable int his equation but substitute products. The U.S. may well be energy sufficient in a couple years, fully independent off Saudi oil. Then there is other energy sources that may push oil well into the teens or 20s in 10 year's time. I am just urging you to consider that. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And here to your points: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) It has been a very profitable trade for some of the large trading houses, so profitable that Goldman, MS, and other banks setup whole department to charter tankers simply to hold oil and leisurely cruise around betting on higher oil prices. But yes this is not a one-man show. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Forget that for anything other than trading short-term. Look at the curve 1-2 years out and I think we agree. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) This I think is your best bet and the precise reason guys like Paulson bought gold companies (well lets not talk about his most recent blunders). It allows to trade in size and allows to get involved without the infrastructure required to hold the physicals. You can always strip out the equity component through an index hedge, and I think as long as you reasonably diversify you should be sufficiently insulated from unsystematic risk as well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In summary, to go long oil as part of a longer-term trade I do not see a way around  buying oil exploration companies or equities with price return profiles that are highly correlated to spot oil price returns. Most all derivatives and ETFs are adjusted for the price of hedging future cash flows through forwards or futures. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-03-04T14:16:51.983" LastActivityDate="2013-03-04T14:16:51.983" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7425" PostTypeId="1" CreationDate="2013-03-04T01:40:34.297" Score="4" ViewCount="528" Body="&lt;p&gt;I am attempting to model a cumulative time-series of a positive integer variable across independent entities. The cumulative series appears to follow a process of Geometric Brownian Motion (GBM) based on lognormal distributions seen cross-sectionally at each time point. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The standard treatments and estimation methods for GBM drift ($m$) and diffusion ($s$) coefficients are based upon a specification where the random variation at each time point comes from a Wiener process $W(t)$ with normally distributed increments of zero mean:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dX(t) = m X(t) dt + s X(t) dW(t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my problem, this cannot apply since X(t) is a cumulative sum of positive numbers. Random increments can be positive or zero only, and the mean will be non-zero and positive. A normal distribution truncated below 0 appears to be appropriate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone point me to a treatment and estimation approach for this type of problem? I believe the standard estimation methods do not apply here.&lt;/p&gt;&#xA;" OwnerUserId="4888" LastEditorUserId="467" LastEditDate="2013-03-04T13:26:53.333" LastActivityDate="2017-10-29T13:17:08.967" Title="Geometric Brownian Motion with non-negative random increments" Tags="&lt;sde&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7426" PostTypeId="2" ParentId="7425" CreationDate="2013-03-04T06:22:41.863" Score="1" Body="&lt;p&gt;Are you sure that you do not need a Poisson Process (see for instance &lt;a href=&quot;http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-262-discrete-stochastic-processes-spring-2011/course-notes/MIT6_262S11_chap02.pdf&quot; rel=&quot;nofollow&quot;&gt;a course about them&lt;/a&gt;)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Poisson processes are commonly used to model the sum of arrival times. They are very useful to model high frequency data (arrivale rates of buy / sell orders). You can couple several Poisson processes using Hawkes processes (see &lt;a href=&quot;http://arxiv.org/abs/1101.3422&quot; rel=&quot;nofollow&quot;&gt;Modeling microstructure noise with mutually exciting point processes&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2013-03-04T06:22:41.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7427" PostTypeId="2" ParentId="7425" CreationDate="2013-03-04T08:08:24.530" Score="2" Body="&lt;p&gt;I think the notion of a &lt;a href=&quot;http://en.wikipedia.org/wiki/L%C3%A9vy_process&quot; rel=&quot;nofollow&quot;&gt;Lévy process&lt;/a&gt; fits for your problem. Lévy processes with only positive increments are called &lt;a href=&quot;http://galton.uchicago.edu/~lalley/Courses/385/LevyProcesses.pdf&quot; rel=&quot;nofollow&quot;&gt;Lévy subordinators&lt;/a&gt;. Poisson processes as lehalle proposes are a subclass of these. Compound Poisson processes are an easy generalization of Poisson processes, they have only positive increments if you assume that the &quot;2nd&quot; distribtion (jump size) is non-negative. I can provide details but you find good sources online too.&#xA;EDIT: I just read positive integer. Then only compound poisson with integer valued jumps size distribution works ... (e.g. Negative Binomial).&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2013-03-04T09:34:37.770" LastActivityDate="2013-03-04T09:34:37.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7429" PostTypeId="1" CreationDate="2013-03-04T11:21:58.337" Score="8" ViewCount="404" Body="&lt;p&gt;I am trying to use the EMD applied to EURUSD open price to train a machine learning algo (RVM).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have run only once the EMD on my training set and once on the training+test set.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The results on the test sets only are quite good. However when I apply the algo on the last sample only the predictions are bad.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Shall I run the EMD on each sample of my training set using a sliding window ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand EMD is non-causal, but can it be used in some ways for training a machine learning algo ?&lt;/p&gt;&#xA;" OwnerUserId="3181" LastEditorUserId="467" LastEditDate="2013-03-04T13:24:51.027" LastActivityDate="2014-04-18T18:35:14.833" Title="How to perform Empirical Mode Decomposition?" Tags="&lt;fx&gt;&lt;machine-learning&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7430" PostTypeId="1" CreationDate="2013-03-04T13:03:45.523" Score="12" ViewCount="402" Body="&lt;p&gt;In the paper &quot;&lt;a href=&quot;http://forum.johnson.cornell.edu/faculty/jarrow/109%20wp.pdf&quot;&gt;Liquidity Risk and Risk Measure Computation&lt;/a&gt;&quot; authors describe a linear supply curve model for liquidity risks in presence of market &#xA;impact, i.e. impact-affected asset price $S(t,x)$ is proportional to unaffceted price $S(t,0)$ and to traded volume $x$ with some coefficient $\alpha$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under the diffusion (with constant drift $\mu$ and volatility $\sigma$) assumption for unaffected price process, the model parameter $\alpha$ is estimated through the regression on returns (see (9)): &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\log\left(\frac{S(t_2,x_{t_2})}{S(t_1,x_{t_1})}\right) \simeq \int_{t_1}^{t_2}(\mu-\frac{1}{2}\sigma^2)dt + \int_{t_1}^{t_2}\sigma dW_t + \alpha(x_{t_2}-x_{t_1})$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a couple of basic questions that comes up regarding this regression:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Should one use the signed values for the buy/sell volumes $x_{t_1}$ and $x_{t_2}$? In the section 2 of the article this is mentioned, however the regression on $x_{t_2}-x_{t_1}$ seems to be complicated in some cases. For example, if there are only buy trades of the same size or when one has only external trades data with no indication of buy/sell available.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How should we treat $\int_{t_1}^{t_2}(\mu-\frac{1}{2}\sigma^2)dt$ term? Should we estimate it in the same regression or estimate it separately using unaffected price time series $S(t,0)$? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is it fine to use intraday data throughout a certain period for this regression (e.g. shouldn't one try to account for price jumps between trading days)?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="370" LastEditorUserId="3015" LastEditDate="2013-03-04T15:14:12.883" LastActivityDate="2015-05-09T11:29:52.267" Title="Regression in liquidity risk model of Jarrow/Protter" Tags="&lt;risk-management&gt;&lt;regression&gt;&lt;liquidity-risk&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7431" PostTypeId="1" AcceptedAnswerId="7432" CreationDate="2013-03-04T14:29:13.830" Score="1" ViewCount="424" Body="&lt;p&gt;assume I have following delta-term vol data from broker:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Spot 3.4550&#xA;                 O/N      1WK      2WK      3WK      1M       6WK      2M&#xA;Volatility       7.544    7.7      7.731    7.911    8.025    8.18     8.4&#xA;Forward Points   0.0004   0.0021   0.0045   0.0063   0.0079   0.0106   0.0164&#xA;EUR Depo Rate    0.405    1.205    1.145    1.128    1.1      1.11     1.13&#xA;PLN Depo Rate    4.216    5.028    4.586    4.187    3.558    3.58     3.626&#xA;Butterfly        0.157    0.19     0.229    0.268    0.34     0.368    0.44&#xA;RiskReversal     0.35     0.45     0.567    0.683    0.9      0.983    1.2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is this for sure that $f=S+Forward Points$ so&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$f_{ON}=3.4550+ 0.0004=3.4554$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$f_{1M}=3.4550+ 0.0079=3.4629$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and so on, &lt;strong&gt;regardless&lt;/strong&gt; delta quoting convensions and ATM convensions&lt;/p&gt;&#xA;" OwnerUserId="2017" LastEditorUserId="2017" LastEditDate="2013-03-04T20:29:43.953" LastActivityDate="2013-03-04T20:29:43.953" Title="compute FX forward from broker's data" Tags="&lt;volatility&gt;&lt;fx&gt;&lt;forward&gt;&lt;delta&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7432" PostTypeId="2" ParentId="7431" CreationDate="2013-03-04T15:23:42.750" Score="3" Body="&lt;p&gt;If you're asking what the &lt;strong&gt;FX Outright&lt;/strong&gt; for 1M EUR/PLN is, given that table, then yes the answer is just outright = spot + fwd points, which is 3.4550 + 0.0079 = 3.4629 (you had the wrong column for your 1M value).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually fwd points are quoted directly (i.e. not as an outright), using a divisor set by market convention. I expect EUR/PLN divisor to be 10,000, so that would be quoted as 79 pts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So no, you don't need any of the rest of the data in the table.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2013-03-04T15:23:42.750" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7436" PostTypeId="2" ParentId="7350" CreationDate="2013-03-04T18:35:56.557" Score="1" Body="&lt;p&gt;@pyCthon's comment hit home.  So I did some tests.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I compared a parametric computation to a Monte Carlo computation of IR Vol for a small set of fixed income securities.  I was particularly concerned whether I could identify factors that would indicate that the difference would exceed 10% of the MC result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's are my summary findings:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Vanilla IR Swaps (3) - difference ranged from 16% to 40% across my sample&lt;/li&gt;&#xA;&lt;li&gt;Convertible Bonds (2) - FUGIT &gt; 7 corresponding to an IR Var difference &gt; 500%, FUGIT &amp;lt; 1 corresponded to a difference of &amp;lt; 1% -- however sample size of 2 bonds is too small to generalize &lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Swaptions (3) - difference ranged from 3.1% to 0.3% -- the small magnitude and lack of variation in the % difference for these securities is unexplained.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Non-callable Bonds (8) - This was the most interesting finding.  Three of the holdings had a % difference below 7% while the percentage difference of the other five ranged from 36% to 77% -- After examining various factors (duration, dv01, convexity, theta, years to maturity, etc.) I was finally able to predict and rank the percentage difference by comparing the scaled weighted average term vol(2) used in the parametric IR Vol calculation. When the scaled avg vol was below 1, the percentage difference was below 10%, and the percentage difference increased with increasing scaled avg vol.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(1) FUGIT: Expected life of a convertible bond in years&lt;br&gt;&#xA;(2) scaled weighted average term vol computed as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sum{(vol * dv01 * rate)} \frac {Median_{WeightedVols} }{ Range_{WeightedVols}}$$&lt;/p&gt;&#xA;" OwnerUserId="3365" LastActivityDate="2013-03-04T18:35:56.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7437" PostTypeId="2" ParentId="7422" CreationDate="2013-03-04T19:33:59.923" Score="5" Body="&lt;p&gt;My answer is to go with option 2, but go long the long-dated contracts.  Looking at the forward curve for WTI crude, one can buy crude, say, for 5 years out at $83 per barrel.  Not only you can avoid the monthly rolls, you can take advantage of the current medium-term/long-term backwardation in crude.&lt;/p&gt;&#xA;" OwnerUserId="3188" LastActivityDate="2013-03-04T19:33:59.923" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7439" PostTypeId="2" ParentId="3449" CreationDate="2013-03-04T20:52:40.657" Score="2" Body="&lt;p&gt;&lt;a href=&quot;http://www.math.utexas.edu/users/jjames/MatLabCode/Lecture_notes_2008d.pdf&quot; rel=&quot;nofollow&quot;&gt;This note&lt;/a&gt; may be helpful you. Especially, chapter 4 in the note covered the FFT method for option pricing, the author also gave the algorithm and MATLAB code.&lt;/p&gt;&#xA;" OwnerUserId="4601" LastEditorUserId="35" LastEditDate="2013-03-04T21:17:22.890" LastActivityDate="2013-03-04T21:17:22.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7440" PostTypeId="1" CreationDate="2013-03-04T21:04:13.963" Score="5" ViewCount="318" Body="&lt;p&gt;does anyone know for sure what is the FX market convension to quote delta-term pairs for EUR/PLN, for EUR/USD. I know that for EUR/PLN it should be delta p.a forward, for EUR/USD it should be delta spot to 1y and delta fwd from 1y ahead.&#xA;but I am not sure from my results, particularly for EUR/PLN pair.&lt;/p&gt;&#xA;" OwnerUserId="2017" LastActivityDate="2013-03-04T21:04:13.963" Title="EUR/PLN and EUR/USD delta-term-vol surface quoting convension" Tags="&lt;volatility&gt;&lt;fx&gt;&lt;forward&gt;&lt;delta&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7441" PostTypeId="2" ParentId="103" CreationDate="2013-03-05T00:33:10.800" Score="3" Body="&lt;p&gt;I like this point of view on risk neutral pricing:&#xA;risk neutral probability $q$ is such a probability that the expected possible price of the option at $t=T$ calculated with this probability and then discounted gives you today price at $t=t_0$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;it is derived from today price &lt;strong&gt;under the assumption&lt;/strong&gt; that all the time holding portfolio of option(buy) and instrument(sell) you are delta hedged, so it's value is known and the same in each case (rise, fall).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;other nice view is: &#xA;future price of the option (expected with risk free rate) is equal to it's expected value, i.e if today price is $V$ and option price tomorrow might be $V^+$or $V^-$ and risk free rate is $r$ then you can retrieve $q$ from this equation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(1+rdt)V=qV^++(1-q)V^-$&lt;/p&gt;&#xA;" OwnerUserId="2017" LastActivityDate="2013-03-05T00:33:10.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7442" PostTypeId="2" ParentId="3449" CreationDate="2013-03-05T00:54:03.660" Score="1" Body="&lt;p&gt;This is public knowledge what you need is a good book on how option strategies are built and used...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Heres some good starting points/books in which you can get a good framework to start building and applying your FFT option pricing method of choice&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0471792519&quot; rel=&quot;nofollow&quot;&gt;The volatility surface&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0132777428&quot; rel=&quot;nofollow&quot;&gt;Options futures and other Derivatives&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/155738486X&quot; rel=&quot;nofollow&quot;&gt;Options Volatility and Pricing&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1764" LastActivityDate="2013-03-05T00:54:03.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7443" PostTypeId="2" ParentId="1937" CreationDate="2013-03-05T09:48:27.480" Score="1" Body="&lt;p&gt;Well pattern recognition and image processing is so developed these days. This is cutting edge in CS now and if we could identify cancer or brain tumor on a hazy image or a suspect face on an industry cam then recognizing head and shoulders on a chart is really really easy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Support Vector Machines or entropy come to mind but there is a myriad of technologies and they are easily available and so is the processing power for the job.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However there is a big leap between recognizing the pattern and using it as a base for successful trading. You could put a lot of effort and computer power (mind the CO2 it generates) into vain. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Very educational approach though. At least for me it was.&lt;/p&gt;&#xA;" OwnerUserId="2900" LastActivityDate="2013-03-05T09:48:27.480" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7444" PostTypeId="2" ParentId="4174" CreationDate="2013-03-05T21:43:23.600" Score="2" Body="&lt;p&gt;The best book concerning statistical validation of objective technical indicators would be David Aronson's highly acclaimed &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470008741&quot; rel=&quot;nofollow&quot;&gt;Evidence-Based Technical Analysis&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While the first quarter of the book is spent establishing the distinction between chart eye-ballers and objective verifiable TA, the latter portion of the book is an absolute goldmine as it starts off with the basics of statistical inference and then covers the monte-carlo permutation method and bootstrap tests extensively. In the end, numerous technical indicators were tested on the S&amp;amp;P and none of them exhibited statistically significant predictive power, although the author did mention that combinations of such indicators could be lucrative. &lt;/p&gt;&#xA;" OwnerUserId="2851" LastEditorUserId="35" LastEditDate="2013-03-05T22:16:58.813" LastActivityDate="2013-03-05T22:16:58.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7445" PostTypeId="1" AcceptedAnswerId="7514" CreationDate="2013-03-05T21:59:32.937" Score="9" ViewCount="6349" Body="&lt;p&gt;Algorithmic trading involves the use of algorithms to optimally execute trading instructions. Then there are algorithms which initiate trades, based on various quantitative strategies (e.g. pairs trading).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the impression that &quot;algorithmic trading&quot; (or automated trading) is often used for both types of algorithms, although they're very different. They can be used exclusively (a human executes the trading instruction of an algorithm, or a human manually inputs a trade which the trading algorithm executes) or together sequentially (the latter algorithm submits trades to the former, which executes them). So how do we distinguish these two types of algorithms?&lt;/p&gt;&#xA;" OwnerUserId="2165" LastEditorUserId="2183" LastEditDate="2017-06-05T10:00:01.643" LastActivityDate="2017-06-05T10:00:01.643" Title="How to distinguish between different types of algorithmic trading" Tags="&lt;quant-trading-strategies&gt;&lt;trading&gt;&lt;automated-trading&gt;&lt;algorithmic-trading&gt;&lt;terminology&gt;" AnswerCount="3" CommentCount="5" FavoriteCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="7446" PostTypeId="1" AcceptedAnswerId="7447" CreationDate="2013-03-06T07:14:54.707" Score="2" ViewCount="105" Body="&lt;p&gt;Housing loan market vibrates according to the policies, such as&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;LTV rate, for example, if must pay 20% downpayment, LTV rate would be 80%&lt;/li&gt;&#xA;&lt;li&gt;interest rate, for example, lifting the loan rate, the market shall shrink&lt;/li&gt;&#xA;&lt;li&gt;loan tenor, for example, if a new policy limits Housing loan to 10 years, the market will change drastically&lt;/li&gt;&#xA;&lt;li&gt;I assume GDP growth rate, house pricing rate, and inflation rate also play a role here.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;How to set up a model to estimate the housing loan market?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be more complex, if policies set differenet set of limits on LTV rate, loan rate, loan tenor, for a family's first, 2nd, and 3rd real estate, is it possible to also cover the structure change?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's a big topic, I hope someone with the experience could suggest where could I start, for example some proven industry model, or some book that summarized the relative models.&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2013-03-06T08:13:45.347" Title="How to model housing loan market?" Tags="&lt;modeling&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7447" PostTypeId="2" ParentId="7446" CreationDate="2013-03-06T08:13:45.347" Score="2" Body="&lt;p&gt;This is an incredibly broad question, there are tons of different schools of thought, and each housing market reacts differently to various different unions of fundamentals. Also, the type of housing market makes a huge difference, single detached housing vs. multi story apartment complexes,...Every investment bank's research dept. applies different set of tools and this is just a subset of all those who attempt to model housing. But here maybe couple starting points to ponder about:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A broad and very basic introduction by the Fed S.F.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.frbsf.org/publications/economics/letter/2004/el2004-27.html&quot; rel=&quot;nofollow&quot;&gt;http://www.frbsf.org/publications/economics/letter/2004/el2004-27.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And a collection of papers that look at different fundamentals and apply different models:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://epress.lib.uts.edu.au/research/bitstream/handle/10453/11272/2006009456.pdf?sequence=1&quot; rel=&quot;nofollow&quot;&gt;http://epress.lib.uts.edu.au/research/bitstream/handle/10453/11272/2006009456.pdf?sequence=1&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://urbanpolicy.berkeley.edu/pdf/HQ_JORS06.pdf&quot; rel=&quot;nofollow&quot;&gt;http://urbanpolicy.berkeley.edu/pdf/HQ_JORS06.pdf&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://sgfm.elcorteingles.es/SGFM/FRA/recursos/doc/Actos/2005/1451259986_3152007194545.pdf&quot; rel=&quot;nofollow&quot;&gt;http://sgfm.elcorteingles.es/SGFM/FRA/recursos/doc/Actos/2005/1451259986_3152007194545.pdf&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You should be able to find a lot more if you dig a little deeper. But from how you worded the question I got the impression you are better off looking at the bare basics first, in that case I recommend a read through the Fed paper as starting point. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-03-06T08:13:45.347" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7448" PostTypeId="1" AcceptedAnswerId="7449" CreationDate="2013-03-06T09:35:23.203" Score="6" ViewCount="1103" Body="&lt;p&gt;I had a discussion recently about the stability of volatilities and correlations. If we take for example stocks and bonds (think of DAX and Bund) then I have seen changing volatilities (something like $30\%-15\%$ vola pa. for DAX) in the last years but a consistently strong negative correlation around $-0.5$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Commercial risk management systems use different half-lives in their weighting schemes reflecting quicker changes in vola and more stability in correlations. This is my feeling for periods like one or two years too. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A consultant told me yesterday that he thinks the other way around and that for him volatility is quite stable (say $30\%$ for stocks) and correlations change a lot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although this must depend on the horizon that you observe I strongly disagree and see the stability of correlations higher than the stability of volas. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which view is more appropriate for a $1-2$ years horizon and what for longer terms?&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2013-03-06T13:10:09.967" Title="Stability of correlations and volatility" Tags="&lt;volatility&gt;&lt;correlation&gt;&lt;risk-management&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7449" PostTypeId="2" ParentId="7448" CreationDate="2013-03-06T10:32:55.733" Score="6" Body="&lt;p&gt;I would entirely separate the investigation and analysis of volatility and correlation between two asset classes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Think of it this way: If volatility is extremely high then high fluctuation to both, the up and down side will contribute to the stability of high volatility. However, for correlations it makes a big difference whether the large move has been to the up or down side especially the co-variation between, lets say, Dax and Bunds. The opposite holds true as well: If return volatility suddenly decreases then that has obviously a strong impact on your realized volatility measure, but it may not affect correlations at all as long as the covariation is in line with your current realized measure. Neither levels nor historical volatility-correlation patterns have any bearing whatsoever on future relationships between volatility and correlation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way annualized vols for Dax were more in the region 12%-40% over the last couple years. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In summary, its entirely by chance that you observe certain patterns of stability or fluctuation in either volatility or correlation measures but what is not by chance is the ever changing and unpredictable relationships between volatility and correlations. Only when markets as a whole are stressed through exogenous events does one observe the general pattern of higher volatility and higher correlations but that generally applies to assets within the same asset class. The opaque relationship between volatility and correlations was further evidenced in late 2008 when one could pick up dispersion structures for cents on the dollar from exotic desks who attempted to clean up the books before they were entirely dismantled and everyone fired. Not that such structures were a great trade, in fact dispersion decreased further into Q1 2009.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example: Look at how gold traded in 2008. Every last sell-side analyst in the world predicted staggering gold prices due to the flight to safety and tangible assets. Remember, even money market funds were under assault, even your paper currency under the mattress was getting devalued. And what happened? Gold was massively dumped because of hedge fund liquidations. I know a lot of volatility desks that have been long-term profitable. But to be very honest with you, I hardly ever saw a correlation desk that survived for longer than 5 years. If history has taught me personally one thing then it is that I would not bet a single coin on correlation predictions, at least a lot less than what I at times wager on direction and/or volatility. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-03-06T13:10:09.967" LastActivityDate="2013-03-06T13:10:09.967" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7450" PostTypeId="2" ParentId="7445" CreationDate="2013-03-06T14:08:29.597" Score="0" Body="&lt;p&gt;The two types you mention are not necessarily mutually exclusive, but you can take a relatively short horizon, and check if the algo consistently makes money. If it does it's the second type, if not, it is more likely to be of the first kind.&lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2013-03-06T14:08:29.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7451" PostTypeId="2" ParentId="7445" CreationDate="2013-03-06T14:53:48.443" Score="2" Body="&lt;p&gt;The broker algorithms or the trading algorithms are designed to the optimal execution of large amounts of stocks with different benchmarks (e.g. VWAP, PoV, Implementation Shortfall or Slippage, Price Inline, TWAP, DWAP, etc.). These algorithms sometimes uses statistical methods and market microstructure analysis (to analyse spreads, volume, seasonality, supply/demand).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The quantitative strategies are also algorithms, but these algos uses historical data and intradaily data to take decisions of what to invest? and when to invest? These algos send us signals of buy or sell, and we can execute them with our trading algorithms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my experience I think that the algorithmic trading help us to lose less money when we execute, and the quantitaive strategies algorithms help use to take the &quot;correct&quot; decision of what do we buy or sell and when to execute the order.&lt;/p&gt;&#xA;" OwnerUserId="4701" LastActivityDate="2013-03-06T14:53:48.443" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7452" PostTypeId="1" AcceptedAnswerId="7459" CreationDate="2013-03-06T15:29:48.260" Score="3" ViewCount="247" Body="&lt;p&gt;To compare two risky portfolios, Mean-Variance (M-V) portfolios for example, many compare their Cash Equivalent ($CE$). $CE$ is defined as the amount of cash that provides the same utility as the risky portfolio: &#xA;$$U\left(CE\right)= W\left(w\right)= w'\mu-\frac{1}{2}\lambda w'\Sigma w$$&#xA;where $W(x)$ is the investor's expected utility of wealth, and basically the function to be maximized in the M-V portfolio problem. My question is why not just limit the comparison on expected utilities of the investor $W(w)$. What is the advantages behind comparing $CE$. Thank you.  &lt;/p&gt;&#xA;" OwnerUserId="3248" LastEditorUserId="3248" LastEditDate="2013-03-06T17:28:05.320" LastActivityDate="2013-03-08T10:31:35.503" Title="Comparing Cash Equivalent of risky portfolios" Tags="&lt;modern-portfolio-theory&gt;&lt;portfolio-selection&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7453" PostTypeId="2" ParentId="352" CreationDate="2013-03-06T21:03:46.053" Score="1" Body="&lt;p&gt;Here you have a example &quot;applying Volatility Pumping to real stock market&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://parrondoparadox.blogspot.com.es/2011/02/parrondos-paradox-stock-market.html&quot; rel=&quot;nofollow&quot;&gt;http://parrondoparadox.blogspot.com.es/2011/02/parrondos-paradox-stock-market.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="4911" LastEditorUserId="4911" LastEditDate="2013-03-06T21:14:16.177" LastActivityDate="2013-03-06T21:14:16.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7455" PostTypeId="1" CreationDate="2013-03-07T02:07:08.537" Score="4" ViewCount="804" Body="&lt;p&gt;Apologies if this is an overly simple question. I have a series of stock returns, and I would like to estimate my portfolio's ex-ante tracking error versus the benchmark (S&amp;amp;P 500) given the current relative weights and historical returns. However, for many of the stocks there are very few returns (&amp;lt;36 weeks).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the industry standard for dealing with mismatching data when estimating portfolio volatility or tracking error? Is it commonly accepted practice  to use a shrinkage estimator (as in Ledoit and Wolf)  on a covariance matrix estimated using all available data points? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I  have 180 weekly returns for the vast majority of the stocks. But, the portfolio's largest relative positions are in stocks that have very little data (FB, LNKD, GRPN).&lt;/p&gt;&#xA;" OwnerUserId="4914" LastActivityDate="2013-03-07T03:05:55.373" Title="How to calculate tracking error given mismatches in available data" Tags="&lt;covariance&gt;&lt;estimation&gt;&lt;tracking-error&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7456" PostTypeId="2" ParentId="7455" CreationDate="2013-03-07T03:05:55.373" Score="3" Body="&lt;p&gt;There are many techniques, but I would begin with Stambaugh &#xA;&lt;a href=&quot;http://finance.wharton.upenn.edu/~rlwctr/papers/9605.pdf&quot; rel=&quot;nofollow&quot;&gt;Analyzing Investments Whose Histories Differ in Lengths&lt;/a&gt;. The full information maximum likelihood approach he describes basically involves regressing the short history series against the long history series to obtain the covariance with the longer history securities and adding back the covariance of the residual from the short history regression. I think there's some Matlab code that implements it &lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/9061-risk-and-asset-allocation&quot; rel=&quot;nofollow&quot;&gt;in this package&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you have the full covariance matrix, you can calculate the tracking error as normal.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2013-03-07T03:05:55.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7457" PostTypeId="2" ParentId="7452" CreationDate="2013-03-07T04:17:45.680" Score="2" Body="&lt;p&gt;I do not see any advantage in this approach whatsoever, nor would I believe, as you suggested, that &quot;many&quot; use this kind of approach. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact I find it horribly wrong. Using a single variable (CE in this case) to represent a non-trivial risk-return construct implies the ability to map such relationship to one variable representations. Everybody values risk differently, everybody looks for a different risk/reward relationship for million different reasons. The necessary simplifying assumption that is applied here is that risk/reward utility means the same to everyone. I am not saying that utility is identical for all risk/reward mappings, but that a 90% expected return with portfolio variance of 50% has the same utility to all, and a 10% expected return with portfolio variance of 5% has another utility albeit the assumption is that everyone measures this utility equally. I find such assumption plain wrong.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is almost as if there are no greeks in derivatives trading, only a price, buy and sell and that is it. Convenient, because now we can compare prices only, but all the fine-grained detail that makes one chose a 3 month fly over a 2 months spread gets lost because there are no more risk profiles, 2nd and higher order greeks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes mathematicians (and economists) go overboard simply because they spend too much time in an artificially lit room instead of dwelling among mortals. I suggest this is one of those cases. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-03-07T14:44:10.180" LastActivityDate="2013-03-07T14:44:10.180" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7459" PostTypeId="2" ParentId="7452" CreationDate="2013-03-07T13:44:08.557" Score="3" Body="&lt;p&gt;There is a simple reason to use prefer $CE$ to pure utility: $CE$ is independent of utility units. Thus it allows direct comparison. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The cash equivalent of a risky portfolio is the certain amount of cash that provides the same utility that portfolio. So for portfolio $w$ we can define $CE$ via $U(CE)=E[U(w)]$ or $CE=U^{-1}(E[U(w)])$. Note that for risk-free portfolio the $CE$ equals to certain return. So there is one-to-one correspondence betwen expected utility and $CE$. $CE$ is not a new concept but a convinient way to express utility in different units.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also $CE$ is used in research papers when risk premia calculation of a lottery is required, i.e. then you can just substract $CE$ from the price of the lottery.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This answer heavily borrows form the book &quot;&lt;a href=&quot;http://books.google.ch/books?id=GherKrR0X5cC&amp;amp;lpg=PA251&amp;amp;dq=cash-equivalent%20utility&amp;amp;pg=PA251#v=onepage&amp;amp;q=cash-equivalent%20utility&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;The Kelly Capital Growth Investment Criterion: Theory and Practice&lt;/a&gt;&quot;, page 251.&lt;/p&gt;&#xA;" OwnerUserId="370" LastEditorUserId="370" LastEditDate="2013-03-08T10:31:35.503" LastActivityDate="2013-03-08T10:31:35.503" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="7461" PostTypeId="1" CreationDate="2013-03-07T18:03:38.647" Score="8" ViewCount="885" Body="&lt;p&gt;Modeling Exchange Rate Using GARCH&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's consider the following exchange rate : USD/JPY&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For each sequence, we consider changes in the daily difference between the highest price and the open price of the underlying exchange rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, if:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$O(t)$ is the open price of the underlying exchange rate at time $t$, and&lt;/li&gt;&#xA;&lt;li&gt;$H(t)$ is the highest price of the underlying at time $t$,&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;we transform the sequence as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;Y(t) = \log \frac{H(t)-O(t)}{H(t-1)-O(t-1)}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GARCH Model is frequently used to model changes in the variance of $Y(t)$, and I suggest to investigate in this way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is a common known that GARCH models are appropriate for modeling time series that exhibit a heavily-tailed distribution and display some degree of serial correlation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So as a preliminary we must verify that the sequence $Y(t)$ is in fact heavy-tailed and does indeed exhibit serial correlation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Empirical Sequence&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I computed : skewness = 0.11 and kurtosis = 3.9. Test Ok&lt;/li&gt;&#xA;&lt;li&gt;I plotted ACF &amp;amp; PACF : evidence of serial correlation &amp;amp; long term dependence among sequence&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;GARCH model &quot;OK&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GARCH Modelling&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I fit a GARCH(1,1) / GARCH(1,2) / GARCH(1,2) to sequence to obtain parameters.&lt;/li&gt;&#xA;&lt;li&gt;Ljung-Box : Only GARCH(1,1) &amp;amp; GARCH(1,2) succeed.&lt;/li&gt;&#xA;&lt;li&gt;I simulated on 1 $Y$ and compared simulated to original sequence.&lt;/li&gt;&#xA;&lt;li&gt;Result does not seems to capture salient features of the empirical sequence.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Do you see any improvement in the methodology to improve my results?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="4915" LastEditorUserId="35" LastEditDate="2013-03-07T18:35:38.227" LastActivityDate="2013-03-08T14:26:19.300" Title="Improving GARCH modeling approach" Tags="&lt;garch&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7462" PostTypeId="1" AcceptedAnswerId="7518" CreationDate="2013-03-07T18:17:12.097" Score="8" ViewCount="752" Body="&lt;p&gt;In Canadian fixed income markets there is a nice handbook called &lt;a href=&quot;http://iiac.ca/resources/277/canadian-conventions-in-fixed-income-markets-2007-01-01-2007.pdf&quot;&gt;Canadian Conventions in Fixed Income Markets (PDF)&lt;/a&gt;.  It contains detailed market standard pricing formulas for calculating prices, coupons, accrued, and other values for various types of bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a similar book for US fixed income market, or its best approximation?  Preferably it would include all types of Treasury Bills/Notes/Bonds/etc, agency, munis, corporate, commercial paper, etc.  Hopefully it would also include standard formulas for call/put/floor/cap/etc, but that may be just wishful thinking.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2013-03-14T17:58:58.850" Title="Is there a comprehensive reference book on US fixed income conventions?" Tags="&lt;fixed-income&gt;&lt;pricing-formulae&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7463" PostTypeId="2" ParentId="7461" CreationDate="2013-03-07T19:01:20.607" Score="7" Body="&lt;p&gt;I think there is some room for improvement here.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;1. GARCH&lt;/h1&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;GARCH models are appropriate for modeling time series that exhibit a heavily-tailed distribution and display some degree of serial correlation.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That's not the case.  GARCH is used for modelling series where there is serial correlation in &lt;em&gt;variance&lt;/em&gt;, not in actual observations.  And heavy tails are just incidental, and could indicate any number of things that have nothing to do with GARCH.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you may recall, the model for GARCH(N,M) is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;Y(t) = \mu + \sigma(t) \varepsilon(t)&#xA;$$&#xA;where $\varepsilon(t)$ are i.i.d. (usually $N(0,1)$) and &#xA;$$&#xA;\begin{aligned}&#xA;\sigma^2(t) = \omega &amp;amp; + \alpha_1\varepsilon^2(t-1) + ...+\alpha_N\varepsilon^2(t-N) \\ &amp;amp; + \beta_1\sigma^2(t-1) + ...+\beta_M\sigma^2(t-M)&#xA;\end{aligned}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So to test for appropriatness of using GARCH, you should check for variability and serial correlation of  &lt;em&gt;squares&lt;/em&gt; of residuals $(Y(t) - \mu)^2$, not of the time series itself.  This can be done by e.g. comparing variances of $(Y(t) - \mu)$ on different subsets of samples and testing the hypothesis that they are different.  Alternatively, this can be done by plotting ACF and PACF of $(Y(t) - \mu)^2$, though as far as I remember (and I don't remember this well), there may be some quirks there.  But before you do that, check the next section:&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;2. Serial Correlation&lt;/h1&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I plotted ACF &amp;amp; PACF : evidence of serial correlation &amp;amp; long term dependence among sequence&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Your ACF and PACF showed you serial dependence in $Y(t)$.  This suggests that the first thing you do is should make sure that the series is stationary by applying one of &lt;a href=&quot;https://quant.stackexchange.com/questions/2372/how-to-check-if-a-timeseries-is-stationary&quot;&gt;stationarity tests&lt;/a&gt; and, if they they show lack of stationarity, apply a correction like &lt;a href=&quot;http://www2.statistics.com/resources/glossary/t/tsdiff.php&quot; rel=&quot;nofollow noreferrer&quot;&gt;differencing&lt;/a&gt;.  Though given that you're working with daily differences between max and and opening price, I would expect that the series is stationary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the series is stationary and still comes up with significant ACF/PACF results, you should try one of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Autoregressive%E2%80%93moving-average_model&quot; rel=&quot;nofollow noreferrer&quot;&gt;ARMA(N,M)&lt;/a&gt; models which model serial dependence in the time series itself:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align}&#xA;Y(t) = \mu &amp;amp;+ \alpha_1 \epsilon(t-1) + ... + \alpha_N \epsilon(t-N)\\&#xA;&amp;amp;+ \beta_1 Y(t-1) + ... + \beta_M Y(t-M)&#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2013-03-08T14:26:19.300" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7464" PostTypeId="2" ParentId="7421" CreationDate="2013-03-07T19:06:07.633" Score="1" Body="&lt;p&gt;Assuming your question is about using the FX 'volume' you see in a broker's DOM or T&amp;amp;S window, you probably can't infer much about order flow in the way you can with other instrument types.      FX volume and tick data are not equivalent to what you will see for other instruments.  That is, unless the feed is coming from a FX ECN like HotSpot or Currenex, the volume and ticks you're seeing are just quotes, not completed trades. &lt;/p&gt;&#xA;" OwnerUserId="4918" LastActivityDate="2013-03-07T19:06:07.633" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7465" PostTypeId="1" CreationDate="2013-03-07T22:09:48.357" Score="5" ViewCount="1487" Body="&lt;p&gt;I'm trying to backtest Pairs Trading but have become a bit confused on the different methods of selecting pairs, how to look for trading signals and what size of the positions to take in the assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I'm doing right now is that I'm testing for cointegration amongst pairs, which I'm doing with Engle-Granger to get the coefficients in the stationary linear combination of the assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_t = bY_t+a + \epsilon_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After that I check the residual $\epsilon_t = X_t-bY_t-a$ for trading signals. If the absolute value of the residual is larger than some predetermined amount I would open the trade. The trade is closed when the residual is reversed back to 0. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When receiving a signal, I want to trade long/short with equal amounts (1 dollar long/short), as in Gatev et al. and many others. But what I realized is that using these signals and this residual you could actually make a loss from a long/short position with equal amounts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I tried to figure out how they (Gatev and others) looked for trading signals, but everywhere I look it's very poorly explained (especially in their original article). It just says that they use cointegration or OLS or something equivalent and then trade 1 dollar long, 1 dollar short etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what is it that they do? Do they test for stationary in the linear combination without the constant a? &#xA;$X_t = bY_t + \epsilon_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or is there perhaps any additional condition (in the trading signals) I could add to avoid this potential loss of incurring? Since it depends on the value of the assets at the time of closing I would guess not. Would you recommend looking at some other residual for trading signals?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know you could take positions 1 and b in the different assets to ensure no trade makes any loss, but this severely complicates the computations of the returns w.r.t. the committed capital. Because of that, I'd rather not use this method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I've been misunderstood, I will try to clearify what I'm asking.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The profit from each trade:$P = N_x X_c - N_x X_o + N_y Y_o - N_yY_c$ if you're long in X and short in Y.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming our relationship from the cointegration we have the closing resp. opening we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_o = bY_o + a + \epsilon_o$ where $\epsilon_o$ is larger than some value U or less than -U. If we're long in X and short in Y this would mean that its less than -U.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_c = bY_c + a + \epsilon_c$ where $\epsilon_c$ is larger than 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This gives us the profit: &#xA;$$P = N_x (bY_c + a + \epsilon_c) - N_x (bY_o + a + \epsilon_o) + N_y Y_o - N_yY_c = $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's now say we take positions 1 and b in X resp. Y. This gives us:&#xA;$$P=\epsilon_c - \epsilon_o &amp;gt; U$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if I would invest equal amounts in each asset the profit would be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P = Y_c/Y_o - X_c/X_o$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is not strictly positive. So that's why I asked what Gatev et al. (and others) used to look for trading signals. Do they model the stationary time series as $X_t = bY_t + \epsilon_t$? They mension normalised price series also, but they don't explain in detail what it is that they do. This confuses me and I can't figure it out.&lt;/p&gt;&#xA;" OwnerUserId="4709" LastEditorUserId="263" LastEditDate="2013-12-29T14:48:13.973" LastActivityDate="2014-08-24T01:36:44.103" Title="Pairs trading: Question on non-negative profits, size of the positions and trading signals" Tags="&lt;time-series&gt;&lt;pairs-trading&gt;" AnswerCount="3" CommentCount="8" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7466" PostTypeId="1" AcceptedAnswerId="7468" CreationDate="2013-03-08T04:01:04.227" Score="2" ViewCount="2537" Body="&lt;p&gt;I am doing some modelling and have some data:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Index         XYZ                1 &#xA;1994-02-01  -0.005128205          0.994871&#xA;1994-03-01  0.013089005           1.007893&#xA;1994-04-01  0.012224939           1.020215&#xA;1994-05-01  0.018518519           1.039107&#xA;1994-06-01  0.017817372           1.057622&#xA;1994-07-01  0.019438445           1.078180&#xA;1994-08-01  0.006741573           1.085449&#xA;1994-09-01  0.017582418           1.104534&#xA;1994-10-01  -0.004319654          1.099762&#xA;1994-11-01  0.004310345           1.104503&#xA;1994-12-01  0.002150538           1.106878&#xA;1995-01-01  0.006382979           1.113943&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am trying to calculate the total return of the above column vector without transforming it to an equity curve first. Is it correct to just add it up?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The sum of the return = 0.1088808, while the discrete and continuous returns are 0.113944 and 0.107907. Why is there this difference?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: &#xA;For the calculation, i simply used @Richard's equation.&lt;br&gt;&#xA;Discrete = (1.113943 - 1) / 1 = 0.113944&#xA;Continuous = ln(1.113943/1) = 0.107907&lt;/p&gt;&#xA;" OwnerUserId="2318" LastEditorUserId="2318" LastEditDate="2013-03-08T17:22:02.673" LastActivityDate="2013-03-08T17:22:02.673" Title="Calculating Momentum From Returns" Tags="&lt;returns&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7467" PostTypeId="2" ParentId="7466" CreationDate="2013-03-08T04:18:39.337" Score="4" Body="&lt;p&gt;Returns are supposed to be compounded. For example, if I make 10% today and another 10% &lt;em&gt;on top of that&lt;/em&gt; tomorrow, then I will have made 21%. Addition would only make sense if I had taken my profits out at the end of the first day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So no, you can't add returns like this. Instead, you must multiply the returns:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\prod_{i=1}^{n} (x_i + 1) - 1&#xA;\end{equation}&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2013-03-08T04:18:39.337" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7468" PostTypeId="2" ParentId="7466" CreationDate="2013-03-08T04:44:19.627" Score="4" Body="&lt;p&gt;It depends on what you do with your returns. If your returns directly affect your capital base, regardless of positive or negative returns, and if you employ all the generated returns in new trades on which you subsequently calculate returns then you should use &lt;strong&gt;compounded&lt;/strong&gt; returns. Else your returns should be treated as &lt;strong&gt;additive&lt;/strong&gt; and simply aggregated through addition. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please keep in mind that most buy-side portfolio managers and prop groups on the sell-side and hedge fund side do not re-employ returns, at least not right away. It is not a hard science in that all returns, gains and losses are moved into a segregated account but traders and portfolio managers generally do not look at each day's capital base, including all generated returns, when they make decisions of position size, profit targets and when they cut losing positions. Especially loss limits and position limits on the sell-side are re-evaluated very infrequently by superiors. Of course losses are immediately reflected in aggregate net profitability but just because you start off a 100 unit capital base and generated a 10 unit profit today does not mean your boss lets you get off the hook easily if your single asset position limit was 5% of the capital base at your last meeting with your boss and you took the liberty to put on a position of 5.5 units tomorrow. Buy-side portfolio manager committees generally sit down quarterly or so and re-evaluate re-investment decisions that are based on the profits/losses generated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the least, I would not blindly assume a constant re-investment on daily, weekly, even monthly basis unless there is a clear intention to re-invest behind it. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-03-08T04:57:41.693" LastActivityDate="2013-03-08T04:57:41.693" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7469" PostTypeId="1" CreationDate="2013-03-08T10:14:55.483" Score="8" ViewCount="3507" Body="&lt;p&gt;Background: Kupiec P. in 1995, published paper &quot;Techniques for Verifying the Accuracy of Risk Management Models&quot; on Journal of Derivatives, v3, P73-84, it's a Unconditional Coverage Tests designe for VaR model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This &quot;proportion of failures&quot; or POF test examines how many times a financial institution's VaR is violated over a given span of time. If the number of violations differs considerably from $\alpha * 100\%$ of the sample, then the accuracy of the underlying risk model is called into question. Kupiec's (1995) test statistic&#xA;takes the form,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$POF = 2 \cdot ln \left( \left(\frac{1-\hat\alpha}{1-\alpha}\right)^{T-I(\alpha)} \left(\frac{\hat\alpha}{\alpha}\right)^{I(\alpha)} \right) $$&#xA;$$\hat\alpha = \frac{1}{T}I(\alpha)$$&#xA;$$I(\alpha) = \sum_{t=1}^N I_t(\alpha)$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;, where $I_t(\alpha)$ is the violation of VaR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, the problem is, if $I_t(\alpha) = 0$ , POF number is not defined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I wonder if I could extend the POF test like this? --&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$POF = 2 T \cdot ln \left( \left(\frac{1-\hat\alpha}{1-\alpha}\right)^{1-\hat \alpha} \left(\frac{\hat\alpha}{\alpha}\right)^{\hat \alpha } \right) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;; then, $\lim_{x\to 0}x^x = 1$, for $x&amp;gt;0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;; so when $I_t(\alpha) = 0$, we have $\hat \alpha = 0$, and :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$POF = 2 T \cdot ln \left( \left(\frac{1-\hat\alpha}{1-\alpha}\right)^{1-\hat \alpha}   \right) = 2 T \cdot ln \left( \frac{1}{1-\alpha}  \right)$$&#xA;, is this right?&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2013-03-20T13:43:27.537" Title="VaR model Unconditional Coverage Tests: Is this extension of Kupiec POF test correct?" Tags="&lt;backtesting&gt;&lt;modeling&gt;&lt;var&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7470" PostTypeId="1" CreationDate="2013-03-08T10:15:21.920" Score="6" ViewCount="567" Body="&lt;p&gt;Let's decompose the return process $R_t$ as follows : &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R_{t} = sign(R_{t}) * |R_{t}| $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's part of the equation is forecastable?&lt;/p&gt;&#xA;" OwnerUserId="4915" LastEditorUserId="2587" LastEditDate="2013-03-11T08:29:57.577" LastActivityDate="2013-03-11T14:13:02.613" Title="Predict Market Direction, What is forecastable/unforecastable?" Tags="&lt;prediction&gt;" AnswerCount="2" CommentCount="10" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7471" PostTypeId="2" ParentId="7465" CreationDate="2013-03-08T11:21:27.560" Score="0" Body="&lt;p&gt;I cannot get your point o even if it was a question, but there are another techniques to co integrate pairs. eg &lt;a href=&quot;http://en.wikipedia.org/wiki/Johansen_test&quot; rel=&quot;nofollow&quot;&gt;Johansen tests&lt;/a&gt; ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You just described how to implement a simple execution strategy. &lt;/p&gt;&#xA;" OwnerUserId="1360" LastActivityDate="2013-03-08T11:21:27.560" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7472" PostTypeId="1" CreationDate="2013-03-08T12:27:04.770" Score="8" ViewCount="697" Body="&lt;p&gt;assume I have following delta-term vol data from broker:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Spot 3.4550&#xA;                 O/N      1WK      2WK      3WK      1M       6WK      2M&#xA;Volatility       7.544    7.7      7.731    7.911    8.025    8.18     8.4&#xA;Forward Points   0.0004   0.0021   0.0045   0.0063   0.0079   0.0106   0.0164&#xA;EUR Depo Rate    0.405    1.205    1.145    1.128    1.1      1.11     1.13&#xA;PLN Depo Rate    4.216    5.028    4.586    4.187    3.558    3.58     3.626&#xA;Butterfly        0.157    0.19     0.229    0.268    0.34     0.368    0.44&#xA;RiskReversal     0.35     0.45     0.567    0.683    0.9      0.983    1.2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;now I want to retrieve strikes from delta-term vol surface. there are few convensions of quoting delta and ATM condition. apart from this, lets assume that my appropriate formula for ATM strike is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$K=fe^{-\frac12\sigma^2\tau}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;because I need to specify time $\tau$ to put into my other calculations and I don't want to count days and wonder what basis etc, I would like to retrieve first $\tau$ from relationship above.&#xA;it is then given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\tau=-ln({\frac{K}f})\frac2{\sigma^2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but still I need rates to compute other strikes. So what should they be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;we know that&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$f=S+Forward Points$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and for instance&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$f_{ON}=3.4550+ 0.0004=3.4554$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$f_{1M}=3.4550+ 0.0079=3.4629$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and ofcourse&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$f=Se^{(r_d-r_f)\tau}$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;now the question is how to use DEPO rates in $f(S,r_d,r_f,\tau)$ formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so what $r_d$, $r_f$ should be put into $f=Se^{(r_d-r_f)\tau}$ for 1M based on table presented?&#xA;is this ready tu put into it so for $f_{1M}$ I have $r_d\tau=0.03558\tau$ or do I have to annualize it first or get equal rate in continuous compounding?&#xA;please be exact and write down exact formula for say $1M$ $r_D$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried just this rates ($r_d\tau=0.03558\tau$) and also rates continuously compounded ($r_{d,cont}=ln(1+r_d)$) but the results for strikes for delta different from ATM are still not exact nevertheless if I use spot, forward, spot p.a. or forward p.a. convention.&#xA;I use QuantLib.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;below are my results as ticks difference between quoted strike and retrieved from delta-term. I am not satisfied with such accuracy, the reason for this discrepancy is not correct use of rates and time convensions.&#xA;&lt;img src=&quot;https://i.stack.imgur.com/wHxpu.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;here is result for EUR/USD, slightly better but still small error&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/w6M0d.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2017" LastEditorUserId="2017" LastEditDate="2013-03-20T00:28:36.080" LastActivityDate="2021-05-02T07:41:56.243" Title="compute time from FX forward, how use DEPO rates?" Tags="&lt;interest-rates&gt;&lt;implied-volatility&gt;&lt;fx&gt;&lt;forward&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7473" PostTypeId="2" ParentId="7465" CreationDate="2013-03-08T12:51:14.340" Score="1" Body="&lt;p&gt;I do understand your confusion, for someone who has already started research in these topics there might be many questions. regarding size of position: it definitely doesn't have to be 1, or generally the same in both assets. After receiving a signal you have to get into trade with sizes that are appropriate to your ideas, e.g if you want to be say 'delta hedged' or 'market nerutral' you have to choose the values that gives you... cointegration vector.&lt;/p&gt;&#xA;" OwnerUserId="2017" LastEditorUserId="2017" LastEditDate="2014-08-24T01:36:44.103" LastActivityDate="2014-08-24T01:36:44.103" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="7474" PostTypeId="1" CreationDate="2013-03-08T13:35:31.913" Score="5" ViewCount="249" Body="&lt;p&gt;I want to fit the following model to a time series:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;y_{t}=\alpha_{0}+\alpha_{1}y_{t-1}+\alpha_{2}y_{t-1}^{2}+\lambda h_{t}+\varepsilon_{t}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;h_{t}=\beta_{0}+\beta_{1}\varepsilon_{t-1}^{2}+\beta_{2}h_{t-1}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I do this with R or with any other statistical software?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="4921" LastActivityDate="2015-12-27T21:56:33.477" Title="Fitting a non linear AR + GARCH(1,1)-M model" Tags="&lt;volatility&gt;&lt;time-series&gt;&lt;statistics&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7481" PostTypeId="1" CreationDate="2013-03-09T19:29:28.770" Score="2" ViewCount="174" Body="&lt;p&gt;Where to find the following paper of the noble prize Paul Samuelson (2003) “When and Why Mean-Variance Analysis Generically Fails,”. I was looking for it desperately on Google and Google Scholar but no results. Please help in case you have seen it.   &lt;/p&gt;&#xA;" OwnerUserId="3248" LastActivityDate="2013-03-09T20:07:30.990" Title="Find a paper about portfolio management" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7482" PostTypeId="2" ParentId="7481" CreationDate="2013-03-09T20:07:30.990" Score="3" Body="&lt;p&gt;This &lt;a href=&quot;http://research.stlouisfed.org/wp/2007/2007-016.pdf&quot; rel=&quot;nofollow&quot;&gt;pdf&lt;/a&gt; says on page two that the paper was never published. I don't know the reason but you could try to mail the authors of the papers were the article is mentioned. Since it was never published it might be less encumbered by copyright than usual.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2013-03-09T20:07:30.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7483" PostTypeId="2" ParentId="214" CreationDate="2013-03-09T20:27:34.780" Score="4" Body="&lt;p&gt;Question “When we speak about &lt;a href=&quot;http://parrondoparadox.blogspot.com.es/&quot; rel=&quot;nofollow&quot;&gt;Parrondo's Paradox&lt;/a&gt; in relation to stock markets, is there a direct relation between both of them?”&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Professor Parrondo:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I could say, no, no direct with the original ones, because the probability in the original ones depends from how much capital do you have, then it is a random walk with no uniform probabilities and  it is very unlikely to have in the stock market, but it is true that there is something that is no very well know, but it is well known in stock markets, called &lt;a href=&quot;http://parrondoparadox.blogspot.com.es/2011/02/parrondos-paradox-stock-market.html&quot; rel=&quot;nofollow&quot;&gt;“volatility pump”&lt;/a&gt; you split your inversion in two assets 50:50 and you keep this percentage of the capital in the assets re-balancing our inversion every day , you can relate it to the paradox because you can convert this two loser assets in a winning one. But this idea came from 100 years ago from “Feller” and his work about multiplicative process where the average go to infinitive and the probability density go to cero. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;— &lt;a href=&quot;http://parrondoparadox.blogspot.com.es/2011/03/professor-parrondo-interview.html&quot; rel=&quot;nofollow&quot;&gt;Professor Parrondo interview&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="4911" LastEditorUserId="4911" LastEditDate="2015-10-28T22:41:26.067" LastActivityDate="2015-10-28T22:41:26.067" CommentCount="1" CommunityOwnedDate="2013-03-09T20:27:34.780" ContentLicense="CC BY-SA 3.0" />
  <row Id="7484" PostTypeId="1" CreationDate="2013-03-10T04:51:58.987" Score="3" ViewCount="320" Body="&lt;p&gt;Does anyone know how I can obtain time and sales data for a stock?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lots of feeds provide the total volume but I would like to see the breakdown of what buy/sell orders made up the day's volume.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to get this via an API so I can analyze it in my code in real time as the market is trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for your help.&lt;/p&gt;&#xA;" OwnerUserId="4935" LastEditorUserId="4935" LastEditDate="2013-03-16T04:55:05.170" LastActivityDate="2021-04-28T03:03:05.450" Title="Data feed that shows individual orders" Tags="&lt;data&gt;&lt;market-data&gt;&lt;order&gt;&lt;feed&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7487" PostTypeId="2" ParentId="352" CreationDate="2013-03-10T13:32:02.910" Score="5" Body="&lt;p&gt;Here is an interesting example which makes use of these concepts in emerging markets. Emerging markets are ideal because volatility tends to be higher so it can better be harvested:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.parametricportfolio.com/wp-content/uploads/2010/09/EM-Rebalancing-White-Paper-JWM.CA_.pdf&quot; rel=&quot;noreferrer&quot;&gt;Diversifying and rebalancing emerging market countries&lt;/a&gt; by David Stein et al.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Abstract:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We discuss the diversification and rebalancing of Emerging Market countries. Emerging country risks are high and relatively uncorrelated, and the cap-weighted index is oncentrated. In the absence of prior information on returns, these characteristics lead us to expect that a structured rebalanced portfolio will out-perform a capweighted one over the long term. We study this phenomenon with a theoretical model of portfolio returns – this allows us to quantify performance advantages and understand what drives them. It turns out that, even though Emerging Markets suffer high transaction costs and unreliable information, pragmatic portfolio implementations with relatively little trading are still possible. For real implementation, we want to gain some confidence that performance benefits will continue into the future, so we review how the key drivers of excess performance have been evolving during the recent past of increasing globalization.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="12" LastActivityDate="2013-03-10T13:32:02.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7488" PostTypeId="1" AcceptedAnswerId="7491" CreationDate="2013-03-10T16:21:49.873" Score="4" ViewCount="4482" Body="&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am assuming that I don't need to use margin account to short here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is a standard way to calculate return for pairs trading strategy? For example, I bought 100 dollars worth of a loser (L) and shorted 100 dollars worth of winner (W), and when their prices converged I sold L for 110 dollars worth, and paid 90 dollars for W. At the end I made dollars 20, but what is my return? Normally I would divide profit by investment, but here my net investment is zero, so I can't do that. It seems reasonable to count each of my 100 dollars positions as separate investments, in that case I would have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\mbox{return} = \frac{20}{100 + 100} * 100 \% = 10 \%&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the above right? If not what is the proper method?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I need to use a margin account:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Under Regulation T, it is mandatory for short trades that 150% of the&#xA;  value of the position at the time the short is created be held in a&#xA;  margin account. This 150% is comprised of the full value of the short&#xA;  (100%), plus an additional margin requirement of 50% or half the value&#xA;  of the position. (The margin requirement for a long position is also&#xA;  50%.) For example, if you were to short a stock and the position had a&#xA;  value of \$20,000, you would be required to have the \$20,000 that came&#xA;  from the short sale plus an additional \$10,000, for a total of&#xA;  $30,000, in the account to meet the requirements of Regulation T&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.investopedia.com/ask/answers/05/marginaccountshortsell.asp#axzz2NArZzZjp&quot; rel=&quot;nofollow&quot;&gt;Investopedia&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I would need to put 100 * 1.5 = 150 in the margin account for shorting a winner, and buy 100 dollars worth a loser, so my return is:&#xA;$$&#xA;\mbox{return} = \frac{20}{100 + 150} * 100\% = 8\%&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the above is right, but a bit unsure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank You&lt;/p&gt;&#xA;" OwnerUserId="2512" LastEditorUserId="2512" LastEditDate="2013-03-10T22:43:44.913" LastActivityDate="2013-03-11T04:01:07.403" Title="What is the proper way to calculate returns for Pair Trading?" Tags="&lt;pairs-trading&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7489" PostTypeId="1" AcceptedAnswerId="7492" CreationDate="2013-03-10T19:13:58.453" Score="2" ViewCount="92" Body="&lt;p&gt;I found  references relative to US where the  &lt;em&gt;Nominal Annual Percentage Rate&lt;/em&gt; or simply APR is defined as the simple interest rate (i.e.  proportional to time and  without compounding).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead  the effective APR or &lt;em&gt;Annual Percentage Yield&lt;/em&gt; (APY) takes into account the effect of  interest compounding. Also in US there are some legal provisions requiring that APR (and not the APY) to be advertised. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But how is the situation on the UK side? Are the meanings the same?  APR=simple, APY=compound too?&lt;/p&gt;&#xA;" OwnerUserId="3434" LastActivityDate="2013-03-11T04:15:27.030" Title="Annual Percentage Rate and Yield" Tags="&lt;interest-rates&gt;&lt;fixed-income&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7490" PostTypeId="2" ParentId="1554" CreationDate="2013-03-10T20:01:30.303" Score="0" Body="&lt;p&gt;I'm a little surprised that no one has mentioned Fidelity (Wealth-Lab Pro, using C#):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.fidelity.com/trading/advanced-trading-tools/strategy-testing/overview&quot; rel=&quot;nofollow&quot;&gt;https://www.fidelity.com/trading/advanced-trading-tools/strategy-testing/overview&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.fidelity.com/trading/advanced-trading-tools/strategy-testing/faqs&quot; rel=&quot;nofollow&quot;&gt;https://www.fidelity.com/trading/advanced-trading-tools/strategy-testing/faqs&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I realize that this has now been extended to retail trading, however for certain types of hedge funds, this is more than good enough.   If you're running/testing your own Index, the Index-Lab extension is a cheap way to test things out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to test some auto-trades and don't require millisecond timing, it's a cheap way to play with various schemes.&lt;/p&gt;&#xA;" OwnerUserId="392" LastActivityDate="2013-03-10T20:01:30.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7491" PostTypeId="2" ParentId="7488" CreationDate="2013-03-11T04:01:07.403" Score="4" Body="&lt;p&gt;It depends on which return you precisely attempt to measure:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Gross Return on trade: Forget about margin or not margin, it does not matter. When you evaluate the performance of a single position you look at the notional to which you exposed yourself to. So if you bought a stock worth 100 dollars and later on sell it for 110 dollars then you generated a return of 10 dollars or 10% of exposed notional. It does not matter at this point whether you borrowed the funds from someone or not in calculation of gross return on your trade. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Net return on trade: If you want to calculate the total return on your investment then you may have to factor in the costs of funding as well.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Return on capital (employed): In this case you need to look at how much of your capital did you lock up/ margin in order to trade such position. Here, margins come into play. Obviously, your returns on leveraged investments will be much more pronounced when measured as return on capital rather than return on the actual notional traded, but your risk will also be magnified. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Now, a pair trade is really not much different in terms of return attribution from 2 separate trades. Thus all you do is you aggregate the returns (after you define precisely what return type you attempt to evaluate). Make sure you understand that risk is &lt;strong&gt;NOT&lt;/strong&gt; aggregated because it does not linearly scale. But as this question is just about returns you should simply add return profiles of each leg together. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your example if you longed 100 dollars and you shorted 100 dollars on another name then your total notional traded is 200 dollars. You generated an aggregate of 20 dollars and hence your gross return on the trade is 10%. Your net return depends on how much you paid in funding and borrow charges. Your return on capital depends on how much you leveraged your position. I can't answer it without knowing your leverage rate on this particular trade. But its pretty straight forward for you to derive. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-03-11T04:01:07.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7492" PostTypeId="2" ParentId="7489" CreationDate="2013-03-11T04:15:27.030" Score="1" Body="&lt;p&gt;First off, APR can be both, compounded or not compounded, depending on whether you talk about nominal APR or effective APR. Though, generally in the US when people talk APR it is referring to the nominal APR. Also, APY is not a generally used term in the US, usually EAR is used which is taking into account compounding in order to make rates comparable across different compounding frequencies. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the UK the situation is very similar with the following exception:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;EAR is the rate, taking into account compounding, on interest &lt;strong&gt;owed&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;AER is the rate, taking into account compounding, on balances &lt;strong&gt;earned&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-03-11T04:15:27.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7493" PostTypeId="2" ParentId="352" CreationDate="2013-03-11T06:20:46.873" Score="5" Body="&lt;p&gt;It was discussed long ago by Claude Shannon and discussed a bit in &lt;em&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0809045990&quot; rel=&quot;nofollow&quot;&gt;Fortune's Formula&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In the 1960s, Shannon gave a lecture in a hall packed with students and teachers alike in MIT, on the topic of maximizing the growth rate of wealth. He detailed a method on how you can grow your portfolio by rebalancing your fund between a stock and cash, while this stock stays in a random ranging market. (He used a geometric Wiener example). Essentially, you buy more when stock price is low, using the cash at hand, or sell more when stock price is high, with allocation of 50-50% value at each interval.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In addition, the ideas were further explored by Thomas Cover, with his &lt;a href=&quot;http://www-isl.stanford.edu/~cover/papers/paper93.pdf&quot; rel=&quot;nofollow&quot;&gt;Universal Portfolios&lt;/a&gt; concept. There was some word that he had left academia at one point to work on a hedge fund.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having done some research in this area myself, I can say that one of the issues is that it takes a very long time for the results to converge (i.e. it would take a great amount of patience for your portfolio to converge towards the best asset's performance).&lt;/p&gt;&#xA;" OwnerUserId="3040" LastEditorUserId="35" LastEditDate="2013-03-11T11:21:41.513" LastActivityDate="2013-03-11T11:21:41.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7494" PostTypeId="2" ParentId="7470" CreationDate="2013-03-11T10:58:38.920" Score="3" Body="&lt;p&gt;The two components you refer to in your questions are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Market &lt;strong&gt;direction&lt;/strong&gt; (the sign of the return)&lt;/li&gt;&#xA;&lt;li&gt;Change &lt;strong&gt;magnitude&lt;/strong&gt; (the absolute value of the return)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;First, I'm sure you realize that neither of these are predictable at a 100%, otherwise there would be no way to make profit (you make profit by seeing things other didn't).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer the question, I would say that predicting the direction is a bit easier in a sense than the magnitude simply because of the possible outcomes:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the sign is a discrete variable with 2 possible outcomes;&lt;/li&gt;&#xA;&lt;li&gt;whereas the magnitude is a continuous variable).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Other than that, there exists techniques for both, but neither will give you 100% accuracy, (or even close to that).&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2013-03-11T10:58:38.920" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7495" PostTypeId="1" CreationDate="2013-03-11T11:19:39.667" Score="10" ViewCount="16881" Body="&lt;p&gt;I am writing about VaR and I am wondering about the following:&#xA;We can scale the VaR to different time horizons by using the square root of time, which means, that the volatility is adjusted by square root of the time horizon. So e.g. we have the daily volatility then the weekly volatility (for 5 trading days) is given by &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sqrt{5}*$ daily volatility&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now my question is the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this hold only for log returns or also for simple returns? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I googled it but I could not find a proof for it. So where can I find a proof for this in terms of log returns and either also a proof for the case of simple returns or an estimation of the error I will be doing, if I use the square root of time while using simple returns?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And finally considering the VaR: Does this need the normal distribution as an assumption?&lt;/p&gt;&#xA;" OwnerUserId="4940" LastActivityDate="2013-03-11T21:52:43.500" Title="Square root of time" Tags="&lt;volatility&gt;&lt;return&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7496" PostTypeId="2" ParentId="7495" CreationDate="2013-03-11T12:39:36.347" Score="11" Body="&lt;p&gt;Scaling volatility as you do is often leading to inaccurate results  which is over-estimating volatility especially when you scale daily volatility to even longer periods. Please see the following for more:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://economics.sas.upenn.edu/~fdiebold/papers/paper18/dsi.pdf&quot;&gt;http://economics.sas.upenn.edu/~fdiebold/papers/paper18/dsi.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above paper also explains why scaling the way you did does not properly account for the correct volatility when returns are not normally distributed/ prices are not log-normally distributed. But I like the following explanation better:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Scaling volatility as you did it only is mathematically correct when the underlying price model is driven by Geometric Brownian motion which implies that prices are log normally distributed and returns are normally distributed. The reason for that is that &lt;strong&gt;the driving Brownian motion accumulates variation at rate one per unit of time&lt;/strong&gt;. The proof of that is pretty well published but my favorite source is Steven Shreve, Stochastic Calculus for Finance II, page 101-107 (2004 edition). So, volatility scales with the square root of time only when the underlying process is driven by a geometric Brownian motion. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-03-11T14:25:16.880" LastActivityDate="2013-03-11T14:25:16.880" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7497" PostTypeId="1" AcceptedAnswerId="7511" CreationDate="2013-03-11T13:45:56.120" Score="4" ViewCount="264" Body="&lt;p&gt;If a random variable is discrete, and we are interested in its quantile value, how to define a proper back testing procedure?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the &lt;strong&gt;underlying variable&lt;/strong&gt; with a discrete value is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;d(\mbox{account}) = \mbox{PaymentDate} - \mbox{BillingDate}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the &lt;strong&gt;observing variable:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;y = \mbox{percentile}(d, 95\%, \mbox{month})&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or $y$ is the 95th percentile value of $d$, for a particular month. e.g. 95% of credit cards are paid within 20 days from the billing, in 2013 Jan.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could I define a back-testing approach?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h1&gt;Background&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;To define an estimation-backtesting method for a continous random variable is easier. Now in my group we have such a non-parametric approach:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;underlying variable:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r(\mbox{month}) = \mbox{monthly credit-card account default rate}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, 2013 Feb default rate is 1.1%, 2013 Jan is 1.2%...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;observing variable:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;x = \mbox{percentile}(r, 95\%)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$x$ is the 95% percentile value of $r$. Here $x$ definition is similar to VaR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;point forcast:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\hat x(\mbox{month}) = \mbox{percentile}(r(\mbox{month}), N, 95\%)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\hat x$ is the 95% percentile value of $r$, based on $N$ historic observations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, take $N=36$, retrieve back 36 months, the 95% percentile value of default rate $r$ is 2.3%. then $\hat x = 2.3\%$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;point forecast Exception:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\mbox{PFException}(t) =&#xA;\begin{cases} 0 &amp;amp; r(\mbox{month}) \leq \hat x(\mbox{month})&#xA;\\&#xA;1 &amp;amp; \text{otherwise}&#xA;\end{cases}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By right 95% of the time there shall have no exception, while 5% of the time exception happens.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;backtesting:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are POF test, checking the rate of the exception; and independent test, checking the correlation of exceptions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, Kupiec (1995) proposed a POF test checks exceptions happened in previouis 36 months' point forecasts: 0-4 exceptions are ok, green light, 4-7 exceptions are yellow light, while more than 8 exceptions are red light.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Christoffersen (1998) proposed an independent test.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kupiec, P. (1995). Techniques for verifying the accuracy of risk management models. Journal&#xA;of Derivatives 3, 73–84.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Christoffersen, P. (1998). Evaluating interval forecasts. International Economic Review 39,&#xA;841–62.&lt;/p&gt;&#xA;" OwnerUserId="2161" LastEditorUserId="35" LastEditDate="2013-03-11T14:34:28.463" LastActivityDate="2013-03-13T06:52:42.513" Title="backtesting a 5% quantile model of a discrete value random variable?" Tags="&lt;backtesting&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7498" PostTypeId="2" ParentId="7470" CreationDate="2013-03-11T14:13:02.613" Score="4" Body="&lt;p&gt;I think this one has a clear answer (I am solely talking about equities here):&lt;br&gt;&#xA;&lt;strong&gt;The change magnitude is much more predictable than the direction.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason being that equity volatility is much more predictable than equity risk premiums. Volatility is nothing else but change magnitude and due to the stylized facts of volatility clustering together with mean reversion more predictable than the whole package, therefore also including direction. Basically the pattern is that there are phases when most movements are big in either direction and phases where everything is calm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a nice exposition see also this paper by Andrew Ang:&lt;br&gt;&#xA;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2117625&quot; rel=&quot;nofollow&quot;&gt;Equity market level&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2013-03-11T14:13:02.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7500" PostTypeId="2" ParentId="7495" CreationDate="2013-03-11T21:52:43.500" Score="4" Body="&lt;p&gt;for the square-root rule: it holds for log-returns, if you assume the same variance and no autocorrelation. Because then:&#xA;$$&#xA;Var[r_1 + \cdots + r_d] = Var[r_1] + \cdots + Var[r_d] = d Var[r_1]&#xA;$$&#xA;and thus &#xA;$$&#xA;\sqrt{Var[r_1 + \cdots + r_d] } = \sqrt{d} \sqrt{Var[r_1]}.&#xA;$$&#xA;This is mathematically true for any distribution that fulfills the assumptions. For the case with autocorrelations you can look here: &lt;a href=&quot;http://arxiv.org/abs/1009.3638&quot; rel=&quot;nofollow&quot;&gt;Scaling portfolio volatility and calculating risk contributions in the presence of serial cross-correlations&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course this holds in the ideal world of mathematics but it is at least a benchmark for anything better and more realistic. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Concerning VaR: VaR is a quantile as you can read on &lt;a href=&quot;http://en.wikipedia.org/wiki/Value_at_risk&quot; rel=&quot;nofollow&quot;&gt;wikipedia&lt;/a&gt;. Very often a normal distribution is assumed but this is not the only possibility. Another one is a t-distribution, just to name one. &lt;a href=&quot;http://press.princeton.edu/titles/8056.html&quot; rel=&quot;nofollow&quot;&gt;This book&lt;/a&gt; deals a lot with VaR.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2013-03-11T21:52:43.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7503" PostTypeId="1" AcceptedAnswerId="7504" CreationDate="2013-03-12T07:27:29.183" Score="4" ViewCount="1206" Body="&lt;p&gt;Recently I have looked at some sovereign CDS spreads (of the Nordic countries to be precise) and have tested for cointegration in the levels (i.e. untransformed) and logs of the spreads. Tests indicate that a cointegrating relationship exists between certain pairs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions are: how would one go about setting up a pairs trade (if that is the proper word here) using the cointegrating vector from either the CDS spreads or the log CDS spreads? What would be the difference between logs and levels? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I understand it, when using e.g. stock prices, if using the stock prices as they are, the cointegrating vector would tell you how many of each stock to buy (when it is time to buy), and using logs, the cointegrating vector will tell you the relative weights in dollars to place in each stock. However, when using CDS contracts, e.g. as the buyer, we commit to making quarterly payments based on the spread, to receive protection (a payout) in case of a credit event. How would this translate into a pairs trading strategy?&lt;/p&gt;&#xA;" OwnerUserId="1584" LastActivityDate="2013-03-12T08:51:35.040" Title="Pairs trade CDS contracts using cointegration" Tags="&lt;cointegration&gt;&lt;pairs-trading&gt;&lt;cds&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7504" PostTypeId="2" ParentId="7503" CreationDate="2013-03-12T08:43:42.397" Score="3" Body="&lt;p&gt;I urge you to not compare CDS contracts and pairs with cash equity pair trades. The profiles are entirely different. CDS pairs are much more similar to being long and short an options contract. As protection buyer you are essentially long an option, you pay an &quot;insurance premium&quot; and that is what you are standing to lose at maximum. However, as protection seller you are paid premium for a potentially large liability in the case an &quot;event is triggered&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Trading CDS contracts as pairs and believing you can in any way hedge away disaster is asking to load the cart with toxic waste, so to speak. I already am very critical about anyone claiming they have a &quot;perfect&quot; equity pairs trading strategy. Unsystematic risks are ensuring time and again that the most co integrated pairs are ripped apart as if there is no tomorrow. As mentioned above, your CDS pairs are a lot more complex in terms of risk exposure. You are basically short volatility and correlation and I am not sure that is ever a prudent long-term strategy (unless you are a market maker and have accepted for yourself and are fine with the fact that most market makers selling volatility and selling correlation are going bust on a very frequent and stable cycle). All of the above obviously applies more to single name CDS rather than CDS indexes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would strongly urge you to take the trade apart and trade each leg on its own, even when trading CDS indexes. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-03-12T08:51:35.040" LastActivityDate="2013-03-12T08:51:35.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7505" PostTypeId="1" AcceptedAnswerId="7545" CreationDate="2013-03-12T09:10:24.113" Score="8" ViewCount="2181" Body="&lt;p&gt;Suppose $X$ is a normal random variable with mean 0, and variance $\sigma^2$.  $F(x)$ is the CDF(cumulative distribution function) of a standard normal random variable(mean 0 and variable 1), how to calculate the expectation of $ F(X+a)$, where $ a&amp;gt;0 $.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This was a quant interview question. I know how to calculate the expectation of F(X), i.e when $a=0$, but I have no idea when $a \neq 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My solution for $a=0$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Method 1: Since F(x) is the CDF of a normal random variable with mean 0, and variance $\sigma^2$. We will have F(x)=1-F(-x). Suppose that f(x) is the corresponding pdf, and f(x)=f(-x).  Then&#xA;\begin{align}&#xA;\mathbb{E}[F(X)]&amp;amp;=\int_{-\inf}^{+\inf} F(s)f(s)ds\\&#xA;&amp;amp;=\int_{-\inf}^{+\inf} (1-F(-s))f(s)ds\\&#xA;&amp;amp;=1-\int_{-\inf}^{+\inf} F(-s)f(s)ds\\&#xA;&amp;amp;=1-\int_{-\inf}^{+\inf} F(m)f(m)dm&#xA;\end{align}&#xA;Hence we have&#xA;$$ \int_{-\inf}^{+\inf} F(s)f(s)ds=\frac{1}{2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Method 2(This method seems it didn't require that X is normal random variable): Let's first compute the distribution for $F(X)$:&#xA;\begin{align}&#xA;\mathbb{P}\{F(X) \leq y\}&amp;amp;=\mathbb{P}\{X \leq F^{-1}(y)\}\\&#xA;&amp;amp;=F\cdot F^{-1}(y)=y&#xA;\end{align}&#xA;So $F(X)$ is uniformly distributed, hence the mean is $\frac{1}{2}$.&lt;/p&gt;&#xA;" OwnerUserId="4601" LastEditorUserId="2587" LastEditDate="2013-03-15T16:30:43.873" LastActivityDate="2013-03-18T13:54:13.150" Title="Calculate the expectation of a shift CDF" Tags="&lt;probability&gt;" AnswerCount="3" CommentCount="11" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7507" PostTypeId="1" CreationDate="2013-03-12T13:34:46.657" Score="4" ViewCount="1303" Body="&lt;p&gt;I am trying to get a simplified model of the DV01 for the US 10YR Note futures but I cant figure out what the current yield is. When I back out the implied interest rate on the current TYM3 futures contract (as of 3.12.13) I get a YTM of about 2.53, however the current GENERIC 10 Year yield or TNX is only 2.03 or so. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that the 10 year future is referenced off a 6% bond and that the Generic yield is from the current &lt;em&gt;on the run&lt;/em&gt; bond. But I am trying to understand why there is such a large difference between the implied futures price yield and the generic yield.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, is there cost of carry holding futures contracts? I believe there is, equal to the current yield but I am not sure&lt;/p&gt;&#xA;" OwnerUserId="4944" LastActivityDate="2013-08-10T13:59:16.383" Title="Yield on Fixed income futures" Tags="&lt;interest-rates&gt;&lt;fixed-income&gt;&lt;futures&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7508" PostTypeId="2" ParentId="7505" CreationDate="2013-03-12T19:27:11.380" Score="1" Body="&lt;p&gt;Hopefully this is correct...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So firstly, what is $F(X)$ when $X$ is a random variabel?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is where I might be completely wrong, but at least it gives the correct answer in the case of a=0, so let's try that one first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have two random variables with the same normal distribution, mean 0 and sd $\sigma^2$.&#xA;$X_1, X_2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So we are supposed to calculate $F_{X_1}(X_2) = P(X_1 \leq X_2) = P(X_1 - X_2 \leq 0)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since both $X_1$ and $X_2$ are both normal we have that $X =X_1 - X_2$ is also normal with mean $0$ and s.d. $2\sigma^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So we have $P(X \leq 0)$ which is 1/2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the case of $a \neq 0$ we would get $P(X \leq a)$ which is $F_{X}(a)$. However it seems like it would always end up as a constant, so the expected value seems a bit 'redundant', which makes me think that this might not be the correct solution..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit: Also, in $P(X \leq a)$ you could divide to get, since mean is 0, divide to get standard normal and you would get $\Phi(\frac{a}{\sqrt2sigma})$ or smth like that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit2:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sigma = 2;&#xA;n = 5000000;&#xA;a=5;&#xA;mean(normcdf(normrnd(0,sigma,1,n)+a,0,sigma))&#xA;normcdf(a/(sqrt(2)*sigma),0,1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4709" LastEditorUserId="370" LastEditDate="2013-03-13T21:21:44.633" LastActivityDate="2013-03-13T21:21:44.633" CommentCount="16" ContentLicense="CC BY-SA 3.0" />
  <row Id="7510" PostTypeId="2" ParentId="4262" CreationDate="2013-03-12T22:01:28.533" Score="6" Body="&lt;p&gt;It really depends on the source of your signal. Since you're trading options I assume it is either volatility signal, or volatility + basis signal. If you have signal only on basis don't bother with options and just trade underlying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if you are trading vol signal only, you will need to hedge all basis risk - so gamma hedge (dynamic hedging with underlying) each underlying separately, so your PL on each instrument is (hopefully) just vol mispricing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are trading vol + basis, then you can implement them as offsetting trades - e.g. long 1M 25delta call in IWN and short equivalent call in IWO, no hedging (or just initial margin hedging) so this way you get PL from basis and from vol difference. &lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2013-03-12T22:01:28.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7511" PostTypeId="2" ParentId="7497" CreationDate="2013-03-13T06:52:42.513" Score="1" Body="&lt;p&gt;Just to answer my own question. Discrete variates' quantile, could be modelled and tested. I followed this paper: &quot;Discrete Quantile Estimation&quot;, Halina Frydman and Gary Simon, New York University, January 29, 2007. Detailed approach is inside.&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2013-03-13T06:52:42.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7513" PostTypeId="2" ParentId="7505" CreationDate="2013-03-13T10:01:02.090" Score="1" Body="&lt;p&gt;As you already mentioned you can get the CDF of this distribution using distribution transform:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P(F(X+a)\le y)=P(F^{-1}(F(X+a))\le F^{-1}(y))=P(X+a\le F^{-1}(y))=P(X\le F^{-1}(y)-a)=F(F^{-1}(y)-a)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you could write down expectation in integral form, but on the first glance it seems not so trivial how to get an explicit expression. Probably they didn't expect you to do this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also try to run quick Monte-Carlo in R to see what your distribution looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  a &amp;lt;- 1&#xA;  sigma &amp;lt;- 2&#xA;  m &amp;lt;- pnorm(rnorm(10000,0,sigma)+a,0,sigma)&#xA;  hist(m)  &#xA;  plot(ecdf(m))&#xA;  mean(m)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You will definitely see that it's not uniform for the values of $a$ that are significantly bigger than 0.&lt;/p&gt;&#xA;" OwnerUserId="370" LastActivityDate="2013-03-13T10:01:02.090" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7514" PostTypeId="2" ParentId="7445" CreationDate="2013-03-13T10:15:03.580" Score="11" Body="&lt;p&gt;I found this solid overview of different trading algorithms by &lt;a href=&quot;http://www.dbresearch.com/PROD/DBR_INTERNET_EN-PROD/PROD0000000000270960.pdf&quot; rel=&quot;noreferrer&quot;&gt;Deutsche Bank Research&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Trade execution algorithms&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Designed to minimise the price impact of &lt;strong&gt;executing trades of large &#xA;volumes&lt;/strong&gt; by ‘shredding’ orders into smaller parcels and slowly &#xA;releasing these into the market.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Strategy implementation algorithms&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Designed to read real-time market data and &lt;strong&gt;formulate trading signals&lt;/strong&gt; to be executed by trade execution algorithms. This may involve automatically &lt;strong&gt;rebalancing portfolios&lt;/strong&gt; when certain pre-specified tolerance levels are exceeded, &lt;strong&gt;searching for arbitrage &#xA;opportunities&lt;/strong&gt;, automatic quoting and hedging in a &lt;strong&gt;market maker-type role&lt;/strong&gt;, and producing trading signals from technical analysis.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Stealth/gaming algorithms&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Designed to take advantage of the price movement caused when &#xA;large trades are filled and also to &lt;strong&gt;detect and outperform other algorithmic strategies&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Electronic market making&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Liquidity-providing&lt;/strong&gt; strategies that mimic the traditional role &#xA;market makers once played. These strategies involve making a two-sided market aiming at &lt;strong&gt;profiting by earning the bid-ask spread&lt;/strong&gt;. This has evolved into what is known as Passive Rebate Arbitrage.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Statistical arbitrage&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Traders look to correlate prices between securities in some way and trade off of the &lt;strong&gt;imbalances in those correlations&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Liquidity detection&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Traders look to &lt;strong&gt;decipher whether there are large orders&lt;/strong&gt; existing in a matching engine by sending out small orders (“pinging”) to look for where large orders might be resting. When a small order is filled quickly, there is likely to be a large order behind it.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2165" LastEditorUserId="2165" LastEditDate="2013-03-15T10:57:58.327" LastActivityDate="2013-03-15T10:57:58.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7516" PostTypeId="2" ParentId="7507" CreationDate="2013-03-13T12:42:58.717" Score="3" Body="&lt;p&gt;i figured it out. the difference between the Generic Yield and the Futures price implied yield is do to the difference between the current &quot;on the run&quot; 10 year bond the current cheapest to deliver (CTD) bond for the futures contract. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wow who would have thought figuring out DV01 for a futures contract would be so hard to do. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since current yields are much lower than Futures 6% reference bond, the CTD will be a shorter maturity higher coupon bond and therefore will have a higher YTM (after conversion factor) vs on the run bond&lt;/p&gt;&#xA;" OwnerUserId="4944" LastActivityDate="2013-03-13T12:42:58.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7518" PostTypeId="2" ParentId="7462" CreationDate="2013-03-13T15:36:16.187" Score="2" Body="&lt;p&gt;And, as suggested by everyone on and offline, the winner is... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://books.google.ca/books/about/The_Handbook_of_Fixed_Income_Securities.html?id=ji6O3hPSmrYC&quot; rel=&quot;nofollow&quot;&gt;The Handbook of Fixed Income Securities by Frank J. Fabozzi&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2013-03-13T15:36:16.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7519" PostTypeId="1" CreationDate="2013-03-13T18:29:04.200" Score="2" ViewCount="1010" Body="&lt;p&gt;Can we please sumarise here some of the basic concepts, tools used in arbitrage and statistical arbitrage in real life?&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;ARB: benefit from price difference on same asset&lt;/li&gt;&#xA;&lt;li&gt;ARB: difference between stock index and syntetic index constructed from stocks&lt;/li&gt;&#xA;&lt;li&gt;ARB: triangular arb (is this being exploited? by who? where?)&lt;/li&gt;&#xA;&lt;li&gt;ARB/STATARB: difference between futures and theo futures&lt;/li&gt;&#xA;&lt;li&gt;STATARB: cointegration/correlation&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;These are main directions I can think about at the moment. Can you please add more? Please share a link and/or a brief description.&lt;/p&gt;&#xA;" OwnerUserId="2017" LastEditorUserId="2017" LastEditDate="2018-04-01T21:58:01.013" LastActivityDate="2019-01-10T07:47:35.010" Title="main arbitrage &amp; statistical arbitrage concepts" Tags="&lt;statistics&gt;&lt;arbitrage&gt;&lt;pairs-trading&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7520" PostTypeId="2" ParentId="7519" CreationDate="2013-03-13T18:54:02.273" Score="4" Body="&lt;p&gt;There are many. Just to list a few:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Capital structure arbitrage (CDS)&lt;br&gt;&#xA;Convertible bonds arbitrage&lt;br&gt;&#xA;Merger arbitrage&lt;br&gt;&#xA;Latency arbitrage&lt;br&gt;&#xA;Exchange-traded funds arbitrage&lt;br&gt;&#xA;Correlation and volatility arbitrage&lt;br&gt;&#xA;Municipal bond relative value arbitrage&lt;br&gt;&#xA;Regulatory arbitrage&lt;br&gt;&#xA;...  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;They are all easily googled. However, the main idea is always the same. &lt;/p&gt;&#xA;" OwnerUserId="370" LastActivityDate="2013-03-13T18:54:02.273" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7521" PostTypeId="1" CreationDate="2013-03-13T21:53:42.527" Score="4" ViewCount="293" Body="&lt;p&gt;I have a fairly pedestrian optimization problem: Max sharpe, subject to a x% vol target. I have a set of expected returns, asset vols and a correlation matrix. I am finding that when i set the off-diagonals of my covariance matrix to 0 (ie assume zero corelation, independant views on assets) my backtested performance results are substantially better than optimization including the full covariance matrix. Its clear what is going on here - this approach removes hedge positions (ie: negative holdings in assets with a small positive expected return (and vice versa) that are highly correlated with other assets.) As a result my holdings are always aligned with my expected returns, but the individual asset volatilities still scale the holding. The conlcusion from these results is that one should max exposure to my expected returns and I should &quot;suppress&quot; the correlation matrix. My question is: is this valid? Would anyone really use this approach...thanks in advance for any thoughts...&lt;/p&gt;&#xA;" OwnerUserId="4953" LastActivityDate="2013-03-15T12:40:43.437" Title="Is Optimization ignoring correlation valid?" Tags="&lt;optimization&gt;&lt;correlation-matrix&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7522" PostTypeId="1" AcceptedAnswerId="7531" CreationDate="2013-03-14T00:40:57.930" Score="7" ViewCount="601" Body="&lt;p&gt;I noticed that if you use two correlated geometric brownian motions, the correlation structure decays in time pretty fast even for really high correlation values. &#xA;I think that is not replicating reality, is it?&#xA;I wondered how people solve this problem in practice? &#xA;Specially for pricing of spread options.It overprices long term options. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Tb2aE.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="3245" LastActivityDate="2013-03-15T21:10:00.473" Title="Correlation decay in lognormal distribution" Tags="&lt;correlation&gt;&lt;brownian-motion&gt;&lt;spread-options&gt;" AnswerCount="2" CommentCount="8" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7523" PostTypeId="2" ParentId="7522" CreationDate="2013-03-14T01:35:09.937" Score="3" Body="&lt;p&gt;It depends on the frequency and the horizon. For instance, I got a similar looking chart when I used annual log returns as the input to the log normal distribution and went out 250 years. With daily log returns over a few years, there isn't nearly as much of a decay. However, when you go out 250 years with daily returns you still see the pattern.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastEditorUserId="2379" LastEditDate="2013-03-14T02:05:39.463" LastActivityDate="2013-03-14T02:05:39.463" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7524" PostTypeId="2" ParentId="2975" CreationDate="2013-03-14T02:28:03.207" Score="0" Body="&lt;p&gt;You could perhaps think about expected returns for a momentum stratgey in terms of relative expected returns across your assets i.e. the current price and your moving average (if that's how you define momentum) on each asset. or, more simplistically you could create expected returns in the form of a binary signal (+1 for long or -1 for short). i would then suggest you scale your +1/-1 alphas by the volatility of each asset (signal * vol). Neither gives you a precise expected return but the optimiser will still give you a set of weights that reflect your expectations on a relative basis....&lt;/p&gt;&#xA;" OwnerUserId="4953" LastActivityDate="2013-03-14T02:28:03.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7526" PostTypeId="1" CreationDate="2013-03-14T16:27:39.580" Score="8" ViewCount="6958" Body="&lt;p&gt;I am using a large daily data panel for over 250 companies and over several years. I am concerned about adjusting for stock splits. Is there any program in SAS to detect stock splits? How do I adjust the stock splits?&lt;/p&gt;&#xA;" OwnerUserId="4957" LastEditorUserId="35" LastEditDate="2013-03-14T16:38:12.803" LastActivityDate="2014-01-30T18:14:50.787" Title="How to detect and adjust for stock splits?" Tags="&lt;data&gt;&lt;econometrics&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="5" ClosedDate="2014-02-07T14:54:38.780" ContentLicense="CC BY-SA 3.0" />
  <row Id="7527" PostTypeId="1" CreationDate="2013-03-14T17:18:17.363" Score="1" ViewCount="784" Body="&lt;p&gt;A standard example when learning to price American options is the perpetual American put.  This is a put that has no expiry (or you can consider T = infinity).  The standard solution prices this using the basic Black-Scholes assumptions (including no restrictions on short-selling) and ends up concluding the optimal exercise strategy is finding the right lower barrier that effectively knocks out your put with a rebate.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But my question is this:  doesn't the idea of such a perpetual option contradict the Black-Scholes assumptions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order for this pricing exercise (and yes, I'm aware it's just an exercise and not a real pricing problem) to be valid, you must be able to delta-hedge, correct?  And since this will involve shorting the stock, this would seem to allow shorting the stock for arbitrary lengths of time.  But doesn't this allow arbitrage?  After all, someone (who doesn't care about the put) can just short the stock indefinitely and never close it out.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Isn't this an arbitrage?  If not, what am I missing?  Is there some adjustment one needs to make to the idea of arbitrage in this infinite time case?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note my question is about the standard Black-Scholes theory.  Someone asked about margin, but I don't think that's part of the standard theory.&lt;/p&gt;&#xA;" OwnerUserId="2477" LastEditorUserId="2477" LastEditDate="2013-03-15T02:21:03.243" LastActivityDate="2017-02-21T04:39:03.047" Title="Doesn't a perpetual option contradict the Black-Scholes framework?" Tags="&lt;black-scholes&gt;" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7528" PostTypeId="2" ParentId="7462" CreationDate="2013-03-14T17:58:58.850" Score="1" Body="&lt;p&gt;It used to be (and maybe still is) Standard Securities Calculation Methods ..., a 2 volume set, but it is no longer available. You might find it in a library. It is available for $$$ at &lt;a href=&quot;http://www.sifma.org/research/bookstore.aspx&quot; rel=&quot;nofollow&quot;&gt;http://www.sifma.org/research/bookstore.aspx&lt;/a&gt;, or maybe you can find a used copy. TIPS, Inc., &lt;a href=&quot;http://www.tipsinc.com/prods.htm&quot; rel=&quot;nofollow&quot;&gt;http://www.tipsinc.com/prods.htm&lt;/a&gt;, has an app and software implementing the books.&lt;/p&gt;&#xA;" OwnerUserId="4958" LastActivityDate="2013-03-14T17:58:58.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7529" PostTypeId="1" CreationDate="2013-03-14T18:02:42.417" Score="10" ViewCount="680" Body="&lt;p&gt;I'm currently working on some matlab code that is supposed to check a stock database for any errors (missing values, wrong values, etc.). The reason for this is that after reading &lt;a href=&quot;https://quant.stackexchange.com/a/1639/2278&quot;&gt;this post&lt;/a&gt; I came to the conclusion that I'll probably have to write some data cleaning code in order to get accurate and reliable results when backtesting with this database. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The database has been downloaded from &lt;a href=&quot;http://finance.yahoo.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;yahoo finance&lt;/a&gt; and contains the following columns for each stock: Date, Open, High, Low, Close, Volume, AdjClose.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far the program scans for the following trivial errors:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Close &gt; High&lt;/li&gt;&#xA;&lt;li&gt;Close &amp;lt; Low&lt;/li&gt;&#xA;&lt;li&gt;Open &gt; High&lt;/li&gt;&#xA;&lt;li&gt;Open &amp;lt; Low&lt;/li&gt;&#xA;&lt;li&gt;High &amp;lt; Low&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The program also checks if any of the data columns contains values less than zero or NaN.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What other errors/flaws could I look for in the database?&lt;/p&gt;&#xA;" OwnerDisplayName="user2278" LastEditorUserId="-1" LastEditorDisplayName="user2278" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2013-03-19T11:16:03.187" Title="Scanning a stock database for errors/flaws" Tags="&lt;equities&gt;&lt;database&gt;&lt;error&gt;" AnswerCount="3" CommentCount="8" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7530" PostTypeId="2" ParentId="7521" CreationDate="2013-03-14T20:37:13.567" Score="2" Body="&lt;p&gt;I had to answer because of your name, and becaue I deal with portfolio optimization often. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my world of equities correlation does matter a lot. If one follows the thoughts e.g. &lt;a href=&quot;http://cssanalytics.wordpress.com/2012/07/16/diversification-and-risk-reduction/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; then it matters most. &#xA;I deal with minimum-variance construction (no expected return, of course some constraints on the weights) and there I often see positions that come into the min.var portfolio despite relatively high volatility  due to low correlation to the rest of the portfolio. &#xA;So in my mind: correlation does matter. I have more experience with long only portfolios but I have seen similar in long/short settings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you deal with currencies. If your optimization works with vola and expected returns then your expectations must work really good! One reason why taking correlations into account does nt improve the result even further could be because they vary too much in the long history that you use. Therefore they do not tell you enough for the coming week.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tell us some more about the data: how many currencies? Weekly returns? Which observation period for the covariance matrix? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I found a funny maybe useful app by FOREX on currency correlations. They seem to change a lot: &lt;a href=&quot;http://www.forexticket.co.uk/en/tools/01-01-correlation&quot; rel=&quot;nofollow&quot;&gt;http://www.forexticket.co.uk/en/tools/01-01-correlation&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2013-03-15T12:40:43.437" LastActivityDate="2013-03-15T12:40:43.437" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7531" PostTypeId="2" ParentId="7522" CreationDate="2013-03-15T03:15:45.513" Score="7" Body="&lt;p&gt;well, it is absolutely in agreement with theory. the correlation as measured by Pearson's coefficient $\rho$ is linear measure in the sense that the bounds [-1,1] are obtained only when transformations of our variables are &lt;strong&gt;linear&lt;/strong&gt;, so if we have variables $X$ and $Y$ then something like $aX+bY+c$ where $a,b\in\mathbb{R^*}$, $c\in\mathbb{R}$  will have boundaries [-1,1] on correlation coefficient&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but&lt;/p&gt;&#xA;&#xA;&lt;p&gt;as soon as we drift from linear transformation the boundaries differ and are closer to 0, how close it depends on the type of transformation used. and since brownian motion is not linear transformation of variables of interest the boundaries vanish.&#xA;as example of this I have attached below a result of my playing with two variables being lognormal distributed:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X~(0,1)$, and $Y~(0,\sigma^2)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;it &lt;a href=&quot;http://www.amazon.ca/Copula-Methods-Finance-Umberto-Cherubini/dp/0470863447&quot; rel=&quot;nofollow noreferrer&quot;&gt;can be shown&lt;/a&gt; (&lt;a href=&quot;http://www.gravitascapital.com/Research/Risk/Risk%20Measurement%20and%20Modelling/Aggregation%20of%20Correlated%20Risk%20Portfolios%20-%20Models%20and%20Algorithms.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;or here&lt;/a&gt;) that low and upper bounds on Pearson $\rho$ in this example are&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\rho_{low}={\frac{e^{-\sigma_X\sigma_Y} -1}{\sqrt{(e^{\sigma_X^2}-1})(e^{\sigma_Y^2}-1)}}$  ,  $\rho_{high}={\frac{e^{\sigma_X\sigma_Y} -1}{\sqrt{(e^{\sigma_X^2}-1})(e^{\sigma_Y^2}-1)}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;what is easy to see in my picture and almost identical to your results.&#xA;how can we deal with this fact? we can use different measures of concordance*, there are many of them, and possibilities are Kendal's tau or Spearmans rho for instance.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;so what measure of concordance is then? just some function satysfying few axioms, I will refer you again to the links above. correlation is NOT one of them since it doesn't satisfy vi) axiom given by Scarsini(1984) (about pointwise convergence: it doesn't converges when the copula (pointwise) does)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/LWLXH.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2017" LastEditorUserId="2017" LastEditDate="2013-03-15T21:10:00.473" LastActivityDate="2013-03-15T21:10:00.473" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7532" PostTypeId="1" CreationDate="2013-03-15T04:02:44.247" Score="3" ViewCount="318" Body="&lt;p&gt;Doe's any one know the history behind, or background of the multiple naming conventions for the equivalent risk functions. Different quant authors prefer using different names, does any one know why? which came first? why do some quants prefer one over the other. What is the history behind all of this.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ES - expected shortfall&#xA;CVaR - conditional value at risk &#xA;AVaR - average value at risk &#xA;ETL  - expected tail loss&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1764" LastActivityDate="2019-08-25T15:11:53.233" Title="Reasoning behind multiple names for the equivalent risk measures AVaR/ETL/ES/CVaR" Tags="&lt;risk-models&gt;&lt;var&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7533" PostTypeId="1" AcceptedAnswerId="7534" CreationDate="2013-03-15T17:02:02.370" Score="5" ViewCount="4269" Body="&lt;p&gt;How does $\Theta$ change for deep out-of-the money options? Looking at the below graph, it seems the time decay is highest for ATM options and increases rapidly as we approach maturity of the option. From the graph, it seems the deep OTM options have flat $\Theta$ throughout the entire term strucuture. Shouldn't the OTM options experience the most decay?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/zj4VC.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="4729" LastEditorUserId="35" LastEditDate="2013-03-15T17:12:35.857" LastActivityDate="2013-03-19T00:35:15.390" Title="Theta's effect for OTM options" Tags="&lt;options&gt;&lt;theta&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7534" PostTypeId="2" ParentId="7533" CreationDate="2013-03-15T17:22:22.320" Score="8" Body="&lt;p&gt;No because they are worthless in the first place. Theta is in dollar space and therefore, if something is worthless, it is hard for it to lose much more value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Think about it this way. When you are buying an option, you are really buying gamma from BS PDE. The cost of gamma is theta. Where is gamma highest? ATM&lt;/p&gt;&#xA;" OwnerUserId="3440" LastEditorUserId="3440" LastEditDate="2013-03-15T17:28:22.297" LastActivityDate="2013-03-15T17:28:22.297" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7535" PostTypeId="2" ParentId="7533" CreationDate="2013-03-15T17:49:13.067" Score="0" Body="&lt;p&gt;$\Theta$ measures the rate of change of the option value $V$ with time $t$ if the underlying asset $S$ doesn't move. since deep OTM options are almost worthless this change will be small if the asset will not move - they still will be worthless: at least they cannot change much in price since are almost worth 0.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;write Black-Scholes equaton as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Theta+\frac12\sigma^2S^2\Gamma+rS\Delta-rV=0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Theta=rV-\frac12\sigma^2S^2\Gamma-rS\Delta=r(V-S\Delta)-\frac12\sigma^2S^2\Gamma$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;since $\Gamma$ for OTM call option is close to 0 theta will be higher. and $V$ and $\Delta$ don't change(vary) much, so as the $\Theta$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;ofcourse this is just the rule of thumb since formula for $\Theta$ is not so easy to understand at the first glance, or even at 100th&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I made a picture which might help to understand this: notice relative stability of hadged portfolio $(V-\Delta S)$, negative (in this case) value of this doesn't vary much with respect to changes in spot when OTM, and vary more when close to ATM (ATM spot strike is 1.5178). this is the change in the &lt;strong&gt;second&lt;/strong&gt; term of equation for $\Theta$ that introduces much to the variation of it, it is $-\frac12\sigma^2S^2\Gamma$. and as said before, since $\Gamma$ converges to 0 for OTM options the shape of this term is as we can see in the picture.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/cUu8h.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/2PCXe.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2017" LastEditorUserId="2017" LastEditDate="2013-03-19T00:35:15.390" LastActivityDate="2013-03-19T00:35:15.390" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7536" PostTypeId="2" ParentId="7532" CreationDate="2013-03-15T19:02:29.577" Score="4" Body="&lt;p&gt;No specific history. I'm not aware who introduced this measure initially. Most probably it came up as an example in the research papers on coherent risk measure. All names make sense to some extent:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Expected shortfall&lt;/strong&gt; - as it's an expectation of losses&lt;br&gt;&#xA;&lt;strong&gt;Conditional Value at Risk&lt;/strong&gt; - as it can be written as $E[X |X &amp;gt;VaR_α(X)]$, i.e. conditional expectation&lt;br&gt;&#xA;&lt;strong&gt;Average value at risk&lt;/strong&gt; - as it can be written as $\frac{1}{1-\alpha}\int_{\alpha}^1VaR_{\beta}(X)d\beta$, which is essentially an average&#xA;&lt;strong&gt;Expected Tail Loss&lt;/strong&gt; - as it's expectation calculated in the tail of loss distribution  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's also sometimes called Tail VaR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personal preferences of people are usually based on their favorite risk management reference book. &lt;/p&gt;&#xA;" OwnerUserId="370" LastActivityDate="2013-03-15T19:02:29.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7537" PostTypeId="2" ParentId="7527" CreationDate="2013-03-15T19:06:58.357" Score="1" Body="&lt;p&gt;The description of your arbitrage strategy is very vague. Thus it's hard to answer your question. However, this alone makes your &quot;arbitrage&quot; strategy not &lt;a href=&quot;http://en.wikipedia.org/wiki/Admissible_trading_strategy&quot; rel=&quot;nofollow&quot;&gt;admissible&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;shorting the stock for arbitrary lengths of time&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Thus what you describe is not an arbitrage strategy. &lt;/p&gt;&#xA;" OwnerUserId="370" LastEditorUserId="35" LastEditDate="2013-03-15T20:43:19.577" LastActivityDate="2013-03-15T20:43:19.577" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7538" PostTypeId="1" AcceptedAnswerId="7540" CreationDate="2013-03-16T15:58:19.777" Score="6" ViewCount="2381" Body="&lt;p&gt;When using following risk-neutral random walk&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\delta S = rS \delta t + \sigma S \sqrt{\delta t} \phi$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\phi \sim N(0,1)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now when a text mentions drift = 5% does that mean that interest rate (r) is 5%? &lt;/p&gt;&#xA;" OwnerUserId="3336" LastEditorUserId="3336" LastEditDate="2013-03-16T16:27:03.147" LastActivityDate="2013-03-16T20:43:12.210" Title="Is drift rate the same as interest rate in risk-neutral random walk when using Monte Carlo for option pricing?" Tags="&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;risk-neutral-measure&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7540" PostTypeId="2" ParentId="7538" CreationDate="2013-03-16T19:32:53.823" Score="4" Body="&lt;p&gt;Yes. The risk neutral and the real path share the same volatility, so the difference is in the drift rate, where the risk-neutral path drifts with the risk-free rate r.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may want to check out Paul Willmots &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470319585&quot; rel=&quot;nofollow&quot; title=&quot;Paul Willmot introduces quant finance&quot;&gt;book&lt;/a&gt;, esp. ch. 26, for applications.&lt;/p&gt;&#xA;" OwnerUserId="1976" LastActivityDate="2013-03-16T19:32:53.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7541" PostTypeId="2" ParentId="7538" CreationDate="2013-03-16T20:43:12.210" Score="3" Body="&lt;p&gt;When using Monte Carlo for option pricing you numerically approximate expectation under a risk-neutral probability measure $Q$. Your undiscounted stock price process in GBM framework has as a drift equal to risk free rate under $Q$. So the answer to your question is affirmative.&lt;/p&gt;&#xA;" OwnerUserId="370" LastActivityDate="2013-03-16T20:43:12.210" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7542" PostTypeId="2" ParentId="7529" CreationDate="2013-03-16T21:37:22.517" Score="0" Body="&lt;p&gt;What you're talking about is &lt;em&gt;sanity checks&lt;/em&gt; and if you really have to do those, it's good grounds to classify the data source as unreliable (or, alternatively, your understanding of said data source is inadequate). Typically, when getting from Yahoo, you shouldn't need to do this.&lt;/p&gt;&#xA;" OwnerUserId="1217" LastActivityDate="2013-03-16T21:37:22.517" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7543" PostTypeId="2" ParentId="7529" CreationDate="2013-03-17T00:57:11.610" Score="6" Body="&lt;p&gt;Few points from my experience:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 Another filters that you that you should consider is for price = 999 or 999.99 that appears in some data providers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2 Another set of checks is to look at cross-section of e.g. range = (high-low)/close over all names. Check for the smallest range and largest range to see if the values make sense. You can also check daily % change from one day to another. Check all largest moves for errors in the data. Flash crash in the US have created huge ranges, but if you see abnormal ranges on different days, check out the quality of data. Also September 2008 there are many nonsensical values even in very liquid products. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;3 You have to be careful using yahoo (and other sources) for companies changing names, or going in / out of bankruptcy. &lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2013-03-17T00:57:11.610" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7545" PostTypeId="2" ParentId="7505" CreationDate="2013-03-18T13:54:13.150" Score="7" Body="&lt;p&gt;This leads to the same result as Alexeys answer. However, my reasoning is different. &#xA;$$&#xA;E[F_X(X+a)]=\int_{-\infty}^{\infty} F_X(x+a) f_X(x)dx=\int_{-\infty}^{\infty} \int_{-\infty}^{x+a}f_X(y)dy f_X(x)dx=\\&#xA;\int_{-\infty}^{\infty} \int_{-\infty}^{\infty} 1_{(-\infty,x+a]}(y) f_X(y) f_X(x)dydx=&#xA;\int_{-\infty}^{\infty} \int_{-\infty}^{\infty} 1_{_{\{y-x\le a\}}}(y) f_X(y) f_X(x)dydx.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The product of the two densities in the integral is the density of a bivariate Gaussian vector (X,Y), whose components are independent and follow a normal distribution $N(\mu,\sigma^2)$. Hence this integral is the same as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;E[1_{\{Y-X\le a\}}]=P[\{Y-X\le a\}],&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Y,X$ are iid $N(\mu,\sigma^2)$. Thus $Y-X$ has a $N(0,2\sigma^2)$ distribution. We get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;E[F_X(X+a)]=F_{Y-X}(a)=\Phi\left(\frac{a}{\sqrt{2}\sigma}\right).&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="4976" LastActivityDate="2013-03-18T13:54:13.150" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7546" PostTypeId="1" CreationDate="2013-03-18T14:48:26.013" Score="1" ViewCount="1016" Body="&lt;p&gt;Is Kolmogorov-Smirnov test self-sufficient to prove normal distribution of a time series? And then test efficiency of a market?&lt;/p&gt;&#xA;" OwnerUserId="4915" LastEditorUserId="35" LastEditDate="2013-03-18T15:19:51.687" LastActivityDate="2013-03-19T12:37:52.803" Title="Kolmogorov-Smirnov test" Tags="&lt;statistics&gt;" AnswerCount="3" CommentCount="10" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7547" PostTypeId="2" ParentId="7546" CreationDate="2013-03-18T19:11:44.063" Score="1" Body="&lt;p&gt;I think that knowing that price of every asset is a random walk is not enough to say that the market is efficient. What if prices of asset y and asset z follow the same price as x plus some noise. If x is a random walk, then y and z are also random walks; however, it would be possible to exploit their relationship via pairs trading; hence, markets are not efficient. In my example x could price of oil and y and z could be two oil companies prices of who's shares are closely related to the price of oil.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an illustration in Python:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import pylab&#xA;import random as rn&#xA;&#xA;def gen_random_walk(n):&#xA;    x = [100]&#xA;    for _ in xrange(n):&#xA;        change = rn.gauss(0, x[-1]/100.0)&#xA;        x.append(x[-1] + change)&#xA;    return x&#xA;&#xA;def plot_pair(n):&#xA;    x = gen_random_walk(n)&#xA;    noise_y = [rn.gauss(0, 1) for _ in xrange(n)]&#xA;    noise_z = [rn.gauss(0, 1) for _ in xrange(n)]&#xA;&#xA;    y = [ele_x + noise_y for ele_x, noise_y in zip(x, noise_y)]&#xA;    z = [ele_z + noise_y for ele_z, noise_y in zip(x, noise_z)]&#xA;&#xA;    pylab.plot(zip(y,z))&#xA;    pylab.show()&#xA;&#xA;plot_pair(250)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/QHEX5.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2512" LastEditorUserId="2512" LastEditDate="2013-03-18T19:16:48.537" LastActivityDate="2013-03-18T19:16:48.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7548" PostTypeId="2" ParentId="7546" CreationDate="2013-03-18T21:42:11.630" Score="2" Body="&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Kolmogorov%E2%80%93Smirnov_test&quot; rel=&quot;nofollow&quot;&gt;Wikipedia&lt;/a&gt; says&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In statistics, the Kolmogorov–Smirnov test (K–S test) is a&#xA;  nonparametric test for the equality of continuous, one-dimensional&#xA;  probability distributions that can be used to compare a sample with a&#xA;  reference probability distribution (one-sample K–S test), or to&#xA;  compare two samples (two-sample K–S test).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;so yes but also warns that a large number of data points might be required. Why don't you apply the &lt;a href=&quot;http://en.wikipedia.org/wiki/Jarque%E2%80%93Bera_test&quot; rel=&quot;nofollow&quot;&gt;Jarque-Bera&lt;/a&gt; test?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think I've a simpler example to show that a normal distribution does not imply market efficiency:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose security 1 prices are given by the GBM $X(t)$ and the prices of security 2 $X(t-1)$. Then returns are normally distributed but predictable.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2013-03-18T21:42:11.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7549" PostTypeId="2" ParentId="7529" CreationDate="2013-03-19T05:04:18.483" Score="2" Body="&lt;p&gt;The adjusted close will change after dividends and stock splits. So the old data will have to be replaced by the new. So it is usually a good idea to check for adj close of the downloaded values against current values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also like to check for downloaded data against some other source (like Google). I do this by writing a unit test that will randomly pick a date and download the data from Google and check against Yahoo's.&lt;/p&gt;&#xA;" OwnerUserId="2273" LastEditorUserId="35" LastEditDate="2013-03-19T11:16:03.187" LastActivityDate="2013-03-19T11:16:03.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7550" PostTypeId="2" ParentId="7526" CreationDate="2013-03-19T05:10:50.537" Score="2" Body="&lt;p&gt;yahoo provides adjusted_close. You could use this to detect splits&lt;/p&gt;&#xA;&#xA;&lt;p&gt;adjustment_factor = adjusted_close/close&lt;/p&gt;&#xA;&#xA;&lt;p&gt;change in adjustment_factor = adjustment_factor (yesterday's)/adjustment_factor(today)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if this number is less than 0.9 or greater than 1, you have a split&lt;/p&gt;&#xA;" OwnerUserId="2273" LastEditorUserId="2273" LastEditDate="2013-03-19T19:02:37.060" LastActivityDate="2013-03-19T19:02:37.060" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7551" PostTypeId="2" ParentId="7546" CreationDate="2013-03-19T12:37:52.803" Score="1" Body="&lt;p&gt;no. this test as same as any else can't say for 100% that distribution is normal. and how do you want to use it to test market efficiency? you didn't mention.&#xA;basically to test market efficiency the CAPM or APT model is used. you can find &lt;a href=&quot;http://people.su.se/~blars/lec8vt02.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; more info about it. in short it must holds that higher return correspond to higher $\beta$&lt;/p&gt;&#xA;" OwnerUserId="2017" LastActivityDate="2013-03-19T12:37:52.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7552" PostTypeId="2" ParentId="2870" CreationDate="2013-03-19T13:49:19.693" Score="1" Body="&lt;p&gt;A minimum variance portfolio is going to be the most diversified portfolio you can achieve given your portfolio weighting constraints. A diversified portfolio will nearly always achieve the best risk adjusted returns over the long term into an uncertain and unpredictable future. A max Sharpe portfolio by contrast is not only trying to overcome the uncertainty with the prediction of returns but it is also risk concentrated into it's precarious forecasts and therefore while a max Sharpe portfolio may out perform in certain periods of the short term it is most likely to under perform a min var portfolio over the medium to long term on a risk-adjusted basis. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore if you select the min var portfolio weights, it is possible to leverage these portfolios to achieve one's desired level of portfolio risk or absolute returns, so why would you not choose the more diversified approach, with other positive attributes such a low maximum drawdown etc.?&lt;/p&gt;&#xA;" OwnerUserId="4980" LastEditorUserId="35" LastEditDate="2013-03-19T14:16:32.250" LastActivityDate="2013-03-19T14:16:32.250" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7553" PostTypeId="2" ParentId="7532" CreationDate="2013-03-19T14:09:47.113" Score="3" Body="&lt;p&gt;I have also seen (in rough decreasing importance order): &#xA;&lt;strong&gt;Mean excess loss&lt;/strong&gt;, &#xA;&lt;strong&gt;Tail conditional expectation&lt;/strong&gt; and the variant C.T.E.,&#xA;&lt;strong&gt;Tail mean&lt;/strong&gt;,&#xA;&lt;strong&gt;Mean shortfall&lt;/strong&gt;...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;AVaR doesn't seem as common as the other three you mentioned.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://arxiv.org/pdf/cond-mat/0104295.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Acerbi and Tasche 2002&lt;/a&gt; discuss the difference between CVaR and ES.&#xA;In practice there's little mention on reasons for each choice and rarely any differences have a significant role so that all variants become equivalent. The different naming flavours mostly originate historically from various areas: &lt;em&gt;very&lt;/em&gt; roughly (from my concentrated and relatively limited sample) CVaR seems more en vogue among economists&amp;amp;traders, ES among risk managers, ETL among &quot;statisticians&quot;, TVaR in econometrics, CTE among actuaries etc...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For other formulations of ES check also &lt;a href=&quot;http://en.wikipedia.org/wiki/Spectral_risk_measure&quot; rel=&quot;nofollow noreferrer&quot;&gt;spectral&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/Distortion_risk_measure&quot; rel=&quot;nofollow noreferrer&quot;&gt;distortion risk measures&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3015" LastEditorUserId="42340" LastEditDate="2019-08-25T15:11:53.233" LastActivityDate="2019-08-25T15:11:53.233" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="7554" PostTypeId="1" AcceptedAnswerId="7564" CreationDate="2013-03-19T14:54:45.783" Score="7" ViewCount="457" Body="&lt;p&gt;In the &lt;a href=&quot;http://www2.gsb.columbia.edu/faculty/aang/book/Hedge%20Funds%2002-10-2013.pdf&quot; rel=&quot;noreferrer&quot;&gt;draft chapter about hedge funds&lt;/a&gt; of his forthcoming book Andrew Ang postulates the dawn of new factor funds (p. 35 ff.), i.e. funds that directly target factors like volatility, value-growth, size, momentum etc. and give investors direct access to factor risk premiums much more cheaply.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand the &lt;a href=&quot;http://blogs.wsj.com/totalreturn/2012/08/20/russell-etfs-we-hardly-knew-ye/&quot; rel=&quot;noreferrer&quot;&gt;Wall Street Journal reports&lt;/a&gt; that Russell Investments just closed down comparable investment vehicles (factor ETFs).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question&lt;/strong&gt;&lt;br&gt;&#xA;Do you know of any investable factor indices/ETFs/funds and/or any current activities that go into that direction and will be launched in the foreseeable future? These don't need to be restricted to the US, I am also interested in activities around the world. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;EDIT&lt;/em&gt;&lt;br&gt;&#xA;I am especially talking about the following risk premia (mainly, but not exclusively in equities, fixed income, derivatives):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Carry &lt;/li&gt;&#xA;&lt;li&gt;&quot;Curve&quot; or &quot;term premium&quot;&lt;/li&gt;&#xA;&lt;li&gt;Size&lt;/li&gt;&#xA;&lt;li&gt;Value&lt;/li&gt;&#xA;&lt;li&gt;Momentum and trend&lt;/li&gt;&#xA;&lt;li&gt;Liquidity&lt;/li&gt;&#xA;&lt;li&gt;Volatility&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For a good overview see: &lt;a href=&quot;http://www.indexuniverse.eu/europe/publications/journal-of-indexes/articles/8191-systematic-risk-premia-across-asset-classes.html?fullart=1&amp;amp;start=9&quot; rel=&quot;noreferrer&quot;&gt;Systematic Risk Premia Across Asset Classes&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2013-03-20T11:07:17.590" LastActivityDate="2013-03-20T11:07:17.590" Title="Examples of investable factors via factor funds/ETFs" Tags="&lt;index&gt;&lt;etf&gt;&lt;funds&gt;&lt;products&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7555" PostTypeId="1" AcceptedAnswerId="7565" CreationDate="2013-03-19T21:48:31.990" Score="4" ViewCount="130" Body="&lt;p&gt;I know this is a naïve question but how does the BS formula have a closed form solution? It seems from what I am reading Price impacts delta, price influences volatility which in turn influeces delta and gamma. BS seems to be an endogenous models. Is price the only exogenous variable in the model? How can find a closed form solution if every all the variables and are impacting one another? I appreciate any advice on the question.&lt;/p&gt;&#xA;" OwnerUserId="4729" LastActivityDate="2013-03-20T12:18:44.250" Title="Endogeniety of Black-Scholes" Tags="&lt;options&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7556" PostTypeId="1" CreationDate="2013-03-19T23:06:46.157" Score="2" ViewCount="592" Body="&lt;p&gt;This is more of a general question at this point, but if my thought process makes sense I  will follow up with an R implementation. I have read a number of papers on cointegration analysis for pairs trading. My thought was to apply cointegration to an analysis of investment manager returns. Typically investment-manager returns are regressed on factor returns to estimate risk exposures and alpha (intercept). Instead, I would like to use cointegration analysis to estimate risk exposures and alpha based on the level of cumulative wealth invested in a manager's strategy vs. various risk exposures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using R. My thought was to use a stepwise regression-type procedure based on AIC to find a good fit for manager returns with a parsimonious model. Basically the idea was to create a function that would step through various cointegration vectors, and arrive at the vector tested with the lowest AIC that results in stationary residuals based on an ADF test. I could then test for significant alpha using Newey-West standard errors. I have a few questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Is this a reasonable thing to do?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Given my knowledge of the risk exposures and investment managers, I think there exists only one cointegrating vector. Given this, does it make sense to use the Engle-Granger method?  This is much easier to work with in R for what I am trying to do.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If it is reasonable to use the Engle-Granger method with &lt;code&gt;lm()&lt;/code&gt;, in order to estimate alpha (a positive/negative drift in level of wealth over time), can I just add a vector of lenght N to the regression, where each value is equal to t? Then the estimated weight of this term would be equal to added wealth per period not explained by risk (manager skill).  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&lt;strong&gt;Edit&lt;/em&gt;&lt;/strong&gt; sample code is below.  I haven't included an algorithm to step through different&#xA;regression factors as I just included a simple equity manager, and adding and removing factors becomes more useful I think as you delve into alternatives and are looking at many more possible risk factors.  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;require(tseries)&#xA;require(sandwich)&#xA;require(lmtest)&#xA;&#xA;#---------------- Data--------------------------------------------------------------&#xA;&#xA;managerReturns&amp;lt;-ts(c(-0.008,0.022,0.061,0.013,-0.076,-0.041,0.063,-0.030,0.071&#xA;                    ,0.036,-0.010,0.055,0.018,0.039,0.002,0.036,0.003,-0.014&#xA;                    ,-0.033,-0.018,-0.055,0.069,0.004,0.019,0.028,0.018,0.028&#xA;                    ,-0.008,-0.037,0.048,0.003,0.019,0.025,-0.020,0.013,0.007),&#xA;                    start = c(2010,01),frequency=12)&#xA;&#xA;mkt&amp;lt;-ts(c(-0.0336,0.034,0.0632,0.02,-0.0789,-0.0556,0.0692,-0.0477,0.0954,0.0388,&#xA;       0.0061,0.0682,0.0201,0.0349,0.0048,0.029,-0.0127,-0.0175,-0.0234,-0.06,&#xA;       -0.076,0.1134,-0.0026,0.0074,0.0506,0.0443,0.0311,-0.0084,-0.062,0.0388,&#xA;       0.0079,0.0256,0.0274,-0.0175,0.0077,0.0118),start = c(2010,01),frequency=12)&#xA;&#xA;value&amp;lt;-ts(c(0.0019,0.0142,0.0157,0.0493,-0.0009,-0.0212,0.0013,-0.0289,0.0383,&#xA;         0.0103,0.0366,0.0075,-0.0246,0.0165,0.0259,-0.003,-0.0066,-0.0008,&#xA;         -0.0144,-0.0329,-0.0371,0.0357,-0.0025,-0.0055,0.0253,-0.0161,-0.0022,&#xA;         -0.0061,-0.0009,0.0083,-0.0257,0.0073,0.0045,-0.0104,0.0069,0.0165),&#xA;          start = c(2010,01),frequency=12)&#xA;&#xA;size&amp;lt;-ts(c(0.0061,0.0273,0.0206,0.0314,-0.0234,-0.0427,0.002,-0.017,-0.0305,&#xA;        -0.0228,-0.0051,0.036,0.0084,0.0167,-0.0119,-0.0227,-0.0214,-0.0045,&#xA;        -0.0112,-0.0146,-0.0091,-0.0102,-0.001,0.0154,-0.0221,-0.0003,-0.0003,&#xA;        -0.0019,0.0017,0.0039,-0.0003,0.0056,0.0159,0.0408,-0.0112,0.0329),&#xA;         start = c(2010,01),frequency=12)&#xA;&#xA;rf&amp;lt;-ts(c(0,0,0.0001,0,0.0001,0.0001,0.0001,0.0001,0.0001,0.0001,0.0001,0.0001,&#xA;      0.0001,0.0001,0.0001,0,0,0,0,0.0001,0,0,0,0,0,0,0,0,0.0001,0,0,0.0001,&#xA;      0.0001,0.0001,0.0001,0.0001),start = c(2010,01),frequency=12)&#xA;&#xA;mangerReturns&amp;lt;-log(managerReturns+1)&#xA;mkt&amp;lt;-log(mkt+1)&#xA;value&amp;lt;-log(value+1)&#xA;size&amp;lt;-log(size+1)&#xA;rf&amp;lt;-log(rf+1)&#xA;managerExcess&amp;lt;-managerReturns-rf&#xA;&#xA;# ----------------------------------- Returns based Factor Analysis----------------&#xA;&#xA;fit&amp;lt;-lm(managerExcess~mkt+value+size)&#xA;summary(fit)&#xA;&#xA;# ----------------------------------- Cointegration Analysis ----------------------&#xA;&#xA;lvlManager&amp;lt;-cumsum(managerExcess)&#xA;lvlMkt&amp;lt;-cumsum(mkt)&#xA;lvlValue&amp;lt;-cumsum(value)&#xA;lvlSize&amp;lt;-cumsum(size)&#xA;alpha&amp;lt;-seq(1,length(lvlManager))&#xA;&#xA;fit2&amp;lt;-lm(lvlManager~lvlMkt+lvlValue+lvlSize+alpha)&#xA;#Coefficient test with Newey-West Standard Errors&#xA;coeftest(fit2,NeweyWest(fit2))&#xA;#Check for stationarity&#xA;adf.test(residuals(fit2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4981" LastEditorUserId="508" LastEditDate="2013-06-22T20:55:55.973" LastActivityDate="2013-06-22T20:55:55.973" Title="Stepwise Cointegration" Tags="&lt;time-series&gt;&lt;r&gt;&lt;cointegration&gt;&lt;manager-analysis&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7558" PostTypeId="1" CreationDate="2013-03-20T00:42:58.440" Score="4" ViewCount="1005" Body="&lt;p&gt;Lévy processes are self-decomposable and independent on any non-overlapping interval, so how come the distribution of the process at time T,$\phi(T)$, which is the sum of N i.i.d with law $\phi(T/N)$ is not normally distributed ? &#xA;I cannot find what am I missing here ?&lt;/p&gt;&#xA;" OwnerUserId="3245" LastEditorUserId="92" LastEditDate="2013-03-20T19:31:55.973" LastActivityDate="2013-03-22T13:45:12.000" Title="Central Limit Theorem and Lévy processes" Tags="&lt;stochastic-processes&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7559" PostTypeId="1" CreationDate="2013-03-20T03:00:15.787" Score="0" ViewCount="711" Body="&lt;p&gt;I Calculated facebook option(expired in 12/4/13) Implied Volatility with the Bisection Method. The program will be attached at the end. The results for different strike prices are so different:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;                call    put     call    put     put&#xA;Stock Price     26.55   26.55   26.55   26.55   26.55&#xA;Strike Price    26.5    26.5    27      27      28&#xA;Time to maturity    0.06301&#xA;Risk Free Rate      1.88E-02&#xA;Dividend Yield  0       0       0       0&#xA;Option Price    0.87    0.86    0.63    1.08    1.65&#xA;&#xA;Result&#xA;Implied Volatility  0.312236566 0.308462006 0.306893589     0.477272194&#xA;    0.840291866&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can any tell me what's wrong with the program?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  Public TargetColume As Integer&#xA;&#xA;  Function BlackScholesCall( _ &#xA;    ByVal S As Double, _ &#xA;    ByVal X As Double, _ &#xA;    ByVal T As Double, _ &#xA;    ByVal r As Double, _ &#xA;    ByVal d As Double, _ &#xA;    ByVal v As Double) As Double &#xA;    Dim d1 As Double &#xA;    Dim d2 As Double &#xA;    d1 = (Log(S / X) + (r - d + v ^ 2 / 2) * T) / v / Sqr(T)&#xA;    d2 = d1 - v * Sqr(T) &#xA;    BlackScholesCall = Exp(-d * T) * S * Application.NormSDist(d1) - X * Exp(-r * T) * Application.NormSDist(d2)&#xA;  End Function &#xA;&#xA;  Function ImpliedVolatility( _ &#xA;    ByVal S As Double, _ &#xA;    ByVal X As Double, _ &#xA;    ByVal T As Double, _ &#xA;    ByVal r As Double, _ &#xA;    ByVal d As Double, _ &#xA;    ByVal Price As Double) As Double &#xA;&#xA;    Dim epsilonABS As Double &#xA;    Dim epsilonSTEP As Double &#xA;    Dim volMid As Double&#xA;    Dim niter As Integer &#xA;    Dim volLower As Double &#xA;    Dim volUpper As Double &#xA;&#xA;    epsilonABS = 0.0000001 &#xA;    epsilonSTEP = 0.0000001 &#xA;    niter = 0 &#xA;    volLower = 0.001 &#xA;    volUpper = 1 &#xA;&#xA;    Do While volUpper - volLower &amp;gt;= epsilonSTEP Or Abs(BlackScholesCall(S, X, T, r, d, volLower) - Price) &amp;gt;= epsilonABS And epsilonABS &amp;lt;= Abs(BlackScholesCall(S, X, T, r, d, volUpper) - Price) &amp;gt;= epsilonABS &#xA;      volMid = (volLower + volUpper) / 2 &#xA;      If Abs(BlackScholesCall(S, X, T, r, d, volMid) - Price) &amp;lt;= epsilonABS Then &#xA;        Exit Do &#xA;      ElseIf ((BlackScholesCall(S, X, T, r, d, volLower) - Price) * (BlackScholesCall(S, X, T, r, d, volMid) - Price) &amp;lt; 0) Then &#xA;        volUpper = volMid&#xA;      Else&#xA;        volLower = volMid &#xA;      End If&#xA;      niter = niter + 1&#xA;    Loop&#xA;&#xA;    ImpliedVolatility = volLower &#xA;&#xA;  End Function&#xA;&#xA;  Function CalcImpliedVolatility()&#xA;&#xA;  Dim S, X, T, r, d, Price As Double &#xA;  Dim volatility As Double &#xA;&#xA;  S = ActiveSheet.Cells(6, TargetColume).Value &#xA;  X = ActiveSheet.Cells(7, TargetColume).Value &#xA;  T = ActiveSheet.Cells(8, &quot;B&quot;).Value &#xA;  r = ActiveSheet.Cells(9, &quot;B&quot;).Value &#xA;  d = ActiveSheet.Cells(10, TargetColume).Value&#xA;  Price = ActiveSheet.Cells(11, TargetColume).Value &#xA;&#xA;  volatility = ImpliedVolatility(S, X, T, r, d, Price)&#xA;&#xA;  ActiveSheet.Cells(14, TargetColume).Value = volatility&#xA;&#xA;  End Function&#xA;&#xA;Private Sub CommandButton1_Click()&#xA;&#xA;  CalcImpliedVolatility&#xA;&#xA;End Sub&#xA;&#xA;Private Sub Worksheet_SelectionChange(ByVal Target As Range)&#xA;    TargetColume = Target.Column&#xA;End Sub&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4982" LastEditorUserId="1976" LastEditDate="2013-03-24T00:03:13.273" LastActivityDate="2013-03-24T00:03:13.273" Title="Why the implied volatilities calculated are so different" Tags="&lt;volatility&gt;&lt;black-scholes&gt;&lt;implied-volatility&gt;" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7560" PostTypeId="2" ParentId="7558" CreationDate="2013-03-20T03:57:34.233" Score="2" Body="&lt;p&gt;The Lévy theorem states that the conditions that have to be met for $M(t)$ to be a Brownian motion (and hence be normally distributed):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$M(t)$, for $t&amp;gt;0$, be a martingale relative to some filtration $F(t), t&amp;gt;0$.&lt;/li&gt;&#xA;&lt;li&gt;$M(0)= 0$&lt;/li&gt;&#xA;&lt;li&gt;$M(t)$ has continuous paths&lt;/li&gt;&#xA;&lt;li&gt;$[M,M](t) = t$ for all $t\geq0$;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So, to test each condition you simply differentiate your Lévy process (using Itô Calculus), change to the integrated form and you notice that at $t=0$ the stochastic integral takes the value zero, hence the expectation is always zero (at $t=0$). When you take the expectation of the stochastic integral you can isolate the following moment generating function:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}\left[\mathrm{exp}\left(uM(t)\right)\right] = \mathrm{exp}\left(\frac{1}{2} u^2t\right)$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is the MGF for the normal distribution with zero mean and variance $t$. Therefore your $M(t)$ Lévy process follows the same distribution and you just showed that also an $M(t)$ process follows normality. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your Levy process does not satisfy above conditions but still follows the general definition of a Levy processes as stated here: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://almostsure.wordpress.com/2010/11/23/levy-processes/&quot; rel=&quot;nofollow&quot;&gt;http://almostsure.wordpress.com/2010/11/23/levy-processes/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then you can utilize the characteristic functions. Since the characteristic function of a convolution is the product of the characteristic functions of the densities involved, the central limit theorem has yet another restatement: the product of the characteristic functions of a number of density functions becomes close to the characteristic function of the normal density as the number of density functions increases without bound, under the conditions stated above. However, to state this more precisely, an appropriate scaling factor needs to be applied to the argument of the characteristic function. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following shows how those scaling factors and drift adjustments can be made: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.stats.ox.ac.uk/~winkel/lp1.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.stats.ox.ac.uk/~winkel/lp1.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-03-21T03:22:18.050" LastActivityDate="2013-03-21T03:22:18.050" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="7561" PostTypeId="2" ParentId="7555" CreationDate="2013-03-20T04:10:49.423" Score="4" Body="&lt;p&gt;BS does not make any assumptions about the existence or lack thereof of endogenous variables. According to BS, an options price (equity option) can be determined from 5(6) variables: Price of the underlying, volatility, strike, time to expiration, interest rate, dividends (if applicable). None of those directly are derived from each other, however, a case can be made that there are correlation patterns that can be observed especially between asset prices (and their returns) and volatility. Also obviously interests are a function of time (some models even state that rates are composed of a deterministic function (sole function of time)). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However none of those possible causality patterns negate the validity of the BS model. Nobody argues that the BS model is perfect, it suffers from many simplifying assumptions but then please keep in mind that BS is merely a translation tool between prices and volatility and vice versa. Nothing more, nothing less. An options trader cannot make money simply by knowledge and application of the BS model. The model itself does not make any predictions, it does not spot any arbitrate opportunities (in fact one faulty assumption is that arbitrage does not exist). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In summary, so yes there are inputs to the BS model that may exhibit causality relationships (endogeneity), however, that does not mathematically contradict the correct derivation of BS, given all the assumptions made.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, the WIKI article regarding BS wrongly makes the assumption that dividends do not exist. The extension is so trivial that I would still consider it part of BS. Black's model is also by most considered a trivial extension of BS and hence part of the family. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-03-20T04:25:46.797" LastActivityDate="2013-03-20T04:25:46.797" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7562" PostTypeId="1" CreationDate="2013-03-20T07:05:37.077" Score="1" ViewCount="1270" Body="&lt;p&gt;Suppose I have 2 stocks $S_{1}$ and $S_{2}$:&#xA;\begin{align}&#xA;&amp;amp; dS_{1}=rS_{1}dt+\sigma_{1}S_{1}dB_{1}\\&#xA;&amp;amp; dS_{2}=rS_{2}dt+\sigma_{2}S_{2}dB_{2}\\&#xA;&amp;amp; dB_{1}dB_{2}=\rho dt&#xA;\end{align}&#xA;Then I have a option A with payoff $(S_{1}+S_{2}-K)^{+}$&#xA;and another option B with payoff $(S_{1}-S_{2}-K)^{+}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question: I want to know the rigorous proof of the relationship between option A/B and correlation $\rho$? Or you may tell me where I can find the proof?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuitively: when $\rho$ is increasing, will move aligned with each other, then we can think that $S_{1}+S_{2}$ will become larger, and $S_{1}+S_{2}$ will become smaller, the option A price will be bigger, Option B price will be smaller. So we think price of A is a increasing function of $\rho$ and price of $B$ is a decreasing function of $\rho$.&lt;/p&gt;&#xA;" OwnerUserId="4601" LastActivityDate="2013-03-20T07:05:37.077" Title="Correlation Sensitivity" Tags="&lt;correlation&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7563" PostTypeId="2" ParentId="7558" CreationDate="2013-03-20T08:47:56.323" Score="4" Body="&lt;p&gt;I believe your problem is that you're assuming all Lévy processes are stable with exponent $2$.  Here is what happens if we try to use your argument: Let $X$ be a Lévy process (that is a martingale, for simplicity).  At time $t$, for any $N$, we have&#xA;$$&#xA;X_t \sim\sum_{i=1}^N X^i \left(\frac{t}{N}\right),&#xA;$$&#xA;with each $X^i \left(\frac{t}{N}\right)$ i.i.d. and distributed like $X_{\frac{t}{N}}$.  In order to apply the Central Limit Theorem, to deduce the alleged normality of $X_t$, what we would want is&#xA;$$&#xA;X^i \left(\frac{t}{N} \right) \sim \frac{1}{\sqrt{N}} X^i,&#xA;$$&#xA;where now the $X^i$ are a sequence of i.i.d random variables which don't depend on $N$ anymore (i.e. each $X^i \sim X_t$)  This is &lt;strong&gt;critical&lt;/strong&gt;, because the CLT only applies to a fixed sequence of random variables.  This then &lt;em&gt;would&lt;/em&gt; yield&#xA;$$&#xA;X_t \sim \frac{1}{\sqrt{N}} \sum_{i=1}^N X^i,&#xA;$$&#xA;which, as $N \rightarrow \infty$, would fit the template of the Central Limit Theorem (of course up to variance conditions)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This property (that $X_{\frac{t}{N}} \sim \frac{1}{\sqrt{N}} X_t$), however, is not enjoyed by an arbitrary Lévy martingale (although it is satisfied by Brownian Motion).  Consequently, if you carried out this argument in general, you would have to use a &lt;strong&gt;triangular array&lt;/strong&gt; of random variables, (see my comment below on these objects) which give rise to stable distributions through a generalization of the CLT.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The more general scaling property for a Lévy process is that $X$ satisfies&#xA;$$&#xA;X_t / t^{1/\alpha} \sim X_1,&#xA;$$&#xA;with $\alpha$ being known as the exponent of the process.  This is the basic property of the &lt;em&gt;stable processes&lt;/em&gt;, which are a subset of the Lévy processes.  The Poisson Process, for example, isn't stable, while the Cauchy process is stable with exponent $1$.  A $2$-stable process must be Gaussian&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to add a new argument, which attempts to explain the following fact: If $X$ is a Levy process, then it is Gaussian &lt;strong&gt;if and only if&lt;/strong&gt; it has continuous paths.  This is a technical argument, and indeed it basically constitutes half of the Levy decomposition theorem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\xi_{nj}$ be a &lt;strong&gt;triangular null array&lt;/strong&gt; of independent random variables.  This means $\xi_{nj}$ is defined, for $1 \leq j \leq m_n$, for each $n \in \mathbb{N}$, and $\sup_j E\left[ |\xi_{nj}| \wedge 1 \right] \rightarrow 0$ as $n \rightarrow \infty$.  This is like a uniform convergence in probability to zero, as $n \rightarrow \infty$.  I'm going to cite a Theorem due to Feller and Levy.  I found it in &quot;Foundations of Modern Probability&quot; by Kallenberg.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Theorem&lt;/strong&gt; Let $\xi_{nj}$ be a triangular null array.  $\sum_j \xi_{nj}$ converges to a normal r.v. $\xi \sim N(b,c)$ if and only if the following three conditions hold:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\sum_j P(|\xi_{nj}| &amp;gt; \epsilon) \rightarrow 0 \text{ for all } \epsilon &amp;gt; 0,&#xA;$$&#xA;$$&#xA;\sum_j E \left[\xi_{nj} ; |\xi_{nj}| \leq 1 \right] \rightarrow b,&#xA;$$&#xA;$$&#xA;\sum_j var \left[\xi_{nj} ; |\xi_{nj}| \leq 1 \right] \rightarrow c&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The proof of this theorem is not easy.  Message me if you'd like to get more details.  However, the upshot is that, assuming this theorem, we see that path continuity is essentially equivalent to the first condition, with $\xi_{nj}$ representing the $j^{th}$ increment of $X$ with the $n^{th}$ grid.  Mean and variance control are the second and third conditions, respectively.&lt;/p&gt;&#xA;" OwnerUserId="3415" LastEditorUserId="3415" LastEditDate="2013-03-22T13:45:12.000" LastActivityDate="2013-03-22T13:45:12.000" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7564" PostTypeId="2" ParentId="7554" CreationDate="2013-03-20T10:38:30.270" Score="3" Body="&lt;p&gt;Here couple ETFs that may satisfy what you are looking for:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.quant-shares.com/etf-list/&quot; rel=&quot;nofollow&quot;&gt;http://www.quant-shares.com/etf-list/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.etc.db.com/GBR/ENG/Institutional/Downloads/ISIN/Factsheets/GB00B4N0QN94&quot; rel=&quot;nofollow&quot;&gt;http://www.etc.db.com/GBR/ENG/Institutional/Downloads/ISIN/Factsheets/GB00B4N0QN94&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://guggenheiminvestments.com/products/etf/wmcr&quot; rel=&quot;nofollow&quot;&gt;http://guggenheiminvestments.com/products/etf/wmcr&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://etfdb.com/type/investment-style/high-beta/&quot; rel=&quot;nofollow&quot;&gt;http://etfdb.com/type/investment-style/high-beta/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Those include ETFs with a momentum approach, mean-reversion approach, micro cap approach, and high-beta approach. Just a small subset of the many others available, but it should answer your question that yes, there are plenty such ETFs out there. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-03-20T10:38:30.270" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7565" PostTypeId="2" ParentId="7555" CreationDate="2013-03-20T12:09:52.360" Score="2" Body="&lt;p&gt;Just as an aside: The BS formula is not so &lt;em&gt;closed&lt;/em&gt; after all (it of course all depends on your definition of &lt;em&gt;closed form&lt;/em&gt;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$c(S,K,t,r,\sigma)=$$ $$S\frac{1}{\sqrt{2\pi{}}}\int_{-\infty{}}^{\frac{\ln{\left(\frac{S}{K}\right)}+\left(r+\frac{{\sigma{}}^2}{2}\right)t}{\sigma{}\sqrt{t}}}e^{-\frac{x^2}{2}}dx-e^{-rt}K\frac{1}{\sqrt{2\pi{}}}\int_{-\infty{}}^{\frac{\ln{\left(\frac{S}{K}\right)}+\left(r-\frac{{\sigma{}}^2}{2}\right)t}{\sigma{}\sqrt{t}}}e^{-\frac{x^2}{2}}dx$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So lots of integrals, logarithms, square roots, fractions, $e$’s, $π$’s and infinity here and everything has to be evaluated. The only thing that makes life easier is that these integrals (normal distribution) turn up so often in maths that they get their own abbreviation, where everything is hidden behind and this is then called &lt;em&gt;closed form&lt;/em&gt;. This is why BS always looks so nice and simple. Just saying...&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2013-03-20T12:18:44.250" LastActivityDate="2013-03-20T12:18:44.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7566" PostTypeId="2" ParentId="7558" CreationDate="2013-03-20T12:48:49.407" Score="1" Body="&lt;p&gt;A very good question. In other words you ask why the central limit theorem does not hold, right? A sum of iid should be somehow normal, right? Looking at the Levy-Kinchin representation we see the Gaussian part, which comes from increments of a continuous process, and the rest from the jumps. So one answer (which is not mathematically rigorous) is the presence of jumps. Another reason is that a Levy process can have infinite moments (also because of the jumps).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we the process is continuous then it is Gaussian (if and only if). The jumps enrich the model but of course make if much more complicated.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2013-03-20T12:48:49.407" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7568" PostTypeId="1" AcceptedAnswerId="8045" CreationDate="2013-03-20T17:56:07.767" Score="36" ViewCount="114405" Body="&lt;p&gt;Is there any known solution (preferably open source) to map between ticker symbols, Reuters and Bloomberg symbols. For example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Ticker: &lt;strong&gt;AAPL&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;Reuters: &lt;strong&gt;AAPL.O&lt;/strong&gt; (may be prefixed with &lt;strong&gt;RSF.ANY.&lt;/strong&gt; dependent upon infrastructure)&lt;/li&gt;&#xA;&lt;li&gt;Bloomberg: &lt;strong&gt;AAPL US Equity&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Edit: by mapping I mean translating from one symbol naming convention to another. For example let's say we have RSF.ANY.AAPL.O and want to get Bloomber equivalent, which is &quot;AAPL US Equity&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit2: Fixed Bloomber mapping, it should be &quot;AAPL US Equity&quot; not &quot;AAPL:US&quot;&lt;/p&gt;&#xA;" OwnerUserId="3308" LastEditorUserId="19419" LastEditDate="2016-02-12T06:49:01.390" LastActivityDate="2021-01-14T13:26:57.193" Title="Mapping symbols between tickers, Reuters RICs and Bloomberg tickers" Tags="&lt;market-data&gt;&lt;tick-data&gt;&lt;bloomberg&gt;&lt;reuters&gt;" AnswerCount="12" CommentCount="10" FavoriteCount="23" ContentLicense="CC BY-SA 3.0" />
  <row Id="7569" PostTypeId="2" ParentId="7559" CreationDate="2013-03-20T19:10:29.787" Score="1" Body="&lt;p&gt;you can use this code&#xA;from Uwe Wystup FX Options and Structured Products. you can find it online.&#xA;it uses vega and taylor expansion (just to 1st derivative which is vega) to find vol. you have to have code for european call price, but you have it already&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Function VanillaVolRetriever(spot As Double, rd As Double,rf As Double, strike As Double, T As Double, type As Integer, GivenValue As Double) As Double&#xA;Dim func As Double&#xA;Dim dfunc As Double&#xA;Dim maxit As Integer ’maximum number of iterations&#xA;Dim j As Integer&#xA;Dim s As Double&#xA;’first check if a volatility exists, otherwise set result to zero&#xA;If GivenValue&amp;lt;Application.Max(0,type*(spot*Exp(-rf*T)-strike*Exp(-rd * T)))Or(type = 1 And GivenValue &amp;gt; spot*Exp(-rf * T)) Or (type = -1 And GivenValue &amp;gt; strike * Exp(-rd * T)) Then VanillaVolRetriever = 0&#xA;Else&#xA;’ there exists a volatility yielding the given value,&#xA;’ now use Newton’s method:&#xA;’ the mapping vol to value has a saddle point.&#xA;’ First compute this saddle point:&#xA;saddle = Sqr(2/T * Abs(Log(spot / strike) + (rd - rf) * T))&#xA;If saddle &amp;gt; 0 Then&#xA;   VanillaVolRetriever = saddle * 0.9&#xA;Else&#xA;   VanillaVolRetriever = 0.1&#xA;End If&#xA;  maxit = 100&#xA;For j = 1 To maxit Step 1&#xA;   func = Vanilla(spot, strike, VanillaVolRetriever, rd, rf, T, type, value) - GivenValue&#xA;   dfunc = Vanilla(spot, strike, VanillaVolRetriever,rd, rf, T, type, vega)&#xA;   VanillaVolRetriever = VanillaVolRetriever - func / dfunc&#xA;   If VanillaVolRetriever &amp;lt;= 0 Then&#xA;      VanillaVolRetriever = 0.01&#xA;   If Abs(func / dfunc) &amp;lt;= 0.0000001 Then j = maxit&#xA;Next j&#xA;End If&#xA;End Function&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;you can find it also &lt;a href=&quot;http://mathfinance2.com/MF_website/download.aspx?AttachmentRef=34&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;it is absolutely OK that they are different dependent on strike, you would suspect there's bug in your function otherwise. &#xA;this is reality: we use BS model with const vol assumption and we quote different vol for different strike/delta&lt;/p&gt;&#xA;" OwnerUserId="2017" LastEditorUserId="2017" LastEditDate="2013-03-20T20:36:45.210" LastActivityDate="2013-03-20T20:36:45.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7572" PostTypeId="1" AcceptedAnswerId="7583" CreationDate="2013-03-21T07:15:16.423" Score="8" ViewCount="348" Body="&lt;p&gt;I'm building some models, for example, Bad Loan (NPL) rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's based on historical simulation method -- basically it's saying the future behavior could be predicted by history data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, this is not always true, when the market changes. For example, when 2008 financial crisis came, NPL rates went up; when there's a tax cut, the NPL drops.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, whenever market changes, the model will fail, but after a few months, it will pick up the trend and work again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, how could I defend my model? How to justify that the failure is acceptable? Is there some industry standard / criterion about the tolerance of model mismatch caused by external factors (e.g. market, economics)?&lt;/p&gt;&#xA;" OwnerUserId="2161" LastEditorUserId="35" LastEditDate="2013-03-21T11:09:43.700" LastActivityDate="2013-03-22T08:36:19.010" Title="How to justify a model that could not predict external factors?" Tags="&lt;modeling&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7573" PostTypeId="1" AcceptedAnswerId="7580" CreationDate="2013-03-21T07:24:07.140" Score="2" ViewCount="514" Body="&lt;p&gt;I am trying to get historical data for credit risk and do some analysis on it as a school project. I thought CDX index might be a good proxy for typical credit risk data, but I am not sure. Typically what might be a good and also accessible set of data for credit risk of a financial institution.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, if CDX is a good proxy, where can I find historical data for it. I get nothing out of Bloomberg and Markit.com. Is it an extra on Bloomberg?&lt;/p&gt;&#xA;" OwnerUserId="3245" LastEditorUserId="35" LastEditDate="2013-03-21T11:11:11.810" LastActivityDate="2013-03-21T14:37:50.727" Title="Credit risk data" Tags="&lt;market-data&gt;&lt;credit-risk&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7574" PostTypeId="1" AcceptedAnswerId="7577" CreationDate="2013-03-21T12:37:02.207" Score="0" ViewCount="2156" Body="&lt;p&gt;I was trying to run some Monte-Carlo simulations and if I used:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;rng(seed, 'Twister');&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For some reason I would get &quot;Option Values Can not be Negative&quot; errors in the blsimpv function, but if I just use the rand (seed) function, the problem seems to be OK (having everything else the same).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, aren't both of them the similar function? (i.e., generate a whole bunch of random numbers).  If so, why is one giving me issues and the other is OK?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I post this is Quant since this is related to the implementation of quant models, hope that is OK.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="3595" LastActivityDate="2013-03-21T12:50:12.337" Title="Matlab - Differences between rng and rand" Tags="&lt;matlab&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7575" PostTypeId="2" ParentId="7573" CreationDate="2013-03-21T12:37:45.310" Score="1" Body="&lt;p&gt;As others have noted, Markit is a great source for this.  For CDX in particular, they publish on a daily basis their &lt;a href=&quot;http://www.markit.com/en/about/news/commentary/cds/cds.page&quot; rel=&quot;nofollow&quot;&gt;&quot;Biggest Credit Movers&quot;&lt;/a&gt; which includes CDX, iTraxx, iBoxx, Sovereign Credit improvement/deterioration, and Corporate credit improvement/deterioration.  Here is a &lt;a href=&quot;http://www.markit.com/assets/en/docs/commentary/markit-movers/2011/BigMovers200313.pdf&quot; rel=&quot;nofollow&quot;&gt;sample&lt;/a&gt; report, which you can also sign up to have emailed to you every day.  Keep in mind that this list will only include the largest changes and not the widest spreads/riskiest credit, but for your purposes might prove to have all the data you need.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, they have pretty thorough documentation of their methodology, definitions, and &lt;a href=&quot;http://www.markit.com/en/products/data/indices/credit-and-loan-indices/index-annexes/annexes.page?&quot; rel=&quot;nofollow&quot;&gt;index components&lt;/a&gt;, which is a huge plus plus.&lt;/p&gt;&#xA;" OwnerUserId="2732" LastEditorUserId="2732" LastEditDate="2013-03-21T12:42:53.840" LastActivityDate="2013-03-21T12:42:53.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7576" PostTypeId="1" CreationDate="2013-03-21T12:44:12.537" Score="2" ViewCount="153" Body="&lt;p&gt;I am just wondering if there is any problem with the so-called &quot;exact&quot; Heston simulations? So far what I have seen are the good things about it, what are the disadvantages? Because if it is so perfect, why is everyone not using the &quot;exact&quot; simulation since it would reduce the discretization error?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="3595" LastActivityDate="2013-03-21T12:44:12.537" Title="Problems with exact Heston simulations" Tags="&lt;simulations&gt;&lt;heston&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7577" PostTypeId="2" ParentId="7574" CreationDate="2013-03-21T12:50:12.337" Score="3" Body="&lt;p&gt;No, &lt;code&gt;rng&lt;/code&gt; does not do the same as &lt;code&gt;rand&lt;/code&gt;. &lt;code&gt;rng&lt;/code&gt; sets the seed for the random number generator and &lt;code&gt;rand&lt;/code&gt; generates random numbers. Also it can be seen in documentation that the &lt;code&gt;rng&lt;/code&gt; function only accepts positive integers. Usually random number generator algorithms start with integers for the seed. For various examples: C random function takes the system clock as seed as it does Minecraft's world generator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Doc: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.mathworks.co.uk/help/matlab/ref/rng.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;rnd&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.mathworks.co.uk/help/matlab/ref/rand.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;rand&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="4988" LastActivityDate="2013-03-21T12:50:12.337" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7578" PostTypeId="1" CreationDate="2013-03-21T13:26:25.377" Score="1" ViewCount="486" Body="&lt;p&gt;Let you have only three underlyings, like SPY, TLT and GLD, and you want to buy $n_{1}$ Call options on SPY, $n_{2}$ Call options on TLT and $n_{3}$ Call options on GLD... with a limited budget, that is obvious.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You know those three underlyings, $S_{i}$ where $i=1,2,3$, are correlated as explained by $P$ correlation matrix and $V$ annualized covariance matrix (in case, with implied volatilities in main diagonal).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Being moneyness and maturity equal for each Call option written on each underlying, my goal is to find the value of $n_{1}, n_{2}$ and $n_{3}$ in order to make often good profits over time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What was my step-by-step proceedings in such a case?&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Calculating pseudo-square root matrix of $V$, that is $\Sigma$, via eigenvalue decomposition;&lt;/li&gt;&#xA;&lt;li&gt;setting an horizon of 30 days, that is $T=30/365=0.082$ years;&lt;/li&gt;&#xA;&lt;li&gt;simulating 10,000 correlated multi-dimensional GBM stochastic processes with risk free rate drift, $\Sigma$ diffusion matrix and $T$ terminal time;&lt;/li&gt;&#xA;&lt;li&gt;calculating arithmetic returns separately for each underlying as $R_{T}=\frac{S_{T}}{S_{0}}-1$.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If I had bought the underlying securities, I would have linear P&amp;amp;L and I could choose my favorite performance (risk) measure to be maximized (minimized), like Omega, Expected Shortfall, Tail Dependance, Drawdown etc.; but in this case I'm dealing with options, which have not linear P&amp;amp;L due to convexity (Gamma).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means you're looking for realized volatility (dispersion of $S_{T}$) higher than implied volatility regardless of weighted returns trend, because Call options already defend you against drawdowns and tail risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence my question is: making $n_{1}, n_{2}$ and $n_{3}$ varying over time, what's the measure I should maximize or minimize to&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;maximize my returns;&lt;/li&gt;&#xA;&lt;li&gt;maximize my Sharpe;&lt;/li&gt;&#xA;&lt;li&gt;making my return shape distribution the best possible&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;...buying &lt;strong&gt;only&lt;/strong&gt; Call options on those underlying securities?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the &lt;code&gt;R&lt;/code&gt; reproducible code to maximize long Call options modified Sharpe ratio.&#xA;In the real world book's options prices should be used, but in this example I've used BMS formula with GARCH(1,1) volatility to estimate them and their change over time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please, tell me if you think there are theoretical and/or practical mistakes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# ======================================================== #&#xA;# Managing options portfolio risk                          #&#xA;# Stochastic optimization of several correlated securities #&#xA;# By Lisa Ann for Quantitative Finance @ StackExchange                                                  #&#xA;# ======================================================== #&#xA;&#xA;# Contents:&#xA;&#xA;# 1. Loading packages&#xA;# 2. Downloading datas and preparing environment&#xA;# 3. Estimating orthogonal GARCH(1,1) covariance matrix&#xA;# 4. Simulating stochastic n-dimensional diffusion processes with 'n' equations&#xA;# 5. Correlated geometric Brownian motions returns&#xA;# 6. Pricing options at the end of simulation&#xA;# 7. Optimization of portfolio modified Sharpe&#xA;&#xA;# *********************************&#xA;# 1. Loading packages&#xA;# *********************************&#xA;&#xA;library(DEoptim)&#xA;library(quantmod)&#xA;library(RQuantLib)&#xA;library(Rsolnp)&#xA;library(rugarch)&#xA;&#xA;# 'yuima' package from R-Forge&#xA;&#xA;install.packages(&quot;yuima&quot;, repos=&quot;http://R-Forge.R-project.org&quot;)&#xA;library(yuima)&#xA;&#xA;# You can download 'rmgarch' package from:&#xA;# https://rmgarch.googlecode.com/files/rmgarch_1.00-4.zip&#xA;&#xA;library(rmgarch)&#xA;&#xA;# *********************************&#xA;# 2. Downloading datas and preparing environment&#xA;# *********************************&#xA;&#xA;# We will start with few assets which represent main asset classes: SPY for &#xA;# equity, TLT for Government bonds and GLD for gold. We will add more assets&#xA;# later on&#xA;&#xA;tickers &amp;lt;- c('SPY', 'TLT', 'GLD')&#xA;getSymbols(tickers, from = '1950-01-01')&#xA;&#xA;# 3-Month London Interbank Offered Rate (LIBOR), based on U.S. Dollar&#xA;&#xA;getSymbols('USD3MTD156N', src = 'FRED')&#xA;&#xA;# Merging close-to-close arithmetic returns&#xA;&#xA;xinit &amp;lt;- as.vector(tail(na.omit(merge(Cl(SPY), Cl(TLT), Cl(GLD))), 1))&#xA;data &amp;lt;- na.omit(merge(ClCl(SPY), ClCl(TLT), ClCl(GLD)))&#xA;xyplot(data)&#xA;&#xA;# Risk free rate proxy&#xA;&#xA;r.f &amp;lt;- as.numeric(tail(USD3MTD156N, 1) / 100)&#xA;&#xA;# *********************************&#xA;# 3. Estimating orthogonal GARCH(1,1) covariance matrix&#xA;# *********************************&#xA;&#xA;# We have to set our time horizon&#xA;&#xA;n.ahead &amp;lt;- 30&#xA;&#xA;# Covariance matrix forecast&#xA;&#xA;spec &amp;lt;- gogarchspec(mean.model = list(model = 'constant'), &#xA;                    variance.model = list(model = 'apARCH',&#xA;                                          garchOrder = c(1,1)),&#xA;                    distribution.model = 'manig')&#xA;fit &amp;lt;- gogarchfit(spec = spec, data = data)&#xA;forecast &amp;lt;- gogarchforecast(fit = fit, n.ahead = n.ahead)&#xA;V &amp;lt;- rcov(forecast)[[1]][,,n.ahead]&#xA;colnames(V) &amp;lt;- rownames(V) &amp;lt;- tickers&#xA;V&#xA;&#xA;# *********************************&#xA;# 4. Simulating stochastic n-dimensional diffusion processes with 'n' equations&#xA;# *********************************&#xA;&#xA;# Eigenvalue decomposition of coavariance matrix:&#xA;# a is the matrix for which we want to square root, then&#xA;# a.eig &amp;lt;- eigen(a)&#xA;# a.sqrt &amp;lt;- a.eig$vectors %*% diag(sqrt(a.eig$values)) %*% solve(a.eig$vectors)&#xA;&#xA;s.eig &amp;lt;- eigen(V)&#xA;sigma.ch &amp;lt;- s.eig$vectors %*% diag(sqrt(s.eig$values)) %*% t(s.eig$vectors)&#xA;colnames(sigma.ch) &amp;lt;- rownames(sigma.ch) &amp;lt;- tickers&#xA;sigma.ch&#xA;&#xA;# Stochastic differential equations&#xA;&#xA;n &amp;lt;- ncol(data)&#xA;drift &amp;lt;- paste('r.f * x', 1:n, sep = '')&#xA;diffusion &amp;lt;- matrix(NA, n, n)&#xA;&#xA;for(i in 1:n){&#xA;  for(j in 1:n){&#xA;    diffusion[i,j] &amp;lt;- paste(sigma.ch[i,j], ' * x', j, sep = '')&#xA;  }&#xA;}&#xA;&#xA;object &amp;lt;- setModel(drift = drift, diffusion = diffusion, &#xA;         solve.variable = paste('x', 1:n, sep = ''))&#xA;&#xA;# Sampling grid properties: 'n.ahead' days and number of intervals&#xA;&#xA;sampling &amp;lt;- setSampling(Terminal = n.ahead / 365, n = n.ahead * 1)&#xA;&#xA;# Plotting simulations to check SDEs behaviour follows covariance matrix&#xA;&#xA;plot(simulate(object = object, xinit = xinit, sampling = sampling), lwd = 2,&#xA;     type = 'o', col = 1:n)&#xA;&#xA;# *********************************&#xA;# 5. Correlated geometric Brownian motions&#xA;# *********************************&#xA;&#xA;# Starting values&#xA;&#xA;S.0 &amp;lt;- matrix(xinit, nrow = 10000, ncol = n, byrow = TRUE)&#xA;&#xA;# Terminal values&#xA;&#xA;S.T &amp;lt;- matrix(NA, nrow = 10000, ncol = n)&#xA;&#xA;for(i in 1:10000){&#xA;  for(j in 1:n){&#xA;    sim &amp;lt;- simulate(object = object, xinit = xinit, sampling = sampling)&#xA;    S.T[i,j] &amp;lt;- tail(sim@data@zoo.data[[j]], 1)&#xA;  }&#xA;}&#xA;&#xA;colnames(S.T) &amp;lt;- tickers&#xA;par(mfrow = c(n,n))&#xA;&#xA;for(j in 1:n){&#xA;  hist(S.T[,j], xlab = tickers[j], freq = FALSE,&#xA;       main = paste('Probability of', tickers[j], 'being at', &#xA;                    expression(S(T)), n.ahead, 'periods from today'))&#xA;  lines(density(S.T[,j]), lwd = 2)&#xA;}&#xA;&#xA;par(mfrow = c(1,1))&#xA;&#xA;# *********************************&#xA;# 6. Pricing options at the end of simulation&#xA;# *********************************&#xA;&#xA;# Now we have to price Call options at time 'T' to see true performances&#xA;# Estimating volatility of underlyings&#xA;&#xA;spec &amp;lt;- ugarchspec(variance.model = list(model = 'sGARCH', garchOrder = c(1,1)),&#xA;                   mean.model = list(armaOrder = c(0,0)),&#xA;                   distribution.model = 'norm')&#xA;&#xA;# Function to estimate underlying volatility&#xA;&#xA;hv &amp;lt;- function(x, t, n.ahead){&#xA;  fit &amp;lt;- ugarchfit(spec = spec, data = x)&#xA;  forc &amp;lt;- ugarchforecast(fit, n.ahead = n.ahead)&#xA;  sigma &amp;lt;- forc@forecast$sigmaFor[t]&#xA;  return(sigma)&#xA;}&#xA;&#xA;# Volatilities at '0' and at 'T'&#xA;&#xA;sigma.0 &amp;lt;- apply(X = data, MARGIN = 2, FUN = hv, t = 1, &#xA;                 n.ahead = n.ahead) * sqrt(252)&#xA;sigma.0.vec &amp;lt;- matrix(sigma.0, nrow = nrow(S.0), ncol = n, byrow = TRUE)&#xA;sigma.T &amp;lt;- apply(X = data, MARGIN = 2, FUN = hv, t = n.ahead, &#xA;                 n.ahead = n.ahead) * sqrt(252)&#xA;sigma.T.vec &amp;lt;- matrix(sigma.T, nrow = nrow(S.T), ncol = n, byrow = TRUE)&#xA;barplot(rbind(sigma.0, sigma.T), beside = TRUE, legend.text = TRUE,&#xA;        ylab = 'Annualized Volatility')&#xA;&#xA;# Options prices at 'S.0'&#xA;# We consider (ATM + 1) strikes for Call options&#xA;&#xA;strike &amp;lt;- ceiling(S.0) + 1&#xA;call.0 &amp;lt;- matrix(NA, nrow = nrow(S.0), ncol = n)&#xA;&#xA;for(i in 1:nrow(S.0)){&#xA;  for(j in 1:n){&#xA;    call.0[i,j] &amp;lt;- EuropeanOption(type = 'call', underlying = S.0[i,j], &#xA;                                  strike = strike[i,j], dividendYield = r.f, &#xA;                                  riskFreeRate = r.f, &#xA;                                  maturity = (n.ahead * 2) / 365,&#xA;                                  volatility = sigma.0.vec[i,j])$value  &#xA;  }&#xA;}&#xA;&#xA;# Options prices at 'S.T'&#xA;&#xA;call.T &amp;lt;- matrix(NA, nrow = nrow(S.T), ncol = n)&#xA;&#xA;for(i in 1:nrow(S.T)){&#xA;  for(j in 1:n){&#xA;    call.T[i,j] &amp;lt;- EuropeanOption(type = 'call', underlying = S.T[i,j], &#xA;                                  strike = strike[i,j], dividendYield = r.f, &#xA;                                  riskFreeRate = r.f, maturity = n.ahead / 365,&#xA;                                  volatility = sigma.T.vec[i,j])$value    &#xA;  }&#xA;}&#xA;&#xA;# Call buyer returns&#xA;&#xA;call.r &amp;lt;- call.T / call.0 - 1&#xA;&#xA;# *********************************&#xA;# 7. Optimization of portfolio modified Sharpe&#xA;# *********************************&#xA;&#xA;# Call weighted returns function&#xA;&#xA;call.w &amp;lt;- function(w){&#xA;  ret &amp;lt;- call.r %*% w&#xA;  mu &amp;lt;- mean(ret)&#xA;  q &amp;lt;- quantile(ret, probs = .05)&#xA;  risk &amp;lt;- mean(ret[ret &amp;lt; q])&#xA;  return(- (mu - r.f) / risk)&#xA;}&#xA;&#xA;# Optimization&#xA;&#xA;par &amp;lt;- DEoptim(fn = call.w, lower = rep(10, n), upper = rep(100, n),&#xA;               control = DEoptim.control(strategy = 6, &#xA;                                         itermax = 1000))$optim$bestmem&#xA;par / sum(par)&#xA;round(solnp(pars = runif(3, 0, 1), fun = call.w, eqfun = function(w){sum(w)},&#xA;            eqB = 1, LB = rep(0, n), UB = rep(1, n), &#xA;            control = list(innter.iter = 10000))$pars, 4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;At the end of optimization, my budget is allocated on SPY, TLT and GLD according to optmal weights.&lt;/p&gt;&#xA;" OwnerUserId="3058" LastEditorUserId="3058" LastEditDate="2013-03-24T11:12:00.117" LastActivityDate="2013-03-24T11:12:00.117" Title="Call options portfolio: what would the underlyings' moments to be maximized?" Tags="&lt;optimization&gt;&lt;stochastic-processes&gt;&lt;option-strategies&gt;&lt;diversification&gt;&lt;performanceanalytics&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7579" PostTypeId="2" ParentId="7568" CreationDate="2013-03-21T14:00:37.427" Score="2" Body="&lt;p&gt;I will be adding here some resources that I found during the research, hopefully it will turn useful for others:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.linkedin.com/groups/master-symbol-database-most-cost-98173.S.51776671&quot; rel=&quot;nofollow&quot;&gt;http://www.linkedin.com/groups/master-symbol-database-most-cost-98173.S.51776671&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Reuters_Instrument_Code&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Reuters_Instrument_Code&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="3308" LastEditorUserId="3308" LastEditDate="2014-08-01T14:40:38.987" LastActivityDate="2014-08-01T14:40:38.987" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7580" PostTypeId="2" ParentId="7573" CreationDate="2013-03-21T14:37:50.727" Score="3" Body="&lt;p&gt;CDX &lt;strong&gt;is&lt;/strong&gt; available from Bloomberg at no extra cost, though they do not (so far as I know) form a total-return series that takes rolls into account.  See, for example, &lt;code&gt;CDX HY CDSI S19 5Y PRC Corp&lt;/code&gt; or Bloomberg ID &lt;code&gt;CXPHY519&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2013-03-21T14:37:50.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7582" PostTypeId="2" ParentId="7572" CreationDate="2013-03-22T01:52:39.863" Score="2" Body="&lt;p&gt;it was meant to be a comment, so please don't treat it like an answer, just suggestion.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I think every department has its own standards. and if you want to constitute your model somehow, then you can just compute R^2 between real and fitted values, &lt;a href=&quot;http://en.wikipedia.org/wiki/Root-mean-square_deviation&quot; rel=&quot;nofollow&quot;&gt;RMSD&lt;/a&gt;, information capacity criteria (AIC/BIC) or you can use any from tens other measures. you can also state that there is some long-run relationship, and these deviations are just short term deviations from the long-run equilibrium, maybe ECM (error correction) model is appropriate.&lt;/p&gt;&#xA;" OwnerUserId="2017" LastActivityDate="2013-03-22T01:52:39.863" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7583" PostTypeId="2" ParentId="7572" CreationDate="2013-03-22T05:50:49.783" Score="3" Body="&lt;p&gt;Well, typically in the process of coming up with a model you are supposed to understand the assumptions that you're making and the circumstances(preferably quantifiable) under which your assumptions will hold/break. No model is infallible and it is how well the assumptions are stated and understood that will determine  if your model is acceptable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't really provide any specific suggestions since I don't know about the fine details of what you're doing. But I'd looking into applying some form of granger causality metric if time-series are involved or to measure the non-stationarity of the data(entropy and f-divergences). &lt;/p&gt;&#xA;" OwnerUserId="2886" LastActivityDate="2013-03-22T05:50:49.783" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7585" PostTypeId="2" ParentId="7572" CreationDate="2013-03-22T08:36:19.010" Score="1" Body="&lt;p&gt;I think most models failed in the 2008 crisis. Historical simulation and e.g. a value-at-risk calculated from it is designed for normal to &quot;medium&quot; market behavior. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To account for crisis scenarios stress tests should be in place. This what is done e.g. in the &lt;a href=&quot;http://en.wikipedia.org/wiki/Undertakings_for_Collective_Investment_in_Transferable_Securities_Directives&quot; rel=&quot;nofollow&quot;&gt;USCITS&lt;/a&gt; framework.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, after the crisis your model should keep this history &quot;in mind&quot;. &lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2013-03-22T08:36:19.010" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7586" PostTypeId="1" CreationDate="2013-03-22T12:22:59.913" Score="12" ViewCount="644" Body="&lt;p&gt;In the academic applied probability/math finance community, Backwards Stochastic Differential Equations (BSDE's) are extremely popular, and they provide a single framework for several different problems, notably hedging and utility maximization, where models of market imperfections might stop older models.  The basic setup in a high level sense, is that you specify a terminal condition (i.e. what you might like to hedge at the end of a trading period), and the dynamics in time backwards from that point.  For those interested, they are not equivalent to forward SDE's precisely because there is a filtration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to know if people are using these devices in practice, and for what purposes, and basically, what is the state of the art?&lt;/p&gt;&#xA;" OwnerUserId="3415" LastEditorUserId="3415" LastEditDate="2013-03-22T12:31:35.930" LastActivityDate="2013-03-25T21:56:35.843" Title="Are BSDE's used in practice?" Tags="&lt;stochastic-processes&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7587" PostTypeId="2" ParentId="7375" CreationDate="2013-03-22T19:33:59.753" Score="3" Body="&lt;p&gt;It can be difficult to obtain market capitalization for some types of assets. Instead, you can use the weights to an arbitrary benchmark portfolio. That would be like backing out the returns that would result in you investing in the benchmark portfolio if you don't have any views.&lt;/p&gt;&#xA;" OwnerUserId="56" LastActivityDate="2013-03-22T19:33:59.753" CommentCount="0" CommunityOwnedDate="2013-03-22T19:33:59.753" ContentLicense="CC BY-SA 3.0" />
  <row Id="7588" PostTypeId="2" ParentId="530" CreationDate="2013-03-22T20:47:19.230" Score="1" Body="&lt;p&gt;I've found John Ehler's Fisher Transform quite useful as an indicator in trading futures particularly on Heikin-Ashi tick charts. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I rely on it for my strategy but I don't think it is reliable enough to base an entire automated system on its own because it has not proven reliable during choppy days but it can be quite useful on trend days like today. (I'd be happy to post a chart to illustrate but I don't have the reputation needed)&lt;/p&gt;&#xA;" OwnerUserId="4938" LastActivityDate="2013-03-22T20:47:19.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7589" PostTypeId="1" AcceptedAnswerId="7590" CreationDate="2013-03-23T05:22:23.440" Score="3" ViewCount="365" Body="&lt;p&gt;So basically&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$dS_t=\mu S_tdt+\sigma S_tdWt$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$\mu=r-\frac12\sigma^2$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I have just been thinking about this later equation. This is very interesting because it ties together risk-free rate, volatility and asset drift. I always like and try to look at equation from some simple perspective, for example assuming that something is huge or very small or 0, and trying to watch how it impacts other variables. This is good approach to remember some dependencies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So looking at this later equation, first thing to note is the negative sign of volatility. This is OK when trying to explain why VIX is index of fear and that &quot;investors&quot; don't like increase in volatilities.  But increasing risk-free rate in macroeconomics theory translates to increased demand for bonds and decrease in demand for stocks, so their prices drop - this assumption is quite real in today's market - when US Treasuries yields rise stocks go down and vice versa. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this is not in agreement with this also fundamental assumption $\mu=r-\frac12\sigma^2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do you interpret this fact?&lt;/p&gt;&#xA;" OwnerUserId="2017" LastEditorUserId="2609" LastEditDate="2013-03-23T15:13:19.193" LastActivityDate="2013-03-23T17:26:37.473" Title="Black-Scholes and Fundamentals" Tags="&lt;volatility&gt;&lt;interest-rates&gt;&lt;black-scholes&gt;&lt;risk-neutral-measure&gt;&lt;fundamentals&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7590" PostTypeId="2" ParentId="7589" CreationDate="2013-03-23T09:01:26.587" Score="10" Body="&lt;p&gt;I think you are interpreting too much into the matter. The $-\frac12\sigma^2$ is just a correction term that comes from &lt;a href=&quot;http://en.wikipedia.org/wiki/Jensen%27s_inequality&quot;&gt;Jensen's inequality&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need this when switching from supposedly symmetric returns (&lt;a href=&quot;http://en.wikipedia.org/wiki/Normal_distribution&quot;&gt;normal distribution&lt;/a&gt;) to the skewed price process (&lt;a href=&quot;http://en.wikipedia.org/wiki/Log-normal_distribution&quot;&gt;log-normal distribution&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think there are no deeper truths to be found here.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2013-03-23T09:01:26.587" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7591" PostTypeId="2" ParentId="7589" CreationDate="2013-03-23T14:57:53.597" Score="3" Body="&lt;p&gt;One thing to keep in mind here is that the world of risk-free/arbitrage-free models is not necessarily the real world.  Specifically, this equation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\mu = r - \frac{1}{2}\sigma^2&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;occurs not because this is the way stocks behave in reality (they don't!  For S&amp;amp;P 500, long-run $\mu$ is closer to 6-9%, if I recall correctly), but because using any other number in the pricing formula would create arbitrage.  &lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2013-03-23T17:26:37.473" LastActivityDate="2013-03-23T17:26:37.473" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7592" PostTypeId="2" ParentId="7559" CreationDate="2013-03-23T20:48:57.113" Score="2" Body="&lt;p&gt;The line&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Dim S, X, T, r, d, Price As Double &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is better written as &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Dim S As Double, X As Double, T As Double, r As Double, d As Double, Price As Double&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;because 'as' only applies to the variable directly before it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The bisection algorithm seems to work as advertised. You could check with an online calculator such as &lt;a href=&quot;http://www.numa.com/cgi-bin/numa/calc_op.pl&quot; rel=&quot;nofollow&quot;&gt;this one&lt;/a&gt;. I've rewritten the function to be more efficient and shorter although I believe the initial output was also correct but the column header are wrong, some puts are calls and the code for puts is not included. Anyway here is the code.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Private Const maxIter As Long = 100000#&#xA;Private Const epsilonABS As Double = 0.0000001&#xA;Private Const epsilonSTEP As Double = 0.0000001&#xA;&#xA;Public Function ImpliedVolatility( _&#xA;  S As Double, X As Double, T As Double, r As Double, d As Double, _&#xA;  Price As Double _&#xA;) As Double&#xA;&#xA;  Dim volMid As Double, valMid As Double, diff As Double&#xA;  Dim niter As Integer&#xA;&#xA;  volLower = 0.001&#xA;  volUpper = 1&#xA;  niter = 0       &#xA;  Do&#xA;    volMid = (volLower + volUpper) / 2&#xA;    valMid = BlackScholesCall(S, X, T, r, d, volMid)&#xA;    diff = Abs(valMid - Price)&#xA;&#xA;    If valMid &amp;gt; Price Then&#xA;      volUpper = volMid&#xA;    Else&#xA;      volLower = volMid&#xA;    End If&#xA;&#xA;    niter = niter + 1&#xA;  Loop While volUpper - volLower &amp;gt;= epsilonSTEP And diff &amp;gt; epsilonABS And _&#xA;      niter &amp;lt; maxIter&#xA;&#xA;  ImpliedVolatility = volMid&#xA;&#xA;End Function&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="848" LastEditorUserId="848" LastEditDate="2013-03-23T21:54:02.500" LastActivityDate="2013-03-23T21:54:02.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7593" PostTypeId="2" ParentId="7375" CreationDate="2013-03-24T00:46:42.720" Score="5" Body="&lt;p&gt;For Black-Litterman you need to have weights of the market portfolio, or a close benchmark, where you know the asset allocation. The common approach in practice is to find a large fund with a low tracking error for your investment universe. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Depending on your goal it may be enough to have the allocation over classes of your fund, which will allow you to extract expected returns for the subclasses, rather than individual securities. One way I have seen in practice is to use the endowment funds of Harvard, Yale, etc., as there is some data available (from their investment offices). That is the reason you rarely see a more specific implementation, just like you describe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the point remains, you need to find some asset allocation for the market portfolio. &lt;/p&gt;&#xA;" OwnerUserId="1976" LastActivityDate="2013-03-24T00:46:42.720" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7598" PostTypeId="1" CreationDate="2013-03-25T02:55:01.717" Score="2" ViewCount="732" Body="&lt;p&gt;I have constructed a mean reverting spread using two indexes. I know they have to be mean reverting, but when plotted side by side they are mean reverting for a little bit and then deviate and head one direction, all because of a few returns. I was wondering what the proper way of normalizing the trend or dealing with a non-stationary mean in a reverting series?&lt;/p&gt;&#xA;" OwnerUserId="5003" LastEditorUserId="467" LastEditDate="2013-03-25T10:39:50.707" LastActivityDate="2013-03-25T10:39:50.707" Title="Mean Reverting Spread" Tags="&lt;pairs-trading&gt;&lt;mean-reversion&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7599" PostTypeId="1" CreationDate="2013-03-25T03:42:04.127" Score="3" ViewCount="2971" Body="&lt;p&gt;There's 30 days worth of data at &lt;a href=&quot;http://www.otcmarkets.com/marketActivity/symbol-changes&quot; rel=&quot;nofollow&quot;&gt;http://www.otcmarkets.com/marketActivity/symbol-changes&lt;/a&gt; - but I'm really looking for the past 10 years, or 5 years if only that is possible. Any dice?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The closest I've come, and this is not really cutting it, is looking up a stock via Yahoo! Finance and seeing &quot;TICKER is no longer valid. It has changed to NEWTICKER&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But that's not helpful; for example in the case of Skye industries, it used to trade as SKYY.  But now SKYY tracks some sort of cloud computing ETF.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Happy to pay for the data.&lt;/p&gt;&#xA;" OwnerUserId="5004" LastEditorUserId="467" LastEditDate="2013-03-25T10:43:44.580" LastActivityDate="2021-03-10T15:00:46.907" Title="Where can I get historical ticker change database?" Tags="&lt;data&gt;&lt;historical-data&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7600" PostTypeId="1" AcceptedAnswerId="7602" CreationDate="2013-03-25T13:22:36.133" Score="5" ViewCount="257" Body="&lt;p&gt;From &lt;a href=&quot;http://www.wilmott.com/pdfs/110309_riaz_wilmott.pdf&quot; rel=&quot;noreferrer&quot;&gt;this paper&lt;/a&gt;. page 3&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We get that the total profit at expiration is the difference in value between the price of the option with actual volatility and the one with implied volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried solving the integral but I don't get the same result. I especially don't understand why the incremental value in both options cancel each other out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$e^{r\cdot t_0} \int_{t_0}^T d\left(e^{-r\cdot t}(V^i - V^a)\right) = V^a - V^i$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used the expression of the differential to solve the integral in the hope of getting the same result, but I get stuck with terms in $dV^i$ and $dV^a$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \left(e^{-r\cdot T} - e^{-r.\cdot t_0}\right)\left[ (dV^a - dV^i)/r  - (V^a - V^i) \right]$$&lt;/p&gt;&#xA;" OwnerUserId="5005" LastEditorUserId="3263" LastEditDate="2013-03-25T14:50:53.693" LastActivityDate="2013-03-25T16:25:24.337" Title="Hedging with actual volatility: problem understanding the math behind the result" Tags="&lt;options&gt;&lt;hedge&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7601" PostTypeId="2" ParentId="7568" CreationDate="2013-03-25T14:35:38.510" Score="1" Body="&lt;p&gt;Bloomberg provides unique identifiers, I assume Reuters does the same thing.  It might be a good idea to use those, or at least track them.  Presumably you have pricing data on each of these?  You could always check a few close prices against each other to check if  you have matched the strings correctly.&lt;/p&gt;&#xA;" OwnerUserId="4981" LastActivityDate="2013-03-25T14:35:38.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7602" PostTypeId="2" ParentId="7600" CreationDate="2013-03-25T15:53:58.723" Score="6" Body="&lt;p&gt;The integration is over a full differential, meaning we can write:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \int_{t_i}^T df(t) = f(T) - f(t_i)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, $V^i$ and $V^a$ represent the 'implied' and 'actual' value of the option, meaning they are time-dependent. This gives:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$e^{r\cdot t_0} \int_{t_0}^T d\left(e^{-r\cdot t}(V^i - V^a)\right) =&#xA;e^{-r(T-t_0)} (V^i(T) - V^a(T)) - (V^i(t_i) - V^a(t_i))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next, we use the fact that at the time of expiration the value of the options is completely determined by the stock price, and independent of the volatility. This means: $V^i(T) = V^a(T)$. What remains is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$e^{r\cdot t_0} \int_{t_0}^T d\left(e^{-r\cdot t}(V^i - V^a)\right) = V^a(t_i) - V^i(t_i)  = V^a - V^i$$&lt;/p&gt;&#xA;" OwnerUserId="3371" LastEditorUserId="3371" LastEditDate="2013-03-25T16:25:24.337" LastActivityDate="2013-03-25T16:25:24.337" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7603" PostTypeId="2" ParentId="7586" CreationDate="2013-03-25T16:40:21.947" Score="4" Body="&lt;p&gt;Hi here are my two cents,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is true that BSDE's framework represents a very powerful theoretical tool to attack abstract problems in mathematical finance. Nevertheless to my knowledge they are very rarely used in practice for at least three reasons. First they are very &quot;unnatural&quot; in their expression (integrating in the future in time and still being adapted goes against intuition), second the numerics for BSDE's approximation are not fully mature and even if some algorithms do exist they are exotic and complex so the investments they require is usually considered to big to be worthy, and third there exists for most of real life problems at hand some other solutions that already do the job for the same purpose that BSDE can be used for. So in my opinion unless one can prove a gain of at least a factor of complexity using BSDEs, we will probably never see them used a lot in practice. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best regards&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="92" LastEditDate="2013-03-25T21:56:35.843" LastActivityDate="2013-03-25T21:56:35.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7604" PostTypeId="1" AcceptedAnswerId="7616" CreationDate="2013-03-25T19:51:24.233" Score="12" ViewCount="24759" Body="&lt;p&gt;&lt;em&gt;Volatility skew&lt;/em&gt; tells us that options with the same maturity at different strikes can have different implied vol. However, can a corresponding call and put for the same strike and maturity have different implied vol?&lt;/p&gt;&#xA;" OwnerUserId="4729" LastEditorUserId="2183" LastEditDate="2017-08-08T06:04:47.843" LastActivityDate="2017-08-08T06:04:47.843" Title="Does implied vol vary for calls vs puts?" Tags="&lt;options&gt;&lt;implied-volatility&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7605" PostTypeId="1" AcceptedAnswerId="7685" CreationDate="2013-03-25T20:25:53.787" Score="1" ViewCount="324" Body="&lt;p&gt;Has a relationship been noted?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mostly, I'd like to know if the open interest increases on an underlying, does the underlying usually see increased trading?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My guess would be &quot;yes&quot; since MMs can only mostly hedge with the underlying, and they must constantly rehedge (buy or sell) the underlying everytime the underlying changes, possibly as volatility futures, interest rates, etc do too.&lt;/p&gt;&#xA;" OwnerDisplayName="user3232" LastEditorDisplayName="user3232" LastEditDate="2013-03-25T21:10:53.367" LastActivityDate="2013-04-07T15:47:50.303" Title="changes in open interest vs changes in underlying volume" Tags="&lt;options&gt;&lt;market-making&gt;&lt;volume&gt;&lt;open-interest&gt;&lt;delta-hedging&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7607" PostTypeId="2" ParentId="7604" CreationDate="2013-03-26T00:00:32.197" Score="3" Body="&lt;p&gt;First: what you use in the call or put formula is volatility of underlying; it is the same underlying, so volatility implied by call and put has to be the same. It is vol of underlying asset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remember put-call parity&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$call-put=S-e^{-rt}K$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$call=put+S-e^{-rt}K$     by a pure arbitrage rule&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means that volatility of call, as variable equal to put+constant, is the same as volatility of put. Since only volatility induced to both of these comes from volatiity of the asset, I am sure it can be shown that this volatilty of asset must be the same for call and put.&lt;/p&gt;&#xA;" OwnerUserId="2017" LastEditorUserId="35" LastEditDate="2013-03-26T00:50:24.513" LastActivityDate="2013-03-26T00:50:24.513" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7609" PostTypeId="1" CreationDate="2013-03-26T01:48:05.063" Score="2" ViewCount="628" Body="&lt;p&gt;I don't know if I'm doing this right and I'd greatly appreciate help.&#xA;I'm trying to use an option pricing formula to backout the likelihood of the Euro dropping below $1.27, even for a minute, at any time by April 10.  My calculations are in an excel worksheet labeled &quot;Current&quot; here:&#xA;&lt;a href=&quot;https://www.dropbox.com/s/sggti4iji5tjfne/binary-american-option.xlsx&quot; rel=&quot;nofollow&quot;&gt;https://www.dropbox.com/s/sggti4iji5tjfne/binary-american-option.xlsx&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The formula is from here: &lt;a href=&quot;http://www.matthiasthul.com/joomla/attachments/article/70/American%20Digital.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.matthiasthul.com/joomla/attachments/article/70/American%20Digital.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    3/25/2013       Today's Date&#xA;    4/10/2013       End Date&#xA;B=  1.27        strike price &#xA;S0= 1.28652     spot price&#xA;T=  0.043835616     time to strike date (years)&#xA;sigma=  0.0896      volatility of underlying, measured in std dev of annual % change&#xA;r=  -0.001      risk free interest rate&#xA;&#xA;            below this line calculated automatically&#xA;alpha=  -0.00501408     &#xA;beta=   0.00301408      &#xA;&#xA;ratio=  0.987159158     &#xA;logratio=   -0.012923998        &#xA;zscore1=    -0.695973397        &#xA;zscore2=    -0.681887312        &#xA;&#xA;cumnormal1  0.243222745     &#xA;cumnormal2  0.247655105     &#xA;&#xA;factor1 1.003224855     &#xA;factor2 1.013007874     &#xA;&#xA;term1   0.244007103     &#xA;term2   0.250876571     &#xA;&#xA;price   0.494883674     &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2382" LastEditorUserId="2382" LastEditDate="2013-03-26T04:12:12.413" LastActivityDate="2013-03-26T09:31:28.177" Title="Calculating the probability of a price change using an options pricing formula" Tags="&lt;options&gt;&lt;forecasting&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7610" PostTypeId="2" ParentId="7605" CreationDate="2013-03-26T02:15:22.957" Score="3" Body="&lt;p&gt;&quot;does the underlying usually see increased trading?&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not necessarily. Most market makers do not re-hedge much in the underlying. In many markets the delta is exchanged (off-exchange) alongside the options trade at initiation, making both parties delta neutral at the outset. Re-hedges in large vol books are generally accomplished through other options and only residual delta is hedged in the underlying. But it obviously depends on the specific asset class and market convention as well as individual approach to trading such options. I am just saying that an academic paper will not be able to cover all those ifs, again it depends on above-mentioned variables. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-03-26T02:15:22.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7611" PostTypeId="2" ParentId="7604" CreationDate="2013-03-26T02:27:02.307" Score="8" Body="&lt;p&gt;Implied volatility does not have to be equal (so yes, it can be different) for a call and put of same underlying, underlying borrow rates, time to expiration, strike if:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If the underlying is a stock and the underlying cannot be easily borrowed for short selling&lt;/li&gt;&#xA;&lt;li&gt;If there are dividends or other costs of carry involved&lt;/li&gt;&#xA;&lt;li&gt;If there is not unlimited liquidity in the market&lt;/li&gt;&#xA;&lt;li&gt;In the absence of market turbulence. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In the absence of those such call and put should have matching implied volatility, under Put-Call parity. Please keep in mind above conditions can be met much more often than most academic papers suggest. I can name you multiple examples for each above mentioned points that occurred just over the past 10 years that may have pushed the call and put implied vols significantly out of whack, sometimes for short periods of time, sometimes longer periods. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-03-26T02:27:02.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7613" PostTypeId="2" ParentId="7609" CreationDate="2013-03-26T09:31:28.177" Score="3" Body="&lt;p&gt;I you want to look at an option-pricing method, you would have to look at a &lt;strong&gt;down-and-in&lt;/strong&gt; &lt;a href=&quot;http://en.wikipedia.org/wiki/Barrier_option&quot; rel=&quot;nofollow&quot;&gt;barrier option&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Down-and-in&lt;/strong&gt;: spot price starts above the barrier level and has to move down for the option to become activated.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But the thing is, you do not have to look at an option pricing formula, you just need a model and a handle on probability theory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, if you assume the classic &lt;a href=&quot;http://en.wikipedia.org/wiki/Geometric_Brownian_motion&quot; rel=&quot;nofollow&quot;&gt;Geometric Brownian Motion&lt;/a&gt;, then you will be able to find a close form solution in this &lt;a href=&quot;https://www.google.ch/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=2&amp;amp;ved=0CDwQFjAB&amp;amp;url=http://www.math.unl.edu/~sdunbar1/MathematicalFinance/Lessons/StochasticCalculus/GeometricBrownianMotion/geometricbrownian.pdf&amp;amp;ei=pFxRUamoOKmQ7AaV1IHgAg&amp;amp;usg=AFQjCNF5437X9dBp-52EVehYfZLbmrtsTA&amp;amp;bvm=bv.44158598,d.ZGU&quot; rel=&quot;nofollow&quot;&gt;article&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2013-03-26T09:31:28.177" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7614" PostTypeId="1" CreationDate="2013-03-26T17:40:26.863" Score="5" ViewCount="205" Body="&lt;p&gt;Adding more variables to a model usually increases its accuracy. However, without adequate analysis it could also lead to &lt;em&gt;curve fitting&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another question (&lt;a href=&quot;https://quant.stackexchange.com/questions/1891/how-much-data-is-needed-to-validate-a-short-horizon-trading-strategy?rq=1&quot;&gt;How much data is needed to validate a short-horizon trading strategy?&lt;/a&gt;) received answers related to the statistical significance of the standard error of the model. However, I wonder if anyone has results (or analysis) of &lt;strong&gt;what should be the ratio of sample data to dimensions used in a model&lt;/strong&gt;. My intuition has led me to use at least 30 times more sample data points than variables implemented as dimensions but I am not happy with this approach. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess that this would depend on the characteristics of the model (it would be different for linear regressions, SVM, non-linear models, etc. and also dependent on the relationships among the variables used) but &lt;strong&gt;is there a general framework for estimating this?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="5006" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2013-04-07T18:00:17.113" Title="How does the number of free dimensions of a model affect its required size of sample?" Tags="&lt;regression&gt;&lt;nonlinear&gt;&lt;svm&gt;&lt;dimensions&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7615" PostTypeId="2" ParentId="7614" CreationDate="2013-03-26T18:45:32.403" Score="3" Body="&lt;p&gt;The following is a good way to judge the quality of fits for a model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Akaike_information_criterion&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Akaike_information_criterion&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3440" LastActivityDate="2013-03-26T18:45:32.403" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7616" PostTypeId="2" ParentId="7604" CreationDate="2013-03-26T19:35:08.520" Score="19" Body="&lt;p&gt;Taking away all  frictions and incomplentess of the market, the theory says that &lt;em&gt;European&lt;/em&gt; Call and Puts do have the same implied volatility unless there is an arbitrage opportunity by put call parity&#xA;$$&#xA;C(t,K) - P(t,K) = DF_t(F_t - K)\ . &#xA;$$&#xA;If you plug the Black-Scholes formula here for the prices of the call and the put, you will see that the equality only holds if and only if volatilities are equal. &#xA;$$&#xA;DF_t[F_t(\Phi(d_+^{Call}) + \Phi(-d_+^{Put})) - K(\Phi(d_-^{Call}) + \Phi(-d_-^{Put}))] = DF_t(F_t-K)&#xA;$$&#xA;Since $\Phi(x)+\Phi(-x)=1$, put call parity holds if and only if $d_\pm^{Call} = d_\pm^{Put}$, so if and only if $\sigma_{Call}(t,K) = \sigma_{Put}(t,K)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice there are bid-ask spreads and liquidity issues which implies that observable prices of &lt;em&gt;European&lt;/em&gt; options do no align necessarily to the theory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For &lt;em&gt;American&lt;/em&gt; options (the standard options traded on Equity stocks) we can still think in terms of implied volatility but there is no such thing as a put-call parity so implied volatilities are not necessarily equal anymore. There are some put-call parity style inequalities but those are not strong enough to guarantee the equality of volatilities.&lt;/p&gt;&#xA;" OwnerUserId="1704" LastEditorUserId="1704" LastEditDate="2016-05-18T01:04:32.930" LastActivityDate="2016-05-18T01:04:32.930" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7618" PostTypeId="2" ParentId="7599" CreationDate="2013-03-27T01:10:48.623" Score="3" Body="&lt;p&gt;This may or may not help you depending on what resources are available to you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you happen to have access to any source of daily data which contains both tickers and SEDOLs (i.e., the London Stock exchange unique identifiers; these are quite commonly used), then you can trivially derive 99% of all ticker changes. When a ticker changes, the SEDOLs typically remain unchanged, so a quick script comparing the ticker-to-SEDOL mapping from day to day should reveal most changes. Once in a blue moon, a SEDOL will change on the same day as the ticker and there's nothing you can do about it, but that almost never happens. I've used this trick many times when exploring new markets for which I don't have ticker change info.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: CUSIPs and ISINs don't seem to work very well for this; you really need SEDOLs.&lt;/p&gt;&#xA;" OwnerUserId="1628" LastActivityDate="2013-03-27T01:10:48.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7619" PostTypeId="2" ParentId="7568" CreationDate="2013-03-27T01:35:30.017" Score="4" Body="&lt;p&gt;Bloomberg equity codes are usually quite easy to derive if you know the ticker (though you may have to replace dashes/spaces/slashes for preferred and multi-class shares). This is just for equities though and this is definitely not the case for futures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;RICs are a different story. In the US, you need to know on what exchange the ticker is listed to get the suffix. Outside the US and Asia, it's even worse, RICs have very little relationship to the tickers they refer to and are often completely different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, Reuters does provide daily definitions of every single RIC and provides the associated ticker (which can be used to derive the Bloomberg code) as well as SEDOL/CUSIP and other identifiers. This product is provided as part of the &quot;Reuters Datascope Equities&quot; data. If you are working for a financial institution, it is very likely that they would be subscribing to these daily text files, and you should enquire. These files can be parsed to produce daily RIC -&gt; native ticker, and then trivially converted to Bloomberg mappings. I don't believe you will find any other source of comprehensive RIC data anywhere else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, be aware that Bloomberg codes and RICs do not refer to ticker, they refer to exchange quotes. For example, &quot;AAPL US Equity&quot;, &quot;AAPL UP Equity&quot;, AAPL.OQ, AAPL.P, and a dozen more all refer to various Apple quotes on different exchanges. So be aware that you are mapping quotes, not tickers (an while the RICs for the exact same stock trading on various exchanges seem to share the same root in the US, this is not usually the case in other countries).&lt;/p&gt;&#xA;" OwnerUserId="1628" LastActivityDate="2013-03-27T01:35:30.017" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7622" PostTypeId="2" ParentId="4853" CreationDate="2013-03-27T11:00:25.097" Score="0" Body="&lt;p&gt;I agree with @Freddy, that we are talking about backtesting trading strategy in simulation environment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Somehow you opened those positions - that means you have some trading strategy, the strategy which gives you enter (and probably exit) signals.&#xA;There are two cases: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You CAN formalize and automate this strategy.&lt;/li&gt;&#xA;&lt;li&gt;You CAN'T do it for any reasons.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;(1) What you are doing in the first case: is getting some trading simulation software (like Amibroker) or develop some backtesting utility yourself. And simply overlie your trading strategy signals with different risk management indicators (trailing stops or some bands) and get optimal stop values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) Use a set of historic trades which you already did as an input for simulation tool. And again run it with trailing stops. &lt;/p&gt;&#xA;" OwnerUserId="2246" LastEditorUserId="2246" LastEditDate="2013-03-27T11:14:46.420" LastActivityDate="2013-03-27T11:14:46.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7623" PostTypeId="1" AcceptedAnswerId="7624" CreationDate="2013-03-27T12:37:37.530" Score="1" ViewCount="272" Body="&lt;p&gt;Assume a money market has interest rate process $R(t)$. In Shreve's &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/144192311X&quot; rel=&quot;nofollow&quot;&gt;Stochastic Calculus for Finance II&lt;/a&gt;, formula (5.2.17) on page 215 defines the discounted process as&#xA;$$&#xA;D(t) = e^{-\int_0^t R(s) ds}.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is $D(t)$ called &quot;discounted&quot; process? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does it mean that any value at time t times $D(t)$ will give its present value  at time $0$?&lt;/p&gt;&#xA;" OwnerUserId="408" LastEditorUserId="467" LastEditDate="2013-03-27T13:10:35.743" LastActivityDate="2013-03-27T13:10:35.743" Title="What is the meaning of the discounted process defined from the interest rate process?" Tags="&lt;interest-rates&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7624" PostTypeId="2" ParentId="7623" CreationDate="2013-03-27T12:50:04.503" Score="5" Body="&lt;p&gt;Indeed, $D(t)$ is the &lt;a href=&quot;http://en.wikipedia.org/wiki/Discounting#Discount_factor&quot;&gt;discount factor&lt;/a&gt; used to compute the present value of a cash flow at time $t$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$PV = D(t) \cdot CF_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is more convenient to write it that way when you assume stochastic interest rate because you don't have to write the integral all the time.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2013-03-27T12:50:04.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7625" PostTypeId="1" CreationDate="2013-03-27T16:57:32.213" Score="18" ViewCount="1151" Body="&lt;p&gt;I consider pricing and risk analysis of derivatives on dividends of the members of equity indices (such as Dow Jones EuroStoxx). There are options but I focus on futures.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What are common stochastic models for dividends that allow pricing of such derivatives respectively risk analysis?&lt;/li&gt;&#xA;&lt;li&gt;What are practitioner approaches to pricing and risk analysis of dividend futures/options?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Who has references, experiences, comments?&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2013-04-05T07:41:01.157" LastActivityDate="2020-04-29T19:12:57.720" Title="Stochastic modelling of derivatives on dividends" Tags="&lt;derivatives&gt;&lt;risk-models&gt;&lt;dividends&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7629" PostTypeId="1" CreationDate="2013-03-27T23:51:38.747" Score="2" ViewCount="381" Body="&lt;p&gt;Lets say we have &quot;today's&quot; snapshot of asset allocation and need to determine the 6mo, 1 yr and 5 yr risk and returns of this portfolio. If the time series for every asset is very long, longer than the longest time horizon of interest then it's simple. Just compute the portfolio returns =&gt; get mean and standard deviation and call it a day (ignoring higher order arguments for now).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when the time-series data is of different lengths as well as of much shorter durations than the time horizons of risk and return - it's not so straightforward. To illustrate, I've sketched this portfolio time series below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/MOaWY.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[ &lt;a href=&quot;https://i.imgur.com/Gm5MwId.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;Full resolution link&lt;/a&gt; ] &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In such a situation, given only the snapshot of the portfolio 'today' and their time series, what would be a statistically consistent way to determine the risk and return? Lets assume we can't know the portfolio composition/asset allocation in the past - just a single snapshot less than a week old / &quot;today&quot;. We would like to employ the same principles across the spectrum of portfolios i.e. use the same even if&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;portfolio 1 has only A and B today&lt;/li&gt;&#xA;&lt;li&gt;portfolio 2 has only FB and G today&lt;/li&gt;&#xA;&lt;li&gt;portfolio 3 has A,B,C,D,E,FB, and G today &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="3509" LastEditorUserId="3509" LastEditDate="2013-03-29T00:19:23.817" LastActivityDate="2013-03-29T01:32:35.287" Title="Portfolio risk-return when assets have limited and inconsistent historical data / time series?" Tags="&lt;risk&gt;&lt;portfolio-management&gt;&lt;returns&gt;&lt;modern-portfolio-theory&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7630" PostTypeId="2" ParentId="7629" CreationDate="2013-03-28T01:13:25.637" Score="1" Body="&lt;p&gt;Generally I would annualize risk and returns even when an asset's returns/general time series (ts) does not span over the full year So, both, FB and G present risk and return over the past year. For risk and return that is calculated over longer periods I would not include an asset in the portfolio of which you have no ts available to measure risk and returns. So, if you try to asset the 5 year portfolio risk and return I would not include asset FB and G in the portfolio. Already extrapolating to full years is making assumptions some may find pushing the envelope. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would strongly advise not to go the correlated asset replacement route. Over a long-term horizon, such as your 5 year risk/return calculations, there is no replacement asset that can be correlated too highly with your asset, whose longer return time series are missing, to make up for unaccounted unsystematic/company specific risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A simple calculation should make this clear: Lets take portfolio of 3 assets A,B, FB. Let's assume you have the portfolio risk and return over the past 5 years but not the individual asset time series over 5 years for FB. Now, replace the missing time series FB with a highly correlated asset. Re-calculate the portfolio risk and return profiles. Derive the tracking error to the true portfolio risk and return profiles. Now, before plugging in the correlated asset returns into the missing time series spots, introduce a one-time jump of +-20% at an arbitrary location in the time series. Re-calculate your portfolio risk and return, derive your tracking error. Are you happy with the results? Can you live with the induced jump? Because if you say no you should never even start to think to replace asset returns with any correlated asset returns. 20% moves due to corporate actions, or any unsystematic even for that matter is highly &lt;strong&gt;conservative&lt;/strong&gt;, generally you witness a lot higher deviations over such long period of time, plus correlations generally completely break down after such large moves, something we did not even account for in our back-of-the-envelope calculation. This all assumes we are talking about cash equity as an asset class. Other asset classes may witness higher or lower jumps, and the 20% is purely arbitrary, though as pointed out I believe it is at the low end of what can happen in a 5-year time span. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-03-29T01:32:35.287" LastActivityDate="2013-03-29T01:32:35.287" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7631" PostTypeId="1" AcceptedAnswerId="7635" CreationDate="2013-03-28T08:08:23.653" Score="4" ViewCount="1702" Body="&lt;p&gt;Which of the following statements is correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a. If a bond’s yield to maturity exceeds its coupon rate, the bond’s current yield must also exceed its coupon rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b. If a bond’s yield to maturity exceeds its coupon rate, the bond’s price must be less than its maturity value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The correct answer is b. I would like to know why option a is incorrect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If bond price is less than maturity value, then current yield = (annual coupon payment)/(current bond price) &gt; coupon rate. Is there anything wrong with this reasoning?&lt;/p&gt;&#xA;" OwnerUserId="5025" LastActivityDate="2013-03-29T17:12:42.857" Title="YTM and current yield" Tags="&lt;bond&gt;" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7632" PostTypeId="2" ParentId="7631" CreationDate="2013-03-28T11:30:20.660" Score="0" Body="&lt;p&gt;No you're right. If YTM &gt; coupon rate, then the bond is selling below par and therefore current yield &gt; coupon rate.&lt;/p&gt;&#xA;" OwnerUserId="5005" LastActivityDate="2013-03-28T11:30:20.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7633" PostTypeId="2" ParentId="7631" CreationDate="2013-03-28T13:06:06.793" Score="0" Body="&lt;p&gt;If you're talking about a straight, option-free bond, then A is absolutely correct.  It's rather easy to prove doing the math.  However, if it's not a straight bond then you may have cases where A wouldn't be true(puttable bonds in some cases), but then B would be false in those cases as well.  I think you need to burn whatever book you're reading.&lt;/p&gt;&#xA;" OwnerUserId="2732" LastActivityDate="2013-03-28T13:06:06.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7634" PostTypeId="2" ParentId="7629" CreationDate="2013-03-28T19:53:54.910" Score="0" Body="&lt;p&gt;For a similar case (Introduction of REITs in Germany a few years ago) we looked for a similar asset (in terms of correlation) and used that time series for the portfolio construction. We had only a very short time series for that REIT Index (around 4-5 months iirc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, we used Dutch REITs - due to high correllation between German and Dutch lead indices - and adjusted the NL-REIT timeseries to match the moments of the German REITs. By no means a perfect method, but we tried to analyze the potential for REITs in the German market. To give some context, the result was used to construct some simulated mean/variance portfolio, and not as live strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS I hope I understand your question correctly, not really sure though. If not, please clarify.&lt;/p&gt;&#xA;" OwnerUserId="1976" LastActivityDate="2013-03-28T19:53:54.910" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7635" PostTypeId="2" ParentId="7631" CreationDate="2013-03-29T01:44:05.013" Score="1" Body="&lt;p&gt;&lt;strong&gt;(a) is false&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a zero coupon bond.  Yield to maturity clearly exceeds the coupon rate, but &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;Y_\text{current} = 0 = \text{Coupon}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;while the question asks about a strict inequality.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastEditorUserId="2609" LastEditDate="2013-03-29T17:12:42.857" LastActivityDate="2013-03-29T17:12:42.857" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7636" PostTypeId="1" CreationDate="2013-03-29T16:57:31.417" Score="1" ViewCount="140" Body="&lt;p&gt;Trying to use a linear regression model to forecast the CPI. I noticed that when I took a moving average of the residuals, though homoscedatisc and nonautocorrelated (i.e. they squiggle up&amp;amp;down with no uniform pattern), that they seemed to move in the same direction as the CPI. That is the moving average of the residuals and the depended variables correlated. What does this imply? Is this a case of omitted variable bias? Are my coefficients biased? What are some common prognoses for a such a problem?&lt;/p&gt;&#xA;" OwnerUserId="4729" LastEditorUserId="16595" LastEditDate="2018-07-28T19:18:20.263" LastActivityDate="2018-07-28T19:18:20.263" Title="Assessing Forecasting with Correlated Residuals" Tags="&lt;forecasting&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="7637" PostTypeId="2" ParentId="7636" CreationDate="2013-03-29T17:23:19.477" Score="1" Body="&lt;p&gt;The reason you're seeing the bias is because of the adjustment, commonly referred to the &quot;fudge factor&quot; that they government applies to basically all of their published statistics.  This is almost always in the direction to make the numbers rosier, and therefore your error term likely will exhibit signs of positive serial correlation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/38Iax.png&quot; alt=&quot;CPI_ShadowStats&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The standard test for first-order serially correlated errors is the &lt;a href=&quot;http://en.wikipedia.org/wiki/Durbin%E2%80%93Watson_statistic&quot; rel=&quot;nofollow noreferrer&quot;&gt;Durbin-Watson&lt;/a&gt; test statistic.  For higher-order testing of serial correlation you can use the &lt;a href=&quot;http://en.wikipedia.org/wiki/Breusch%E2%80%93Godfrey_test&quot; rel=&quot;nofollow noreferrer&quot;&gt;Breush-Godfrey&lt;/a&gt; test.&lt;/p&gt;&#xA;" OwnerUserId="2732" LastEditorUserId="2732" LastEditDate="2013-03-29T17:35:47.447" LastActivityDate="2013-03-29T17:35:47.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7639" PostTypeId="2" ParentId="4834" CreationDate="2013-03-31T19:55:19.560" Score="1" Body="&lt;p&gt;I'm seriously trying to figure out the exact same thing for my dissertation. I can easily solve for reservation (threshold) prices when offered prices are independent, but I haven't yet solved for the case of mean reversion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's an example in Bertsekas (1987) page 83 with an autocorrelated asset sale model, but it's too brief for me to follow all the way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are my first steps. The asset must be sold before period $T$. We know the final reservation price is zero: $RP_{T} = 0$. In the next to last period, the agent compares the payoff with selling in period $T-1$ or waiting until period $T$. The value function is&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$J(T-1) = \max[P_{T-1},\beta E[P_T|P_{T-1}]$,&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;where $\beta$ is a discount factor. The threshold price at time $T-1$ is the value that makes the asset holder indifferent to selling in either of the two periods. Substituting the expected value of the OU process,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$P_{T-1}= \beta(\mu+e^{-\eta}\left(P_{T-1}-\mu\right)) $,&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Where $\eta$ is the level of mean reversion. Solving for $P_{T-1}$ yields the reservation price:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$RP_{T-1}=\frac{\beta \mu (1-e^{-\eta})}{1-\beta e^{-\eta}}$.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;(check the algebra, but I think it's correct). Then, I derived the remainder of the reservation prices using the equation&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$J(t) = \max[P_t,\beta E[J(t+1)|P_t]]$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$E[J(t+1)|P_t] = \mbox{Pr}\left(P_{t+1}\geq RP_{t+1}\right)\times\left(E\left[P_{t+1}|P_{t+1}\geq RP_{t+1}\right]\right) + \mbox{Pr}\left(P_{t+1}&amp;lt;RP_{t+1}\right)\times\left(RP_{t+1}\right)$.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For the OU process,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$P_{t+s}|P_{t}\sim N\left(\mu+e^{-\eta s}\left(P_{t}-\mu\right),\frac{\sigma^{2}}{2\eta}\left(1-\exp\left(-2\eta s\right)\right)\right).$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I used &lt;code&gt;R&lt;/code&gt;'s &lt;code&gt;etruncnorm&lt;/code&gt; function to calculate the probabilities in the value equation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have more details in my dissertation, pages 35-41:&#xA;&lt;a href=&quot;http://people.clemson.edu/~campbwa/dissertation/WAC_dissertation_3-15-2013.pdf&quot; rel=&quot;nofollow&quot;&gt;http://people.clemson.edu/~campbwa/dissertation/WAC_dissertation_3-15-2013.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have derived a full set of reservation prices, but they're too high. If I shift them down in the simulation model, profits increase!&lt;/p&gt;&#xA;" OwnerUserId="3043" LastActivityDate="2013-03-31T19:55:19.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7640" PostTypeId="1" CreationDate="2013-03-31T20:23:56.867" Score="3" ViewCount="1264" Body="&lt;p&gt;I know that the long run variance of the standard OU process is &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$\lim_{s\rightarrow \infty}\mbox{Var}(P_{t+s}|P_t) = \frac{\sigma^2}{2\theta}$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I'm using the geometric version of the process. I used the simulation equation &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$P_{t}=P_{t-1}+\theta\left(\mu-P_{t-1}\right)+\sigma P_{t-1}\epsilon_{t-1}$.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/a/4932/35&quot;&gt;SRKX posted a derivation of the variance for the geometric process&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$\mbox{Var}[St]=S^2_0(\exp(σ2t)−1)\exp(−2θt)$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This doesn't appear to reach any long run value, the variance just keeps growing:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$\lim_{s\rightarrow \infty}\mbox{Var}(P_{t+s}|P_t) = \infty $.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What's wrong with just modifying the variance term of the OU process to be&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$\mbox{Var}\left(P_{t+s}|P_{t}\right)=\frac{\sigma^{2}P_t^2}{2\theta}\left(1-\exp\left(-2\theta s\right)\right)$?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That way, the long run variance is&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$\lim_{s\rightarrow \infty}\mbox{Var}(P_{t+s}|P_t) = \frac{\sigma^2P^2_t}{2\theta}$.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Is this correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason this is important is because it affects the threshold calculation for buying a mean reverting asset. See:&#xA;&lt;a href=&quot;https://quant.stackexchange.com/a/7639/3043&quot;&gt;https://quant.stackexchange.com/a/7639/3043&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3043" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2013-04-01T14:01:35.550" Title="Does the geometric Ornstein-Uhlenbeck process have stationary variance?" Tags="&lt;statistics&gt;&lt;stochastic-processes&gt;&lt;stationarity&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7645" PostTypeId="1" CreationDate="2013-04-02T04:03:33.517" Score="3" ViewCount="591" Body="&lt;p&gt;I've been reading up on different models used to forecast the equity risk premium, and I've seen a couple of papers that had questionable methods. For example, &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2172164&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; paper by Javier Estrada goes into detail on how to use the Shiller PE ratio to forecast 10-year equity returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2222008&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; paper, which looks to be a draft, also uses a similar methodology to Estrada. The only paper I have seen where they specifically address the issue of independent observations and model misspecification is the one by Klement on using the Shiller PE in emerging markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem I have with the first two papers is that they look at the data available today and make a prediction about the next ten years. They then roll everything forward one month and make another prediction about the next ten years. Clearly, there are overlapping data between the two time periods. Should the authors only be evaluating model usability by looking at non-overlapping time periods? What is the most appropriate way to evaluate their models?&lt;/p&gt;&#xA;" OwnerUserId="5051" LastActivityDate="2013-09-03T07:25:53.740" Title="Why do long-term equity return forecast models use dependent observations?" Tags="&lt;time-series&gt;&lt;regression&gt;&lt;models&gt;&lt;auto-correlation&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7646" PostTypeId="2" ParentId="7645" CreationDate="2013-04-02T04:20:07.910" Score="5" Body="&lt;p&gt;Couple points I like to make:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;There exists no reliable model that can even predict future price returns (risk premiums, excess returns, whatever you want to call it) beyond a year, run as fast as you can if you hear from someone who claims he can predict risk premiums 10 years out, whether reliably or not. It makes zero sense and clearly comes from either a snake oil sales man or an academician with zero experience in and exposure to financial markets/assets.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Any financial predictive model, no matter how quantitative, is to be treated with the utmost suspicion and care. Just do your homework: Evaluate the average performance of pure quant based funds vs its peers. You will notice that there is hardly a noticeable difference in performance. I generally am very suspicious of models where the portfolio manager claims the model is a) never overridden and b) is based only on one specific approach, such as fundamental factors or pure technicals. No matter how well a model performs during a specific time span, for example a Bank of Japan currency intervention, a major strike by North Korea, an SEC investigation, a proxy fight, can erase whatever pnl has been built at either an instant or in a very short period of time. The arrogance of steadfastly believing in one's model even in the face of steep unrealized losses has almost always killed such portfolio manager. Sure, you can account for unpredictable events through risk premiums but in the end of the day it does not change the fact: Markets are dynamic and they almost always react to a vast array of factors, almost never does a specific asset trade purely on technical or fundamental factors. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In summary, I really would recommend not to waste time on models that claim they can forecast risk premiums or returns far into the future. None are known to me that outperform risk-free assets (if such even still exist in today's environment). As market practitioner I can assure you that the sweet spot lies somewhere in between ultra high frequency and holding periods of a maximum of a few months. I am not saying there are no investments whose returns materialize in a matter of years but I am talking about holding periods that optimize risk/reward. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-04-02T15:23:21.103" LastActivityDate="2013-04-02T15:23:21.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7648" PostTypeId="2" ParentId="2380" CreationDate="2013-04-02T04:40:35.160" Score="2" Body="&lt;p&gt;&quot;How can I understand if the volatility is not constant reading ARCH/GARCH model &quot;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;By analyzing the error terms/residuals. There is not much more magic going on than just this and the following rather introductory level paper should get you started: &lt;a href=&quot;http://archive.nyu.edu/bitstream/2451/26577/2/FIN-01-030.pdf&quot; rel=&quot;nofollow&quot;&gt;http://archive.nyu.edu/bitstream/2451/26577/2/FIN-01-030.pdf&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Garch models essentially add conditional variance terms to the regression equation in order to capture time-varying variance and volatility clustering. Just to tame your excitement a bit, do not expect to extract a whole lot of value from the application of ARCH/GARCH models in terms of predicting volatility clusters or variance dynamics, they generally perform very poorly in that regards. Academicians may get extremely excited when the market confirms their models that S&amp;amp;P 500 index/futures vol at 60 levels does not drop back to 20 levels overnight. At the same time one too many funds and trading desks got killed by an over reliance on GARCH models in their quest to predict volatility dynamics. Volatility in the end of the day trades and reacts to extreme but unpredictable events in a very similar fashion than any other asset class. That is why traditionally most models fail in high volatility environments while they track a lot better in low vol environments, but hey, isn't that a self-fulfilling prophesy? Fact, however, remains that most all models are incapable to predict regime changes which confirms my own basic tenet of how to approach trading and risk management in general: Reactive rather than predictive. Just sharing my own non-quantitative take and summary of market experience. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-04-02T04:40:35.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7650" PostTypeId="1" AcceptedAnswerId="7654" CreationDate="2013-04-02T09:43:35.357" Score="8" ViewCount="2269" Body="&lt;p&gt;I'm working on market trends. I have daily prices for 33 assets from different markets. I was wondering if there is a way to cancel the effects of different opening/closing times.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been told that a moving average over four days would be enough; I think a weekly moving average should improve many thing. As I observe a 50-day moving average to observe market trends, I don't really see the point in doing this first moving average.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any literature about this topic? Are there simple solutions to cancel the effects of markets desynchronization?&lt;/p&gt;&#xA;" OwnerUserId="5052" LastEditorUserId="35" LastEditDate="2013-04-02T11:16:20.377" LastActivityDate="2013-06-11T10:38:45.380" Title="Data Synchronization" Tags="&lt;trends&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7651" PostTypeId="2" ParentId="7614" CreationDate="2013-04-02T11:49:43.787" Score="3" Body="&lt;p&gt;In full generality this is a very difficult question. The closest you will get to a general framework is Vapnik-Chervonenkis theory. You can read about this in Chapter 7.9 of &quot;The elements of statistical learning&quot; by Hastie, Tibshirani and Friedman which can be downloaded from their &lt;a href=&quot;http://www-stat.stanford.edu/~tibs/ElemStatLearn&quot; rel=&quot;nofollow&quot;&gt;website &lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But be warned that this is a theoretical approach. Often more heuristic approaches will serve you better. Chapter 7 of the book covers those as well.&lt;/p&gt;&#xA;" OwnerUserId="482" LastActivityDate="2013-04-02T11:49:43.787" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7652" PostTypeId="2" ParentId="7645" CreationDate="2013-04-02T15:01:44.060" Score="4" Body="&lt;p&gt;Generally we use models that go so far out in a comparative sense, not as an absolute decision. You are definitely do some good reading but I believe you are thinking about these models in the wrong way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think (and correct me if I'm wrong) you are looking at creating or finding the perfect &quot;crystal ball&quot; model that will predict returns/risk premiums etc. for the next 3, 5, 10 years and you make an investment decision based on its output. This is different on how the professional world does it. While generally we wouldn’t use a risk premium model out 10 years we do use these types of models in a comparative sense. We realize it’s impossible to model returns or something like a risk premium so far out so we use these types of models to compare deals not model returns. The models become baselines where we compare the multitude of deals that come across the desk. We don’t say &quot;Hey the model says we will return X yield in 5 years&quot; it’s used like &quot;Hey deal A is X in the model and deal B is Y, why is this the case and which do we like better?&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the retail investor is caught up in models as an absolute decision because A) it sounds easy (almost magical, telling the future right?), B) They are looking for one or two &quot;right deals&quot; and don’t see the deal flow and have to do the comparative analysis we do. We HAVE to spend this money (investors looking for returns don’t like it when cash sits around) where retail investors are looking for the right deal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope I'm making some sort of sense. To summarize, in the professional world models help compare similar deals not necessarily model returns. As Freddy said, modeling is often sold to retail investors as a &quot;crystal ball&quot; that can predict not only returns but risk premiums 10 years out (what?!?!). So it doesn’t really matter how you model risk premiums 3-5-10 years (because in reality you can’t) as long as it make sense when used to compare other deals.&lt;/p&gt;&#xA;" OwnerUserId="5053" LastEditorUserId="35" LastEditDate="2013-04-02T15:25:16.310" LastActivityDate="2013-04-02T15:25:16.310" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7653" PostTypeId="1" CreationDate="2013-04-02T15:14:29.557" Score="4" ViewCount="171" Body="&lt;p&gt;I consider pricing and risk analysis of derivatives on dividends of the members of equity indices (such as Dow Jones EuroStoxx). There are options but I focus on futures.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What are the main risk factors for dividends?&lt;/li&gt;&#xA;&lt;li&gt;Which quantitative factors do you consider in the context of derivatives on dividends?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I found a nice presentation by &lt;a href=&quot;http://www.quantitative-research.de/dl/ModellingDividends.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bühler of JPMorgan&lt;/a&gt; but who has further references, experiences, comments?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that stochastic models for derivatives on dividends are covered in &lt;a href=&quot;https://quant.stackexchange.com/questions/7625/stochastic-modelling-of-derivatives-on-dividends&quot;&gt;this question&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="11723" LastEditDate="2019-02-18T06:05:55.373" LastActivityDate="2019-02-18T06:05:55.373" Title="Risk factors for derivatives on dividends" Tags="&lt;equities&gt;&lt;derivatives&gt;&lt;risk-models&gt;&lt;dividends&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7654" PostTypeId="2" ParentId="7650" CreationDate="2013-04-02T15:25:56.723" Score="8" Body="&lt;p&gt;Effects of non-contemporaneous trading (i.e. different closing times) for risk management are covered in this article (&lt;a href=&quot;http://arxiv.org/abs/1009.3638&quot; rel=&quot;nofollow noreferrer&quot;&gt;preprint&lt;/a&gt;,&lt;a href=&quot;http://www.risk.net/journal-of-risk/journal/2164360/issue-volume-14-spring-2012&quot; rel=&quot;nofollow noreferrer&quot;&gt;link to journal&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The conclusion is that a moving average process in the sense of time-series analysis can handle the resulting cross-autocorrelation. This means that in each time-step you have lagged correlations (e.g. Japan today to US yesterday) but only for lag $1$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case you want to use e.g. &lt;a href=&quot;http://de.wikipedia.org/wiki/Hodrick-Prescott-Filter&quot; rel=&quot;nofollow noreferrer&quot;&gt;the Hodrick-Prescott-filter&lt;/a&gt; in a Kalman filter setting for fitting a trend, this model approach could improve the picture (I can not tell from experience but as an idea ...). For hints on the HP-filter you can start &lt;a href=&quot;https://stats.stackexchange.com/questions/48326/state-space-formulation-of-hodrick-prescott-lter&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2013-04-02T15:25:56.723" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="7655" PostTypeId="2" ParentId="7650" CreationDate="2013-04-02T19:28:04.810" Score="3" Body="&lt;p&gt;Another solution is to convert the daily series to weekly. Alternately, if you have to use the daily data, &lt;a href=&quot;http://www.axiomainc.com/downloads/Axioma_ReturnsTiming_ShortVersion20101116.pdf&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt; describes how to construct a synchronized return, which you could presumably adjust it into a synchronized hypothetical price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, the issue is one of missing data, which can quickly get you into some advanced techniques (e.g. generating the missing data in a Gibbs sampling approach). The Kalman Filter approach that Richard mentioned also is popular in the literature. In economics, they use Kalman filters to &quot;Nowcast&quot; in order to handle different publication lags, which is similar to some data not being available from some markets. I would take extra care that the results makes sense. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2013-04-02T19:28:04.810" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7657" PostTypeId="1" CreationDate="2013-04-03T00:28:38.633" Score="5" ViewCount="418" Body="&lt;p&gt;What is the condition for underlying stochastic volatility processes to give a consistent covariance matrix?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I read in Hull that in order to have a consistent covariance matrix, volatility parameters should be estimated using same model. Does that mean, for example, if I am using a Garch(1,1) model with some parameters, I should use the same parameters for all underlying? Or it is just enough to have Garch(1,1) and not necessarily the same parameters. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In either case, what would be a solution if the underlyings obviously fall under different models? &lt;/p&gt;&#xA;" OwnerUserId="3245" LastEditorUserId="5149" LastEditDate="2013-05-04T13:09:49.357" LastActivityDate="2014-03-31T01:13:26.467" Title="Obtaining a consistent covariance matrix for stochastic volatility processes" Tags="&lt;stochastic-volatility&gt;&lt;correlation-matrix&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7659" PostTypeId="2" ParentId="7625" CreationDate="2013-04-03T13:38:15.730" Score="-1" Body="&lt;p&gt;I will try to give you a way of &quot;pricing&quot; european call option on a stock that pays divided at t =1. You can extend it to American , more nodes etc &#xA;In the end these 2 papers &lt;a href=&quot;http://www.math.tamu.edu/~stecher/425/Sp12/optionsForDividendStocks.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Paper 1&lt;/a&gt; and &lt;a href=&quot;http://www.statslab.cam.ac.uk/~chris/papers/RK081004.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Paper2&lt;/a&gt;&#xA;are quite good if you want a rigourous treatment using SDE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets define the underlined stock by(price ,up and down factors) $$ S = 100 ,  u = 1.1, d = 0.9, (1+r ) = 1.05 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume that the UL pays a $5 dividend at t = 1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can have a binomial tree such that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/7HvSf.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it is a european Call option  with maturity =2 and strike K = 90 then Node 2 is&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;MAX(115.5 - 90 , 0 ) = 25.5&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;MAX(94.5 - 90 , 0 ) = 4.5&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;MAX(93.5 - 90 , 0 ) = 3.5&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;MAX(76.5 - 90 , 0 ) = 0&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Find risk nuetral probability of going up $$ q = (1+r)-d/(u-d)$$&#xA;and find price at node 1 and thereafter at node 0. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Risk is a big problem in itself which I will leave for now for someone else. &lt;/p&gt;&#xA;" OwnerUserId="1386" LastActivityDate="2013-04-03T13:38:15.730" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7660" PostTypeId="2" ParentId="7657" CreationDate="2013-04-04T07:39:59.920" Score="2" Body="&lt;p&gt;I am not an expert in this field, but it would be best to consider a full multivariate GARCH model. This &lt;a href=&quot;http://weber.ucsd.edu/~mbacci/engle/dcc.pdf&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; by Engle and Sheppard should be a good start. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the constant correlation matrix approach is covered to a certain extent too. I hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2013-04-04T07:39:59.920" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7661" PostTypeId="1" AcceptedAnswerId="7662" CreationDate="2013-04-04T08:15:28.983" Score="2" ViewCount="417" Body="&lt;p&gt;I've written some code to calculate European option prices using the Black-Scholes analytical method. Can somebody recommend a good way to test that code? I have looked at option pricers online like &lt;a href=&quot;http://www.ivolatility.com/calc/&quot; rel=&quot;nofollow&quot;&gt;IVolatility&lt;/a&gt;. However, I'm not sure if they use the method I am trying to test.&lt;/p&gt;&#xA;" OwnerUserId="3336" LastActivityDate="2013-04-04T09:01:12.540" Title="Testing Black Scholes Analytical Options Pricer" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7662" PostTypeId="2" ParentId="7661" CreationDate="2013-04-04T09:01:12.540" Score="3" Body="&lt;p&gt;An easy and fast way is checking your values against Excel functions.&#xA;See, the picture below.&lt;p&gt;&#xA;Or, maybe you could post your code and people will have a look at it.&#xA;&lt;p&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/AqWt0.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2220" LastActivityDate="2013-04-04T09:01:12.540" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7663" PostTypeId="1" CreationDate="2013-04-03T17:42:01.190" Score="8" ViewCount="4436" Body="&lt;p&gt;Apart from the model of &lt;a href=&quot;http://en.wikipedia.org/wiki/Geometric_Brownian_motion&quot;&gt;Geometric Brownian motion&lt;/a&gt; is there any other &quot;widely accepted&quot; stochastic model to characterize the dynamics of a stock price process?&lt;/p&gt;&#xA;" OwnerDisplayName="peter5" LastEditorUserId="1652" LastEditDate="2013-04-04T17:45:53.377" LastActivityDate="2013-06-07T18:05:21.500" Title="Stochastic modeling of stock price process" Tags="&lt;stochastic-processes&gt;&lt;finance&gt;" AnswerCount="3" CommentCount="6" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7664" PostTypeId="2" ParentId="141" CreationDate="2013-04-05T08:26:19.240" Score="12" Body="&lt;p&gt;To get a consolidated feed of most of the data feeds here use &lt;a href=&quot;http://www.quandl.com/&quot; rel=&quot;nofollow&quot;&gt;Quandl&lt;/a&gt;. This is free for limited amount of requests per day.&lt;/p&gt;&#xA;" OwnerUserId="909" LastEditorUserId="1040" LastEditDate="2016-10-21T03:19:36.147" LastActivityDate="2016-10-21T03:19:36.147" CommentCount="0" CommunityOwnedDate="2013-04-05T08:26:19.240" ContentLicense="CC BY-SA 3.0" />
  <row Id="7666" PostTypeId="1" AcceptedAnswerId="7667" CreationDate="2013-04-05T13:29:50.443" Score="10" ViewCount="8418" Body="&lt;p&gt;Can you use the variance ratio test to determine whether or not a time series is mean reverting? I'm using the &lt;code&gt;Lo.Mac&lt;/code&gt; function in the &lt;code&gt;vrtest&lt;/code&gt; library in &lt;code&gt;R&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've used the test to reject geometric Brownian motion as a price process. Does that indicate that I have a mean reverting process or does it only indicate that the assumptions of geometric Brownian motion are not satisfied?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My plot of variance ratios looks like this:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/kWAX4.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't quite understand the interpretation of this plot!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I don't want to use a unit root test for stationarity because the process has nonconstant variance. It is not second order stationary although I believe that it is mean reverting.&lt;/p&gt;&#xA;" OwnerUserId="3043" LastEditorUserId="3043" LastEditDate="2013-04-05T14:48:27.120" LastActivityDate="2013-09-03T14:07:53.293" Title="Using variance ratios to test for mean reversion" Tags="&lt;time-series&gt;&lt;r&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7667" PostTypeId="2" ParentId="7666" CreationDate="2013-04-05T15:47:08.547" Score="10" Body="&lt;p&gt;It only indicates that the null hypothesis of uncorrelated increments is violated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the sake of simplicity, assume a time series is stationary. Then a sufficient statistic for arbitrary variance ratios is its covariance function. In general, a given deviation from the null can originate from different covariance functions, which in turn, entails that making any specific claim about mean reversion is not trivial. I find that this point is often overlooked in the financial literature. I expect that when phrased properly a similar statement can be made about non-stationary series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That being said, mapping abnormal variance ratios to mean reversion/trend following is not impossible but it requires making specific assumptions about the alternative model.&lt;/p&gt;&#xA;" OwnerUserId="1531" LastEditorUserId="1531" LastEditDate="2013-09-03T14:07:53.293" LastActivityDate="2013-09-03T14:07:53.293" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7668" PostTypeId="1" AcceptedAnswerId="7686" CreationDate="2013-04-05T17:04:52.927" Score="2" ViewCount="182" Body="&lt;p&gt;Have the exchanges disclosed their criteria?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have a best guess based upon observations of volume (however you wish to define it)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please no qualitative answers.&lt;/p&gt;&#xA;" OwnerDisplayName="user3232" LastActivityDate="2013-04-07T16:31:47.350" Title="monthly contract volume required for penny increments?" Tags="&lt;options&gt;&lt;spread&gt;&lt;volume&gt;&lt;bid&gt;&lt;ask&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7670" PostTypeId="2" ParentId="7668" CreationDate="2013-04-05T19:41:28.307" Score="2" Body="&lt;p&gt;You are referring to the &lt;strong&gt;Penny Pilot Program&lt;/strong&gt;. Only options whose premiums are quoted at a price less than \$3 may be eligible for penny increments, except for IWM, QQQ, and SPY, which are always quoted in pennies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The list of permitted classes doesn't seem to come from specific volume criteria. Instead, the SEC and the exchanges together roll-out names in phases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CBOE's &lt;a href=&quot;http://www.sec.gov/rules/sro/cboe/2013/34-68873.pdf&quot; rel=&quot;nofollow&quot;&gt;proposal for mini-options&lt;/a&gt; gives some additional insight:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;There is a price test for entry into the Penny Pilot Program which excludes “high premium” classes, which are defined as classes priced at $200 per share or higher at the time of selection.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is why GOOG is not in the Penny Pilot Program, for example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best bet is to use the list of eligible classes from &lt;a href=&quot;http://www.ise.com/WebForm/viewPage.aspx?categoryId=152&quot; rel=&quot;nofollow&quot;&gt;ISE&lt;/a&gt; or &lt;a href=&quot;https://www.cboe.org/hybrid/pennypilot.aspx&quot; rel=&quot;nofollow&quot;&gt;CBOE&lt;/a&gt;. Note that &lt;a href=&quot;http://cchwallstreet.com/CBOETools/PlatformViewer.asp?selectednode=chp_1_1_6_3_3&amp;amp;manual=/CBOE/rules/cboe-rules/&quot; rel=&quot;nofollow&quot;&gt;Rule 6.42&lt;/a&gt; states, &quot;the Penny Pilot shall expire on June 30, 2013&quot;.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2013-04-05T19:41:28.307" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7671" PostTypeId="2" ParentId="7666" CreationDate="2013-04-05T23:28:27.290" Score="8" Body="&lt;p&gt;of course you can use this test to elaborate on this matter. Basically this test measures the ratio of variance of series in period &lt;code&gt;tn&lt;/code&gt; to &lt;code&gt;n*variance&lt;/code&gt; of &lt;code&gt;t&lt;/code&gt; preriod&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{Var(tn)}{nVar(t)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in short:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;constant ratio for random walk&lt;/li&gt;&#xA;&lt;li&gt;increasing for series with trend&lt;/li&gt;&#xA;&lt;li&gt;decreasing for mean reverting process, more decreasing (faster) - better mean reversion&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/f2lLd.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/2oygn.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2017" LastEditorUserId="2017" LastEditDate="2013-04-06T16:03:09.590" LastActivityDate="2013-04-06T16:03:09.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7672" PostTypeId="1" CreationDate="2013-04-06T02:50:25.800" Score="1" ViewCount="799" Body="&lt;p&gt;I am new to regression analysis. Let's say initially I have a linear regression&lt;/p&gt;&#xA;&#xA;&lt;p&gt;x = alag(x1) + blag(x2) + clag(x3) -- eq 1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to predict the price x based on the the price of x from previous days.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say I believe that lagged volatility y and lagged range (high - low) z also would affect  today's price, how could I regress the data? Do I simply do&lt;/p&gt;&#xA;&#xA;&lt;p&gt;x = alag(x1) + blag(x2) + clag(x3) +&#xA;     dlag(y1) + elag(y2) + flag(y3) +&#xA;     glag(z1) + hlag(z2) + ilag(z3)    -- eq 2&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuitively, I think that the combination of the three factors together for a particular day is useful for the prediction. For example,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;x = alag(All factors lag 1) + blag(All factors lag 2) + clag(All factors lag 3) --eq 3&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, by using eq2, it seems like I am treating all factors independently irregardless the data point is from the same day or not. So is there a method to handle the lagged data in groups or I am getting it wrong by thinking that way?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="6216" LastActivityDate="2013-04-08T08:32:34.463" Title="Regression with Lagged variables" Tags="&lt;regression&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7673" PostTypeId="1" CreationDate="2013-04-06T04:48:25.647" Score="4" ViewCount="2085" Body="&lt;p&gt;I have created a VBA program to calculate VaR by using Monte Carlo, I have simulated Brownian Motion. This method might be ok for 100% equity portfolio, but let's say this portfolio may have fixed income/alternative investment/derivative etc and that composition percentage may or may not be known to me. In that case as a generic model can I use Generalized Pareto Distribution(GPD) for Monte Carlo ? Usage will not be for accurate Market Risk valuation purpose but more of a Investment Performance Risk Analytics report. I got a link for GPD in excel at below link. &lt;a href=&quot;http://www.quantitativeskills.com/sisa/rojo/pareto.xls&quot; rel=&quot;nofollow&quot;&gt;http://www.quantitativeskills.com/sisa/rojo/pareto.xls&lt;/a&gt; But in that case what/how will be my stochastic equation for price/return modelling ? Simply randomizing x0 or alpha will not do I believe. My current VBA code is as below for easy reference:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    Function ValueAtRiskMC(confidence, horizon, RiskFree, StDv, StockValue)&#xA;&#xA;Dim i As Integer&#xA;&#xA;Dim stockReturn(1 To 10000) As Double&#xA;    'start of monte carlo loop&#xA;    For i = 1 To 10000&#xA;&#xA;    'According to the Black Scholes model, the price path of stocks is defined by&#xA;    'the stochastic partial differential equation dS = (r - q -1/2sigma^2)dt + sigma dz&#xA;    'where dz is a standard Brownian motion, defined by dz = epsilon * sqrt(dt)&#xA;    'where epsilon is a standard normal random variable; dS is the change in stock price&#xA;    'r is the risk-free interest rate, q is the dividend of the stock,&#xA;    'sigma is the volatility of the stock.&#xA;&#xA;    'The model implies that dS/S follows a normal distribution with mean&#xA;    'r - q -1/2sigma^2, and standard deviation sigma * epsilon * sqrt(dt))&#xA;    'As such the price at time 0 &amp;lt; t &amp;lt;= T is given by&#xA;    'St = S0 * exp( (r – q - ½ sigma^2) dt + sigma * epsilon * sqrt(dt))&#xA;&#xA;    'As we are ignoring dividends etc here so&#xA;    'below line is for geometric brownian motion&#xA;    stockReturn(i) = Exp((RiskFree - 0.5 * StDv ^ 2) + StDv * Application.NormInv(Rnd(), 0, 1)) - 1&#xA;    Next i&#xA;    'end of monte carlo loop&#xA;&#xA;    ValueAtRiskMC = StockValue * (-(horizon) ^ 0.5) * Application.Percentile(stockReturn, 1 - confidence)&#xA;&#xA;End Function&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3456" LastActivityDate="2013-04-09T09:21:08.997" Title="Value at Risk Monte-Carlo using Generalized Pareto Distribution(GPD)" Tags="&lt;monte-carlo&gt;&lt;distribution&gt;&lt;value-at-risk&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7674" PostTypeId="1" CreationDate="2013-04-06T17:29:47.473" Score="7" ViewCount="1515" Body="&lt;p&gt;I want to fit a distribution to my financial data using a volatility model to estimate the VaR. So in case of a normal distribution, this would be very easy, I assume the returns to follow a normal distribution and calculate a volatility forecast for each day, so I have $\sigma_1,\sigma_2,...,\sigma_n,$. I can calculate the VaR via ($\mu$ constant, $z_\alpha$ quantile of standard normal): $VaR_{\alpha ,t}=\mu+\sigma_t z_\alpha$. This is in case, I have losses, so I look at the right tail. So for each day I have a normal density with a constant $\mu$ but a different $\sigma$ corrensponding to the volatility model. Let's assume a very simple volatility model, e.g. (empirical) standard deviation of the last 10 days and the $\mu$ is set to zero. The R code could look like (&lt;a href=&quot;http://uploadeasy.net/upload/cdm3n.rar&quot;&gt;data&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;volatility&amp;lt;-0&#xA;quantile&amp;lt;-0&#xA;for(i in 11:length(dat)){&#xA;volatility[i]&amp;lt;-sd(dat[(i-10):(i-1)])&#xA;}&#xA;&#xA;for(i in 1:length(dat)){&#xA;quantile[i]&amp;lt;-qnorm(0.975,mean=0,sd=volatility[i])&#xA;}&#xA;# the first quantile value is the VaR for the 11th date&#xA;&#xA;#plot the volatility&#xA;plot(c(1:length(volatility)),volatility,type=&quot;l&quot;)&#xA;&#xA;#add VaR&#xA;lines(quantile,type=&quot;l&quot;,col=&quot;red&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, I want to change the volatility model to a more advanced model (EWMA, ARCH, GARCH) and the distribution to a more sophisticated distribution (student, generalized hyperbolic distribution). My main question is now, how can I combine the volatility model and the distribution, since in case e.g. of a Student's-t distribution with parameters $\mu$ (location), $\nu$ (df), $\beta$ (scale) I cannot just plug the $\sigma$ in, because the distribution has no $\sigma$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One solution I already know is, that I take the variance formula of the corresponding distribution - in case of a Student's-t distribution this would be $\sigma = \beta \frac{v}{v-2}$. I have an estimate for $\sigma$. So for each day I do the ML estimation with a modified log-likelihood where I insert for the scale parameter: $\beta = \hat{\sigma}(\nu-2)/\nu$ and do the estimation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all, is this correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I looked at several papers, but I did not understand, how they did this?&#xA;No matter what volatility model they use, I cannot understand the connection of distribution and volatility model. For example, consider this &lt;a href=&quot;http://www.math.chalmers.se/~palbin/mattiasviktor.pdf&quot;&gt;paper&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On page 50 they are showing the hyperbolical distribution with different volatility models, &lt;strong&gt;how did they do this&lt;/strong&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I do not understand table 6.2 on page 49:&#xA;If they have estimated several distributions over the time, they have lots of estimates, but they just show one distribution? I mean, where does it come from? The 3d picture clearly differnt distributions over time, so they have estimated the distribution after 5 days (page 48), but in the table is just one specific distribution with specific parameters? And they give the volatility models in the rows?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A second famous paper is the Technial Document by JPMorgan:&#xA;RiskMetrics Technical Document - Fourth Edition 1996, December&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(since I have not enough reputation I cannot give a second link, you can get the paper by typing &quot;Risk metrics technical document 1996 jp morgan&quot; into google, the first hit is the document with 296 pages)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Especially page 238 is interesting:&#xA;&quot;According to this model, returns are generated as follows&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_t=\sigma_t \xi_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma^2_t=\lambda \sigma^2_{t-1}+(1-\lambda)r_{t-1}^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\xi$ is distributed according to the generalized error distribution. So they do not assume the returns to follow a certain distribution, but they assume the returns condition on the volatility to follow a certain distribution, right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now my question is, how can one calculate the VaR in this case? On page 242 they give a short summary, describing the steps. The third step in the most intersting:&#xA;&quot;Third, we use [...] volatility estimated and the [...] probability distributions ([...] generalized error distribution) evaluated at the parameter estimates to construct VaR forecasts at the 1st and the 99th percentile.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is now, &lt;strong&gt;how do they do it&lt;/strong&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They describe their fitting steps in the steps before, but I am not getting the following point:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do they fit the distribution to the original return series, calculate the volatility ($\sigma_t$) and then just calculate the VaR with $VaR_t=\sigma_t * q_\alpha$ where $q_\alpha$  is the quantile of the fitted distribution&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;p&gt;do they fit the distribution to the standardized returns ($\xi_t=r_t/\sigma_t$), calculate the volatility and then just calucate the VaR with $VaR_t=\sigma_t * q_\alpha$ where $q_\alpha$ is now the quantile of the fitted distribution which was fitted using the standardized residuals?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another question is: Did they set the mean of the return to zero?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My main point is, how to fit a sophisticated distribution to financial data using a volatility forecast for each day, which was generated by EWMA, ARCH or GARCH and how to calculate the VaR for each day over a time horizon and how to implement this. The paper is doing this, but I am simply not getting it. I worked on this for days now and I am really stuck here. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And one other question:&#xA;If I am doing the way with the modified log-likelihood: This is really challenging in case of a hyperbolic distribution, since the variance is not calculated easily anymore? See wikipedia.&lt;/p&gt;&#xA;" OwnerUserId="5078" LastActivityDate="2013-04-19T14:06:22.527" Title="Fitting distributions to financial data using volatility model to estimate VaR" Tags="&lt;volatility&gt;&lt;r&gt;&lt;estimation&gt;&lt;distribution&gt;&lt;value-at-risk&gt;" AnswerCount="1" CommentCount="9" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7675" PostTypeId="1" CreationDate="2013-04-06T18:44:55.977" Score="5" ViewCount="1276" Body="&lt;p&gt;I often hear in the news that High-Frequency Traders can front-run incoming trades because they are faster at acquiring information and to execute trades. I also read that speed is only a necessary condition but not sufficient. The other necessary condition concerns the &quot;special order types&quot; that HFTraders have access at different exchanges... what are those special order types? It is not market or limit orders... what's so &quot;special&quot; about them?&lt;/p&gt;&#xA;" OwnerUserId="2570" LastActivityDate="2013-04-06T21:26:07.713" Title="High-Frequency Traders and Front Running: What order types are they using?" Tags="&lt;trading&gt;&lt;high-frequency&gt;&lt;order-execution&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ClosedDate="2013-04-06T21:49:24.950" ContentLicense="CC BY-SA 3.0" />
  <row Id="7678" PostTypeId="2" ParentId="7675" CreationDate="2013-04-06T21:26:07.713" Score="6" Body="&lt;p&gt;Everyone can do what HFTs do, if they spend the necessary time and money to build and run the infrastructure required. This may involve becoming a regulated broker/dealer, but it is in no way an invite-only club.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, to your specific question, you'll find some information on &lt;a href=&quot;http://haimbodek.com/research.html&quot; rel=&quot;noreferrer&quot;&gt;Haim Bodek's site&lt;/a&gt;. Bodek does content that ISO's and Day ISOs are used to gain certain microstructure advantage. Of course, anyone trading in the market is attempting to gain an advantage of some sort. Another example is the Hide not Slide order. This can be used to gain microstructure advantage resulting in advantageous queue position when a new level lights. Again, the order type is available to any market participant whose market access makes it available to them (meaning, your broker could give you access to hide not slide, if they wanted to).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Front running is not possible and is against the law. Anyone that contends that HFTs front run orders is misinformed. What they might mean is that HFTs react faster than they can. This has happened before and can be seen as both an advantage (in the early days) of being a local in an exchange pit as well as a disadvantage (1990s, early 2000s) of being a pit trader in an increasingly electronic market. The HFTs are simply the next step.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2013-04-06T21:26:07.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7681" PostTypeId="1" CreationDate="2013-04-07T03:59:08.737" Score="2" ViewCount="556" Body="&lt;p&gt;Lets say I have the returns of two stocks(stock1 and stock2). Now without running a regression, I lag one of the variables, calculate the correlation between the two stocks and repeat this process as I keep stock1's returns fixed as I continually lag stock2's returns forward. What are some valid statistics that one could use to determine if the correlation (corr(stock1 return, stock2 return(-n)) at any given lag is statistically significant? Ljung-Box is pretty much used for looked at autocorrelation for a variable and its past lags, not for another variable. &lt;/p&gt;&#xA;" OwnerUserId="4729" LastActivityDate="2013-04-08T21:02:33.057" Title="Testing Significance of Correlation" Tags="&lt;statistics&gt;&lt;correlation&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7682" PostTypeId="1" AcceptedAnswerId="7694" CreationDate="2013-04-07T10:14:31.417" Score="7" ViewCount="1194" Body="&lt;p&gt;I've developed some software which generates sets of trades, and I'd like to backtest those trades. My software currently outputs a CSV file with details of each trade:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;2011-03-31,MSFT,Buy,100&#xA;2011-04-02,AAPL,Buy,50&#xA;2011-05-10,MSFT,Sell,100&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there any backtesting software out there that lets you bring in a set of your own trades, and see how it would have done? All the software I've found so far requires to you write your algos directly in the package, and doesn't simply let you say 'Buy X, Sell Y'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit based on comments:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I don't include prices or commissions in my CSV because my play here is a long term play (timescale is months or even years). Having the backtesting software use the VWAP (or even just the day's close) is fine, and with most retail commissions fairly low I could either let the backtesting software add one in or just ignore it. I may not get perfect resolution but (I think) I'd be close enough.&lt;/li&gt;&#xA;&lt;li&gt;I can't use any of the packages that I've found because my algo doesn't work on the traditional technicals. Instead I'm looking (mostly) at independent stuff, such as 13f data feeds.&lt;/li&gt;&#xA;&lt;li&gt;I can definitely write something in R, or even in my own codebase, but I'm trying to save myself some work on my proof of concept.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="5081" LastEditorUserId="5081" LastEditDate="2013-04-07T17:27:38.837" LastActivityDate="2020-10-21T18:49:08.223" Title="Software for backtesting outside strategies (CSV transaction upload)" Tags="&lt;backtesting&gt;" AnswerCount="5" CommentCount="6" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7683" PostTypeId="2" ParentId="7672" CreationDate="2013-04-07T12:56:59.750" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I think that the combination of the three factors together for a particular day is useful for the prediction.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;A shortcut.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Did you formally determine the nature of this &lt;em&gt;combination&lt;/em&gt; of the 3 factor together?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say you come up with the &lt;em&gt;combination&lt;/em&gt;: &lt;strong&gt;factor1 + factor2 + factor3&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you can do is considering it as a new variable, eg &lt;strong&gt;v&lt;/strong&gt; to that &lt;strong&gt;v = factor1 + factor2 + factor3&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You now just have to plug the new variable &lt;strong&gt;v&lt;/strong&gt; into you equation.&lt;/p&gt;&#xA;" OwnerUserId="2220" LastActivityDate="2013-04-07T12:56:59.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7684" PostTypeId="2" ParentId="4741" CreationDate="2013-04-07T13:14:53.397" Score="1" Body="&lt;p&gt;It exists several techniques to deal with mixed-frequency data. I believe &lt;strong&gt;MIxed DAta Sampling&lt;/strong&gt; is the best-known.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Eg:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;bridge equation,&lt;/li&gt;&#xA;&lt;li&gt;MIxed DAta Sampling (MIDAS) models&lt;/li&gt;&#xA;&lt;li&gt;Mixed frequency VARs&lt;/li&gt;&#xA;&lt;li&gt;Mixed frequency factor models&lt;/li&gt;&#xA;&lt;li&gt;...&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here is a good document on this topic: &lt;a href=&quot;https://docs.google.com/viewer?a=v&amp;amp;q=cache%3ai4FO0H5T_2cJ%3awww.norges-bank.no/pages/93112/Norges_Bank_Working_Paper_2013_06.pdf%20&amp;amp;hl=es-419&amp;amp;pid=bl&amp;amp;srcid=ADGEESiWnBbMTYse4JAyzh8zRTklDNo_go_wWSs1B7wirxJRv-V_bONuFFwfo-LP7EwjgwNEMysPVrpo5fT7kgAGp19bg2IClQiAYhrWAEa5u2uDlpdnOvEXCra2FyKlwSLxlUm08gZw&amp;amp;sig=AHIEtbSKKop8ry6EmhGjTwsaakghe1gdpQ&quot; rel=&quot;nofollow&quot;&gt;A survey of econometric methods for mixed- frequency data&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="2220" LastEditorUserId="2220" LastEditDate="2013-04-07T13:30:25.613" LastActivityDate="2013-04-07T13:30:25.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7685" PostTypeId="2" ParentId="7605" CreationDate="2013-04-07T15:47:50.303" Score="0" Body="&lt;p&gt;Old (1998):  &lt;a href=&quot;http://bbs.cenet.org.cn/uploadimages/2003931633961531.pdf&quot; rel=&quot;nofollow&quot;&gt;http://bbs.cenet.org.cn/uploadimages/2003931633961531.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Says that depth, volume, trade size, and trade frequency increase while spread decreases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since open interest is 0 before options trade and &gt; 0 after, I'm going to extrapolate and say that increases in open interest increases underlying volume.&lt;/p&gt;&#xA;" OwnerDisplayName="user3232" LastActivityDate="2013-04-07T15:47:50.303" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7686" PostTypeId="2" ParentId="7668" CreationDate="2013-04-07T16:08:41.463" Score="-1" Body="&lt;p&gt;The first 13 were some pretty active securities, but they definitely weren't the most.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;chrisaycock's noted $3 threshold undoubtedly plays a role, so does volume, but there's probably some sort of other political consideration (like &quot;don't leave out the small caps!&quot;) that could be quantified.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like, generally speaking, it's the highest dollar volume underlyings with most option premium volume under $3 as well as a few political choices here and there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.ise.com/assets/files/investors/Penny_Report.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.ise.com/assets/files/investors/Penny_Report.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Fun facts from the link: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Offered spread drops from 10c to 7c.&lt;/li&gt;&#xA;&lt;li&gt;Size at the offer drops 80%, but how is this a shock that everyone at the nickel can't play along at the penny?&lt;/li&gt;&#xA;&lt;li&gt;Depth drops 60%, so it looks like some came part of the way, and those who have no hope of ever getting their order filled went away.&lt;/li&gt;&#xA;&lt;li&gt;Quotes from market makers doubled.  Looks like &lt;em&gt;they&lt;/em&gt; like it.&lt;/li&gt;&#xA;&lt;li&gt;The part the exchange cares about most: volume increased 33% for PP stocks, 9% for no PP.&lt;/li&gt;&#xA;&lt;li&gt;The part the exchanges are afraid of the most: 25% increase in capacity needed to handle pennies.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I can't wait for the penny pilot to be over.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Whoever actually drops out and only does nickels will get murdered by the last one(s) still doing pennies (NYSE/Arca looks pretty enthusiastic based upon their papers).  We might watch CBOE take a huge hit to earnings and prestige if they're the only ones who bow out.  Could be a funny day!&lt;/li&gt;&#xA;&lt;li&gt;The exponential rate (current average annual 74% rate) that underlyings have been added to the penny list will continue.  We're at 362 pennies, 3215 total now, so it looks like it'll be ~4 years until totally ubiquitous.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerDisplayName="user3232" LastEditorDisplayName="user3232" LastEditDate="2013-04-07T16:31:47.350" LastActivityDate="2013-04-07T16:31:47.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7687" PostTypeId="2" ParentId="4165" CreationDate="2013-04-07T18:08:26.090" Score="0" Body="&lt;p&gt;It's just a convention, a way to account for the total return of the stock including dividends.  This method is for simplicity's sake.  It'd be &quot;impossible&quot; to try to take into account all of the infinite possibilities of dividend investment elsewhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could think of it as &quot;the dividend is fully reinvested cost-free&quot;, but that's just a short-hand way to visualize it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the stock increases by X and a dividend paid is Y then today's return is X+Y.  It carries on to each new day, so that's why a dividend paying stock has higher adjusted prices than the true price.&lt;/p&gt;&#xA;" OwnerDisplayName="user3232" LastActivityDate="2013-04-07T18:08:26.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7688" PostTypeId="2" ParentId="4165" CreationDate="2013-04-07T18:15:39.653" Score="0" Body="&lt;p&gt;Often you're more interested in what your &lt;strong&gt;overall return&lt;/strong&gt; would have been (or has been) over a certain holding period rather than how much the stock price has changed.  In that case, you'd need to have some way to account for the dividends, and calculating adjusted stock price is a convenient way of doing it.&lt;/p&gt;&#xA;" OwnerUserId="2609" LastActivityDate="2013-04-07T18:15:39.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7689" PostTypeId="2" ParentId="7663" CreationDate="2013-04-07T21:20:25.750" Score="2" Body="&lt;p&gt;There are many, which are mostly generalizations of the Black-Scholes model (Geometric Brownian Motion).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Equity stocks, the most widely used (IMHO) is the deterministic generalization of Black-Scholes model, the &lt;a href=&quot;http://en.wikipedia.org/wiki/Local_volatility&quot; rel=&quot;nofollow&quot;&gt;Local Volatility model&lt;/a&gt;. Followed by &lt;a href=&quot;http://en.wikipedia.org/wiki/Stochastic_volatility&quot; rel=&quot;nofollow&quot;&gt;stochastic volatility models&lt;/a&gt; such as &lt;a href=&quot;http://en.wikipedia.org/wiki/Heston_model&quot; rel=&quot;nofollow&quot;&gt;Heston&lt;/a&gt; or &lt;a href=&quot;http://en.wikipedia.org/wiki/SABR_volatility_model&quot; rel=&quot;nofollow&quot;&gt;SABR&lt;/a&gt;, also there is a generalization of the Local volatility model with stochastic volatility but not used as much because is harder to implement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, there are a lot of different models such as Levy processes, but the ones I indicated here are the ones that you would see implemented in practice for derivatives pricing. &lt;/p&gt;&#xA;" OwnerUserId="1704" LastActivityDate="2013-04-07T21:20:25.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7690" PostTypeId="2" ParentId="7681" CreationDate="2013-04-07T21:45:44.863" Score="4" Body="&lt;p&gt;Simple rule: correlation coefficient R of N samples is statistically significant if: &#xA;$|R| &amp;gt; 2 / \sqrt{N}$&#xA;&lt;a href=&quot;http://capone.mtsu.edu/dwalsh/436/CORRSIG.pdf&quot; rel=&quot;nofollow&quot;&gt;http://capone.mtsu.edu/dwalsh/436/CORRSIG.pdf&lt;/a&gt;&#xA;But watch out for spurious correlations. It is possible to find statistically significant correlation for non stationary data series even though there is no correlation. &#xA;&lt;a href=&quot;http://www.investopedia.com/terms/s/spurious_correlation.asp&quot; rel=&quot;nofollow&quot;&gt;http://www.investopedia.com/terms/s/spurious_correlation.asp&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2297" LastEditorUserId="2609" LastEditDate="2013-04-08T21:02:33.057" LastActivityDate="2013-04-08T21:02:33.057" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7691" PostTypeId="2" ParentId="7682" CreationDate="2013-04-08T08:26:45.880" Score="3" Body="&lt;p&gt;Answering my own question... based on the above comments and a lot of research, it looks like there aren't any packages out there that do this 'out of the box'. So coding your own is the best way to go. &lt;/p&gt;&#xA;" OwnerUserId="5081" LastActivityDate="2013-04-08T08:26:45.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7692" PostTypeId="2" ParentId="7673" CreationDate="2013-04-08T08:28:10.167" Score="3" Body="&lt;p&gt;the risk neutral drift is needed for pricing of derivatives. For a $100\%$ equity portfolio you can take the real world drift - sometimes a good guess is a drift of zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For fixed-income you could do the same and might need more sophistication for the variance term. If you have short-dated bonds then you will need a special model for the pull-to-par. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For derivatives: for options the best is modelling the spot price (and other parameters) and then do full valuation. Or as an approximation you do Delta-Gamma. But again: to cover many asset classes in one application is a big project (that's why there are those vendors of commercial solutions).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why do you want to use GPD? If you want to use GPD to model fat tails then you could use it for all asset classes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to model fat tails you can use Levy models (t-distributed returns, normal-inverse Gaussian mixtures). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To find some key-words to search for you can have a look &lt;a href=&quot;http://www.nr.no/files/samba/bff/GHSkewTAasHaff05.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; or you brows through &lt;a href=&quot;http://press.princeton.edu/titles/8056.html&quot; rel=&quot;nofollow&quot;&gt;this book&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: if you want to use the GPD anyways then looking at the &lt;a href=&quot;http://en.wikipedia.org/wiki/Generalized_Pareto_distribution&quot; rel=&quot;nofollow&quot;&gt;wikipedia page&lt;/a&gt; you find an algorithm for random number generation of this distribution. E.g. in the special case where $\xi=0$ you draw a uniform $U$ and calculate&#xA;$$ X = \mu - \sigma \log(U) $$&#xA;and $X$ has the desired distribution. The above formula comes from the random number generation by inversion of the CDF which is a general approach. Of course you have to fit the parameters of the GPD. Does this help?&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2013-04-09T09:21:08.997" LastActivityDate="2013-04-09T09:21:08.997" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7693" PostTypeId="2" ParentId="7672" CreationDate="2013-04-08T08:32:34.463" Score="1" Body="&lt;p&gt;For forecasting and regression methods there is a great, free online textbook by &lt;a href=&quot;http://otexts.com/fpp/&quot; rel=&quot;nofollow&quot;&gt;Rob Hyndman&lt;/a&gt;. Chapter 9 deals with time-series regression. It is perfectly fine to have correlated factors on the rhs as in your equation 2. The forecast will work but the clear attribution to the regression factors will not possible.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2013-04-08T08:32:34.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7694" PostTypeId="2" ParentId="7682" CreationDate="2013-04-08T13:02:13.817" Score="16" Body="&lt;p&gt;You're not really asking how to backtest a strategy.  You already have run a backtest to generate simulated trades.  What you're asking for is a way to assess the performance of those simulated trades.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can do this with the R package &lt;a href=&quot;http://r-forge.r-project.org/R/?group_id=316&quot;&gt;blotter&lt;/a&gt;.  You'll need to setup your account and portfolio, then loop over each row in your CSV and call &lt;code&gt;addTxn&lt;/code&gt;.  For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;trades &amp;lt;- read.csv(&quot;trades.csv&quot;)&#xA;symbols &amp;lt;- unique(trades$symbol)&#xA;&#xA;# Set up a portfolio object and an account object in blotter&#xA;initPortf(name='default', symbols=symbols, initDate=initDate)&#xA;initAcct(name='default', portfolios='default', initDate=initDate, initEq=initEq)&#xA;verbose = TRUE&#xA;&#xA;for(i in 1:NROW(trades)) {&#xA;  addTxn('default', Symbol=trades$symbol[i], TxnDate=trades$date[i],&#xA;    TxnPrice={&quot;object-with-price&quot;}, TxnQty=trades$quantity[i], TxnFees=0, verbose=verbose)&#xA;}&#xA;&#xA;# Calculate P&amp;amp;L and resulting equity with blotter&#xA;updatePortf(Portfolio='default', Dates=CurrentDate)&#xA;updateAcct(name='default', Dates=CurrentDate)&#xA;updateEndEq(Account='default', Dates=CurrentDate)&#xA;&#xA;# Look at performance&#xA;chart.Posn(Portfolio='defaut',Symbol='MSFT')&#xA;chart.Posn(Portfolio='defaut',Symbol='AAPL')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="56" LastActivityDate="2013-04-08T13:02:13.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7696" PostTypeId="1" CreationDate="2013-04-08T17:30:46.287" Score="16" ViewCount="6375" Body="&lt;p&gt;&lt;strong&gt;Original Question: What is the link between Gamma and the Volatility Risk?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It leads me to ask:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;- What is the Volatility Risk definition and what are the good practices to measure it?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thinking about that question, all I could figure out liking with it  is this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a market $(S^0, S)$ composed of one non-risky asset $S^0$ and&#xA; one risky asset $S$. The interest rate in this market is $r$ (supposed&#xA; constant just to simplify. Also, consider an adapted square integrable&#xA; process $\sigma$ and suppose that $S$ follows    $$S_t= S_0 + \int_0^t&#xA; r S_u ~du +\int_0^t \sigma_u S_u dW_u \quad , t  \geq 0$$   under the&#xA; risk-neutral probability.   Let's suppose a trader evaluate the price&#xA; $v$ of an option of maturity $T$ by fixing &#xA; $\sigma_t=\bar{\sigma}(t,S_t)$, a function of local volatility. Then,&#xA; I know that the coverage error is given by  (one can show it by a simple aaplication of Feyman-Kac theorem and Itô's Lemma) \begin{align} \text{Err}&#xA; = V_T- v(T, S_T) &amp;amp;= \int_0 ^T e^{r(T-t)} (\bar{\sigma}(t,S_t) - \sigma_t) \partial^2_x v(t,S_t)dt \\&amp;amp;=\int_0 ^T e^{r(T-t)}&#xA; (\bar{\sigma}(t,S_t) - \sigma_t) \Gamma(t,S_t)dt,\end{align}   where $V&#xA; = (V_t)_{0 \leq t \leq T}$ is the replicating portfolio and $v(t,x)$ is the intrinsic value of the option  at time $t \in [0,T]$ and spot&#xA; $S_t=x$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, we conclude that if:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;$\Gamma \geq 0$ (i.e. a convex price):&lt;/strong&gt; an over-estimation of $\bar{\sigma}(t,S_t)$ secures a gain, and an under-estimation of&#xA;$\bar{\sigma}(t,S_t)$ secures a loss.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;$\Gamma\leq 0$ (i.e. a concave price):&lt;/strong&gt; an under-estimation of $\bar{\sigma}(t,S_t)$ secures a gain, and an over-estimation of&#xA;$\bar{\sigma}(t,S_t)$ secures a loss.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;$\Gamma \approx 0$  (i.e. neutral Gamma hedging):&lt;/strong&gt; the hedging is weakly sensitive to realized volatility.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Am I going in the right direction to answer that?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would appreciate any advice. Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="3534" LastEditorUserId="3534" LastEditDate="2013-04-11T04:24:21.597" LastActivityDate="2016-10-26T18:17:21.233" Title="Gamma vs. Volatility Risk" Tags="&lt;volatility&gt;&lt;risk&gt;&lt;risk-models&gt;&lt;coherent-risk-measure&gt;&lt;gamma&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="7697" PostTypeId="1" AcceptedAnswerId="7701" CreationDate="2013-04-08T21:34:23.340" Score="8" ViewCount="338" Body="&lt;p&gt;Consider a probability filtred space $(\Omega, \mathcal F, \mathbb F, \mathbb P)$, where $\mathbb F = (\mathcal F_t)_{0\leq t\leq T}$ satisfing the habitual conditions and isgenerated by $1 d $- Brownian Motion (with $\mathcal F_T = \mathcal F$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, consider a finantial market where the interest rate is nul, $r=0$, and the dynamics of the risky asset $S$ is given by&#xA; $$S_t= S_0 + \int_0^t  \mu_s ~ds +\int_0^t \sigma_s ~dW_s \quad , t  \geq 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $t \in [0,T] \mapsto \mu_t$ and $t \in [0,T] \mapsto \sigma_t \geq 0$ are &lt;strong&gt;deterministic and continuous functions&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Show that:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;If the absence of arbitrage opportunity hypothesis is verified, then $B:=\{t \in [0,T] : \sigma_t=0 \  \text{and} \ \mu_t \neq 0\}$ is a Lebesgue nul-measure set (ie, $\int_0^T\mathbf1_{t \in B} dt=0$).&lt;/li&gt;&#xA;&lt;li&gt;$\nu_\sigma(O):= \int_0^T\mathbf1_{t \in O}\sigma_t ~dt$ dominates $\nu_\mu (O):= \int_0^T\mathbf1_{t \in O} \mu_t ~dt$, where $O$ is a borelian of $[0,T]$ ( ie, $\nu_\mu \ll \nu_\sigma$) and deduce from it that  there is a measurable function $\lambda$ such that $\mu = \sigma \lambda$.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3534" LastEditorUserId="3534" LastEditDate="2013-04-09T02:27:40.680" LastActivityDate="2013-05-09T08:07:23.657" Title="Non-arbitrage theory and existence of a risk premium" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7698" PostTypeId="1" AcceptedAnswerId="7769" CreationDate="2013-04-08T21:59:11.443" Score="5" ViewCount="461" Body="&lt;p&gt;Consider a probability filtred space $(\Omega, \mathcal F, \mathbb F, \mathbb P)$, where $\mathbb F = (\mathcal F_t)_{0\leq t\leq T}$ satisfing the habitual conditions and is generated by $1 d $- Brownian Motion (with $\mathcal F_T = \mathcal F$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, consider a financial market where the interest rate is nul, $r=0$, and the dynamics of the risky asset $S$ is given by&#xA; $$S_t= S_0 + \int_0^t  \mu_s ~ds +\int_0^t \sigma_s ~dW_s \quad , t  \geq 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $t \in [0,T] \mapsto \mu_t$ and $t \in [0,T] \mapsto \sigma_t \geq 0$ are &lt;strong&gt;deterministic and continuous functions&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose that there is a measure $\mathbb Q \sim \mathbb P$ and a $\mathbb Q$-brownian motion  $W^{\mathbb Q}$ such that &#xA;$$S_t= S_0+\int_0^t \sigma_s ~dW_s^{\mathbb Q}\quad , t  \leq T$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We want to evaluate and hedge a forward-start option, whose payoff is $(S_T-\kappa S_1)^+$ where $\kappa &amp;gt;0$ (we suppose T&gt;1). Let's admit that it can be perfectly hegded and let's note &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ p(t,x) := \mathbb E^{\mathbb Q} \left [ (S_T-\kappa S_1)^+ | S_t=x \right] \quad \text{for} \ (t,x) \in [0,1]\times(0,\infty)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Show that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ p(t,x) = x F(1,\kappa, \int_0^T \sigma_s ^2 ds) \quad \text{if} \ t\in [0,1]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where, for $y, K, \gamma^2 &amp;gt;0$&#xA;$$F(y,K,\gamma^2) = \mathbb E \left [ (ye^Y -K)^+ \right] \quad \text{with} \ Y \sim \mathcal N(-\gamma^2/2, \gamma^2)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would appreciate any advice. Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="3534" LastEditorUserId="3534" LastEditDate="2013-04-11T04:23:54.173" LastActivityDate="2017-11-28T09:50:47.507" Title="Foward-start option pricing" Tags="&lt;option-pricing&gt;&lt;stochastic-processes&gt;&lt;mathematics&gt;&lt;pricing&gt;&lt;pricing-formulae&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7699" PostTypeId="1" CreationDate="2013-04-09T00:30:41.317" Score="4" ViewCount="496" Body="&lt;p&gt;I am attempting to come up with an algorithm to iterate through every possible path of a trinomial tree and am having difficulties coming up with one. Is there any literature on this or has anyone else written something similar?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be specific I am trying to calculate the P&amp;amp;L of stock trades from node 0 to every possible path end.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Let me clarify - for a 1 step trinomial tree there are three paths: 1 (up) 0 (middle) or -1 (down). Adding another step makes the tree have 5 ending points and 9 paths: 11 (up,up) 10 (up,mid) 01 (mid, up) 1-1 (up,down) 00 (mid,mid) -11 (down,up) 0-1 (m,d) -10 (d,m) -1-1 (d,d)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am aware the total number of paths that end at a given point is given by Pascal's tetrahedron but I do not know how to come up with all the paths for an arbitrary (n-step) tree. So I need the 1,-1,1,-1,0 sequence which in this case would end on the middle node of a 5 step tree.&lt;/p&gt;&#xA;" OwnerUserId="5092" LastEditorUserId="5092" LastEditDate="2013-04-09T13:58:19.740" LastActivityDate="2013-04-09T14:45:15.340" Title="Iterating through every path of a Trinomial Tree" Tags="&lt;lattice&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7701" PostTypeId="2" ParentId="7697" CreationDate="2013-04-09T08:03:48.033" Score="4" Body="&lt;p&gt;For the first one absurd reasoning allows you to construct an arbitrage (as r=0) by investing (or short selling according to the sign of $\mu$) at the time where $\sigma$ is null, or if you prefer as soon as $t$ is in $B$ (which is not a Lebesgue negligible set by hypothesis) which is absurd as no-arbitrage holds. The details that remain to be proved is that such a strategy is an admissible one. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the second question, as soon as the first part is done, it is only the application of Lebesgue's  decomposition theorem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the first part as any borelian set such that $\nu_\sigma(O):= \int_0^T\mathbf1_{t \in O}\sigma_t dt $ doesn't dominate $\nu_\mu (O):= \int_0^T\mathbf1_{t \in O} \mu_t dt$ is included in $B$ and as $B$ is of null probability the conclusion holds true.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best regards&lt;/p&gt;&#xA;" OwnerUserId="92" LastActivityDate="2013-04-09T08:03:48.033" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7702" PostTypeId="2" ParentId="764" CreationDate="2013-04-09T10:48:19.317" Score="2" Body="&lt;p&gt;I am not sure any of the other answers mentioned this but the main reason you should not use an option model to buy/sell the underlying (BS or other) is that the option models are more about market-making in options and hedging using the underlying rather than forecasting the underlying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The layman way to understand this is that: using an option model, you do not care about forecasting the right price of the underlying as your job is to market-make options and your loss and profit are related to the efficiency of the hedge which is NOT directly correlated with the efficiency of forecasting your underlying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is why most of option models start with the hypothesis of no arb as they are trying to hedge using replication.&lt;/p&gt;&#xA;" OwnerUserId="2908" LastActivityDate="2013-04-09T10:48:19.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7703" PostTypeId="2" ParentId="7699" CreationDate="2013-04-09T12:25:55.067" Score="1" Body="&lt;p&gt;To convert an index to &lt;a href=&quot;http://en.wikipedia.org/wiki/Ternary_numeral_system&quot; rel=&quot;nofollow&quot;&gt;base 3&lt;/a&gt; (actually to an array with the base 3 digits, each one selecting a move up/mid/down) you only need to alternate a modulo-3 (remainder) operator and integer division by 3.&#xA;Or were you asking for something else?&lt;/p&gt;&#xA;" OwnerUserId="3015" LastActivityDate="2013-04-09T12:25:55.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7704" PostTypeId="1" AcceptedAnswerId="7712" CreationDate="2013-04-09T13:10:27.250" Score="2" ViewCount="238" Body="&lt;p&gt;In calculating the Sharpe Ratio, should I take into account the days were I have 0 return due to non-trading day? Another user posted a similar question but this was related to trading days with no open position. This is actually the same issues but then related to return history and inactive trading days. When analyzing the return history of several firms in the Asia Pacific region I noticed that there are some irregularities  when it comes to trading days. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, X has 239 td’s on the TSE  while Y has 250 td’s on the SGX. Squaring both daily returns by 252 would give biased returns/Sharpe ratios. My gut feeling says to square it by the amount of actual td’s rather than using the common 252 days. It also sometimes occurs within, for example the Japanese market, that different listed firms produce 0 return four times in a row, while others have on those same days a positive/negative return. The data is downloaded from the DataStream database.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="5097" LastActivityDate="2013-04-10T03:24:29.950" Title="How to deal with different amount of td's in computing Sharpe Ratio" Tags="&lt;equities&gt;&lt;returns&gt;&lt;sharpe-ratio&gt;&lt;annualized&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7705" PostTypeId="1" CreationDate="2013-04-09T13:47:01.853" Score="12" ViewCount="643" Body="&lt;p&gt;Suppose I have the following model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_t=\sigma_t * \epsilon_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $r_t$ is the return at time t, $\sigma_t$ is the volatility, the model used to model this volatility is an exponentially weighted moving average with known parameter $\lambda$. $\epsilon_t$ is a random variable distributed according to the hyperbolic distribution with parameters $\alpha, \beta , \mu, \delta$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First question:&#xA;How do I estimate this model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Since $\lambda$ is known, calculate the $\hat{\sigma}_t$. &lt;/li&gt;&#xA;&lt;li&gt;Calculate $r_t/\hat{\sigma}_t$ which give the so called standardized residuals.&lt;/li&gt;&#xA;&lt;li&gt;Using the standardized residuals estimate the parameters of the hyperbolic distribution with classical ML.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Or&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Include the $\hat{\sigma}_t$ in the log-likelihood of the hyperbolic distribution and maximize this, so this could be called a &quot;joint&quot; estimation. Since not the normal ML is done, but the ML with the estimated $\sigma$ included.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Second question:&#xA;Suppose the volatility is modeled by an ARCH process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I have to use an R package which estimates all parameters jointly, so the output give me the values of the ARCH process AND the values of the hyperbolic distribution?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or can I use a &quot;normal&quot; ARCH command (which will assume the $\epsilon$ to be N(0,1) distributed (I guess) calculate the $\sigma$. Then do like above, calculate the standardized residuals by calculating $r_t/\sigma_t$ and use these to estimate an hyperbolic distribution using ML. What do you think about this &quot;divided&quot; approach?&lt;/p&gt;&#xA;" OwnerUserId="5078" LastEditorUserId="848" LastEditDate="2013-04-09T17:01:40.963" LastActivityDate="2014-07-16T14:52:57.040" Title="How to estimate the following model?" Tags="&lt;volatility&gt;&lt;returns&gt;&lt;garch&gt;&lt;estimation&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7707" PostTypeId="2" ParentId="7699" CreationDate="2013-04-09T14:45:15.340" Score="5" Body="&lt;p&gt;If I understand you correctly, here's an example in Python. Any other programming language should be able to do something similar:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def search(path):&#xA;    if len(path) == 5:&#xA;        if sum(path) == 0:&#xA;            print path&#xA;    else:&#xA;        search(path+[1])&#xA;        search(path+[0])&#xA;        search(path+[-1])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Just invoke it with an empty array:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt; search([])&#xA;[1, 1, 0, -1, -1]&#xA;[1, 1, -1, 0, -1]&#xA;[1, 1, -1, -1, 0]&#xA;[1, 0, 1, -1, -1]&#xA;[1, 0, 0, 0, -1]&#xA;[1, 0, 0, -1, 0]&#xA;[1, 0, -1, 1, -1]&#xA;[1, 0, -1, 0, 0]&#xA;[1, 0, -1, -1, 1]&#xA;[1, -1, 1, 0, -1]&#xA;[1, -1, 1, -1, 0]&#xA;[1, -1, 0, 1, -1]&#xA;[1, -1, 0, 0, 0]&#xA;[1, -1, 0, -1, 1]&#xA;[1, -1, -1, 1, 0]&#xA;[1, -1, -1, 0, 1]&#xA;[0, 1, 1, -1, -1]&#xA;[0, 1, 0, 0, -1]&#xA;[0, 1, 0, -1, 0]&#xA;[0, 1, -1, 1, -1]&#xA;[0, 1, -1, 0, 0]&#xA;[0, 1, -1, -1, 1]&#xA;[0, 0, 1, 0, -1]&#xA;[0, 0, 1, -1, 0]&#xA;[0, 0, 0, 1, -1]&#xA;[0, 0, 0, 0, 0]&#xA;[0, 0, 0, -1, 1]&#xA;[0, 0, -1, 1, 0]&#xA;[0, 0, -1, 0, 1]&#xA;[0, -1, 1, 1, -1]&#xA;[0, -1, 1, 0, 0]&#xA;[0, -1, 1, -1, 1]&#xA;[0, -1, 0, 1, 0]&#xA;[0, -1, 0, 0, 1]&#xA;[0, -1, -1, 1, 1]&#xA;[-1, 1, 1, 0, -1]&#xA;[-1, 1, 1, -1, 0]&#xA;[-1, 1, 0, 1, -1]&#xA;[-1, 1, 0, 0, 0]&#xA;[-1, 1, 0, -1, 1]&#xA;[-1, 1, -1, 1, 0]&#xA;[-1, 1, -1, 0, 1]&#xA;[-1, 0, 1, 1, -1]&#xA;[-1, 0, 1, 0, 0]&#xA;[-1, 0, 1, -1, 1]&#xA;[-1, 0, 0, 1, 0]&#xA;[-1, 0, 0, 0, 1]&#xA;[-1, 0, -1, 1, 1]&#xA;[-1, -1, 1, 1, 0]&#xA;[-1, -1, 1, 0, 1]&#xA;[-1, -1, 0, 1, 1]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="35" LastActivityDate="2013-04-09T14:45:15.340" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7710" PostTypeId="1" CreationDate="2013-04-09T22:26:45.797" Score="2" ViewCount="178" Body="&lt;p&gt;if I have two asset prices modeled separately as geometric brownian motions. How do i go about calculating the expected statistics of their difference? Like given the sigmas and mus of both processes, and their correlations, what would the standard deviation of that difference/sum be?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an analytic solution for the case of two GBMs? Or are there even solutions for n&gt;2?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've done simulations with a large number of assets. But could intermarket spreads or similar be done without simulating?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I really thought this would be easy to find with google, but I was unable to.&lt;/p&gt;&#xA;" OwnerUserId="5099" LastActivityDate="2013-04-11T14:05:00.930" Title="Statistics of difference between two GBMs" Tags="&lt;statistics&gt;&lt;portfolio&gt;&lt;brownian-motion&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7711" PostTypeId="2" ParentId="7710" CreationDate="2013-04-10T02:47:38.650" Score="1" Body="&lt;p&gt;$$&#xA;\frac{dS_{1t}}{S_{1t}}=\mu_1 dt + \sigma_1 dW_{1t} \to S_{1t} = S_{1,t=0}e^{\int^t_0 \mu_1 - .5\sigma^2_1 ds  + \int^t_0 \sigma_1dW_{1s}}\\&#xA;\frac{dS_{2t}}{S_{2t}}=\mu_2  dt + \sigma_1 \rho dW_{1t} + \sigma_2 (1-\rho)dW_{2t} \to S_{2t}   = S_{2,t=0}e^{\int^t_0 \mu_2 - .5 (1-\rho)^2\sigma_2^2 + \rho^2 \sigma_1^2 ds  + \rho \int^t_0 \sigma_1dW_{1s} + (1-\rho)\int^t_0 \sigma_2dW_{2s}} \\&#xA;S_{2t} - S_{1t}  = S_{1,t=0}e^{\int^t_0 \mu_1 - .5\sigma^2_1 ds  + \int^t_0 \sigma_1dW_{1s}} - S_{2,t=0}e^{\int^t_0 \mu_2 - .5 (1-\rho)^2\sigma_2^2 + \rho^2 \sigma_1^2 ds  + \rho \int^t_0 \sigma_1dW_{1s} + (1-\rho)\int^t_0 \sigma_2dW_{2s}}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which as you can see, is not GBM but you can compute Expected value from here.&lt;/p&gt;&#xA;" OwnerUserId="3440" LastEditorUserId="3440" LastEditDate="2013-04-10T13:21:58.367" LastActivityDate="2013-04-10T13:21:58.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7712" PostTypeId="2" ParentId="7704" CreationDate="2013-04-10T03:24:29.950" Score="3" Body="&lt;p&gt;I can only repeat myself because your mentioned previously asked question is essentially identical:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;=&gt; I would say do not include non-trading days, do not include days with zero position, do not include days where the asset did not trade for whatever other reason. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here some reasons and pointers:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Sharpe measures excess returns scaled by volatility. The whole big picture of using such metrics is to gauge risk and risk adjusted returns. When a security does not trade, when you do not have a position then you do not carry risk at least not on that day. Nothing moves, hence, you are not subject to risk nor returns (on that particular day)&lt;/li&gt;&#xA;&lt;li&gt;You should always scale by the number days that you include in your calculation. So, if a security trades on January 1-31, then trading is halted because of filing irregularities or gross corporate illegal conduct or for whatever reason and for the rest of the year the security does not trade then you end up with those number days that you had a position in this security in January and on which such security traded. Hence you also scale by such number trades. The point is that this one single security does not make up your whole portfolio nor investment horizon (I hope not) but that you properly reflect such risk even if you need to extrapolate risk and returns out over the remainder of the year even though the security did not trade. You are sometimes unfairly penalized for that, at other times you are unfairly rewarded by applying such procedure but the whole point is that such event risk is properly reflected in your whole portfolio risk metrics. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-04-10T03:24:29.950" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7715" PostTypeId="1" AcceptedAnswerId="7717" CreationDate="2013-04-10T14:54:02.417" Score="4" ViewCount="377" Body="&lt;p&gt;The GBM is defined by&#xA;&lt;br&gt;&#xA;$&#xA;dS(t) = \mu S(t)dt + \sigma S(t) dW_t,&#xA;$&#xA;&lt;br&gt;&#xA;with analytical solution&#xA;&lt;br&gt;&#xA;$&#xA;S(t^\prime) = S(t) exp\left[\left(\mu-\frac{\sigma^2}{2}\right)\left(t^\prime-t\right)+\sigma\left(W(t^\prime)-W(t)\right)\right].&#xA;$&#xA;&lt;br&gt;&#xA;What is the analytical expression for the covariance, &#xA;$&#xA;Cov[S(t),S(t^\prime)]&#xA;$&#xA;?&lt;/p&gt;&#xA;" OwnerUserId="5107" LastActivityDate="2013-04-10T16:56:35.113" Title="Auto-correlation of GBM" Tags="&lt;auto-correlation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7716" PostTypeId="2" ParentId="7526" CreationDate="2013-04-10T16:05:10.690" Score="-2" Body="&lt;p&gt;Here is R code which calculates the &quot;Split Ratio&quot; for historical data:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(TTR)&#xA;s &amp;lt;- getSymbols(&quot;GILD&quot;, auto.assign=FALSE)&#xA;&#xA;splitRatio &amp;lt;- s$GILD.Adjusted  / s$GILD.Close&#xA;names(splitRatio) &amp;lt;- c(&quot;SplitRatio&quot;)&#xA;&#xA;head(splitRatio)&#xA;tail(splitRatio)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However (and this is a big however): the cumulated amount of dividends paid will slowly distort this ratio. For example, IBM hasn't had a stock split since 1999, yet the &quot;SplitRatio&quot; at 2007-01-03 is 0.897. This means that IBM has paid out a total of (1/0.897)-1 = 11% dividends since 2007-01-03.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, I'm not 100% sure that this is the complete story, so I've made this a community Wiki so any correct inassumptions can be addressed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This answer is wrong, according to the comment below from Joshua Ullrich:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Don't do this. It's much better to use quantmod::adjustOHLC with Yahoo&#xA;  data. When use.Adjusted=FALSE (the default), the function pulls the&#xA;  split and dividend data from Yahoo and calculates the ratios manually.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="906" LastEditorUserId="906" LastEditDate="2013-08-02T23:41:29.767" LastActivityDate="2013-08-02T23:41:29.767" CommentCount="3" CommunityOwnedDate="2013-04-10T16:25:29.503" ContentLicense="CC BY-SA 3.0" />
  <row Id="7717" PostTypeId="2" ParentId="7715" CreationDate="2013-04-10T16:51:10.883" Score="4" Body="&lt;p&gt;W.l.o.g we use the initial condition $S(0)=1$ and define $\gamma:=\mu-\frac{\sigma^2}{2}$. Hence we have the dynamics&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S_t=e^{\gamma t +\sigma W_t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By definition $Cov(X,Y)=E((X-E(X))(Y-E(Y))=E(XY)-E(X)E(Y)$, where the last equality follows from the linearity of the expectation. Note $\gamma t+\sigma W_t$ is normal distributed with mean $\gamma t$ and variance $\sigma^2t$. Hence $S_t$ is lognormal with mean $\phi_t:=E[S_t]=e^{\gamma t+\frac{\sigma^2t}{2}}$. For $t&amp;gt;r$ this yields,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Cov(S_t,S_r) =E((S_t-\phi_t)(S_r-\phi_r))=E(S_rS_t)-\phi_r\phi_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The last step is to calculate $E(S_tS_r)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E(S_rS_t)=e^{\gamma(t+r)}E(e^{\sigma(W_t+W_r)})=e^{\gamma(t+r)}E(e^{\sigma(W_t-W_r)}e^{2\sigma(W_r)})=e^{\gamma(t+r)}E(e^{\sigma(W_t-W_r})E(e^{2\sigma W_r})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where we have used that $W_t-W_r$ and $W_r$ are independent. Again, using the formula for the mean of a lognormal distribution we get&#xA;$$E(e^{\sigma(W_t-W_r)})=e^{\frac{\sigma^2(t-r)}{2}}$$ and&#xA;$$E(e^{2\sigma W_r})=e^{2\sigma^2 r}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Cov(S_t,S_r)=e^{\gamma(t+r)}e^{\frac{\sigma^2(t-r)}{2}}e^{2\sigma^2 r}-e^{\gamma t+\frac{\sigma^2t}{2}}e^{\gamma r+\frac{\sigma^2r}{2}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I leave it to you to check if this can be further simplified. &lt;/p&gt;&#xA;" OwnerUserId="17133" LastEditorUserId="17133" LastEditDate="2013-04-10T16:56:35.113" LastActivityDate="2013-04-10T16:56:35.113" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7718" PostTypeId="1" CreationDate="2013-04-10T17:20:42.310" Score="4" ViewCount="1622" Body="&lt;p&gt;According to this &lt;a href=&quot;http://girirajcollections.blogspot.de/2011/03/google-realtime-intraday-data.html&quot; rel=&quot;nofollow&quot;&gt;link&lt;/a&gt; I try to get intraday data of SAP listed at Xetra.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intraday data with timestep of 1 second would be great. I do not understand parts of the command, I try&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.google.com/finance/getprices?q=SAP&amp;amp;x=ETR&amp;amp;i=60&amp;amp;p=5d&amp;amp;f=d,c,o,h,l&amp;amp;df=cpct&amp;amp;auto=1&amp;amp;ts=1266701290218&quot; rel=&quot;nofollow&quot;&gt;http://www.google.com/finance/getprices?q=SAP&amp;amp;x=ETR&amp;amp;i=60&amp;amp;p=5d&amp;amp;f=d,c,o,h,l&amp;amp;df=cpct&amp;amp;auto=1&amp;amp;ts=1266701290218&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, first thing I ask myself: Why is there a date column (COLUMNS=DATE,CLOSE,HIGH,LOW,OPEN)? I mean, since this is intraday data of 5 days, there should be more rows per day than just one?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get intraday data of SAP at Xetra of the last 10 years with this command?&lt;/p&gt;&#xA;" OwnerUserId="5108" LastActivityDate="2013-04-10T17:49:40.363" Title="Get intraday data of SAP with google Finance" Tags="&lt;data&gt;&lt;intraday&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7719" PostTypeId="2" ParentId="7718" CreationDate="2013-04-10T17:49:40.363" Score="3" Body="&lt;p&gt;The data is numbered by order in the date column. Its not a real timestamp, to find the actual time, you need to look at the header, where the exact time where the data starts is noted. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For 1 second intervals, change the i-flag in the URL to 1, like here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.google.com/finance/getprices?q=SAP&amp;amp;x=ETR&amp;amp;i=1&amp;amp;f=d,c,o,h,l&amp;amp;df=cpct&amp;amp;auto=1&amp;amp;ts=1266701290218&quot; rel=&quot;nofollow&quot;&gt;https://www.google.com/finance/getprices?q=SAP&amp;amp;x=ETR&amp;amp;i=1&amp;amp;f=d,c,o,h,l&amp;amp;df=cpct&amp;amp;auto=1&amp;amp;ts=1266701290218&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also removed the period-flag (p) which was previously limiting the request to the last five days. This should provide you with all data thats available on a one second interval, but if you play around with the p-flag a little, you may be able to find more. Alternatively try to mess with the ts-flag, which would supply a start date.&lt;/p&gt;&#xA;" OwnerUserId="1976" LastActivityDate="2013-04-10T17:49:40.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7720" PostTypeId="2" ParentId="675" CreationDate="2013-04-10T18:33:37.453" Score="0" Body="&lt;p&gt;Try portfolio_metrics @&#xA;&lt;a href=&quot;https://github.com/tvaught/experimental/tree/master/portfolio_metrics&quot; rel=&quot;nofollow&quot;&gt;https://github.com/tvaught/experimental/tree/master/portfolio_metrics&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is post describing the lib&#xA;&lt;a href=&quot;http://travisvaught.blogspot.com/2011/09/modern-portfolio-theory-python.html&quot; rel=&quot;nofollow&quot;&gt;http://travisvaught.blogspot.com/2011/09/modern-portfolio-theory-python.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2273" LastActivityDate="2013-04-10T18:33:37.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7722" PostTypeId="1" CreationDate="2013-04-11T11:23:42.610" Score="2" ViewCount="365" Body="&lt;p&gt;I am working on a paper where I have to model the long run relationship between earnings and dividends. I have downloaded the raw data from shillers website. I have converted the series to log(dividend) and log(earnings), and tested for stationarity in both variables. Both are non stationary before differencing once. The result from the test of cointegration between the variables conclude that they are cointegrated. Studying the raw data (levels without log), both variables have an exponential growth, but after using log there is a linear relationship. I have run a regression with both log and levels but I do not understand which of the models that are correct when describing the long run relationship between the variables. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Log(dividend) = a + b(log(earnings)) + u --&gt; -0.44 + 0.88(log(earnings)) &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Dividend = a + bEarnings + u --&gt; 0.87 + 0.35Earnings&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;From the book I am using it is stated that i do not need to work with stationary variables when modelling the long run relationship between two cointegrated variables, and that cointegration allows me to use levels (where the variables separately are non stationary). But when both variables possess an exponential growth, am I supposed to use equation 1 or 2? And Why choose one model over the other one? Also is there a problem with omitted variable bias when modelling the long run relationship between two cointegrating variables? &lt;/p&gt;&#xA;" OwnerUserId="5111" LastActivityDate="2013-04-11T11:23:42.610" Title="Modelling long run relationship between dividend and earnings" Tags="&lt;equities&gt;&lt;modeling&gt;&lt;cointegration&gt;&lt;dividends&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7724" PostTypeId="2" ParentId="7710" CreationDate="2013-04-11T14:05:00.930" Score="2" Body="&lt;p&gt;There is of course no closed-form formula for this.  However, the community has long since worked out what all the distributional moments are. A common use is to get the equivalent lognormal (or sometimes shifted lognormal) distribution to a portfolio (such as your difference). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a &lt;a href=&quot;http://www.feweb.vu.nl/en/Images/AmericanBasketOptions_tcm97-194676.pdf&quot; rel=&quot;nofollow&quot;&gt;recent moments paper&lt;/a&gt; in which they go so far as to run a binomial tree for American basket options.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2013-04-11T14:05:00.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7725" PostTypeId="1" CreationDate="2013-04-12T09:57:25.987" Score="3" ViewCount="235" Body="&lt;p&gt;I got a gamma of -0.1321677.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error Analysis:&#xA;        Estimate  Std. Error  t value Pr(&amp;gt;|t|)    &#xA;mu      0.005979    0.007523    0.795 0.426751    &#xA;omega   0.028640    0.003130    9.149  &amp;lt; 2e-16 ***&#xA;alpha1  0.111942    0.029809    3.755 0.000173 ***&#xA;gamma1 -0.132168    0.161835   -0.817 0.414111    &#xA;beta1   0.561755    0.053081   10.583  &amp;lt; 2e-16 ***&#xA;delta   2.000000    0.189719   10.542  &amp;lt; 2e-16 ***&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can someone explain please? Is the leverage effect significant?&lt;/p&gt;&#xA;" OwnerUserId="5116" LastEditorUserId="35" LastEditDate="2013-04-12T11:13:06.177" LastActivityDate="2013-04-12T11:13:06.177" Title="What does negative gamma mean in APGARCH model?" Tags="&lt;r&gt;&lt;garch&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7726" PostTypeId="1" CreationDate="2013-04-12T10:04:29.917" Score="5" ViewCount="541" Body="&lt;p&gt;A problem I came across while practicing using Ito's Lemma had a process with an integral whose integrand depends on the upper limit of integration (the goal is to find $dZ_{t}$):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Z_{t}=\int_{0}^{t}e^{\frac{t-s}{2}}\sin(B_{s})dB_{s}$, where $B$ is a standard Brownian motion&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In what way do I need to take this into account in my solving the problem, if at all?&lt;/p&gt;&#xA;" OwnerUserId="5117" LastActivityDate="2013-04-12T14:54:37.890" Title="Ito's Lemma - Integrand depends on upper limit of integration" Tags="&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7727" PostTypeId="2" ParentId="7726" CreationDate="2013-04-12T10:14:07.667" Score="1" Body="&lt;p&gt;Note that the $$dX_t = b_t dt + \sigma_s dB_t$$ notation for a (local) semi-martingale $X = (X_t)_{t \in [ t_0, T]}$ is an abreviation for &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ X_t = X_{t_0} + \int _{t_0} ^t b_s~ ds + \int _{t_0} ^t \sigma_s ~dB_s$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $b$ and $\sigma$ can be  for example of the form  $b_s = b(\omega, s, X_s)$ and $\sigma_s = \sigma(\omega, s, X_s)$ under condition that they are progressivelly measurable prosses and that &#xA;$$\ \int _{t_0} ^T b_s ds + \int _{t_0} ^T \sigma_ s^2 ds \ &amp;lt; \infty  \quad \mathbb P - as$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, since $ Z_t = e^{\frac{t}{2}} Y_t$ where $Y_t:= \int _{0} ^t e^{\frac{-s}{2}} \sin( B_s) ~dB_s$, you have by Itô's Lemma&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ d Z_t = e^{\frac{t}{2}} ~dY_t + \frac{1}{2}e^{\frac{t}{2}} Y_t ~dt+d\langle e^{\frac{t}{2}} ,Y_t\rangle_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ d Z_t = e^{\frac{t}{2}}  e^{\frac{-t}{2}} \sin( B_t) ~dB_t + \frac{1}{2}e^{\frac{t}{2}} \int _{0} ^t e^{\frac{-s}{2}} \sin( B_s) ~dB_s$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for all $ s\in [0, +\infty)$ (note that $Z_0 =0$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note that you must verifie that $Z$ is well defined as an stochastic integral, wich is evidently true since the integrand is bounded in $[0, +\infty)$&lt;/p&gt;&#xA;" OwnerUserId="3534" LastEditorUserId="3534" LastEditDate="2013-04-12T14:54:37.890" LastActivityDate="2013-04-12T14:54:37.890" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7728" PostTypeId="1" CreationDate="2013-04-12T12:50:03.603" Score="9" ViewCount="9271" Body="&lt;p&gt;I have seen that in several papers, where the aim was to evaluate the performance of a certain investment strategy, they use t-statistics to test for significance in the results. However, this seems a bit odd to me as the t-statistics assumes that you have some theoretical mean that the observed mean deviates from, which is not being told in the article. The particular article I'm refering to is &lt;em&gt;&lt;a href=&quot;http://stat.wharton.upenn.edu/~steele/Courses/434/434Context/PairsTrading/PairsTradingGGR.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;Pairs Trading: Performance of a Relative-Value Arbitrage Rule&quot;&lt;/a&gt;&lt;/em&gt;, by Gatev et al.  There are several others that use similar tests.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my first question is what does these t-statistics tell them (or what is it that I do not understand)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, I wonder how the Newey-West standard error, as used in this manner, could be calculated in Matlab. As far as I have understood it there is no built in function to do this. After some &lt;em&gt;googleing&lt;/em&gt; I could find a code, although it seemed to have several flaws (if I understood the conversation about it) so I guess it was not usable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems like several similar questions have been asked before without success (&lt;a href=&quot;https://stats.stackexchange.com/questions/43898/newey-west-t-statistics&quot;&gt;https://stats.stackexchange.com/questions/43898/newey-west-t-statistics&lt;/a&gt;), hopefully I am a bit luckier this time!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I am not sure if I am allowed to cross-post like this, I asked this question originally on stats.stackexchange without success. But as it concerns quant trading to some level I thought I might aswell try asking it here.&lt;/p&gt;&#xA;" OwnerUserId="4709" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2015-06-06T12:45:08.547" Title="t-statistics for the mean return, using Newey-West standard errors" Tags="&lt;backtesting&gt;&lt;probability&gt;&lt;performance-evaluation&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7729" PostTypeId="1" CreationDate="2013-04-12T13:36:21.983" Score="3" ViewCount="1409" Body="&lt;p&gt;A problem of which I couldn’t find the answer on the forum is about the construction of equally-weighted and value-weighted portfolio. &#xA;I want to compute the equally-weighted property-type portfolio by expressing a company's type of segment exposure by the sum of all the net asset values and then aggregate the percentages of each property-type to get the equally weighted property-type exposure. &#xA;As for the value-weighted component, I use the company's percentage of market capitalization compared to the total market capitalization of the sample and subsequently use these percentages to correct segment exposure. So W1Eoffice + W2Eoffice … W17Eoffice and divide this sum by a value-weighted total net asset value.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this a correct way of calculating a value- and equally weighted portfolio?&lt;/p&gt;&#xA;" OwnerUserId="5119" LastEditorUserId="5119" LastEditDate="2013-04-13T22:22:53.607" LastActivityDate="2013-04-13T22:22:53.607" Title="How to correctly construct a value- and equally weighted portfolio consisting of property-types?" Tags="&lt;portfolio-management&gt;&lt;mathematics&gt;&lt;portfolio&gt;&lt;real-estate&gt;&lt;excel&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7730" PostTypeId="2" ParentId="3640" CreationDate="2013-04-12T14:55:47.420" Score="5" Body="&lt;p&gt;CUSIP and ISIN codes are issued in the US by &lt;a href=&quot;https://www.cusip.com/cusip/index.htm&quot; rel=&quot;noreferrer&quot;&gt;CUSIP Global Services&lt;/a&gt;, run by S&amp;amp;P. While the data structure follows a certain logic, there is no way to extract relevant security information from the number. You generally have to rely on a data vendor for specific data such as the maturity date for a bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of US Treasuries, however, the Treasury Direct website provides &lt;a href=&quot;http://www.treasurydirect.gov/RI/OFAuctions?form=histQuery&quot; rel=&quot;noreferrer&quot;&gt;a database&lt;/a&gt; of relevant information for every security, including maturity date and CUSIP. The database covers security issued since 1980.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note that a variety of CUSIPs can be assigned to Treasury securities before their auction date and are later transferred to a &quot;permanent&quot; CUSIP. For example, a standard bond will go to three auctions before reaching its full size. For ease of use bonds will be issued a temporary CUSIP before auction to differentiate the auctioned bonds from the rest of the issue.&lt;/p&gt;&#xA;" OwnerUserId="5120" LastActivityDate="2013-04-12T14:55:47.420" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7731" PostTypeId="1" AcceptedAnswerId="7732" CreationDate="2013-04-12T18:10:50.327" Score="4" ViewCount="1002" Body="&lt;p&gt;I've been trying to download the national interest rates for some countries. When i use Datastream, it only gives me the currency return (while i need yield).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone please tell how to download the series. I do use the correct Mnemonic ( BBJPY3M SNGTB3M ADBR090 HKEFB3M). Should i use maybe Thomson instead?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know this is kind of a nooby question, but i've been dealing with this over 2 hours now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Help is highly appreciated!&lt;/p&gt;&#xA;" OwnerUserId="5097" LastEditorUserId="5097" LastEditDate="2013-04-12T18:20:42.180" LastActivityDate="2013-04-12T19:09:12.100" Title="How to download risk free rate?" Tags="&lt;interest-rates&gt;&lt;returns&gt;&lt;sharpe-ratio&gt;&lt;yield&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7732" PostTypeId="2" ParentId="7731" CreationDate="2013-04-12T19:09:12.100" Score="0" Body="&lt;p&gt;There is no such thing as a single domestic &quot;risk-free rate&quot;. At the very least, you need an investment horizon to be able to find the corresponding risk-free rate on a domestic interest rate curve. The curve itself is typically constructed out of an interpolation of government bond yields, which may or may not be &quot;risk-free&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't have access to Datastream but Reuters codes tend to be similar across platforms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, let's say you're looking at a 2-Year risk-free rate for the US and the Euro. Mnemonics will likely follow this pattern:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[cc][tt]T=RR&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where [cc] is the 2-digit country code [US and EU respectively].&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[tt] the horizon, with M = Month and Y =  Year. e.g. 3M, 2Y.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case in question you  would be looking at pulling &quot;US2YT=RR&quot; and &quot;EU2YT=RR&quot;. You will then need to pull a mid-yield for each of these tickers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bloomberg also provides a similar function.&lt;/p&gt;&#xA;" OwnerUserId="5120" LastActivityDate="2013-04-12T19:09:12.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7733" PostTypeId="2" ParentId="7728" CreationDate="2013-04-12T20:08:03.210" Score="7" Body="&lt;p&gt;In this case, the t-statistic is used to determine if the returns are statistically different from zero (the theoretical mean). A small t-statistic would imply that the null hypothesis (no significant excess return) cannot be rejected. Newey-West standard errors are used to correct for the correlations of error terms over time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have written a Matlab function to calculate Newey-West standard errors, with the option to have the lag length determined by the Newey-West (1994) plug-in procedure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to use the code you will need to have your regression residuals matrix calculated.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function nwse = NeweyWest(e,X,L)&#xA;% PURPOSE: computes Newey-West adjusted heteroscedastic-serial&#xA;%          consistent standard errors&#xA;%---------------------------------------------------&#xA;% where: e = T x n vector of model residuals&#xA;%        X = T x k matrix of independant variables&#xA;%        L = lag length to use&#xA;%&#xA;%        se = Newey-West standard errors&#xA;%---------------------------------------------------&#xA;&#xA;indexxx = sum(isnan(X),2)==0;&#xA;X = X(indexxx,:);&#xA;e = e(indexxx,:);&#xA;&#xA;[N,k] = size(X);&#xA;k = k+1;&#xA;X = [ones(N,1),X];&#xA;&#xA;&#xA;if nargin &amp;lt; 3&#xA;% Newey-West (1994) plug-in procedure&#xA;L = floor(4*((N/100)^(2/9)));&#xA;end&#xA;&#xA;&#xA;Q = 0;&#xA;for l = 0:L&#xA;    w_l = 1-l/(L+1);&#xA;    for t = l+1:N&#xA;        if (l==0)   % This calculates the S_0 portion&#xA;            Q = Q  + e(t) ^2 * X(t, :)' * X(t,:);&#xA;        else        % This calculates the off-diagonal terms&#xA;            Q = Q + w_l * e(t) * e(t-l)* ...&#xA;                (X(t, :)' * X(t-l,:) + X(t-l, :)' * X(t,:));&#xA;        end&#xA;    end&#xA;end&#xA;Q = (1/(N-k)) .*Q;&#xA;&#xA;nwse = sqrt(diag(N.*((X'*X)\Q/(X'*X))));&#xA;&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5120" LastActivityDate="2013-04-12T20:08:03.210" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="7734" PostTypeId="1" CreationDate="2013-04-12T21:31:08.187" Score="3" ViewCount="111" Body="&lt;p&gt;Given the portfolio return $R$ and the benchmark return $B$, I want to define a risk indicator, measuring the ability to beat the benchmark ($R&amp;gt;B$), given the downside risk taken; the latter not intended as an absolute loss, but as the risk of falling below the benchmark.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This measure could be set as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{\mathbb{E}R-\mathbb{E}B}&#xA;{\int_{r\leq b}\,  (r-b)^2 f_{R,B}(r,b)\mathrm{d}r\mathrm{d}b}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $f_{R,B}$ is the joint density for $R$ and $B$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The result is Sortino-like, but the target here is not a scalar, but the return of the benchmark.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you find any conceptual or formal error in this approach? or can you suggest a better way to implement the idea? &lt;/p&gt;&#xA;" OwnerUserId="3434" LastActivityDate="2013-04-12T21:31:08.187" Title="Benchmarking risk" Tags="&lt;risk&gt;&lt;risk-models&gt;&lt;benchmark&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7738" PostTypeId="1" AcceptedAnswerId="7760" CreationDate="2013-04-15T06:19:00.940" Score="8" ViewCount="12554" Body="&lt;p&gt;I am having trouble wrapping my head around some text provided to us by our lecturer (unfortunately he is currently unavailable). If we let $c$ be the price of a European call option, $S_0$ the current price of an asset (say a stock), $X$ the strike price, $T$ the time to maturity, and $r$ the (static) interest rate. We ignore dividends.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Suppose that $$c = 3, S_0 = 20, X = 18,\\ T = 1, r = 10\%$$ Is there an arbitrage opportunity? &lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;buy the call, short the stock&lt;/li&gt;&#xA;  &lt;li&gt;proceeds: $-3+20 =17$; grows to $17e^{0.1} = 18.79 &amp;gt; 18$&lt;/li&gt;&#xA;  &lt;li&gt;yes!&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I don't understand how you can deduce the existence of an arbitrage opportunity from $18.79 &amp;gt; 18$.&lt;/p&gt;&#xA;" OwnerUserId="5131" LastEditorUserId="1355" LastEditDate="2013-04-15T11:40:56.300" LastActivityDate="2017-02-27T23:45:36.917" Title="Call option arbitrage opportunity" Tags="&lt;options&gt;&lt;arbitrage&gt;&lt;option-strategies&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7739" PostTypeId="1" CreationDate="2013-04-15T07:34:02.337" Score="2" ViewCount="933" Body="&lt;p&gt;I am considering a product composed of 10 underlying assets. The maturity is 5 year. Each year if the performance of the equi-weighted portfolio reach a barrier, it pays a coupon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question concern the computation of the greeks. For example, is it true to compute delta as&#xA;the sum of the delta of each underlying assets ? Same question for the gamma, vega, rho and theta.&lt;/p&gt;&#xA;" OwnerUserId="3553" LastActivityDate="2013-04-15T09:49:53.770" Title="Greeks of Basket" Tags="&lt;monte-carlo&gt;&lt;greeks&gt;&lt;basket&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7741" PostTypeId="2" ParentId="7739" CreationDate="2013-04-15T09:49:53.770" Score="2" Body="&lt;p&gt;Freddy has already answered it and my answer had an assumption in it so clarifying -&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If payoff of basket with underlined securities A,B and C are &#xA;$$&#xA;P_b = C_1*P_A + C_2*P_B + C_3*P_C&#xA;$$&#xA;Where &#xA;$$C_1 , C_2  ,C_3 $$ are contants then portfolio delta is  $$ \delta_b = C_1*\delta_a+C_2*\delta_b+C_3*\delta_c $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short as Freddy Said , and I assumed if the potfolio payoff is merely a sum of all underlined then yes the delta will be sum of deltas of underlined. If not and then you have to apply differentiation on the payoff fuction of basket&lt;/p&gt;&#xA;" OwnerUserId="1386" LastActivityDate="2013-04-15T09:49:53.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7743" PostTypeId="1" AcceptedAnswerId="7749" CreationDate="2013-04-15T17:24:32.063" Score="6" ViewCount="1730" Body="&lt;p&gt;Besides obvious extreme examples (ie volatility going to infinity, infinite time, zero time, or zero volatility, deep OTM/ITM  ) how does one gauge if an option is 'correct' or at least in the ballpark when priced with an option pricing formula? Unlike physics, results in quant. finance seem to have more of a subjective nature to them. Are quoted options prices the benckmark of accuracy, so option pricing should strive to match them?&lt;/p&gt;&#xA;" OwnerUserId="5133" LastEditorUserId="5133" LastEditDate="2013-04-15T17:29:42.460" LastActivityDate="2013-04-16T02:03:51.487" Title="How do you know if if an option is priced correctly?" Tags="&lt;option-pricing&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7744" PostTypeId="2" ParentId="7743" CreationDate="2013-04-15T19:48:30.143" Score="2" Body="&lt;p&gt;The most important road markings are given by the fact that the price has to be arbitrage-free.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A good introduction to the concept is given in this article by Schachermayer:&lt;br&gt;&#xA;&lt;a href=&quot;http://www.mat.univie.ac.at/~schachermayer/pubs/preprnts/prpr0118a.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.mat.univie.ac.at/~schachermayer/pubs/preprnts/prpr0118a.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another helpful concept in this context is put-call parity, which has to hold for combinations of prices:&lt;br&gt;&#xA;&lt;a href=&quot;http://en.wikipedia.org/wiki/Put%E2%80%93call_parity&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Put%E2%80%93call_parity&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2013-04-15T19:48:30.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7747" PostTypeId="1" CreationDate="2013-04-16T01:27:40.997" Score="4" ViewCount="508" Body="&lt;p&gt;In Meucci's paper called &quot;Managing Diversification&quot; he mentions that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Indeed, the eigenvalues A correspond to the variances of these uncorrelated portfolios&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to replicate it but found they differ. Any thoughts?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; round(prin.port.risk,8) &#xA;[1] 0.00017323 0.00013995 0.00030159 0.00007239&#xA;&amp;gt; round(eval,8)&#xA;[1] 0.00053912 0.00010127 0.00003948 0.00000730&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Full R Code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;rm(list=ls())&#xA;require(RCurl)    &#xA;sit = getURLContent('https://github.com/systematicinvestor/SIT/raw/master/sit.gz',     binary=TRUE, followlocation = TRUE, ssl.verifypeer = FALSE)&#xA;con = gzcon(rawConnection(sit, 'rb'))&#xA;source(con)&#xA;close(con)&#xA;load.packages('quantmod,lattice')&#xA;&#xA;#######################################################&#xA;#Get and Prep Data&#xA;#######################################################&#xA;data &amp;lt;- new.env()&#xA;&#xA;tickers&amp;lt;-spl(&quot;VBMFX,VTSMX,VGTSX,VGSIX&quot;)&#xA;  getSymbols(tickers, src = 'yahoo', from = '1980-01-01', env = data, auto.assign = T)&#xA;  for(i in ls(data)) data[[i]] = adjustOHLC(data[[i]], use.Adjusted=T)&#xA;&#xA;bt.prep(data, align='remove.na', dates='1990::2013')&#xA;&#xA;#################&#xA;&#xA;prices&amp;lt;-data$prices&#xA;ret&amp;lt;-prices / mlag(prices) - 1&#xA;ret[1,]&amp;lt;-0&#xA;demean = scale(coredata(ret), center=TRUE, scale=FALSE)&#xA;&#xA;#eigen decomposition of return (using &quot;princomp&quot;)&#xA;pca&amp;lt;-princomp(ret,cor=F)&#xA;loadings&amp;lt;-pca$loadings[] #eigen vectors&#xA;    eval&amp;lt;-eigen(cov(demean))$values  #eigen values that supposedly represent risk of principal portfolios&#xA;&#xA;prin.port.ret&amp;lt;-ret %*% loadings #principal port ret&#xA;&#xA;#These two differ??!?!?!?!?&#xA;prin.port.risk&amp;lt;-(apply(prin.port.ret,2,var))&#xA;(eval)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2318" LastEditorUserId="2318" LastEditDate="2013-04-16T03:47:12.463" LastActivityDate="2013-04-16T03:47:12.463" Title="PCA Variances and Principal Portfolio Variances" Tags="&lt;pca&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7749" PostTypeId="2" ParentId="7743" CreationDate="2013-04-16T02:03:51.487" Score="7" Body="&lt;p&gt;While the translation between implied volatility (iVol) and options prices is of a strictly mathematical nature (when you feed 10 market makers with the same iVol you most likely get 10 identical or close to identical option prices in vanilla structures). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is on the other side more of an art than science is how to assess whether iVols/prices trade fairly, whether an option is fairly valued or whether implied volatility fairly represents the future underlying expected price variations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it comes down to what you believe about market dynamics. If you make the assumption that quoted options prices ARE the market and hence represent fair value then you take it from there and generate your vol surface and price other non-quoted structures. If you have your own model that derives prices and volatility measures that divert from your model prices then you obviously believe that the prices and volatility measures of your model have some sort of validity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence the topic of calibration is a touchy one: When do you calibrate and at what point can you be reasonably certain that the data points you take into consideration for calibration represent fair value. Obviously you do not want to calibrate gold option vol surface right when the market pushed down gold prices and its futures by almost 10% intraday; admittedly a very rare move (though we just witnessed it last night) and hence nobody in their right mind would calibrate a volatility surface at a time when the market is showing very abnormal dynamics. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, take it for what its worth, as much as the academic world likes to make options pricing and valuation a hard science, having traded volatility for many years I can tell you that I do find a number very unscientific aspects in pricing options accurately in order to make a long-term living out of this endeavor. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-04-16T02:03:51.487" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7750" PostTypeId="1" CreationDate="2013-04-16T10:11:21.657" Score="8" ViewCount="4876" Body="&lt;p&gt;I often have to generate cashflow diagrams.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering if anyone has a good tool to generate them in either $\LaTeX$ or a picture?&lt;/p&gt;&#xA;" OwnerUserId="2908" LastEditorUserId="16595" LastEditDate="2018-10-01T08:44:43.797" LastActivityDate="2020-02-12T19:27:47.117" Title="Best tool to generate cashflow diagrams" Tags="&lt;application&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7752" PostTypeId="2" ParentId="7750" CreationDate="2013-04-16T11:43:40.120" Score="3" Body="&lt;p&gt;I found a nice example on &lt;a href=&quot;http://www.latex-community.org/forum/viewtopic.php?f=19&amp;amp;t=12059&quot; rel=&quot;nofollow&quot;&gt;this page&lt;/a&gt; using the pgf/tikZ package for $\LaTeX$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The website is giving the code for $\LaTeX$, if you are using LyX, in order to get the same sample than the website you have to do the following. First edit the document preamble using Document-&gt;Settings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; \usepackage{siunitx}&#xA; \usepackage{tikz}&#xA; \usetikzlibrary{calc,matrix}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then the following in a code block:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; \begin{tikzpicture}[&amp;gt;=stealth,ultra thick]&#xA;    \draw[-&amp;gt;] (0,0) -- (10,0);&#xA;    \draw (-1,0) node[below] {n} (-1,0.5) node[above] {PMT};&#xA;    \foreach \x/\n in {1/0,3/1,5/2,7/3,9/4}&#xA;      \draw (\x,0) node(\n)[below] {\n} -- (\x,0.5);&#xA;    \foreach \x/\n in {1/0,3/1,5/2,7/3}&#xA;      \draw (\x,0.5) node[above] {\num{5000}};&#xA;    \matrix (calc) [matrix of math nodes,matrix anchor=north west,nodes={anchor=east}] at (9,-1) {%&#xA;      \$ \num{5300.00} &amp;amp; = &amp;amp; \num{5000}\times (\num{1.06})^1 \\&#xA;      \$ \num{5618.00} &amp;amp; = &amp;amp; \num{5000}\times (\num{1.06})^2 \\&#xA;      \$ \num{5955.08} &amp;amp; = &amp;amp; \num{5000}\times (\num{1.06})^3 \\&#xA;      \$ \num{6312.38} &amp;amp; = &amp;amp; \num{5000}\times (\num{1.06})^4 \\&#xA;      \$ \num{23185.46} \\&#xA;    };&#xA;    \draw[thick] (calc-5-1.north west) -- (calc-5-1.north east);&#xA;    \foreach \n/\l in {0/4,1/3,2/2,3/1}&#xA;      \draw[-&amp;gt;,gray!50] (\n) |- ($(calc-\l-1.west)+(-0.5,0)$);&#xA;  \end{tikzpicture}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2908" LastEditorUserId="2908" LastEditDate="2013-04-16T12:52:01.587" LastActivityDate="2013-04-16T12:52:01.587" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7753" PostTypeId="1" AcceptedAnswerId="7754" CreationDate="2013-04-16T12:23:31.000" Score="2" ViewCount="142" Body="&lt;p&gt;I looked at the CBOE website and they say the expiration is the Saturday following the third Friday of each month.  However, I look up an options chain for Google, for example, and I see three expiration dates for May: May 3, 2013, May 10, 2013, May 18, 2013.&lt;/p&gt;&#xA;" OwnerUserId="5142" LastActivityDate="2013-04-16T13:05:42.970" Title="How are option expiration dates decided?" Tags="&lt;american-options&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7754" PostTypeId="2" ParentId="7753" CreationDate="2013-04-16T13:05:42.970" Score="5" Body="&lt;p&gt;Standard Options on CBOE expire on the Saturday following the third Friday of a &lt;a href=&quot;http://en.wikipedia.org/wiki/Expiration_%28options%29&quot;&gt;month&lt;/a&gt;. Additionally to that there exist &lt;a href=&quot;http://www.investopedia.com/articles/optioninvestor/11/intro-weekly-options.asp&quot;&gt;weekly options&lt;/a&gt;. That's why you see these two series of options.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2013-04-16T13:05:42.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7755" PostTypeId="1" CreationDate="2013-04-16T14:09:41.647" Score="3" ViewCount="733" Body="&lt;p&gt;I am trying to prove that a long-short strategy invested according to the cointegrated relationship from Engle-Granger's. So essentially I'm trying to show that the return $r_{XY}$ of the portfolio (X long Y short) has zero $\beta$ (in other words it is market neutral in CAPM sense). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;CAPM says that $r_Y = r_m\beta_Y + \alpha_Y$, $r_X = r_m\beta_X + \alpha_X$, hence $$r_{XY}=r_X - br_Y = \beta_Xr_m + \alpha_X - b\beta_Yr_m - b\alpha_Y = r_m(\beta_X-b\beta_Y) + \alpha_X - b\alpha_Y$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to be market neutral we need that $\beta_X-b\beta_Y=0$ but I'm struggeling a bit to prove this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $\beta$ is defined as $$\beta = \frac{Cov(r_p,r_m)}{Var(r_m)}$$ I firstly need to find $r_X$ and $r_Y$ to find the $\beta$'s.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is were I get stuck. I have been trying to use that, assuming the stocks continues to be cointegrated, we need that $X_t(1+r_X) = bY_t(1+r_Y) + \mu + \epsilon_t$ $(\star)$. Then solve for $r_X$ or $r_Y$ and plug it into our equations, but it doesn't really work. For $\beta_X-b\beta_Y$ to be $0$ we need that $r_X = br_Y+constant$, but this doesn't work with $(\star)$$$$$Is it possible to do it like this, or is there some other way to prove that it is market neutral in CAPM sense? Or maybe it isn't market neutral according to CAPM?&lt;/p&gt;&#xA;" OwnerUserId="4709" LastActivityDate="2013-04-16T22:20:50.547" Title="Using cointegration to prove that a long-short strategy is market neutral (in CAPM sense)" Tags="&lt;cointegration&gt;&lt;capm&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7756" PostTypeId="1" CreationDate="2013-04-16T14:25:32.450" Score="6" ViewCount="464" Body="&lt;p&gt;Going one level beyond stressed scenarios, to parameters e.g. for a VaR measure: what are the most common approaches for stressing a covariance/correlation matrix, especially taking portfolio exposure into account (so reverse testing iirc)? How many traders want e.g. to play with eigenvectors as opposed to just a concentration plus a global variance parameters? Is it common to leave full freedom of fudging the matrix subject to a later PSD correction? I'm interested in both current practice and what the leading software risk tools are offering, less in the plethora of possibilities investigated in academia.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stats.stackexchange.com/questions/2572/correlation-stress-testing&quot;&gt;Here's&lt;/a&gt; a related question with little response. &lt;/p&gt;&#xA;" OwnerUserId="3015" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2013-07-06T17:42:29.507" Title="Stress testing covariance" Tags="&lt;correlation&gt;&lt;covariance&gt;&lt;correlation-matrix&gt;&lt;stress-testing&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7757" PostTypeId="2" ParentId="7755" CreationDate="2013-04-16T22:20:50.547" Score="1" Body="&lt;p&gt;you get what should get. You can't prove that strategy long $X$ short $Y$ is market neutral: is strategy long EUR/USD short USD/CHF risk neutral? I wouldn't say that. It depends, on what? On relationship between these variables, so it is perfectly hedged only if &lt;code&gt;dX=dY&lt;/code&gt; so your task is bad stated: it should be rather: what should be &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$b$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to assure that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_{XY}=r_X - br_Y=0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and answer is  $b = \frac{Cov(r_X,r_Y)}{Var(r_X)}$ so regression coefficient, under assumption that errors are normally distributed, of course they might be not and then not linear combination is optimal but some else, nonlinear, it has just assure that if X moves dX then Y moves by dY so you just need to know what position to take. Since you want to determine constant $b$ size in asset then if they don't create linear combination you can't find linear market neutral combination and forget about CAPM and your $\beta$&lt;/p&gt;&#xA;" OwnerUserId="2017" LastActivityDate="2013-04-16T22:20:50.547" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="7758" PostTypeId="2" ParentId="7750" CreationDate="2013-04-16T22:33:52.180" Score="2" Body="&lt;p&gt;Aside from TikZ approach that you've found, these scripting languages would work:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;MetaPost&lt;/li&gt;&#xA;&lt;li&gt;PSTricks&lt;/li&gt;&#xA;&lt;li&gt;Asymptote&lt;/li&gt;&#xA;&lt;li&gt;MATLAB, see &lt;code&gt;cfplot&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Mathematica, see &lt;code&gt;Cashflow&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Vector graphics are most suitable for the task, so if you prefer GUI point-and-click:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Adobe Illustrator&lt;/li&gt;&#xA;&lt;li&gt;CorelDRAW&lt;/li&gt;&#xA;&lt;li&gt;Inkscape (free)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2013-04-16T22:33:52.180" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7759" PostTypeId="2" ParentId="2202" CreationDate="2013-04-17T00:01:28.407" Score="2" Body="&lt;p&gt;Is it possible to replicate the option of a custom index? Yes and you can find OTC market-makers who will make a price. They use portfolio replication to mimic the payoff of the option with a position in the underlying (Black-Scholes, '73). Even though the underlying custom index is not traded it can be perfectly constructed via its traded constituents. So once you sell the option to your customer, you reconstruct the payoff of a long option by dynamically adjusting a position in the underlying. The underlying position is kept delta matched to the option. Delta matched positions are PL neutral over small changes, eg if the custom index changes price by 1USD, an at-the-money call option with a face value of 1,000,000USD will see about equivalent changes in value as a custom index holding of around 500,000USD (excuse the hand-waving).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here the delta is based on your multivariate price model of the underlying basket. You know the volatilities of the single stocks from the options market. You have to input a correlation matrix, which is the hard part. The upper limit of this correlation matrix is where all the stocks move together, which of course will result in a high price for the option. However the price history of the stocks will generally show some negative correlation, which is what you see under normal conditions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem with baskets it that this negative-correlation-under-normal-conditions makes them seem far less volatile than single assets, leading to people holding massive positions in baskets and their derivatives. However when extreme events occur, correlation can approach 1 and at the same time constituent volatility spikes. Extreme events though are rare (!), so people usually do not have the historic data to be prepared for extreme movements in baskets. In fact the underestimation of basket price volatility is the source of some spectacular financial failures. Nick Leeson bankrupted Barings Bank by selling massive options on Japanese stock indices, the positions blew up when an earthquake toppled Asian markets. The Global Financial Crisis was principally caused by the belief that baskets of credit risks were less risky than they were.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So make the positions small, and know that you are unlikely to have enough price history to confidently predict future outcomes, so account for that in your price.    &lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW not sure where the idea that transaction costs prohibit dynamic replication strategies. The options markets of the 80's, 90's boomed because of dynamic hedging, and today automated trading has only reduced transaction costs further. &lt;/p&gt;&#xA;" OwnerUserId="2251" LastEditorUserId="2251" LastEditDate="2013-04-19T17:48:00.430" LastActivityDate="2013-04-19T17:48:00.430" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7760" PostTypeId="2" ParentId="7738" CreationDate="2013-04-17T00:45:34.923" Score="9" Body="&lt;p&gt;The option is a contract that gives you the right to buy the stock in one year for 18. Today people are trading the stock for 20, so you can &lt;em&gt;sell the stock short&lt;/em&gt; for 20 today, meaning, someone gives you 20 cash today in return for a stock IOU, where you are obligated to deliver the stock to them on a later date. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you get 20 cash upfront but you need to spend 3 of it to buy the option. After one year this net 17 reinvested becomes 18.79. This is more cash than you need to buy back the stock using your option if the price ends up &gt; 18. So, worst case scenario is the stock ends the year &gt; 18, you exercise the option and buy the stock for 18 from the option seller, and you net 18.79-18.0=.79 cash. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course the stock could end the year below 18, and then you wouldn't use the option to buy back the stock, you would just buy the stock at whatever price it trades in the market. So either you make .79 or you make more. Arbitrage.&lt;/p&gt;&#xA;" OwnerUserId="2251" LastEditorUserId="2251" LastEditDate="2017-02-27T23:45:36.917" LastActivityDate="2017-02-27T23:45:36.917" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7761" PostTypeId="1" AcceptedAnswerId="7763" CreationDate="2013-04-17T02:13:41.787" Score="46" ViewCount="98708" Body="&lt;p&gt;We all know if you back out of the Black Scholes option pricing model you can derive what the option is &quot;implying&quot; about the underlyings future expected volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a simple, closed form, formula deriving Implied Volatility (IV)? If so can you could you direct me to the equation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or is IV only numerically solved?&lt;/p&gt;&#xA;" OwnerUserId="4729" LastEditorUserId="4729" LastEditDate="2019-08-23T01:31:36.100" LastActivityDate="2020-06-22T14:47:06.910" Title="A simple formula for calculating implied volatility?" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;implied-volatility&gt;" AnswerCount="6" CommentCount="4" FavoriteCount="36" ContentLicense="CC BY-SA 4.0" />
  <row Id="7762" PostTypeId="2" ParentId="7761" CreationDate="2013-04-17T03:16:25.697" Score="18" Body="&lt;p&gt;It is a very simple procedure and yes, Newton-Raphson is used because it converges sufficiently quickly:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You need to obviously supply an option pricing model such as BS. &lt;/li&gt;&#xA;&lt;li&gt;Plug in an initial guess for implied volatility -&gt; calculate the the option price as a function of your initial iVol guess -&gt; apply NR -&gt; minimize the error term until it is sufficiently small to your liking.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;the following contains a very simple example of how you derive the implied vol from an option price: &lt;a href=&quot;http://risklearn.com/estimating-implied-volatility-with-the-newton-raphson-method/&quot;&gt;http://risklearn.com/estimating-implied-volatility-with-the-newton-raphson-method/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can also derive implied volatility through a &quot;rational approximation&quot; approach (closed form approach -&gt; faster), which can be used exclusively if you are fine with the approximation error or as a hybrid in combination with a few iterations of NR (better initial guess -&gt; less iterations). Here a reference: &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=952727&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=952727&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="254" LastEditDate="2013-04-17T13:33:35.767" LastActivityDate="2013-04-17T13:33:35.767" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7763" PostTypeId="2" ParentId="7761" CreationDate="2013-04-17T03:28:21.173" Score="30" Body="&lt;p&gt;&lt;a href=&quot;http://www.cfapubs.org/doi/abs/10.2469/faj.v44.n5.80&quot; rel=&quot;noreferrer&quot;&gt;Brenner and Subrahmanyam (1988)&lt;/a&gt; provided a closed form estimate of IV, you can use it as the initial estimate:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;   \sigma \approx \sqrt{\cfrac{2\pi}{T}} . \cfrac{C}{S}&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="5146" LastEditorUserId="28193" LastEditDate="2017-06-02T08:03:01.970" LastActivityDate="2017-06-02T08:03:01.970" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7764" PostTypeId="1" AcceptedAnswerId="7782" CreationDate="2013-04-17T10:56:04.637" Score="3" ViewCount="235" Body="&lt;p&gt;Suppose company A has CIK 0000012345 and ceases to exist. At some later time, company B registers with the SEC to submit filings. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible that company B will be assigned the same CIK 0000012345? In other words, are CIKs unique for all time or are CIKs unique at any instant of time?&lt;/p&gt;&#xA;" OwnerUserId="5147" LastActivityDate="2013-04-19T17:03:44.883" Title="Can Central Index Keys (CIKs) issued by the SEC be reassigned?" Tags="&lt;equities&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7765" PostTypeId="2" ParentId="7761" CreationDate="2013-04-17T14:21:52.073" Score="43" Body="&lt;p&gt;The Black-Scholes option pricing model provides a closed-form pricing formula &lt;span class=&quot;math-container&quot;&gt;$BS(\sigma)$&lt;/span&gt; for a European-exercise option with price &lt;span class=&quot;math-container&quot;&gt;$P$&lt;/span&gt;.   There is no closed-form inverse for it, but because it has a closed-form vega (volatility derivative) &lt;span class=&quot;math-container&quot;&gt;$\nu(\sigma)$&lt;/span&gt;, and the derivative is nonnegative, we can use the Newton-Raphson formula with confidence.&lt;/p&gt;&#xA;&lt;p&gt;Essentially, we choose a starting value &lt;span class=&quot;math-container&quot;&gt;$\sigma_0$&lt;/span&gt; say from yoonkwon's post.  Then, we iterate&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;\sigma_{n+1} = \sigma_n - \frac{BS(\sigma_n)-P}{\nu(\sigma_n)}&#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;until we have reached a solution of sufficient accuracy.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;This only works for options where the Black-Scholes model has a closed-form solution and a nice vega&lt;/strong&gt;.  When it does not, as for exotic payoffs, American-exercise options and so on, we need a more stable technique that does not depend on vega.&lt;/p&gt;&#xA;&lt;p&gt;In these harder cases, it is typical to apply a secant method with bisective bounds checking.  A favored algorithm is &lt;a href=&quot;http://en.wikipedia.org/wiki/Brent%27s_method&quot; rel=&quot;noreferrer&quot;&gt;Brent's method&lt;/a&gt; since it is &lt;a href=&quot;http://www.numerical.recipes/&quot; rel=&quot;noreferrer&quot;&gt;commonly available&lt;/a&gt; and quite fast.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2020-06-22T13:20:11.447" LastActivityDate="2020-06-22T13:20:11.447" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="7766" PostTypeId="1" CreationDate="2013-04-17T17:19:55.410" Score="11" ViewCount="2449" Body="&lt;p&gt;My firm is investigating FX EMS systems to see if we can reduce execution costs for our trading strategies that involve FX (not low latency).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The liquidity providers are a few major banks. We're interested in the potential to include more banks and ECNs if we find there are advantages to this through being able to aggregate many venues efficiently.&lt;/p&gt;&#xA;" OwnerUserId="5148" LastEditorUserId="5148" LastEditDate="2013-08-22T21:01:01.747" LastActivityDate="2013-08-22T21:01:01.747" Title="how do you evaluate an FX market EMS?" Tags="&lt;automated-trading&gt;&lt;fx&gt;&lt;transaction-costs&gt;" AnswerCount="3" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7767" PostTypeId="1" AcceptedAnswerId="7798" CreationDate="2013-04-18T03:01:24.713" Score="9" ViewCount="5046" Body="&lt;p&gt;I'm working on an implementation in R of Longstaff &amp;amp; Schwartz method from the &lt;a href=&quot;http://www.math.ethz.ch/~hjfurrer/teaching/LongstaffSchwartzAmericanOptionsLeastSquareMonteCarlo.pdf&quot;&gt;this&lt;/a&gt; 2001 article.  I've managed to build code that replicates their prices in table 1 (p. 127), but only for the ones with volatility .2.  For the .4 ones, my code estimates prices below theirs.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, first I would like to ask what precisely the dependent variable in each of the LSM steps is?  LS state: 'regress the discounted values of $C(\omega, s; t_{K-1}, T)$ on...' where the  $C$ notation indicates 'path of cashflows'.  I've taken this to mean that, at each step the dependent variable along each path is the exercise value of the option (either terminal or early if a pervious step has indicated early exercise) discounted to the current period.  Is this accurate?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, does anyone know of a publicly available implementation of LSM for American options that I could check my work against?&lt;/p&gt;&#xA;" OwnerUserId="1354" LastActivityDate="2013-04-22T22:01:25.020" Title="Longstaff-Schwartz (Least Squares Monte Carlo) applied to American Options" Tags="&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;american-options&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7768" PostTypeId="1" AcceptedAnswerId="7780" CreationDate="2013-04-18T05:52:55.007" Score="18" ViewCount="1812" Body="&lt;p&gt;A friend and I are starting from scratch&amp;mdash;neither of us have backgrounds in finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently when we have a question, &lt;em&gt;e.g. What variations on the Slow Stochastic Oscillator have been explored, and how have their backtesting results compared?&lt;/em&gt;, we rely on Google and Google Scholar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But we want to put together a list of sources more targeted toward quantitative finance research so we feel more consistent about the information we comb through. Not just arbitrarily reading 10, 20, or 100 pages of search results depending on our level of interest and attention that day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I looked around Q.SE and found some repeated references to &lt;a href=&quot;http://www.ssrn.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;SSRN (Social Science Research Network)&lt;/a&gt;, but many more links to papers seem to lead to specific universities and domains. We no longer have academic affiliations to grant us access to digital libraries like JSTOR, but we'd consider paying subscription fees if worth it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there aren't any centralized resources, we'd still appreciate hearing from those involved in research: &lt;strong&gt;How do you go about conducting your research then? Do you have a &quot;go to&quot; list of websites or search terms that you find useful?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="5149" LastEditorUserId="5149" LastEditDate="2019-04-04T06:37:58.603" LastActivityDate="2019-04-04T10:34:12.927" Title="Resources for finding scholarly research on topics in quantitative finance?" Tags="&lt;research&gt;&lt;resource&gt;" AnswerCount="5" CommentCount="6" FavoriteCount="10" ContentLicense="CC BY-SA 4.0" />
  <row Id="7769" PostTypeId="2" ParentId="7698" CreationDate="2013-04-18T07:26:27.737" Score="1" Body="&lt;p&gt;Note that&#xA;\begin{align} p(t,x) &amp;amp;:= \mathbb E^{\mathbb Q} \left [ S_1 (S_T/ S_1-\kappa)^+ | S_t=x \right]  \\&amp;amp;= x \mathbb E^{\mathbb Q} \left [ (S_T/x-\kappa )^+ | X_t=x \right]    \end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for all $t&amp;lt;1$ and  $x \in (0, +\infty)$, since $S$  is a $\mathbb Q$ -martingale. Now, if we include the aditional condition on $\sigma$ that $\sigma_t := \tilde\sigma(S_t) ~S_t$, we can conclude that&#xA;\begin{align} p(t,x) &amp;amp;= x F(1,\kappa, \int_1^T \tilde\sigma(S_s)^2 ds),  \end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $F$ is defined as in the question BUT under $\mathbb Q$ and not under $\mathbb P$ as  it says. &lt;/p&gt;&#xA;" OwnerUserId="3534" LastActivityDate="2013-04-18T07:26:27.737" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7770" PostTypeId="2" ParentId="7768" CreationDate="2013-04-18T09:52:48.203" Score="2" Body="&lt;p&gt;My only source is google... The best advice I can give you is to add the search term: &quot;filetype:pdf&quot;. You will end up with some papers, quality is not garanteed.&#xA;Crosscheck the sources and you will find the name of an expert on the topic you are looking for. He/she will probably have a personnal website on his/her university with quality papers or the habits to post on SSRN or others website (Arxiv for exemple).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And of course Q.SE is a very good source.&lt;/p&gt;&#xA;" OwnerUserId="5052" LastEditorUserId="5052" LastEditDate="2013-04-18T09:58:28.167" LastActivityDate="2013-04-18T09:58:28.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7771" PostTypeId="2" ParentId="7768" CreationDate="2013-04-18T09:58:01.403" Score="15" Body="&lt;p&gt;ArXiv is the standard resource of preprints in the field of physics. Almost all papers in physics are uploaded here before they are submitted to a journal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They also have a quantitative finance part:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://arxiv.org/archive/q-fin&quot;&gt;http://arxiv.org/archive/q-fin&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This section is not nearly as active as the physics-part of ArXiv though. Hopefully this will change in the future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is also this RSS feed:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://dailyssrn.com/&quot;&gt;http://dailyssrn.com/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although this is more oriented towards economics. &lt;/p&gt;&#xA;" OwnerUserId="3371" LastEditorUserId="3371" LastEditDate="2013-04-18T13:21:27.620" LastActivityDate="2013-04-18T13:21:27.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7773" PostTypeId="2" ParentId="7768" CreationDate="2013-04-18T19:13:08.733" Score="4" Body="&lt;p&gt;SSRN (Social Science Research Network) hosts a vast amount of papers, and the financial research section has, while not specialized in quant finance, a lot of interesting stuff to offer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the link: &lt;a href=&quot;http://papers.ssrn.com/sol3/JELJOUR_Results.cfm?form_name=journalbrowse&amp;amp;journal_id=2060735&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/JELJOUR_Results.cfm?form_name=journalbrowse&amp;amp;journal_id=2060735&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The major difference between ArXiv and SSRN is that ArXiv ist - in my experience - mostly known to physicists, while SSRN is well recognized among economists. Accordingly, on SSRN you will also find much non-quantitative research, but I wouldn't consider that a huge problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A bit annoying is that some MBA students seem to consider their papers quantitative research and upload it there (misleadingly tagged), and to my knowledge there's no process of quality assurance working, so sometimes you end up with a bunch of crap. Rarely, though.&lt;/p&gt;&#xA;" OwnerUserId="1976" LastActivityDate="2013-04-18T19:13:08.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7774" PostTypeId="1" AcceptedAnswerId="7776" CreationDate="2013-04-18T19:17:39.130" Score="2" ViewCount="34542" Body="&lt;p&gt;You are given the following information regarding the domestic government fixed-interest bond market:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The current price of a &lt;strong&gt;one-year bond&lt;/strong&gt; paying coupons at a rate of $4.5$% per annum and redeemed at par is £100.41 per £100 nominal&lt;/li&gt;&#xA;&lt;li&gt;The current price of a &lt;strong&gt;two-year bond&lt;/strong&gt; paying coupons at a rate of $6.5$% per annum and redeemed at par is £100.48 per £100 nominal&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Calculate the two-year spot rate of interest, $y_2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure how to start this question. Do we have to work out the first and second year forward rates? &lt;/p&gt;&#xA;" OwnerUserId="5153" LastActivityDate="2013-04-18T22:28:52.110" Title="Calculating spot rate of interest" Tags="&lt;spot-rate&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7775" PostTypeId="2" ParentId="7766" CreationDate="2013-04-18T21:02:45.487" Score="4" Body="&lt;p&gt;Trading through an ECN is a good idea, FXALL is probably a bad choice since they have such a small market share. Currenex and Hotspot are both better. EBS (in EUR, JPY, and CHF) and Reuters (in GBP, AUD, CAD) have the largest market shares, but they both are expensive to set up and require monthly fees regardless of how much you trade, their liquidity in pairs where they are not the primary exchange is poor, and their technology is atrocious. Currenex would be the top choice for good liquidity in all pairs (about 10% of overall volume, compared to 5% for hotspot, and 1% for FXALL), execution algos available through their API, and general quality of their technology.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It sounds like you may be best suited to using an aggregator, I would not consider Reuters or Integral and I am not familiar with Apama or Portware. I am familiar with MarketFactory and Flextrade. Flextrade is mature technology and will get the job done. It's a simple FIX api to send orders, and you can write your own algos or use some off the shelf. MarketFactory is newer and from what I know about it it's the best off the shelf aggregator, but I have only seen their marketing material, I've never used the product. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;@pedro Banks will only give you tight spreads if they are making a lot of money off you, so it's kind of a mixed blessing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;@assylias Fees are under $5/MM which is less than .1 pips. The aggregate spread on an ECN is going to be tighter than from any single counterparty 90%+ of the time. &lt;/p&gt;&#xA;" OwnerUserId="5154" LastActivityDate="2013-04-18T21:02:45.487" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7776" PostTypeId="2" ParentId="7774" CreationDate="2013-04-18T22:21:47.247" Score="0" Body="&lt;p&gt;Solving for annual interest rates:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The one year annual spot rate r1:&#xA;$$ &#xA;   1.045/(1+r1)=1.0041 =&amp;gt; r1 \approx 4.0733\%&#xA;$$&#xA;The one-two year forward rate r1,2: &#xA;$$&#xA;.065/(1+r1)+1.065/(1+r1)(1+r1,2)=1.0048 =&amp;gt; r1,2 \approx 8.5927\%&#xA;$$&#xA;The two year spot rate r2=&#xA;$$&#xA;(1+r2)^{2}=(1+r1)(1+r1,2) =&amp;gt; r2 \approx 6.3090\%&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="5155" LastEditorUserId="5155" LastEditDate="2013-04-18T22:28:52.110" LastActivityDate="2013-04-18T22:28:52.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7777" PostTypeId="1" CreationDate="2013-04-19T12:24:20.797" Score="2" ViewCount="506" Body="&lt;p&gt;I recently retrieved a large amount of European option data, for call and put prices, from OptionMetrics. Doing so for the same time period I get a file consisting of&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;62558&lt;/em&gt; rows of &lt;strong&gt;call&lt;/strong&gt; prices &amp;amp; &lt;em&gt;62557&lt;/em&gt; rows of &lt;strong&gt;put&lt;/strong&gt; prices&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, both files contain on each row some characteristics such as&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The option ID&lt;/li&gt;&#xA;&lt;li&gt;The date of the price&lt;/li&gt;&#xA;&lt;li&gt;The expiration data of the option&lt;/li&gt;&#xA;&lt;li&gt;Bid/Ask price&lt;/li&gt;&#xA;&lt;li&gt;Strike price&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As the option ID's do not match between the call and put options, I am wondering what the best way is to synchronize these data sets? This is needed for instance to calculate the pull-call parity; in that case I need for every call price a corresponding put price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My suggestion is to look at the strike price, date of option and expiration date and when those match to treat the put and call option as similar, i.e. they belong together. I tried this and immediately noticed that in some cases the corresponding strike price is different for the one or other, even when the dates and expiration dates match.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;What are other ways to match the put and call data?&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;As the number of rows didn't match, some call options will not have a corresponding put price or vica versa, why is this?&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2291" LastActivityDate="2019-08-12T12:37:43.497" Title="How to synchronize put and call option-data?" Tags="&lt;options&gt;&lt;time-series&gt;&lt;data&gt;&lt;optionmetrics&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7778" PostTypeId="2" ParentId="7766" CreationDate="2013-04-19T13:10:45.260" Score="0" Body="&lt;p&gt;Just my two cents but &lt;strong&gt;both HotspotFX and Interactive Brokers provide what you need&lt;/strong&gt; on a corporate level. If you want a simple and &quot;clean&quot; solution you're not looking to support several different formats from several different banks and having to manage your liquidity across all those providers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Hotspot FX&lt;/strong&gt;&lt;br&gt;&#xA; - FIX&lt;br&gt;&#xA; - API's: Java&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Interactive Brokers&lt;/strong&gt;&lt;br&gt;&#xA; - FIX&lt;br&gt;&#xA; - API's: Java, C++, DDE for Excel, ActiveX&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Go with FIX&lt;/strong&gt;.&lt;br&gt;&#xA; Fix is supported by both Hotspot, IB and all the major banks. If you develop around FIX you'll have it almost 'plug-and-play' to the major providers. There is also a nice FIX API for your language of choice &lt;code&gt;.Net&lt;/code&gt; on &lt;a href=&quot;http://www.quickfixengine.org/&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;QuickFIX&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1731" LastEditorUserId="1731" LastEditDate="2013-04-19T21:47:25.630" LastActivityDate="2013-04-19T21:47:25.630" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7779" PostTypeId="2" ParentId="7674" CreationDate="2013-04-19T14:06:22.527" Score="2" Body="&lt;p&gt;The standard answer to your question would be to do the maximum likelihood estimation. When you say &quot;plug in $\sigma$&quot; you can show that the sample estimate of $\sigma$ is actually the maximum likelihood estimate of $\sigma$ for the normal distribution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I can assume that your data are IID then what you do is use your distribution with parameters $\{\theta_1 \ldots \theta_n\}$ to compute&#xA;$$p(x_1, x_2, \ldots, x_m | \theta_1 \ldots \theta_n) = \prod_j p(x_j | \theta_1 \ldots \theta_n).$$&#xA;Here $x_1 \ldots x_m$ are your data points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now take logarithms of both sides and you have&#xA;$$f(\theta_1 \ldots \theta_n) = \sum_j \ln(p(x_j | \theta_1 \ldots \theta_n)).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The final step is to maximize the above with respect to $\theta_j$. In many cases you may be able to do this analytically (such as for the normal distribution). If so, you will get a close form equation in terms of your data points for estimating the parameters of your distribution. If not you can plug the above in some numerical optimizer and get the estimates that way. Once you have your estimates you can estimate the VaR by computing the quantiles using your estimated distribution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you like Bayesian analysis I believe you get the same answer if you do a Beysian estimation with the conjugate prior (don't quote me on that though, better to check). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an aside, this is also quite useful for doing robust (ie. outlier resistant) estimates of centre and scale parameters if you stick in some other $f$ that might not correspond to a probability distribution. Tukey functions are a popular choice here.&lt;/p&gt;&#xA;" OwnerUserId="5156" LastActivityDate="2013-04-19T14:06:22.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7780" PostTypeId="2" ParentId="7768" CreationDate="2013-04-19T14:07:43.137" Score="7" Body="&lt;p&gt;&lt;a href=&quot;https://twitter.com/quantivity&quot; rel=&quot;nofollow&quot;&gt;@quantivity&lt;/a&gt; is an aggregator of interesting papers, as is &lt;a href=&quot;http://www.thewholestreet.com/&quot; rel=&quot;nofollow&quot;&gt;http://www.thewholestreet.com/&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Beyond that, I guess you must find the isolated communities of practitioners who can guide you or (or course) just follow up all the references of papers.  &lt;a href=&quot;http://www.wilmott.com/&quot; rel=&quot;nofollow&quot;&gt;Wilmott&lt;/a&gt; has a pretty solid message board for quant finance, &lt;a href=&quot;https://www.quantopian.com/&quot; rel=&quot;nofollow&quot;&gt;quantopian&lt;/a&gt; is trying to build one for algo trading systems.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the sort of technical analysis you are trying to find, I am not totally certain, but quantopian might be a good start.&lt;/p&gt;&#xA;" OwnerUserId="3491" LastEditorUserId="1587" LastEditDate="2013-04-24T00:37:24.543" LastActivityDate="2013-04-24T00:37:24.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7782" PostTypeId="2" ParentId="7764" CreationDate="2013-04-19T17:03:44.883" Score="1" Body="&lt;p&gt;I have been in touch with the securities and exchange commission. CIKs cannot be reassigned and are unique for all time. See the excerpt below:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;CIKs are not reassigned or recycled by the SEC -- they are intended to be forever unique.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="5147" LastActivityDate="2013-04-19T17:03:44.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7783" PostTypeId="2" ParentId="7777" CreationDate="2013-04-19T18:00:35.563" Score="1" Body="&lt;p&gt;European calls and puts have the same volatility value when they are matched by time to expiry and strike. So if you do match them by time to expiry, strike and price date then you can calculate the implied volatility and look for discrepancies, under the assumption that they should be the same, due to put-call parity as you say.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not all options of the same expiry have the same strike. On any given exchange expiration date, there will be many puts and many calls, with different strikes. Options with different strikes are not a put-call parity match. Instead you will be able to back out the different implied volatilities of different strikes and graph them. That graph (implied vol vs strike for a given expiration) is called the Volatility Smile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If a particular strike on a given expiration does not have both a put and a call, it is because there was not sufficient interest in the one of the options to deserve a quote. This is usually true for low strike calls and high strike puts, which have a high intrinsic value and as such demand too much capital to trade. &lt;/p&gt;&#xA;" OwnerUserId="2251" LastActivityDate="2013-04-19T18:00:35.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7784" PostTypeId="1" CreationDate="2013-04-19T18:42:19.920" Score="4" ViewCount="4211" Body="&lt;p&gt;I'm trying to figure out how to perform cointegration tests in R between 2 time series. I'm using &lt;code&gt;po.test&lt;/code&gt; from the package &lt;code&gt;tseries&lt;/code&gt; and &lt;code&gt;ca.po&lt;/code&gt; and &lt;code&gt;ca.jo&lt;/code&gt; from the package &lt;code&gt;urca&lt;/code&gt;, and I have a couple of questions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If I use PO which is non symmetric and one time series is stationary and the other isn't, I get opposite results. Is this normal? Also related I guess, if I have two time series and don't know yet whether they are stationary, can I use cointegration tests right away or do I need to pretest for unit roots?&lt;/li&gt;&#xA;&lt;li&gt;When I use &lt;code&gt;po.test&lt;/code&gt; and &lt;code&gt;ca.po&lt;/code&gt; I get very different results, why is this?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="5159" LastActivityDate="2014-01-09T17:35:03.300" Title="Cointegration tests" Tags="&lt;r&gt;&lt;cointegration&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7785" PostTypeId="1" CreationDate="2013-04-20T00:11:55.120" Score="2" ViewCount="1653" Body="&lt;p&gt;I've found many, many sites which describe what the MESA sine wave looks like and how to interpret it.  But I have yet to find any site that describes the actual formula used to calculate the sine wave. (The lead wave I assume is simply the sine wave phase-shifted 45 degrees.)&lt;/p&gt;&#xA;" OwnerUserId="5160" LastEditorUserId="5149" LastEditDate="2013-04-24T11:06:09.640" LastActivityDate="2013-04-24T11:06:09.640" Title="How is the MESA sine wave calculated?" Tags="&lt;technicals&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7786" PostTypeId="2" ParentId="7766" CreationDate="2013-04-20T01:52:25.503" Score="3" Body="&lt;p&gt;Your aggregator should be coding not just to the FIX feeds but the specialized protocols. FIX just gives the bare minimum.  For example, Hotspot's FIX certainly works but  is throttled and doesn't have the full market data detail.  You need their Itch.  For Currenex, you need their Itch and Ouch.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your aggregator provider should also give impartial advice and give the full functionality of each ECN without making it complicated.  The FX ECNs are very different in structure and which currencies they are strong at.  For example, EBS is strong in USD/JPY and EUR/USD, Reuters is strong in commonwealth pairs.  Hotspot is good at crosses. FXall, Currenex, also the bank APIs each have their uses.  Some ECNs and banks are better than others at different times of day, some are better whether you are an aggressor or making prices etc..  It is a very fragmented market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ask your aggregator whether they are being paid by the banks or ECNs.  Someone mentioned this.  If so, it is not an impartial aggregator. &lt;/p&gt;&#xA;" OwnerUserId="5161" LastActivityDate="2013-04-20T01:52:25.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7787" PostTypeId="2" ParentId="7785" CreationDate="2013-04-20T12:20:28.377" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://www.mesasoftware.com/index.htm&quot; rel=&quot;nofollow&quot;&gt;Elher's website&lt;/a&gt; has a technical papers section wherein you can find a paper called &quot;MAMA.&quot; At the end of this paper there is Easylanguage code to calculate the phase. You are right that the lead sine is just phase plus 45 degrees. Just take the sine of these calculated phases for the indicator.&lt;/p&gt;&#xA;" OwnerUserId="252" LastActivityDate="2013-04-20T12:20:28.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7788" PostTypeId="2" ParentId="7784" CreationDate="2013-04-20T23:08:53.790" Score="2" Body="&lt;p&gt;I believe all you need to cope is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;A definition of cointegration from any statistics handbook, wikipedia or the like, &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;An example code for the implementation in R, eg &lt;a href=&quot;http://quanttrader.info/public/testForCoint.html&quot; rel=&quot;nofollow&quot;&gt;http://quanttrader.info/public/testForCoint.html&lt;/a&gt; that is often cited.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2220" LastActivityDate="2013-04-20T23:08:53.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7792" PostTypeId="5" CreationDate="2013-04-21T17:40:22.273" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2013-04-21T17:40:22.273" LastActivityDate="2013-04-21T17:40:22.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7793" PostTypeId="4" CreationDate="2013-04-21T17:40:22.273" Score="0" Body="Homework questions for students studying Quantitative Finance or a similar subject." OwnerUserId="848" LastEditorUserId="848" LastEditDate="2013-04-21T21:02:39.823" LastActivityDate="2013-04-21T21:02:39.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7794" PostTypeId="1" CreationDate="2013-04-21T23:53:45.373" Score="2" ViewCount="686" Body="&lt;p&gt;I am attempting to minimize the variance of a 3 stock portfolio using optimization within a loop. What I have done is calculated the stock returns and cov matrix from dates 1980-01-01 to 1989-12-31 and optimized for the minvar portfolio using solve.QP. From here, I would like to calculate the minvar portfolio for every year leading up to date 2010-12-31 and store the weights and optimal value in a vector. My code is as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    library(quantmod)&#xA;    library(FRAPO)&#xA;    library(quadprog)&#xA;    getSymbols(c(&quot;F&quot;,&quot;AA&quot;,&quot;IBM&quot;),from=&quot;1980-01-01&quot;,to=&quot;2010-12-31&quot;)&#xA;    port=cbind(F$F.Adjusted,AA$AA.Adjusted,IBM$IBM.Adjusted)&#xA;    portret=returnseries(port,&quot;discrete&quot;,trim=TRUE)&#xA;    portret=data.frame(date=index(portret),coredata=portret)&#xA;    colnames(portret)=c(&quot;time&quot;,&quot;F&quot;,&quot;AA&quot;,&quot;IBM&quot;)&#xA;    #to determine where to end portA&#xA;    which(portret==&quot;1989-12-29&quot;,arr.ind=TRUE)&#xA;    #row number 2527 references date 1989-12-29&#xA;    portA=subset(portret,select=c(&quot;F&quot;,&quot;AA&quot;,&quot;IBM&quot;),subset=portret[,1]&amp;lt;portret[2527,1])&#xA;    portAcov=cov(portA)&#xA;    Dmat=portAcov&#xA;    dvec=c(0,0,0)&#xA;    A=c(1,1,1)&#xA;    B=diag(3)&#xA;    portAmeans=colMeans(portA)&#xA;    Amat=cbind(A,portAmeans,B)&#xA;    bvec=c(1,0,0,0,0)&#xA;    sol=solve.QP(Dmat,dvec,Amat,bvec,meq=1)&#xA;    #this gives me my minvar port weights for up to year 1990&#xA;    portB=subset(portret,select=c(&quot;F&quot;,&quot;AA&quot;,&quot;IBM&quot;),subset=portret[,1]&amp;gt;=portret[2527,1])&#xA;    w=matrix(0,nrow(portret),3)&#xA;    w[1,1:3]=sol$solution&#xA;    v=matrix(0,nrow(portret),1)&#xA;    v[1]=sol$value&#xA;    for(i in (which(portret==&quot;1990-01-02&quot;,arr.ind=TRUE)[1]:&#xA;          which(portret==&quot;2010-12-31&quot;,arr.ind=TRUE)[1])){&#xA;    Dmat=cov(subset(portret[,2:4],select=c(&quot;F&quot;,&quot;AA&quot;,&quot;IBM&quot;),subset=portret[,1]&#xA;                                                       &amp;lt;portret[i,1]))&#xA;    sol2=solve.QP(Dmat,dvec,Amat,bvec,meq=1)&#xA;    w[i,1:3]=sol2$solution&#xA;    v[i,]=sol2$value}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For some reason my weight vector w and value vector v equal all the same numbers. I have been crunching this code for days and cant figure it out. Additionally, I want yearly values and weights (i.e. optimal minvar weights for year 1990, 1991, 1992... 2010 and the corresponding values). Is there a simple way to do this??&lt;/p&gt;&#xA;" OwnerUserId="5172" LastEditorUserId="5172" LastEditDate="2013-04-22T14:35:08.957" LastActivityDate="2013-04-22T14:35:08.957" Title="portfolio optimization with a loop" Tags="&lt;programming&gt;&lt;optimization&gt;&lt;r&gt;&lt;finance&gt;&lt;variance&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7797" PostTypeId="1" CreationDate="2013-04-22T10:01:01.160" Score="2" ViewCount="90" Body="&lt;p&gt;I am working on a project that involves pricing european call options in incomplete markets. Now I need to find a unique measure $Q^*$ such that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Q^* = \min_{M_e} E_Q [V(T)-F(w)]^2 = \min_{u} E_Q [V(T)-F(w)]^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $V(T)$ is the terminal value of a portfolio given&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V(T) = V(0)e^{rt} + \int_0^T e^{r(t-u)}\beta(u)S(u)\sigma dB(u)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$F(w)=(e^{\sigma B(T)+(r-\frac{1}{2}\sigma^2)T}-K)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$M_e$ is the set of all equivalent martingales.&lt;/p&gt;&#xA;" OwnerUserId="5174" LastEditorUserId="17133" LastEditDate="2013-04-23T18:43:00.250" LastActivityDate="2013-04-23T18:43:00.250" Title="Mean-variance minimizser" Tags="&lt;variance&gt;&lt;mean&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7798" PostTypeId="2" ParentId="7767" CreationDate="2013-04-22T12:20:00.460" Score="4" Body="&lt;p&gt;With respect to your first question: Yes. The regression has to determine the conditional expectation of the &lt;em&gt;continuation value&lt;/em&gt;, i.e., the (discounted) value of the future cash flows including the exercise criteria(s) you have determined for the remaining future exercise times, conditional to the assumption that you did not exercise at or prior the current date. These are determined in a backward algorithm, going backward in time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With respect to your second question: An open source Java implementation of the backward algorithm and the least square regression can be found at &lt;a href=&quot;http://www.finmath.net/java/&quot; rel=&quot;nofollow&quot;&gt;http://www.finmath.net/java/&lt;/a&gt; - see also &lt;a href=&quot;http://www.finmath.net/topics/bermudanoptionmontecarlo/&quot; rel=&quot;nofollow&quot;&gt;http://www.finmath.net/topics/bermudanoptionmontecarlo/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3548" LastEditorUserId="3548" LastEditDate="2013-04-22T22:01:25.020" LastActivityDate="2013-04-22T22:01:25.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7800" PostTypeId="1" CreationDate="2013-04-22T16:54:21.963" Score="7" ViewCount="296" Body="&lt;p&gt;I'm working through the &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0071459391&quot; rel=&quot;noreferrer&quot;&gt;Quantitative Equity Portfolio Management book by Chincarini and Kim&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to build a basic industry-based fundamental factor model. As this is a pet project for pedagogical purposes, I don't have the money to spend on Barra's GICS classifications. I also understand that other industry classifications (SIC and NAICS) are fairly useless for factor models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a reasonable open-source or homemade alternative (using, say, k-means clustering or non-negative matrix factorization) to create my own industry factors for US equities?&lt;/p&gt;&#xA;" OwnerUserId="2119" LastActivityDate="2016-12-14T17:05:17.863" Title="Industry factors without GICS" Tags="&lt;factor-models&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7802" PostTypeId="1" AcceptedAnswerId="7807" CreationDate="2013-04-23T06:44:51.697" Score="8" ViewCount="3638" Body="&lt;p&gt;I'm looking at four sources of forex data, as compiled in the question, &lt;a href=&quot;https://quant.stackexchange.com/questions/141/what-data-sources-are-available-online/1436#1436&quot;&gt;What data sources are available online?&lt;/a&gt; And I think I must be misunderstanding something, perhaps something fundamental, but I'm not sure what. Given my ignorance, it's hard to pin down my confusion as a single question, so I'll express a few, in hopes someone can pick up on the source of my confusion and shed light.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The tick data from DukasCopy shows 5 columns: Time, Ask, Bid, AskVolume, and BidVolume. Am I correct to believe that this data shows no information about actual executions&amp;mdash;only changes to the &lt;em&gt;quotes&lt;/em&gt;? (Am I correct to believe that the AskVolume and BidVolume columns describe only the quantity &lt;em&gt;offered&lt;/em&gt; at the Ask and Bid prices, respectively?)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The 1-second data from DukasCopy shows 6 columns: Time, Open, High, Low, Close, and Volume. Am I correct to believe that this data &lt;em&gt;does&lt;/em&gt; show information about actual executions, &lt;em&gt;i.e.&lt;/em&gt; Volume being the quantity traded in the given time period of 1 second?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;OANDA only provides daily and weekly data, the forexforums.com links only provide 1-minute data (resembling DukasCopy's 1-second data), and GAIN Capital seems to provide tick data (resembling DukasCopy's tick data) without the bid and ask volumes. I have looked at many other sources as well, but can't seem to find tick data on &lt;em&gt;trades&lt;/em&gt;, &lt;em&gt;i.e.&lt;/em&gt; the time, price, and quantity at every trade. Am I looking for something that doesn't actually exist? If so, then why does it not exist?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I suspect it could have something to do with the non-centralized nature of the forex markets. But then, what exactly does this historical data, &lt;em&gt;e.g.&lt;/em&gt; DukasCopy's, mean? Do these numbers only represent the quotes (tick data) and trades (1-second data) &lt;em&gt;handled by DukasCopy&lt;/em&gt; (who I understand to be a broker)? Or, do they indeed come from some centralized aggregation of quotes and/or trades?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I have looked for explanations regarding the data on each of the four websites, but to no avail. I apologize for asking such a basic question; I'm very new to forex, and I'm surprised by how different it is from the the NYSE/NASDAQ markets, which I'm slightly more familiar with.&lt;/p&gt;&#xA;" OwnerUserId="5149" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2015-02-14T22:53:17.490" Title="How is historical data for forex collected or computed?" Tags="&lt;fx&gt;&lt;historical-data&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="7807" PostTypeId="2" ParentId="7802" CreationDate="2013-04-23T13:30:49.757" Score="9" Body="&lt;p&gt;The fx market, contrary to most other asset classes is an almost entirely fragmented over-the-counter market, aside the very small number of fx futures that are trading at dismal liquidity levels. Therefore, you will not encounter a single serious liquidity provider that will take a stab at estimating total traded volume in any of the currency pairs. Having said that, there are some brokers that may show traded volume that crosses their own books, only. You cannot compare fx markets with any listed cash equity, futures, or options market. Why this is the case? Simple, historical reasons and traders and market participants really are against change unless of course it changes their own bottom lines. That is why many initiatives that were pushed by risk managers, back and middle offices died for lack of front office support, such as trade settlement at T+0. A decentralized market in fx works well enough for most players to see no need to change much about it. ECNs and aggregation frameworks saw the void and now provide quite a chunk of liquidity but in the end all they do is, well, aggregate. The actual liquidity still comes from various houses. In a sense it is funny if you really think about it because a 200 million block gets in the end passed from one hand to the other, while each hand retains a small chunk until it is split up sufficiently for the remaining hand to hold. So the same 200 million or part of it may pass the same brokers and order books several times before it is swallowed up by those the risk eventually ended up with.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To your bullets above (1-4):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) you are right. And its only the quantity that the broker/ecn itself sees. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) I cannot confirm that but I would logically assume that the volume refers to trades but again only at the broker. I have not come across many brokers that show trading volume or average traded prices or any other related trade data but that does not mean it does not exist. Some ECNs do show traded volume. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) See 2, regarding trading data at each ecn or broker, it does exist but traditionally most market participants have not expressed much interest in such data because it is pretty meaningless. You can't meaningfully extrapolate to the market as a whole. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) No centralized fx trading, hence no centralized aggregation unless you refer to ECNs that centralize/aggregate a chunk of total trading interest. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-04-24T02:22:42.490" LastActivityDate="2013-04-24T02:22:42.490" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7808" PostTypeId="1" CreationDate="2013-04-23T17:33:51.333" Score="10" ViewCount="21231" Body="&lt;p&gt;I recently heard that for a forward swap rate (for example, the fixed rate of a swap that will start in one year and end in five years), I need to do a convexity adjustment in order to get the right number. Is it true, and if so why?&lt;/p&gt;&#xA;" OwnerUserId="5180" LastEditorUserId="467" LastEditDate="2013-04-24T07:47:13.380" LastActivityDate="2013-04-28T15:42:17.773" Title="Convexity adjustment for a forward swap rate" Tags="&lt;swaps&gt;&lt;convexity&gt;" AnswerCount="5" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7809" PostTypeId="1" CreationDate="2013-04-23T17:34:46.203" Score="3" ViewCount="3148" Body="&lt;p&gt;I need to annualize daily returns for about 120 firms for over a period of 10 years. I chose to calculate the geometric return because 1) it is the actual return 2) to avoid the asymmetric effect of negative and positive returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem is that the geometric return that i have calculated doesn't match the actual yearly rate of return. Here is what I've done;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Calculate simple returns by (Xt0-Xt-1)/Xt-1&lt;/li&gt;&#xA;&lt;li&gt;Check how many days the stock was being traded for, because the rule of thumb 252 is to ambiguous. This is because some stocks get a listing in e.g. March and would therefore be unfair to multiply by 252.&lt;/li&gt;&#xA;&lt;li&gt;Use the formula =sumproduct(geomean(aa1:zz36+1)-1) to come up with daily geomean. This should do the trick regarding the negative values, but maybe my result are biased because of the amount of 'zero' returns due to holiday/(un)listing. I also thought of this by using the count.if'0' and subtract this number by the total days in a year. &lt;/li&gt;&#xA;&lt;li&gt;annualize the daily geomean by multiplying with counted days traded.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I thought all was well until i checked my first observation. This fund got listed 2-march-2010 for 100 and the year end was 161.6. Using the above methodology yield a daily geomean of 0.009915 and trading days of 201. Multiplying by 201 this results in annualized geomean of 1.9931. This is obvious incorrect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could also use the formula ((Xt0/Xt-1)^(1/tds)-1)*tds  - which result in the correct answer of .4805- but is devious due to irregularities of dataset..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can somebody see what I am doing wrong here. As I mentioned above, I do have have some zero value because I download daily prices per year. I then select 1-Jan to 31-Dec. How can I overcome the problem with the zero values? I tried empty space, but than the formula doesn't work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="5097" LastEditorUserId="5097" LastEditDate="2013-04-25T13:53:59.313" LastActivityDate="2013-04-25T15:50:01.293" Title="Calculating Geometric mean" Tags="&lt;equities&gt;&lt;portfolio-management&gt;&lt;sharpe-ratio&gt;&lt;return&gt;&lt;annualized&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7810" PostTypeId="2" ParentId="7809" CreationDate="2013-04-23T20:41:32.320" Score="0" Body="&lt;p&gt;When you say the return on firms, I take it you mean the change in the stock price of firms. If you were talking about the return of firms' investment strategies, then you would have to deal with cash inflows, which makes the answer more complicated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are having problems, there are two equivalent approaches that should give you the correct answer. In the first, only focus on the price of the stock at the end points to compute the geometric return. In the second, take the average of the log returns over the appropriate horizon and frequency, multiply by whatever constant to annualize the log returns (252 in your case), and then convert from log by $exp(x)-1$, where $x$ is the adjusted log return.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2013-04-23T20:41:32.320" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7811" PostTypeId="1" AcceptedAnswerId="7814" CreationDate="2013-04-24T01:55:35.000" Score="7" ViewCount="983" Body="&lt;p&gt;I don't understand why in the formula&#xA;$$\log{\frac{S_{t+\triangle t}}{S_t}} \sim \phi{\left((\mu - \frac{1}{2}\sigma^2)\triangle t, \sigma^2 \triangle t\right)}$$&#xA;the mean is $(\mu - \frac{1}{2}\sigma^2)\triangle t$ and not just $\mu \triangle t$. I am aware that it is supposed to represent a lognormal distribution, but I guess I'm missing something, or that explanation isn't simple enough. &lt;/p&gt;&#xA;" OwnerUserId="5182" LastEditorDisplayName="user13444" LastEditDate="2016-12-15T10:04:15.923" LastActivityDate="2016-12-15T10:04:15.923" Title="In Black-Scholes, why is $\log{\frac{S_{t+\triangle t}}{S_t}} \sim \phi{((\mu - \frac{1}{2}\sigma^2)\triangle t, \sigma^2 \triangle t)}$?" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;normal-distribution&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7812" PostTypeId="1" CreationDate="2013-04-24T03:42:32.573" Score="6" ViewCount="617" Body="&lt;p&gt;Consider some negative skew and high kurtosis return time-series $X_t$. I do not know the functional form of the pdf of $X_t$ and have about 150,000 data points. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose that I was to create an adjusted $X_t$ called $X_t^a$ where the mean, median, skew and kurtosis remain approximately the same as the original series, and the only main difference is that $\sigma (X_t) = 2*\sigma (X_t^a)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's an appropriate transformation? I've tried:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ X_t^a := (X_t - E[X_t])*0.5\frac{\sigma(X_t)}{\sigma(X_t)} + E[X_t]  \\&#xA;= Z*0.5\sigma(X_t) + E[X_t] \sim N(E[X_t],(0.5\sigma(X_t))^2)$$ &#xA;$$Z \sim N(0,1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but this severely reduces the positive median towards zero which is not what I want (I want to keep $\text{median}(X_t)$ approximately equal to $\text{median}(X_t^a)$). &lt;/p&gt;&#xA;" OwnerUserId="5183" LastEditorUserId="5183" LastEditDate="2013-04-24T05:01:24.517" LastActivityDate="2013-04-25T13:52:15.603" Title="Transformation to reduce standard deviation without changing median" Tags="&lt;volatility&gt;&lt;stochastic-processes&gt;&lt;distribution&gt;&lt;normal-distribution&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7813" PostTypeId="2" ParentId="7808" CreationDate="2013-04-24T06:50:31.340" Score="1" Body="&lt;p&gt;Yes, an adjustment has to be made and the reason is that a forward curve now will evolve and not be the same as the future spot curve. For example, a one year forward today is not equal to your spot rate a year hence. So spot curve discount factors have to be adjusted or directly replaced through the forward DFs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Convexity adjustments are already supposed to be made during the forward libor curve construction. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-04-26T10:24:32.297" LastActivityDate="2013-04-26T10:24:32.297" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7814" PostTypeId="2" ParentId="7811" CreationDate="2013-04-24T06:56:32.823" Score="7" Body="&lt;p&gt;So we have the BS-Model&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dS_t=S_t(\mu dt +\sigma dW_t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;W.l.o.g we assume $S_0=1$. Itô's lemma implies that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S_t=\exp{(\sigma W_t+(\mu-\frac{1}{2}\sigma^2)t)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know that $W_t$ is normally distributed with mean $0$ and variance $t$. Now have a look at the r.v.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X_t=\sigma W_t+(\mu-\frac{1}{2}\sigma^2)t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma W_t$ is the random part and $\gamma:=(\mu-\frac{1}{2}\sigma^2)t$ is deterministic. Hence $E[X_t]=\sigma E[W_t]+\gamma=\sigma\cdot 0+\gamma=\gamma$. We also have the rule $Var(Y+a)=Var(Y)$, for constants $a$ and a r.v. $Y$. Hence the variance of $X_t$ is given by $\sigma^2t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By properties of the $\exp(x)$ function, we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{S_{t+\Delta t}}{S_t}=\exp{(\sigma(W_{t+\Delta t}-W_t)+(\mu-\frac{1}{2}\sigma^2})(t+\Delta t-t))=\exp{(\sigma(W_{t+\Delta t}-W_t)+(\mu-\frac{1}{2}\sigma^2})\Delta t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can apply the same argument as for $X_t$, using that $W_{t+\Delta t}-W_t\sim\mathcal{N}(0,\Delta t)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why it should be the lognormal distribution should be clear. Let me know if something is not clear to you.&lt;/p&gt;&#xA;" OwnerUserId="17133" LastActivityDate="2013-04-24T06:56:32.823" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7815" PostTypeId="2" ParentId="7811" CreationDate="2013-04-24T07:00:29.610" Score="4" Body="&lt;p&gt;The term 1/2 * sigma-squared arises through the application of Ito's Lemma. Keep in mind that the assumption is of a stock price that follows geometric BM with a constant drift and volatility. If you set up a delta-hedge portfolio and apply Ito calculus you will end up with an adjustment in the distribution by exactly above term. Another way of interpreting the term is that it represents the difference between the mean and the median of the log-normal distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not have the book with me right now but Steven Shreve in his Stochastic Calculus II book has one of the most logical and easily understood derivations of Black Scholes through change of probability measure and it will make the shift in mean crystal clear. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not a huge fan of posting lengthy formulae nor am I a mathematician by heart so please take a look at the cited reference. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-04-24T07:00:29.610" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7816" PostTypeId="2" ParentId="7811" CreationDate="2013-04-24T08:16:14.897" Score="7" Body="&lt;p&gt;Another way of seeing it is that the $-\frac12\sigma^2$ is just a correction term that comes from &lt;a href=&quot;http://en.wikipedia.org/wiki/Jensen%27s_inequality&quot; rel=&quot;noreferrer&quot;&gt;Jensen's inequality&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need this when switching from supposedly symmetric returns (&lt;a href=&quot;http://en.wikipedia.org/wiki/Normal_distribution&quot; rel=&quot;noreferrer&quot;&gt;normal distribution&lt;/a&gt;) to the skewed price process (&lt;a href=&quot;http://en.wikipedia.org/wiki/Log-normal_distribution&quot; rel=&quot;noreferrer&quot;&gt;log-normal distribution&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2013-04-24T08:16:14.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7817" PostTypeId="1" AcceptedAnswerId="7823" CreationDate="2013-04-24T08:36:02.803" Score="5" ViewCount="4760" Body="&lt;p&gt;Black-Scholes requires volatility estimated in trading days. How does this affect other parameters? Specifically, should the time-to-expiration also be in trading days? And how does this affect the risk-free interest rate?&lt;/p&gt;&#xA;" OwnerUserId="5186" LastEditorUserId="35" LastEditDate="2013-04-24T12:56:17.540" LastActivityDate="2013-05-01T17:33:20.943" Title="Trading days or calendar days for Black-Scholes parameters?" Tags="&lt;black-scholes&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7818" PostTypeId="2" ParentId="141" CreationDate="2013-04-24T09:44:31.647" Score="31" Body="&lt;p&gt;&lt;a href=&quot;http://www.quandl.com&quot;&gt;quandl&lt;/a&gt; is a new data source for all kind of econometric time series.&lt;/p&gt;&#xA;" OwnerUserId="5187" LastActivityDate="2013-04-24T09:44:31.647" CommentCount="3" CommunityOwnedDate="2013-04-24T09:44:31.647" ContentLicense="CC BY-SA 3.0" />
  <row Id="7819" PostTypeId="2" ParentId="7812" CreationDate="2013-04-24T09:50:06.310" Score="5" Body="&lt;p&gt;It's not possible with a simple linear transformation like the one you mentioned: since scale and thus the distance between mean and median are required to change, either the mean or the median will not be preserved. &#xA;Therefore you must use nonlinear transformations, which will complicate quite a bit mantaining skew and kurtosis and imho will not be meaningful anyway (the distortions needed to mantain the statistics will do more harm than good to the empirical PDF).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sorry if I suggest to challenge the requirements: why do you want both mean and median preserved? These statistics do not have much intrinsic value other than providing estimates of location (but not the same location though: even with full PDF knowledge they´d be different! yet one might still convert one of them to the other kind), forcing such a relationship between the two sounds like a recipe for trouble. An alternative would be to define a location statistic as some average of the two and mantain that constant in a simple linear transform. Or even better using a more robust location statistic in place of both.&lt;/p&gt;&#xA;" OwnerUserId="3015" LastEditorUserId="3015" LastEditDate="2013-04-25T08:40:25.210" LastActivityDate="2013-04-25T08:40:25.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7820" PostTypeId="1" AcceptedAnswerId="7821" CreationDate="2013-04-24T10:42:10.610" Score="9" ViewCount="15937" Body="&lt;p&gt;So I'm trying to simulate currency movements for several currencies with a given correlation matrix. I have the initial price, drift and volatility for each of the separate currencies, and I want to simulate their prices against USD with correlations following the matrix. I'm doing this in Excel. I read somewhere that multiplying a vector of independent GBMs with the Cholesky decomposition of the correlation matrix gives the required result, but doesn't work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help?&lt;/p&gt;&#xA;" OwnerUserId="5188" LastEditorUserId="12" LastEditDate="2016-05-27T16:26:40.937" LastActivityDate="2017-05-03T20:56:06.670" Title="How to simulate correlated Geometric brownian motion for n assets?" Tags="&lt;brownian-motion&gt;&lt;correlation-matrix&gt;&lt;excel&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7821" PostTypeId="2" ParentId="7820" CreationDate="2013-04-24T10:57:28.683" Score="12" Body="&lt;p&gt;Yes, you need Cholesky factorization.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find the general idea here:&lt;br&gt;&#xA;&lt;a href=&quot;http://www.goddardconsulting.ca/option-pricing-monte-carlo-basket.html&quot;&gt;http://www.goddardconsulting.ca/option-pricing-monte-carlo-basket.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Plus the implementation in MATLAB here:&lt;br&gt;&#xA;&lt;a href=&quot;http://www.goddardconsulting.ca/matlab-monte-carlo-assetpaths-corr.html&quot;&gt;http://www.goddardconsulting.ca/matlab-monte-carlo-assetpaths-corr.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code in general should be easily translatable. The only difficulty is the Cholesky factorization where VBA code can be found here:&lt;br&gt;&#xA;&lt;a href=&quot;http://vbadeveloper.net/numericalmethodsvbacholeskydecomposition.pdf&quot;&gt;http://vbadeveloper.net/numericalmethodsvbacholeskydecomposition.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2013-04-24T10:57:28.683" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7822" PostTypeId="1" AcceptedAnswerId="7825" CreationDate="2013-04-24T11:14:03.937" Score="6" ViewCount="34969" Body="&lt;p&gt;One site suggested the difference is that the warrant in the bond with warrant is a fixed price on company stock. E.g. for a \$1000 bond, you can buy 500 shares at \$2 each. And that convertible bonds does not have a fixed price term.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another site suggested that with a bond with warrant, the warrant can be sold separately from the bond, while a convertible bond has not that possibility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are any of these suggestions correct, or is it something else that make up the (major) difference?&lt;/p&gt;&#xA;" OwnerUserId="5189" LastEditorUserId="467" LastEditDate="2013-04-24T14:35:32.160" LastActivityDate="2019-12-01T14:30:52.037" Title="What is the difference between convertible bond and bond with warrant?" Tags="&lt;convertible-bond&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7823" PostTypeId="2" ParentId="7817" CreationDate="2013-04-24T12:57:49.313" Score="3" Body="&lt;p&gt;I remember this discussion here: &lt;a href=&quot;http://www.wilmott.com/messageview.cfm?catid=3&amp;amp;threadid=62227&quot; rel=&quot;nofollow&quot;&gt;http://www.wilmott.com/messageview.cfm?catid=3&amp;amp;threadid=62227&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should absolutely match your convention for time to expiration to the convention you used for calculating volatility. There seems to be other ways to proceed, as modifying the volatility to match your convention but I don't really see the point in using them.&lt;/p&gt;&#xA;" OwnerUserId="5052" LastActivityDate="2013-04-24T12:57:49.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7825" PostTypeId="2" ParentId="7822" CreationDate="2013-04-24T13:23:27.890" Score="6" Body="&lt;p&gt;The major difference is that the equity option embedded in a convertible bond is not detachable from the convert, so that you have to value the bond and the embedded option together.  If you want to make a direct comparison with a detachable warrant, you can think of the the embedded option in a convertible bond as having a strike price equal to the value of the remaining cash flows of the convertible bond, so that the strike prices changes over time as coupon payments are made, and changes with the level of both interest rates and the credit quality of the bond issuer.&lt;/p&gt;&#xA;" OwnerUserId="2027" LastActivityDate="2013-04-24T13:23:27.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7826" PostTypeId="1" CreationDate="2013-04-24T19:40:04.073" Score="4" ViewCount="2231" Body="&lt;p&gt;&lt;a href=&quot;http://blog.oddhead.com/2006/10/30/implementing-hansons-market-maker/&quot; rel=&quot;nofollow&quot;&gt;Implementing Hanson's Market Maker&lt;/a&gt; states:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If the market maker wants to quote a &quot;current price&quot;, he can. The&#xA;  current price for outcome 1 is:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\mbox{price1} = \frac{e^{\frac{q1}{b}}}{e^{\frac{q1}{b}} + e^{\frac{q2}{b}}}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why this is the case? Is it just some simple &quot;see-saw&quot; algorithm? Exert pressure on one side and it will simply radiate across into the corresponding +/- price change?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am asking in the context of writing a simple market-making algorithm to offer bids and quotes (on a virtual market), but this seems too simple.&lt;/p&gt;&#xA;" OwnerUserId="5168" LastEditorUserId="35" LastEditDate="2013-04-24T20:33:38.583" LastActivityDate="2014-11-20T02:46:21.407" Title="How does Hanson's Market Maker (LMSR) work?" Tags="&lt;pricing&gt;&lt;market-making&gt;&lt;algorithm&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7827" PostTypeId="1" AcceptedAnswerId="7829" CreationDate="2013-04-24T21:47:28.373" Score="3" ViewCount="196" Body="&lt;p&gt;Suppose we hedge an index option using futures on that index. How would the hedging strategy be different if the underlying could be traded directly (from a risk point of view)?&lt;/p&gt;&#xA;" OwnerUserId="5186" LastActivityDate="2013-04-25T01:22:10.277" Title="Hedging differences between equity and index options?" Tags="&lt;options&gt;&lt;risk&gt;&lt;option-strategies&gt;&lt;hedge&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7828" PostTypeId="2" ParentId="3699" CreationDate="2013-04-25T00:19:58.603" Score="2" Body="&lt;p&gt;This is probably not a good question for Q.SE&amp;mdash;despite its application in your strategy, you're (perhaps unaware) asking a general math question: &lt;strong&gt;the difference between the &lt;em&gt;ratio of means&lt;/em&gt; and the &lt;em&gt;mean of ratios&lt;/em&gt;&lt;/strong&gt;. There are numerous results online that distinguish the difference, but I assume the terminology wasn't apparent to you at the time. I've come across some elementary books and sites that use one or the other though, seemingly arbitrarily and without thought, &lt;em&gt;e.g.&lt;/em&gt; when smoothing the stochastic; so maybe it'll be useful to comment on it:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your first formula, $$B_n\frac{\sum{A_i}}{\sum{B_i}} = B_n\frac{\frac{1}{n}\sum{A_i}}{\frac{1}{n}\sum{B_i}}$$ is the &lt;em&gt;ratio of means&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your second formula, $$B_n\frac{1}{n}\sum{\frac{A_i}{B_i}}$$ meanwhile, is the &lt;em&gt;mean of ratios&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's not really about advantage/disadvantage, but what you seek from an analytical perspective.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first formula is &lt;em&gt;not&lt;/em&gt; sensitive to how the series compare &lt;em&gt;per point in time&lt;/em&gt;. For example, both $A'_i$, a wildly fluctuating series whose average is $\mu'$, and $A''_i$, a constant series that is always $\mu'$, would yield the same result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second formula, however, &lt;em&gt;is&lt;/em&gt; sensitive to each point in time, and averages &lt;em&gt;the various measurements of comparison&lt;/em&gt;, over time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm skeptical about your method, to say the least, but as you insist, I'll leave that discussion out. Given your claims, though, I imagine the second formula, the &lt;em&gt;mean of ratios&lt;/em&gt;, is what you're after, (1) because you appear to be calculating whether one instrument is an &quot;overestimator&quot; or &quot;underestimator&quot; of the other, and I imagine you'd like to calculate the &lt;em&gt;average of those comparisons (estimations) at each point in time&lt;/em&gt;, not &lt;em&gt;the comparison (estimation) of two averages across all points in time&lt;/em&gt;, and (2) because &lt;em&gt;the mean of ratios&lt;/em&gt; is not sensitive to absolute price levels (only relative price levels per point in time), &lt;em&gt;e.g.&lt;/em&gt; if the price jumped up 200% in the middle of your series and you were using the &lt;em&gt;ratio of means&lt;/em&gt;, differences in the latter half of the series would dominate in effect over the former half (unless you're using log-normalized values).&lt;/p&gt;&#xA;" OwnerUserId="5149" LastEditorUserId="5149" LastEditDate="2013-04-25T00:43:53.520" LastActivityDate="2013-04-25T00:43:53.520" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7829" PostTypeId="2" ParentId="7827" CreationDate="2013-04-25T01:22:10.277" Score="2" Body="&lt;p&gt;The differences essentially boil down to liquidity and pricing discrepancies between the underlying and the futures of the underlying. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;With futures you have to consider basis risk which you obviously do not face if you can trade in the underlying directly.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Additionally, you need to roll futures contracts before they expire, hence you are faced with roll charges. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Also, depending on liquidity profiles, there are assets in the market where for specific reasons the derivative is more or less liquid than the underlying itself which may impact spreads and prices you pay/receive when trading them. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Another factor are financing charges: Some assets command higher or lower financing charges and borrow rates than their derivatives. Derivatives can most often be margined more cheaply than the cash underlying. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Those, in sum make up the differences and impact risk when considering whether or not to trade directly in the underlying or its derivative. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-04-25T01:22:10.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7831" PostTypeId="2" ParentId="7809" CreationDate="2013-04-25T11:42:18.520" Score="1" Body="&lt;p&gt;I'm currently also using daily returns which I want to annualize. This is my approach:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;For every month, I calculate the simple return using the formula: &lt;code&gt;(end-of-month closing price / beginning-of-month closing price) - 1&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I use the Excel formula &lt;code&gt;somproduct(geomean(A1:A12+1)-1)&lt;/code&gt; to find the monthly compounded return.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Finally, I annualize the result of step 2 by 12 (months).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The reason for cutting up the year into months is that when I use the formula &lt;code&gt;(31 December closing price / 1 January closing price) ^(1/252) * 252&lt;/code&gt;, the result doesn't represent the situation because of the high price swings. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps, but I'm not sure if it's correct. Maybe someone can verify this approach.&lt;/p&gt;&#xA;" OwnerUserId="5199" LastEditorUserId="5149" LastEditDate="2013-04-25T15:50:01.293" LastActivityDate="2013-04-25T15:50:01.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7833" PostTypeId="2" ParentId="7808" CreationDate="2013-04-25T13:48:45.883" Score="8" Body="&lt;p&gt;First of all it is not clear what exactly you mean by right number, you definitely do not adjust forward swap rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You probably mean adjusting euro dollar futures contract rates so that you can later use these values to fit the swap/forward libor curve. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reason for adjustment is simple. If you are short ED futures and &lt;strong&gt;rates go higher&lt;/strong&gt; futures price drops and you make money. Clearing house of exchange reimburses you excess margin and you can reinvest them at &lt;strong&gt;higher rate&lt;/strong&gt;. If rates &lt;strong&gt;go lower&lt;/strong&gt; you have to put extra cash into your margin account, you can borrow this money &lt;strong&gt;at lower rate&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming some distribution and forward rate model(and here things vary from simple vasicek model to extremely complicated example Peterbarg) one can compute how much this advantage is in dollars and convert it to basis points. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pure intuition tells that longer is the expiry higher is the adjustment also higher is the vol higher is the adjustment. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the end result is that being short gives you advantage and market participants are aware of it and penalize short side by that amount.&lt;/p&gt;&#xA;" OwnerUserId="5193" LastActivityDate="2013-04-25T13:48:45.883" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7834" PostTypeId="2" ParentId="7812" CreationDate="2013-04-25T13:52:15.603" Score="2" Body="&lt;p&gt;As Quartz says it is possible to make non-linear transformations taking into account skew and kurtosis, but this is mostly is limited to univariate processes (one approach for a t distribution is to match moments). For multivariate processes, it is considerably more difficult. A more general solution is to rely on &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1213325&quot; rel=&quot;nofollow&quot;&gt;Entropy Pooling&lt;/a&gt;. You could take views on both the median and the variance of the process in a univariate or multivariate setting. Be careful to check the effective number of scenarios afterward in case you have inadvertently taken an extreme view (unlikely if fixing the median and reducing the standard deviation, but possible if making the standard deviation sufficiently large). &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2013-04-25T13:52:15.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7835" PostTypeId="1" CreationDate="2013-04-25T14:37:29.237" Score="4" ViewCount="456" Body="&lt;p&gt;I have a set of date covering petrol prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My example has two columns where each row represents a sequential date.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   unleaded diesel&#xA;1   1.39     1.35&#xA;2   1.3901   1.3502&#xA;3   1.3902   1.3501&#xA;.....&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I generate eigen values:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;my.eigen $values [1] 7.053791e-07 9.097811e-08&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$vectors&#xA;             PC1        PC2&#xA;unleaded 0.6489256 -0.7608519&#xA;diesel   0.7608519  0.6489256&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;my.eigen $values [1] 7.053791e-07 9.097811e-08&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I produce a timeseries using the first, second or first two Components. That would give me something that replicates(but of course is different to) the original data?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to plot unleaded, diesel timeseries against the &quot;replicated&quot; data for different inclusion of components.&lt;/p&gt;&#xA;" OwnerUserId="4603" LastActivityDate="2013-04-25T14:37:29.237" Title="How replicate data using PCA" Tags="&lt;pca&gt;" AnswerCount="0" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7837" PostTypeId="1" AcceptedAnswerId="7838" CreationDate="2013-04-25T18:22:23.393" Score="7" ViewCount="2844" Body="&lt;p&gt;I have been looking this up and I feel like I keep running into different definitions. My understanding is that an ISO order is one which will get filled with the displayed quantity in a particular exchange's book until it needs to be routed to other market venues in order to comply with reg NMS. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at &lt;a href=&quot;http://usequities.nyx.com/markets/nyse-arca-equities/order-types&quot; rel=&quot;nofollow&quot;&gt;http://usequities.nyx.com/markets/nyse-arca-equities/order-types&lt;/a&gt; (towards the bottom) it makes it sound like an ISO order will sweep &lt;em&gt;down&lt;/em&gt; the levels of ARCA's book without regards to external quotes. This sounds like it's either a violation of reg NMS, or an exception in which the trader takes on the liability of having checked the NBBO himself. If it is the latter case, it is still different from the definition above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So which one is it?&lt;/p&gt;&#xA;" OwnerUserId="1456" LastEditorUserId="2299" LastEditDate="2017-06-23T05:33:45.840" LastActivityDate="2017-06-23T05:33:45.840" Title="What exactly is an ISO order?" Tags="&lt;equities&gt;&lt;trading&gt;&lt;market-microstructure&gt;&lt;limit-order-book&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7838" PostTypeId="2" ParentId="7837" CreationDate="2013-04-25T19:24:38.947" Score="7" Body="&lt;p&gt;Your first definition is wrong; I'm not sure where you got that from. Your second definition is correct: the ISO alerts the exchange that the submitting party has taken responsibility for RegNMS and requests a fill at only that venue's price; there is no routing away. Obviously, there is a huge red-tape burden to get permission to do this.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2013-04-25T19:24:38.947" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7840" PostTypeId="2" ParentId="7808" CreationDate="2013-04-26T09:10:46.743" Score="0" Body="&lt;p&gt;For a vanilla forward-start swap, I would agree with imachabeli; convexity is an adjustment for the non-linearity of the quoted fixed rate dependence on the floating note. If expected Libors rise 1bp, the fixed leg can be increased 1bp to compensate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Convexity adjustments are made as standard to interest rate futures (i.e. 3m); with the next futures date (Jun13) 2 months away, the front contract convexity adjustment is less than .1bp, so it makes no real difference. By contrast at 5y (Jun18), the 21st contract convexity is around 15bp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is possible the question is about swap futures, which deal over the futures dates, and which are therefore forward starting. As these are also futures, and deliver margin payments, there is a convexity adjustment to be made as per 3m futures.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2013-04-26T09:10:46.743" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7841" PostTypeId="1" CreationDate="2013-04-26T11:05:32.553" Score="12" ViewCount="8940" Body="&lt;p&gt;I am looking at two different ways of estimating the expected / implied dividends from market data. &lt;/p&gt;&#xA;&#xA;&lt;h3&gt;1. Dividend futures&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;I know that this asset class is not very liquid and might not be representative enough. However, assuming that I have prices which are good enough, how could I estimate the implied divided from the contract price?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, if I have an exchange traded contract whose settlement is the sum of actual dividends paid during 2013, could I just take the current contract price and capitalize it up to the settlement date in order to obtain the implied dividend for 2013?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; Example added for illustration purposes: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On 05 july 2013, the quoted prices for Santander Dividend Futures are: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;2013 contract; Maturity 20 Dec 2013; Price:  0.58&lt;/li&gt;&#xA;&lt;li&gt;2014 contract; Maturity 19 Dec 2014; Price:  0.41&lt;/li&gt;&#xA;&lt;li&gt;2015 contract; Maturity 18 Dec 2015; Price:  0.32&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For simplicity assume that: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Each contract is linked to the sum of all dividends paid during the corresponding calendar year.&lt;/li&gt;&#xA;&lt;li&gt;Appropriate risk free rates for each contract are:  0,1%; 0,3%; 0,5%.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If I want to estimate the total amount of implied dividends for each year, could these figures be obtained as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;D_{2013}=0.58e^{(0,001*0.46)}=0.5802  &#xA;$$&#xA;$$&#xA;D_{2014}=0.41e^{(0,003*1.46)}=0.4118 &#xA;$$&#xA;$$&#xA;D_{2015}=0.32e^{(0,005*2.45)}=0.3240  &#xA;$$&#xA;Or am I missing something?&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;2. Index / single-stock futures&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Alternatively, if I wanted to estimate the dividend yield for a stock, what are the limitations of calculating the implied yield directly from the market prices as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;F=S_0e^{(r-q)T}   \; \; \; \; \; \Rightarrow \; \; \; \; \;   q = \frac{rT-\ln{\frac{F}{S_0}}}{T} &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess there must be certain shortcomings with this aprroach, since usually the synthetic forward is obtained through the put-call parity instead of using the futures prices. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="5208" LastEditorUserId="5208" LastEditDate="2013-12-12T10:29:23.223" LastActivityDate="2013-12-12T10:29:23.223" Title="Implied dividend estimation" Tags="&lt;options&gt;&lt;arbitrage&gt;&lt;futures&gt;&lt;dividends&gt;&lt;discrete-dividends&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7843" PostTypeId="2" ParentId="7841" CreationDate="2013-04-26T13:30:51.177" Score="6" Body="&lt;p&gt;You could compute index dividend yield from ATM options using linearized put-call parity (assuming index options are European.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The present value of the dividend payment is:&#xA;$PV(div) = P - C + (S - K) + K(e^{rT} - 1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $r$ is interest rate to the option expiration and $T$ is time to maturity in years. Then the implied dividend is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d = \frac{PV(div)}{T*S}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I realize it's not a complete answer, but it's a starting point.&#xA;Note: whether using futures or options, the implied dividend value would represent the portion paid until the contract expiry.&lt;/p&gt;&#xA;" OwnerUserId="2909" LastEditorUserId="2909" LastEditDate="2013-04-26T13:40:02.073" LastActivityDate="2013-04-26T13:40:02.073" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7844" PostTypeId="2" ParentId="7777" CreationDate="2013-04-26T13:59:20.157" Score="0" Body="&lt;p&gt;If you load the table above into any RDBMS that supports SQL, the query you could use would be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;SELECT DISTINCT A.OptionID AS CallID, B.OptionID AS PutID&#xA;FROM OPTION_PRICE A JOIN OPTION_PRICE B&#xA;ON A.Strike = B.Strike AND&#xA;A.Expiration = B.Expiration AND&#xA;A.Date = B.Date AND&#xA;A.SecurityID = B.SecurityID&#xA;WHERE A.CallPut = 'C' AND B.CallPut = 'P'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This maps call option IDs to put option IDs.&lt;/p&gt;&#xA;" OwnerUserId="2909" LastEditorUserId="35" LastEditDate="2013-04-26T14:20:40.950" LastActivityDate="2013-04-26T14:20:40.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7845" PostTypeId="1" CreationDate="2013-04-26T14:40:17.560" Score="3" ViewCount="84" Body="&lt;p&gt;How should one order (sequence) the following tests? &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Stationarity test&lt;/li&gt;&#xA;&lt;li&gt;Johansen cointegration test&lt;/li&gt;&#xA;&lt;li&gt;Normality/Histogram test&lt;/li&gt;&#xA;&lt;li&gt;Autocorrelation test&lt;/li&gt;&#xA;&lt;li&gt;Heteroskedasticity test&lt;/li&gt;&#xA;&lt;li&gt;Multicollinearity test &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Or, does the sequence not matter?&lt;/p&gt;&#xA;" OwnerUserId="5209" LastEditorUserId="5149" LastEditDate="2013-04-26T15:11:02.227" LastActivityDate="2013-04-27T11:08:33.997" Title="Is there an appropriate sequence to tests during model diagnosis?" Tags="&lt;time-series&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7846" PostTypeId="1" CreationDate="2013-04-26T14:46:01.143" Score="1" ViewCount="170" Body="&lt;p&gt;How does one use the Johansen cointegration test in a linear time series model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should I only use normalized coeffients for interpretation? Or, once I know that the variables are cointegrated, do I simply regress the variables and consider it the long-run relationship?&lt;/p&gt;&#xA;" OwnerUserId="5209" LastEditorUserId="5149" LastEditDate="2013-04-26T15:23:52.560" LastActivityDate="2013-04-26T20:07:37.990" Title="How does one use the Johansen cointegration test in a linear time series model?" Tags="&lt;time-series&gt;&lt;time&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7847" PostTypeId="1" CreationDate="2013-04-26T15:39:44.713" Score="3" ViewCount="312" Body="&lt;p&gt;If stock returns ($r_t$) are not auto correlated why is that the squared term of the returns (volatility) exhibit serial correlation? Does heteroskedacity, by its nature, imply that time varying volatility is autocorrelated and therefore volatility today is influenced by its lagged values?&lt;/p&gt;&#xA;" OwnerUserId="4729" LastEditorUserId="848" LastEditDate="2013-04-26T16:30:04.647" LastActivityDate="2013-04-28T15:25:52.887" Title="Time Varying Volatility" Tags="&lt;volatility&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7848" PostTypeId="2" ParentId="7847" CreationDate="2013-04-26T15:51:13.940" Score="3" Body="&lt;p&gt;To your first question: The first and the second moment are independent, so even if returns are not autocorrelated the size of returns can be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To your second question: Autocorrelated volatility implies volatility not being constant but varying, which is heteroscedasticity or volatility clustering.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2013-04-28T15:25:52.887" LastActivityDate="2013-04-28T15:25:52.887" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7849" PostTypeId="1" CreationDate="2013-04-26T17:11:47.153" Score="4" ViewCount="439" Body="&lt;p&gt;I am wondering about the distribution of the error term/innovation process in a ARCH/GARCH process and its implementation, I am not sure about some points. The basic assumption is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_t=\sigma_t*\epsilon_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the $\sigma_t$ is the volatility, modeled by ARCH/GARCH and the $\epsilon_t$ are mostly assumed to be N(0,1).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now my questions are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;More sophisticated models drop this assumption. So I can say, e.g. $\epsilon_t$ follows a generalized hyperbolic distribution. So the mean does not need to be zero and the variance does not need to be equal to 1. This is correct, right?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If I use the &lt;a href=&quot;http://cran.r-project.org/web/packages/rugarch/vignettes/Introduction_to_the_rugarch_package.pdf&quot; rel=&quot;nofollow&quot;&gt;rugarch package&lt;/a&gt;: It supports different distributional assumptions. But I am not getting the following: So they also drop the assumption of mean zero and variance one? Or are they using something like a &quot;standardized&quot; version?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Suppose I want to fit a GARCH(1,1) assuming, that the $\epsilon_t$ follow a generalized hyperbolic distribution, but the mean does not have to be zero and the variance does not need to be one. Is rugarch doing a jointly parameter estimation? So in my final output, do I get the parameters of the GARCH process and the parameters of my generalized hyperbolic distribution?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;My last question is, how can I implement this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess I have to use the following command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ugarchspec(variance.model = list(model = &quot;sGARCH&quot;, garchOrder = c(1, 1), &#xA;submodel = NULL, external.regressors = NULL, variance.targeting = FALSE), &#xA;mean.model = list(armaOrder = c(1, 1), include.mean = TRUE, archm = FALSE, &#xA;archpow = 1, arfima = FALSE, external.regressors = NULL, archex = FALSE), &#xA;distribution.model = &quot;norm&quot;, start.pars = list(), fixed.pars = list(), ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the distribution.model has to be set to &lt;code&gt;ghyp&lt;/code&gt;. Is this assuming a mean of zero and a variance of one? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think no, right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I use the hyperbolic distribution for distribution.model?&lt;/p&gt;&#xA;" OwnerUserId="5078" LastActivityDate="2016-02-26T18:15:30.167" Title="Error term/Innovation process in ARCH/GARCH processes?" Tags="&lt;r&gt;&lt;garch&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7850" PostTypeId="2" ParentId="7808" CreationDate="2013-04-26T18:28:34.827" Score="3" Body="&lt;p&gt;Given an index $t \mapsto S(t)$ (this may be a forward swap rate) and some value process $t \mapsto A(t)$ (this may be a swap annuity) we assume that $S/A$ is a traded product (which is true if $S$ is the forward swap rate and A is the &lt;em&gt;corresponding&lt;/em&gt; (!) swap annuity. Then the future payoff $S(T) \cdot A(T)$ can be values as $S(t) \cdot A(t)$ (since $S$ is a martingale under the measure $Q^A$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if we consider the payoff $S(T) \cdot P(T)$ (say for example if $P$ is the zero coupon bond with maturity $T$) then the value can be expressed as $S'(t) \cdot P(t)$ where $S'(t)$ is the so called convexity adjusted rate, that is $S'(t) = E(S(T) \cdot \frac{P(T)/P(t)}{A(T)/A(t)})$ (with expectation under $Q^A$). The convexity adjustment is a correlation term coming from the correlation of the index to the change of the payment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said: If you need a convexity adjustment depends on how the index is paid.&lt;/p&gt;&#xA;" OwnerUserId="3548" LastActivityDate="2013-04-26T18:28:34.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7851" PostTypeId="2" ParentId="7847" CreationDate="2013-04-26T19:57:33.190" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;The first and the second moment are independent, so even if returns&#xA;  are not autocorrelated the size of returns can be.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;of course. Example: generate path of variable with binomial distribution that takes value of 1 or -1, that is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sum_{i=1}^n{} x_i,x_i=\{1,-1\}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;now you can generate another path $\sum_{i=1}^n{} x'_i,x'_i=\{1,-1\}$ choosing values of  $x'$ with freedom, and this way paths will be correlated or not, and squares of it will be correlated all the time, as two constant series of 1,1,1,...,1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;regarding you second question&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Does Autocorrelation imply Heteroskedacity?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;No. These are two independent concepts. When you take matrix of varince-covariance of time series homoscedasticity is related to the elements on a diagonal, still with assumption that pairwise coefficients are 0. If they are not 0 then there is autocorrelation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://aiolos.um.savba.sk/~viktor/Econ/Chapter6.pdf&quot; rel=&quot;nofollow&quot;&gt;see here for details on this &lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2017" LastEditorUserId="2017" LastEditDate="2013-04-26T20:26:07.803" LastActivityDate="2013-04-26T20:26:07.803" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7852" PostTypeId="2" ParentId="7846" CreationDate="2013-04-26T20:07:37.990" Score="1" Body="&lt;p&gt;no, you should use your original variables, no truncating, normalizing or whatever. And remember that you need Johansen only in case of more than one independent variable.&lt;/p&gt;&#xA;" OwnerUserId="2017" LastActivityDate="2013-04-26T20:07:37.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7854" PostTypeId="1" AcceptedAnswerId="7859" CreationDate="2013-04-27T01:05:12.930" Score="4" ViewCount="1549" Body="&lt;p&gt;Is there any unit of measure for the magnitude of the contango (or backwardation) for futures, so you can compare the contango of many symbols.&lt;/p&gt;&#xA;" OwnerUserId="2257" LastActivityDate="2017-08-03T07:00:54.467" Title="How to measure contango?" Tags="&lt;derivatives&gt;&lt;futures&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7855" PostTypeId="1" CreationDate="2013-04-27T07:11:51.467" Score="2" ViewCount="100" Body="&lt;p&gt;I'm not very fluent in the quant vernacular, so perhaps the nature of my question will be better illustrated as a hypothesis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One market has closed and another market elsewhere on Spaceship Earth is opening. For example, the Nikkei opens at 7pm Eastern time, a few hours after NYSE has closed. Let's hypothesize that there's a higher demand for JPY from USD holders during this interval than any other interval during the day, and consequently there is a greater probability of profiting from a buy &amp;amp; sell of JPY during this interval than other intra-day interval.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What kind of statistical analysis would you do to test this hypothesis?&lt;/p&gt;&#xA;" OwnerUserId="5214" LastActivityDate="2013-04-27T07:11:51.467" Title="How to measure if variance is greater at a certain time of day?" Tags="&lt;volatility&gt;&lt;fx&gt;&lt;variance&gt;&lt;intraday&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7859" PostTypeId="2" ParentId="7854" CreationDate="2013-04-27T21:25:14.157" Score="8" Body="&lt;p&gt;Just take something like&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{\log{\frac{F_j}{F_i}}}{t_j - t_i} \times 365&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $t_i$ denotes the expiry (or alternatively delivery) date of future $i$. The annualization is so you can compare different futures.&lt;/p&gt;&#xA;" OwnerUserId="5218" LastEditorUserId="924" LastEditDate="2017-08-03T07:00:54.467" LastActivityDate="2017-08-03T07:00:54.467" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7860" PostTypeId="1" CreationDate="2013-04-27T23:51:17.100" Score="5" ViewCount="1862" Body="&lt;p&gt;What methods can be applied to determine the volatility of strategy using a rolling window? Using normal standard deviation would bias the results as the returns will be highly correlated. Although, after reading several papers where a rolling window is applied, I've not seen one mention anything about it. Is it because it is not necessary or is it &quot;too simple&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By rolling window I simply mean that, for instance, the the strategy is tested over a 6 month period, then rolled forward 1 month and from there tested over a 6 month period, etc.&lt;/p&gt;&#xA;" OwnerUserId="4709" LastActivityDate="2015-04-30T22:23:30.243" Title="Volatility of a rolling window strategy" Tags="&lt;volatility&gt;&lt;backtesting&gt;&lt;returns&gt;" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7862" PostTypeId="1" CreationDate="2013-04-28T09:33:10.290" Score="5" ViewCount="602" Body="&lt;p&gt;I have a matrix of 259 weekly returns, 50 assets and a portfolio composition for each of the 259 weeks. I would like to test the performance of the portfolio during 52 weeks, rebalancing every 12 weeks also taking into account fees for each rebalancing, etc. I would choose 50 dates randomly, perform the test each date, store results and finally average them. Is there any way of doing this in R?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;n=50&#xA;d=52*5-1 #multiple of 7&#xA;w=16&#xA;ns=50&#xA;returns=xts(matrix(rnorm(n*d,0,0.01),d,n),Sys.Date()-seq(d*7,1,by=-7))&#xA;A=c(rep(1/w,w),rep(0,n-w))&#xA;weights=xts(t(replicate(d,sample(A,n))),Sys.Date()-seq(d*7,1,by=-7))&#xA;dates.v=as.Date(replicate(ns,sample(index(returns),1)))&#xA;for (i in 1:ns) {&#xA;  while (dates.v[i]+52*7&amp;gt;max(index(returns))) {dates.v[i]=sample(index(returns),1)} #this is to ensure that we always use one entire year&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I already had a look to the fPortfolio, backtest and PortfolioSim packages but haven't found a similar example so don't know whether is possible or not.&lt;/p&gt;&#xA;" OwnerUserId="3451" LastActivityDate="2014-02-08T14:47:32.523" Title="analyze strategy performance with given matrix of weights/time and weekly returns in R" Tags="&lt;backtesting&gt;&lt;r&gt;&lt;portfolio&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7863" PostTypeId="2" ParentId="7808" CreationDate="2013-04-28T13:04:37.363" Score="3" Body="&lt;p&gt;Most likely the question is about CMS rate convexity adjustment. i.e. today value of a swap rate that fixes at some future time T. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mathematically, the adjustment arises from different measures (annuity versus forward measure). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a good reference &lt;a href=&quot;http://www.math.nyu.edu/~alberts/spring07/Lecture4.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.math.nyu.edu/~alberts/spring07/Lecture4.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a rule of thumb, the size of the adjustment depends on &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;CMS maturity&lt;/li&gt;&#xA;&lt;li&gt;Level of vol&lt;/li&gt;&#xA;&lt;li&gt;skew&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For the latter the classical reference is &lt;a href=&quot;http://www.gorillasci.com/documents/convexity.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.gorillasci.com/documents/convexity.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5223" LastEditorUserId="35" LastEditDate="2013-04-28T15:42:17.773" LastActivityDate="2013-04-28T15:42:17.773" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7865" PostTypeId="1" CreationDate="2013-04-28T19:21:53.923" Score="3" ViewCount="1490" Body="&lt;p&gt;I'm trying to implement cointegration tests using the R urca package. I've figured out the Johansen test (ca.jo), but I'm having trouble with the Philips-Ouliaris test (ca.po). I have two questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;How do I interpret the results?&lt;/li&gt;&#xA;&lt;li&gt;How do I get the cointegrating vectors (the B matrix)?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I understand how the test itself works, but I find the ca.po routine confusing. To give an example: First, I create a bivariate time series with a known cointegrating relation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; x = cumsum(rnorm(100,1))&#xA;&amp;gt; y = -1*x + rnorm(n=100,mean=.1,sd=.1)&#xA;&amp;gt; z = zoo(cbind(x,y))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this case, the cointegrating vector, &lt;code&gt;B&lt;/code&gt;, should be close to &lt;code&gt;[1,1]&lt;/code&gt;. I run the test and, as expected, get a significant test statistic:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; a = ca.po(z, lag='long', demean='none', type='Pz')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The test statistic is 165.8306 and the 1% critical value is 55.1911. Good news. However, when I inspect the test object, I have trouble finding the cointegrating vector. Shouldn't it be in the &lt;code&gt;a@testreg&lt;/code&gt; slot? Here is what I find:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; a@testreg&#xA;Response x :&#xA;&#xA;Call:&#xA;lm(formula = x ~ zr - 1)&#xA;&#xA;Residuals:&#xA;Min      1Q  Median      3Q     Max &#xA;-1.8083 -0.4643  0.2463  0.9273  2.5340 &#xA;&#xA;Coefficients:&#xA;Estimate Std. Error t value Pr(&amp;gt;|t|)  &#xA;zrx   1.6255     0.9331   1.742   0.0847 .&#xA;zry   0.6111     0.9342   0.654   0.5146  &#xA;&#xA;Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 &#xA;&#xA;Residual standard error: 1.059 on 97 degrees of freedom&#xA;Multiple R-squared: 0.9998, Adjusted R-squared: 0.9998 &#xA;F-statistic: 2e+05 on 2 and 97 DF,  p-value: &amp;lt; 2.2e-16&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is also another regression with &lt;code&gt;y&lt;/code&gt; on the left-hand side. Anyway, I am wondering what &lt;code&gt;zrx&lt;/code&gt; and &lt;code&gt;zry&lt;/code&gt; correspond to? Are they elements of a vector &lt;code&gt;zr&lt;/code&gt;? I thought that the regression should only include &lt;code&gt;B2&lt;/code&gt;, and my cointegrating vector would be &lt;code&gt;[1, -B2]&lt;/code&gt;. Also, it is clear that these values do not really correspond to the true cointegrating vector &lt;code&gt;[1,1]&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I run the same cointegration test using ca.jo, I get &lt;code&gt;B&lt;/code&gt; = &lt;code&gt;[1,1]&lt;/code&gt; without any trouble. Therefore, I am wondering how to interpret this ca.po test? Finally, I also was wondering how to access elements of the test regression in the ca.po object? For example,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; names(a@testreg)&#xA;&#xA;    [1] &quot;Response x&quot; &quot;Response y&quot;&#xA;&#xA;&amp;gt; attributes(a@testreg)&#xA;&#xA;    $names&#xA;    [1] &quot;Response x&quot; &quot;Response y&quot;&#xA;&#xA;    $class&#xA;    [1] &quot;listof&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So it's a little confusing. Anyway, thanks for the help! I really appreciate it!&lt;/p&gt;&#xA;" OwnerUserId="5224" LastEditorUserId="5149" LastEditDate="2013-05-04T06:01:22.693" LastActivityDate="2013-05-04T06:01:22.693" Title="Philips-Ouliaris test for cointegration" Tags="&lt;r&gt;&lt;finance&gt;&lt;cointegration&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7866" PostTypeId="1" CreationDate="2013-04-29T07:54:46.013" Score="3" ViewCount="3713" Body="&lt;p&gt;I am wondering if there exists a Black Scholes pricing formula for a collar option?&lt;/p&gt;&#xA;" OwnerUserId="5227" LastActivityDate="2013-04-29T13:38:11.137" Title="Black Scholes Formula for Collar Option" Tags="&lt;black-scholes&gt;" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7867" PostTypeId="2" ParentId="7866" CreationDate="2013-04-29T09:30:19.180" Score="3" Body="&lt;p&gt;Your question lacks a bit of background to make sure that you are using the right terminology.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short, you buy an interest rate &lt;strong&gt;collar&lt;/strong&gt; to hedge exposure in rates when they get out of a zone. As you can see on the wiki &lt;a href=&quot;http://en.wikipedia.org/wiki/Interest_rate_cap_and_floor&quot; rel=&quot;nofollow&quot;&gt;page&lt;/a&gt; when you buy a collar, you essentially:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Buy an interest rate cap with strike price $K_c$&lt;/li&gt;&#xA;&lt;li&gt;Sell an interest rate floor with strike price $K_f$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;with the same underlying rate and maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a result, you make a profit when $r&amp;gt;K_c$ and and loss when $r&amp;lt;K_f$. Hence, if you have a short exposure to rates (i.e. you are willing them to go &lt;em&gt;down&lt;/em&gt;, for example if you own a bond) then you are giving away any profit beyond $K_f$ and getting insurance against any loss beyond $K_c$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, the value of your collar is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$v_\text{collar}= v_\text{cap} - v_\text{floor}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can price both the cap and the floor using Black's &lt;a href=&quot;http://en.wikipedia.org/wiki/Black_model&quot; rel=&quot;nofollow&quot;&gt;formula&lt;/a&gt;, and you get the value of the collar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that you can take the exact same opposite position which is then called a &lt;strong&gt;reverse collar&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2013-04-29T09:30:19.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7868" PostTypeId="1" CreationDate="2013-04-29T11:00:55.997" Score="9" ViewCount="18350" Body="&lt;p&gt;Can anyone give me a few pointers of how to approach using PCA for trading? In particular, it seems to me, PCA is useful for selecting a subset of a portfolio of stocks(or other) rather than trading every stock. BUT I wonder if it can also add value when trading a single stock? Can PCA be somehow applied to other inputs that might effect the stock price - perhaps technical indicators?&lt;/p&gt;&#xA;" OwnerUserId="4603" LastActivityDate="2013-04-29T13:27:14.780" Title="How to use PCA for trading" Tags="&lt;trading&gt;&lt;pca&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7870" PostTypeId="2" ParentId="1908" CreationDate="2013-04-29T12:04:04.993" Score="3" Body="&lt;p&gt;Yep, there is one and it's leagues better than jquantlib.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://code.google.com/p/maygard/&quot; rel=&quot;nofollow&quot;&gt;https://code.google.com/p/maygard/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5230" LastActivityDate="2013-04-29T12:04:04.993" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7871" PostTypeId="2" ParentId="3284" CreationDate="2013-04-29T12:15:05.633" Score="9" Body="&lt;p&gt;Don't use eoddata unless you absolutely have to.  I purchased long history of global index and forex prices.  There are hundreds and hundreds of incorrectly missing or completely wrong prices.  For example (big problem with forex), the price is coming along in the 10s, then spkes up to the 1000's for a few days before dropping back down.  Repeat over and over again.  The worst is when it's the opposite; should be 1s, but incorrectly recorded as .01s - not nough decimals to rescale. This is an obviously stupid error, especially since they claim&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;i&gt;EODData runs a number of computers that scan the data 24x7 to find anomalies and correct the prices that are clearly wrong. We also compare our data against other sources to double check whether we have the right figures. As a final measure we have staff who spend all day finding and correcting data problems&lt;/i&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How about FOREX tickers where suddenly there are no prices for several months?  This is also relatively common in their data.  One of them goes AWOL for 3 years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, repeated attempts to get them to fix the data, after I have already spent hours and hours identifying &amp;amp; fixing what I can are less than successful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most recent response from support:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Sorry but we no long have the resources available to correct the errors you have mentioned.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Can we say false advertising?&lt;/p&gt;&#xA;" OwnerUserId="5231" LastEditorUserId="5231" LastEditDate="2013-04-30T06:19:44.577" LastActivityDate="2013-04-30T06:19:44.577" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7872" PostTypeId="2" ParentId="7868" CreationDate="2013-04-29T13:16:39.770" Score="9" Body="&lt;p&gt;To answer your questions we have to take a look to what it does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PCA is mathematically defined as an orthogonal linear transformation that transforms the data to a new coordinate system, such that news vectors are orthogonals and explain the main part of the variance of the first set.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It took an N x M matrice as input, N represents the differents repetition of the experiment and M the results of a particular probe. It will give you directions (or principal components) which explain the variance of your dataset. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it all depends on what you input to your PCA. I use PCA to look at market correlation, so I input M prices over N times. You can input differents measure (greeks, futures ...) of a single stocks to take a look at its dynamics. My use will give the correlation of a stock price with the market, known as beta, the other use will give correlation between different technical indicators of a stock. And well I guess you can get some interesting results with differents indicators over differents stocks... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't forget about pre-processing. As you can see here: &lt;a href=&quot;https://quant.stackexchange.com/questions/7650/data-synchronization&quot;&gt;Data Synchronization&lt;/a&gt; there is some tricky problems with market datas. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It also depends on what you do with your results. You can use some criterion to remove components with little variance to reduce the dimension of your dataset. This is the usual &quot;goal&quot; of PCA. It give you a reduced number of stock to build a portfolio, to estimate profit/risk curves... But you can also do more complex post treatment. Here: &lt;a href=&quot;http://th-www.if.uj.edu.pl/acta/vol36/pdf/v36p2767.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://th-www.if.uj.edu.pl/acta/vol36/pdf/v36p2767.pdf&lt;/a&gt; you can see an use of PCA combined with random matrix theory to remove the noise of the market. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;PCA is a tool, a very powerfull tool, but just a tool. Your results will depends on how you use it. The risk is to use it too much. You know what they said, if you have a hammer every problem looks like a nail.&lt;/p&gt;&#xA;" OwnerUserId="5052" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2013-04-29T13:22:03.713" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7873" PostTypeId="2" ParentId="7868" CreationDate="2013-04-29T13:27:14.780" Score="0" Body="&lt;p&gt;As I explained in this &lt;a href=&quot;https://quant.stackexchange.com/a/4628/467&quot;&gt;post&lt;/a&gt;, PCA is a &lt;strong&gt;dimension reduction method&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no way to use it to determine intrinsic values of a stock, and hence it is not used directly for trading...&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2013-04-29T13:27:14.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7874" PostTypeId="2" ParentId="7866" CreationDate="2013-04-29T13:38:11.137" Score="4" Body="&lt;p&gt;SRXX has talked about Intrest Rate Collar. Since it is not clear if you are looking for IR or equity here is my explaination of equity Collar &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equity Collar :-&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Structure &#xA;:- Buy Underlying Asset (e.g. Stock) and Buy an out of money put and write out of money call&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Payoff daigram&#xA;&lt;img src=&quot;https://i.stack.imgur.com/8ynYg.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Replication  &lt;strong&gt;COLLAR = long stock + long put (K1) + short call (K2)&lt;/strong&gt;  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/kIW9I.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see the Max gain / Loss is limited which the objective here&lt;/p&gt;&#xA;&#xA;&lt;p&gt;HTH&lt;/p&gt;&#xA;" OwnerUserId="1386" LastActivityDate="2013-04-29T13:38:11.137" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7876" PostTypeId="1" CreationDate="2013-04-29T20:30:08.817" Score="3" ViewCount="34991" Body="&lt;p&gt;I have derived a firm's cost of equity using the WACC formula (see &lt;a href=&quot;https://quant.stackexchange.com/q/7875/5233&quot;&gt;here&lt;/a&gt;), which means that the cost of equity has factored in the firms' debt (i.e. levered beta) and now I need to calculate the firm's unlevered beta. Here is my solution thus far, please let me know if I am on the right track.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Formula to calculate unlevered beta:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;βL = βU + [1 + (1 - t)(d/e)]&#xA;&#xA;Where:&#xA;βL = the firm's beta with leverage = 1.5&#xA;βU = the firm's beta with no leverage&#xA;t = the corporate tax rate = 40%&#xA;d/e = the firms debt/equity ratio = 35/65&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Calculations&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1.1 = βU + [1 + (1 - 0.40)(35/65)]&#xA;1.1 = βU + [1 + (0.6)(0.538461538461538)]&#xA;1.1 = βU + [1 + (0.6)(0.538461538461538)]&#xA;1.1 = βU + 1.323077&#xA;βU = 1.323077 - 1.1&#xA;βU = 0.223077&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;UPDATE&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I had some errors above, which were pointed out in the answer below. Here is the updated question (which I think is now correct).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Revised Formula to calculate unlevered beta:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;βU = βL * [1 / (1 + (1 - t)(d/e))]&#xA;&#xA;Where:&#xA;βL = the firm's beta with leverage = 1.5&#xA;βU = the firm's beta with no leverage&#xA;t = the corporate tax rate = 40%&#xA;d/e = the firms debt/equity ratio = 35/65&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Revised Calculations&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;βU = 1.5 * [1 / (1 + (1 - 0.40)(35/65)) ]&#xA;βU = 1.5 * [1 / 1.323077]&#xA;βU = 1.5 * 0.755814&#xA;βU = 1.133721&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5233" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-10-14T15:20:09.107" Title="How to calculate unlevered beta" Tags="&lt;beta&gt;&lt;capm&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7877" PostTypeId="2" ParentId="7876" CreationDate="2013-04-29T20:55:41.683" Score="1" Body="&lt;p&gt;Your formula is adding where you should be multiplying, and you plugged your inputs into the wrong places (your levered Beta notably).  In any case, the process for un-levering/re-levering the beta goes like so:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Step 1:  Find benchmark company/asset/project Beta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Step 2:  Un-lever the benchmark Beta:     Unlevered Beta = Levered Beta * (1 / ( 1 + (1 - t)*D/E))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Step 3:  Re-lever the beta with your company/projects D/E Ratio:   Un-levered Beta * (1 + (1-t)*D/E)&lt;/p&gt;&#xA;" OwnerUserId="2732" LastEditorUserId="5149" LastEditDate="2013-04-29T20:57:25.677" LastActivityDate="2013-04-29T20:57:25.677" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7880" PostTypeId="1" CreationDate="2013-04-30T12:32:23.337" Score="7" ViewCount="9051" Body="&lt;p&gt;I have two interrelated questions that have been bothering me for some time. I have read all the stuff online and it still doesn't make sense to me:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us assume:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;0% interest rate (both hedge funding and discounting rate)&lt;/li&gt;&#xA;&lt;li&gt;0% dividends&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Hence, Forward=Spot.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Why is the price of a &lt;em&gt;ATM put&lt;/em&gt; equal to the price of a &lt;em&gt;ATM call&lt;/em&gt;? What is happening to the log-normal distribution here, shouldn't the call be more expensive? (two 50% increases lead to a greater payoff(225% Spot) than 2 50% decreases (25% Spot).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Very related.. why is then a 110% Call Option worth more than a 90% Put option (under the same conditions as above)?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5239" LastEditorUserId="467" LastEditDate="2013-04-30T15:50:14.400" LastActivityDate="2015-04-06T07:35:58.173" Title="Call vs. Put Option" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;put-call-parity&gt;" AnswerCount="6" CommentCount="5" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7881" PostTypeId="2" ParentId="7880" CreationDate="2013-04-30T12:39:04.693" Score="7" Body="&lt;p&gt;The &lt;strong&gt;put call parity&lt;/strong&gt; is given as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$c_t-p_t = S_t - \frac{X}{e^{r(T-t)}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you assume $r=0$, you get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$c_t-p_t = S_t - X$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, $c_t \neq p_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rationale behind it is much more financial than mathematical. You have to look at the payoff on both side of the equation, and you see that both portfolio will give the same payoff  at time $T$ (the expiration of the options). So they &lt;strong&gt;have to have the same price today&lt;/strong&gt; otherwise there is an obvious arbitrage opportunity. &lt;strong&gt;It holds for any model&lt;/strong&gt; you assume for the process $S$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that because it is independent of the model, the fact that for ATM option $c_t = p_t$ if $r=0$ &lt;em&gt;does not tell you &lt;strong&gt;anything&lt;/strong&gt; about the price of the options&lt;/em&gt;. They could be worth thousands or 0, they just have to be equal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume for a minute they're not equal: $c_t=2$ and $p_t=1$ and $S_t=100$. Then I can sell the call, buy the put, buy the stock by borrowing 100 (with no cost). So I know that I got 2 from the call, paid for the put so I have the stock plus 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At maturity, if the stock went up, the put I have is worth 0, the call I sold will force me to give away the stock for 100 which I will give back as I borrowed them... But I made a profit of 1 over the operation. If the stock does not move, both option are worth 0 at time $T$, so I can sell my stock for 100 and pay back the loan, and made a profit of 1. If the stock went down, the call payoff is 0, I can sell the stock at 100 because I own the put, and use the 100 to repay the loan, making a profit of 1. So in any case, I make profit of 1, it's an arbitrage opportunity.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2013-04-30T21:52:42.343" LastActivityDate="2013-04-30T21:52:42.343" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7882" PostTypeId="1" CreationDate="2013-04-30T14:33:01.997" Score="13" ViewCount="2271" Body="&lt;p&gt;What are the best methods to extrapolate bond yields from an existing curve that doesn't extend quite this far?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, how would one come about finding a theoretical bond yield for a 40 or 50 year US Treasury Bond, when no bond exists of a maturity of much more than 30 years? I guess you could remove credit risk from corporate ultra-long bonds, but this might prove difficult.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I explored using curve fitting models such as Nelson-Siegel and Svensson, but the results are a little unsatisfactory and highly volatile, with theoretical yields at the 50 year mark varying by as more than 50bps depending on the date at which the curve is calculated (over a short time frame).&lt;/p&gt;&#xA;" OwnerUserId="5120" LastActivityDate="2013-07-30T20:46:05.057" Title="Bond curve extrapolation" Tags="&lt;yield-curve&gt;&lt;curve-fitting&gt;&lt;extrapolation&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7883" PostTypeId="2" ParentId="7880" CreationDate="2013-04-30T14:33:54.897" Score="0" Body="&lt;p&gt;As SRKX mentioned the price relation between the Put and Call (with equal strikes) follows from the Put-Call parity. The whole point behind Put-Call parity is that it does not depend on the underlying distribution which describes your stock price. Put-Call parity is consequence of no arbitrage. It makes no reference to whatever model you are using to describe your stocks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the prices of the Put and Call do not satisfy Put-Call parity then you automatically have an arbitrage opportunity.&lt;/p&gt;&#xA;" OwnerUserId="3371" LastActivityDate="2013-04-30T14:33:54.897" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7884" PostTypeId="2" ParentId="7880" CreationDate="2013-04-30T15:07:24.487" Score="7" Body="&lt;p&gt;A simple intuitive answer why the OTM Call is more expensive than the OTM Put is because of the skewness of the log-normal distribution. Think about it, what is the probability that the stock price is above 110 at expiration and what is the probability it is below 90? This should answer your question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Written in probability terms:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The median of the distribution of future stock prices is $S(t) e^{r-\frac{1}{2}\sigma^2} \sim S(t)$  (for reasonable and realistic $\sigma^2$ )&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$P(S(T)&amp;gt; 110) \sim 1/2 - P(100&amp;lt;S(T)&amp;lt;110)$ which is the probability that the call finishes in the money. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$P(S(T)&amp;lt;90) \sim 1/2-P(90&amp;lt;S(T)&amp;lt;100)$ which is the probability that the put finishes in the money&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The distribution is skewed so that $P(90&amp;lt;S(T)&amp;lt;100) &amp;gt; P(100&amp;lt;S(T)&amp;lt;110)$ which follows from the fact that the probability density function at the median is downward sloping.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Thus, $P(S(T)&amp;gt;110) &amp;gt;&amp;gt; P(S(T)&amp;lt;90)$ -&gt; call price &gt; put price&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This is not a rigorous proof but you asked for a qualitative answer.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="254" LastEditDate="2013-05-03T13:43:14.837" LastActivityDate="2013-05-03T13:43:14.837" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="7885" PostTypeId="2" ParentId="7065" CreationDate="2013-04-30T18:59:30.953" Score="2" Body="&lt;p&gt;Definitely check out &lt;strong&gt;&lt;a href=&quot;http://www.scichart.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;SciChart&lt;/a&gt;&lt;/strong&gt;, which is a &lt;strong&gt;&lt;a href=&quot;http://www.scichart.com/wpf-chart-features&quot; rel=&quot;nofollow noreferrer&quot;&gt;commercial WPF stock chart control&lt;/a&gt;&lt;/strong&gt; built with financial &amp;amp; scientific users in mind. There is a review posted &lt;strong&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/3158/is-there-a-charting-api-which-allows-to-replicate-bloomberg-chart-tool-features/14303#14303&quot;&gt;here&lt;/a&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;a href=&quot;https://stackoverflow.com/a/16180699/303612&quot;&gt;here&lt;/a&gt;&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;SciChart supports &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Candlestick, OHLC&lt;/li&gt;&#xA;&lt;li&gt;Line, Step-Line&lt;/li&gt;&#xA;&lt;li&gt;Mountain, Column&lt;/li&gt;&#xA;&lt;li&gt;Scatter&lt;/li&gt;&#xA;&lt;li&gt;Band series (High Low Fill)&lt;/li&gt;&#xA;&lt;li&gt;Annotations such as line, arrow, trendline, custom buy or sell markers&lt;/li&gt;&#xA;&lt;li&gt;Composite annotations such as Fibonacci Retracement, Fib Extension&lt;/li&gt;&#xA;&lt;li&gt;Multi-paned stock charts charts / shared mouse events across charts&lt;/li&gt;&#xA;&lt;li&gt;XAxis Scrollbars for stock charts&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/cLhLS.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/cLhLS.jpg&quot; alt=&quot;WPF Chart Types provided by SciChart&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;3D Surface plots as well as 2D Charts&lt;/li&gt;&#xA;&lt;li&gt;Heatmaps&lt;/li&gt;&#xA;&lt;li&gt;Tooltips, customisation of tooltips&lt;/li&gt;&#xA;&lt;li&gt;Data-point selection &amp;amp; series click to select&lt;/li&gt;&#xA;&lt;li&gt;Legends&lt;/li&gt;&#xA;&lt;li&gt;Many many more features (too many to list here)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/NODZ3.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/NODZ3.png&quot; alt=&quot;WPF 3D Chart Types provided by SciChart&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as performance / speed goes, in tests it's the &lt;strong&gt;&lt;a href=&quot;http://www.scichart.com/wpf-chart-performance-comparison/&quot; rel=&quot;nofollow noreferrer&quot;&gt;fastest WPF Chart!&lt;/a&gt;&lt;/strong&gt;, using the same low-level bitmap rendering as you find in Windows Forms charts, and in some editions, full DirectX rendering. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is being used in &lt;strong&gt;&lt;a href=&quot;http://www.mtpredictor.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;MTPredictor v7.5&lt;/a&gt;&lt;/strong&gt; (an Elliot Wave trading platform) who have tested it in live markets with several monitors and several charts all open, all ticking simultaneously. You can see a &lt;strong&gt;&lt;a href=&quot;http://www.youtube.com/watch?feature=player_embedded&amp;amp;v=cx56-GU5_hU#!&quot; rel=&quot;nofollow noreferrer&quot;&gt;webinar of MTPredictor running SciChart here&lt;/a&gt;&lt;/strong&gt;. Note MTP run a webinar once per day and videos are all on youtube.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We had a trial user contact us with a &lt;strong&gt;&lt;a href=&quot;http://www.youtube.com/watch?v=qN699PPD484&quot; rel=&quot;nofollow noreferrer&quot;&gt;youtube demo showing scichart in real-time trading application&lt;/a&gt;&lt;/strong&gt;, in a live market with multiple ticks per second being pushed to the chart. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In our installer we have several live demos showing real-time financial charting and multi-pane financial charting. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As another poster mentioned, it is a commercial chart but we aim to provide excellent support and fix bugs in a timely manner. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Full Disclosure:&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;I am the owner and tech lead on the SciChart project&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="5240" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2016-01-26T08:10:41.800" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7886" PostTypeId="2" ParentId="7880" CreationDate="2013-05-01T00:18:26.110" Score="1" Body="&lt;p&gt;@RemusStanescu Question 2) was answered quite intuitively but incorrectly by Freddy (he'd be right if he focused on conditional expectations rather than probabilities: indeed, P(s&gt;110) &lt;strong&gt;&amp;lt;&lt;/strong&gt; P(s&amp;lt;90) assuming lognormal dynamics for the underlying stock.) This follows from its negative skewness, which is key to your question. First note that call and put prices are nothing more than conditional expectations of the stock price against the respective payoffs (this follows from their being contingent claims.) The negative skewness of the lognormal distribution, which has mean greater than its median, is such that in probabilistic terms, since the average outcome of the stock price at expiry has a less than 1/2 chance of being realized, the only way for calls to be worth more than puts for equally out of the money strikes is for the conditional expectations to weight higher values that offset the loss from probability. And that is just what occurs with the Lognormal. Thus one can say that conditional on being in the money, calls are always worth more than puts. In visual terms consider the longer right tail of the lognormal distribution, which goes off to infinity (whereas put payoffs are bounded by 0) so that higher values despite being less likely in symmetric terms, compensate the final expectation to the loss in probability mass. Remember, pricing is usually nothing more than integrating a payoff over a probability distribution of some dimension. see here:&lt;a href=&quot;http://en.wikipedia.org/wiki/File:Comparison_mean_median_mode.svg&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/File:Comparison_mean_median_mode.svg&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;SRKX does enough to answer your ATM question. see here for more:  &lt;a href=&quot;http://www.ederman.com/new/docs/qf-Illusions-dynamic.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.ederman.com/new/docs/qf-Illusions-dynamic.pdf&lt;/a&gt;&#xA;In terms of the above, ATM puts = ATM calls when S=K (r=q=0) because there is a correction of 1/2*{sigma^2} to the drift of the stock dynamics that offsets the probability that P(S&gt;K)&amp;lt;.5 when S is lognormally distributed. But this is a model dependent reason: just read the paper in the link above for the stronger, model independent reason. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&lt;strong&gt;On edit (to place all comments in one place:)&lt;/em&gt;&lt;/strong&gt;&#xA;I did not purge anything. Looks like the moderator did, and threw away all of the formulas i used to prove that if we remain in the risk neutral world, one cannot make the approximation &lt;strong&gt;*&lt;em&gt;(1)&lt;/em&gt;*&lt;/strong&gt;  $S(t) \exp^{r-\frac{\sigma^2}{2}} \sim S(t)$ without introducing arbitrage. All the probabilities in this question require the risk neutral measure which allows for the correct integration of $SN\left(d_1\right)-Ke^{-r(T-t)}N\left(d_2\right)$ where &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d_1=\frac{\ln(S/K)+\left(r+\frac{1}{2}\sigma^2\right)(T-t)}{\sigma \sqrt{T-t}}$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d_2=d_1-\sigma \sqrt{T-t}$ and $N(x)=\frac{1}{\sqrt{2 \pi}}\int_{-\infty}^x e^{-\frac{1}{2}s^2}ds$ (assuming no divs and the formula for the call price, with no loss in generality.) Notice $d_1, d_2$ are limits of integration. If one makes the approximation &lt;strong&gt;*&lt;em&gt;(1)&lt;/em&gt;*&lt;/strong&gt;, the integral evaluates so as to introduce arbitrage into the BS formula, in particular, PC parity is violated. Again, in simplest terms, just look at $N(d_2)$, which is the risk neutral probability that S&gt;k at expiry. Plug in the numbers and you'll see proof positive that in the BS framework, it is not the unconditional probability of being in the money that makes calls more expensive versus puts for symmetrically OTM strikes (in a world where there is no implied volatility skew, i.e., each strike gets the same vol), it is the expectation &lt;strong&gt;&lt;em&gt;conditional&lt;/em&gt;&lt;/strong&gt; on the terminal stock price being in the money that makes it so. Of course i've lost my breath trying to make you see this, to actually prove it to yourself, to no avail. You simply aren't thinking closely about what I'm saying. And for the love of 'i have a life', I ain't copying anything from anywhere. Why would I care to do that? I am here because I noticed your reference to the unconditional probability of being in the money is wrong in the risk neutral world, and simply found it interesting to flesh this out. In case you're wondering, my intuition was guided simply by checking the claim with the good ole, $N(d_2)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I actually pasted one of my purged comments in a notepad that is still open, so let me offer this up for further proof:The right comparison is between: $P(S(T)&amp;gt; 110) \sim 1/2 - P(median&amp;lt;S(T)&amp;lt;110)$ &amp;amp; $P(S(T)&amp;lt;90) \sim 1/2-P(90&amp;lt;S(T)&amp;lt;median)$ As soon as vol&gt;0, the median is less than the mean which means there is some substantial probability mass getting wedged between 100, the mean, and the median. If one then accounts for this, the following becomes true:  $P(median&amp;lt;S(T)&amp;lt;110)$ &lt;strong&gt;&gt;&lt;/strong&gt; $P(90&amp;lt;S(T)&amp;lt;median)$, and thus $P(S(T)&amp;lt;90)$ &lt;strong&gt;&gt;&lt;/strong&gt; $P(S(T)&amp;gt;110)$,&lt;br&gt;&#xA;and therefore we are back to step 1, trying to understand why the call is worth more than the put. It is then the reasoning based on expectation that provides the answer.&lt;/p&gt;&#xA;" OwnerUserId="5241" LastEditorUserId="5241" LastEditDate="2013-05-21T19:03:59.430" LastActivityDate="2013-05-21T19:03:59.430" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7887" PostTypeId="2" ParentId="7811" CreationDate="2013-05-01T02:26:07.373" Score="3" Body="&lt;p&gt;You can refer to Shreve's book, Volume II, Section 4.4.3 .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume that we have a generalized geometric Brownian motion&#xA;$$dX_t = \sigma_t dW_t + (\alpha_t - \frac{1}{2} \sigma_t^2) dt ,$$&#xA;where the drift coefficient and the volatility are functions of $t$ also.  $(dX_t)^2 = \sigma_t^2 dt + \mathcal{O}(dt^{3/2})$ .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume that the asset price is&#xA;$$ S_t = S_0 e^{X_t} = S_0 e^{\int_0^t \sigma_s dW_s + \int_0^t \alpha_s - \frac{1}{2} \sigma_s^2 ds} .$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $S_t = f(X_t)$ and apply Ito's lemma to $df(X_t)$.  Note that $f(x) = S_0 e^{x}$ and $\partial_x f = S_0 e^{x} = \partial^2_x f$.&#xA;$$dS_t = df(X_t) = \partial_x f(X_t) dX_t + \frac{1}{2} \partial^2_x f(X_t) dX_t^2&#xA; = \alpha_t S_0 e^{X_t} dt + \sigma_t S_t dW_t ,$$&#xA;or &#xA;$$ \frac{dS_t}{S_t} = \alpha_t dt + \sigma_t dW_t .$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, for time-varying drift $\alpha_t$ and volatility $\sigma_t$, $ S_t = S_0 \exp\left(\int_0^t \sigma_s dW_s + \int_0^t \alpha_s - \frac{1}{2} \sigma_s^2 ds \right)$ is the solution to the stochastic differential equation $\frac{dS_t}{S_t} = \alpha_t dt + \sigma_t dW_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that, if $\alpha = 0$ and $\sigma_t = \sigma$, $Z_t = \exp \left( \sigma W_t - \frac{1}{2} \sigma^2 t\right)$ is a martingale.&lt;/p&gt;&#xA;" OwnerUserId="3188" LastEditorUserId="3188" LastEditDate="2013-05-01T02:39:40.597" LastActivityDate="2013-05-01T02:39:40.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7888" PostTypeId="2" ParentId="7817" CreationDate="2013-05-01T17:33:20.943" Score="0" Body="&lt;p&gt;the convention for most market makers of options is to use calender time. it is also the convention in data one gets from options data vendors. another way to see this is that market makers will fade their bids near the close on a 'normal' friday for fear of holding inventory ahead of the weekend, since it is a crap shoot whether the pick-up in vols on Monday morning will offset the time decay from a ho-hum weekend. all this holds on average.&lt;/p&gt;&#xA;" OwnerUserId="5241" LastActivityDate="2013-05-01T17:33:20.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7889" PostTypeId="2" ParentId="7882" CreationDate="2013-05-01T19:03:28.247" Score="2" Body="&lt;p&gt;It really depends on how/where do you plan to use final values. &#xA;I would not use extrapolation since it will ignore market realities. Forward rates  across long end tend to be increasing while dumb extrapolation might give you the opposite result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case of treasuries one can use treasury and swap spread and while you do not have 50 Y treasuyy one can find quotes for 50Y swap. You can imply some dynamics of spread or keep it constant and effectively 50Y swap minus spread will be your 50Y treasury yield and than fit curve with that data point. If you have bloomberg check USBE30. &lt;/p&gt;&#xA;" OwnerUserId="5193" LastActivityDate="2013-05-01T19:03:28.247" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7891" PostTypeId="1" CreationDate="2013-05-02T11:43:43.747" Score="4" ViewCount="278" Body="&lt;p&gt;Please, consider the following functions from &lt;code&gt;RQuantLib&lt;/code&gt; package:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;FixedRateBond()&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;FixedRateBondPriceByYield()&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Is there any difference in the final output if one uses the former specifying a flat term structure, e.g. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;params &amp;lt;- list(tradeDate = as.Date(’2002-2-15’),&#xA;               settleDate = as.Date(’2002-2-19’),&#xA;               dt = .25,&#xA;               interpWhat = &quot;discount&quot;,&#xA;               interpHow = &quot;loglinear&quot;)&#xA;               setEvaluationDate(as.Date(&quot;2004-11-22&quot;))&#xA;               discountCurve.flat &amp;lt;- DiscountCurve(params, list(flat = 0.05))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;instead of the latter with &lt;code&gt;FixedRateBondPriceByYield(..., yield = 0.05, ...)&lt;/code&gt;?&#xA;(Use the same parameters at &lt;code&gt;...&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;FixedRateBondPriceByYield()&lt;/code&gt; should just return bond's clean price, while &lt;code&gt;FixedRateBond()&lt;/code&gt; can return dirty price in addition to accrued interests and cash flow tables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anything else?&lt;/p&gt;&#xA;" OwnerUserId="3058" LastActivityDate="2013-05-02T11:43:43.747" Title="RQuantLib: any difference between FixedRateBond() and FixedRateBondPriceByYield() with flat term structure?" Tags="&lt;fixed-income&gt;&lt;r&gt;&lt;yield-curve&gt;&lt;bond&gt;&lt;quantlib&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7894" PostTypeId="1" CreationDate="2013-05-02T19:34:40.650" Score="7" ViewCount="887" Body="&lt;p&gt;Suppose I have a basket of 3 securities A, B, and C. I believe that the basket is cointegrated and I want to create a mean-reverting trade. I fit the model:&#xA;$\log(A)=\beta_b*\log(B)+\beta_c*\log(C)+\alpha$ where A, B, and C are the prices of the securities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This gives me estimates of $\alpha$, $\beta_b$ and $\beta_c$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now suppose that I believe that the spread is out of line. I want to sell \$1 of A and buy \$1 of the B and C basket. How should I allocate that dollar to B and C? Is it simply $\beta_b*\$1$ units of B and $\beta_c*\$1$ units of C or is it more complex?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Related, is it more correct to regress log prices or raw prices when fitting the model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I know that this is related to &lt;a href=&quot;https://quant.stackexchange.com/questions/3456/how-to-build-a-mean-reverting-basket&quot;&gt;How to build a mean reverting basket?&lt;/a&gt; but the answers there weren't very detailed and this is a more specific question).&lt;/p&gt;&#xA;" OwnerUserId="5251" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2017-12-19T23:24:23.863" Title="How to determine ratios for mean-reverting basket" Tags="&lt;quant-trading-strategies&gt;&lt;statistics&gt;&lt;trading&gt;&lt;regression&gt;&lt;cointegration&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7895" PostTypeId="1" CreationDate="2013-05-03T03:31:18.737" Score="1" ViewCount="534" Body="&lt;p&gt;When looking through Bloomberg's BSYM data ADR and Common Stock data (5/2/13), I was able to find the ticker symbol 'V' associated with Visa but was unable to find any record for Vivendi, which I believe also used 'V' at some point in time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If BSYM is a truly unique identifier (which interests me since it's an open-source way to have a unique security ID), shouldn't I see at least one record for the Vivendi Universal ADR that also had the 'V' symbol?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;===EDIT===&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a more clear example: Chrysler used to trade under &quot;DCX&quot; (after they were bought by Daimler) ... that ticker appears nowhere in the Bloomberg BSYM data. So I'm assuming that a current view of the BSYM equity/common-stock list has survivorship issues (i.e. it's a great source of all current tickers but won't include any companies that no longer exist).&lt;/p&gt;&#xA;" OwnerUserId="2119" LastEditorUserId="2119" LastEditDate="2013-05-03T10:48:02.863" LastActivityDate="2013-07-03T21:37:15.323" Title="BSYM for historical tickers" Tags="&lt;data&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7896" PostTypeId="2" ParentId="7895" CreationDate="2013-05-03T09:57:23.667" Score="0" Body="&lt;p&gt;Your answer is found on &lt;a href=&quot;http://en.wikipedia.org/wiki/Ticker_symbol#cite_note-1&quot; rel=&quot;nofollow&quot;&gt;Wikipedia&lt;/a&gt;,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Symbols sometimes change to reflect mergers. Prior to the 1999 merger&#xA;  with Mobil Oil, Exxon used a phonetic spelling of the company &quot;XON&quot; as&#xA;  its ticker symbol. The symbol of the firm after the merger was &quot;XOM&quot;.&#xA;  Symbols are sometimes reused, in the US the single letter symbols are&#xA;  particularly sought after as vanity symbols. For example since Mar&#xA;  2008 Visa Inc. has used the symbol V that had previously been used by&#xA;  Vivendi which had delisted and given up the symbol. [1]&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.bloomberg.com/markets/symbolsearch?query=Vivendi&amp;amp;commit=Find+Symbols&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; is a list of current registered Vivendi symbols on Bloomberg.&lt;/p&gt;&#xA;" OwnerUserId="5222" LastActivityDate="2013-05-03T09:57:23.667" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7899" PostTypeId="1" CreationDate="2013-05-03T17:29:10.183" Score="2" ViewCount="1140" Body="&lt;p&gt;I have a bunch of deltas and option implied vols at those deltas. I would like to interpolate them in R. Interpolating them in delta space seems difficult, since normally you would like the ATM calls and puts to paste together, but in delta space they will be on opposite ends of the x-axis (delta). I was thinking of simply doing the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# first convert everything to moneyness type measure&#xA;sample_delta = c(seq(-.5, -.05, by=.05), seq(.05, .55, by=.05))&#xA;sample_vols = runif(n = length(sample_delta)) # some made up vols&#xA;d1 = ifelse(sample_delta &amp;lt; 0, qnorm(sample_delta +1), qnorm(sample_delta))&#xA;s = spline(d1, sample_vols)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The issue is that I have to go back and forth converting between &lt;code&gt;d1&lt;/code&gt; and &lt;code&gt;delta&lt;/code&gt; when at the end of the day I just want things to be in standardized delta space. Does R have any packages to do this? For example &lt;code&gt;quantmod&lt;/code&gt; or something of the sort.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make things more clear: Given a bunch of deltas and implied vols, I would like to generate an entire vol surface. What is the best way to do this?&lt;/p&gt;&#xA;" OwnerUserId="3312" LastEditorUserId="3312" LastEditDate="2013-05-04T23:18:19.773" LastActivityDate="2013-05-04T23:18:19.773" Title="Interpolate option volatility in delta space in R" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;r&gt;&lt;skew&gt;&lt;interpolation&gt;" AnswerCount="0" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="7900" PostTypeId="1" CreationDate="2013-05-03T18:26:35.433" Score="2" ViewCount="118" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Risk-free rate of return should equal the expected long-run growth rate of the economy with an adjustment for short-run liquidity.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What is meant by the last phrase, &quot;adjustment for short-run liquidity&quot;?&lt;/p&gt;&#xA;" OwnerUserId="5260" LastEditorUserId="5149" LastEditDate="2013-05-03T19:45:44.730" LastActivityDate="2013-05-03T19:45:44.730" Title="What does it mean to adjust for short-run liquidity in finding risk-free rate of return" Tags="&lt;return&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7901" PostTypeId="1" CreationDate="2013-05-04T14:14:13.813" Score="2" ViewCount="153" Body="&lt;p&gt;I would like to analysis of portfolio insurance under a coherent risk-measure method (CVaR), How can I achieve that? Is there a way to turn the problem into a linear programming problem? or to approximate the results? Any links or ideas are welcome.&lt;/p&gt;&#xA;" OwnerUserId="5265" LastActivityDate="2013-05-04T14:14:13.813" Title="Portfolio insurance with a coherent risk measure (CVaR)" Tags="&lt;portfolio&gt;&lt;coherent-risk-measure&gt;&lt;insurance&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7902" PostTypeId="1" AcceptedAnswerId="7903" CreationDate="2013-05-04T14:26:21.277" Score="3" ViewCount="1436" Body="&lt;p&gt;We assume we work in the risk-neural measure with a stock which pays no dividend and a continuous discount rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For PUT and CALL only: can someone please clarify if what I said is correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The intuitive answer is yes, because bigger volatility you are more likely to end up in a region that that is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I looked it up the wikipedia for the formula, but I am a bit lazy trying to prove it is positive&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a GENERAL PAY-OFF FUNCTION:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;when is this still true? I would think it would be true for a monotone function or maybe a convex function? Does anyone know any exisiting literature on this?&lt;/p&gt;&#xA;" OwnerUserId="3334" LastActivityDate="2013-05-07T13:43:14.567" Title="Is vega of Black-Scholes European type option always positive?" Tags="&lt;black-scholes&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7903" PostTypeId="2" ParentId="7902" CreationDate="2013-05-04T15:18:30.320" Score="5" Body="&lt;p&gt;If you modify your question to &quot;European Call and Put under a Black-Scholes Model&quot; the answer is: yes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's trivial to verify it from the formula $S e^{d_1} \sqrt{T-t}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a general payoff the question is more difficult to answer. In general vega will not be positive.&#xA;I believe that you can derive some conditions on the payoff assuming a Black-Scholes Model, but I believe that these conditions are &quot;almost useless&quot;, since such a general payoff (like a call spread) would depend on the volatility smile and would not be valued using a Black-Scholes Model...&lt;/p&gt;&#xA;" OwnerUserId="3548" LastEditorUserId="3548" LastEditDate="2013-05-06T17:31:39.163" LastActivityDate="2013-05-06T17:31:39.163" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7904" PostTypeId="1" CreationDate="2013-05-04T15:21:41.167" Score="3" ViewCount="2008" Body="&lt;p&gt;I'd like to work with raw tick data and naturally this data is unevenly spaced (for example, a couple of quotes are at the same second etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;10:12:35 - 14.44&#xA;10:12:35 - 14.45&#xA;10:12:35 - 14.47&#xA;10:12:36 - 14.46&#xA;10:12:36 - 14.49&#xA;10:12:37 - 14.50&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My question is regarding how to set this data to &quot;fixed&quot; intervals for valid math calculation. Though I read &lt;a href=&quot;https://quant.stackexchange.com/questions/4259/analyzing-tick-data&quot;&gt;here&lt;/a&gt; couple of suggestions on what should be done, I'm not sure its clear to me:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Do I have to manipulate the raw data to have &quot;clean&quot; timestamps as the x-axis to work with &lt;a href=&quot;http://ta-lib.org/function.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;common technical indicators&lt;/a&gt;?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Or can I refer to the index as the x-axis (and just ignore the timestamp)? Can I look at it as a &quot;stream&quot; of ticks to anaylze?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5266" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2019-12-22T23:36:18.647" Title="Analyze raw tick data" Tags="&lt;time-series&gt;&lt;analysis&gt;&lt;tick-data&gt;&lt;continuous-time&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7905" PostTypeId="1" AcceptedAnswerId="7909" CreationDate="2013-05-04T16:09:24.047" Score="6" ViewCount="4691" Body="&lt;p&gt;I am trying to code up the optimization problem for Max Diversification Portfolios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main problem I am having is properly translating the objective function in to code and port it in to the optimizer in general.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would one approach this? Can this be solved with R's &lt;code&gt;quadprog&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The objective function to maximize is the diversification ratio:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;d(P) = P'E / sqrt(P'VP)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;E&lt;/code&gt; is vector of asset volatilities,&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;P&lt;/code&gt; is the vector of weights&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;V&lt;/code&gt; is the covariance matrix.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2318" LastEditorUserId="467" LastEditDate="2013-05-04T22:57:34.363" LastActivityDate="2013-05-07T14:58:49.493" Title="How to implement Maximum Diversification in R?" Tags="&lt;programming&gt;&lt;optimization&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7906" PostTypeId="2" ParentId="7904" CreationDate="2013-05-04T17:37:06.553" Score="3" Body="&lt;p&gt;If you just want to run some simplistic technical analysis on quotes, then select the last quote for each unique timestamp. That will ensure that you don't have duplicate timestamps. If you must have it evenly spaced (i.e. no gaps from one second to another), then you can reuse the previous quote to fill-in the missing value.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2013-05-04T17:37:06.553" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7907" PostTypeId="2" ParentId="7905" CreationDate="2013-05-04T22:57:07.520" Score="4" Body="&lt;p&gt;For the record, the formula for maximum diversification portfolio can be found in this &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1977577&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see from the &lt;code&gt;quadprog&lt;/code&gt; &lt;a href=&quot;http://cran.r-project.org/web/packages/quadprog/quadprog.pdf&quot; rel=&quot;nofollow&quot;&gt;documentation&lt;/a&gt;, it minimizes problems of the following form:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \min - d'b + \tfrac12 b' D b ~ \text{with} ~ A' b \geq b_0 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So clearly, it's not good for your formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can consider &lt;a href=&quot;http://stat.ethz.ch/R-manual/R-devel/library/stats/html/optim.html&quot; rel=&quot;nofollow&quot;&gt;optim&lt;/a&gt; or one of its extensions for your problem.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="1917" LastEditDate="2013-05-07T14:58:49.493" LastActivityDate="2013-05-07T14:58:49.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7908" PostTypeId="2" ParentId="4336" CreationDate="2013-05-04T23:23:56.283" Score="0" Body="&lt;p&gt;This presentation may be of interest to you... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://support.precisionlender.com/entries/22591983-How-does-the-math-work-&quot; rel=&quot;nofollow&quot;&gt;https://support.precisionlender.com/entries/22591983-How-does-the-math-work-&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Full disclosure: this is my employer, but I think it's relevant to the discussion&lt;/p&gt;&#xA;" OwnerUserId="5268" LastActivityDate="2013-05-04T23:23:56.283" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7909" PostTypeId="2" ParentId="7905" CreationDate="2013-05-05T08:49:25.957" Score="5" Body="&lt;p&gt;You can find the full R source code for that at the site of &lt;a href=&quot;http://systematicinvestor.wordpress.com&quot; rel=&quot;noreferrer&quot;&gt;Systematic Investor&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example have a look at this post about &lt;a href=&quot;http://systematicinvestor.wordpress.com/2013/03/22/maximum-sharpe-portfolio/&quot; rel=&quot;noreferrer&quot;&gt;Maximum Sharpe Portfolios&lt;/a&gt;. There you see that he created the helper function &lt;code&gt;portfolio.allocation.helper&lt;/code&gt; for the following optimization methods:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;EW=equal.weight.portfolio,&#xA;RP=risk.parity.portfolio,&#xA;MV=min.var.portfolio,&#xA;MD=max.div.portfolio,&#xA;MC=min.corr.portfolio,&#xA;MC2=min.corr2.portfolio,&#xA;MCE=min.corr.excel.portfolio,&#xA;MS=max.sharpe.portfolio&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now the full source code can be found &lt;a href=&quot;https://github.com/systematicinvestor/SIT/blob/master/R/strategy.r&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll want to have a look at &lt;code&gt;max.div.portfolio&lt;/code&gt; which is based on the method in:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Toward Maximum Diversification by Y. Choueifaty, Y. Coignard, The&#xA;  Journal of Portfolio Management, Fall 2008, Vol. 35, No. 1: pp. 40-51&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="12" LastEditorUserId="35" LastEditDate="2013-05-05T13:37:05.983" LastActivityDate="2013-05-05T13:37:05.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7910" PostTypeId="1" CreationDate="2013-05-05T15:01:01.983" Score="5" ViewCount="509" Body="&lt;p&gt;Does anyone know of a decent quant/stat factor website, distribution(public or private) or publication that tracks performance of &quot;many&quot; of traditional quant/stat factors?  By that I mean would show daily, weekly, or monthly performance of enough traditional factors just to get a general idea of what is working lately/been trending for a long time/etc..  (e.g. 3 day reversion strategies worked quite well the last two weeks and open/close bracketing strategies got crushed last month.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've seen the occasional distribution from a bank that will show a handful of factors they run on a quarterly/annual basis, and Bloomberg has some functionality (e.g. BTST) that leaves a lot to be desired, but I've got to imagine there's something more systematic/open source out there, especially with the (slow) rise of more cloud based backtesting services, since what I'm looking for really just requires some person/group having coded enough factors up in a platform and a simple report on top.  (The data quality is not too critical, but naturally the more flawed the less useful!)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any pointers?   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Much appreciated all! I'll certainly post anything I find as well.&lt;/p&gt;&#xA;" OwnerUserId="5261" LastEditorUserId="5261" LastEditDate="2013-05-05T23:55:22.440" LastActivityDate="2017-03-09T18:12:21.977" Title="Quant/Stat Factor Performance Website/Distribution?" Tags="&lt;quant-trading-strategies&gt;&lt;backtesting&gt;&lt;factor-models&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7911" PostTypeId="1" CreationDate="2013-05-05T17:28:21.290" Score="12" ViewCount="1001" Body="&lt;p&gt;I want to fit an ARMA-GARCH model to my &lt;a href=&quot;http://uploadeasy.net/upload/r8hr0.rar&quot; rel=&quot;noreferrer&quot;&gt;data&lt;/a&gt; using rugarch package in R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all, I look at the acf and pacf:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;install.packages(&quot;forecast&quot;)&#xA;library(forecast)&#xA;par(mfrow=c(2,1))&#xA;Acf(mydata,main=&quot;ACF&quot;,cex.axis=1.2,cex.lab=1.2,ci.type=&quot;ma&quot;)&#xA;Acf(mydata,type=&quot;partial&quot;,main=&quot;PACF&quot;,cex.axis=1.2,cex.lab=1.2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;this gives the following images:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/qIND7.png&quot; alt=&quot;acfandpa&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see, the first, second and third lag are not significant. The 4th and the 5th are significant. I decided to use two models for my mean equation: no model (since the intercept is not significant, I checked this) and a modified ARMA(5,5), where the ar1, ar2, ar3, ma1, ma2, mar3 coefficients and the mean are fixed to zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's consider only the second model.&#xA;I estimate the model via&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(lmtest)&#xA;mymodel&amp;lt;-arima(mydata, order=c(5,0,5),include.mean=FALSE,fixed=c(0,0,0,NA,NA,0,0,0,NA,NA))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which gives the output&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/mE6S1.png&quot; alt=&quot;modeloutput&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get the p-values via&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;coeftest(mymodel)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which shows, that all coeff are highly significant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I look at the residuals:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;resid&amp;lt;-mymodel$residuals&#xA;&#xA;par(mfrow=c(2,1))&#xA;Acf(resid,main=&quot;ACF of the residuals of the mean equation, \nmodified ARMA(5,5), zero mean&quot;,cex.axis=1.2,cex.lab=1.2)&#xA;Acf(resid,type=&quot;partial&quot;,main=&quot;PACF of the residuals of the mean equation, \nmodified ARMA(5,5), zero mean&quot;,cex.axis=1.2,cex.lab=1.2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which gives the following images:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/UUxUb.png&quot; alt=&quot;acresid&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see, I could &quot;kill&quot; the dependence at the low lag orders.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I do the joint estimation using the rugarch package.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  spec2&amp;lt;-ugarchspec(variance.model = list(model = &quot;sGARCH&quot;, garchOrder = c(1, 1)), &#xA;    mean.model = list(armaOrder = c(5, 5), include.mean = FALSE), &#xA;    distribution.model = &quot;norm&quot;,fixed.pars=list(ar1=0,ar2=0,ar3=0,ma1=0,ma2=0,ma3=0))&#xA;&#xA;    model2&amp;lt;-ugarchfit(spec=spec2,data=mydata)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I look at the output by just entering &lt;code&gt;model2&lt;/code&gt;, the relevant parameter output is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/f4VsX.png&quot; alt=&quot;garch&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1.Is it correct, that the coefficients are now different to the coefficients of the arima output?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I now look at &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;plot(model2,which=4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and this gives the following image:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/BnEsq.png&quot; alt=&quot;acfresid&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2.This is the acf of the observations, but I want to have the acf AND the pacf of the residuals. How can I get them? (not the acf of the standardized residuals of the volatility equation, this would be the 10th and the 11th plot).&lt;/p&gt;&#xA;" OwnerUserId="5078" LastEditorUserId="5078" LastEditDate="2013-05-05T17:40:04.003" LastActivityDate="2013-07-14T14:04:20.990" Title="rugarch: Joint estimation leads to different results" Tags="&lt;r&gt;&lt;garch&gt;&lt;estimation&gt;&lt;auto-correlation&gt;&lt;arma&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7912" PostTypeId="1" CreationDate="2013-05-05T18:59:28.283" Score="2" ViewCount="453" Body="&lt;p&gt;This may be a silly question, but does there exist a methodology for examining the impact of &quot;events&quot; on companies that are not publicly traded? I suppose it would look at abnormal revenues rather than abnormal returns on the stock market. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say, for example, that a private business wants to analyze the impact of an advertising campaign or promotion (or any other endogenous event). The &quot;event&quot; would be the promotion, and they would analyze any change in revenue from their &quot;normal&quot; levels. I suppose they would use historical revenue data that had been cleaned to remove any possible cyclical or seasonal components (detrended to isolate the impact of the &quot;event&quot;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this wouldn't have anything to do with investor expectations or whether an event has real information content. I've found a paper: &lt;a href=&quot;http://rme.sagepub.com/content/22/2/57.full.pdf+html&quot; rel=&quot;nofollow&quot;&gt;&quot;Event study methodology in marketing&quot;&lt;/a&gt;. What I'm looking for is something similar but assessing revenues rather than stock prices. The overarching idea being to quantify the impact of management decisions when there is no stock market data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I apologize if this is too far outside the realm of quantitative finance. I learned about event studies through investment analysis and financial economics classes. At the moment I'm wondering what sort of data-analysis is possible for smaller businesses. &lt;/p&gt;&#xA;" OwnerUserId="5272" LastActivityDate="2014-11-26T20:22:50.623" Title="Event studies using revenue data vs. measuring abnormal returns" Tags="&lt;time-series&gt;&lt;research&gt;&lt;returns&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7913" PostTypeId="1" CreationDate="2013-05-06T07:55:35.197" Score="0" ViewCount="489" Body="&lt;p&gt;I would like to know how I can test the efficiency of Exponential Moving Averages when it comes to forex trading. Can i have any papers that point to the efficiency of this strategy? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you. :) &lt;/p&gt;&#xA;" OwnerUserId="5257" LastActivityDate="2013-05-06T08:17:12.160" Title="How to test the efficiency of Exponential Moving Averages as a trading startegy?" Tags="&lt;quant-trading-strategies&gt;&lt;backtesting&gt;&lt;moving-average&gt;" AnswerCount="1" CommentCount="8" ClosedDate="2013-05-06T11:16:03.657" ContentLicense="CC BY-SA 3.0" />
  <row Id="7914" PostTypeId="2" ParentId="7913" CreationDate="2013-05-06T08:17:12.160" Score="3" Body="&lt;p&gt;Two good starting points are here:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Allen, Helen, and Mark Taylor. “The Use of Technical Analysis in the Foreign&#xA;Exchange Market.” The Journal of International Money and Finance, June 1992, pp.&#xA;304-314.&lt;/li&gt;&#xA;&lt;li&gt;Lui, Y.H., and D. Mole. “The Use of Fundamental and Technical Analyses by Foreign&#xA;Exchange Dealers: Hong Kong Evidence.” The Journal of International Money and&#xA;Finance, Volume 17, Number 3, 1 June 1998, pp. 535-545.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="12" LastActivityDate="2013-05-06T08:17:12.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7915" PostTypeId="2" ParentId="7904" CreationDate="2013-05-06T08:34:50.173" Score="2" Body="&lt;p&gt;To help you understand why you need to follow recipes (like chrisaycock's) just have a look at your tick data.  You will find ticks clustered at some points in time while they seem scarce at others.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you proceed with your recipe 2, you will lose those clusters of activity and &lt;em&gt;stretch&lt;/em&gt; them out.  In periods of low activity you will &lt;em&gt;condense&lt;/em&gt; the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most indicators you mentioned will expect to work over a &lt;em&gt;window of time&lt;/em&gt;, simply because the results are so much more meaningful.  In theory, you could apply the same algorithms to stretched or condensed indexed ticks, but the results will also be valid for those periods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That means for a cluster of activity that makes the price jump from &lt;code&gt;X&lt;/code&gt; to &lt;code&gt;X+10&lt;/code&gt; within 1000 ticks but only one second of time your indicator might tell you to sell on the 400th tick and buy on the 800th.  But to implement this you would have to execute a round-trip within less than a second.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now also this indicator's results are less comparable.  Because in a period of low market activity the indicator might give you the same result (sell on 400, buy on 800), but now it's stretched over, say, hours, and it's much more likely that you can realise this trade.&lt;/p&gt;&#xA;" OwnerUserId="1040" LastActivityDate="2013-05-06T08:34:50.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7916" PostTypeId="1" AcceptedAnswerId="7923" CreationDate="2013-05-06T14:58:46.507" Score="2" ViewCount="1221" Body="&lt;p&gt;I am looking for some paper or similar which deal with this topic: hedging bankruptcy on firm's debt using Put options written on that firm's equity price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This should be based on the assumption that equity price goes zero if firm defaults, then Put options go ITM and profits (partially) cover LGD; on the other hand, if no default occurs you have regular coupon payments that can make Put cheaper than naked long position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any reference?&lt;/p&gt;&#xA;" OwnerUserId="3058" LastActivityDate="2013-05-07T18:01:47.853" Title="Hedging credit risk using Put equity options" Tags="&lt;options&gt;&lt;hedging&gt;&lt;default&gt;&lt;credit-risk&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7917" PostTypeId="2" ParentId="7902" CreationDate="2013-05-06T16:52:38.090" Score="3" Body="&lt;p&gt;As Christian notes, under the Black-Scholes model standard european options have prices that are monotonic in volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see that &lt;a href=&quot;https://quant.stackexchange.com/questions/2059/how-does-volatility-affect-the-price-of-binary-options/2060#2060&quot;&gt;binary options do not share this property&lt;/a&gt; but I suspect you are correct about convex payoffs.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2013-05-07T13:43:14.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7918" PostTypeId="1" CreationDate="2013-05-07T00:51:21.477" Score="4" ViewCount="490" Body="&lt;p&gt;I'm attempting to solve for $\hat{k}$ clusters, such that the rate distortion is minimized, as described &lt;a href=&quot;http://en.wikipedia.org/wiki/Determining_the_number_of_clusters_in_a_data_set&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;, however, the answers that I am getting from my algorithm are not following the &quot;Jump&quot; behavior (as is needed to appropriately choose $k$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My current process:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given a $N$ by $d$ matrix of asset returns:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Calculate the correlation of the assets, resulting in a $d \times d$ correlation matrix.&lt;/li&gt;&#xA;&lt;li&gt;For $k \in [1, d]$ calculate the $1 \times d$ vectors of cluster labels, using the correlation matrix as the input&lt;/li&gt;&#xA;&lt;li&gt;For $k \in [1, d]$ calculate $k, 1 \times d$ vectors of cluster centroids, using the correlation matrix as the input&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Based on the cluster label (see code below), construct $\mathbf{A}$, a $d \times d$ matrix of cluster centroids based on the cluster label of each asset.  So for instance, say $k=3$ and there are 4 assets total, and the results of the k-means cluster is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;asset 1 is in cluster 1 &lt;/li&gt;&#xA;&lt;li&gt;asset 2 is in cluster 1&lt;/li&gt;&#xA;&lt;li&gt;asset 3 is in cluster 2&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;asset 4 is in cluster 3&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would create a $4 \times 4$ matrix where $\textrm{row }1 = \textrm{centroid } 1$ (a 1, 4 row vector), $\textrm{row }2 = \textrm{centroid } 1$ $\textrm{row }3 = \textrm{centroid } 2$ (a 1, 4 row vector), $\textrm{row }4 = \textrm{centroid} 3$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Then calculate the &lt;strong&gt;rate distortion&lt;/strong&gt; function, $\epsilon$, for each $k$, where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\epsilon_{k} \triangleq \frac{1}{p}\mathbf{A^\intercal}\mathbf{\Sigma^{-1}}\mathbf{A}$&#xA;   where, $\mathbf{\Sigma} \triangleq$ The Covariance Matrix of the $N \times d$ asset returns &lt;strong&gt;NOTE:&lt;/strong&gt; I'm not certain whether I take the covariance of the asset returns or the covariance of the covariance matrix (which didn't seem right to me).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;This leaves me with a $d \times d$ matrix that I then sum all the values, and follow the remainder of the procedure listed &lt;a href=&quot;http://en.wikipedia.org/wiki/Determining_the_number_of_clusters_in_a_data_set&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.  This procedure is derived from the paper, &lt;a href=&quot;https://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=3&amp;amp;ved=0CEYQFjAC&amp;amp;url=http%3A%2F%2Fciteseerx.ist.psu.edu%2Fviewdoc%2Fdownload%3Fdoi%3D10.1.1.107.9895%26rep%3Drep1%26type%3Dpdf&amp;amp;ei=EwqJUZS4M9ey4AOI6oHQCw&amp;amp;v6u=https%3A%2F%2Fs-v6exp1-ds.metric.gstatic.com%2Fgen_204%3Fip%3D64.49.98.2%26ts%3D1367935508309732%26auth%3Dr5qjolgubxkfxpxipmyymjjw2wqtvlb5%26rndm%3D0.16257459507323802&amp;amp;v6s=2&amp;amp;v6t=2984&amp;amp;usg=AFQjCNFGfk0V7cG6e0DvAi9WTdkU8-zkUw&amp;amp;sig2=Ej2qQ9c-ohnr1fnrU679Cg&amp;amp;bvm=bv.45960087,d.dmg&quot; rel=&quot;nofollow&quot;&gt;Finding the number of clusters in a data set: An information theoretic approach&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;My Python Code is as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import Pycluster&#xA;&#xA;def rate_distortion(X, cov_matrix, num_clusters):&#xA;    clusterid, error, nfound = Pycluster.kcluster(X, nclusters = num_clusters)&#xA;    cdata, cmask = Pycluster.clustercentroids(X, clusterid = clusterid)&#xA;    c_mat = pandas.DataFrame(numpy.empty(X.shape), columns = X.columns)&#xA;    for i, cluster in enumerate(clusterid):&#xA;        c_mat.ix[i, :] = cdata[cluster, :]&#xA;&#xA;    diff_mat = numpy.subtract(X, c_mat)&#xA;    p = X.shape[1]&#xA;    Y = p/2.&#xA;    distortion = 1./p * numpy.sum(numpy.dot(numpy.dot(diff_mat.transpose(),&#xA;                                                      numpy.linalg.inv(cov_matrix)),&#xA;                                            diff_mat))&#xA;    return distortion**(-Y)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To execute a script that exactly illustrates to what I'm referring to, use data located &lt;a href=&quot;https://www.dropbox.com/s/nvvtlo2f23vx0fp/asset_prices.csv&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; and the following script:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import pandas, numpy, Pycluster&#xA;&#xA;prices = pandas.DataFrame.from_csv('asset_prices.csv')&#xA;returns = prices.apply(numpy.log).diff()&#xA;k = numpy.arange(1,12)&#xA;d = []&#xA;for i in k:&#xA;      d.append(rate_distortion(returns.corr(), returns.cov(), i)&#xA;d = pandas.Series(d, index = k)&#xA;&#xA;In [22]: d&#xA;Out[22]:&#xA;1     8.845139e-33&#xA;2     3.969062e-29&#xA;3     9.387323e-28&#xA;4     9.200729e-28&#xA;5     4.675902e-18&#xA;6     2.412458e-21&#xA;7     3.582043e-18&#xA;8     8.094695e-17&#xA;9     1.424341e-16&#xA;10    4.320064e-14&#xA;11             inf&#xA;dtype: float64&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2153" LastEditorUserId="848" LastEditDate="2014-08-30T17:22:45.697" LastActivityDate="2014-08-30T17:22:45.697" Title="Rate Distortion Minimization in a Python Clustering Algorithm" Tags="&lt;python&gt;&lt;financial-engineering&gt;&lt;cluster&gt;&lt;rate-distortion&gt;" AnswerCount="0" CommentCount="15" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7919" PostTypeId="1" CreationDate="2013-05-07T09:56:45.550" Score="3" ViewCount="1962" Body="&lt;p&gt;Suppose, if the price of a European option (say a put) can be shown to be monotone in volatility (say for any maturity), does it follow that American options has to be monotone in volatility? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;CLARIFICATION: Monotonicity in volatility means, assuming all other paramters is fixed, the option price is increasing or decreasing in volatility level (at time 0)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;^ Presumably, for Black-Scholes model, we can explicitly demonstrate this. (Though I have not tried myself) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;what I am intersted in is, does anyone know any counter examples for this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I work on optimal stopping problems. I am currently working on Barndoff-Nielson Shephard model and I am trying to prove the American put (or a more general pay off) under a pricing measure is monotone in volatility. While I think it should not be too difficult to show monotonicity in volatility if the option is European, it is a lot harder to do it for an American option. I am just trying to get some intuition for this. &lt;/p&gt;&#xA;" OwnerUserId="3334" LastEditorUserId="3334" LastEditDate="2013-05-07T12:46:21.647" LastActivityDate="2013-05-07T15:20:00.193" Title="Relationship between European, American options volatility" Tags="&lt;volatility&gt;&lt;black-scholes&gt;&lt;american-options&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7920" PostTypeId="1" CreationDate="2013-05-07T10:47:58.870" Score="3" ViewCount="1094" Body="&lt;p&gt;When evaluating the strategy ex-post using e.g. Sharpe ratio, what should one use as the risk-free rate? Let's suppose I am using a 1Y sample of weekly returns, sampled between 2012-01-01 and 2012-12-31. Should I use the 1Y risk-free rate as of 2012-01-01, an average of the 1W risk-free rates as of the beginning of each week in 2012, or subtract each 1W risk-free rate from the corresponding strategy return each week before averaging/calculating variance?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My intuition was to do the last, but on the other hand with the interest rates floating, this hardly makes it the &quot;risk-free&quot; option?&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2013-05-07T15:37:32.977" Title="Risk-free rate for ex-post evaluation of investment strategy" Tags="&lt;risk&gt;&lt;sharpe-ratio&gt;&lt;performance-evaluation&gt;&lt;investment&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7921" PostTypeId="1" CreationDate="2013-05-07T13:44:38.847" Score="14" ViewCount="5229" Body="&lt;p&gt;I'm using around 130 technical indicators for 100 different companies. Each company's stock price moves in a different range, see &lt;a href=&quot;http://en.wikipedia.org/wiki/FTSE_100_Index&quot;&gt;FTSE 100&lt;/a&gt;. In addition, each technical indicator moves in a different range as well, ie some goes between 0-1, other 0-100 and others move with the price. This is the list I'm using &lt;a href=&quot;http://ta-lib.org/function.html&quot;&gt;http://ta-lib.org/function.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to feed this into a machine learning algorithm where I predict the relative price movement of the stock price the next day. I use a logistic loss for profit optimization and two regularizer terms, one between companies, and the other between time periods. This is unimportant for now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rather, what I'm asking about is how to normalize the input data? I've tried zscore, rate of change, absolute differences, and various combination of these, but I'm not sure which is the right approach. Also, I assume that first I need to calculate the indicators and then normalize that data. or would these indicators make sense on normalized data?&lt;/p&gt;&#xA;" OwnerUserId="1681" LastActivityDate="2019-04-02T08:13:46.770" Title="How to normalize technical indicators for machine learning?" Tags="&lt;machine-learning&gt;&lt;technicals&gt;" AnswerCount="4" CommentCount="5" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="7922" PostTypeId="2" ParentId="7919" CreationDate="2013-05-07T14:01:35.503" Score="5" Body="&lt;p&gt;For a standard American exercise option expiring at $T&amp;gt;0$, price is still monotically increasing in volatility under the Black-Scholes model (though obviously it is not strictly monotonic, due to early exercise rendering price insensitive to volatility in some regions of parameter space).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To see this, you can use one of three techniques:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Investigate the properties of a single step in the binomial tree pricing formulas&lt;/li&gt;&#xA;&lt;li&gt;Formulate the price as an iterated solution in linear complementarity form at $t&amp;lt;T$, and decompose a single timestep's solution into a European option expiring at $t$ , another at $T$ and a forward contract, each of which is convex&lt;/li&gt;&#xA;&lt;li&gt;Differentiate the Black-Scholes PDE with respect to volatility, and then prove it is positive on convex payoffs.  Then use the property that applying early exercise conditions preserves convexity.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="254" LastActivityDate="2013-05-07T14:01:35.503" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7923" PostTypeId="2" ParentId="7916" CreationDate="2013-05-07T14:45:11.927" Score="3" Body="&lt;p&gt;This is, of course, a very old play.  The main thing that gets in the way of trading it is that puts are rarely available in a quantity that matches typical credit instrument notionals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a &lt;a href=&quot;http://faculty.baruch.cuny.edu/lwu/papers/CarrWuRFS2011.pdf&quot; rel=&quot;nofollow&quot;&gt;decent paper&lt;/a&gt; by Peter Carr on the topic, see equation (4) and surrounding.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2013-05-07T18:01:47.853" LastActivityDate="2013-05-07T18:01:47.853" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7924" PostTypeId="2" ParentId="7919" CreationDate="2013-05-07T15:20:00.193" Score="1" Body="&lt;p&gt;So to expand a bit further on what Brian had mentioned, you're going to get a different vol surface given american vs european. So this is something Brian already pointed out, but one very simple and practical way that you can prove this to yourself is just to think about how the implied forwards are generated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the European case we use the entire strip while for American options we only treat options which ul_last &gt; strikes. So like I said, you'll get different forwards which will lead to a different vol surface. &lt;/p&gt;&#xA;" OwnerUserId="122" LastActivityDate="2013-05-07T15:20:00.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7925" PostTypeId="2" ParentId="7904" CreationDate="2013-05-07T15:33:59.480" Score="0" Body="&lt;p&gt;It really depends on what you're trying to do, a solution as simple as agging the data to x-sec OHLC bars may suffice and from the sounds of things that's what you need. Now if you need to work with order book dynamics then tick data is fairly crucial, then what I'd do for analysis is reconstruct the orderbook from the ticks then just take snapshots of the book (again depends on your requirements). &lt;/p&gt;&#xA;" OwnerUserId="122" LastActivityDate="2013-05-07T15:33:59.480" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7926" PostTypeId="2" ParentId="7920" CreationDate="2013-05-07T15:37:32.977" Score="1" Body="&lt;p&gt;seems to me that the rate used depends on the corresponding strategy's grip on funding: that is to say, if the strategy is self-financing, rf=0 when calculating sharpe (in the sense that your costs of funds is zero in construction of the strategy); if it requires an outlay at t_0, an amount which is tied up throughout the time frame of the year, rf should be the 1 yr zero rate as of t0; if the strategy is such that each week the outlay is returned and reinvested the following week, then the rf should be the geometric mean of the return on 1 week t-bills as of 2012-01-01 through 2012-12-31&#xA;at any rate see here: see here: &lt;a href=&quot;http://www.edge-fund.com/Dowd00.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.edge-fund.com/Dowd00.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5241" LastActivityDate="2013-05-07T15:37:32.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7928" PostTypeId="2" ParentId="7916" CreationDate="2013-05-07T17:28:45.430" Score="0" Body="&lt;p&gt;from my reading of Gatheral's notes on this strategy, the best you can hope for at this point, given that the strategy is indeed old hat as Brian states, are bounds on the price of deeply OTM puts as implied by credit spreads of associated tenor. turns out the upper bound is the value of the associated ATM put option and is independent of the credit spread. As for the lower bound, it is nothing more than the present value of the strike price times the probability of default implied by the credit spread. There is a nice anecdote in Gatheral's book about how hedge funds back in the day took it to market makers who got repeatedly burned in connection with implied vol skew.&lt;/p&gt;&#xA;" OwnerUserId="5241" LastEditorUserId="254" LastEditDate="2013-05-07T17:43:13.430" LastActivityDate="2013-05-07T17:43:13.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7929" PostTypeId="1" AcceptedAnswerId="7930" CreationDate="2013-05-08T03:35:23.370" Score="15" ViewCount="8691" Body="&lt;p&gt;There are quite a few discussions here about storage, but I can't find quite what I'm looking for. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm in need to design a database to store (mostly) option data (strikes, premiums bid / ask, etc.). The problem I see with RDBMS is that given big number of strikes tables will be enormously long and, hence, result in slow processing. While I'm reluctant to use MongoDB or similar NoSQL solution, for now it seems a very good alternative (quick, flexible, scalable). &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;There is no need in tick data, it will be hourly and daily closing prices &amp;amp; whatever other parameters I'd want to add. So, no need for it to be updated frequently and writing speed is not that important. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The main performance requirement is in using it for data mining, stats and research, so it should be as quick as possible (and preferably easy) to pull and aggregate data from it. I.e., think of 10-year backtest which performs ~100 transactions weekly over various types of options or calculating volatility swap over some extended period of time. So the quicker is better. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;There is lots of existent historical data which will be transferred into the database, and it will be updated on a daily basis. I'm not sure how much memory exactly it will take, but AFAIK memory should not be a constraint at all. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Support by popular programming languages &amp;amp; packages (C++, Java, Python, R) is very preferable, but would not be a deal breaker.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="5086" LastEditorUserId="5086" LastEditDate="2013-05-08T07:23:40.197" LastActivityDate="2016-04-29T21:26:25.260" Title="Best way to store hourly/daily options data for research purposes" Tags="&lt;options&gt;&lt;data&gt;&lt;database&gt;" AnswerCount="5" CommentCount="11" FavoriteCount="16" ContentLicense="CC BY-SA 3.0" />
  <row Id="7930" PostTypeId="2" ParentId="7929" CreationDate="2013-05-08T06:23:31.437" Score="6" Body="&lt;p&gt;A columnar database or No-SQL solution may be your best choice. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It depends on which OS you target, what your throughput and latency requirements are and whether you look to persist all data or not and finally how big the size of your data is expected to be. Obviously if you only look to store hourly/daily data then even a database that comprises a year of all options data of the SPX500 underlyings may fit into memory and if that is the case you should definitely look at RedisDB. It can persist/snapshot data but generally loads them back into memory. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the size of your data is a constraint to fitting it into memory then another solution such as RavenDB (well written .Net library), or other non-.net solution, depending on requirements, such as Mongo or Couch db may fit a lot better. Please add more requirements and I am happy to edit my post and add information, given I believe I can add value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to your updated information I recommend to look more closely at Redis : Not only are there libraries for pretty much any programming language and OS imaginable (I use it in my .Net framework with the BookSleeve API). You also get great support in R. You can dump literally time series with millions of elements into it, have it stay in memory (you can also persist it) but you can incredibly fast access the data out of R. I do not know a faster way to access time series data out of R to be honest plus additional indexing packages will give you a great accessor library. If you look for something fast, efficient and look to profile ideas/data, which hints at R usage then RedisDB Is what you want. Of course this is not supposed to be a solution for huge data requirements but you specifically mentioned you deal with hourly/daily data and for that purpose even a machine with 16gb of core memory running 64bit code will be plenty enough thus certain suggestions that redis will force you to invest in outrageous hardware are unwarranted. If you look to heavily profile those data in R or python or other languages and want blazing fast access then redis is your solution. If you are more about long term storage and are happy to accept disk access latencies then no need for a cache based db and rather look at document or other key/value or columnar data stores.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other solutions may also work but if you look to solve all your requirements that do not force you to sit down for days just to think about schemata and table relationships just in order to get an SQL solution going then I recommend you look into the direction of Redis or similar approaches and not SQL. Columnar databases may also work though the open source solutions are rather clumsy to work with and I would say not very well thought out in terms of usability and extensibility. (Example: HDM5, though its more of a file format than a database, but until 2013 the guys have still not managed to enable dynamic sizing of data in hdf5 files. You can delete content but the allocated space is not returned. Whatever people tell me about NASA or other organizations using it, I settled the story in the way that those are big organizations with heavy government involvement where funding and resources in many areas that are not priority can get extremely scarce. I do not believe any large organization would still operate on 1990s type of databases if they had plenty enough funding to work on developing better ones. That is the reason certain organizations still use them but I do not find it a point that speaks in favor of using Berkeley DB or HDF5; I used both of them and find them very limited in many ways, plus the performance did not even turn out to be that great. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Summary: pick your weapon of choice, columnar databases could be the solution if you are willing to work around sometimes strange limitations in the api or core data structure but they are made to deal with time series data. Or chose no SQL solutions, either memory based/cache based solutions or purely persisted ones. But I would strongly advise you not to go with SQL. It's generally a giveaway of a beginner or junior person when being asked which database they use for time series storage and the answer comes out they use MySQL, MySQL or embedded SQL solutions. Those are just not designed to handle time series data well.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-05-09T15:31:27.233" LastActivityDate="2013-05-09T15:31:27.233" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7931" PostTypeId="2" ParentId="7929" CreationDate="2013-05-08T08:21:12.897" Score="3" Body="&lt;p&gt;You need to log some data, and later use it for analysis. Dare I suggest you just append the values to a set of files? You can load up the data later for your runs, and cache anything needed frequently. Frankly buying an SSD and copying the files to that before you run analysis should solve your problem, and no-one had to get hurt.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2013-05-08T08:21:12.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7932" PostTypeId="1" AcceptedAnswerId="7935" CreationDate="2013-05-08T10:14:19.017" Score="18" ViewCount="24427" Body="&lt;p&gt;I want to do one step ahead in-sample forecasts. My data can be found &lt;a href=&quot;http://uploadeasy.net/upload/c7fcx.rar&quot;&gt;here&lt;/a&gt;. This is just a data frame with the date as the rownames.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I specify my model and do the fit and show the plots with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(rugarch)&#xA;model&amp;lt;-ugarchspec(variance.model = list(model = &quot;sGARCH&quot;, garchOrder = c(1, 1)), &#xA;mean.model = list(armaOrder = c(0, 0), include.mean = FALSE), &#xA;distribution.model = &quot;norm&quot;)&#xA;&#xA;modelfit&amp;lt;-ugarchfit(spec=model,data=mydata)&#xA;plot(modelfit)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I want to do one-step-ahead in sample forecasts of my cond. mean and cond. volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I therefore use the ugarchfit command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ugarchforecast(modelfit,n.ahead=1,data=mydata)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this is only one value for the last date. So I want to have this for every data starting from the beginning and up to my final values. These should be 1-step-ahead forecasts which use the specified model parameters and my data. How can I get this?&lt;/p&gt;&#xA;" OwnerUserId="5078" LastActivityDate="2013-05-12T19:53:21.277" Title="Forecasting using rugarch package" Tags="&lt;r&gt;&lt;garch&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="7934" PostTypeId="2" ParentId="7929" CreationDate="2013-05-08T19:54:03.477" Score="7" Body="&lt;p&gt;I recommend you optimize your SQL implementation instead of going for NoSQL, and throwing more expensive hardware at the problem.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Always benchmark first. The reason I'm saying this is that I've seen MS SQL Server scale perfectly fine for options data of the magnitude you're describing and &quot;&lt;em&gt;big&lt;/em&gt; number of strikes tables will be &lt;em&gt;enormously long&lt;/em&gt; and, hence, result in &lt;em&gt;slow&lt;/em&gt; processing&quot; is not a good way to judge.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Redis is a very bad idea for what you're trying to accomplish. From what I can see from the other post, all it has going for it is that it has R bindings. But quite frankly, almost everything has multi-language bindings nowadays that it's an inactive selling point. Redis is designed to trade off consistency and durability for speed. Mongo is similar (it's not that there is no durability, you'd look up WALs to recover and this is rather sketchy but that's for another topic). To put this in perspective:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;This trade-off becomes a necessary evil if you're doing FB social ad metrics, logging 30 million events per second in realtime. But if you're logging 2000 options * 50 records per hour = 28 records per second in batch, you don't need those trade-offs. The risks are asymmetric: If you lose your market data, you would have to seek a vendor, pay, and spend time adjusting the backfill to your own storage format. If FB misses a few clicks for user statistics to deliver latency requirements, everything still moves along smoothly. So you have to work around this, set up persistence servers. The persistence servers should separated (e.g. you'd put them in NY2/NY4) in case of a localized failure. It sums up to be much costlier than mirroring your disks.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You need to have a &lt;em&gt;lot&lt;/em&gt; of memory. This is less a problem if you're hosting everything on the cloud (but this comes with other issues and chances are you aren't). 16 cores and 244 GB memory, a Redis slave per core and you are down to 15 GB of memory. See: &lt;a href=&quot;https://moot.it/blog/technology/redis-as-primary-datastore-wtf.html&quot;&gt;https://moot.it/blog/technology/redis-as-primary-datastore-wtf.html&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;NOTE: The problems stated above are different from the management concerns that see NoSQL being limited in established firms - the latter are usually misguided.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2013-05-08T19:54:03.477" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="7935" PostTypeId="2" ParentId="7932" CreationDate="2013-05-08T20:20:29.227" Score="10" Body="&lt;p&gt;You want to set the parameter &lt;code&gt;n.roll&lt;/code&gt; to the number of &lt;code&gt;n.ahead&lt;/code&gt;, &lt;code&gt;n.roll&lt;/code&gt; rolling forecasts you want. (The &lt;code&gt;n.ahead&lt;/code&gt; parameter controls how many steps ahead you want to forecast for each roll date.) Thus by setting &lt;code&gt;n.roll&lt;/code&gt; to a number almost equal to your sample size, and critically setting the &lt;code&gt;out.sample&lt;/code&gt; parameter almost equal to your sample size, you're telling the method to take a specified fit and treat the in sample data as out of sample data, and thereby roll the forecast &lt;code&gt;n.roll&lt;/code&gt; times, &lt;code&gt;n.ahead&lt;/code&gt; times forward each time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will do it: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;spec = getspec(modelfit);&#xA;setfixed(spec) &amp;lt;- as.list(coef(modelfit));&#xA;forecast = ugarchforecast(spec, n.ahead = 1, n.roll = 2579, data = mydata[1:2580, ,drop=FALSE], out.sample = 2579);&#xA;sigma(forecast);&#xA;fitted(forecast)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5241" LastEditorUserId="5149" LastEditDate="2013-05-08T21:34:49.187" LastActivityDate="2013-05-08T21:34:49.187" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="7936" PostTypeId="1" CreationDate="2013-05-09T01:08:47.663" Score="1" ViewCount="835" Body="&lt;p&gt;Can anyone help me understand how expected economic growth is usually measured? I've read several papers that talk about using breakeven inflation as a proxy for expected inflation, and then the authors will calculate the sensitivity of various assets to the change in unexpected inflation. I've seen the paper from Cam Harvey on the shape of the yield curve as a proxy for market expectations regarding economic recessions, but I'm curious as to how academics and market practitioners come up with a proxy for the expected growth rate of the economy.&lt;/p&gt;&#xA;" OwnerUserId="5216" LastActivityDate="2013-05-09T16:23:30.687" Title="Proxy for Expected Economic Growth" Tags="&lt;regression&gt;&lt;econometrics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7937" PostTypeId="1" CreationDate="2013-05-09T13:26:37.277" Score="1" ViewCount="1089" Body="&lt;p&gt;I am wondering which data to use to test the Covered Interest Rate Parity between Europe and the United States. Recap that for the CIP to hold, it should mean that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;F/S = (1+r)/(1+r*) where&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;F =  the 1-period ahead forward rate on the EUR/USD exchange rate &lt;/li&gt;&#xA;&lt;li&gt;S =  the spot rate of the EUR/USD exchange &lt;/li&gt;&#xA;&lt;li&gt;r =  domestic interest rate &lt;/li&gt;&#xA;&lt;li&gt;r* = foreign interest rate&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For the forward rate I use the &lt;strong&gt;1-month rates&lt;/strong&gt; available on many resource sites, this holds true for the spot rate.&#xA;However, which interest rate should I use for the domestic and foreign one?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My guess was to use the Euribor (1-Month) for the European and the Daily Treasury Yield (1-Month) or the USD Libor (1-Month).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, then there is a huge gap between F/S and (1+r)/(1+r*); i.e.&#xA;F/S yields values around 0.9-0.95 whereas (1+r)/(1+r*) yields values around 0.5 (when using USD Libor), meaning that the CIP definitely does not hold. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recap that the lastest rate on the T-bill (1-Month) equals 0.03 and USD libor 0.1992 whereas the Euribor (1-Month) equals 0.112. Also recap that the forward rate (1-month) on EUR/USD is about 1.25 and the spot rate about 1.31.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An explanation could be of course the absence of transaction costs, but does this explain such a large gap? And secondly, if I wanted to calculate the CIP with transaction costs, does anybody know where to get the BID and ASK quotes on the Euribor and Treasury Bill?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In summary:&#xA;&lt;strong&gt;- Which interest rate should I use for Europe and US?&#xA;- Why is there such a large gap?&#xA;- Where to get the BID and ASK quotes on the Euribor and T-bill?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="2291" LastEditorUserId="2291" LastEditDate="2013-05-09T14:34:06.563" LastActivityDate="2013-06-08T17:25:05.953" Title="When calculating CIP between EU and US, which interest rates data to use?" Tags="&lt;interest-rates&gt;&lt;fx&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7938" PostTypeId="2" ParentId="7929" CreationDate="2013-05-09T15:24:18.577" Score="3" Body="&lt;p&gt;Check out &lt;a href=&quot;http://discretelogics.com/teafiles/&quot; rel=&quot;nofollow&quot;&gt;http://discretelogics.com/teafiles/&lt;/a&gt;. It solves the large memory footprint by using memory mapped files.&lt;/p&gt;&#xA;" OwnerUserId="892" LastActivityDate="2013-05-09T15:24:18.577" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7939" PostTypeId="2" ParentId="7936" CreationDate="2013-05-09T16:23:30.687" Score="1" Body="&lt;p&gt;When you ask for &quot;expected economic growth&quot; you need to be specific for what you are asking for. I assume you mean GDP. But what &quot;economic growth&quot; is depends on who you are talking to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my business (real estate finance, more specifically class A multifamily and industrial in 1st tier cities) economic growth has been spectacular in the past two years with the continually falling interest rates and foreign money flowing into the first tier cities in the last year our little world is doing very well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On to your question: You most certainly can use yield curve to predict economic growth, most specifically a common tool is the spread between the 10 yr and the 3 month treasury. The steeper the curve the more indication of strong growth, and an inverted curve (short term notes with higher rates than long term) indicate an impending recession. The inverted curve has presented itself about a year before the last several recessions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Re-reading your question, I don’t think i answered it properly. The above gives a sense of general economic direction but does not predict an actually &quot;measurement&quot; or number. Not to cop out but this is far more difficult and economists who dig through mountains of data (certainly not just one indicator or proxy) get it wrong just one quarter out.&lt;/p&gt;&#xA;" OwnerUserId="5053" LastActivityDate="2013-05-09T16:23:30.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7940" PostTypeId="2" ParentId="7937" CreationDate="2013-05-09T16:58:28.797" Score="1" Body="&lt;p&gt;stay away from using rates that are based on unsecured funding -- there is differential risk premia embedded if you do, e.g., the health of the US banking system versus that of Europe's when using libor usd versus euribor. also, those rates are liable to manipulation. what you want to use are the rates charged for borrowing in one country versus the rates conferred to lend in another on a collateralized basis. barring the availability of such data, as a proxy using mid quotes on US tbills and mid quotes on german tbills -- both are relatively risk free -- should do the trick (too bad both are near 0, if not negative, as Germany's was until a few months ago.) Also note in this case, because the euro is the currency of so many different countries, each with their own government securities, the Euro/US pair has several associated CIP calculations possible. Though indeed, for many of the countries, the gov securities are not rated anywhere near 'risk free' and therefore cannot be used.&lt;/p&gt;&#xA;" OwnerUserId="5241" LastActivityDate="2013-05-09T16:58:28.797" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7941" PostTypeId="1" CreationDate="2013-05-09T19:28:39.137" Score="3" ViewCount="1232" Body="&lt;p&gt;I am trying to model margin requirements on various commodity futures, however it doesn't seem that the CME has released the formula they use to set these performance bonds. I am sure that they use some measure of volatility to determine a value that prevents daily changes greater than the requirement. Does anyone have any experience in this endeavor, or can point me to some resources?&lt;/p&gt;&#xA;" OwnerUserId="5299" LastActivityDate="2013-06-08T21:25:27.307" Title="How does the CME set margin requirements on commodity Futures" Tags="&lt;programming&gt;&lt;derivatives&gt;&lt;futures&gt;&lt;estimation&gt;&lt;commodities&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7942" PostTypeId="2" ParentId="7941" CreationDate="2013-05-09T20:27:09.120" Score="1" Body="&lt;p&gt;Keyword SPAN and the summarized answer is that it sets margin requirements as a function of risk/volatility. CME and other exchanges also function as clearers and thus they have an interest that market participants who clear with CME remain solvent. The exchange runs stress tests and determines a reasonable amount of performance bond that has to be deposited as margin in order to minimize the risk of insolvency under current stress tested market environments and certain constraints, among others a margin level reasonable enough to optimize turnover in their offered products.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-05-09T20:27:09.120" CommentCount="5" CommunityOwnedDate="2013-05-09T20:27:09.120" ContentLicense="CC BY-SA 3.0" />
  <row Id="7943" PostTypeId="1" AcceptedAnswerId="7953" CreationDate="2013-05-09T23:52:29.830" Score="3" ViewCount="3355" Body="&lt;p&gt;I would like to backtest an options strategy in R. I require the ability to delta hedge and rebalance to options in the portfolio at different frequencies (daily, monthly,etc.) What packages are the correct ones to use for this purpose? (I have seen the R Finance task view but there is a lot there)&lt;/p&gt;&#xA;" OwnerUserId="3312" LastActivityDate="2021-04-14T09:18:18.710" Title="backtesting options strategies in R" Tags="&lt;options&gt;&lt;quant-trading-strategies&gt;&lt;backtesting&gt;&lt;r&gt;&lt;delta-hedging&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7945" PostTypeId="2" ParentId="7943" CreationDate="2013-05-10T01:10:07.677" Score="2" Body="&lt;p&gt;My first thought would be to use quantlib package to get the delta values and comply those to get a position delta. Then use rules based on delta values to hedge. Use discrete time adjustments or use delta bands.&lt;/p&gt;&#xA;" OwnerUserId="4764" LastEditorUserId="35" LastEditDate="2013-05-10T11:14:43.193" LastActivityDate="2013-05-10T11:14:43.193" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7947" PostTypeId="1" CreationDate="2013-05-10T05:37:20.130" Score="3" ViewCount="1488" Body="&lt;p&gt;I want to ask if there is a situation to know the order of GARCH(p, q) from the result. For example, in the case of AR(p), one can know the value of p by plotting pacf(). In case of MA(q), one can know the value of q by plotting acf().&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any similar situation to know the value of p and q in GARCH(p, q) models? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;May be using Engels Arch Effect test.&lt;/p&gt;&#xA;" OwnerUserId="5301" LastEditorUserId="35" LastEditDate="2013-05-10T11:18:23.213" LastActivityDate="2013-05-10T11:44:57.813" Title="knowing the order of GARCH model" Tags="&lt;time-series&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7949" PostTypeId="1" AcceptedAnswerId="14874" CreationDate="2013-05-10T11:09:51.173" Score="2" ViewCount="2330" Body="&lt;p&gt;I'm trying to price a fixed rate bond one year from now on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The bond is the PEUGOT 7 ⅜ 03/06/18, whose ISIN code is FR0011439975. I'm using such a specific example because in this way everyone can try to reproduce results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using these instruments:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Bloomberg &lt;code&gt;YAS&lt;/code&gt; function&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;RQuantLib&lt;/code&gt; package &lt;code&gt;FixedRateBondPriceByYield()&lt;/code&gt; function&lt;/li&gt;&#xA;&lt;li&gt;Hoadley Excel add-in &lt;code&gt;HoadleyBond()&lt;/code&gt; function&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;and getting different results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then there must be something wrong with me, because fixed rate bond pricing is an easy task.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bond's features (&lt;code&gt;RQuantLib&lt;/code&gt; / Hoadley fields name):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;faceAmount / principal $= 100$&lt;/li&gt;&#xA;&lt;li&gt;effectiveDate / Valuation_date = 10 May 2014&lt;/li&gt;&#xA;&lt;li&gt;maturityDate / Maturity = 6 March 2018&lt;/li&gt;&#xA;&lt;li&gt;rates / Coupon_rate $= 0.07375$&lt;/li&gt;&#xA;&lt;li&gt;period / Coupon_freq $= 1$ (Annual)&lt;/li&gt;&#xA;&lt;li&gt;yield / Term_struc $= 0.06535$ (flat curve due to pricing with YTM)&lt;/li&gt;&#xA;&lt;li&gt;redemption $= 100$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Other arguments, such as settlement days, calendar rules and so on, can be ignored because I don't need such an accuracy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Results:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Bloomberg &lt;code&gt;YAS&lt;/code&gt; function clean price $= 102.72$&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;RQuantLib&lt;/code&gt; package &lt;code&gt;FixedRateBondPriceByYield()&lt;/code&gt; function clean price $= 96.67$&lt;/li&gt;&#xA;&lt;li&gt;Hoadley Excel add-in &lt;code&gt;HoadleyBond()&lt;/code&gt; function clean price $= 103.31$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Where's my mistake? What am I not taking into consideration?&lt;/p&gt;&#xA;" OwnerUserId="3058" LastActivityDate="2014-09-27T21:38:19.663" Title="RQuantLib, Hoadley and Bloomberg YAS: fixed rate bond pricing differences?" Tags="&lt;fixed-income&gt;&lt;r&gt;&lt;pricing&gt;&lt;bond&gt;&lt;bloomberg&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7950" PostTypeId="1" CreationDate="2013-05-10T11:40:48.780" Score="18" ViewCount="3433" Body="&lt;p&gt;I would like to estimate Ornstein–Uhlenbeck process' parameters via Kalman filter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My process is the following one:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\text{d}x_{t}=\alpha(\theta-x_{t})\text{d}t+\sigma\text{d}W_{t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm interested in CIR process, too:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\text{d}x_{t}=\alpha(\theta-x_{t})\text{d}t+\sigma x_{t}^{\beta}\text{d}W_{t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and my goal is to find the values of $\alpha$, $\theta$ and $\beta$ using Kalman filter over a state-space representation of the process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How may I describe such a process in a form suitable to state-space representation and Kalman filter?&lt;/p&gt;&#xA;" OwnerUserId="3058" LastEditorUserId="464" LastEditDate="2013-05-21T12:01:08.537" LastActivityDate="2013-11-08T00:21:53.970" Title="Parameter estimation of Ornstein–Uhlenbeck and CIR processes" Tags="&lt;stochastic-processes&gt;&lt;kalman&gt;&lt;parameter-estimation&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="7951" PostTypeId="2" ParentId="7947" CreationDate="2013-05-10T11:44:57.813" Score="6" Body="&lt;p&gt;See any standard econometrics textbook on &lt;em&gt;model specification and selection&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One frequently uses terms like AIC, BIC, ... to compute metrics which trade off the improvement in fit that comes from specifying additional terms against the &quot;penalty&quot; (in quotes because how to express this depends on the chosen metric) applied to overly rich models (which may just break).  You could test a GARCH(1,1) versus a GARCH(2,1) or GARCH(2,2) this way.  As I recall, that is even in the original paper by Bollerslev.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the wild, you almost never see a GARCH that is not of a GARCH(1,1).  Bigger gains can be had by altering the GARCH specifications -- but you have about three decades worth of stuff to read up on now.&lt;/p&gt;&#xA;" OwnerUserId="69" LastActivityDate="2013-05-10T11:44:57.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7953" PostTypeId="2" ParentId="7943" CreationDate="2013-05-10T13:58:40.677" Score="3" Body="&lt;p&gt;Assuming you already have a way to obtain hedge ratios and the like, your best available choice is probably &lt;a href=&quot;https://github.com/milktrader/blotter/wiki/The-Packages&quot; rel=&quot;nofollow&quot;&gt;blotter&lt;/a&gt; (used to be just &lt;em&gt;quantstrat&lt;/em&gt;).  You will find that it isn't necessarily oriented toward options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally for options backtesting, pros end up making their own or buying commercial software.   There are tons of commercial providers, but I don't know anyone who has investigated the top candidates.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2013-05-10T14:34:53.593" LastActivityDate="2013-05-10T14:34:53.593" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7954" PostTypeId="2" ParentId="739" CreationDate="2013-05-10T15:17:35.393" Score="7" Body="&lt;p&gt;S&amp;amp;P credit rating change information until 2012 (European Union only):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.standardandpoors.com/ratings/articles/en/us/?articleType=HTML&amp;amp;assetID=1245327302187&quot;&gt;http://www.standardandpoors.com/ratings/articles/en/us/?articleType=HTML&amp;amp;assetID=1245327302187&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5306" LastActivityDate="2013-05-10T15:17:35.393" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7955" PostTypeId="2" ParentId="7949" CreationDate="2013-05-10T19:45:41.653" Score="2" Body="&lt;p&gt;Let's approximate the time to maturity to be 3 years and 10 months. Assume that coupon is paid on March 6 each year. Let face value $F=100$ and coupon $c=0.07375F$. Let the discount factor be $d(0,T)=e^{−r T}$ where $r=0.06535$. The price of the bond is&#xA;$$ce^{−10/12 \bullet r}+ce^{−22/12 \bullet r}+ce^{−34/12 \bullet r}+(F+c)e^{−46/12 \bullet r}=103.24 \; .$$&#xA;Since the discount rate $r$ &amp;lt; coupon rate, I don't see how the price of the bond can be less than 100.&lt;/p&gt;&#xA;" OwnerUserId="3188" LastEditorUserId="3188" LastEditDate="2013-05-11T03:45:51.140" LastActivityDate="2013-05-11T03:45:51.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7956" PostTypeId="2" ParentId="7949" CreationDate="2013-05-10T21:38:05.033" Score="3" Body="&lt;p&gt;This is wrong:&#xA;effectiveDate / Valuation_date = 10 May 2014&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good that you included the ISIN, which states that the effective date (as contrasted with the issue date) was a few days after 03 May 2013.&lt;/p&gt;&#xA;" OwnerUserId="5241" LastActivityDate="2013-05-10T21:38:05.033" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7957" PostTypeId="2" ParentId="7402" CreationDate="2013-05-11T04:07:10.543" Score="10" Body="&lt;p&gt;You should take a look at the example from Hull's book.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume that the 6-month, 12-month, 18-month zero rates are 4%, 4.5%, and 4.8%, respectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose we know that the 2-year swap rate is 5%, which implies that&#xA;a 2-year bond with a semiannual coupon of 5% per annum sells for par:&#xA;$$2.5 e^{-0.04 \bullet 0.5} + 2.5 e^{-0.045 \bullet 1.0} &#xA;    + 2.5 e^{-0.048 \bullet 1.5} + 102.5 e^{-2 \bullet R} = 100 \; . $$&#xA;Solving for $R$ above gives a 2-year zero rate $R$ of 4.953%.  We can keep going to compute the 3-year zero rates, etc.&lt;/p&gt;&#xA;" OwnerUserId="3188" LastEditorUserId="3188" LastEditDate="2016-02-03T16:39:01.393" LastActivityDate="2016-02-03T16:39:01.393" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7958" PostTypeId="2" ParentId="7950" CreationDate="2013-05-11T15:24:39.313" Score="-2" Body="&lt;p&gt;this question can be quite straightforward or gnarly depending on whether you can observe measurements of $x_t$ directly or not. in the latter case, in general it will become a nonlinear system, and will require application of the extended kalman filter or its improvement, the unscented kalman filter. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&lt;strong&gt;On Edit:&lt;/em&gt;&lt;/strong&gt;&#xA;Now that the bounty has expired, let me answer by way of supplying this key reference (which i found as a result of this question*): &quot;Estimating and Testing Exponential-Affine Term Structure Models by Kalman Filter&quot; by Jin-Chuan Duan, Jean-Guy Simonato. Pg 13 of the paper gives the answer for the Vasicek model, page 15 for the CIR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;*Because of the results of Duffie and Kan (93), both these models lead to pricing equations for zero coupon bonds that are affine in the short rate, xt. As a result, one can use a linear Kalman filter to solve this, using zero coupon rate changes as the input. I originally thought one would definitely need the UKF.&lt;/p&gt;&#xA;" OwnerUserId="5241" LastEditorUserId="5241" LastEditDate="2013-05-21T19:02:43.280" LastActivityDate="2013-05-21T19:02:43.280" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7959" PostTypeId="2" ParentId="7402" CreationDate="2013-05-11T15:31:42.463" Score="11" Body="&lt;p&gt;(In addition to the answers of Freddy and Phil H):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &quot;modern&quot; multi-curve setups: You have to distinguish between discount curves (which describe todays value of the a future fixed payoff (e.g. a zero coupon bond)) and forward curve, which describe the expectation (in a specific sense) of future interest rate fixings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Swaps pay LIBOR rates and are usually collaterlized with respect to an OIS accruing account. The collateralization implies that you discount (fixed) payments on the OIS curve. From the swap you may then calculate forward rates for the LIBOR fixings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bond spread are usually given above LIBOR an from bond prices you may derive the bond curve, which can be seen as the discount curve of uncollaterlized funding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Theses (discount) curves can be represented in terms of yields (r(T) := log(df(T))/T)).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a multi-curve curve calibration algorithm in source code here: &lt;a href=&quot;http://www.finmath.net/topics/curvecalibration/&quot;&gt;http://www.finmath.net/topics/curvecalibration/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a spreadsheet for download performing bootstrapping of OIS curve, forward curve, funding curves, cross-currency discount curves. Maybe you find it useful, e.g. to benchmark your calibration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your funding is performed using a mix of instruments, e.g. short term funding and long term fusing, then it can still make sense to setup a &quot;mixed&quot; curve. Howerver, you have to distiguish forward curves and funding curves. See also &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2194907&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2194907&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Disclaimer: I am the author of the source code referenced and the paper).&lt;/p&gt;&#xA;" OwnerUserId="3548" LastEditorUserId="3548" LastEditDate="2013-05-11T19:29:53.730" LastActivityDate="2013-05-11T19:29:53.730" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7960" PostTypeId="1" AcceptedAnswerId="7961" CreationDate="2013-05-11T17:31:00.303" Score="2" ViewCount="614" Body="&lt;p&gt;Here I have this question&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(i) state Ito's formula&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(ii) hence or otherwise show that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\int^t_0B_s dB_s = \dfrac{1}{2}B^2_t -\dfrac{1}{2} t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(iii) define the quadratic variation $Q(t)$ of Brownian motion over [0,t], given that $Q(t) = t$, use this result to prove (ii)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can do everything up to the last bit of (iii), how can quadratic variation tell you this relationship?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;disclaimer: this is not homework. I am trying to help a friend preparing for an exam and this was a past paper question.&lt;/p&gt;&#xA;" OwnerUserId="3334" LastEditorUserId="2587" LastEditDate="2014-06-06T14:37:15.987" LastActivityDate="2014-06-06T14:37:15.987" Title="Quadratic variation question" Tags="&lt;stochastic-calculus&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7961" PostTypeId="2" ParentId="7960" CreationDate="2013-05-11T18:36:30.010" Score="2" Body="&lt;p&gt;&quot;Like&quot; Ito:&#xA;$$d (B^2) = B dB + B dB + dB dB$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is&#xA;$$B dB = \frac{1}{2} d (B^2) - \frac{1}{2} dB dB$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Integrate. Last term is 1/2 the quadratic variation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand the questions as follows: In iii) one has to define what $dB dB$ stands for and one has to &quot;proof&quot; the first line in my answer. In ii) one may use Ito to &quot;know&quot; that $dB dB = dt$.&lt;/p&gt;&#xA;" OwnerUserId="3548" LastEditorUserId="3548" LastEditDate="2013-05-13T13:56:03.533" LastActivityDate="2013-05-13T13:56:03.533" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="7962" PostTypeId="2" ParentId="7960" CreationDate="2013-05-11T19:28:53.627" Score="2" Body="&lt;p&gt;i picked this off from Shreve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Start with the definition of sampled quadratic variation: (&lt;em&gt;1&lt;/em&gt;) $\frac{1}{2}Q_\pi = \frac{1}{2}\sum\nolimits_{j=0}^{n-1} (W_{j+1}) - W_j)) ^2$ where $\pi$ = {0,1,2...,n} is a partition of $[0,T]$ (Note we took $\frac{1}{2}$ of both sides for reasons that will be clear in the next line.)  Now we know &lt;em&gt;(1)&lt;/em&gt; is equal to $\frac{T}{2}$, but we also know by simple algebra that&lt;br&gt;&#xA; &lt;em&gt;(1)&lt;/em&gt; =$\frac{1}{2}W_n^2 + \sum\nolimits_{j=0}^{n-1} W_j(W_j - W_{j+1})$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;All that remains to show the result is to make it rigorous in the sense that we're approximating a Brownian motion with a discretized version that converges in the limit as $n \to \infty$; we're also approximating the ito integral with sums, which also converge in the limit. Will leave this to you to iron out a bit further. Again, reference Shreve's notes if you don't have his excellent texts (google search :&lt;strong&gt;steve shreve notes&lt;/strong&gt;)&lt;/p&gt;&#xA;" OwnerUserId="5241" LastActivityDate="2013-05-11T19:28:53.627" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7963" PostTypeId="1" CreationDate="2013-05-12T01:25:57.937" Score="2" ViewCount="99" Body="&lt;p&gt;I need to use the lagragian multiplier to find the minimal martingale measure from the set of equivalent martingale measures.  i formed the lagragian  as L = $L(u(t,S(t)),\lambda) = E_\mathbb{P}[\dfrac{d\mathbb{Q}}{d\mathbb{P}}(H - V(T))^2] + \lambda(\sigma(t,S(t))u(t,S(t)) - \alpha(t,S(t)) + r(t))$ where H is the  payoff of an option and $V(T)$ is the terminal value of a self financing portfolio and $\dfrac{d\mathbb{Q}}{d\mathbb{P}} = \exp \{ \int_0^T udB(s) + \frac{1}{2} \int_0^T u^2 ds\}$ $\quad$  I need to slove for the above minimistion problem to get $u$. I have been trying this for more than a week now and i dont seem to yield any reasonable result.Can someone pls help me out with it especially how to compute this  $E_\mathbb{P}[\dfrac{d\mathbb{Q}}{d\mathbb{P}}(H - V(T))^2] $ .I think when i get that i can now take the partial derivatives to get my $u$ .Thank you&lt;/p&gt;&#xA;" OwnerUserId="5174" LastEditorUserId="16595" LastEditDate="2018-07-22T20:36:38.770" LastActivityDate="2018-07-22T20:36:38.770" Title="mean variance minimizer" Tags="&lt;martingale&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7964" PostTypeId="1" AcceptedAnswerId="12842" CreationDate="2013-05-12T06:29:32.933" Score="8" ViewCount="702" Body="&lt;p&gt;I've heard that 90% of retail investors in FX lose money. I want to analyze this in more detail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; Is there some literature that describes the statistics of profit/loss for retail traders in FX?&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;I would be interested to see the distribution function - i.e. how many clients gaining how much money.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How stable it is - with respect to time and other things e.g. country, currency pairs?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="4652" LastEditorUserId="35" LastEditDate="2013-05-12T16:05:30.303" LastActivityDate="2014-06-30T07:46:55.687" Title="Distribution of profit/loss for retail traders in FX" Tags="&lt;fx&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="7970" PostTypeId="1" AcceptedAnswerId="7995" CreationDate="2013-05-13T08:06:19.997" Score="5" ViewCount="559" Body="&lt;p&gt;It's a question pertaining to the correlation of a log asset process (following BM) and its time average, to put it into form, if &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X(t)=\mu t+\sigma W(t)$$&#xA;then &#xA;$$ \bar{X}(t):=\frac{1}{t}\int_0^tX(\tau)d\tau\,{\buildrel d \over =}\,\mu\frac{t}{2}+\frac{\sigma}{\sqrt3}W(t) $$&#xA;where we see that the mean and variance are $\mu t/2$ and $\sigma^2t/3$. Now I have a paper here (&lt;em&gt;Path integral approach to Asian options in the Black–Scholes mode&lt;/em&gt;) that says that the correlation coefficient of $X$ and $\bar{X}$ is equal to $\sqrt3/2$...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if I do it from definition &#xA;$$ \rho_{X(t),\bar{X}(t)}=\frac{Cov(\sigma W(t),\frac{\sigma}{\sqrt3}W(t))}{\sigma\sqrt t\frac{\sigma\sqrt t}{\sqrt3}}=\frac{\frac{\sigma^2}{\sqrt3} Var(W(t))}{\frac{\sigma^2 t}{\sqrt3}}=1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I guess I missed something somewhere, if anyone could give me his 2 cents...&#xA;Thanks&lt;/p&gt;&#xA;" OwnerUserId="5316" LastActivityDate="2013-05-16T00:49:25.533" Title="Covariance of brownian motion and its time average" Tags="&lt;brownian-motion&gt;&lt;asian-option&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7973" PostTypeId="1" CreationDate="2013-05-13T09:58:04.973" Score="2" ViewCount="148" Body="&lt;p&gt;I want to simulate a &lt;a href=&quot;http://sfb649.wiwi.hu-berlin.de/fedc_homepage/xplore/tutorials/sfehtmlnode22.html&quot; rel=&quot;nofollow&quot;&gt;geometric binomial process with state/time dependent increments&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the model is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}R_t=\frac{X_t}{X_{t-1}}\end{align}&#xA;\begin{align}P(R_t=u)=p(X_{t-1},t) \hspace{1cm} P(R_t = d)=1-p(X_{t-1},t)\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&#xA;\begin{align}p(X_{t-1},t)=\frac{1}{2^{|X_{t-1}|+1}}\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So e.g. how can I do this, if the initial value is equal to one? I want to use R. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The clue is, that  \begin{align}P(R_t=u)=p(X_{t-1},t)\end{align}&#xA;and also for $R_t=d$ is not constant?&lt;/p&gt;&#xA;" OwnerUserId="5078" LastActivityDate="2013-05-13T10:09:16.147" Title="How to simulate a Geometric Binomial Process with state/tie dependent increments?" Tags="&lt;r&gt;&lt;binomial-tree&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7976" PostTypeId="2" ParentId="4775" CreationDate="2013-05-13T13:23:46.660" Score="3" Body="&lt;p&gt;Papers for Quantitative Finance I recommend you: Arxiv, SSRN and Science Direct.&lt;/p&gt;&#xA;&lt;p&gt;Conferences: Quant Princeton Conference, Market MicroStructure Confronting Many Viewpoints; &lt;a href=&quot;https://rads.stackoverflow.com/amzn/click/com/1119952417&quot; rel=&quot;nofollow noreferrer&quot; rel=&quot;nofollow noreferrer&quot;&gt;an eponym book&lt;/a&gt; has been extracted from the 2010 issue of the conference.&lt;/p&gt;&#xA;&lt;p&gt;I think Arxiv.org is an excellent tool, maybe you don't find an specific paper, but all the preprints include good references that help you understand all about QF.&lt;/p&gt;&#xA;&lt;p&gt;[EDIT in March 2021] It is a conflicted advice, but if you are interested in &lt;strong&gt;market microstructure&lt;/strong&gt;, you should follow this journal:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.worldscientific.com/worldscinet/mml&quot; rel=&quot;nofollow noreferrer&quot;&gt;Market Microstructure and Liquidity&lt;/a&gt; - we created it because we had the feeling that a journal really dedicated to this field was needed.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="4701" LastEditorUserId="2299" LastEditDate="2021-03-18T08:15:33.233" LastActivityDate="2021-03-18T08:15:33.233" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="7978" PostTypeId="1" CreationDate="2013-05-13T22:43:28.560" Score="0" ViewCount="216" Body="&lt;p&gt;In software, I'm trying to implement the Stochastic Oscillator (&lt;a href=&quot;http://en.wikipedia.org/wiki/Stochastic_oscillator&quot; rel=&quot;nofollow&quot;&gt;see here&lt;/a&gt;), and I'd like to figure out a few things. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say I use standard inputs 14, 3 and 3. If my 14 is for intraday ticks, what is &lt;strong&gt;&lt;em&gt;the period&lt;/em&gt;&lt;/strong&gt; (%D Exponential Moving Average) that 3 represents? It doesn't seem to make sense, that the period should be &lt;strong&gt;&lt;em&gt;days&lt;/em&gt;&lt;/strong&gt;, if my 14 represents &lt;strong&gt;&lt;em&gt;intraday ticks&lt;/em&gt;&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Does it instead mean 3 periods of 14 (3 * 14), in this case? &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2690" LastEditorUserId="35" LastEditDate="2013-05-13T23:39:55.517" LastActivityDate="2013-06-13T14:27:16.207" Title="Grokking Stochastic Oscillator for Stocks" Tags="&lt;technicals&gt;&lt;indicator&gt;&lt;charts&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7980" PostTypeId="2" ParentId="7978" CreationDate="2013-05-14T14:12:02.587" Score="1" Body="&lt;p&gt;The period is the time between two ticks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It means you have to work with the last 3 periods, each periods have a lenght of 1/14 of a day. So you are working with a time windows of 3/14 of a day.&lt;/p&gt;&#xA;" OwnerUserId="5052" LastActivityDate="2013-05-14T14:12:02.587" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="7981" PostTypeId="1" AcceptedAnswerId="7982" CreationDate="2013-05-11T15:29:03.760" Score="6" ViewCount="181" Body="&lt;p&gt;It's a simplified model.&#xA;Suppose $U_t$ is a random variables subject to Lognormal($x_1$, $z_1^2$)distribution. $V_t$ is a random variables subject to Lognormal($x_2$, $z_2^2$)distribution. Suppose they are independent here.&#xA;The payoff of the heat rate-linked derivatives is $\max(U_T - V_T, 0)$.&#xA;How to price this option?&#xA;It's a integration stuff.&lt;/p&gt;&#xA;" OwnerUserId="5354" OwnerDisplayName="yita17" LastActivityDate="2013-05-14T15:00:14.617" Title="pricing of heat rate-linked derivative" Tags="&lt;probability&gt;&lt;optimization&gt;&lt;finance&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="7982" PostTypeId="2" ParentId="7981" CreationDate="2013-05-11T18:37:58.707" Score="5" Body="&lt;p&gt;This might be a surprise to you, you can evaluate the option using &lt;a href=&quot;http://en.wikipedia.org/wiki/Black%E2%80%93Scholes&quot; rel=&quot;noreferrer&quot;&gt;Black Scholes&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The key concept is change your &lt;a href=&quot;http://en.wikipedia.org/wiki/Num%C3%A9raire&quot; rel=&quot;noreferrer&quot;&gt;numéraire&lt;/a&gt; from dollar to the asset associated with $V$. The $V$ in your payout $\max(U_t-V_t,0)$ will effectively get replaced by a constant, the par forward of asset $V$ at maturity $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $U_t$ and $V_t$ are independent, you can parametrize them by two standard normal&#xA;random variables $\eta_1$, $\eta_2$ with mean $0$ and standard derivation $1$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$U_t = e^{x_1 + z_1 \eta_1}\quad\text{ and }\quad V_t = e^{x_2 + z_2 \eta_2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $(\cdots)^{+}$ stands for the function $\max(\cdots,0)$, the future value of the option&#xA;is given by the integral:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align}\text{F.V.} = &amp;amp; \int ( U_t - V_t )^{+} \exp( -\frac{\eta_1^2 + \eta_2^2}{2}) \frac{d\eta_1 d\eta_2}{2\pi}\\&#xA;= &amp;amp;\int ( e^{x_1 + z_1 \eta_1} -  e^{x_2 + z_2 \eta_2} )^{+} \exp( -\frac{\eta_1^2 + \eta_2^2}{2}) \frac{d\eta_1 d\eta_2}{2\pi}\\&#xA;= &amp;amp;\int ( e^{x_1 + ( z_1 \eta_1 - z_2 \eta_2 ) } -  e^{x_2} )^{+} \exp( z_2\eta_2 -\frac{\eta_1^2 + \eta_2^2}{2}) \frac{d\eta_1 d\eta_2}{2\pi}\tag{*1}&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let &#xA;$$z = \sqrt{z_1^2+z_2^2}\quad\text{ and }\quad\begin{cases}u = \frac{z_1\eta_1 - z_2\eta_2}{z}\\ \\ v = \frac{z_2\eta_1 + z_1\eta_2}{z}\end{cases}&#xA;\Longleftrightarrow&#xA;\begin{cases}\eta_1 = \frac{z_1 u + z_2 v}{z}\\ \\ \eta_2 = \frac{z_1 v - z_2 u }{z}\end{cases}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is easy to check:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ u^2 + v^2 = \eta_1^2 + \eta_2^2  \quad\text{ and }\quad du dv = d\eta_1 d\eta_2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $U_F = e^{x_1 + \frac{z_1^2}{2}}$ and $V_F = e^{x_2 + \frac{z_2^2}{2}}$ be the par forward of asset $U$ and $V$ at maturity $t$. We can rewrite $(*1)$ as:&#xA;$$&#xA;\begin{align}&#xA;&amp;amp;\int ( e^{x_1 + z u } -  e^{x_2} )^{+} \exp\left( \frac{z_2(z_1 v - z_2 u)}{z} -\frac{u^2 + v^2}{2}\right) \frac{du dv}{2\pi}\\&#xA;= &amp;amp; \int ( e^{x_1 + z u } -  e^{x_2} )^{+} \exp\left( \frac{z_2^2}{2}-\frac{(u + (z_2^2/z))^2 + ( v - (z_1z_2/z))^2}{2}\right) \frac{du dv}{2\pi}\\&#xA;= &amp;amp; \int ( e^{\tilde{x}_1 + z \tilde{u}} - e^{\tilde{x}_2} )^{+} e^{-\frac{\tilde{u}^2}{2}} \frac{d\tilde{u}}{\sqrt{2\pi}}&#xA;\quad\text{ where } &#xA;\begin{cases}&#xA;\tilde{u}\; = u + (z_2^2/z)\\&#xA;\tilde{x}_1 = x_1 - z \frac{z_2^2}{z} + \frac{z_2^2}{2} = \log U_F - \frac{z^2}{2}\\&#xA;\tilde{x}_2 = x_2 + \frac{z_2^2}{2} = \log V_F&#xA;\end{cases}\end{align}$$&#xA;As a result, we have:&#xA;$$\text{F.V.} = \int ( U_F\,e^{z\tilde{u} - \frac{z^2}{2}} - V_F )^{+} e^{-\frac{\tilde{u}^2}{2}} \frac{d\tilde{u}}{\sqrt{2\pi}}\tag{*2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is nothing but the future value of a call option with strike $V_F$ on an asset with par forward $U_F$ and standard derivation $z$ at maturity. You can finish the integral&#xA;using Black Scholes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $U_t$ and $V_t$ are not independent to each other, you can still transform F.V. to an integral of the form $(*2)$. The only difference is $U_F$ and $z$ there will be adjusted by&#xA;some factors. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to learn how to deal with the case with correlation, pickup any standard textbook on option pricing and look for the pricing of quanto option. The issues you encountered in pricing a quanto option is similar to the one you need to price your heat-linked option under the log normal model.&lt;/p&gt;&#xA;" OwnerUserId="5309" OwnerDisplayName="achille hui" LastActivityDate="2013-05-13T07:53:11.867" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="7985" PostTypeId="1" AcceptedAnswerId="7986" CreationDate="2013-05-14T22:24:22.310" Score="7" ViewCount="1412" Body="&lt;p&gt;Here is an interesting video by Nanex: &lt;a href=&quot;http://www.youtube.com/watch?&amp;amp;v=rB5jJuMP84E&quot;&gt;http://www.youtube.com/watch?&amp;amp;v=rB5jJuMP84E&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps some of you have already seen something similar. It is an animation of the order routing. It shows 1/2 second of trading activity in the stock Johnson &amp;amp; Johnson slowed down to a couple of minutes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm a bit confused on how the &quot;moving symbols&quot; should be interpreted. Firstly I thought that it was the orders that are sent to the other exchanges due to &quot;Smart order routing&quot;, in order to provide the trader with the best execution of his trade. However, the description of the video says: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;Note how every exchange must process every quote from the others -- for proper trade through price protection&quot;. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This lead me to believe these are the quotes that are sent to the other exchanges.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The description of the video also says: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;Watch High Frequency Traders (HFT) at the millisecond level jam thousands of quotes in the stock of Johnson and Johnson (JNJ) through our financial networks on May 2, 2013. Video shows 1/2 second of time. If any of the connections are not running perfectly, High Frequency Traders can profit from the price discrepancies that result. There is no economic justification for this abusive behavior&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Could someone give a more detailed explanation on how high frequency traders jam the networks to exploit these price discrepancies?&lt;/p&gt;&#xA;" OwnerUserId="4709" LastEditorUserId="4709" LastEditDate="2013-05-14T22:29:30.453" LastActivityDate="2013-05-15T01:25:54.903" Title="Profiting from price discrepancies between stock exchanges" Tags="&lt;arbitrage&gt;&lt;high-frequency&gt;&lt;order-handling&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7986" PostTypeId="2" ParentId="7985" CreationDate="2013-05-15T01:25:54.903" Score="10" Body="&lt;p&gt;The &quot;price protection&quot; refers to &lt;strong&gt;RegNMS&lt;/strong&gt; in the US. A stock exchange that does not have the best price must route all order flow to the exchange that does. The SIP in the figure is a consolidated feed that lists the best price among all exchanges.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider this example: a broker sends a market order to buy JNJ to NYSE where the best offer is \$86.97. However, NYSE notices that NASDAQ has an offer of \$86.96. By law, NYSE must route the order to NASDAQ even though the broker hasn't specifically asked for it. This is intended to protect the broker's client by ensuring that he gets filled at the best price no matter what.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This has nothing to do with &quot;smart order routing&quot;. SORT is a way for a broker to route to the exchange with (1) the best price, and (2) the lowest transaction cost. (This latter number is from the exchange's fee schedule.) SORT can give the broker and his client an improvement of tens of cents per one-hundred shares traded. That can really add-up for very large clients. But there is no RegNMS mandate regarding transaction costs; the US government's only concern is that the &lt;em&gt;price of the stock&lt;/em&gt; is the best available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, regarding NANEX's claims that HFTs are &quot;jamming&quot; quotes: NANEX often makes paranoid and disparaging remarks regarding automated market making. It is possible &lt;em&gt;in theory&lt;/em&gt; for an HFT to arbitrage a bid from one exchange that crosses with an ask from another. The HFT will send an &quot;intermarket sweep order&quot; to alert the exchanges not to route the order. (By law, the HFT is taking responsibility for RegNMS; this alone should give you an idea of how few market participants are actually capable of doing this.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, ask yourself this: Aside from the fact that arbitraging crossed markets is actually pretty rare, is it morally wrong for the HFT to perform this arb? Is this different from the ETF market maker that provides liquidity for retail investors by arbitraging the underlying product? Is it different from the options market maker who has determined his prices according to put-call parity?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My point is that &quot;simple arbitrage&quot; is not so simple. And it is actually a net benefit for the broader market. But a YouTube video like that will never go viral.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2013-05-15T01:25:54.903" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7987" PostTypeId="2" ParentId="2435" CreationDate="2013-05-15T03:29:09.337" Score="1" Body="&lt;p&gt;Rather simply and generally when you take the stochastic differential of a process and get no drift term but simply an ito integral, then this process is a martingale. &#xA;From memory that's how you retrieve some pde equations whose solutions lead to martingale (take the differential, look at the dt partial differentials term, then look for solution that would yield a vanishing dt term) &lt;/p&gt;&#xA;" OwnerUserId="5316" LastActivityDate="2013-05-15T03:29:09.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7989" PostTypeId="1" CreationDate="2013-05-15T09:23:50.983" Score="3" ViewCount="183" Body="&lt;p&gt;Just a very quick general question regarding the OIS market. Is it common place on termsheets to state a PV Notional and additionally a FV notional, if so what is the purpose of this and does market convention stipulate whether PV of FV notional should be booked? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most swaps I have dealt with previously, like IRS &amp;amp; Commodity Swaps, have generally always had one notional on both Fixed and Floating legs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Appreciate any comments.&lt;/p&gt;&#xA;" OwnerUserId="5335" LastEditorUserId="16595" LastEditDate="2018-06-19T16:19:43.613" LastActivityDate="2018-06-19T16:19:43.613" Title="Overnight Index Swaps" Tags="&lt;swaps&gt;&lt;overnight-index&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="7992" PostTypeId="1" CreationDate="2013-05-15T16:13:50.960" Score="2" ViewCount="218" Body="&lt;p&gt;Normally the Market exposure associated with your stock/portfolio is your delta for that stock/ portfolio. Basic idea of hedging involved here is buying/selling respective futures depending upon whether you are short or long. Right now I just use one single future traded on stock exchange to hedge against all kind of exposure, whether it's a sector or country exposure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In some cases, my future doesn't always has stock components for all sectors, like it may be missing some mining stocks. There are days when such sector can move by a large percentage. I basically want to minimize my risk for these days, for which I can manually buy the exchange traded sector specific future but then certain sectors have inter correlation with each other. So buying one may not be the best way but instead some combination of 2-3 futures which can minimize my exposure as much as possible. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, what I am trying to do is select some 2-3 futures (may be ETFS) which can reduce my market exposure to as low as possible? How can I select those 2-3 ETFs/Futures from my universe of say 9-10?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem can be solved by either iterating over all the possible combination of futures (present in my universe)  or coming up with some function for market exposure that can be minimized under certain constraint. I hope I am clear in what I am trying to accomplish or may be someone can help me to refine the problem statement, if they get the idea.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for some suggestions on how to continue or what could be a good objective function that could be minimized in this case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="5343" LastEditorUserId="5343" LastEditDate="2013-05-17T09:43:06.220" LastActivityDate="2013-05-17T09:43:06.220" Title="Market Exposure and Hedging" Tags="&lt;risk-management&gt;&lt;hedging&gt;&lt;futures&gt;&lt;market&gt;" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="7994" PostTypeId="1" CreationDate="2013-05-15T20:40:30.910" Score="14" ViewCount="2135" Body="&lt;p&gt;Has anyone ever formally proved that Markets are incomplete under the &lt;a href=&quot;http://en.wikipedia.org/wiki/Stochastic_volatility&quot;&gt;stochastic volatility&lt;/a&gt; model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that if there are more random sources than traded assets, then the market is incomplete but does there exist a proof of that meta-fact?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there is, could you please give me the reference to the paper(s)? &lt;/p&gt;&#xA;" OwnerUserId="5344" LastEditorUserId="467" LastEditDate="2013-05-17T08:49:49.280" LastActivityDate="2014-03-12T19:42:42.007" Title="How to prove that markets are incomplete under the Stochastic Volatility model?" Tags="&lt;market&gt;&lt;stochastic-volatility&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="7995" PostTypeId="2" ParentId="7970" CreationDate="2013-05-16T00:41:51.563" Score="2" Body="&lt;p&gt;You want to work directly with $\overline{X}$, and not some other r.v. with the same distribution, since equivalence in distribution doesn't imply that correlation remains the same.  For ease of notation, I'll assume that $\mu = 0$ and $\sigma = 1$.  I claim that&#xA;$$&#xA;\text{cov}\left(\overline{X},X \right) = \frac{1}{t} \int_0^t s \  ds.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this is what you get if you calculated $\frac{1}{t} \int_0^t \text{cov}(W_s, W_t) \ ds$.  For now, I will leave it to you to justify this step, but the approach you should take is 1) discretize the Riemann integral, and show that things work there, and 2) Use the Dominated Convergence Theorem to pass to the limit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In any case, what we get is &#xA;$$&#xA;\text{cov}\left(\overline{X},W_t \right) = \frac{1}{t} \cdot \frac{t^2}{2} = \frac{t}{2}.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using your formula for the variance of $\overline{X}$, this leads to&#xA;$$&#xA;\text{corr}(\overline{X},W_t) = \frac{\frac{t}{2}}{\sqrt{t}\cdot\frac{\sqrt{t}}{\sqrt{3}}} = \frac{\sqrt{3}}{2}.&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="3415" LastEditorUserId="3415" LastEditDate="2013-05-16T00:49:25.533" LastActivityDate="2013-05-16T00:49:25.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7996" PostTypeId="1" AcceptedAnswerId="7997" CreationDate="2013-05-16T02:26:46.103" Score="2" ViewCount="635" Body="&lt;p&gt;What are the intricate differences between SSF and CFD?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The similarities are that both take into account interest and settled daily thus looks more or less the same pima facie.&lt;/p&gt;&#xA;" OwnerUserId="909" LastActivityDate="2013-05-16T05:15:05.760" Title="What are the differences between CFD and SSF?" Tags="&lt;derivatives&gt;&lt;futures&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7997" PostTypeId="2" ParentId="7996" CreationDate="2013-05-16T05:15:05.760" Score="3" Body="&lt;p&gt;The basic difference is that CFDs are over-the-counter products and SSF are exchange listed products.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This does not, however, hold entirely true anymore as some CFDs are listed (example, &lt;a href=&quot;http://www.asx.com.au/products/asx-listed-cfds.htm&quot; rel=&quot;nofollow&quot;&gt;http://www.asx.com.au/products/asx-listed-cfds.htm&lt;/a&gt; ).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the historical reason for CFD's origin was that over-the-counter products could provide more leverage and such products were easier to register and distribute and hence more exotic products could be created. Also, CFDs can take exposure to markets that exchanges would not touch (for regulatory reasons), such as the A-share listed Mainland Chinese markets.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-05-16T05:15:05.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="7999" PostTypeId="2" ParentId="2435" CreationDate="2013-05-16T09:27:44.737" Score="5" Body="&lt;p&gt;For Itô Processes $dX(t) = \mu(t) \mathrm{d}t + \sigma(t) \mathrm{d}W(t)$ you have the result that (under appropriate assumptions which ensure that the local martingale is a martingale, e.g. $E( (\int \sigma(t)^2 \mathrm{d}t )^{1/2} ) &amp;lt; \infty$, etc.): $X$ is a martingale $\Leftrightarrow$ $\mu(t) = 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in order to check if a process $X$ is a martingale use Itô to get its &quot;$\mathrm{d}X = \ldots$-representation&quot; and check the coefficient of $dt$ on zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I believe the exact result can be found in Øksendal, Bernt K.: Stochastic Differential Equations: An Introduction with Applications)&lt;/p&gt;&#xA;" OwnerUserId="3548" LastEditorUserId="3548" LastEditDate="2013-05-16T09:50:38.580" LastActivityDate="2013-05-16T09:50:38.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8001" PostTypeId="1" CreationDate="2013-05-16T11:12:55.703" Score="2" ViewCount="256" Body="&lt;p&gt;An algorithm predicts price movement by some certainty and it invests proportional to the confidence level. Predictions range from -1 to +1, -1 meaning sell for a value of &lt;code&gt;$1&lt;/code&gt; +1 meaning buy for a value of &lt;code&gt;$1&lt;/code&gt;. Then the profit is calculated by multiplying the prediction with the relative price movement of the security traded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now assume a transaction cost of 0.6%. How does that change the profit the algorithm makes? For now, we only calculate the transaction cost for one cycle, i.e buy or sell once and the next time step sell or buy again in order to realize the profit.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;So to clarify. I have two variables &lt;code&gt;pred&lt;/code&gt; which is a prediction ranging from -1 and +1. I also have &lt;code&gt;d_price&lt;/code&gt; which is the relative price movement of the security. This can be 0.0003 or -0.002 or something similar. You calculate this by &lt;code&gt;d_price = (price_t1 - price_t0) / price_t0&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have this eqution now:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;profit = pred * d_price&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The algorithm makes two trades. It makes a trade when it makes the prediction at time step &lt;code&gt;t0&lt;/code&gt;, then it makes another trade at time step &lt;code&gt;t1&lt;/code&gt; in order to realize a profit. So if it predicts +0.5 and then the relative price movement is +0.01 then the profit it makes is 0.005.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I'm asking about is how this changes when there is a transaction cost of &lt;code&gt;trans=0.006&lt;/code&gt;. The transaction cost if percentage based, meaning if I buy 1 amount, I will receive 0.994 only. Likewise, if I sell 1 amount I will receive price * 0.994&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;profit = f(pred,d_price,trans)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is &lt;code&gt;f&lt;/code&gt; ?&lt;/p&gt;&#xA;" OwnerUserId="1681" LastEditorUserId="1681" LastEditDate="2013-05-16T16:32:04.730" LastActivityDate="2013-05-16T17:45:14.950" Title="Add transaction costs to prediction" Tags="&lt;trading&gt;&lt;transaction-costs&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8002" PostTypeId="1" CreationDate="2013-05-16T15:36:43.633" Score="4" ViewCount="201" Body="&lt;p&gt;I would like to ask a question about random walk. Campbell, Lo &amp;amp; Mackinlay defined the random walk, in the following way (RW3):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;cov[f(r_{t}),g(r_{t+k})]=0,\qquad k\neq0&#xA;$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;for all $f(\cdot)$ and $g(\cdot)$, where $f(\cdot)$&#xA;and $g(\cdot)$ are linear functions, and $\{r_{t}\}$&#xA;is a series of returns. So, the question is about the following equation: &#xA;$$&#xA;r_{t}=\alpha\varepsilon_{t-1}^{2}+\varepsilon_{t},\qquad\varepsilon_{t}\sim IID(0,\sigma^{2}).&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it random walk or not? And why? &#xA;(I have an idea, but i don't know, if it's true.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="4921" LastActivityDate="2013-05-16T15:36:43.633" Title="Is it random walk?" Tags="&lt;time-series&gt;&lt;stochastic-processes&gt;&lt;random-walk&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8003" PostTypeId="2" ParentId="4834" CreationDate="2013-05-16T16:15:19.953" Score="1" Body="&lt;p&gt;Following references from the answer provided by @Richard, we see that the optimality condition for a continuous process in general (and therefore an OU process in particular) is covered in Section 2 concluding on page 6 of &lt;a href=&quot;http://www.jbs.cam.ac.uk/research/working_papers/2002/wp0211.pdf&quot; rel=&quot;nofollow&quot;&gt;Thompson 2002&lt;/a&gt;, where he also represents the solution in terms of the Hamilton-Jacobi-Bellman equations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you change the limits of the integral on the top of that page (and its antecedents) to $ \min( T,H_S \wedge H_B  ) $ and then solve (which I don't think is necessarily possible in closed form) then you will have your optimum for the finite time horizon $T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you actually try to trade this, pay close attention to the practical issues raised by @Freddy.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2013-05-16T16:15:19.953" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8004" PostTypeId="1" CreationDate="2013-05-16T17:20:26.823" Score="0" ViewCount="185" Body="&lt;p&gt;Let you have the following mean reverting process:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\text{d}x_{t}=a(\theta-x_{t})\text{d}t$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the diffusion term is absent, that is this process is &lt;strong&gt;not&lt;/strong&gt; stochastic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let you know the value of $\theta$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You also know that at time $t=T$ it must be $x_{T}\simeq\theta$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(That is when $|x_{T}-\theta|$ is so small to be negligible because $x_{t}=\theta$ when $t\rightarrow\infty$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does any closed form and/or a proxy of $a(\theta,T)$ exist?&lt;/p&gt;&#xA;" OwnerUserId="3058" LastActivityDate="2013-05-16T17:20:26.823" Title="Exact value of mean reversion rate knowing terminal value of the process" Tags="&lt;stochastic-processes&gt;&lt;mean-reversion&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8005" PostTypeId="2" ParentId="8001" CreationDate="2013-05-16T17:45:14.950" Score="2" Body="&lt;p&gt;I'm not really sure what your question is, you appear to answer it yourself...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I'm understanding you correctly you are making 2 transactions at 0.6% cost, so then your profit = pred * d_price - pred*(trans) - pred/(1+d_price)*trans&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is just your raw profit minus your transaction costs at your opening and closing prices&lt;/p&gt;&#xA;" OwnerUserId="5092" LastActivityDate="2013-05-16T17:45:14.950" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="8006" PostTypeId="1" CreationDate="2013-05-16T17:46:07.183" Score="3" ViewCount="1112" Body="&lt;p&gt;I am trying to see if house price is cointegrated with interest rate, per capita income and rental vacancy rate and got the following output from ca.jo in R:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Johansen-Procedure # &#xA;###################### &#xA;&#xA;Test type: maximal eigenvalue statistic (lambda max) , with linear trend &#xA;&#xA;Eigenvalues (lambda):&#xA;[1] 0.52471580 0.12579545 0.10395269 0.06262468&#xA;&#xA;Values of teststatistic and critical values of test:&#xA;&#xA;          test 10pct  5pct  1pct&#xA;&#xA;r &amp;lt;= 3 |  8.47  6.50  8.18 11.65&#xA;&#xA;r &amp;lt;= 2 | 14.38 12.91 14.90 19.19&#xA;&#xA;r &amp;lt;= 1 | 17.61 18.90 21.07 25.75&#xA;&#xA;r = 0  | 97.44 24.78 27.14 32.14&#xA;&#xA;Eigenvectors, normalised to first column:&#xA;(These are the cointegration relations)&#xA;&#xA;                    y.l2   income.l2 interest.l2     vac.l2&#xA;y.l2             1.00000000  1.00000000   1.0000000 1.00000000&#xA;&#xA;income.l2   -10.16285869 -1.32443038 -12.6597547 0.61669614&#xA;&#xA;interest.l2  -0.06759846 -0.35179735  -0.1535533 0.02143767&#xA;&#xA;vac.l2        0.22771577  0.02087503  -0.4814448 0.02113804&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So from what I understand, the output indicates that there is one cointegration relation. And using the 1st eigenvector, I should get that y(which is log_price)=-10.16*income-0.0675*interest+0.227*vacancy rate. However, I ran a ADF test on this combination and got p-value 0.11 (meaning the combination is still non-stationary!). Why is that? Am I using the wrong thing? What does the &quot;.12&quot; mean after the variable names? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for any help!&lt;/p&gt;&#xA;" OwnerUserId="5349" LastEditorUserId="35" LastEditDate="2013-05-16T18:00:03.820" LastActivityDate="2013-06-23T17:09:57.027" Title="R Outputs from Johansen test. Linear combination still not stationary?" Tags="&lt;cointegration&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8009" PostTypeId="2" ParentId="7240" CreationDate="2013-05-17T12:26:18.800" Score="3" Body="&lt;p&gt;TradeStation offers python support via their WebAPI.  Check it out here: &lt;a href=&quot;http://tradestation.github.io/webapi-docs/&quot; rel=&quot;nofollow&quot;&gt;http://tradestation.github.io/webapi-docs/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3472" LastActivityDate="2013-05-17T12:26:18.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8010" PostTypeId="2" ParentId="447" CreationDate="2013-05-17T12:34:34.180" Score="0" Body="&lt;p&gt;Have you seen TradeStation's WebAPI? Check it out here: &lt;a href=&quot;http://tradestation.github.io/webapi-docs/&quot; rel=&quot;nofollow&quot;&gt;http://tradestation.github.io/webapi-docs/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3472" LastActivityDate="2013-05-17T12:34:34.180" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8011" PostTypeId="1" CreationDate="2013-05-17T13:25:16.550" Score="3" ViewCount="286" Body="&lt;p&gt;I am working on a toy model, in part of which an investor has to decide (based on some utility theory) how much money to invest in a given portfolio. For simplicity, assume that the portfolio is already constructed, it has an expected return $\mu$ and the volatility $\sigma$ which are known to the investor. If the investor invests $x$ in the portfolio, he gets $(1+\rho)x$ on the next step where&#xA;$$&#xA;  \rho \sim\mathscr N(\mu,\sigma^2)&#xA;$$&#xA;is a stochastic return on the investment. Suppose, that at the current moment the investor has $X$ as his capital. Are there any formulas from the utility theory on how to compute the desired level of investments given $X,\mu$ and $\sigma$ - and perhaps some additional parameters such as risk aversion of the investor? &lt;/p&gt;&#xA;" OwnerUserId="464" LastEditorUserId="41390" LastEditDate="2020-11-18T23:11:00.553" LastActivityDate="2020-11-18T23:11:00.553" Title="Desired portfolio volume based on utility theory" Tags="&lt;portfolio-management&gt;&lt;utility-theory&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="8012" PostTypeId="1" CreationDate="2013-05-17T14:42:46.477" Score="0" ViewCount="382" Body="&lt;p&gt;Does anyone have a view on the quality of the timestamping of GAINCAPITAL's free historical data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is non-FX data there and I wonder if the timestamps are in sync?&lt;/p&gt;&#xA;" OwnerUserId="4603" LastEditorUserId="35" LastEditDate="2013-05-19T13:22:46.903" LastActivityDate="2013-05-27T21:58:20.767" Title="Quality of GAINDATA timestamps" Tags="&lt;historical-data&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8013" PostTypeId="2" ParentId="8011" CreationDate="2013-05-17T14:50:17.783" Score="2" Body="&lt;p&gt;One approach is to use an exponential utility function: $U(x) = -e^{-\lambda x}$.  Here, $\lambda$ records what is known as the &lt;em&gt;absolute risk aversion&lt;/em&gt;.  Exponential utility functions are nice because they have a wealth independence property (of course, this may be seen as a drawback).  As we will see below, the initial capital $X$ plays no part in the optimal investment decision.  This decision only depends on $\lambda$.  Let's consider the agent's utility after investing $x$ dollars.  This is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;U(X + \rho x) = -e^{-\lambda (X + \rho x)} = e^{-\lambda X} \cdot \left( -e^{-\lambda \rho x} \right).&#xA;$$&#xA;The first term above does not depend on $x$, and is positive.  So, we only have to optimize (minimize) the second term over $x$.  This is the wealth independence property.  The second term is&#xA;$$&#xA;-\int_{-\infty}^\infty e^{-\lambda x y} e^{\frac{-(y - \mu)^2}{2 \sigma^2}}dy.&#xA;$$&#xA;We can evaluate this analytically by completing the square, yielding&#xA;$$&#xA;-\int_{-\infty}^\infty e^{\frac{-(y - \mu + \sigma^2 \lambda x)^2}{2 \sigma^2}} e^{-\mu \lambda x + \frac{\sigma^2 \lambda^2 x^2}{2}} dy = -e^{-\mu \lambda x + \frac{\sigma^2 \lambda^2 x^2}{2}}.&#xA;$$&#xA;The right hand side above is maximized when $-\mu \lambda x + \frac{\sigma^2 \lambda^2 x^2}{2}$ is minimized.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Differentiating, we achieve the optimal $x^* = \frac{\mu}{\sigma^2 \lambda}$.  This makes sense at least qualitiatively.  We invest more when $\mu$ is higher, lower when $\sigma^2$ is greater, and lower when $\lambda$ (our level of risk aversion), is higher.&lt;/p&gt;&#xA;" OwnerUserId="3415" LastActivityDate="2013-05-17T14:50:17.783" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="8014" PostTypeId="1" CreationDate="2013-05-17T15:11:06.843" Score="0" ViewCount="335" Body="&lt;p&gt;In general I'm wondering about the names of time-derivatives of price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. in physics the first few time-derivatives of position are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;f(x) = displacement&lt;/li&gt;&#xA;&lt;li&gt;f'(x) = velocity&lt;/li&gt;&#xA;&lt;li&gt;f''(x) = acceleration&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And the first integral (anti-derivative) of displacement is called &lt;em&gt;absement&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What would the equivalent financial terms be?&lt;/p&gt;&#xA;" OwnerUserId="2464" LastActivityDate="2013-05-21T11:29:17.943" Title="What's the first time-integral of price called?" Tags="&lt;finance&gt;&lt;mathematics&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8015" PostTypeId="2" ParentId="8014" CreationDate="2013-05-17T15:18:48.283" Score="2" Body="&lt;p&gt;Although I don't think that this is a question that fits in here, I will give you a reference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might want to have a look at the so called greeks, you find a first overview here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Greeks_(finance)&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Greeks_(finance)&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2013-05-17T15:18:48.283" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8019" PostTypeId="1" AcceptedAnswerId="8022" CreationDate="2013-05-18T13:03:23.437" Score="7" ViewCount="7001" Body="&lt;p&gt;As we all know the S&amp;amp;P and its implied vol, the VIX, generally move in opposite direction. To a large extent, the correlations makes sense. IV is one of the main drivers of the price of options, going long options is also going long IV. When the market drops, option prices, adjusted for the drop in the the S&amp;amp;P price, experience a further appreciation, the extra appreciation o the options above and beyond the the price movement can be attributed to an increase in IV. My question is when IV(the VIX) and SPX correlation breakdown from its usual inverse relationship( corr=-.95), what do you think this implies about future returns? Why does these instances occur? There are many times when the correlations drops to 0 and becomes positive!&lt;img src=&quot;https://i.stack.imgur.com/ixZEu.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is a picture with the 20 day correlation between the two indices.&lt;/p&gt;&#xA;" OwnerUserId="4729" LastActivityDate="2013-05-18T22:56:04.480" Title="When the Inverse Correlation between the SPX and VIX breaks down" Tags="&lt;correlation&gt;&lt;implied-volatility&gt;&lt;vix&gt;&lt;spx&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8020" PostTypeId="1" AcceptedAnswerId="8053" CreationDate="2013-05-18T14:29:47.223" Score="7" ViewCount="4503" Body="&lt;p&gt;In Basel II, EL is useful. It's calculated as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$EL = PD \cdot EAD \cdot LGD $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in advance IRB (internal rate-based approach),&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Correlation&#xA;$$R = 0.12 \frac{1 – e^{-50 \cdot PD}}{1 – e^{-50}} &#xA;+ 0.24 \cdot (1- \frac{ 1 – e^{-50 \cdot PD}} {1 – e^{-50}} )$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maturity adjustment &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$b = [0.11852 – 0.05478  \ln(PD)]^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Capital requirement &#xA;$$K = \{ LGD \cdot N(\sqrt{\frac{1}{1 – R}} \cdot G(PD) + \sqrt{\frac{R}{1 – R}} \cdot G(0.999)) – PD \cdot LGD\} \cdot \frac{1 + (M – 2.5) b}{1 – 1.5  b} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;here Ln denotes the natural logarithm; N(x) denotes the cumulative distribution function for a standard normal random variable; G(z) denotes the inverse cumulative distribution function for a standard normal random variable (i.e. the value of x such that N(x) = z). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Afterwards,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Risk-weighted assets &#xA;$$RWA = K \cdot 12.5 \cdot EAD$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$CAR = \frac{Tier 1 capital + Tier 2 capital}{Total Asset}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-- Basel II defines limits on CAR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, for unexpected loss, did Basel II make any restriction on it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FRM has a set of formula calculating UL from LGD, EAD etc...&#xA;Unexpected Loss&#xA;$$UL = EAD \sqrt{PD\cdot \sigma_{LGD}^2 + LGD^2 \cdot \sigma_{PD}}$$&lt;/p&gt;&#xA;" OwnerUserId="2161" LastEditorUserId="2161" LastEditDate="2013-05-19T00:27:12.813" LastActivityDate="2013-05-30T09:09:31.750" Title="Is Unexpected Loss ever used in Basel II?" Tags="&lt;risk-management&gt;&lt;credit-risk&gt;&lt;basel&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8021" PostTypeId="1" CreationDate="2013-05-18T15:50:43.750" Score="5" ViewCount="134" Body="&lt;p&gt;When buying a mortgage, you can choose to &quot;lock in&quot; a rate at any point within 60 days of your closing date. Once locked in, you can't revert.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This makes it a &lt;a href=&quot;http://en.wikipedia.org/wiki/Secretary_problem&quot; rel=&quot;noreferrer&quot;&gt;secretary problem&lt;/a&gt; - in the traditional problem, we would want to lock in at the lowest point after waiting $\sqrt{60}$ days. However, unlike in the traditional problem the rates are not i.i.d., so it becomes harder.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/A_Random_Walk_Down_Wall_Street&quot; rel=&quot;noreferrer&quot;&gt;One model&lt;/a&gt; is to assume prices form a random walk; I've found &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/0304414988901044&quot; rel=&quot;noreferrer&quot;&gt;this paper&lt;/a&gt; whose abstract says that the optimal strategy in random walk secretary problems is to choose the first rate, but the text is behind a pay wall so I'm not sure of all  the assumptions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone point me to a reference on optimal stopping in the case of locking in mortgage rates?&lt;/p&gt;&#xA;" OwnerUserId="5361" LastActivityDate="2013-05-18T15:50:43.750" Title="Optimal mortgage rate strategy" Tags="&lt;interest-rates&gt;&lt;optimization&gt;&lt;random-walk&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8022" PostTypeId="2" ParentId="8019" CreationDate="2013-05-18T18:44:49.483" Score="8" Body="&lt;p&gt;If you look at tick data, you will probably get an even better analysis. However, vix correlation tends to be negative with spx but remember that this is generally more true for when spx tanks. When spx goes up, the correlation isn't as strong. Why? People panic after a drop, therefore leading to people buying options. They don't care about black scholes delta hedging etc. They only want to hedge their position. However, when spot is going up, vix doesn't necessarily have to go down because if it does go down quite a bit, you buy the option, and just delta hedge and collect the difference between realized and implied volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another thing that you can also look at is the skew in the options market. When correlation between spot and vol is very high, you tend find a much steeper skew and vice versa. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;spx is cash settled so there is no physical to deliver. and spx is so liquid that it is nearly impossible for any individual to move the market. we know that market impact is proportional to sigma * sqrt( (order size) / (average volume) ). on any given day, spx and spy trades at least 2 million contracts. for a big player to move the market, you will literally need to trade at least half a billion which I've personally never seen. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should do an analysis of realized volatility during the previous 20 days as well. If the realized volatility during the previous 20 days was .16, and the implied volatility was .12, you will still buy the option even if markets were going up no? since you can make a profit from delta hedging.&lt;/p&gt;&#xA;" OwnerUserId="3440" LastEditorUserId="3440" LastEditDate="2013-05-18T22:56:04.480" LastActivityDate="2013-05-18T22:56:04.480" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="8025" PostTypeId="1" CreationDate="2013-05-19T13:51:40.280" Score="4" ViewCount="1771" Body="&lt;p&gt;I have a two-asset Black-Scholes model for a financial market:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dB_t=B_t r dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS_t=S_t(\mu dt+\sigma dW_t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I introduce a European claim $\xi=max(K,S_T)$ with maturity $T$, for some fixed $K$. I have calculated what the no-arbitrage price of this claim should be at each time $t&amp;lt;T$ by computing expectations under the equivalent martingale measure, which is a function of $S_t$, $t$, and the fixed parameters in the model. and I am now asked to find a replicating portfolio in the original 2 asset market for this claim.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that if $V(t,S)$ is a solution to the Black-Scholes PDE subject to the terminal condition $V(T,S)=\max(K,S)$, then $V(t,St)$ is a no-arbitrage time-$t$ price for $\xi$, and that the trading strategy given by taking initial wealth to be $V(0,S_0)$ and the time-$t$ holding in the stock to be $\frac{\partial V}{\partial S}$ is a replicating strategy for the claim.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I view the pricing function I originally found (by computing expectations) as a function $\xi(t,St)$, is it necessarily true taking initial wealth to be $\xi(0,S_0)$ and taking time-t holding in the stock to be $\frac{\partial \xi}{\partial S}$ will give a replicating portfolio? It should be, simply due to the fact there is a unique equivalent martingale measure in this market, so there must be a unique no-arbitrage time -$t$ cost for the claim at each time $t$, and so $\xi(t,S_t)$ must solve the Black-Scholes PDE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, is it possible to prove that this trading strategy does replicate the claim without appealing to the fact that the pricing function solves the Black-Scholes PDE?&lt;/p&gt;&#xA;" OwnerUserId="5364" LastActivityDate="2013-05-21T00:45:57.543" Title="Replicating strategy in the Black-Scholes model" Tags="&lt;black-scholes&gt;&lt;replication&gt;" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="8026" PostTypeId="2" ParentId="8012" CreationDate="2013-05-19T14:10:36.773" Score="2" Body="&lt;p&gt;I composed Gain-Capital's historical data files into one series for back-testing a while ago and too noticed that they are out of order.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each CSV file contains correctly ordered data points but it seems the CSV files are out of order (maybe wrongly named).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I went for another source in the end.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If Index A comes in at 12:00:01.001 and Forex B comes in at 12:00:01.001 - did they in reality arrive at the same moment?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I work at one of the largest market data providers there is. Out of experience I can asure you that &lt;strong&gt;there's is always a time-skew between two data-sources&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This skew is due to mainly 2 factors:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Number of intermediary provider/consumer pairs in the data supply chain&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Network and computation latency&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Even high-profile market data providers struggle with this and often the output-quality is not as good as you would expect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some providers will try to align different data sources by aggregating them over a period of 15 minutes before output - this is called &lt;em&gt;&quot;delayed&quot;&lt;/em&gt; data-quality.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Are you willing to share what you other source of data is?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://quant.stackexchange.com/questions/141/what-data-sources-are-available-online/168#168&quot;&gt;this answer&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2464" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2013-05-20T13:43:04.327" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8027" PostTypeId="2" ParentId="4924" CreationDate="2013-05-19T16:38:25.040" Score="1" Body="&lt;p&gt;A logical way of answering this question is proof by contradiction. First note that if it is not optimal to exercise an american option prior to expiry, then the option should have the same value as the european option. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;So assume that it is not optimal to exercise the option prior to expiry, i.e. assume that the american option has the same value as the european option. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Determine the value of the option using the Black-Scholes formula, for a range of initial spot prices, with all other parameters fixed. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Plot a graph of the option values against the spot prices, and on the same chart plot the payoff against the spot prices. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You observe that for a call option with no dividends, for any given spot price, the option value always exceeds the corresponding payoff value. This means that it will always be profitable to sell on, or indeed hold the option, rather than to exercise - i.e. it is never optimal to exercise the option prior to expiry. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;On the other hand, where there is a dividend and the spot price is large enough, the payoff is larger than option value - i.e. it is optimal to exercise the option. This is where the initial assumption that it is not optimal to exercise the option prior to expiry is contradicted, in which case we can't hold on to the argument that the European and American call options are of the same value.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="5368" LastActivityDate="2013-05-19T16:38:25.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8029" PostTypeId="2" ParentId="7802" CreationDate="2013-05-19T22:30:04.570" Score="4" Body="&lt;p&gt;Correct explanation by Freddy. Retail investors and even most institutional investors don't have access to trading, bid, or ask volumes. The reason is that there is no centralized body who would aggregate data. Would it be possible to put it in place? Certainly, but the big fx players (handful of the really big banks) would suffer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although not even the big banks don't see all the flows (only flow going through their books), they see a good amount of it and use it to trade. Just to get an idea how concentrated the market is, in the US in 2010, 7 banks account for 75% of fx turnover (see BIS Triennial Central Bank Survey). For example, it is a very valuable information to know how many billion of USD/JPY are sitting on the bid/ask because it will take the market longer to eat through all of it and this will act as support/resistance. &lt;/p&gt;&#xA;" OwnerUserId="5370" LastActivityDate="2013-05-19T22:30:04.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8030" PostTypeId="2" ParentId="4810" CreationDate="2013-05-19T23:21:18.767" Score="5" Body="&lt;p&gt;For part (d), instead of using Girsanov's theorem as phubaba suggested, I believe that we can state directly that the price is &#xA;$$V_t = e^{-r(T-t)} \mathbb{E}^Q \left[ u(S_T-K) \middle \vert \mathcal{F}_t \right],$$&#xA;where $u$ is the step function, $Q$ is the risk-neutral probability measure, and $\mathcal{F}_t$ is the filtration at time $t$, since the value of any European-style option with a payoff $f(S_T)$ is given by &#xA;$V_t = e^{-r(T-t)} \mathbb{E}^Q \left[ f(S_T) \middle \vert \mathcal{F}_t \right]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For part (e), note that for a general payoff function $f(S_T)$, we can write &#xA;$$V_t = e^{-r(T-t)} \int_{-\infty}^\infty f(S_0 e^x) \frac{1}{\sigma \sqrt{2 \pi (T-t)}} \exp \left\{-\frac{\left[x-(r-\sigma^2/2)(T-t)\right]^2}{2 \sigma^2 (T-t)} \right\} dx,$$&#xA;where $x \sim \mathcal{N}((r-\sigma^2/2)(T-t), \sigma^2(T-t))$.&#xA;Plugging in $f(S_0 e^x) = u(S_0 e^x-K)$, I get $V_t = e^{-r(T-t)}N(d_2)$.&lt;/p&gt;&#xA;" OwnerUserId="3188" LastEditorUserId="3188" LastEditDate="2013-05-20T01:38:21.737" LastActivityDate="2013-05-20T01:38:21.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8033" PostTypeId="2" ParentId="7240" CreationDate="2013-05-20T15:28:05.917" Score="1" Body="&lt;p&gt;Check out &lt;a href=&quot;https://www.quantopian.com&quot; rel=&quot;nofollow&quot;&gt;Quantopian&lt;/a&gt;.  It's all in Python.  You can backtest and paper trade your algo for free.  We do live trading by hooking your algorithm to your Interactive Brokers account.&lt;/p&gt;&#xA;" OwnerUserId="2605" LastActivityDate="2013-05-20T15:28:05.917" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8034" PostTypeId="2" ParentId="85" CreationDate="2013-05-20T20:44:31.853" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;The introduction of 'volume endowed' shapes that represent support and resistance forces. Theoretical paths in , unlike in Brownian motion are either strictly monotonically increasing, flat, or monotonically decreasing and obey the equilibrium equation with an inverse relation between LHS resistance/support forces and .&lt;/li&gt;&#xA;&lt;li&gt;Volatility  in chart to scalar is a combination of variables such as the geometric properties of the LHS resistance/support forces, change in price, trade size, and volume.&lt;/li&gt;&#xA;&lt;li&gt;The interaction of buy &amp;amp; sell orders within the volume is the propagator of price change.&lt;/li&gt;&#xA;&lt;li&gt;The use of truncated normal distributions in contrast to a log-normal distribution. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5376" LastEditorUserId="35" LastEditDate="2013-05-20T20:54:53.677" LastActivityDate="2013-05-20T20:54:53.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8035" PostTypeId="2" ParentId="8025" CreationDate="2013-05-21T00:45:57.543" Score="1" Body="&lt;p&gt;these kinds of questions usually require careful attention to details: if it's a hw question of some kind, consult shreve's lecture notes, he has a whole section on this precise topic in all its glory. as for intuition, since holding $\frac{\partial \xi}{\partial S}$ at any point in time eliminates the dW term, in the context of a discrete time period model of the evolution of your wealth and whether it hedges the derivative in each admissible state of the world, by hedging the 'brownian' randomness it is exposed to at each time step (there are two unknowns at each time step, how much to hold of the stock and how much to invest in the money market, which depend on the realization of the brownian), by induction on $n$, where n is the number of time steps used to discretize time, the result follows.&lt;/p&gt;&#xA;" OwnerUserId="5241" LastActivityDate="2013-05-21T00:45:57.543" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8036" PostTypeId="2" ParentId="3146" CreationDate="2013-05-21T01:54:03.713" Score="2" Body="&lt;p&gt;There are several reasons: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Expected payoff = 0&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know why you selected 0.5 ATR and 2 ATR away from the market but let's go with it for a while. This means that you want to gain 2x while risking only 0.5x. For now let's assume that FX log-returns are normal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To bring it to a higher level, we can use a piece of Black Scholes formula, namely the probability that an option ends up in the money is N(d$_{2}$) where N(*) is a cumulative normal distribution of a function and d2 is a function defined as in BS. So your expected payoff is E[payoff] = 2*N(d$_{2}$(2)) - 0.5*N(d$_{2}$(0.5)) which equals 0 if you do the calculation. This explains why you don't make money, not why in reality you lose money. Read on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Returns are not normally distributed&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, normal distribution is not a good representation of FX (or other) log-returns. The real distribution of returns has fat tails, often skewness, prices have jumps etc. If the assumption of normality is rejected, your model breaks down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Transaction costs&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As edouard mentioned, even if your E[payoff] = 0, you would incur transaction costs (through slippage, fees, bid/ask spread etc.) which would make your E[payoff] &amp;lt; 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope it helps. &lt;/p&gt;&#xA;" OwnerUserId="5370" LastActivityDate="2013-05-21T01:54:03.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8038" PostTypeId="2" ParentId="3319" CreationDate="2013-05-21T08:08:21.343" Score="0" Body="&lt;p&gt;The question remains unanswered...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you basically state by OAS = z - o  is that OAS is less than the z-spread for callable bonds. Now if you compute the PV of the bond by discounting it by respective yields (Treasury yield + spread) you will find that the the bond discounted using the z-spread will be cheaper than the one discounted by OAS. It does not make sense because as a rational investor I demand a larger discount for the call option that I provide the issuer with.&lt;/p&gt;&#xA;" OwnerUserId="5379" LastActivityDate="2013-05-21T08:08:21.343" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8039" PostTypeId="1" AcceptedAnswerId="8113" CreationDate="2013-05-21T10:32:22.650" Score="11" ViewCount="847" Body="&lt;p&gt;Let's assume we need to calculate a 1-day VaR for a portfolio of funds. Funds are traded, they can be bought and sold every day. We know exactly what the assets in each fund are. What is the right way to calculate VaR?&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;flatten the portfolio and calculate VaR on a portfolio of assets&lt;/li&gt;&#xA;&lt;li&gt;treat each fund as a tradeable asset and calculate VaR based on that?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="89" LastActivityDate="2013-06-05T11:36:52.903" Title="VaR for portfolio of funds" Tags="&lt;var&gt;&lt;funds&gt;" AnswerCount="2" CommentCount="7" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8040" PostTypeId="2" ParentId="8014" CreationDate="2013-05-21T11:29:17.943" Score="1" Body="&lt;p&gt;Well, if you divide a time integral by the length of the time interval, you'll get the average (in time) price:&#xA;$$&#xA;  \frac{1}{t}\int_0^T x_t\mathrm dt&#xA;$$&#xA;so &lt;em&gt;at least&lt;/em&gt; on of the meanings of the integral itself is an average price time the length of the interval. In such a case, I think the normalized quantity (the integral divided by the length) is more meaningful. It is used e.g. in the exotic options whose payoff depends on the average price.&lt;/p&gt;&#xA;" OwnerUserId="464" LastActivityDate="2013-05-21T11:29:17.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8043" PostTypeId="2" ParentId="7880" CreationDate="2013-05-21T23:46:03.880" Score="1" Body="&lt;p&gt;As already answered, your first question is call-put parity and this is an arbitrage relation independent of model assumption.&#xA;Your second question (under zero rates and dividends, in the Black-Scholes model) relates to &lt;em&gt;call-put symmetry&lt;/em&gt; : &#xA;$$Call(spot=S_0,strike=K)=Put(spot=S_0,strike= \frac{S_0^2}{K})\times \frac{K}{S_0}$$&#xA;It can be easily derived from the B&amp;amp;S formula.&#xA;A good reference is Peter Carr, &quot;&lt;strong&gt;Put-Call Symmetry: Extensions and Applications&lt;/strong&gt;&quot; in &lt;em&gt;Mathematical Finance&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From this symmetry formula, you get that a 110% call is approximatively 10% more expensive than a 90% put.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The intuition behind this for 110% call and 90% put : Consider a favorable upward move for the call:  $S_T=110\% \times (1+x)$ with $x&amp;gt;0$ and the symmetric equiprobable downward move $S_T=90\% \times (1-x)$ favorable for the put. For those equiprobable moves, the payout are respectively $110\% \times x$ for the call and $90\% \times x$ for the put. You see that the call payout is $20\%$ higher. As the probability of a favorable move is close to $1\over 2$, you can expect the call price to be $10\%$ above the put price.&lt;/p&gt;&#xA;" OwnerUserId="5278" LastEditorUserId="13496" LastEditDate="2014-12-15T13:32:06.950" LastActivityDate="2014-12-15T13:32:06.950" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8045" PostTypeId="2" ParentId="7568" CreationDate="2013-05-22T15:14:08.113" Score="22" Body="&lt;p&gt;Here are some pointers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all:  What you list as a Reuters RIC, &lt;code&gt;RSF.ANY.AAPL.OQ&lt;/code&gt;, is not really a RIC, only the &lt;code&gt;AAPL.OQ&lt;/code&gt; is. The initial part is some stuff which is essentially site specific and tells me that you are working on a site that has a legacy RTIC infrastructure (some Reuters/TIBCO technology which is quite old these days and for all practical purposes has been deprecated in favour of other distribution mechanisms, most notably the ADS). Ok, the &lt;code&gt;AAPL.OQ&lt;/code&gt; is the RIC, and only that. The initial part, the &lt;code&gt;RSF.ANY&lt;/code&gt; denotes the feed and that is because the Reuters Market Data System (an in-house ticker plant) is vendor agnostic and can have any feed on it, for example Bloomberg. So the initial part could might as well be &lt;code&gt;BB.ANY&lt;/code&gt; in order to denote the site's Bloomberg feed. .. and then the latter part would of course be a Bloomberg symbol, not a RIC. But we are getting ahead of ourselves here and mixing technology implementation with that of instrument naming schemes, most notably the RIC and the BSYM. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With regards to how Reuters RICs are constructed you can read &lt;a href=&quot;http://findb.aalto.fi/docs/Reuters/reuters_dataguide.pdf&quot;&gt;this guide&lt;/a&gt;. This document also exist on the Thomson Reuters web site but it doesn't seem to be available without registration. I just found the public link by Googling. There may be a newer version of this document but I doubt it makes much of a difference. RICs have been constructed the same way for ages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the Bloomberg Symbology (BSYM) you can find more information on &lt;a href=&quot;http://bsym.bloomberg.com/sym/pages/bsym-whitepaper.pdf&quot;&gt;this link&lt;/a&gt;. Bloomberg has multiple identifiers to identify the same thing. Only the &lt;code&gt;BBGID&lt;/code&gt; (Bloomberg Global ID) doesn't change with name changes, i.e it is constant over time. The downside is that it is totally meaningless. Another way to access a data item is to use a combination of the Ticker, Market and Pricing source with spaces between them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both Reuters and Bloomberg try to use the exchange's ticker symbol as part of their naming standard whenever possible. Unfortunately some exchanges use incomprehensible ticker symbols but that is not really the fault of Reuters or Bloomberg.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bloomberg has made their symbology available under a very liberal &quot;open source&quot; license. Don't be fooled though. He who defines the universe, owns it. Without an impartial body to allocate the symbols it is really not worth much, IMHO. The difficulty in naming financial instruments lies not so much with exchange traded instruments like equities. That is rather simple: Take the exchange's own ticker symbol and then add some self-invented identifier to denote the market place. That's how both Reuters and Bloomberg do it. Nope, my friend, the difficulty (and the real lock-in) is with all the OTC instruments.&lt;/p&gt;&#xA;" OwnerUserId="5388" LastActivityDate="2013-05-22T15:14:08.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8048" PostTypeId="2" ParentId="3135" CreationDate="2013-05-22T20:45:02.183" Score="1" Body="&lt;p&gt;This is a multiobjective problem and can be solved by building a cloud of portfolios with no constraints on either covariance or correlation and constraints on the return and constraints on either the covariance or correlation (whichever you didn't pick as being unconstrained). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, find the efficient (Pareto) frontier of this cloud to find the portfolio that is optimal for both correlation and covariance. This is a QCQP (Quadratically constrained quadratic program) since both correlation and covariance optimization are solved using quadratic programming.&lt;/p&gt;&#xA;" OwnerUserId="5390" LastActivityDate="2013-05-22T20:45:02.183" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8053" PostTypeId="2" ParentId="8020" CreationDate="2013-05-23T07:03:56.550" Score="3" Body="&lt;p&gt;let me try answer my own questions, partially, from below that are exerpted from FRM exam notes.&#xA; &lt;img src=&quot;https://i.stack.imgur.com/A6RcZ.jpg&quot; alt=&quot;FRM notes p1&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/IliNS.jpg&quot; alt=&quot;FRM notes p2&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So actually the K above, is UL, though it derives only from PD and maturity, but the G, N and 0.999, actually are calculating the VaR and UL.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, CAR is defined based on EAD and K, while K means UL. the essence is, CAR is to cover Unexpected Loss -- captical reserved is not for EL, EL shall be calculated in the cost already.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, how the K formular using G, and N comes from PD, I don't know... maybe need dig some papers.&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2013-05-23T07:03:56.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8055" PostTypeId="1" CreationDate="2013-05-23T07:17:05.600" Score="3" ViewCount="73" Body="&lt;p&gt;I understand the discount for Asian vs. European vol depends on time to expiry and length of averaging period. This makes sense intuitively; a short averaging period far away blurs into a single expiry, while a close---but long---averaging period is very different from a bullet. Is there a rule of thumb to approximate that discount?&lt;/p&gt;&#xA;" OwnerUserId="5394" LastEditorUserId="35" LastEditDate="2013-05-24T14:13:31.417" LastActivityDate="2013-05-24T14:13:31.417" Title="Discount of Asian vs European vols" Tags="&lt;implied-volatility&gt;&lt;european&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8056" PostTypeId="1" AcceptedAnswerId="8058" CreationDate="2013-05-23T14:11:45.353" Score="18" ViewCount="1794" Body="&lt;p&gt;Are there any papers that make an explicit contrast/comparison of the following (or other) vol models in terms of the suitability for addressing some empirical problem?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Wavelet multiresolution volatility&lt;/li&gt;&#xA;&lt;li&gt;EWMA&lt;/li&gt;&#xA;&lt;li&gt;GARCH family&lt;/li&gt;&#xA;&lt;li&gt;range volatility&lt;/li&gt;&#xA;&lt;li&gt;derivative implied volatility, models from stochastic finance. SABR etc. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="3174" LastActivityDate="2013-05-23T16:57:52.407" Title="So many volatility models. Any comparisons of them?" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;garch&gt;&lt;econometrics&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="8057" PostTypeId="1" AcceptedAnswerId="8059" CreationDate="2013-05-23T15:42:15.047" Score="0" ViewCount="4567" Body="&lt;p&gt;Iam doing research on return characteristics. As of today the scope of the research has changed from a local investor point of view to an international investor point of view. This basically means that returns have to based on returns in US$ instead of their local currency.&#xA;The most obvious way would be to download all the returns again and then annualize them. But this is a fairly tedious job and time consuming. A professor told me that I could also download the historic currency rates (so for example from JPY to USD) and then multiply the returns with this number. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I followed her advice in doing so and downloaded the average yearly historic rates. At first sight it looked plausible as , for example, the yearly return in AU$  was around 17 % and the conversion rate was 0.95 for that year. But looking at JPY returns, for a given year, of 16% and JPY/USD rate of 0.0126 will diminish all returns. &#xA;So what am I doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="5097" LastEditorUserId="35" LastEditDate="2013-05-23T16:08:32.250" LastActivityDate="2013-05-23T16:27:44.743" Title="How to adjust local currency returns to US$/EUR return?" Tags="&lt;equities&gt;&lt;portfolio-management&gt;&lt;returns&gt;&lt;diversification&gt;&lt;currency&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8058" PostTypeId="2" ParentId="8056" CreationDate="2013-05-23T16:18:22.663" Score="16" Body="&lt;p&gt;You may want to first broadly categorize volatility models before comparing between them within each class, it does not make sense to compare standard deviation models with an implied vol model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would broadly classify as follows:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Historical realized volatility: Those include standard deviation (sum of squared deviations), realized range volatility models, and essentially anything that is based on past price and return data. Such models strictly deal with past data points and do not bother to make any sort of prediction.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Implied volatility models: Those lead to volatility measures that are the other side of the coin of derivative prices, whereas the implied vol model functions as translation tool. Part of that categorization is the SABR model and essentially most all stochastic models that implement different sorts of Brownian Motion &quot;drivers&quot;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Volatility forecasting models generally utilize past data, contrary to implied volatility models, in order to make predictions about future volatility dynamics and levels. Most Garch volatility models fall under this category.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A sub-category deals with intra-day volatility models such as Pearson or Garman-Klass.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I understand that my answer does not compare each individual volatility model but I believe, or hope, it helps to broadly compare and classify different models. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-05-23T16:57:52.407" LastActivityDate="2013-05-23T16:57:52.407" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="8059" PostTypeId="2" ParentId="8057" CreationDate="2013-05-23T16:27:44.743" Score="2" Body="&lt;p&gt;You are not doing anything wrong. You just need to multiply the absolute return by the currency conversion factor. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You trade 200,000,000 yen notional and generate a return of 16% on that notional, then simply multiply 32,000,000 jpy gain by your conversion factor 0.0126 to yield a return of 403,200 USD. The return of 16% was generated on the asset itself, it does not matter in which currency it was originally expressed in. When you buy and sell a car and yield a return then it does not matter whether both deals were undertaken in USD or Euro, at least not for the sake of calculating the relative return. Currency considerations only come into play when you transacted the first leg of the trade in a different currency from the one of the second leg. Then part of the return will need to be attributed to fluctuations in the respective currency pair, absent any currency hedge. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-05-23T16:27:44.743" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8060" PostTypeId="1" AcceptedAnswerId="8062" CreationDate="2013-05-23T16:50:39.577" Score="3" ViewCount="178" Body="&lt;p&gt;I've seen parsec (&lt;a href=&quot;http://parsec.cs.princeton.edu/index.htm&quot; rel=&quot;nofollow&quot;&gt;http://parsec.cs.princeton.edu/index.htm&lt;/a&gt;), which has a PDE pricing component, but the distribution is enormous and I haven't bothered to try to download it for review.  I'm interested in finding benchmarks for pricing a portfolio of vanilla options and running some scenarios; has anybody seen anything like this?&lt;/p&gt;&#xA;" OwnerUserId="5400" LastActivityDate="2014-06-14T18:46:32.870" Title="Are there any good benchmarks for performance of vanilla option pricing code?" Tags="&lt;option-pricing&gt;&lt;programming&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8062" PostTypeId="2" ParentId="8060" CreationDate="2013-05-23T19:11:22.330" Score="3" Body="&lt;p&gt;On a single-option basis, there is &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1030143&quot; rel=&quot;nofollow&quot;&gt;this paper comparing methods&lt;/a&gt; by Mark Joshi.  It doesn't specifically examine portfolios, but there's a reason for that.   Portfolio and scenario computations are embarrassingly parallel, so once you have achieved your most efficient available option pricer, the rest is simply about wise distribution of your computational load.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is also &lt;a href=&quot;http://www.epics-project.eu/publications/2011_jin_fccm.pdf&quot; rel=&quot;nofollow&quot;&gt;this somewhat minimalist&lt;/a&gt; paper for FPGA schemes, though to be honest I doubt many people are bothering with FPGA for option pricing, since you can be faster market-making on a delta grid.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="7867" LastEditDate="2014-06-14T18:46:32.870" LastActivityDate="2014-06-14T18:46:32.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8063" PostTypeId="1" AcceptedAnswerId="8064" CreationDate="2013-05-23T21:15:28.043" Score="0" ViewCount="76" Body="&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;XYZ Corp pays a $0.25/share dividend - Ex date=1/15/13, Pay date 1/31/2013&#xA;I own 100 total shares of XYZ on 1/1/2013&#xA;I buy 50 shares of XYZ on at 12 PM 1/15/2013 (increasing total shares to 150)&#xA;I buy 50 more shares of XYZ at 1 PM on 1/15/2013 (increasing total shares to 200)&#xA;I dispose of all 200 shares of XYZ at 4PM on 1/15/2013 (decreasing total shares to 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On 1/31/2013, what is my dividend payment worth?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;25.00 (using balance of 100 on &lt;strong&gt;start&lt;/strong&gt; of &lt;em&gt;ex date&lt;/em&gt;:1/15/2013)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;37.50 / 50.00 (using balances of 150 and 200 &lt;strong&gt;during&lt;/strong&gt; &lt;em&gt;ex date&lt;/em&gt;:1/15/2013)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Nothing (because I didn't own it at the end of &lt;em&gt;ex date&lt;/em&gt;: 1/15/2013)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Something else entirely&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="5403" LastEditorUserId="5403" LastEditDate="2013-05-23T21:41:56.760" LastActivityDate="2013-05-24T00:03:31.387" Title="How is the dividend payment calculated when an asset is disposed on the ex date?" Tags="&lt;dividends&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8064" PostTypeId="2" ParentId="8063" CreationDate="2013-05-24T00:03:31.387" Score="3" Body="&lt;p&gt;You get nothing, by this logic you could accumulate risk-free money all day by buying/selling on the ex-date as long as the dividend is larger than the spread.&lt;/p&gt;&#xA;" OwnerUserId="2732" LastActivityDate="2013-05-24T00:03:31.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8065" PostTypeId="1" AcceptedAnswerId="8068" CreationDate="2013-05-24T04:58:54.897" Score="6" ViewCount="2502" Body="&lt;p&gt;I'll be starting a MFE grad program in Fall, and some of the classes have a lab that use the IB TWS &amp;amp; API. I'd like to play around with it for fun this summer. Unfortunately, I don't have an IB account, and they require a funded account to even use their paper trading services.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you know if I could still effectively test code even though I can't use data from the TWS? I'd like to run in on Ubuntu, and test some C++ code (using Eclipse).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any workarounds whatsoever? Suppose I could get the needed data from other sources. I don't even need real data or real tickers. I'd gladly synthesize data if that would work. I just don't want to go through all the trouble if it's going to be hopeless.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not even trying to test trading strategies! I just want to test some code and brush up on my C++ while playing with the IB API before grad school.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="5407" LastActivityDate="2016-03-21T05:22:50.733" Title="IB TWS &amp; API, without IB account?" Tags="&lt;backtesting&gt;&lt;programming&gt;&lt;interactive-brokers&gt;" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8066" PostTypeId="2" ParentId="8065" CreationDate="2013-05-24T05:09:35.437" Score="2" Body="&lt;p&gt;You can fund the account with the minimum account requirement for setup, then withdraw your funds immediately. You will then only need enough in your account to cover monthly data usage fees. (You don't have to maintain an account minimum to keep the account open.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's not an ideal solution but you may be able to borrow the funds off a family member for a week or so. It's all in the name of your education.&lt;/p&gt;&#xA;" OwnerUserId="5408" LastEditorUserId="5149" LastEditDate="2013-05-24T14:12:55.437" LastActivityDate="2013-05-24T14:12:55.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8068" PostTypeId="2" ParentId="8065" CreationDate="2013-05-24T12:35:25.357" Score="6" Body="&lt;p&gt;The IB website have a demo version of TWS for download which you can use with their C++, Java etc API. The price feed is stale and orders are not cleared but it shouldn't matter for your purposes. The demo version doesn't require a account/username.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are also active groups which can be very helpful for details on IB API. One large group is, for instance, on Linkedin.&lt;/p&gt;&#xA;" OwnerUserId="881" LastEditorUserId="-1" LastEditDate="2013-09-16T21:45:25.960" LastActivityDate="2013-09-16T21:45:25.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8069" PostTypeId="1" CreationDate="2013-05-24T14:26:18.340" Score="2" ViewCount="564" Body="&lt;p&gt;For computation of realized volatility, especially range based volatility, deal prices are commonly used.&#xA;If Level I data available should the deals data still be used or another measures of spot price would be preferable(for example, mid-price)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Such measures could diminish the impact of bid-ask spread, but what would be the consequences for the volatility measures?&#xA;Would the assumptions of the process be violated or quite the opposite - the price process would become closer to theoretical one?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming for the ranged based models, price follows Brownian motion with zero drift:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dp_t = \sigma dW_t$, where $p = ln(P)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What would the better price measure for them?&#xA;Does the answer change if we use different time windows( 1, 5, 30, 60 minutes)?&lt;/p&gt;&#xA;" OwnerUserId="5409" LastActivityDate="2013-05-24T15:52:26.080" Title="Which prices to use to compute realized volatility?" Tags="&lt;volatility&gt;&lt;estimation&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8070" PostTypeId="1" AcceptedAnswerId="8075" CreationDate="2013-05-24T15:44:04.230" Score="3" ViewCount="214" Body="&lt;p&gt;Some equities on European markets have options traded in two different exercise styles: American and European. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Examples: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.eurexchange.com/exchange-en/products/equ/opt/31302/&quot; rel=&quot;nofollow&quot;&gt;ABB&lt;/a&gt; and &lt;a href=&quot;http://www.eurexchange.com/exchange-en/products/equ/opt/31540/&quot; rel=&quot;nofollow&quot;&gt;ABB (european)&lt;/a&gt; on Eurex&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.meff.es/aspx/Financiero/Ficha.aspx?ticker=SAN&amp;amp;id=ing&quot; rel=&quot;nofollow&quot;&gt;Banco Santander&lt;/a&gt; on MEFF&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Consider constructing volatility surface for given equity with two set of options, when for each expiration/maturity there are two corresponding IV points (from European and  American options respectively.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How one in this case would construct the surface and what is the reasoning?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Using only one set of options (either European or American), chosen&#xA;by some parameter (total volume, open interest, etc.)&lt;/li&gt;&#xA;&lt;li&gt;Combining both sets&lt;/li&gt;&#xA;&lt;li&gt;Something else&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2909" LastActivityDate="2021-04-24T21:12:07.063" Title="Different Exercise Style Options on Same Underlying" Tags="&lt;options&gt;&lt;implied-volatility&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8071" PostTypeId="2" ParentId="8069" CreationDate="2013-05-24T15:52:26.080" Score="1" Body="&lt;p&gt;Which realized volatility are you attempting to measure is highly important in order to determine which prices and return series to utilize to compute realized volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here couple ideas:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;What do you attempt to measure: Bid/Offer spread volatility, traded price variations,...Even if you attempt to measure asset price variations it can make a difference whether you use bid, offer, mid-prices, or traded prices. Using bids or offers for this particular purpose can sometimes result in erratic moves (because prices may fluctuate widely even though nobody trades on those bids and offers), mid prices somewhat smooth that out, and traded prices are maybe the most preferable to use in this regards. However, there are asset classes where you do not easily get a hold of traded prices, such as OTC currency price series. So, depending exactly what you attempt to measure will help to narrow down which price series to use.  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Which time compression do you target with your volatility measure? Are you dealing with tick based data, with compressed intraday data, daily, weekly data. It can make a difference because there are realized volatility models out there that shine on capturing intraday variations, while others are better in measuring high frequency price return variations or daily return volatility. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What specific volatility measure are you targeting. Garman-Klass, for example specifies exactly which price series to use (such as Open, High, Low, Close).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Combined, you should be able to exactly determine which price series to use. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-05-24T15:52:26.080" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8073" PostTypeId="1" AcceptedAnswerId="8074" CreationDate="2013-05-24T17:14:32.903" Score="2" ViewCount="2478" Body="&lt;p&gt;Is there a website that offers current LIBOR rates for all tenors for free in machine readable formats?&lt;/p&gt;&#xA;" OwnerUserId="5412" LastActivityDate="2013-05-24T20:24:31.990" Title="LIBOR Rates available in CSV, XML etc" Tags="&lt;interest-rates&gt;&lt;programming&gt;&lt;libor&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8074" PostTypeId="2" ParentId="8073" CreationDate="2013-05-24T20:14:59.833" Score="4" Body="&lt;p&gt;It depends a little what you mean by &quot;current&quot; but the CDS market developed a &quot;&lt;a href=&quot;http://www.cdsmodel.com&quot; rel=&quot;nofollow&quot;&gt;standardized model&lt;/a&gt;&quot; for transforming between upfront and spread-based quotes.  The model depends on an agreed curve of risk-free rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The LIBOR rates used for CDS settlement are available at:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.markit.com/news/InterestRates_CCY_yyyymmdd.zip&quot; rel=&quot;nofollow&quot;&gt;https://www.markit.com/news/InterestRates_CCY_yyyymmdd.zip&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is not up-to-the minute, so maybe it's too slow for you.  I'm not sure what the terms of service are, but they must be reasonably liberal in order to allow the industry to trade off them.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2013-05-24T20:24:31.990" LastActivityDate="2013-05-24T20:24:31.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8075" PostTypeId="2" ParentId="8070" CreationDate="2013-05-24T20:21:17.613" Score="2" Body="&lt;p&gt;If you can get anywhere close to the same open-interest and volume using European options as the corresponding American ones, you'll have a much easier time just using them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;American options with high probability of early exercise don't contain information about that back end of the vol surface, and it's kind of hard to decide just what to do with their implied vols.  The only way you can be sure you've done it properly is to throw them all into some giant multivariate optimization algorithm on a parameterized volatility surface.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, if you're calibrating the vol surface to &lt;em&gt;trade&lt;/em&gt; these same American options, rather than (say) to fit some exotics-pricing or risk model, then you had better calibrate to those American options.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2013-05-24T20:21:17.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8076" PostTypeId="1" AcceptedAnswerId="8104" CreationDate="2013-05-25T13:58:34.917" Score="18" ViewCount="4906" Body="&lt;p&gt;I am currently doing my research for my master thesis, which will clearly focus on the question of risk managment in algorithmic trading systems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have done research about this topic and found some valuable nuggets here:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Extreme Value Theory and Fat Tails in Equity Markets. Blake LeBaron&#xA;and Ritirupa Samanta. May, 2004.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Algorithmic Trading and DMA&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;However, as I see, algorithmic trading is an extremely hidden topic. Therefore, I really would appreciate from you as financial professionals, a hint about papers about risk managment in hft/algorithmic trading/blackbox trading!&lt;/p&gt;&#xA;" OwnerUserId="5414" LastEditorUserId="5447" LastEditDate="2015-11-01T12:47:46.440" LastActivityDate="2016-08-15T13:02:05.550" Title="Papers about risk management in algorithmic trading?" Tags="&lt;research&gt;&lt;risk-management&gt;&lt;high-frequency&gt;&lt;algorithmic-trading&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="19" ContentLicense="CC BY-SA 3.0" />
  <row Id="8077" PostTypeId="2" ParentId="3319" CreationDate="2013-05-25T17:19:53.367" Score="3" Body="&lt;p&gt;The Z Spread is the constant spread above the treasury curve that compensates the bond holder for credit, liquidity and option risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Option Adjusted spread is simply the Z- Spread excluding the premium to compensate for the option risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, the OAS is the spread above the treasury curve that compensates for credit and liquidity risk only. &lt;/p&gt;&#xA;" OwnerUserId="5418" LastActivityDate="2013-05-25T17:19:53.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8079" PostTypeId="1" AcceptedAnswerId="8080" CreationDate="2013-05-25T22:51:46.380" Score="7" ViewCount="2413" Body="&lt;p&gt;What  stochastics processes (if any) are used to model currencies  exchange rates &#xA;and how good are such models ?&lt;br&gt;&#xA;References on subj. are also highly welcome. &lt;/p&gt;&#xA;" OwnerUserId="4652" LastActivityDate="2013-05-29T16:34:21.873" Title="Statistical models for exchange rates?" Tags="&lt;fx&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8080" PostTypeId="2" ParentId="8079" CreationDate="2013-05-26T07:11:51.250" Score="7" Body="&lt;p&gt;I work extensively with currency models and have to admit there is not much in the public domain regarding recent published research that may satisfy your needs. Some of the below mentioned models incorporate stochastic components but please keep in mind that most research on currencies focuses on fundamentals (such as balance of payments) and depending on your investment and trading horizon they may suit your needs. There is hardly anything published that deals with high frequency currency models that I would deem noteworthy but I am happy to stand corrected by others if they can dig up such research.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having said that may I point you to some dated papers that may generate ideas and on which you may expand:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Olson is a highly respected data supplier as well as research house (they recently also offer investment services). They provide access to some of their older research:&#xA;&lt;a href=&quot;https://www.olseninvest.com/customer/papers.vm&quot; rel=&quot;nofollow&quot;&gt;Olson&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Another dated paper that walks through some of the more basic methodologies: &#xA;&lt;a href=&quot;https://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=6&amp;amp;ved=0CEsQFjAF&amp;amp;url=http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.5.8119&amp;amp;rep=rep1&amp;amp;type=pdf&amp;amp;ei=b7OhUbPQIsbJkgW7o4GIBA&amp;amp;usg=AFQjCNHuZ1u5Uf7b1Y-d_MElcC2CtZFHCw&amp;amp;sig2=r-aJuYxQmoupELUfm0RQBQ&amp;amp;bvm=bv.47008514,d.dGI&amp;amp;cad=rja&quot; rel=&quot;nofollow&quot;&gt;Link&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The following papers provide somewhat of an introduction to modeling fx strategies in higher frequency space though I did not derive much added value out of those. See for yourself whether you like any of those:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://faculty.washington.edu/ezivot/research/hflectures.pdf&quot; rel=&quot;nofollow&quot;&gt;washington.edu&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.bis.org/publ/mktc05.pdf&quot; rel=&quot;nofollow&quot;&gt;bis&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.econ.ucdavis.edu/faculty/jorda/papers/macrodyn02.pdf&quot; rel=&quot;nofollow&quot;&gt;ucdavis.edu&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.essex.ac.uk/csee/research/publications/technicalreports/2010/ces-519.pdf&quot; rel=&quot;nofollow&quot;&gt;essex.ac&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="1386" LastEditDate="2013-05-29T16:34:21.873" LastActivityDate="2013-05-29T16:34:21.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8081" PostTypeId="2" ParentId="8079" CreationDate="2013-05-26T07:19:58.923" Score="4" Body="&lt;p&gt;I'm not exactly sure what you are looking for but if you're interested in models for longer periods this &lt;a href=&quot;http://www.imf.org/external/pubs/ft/wp/2011/wp11116.pdf&quot; rel=&quot;nofollow&quot;&gt;overview paper&lt;/a&gt; might be a good starting point for you. If you can tell use more about what you want to do with the model it might be helpful to give more specific answers.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2013-05-26T07:19:58.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8082" PostTypeId="1" AcceptedAnswerId="8086" CreationDate="2013-05-26T23:01:26.563" Score="0" ViewCount="624" Body="&lt;p&gt;I'm trying to price an interest rate swap and would like to change the default coupon payment frequency from 1 a year to 2 or 4 a year. I'm using&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Price = swapbyzero(RateSpec, LegRate, i, Maturity, 'Principal', Principal); &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and tried &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Price = swapbyzero(RateSpec, LegRate, i, Maturity, 'Principal', Principal,'Period',2); &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where 'Period' is a valid option when pricing bond using &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;prbyzero&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm using matlab 2013a&lt;/p&gt;&#xA;" OwnerUserId="2466" LastActivityDate="2013-05-27T15:08:12.570" Title="Matlab; How to specify Coupon frequency for Interest Rate Swap" Tags="&lt;interest-rates&gt;&lt;fixed-income&gt;&lt;pricing&gt;&lt;swaps&gt;&lt;matlab&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8083" PostTypeId="1" CreationDate="2013-05-27T05:39:41.743" Score="6" ViewCount="170" Body="&lt;p&gt;The Fed's balance sheet has been expanding over the last few month due to QE3. When the Fed goes out to buy treasuries or MBS, it's taking those securities out of the market and exchanging them with cash (an increase in the monetary aggregates). Question is, if the central bank buys treasuries from the primary dealers, where does the primary dealer take the cash he just received from the Fed? Many are claiming that the rally in the SPX index is fueled by QE's easy cash, if so what data could be used to validate this story?&lt;/p&gt;&#xA;" OwnerUserId="4729" LastEditorUserId="848" LastEditDate="2013-05-27T06:05:50.873" LastActivityDate="2013-05-27T08:15:33.743" Title="Relating Quantitative Easing to the rally in the SPX" Tags="&lt;macro-economics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8084" PostTypeId="2" ParentId="8083" CreationDate="2013-05-27T07:59:15.417" Score="5" Body="&lt;p&gt;First of all Fed traders do not necessarily buy from primary dealers. In fact Fed buys most treasuries in the secondary market and that can include sell-side investment banks or even large fund houses that may not have primary dealer status. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keeping this in mind, essentially anyone who has large chunks of treasuries to sell which the Fed might be fond of will use the money to either re-invest elsewhere or park with, guess who, the Fed. Yes, the sad truth is that a lot of the money the Fed intended to pump into the system gets parked in overnight or even term loans with the Fed, exactly where it came from for lack of investment opportunities. The rest will be invested in fresh bond series, equities, essentially anything that meets the investment guidelines and targets. Only money that banks cash out of selling bonds to the Fed off their own balance sheets can be put to work and lend out by a multiple through the fractional reserve banking system. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, the reason why equity markets are so bid is not really because of quantitative easing but it is due to a reason that also originally caused the Fed to act by buying government bonds: Unstable markets and a lack of growth. Hardly any company currently invests in capital expenditures, hardly any company shows interest in buying other companies (at least not to the tune of past deal data), hardly any company massively pays out dividends. Guess what that results in: Exorbitant earnings. Equity investors like nothing more than higher expected earnings and potentially juicy dividend payouts and that is why everyone chases equities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That the Fed stepped in and still continues to pump money into the &quot;system&quot; (again system here is meant to be those who sell treasuries to the Fed) is an important psychological factor but in terms of distribution of money it hardly can even be compared to large fiscal packages that the government may shower upon its people and corporates (such as the Japanese government is doing without much success).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In summary, the biggest effect the Fed is having on equity markets is a signaling effect and a subordinate effect is that Fed is freeing bond holders off their investments and letting them switch into other asset classes, such as equities. Keep in mind that some of the largest bond powerhouses publicly announced they believe the bond rally has ended and that they have started to lighten up on their US government bond holdings. Of course a big reason for that is also the meager returns US treasuries provide vs, or example, emerging market bond yields. So, I do not believe the Fed directly pumps any money into equity markets. Remember that BOJ has run a zero interest policy (their own form of QE) for years and look where Nikkei has traded until recently. The large Nikkei rally can thus not be attributed to BOJ buying government bonds but almost entirely to the effect the buying has on the exchange rate and direct impact on Japan's export-centric industries. Similarly, US equity markets are fueled by other factors, which I mentioned above, rather than a direct effect that results from Fed purchases of US treasuries. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-05-27T08:15:33.743" LastActivityDate="2013-05-27T08:15:33.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8085" PostTypeId="2" ParentId="8082" CreationDate="2013-05-27T08:05:42.560" Score="1" Body="&lt;p&gt;I don't know what is supported by MatLab (I use Java to do such stuff :-).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in case you do not find a solution from the swapbyzero function you mentioned I can suggest a workaround:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Value a swap with the annual fix frequence.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Given that it is a payer swap (pays the fixed leg), correct the value by:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Substract the value of an annual fix coupon bond and&lt;/li&gt;&#xA;&lt;li&gt;Add the value of the desired frequence fix coupon bond.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;PS: Note that the MatLab function is likely not appropriate to value a swap in a &quot;realistic&quot; way, since it looks like multi-curve (OIS discounting) is not considered here (I wonder if term structure is considered?), see also &lt;a href=&quot;https://quant.stackexchange.com/questions/723/rationale-for-ois-discounting-for-collateralized-derivatives/4919#4919&quot;&gt;Rationale for OIS discounting for collateralized derivatives?&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="3548" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2013-05-27T15:08:12.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8086" PostTypeId="2" ParentId="8082" CreationDate="2013-05-27T08:41:17.623" Score="0" Body="&lt;p&gt;Name-Value pair option 'LegReset' [n n] where n is the frequency&lt;/p&gt;&#xA;" OwnerUserId="2466" LastActivityDate="2013-05-27T08:41:17.623" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8087" PostTypeId="1" CreationDate="2013-05-27T11:37:32.410" Score="7" ViewCount="34778" Body="&lt;p&gt;Regarding &lt;code&gt;PX_LAST&lt;/code&gt;, &lt;code&gt;PX_VOLUME&lt;/code&gt; etc... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What does the &quot;PX&quot; prefix stand for?&lt;/p&gt;&#xA;" OwnerUserId="5432" LastEditorUserId="743" LastEditDate="2015-10-23T23:34:39.600" LastActivityDate="2020-08-18T00:33:49.283" Title="What does the prefix PX stand for on a Bloomberg Terminal?" Tags="&lt;bloomberg&gt;&lt;terminology&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8088" PostTypeId="2" ParentId="8087" CreationDate="2013-05-27T12:15:15.723" Score="1" Body="&lt;p&gt;These are just Bloomberg mnemonic representations of data fields “Last Price”, “Volume” etc.&lt;/p&gt;&#xA;" OwnerUserId="2246" LastActivityDate="2013-05-27T12:15:15.723" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8089" PostTypeId="2" ParentId="8087" CreationDate="2013-05-27T12:38:05.163" Score="15" Body="&lt;p&gt;&lt;code&gt;PX&lt;/code&gt; is often used as an abbreviation for price in Bloomberg.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fields prefixed with &lt;code&gt;PX&lt;/code&gt; are generally static fields: the value is requested only once and is based on whatever information is available when you send that request. On the other hand, real time fields keep sending new data as it becomes evailable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example: &lt;code&gt;PX_LAST&lt;/code&gt; is the last price as of when you request it and won't change afterwards, whereas &lt;code&gt;LAST_PRICE&lt;/code&gt; is a real time last price which will keep updating if you subscribe to those changes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other examples include &lt;code&gt;PX_BID&lt;/code&gt; vs. &lt;code&gt;BID&lt;/code&gt;, &lt;code&gt;PX_VOLUME&lt;/code&gt; vs. &lt;code&gt;VOLUME&lt;/code&gt; etc.&lt;/p&gt;&#xA;" OwnerUserId="2393" LastEditorUserId="2393" LastEditDate="2013-05-27T12:43:33.393" LastActivityDate="2013-05-27T12:43:33.393" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8091" PostTypeId="1" CreationDate="2013-05-27T18:01:09.817" Score="15" ViewCount="3442" Body="&lt;p&gt;I'm working through the implementation of a risk budgeting approach as described in the recent &lt;a href=&quot;http://www.thierry-roncalli.com/download/risk-budgeting.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Roncalli&lt;/a&gt; paper. The idea is that the portfolio manager sets a contribution of total portfolio volatility to each asset in the portfolio (the budget, $b_i$ where $\sum_{i=1}^n b_i = 1$) and solves an optimization problem to find the weights ($x_i$ where $\sum_{i=1}^n x_i = 1$) of those assets that allow the assets' volatility contribution to match the set budget. A somewhat similar approach was discussed on this site &lt;a href=&quot;https://quant.stackexchange.com/questions/3114/risk-parity-portfolio-construction&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More formally (eq. 8):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$x^*=\underset{x}{\arg \min} \sum_{i=1}^n (\frac{x_i(\Sigma x)_i}{\sum_{j=1}^n x_j(\Sigma x)_j} - b_i)^2$$&#xA;$$u.c. 1^Tx=1; 0\le x \le 1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$x$ is the weight of asset $i$  &lt;/li&gt;&#xA;&lt;li&gt;$n$ is the number of assets  &lt;/li&gt;&#xA;&lt;li&gt;$(\Sigma x)_i$ is the covariance of asset $i$ wrt to the portfolio (I think this is the interpretation, perhaps someone can confirm)  &lt;/li&gt;&#xA;&lt;li&gt;$b_i$ is the set risk budget for asset $i$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What I am trying to do is add to this approach the ability for the manager to set an overall target portfolio volatility in addition to the budget of each asset.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to the paper, we know:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sum_{i=1}^n RC_i(x_i,...,x_n)=\sum_{i=1}^n x_i \frac{(\Sigma x)_i}{\sqrt{x^T\Sigma x}}=\sigma(x)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$RC_i$ is the risk contribution ($b$) of asset $i$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Because of these relationships, I've drawn the conclusion that $\sqrt{x^T\Sigma x} = \sum_{j=1}^n x_j(\Sigma x)_j$ (portfolio volatility is the sum of each assets' volatility contribution), I thought I might insert my target portfolio volatility as the denominator of the minimization problem above. I got reasonable results in my tests but the actual portfolio volatility using the results of the optimization problem never matched the target.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After I thought about this for a while, I realized this approach is probably naive and likely wrong. Basically, because I'm using two different covariance matrixes to represent the same volatility value: the computed covariance matrix included in the numerator and the covariance matrix that is implied by a target volatility estimation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is twofold:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Are there papers/references available that describe the mechanics of setting asset level risk budgets as well as a portfolio level target volatility?&lt;/li&gt;&#xA;&lt;li&gt;Does anyone have an idea independent of any papers or resources how I might go about setting asset level risk budgets as well as a portfolio level target volatility?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1112" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2015-12-15T03:55:38.467" Title="Risk Budgets with Target Portfolio Volatility" Tags="&lt;volatility&gt;&lt;portfolio-management&gt;&lt;portfolio&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="8092" PostTypeId="1" AcceptedAnswerId="8093" CreationDate="2013-05-27T19:10:21.893" Score="4" ViewCount="1497" Body="&lt;p&gt;I am trying to reproduce a plot in &quot;Statistics and Data engineering for Financial Engineering&quot; by D. Ruppert. The author uses the risk free returns data available in the Ecdat package in R. Specifically the rf variable in the Capm data set of this package. He wants to demonstrate that changes in the rate are more variable for large values of the rate (heteroskedacity). So in figure 4.19 (a) he plots the change in the rate vs the lagged rate, and indeed for larger values the points in the scatter plot are more dispersed. I want to reproduce this plot. But I have no idea what the &quot;lagged rate&quot; here means. Any ideas?     &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have attached the plot below. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to reconstruct figure 4.19 (a), but I'm not exactly sure what to plot on the x-axis. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ekB6j.jpg&quot; alt=&quot;here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="1130" LastEditorUserId="1130" LastEditDate="2013-05-27T19:25:03.883" LastActivityDate="2013-05-27T21:36:25.083" Title="What is lagged interest rate?" Tags="&lt;data&gt;&lt;fixed-income&gt;&lt;historical-data&gt;&lt;interest&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8093" PostTypeId="2" ParentId="8092" CreationDate="2013-05-27T21:36:25.083" Score="3" Body="&lt;p&gt;Lagged means past values. The lag can be by as long as you want. If Interest Rates today are 0% and yesterday they were 0.25%. Yesterdays value is what we call the lagged value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say its now 2012 and we are looking at IR in yearly frequency. IR is 0.1%. To lag IR we simply look back at the last value. So what was IR last year? It was 0.3%. Notice how 0.3% is in IR(-1) for 2012 (which is the present). If the concept isn't clear just reread this more carefully. When your lagging a time series all your doing is making todays value, yesterday. How do you that, you shift the array down. Notice you can make the lag whaterver value you feel. IR(-2) means, your looking at IR 2 years ago. In the graph above, the author is simply trying to analyze the effect of yesterday's (past values of IR) on today's IR value. How much does the past values influence today's value? That's what the graphs are trying to delineate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Can someone help arrange the data matrix I wrote below, when its displayed it not formatted correctly. Thank you!)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Date IR    IR(-1)&amp;lt;--Lagged Interest Rate&#xA;2008 1.5%  --&#xA;2009 1.1%  1.5%&#xA;2010 0.9%  1.1%&#xA;2011 0.3%  0.9%&#xA;2012 0.1%  0.3%&#xA;2013 --    0.1% &lt;/p&gt;&#xA;" OwnerUserId="4729" LastActivityDate="2013-05-27T21:36:25.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8094" PostTypeId="2" ParentId="8012" CreationDate="2013-05-27T21:58:20.767" Score="1" Body="&lt;p&gt;We gave up on using Gain's data in the end and partnered with FXCM to provide our FX data. We tidied and timeseries ordered it through our IDE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Disclaimer - I'm a founder at QuantConnect.com &lt;/p&gt;&#xA;" OwnerUserId="5436" LastActivityDate="2013-05-27T21:58:20.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8096" PostTypeId="1" AcceptedAnswerId="8105" CreationDate="2013-05-28T10:23:12.557" Score="2" ViewCount="2733" Body="&lt;p&gt;As I understand it, recovery swaps and CDS are both used to provide hedging against the default risk of a loan.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the difference between them?&lt;/p&gt;&#xA;" OwnerUserId="1050" LastEditorUserId="1050" LastEditDate="2020-05-14T20:25:13.107" LastActivityDate="2020-05-14T20:25:13.107" Title="What is the difference between a recovery swap and a CDS?" Tags="&lt;swaps&gt;&lt;default&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="8097" PostTypeId="2" ParentId="8039" CreationDate="2013-05-28T11:10:03.530" Score="3" Body="&lt;p&gt;No matter how you calculate the VaR (historical simulation, covariance approach, MC) I assume that you work on historical data or data derived from the history of assets, risk factors and theresuch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this assumption is correct then I would use approach (1). If you know the exact positions today of the (sub-)funds, then (except from some technicalities) you have all these assets in your fund-of-funds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use approach (2) then the historical time series will be biased as the (sub-)fund might have traded a lot in the past (changed duration, equity long/short). Then the history of the (sub-)fund itself does not reflect the risk of the current positions today (!)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you subfunds are rather benchmark based and stick close to it, then (1) and (2) will not differ that much. To be on the safe side I recommend (1). &lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2013-05-28T11:10:03.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8098" PostTypeId="2" ParentId="3319" CreationDate="2013-05-28T18:28:02.330" Score="0" Body="&lt;p&gt;Very insightful discussion. Let me try if I can address this issue. What victor has challenged makes perfect sense, but I think we when calculate z-spread, we just ignore the option. So when we actually calculate call embedded bonds, investors are looking for larger discount to compensate, so the spread is larger which reflect on the market price. And this price is what we use to calculate z-spread. So you will see larger z-spread version put embedded one with smaller z-spread. And Z = OSA + Option. OSA is a ideal spread which is measuring the spread between the fair value and market value. Like if you don't have the call option, the bond price will be higher and the discount rate will be lower, and the spread is smaller. The difference is the price(spread) of option. For call is positive and for put is negative. I hope this can clear some misconceptions. &lt;/p&gt;&#xA;" OwnerUserId="5439" LastActivityDate="2013-05-28T18:28:02.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8099" PostTypeId="1" CreationDate="2013-05-28T19:18:19.433" Score="35" ViewCount="37667" Body="&lt;p&gt;Is there a way by which I can get a list of CIK of all registered stocks at the SEC?&lt;/p&gt;&#xA;" OwnerUserId="5440" LastEditorUserId="35" LastEditDate="2013-05-28T23:15:57.587" LastActivityDate="2020-07-31T19:30:53.563" Title="Central Index Key (CIK) of all traded stocks" Tags="&lt;sec&gt;" AnswerCount="11" CommentCount="0" FavoriteCount="26" ContentLicense="CC BY-SA 3.0" />
  <row Id="8100" PostTypeId="2" ParentId="8099" CreationDate="2013-05-28T19:54:14.737" Score="27" Body="&lt;p&gt;The EDGAR &lt;a href=&quot;https://www.sec.gov/edgar/searchedgar/accessing-edgar-data.htm&quot; rel=&quot;noreferrer&quot;&gt;FTP&lt;/a&gt; should have all of the information you need.  Here is the &lt;a href=&quot;https://www.sec.gov/Archives/edgar/cik-lookup-data.txt&quot; rel=&quot;noreferrer&quot;&gt;list&lt;/a&gt; from that page in text format.  Keep in mind a given CIK can be associated with multiple names through time.&lt;/p&gt;&#xA;" OwnerUserId="2732" LastEditorUserId="2732" LastEditDate="2017-12-05T18:52:54.267" LastActivityDate="2017-12-05T18:52:54.267" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8102" PostTypeId="2" ParentId="8076" CreationDate="2013-05-29T07:22:08.357" Score="1" Body="&lt;p&gt;Algorithmic Trading in general is no different from normal trading except all of the trading is automated. So it encompasses the same risk parameters that normal traders would.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When it comes to High Frequency Trading, the risk management checks would be at Strategy Level as well as &quot;individual trade&quot; level.There would be checks for sizes, values etc. &#xA;However any trading is essentially a &quot;risk management&quot; exercise and main risk in HFT is &quot;execution&quot; risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, Indian Regulator SEBI has provided the following guidelines -&lt;a href=&quot;http://www.sebi.gov.in/cms/sebi_data/attachdocs/1333109064175.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.sebi.gov.in/cms/sebi_data/attachdocs/1333109064175.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5444" LastActivityDate="2013-05-29T07:22:08.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8104" PostTypeId="2" ParentId="8076" CreationDate="2013-05-29T14:05:02.017" Score="9" Body="&lt;p&gt;Indeed, algorithmic trading is a very hidden subject.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All I can help you with are some industry-specific terms which might speed up your search for relevant papers and information:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://2ndskiesforex.com/trade-signals/forex-strategies/money-management-and-the-risk-of-ruin/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Risk of ruin tables&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;(Peak-to-valley) drawdown (maximum drawdown, duration of drawdown etc.)&lt;/li&gt;&#xA;&lt;li&gt;Number of consecutive losses&lt;/li&gt;&#xA;&lt;li&gt;Confidence intervals&lt;/li&gt;&#xA;&lt;li&gt;Empirical distributions (for risk or P/L management)&lt;/li&gt;&#xA;&lt;li&gt;Value-at-risk VaR (or likewise) measures (use a valid &lt;a href=&quot;http://www.investopedia.com/terms/l/leptokurtic.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;leptokurtic&lt;/a&gt; distribution)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://arxiv.org/pdf/1302.6363.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Influence analysis&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Slippage problems&lt;/li&gt;&#xA;&lt;li&gt;Liquidity problems (especially in thinly traded securities or derivatives)&lt;/li&gt;&#xA;&lt;li&gt;Model backtesting biases (e.g. survivorship bias)&lt;/li&gt;&#xA;&lt;li&gt;Latency issues and &lt;a href=&quot;http://www.wallstreetandtech.com/trading-technology/the-new-race-to-zero/a/d-id/1316234&quot; rel=&quot;nofollow noreferrer&quot;&gt;competition&lt;/a&gt; (and different quotation times between exchanges)&lt;/li&gt;&#xA;&lt;li&gt;Transaction costs&lt;/li&gt;&#xA;&lt;li&gt;Order rate flow control&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1695596&quot; rel=&quot;nofollow noreferrer&quot;&gt;Order Flow Toxicity&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Pre-trade (and post-trade) checks&lt;/li&gt;&#xA;&lt;li&gt;Unexpected market conditions (&lt;a href=&quot;https://en.wikipedia.org/wiki/Black_swan_theory#Epistemological_approach&quot; rel=&quot;nofollow noreferrer&quot;&gt;unknown unknowns&lt;/a&gt; such as the financial crisis(?) )&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2013355&quot; rel=&quot;nofollow noreferrer&quot;&gt;Flash crash&lt;/a&gt; recognition (and &lt;a href=&quot;http://datascienceassn.org/sites/default/files/The%20Microstructure%20of%20the%20%E2%80%98Flash%20Crash%E2%80%99%20-%20Flow%20Toxicity,%20Liquidity%20Crashes%20and%20the%20Probability%20of%20Informed%20Trading.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;hedging&lt;/a&gt; or &lt;a href=&quot;http://nightowltrader.blogspot.nl/2011/01/how-to-profit-from-next-flash-crash.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;exploitation&lt;/a&gt; by aggresive counter strategies)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.ecb.europa.eu/pub/pdf/scpwps/ecbwp948.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Outlier problems&lt;/a&gt; and faulty quotations (with HF tick data)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Quote_stuffing&quot; rel=&quot;nofollow noreferrer&quot;&gt;Quote stuffing&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;And the new one: &lt;a href=&quot;http://www.wsj.com/articles/SB10000872396390443989204577599243693561670&quot; rel=&quot;nofollow noreferrer&quot;&gt;queue jumping&lt;/a&gt; (but that's only for HFT; &lt;a href=&quot;https://i.imgur.com/4bk1SoE.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;corresponding picture&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Try Google Scholar for these keywords. Good luck :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;sub&gt;(if anyone knows any other keywords, please append them to my answer)&lt;/sub&gt;&lt;/p&gt;&#xA;" OwnerUserId="5447" LastEditorUserId="5447" LastEditDate="2016-08-15T13:02:05.550" LastActivityDate="2016-08-15T13:02:05.550" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8105" PostTypeId="2" ParentId="8096" CreationDate="2013-05-29T16:32:17.203" Score="4" Body="&lt;p&gt;CDS provides protection against default. So when a firm is unable to pay the coupon (and there are few more scenarios where firms default) CDS is triggered. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After default the liability holders have first claim on the firm's assets. If the assets are less than loan (say 60% of loan amount) then recovery can only be 60%. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;if these are risky assets and there is possible uncertainty in the asset value from the time of default to recovery payout one can buy  recovery swap or recovery default swap to provide a hedge against the such &lt;strong&gt;uncertainty of recovery&lt;/strong&gt; in default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope that makes sense&lt;/p&gt;&#xA;" OwnerUserId="1386" LastActivityDate="2013-05-29T16:32:17.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8109" PostTypeId="2" ParentId="44" CreationDate="2013-05-30T00:22:51.143" Score="5" Body="&lt;p&gt;The answer to the original question is simple: the Chopra-Ziemba paper is highly flawed and unreliable. Note that the framework is in-sample and based on a utility function. It has nothing to do with out-of-sample behavior of the mean vs. the covariance in an optimization. Estimation error grows linearly in the mean but quadratically in the covariance. At the portfolio optimization level, unless you are optimizing four or less assets, the estimation error in the covariance begins to dominate. It is one of the classic errors that keeps getting referenced. The Ledoit estimator talks about estimation error in the covariance and offers a solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Robust optimization is just a set of constraints on the optimization. It is no solution to the estimation error problem in portfolio optimization. It is robust simply because it is constrained.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem with Black-Litterman is that it is not an alternative at all to estimation error. Our newly published paper: &quot;Deconstructing Black-Litterman: How to get the portfolio you already knew you wanted&quot; by Michaud, Esch, Michaud, &lt;em&gt;Journal of Investment Management&lt;/em&gt;, 1st quarter 2013 details a wide variety of critical errors in the procedure that is inconsistent with modern statistics and in no way solves estimation error issues.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;@QuantGuy continues to propound errors about Michaud optimization. The Michaud efficient frontier has a &quot;maximum return point&quot; depending on the character of the inputs. The Scherer claim of an anomaly is based on a serious error of misunderstanding. When there is insufficient information in investment inputs, things can occur. But they make perfect investment sense. See Michaud and Michaud (2008, ch. 6) for a discussion.&lt;/p&gt;&#xA;" OwnerUserId="5455" LastEditorUserId="35" LastEditDate="2013-05-30T01:46:17.607" LastActivityDate="2013-05-30T01:46:17.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8110" PostTypeId="1" AcceptedAnswerId="8134" CreationDate="2013-05-30T02:23:37.713" Score="6" ViewCount="817" Body="&lt;p&gt;The question is NOT about real trading, but about simplified mathematical models for trading. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the main problems in trading  is that asset prices are not correctly described by the some random  processes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us consider  idealized situation - assume that asset's price $p(t)$ is given by some random process, which is &lt;strong&gt;known to trader&lt;/strong&gt;. It roughly speaking means that probabilities of all events $p(t_1) = p_1, p(t_2) = p_2, ..., p(t_k) = p_k$ are known to trader. Both for time $t$ in future or in the past. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are some theoretical results on optimal or (sub)-optimal trading strategies in this idealized setup? What are some theoretical results on profit estimates ? (I.e. some bounds - we cannot earn more than ...)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If nothing like that is known - what is the reason - is it difficult or &quot;no one needs&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By &quot;optimal&quot; I mean the following. Of course, intuitively it means that  trader will gain the most profit, but here is subtlety - our price $p(t)$ is a random variable, so profit is also a random variable, so it should be specified what means &quot;the most&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can be $E(p(T))$ (mean value for some $t=T$), or can be $\frac{E(p(t))}{std(p(t))}$ - or what whatever, any mathematically correct result is very welcome.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me emphasize that from my point of view this is question mathematically well-defined, and I would expect that many &lt;strong&gt;mathematically rigorous theorems&lt;/strong&gt; (and/or conjectures) should be known on this for experts. If someone doubts that question is mathematically rigorous, please let us discuss in comments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It might be that such kind of results known only for some special kind of random processes - e.g. Brownian motion or whatever - any information is welcome, I am novice in the field.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For example assume that our random process is actually deterministic process - i.e. only one trajectory $p(t) = p_0(t)$ has probability $1$, all other trajectories has probability $0$. Then the optimal trading strategy is to buy at local minimums and sell at local maximums; profit is variation of $p_0(t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well, this is of course over-simplified situation, but I just put it to demonstrate that there exist rigorous mathematical results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also this example gives some bound on maximal possible mean profit for general random process - we should sum over all possible trajectories their variations with the weight - probability of the trajectory (a'la Feynmann's path-integral).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This bound should not be sharp - it seems it is impossible to achieve it in general - is it correct? What are the sharper bounds?&lt;/p&gt;&#xA;" OwnerUserId="4652" LastEditorUserId="35" LastEditDate="2013-05-30T11:16:57.177" LastActivityDate="2013-06-01T12:02:34.030" Title="Mathematical theories of (sub)-optimal trading strategies under &quot;idealized&quot; assumption - price is random process known to trader" Tags="&lt;algorithmic-trading&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8111" PostTypeId="1" AcceptedAnswerId="8123" CreationDate="2013-05-30T07:02:19.930" Score="1" ViewCount="566" Body="&lt;p&gt;Most automated trading systems have a number of embedded parameters such as the lookback periods, entry and exit thresholds, etc. This is like the moving average crossover system or any of the systems that rely on some kind of data window for calculations. For example, if I use a fast and slow exponential filter for an MA crossover system, then I need to figure out the best time values for each of these filters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finding these parameters can be difficult because there's only one history from the traded security. A single currency might have 200 million ticks or 2 million 1 minute data points. This is only one scenario of what could have happened and represents multiple trends and turning points in an evolving series. If I want to really pick parameters that would be best, it seems like I would want to use multiple samples to reduce overfitting. It's possible to use hold out data, but it seems like it would be better to use bootstrapping to get additional histories to optimize on. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a problem using block, moving block or other bootstrap methods to find the optimal trading parameters or blackbox parameters? Seems like a good idea. What are the most effective bootstrap methods for nonstationary, evolving dependent time series?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="5456" LastEditorUserId="5456" LastEditDate="2013-05-31T08:17:40.057" LastActivityDate="2013-05-31T08:32:00.727" Title="Blackbox Optimization + Bootstrapping = Parameter Selection?" Tags="&lt;optimization&gt;&lt;models&gt;&lt;currency&gt;&lt;parameter&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8112" PostTypeId="2" ParentId="8020" CreationDate="2013-05-30T09:09:31.750" Score="2" Body="&lt;p&gt;For more explanations you can also try out &quot;&lt;a href=&quot;http://www.bis.org/bcbs/irbriskweight.htm&quot; rel=&quot;nofollow&quot;&gt;An explanatory note on the Basel II IRB Risk Weight Functions&lt;/a&gt;&quot;, or if you read german, &quot;&lt;a href=&quot;http://www.fh-vie.ac.at/content/download/1287/7848/file/WP1_Cech&quot; rel=&quot;nofollow&quot;&gt;Die IRB Formel&lt;/a&gt;&quot;.&lt;/p&gt;&#xA;" OwnerUserId="3015" LastActivityDate="2013-05-30T09:09:31.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8113" PostTypeId="2" ParentId="8039" CreationDate="2013-05-30T09:35:43.187" Score="4" Body="&lt;p&gt;Both approaches have drawbacks, so if one &lt;em&gt;must&lt;/em&gt; choose among the two then one shall compare those drawbacks in the specific case. &#xA;Or another way would be devising a hybrid of the two (e.g. adding statistics of historical deviations of the fund portfolio from the (1) view etc...).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Among the drawbacks of (1): trading costs, rebalancings, management fees etc are all lost/not accounted for.&#xA;For (2): you might lose in information &amp;amp; statistical efficiency (especially if number of constituents &gt; funds) compared e.g. to a factor model; one also loses the ability to deal properly with derivatives (available in (1) by also tracking underlyings).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course it's important what kind of funds you're dealing with, which will change the relative importance of the above mentioned drawbacks; e.g. are they active or passive/benchmarked? Obviously passive will mean (1) is &lt;em&gt;less&lt;/em&gt; problematic than with active ones (but this doesnt eliminate the need for a comparison altogether)...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have time I would suggest going for a hybrid to get the best of both approaches. Some detail on this joint model:&#xA;(1) has the advantage of detailed statistics on the invested universe and its dynamics&#xA;(2) additionally to the underlying investment (2a) (which is not accessible directly, and might also have lower statistical power) also includes the above mentioned additional dynamics proper of the fund &amp;amp; management (2b).&lt;br/&gt;&#xA;The first goal of the hybrid model is of course to extract that second component (2b), by subtracting the market behaviour which we assume is known in more detail by (1). &#xA;As a second step of course one can then simulate forecasts of the combined model (1)&amp;amp;(2b) and calculate a VaR on them.&lt;br/&gt;&#xA;So the trickery is mostly in deriving (2b). If the history of fund holdings is also known besides obviously the history of the underlying prices too (let's call this ideal case 1A), then additional information e.g. on rebalancings can enter (2b) (to help identify residuals such as fees, if they´re not known explicitely) &lt;em&gt;and&lt;/em&gt; the comparison between (1) and (2a) is proper in the first place. All the market dynamics in the funds is correctly modeled so that the residual fund behaviour can be analysed. Otherwise -keeping a fixed fund composition (1B)- you must take care that far away in the past this present view induces a static &quot;synthetic&quot; fund history which might be diverging from the correct dynamic syntetic fund history (1A), and thus the resulting discrepancies among the two views (2)-(1B) that you are analysing for (2b) might not be very realistic. So here one shall do atleast some additional exponential weighting or so...&lt;/p&gt;&#xA;" OwnerUserId="3015" LastEditorUserId="3015" LastEditDate="2013-06-05T11:36:52.903" LastActivityDate="2013-06-05T11:36:52.903" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8114" PostTypeId="1" CreationDate="2013-05-30T09:51:24.797" Score="6" ViewCount="6155" Body="&lt;p&gt;The CIR process is given by the SDE&#xA;$$&#xA;  \mathrm dr_t = \theta(\mu-r_t)\mathrm dt + \sigma\sqrt{r_t}\mathrm dW_t&#xA;$$&#xA;where $W_t$ is a Brownian motion. I am interested in finite-difference schemes of simulating trajectories of this process, for example I tried the Euler-Maryama scheme&#xA;$$&#xA;  r_{t+\Delta t} \approx r_t + \theta(\mu - r_t)\Delta t + \sigma\sqrt{r_t}\xi_t\sqrt{\Delta t}, \quad \xi_t\sim\mathscr N(0,1)&#xA;$$&#xA;but when I am making $\Delta t$ smaller and smaller, results do not seem nice. In fact, I am also interested in a more general simulation techniques for &lt;a href=&quot;https://math.stackexchange.com/questions/350278/monte-carlo-for-sde-with-square-root-diffusion-term&quot;&gt;similar kind of processes&lt;/a&gt;. Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="464" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2020-09-05T11:52:49.003" Title="Monte Carlo simulating Cox-Ingersoll-Ross process" Tags="&lt;stochastic-processes&gt;&lt;monte-carlo&gt;&lt;simulations&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8115" PostTypeId="1" AcceptedAnswerId="8190" CreationDate="2013-05-30T11:20:30.727" Score="5" ViewCount="1886" Body="&lt;p&gt;I am faced with the following problem. Let the standard Brownian motion $W_t$ be the price process of a traded asset in an economy with zero interest rate. Define $$A_T=\frac{1}{T}\int_0^T W_t^2 dt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have two questions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;What is the fair price at time $t=0$ of a contract that offers $A_T$?&lt;/li&gt;&#xA;&lt;li&gt;How do we form a dynamic hedging strategy that eliminates all risk in having to deliver this claim?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I answered part 1 by simply taking the expectation. The fair price is $E(A_T\mid \mathcal{F}_0)=\frac{T}{2}$. How could the dynamic hedging be strategised?&lt;/p&gt;&#xA;" OwnerUserId="3511" LastEditorUserId="3511" LastEditDate="2013-05-30T12:17:14.313" LastActivityDate="2020-12-13T12:49:29.870" Title="Dynamic hedging strategy example" Tags="&lt;hedging&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8116" PostTypeId="2" ParentId="848" CreationDate="2013-05-30T13:58:29.273" Score="3" Body="&lt;p&gt;You can use wavelet coherence, which is a measure of frequency-varying and time-varying similarity of two time series $X_t$ and $Y_t$ by comparing the coefficients of the wavelet transform $\int_{-\infty}^{\infty} f(t) \psi_{u,s}(t)dt$ (in highly non-technical terms). You can use the phase difference to study the lead-lag relationship.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The benefit would be:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Doesn't require stationarity in $f(t)$. &lt;/li&gt;&#xA;&lt;li&gt;Detects frequency-dependent comovement. If speculative behavior drives mid-high frequency returns and investment behavior drives low frequency returns then there is no reason why comovement at one frequency necessitates comovement at another frequency.&lt;/li&gt;&#xA;&lt;li&gt;You can couple the analysis with an analysis of phase difference between the two wavelet transforms, frequency-dependent Granger causality and other tools.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Another method would be copula correlations and copula conditional probabilities.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;These can be time-varying through the Patton (2006) paramaterizations and more recent SCAR versions and I don't think the assumptions on the DGP is very strict.&lt;/li&gt;&#xA;&lt;li&gt;You can study $\mathbb{P}(X &amp;lt; q | Y &amp;lt; q)$ which is a measure of comovement that is not offered by standard correlation measures. &lt;/li&gt;&#xA;&lt;li&gt;You can get time-varying tail correlations if you are concerned with tail events.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Also, quantile correlations:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Still a working paper.&lt;/li&gt;&#xA;&lt;li&gt;Correlation of one variable and another, conditional on the other being in an extreme region of the distribution.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;There's also extreme correlation measures within generalised pareto distribtions. ...Not sure how this works though. &lt;/p&gt;&#xA;" OwnerUserId="3174" LastEditorUserId="3174" LastEditDate="2013-07-18T10:45:42.153" LastActivityDate="2013-07-18T10:45:42.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8117" PostTypeId="2" ParentId="8114" CreationDate="2013-05-30T14:37:43.620" Score="4" Body="&lt;p&gt;There are a lot of methods for simulating such a process, the real problem here is to preserve positivity of the next simulated step as the Gaussian increment might result in negative value and then a non definite value for the next &quot;square-root&quot; step. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An approach that might be suitable to your more general needs is the following where a &quot;consistent-domain&quot; Markov Chain approach is used &lt;a href=&quot;http://arxiv.org/abs/1011.3247&quot; rel=&quot;nofollow&quot;&gt;&quot;Labbé, Remillard, Renaud - A Simple Discretization Scheme for Non negative Diffusion Processes, with Applications to Option Pricing&quot;&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are many other methods to sample from this process, search for &quot;Heston model simulation&quot; and you should find all you need.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best regards&lt;/p&gt;&#xA;" OwnerUserId="92" LastEditorUserId="92" LastEditDate="2013-05-30T15:40:25.753" LastActivityDate="2013-05-30T15:40:25.753" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8119" PostTypeId="1" CreationDate="2013-05-30T17:47:13.723" Score="3" ViewCount="2473" Body="&lt;p&gt;I'm a high school technology teacher and sponsor for the Charity Student Investment Project. Currently our students track our investment portfolio via a google spreadsheet (&lt;a href=&quot;http://charitystudentinvestmentproject.com/index.php/portfolio&quot; rel=&quot;nofollow&quot;&gt;http://charitystudentinvestmentproject.com/index.php/portfolio&lt;/a&gt;) that calculates unrealized capital gain, total ROI (excluding dividend payments), market value, etc.. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We are looking for a solution that will allow us to track the 'total return' including dividend payments for our entire portfolio and each individual investment. A bonus feature would be the ability to share the report on the internet, but this feature is not a requirement. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions for free or low-cost solutions for calculating 'total return', including dividend payments? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, I want a solution that 'automatically' calculates (total dividend payments + unrealized gain) to show the 'total return' of a current investment. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&#xA;Todd&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A little background on the Charity Student Investment Project. We are a high school student organization and part of a 501 c3. Our mission is to teach students about personal finance and how to invest in the stock markets via real-world experience and actively managing a real-money student-managed investment portfolio. &lt;/p&gt;&#xA;" OwnerUserId="5461" LastEditorUserId="5461" LastEditDate="2013-05-30T20:43:45.533" LastActivityDate="2020-03-13T16:43:32.703" Title="Portfolio software that shows 'total return' for each investment" Tags="&lt;portfolio-management&gt;&lt;returns&gt;&lt;portfolio&gt;&lt;software&gt;" AnswerCount="4" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8120" PostTypeId="2" ParentId="848" CreationDate="2013-05-30T18:07:27.687" Score="28" Body="&lt;p&gt;One of my favorites is a generalization of correlation: &lt;a href=&quot;http://en.wikipedia.org/wiki/Distance_correlation&quot; rel=&quot;noreferrer&quot;&gt;Distance Correlation (dCor)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several reasons for that:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;It generalizes classical (i.e. linear) correlation in the sense that linearity is a special case. It gives identical readings for linear dependence.&lt;/li&gt;&#xA;&lt;li&gt;There are analogs for variance, covariance and standard deviation, so these identities hold: $$\operatorname{dVar}^2_n(X) := \operatorname{dCov}^2_n(X,X)$$ and $$\operatorname{dCor}(X,Y) = \frac{\operatorname{dCov}(X,Y)}{\sqrt{\operatorname{dVar}(X)\,\operatorname{dVar}(Y)}}$$&lt;/li&gt;&#xA;&lt;li&gt;$dCor=0$ implies true independence, all other readings imply linear or non-linear dependence - Compare the following readings, first linear correlation (&lt;a href=&quot;http://en.wikipedia.org/wiki/File:Correlation_examples2.svg&quot; rel=&quot;noreferrer&quot;&gt;source&lt;/a&gt;):&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/FJQAW.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and distance correlation (&lt;a href=&quot;http://en.wikipedia.org/wiki/File:Distance_Correlation_Examples.svg&quot; rel=&quot;noreferrer&quot;&gt;source&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/h3xHG.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Beware, oversimplification ahead: The reason it shows this behavior is basically that it is the correlation of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Characteristic_function_%28probability_theory%29&quot; rel=&quot;noreferrer&quot;&gt;characteristic functions&lt;/a&gt; of the random variables, i.e. the Fourier transforms of the probability density functions, i.e. a rotation from the time into the frequency domain. Therefore not only linear dependence is being tested but basically all functional dependencies which can be represented by the (periodic) complex exponential function. To get an intuition read also this article: &lt;a href=&quot;http://archive.is/7TVzZ&quot; rel=&quot;noreferrer&quot;&gt;Here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is an implementation in &lt;a href=&quot;http://cran.us.r-project.org/web/packages/energy/index.html&quot; rel=&quot;noreferrer&quot;&gt;R&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2016-03-02T08:27:26.987" LastActivityDate="2016-03-02T08:27:26.987" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8122" PostTypeId="1" AcceptedAnswerId="8162" CreationDate="2013-05-31T01:51:26.213" Score="4" ViewCount="451" Body="&lt;p&gt;After Jan 2013 change, now the main reporting changes requested from Basel III is LCR, Liquidity Coverage Ratio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moody's has a product named RiskAuthority (previously Fermat CAD) that is going to support LCR, or that's what they say.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does any one know of any other products on the market? and if so how is it (quality, pricing etc)?&lt;/p&gt;&#xA;" OwnerUserId="2161" LastEditorUserId="1764" LastEditDate="2013-05-31T03:27:46.837" LastActivityDate="2014-06-26T08:36:56.203" Title="which product supports Basel III LCR (liquidity coverage ratio) reporting?" Tags="&lt;basel&gt;&lt;liquidity-risk&gt;&lt;products&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8123" PostTypeId="2" ParentId="8111" CreationDate="2013-05-31T08:32:00.727" Score="2" Body="&lt;p&gt;Amirsani,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here couple points how I would proceed:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;I would first look to divide your time series into different clusters, enough so that different market dynamics fall into different clusters. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I guess you will not be trading a single asset and thus you will not just optimize over a single stock or options contract. I would strongly try to discourage from optimizing parameters over each individual asset but instead over a set of assets. Do not derive an optimized parameter set for Google and another for MS, for example because most likely will you overfit. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I would start with first splitting the data into training data and then data you test your optimizations on in the end. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Then I would proceed with bucketing time series by dates (months, years or whatever you chose) and then optimize each bucket separately and then run statistical tests on the stability of your optimized parameters across buckets. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Also compare your strategy results between buckets with one parameter set and derive how stable the outcomes are. In the end you should run statistical tests over the data not used for optimizations. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-05-31T08:32:00.727" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8124" PostTypeId="1" CreationDate="2013-05-31T10:06:55.783" Score="3" ViewCount="91" Body="&lt;p&gt;Regulators are starting to analyse (or at least they are talking about it) model assumptions. We all know that too often our assumptions are just in the model documentation. Furthermore, we have no standard language for talking about assumptions. Indeed a given assumption within an organization that applies to more than one model may be described different by different developers – so at first sight it is not evident that it is the same assumption.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anybody have views of standard language for assumptions (is there a catalogue). Does anyone have examples whereby the same assumption is referred to in many ways? Your views on this topic would be appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thx!&lt;/p&gt;&#xA;" OwnerUserId="5466" LastActivityDate="2013-06-07T09:12:49.233" Title="Standard Assumption Terminology" Tags="&lt;risk-models&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8125" PostTypeId="2" ParentId="908" CreationDate="2013-05-31T10:17:26.827" Score="1" Body="&lt;p&gt;I havent seen much implementing reflexivity in practice in a comprehensive way. Of course there are small steps in that direction, but no general framework yet. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To comment on answers above: incorporating updates of information is &lt;em&gt;not&lt;/em&gt; reflexivity; reflexivity is about taking into account the effect of &lt;em&gt;your&lt;/em&gt; own actions while chosing them (jointly with those of other market participants, sure), that is ex ante, not ex post. Also momentum and mean reversion need not have anything to do with reflexivity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even the modeling of market impact in algo trading, which should be the application par excellance of reflexivity, is still done in a kind of traditional &quot;blind&quot; way: ex post statistics of impact are taken and then the forecasting model is used to optimize strategies...  Reflexivity in algo trading would be best applied to avoiding stop loss crashes, which is currently not yet done afaik. But sure market impact modeling goes a little bit towards reflexivity in a short term sense. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Stochastic control is one area where some reflexivity is indeed present by definition. And sure game theory, but that's not used much in practice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something might also be found in the bubble dynamics literature, but I'm not familiar with it.&#xA;Agent modeling is surely interesting per se, but in its current state is far from even scratching the surface of that topic, and the main research stream doesnt touch reflexivity at all. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;More on control theory (w/o stochasticity) which is already pertinent (see also &lt;em&gt;dynamic programming&lt;/em&gt;). It deals with the response dynamics of a system to different inputs and how to best plan strategies. E.g. it is used in engineering to study and prevent oscillations. Oscillations are the typical problem arising when no control techniques are used (as seen in economic cycles, bubbles etc...): a target is aimed at, a steering parameter is directed towards that but the actual response of the system is not linear so the steering needs to be corrected, but then the correction itself must be called back with time yet still the dynamics leads away in the other direction, so one has to steer again in the original direction, and so on in an endless cycle...&#xA;E.g. in algo trading of course your target is the quoted price, but you must adjust it to take into account market impact, which however is not given but depends itself on the your target and strategy generating some circularity.&#xA;Control theory iirc is applied in pricing of americans for the exercise strategy, and all similar problems, although it's overkill since there's much more to it. &lt;a href=&quot;http://www.math.ethz.ch/~hmsoner/pdfs/BOOK-Soner-Stochastic_optimal_control_in_finance.pdf&quot; rel=&quot;nofollow&quot;&gt;Here some examples in finance.&lt;/a&gt;&#xA;(Definitely people at the FED should take a course in control theory, before they start messing that way with the world economy. What will happen with inflation is a classic case of control myopia where they're oversteering without noticing it before it's too late.  &lt;a href=&quot;http://www.utexas.edu/cola/files/495395&quot; rel=&quot;nofollow&quot;&gt;Here some examples in economics.&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="3015" LastEditorUserId="3015" LastEditDate="2013-05-31T13:07:34.627" LastActivityDate="2013-05-31T13:07:34.627" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8126" PostTypeId="2" ParentId="8119" CreationDate="2013-05-31T16:57:05.913" Score="1" Body="&lt;p&gt;You should definitely check out the &lt;a href=&quot;http://www.marketwatch.com/game/dart-march-2013/portfolio/holdings?name=William%20Vantuinen&amp;amp;p=525339&quot; rel=&quot;nofollow&quot;&gt;Virtual Stock Exchange Games&lt;/a&gt;* by Marketwatch it provides simple interface, and many options for the rules of the game. Its instantly online, free, and uses real-time prices, but it only allows trading &lt;strong&gt;NASDAQ stocks&lt;/strong&gt;, as far as I know.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These games are &lt;a href=&quot;http://www.marketwatch.com/game/learningcenter/faq&quot; rel=&quot;nofollow&quot;&gt;meant&lt;/a&gt; to be played by students, and thought, so I hope it fits your needs.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;*a random guys current virtual portfolio in a major competition, for example. You can set portfolios to be hidden btw.&lt;/p&gt;&#xA;" OwnerUserId="5314" LastActivityDate="2013-05-31T16:57:05.913" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8127" PostTypeId="1" CreationDate="2013-05-31T18:13:01.673" Score="3" ViewCount="728" Body="&lt;p&gt;Heston and Rouwenhorst (1994) devised an empirical estimation strategy to decompose stock returns into three components: a pure industry effect, a pure country effect, and a world-factor return.  Essentially, they perform monthly cross-sectional weighted least squares regressions on individual stock returns to determine &quot;pure&quot; country and sector effects.  To estimate &quot;pure&quot; effects, they add constraints to the regression so that the country and sector factors have a weighted mean of zero for each period.  Note the intercept in this equation would be interpreted as the global world return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The sector constraint would be interpreted as the product of each sector's market weight and its sector factor coefficient summed over each sector.  Same for country.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, I've built country and sector factors and set up the following regression for one time period but don't know how to add the constraints...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;lm(Return ~ Country + Sector, data = data, weights = MktCapUsd)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Are there packages available to easily add in these types of constraints?&lt;/p&gt;&#xA;" OwnerUserId="5468" LastEditorUserId="1764" LastEditDate="2013-06-01T17:19:30.143" LastActivityDate="2020-07-10T17:29:22.037" Title="Any one know how to implement the Heston and Rouwenhorst country-sector effects regression in R?" Tags="&lt;r&gt;&lt;regression&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8128" PostTypeId="2" ParentId="908" CreationDate="2013-05-31T19:22:03.180" Score="3" Body="&lt;p&gt;This paper by Filimonov and Sornette might be interesting or useful to you.  I've only read about the first third, but I thought the model was pretty cool.  The model for price changes is a self-exciting Poisson process: there is an exogenous factor modeling the &quot;real&quot; price changes, and then there is a feedback mechanism where the overall arrival rate is an exponentially weighted average of recent arrivals.  The paper is available &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1998832&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.  If you go through it all, would welcome your thoughts.&lt;/p&gt;&#xA;" OwnerUserId="3415" LastActivityDate="2013-05-31T19:22:03.180" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8131" PostTypeId="1" AcceptedAnswerId="8137" CreationDate="2013-05-31T21:44:47.670" Score="2" ViewCount="1169" Body="&lt;p&gt;I have two options datasets:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;EOD IV and Greeks&lt;/li&gt;&#xA;&lt;li&gt;Tick option and underlying prices&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I'm looking to calculate IV for each tick. Is there a way to approximate the ticks' IV using last EOD Greeks and IV?&lt;/p&gt;&#xA;" OwnerUserId="2257" LastActivityDate="2013-06-02T02:39:26.700" Title="Aprox intraday implied volatility using intraday option prices and EOD greeks" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;greeks&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8134" PostTypeId="2" ParentId="8110" CreationDate="2013-06-01T12:02:34.030" Score="6" Body="&lt;p&gt;On the request, here are my two cents. Suppose that the price follows the dynamics&#xA;$$&#xA;  \begin{cases}&#xA;    \mathbf z_{k+1} &amp;amp;= F(\mathbf z_k,\mathbf i_k,\mathbf w_k),&#xA;  \\&#xA;    \mathbf i_{k+1} &amp;amp;= G(\mathbf i_k, \mathbf w_k)&#xA;  \end{cases}&#xA;$$&#xA;where $\mathbf z_k$ is a price of a traded assets at the time $k$, $\mathbf i_k$ is the value of parameters of the model (drift, volatility, state of economy etc.) and $\mathbf w_k$ is a noise process. Parameters and noise can be infinite-dimensional (e.g. parameters can be the whole history), the only restriction we put here is that they belong to some Borel spaces. The price process $\mathbf z_k$ however has to be 1-dimensional, with values in $\Bbb R$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, we assume that at any moment of time the trader&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;either can close position if the one is already opened&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;if no position is opened, he can open it on the amount of money he has&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Let $\mathbf x_k$ be the trader's capital, and let $\mathbf u_k$ be the volume of the currently open position (zero if the position is closed). As a result, the dynamics of the capital is&#xA;$$&#xA;  \mathbf x_{k+1} = \mathbf x_k + \rho\mathbf u_k(\mathbf z_{k+1} - \mathbf z_k),&#xA;$$ &#xA;where $\rho$ is a leverage. The state space for the trader is hence &#xA;$$&#xA;  \underbrace{\Bbb R}_{\text{for }\mathbf x_k}\times \underbrace{\Bbb R}_{\text{for }\mathbf u_k}&#xA;$$ &#xA;and the control space is given by $U = [0,\infty)$ with admissible control structure being state dependent:&#xA;$$&#xA;  \mathbf u_{k+1} \in \begin{cases}&#xA;[0,x],&amp;amp;\text{ if } \mathbf u_k = 0,&#xA;\\&#xA;\{0\},&amp;amp;\text{ if }\mathbf u_k &amp;gt; 0.&#xA;\end{cases}&#xA;$$&lt;br&gt;&#xA;Your performance criterion is a final capital for some fixed time horizon $T$, that is $\mathbf x_T$.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Stated in terms of classical stochastic dynamic programming, you have the following Markov control process $(S,U,\{U(s)\}_{s\in S},f,c)$ where the ultimate state space is&#xA;$$&#xA;  S = \underbrace{\Bbb R}_{\text{for }\mathbf x_k}\times \underbrace{\Bbb R}_{\text{for }\mathbf u_k} \times \underbrace{\Bbb R}_{\text{for }\mathbf z_k} \times \underbrace{\Bbb I}_{\text{for }\mathbf i_k},&#xA;$$&#xA;the control space is $U = [0,\infty)$, the control structure is&#xA;$$&#xA;  U(x,u,z,i) = &#xA;  \begin{cases}&#xA;[0,x],&amp;amp;\text{ if } u = 0,&#xA;\\&#xA;\{0\},&amp;amp;\text{ if } u &amp;gt; 0.&#xA;\end{cases}&#xA;$$&lt;br&gt;&#xA;and the dynamics $\mathbf s_{k+1} = f(\mathbf s_k,\mathbf w_k)$ in details look as&#xA;$$&#xA;  \begin{cases}&#xA;    \mathbf z_{k+1} &amp;amp;= F(\mathbf z_k,\mathbf i_k,\mathbf w_k),&#xA;  \\&#xA;    \mathbf x_{k+1} &amp;amp;= \mathbf x_k + \rho\mathbf u_k(\mathbf z_{k+1} - \mathbf z_k),&#xA;  \\&#xA;    \mathbf i_{k+1} &amp;amp;= G(\mathbf i_k, \mathbf w_k).&#xA;  \end{cases}&#xA;$$&#xA;Finally, the running cost is $c_t(s) = 0$ and the final cost is $c_T(s) = x$, where $s = (x,u,z,i)$ is a state vector. The optimal solution to such problems is given by the dynamic programming, and can be consulted in the book of H.-Lerma and Lassaire on Control Markov Processes.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;P.S. This is a model, where you can only trade 1 asset, only long positions are allowed, and you can close the whole position only (rather than a part of it). However, extensions are rather trivial and concern mostly the admissible control structure (which controls are available at which states).&lt;/p&gt;&#xA;" OwnerUserId="464" LastActivityDate="2013-06-01T12:02:34.030" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8136" PostTypeId="1" CreationDate="2013-05-31T15:46:54.917" Score="2" ViewCount="172" Body="&lt;p&gt;Heston and Rouwenhorst (1994) devised an empirical estimation strategy to decompose stock returns into three components: a pure industry effect, a pure country effect, and a world-factor return.  Essentially, they perform monthly cross-sectional weighted least squares regressions on individual stock returns to determine &quot;pure&quot; country and sector effects.  To estimate &quot;pure&quot; effects, they add constraints to the regression so that the country and sector factors have a weighted mean of zero for each period.  Note the intercept in this equation would be interpreted as the global world return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The sector constraint would be interpreted as the product of each sector's market weight and its sector factor coefficient summed over each sector.  Same for country.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, I've built country and sector factors and set up the following regression for one time period but don't know how to add the constraints...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;lm(Return ~ Country + Sector, data = data, weights = MktCapUsd)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Are there packages available to easily add in these types of constraints?&lt;/p&gt;&#xA;" OwnerUserId="5468" OwnerDisplayName="FinanceDude" LastActivityDate="2013-06-01T19:04:31.580" Title="How to set up Heston and Rouwenhorst regression?" Tags="&lt;r&gt;&lt;regression&gt;" AnswerCount="0" CommentCount="1" ClosedDate="2013-06-01T23:48:47.513" ContentLicense="CC BY-SA 3.0" />
  <row Id="8137" PostTypeId="2" ParentId="8131" CreationDate="2013-06-02T02:39:26.700" Score="2" Body="&lt;p&gt;There are essentially two approaches you can take:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Approximate changes in IV by establishing a relationship between IV and option prices through a function of IV solely dependent on option price. While it is computationally very convenient it introduces huge estimation errors in certain cases. As pointed out in my comment above one such case is a slide in underlying prices and accompanying IV shift up which you do not account for by only looking at changes in the option price. Also short-dated options will make your estimation almost worthless because you do not account for delta decay and changed in vega due to the passage of time (dVega/dTime) among other factors that affect short-dated options. I highly discourage you from taking the short route in case you deal with short-dated options. What you could do in this case is the following: Build in a filter and only run such approximation if&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;you do not deal with short dated options&lt;/li&gt;&#xA;&lt;li&gt;fall back on a full-scale IV derivation if the underlying price return lies beyond a certain threshold&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Run a full-scale IV derivation by taking the last option and underlying prices and last observed IV and then apply all first-order greeks and for short-dated options some of the higher order greeks (I mentioned an example above). This will be computationally more intensive but it will be way more accurate.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As I mentioned I do not see much value in why you want to run an approximation in the first place. If you look to derive meaningful IVs then you need to run the full computation, especially if you look to extract IVs for further implied volatility model testing. If you look for enough accuracy to observe bid and offer implied volatility then you should not run any approximations at all. Also, if you have access to historical intraday greeks then I highly recommend to check with your data vendor, most likely they also supply past implied volatility data. Just my two cents. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-06-02T02:39:26.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8138" PostTypeId="1" AcceptedAnswerId="10195" CreationDate="2013-06-02T18:00:29.873" Score="1" ViewCount="1538" Body="&lt;p&gt;I looked through the master list of data sources but could not find any data sources for financial data of global equities. An example would be the balance sheet of, say, &lt;code&gt;STO:HM-B&lt;/code&gt;. The company can be found on both Yahoo Finance and Google Finance but they do not give any financial data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Morningstar.com is the only online site I've found so far that even has the data, but I suspect that isn't free data to use in applications. Also, even if I were to want to scrape that data it would be near impossible since it appears to be JavaScript generated post-page load.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I'm hoping to find is something in XML format or in a format I can myself translate to XML. Even HTML is fine, just as long as it's one site for all financials for most global equities.&lt;/p&gt;&#xA;" OwnerUserId="5363" LastEditorUserId="5363" LastEditDate="2013-06-02T23:37:48.187" LastActivityDate="2019-01-05T09:28:22.363" Title="Data sources for financials of global equities" Tags="&lt;equities&gt;&lt;data&gt;" AnswerCount="4" CommentCount="4" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="8142" PostTypeId="1" CreationDate="2013-06-03T14:59:09.450" Score="2" ViewCount="86" Body="&lt;p&gt;I am trying to analyze an investment strategy that tries to exploit the empirical difference between forward interest rates and realized spot rates. I am using FRAs to capture the difference. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking at different contracts, namely 3x6, 6x9, 9x12, 12x24, 24x36.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Every month from 01/01/1980 to 02/01/2013 a short FRA position is entered. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I want to compare all the contracts in terms of average return p.a., standard deviation p.a., Sharpe ratio, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem is that I don't know how to make the returns from the 3-months contracts comparable to the ones from the 1-year contracts (which should give me returns p.a. already?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I am using only FRAs, all the returns are excess returns; I have no capital to start with. I just enter an FRA with notional 100 every month.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anybody help me?&lt;/p&gt;&#xA;" OwnerUserId="5479" LastEditorUserId="35" LastEditDate="2013-06-04T01:27:33.747" LastActivityDate="2013-06-04T01:27:33.747" Title="FRA-Strategy: Make 3-month and 1-year Excess returns comparable" Tags="&lt;returns&gt;&lt;derivatives&gt;&lt;investment&gt;&lt;forward&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8143" PostTypeId="1" CreationDate="2013-06-02T21:22:32.617" Score="9" ViewCount="487" Body="&lt;p&gt;Explanation for Put Option:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{\partial V}{\partial t}+ \mathcal{L}_{BS} (V) = 0, $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathcal{L}_{BS} (V) = \frac{1}{2} \sigma^2 S^2 \frac{\partial^2 V}{\partial S^2} + (r-q) S \frac{\partial V}{\partial S} - r V$&#xA;holds for $S &amp;gt; S_f$, where $S_f$ is contact point. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why does this equation hold for $S &amp;gt; S_f$?&#xA;Could you give me link for proof?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another question is: &lt;strong&gt;Why do we need high-contact condition&lt;/strong&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I correctly understand that for American Put Option, if $S &amp;gt; S_{f}$, there is no sense to exercise at time $t&amp;lt;T$ (because it causes immediate loss: $-V+S-K&amp;lt;0$).&#xA;So  it behaves like European Option, hence $V^{Am}_{P}=V^{E}_{P}$ and it satisfies Black-Scholes Equation.&lt;/p&gt;&#xA;" OwnerUserId="5486" OwnerDisplayName="Mikhail Norshteyn" LastEditorUserId="26595" LastEditDate="2017-07-17T18:25:29.523" LastActivityDate="2017-07-17T18:25:29.523" Title="Why does Black-Scholes equation hold on continuation region of American Option?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;differential-equations&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8144" PostTypeId="1" CreationDate="2013-06-03T17:10:46.983" Score="3" ViewCount="456" Body="&lt;p&gt;I have a profit loss statement and balance sheet with the following fields: Example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;P&amp;L          &#xA;Turnover420,363 -&#xA;  Cost of sales             £118,730    £140,169    -&#xA;Gross Profit                £178,862    £280,194    -&#xA;  Operating Costs           £154,889    £255,123    -&#xA;  Interest paid (received)  £3,007  £4  -&#xA;  Tax paid  -               £4,838  -&#xA;Profit After Tax (Loss)     £20,966 £20,229 -&#xA;&#xA;Balance Sheet            &#xA;Total assets                £68,090 £47,032&#xA;  Current assets            £62,975 £43,847&#xA;  Fixed assets              £5,115  £3,185&#xA;Total liabilities           £56,560 £55,731&#xA;  Current liabilities       £56,560 £55,731&#xA;  Long-term liabilities     -   -&#xA;Shareholder Funds / Net Assets £11,530  £(8,699)&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd be interested in what models exist to predict credit risk or bankruptcy likelihood based on this information. (I have other meta data available as well, such as industry and location, but I ignore that for the moment)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After researching for a while I found this paper by Altman &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/j.1540-6261.1968.tb00843.x/full&quot; rel=&quot;nofollow&quot;&gt;http://onlinelibrary.wiley.com/doi/10.1111/j.1540-6261.1968.tb00843.x/full&lt;/a&gt;&#xA;He uses a method called Z-score that is the linear combination of five financial ratios. &lt;a href=&quot;http://en.wikipedia.org/wiki/Altman_Z-score&quot; rel=&quot;nofollow&quot;&gt;wikipedia&lt;/a&gt; Is this still widely used today? If not what are the alternatives?&lt;/p&gt;&#xA;" OwnerUserId="1681" LastActivityDate="2019-07-17T08:17:49.420" Title="Risk prediction based on financial statements" Tags="&lt;risk&gt;&lt;valuation&gt;" AnswerCount="3" CommentCount="6" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8145" PostTypeId="2" ParentId="8143" CreationDate="2013-06-03T18:10:51.390" Score="4" Body="&lt;p&gt;The actual problem one solves for American options is an optimal stopping time problem, so the value of the option is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;V_0 = \max_\tau E_{\tau}\left[e^{-r \tau} (S_\tau-K)^+  \right]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the maximum is taken over all stopping times (exercise strategies $\tau&amp;gt;0$ permissible in the contract).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With a PDE operator such as you have, the instantaneous equality can be expressed in linear complementarity form as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \left(\frac{\partial V}{\partial t}+ \mathcal{L}_{BS} (V)\right)\cdot \left(V-g\right) = 0  $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $g$ represents early exercise value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note for convenience that (post exercise) the stock itself satisfies the BS PDE trivially.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2013-06-03T18:10:51.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8147" PostTypeId="2" ParentId="8065" CreationDate="2013-06-03T20:45:53.510" Score="3" Body="&lt;p&gt;Some time ago I tested the IB C++ API with the free demo account: edemo-demouser. The market data is obviously far from reality, but its fine for getting to know the API itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good luck with your project!&lt;/p&gt;&#xA;" OwnerUserId="5480" LastActivityDate="2013-06-03T20:45:53.510" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8148" PostTypeId="2" ParentId="8143" CreationDate="2013-06-03T21:47:35.180" Score="0" Body="&lt;p&gt;The payoff when exercising the option is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\max(K-S(t),0)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;now assume there is a $V(S,t)&amp;lt;\max(K-S(t),0)$: there would be the opportunity for arbitrage. We could buy the asset for $S$ and the put option for $V$. Selling the asset for $K$ would lead to a risk free profit of $K-S-V$. Thus the value of the american put option must hold the additional constraint&#xA;$$V(S,t)\geq \max(K-S(t),0)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As long as $V &amp;gt; K-S$ (or $S&amp;gt;S_f$) it is given by the BS PDE, otherwise the price is given by $K-S$. Most (if not all) textbook introductions to financial derivatives include more details on that and derivations of the BS PDE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second (more mysterious) constraint is a consequence of &quot;optimal&quot; behavior of the agents. Keywords to find more on that might be optimal stopping problem or game theory of options.&lt;/p&gt;&#xA;" OwnerUserId="3263" LastEditorUserId="3263" LastEditDate="2013-06-04T10:15:44.877" LastActivityDate="2013-06-04T10:15:44.877" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8153" PostTypeId="1" CreationDate="2013-06-04T12:28:15.167" Score="3" ViewCount="203" Body="&lt;p&gt;Are there any practical quantitative risk management strategies for a large participant  in an illiquid market with a few dominant players? By a large partcipant I mean someone who &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;has significant share in the market turnover &lt;/li&gt;&#xA;&lt;li&gt;holds large inventory&lt;/li&gt;&#xA;&lt;li&gt;(therefore) could be a subject for predatory trading&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;By illiquid market I mean that trading is possible, however price impact is large and stealth liquidation of even a moderate position is not an option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm currently looking for into a stress testing/scenario but may be there are better approaches?&lt;/p&gt;&#xA;" OwnerUserId="370" LastActivityDate="2013-06-04T12:28:15.167" Title="Quantitative risk management strategy for a large participant in an illiquid market" Tags="&lt;risk-management&gt;&lt;liquidity-risk&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8156" PostTypeId="1" CreationDate="2013-06-04T19:04:50.773" Score="7" ViewCount="2016" Body="&lt;p&gt;I looked through several sources on Bollinger bands and I do not see clear recipes of their usage. &lt;a href=&quot;http://en.wikipedia.org/wiki/Bollinger_Bands&quot; rel=&quot;nofollow noreferrer&quot;&gt;Wikipedia&lt;/a&gt; says  &quot;The use of Bollinger Bands varies widely among traders. &quot;&#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/864/trading-a-stock-or-other-asset-based-on-bollinger-bands&quot;&gt;QSE discussion&lt;/a&gt;  seems also says &quot;Just like everyone else that's been down this path, you'll have to prove this stuff to yourself. &quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt; Would you be so kind to share with me your experience -  how (and when) do you use them ? what are the outcomes? and what idea stands behind it ? &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Let me say what I understand - if market is in horizontal trend, i.e. we can think of it &#xA;as price = Const + noise. Then it is reasonable to expect that if in some moment price is quite big, then it it will return to mean - so we go short at big price and sell in future, when it returns to trend(=Const).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However if we have positive trend: price(t) = A*t+B + noise,&#xA;it very much depends on how fast noise is changing, how big is A, and volatility of noise.&#xA;Since if trend is go ups very quickly even if the price is far from trend and it will return to trend some time after at the moment of return it will be much high than it was before (because of trend), so if you go short - you will lose.&lt;/p&gt;&#xA;" OwnerUserId="4652" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2014-07-28T18:50:41.273" Title="Usage of Bollinger bands" Tags="&lt;trading&gt;&lt;technicals&gt;&lt;charts&gt;" AnswerCount="4" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8158" PostTypeId="2" ParentId="8144" CreationDate="2013-06-05T00:36:09.887" Score="1" Body="&lt;p&gt;You can start exploring the subject by having a look at &lt;a href=&quot;http://socsci2.ucsd.edu/~aronatas/project/academic/science.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Credit risk measurement: Developments over the last 20 years&lt;/a&gt; if only for the reference list. As a more modern approach an &quot;upgraded&quot; version of the original &lt;strong&gt;Z-score&lt;/strong&gt; method was recently proposed by &lt;em&gt;Altman&lt;/em&gt;: &lt;a href=&quot;http://people.stern.nyu.edu/ealtman/z-metrics.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Z-Metrics™ Methodology For Estimating Company Credit&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Though be aware that despite numerous alternative methods being available (just search for &lt;strong&gt;discriminant analysis&lt;/strong&gt;), most of the time you could describe the process as fitting a simple model to the available training/test data set. So the question you have to answer before all is about the appropriateness of the assumptions to your situation (analyzed universe, regime changes etc.). Quality of data is also an issue as already mentioned by &lt;a href=&quot;https://quant.stackexchange.com/users/2114/matt-wolf&quot;&gt;@MattWolf&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="38" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2013-06-05T13:42:16.317" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8159" PostTypeId="2" ParentId="8122" CreationDate="2013-06-05T01:03:06.320" Score="3" Body="&lt;p&gt;So far I only know that SunGard has a product named &quot;Ambit Focus&quot;, where its module &quot;Liquidity Risk&quot; supports the LCR and NSFR reports according to Basel III liquidity rules.&lt;/p&gt;&#xA;" OwnerUserId="2161" LastEditorUserId="35" LastEditDate="2013-06-05T01:26:44.407" LastActivityDate="2013-06-05T01:26:44.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8160" PostTypeId="2" ParentId="8156" CreationDate="2013-06-05T01:08:32.203" Score="4" Body="&lt;p&gt;I have played around with those a bit and my results were mixed. Bollinger bands essentially show you the price relative to rolling window volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One interpretation is that if the current price leaves the Bollinger bands, a trend or movement emerges (of course depending on your time frame as with all technical indicators) in that direction. The strategy would be to buy as soon as the upper band is crossed from below, and close the position as soon as the price crosses the moving average with the same length as the bands. Intuitively, trade when the price is farther away from the moving average than a multiple of standard deviation (larger multiple =&gt; less trades, possibly stronger moves). On multiple day frames (between 4 and 60, iirc), this did yield nice results on stocks (in mock portfolios), but I assume that is mostly due to backtesting bias. Nothing consistent or reliable that I found worthy of exploring given the pressure of actual work. Maybe in the future though...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another interpretation could be to trade the other way: As the price leaves the band, it should soon re-enter it. However I could not come up with a tradingstrategy that even remotely made sense to me, so I didn't explore this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most likely use in practice I would assume to be somewhere in the area of a short- to midterm indicator for equity risk, but I would prefer true econometric methods to be honest.&lt;/p&gt;&#xA;" OwnerUserId="1976" LastActivityDate="2013-06-05T01:08:32.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8161" PostTypeId="2" ParentId="8144" CreationDate="2013-06-05T07:02:55.867" Score="0" Body="&lt;p&gt;You maybe want to have a look at this paper &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2012277&quot; rel=&quot;nofollow&quot;&gt;Are Ratings the Worst Form of Credit Assessment Apart from All the Others?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1880" LastActivityDate="2013-06-05T07:02:55.867" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8162" PostTypeId="2" ParentId="8122" CreationDate="2013-06-05T09:00:26.030" Score="1" Body="&lt;p&gt;OneSumX (FRS Global - now officially Wolters Kluwer Financial Services). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Due to the impact on market risk (explicit creation of new contracts from available liquidity lines, firstly affected by interest rate risk) and on credit risk (negative exposure to be considered in the LCR, and not simply floored to zero) you might need both the market and liquidity reporting modules, if not the full package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.frsglobal.com/solutions/basel-iii.html&quot; rel=&quot;nofollow&quot;&gt;http://www.frsglobal.com/solutions/basel-iii.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2872" LastEditorUserId="2872" LastEditDate="2014-06-26T08:36:56.203" LastActivityDate="2014-06-26T08:36:56.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8164" PostTypeId="2" ParentId="8144" CreationDate="2013-06-05T12:33:30.743" Score="1" Body="&lt;p&gt;If you don’t have any market quotes, one possible way to assess the credit risk of an obligor is to use its financial statements. For instance, this &lt;a href=&quot;http://www.standardandpoors.com/prot/ratings/articles/en/us/?articleType=HTML&amp;amp;assetID=1245340716573&quot; rel=&quot;nofollow noreferrer&quot;&gt;paper&lt;/a&gt; describes the criteria that S&amp;amp;P use to derive the credit rating of a given obligor:  &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Indicative credit ratings might be calculated using the following ratios: FFO/Debt, Debt/EBITDA and Debt/Capital. &lt;/li&gt;&#xA;&lt;li&gt;You also need to consider the business risk profile of the obligor (country &amp;amp; industry risk, competitive position, etc.) &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Given its financial and business risk, a theoretical rating can be obtained using the &lt;a href=&quot;http://www.standardandpoors.com/prot/ratings/articles/en/us/?articleType=HTML&amp;amp;assetID=1245340716573&quot; rel=&quot;nofollow noreferrer&quot;&gt;matrix provided by S&amp;amp;P&lt;/a&gt;. Once you have the credit rating, to infer its credit risk you may: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Compute the credit spread of bonds issued by companies with the same credit rating.&lt;/li&gt;&#xA;&lt;li&gt;Compute the historical default rates that have been observed for companies with the same rating (see &lt;a href=&quot;http://www.standardandpoors.com/ratings/articles/en/us/?articleType=HTML&amp;amp;assetID=1245348978068&quot; rel=&quot;nofollow noreferrer&quot;&gt;S&amp;amp;P&lt;/a&gt;).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="5208" LastEditorUserId="5208" LastEditDate="2019-07-17T08:17:49.420" LastActivityDate="2019-07-17T08:17:49.420" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="8165" PostTypeId="2" ParentId="1238" CreationDate="2013-06-05T14:48:43.480" Score="0" Body="&lt;p&gt;There is a new paper presenting a more accurate way to calculate CVA:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2267508&quot; rel=&quot;nofollow&quot;&gt;An Accurate Solution for Credit Value Adjustment (CVA) and Wrong Way Risk&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5491" LastEditorUserId="35" LastEditDate="2013-06-05T15:12:37.837" LastActivityDate="2013-06-05T15:12:37.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8166" PostTypeId="2" ParentId="689" CreationDate="2013-06-05T14:55:57.543" Score="3" Body="&lt;p&gt;US market uses the STREET convention.&#xA;UK market uses the DMO convention.&#xA;EUR market uses the ICMA convention (Germany uses also a lot MOOSMULLER convention).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main difference between these conventions are: &#xA;- the way the number of days is calculated for the discount factors &#xA;- the day count convention used &#xA;- the calendar used in case of adjsuted schedule. &lt;/p&gt;&#xA;" OwnerUserId="5492" LastActivityDate="2013-06-05T14:55:57.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8168" PostTypeId="1" AcceptedAnswerId="8169" CreationDate="2013-06-05T16:31:07.020" Score="0" ViewCount="266" Body="&lt;p&gt;So I have a problem from Marcel Finan's &quot;A Basic Course in the Theory of Interest and Derivative Markets.&quot; We are going over floors and caps, covered puts and covered calls.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the following combined position:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Buy an index for 500&lt;/li&gt;&#xA;&lt;li&gt;Buy a 500-strike put with expiration date 3 months with a 3-month risk free rate of 1% and premium of 41.95.&lt;/li&gt;&#xA;&lt;li&gt;Borrow 495.05 with 3-month interest rate of 1%.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Graph the payoff diagram and the profit diagram of this position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, since we are simultaneously buying an asset and a purchased put, this makes this a floor.  According to Broverman, the formula for a floor's payoff is&#xA;$$\text{payoff}=\begin{cases}&#xA;K,  &amp;amp; \text{if $S_T\le{K}$} \\&#xA;S_T, &amp;amp; \text{if $S_T\gt{K}$}  \\&#xA;\end{cases}&#xA;$$&#xA;So in this case we know that the cost to purchase both the asset and the put is 541.95 and we are borrowing 495.05 from the start.  So is the expiry price $S_T=500(1.01)=505$?  This would make the payoff $505$, since $505\gt{500}$.&lt;br&gt;&#xA;What about the profit?  Again Broverman has the profit function as&#xA;$$\text{profit}=\begin{cases}&#xA;K-(S_0+P_0)e^{rT},  &amp;amp; \text{if $S_T\le{K}$} \\&#xA;S_T-(S_0+P_0)e^{rT}, &amp;amp; \text{if $S_T\gt{K}$}  \\&#xA;\end{cases}&#xA;$$&#xA;So since $S_T\gt{K}$ is the profit just $505-(500+41.95)(1.01)=-42.37$?&lt;/p&gt;&#xA;" OwnerUserId="5493" LastEditorUserId="848" LastEditDate="2013-06-05T16:57:12.500" LastActivityDate="2013-06-05T17:50:02.377" Title="Floor and Cap problem" Tags="&lt;option-strategies&gt;&lt;homework&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8169" PostTypeId="2" ParentId="8168" CreationDate="2013-06-05T17:50:02.377" Score="1" Body="&lt;p&gt;As the asker already found out:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No this is not simply the answer. $S_T$ is not known at the moment of investment so the future profit is a function of the stochast $S_T$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A graph is a useful tool to gain insight into the amount of profit for each realized value of $S_T$.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2013-06-05T17:50:02.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8170" PostTypeId="1" AcceptedAnswerId="8917" CreationDate="2013-06-05T18:08:24.250" Score="2" ViewCount="503" Body="&lt;p&gt;I want to run a block bootstrap on the relative returns, but I'm not sure if subtracting the mean is important.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A bootstrap sequence is a synthetic sequence generated using the original sequence. If you're backtesting or estimating certain measures, such as volatility or the mean, then you can use the bootstrap to get a confidence interval on these values. The issue is in the way the bootstrap sequence is generated. You have to cut the original sequence into blocks, for the block bootstrap, and select blocks uniformly at random and place them in the sequence they were selected until you have a new bootstrap sequence of length n. You can't use the original prices, so you have to use the relative prices. These relative prices are the same as 1 day returns. I am wondering if mean centering is important in practice. I currently take the difference of their logs,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\log\left(\frac{r_t}{r_{t-1}}\right)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but it seems that some posts have suggested subtracting the mean return from the difference of logs &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\log\left(\frac{r_t}{r_{t-1}}\right) - \mu_r$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most of the papers have an assumption of zero mean sequences. It's easy to zero-mean, but I'm afraid that this introduces some lookahead bias as the mean of the entire sequence is only known with knowledge of the full sequence. Why is subtracting the mean useful/important in practice?&lt;/p&gt;&#xA;" OwnerUserId="5456" LastEditorUserId="5456" LastEditDate="2013-06-11T07:48:58.090" LastActivityDate="2013-12-11T10:16:56.577" Title="Block Bootstrapping Relative Returns" Tags="&lt;returns&gt;&lt;bootstrap&gt;" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8171" PostTypeId="2" ParentId="8115" CreationDate="2013-06-05T23:05:46.757" Score="0" Body="&lt;p&gt;Your fair price formula is not general enough. You need to make W(0) appear, then differentiate wrt it. This will be your delta. You assumed W(0) = 0 and got rid of it, and now you're stuck with nothing to differentiate wrt. &lt;/p&gt;&#xA;" OwnerUserId="5496" LastActivityDate="2013-06-05T23:05:46.757" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8172" PostTypeId="1" CreationDate="2013-06-06T08:47:49.770" Score="5" ViewCount="596" Body="&lt;p&gt;I have recently been tasked to work on fair value derivation for futures on equity indices (non-US). I know that the FVD function in Bloomberg can have a huge discrepancy from markets: where cheap is actually expensive and vice versa. How do I determine the accuracy of my model without waiting for expiry?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main difficulties I have encountered are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Interest rates for cost of carry (some of the countries have closed FX markets), so what is the closest approximation I should look at? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some people have mentioned NDFs but I need help on curve construction, best to ask for quotes from NDF traders?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Dividends - big difference from my calculations vs what Bloomberg's BDVD function shows (divisors differ, confirmed ex-dates and FVD missing out on dividends). How do I determine who is right or wrong?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Accuracy of fair value - given that it is only an estimate, how do people trade the calendar spreads? (Might be OT, forgive me)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;And if possible, what has your experience been when deriving fair values?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5195" LastActivityDate="2013-06-11T04:04:49.717" Title="Futures Contract Fair Values Accuracy" Tags="&lt;futures&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8174" PostTypeId="2" ParentId="7663" CreationDate="2013-06-06T09:55:24.887" Score="2" Body="&lt;p&gt;In addition to &lt;a href=&quot;http://en.wikipedia.org/wiki/Local_volatility&quot; rel=&quot;nofollow&quot;&gt;local volatility&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/Stochastic_volatility&quot; rel=&quot;nofollow&quot;&gt;stochastic volatility&lt;/a&gt; models, &lt;a href=&quot;http://en.wikipedia.org/wiki/Jump_diffusion&quot; rel=&quot;nofollow&quot;&gt;discontinuous jumps&lt;/a&gt; are also an important component of stock price movements that are cannot be properly explained by &lt;a href=&quot;http://en.wikipedia.org/wiki/Diffusion_process&quot; rel=&quot;nofollow&quot;&gt;diffusion models&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This article: &lt;a href=&quot;http://www.ito33.com/sites/default/files/articles/Risk0412ito33_0.pdf&quot; rel=&quot;nofollow&quot;&gt;&quot;Which model for equity derivatives?&quot;&lt;/a&gt;, gives an overview of the rationale behind discontinuous jumps and their importance for modeling the evolution of equity prices, in particular when assessing the fair value of options and contingent claims. &lt;/p&gt;&#xA;" OwnerUserId="5208" LastActivityDate="2013-06-06T09:55:24.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8175" PostTypeId="1" AcceptedAnswerId="8183" CreationDate="2013-06-06T13:17:07.987" Score="2" ViewCount="124" Body="&lt;p&gt;In this &lt;a href=&quot;http://www.r2-financial.com/wp-content/uploads/2012/04/RMFI-5-3_p252-272.pdf-Adobe-Acrobat-Standard.pdf&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; in equation 15 on page 261 dealing with one factor copula model, one is using creditworthiness indicator as one of a variables. It is defined as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;Y_c = \sqrt{\rho_c} Z + \sqrt{1-\rho_c} \epsilon_c&#xA;\end{equation}&#xA;where Z is a systematic factor influencing default an it is standard normal distributed. Can one make it clearer and let me know what Z should be? Can we take credit spread (and implicitly assume spread is normally distributed?)&lt;/p&gt;&#xA;" OwnerUserId="2466" LastEditorUserId="848" LastEditDate="2013-06-07T05:27:42.617" LastActivityDate="2013-06-07T09:22:53.100" Title="Creditworthiness indicator for copula one-factor model" Tags="&lt;probability&gt;&lt;normal-distribution&gt;&lt;copula&gt;&lt;credit-risk&gt;&lt;credit-ratings&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8176" PostTypeId="2" ParentId="8099" CreationDate="2013-06-06T15:05:11.807" Score="6" Body="&lt;p&gt;As of now, I know of no good method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The tedious part about all of this is that there is no company name standard apparent to me, as CIK company name, exchange company name, and legal company name can all be different.  I have to get my hands dirty with the method I use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I only trade options, so I download the CBOE's &lt;a href=&quot;http://www.cboe.com/TradTool/Symbols/SymbolEquity.aspx&quot; rel=&quot;noreferrer&quot;&gt;master list&lt;/a&gt; in &lt;a href=&quot;http://www.cboe.com/publish/ScheduledTask/MktData/cboesymboldir2.csv&quot; rel=&quot;noreferrer&quot;&gt;csv&lt;/a&gt; and input into my database.  I think the stock exchanges post something similar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the tedious part: you can use the &lt;a href=&quot;http://www.sec.gov/edgar/searchedgar/cik.htm&quot; rel=&quot;noreferrer&quot;&gt;established company name to ticker search&lt;/a&gt; which is difficult to parse or this other &lt;a href=&quot;http://www.sec.gov/edgar/searchedgar/companysearch.html&quot; rel=&quot;noreferrer&quot;&gt;search that gives everything on a given result&lt;/a&gt;.  I use the second search.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For this, I made a simple php script that iterates through each ticker I receive from the CBOE, searching first the entire company name then each word individually, both except for words like &quot;the&quot;, &quot;company&quot;, &quot;corporation&quot;, &quot;inc&quot;, etc and dump the results into a database.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll see that with the &quot;other search&quot; there are two results: a company page if there's only result or a company list if there're multiple.  Both are easy to parse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When there's 1 result for the search with the &quot;sanitized&quot; entire company name, I just went with that initially and started on the ones with multiples (rare with full name search) or no results (sometimes with full name search).  Over time, I have confirmed all manually.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The manual inspection never ends.  Companies change names and tickers.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I will now parse with jeff m's link.&lt;/p&gt;&#xA;" OwnerDisplayName="user5462" LastEditorDisplayName="user5462" LastEditDate="2013-06-06T15:26:44.023" LastActivityDate="2013-06-06T15:26:44.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8177" PostTypeId="1" AcceptedAnswerId="8213" CreationDate="2013-06-06T19:49:50.070" Score="2" ViewCount="1267" Body="&lt;p&gt;I've generated roll adjusted notional futures data by adding a roll adjustment to the settlement price then multiplying by contract multiplier through time. For example, for crude oil CL, on 15 March 2013, the settlement price of the CLJ3 contract was &lt;code&gt;93.45&lt;/code&gt;. The cumulative roll adjustment was &lt;code&gt;-70.80&lt;/code&gt; and the multiplier is &lt;code&gt;1,000&lt;/code&gt;. My roll adjusted notional is then $(93.45-70.80)/*1,000=22,650$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is great but take for example 12 Feb 2009 where settlement price was &lt;code&gt;33.98&lt;/code&gt; and cumulative roll adjustment was &lt;code&gt;-33.99&lt;/code&gt;. This gives me a negative roll adjusted contract value of $(33.98-33.99)*1,000=-10$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The implication of a negative roll adjusted notional value on futures is that you have literally lost money through the cost of carry for this product. I am using a method dictated by my client otherwise the ratio method, described &lt;a href=&quot;https://quant.stackexchange.com/questions/419/is-there-a-standard-method-for-getting-a-continuous-time-series-from-futures-dat&quot;&gt;here&lt;/a&gt;, may have been implemented. This person is intent on capturing potential loss due to carry, however.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm challenged in my attempt to compute continuous returns for the series because of the negative values. Taking the log of a negative number in MATLAB returns an imaginary number and Excel can't handle it at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have experience or advice in computing continuous returns for negative roll-adjusted futures notionals?&lt;/p&gt;&#xA;" OwnerUserId="1112" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2013-06-12T00:22:04.820" Title="Continuous returns for negative roll-adjusted futures data" Tags="&lt;futures&gt;&lt;log-returns&gt;&lt;matlab&gt;&lt;roll-adjustment&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8178" PostTypeId="1" AcceptedAnswerId="27701" CreationDate="2013-06-06T21:58:12.177" Score="2" ViewCount="828" Body="&lt;p&gt;Consider a market composed by two stocks whose prices $X$ and $Y$ are given by B&amp;amp;S diffusion:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dX_t= \mu X_t dt+ \sigma X_tdW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dY_t= \mu Y_t dt+ \sigma Y_tdB_t$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Supposing the market is complete, how to evaluate the fair price of an option whose payoff is $$ \phi(X_T,Y_T)=(X_T-Y_T)_+$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My idea was to apply a change of numeraire technique and so obtain price as a function of the B&amp;amp;S formula. However, I was not able to find it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any advice would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="3534" LastEditorUserId="467" LastEditDate="2016-06-18T13:11:34.283" LastActivityDate="2016-06-19T15:55:07.420" Title="How to price an exchange option using B&amp;S framework?" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;stochastic-processes&gt;&lt;pricing-formulae&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8183" PostTypeId="2" ParentId="8175" CreationDate="2013-06-07T09:22:53.100" Score="0" Body="&lt;p&gt;Looks like this &lt;a href=&quot;http://www.gravitascapital.com/Research/Risk/Applying%20Copula%20Function%20to%20Risk%20Management.pdf&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; might be helpful &lt;/p&gt;&#xA;" OwnerUserId="2466" LastActivityDate="2013-06-07T09:22:53.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8185" PostTypeId="2" ParentId="8178" CreationDate="2013-06-07T13:41:59.283" Score="-3" Body="&lt;p&gt;You should study the dynamic of $X_t-Y_t$, don't forget about correlation and that the brownian motion is not the same. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am pretty sure that there is some big flaws in your model (as taking same interest rate). You should really take a look at this: &lt;a href=&quot;http://www.amazon.fr/gp/product/0273759078/ref=pd_lpo_k2_dp_sr_1?pf_rd_p=471061593&amp;amp;pf_rd_s=lpo-top-stripe&amp;amp;pf_rd_t=201&amp;amp;pf_rd_i=0131499084&amp;amp;pf_rd_m=A1X6FK5RDHNB96&amp;amp;pf_rd_r=17B2XDS38PPK4WX24MKQ&quot; rel=&quot;nofollow&quot;&gt;John C. Hull Options, Futures and Other Derivatives&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5052" LastActivityDate="2013-06-07T13:41:59.283" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8186" PostTypeId="2" ParentId="7663" CreationDate="2013-06-07T16:09:01.147" Score="1" Body="&lt;p&gt;Though not widely accepted, an alternative, non-drift option pricing model is &lt;a href=&quot;http://en.wikipedia.org/wiki/User%3aStockequation/sandbox&quot; rel=&quot;nofollow&quot;&gt;detailed here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially, we derive a relation between buy and sell orders and visual displacement on a chart.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\left (\frac{2b_o-t_o}{t_o-b_o}\right )=\frac{\Delta_p}{\Delta_b}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The buy and sell orders themselves can be used in a normal distribution to find the probability of a stock rising above a strike price.&lt;/p&gt;&#xA;" OwnerUserId="5376" LastEditorUserId="5149" LastEditDate="2013-06-07T18:05:21.500" LastActivityDate="2013-06-07T18:05:21.500" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8189" PostTypeId="7" CreationDate="2013-06-07T21:20:42.190" Score="0" Body="&lt;ul&gt;&#xA;&lt;li&gt;How do I become a quant?&lt;/li&gt;&#xA;&lt;li&gt;What programming language should I use?&lt;/li&gt;&#xA;&lt;li&gt;Where can I find free data online?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="-1" LastEditorUserId="35" LastEditDate="2013-06-07T21:20:42.190" LastActivityDate="2013-06-07T21:20:42.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8190" PostTypeId="2" ParentId="8115" CreationDate="2013-06-08T11:48:25.703" Score="5" Body="&lt;p&gt;Consider a dynamic hedging strategy where you invest &lt;span class=&quot;math-container&quot;&gt;$H_t$&lt;/span&gt; in the stock at time &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt;. To eliminate all risk, the value of the investment must be equal to the claim at time &lt;span class=&quot;math-container&quot;&gt;$T$&lt;/span&gt;. Using Ito's calculus, we could express &lt;span class=&quot;math-container&quot;&gt;$A_T$&lt;/span&gt; as follows:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$A_T=\frac{T}{2}+\int_0^T 2W_t \left(1-\frac{t}{T}\right) dW_t=\frac{T}{2}+\int_0^T  H_tdW_t$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Thus the strategy would be to start with an amount &lt;span class=&quot;math-container&quot;&gt;$T/2$&lt;/span&gt; (fair price at &lt;span class=&quot;math-container&quot;&gt;$t=0$&lt;/span&gt;) and invest &lt;span class=&quot;math-container&quot;&gt;$H_t=2W_t(1-t/T)$&lt;/span&gt; dynamically in the stock.&lt;/p&gt;&#xA;&lt;p&gt;PS: This is a special case of the Black-Scholes setup where the interest rate &lt;span class=&quot;math-container&quot;&gt;$r=0$&lt;/span&gt;. If &lt;span class=&quot;math-container&quot;&gt;$X_t$&lt;/span&gt; is the value of the holding and &lt;span class=&quot;math-container&quot;&gt;$S_t$&lt;/span&gt; is the stock price, the value of &lt;span class=&quot;math-container&quot;&gt;$dX_t$&lt;/span&gt; is &lt;span class=&quot;math-container&quot;&gt;$dX_t=H_tdS_t+(X_t-H_tS_t)rdt$&lt;/span&gt;. &lt;span class=&quot;math-container&quot;&gt;$H_t$&lt;/span&gt; is the amount to be investment dynamically in the stock, and is also known as the delta of the option.&lt;/p&gt;&#xA;" OwnerUserId="3511" LastEditorUserId="3511" LastEditDate="2020-12-13T12:49:29.870" LastActivityDate="2020-12-13T12:49:29.870" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="8191" PostTypeId="2" ParentId="3438" CreationDate="2013-06-08T13:49:48.767" Score="1" Body="&lt;p&gt;Another point to mention is that using a LIBOR swap curve removes sovereign risks associated with using treasuries to construct yield curves.&lt;/p&gt;&#xA;" OwnerUserId="5509" LastActivityDate="2013-06-08T13:49:48.767" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8192" PostTypeId="1" AcceptedAnswerId="8193" CreationDate="2013-06-08T14:58:43.320" Score="1" ViewCount="410" Body="&lt;p&gt;Problem from Finan, FM/2&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;On 12-30-1998, you decided to bet on the January effect.  On that day, you bought 400 shares of Microsoft on margin at the price of 139 per share.  The initial margin requirement is 55% and the maintenance margin is 30%.  The annual cost of the margin loan is 6.5%&lt;/p&gt;&#xA;&lt;p&gt;To what price must Microsoft fall for you to receive a margin call?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;So if we use the Initial margin requirement formula&#xA;&lt;span class=&quot;math-container&quot;&gt;$$IM=P\cdot{Q}\cdot{IM\text{%}}$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;But the correct answer of 89.36 as Microsoft price is given only if &lt;span class=&quot;math-container&quot;&gt;$\text{IM%}$&lt;/span&gt; is 45%.  Does this mean that we use &lt;span class=&quot;math-container&quot;&gt;$1-IM\text{%}%$&lt;/span&gt; as the initial margin percentage?  I'm confused about the wording because the problem gives you initial margin requirement as a percentage and not as a dollar value.  If you put 55% in the above equation you do not get the right answer.  No where in the texts that I'm using does it state initial margin requirement as a percentage is &lt;span class=&quot;math-container&quot;&gt;$1-IM\text{%}$&lt;/span&gt;?&lt;/p&gt;&#xA;" OwnerUserId="5493" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2019-09-08T09:09:33.530" Title="Initial margin requirement as percentage, not dollar value" Tags="&lt;equities&gt;&lt;margin&gt;&lt;initial-margin&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="8193" PostTypeId="2" ParentId="8192" CreationDate="2013-06-08T15:14:31.630" Score="1" Body="&lt;p&gt;Nevermind, I just found the quote i needed:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When buying on margin, the investor borrows part of the purchase price of the stock from a broker or brokerage firm and contributes the remaining portion (&amp;lt;----IM requirement)...&#xA;so thus when calculating, if IM requirement is 55%, the amount of the loan is 45%....&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so then calculating the price, we do&#xA;$$\frac{400\cdot{X}-400\cdot{139}\cdot{.45}}{400\cdot{X}}=.3$$&#xA;Solving for X gives us $89.36.&lt;/p&gt;&#xA;" OwnerUserId="5493" LastActivityDate="2013-06-08T15:14:31.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8194" PostTypeId="1" CreationDate="2013-06-09T06:19:17.770" Score="4" ViewCount="643" Body="&lt;p&gt;For simplicity sake, if stock returns are normally distrusted, would that imply that second moment, variance/volatility, is chi-squared distrusted? If so wouldn't that imply the statistics(employed to in hypothesis testing) in garch modeling are also chi-squared distributed used in a chi-square test?&lt;/p&gt;&#xA;" OwnerUserId="4729" LastActivityDate="2013-06-10T17:08:40.953" Title="Volatility Return Distribution/Garch Modeling" Tags="&lt;implied-volatility&gt;&lt;garch&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8195" PostTypeId="2" ParentId="8156" CreationDate="2013-06-09T16:57:34.613" Score="3" Body="&lt;p&gt;John Bollinger, the developer of Bollinger Bands, provides descriptions of methods he suggests for using his bands on his website BBands.com. They can be found under Four Methods in the support area. Bollinger Bands are most effective when used with other indicators for confirmation, and are very powerful for mean reversion and for price breakouts. On the home page of BBands.com there is a free webinar with 22 rules for using the bands that provides a lot of guidance for usage.&lt;/p&gt;&#xA;" OwnerUserId="5514" LastActivityDate="2013-06-09T16:57:34.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8196" PostTypeId="1" CreationDate="2013-06-09T21:32:02.437" Score="10" ViewCount="779" Body="&lt;p&gt;Under the Black-Scholes model, we have the European put option is $\mathbb{E} [e^{-rt}(K-S_t)]$, where we take $\log(S_t)=X_t$ and $dX_t= \sigma dW_t - \dfrac{1}{2}\sigma^2 dt + rdt$. Here the option price is monotone in $\sigma$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To show this we can appeal to Black-Scholes formula. though there is an easier, which directly appeal to the Gaussianity of $\log (S_t)$, the fact that a Gaussian random variable can be written as a sum of two Gaussian random variables, and uses conditional Jensen inequality. This trick would even work even if we work with stochastic volatility, as long as the volatility is driven by a process independent of the Brownian Motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, this trick fails instantly we replace $W_t$ with another Levy process and replace $\dfrac{1}{2}\sigma^2$ with the log moment generating function of the Levy process. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, suppose we replace the $W_t$ by a general Levy process. would this remain true? does there exists any literature on this subject. The gut-feeling is yes, but I have failed to prove this myself. Does anyone know any literature written on this subject?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: As Christian pointed out, volatility is not actually an appropriate word to use here. What I really mean is that, is the price monotone in $\sigma$?&lt;/p&gt;&#xA;" OwnerUserId="3334" LastEditorUserId="3334" LastEditDate="2013-06-10T09:53:30.217" LastActivityDate="2015-11-03T23:21:45.037" Title="Is the price of European put option monotone in volatility if we replace BM in Black-Scholes with a general Levy process?" Tags="&lt;volatility&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8199" PostTypeId="2" ParentId="8196" CreationDate="2013-06-10T15:01:41.387" Score="2" Body="&lt;p&gt;I'm pretty certain it is not monotone -- consider the following argument:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A Levy process is decomposable into a sum of brownian motions, jump processes and poisson processes.  Consider a case where the poisson component is driving price to zero $\left(\log(S) \rightarrow -\infty\right)$ with near certainty, making option value close to intrinsic.  Adding in a highly volatile brownian motion will start to put more probability on survival, decreasing the option value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They key here is that, viewing a Levy process as the sum of two complex processes, we can architect the interaction between them to obtain pathological behavior.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2013-06-10T15:40:37.300" LastActivityDate="2013-06-10T15:40:37.300" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8201" PostTypeId="2" ParentId="8194" CreationDate="2013-06-10T17:08:40.953" Score="4" Body="&lt;p&gt;Squaring normally distributed variables results chi-square distributions, which (as you imply) is why the chi-square distribution is used in hypothesis tests for the variance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you estimate a Garch model and obtain the conditional variance at every point in time, you could use a chi-squared hypothesis test to ask a question like is the variance in a particular period greater than some number. I don't think I've ever bothered to do this, but I suppose it is possible. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nevertheless, that does not mean that the parameters to a Garch model also require a chi-square test. Garch is often estimated by quasi-MLE and standard errors are calculated using well-known approaches, i.e. not based on a chi-squared distribution. A simpler case is to consider estimating an Arch model, which can be done with OLS on the squared returns (assuming zero mean) and their lags. The distribution of the errors to this equation is non-normal, but OLS is a reasonable estimator when non-normal. You may need to calculate robust standard errors but not necessary. Hypothesis tests on the parameters of the Arch estimation can be conducted as usual. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is one area where the issue is far more clear in a Bayesian framework. In the Bayesian framework you clearly define the prior on the parameter (often rather the inverse of the parameter for variance). The distribution of the posterior can be used to conduct any relevant hypothesis tests.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2013-06-10T17:08:40.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8202" PostTypeId="1" AcceptedAnswerId="8205" CreationDate="2013-06-10T18:35:53.510" Score="2" ViewCount="555" Body="&lt;p&gt;I faced a problem that gives the following information:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;market risk premium, and risk free rate is given&lt;/li&gt;&#xA;&lt;li&gt;You currently have a portfolio of amount of x, beta b1.&lt;/li&gt;&#xA;&lt;li&gt;Now there is a new investment opportunity of amount y, beta b2, expected return r2.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The question is:&#xA;Under what circumstance should you take the new investment opportunity?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the answer is quite simple, just calculate the required rate of return for investment y, and compare that to r2. If it is lower than r2 then take it, else don't. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am slightly confused because the problem also gave the information on the current investment, and value of the new investment. Is this redundant information?&lt;/p&gt;&#xA;" OwnerUserId="5518" LastEditorUserId="5518" LastEditDate="2013-06-10T19:09:52.330" LastActivityDate="2013-06-11T01:50:17.940" Title="Required Rate of Return vs Expected Return" Tags="&lt;return&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8203" PostTypeId="1" CreationDate="2013-06-10T19:45:11.973" Score="1" ViewCount="317" Body="&lt;p&gt;Let say I ran two strategies and got its weights at each rebalance and equity curves. I would like to combine these systems to get the performance if I were to trade them concurrently from a portfolio level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first way to do it would be to just take the equity curves of the respective strategies and treat them as asset class return streams and allocate weights at desired rebalance. To get the performance, I simply do w'R, where w = weights at each rebalance and R being the returns of the strategies. If I were to calculate portfolio volatility given weights w, I would simple employ p.risk = w'E w.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second way to do it, is to first calculate the get the desired weights for each strategies. From there I can drill deeper and get the weights of the asset classes for each strategy. (assume they trade the same universe) But the problem here is that when I get the aggregate exposure for each asset class and calculate portfolio level volatility (using w'Ew (of asset classes)), I get a number that is less than the first way of doing it. Why is that? Should both methods be the same, all else equal?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;example of second way&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each strategy trades Asset1 and Asset2&lt;/p&gt;&#xA;&#xA;&lt;p&gt;at first rebalance:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Strategy 1 allocated 30%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Strategy 2 allocated 70%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Within each strategy:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Strategy 1 allocates 10% to Asset1 and 90% to Asset2&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Strategy 2 allocates 60% to Asset1 and 40% to Asset2&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get portfolio level asset exposure simply:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Strategy1: x= asset 1 (30%*10%), asset2 (30% * 90%) = 3% , 27%&#xA;Strategy2: y= asset 1 (70%*60%), asset2 (70% * 40%) = 42%, 28%&#xA;&#xA;Aggregate Asset 1 exposure = 3% + 42% = 45%&#xA;Aggregate Asset 2 exposure = 27% + 28% = 55%&#xA;for a total of 100%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So given asset1 = 45% weight and asset2 of 55% weight, I can simply get portfolio risk by w'Ew where E = covariance between the two assets.&lt;/p&gt;&#xA;" OwnerUserId="2318" LastEditorUserId="2318" LastEditDate="2013-06-11T13:39:01.040" LastActivityDate="2013-06-13T14:49:02.790" Title="Volatility Estimation" Tags="&lt;volatility&gt;&lt;asset-allocation&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8205" PostTypeId="2" ParentId="8202" CreationDate="2013-06-11T01:40:24.393" Score="0" Body="&lt;p&gt;This question is maybe not just about evaluating whether investment y is profitable in terms of expected return vs. required return but you also may need to consider the opportunity cost, meaning, whether it makes more sense to invest in investment x or y &lt;strong&gt;plus&lt;/strong&gt; whether it may be most beneficial to diversify into investments in x and y.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without knowing the context in which the question was posed I would say that the answer is supposed to be qualitative in nature and that the correct answer should be that there is missing information in order to fully determine whether a diversification benefit will cause the best investment to be a portfolio of x &lt;strong&gt;and&lt;/strong&gt; y. For example, details on the individuals' risk is only given as betas but the betas are computed through the covariance and individual investment's standard deviation, both of which are missing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the two investments are perfectly positively correlated then you would obviously want to invest everything in the investment with the most attractive expected return relative to the required return, but if the investments correlate otherwise then I would say that to give a precise answer you would need more information than what was given.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In summary, either the question looks for a purely qualitative answer and checks whether you understand the bigger picture of investing in different assets or you are simply asked to calculate the expected return of investment x through b1, r-f-rate, and market risk premium and compare with investment y. I would err on the former. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-06-11T01:50:17.940" LastActivityDate="2013-06-11T01:50:17.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8206" PostTypeId="2" ParentId="8172" CreationDate="2013-06-11T04:04:49.717" Score="2" Body="&lt;p&gt;All pretty good questions given this is your first question on this site. Answer is you do not know with absolute certainty whose dividend model is the right one. But generally you get a pretty good read given you talk to broker dealers regularly. Anything that is estimated can by definition not be accurate so you need to build you own model with the given information at hand, which includes what other market participants are seeing. How wide the spread in estimates is also is of importance and should be taken into account by your model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would definitely take into account market dividend rates. Even if you just infrequently trade with certain sell-side desks they generally share their dividend data. If that is not the case but you have access to an in-house vol desk then you should talk to them because they most certainly get the dividend data from whichever counter party they trade with. In fact dividend data are often shared during the price agreement process when trading single stock or index options.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-06-11T04:04:49.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8209" PostTypeId="2" ParentId="7650" CreationDate="2013-06-11T10:38:45.380" Score="2" Body="&lt;p&gt;If you're asking for the covariance structure, then the simplest asynchronous estimator is that from &lt;a href=&quot;http://projecteuclid.org/DPubS?service=UI&amp;amp;version=1.0&amp;amp;verb=Display&amp;amp;handle=euclid.bj/1116340299&quot; rel=&quot;nofollow&quot;&gt;Hayashi-Yoshida&lt;/a&gt; - &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S0167947309003636&quot; rel=&quot;nofollow&quot;&gt;Corsi-Audrino&lt;/a&gt; which avoids any bias from synchronization. There is a wide literature developed on top, from dealing with microstructure noise&amp;amp;autocorrelation to improving efficiency, but the basic form should usually suffice in practice. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;VMA&amp;amp;c and filters are surely also feasible, but sometimes overkill, just like classical missing data methods such as expectation maximization.&lt;/p&gt;&#xA;" OwnerUserId="3015" LastActivityDate="2013-06-11T10:38:45.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8210" PostTypeId="1" CreationDate="2013-06-11T21:00:33.537" Score="4" ViewCount="386" Body="&lt;p&gt;Can someone provide me with details or a reference on how to transform the Black-Scholes PDE with nonconstant coefficients (i.e. $r=r\left(S,t\right)$, $\sigma=\sigma\left(S,t\right)$) to the heat equation? Thank you in advance.&lt;/p&gt;&#xA;" OwnerUserId="5525" LastActivityDate="2013-06-11T21:00:33.537" Title="Black-Scholes PDE to heat equation, nonconstant coefficients" Tags="&lt;black-scholes&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8213" PostTypeId="2" ParentId="8177" CreationDate="2013-06-12T00:22:04.820" Score="0" Body="&lt;p&gt;Turns out there are many methods which people use to adjust futures time series. The method employed depends on the use. There's a real nice paper &lt;a href=&quot;http://www.ipedr.com/vol29/48-CEBMM2012-R00003.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; that synthesizes each of the methods. Turns out the method Matt Wolf described will likely work the best.&lt;/p&gt;&#xA;" OwnerUserId="1112" LastActivityDate="2013-06-12T00:22:04.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8215" PostTypeId="2" ParentId="7162" CreationDate="2013-06-12T09:59:32.327" Score="5" Body="&lt;p&gt;I would also recommend &lt;a href=&quot;http://aws.amazon.com&quot; rel=&quot;nofollow&quot;&gt;Amazon AWS&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using Amazon Elastic MapReduce you can schedule jobs, deploy them on as many servers as you like and consolidate the results of your tests.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Their pricing is very reasonable (starting at $0.020 per hour!)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We use Amazon AWS quite a lot for our own Algorithmic Trading Framework &lt;a href=&quot;http://www.algotrader.ch&quot; rel=&quot;nofollow&quot;&gt;AlgoTrader&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5530" LastEditorUserId="467" LastEditDate="2013-06-12T12:33:46.493" LastActivityDate="2013-06-12T12:33:46.493" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8216" PostTypeId="2" ParentId="3778" CreationDate="2013-06-12T10:02:16.917" Score="0" Body="&lt;p&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt; I work for AlgoTrader.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.algotrader.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;AlgoTrader&lt;/a&gt; is used by some smaller hedge funds, especially in the volatility trading area.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;AlgoTrader is a Java based Algorithmic Trading Platform that enables development, simulation and execution of multiple strategies in parallel. The automated Trading Software can trade Forex, Options, Futures, Stocks &amp;amp; Commodities on any market. The system is based on Complex Event Processing (CEP) and Event Stream Processing (ESP) using Esper.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, the system does have both a FIX interface as well as Bloomberg connectivity.&lt;/p&gt;&#xA;" OwnerUserId="5530" LastEditorUserId="924" LastEditDate="2017-08-01T08:53:10.207" LastActivityDate="2017-08-01T08:53:10.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8217" PostTypeId="2" ParentId="306" CreationDate="2013-06-12T10:13:15.257" Score="0" Body="&lt;p&gt;Besides all the procedural languages mentioned above I would also strongly vote for Complex Event Processing (CEP) and its programming language EPL (similar to SQL). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Time-based Market Data Analysis and Signal Generation are coded in EPL statements, whereas procedural actions like placing an order are coded in plain Java Code. The combination of the two provides a best-of-both-worlds approach and accommodates strategies that are predominantly time-based and therefore cannot be programed with traditional procedural programming languages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://esper.codehaus.org/&quot; rel=&quot;nofollow&quot;&gt;Esper&lt;/a&gt; is an Open Source solution in the CEP area.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.algotrader.ch&quot; rel=&quot;nofollow&quot;&gt;AlgoTrder&lt;/a&gt; is an Algorithmic Trading Framework based on CEP and Esper.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;AlgoTrader is a Java based Algorithmic Trading Platform that enables development, simulation and execution of multiple strategies in parallel. The automated Trading Software can trade Forex, Options, Futures, Stocks &amp;amp; Commodities on any market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two versions available of AlgoTrader:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;An Open Source Version that you can download for free&lt;/li&gt;&#xA;&lt;li&gt;A Commercial Version (with Support and Professional Services) &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="5530" LastActivityDate="2013-06-12T10:13:15.257" CommentCount="2" CommunityOwnedDate="2013-06-12T10:13:15.257" ContentLicense="CC BY-SA 3.0" />
  <row Id="8219" PostTypeId="1" AcceptedAnswerId="8221" CreationDate="2013-06-12T14:38:53.030" Score="5" ViewCount="734" Body="&lt;p&gt;When reading a paper by DeMiguel and Nogales (2007; &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=911596&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=911596&lt;/a&gt;), I came across the following formulation: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Comparing the proposed minimum-risk portfolios to the traditional minimum-variance&#xA;  portfolios, we observe that the proposed portfolios have more stable weights than the traditional&#xA;  minimum-variance portfolios,...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And I am left wondering: is a minimum-risk and minimum-variance portfolio the same thing? Usually, risk is measured by standard deviation, if I'm not mistaken, which is not equal to variance; however, a larger variance means larger risk and vice versa. Did the authors just want to avoid repeating themselves?&lt;/p&gt;&#xA;" OwnerUserId="1817" LastEditorUserId="38" LastEditDate="2013-06-12T16:09:00.140" LastActivityDate="2013-06-19T08:28:56.363" Title="Are minimum-risk and minimum-variance portfolios equivalent?" Tags="&lt;minimum-variance&gt;&lt;markowitz&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8220" PostTypeId="2" ParentId="8219" CreationDate="2013-06-12T16:06:01.763" Score="3" Body="&lt;p&gt;Risk is a broader concept than variance. That paper is specifically focused on robust estimators (i.e., estimators that are less sensitive to outliers) of dispersion. A robust estimator of dispersion is not the same thing as variance (which may be a dispersion parameter for some classes of distributions). Nevertheless, these robust estimators could be used to estimate portfolio risk. Other approaches to minimizing risk could include minimizing conditional Value at Risk/Expected Shortfall.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastEditorUserId="2379" LastEditDate="2013-06-12T16:54:39.090" LastActivityDate="2013-06-12T16:54:39.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8221" PostTypeId="2" ParentId="8219" CreationDate="2013-06-12T16:06:12.140" Score="4" Body="&lt;p&gt;The problem lies in the definition of &lt;em&gt;risk&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that in the cited paper, the authors treat &lt;em&gt;risk&lt;/em&gt; as a concept connected with the uncertainty of the out-of-sample performance of the portfolio. In that way portfolios constructed using the proposed robust estimators would be what they call &lt;strong&gt;minimum-risk portfolios&lt;/strong&gt;. Contrasted with &lt;strong&gt;minimum-variance portfolios&lt;/strong&gt;, which aim to minimize the in-sample variance, they may differ significantly. So, at least in my perception, that's where the difference comes from.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a general context you may see &lt;em&gt;minimum-risk&lt;/em&gt; and &lt;em&gt;minimum-variance&lt;/em&gt; portfolios used interchangeably as synonyms. Indeed, standard deviation (square root of variance) is most commonly used as a means to express risk (especially in the Markowitz's optimization context) so that may be the cause of your confusion.&lt;/p&gt;&#xA;" OwnerUserId="38" LastActivityDate="2013-06-12T16:06:12.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8222" PostTypeId="7" CreationDate="2013-06-12T16:12:29.950" Score="0" Body="&lt;p&gt;&lt;strong&gt;Quantitative Finance Stack Exchange&lt;/strong&gt; is a question and answer site for professionals and academics in quantitative finance. It's built and run &lt;em&gt;by you&lt;/em&gt; as part of the &lt;a href=&quot;http://stackexchange.com&quot;&gt;Stack Exchange&lt;/a&gt; network of Q&amp;amp;A sites. With your help, we're working together to build a library of detailed answers to every question about quantitative finance.&lt;/p&gt;&#xA;" OwnerUserId="-1" LastEditorUserId="35" LastEditDate="2013-06-12T16:12:29.950" LastActivityDate="2013-06-12T16:12:29.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8224" PostTypeId="2" ParentId="461" CreationDate="2013-06-13T08:38:06.037" Score="2" Body="&lt;p&gt;At AlgoTrader we also use &lt;a href=&quot;http://esper.codehaus.org/&quot; rel=&quot;nofollow&quot;&gt;Esper&lt;/a&gt; to store all arriving Tick Data in a local Esper Named Window. After a predefined interval, the latest Tick Data snapshot is written to both the filesystem and the database. The actual persistence is done in a separate thread by using Esper Threading. Currently we use MySql but you could just as well use some NoSQL Database (like MongoDB).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have a look how this is done at our &lt;a href=&quot;http://code.google.com/p/algo-trader/&quot; rel=&quot;nofollow&quot;&gt;Open Source Page&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Algorithmic Trading Platform AlgoTrader is also available as a &lt;a href=&quot;http://www.algotrader.ch&quot; rel=&quot;nofollow&quot;&gt;Commercial Version&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Disclosure: I work for AlgoTrader&lt;/p&gt;&#xA;" OwnerUserId="5530" LastActivityDate="2013-06-13T08:38:06.037" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8225" PostTypeId="2" ParentId="8170" CreationDate="2013-06-13T09:18:35.713" Score="0" Body="&lt;p&gt;When you do bootstrapping, the actual problem is that you have too few events to really get an actual distribution. There are X methods to get the original set enriched, reinserting the events based not only on the uniform distribution when selecting the nth event out of the N total ones.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the mean is one of the first characteristics of a distribution (the 1st moment), substracting a mean (whatever reasons you have), you implicitly throw information away. &#xA;You might well calculate whatever mean you want at the very end and do with it the intended stuff.&lt;/p&gt;&#xA;" OwnerUserId="2872" LastActivityDate="2013-06-13T09:18:35.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8226" PostTypeId="2" ParentId="8203" CreationDate="2013-06-13T14:49:02.790" Score="1" Body="&lt;p&gt;Yes, you can definitely use the classic $\sigma^2=w' \Sigma w$ formula to compute the volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, you first compute your consolidated portfolio $w_p$ from your two strategies portfolios $w_A$ and $w_B$ by giving them weights weights $\alpha_A$ and $\alpha_B$ as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$w_p = \alpha_A \cdot w_A + \alpha_B \cdot w_b $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the variance is calculated for $w_p$ as it would for any portfolio.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2013-06-13T14:49:02.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8227" PostTypeId="1" AcceptedAnswerId="8265" CreationDate="2013-06-14T13:47:00.470" Score="8" ViewCount="1520" Body="&lt;p&gt;From a quant point of view, how would you explain Malliavin calculus in few words ? I have the level to take these courses, but won't be able to do it next year, so I want to know what I am missing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What would they bring to someone who has already learned stochastic Calculus with Ito's integral?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would they be more useful for front office or middle office?&lt;/p&gt;&#xA;" OwnerUserId="5052" LastEditorUserId="13415" LastEditDate="2014-12-17T08:03:41.623" LastActivityDate="2014-12-17T08:03:41.623" Title="Malliavin Calculus" Tags="&lt;stochastic-calculus&gt;&lt;malliavin-calculus&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="8228" PostTypeId="1" AcceptedAnswerId="8237" CreationDate="2013-06-14T22:29:42.990" Score="7" ViewCount="8397" Body="&lt;p&gt;I want to calculate IV for american options with dividends. So far I have found algorithms to calculate the option price given a volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please can you point me to paper or implementation (R, python or any other language) of an algorithm that can calculate the IV given option prices, risk free rate, dividends, etc.&lt;/p&gt;&#xA;" OwnerUserId="2257" LastEditorUserId="2257" LastEditDate="2013-06-15T14:24:32.903" LastActivityDate="2017-10-03T09:07:26.777" Title="How to calculate the implied volatility using the binomial options pricing model" Tags="&lt;options&gt;&lt;volatility&gt;&lt;option-pricing&gt;&lt;implied-volatility&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8234" PostTypeId="1" AcceptedAnswerId="8244" CreationDate="2013-06-15T14:56:05.507" Score="16" ViewCount="16676" Body="&lt;p&gt;In my previous job, a fund of funds, they used 3 months forward FX contracts (renewed every 3 months) to protect their portfolio against currency risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I do understand why forwards are useful for fixed schedule (like bonds with coupons at fixed periods). I don't understand why it is protecting the portfolio's positions against currencies risk during the undetermined positions lifetime time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe, I'm unclear. So, here is an example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The portfolio is in USD.&lt;/li&gt;&#xA;&lt;li&gt;It has 3 positions, 2 in USD and 1 in EUR.&lt;/li&gt;&#xA;&lt;li&gt;The EUR position needs to be protected against EUR/USD variation.&lt;/li&gt;&#xA;&lt;li&gt;Positions can be held during an unknown period (over a year maybe).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;With renewed 3-months FX forward, your EUR position is protected only for 3 months. When the contract ends, you get a new one with a new &quot;price&quot; close to current spot and not close to the initial investment spot rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I missing something? I was told, this is the most efficient way.&lt;/p&gt;&#xA;" OwnerUserId="5539" LastEditorUserId="5539" LastEditDate="2013-06-15T17:26:47.437" LastActivityDate="2013-06-19T15:37:22.273" Title="Why using 3 months forward to hedge fx risk on a fund of funds portfolio?" Tags="&lt;risk&gt;&lt;fx&gt;&lt;forward&gt;&lt;hedge&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8235" PostTypeId="2" ParentId="8228" CreationDate="2013-06-15T23:34:52.347" Score="2" Body="&lt;p&gt;You don't need an algorithm to solve that - just program a simple BS option calculator using standard BS with dividend in Excel and fix all the inputs except the volatility. Then use goal seek/solver to change the volatility to get the given price and as a result you will have the implied volatility of the price.&lt;/p&gt;&#xA;" OwnerUserId="5350" LastActivityDate="2013-06-15T23:34:52.347" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8236" PostTypeId="2" ParentId="8228" CreationDate="2013-06-16T04:37:02.860" Score="1" Body="&lt;p&gt;I tried to answer this in the comments but it got too long. simplest approach would be to guess a low and high volatility that is guaranteed to envelope the one to solve for. then compute the corresponding options prices at each of these guesses using your pricer. then while the difference between your guesses (the low/high volatility) is greater than some specified espilon, compute the price of an option at the average of your two guesses. Now adjust either your low volatility guess or high volatility guess depending on whether the price of the option at the average volatility is greater than or less than the price you are given from the market. This will then allow you to push up your low volatilty guess to where the average of the guesses was or push down your high guess to the average. Thus you bisect and iterate, and ultimately your two guesses are equal and given you the price of the option given from the market. This is the simple algo in so many words. &lt;/p&gt;&#xA;" OwnerUserId="5241" LastActivityDate="2013-06-16T04:37:02.860" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8237" PostTypeId="2" ParentId="8228" CreationDate="2013-06-16T12:32:54.283" Score="5" Body="&lt;p&gt;Here is a paper by the infamous Mark Rubinstein that should get you started. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.haas.berkeley.edu/groups/finance/WP/rpf232.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.haas.berkeley.edu/groups/finance/WP/rpf232.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And here the trinomial tree version:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.ederman.com/new/docs/gs-implied_trinomial_trees.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.ederman.com/new/docs/gs-implied_trinomial_trees.pdf&lt;/a&gt; by no lesser than Derman and Kani. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This may also help with the actual computations:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://sfb649.wiwi.hu-berlin.de/papers/pdf/SFB649DP2008-044.pdf&quot; rel=&quot;nofollow&quot;&gt;http://sfb649.wiwi.hu-berlin.de/papers/pdf/SFB649DP2008-044.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-06-16T15:08:27.453" LastActivityDate="2013-06-16T15:08:27.453" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8238" PostTypeId="1" AcceptedAnswerId="8239" CreationDate="2013-06-17T03:47:27.947" Score="1" ViewCount="610" Body="&lt;p&gt;I'm reading &quot;Insights for Bank Directors&quot; (&lt;a href=&quot;http://www.stlouisfed.org/col/director/reference_view.htm&quot; rel=&quot;nofollow&quot;&gt;http://www.stlouisfed.org/col/director/reference_view.htm&lt;/a&gt;), a good introduction to commercial banks, based on a virtual bank &quot;Insight&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It talks about Gap Analysis, on how a bank is positioned by comparing the values of the assets and liabilities that roll over—or reprice—at various time periods in the future. &#xA;( &lt;a href=&quot;http://www.stlouisfed.org/col/director/Materials/alco_gapanalysis_print.htm&quot; rel=&quot;nofollow&quot;&gt;http://www.stlouisfed.org/col/director/Materials/alco_gapanalysis_print.htm&lt;/a&gt; )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It says banks shall keep short term gap position low:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;... ALCO is recommending that the bank sell \$1.6 million in Treasury&#xA;  notes coming due at the end of October (the coming month) and use the&#xA;  proceeds from the sale to buy higher-yielding, five-year notes issued&#xA;  by the Federal Home Loan Bank. The effect of this transaction would be&#xA;  to increase the bank’s negative gap–that is, the purchase would reduce&#xA;  rate-sensitive assets that will reprice within the next year by \$1.6&#xA;  million. The \$1.6 million would now move to a 1-5 year time period&#xA;  column of the report. The bank’s negative cumulative gap position at&#xA;  one year would increase to \$3,533. As a result, if rates rise as&#xA;  expected, the bank’s net interest income would decline more than if&#xA;  the notes had not been purchased. The recommendation to buy the notes&#xA;  is not a good one.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However, I don't get it, why short term gap position shall be maintained low?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically bank have long term asset (loans, T-Bills) and short term liabilities (Deposits, CDs). Revolvingly taking short term liability to fund long term assets -- this is how banks make profit using the term structure, as short term yield is always lower than long term ones. So why there shall be a problem if the short term gap position is high? in the example, if the \$1.6 million in Treasury note coming due at the end of the next month, is used to buy five-year notes, leaving the short term CD more obvious, what would be the problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it the problem that if interest rate increases in October, Insight Bank needs pay more interest to CDs? In this case, if the \$1.6m is not used to buy 5-year notes, it could be used to buy short term notes, which would brings high interest to compensate the cost to CDs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the above is the concern, could it be another option, that is to use part of the \$1.6m to buy some interest rate options or swaptions?&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2013-06-18T07:37:22.690" Title="why banks shall keep short term gap position low?" Tags="&lt;interest-rates&gt;&lt;risk-management&gt;&lt;asset-allocation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8239" PostTypeId="2" ParentId="8238" CreationDate="2013-06-17T04:30:44.530" Score="3" Body="&lt;p&gt;Very simple answer: Duration, my friend. The notes present much higher interest sensitivity and if rates across the curve rise the investment in the longer duration notes will cause a mark to market loss larger than the outstanding treasury notes. Not always do banks have the luxury to hold all their assets until maturity, especially not when the regulatory environment is about to change (Basel III, ...), when the asset base crumbles due to investors/depositors' risk aversion, and such forth. A bank pays very close attention to what their in-house economists think rates will do across the whole spectrum of the curve because banks generally take exposure to a whole host of very interest sensitive securities. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I cannot comment on the specific recommendation but the above is a general explanation why banks do not blindly lend long-term and finance themselves short-term. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-06-18T07:37:22.690" LastActivityDate="2013-06-18T07:37:22.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8242" PostTypeId="1" AcceptedAnswerId="8318" CreationDate="2013-06-17T14:59:42.070" Score="8" ViewCount="1494" Body="&lt;p&gt;From a quant point of view, how would you explain Multi Fractals Models in few words ? I have the level to take these courses, but won't be able to do it next year, so I want to know what I am missing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What would they bring to someone who has already learned stochastic Calculus with Ito's integral?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would they be more useful for front office or middle office?&lt;/p&gt;&#xA;" OwnerUserId="5052" LastActivityDate="2013-06-30T03:13:22.907" Title="Multi Fractals Models" Tags="&lt;stochastic-calculus&gt;&lt;models&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="8243" PostTypeId="1" AcceptedAnswerId="8308" CreationDate="2013-06-17T15:00:17.293" Score="3" ViewCount="289" Body="&lt;p&gt;At many exchanges the opening price is set using an auction which takes place pre-opening (see &lt;a href=&quot;http://www.itg.com/news_events/papers/Inside_Opening_Auction.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; for example). During the auction you are allowed to place orders according to certain rules (you might for example be prevented to cancel any order you have made).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you know of any established models or &quot;rule of thumb&quot; for predicting at &#xA;what order volume you would move the opening price? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you place an order larger than the current bid/ask volume you would probably move the opening price, but the problem is made harder (I think at least!) since there are also hidden order volumes.&lt;/p&gt;&#xA;" OwnerUserId="5549" LastEditorUserId="5549" LastEditDate="2013-06-18T09:35:43.410" LastActivityDate="2013-06-23T06:55:01.323" Title="At what volume would you move the price at the opening auction?" Tags="&lt;equities&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8244" PostTypeId="2" ParentId="8234" CreationDate="2013-06-17T17:00:54.407" Score="12" Body="&lt;p&gt;The majority of the movement in currencies is in the spot rates, rather than in the term structure. A 3-month rolling hedge would always be protecting against movements in the spot rates, no matter when they happen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using your example, if the current EUR/USD rate is 1.3333, you might be able to get a 3-month forward at 1.3339. (Forgive me if I have the direction wrong here, I haven't touched FX in years.) If the spot rate jumps to 1.2000 by the time your 3-month forward expires, you will have 0.1339 in profits to protect you from losses in your position. If you are then able to roll the hedge to a new 3-month forward at 1.2006, you still keep the 0.1339 in profits. When you finally exit you EUR position, you might only get 1.2000 for it, but you have 0.1339 in profits from that first forward. Therefore the hedge has worked, absorbing the vast majority of your currency losses.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This rolling hedge would fail if the underlying were something where the term structure was more active. Take natural gas. If you have a natural gas position -- say a producing field that will come online in an unknown number of years into the future -- then making 3-month rolling hedges would not provide much protection. Natural gas in 3 months is very uncorrelated with natural gas in 3 years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To the extent that currency term structures do change -- meaning a move in the relative interest rates of the two countries -- you would not be protected very well. You would only be protected for the remaining life of the current 3-month forward, not for the months or years between that forward's expiration and your underlying position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since your old employer says that 3-month rolling hedges were the most efficient, they probably did their research. Multi-year forwards are not nearly as liquid as 3-month forwards, and they would have paid a larger bid/offer to their bank/counterparty. In the USD/EUR case they could have used Eurodollars vs. Euribor futures to hedge the interest rate risk, but the transaction costs there are not low either, and they'd have to worry about margin. They probably decided that the risk was small and the cost of a more complete hedge was high.&lt;/p&gt;&#xA;" OwnerUserId="5550" LastActivityDate="2013-06-17T17:00:54.407" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8245" PostTypeId="1" AcceptedAnswerId="8321" CreationDate="2013-06-18T01:52:05.200" Score="1" ViewCount="759" Body="&lt;p&gt;At the moment I am running a Quad Core Xeon PC with 12GB of RAM doing crude MC with 10k scenarios and 1000 time steps. And using fminsearch for calibration, and it takes about half an hour to an hour to do the work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, assuming MC is the only possible way for doing so (I know there are other ways from the post here, thanks to the great people at StackExchange: &lt;a href=&quot;https://quant.stackexchange.com/questions/7048/other-means-of-calibrating-heston-models&quot;&gt;Other means of calibrating Heston models&lt;/a&gt;), is there any way I can speed this up a little? I am already using Matlabpool open for parallel computing and I would like my code to be flexible enough so that I can still run other alternatives of the Heston model (say Chan model) which does not have an easy analytical solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="3595" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2013-06-24T13:15:11.783" Title="Heston MC Simulations - Speed up in Matlab" Tags="&lt;monte-carlo&gt;&lt;heston&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8246" PostTypeId="1" AcceptedAnswerId="8263" CreationDate="2013-06-18T02:28:30.960" Score="4" ViewCount="959" Body="&lt;p&gt;So I have been trying to implement a simple Heston calibration using crude MC with 10k scenarios and 1000 time steps and the best I could get is 3x of the observed implied volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suspect it has something to do with the way my initial guess worked, and therefore, I am just wondering:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Is the initial guess very critical (that a not-so-great initial guess could give you 3x the differences)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If it is, how can I get a good initial guess?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3595" LastActivityDate="2013-06-19T14:32:54.190" Title="Heston - How important are the initial guess in calibration and if it is very important, what would be a good way to get initial guess?" Tags="&lt;heston&gt;&lt;parameter&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8247" PostTypeId="1" AcceptedAnswerId="8248" CreationDate="2013-06-18T04:35:29.390" Score="41" ViewCount="25347" Body="&lt;p&gt;This question has puzzled me for a while. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We all know geometric brownian motions have drifts $\mu$: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS / S = \mu dt + \sigma dW$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and different stocks have different drifts of $\mu$. Why would the drifts go away in Black Scholes? Intuitively, everything else being equal, if a stock has higher drift, shouldn't it have higher probability of finishing in-the-money (and higher probability of having higher payoff), and the call option should be worth more? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an intuitive and easy-to-understand answer? thanks. &lt;/p&gt;&#xA;" OwnerUserId="2576" LastActivityDate="2020-11-04T21:44:42.347" Title="Why Drifts are not in the Black Scholes Formula" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;risk-neutral-measure&gt;" AnswerCount="15" CommentCount="3" FavoriteCount="45" ContentLicense="CC BY-SA 3.0" />
  <row Id="8248" PostTypeId="2" ParentId="8247" CreationDate="2013-06-18T07:19:22.390" Score="43" Body="&lt;p&gt;Here couple pointers that may make it clearer:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Drift can be replaced by the risk-free rate through a mathematical construct called risk-neutral probability pricing. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Why can we get away with that without introducing errors? The reason lies in the ability to setup a hedge portfolio, thus the market will not compensate us for the drift above and beyond the risk free rate under risk-neutral probability pricing. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;As long as such hedge exists  and couple other conditions are met (please look up Girsanov's Theorem) we can introduce a risk-neutral measure so that when applying it to the differential equation and through application of Ito Calculus the drift term vanishes, which greatly simplifies the underlying math.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It is not easy to come up with a way to reliably measure drift as it is not well known and hard to estimate in reality. Similarly, real probabilities are different for every underlying asset and are difficult to estimate because investors require different risk premiums for each and every asset. Hence, being able to take the detour through risk neutral pricing greatly simplifies the derivation not only mathematically but also intuitively. Please note that the volatility of the risk neutral paths and paths under real-world probabilities are identical, what differs is the drift term vs risk-free rate. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Keep in mind that not all derivative functions can be derived through risk-neutral pricing, in fact I venture to estimate that less than 20% of all traded derivatives by investment banks can be priced through risk-neutral pricing (in terms of number of different instruments not trading volume). &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In order to understand the technical reason of the elimination of drift through risk-neutral pricing you need to walk through the mathematics and one of the cleanest and most intuitive approaches I have seen was in Steven Shreve's book, Stochastic Calculus for Finance II, page 218-220 (2004 edition)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-06-18T11:42:33.577" LastActivityDate="2013-06-18T11:42:33.577" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8250" PostTypeId="2" ParentId="8247" CreationDate="2013-06-18T13:07:03.667" Score="10" Body="&lt;p&gt;$$dS / S = \mu dt + \sigma dW \\&#xA;\\ dS / S  -r dt= \mu dt - rdt + \sigma dW \\&#xA;\\ dS / S  -r dt= [\frac{(\mu - r)}{\sigma}dt + dW]\sigma \\$$&#xA;Then, Girsanov tells us that, as long as the risk premium is bounded from below, we can write&#xA;$[\frac{(\mu - r)}{\sigma}dt + dW]\sigma$ as $\sigma d\tilde{W}$ where $\tilde{W}$ is simply another brownian motion with mean 0 and variance equal to its time step.  Hence,&#xA;$$dS / S = rdt + \sigma d\tilde{W} \\$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way to think about this is that, in the Black-Scholes world of option pricing, markets are assumed to be friction-less and hence, all assets can be perfectly hedged. If we can perfectly hedge our underlying asset, then in theory, it should have no volatility and should grow at the risk free rate, r.  &lt;/p&gt;&#xA;" OwnerUserId="826" LastActivityDate="2013-06-18T13:07:03.667" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8251" PostTypeId="1" CreationDate="2013-06-18T14:02:05.890" Score="12" ViewCount="19344" Body="&lt;p&gt;I am reading a paper where the term conditional variance is mentioned, but I am not really sure what is meant by this and how this can be calculated:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Fig. 2 shows the conditional variances of the centered returns of the&#xA;  series of prices under study.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;As far is know the term conditional variances is used only in GARCH models. So, I assume that in order to calculate these variances one has to use a GARCH Model for the returns. First, one has to calculate the returns $r_t = \ln(p_t) - \ln(p_{t-1})$. Then, the returns should be centered via $\hat{r}_t = r_t-\bar{r}$ (quite unsure if this meant by centered). The last step would be to apply a GARCH model. Is this going into the right direction or am I completely lost here?&lt;/p&gt;&#xA;" OwnerUserId="5556" LastEditorUserId="5669" LastEditDate="2013-07-13T14:56:22.107" LastActivityDate="2018-12-06T08:06:21.713" Title="How to calculate the conditional variance of a time series?" Tags="&lt;time-series&gt;&lt;garch&gt;&lt;variance&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="8252" PostTypeId="2" ParentId="8247" CreationDate="2013-06-18T16:44:59.503" Score="31" Body="&lt;p&gt;Being on the sell side and selling options you can intuitively think of it like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An option is like any other product that is being produced out of ingredients and because of the competitive situation of the producer this is done by the cheapest possible production process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The ingredients are in a simple (Black Scholes) setting a stock and and a risk free bond. So this is where the name &quot;derivative&quot; comes from: It is derived from other, simpler products (the underlying).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now to make it even simpler think of a call with a zero strike on the underlying. How would you price such a call? Well, you would price it like the stock (up to a correction for the risk free interest rate)! Here the same question could be asked: Shouldn't it be priced higher with the underlying having higher drift? The answer is no, because this is already included in the price of the underlying! You would kind of double count this effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &quot;real&quot; options the reason is the same, the only thing that changes is that you have to adapt the proportion of the stock when the price of the underlying changes. But the original reasoning stays the same: The drift does not enter into the price of the derivative because it is already included in the price of the underlying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A very readable intuitive paper on this issue is by a giant of the field, Emanuel Derman. It can be found here:&#xA;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=364760&quot; rel=&quot;noreferrer&quot;&gt;The Boy's Guide to Pricing &amp;amp; Hedging&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also my answer to a similar question here: &#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/103/how-does-the-risk-neutral-pricing-framework-work/107#107&quot;&gt;How does the &amp;quot;risk-neutral pricing framework&amp;quot; work?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2013-06-18T16:52:14.700" CommentCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="8254" PostTypeId="1" CreationDate="2013-06-18T20:23:18.307" Score="2" ViewCount="121" Body="&lt;p&gt;I have a 14 year backtest for a systematic strategy that uses a static notional per each position. On any given day I could have multiple positions long and short and notional long and short.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I standardize my returns to show the correct % return from the portfolio?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Notional per trade= 10k&#xA;20 Longs= 200k notional long&#xA;5 Shorts= 50k notional short&#xA;Say I make 2k on my longs is 1%&#xA;Say I lose 2k on my shorts is (4%)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I derive a standardized percentage return for the portfolio as a whole? What is &quot;industry standard&quot;?&lt;/p&gt;&#xA;" OwnerUserId="5558" LastEditorUserId="35" LastEditDate="2013-06-18T20:25:07.100" LastActivityDate="2013-06-18T20:25:07.100" Title="% Return on backtest with variable positions and notional amounts" Tags="&lt;trading&gt;&lt;returns&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8256" PostTypeId="1" CreationDate="2013-06-18T21:15:47.613" Score="2" ViewCount="157" Body="&lt;p&gt;Let’s say I have a function, which is a time series of data points, I am trying to find a polynomial of fixed sine's and cosines that bests approximate the data points. I know Chebyshev Approximation is popular tool to approximate a dataset function with a polynomial. I am trying to approximate the function with a trigonometric polynomial that finds the optimal  coefficients and periodicities for each cosine/sine term that best minimizes the error. I have done this before using trigonometric regressions to find a best fit for a time series but my problems with trig regressions is there are infitinitly many periodicities to test. Is there an approximation method that can be used to approximating the best coefficient on each cosine/sine and the optimal periodicity that best fits the data? Thank you!&lt;/p&gt;&#xA;" OwnerUserId="4729" LastActivityDate="2013-06-19T15:43:14.413" Title="Approximating a function with trignometric polynomials" Tags="&lt;econometrics&gt;&lt;numerical-methods&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8257" PostTypeId="1" CreationDate="2013-06-19T00:40:01.567" Score="9" ViewCount="593" Body="&lt;p&gt;Allow me to explain.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You look back from some period to the present. Say a week ago to now, using a per-minute view. You then crawl through your database of past price data, and you try to find a history segment that is most similar to what that one week window is. You display the historical data's price after that matched historical segment in hopes that the current market will follow a trend similar to what that historical data did.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To me, this sounds like a great strategy because it attacks the market on the pattern level. It doesn't rely on indicators to look for trends, it looks for the trends themselves. But I can't help but think that this is naive and will be a waste of time to implement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone done this? Or can anyone tell me why this is a dumb idea?&lt;/p&gt;&#xA;" OwnerUserId="5559" LastActivityDate="2014-03-27T18:15:16.183" Title="Is there a name for, or any research on, a system where you try to predict future price by finding a similar price history in the past?" Tags="&lt;algorithm&gt;&lt;algorithmic-trading&gt;" AnswerCount="5" CommentCount="7" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8258" PostTypeId="2" ParentId="8257" CreationDate="2013-06-19T05:43:53.290" Score="5" Body="&lt;p&gt;You might want to check out the book &lt;a href=&quot;http://books.google.de/books?id=jbD47VkOHAEC&amp;amp;lpg=PP1&amp;amp;pg=PP1#v=onepage&amp;amp;q&amp;amp;f=false&quot; rel=&quot;noreferrer&quot;&gt;Evidence Based Technical Analysis&lt;/a&gt; by David Aronson.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In it he applies statistical techniques to determine whether certain time series patterns have any predictive power. It's an interesting read and should equip you with some ideas on how to differentiate between folklore and statistical rigor. It also gives you ample literature references.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find a good overview and summary of the book on &lt;a href=&quot;http://www.cxoadvisory.com/2526/technical-trading/evidence-based-technical-analysis-applying-the-scientific-method-and-statistical-inference-to-trading-signals-chapter-by-chapter-review/&quot; rel=&quot;noreferrer&quot;&gt;CXO Advisory&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also find further material on the &lt;a href=&quot;http://www.evidencebasedta.com/&quot; rel=&quot;noreferrer&quot;&gt;webpage of the author&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2013-06-19T05:43:53.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8260" PostTypeId="2" ParentId="8219" CreationDate="2013-06-19T08:28:56.363" Score="2" Body="&lt;p&gt;Answering &quot;No&quot; to the title question, I'll mention that variance is a rather poor measure of risk, even if convinient and nicely behaving. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Variance is not even a risk measure, with the standard deviation eventully being a deviation risk measure, while not necessarily for downside risk (see David Nawrocki-&quot;A Brief History of Downside Risk Measures&quot; for historical alternatives)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nowadays the expected shortfall seams to be the most fashionable (tail) risk measure for portfolios (ex: Turan G. Bali, K. Ozgur Demirtas and Haim Levy: &quot;Is There a Relation Between Downside Risk and Expected Stock Returns?&quot;)&lt;/p&gt;&#xA;" OwnerUserId="2872" LastActivityDate="2013-06-19T08:28:56.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8261" PostTypeId="2" ParentId="1238" CreationDate="2013-06-19T08:41:59.190" Score="0" Body="&lt;p&gt;Mind the &quot;side-effects&quot; of CVA: DVA and FVA. &#xA;Antonio Castagna has some clear introduction to them (&quot;Funding, Liquidity, Credit and Counterparty Risk: Links and Implications&quot; - for DVA, and &quot;Yes, FVA is a Cost for Derivatives Desks&quot;)&lt;/p&gt;&#xA;" OwnerUserId="2872" LastActivityDate="2013-06-19T08:41:59.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8263" PostTypeId="2" ParentId="8246" CreationDate="2013-06-19T09:11:45.027" Score="3" Body="&lt;p&gt;To check your results, you might try &quot;The Heston Model: A Practical Approach with Matlab Code&quot; by Nimalin Moodley, &lt;a href=&quot;http://math.nyu.edu/~atm262/fall06/compmethods/a1/nimalinmoodley.pdf&quot; rel=&quot;nofollow&quot;&gt;http://math.nyu.edu/~atm262/fall06/compmethods/a1/nimalinmoodley.pdf&lt;/a&gt; , in particular the www.ingber.com open source C++ code for Adaptive Simulated Annealing (+ SWIG to wrap/parse it to the language you are using)&lt;/p&gt;&#xA;" OwnerUserId="2872" LastActivityDate="2013-06-19T09:11:45.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8264" PostTypeId="2" ParentId="998" CreationDate="2013-06-19T09:19:58.540" Score="1" Body="&lt;p&gt;The Wiki pages seemed to have been upgraded :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Renaissance_Technologies&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Renaissance_Technologies&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Investment strategy&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Renaissance uses computer-based models to predict price changes in easily-traded financial instruments. These models are based on analyzing as much data as can be gathered, then looking for non-random movements to make predictions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[Teitelbaum, Richard (2008-10-27). &quot;Simons at Renaissance Cracks Code, Doubling Assets&quot;. Bloomberg. Retrieved 2009-06-02.]&lt;/p&gt;&#xA;" OwnerUserId="2872" LastActivityDate="2013-06-19T09:19:58.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8265" PostTypeId="2" ParentId="8227" CreationDate="2013-06-19T09:36:23.527" Score="10" Body="&lt;p&gt;I think this question has no easy answer but I'll give it a shot anyway (beware: oversimplification ahead!).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main idea of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Malliavin_calculus&quot;&gt;Malliavin calculus&lt;/a&gt; is to be able to differentiate stochastic processes like &lt;a href=&quot;http://en.wikipedia.org/wiki/Wiener_process&quot;&gt;Brownian motion&lt;/a&gt; (or more general &lt;a href=&quot;http://en.wikipedia.org/wiki/Martingale_%28probability_theory%29&quot;&gt;martingales&lt;/a&gt; with bounded quadratic variation), which are not differentiable in the traditional sense (because of their infinite variation).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Insofar the Malliavin calculus is the natural counterpart for stochastic differentiation to what the &lt;a href=&quot;http://en.wikipedia.org/wiki/Ito_calculus&quot;&gt;Ito calculus&lt;/a&gt; is for stochastic integration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the practical application of Malliavin calculus is in the area of calculating &lt;a href=&quot;http://en.wikipedia.org/wiki/Greeks_%28finance%29&quot;&gt;option Greeks&lt;/a&gt; which makes sense since you would suspect that you needed derivatives to calculate these.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main problem with the traditional approach is that the derivative needs to be approximated using the ﬁnite diﬀerence method and such approximations can become very rough. The integration by parts formula obtained from Malliavin calculus can transform a derivative into a weighted integral of random variables. This gives a more accurate and fast converging numerical solution than obtained by the classical method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some parts of the following thesis (on which parts of this answer are based too) might be helpful to dive deeper into the matter: &lt;a href=&quot;http://frank-oertel-math.de/PhD_thesis_on_Malliavin_Calculus_incl_copy_of_FO.pdf&quot;&gt;The Malliavin calculus by Han Zhang&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To dive deeper into the practical applications (plus a primer on Malliavin calculus at the end!) can be found here: &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=301703&quot;&gt;Smart Monte Carlo: Various Tricks Using Malliavin Calculus by Eric Benhamou&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2013-06-19T09:45:53.823" LastActivityDate="2013-06-19T09:45:53.823" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8266" PostTypeId="2" ParentId="8256" CreationDate="2013-06-19T09:44:08.127" Score="4" Body="&lt;p&gt;Working on trigonometric polynomial decomposition, the first step is to take a big look at &lt;a href=&quot;https://en.wikipedia.org/wiki/Fourier_transform&quot; rel=&quot;nofollow&quot;&gt;Fourier transformation&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is very powerfull, well documented and probably well implemented on your favorite language.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It will give you the decomposition of your time series. You can remove highest frequencies, which correspond to noise, to have a good estimation.&lt;/p&gt;&#xA;" OwnerUserId="5052" LastEditorUserId="35" LastEditDate="2013-06-19T11:11:52.187" LastActivityDate="2013-06-19T11:11:52.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8267" PostTypeId="2" ParentId="8234" CreationDate="2013-06-19T10:04:37.163" Score="0" Body="&lt;p&gt;The price of the Forex Future is linked to the Spot Rate by the following formula:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;spot * exp(rate difference * years)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Choosing a 3-month time horizon is indeed quite common for &quot;manual&quot; hedging when the holding period of the positions is quite long.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet the higher your trade frequency (in your case concerning the EUR position), the more often you need to adjust your hedge. If you have to do it on a daily basis (or even more frequently), it might make sense to use a Trading platform for this purpose. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Two additional Notes on this topic:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;There are actually three different contract sizes for the EUR/USD FX Futures: 2'500, 62'500 and 125'000 USD. We use the large ones to do the main portion of the hedge and mostly keep it for the entire 3 months. In addition we use the medium ones to adjust the hedge on a weekly basis&lt;/li&gt;&#xA;&lt;li&gt;Also, some Brokers (e.g. InteractiveBrokers) provide virtual Spot Positions which essentially remove the when-to-roll question.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="5530" LastEditorUserId="5530" LastEditDate="2013-06-19T15:37:22.273" LastActivityDate="2013-06-19T15:37:22.273" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8268" PostTypeId="2" ParentId="8246" CreationDate="2013-06-19T14:32:54.190" Score="2" Body="&lt;p&gt;It depends on the used optimization algorithm, esp. whether they act locally or globally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just to give you some ideas:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Local (deterministic) algorithms (e.g. &lt;a href=&quot;http://en.wikipedia.org/wiki/Gradient_descent&quot; rel=&quot;nofollow&quot;&gt;gradient methods&lt;/a&gt;): a good initial guess is crucial.&lt;/li&gt;&#xA;&lt;li&gt;(Global) stochastic algorithms (e.g. &lt;a href=&quot;http://en.wikipedia.org/wiki/Simulated_annealing&quot; rel=&quot;nofollow&quot;&gt;simulated annealing&lt;/a&gt;): the initial guess is irrelevant.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You can find more here: &lt;a href=&quot;http://www.math.umn.edu/~bemis/IMA/MMI2008/calibrating_heston.pdf&quot; rel=&quot;nofollow&quot;&gt;Heston’s Stochastic Volatility Model Implementation, Calibration and Some Extensions by Sergei Mikhailov, Ulrich Nögel&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2013-06-19T14:32:54.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8270" PostTypeId="2" ParentId="8256" CreationDate="2013-06-19T15:43:14.413" Score="3" Body="&lt;p&gt;Building upon +&lt;a href=&quot;https://quant.stackexchange.com/users/5052/lmorin&quot;&gt;Imorin&lt;/a&gt; answer, you should have a look specifically at &lt;strong&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Discrete_cosine_transform&quot; rel=&quot;nofollow noreferrer&quot;&gt;discrete cosine transforms&lt;/a&gt;&lt;/strong&gt;. It's a standard approach when trying to express finite sequences as a sum of cosines. I would start from there, especially as it's implemented in every common language (&lt;a href=&quot;http://cran.r-project.org/web/packages/fftw/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;R&lt;/a&gt;, &lt;a href=&quot;http://www.mathworks.com/help/signal/ref/dct.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Matlab&lt;/a&gt;, &lt;a href=&quot;http://docs.scipy.org/doc/scipy/reference/generated/scipy.fftpack.dct.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Python&lt;/a&gt; for starters). Only then evaluate if you need more.&lt;/p&gt;&#xA;" OwnerUserId="38" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2013-06-19T15:43:14.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8271" PostTypeId="1" CreationDate="2013-06-19T15:46:43.023" Score="14" ViewCount="1229" Body="&lt;p&gt;Creating random portfolios with weights $x_i$ can be thought of as sampling from the surface of a simplex given by $$Ex = f$$ and $$Ax \le b$$ Where $E$ and $A$ are constraint matrices for equality and inequality constraints, and $f$ and $b$ are solutions for some portfolio you want to match on, $x_0$. Adjusting the previous equations to reflect this gives us:&#xA;$$Ex = f = Ex_0$$ and $$Ax \le b = Ax_0.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The equality constraints are relatively easy to satisfy, the solution is simply $x = x_0 + Z r$, where $Zr$ is in the null-space of $E$, and this can be the basis of a Monte Carlo random-walk. However there is no straightforward, mathematical way to link the inequality constraints with the equality constraints. The solution seems to be to check if your walk takes you over the boundary, and then reflect back over it, however as the number of $x$'s gets very large, the number of faces to reflect over grows with $n$ and this starts to pose a problem with computation time. Is there a better way to do this algorithm, or is this problem just hard?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Here is some sample R code with the random walk and reflecting over the boundaries, only handing the inequality constraint that all $x$'s must be positive:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;require(MASS)&#xA;getWeights &amp;lt;- function(Emat, x0, n, verbose = FALSE) {&#xA;    Z = Null(t(Emat))&#xA;    ret = matrix(0, nrow = length(x0), ncol = n + 1)&#xA;    ## Would it be better to use apply here?&#xA;    nc = ncol(Z)&#xA;    mn = mean(x0)&#xA;    ret[, 1] = x0 + Z %*% rnorm(nc, 0, mn)/sqrt(nc)&#xA;    k = 0&#xA;    if(verbose) cat(&quot;Created Vectors: &quot;)&#xA;    if(verbose) cat(paste(k))&#xA;&#xA;    for (i in 2:(n + 1)) {&#xA;        ret[, i] = ret[, i - 1] + Z %*% rnorm(nc, 0, mn)/sqrt(nc)&#xA;        m = k + 1;&#xA;        while(any(ret[, i] &amp;lt; 0)) {&#xA;            reflection = rep(0, ncol(Emat))&#xA;            reflection[which(ret[, i] &amp;lt; 0)] = ret[, i][which(ret[, i] &amp;lt; 0)]&#xA;            for (j in 1:ncol(Z)) {&#xA;                ret[, i] = ret[, i] - 2* Z[, j] * (reflection %*% Z[, j])/sqrt(Z[,&#xA;                  j] %*% Z[, j])&#xA;            }&#xA;            ##for(i in 1:nchar(paste(k)))  cat(&quot;\b&quot;)&#xA;            ##if(verbose) cat(paste(m))&#xA;            ##k = m&#xA;            ##m = k + 1&#xA;        }&#xA;        if(verbose) for(i in 1:nchar(paste(k)))  cat(&quot;\b&quot;)&#xA;        if(verbose) cat(paste(m))&#xA;        k = m&#xA;    }&#xA;    ret = ret[, 2:(n + 1)]&#xA;    if(verbose) cat(&quot;\n&quot;)&#xA;    return(ret)&#xA;}&#xA;Emat = matrix(1, ncol = 1000, nrow = 1)&#xA;x0 = rep(1/1000, 1000)&#xA;w = getWeights(Emat, x0, 1000, TRUE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see this code simply goes too slow. (Do you think it would be best to try and implement this code faster, using C and multiple cores, or would it be more worthwhile changing the algorithm?)&lt;/p&gt;&#xA;" OwnerUserId="5523" LastEditorDisplayName="user1157" LastEditDate="2014-02-13T17:01:49.223" LastActivityDate="2014-03-15T18:18:38.797" Title="Is creating constrained random portfolios a hard problem?" Tags="&lt;portfolio-management&gt;&lt;r&gt;&lt;monte-carlo&gt;&lt;random-walk&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8272" PostTypeId="1" CreationDate="2013-06-20T09:12:15.140" Score="3" ViewCount="3772" Body="&lt;p&gt;My goal is to develop a model to simulate long term FX movements. (I am not sure if long term makes any difference, but if it does I am more interested in long term fx movements)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These Monte Carlo simulations will &lt;em&gt;not&lt;/em&gt; be used for pricing but from a risk-management perspective, to calculate how much the portfolio is exposed to FX risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering if there is a suggested model (or paper or anything) that I could use as a starting base.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Some further notes, after Matt's comment:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not interested in some sort of a trading strategy (i think i misused the words: portfolio and exposure). And i don't want to hedge or price anything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Imagine that you have lend some money (through some instrument) that you will receive in 20-30 years in a foreign currency.  Now you believe that forex rates have some correlation with your instrument and some other factors and you want to see how much you stand to lose in a worst case scenario.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My idea was that I would run an MC where i will have some sort of forex evolution correlated with the evolution of my instrument and i set up some sort of a stress test.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is my line of thinking correct, or you believe that i should be trying something else?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we agree that my approach is decent, my question is how would you evolve a forex rate.&lt;/p&gt;&#xA;" OwnerUserId="5569" LastEditorUserId="5569" LastEditDate="2013-06-20T12:48:03.047" LastActivityDate="2013-06-20T12:48:03.047" Title="Models for simulating FX movements" Tags="&lt;fx&gt;&lt;monte-carlo&gt;&lt;simulations&gt;&lt;modelling&gt;" AnswerCount="0" CommentCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="8273" PostTypeId="1" CreationDate="2013-06-20T10:28:42.160" Score="16" ViewCount="1044" Body="&lt;p&gt;My question in short is as follows: can I take main principal component of historical covariance matrix and use it as historical volatilities when fitting a binomial tree?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's more detailed description:&#xA;let's suppose I want to build Hull-White or BDT tree. They both need current rates curve $r(t)$ and volatility curve $\sigma(t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's also suppose I have a history of interest rates in columns&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;r(1)   r(2)   r(3)   r(4)     &amp;lt;---- index means they are of different terms&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; 6%     7%     8%    8.5%     &amp;lt;----- example numbers&#xA; 4%     6.5%   9%    10%&#xA; ...    ...    ...   ...&#xA; 7%     11%    13%   14%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What can I do to estimate volatility?&#xA;Easiest way is to calculate standard deviation of differenced values in each column (hope it is evident what I mean). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another approach is to obtain whole covariance matrix $\Omega$, which items are $\Omega_{i,j} = \sigma_i \sigma_j \rho_{i,j}$. In this case our standard deviations from previous approach will lie on main diagonal of that matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What we now can do is apply PCA so that to have covariance matrix decomposed into main components. This means I decompose how matrix $\Omega$ multiples by some vector $x$ in the following way: $\Omega x = \left(\lambda_1 u_1 u_1^T  + ... + \lambda_N u_N u_N^T\right) x$. And if I take first principal componenent $u_1$ which corresponds to largest $\lambda$, I have some vector with volatilies along the the time, which gives most effect: $\Omega x \approx \lambda_1 u_1 u_1^T x$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I want to understand if I could use that $u_1$ instead of vector of simple standard deviations, in a hope that such choice will help me better capture term structure behavior?&lt;/p&gt;&#xA;" OwnerUserId="2870" LastEditorUserId="2870" LastEditDate="2013-06-20T10:45:04.240" LastActivityDate="2015-06-25T16:11:28.433" Title="Applicability of PCA to get historical volatilities to calibrate interest rates trees" Tags="&lt;interest-rates&gt;&lt;pca&gt;&lt;hullwhite&gt;&lt;bdt&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8274" PostTypeId="1" AcceptedAnswerId="26228" CreationDate="2013-06-20T11:29:50.067" Score="34" ViewCount="10216" Body="&lt;p&gt;In the world of finance, &lt;a href=&quot;https://quant.stackexchange.com/questions/103/how-does-the-risk-neutral-pricing-framework-work&quot;&gt;Risk-neutral pricing&lt;/a&gt; allow us to estimate the fair value of &lt;a href=&quot;http://en.wikipedia.org/wiki/Derivative_%28finance%29&quot; rel=&quot;noreferrer&quot;&gt;derivatives&lt;/a&gt; using the risk free rate as the expected return of the underlyings. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the behavior of financial assets in the real-world might be substantially different to the evolution used in a risk-neutral context.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, if I want to estimate the real-world probability of an equity asset reaching certain thresholds, which models and calibration techniques could be used?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular, some questions that may arise in the estimation of real-world probabilities are: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Calibration&lt;/strong&gt;: Should real-world probabilities be calibrated to current market prices or, alternative, historical data should be used for this type of estimation?&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;No-arbitrage conditions&lt;/strong&gt;: Could they be relaxed or they still play a role in the assessment of real-world probabilities?&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Expected returns&lt;/strong&gt;: Assuming that I have already estimated the expected return of an asset $\mu$, how accurate would be a real-world estimation that combines a widely used evolution model (e.g. &lt;a href=&quot;http://en.wikipedia.org/wiki/Geometric_Brownian_motion&quot; rel=&quot;noreferrer&quot;&gt;Geometric Brownian motion&lt;/a&gt;), with the use of $\mu$ instead of the risk free rate $r$? &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Per comments, I understand that in order to estimate real-world probabilities:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I should use expected returns instead of the risk-free rate. &lt;/li&gt;&#xA;&lt;li&gt;The asset evolution should still respect the no-arbitrage conditions (i.e: the real-world dynamics should still reproduce the current prices of vanilla options). &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;However, if we just use $\mu$ instead of $r$, the underlying asset behavior might not be consistent with the observed option prices. For instance, if we just change $r$ by $\mu$ (with $\mu&amp;gt;r$) the underlying asset dynamics will lead to call prices above its current market price, and put prices below its market price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, in addition to use expected returns, which other adjustment might be needed in order to estimate real-world probabilities?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any papers or references regarding real-world estimation will be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="5208" LastEditorUserId="5208" LastEditDate="2019-01-14T14:45:16.880" LastActivityDate="2020-08-19T09:15:59.110" Title="How to estimate real-world probabilities" Tags="&lt;derivatives&gt;&lt;risk-neutral-measure&gt;&lt;forecasting&gt;&lt;stochastic-discount&gt;&lt;real-world-measure&gt;" AnswerCount="6" CommentCount="0" FavoriteCount="54" ContentLicense="CC BY-SA 3.0" />
  <row Id="8275" PostTypeId="2" ParentId="8274" CreationDate="2013-06-20T12:28:37.270" Score="6" Body="&lt;p&gt;This is indeed one of the most difficult tasks to do (if not next to impossible).&lt;/p&gt;&#xA;&lt;p&gt;I would say the standard reference is the following:&lt;br&gt;&#xA;&lt;a href=&quot;https://books.google.com/books?id=WqFf6imwTsUC&amp;amp;printsec=frontcover&quot; rel=&quot;nofollow noreferrer&quot;&gt;Expected Returns: An Investor's Guide to Harvesting Market Rewards by Antti Ilmanen&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;An abridged (but still about 170 pages long), yet more current - and free (!) version in different formats (pdf, mobi for the Kindle and epub) can be found here:&lt;br&gt;&lt;a href=&quot;http://www.cfapubs.org/toc/rf/2012/2012/1&quot; rel=&quot;nofollow noreferrer&quot;&gt;Expected Returns on Major Asset Classes by Antti Ilmanen&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Addendum: A 8-page long summary of the main points can be found here:&lt;br&gt;&#xA;&lt;a href=&quot;http://www.cfapubs.org/doi/pdf/10.2469/cp.v29.n2.3&quot; rel=&quot;nofollow noreferrer&quot;&gt;Understanding Expected Returns by Antti Ilmanen&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="31822" LastEditDate="2020-08-19T09:15:59.110" LastActivityDate="2020-08-19T09:15:59.110" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="8276" PostTypeId="2" ParentId="8257" CreationDate="2013-06-20T12:34:35.613" Score="0" Body="&lt;p&gt;I think the thing that best fit your idea is k-nearest neighbors algorithm.&lt;/p&gt;&#xA;" OwnerUserId="4812" LastActivityDate="2013-06-20T12:34:35.613" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8277" PostTypeId="2" ParentId="8274" CreationDate="2013-06-20T12:50:40.680" Score="6" Body="&lt;p&gt;First of all, I must say that it's a very general question, and the answer can vary depending on type of assets you model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In quant finance real world probabilities are generally used for risk management. It can be said, that in order to use real-world probabilities you have to calibrate your models to history. In order to obtain risk-neutral probabilities, you fit to market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simplest example - brownian motion for asset price. It is $\frac{dS}{S} = \mu dt + \sigma dW_t$ in real world and $\frac{dS}{S} = r dt + \sigma dW_t$ in risk-neutral world. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where would you take $\mu$ from? The easiest way is to take history and estimate historical asset drift, or just calculate $\frac{1}{N}\sum_{i=1}^N\frac{S_{i+1}-S_i}{S_i}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where would you take $r$ from? You just take current risk-free rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the same time I must stress that quant finance models are IMHO unsuitable for long-term forecasting. In this case you have to seek for appropriate econometric model.&lt;/p&gt;&#xA;" OwnerUserId="2870" LastEditorUserId="2870" LastEditDate="2013-06-20T13:55:12.877" LastActivityDate="2013-06-20T13:55:12.877" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8279" PostTypeId="2" ParentId="8273" CreationDate="2013-06-20T14:47:47.617" Score="2" Body="&lt;p&gt;A way to go would be to linearly build indepedant interest rates to eliminate correlation effects. How do you do that ? You linearly build orthogonal interest rates from your starting ones. This is totaly equivalent to diagonalising correlation matrix, which is the principle of PCA. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using information criteria you can then choose to remove lowest components, but using only the first one without checking others would be a mistake. &lt;a href=&quot;https://stats.stackexchange.com/questions/24034/how-to-know-when-to-stop-reducing-dimensions-with-pca&quot;&gt;Reducing dimension with PCA&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Concerning binomial trees, from what I remember binomial trees and multivariate datasets does not go well. For m dimensions, each step will multiply branches by $2^{m}$, and you should have N step where N is big. Even if there is recombination you will end up with $N^{m}$ values (plus all intermediate values). Operations needed grow more than exponentialy with the dimension, you will rapidly meet a power computing barrier. I remember a teacher saying that binomial tree are not suited for m&gt;2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(And that is just for building the tree, I assume you want to work with it after building it... it can add a lot more complexity).&lt;/p&gt;&#xA;" OwnerUserId="5052" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2013-06-20T14:54:06.130" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="8280" PostTypeId="1" AcceptedAnswerId="8297" CreationDate="2013-06-20T15:55:23.697" Score="9" ViewCount="7479" Body="&lt;p&gt;I am wondering about the huge differences of the data provider google finance and yahoo finance. I am interested in the monthly data from adidas listed on xetra. In google: ETR:ADS and in yahoo finance: ADS.DE - Xetra.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a huge difference in the data, e.g. consider the 02.06.2008:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;google finance:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Date             Open    High   Low     Close   Volume &#xA;Jun 2, 2008     45.49   45.60   44.93   45.05   1,037,644 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;yahoo finance (german):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Datum   Eröffnungskurs  Max.    Tief    Schluss Ø Volumen   Adj. Schluss* &#xA;2. Jun 2008 45,49   46,48   39,39   40,11   1.603.100   38,34&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see the open (&quot;Eröffnungskurs&quot;) is the same. But all other values are different. So currency seems not to be the problem. But why are these values so different?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, why is there a yahoo finance gap in August 2008? I don't get the value of the 01.08.2008 but the 18. Aug 2008 instead? Since I am using the yahoo finance data I have to fill in this gap, what value / what method would be appropriate?&lt;/p&gt;&#xA;" OwnerUserId="5416" LastActivityDate="2015-03-09T17:30:10.323" Title="Difference between google finance and yahoo finance?" Tags="&lt;data&gt;&lt;market-data&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="8283" PostTypeId="1" CreationDate="2013-06-20T16:51:10.990" Score="-4" ViewCount="79" Body="&lt;p&gt;Does a bond's Yield to Maturity represent the amount of interest one gets at maturity even though it's expressed as a percentage? I read that it is a rate of return on a bond at maturity, but what is the &quot;return&quot;?&lt;/p&gt;&#xA;" OwnerUserId="5571" LastActivityDate="2013-06-20T17:11:47.857" Title="Does YTM represent interest?" Tags="&lt;bond&gt;&lt;yield&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2013-06-20T21:49:40.920" ContentLicense="CC BY-SA 3.0" />
  <row Id="8284" PostTypeId="2" ParentId="8274" CreationDate="2013-06-20T16:54:13.020" Score="9" Body="&lt;p&gt;You may want to consider splitting two important, yet very different concepts:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pricing a derivative security with contingent payoff and forecasting an asset.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Pricing a derivative can be achieved through setting up a hedge portfolio and track its evolution and &quot;value&quot; at any point in time before the derivative security pays off. Risk-neutral pricing is a handy tool to accomplish that. In most all cases do you need to possess knowledge of the underlying price dynamics which most likely depend on one or more random components, such as Brownian Motion. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Estimating the probability of a non-contingent asset (such as a stock) reaching certain thresholds can be done entirely without the construct of any risk neutral probability measure. All you need is a pricing model and a parameter set (which you could estimate or derive from a fit to historical data) and run a simple Monte Carlo simulation. No need for risk neutral probabilities at all. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;My point is that the concept of risk neutral pricing is not necessary if you want to estimate the probability of an asset with non contingent payoff to reach certain price levels. Your question was which models could be used to estimate the probability of reaching such thresholds: You can setup a pricing model, whose parameters you fit to past data, and throw it into a MC pricer. Check how many of the paths reach your thresholds and derive your probability. That is an example where you use real-world parameters to estimate a real-world probability.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT (in response to edited question)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Calibration -&gt; Calibrate real-world probabilities to historical data and models, incorporating risk-neutral probabilities, to current market prices. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;No-arbitrage conditions: No they cannot be relaxed, and why would you want to do that? You look for a self-consistent model and if you calibrate to current market prices but throw overboard no-arbitrage conditions then you end up with incorrect probabilities because your model is distorted. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Historical fit: You can calibrate any model that incorporates real-world probabilities to historical data. Whether history repeats itself and whether your assumed risk premiums lead to the correct probabilities is an entirely different question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Expected Returns: You do not have the choice when using real-probabilities; you cannot use the risk-free rate because in your world of real probabilities investors are risk averse and apply different utility curves, hence, you need to estimate risk premiums and expected returns instead of simply using a risk-free rate. As this is a pretty damning exercise it is the precise reason why risk-neutral probabilistic models are so attractive. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short? A non risk-neutral probability model. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-06-28T04:42:02.497" LastActivityDate="2013-06-28T04:42:02.497" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8285" PostTypeId="1" CreationDate="2013-06-20T17:05:58.790" Score="2" ViewCount="487" Body="&lt;p&gt;I have three different option pricing models, for which I computed the in-sample and out-of-sample pricing errors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I want to test the pricing performance of these three option pricing models against the Black-Scholes obtained prices. What is the most convenient way to do so?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When comparing the empirical predictive performance of various models, one usually uses the Diebold-Mariano test statistic. Would this be a valid approach for comparing the performance of the option models? I am concerned about the fact that the Diebold-Marino (DM)  test-statistic is not following a standard normal distribution when using the pricing errors of the option models as input. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One paper (Andreou, Charalambous and Martzoukos, 2005) uses the matched-pair t-tests concerning the squared differences to compare the performance statistically. Here I am again concerned about the distribution of the t-statistic, as the inferences made are only valid in case of a standard normal distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or is bootstrapping the DM-statistic a solution? Let me know your thoughts...&lt;/p&gt;&#xA;" OwnerUserId="2291" LastActivityDate="2013-06-20T17:05:58.790" Title="How to statistically compare the pricing errors of various option pricing models?" Tags="&lt;option-pricing&gt;&lt;testing&gt;&lt;statistical-significance&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8286" PostTypeId="2" ParentId="8283" CreationDate="2013-06-20T17:11:47.857" Score="1" Body="&lt;p&gt;Simply speaking, return means relative amount of &lt;em&gt;extra&lt;/em&gt; money earned after investing of some amount of money: Return = $\frac{Received}{Invested}-1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you invested \$100 and received \$100, this means you have zero return (\$100/\$100-1).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you invested \$100 and received \$110, your return in 10% (\$110/\$100-1 = 1.1-1 = 0.1 = 10%).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next step is account for term in which you received this return, and here comes a concept of yearly return. Formula is $1+r_y f = 1+r$ or $r_t = r/f$, where $r_y$ is year return, $f$ is fraction of a year, and $r$ is your previously calculated absolute return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you earned 10% in one year, it is your yearly return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you earned 10% in half year, then your yearly return is 10%/0.5 = 20%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next step is account for &lt;a href=&quot;http://en.wikipedia.org/wiki/Day_count_convention&quot; rel=&quot;nofollow&quot;&gt;Day count convention&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/Compound_interest&quot; rel=&quot;nofollow&quot;&gt;Compounding&lt;/a&gt; but it would be a long story.&lt;/p&gt;&#xA;" OwnerUserId="2870" LastActivityDate="2013-06-20T17:11:47.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8288" PostTypeId="2" ParentId="8280" CreationDate="2013-06-20T19:36:05.400" Score="11" Body="&lt;p&gt;There are so many different data providers, and they all end up using slightly different definitions.  For Google, it looks like they use Deutsche Börse (&lt;a href=&quot;http://www.google.com/intl/en/googlefinance/disclaimer/?ei=BlTDUbC3EoG4rQG5nQE&quot;&gt;Google&lt;/a&gt;) as a data source.  I can't tell what Yahoo Deutschland is using.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think your real question, though, is why the different data providers have different answers to the same questions. The answers aren't as clear-cut as you'd think, and the specific rules the data providers use make all the difference.  I bet that Yahoo is using an intraday datasource.  Open-high-low-close-volume data comes from the trade tick data - open is first tick, close is last tick, etc.  That trade data could be coming from any number of exchanges, not just the exchange of record.  Google is clearly using an end-of-day data provider, in this case the official exchange record.  It's often hard to tell what rules the exchanges use for their &quot;official&quot; data.  The end result is that the intraday and end of day rarely exactly match because they are derived from different streams of data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can drive yourself crazy with stuff like this.  You have to decide what matters for your purposes, and then settle on a datasource that can provide that, and then ignore the noise that surrounds it. &lt;/p&gt;&#xA;" OwnerUserId="2605" LastActivityDate="2013-06-20T19:36:05.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8289" PostTypeId="1" CreationDate="2013-06-21T00:22:26.430" Score="2" ViewCount="303" Body="&lt;p&gt;When I calibrate a short rate model to market swaption vols, what curve am I getting when I plug in the calibrated parameters into the analytical formulae (assuming they exist for the model I'm looking at)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since swaption vols apply to a swap that is projected and discounted off different curves, I can't get my head around whether the resulting short rate model simulates the discount curve, projection curve or somehow the &quot;total&quot; swap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm basically trying to figure out how to price a swap using simulated curves produced using a short rate model in this new dual curve world.  I need projections and discount factors, and I don't know if they should come from one calibrated short rate model, or if I should be somehow have two short rate models (one for the projection curve and one for discount, both maybe calibrated using market swaption vols but different term structures)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="5563" LastActivityDate="2013-06-21T00:22:26.430" Title="Dual curves and short rate calibration" Tags="&lt;calibration&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8290" PostTypeId="2" ParentId="3438" CreationDate="2013-06-21T01:34:17.990" Score="7" Body="&lt;p&gt;Liquidity, liquidity, liquidity!&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;we want the yield curve to be the curve that gives us the rate at which a well-rated bank can lend** money for any tenor&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So, that starting premise may be causing confusion.  What you describe is not what the swap curve was ever meant to show.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The widespread use of the swap (par) curve has to do with the liquidity of interest rate swaps, and the liquidity has to do simply with the fact that the most active participants are going from fixed-rate bonds (assets or liabilities) to synthetic floating rate, or the other way around.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, for instance, in the US, fixed-rate corporate bonds typically pay coupons on a semiannual 30/360 basis, and floating-rate loans are typically linked to (quarterly ACT/360) LIBOR.  So a very liquid market evolved with those two legs; there is far less use for an exchange for rolling short-term rates against a bullet long-term rate.  (As to why those are the conventions in the US and why they vary by country is a different question.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Liquidity -&gt; frequent transactions -&gt; reliable market levels, even if not in a particularly intuitive &quot;format&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;** Minor thing, but perhaps you meant borrow and not lend?  Where the bank lends has to do with whom it is lending to.  Where the bank borrows has to do with its own credit risk.  Arguably, the CDS market does what you want the yield curve to do; it is a spread and the CDS coupon is paid periodically, yes, but that spread represents the &quot;bullet&quot; cost of the bank borrowing for that tenor.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is actually impossible to derive bullet bank borrowing costs from the swap curve, not even when you bootstrap long-term zero rates.  (Because a par swap rate is an &quot;average&quot; of rolling short-term borrowing costs - there is a significant credit premium involved in increasing that short tenor - and those costs come from a panel (BBA) in which weak banks are constantly being replaced by stronger banks.)&lt;/p&gt;&#xA;" OwnerUserId="5563" LastActivityDate="2013-06-21T01:34:17.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8291" PostTypeId="1" AcceptedAnswerId="8292" CreationDate="2013-06-21T06:27:53.457" Score="2" ViewCount="125" Body="&lt;p&gt;Recently Monetary Authority of Singapore (MAS) raps banks in rate-rigging. This is nothing new, LIBOR was also manupulated before, by some &quot;major&quot; banks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;however, before the censorship, did any &quot;minor&quot; bank declare that the interest rate from LIBOR is distorted?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;seems modellers always assume the market is right, so models, or parameters used in the model are always first calibrated according to the market, then used to price products.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so even there is a problem, people will try to find some work-around. for example if the term structure leds to a negative future rate, the curve is still accepted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is there some mechanism to detect such abnormality and flag &quot;market is wrong&quot; ?&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2013-06-21T09:30:00.217" Title="if market is always assumed right, what happened when LIBOR was manupulated?" Tags="&lt;interest-rates&gt;&lt;modeling&gt;&lt;rate-distortion&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8292" PostTypeId="2" ParentId="8291" CreationDate="2013-06-21T07:08:02.783" Score="1" Body="&lt;p&gt;Nobody assumes the market is right. The issue with Libor was that nobody could do much about it. Well, not 100% correct, you had the following 3 choices:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Participate in the scheme and benefit (monetarily)&lt;/li&gt;&#xA;&lt;li&gt;Be on the receiving end and despite you knowing the rate is not what it should be you have no choice, you gotta borrow/lend your funds at the end of the day no matter what.&lt;/li&gt;&#xA;&lt;li&gt;You complain to regulators, the same regulators whose salaries are paid to a large degree by the very same bank conglomerates that set Libor every day.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The choice was/is yours...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, even if you know that market prices are distorted what are you gonna do about it. Assume for a second that you know that the skew of most index options should be much more pronounced. You basically believe the market has it wrong and does not price risk appropriately. If you want to trade on your believes you can of course do so, however, whether anyone else trades with you is another question, entirely. And if the market does not converge to your own estimate of where you see it is fairly valued at then you will not even benefit from your &quot;correct model&quot;. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-06-21T09:30:00.217" LastActivityDate="2013-06-21T09:30:00.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8293" PostTypeId="2" ParentId="3438" CreationDate="2013-06-21T08:30:19.373" Score="2" Body="&lt;p&gt;I agree with joelhoro's answer that swap rates are not used &lt;strong&gt;directly&lt;/strong&gt; as funding rates, although I noticed that quite a few answers here do assume (erroneously) that the swap rate is taken verbatim to construct the yield curve.  Instead, one performs bootstrapping.  For example, the value of receiving fixed while paying floating in a swap = $V_\text{fixed} - V_\text{float} =&#xA;  R_\text{swap}  \sum_{i=1}^{2T} \text{day}(t_{i-1}, t_i) d(0, t_i) - \sum_{i=1}^{4T} \left[ d(0,t_{i-1}) - d(0,t_i) \right] $, where $\text{day}(t_1, t_2)$ is the day-count fraction, $T$ is the maturity, and $d(t_1, t_2)$ is the discount factor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We solve for the swap rate by setting the value to zero: $R_{\text{swap}} = \frac{1 - d(0,T)}{\sum_{i=1}^{2T} \text{day}(t_{i-1}, t_i) d(0, t_i)}$.  Hence, given a set of market (breakeven) swap rates for various maturity dates, one can work out the various discount factors $d(0, t_i)$, where $i = 1, \ldots, 2T$.&lt;/p&gt;&#xA;" OwnerUserId="3188" LastEditorUserId="3188" LastEditDate="2013-06-22T02:21:33.607" LastActivityDate="2013-06-22T02:21:33.607" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8294" PostTypeId="1" AcceptedAnswerId="8296" CreationDate="2013-06-21T08:30:54.583" Score="4" ViewCount="216" Body="&lt;p&gt;The marginal risk contribution of asset $i$ is defined by Roncalli in his &lt;a href=&quot;https://www.google.ch/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;ved=0CC4QFjAA&amp;amp;url=http%3A%2F%2Fwww.thierry-roncalli.com%2Fdownload%2Ferc.pdf&amp;amp;ei=XQnEUaGiBJSyhAfLroDoBA&amp;amp;usg=AFQjCNGMWOpwt8fF2ZDwcACORg7p5JZMwA&amp;amp;sig2=aOT5FitmuAB0Pe3ayggfAQ&amp;amp;bvm=bv.48293060,d.ZG4&quot; rel=&quot;noreferrer&quot;&gt;paper&lt;/a&gt; on ERC as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\partial \sigma(x)}{\partial x_i} = \frac{1}{\sigma(x)} \left( w_i \sigma_i^2 + \sum_{\substack{j=1 \\ i \neq j}}^n w_j \sigma_{i,j} \right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was thinking about computing the value for a fully invested portfolio with $n=2$ assets, i.e. $x=\{w,1-w\}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With $n=2$, we know that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma(x)=\sqrt{w^2 \sigma_1^2 + (1-w)^2 \sigma_2^2 + 2 w (1-w) \sigma_{1,2}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, we can compute the marginal contribution of asset 1 (with $x_1=w$) as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{d \sigma(x)}{dw} = \frac{1}{2} \frac{1}{\sigma(x)} \left[ 2w \sigma_1^2 + 2(1-w)(-1) \sigma_2^2 + 2 \sigma_{1,2} (1-2w) \right] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{d \sigma(x)}{dw} = \frac{1}{\sigma(x)} \left[ w \sigma_1^2 - (1-w) \sigma_2^2 + \sigma_{1,2} (1-2w) \right] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I use Roncalli's definition, I get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{d \sigma(x)}{dw} = \frac{1}{\sigma(x)} \left[ w \sigma_1^2 + (1-w) \sigma_{1,2} \right] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The two results are not the same, and I'm trying to understand why. So far, I came up with the fact that Roncalli's definition is not taking into account the fact that the portfolio is fully invested. Is that correct?&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2013-06-21T10:03:05.440" LastActivityDate="2013-06-21T10:03:05.440" Title="What is the analytic value of an asset's risk contribution, if $n=2$?" Tags="&lt;risk-management&gt;&lt;mathematics&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8296" PostTypeId="2" ParentId="8294" CreationDate="2013-06-21T09:26:56.820" Score="4" Body="&lt;p&gt;You see, you added something new to the source formula, i.e. a dependence between weights of different assets: $w_2 = 1 - w_1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's try to forget that they are related to each other and vary them independently:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma(x)=\sqrt{w_1^2 \sigma_1^2 + w_2^2 \sigma_2^2 + 2 w_1 w_2 \sigma_{1,2}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now $\frac{dw_2}{dw_1} = 0$ and equation becomes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{d \sigma(x)}{dw_1} = \frac{1}{2} \frac{1}{\sigma(x)} \left[ 2w_1 \sigma_1^2 + 2 w_2  \sigma_{1,2} \right] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{d \sigma(x)}{dw_1} =  \frac{1}{\sigma(x)} \left[ w_1 \sigma_1^2 + w_2  \sigma_{1,2} \right] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, let's tak $w_2 = 1 - w_1$ and you receive Roncalli's formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{d \sigma(x)}{dw} = \frac{1}{\sigma(x)} \left[ w_1 \sigma_1^2 + (1-w_1) \sigma_{1,2} \right]$$&#xA;I think it's a tricky question, but I believe his way is right, because when you decompose $\sigma$ into factors, it is &lt;em&gt;more correct&lt;/em&gt; to keep weights constant.&lt;/p&gt;&#xA;" OwnerUserId="2870" LastActivityDate="2013-06-21T09:26:56.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8297" PostTypeId="2" ParentId="8280" CreationDate="2013-06-21T16:17:46.423" Score="8" Body="&lt;p&gt;The difference is usually explained by &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the way the end-providers (Google, Yahoo) aggregate the data they get&#xA;from their vendors&lt;/li&gt;&#xA;&lt;li&gt;getting prices from same exchange, but from&#xA;different trading platforms&lt;/li&gt;&#xA;&lt;li&gt;different adjustments and corrections&#xA;during post trading period&lt;/li&gt;&#xA;&lt;li&gt;missing corporate actions or dividends and&#xA;many more.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you have a discrepancy in a price usually it's a good practice to check Investor Relations section on company's website. For example, for &lt;a href=&quot;http://www.adidas-group.com/en/investorrelations/share/share_price/default.aspx&quot; rel=&quot;nofollow&quot;&gt;Adidas&lt;/a&gt; you'd see that the correct value for 6/2/2008 is 45.05.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The ultimate source, of course, would be checking the exchange for that price. If exchange allows to get the price that far back one should use that value. &lt;a href=&quot;http://www.boerse-frankfurt.de/en/equities/adidas+ag+DE000A1EWWW0/price+turnover+history/historical+data&quot; rel=&quot;nofollow&quot;&gt;Frankfurt Stock Exchange&lt;/a&gt; in this case allows you to get this period. Note that there are two tabs: Xetra and Frankfurt, they simply represent two different trading platforms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yahoo, btw, is getting stock data from Hemscott (which was acquired by Mornignstar.) Hemscott is not the most accurate source of EOD stocks. Google is getting the data from SIX Financial (former Telekurs).&lt;/p&gt;&#xA;" OwnerUserId="2909" LastEditorUserId="2909" LastEditDate="2015-03-09T17:30:10.323" LastActivityDate="2015-03-09T17:30:10.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8300" PostTypeId="1" AcceptedAnswerId="8317" CreationDate="2013-06-21T20:55:37.440" Score="2" ViewCount="178" Body="&lt;p&gt;I am attempting to recreate the S&amp;amp;P Dynamic Asset Exchange using the methodology outlined in &lt;a href=&quot;http://www.spindices.com/documents/methodologies/methodology-sp-dynamic-asset-exchange.pdf&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am struggling to 'normalize' the prices of the assets properly.  On page 6 of the aforementioned paper, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Price A(t) = Price of asset A normalized to equal 100 on the last trading day of the preceding year&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Price B(t) = Price of asset B normalized to equal 100 on the last trading day of the preceding year&lt;/p&gt;&#xA;&#xA;&lt;p&gt;--&#xA;What methodology is implied for 'normalize' -- the standard Random Variable normalization? (Random Variable - Mean)/(Standard Deviation)?  Or is there an alternative method?&lt;/p&gt;&#xA;" OwnerUserId="5577" LastEditorUserId="35" LastEditDate="2013-06-23T14:58:01.563" LastActivityDate="2013-07-17T14:54:11.440" Title="Pricing Assets in the S&amp;P Dynamic Asset Exchange" Tags="&lt;asset-pricing&gt;&lt;dynamic&gt;&lt;asset&gt;&lt;exchange&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8304" PostTypeId="2" ParentId="7556" CreationDate="2013-06-22T15:16:52.700" Score="1" Body="&lt;p&gt;I would recommend using the Johansen-Procedure for determining the cointegration vector, the &lt;code&gt;ca.jo&lt;/code&gt;-function from &lt;code&gt;library(urca)&lt;/code&gt;. After determining the cointegration rank, a normalized cointegration vector is produced by estimating a restricted VECM with the command &lt;code&gt;cajorls()&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5579" LastEditorUserId="35" LastEditDate="2013-06-22T17:24:21.800" LastActivityDate="2013-06-22T17:24:21.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8308" PostTypeId="2" ParentId="8243" CreationDate="2013-06-23T06:55:01.323" Score="2" Body="&lt;p&gt;I am not aware about any rule of thumb on market impact during fixing auctions (nothing comparable with the usual &lt;em&gt;square root&lt;/em&gt; rule for meta orders market impact). In &lt;a href=&quot;https://www.cheuvreux.com/dl.aspx?filter=159088&quot; rel=&quot;nofollow&quot;&gt;Navigating Liquidity 6 - A global menu for optimal trading&lt;/a&gt;, there is a study about the liquidity during the fixing auctions, you should start from here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another important point is the data you have access to to fit your model.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2013-06-23T06:55:01.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8309" PostTypeId="2" ParentId="3368" CreationDate="2013-06-23T07:38:00.300" Score="1" Body="&lt;p&gt;The vast majority of credit is produced by banks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Banks &quot;borrow short, lend long&quot;, meaning: they borrow in the short term, mostly in the form of deposits that have a theoretical term of 0 or near 0 which pay the same, and they lend in the long term, mostly in the form of government debt, mortgages, and corporate bonds &amp;amp; loans for many years.  &lt;a href=&quot;http://www.federalreserve.gov/releases/h8/current/&quot; rel=&quot;nofollow&quot;&gt;The Fed produces this data for free.&lt;/a&gt;  Banks have been fond of getting themselves into trouble with commercial paper through special purpose entities every other expansion or so, but most funding comes from deposits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One might say &quot;but banks only hold a fraction of total credit&quot;, and one'd be right, but that's not what the modern bank does.  Before tight rule of law, agency law, and ease of financial trading, banks did hold most of what little credit existed in the world.  Now, they are merely the producers of credit, actually only receiving ~50% of net income from net interest; the other ~50% comes from fees &amp;amp; selling those produced loans to investors at a profit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After a banknote issuer (central bank, monetary authority, etc) has failed to maintain a level of inflation that it prefers to a large degree if it even cares at all, it usually overshoots in the other direction, selling assets/raising the price of whatever it prefers to control instead of controlling inflation directly, causing interest rates to rise with diminishing effect across the rest of the yield curve.  This &quot;other price&quot; in the US, usually called the Fed funds rate, is the rate (spread) that banks charge each other for borrowing (trading) required reserves (deposits) at the Fed.  Whatever price a banknote issuer prefers to control will always be controlled through one method: controlling the quantity of assets on its balance sheet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If a bank has now lost ~50% and more of its net income because the net interest margin is less than the cost to produce credit, it shouldn't be expected to continue to produce credit.  If credit is not being produced, investment cannot be funded.  If investment cannot be funded, operations cannot be funded. If operations cannot be funded, wages &amp;amp; salaries cannot be funded... &lt;/p&gt;&#xA;" OwnerDisplayName="user5462" LastEditorDisplayName="user5462" LastEditDate="2013-06-24T14:44:35.563" LastActivityDate="2013-06-24T14:44:35.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8313" PostTypeId="2" ParentId="8156" CreationDate="2013-06-23T15:00:31.600" Score="1" Body="&lt;p&gt;Usage of Bollinger Bands as a volatility indicator  is a strange practice.&#xA;Because it's calculation is based on asset volatility instead returns volatility.&#xA;So any great trend piece will be contain more wider Bollinger Bands channel, than simple flat fluffy piece, where deviation realy is there.&lt;/p&gt;&#xA;" OwnerUserId="5588" LastActivityDate="2013-06-23T15:00:31.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8314" PostTypeId="2" ParentId="8006" CreationDate="2013-06-23T16:59:32.487" Score="1" Body="&lt;p&gt;Maybe you have made some misspecification with regards to deterministic terms or lag length. Try to estimate a restricted VECM from your ca.jo()-output with cajorls(), extract $\beta$ and run the ADT-test on that process.&lt;/p&gt;&#xA;" OwnerUserId="5579" LastEditorUserId="5579" LastEditDate="2013-06-23T17:09:57.027" LastActivityDate="2013-06-23T17:09:57.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8317" PostTypeId="2" ParentId="8300" CreationDate="2013-06-23T22:42:05.883" Score="1" Body="&lt;p&gt;I think in this case no fancy normalization techniques are implied. At least from what I understand from the cited part, they just scale the variables so that they are equal to 100 in the base period (end of preceding year) - something like computing a &lt;a href=&quot;http://en.wikipedia.org/wiki/Deflator&quot; rel=&quot;nofollow&quot;&gt;deflator&lt;/a&gt;, commonplace in macro analysis.&lt;/p&gt;&#xA;" OwnerUserId="38" LastActivityDate="2013-06-23T22:42:05.883" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8318" PostTypeId="2" ParentId="8242" CreationDate="2013-06-24T09:46:55.253" Score="7" Body="&lt;p&gt;Multi-fractal models can be applied to the modeling and forecasting of volatility. I read the following book with much interest and actually setup couple models in order to compare performance vs Garch family models and the application of multi-fractals much better captures discontinuous regime-changes than traditional volatility models. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0121500136&quot;&gt;Multifractal-Volatility Forecasting&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I would say that multi-fractal models definitely find applicability at quant and front office desks, however, I believe it can also equally applied in risk management, such as the estimation of Value-at-Risk. Think of assets whose volatility double from one day to the next. Traditional methods would hugely trail such regime-changes while multi-fractal models look to be much more adaptive to regime switching.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Caveat: I still try to work through the last chapters with more advanced math and not everything is yet entirely clear to me. I do this more on the side so, I am not sure whether I will be able to add more value very soon. But I may be able to post some code I used to setup a few models. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-06-24T09:54:14.817" LastActivityDate="2013-06-24T09:54:14.817" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8320" PostTypeId="2" ParentId="8247" CreationDate="2013-06-24T12:40:32.167" Score="10" Body="&lt;p&gt;Recently I came across an interesting intuitive explanation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose driftless market. Market price is 105, strike price is 100. Call option costs 8, put option 3. (intrinsic value of call is 5, time value of both is 3)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the market starts drifting upwards massively. You say, that you would probably price call higher, e.g. at 10. Would you also price put higher? Probably not, since it's less probable that it will end up in the money. You would probably price put even lower, e.g. at 2. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in that case, you clearly violate put/call parity, and it's possible for me to buy the call, and completely hedge it with the put, some cash and some stocks and earn riskless profit from you. Due to put/call parity, the price of put must rise together with price of call (they must have the same time value), which is inconsistent with dependence on drift.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I disregarded interest rates for clarity.&lt;/p&gt;&#xA;" OwnerUserId="3120" LastActivityDate="2013-06-24T12:40:32.167" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8321" PostTypeId="2" ParentId="8245" CreationDate="2013-06-24T13:15:11.783" Score="1" Body="&lt;p&gt;Different optimizations could help.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Parallel computing makes even worse if each computation is fast enough due to overhead. Thus it may be better to use profiler to get what can be improved. Usually it helps to send larger problems to parallel computation cores.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Matlab is very good at matrix operations and it could be better to treat different draws of MC as one matrix if possible. Returning to first point this multiple scenarios in one matrix can be sent for parallel computing and improve performance.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The main principles: use less memory allocation operations and less calls for parallel computation. Sometimes it is even faster to run several intances of nonparallel code than using parallel computation on different matlabpool cores.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="5409" LastActivityDate="2013-06-24T13:15:11.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8322" PostTypeId="1" CreationDate="2013-06-24T13:34:04.380" Score="4" ViewCount="694" Body="&lt;p&gt;For my thesis, I'm writing about robust portfolio allocation. I have the idea to include a measure of transaction cost, since ignoring them seems too simplifying for a real-world problem. Comparing a traditional and a robust portfolio, it has been found that the robust portfolio consists of fewer assets and needs less restructuring, so if we assume transaction cost, it is even better than a traditional portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is now, what is the magnitude that I can assume for both private and institutional investor's transaction cost? I'm not trading myself; I heard that a private person's stock trading takes around 1% transaction fee. I assume it is much lower for a large private or commercial investor, but still above 0. The asset classes should involve stocks, funds, indices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My idea on the measure of the transaction cost $c_i$ for the readjustment of the portfolio $x$ between periods $i$ and $i+1$ would look as follows:&#xA;\begin{alignat*}{5}&#xA;c_i \thicksim \sum_{j=1}^n |(x_{i+1})_j-(x_i)_j|&#xA;\end{alignat*}&lt;/p&gt;&#xA;" OwnerUserId="1817" LastEditorUserId="1817" LastEditDate="2013-06-25T18:35:06.907" LastActivityDate="2013-06-26T10:04:28.130" Title="Magnitude of Transaction Cost for Institutional Investors" Tags="&lt;transaction-costs&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8323" PostTypeId="2" ParentId="8228" CreationDate="2013-06-24T14:05:53.443" Score="0" Body="&lt;p&gt;Checkout QuantLib. It has an implied volatility calc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/lballabio/quantlib/blob/master/QuantLib/ql/instruments/impliedvolatility.cpp?source=cc&quot; rel=&quot;nofollow&quot;&gt;https://github.com/lballabio/quantlib/blob/master/QuantLib/ql/instruments/impliedvolatility.cpp?source=cc&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="892" LastActivityDate="2013-06-24T14:05:53.443" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8324" PostTypeId="2" ParentId="2205" CreationDate="2013-06-25T01:39:29.520" Score="3" Body="&lt;p&gt;do a regression where stock returns is dependent and market return is independent variable. Value of R^2 is Systematic risk and value of 1-R^2 is unsystematic risk...&lt;/p&gt;&#xA;" OwnerUserId="5597" LastActivityDate="2013-06-25T01:39:29.520" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8325" PostTypeId="1" CreationDate="2013-06-25T07:34:15.120" Score="7" ViewCount="830" Body="&lt;p&gt;What is the fastest way to numerically compute Black-Scholes-Merton option prices?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to find fastest and still precise method.&#xA;Currently I'm using numerical approximation of Normal cdf with 10-9 precision and standard formulae.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there another way to compute them numerically using any programming language without built-in libraries for option pricing and cdf computation? If any what is the speed of the algorithm in comparison with standard method and what is precision of an answer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a question about &lt;a href=&quot;https://quant.stackexchange.com/q/1150/5409&quot;&gt;approximations to the Black-Scholes formula&lt;/a&gt;, but there are aproximations for ATM options. And it is not obvious that this methods would show better results.&lt;/p&gt;&#xA;" OwnerUserId="5409" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2014-08-29T13:43:49.790" Title="Black-Scholes fastest computation method" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;numerical-methods&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8326" PostTypeId="1" AcceptedAnswerId="8331" CreationDate="2013-06-25T09:08:56.477" Score="7" ViewCount="2680" Body="&lt;p&gt;Let's assume we have a portfolio containing large number (~500) of risk factors. We want to simulate the portfolio dynamics. PCA based simulation would be faster as we can reduce the dimensionality. Are there any other advantages of PCA-based approach Monte Carlo over Monte Carlo using Cholesky Decomposition (e.g. stability, more realistic dynamics)? I've seen papers dealing with &lt;a href=&quot;http://www.fea.com/resources/a_multi_factor_intro.pdf&quot;&gt;seasonality effect in commodity forward curves&lt;/a&gt;, application to yield curves and an article &lt;a href=&quot;http://www.risklatte.com/Articles/QuantitativeFinance/QF146.php&quot;&gt;here&lt;/a&gt;. However, I'm looking for some more in depth on the topic. Any references or practical experience is welcome.&lt;/p&gt;&#xA;" OwnerUserId="370" LastActivityDate="2013-06-30T17:11:22.547" Title="Principle Component Analysis vs. Cholesky Decomposition for MonteCarlo" Tags="&lt;correlation&gt;&lt;monte-carlo&gt;&lt;pca&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8328" PostTypeId="1" CreationDate="2013-06-25T09:31:40.623" Score="4" ViewCount="255" Body="&lt;p&gt;In a more conservative estimate than a simple historical average, Fama &amp;amp; French estimate (US) equity risk premium at 3-4% (e.g., &lt;em&gt;&lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/1540-6261.00437/abstract&quot; rel=&quot;nofollow&quot;&gt;Equity Risk Premium&lt;/em&gt;, JF, 2002&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This suggests that in an APT-like asset pricing test, the estimate of the risk premium on the market factor should be within an estimation error of that range (since the market portfolio has loading of 1 on the market factor and zero on all others). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In their &lt;a href=&quot;http://www.bengrahaminvesting.ca/Research/Papers/French/The_Cross-Section_of_Expected_Stock_Returns.pdf&quot; rel=&quot;nofollow&quot;&gt;&quot;Cross-Section of Expected Returns&quot; (JF 1992)&lt;/a&gt; paper, Fama &amp;amp; French argue that the assets should be priced using a 3-factor APT model (with Market, HML, SMB) rather than CAPM. Their main argument is that in a single-factor cross-sectional regression, the market risk premium estimate is too close to zero (though, given the large estimation error, it's actually within a confidence interval from the 3% per annum).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when they add SMB beta to the the cross-sectional regression, the market risk premium estimate becomes quite negative (this time it is too low even allowing for the estimation error). FF argue that this reinforces their point that CAPM is not a good model; while this may be true, isn't this an equally powerful argument against FF3 as an asset pricing model?&lt;/p&gt;&#xA;" OwnerUserId="5599" LastEditorUserId="848" LastEditDate="2014-12-25T16:10:29.823" LastActivityDate="2014-12-25T16:10:29.823" Title="ERP and FF 3-factor model" Tags="&lt;equities&gt;&lt;risk-premium&gt;&lt;asset-pricing&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8329" PostTypeId="2" ParentId="2205" CreationDate="2013-06-25T12:04:18.860" Score="4" Body="&lt;p&gt;If Y is the excess returns of your asset and X is that of the market, then CAPM tells you &#xA;$Y = \beta X + \epsilon$&#xA;Taking the variance of both sides yields &#xA;$$&#xA;\\ \sigma^2_{Y} = \beta^2 \sigma^2_{X} + \sigma^2_{\epsilon} \\&#xA;$$&#xA;We know that &#xA;$$\beta = \frac{\sigma_{X,Y}}{\sigma^2_{X}} = \rho_{X,Y}\frac{\sigma_{Y}}{\sigma_{X}}$$&#xA;Where $\sigma_{X,Y}$ is the covariance and $\rho_{X,Y}$ the correlation.  Hence, substituting for $\beta$ and solving for $\sigma^2_{\epsilon}$ we get:&#xA;$$\sigma^2_{\epsilon}= \sigma^2_{Y}(1-\rho^2_{X,Y})  $$&lt;/p&gt;&#xA;" OwnerUserId="826" LastEditorUserId="826" LastEditDate="2013-06-25T12:23:37.740" LastActivityDate="2013-06-25T12:23:37.740" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8330" PostTypeId="2" ParentId="1615" CreationDate="2013-06-25T12:18:11.017" Score="2" Body="&lt;p&gt;An excellent example is the Federal Reserve Bank of Chicago’s National Financial Conditions Index (NFCI): &lt;a href=&quot;http://research.stlouisfed.org/fred2/series/NFCI&quot; rel=&quot;nofollow&quot;&gt;http://research.stlouisfed.org/fred2/series/NFCI&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cxoadvisory.com/&quot; rel=&quot;nofollow&quot;&gt;CXO Advisory Group&lt;/a&gt; just published a report which came to the following conclusion:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;[...] evidence from simple tests suggests that the Federal Reserve Bank of&#xA;  Chicago’s NFCI may be a useful indicator of future U.S. stock market&#xA;  returns, principally by helping to avoid parts of crashes.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Full report here (subscribers only):&lt;br&gt;&#xA;&lt;a href=&quot;http://www.cxoadvisory.com/23420/economic-indicators/chicago-fed-nfsi-as-u-s-stock-market-predictor&quot; rel=&quot;nofollow&quot;&gt;http://www.cxoadvisory.com/23420/economic-indicators/chicago-fed-nfsi-as-u-s-stock-market-predictor&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More info on the indicator itself can be found here (papers, videos etc.): &lt;a href=&quot;http://www.chicagofed.org/webpages/publications/nfci/index.cfm&quot; rel=&quot;nofollow&quot;&gt;http://www.chicagofed.org/webpages/publications/nfci/index.cfm&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2013-06-25T12:18:11.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8331" PostTypeId="2" ParentId="8326" CreationDate="2013-06-25T14:30:57.183" Score="8" Body="&lt;p&gt;Apart from numerical stability errors, Cholesky and PCA (without dim reduction) shall produce exactly the same distribution, they are two symmetric decomposition of the same covariance matrix and thus are equivalent for transforming a standard normal vector.&#xA;Of course when doing different things with PCA components, such as in dim reduction or quasi Monte Carlo sampling or related variance reduction methods, the equivalence is lost by definition, but it is there for standard sampling.&#xA;One advantage of Cholesky might be that storing and multiplying a triangular matrix requires less resources than a full square one. Pivoting is used for Cholesky if the covariance matrix is not PD (see &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.139.8064&quot;&gt;this paper by Higham&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One source of confusion in the links might be the lack of clear separation between estimation and sampling. After estimation you shall have a PSD matrix and the decomposition used for sampling has nothing to do with it. (Methods for estimation can also be better than a naive sample covariance, there is a huge literature on this.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note that in the second link posted the procedure to &quot;clean&quot; non PSD matrices to get a correlation matrix forgets one step after zeroing negative eigenvalues: you must also scale rows&amp;amp;columns so as to recover ones on the diagonal. And there are also better methods to do that cleaning, this is not returning the nearest PSD correlation matrix.&#xA;Also that page is poorly written and confusing imho, if not ripe with errors, look for something else, e.g. Glasserman's Monte Carlo book.&lt;/em&gt; &lt;/p&gt;&#xA;" OwnerUserId="3015" LastEditorUserId="3015" LastEditDate="2013-06-25T15:07:58.767" LastActivityDate="2013-06-25T15:07:58.767" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8332" PostTypeId="2" ParentId="8326" CreationDate="2013-06-25T14:32:43.297" Score="2" Body="&lt;p&gt;When estimating covariance matrices, you run into problems as the number of assets/risk factors approaches or exceeds the number of observations. Some eigenvalues will go to zero, or be very small. This will mean that the covariance matrix is positive semi-definite instead of positive definite. Since the Cholesky decomposition requires a positive definite matrix, this leads to problems. However, you can adjust the eigenvalues in a PCA approach to change the covariance matrix to become positive definite. You could simulate from the PCA (for lack of a better way to phrase it) or use Cholesky on the adjusted covariance matrix. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2013-06-25T14:32:43.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8335" PostTypeId="2" ParentId="8322" CreationDate="2013-06-26T08:12:03.087" Score="3" Body="&lt;p&gt;For a thesis, it makes sense just to assume a range of fixed costs (e.g. 0.5%, 1%, 2%) and look how this affects your optimal portfolio and overall profitability.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fees for large institutional investors usually don't represent much of the trading costs. Most of the costs come from liquidity (bid-ask spread you have to pay) and market impact (how much your own trading affects the prices). Transaction costs modelling is a large topics. However, if it's not a central topic of your thesis, you might want to make a quick estimate using bid-ask spread as a main cost driver. If you want to account for a market impact, you can try to take the results of &lt;a href=&quot;http://www.courant.nyu.edu/~almgren/papers/costestim.pdf&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt;. It's already calibrated for equity markets so you just need to plug your own values. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a retail trader, you can just take fee structure of any popular brokerage firm as a benchmark, like Interactive Brokers.&lt;/p&gt;&#xA;" OwnerUserId="370" LastEditorUserId="370" LastEditDate="2013-06-26T10:04:28.130" LastActivityDate="2013-06-26T10:04:28.130" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8336" PostTypeId="2" ParentId="8325" CreationDate="2013-06-26T08:19:46.170" Score="8" Body="&lt;p&gt;Fastest method is a pre-generated lookup table with carefully selected in-memory structure so you don't get too many CPU cache misses (avoiding the memory latency). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want an absolute speed, you also can go for a hardware specific implementation (GPU, FPGA).&lt;/p&gt;&#xA;" OwnerUserId="370" LastEditorUserId="35" LastEditDate="2013-06-26T11:26:38.117" LastActivityDate="2013-06-26T11:26:38.117" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8337" PostTypeId="1" AcceptedAnswerId="8367" CreationDate="2013-06-26T16:15:12.560" Score="13" ViewCount="19567" Body="&lt;p&gt;The &lt;strong&gt;delta&lt;/strong&gt; in option pricing, also called the &lt;em&gt;hedge ratio&lt;/em&gt;, is expressed as the sensitivity of the option price to the underlying price change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;strong&gt;analytical solution&lt;/strong&gt; for the most common option pricing models, such as the Black-Scholes, Corrado and Su, and other frameworks can be found on the internet or in books.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I am dealing with a more complex model &lt;strong&gt;for which the analytical solution is not that obvious&lt;/strong&gt;, and hence therefore want to obtain the delta (and later also the other greeks) by means of a numerical method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far I haven't found a proper way to do so. More specific, when simply calculating the gradient of the Call price with respect to the underlying Spot price, I get different values than from the analytical solution -- In case of the Black-Scholes model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone explain &lt;strong&gt;why the gradient does not equal the delta&lt;/strong&gt; and what the numerical alternatives are for this issue?&lt;/p&gt;&#xA;" OwnerUserId="2291" LastActivityDate="2017-09-01T20:09:36.567" Title="How to numerically obtain delta?" Tags="&lt;option-pricing&gt;&lt;greeks&gt;&lt;numerical-methods&gt;&lt;delta-hedging&gt;" AnswerCount="2" CommentCount="9" FavoriteCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="8338" PostTypeId="1" AcceptedAnswerId="8343" CreationDate="2013-06-26T19:11:48.977" Score="0" ViewCount="954" Body="&lt;p&gt;In the end of May 2013 British Bankers Association (BBA) stopped publishing LIBOR rates for Australian and Canadian dollars in a light of recent scandals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;LIBOR rates were essential for creating zero curves for these currencies. &#xA;BBA now recommends to use &lt;a href=&quot;http://www.afma.com.au/data/bbsw.html&quot; rel=&quot;nofollow&quot;&gt;Bank Bill Swap Reference Rate&lt;/a&gt; (BBSW) for AUD and &lt;a href=&quot;http://www.m-x.ca/marc_terme_bax_cdor_en.php&quot; rel=&quot;nofollow&quot;&gt;Canadian Dealer Offered Rate&lt;/a&gt; (CDOR) for CAD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would you convert these into zero curves?&lt;/p&gt;&#xA;" OwnerUserId="2909" LastEditorUserId="2909" LastEditDate="2013-06-26T20:39:49.753" LastActivityDate="2013-06-27T04:17:46.690" Title="Zero Curve Calculation for AUD, CAD (post LIBOR scandal)" Tags="&lt;interest-rates&gt;&lt;yield-curve&gt;&lt;curve-fitting&gt;&lt;extrapolation&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8339" PostTypeId="2" ParentId="8178" CreationDate="2013-06-26T19:18:31.697" Score="1" Body="&lt;p&gt;That's a great question and it is what I always wanted to try to do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess I found a solution using PDE approach. Change of numeraire would be more intuitive indeed, but I am not very good in stochastic calculus.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea is as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Let's consider portfolio $\Pi = V(X,Y,t) - \Delta_X X - \Delta_Y Y$.&#xA;I will found $\Delta_X$ and $\Delta_Y$ such that portfolio $\Pi$ would be riskless and earn risk-free rate of return $r$: $d\Pi = r\Pi dt$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Assumption&lt;/strong&gt;: $dX = \mu_X X dt + \sigma_X X dW^X$,  $dY = \mu_Y Y dt + \sigma_Y Y dW^Y$ and $dW^X dW^Y = \rho dt$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, applying Ito's lemma I obtain:&#xA;$d\Pi = \frac{\partial V}{\partial t} dt + \frac{\partial V}{\partial X} dX + \frac{\partial V}{\partial Y} dY + \frac{1}{2} \sigma_X^2 X^2 \frac{\partial^2 V}{\partial X^2} dt+ \frac{1}{2} \sigma_Y^2 Y^2 \frac{\partial^2 V}{\partial Y^2} dt+ \rho \sigma_X\sigma_Y XY \frac{\partial^2 V}{\partial X\partial Y} dt - \Delta_X dX - \Delta_Y dY =$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\left( \frac{\partial V}{\partial t} + \frac{1}{2} \sigma_X^2 X^2 \frac{\partial^2 V}{\partial X^2}+ \frac{1}{2} \sigma_Y^2 Y^2 \frac{\partial^2 V}{\partial Y^2} + \rho \sigma_X\sigma_Y XY \frac{\partial^2 V}{\partial X\partial Y} \right)dt + \left(\frac{\partial V}{\partial X} - \Delta_X \right) dX  + \left(\frac{\partial V}{\partial Y}   - \Delta_Y \right) dY$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And all this is equal to  $d\Pi = r\Pi dt = r\left(V - \Delta_X X - \Delta_Y Y\right)dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, set $\frac{\partial V}{\partial Y} = \Delta_Y$ and $\frac{\partial V}{\partial X} = \Delta_X$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Left-hand side becomes $\left(\frac{\partial V}{\partial t} + \frac{1}{2} \sigma_X^2 X^2 \frac{\partial^2 V}{\partial X^2}+ \frac{1}{2} \sigma_Y^2 Y^2 \frac{\partial^2 V}{\partial Y^2} + \rho \sigma_X\sigma_Y XY \frac{\partial^2 V}{\partial X\partial Y}\right) dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right-hand side is now $r\left(V - \frac{\partial V}{\partial X} X - \frac{\partial V}{\partial Y} Y\right)dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The PDE is now $\frac{\partial V}{\partial t} + \frac{1}{2} \sigma_X^2 X^2 \frac{\partial^2 V}{\partial X^2}+ \frac{1}{2} \sigma_Y^2 Y^2 \frac{\partial^2 V}{\partial Y^2} + \rho \sigma_X\sigma_Y XY \frac{\partial^2 V}{\partial X\partial Y} = r\left(V - \frac{\partial V}{\partial X} X - \frac{\partial V}{\partial Y} Y\right)$, or&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{\partial V}{\partial t} + \frac{1}{2} \sigma_X^2 X^2 \frac{\partial^2 V}{\partial X^2}+ \frac{1}{2} \sigma_Y^2 Y^2 \frac{\partial^2 V}{\partial Y^2} + \rho \sigma_X\sigma_Y XY \frac{\partial^2 V}{\partial X\partial Y} + r\frac{\partial V}{\partial X} X + r \frac{\partial V}{\partial Y} Y = rV$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I forgot: the boundary condition is $V(X, Y, T) = (X -  Y)^+$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Now, in order to solve this crazy PDE i will use substitution:&#xA;$Z = \frac{X}{Y}$ and $V(X,Y,t) = G(Z, t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks to &lt;a href=&quot;http://www.wolframalpha.com/input/?i=D%5BG%5BX/Y,t%5D,Y%5D&quot; rel=&quot;nofollow&quot;&gt;Wolfram Alpha&lt;/a&gt;, I have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{\partial V}{\partial X} = \frac{1}{Y} \frac{\partial G}{\partial Z}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{\partial V}{\partial Y} = -\frac{X}{Y} \frac{\partial G}{\partial Z}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{\partial^2 V}{\partial X^2} = -\frac{1}{Y^2} \frac{\partial^2 G}{\partial Z^2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{\partial^2 V}{\partial Y^2} = \frac{X\left(2Y\frac{\partial G}{\partial Z}+X\frac{\partial^2 G}{\partial Z^2}\right)}{Y^4} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{\partial^2 V}{\partial XY} = -\frac{Y\frac{\partial G}{\partial Z}+X\frac{\partial^2 G}{\partial Z^2}}{Y^3} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Substituting into previous equation and cancelling the terms out we obtain:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\dot{G} + [\sigma_X^2-\rho \sigma_X \sigma_Y]ZG' + \frac{1}{2}[\sigma_X^2-2\rho \sigma_X \sigma_Y + \sigma_Y^2]Z^2G'' = rG$, or&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\dot{G} + \mu_GZG' + \frac{1}{2}\sigma_G^2 Z^2G'' = rG$, where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\dot{G} = \frac{dG}{dt}$, $G' = \frac{dG}{dZ}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mu_G = \sigma_X^2-\rho \sigma_X \sigma_Y$, $\sigma_G = \sqrt{\sigma_X^2-2\rho \sigma_X \sigma_Y + \sigma_Y^2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And the boundary condition is $G(Z,T) = Y(Z - 1)^+$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE: PREVIOUS VERSION WAS NOT COMPLETELY CORRECT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Now the question is what to do with that $Y$ in the equation above? I employ next change of variables: $G(Z) = YF(Z)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks to paper and pencil, I have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$G' = (YF)' = Y\left(F' - \frac{F}{Z}\right)$ and  $G'' = \left((YF)'\right)' = \text{after some calculations} = YF''$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Plugging this into $Z$'s PDE we obtain:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\dot{F} + \mu_G Z F' + \frac{1}{2} \sigma_G^2 Z^2 F'' = (r+ \mu_G)F$&#xA;with boundary condition $F(Z,T) = (Z-1)^+$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now denote $r^* = r+ \mu_G$ and equation becomes: $\dot{F} + (r^* - r) Z F' + \frac{1}{2} \sigma_G^2 Z^2 F'' = r^* F$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) Now $r^*$ works like new risk-free rate and $r$ is like $Z$'s dividend yield and we can apply well-known formula for option on asset with continiously paid dividends:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$F(Z, T) = e^{-r^*T} N(d_1)  Z_0 - e^{-rT} N(d_2) $, where&#xA;$d_{1,2} = \frac{1}{\sigma_G\sqrt{T}}\left[\ln\left(Z_0\right)+\left(r^* - r \pm\frac{\sigma_G^2}{2}\right)T\right] =\frac{1}{\sigma_G\sqrt{T}}\left[\ln\left(Z_0\right)+\left(\mu_G \pm\frac{\sigma_G^2}{2}\right)T\right] $.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5) Now $V =  e^{-r^*T} N(d_1)  X_0 - e^{-rT} N(d_2) Y_0$, where&#xA;$d_{1,2}  =\frac{1}{\sigma_G\sqrt{T}}\left[\ln\left(\frac{X_0}{Y_0}\right)+\left(\mu_G \pm\frac{\sigma_G^2}{2}\right)T\right] $, where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r^* = r+ \mu_G$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mu_G = \sigma_X^2-\rho \sigma_X \sigma_Y$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma_G = \sqrt{\sigma_X^2-2\rho \sigma_X \sigma_Y + \sigma_Y^2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope I was correct. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also hope somebody would be able to propose any better solution, maybe using martingale approach.&lt;/p&gt;&#xA;" OwnerUserId="2870" LastEditorUserId="2870" LastEditDate="2013-06-27T06:15:24.437" LastActivityDate="2013-06-27T06:15:24.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8342" PostTypeId="2" ParentId="8337" CreationDate="2013-06-27T04:01:44.540" Score="3" Body="&lt;p&gt;It may be the case with certain exotics that greeks are derived analytically through approximations. In that case at certain boundaries you may get different results from such approximation over the numerical approach. Why do you not approach the numerical case similarly than most banks and hedge funds when they &quot;shock&quot; their options books: Simply shift your underlying, re-calculate the option price, derive a convexity adjustment factor, and from both approximate your delta. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-06-27T04:18:17.877" LastActivityDate="2013-06-27T04:18:17.877" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8343" PostTypeId="2" ParentId="8338" CreationDate="2013-06-27T04:17:46.690" Score="2" Body="&lt;p&gt;I think the following two questions and related answers should help in answering the question: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/3438/why-use-swap-rates-in-a-yield-curve/8290#8290&quot;&gt;Why use swap-rates in a yield curve?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/7311/is-there-an-australian-interbank-rate&quot;&gt;Is there an Australian Interbank Rate?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially to derive funding curves you gotta use what is left with the constraint that the source instrument has to be liquid enough and closely enough reflect true market conditions. The math behind sourcing such swap rates to generate a zero curve is standard, the only thing that changed is the reference rates used. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be honest, I believe those submitted rates are not coming with any more guarantees to be free of rate rigging than any prior libor submissions. The vendor name changed, the topic is still fresh on people's minds and that is about it. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2013-06-27T04:17:46.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8345" PostTypeId="1" AcceptedAnswerId="9300" CreationDate="2013-06-27T12:36:07.900" Score="7" ViewCount="26025" Body="&lt;p&gt;This is not homework. I am trying to calculate the implied interest rate of one currency (C2) using an FX swap and the interest rate of another currency (C1 - base). I have the following:&lt;br/&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Spot:&lt;/strong&gt; 7.7587 (C2 per unit C1)&lt;br/&gt;&#xA;&lt;strong&gt;Buy Notional (spot) C1:&lt;/strong&gt; 12,888,757.14 &lt;br/&gt;&#xA;&lt;strong&gt;Sell Notional (spot) C2:&lt;/strong&gt; 100,000,000.00 &lt;br/&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Start date:&lt;/strong&gt; 6-May-13&lt;br/&gt;&#xA;&lt;strong&gt;End date:&lt;/strong&gt; 7-May-14&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Buy Notional (forward) C2:&lt;/strong&gt; 100,000,000.00 &lt;br/&gt;&#xA;&lt;strong&gt;Sell Notional (forward) C1:&lt;/strong&gt; 12,905,390,58 &lt;br/&gt;&#xA;&lt;strong&gt;Forward FX rate&lt;/strong&gt;:  7.7487 &lt;br/&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a borrowing in C1 for 0.9650% for the year.&lt;br/&gt;&#xA;Using interest rate parity:&#xA;$$ F_0 = S_0 \frac{1+r_{C2}}{1+r_{C1}}  $$&lt;br/&gt;I solve for $ r_{C2} = 0.8349\%$.&lt;br/&gt;&#xA;However, I am told that the right answer  is $0.8486\%$.&lt;br/&gt; Which should be the implied interest rate in currency C1. Am I crazy or missing something? &lt;br/&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I need to consider FX basis?&lt;br/&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt; &lt;br/&gt;&#xA;If I use ACT/360 for C1 and ACT/365 for C2 with $ACT=365$ I get actually pretty close $(0.8483\%)$. Is that it? Is the difference caused by daycount?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;C1 is USD &lt;br/&gt;&#xA;C2 is HKD &lt;br/&gt;&#xA;(I believe these are the correct day-count convention based on a paper by UBS). Not sure where to find the &quot;official&quot; declaration.&lt;/p&gt;&#xA;" OwnerUserId="2685" LastEditorUserId="2685" LastEditDate="2013-06-28T05:40:52.203" LastActivityDate="2013-10-31T17:53:43.067" Title="Implied interest rate from FX swap" Tags="&lt;interest-rates&gt;&lt;fx&gt;&lt;forward&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8346" PostTypeId="1" AcceptedAnswerId="8351" CreationDate="2013-06-27T13:11:47.307" Score="2" ViewCount="2423" Body="&lt;p&gt;I have a quite basic question, but I can't find a reference with it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recall that we can use the Black-Scholes formula to price a European call or put for a market consisting when:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the underlying asset following geometric Brownian motion;&lt;/li&gt;&#xA;&lt;li&gt;the risk free interest rate is considered constant;&lt;/li&gt;&#xA;&lt;li&gt;the volatility of the underlying asset returns is constant.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In deriving this, one writes the call/put as expectations of discounted payoffs, e.g. $C=E^Q[\exp^{-rT}(S_T-K)_+]$ for call ($Q=$risk neutral prob.), where $(S_t)$ is follows geometric Brownian motion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is : what is the variance of what lies in the bracket ? I ask this for calls and puts. &lt;/p&gt;&#xA;" OwnerUserId="5612" LastEditorUserId="467" LastEditDate="2013-06-27T15:35:24.657" LastActivityDate="2013-06-28T10:03:15.977" Title="Formula for variance of European call/put in Black Scholes" Tags="&lt;black-scholes&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8347" PostTypeId="2" ParentId="85" CreationDate="2013-06-27T15:10:02.573" Score="4" Body="&lt;p&gt;One I like is the Artificial Neural Network model with inputs the same as for the Black-Scholes model (hence Spot, Strike, Rate, Time to expiration, Dividend).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a modification of the &lt;a href=&quot;http://dro.dur.ac.uk/5573/&quot; rel=&quot;nofollow&quot;&gt;Andreou et. al. (2008)&lt;/a&gt; framework who use hybrid artificial neural networks that incorporate information from the parametric models. Moreover,&#xA;$Call = f(Call_{cs}, Call_{bs})$&#xA;where $f(.)$ is the hybrid network that links information from the parametric models with the prices $Call_{cs}$ (Corrado and Su, 1997) and $Call_{bs}$ (Black Scholes, 1973). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case I proposed, one can use the same hybrid networks $f(.)$ to incorporate information from the Black-Scholes inputs (Spot, Strike, Rate, Time to expiration, Dividend). Hence,&#xA;$Call = f(Spot, Strike, Rf, T, Div)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This would allow for complex nonlinear relations. However, the approach may be sensitive to overfitting or other calibration issues.&lt;/p&gt;&#xA;" OwnerUserId="2291" LastEditorUserId="2291" LastEditDate="2013-06-28T15:23:37.483" LastActivityDate="2013-06-28T15:23:37.483" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8348" PostTypeId="1" CreationDate="2013-06-27T18:27:57.473" Score="8" ViewCount="1777" Body="&lt;p&gt;What methods are available to calculate IV and greeks for an american option with discrete dividends, and how do they compare?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should I use Roll-Geske-Whaley and solve for a given option price?&lt;/p&gt;&#xA;" OwnerUserId="2257" LastActivityDate="2017-12-14T17:54:35.313" Title="Implied volatility and greeks for american option with discrete dividends" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;implied-volatility&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8349" PostTypeId="1" AcceptedAnswerId="8352" CreationDate="2013-06-27T22:32:37.130" Score="4" ViewCount="2060" Body="&lt;p&gt;It is always said that longer bonds are more sensitive to interest rates. Intuitively this makes perfect sense, since longer bonds have a larger portion of its cash flow being subjected to stronger interest rate adjustments, and thus their value must be more sensitive to interest rates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I tried to prove this quantitatively, things seem to get more complicated.&#xA;Suppose a bond with par value $a$ pays coupons of amount $y$ annually. If interest rate is $r$, then the value of the bond is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ P=\frac{y}{r}[1-\frac{1}{(1+r)^{n}}]+\frac{a}{(1+r)^{n}} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And the relative change in the bond price with respect to interest rate is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{1}{P}\frac{dP}{dr} $$&#xA;where &#xA;$$ \frac{dP}{dr}=y\left\{ [1-(1+r)^{-n}](-r^{-2})-nr^{-1}(1+r)^{-n-1}\right\} -an(1+r)^{-n-1} $$&#xA;$$  =\frac{\frac{y}{r^{2}}(1+r-\frac{n}{r})-an}{(1+r)^{n+1}}-\frac{y}{r^{2}} $$&#xA;Therefore,&#xA;$$ \frac{1}{P}\frac{dP}{dr}=\frac{y(1+r-\frac{n}{r}-(1+r)^{n+1})-anr^{2}}{\left\{ yr[(1+r)^{n}-1]+ar^{2}\right\} (1+r)} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose long term bonds are really more sensitive to interest rate changes, then the above equation should always be negative, and its value should decrease as n increases. But I am having trouble seem this from the above equation. In fact, numerical results suggest other wise:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/y96Lj.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The chart above shows the percentage change in bond price when interest increases by 1%. The bond pays a 6% annual coupon. Each curve represents a bond that is subjected to a different interest rate. For example, the purple curve in the middle represents the relative change in the price of a bond that pays 6% coupon with interest rate being 9%. The vertical axis is the relative change in price, and the horizontal axis is the length of the bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can see from the chart that initially bond price does decrease faster as length increases, but soon reaches a maximum rate of decrease, and eventually the rate seems to move back toward a limiting value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This leaves 2 questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;With regard to the saying that &quot;longer bonds are more sensitive to interest rates&quot;, is this a statement that is true for most practical cases, or is it a statement that's always true mathematically?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How can we algebraically derive the results seen in the chart to answer questions such as where do the maximum rate of decrease occur, and what is the limiting value, if it exists at all?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5518" LastEditorUserId="5518" LastEditDate="2013-06-28T01:51:50.530" LastActivityDate="2013-07-03T00:52:15.350" Title="Is duration really inversely related to the maturity time length of a bond?" Tags="&lt;duration&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8351" PostTypeId="2" ParentId="8346" CreationDate="2013-06-28T09:57:23.590" Score="1" Body="&lt;p&gt;I just sketch how you can derive the formula. In your setting we have $S_T=s_0e^{\sigma W_T-\frac{1}{2}\sigma^2T}$. W.l.o.g we put $s_0=1$. Hence $S_T$ is lognormal distributed and $S_T^2=e^{2\sigma W_T-\sigma^2T}$, which is still lognormal. $Var(X)=E[X^2]-E[X]^2$. We just have to compute $E[X^2]$. Let $A:=\{S_T&amp;gt;K\}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E[X^2]=E[(S_T-K)_+^2]=E[S_T^2\mathbf1_A]-2KE[S_T\mathbf1_A]+K^2Q[A]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the two last terms you have already calculated in the usual derivation of Black Scholes. For the first one you use the same techniques as for $E[S_T\mathbf1_A]$ with a different lognormal distribution.&lt;/p&gt;&#xA;" OwnerUserId="17133" LastEditorUserId="17133" LastEditDate="2013-06-28T10:03:15.977" LastActivityDate="2013-06-28T10:03:15.977" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8352" PostTypeId="2" ParentId="8349" CreationDate="2013-06-28T12:58:24.260" Score="7" Body="&lt;p&gt;Assume a number of bonds with three constant variables, par value $par$, coupon value $C$ (paid annually), and interest rate $r$, and one changing variable, time to maturity $n$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First off, the relevant formulas:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The price $P$ of each bond, as you've already written it, is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;P=C*[\frac{1}{r}-\frac{1}{r}*\frac{1}{(1+r)^{n}}]+\frac{par}{(1+r)^{n}}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The duration $D$ of each bond is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;D = \sum_{t=1}^{n}{w_t*t}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $w_t$ is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;w_t = \frac{C_t}{(1+r)^t}*\frac{1}{P}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The volatility $V$ (modified duration) of each bond is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;V = \frac{D}{(1+r)}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The modified duration $V$ gives an exact measure of the bond's exposure to interest rates. Thus the bond price sensitivity to interest rates is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{\Delta P}{P} = -V*\Delta r&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if you put all these together it should easily follow that &quot;the longer the bond the higher the sensitivity to interest rates&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First off, it's probably easy to see how $P$ relates to $n$. As $n$ goes up $P$ goes up as well. As $n$ gets bigger however the price increase rate drops and you eventually get closer and closer to $\frac{C}{r}$ (perpetuity formula). You do however constantly move up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, as $n$ gets bigger, the bond duration $D$ increases as well. It also approaches a limit but it continuously increases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By now you should probably see where I'm going with this. As $D$ gets bigger, $V$ gets bigger as well. As $V$ gets bigger the bond price sensitivity to interest rates goes up as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It follows then that as $n$ gets bigger (the bond becomes 'longer') the bond price sensitivity to rates goes up as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To see a numerical example as well have a look at the following charts:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C = 100,\ par = 1000,\ r = 0.05,\ \Delta r = 0.001$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P(n)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.imgur.com/ATM6JY5.png&quot; alt=&quot;Price&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$D(n)$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.imgur.com/ymvVMmt.png&quot; alt=&quot;Duration&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{\Delta P}{P}$ for $0.001$ increase in $r$ (the chart says &quot;0.01 dr&quot;. That is wrong. The change in r is 0.001)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.imgur.com/ftfB5FH.png&quot; alt=&quot;Price change&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{\Delta P}{P}$ for $0.01$ increase in $r$ for multiple $r$ levels&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.imgur.com/BdQArvg.png&quot; alt=&quot;Price change, multiple r levels&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ultimately I end up with a graph similar to yours but with no surprising results. There's no bond price change line curving up. All lines get closer and closer to their limit and then move to the right almost horizontally. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To wrap it up in terms of algebraic computations and thus address your second question as well we have the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\lim_{n \to +\infty}P = \frac{C}{r}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\lim_{n \to +\infty}D = 1+\frac{1}{r}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\lim_{n \to +\infty}V = \frac{1}{r}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mathematically speaking, the formulas confirm the answer to the first question for all numbers, not just practical ones, and they also allow you to calculate the relevant limits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The numbers and charts used in the numerical example above conform to these limit formulas as well. The bond price approaches $2000$ which as per the above formula is $100/0.05$, the bond duration approaches $21$ which is $1 + 1/0.05$, volatility approaches $20$ which is $1/0.05$, and the bond price sensitivity to interest rates approaches $-0.02$ which is $0.001*(-20)$&lt;/p&gt;&#xA;" OwnerDisplayName="user5399" LastEditorDisplayName="user5399" LastEditDate="2013-06-28T13:58:54.817" LastActivityDate="2013-06-28T13:58:54.817" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8353" PostTypeId="1" CreationDate="2013-06-29T09:01:21.677" Score="0" ViewCount="2304" Body="&lt;p&gt;I don't understand the following statement: The price of a &lt;em&gt;contingent claim&lt;/em&gt; is the expected value of the discounted payoff value under the &lt;em&gt;risk neutral probability measure Q&lt;/em&gt; deﬁned in &lt;em&gt;complete markets&lt;/em&gt; with &lt;em&gt;no-arbitrage.&lt;/em&gt;&#xA;$$\mathbb E^Q\left[(S_T-K)_+e^{-\int_0^T r_s\, ds}|\mathcal F_0\right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb E^Q [.]$ is the &lt;em&gt;expectation under the risk neutral measure&lt;/em&gt; $Q$, $S_T$ &#xA;is the underlying  strike price, and $r_s$ is the risk-free rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Through  what argument does the existence of a risk neutral probability measure imply an arbitrage-free value of the portfolio?&lt;/p&gt;&#xA;" OwnerUserId="5101" LastEditorUserId="848" LastEditDate="2013-08-03T08:18:35.350" LastActivityDate="2013-08-03T08:18:35.350" Title="expected value of the discounted payoff" Tags="&lt;risk-neutral-measure&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8354" PostTypeId="1" CreationDate="2013-06-29T14:05:29.890" Score="0" ViewCount="6005" Body="&lt;p&gt;I am supposed to model daily stock prices with a normal inverse gauss distribution in excel. I feel like I am misssing some basics because I cant transform the information from the academic papers into an excel formula. Does anyone have any experience with this distribution? How do I go from the PDF to the St = So * exp (X) formula?&lt;/p&gt;&#xA;" OwnerUserId="5621" LastActivityDate="2013-07-06T18:13:43.517" Title="Stock prices using a monte carlo simulation with a normal inverse gauss distribution" Tags="&lt;monte-carlo&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8355" PostTypeId="2" ParentId="8354" CreationDate="2013-06-29T18:34:58.803" Score="3" Body="&lt;p&gt;Note: In your text you refer to the stock prices and using a normal inverse gaussian. This would correspond to a normal model. However the formula you write suggests a log-normal (Black-Scholes) like model (not sure what X is), i.e. using a normal inverse gaussian for the stock &lt;em&gt;returns&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Excel:&#xA;The spreadsheet at&#xA;&lt;a href=&quot;http://www.christian-fries.de/finmath/spreadsheets/&quot; rel=&quot;nofollow&quot;&gt;http://www.christian-fries.de/finmath/spreadsheets/&lt;/a&gt;&#xA;does a Monte-Carlo Simulation of a Black-Scholes model and the corresponding risk neutral valuation of a derivative. To convert the log-normal process to a normal one: convert the Euler scheme&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;=D18+$C$6*D18*$C$8+$C$7*D18*NORMINV(RANDOM();0;1)*SQRT($C$8)&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;you have&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;=D18+$C$6*$C$8+$C$7*NORMINV(RANDOM();0;1)*SQRT($C$8)&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where this is cell E18 and&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;D18 denotes the previous cell / realization of the stock&lt;/li&gt;&#xA;&lt;li&gt;\$C\$6 is the drift r&lt;/li&gt;&#xA;&lt;li&gt;\$C\$8 is the time step dt&lt;/li&gt;&#xA;&lt;li&gt;\$C\$7 is the volatility $\sigma$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;and each row then corresponds to a Monte-Carlo path. (Remark: In the normal case case, the Euler scheme is the exact solution. In the log normal case it is much better to use the Euler scheme for log(S), i.e.&#xA;$S(t+\Delta t) = S(t) * \exp(r \Delta t - 0.5 \sigma \Delta t + \Delta W(t))$ - I assume you can guess the corresponding Excel formula.&lt;/p&gt;&#xA;" OwnerUserId="3548" LastActivityDate="2013-06-29T18:34:58.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8359" PostTypeId="1" AcceptedAnswerId="8360" CreationDate="2013-06-30T20:00:57.703" Score="4" ViewCount="615" Body="&lt;p&gt;To compare my stock portfolio generator with managed funds performance, I want to calculate the Sharpe Ratio of my historic portfolios with the numbers found on the fund company web sites or in financial portals. However, I could not find a specification of their calculations. I also emailed MorningStar to no avail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question 1: What exactly should be used for risk-free interest? I can use the 12M USD LIBOR but it is at least 1% below the risk-free interest a private investor can expect (I am looking for a one year performance, i.e. hold all stocks exactly one year).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question 2: I am using LOG10(day /day before) returns for the stdev calculation, but for the return calculation I use last portfolio value - first portfolio value - 1.0. That is probably total bogus and makes my numbers look too good but since I could not find a reference... I might as well use geometric averages or dollar amounts as was suggested in one answer to a similar question here, but what is the official way of doing it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my main question is: how exactly do the fund companies calculate the Sharpe Ratio? I also heared the opinion that they do it this way or the other, whatever suits. But that would make the Sharpe Ratio worthless for comparing fund performance, so there must be one accepted method?! &lt;/p&gt;&#xA;" OwnerUserId="5628" LastActivityDate="2013-07-04T15:49:09.163" Title="How is the Sharpe Ratio presented in fund profiles usually calculated?" Tags="&lt;sharpe-ratio&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8360" PostTypeId="2" ParentId="8359" CreationDate="2013-06-30T21:08:14.790" Score="4" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Make your pick depending on your market, but make it EXPLICIT. As chrisaycock noted, most companies ignore the riskfree rate, and usually thats fine, Sharpe-ratios are almost exclusively interpreted in comparison. If clients demand sharpe ratios (and require a risk-free rate), just make sure it is totally clear which one you've used.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;No 'official' way, whatever floats your boat. This looks good to me though. Make it explicit, e.g. via footnote.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You get the idea: Spell all assumption/methods, and nobody can complain. &lt;/p&gt;&#xA;" OwnerUserId="1976" LastEditorUserId="35" LastEditDate="2013-07-04T15:49:09.163" LastActivityDate="2013-07-04T15:49:09.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8361" PostTypeId="1" CreationDate="2013-06-30T22:20:57.143" Score="5" ViewCount="1057" Body="&lt;p&gt;Are there any free, open source VBA addins or R packages that can be linked using the yahoo finance/Google finance/other data sources api to continuously download intraday data into excel or R?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://code.google.com/p/finance-data-to-excel/&quot; rel=&quot;noreferrer&quot;&gt;https://code.google.com/p/finance-data-to-excel/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the closest I have found to loading D/M/Y prices into excel but it doesn't allow for intraday. I have a few charts with my own technical indicators that I would love to have have refreshed every few seconds with new data. I know that yahoo finance only provides delayed data but that's not an issue for me.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I miss having Bloomberg :(&lt;/p&gt;&#xA;" OwnerUserId="4729" LastActivityDate="2017-10-24T07:44:23.610" Title="Loading HF stock data into excel" Tags="&lt;data&gt;&lt;r&gt;&lt;excel&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8363" PostTypeId="1" CreationDate="2013-07-01T01:25:03.173" Score="2" ViewCount="311" Body="&lt;p&gt;As part of End-Of-Day calculations once a particular market/exchange has closed for all the tickers traded on that market one may typically compute the following properties:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;OHLC&lt;/li&gt;&#xA;&lt;li&gt;Bid/Ask Price (mean, median, stddev)&lt;/li&gt;&#xA;&lt;li&gt;Bid/Ask Size (mean, median, stddev)&lt;/li&gt;&#xA;&lt;li&gt;Spread (mean, median, stddev)&lt;/li&gt;&#xA;&lt;li&gt;Executed volume (total, mean, stddev, min, max)&lt;/li&gt;&#xA;&lt;li&gt;Percentage of total daily volume&lt;/li&gt;&#xA;&lt;li&gt;VWAP&lt;/li&gt;&#xA;&lt;li&gt;Time between executions (mean, stddev)&lt;/li&gt;&#xA;&lt;li&gt;Number of executions&lt;/li&gt;&#xA;&lt;li&gt;Perform points [2-9] over the last N non-extraordinary business days (where N is 10 and 20) obtaining mean, stddev, min and max&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The statistics are summaries computed over uniform buckets of time for each ticker. The buckets can be of size 30sec, 1min, 2min, 5min, 10min - which bucket is used for a particular ticker is dependent on the nature of the ticker.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;For example&lt;/em&gt;, a 10BD mean of executed volume and bid price (with their stddev) in a particular bucket for a well behaved ticker can help a vwap buyside mean oriented market impact minimizing strategy predict how much volume could be expected in that interval, allowing it to make better decisions about how much volume it should have out, and at what price levels, and whether or not it's falling behind and if so should it cross the spread now or will there be ample volume for it to catch up in the next intervals before its end-time is reached.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: In addition to the above what else does one typically compute? - &lt;em&gt;and if possible why?&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="5632" LastEditorUserId="5632" LastEditDate="2013-07-02T03:10:53.233" LastActivityDate="2013-07-06T18:10:54.617" Title="Simple EOD computations for tick data" Tags="&lt;time-series&gt;&lt;statistics&gt;&lt;analysis&gt;&lt;tick-data&gt;" AnswerCount="0" CommentCount="7" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8364" PostTypeId="1" CreationDate="2013-07-01T01:30:08.003" Score="11" ViewCount="574" Body="&lt;p&gt;If an increasing process $X_t$ has a known Laplace transform $\mathbb{E} e^{-s X_t} = m_t(s)$, define its hitting time $\tau$ to some level $B$ to be&#xA;$$&#xA;\tau = \inf\{ u &amp;gt; 0 : X_u \geq B \}.&#xA;$$&#xA;Can we express the Laplace transform (or its CDF) of $\tau$ in terms of $m$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular, I am interested in the hitting time of the integrated CIR process&#xA;$$&#xA;X_t = \int_0^t V_s \ ds&#xA;$$&#xA;where&#xA;$$&#xA;dV_t = (\alpha V_t + \beta) dt + \gamma \sqrt{V_t} dW_t.&#xA;$$&#xA;The Laplace transform of $X_t$ is known in closed-form in this case, and given by&#xA;$$&#xA;m_t(s) = \mathbb{E} e^{-s X_t} = \left( \frac{e^{-\alpha t/2}}{\cosh(Pt/2)-\frac{\alpha}{P}\sinh(Pt/2)} \right)^{2\beta/\gamma^2} \exp\left(-\frac{s V_0}{P} \frac{2 \sinh(Pt/2)}{\cosh(Pt/2)-\frac{\alpha}{P} \sinh(Pt/2)}\right)&#xA;$$&#xA;where $P = \sqrt{\alpha^2 + 2 \gamma^2 s}$.&lt;/p&gt;&#xA;" OwnerUserId="5631" LastEditorDisplayName="user16891" LastEditDate="2015-07-23T09:48:37.943" LastActivityDate="2017-05-13T20:25:09.050" Title="Distribution of hitting time of the integrated CIR process" Tags="&lt;stochastic-calculus&gt;&lt;probability&gt;&lt;term-structure&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8365" PostTypeId="1" CreationDate="2013-07-01T09:40:45.850" Score="4" ViewCount="189" Body="&lt;p&gt;Hello Quant Finance StackExchange,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a simple way to find the crossing probabilities of a moving barrier, namely a barrier written in the form $U(t)=\alpha_1t^2 + \beta_1t + \gamma_1$ and $L(t)=\alpha_2t^2 + \beta_2t + \gamma_2$. (or if no solution, reduce the complexity to linear polynomial $\alpha t + \beta$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that there's a simple solution if the barrier is fixed, $U(t) = U$ and $L(t) = L$ and that $P(U$before$L)$, written here as $H(x)$, for a process $X_t$is given by &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$H(x)=\frac{s(x)-s(L)}{s(U)-s(L)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $x$, $L\leq x \leq U$ is the starting position and $s(x)$ is the scaling function such that $Y_t = s(X_t)$ is a martingale. Example, for GBM with $2\mu \neq\sigma^2$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$s(x)=\frac{x^{1-2\mu/\sigma^2}}{1-2\mu/\sigma^2}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if I were to apply optional stopping for a moving barrier as I did a fixed barrier, it would seem that I'll get something like,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$H(x,\tau)=\frac{s(x)-s(L(\tau))}{s(U(\tau))-s(L(\tau))}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which would make it a random variable as the first exit time $\tau$ is random. Would getting the crossing probability as simple as taking the expectation, namely&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$H(x)=\text{E}_\tau(H(x,\tau))=\sum_{t=0}^T\left[H(x,t)P(\tau=t)\right]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this method reasonably logical?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(My rusty notation comes from me being two years removed from doing stochastic calculus at college. A rough explanation would do. Yes, I know there's tons of mathematical intricacies I conveniently overlooked.)&lt;/p&gt;&#xA;" OwnerUserId="5634" LastActivityDate="2013-07-01T09:40:45.850" Title="Simple way to get the crossing probabilities of a moving barrier" Tags="&lt;barrier&gt;&lt;stopping&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8366" PostTypeId="2" ParentId="3746" CreationDate="2013-07-01T09:46:35.280" Score="1" Body="&lt;p&gt;Just have a look at Chekhlov/Uryasev/Zabarankin paper on the subject. &#xA;People do not use it because they do not understand it that s it.&lt;/p&gt;&#xA;" OwnerUserId="5635" LastActivityDate="2013-07-01T09:46:35.280" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8367" PostTypeId="2" ParentId="8337" CreationDate="2013-07-01T12:52:29.343" Score="16" Body="&lt;p&gt;This is in fact a tricky matter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you say one way is to calculate delta by an analytic formula, i.e. calculate the first derivative of the option pricing formula you are using with respect to the underlying's spot price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second way is to do it numerically, i.e. change the spot price by a small value $dS$, calculate the value of the option and then calculate the delta as a difference quotient: $delta = \frac{V(S+dS)-V(S)}{dS}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When changing the spot price and calculating $V(S+dS)$ there are two possibilities:&lt;br&gt;&#xA;1. change spot price by $dS$, all other parameters (including volatility) stay unchanged, then price the option and calculate the delta as shown above.&lt;br&gt;&#xA;2. change spot price by $dS$, take volatility from the volatility surface, then price the option and calculate the delta as shown above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which method is the best very much depends on the dynamics of the volatility surface and many subtleties have to be taken into consideration here. This is also related to the so called &lt;em&gt;Sticky Delta vs. Sticky Strike problem&lt;/em&gt; and there's no &lt;em&gt;correct&lt;/em&gt; solution all the time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a good overview and introduction see here:&lt;br&gt;&lt;a href=&quot;http://www.emanuelderman.com/media/euronext-volatility_smile.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Laughter in the Dark - The Problem of the Volatility Smile&lt;/a&gt; by Emanual Derman and especially&lt;br&gt;&lt;a href=&quot;http://www.emanuelderman.com/media/smile-lecture9.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Regimes of Volatility&lt;/a&gt; by the same author.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2017-09-01T20:09:36.567" LastActivityDate="2017-09-01T20:09:36.567" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8368" PostTypeId="2" ParentId="8361" CreationDate="2013-07-01T14:42:11.807" Score="2" Body="&lt;p&gt;you need real-time tick in order to achive this. IB, esignal, iqfeed both provides RTD/DDE api to excel integration.&lt;/p&gt;&#xA;" OwnerUserId="1360" LastActivityDate="2013-07-01T14:42:11.807" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8369" PostTypeId="1" AcceptedAnswerId="8380" CreationDate="2013-07-01T15:05:55.533" Score="12" ViewCount="2616" Body="&lt;p&gt;Let two underlyings, $S_{1}$ and $S_{2}$, are correlated and $\beta$ is the slope of their returns linear regression, that is, it says how much $S_{1}$ co-variates with $S_{2}$ variance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, let&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\beta=\dfrac{\sigma_{S_{1}S_{2}}}{\sigma^{2}_{S_{2}}}=0.83$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;that is, when $S_{2}$ raises by $1\%$ $S_{1}$ goes up by $0.83\%$; in this example we can assume to know the true value of $\beta$, then no estimation error is present.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now consider two Call options: the former, $c_{1}$, is written on $S_{1}$ and the latter, $c_{2}$, is written on $S_{2}$, and they have both the same moneyness (e.g. 102%).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to BMS formula, the implied volatility, $v_{1}$, extrapolated from $c_{1}$ is greater than the one, $v_{2}$, extrapolated from $c_{2}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, let&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$v_{1}-v_{2}=6\%$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;on annual basis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_{1}$ and $S_{2}$ are strongly correlated and their linear regression $R^{2}$ is above $0.8\approx0.9$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What about buying $S_{2}$ Gamma selling $S_{1}$ Gamma in order to get a zero cost position but having sold (bought) an implied volatility greater (smaller) than realized volatility?&lt;/p&gt;&#xA;" OwnerUserId="3058" LastEditorUserId="3058" LastEditDate="2014-10-30T08:31:27.983" LastActivityDate="2014-10-30T08:31:27.983" Title="Beta vs. Implied Volatility statistical arbitrage using options" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;beta&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="8370" PostTypeId="2" ParentId="8361" CreationDate="2013-07-01T16:00:44.190" Score="4" Body="&lt;p&gt;For R see the following packages:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://cran.r-project.org/web/packages/quantmod/index.html&quot; rel=&quot;nofollow&quot;&gt;http://cran.r-project.org/web/packages/quantmod/index.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://cran.r-project.org/web/packages/highfrequency/index.html&quot; rel=&quot;nofollow&quot;&gt;http://cran.r-project.org/web/packages/highfrequency/index.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://cran.r-project.org/web/packages/TFX/index.html&quot; rel=&quot;nofollow&quot;&gt;http://cran.r-project.org/web/packages/TFX/index.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://cran.r-project.org/web/packages/IBrokers/index.html&quot; rel=&quot;nofollow&quot;&gt;http://cran.r-project.org/web/packages/IBrokers/index.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For a broader overview this might help:&lt;br&gt;&#xA;&lt;a href=&quot;http://cran.r-project.org/web/views/Finance.html&quot; rel=&quot;nofollow&quot;&gt;http://cran.r-project.org/web/views/Finance.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2013-07-01T16:00:44.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8371" PostTypeId="1" CreationDate="2013-07-01T16:40:34.263" Score="15" ViewCount="778" Body="&lt;p&gt;Shrinkage was much en-vogue before random matrix theory (RMT) took everybody's attention in covariance matrix estimation, however the latter also showed its limits. A plethora of other estimators has been presented, but I could not yet spot a golden standard. What is nowadays used most in practice (or what are &lt;em&gt;you&lt;/em&gt; using), and why? Also, shrinkage came in different flavours, so I'd like to know which is the favourite among them. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that I'm not just asking for the statistical properties of different methods (this would be on &lt;a href=&quot;https://stats.stackexchange.com/&quot;&gt;Cross Validated&lt;/a&gt; in that case), but also their interplay with practical considerations here in the quant world, which might include even non-technical factors.&lt;/p&gt;&#xA;" OwnerUserId="3015" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2017-02-17T11:56:32.533" Title="Covariance estimation: shrinkage, random matrix theory, what else?" Tags="&lt;covariance&gt;&lt;parameter-estimation&gt;&lt;covariance-estimation&gt;&lt;covariance-matrix&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="8372" PostTypeId="2" ParentId="8257" CreationDate="2013-07-01T20:24:21.947" Score="4" Body="&lt;p&gt;Some reading that may be of interest to you and which proceeds along similar lines of thought is that of Shmilovici in &quot;Predicting Stock Returns Using a Variable Order Markov Tree Model&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Abstract:&#xA;&quot;The weak form of the Efficient Market Hypothesis (EMH) states that the current market price fully reflects the information of past prices and rules out predictions based on price data alone. In an efficient market, consistent prediction of the next outcome of a financial time series is problematic because there are no reoccurring patterns that can be used for a reliable prediction. This research offers an alternative test of the weak form of the EMH. It uses a universal prediction algorithm based on the Variable Order Markov tree model to identify re-occurring patterns in the data, constructs explanatory models, and predicts the next time-series outcome. Based on these predictions, it rejects the EMH for certain stock markets while accepting it for other markets. The weak form of the EMH is tested for four international stock exchanges: the German DAX index; the American Dow-Jones30 index; the Austrian ATX index and the Danish KFX index. The universal prediction algorithm is used with sliding windows of 50, 75, and 100 consecutive daily returns for periods of up to 12 trading years. Statistically significant predictions are detected for 17% to 81% of the ATX, KFX and DJ30 stock series for about 3% to 30% of the trading days. A summary prediction analysis indicates that for a confidence level of 99% the more volatile German (DAX) and American (DJ30) markets are indeed efficient. The algorithm detects periods of potential market inefficiency in the ATX and KFX markets that may be exploited for obtaining excess returns.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's not something I've ever tried to implement but is still living on my shelf along with plenty of other material waiting for some proper attention in due course.&lt;/p&gt;&#xA;" OwnerUserId="787" LastActivityDate="2013-07-01T20:24:21.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8376" PostTypeId="1" AcceptedAnswerId="8377" CreationDate="2013-07-02T16:37:34.670" Score="2" ViewCount="147" Body="&lt;p&gt;I often come across the following notation in my script, and I have not found it anywhere else. While our lecturer insists it is of utmost importance to write this way in his exams, he yet failed to explain why...&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Setup&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;From a geometric Brownian motion&#xA;$$&#xA;dX_t = \mu X_tdt+\sigma X_t dW_t&#xA;$$&#xA;apply Ito to $$f(X_t,t) = ln X_t =: Y_t$$ and get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;dY_t = \frac{1}{X_t}dX_t - \frac{1}{2X_t^2}d[X]_t&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Actual Question&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Why is X in &lt;em&gt;squared brackets&lt;/em&gt; in the second term of the RHS?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the specific background to write this way, and how is it different from other notations?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All texts I've worked with so far (pure finance, except Oksendal) were able to work without this. What am I missing here?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I appreciate your help!&lt;/p&gt;&#xA;" OwnerUserId="1976" LastActivityDate="2013-07-04T09:47:25.323" Title="Bracket-Notation in SDEs" Tags="&lt;sde&gt;&lt;notation&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8377" PostTypeId="2" ParentId="8376" CreationDate="2013-07-02T18:19:03.793" Score="4" Body="&lt;p&gt;It is a notation for &lt;a href=&quot;http://en.wikipedia.org/wiki/Quadratic_variation&quot; rel=&quot;nofollow&quot;&gt;quadratic variation&lt;/a&gt; of a stochastic process.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2013-07-04T09:47:25.323" LastActivityDate="2013-07-04T09:47:25.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8378" PostTypeId="2" ParentId="8369" CreationDate="2013-07-02T20:04:01.703" Score="3" Body="&lt;p&gt;You could sell a high realized volatility against a low implied all day and bust out in a month. Doing this as a inter-stock spread isn't going to make it much of a better trade. If you want to take advantage of realized vol vs. implied vol  you need a model that describes the relationship between the two.&lt;/p&gt;&#xA;" OwnerUserId="5092" LastActivityDate="2013-07-02T20:04:01.703" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8379" PostTypeId="2" ParentId="8349" CreationDate="2013-07-03T00:52:15.350" Score="2" Body="&lt;p&gt;I'm not a bond trader and haven't looked at this in years, so my quantities may not be defined exactly as per convention, but it is generally correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer your question, you should restate the present value of the bond using exponentials. This new formulation is exactly equivalent to what you wrote but much more tractable algebraically (note that my interest rate $r$ below is not exactly the same as yours, it needs to be adjusted using the usual methods).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;P = y \Sigma e^{-rt_n} + a e^{-rt_N}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now this is trivial to differentiate:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{1}{P}\frac{dP}{dr} = \frac{y \Sigma t_n e^{-rt_n} + a t_N e^{-rt_N} }{P} = D !&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bingo, that's the definition of your bond's duration right there!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The derivative of your bond's PV is the weighted payout time of its coupons. This is an exact relationship, and not just an approximation.&lt;/p&gt;&#xA;" OwnerUserId="1628" LastActivityDate="2013-07-03T00:52:15.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8380" PostTypeId="2" ParentId="8369" CreationDate="2013-07-03T01:08:46.563" Score="5" Body="&lt;p&gt;This is definitely a valid (and possibly viable) strategy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think that your constraint of zero costs is a red herring and serves no useful purpose beside forcing you to take lopsided bets in the direction of the cheaper option. I would try instead to build a portfolio that has zero vega (hedged against overall moves in market-wide implied volatility) and zero delta (accomplished by overlaying a stock position). If possible may be able to combine additional options in your portfolio (i.e., more than two) to shield yourself against gamma exposure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am quite sure that other players in the market are doing this, so my guess is that this strategy, if well-diversified, could make good money before costs, but would be likely a non-trivial task to make it profitable after costs (as with most things in finance).&lt;/p&gt;&#xA;" OwnerUserId="1628" LastActivityDate="2013-07-03T01:08:46.563" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8381" PostTypeId="5" CreationDate="2013-07-03T08:12:06.337" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2013-07-03T08:12:06.337" LastActivityDate="2013-07-03T08:12:06.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8382" PostTypeId="4" CreationDate="2013-07-03T08:12:06.337" Score="0" Body="Python is a dynamically and strongly typed programming language whose design philosophy emphasizes code readability. Two significantly different versions of Python (2 and 3) are in use. Please mention the version that you are using when asking a question about Python." OwnerUserId="5644" LastEditorUserId="5644" LastEditDate="2013-07-03T09:20:13.110" LastActivityDate="2013-07-03T09:20:13.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8383" PostTypeId="2" ParentId="8353" CreationDate="2013-07-03T12:40:22.560" Score="0" Body="&lt;p&gt;In Mathematical finance, the concept of &quot;arbitrage-free&quot; portfolios is usually introduced before risk neutral measure. No arbitrage theory is intuitive for student when formulated this way: &quot;there is no strategy that can beat the market&quot;. (or &lt;a href=&quot;http://en.wikipedia.org/wiki/No_free_lunch_with_vanishing_risk&quot; rel=&quot;nofollow&quot;&gt;NFLVR&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then one can show that this implies the existence of a risk neutral measure (completeness of the market gives uniqueness of the market). Finally the reverse implication is mathematically showed, but has little less interest because one can grasp the idea with the first proof. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is this equivalent ? The value of an asset is not his expected value at the end of the contract because there is risk. No Artbitrage hypothesis implies there is a common value for bearing the risk. If you mathematically change your probability space to take this common risk bearing premium into account in your metric, the value of the asset will be the expected value in the new probability space. This is mainly a mathematical trick, it's just factoring the risk premium. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is this interesting ? It's easier to find the risk neutral probability once and for all assets and then pricing the assets taking their expected values than calculating each asset expected value corrected by the risk premium. &lt;/p&gt;&#xA;" OwnerUserId="5052" LastEditorUserId="5052" LastEditDate="2013-07-03T13:40:00.737" LastActivityDate="2013-07-03T13:40:00.737" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8385" PostTypeId="2" ParentId="7895" CreationDate="2013-07-03T21:37:15.323" Score="1" Body="&lt;p&gt;bloomberg symbology returns the last known ticker and associates that with a bbgid.  They do not release all of the associated tickers with data.  There is no way of finding out all of the historical tickers associated with an entity.  bloomberg publishes bbgid's which are &quot;open&quot; by searching and unique but you need api access to become survivorship bias free. &lt;/p&gt;&#xA;" OwnerUserId="1368" LastActivityDate="2013-07-03T21:37:15.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8386" PostTypeId="2" ParentId="8353" CreationDate="2013-07-04T06:02:15.637" Score="1" Body="&lt;p&gt;1) If some process $V_t$ is a martingale under some measure $Q$, we can always write $V_t = \mathbb{E}^Q_t[V_T]$. It is simply a definition of a martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Next question is &quot;in which measure would my process be a martingale&quot;? How do people in textbooks answer? They say, &quot;we will measure the performance of your portfolio relative to money market account&quot;. Now, MMA grows in steady pace $r(t)$. Hence, in order to keep its value constant, they discount it with the integral in your expectation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then they adjust the brownian motion your asset follows by changing probability measure. Thats where discounting comes into formula from. And voila! Your process is now martingale in that measure and you happily write the formula above.&lt;/p&gt;&#xA;" OwnerUserId="2870" LastActivityDate="2013-07-04T06:02:15.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8388" PostTypeId="1" CreationDate="2013-07-04T08:33:05.793" Score="4" ViewCount="374" Body="&lt;p&gt;In my program on Financial mathematics we studied such topics as pricing, portfolio management, risk theory (probability of ruin of an insurance company) etc. However, now I often see a line between &quot;financial mathematics&quot; and &quot;risk theory&quot;, with latter being also related to &quot;actuarial science&quot;. I have a question thus, is there indeed such a distinction in the terminology, or that's just my impression, and if there is such a distinction in the terminology - why did it appear, that is what is the crucial difference between those concepts. Methods used are very similar - stochastic modeling and stochastic analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please feel free to retag this question&lt;/p&gt;&#xA;" OwnerUserId="464" LastActivityDate="2013-07-04T14:26:10.717" Title="Risk theory is a part of financial mathematics" Tags="&lt;risk-management&gt;&lt;terminology&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8389" PostTypeId="2" ParentId="8388" CreationDate="2013-07-04T10:03:07.650" Score="4" Body="&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Mathematical_finance&quot; rel=&quot;nofollow&quot;&gt;Financial mathematics (or Mathematical finance&lt;/a&gt;) is obviously clearly quantitatively oriented.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Risk theory can be quantitatively oriented but can also be broader in the sense of qualitative characteristics, see e.g. &lt;a href=&quot;http://en.wikipedia.org/wiki/Risk_management&quot; rel=&quot;nofollow&quot;&gt;risk management&lt;/a&gt; or as an example for a more qualitatively oriented approach &lt;a href=&quot;http://en.wikipedia.org/wiki/Operational_risk&quot; rel=&quot;nofollow&quot;&gt;operational risk&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another difference is that financial mathematics uses both real world and risk neutral probability measures (depending on what is the aim of the model, e.g. derivatives pricing or portfolio management) whereas risk management exclusively uses the real world measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also this excellent article:&#xA;&lt;br&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1717163&quot; rel=&quot;nofollow&quot;&gt;'P' Versus 'Q': Differences and Commonalities between the Two Areas of Quantitative Finance by Attilio Meucci&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2013-07-04T10:03:07.650" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8390" PostTypeId="2" ParentId="8388" CreationDate="2013-07-04T14:26:10.717" Score="2" Body="&lt;p&gt;I have found a very nice discussion on the difference between the risk theory and the finance in &lt;a href=&quot;http://www.math.ethz.ch/~baltes/ftp/embfrefur.pdf&quot; rel=&quot;nofollow&quot;&gt;Stochastic Processes in Insurance and Finance&lt;/a&gt; by P. Embrechts et al. - namely, section 4.1 discusses the methodological difference between the fields which I hope nicely adds to the &#xA;answer of vonjd.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although being short, I think it better fits the answer rather than a comment since it may be beneficial for other &lt;/p&gt;&#xA;" OwnerUserId="464" LastActivityDate="2013-07-04T14:26:10.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8391" PostTypeId="1" CreationDate="2013-07-04T14:56:42.257" Score="4" ViewCount="178" Body="&lt;p&gt;Is it possible to infer investor's utility function from the set of decisions she is making?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's assume for simplicity that the market consists of a single traded asset whose return distribution is stationary and known to the agents. We are also given a set of trades made by a particular investor in this market. We also know the wealth of an investor. How do we estimate the investor's utility function from this data?&lt;/p&gt;&#xA;" OwnerUserId="5652" LastEditorUserId="12" LastEditDate="2013-07-04T16:01:54.530" LastActivityDate="2013-07-04T16:01:54.530" Title="Estimating investor's utility from the trades data" Tags="&lt;risk&gt;&lt;pricing&gt;&lt;utility-theory&gt;&lt;kernel&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8392" PostTypeId="2" ParentId="8391" CreationDate="2013-07-04T15:56:34.453" Score="1" Body="&lt;p&gt;The problem is to find the best functional form of the utility function plus estimate its parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A good starting point is the following draft chapter from an upcoming book which gives a good intuition and many examples:&#xA;&lt;a href=&quot;http://www2.gsb.columbia.edu/faculty/aang/book/Preferences%2010-08-2012.pdf&quot; rel=&quot;nofollow&quot;&gt;Preferences by Andrew Ang&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2013-07-04T15:56:34.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8397" PostTypeId="1" CreationDate="2013-07-06T17:34:37.223" Score="0" ViewCount="113" Body="&lt;p&gt;Are there any resources that tabulate past analyst forecasts for the monthly unemployment rate along with the dispersion of the forecasts&lt;/p&gt;&#xA;" OwnerUserId="4864" LastActivityDate="2013-07-14T01:48:18.650" Title="Analyst Forecasts for monthly unemployment rate" Tags="&lt;statistics&gt;&lt;research&gt;&lt;market-data&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8405" PostTypeId="1" AcceptedAnswerId="8413" CreationDate="2013-07-06T20:50:39.917" Score="9" ViewCount="11780" Body="&lt;p&gt;What are typical values for risk aversion parameters $\lambda$ used in mean-variance optimization? &lt;strong&gt;Please provide references.&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just to be clear, I'm talking about the $\lambda$ in $U(w) = w'\mu - \frac{\lambda}{2} w' \Sigma w$, the utility function in mean-variance optimization. &lt;/p&gt;&#xA;" OwnerUserId="5667" LastEditorUserId="5667" LastEditDate="2013-07-09T00:46:05.550" LastActivityDate="2019-08-16T08:50:39.913" Title="Typical risk aversion parameter value for mean-variance optimization?" Tags="&lt;optimization&gt;&lt;modern-portfolio-theory&gt;&lt;mean-variance&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="8406" PostTypeId="1" CreationDate="2013-07-07T02:11:35.403" Score="1" ViewCount="217" Body="&lt;p&gt;When I regress a single stock against a market index, I get a high value of R2 and beta closer to 1.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;APPL.fit &amp;lt;- lm(APPL ~ JKSE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I regress an unequally weighted portfolio against a market index, I get a lower R2 and beta close to 0.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;portfolio &amp;lt;- APPL*0.3 + WERT*0.1 +QRT*0.2 + POK*0.15 + LOI*0.15 + POI*0.03 +OLI*0.07&#xA;&#xA;Port.fit &amp;lt;- lm(portfolio ~ JKSE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Am I doing it wrong? &lt;/p&gt;&#xA;" OwnerUserId="5597" LastEditorUserId="35" LastEditDate="2013-07-07T04:27:45.617" LastActivityDate="2013-07-08T01:24:00.340" Title="Regression of Unequally Weighted Portfolio against a Single Index" Tags="&lt;regression&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8407" PostTypeId="5" CreationDate="2013-07-07T12:25:50.880" Score="0" Body="&lt;p&gt;The &lt;a href=&quot;http://en.wikipedia.org/wiki/Pearson_product-moment_correlation_coefficient&quot; rel=&quot;nofollow&quot;&gt;correlation&lt;/a&gt; between two random variables $X$ and $Y$ is a measure of the degree of linear association between them. The &lt;a href=&quot;http://en.wikipedia.org/wiki/Pearson_product-moment_correlation_coefficient&quot; rel=&quot;nofollow&quot;&gt;correlation&lt;/a&gt; is defined as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ {\rm cor}(X,Y) = \frac{ {\rm cov}(X,Y) }{ \sqrt{ {\rm var}(X) {\rm var}(Y) } },$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where ${\rm cov}(X,Y)$ denotes the &lt;a href=&quot;http://en.wikipedia.org/wiki/Covariance&quot; rel=&quot;nofollow&quot;&gt;covariance&lt;/a&gt; between $X$ and $Y$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The correlation coefficient is bounded between $-1$ (perfect negative linear relationship) and $1$ (perfect positive linear relationship).&#xA;If $X$ and $Y$ are &lt;a href=&quot;http://en.wikipedia.org/wiki/Statistical_independence&quot; rel=&quot;nofollow&quot;&gt;independent&lt;/a&gt;, we have ${\rm cor}(X,Y) = 0$. But the converse is in general not true.&lt;/p&gt;&#xA;" OwnerUserId="5669" LastEditorUserId="5669" LastEditDate="2013-07-07T12:53:02.500" LastActivityDate="2013-07-07T12:53:02.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8408" PostTypeId="4" CreationDate="2013-07-07T12:25:50.880" Score="0" Body="A measure of the degree of linear association between a pair of random variables." OwnerUserId="5669" LastEditorUserId="5669" LastEditDate="2013-07-07T12:53:07.017" LastActivityDate="2013-07-07T12:53:07.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8409" PostTypeId="5" CreationDate="2013-07-07T12:55:43.043" Score="0" Body="&lt;p&gt;The &lt;a href=&quot;http://en.wikipedia.org/wiki/Covariance&quot; rel=&quot;nofollow&quot;&gt;covariance&lt;/a&gt; between two random variables $X$ and $Y$ is a measure of the degree of linear association between them. The &lt;a href=&quot;http://en.wikipedia.org/wiki/Covariance&quot; rel=&quot;nofollow&quot;&gt;covariance&lt;/a&gt; is defined as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$${\rm cov}(X,Y)&#xA; = {\rm E} \left\[ \left( X - {\rm E}(X) \right) \left( Y - {\rm E}(Y) \right)&#xA;\right\]  = {\rm E} (XY) - {\rm E} (X) {\rm E} (Y) .$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $X$ and $Y$ are &lt;a href=&quot;http://en.wikipedia.org/wiki/Statistical_independence&quot; rel=&quot;nofollow&quot;&gt;independent&lt;/a&gt;, we have ${\rm cov}(X,Y) = 0$. But the converse is in general not true.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The magnitude of the covariance depends on the variance of both $X$ and $Y$, and it is not easy to interpret. The &lt;a href=&quot;http://en.wikipedia.org/wiki/Pearson_product-moment_correlation_coefficient&quot; rel=&quot;nofollow&quot;&gt;correlation&lt;/a&gt; is often used instead to measure the degree of linear association between $X$ and $Y$ on a scale free basis.&lt;/p&gt;&#xA;" OwnerUserId="5669" LastEditorUserId="5669" LastEditDate="2013-07-07T12:58:44.767" LastActivityDate="2013-07-07T12:58:44.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8410" PostTypeId="4" CreationDate="2013-07-07T12:55:43.043" Score="0" Body="A measure of the degree of linear association between a pair of random variables." OwnerUserId="5669" LastEditorUserId="5669" LastEditDate="2013-07-07T12:58:48.940" LastActivityDate="2013-07-07T12:58:48.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8411" PostTypeId="5" CreationDate="2013-07-07T13:29:23.760" Score="0" Body="&lt;p&gt;A &lt;a href=&quot;http://en.wikipedia.org/wiki/Copula_%28probability_theory%29&quot; rel=&quot;nofollow&quot;&gt;copula&lt;/a&gt; is a multivariate distribution with &lt;a href=&quot;http://en.wikipedia.org/wiki/Uniform_distribution_%28continuous%29&quot; rel=&quot;nofollow&quot;&gt;uniform&lt;/a&gt; marginal distributions. Copulas are mostly used to represent or to model the structure of dependence between random variables, separately from the marginal distributions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is based on &lt;a href=&quot;http://en.wikipedia.org/wiki/Sklar%27s_theorem#Sklar.27s_theorem&quot; rel=&quot;nofollow&quot;&gt;Sklar's theorem&lt;/a&gt; which shows that all multivariate distributions contain a copula, and how joint distributions are formed by coupling together marginal distributions with a copula. If you take a continuous multivariate distribution and apply the Probability Integral Transform to each margin, the resulting multivariate distribution has uniform margins and will be a copula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Copulas are widely used in many application areas including finance, insurance, actuarial science, biostatistics, hydrology and weather research.&lt;/p&gt;&#xA;" OwnerUserId="5669" LastEditorUserId="5669" LastEditDate="2013-07-07T13:50:39.213" LastActivityDate="2013-07-07T13:50:39.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8412" PostTypeId="4" CreationDate="2013-07-07T13:29:23.760" Score="0" Body="A copula is a multivariate distribution with uniform marginal distributions. Copulas are mostly used to represent/model the structure of dependence between random variables, separately from the margins." OwnerUserId="5669" LastEditorUserId="5669" LastEditDate="2013-07-07T13:50:43.923" LastActivityDate="2013-07-07T13:50:43.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8413" PostTypeId="2" ParentId="8405" CreationDate="2013-07-07T18:37:20.610" Score="5" Body="&lt;p&gt;Typical risk aversion levels lie between one and ten.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See pages 11f. in the following paper:&lt;br&gt;&#xA;&lt;a href=&quot;http://www2.gsb.columbia.edu/faculty/aang/book/Preferences%2010-08-2012.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Preferences by Andrew Ang&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Unfortunately the paper doesn't seem to be available online anymore. The final source is the following book:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://books.google.de/books?id=e5yzAwAAQBAJ&amp;amp;lpg=PP1&amp;amp;pg=PP1#v=onepage&amp;amp;q&amp;amp;f=false&quot; rel=&quot;nofollow noreferrer&quot;&gt;Asset Management: A Systematic Approach to Factor Investing (Financial Management Association Survey and Synthesis) 1st Edition&#xA;by Andrew Ang&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you know a way to access the above chapter legally please let me know in the comments, I will update the post accordingly (I leave the original link for now).&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2019-08-16T08:50:39.913" LastActivityDate="2019-08-16T08:50:39.913" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="8415" PostTypeId="2" ParentId="8406" CreationDate="2013-07-08T01:24:00.340" Score="2" Body="&lt;p&gt;I find this an applicable question to asked here and there could be several reasons for your stated regression results:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Apple could be simply more highly correlated with the Jakarta stock index than the portfolio you have given with your stated weights. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It could be that one or more of the stocks you specified in your portfolio reflects abnormal returns, such as a takeover bid, merger, analyst downgrade, or any other corporate action which may have caused the stock to be discontinuously repriced 50% higher or lower. That alone could cause a big drop in the R2. I would investigate each individual stock over the observation period and verify that the returns fall into a certain bandwidth around its own long term mean. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Not being familiar with the individual stocks of your given portfolio it could be that despite normal trading conditions that the return variability of some of the stocks and the resulting portfolio variance is way higher than the one of Apple's returns. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In summary, you need to understand the individual stock return dynamics in your portfolio if you want to explain the drop in R2. How do your standard errors look like? &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-07-08T01:24:00.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8416" PostTypeId="1" AcceptedAnswerId="8417" CreationDate="2013-07-08T10:50:15.850" Score="7" ViewCount="2335" Body="&lt;p&gt;When modelling the term structure of interest rates, one widespread possibility is using the Black-Karasinski model, which is given by the following stochastic process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d\ln{r}=[\theta(t)-a(t)\ln{r}]dt+\sigma(t)dt,$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\theta(t)$, $a(t)$ and $\sigma(t)$ are parameters which can be adjusted so that the model fits the current term structure. This is why it is considered a no-arbitrage model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we now remove the time-dependence of the parameters, we end up at an equilibrium-model with a log-normal distribution of the interest rate $r$. This is basically a logarithmic equivalent of the so-called Vasicek model, which is given by &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dr=a(b-r)dt+\sigma dz.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most striking difference between the two models is now the fact that in the logarithmic one, negative interest rates cannot occur. In literature, the absence of negative rates is presented as an advantage. However, due to negative interest rates actually appearing in derivative markets, this statement has to be reconsidered.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I want to know is the following: are there any other advantages (if there are any) of using a log-normal equilibrium model (Black-Karasinski with constant parameters) in comparison to a normally distributed equilibrium model (Vasicek)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance. &lt;/p&gt;&#xA;" OwnerUserId="5676" LastActivityDate="2013-07-08T11:49:03.993" Title="On short-rate-models: Black-Karasinski (with constant parameters) compared to Vasicek" Tags="&lt;interest-rates&gt;&lt;derivatives&gt;&lt;hullwhite&gt;&lt;term-structure&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8417" PostTypeId="2" ParentId="8416" CreationDate="2013-07-08T11:41:53.460" Score="7" Body="&lt;p&gt;I will refer to &lt;a href=&quot;http://www.amazon.de/Interest-Rate-Models-Practice-Inflation/dp/3540221492&quot; rel=&quot;noreferrer&quot;&gt;&quot;Interest Rate Models - Theory and Practice: With Smile, Inflation and Credit&quot;&lt;/a&gt; by Damiano Brigo and Fabio Mercurio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In chapter 3 (One-factor short-rate models) they have a very nice table which lists some of the properties of instantaneous short rate models. In both of your models you know the distribution of $r_t$. The huge difference between the two models is the following: For Vasicek you have both, analytical bond and analytical option prices. Instead, the Black-karasinski model does not provide an analytical solution to neither bond nor option prices. This is the main difference and of course a disadvantage of the Black-Karasinski model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally one can say, that allowing time dependent parameters has the advantage of fitting the initial yield and volatility curve. But as you can see, this has the drawback that the model can not be handled analytically. &lt;/p&gt;&#xA;" OwnerUserId="17133" LastEditorUserId="17133" LastEditDate="2013-07-08T11:49:03.993" LastActivityDate="2013-07-08T11:49:03.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8418" PostTypeId="1" CreationDate="2013-07-08T12:45:28.210" Score="2" ViewCount="180" Body="&lt;p&gt;Are there any relevant computationally intensive quantitative finance problems that could be outsourced to a trustless grid? By a trustless grid I mean that you cannot trust it with the access to your sensitive data (e.g. open positions).&lt;/p&gt;&#xA;" OwnerUserId="370" LastEditorUserId="370" LastEditDate="2013-07-08T13:00:01.833" LastActivityDate="2013-07-08T13:00:01.833" Title="Practical quantitative finance problems that could be solved in trustless grid computing environment?" Tags="&lt;numerical-methods&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8420" PostTypeId="1" CreationDate="2013-07-08T18:41:02.267" Score="4" ViewCount="6677" Body="&lt;p&gt;As part of a research project I ran a query on the Mergent FISD database using the WRDS website. The output included the CUSIPs of numerous bond issues (&gt;10000). I am using this data to run event studies and I need to obtain the CUSIP of the stock of the company that issued the bonds. Since I have over 10000 data points, I need to automate this conversion or lookup process. Any programming language or method would be fine with me in this situation.&lt;/p&gt;&#xA;" OwnerUserId="5679" LastActivityDate="2013-09-07T12:19:46.083" Title="How can you convert the CUSIP of a bond issue to the CUSIP of the company's stock/" Tags="&lt;fixed-income&gt;&lt;programming&gt;&lt;research&gt;&lt;database&gt;" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="8421" PostTypeId="2" ParentId="8420" CreationDate="2013-07-08T20:53:44.270" Score="2" Body="&lt;p&gt;You can use this website here: &lt;a href=&quot;http://activequote.fidelity.com/mmnet/SymLookup.phtml&quot; rel=&quot;nofollow&quot;&gt;http://activequote.fidelity.com/mmnet/SymLookup.phtml&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would recommend using a simple data manipulation language such as Python in order to solve your problem. You would need to write a code that read the webpage for specific CUSIP numbers and then find the specific portion of the HTML file that will contain the name of the company and pull that information out of the webpage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, in order to look up the CUSIP of 037833100, you will get the corresponding URL:&#xA;&lt;a href=&quot;http://activequote.fidelity.com/mmnet/SymLookup.phtml?reqforlookup=REQUESTFORLOOKUP&amp;amp;productid=mmnet&amp;amp;isLoggedIn=mmnet&amp;amp;rows=50&amp;amp;for=stock&amp;amp;by=cusip&amp;amp;criteria=037833100&amp;amp;submit=Search&quot; rel=&quot;nofollow&quot;&gt;http://activequote.fidelity.com/mmnet/SymLookup.phtml?reqforlookup=REQUESTFORLOOKUP&amp;amp;productid=mmnet&amp;amp;isLoggedIn=mmnet&amp;amp;rows=50&amp;amp;for=stock&amp;amp;by=cusip&amp;amp;criteria=037833100&amp;amp;submit=Search&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now your Python program could manipulate the URL by inserting different numbers for the criteria portion and then read the page and pull out the name of the company.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's some Python code you would use to get a specific stock:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import urllib2&#xA;&#xA;data = urllib2.urlopen('http://activequote.fidelity.com/mmnet/SymLookup.phtml?reqforlookup=REQUESTFORLOOKUP&amp;amp;productid=mmnet&amp;amp;isLoggedIn=mmnet&amp;amp;rows=50&amp;amp;for=bond&amp;amp;by=cusip&amp;amp;criteria=CUSIPNUMBERGOESHERE&amp;amp;submit=Search')&#xA;data_string = data.read()&#xA;start = data_string.find(&quot;&amp;lt;tr&amp;gt;&amp;lt;td height=\&quot;20\&quot; nowrap&amp;gt;&amp;lt;font class=\&quot;smallfont\&quot;&amp;gt;&quot;)&#xA;end = data_string[start:].find(&quot;&amp;lt;/font&amp;gt;&quot;)&#xA;companyName = data_string[start:][51:end]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5315" LastEditorUserId="5315" LastEditDate="2013-07-08T21:29:09.833" LastActivityDate="2013-07-08T21:29:09.833" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8422" PostTypeId="1" CreationDate="2013-07-08T21:15:26.627" Score="2" ViewCount="144" Body="&lt;p&gt;Popular yet generally academically-grounded commentators such as Annette Thau and Larry Swedroe have claimed that there is the possibility for &quot;sell-off risk&quot; in bond funds.  By this they apparently mean that &lt;strong&gt;shareholders in the bond fund who &lt;em&gt;do not sell&lt;/em&gt; experience losses as a direct result of other shareholders selling their shares in a period of steep market losses.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here's an example to illustrate:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say that stay-the-course owners (we'll call them type H, for holders) own 50% (\$500k) of a \$1mm bond fund. Panicky owners (type P) own 50% (\$500k) of the fund.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then bond prices somehow drop a historically-unprecedented 50%, to \$500k total assets in the fund. In response the P owners panic and liquidate all their holdings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fund manager has to sell holdings to meet redemptions. They sell...50% of the bonds the fund owns, which are worth \$250k.  Which means the type H owners now own 100% of a \$250k fund.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The next day, Bernanke utters the magic word, and bond prices are restored. You and the type H owners now own 100% of a \$500k fund.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Sell-off risk&quot; is any risk that at the end of the day, the 100% of the fund that you and the type L owners now own is less than \$500k.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The only mechanism I can conceive of by which this might happen is through a wide spread due to liquidity constraints, combined with imperfect accounting (e.g. the sellers are given the NAV of the fund computed under ideal circumstances, rather than the sale price of the bonds that were sold as a result of their fund sale).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Main question:&lt;/em&gt; Does this effect happen in the real world?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Follow-up to main question:&lt;/em&gt; If it does, how large an effect is it?  Is there any data that would allow this sell-off risk to be bounded?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Covering-all-the-bases question:&lt;/em&gt; Are there any other mechanisms by which this sell-off risk could occur?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a fund comprised of ten bonds (R code provided):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; library(maRketSim)&#xA;&amp;gt; &#xA;&amp;gt; mkt1 &amp;lt;- market(market.bond(i=.05), t=0)&#xA;&amp;gt; prt &amp;lt;- portfolio( &#xA;+   bonds=lapply( rep(seq(2,10,2),2), Curry(bond, mkt=mkt1) ),&#xA;+   mkt=mkt1,&#xA;+   name=&quot;Portfolio&quot;&#xA;+ )&#xA;&amp;gt; prt&#xA;Portfolio 'Portfolio' created at time 0 containing 10 bonds.&#xA;i (%)    Maturity    Par   Coupon        t&#xA; 5.00      2.0 yr  $1000   $25       0.0  &#xA; 5.00      4.0 yr  $1000   $25       0.0  &#xA; 5.00      6.0 yr  $1000   $25       0.0  &#xA; 5.00      8.0 yr  $1000   $25       0.0  &#xA; 5.00      10.0 yr  $1000   $25       0.0  &#xA; 5.00      2.0 yr  $1000   $25       0.0  &#xA; 5.00      4.0 yr  $1000   $25       0.0  &#xA; 5.00      6.0 yr  $1000   $25       0.0  &#xA; 5.00      8.0 yr  $1000   $25       0.0  &#xA; 5.00      10.0 yr  $1000   $25       0.0  &#xA;&amp;gt; summary( prt )&#xA;Portfolio 'Portfolio' of 10 bonds created at time 0. Current time is 0.&#xA;PV of portfolio is $10000&#xA;    Duration of portfolio is 4.983404&#xA;    Coupon yield is 5%&#xA;    Coupon total is $500 per year.&#xA;N.B. Portfolio summaries do not include reinvested coupons or maturing securities.  For that, place the portfolio in an account.&#xA;&amp;gt; &#xA;&amp;gt; # Then market rate rises&#xA;&amp;gt; mkt2 &amp;lt;- market(market.bond(i=.1), t=0)&#xA;&amp;gt; summary( prt, mkt=mkt2 )&#xA;Portfolio 'Portfolio' of 10 bonds created at time 0. Current time is 0.&#xA;PV of portfolio is $7891.38&#xA;    Duration of portfolio is 4.497744&#xA;    Coupon yield is 6.34%&#xA;    Coupon total is $500 per year.&#xA;N.B. Portfolio summaries do not include reinvested coupons or maturing securities.  For that, place the portfolio in an account.&#xA;&amp;gt; &#xA;&amp;gt; # Present value has dropped.  In response, half the fund holders panic.&#xA;&amp;gt; # In response, the fund manager sells half the bonds in the fund.&#xA;&amp;gt; # Assuming no transaction costs.&#xA;&amp;gt; &#xA;&amp;gt; prt2 &amp;lt;- prt&#xA;&amp;gt; prt2$bonds &amp;lt;- prt2$bonds[1:5]&#xA;&amp;gt; prt2&#xA;Portfolio 'Portfolio' created at time 0 containing 5 bonds.&#xA;i (%)    Maturity    Par   Coupon        t&#xA; 5.00      2.0 yr  $1000   $25       0.0  &#xA; 5.00      4.0 yr  $1000   $25       0.0  &#xA; 5.00      6.0 yr  $1000   $25       0.0  &#xA; 5.00      8.0 yr  $1000   $25       0.0  &#xA; 5.00      10.0 yr  $1000   $25       0.0  &#xA;&amp;gt; summary(prt2, mkt=mkt2)&#xA;Portfolio 'Portfolio' of 5 bonds created at time 0. Current time is 0.&#xA;PV of portfolio is $3945.69&#xA;    Duration of portfolio is 4.497744&#xA;    Coupon yield is 6.34%&#xA;    Coupon total is $250 per year.&#xA;N.B. Portfolio summaries do not include reinvested coupons or maturing securities.  For that, place the portfolio in an account.&#xA;&amp;gt; &#xA;&amp;gt; # Then the market rate returns to its previous value&#xA;&amp;gt; &#xA;&amp;gt; summary(prt2, mkt=mkt1)&#xA;Portfolio 'Portfolio' of 5 bonds created at time 0. Current time is 0.&#xA;PV of portfolio is $5000&#xA;    Duration of portfolio is 4.983404&#xA;    Coupon yield is 5%&#xA;    Coupon total is $250 per year.&#xA;N.B. Portfolio summaries do not include reinvested coupons or maturing securities.  For that, place the portfolio in an account.&#xA;&amp;gt; # And so does the fund value&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1184" LastEditorUserId="1184" LastEditDate="2013-07-10T14:48:33.680" LastActivityDate="2013-07-10T14:48:33.680" Title="Is there such a thing as &quot;sell-off risk&quot; in bond funds?" Tags="&lt;fixed-income&gt;&lt;funds&gt;&lt;mutual-fund&gt;" AnswerCount="0" CommentCount="12" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8423" PostTypeId="1" CreationDate="2013-07-09T03:11:33.073" Score="6" ViewCount="327" Body="&lt;p&gt;Suppose there are two time series that I want to analyze and compare. However, many, or most, of the data are zeroes for some reason. For example, consider a pair of intraday trading returns time series. In most days, the trading strategies don't trade at all, so most of the returns are zeroes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I understand their correlation? I suppose I can just keep all the zeroes, and use the raw data to calculate the correlation. Any other thoughts? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I want to identify the time period when the returns are different substantially, I must think about the zeroes carefully. For example, time period A gives 0.2% in each of 20 days out of 100 days, but time period B gives 0.1% in 40 days out of 100 days. How do I compare and determine them?&lt;/p&gt;&#xA;" OwnerUserId="4825" LastEditorUserId="4825" LastEditDate="2013-07-09T05:39:13.947" LastActivityDate="2013-07-10T00:42:06.560" Title="How to deal with zeroes in returns?" Tags="&lt;time-series&gt;&lt;correlation&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8424" PostTypeId="1" CreationDate="2013-07-09T07:46:39.613" Score="4" ViewCount="534" Body="&lt;p&gt;I am doing a research for a paper for market risk stress testing. In fact I found some information on the web about this important topic such as:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://www.google.de/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=2&amp;amp;ved=0CDQQFjAB&amp;amp;url=https://homepages.fhv.at/tb/cms/?download=BreuerCsiszar-stresstest-v1.pdf&amp;amp;ei=UL7bUcSoL4Toswb-joGYBg&amp;amp;usg=AFQjCNG-H0izzlaeul-vRQfabYZR4w2h9w&amp;amp;sig2=WW4wqcCPYZ9UVD50nBNC8w&amp;amp;bvm=bv.48705608,d.Yms&amp;amp;cad=rja&quot; rel=&quot;nofollow&quot;&gt;Stress Testing from Art to Science&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.jpmorgan.com/tss/General/Stress_Testing_Value-at-Risk/1159389400084&quot; rel=&quot;nofollow&quot;&gt;Stress Testing Value-at-Risk &lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;However, this papers are mostly theoretical and do not talk about best practices or specific examples of market risk stress tests. I really would value a simple &lt;code&gt;R&lt;/code&gt; example to understand the underlying calculations?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I appreciate your answer!&lt;/p&gt;&#xA;" OwnerUserId="5414" LastActivityDate="2017-05-19T14:36:20.627" Title="Market risk stress testing?" Tags="&lt;risk&gt;&lt;statistics&gt;&lt;research&gt;&lt;value-at-risk&gt;&lt;stress-testing&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8426" PostTypeId="1" CreationDate="2013-07-09T09:10:28.643" Score="4" ViewCount="739" Body="&lt;p&gt;I'm trying to do a portfolio optimization with an expected shortfall constraint. For this, it is necessary to know the distribution of expected portfolio returns. When doing this empirically, my plan is to assume a small investment universe in which all assets' daily returns are known. If the portfolio is optimized with a 100-day moving horizon, then on day 101, I have 100 past returns for each asset, which would also allow me to get an estimate of each of their distributions. But if I now put them together in a portfolio, what is the way to determine the portfolio return distribution?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought about an application of the central limit theorem and then assume a normal distribution accordingly, but I will not have enough assets for this, and they will not be evenly weighted in the portfolio (in fact, the portfolio will be robust, therefore only quite few assets will have positive weights).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, is it possible to take some defined distribution that is known to approximate portfolio returns more or less well, and then take this as a basis for the ES-calculation? I guess that normal and lognormal distribution both don't fit very well, so is there an alternative?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm planning to use stock indices as the assets in my universe.&lt;/p&gt;&#xA;" OwnerUserId="1817" LastActivityDate="2020-12-04T01:56:25.003" Title="Determining the portfolio return distribution to calculate CVaR/ES" Tags="&lt;portfolio-management&gt;&lt;portfolio-selection&gt;&lt;value-at-risk&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8427" PostTypeId="2" ParentId="8423" CreationDate="2013-07-09T10:06:09.370" Score="2" Body="&lt;p&gt;This depends on the nature of the zero returns. As Quartz has pointed out, if the zero returns are endogenous, then you should take the zeros into consideration as they are part of the strategy behavior - there is nothing wrong with regressing the two series in that case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, it is always a very bad idea to aggregate the time series simply to avoid the problem as you're artificially inflating your Sharpe ratio.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2013-07-09T10:06:09.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8428" PostTypeId="2" ParentId="8423" CreationDate="2013-07-09T13:55:34.353" Score="1" Body="&lt;p&gt;The answer largely depends on what are the timeseries and what kind of analysis you are going to do. Also you should clearly understand the limitations of correlation for time series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your 2 trading strategies returns example, I would try to:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Use a third time series to compare correlations of trades returns against it. For example, if both strategy are trading the same asset, you can take this asset's return time series.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use rolling window and aggregate trading strategies return values inside that window. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="370" LastActivityDate="2013-07-09T13:55:34.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8429" PostTypeId="2" ParentId="8426" CreationDate="2013-07-09T14:11:16.973" Score="5" Body="&lt;p&gt;There is a formula for calculating ES from a normal distribution. There is also a formula for ES of arbitrary distributions using a Cornish-Fisher expansions (easy for univariate processes but frustrating for multivariate).&lt;/p&gt;&#xA;&lt;p&gt;However, the most common approach is a scenario representation of the distribution. This could include using the historical distribution or it could include estimating parameters to a distribution and simulating many times from it. The second approach is very arbitrary and gives you a lot of freedom to incorporate whatever non-normalities or time-varying properties you feel are important.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastEditorUserId="41390" LastEditDate="2020-12-04T01:56:25.003" LastActivityDate="2020-12-04T01:56:25.003" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="8430" PostTypeId="1" AcceptedAnswerId="8433" CreationDate="2013-07-09T20:17:13.033" Score="1" ViewCount="2317" Body="&lt;p&gt;I have a fixed-coupon bond with the following characteristics:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Settlement: 11 July 2013&#xA;Maturity: 4 April 2022&#xA;Face Value: 100&#xA;YTM: 4.24403 %&#xA;Coupon: 4.08 %&#xA;Coupon Frequency: Annual&#xA;Day Count Convention: Actual/360&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have a C# function that according to my Bloomberg screen should churn out a price of $98.8073, but I just can't seem to get it right. Could someone please show me a paper or some code that would fix this problem? I'm only off with about a dollar so I think I'm doing something wrong with how I handle the day count.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="1128" LastActivityDate="2013-07-10T14:43:39.620" Title="Need to match my bond price calculation to that of Bloomberg, currently failing hard" Tags="&lt;fixed-income&gt;&lt;programming&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8431" PostTypeId="1" CreationDate="2013-07-09T22:10:08.990" Score="5" ViewCount="1179" Body="&lt;p&gt;If I have multiple markets (let's say 5, but the solution should be generic) trading the same stock/commodity/whatever, and the markets differ in both variable fees (which are in % of the trade order) and fix fees (which are in absolute number of $ per trade order), and suppose there exists an arbitrage opportunity on more than 2 markets at the same time, &lt;strong&gt;how do you calculate the absolutely most profitable sequence of market orders?&lt;/strong&gt; (order of orders matters)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The variable fees are not a problem, but the fix fees complicate the whole algorithm tremendously. Is this a traveling salesman type of problem? Or, is there any paper which deals with this problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fees might be something like this (shown as an example):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;1st market: $5 + 1 %&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;2nd market: $4 + 2 %&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;3rd market: $0 + 5 %&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;4th market: $10 + 0 %&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;5th market: $3 + 3 %&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2916" LastActivityDate="2015-06-12T01:17:54.647" Title="Calculating most profitable arbitrage orders on multiple market with fixed and variable fees" Tags="&lt;arbitrage&gt;&lt;algorithm&gt;&lt;algorithmic-trading&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8433" PostTypeId="2" ParentId="8430" CreationDate="2013-07-10T01:16:29.383" Score="2" Body="&lt;p&gt;I see 98.81 as well, so that is definitely correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From hearing that you are about a dollar off it looks to me as if you may have omitted accrued interest which should come to around that value given the last coupon payment date was in April and settlement is in the middle of July and a coupon of around 4 dollars.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note the distinction between clean vs. dirty bond prices, one includes accrued interest the other not. Generally the true price of a bond includes accrued interest because that will have you arrive at the net price you end up paying/receiving for the bond.  &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-07-10T14:43:39.620" LastActivityDate="2013-07-10T14:43:39.620" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8434" PostTypeId="1" CreationDate="2013-07-10T01:51:40.173" Score="1" ViewCount="277" Body="&lt;p&gt;I am receiving the following error: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Exception in thread &quot;main&quot; rcaller.exception.RCallerExecutionException: RExecutable is not defined. Please set this variable to full path of R executable binary file.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This being said, I have tested RCaller separately and have had it work (basic 1+1 example).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code I am trying to run in Java is the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;        public void computeImpliedVol(siteCall.reqObj rO) {&#xA;            try {&#xA;                double price;&#xA;                String modCP=callPut.contains(&quot;P&quot;)?&quot;put&quot;:&quot;call&quot;;&#xA;                SimpleDateFormat sf = new SimpleDateFormat(&quot;yyyyMMdd&quot;);&#xA;                DecimalFormat df = new DecimalFormat(&quot;########&quot;);&#xA;&#xA;                Date dMat = sf.parse(df.format(maturity));&#xA;                Date dt;&#xA;                double diff;&#xA;                caller.setRscriptExecutable(&quot;C:/Program Files/R/R-2.15.2/bin/Rscript&quot;);&#xA;&#xA;                String command;&#xA;&#xA;&#xA;                for (Double d : hTimeSeries.keySet()) {&#xA;                    caller.addRCode(&quot;library(RQuantLib)&quot;);&#xA;                    dt = sf.parse(df.format(d));&#xA;                    diff=(dMat.getTime()-dt.getTime())/(60.0*60.0*1000.0*24.0)/365.0;&#xA;                    if (longShort &amp;gt; 0) {&#xA;                        price = hTimeSeries.get(minDate).ask;&#xA;                    } else {&#xA;                        price = hTimeSeries.get(minDate).bid;&#xA;                    }&#xA;                    command = &quot;EOImpVol&amp;lt;-EuropeanOptionImpliedVolatility(\&quot;&quot; + modCP + &quot;\&quot;,&quot; &#xA;                           + price + &quot;,&quot; + rO.requestObject.get(d).hAClose + &quot;,&quot; + strike + &quot;,0,.03,&quot; + &#xA;                             diff + &quot;,.2)&quot;;&#xA;                     caller.addRCode(command);&#xA;                     caller.runAndReturnResultOnline(&quot;EOImpVol&quot;);&#xA;                     double rDbl[]=caller.getParser().getAsDoubleArray(&quot;EOImpVol&quot;);&#xA;                     rDbl=rDbl;&#xA;                }&#xA;            } catch (ParseException ex) {&#xA;                Logger.getLogger(optionDB.class.getName()).log(Level.SEVERE, null, ex);&#xA;            }&#xA;&#xA;        }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I try to run the &lt;code&gt;command&lt;/code&gt; in R I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;        &amp;gt; EOImpVol&amp;lt;-EuropeanOptionImpliedVolatility(&quot;put&quot;,1.9,21.18,21.0,0,.03,0.10410958904109589,.2)&#xA;        &amp;gt; EOImpVol&#xA;        $impliedVol&#xA;        [1] 0.7518471&#xA;&#xA;        $parameters&#xA;			$parameters$type&#xA;        [1] &quot;put&quot;&#xA;&#xA;        $parameters$value&#xA;        [1] 1.9&#xA;&#xA;        $parameters$underlying&#xA;        [1] 21.18&#xA;&#xA;        $parameters$strike&#xA;        [1] 21&#xA;&#xA;        $parameters$dividendYield&#xA;        [1] 0&#xA;&#xA;        $parameters$riskFreeRate&#xA;        [1] 0.03&#xA;&#xA;        $parameters$maturity&#xA;        [1] 0.1041096&#xA;&#xA;        $parameters$volatility&#xA;        [1] 0.2&#xA;&#xA;&#xA;        attr(,&quot;class&quot;)&#xA;        [1] &quot;EuropeanOptionImpliedVolatility&quot; &quot;ImpliedVolatility&quot; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I am assuming it works fine. Is something obvious occurring that I do not realize being new to this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much&lt;/p&gt;&#xA;" OwnerUserId="5262" LastActivityDate="2016-10-14T02:42:34.427" Title="RCaller &amp; RQuantlib error in java" Tags="&lt;programming&gt;&lt;r&gt;&lt;quantlib&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8435" PostTypeId="1" CreationDate="2013-07-10T09:02:22.543" Score="2" ViewCount="52" Body="&lt;p&gt;The question may sound simple however for the moment it is a brainteaser to get it right, let me explain:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the exercise is to be done on +/- 200 groups of materials (matgroups)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;one matgroup can contain 5 to 5000 materials. We want to see a price or cost evolution by month going back 3 years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Every month the materials we buy have a price and a purchased quantity. However not all materials are bought every month.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so matgroup X can consist of materials A, B, C, D with each a price and quantity in january, but in february the same matgroup X can consist of materials A, D, E, F, G, H. It can take months until material B or C is purchased again. The weights (=quantities) of the materials can be very different within the matgroup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;our 1st solution is to only keep materials in the index that have been bought in every month. Out of a set of 20.000 materials, we in the end had 3000 materials left that were valid... some matgroups only had 1 material left, some 0. No surprise that this would give very strange trends, and not very representative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2nd solution was to fill the blanks if a material isn't bought, however if this is a material with quite some volume next to it, it gets too important to be an artificially added material...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We're a bit stuck. Any experiences with something similar? Do you have enough info to think about an answer? Any suggestions/comment welcome.&lt;/p&gt;&#xA;" OwnerUserId="5687" LastActivityDate="2013-07-10T09:02:22.543" Title="How to make a historical index of a group of materials in which the set of materials changes every month?" Tags="&lt;time-series&gt;&lt;index&gt;&lt;historical-data&gt;&lt;history&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8438" PostTypeId="1" AcceptedAnswerId="8441" CreationDate="2013-07-10T13:04:01.980" Score="2" ViewCount="2582" Body="&lt;p&gt;If you're used to play with &lt;code&gt;R&lt;/code&gt;, you'll enjoy the following reproducible code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# =================================================== #&#xA;# An example of state-space monitor via Kalman filter #&#xA;# =================================================== #&#xA;&#xA;op &amp;lt;- par(no.readonly = TRUE)&#xA;Sys.setenv(TZ = 'UTC')&#xA;&#xA;# Contents:&#xA;&#xA;# 1. Installing packages&#xA;# 2. Loading packages&#xA;# 3. Custom functions&#xA;# 4. Downloading and preparing data&#xA;# 5. Cross-Betas Kalman filtering&#xA;&#xA;# *********************************&#xA;# 1. Installing packages&#xA;# *********************************&#xA;&#xA;install.packages('KFAS')&#xA;install.packages('latticeExtra')&#xA;install.packages('quantmod')&#xA;&#xA;# *********************************&#xA;# 2. Loading packages&#xA;# *********************************&#xA;&#xA;require(compiler)&#xA;require(latticeExtra)&#xA;require(KFAS)&#xA;require(quantmod)&#xA;&#xA;# *********************************&#xA;# 3. Custom functions&#xA;# *********************************&#xA;&#xA;# This function returns the time varying state-space representation &#xA;# parameters of a linear model which represents y ~ X&#xA;&#xA;Kalman.beta &amp;lt;- cmpfun(function(y, X)&#xA;{&#xA;  model &amp;lt;- regSSM(y = y, X = cbind(1, X), H = NA, Q = diag(NA, 2))&#xA;  object &amp;lt;- fitSSM(inits = rep(0, 3), model = model)$model&#xA;      KFAS &amp;lt;- KFS(object = object)&#xA;      alpha.beta &amp;lt;- xts(t(KFAS$alphahat), index(y))&#xA;  colnames(alpha.beta) &amp;lt;- rep(paste(colnames(y), 'vs' , colnames(X)), 2)&#xA;  return(alpha.beta)&#xA;})  &#xA;&#xA;# *********************************&#xA;# 4. Downloading and preparing data&#xA;# *********************************&#xA;&#xA;env &amp;lt;- new.env()&#xA;Symbols &amp;lt;- c('SPY', 'QQQ', 'XLF', 'TLT')&#xA;getSymbols(Symbols = Symbols, env = env, from = '1950-01-01')&#xA;args &amp;lt;- eapply(env = env, FUN = function(x){ClCl(x)})&#xA;X &amp;lt;- na.omit(do.call(what = merge, args = args))&#xA;colnames(X) &amp;lt;- Symbols&#xA;xyplot(X)&#xA;&#xA;# *********************************&#xA;# 5. Cross-Betas Kalman filtering&#xA;# *********************************&#xA;&#xA;Betas &amp;lt;- NULL&#xA;k &amp;lt;- 0&#xA;&#xA;for(i in 1:ncol(X))&#xA;{&#xA;  for(j in (1:ncol(X))[-i])&#xA;  {&#xA;    k &amp;lt;- k + 1&#xA;    Betas[[k]] &amp;lt;- Kalman.beta(y = X[,i], X = X[,j])[,2]&#xA;  }&#xA;}&#xA;&#xA;Beta.matrix &amp;lt;- do.call(what = merge, args = Betas)&#xA;colnames(Beta.matrix) &amp;lt;- gsub(pattern = '.', fixed = TRUE, &#xA;                              x = colnames(Beta.matrix), replacement = ' ')&#xA;xyplot(Beta.matrix, superpose = FALSE, auto.key = FALSE,&#xA;       main = '')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What does this code do? It basically uses Kalman filter to estimate time varying $\beta_{t}$ of each asset against each other and plot them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the matter with that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use a simple linear regression model to estimate $\beta$ constant over time you will see it often happens, as instance, that $\beta_{t}&amp;lt;1&amp;lt;\beta$ or $\beta_{t}&amp;gt;0&amp;gt;\beta$ for the most of the time series... which is really counterintuitive!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could SPY be negatively correlated with QQQ while it's quite obvious they are strongly correlated and $\beta \approx 1$? And so on...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would you explain this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anything wrong with my code?&lt;/p&gt;&#xA;" OwnerUserId="3058" LastActivityDate="2017-06-30T21:37:06.300" Title="Counterintuitive time varying Beta with Kalman filter" Tags="&lt;time-series&gt;&lt;r&gt;&lt;correlation&gt;&lt;beta&gt;&lt;kalman&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8441" PostTypeId="2" ParentId="8438" CreationDate="2013-07-10T19:15:42.817" Score="2" Body="&lt;p&gt;This is definitely not a Kalman filter's issue: if you replace this line of code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;args &amp;lt;- eapply(env = env, FUN = function(x){ClCl(x)})&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with this one&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;args &amp;lt;- eapply(env = env, FUN = function(x){ClCl(x)})[Symbols]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;eapply()&lt;/code&gt; will keep the order of the original Yahoo query from &lt;code&gt;quantmod&lt;/code&gt;. You can check and you will see each $\beta_{t}$ matches about the $\beta$ from simple OLS linear regression CAPM-like.&lt;/p&gt;&#xA;" OwnerUserId="3058" LastActivityDate="2013-07-10T19:15:42.817" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8443" PostTypeId="1" CreationDate="2013-07-11T13:19:24.297" Score="2" ViewCount="1166" Body="&lt;p&gt;I want to calculate annual excess returns on portfolios using monthly returns for a CAPM (for the assets in the portfolio as well as for the benchmark), in order to have more information on the correlations, more precise betas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a few questions about this (may justify separate postings):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Because the CAPM comes from monthly correlations, I shall calculate&#xA;excess returns for each month, right? But if I only have year-end&#xA;snapshots of portfolios, I should chain the monthly excess returns&#xA;up (compound them) and multiply the initial value with each surprise&#xA;return? Is this essentially the same as doing the annual&#xA;calculation? (I suspect an argument about integrating a continuous&#xA;price process into some return observations anyway.)&lt;/li&gt;&#xA;&lt;li&gt;Is it standard&#xA;practice to adjust (slightly) for shorter months having somewhat&#xA;less information on the correlations? Shall I weight by the number&#xA;of days or only trading days before return dates?&lt;/li&gt;&#xA;&lt;li&gt;I do not have a principled approach on which time period to use for the beta-calculation. The observations are from 1999-2007, and it was already hard to get returns for only these year, so I do not use retrospective, historical returns. This is defensible, right?&lt;/li&gt;&#xA;&lt;li&gt;Relatedly, some instruments end trading during these years, or start only later. Those betas should be adjusted somehow to acknowledge less information about them? Or the point estimate is just the point estimate?&lt;/li&gt;&#xA;&lt;li&gt;Is it OK to use&#xA;the monthly T-bill rate as the risk-free rate, changing from month&#xA;to month? (I have average SAY yields with day-counting on the&#xA;ACT/360 -- which I shall correct for, I presume.)&lt;/li&gt;&#xA;&lt;li&gt;All these&#xA;portfolios are Swedish. Is it good practice to include the currency&#xA;risk in the correlations with expressing all returns (incl. the&#xA;benchmark) in SEK?&lt;/li&gt;&#xA;&lt;li&gt;Many holdings are diversified internationally,&#xA;but not completely. Is it appealing to use an MSCI all-world&#xA;benchmark (MSCI ACWI IMI GR USD converted into SEK) as people&#xA;&quot;should&quot; diversify, so all extra risk is, well, extra, so it makes&#xA;much more sense to compare everything to an MSCI World (viz.&#xA;developed markets only) benchmark?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot!&lt;/p&gt;&#xA;" OwnerUserId="5693" LastActivityDate="2014-04-10T14:07:50.007" Title="annual excess returns from CAPM on monthly total returns" Tags="&lt;returns&gt;&lt;beta&gt;&lt;coherent-risk-measure&gt;&lt;currency&gt;&lt;capm&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8444" PostTypeId="1" CreationDate="2013-07-11T18:17:53.867" Score="0" ViewCount="511" Body="&lt;p&gt;I am trying to understand how changes in economic indicators like Unemployment Rate, Inflation Rate, and Consumer Sentiment affect the portfolio values. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For that I want to measure the correlation between a given economic indicator and S&amp;amp;P SPDRs. I am using scipy stats package and Pearson correlation for that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see unintuitive correlations like&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;corr(fin SPDR, Consumer Sentiment) &gt; 0.75 , corr(consumer staples SPDR, Consumer Sentiment) = -0.5 [ p-value &amp;lt;&amp;lt; 0.01 ]&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;corr(housing starts, tech SPDR) = -0.37 , corr(Housing Starts, consumer staples SPDR) = -0.57&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I would think that when the consumer sentiment is high, the consumer staples should also reflect this positivity. But I see negative correlation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure if the problem is due to time lag between the economic indicator turning positive and its positive benefits experienced by the companies in a given sector. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Correlations were conducted on SPDR prices and various economic indicators over last 10 years of time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anyone who has done analysis on correlations between economic indicators and market prices help me make sense of these results?&lt;/p&gt;&#xA;" OwnerUserId="5696" LastEditorUserId="35" LastEditDate="2013-07-11T18:34:53.890" LastActivityDate="2013-11-09T18:47:09.840" Title="Non-intuitive correlation between S&amp;P sector indexes and economic indicators" Tags="&lt;equities&gt;&lt;interest-rates&gt;&lt;correlation&gt;" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="8445" PostTypeId="1" CreationDate="2013-07-11T20:33:55.583" Score="2" ViewCount="139" Body="&lt;p&gt;Last month when FOMC meeting decision went out that fed would start to exit QE3, immediately  we saw a deleveraging effect: SPY went down, GLD went down, and LQD (bond) went down, but US dollars went up.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most of all, I would like to know what's everyone's view on what was driving these market movements after the announcement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, an interesting idea is that the covariance structure at these kind of special moment would degenerate to $ee^{t}$  form, which means a perfect correlation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder if there is any reference on quantitative research on deleveraging's measurement, detection and prediction?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way to understand the event is by applying signal analysis, for example the impulse response view. I wonder if anyone has a comment on how the trend/reversal formation for event like this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, I got a vote down for my previous post because of &quot;common knowledge to those who study finance&quot;.  As someone who worked for a hedge fund prototyping a high dimensional trading strategy with sharpe ratio &gt;1.8,  I really don't know this knowledge would be common.  The reason is obvious, because the market is of a high dimension monster, so there would never be one or two factors like in &quot;classic&quot; economy view that you see on TV or in textbooks, as every one who really practice with serious investment would know. So why not let us be a little bit more open so people from different background can participate, so that everyone can learn ? &lt;/p&gt;&#xA;" OwnerUserId="2210" LastEditorUserId="2210" LastEditDate="2013-07-11T20:44:12.747" LastActivityDate="2013-07-12T04:57:27.467" Title="To understand FOMC events and its impact on the market" Tags="&lt;modeling&gt;&lt;forecasting&gt;&lt;covariance&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8446" PostTypeId="1" CreationDate="2013-07-11T22:08:13.700" Score="3" ViewCount="258" Body="&lt;p&gt;I'm learning this material and I can follow the derivation of the BSM PDE fairly well.  The only problem I have is there is an assumption in the derivation (that I am reading) that a stock price movement of exactly 1 standard deviation will produce a self financing delta hedge and thus should earn the risk free rate and everything falls into place from there.  Where did the assumption of 1 standard deviation come from?  It seems like it could have been any movement (y) and the PDE would adjust so then the option price formula would adjust and the market maker would then have a self financing portfolio when the movements are always (y).  Am I missing some part of Ito's Lemma that makes the one standard deviation the magic number?&lt;/p&gt;&#xA;" OwnerUserId="5698" LastEditorUserId="35" LastEditDate="2013-07-12T00:56:24.593" LastActivityDate="2018-06-22T16:40:18.860" Title="The reason behind the selection of a 1 standard deviation movement for self financing delta hedge" Tags="&lt;black-scholes-pde&gt;" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8447" PostTypeId="2" ParentId="8445" CreationDate="2013-07-12T04:16:06.743" Score="2" Body="&lt;p&gt;My answer will be very non-quantitative but the resulting models are actually quite mathematical but I like to stick to a general overview because of the proprietary nature of those models. Here couple thoughts though:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;You can't just try to explain market moves by a few indicators or a single Fed speech (by the way, the market hugely misread those statements, 2 days ago in my book was a game changer and put and end to all QE-end speculation, it will continue at current rates without question). Currencies, equities, ... move as a function of a whole host of variables and the relationships are entirely dynamic and ever changing. I recommend to learn to look at the big picture and take everything into perspective when modeling a new strategy rather than trying to get bogged down by forcing a relationship between Employment and SPX returns, for example.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The market reacted to the Fed speech a few months ago entirely differently than it reacted to the Q&amp;amp;A 2 days ago in a for many unpredictable pattern (though I repeat I found it a clear game changer where the dollar will be sold into the next couple weeks). This fact points to the possibility (and for me empirical fact) that market participants on average may react at most times in predictable patterns but such patterns are strongly anchored to, what I call, stage-disequilibriums. What I mean with that is that investors, traders, central banks react as a function of what their current utility is and that utility is dynamic. As a result, estimating and modeling the correct utility and &quot;calibrating&quot; your model as a function of the current &quot;market utility&quot; is a much more fruitful endeavor than looking to squeeze static relationships out of equity markets and economic indicators. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;To elaborate what I mean with &quot;market utility&quot;: There where market stages when injecting money by a central bank was seen as a huge negative to equity markets because market participants thought that the central bank had knowledge of less optimistic economic developments than what the broad public had. The point leads to the need to find some sort of utility (I use this term very loosely here) that reflect the way how investors react to a complete set of market driving variables. So, instead of modeling each variable and trying to estimate its impact on future market returns, the exercise would be to find one utility that optimizes how the whole set of variables and their changes impact market behavior. When such utility can be shown to be consistent and persistent over time then one can speak of having identified a specific &quot;market stage&quot; or &quot;utility stage&quot;. Key is to appreciate the fact that a) dependent variables my drop out or be added from one stage to the next and b) that the relationship between the dependent variables remains static within the same stage but may change entirely between stages. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Utility or utility stages can and are very different from one asset class to another for logical reasons: A perfect example is the different utility stages between the U.S. dollar and the Australian dollar: A big function of the Australian currency utility is its dependency on the Chinese economy and changes in market perception of future Chinese growth rates, labor conditions, imports and exports. The U.S. dollar on the other hand hardly displays any dependency on such variables and is currently much more driven by when investors will dissect the &lt;strong&gt;intended&lt;/strong&gt; rhetoric of Ben Bernanke. For example, right now most market participants still believe that Fed action will very much be a function of economic results this year, 2013, while I built into the current utility that no matter whether unemployment drops below 6.5% or not Fed will not reduce its accommodative state in 2013 anymore. This points to two important facts: a) my model predicts dollar moves right now in very different way from the majority of market participants, my fair value of the dollar lies a lot lower than what the market believes, and b) my USD utility model is much less sensitive to economic indicators at this moment but much more sensitive to market perception of expected Fed behavior vs my model Fed behavior. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I like to stress, as it is a &lt;strong&gt;very important point&lt;/strong&gt; that this approach is not predictive in nature but reactive. The model takes into account how the market just reacted to certain economic releases or a speech. Thus, if the model is in disagreement with market reaction then the model would suggest to implement positions against short-term momentum, if the model agrees with market reaction but established a more elaborate market participation then the model would suggest a position in alignment with short-term momentum, to give just two examples. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The key take-away&lt;/strong&gt; here is that I witnessed that identifying different market stages quantitatively will improve the quality of the model (reduction in tracking error, variability between model output and future realized market behavior) by orders of magnitude in terms of interpreting market reaction to key variables correctly. The big difference between this approach and other models is that an attempt is not made to fit individual dependent variables to a market that has proven to strongly dislike static correlation assumptions and it also differs from multi factor models that look for a linear or non linear relationship between different dependent variables to predict market returns. My approach is not predictive in nature but reactive and this approach has shown to be fairly accurate in identifying and reflecting changes in the overall utility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;** One sentence summary**: A model can be identified that reflects changing perception (utility) by market participants to what market-drivers identify as influential variables, thus such model does not attempt to establish a static relationship (which may be re-calibrated but is nonetheless static) between market returns and a combination of dependent variables, but it identifies different market stages where in each stage market perception to a model-dependent variable combination has been shown to be extremely stable.  &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-07-12T04:57:27.467" LastActivityDate="2013-07-12T04:57:27.467" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8448" PostTypeId="2" ParentId="8446" CreationDate="2013-07-12T05:11:21.667" Score="2" Body="&lt;p&gt;The self-financing model that leads to the Black Scholes formula generally only makes distributional assumptions not assumptions about the absolute variability of the underlying assets. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Was such assumption part of the discretization approach? Because then infinitesimal asset value changes without changes in positions in the assets would form the definition of a self-financing portfolio and then such infinitesimal change may include bounds or specific values of asset variability. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the way you said it was stated I would say is &lt;strong&gt;incorrect&lt;/strong&gt; because a self-financing portfolio can include an asset that has any kind of variability as long as the model distributional assumptions are respected. The assumed distribution is of course wrong but market accepted standard in pricing derivatives that utilize the derived B-S framework. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-07-12T05:11:21.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8449" PostTypeId="1" CreationDate="2013-07-12T06:49:29.060" Score="1" ViewCount="537" Body="&lt;p&gt;can we use alpha value to calculate option price instead of historical volatility.&#xA;And if we can please explain how. I am doing my MMS in Finance and this for a project i am doing. the project is about tweaking the black scholes formula on option pricing.&lt;/p&gt;&#xA;" OwnerUserId="5699" LastActivityDate="2013-07-13T13:29:18.090" Title="how to calculate more efficient volatility figure than historical volatility?" Tags="&lt;volatility&gt;&lt;option-pricing&gt;&lt;stochastic-volatility&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8450" PostTypeId="2" ParentId="8449" CreationDate="2013-07-12T07:48:00.030" Score="2" Body="&lt;p&gt;Black Scholes makes the assumption of deterministic (time varying) volatility of the underlying asset. Also, the volatility input to the option pricing model is implied by nature and does not rest on realized historical volatilities. Think about it, the whole notion of being able to price a derivative with contingent future payoff rests to large degree on the assumed &lt;strong&gt;future&lt;/strong&gt; variability of the underlying asset. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore if you look to make changes to the Black Scholes framework then you can start with modeling &lt;strong&gt;implied&lt;/strong&gt; volatility, not &lt;strong&gt;historical realized&lt;/strong&gt; volatility. The next step would be to relax more assumptions of the BS framework to account for discontinues jumps, varying interest rates, different dividend models, and such forth. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But try to remove yourself from considering realized volatility metrics as they are of no use to the BS framework unless of course you utilize historical volatility to model your implied volatility which you then plug into BS. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-07-12T07:48:00.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8451" PostTypeId="1" CreationDate="2013-07-12T12:24:28.633" Score="2" ViewCount="121" Body="&lt;p&gt;Currently iam working on my master thesis which is about risk adjusted returns in the Asia Pacific REIT market. The goal of the paper is to determine/find variables that conceive explanatory power over the IV. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To determine this I also performed a FE regression based on countries. The result are more or less in line with FE for the whole sample (with firmID as dummy) and OLS regression. &#xA;The suprising thing actually is that for the whole sample period (so still with country dummies) some of the variables seem to be insignificant, while on the contrary, if the sample is split up in 2 sub-periods, they show to have a significant effect in both the periods. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I find this rather strange that a variable is significant for both the sub-periods, but fail to do so for the whole sample period. What could be the reason the reason for this? Is this a finance problem or should I be looking more in the statistical direction?&#xA;For those with an finance background, the variables which show this pattern are market capitalization, price-to-book ratio and dividend yield. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've uploaded the FE regression result for the Australian market. Hopefully this works clarifying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS. Lagrange and Hausman test favored FE model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whole sample regression 2002-2012; &lt;a href=&quot;http://www.freeimagehosting.net/newuploads/pyjot.png&quot; rel=&quot;nofollow&quot;&gt;http://www.freeimagehosting.net/newuploads/pyjot.png&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sub period 1 (2002-2012); &lt;a href=&quot;http://www.freeimagehosting.net/newuploads/d3ull.png&quot; rel=&quot;nofollow&quot;&gt;http://www.freeimagehosting.net/newuploads/d3ull.png&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sub period 2 (2008-2012); &lt;a href=&quot;http://www.freeimagehosting.net/newuploads/betwt.png&quot; rel=&quot;nofollow&quot;&gt;http://www.freeimagehosting.net/newuploads/betwt.png&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5097" LastEditorUserId="5097" LastEditDate="2013-07-12T12:31:27.320" LastActivityDate="2013-07-12T12:31:27.320" Title="Insignificant or significant explanatory power over risk adjusted returns?" Tags="&lt;equities&gt;&lt;returns&gt;&lt;regression&gt;&lt;auto-correlation&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8452" PostTypeId="1" AcceptedAnswerId="16950" CreationDate="2013-07-12T15:22:26.153" Score="12" ViewCount="2289" Body="&lt;p&gt;The theory of the so called Dragon-Kings, esp. by Didier Sornette (ETH Zürich), basically states that financial crises and crashes are predictable (contrary to the &lt;a href=&quot;http://en.wikipedia.org/wiki/Black_swan_theory&quot;&gt;theory of black swans&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following paper gives an overview (see esp. section 5, p. 20f. for predictability):&lt;br&gt;&#xA;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2191590&quot;&gt;Dragon-Kings: Mechanisms, Statistical Methods and Empirical Evidence by Didier Sornette, Guy Ouillon&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question&lt;/strong&gt;&lt;br&gt;&#xA;Do you know any software, tools, Excel sheets and/or preferably R code/packages with which the predictability of Dragon-Kings can be tested?&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2015-07-30T09:53:21.987" LastActivityDate="2019-02-20T22:17:28.480" Title="Tools/R code for predicting Dragon-Kings" Tags="&lt;r&gt;&lt;prediction&gt;&lt;software&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="8454" PostTypeId="1" CreationDate="2013-07-13T12:12:56.500" Score="1" ViewCount="331" Body="&lt;p&gt;Could someone please help me translate what this is saying on page P15, section 4.2:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.ntuzov.com/Nik_Site/Niks_files/Research/papers/stat_arb/Ahmed_2009.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.ntuzov.com/Nik_Site/Niks_files/Research/papers/stat_arb/Ahmed_2009.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When the order rates are time-varying probabilities must be computed&#xA;  via Monte Carlo. A simple algorithm is as follows. There are six types&#xA;  of orders; buy/sell and market/limit/cancel. For each type of order&#xA;  there are multiple rates depending on the distance to the bid/ask,&#xA;  i.e. if the bid is at the tenth highest tick level then there are ten&#xA;  limit buy orders.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Let $\lambda_i$, $i \in \mathcal{I}$ be the collection of all order&#xA;  rates and $\boldsymbol{x}_t = (x_1, \ldots, x_n)$ be the current state&#xA;  of the order book, as specified in [1]. Then there are a fixed and&#xA;  finite number of possible states $x_t+1$ can take on. The next state&#xA;  of the order book is completely determined by which order arrives&#xA;  first. It is known that if $X_i \sim \exp(\lambda_i)$ then&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Therefore &lt;strong&gt;to determine the next state of the order book we just&#xA;  sample $u \sim U(0,1)$ then partition the interval $(0, 1)$ according&#xA;  to the above probabilities to determine which order arrived first&lt;/strong&gt;.&#xA;  After the next state of the order book is computed we recompute the&#xA;  $\lambda_i$'s since they depend on the order book, i.e. $x_t$ is an&#xA;  inhomogeneous Markov chain, and repeat to generate an entire sample&#xA;  path. &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Let $A$ be the set of $\omega$ where the midprice increases, to&#xA;  compute its probability we simulate sample paths until there is a&#xA;  change in the midprice and compute $I_A(\omega)$ then estimate the&#xA;  probability as&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ok, I have made some progress:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the comment below says, X is exponentially distributed. However, I do not get what calculating the &quot;distribution of the minimum exponential random variable&quot; is for?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, once we have done this we then (seem to) plot the uniform distribution between 0 and 1 and then plot the probabilities on the x-axis, and, I think, look for the probability with the greatest area?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;I really don't understand why this tells us the next state?? What exactly is finding the minimum exponential random variable telling us?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Why do we need to use the uniform distribution?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="5168" LastEditorUserId="2543" LastEditDate="2013-12-05T18:07:31.107" LastActivityDate="2013-12-05T18:07:31.107" Title="Help with understanding a normal distribution/probability question" Tags="&lt;time-series&gt;&lt;correlation&gt;&lt;probability&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8455" PostTypeId="2" ParentId="8449" CreationDate="2013-07-13T13:29:18.090" Score="4" Body="&lt;p&gt;The standard realized volatility calculation assumes an underlying model: geometric Brownian motion with constant drift and volatility. Then realized vol squared is an unbiased estimator of the process volatility squared.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to move beyond Black Scholes then you have two possibilities: look at a different formal model and the estimators for its values; or assume that volatility is stochastic but varies more slowly than your estimation window, so you can (roughly) assume it's constant for that window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think by &quot;alpha value&quot; you're referring to the alpha parameter in the GARCH model? There are lots of references on estimators for GARCH process parameters, though I don't have any at hand right now. Trying googling for GARCH estimation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, though, people do the second more than the first, even though it's difficult to justify formally. One way you can give yourself more confidence there is to use a more accurate estimator of realized vol than the usual close-to-close one, since then you can use a shorter historical window for the same uncertainty on your volatility estimate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Two usual ways there: use regularly-spaced data that's more frequent than close-to-close (eg sampled every 10 mins from realtime data); or use high-low-open-close (HLOC). There's a really cool paper by Garman and Klass on estimating vol using HLOC data which I love, and gives an estimator with a variance about 9x smaller than the variance on the close-to-close realized vol estimator (so std dev of the estimate is ~3x more accurate):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cims.nyu.edu/~ra1221/riskPortfolio/garmanKlass.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.cims.nyu.edu/~ra1221/riskPortfolio/garmanKlass.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5705" LastActivityDate="2013-07-13T13:29:18.090" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8456" PostTypeId="1" AcceptedAnswerId="8465" CreationDate="2013-07-13T14:37:15.817" Score="1" ViewCount="211" Body="&lt;p&gt;I was wondering whether the option implied probability density of the log returns:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$x = \ln\left(\frac{S}{S_0}\right)$ with S the value of a certain stock, is always symmetric ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was asking myself this question because we model the &quot;randomness&quot; in the log return with a Brownian motion which is symmetric around zero, which leads to a model of the form:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dx_T = a(x,t)dt+b(x,t)dW_T$ with $W_T$ the Brownian motion. Where we simply have a drift where we superimpose a random walk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this kind of model there can't be a skewness, now I was wondering whether there were any models that take skewness into account and if it's already been seen in the distribution of the log returns?&lt;/p&gt;&#xA;" OwnerUserId="5708" LastEditorUserId="35" LastEditDate="2013-07-14T13:51:08.070" LastActivityDate="2016-08-25T00:20:55.177" Title="Symmetry of option-implied probability density" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;probability&gt;&lt;option-strategies&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8459" PostTypeId="2" ParentId="8454" CreationDate="2013-07-13T16:10:53.543" Score="2" Body="&lt;p&gt;My understanding is the following. They want to determine the next state of the order book. So, they need to know which order comes first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way to find which order arrives first could be to generate a new $X_i$ for all $i \in \mathcal{I}$, and to identify the smallest. This would not be efficient.&#xA;The alternative that they mention relies on&#xA;$$&#xA;p_k := {\rm Pr}[\min (X_i : i \in \mathcal{I}) = X_k]&#xA;= \frac{\lambda_k}{\sum_{i \in \mathcal{I}} \lambda_i},&#xA;$$&#xA;which provides the probability that the $k$th is the smallest. Obviously, these probabilities sum to one. The idea is to partition the interval $[0, 1]$ into disjoint segments of size $p_k$, one for each order $k$. To determine which order comes first, one just needs to sample a uniform random variable on $[0,1]$, and determine in which segment it belongs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit: example of determination of the first order&lt;/strong&gt;&lt;br&gt; &#xA;Suppose that $\mathcal{I} = \{1, 2, 3\}$, and $\lambda_1 = 2, \lambda_2 = 5, \lambda_3 = 3$. So, $p_1 = 0.2, p_2 = 0.5, p_3 = 0.3$, and the segments are [0, 0.2], (0.2, 0.7] and (0.7, 1].&lt;br&gt;&#xA;Let $u$ denote the value sampled from the uniform distribution. If $u \in [0, 0.2]$ then $k = 1$, if $u \in (0.2, 0.7]$ then $k = 2$, and if $u \in (0.7, 1]$ then $k = 3$.&lt;/p&gt;&#xA;" OwnerUserId="5669" LastEditorUserId="5669" LastEditDate="2013-07-14T08:22:40.717" LastActivityDate="2013-07-14T08:22:40.717" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="8461" PostTypeId="1" CreationDate="2013-07-13T16:32:41.430" Score="-4" ViewCount="188" Body="&lt;p&gt;Is there a native and free API and DB to request information such as: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;All the companies which their &lt;code&gt;P/E&lt;/code&gt; ratio is greater than 50 &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The closing prices of stock &lt;code&gt;$XYZ&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="4800" LastEditorUserId="4800" LastEditDate="2017-06-15T06:35:29.227" LastActivityDate="2017-06-15T06:35:29.227" Title="API to perform queries on stocks and financial derivatives" Tags="&lt;programming&gt;&lt;data&gt;&lt;database&gt;" AnswerCount="1" CommentCount="6" ClosedDate="2013-07-14T00:51:56.387" ContentLicense="CC BY-SA 3.0" />
  <row Id="8462" PostTypeId="2" ParentId="8461" CreationDate="2013-07-13T19:40:59.120" Score="1" Body="&lt;p&gt;Try the yahoo screener:&#xA;&lt;a href=&quot;http://screener.finance.yahoo.com/newscreener.html&quot; rel=&quot;nofollow&quot;&gt;http://screener.finance.yahoo.com/newscreener.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The java version will run on windows/osx/linux and you can download to a csv.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&#xA;the java version no longer works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This link is the best yahoo has.&#xA;&lt;a href=&quot;https://screener.finance.yahoo.com/stocks.html&quot; rel=&quot;nofollow&quot;&gt;https://screener.finance.yahoo.com/stocks.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quandl has all of this data as well so people can generate their own data.&lt;/p&gt;&#xA;" OwnerUserId="1368" LastEditorUserId="1368" LastEditDate="2016-05-28T14:20:19.803" LastActivityDate="2016-05-28T14:20:19.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8463" PostTypeId="2" ParentId="8446" CreationDate="2013-07-13T23:28:29.620" Score="2" Body="&lt;p&gt;Your questions lacks a bit of detail. However: Since you are referring to a PDE it appears as if the Black Scholes formula is proved by considering a discrete model (1 standard-deviation move per time-step), then taking a limit &quot;time-step size to zero&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, in a tree, you are essentially approximating the normal distributed increment with a Bernoulli distributed increment (you can reach only two states per time-step and node) and the relation of these two states is that &quot;one standard-deviation&quot;. In the limit this will converge to the normal distribution with the respective standard deviation (Theorem of Donsker).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I you would use some other variability it would converge to some other normal distribution (and not to your model).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put differently: It is assumed that the approximation has only two states and given the time step, it is necessary that these two states differ by one standard deviation to obtain the desired normal distribution in the limit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(This is just a guess, since your questions lacks detail on how the proof was actually done).&lt;/p&gt;&#xA;" OwnerUserId="3548" LastActivityDate="2013-07-13T23:28:29.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8464" PostTypeId="2" ParentId="8397" CreationDate="2013-07-14T01:48:18.650" Score="1" Body="&lt;p&gt;Haver analytics has this data, though its not cheap&lt;/p&gt;&#xA;" OwnerUserId="1368" LastActivityDate="2013-07-14T01:48:18.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8465" PostTypeId="2" ParentId="8456" CreationDate="2013-07-14T10:42:44.183" Score="2" Body="&lt;p&gt;No it's not always symmetric!&#xA;There are a few models which take skewness into account. And it would seem weird to me that they'd build models to account for skewness if it wouldn't exist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example of these models is the CGMY model, the name comes from the parameters which are used to model the different moments like kurtosis and SKEWNESS. I don't know the details and I don't have a link since I've only seen it on internal papers at the university. But for as far as I've seen Google does just fine. If you look it up You'll find several CGMY densities where some have kurtosis and others skewness.&lt;/p&gt;&#xA;" OwnerUserId="5708" LastEditorUserId="5708" LastEditDate="2013-07-15T20:46:39.567" LastActivityDate="2013-07-15T20:46:39.567" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8466" PostTypeId="5" CreationDate="2013-07-14T11:14:40.927" Score="0" Body="&lt;p&gt;The bootstrap is a statistical method used to obtain reliable standard errors, confidence intervals, and other measures of uncertainty for a wide range of problems.&#xA;The key idea is to create replicate datasets by resampling from the original data, and to compute the quantities of interest in the data analysis on the replicated datasets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the &lt;a href=&quot;http://en.wikipedia.org/wiki/Bootstrapping_%28statistics%29&quot; rel=&quot;nofollow&quot;&gt;Wikipedia article&lt;/a&gt; for more information.&lt;/p&gt;&#xA;" OwnerUserId="5669" LastEditorUserId="5669" LastEditDate="2013-07-14T12:09:58.877" LastActivityDate="2013-07-14T12:09:58.877" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8467" PostTypeId="4" CreationDate="2013-07-14T11:14:40.927" Score="0" Body="Resampling technique for estimating standard errors and computing confidence intervals of sample based quantities." OwnerUserId="5669" LastEditorUserId="5669" LastEditDate="2013-07-14T13:49:33.343" LastActivityDate="2013-07-14T13:49:33.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8468" PostTypeId="2" ParentId="7911" CreationDate="2013-07-14T14:04:20.990" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;1.Is it correct, that the coefficients are now different to the coefficients of the arima output?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It seems right that the ARMA coefficients are different. Indeed, in the second model, the GARCH component will capture fluctuations that the ARMA component will not have to capture, resulting in different ARMA parameter estimates.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;2.This is the acf of the observations, but I want to have the acf AND the pacf of the residuals. How can I get them?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Here is a suggestion:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;resid2 &amp;lt;- as.numeric(residuals(model2, standardize=FALSE))&#xA;Acf(resid2)&#xA;Acf(resid2, type = &quot;partial&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As a complement, I would suggest to shun choosing the order of the ARMA and GARCH parts separately/sequentially. To choose the order of the model, it is preferable to consider the &quot;full&quot; models (i.e.., ARMA($p$, $q$)-GARCH($r$, $s$)) for varying choices of $p,q,r$ and $s$, and to chose the appropriate model by comparing models with likelihood ratio tests if the models are nested or with information criteria (e.g., AIC or BIC) if the models are not nested.&lt;/p&gt;&#xA;" OwnerUserId="5669" LastActivityDate="2013-07-14T14:04:20.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8469" PostTypeId="2" ParentId="8446" CreationDate="2013-07-14T15:00:18.293" Score="-1" Body="&lt;p&gt;I figured this out after studying.  I'll try and do a better job of communicating my question in my answer.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My basic question was when a market maker is in a delta-hedged position after writing a vanilla call option why is it that a stock movement of one standard deviation produces a profit of $0 (approximately), ie the movement in value of calls = the movement in value of stock position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understood that it was due to interpreting the gamma coefficient in the BS PDE as a stock price movement, which would produce a movement in the call values exactly equal to the movement in the stock values.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I didn't understand was why the gamma coefficient had to be sigma^2 x S^2, which if interpreted as a stock price movement produced that magic number effect.  Most of the derivations I saw just went from one line to the next without explaining where that coefficient came from.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I was working through the derivation of Ito's Lemma I figured it out, that coefficient is necessary if the underlying asset's distribution is modeled as a geometric browinan motion, from the (ds)^2 term.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hopefully that makes sense.&lt;/p&gt;&#xA;" OwnerUserId="5698" LastActivityDate="2013-07-14T15:00:18.293" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8470" PostTypeId="2" ParentId="545" CreationDate="2013-07-14T15:42:16.923" Score="2" Body="&lt;p&gt;The late &lt;a href=&quot;http://en.wikipedia.org/wiki/Thomas_M._Cover&quot; rel=&quot;nofollow noreferrer&quot;&gt;Thomas Cover &lt;/a&gt;, (likely the leading &quot;Information Theorist&quot; of his generation), considered &quot;Universal&quot; approaches to things like data compression and portfolio allocations as true genetic algorithms.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Evolution has no parameters to fit or train.  Why should true genetic algorithms?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Universal approaches make no assumptions about the underlying distribution of data.  They make no attempt to predict the future from patterns or anything else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &quot;theoretical&quot; effectiveness of Universal approaches (they present significant implementation challenges see my recent question: &lt;a href=&quot;https://quant.stackexchange.com/questions/8453/geometry-for-universal-portfolios&quot;&gt;Geometry for Universal Portfolios?&lt;/a&gt;) follow from them doing what evolution demands.  The fastest, smartest, or strongest don't necessarily survive in the next generation.  Evolution favors that gene, organism, meme, portfolio, or data compression algorithm positioned to most easily adapt to whatever happens next. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, because these approaches make make no assumptions and operate non-parametrically, one can consider all tests, even on all historical data, as out-of-sample.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Certainly they have limitations,  Certainly they can't work for every kind a problem we face in our domain, but gee, what an interesting way to think about the things.&lt;/p&gt;&#xA;" OwnerUserId="2789" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2013-07-14T15:42:16.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8472" PostTypeId="1" AcceptedAnswerId="8486" CreationDate="2013-07-14T16:35:40.357" Score="4" ViewCount="2092" Body="&lt;p&gt;Can someone recommend a good source for corporate action data?  I need at the very least: ticker changes, dividends, splits, acquisitions and delistings.  I historically used Bloomberg Back Office and am looking for a suitable replacement that is within a small team's budget besides just scraping a bloomberg terminal.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:  More generally where are the major places getting their data?  Are they parsing each companies websites or some some sec filings that I am missing?  Is it from DTCC?&lt;/p&gt;&#xA;" OwnerUserId="1368" LastEditorUserId="1368" LastEditDate="2013-07-14T18:20:35.520" LastActivityDate="2017-04-17T20:09:41.153" Title="corporate action data" Tags="&lt;historical-data&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8473" PostTypeId="1" CreationDate="2013-07-14T17:03:36.633" Score="2" ViewCount="393" Body="&lt;p&gt;Would someone be able to give me an idea what type of fluid dynamics I could look at for modelling the order book? My background is more signals-related maths (correlation, covariance, fourier etc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am interested in modelling the order book based upon the buy/sell pressure within the order book depth.&lt;/p&gt;&#xA;" OwnerUserId="5168" LastActivityDate="2013-07-14T17:03:36.633" Title="Fluid dynamics for order book depth modelling" Tags="&lt;time-series&gt;&lt;equities&gt;&lt;data&gt;&lt;quant-trading-strategies&gt;&lt;research&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8474" PostTypeId="1" AcceptedAnswerId="8475" CreationDate="2013-07-14T19:34:30.047" Score="-1" ViewCount="1405" Body="&lt;p&gt;As you know, most of the EOD data available have only OHLC price. I used to do back-testing using the Close price as both bid and ask. however, in real world, the bid and ask spread is huge and the bid/ask quantity is also never constant. Above that, the bid/ask price changes with every shares sold/bought. Therefore, my earlier back-test could never be implement in the real world. What approach should i do to get/estimate ask/bid price for backtesting for OHLC data?&lt;/p&gt;&#xA;" OwnerUserId="5659" LastActivityDate="2013-08-02T08:37:35.260" Title="How to get/estimate ask/bid price for backtesting for OHLC data?" Tags="&lt;equities&gt;&lt;backtesting&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ClosedDate="2013-08-09T07:20:52.640" ContentLicense="CC BY-SA 3.0" />
  <row Id="8475" PostTypeId="2" ParentId="8474" CreationDate="2013-07-14T20:13:41.073" Score="6" Body="&lt;p&gt;If you want to backtest with closing prices, the best bet is to add a &lt;em&gt;slippage&lt;/em&gt; to the trade price. Note, however, that &lt;em&gt;transaction cost modeling&lt;/em&gt; is a large field within quantitative finance and there is no simple solution to estimate this.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2013-07-14T20:13:41.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8477" PostTypeId="1" AcceptedAnswerId="8479" CreationDate="2013-07-14T21:42:05.780" Score="-5" ViewCount="2684" Body="&lt;p&gt;Spread is the difference between Bid and Ask. I'm confused what is High-Low Spread and Open-Close spread?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ndX4g.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="5659" LastActivityDate="2013-07-14T23:01:35.627" Title="What is (High-Low) and (Open-Close) spread?" Tags="&lt;equities&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2013-07-15T19:30:29.230" ContentLicense="CC BY-SA 3.0" />
  <row Id="8478" PostTypeId="1" CreationDate="2013-07-14T22:35:37.647" Score="7" ViewCount="690" Body="&lt;p&gt;I am new to stochastic calculus. Can I know how to compute the close-form solution for &#xA;$$\int_0^t \exp(\alpha s - \sigma W_s) \; ds$$&#xA;and&#xA;$$\int_0^t \exp(\alpha s - \sigma W_s) \; dW_s.$$&#xA;I encounter that when trying to solve for the following SDE&#xA;$$dX_t = \theta(\mu - X_t)\; dt + \sigma X_t \; dW_t$$&lt;/p&gt;&#xA;" OwnerUserId="5716" LastActivityDate="2019-02-09T13:13:51.283" Title="close form for stochastic integral" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8479" PostTypeId="2" ParentId="8477" CreationDate="2013-07-14T23:01:35.627" Score="2" Body="&lt;p&gt;It's simply the difference between the two values. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;High-Low gives you an idea about the total price movement over the tick period, Open-Close gives you an indication of the direction of the move. If Open-Close is negative, the price went up, and vice versa. High-Low obviously is always positive.&lt;/p&gt;&#xA;" OwnerUserId="1976" LastActivityDate="2013-07-14T23:01:35.627" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8480" PostTypeId="1" AcceptedAnswerId="8481" CreationDate="2013-07-15T00:42:52.927" Score="0" ViewCount="156" Body="&lt;p&gt;For a stock trading at $27, $28 strike, 0% interest, 15% annual vol,  and one day until expiration there is about a 1 in 17000 chance of it being exercised?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d_2 = \frac{1}{.15\sqrt{1/252}}\left[\ln\left(\frac{27}{28}\right) + \left(0 - \frac{.15^2}{2}\right)(1/252)\right]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$1/(0.5 (1 + Erf[(Log[27/28] - (1/252) (0.15^2/2))/(0.15 *2^{1/2} Sqrt[1/252])]))$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;that seem way too small but it's the answer I got &lt;/p&gt;&#xA;" OwnerUserId="5376" LastEditorUserId="5376" LastEditDate="2013-07-15T00:51:42.880" LastActivityDate="2013-07-15T02:45:34.160" Title="Am I reading this correctly? probability way too small with BS model" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8481" PostTypeId="2" ParentId="8480" CreationDate="2013-07-15T02:45:34.160" Score="9" Body="&lt;p&gt;With $15\%$ annual volatility we have $15\%/\sqrt{252}\approx0.94\%$ daily volatility. To go from $27$ to $28$ is a $1/27\approx 3.7\%$ move which is $3.7/0.94\approx 3.9$ standard deviations. For a normal distribution this is about $0.005\%$ probability which is in line with your result.&lt;/p&gt;&#xA;" OwnerUserId="5107" LastActivityDate="2013-07-15T02:45:34.160" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8483" PostTypeId="1" AcceptedAnswerId="9398" CreationDate="2013-07-15T11:59:26.263" Score="2" ViewCount="706" Body="&lt;p&gt;I need to model the recovery rate of a &lt;a href=&quot;http://en.wikipedia.org/wiki/Structured_product&quot; rel=&quot;nofollow&quot;&gt;structured bond&lt;/a&gt; whose expected cash flows, if the issuer remains solvent, will be very low. For instance, assume that I need to estimate the recovery amount of a bond with an expected cash flow at maturity of 15% of its notional value (i.e.: the expected coupon is -85%). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to estimate a recovery in this type of bond:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Should I still consider the initial bond notional and apply a recovery rate? In such case, with the usual levels of recovery  of $\sim$ 0.4 the defaulting scenario would result in a higher payoff than the solvency one, which seems quite odd.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Which other approaches could be used to estimate the recovery in these types of bonds? (e.g: calculate the recovery based on the non-default market value?)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: Information added based on comments&lt;/p&gt;&#xA;" OwnerUserId="5208" LastEditorUserId="5208" LastEditDate="2013-11-08T10:35:27.663" LastActivityDate="2013-11-08T14:55:40.517" Title="Recovery rate in a structured bond" Tags="&lt;fixed-income&gt;&lt;recovery&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="8486" PostTypeId="2" ParentId="8472" CreationDate="2013-07-15T20:03:13.333" Score="6" Body="&lt;p&gt;Depends on your budget of course, but:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Mergent offers a &lt;a href=&quot;http://www.mergent.com/mergent-solutions/corporate-actions-equity-pricing&quot;&gt;great service&lt;/a&gt;, expensive though.&lt;/li&gt;&#xA;&lt;li&gt;Six Financial Information offers good &lt;a href=&quot;http://www.six-financial-information.com/en/home/global-data-services/corporate-actions.html&quot;&gt;Corporate Actions service&lt;/a&gt;. (Personally, I would go with this one)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://corporate.morningstar.com/us/documents/MethodologyDocuments/FactSheets/MorningstarPrice&amp;amp;CorporateActionsFactSheet.pdf&quot;&gt;Morning Star&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.interactivedata.com/index.php/productsandservices/content/id/Corporate+Actions&quot;&gt;Interactive Data&lt;/a&gt; (very hard company to deal with, their legal would waste a lot of your time, but may still worth to get a quote)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Also, consider how much IT resources you have for accurately getting, parsing, processing and storing these data.&lt;/p&gt;&#xA;" OwnerUserId="2909" LastEditorUserId="2909" LastEditDate="2013-07-15T20:13:28.650" LastActivityDate="2013-07-15T20:13:28.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8489" PostTypeId="1" AcceptedAnswerId="8491" CreationDate="2013-07-16T10:47:53.650" Score="1" ViewCount="3734" Body="&lt;p&gt;Are there any general arguments to decide whether it is better to use a model with a normal or a lognormal distribution of the short rate? E.g. Hull-White with a normal and Black-Karasinski with a lognormal, is there a way to judge which is better? I am aware of the fact that lognormal models don't describe negative interest rates, but are there any other criteria? By &quot;better&quot; I mean the model's better ability to reproduce actual market data.&lt;/p&gt;&#xA;" OwnerUserId="5676" LastEditorUserId="5676" LastEditDate="2013-07-16T10:54:00.100" LastActivityDate="2013-07-16T16:11:43.263" Title="Normal vs Lognormal Short Rate models" Tags="&lt;interest-rates&gt;&lt;hullwhite&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8490" PostTypeId="1" AcceptedAnswerId="23146" CreationDate="2013-07-16T11:16:19.003" Score="3" ViewCount="721" Body="&lt;p&gt;I have a problem with the underlying assumption in the future/forward convexity adjustment.&#xA;If I understand correctly, the assumption is, if I am long ED, I earn money when rates go down and invest the money in a lower rate and vice versa.&#xA;What I don't agree with is that the correlation between the spot rate and for example EDU5 is very far from 1, sometimes it is even negative (especially in a crisis).&#xA;So I may earn money on long EDU5 and invest the earnings in a higher rate, as the spot rate is going high as well.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Do most models assume 1 correlation between the spot rate and the forward rate?&lt;/li&gt;&#xA;&lt;li&gt;Any models thay take the correlation under consideration?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5726" LastEditorUserId="4660" LastEditDate="2013-07-19T07:40:02.450" LastActivityDate="2016-05-07T17:59:55.590" Title="Convexity adjustment" Tags="&lt;fixed-income&gt;&lt;swaps&gt;" AnswerCount="1" CommentCount="10" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8491" PostTypeId="2" ParentId="8489" CreationDate="2013-07-16T13:52:25.227" Score="4" Body="&lt;p&gt;General knowledge:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reference for short rates models is: &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/3540221492&quot; rel=&quot;nofollow&quot;&gt;Interest Rate Models, by D. Brigo &amp;amp; F. Mercurio, Springer&lt;/a&gt;&#xA;Worth the cost.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find a summary of the propeties of the &quot;dr&quot; models p15 &amp;amp; p19: &lt;a href=&quot;http://ieor.columbia.edu/pdf-files/Brigo_D.pdf&quot; rel=&quot;nofollow&quot;&gt;Interest Rate Models: Paradigm shifts in recent years, D. Brigo, Columbia University Seminar&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will see the quote p19: &quot;Pricing models need to be more precise in the distribution properties so lognormal models were usually preferred&quot;. Normal Versus Lorgnormal is not the only thing involved in the process of choosing the models. &lt;/p&gt;&#xA;" OwnerUserId="5052" LastEditorUserId="5052" LastEditDate="2013-07-16T16:11:43.263" LastActivityDate="2013-07-16T16:11:43.263" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8492" PostTypeId="1" CreationDate="2013-07-16T14:46:53.667" Score="2" ViewCount="161" Body="&lt;p&gt;We are running a portfolio of fund managers in our fund. When one of the managers hits the max DD constraint we pull money from this manager. This may happen in the middle of the allocation period and we need to reinvest the money to the other managers. We cannot decrease the allocations for the remaining managers. What is the smart way to allocate the money we have pulled? I suspect it is easiest to answer this question in the MVO framework. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas and references are really appreciated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;" OwnerUserId="5652" LastActivityDate="2013-07-16T16:07:24.473" Title="What is the smart way to reallocate money?" Tags="&lt;portfolio-management&gt;&lt;mean-variance&gt;&lt;markowitz&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8493" PostTypeId="2" ParentId="8492" CreationDate="2013-07-16T16:07:24.473" Score="3" Body="&lt;p&gt;You should have a look at chapter 8 (p. 261ff.) of&lt;br&gt;&#xA;&lt;a href=&quot;http://books.google.de/books?id=v2ZRNSPfwTMC&amp;amp;lpg=PP1&amp;amp;pg=PP1#v=onepage&amp;amp;q&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;Hedge Fund Market Wizards by Jack D. Schwager&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Excerpt from there (but it is much more detailed in the book):&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Perhaps the most potent risk control Platt employs in BlueCrest’s&#xA;  discretionary strategy is maintaining an extremely tight rein on what&#xA;  a trader can lose before capital is withdrawn. A mere 3 percent loss&#xA;  is enough to trigger a 50 percent reduction in a trader’s allocation,&#xA;  and the same small additional percentage loss is all it takes to&#xA;  remove a trader’s entire allocation. These rigid rules seek to prevent&#xA;  any trader from losing more than 5 percent of his initial stake. (The&#xA;  combination of two successive 3 percent losses is less than a 5&#xA;  percent loss because the second 3 percent loss is incurred on only 50&#xA;  percent of the starting stake.) In his own trading book, Platt is&#xA;  subject to the same rules as his traders, but he has never approached&#xA;  the 3 percent loss point. &lt;br&gt;&lt;br&gt;You would think that with such extreme loss&#xA;  limitations, it would be very difficult for individual traders, and in&#xA;  turn the strategy, to make much money. It seems that with only 3&#xA;  percent leeway before their capital allocation is slashed that traders&#xA;  would be risking too little on their trades to make much of a return.&#xA;  How then has the discretionary strategy managed to average nearly a 14&#xA;  percent per year net return? The key is that the 3 percent/3 percent&#xA;  risk rule applies to a trader’s starting stake. So certainly, the rule&#xA;  encourages traders to be very cautious at the onset, being highly&#xA;  selective in their trades and tightly limiting the loss on any trade.&#xA;  But as traders get ahead, their cushion widens, as trading gains&#xA;  augment the small initial 3 percent loss allowance. Once they are&#xA;  comfortably in the black, traders can take much more risk, thereby&#xA;  creating the potential to achieve large returns, despite the highly&#xA;  restrictive initial loss limitation. Essentially, the trader&#xA;  allocation risk control strategy assures capital preservation, while&#xA;  at the same time keeping upside potential open-ended by allowing&#xA;  greater risk-taking with profits. It is, effectively, an asymmetric&#xA;  risk management strategy.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="12" LastActivityDate="2013-07-16T16:07:24.473" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8494" PostTypeId="1" AcceptedAnswerId="8513" CreationDate="2013-07-16T16:44:45.907" Score="8" ViewCount="3960" Body="&lt;p&gt;I read the posts, &lt;a href=&quot;https://quant.stackexchange.com/questions/3526/how-to-interpret-results-of-johansen-test&quot;&gt;How to interpret results of Johansen Test?&lt;/a&gt; and &lt;a href=&quot;https://quant.stackexchange.com/questions/2076/how-to-interpret-the-eigenmatrix-from-a-johansen-cointegration-test&quot;&gt;How to interpret the eigenmatrix from a Johansen cointegration test?&lt;/a&gt; But still I am quite confused by the output. I have a project with two series: I don't reject both H0, therefore I'd say there is no cointegration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Johansen Procedure:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Test type: trace statistic, with linear trend.&lt;/li&gt;&#xA;&lt;li&gt;Eigenvalues (lambda):&lt;pre&gt;&#xA;[1] 0.0189039550 0.0008903665&#xA;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;Values of test statistic and critical values of test:&lt;pre&gt;         test 10pct  5pct  1pct&#xA;r &amp;lt;= 1 | 0.39  6.50  8.18 11.65&#xA;r = 0  | 8.65 15.66 17.95 23.52&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;Eigenvectors, normalised to first column (these are the cointegration relations):&lt;pre&gt;           Oil.l1  Fuel.l1&#xA;Oil.l1   1.000000   1.0000&#xA;Fuel.l1 -1.484484 -11.1973&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;Weights W (this is the loading matrix):&lt;pre&gt;             Oil.l1      Fuel.l1&#xA;Oil.d  -0.049059881 0.0002693549&#xA;Fuel.d  0.002111537 0.0002467205&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;However, I'd like to impose one. Thus, I want to read alpha and beta. From what I understand these are the vectors below the largest eigenvalue? &lt;em&gt;i.e.&lt;/em&gt; here, beta is (1, -1.48) and alpha is (-0.049, 0.002). &lt;em&gt;But&lt;/em&gt;, if I want to build a cointegrating relationship, then are there two of them (below), or only one (the upper one)? I believe that lower one is very unrealistic due to low eigenvalue (first one too but we impose its not):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;Oil.l1 - 1.48*Fuel.l1 &#xA;Oil.l1 - 11.19*Fuel.l1&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also, to get the Gamma(j) matrices for differenced data for Vector Error Correction Form, I do the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;ECF = ca.jo(ldata, type=&quot;trace&quot;, spec=&quot;transitory&quot;, K=14)&#xA;vec2var(ECF,r=1) #r = 1 for cointegration rank&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;According to theory there should be (p-1) matrices, i.e. 13 &lt;em&gt;but&lt;/em&gt; I get 14. Should I simply ignore the last one?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd be extremely thankful for help!&lt;/p&gt;&#xA;" OwnerUserId="5724" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2013-07-18T08:48:29.670" Title="Cointegrating relationships - Johansen in R" Tags="&lt;r&gt;&lt;cointegration&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8495" PostTypeId="2" ParentId="549" CreationDate="2013-07-16T20:03:20.460" Score="8" Body="&lt;p&gt;&lt;strong&gt;And then music...&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Victor Neiderhoffer, in a 2001 &lt;a href=&quot;http://www.traders.com/Documentation/FEEDbk_docs/2001/04/Abstracts_new/Interview/Interview.html&quot;&gt;interview&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The market plays music all the time. The problem is you never know how the music of the market is going to end. But a good framework is that it will end on the tonic. Consonance to dissonance back to consonance. And whenever there's tremendous dissonance, strident moves in one direction, a good working hypothesis is that at the end, you'll find consonance again.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Mean reversion?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A 2007 &lt;a href=&quot;http://www.newyorker.com/reporting/2007/10/15/071015fa_fact_cassidy?currentPage=all&quot;&gt;New Yorker&lt;/a&gt; article on Neiderhoffer discussed some more of his music and markets ideas:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In “The Education of a Speculator,” he devotes an entire chapter to this notion, comparing the market’s movements to some of his favorite pieces of classical music, and juxtaposing pages of sheet music with stock charts. “When the markets are moving in my favor in a nice, gentle way—never below my initial price—I often think of the ‘Trout Quintet,’ ” he writes. “Another frequent work I hear in the market is Haydn’s Symphony No. 94. . . . Right after lunch, or before a holiday, the markets have a tendency to meander up and down in a five-point range above and below the opening. The pattern is similar to the twinkling C-major fifths of Haydn’s symphony.”&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;At some point, Neiderhoffer developed a means of &quot;playing&quot; audio of market moves for his trading desk. (I'll try to find a link to the source, its been a while since I saw it.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;More interestingly...&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a colleague, that creates audio files of fractal market structures. He can play an entire day's tick by tick volatility. It just provides a different way to experience the data. Such things, like the things this great question has evoked from the community, may shift the way we think about things and keep us fresh.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If anyone wants to listen to some short clips, contact me by my email, posted in my profile, and I'll send a few.&lt;/p&gt;&#xA;" OwnerUserId="2789" LastActivityDate="2013-07-16T20:03:20.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8497" PostTypeId="1" CreationDate="2013-07-17T03:36:07.610" Score="0" ViewCount="2612" Body="&lt;p&gt;Using a 30/360 day count convention, how can you value the NPV of these cash flows and the discount factor? I know how to discount cash flows but how does it differ using a 30/360 approach? What is the approach that I should be using?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Date       Payments     Discount Factor    Discounted Value&#xA;12/31/2012  0               100.00% &#xA;6/30/2013   75,200      &#xA;12/31/2013  50,600      &#xA;6/30/2014   86,700      &#xA;12/31/2014  77,000      &#xA;6/30/2015   74,400      &#xA;12/31/2015  25,200      &#xA;6/30/2016   70,700      &#xA;12/31/2016  81,800      &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4729" LastActivityDate="2013-07-19T12:55:38.503" Title="30360 Daycount Count Convention to find NPV for Bonds" Tags="&lt;fixed-income&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8498" PostTypeId="2" ParentId="8497" CreationDate="2013-07-17T06:07:35.760" Score="2" Body="&lt;p&gt;You are missing the rates in your question you need to derive your DFs. The only difference between day count convention is how you adjust your rate to convert to the actual rate applicable between the date of the cash flow and the date to which you pv the future cf. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally the following function applies: 1/((1+r/360)^360*T), where T is the time in years between the pv date and the cf date, given each month has 30 days and the year 360 days. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example: r(t0, t1) = 5%, dcConvention = 30/360, t0 = 1 Jan 2013, t1 = 15 Mar 2013&lt;/p&gt;&#xA;&#xA;&lt;p&gt;T = 74 days / 360 days = 0.20555555&lt;/p&gt;&#xA;&#xA;&lt;p&gt;DF(t1) approx =  0.989775564&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&#xA;This above calculation implies daily compounding. If rates are only annually compounded then the following function applies: 1/(1+r)^T which works out to be in this example: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1/(1+0.05)^0.2055555 = 0.990021&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-07-19T07:25:30.933" LastActivityDate="2013-07-19T07:25:30.933" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8499" PostTypeId="1" CreationDate="2013-07-17T07:00:35.973" Score="-3" ViewCount="97" Body="&lt;p&gt;All of the Forex volume/transactions are always reported in total dollar amount.  I am interested in the number of individual trades.  Where can I find this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Granularity doesn't matter, transactions/year would be small enough.  I would prefer to separate out by currency.&lt;/p&gt;&#xA;" OwnerUserId="5729" LastActivityDate="2013-07-17T08:27:22.893" Title="Total number of currency transactions" Tags="&lt;fx&gt;" AnswerCount="1" CommentCount="2" ClosedDate="2013-07-23T01:09:10.390" ContentLicense="CC BY-SA 3.0" />
  <row Id="8500" PostTypeId="2" ParentId="8499" CreationDate="2013-07-17T08:27:22.893" Score="1" Body="&lt;p&gt;There is no such thing as total trading volume and especially no aggregate transactions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason for that is that Foreign Exchange is a purely OTC (over the counter) market so even you see volume by one broker/ECN that is only volume that crosses the ECN or transactions at the particular broker. Nobody knows exactly how much volume is transacted during any given time period or on a given day/week/month/year. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-07-17T08:27:22.893" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8501" PostTypeId="1" AcceptedAnswerId="8512" CreationDate="2013-07-17T10:38:11.733" Score="10" ViewCount="18201" Body="&lt;p&gt;I plan to use &lt;a href=&quot;http://en.wikipedia.org/wiki/Kalman_filter&quot; rel=&quot;noreferrer&quot;&gt;Kalman filter&lt;/a&gt; to estimate saving account amount.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I'm a bit lost at how to tune the filter's parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking as the example from the Wikipedia page, basically there are three parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P(0) can be set as (L, 0; 0, L), where L is a big number. This is fine, anyway P(k) shall converge.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;R supposedly is a constant; it's suggested to be taken as covariance of z. Fine, thought Z is composed of x and v.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How about Q? From &lt;a href=&quot;http://www.cs.unc.edu/~tracker/media/pdf/SIGGRAPH2001_CoursePack_08.pdf&quot; rel=&quot;noreferrer&quot;&gt;An Introduction to the Kalman Filter by Greg Welch and Gary Bishop&lt;/a&gt;, different values of Q seems seriously affect the converge of estimation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions on how to tune Q?&lt;/p&gt;&#xA;" OwnerUserId="2161" LastEditorUserId="2161" LastEditDate="2013-07-18T01:13:31.270" LastActivityDate="2017-04-02T17:11:58.747" Title="How to tune Kalman filter's parameter?" Tags="&lt;modeling&gt;&lt;kalman&gt;&lt;parameter&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="8504" PostTypeId="2" ParentId="8300" CreationDate="2013-07-17T14:54:11.440" Score="-1" Body="&lt;p&gt;On page 6 of the document there is the formula &quot;Ct_DeltaAB = Equation #1 evaluated for changes in Price A and Price B&quot;. How can I know what the changes are in Price A and Price B? I know the correlation between A and B but that does not mean that I can derive the changes of A and B. How do I solve this problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rick&lt;/p&gt;&#xA;" OwnerUserId="5734" LastActivityDate="2013-07-17T14:54:11.440" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8505" PostTypeId="1" CreationDate="2013-07-17T19:25:08.623" Score="5" ViewCount="1586" Body="&lt;p&gt;I need to use various data sources to cover all of my data, and I am concerned by the discrepancies in total returns. Data vendors were helpful, but their simple documentation did not help resolve why there can be differences for some months for some ISINs but not for other months. If you are familiar with these issues, please comment on the example data points below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am calculating calendar-month returns (in Swedish Kronen) via&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;TOT_RETURN_INDEX_GROSS_DVDS from Bloomberg (taking the ratio of&#xA;consecutive month-end values),&lt;/li&gt;&#xA;&lt;li&gt;RI of ThomsonReuters Datastream&#xA;(again, a ratio),&lt;/li&gt;&#xA;&lt;li&gt;FG_TOTAL_RETURNC of FactSet (directly),&lt;/li&gt;&#xA;&lt;li&gt;Month End Return of Morningstar (directly),&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I would love to see consistent returns, comparable to what MSCI bases their total return indices on. Which vendor corresponds to this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think all vendors promised to assume all reinvestments of dividends and capital distribution for this data (though for funds fees and costs might still change things). Meanwhile for&lt;/p&gt;&#xA;&#xA;&lt;p&gt;H&amp;amp;M stock (HENNES &amp;amp; MAURITZ B) in April 2000, I see&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Bloomberg:      -.0027076&lt;/li&gt;&#xA;&lt;li&gt;ThomsonReuters: -.0023833&lt;/li&gt;&#xA;&lt;li&gt;FactSet:        -.00238335&lt;/li&gt;&#xA;&lt;li&gt;Morningstar:     .0104167&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For an SEB Sverige fund, a difference shows up in June 2000: .0304632 from Bloomberg and            .0494242 from Morningstar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And the fact that sometimes Morningstar produces lower numbers, sometimes higher numbers, and for equities, not stocks, does not suggest a definitional issue about reinvesting or paying dividends, e.g.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Ericssson stock (ERICSSON (LM) B):&#xA;Nov 2000: BB: -.1390977; TR DS: -.1390979; FS: -.13909775; MS: -.0912699&#xA;but&#xA;Sept 2001:BB: -.2431374; TR DS: -.2431377; FS: -.2431372; MS: -.2873786;&lt;br&gt;&#xA;Oct 2001: BB: .1968915; TR DS: .1968912; FS: .1968913; MS: .2588556.&lt;/p&gt;&#xA;" OwnerUserId="5693" LastActivityDate="2016-04-29T10:56:04.403" Title="comparing total returns from various data vendors" Tags="&lt;returns&gt;&lt;market-data&gt;&lt;index&gt;&lt;bloomberg&gt;&lt;total&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8506" PostTypeId="1" CreationDate="2013-07-17T19:37:29.433" Score="2" ViewCount="6169" Body="&lt;p&gt;I want to calculate annual excess returns on portfolios using monthly returns for a CAPM (for the assets in the portfolio as well as for the benchmark), in order to have more information on the correlations, more precise betas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because the CAPM comes from monthly correlations, I shall calculate excess returns for each month, right? But if I only have year-end snapshots of portfolios, I should chain the monthly excess returns up (compound them) and multiply the initial value with each surprise return? Is this essentially the same as doing the annual calculation? (I suspect an argument about integrating a continuous price process into some return observations anyway.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have information on holdings $q_0$ and want to calculate surprise returns on this initial portfolio over the following year, $r^s_{0,12} \cdot q_0$. (Where annual returns are between moment 0 and moment 12.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For $r^s_{0,12}$, I thought to use $r^s_{0,12} = \left( \prod_{t =1}^{12} R^s_{t,a} \right)-1$, where monthly surprise returns gross come from a monthly CAPM (of log returns): $ R^s_{t,a} = R_{t,a} / R^{exp}_{t,a} $ where $ \log R^{exp}_{t,a} = \left( \hat{\beta_a}(\log(R^m_t)-\log(R^f_t)) \right)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope the net vs gross returns and divisions or differences of logs are not too confusing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Full disclosure: This breaks down my longer question into specifics. Please bear with me. From:&#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/8443/annual-excess-returns-from-capm-on-monthly-total-returns&quot;&gt;annual excess returns from CAPM on monthly total returns&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5693" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2013-07-19T15:10:26.230" Title="how to chain monthly excess returns into annual?" Tags="&lt;returns&gt;&lt;beta&gt;&lt;coherent-risk-measure&gt;&lt;capm&gt;&lt;currency&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8507" PostTypeId="1" CreationDate="2013-07-17T19:42:30.453" Score="1" ViewCount="91" Body="&lt;p&gt;I want to calculate annual excess returns on portfolios using monthly (total) returns for a CAPM (for the assets in the portfolio as well as for the benchmark), in order to have more information on the correlations, more precise betas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it standard practice to adjust (slightly) for shorter months having somewhat less information on the correlations? Shall I weight by the number of days or only trading days before return dates?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Full disclosure: This breaks down my longer question into specifics. Please bear with me. From:&#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/8443/annual-excess-returns-from-capm-on-monthly-total-returns&quot;&gt;annual excess returns from CAPM on monthly total returns&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5693" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2014-06-05T14:27:41.243" Title="different amount of information on return correlations from shorter and longer periods?" Tags="&lt;returns&gt;&lt;beta&gt;&lt;coherent-risk-measure&gt;&lt;capm&gt;&lt;currency&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8511" PostTypeId="1" CreationDate="2013-07-17T20:12:36.007" Score="1" ViewCount="152" Body="&lt;p&gt;I want to calculate annual excess returns on portfolios using monthly returns for a CAPM (for the assets in the portfolio as well as for the benchmark), in order to have more information on the correlations, more precise betas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to use the right benchmark for all this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many holdings are diversified internationally,&#xA;    but not completely, esp. not into emerging markets (over 1999-2007). Is it appealing to use an MSCI all-world&#xA;    benchmark (viz. MSCI ACWI IMI GR USD converted into SEK) as people&#xA;    &quot;should&quot; have diversified, so all extra risk is, well, extra? Or it makes&#xA;    much more sense to compare everything to an MSCI World (&#xA;    developed markets only) benchmark?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Full disclosure: This breaks down my longer question into specifics. Please bear with me. From: &lt;a href=&quot;https://quant.stackexchange.com/questions/8443/annual-excess-returns-from-capm-on-monthly-total-returns&quot;&gt;annual excess returns from CAPM on monthly total returns&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5693" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2014-04-05T21:38:45.383" Title="right benchmark for an incompletely diversified international portfolio (for a CAPM): MSCI World or MSCI ACWI IMI?" Tags="&lt;returns&gt;&lt;beta&gt;&lt;coherent-risk-measure&gt;&lt;capm&gt;&lt;currency&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8512" PostTypeId="2" ParentId="8501" CreationDate="2013-07-18T06:15:31.037" Score="6" Body="&lt;p&gt;Estimation of the initial states of R and particularly Q is indeed more of an art than science.  The task at hand is to estimate the covariances. You have basically two main choices:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Live with the fact that you will never be able to exactly pinpoint the covariance of noise in financial time series. The most often used approach is to pose the coveriance estimation as a least-squares problem, such as using ALS. Below ALS and a few related solutions to the problem. However, what makes your problem a lot easier is that you apply Kalman filters to a savings account. I do not know which exact method you use to model a savings account or what distributional properties it has. However, it looks and sounds a lot easier than applying Kalman filters to financial time series with potentially several Brownian motion components. A savings account &quot;process&quot; may have much more straight forward covariances which you can equip Q with. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://jbrwww.che.wisc.edu/software/als/&quot; rel=&quot;noreferrer&quot;&gt;Autocovariance Least-Squares (ALS) Package&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S0005109805003262&quot; rel=&quot;noreferrer&quot;&gt;A new autocovariance least-squares method for estimating noise covariances&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S0959152407001631&quot; rel=&quot;noreferrer&quot;&gt;A generalized autocovariance least-squares method for Kalman filter tuning&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Another solution is to relax the distributional assumptions that underlie Kalman filters and focus your efforts on techniques such as Particle Filters. I have to great success implemented Particle Filters in financial time series tracking as well as forecasting. However, a word of warning is that particle filter algorithms are extremely computationally expensive and hence they may not be applicable to real-time applications. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-07-18T06:15:31.037" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8513" PostTypeId="2" ParentId="8494" CreationDate="2013-07-18T08:48:29.670" Score="2" Body="&lt;p&gt;The two eigenvectors are are ordered by maximum likelihood. The eigenvector is the cointegrating relationship and the weight is their coefficient, if they are used, in for example a VECM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get the VECM-form, you need to to use the command cajorls()(restricted) or cajoorls()(unrestricted). The vec2var() gives you a level (undifferenced) representation of the VECM. In a VECM you'll have 13 $(p-1)$ lags per variable. I think you will find the help on the commands, ca.jo, vec2var, cajorls and cajools very helpful. &lt;/p&gt;&#xA;" OwnerUserId="5579" LastActivityDate="2013-07-18T08:48:29.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8514" PostTypeId="1" CreationDate="2013-07-18T13:25:59.820" Score="5" ViewCount="985" Body="&lt;p&gt;I am doing a research for stress testing in market risk. The usual process I found out for scenario testing is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Define risk factors upon the portfolio &lt;/li&gt;&#xA;&lt;li&gt;Define the desired scenarios&lt;/li&gt;&#xA;&lt;li&gt;Vary the risk factors and execute the different scenarios &lt;/li&gt;&#xA;&lt;li&gt;Interprete the scenarios&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;My problem is that I do not know how to define the risk factors for a portfolio? Which &lt;code&gt;R&lt;/code&gt; functionality could I use? For example, what are the risk factors for a simple FX portfolio when I consider the portfolio: &lt;code&gt;EURUSD&lt;/code&gt;, &lt;code&gt;USDMXN&lt;/code&gt;, &lt;code&gt;AUDUSD&lt;/code&gt;, &lt;code&gt;USDJPY&lt;/code&gt; and &lt;code&gt;USDKRW&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I really appreciate your answer!&lt;/p&gt;&#xA;" OwnerUserId="5414" LastEditorUserId="5669" LastEditDate="2013-07-18T13:55:30.560" LastActivityDate="2015-07-05T23:36:38.123" Title="Definition of risk factors for market risk scenario testing" Tags="&lt;risk&gt;&lt;r&gt;&lt;risk-models&gt;&lt;market&gt;&lt;stress-testing&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8517" PostTypeId="1" CreationDate="2013-07-18T20:02:07.130" Score="2" ViewCount="1139" Body="&lt;p&gt;To test a model with real-life data, I used the fetch-function in matlab to connect to the database of yahoo! finance. My code to try and get 7 different assets' returns is the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;FromDate = '6/1/2001';&#xA;ToDate = '12/31/2012';&#xA;Period = 'w';&#xA;&#xA;% DAX = ^GDAXI&#xA;ASS1 = fetch(yahoo,'^GDAXI','Close',FromDate,ToDate,Period);&#xA;% Nikkei 225= ^N225&#xA;ASS3 = fetch(yahoo,'^N225','Close',FromDate,ToDate,Period);&#xA;% S&amp;amp;P 500 = ^GSPC&#xA;ASS5 = fetch(yahoo,'^GSPC','Close',FromDate,ToDate,Period);&#xA;% RUSSELL 1000 GROWTH = IWF&#xA;ASS6 = fetch(yahoo,'IWF','Close',FromDate,ToDate,Period);&#xA;% RUSSELL 1000 VALUE = IWD&#xA;ASS7 = fetch(yahoo,'IWD','Close',FromDate,ToDate,Period);&#xA;% RUSSELL 2000 GROWTH = IWO&#xA;ASS8 = fetch(yahoo,'IWO','Close',FromDate,ToDate,Period);&#xA;% RUSSELL 2000 VALUE = IWN&#xA;ASS9 = fetch(yahoo,'IWN','Close',FromDate,ToDate,Period);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I intentionally took weekly ticks because the indices come from different world regions and SE may be open at some place but closed at another. This period contains 604 weeks and 3 days, according to wolframalpha.com. But now, the length of the vectors are like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;606x2 double&amp;gt;, &#xA;&amp;lt;602x2 double&amp;gt;, &#xA;&amp;lt;605x2 double&amp;gt;, &#xA;&amp;lt;605x2 double&amp;gt;, &#xA;&amp;lt;605x2 double&amp;gt;, &#xA;&amp;lt;605x2 double&amp;gt;, &#xA;&amp;lt;605x2 double&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;i.e. the DAX finds 606 weekly ticks in less than 605 weeks, and the Nikkei 225 only 602. Does anybody have an idea what the reason could be - I cannot think of anything else than the stock exchange being closed three times for an entire week in Japan (Earthquake 2011, maybe, but DAX and NIKKEI have an equal number of returns from January 2011 until april of 2012, namely 70.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems I cannot work around this on the core of the yahoo database; just like I had to adjust the Russell Value 2000 index for a 3-for-1 split because I did not get the adjusted price from yahoo.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But more importantly, with an uneven number of ticks and returns, I cannot use any model. I therefore need to remove those rows from an asset where the date does not appear in every other asset (as the fetch function gives a column with the dates along with the ticks). The code I came up with until now is &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for i=1:size(ASS1(:,1))&#xA;    if sum(ismember(ASS1(i,1),[ASS3,ASS5,ASS6,ASS7,ASS8,ASS9]))&amp;lt;6;&#xA;        ASS1(i,:)=[]&#xA;    end&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to remove row i from asset 1 if it is not in all other Assets. But this is very inflexible with respect to number of assets, and not elegant to run. Is there a function that would help me better?&lt;/p&gt;&#xA;" OwnerUserId="1817" LastActivityDate="2013-07-18T20:02:07.130" Title="fetch from yahoo! finance database - varying number of ticks" Tags="&lt;data&gt;&lt;database&gt;&lt;matlab&gt;&lt;yahoo&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8518" PostTypeId="2" ParentId="2059" CreationDate="2013-07-18T21:04:49.047" Score="3" Body="&lt;p&gt;I have a mathematical proof with no graphs or pictures.&#xA;Suppose $r=0$, what we want is to see what happens if volatility changes in $E^Q[1_{S_T&amp;gt;K}]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The latter quantity is $Q(S_T&amp;gt;K)=Q(\log S_T &amp;gt; \log K)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under Q, we know that $S_T=S_0 \exp\left(-\frac12 \sigma^2T + \sigma W_T\right)$, &#xA;so $\log S_T$ is distributed as $ N(\log S_0 -\frac12\sigma^2T, \sigma^2 T)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So we can write $Q\left(\sigma \sqrt{T} N + \log(S_0) -\frac12 \sigma^2T &amp;gt; \log K\right)$ which equals&#xA;$&#xA;Q\left(N&amp;gt;\frac{\log{\frac{K}{S_0}}+\frac12 \sigma^2T}{\sigma \sqrt T}\right).&#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $f(y)=Q(N&amp;gt;y)$ decreases in $y$, it is enough to study&#xA;$y=y(\sigma)=\frac{\log{\frac{K}{S_0}}+\frac12 \sigma^2T}{\sigma \sqrt T}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $K&amp;gt;S_0$ (out of the money option), then if $\sigma \to 0$, $y(\sigma)\to +\infty$ and the same happens if $\sigma \to +\infty$. Hence there is a minimum for $\sigma=\sqrt{\log{\frac{K}{S_0}}}$. We deduce (by continuity) that&#xA;$f(y(0))=0$, $f(y(+\infty))=0$, and we have a maximum for $\sigma=\sqrt{\log{\frac{K}{S_0}}}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If instead $K&amp;lt;S_0$ (in the money option), $\sigma \to 0$ gives $-\infty$, $\sigma\to \infty$ still gives $\infty$ and the function $y(\sigma)$ is strictly increasing. So $f(y(0))=1$, $f(y(+\infty))=0$ and $f$ is strictly decreasing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, for an at the money option $S_0=K$, we have $f(y)=Q\left(N &amp;gt; \frac12 \sigma \sqrt T\right)$, so $f(0)=\frac 12$, and $f$ strictly decreases to the value $0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="5742" LastEditorUserId="5742" LastEditDate="2014-06-10T21:26:13.133" LastActivityDate="2014-06-10T21:26:13.133" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8522" PostTypeId="1" CreationDate="2013-07-18T23:56:11.807" Score="-2" ViewCount="492" Body="&lt;p&gt;Using a 30/360 day count what is the exact formula to discount this single zero coupon bond?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;DayCount:   30/360&#xA;Start Date  6/25/2013&#xA;End Date    1/1/2020&#xA;Discount Rate   3.50%&#xA;&#xA;Present Value   &#xA;Ending Value    50,000,000&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4729" LastActivityDate="2013-07-19T07:28:35.193" Title="DCF Zero Coupon Bond" Tags="&lt;fixed-income&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8523" PostTypeId="2" ParentId="8506" CreationDate="2013-07-19T02:48:20.910" Score="3" Body="&lt;p&gt;Compounding the monthly excess returns won't provide the annual excess return. You need to compute the difference between the annual return of the portfolio and the annual return of the benchmark.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To illustrate this let's look at an example. Consider the following two situations:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The benchmark performs well with a $2\%$ return each month;&lt;/li&gt;&#xA;&lt;li&gt;The benchmark performs badly with a $2\%$ loss (a return of $-2\%$) each month.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Suppose that in both situations the portfolio has a monthly excess return of $1\%$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, the compounded monthly excess return is $(1 + 0.01)^{12} - 1 = 12.7\%$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In situation 1, the benchmark annual return is $(1 + 0.02)^{12} - 1 = 26.8\%$, and the portfolio annual return is $(1 + 0.03)^{12} - 1 = 42.6\%$. So the annual excess return is $15.8\%$, which is different from the compounded monthly excess return of $12.7\%$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In situation 2, the benchmark annual return is $(1 - 0.02)^{12} - 1 = -21.5\%$, and the portfolio annual return is $(1 - 0.01)^{12} - 1 = -11.4\%$. So the annual excess return is $10.1\%$, which is also different from the &quot;compounded excess return&quot; of $12.7\%$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This simple example illustrates that just knowing the excess returns of the portfolio is not enought to get the annual excess return. One needs also the monthly/annual  return of the benchmark; it's a consequence of the effect of compounding.&lt;/p&gt;&#xA;" OwnerUserId="5669" LastActivityDate="2013-07-19T02:48:20.910" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8524" PostTypeId="2" ParentId="8522" CreationDate="2013-07-19T04:33:26.440" Score="1" Body="&lt;ul&gt;&#xA;&lt;li&gt;DF(t1) = 1/((1+r/360)^360*T)&lt;/li&gt;&#xA;&lt;li&gt;Using 30/360 Daycount convention, you get 2346 days to discount over.&lt;/li&gt;&#xA;&lt;li&gt;Your discount factor should work out to about 0.7961 and hence your PV of the cash flow should be about 39,803,337.23.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="4660" LastEditDate="2013-07-19T07:28:35.193" LastActivityDate="2013-07-19T07:28:35.193" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8525" PostTypeId="1" AcceptedAnswerId="8528" CreationDate="2013-07-19T08:53:49.873" Score="2" ViewCount="264" Body="&lt;p&gt;I am reading the book &lt;em&gt;An Introduction to Financial Option Valuation&lt;/em&gt;. The following on page 58 makes me confused:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;For the formula:&#xA;  $\exp \left\{ -1.96\sigma \sqrt{t}+(\mu-0.5 \sigma^2)t \right\}$,&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;if $t$ is small, then it is approximately equal to $\exp \left (-1.96 \sigma \sqrt{t} \right )$.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Moreover, the second formula approximagely equals $1 - 1.96 \sigma \sqrt{t}$.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I don't understand how can we get the second and the third expression. If $t$ is very small, then $\sqrt{t}$ should be infinitesimal. Then, why has $(\mu-0.5 \sigma^2)t$ disappeared in the second formula, but not $-1.96 \sigma \sqrt{t}$?&lt;/p&gt;&#xA;" OwnerUserId="5744" LastEditorUserId="5669" LastEditDate="2013-07-19T15:53:15.260" LastActivityDate="2013-07-22T02:35:36.527" Title="Question on an approximation in pricing formula" Tags="&lt;pricing-formulae&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8526" PostTypeId="1" AcceptedAnswerId="8550" CreationDate="2013-07-19T11:04:18.177" Score="-2" ViewCount="881" Body="&lt;p&gt;I want to build trading systems  based on two things:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1)Fractal Theory&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2)Harmonics Pattern&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have read the book : The Misbehavior of Markets: A Fractal View of Financial Turbulence By Mandelbrot but he didn’t show how to find fractal in time series. &#xA;Moreover I don’t have time to go through all books with this topic, because I have work afterhours. So my question to you is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Do you know best measures for fractal theory or harmonics patterns in Time Series of Stock?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Do you know some helpful publications/books connected with this topic – how to look for patterns/measures?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Do you have any suggestions about construction of such trading systems?&lt;/p&gt;&#xA;" OwnerUserId="5745" LastEditorUserId="5745" LastEditDate="2013-07-19T12:03:46.773" LastActivityDate="2013-07-22T08:42:32.327" Title="How to look for fractals/harmonics patterns in time series?" Tags="&lt;programming&gt;&lt;algorithm&gt;&lt;fractals&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8528" PostTypeId="2" ParentId="8525" CreationDate="2013-07-19T11:10:44.723" Score="5" Body="&lt;p&gt;To simplify notations, let $a:= -1.96\sigma$ and $b := \mu - 0.5\sigma^2$. The development in the book could be justified if both $a\sqrt{t}$ and $bt$ are small (close to zero), and if we have that $|a\sqrt{t}| &amp;gt; |bt|$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recall that &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$\exp (x+y)= \exp(x)\exp(y)$,&lt;/li&gt;&#xA;&lt;li&gt;$\exp(x)\approx 1 + x,\quad \text{if } x\approx 0$. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Then, using these properties we have&#xA;\begin{align}&#xA;\exp (a\sqrt{t} + bt)&#xA; &amp;amp;= \exp (a\sqrt{t}) \exp (bt)\\&#xA; &amp;amp;\approx \exp (a\sqrt{t})  (1 + bt) \\&#xA; &amp;amp;\approx \exp (a\sqrt{t}),\tag{1} \\&#xA; &amp;amp;\approx 1 + a\sqrt{t},&#xA;\end{align}&#xA;where the  approximation in (1) follows from the fact that $bt$ is (very) close to zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fact that  $bt$ dissapeared but not $a\sqrt{t}$ comes from the fact that they probably assume that $|a\sqrt{t}| &amp;gt; |bt|$. This assumption should be explicitly stated or obvious from the context (given the typical values for $\sigma$ and $\mu$).  &lt;/p&gt;&#xA;" OwnerUserId="5669" LastEditorUserId="5669" LastEditDate="2013-07-20T12:55:22.553" LastActivityDate="2013-07-20T12:55:22.553" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="8532" PostTypeId="1" AcceptedAnswerId="8613" CreationDate="2013-07-19T12:25:42.110" Score="4" ViewCount="361" Body="&lt;p&gt;When estimating &lt;strong&gt;in-sample&lt;/strong&gt; option prices, one usually estimates the structural parameters $\theta_t$ using all information up to time $t$, and then prices the option at time $t$ using the obtained parameters and other inputs like the spot price $S_t$ and strike price $X$ etc. The price is then given by:&#xA;$\hat{c}_t = f(S_t, X, ..., \hat{\theta}_t) $ where $f(\cdot)$ is a function corresponding to a particular option pricing model, such as the Black Scholes formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In an &lt;strong&gt;out-of-sample&lt;/strong&gt; framework, the approach described in many papers (see e.g., Baksi et al. 1997) is to first estimates the structural parameters using all information up to time $t$, and then to use these along with the other input variables at time $t+1$. So:&#xA;$\hat{c}_{t+1} = f(S_{t+1}, X, ..., \hat{\theta}_t) $.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is this correct? And are the forecasts genuine out-of-sample forecasts?&lt;/li&gt;&#xA;&lt;li&gt;Why do you use the input variables at time $t+1$? Aren't those unknown? If they were known you could optimize the parameter estimates by using all the information up to time $t+1$; hence the call price $c_{t+1}$ would also be known.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2291" LastEditorUserId="2291" LastEditDate="2013-07-31T15:22:39.803" LastActivityDate="2013-08-01T05:13:45.377" Title="How does out-of-sample option pricing work in practice?" Tags="&lt;option-pricing&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8533" PostTypeId="2" ParentId="8497" CreationDate="2013-07-19T12:40:10.420" Score="0" Body="&lt;p&gt;In the data provided, the Dec dates are all 31st. In the 30/360 conventions (&lt;a href=&quot;http://en.wikipedia.org/wiki/Day_count_convention#30.2F360_methods&quot; rel=&quot;nofollow&quot;&gt;Wikipedia has details&lt;/a&gt; of the different 30/360 versions), the factor is calculated from the difference in years, months and days separately; years count as 12 months, and months count as 30 days. Generally 31st gets lowered to 30 days. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this manner, the distance between the first two dates (2012-12-31 and 2013-06-30) becomes 1 year, -6 months and 0 days (in the convention), and thus the factor for the dates (see Wikipedia explanation for details) comes out as exactly 0.5. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The 30/360 factors for the periods specified by those dates, then, are 0.5, 0.5, 0.5 etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually bonds have a fixed coupon rate, but those interest payments in the question and the neat fractions above do not square with each other, so something else is going on. In order to discount, you would need a rate to discount at. I thought I might retrieve it from the interest and a guess at the principal, but the interest payments vary too much to be a vanilla bond. &lt;/p&gt;&#xA;" OwnerUserId="1314" LastEditorUserId="1314" LastEditDate="2013-07-19T12:55:38.503" LastActivityDate="2013-07-19T12:55:38.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8534" PostTypeId="1" AcceptedAnswerId="8573" CreationDate="2013-07-19T15:16:25.673" Score="4" ViewCount="581" Body="&lt;p&gt;I am currently expanding my own strategy profiling and testing platform which partly consists of a portfolio backtesting module. The backtest engine processes tick based data (quotes for currencies, order book changes and trades for other asset classes) and I am currently looking to enhance the risk management and portfolio capabilities. As I test portfolios of concurrent assets of different base currencies I need to implement a currency conversion algorithm for margin calculation purpose, base currency pnl, and capital utilization purposes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no issue with my EMS and OMS in real time as each subscribed asset will pass its base currency into a scheduler which frequently updates those fx pairs that aid in converting the asset base currency to overall account base currency. However, as I deal with many hundreds of millions of ticks in backtests I cannot afford to update such fx pairs on each tick, at least it would be computationally prohibitively expensive. obviously we are talking historical data but I have all historical tick based data for any and all currencies pairs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you offer solutions or ideas how to handle such issue? One idea is to update the batch of conversion fx pairs once per day (just one tick data point per day). Fx rates do not fluctuate too much on any given day to make a too significant impact on order sizing, margin calculations, and notional exposure. But any alternative views or recommendations are highly welcomed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-07-26T11:22:45.510" Title="How to most optimally perform currency conversions when backtesting on portfolio level?" Tags="&lt;backtesting&gt;&lt;programming&gt;&lt;fx&gt;&lt;currency&gt;" AnswerCount="3" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="8535" PostTypeId="1" AcceptedAnswerId="8537" CreationDate="2013-07-19T15:54:30.517" Score="1" ViewCount="2352" Body="&lt;p&gt;What would the schedule of payments be for a bond with a sinking fund? I know how to price a bond but how does the sinking fund play into it?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Semi-Annual Pay Bonds   &#xA;Maturity    12/31/2033&#xA;Original Par    10,000,000&#xA;Coupon Rate 4%&#xA;First interest payment date 6/30/2014&#xA;&#xA;Principal Sinking Fund payments of $1 million per year  &#xA;(in December) for last 10 years starting in 12/31/2024  &#xA;(through 12/31/2033)    &#xA;&#xA;&#xA;&#xA;              Bond Interest Payment    Bond Principal Payment   Total Bond Payment&#xA;6/30/2014           &#xA;12/31/2014          &#xA;6/30/2015           &#xA;12/31/2015          &#xA;6/30/2016           &#xA;12/31/2016          &#xA;6/30/2017           &#xA;12/31/2017          &#xA;6/30/2018           &#xA;12/31/2018          &#xA;6/30/2019           &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4729" LastActivityDate="2013-07-24T07:28:29.760" Title="Valuation of a Sinking Bond Fund" Tags="&lt;fixed-income&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8537" PostTypeId="2" ParentId="8535" CreationDate="2013-07-19T16:29:53.050" Score="2" Body="&lt;p&gt;A sinking fund provides credit enhancement for the investor and reduces interest rate risk for the issuer.  The obligor will purchase a pre-determined amount of bonds to be retired in the open market if they're trading below par, or they will make payments to the appointed trustee who will buy-back the bonds in a lottery(typically at a pre-determined call price).  Schedules vary considerably and may include other provisions such as deferment periods or acceleration features.  One just needs to read the indenture to see how predictable the schedule will be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the investors point of view, the advantages of a sinking fund is that it ensures a timely paydown of the principal so the maturity payment is easier to make.  It will enhance the liquidity of the debt, which is especially nice for smaller issues in thinner secondary markets.  Finally, the pricing will be more stable since the issuer may become an active participant in the buy side when prices fall.  All of these will nudge the bond towards lower yields and tighter spreads.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are some drawbacks, especially if you happen to be one of the lottery bonds called early, wasting your time in analyzing the bond and potentially relinquishing a high coupon if rates fall.  This can put downward pressure on new issues prices when interest rates are high since contraction risk will be greater.  Other features such as acceleration can also put downward pressure on prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for actually pricing the bond, treat it as you would a callable bond.  The indenture, or preferably your data provider, will give you the information you need.  Besides the obvious coupon/frequency etc., you need to know the probability of it being retired(amount to retire/remaining issue size),  the price you will receive if retired, and the corresponding schedule.&lt;/p&gt;&#xA;" OwnerUserId="2732" LastEditorUserId="2732" LastEditDate="2013-07-23T15:38:16.060" LastActivityDate="2013-07-23T15:38:16.060" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8538" PostTypeId="2" ParentId="987" CreationDate="2013-07-20T02:32:03.393" Score="5" Body="&lt;p&gt;This is the question I've been waiting for! I work at a large outsourced CIO shop and spend a lot of time evaluating different managers and the strategies they come to us with. I also know a number of people I went to school with that are now at quant funds. There are a couple of important points to keep in mind:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Every respectable quantitative manager has a flagship strategy that will never accept capital from outside investors. Most of the ones I've seen tend to have around $1 bil of capacity and never open up to anyone not employed by the firm. The returns I've seen for those funds are all incredible (over 20% CAGRs, with Sharpe ratios over 5), but if you don't do what I do or work for a quant shop, you're never going to know about these funds.&lt;/li&gt;&#xA;&lt;li&gt;The lifecycle of quant funds tends to be different than other funds. If you're Julian Robertson, Chase Coleman, or John Griffin, you have an investing acumen or edge that would take someone years to mimic, assuming they can even come close. Quant funds are only as good as the unpublished investment anomalies they've analyzed. As published research catches up to their research, their performance will deteriorate. So, you tend to see fewer quant firms that have long, impressive track records.&lt;/li&gt;&#xA;&lt;li&gt;Lastly, because they rely on investment anomalies to earn their bread, most quant funds focus on asset gathering rather than straight outperformance. A great example of this would be the plethora of low vol strategies coming to market. These funds look great in backtests because they all exploit the low vol anomaly, and they have a ridiculously high capacity because most low vol stocks tend to have large market caps. If you have the mutually exclusive option of generating higher outperformance by making a few tweaks to a low vol strategy or sacrificing some performance so you can take in another five billion, you're going to go for the option that puts more money in your pocket.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Hope that helps answer your question.&lt;/p&gt;&#xA;" OwnerUserId="5216" LastActivityDate="2013-07-20T02:32:03.393" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8539" PostTypeId="2" ParentId="8525" CreationDate="2013-07-20T11:16:22.903" Score="3" Body="&lt;p&gt;I wanted to add this side note to Quantelbex' answer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both factors in $\exp(a\sqrt t)\exp(b t)$ go to one as $t$ goes to zero, but for small $t$, the $\exp(b t)$ term approaches one faster. For $t=\frac {a^2}{b^2}$ both factors  are the same, if $t$ is smaller than $\frac {a^2}{b^2}$, we have $\exp(a\sqrt t) &amp;gt; \exp(bt)$. Thus the approximation that $\exp(a \sqrt t + b t) \approx \exp(a \sqrt t)$ for small $t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the Taylor expansion for the exponential we can calculate the error that is made with this approximation:\begin{align}\exp(a \sqrt t + b t) - \exp(a\sqrt t) &amp;amp;= 1+a\sqrt t +b t + \frac 12 a^2 t +\mathcal O(t^{3/2}) - (1+a\sqrt t + \frac 12 a^2 t + \mathcal O(t^{3/2}))\\&#xA;&amp;amp;= b t + \mathcal O(t^{3/2})\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second approximation is just the Taylor  expansion of the first one and the error is given by:&#xA;\begin{align}\exp(a \sqrt t + b t) - 1-a\sqrt t &amp;amp;= 1+a\sqrt t +b t + \frac 12 a^2 t +\mathcal O(t^{3/2}) - 1-a\sqrt t\\&#xA;&amp;amp;= (b + \frac 12 a^2) t + \mathcal O(t^{3/2})\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in both cases the error vanishes linear in $t$, but in order to understand the error one makes, one needs to know $a$ and $b$ to know if the approximations are acceptable for the values of $t$ you consider.&lt;/p&gt;&#xA;" OwnerUserId="3263" LastEditorUserId="3263" LastEditDate="2013-07-22T02:35:36.527" LastActivityDate="2013-07-22T02:35:36.527" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8540" PostTypeId="1" CreationDate="2013-07-20T14:09:19.500" Score="4" ViewCount="196" Body="&lt;p&gt;I was reading &lt;a href=&quot;http://www.kitces.com/blog/archives/540-Why-Inferential-Statistics-Is-A-Lousy-Way-To-Evaluate-Active-Managers.html&quot; rel=&quot;nofollow&quot;&gt;an article&lt;/a&gt; recently that pointed out the dangers of using statistical inference in evaluating active managers as the power of statistical tests diminishes with the variance of the underlying data. I can understand the case for requiring more stringent tests like White's reality check, but could you ever make the case that tests for statistical significance should have a lower bar or that a t-test is not useful in evaluating active managers? &lt;/p&gt;&#xA;" OwnerUserId="5216" LastEditorUserId="35" LastEditDate="2013-07-20T15:44:47.657" LastActivityDate="2013-07-27T13:55:51.090" Title="Statistical Power and Active Management" Tags="&lt;equities&gt;&lt;statistics&gt;&lt;statistical-significance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8543" PostTypeId="1" CreationDate="2013-07-21T04:06:41.767" Score="0" ViewCount="7642" Body="&lt;p&gt;I'm dealing with electricity options and I'm considering the possibilty of negative prices. I want two estimate the historic volatility. However, an arithmetic mean doesn't feel appropriate and $\log(\frac{P_i}{P_{i-1}})$ doesn't work if $P_{i-1}$ is less or equal than 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;20th July:  $P_1$= 24 euros/MWh&#xA;21st July:  $P_2$= -70 euros/MWh&lt;/p&gt;&#xA;&#xA;&lt;p&gt;what do you suggest to properly calculate the return rate? what is the correct interpretation?&lt;/p&gt;&#xA;" OwnerUserId="5754" LastEditorUserId="3548" LastEditDate="2013-07-21T17:28:05.230" LastActivityDate="2013-07-23T13:54:31.727" Title="How to calculate return rates with negative prices?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;black-scholes&gt;&lt;asset-returns&gt;" AnswerCount="3" CommentCount="8" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8544" PostTypeId="2" ParentId="8543" CreationDate="2013-07-21T05:08:10.200" Score="-1" Body="&lt;p&gt;In this case,you shouldn't use log return.You should calculate return as (P(i)/P(i-1))-1.&lt;/p&gt;&#xA;" OwnerUserId="5748" LastActivityDate="2013-07-21T05:08:10.200" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8546" PostTypeId="2" ParentId="8543" CreationDate="2013-07-21T17:27:04.023" Score="3" Body="&lt;p&gt;The answer depends on what model you assume for the underlying. The situation, that the underlying can become negative also occures for interest rate spreads and even for interest rates. Here some people use absolute changes, that is $X_{i} - X_{i-1}$ instead of relative changes $\frac{X_{i} - X_{i-1}}{X_{i-1}}$ or (which is almost the same as relative returns) log-returns $\log(\frac{X_{i}}{X_{i-1}})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you model the return as normal distributed, you are assuming that your underlying is log-normal. Hence you estimate vol from log-returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you model the absolute changes as normal distributed, you would estimate the historic vol from absolute changes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you are speaking of options and vol, you should know what your model assumption is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: More details on this can also be found in &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2194917&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2194917&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3548" LastActivityDate="2013-07-21T17:27:04.023" CommentCount="17" ContentLicense="CC BY-SA 3.0" />
  <row Id="8548" PostTypeId="1" CreationDate="2013-07-21T19:39:10.040" Score="7" ViewCount="1443" Body="&lt;p&gt;I am trying to find a formula for the skewed-t VaR. For example the VaR formula for a t-distribution is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\sqrt{\frac{df-2}{df}} \times \Sigma{t} \times \mbox{quantitle}(t-\mbox{dist}, 0.01) + \mu&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Please excuse the messy formula &amp;amp; the sigma(t) denotes a GARCH model)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I am struggling to do the same for a skewed-t distribution&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using the &lt;code&gt;rugarch&lt;/code&gt; package in R and I am struggling to find out which version of the skewed-t distribution is being used. I went to the fGarch pdf and downloaded the reference &lt;a href=&quot;http://arno.uvt.nl/show.cgi?fid=3396&quot;&gt;ON BAYESIAN MODELLING OF FAT TAILS AND SKEWNESS&lt;/a&gt; by C. Fernandez et al., but my lack of Bayesian knowledge means the pdf it says is the Skew-Student is not helping perhaps as much as it should.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be much appreciated.&lt;/p&gt;&#xA;" OwnerUserId="5758" LastEditorUserId="35" LastEditDate="2013-07-21T20:21:22.707" LastActivityDate="2015-11-24T13:18:57.077" Title="Value-at-Risk formula when using skewed-t distribution" Tags="&lt;value-at-risk&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8549" PostTypeId="2" ParentId="2019" CreationDate="2013-07-22T05:09:31.237" Score="4" Body="&lt;p&gt;All books recommended in previous posts are splendid :-) I would like to add one more book for continuous time financial mathematics:&#xA; Arbitrage Theory in Continuous Time by Tomas Bjork.&lt;/p&gt;&#xA;" OwnerUserId="5748" LastActivityDate="2013-07-22T05:09:31.237" CommentCount="0" CommunityOwnedDate="2013-07-22T11:12:50.077" ContentLicense="CC BY-SA 3.0" />
  <row Id="8550" PostTypeId="2" ParentId="8526" CreationDate="2013-07-22T08:36:50.283" Score="2" Body="&lt;p&gt;Perhaps to detect fractal behaviour you could fit something like a Daubechies wavelet. That is, $W(a,b) := \frac{1}{\sqrt{|a|}} \int_{-\infty}^{\infty} f(t) \phi((t-b)/a)dt$. Then you want to check the set $\{W(a,b) : a \in \mathbb{R}_+\}$ where $a$ is the scale, for some fixed $b$. If all the coefficients are similar then this might be some indication of fractal like behaviour at least in that time localisation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good to review stochastic calculus or econometric estimators that take in multiple frequencies for possible solutions.&lt;/p&gt;&#xA;" OwnerUserId="3174" LastEditorUserId="3174" LastEditDate="2013-07-22T08:42:32.327" LastActivityDate="2013-07-22T08:42:32.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8552" PostTypeId="2" ParentId="4948" CreationDate="2013-07-22T13:01:52.143" Score="2" Body="&lt;p&gt;Here is a example of fitting Garch on financial time series. Application for regime switching in trading. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://systematicinvestor.wordpress.com/2012/01/06/trading-using-garch-volatility-forecast/&quot; rel=&quot;nofollow&quot;&gt;http://systematicinvestor.wordpress.com/2012/01/06/trading-using-garch-volatility-forecast/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2318" LastActivityDate="2013-07-22T13:01:52.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8554" PostTypeId="2" ParentId="8543" CreationDate="2013-07-23T13:54:31.727" Score="0" Body="&lt;p&gt;Abandon the idea to use lognormal (GBM) model for power spot market. Just don't do it. Spot power prices have totally different properties and Black-Scholes option prices will not make any sense. They won't be even remotely close to the correct option value!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just a list of things that lognormal model does not capture and that are important for option pricing:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Negative prices&lt;/li&gt;&#xA;&lt;li&gt;Price spikes (stochastic volatility)&lt;/li&gt;&#xA;&lt;li&gt;Mean reversion&lt;/li&gt;&#xA;&lt;li&gt;Strong periodicity (daily, weekly, yearly)&lt;/li&gt;&#xA;&lt;li&gt;Impossibility to hedge small products for sufficiently long time&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="3120" LastActivityDate="2013-07-23T13:54:31.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8555" PostTypeId="2" ParentId="4079" CreationDate="2013-07-23T14:08:40.110" Score="4" Body="&lt;p&gt;I wanted to add this answer for anyone still searching for a convenient way to find this data,&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;go to &lt;a href=&quot;http://www.quandl.com/&quot; rel=&quot;nofollow&quot;&gt;http://www.quandl.com/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;search in this format &lt;code&gt;&amp;lt;ticker&amp;gt; outstanding shares&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Edit: The appropriate result should be in there somewhere, it may no longer be the first link as it previously was.&lt;/p&gt;&#xA;" OwnerUserId="4910" LastEditorUserId="4910" LastEditDate="2014-03-19T15:46:29.083" LastActivityDate="2014-03-19T15:46:29.083" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8558" PostTypeId="2" ParentId="8535" CreationDate="2013-07-24T07:28:29.760" Score="2" Body="&lt;p&gt;I assume the sinking fund is &lt;strong&gt;optional&lt;/strong&gt; and &lt;strong&gt;non-cumulative&lt;/strong&gt;. In effect the issuer of the bond holds 10 European call options on 1 million at 4% each. These are valued using a binomial tree and are interest rate dependent. To value the bond price the bond as if there were no options embedded (I.e. it's single bullet, plain vanilla bond) and then add (really subtract) the value of the options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume that every year the issuer can call a maximum of 1 million. If they are cumulative (e.g. if in year 2 the issuer can call 2 million if a million was not called the year before) then you're best left off with a monte-carlo simulation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fixed Income Securities and Derivatives Handbook - Choudry.&#xA;Binomial trees starting point: &lt;a href=&quot;http://en.wikipedia.org/wiki/Binomial_options_pricing_model&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Binomial_options_pricing_model&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2685" LastActivityDate="2013-07-24T07:28:29.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8559" PostTypeId="2" ParentId="8534" CreationDate="2013-07-24T09:08:26.230" Score="0" Body="&lt;p&gt;If you use the same time each day then on days when the currency market moves a lot, your risk measurement error will be larger than on other days.  Why not monitor the intraday FX movements and update your risk calculations whenever a certain divergence is observed.  The result will be more frequent updating in volatile periods and less frequent updating at other periods, with the additional benefit of being able to control the size of your error tolerance.  &lt;/p&gt;&#xA;" OwnerUserId="3297" LastActivityDate="2013-07-24T09:08:26.230" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8560" PostTypeId="1" CreationDate="2013-07-24T10:26:51.717" Score="11" ViewCount="2315" Body="&lt;p&gt;I'm trying to understand the standard hedging argument to derive the Black--Scholes PDE. There's one aspect of the derivation which I can't get passed and I'd be very grateful for some clarification here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We make the standard assumptions: underlying follows a geometric BM, i.e. $\text{d} S_t = \mu S_t \text{d}t + \sigma S_t \text{d}W_t$ and we let $V(S_t,t)$ be an option written on this security so that by Ito's Lemma, we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\text{d} V_t = \left(\frac{\partial V}{\partial t} + \mu S_t \frac{\partial V}{\partial S} + \frac{1}{2} \sigma^2 S^2_t \frac{\partial^2 V}{\partial S^2}\right) \text{d}t + \left(\sigma S_t \frac{\partial V}{\partial S}\right) \text{d}W_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All good so far. We then set-up a portfolio consisting of a single option and some amount $\Delta(S_t,t)$ of the underlying whose value is given by $\Pi_t = V_t + \Delta(S_t,t) S_t$. It is then assumed that this portfolio be &lt;em&gt;self-financing&lt;/em&gt;, i.e. that there are no additional inflows or outflows of cash, formalised as $\text{d} \Pi_t = \text{d} V_t + \Delta(S_t,t) \text{d} S_t$. We then choose $\Delta(S_t,t) = - \frac{\partial V}{\partial S}$ and then by substituting this into the above formula and using self-financing, we quickly obtain a &lt;em&gt;riskless&lt;/em&gt; portfolio and the Black--Scholes PDE follows from there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The point that confuses me is that it is not clear to me that we can definitely construct a portfolio satisfying $\Pi_t = V_t - \frac{\partial V}{\partial S} S_t$ &lt;em&gt;which also&lt;/em&gt; must satisfy $\text{d} \Pi_t = \text{d} V_t - \frac{\partial V}{\partial S} \text{d} S_t$. Every text I can find simply assumes that you can and proceeds as above. However, the existence of such a portfolio implies that $\frac{\partial V}{\partial S} S_t = \int_0^t \frac{\partial V}{\partial S}(S_u,u) \text{d}S_u$ and I don't see that this is necessarily true, that is to say, I don't see how such a portfolio can exist? What am I missing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The interesting thing is that I have followed a different derivation of Black--Scholes where the portfolio instead consists of some amount of the underlying and some amount of a risk-free instrument $B_t$, i.e. $\Pi_t = \alpha(S_t,t) S_t + \beta(S_t,t) B_t$. Here we choose $\alpha(S_t,t) = \frac{\partial V}{\partial S}$ as before to remove the risk but this time the freedom in $\beta(S_t,t)$ seems to mean that we can ensure the portfolio is self-financing and therefore I am happy with this version of the argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would really like to understand both arguments and where it is that I am going wrong in the first so any help is gratefully appreciated!&lt;/p&gt;&#xA;" OwnerUserId="5774" LastEditorUserId="5774" LastEditDate="2013-07-24T15:59:49.530" LastActivityDate="2013-10-30T20:11:26.930" Title="Black--Scholes hedging argument" Tags="&lt;black-scholes&gt;&lt;black-scholes-pde&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="8561" PostTypeId="2" ParentId="8560" CreationDate="2013-07-24T12:32:25.067" Score="4" Body="&lt;p&gt;According to wikipedia one chooses $\pi_t=-V_t+\frac{\partial V}{\partial S}S_t$. This means, you are shorten $V$ and long $\frac{\partial V}{\partial S}$ shares of $S$. The general theory of self-financing strategies assumes that your market consists of a $\mathbb{R}^{d+1}$ process $S$, with $d$ risky assets and one risk free (bank account). A trading strategy is then a function $\phi=(\vartheta,\eta)$, where $\vartheta$ is $\mathbb{R}^d$-valued and $\eta$ is real-valued. Of course you have to put some additional assumptions on both of them. The general value process $V$ is defined to be $\vartheta S+\eta$ (note we discount everything, so the bank account is constant $1$). Self-financing means that the costs are constant over time, where the costs $C_t(\phi)=V_t(\phi)-\int\vartheta_udS_u$. So to be self-financing means $C_t(\phi)=C_0(\phi)=V_0(\phi)$ for all $t$. The following result is easily verified:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;There is a bijection between self-financing strategies and pairs $(V_0,\vartheta)$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So it is enough to set up the strategy for your risky asset and your initial cash amount to obtain a self-financing strategy. In your example you exactly specify the risky part of your asset, leading to a self-financing strategy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in my opinion, there is more elegant way to derive the PDE. Assume very generally that your payoff is of the form $H=h(S_T)$, where $h$ is some measurable function. From risk neutral pricing you now that the value process of $H$ is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V_t^H=E_Q[H|\mathcal{F}_t]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;under an equivalent local martingale measure. Therefore $V^H$ is a $Q$-martingale. Using independence of Brownian Motion you will easily find that $$V_t^H=E_Q[h(S_T)|\mathcal{F}_t]=v(t,S_t)$$&#xA;One can prove that the function $v$ is sufficiently smooth. Applying Itô:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dV^H=dv=v_x(t,x)\sigma S_tdW^Q_t+(v_t(t,x)+\frac{1}{2}v_{xx}(t,x)\sigma^2S^2_t)dt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a $Q$ BM $W^Q$ and using the dynamics under $Q$ of $S$. Since $V^H$ is a &#xA;$Q$ martingale, the finite variation part has to vanish, so you get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$v_t(t,x)+\frac{1}{2}v_{xx}(t,x)\sigma^2x^2=0$$&#xA;with $v(T,\cdot)=h(\cdot)$. Using undiscoutend terms, $v(t,x)=\exp{(-rt)}\tilde{v}(t,x\exp{(rt)})$, plugging this into the PDE above, gives exactly the BS-PDE:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$0=\frac{\partial\tilde{v}}{\partial t}+r\tilde{x}\frac{\partial\tilde{v}}{\partial \tilde{x}}+\frac{1}{2}\sigma^2\tilde{x}^2\frac{\partial^2\tilde{v}}{\partial \tilde{x}^2}-r\tilde{v}$$&#xA;with $\tilde{v}(T,\cdot)=\tilde{h}(\cdot)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course this uses a lot us (basic) stochastic calculus, but if you understand once, what is going on here, you get a better feeling of the theory.&lt;/p&gt;&#xA;" OwnerUserId="17133" LastActivityDate="2013-07-24T12:32:25.067" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="8562" PostTypeId="2" ParentId="8560" CreationDate="2013-07-24T12:43:00.103" Score="3" Body="&lt;p&gt;I believe the setup of the first part you presented is inaccurate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The whole point of the hedge argument is that you can setup a &lt;strong&gt;self-financing&lt;/strong&gt; portfolio that only holds a certain amount of stock and invests/borrows at a specific financing rate. It can be shown that such portfolio almost surely has the same payoff as the option at maturity. The option payoff is F(T) measurable, meaning that the payoff is path-dependent. So, only through investing/borrowing in an interest rate bearing instrument that finances a specific amount of risky asset can such portfolio be constructed and equals the option price at any t. There is more to it (risk neutral pricing and change of measure as part of the complete hedge argument to derive the share of risky asset to be traded to hedge the option payoff so I just presented the gist of it). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your first portfolio equation assumes you trade the option which you actually try to hedge which kind of misses the point of the hedge argument. Where the first part goes wrong is that, as you stated, &quot;there is no cash in or outflow&quot;, which is incorrect: The cash in and out flows that follow from changes in the amount of holding in the risky asset are invested/borrowed in an interest bearing instrument. So, it is true that the whole portfolio is self-contained, however, within the hedge portfolio there is clearly cash flows that have to be borrowed/invested. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I highly recommend to follow pages 217-220 of Stochastic Calculus for Finance II by Steven Shreve to understand the hedge argument and how it sets the stage to derive the Black Scholes pricing model (even though it takes the approach of risk neutral pricing rather than the PDE approach I find it much better to understand the risk neutral pricing approach in order to fully appreciate how the hedge portfolio works and why it is so important.)&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-07-24T12:48:51.450" LastActivityDate="2013-07-24T12:48:51.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8563" PostTypeId="1" CreationDate="2013-07-24T13:42:03.637" Score="6" ViewCount="851" Body="&lt;p&gt;I like to apply the Newey-West covariance estimator for portfolio optmization which is given by &#xA;$$&#xA;\Sigma = \Sigma(0) + \frac12 \left (\Sigma(1) + \Sigma(1)^T \right),&#xA;$$&#xA;where $\Sigma(i)$ is the lag $i$ covariance matrix for $i=0,1$. Furthermore I like to use shrinkage estimators as implemented in the corpcor package for R. The identity matrix as shrinkage prior for $\Sigma(0)$ is plausible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What would you use as prior for $\Sigma(1)$ - the zero-matrix? Do you know an R implementation that allows to estimate lag-covariance matrices using shrinkage? There must be some basic difference as a lag-covariance matrix is not necessarily positive-definite (e.g. the zero-matrix). If I apply shrinkage to $\Sigma(0)$ and use the standard sample-estimator for $\Sigma(1)$ then it is not assured that $\Sigma$ is positive-definite.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: The above definition is taken from:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whitney K. Newey and Keneth D. West. A simple, positive semi-denite, heteroskedasticity and autocorrelation consistent covariance matrix. Econometrica, 55(3):703-708, 1987.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can also be found &lt;a href=&quot;http://arxiv.org/pdf/1009.3638.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; in formula (1.9) on page 6.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2013-07-26T13:13:42.987" LastActivityDate="2013-07-26T13:13:42.987" Title="Shrinkage Estimator for Newey-West Covariance Matrix" Tags="&lt;optimization&gt;&lt;portfolio&gt;&lt;covariance-estimation&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8564" PostTypeId="1" CreationDate="2013-07-24T18:07:55.240" Score="2" ViewCount="72" Body="&lt;p&gt;I am using the KPSS test to check stationarity of a financial time series. I would like to know if there is another test to confirm the stationarity. Any advice?&lt;/p&gt;&#xA;" OwnerUserId="5778" LastEditorUserId="35" LastEditDate="2013-07-24T18:28:55.183" LastActivityDate="2013-07-24T18:28:55.183" Title="Is there a different test to check stationarity?" Tags="&lt;stationarity&gt;&lt;statistical-finance&gt;" AnswerCount="0" CommentCount="1" ClosedDate="2013-07-25T06:22:48.810" ContentLicense="CC BY-SA 3.0" />
  <row Id="8565" PostTypeId="2" ParentId="955" CreationDate="2013-07-25T09:29:34.230" Score="2" Body="&lt;p&gt;A very well thought through exposition on the matter is given in this paper:&lt;br&gt;&#xA;&lt;a href=&quot;http://qwafafew.org/images/uploads/boston/alpha6b.pdf&quot; rel=&quot;nofollow&quot;&gt;A Consultant’s Perspective on Distinguishing Alpha from Noise by John R. Minahan&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It combines a lot of wisdom and common sense that sometimes seems to get lost in the process...&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2013-07-25T09:29:34.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8566" PostTypeId="1" CreationDate="2013-07-25T14:59:10.827" Score="-1" ViewCount="803" Body="&lt;p&gt;Which is best? Or is it irrelevant?&#xA;Hi! Considering Level 2 Data (Market Depth), I want to understand the advantages to have all the order book on an order-by-order basis (or tick-by-tick basis) versus only have a total aggregated volume by price levels? &#xA;Who are the principal users/traders of each method? Can you give me an example of a trading strategy using the order-by-order view?&#xA;Do stock exchanges and vendors should provide Level 2 Data on an order-by-order view?&#xA;Thank you very much in advance. Congrats for this very useful and interesting website!&lt;/p&gt;&#xA;" OwnerUserId="5785" LastActivityDate="2013-07-26T05:51:42.520" Title="Order book depth views preferences: order-by-order vs. total aggregated volume by price levels" Tags="&lt;equities&gt;&lt;limit-order-book&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8568" PostTypeId="2" ParentId="8534" CreationDate="2013-07-25T18:31:28.993" Score="2" Body="&lt;p&gt;There are two factors here, which might or might not be conflicting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) You want to mimic what will happen in production. If your production system sweeps currencies once a day, then backtest that way. If your clearing broker only calculates margin at the end of the day, then do the same in backtests. If you will only resize your portfolio once a month, then do it that way in backtests. Anything else will add to the discrepancy between backtesting and actual performance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) You want to match the time intervals that you will use to evaluate the backtest's performance. If you will be calculating performance on daily outcomes, you need/want to convert currencies once a day for pnl purposes. If you are going to be looking at minute-by-minute portfolio results when calculating Sharpe,etc then you'll have to be converting currencies that often just so that you have a common currency for your calculation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the technology side, I don't see why it would be hard to update the currency prices at the increments that the two factors above suggest. If the volume of currency ticks is slowing down the backtest, you could preprocess the currency data to extract the last tick before each desired time increment. So if it's once a day, you only save one tick per pair. If you don't know in advance what times you want, you could at least make a smaller database that had at most one tick per second per pair.&lt;/p&gt;&#xA;" OwnerUserId="5550" LastActivityDate="2013-07-25T18:31:28.993" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8569" PostTypeId="2" ParentId="8566" CreationDate="2013-07-26T05:51:42.520" Score="2" Body="&lt;p&gt;As someone pointed out, most times you do not have a choice because how the order book is disseminated heavily depends on the exchange. In Asia there are exchanges that even show the name of the counter party (though only aggregate volume not each order). Other exchanges provide a full &quot;view&quot;, again others price level aggregates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Broadly speaking, some strategies benefit from being able to process each single order. One of such strategy would be a predatory VWAP algorithm (I have written some myself) which greatly benefit from information of each order. In combination with what I mentioned that some exchanges show counter party names/ids in aggregate volume from, such individual order information can be incredibly valuable. It is not one of the hardest exercises to quantitatively identify large VWAP orders that are &quot;worked&quot; in the market. Any individual order information is highly valuable in understanding whether they are aggressive, neutral, or defensive in their trading approach which in turn will give a lot of information about whether they most likely &quot;chase&quot; certain short-term momentum or wait to buy on expected pull-backs. Sorry but I am not able to pass on more detailed information but I think that should be detail enough to understand when order by order information can be put to use. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-07-26T05:51:42.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8570" PostTypeId="1" AcceptedAnswerId="8571" CreationDate="2013-07-26T08:29:29.420" Score="7" ViewCount="247" Body="&lt;p&gt;If we know the dynamics of $S$, then we can estimate the value of $S$ at a time point, $t$. Here, I have a question concerning how to solve for $S_t$ by Itô because I obtained different results by different approaches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a geometric Brownian motion:&#xA;$$dS_t=S_t μ dt+S_t σdW_t,$$&#xA;$$\frac{dS_t}{S_t} =μ dt+σdW_t,$$&#xA;and, in fact we have,&#xA;$$\frac{dS_t}{S_t} =d\ln(S_t).$$&#xA;If we make $Z=d\ln(S_t)$, then,&#xA;$$dZ=\frac{\partial Z}{\partial t} dt+\frac{\partial Z}{\partial S_t} dS_t+ \frac{1}{2} \frac{\partial^2 Z}{\partial S_t^2} (dS_t)^2=(μ-\frac{1}{2} σ^2 )dt+σdW_t,$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Z_t= Z_0+\left(μ- \frac{σ^2}{2} \right) \int_0^tds+σ\int_0^tdW_s,$$&#xA;$$\ln(S_t )=\ln(S_0 )+(μ-\frac{1}{2} σ^2 )dt+σW_t,$$&#xA;$$S_t=S_0 \cdot e^\left((μ- \frac{1}{2} σ^2 )dt+σW_t \right).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if I use another approach, then I get the different result. Since we have&#xA;$\frac{dS_t}{S_t} =d\ln(S_t)$ then,&#xA;$$d\ln(S_t )=μdt+σdW_t$$&#xA;and &#xA;\begin{align}&#xA;\ln(S_t)&amp;amp;=\ln(S_0)+μ\int_0^tds+σ\int_0^t dW_s \\&#xA;&amp;amp;=\ln(S_0)+μt + σW_t,&#xA;\end{align}&#xA;$$S_t=S_0 \cdot e^{(μt+σW_t)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think both approaches are correct. But why are the results distinct?&lt;/p&gt;&#xA;" OwnerUserId="5748" LastEditorUserId="5657" LastEditDate="2013-07-26T16:24:37.417" LastActivityDate="2013-07-26T16:26:45.607" Title="A question on Ito" Tags="&lt;stochastic-calculus&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8571" PostTypeId="2" ParentId="8570" CreationDate="2013-07-26T09:20:32.240" Score="9" Body="&lt;p&gt;The part where you say that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{dS_t}{S_t} = d\ln(S_t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is &lt;strong&gt;wrong&lt;/strong&gt;, because $S$ is a stochastic variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is exactly what Itô tells you with his formula that you apply right do compute your $dZ$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The difference comes from the quadratic variation of the process $S$ which you express as $(dS)^2$. If you don't add this term when the variable are stochastic, your derivation is wrong.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2013-07-26T10:27:03.330" LastActivityDate="2013-07-26T10:27:03.330" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8572" PostTypeId="1" AcceptedAnswerId="8574" CreationDate="2013-07-26T10:41:39.090" Score="0" ViewCount="171" Body="&lt;p&gt;I want to calculate company-level market cap values for stock exchanges listed by Bloomberg.  I gather this &lt;a href=&quot;http://en.wikipedia.org/wiki/Market_capitalization&quot; rel=&quot;nofollow&quot;&gt;can be calculated&lt;/a&gt; as the product of share price and the total of shares in circulation.  But this approach does not seem to add up: for example the London Stock Exchange's data on FTSE100 members (&lt;a href=&quot;http://www.londonstockexchange.com/statistics/companies-and-issuers/companies-and-issuers.htm&quot; rel=&quot;nofollow&quot;&gt;see their 'List of All Companies'&lt;/a&gt;) gives a £9,521.4 million cap value for Pearson, but calculating for this company from &lt;a href=&quot;http://www.bloomberg.com/quote/UKX%3aIND/members&quot; rel=&quot;nofollow&quot;&gt;Bloomberg stats&lt;/a&gt; yields £2,796m (£1,331.00 * 2.1m shares).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone possibly clarify what the LSE figure is based on?  I'm not an economist or finance expert but need reliable data on company cap values around the world. I'd prefer to get this centrally from somewhere like Bloomberg than interrogate 50+ exchange websites!  So alternatively it would be really helpful to know of a better way to get this data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="5792" LastEditorUserId="5792" LastEditDate="2013-07-26T13:05:39.657" LastActivityDate="2013-07-26T13:05:39.657" Title="Calculating company-level market capitalisations from share quantities and values" Tags="&lt;statistics&gt;&lt;market-data&gt;&lt;bloomberg&gt;&lt;market-capitalization&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8573" PostTypeId="2" ParentId="8534" CreationDate="2013-07-26T11:22:45.510" Score="2" Body="&lt;p&gt;From a practical standpoint, the conversion rate can be kept constant during the day. It won't be precise, but it'll be fast. Stat arb backtesters have plenty of precedent where the entry price is the day's close plus a slippage factor. So if your goal is adversarial research (where there question is &quot;would this strategy work?&quot;), then you could add a negative fudge factor to the conversion rate that always makes your results look slightly worse.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2013-07-26T11:22:45.510" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8574" PostTypeId="2" ParentId="8572" CreationDate="2013-07-26T12:32:04.097" Score="4" Body="&lt;p&gt;I think you are misinterpreting the data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now, looking at &lt;a href=&quot;http://www.bloomberg.com/quote/PSON%3aLN&quot; rel=&quot;nofollow&quot;&gt;Bloomberg webpage&lt;/a&gt;, the Market Cap of Pearson is &lt;strong&gt;11.142,56(M)&lt;/strong&gt;. This figure has been obtained looking at the heading &lt;strong&gt;Market Cap (M GBP)&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternative, if you go through the Number of Shares x Share Price route, using the same  &lt;a href=&quot;http://www.bloomberg.com/quote/PSON%3aLN&quot; rel=&quot;nofollow&quot;&gt;Bloomberg webpage&lt;/a&gt;, you obtain: &lt;strong&gt;Shares Outstanding (M)&lt;/strong&gt; x &lt;strong&gt;Current Share Price&lt;/strong&gt; = 817.50 (M) * £13,65 = &lt;strong&gt;11.158.88(M)&lt;/strong&gt;, which is a similar figure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, the difference is likely due to the fact that &lt;a href=&quot;http://www.bloomberg.com/quote/PSON%3aLN&quot; rel=&quot;nofollow&quot;&gt;Bloomberg webpage&lt;/a&gt; is not reporting real time or exact figures for Shares Outstanding and Current Share Price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at a &lt;a href=&quot;http://en.wikipedia.org/wiki/Bloomberg_Terminal&quot; rel=&quot;nofollow&quot;&gt;Bloomberg terminal&lt;/a&gt;, the number of shares outstanding is 817.502.853, and the current share price is £13,63, which yield a Market Cap of: 11.142.564.453 or &lt;strong&gt;11.142,56 millions&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in short: yes, you can obtain Market Caps directly from the &lt;a href=&quot;http://www.bloomberg.com/quote/PSON%3aLN&quot; rel=&quot;nofollow&quot;&gt;Bloomberg webpage&lt;/a&gt;, but you need to look at the correct heading.&lt;/p&gt;&#xA;" OwnerUserId="5208" LastEditorUserId="35" LastEditDate="2013-07-26T13:01:03.457" LastActivityDate="2013-07-26T13:01:03.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8575" PostTypeId="1" CreationDate="2013-07-26T13:49:37.623" Score="2" ViewCount="127" Body="&lt;p&gt;This is to some extent a theoretical question and maybe we can work together to produce some input and output. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Diverse option pricing models are reported to be misspecified in various studies. One example is the paper of Baksi et. al (1997) called &quot;Empirical performance of alternative option pricing models&quot;. The authors come to this conclusion by estimating the implied volatilities for a full dataset, and then re-estimating these implied volatilities for six subsets based on the moneyness-maturity categories. They find differences between the values of the implied volatilities. I quote: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;if each candidate option pricing model were correctly specified, the&#xA;  six sets of option   prices, formed across either moneyness or&#xA;  maturity, should not have resulted in different implied parameter&#xA;  volatility values nor should the “implied-parameter matrix” treatment&#xA;  have led to any performance improvement.&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My first question is, &lt;strong&gt;what does misspecified actually mean&lt;/strong&gt;? Isn't this difference between the implied parameters due to the presence of the volatility smile; in that case, one should say that the models are not misspecified, but that this is a result due to the data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly, &lt;strong&gt;how do some models allow for this misspecification&lt;/strong&gt;? If for instance, a specific model is misspecified during a particular period, it is imaginable that it produces a smaller pricing error during a different sub-period. One example I heard is the GARCH option pricing model; a constant GARCH model is nested within the GARCH framework, so that it allows for misspecification. I don't entirely understand this concept, so maybe someone can help me out?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="2291" LastActivityDate="2013-07-26T13:49:37.623" Title="Do some option pricing models allow for misspecification and what does it mean?" Tags="&lt;option-pricing&gt;&lt;calibration&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8576" PostTypeId="1" CreationDate="2013-07-26T15:05:33.257" Score="-5" ViewCount="130" Body="&lt;p&gt;Everything I have read about XIRR (e.g., as calculated in Excel) says that there is no closed-form equation and it must be calculated by iterated approximation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could someone give a brief mathematical explanation of why there is no closed-form solution?&lt;/p&gt;&#xA;" OwnerUserId="5794" LastEditorUserId="16595" LastEditDate="2018-10-09T08:05:41.990" LastActivityDate="2018-10-09T08:05:41.990" Title="Why is there no closed-form equation for XIRR?" Tags="&lt;returns&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8577" PostTypeId="2" ParentId="8576" CreationDate="2013-07-26T15:13:04.243" Score="3" Body="&lt;p&gt;The &lt;em&gt;internal rate of return&lt;/em&gt; is simply the rate at which the &lt;em&gt;net present value&lt;/em&gt; is zero. So solve for $r$ in &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\sum{\frac{C_n}{(1+r)^n}} = 0&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no closed-form solution to this.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2013-07-26T15:13:04.243" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8578" PostTypeId="2" ParentId="8570" CreationDate="2013-07-26T16:02:19.270" Score="1" Body="&lt;p&gt;You're right, both approaches are correct in a way (but I think you have some messiness in how you written everything out as @SRKX pointed out) ... but under different formulations of stochastic calculus. Your second answer is the solution for the &lt;a href=&quot;http://en.wikipedia.org/wiki/Stratonovich_stochastic_calculus&quot; rel=&quot;nofollow&quot;&gt;Stratonovich&lt;/a&gt; SDE:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{d}S_t = \mu S_t \text{d}t + \sigma S_t \circ \text{d}W_t,$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under the Stratonovich interpretation the generic calculus &lt;a href=&quot;http://en.wikipedia.org/wiki/Chain_rule&quot; rel=&quot;nofollow&quot;&gt;chain rule&lt;/a&gt; applies, so you don't need a form of &lt;a href=&quot;http://en.wikipedia.org/wiki/Ito%27s_lemma&quot; rel=&quot;nofollow&quot;&gt;Itô's formula/lemma&lt;/a&gt;, i.e., the chain rule for Itô stochastic calculus. These chain rules are used to remove state dependence (in your case, dependence on $S_t$) from the stochastic integrals that correspond to the SDEs, allowing them to be solved.&lt;/p&gt;&#xA;" OwnerUserId="5657" LastEditorUserId="5657" LastEditDate="2013-07-26T16:26:45.607" LastActivityDate="2013-07-26T16:26:45.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8580" PostTypeId="2" ParentId="8540" CreationDate="2013-07-27T13:55:51.090" Score="3" Body="&lt;p&gt;The main problem with hypothesis testing is going to be survivorship bias. Any manager with a track record you're looking at is only there because they haven't performed badly -- if they perform badly then investors withdraw their money, they collapse, and you don't have their data to do the hypothesis test on! So even if all the managers were investing in geometric Brownian motions then survivorship bias will make a lot of managers for which there is sufficient data pass the skill hypothesis test with flying colours.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other issue is that most of the data you'll be able to get is monthly. You need to do a power estimation of your test if you're using monthly data.&lt;/p&gt;&#xA;" OwnerUserId="3174" LastActivityDate="2013-07-27T13:55:51.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8581" PostTypeId="1" CreationDate="2013-07-27T14:04:22.360" Score="-1" ViewCount="404" Body="&lt;p&gt;I am trying to convert various series of returns into one currency (euro). I saw from aprevious post that soemone suggested using conversion factors, where would I find these? Also, given that the euro only goes back so far is there anyway to get a proxy for historic Eurozone returns?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No, can access the fx data - I suppose my question is if your time series is in US dollars and goes back say 40 years and you want it in Euros, what conversion rate would you use given the Euro hasn't been around that long??&lt;/p&gt;&#xA;" OwnerUserId="5797" LastEditorUserId="-1" LastEditDate="2013-07-28T01:41:02.743" LastActivityDate="2013-07-28T22:53:01.543" Title="Converting time series returns into euro" Tags="&lt;time-series&gt;&lt;currency&gt;&lt;index&gt;&lt;exchange&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8584" PostTypeId="1" CreationDate="2013-07-27T21:48:36.033" Score="0" ViewCount="206" Body="&lt;p&gt;I'd like to estimate from a daily prices serie $P_t$ with $N$ observations a quantity such as the variance of the weekly returns. I will use $\ln\left(\frac{P_{T+5}}{P_T}\right)$ assuming 5 days in a week for a weekly return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The good method (or so it seems) would be to use non-overlapping data, that is to say I will end up with a sample of $N/5$ data points. Let's say I use $\left(\ln\left(\frac{P_{5}}{P_0}\right), \ln\left(\frac{P_{10}}{P_5}\right), ..., \ln\left(\frac{P_{N}}{P_{N-5}}\right) \right)$ as sample to compute the variance (assuming $N$ is a multiple of 5). While this looks like the most robust method, the number of observations is greatly reduced.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to do better? I am thinking about using overlapping data, but then the samples I end up with (for example $\left(\ln\left(\frac{P_{6}}{P_1}\right), \ln\left(\frac{P_{11}}{P_6}\right), ... \right)$) are not independent one from each other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a practical method to deal with this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you all for your answers. Following the advice of SRKX, I am taking a real example. I have used the SPY returns from Jan 4th 2012 up to Dec 28th 2012. This gives an initial data set of 753 prices from which I consider the 3 days returns, to make things easier hopefully.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Out of this sample I can build 3 non-overlapping 3 days returns sets of 250 values each. By 3 days return I indeed mean $R_t = \ln \frac{S_t}{S_{t-3}}$. If $r_t = \ln \frac{S_t}{S_{t-1}}$ then obviously $R_t = r_{t-2}+r_{t-1}+r_t$ (apologizes for the sloppy notation).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If one assigns a number from 1 to 753 to the previous close prices, the first sample built with non-overlapping data is then:&#xA;$$Sample_1 = (\ln \frac{S_4}{S_1}, \ln \frac{S_7}{S_4}, ..., \ln \frac{S_{751}}{S_{748}})$$&#xA;and the second and third are $Sample_2 = (\ln \frac{S_5}{S_2}, \ln \frac{S_8}{S_5}, ..., \ln \frac{S_{752}}{S_{749}})$, $Sample_3  = (\ln \frac{S_6}{S_3}, \ln \frac{S_9}{S_6}, ...\ln \frac{S_{753}}{S_{750}})$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't want to choose a priori a specific distribution for the daily returns $r_t = \ln \frac{S_t}{S_{t-1}}$. All I will assume is that $E[r_i r_j] = 0$ for $i \neq j$, $E[r_i]=0$ (reasonable for the considered sample) and $E[r_i^2] = \sigma^2$ (this is not quite the case but let's keep this anyway).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under these assumptions, I expect that the empirical correlation between the sample 1 and 2 will be $\frac{2}{3}$: $\ln \frac{S_4}{S_1} = r_2+r_3+r_4$ and $\ln \frac{S_5}{S_2} = r_3+r_4+r_5$, so the first elements of these samples have 2 daily returns in common, the remaining terms ($r_2$ and $r_5$) are not correlated (with each other and with $r_3+r_4$), same for all the terms of the sample, hence the result. Same goes for the correlation between the samples 2 and 3, and the correlation between sample 1 and 3 will be $\frac{1}{3}$ (under these assumptions the correlation for the $N$ days returns with $p$ days overlap is $\frac{p}{N}$ if I am not mistaken).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am lucky, for the data I have chosen it works quite well, I measured the empirical correlations between sample 1 and 2 = $0.63,$ sample 2 and 3 = $0.6$, sample 1 and 3 = $0.3$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far so good, now I can compute the 3 resulting (annualized) volatilities out of the 3 samples: I found $\sigma_1 = 18.4\%$, $\sigma_2 = 17.1 \%$ and $\sigma_3 = 18.5\%$. The average of these values is $18\%$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can also compute the same thing by fusioning the 3 samples (so everything is mixed), which gives $18\%$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As SRKX said all these results are finally almost the same... But my question really is: does it make sense to do this? Does computing the 3 sample variances add some information or not? It looks like for $N$ days returns, if the overlap $p$ is small the correlation between the samples can be reduced down to a &quot;small enough&quot; value (for large $N$, which is what I am interested in): in this case can it be used?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or I should just use other techniques like bootstrapping the first sample and not try to play with the overlapping samples?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope I was not too long and clear enough... It might be completely trivial but for now something is not clear for me.&lt;/p&gt;&#xA;" OwnerUserId="5800" LastEditorUserId="5800" LastEditDate="2013-07-30T03:48:32.163" LastActivityDate="2014-02-19T12:17:10.507" Title="Estimate weekly, yearly quantities from finite samples" Tags="&lt;statistics&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8585" PostTypeId="1" CreationDate="2013-07-28T07:34:57.147" Score="2" ViewCount="147" Body="&lt;p&gt;I'm building an model on different loans' NPL rate. The problem is NPL rates are always affected by the market. When NPL rates move in trend, my model will fail the back-testing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming $x(t)$ is a random variable that distributed among $[-1, 1]$, with the mean $\mu = 0$ and a standard deviation $\sigma$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When the sample size $n$ is big, the distribution of observed mean $\bar x$ will be ~ $N(0, \sigma^2/n)$. The back-testing confidence interval for $\bar x$ is $[- z_{\frac{\alpha}{2}} \frac{\sigma}{\sqrt{n}} , z_{\frac{\alpha}{2}} \frac{\sigma}{\sqrt{n}} ]$. The model always passes the backtest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, troubles come when $x(t)$ has some trend. Let's say $x(t)$ becomes $x(t) = \sin (t + random(t) )$. Here $x(t)$ still follows the distribution, but when $x(t)$ moves near $+1$, the samples' mean will be around $+1$, increasing the sample size will not bring the $\bar x$ near to $0$, the model fails the backtesting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now my problem is, NPL's trend is hard to predict, the cycle sometimes are 6 months, sometimes are 2 years. My NPL model always fails the back-testing because of trend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestion please?&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2013-09-29T10:24:33.590" Title="how to make a distribution model tolerable of trend?" Tags="&lt;backtesting&gt;&lt;modeling&gt;&lt;distribution&gt;&lt;trends&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8588" PostTypeId="2" ParentId="8584" CreationDate="2013-07-28T14:22:58.183" Score="1" Body="&lt;p&gt;I believe you should use the &quot;usual&quot; weekly dates i.e. $r_t = \ln \frac{S_t}{S_{t-5}}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do using the other methods, you are actually using blending 5 different weekly series, which is not exactly correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, I don't expect any of your measure to differ a lot. Try to compute them separately and then all of them together and you would probably get rather similar result. If that's the case, then just use the classic way I mention in the first line, you'll avoid controversy.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2013-07-28T14:22:58.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8590" PostTypeId="2" ParentId="8581" CreationDate="2013-07-28T22:53:01.543" Score="1" Body="&lt;p&gt;The best approximation of EUR/USD crossrate is probably Deutsche Mark - USD. However you need to be careful for the period around the creation of the Euro: due to the &lt;a href=&quot;http://en.wikipedia.org/wiki/European_Exchange_Rate_Mechanism&quot; rel=&quot;nofollow&quot;&gt;exchange rate mechanism&lt;/a&gt; European currency rates aren't really fully market-based. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume you are aware of the Bretton woods system so won't talk about caveats in using currency data too far back (I see you said you have 40 years of USD data, that sounds about right). &lt;/p&gt;&#xA;" OwnerUserId="5667" LastActivityDate="2013-07-28T22:53:01.543" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8591" PostTypeId="1" CreationDate="2013-07-29T02:56:09.013" Score="3" ViewCount="1031" Body="&lt;p&gt;This is a question about why options prices do not take volume into account. The popular option valuation formula &quot;black-scholes&quot; certainly does not account for this and I don't suggest that it does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But one could hold a large option position while the underlying asset's price walks up or down on very low volume, allowing the option to gain more and more value and be liquidated without affecting the market for the underlying asset. This seems strange to me, since it would seem to me that the option's value/price should have a liquidity premium for exercising the option and closing the position on the underlying asset, despite the fact that most options are not exercised.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I like the inefficiencies in option pricing, as a speculative tool and the predictability in calculating intrinsic value as an in the money option moves deeper in the money. But it seems that volume weighted price nearer expiration should determine the price of an option's intrinsic value in the black-scholes formula&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thoughts and insight appreciated&lt;/p&gt;&#xA;" OwnerUserId="1453" LastActivityDate="2013-07-29T07:24:16.013" Title="options pricing using vwap" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;vwap&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8592" PostTypeId="2" ParentId="8591" CreationDate="2013-07-29T07:24:16.013" Score="4" Body="&lt;p&gt;As you correctly pointed out volume has no place in the pricing models of most any option(Unless of course you create an option whose underlying or is volume in some way or if volume is used as some sort of barrier). The reason is simple: The contingent payoff and hence the probability of ending up in the money is not a function of volume. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why the market is perfectly comfortable with that fact, including those who hedge the option with underlying assets is because liquidity is priced into the implied volatility directly to some degree but it is especially priced into the implied vol spread. Should the underlying be highly illiquid or should, for example a highly uncertain dividend declaration loom, then spreads in the quoted implied vols will widen. This can easily be seen when you compare options on underlying assets that are highly liquid with much turnover vs options whose underlying rarely trades. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-07-29T07:24:16.013" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8593" PostTypeId="2" ParentId="8584" CreationDate="2013-07-29T10:29:42.123" Score="3" Body="&lt;p&gt;In increasing order of complexity:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If you can assume that your process is lognormal then the way to go is doing stats on the highest frequency returns and then scaling the results to the desided horizon (see the &lt;a href=&quot;https://stats.stackexchange.com/questions/63882/scaling-a-normal-distribution-while-using-ewma/63887#63887&quot;&gt;two references here&lt;/a&gt; for this and the next point).&lt;/li&gt;&#xA;&lt;li&gt;For other transition probabilities (still assuming i.i.d. increments) the scaling can be less trivial but can still be performed at worst numerically (e.g. via PDF convolution)&lt;/li&gt;&#xA;&lt;li&gt;If you're interested in capturing features such as autocorrelation then the issue gets complicated, see e.g. Newey-West and &lt;a href=&quot;https://quant.stackexchange.com/questions/8563/shrinkage-estimator-for-newey-west-covariance-matrix&quot;&gt;this question&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Time series models like GARCH capture evolving characteristics departing from i.i.d. increments. You fit the model to the highest frequency data and then using it you can recover the unconditional PDF at any given horizon (by resimulation or analytically).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The latter option seems to be what you're looking for.&#xA;There are other techniques for dealing with correlated samples such as overlapping returns (without fitting a specific model), but their drawbacks are still significant in practice and may not lead to the hypotetical accuracy improvement.&lt;/p&gt;&#xA;" OwnerUserId="3015" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2014-02-19T12:17:10.507" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8594" PostTypeId="1" AcceptedAnswerId="8620" CreationDate="2013-07-30T02:25:54.667" Score="17" ViewCount="26703" Body="&lt;p&gt;I have seen the following formula for the tangency portfolio in Markowitz portfolio theory but couldn't find a reference for derivation, and failed to derive myself. If expected excess returns of $N$ securities is the vector $\mu$ and the covariance of returns is $\Sigma$, then the tangent portfolio (maximum Sharpe Ratio portfolio) is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;w^* = (\iota \Sigma^{-1} \mu)^{-1} \Sigma^{-1} \mu&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $\iota$ is a vector of ones. Anyone know a source of the derivation? &lt;/p&gt;&#xA;" OwnerUserId="5667" LastEditorUserId="35" LastEditDate="2013-07-30T02:38:46.233" LastActivityDate="2014-02-04T13:46:31.853" Title="Derivation of the tangency (maximum Sharpe Ratio) portfolio in Markowitz Portfolio Theory?" Tags="&lt;optimization&gt;&lt;modern-portfolio-theory&gt;&lt;mean-variance&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="8595" PostTypeId="1" CreationDate="2013-07-30T04:17:11.467" Score="6" ViewCount="2920" Body="&lt;p&gt;In backtesting (nasdaq stocks), I make the assumption that I have the ability buy/sell each day at the opening and closing prices. Is this realistic?&lt;/p&gt;&#xA;" OwnerUserId="3045" LastActivityDate="2015-11-26T15:26:52.533" Title="Backtesting - can you buy/sell at open and closing prices?" Tags="&lt;backtesting&gt;" AnswerCount="4" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8596" PostTypeId="1" CreationDate="2013-07-30T04:26:19.093" Score="4" ViewCount="1498" Body="&lt;p&gt;Does anyone know if the Fama-French three factor model has been re-examined empirically after 1993, when the original paper was first published? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am asking because there seems to be considerable debate about whether the SMB and HML factors represent true risk-factors. It seems to me the best test is to see whether they still work out of sample. &lt;/p&gt;&#xA;" OwnerUserId="5667" LastActivityDate="2013-08-09T14:39:53.553" Title="Does Fama French Three Factor Model Work out of Sample (after 1993)?" Tags="&lt;pricing&gt;&lt;factor-models&gt;&lt;capm&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8597" PostTypeId="2" ParentId="8596" CreationDate="2013-07-30T05:48:23.550" Score="7" Body="&lt;p&gt;You might want to read this:&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1720139&quot;&gt;Size, Value, and Momentum in International Stock Returns by Fama and French (2011)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Abstract:&lt;br&gt; In the four regions (North America, Europe, Japan, and&#xA;  Asia Pacific) we examine, there are value premiums in average stock&#xA;  returns that, except for Japan, decrease with size. Except for Japan,&#xA;  there is return momentum everywhere, and spreads in average momentum&#xA;  returns also decrease from smaller to bigger stocks. We test whether&#xA;  empirical asset pricing models capture the value and momentum patterns&#xA;  in international average returns and whether asset pricing seems to be&#xA;  integrated across the four regions. Integrated pricing across regions&#xA;  does not get strong support in our tests. For three regions (North&#xA;  America, Europe, and Japan) local models that use local explanatory&#xA;  returns provide passable descriptions of local average returns for&#xA;  portfolios formed on size and value versus growth. Even local models&#xA;  are less successful in tests on portfolios formed on size and&#xA;  momentum.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2013-07-30T08:13:50.093" LastActivityDate="2013-07-30T08:13:50.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8600" PostTypeId="2" ParentId="8595" CreationDate="2013-07-30T16:10:23.023" Score="4" Body="&lt;p&gt;I do know of a largish prop shop that (as of 2009) had a deal with their prime broker to trade Nasdaq ETFs at the closing price, in size, so long as they gave a few hours' notice of order size and direction and never cancelled.  After commissions and fees, the price was naturally worse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally speaking, you have to assume slippage, as mentioned by chrisaycock, and most shops miss the trade with some regularity.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2013-07-30T16:10:23.023" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="8603" PostTypeId="2" ParentId="8585" CreationDate="2013-07-31T08:33:03.843" Score="0" Body="&lt;p&gt;you could calculate and subtract the trend. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;dx=h(m-x)*dt+s*dz&lt;br&gt;&#xA;x_(t) - x_(t - 1) = m (1 - exp(- h Dt)) + (exp(- h Dt) - 1) x_(t - 1) + e_t&lt;br&gt;&#xA;error e_t normally distributed with &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(s_e)^2 = [1 - exp(- 2 h)] (s^2)/2h   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because when Dt-&gt;0&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x_t - x_(t - 1)  ~h(m-x_(t - 1))dt +  et &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;you calculate the parameters h and m from the mean regression after that....?&lt;/p&gt;&#xA;" OwnerUserId="2872" LastActivityDate="2013-07-31T08:33:03.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8605" PostTypeId="1" CreationDate="2013-07-31T15:03:21.963" Score="2" ViewCount="221" Body="&lt;p&gt;Hypothetical Trade:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I buy 10,000 shares of ASTC using a broker API.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The order is filled in 4 similar lots;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;2500 shares at 0.80&#xA;2500 shares at 0.80&#xA;2500 shares at 0.77&#xA;2500 shares at 0.77&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The easiest way to record these lot fills is if the broker issues a UNIQUE &quot;Lot ID&quot; like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;2500 shares at 0.80 --- LOT ID# 3484HGK&#xA;2500 shares at 0.80 --- LOT ID# DFD38HF&#xA;2500 shares at 0.77 --- LOT ID# JJVKD89&#xA;2500 shares at 0.77 --- LOT ID# FJF9D93&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;THE PROBLEM:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, the broker does not issue LOT ID#'s (yet). A computer program will see the lot fills many times.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;WHAT LOGIC DO I USE TO PREVENT THE PROGRAM FROM RECORDING EACH LOT FILL MORE THAN ONCE?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suggestion 1: I can make a hash based on the attributes of the LOT. That may work, however, if everything matches (timestamp, number of shares, symbol, price) I will get duplicate hashes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suggestion 2: Use the alert notifications. I am not sure the notifications are available from the API.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to know how others have handled this tracking issue.&lt;/p&gt;&#xA;" OwnerUserId="3185" LastEditorUserId="35" LastEditDate="2013-07-31T16:15:59.250" LastActivityDate="2013-08-31T04:18:36.170" Title="How do you handle order tracking (without unique Lot ID's)" Tags="&lt;programming&gt;&lt;order&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8606" PostTypeId="1" CreationDate="2013-07-31T15:21:02.390" Score="0" ViewCount="76" Body="&lt;p&gt;What is the &lt;em&gt;real&lt;/em&gt; value of a single share of company stock?  Let's ignore the &quot;the value is what someone is willing to pay for it&quot; angle.  At some point, there has to be a real inherent value to company stock for it to be worth someone paying money for it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Stocks that pay dividends have an obvious value, but not all stocks do that.  I'm not asking about dividend-bearing stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is also the notion of gaining control of a company by purchasing a controlling interest.  I'm asking about stocks where this is an impossibility (more than 50% owned by a single individual, etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, to ask a specific, if hypothetical, question:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Assume a company at IPO; call it XCo.  XCo is quite profitable.  Before the IPO, XCo is 100% owned by a single person; call him Mr. X.  The IPO documents show that after IPO, 51% of the stock will be retained by Mr. X, and that there is no intention of paying dividends.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Why would anyone be interested in purchasing stock in XCo?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="5825" LastActivityDate="2013-08-01T04:31:31.090" Title="Real value of small numbers of shares of company stock" Tags="&lt;equities&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8608" PostTypeId="2" ParentId="247" CreationDate="2013-07-31T15:43:43.337" Score="1" Body="&lt;p&gt;Extensions of the Black-Scholes model usually focus on relaxing one or more assumptions. Some of these generalizations include:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Log normal distribution of returns (e.g., Corrado and Su, 1996)&lt;/li&gt;&#xA;&lt;li&gt;Continuous trading (e.g., relaxed by Merton, 1976)&lt;/li&gt;&#xA;&lt;li&gt;Continuous evolution of the share price (e.g., relaxed by Cox-Ross-Rubinstein, 1979)&lt;/li&gt;&#xA;&lt;li&gt;Constant interest rates (e.g., relaxed by Baksi et al, 1997)&lt;/li&gt;&#xA;&lt;li&gt;Constant variance on the underlying returns (e.g., relaxed by Heston, 1993)&lt;/li&gt;&#xA;&lt;li&gt;No dividends (e.g., relaxed by Merton, 1973)&lt;/li&gt;&#xA;&lt;li&gt;Contentious diffusion of the underlying (e.g., relaxed by Merton, 1976)&quot;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Etc. Etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I give example of relative `simple' and extensions.&lt;/p&gt;&#xA;" OwnerUserId="2291" LastActivityDate="2013-07-31T15:43:43.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8609" PostTypeId="2" ParentId="8605" CreationDate="2013-07-31T16:13:34.867" Score="1" Body="&lt;p&gt;you forgot to mention what broker or api you are using. AFAIK every broker/exchange provides a execution id, wich is unique for every trade on the trade session, with the execution id and your order id you can group the trades for the order sent. You could check the execution report of the &lt;a href=&quot;http://www.fixprotocol.org/specifications/fix4.4fiximate/ExecutionReport.html&quot; rel=&quot;nofollow&quot;&gt;FIX Protocol&lt;/a&gt; its based on the industry standard and the majority of  brokers use it to deal with the exchanges/ecn.  &lt;/p&gt;&#xA;" OwnerUserId="1360" LastActivityDate="2013-07-31T16:13:34.867" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8611" PostTypeId="2" ParentId="8605" CreationDate="2013-08-01T04:03:38.557" Score="1" Body="&lt;p&gt;I think you are focusing on lots when you should focus on having the API return the original orderID, that is what really matters, not LotIDs (though every API of average quality should generate a unique ID for each individual fill as well).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Chrisaycock is right in saying that each fill you receive should automatically be unique. So you are by definition not double counting even if you are not able to uniquely allocate each fill to the original order. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, you need to find a way to either a) tag your original order you send to your broker with your own unique orderID or b) if the API permits get the assigned original orderID from the order you submitted so you can later on match the fills that are tagged with either your original orderID or the one of the broker. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To summarize, you should &lt;strong&gt;never&lt;/strong&gt; get double counted fills from your broker. If that is the case you should definitely dump that API or change brokers. A fill you receive should be a unique fill, never anything else. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-08-01T04:03:38.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8613" PostTypeId="2" ParentId="8532" CreationDate="2013-08-01T05:13:45.377" Score="2" Body="&lt;p&gt;I checked out a paper which deals with out-of-sample option pricing (&lt;a href=&quot;http://repec.kse.org.ua/pdf/KSE_dp38.pdf&quot; rel=&quot;nofollow&quot;&gt;http://repec.kse.org.ua/pdf/KSE_dp38.pdf&lt;/a&gt;, especially following pp. 40-) and I believe it is a sound approach to test whether the addition of structural parameters ads value in pricing capability to more parsimonious models. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Their approach is to &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;derive additional parameters (I use the term parameter as in parameterized model, additional in the hopes of obtaining a better fit between the model outputs and actual prices), hoping to derive a model that results in a better fit. &lt;/li&gt;&#xA;&lt;li&gt;However, the danger is to overfit such models and they use &quot;out-of-sample&quot; tests in order to verify whether the improvement in fit is merely a function of overfitting or whether the additional parameters display true added forecasting value. &lt;/li&gt;&#xA;&lt;li&gt;The &lt;strong&gt;structural parameters are fixed to t&lt;/strong&gt; but &lt;strong&gt;all other option pricing model inputs are varied over time&lt;/strong&gt; when calculating &lt;strong&gt;option prices at t+1, t+2,...,t+n&lt;/strong&gt;, hence they speak of &lt;strong&gt;out-of-sample testing of structural parameters&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;li&gt;The authors' conclusion of this particular paper is that indeed the approach, that alternative models take by inclusion of structural fitted parameters, is a viable way to model option prices aside the general stochastic volatility models. They state that out-of-sample tests have shown that such parameterized models are able to correctly capture the volatility term structure and smile. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In summary, I would answer question1 with a &quot;reserved&quot; yes if you mean with out-of-sample the testing of structure parameters rather than all model inputs (as described above other time varying parameters, such as stock price,..., are not out-of-sample). The second question I would answer in that the out-of-sample structural parameters at t are used to estimate option prices at (t+1,...t+n), and therefore the other parameters are kept varying by t to zero in on the structural parameter fitness, not on the other parameters. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, my hunch is that the papers you came across focus on the structural parameters, only, when they mean &quot;out-of-sample testing&quot;, while you maybe thought that out-of-sample testing includes all model inputs and thus were perplexed why stock prices at t+1...t+n are used to estime option prices over the same t+1...t+n.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-08-01T05:13:45.377" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8614" PostTypeId="2" ParentId="7374" CreationDate="2013-08-01T05:27:54.097" Score="6" Body="&lt;p&gt;I have honestly not come across a good book (or good enough review to make me buy the book) on Fund Transfer Pricing. While it is not my career focus, I had to familiarize myself a bit with the topic because of certain requirements involving funding trading operations and the performance of funding specific operations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally I would recommend the following papers and presentation material because I read through them myself and I feel it answers several of your questions (bank credit spreads, funding curves and obtain funding in the market, some papers directly cover FTP in commercial banks (which I assume would tangent your project):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In no particular order:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://pure.au.dk/portal-asb-student/files/5207/thesis-vi.pdf&quot; rel=&quot;noreferrer&quot;&gt;Fund TransferPricing in a Commercial Bank&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.ey.com/Publication/vwLUAssets/Fund_transfer_pricing/%24FILE/Fund_Transfer_pricing.pdf&quot; rel=&quot;noreferrer&quot;&gt;Fund Transfer Pricing by Ernst &amp;amp; Young&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2257081&quot; rel=&quot;noreferrer&quot;&gt;Revisiting Fund Transfer Pricing&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.sas.com/resources/whitepaper/wp_17624.pdf&quot; rel=&quot;noreferrer&quot;&gt;FTP and Risk-adjusted Performance Measurement&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.deloitte.com/assets/Dcom-UnitedKingdom/Local%20Assets/Documents/Industries/Financial%20Services/uk-fs-future-bank-treasury-management.pdf&quot; rel=&quot;noreferrer&quot;&gt;Future of Bank Treasury Management&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://executive.education.insead.edu/ressources/library/ckfinder/userfiles/files/Fund%20Transfer%20Pricing%20for%20Deposits%20and%20Loans,%20Foundation%20and%20Advanced.pdf&quot; rel=&quot;noreferrer&quot;&gt;FTP for Deposits and Loans, Foundation and Advanced&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-08-01T05:27:54.097" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8616" PostTypeId="1" AcceptedAnswerId="8618" CreationDate="2013-08-01T09:51:19.263" Score="1" ViewCount="4555" Body="&lt;p&gt;I need to get the IMM dates in excel.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IMM dates are defined as the third Wednesday of every March/June/September/December.&lt;/p&gt;&#xA;" OwnerUserId="2466" LastEditorUserId="2466" LastEditDate="2013-08-01T13:32:43.553" LastActivityDate="2013-08-01T13:32:43.553" Title="IMM dates in excel" Tags="&lt;forward&gt;&lt;cds&gt;&lt;excel&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8617" PostTypeId="2" ParentId="8594" CreationDate="2013-08-01T11:18:39.287" Score="-2" Body="&lt;p&gt;Merton, Robert, 1972, An Analytic Derivation of the Efficient Portfolio Frontier, Journal of Financial and Quantitative Analysis&lt;/p&gt;&#xA;" OwnerUserId="2448" LastActivityDate="2013-08-01T11:18:39.287" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8618" PostTypeId="2" ParentId="8616" CreationDate="2013-08-01T11:57:17.983" Score="2" Body="&lt;p&gt;Not sure how you're looking to use it, but if you start with an IMM date in cell A1 (e.g. 9/18/2013), in cell A2 put...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;=DATE(YEAR(A1), MONTH(A1) + 3, 1 + MOD(4 - WEEKDAY(DATE(YEAR(A1), MONTH(A1) + 3, 1)), 7) + 14)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;...and drag it down.  It will return the 3rd Wednesday of the month for every third month, so assuming that the month of the date you put in cell A1 is March, June, September, or December, this will give you what you're looking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I modified this answer here from another forum: &lt;a href=&quot;http://www.mrexcel.com/forum/excel-questions/25668-calculating-every-third-friday.html&quot; rel=&quot;nofollow&quot;&gt;http://www.mrexcel.com/forum/excel-questions/25668-calculating-every-third-friday.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5831" LastActivityDate="2013-08-01T11:57:17.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8619" PostTypeId="1" CreationDate="2013-08-01T15:47:11.937" Score="2" ViewCount="214" Body="&lt;p&gt;I was estimating a long-run relationship of exchange rate and purchasing power parity. The  residual of the long-run relation which should be $I(0)$, but it is only $I(0)$ when I introduce trend in the long-run relationship. Can someone provide the logic or study material that shows introducing trend is not a problem and how to justify it?&lt;/p&gt;&#xA;" OwnerUserId="5834" LastEditorUserId="35" LastEditDate="2013-08-02T12:59:32.613" LastActivityDate="2013-08-03T10:43:09.037" Title="Trend in Cointegration relationship" Tags="&lt;cointegration&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8620" PostTypeId="2" ParentId="8594" CreationDate="2013-08-01T16:43:39.190" Score="13" Body="&lt;p&gt;The unconstrained mean-variance problem $$w_{mv,unc}\equiv argmax\left\{ w'\mu-\frac{1}{2}\lambda w'\Sigma w\right\} &#xA; $$ can easily be found by taking the derivative $$\frac{\partial}{\partial w}\left(w'\mu-\frac{1}{2}\lambda w'\Sigma w\right)=\mu-\lambda\Sigma w&#xA; $$ setting it to zero, and solving for $w$. This gives $$w_{mv,unc}\equiv\frac{1}{\lambda}\Sigma^{-1}\mu&#xA; $$&#xA;To find the portfolio constraining all the weights to sum to $1$, it is as simple as dividing by the sum of the portfolio weights $$w_{mv,c}\equiv\frac{w_{mv,unc}}{1'w_{mv,unc}}=\frac{\Sigma^{-1}\mu}{1'\Sigma^{-1}\mu}&#xA; $$which after canceling out the risk aversion variables gives what you have above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more general constraints, such that $Aw=b$, the formula is more complex. I often refer to the derivation in this &lt;a href=&quot;http://edoc.hu-berlin.de/master/jiao-wei-2003-12-16/PDF/jiao.pdf&quot;&gt;paper&lt;/a&gt; for the formula. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2013-08-01T16:43:39.190" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8621" PostTypeId="1" CreationDate="2013-08-01T18:30:18.603" Score="5" ViewCount="1423" Body="&lt;p&gt;In the Vasicek interest-rate model, the interest rate reverts to a constant mean.  This makes sense to me.  In my conception, the mean ought to be time-invariant, since interest rates don't follow an increasing or decreasing trend in the long term.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the Hull-White modified model, the mean is a time-dependent function.  I cannot understand why this is the case.&lt;/p&gt;&#xA;" OwnerUserId="5731" LastEditorUserId="5731" LastEditDate="2013-08-01T20:25:55.043" LastActivityDate="2016-02-24T23:11:21.223" Title="Why is the mean time-dependent in the Hull-White interest rate model?" Tags="&lt;interest-rates&gt;&lt;mean-reversion&gt;&lt;hullwhite&gt;&lt;vasicek&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8622" PostTypeId="2" ParentId="8076" CreationDate="2013-08-02T01:36:32.183" Score="1" Body="&lt;p&gt;You might want to check this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2285407&amp;amp;download=yes&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2285407&amp;amp;download=yes&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5837" LastActivityDate="2013-08-02T01:36:32.183" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8623" PostTypeId="1" AcceptedAnswerId="8645" CreationDate="2013-08-02T02:53:27.207" Score="7" ViewCount="7525" Body="&lt;p&gt;I know that the relative risk aversion is defined as&#xA;$$R(c) = cA(c)=\frac{-cu''(c)}{u'(c)}$$&#xA;where $u(c)$ denotes the utility curve as a function of wealth $c$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I do not understand the intuition for it. Can you explain the intuition for relative risk aversion?&lt;/p&gt;&#xA;" OwnerUserId="5839" LastEditorUserId="848" LastEditDate="2013-08-04T16:07:50.067" LastActivityDate="2013-08-05T00:30:05.553" Title="What is the significance of Relative Risk Aversion" Tags="&lt;risk&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8625" PostTypeId="2" ParentId="8474" CreationDate="2013-08-02T08:37:35.260" Score="1" Body="&lt;p&gt;There is a recent paper with a procedure to estimated the bid/ask spread from a series of daily high/low prices.  Link: &lt;a href=&quot;http://www3.nd.edu/~scorwin/papers/high-low_spreads.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www3.nd.edu/~scorwin/papers/high-low_spreads.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5841" LastActivityDate="2013-08-02T08:37:35.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8626" PostTypeId="1" CreationDate="2013-08-02T08:57:09.183" Score="2" ViewCount="608" Body="&lt;p&gt;Is the modified duration of an overnight index swap zero or close to zero?&lt;/p&gt;&#xA;" OwnerUserId="5411" LastActivityDate="2013-08-05T10:19:22.680" Title="Modified Duration of Overnight Index Swaps" Tags="&lt;swaps&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8627" PostTypeId="2" ParentId="7334" CreationDate="2013-08-02T09:02:35.473" Score="2" Body="&lt;p&gt;If you are doing something cross-sectional (like Fama-Macbeth regressions) you can just use the ratios where you would put the factor loadings (i.e. betas from the time series regs).  You probably want to do some kind of transformation on the ratio to make it well-behaved first though.  If you want an actual factor based on the ratio, you can use &quot;factor mimicking portfolios&quot;, which are basically portfolios that are long stocks with high values of the ratio and short stocks with low values, with some attempt to orthogonalize them to other variables.  See Ken French's website.  The return time series from this portfolio is your factor.  &lt;/p&gt;&#xA;" OwnerUserId="5841" LastActivityDate="2013-08-02T09:02:35.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8629" PostTypeId="1" CreationDate="2013-08-02T11:18:03.933" Score="2" ViewCount="682" Body="&lt;p&gt;Let a linear time-varying mode like this one:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$y_{t}=\alpha_{t}+\beta_{t}x_{t}+\epsilon_{t}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also suppress the constant term to simplify this example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$y_{t}=\beta_{t}x_{t}+\epsilon_{t}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kalman filter allows you to get $\beta_{t}$ value under some hypothesis which there's no need to list here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Knowing that, e.g. in the linear regression case,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\beta_{y,x}=\dfrac{\sigma(y,x)}{\sigma^{2}(x)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\rho_{y,x}=\dfrac{\sigma(y,x)}{\sigma(y)\sigma(x)}$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;it's very easy to see that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\rho_{y,x}=\beta_{y,x}\dfrac{\sigma^{2}(x)}{\sigma(y)\sigma(x)}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question: is there any way I can use the output of the Gaussian Kalman filter applied to this obs. equation to get the time-varying value of $\rho_{y,x}(t)$?&lt;/p&gt;&#xA;" OwnerUserId="3058" LastActivityDate="2013-08-02T11:18:03.933" Title="Time-varying correlation via state-space representation and Kalman filter" Tags="&lt;time-series&gt;&lt;correlation&gt;&lt;kalman&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8630" PostTypeId="2" ParentId="8621" CreationDate="2013-08-02T12:14:33.297" Score="4" Body="&lt;p&gt;The claim that interest rates don't follow long term trends is not consistent with observed data. The idea of mean reversion is that interest rates do not rise or fall without bound, but are limited by economic and political factors. But there is no indication that this oscillation of short rates should happen around a constant mean. Allowing the mean reversion parameters to be time-dependent (as the Hull-White model does) allows the short rate (which is described by the model) to match the term structure of interest rates (forward rates). &lt;/p&gt;&#xA;" OwnerUserId="5676" LastActivityDate="2013-08-02T12:14:33.297" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8631" PostTypeId="1" CreationDate="2013-08-02T15:34:10.947" Score="2" ViewCount="915" Body="&lt;p&gt;Assume that we have current month term curve and the curves from the two previous months. The current curve may be shifted from the average of the previous two curve by some value (a parallel shift). The task is to identify outliers on the current curve and if they exist than smooth (interpolate) the outlying points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tackled the problem using first degree derivatives to identify the outliers. The method seem to work well to detect the outliers using the difference of the first derivatives as a sample.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question relates to smoothing. Using, for instance, of the splines or quadratic interpolation would not work well as I may have two consequative points as outliers. The terms structure consits of only 12 maturities, thus probably using a polynom of a higher degree might do the trick. Do you have any other ideas?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks guys! &lt;/p&gt;&#xA;" OwnerUserId="4830" LastActivityDate="2014-06-01T04:49:47.577" Title="Smoothing Term Curve" Tags="&lt;interpolation&gt;&lt;outliers&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8632" PostTypeId="2" ParentId="8626" CreationDate="2013-08-02T19:16:33.397" Score="2" Body="&lt;p&gt;In short, no.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An OIS has 2 legs, like any other swap. The float leg duration will be nearly zero, because apart from the ON period the rates are floating. The fixed leg, however, has the same duration as a 3m swap with the same fixed leg specification.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastEditorUserId="1314" LastEditDate="2013-08-05T10:19:22.680" LastActivityDate="2013-08-05T10:19:22.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8633" PostTypeId="1" CreationDate="2013-08-03T01:06:46.883" Score="0" ViewCount="108" Body="&lt;p&gt;Do fewer transaction costs and higher liquidity relate to lower market prices?  Are there any good resources that deal with these topics in more detail?&lt;/p&gt;&#xA;" OwnerUserId="5846" LastActivityDate="2014-01-20T03:05:30.187" Title="Liquidity and Prices" Tags="&lt;pricing&gt;&lt;liquidity&gt;&lt;transaction-costs&gt;&lt;macro-economics&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8634" PostTypeId="2" ParentId="8619" CreationDate="2013-08-03T10:43:09.037" Score="1" Body="&lt;p&gt;The critical values of the unit root test you are using depends if there is a trend or not. For example, the quantiles of the Dickey-Fuller distribution is different when a trend is included from when a trend is not included, hence the critical values for your unit root test are different. The critical values of unit root tests are generated by simulation, with different kinds of deterministic terms to match the series you are considering. &lt;/p&gt;&#xA;" OwnerUserId="5579" LastActivityDate="2013-08-03T10:43:09.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8635" PostTypeId="1" AcceptedAnswerId="8648" CreationDate="2013-08-03T12:45:06.223" Score="2" ViewCount="1597" Body="&lt;p&gt;What is the best method for calculating VaR/CVaR for private equity, hedge fund, and alternative investment portfolios? I have only historical monthly return for them.&lt;/p&gt;&#xA;" OwnerUserId="3456" LastEditorUserId="35" LastEditDate="2013-08-03T14:42:56.370" LastActivityDate="2013-08-04T20:48:47.090" Title="How to calculate VaR/CVaR for private equity, hedge fund, and alternative investment portfolios?" Tags="&lt;var&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8639" PostTypeId="1" CreationDate="2013-08-04T01:00:21.000" Score="3" ViewCount="299" Body="&lt;p&gt;when trying to implement the Black-Scholes formula in Delphi, I've found this: &lt;a href=&quot;http://www.espenhaug.com/black_scholes.html&quot; rel=&quot;nofollow&quot;&gt;http://www.espenhaug.com/black_scholes.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've checked the results against option-price.com and found they are different. Can anyone share the code for the B&amp;amp;S formula in Delphi/FreePascal (from a different source than espenhaug.com?.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;{Black and Scholes (1973) Stock options}&#xA;&#xA;function BlackScholes(CallPutFlag : string; S, X, T, r, v : Double): Double;&#xA;var&#xA;  d1, d2 : Double;&#xA;&#xA;begin&#xA;  Result := 0;&#xA;  d1 := (LN(S / X) + (r + Power(v, 2) / 2) * T) / (v * SqRt(T));&#xA;  d2 := d1 - v * SqRt(T);&#xA;  if CallPutFlag = 'c' then&#xA;    Result := S * CND(d1) - X * Exp(-r * T) * CND(d2)&#xA;  else&#xA;    if CallPutFlag = 'p' then&#xA;      Result := X * Exp(-r * T) * CND(-d2) - S * CND(-d1);&#xA;end;&#xA;&#xA;{The cumulative normal distribution function}&#xA;function CND(X : Double) : Double;&#xA;var&#xA;  L, K : Double;&#xA;&#xA;const&#xA;  a1 = 0.31938153;   a2 = -0.356563782;  a3 = 1.781477937;&#xA;  a4 = -1.821255978; a5 = 1.330274429;&#xA;&#xA;begin&#xA;  L := Abs(X);&#xA;  K := 1 / (1 + 0.2316419 * L);&#xA;  Result := 1 - 1 / SqRt(2 * Pi) * Exp(-Power(L, 2) / 2)&#xA;            * (a1 * K + a2 * Power(K, 2) + a3 * Power(K, 3)&#xA;            + a4 * Power(K, 4) + a5 * Power(K, 5));&#xA;  if X &amp;lt; 0 then&#xA;    Result := (1 - Result)&#xA;end;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5852" LastEditorUserId="5852" LastEditDate="2013-08-04T13:28:45.827" LastActivityDate="2013-08-04T13:28:45.827" Title="Black-Scholes in Delphi" Tags="&lt;black-scholes&gt;" AnswerCount="0" CommentCount="9" ClosedDate="2013-08-07T06:08:51.580" ContentLicense="CC BY-SA 3.0" />
  <row Id="8640" PostTypeId="1" AcceptedAnswerId="8643" CreationDate="2013-08-04T09:34:38.377" Score="3" ViewCount="603" Body="&lt;p&gt;It can be argued that the leverage - reflected by how much collateral people or firms need to put down to borrow and might lose if they fail to pay the loan back - used in the financial system is one of the quantities that proved to be fatal for the unfolding of the recent financial crises:&lt;br&gt;&#xA;&lt;a href=&quot;http://www.bloomberg.com/news/2012-12-09/if-we-don-t-measure-leverage-we-risk-more-crises.html&quot; rel=&quot;nofollow&quot;&gt;http://www.bloomberg.com/news/2012-12-09/if-we-don-t-measure-leverage-we-risk-more-crises.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The more surprising it is that this quantity doesn't seem to be systematically measured.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question&lt;/strong&gt;&lt;br&gt;&#xA;Are there any good proxies with some history available that could be used to get a grip on that quantity?&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2013-08-04T14:09:17.400" Title="Measuring and proxies for leverage in the financial system" Tags="&lt;data&gt;&lt;market-data&gt;&lt;historical-data&gt;&lt;leverage&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8641" PostTypeId="1" CreationDate="2013-08-04T12:29:04.193" Score="8" ViewCount="222" Body="&lt;p&gt;Let X and Y be two GBM’s, they have each a univariate log-normal distribution for some time t, that is $X_t\sim{LnN(µ_x, σ^2_x)}$,  $Y_t\sim{LnN(µ_y, σ^2_y})$ and $Z_t=[X_t,Y_t]\sim{ MvLnN(μ, Σ)}$ where $µ_x, σ^2_x, µ_y, σ^2_y ,  Σ$ have the known expressions as functions of time and initial values..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We take the value of the basket as $B_t=X_t+Y_t$.&#xA;The distribution of B is not log-normal but its density can be written as :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$f(b)=\int_{-\infty}^{+\infty}f(x,b-x)dx$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We write the multivariate density as the product of univariate densities and the copula density :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$f(x,y)=c(x,y)f(x)g(y)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So we can write the density of the basket as :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$f(b)=\int_{-\infty}^{+\infty}c(x,b-x)f(x)g(b-x)dx$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where c(x,y) is the density of the normal copula (since the copula remain the same under increasing transformations of rvs), which has a known form.&#xA;Moreover we can generalise this to a sum of n variables by looking at the bivariate pairs of combinations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this used in pricing basket options?&#xA;Since I haven’t seen such a procedure used I was wondering what is the reason for not using it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&#xA;I modified the integral expressions above because they weren't totally correct. The question is still up, though I'm less convinced by this approach in the case where B is a sum of many rvs since the last integral above might become quite difficult to evaluate. Still, this would give an exact solution. &lt;/p&gt;&#xA;" OwnerUserId="5333" LastEditorUserId="5333" LastEditDate="2013-08-07T08:59:09.667" LastActivityDate="2013-08-07T08:59:09.667" Title="Basket option density in BS model" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;basket&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8642" PostTypeId="1" CreationDate="2013-08-04T13:28:57.260" Score="6" ViewCount="1447" Body="&lt;p&gt;I'm developing a trading strategy which takes into account certain parameters (e.g. avg spread, weighted price, etc). Of course, these parameters can be calculated over different window types (i.e. last X minutes/ticks/trades) and sizes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously, there's no optimal window to be used in every instance, but I would appreciate a few pointers/references to papers discussing how to choose the right window type + size in different situations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, are there any special measures to be taken when applying such windows to market data of illiquid assets?&lt;/p&gt;&#xA;" OwnerUserId="5857" LastEditorUserId="467" LastEditDate="2013-08-05T06:58:04.477" LastActivityDate="2013-08-05T06:58:04.477" Title="How to choose a rolling window type and size?" Tags="&lt;strategy&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8643" PostTypeId="2" ParentId="8640" CreationDate="2013-08-04T13:56:27.793" Score="3" Body="&lt;p&gt;It depends obviously on which specific leverage you attempt to measure but you can certainly build some sort of index from, for example, the below:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Aggregate smoothed equity P/E ratio divergence from long term mean (in a sense it reflects how money is levered to buy stocks at multiples of their long term P/E mean). &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Broad money in circulation -&gt; Money multipliers &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Amount of outstanding prime/Alt-As/subprime loans outstanding , HELs, commercial mortgage loans&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Discretionary consumer spending&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;commercial machine leases (not sure whether there is public information out on that)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Amount of business startups&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I think it may be interesting to gather data on those and to compile an index, though I would estimate that it will not have much predictive power and is rather coincident or even slightly lagging. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-08-04T14:09:17.400" LastActivityDate="2013-08-04T14:09:17.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8644" PostTypeId="2" ParentId="85" CreationDate="2013-08-04T14:06:02.900" Score="3" Body="&lt;p&gt;Option pricing is done under the risk-neutral measure, i.e. the drift term is the risk-free interest rate. Therefore the only degree of freedom to drive the underlying is the volatility. That is why volatility modelling for all (new) option pricing models is so crucial. You can find a good, concise and current overview here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2272823&quot; rel=&quot;nofollow&quot;&gt;A Short Note on Volatility Models by Didier Kouokap Youmbi&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Abstract:      &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This document is a short summary regarding the evolution of the&#xA;  volatility models from Black and Scholes to the Local-Stochastic&#xA;  Volatility models. We show advantages as drawbacks linked to each&#xA;  model, and how the community has moved from one model to another in&#xA;  order to overcome drawbacks.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="12" LastActivityDate="2013-08-04T14:06:02.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8645" PostTypeId="2" ParentId="8623" CreationDate="2013-08-04T16:47:50.250" Score="5" Body="&lt;p&gt;In utility theory the basic assumption is that $u(c)$ is strictly monotonically increasing in wealth: people prefer more over less. Hence, $\forall c, u'(c) &amp;gt; 0$. The second assumption is that the amount of utility added, as $c$ increases, diminishes, so $\forall c, u''(c) &amp;lt; 0$. Combining these two observations we have that&#xA;$$\forall c, A(c) = \frac{-u''(c)}{u'(c)} &amp;gt; 0.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be interpreted as follows, if for a particular $c$ $u'(c)$ is large $A(c)$ will be small. Thus if utility curve is sensitive to increases in wealth the risk aversion is low. For $u''(c)$ the reverse holds: if $u''(c)$ for a particular value of $c$ risk aversion will be low. $A(c)$ captures both sensitivities and also produces some kind of a trade-off between them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The quantity $R(c)$ is just $A(c)$ scaled by the wealth. This scaling has the advantage that this quantity is not sensitive to a change in numéraire of $c$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, the &lt;a href=&quot;http://en.wikipedia.org/wiki/Risk_aversion&quot; rel=&quot;noreferrer&quot;&gt;Wikipedia page&lt;/a&gt; is excellent.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2013-08-04T16:47:50.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8646" PostTypeId="2" ParentId="8642" CreationDate="2013-08-04T19:12:58.197" Score="5" Body="&lt;p&gt;This may be a tricky question and I am curious to see whether there is indeed a statistical methodology that tries to answer this question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To my experience it really varies with the data you are working with. For instance, one may choose a rolling window above an expanding window when there are structural breaks in the data, hence which can affect the structural estimates of the parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The length of this rolling window is then usually determined by means of some economic explanation. Moreover, when you expect that a structural or dynamic change is in effect for a particular period of time X, then you choose a rolling window of X days/minutes/ticks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;As in your case&lt;/strong&gt;, I would suggest to take a look at papers that discuss your trading strategies and why the authors choose this particular rolling window. It may be also useful to try a sensitivity analysis where you roughly `play' with various window sizes and see what happens. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Important&lt;/em&gt;! The latter is not genuine modelling as you are observing the data first. To avoid for this bias, try to play with a sub-sample (in-sample) of your data.&lt;/p&gt;&#xA;" OwnerUserId="2291" LastActivityDate="2013-08-04T19:12:58.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8648" PostTypeId="2" ParentId="8635" CreationDate="2013-08-04T19:44:44.773" Score="2" Body="&lt;p&gt;In my opinion using MC with Generalised Pareto should be better if is properly calibrated.This is because such a model would give higher probability mass in the tails. But of course the calibration will be as good as your historical data is, so the whole advantage of having higher probability of negative evolutions is actually based on an assumption (that the tails are well modeld by GPD).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The historical data approach is the most elegant since it is non-parametric (so no assumptions regarding the distribution are made).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you look at VaR for portfolios, the copula approach should be considered as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might find it useful to take a look at this &lt;a href=&quot;https://www.stanford.edu/class/msande444/2012/MS&amp;amp;E444_2012_Group2a.pdf&quot; rel=&quot;nofollow&quot;&gt;article.&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5333" LastEditorUserId="848" LastEditDate="2013-08-04T20:48:47.090" LastActivityDate="2013-08-04T20:48:47.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8649" PostTypeId="2" ParentId="8631" CreationDate="2013-08-04T19:55:01.340" Score="0" Body="&lt;p&gt;Just off the top of my head I would say that after you identify the outliers you remove them and do spline interpolation on the remaining points. &lt;/p&gt;&#xA;" OwnerUserId="5333" LastActivityDate="2013-08-04T19:55:01.340" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8650" PostTypeId="2" ParentId="8623" CreationDate="2013-08-05T00:30:05.553" Score="3" Body="&lt;p&gt;Relative risk aversion has an intuitive economic explanation, and through a toy example, we can shed some light on its mysterious looking formula.  Consider an agent with constant relative risk aversion (i.e. power or log utility) and some asset with a fixed &quot;attractiveness&quot; (essentially sharpe ratio, more on this later).  For the agent to invest optimally, he wants to invest a proportion of his wealth into the asset, and this proportion is &lt;strong&gt;inversely related&lt;/strong&gt; to his relative risk aversion.  For agents with a more general utility function, relative risk aversion is no longer constant, and so this reasoning doesn't hold true globally.  It is still true, however, in an infinitesimal sense.  Let's go into this in more detail:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a two period model.  At time $t = 0$, an asset's price is $1$.  At time $t = 1$, the asset's price is equal to $1 + \epsilon$ with probability $\frac{1}{2}$, and equal to $\frac{1}{1 + \epsilon}$ with probability $\frac{1}{2}$.  An agent has initial wealth $c$ and utility function $U(\cdot)$.  We wish to determine $\alpha^*$, the proportion of the agent's wealth which should be invested to maximize expected utilty.  I claim that $\alpha^*$ is proportional to $\frac{1}{R(c)}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose that the agent invests $\alpha \%$ of his wealth.  Then at time $t = 1$, his expected utility is &#xA;$$&#xA;\frac{1}{2} U \left(c - c\alpha + c\alpha(1 + \epsilon) \right) + \frac{1}{2}U \left( c - c\alpha + c\frac{\alpha}{1 + \epsilon} \right).&#xA;$$&#xA;This can be rewritten as &#xA;$$&#xA;\frac{1}{2}U \left(c + c \alpha \epsilon \right) + \frac{1}{2}U \left(c - \frac{c \alpha \epsilon}{1 + \epsilon} \right).&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We are assuming that $\epsilon$ is very small (recall the infinitesimal bit I mentioned earlier), so we will approximate this expression with a second order Taylor expansion.  It becomes&#xA;$$&#xA;U(c) + \frac{1}{2}c \alpha \epsilon U'(c) + \frac{1}{4} c^2\alpha^2 \epsilon^2 U''(c) - \frac{1}{2}\frac{c \alpha \epsilon}{1 + \epsilon}U'(c) + \frac{1}{4}\frac{c^2 \alpha^2 \epsilon^2}{(1 + \epsilon)^2}U''(c).&#xA;$$&#xA;We're maximizing utility here, so we want to choose the best $\alpha$.  Ignoring the first term, which doesn't depend on $\alpha$, and combining terms, it is equivalent to maximize&#xA;$$&#xA;c \alpha \epsilon U'(c) \frac{\epsilon}{1 + \epsilon} + \frac{1}{2}c^2 \alpha^2 \epsilon^2 U''(c) \left( 1 + \frac{1}{(1 + \epsilon)^2} \right).&#xA;$$&#xA;Divide through by constants (everything but $\alpha$) to get&#xA;$$&#xA;\alpha U'(c) \frac{1}{1 + \epsilon} + \frac{1}{2} c \alpha^2 U''(c) \left( 1 + \frac{1}{(1 + \epsilon)^2} \right).&#xA;$$&#xA;Letting $\epsilon$ tend to zero, this becomes&#xA;$$&#xA;\alpha U'(c) + \frac{1}{2} c \alpha^2 U''(c).&#xA;$$&#xA;Take derivatives with respect to $\alpha $ and set equal to zero.  This gives&#xA;$$&#xA;U'(c) + c \alpha U''(c) = 0,&#xA;$$&#xA;or $\alpha^* = -\frac{U'(c)}{c U''(c)}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One last note.  There is a similar mechanism going on in the expected utility problem for power utility in a Black-Scholes market, studied by Merton a long time ago.  For example, when the market dynamics follow&#xA;$$&#xA;dX_t = \mu X_t dt + \frac{1}{2} \sigma X_t dW_t,&#xA;$$&#xA;and the agent has power utility $U(x) = \frac{1}{\alpha}x^\alpha$, $0 &amp;lt; \alpha &amp;lt; 1$, it is optimal for the agent to always hold $\frac{\mu}{\sigma}\alpha \%$ of his wealth in the risky asset.  You may calculate that the relative risk aversion of such an agent is $\frac{1}{\alpha}$, and the constant of proportionality, $\frac{\mu}{\sigma}$, is the asset's sharpe ratio.&lt;/p&gt;&#xA;" OwnerUserId="3415" LastActivityDate="2013-08-05T00:30:05.553" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8652" PostTypeId="1" AcceptedAnswerId="8660" CreationDate="2013-08-05T13:58:26.610" Score="3" ViewCount="11912" Body="&lt;p&gt;I have the following C# code for calculating the modified duration of fixed coupon bonds:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    public Double duration(Bond bond, DateTime dtSettle)&#xA;    {&#xA;        double duration = 0.0;&#xA;        double timeDiff1;&#xA;        double timeDiff2;&#xA;        double ytm = YTM(bond,bond.marketPrice,dtSettle);&#xA;        double impPrice = ImpliedBPFfromYTM(bond,ytm,dtSettle);&#xA;&#xA;        timeDiff1 = getDayCount(dtSettle, bond.termdates[0], &quot;ACT/365&quot;, false);&#xA;&#xA;        for (int i = 0; i &amp;lt; bond.termdates.Count; i++)&#xA;        {&#xA;            timeDiff2 = getDayCount(bond.termdates[0], bond.termdates[i],bond.dayCountConvention, false) + timeDiff1;&#xA;            duration = duration + timeDiff2*(cpn/Math.Pow((1+ytm),timeDiff2));&#xA;        }&#xA;&#xA;        timeDiff2 = getDayCount(bond.termdates[0], bond.termdates[bond.termdates.Count - 1], bond.dayCountConvention, false) + timeDiff1;&#xA;        duration = duration + timeDiff2 * (bond.workoutPar / Math.Pow((1 + ytm), timeDiff2));&#xA;        return (duration / (impPrice + bond.accrued_interest)) / (1 + ytm / bond.freq);&#xA;    }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Could anyone give me any pointers as to how I can create a similiar function that calculates the modified duration for Floating Rate Notes?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some explanation of the code: the YTM function returns yield to maturity given bond characteristics. ImpliedBPFromYTM returns the price of the bond given the yield to maturity, market price etc. getDayCount returns the days between two different dates given the day-count-convention of the bond. Please let me know if there is anything else you need clarified.&lt;/p&gt;&#xA;" OwnerUserId="1128" LastActivityDate="2019-07-13T12:43:29.527" Title="Duration of a floating rate note" Tags="&lt;fixed-income&gt;&lt;programming&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8654" PostTypeId="1" CreationDate="2013-08-05T18:07:19.400" Score="1" ViewCount="508" Body="&lt;p&gt;As the title suggests why is the indifference equations in mean variance portfolio theory convex shaped?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indifference Equation: &lt;a href=&quot;https://en.wikipedia.org/wiki/Indifference_curve&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Indifference_curve&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A graph:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/qDf5v.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="5839" LastEditorUserId="5839" LastEditDate="2013-08-05T20:32:22.080" LastActivityDate="2013-08-07T20:32:41.197" Title="Why are indifference equations in mean-variance portfolio theory convex shaped" Tags="&lt;economics&gt;&lt;utility-theory&gt;&lt;statistical-finance&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8656" PostTypeId="1" AcceptedAnswerId="8657" CreationDate="2013-08-05T20:58:54.020" Score="4" ViewCount="802" Body="&lt;p&gt;I am trying to estimate the early exercise boundary for an American put option. I can find the put value through the &lt;a href=&quot;http://www.math.ethz.ch/~hjfurrer/teaching/LongstaffSchwartzAmericanOptionsLeastSquareMonteCarlo.pdf&quot; rel=&quot;nofollow&quot;&gt;Longstaff-Schwartz LSM method&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I obtain the early exercise boundary within the same LSM framework?&lt;/p&gt;&#xA;" OwnerUserId="5867" LastActivityDate="2013-08-05T22:02:11.000" Title="Estimating early exercise boundary for American put" Tags="&lt;options&gt;&lt;monte-carlo&gt;&lt;american-options&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8657" PostTypeId="2" ParentId="8656" CreationDate="2013-08-05T22:02:11.000" Score="4" Body="&lt;p&gt;For a vanilla option, this is a very slow way to get the boundary, and it's somewhat unreliable for any option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In either a more standard grid scheme or in a LS solver, you obtain the boundary by finding two nodes such that one of them has option value equal to early exercise value, and its neighbor has option value above early exercise value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This gives you an interval of underlying prices between which the boundary must lie.  To narrow down that interval, you must increase the number of points in your grid.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2013-08-05T22:02:11.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8659" PostTypeId="2" ParentId="4672" CreationDate="2013-08-06T09:01:49.713" Score="4" Body="&lt;p&gt;What you are talking about is called &lt;em&gt;regression using fractional polynomials&lt;/em&gt; and it has its merits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The canonical reference is this one:&lt;br&gt;&#xA;&lt;a href=&quot;https://person.hst.aau.dk/slc/Teaching/Papers/RoystonAltman94.pdf&quot; rel=&quot;nofollow&quot;&gt;Regression Using Fractional Polynomials of Continuous Covariates: Parsimonious Parametric Modelling by Royston and Altman (1994)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the abstract:&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The relationship between a response variable and one or more&#xA;  continuous covariates is often curved. Attempts to represent curvature&#xA;  in single- or multiple-regression models are usually made by means of&#xA;  polynomials of the covariates, typically quadratics. However, low&#xA;  order polynomials offer a limited family of shapes, and high order&#xA;  polynomials may fit poorly at the extreme values of the covariates. We&#xA;  propose an extended family of curves, which we call fractional&#xA;  polynomials, whose power terms are restricted to a small predefined&#xA;  set of integer and non-integer values. The powers are selected so that&#xA;  conventional polynomials are a subset of the family. Regression models&#xA;  using fractional polynomials of the covariates have appeared in the&#xA;  literature in an ad hoc fashion over a long period; we provide a&#xA;  unified description and a degree of formalization for them. They are&#xA;  shown to have considerable flexibility and are straightforward to fit&#xA;  using standard methods. We suggest an iterative algorithm for&#xA;  covariate selection and model fitting when several covariates are&#xA;  available. We give six examples of the use of fractional polynomial&#xA;  models in three types of regression analysis: normal errors, logistic&#xA;  and Cox regression.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;...and you might have guessed it: There is an R-package for that :-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://cran.r-project.org/web/packages/mfp/&quot; rel=&quot;nofollow&quot;&gt;mfp: Multivariable Fractional Polynomials&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2013-08-06T09:01:49.713" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8660" PostTypeId="2" ParentId="8652" CreationDate="2013-08-06T09:42:13.030" Score="8" Body="&lt;p&gt;Do you have any strict definition of YTM of FRN? I googled and asked many times but I failed to find good and clear explanation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem with FRNs is that we do not know what are the future coupons except for only one. If we solved this problem, we could treat FRN just like standard bond. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the text below I will first consider spread to be zero. In case spread is not equal to zero, FRN can be considered as a pack of two bonds, first is FRN with zero spread, and the second is a &lt;em&gt;spread-only&lt;/em&gt; fixed-coupon bond (with no final redemtion of face value!), and their prices and durations can be estimated separately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The easiest way&lt;/strong&gt; to solve this problem is to say that FRN coupons will be equal to current values of forward rates on correspoding periods. This does make some sense because forward rates must be equal (in theory) to risk-neutral expectations of future values of the reference rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case we do have coupons on FRN and we can now apply techniques applicable to standard bonds and find its yield and duration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;But this approach is somehow questionable&lt;/strong&gt; &#xA;The main problem is duration. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case we have 5 year FRN with quarterly coupon reset, its duration (calculation in a way described above) will be for example 2 or 3 years. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the same time, such FRN can be considered as a pack of 5*4 = 20 bonds with maturity of 3 months with single coupon at maturity. All these bonds, except for the first, have no sensitivity to interest rates. This means, that the only source of duration is the first bond with known coupon, and its duration is simply its time to maturity. This means that such FRN's duration will be in any case less than three months, which is very different from 2 or 3 years obtained in previous calcultaion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This approach is also questionalbe with respect to price. Using the same approach as we used for duration, we can show that FRN price is just a discounted value of it's first payoff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt; If I was to calculate FRN price and duration, I would simply use discounted value of it's first payoff and time to first payoff respectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Formula&lt;/strong&gt;: if FRN reset time is $T$, time until next payment is $t$, year is 365 days long, next interest rate to be paid by FRN is $r_f$ and current interest rate for time $t$ id $r_c$ then the price is&#xA;$$P = \frac{1+r_f T / 365}{1+ r_c t / 365}$$&#xA;and the modified duration is &#xA;$$-\frac{1}{P}\frac{dP}{dr_c} = -\frac{t}{365}\left(-\frac{1}{1+ r_c t / 365}\right) = \frac{t}{365}\frac{1}{1+ r_c t / 365}$$ in other words, the present value of $\frac{t}{365}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Remark:&lt;/strong&gt; If I were a more advanced guy, I would employ some kind of tree or MC model, which would simulate paths of reference rate and hence I would be able to calculate anything I really need. But in this case I would also need some volatility curve which it seems you do not have at hands.&lt;/p&gt;&#xA;" OwnerUserId="2870" LastEditorUserId="12002" LastEditDate="2018-05-28T17:14:01.603" LastActivityDate="2018-05-28T17:14:01.603" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="8661" PostTypeId="1" CreationDate="2013-08-06T11:05:01.987" Score="4" ViewCount="736" Body="&lt;p&gt;Consider a classical &lt;a href=&quot;http://en.wikipedia.org/wiki/Black_Scholes&quot; rel=&quot;nofollow&quot;&gt;Black Scholes model&lt;/a&gt; ,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{dS}{S} = \mu dt + \sigma dW$$&#xA;, where $dW$ is a &lt;a href=&quot;http://en.wikipedia.org/wiki/Wiener_process&quot; rel=&quot;nofollow&quot;&gt;Brownian motion&lt;/a&gt;, that $W(t_1) - W(t_0) \sim N(0, t_1 - t_0)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The back-testing strategy is straight-forward: Once $\mu$ and $\sigma$ is recognized from the samples, $ dS / S_t \sim N(\mu \cdot dt, \sigma^2 dt)$. So back-testing of the model becomes hypothesis testing of a normal distribution's mean and standard deviation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I'm coming out with such a modified Vasicek model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dr_t = a(b-r_t)dt + (c + d \cdot r_t) dW $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This modifies the original &lt;a href=&quot;http://en.wikipedia.org/wiki/Vasicek_model&quot; rel=&quot;nofollow&quot;&gt;Vasicek model&lt;/a&gt;: $dr_t = a(b-r_t)dt + \sigma dW$ as I notice the samples shows time-variant $\sigma(t)$ which has a strong linear correlation with $r_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, how could I design the back-testing to validate my model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought to back-test the $a$ and $b$ first, at least, &#xA;$$E[dr_t + a \cdot r_t dt] = a \cdot b \cdot dt$$&#xA;, this is a constant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But $dr_t + a \cdot dt$ 's standard deviation is not constant, I'm lost how to set the Hypothesis testing's criterion! Leaving alone how to back-test the $c$ and $d$ part? &lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2013-08-07T13:44:59.580" Title="How to design back-testing (validation) for such modified Vasicek model?" Tags="&lt;backtesting&gt;&lt;normal-distribution&gt;&lt;vasicek&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8663" PostTypeId="2" ParentId="8661" CreationDate="2013-08-06T14:35:52.307" Score="2" Body="&lt;p&gt;Your SDE has no closed-form solution, so you'll have to apply the &lt;a href=&quot;http://en.wikipedia.org/wiki/Euler%E2%80%93Maruyama_method&quot; rel=&quot;nofollow&quot;&gt;Euler method&lt;/a&gt; to obtain an approximate terminal distribution.  Once you have the terminal distributions, any time series you want to validate has a highly multivariate probability density (due to the fact that each day's data comes from a slightly different distribution).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can transform this into normal space by forming &lt;a href=&quot;http://en.wikipedia.org/wiki/Standard_score&quot; rel=&quot;nofollow&quot;&gt;z-scores&lt;/a&gt; of each data point.  Hypothesis testing now becomes a trivial exercise on those z-scores arising from the standard gaussian.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2013-08-07T13:44:59.580" LastActivityDate="2013-08-07T13:44:59.580" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8664" PostTypeId="2" ParentId="1343" CreationDate="2013-08-06T14:52:13.327" Score="1" Body="&lt;p&gt;A list of various liquidity measures is described in the paper: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2225758&quot; rel=&quot;nofollow&quot;&gt;Economic Valuation of Liquidity Timing&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See page 11, starting with the paragraph &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(...) We consider a variety of monthly liquidity measures which together&#xA;  capture all aspects of liquidity: Roll, Effective Tick, Zeros,&#xA;  High-Low, and Illiquidity Ratio (ILR).10 The first four measures proxy&#xA;  for the bid-ask spread and the fifth measure is a proxy for price&#xA;  impact. All liquidity variables measure illiquidity, i.e. higher&#xA;  estimates correspond to lower liquidity.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2291" LastActivityDate="2013-08-06T14:52:13.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8665" PostTypeId="1" CreationDate="2013-08-06T16:39:38.260" Score="0" ViewCount="720" Body="&lt;p&gt;I want to predict expected returns for assets using a CAPM, to calculate unexpected (unpredictable, idiosyncratic, non-systemic) returns in portfolios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My CAPM estimated on monthly total gross returns obviously have some outliers. Instead of throwing out the outlier months, I think I need to ignore entire assets with outlier betas. What range of betas would one consider reasonable?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My model is nothing more complicated to use the 1999-2007 monthly returns relative to the MSCI World total gross returns, and predict for the same period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Btw, I know my suggestion makes the beta calculation for the entire portfolio invalid, but I think I can take that loss as I cannot price everything in the portfolio, let alone considering hedging against the investor's consumption stream, swings in human capital, earnings potential, pension claims etc. anyway.)&lt;/p&gt;&#xA;" OwnerUserId="5693" LastActivityDate="2013-08-06T16:39:38.260" Title="what is a reasonable beta in CAPM?" Tags="&lt;returns&gt;&lt;beta&gt;&lt;capm&gt;&lt;expected-return&gt;&lt;outliers&gt;" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="8666" PostTypeId="1" CreationDate="2013-08-06T17:51:24.750" Score="4" ViewCount="207" Body="&lt;p&gt;Imagine you have two volatilities, the second which is &quot;activated&quot; when the stock crosses a barrier called $p_b$. The present price is $p_1$. ($p_b&amp;gt;p_1$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be used to price options after a crash when it's assumed that options are more expensive in the short term and are reverting over the long term. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is also a time parameter for the ratio of time for the duration first volatility ($t_1$) with the time duration until expiration ($t_2$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried pricing such an option and it's quite messy and involves some improvisation for tricky situations such as when the barrier is the same as the present price or when the time duration $t_1$ is very small relative to $t_2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the best I have done so far. It still has inconsistencies where the call exceeds the present price for &lt;a href=&quot;http://en.wikipedia.org/wiki/User%3aStockequation2/sandbox&quot; rel=&quot;nofollow&quot;&gt;very specific instances&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When the volatilities are equal, the equation reduces to Black-Scholes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the first volatility is very flat and the second is greater, the stock --- as $t$ progresses --- will eventually assume the longer-run volatility, but the option is slightly cheaper than simply pricing it with the long-run because the lesser short-run volatility is like friction. Likewise, if the finite frame volatility is greater than the longer run, then we should get a small &quot;boost&quot; for the call price from the short-run even as the option assumes the long-run lesser volatility.&lt;/p&gt;&#xA;" OwnerUserId="5376" LastEditorUserId="35" LastEditDate="2013-08-06T18:58:06.127" LastActivityDate="2013-08-06T18:58:06.127" Title="How to price an option with two volatilities?" Tags="&lt;options&gt;" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="8667" PostTypeId="1" CreationDate="2013-08-06T20:22:36.680" Score="1" ViewCount="1419" Body="&lt;p&gt;Could someone please help me with trying to get the Ox interface to work in R. I followed the steps outlined in this paper (&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1752095&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1752095&lt;/a&gt;), but I get the following errors as output:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ox Console version 6.21 (Windows/U) (C) J.A. Doornik, 1994-2011&#xA;This version may be used for academic research and teaching only&lt;/p&gt;&#xA;&#xA;&lt;p&gt;C:\Ox\lib\GarchOxModelling.ox (28): 'fopen' undeclared identifier&lt;/p&gt;&#xA;&#xA;&lt;p&gt;C:\Ox\lib\GarchOxModelling.ox (29): 'fscan' undeclared identifier&lt;/p&gt;&#xA;&#xA;&lt;p&gt;C:\Ox\lib\GarchOxModelling.ox (39): 'fclose' undeclared identifier&lt;/p&gt;&#xA;&#xA;&lt;p&gt;C:\Ox\lib\GarchOxModelling.ox (227): 'fprint' undeclared identifier&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Error in file(file, &quot;r&quot;) : cannot open the connection&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition: Warning messages:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1: running command 'C:\Ox\bin\oxl.exe C:\Ox\lib\GarchOxModelling.ox' had status 1 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2: In file(file, &quot;r&quot;) :&#xA;  cannot open file 'OxResiduals.csv': No such file or directory &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would I go about solving the undeclared identifier problem? And then the following 2 additional warnings messages 1. and 2. ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am really out of my depth here but really need to use FIGARCH &amp;amp; possibly FIEGARCH in R. Thanks for any help provided.&lt;/p&gt;&#xA;" OwnerUserId="5874" LastEditorUserId="7008" LastEditDate="2015-11-24T15:00:09.263" LastActivityDate="2017-05-16T18:27:17.613" Title="garchOxFit in R" Tags="&lt;r&gt;&lt;garch&gt;&lt;ox&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8668" PostTypeId="2" ParentId="8667" CreationDate="2013-08-06T22:28:53.390" Score="2" Body="&lt;p&gt;The interface from R to Ox is no longer supported by Rmetrics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could look into the &lt;a href=&quot;http://cran.r-project.org/package=rugarch&quot; rel=&quot;nofollow&quot;&gt;Rugarch package from CRAN&lt;/a&gt; instead. It supports a number of Garch specifications.&lt;/p&gt;&#xA;" OwnerUserId="69" LastActivityDate="2013-08-06T22:28:53.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8669" PostTypeId="2" ParentId="8667" CreationDate="2013-08-06T22:30:15.377" Score="2" Body="&lt;p&gt;fopen,fscan are in stdio.h but it looks like Ox has their own include file.  For some reason it's commented out in garchOxModelling.ox, uncomment that line only.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#include &amp;lt;oxstd.h&amp;gt;  &#xA;//#include &amp;lt;packages/gnudraw/gnudraw.h&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I remember I had to change this line as well since I used a newer G@rch distro.  It was /Garch42/ , I changed it to /Garch6/&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#import &amp;lt;packages/Garch6/garch&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Simple R script&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#My test input&#xA;library(quantmod)&#xA;library(FinTS)&#xA;getSymbols(c(&quot;SPY&quot;), src='yahoo', from=&quot;2005-01-01&quot;)#dnld data&#xA;sp.close&amp;lt;-as.vector(SPY[,&quot;SPY.Adjusted&quot;])&#xA;y1=100*diff(log(sp.close))&#xA;#call preloaded custom R function&#xA;result.sp=garchOxFit(formula.mean = ∼arma(1, 0), formula.var = ∼figarch.bbm(1,1),&#xA;                     series = y1, cond.dist = &quot;skewed-t&quot;,include.mean = TRUE, &#xA;                     truncation = 100, trace = TRUE, title=NULL,include.var=TRUE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Some truncated output&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Ox Console version 6.21 (Windows/U) (C) J.A. Doornik, 1994-2011&#xA;This version may be used for academic research and teaching only&#xA;Copyright for this package: S. Laurent, 2000-2009.&#xA;G@RCH package version 6.0, object created on  6-08-2013&#xA;-------------------------------------&#xA;Starting Values&#xA;===============&#xA;Parameter      Starting Value&#xA;Cst(M)               0.010000&#xA;AR(1)                0.010000&#xA;Cst(V)               0.040000&#xA;d-Figarch            0.450000&#xA;ARCH(Phi1)           0.100000&#xA;GARCH(Beta1)         0.400000&#xA;Asymmetry            0.010000&#xA;Tail                 6.000000&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Edit: For the second part of your question, the missing files (OxResiduals etc.) will show up in your working dir after you fix the file io problem. &lt;/p&gt;&#xA;" OwnerUserId="5872" LastEditorUserId="5872" LastEditDate="2013-08-07T04:27:13.610" LastActivityDate="2013-08-07T04:27:13.610" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8670" PostTypeId="2" ParentId="2651" CreationDate="2013-08-07T00:01:16.707" Score="0" Body="&lt;p&gt;Trading following earnings tends to follow a bimodal normal distribution. There is an expectation the stock will jump or fall some 'x' % amount based on an underlying bimodal normal distribution. Calculate the expected value &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's like a dividend &lt;/p&gt;&#xA;" OwnerUserId="5376" LastActivityDate="2013-08-07T00:01:16.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8671" PostTypeId="1" CreationDate="2013-08-07T02:41:53.260" Score="5" ViewCount="133" Body="&lt;p&gt;Is there a method of finding a risk-neutral measure for assets driven by the levy process? I understand there is the esscher transform but I think it tends to transform the processes into unrecognisable/intractable forms. Can anyone provide an explicit method to finding a risk-neutral measure?&lt;/p&gt;&#xA;" OwnerUserId="5867" LastActivityDate="2013-08-07T02:41:53.260" Title="Risk neutral measure in exponential levy model" Tags="&lt;options&gt;&lt;risk-neutral-measure&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8673" PostTypeId="2" ParentId="1343" CreationDate="2013-08-07T07:02:29.330" Score="2" Body="&lt;p&gt;The &quot;&lt;a href=&quot;https://www.google.com/search?q=navigating%20liquidity&quot; rel=&quot;nofollow&quot;&gt;Navigating Liquidity&lt;/a&gt;&quot; serie by CA Cheuvreux's former quant research team addresses different means to measure liquidity in a post MiFID (in europe) and post Reg NMS (for US) world.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, CA Cheuvreux having been sold by CAcib, most of the links in the upper google search seems to be broken. You will find informations about measuring liquidity in the first Chapter of &lt;a href=&quot;http://www.worldscientific.com/worldscibooks/10.1142/8967&quot; rel=&quot;nofollow&quot;&gt;Market Microstructure in Practice&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2014-01-18T09:06:58.167" LastActivityDate="2014-01-18T09:06:58.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8678" PostTypeId="2" ParentId="2330" CreationDate="2013-08-07T15:09:09.917" Score="2" Body="&lt;p&gt;I have written &lt;a href=&quot;http://www.filedropper.com/functions&quot; rel=&quot;nofollow&quot;&gt;R code&lt;/a&gt; for some time-varying bivariate fat-tailed copula functions (ripped off Patton's Matlab code) and played around with various optimizers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then use &lt;code&gt;Rsolnp&lt;/code&gt;, &lt;code&gt;nloptr&lt;/code&gt;, &lt;code&gt;alabama&lt;/code&gt; or &lt;code&gt;DEoptim&lt;/code&gt; packages to find an optimisation solution. Here is some &lt;a href=&quot;http://www.filedropper.com/copula2&quot; rel=&quot;nofollow&quot;&gt;R code&lt;/a&gt; where I play around with different optimisation algorithms. Note that the &lt;code&gt;data2.csv&lt;/code&gt; is just a 2 column of doubles with no rownames and no Header. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately numerical MLE is very slow even with 1000 datapoints ... I would be VERY interested in seeing an iterative state space solution, if tractable. However, I somehow doubt one has been developed since this only came around in 2006 and is mostly popular among international economics researchers who are focused on applied questions with low frequency data (hence numerical MLE is fine for them). &lt;/p&gt;&#xA;" OwnerUserId="3174" LastEditorUserId="3174" LastEditDate="2013-08-07T15:46:41.157" LastActivityDate="2013-08-07T15:46:41.157" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8679" PostTypeId="1" CreationDate="2013-08-07T19:03:03.213" Score="0" ViewCount="68" Body="&lt;p&gt;Is there someway to get the historic market capitalization/outstanding shares of stocks traded in US exchanges ?&lt;/p&gt;&#xA;" OwnerUserId="5440" LastActivityDate="2013-08-07T21:14:51.167" Title="Historic market cap/outstanding shares" Tags="&lt;historical-data&gt;" AnswerCount="0" CommentCount="4" ClosedDate="2013-08-07T23:12:15.617" ContentLicense="CC BY-SA 3.0" />
  <row Id="8680" PostTypeId="2" ParentId="8654" CreationDate="2013-08-07T20:32:41.197" Score="1" Body="&lt;p&gt;I agree with @MattWolf The graph you show is confusing and evil, it makes me feel dumb every time I look at it. So I inverted the axis. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/6wWPc.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we see the familiar shape of an utility curve, discussed in &lt;a href=&quot;https://quant.stackexchange.com/questions/8623/what-is-the-significance-of-relative-risk-aversion&quot;&gt;your previous question&lt;/a&gt;. It is upward sloping at a declining rate. In this case $u$ takes the place of $R_p$ and the general form of mean variance utility is&#xA;$$u(R_p, \sigma_p) = R_p - \lambda \sigma^2_p$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.tau.ac.il/~spiegel/teaching/corpfin/mean-variance.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;This derivation&lt;/a&gt; might be of interest.&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2013-08-07T20:32:41.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8682" PostTypeId="2" ParentId="141" CreationDate="2013-08-08T03:02:31.003" Score="5" Body="&lt;p&gt;I have used both Xignite and &lt;a href=&quot;http://www.financialcontent.com/services/online/stock_market_widgets.php&quot; rel=&quot;noreferrer&quot;&gt;FinancialContent&lt;/a&gt; for economic data and stock quote data feeds.&#xA;The plus side of FinancialContent is that they have JavaScript widgets (free with ads or paid with no ads).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both companies offer JSON, XML and CSV formatted feeds.&lt;/p&gt;&#xA;" OwnerUserId="5885" LastActivityDate="2013-08-08T03:02:31.003" CommentCount="0" CommunityOwnedDate="2013-08-08T03:02:31.003" ContentLicense="CC BY-SA 3.0" />
  <row Id="8683" PostTypeId="1" AcceptedAnswerId="8684" CreationDate="2013-08-08T04:57:13.527" Score="2" ViewCount="268" Body="&lt;p&gt;I come from a programming background and not am no quant by career so this is probably a newbie question for you guys. I have written some code to pull daily closing values for market indices (DOW/NASDAQ etc.) along with closing account balances from a stock broker's API.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/FteB4.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/FteB4.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;See screenshot&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I have a date column, closing values for DJI/NASDAQ and 'ClosingBalance' for the day of a given trader's account. If I am to ignore the 'Deposit' and 'Withdrawal' columns, then I can take this time series and plot on a chart how the trader's account value is moving with the market for a given date range. I can then further compute if he is outperforming or not, etc. etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Great.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But turns out, the fellow might inject more equity via cash deposits over time or make withdrawals over time. Let's even forget withdrawals if it makes the scenario simpler, so in the case of just deposits (such as the 499 entry in the middle), what is the standard industry convention on adjusting against this while attempting to compute the trader's account balances vs. the market to see if he is outperforming?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it simple enough that when a deposit is made, you add up the same deposit for all previous days? And what happens when withdrawals are made?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any hints on the usual direction programmers and quants take in this scenario will be helpful. Coding the logic isn't my problem, I want to understand what the practice to handle this situation is...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, how is the Y axis normalized here? The account balances could be in the 10k-100k range while the Dow could be in ther 15k-20k range while the NASDAQ could be in the 1k-5k range. Perhaps some kind of modular operation? Or divide or reduce by a factor? Perhaps pick one of the series' first value as the starting point on the scale, and subtract the other series by the difference so that all the series start at the same value? I suppose while plotting on a chart, the Y axis would really need to be a percentage scale and not absolute?...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;OP EDIT BEGIN - This is my first draft after I coded things up&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The green is my fund performance, blue is the DOW, black is the NASDAQ.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/UxVwB.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;OP EDIT END&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="5769" LastEditorUserId="5769" LastEditDate="2013-08-12T02:34:50.667" LastActivityDate="2014-02-08T16:10:55.593" Title="Industry convention to track trading performance against market indices?" Tags="&lt;market-data&gt;&lt;performance&gt;&lt;performance-evaluation&gt;&lt;performanceanalytics&gt;&lt;best-practices&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8684" PostTypeId="2" ParentId="8683" CreationDate="2013-08-08T06:01:32.400" Score="1" Body="&lt;p&gt;Maybe the following guidelines help:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Big picture: For performance measurement purposes you should compare returns not absolute values. You need to convert all time series into percent returns which in itself takes care of normalization. Also as next step you do not only want to measure out or under performance in terms of return performance but in risk-adjusted performance.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I would proceed as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&lt;br&gt;&#xA;I make the following assumption: The closing balance reflects deposits/withdrawals(d/w) made on that day &lt;strong&gt;and&lt;/strong&gt; the d/w has been undertaken &lt;strong&gt;post&lt;/strong&gt; trading. Another assumption made is that investment performance is based on the total account balance, meaning that new deposits are invested on the next day, too. If those assumptions are incorrect then more information have to be given to be more specific. &#xA;&lt;strong&gt;End Edit&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;First, adjust the account balance time series for withdrawals and deposits: Subtract deposits from that day'closing balance and add withdrawals back to that day's closing balance. You do not want to calculate returns on a deposit or withdrawal that has been made post trading. Next, calculate the daily percentage returns. Subsequently, adjust back the correct closing balance, reflecting deposits and withdrawals. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Then you can head into several different directions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;For each date sum up all previous returns for each individual time series which gets you a very simplified kind of aggregate performance series, you can then compare directly with the index performance (a geometric mean would be more accurate but this is just a simplified example)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Simply average the returns of each time series and compare results&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Calculate the Sharpe Ratio for each time series and compare the average risk-adjusted returns (a search on this forum should show how to calculate SR)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Calculate for each data point the daily return and risk adjust it by dividing by the standard deviation that is sampled over a defined window. That will also get you a performance curve but on a risk adjusted basis. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As you can see there are many different ways (and probably a dozen more), so it really depends what you exactly indent to measure. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-08-08T07:41:15.810" LastActivityDate="2013-08-08T07:41:15.810" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8686" PostTypeId="1" AcceptedAnswerId="9646" CreationDate="2013-08-08T11:13:43.743" Score="5" ViewCount="394" Body="&lt;p&gt;I am trying to find market-structure research on how the size / depth of the order book changes during the day for equities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would expect it to get deeper and deeper and bigger and bigger continously as the day progresses, but I don't have access to order book data to validate this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone here provide any insight on this topic? Hope this is question is applicable to this site.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For my purposes, I am mainly interested in two things: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;What type of function gives a view of how it grows? Is it logarithmic? Linear? I'm guessing it's linear. Does the growth rate change during the day (for example, much higher in the beginning and towards the end)?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The distribution of the growth among different price levels. For example, will the ratio $$\frac{\mbox{number of quotes far-from-midpoint}}{\mbox{number of quotes close-to-midpoint}}$$ grow as the day progresses, or does it virtually stay the same?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5888" LastEditorUserId="2299" LastEditDate="2013-12-07T08:00:10.437" LastActivityDate="2013-12-07T08:10:51.387" Title="Growth of Order Book size during day" Tags="&lt;market-microstructure&gt;&lt;orderbook&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8687" PostTypeId="1" CreationDate="2013-08-08T11:21:24.923" Score="1" ViewCount="162" Body="&lt;p&gt;I would like to simulate an equity index, a risk free cash account and the yield curve for the purposes of valuing a guarantee on an insurance product that is being backed by both equities and cash. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the industry standard model for an option that depends on the payoff of many asset classes - such as equities and cash? Can this be simulated with MC simulation? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly, a common approach in the actuarial literature seems to be to simulate under the real-world measure and then use a stochastic discount factor to get back to a risk neutral price. Has this been applied in any of the above methods?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="5863" LastActivityDate="2013-08-08T11:21:24.923" Title="What are the industry standard models for monte carlo simulation of basket options?" Tags="&lt;monte-carlo&gt;&lt;risk-neutral-measure&gt;&lt;basket&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8688" PostTypeId="2" ParentId="8420" CreationDate="2013-08-08T11:29:11.687" Score="0" Body="&lt;p&gt;if you have access to a Bloomberg terminal, you could use this function in Excel:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;=BDP(&quot;013926500 CORP&quot;,&quot;BOND To EQY TICKER&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;013926500 is the CUSIP for ABB&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is very easy to automate Bloomberg / Excel functions and a quick Google should show you decent examples. Also Bloomberg terminals carry several such example APIs that should help you automate the download.&lt;/p&gt;&#xA;" OwnerUserId="932" LastActivityDate="2013-08-08T11:29:11.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8689" PostTypeId="1" AcceptedAnswerId="8702" CreationDate="2013-08-08T11:37:49.007" Score="7" ViewCount="1778" Body="&lt;p&gt;We try to analyze the average correlation of a portfolio as it can be found &lt;a href=&quot;http://www.nematrian.com/R.aspx?p=MeasuringAverageStockCorrelation&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; in section 2 b), the same formula which is also used by the CBOE to calculate implied correlations: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\rho_{av(2)} = \frac{\sigma^2 - \sum_{i=1}^N w_i^2\sigma_i^2}{2 \sum_{i=1}^N \sum_{j&amp;gt;i}^N w_i w_j \sigma_i \sigma_j}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:Assuming that $\sigma^2 = \sum_{i=1}^N \sum_{j=1}^N w_i w_j \sigma_i \sigma_j \rho_{i,j}$, where $\rho_{i,i}=1$, for $i=1,\ldots,N$, the above expression can be written as&#xA;$$&#xA;  \rho_{av(2)} = \frac{\sum_{i=1}^N \sum_{j&amp;gt;i}^N w_i w_j \sigma_i \sigma_j \rho_{i,j}}{\sum_{i=1}^N \sum_{j&amp;gt;i}^N w_i w_j \sigma_i \sigma_j}.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following questions arise. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Assuming that $w_i \in \mathbb{R}$, i.e. long/short leverage is allowed, is it possible that $|\rho_{av(2)}|&amp;gt;1 $ ? Note that we don't assume $\sum w_i=1$.&lt;/li&gt;&#xA;&lt;li&gt;Does there already exist the notion of contribution to average correlation? Meaning that e.g. in a long/short portfolio, where average correlation should be close to zero, I can identify positions that drive the average correlation up (in absolute value).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2013-09-19T15:03:34.043" LastActivityDate="2013-09-20T14:03:58.980" Title="Average correlation of index/portfolio" Tags="&lt;portfolio-management&gt;&lt;correlation&gt;&lt;portfolio&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8690" PostTypeId="1" CreationDate="2013-08-08T12:26:25.970" Score="-2" ViewCount="2579" Body="&lt;p&gt;Basically, the question is in the title. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For some similar data: &lt;a href=&quot;http://edhec-risk.com&quot; rel=&quot;nofollow&quot;&gt;EDHEC&lt;/a&gt; provides some data and one can also get the Mutual Funds data from the Yahoo Finance:is there anything else out there? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;" OwnerUserId="5652" LastEditorUserId="5652" LastEditDate="2013-08-09T05:13:04.663" LastActivityDate="2019-01-12T10:55:15.523" Title="Where to get access to an inexpensive or free hedge fund/CTA DB?" Tags="&lt;historical-data&gt;&lt;database&gt;&lt;funds&gt;" AnswerCount="3" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8691" PostTypeId="2" ParentId="8690" CreationDate="2013-08-08T12:49:12.823" Score="1" Body="&lt;p&gt;You can get monthly performance for all of the Eurekahedge indices for free from Quandl: &lt;a href=&quot;http://www.quandl.com/EUREKA-Eurekahedge&quot; rel=&quot;nofollow&quot;&gt;http://www.quandl.com/EUREKA-Eurekahedge&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5831" LastActivityDate="2013-08-08T12:49:12.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8692" PostTypeId="1" CreationDate="2013-08-08T12:51:25.157" Score="5" ViewCount="570" Body="&lt;p&gt;I am trying to help a friend with her thesis on Counterparty Credit Risk where she intends to have a somewhat lengthy treatment on Credit Valuation Adjustment (CVA). Specifically I am looking to help her in including some computer simulated experiments which would hopefully illustrate CVA calculations under simulated scenarios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been reading a bit on CVA and have got somewhat fair idea of what's going on. However, I am at a loss to find a document where the &quot;Math&quot; has been distilled and computational aspects highlighted, preferably from a programmer's point of view. I have come across a &lt;a href=&quot;http://www.mathworks.com.au/help/fininst/counterparty-credit-risk-and-cva.html&quot; rel=&quot;noreferrer&quot;&gt;document&lt;/a&gt;, which is part of MATLAB's financial toolbox and it does give me some ideas. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for suggestions/pointers regarding the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: I am not averse to understanding the Math, just quite perplexed about the &quot;only Math&quot; aspect.&lt;/p&gt;&#xA;" OwnerUserId="5891" LastActivityDate="2019-04-18T20:10:41.267" Title="Credit Valuation Adjustment Implementation" Tags="&lt;simulations&gt;&lt;cva&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8696" PostTypeId="2" ParentId="8683" CreationDate="2013-08-08T17:01:44.990" Score="0" Body="&lt;p&gt;I can't speak as to whether it is &quot;industry convention,&quot; but you might find &lt;a href=&quot;https://en.wikipedia.org/wiki/Unit_Valuation_System&quot; rel=&quot;nofollow&quot;&gt;Unit valuation&lt;/a&gt; useful here.&lt;/p&gt;&#xA;" OwnerUserId="252" LastActivityDate="2013-08-08T17:01:44.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8697" PostTypeId="1" AcceptedAnswerId="8742" CreationDate="2013-08-08T20:06:23.117" Score="14" ViewCount="9967" Body="&lt;p&gt;I am attempting to run a rolling multivariate regression (14 explanatory variables) across a panel of 5000 stocks:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;For each of the 5000 stocks, I run 284 regressions (by rolling over my sample period).&lt;/li&gt;&#xA;&lt;li&gt;In summary: 1,420,000 regressions in total are ran for the panel.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;To achieve this, I make use a nested &quot;for loop&quot;: loop over securities and over time. Coefficients are exported to a csv file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As expected, the issue is that the entire procedure takes a HUGE amount of time to complete.&#xA;Would there be an efficient way of handling this? (As I realize that the &quot;apply&quot; function is more efficient than a &quot;for loop&quot;, please keep in mind that given the huge processing time, the time gain from the alternative use of the &quot;apply&quot; function would still be minimal).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a snapshot of the code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sec = ncol(ret.zoo)&#xA;num.factors = ncol(data)&#xA;rows = nrow(ret.zoo) - 60 + 1&#xA;col.names &amp;lt;- c(&quot;gvkey&quot;, &quot;date&quot;, &quot;intercept&quot;, colnames(data))&#xA;write.table(as.data.frame(t(col.names)), file = paste(path, &quot;betas.csv&quot;, sep = &quot;&quot;),  row.names = FALSE, col.names = FALSE, sep = &quot;,&quot;)&#xA;&#xA;for(i in 1:sec) {   &#xA;    beta = data.frame(matrix(nc = num.factors + 3, nr = rows))&#xA;    df = merge(ret.zoo[,i], data)&#xA;    names(df) &amp;lt;- c(&quot;return&quot;, names(data))&#xA;&#xA;    for(j in 1:rows) {&#xA;        #Checks if number of observations &amp;gt;=30. If so, regression is ran. Otherwise, it is not.&#xA;        no.na = ret.zoo[j:(j+59),i][which(!is.na(coredata(ret.zoo[j:(j+59),i])))]&#xA;        if(length(no.na) &amp;gt;= 30) {&#xA;            beta[j,1] = substr(colnames(ret.zoo)[i],2,7)&#xA;            beta[j,2] = as.character(index(df[(j+59),])) ### Date&#xA;            beta[j,3:(num.factors+3)] = coef(lm(return ~., data = as.data.frame(df[j:(j+59),]), na.action = na.omit))&#xA;        }&#xA;    }&#xA;    write.table(beta, file = paste(path, &quot;betas.csv&quot;, sep = &quot;&quot;), append = T, sep = &quot;,&quot;, row.names = FALSE, col.names = FALSE)&#xA;    rm(beta)    &#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;sec: number of stocks (securities). Each security has a time series of returns.&lt;/li&gt;&#xA;&lt;li&gt;rows: number of time periods (over which we roll the regression)&lt;/li&gt;&#xA;&lt;li&gt;beta: matrix of coefficients of all regressions for each security. It is cleared every time for each sec.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;MODEL:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Here is the regression model for each security &lt;em&gt;i&lt;/em&gt; at time &lt;em&gt;t&lt;/em&gt; :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;R(i,t) = a(i,t) + b1(i,t)f1(t) + b2(i,t)f2(t) + .... + bn(i,t)fn(t) + e(i,t)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;em&gt;b&lt;/em&gt; are the regression coefficients, &lt;em&gt;f&lt;/em&gt; the factors, and &lt;em&gt;e&lt;/em&gt; the residuals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;em&gt;i&lt;/em&gt; is in [1:5000], the number of factors &lt;em&gt;n&lt;/em&gt; is 14, and time &lt;em&gt;t&lt;/em&gt; is in [1:343] (343 months).&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;For each security &lt;em&gt;i&lt;/em&gt;, we run this regression over rolling periods of 60 months (hence the j:j+59 in R code).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Each rolling regression is ran only if the &lt;strong&gt;non-NA&lt;/strong&gt; number of observations of the rolling window for the dependent variable is &gt;= 30 (While the independent variables cannot be NA, the dependent variables (here stock returns) can take NA values, if the stock drops from the index).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;We then obtain &lt;strong&gt;284 = 343 - 60 + 1&lt;/strong&gt; beta coefficients for each factor &lt;em&gt;f&lt;/em&gt; for each security &lt;em&gt;i&lt;/em&gt;. These are stored in the &quot;beta&quot; dataframe (the &quot;beta&quot; dataframe has nr = 284, and ncol = 14+3 (14 factors, intercept, date, and identifier).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So, in summary, we conduct 284 regressions per security, and we have a total of 5000 securities. That makes 1,420,000 regressions in total.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For some perspective, running this script takes about 50min to successfully complete.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you,&lt;/p&gt;&#xA;" OwnerUserId="5896" LastEditorUserId="5896" LastEditDate="2013-08-12T20:26:28.293" LastActivityDate="2015-06-10T08:49:23.790" Title="R: Fast and efficient way of running a multivariate regression across a (really) large panel (First pass of Fama MacBeth)" Tags="&lt;time-series&gt;&lt;portfolio-management&gt;&lt;r&gt;&lt;regression&gt;&lt;factor-models&gt;" AnswerCount="4" CommentCount="7" FavoriteCount="16" ContentLicense="CC BY-SA 3.0" />
  <row Id="8698" PostTypeId="1" CreationDate="2013-08-08T20:14:25.437" Score="4" ViewCount="3090" Body="&lt;p&gt;I am trying to estimate a FIGARCH(1,1) model in R for Value-at-Risk purposes. As I understand it, the rugarch package does not support FIGARCH or FIEGARCH. To that end, I used the garchOxFit function (which runs the estimation in Ox, whilst interfacing with R). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It all works and I am left with the the fitted conditional volatility and the parameter estimates. My problem now is to use that to get the analytic VaR estimate for the next day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a simple GARCH(1,1) that is fine: take the last estimated conditional volatility of the sample as well as the last squared residual; plug those into the GARCH equation along with the parameter estimates to get the next day's predicted volatility. One would then use with a quantile function based on whatever distribution was assumed to calculate the analytic VaR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Problem is I am too simple to see how to do get the vol estimate with a FIGARCH model. I have the following maximum likelihood estimates for the FIGARCH parameters:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cst(V) x 10^4   :     0.076547   #ie. constant in GARCH equation (omega)&lt;br&gt;&#xA;d-Figarch :                   0.584467&lt;br&gt;&#xA;ARCH(Phi1) :          0.122547&lt;br&gt;&#xA;GARCH(Beta1) :         0.643318   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have looked at Bollerslev's initial paper on FIGARCH, and am still clueless as to how one gets the next recursive volatility estimate given the parameter estimates and previous day's volatility and squared residual. Any ideas? Any help would be very much appreciated. &lt;/p&gt;&#xA;" OwnerUserId="5897" LastEditorUserId="7008" LastEditDate="2015-11-24T12:34:51.903" LastActivityDate="2015-11-24T12:34:51.903" Title="FIGARCH estimation in R" Tags="&lt;r&gt;&lt;garch&gt;&lt;ox&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8699" PostTypeId="2" ParentId="2565" CreationDate="2013-08-08T20:27:48.383" Score="1" Body="&lt;p&gt;A weekly series of low-frequency (monthly) variables is obtained using an interpolation, or “adjustment” with respect to a related series. The interpolation of a time-series by means of a related series involves two steps: choosing the “benchmark” series, and then interpolating the wanted series using the related series. The related series is chosen so that its movements at the high-frequency intervals are highly correlated with the given series. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, unanticipated inflation data is extracted using monthly CPI data. Therefore, the series has an original &lt;strong&gt;monthly&lt;/strong&gt; frequency. Using a weekly &lt;strong&gt;related&lt;/strong&gt; time series, the &lt;strong&gt;weekly resampling&lt;/strong&gt; of unanticipated inflation is performed by superimposing the intra-month movements of the related series on the month-to-month movement of the monthly unanticipated inflation factor, using a technique to eliminate any difference between the month-to-month movements of the two series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's look at this example. Let:&#xA;- UNIF: be the &lt;strong&gt;monthly&lt;/strong&gt; series of unanticipated inflation. This is the original time-serie.&#xA;- x: be the related time-series to unanticipated inflation, with a &lt;strong&gt;weekly&lt;/strong&gt; frequency.&#xA;- UNIF*: be the interpolated time-series (the one we want to derive) with a&lt;strong&gt;weekly&lt;/strong&gt; frequency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the methodology:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Jb70X.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="5896" LastActivityDate="2013-08-08T20:27:48.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8700" PostTypeId="1" AcceptedAnswerId="8747" CreationDate="2013-08-08T21:26:00.947" Score="6" ViewCount="2535" Body="&lt;p&gt;This &lt;a href=&quot;http://www.cfo.com/article.cfm/3304945/3&quot; rel=&quot;nofollow&quot;&gt;2004 McKinsey Quarterly article&lt;/a&gt; reports that, back in 1999,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;three-quarters of CFOs always or almost always use[d] IRR when evaluating capital projects.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The same article warns against the pitfalls of the internal rate of return (IRR). Although using the latter makes sense if the project only consists of an initial investment and a final cash inflow, things start to get hairy when the project includes interim cash flows:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The definition of the IRR is not mathematically sound because, for such projects, there can be multiple IRR values. Some people say that, in that case, you should pick the smallest of those values (rationale?). However, Excel's IRR routine does not unconditionally converge to that smallest value, as it uses some rootfinding method that requires an initial guess, which influences the result returned.&lt;/li&gt;&#xA;&lt;li&gt;An underlying assumption of the IRR is that interim cash flows can and will be reinvested at the same rate as the IRR, which is rarely the case. This rather strong assumption introduces distortion that can&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;make bad projects look better and good ones look great.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For those reasons, the article recommends staying away from the IRR as much as possible and preferring other metrics such as the Net Present Value (NPV) and the Modified Internal Rate of Return (MIRR).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't work in the world of finance (I've got an engineering background), but the few finance guys who I rub shoulders with use the IRR seemingly without being aware of its limitations. Hence my questions (all related, really):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Has the article's message sunk in since 2004?&lt;/li&gt;&#xA;&lt;li&gt;Or &lt;strong&gt;do (industry) people still routinely use IRR for capital budgeting?&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;Do you know of more recent reports on the popularity (or lack thereof) of the IRR?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="5899" LastEditorUserId="5899" LastEditDate="2013-08-09T08:47:27.153" LastActivityDate="2016-12-16T20:15:45.847" Title="How popular is the IRR as a tool for capital budgeting, nowadays?" Tags="&lt;budgeting&gt;" AnswerCount="5" CommentCount="7" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8702" PostTypeId="2" ParentId="8689" CreationDate="2013-08-09T08:55:28.720" Score="3" Body="&lt;p&gt;I did some calculations in mathematica in the 3 asset case. Assume we have exposures $w_i,i=1,2,3$ and volatilities $\sigma_i,i=1,2,3$ and correlations $\rho_{1,2},\rho_{1,3},\rho_{2,3}$. Let's assume $\sigma_1=\sigma_2=\sigma_3=\sigma$ for some arbitrary positive $\sigma$. For the weights we assume $w_2=w_3 = 0.5$ and we have a short in asset 1 of $w_1 = -0.5$. Then the above formula becomes&#xA;$$&#xA;\rho_{av(2)} = \rho_{1,2}+\rho_{1,3}-\rho_{2,3}.&#xA;$$&#xA;Then the question is whether we can find valid (pos.definite correlation matrix) values for the correlations such that the above formula delivers a results out side of the unit interval. A possible choice is $\rho_{1,2}=0.95, \rho_{1,3}=0.95$ and $\rho_{2,3}=0.89$ with the result $1.01$!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The mathematica code is the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;    pfvar[w1_, w2_, w3_] := &#xA;     w1^2*[Sigma]1^2 + w2^2*[Sigma]2^2 + w3^2*[Sigma]3^2 + &#xA;      2*([Sigma]1*[Sigma]2*[Rho]12*w1*w2 + &#xA;[Sigma]1*[Sigma]3*[Rho]13*w1*w3 + [Sigma]3*[Sigma]2*[Rho]23*w3*w2)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;impliedCorr[w1_, w2_, w3_] := (pfvar[w1, w2, w3] - (w1^2*\[Sigma]1^2 + w2^2*\[Sigma]2^2 &#xA;   + w3^2*\[Sigma]3^2))/(  2*(\[Sigma]1*\[Sigma]2*w1*w2 + \[Sigma]1*\[Sigma]3*w1*&#xA;       w3 + \[Sigma]3*\[Sigma]2*w3*w2)  )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;impliedCorr[w1, w2, w3] /. &#xA;      w2 -&gt; w3 /. [Sigma]2 -&gt; [Sigma]3 /. [Sigma]3 -&gt; [Sigma]1 /. &#xA;   w3 -&gt; 0.5 /. w1 -&gt; -0.5 // Simplify&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[Rho]12 + [Rho]13 - [Rho]23 /. [Rho]12 -&gt; &#xA;    0.95 /. [Rho]13 -&gt; 0.95 /. [Rho]23 -&gt; 0.89&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Thanks to @John I found a mistake and corrected $\rho_{2,3}$ to $0.89$.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2013-09-20T14:03:58.980" LastActivityDate="2013-09-20T14:03:58.980" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="8703" PostTypeId="2" ParentId="2046" CreationDate="2013-08-09T11:14:58.497" Score="4" Body="&lt;p&gt;These 2 sites are relevant:&#xA; - &lt;a href=&quot;http://www.thewholestreet.com/&quot; rel=&quot;nofollow&quot;&gt;The Whole Street&lt;/a&gt; (research aggregation)&#xA; - &lt;a href=&quot;http://www.oxfordstrat.com/rd-blog&quot; rel=&quot;nofollow&quot;&gt;Oxford Capital Strategies&lt;/a&gt; (strategy reviews)&lt;/p&gt;&#xA;" OwnerUserId="5901" LastActivityDate="2013-08-09T11:14:58.497" CommentCount="0" CommunityOwnedDate="2014-07-23T16:34:06.740" ContentLicense="CC BY-SA 3.0" />
  <row Id="8704" PostTypeId="2" ParentId="8596" CreationDate="2013-08-09T14:27:20.263" Score="4" Body="&lt;p&gt;In the following paper: &quot;On the Cross-Section of Expected Stock Returns: Fama-French Ten Years Later&quot; (by Chou, Chou, and Wang), the authors found, using the Fama-Mac Beth two-pass regression, that the size effect becomes insignificant during the post-1981 period, and the Book/Market effect becomes insignificant during the post-1990 period. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is important to note that the statistical significance of the Fama-French factors is not only highly sensitive to the sample period used for testing, but also highly dependent on the test assets used as dependent variables. In both Fama-French papers (1993, 2011), the test assets were double-sorted portfolios formed on size and book/market, and/or size and momentum. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The premise of Fama-French seems reasonable: if there are priced factors that are responsible for the size and value premium, then sorting stocks into portfolios based on their size and book/market ratio are likely to result in diversified portfolios that span the factor space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that, by grouping all of the assets with similar size or B/M together, any variation in factor loading that is independent of these two firm-characteristics is largely eliminated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, in order to have more powerful tests, the LHS(left-hand side) portfolios should be augmented by portfolios with high correlation to the proposed factors, but with imperfect correlation with size and B/M.&lt;/p&gt;&#xA;" OwnerUserId="5896" LastEditorUserId="5896" LastEditDate="2013-08-09T14:39:53.553" LastActivityDate="2013-08-09T14:39:53.553" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="8705" PostTypeId="2" ParentId="8444" CreationDate="2013-08-09T15:21:09.387" Score="2" Body="&lt;p&gt;Beside the lag issue, I do not believe that the negative correlation between Consumer Staples and sentiment is counter-intuitive. The S&amp;amp;P SPDR XLP ETF (Consumer Staples) offers a broad exposure to &lt;strong&gt;defensive&lt;/strong&gt; mega-cap consumer names. Spending on consumer staples is usually characterized by an inelastic demand. Whether the economic climate is strong or week, people still need to purchase tooth-paste, milk or dish-washing liquid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As consumer sentiment decreases in light of chilly economic winds that are likely to affect consumer discretionary spending, investors would tend to seek a more stable and defensive portfolio tilt, hence the increasing interest in the Consumer Staples ETF. &lt;/p&gt;&#xA;" OwnerUserId="5896" LastEditorUserId="5896" LastEditDate="2013-08-09T15:28:09.713" LastActivityDate="2013-08-09T15:28:09.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8706" PostTypeId="1" AcceptedAnswerId="8708" CreationDate="2013-08-09T16:11:20.503" Score="3" ViewCount="1459" Body="&lt;p&gt;What is meant by a structural short in this context:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;First lesson: Valuation shorts are pretty difficult. Look for structural shorts instead.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://brontecapital.blogspot.in/2008/07/whoa-here-come-japanese.html&quot; rel=&quot;nofollow&quot;&gt;Link&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5682" LastActivityDate="2013-08-09T20:16:20.690" Title="What is meant by a structural short?" Tags="&lt;short-selling&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8707" PostTypeId="2" ParentId="8697" CreationDate="2013-08-09T16:27:18.763" Score="8" Body="&lt;p&gt;It appears that you are re-running the regression with each new data point.  Instead, you should use an update/online formula (see an excellent answer by the famous Dr. Huber at &lt;a href=&quot;https://stats.stackexchange.com/a/6923&quot;&gt;stats.se&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find an implementation in the R package &lt;a href=&quot;http://rss.acs.unt.edu/Rdoc/library/biglm/html/biglm.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;biglm&lt;/a&gt;.  If it doesn't have all the features you need (no windowing out of old data) you can at least adapt it and use it to unit test your own work.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2013-08-09T16:27:18.763" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="8708" PostTypeId="2" ParentId="8706" CreationDate="2013-08-09T19:15:36.910" Score="6" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;A &quot;Valuation Short&quot; is a short idea based solely on valuation&#xA;(fundamentals). This is presumably a &quot;bad&quot; idea and one of the&#xA;quickest ways of loosing all your money.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A &quot;Structural Short&quot; is said of shorting a company with a mature business model in decline, or shorting a stock that is becoming obsolete or significantly less competitive due to some major changes in the industry.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;A good example of a structural short is shorting a &quot;newspaper&quot; stock. The case of the newspaper industry is a good illustration of structural decline: due to the proliferation of online news sources, expensive news priting has become obsolete and has lost its competitive advantage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, here is my interpretation of the quote &quot;First lesson: Valuation shorts are pretty difficult. Look for structural shorts instead.&quot;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;When relying on fundamentals &lt;em&gt;alone&lt;/em&gt; to support a &quot;short&quot; idea, one can be misled. For example, some would rush to short a stock based on a small earnings miss. This wouldn't be a good idea unless supported by a catalyst. Earnings miss, slower growth or low margins can easily revert. For example, if a company is hitting a rough patch due to mismanagement, the situation could quickly reverse back with a change of management. Should you have shorted that stock based on fundamentals alone, you would certainly be in trouble.&#xA;However, if the poor fundamentals were supported by the fact that the company is facing structural disadvantages or loosing competitive edge, then your short could end up being profitable.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="5896" LastEditorUserId="5896" LastEditDate="2013-08-09T20:16:20.690" LastActivityDate="2013-08-09T20:16:20.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8709" PostTypeId="2" ParentId="7095" CreationDate="2013-08-09T21:51:08.840" Score="2" Body="&lt;p&gt;I will start by saying that the paper that recommends the procedure is rather badly written, but since the issue is not of high difficulty I would dare to give a few hints that could suggest the answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all, Michelle was trying to do this estimation of the VaR using a non-parametric procedure based on kernel estimation of the real density of the data generating process.&#xA;This is similar to the basic estimation of the VaR from the historical data but in the same time has a small twist of complication.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the &quot;historical&quot; estimation of the VaR you take the data order it by value and look at the point from where it starts the 5% worst block of data points. That will be your estimate of the 5% VaR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this kernel estimation you want to get to the &quot;same&quot; result but you want it to make it a bit more fancy by adding some probability to it. This bit of probability regards the distribution of the estimate of the VaR. That is, we consider the historical realisations as one of many possible realisations of the process of the price, and so, the VaR estimate from the historical data is one of the possible many values that this estimator takes, and all of this possible values would make a distribution.This is the distribution that he was looking for (the jth order distribution). To compute that, he just needed to apply some formula given in the above cited article. And in the end, the mean of that distribution would give him the estimate of the VaR. The benefit of having that distribution is that you can give some credibility to that estimator by computing for example the confidence interval of that estimate of the VaR.&lt;/p&gt;&#xA;" OwnerUserId="5333" LastEditorUserId="5333" LastEditDate="2013-08-09T23:00:31.187" LastActivityDate="2013-08-09T23:00:31.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8710" PostTypeId="2" ParentId="1270" CreationDate="2013-08-10T05:43:03.637" Score="3" Body="&lt;p&gt;You can use copulas. The probability that B rises given A rises is $P(- R_B &amp;lt; 0 | - R_A &amp;lt; 0) = \frac{P(-R_B &amp;lt; 0, - R_A &amp;lt; 0)}{P(-R_A &amp;lt; 0)} = \frac{C(F_{-B}(0),F_{-A}(0))}{F_{-A}(0)}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can specify the marginals as a GARCH process and use either non parametric or parametric copulas to get your final conditional probability. &lt;/p&gt;&#xA;" OwnerUserId="3174" LastActivityDate="2013-08-10T05:43:03.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8711" PostTypeId="2" ParentId="8689" CreationDate="2013-08-10T09:15:22.093" Score="4" Body="&lt;p&gt;Let's start by replacing $\sigma$ by its estimator formula $\sigma^2=\frac{1}{n}\sum^n_{i=1}(x_i-\mu)^2$. Now, by replacing $\mu$ by its estimator $\mu=\frac{1}{n}\sum^n_{i=1}x_i$ in the formula for the variance we obtain:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma^2=\frac{1}{2n^2}\sum^n_{j=1}\sum^n_{i=1}(x_i-x_j)^2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the individual asset, the variance will write $\sigma^2_s=\frac{1}{2n^2}\sum^n_{j=1}\sum^n_{i=1}(x_{s,i}-x_{s,j})^2$, $s=1,2,...,N$.&#xA;For the portfolio, we can denote the observations by $y_i=\sum_{s=1}^N w_sx_{s,i}$, and so the variance of the portfolio writes&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma^2=\frac{1}{2n^2}\sum^n_{j=1}\sum^n_{i=1}(y_i-y_j)^2=\frac{1}{2n^2}\sum^n_{j=1}\sum^n_{i=1}(\sum_{s=1}^N w_sx_{s,i}-\sum_{s=1}^N w_sx_{s,j})^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, feeding this into your formula we get on the numerator:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma^2-\sum_{s=1}^N w^2_s\sigma_s^2=\frac{1}{2n^2}\sum^n_{j=1}\sum^n_{i=1}(\sum_{s=1}^N w_sx_{s,i}-\sum_{s=1}^N w^2_sx_{s,j})^2-\sum_{s=1}^N w_s\frac{1}{2n^2}\sum^n_{j=1}\sum^n_{i=1}(x_{s,i}-x_{s,j})^2=\frac{1}{2n^2}\sum^n_{j=1}\sum^n_{i=1}[(\sum_{s=1}^N w_s(x_{s,i}-x_{s,j}))^2-\sum_{s=1}^N w^2_s(x_{s,i}-x_{s,j})^2]=$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$=\frac{1}{2n^2}\sum^n_{j=1}\sum^n_{i=1}[\sum_{s=1}^N w_s^2(x_{s,i}-x_{s,j})^2+2\sum^N_{s=1}\sum^N_{t&amp;gt;1} w_s w_t(x_{s,i}-x_{s,j})(x_{t,i}-x_{t,j})-\sum_{s=1}^N w^2_s(x_{s,i}-x_{s,j})^2] $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$=\frac{1}{n^2}\sum^n_{j=1}\sum^n_{i=1}\sum^N_{s=1}\sum^N_{t&amp;gt;1} w_s w_t(x_{s,i}-x_{s,j})(x_{t,i}-x_{t,j})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the denominator you have :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$2\sum^N_{s=1}\sum^N_{t&amp;gt;1} w_s w_t\sigma_s\sigma_t=\frac{1}{n^2}\sum^N_{s=1}\sum^N_{t&amp;gt;1} w_s w_t\sqrt{\sum^n_{j=1}\sum^n_{i=1}(x_{s,i}-x_{s,j})^2\sum^n_{j=1}\sum^n_{i=1}(x_{t,i}-x_{t,j})^2}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fraction looks like :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\rho=\frac{\sum^N_{s=1}\sum^N_{t&amp;gt;1} w_s w_t\sum^n_{j=1}\sum^n_{i=1}(x_{s,i}-x_{s,j})(x_{t,i}-x_{t,j})}{\sum^N_{s=1}\sum^N_{t&amp;gt;1} w_s w_t\sqrt{\sum^n_{j=1}\sum^n_{i=1}(x_{s,i}-x_{s,j})^2(x_{t,i}-x_{t,j})^2}}=\frac{\sum^N_{s=1}\sum^N_{t&amp;gt;1}A}{\sum^N_{s=1}\sum^N_{t&amp;gt;1}\sqrt{B}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we look at the relation between A and B, by Cauchy-Schwarz inequality $A^2\leq B$ which translates into  $|\rho|\leq1$. Hopefully I didn't make to many mistakes...&lt;/p&gt;&#xA;" OwnerUserId="5333" LastEditorUserId="5333" LastEditDate="2013-08-10T09:36:49.700" LastActivityDate="2013-08-10T09:36:49.700" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8715" PostTypeId="1" CreationDate="2013-08-10T19:45:58.407" Score="0" ViewCount="378" Body="&lt;p&gt;In the Black (1976) model:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;We should use the settlement prices of the underlying futures contract in order to estimate the volatility, right? Or can we also use the spot prices?&#xA;Because the behaviors of these series of prices are quite different.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Should the volatility always be annualized?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5754" LastEditorUserId="35" LastEditDate="2013-08-10T20:19:25.750" LastActivityDate="2013-08-15T10:03:39.373" Title="Black model - volatility estimation" Tags="&lt;volatility&gt;&lt;black-scholes&gt;&lt;futures&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8716" PostTypeId="1" CreationDate="2013-08-10T19:52:53.237" Score="2" ViewCount="606" Body="&lt;p&gt;In the electricity sector, what should be the shape of the volatility smile?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a behavior similar to other commodities with a convex curve, decreasing first and then growing to the initial level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or &lt;/p&gt;&#xA;&#xA;&lt;p&gt;a volatility skew with volatilities elevated for higher strike prices ??&lt;/p&gt;&#xA;" OwnerUserId="5754" LastEditorUserId="19645" LastEditDate="2021-05-05T08:45:19.523" LastActivityDate="2021-05-05T08:45:19.523" Title="Electricity volatility smile" Tags="&lt;volatility&gt;&lt;volatility-smile&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8717" PostTypeId="2" ParentId="8715" CreationDate="2013-08-10T21:54:06.673" Score="0" Body="&lt;p&gt;In theory, since the futures price is $F(t,T)=S(t)e^{r(T-t)}$, the only risk source is coming from S(t), so the volatilities of the two series should be the same. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The thing is that the theory doesn't consider the fact that the interest rates could be stochastic, or that the future market is more liquid and so incorporates more easily information. Also if the underlying of the future contract is a commodity then you also have the volatility coming from storage cost and convenience yield. So indeed the two series could represent different volatilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And, the one you should use is of course the volatility obtained from the futures prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In what regards weather you should use annualised or monthly volatilities, it shouldn't matter, in theory, as long as you fix the time unit and you are consistent with it throughout the calculations. It does come handy though to use the year as a unit time.     &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason why it doesn't matter what time unit you chose resides in the scaling properties of the BM (in case you are interested).&lt;/p&gt;&#xA;" OwnerUserId="5333" LastActivityDate="2013-08-10T21:54:06.673" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8718" PostTypeId="2" ParentId="8716" CreationDate="2013-08-10T22:18:26.947" Score="2" Body="&lt;p&gt;This &lt;a href=&quot;http://www.waset.org/journals/waset/v59/v59-368.pdf&quot; rel=&quot;nofollow&quot;&gt;article&lt;/a&gt; discusses the problem on the German electricity market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They arrive at the following conclusion:&quot;When the B&amp;amp;S model is used to calculate implied&#xA;volatilities one often obtain different numbers for different&#xA;values of K and T. In particular, a &quot;smile&quot; or &quot;smirk&quot; shape is&#xA;often observed in the plot of implied volatility versus strike&#xA;price. Implied volatility tends to increase with maturity time,&#xA;but is often larger for options with very short maturities. This&#xA;is due to the increase in price that sometimes occurs when&#xA;options are close to maturity as the price and the payoff&#xA;converge.&quot;&lt;/p&gt;&#xA;" OwnerUserId="5333" LastActivityDate="2013-08-10T22:18:26.947" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8724" PostTypeId="1" AcceptedAnswerId="9135" CreationDate="2013-08-12T12:30:49.003" Score="15" ViewCount="15538" Body="&lt;p&gt;I am interested in calibrating a &lt;a href=&quot;http://en.wikipedia.org/wiki/Hull%E2%80%93White_model&quot;&gt;Hull-White&lt;/a&gt; model to the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not, however, have data on anything except the market zero curves, as all derivatives are being traded OTC. My plan is to calibrate the model to the zero curve.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Will this produce a sensible calibration of the model in respect of derivatives? &lt;/li&gt;&#xA;&lt;li&gt;If not, how does one proceed in this case?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5863" LastEditorUserId="467" LastEditDate="2013-08-12T14:29:28.500" LastActivityDate="2018-07-02T13:32:53.160" Title="How to calibrate Hull-White from zero curve?" Tags="&lt;fixed-income&gt;&lt;calibration&gt;&lt;hullwhite&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="8726" PostTypeId="1" CreationDate="2013-08-12T13:13:56.513" Score="5" ViewCount="808" Body="&lt;p&gt;I have constructed a simple HMM (&lt;a href=&quot;http://en.wikipedia.org/wiki/Hidden_Markov_model&quot; rel=&quot;nofollow&quot;&gt;Hidden Markov Model&lt;/a&gt;) with 2 states on the Vol (stdev) of a time series of currency returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The state vector I produce looks reasonable, in the sense that it appears to have identified periods of high or low vol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I appear to be able to generate a very similar state vector just by applying a simple rule like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if (Vol) &amp;gt; x then 1 else 0.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there any advantage/difference to using a HMM?&lt;/p&gt;&#xA;" OwnerUserId="5914" LastEditorUserId="35" LastEditDate="2013-08-14T13:19:51.943" LastActivityDate="2015-10-06T12:10:00.857" Title="Is HMM of Volatility any different from a simple filter?" Tags="&lt;markov-switching&gt;" AnswerCount="2" CommentCount="8" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8727" PostTypeId="2" ParentId="8715" CreationDate="2013-08-12T14:29:55.423" Score="1" Body="&lt;p&gt;In standard Black model &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) We have to use the volatility of underlying. It is similar for futures and stocks, but it is not the same! Futures prices differ from stock prices not only by discounting, but also by dividends, for example. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Volatility should be annualized if you want to use formula &quot;as is&quot; without amendments.&lt;/p&gt;&#xA;" OwnerUserId="2870" LastActivityDate="2013-08-12T14:29:55.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8728" PostTypeId="2" ParentId="8726" CreationDate="2013-08-12T15:58:33.263" Score="8" Body="&lt;p&gt;Have a look at the following paper:&lt;br&gt;&#xA;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2066848&quot; rel=&quot;nofollow&quot;&gt;Regime Shifts: Implications for Dynamic Strategies by Kritzman, Page and Turkington&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the paper (p. 25):&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;But why go through all the trouble? When dealing with regime shifts,&#xA;  we expect Markov-switching models to perform better than simple data&#xA;  partitions based on thresholds. For example, in Figure 1, if we had&#xA;  simply classified the observations that were in the highest quartile&#xA;  as being associated with Regime 2 (the high-mean regime), we would&#xA;  have misidentified the actual regime 40 times out of 200 observations.&#xA;  In contrast, a well calibrated Markov-switching model would have&#xA;  misidentified the actual regime only three times. Arbitrary thresholds&#xA;  give false signals because they fail to capture the persistence in&#xA;  regimes as well as changing volatilities&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;br&gt;&#xA;There doesn't seem to be a free version available any more. If you find one, please let me know: I will then update the link.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2015-10-06T12:10:00.857" LastActivityDate="2015-10-06T12:10:00.857" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8730" PostTypeId="1" AcceptedAnswerId="8752" CreationDate="2013-08-12T20:18:48.387" Score="2" ViewCount="2091" Body="&lt;p&gt;Could anyone point me to detailed literature about &quot;Partial Least Squares Discriminant Analysis&quot;? Intuition, methodology and examples..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;" OwnerUserId="5896" LastActivityDate="2013-08-14T12:58:29.193" Title="Partial Least Squares Discriminant Analysis" Tags="&lt;statistics&gt;&lt;principal-components&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8731" PostTypeId="2" ParentId="8730" CreationDate="2013-08-13T07:49:41.493" Score="2" Body="&lt;p&gt;In addition to the references already given by Matt I would recommend the following presentation which gives a good overview of the big picture, intuition and some mathematical background:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://zoo.cs.yale.edu/classes/cs445/slides/Pfizer_Yale_Version.ppt&quot; rel=&quot;nofollow&quot;&gt;http://zoo.cs.yale.edu/classes/cs445/slides/Pfizer_Yale_Version.ppt&lt;/a&gt;‎&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See esp. pages 71ff. and 206ff.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2013-08-13T07:49:41.493" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8733" PostTypeId="2" ParentId="8700" CreationDate="2013-08-13T10:22:20.753" Score="5" Body="&lt;p&gt;I worked at two large industrial companies for several years and I saw how they evaluate investment projects. The thing is that investment people use any measure that looks good to approve the project they want to be approved. If IRR looks good, they show you IRR. If IRR is bad, they use something else, f.e. NPV. And NPV is extremely nice when comparing two projects of different term, for example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wanted also to add that there can't be any &quot;industry standard&quot; for investment projects. Everyone calculates IRR, but the way it is used depends on project type.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And I can't understand how the hell is this question related to quant finance ))&lt;/p&gt;&#xA;" OwnerUserId="2870" LastActivityDate="2013-08-13T10:22:20.753" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="8734" PostTypeId="2" ParentId="8724" CreationDate="2013-08-13T10:35:12.623" Score="7" Body="&lt;p&gt;The one-factor Hull-White model is given by &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dr(t) = (\theta(t) - \alpha\; r(t))\,dt + \sigma(t)\, dW(t)\,\!.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The zero curves are only sufficient for the calibration of the parameter $\theta(t)$, which is given in terms of them by &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\theta\mathrm{(t)=}\frac{\partial f(0,t)}{\partial T}+\alpha f(0,t)+\frac{\sigma^2}{2\alpha}(1-e^{-2\alpha t}),$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $f(0,T)$ is the instantaneous forward rate at time zero for a maturity of $T$. The parameters $\alpha$ (which describes mean reversion) and $\sigma$ (which describes volatility) have to be calibrated from external sources and chosen such that the output of the model, such as the price of zero-coupon bonds, match the market price of the instruments.&lt;/p&gt;&#xA;" OwnerUserId="5676" LastEditorUserId="34863" LastEditDate="2018-07-02T13:32:53.160" LastActivityDate="2018-07-02T13:32:53.160" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="8735" PostTypeId="1" CreationDate="2013-08-13T11:13:52.740" Score="1" ViewCount="903" Body="&lt;p&gt;Is there any other historical end-of-day CME option data provider rather then CME DataMine?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've searched all the internet and found only CBOE traded options.&lt;/p&gt;&#xA;" OwnerUserId="5409" LastActivityDate="2016-06-16T20:12:12.760" Title="CME historical option data provider" Tags="&lt;options&gt;&lt;data&gt;&lt;historical-data&gt;&lt;cme&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8737" PostTypeId="2" ParentId="8716" CreationDate="2013-08-13T13:51:30.867" Score="2" Body="&lt;p&gt;This is a great question that I actually had when I worked on the trading floor at this large energy company that traded power and other energy commodities. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Electricity has a volatility skew to the upside. So vol for OTM Calls/Deep ITM Puts trades at a premium. Mainly because prices have a tendency to shoot to the upside when load exceeds base demand until new supply comes online to absorb the new demand.&lt;/p&gt;&#xA;" OwnerUserId="4729" LastEditorUserId="35" LastEditDate="2013-08-13T15:57:36.780" LastActivityDate="2013-08-13T15:57:36.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8738" PostTypeId="1" CreationDate="2013-08-13T14:17:19.340" Score="8" ViewCount="1965" Body="&lt;p&gt;What is the correct methodology to compute constant maturity futures price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've met in some papers that do the following. To create constant maturity synthetic futures prices with maturity $m = 30, 60,...,180$ days. We should take a pair of futures that straddle the chosen maturity $m$ with maturities $s&amp;lt;m&amp;lt;l$ measured in days until expiration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the price is derived using the following formula: $$ p_m = \alpha p_s + (1-\alpha)p_l,\, \alpha = \frac{l-m}{l-s}$$&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Should the maturity be rounded to days?&lt;/li&gt;&#xA;&lt;li&gt;What happens when shorter futures comes closer to expiration. On which date and how we roll over the pair?&#xA;Is it recommended to roll over futures several days before expiration. In this case we should have negative $\alpha$.&lt;/li&gt;&#xA;&lt;li&gt;What are the limitations of this methodology? What are general assumptions?&lt;/li&gt;&#xA;&lt;li&gt;We can take only daily closing prices or we can use more frequent data?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5409" LastActivityDate="2017-03-08T20:33:07.700" Title="Constant maturity futures price methodology" Tags="&lt;futures&gt;&lt;methodology&gt;&lt;synthetic&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8739" PostTypeId="1" CreationDate="2013-08-13T16:08:13.983" Score="3" ViewCount="283" Body="&lt;p&gt;Let's assume the usual state-space linear model without constant term for simplicity:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$y_{t}=\beta_{t} X_{t}+\epsilon_{t}$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we apply Gaussian Kalman filter to estimate &lt;span class=&quot;math-container&quot;&gt;$\beta_{t}$&lt;/span&gt; we get &lt;span class=&quot;math-container&quot;&gt;$P_{t}$&lt;/span&gt;, which is the covariance matrices of predicted states, and &lt;span class=&quot;math-container&quot;&gt;$v_{t}$&lt;/span&gt;, which is the prediction error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following simple &lt;code&gt;R&lt;/code&gt; code allows you to download pair of tickers (&lt;code&gt;QQQ&lt;/code&gt; and &lt;code&gt;XLK&lt;/code&gt; for instance) from Yahoo Finance and estimate &lt;span class=&quot;math-container&quot;&gt;$P_{t}$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$v_{t}$&lt;/span&gt; while plotting them:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# ======================================== #&#xA;# Kalman filter errors and states variance #&#xA;# ======================================== #&#xA;&#xA;op &amp;lt;- par(no.readonly = TRUE)&#xA;Sys.setenv(TZ = 'UTC')&#xA;&#xA;# Contents:&#xA;&#xA;# 1. Installing packages&#xA;# 2. Loading packages&#xA;# 3. Downloading and plotting data&#xA;# 4. Kalman filtering of linear regression Beta&#xA;&#xA;# *********************************&#xA;# 1. Installing packages&#xA;# *********************************&#xA;&#xA;#install.packages('KFAS')&#xA;#install.packages('latticeExtra')&#xA;#install.packages('quantmod')&#xA;&#xA;# *********************************&#xA;# 2. Loading packages&#xA;# *********************************&#xA;&#xA;require(compiler)&#xA;require(latticeExtra)&#xA;require(KFAS)&#xA;require(quantmod)&#xA;&#xA;# *********************************&#xA;# 3. Downloading and plotting data&#xA;# *********************************&#xA;&#xA;Symbols &amp;lt;- c('QQQ', 'XLK')&#xA;getSymbols(Symbols, from = '1950-01-01')&#xA;data &amp;lt;- na.omit(merge(Cl(QQQ), Cl(XLK)))&#xA;colnames(data) &amp;lt;- Symbols&#xA;xyplot(data)&#xA;&#xA;# *********************************&#xA;# 4. Kalman filtering of linear regression Beta&#xA;# *********************************&#xA;&#xA;y &amp;lt;- na.omit(merge(ClCl(QQQ), ClCl(XLK)))[,1]&#xA;X &amp;lt;- na.omit(merge(ClCl(QQQ), ClCl(XLK)))[,2]&#xA;model &amp;lt;- regSSM(y = y, X = X, H = NA, Q = NA)&#xA;object &amp;lt;- fitSSM(inits = rep(0, 2), model = model)&lt;span class=&quot;math-container&quot;&gt;$model&#xA;KFAS &amp;lt;- KFS(object = object)&#xA;P &amp;lt;- xts(as.vector(KFAS$&lt;/span&gt;P)[-1], index(y))&#xA;v &amp;lt;- xts(t(KFAS$v), index(y))&#xA;Z &amp;lt;- cbind(P, v)&#xA;colnames(Z) &amp;lt;- c('Covariance of predicted state', 'Prediction error')&#xA;xyplot(tail(Z, 1000))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now let's iterate this procedure over several pairs of securities to estimate their &lt;span class=&quot;math-container&quot;&gt;$\beta_{t}$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$P_{T}$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$v_{t}$&lt;/span&gt; and you want to sort these pairs by the stability and accuracy of &lt;span class=&quot;math-container&quot;&gt;$\beta_{t}$&lt;/span&gt;, that is, low variance and low prediction error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to know suitable criteria to make this ranking system having available &lt;span class=&quot;math-container&quot;&gt;$P_{t}$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$v_{t}$&lt;/span&gt;, i.e. how to penalize a linear relationship because of too high variance and prediction errors?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Replacing &lt;code&gt;QQQ&lt;/code&gt; and &lt;code&gt;XLK&lt;/code&gt; in my code with &lt;code&gt;VXX&lt;/code&gt; and &lt;code&gt;TLT&lt;/code&gt;, you will see greater &lt;span class=&quot;math-container&quot;&gt;$P_{t}$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$v_{t}$&lt;/span&gt;, which are linearly related between &lt;code&gt;VXX&lt;/code&gt; and &lt;code&gt;TLT&lt;/code&gt; and are more volatile and have weaker predictive power than the one between &lt;code&gt;QQQ&lt;/code&gt; and &lt;code&gt;XLK&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is similar to a ranking system and I would like to know how to produce some numeric criteria.&lt;/p&gt;&#xA;" OwnerUserId="3058" LastEditorUserId="38578" LastEditDate="2019-02-23T22:39:23.423" LastActivityDate="2019-02-23T22:39:23.423" Title="Good criteria to sort state-space $\beta_{t}$ according to Kalman filter output" Tags="&lt;beta&gt;&lt;covariance&gt;&lt;prediction&gt;&lt;kalman&gt;&lt;error&gt;" AnswerCount="0" CommentCount="6" FavoriteCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="8740" PostTypeId="1" AcceptedAnswerId="8741" CreationDate="2013-08-13T18:21:20.340" Score="-3" ViewCount="2420" Body="&lt;p&gt;Forgive me I am not good at economics, I have following values.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;amount I want to lend.&lt;/li&gt;&#xA;&lt;li&gt;the current bank interest rate.&lt;/li&gt;&#xA;&lt;li&gt;the amount of years the loan will be for&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Please tell me the formula to calculate how much interest only amount that I will have to pay back over the life of the loan.&lt;/p&gt;&#xA;" OwnerUserId="5920" LastActivityDate="2013-08-14T12:45:39.340" Title="Interest only loan formula" Tags="&lt;economics&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ClosedDate="2013-08-13T20:14:26.597" ContentLicense="CC BY-SA 3.0" />
  <row Id="8741" PostTypeId="2" ParentId="8740" CreationDate="2013-08-13T20:40:50.530" Score="0" Body="&lt;p&gt;If this is a mortgage-type loan, the most &quot;straightforward&quot; way of knowing the total interest amount is to use an &lt;strong&gt;amortization table&lt;/strong&gt;. The table lists the periodic payment, as well as the interest portion and principal repayment portion, for each payment period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the derivation of the formula for the period payment (interest + principal repayment). Let &lt;em&gt;n&lt;/em&gt; be the total number of periods (frequency * maturity), &lt;em&gt;R&lt;/em&gt; be the annualized interest rate, &lt;em&gt;r&lt;/em&gt; be the &lt;em&gt;periodic&lt;/em&gt; interest rate, &lt;em&gt;X&lt;/em&gt; be the periodic payment and &lt;em&gt;P&lt;/em&gt; be the amount of the loan. Let &lt;em&gt;P(n)&lt;/em&gt; be the remaining face value at time t = 1,2,....,n. We have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P(0) = P\\&#xA; P(1) = P(0)(1+r) - X = P(1+r) - X\\&#xA; P(2) = P(1)(1+r) - X = P(1+r)^2 - X(1+r) - X\\&#xA; P(3) = P(2)(1+r) - X = P(1+r)^3 - X(1+r)^2 - X(1+r) - X\\&#xA; P(n) = P(1+r)^n - X\displaystyle\sum\limits_{i=0}^{n-1} (1+r)^i = P(1+r)^n - X\displaystyle\frac{r^n-1}{r-1} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the remaining balance would be 0 by the end of time &lt;em&gt;n&lt;/em&gt; (you would have paid off your loan), $P(n) = 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, we can compute the periodic payment X as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ X = P \displaystyle\frac{r(1+r)^n}{(1+r)^n - 1} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that r is the &lt;em&gt;periodic&lt;/em&gt; interest rate, i.e. $ r = \displaystyle\frac{R}{n} $.&#xA;The reason why P is timed by $(1+r)^n$ is that the amount borrowed is subject to time value of money.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's now take an example. Suppose you are borrowing an amount of $1,000 at 6% for 1 year, with monthly payments. We have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$n = 1 * 12 = 12$$ &#xA;$$P = 1,000$$&#xA;$$R = 0.06$$&#xA;$$r = \displaystyle\frac{R}{n} = \displaystyle\frac{0.06}{12} = 0.005$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The periodic payment X is:&#xA;$$X = 1,000 * \displaystyle\frac{0.005*(1+0.005)^{12}}{(1+0.005)^{12}-1} = 86.07 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The interest payment portion of X at n = 1 is:   $Interest =  P * r = 1,000 * 0.005 = 5$&#xA;The principal repayment portion of X is: $X - Interest = 86.07 - 5 = 81.07$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For complete calculations, here is the amortization table:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/uIIBn.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="5896" LastEditorUserId="5896" LastEditDate="2013-08-14T12:45:39.340" LastActivityDate="2013-08-14T12:45:39.340" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8742" PostTypeId="2" ParentId="8697" CreationDate="2013-08-13T21:19:57.943" Score="5" Body="&lt;p&gt;This isn't exactly what I would call advanced but running each regression on a separate core in a parallel foreach loop would help&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://cran.r-project.org/web/packages/foreach/foreach.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://cran.r-project.org/web/packages/foreach/foreach.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="1764" LastEditDate="2013-08-13T21:36:15.150" LastActivityDate="2013-08-13T21:36:15.150" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8743" PostTypeId="1" AcceptedAnswerId="8778" CreationDate="2013-08-13T22:32:24.147" Score="2" ViewCount="140" Body="&lt;p&gt;If you look at instrument name for listed on various futures exchange you often see&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gold Only1214&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gold Full1214&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is &quot;Full&quot; and &quot;Only&quot; mean? The price listed is the same and I cannot find a reference to this convention anywhere? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Please and Thank you.)&lt;/p&gt;&#xA;" OwnerUserId="5924" LastActivityDate="2013-08-16T06:50:15.770" Title="What is the difference between full and only futures?" Tags="&lt;futures&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8744" PostTypeId="1" CreationDate="2013-08-13T23:49:48.197" Score="9" ViewCount="16842" Body="&lt;p&gt;I'm interested in testing my trading strategy using the Interactive Brokers API for Trader Workstation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A demo account is provided to play with TWS for free, but if I fund a real account I will be provided with a paper trading account to use.  I believe that the demo account uses simulated or old market data, whereas a paper-trading account will use real-time data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other than the delay in market data, are there any restrictions or limitations to using the TWS demo account compared to a paper-trading account?&lt;/p&gt;&#xA;" OwnerUserId="5925" LastActivityDate="2019-12-05T16:33:13.250" Title="What is the difference between the Interactive Brokers demo account and a personal paper trader account?" Tags="&lt;quant-trading-strategies&gt;&lt;programming&gt;&lt;interactive-brokers&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8745" PostTypeId="2" ParentId="8744" CreationDate="2013-08-14T01:32:10.567" Score="7" Body="&lt;p&gt;The demo account sends simulated data, not delayed data.  It is unusable for just about anything except to see if your connections are working.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The paper account sends real time data if you subscribe to it and pay data fees.  It has all the functionality of a real account except fills are simulated.  I believe it's worst case fills as in you have to trade through your price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Delayed data is unavailable through the API.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no built in way to test strategies, you have to write them somehow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try &lt;a href=&quot;http://finance.groups.yahoo.com/group/TWSAPI/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://finance.groups.yahoo.com/group/TWSAPI/&lt;/a&gt;  for more info (join group required).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's no real need to open an account to test strategies if you plan on using historical data.  The only testing specifically to IB should be testing your API code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are some intricacies to IB's data you should be aware of.  It is sampled and only sends updates a few times per second.  You won't get 100% accurate data from them.  There is only limited historical data available for download.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit:&#xA;Delayed data is now available &lt;a href=&quot;http://interactivebrokers.github.io/tws-api/market_data_type.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://interactivebrokers.github.io/tws-api/market_data_type.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yahoo group moved to &lt;a href=&quot;https://groups.io/g/twsapi&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://groups.io/g/twsapi&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5872" LastEditorUserId="5872" LastEditDate="2019-12-05T16:33:13.250" LastActivityDate="2019-12-05T16:33:13.250" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="8747" PostTypeId="2" ParentId="8700" CreationDate="2013-08-14T04:54:53.387" Score="4" Body="&lt;p&gt;&lt;strong&gt;Disclaimer before I add my take:&lt;/strong&gt; I am not a corporate finance practitioner and do not work on budgeting decisions at a large corporation. Rather, I make budgeting decisions for the quant fund I manage. As thus my points may not reflect the point of view of a corporate finance practitioner but nonetheless I believe my points are equally applicable and having had numerous conversations with corporate treasurers of banks but also non financial corporations I believe I have an idea about the thought process going on inside someone who makes budgeting decisions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I like to present a theoretical view and then the practitioner's view:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Theory:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I do not want to go into the details of pitfalls of IRR or NPV but overall the advantage of using IRR is that it produces a single number, it leads to results without making too many assumptions. However, IRR suffers from deficiencies in regards to intermittent cash flows. Also, IRR can result in multiple solutions.&lt;/li&gt;&#xA;&lt;li&gt;On the other hand NPV may require more assumptions. Especially tricky is which rate to chose to discount each of the cash flows. However, in its complexity lies also its accuracy: NPV allows you to discount cash flows at different discount rates. In corporate finance the discount rate can be interpreted in various ways. Some of such interpretations are &quot;hurdle rate&quot;, weighted cost of capital, risk adjusted cost of capital, or financing cost. They are not one and the same and thus assumptions have to be made which exact discount rate to chose. However, despite lots of literature claiming NPV to be complicated I find the theoretical construct very logical because it results in a present value of future cash flows which is what anyone interested in such computations should ultimately be interested in.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here couple links that describe the comparison between IRR and NPV more in detail:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://finance.wharton.upenn.edu/~benninga/pfe_chap07.pdf&quot; rel=&quot;nofollow&quot;&gt;INTRODUCTION TO CAPITAL BUDGETING&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://agmarketing.extension.psu.edu/Business/FinancialTools/TimeValueMoneyP2.PDF&quot; rel=&quot;nofollow&quot;&gt;Time Value of Money and Investment Analysis&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.finaticsonline.com/Freebies/IRR_vs_MIRR_vs_NPV_%5BFinatics%5D.pdf&quot; rel=&quot;nofollow&quot;&gt;Capital Budgeting &amp;amp; Project Appraisal&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.qfinance.com/contentFiles/QF02/g1xtn5q6/12/3/comparing-net-present-value-and-internal-rate-of-return.pdf&quot; rel=&quot;nofollow&quot;&gt;Comparing Net Present Value and Internal Rate of Return&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is as far as theory is concerned.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Practical Application:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;As IRR involves an easier calculation it is the preferred method of use. Management likes simple numbers even if the assumptions are faulty but within the ballpark. IRR has traditionally been used so most practitioners prefer not to shake up things and rather stick to the status quo. Nobody wants to be challenged to answer why they chose different discount rates for each future cash flow and how they arrived at each of those rates. The truth is that any such rates and future cash flows are inherently assumptions that involve a margin for error. When upper management makes decisions they want to be told by their subordinates whether a project produces an IRR that is higher than their overall financing cost for that overall group, region, brand,...most of those guys do not like to hear that a large degree of guess work was at play.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;NPV is by far the more logical way to arrive at a project's expected return. Not only can any type of intermittent cash flows be embedded but each cash flow can be discounted at a different rate, and it should be that way! If a project produces different types of future cash flows (for example, news paper subscriptions: Positive future subscription revenues embed a different type of risk for long-term subscribers vs the subscription revenue earned from new subscribers, hence the future cash flows originating from such subscriptions should be discounted at different rates.). NPV produces far more accurate results despite its multiple assumptions because it reflects a more realistic treatment of future cash flows. Another example are budgeting costs for a trading business of one specific desk. A trading desk may trade in different asset classes, each asset class being of different risk grade. Thus, the financing cost are different. While a bank or hedge funds itself externally on just one or very few rates (realistically not just one rate) internally financing rates are entirely different: An equity trading desk will be charged very different financing rates than a commodities or bond trading desk because they all produce future cash flows of different risk grades. Even one single desk has different traders, some taking wild swings but larger expected cash flows while others are more risk averse and steadily but more slowly build pnl. That should in theory all be considered. Of course that is not the case because a trade-off has to be made between efficiency and accuracy. But I think it is a good reflection of what really goes on within managers involved in capital budgeting. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;However, I like to highlight another aspect which is the political component: Sometimes capital budgeters are forced to arrive at a specific number so they basically need to tweak inputs to arrive at the desired outcome rather than the other way around. Managers' motivations are rarely perfectly aligned with long-term business growth, not even with shareholder or stake holder interests. If one's bonus depends on how many new projects have been proposed and approved by upper management then it tremendously helps to present &quot;juicy propositions&quot; that may not rely on realistic numbers to push the project to the approval stage. Especially for long-term projects most managers care very little what happens 5 years down the road if they look to cash in big time on their next 3 years' worth of bonuses. Sadly, especially in financial operations this is rather the norm than the exception and this I think is born out of the fact that labor mobility is very high between financial corporations. Also financial practitioners generally have a very short-term memory. If one fails, he/she can take some time off or maintain a low profile only to knock on the next door several months or a year down the road and still get a very fair shot. That also happens in normal corporations but I would guess at a much lower rate. One reason for that could be that CEOs of normal corporations are more credited but also held more accountable for the success/failure of the business while financial corporation's CEOs generally get away with bad performance as they can blame market conditions for such challenges. The world is what it is and as long as especially the current American business model with extreme short-term focus on quarterly results, dividend payments, bonuses, the ridiculous amount of short-term staff evaluations (lots of research has shown that it greatly diminishes staff morale and efficiency to evaluate and monitor each other on an almost constant basis and that the cost of such constant evaluations are higher than the perceived benefits) prevails, things most likely won't change much. As long as shareholders and consumers maintain a short term focus, so will corporations and its management.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Summary, in theory IRR suffers from simplistic assumptions and but it is easier to come up with a single number while NPV is far more accurate but involves more assumptions and is more complex to structure. Practitioners need to balance efficiency vs accuracy, however, keep in mind that there are also political undercurrents involved in the choice of technique. Not everything in business comes down to simple number crunching.  &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-08-14T05:02:23.713" LastActivityDate="2013-08-14T05:02:23.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8748" PostTypeId="2" ParentId="4391" CreationDate="2013-08-14T06:31:42.017" Score="0" Body="&lt;p&gt;Are you looking for this?&#xA;Stock return characteristics, skew laws, and the differential pricing of individual equity options, G. Bakshi, N. Kapadia, and D. Madan. Review of Financial Studies 16(1):101--143 (2003)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.8.1805&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow&quot;&gt;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.8.1805&amp;amp;rep=rep1&amp;amp;type=pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;eqn (29)&lt;/p&gt;&#xA;" OwnerUserId="4792" LastActivityDate="2013-08-14T06:31:42.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8749" PostTypeId="1" AcceptedAnswerId="8760" CreationDate="2013-08-14T08:07:24.590" Score="6" ViewCount="11143" Body="&lt;p&gt;In terms of Merton credit risk model need to find the initial value of counterparty's assets and the volatility of the assets. Both value are not directly observable thus we have to approximate them by solving the system of equations, one of which is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \sigma_E E_0 = N(d_1) \sigma_V V_0 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found the derivation of this formula but I couldn't find a good economic explanation behind it - or just what it means? &lt;/p&gt;&#xA;" OwnerUserId="2466" LastActivityDate="2017-11-12T11:34:44.803" Title="relation between asset's and equity volatilities - merton model" Tags="&lt;volatility&gt;&lt;modeling&gt;&lt;stochastic-volatility&gt;&lt;econometrics&gt;&lt;credit&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8750" PostTypeId="2" ParentId="7069" CreationDate="2013-08-14T09:50:12.207" Score="3" Body="&lt;p&gt;Do you refer with 'negative tail dependence' to the case that one variable has a extremely low value and the other random variable has an extremely large value, i.e., &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\tau=\lim_{p \rightarrow 0} \frac{Pr[x&amp;gt;Q_x(1-p),y&amp;lt;Q_y(p)]}{p},$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Q_x(1-p)$ and $Q_y(p)$ refer to the $(1-p)$-th quantile of the random variable $x$ and the $p$-th quantile of the random variable $y$, respectively?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, 'negative tail dependence' can easily be estimated non-parametrically by performing an ols regression. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With $n$ observations $x_1,\cdots,x_n$ and $y_1,\cdots,y_n$, the non-parametric estimate of $\tau$ can be obtained as $\hat{\beta}$ after performing an ols regression on the model $$\bf{1}_{y_t&amp;lt;Y_{k+1}}=\beta \bf{1}_{x_t&amp;gt;X_{n-k-1}},$$ where $\bf{1}$ denotes the indicator function for the condition in the subscript, and where $Y_{k+1}$ and $X_{n-k-1}$ denote the respectively the $(k+1)$-th lowest observation of $y_t$ and the $(k+1)$-th highest observation of x, respectively. Make sure not to include a constant in the regression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more information, see the article &quot;The simple econometrics of tail dependence&quot;, Economics Letters 116(3), 371-373, &lt;a href=&quot;http://dx.doi.org/10.1016/j.econlet.2012.04.016&quot; rel=&quot;nofollow&quot;&gt;http://dx.doi.org/10.1016/j.econlet.2012.04.016&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5926" LastActivityDate="2013-08-14T09:50:12.207" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8751" PostTypeId="2" ParentId="8726" CreationDate="2013-08-14T12:19:35.867" Score="1" Body="&lt;p&gt;HMM allows to get transition matrix that provides additional information itself about probabilities of switching.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As HMM looks on complete state path it allows to identify, for example, short periods of low volatility in high volatility regime that were not a result of regime switching. If we apply some simple rule we have a larger number of switches and thus have biased transition matrix. If the results of this analysis are used in some forecasting or simulations, error in transition matrix would be crucial.&lt;/p&gt;&#xA;" OwnerUserId="5409" LastActivityDate="2013-08-14T12:19:35.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8752" PostTypeId="2" ParentId="8730" CreationDate="2013-08-14T12:58:29.193" Score="2" Body="&lt;p&gt;I liked the following introductions to Partial LS Discriminant Analysis:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://enpub.fulton.asu.edu/cseml/06summer/pls_dis.pdf&quot; rel=&quot;nofollow&quot;&gt; Partial Least Squares for Discrimination&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://users.stat.umn.edu/~sandy/courses/8801/articles/pls.pdf&quot; rel=&quot;nofollow&quot;&gt;A Beginner’s Guide to Partial Least Squares Analysis&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here some references to examples: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.xlstat.com/en/learning-center/tutorials/running-a-partial-least-square-pls-discriminant-analysis-with-xlstat-pls.html&quot; rel=&quot;nofollow&quot;&gt;XLStat Spreadsheet (you may need to install the trial to run the full analysis in Excel)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.inside-r.org/packages/cran/DiscriMiner/docs/plsDA&quot; rel=&quot;nofollow&quot;&gt;R Package plsDA {DiscriMiner}&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://cran.r-project.org/web/packages/muma/index.html&quot; rel=&quot;nofollow&quot;&gt;R Package Muma&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-08-14T12:58:29.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8754" PostTypeId="2" ParentId="8749" CreationDate="2013-08-14T13:41:56.407" Score="3" Body="&lt;p&gt;The equation stated in the question is &lt;strong&gt;not&lt;/strong&gt; at the core of Merton's credit model, (Not saying you claimed it is) but is a simple device in helping to solve the system of linear equations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The equation given simply establishes a relationship between the volatility of equity and the volatility of the assets and it follows from the application of Black Scholes that the equity delta equals N(d1). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please see p5-6 here: &lt;a href=&quot;http://www.ec.bgu.ac.il/monaster/admin/papers/1202.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.ec.bgu.ac.il/monaster/admin/papers/1202.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-08-14T14:38:25.213" LastActivityDate="2013-08-14T14:38:25.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8755" PostTypeId="2" ParentId="8749" CreationDate="2013-08-14T13:53:23.273" Score="4" Body="&lt;p&gt;Well, the main intuition of the Merton model is that a company's equity can be treated as a call option on its assets, thus allowing for the application of Black-Scholes option pricing methods. Let's consider a company that has assets $A_{t}$ financed by equity $E_{t}$ and a zero-coupon debt $B_{t}$ with face value &lt;em&gt;K&lt;/em&gt;, and maturity &lt;em&gt;T&lt;/em&gt;. At time of maturity &lt;em&gt;T&lt;/em&gt;, we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA; E_{T} =&#xA;  \begin{cases}&#xA;   A_{T} - K &amp;amp; \text{if } A_{T} &amp;gt; K \\ &#xA;   0       &amp;amp; \text{if } A_{T} \leq K&#xA;  \end{cases}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason being is that, at maturity &lt;em&gt;T&lt;/em&gt;, debtholders would be paid the full face value &lt;em&gt;K&lt;/em&gt; if the company's assets at &lt;em&gt;T&lt;/em&gt; are greater than &lt;em&gt;K&lt;/em&gt;, leaving to shareholders an equity amount of &lt;em&gt;$A_{T} - K$&lt;/em&gt;. However, if &lt;em&gt;$A_{T} \leq K$&lt;/em&gt;, then the company would default on its debt payment. In that case, since the debtholders have the first claim on what's left of the company's assets, the equityholders end up with nothing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then: $$ E_{T} = max(A_{T} - K, 0)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is exactly the payoff of a call option on &lt;em&gt;$A_{T}$&lt;/em&gt; with a strike price &lt;em&gt;K&lt;/em&gt; and maturity &lt;em&gt;T&lt;/em&gt;. Therefore, the Black-Scholes option pricing methods can be applied, (assuming the asset value follows a GBM). By assuming that the equity value $E_{T}$ also follows a GBM, and by applying Ito's lemma, you can show that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \sigma_E E_t = \frac{\partial E_t}{\partial A_t} \sigma_A A_t $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By substituting B-S call option delta, we obtain:&#xA;$$ \sigma_E E_t = N(d_1) \sigma_A A_t $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your own notation, at time &lt;em&gt;t = 0&lt;/em&gt;, you set $A_0 = V_0$, then:&#xA;$$ \sigma_E E_0 = N(d_1) \sigma_V V_0 $$&lt;/p&gt;&#xA;" OwnerUserId="5896" LastEditorUserId="5896" LastEditDate="2013-08-14T20:04:33.067" LastActivityDate="2013-08-14T20:04:33.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8756" PostTypeId="1" AcceptedAnswerId="8759" CreationDate="2013-08-14T14:15:51.240" Score="4" ViewCount="831" Body="&lt;p&gt;What is the industry consensus (if it exists) about implied volatility calculation for options on VSTOXX (OVS)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've experimented with the following approach:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Standard Black-Scholes&lt;/li&gt;&#xA;&lt;li&gt;VSTOXX futures as underlying prices for respective option maturities&lt;/li&gt;&#xA;&lt;li&gt;Assuming $q=r$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;and I wasn't quite happy with the difference between call/put smiles.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I haven't tried Gruenbichler and Longstaff (GL96) yet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPD:&lt;/strong&gt; After implementing GL96 and Whaley, the latter produces much better results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is how the smile looks for 30 and 90 days for VSTOXX with Whaley implementation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/DDbII.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Q1cZQ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPD2:&lt;/strong&gt; These numbers are in line with VIX options, where implied volatility of ATM options can reach levels of 120%-130%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/9qsg6.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2909" LastEditorUserId="19645" LastEditDate="2021-05-05T08:45:10.363" LastActivityDate="2021-05-05T08:45:10.363" Title="VSTOXX Implied Volatility Calculation" Tags="&lt;implied-volatility&gt;&lt;volatility-smile&gt;" AnswerCount="2" CommentCount="9" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8757" PostTypeId="1" CreationDate="2013-08-14T15:04:24.420" Score="17" ViewCount="1478" Body="&lt;p&gt;I am currently testing whether three proprietary factors - &lt;em&gt;Valuation, Size and Momentum&lt;/em&gt; - explain cross-sectional returns. A sample of 3000 securities was tested using  Fama-MacBeth two-pass regressions over the period 1988-2013. In order to mitigate any thorny estimation problems due to time-varying regression slopes, I have used 50 portfolios sorted on size and book/market (25), and size and momentum (25), as test assets (LHS variables).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The unconditional regressions resulted in &lt;strong&gt;insignificant&lt;/strong&gt; premia for the three factors. Since these factors might behave differently in disparate market conditions, I have also performed conditional regressions based on regimes. The hypothesis was that &lt;em&gt;Valuation&lt;/em&gt; should be highly significant in a &lt;em&gt;Bear&lt;/em&gt; market, while &lt;em&gt;Momentum&lt;/em&gt; should have a statistically significant premia in &lt;em&gt;Bull&lt;/em&gt; markets. However, the results showed &lt;strong&gt;insignificant&lt;/strong&gt; premia for all factors across all market regimes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am a bit surprised by the results, and made me question the actual testing methodology.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a sanity check for the methodology, I have decided to test the Fama-French factors HML and SMB using the same sample period used in the Fama-French(1993) paper. The data was downloaded from Kenneth French website.&#xA;However, even in this case, the Fama-MacBeth procedure was &lt;strong&gt;unable to discover&lt;/strong&gt; any significant premia for either HML or SMB factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would anyone have any thoughts on this issue?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the code for the Fama-MacBeth procedure using &lt;strong&gt;50 portfolios as test assets&lt;/strong&gt;. The 50 sorted portfolios, as well as the factor-mimicking portfolios - VAL, SIZE and MOM - are constructed using a sample of 3000 securities. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;In the first pass of Fama-MacBeth (time-series regression), betas are estimated using rolling windows of 60 months each. Betas are updated monthly.&lt;/li&gt;&#xA;&lt;li&gt;Securities are sorted at the end of June each year, and test portfolios' returns are computed from July to June of the next year. &lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The returns on the factor mimicking portfolios (VAL, SIZE and MOM) are computed as the top-bottom spread of 5 book-to-market quantiles, 5 market-cap quantiles, and 5 momentum quantiles respectively. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In the second-pass of Fama-MacBeth, the previously estimated betas of portfolios are used as independent variables in monthly-cross-sectional regressions, on a subsequent sample period. The premiums for VAL, SIZE and MOM are estimated monthly. When all the monthly cross-sectional regressions have been done, the mean of the time-series of premiums is estimated for each factor. This is all performed by the function &lt;strong&gt;pmg()&lt;/strong&gt;. The average premiums are then tested for statistically significant difference from zero using the t-statistic.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The conditional regressions based on market regimes is &lt;strong&gt;not&lt;/strong&gt; included in the code. The reason being is that the &lt;em&gt;regime&lt;/em&gt; definition is also proprietary. All you need to know is that when the cross-sectional regressions are evaluated, the time-series of premiums for each factors are averaged on a &lt;em&gt;per-regime&lt;/em&gt; basis: in other words, you average the premiums for the periods of bull-markets, and periods of bear-markets, ... separately. The &lt;em&gt;bull&lt;/em&gt; and &lt;em&gt;bear&lt;/em&gt;, and ..  premiums for each factor are tested using the t-statistic.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Please be mindful that this is only a representative &lt;strong&gt;(modified) snapshot&lt;/strong&gt; of the code.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    ##########################################################################&#xA;    ###                   Time-Series Regressions                          ###&#xA;    ##########################################################################&#xA;&#xA;    portfolios = 50      ## Test assets&#xA;    num.factors = 3      ## VAL, SIZE and MOM&#xA;    rows = nrow(ret.ff.zoo) - 60 + 1     ### Number of time windows&#xA;    beta.mat &amp;lt;- matrix(nc = num.factors + 1, nr = portfolios*rows)&#xA;    portfolio.id = matrix(nc = 1, nr = portfolios*rows)&#xA;    d = 1&#xA;&#xA;    for(i in seq(1:portfolios)) {              &#xA;         ######### Dataset (merging test assets' returns and returns of factor-mimicking portfolios&#xA;         data = merge(return = ret.zoo[,i], VAL = df$VAL, SIZE = df$SIZE, MOM = df$MOM, all = c(TRUE, rep(&quot;FALSE&quot;, num.factors)))  ## &quot;df&quot; is the dataframe (zoo object) containing the returns of VAL, SIZE and MOM only       &#xA;&#xA;        ############ Coefficients of regression&#xA;        reg = function (z) coef(lm(return ~., data = as.data.frame(z)))&#xA;        beta = rollapply(data, width = 60, FUN = reg, by.column = FALSE, align = &quot;right&quot;)&#xA;        beta.mat[d:(d+rows-1),] = beta&#xA;        portfolio.id[d:(d+rows-1),] = i&#xA;        d = d + rows&#xA;    }&#xA;    beta.df = data.frame(port = portfolio.id, date = index(beta), beta.mat)&#xA;    colnames(beta.df) &amp;lt;- c(&quot;portfolio&quot;, &quot;date&quot;, &quot;intercept&quot;, colnames(beta)[-1])&#xA;&#xA;&#xA;    ##########################################################################&#xA;    ###                  Cross-Sectional Regressions                       ###&#xA;    ##########################################################################&#xA;&#xA;    ## requires library(plm)&#xA;&#xA;    return &amp;lt;- matrix(ret.zoo[which(index(ret.zoo) &amp;gt;= beta.df$date[1]),], ncol = 1)&#xA;    dataset &amp;lt;- cbind(beta.df, return)&#xA;    fpmg &amp;lt;- pmg(return ~ VAL + SIZE + MOM, data = dataset, index = c(&quot;date&quot;, &quot;portfolio&quot;), na.action = na.omit)&#xA;    summary(fpmg)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thank you,&lt;/p&gt;&#xA;" OwnerUserId="5896" LastEditorUserId="5896" LastEditDate="2013-08-19T14:03:41.023" LastActivityDate="2020-06-21T22:56:46.247" Title="Testing Valuation, Size and Momentum (proprietary factors) from 1988-2013: No evidence of driving cross-sectional returns" Tags="&lt;equities&gt;&lt;backtesting&gt;&lt;portfolio-management&gt;&lt;regression&gt;&lt;factor-models&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="8758" PostTypeId="2" ParentId="8700" CreationDate="2013-08-14T15:05:11.683" Score="0" Body="&lt;p&gt;In my opinion the internal rate of return should be used in the discounting factor which enters the NPV calculation, weighted by some credit risk factor, or having added a credit risk spread. Unless you discount by the targeted rate of return, as for the hedge funds.&#xA;But I have the strong feeling that NPV is calculated by discounting with the risk-free interest rate. Hence IRR is not as popular as it should be.&lt;/p&gt;&#xA;" OwnerUserId="2872" LastEditorUserId="2872" LastEditDate="2014-07-31T00:12:53.730" LastActivityDate="2014-07-31T00:12:53.730" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8759" PostTypeId="2" ParentId="8756" CreationDate="2013-08-14T15:59:42.633" Score="5" Body="&lt;p&gt;I think you would find the following paper very useful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It compares different pricing models applied to VIX options. You can use it as starting point to apply to VSTOXX options and see where it gets you. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://msb040.msb.edu/faculty/bodurthj/unrestricted/teaching/articles/Derivatives/options/Wang-Daigler_The%20Performance%20of%20VIX%20Option%20Pricing%20Models-Empirical%20Evidence%20Beyond%20Simulation_2009.pdf&quot; rel=&quot;noreferrer&quot;&gt;The Performance of VIX Option Pricing Models: &#xA;EmpiricalEvidence Beyond Simulation&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following models were tested:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Whaley (1993)&lt;/li&gt;&#xA;&lt;li&gt;Grunbichler and Longstaff (1996)&lt;/li&gt;&#xA;&lt;li&gt;Carr and Lee (2007)&lt;/li&gt;&#xA;&lt;li&gt;Lin and Chang (2009) (test of 4 different stochastic volatility models&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Let me know whether that is what you were after. I myself do not trade vol of vol so not much on that end. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-08-14T15:59:42.633" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="8760" PostTypeId="2" ParentId="8749" CreationDate="2013-08-14T19:29:07.287" Score="5" Body="&lt;p&gt;You could read it like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;The typical change in equity value is equal to the typical change in asset value, adjusted for the probability of the assets surviving.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the formula is not specific to Merton models, it's also true for regular options and their underlyings.  It's just that volatility of option prices isn't typically a concern in &quot;ordinary&quot; cases.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="848" LastEditDate="2013-08-14T19:47:56.707" LastActivityDate="2013-08-14T19:47:56.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8762" PostTypeId="2" ParentId="8744" CreationDate="2013-08-15T01:48:52.193" Score="1" Body="&lt;p&gt;brian covered the main differences in the first post, but one additional difference is that you only get one personal paper trading account that is probably an individual non-FA (financial advisor) account (or perhaps vice-versa, you have a paper FA account but not an individual paper account).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In contrast there is an individual non-FA demo account (login edemo) AND also an FA (financial advisor) demo account (login fdemo). In addition there is also a portfolio margin demo account. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you want to test your IB API application against API behavior with both FA and non-FA accounts (and perhaps even portfolio margin), then the demo accounts can provide testing beyond what just one paper account makes possible.&lt;/p&gt;&#xA;" OwnerUserId="4716" LastActivityDate="2013-08-15T01:48:52.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8765" PostTypeId="2" ParentId="390" CreationDate="2013-08-15T09:15:02.130" Score="0" Body="&lt;p&gt;I think binning is the superior approach in most cases. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am a practitioner in the field and I have used both continuous transforms and binning approaches. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practical terms in a model there would be around 10 factors. If your model development dataset  is large and robust enough, you could easily have binned each of the 10 factors into 10 bins. Roughly speaking, using the binned scorecard you could then assign $10^{10}$ different scores to your customers. This is way larger than any bank's customer base. So don't worry too much about your model not being granular enough. In mostly cases it will be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For datasets with small sample size, you will likely end up with adjacent bins with large point differentials. This is not desirable! You don't want your customer's scores' to change so drastically if he/she is simply moving to the adjacent bin in one of the factors. In practise I have overcome this by simply employing an automated binning algorithm on the data, and bootstrapping it 100 times. If you think of binning as a step function that maps raw values to a WOE then simply taking the average of the 100 bootstrapped binning will naturally smooth out sudden jumps in WOE. This will make the large point differential problem go away. This method is completely data-based and does not need any other subjective input.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other approaches where a continuous function is fitted the analyst building the model often have to look into limiting the range of values where the curve should be fitted. This could be due to the data sample being not robust enough near the ends of the distribution (e.g. for income variables, very few of your customers would be earning \$10 million+, so someone has to subjective choose where to stop fitting the function say at $1 million). This is all manual and does not lend well to automation. The bootstrapped binning approach in the above paragraphs avoids this problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Binning approach is also easier to implement as a series of if statements should suffice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally even though I use continuous transforms sometimes, I prefer binning and use it whenever it is possible. If your sample size is really small and you have less than 30 defaults to even apply binning, then you may want to relax the bad definition and lengthen your observation period. However even if that does not bring your total bad counts up to around 60~70 then continuous transform might be the way to go.&lt;/p&gt;&#xA;" OwnerUserId="5934" LastEditorUserId="5934" LastEditDate="2013-12-17T05:05:11.417" LastActivityDate="2013-12-17T05:05:11.417" CommentCount="1" CommunityOwnedDate="2013-12-17T05:05:11.417" ContentLicense="CC BY-SA 3.0" />
  <row Id="8766" PostTypeId="2" ParentId="8715" CreationDate="2013-08-15T10:03:39.373" Score="1" Body="&lt;p&gt;You should use the volatility of your hedge instrument. If you do hedging with the underlying you use the underlyings vol. If you do hedging with futures then derive the vol form there...&lt;/p&gt;&#xA;" OwnerUserId="3548" LastActivityDate="2013-08-15T10:03:39.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8768" PostTypeId="1" AcceptedAnswerId="8805" CreationDate="2013-08-15T14:14:19.790" Score="1" ViewCount="169" Body="&lt;p&gt;Consider a log-normal model, $dx / x = \mu dt + \sigma dW$, where $W(t)$ is a Wiener process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say $\mu$ and $\sigma$ change with time, slowly, so we note them by $\mu(t)$ and $\sigma(t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider $dx / x$, where the drift rate is $\mu$, and the volatility is $\sigma \sqrt{dt}$.&#xA;Here, $\mu(t)$ and $\sigma(t)$ is not correlated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if in some cases the data shows a strong correlation, such as when $\mu(t)$ goes up, $\sigma(t)$ would also go up -- the 2 are almost in a linear relationship, something like $\sigma(t) = \sigma_0 + k \mu(t)$ -- how could I set a model for that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, I could just put it as &#xA;$$dx/x = \mu(t) dt + (\sigma_0 + k \mu(t)) dW$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I wonder, is there some already established model/methods for such situation? for example for general stochastic model there are HJM, for mean-reverse there are Hull-White, for stock price there is the log-normal. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some model already researched or even better, used in industry, that extend lognormal model $dx / x = \mu dt + \sigma dW$, so that $\mu(t)$ and $\sigma(t)$ would be correlated?&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2014-04-15T08:22:07.293" Title="how to extend lognormal model so that $\sigma$ is correlated to $\mu$?" Tags="&lt;correlation&gt;&lt;modeling&gt;&lt;stochastic-processes&gt;&lt;lognormal&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8769" PostTypeId="5" CreationDate="2013-08-15T14:18:05.673" Score="0" Body="&lt;p&gt;A future is a contract compensating the trader for movements in the price of an asset (physical or financial). Futures may be used by producers or consumers exposed to price risk to lock in prices.&lt;/p&gt;&#xA;&lt;p&gt;Futures contracts generally have seven identifying features:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;they are in &lt;em&gt;zero net supply&lt;/em&gt;: each long exposure has a corresponding short exposure;&lt;/li&gt;&#xA;&lt;li&gt;they are &lt;em&gt;standardized&lt;/em&gt;: the contract is for a pre-specified amount of a specified quality at a predetermined expiry date, and possibly in a specified location;&lt;/li&gt;&#xA;&lt;li&gt;they are &lt;em&gt;exchange-traded&lt;/em&gt; instruments;&lt;/li&gt;&#xA;&lt;li&gt;traders must &lt;em&gt;post margin&lt;/em&gt; in an account;&lt;/li&gt;&#xA;&lt;li&gt;traders' margin accounts are &lt;em&gt;marked-to-market&lt;/em&gt;: P&amp;amp;L is realized regularly (often daily) by crediting or debiting each trader's margin account;&lt;/li&gt;&#xA;&lt;li&gt;positions are &lt;em&gt;netted&lt;/em&gt;: buys and sells of the same contract do not result in positive and negative holdings, they instead cancel each other out; and,&lt;/li&gt;&#xA;&lt;li&gt;a well-capitalized &lt;em&gt;central clearinghouse&lt;/em&gt; handles marking to market and interposes itself between all traders: all traders have the clearinghouse as their counterparty, not whomever they traded with.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2909" LastEditorUserId="48272" LastEditDate="2020-07-31T11:55:40.880" LastActivityDate="2020-07-31T11:55:40.880" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="8770" PostTypeId="4" CreationDate="2013-08-15T14:18:05.673" Score="0" Body="For futures contracts, instruments which compensate the trader for price changes, may be used to hedge price risk (i.e. lock in a price), and are in zero net supply, standardized, exchange-traded, margined, marked-to-market, netted, and centrally-cleared." OwnerUserId="2909" LastEditorUserId="48272" LastEditDate="2020-07-31T11:57:06.487" LastActivityDate="2020-07-31T11:57:06.487" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="8772" PostTypeId="1" CreationDate="2013-08-15T15:43:41.180" Score="0" ViewCount="117" Body="&lt;p&gt;I am having a problem understanding discounted cash flows. I appreciate your patience and help.&#xA;Lets say I have a bond that I want to price.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Par: $1000&#xA;Coupon Rate: %5.0&#xA;YTM: %5.0&#xA;Frequency: Semi-Annual – 2 (Paid on: 6/30/20XX,12/31/20XX)&#xA;Settlement Date: 8/15/2013&#xA;Maturity Date: 12/31/2014&#xA;&#xA;&#xA;12/31/2013  6/30/2014   12/31/2014  6/30/2014   12/31/2014&#xA;      25        25        25          25           1025&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is the formula I know used to discount cash flows. CF/(1+r/n)^a, where, as I understand it, a=n*t. My question is when valuing bonds I have seen people using the typical a=1,2,3,4,…,n*t&#xA;I  have also seen formula’s where a=.5,1,1.5,2,2.5 when discounting semi-annual cash flows.&#xA;I have also seen people using # of days a=280 for example when the cash flow is some arbitrary date. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For such a simple formula, this unbelievably complicated. Can someone please just explain to me how to find “a” . Is there a comprehensive formula I could use that can discount any cash flow no matter what the date is? Eg. Today is 03/14/2009 and the CF is due on 07/2/2010 for the same info above what would a be?&lt;/p&gt;&#xA;" OwnerUserId="4729" LastActivityDate="2013-08-15T15:43:41.180" Title="DCF of Arbitrary Dates Cash Flows" Tags="&lt;fixed-income&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8774" PostTypeId="1" CreationDate="2013-08-15T17:41:21.750" Score="2" ViewCount="954" Body="&lt;p&gt;Does the Black (1976) model require the existence of the relation $F(t,T)=S(t)e^{r(T−t)}$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I studied the derivation of the Black-Scholes formula. However, although I know the Black formula, I've never studied its entire derivation process. And probably the easiest way to justify the formula is using that relationship (something that motivates the previous question).&lt;/p&gt;&#xA;" OwnerUserId="5754" LastEditorUserId="35" LastEditDate="2013-08-16T12:57:35.193" LastActivityDate="2013-08-16T13:59:54.560" Title="Black (1976) model: relationship between spot and forward prices" Tags="&lt;black-scholes&gt;&lt;futures&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8775" PostTypeId="2" ParentId="8744" CreationDate="2013-08-15T17:49:48.267" Score="1" Body="&lt;p&gt;I want to add several points to the statements above.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Demo account does not allow to make transactions for some asset classes. It does not fill even MKT order for options. &lt;/li&gt;&#xA;&lt;li&gt;I haven't checked, but I'm sure they do not simulate expiration procedures of futures and options.&lt;/li&gt;&#xA;&lt;li&gt;As by default TWS restarts once a day, you will lose all transaction history every day, as well as your P&amp;amp;L. Similarly you lose it after each log off.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Using paper trading account allows you to trade as if it is real account.&lt;/p&gt;&#xA;" OwnerUserId="5409" LastActivityDate="2013-08-15T17:49:48.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8776" PostTypeId="1" AcceptedAnswerId="8779" CreationDate="2013-08-16T03:53:24.280" Score="2" ViewCount="4048" Body="&lt;p&gt;Why is that the covariance of a global minimum variance (GMV) portfolio in the efficient frontier with any asset is always the same?&lt;/p&gt;&#xA;" OwnerUserId="5839" LastActivityDate="2013-08-19T13:05:32.163" Title="Covariance of a GMV portfolio with any asset" Tags="&lt;mean-variance&gt;&lt;economics&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8777" PostTypeId="2" ParentId="8774" CreationDate="2013-08-16T05:13:15.190" Score="2" Body="&lt;p&gt;No, the Black model does not require this relationship to hold. For example, futures on currencies exhibit a different relationship between the future and spot price because of the interest debit/credit nature of currency borrowed/lent. However for the Black model on European futures options to hold the following condition has to be met:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The product of the asset price probability distribution and the pricing kernel&#xA;has to be log-normal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can be shown that the asset price probability distribution does not necessarily have to be log-normal but the above has to hold to price, for example specific stock options (such as European spot options), bond options (where bond prices are log-normal), and some of the interest rate options (where such interest rates follow a MSS-BGM process). The Libor Market Model (LMM) is actually just a special case of the Black model.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-08-16T13:59:54.560" LastActivityDate="2013-08-16T13:59:54.560" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8778" PostTypeId="2" ParentId="8743" CreationDate="2013-08-16T06:50:15.770" Score="4" Body="&lt;p&gt;I'm quite sure I heard it in reference to trading sessions.  Gold full (trading session) is CME Globex.  Gold only (open outcry) is just the floor session.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The prices will differ when the floor session is closed.&lt;/p&gt;&#xA;" OwnerUserId="1040" LastActivityDate="2013-08-16T06:50:15.770" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8779" PostTypeId="2" ParentId="8776" CreationDate="2013-08-16T18:56:20.747" Score="2" Body="&lt;p&gt;Here is the full math proof. Let &lt;em&gt;g&lt;/em&gt; be the GMV portfolio and &lt;em&gt;p&lt;/em&gt; be another asset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align*}&#xA;Cov(x_g, x_p) &amp;amp;= E[{w_g}^T (x- \overline{x}) {(x- \overline{x})}^Tw_p]\\&#xA;&amp;amp;= {w_g}^TE[(x- \overline{x}) {(x- \overline{x})}^T]w_p\\&#xA;&amp;amp;= {w_g}^T\Sigma w_p \\&#xA;&amp;amp;=  (\displaystyle\frac{{i}^T {\Sigma}^{-1}}{C})\Sigma w_p\\&#xA;&amp;amp;= \displaystyle\frac{{i}^Tw_p}{C}\\&#xA;&amp;amp;= \displaystyle\frac{1}{C}&#xA;\end{align*}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $C = 1^T {\Sigma}^{-1} 1 $&lt;/p&gt;&#xA;" OwnerUserId="5896" LastEditorUserId="5896" LastEditDate="2013-08-19T13:05:32.163" LastActivityDate="2013-08-19T13:05:32.163" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8781" PostTypeId="2" ParentId="8776" CreationDate="2013-08-16T19:53:21.447" Score="0" Body="&lt;p&gt;Here is a more qualitative proof: Imagine that the global MVP had two distinct covariances with two other portfolios. This means that additional diversification using these 3 assets would result in a portfolio with a variance lower than that of the global MVP. This would be contradictory to the fact that the global MVP has the lowest possible return variance for a given covariance matrix $\Sigma$. Therefore, the covariance of the global MVP with any other asset or portfolio is constant.&lt;/p&gt;&#xA;" OwnerUserId="5896" LastActivityDate="2013-08-16T19:53:21.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8782" PostTypeId="1" AcceptedAnswerId="8784" CreationDate="2013-08-16T23:26:05.583" Score="0" ViewCount="1426" Body="&lt;p&gt;Assume I have a large portfolio of equities spread across three sectors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am attempting to compute the volatility of these sectors within the portfolio considering the cross correlations among the assets in the other sectors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Further, how might I compute the relevant cross correlations for use in the volatility measure?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any resources or papers on the topic? Or perhaps this is an easy problem that I'm just unaware of?&lt;/p&gt;&#xA;" OwnerUserId="1112" LastEditorUserId="467" LastEditDate="2013-08-18T08:25:03.040" LastActivityDate="2013-08-18T09:32:14.100" Title="How to compute a sector's volatility within a portfolio?" Tags="&lt;volatility&gt;&lt;portfolio-management&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8783" PostTypeId="2" ParentId="8697" CreationDate="2013-08-18T05:39:40.420" Score="0" Body="&lt;p&gt;Convert the problem to a matrix format, and if possible use something like MATLAB because R is significantly slower for matrices - such as the MATLAB's index() function is super fast compared to R's match() function, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once in matrix format, use diligent use of the expression written by Jase in the comments. There is also the fastmatch package if you want to stick to R, provided the data is sorted a-priori.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, a separate thought: Fama-McBeth regressions are usually run over time cross-sectional, than over securities in a time-series. &lt;/p&gt;&#xA;" OwnerUserId="5948" LastActivityDate="2013-08-18T05:39:40.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8784" PostTypeId="2" ParentId="8782" CreationDate="2013-08-18T09:32:14.100" Score="1" Body="&lt;p&gt;I perform this kind of analysis using the &lt;em&gt;risk contribution&lt;/em&gt; concept.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand from this &lt;a href=&quot;https://quant.stackexchange.com/questions/8091/risk-budgets-with-target-portfolio-volatility&quot;&gt;post&lt;/a&gt; that your already know about the contributions, but let's just restate the idea here for the sake of completeness.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have a portfolio of $n$ assets with allocation $w \in \mathbb{R}^n$ and volatility $\sigma_P(w)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;em&gt;marginal risk contribution&lt;/em&gt; of asset $i$ is defined as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$MRC_i= \frac{\partial \sigma_P(w)}{\partial w_i}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;em&gt;total risk contribution&lt;/em&gt; of asset $i$ is defined as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma_i(w) = w_i \cdot MRC_i$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, note that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma_P(w) = \sum_{i=1}^n \sigma_i(w) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(See this canonical &lt;a href=&quot;http://basepub.dauphine.fr/bitstream/handle/123456789/4688/CR%202009-05.pdf?sequence=1&quot; rel=&quot;nofollow noreferrer&quot;&gt;paper&lt;/a&gt; for the details).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to compute how much of the volatility is coming from some sector S, you can just sum the total risk contributions of all assets you consider in the sector.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma_S(w)=\sum_{i \in S} \sigma_i(w)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This would give you an absolute value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An interesting way of looking at this is also to compute its relative version by dividing the total risk contribution of the sector by the total volatility of the portfolio which enables you to discuss the percentage of the risk to be attributed to this given sector.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2013-08-18T09:32:14.100" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8785" PostTypeId="1" AcceptedAnswerId="8787" CreationDate="2013-08-18T10:22:39.800" Score="1" ViewCount="1257" Body="&lt;p&gt;This is a basic question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have three assets, equally weighted, and all the mutual covariances are -1. Then, the covariance matrix looks like - &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; 1  -1  -1&#xA;-1   1  -1&#xA;-1  -1   1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, to calculate the VaR, I need to calculate the portfolio variance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I correct in concluding that I can't calculate the portfolio variance because this matrix is not positive semidefinite? Here is some R code - &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;v = matrix(c(1, -1, -1, -1, 1, -1, -1, -1, 1), ncol=3)&#xA;eigen(v)&#xA;  &amp;gt; $eigenvalues&#xA;  &amp;gt; 2  2 -1&#xA;&#xA;library(micEcon)&#xA;semidefiniteness(v)&#xA;  &amp;gt; FALSE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My next question is: Given ANY symmetric matrix by a user, how do I figure out if I can use it to calculate portfolio variance (or the covariance matrix)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, given the three assets, I can use them to create a weighted time series for the portfolio and calculate the mean and variance of that, and use that to calculate the VaR. How is that different from calculating VaR using teh covariance method?&lt;/p&gt;&#xA;" OwnerUserId="5949" LastEditorUserId="5949" LastEditDate="2013-08-18T12:07:00.817" LastActivityDate="2013-08-18T14:23:55.087" Title="VaR Calculation - Covariance matrix is not positive semidefinite" Tags="&lt;modern-portfolio-theory&gt;&lt;var&gt;&lt;covariance&gt;&lt;variance&gt;&lt;covariance-matrix&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8786" PostTypeId="1" CreationDate="2013-08-18T13:40:34.433" Score="2" ViewCount="1171" Body="&lt;p&gt;To price the convertible bond, one of the models is the bond plus equity option method. That is, the value of convertible bonds is evaluated by finding the value of the straight bond and the value of call option on the underlying asset by option pricing model, i.e. Black Scholes Model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another model is the binomial model which takes account of equity and debt component, as advocated by K. Tsiveriotis and C. Fernandes (1998). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, what is the difference between two methods? Thanks...&lt;/p&gt;&#xA;" OwnerUserId="6119" LastActivityDate="2013-11-04T01:51:43.010" Title="What is the difference between the methods (listed in content) in pricing convertible bond?" Tags="&lt;black-scholes&gt;&lt;binomial-tree&gt;&lt;convertible-bond&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8787" PostTypeId="2" ParentId="8785" CreationDate="2013-08-18T14:23:55.087" Score="5" Body="&lt;p&gt;The given matrix can not represent a covariance matrix since it would imply that asset 1 is negatively correlated to asset 2 and asset 3. But asset 2 is negatively correlated to asset 3 which contradicts the first statement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general a covariance matrix has to be positive semi-definite and symmetric, and conversely every positive semi-definite symmetric matrix is a covariance matrix.&lt;/p&gt;&#xA;" OwnerUserId="5107" LastActivityDate="2013-08-18T14:23:55.087" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8788" PostTypeId="2" ParentId="2770" CreationDate="2013-08-18T16:12:10.757" Score="2" Body="&lt;p&gt;There's also the Intel math libraries.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See: &lt;a href=&quot;https://software.intel.com/en-us/mkl&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://software.intel.com/en-us/mkl&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5954" LastEditorUserId="33410" LastEditDate="2018-10-10T03:33:59.387" LastActivityDate="2018-10-10T03:33:59.387" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="8789" PostTypeId="2" ParentId="959" CreationDate="2013-08-18T16:27:04.647" Score="2" Body="&lt;p&gt;Another reason for C++ is control, or at least the illusion of it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you really care about what exactly is going to happen and when it is going to happen then C++ is the best option. If you are prepared to put in the effort you can know and control everything all the way down to the metal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course the price for more control in C++ is that you often have to control things like clearing up memory that managed code environments do not require.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A big thing in algorithmic trading these days is instrumentation and predictability, not just raw speed. Often it is not good enough to be fastest &lt;em&gt;on average&lt;/em&gt; if the variance is too high, or if critical events are handled too slowly when the market is doing something interesting.&lt;/p&gt;&#xA;" OwnerUserId="5954" LastActivityDate="2013-08-18T16:27:04.647" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8790" PostTypeId="2" ParentId="4322" CreationDate="2013-08-18T16:32:20.090" Score="3" Body="&lt;p&gt;How about an O(N log(n)) solution ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be a viable trading strategy, you often expect them variances to be similar, so just calculate ordinary volatility and put it in an ordered array.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course that's going to be period dependent, so pick a few arbitrary periods and see which instruments end up being together.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you get clusters of vastly smaller size or even simple pairs if you want.&lt;/p&gt;&#xA;" OwnerUserId="5954" LastActivityDate="2013-08-18T16:32:20.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8792" PostTypeId="1" CreationDate="2013-08-19T07:33:10.233" Score="1" ViewCount="128" Body="&lt;p&gt;Is there any good research on the price elasticity of trading in financial markets? Things like optimal fee structures and the like?&lt;/p&gt;&#xA;" OwnerUserId="2768" LastActivityDate="2013-08-20T23:28:19.743" Title="Trading Elasticity Research" Tags="&lt;trading&gt;&lt;fees&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8793" PostTypeId="1" AcceptedAnswerId="8824" CreationDate="2013-08-19T12:38:58.177" Score="1" ViewCount="759" Body="&lt;p&gt;I am looking on literature and models on pricing a bond futures' calendar spread.&#xA;assuming the basket of deliverable bonds is the same and the ctd is the same, what are the factores determining the price of the spread?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="5726" LastActivityDate="2013-08-24T09:15:40.830" Title="Bond futures - calendar spread pricing" Tags="&lt;fixed-income&gt;&lt;futures&gt;&lt;pricing&gt;&lt;spread&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8794" PostTypeId="1" AcceptedAnswerId="8795" CreationDate="2013-08-19T13:58:20.807" Score="3" ViewCount="11614" Body="&lt;p&gt;It looks like the subject of seagull option strategy is not as clearly explained as for other strategies (butterly, bull,bear spread). Thus, can someone provide a clear example of what you buy and sell in this strategy? Also, could you please indicate the ralationship between the strikes of each option that is involved in it? &lt;/p&gt;&#xA;" OwnerUserId="2466" LastActivityDate="2013-08-19T15:25:31.340" Title="Seagull option strategy - clear example" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;quant-trading-strategies&gt;&lt;option-strategies&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8795" PostTypeId="2" ParentId="8794" CreationDate="2013-08-19T15:25:31.340" Score="4" Body="&lt;p&gt;The first Google &lt;a href=&quot;http://www.investopedia.com/terms/s/seagull-option.asp&quot; rel=&quot;nofollow&quot;&gt;result&lt;/a&gt; seems clear enough:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A seagull option is structured through the purchase of a call spread and the sale of a put option (or vice versa)....This structure is appropriate when volatility is high but expected to fall, and the price is expected to trade with a lack of certainty on direction.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So, for example, you might buy the 105% call, sell the 110% call, and sell the 95% put, nudging the strikes as necessary if initially you want to pay zero premium.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If implied volatility is already high, the premium from a short put should finance a more bullish call spread than if IV is low; that, plus the short call make this suitable only when future volatility is expected to decline. It seems like you would also want to have the view that volatility skew is high to justify selling the upside call. More in this note from RBC: &lt;a href=&quot;https://www.rbccm.com/global/file-410676.pdf&quot; rel=&quot;nofollow&quot;&gt;https://www.rbccm.com/global/file-410676.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2378" LastActivityDate="2013-08-19T15:25:31.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8797" PostTypeId="1" CreationDate="2013-08-20T04:30:47.400" Score="0" ViewCount="141" Body="&lt;p&gt;Let's suppose we have a futures contract F in a market where the relation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$F(t,T)=S(t)e^{r(T−t)}$$&#xA;doesn't hold. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the the boundary conditions for the derivation of the Black (1976) formula??&lt;/p&gt;&#xA;" OwnerUserId="5754" LastEditorUserId="467" LastEditDate="2013-08-20T15:48:16.253" LastActivityDate="2013-08-20T15:48:16.253" Title="Black (1976) model: boundary conditions with non-convergence of spot and forward prices" Tags="&lt;black-scholes&gt;&lt;futures&gt;" AnswerCount="0" CommentCount="7" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8800" PostTypeId="2" ParentId="1017" CreationDate="2013-08-20T17:01:41.647" Score="4" Body="&lt;p&gt;Trade matching is the process of 2 investment banks electronically inputting their respective trade details into an electronic trade matching platform; it is called trade matching because both parties are equal in this relationship.  Conversely, where an investment bank has executed a trade with a buy-side firm (e.g. pension fund, insurance company), part of the service provided by the investment bank to its clients is the speedy and accurate communication of a trade confirmation; where this is achievable electronically, it is called trade 'affirmation' because the investment bank is required to be proactive and input the trade details for the buy-side firm to 1) check and 2) respond to via the affirmation platform - by so doing the buy-side firm is reactive....hence the term 'affirmation', meaning to affirm (agree with) the information presented to you.  I hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="5962" LastEditorUserId="35" LastEditDate="2013-08-20T17:34:46.503" LastActivityDate="2013-08-20T17:34:46.503" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8801" PostTypeId="1" CreationDate="2013-08-20T17:02:41.033" Score="1" ViewCount="118" Body="&lt;p&gt;I am looking to take a cross sector subset of a larger stock index universe.&#xA;What steps to I take to assure that sector representation is as equal as possible to help smooth out my variance(while admittedly giving away some return). Thanks.&lt;/p&gt;&#xA;" OwnerUserId="5558" LastActivityDate="2013-08-21T02:07:37.147" Title="How do I take an unbiased, sector neutral sample from a stock index?" Tags="&lt;backtesting&gt;&lt;index&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8804" PostTypeId="2" ParentId="8786" CreationDate="2013-08-20T19:12:55.097" Score="1" Body="&lt;p&gt;If there is no chance of default, and you have an extremely simple set of terms and conditions (T&amp;amp;C) on the bond, then the two are equivalent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the real world T&amp;amp;C are complex for all bonds currently traded, and default is important.  Therefore something closer to the binomial model, which allows the embedded option to disappear in the event of default, is called for.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, professionals use more sophisticated models like the offerings from &lt;a href=&quot;https://monis.sungard.com/Monis/&quot; rel=&quot;nofollow&quot;&gt;Monis&lt;/a&gt; or &lt;a href=&quot;https://www.kynex.com/aboutframe.asp&quot; rel=&quot;nofollow&quot;&gt;Kynex&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2013-08-20T19:12:55.097" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8805" PostTypeId="2" ParentId="8768" CreationDate="2013-08-20T20:32:01.440" Score="3" Body="&lt;p&gt;As @Rustam notes, &quot;correlation&quot; of deterministic functions in the sense you describe is a special case of allowing $\mu$ and $\sigma$ to have a term structure of arbitrary shape.  Since the latter is easy to treat, no one bothers with restricted forms of it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, there quite a few people who deal with models that let $\sigma$ change with $S$.  I am thinking in particular of local volatility models, which have an explicit surface $\sigma(S,t)$ to match vanilla option markets.  These are used on exotics desks (and the models sometimes have jump terms also).&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2013-08-20T20:32:01.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8806" PostTypeId="2" ParentId="8792" CreationDate="2013-08-20T23:28:19.743" Score="2" Body="&lt;p&gt;You can take a look at this paper (December 2011):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.peri.umass.edu/fileadmin/pdf/research_brief/PERI_FTT_Research_Brief.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.peri.umass.edu/fileadmin/pdf/research_brief/PERI_FTT_Research_Brief.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the end of the paper you can also find an interesting reference list.&lt;/p&gt;&#xA;" OwnerUserId="5964" LastActivityDate="2013-08-20T23:28:19.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8807" PostTypeId="2" ParentId="8801" CreationDate="2013-08-21T02:07:37.147" Score="2" Body="&lt;p&gt;You first need to understand how the index values are computed. Is the index market cap weighted, equally weighted,...depending on that you pick a sub set that replicates the properties of the index by weighting the following properties (not an exhaustive list but I hope a starting point):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;large vs small market cap names&lt;/li&gt;&#xA;&lt;li&gt;high vs low beta names&lt;/li&gt;&#xA;&lt;li&gt;high vs low return volatility names&lt;/li&gt;&#xA;&lt;li&gt;sector/group subset representation&lt;/li&gt;&#xA;&lt;li&gt;market/country subset representation (in case you are dealing with global indexes)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-08-21T02:07:37.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8809" PostTypeId="2" ParentId="1597" CreationDate="2013-08-21T15:25:06.770" Score="5" Body="&lt;p&gt;You will find elaborate answers to your question in this excellent new book:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://books.google.de/books?id=fRWM4cNvVnMC&amp;amp;lpg=PP1&amp;amp;dq=Quantitative%20Value&amp;amp;pg=PP1#v=onepage&amp;amp;q&amp;amp;f=false&quot; rel=&quot;noreferrer&quot;&gt;Quantitative Value: A Practitioner’s Guide to Automating Intelligent Investment and Eliminating Behavioral Errors by Gray &amp;amp; Carlisle&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find a good summary over at CXO Advisory Group:&lt;br&gt;&#xA;&lt;a href=&quot;http://www.cxoadvisory.com/22933/fundamental-valuation/a-few-notes-on-quantitative-value/&quot; rel=&quot;noreferrer&quot;&gt;A Few Notes on Quantitative Value&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2013-08-21T15:25:06.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8810" PostTypeId="2" ParentId="8756" CreationDate="2013-08-21T15:47:56.363" Score="1" Body="&lt;p&gt;There is another approach to compute Implied Volatility, namely the Model Free Implied Volatility (MFIV). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to &lt;a href=&quot;http://www.risklatte.com/Articles/QuantitativeFinance/QF169.php&quot; rel=&quot;nofollow&quot;&gt;this link&lt;/a&gt;: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;Unlike the traditional concept of implied volatility, where the implied volatility is estimated numerically from an option pricing model, the model free implied volatility (MFIV) is not dependent on any option pricing model.&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can find several papers about MFIV. I suggest you to take a look at &lt;a href=&quot;http://www.ssrn.com&quot; rel=&quot;nofollow&quot;&gt;SSRN&lt;/a&gt; and &lt;a href=&quot;http://ideas.repec.org/cgi-bin/htsearch?q=model+free+implied+volatility&quot; rel=&quot;nofollow&quot;&gt;REPEC&lt;/a&gt;, as the MFIV methodology is kind of gaining importance for the computation of volatility indices.&lt;/p&gt;&#xA;" OwnerUserId="5964" LastActivityDate="2013-08-21T15:47:56.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8812" PostTypeId="1" AcceptedAnswerId="8822" CreationDate="2013-08-23T00:29:14.100" Score="5" ViewCount="434" Body="&lt;p&gt;I am calculating implied interest rates using covered interest rate parity theorem.&#xA;I am looking at the Australian US currency pair. When evaluating day counts, should I be using Actual/365 for Australia and Actual/360 for US?&lt;/p&gt;&#xA;" OwnerUserId="5976" LastEditorUserId="21023" LastEditDate="2018-05-25T09:50:34.953" LastActivityDate="2020-05-19T10:02:25.840" Title="Day count conventions for covered parity theory" Tags="&lt;currency&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="8813" PostTypeId="1" AcceptedAnswerId="8814" CreationDate="2013-08-23T02:34:16.947" Score="0" ViewCount="2501" Body="&lt;p&gt;I am after a good comprehensive resource on Japanese day count conventions. By that I mean, is actual/360 or actual/365 used for pricing various options, forwards, futures, etc.&lt;/p&gt;&#xA;" OwnerUserId="5976" LastActivityDate="2013-08-23T06:29:56.273" Title="Japan day count conventions" Tags="&lt;options&gt;&lt;futures&gt;&lt;currency&gt;&lt;forward&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8814" PostTypeId="2" ParentId="8813" CreationDate="2013-08-23T06:22:04.603" Score="3" Body="&lt;p&gt;for Japan, act/365 for the domestic market, and act/360 for the euroyen market. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For swaps, fixed leg convention is 6m libor act/365, floating leg, if based on libor, is the 6m rate act/360, if tibor, then the 3m rate act/365.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-08-23T06:29:56.273" LastActivityDate="2013-08-23T06:29:56.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8815" PostTypeId="2" ParentId="8812" CreationDate="2013-08-23T06:26:59.777" Score="2" Body="&lt;p&gt;Correct, USD libor is based on act/360, AUD on act/365 for currencies.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-08-23T06:26:59.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8816" PostTypeId="1" AcceptedAnswerId="18291" CreationDate="2013-08-23T07:12:47.813" Score="4" ViewCount="513" Body="&lt;p&gt;When using Reuters, for each listed company there is credit tab that shows relevant information in terms of credit default. There is also rating class as well as one year default probability. It is said they use a structural model - does anyone knows what structural model do they use? &lt;/p&gt;&#xA;" OwnerUserId="2466" LastActivityDate="2015-06-11T10:10:28.130" Title="What structural model does Reuters use for default probability?" Tags="&lt;risk-models&gt;&lt;credit-ratings&gt;&lt;credit-risk&gt;&lt;reuters&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8817" PostTypeId="1" AcceptedAnswerId="8818" CreationDate="2013-08-23T11:10:48.473" Score="7" ViewCount="803" Body="&lt;p&gt;Consider the &lt;code&gt;RQuantLib&lt;/code&gt; package function &lt;code&gt;FloatingRateBond()&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This takes as inputs &lt;code&gt;gearings&lt;/code&gt; and &lt;code&gt;spreads&lt;/code&gt;, whose correct definition is unknown to me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let I have a floating rate bond, e.g. the BACRED Float 06/18/20 (whose ISIN code is IT0004921646): this bond pays annually EURIBOR 3M + $140$ bps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What &lt;code&gt;gearings&lt;/code&gt; and &lt;code&gt;spreads&lt;/code&gt; of this bond are supposed to be?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since this issuer has a 7Yr credit spread of about 230 bps (and I can interpolate its CDS curve to have every tenor), I would like to know if the &lt;code&gt;curve&lt;/code&gt; argument should be replaced with the yield curve made up by EUR deposit/IRS curve + credit spread curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess the &lt;code&gt;index&lt;/code&gt; argument, conversely, is the spot swap curve and the forward rates are computed from it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S.: yes, I admit it, I'm reading the &lt;code&gt;QuantLib&lt;/code&gt; documentation but I'm not understanding anything about this class.&lt;/p&gt;&#xA;" OwnerUserId="3058" LastEditorUserId="3058" LastEditDate="2013-08-23T11:33:01.147" LastActivityDate="2013-08-23T14:20:33.090" Title="Definition of gearings, spreads and curve in RQuantLib's Floating Rate Bond function" Tags="&lt;fixed-income&gt;&lt;r&gt;&lt;bond&gt;&lt;quantlib&gt;&lt;floating-rate&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8818" PostTypeId="2" ParentId="8817" CreationDate="2013-08-23T14:20:33.090" Score="9" Body="&lt;p&gt;I'm familiar with the library, but not with the way it is exported to R.  Anyway: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;gearings&lt;/code&gt; are optional multipliers of the LIBOR fixing (some bonds might pay, for instance, 0.8 times the LIBOR) and &lt;code&gt;spreads&lt;/code&gt; are the added spreads. In your case, the gearing is 1 and the spread is 0.0140 (that is, 140 bps; rates and spread must be expressed in decimal form).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;curve&lt;/code&gt; is the curve you want to use for discounting. Using the swap curve plus a spread is a possibility. However, note that the CDS spread might not be an exact proxy for the spread to be applied. At the very least, the CDS spread is a quarterly rate simply compounded, whereas (depending on what classes are exported) you might need a continuously compounded rate in order to spread the swap curve. You'll have to perform the conversion first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the library, the &lt;code&gt;index&lt;/code&gt; argument would be an instance of an index class such as Euribor3M, whose constructor in turn would take the swap curve. I don't know how that's managed in RQuantLib.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2013-08-23T14:20:33.090" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8819" PostTypeId="1" CreationDate="2013-08-23T15:35:34.977" Score="2" ViewCount="300" Body="&lt;p&gt;I'm looking to optimize a portfolio maximizing expected return for a particular risk budget, but with absolute constraints on the individual instrument positions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been experimenting with QP, but I was wondering if anyone could guide me to a suitable solution?&lt;/p&gt;&#xA;" OwnerUserId="5980" LastActivityDate="2013-08-23T15:35:34.977" Title="Portfolio optimization with absolute position constraints" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;numerical-methods&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8820" PostTypeId="1" AcceptedAnswerId="8832" CreationDate="2013-08-23T17:03:02.863" Score="3" ViewCount="644" Body="&lt;p&gt;More specifically, I am looking for recent research papers that have harnessed Mandelbrot's ideas too successfully predict asset prices. I have read many papers about wavelets, and I would like to read what other people (you) consider to be the best work in this field. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are wavelets the only analyses currently in development that use Mandelbrot's ideas?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="5981" LastActivityDate="2013-08-26T10:35:54.843" Title="Has there been success in applying Mandelbrot's ideas to financial markets?" Tags="&lt;fractals&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8821" PostTypeId="1" AcceptedAnswerId="8845" CreationDate="2013-08-23T19:37:11.337" Score="1" ViewCount="311" Body="&lt;p&gt;Is it true that pricing a reinsurance contact is equivalent to pricing an option. Basically a reinsurance just cuts off the risk exposure of the insured institution to a threshold say $K$. So if we assume that the prospective losses of the risky portfolio of the institution can be modelled by a random variable X, then the price of the insurance should just be the expected value of $(X-K)^+$, right? This however can be viewed as a call option so we can apply the same pricing methods. Is there any literature on that with further examples of this kind? &lt;/p&gt;&#xA;" OwnerUserId="5983" LastActivityDate="2013-08-28T12:04:25.850" Title="reinsurance pricing equivalent to option pricing" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;risk&gt;&lt;research&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8822" PostTypeId="2" ParentId="8812" CreationDate="2013-08-23T23:05:58.947" Score="8" Body="&lt;p&gt;OpenGamma has a good resource for &lt;a href=&quot;https://quant.opengamma.io/Interest-Rate-Instruments-and-Market-Conventions.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;market conventions&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="993" LastEditorUserId="18748" LastEditDate="2020-05-19T10:02:25.840" LastActivityDate="2020-05-19T10:02:25.840" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="8823" PostTypeId="2" ParentId="7465" CreationDate="2013-08-24T06:48:33.083" Score="1" Body="&lt;p&gt;I'll try to solve your query by way of an example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X= 2*Y + a + e$, here you go Short on $X$ and Long on $Y$, and the coefficient of $Y$ is $2$. Let's say $X=100$ and $Y=49$ (i.e. $X$'s and $Y$'s current price) and $a=1$ and also $e=1$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you need to execute a trade to make money when $e$ becomes $0$. So in order to make money from the trade, you will sell 1 share of $X$ and buy 2 shares of $Y$. Now where ever the price will move if your coefficients are same i.e 2 and $a=1$, the moment $e$ becomes 0 you'll make money.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this pair trade you don't need to put equal money in both $X$ and $Y$, but whatever quantity of $X$ you sell you have to buy twice quantity of $Y$.&lt;/p&gt;&#xA;" OwnerUserId="5986" LastEditorUserId="467" LastEditDate="2013-08-25T09:07:05.367" LastActivityDate="2013-08-25T09:07:05.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8824" PostTypeId="2" ParentId="8793" CreationDate="2013-08-24T09:15:40.830" Score="2" Body="&lt;p&gt;In your scenario, the main factor behind the spread would be the forward repo rate implied by the term repo rates on the ctd, one termed to the delivery date of the front contract, the other termed to the back contract. In the current rate environment this will have little to do with the term structure of mm rates. Instead, any difference between the repos will reflect specialness in the ctd. For example, the ctd might be the on-the-run bond (ie, the most recently auctioned bond) now, but it won't be when the back contract becomes the front contract; this will be anticipated in the repo differential.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there is meaningful probability of switch risk, then the switch optionality will also effect the spread, with the back contract being more sensitive to changes in implied volatility than the front contract. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In summary, you can analyse that spread into forward repo and switch optionality factors. &lt;/p&gt;&#xA;" OwnerUserId="3088" LastActivityDate="2013-08-24T09:15:40.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8827" PostTypeId="1" CreationDate="2013-08-25T21:21:42.223" Score="1" ViewCount="196" Body="&lt;p&gt;This &lt;a href=&quot;http://arxiv.org/abs/0908.3043&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; describes an algorithm for computing arbitrage opportunites using a gauge connetion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone written a python program or C++ or C# program that shows how to follow the steps outlines in the paper, and if so, could you point me to it?&lt;/p&gt;&#xA;" OwnerUserId="5994" LastEditorUserId="467" LastEditDate="2013-08-26T17:34:53.533" LastActivityDate="2013-08-26T17:34:53.533" Title="Example code for &quot;Gauge Invariance, Geometry and Arbitrage&quot; paper" Tags="&lt;programming&gt;&lt;arbitrage&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8828" PostTypeId="2" ParentId="3918" CreationDate="2013-08-25T21:30:26.687" Score="5" Body="&lt;p&gt;A bit belated, but nevertheless:&#xA;It's worth noting that at least &lt;em&gt;some&lt;/em&gt; of the various visible shapes of &quot;quote spam&quot; shown on e.g. Nanex analyses, such as sawtooth patterns, can be explained without assuming malice on the part of the order originators. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By way of example, two poorly designed agency execution algos trading buy child orders may each have a hidden reserve price above the initial market best bid and both be reasonably aggressive and be prepared to penny-jump the best bid all the way up until their reserve price, but if they are unable to beat the best bid, instead then bid at 1 tick (==1 cent in the rest of this example) above the next best bid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically these two algos can interact, each attempting to outbid the other, until say algo #1's reserve price is exceeded, whereupon it will instead bid at the next best bid +1c. Algo #2 will as a result see in the order book that it no longer needs to bid as high as Algo #1's reserve price +1c and will drop back to Algo #1's recently updated price +1c. Algo #1 will then bid at Algo #2's bid +1c, restarting the process and running through the same pattern over and over, in the process generating vast amounts of quote traffic that is superfluous to any genuine price formation process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above pattern I would expect to see recur from time to time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another related possible source that I've seen at least once (and wouldn't expect to see recur too often) is an erroneously coded algo that's tried to outbid itself!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An additional source of quote spam could be as a result of liquidity providers chasing NBBO moves (US markets), where those providers are only prepared to quote if they can be top of book (or near enough to it), but will only know if they are top of book (or thereabouts) &lt;em&gt;after&lt;/em&gt; submitting the order, since competitors would also have been trying to submit at more or less the same time. (In fact, one of the reasons for exchanges introducing new order types was that the exchanges would get hammered with new order submissions in &lt;em&gt;anticipation&lt;/em&gt; of NBBO changes in 1 tick wide markets.)&lt;/p&gt;&#xA;" OwnerUserId="787" LastEditorUserId="787" LastEditDate="2015-12-30T06:25:41.217" LastActivityDate="2015-12-30T06:25:41.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8829" PostTypeId="2" ParentId="7822" CreationDate="2013-08-25T22:27:17.940" Score="4" Body="&lt;p&gt;Both statements are correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A &lt;strong&gt;warrant&lt;/strong&gt; allows a holder to &lt;em&gt;BUY&lt;/em&gt; a stock at a set price.  Because there is a specific price, all that is needed is &lt;em&gt;CASH&lt;/em&gt; to get the stock. As such, the warrant can be separated from the bond, and someone else could use it. As a result, it is valued separately from an accounting perspective.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A &lt;strong&gt;convertible&lt;/strong&gt; bond, on the other hand, simply allows the holder to &lt;em&gt;TRADE&lt;/em&gt; the bond for some stock.  Since the holder needs the &lt;em&gt;BOND&lt;/em&gt; to get the stock (vs. cash), the value of the trade cannot be separated from the stock.&lt;/p&gt;&#xA;" OwnerUserId="5996" LastEditorUserId="467" LastEditDate="2013-08-26T17:42:13.497" LastActivityDate="2013-08-26T17:42:13.497" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8830" PostTypeId="1" CreationDate="2013-08-26T02:37:47.837" Score="0" ViewCount="154" Body="&lt;p&gt;Are there any sure-fire ways to increase market-depth that people have experience with?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has much research been done/published on this subject?&lt;/p&gt;&#xA;" OwnerUserId="2768" LastActivityDate="2013-08-26T23:19:43.083" Title="Increasing Market Depth" Tags="&lt;market-design&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8831" PostTypeId="1" CreationDate="2013-08-26T09:03:04.857" Score="10" ViewCount="170" Body="&lt;p&gt;I observe a sample from a distribution that I expect to be the hitting time &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\tau = \inf\{t&amp;gt;0| X(t)&amp;gt;a\}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $X(t)$ is a Lévy process with $X(0)=0$ and $a$ is some constant. $X$ is not a Brownian motion and the experimental fit to the &lt;a href=&quot;http://en.wikipedia.org/wiki/L%C3%A9vy_distribution&quot;&gt;Lévy distribution&lt;/a&gt; is poor. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I do not need to know the exact formula for the law of $\tau$. For my needs I only need to know that the expectation of $\tau$ is infinite (as in the case of $\tau$ for a Brownian motion). Is it possible to formulate and test this as a statistical hypothesis?&lt;/p&gt;&#xA;" OwnerUserId="5652" LastActivityDate="2014-10-31T14:37:06.177" Title="How to test that a distribution has infinite mean?" Tags="&lt;stochastic-processes&gt;&lt;stopping&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8832" PostTypeId="2" ParentId="8820" CreationDate="2013-08-26T10:35:54.843" Score="6" Body="&lt;p&gt;The best known multifractal process is &lt;a href=&quot;https://en.wikipedia.org/wiki/Fractional_Brownian_motion&quot; rel=&quot;noreferrer&quot;&gt;Fractional Brownian Motion&lt;/a&gt;. One needs to estimate the Hurst exponent, which can be more tricky than it seems. However the fBM distributional characteristics do not match the main stylised facts, e.g. the thinning of tails for longer horizons, so they are not so much used in practice. There are also extensions accounting for stochastic volatility, leading to a curious hybrid. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mandelbrot's work has opened an interesting line of research, but its fruits are not so tasty as hoped at first: markets display &lt;em&gt;some&lt;/em&gt; self-similarity, but not a full one. After many decades it's still mostly an academic topic. Iirc the only market where multifractals seem to bring something is FX.&lt;/p&gt;&#xA;" OwnerUserId="3015" LastActivityDate="2013-08-26T10:35:54.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8833" PostTypeId="1" AcceptedAnswerId="8855" CreationDate="2013-08-26T12:04:52.417" Score="4" ViewCount="1156" Body="&lt;p&gt;I'm trying to understand how to compute the daily volumes of the Dow Jones Industrial Average but I haven't found the proper formula yet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought it was the sum of the price*volume of each constituent but the result doesn't match.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, on 2012-08-23 the last prices and volumes were:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Company             |    Volume   | Price  | Volume x Price&#xA;------------------- | ----------- | ------ | --------------&#xA;3M Co               |   1 953 688 | 114,40 |    223 501 907&#xA;Alcoa               |  11 141 890 |   8,05 |     89 692 215&#xA;American Express    |   2 521 379 |  73,65 |    185 699 563&#xA;AT&amp;amp;T                |  29 728 622 |  34,29 |  1 019 394 448&#xA;Bank of America     |  67 699 182 |  14,57 |    986 377 082&#xA;Boeing              |   3 017 610 | 105,48 |    318 297 503&#xA;Caterpillar         |   4 487 260 |  83,89 |    376 436 241&#xA;Chevron             |   4 682 301 | 119,53 |    559 675 439&#xA;Cisco Systems       |  41 268 535 |  23,86 |    984 667 245&#xA;Du Pont de Nemours  |   2 674 462 |  57,90 |    154 851 350&#xA;Exxon Mobil         |   9 206 422 |  87,52 |    805 746 053&#xA;General Electric    |  20 691 132 |  23,78 |    492 035 119&#xA;Hewlett-Packard     |  22 069 135 |  22,40 |    494 348 624&#xA;Home Depot          |   7 743 049 |  73,89 |    572 133 891&#xA;Intel               |  23 088 692 |  22,44 |    518 110 248&#xA;IBM                 |   2 295 092 | 185,42 |    425 555 959&#xA;Johnson &amp;amp; Johnson   |   7 714 990 |  88,41 |    682 082 266&#xA;JPMorgan Chase      |  11 126 713 |  52,32 |    582 149 624&#xA;McDonald's          |  12 274 162 |  95,13 |  1 167 641 031&#xA;Merck               |   9 181 807 |  47,73 |    438 247 648&#xA;Microsoft           | 225 493 737 |  34,75 |  7 835 907 361&#xA;Pfizer              |  18 507 496 |  28,34 |    524 502 437&#xA;Procter &amp;amp; Gamble    |   5 228 946 |  80,01 |    418 367 969&#xA;Coca-Cola           |  11 303 083 |  38,52 |    435 394 757&#xA;Travelers Companies |   1 336 935 |  80,19 |    107 208 818&#xA;United Technologies |   2 608 836 | 102,80 |    268 188 341&#xA;UnitedHealth Group  |   3 218 469 |  72,54 |    233 467 741&#xA;Verizon             |   6 779 268 |  47,61 |    322 760 949&#xA;Wal-Mart            |   5 475 169 |  73,44 |    402 096 411&#xA;Walt Disney         |   5 510 670 |  61,73 |    340 173 659&#xA;                    |             |        | &#xA;Total               |             |        | 21 964 711 900&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But the DJIA volume for this day was actually 131 855 227:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.google.com/finance/historical?cid=983582&amp;amp;startdate=Aug+19%2C+2013&amp;amp;enddate=Aug+26%2C+2013&quot; rel=&quot;nofollow&quot;&gt;https://www.google.com/finance/historical?cid=983582&amp;amp;startdate=Aug+19%2C+2013&amp;amp;enddate=Aug+26%2C+2013&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what is the right formula?&lt;/p&gt;&#xA;" OwnerUserId="6000" LastEditorUserId="467" LastEditDate="2013-08-26T12:32:45.070" LastActivityDate="2013-08-29T20:19:27.263" Title="How to compute the volume of an index from the volume of its constituents?" Tags="&lt;index&gt;&lt;volume&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8835" PostTypeId="2" ParentId="8830" CreationDate="2013-08-26T23:19:43.083" Score="3" Body="&lt;p&gt;Two general methods: you either need to increase general interest in the asset (i.e. increase volume) or make a mechanical change that will induce depth.  Some obvious ways:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Increase the minimum spread so that depth increases at the inside (you see this effect in low price stocks, where the minimum tick size is a constraint). &lt;/li&gt;&#xA;&lt;li&gt;Incentivize liquidity provision (e.g. maker taker model).&lt;/li&gt;&#xA;&lt;li&gt;Change the matching algorithm, for instance, to pro-rata as it is in short-term interest rate futures.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Some of these changes may result in higher t-costs for liquidity takers, as they primarily provide incentives to middle-men (dealers, high-frequency traders).&lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2013-08-26T23:19:43.083" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8837" PostTypeId="2" ParentId="8690" CreationDate="2013-08-27T06:28:11.823" Score="-2" Body="&lt;p&gt;You could use the free to access database from &lt;a href=&quot;http://www.bankacareer.com&quot; rel=&quot;nofollow&quot;&gt;www.bankacareer.com&lt;/a&gt; it actually provides up to 25k funds at the moment. You can sort it by Type (hedge fund, mutual, etc), Strategy (Income, Growth, etc) and even by country and city.&#xA;Enjoy!&lt;/p&gt;&#xA;" OwnerUserId="6003" LastActivityDate="2013-08-27T06:28:11.823" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8839" PostTypeId="1" CreationDate="2013-08-27T17:05:46.217" Score="0" ViewCount="534" Body="&lt;p&gt;Want to have electronic access to equity options quotes in real-time. Is there anyone offering this service to the individual investor for a reasonable price? Again it must be electronic, in other words, a computer program will analyse the data in real time, not the human eye.&lt;/p&gt;&#xA;" OwnerUserId="2762" LastActivityDate="2013-08-27T17:22:10.690" Title="Where can I get real-time equity options quotes for a reasonable price (i am not a company) besides screen scrapping Yahoo! Finance?" Tags="&lt;options&gt;&lt;equities&gt;&lt;market-data&gt;&lt;electronic-trading&gt;&lt;feed&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ClosedDate="2013-08-27T20:09:09.277" ContentLicense="CC BY-SA 3.0" />
  <row Id="8840" PostTypeId="2" ParentId="8839" CreationDate="2013-08-27T17:22:10.690" Score="1" Body="&lt;p&gt;DTN IQFeed, among many others, I'm sure.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2013-08-27T17:22:10.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8841" PostTypeId="1" CreationDate="2013-08-27T19:46:08.853" Score="3" ViewCount="205" Body="&lt;p&gt;DB has some sample Level 2 market data:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://deutsche-boerse.com/mda/dispatch/en/listcontent/gdb_navigation/mda/200_market_data/650_historical_market_data/35_enbs_hist_data_xetra/EnBS_historical_data_Xetra.htm&quot; rel=&quot;nofollow&quot;&gt;http://deutsche-boerse.com/mda/dispatch/en/listcontent/gdb_navigation/mda/200_market_data/650_historical_market_data/35_enbs_hist_data_xetra/EnBS_historical_data_Xetra.htm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://deutsche-boerse.com/mda/dispatch/en/listcontent/gdb_content_pool/imported_files/public_files/10_downloads/50_informations_services/47_enbs/EnBS_XTR13F1_20121126-0900-0905.dmp.gz&quot; rel=&quot;nofollow&quot;&gt;http://deutsche-boerse.com/mda/dispatch/en/listcontent/gdb_content_pool/imported_files/public_files/10_downloads/50_informations_services/47_enbs/EnBS_XTR13F1_20121126-0900-0905.dmp.gz&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, once I downloaded the file and un-zipped it in windows using Winrar I was presented with a .dmp file and no program could interpret it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How can I view this data on Windows?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="5168" LastEditorUserId="12" LastEditDate="2013-09-08T19:20:57.513" LastActivityDate="2013-09-08T19:20:57.513" Title="Deutsche Börse sample Level 2 data, how to view in Windows?" Tags="&lt;data&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8843" PostTypeId="1" AcceptedAnswerId="57047" CreationDate="2013-08-27T22:06:45.587" Score="16" ViewCount="5782" Body="&lt;p&gt;When dealing with trade data, for example from TAQ, a common problem is that of determining whether a trade was a &lt;em&gt;buy&lt;/em&gt; or a &lt;em&gt;sell&lt;/em&gt;. The most commonly used classifier is the Lee-Ready algorithm (&lt;em&gt;Inferring trade direction from intraday data&lt;/em&gt;, 1991). Unfortunately, this method is known to be inaccurate: Lee and Radhakrishna (&lt;em&gt;Inferring investor behaviour: evidence from TORQ data&lt;/em&gt;, 2000) report that Lee-Ready incorrectly classifies 24% of the trades inside the spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to improve on Lee-Ready's recipie? What are the best algorithms for trade classification?&lt;/p&gt;&#xA;" OwnerUserId="1531" LastActivityDate="2020-09-21T21:49:05.860" Title="What are modern algorithms for trade classification?" Tags="&lt;market-microstructure&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="8844" PostTypeId="2" ParentId="8841" CreationDate="2013-08-28T07:26:57.313" Score="2" Body="&lt;p&gt;It's an ordinary FIX/FAST stream for which you'd need a FIX/FAST decoder.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We're not using Windows, so don't take my word for it, but google thinks &lt;a href=&quot;http://www.b2bits.com/performance_lab/fast_antenna_codec/fast_codec_windows.html&quot; rel=&quot;nofollow&quot;&gt;the FAST Antenna Codec for Windows&lt;/a&gt; could work.&lt;/p&gt;&#xA;" OwnerUserId="1040" LastActivityDate="2013-08-28T07:26:57.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8845" PostTypeId="2" ParentId="8821" CreationDate="2013-08-28T12:04:25.850" Score="1" Body="&lt;p&gt;You are correct on how you should price reinsurance  $E[(X-K)^+]$ and you can view reinsurance as a call option. To this extent, you could price reinsurance with Black-Scholes. However, Black-Scholes is usually used for shorter durations and reinsurance contracts (depending on the product) are typically longer than the 3-6 month horizon used on options. I believe PartnerRe put out a white paper on this (for life reinsurance).&lt;/p&gt;&#xA;" OwnerUserId="6010" LastActivityDate="2013-08-28T12:04:25.850" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8846" PostTypeId="1" CreationDate="2013-08-28T14:42:39.193" Score="3" ViewCount="1756" Body="&lt;p&gt;Can anyone point me to the expression for the first passage time for a geometric Brownian motion process X(t) as a function of the starting point, threshold, drift and diffusion parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am mainly interested for processes with positive drift and thresholds that are higher than the starting point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know this is a standard expression, however all results I have found so far are specific to a particular starting point (e.g. X(0) = 0) and/or threshold of 1, and I am not sure how to generalize to any initial state and threshold value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be much appreciated&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="6012" LastActivityDate="2013-10-30T16:46:31.187" Title="Brownian motion - first passage time" Tags="&lt;stochastic-processes&gt;&lt;brownian-motion&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8847" PostTypeId="2" ParentId="1865" CreationDate="2013-08-28T17:33:11.613" Score="2" Body="&lt;p&gt;There is a new Order Book visualization tool, called BookMap:&#xA;&lt;a href=&quot;http://www.youtube.com/watch?v=1c6HegAn-CA&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.youtube.com/watch?v=1c6HegAn-CA&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It allows to trade and simulate trading in real-time or replay mode.&#xA;The replay mode is free to use.&#xA;&lt;img src=&quot;https://i.stack.imgur.com/N1Iyp.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BookMap is the only tool, that visualizes the history (evolution) of the order book. (the first version will be soon in production)&lt;/p&gt;&#xA;" OwnerUserId="1515" LastEditorUserId="1515" LastEditDate="2014-04-01T23:08:26.517" LastActivityDate="2014-04-01T23:08:26.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8849" PostTypeId="1" CreationDate="2013-08-28T18:40:13.203" Score="7" ViewCount="3566" Body="&lt;p&gt;Excel is likely the most widespread instrument across all not-only-quants desks; in addition, we have to keep in mind that Bloomberg and Reuters allow to easily import real time data in Excel, and this is very handy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Due to these features, I'm wondering what's the easiest and most reliable solution to use QuantLib in Excel.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far, these are the ways I know:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://quantlib.org/quantlibxl/&quot;&gt;&lt;strong&gt;QuantLibXL&lt;/strong&gt;&lt;/a&gt;;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rcom.univie.ac.at/download.html#RExcel&quot;&gt;&lt;strong&gt;RExcel&lt;/strong&gt;&lt;/a&gt; together with &lt;a href=&quot;http://cran.r-project.org/web/packages/RQuantLib/RQuantLib.pdf&quot;&gt;&lt;strong&gt;RQuantLib&lt;/strong&gt;&lt;/a&gt;;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.pyxll.com/&quot;&gt;&lt;strong&gt;PyXLL&lt;/strong&gt;&lt;/a&gt; together with &lt;a href=&quot;https://pypi.python.org/pypi/QuantLib-Python&quot;&gt;&lt;strong&gt;QuantLib-Python&lt;/strong&gt;&lt;/a&gt; (actually, I've not tried this one on the field, yet)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Each one has its pros and con's, I must admit &lt;strong&gt;QuantLibXL&lt;/strong&gt; is harder than I thought before; being quite able to code with &lt;code&gt;R&lt;/code&gt;, so far my favorite solution is the second one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If anyone knows any better solution and/or a good step-by-step tutorial for &lt;strong&gt;QuantLibXL&lt;/strong&gt; (something which explains how to deal easily with &quot;classes&quot; in a spreadsheet), it would be really appreciated if he could write it here.&lt;/p&gt;&#xA;" OwnerUserId="3058" LastEditorUserId="467" LastEditDate="2013-08-29T07:59:02.473" LastActivityDate="2017-10-24T07:32:56.657" Title="What is the best solution to use QuantLib within Excel?" Tags="&lt;programming&gt;&lt;r&gt;&lt;quantlib&gt;&lt;excel&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8850" PostTypeId="1" CreationDate="2013-08-28T23:11:39.917" Score="0" ViewCount="661" Body="&lt;p&gt;I have a question about a option theta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I evaluate the option theta of near expiry put option using Black-Scholes formula given the data as follow:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Index Level = 20,500&lt;/li&gt;&#xA;&lt;li&gt;Strike Price = 20,000&lt;/li&gt;&#xA;&lt;li&gt;Interest Rate = 0.14%&lt;/li&gt;&#xA;&lt;li&gt;Dividend Yield = 3.41%&lt;/li&gt;&#xA;&lt;li&gt;Volatility = 23.64%&lt;/li&gt;&#xA;&lt;li&gt;Time to maturity = 0.01 (2 days)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Using data as above, the put option price is \$12.97, but the theta per one day is -\$13.39. That means after one day, the put option price becomes negative given the above parameters (except time to maturity) do not change. I wonder the reason of put option price is smaller than the absolute value of theta. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess the reason is that the theta tell us the linear change of put option price against the time, but the relationship of option price and time to maturity is not linear, then the above case may happen. Is my conjecture correct? And is there any financial interpretataion on the above phonomena? &lt;/p&gt;&#xA;" OwnerUserId="6119" LastEditorUserId="35" LastEditDate="2013-08-29T03:49:51.030" LastActivityDate="2013-08-31T21:51:44.390" Title="Question about option theta" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;theta&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8851" PostTypeId="2" ParentId="8846" CreationDate="2013-08-29T08:46:06.043" Score="2" Body="&lt;p&gt;Just work in log-space to get rid of the starting point, then by invariance of BM you only need threshold-X(0) and X(0)=0 is enough to work with at first.&#xA;In the no-drift case the solution is also invariant if you scale diffusion and threshold simultaneously (Levy dist), therefore you can effectively get rid of one parameter (that is you can reduce to the case of it being =1). &#xA;In the general case (IG) you can imagine a similar behaviour acting on the drift too (so a combined drift and threshold scaling must be &quot;compensated&quot; by one in volatility), and again you get rid of one parameter, in this case the threshold. &lt;/p&gt;&#xA;" OwnerUserId="3015" LastActivityDate="2013-08-29T08:46:06.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8853" PostTypeId="1" AcceptedAnswerId="8854" CreationDate="2013-08-29T15:52:49.057" Score="3" ViewCount="1314" Body="&lt;p&gt;I have a quick question about the ETF Roll Yield. As we all know commodity ETF’s have struggled with contango (spot price is below futures prices on the term structure). Look at an ETF like USO which because of the contango in WTI has had negative roll yield even as WTI prices have rebounded since 2008.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my question. Why does the roll yield even occur? If an ETF like the USO is long the spot why does it have to roll into a higher price contract? Wouldn’t the futures price and the spot eventually converge by the time the roll occurs? The future price is higher than the spot in a contango wouldn’t the spot have to move higher to reach the futures price? I mean the futures can decline to the spot but I don’t see how this affect you if your long the spot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the USO isn’t long the spot but further out oil contracts, what guarantees that futures price will converge to the spot in a contango curve? So contango doesn’t have to necessarily be a bad thing for a long commodity investor/etf.    &lt;/p&gt;&#xA;" OwnerUserId="4729" LastActivityDate="2013-09-05T15:36:48.240" Title="ETF Negative Roll Yield" Tags="&lt;etf&gt;&lt;roll-adjustment&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8854" PostTypeId="2" ParentId="8853" CreationDate="2013-08-29T16:54:22.637" Score="3" Body="&lt;p&gt;The futures price goes to the spot price as time to maturity declines, not vice-versa. The difference is referred to as basis. That's not really what roll yield is about though. The roll yield aspect is that as the contracts the ETF holds are expiring, they are close to the spot price. However, the next futures contract's price is higher than the price of the futures contract you're in due to the effect of contango. So if you were to sell out of the closest futures contract to buy the next one, it would cost more to achieve the same exposure it had before. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2013-08-29T16:54:22.637" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8855" PostTypeId="2" ParentId="8833" CreationDate="2013-08-29T20:19:27.263" Score="5" Body="&lt;p&gt;The volume reported for the DJIA is the sum of the volumes (in shares) of the individual components, including trades executed on their respective primary markets only.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the 23rd of August, it looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Ticker  Exchange    Shares Traded&#xA;MMM     New York       496,789&#xA;AA      New York     2,400,280&#xA;AXP     New York       613,379&#xA;T       New York     4,886,455&#xA;BAC     New York    12,040,541&#xA;BA      New York       750,949&#xA;CAT     New York     1,456,577&#xA;CVX     New York     1,386,990&#xA;CSCO    NASDAQ GS   10,916,222&#xA;KO      New York     2,786,460&#xA;DD      New York       780,407&#xA;XOM     New York     2,357,309&#xA;GE      New York     5,896,019&#xA;HPQ     New York     5,304,441&#xA;HD      New York     2,399,417&#xA;INTC    NASDAQ GS    7,082,188&#xA;IBM     New York       593,065&#xA;JNJ     New York     1,839,555&#xA;JPM     New York     2,302,471&#xA;MCD     New York       876,265&#xA;MRK     New York     3,387,386&#xA;MSFT    NASDAQ GS   48,203,961&#xA;PFE     New York     4,478,299&#xA;PG      New York     1,475,610&#xA;TRV     New York       269,658&#xA;UTX     New York       832,110&#xA;UNH     New York       968,481&#xA;VZ      New York     1,704,463&#xA;WMT     New York     1,443,304&#xA;DIS     New York     1,971,379&#xA;&#xA;        Total      131,900,430&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also note that the volume for the DJIA as reported on Bloomberg is 131,900,430 for that day - not sure where google is getting the number from.&lt;/p&gt;&#xA;" OwnerUserId="2393" LastActivityDate="2013-08-29T20:19:27.263" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8856" PostTypeId="2" ParentId="8585" CreationDate="2013-08-30T09:27:52.637" Score="1" Body="&lt;p&gt;In my experience with forecasting, you could try a model of the form&#xA;$$&#xA; X_ t = cycle_t + seasonality_t + residuum_t.&#xA;$$&#xA;Sometimes it is hard to find the cycle but the seasonality could be doable if it has some natural structure (something happening in a certain month each year e.g.). Rob Hyndman explains all these things (and provides an R package) in his free online &lt;a href=&quot;http://otexts.com/fpp/&quot; rel=&quot;nofollow&quot;&gt;book&lt;/a&gt;. You could have a look at chapter 6. After having calculated the first 2 components you could model the distribution of the residuum.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2013-08-30T09:27:52.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8857" PostTypeId="1" AcceptedAnswerId="8859" CreationDate="2013-08-30T11:49:04.043" Score="3" ViewCount="1390" Body="&lt;p&gt;I'm using &lt;strong&gt;QuantLibXL&lt;/strong&gt; to build a discount curve, a zero yield curve and a forward curve of the EURIBOR rate (&lt;strong&gt;QuantLibXL&lt;/strong&gt; is downloadable &lt;a href=&quot;http://quantlib.org/quantlibxl/index.html&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;here&lt;/strong&gt;&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've built an object of class &lt;code&gt;PiecewiseYieldCurve&lt;/code&gt; through the &lt;code&gt;qlPiecewiseYieldCurve()&lt;/code&gt; function and the &lt;code&gt;TraitsID&lt;/code&gt; argument is set to &lt;code&gt;ZeroRate&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I use the &lt;code&gt;qlPiecewiseYieldCurveData()&lt;/code&gt; function to get the zero rates, the ObjectHandler returns me the following error message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;qlPiecewiseYieldCurveData - 1st iteration: failed at 1st alive instrument, maturity September 10th, 2013, reference date September 3rd, 2013: invalid value (-1) at index 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Similar issue with the forward rates curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What should I amend in my &lt;code&gt;qlPiecewiseYieldCurve()&lt;/code&gt; to make it work properly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Maybe this question is more suitable to Stack Overflow than Quantitative Finance Stack Exchange?).&lt;/p&gt;&#xA;" OwnerUserId="3058" LastActivityDate="2013-08-30T14:59:08.307" Title="QuantLib error with qlPiecewiseYieldCurveData() on qlPiecewiseYieldCurve() with ZeroYield and ForwardRate" Tags="&lt;programming&gt;&lt;yield-curve&gt;&lt;quantlib&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8859" PostTypeId="2" ParentId="8857" CreationDate="2013-08-30T14:59:08.307" Score="6" Body="&lt;p&gt;Ok, I've done some digging in the code.&#xA;It's an issue with the LogLinear interpolation; while trying to find the correct rate for the 1-week node, the bootstrapper wanders unchecked into a region of negative rates and the logarithms blow up.  At this time, I'm afraid the workaround is just to use some other interpolation.  Or recompile the library and the addin disabling negative rates, but that's a lot more complex...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would you mind reporting this as a bug on the QuantLib mailing list, or the bug tracker at &lt;a href=&quot;http://sourceforge.net/p/quantlib/bugs/&quot;&gt;http://sourceforge.net/p/quantlib/bugs/&lt;/a&gt;? (You might need a SourceForge login for the tracker.)&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2013-08-30T14:59:08.307" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8860" PostTypeId="1" CreationDate="2013-08-30T18:36:40.597" Score="1" ViewCount="313" Body="&lt;p&gt;I think there are two possible ways: 1. day open, close, high, low, volume separately into array, then I have 5 arrays to work with my calculation 2. Put all of these into one array or linklist to do the calculation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the 1. would be more easy to handle all backtest calculations, do you agree?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Background information: I would develop my system with Java and run in either Windows 7 64 bits/ Ubuntu 64 bits. I will eventually connect the live trading version to Interactive Broker Java socket API.&lt;/p&gt;&#xA;" OwnerUserId="6022" LastEditorUserId="1355" LastEditDate="2013-09-05T23:18:31.923" LastActivityDate="2013-09-05T23:18:31.923" Title="For a interdays trading backtest system, should I put day open, close, high, low, volume separately into array?" Tags="&lt;programming&gt;&lt;trading-systems&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8861" PostTypeId="2" ParentId="8860" CreationDate="2013-08-30T18:59:04.263" Score="4" Body="&lt;p&gt;Go with the multiple arrays. This would give you a &lt;a href=&quot;https://quant.stackexchange.com/a/468/35&quot;&gt;column-oriented store&lt;/a&gt;, which is far more cache-efficient when handling time-series data. Specifically, you are describing an &quot;in-memory&quot; database table that can be queried.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll also want to think about how to do your look-ups. Will you have a hash table that maps symbols to OHLC tables? Will you partition the tables by date? Think about what kind of queries you're going to run, and then structure your data to make this search easiest.&lt;/p&gt;&#xA;" OwnerUserId="35" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2013-08-30T18:59:04.263" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8862" PostTypeId="1" CreationDate="2013-08-31T14:20:05.950" Score="2" ViewCount="1363" Body="&lt;p&gt;I have a fairly simple problem for an application I am writing currently. How do you calculate the options probability of being in the money or touching a certain strike price. I know there are at least two ways of doing it. One would be to derive it from the options pricing and the Black Scholes formula, but the other which interests me probably more would be to run a monte carlo simulation given the target strike, current strike, IV and days to expiration. What do you think are the advantages/disadvantages of each method, which one is easier to implement methematically/programatically and what is the math in layman terms of the easier to implement method. Any help will be appreciated!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just want to point out that i come from a developer background and not math/stats one so if you can please provide any answers in very plain terms that would be great. Thanks!&lt;/p&gt;&#xA;" OwnerUserId="6027" LastActivityDate="2013-09-27T14:45:24.117" Title="Monte Carlo Options Probability Calculation" Tags="&lt;options&gt;&lt;statistics&gt;&lt;probability&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8864" PostTypeId="2" ParentId="7165" CreationDate="2013-08-31T18:57:48.253" Score="2" Body="&lt;p&gt;Your distribution is leptokurtic therefore I suggest using MVaR (with Cornish-Fisher expansion) which is useful for non-normal distributions. In the formula you enter your observed or expected skew and excess kurtosis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your strategy does not have exposure all the time I would still stick with the methodology of measuring the VaR during these periods. The explanatory power of the number you calculate then depends on &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;how robust your strategy behaves. E.g. is it out of the market 30%&#xA;of the time with +/-5% always then the average VaR for your period&#xA;should have good explanatory power. On the other extreme, if the&#xA;strategy is not in the market for a year but completely in the&#xA;market the following year the explanatory power of your VaR is low.&#xA;Then you should take a very long observation period/interval.&lt;/li&gt;&#xA;&lt;li&gt;your strategy's behavior against the underlying market. Do you aim&#xA;to be out of the market on the worst days and your strategy just&#xA;does that, then your VaR should be lower than the VaR of the market.You can test the difference for significance.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I learned you have to be cautious in terms of risk measures for intraday timing strategies because being exposed during the opening and closing hour can have different risk-return character than being exposed during the middle of the day. &lt;/p&gt;&#xA;" OwnerUserId="5620" LastActivityDate="2013-08-31T18:57:48.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8865" PostTypeId="2" ParentId="8850" CreationDate="2013-08-31T19:08:21.383" Score="2" Body="&lt;p&gt;Disclaimer: I did not check your example, i.e., that &quot;theta * 1 day&quot; will predict a negative option price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Theta is the derivative with respect to time-to-maturity. It is the change of the option price with respect to an &lt;em&gt;infinitessimal change in time&lt;/em&gt; and not with respect to a change of one day - even if the derivative is &quot;scaled&quot; towards a time scale having 1 day as its unit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words&#xA;$\int_{t}^{t+d} \frac{\partial V}{\partial \tau} d \tau = V(t+d) - V(t)$&#xA;and in general&#xA;$\int_{t}^{t+d} \frac{\partial V}{\partial \tau} d \tau \neq \frac{\partial V}{\partial \tau}(t) \cdot d$, however, the latter is an &lt;em&gt;approximation&lt;/em&gt;. Here $V(t)$ is the option value, evaluated at time $t$.&lt;/p&gt;&#xA;" OwnerUserId="3548" LastEditorUserId="3548" LastEditDate="2013-08-31T21:51:44.390" LastActivityDate="2013-08-31T21:51:44.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8866" PostTypeId="1" CreationDate="2013-09-01T19:22:55.047" Score="3" ViewCount="212" Body="&lt;p&gt;I have several assets, each with different return histories.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some of the assets have 75 days of return history, others have 40 or so days. In calculating a robust covariance matrix, should I be using a resampling with replacement technique or should I be using an expectation maximization algorithm?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was thinking of truncating the samples so that they all share ~40 days of return history, and then resampling that distribution of returns with replacement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, I'm not sure that's ideal.&lt;/p&gt;&#xA;" OwnerUserId="5216" LastEditorUserId="467" LastEditDate="2013-09-02T09:53:15.253" LastActivityDate="2013-09-02T09:53:15.253" Title="Should I use Resampling or Expectation Maximization to compute a robust covariance matrix?" Tags="&lt;statistics&gt;&lt;covariance&gt;&lt;estimation&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8867" PostTypeId="1" CreationDate="2013-09-01T21:16:38.183" Score="2" ViewCount="857" Body="&lt;p&gt;The following link contains a file containing CME Level 2 FIX Market/Orderbook data for Corn futures:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;ftp://ftp.cmegroup.com/datamine_sample_data/md/mdff_cbt_20130714-20130715_7813_0.zip&quot; rel=&quot;nofollow&quot;&gt;ftp://ftp.cmegroup.com/datamine_sample_data/md/mdff_cbt_20130714-20130715_7813_0.zip&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, after going through the file &lt;strong&gt;the timestamps at tag 52 are all over the place and in no order. Would somebody familiar with FIX/CME be able to tell me why this is the case?&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was expecting the data to be ordered chronologically so that I could re-create it as-it-happened on that day. The file is labelled as data from 14th to 15th July.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first few timestamps from the start of the file are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;52=2013-07-15 05:34:28.544&lt;/p&gt;&#xA;&#xA;&lt;p&gt;52=2013-07-14 18:02:06.034&lt;/p&gt;&#xA;&#xA;&lt;p&gt;52=2013-07-15 18:14:51.830&lt;/p&gt;&#xA;&#xA;&lt;p&gt;52=2013-07-15 18:15:19.884&lt;/p&gt;&#xA;&#xA;&lt;p&gt;52=2013-07-15 15:17:58.397&lt;/p&gt;&#xA;&#xA;&lt;p&gt;52=2013-07-15 18:14:52.838&lt;/p&gt;&#xA;&#xA;&lt;p&gt;52=2013-07-14 18:01:54.011&lt;/p&gt;&#xA;&#xA;&lt;p&gt;52=2013-07-15 02:17:36.061&lt;/p&gt;&#xA;&#xA;&lt;p&gt;52=2013-07-15 13:30:16.430&lt;/p&gt;&#xA;&#xA;&lt;p&gt;52=2013-07-15 18:14:57.258&lt;/p&gt;&#xA;&#xA;&lt;p&gt;52=2013-07-15 00:12:22.353&lt;/p&gt;&#xA;&#xA;&lt;p&gt;52=2013-07-15 15:50:47.423&lt;/p&gt;&#xA;&#xA;&lt;p&gt;52=2013-07-15 14:39:56.419&lt;/p&gt;&#xA;" OwnerUserId="5168" LastEditorUserId="35" LastEditDate="2013-09-08T17:59:16.140" LastActivityDate="2014-04-09T21:37:54.537" Title="Ordering of CME Level 2 FIX Market data?" Tags="&lt;data&gt;&lt;cme&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8868" PostTypeId="2" ParentId="8867" CreationDate="2013-09-01T22:13:20.990" Score="1" Body="&lt;p&gt;I am sure that you are interesting in tag 273 (MDEntryTime, &lt;a href=&quot;http://www.onixs.biz/fix-dictionary/4.2/tagNum_273.html&quot; rel=&quot;nofollow&quot;&gt;http://www.onixs.biz/fix-dictionary/4.2/tagNum_273.html&lt;/a&gt;). Which is used in Snapshot and Incremental Refresh messages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also CME gives real time market data using FAST (very simplified for now, they removed all FAST operations from templates several month ago) not FIX.&lt;/p&gt;&#xA;" OwnerUserId="6031" LastActivityDate="2013-09-01T22:13:20.990" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8870" PostTypeId="1" CreationDate="2013-09-02T16:13:10.493" Score="3" ViewCount="672" Body="&lt;p&gt;I have two questions to ask:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;What are the best methods to determine stationarity in a financial market (such as stocks) using MATLAB?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What methods would you recommend to use in order to change from non-stationary points to stationary points (so as to better predict the market), so that I can use the resulted data for genetics algorithms or genetics programming to predict the next move?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thank you for reading this.&lt;/p&gt;&#xA;" OwnerUserId="6034" LastEditorUserId="35" LastEditDate="2013-09-03T15:25:46.990" LastActivityDate="2013-09-03T15:25:46.990" Title="Test for stationarity and make use of non-stationary points in financial market?" Tags="&lt;time-series&gt;&lt;stochastic-calculus&gt;&lt;stationarity&gt;&lt;financial-engineering&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8872" PostTypeId="2" ParentId="7645" CreationDate="2013-09-03T07:25:53.740" Score="1" Body="&lt;p&gt;I think Matt Wolf has missed the point. Equity risk premium prediction models actually tend to perform &lt;strong&gt;better&lt;/strong&gt; over longer horizons than shorter horizons. Why this is the case is disputable, however, I think it largely reflects the mean-reverting qualities of equity markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With regard to the OP's point about over-lapping time periods, it is OK to us rolling time periods which obviously contain some overlap in observations. What you do need to be careful about is statistical inference based off rolling windows because any independence assumption would be clearly flawed.&lt;/p&gt;&#xA;" OwnerUserId="5976" LastActivityDate="2013-09-03T07:25:53.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8874" PostTypeId="1" CreationDate="2013-09-03T11:48:14.433" Score="3" ViewCount="205" Body="&lt;p&gt;A rights issue is the granting by a corporation to its shareholders of a right to purchase $N$ new shares for each $M$ shares they already hold at a (often discounted) price $K$. Thus, it superficially resembles a call option, but because every shareholder is holding such options, dilution of the stock value is unavoidable. Are there any papers out there which would contain a description of a risk-neutral valuation of rights issue, e.g. using a modified Black-Scholes model?&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2013-12-02T16:50:26.107" Title="Risk-neutral models for rights issues" Tags="&lt;equities&gt;&lt;derivatives&gt;&lt;pricing&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8875" PostTypeId="1" CreationDate="2013-09-03T13:31:08.207" Score="18" ViewCount="21496" Body="&lt;p&gt;Searching online, i found out that non-stationary cannot be analyzed with traditional econometric techniques as in case of non-stationarity some basic model assupmtions are not met and correct reasoning on relationships between non-stationary time-series is impossible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anyone who can enlighten me what are the basic model assumptions and the correct reasoning on relationships?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, how does techniques such as detrending, detrending, seasonal adjustment, and transformation test helps to make those non-stationary data into useful stationary data for analysis? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(My thinking is that for example if the non-stationary stock data are gibberish, no amount of effort would be able to make them useful for predicting the stock market.)&lt;/p&gt;&#xA;" OwnerUserId="6034" LastEditorUserId="2299" LastEditDate="2014-06-01T17:31:33.550" LastActivityDate="2014-08-06T17:34:57.220" Title="Why non-stationary data cannot be analyzed?" Tags="&lt;time-series&gt;&lt;stochastic-processes&gt;&lt;econometrics&gt;&lt;stationarity&gt;&lt;financial-engineering&gt;" AnswerCount="6" CommentCount="1" FavoriteCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="8876" PostTypeId="2" ParentId="8875" CreationDate="2013-09-03T13:57:36.077" Score="0" Body="&lt;p&gt;The standard errors of non-stationary processes doesn't have the same properties of stationary times series, that is the F-tests and t-values are not reliable for hypothesis testing. So for example if you try to estimate the relationship between two non-stationary variables, and the t-statistic says that the relationship with them are highly significant, this might as well be  spurious. However, if you first difference the the two variables the true relationship between the two variables are revealed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;One way&lt;/strong&gt; to deal with non-stationary time series is to work with the first differences (if they are integrated of order 1, which they often are). Some data might just need detrending, and some just needs to be seasonally adjusted. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When it comes the to stock prices, the non-stationarity is not the reason they &quot;can't&quot; be predicted. Their pricing are simply just too complicated mechanisms which are too hard to model. &lt;/p&gt;&#xA;" OwnerUserId="5579" LastEditorUserId="5579" LastEditDate="2013-09-03T17:03:38.030" LastActivityDate="2013-09-03T17:03:38.030" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8877" PostTypeId="1" AcceptedAnswerId="9570" CreationDate="2013-09-03T14:25:49.543" Score="1" ViewCount="324" Body="&lt;p&gt;I'm currently looking to implement some version of the yield curve modeling techniques in the maximum smoothness framework. The papers I have found so far explains the theory pretty well, but I find them somewhat hard to replicate. Does anyone here know any easy-to-replicate papers on the topic? The ones I have read so far are: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Fitting yield curves and forward rate curves with maximum smoothness - Adams, Van Deventer, 1994&lt;/li&gt;&#xA;&lt;li&gt;Positive forward rates in the maximum smoothness framework - Manzano, Blomvall, 2004&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance for any input :)&lt;/p&gt;&#xA;" OwnerUserId="1128" LastActivityDate="2013-11-28T00:52:42.200" Title="&quot;Friendly&quot; papers about maximum smoothness yield curve modelling" Tags="&lt;fixed-income&gt;&lt;yield-curve&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8878" PostTypeId="2" ParentId="8874" CreationDate="2013-09-03T15:49:48.253" Score="2" Body="&lt;p&gt;I think Hull treats dilution in his book, and it's extensible to this case.  For what it's worth, the strike is typically set low enough that there's little doubt about exercise, meaning there's not much point in modeling the optionality.  Most people concentrate on the dilution alone -- particularly the question of the change in fully diluted versus undiluted shares outstanding.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2013-09-03T15:49:48.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8879" PostTypeId="2" ParentId="141" CreationDate="2013-09-03T17:29:53.837" Score="4" Body="&lt;p&gt;I have yet to see Bloombergs open API in this thread...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.openbloomberg.com/%E2%80%8E&quot; rel=&quot;nofollow&quot;&gt;Bloombergs API&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.openbloomberg.com/2013/02/06/open-api-blpapi-v3-6-x-released/&quot; rel=&quot;nofollow&quot;&gt;This is the link to the actual API on that page.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second link is the actual link to the latest api&lt;/p&gt;&#xA;" OwnerUserId="1380" LastEditorUserId="1380" LastEditDate="2013-09-04T01:25:44.150" LastActivityDate="2013-09-04T01:25:44.150" CommentCount="2" CommunityOwnedDate="2013-09-03T17:29:53.837" ContentLicense="CC BY-SA 3.0" />
  <row Id="8881" PostTypeId="1" CreationDate="2013-09-04T03:28:15.570" Score="1" ViewCount="665" Body="&lt;p&gt;I have two assets, $S_1$ and $S_2$, which follow geometric Brownian motion processes. This implies that both $S_1$ and $S_2$ have a lognormal distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to get the exchange option price formula through the risk neutral valuation, or, in other words&#xA;$$C(t,S_1,S_2)=e^{-r(T-t)}E(\max\{S_1-S_2,0\})$$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I calculate the expected value $E(\max\{S_1-S_2,0\})$??&lt;/p&gt;&#xA;" OwnerUserId="5754" LastActivityDate="2013-11-26T05:25:34.490" Title="Risk Neutral Evaluation - Exchange/Spread Options" Tags="&lt;risk-neutral-measure&gt;&lt;lognormal&gt;&lt;exchange&gt;&lt;spread-options&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8882" PostTypeId="1" CreationDate="2013-09-04T08:32:38.280" Score="2" ViewCount="1409" Body="&lt;p&gt;I've already computed the CVA\DVA and now I would like to compute the bilateral adjustment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know the relationship between the CVA\DVA with the bilateral adjustment? I mean a paper, article or whatever; if it talks about that relationship and how to compute the bilateral adjustment, it will be very useful.&lt;/p&gt;&#xA;" OwnerUserId="5595" LastEditorUserId="35" LastEditDate="2013-11-21T19:08:04.030" LastActivityDate="2019-05-19T14:53:21.843" Title="CVA DVA and Bilateral adjustment" Tags="&lt;cva&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8883" PostTypeId="1" CreationDate="2013-09-04T15:08:26.473" Score="4" ViewCount="442" Body="&lt;p&gt;The liquidity diversification can be measured by the liquidity score, defined here as the ratio between the pure market P&amp;amp;L CVaR and the market+liquidity P&amp;amp;L CVaR. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried to reproduce the results in Meucci's paper &lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/43243-a-fully-integrated-liquidity-and-market-risk-model&quot; rel=&quot;nofollow noreferrer&quot;&gt;A fully integrated liquidity and market risk model&lt;/a&gt;, for which the code is available in Matlab, more precisely Example 3 of the paper, the liquidity diversification. One would expect that with the same initial capital, varying the number of stocks (1, 5, 50 for example), the liquidity score increases, albeit not greatly because liquidity is less diversifiable than market risk. When I compute the liquidity score however, I don't get an increase but a decrease of the liquidity score. Did someone try his hands on this ? The first picture is for the portfolio with one stock, the second with 20 equally-weighted stocks. You can already see on the plots that the liquidity score for the portfolio of 20 stocks (LS = 0.4) will be lower than the portfolio with one stock (LS = 0.6). If you need the code for computing the liquidity score (not provided in Meucci's code), I can share it ! &lt;img src=&quot;https://i.stack.imgur.com/aqiSV.png&quot; alt=&quot;1 stock&quot;&gt;    &lt;img src=&quot;https://i.stack.imgur.com/fQWie.png&quot; alt=&quot;20 stocks&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="3319" LastActivityDate="2018-04-06T13:46:28.897" Title="Liquidity diversification" Tags="&lt;risk-management&gt;&lt;liquidity&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8884" PostTypeId="2" ParentId="8881" CreationDate="2013-09-04T16:04:52.590" Score="1" Body="&lt;p&gt;Your formula, as it stands, is &lt;strong&gt;incorrect&lt;/strong&gt;, at least is if $E$ means the &quot;expected value under real-world probabilities&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wrote a blog &lt;a href=&quot;http://blog.smaga.ch/introduction-to-risk-neutral-pricing-theory/&quot; rel=&quot;nofollow&quot;&gt;post&lt;/a&gt; explaining the basic rationale behind risk-neutral pricing where you will see that if the &lt;a href=&quot;http://en.wikipedia.org/wiki/Fundamental_theorem_of_asset_pricing&quot; rel=&quot;nofollow&quot;&gt;Fundamental Theorem of Asset Pricing theorem&lt;/a&gt; holds, you can write:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $X_t=S_{1,t}-S_{2,t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$e^{-rt} X_t = \mathbb{E}_\mathbb{Q}[e^{-rT}  \max(X_T,0) | \mathcal{F}_t]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\mathbb{E}_\mathbb{Q}$ stands for &quot;expectation &lt;em&gt;under the risk-neutral probability&lt;/em&gt;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From there, what you have to do is to define the risk-neutral dynamics of $S_1$ and $S_2$. When you say that the assets are following a lognormal distribution, I'll assume that they follow are independent Geometric Brownian Motion. In this case, their risk neutral dynamics are well know (see &lt;a href=&quot;http://en.wikipedia.org/wiki/Risk-neutral_measure#Example_2_.E2.80.94_Brownian_motion_model_of_stock_prices&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dS_{1,t}= r S_{1,t} dt + \sigma_1 S_{1,t} dW^{\mathbb{Q}}_{1,t} $$&#xA;$$dS_{2,t}= r S_{2,t} dt + \sigma_2 S_{2,t} dW^{\mathbb{Q}}_{2,t} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where is the risk-free rate, and $dW^{\mathbb{Q}}_{i,t}=dW_{i,t}+\frac{\mu_i-r}{\sigma_i}dt$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, you have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dX_t=dS_{1,t}-dS_{2,t}=r (S_{1,t} -S_{2,t})dt + + \sigma_1 S_{1,t} dW^{\mathbb{Q}}_{1,t} - dS_{2,t}= r S_{2,t} dt - \sigma_2 S_{2,t} dW^{\mathbb{Q}}_{2,t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X_t = e^{-r(T-t)} \mathbb{E}_\mathbb{Q}[\max(X_T,0)  | \mathcal{F}_t]= e^{-r(T-t)} \mathbb{E}_\mathbb{Q}[\mathbb{1}_{X_T&amp;gt;0}X_T  | \mathcal{F}_t]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you carry on manipulation the equation, I would suggest changing the numeraire...&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2013-09-04T16:39:59.327" LastActivityDate="2013-09-04T16:39:59.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8887" PostTypeId="2" ParentId="141" CreationDate="2013-09-05T00:20:18.743" Score="2" Body="&lt;p&gt;&lt;a href=&quot;http://www.thinknum.com&quot; rel=&quot;nofollow&quot;&gt;Thinknum.com&lt;/a&gt; is a new financial data provider. We have financial time-series data and data for building cashflow models. Thinknum's plotter is similar to tools like GS plottool and JPM data-query in that it allows users to manipulate time-series data using mathematical expressions. &lt;/p&gt;&#xA;" OwnerUserId="6051" LastActivityDate="2013-09-05T00:20:18.743" CommentCount="0" CommunityOwnedDate="2013-09-05T00:20:18.743" ContentLicense="CC BY-SA 3.0" />
  <row Id="8890" PostTypeId="2" ParentId="8853" CreationDate="2013-09-05T15:36:48.240" Score="0" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;If an ETF like the USO is long the spot why does it have to roll into a higher price contract?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is wrong. An ETF is not always long spot (at least not USO). ETF try to create spot returns by using first month future contract. Imagine the amount of storage space required by USO issuer to store all that spot oil. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If the USO isn’t long the spot but further out oil contracts, what guarantees that futures price will converge to the spot in a contango curve?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;There is no guarantee. But the forward curves of commodities tend to change very slowly. So during contango period, typically there are more buyers for forward month contract compared to spot and situation tends to continue over period of multiple futures contract expiries. During such a period, an ETF provider (or even just long only investor who gains exposure using futures contracts) will have to keep on buying the front month contract at higher price than typically where he/she would be able to sell at end of that contract expiry. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Contango is almost always bad for long only invesor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another classic example of ETF suffering due to contango is VXX.&lt;/p&gt;&#xA;" OwnerUserId="4597" LastActivityDate="2013-09-05T15:36:48.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8891" PostTypeId="1" AcceptedAnswerId="8895" CreationDate="2013-09-05T16:41:49.097" Score="4" ViewCount="1784" Body="&lt;p&gt;I am wondering what's the most efficient way (i.e. the method which involves the fewest arguments) to price a bond at a specified date, e.g. a future date (as instance, 6 months from now) in &lt;strong&gt;QuantLib&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let the object of class &lt;code&gt;Bond&lt;/code&gt; is then priced using &lt;code&gt;BondSetCouponPricer()&lt;/code&gt; and &lt;code&gt;InstrumentSetPricingEngine()&lt;/code&gt; with a non-flat object of &lt;code&gt;YieldTermStructure&lt;/code&gt; class (like a zero yield curve): does this take into account the whole shape of the yield term structure, considering the bond is not priced today but at a &quot;new&quot; tenor due to the fact that in this simulation six months have passed? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What if the &lt;code&gt;Bond&lt;/code&gt; object is of &lt;code&gt;FloatingRateBond&lt;/code&gt; class, thus having an &lt;code&gt;IborIndex&lt;/code&gt; made up by an additional object of class &lt;code&gt;YieldTermStructure&lt;/code&gt;? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this take into consideration the &quot;new&quot; tenor due to the fact that in this simulation six months have passed? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks, &lt;/p&gt;&#xA;" OwnerUserId="3058" LastActivityDate="2013-09-06T07:43:46.920" Title="How to price a bond at specified dates in QuantLib" Tags="&lt;fixed-income&gt;&lt;pricing&gt;&lt;quantlib&gt;&lt;floating-rate&gt;&lt;term-structure&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8892" PostTypeId="2" ParentId="8860" CreationDate="2013-09-05T19:06:48.650" Score="0" Body="&lt;p&gt;Considering it is backtesting and ultra-performance is not very relevant**, I would suggest following good OOP principles:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;create a &lt;code&gt;BarData&lt;/code&gt; class which holds the fields you need (date, o, h, l, c, v etc.)&lt;/li&gt;&#xA;&lt;li&gt;store the &lt;code&gt;BarData&lt;/code&gt;s in an &lt;code&gt;ArrayList&amp;lt;BarData&amp;gt;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You can then store several time series in a &lt;code&gt;Map&amp;lt;String, List&amp;lt;BarData&amp;gt;&amp;gt;&lt;/code&gt; or a guava &lt;code&gt;MultiMap&amp;lt;String, BarData&amp;gt;&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That should make your life easier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ps: I don't know the IB API - if they have built-in types that look like my BarData then you sould as well use them directly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;**And note the the difference of performance between arrays and ArrayLists &lt;a href=&quot;https://stackoverflow.com/a/16565376/829571&quot;&gt;is not that big for most use cases&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2393" LastEditorUserId="-1" LastEditDate="2017-05-23T11:33:46.017" LastActivityDate="2013-09-05T20:14:40.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8893" PostTypeId="2" ParentId="8875" CreationDate="2013-09-05T21:41:08.837" Score="1" Body="&lt;p&gt;You can check the &lt;a href=&quot;http://en.wikipedia.org/wiki/Stationary_stochastic_process&quot; rel=&quot;nofollow&quot;&gt;wikipedia page&lt;/a&gt; to find out &quot;the the basic model assumptions&quot; for the a stationary random process, and I assume &quot;the correct reasoning on relationships&quot; are the model that describe a random process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But intuitively speaking, if the data are sampled from a stationary random process, then you can predict the future by deductively extrapolate the past data with more or less confidence (e.g. &lt;a href=&quot;http://en.wikipedia.org/wiki/Autoregressive_model&quot; rel=&quot;nofollow&quot;&gt;AR&lt;/a&gt;, which assumes stationary processes). Or if you have a model to describe the random process, then we can deduce the future based on the model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the process is not stationary and we don't have an appropriate model, it's much harder to do prediction. Techniques such as detrending can somewhat circumvent this problem under certain assumptions. For example, detrending by different assumes that trend is modeled by a function with finitely many non-zero derivatives, otherwise the trend cannot be removed by differencing. Detrending by different also assumes the fluctuation or noise (the remainder after detrending) is stationary, so we can predict based on the detrended data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An excellent introduction can be found &lt;a href=&quot;http://www.stat.cmu.edu/~cshalizi/uADA/13/lectures/ch25.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; (see 25.6).&lt;/p&gt;&#xA;" OwnerUserId="2712" LastActivityDate="2013-09-05T21:41:08.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8895" PostTypeId="2" ParentId="8891" CreationDate="2013-09-06T07:43:46.920" Score="6" Body="&lt;p&gt;There are two different issues at play here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One is that, of course, you want only the future cash flows to enter the calculation. This is taken care when you set the evaluation date to 6 months from today. In C++, you would say&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Settings::instance().evaluationDate() = today + 6*Months;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't remember the corresponding function in QuantLibXL, but you can look for some function with &quot;setEvaluationDate&quot; in its name or something similar. On the hand, the issue date of the bond has no effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second issue is how you manage the term structure, and that depends on what you want to do.  If, as I guess, you want to infer the future curve from today's one (so that, for instance, the spot 6-months rate on the new curve would be the forward 6-months to 1-year rate on today's curve) you can use&amp;mdash;at least in C++; I hope it's exported to Excel&amp;mdash;the &lt;code&gt;ImpliedTermStructure&lt;/code&gt; class. It takes your current curve and a reference date (in your case, today + 6M) and builds a new curve with the desired behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If, instead&amp;mdash;but I don't think it's your case, right?&amp;mdash;you wanted to move today's curve to the new date as it is (that is, so that the spot 6-months rate on the new curve equals the spot 6-months rate on the old one) this can be done by building the curve so that it moves with the evaluation date. It's usually done to calculate the theta numerically by moving everything ahead one day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above also applies to the floating-rate index and its forecast curve.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2013-09-06T07:43:46.920" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8896" PostTypeId="1" AcceptedAnswerId="8899" CreationDate="2013-09-06T08:23:50.140" Score="43" ViewCount="33058" Body="&lt;p&gt;Except Zipline, are there any other Pythonic algorithmic trading library I can choose?  Especially, for backtesting?&lt;/p&gt;&#xA;" OwnerUserId="6054" LastEditorUserId="7547" LastEditDate="2019-05-08T08:31:17.793" LastActivityDate="2019-05-08T08:31:17.793" Title="Except Zipline, are there any other Pythonic algorithmic trading library I can choose?" Tags="&lt;python&gt;&lt;backtesting&gt;&lt;algorithmic-trading&gt;" AnswerCount="14" CommentCount="2" FavoriteCount="67" ContentLicense="CC BY-SA 3.0" />
  <row Id="8897" PostTypeId="1" AcceptedAnswerId="8898" CreationDate="2013-09-06T08:41:24.263" Score="18" ViewCount="4228" Body="&lt;p&gt;I am looking for academic articles which model the p&amp;amp;L of market makers. I have read the Ho-Stoll (1984) article. Is there any recent article on this subject?&lt;/p&gt;&#xA;" OwnerUserId="6055" LastEditorUserId="2299" LastEditDate="2014-05-04T16:53:38.667" LastActivityDate="2015-02-15T14:19:00.843" Title="academic papers about market making" Tags="&lt;market-microstructure&gt;&lt;market-making&gt;&lt;research&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="28" ContentLicense="CC BY-SA 3.0" />
  <row Id="8898" PostTypeId="2" ParentId="8897" CreationDate="2013-09-06T15:08:36.797" Score="24" Body="&lt;p&gt;In fact you have three papers available to go further:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The &lt;a href=&quot;https://www.math.nyu.edu/faculty/avellane/HighFrequencyTrading.pdf&quot; rel=&quot;noreferrer&quot;&gt;Avellaneda-Stoikov&lt;/a&gt; one, with proper model and an approximate solution&lt;/li&gt;&#xA;&lt;li&gt;The &lt;a href=&quot;http://arxiv.org/abs/0902.2516&quot; rel=&quot;noreferrer&quot;&gt;Bayraktar-Ludvkosli&lt;/a&gt; one, with a solution for the linear utility function&lt;/li&gt;&#xA;&lt;li&gt;The &lt;a href=&quot;http://arxiv.org/abs/1105.3115&quot; rel=&quot;noreferrer&quot;&gt;L-Guéant-Fernandez&lt;/a&gt; one, with a full solution for a generic utility function&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I prefer the last one ;{)}&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="6175" LastEditDate="2015-02-15T14:19:00.843" LastActivityDate="2015-02-15T14:19:00.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8899" PostTypeId="2" ParentId="8896" CreationDate="2013-09-07T02:15:33.267" Score="27" Body="&lt;p&gt;Aside from &lt;a href=&quot;http://github.com/quantopian/zipline&quot;&gt;Zipline&lt;/a&gt;, there are a number of algorithmic trading libraries in various stages of development for Python. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the commercial side, &lt;a href=&quot;http://www.rapidquant.com/&quot;&gt;RapidQuant&lt;/a&gt; looks very interesting though I haven't tried it yet. It's from some of same developers that brought us the excellent  &lt;a href=&quot;http://pandas.pydata.org/&quot;&gt;Pandas&lt;/a&gt; data analysis library. I think Wes McKinney (Pandas's main author) is involved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the open source side, you might check out &lt;a href=&quot;https://code.google.com/p/ultra-finance/&quot;&gt;ultra-finance&lt;/a&gt;. It aims to be a fully featured event-driven based backtesting system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also check out &lt;a href=&quot;http://gbeced.github.io/pyalgotrade/&quot;&gt;PyaAlgoTrade&lt;/a&gt;. It's coded to allow for distributed testing of strategies on Google's cloud infrastructure. It incorporates the open source TA-Lib technical analysis library.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, take a look at &lt;a href=&quot;http://www.tradeprogrammer.com/features.php&quot;&gt;TradeProgrammer&lt;/a&gt;. It also uses the TA-Lib library. The package is free to use for backtesting, but its live trading version is commercial. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Aside from that, I think that many proprietary traders build their own systems. There is definitely something to be said for using a tool you understand on that level.&lt;/p&gt;&#xA;" OwnerUserId="5308" LastEditorUserId="5308" LastEditDate="2013-09-07T06:58:22.700" LastActivityDate="2013-09-07T06:58:22.700" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8900" PostTypeId="2" ParentId="8896" CreationDate="2013-09-07T10:19:34.960" Score="1" Body="&lt;p&gt;You can check also &lt;a href=&quot;http://wiki.quantsoftware.org/index.php?title=QuantSoftware_ToolKit&quot; rel=&quot;nofollow&quot;&gt;QSTK Wiki Page&lt;/a&gt; and &lt;a href=&quot;https://github.com/QuantSoftware/QuantSoftwareToolkit&quot; rel=&quot;nofollow&quot;&gt;QSTK GitHub page&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's an open source library developed by Georgia Tech and used in a Computational Investing course.&lt;/p&gt;&#xA;" OwnerUserId="4896" LastEditorUserId="4896" LastEditDate="2016-02-27T12:24:36.857" LastActivityDate="2016-02-27T12:24:36.857" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8901" PostTypeId="1" AcceptedAnswerId="8902" CreationDate="2013-09-08T17:12:38.780" Score="1" ViewCount="849" Body="&lt;p&gt;Where does CME store Security IDs for FIX messages? I cannot find them anywhere? So given Security ID XX I can go and work out what product this actually is?&lt;/p&gt;&#xA;" OwnerUserId="5168" LastEditorUserId="35" LastEditDate="2013-09-08T17:59:39.860" LastActivityDate="2013-09-08T17:59:39.860" Title="Where does CME store Security IDs for FIX messages?" Tags="&lt;data&gt;&lt;cme&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8902" PostTypeId="2" ParentId="8901" CreationDate="2013-09-08T17:35:11.430" Score="4" Body="&lt;p&gt;The SecurityID is in the &lt;a href=&quot;http://www.cmegroup.com/confluence/display/EPICSANDBOX/Market+Data+-+Security+Definition&quot; rel=&quot;nofollow&quot;&gt;Security Definition&lt;/a&gt; message (&lt;code&gt;35=d&lt;/code&gt;). This is reference data and is separate from the Incremental Refresh message (&lt;code&gt;35=X&lt;/code&gt;) that contains the live market data. You'll need to listen to a special IP address to get these messages. (See the &lt;a href=&quot;ftp://ftp.cmegroup.com/fix/Production/Configuration/config.xml&quot; rel=&quot;nofollow&quot;&gt;config file&lt;/a&gt; for the Instrument Replay.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Security Definition will tell you symbol, asset class, exchange, expiration, and anything else you may wish to know.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;It is also possible to statically get the &lt;a href=&quot;ftp://ftp.cmegroup.com/fix/Production/secdef.dat.gz&quot; rel=&quot;nofollow&quot;&gt;security definition file&lt;/a&gt;, but CME cautions against using this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This file is static and not refreshed throughout the trading day.  It should NOT BE USED as the primary source for Security Definition information.  Best practices require that CME Globex users obtain all Security Definition information from the Incremental Data channel or the Instrument Definition loop channel to ensure that intra-day instrument additions are not missed. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="35" LastEditorUserId="35" LastEditDate="2013-09-08T17:56:38.113" LastActivityDate="2013-09-08T17:56:38.113" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8904" PostTypeId="1" AcceptedAnswerId="14395" CreationDate="2013-09-10T07:07:49.193" Score="3" ViewCount="771" Body="&lt;p&gt;I already use QuickFixN to connect to FX ECNs, and am now looking to branch out into futures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Googling it, it seems as if there are a lot of 3rd party APIs which are written to do this, but is there any reason I wouldn't just use QuickFix and connect directly to the exchange?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously cost is one reason to use Quickfix, and from the looks of it some 3rd party APIs are &quot;pre-certified&quot;, which may be a reason to use them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How significant is this, and is there anything else I am missing?&lt;/p&gt;&#xA;" OwnerUserId="6068" LastActivityDate="2014-08-13T19:56:08.757" Title="Should I use QuickFix or a 3rd-party commercial API to connect to the CME" Tags="&lt;fix&gt;&lt;cme&gt;&lt;quickfix&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8908" PostTypeId="1" CreationDate="2013-09-10T19:07:29.547" Score="2" ViewCount="1380" Body="&lt;p&gt;One arbitrage strategy involves looking at the price of the Index Futures price compared with the prices of the options contracts for the underlyings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, can this arbitrage strategy still be performed when not all the underlyings have listed options contracts (like on the FTSE100)? Is there anything which can be done to account for the underlyings with no listed option contracts?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Would also be interested in the answer when not all underlyings having Futures contracts listed for an Index)&lt;/p&gt;&#xA;" OwnerUserId="5168" LastEditorUserId="35" LastEditDate="2013-09-10T20:40:58.413" LastActivityDate="2013-09-18T09:21:59.863" Title="Index arbitrage with Options when not all underlyings have options listed?" Tags="&lt;options&gt;&lt;quant-trading-strategies&gt;&lt;automated-trading&gt;&lt;arbitrage&gt;" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8910" PostTypeId="2" ParentId="8908" CreationDate="2013-09-11T01:28:39.023" Score="4" Body="&lt;p&gt;&lt;em&gt;Is there anything which can be done to account for the underlyings with no listed option contracts?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Classical options pricing theory relies on the idea that any option contract can be simulated with the appropriate dynamic hedging strategy.  Options pricing &lt;em&gt;practice&lt;/em&gt; indicates that this is sort-of true.  So one thing you can do is synthesize the given options by dynamically trading the given equities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another common approach is to trade options in closely related companies, with extra hedges to account for the difference.  But, you have a more serious problem here....&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are considering this an &quot;arbitrage&quot; strategy without (apparently) taking into account the key difference between a FTSE option and the component options, namely that the former is an option on a portfolio with correlated elements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The FTSE option value will increase with increasing correlation, even if individual component volatilities remain unchanged.  The two-element version with log returns $A_{1,2}$ and correlation $\rho$ shows why:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Var}\left(\alpha_1 A_1 + \alpha_2 A_2\right) = \text{Var}\left(\alpha_1 A_1\right) +  \text{Var}\left(\alpha_2 A_2\right) + \rho \sqrt{\text{Var}\left(\alpha_1 A_1\right)   \text{Var}\left(\alpha_2 A_2\right)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value of an option position increases with increasing variance of its underlying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, a position in FTSE options hedged with individual equity options is considered a long (or short) correlation play, and certainly not an arbitrage strategy.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2013-09-11T01:28:39.023" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8911" PostTypeId="1" AcceptedAnswerId="8912" CreationDate="2013-09-11T08:30:37.333" Score="10" ViewCount="5651" Body="&lt;p&gt;I have often seen the following statement in different paper:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;As $\sigma$ is homogeneous and of degree 1, we use Euler decomposition and write $\sigma(x)=\sum_{i=1}^n x_i \frac{\partial \sigma(x)}{\partial x_i}$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The thing is, I am trying to find on wikipedia where this comes from and I can't quite find it. Could someone point me to a reference where this Euler decomposition is explained or give me a brief explanation here?&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2013-09-11T12:02:00.840" Title="What is exactly Euler's decomposition?" Tags="&lt;mathematics&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="8912" PostTypeId="2" ParentId="8911" CreationDate="2013-09-11T09:39:58.763" Score="15" Body="&lt;p&gt;A function $f : \mathbb R^n\backslash\{0\} →\mathbb R$ is called (positive) homogeneous of degree $k$ if&#xA;$$f(\lambda \mathbf x) = \lambda^k f(\mathbf x) \,$$ &#xA;for all $\lambda &amp;gt; 0$. Here $k$ can be any complex number.  The homogeneous functions are characterized by &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Euler's Homogeneous Function Theorem.&lt;/strong&gt; &lt;em&gt;Suppose that the function $f : \mathbb R^n \backslash\{0\} →\mathbb R$ is continuously differentiable. Then $f$ is homogeneous of degree $k$ if and only if&#xA; $$\mathbf{x} \cdot \nabla f(\mathbf{x})\equiv \sum_{i=1}^nx_i\frac{\partial f}{\partial x_i} = kf(\mathbf{x}).$$&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The result follows at once by differentiating both sides of the equation $f(\lambda \mathbf x) = \lambda^k f(\mathbf x)$ with respect to $\lambda$, applying the chain rule, and choosing $\lambda=1$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The converse holds by integrating. Specifically, let $\phi(\lambda) = f(\lambda \mathbf{x})$. Since $\lambda \mathbf{x} \cdot \nabla f(\lambda\mathbf{x})= k f(\lambda \mathbf{x})$, we have that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\phi'(\lambda)&#xA;= \mathbf{x} \cdot \nabla f(\lambda \mathbf{x})&#xA;= \frac{k}{\lambda} f(\lambda \mathbf{x})&#xA;= \frac{k}{\lambda} \phi(\lambda).$$&#xA;Thus, $\phi'(\lambda) - \frac{k}{\lambda} \phi(\lambda) = 0.$ This implies $ \phi(\lambda) = \phi(1) \lambda^k$. Therefore, $$f(\lambda \mathbf{x}) = \phi(\lambda) = \lambda^k \phi(1) = \lambda^k f(\mathbf{x}),$$ so $f$ is homogeneous of degree $k$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit.&lt;/strong&gt; Contrary to popular belief, there exist &lt;em&gt;nonlinear&lt;/em&gt; homogeneous functions of degree $1$, e.g. &#xA;$$f(\mathbf x)=\sqrt{\sum_{i=1}^n x_i^2}.$$&lt;/p&gt;&#xA;" OwnerUserId="70" LastEditorUserId="70" LastEditDate="2013-09-11T12:02:00.840" LastActivityDate="2013-09-11T12:02:00.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8914" PostTypeId="1" AcceptedAnswerId="8946" CreationDate="2013-09-11T11:29:54.717" Score="4" ViewCount="752" Body="&lt;p&gt;For my master thesis, I need high-frequency data with the market participant ID or which identifies the trading parties, respectively. I don't need the entire orderbook but just the matched orders with a trade direction. I've found LOBSTER so far, which has no MPID though, and tradingphysics, whose Times&amp;amp;Sales dataset would be perfect, if the MPID wouldn't be missing for most of the trades. In existig papers researches either use a special dataset which identifies HFT traders directly or use proxies to identify them.&#xA;If you could give me a hint where to get such kind of data, that would be great.&lt;/p&gt;&#xA;" OwnerUserId="6073" LastActivityDate="2015-02-21T07:04:41.427" Title="Transaction Data with Participant ID" Tags="&lt;time-series&gt;&lt;high-frequency&gt;&lt;market-data&gt;&lt;econometrics&gt;&lt;tick-data&gt;" AnswerCount="3" CommentCount="12" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8915" PostTypeId="1" CreationDate="2013-09-12T01:22:08.983" Score="1" ViewCount="1354" Body="&lt;p&gt;Suppose I have a Po with one long, one short positions and some cash (to balance the short + 50% margin) as shown below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;        Begin$     Weight%    Returns %   Port Contrib %&#xA;&#xA;ABC        6675  2.883182515     -0.29963        -0.008638749&#xA;&#xA;&#xA;CBA      -449680   -194.233635     70.31751      -136.5802588&#xA;Cash      674520    291.3504525    0.00011     0.000319288&#xA;&#xA;Total     231515      100                         -136.5885783%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that the return of my portfolio is negative (-136.58) and my market value is positive. My question is for a case like this how can I calculate the return over multiple periods, especially if for the rest of the periods the returns are positive? I tend to believe that the usual solution, which is compounding of all sub period portfolio returns may not work anymore?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks  &lt;/p&gt;&#xA;" OwnerUserId="5821" LastActivityDate="2013-09-12T01:22:08.983" Title="Long/Short portfolio return" Tags="&lt;returns&gt;&lt;longshort&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8916" PostTypeId="1" CreationDate="2013-09-12T08:32:02.777" Score="1" ViewCount="118" Body="&lt;p&gt;Assume a portoflio $w \in \mathbb{R}^n$, you can get the total risk contribution $\psi_i$ of asset $i$ by doing:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\psi_i = w_i \frac{\partial \sigma(w)}{\partial w_i}= \frac{1}{\sigma(w)} \left[ w_i^2 \sigma_i^2 + \sum_{j=1}^n w_i w_j \sigma_{i,j} \right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I can define a function $\Psi(x): \mathbb{R}^n \rightarrow \mathbb{R}^n$ which computes the contributions of a given portfolio $x$, and I will always find a unique answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My equation is, assume I have a set of risk contributions $\overrightarrow{\psi}=\{\psi_1, ... ,\psi_n\}$ , I'm looking to see whether $w^*=\Psi^{-1} \left( \overrightarrow{\psi} \right)$ is unique if it exists. In other words, I'm trying to see whether $\Psi(x)$ is &lt;em&gt;injective&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you know if the proof of such statement exists, or how would you tackle the problem because the only thing I can think about now is to look at the $n$ nonlinear equations system with $n$ variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I worked a bit on the problem and managed to formulate it as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have to show that $\nexists u,v \in \mathbb{R}^n$ such that $u \neq v$ and:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \sigma_i^2 (u_i^2-v_i^2) + \sum_{j=1, i\neq j}^n \sigma_{i,j} (u_i-vi) = 0 \quad \forall i$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I managed to prove this for $n=2$ and $u_1+u_2=v_1+v_2=1$, but I'm struggling to prove it for $n$ assets. I tried by recurrence but the fully invested constraint prevents me from doing so...&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2013-09-13T13:45:57.490" LastActivityDate="2013-09-13T13:45:57.490" Title="How to show that the risk contribution function is or is not injective?" Tags="&lt;risk-management&gt;&lt;mathematics&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8917" PostTypeId="2" ParentId="8170" CreationDate="2013-09-12T09:23:28.343" Score="3" Body="&lt;p&gt;It obviously depends on what you're trying to do but since we're speaking about returns zero centering is what's usually done because of the null hypothesis claiming that expected excess returns are zero. You zero center the distribution because you want to obtain a distribution satisfying the null hypothesis. In this distribution you then plug your sample mean and get a p-value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This comes in handy in performance evaluation. It's what Aronson does in &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470008741&quot; rel=&quot;nofollow&quot;&gt;Evidence Based Technical Analysis&lt;/a&gt; when measuring the significance of the observed profits. It's also what White does in &lt;a href=&quot;http://www.ssc.wisc.edu/~bhansen/718/White2000.pdf&quot; rel=&quot;nofollow&quot;&gt;A Reality Check for Data Snooping&lt;/a&gt; when calculating the p-value for each model. White calculates for example those two V-values. For a single model you have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\bar V_1 = n^{1/2} \bar f_1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is basically the sample mean (see the paper if you don't get the $n^{1/2}$ value) and you also have the bootstrapped distribution&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\bar V_{1,i}^* = n^{1/2} (\bar f_{1,i}^* - \bar f_1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which as you can see is zero centered through mean subtraction. The p-value is then obtained by plugging in $\bar V_1$ in the $\bar V_{1,i}^*$ distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also wouldn't say this adds any forward looking bias as you're not using the mean information to make any kind of decision. You're simply trying to determine whether the observed returns over a certain period beat the expected returns of a random strategy.&lt;/p&gt;&#xA;" OwnerDisplayName="user5399" LastActivityDate="2013-09-12T09:23:28.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8918" PostTypeId="1" CreationDate="2013-09-12T17:01:46.960" Score="6" ViewCount="878" Body="&lt;p&gt;Consider the following m regression equation system:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r^i = X^i \beta^i + \epsilon^i \;\;\; \text{for}  \;i=1,2,3,..,n$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $r^i$ is a $(T\times 1)$ vector of the T observations of the dependent variable, $X^i$ is a $(T\times k)$ matrix of independent variables, $\beta^i$ is a $(k\times1)$ vector of the regression coefficients and $\epsilon^i$ is the vector of errors for the $T$ observations of the $i^{th}$ regression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: in order to test the validity of this model for stock returns (i.e. the inclusion of those explanatory variables) using AIC or BIC criterion,  should these criterion be computed on a time-series basis (i.e. for each stock), or on a cross-sectional basis (and then averaged over time)?&lt;/p&gt;&#xA;" OwnerUserId="5896" LastEditorUserId="5896" LastEditDate="2013-09-13T12:26:36.973" LastActivityDate="2014-12-20T13:12:12.737" Title="Testing the validity of a factor model for stock returns" Tags="&lt;equities&gt;&lt;returns&gt;&lt;regression&gt;&lt;factor-models&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8922" PostTypeId="1" CreationDate="2013-09-13T10:38:20.993" Score="2" ViewCount="91" Body="&lt;p&gt;I am using Pareto distribution to fit a serie of survival rates (with least square). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My ultimate goal is to use this fitting curve for prediction. Thus I would mainly focus on the tail of the fitting curve. In other words, I need to define the &quot;tail&quot; first, and in case my survival rate serie is a time serie, I'd call it &quot;window period&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I've never done curve fitting before, thus have no idea what is the best choice for such a window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone clue me how can I achieve my goal? Appologies if I'm asking something simple.&lt;/p&gt;&#xA;" OwnerUserId="6082" LastActivityDate="2013-09-13T10:38:20.993" Title="How to choose a window for curve fitting and prediction?" Tags="&lt;distribution&gt;&lt;prediction&gt;&lt;curve-fitting&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8924" PostTypeId="1" CreationDate="2013-09-13T14:37:24.110" Score="0" ViewCount="90" Body="&lt;p&gt;In the paper &quot;Economic Forces and the Stock Market&quot; by Chen, Roll and Ross, unanticipated risk premium (URP) is tested as a potential risk factor for stock returns. This factor is commonly calculated as the difference between the return on a low-grade bond index and the return on a portfolio of long-term government bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in this paper, there is no mention as to what &lt;em&gt;type&lt;/em&gt; of return is used to compute URP. Any guess as to whether it would be Month-to-date total return, Yield to maturity, ...?&lt;/p&gt;&#xA;" OwnerUserId="5896" LastEditorUserId="5896" LastEditDate="2013-09-13T15:38:19.013" LastActivityDate="2013-09-13T15:38:43.857" Title="Input for unanticipated risk premium estimation" Tags="&lt;fixed-income&gt;&lt;spread&gt;&lt;risk-premium&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8925" PostTypeId="1" CreationDate="2013-09-13T15:41:46.853" Score="8" ViewCount="475" Body="&lt;p&gt;PCA is sometimes used to estimate components in the rates term structure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any other standard method discussed in the literature or used in practice, what are their advantages and disadvantages ?&lt;/p&gt;&#xA;" OwnerUserId="2908" LastEditorUserId="2587" LastEditDate="2013-09-18T08:56:18.537" LastActivityDate="2014-04-16T12:21:46.283" Title="Are there any other standard rates term structure decomposition than PCA?" Tags="&lt;interest-rates&gt;&lt;pca&gt;&lt;term-structure&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8926" PostTypeId="1" CreationDate="2013-09-14T11:20:00.923" Score="4" ViewCount="1465" Body="&lt;p&gt;I am trying to find whether there is significant volatility transmission between two price series (t=1000). A literature review learned me that the GARCH BEKK model is suitable for this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The SAS package can estimate it, see &lt;a href=&quot;http://support.sas.com/documentation/cdl/en/etsug/63939/HTML/default/viewer.htm#etsug_varmax_sect037.htm&quot; rel=&quot;nofollow&quot; title=&quot;user guide&quot;&gt;user guide&lt;/a&gt;&#xA;However, I am getting strange results. Now I am in doubt about whether I am doing this the right way. I thought I should just make sure the series are stationary by first differencing them and afterwards, I can directly put them into the GARCH BEKK model by SAS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;proc varmax data=price-series;&#xA;model series1 series2; &#xA;garch q=1 p=1 form=bekk;&#xA;run;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which steps am I overlooking?&lt;/p&gt;&#xA;" OwnerUserId="6094" LastEditorUserId="848" LastEditDate="2013-09-14T11:36:53.187" LastActivityDate="2013-10-11T02:23:03.467" Title="Fitting a GARCH BEKK model" Tags="&lt;volatility&gt;&lt;garch&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8928" PostTypeId="2" ParentId="8883" CreationDate="2013-09-14T12:12:21.437" Score="1" Body="&lt;p&gt;The reason is because the parameter alpha (commissions + half the bid-ask spread) has to be changed for each portfolio ! For a same initial (and high) capital, the bid-ask spread estimate is going to be much higher for a highly concentrated portfolio with one stock than with a portfolio with 20 stocks. That means the expected impact on the P&amp;amp;L is going to be more negative than what was shown in the previous plot, and we thus get a lower liquidity score.       &lt;/p&gt;&#xA;" OwnerUserId="3319" LastActivityDate="2013-09-14T12:12:21.437" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8929" PostTypeId="2" ParentId="8925" CreationDate="2013-09-14T18:40:10.693" Score="2" Body="&lt;p&gt;Nelson Siegel seems to be pretty standard too&lt;/p&gt;&#xA;" OwnerUserId="6097" LastActivityDate="2013-09-14T18:40:10.693" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8931" PostTypeId="1" AcceptedAnswerId="17557" CreationDate="2013-09-15T13:34:09.687" Score="12" ViewCount="515" Body="&lt;p&gt;Say for example I have the following company in some specialized industry:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A - Company that is about to be listed in Exchange 1, i.e., no price history &lt;/p&gt;&#xA;&#xA;&lt;p&gt;B - Company that produce similar products as Company A, listed on Exchange 1 as well, however B has very thin volume and price could stay the same for weeks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;C - Similar to company A but listed on Exchange 2, again, thin trading volume&lt;/p&gt;&#xA;&#xA;&lt;p&gt;D - Similar to company B but listed on Exchange 2, also thin trading volume&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For companies B, C and D, I have their historical EOD price for the past two years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Exchange 1 and 2 are listed in different continents and there is very little correlation between the two, also, there is no index for this industrial sector. (However the price between company C&amp;amp;D and A&amp;amp;B should be correlated). Also, we can not assume the price time series is non-stationary as the products those company produce could be seasonal in nature.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to figure out the &quot;correct&quot; market price for Company A before it is listed, based on the information above. And my results so far shows that each of the price time series that I have has a different ARIMA model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, my question is how can I tackle these price data to start my analysis? Bearing in mind that those are all the data I have and can get. &lt;/p&gt;&#xA;" OwnerUserId="3595" LastActivityDate="2015-05-27T17:56:29.550" Title="Time series analysis on illiquid price data?" Tags="&lt;time-series&gt;&lt;historical&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8932" PostTypeId="1" CreationDate="2013-09-16T15:25:06.767" Score="3" ViewCount="227" Body="&lt;p&gt;Is there a quant model that can help estimate how much slippage one would have to give up in order to get an &quot;option spread&quot; (vertical, butterflies, etc.) order executed?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What factors should one look at in building such a model? For instance, some factors that would impact whether a &quot;butterfly spread&quot; would get executed may include:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;NBBO bid / ask spread of individual legs across exchanges &lt;/li&gt;&#xA;&lt;li&gt;bid / ask spread of individual legs (all legs at given exchange (ISE, CBOE))&lt;/li&gt;&#xA;&lt;li&gt;greeks of options spread (delta, gamma, theta, vega)&lt;/li&gt;&#xA;&lt;li&gt;percent change in underlying instrument&lt;/li&gt;&#xA;&lt;li&gt;percent change in volatility&lt;/li&gt;&#xA;&lt;li&gt;volume / open interest at strikes&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;What other factors would one look at? How would one build a quant. model to estimate pre-trade slippage costs for option spreads?&lt;/p&gt;&#xA;" OwnerUserId="6108" LastEditorUserId="35" LastEditDate="2013-09-16T15:28:31.813" LastActivityDate="2013-09-16T15:28:31.813" Title="Pre-Trade Slippage Costs For Option Spread Execution" Tags="&lt;options&gt;&lt;spread&gt;&lt;slippage&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8933" PostTypeId="1" CreationDate="2013-09-16T15:28:27.007" Score="4" ViewCount="611" Body="&lt;p&gt;I am trying to find out Historical Alphas of a bunch of fund returns ${F_i}$ by Using Regression Model$(stepwise)$ with regressors as its underlying exposure-returns(risk-free rate subtracted) i.e. &#xA;$$&#xA;\mathrm{E_i = X_i-R_f}&#xA;$$&#xA;$$&#xA;\mathrm{F_i} = {a_i + \beta_{1i}E_{1}+\beta_{2i}E_{2}...} &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, I assume that this regression model is representative of a Multi-factor CAPM model and the obtained ${\beta_i}$ are the CAPM-${\beta}$ i.e. systemic risk of ${F_i}$ w.r.t. ${E_i}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, I use these models to calculate average historical ${\alpha_i}$ which is excess return for fund ${F_i}$ using below formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\mathrm{\alpha_i} = avg({F_i - F_i^{estimated})} &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this simplistic approach correct, if not, what is the correct way?&lt;/p&gt;&#xA;" OwnerUserId="2011" LastEditorUserId="2011" LastEditDate="2013-09-18T16:23:15.970" LastActivityDate="2013-09-18T16:23:15.970" Title="Is this methodology to calculate Alpha using multi-factor regression model correct?" Tags="&lt;statistics&gt;&lt;factor-models&gt;&lt;capm&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8935" PostTypeId="1" CreationDate="2013-09-16T20:39:35.843" Score="-1" ViewCount="1227" Body="&lt;p&gt;How exactly would I go about investigating whether the S&amp;amp;P 500 stocks were currently over-valued compared with the price of the S&amp;amp;P 500 Index futures contract? Is it just a case of taking each S&amp;amp;P 500 stock price, ratio-ing it down using its S&amp;amp;P 500 constituent weighting and then summing them all up and comparing the number with the Index futures price?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any small examples would be most welcome&lt;/p&gt;&#xA;" OwnerUserId="5168" LastActivityDate="2013-09-16T22:29:44.807" Title="Calculating arbitrage- S&amp;P 500 stocks vs S&amp;P 500 Index future?" Tags="&lt;automated-trading&gt;&lt;futures&gt;&lt;derivatives&gt;&lt;arbitrage&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8936" PostTypeId="2" ParentId="8935" CreationDate="2013-09-16T22:29:44.807" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Futures_contract#Arbitrage_arguments&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Futures_contract#Arbitrage_arguments&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;S(t) is the value of the index. Arb opportunity opens when you can buy (sell) the stocks (typically done with a representative basket of stocks) against the future for less (more), of course adding (subtracting) the cost of carry of the stocks.&lt;/p&gt;&#xA;" OwnerUserId="5092" LastActivityDate="2013-09-16T22:29:44.807" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8939" PostTypeId="2" ParentId="8908" CreationDate="2013-09-18T09:21:59.863" Score="0" Body="&lt;p&gt;it looks like you're talking about arbitraging options on multiple stocks vs options on the futures. if you can't buy options on some of the component stocks, you'd need to substitute for related stocks with high correlation (so that you are overall vega flat) and hope for the best&lt;/p&gt;&#xA;" OwnerUserId="6118" LastActivityDate="2013-09-18T09:21:59.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8942" PostTypeId="1" AcceptedAnswerId="8944" CreationDate="2013-09-18T12:38:10.533" Score="1" ViewCount="652" Body="&lt;p&gt;In &lt;strong&gt;QuantLib&lt;/strong&gt; an object of class &lt;a href=&quot;http://quantlib.org/reference/class_quant_lib_1_1_schedule.html&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;Schedule&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; takes const &lt;a href=&quot;http://quantlib.org/reference/class_quant_lib_1_1_period.html&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;Period&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; &lt;code&gt;&amp;amp;tenor&lt;/code&gt; as argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to know what that &lt;code&gt;tenor&lt;/code&gt; is supposed to be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let I would like to price a floating rate bond (that is, to use the &lt;code&gt;Schedule&lt;/code&gt; object as argument for &lt;a href=&quot;http://quantlib.org/reference/class_quant_lib_1_1_floating_rate_bond.html&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;FloatingRateBond&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; object) which pays quarterly EURIBOR every &lt;strong&gt;two&lt;/strong&gt; months: from what I've read so far, the quarterly EURIBOR (forward) rate is set through an &lt;a href=&quot;http://quantlib.org/reference/class_quant_lib_1_1_ibor_index.html&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;IborIndex&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; class object while I'm not sure of how I can set the payment frequency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe I should use that &lt;code&gt;Schedule&lt;/code&gt; argument (&lt;code&gt;tenor = &quot;2M&quot;&lt;/code&gt; here)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S.: in order to avoid too many questions regarding &lt;strong&gt;QuantLib&lt;/strong&gt; here, I'm looking for some reference which explain topics like the one of this question, that is, the natural language definition of classes' and methods' arguments. Can you suggest me any source suitable to this purpose?&lt;/p&gt;&#xA;" OwnerUserId="3058" LastEditorUserId="3058" LastEditDate="2013-09-18T19:25:55.540" LastActivityDate="2013-09-18T22:01:22.507" Title="Definition of &quot;tenor&quot; argument in QuantLib's Schedule class object" Tags="&lt;quantlib&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8943" PostTypeId="1" AcceptedAnswerId="15102" CreationDate="2013-09-18T17:11:52.980" Score="3" ViewCount="2036" Body="&lt;p&gt;Sharpe's Return-Based Style Analysis is an interesting theory but flawed in practice when working with long-short funds or funds that are changing strategies over shorter periods of time due to the limits of linear regression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have found a few papers looking into improvements to make the calculations more robust &#xA;Markov, Muchnik, Krasotkina, Mottl (2006) seems fairly reasonable for instance.  However, they commonly only deal with the time-varying beta issue.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering if there was anyone out there doing work on the limitations of linear regression for style analysis.  I particular more robust variance-covariance matrices for the minimization of the objective function.&lt;/p&gt;&#xA;" OwnerUserId="5689" LastActivityDate="2014-10-20T21:42:41.170" Title="Robust Returns-Based Style Analysis" Tags="&lt;factor-models&gt;&lt;performance-evaluation&gt;&lt;factor-loading&gt;&lt;robust-optimization&gt;" AnswerCount="4" CommentCount="12" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8944" PostTypeId="2" ParentId="8942" CreationDate="2013-09-18T22:01:22.507" Score="3" Body="&lt;p&gt;&lt;em&gt;Tenor&lt;/em&gt; is just a different term for &lt;em&gt;time to maturity&lt;/em&gt;. A schedule is generated from &lt;em&gt;startDate&lt;/em&gt; and &lt;em&gt;endDate&lt;/em&gt; in combination with a time to maturity and some info on calendar specifics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example from Dimitri Reiswich' Presentation from &lt;a href=&quot;http://quantlib.org/slides/dima-ql-intro-1.pdf&quot; rel=&quot;nofollow&quot;&gt;quantlib.com&lt;/a&gt;, I hope it makes the use of schedule clearer to you:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;void testingSchedule1 (){&#xA;Date begin (30 , September ,2009) , end (15 , Jun ,2012);&#xA;Calendar myCal = Japan ();&#xA;BusinessDayConvention bdC= BusinessDayConvention ( Following );&#xA;Period myTenor (6, Months );&#xA;DateGeneration :: Rule myRule = DateGeneration :: Forward ;&#xA;Schedule mySched (begin ,end , myTenor ,myCal ,bdC ,bdC , myRule , true );&#xA;std :: vector &amp;lt;Date &amp;gt; finalSched = mySched . dates ();&#xA;BOOST_FOREACH ( Date d, finalSched ) std :: cout &amp;lt;&amp;lt; d &amp;lt;&amp;lt; std :: endl ;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which generates the following dates:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;September 30th, 2009&#xA;March 31st, 2010&#xA;September 30th, 2010&#xA;March 31st, 2011&#xA;September 30th, 2011&#xA;March 30th, 2012&#xA;June 15th, 2012&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see, your assumption is actually right - the schedule contains all the payment dates. The Input you need to give it simply&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Period myTenor (2, Months );&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;General info on classes&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are looking for something that specifically deals with design patterns for finance, I recommend &lt;a href=&quot;http://www.amazon.de/Patterns-Derivatives-Pricing-Mathematics-Finance/dp/0521721628/ref=sr_1_1?ie=UTF8&amp;amp;qid=1379541249&amp;amp;sr=8-1&amp;amp;keywords=mark%20joshi&quot; rel=&quot;nofollow&quot;&gt;Mark Joshis Book on that topic&lt;/a&gt;. But, be warned, its pretty hard for C++ Newbies, the finance part is actually quite easy. Otherwise, I think you should look into &lt;em&gt;Design Patterns&lt;/em&gt; in general, unfortunately the only book I've actually read about those is the Heads First book, I really cannot recommend those provided you're older than 12.&lt;/p&gt;&#xA;" OwnerUserId="1976" LastActivityDate="2013-09-18T22:01:22.507" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8945" PostTypeId="1" CreationDate="2013-09-19T14:46:35.677" Score="3" ViewCount="1808" Body="&lt;p&gt;I know the algorithm used by Excel to calculate the YEARFRAC(startDate, endDate, basis) for basis=1. Excel calls the method &quot;act/act&quot;. A Java re-implentation of Excel's algorithm can be found at &lt;a href=&quot;http://svn.finmath.net/finmath%20lib/trunk/src/main/java/net/finmath/time/daycount/DayCountConvention_ACT_ACT_YEARFRAC.java&quot; rel=&quot;nofollow&quot;&gt;finmath.net&lt;/a&gt; together with a &lt;a href=&quot;http://finmath.net/topics/daycountingandschedules/&quot; rel=&quot;nofollow&quot;&gt;spreadsheet comparing several day count conventions&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It appears as if Excel does not implement &quot;ACT/ACT AFB&quot; and definitely the method is not &quot;ACT/ACT ISDA&quot; (which is the most common one I assume).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know all the algorithms (see also &lt;a href=&quot;http://www.christian-fries.de/blog/files/2013-yearfrac.html&quot; rel=&quot;nofollow&quot;&gt;Implementation of the YEARFRAC&lt;/a&gt;). I just have the simple question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the name of Excel's algorithm?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or is it just &quot;Microsoft's proprietary ACT/ACT&quot;.&lt;/p&gt;&#xA;" OwnerUserId="3548" LastActivityDate="2015-03-09T16:40:37.793" Title="Which method is implemented by Excel's YEARFRAC for ACT/ACT?" Tags="&lt;programming&gt;&lt;excel&gt;&lt;daycounting&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8946" PostTypeId="2" ParentId="8914" CreationDate="2013-09-19T15:08:37.517" Score="3" Body="&lt;p&gt;Market participant ID data is extremely unlikely to be available without the collaboration of regulators and the exchange itself, as it is a closely guarded information. Even &quot;anonymized&quot; data with no reference to a specific firm could reveal private information to informed market participants. If obtained at all, it is likely to come with draconian restrictions on access, granularity and publication of results. For example, I know of an official sector researcher who had to keep his entire research project secret for over a year before the legal and regulatory hurdles were cleared &lt;em&gt;even though he already had the data in his possession&lt;/em&gt;. Good datasets for any period of time greater than a day are also likely to be costly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My advice to you is to contact someone who did research with similar data and find out if there would be a way to find access it in one way or another. Talk to professors in your institution, they may very well be in contact with someone who fits the profile.&lt;/p&gt;&#xA;" OwnerUserId="5120" LastActivityDate="2013-09-19T15:08:37.517" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8947" PostTypeId="1" AcceptedAnswerId="8949" CreationDate="2013-09-19T15:19:37.990" Score="2" ViewCount="1308" Body="&lt;p&gt;Due to the periodic fixing of floating rate bonds's coupon rates, in order to calculate the bond clean price one must tell the pricing engine to account for previous LIBOR rate fixing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I am right (I'm a very &lt;strong&gt;QuantLib&lt;/strong&gt; noob), &lt;a href=&quot;http://quantlib.org/reference/_bonds_8cpp-example.html#_a41&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;here&lt;/strong&gt;&lt;/a&gt; is an example of how it works: in the &lt;code&gt;BONDS TO BE PRICED&lt;/code&gt; chapter you can see&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;...&#xA;libor3m-&amp;gt;addFixing(Date(17, July, 2008),0.0278625);&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which says that the last fixing date was on 17 July 2008 and the rate fixed by the central bank was equal to $2.79\%$ on annual basis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let you are using &lt;strong&gt;QuantLibXL&lt;/strong&gt;'s &lt;a href=&quot;http://quantlib.org/quantlibxl/func_index.html#qlIndexAddFixings&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;qlIndexAddFixings()&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; to practically make the same of the &lt;code&gt;C++&lt;/code&gt; code (the fixing will then be used as trigger in &lt;a href=&quot;http://quantlib.org/quantlibxl/func_bonds.html#qlBondSetCouponPricer&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;qlBondSetCouponPricer()&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt;) but you're playing with the evaluation date and a dozen of bonds: in this case you cannot specify the fixings by hand, neither you need a true past value but just something which sounds likely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make the fixing of every bond to be equal to a default value whatever the bond and the evaluation date without setting it by hand?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be possibly sufficient a way to extract the required last fixing date from a &lt;code&gt;FloatingRateBond&lt;/code&gt; object.&lt;/p&gt;&#xA;" OwnerUserId="3058" LastEditorUserId="3058" LastEditDate="2013-09-19T16:12:56.087" LastActivityDate="2013-09-19T21:25:37.850" Title="Automatic fixing of missing floating rate in QuantLib's addFixing()" Tags="&lt;fixed-income&gt;&lt;quantlib&gt;&lt;floating-rate&gt;&lt;libor&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8948" PostTypeId="2" ParentId="848" CreationDate="2013-09-19T20:26:52.507" Score="1" Body="&lt;p&gt;Start with simple things like Pearson correlation, e.g.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/0iDRP.png&quot; alt=&quot;enter image description here&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/jOzq1.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="1868" LastActivityDate="2013-09-19T20:26:52.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8949" PostTypeId="2" ParentId="8947" CreationDate="2013-09-19T21:25:37.850" Score="4" Body="&lt;p&gt;I think to have the answer:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;use &lt;a href=&quot;http://quantlib.org/quantlibxl/func_bonds.html#qlBondPreviousCashFlowDate&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;qlBondPreviousCashFlowDate()&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; pointing at your &lt;code&gt;FloatingRateBond&lt;/code&gt; object to get the last date of payment;&lt;/li&gt;&#xA;&lt;li&gt;use &lt;a href=&quot;http://quantlib.org/quantlibxl/func_index.html#qlInterestRateIndexFixingDate&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;qlInterestRateIndexFixingDate()&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; to get the fixing date referring to the last payment date;&lt;/li&gt;&#xA;&lt;li&gt;use &lt;a href=&quot;http://quantlib.org/quantlibxl/func_index.html#qlIndexAddFixings&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;qlIndexAddFixings()&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; to add a fixing rate to the fixing date you got above;&lt;/li&gt;&#xA;&lt;li&gt;repeat for each one of your bonds if they share the same &lt;code&gt;IborIndex&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So far I've tried this proceedings using several evaluation dates amended through &lt;a href=&quot;http://quantlib.org/quantlibxl/func_calendar.html#qlCalendarAdvance&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;qlCalendarAdvance()&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; (TARGET calendar) just with the &lt;code&gt;Bonds.xls&lt;/code&gt; spreadsheet, but spacing from 2M to 12M in the future doesn't give any issue and the pricing engine has always been able to find a price for the floating rate bond of the example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S.: if someone familiar with the &lt;code&gt;C++&lt;/code&gt; version wanted to explain the proceedings in that language, I'm sure it would be really appreciated.&lt;/p&gt;&#xA;" OwnerUserId="3058" LastActivityDate="2013-09-19T21:25:37.850" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8950" PostTypeId="1" CreationDate="2013-09-19T23:50:45.403" Score="2" ViewCount="85" Body="&lt;p&gt;I've been trying to find a formula to obtain the maximum relative error a trinomial model with n timesteps will incur given all other inputs as compared to the standard BSM model. I'm concerned mostly about american options but I'm thinking early exercise of the american options will only lead to more accurate estimates of the value of the option so I'm not worried about the differences between euro/am options. If such a formula for the maximum relative error does not exist any method to try and estimate the error would work. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="5092" LastActivityDate="2013-09-19T23:50:45.403" Title="Calculating the error of a Trinomial Model" Tags="&lt;black-scholes&gt;&lt;models&gt;&lt;error&gt;&lt;lattice&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8952" PostTypeId="1" AcceptedAnswerId="8955" CreationDate="2013-09-20T20:28:05.953" Score="8" ViewCount="4262" Body="&lt;p&gt;I am trying to find out what is the purpose of &quot;repeating groups&quot; in FIX and what exactly do they represent? Are they all related to the same order and if so, why do you need repeated tags? If they aren't related to the first order wouldnt it be easier to send in a separate message? Is it just all orders at that exact time frame which are grouped together, hence the repeating groups?&lt;/p&gt;&#xA;" OwnerUserId="5168" LastActivityDate="2015-08-05T08:57:47.480" Title="FIX- what exactly do repeating groups represent?" Tags="&lt;limit-order-book&gt;&lt;algorithmic-trading&gt;&lt;fix&gt;&lt;electronic-trading&gt;" AnswerCount="6" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8953" PostTypeId="2" ParentId="8952" CreationDate="2013-09-20T22:40:43.483" Score="1" Body="&lt;p&gt;its a concept, you can repeat N data group of fields in a message, a x field (the repeating group) act as separator of the groups.&lt;/p&gt;&#xA;" OwnerUserId="1360" LastActivityDate="2013-09-20T22:40:43.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8954" PostTypeId="2" ParentId="8952" CreationDate="2013-09-21T04:11:50.107" Score="2" Body="&lt;p&gt;No, it doesn't have to do with time frames. It's a protocol feature designed to enable something akin to &lt;em&gt;nested data&lt;/em&gt;, whether for more compact data transmission, or just to allow one to adhere to rules of semantic sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take market data requests, for example, &lt;em&gt;i.e.&lt;/em&gt; retrieving the current market depth for a certain instrument. Not only would sending one message per order on the book inefficiently retransmit headers and other common tags, but also you'd need an additional tag (or message) to indicate an EOM (end-of-message(s)).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not to mention the latency and auditing overheads (and headaches) involved in dealing with piecemeal data delivery (as opposed to snapshots).&lt;/p&gt;&#xA;" OwnerUserId="5149" LastEditorUserId="5149" LastEditDate="2013-09-21T10:32:39.817" LastActivityDate="2013-09-21T10:32:39.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8955" PostTypeId="2" ParentId="8952" CreationDate="2013-09-21T05:59:33.870" Score="11" Body="&lt;p&gt;Repeating groups are a way for FIX to represent arrays. A &quot;number of&quot; field prepends the repeating group to alert the recipient how many elements to expect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, Arca uses &lt;code&gt;TradingSessionID&lt;/code&gt; (tag 336) to identify pre-open (&lt;em&gt;P1&lt;/em&gt;), primary (&lt;em&gt;P2&lt;/em&gt;), and post-close (&lt;em&gt;P3&lt;/em&gt;) market hours. This group is prepended by &lt;code&gt;NoTradingSessions&lt;/code&gt; (tag 386). So, I would use the following sequence in my FIX message to alert Arca that all three of their sessions are valid for this message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;...|386=3|336=P1|336=P2|336=P3|...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As a side note, FIX also uses multiple-value strings as another representation of arrays. &lt;code&gt;ExecInst&lt;/code&gt; (tag 18) is a single string that has multiple values separated by a space:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;...|18=1 W|...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="35" LastEditorUserId="35" LastEditDate="2013-09-21T18:26:56.253" LastActivityDate="2013-09-21T18:26:56.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8956" PostTypeId="1" AcceptedAnswerId="37886" CreationDate="2013-09-21T07:55:03.847" Score="14" ViewCount="812" Body="&lt;p&gt;We know that, taken every discount curve, it's possible to calculate its forward rates according to our tenor preferences.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know also that it's actually possible to extract an implied term structure from every discount curve simply using the appropriate forward rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is indeed true for risk free discount curves, because the arbitrage-free assumption which returns the forward rates is fair.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let a risky discount curve, that is, every discount curve obtained from liquid issues' yields possibly interpolated and bootstrapped... and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;does it make sense to extract an implied term structure from it like we're used to do with a risk free zero rate curve?&lt;/li&gt;&#xA;&lt;li&gt;Is the implied term structure obtained in such a way an arbitrage-free forecast of the future yield curve shape?&lt;/li&gt;&#xA;&lt;li&gt;If not so, is the assumption that allows to calculate the forward rates valid for risk-free curves only?&lt;/li&gt;&#xA;&lt;li&gt;Does it make sense to obtain an implied term structure from, say, a CDS spread curve? Why?&lt;/li&gt;&#xA;&lt;li&gt;If the answer to 5. was affirmative, would that implied term structure be an arbitrage-free forecast of the issuer's default risk?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3058" LastActivityDate="2018-11-19T18:02:45.507" Title="Implied term structure from risky discount curve: does it make sense?" Tags="&lt;yield-curve&gt;&lt;forward&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8958" PostTypeId="2" ParentId="8595" CreationDate="2013-09-22T00:13:47.570" Score="1" Body="&lt;p&gt;@Chrisaycock , It should be noted that taking out the top order doesn't necessarily move the market by a non-negligible amount. For example, on a $150 stock, if there's an open sell order at \$150 X 1000 shares, and another at \$150.10 @ 5000 shares, you're not going to move the market much, and .10 / \$150.10 is less than 0.1% - negligible unless you're doing HFT.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;@LeeSchmidt, I think a better indicator of a &quot;big order&quot; is the ratio of your order size relative to all the open orders that are relatively close in price to the NBBO. There's also a dark pool that you should consider, especially on large-cap stocks. The easiest way might be to look at volume vs. time (it's best if you can look at intraday volume vs. time but you could eyeball with daily volume). If the 30-minute volume is 10k, and you want to do even a 2k trade, you'll probably move the market. A \$500,000 trade on a company like AAPL won't make a dent in the price when it's average volume is 15 million shares / \$7 billion... but a \$500k buy could easily cause a short spike in some penny stocks.&lt;/p&gt;&#xA;" OwnerUserId="6137" LastEditorUserId="1976" LastEditDate="2013-09-22T08:11:26.930" LastActivityDate="2013-09-22T08:11:26.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8959" PostTypeId="2" ParentId="8943" CreationDate="2013-09-22T00:58:16.053" Score="0" Body="&lt;p&gt;As I know, style analysis is not a linear regression, it's not trying to minimize the square of the error, it's trying to make a combination of the benchmark portfolios to track your portfolio as close as possible. That is to say, your portfolio can outperform the benchmark like 4 percent, it's trying to make the 4 percent as stable as possible, the variance of the 4 percent alpha be as small as possible; while linear regression is trying to say the sum square of all the outperform and underperform is small as possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Style analysis make your portfolio has a parallel outperform or underperform relative to a selection of benchmarks, and from the weights of these benchmarks, you can know your portfolio's style; while linear regression is trying to make the benchmarks curve as close as possible to your portfolio. &lt;/p&gt;&#xA;" OwnerUserId="6116" LastActivityDate="2013-09-22T00:58:16.053" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8960" PostTypeId="1" CreationDate="2013-09-22T05:11:52.220" Score="4" ViewCount="577" Body="&lt;p&gt;I took some classes in portfolio theory, and learnt the Markowitz Mean-Variance Analysis.&#xA;If only two risky assets, the efficient frontier would be a hyperbola passing through the two points; now if added another asset has some correlation with them two, the efficient frontier would be pushed to the left of these three risky assets, generally not passing through them; so, if we keep adding more assets, it seems intuitively that the efficient frontier would be pushed further to the left of the assets points; wouldn't the efficient frontier be like tangent to the y-axis(y axis is  for return), causing the standard deviation to be almost zero? &#xA;I also read Pennacchi's book: Theory of Asset Pricing. it derived the equation for the minimum variance set using linear algebra. And found the position for the global minimum standard deviation point. And it's positive. I understand the equation derivation, but didn't get through the problem as I just thought of.&#xA;Any help? Much appreciated.&lt;/p&gt;&#xA;" OwnerUserId="6116" LastActivityDate="2013-09-22T18:14:05.143" Title="In Mean-Variance Analysis, why not the efficient frontier being pushed to the left near the axis?" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8962" PostTypeId="1" AcceptedAnswerId="8968" CreationDate="2013-09-22T09:52:34.177" Score="4" ViewCount="383" Body="&lt;p&gt;It seems like there is a contradiction between the fact the option pricing is risk-neutral and the large amount of option trading that is done for speculation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the option is risk-neutral, a trader cannot expect to make a profit. He could use the option as a form of insurance, but in practice a lot of options are used for speculation. Since the expectation is zero, but the option costs a fee, this seems like a bad choice for the investor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit:&lt;/em&gt;&#xA;There is an related answer to another question which helped me a lot: &lt;a href=&quot;https://quant.stackexchange.com/a/1116/1157&quot;&gt;https://quant.stackexchange.com/a/1116/1157&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user1157" LastEditorUserId="-1" LastEditorDisplayName="user1157" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2014-01-14T15:55:52.600" Title="Is there a contradiciton between option prices being martingales and the use of options for speculation?" Tags="&lt;option-pricing&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8964" PostTypeId="1" AcceptedAnswerId="8976" CreationDate="2013-09-22T16:09:54.220" Score="4" ViewCount="2706" Body="&lt;p&gt;I have a question that might be trivial to most of you, but somehow I'm not able to solve it by myself. I have a disagreement with my colleague on the distributional properties of a Geometric Brownian Motion: my point of view is, that if you estimate the parameters $\mu$ and $\sigma$ on log return (and assume that they are normal), the GBM at point $t$ has indeed an expected Value of $X_0\exp{((\mu+\sigma^2/2)t)}$ (properties of log-normal) and not $X_0 \exp{(\mu t)}$ as found in the literature, since there $\mu$ is the drift term of the differential equation of the stock price process itself, not of its log-returns. &#xA;I tried to confirm my view via several derivations and numerical examples. My colleague though is still not convinced, cause I use $\text{d }{\ln{\!X}}$ in Ito's Lemma for the log returns, but he argues that they are $\ln{(X_t/X_{t-1})}$. Apparently, my knowledge of differential equations is too limited to find the step from the log-returns to their corresponding SDE. In the literature I only find derivations where they start with the sde of $X$. I'm looking foward to your hints.&lt;/p&gt;&#xA;" OwnerUserId="6073" LastEditorUserId="2727" LastEditDate="2013-09-23T12:45:54.610" LastActivityDate="2013-10-04T10:49:36.553" Title="Differential equation for log-returns" Tags="&lt;statistics&gt;&lt;stochastic-calculus&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8965" PostTypeId="1" CreationDate="2013-09-22T17:11:00.447" Score="2" ViewCount="1809" Body="&lt;p&gt;I am unsure as to the exact arguments required for the Schedule function for an amortizing floater - my code is listed below. Specifically, my question pertains to whether the schedule should always start from the issue date of the bond or should it start from the settlement date if the bond is seasoned. I seem to have seen usage both ways in some of the examples on the web so I am a bit confused. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would expect that the NPV functions index into the right cashflow based on the settlement date provided but just checking.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, if anyone has a working example of an AmortizingFloatingRateBond which calculates the DM given a price (or vice versa) using a notional schedule,that'd be much appreciated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Code Snippet:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;QuantLib::JointCalendar calendar = QuantLib::JointCalendar(QuantLib::UnitedStates(),QuantLib::UnitedKingdom(),&#xA;        JoinBusinessDays);&#xA;QuantLib::DayCounter dayCounter = QuantLib::Actual360();&#xA;&#xA;QuantLib::Integer fixingDays = 1;&#xA;QuantLib::Natural settlementDays = 3;&#xA;&#xA;QuantLib::Date tradeDate(20, QuantLib::September, 2013);&#xA;QuantLib::Date settlementDate = calendar.advance(tradeDate, settlementDays, QuantLib::Days);&#xA;settlementDate = calendar.adjust(settlementDate);&#xA;QuantLib::Settings::instance().evaluationDate() = tradeDate;&#xA;&#xA;QuantLib::Date issueDate(25,QuantLib::July,2013);&#xA;&#xA;QuantLib::Period p1m = QuantLib::Period(1,QuantLib::Months);&#xA;&#xA;// Number of payments&#xA;int num_cashflows = 120;&#xA;QuantLib::Date maturityDate = issueDate + num_cashflows * p1m;&#xA;&#xA;QuantLib::Schedule mySchedule(issueDate,&#xA;    maturityDate,&#xA;    QuantLib::Period(QuantLib::Monthly),&#xA;    calendar,&#xA;    QuantLib::BusinessDayConvention::Unadjusted,&#xA;    QuantLib::BusinessDayConvention::ModifiedFollowing,&#xA;    QuantLib::DateGeneration::Forward,&#xA;    false);&#xA;&#xA;QuantLib::AmortizingFloatingRateBond MyFloater(settlementDays,&#xA;                                     Notional,&#xA;                                     mySchedule,&#xA;                                     libor,&#xA;                                     QuantLib::Actual360(),&#xA;                                     QuantLib::BusinessDayConvention::ModifiedFollowing,&#xA;                                     fixingDays,&#xA;                                     std::vector&amp;lt;QuantLib::Real&amp;gt;(1,1.0),&#xA;                                     std::vector&amp;lt;QuantLib::Spread&amp;gt;(1,Spread),&#xA;                                     std::vector&amp;lt;QuantLib::Rate&amp;gt;(),&#xA;                                     std::vector&amp;lt;QuantLib::Rate&amp;gt;(),&#xA;                                     true,&#xA;                                     issueDate);&#xA;&#xA;MyFloater.setPricingEngine(bondEngine);&#xA;&#xA;std::vector&amp;lt;QuantLib::Date&amp;gt; paySchedule = mySchedule.dates();&#xA;std::vector&amp;lt;QuantLib::Date&amp;gt;::iterator pIter;&#xA;QuantLib::Date priorDate;&#xA;&#xA;for (pIter = paySchedule.begin(); pIter != paySchedule.end() &amp;amp;&amp;amp; *pIter &amp;lt; settlementDate; ++pIter){&#xA;     priorDate = *pIter;&#xA;     libor-&amp;gt;addFixing(calendar.advance(priorDate, QuantLib::Period(-fixingDays,QuantLib::Days)), 0.1805/100);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6139" LastEditorUserId="308" LastEditDate="2013-09-23T07:32:30.603" LastActivityDate="2018-03-18T14:57:06.040" Title="Setting up Schedule for an amortizing floater in QuantLib" Tags="&lt;quantlib&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8966" PostTypeId="1" CreationDate="2013-09-22T17:27:22.870" Score="1" ViewCount="349" Body="&lt;p&gt;To clarify my heading, I have been searching for a material that consolidates all standard Fixed Income Security Pricing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g.  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Zero Coupon Bond - Pricing Models (Pure discount, with embedded options) - Example - Frequently usage&#xA;Coupon Bond - Pricing Models(sold before/after coupon dates)) - Example - Frequent usage&#xA;Inverse Floater - Pricing Model - Example - Frequent usage&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;etc..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While searching I am already taking notes to have my own material. Current main references are Fixed Income HandBook by Frank J. Fabozzi, Steven V. Mann and CFA Volume.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also I would appreciate if one can direct me to a material that shows C#/.Net based FI pricing library. I am alright with even VBA as I just want to take a look at the design of the library and how it's being used in some examples. Preferably a simple/yet clearly verified stack to start with.&lt;/p&gt;&#xA;" OwnerUserId="3178" LastActivityDate="2013-09-22T17:27:22.870" Title="Market Standard Pricing Models for Fixed Income Securities (Vanilla)" Tags="&lt;fixed-income&gt;&lt;models&gt;&lt;asset-pricing&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8967" PostTypeId="2" ParentId="8960" CreationDate="2013-09-22T18:14:05.143" Score="2" Body="&lt;p&gt;In mean-variance analysis, you combine different assets to minimize variance and maximize expected return. The hyperbola is not a function of the number of assets, but of their mean and variance. If the efficient frontier where a tangent to the y-axis (which can't be) or nearly a tangent, that would mean you would have almost zero portfolio-variance, which won't be the case for risky assets, and clearly not so by adding further assets with variance &gt;0.&lt;/p&gt;&#xA;" OwnerUserId="6073" LastActivityDate="2013-09-22T18:14:05.143" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8968" PostTypeId="2" ParentId="8962" CreationDate="2013-09-22T19:00:09.397" Score="6" Body="&lt;p&gt;You may need to differentiate between the use of options and the pricing of options. How options are used has no bearing on the price of such options. Options can be used as leveraged investments or as insurance or as hedges. Any such use does not change the fair value derived for the option. By the way you are in fact compensated the risk premium but it is already built into the underlying and risk neutral pricing is just an apparatus which simplifies pricing mechanics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Who says that options cannot be used for speculative purpose. If you have a better model that derives a different implied volatility than the value the option is priced at then you can speculate and make money and yet the risk neutral pricing framework still holds up&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-09-22T19:07:38.440" LastActivityDate="2013-09-22T19:07:38.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8969" PostTypeId="1" CreationDate="2013-09-22T22:32:36.450" Score="1" ViewCount="2100" Body="&lt;p&gt;Just want to check whether i understand it correctly:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long Calls have positive delta&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long Puts have negative Delta&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long stock has 0.01 delta&lt;/p&gt;&#xA;&#xA;&lt;p&gt;100 Shares have 1 delta&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore:&#xA;Covered Call = 1 minus delta of Call option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this correct?&lt;/p&gt;&#xA;" OwnerUserId="4707" LastActivityDate="2013-10-27T21:02:27.110" Title="Delta in Covered Calls?" Tags="&lt;greeks&gt;&lt;delta&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8970" PostTypeId="1" CreationDate="2013-09-23T01:31:35.290" Score="1" ViewCount="317" Body="&lt;p&gt;What is a proper (or commonly used/accepted) way of calculating some spot value with tick data? At the moment I can think of two options:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Take the latest available best bid, latest available best ask and find mid. (Trade represents both best bid and ask at the same level)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Take the latest available trade and consider it as a spot price.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The problem with 1 for me is that spread can change dramatically over time, especially in the beginning of trading which can affect the mid and show unrealistic prices. The problem with 2 is that bid-ask can move significantly without any trades being performed and so latest trade wouldn't represent the market situation any more. If the considered asset is not very liquid there come lots of problems (i.e., no bid available at all). I can think of a few tweaks, but I'm quite sure I'm trying to re-invent the thing and there must be a common solution for it. Is there? I.e., how do data providers calculate minutely prices based on tick data?&lt;/p&gt;&#xA;" OwnerUserId="5086" LastEditorUserId="5086" LastEditDate="2013-09-23T05:09:24.493" LastActivityDate="2013-09-23T05:48:00.477" Title="Calculating spot level using tick data" Tags="&lt;tick-data&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8971" PostTypeId="2" ParentId="8970" CreationDate="2013-09-23T05:48:00.477" Score="2" Body="&lt;p&gt;Neither is entirely correct. I think you need to find a middle ground here because: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) Bid and Ask do not have to be identical when a trade occurs. Someone may lift the offer and that results in a trade without ever having bid the asset&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) The last trade may have occurred some time ago as pointed out and true value will most likely lie somewhere between bid and offer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having said that, I believe market accepted standard is to take the last trade as true value because that is where two counterparties agreed to conduct business. Just because someone shows buy and someone else sell interest does not mean that anyone is willing to trade at levels away from their shown interest and thus true value is not reflected in current bid/offers alone. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would take the last trade as &quot;true value&quot; but if bid/offers are significantly away from the last traded price and if bid and offers are regularly refreshed, meaning market participants stand ready to trade at such indications then I would mark true value as the bid-offer mid price. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-09-23T05:48:00.477" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8972" PostTypeId="1" AcceptedAnswerId="8978" CreationDate="2013-09-23T06:24:00.953" Score="3" ViewCount="911" Body="&lt;p&gt;In a limit book like NASDAQ ITCH, can liquidity suppliers know the demand-side identity of a trader prior or after a trade? Knowing this will help me with my theoretical model that I am trying to develop since I am wondering whether a liquidity supplier that observes say a trade of 90 shares that takes away liquidity up to three ticks (30 shares per tick - block shape book) can distinguished whether the trade came from one individual or three individuals who submitted trades at each tick.&lt;/p&gt;&#xA;" OwnerUserId="2570" LastEditorUserId="2570" LastEditDate="2013-09-23T06:29:01.007" LastActivityDate="2014-10-24T23:06:43.537" Title="Trader's identity in a limit book" Tags="&lt;limit-order-book&gt;&lt;nasdaq&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8973" PostTypeId="2" ParentId="8965" CreationDate="2013-09-23T07:54:26.933" Score="3" Body="&lt;p&gt;As for the first question, the schedule should start from the issue date. The bond will manage cash flows correctly based on the evaluation date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second is a bit trickier, and I don't think I have working code handy.  The general idea is: if you want to add a spread to the rate of the bond (to go from discount margin to price) you'll have to modify the term structure you pass to your Libor instance.  Instead of linking the term-structure handle to the Libor curve, create an instance of &lt;code&gt;ForwardSpreadedTermStructure&lt;/code&gt; passing the Libor curve and a quote holding the spread; something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;boost::shared_ptr&amp;lt;SimpleQuote&amp;gt; spread(new SimpleQuote(0.0));&#xA;boost::shared_ptr&amp;lt;YieldTermStructure&amp;gt; spreadedCurve(&#xA;    new ForwardSpreadedTermStructure(liborCurve,&#xA;                                     Handle&amp;lt;Quote&amp;gt;(spread)));&#xA;libor = boost::shared_ptr&amp;lt;IborIndex&amp;gt;(&#xA;    new USDLibor(1*Months,&#xA;                 Handle&amp;lt;YieldTermStructure&amp;gt;(spreadedCurve)));&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you initialize the bond with the Libor instance above, you should be able to write:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;spread-&amp;gt;setValue(0.002);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and see the bond price change accordingly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To go from price to DM, you have to invert the above in some way.  The easiest is probably to create a function object that takes a spread and returns the difference between the target price and the price calculated with the current DM (it will probably have to hold a reference to the bond and perform the calculation I outlined).  Once you have the function object, you can pass it to any of the 1-D solvers available in the library.  The solver will return the spread that gives a null price difference; that is, the spread for which the price equals the target price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; as per &lt;a href=&quot;https://quant.stackexchange.com/questions/37705&quot;&gt;Calculating Discount Margin on a floating rate bond using QuantLib&lt;/a&gt;, you should use the original LIBOR curve for forecast and the curve plus spread for discounting; thus, something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;shared_ptr&amp;lt;SimpleQuote&amp;gt; spread = make_shared&amp;lt;SimpleQuote&amp;gt;(0.0);&#xA;shared_ptr&amp;lt;YieldTermStructure&amp;gt; spreadedCurve =&#xA;    make_shared&amp;lt;ForwardSpreadedTermStructure&amp;gt;(liborCurve,&#xA;                                              Handle&amp;lt;Quote&amp;gt;(spread));&#xA;libor = make_shared&amp;lt;USDLibor&amp;gt;(1*Months,&#xA;                              Handle&amp;lt;YieldTermStructure&amp;gt;(liborCurve));&#xA;bondEngine = make_shared&amp;lt;DiscountingBondEngine&amp;gt;(&#xA;                           Handle&amp;lt;YieldTermStructure&amp;gt;(spreadedCurve));&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="308" LastEditorUserId="308" LastEditDate="2018-03-18T14:57:06.040" LastActivityDate="2018-03-18T14:57:06.040" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8974" PostTypeId="1" AcceptedAnswerId="8983" CreationDate="2013-09-23T09:27:50.697" Score="7" ViewCount="766" Body="&lt;p&gt;The put-call symmetry states that &lt;code&gt;C(S,t;X,r,q) = P(X,t;S,q,r)&lt;/code&gt;, and that this works for American options. According to my notes, this is 'model dependent' because it depends on the assumption that the underlying price follows geometric brownian motion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I don't understand why this would matter: Considering that the payoffs are the same, shouldn't the two options have the same value even if the stock price doesn't follow geometric brownian motion?&lt;/p&gt;&#xA;" OwnerUserId="4862" LastActivityDate="2013-09-23T17:24:26.480" Title="Why is the Put-Call Symmetry model dependent?" Tags="&lt;put&gt;&lt;call&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8976" PostTypeId="2" ParentId="8964" CreationDate="2013-09-23T13:07:09.910" Score="7" Body="&lt;p&gt;If you consider $X_1$ a random variable which is normally distributed with mean $\mu$ and variance $\sigma^2$ them $S_1 = \exp(X_1)$ is log-normally distributed with mean $\exp(\mu + \sigma^2/2)$ and variance $(\exp(\sigma^2)-1)\exp(2\mu+\sigma^2)$. This follows from the definitions of the normal distribution and the log-normal distribution and deriving the expectation and variance from these definitions and you can find it &lt;a href=&quot;http://en.wikipedia.org/wiki/Log_normal&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you define a process $X_t$ by&#xA;$$&#xA;dX_t = \mu dt + \sigma dB_t,&#xA;$$&#xA;then the process has expectaion $\mu t$ and variance $\sigma^2 t$ by basic SDE theory.&#xA;If you consider the process $S_t = \exp(X_t)$ then you get by Ito's lemma&#xA;$$&#xA;\frac{dS_t}{S_t} =  \mu dt + \sigma dB_t + \sigma^2/2 dt = (\mu + \sigma^2/2) dt + \sigma dB_t.&#xA;$$&#xA;and because of considerations above we have $E[S_t/S_0] = \exp(\mu t + \sigma^2/2 t)$ and variance $(\exp(\sigma^2 t)-1)\exp(2\mu t+\sigma^2 t)$. Thus a drift of $\mu$ in the process of the log-returns gives you a drift of $\mu + \sigma^2/2$ in the process of geometric returns. Now you can define $\tilde{\mu} = \mu + \sigma^2/2$ and rewrite the processes with $\tilde{\mu}$ then you have drift $\tilde{\mu}$ for the geometric returns and $\tilde{\mu} - \sigma^2/2$ for the log-returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: After having written this, I found &lt;a href=&quot;http://www.columbia.edu/~ks20/FE-Notes/4700-07-Notes-GBM.pdf&quot; rel=&quot;nofollow&quot;&gt;nice lecture notes&lt;/a&gt; by Karl Sigman about this in the web.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2013-10-04T10:26:32.833" LastActivityDate="2013-10-04T10:26:32.833" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="8978" PostTypeId="2" ParentId="8972" CreationDate="2013-09-23T13:15:15.733" Score="3" Body="&lt;p&gt;ITCH does not disseminate any identifiers for the buy-side. They have a &lt;em&gt;match&lt;/em&gt; number (used to correct or break trades) and a &lt;em&gt;reference&lt;/em&gt; number (for displayed liquidity) and that's it. No other identifying features are present.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2013-09-23T13:15:15.733" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="8979" PostTypeId="1" CreationDate="2013-09-23T14:45:55.470" Score="3" ViewCount="832" Body="&lt;p&gt;Assuming the returns distribution is normal, then there is a relation between Stutzer index and Sharpe ratio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I found in the following paper 2 different equation:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.yats.com/doc/hedge-fund-weekly-report-sample.pdf&quot; rel=&quot;nofollow&quot;&gt;Paper I&lt;/a&gt; (page 10-11)‎ where it is mentioned Stutzer index (Ip) is half of square of the Sharpe ratio.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.moorscabot.net/assets/pdfs/CBOE-Analysis.pdf&quot; rel=&quot;nofollow&quot;&gt;Paper II&lt;/a&gt; (page 8) where it is mentioned&#xA;Stutzer index is equal to the Sharpe Ratio.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Can somebody tell, which one is correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also if I have ony 12 monthly return series is it meaningful to calculate Stutzer index? (most of the implemented algorithms I'v seen so far are on daily returns of at least 100-120 observations)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Stutzer index definition: &lt;a href=&quot;http://www.investopedia.com/terms/s/stutzerindex.asp&quot; rel=&quot;nofollow&quot;&gt;http://www.investopedia.com/terms/s/stutzerindex.asp&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Michael J. Stutzer original paperlink: &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=239540&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=239540&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3456" LastEditorUserId="-1" LastEditDate="2013-09-26T06:45:42.007" LastActivityDate="2013-09-27T14:26:52.900" Title="What is the correct Stutzer index and Sharpe ratio relation, assuming a normal returns distribution?" Tags="&lt;portfolio-management&gt;&lt;sharpe-ratio&gt;&lt;normal-distribution&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8980" PostTypeId="1" CreationDate="2013-09-23T15:43:20.100" Score="3" ViewCount="1367" Body="&lt;p&gt;the idea is to simulate price returns thus to be normally distributed i 'am trying to use subordinated arithmetic brownian motion subordinated to time activity (volume)&#xA; stock prices are following GBM then you can say&#xA;$$&#xA;dS_t=μS_tdt+σS_tdW_t&#xA;$$&#xA;where the time considered is not the calendar time but activity time (Ané &amp;amp; Geman 2000). I faced problems while implementing it in matlab so any help would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="6148" LastEditorUserId="6505" LastEditDate="2013-12-10T14:56:21.060" LastActivityDate="2013-12-10T14:56:21.060" Title="How to simulate stock prices with stochastic time change subordinated arithmetic Brownian Motion?" Tags="&lt;programming&gt;&lt;finance&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8983" PostTypeId="2" ParentId="8974" CreationDate="2013-09-23T17:24:26.480" Score="6" Body="&lt;p&gt;American put-call symmetry relies on the observation that trading $S$ for $K$ is optimal when $\frac1K$ is optimally traded for $\frac1S$.   So long as the dynamics of the inverse process $\frac1S$ are sufficiently tractable, you can derive the symmetry formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You don't have to have a &quot;pure&quot; GBM for this to work.  For example, non-constant (and even price-dependent) volatility and rates are OK.  But, given you need a good inverse process you probably do need a log-process of some kind.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2013-09-23T17:24:26.480" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="8984" PostTypeId="2" ParentId="8972" CreationDate="2013-09-23T17:44:06.070" Score="1" Body="&lt;p&gt;Regarding the second part of your question, - if you have relatively precise timestamps, you can use those to distinguish the cases you're interested. E.g. if one party took all three levels, the timestamps will be very close, or identical. &lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2013-09-23T17:44:06.070" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="8985" PostTypeId="1" CreationDate="2013-09-23T19:43:15.477" Score="10" ViewCount="294" Body="&lt;p&gt;I am undergoing a focused study of market making theory. So far, I've encountered the following papers:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.cis.upenn.edu/~mkearns/papers/marketmaking.pdf&quot; rel=&quot;noreferrer&quot;&gt;Market Making and Mean Reversion&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://machinelearning.wustl.edu/mlpapers/paper_files/NIPS2008_0272.pdf&quot; rel=&quot;noreferrer&quot;&gt;Adapting to a Market Shock: Optimal Sequential&#xA;Market-Making&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.cs.cmu.edu/~sandholm/ratoinalMarketMakingWProbabilisticKnowledge.aamas12.pdf&quot; rel=&quot;noreferrer&quot;&gt;Rational Market Making with Probabilistic Knowledge&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.seasholes.com/files/Paper_Hendershott_Seasholes_2007_AER_P_P.pdf&quot; rel=&quot;noreferrer&quot;&gt;Market Maker Inventories and Stock Prices&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1722924&quot; rel=&quot;noreferrer&quot;&gt;High Frequency Trading and The New-Market Makers&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.finance-concepts.com/images/fc/HighFrequencyTrading.pdf&quot; rel=&quot;noreferrer&quot;&gt;High-frequency trading in a limit order book&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://arxiv.org/abs/1105.3115&quot; rel=&quot;noreferrer&quot;&gt;Dealing with the Inventory Risk. A solution to the market making problem&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What important papers on market making am I missing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[To constrain the field a little, I'm interested in market making highly liquid equities where the market maker operates at latencies no larger than the competition.]&lt;/p&gt;&#xA;" OwnerUserId="3098" LastEditorUserId="3098" LastEditDate="2013-09-23T19:49:24.027" LastActivityDate="2013-09-23T19:49:24.027" Title="Survey of market making strategies and research" Tags="&lt;high-frequency&gt;&lt;market-making&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="13" ClosedDate="2013-09-23T20:23:26.373" ContentLicense="CC BY-SA 3.0" />
  <row Id="8986" PostTypeId="1" CreationDate="2013-09-23T20:55:55.193" Score="2" ViewCount="586" Body="&lt;p&gt;Consider a non-liquid option market with a wide bid-ask spreads across all strikes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Spot: \$52&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A snapshot of the \$50 strike shows:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;      Bid - Ask&#xA;Call: 2   - 4.5 &#xA;Put:  0.5 - 3.5 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Assume 0% interest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a set of rules or a model that could minimize the range of possible IV's by entering the option's bid/ask prices?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;because these options have a very wide spread and their last price changes sporadically i cannot achieve one appropriate fair value/IV for each option, and as i have mentioned, it's applies to all strikes and therefore i'm incapable of forming a skew. &#xA;so my question is if there's a math way to obtain min&amp;amp;max fair value outcomes for each option?&lt;/p&gt;&#xA;" OwnerUserId="6152" LastEditorUserId="6152" LastEditDate="2013-09-24T18:09:01.600" LastActivityDate="2013-09-24T18:09:01.600" Title="Pricing options and bid-ask spread" Tags="&lt;options&gt;&lt;option-pricing&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8987" PostTypeId="2" ParentId="8914" CreationDate="2013-09-24T05:51:03.353" Score="3" Body="&lt;p&gt;I have a little experience with this.  First, NASDAQ has shared a dataset with researchers that flags whether an HFT participated in each trade or not but not the actual MPID - probably less granular than what you want.  You generally need a professor to &quot;cosign&quot; your request, write a brief project proposal, and sign an NDA to get it.  They also have shared data with participant ids but this is more closely guarded, and I have heard that in one case the researcher had to be onsite to use it.  Second, the CFTC has shared futures market data containing trader ids with researchers in the past, but this program is frozen and many projects that were in progress are now caught in limbo (you can find a few press articles on this).  Finally, if ancient data from before HFTs existed would do you any good, you can get the NYSE TORQ database with no hassles.  See &lt;a href=&quot;http://people.stern.nyu.edu/jhasbrou/Research/WorkingPaperIndex.htm&quot; rel=&quot;nofollow&quot;&gt;http://people.stern.nyu.edu/jhasbrou/Research/WorkingPaperIndex.htm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, you mentioned that you were able to get similar data from an exchange, can you share any details?&lt;/p&gt;&#xA;" OwnerUserId="5841" LastActivityDate="2013-09-24T05:51:03.353" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8990" PostTypeId="2" ParentId="8595" CreationDate="2013-09-24T15:04:45.913" Score="1" Body="&lt;p&gt;First of all you need to be clarify what you mean by 'opening/closing price' are you talking about the last tick? The opening/closing auction price? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say you're talking about closing auction price within the context of a backtest. The big question here is are you computing your trading signal based on that same price? If you are then there's a major issue with this in you've essentially introduced lookahead bias. Remember in order to get the closing auction price for most US equities you have to send out a MOC 15 minutes before the close. Therefore you can't possibly have the closing print to compute on and achieve execution at that price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Final tick maybe, but you'll have to include a pretty substantial slippage assumption. &lt;/p&gt;&#xA;" OwnerUserId="122" LastActivityDate="2013-09-24T15:04:45.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8991" PostTypeId="2" ParentId="4218" CreationDate="2013-09-24T16:39:59.827" Score="2" Body="&lt;p&gt;Idiosyncratic volatility is NOT included in the regressors, so it should not be and actually cannot be part of your matrix X. Idiosyncratic volatility is the volatility (of Y) your matrix X (explanatory variables) cannot explain (i.e. remaining unexplained part), so it is the error term of your regression equation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just compute the standard deviation of your residuals; it is what you are looking for.&lt;/p&gt;&#xA;" OwnerUserId="6157" LastEditorUserId="35" LastEditDate="2013-09-25T16:32:52.330" LastActivityDate="2013-09-25T16:32:52.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8992" PostTypeId="2" ParentId="2205" CreationDate="2013-09-24T16:51:37.140" Score="1" Body="&lt;p&gt;Actually, the value of R2 is the percent of total risk explained by systematic risk..so you need to compute total risk, which is the sd of your stock returns...and then annualize it (i.e. if your data is monthly, just multiply the sd you computed by sqrt of 12) and then multiply it with R2 to obtain your systematic risk. The rest is unsystematic.&lt;/p&gt;&#xA;" OwnerUserId="6157" LastActivityDate="2013-09-24T16:51:37.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="8995" PostTypeId="2" ParentId="2678" CreationDate="2013-09-24T22:39:16.880" Score="2" Body="&lt;p&gt;False. It is not always the case for European options which cannot be exercised early and for Americans when you include transaction costs.&lt;/p&gt;&#xA;" OwnerUserId="3287" LastActivityDate="2013-09-24T22:39:16.880" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8997" PostTypeId="1" CreationDate="2013-09-25T08:04:22.987" Score="4" ViewCount="348" Body="&lt;p&gt;Let us start from the old times, where markets were less liquid. Suppose I hold some stocks of the company XYZ and I want to sell them. Why shall I expect that their price can rise in the next quarter given that company showed good in the current quarter and is likely to do well in the future? I could name at least three reasons for that:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The dividends on these stocks will be higher&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If I own enough stocks, the buyer of them can play a role in managing the company&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The buyer of stocks will expect that the price will grow even further and wants to speculate on the stocks by selling them for a higher price, say, in a year.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The latter reason is a bit cyclic though: if it would be the only reason to buy a stock - then the &lt;strong&gt;only&lt;/strong&gt; thing determining the price direction would be the expectation of market participants - even not about the company itself, but about the price direction. As a result, in such situation I would not see any connection between the fact how the company does, and how the stock price changes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the current moment, there are a lot of companies that do not pay any dividends on their stocks, and there are a lot of investors that buy/sell stocks of these companies in amounts much less to talk about affecting the company's management. I wonder thus, whether for such companies there is no any connection between how company does, and how the stock price moves. Perhaps, that could be illustrated by a dotcom situation 15 years ago. By a fundamental reason for a price change I mean something that does not depend only on the expectation of the market about the stock's price, and is related to the company itself. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edited:&lt;/strong&gt; I've just found a very nice and useful discussion &lt;a href=&quot;http://ask.metafilter.com/71639/What-are-stocks-actually-worth-if-they-never-pay-dividends&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; which almost answers my question. At the same time, I would be happy if a more quant-oriented community says its word.&lt;/p&gt;&#xA;" OwnerUserId="6160" LastEditorUserId="6160" LastEditDate="2013-09-25T09:01:56.403" LastActivityDate="2019-08-09T15:41:45.757" Title="Fundamental reasons for the stock price change" Tags="&lt;equities&gt;&lt;market-microstructure&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="8998" PostTypeId="2" ParentId="8997" CreationDate="2013-09-25T08:58:33.357" Score="2" Body="&lt;p&gt;Its a bit of a broad and almost philosophical question to be honest. Just two things that pop in mind are &#xA;(A) the money supply (&amp;amp; possible inflation) in combination with interest rates - this will drive the major money allocation in the world. As you see now with S&amp;amp;P at record highs on the back of massive quantitative easing and low interest rates. Money has to go somewhere (for fund managers and the likes) to bring returns.&#xA;(B) mergers and acquisitions - major driver for some hedge fund plays on relative valuation of the stock prices of both companies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But then again, just two things (of many more) that pop up...&lt;/p&gt;&#xA;" OwnerUserId="6165" LastActivityDate="2013-09-25T08:58:33.357" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="8999" PostTypeId="1" CreationDate="2013-09-25T09:33:15.873" Score="-1" ViewCount="262" Body="&lt;p&gt;As I understand it this model derived from data for US companies. Is it valid to apply the model as is to UK companies or does it require any modifications?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Description of the model:&#xA;&lt;a href=&quot;http://www.stockopedia.co.uk/content/the-beneish-m-score-identifying-earnings-management-and-short-candidates-56823&quot; rel=&quot;nofollow&quot;&gt;http://www.stockopedia.co.uk/content/the-beneish-m-score-identifying-earnings-management-and-short-candidates-56823&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="6166" LastActivityDate="2013-09-25T12:47:06.443" Title="Can Beneish's model for detecting earnings manipulation be applied to companies in the UK?" Tags="&lt;modeling&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9000" PostTypeId="2" ParentId="8999" CreationDate="2013-09-25T12:47:06.443" Score="0" Body="&lt;p&gt;UK(IFRS) and the US(GAAP) use different accounting standards - off the top of my head you're likely to have differences at least in the Receivables Index, Margin Index, Asset Quality index due to inventory and costing differences.  For example LIFO isn't permitted under IFRS, which is going to affect COGS and Inventory.  It doesn't mean it's unusable, you'll just have to make sure to convert the statements into a common form.  I don't have experience using the M-Score, and I didn't read much past the factors, but I would hope they outline the standard accounting assumptions for each factor.&lt;/p&gt;&#xA;" OwnerUserId="2732" LastActivityDate="2013-09-25T12:47:06.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9002" PostTypeId="1" CreationDate="2013-09-25T12:59:34.277" Score="11" ViewCount="11134" Body="&lt;p&gt;We have built an algorithmic trading software and need to calculate the following parameters for each position in our portfolio.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Average Price&lt;/li&gt;&#xA;&lt;li&gt;Cost&lt;/li&gt;&#xA;&lt;li&gt;Realized Profit &amp;amp; Loss&lt;/li&gt;&#xA;&lt;li&gt;Unrealized Profit &amp;amp; Loss&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;These values can be calculated by going through all prior fills for that security. But in a trading system that potentially has thousands of trades for a single security this might take too long, especially if this calculation has to be done every time one needs those values. So I assume that it is much quicker to calculate those values based on prior values and the last fill received for that security.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help is appreciated!&lt;/p&gt;&#xA;" OwnerUserId="5530" LastEditorUserId="5530" LastEditDate="2013-09-28T11:18:19.733" LastActivityDate="2020-11-20T22:39:00.820" Title="Calculate Average Price, Cost, (Un)Realized P&amp;L of a position based on executed trades" Tags="&lt;returns&gt;&lt;pricing&gt;&lt;portfolio&gt;&lt;valuation&gt;&lt;performance&gt;" AnswerCount="5" CommentCount="4" FavoriteCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="9004" PostTypeId="2" ParentId="8997" CreationDate="2013-09-25T13:59:20.987" Score="1" Body="&lt;p&gt;In general, from a fundamental analysis viewpoint, a good buy would be a stock, whose price is lower than its fundamental value. In Rational Expectations theory, all future payments are already correctly priced into the stock price, so (1) an assumed rise of dividends, which you mention, would be already reflected by the stock price. If not so, you could arbitrage on that mispricing. (2) makes no sense, in my opinion, since, in general, the manager of the company has the best information set, so a participation of the stock buyer in the decision process would not necessarily lead to an increased value. (3) is most likely the motivation of a fundamentalist, but only if he thinks that he knows better than others. Anything else would be technical analysis, i.e. the assumption that future price patterns can be explained by the former price process. This is in contradiction with FA though, because, as explained earlier, that information would have already been processed. Look up &quot;Efficient Market Hypothesis&quot; on this topic.&#xA;So, I think, fundamental reasons for a price change can only be explained by a current under-(over-)valuation of the stock, a trade of fundamentalists on this mispricing and a price correction in the future.&lt;/p&gt;&#xA;" OwnerUserId="6073" LastActivityDate="2013-09-25T13:59:20.987" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9006" PostTypeId="1" AcceptedAnswerId="9014" CreationDate="2013-09-25T17:18:19.687" Score="4" ViewCount="440" Body="&lt;p&gt;I decided to recap my knowledge in interest rates, and decided to start with Chapter 4 on interest rates (in 8th edition) of the Hull's book &quot;Options, Futures and Other derivatives&quot;. In 4.3 the concept of a zero-coupon rate is briefly introduced, and is further used to price a coupon-bearing bond in 4.4. Procedure is natural, logical and relies on clear arbitrage-avoiding arguments. However, in 4.5 zero-coupon rates are themselves computed via the coupon-bearing bond prices. This line feels cyclic to me. I can understand that one can use this to check the consistency of bond prices over several maturities, but does it mean that one can actually price bonds using such arguments?&lt;/p&gt;&#xA;" OwnerUserId="464" LastActivityDate="2013-09-27T02:11:08.580" Title="Basic question about bonds pricing" Tags="&lt;fixed-income&gt;&lt;pricing&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9009" PostTypeId="1" AcceptedAnswerId="9032" CreationDate="2013-09-25T21:42:34.487" Score="0" ViewCount="380" Body="&lt;p&gt;I am new to pairs trading and am in the process of constructing the code for backtesting a basic pair trading strategy. While I understand the basic idea behind the pair trading strategy, I am having trouble understanding which stock to short or long should future price dynamics change between the pair. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question: Let say stock A currently trades at a price that is more expensive than Stock B. If this relationship continues to persist, whenever there is a divergence in price, I will short A and long B. But if price dynamics change such that price of B &gt; price of A, I would need to switch between the entry such that when there is a divergence, I will need to now short B and long A.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this correct?&lt;/p&gt;&#xA;" OwnerUserId="2318" LastActivityDate="2013-09-28T02:53:49.233" Title="Stat Arb Equity Pair Position Trigger" Tags="&lt;pairs-trading&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9012" PostTypeId="2" ParentId="9009" CreationDate="2013-09-26T10:41:55.860" Score="2" Body="&lt;p&gt;Please see e.g. wikipedia entry for &lt;a href=&quot;http://en.wikipedia.org/wiki/Cointegration&quot; rel=&quot;nofollow&quot;&gt;cointegration&lt;/a&gt;. You should also probably read the original paper &lt;a href=&quot;http://www.jstor.org/discover/10.2307/1913236?uid=3737976&amp;amp;uid=2&amp;amp;uid=4&amp;amp;sid=21102666072541&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; and/or the book by &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0471460672&quot; rel=&quot;nofollow&quot;&gt;Vidyamurtha&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Vidyamurtha's book is a bit messy, but IMO quite OK.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I think it's going to be pretty hard to make pairs trading work in practice. It's just a too old idea and it's being done too much and you're going to have a tough time finding suitable pairs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should improve your math a lot and think of a better algorithm ;)&lt;/p&gt;&#xA;" OwnerUserId="5636" LastActivityDate="2013-09-26T10:41:55.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9014" PostTypeId="2" ParentId="9006" CreationDate="2013-09-26T18:15:18.923" Score="5" Body="&lt;p&gt;Generally, there are few or no zero-coupon instruments traded in the market, especially for longer maturities.  However, pricing of many derivatives relies on having a zero curve, so it becomes necessary to construct one using available instruments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Aside from derivatives, one can use a zero curve fitted to liquid bonds to price new or less liquid issues.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2013-09-26T18:15:18.923" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9016" PostTypeId="2" ParentId="9006" CreationDate="2013-09-27T02:05:06.317" Score="2" Body="&lt;p&gt;Yea, I just started work at a fixed income shop. We accrete the value of zero coupon bonds based on the coupon rate the bond would have paid if it were an interest/bullet bond. The value of the coupon/accreted rate in the Official statement/indenture of the bond is obviously not the rate the market is pricing the bonds at but it fluctuates around it, assuming the obligor's credit worthiness is not impaired and there is liquidty in the market, otherwise you would have large credit, liquidity premiums. Just think of the accretated rate as a glide path that gets you from the value of the bond now to the par amount at maturity and that the market price/yield, which is different, will fluctuate around this accreted rate all the way up to par.&lt;/p&gt;&#xA;" OwnerUserId="4729" LastEditorUserId="4729" LastEditDate="2013-09-27T02:11:08.580" LastActivityDate="2013-09-27T02:11:08.580" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9017" PostTypeId="2" ParentId="8969" CreationDate="2013-09-27T02:19:26.023" Score="2" Body="&lt;p&gt;&lt;a href=&quot;http://www.theoptionsguide.com/in-the-money-covered-calls.aspx&quot; rel=&quot;nofollow&quot;&gt;http://www.theoptionsguide.com/in-the-money-covered-calls.aspx&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Look at the chart on this site. Do you see how the line is upward sloping for a covered call until the stock reaches a price of 45? To simplify things, you have a delta of 1 until 45 and then a delta of 0 after 45 onwards. Delta is the slope of the line. Delta of a covered call changes depending on how ITM your short call.&lt;/p&gt;&#xA;" OwnerUserId="4729" LastActivityDate="2013-09-27T02:19:26.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9018" PostTypeId="1" AcceptedAnswerId="9023" CreationDate="2013-09-27T05:57:17.157" Score="3" ViewCount="260" Body="&lt;p&gt;How do I measure how quickly a binomial lattice converges to an option value as the number of steps is increased?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm charting option value versus number of steps for various binomial lattice models and while the values generally converge as the number of steps increases, the rate at which they converge differs. For example, Model A converges fastest for at-the-money puts but Model B converges fastest for an otherwise identical option that is deep in-the-money.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Eyeballing the charts it seems obvious (sometimes) which model pick for a particular scenario, but how do you quantify this?&lt;/p&gt;&#xA;" OwnerUserId="3287" LastActivityDate="2013-09-27T13:24:25.097" Title="Binomial lattice convergence" Tags="&lt;models&gt;&lt;binomial-tree&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9020" PostTypeId="1" CreationDate="2013-09-27T08:45:15.310" Score="5" ViewCount="1096" Body="&lt;p&gt;Not sure if this is the right question board for this - &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It sounds like CME is switching their MDP platform from FAST to Simple Binary Encoding and it will be going to production soon. Does anybody know of a good (free) decoder for FIX binary? I checked with CME and they said they won't be developing one for some time. Thanks!&lt;/p&gt;&#xA;" OwnerUserId="6167" LastActivityDate="2014-01-07T18:55:51.233" Title="FIX binary decoder" Tags="&lt;market-data&gt;&lt;fix&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9022" PostTypeId="1" AcceptedAnswerId="9041" CreationDate="2013-09-27T12:16:38.977" Score="14" ViewCount="5428" Body="&lt;p&gt;Why are manual market makers still predominant in options markets? Why haven't algorithms replaced these market makers, as they have for liquid stocks for example?&lt;/p&gt;&#xA;" OwnerUserId="6081" LastEditorUserId="6081" LastEditDate="2013-09-28T08:31:35.267" LastActivityDate="2018-09-03T14:45:12.010" Title="Why are there still manual market makers in options" Tags="&lt;options&gt;&lt;market-making&gt;&lt;algorithmic-trading&gt;" AnswerCount="4" CommentCount="5" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9023" PostTypeId="2" ParentId="9018" CreationDate="2013-09-27T13:24:25.097" Score="5" Body="&lt;p&gt;You don't mention if the puts in question are exotic or vanilla, but assuming they are vanilla, you should read &lt;a href=&quot;http://www.tandfonline.com/doi/abs/10.1080/14697688.2011.617776#preview&quot;&gt;this paper by Chen and Joshi&lt;/a&gt;.  In it, they find optimal performance by using smoothed, truncated Tian-parameter binomial lattices with &lt;a href=&quot;http://en.wikipedia.org/wiki/Richardson_extrapolation&quot;&gt;Richardson extrapolation&lt;/a&gt; --  where the idea is to run one extra low-cost (long $\Delta T$) tree in order to extrapolate the lattice values to $\Delta T=0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Aside from a carefully-derived recommendation, the paper is an excellent review of most of the known tricks for extracting performance from binomial lattices.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2013-09-27T13:24:25.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9024" PostTypeId="2" ParentId="8979" CreationDate="2013-09-27T14:05:16.857" Score="2" Body="&lt;p&gt;I think some some terminology got mixed up here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $r_t$, $t=1,\ldots,T$ be a series of iid excess returns with the estimated mean excess return $\bar{r}= \sum_{t=1}^Tr_t$.&#xA;Then the Stutzer Index $S$ is defined as &#xA;$ S=\frac{|\bar{r}|}{\bar{r}}\sqrt{2I_p}$ with $I_p$ being the &quot;Stutzer Information Statistic&quot;, $I_p=\max_\theta -\log(\frac{1}{T}\sum_{t=1}^T \text{e}^{\theta r_t})$. In the normal case John's reference tells us that $I_p = \frac{1}{2}\lambda_p^2$ where $\lambda_p$ is the Sharpe Ratio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, the Stutzer Information Statistic $I_p$ is obviously half of the squared sharpe ratio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Stutzer Index $S$ on the other hand is equal to the sharpe ratio:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $\frac{|\bar{r}|}{\bar{r}} = \text{sgn}(\lambda_p)$ and $\sqrt{2I_p} = |\lambda_p|$  it follows that $S = \text{sgn}(\lambda_p) |\lambda_p|=\lambda_p$.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastEditorUserId="2727" LastEditDate="2013-09-27T14:26:52.900" LastActivityDate="2013-09-27T14:26:52.900" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9026" PostTypeId="2" ParentId="8862" CreationDate="2013-09-27T14:45:24.117" Score="1" Body="&lt;p&gt;As Matt has mentioned, although BS allows for the explicit formula of the price in case of European call and put, things get much tougher in case you change the contingent claim - not to say the model itself. For example, the probability of a European call option being in the money can be regarded as a contingent claim given by $f(S_t):=1\{S_t\geq K\}$ where $1\{A\}$ here stands for the &lt;a href=&quot;http://en.wikipedia.org/wiki/Indicator_function&quot; rel=&quot;nofollow&quot;&gt;Indicator function&lt;/a&gt; of a set. In contrast to the normal payoff $g(S_t)  = (S_t - K)^+$, $f(S_t)$ is a discontinuous function of the stock price which already gives you a new level of complexity. It shall not be a big problem for a parabolic PDE such as the one in BS case - and even an analytical solution may be known. However, if your model is different from BS - there are rarely analytical solutions to corresponding PDEs, so in the best case one hope to find an appropriate numerical solver.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Monte Carlo can actually outperform PDE numerical solvers when it comes to large-dimensional models. In addition, you can use the very same samples to price different stuff - that is if you are given a time horizon of a problem, you can run couple of millions of simulations and price call, put, lookback, barrier etc. You shall bear in mind that Monte Carlo gives you a result only up to some level of confidence - that is you may be extremely unlucky, and your outcomes may appear to be completely wrong, but often one tries pushing the confidence to be around $1-10^{-6}$ or even closer to $1$ - this will require running quite some samples, of course, but besides that Monte Carlo is a very flexible method. I would say a more fundamental drawback of it is that it does not fit well optimization problems - as an example, you can't use Monte Carlo directly to price American-style contingent claims unless you express the problem as a dynamic programming and run 1-step Monte Carlo simulations for each iteration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is by no means a complete answer, and I agree with Matt that a book would be more comprehensive, but I hope it gives you at least a brief overview.&lt;/p&gt;&#xA;" OwnerUserId="464" LastActivityDate="2013-09-27T14:45:24.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9027" PostTypeId="2" ParentId="9002" CreationDate="2013-09-27T17:34:06.863" Score="0" Body="&lt;p&gt;This is a partial answer. It shows how to simply calculate Total P&amp;amp;L, which is sum of Realized and UnRealized. From my experience, I didn't really need to split it. Also, It doesn't calculate Average Price, but you can add this functionality if needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, here is the simplest implementation (Java)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;public class PNL {&#xA;    int position = 0;&#xA;    double money = 0.0;&#xA;&#xA;    public void on_execution(double price, int quantity) {&#xA;        position += quantity;&#xA;        money -= quantity * price;&#xA;    }&#xA;&#xA;    public double get_pnl(double current_price){&#xA;        double pnl = money + position * current_price;&#xA;        return pnl;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Usage:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Whenever execution occurs, call &lt;code&gt;on_execution()&lt;/code&gt;, where &lt;code&gt;price&lt;/code&gt; is execution price, and &lt;code&gt;quantity&lt;/code&gt; is execution size. Note, that &lt;code&gt;quantity&lt;/code&gt; is signed, i.e. it must be negative in case of SELL.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Whenever you need the total P&amp;amp;L, call the &lt;code&gt;get_pnl()&lt;/code&gt; with current price. The price is up to you to decide. It may be last price, midprice, position liquidation price, etc.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Explanation: The idea here is very intuitive: you change money into position and vice versa. You P&amp;amp;L is sum of money and the value of position. Signed &lt;code&gt;quantity&lt;/code&gt; makes it consistent for any direction of trade.&lt;/p&gt;&#xA;" OwnerUserId="1515" LastActivityDate="2013-09-27T17:34:06.863" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9028" PostTypeId="2" ParentId="8980" CreationDate="2013-09-27T17:56:14.190" Score="3" Body="&lt;p&gt;Here it is. Returns here are normally distributed by construction.&#xA;It doesn't involve time scale, you can use time, volume, or any other &quot;activity&quot;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt; sigma = 0.001;&#xA;&amp;gt;&amp;gt; mu = 0;&#xA;&amp;gt;&amp;gt; returns = mu + sigma * randn(1000,1);&#xA;&amp;gt;&amp;gt; price = cumprod(1 + returns);&#xA;&amp;gt;&amp;gt; plot(price)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/1Eh3N.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="1515" LastActivityDate="2013-09-27T17:56:14.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9029" PostTypeId="2" ParentId="8972" CreationDate="2013-09-27T18:55:38.627" Score="3" Body="&lt;p&gt;I was able to identify significant participants by order size on CME exchange. I think ITCH is even more informative that CME's data format. The trick is to learn very closely the incremental data and the order in which this data arrives. We can assume that exchange's Matching Engine and its market data distribution algorithm are programmed machines, therefore always process similar cases in exactly the same way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, a large aggressor order is being executed. First, you receive all the matched executions. Then you receive order book updates, caused by this executions (In fact, knowing the matching algorithm, you can predict the book updates!). &#xA;Even if there is another aggressor order waiting, its executions will not be transmitted until the previous order book updates are completed. Of cause, you need to validate this with timestamps as said above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But there are much more special cases, which I can't describe here. For example, the order may be only partially executed until reaches its limit price. It can still be detected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Such investigation can be applied on both aggressor orders and passive limit orders activity.&#xA;Below is such an example on one day of ES future. &#xA;For example, there are 11285 events of BUY 46, and just ~200 events of BUY 47. Which makes it reasonable to assume that most of orders of size 46 belong to the same trader.&#xA;Some traders attempt to &quot;hide&quot; their activity by random distribution (between 100 and 120 in this example). Also as expected there are peaks on round sizes 100, 200, ...  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/7zwuY.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After detecting distinguishing peaks of order size, you can separate certain trader to watch its behavior. The second image illustrates the activity of trader who uses order size 46. We can see its behavior before news release. It's also possible to detect his location using response time to price changes. This trader's machine is located in Europe because its response time is about 100 ms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/WzziS.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="1515" LastActivityDate="2013-09-27T18:55:38.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9030" PostTypeId="2" ParentId="8952" CreationDate="2013-09-27T19:12:52.617" Score="1" Body="&lt;p&gt;Using repeating groups is most important in transmitting the market data. One single order may generate several market data events (datablocks). Suppose, a single large aggressor order arrives to the exchange and matched against several limit orders. This generates number of trade events, and several order book updates. It's reasonable to pack all these events into a single FIX message.&lt;/p&gt;&#xA;" OwnerUserId="1515" LastActivityDate="2013-09-27T19:12:52.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9031" PostTypeId="2" ParentId="9022" CreationDate="2013-09-28T02:41:37.530" Score="2" Body="&lt;p&gt;Due to the complexity and variety of options instruments.&lt;/p&gt;&#xA;" OwnerUserId="6185" LastActivityDate="2013-09-28T02:41:37.530" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9032" PostTypeId="2" ParentId="9009" CreationDate="2013-09-28T02:53:49.233" Score="2" Body="&lt;p&gt;Yes you are correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If price of A &gt; B, then short A and long B. &#xA;When prices of A and B diverge: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;(a) because of A: Make money since A is (by pairs trading assumption) over priced and we shorted.&lt;/li&gt;&#xA;&lt;li&gt;(b) because of B: Make money since B is (again, by pairs trading assumption) under priced and we were long.&lt;/li&gt;&#xA;&lt;li&gt;(c) Because of both A and B: Both A was overpriced and B was under priced is a combination of the above two cases and we make money.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;These three cases exhaust the scenario that the prices diverged. We do not need to know which of the cases happened to make money. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more information, see &lt;a href=&quot;http://en.wikipedia.org/wiki/Pairs_trade&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Pairs_trade&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6185" LastActivityDate="2013-09-28T02:53:49.233" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9033" PostTypeId="2" ParentId="8952" CreationDate="2013-09-28T04:56:41.010" Score="1" Body="&lt;p&gt;Repeating groups are used in FIX FAST, the FIX protocol used for streaming quotes. As pointed before, they are used to relay information that fits into an array like structure, such as characteristics of the 3 trading sessions for the day, or details about an instrument, or a L2 snapshot. &lt;/p&gt;&#xA;" OwnerUserId="6186" LastActivityDate="2013-09-28T04:56:41.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9034" PostTypeId="1" AcceptedAnswerId="10045" CreationDate="2013-09-28T07:35:12.880" Score="1" ViewCount="562" Body="&lt;p&gt;Does anyone have suggestions for potential control variates for vanillas in a Heston model? I've tried black scholes with implied volatility, average volatility and long term volatility all without great success, so I'm hoping you guys got an idea.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2014-01-24T17:57:17.300" Title="Control variate for Heston model" Tags="&lt;monte-carlo&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9035" PostTypeId="1" CreationDate="2013-09-28T07:37:01.310" Score="1" ViewCount="94" Body="&lt;p&gt;I am trying to calculate IV of options for a ticker over the last 10 years.&#xA;Problem is that some option prices don't make sense (for example, closing price \$31.94, but 30-day call option with 18 days until expiration closed \$1.92 - and this happens rather a lot) and the IV result is 0, which skews my computations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought this could happen because I should use the adjusted stock prices, however it doesn't make sense to me: wasn't the price that day the original one, not the adjusted?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anybody have an idea how to solve this?&lt;/p&gt;&#xA;" OwnerUserId="4933" LastEditorUserId="35" LastEditDate="2013-09-28T16:14:00.640" LastActivityDate="2013-09-28T16:14:00.640" Title="Adjusted option prices?" Tags="&lt;options&gt;&lt;adjusted&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9037" PostTypeId="2" ParentId="9002" CreationDate="2013-09-28T11:30:52.057" Score="8" Body="&lt;p&gt;We actually managed to come up with the answer to this question ourselves but wanted to share the answer since it might be relevant to others as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The calculation depends on what method is used to calculate the cost. There is the FIFO, LIFO and the average cost method, see: &lt;a href=&quot;http://www.accounting-basics-for-students.com/fifo-method.html&quot; rel=&quot;noreferrer&quot;&gt;http://www.accounting-basics-for-students.com/fifo-method.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If FIFO or LIFO are used, there is no other way than going through each fill every time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However for the average cost method one only needs the prior values of the position (quantity, cost and realized P/L) and the latest fill (qty and price). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;These are the calculations (in shortened Java code):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;closingQty = sign(oldQty) != sign(fillQty) ? min(Math.abs(oldQty), abs(fillQty)) * sign(fillQty) : 0&#xA;openingQty = sign(oldQty) == sign(fillQty) ? fillQty : fillQty - closingQty&#xA;&#xA;newQty = oldQty + fillQty&#xA;newCost = oldCost + openingQty * fillPrice + closingQty * oldCost / oldQty&#xA;newRealizedPL = oldRealizedPL + closingQty * (oldCost / oldQty - fillPrice)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The other values can now be derived:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;averagePrice = cost / qty&#xA;marketValue = qty * currentPrice&#xA;unrealizedPL = cost - marketValue&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks to everyone. Any feedback?&lt;/p&gt;&#xA;" OwnerUserId="5530" LastEditorUserId="5530" LastEditDate="2013-09-28T11:49:00.623" LastActivityDate="2013-09-28T11:49:00.623" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="9038" PostTypeId="1" CreationDate="2013-09-28T11:57:01.907" Score="0" ViewCount="487" Body="&lt;p&gt;I'm currently involved with a project to integrate RiskMetrics into our business and one issue we've identified is the treatment of market data timing across time zones. This can have the effect of lowering correlations between securities we can otherwise observe being highly correlated. We've tried a couple of approaches to deal with the issue but none have been satisfactory in our opinion. Just wondering if anyone else has dealt with this issue and what solutions have been proposed. We have gotten to the point of considering uploading our own data series, with all the complications that come with that. &lt;/p&gt;&#xA;" OwnerUserId="5952" LastEditorUserId="35" LastEditDate="2013-09-28T16:02:07.443" LastActivityDate="2013-09-30T08:27:17.263" Title="Asynchronous Data Across Time Zones - RiskMetrics" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;risk-models&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9039" PostTypeId="1" CreationDate="2013-09-28T15:40:23.773" Score="3" ViewCount="1060" Body="&lt;p&gt;I need API access to get ForEx tickers and order books for currency pairs. From what I can tell there is a .Net API called &lt;a href=&quot;http://www.dailyfx.com/forex_forum/forexconnect/&quot; rel=&quot;nofollow&quot;&gt;ForexConnect&lt;/a&gt; which I can use to get this data. Now where can I get this data from? What services support this interface?&lt;/p&gt;&#xA;" OwnerUserId="6188" LastActivityDate="2014-02-11T03:20:54.740" Title="What Forex Services support the ForexConnect API?" Tags="&lt;programming&gt;&lt;trading&gt;&lt;automated-trading&gt;&lt;fx&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9041" PostTypeId="2" ParentId="9022" CreationDate="2013-09-28T18:02:44.963" Score="11" Body="&lt;p&gt;You need to differentiate between OTC and listed options in order to appreciate the fact market makers are still active and relevant in either segment:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Listed Options: Actually most listed options market making is governed by market making algorithms, however, most such algorithms are implemented with manual overlays. Something very similar goes on in the eFX world, where most quoting engines are fully systematized, however, spread tightening and widening can and is in fact overridden by humans who analyzed counter party profitability, trading actitivity such as frequency and such forth. This may not fully translate into listed options markets but the reason in general for listed options is that too  much can go wrong when stocks, for instance, move by 10%+ within minutes post market-impacting events. Now that is true for stock markets as well but please keep in mind that most hft participants do not have an obligation to show prices, whereas options market makers are bound to stricter liquidity provision requirements, subject to each exchange on which such options are listed. So, while most all listed options contract market making is in some way or the other automated, there still are manual overrides at force.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OTC options markets: On the rates side, please appreciate that 90%+ of underlying notional traded goes through the OTC rather than listed markets. On the equities side that is somewhat lower but still significant, especially on the index side of things. With full customizability goes aboard the ability to fully automate. Now, everything in life can be automated, given a sufficient budget and no time constraints. But in a sense what chrisaycock pointed out is actually right: Car dealers, travel agents, and a host other middle men fight hard to stay in place and try to remain indispensable. Same with most OTC options markets: Fact is that which counterparty requests quotes, at what time, in what size, and especially the chatter surrounding an OTC trade is hugely important in brokering a deal, something that would be very expensive and time consuming to automate. For example, a keen understanding whether the requested size by a client is all that client is intending to trade or whether there is more that he/she possibly attempts to deal with other counterparties is part of the core job description of any trader, as it can hugely influence expected profit and loss for the market maker. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am sure we will get there in the future, but for now most OTC market participants are not too interested in pushing into this direction simply because it also means they would cut their own fingers. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-09-28T18:09:53.887" LastActivityDate="2013-09-28T18:09:53.887" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9044" PostTypeId="2" ParentId="3486" CreationDate="2013-09-29T23:44:44.727" Score="4" Body="&lt;p&gt;Because you would make a higher profit if you sold the option on the open market at that point in time, rather than exercising it at that point in time due to the time value of money.&lt;/p&gt;&#xA;" OwnerUserId="6197" LastActivityDate="2013-09-29T23:44:44.727" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9045" PostTypeId="1" CreationDate="2013-09-30T05:56:08.590" Score="3" ViewCount="237" Body="&lt;p&gt;I have data for 3 yrs of 5 min prices of various equities. I can construct a linear regression model and try to see the in-sample model performance. But I was wondering whether fitting a state-space model might improve my model bias (performance).&#xA;I have been using R and constructed an AR(2) process (where the coefficients are estimated by MLE) using the package DLM and a Random-walk-plus-noise model but both of these do not give significant bias (model bias is typically &amp;lt; 50 %).&#xA;Also I am rolling the model as each new data comes in and re-evaluating the model parameters at each step. I do not know if holding the model for some time and forecasting multi-step ahead is gonna make my model more robust.&#xA;I tried to search online but among the various papers I got, nothing pinpoints to using a state space model for forecasting equity returns.&#xA;Does someone have any knowledge of this or can point me to a paper which deals with this?&#xA;Thanks in Advance !!&lt;/p&gt;&#xA;" OwnerUserId="6199" LastActivityDate="2013-09-30T05:56:08.590" Title="Forecasting Equity returns using state-space models" Tags="&lt;equities&gt;&lt;high-frequency&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9046" PostTypeId="2" ParentId="9038" CreationDate="2013-09-30T08:27:17.263" Score="2" Body="&lt;p&gt;as vanguard2k points out the prolem is dealt with e.g. in &lt;a href=&quot;http://arxiv.org/abs/1009.3638&quot; rel=&quot;nofollow&quot;&gt;Scaling portfolio volatility and calculating risk contributions in the presence of serial cross-correlations&lt;/a&gt; and references therein.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It turns out that correlations are lowered while lag one cross-correlations increase. E.g. you can probably see a correlation of Japan today to US yesterday due to the different closing times. The approach desribed above tries to incorporate this effect in volatility estmates for holding periods of more than one day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This approach usually yields similar estimates as using weekly data (where closing-time differences still play a role but a much smaller one). But in my mind using daily data (and handling the effects described above) is superior in ex-ante risk analysis and portfolio optimization (more reactive, more data points).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my experience you can not solve this problem by shifting data by full days. Shifting by full days however can be necessary treating funds whose pubslished NAV corresponds to a market date in the past (T-1 e.g).&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2013-09-30T08:27:17.263" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9048" PostTypeId="1" CreationDate="2013-09-30T10:40:29.373" Score="3" ViewCount="1375" Body="&lt;p&gt;In his paper &lt;a href=&quot;http://www.stanford.edu/~wfsharpe/art/q2001/q2001.htm&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;Budgeting and Monitoring the Risk of Defined Benefit Pension Funds&lt;/em&gt;&lt;/a&gt;, Bill Sharpe writes:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;[...] the sum of the weighted marginal risks of the portfolio&#xA;  components will equal twice the variance of the overall portfolio.&#xA;  This leads some to define the risk contribution of a component as half&#xA;  its marginal risk (that is, its covariance with the portfolio) so that&#xA;  a weighted average of these values will equal the variance of the&#xA;  overall portfolio. [...] it sometimes leads to an incorrect view&#xA;  that &lt;em&gt;it is possible to decompose portfolio risk into a set of additive&#xA;  components&lt;/em&gt; and to incorrect statements of the form &lt;em&gt;&quot;this manager&#xA;  contributed 15% to the total risk of the portfolio&quot;&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In the next paragraph, Bill Sharpe continues to say that the additive decomposition does make sense if all the asset's returns were indepdendent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What makes the view and the statements ((highlighted in italics) incorrect in general case, but correct when the asset returns are independent? It seems either way there is an additive decomposition of the variance, but not of the standard deviation, of portfolio returns.&lt;/p&gt;&#xA;" OwnerUserId="5599" LastEditorUserId="5599" LastEditDate="2013-09-30T11:07:04.863" LastActivityDate="2013-09-30T13:08:26.657" Title="Additive portfolio risk decomposition" Tags="&lt;risk&gt;&lt;risk-management&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9049" PostTypeId="2" ParentId="9048" CreationDate="2013-09-30T11:48:49.337" Score="1" Body="&lt;p&gt;I figure the answer is hidden in the definition of &quot;marginal contribution to risk&quot;. I try to use the notation of the paper you linked.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Marginal contribution to risk is defined as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$M_i = 2C_{ip}$ with $C_{ip}$ being the covariance between asset $i$ and the portfolio $p$.&#xA;One can now argue that, since this covariance also depends on the other assets $j\neq i$, the value $M_i$ is implicitly connected to the other assets via the correlation structure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand if all assets are &lt;em&gt;uncorrelated&lt;/em&gt;, we have that $C_{ip}=C_{ii}w_i$, since $C_{ij}=0$ for $j\neq i$. Thus, the marginal contributions do &lt;em&gt;not&lt;/em&gt; depend on the other assets. Therefore one can speak of a more &quot;pure&quot; contribution to variance in this case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, if the asset returns are &lt;em&gt;independent&lt;/em&gt;, they are also &lt;em&gt;uncorrelated&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastEditorUserId="2727" LastEditDate="2013-09-30T13:08:26.657" LastActivityDate="2013-09-30T13:08:26.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9050" PostTypeId="1" CreationDate="2013-09-30T12:20:19.597" Score="1" ViewCount="1106" Body="&lt;p&gt;How can I calculate zero-coupon rates from historical IR swap rates? I have a record of IRS for the past 4000 days and I am want to compute the zero coupon rates based on them.&lt;/p&gt;&#xA;" OwnerUserId="6202" LastEditorUserId="35" LastEditDate="2013-09-30T13:38:33.637" LastActivityDate="2013-09-30T15:22:32.857" Title="How to derive zero-coupon rates from IRS?" Tags="&lt;fixed-income&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9051" PostTypeId="1" CreationDate="2013-09-30T15:05:17.100" Score="12" ViewCount="1500" Body="&lt;p&gt;Let's take the &lt;a href=&quot;http://en.wikipedia.org/wiki/Spectral_risk_measure&quot; rel=&quot;noreferrer&quot;&gt;usual definition&lt;/a&gt; of a spectral risk measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we look at the integral we see that spectral risk measures have the property that the risk measure of a random variable $X$ can be represented by a combination of the quantiles of $X$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the quantile function is rather friendly one gets that every spectral risk measure is also a coherent risk measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Examples are the expected value and the expected shortfall (CVaR).&#xA;In those cases, the spectral representation yields a very convenient way to approximate the measure by simply weighing the quantiles of our dataset. That yields the following questions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any other known measures that have a spectral representation?&#xA;If we relax the assumptions on the spectrum $\phi$, can we obtain (approximative sequences of) other (possibly non-coherent) risk measures?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&#xA;In reaction to the comment by @Joshua Ulrich I want to provide an example of what I want to achieve and some more details.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Example: The Conditional Value at Risk. We have the following formula: $\text{CVaR}_\alpha(X) = -\frac{1}{\alpha}\int_0^{\alpha}F^{-1}_X(p)dp$. From sample $X_i$, $i=1,\ldots,N$, we can calculate the CVaR by taking the order statistics that are in the $\alpha$-tail of the sample, average, and divide by $\alpha$. We can see that this is measure has a spectral representation with $\phi(p) = \frac{1}{\alpha}$ for $p \in [0,\alpha]$ and $\phi(p) = 0$ for $p \in (\alpha, 1]$. So its easy to check: The CVaR is a spectral measure.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Obviously, the &quot;order statistics + weighted average&quot; procedure does not only work for the CVaR, it works for all spectral measures: From the definition of spectral measure we see that, after discretizing the integral, we have an approximation of the measure that is a linear combination of quantiles which is very easy to compute.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact its so easy that I would like to compute as many risk measures as possible this way (very easy if you do monte carlo or scenarios for example). For the computation only, I dont need all the assumptions about $\phi$ so lets forget about them for a moment and see what else we can calculate this way.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastEditorUserId="2727" LastEditDate="2013-10-21T07:48:35.597" LastActivityDate="2019-04-26T09:41:07.697" Title="Examples of Spectral Risk Measures" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;coherent-risk-measure&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9052" PostTypeId="2" ParentId="9050" CreationDate="2013-09-30T15:22:32.857" Score="8" Body="&lt;p&gt;I assume that you are working in a &lt;em&gt;single curve theory.&lt;/em&gt;  While this theory used to do well, it is not adapted to today's market and — as Brian B pointed it out — you cannot get a useful information from swap rates alone.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The swap rate $S(t)$ at $t$ for a given tenor $T$ and period $P$ is the fixed rate such that a swap starting at $t$ and ending at $t+T$ which exchanges $S(t)$ against the LIBOR-$P$ rate $R$ has value $0$ at $t$. (I write LIBOR for the simply compounded spot rate, which is what you are looking for.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Writing this statement in formulas gives you a linear equation whose unknowns are the rates $R(t)$, $R(t+P)$ and so on until $R(t+T)$. Considering swaps of increasingly large tenors leads to a triangular linear system that you almost can solve: but since you are likely to have much less data as what is really needed you end up using LIBOR rates to determine the zero-rate for short maturities and make simplifications to determine the zero-rate for longer maturities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance if you know the swap rates for $P = 6M$ and tenors $T$ in $1Y$, $2Y$ and $5Y$, writing the equations I described leaves you with 3 equations for 10 unknowns, and you have to make some simplifying assumptions to reduce this number of unkowns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The procedure is similar to the usual bootstrapping based on treasury bonds: the strategy is the same but the instruments used differ.&lt;/p&gt;&#xA;" OwnerUserId="6123" LastActivityDate="2013-09-30T15:22:32.857" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9053" PostTypeId="2" ParentId="8846" CreationDate="2013-09-30T15:44:51.660" Score="2" Body="&lt;p&gt;In log space the explicit solution for the density of the first passage time is the Inverse Gaussian Distribution.  See, e.g., &lt;a href=&quot;http://www.springerreference.com/docs/html/chapterdbid/205395.html&quot; rel=&quot;nofollow&quot;&gt;http://www.springerreference.com/docs/html/chapterdbid/205395.html&lt;/a&gt; or the Wikipedia page for the distribution.  The only thing that should matter is the interval from the initial state to the threshold, and that is the parameter &quot;a&quot; in the form given in the link above.&lt;/p&gt;&#xA;" OwnerUserId="915" LastEditorUserId="915" LastEditDate="2013-09-30T15:50:53.363" LastActivityDate="2013-09-30T15:50:53.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9054" PostTypeId="1" CreationDate="2013-09-30T23:02:02.420" Score="15" ViewCount="699" Body="&lt;p&gt;Say you have a portfolio with long exposure to a few linear assets (stock indices) and&#xA;short exposure to a nonlinear asset (say call options on one of the linear assets). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am interested in modelling extreme returns (negative returns) on this total portfolio for a 1-day horizon for calculation of risk measures. For linear assets this can be done with&#xA;Extreme Value Theory by fitting a Generalised Pareto Distribution (GPD) to observations over a high threshold. When it comes to portfolios including nonlinear exposure, I can only come up with two approaches which I will briefly explain:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Calculate the portfolio pseudo-historical returns (similar to historical simulation) by estimating tomorrows portfolio return from past returns, where the options would be priced (e.g. by Black-and-Scholes). Then lower tail of this empirical distribution would be fitted by GPD. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Fit GPD to both the upper and lower tail of the linear assets empirical distributions and&#xA;a kernel smoother to the middle. Then do a number of Monte Carlo simulations from these, connecting the simulated returns by a copula. The option position will priced based on the simulation.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I have not found much literature on EVT and more complex portfolio.Are any of these approaches adequate for my problem? &lt;/p&gt;&#xA;" OwnerUserId="6204" LastActivityDate="2017-08-19T00:59:33.653" Title="Extreme Value Theory possible for portfolios with options?" Tags="&lt;risk&gt;&lt;var&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9055" PostTypeId="1" AcceptedAnswerId="9059" CreationDate="2013-10-01T03:31:34.150" Score="8" ViewCount="2474" Body="&lt;p&gt;Under what circumstances can implied volatility smile be concave (ATM implied volatility higher than OTM put and call)? I know that a slight concavity is not prohibited by no-arbitrage... What are some real-life examples for that?&lt;/p&gt;&#xA;" OwnerUserId="5086" LastActivityDate="2013-11-01T01:03:36.973" Title="Concave volatility smile" Tags="&lt;implied-volatility&gt;&lt;volatility-smile&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9056" PostTypeId="2" ParentId="9039" CreationDate="2013-10-01T06:54:07.300" Score="0" Body="&lt;p&gt;ForexConnect is an API used by the FXCM broker. You can open a demo account there to connect to.&lt;/p&gt;&#xA;" OwnerUserId="225" LastActivityDate="2013-10-01T06:54:07.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9057" PostTypeId="2" ParentId="9055" CreationDate="2013-10-01T10:03:14.033" Score="4" Body="&lt;p&gt;Negative excess kurtosis leads to a concave vol smile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, no-arbitrage arguments are of theoretical nature: implied volatilities can exhibit no-arbitrate violations in the theoretical sense for extended periods given that such arbitrate cannot be traded due to other factors, such as liquidity, spreads, transaction related costs...not saying this happens often but it does at times.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="467" LastEditDate="2013-10-01T10:07:12.200" LastActivityDate="2013-10-01T10:07:12.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9059" PostTypeId="2" ParentId="9055" CreationDate="2013-10-01T14:58:59.423" Score="7" Body="&lt;p&gt;You can see concavity in &lt;em&gt;mean-reverting&lt;/em&gt; underlying assets where the option tenor is comparable to the characteristic reversion time of the asset.  For a geometric brownian motion, all underlying prices are possible, so any mean reversion or other limitation on large changes that might occur in reality would ultimately appear as a skinny tail and negative curvature.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A good example of real-life negative curvature is options on VIX futures.  I include a chart from Bloomberg data below, with the caveats that&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Bloomberg is terrible at implying vols for VIX, so one can only see this in their put vols, and&lt;/li&gt;&#xA;&lt;li&gt;Somehow I typed 3014 in the title&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Properly&lt;/em&gt; implied VIX vols do have negative curvatures as seen here, and were especially pronounced in it during 2008 and 2009 when longer tenors were available.  Typically they also have wrong-way skew, which somewhat obscures the negative curvature effects.  There are some nice charts, properly done, on page 23 of &lt;a href=&quot;http://faculty.baruch.cuny.edu/jgatheral/Bachelier2008.pdf&quot; rel=&quot;noreferrer&quot;&gt;this paper by Jim Gatheral&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Iaqad.png&quot; alt=&quot;VIX March Put Vols&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2013-10-01T16:33:40.797" LastActivityDate="2013-10-01T16:33:40.797" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9060" PostTypeId="1" AcceptedAnswerId="9066" CreationDate="2013-10-01T16:42:27.870" Score="4" ViewCount="461" Body="&lt;p&gt;If a stock price, $S(t)$, is governed by a geometric brownian motion. Is it possible to characterise the value of an option $V(S,t)$ as an ODE rather than a PDE (given $S$ is itself a function of $t$)? Hence is it possible to write a closed form solution as just a function of $t$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apologies if this is a stupid question (I'm new to QF).&lt;/p&gt;&#xA;" OwnerUserId="6210" LastEditorUserId="6210" LastEditDate="2013-10-01T17:54:58.117" LastActivityDate="2013-10-02T13:13:39.937" Title="Can option prices be characterised by an ODE?" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9061" PostTypeId="1" CreationDate="2013-10-01T17:20:54.193" Score="9" ViewCount="938" Body="&lt;p&gt;There are a lot of papers out there which make attempts to forecast or discuss the benefits of wavelets for frequency decomposition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Oddly, very few discuss the huge boundary effects that are present when used with a non infinite series (most cases I can think of in finance).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do any practical usages exist for wavelets without the benefit of hindsight?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've gone through MODWT, SWT, DWT and CWT these all look great on an existing series but terrible when used in a causal sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone out there had any luck through extending their end point via Kalman or something else before applying a wavelet?&lt;/p&gt;&#xA;" OwnerUserId="6151" LastActivityDate="2014-03-30T23:29:03.207" Title="Practical Usage of Wavelets with Real Time Data" Tags="&lt;digital-signal-processing&gt;&lt;wavelet&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9064" PostTypeId="2" ParentId="7568" CreationDate="2013-10-02T12:22:45.033" Score="1" Body="&lt;p&gt;try www.tr8tool.com.  It looks like they have a bunch of major names already mapped.&lt;/p&gt;&#xA;" OwnerUserId="6217" LastActivityDate="2013-10-02T12:22:45.033" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9065" PostTypeId="2" ParentId="1207" CreationDate="2013-10-02T12:34:23.033" Score="0" Body="&lt;p&gt;wallstreethorizon.com has historical EPS and lots of historical earnings and dividend date files. They track both the pre-announcements and the actual earnings announcements. Excellent for backtesting earnings announcement signals.  They don't do valuations.&lt;/p&gt;&#xA;" OwnerUserId="6217" LastActivityDate="2013-10-02T12:34:23.033" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9066" PostTypeId="2" ParentId="9060" CreationDate="2013-10-02T13:13:39.937" Score="8" Body="&lt;p&gt;It is not possible for what most people think of as options, but there are classes of options for which an ODE is used.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a nontrivial example, think of &lt;em&gt;perpetual&lt;/em&gt; American-exercise options.  Because of perpetual exercise, the option value is independent of time.  In place of the Black-Scholes PDE&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{\partial f}{\partial t} = \frac12 \sigma^2 x^2 f^{\prime \prime} + r x f^\prime-rf&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;we obtain the time-homogeneous ODE&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;0= \frac12 \sigma^2 x^2 f^{\prime \prime} + r x f^\prime-rf&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solving this ODE, one finds there is a barrier, $x^\star$, beyond which a perpetual American put should be executed.  The solution is a relatively simple function&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;K\left( \frac{K}{S} \left( 1-\frac{2r}{2r+\sigma^2} \right) \right)^{2r/\sigma^2}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This solution was, as far as I can tell, first derived by McKean in 1965.  As you can tell, it mainly works because we were able to remove one of the (underlying price, time) variable from the ODE.  Most options quite clearly have value that depends on both.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More trivial examples include bonds, which don't have any optionality to speak of but do follow the ODE&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{dB}{dt}= -(r+h) B&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and CDS which in the Poisson model follow the same ODE with different boundary conditions.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2013-10-02T13:13:39.937" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9068" PostTypeId="1" AcceptedAnswerId="9110" CreationDate="2013-10-02T14:52:34.177" Score="5" ViewCount="1392" Body="&lt;p&gt;I've been trying to get a grasp on some of the basics of interest rate modeling, and am looking to simulate rates using the 2 factor Hull White model, which I am aware offers a more realistic model of rates which allows for imperfect correlation between instantaneous forward rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've found resources on the web which reduce the model to an additive Gaussian one, where one has for the short rate $r(t)$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r(t) = \varphi(t) + x_1(t) + x_2(t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $x_1, x_2$ are mean reverting processes governed by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dx_1(t) = -a_1x_1(t)\cdot dx + \sigma_1\cdot dW_1(t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dx_2(t) = -a_1x_2(t)\cdot dx + \sigma_2\cdot dW_2(t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $dW_1(t)dW_2(t) = \rho$, and $\varphi(t)$ is deterministic and chosen to fit the initial forward rate curve $f(0,t)$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\varphi(t) = f(0,t) + \frac{\sigma_1^2}{2a_1^2}\left(1-e^{-a_1t}\right)^2+\frac{\sigma_2^2}{2a_2^2}\left(1-e^{-a_2t}\right)^2+\rho\frac{\sigma_1\sigma_2}{a_1a_2}\left(1-e^{-a_1t}\right)\left(1-e^{-a_2t}\right)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This tells me how to simulate the short rate (by updating $x_1,x_2$ at each time increment and adding to $\varphi$), but my question is, how could one simulate the evolution of the whole forward curve? I have also found (unwieldy) closed-form expressions for $P(t,T)$ the price of a term $T$ zero coupon bond at time $t$, from which you can obtain the forward curve, but is there a way to generate the forward curve at time $t+\Delta t$ by updating the curve at time $t$, akin to the way we can do it for the short rate $r(t)$?&lt;/p&gt;&#xA;" OwnerUserId="6213" LastActivityDate="2018-11-06T09:29:23.273" Title="How does the 2-factor Hull White model propagate the forward rates curve?" Tags="&lt;simulations&gt;&lt;yield-curve&gt;&lt;forward&gt;&lt;hullwhite&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9070" PostTypeId="1" AcceptedAnswerId="9073" CreationDate="2013-10-02T16:37:01.853" Score="0" ViewCount="472" Body="&lt;p&gt;When I look at the adjusted close prices of SP500, for example, I notice that the numbers are always significantly below the actual closing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the explanation of what adjusted prices are, one gets the impression that the Open prices for the stock on the next day that a certain event happens (such as splits or dividend pays) should be equal, or very similar to, the adjusted close price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, this is never the case. Why is there a systematic discrepancy?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Date,Open,High,Low,Close,Volume,Adj Close&#xA;2009-09-30,106.36,106.46,104.62,105.59,254383000,97.27&#xA;2009-09-29,106.51,107.02,105.78,106.00,133733900,97.65&#xA;2009-09-28,104.85,106.55,104.83,106.32,118285800,97.94&#xA;2009-09-25,104.78,105.36,104.09,104.45,204059000,96.22&#xA;2009-09-24,106.41,106.64,104.55,105.01,228636800,96.73&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm trying to evaluate a certain automated strategy but this difference is giving me a hard time to know what my position is after a trade is done. I understand that I buy and sell at the raw prices, but it's not clear to me how to properly evaluate the value of the portfolio at a given point in time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="6221" LastActivityDate="2013-10-02T20:05:25.133" Title="adjusted close prices on SP500" Tags="&lt;equities&gt;&lt;data&gt;&lt;backtesting&gt;&lt;automated-trading&gt;&lt;historical-data&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9073" PostTypeId="2" ParentId="9070" CreationDate="2013-10-02T19:59:54.727" Score="1" Body="&lt;p&gt;Adjusted series are cumulative of all events that happen after the date. Meaning, if you look at the prices on 2009-09-30, the adjusted close represents all corporate actions that happen after this date. This will create a cumulative effect causing adjusted prices farther back in time to deviate more and more from the actual prices observed that day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you look at a more recent price series and find one that has only had one corporate action you'll see a price series that more accurately reflects what you're expecting. Here is data from IBM showing from Yahoo to demonstrate:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Date        Open    High    Low     Close   Volume      Adj Close&#xA;Aug 8, 2013 189.45  189.87  186.79  187.93  4,547,600   187.93&#xA;Aug 7, 2013 189.60  189.93  188.05  188.56  3,901,700   188.56&#xA;Aug 7, 2013 0.95 Dividend&#xA;Aug 6, 2013 192.26  192.51  190.27  190.99  5,938,500   190.04&#xA;Aug 5, 2013 195.16  195.88  194.35  195.50  2,490,900   194.53&#xA;Aug 2, 2013 195.50  195.50  193.22  195.16  3,874,000   194.19&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On &lt;code&gt;Aug 6, 2013&lt;/code&gt; IBM closed at &lt;code&gt;190.99&lt;/code&gt;, went ex-dividend for &lt;code&gt;0.95&lt;/code&gt;, then opened the next day at &lt;code&gt;189.60&lt;/code&gt;. The Adjusted close for &lt;code&gt;Aug 6, 2013&lt;/code&gt; was &lt;code&gt;190.04&lt;/code&gt; representing the actual close &lt;code&gt;190.99&lt;/code&gt; less the dividend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, that the open price on the day after a corporate action does not (and likely won't) be equal to the previous days close net of the adjustment. Other factors such as overnight news will affect the next days open.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastEditorUserId="1355" LastEditDate="2013-10-02T20:05:25.133" LastActivityDate="2013-10-02T20:05:25.133" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9074" PostTypeId="2" ParentId="14" CreationDate="2013-10-02T20:00:51.273" Score="0" Body="&lt;p&gt;For future use: Here's a good link with exact formula - &lt;a href=&quot;http://www.quantessential.com/messageview.cfm?catid=3&amp;amp;threadid=24601&quot; rel=&quot;nofollow&quot;&gt;http://www.quantessential.com/messageview.cfm?catid=3&amp;amp;threadid=24601&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And here's and article with same formulas - &lt;a href=&quot;http://www.wilmott.com/pdfs/050527_haug.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.wilmott.com/pdfs/050527_haug.pdf&lt;/a&gt; (see paragraph 2.3)&lt;/p&gt;&#xA;" OwnerUserId="2870" LastActivityDate="2013-10-02T20:00:51.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9076" PostTypeId="1" CreationDate="2013-10-03T01:29:01.353" Score="2" ViewCount="389" Body="&lt;p&gt;What interest rates are used in practice in a stock index / futures arbitrage? I've seen cases, when the assumed rate is 3 months LIBOR, but does it mean, that everyone who does the arbitrage can borrow cash at it (or anyone, who can't is automatically out of the game)?&lt;/p&gt;&#xA;" OwnerUserId="1552" LastEditorUserId="848" LastEditDate="2013-10-03T05:18:50.703" LastActivityDate="2013-10-03T05:18:50.703" Title="interest rate in cost of carry" Tags="&lt;interest-rates&gt;&lt;arbitrage&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9077" PostTypeId="1" CreationDate="2013-10-03T02:06:20.183" Score="3" ViewCount="1693" Body="&lt;p&gt;According to ISDA standard (also &lt;a href=&quot;http://www.cdsmodel.com/assets/cds-model/docs/ISDA%20Standard%20CDS%20Contract%20Converter%20Specification%20-%20Sept%204,%202009.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;), the recovery rate for senior unsecured is 40%, that of subordinate is 20%, and emerging markets is 25% (both senior and subordinate).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder the rationale of applying higher recovery rate of emerging markets (subordinate) than that of the subordinate in developed countries. Could anyone explain the rationale of applying certain recovery rate for senior unsecured, subordinate and emerging markets assumed by ISDA? Is there any reference explaining such assumption on recovery rate?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="6119" LastEditorUserId="35" LastEditDate="2013-10-03T13:23:28.493" LastActivityDate="2013-10-10T03:15:21.763" Title="Question about the rationale of applying certain recovery rate by ISDA" Tags="&lt;recovery&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9078" PostTypeId="2" ParentId="9076" CreationDate="2013-10-03T03:13:08.400" Score="2" Body="&lt;p&gt;The most prudent way (imho, from a practitioner's point of view) is to chose the rate that applies to the expected lifetime of the trade, which would at the outset be the time to expiration of the futures contract. I am saying that because when you look at the futures contract mechanics the arbitrage is constructed in the way of borrowing/lending in the underlying until the contract is settled and you are obliged to either receive or deliver the underlying (cash or else underlying directly). Chose the rate the large players can borrow/lend at, not the rate you can deal at. Of course above logic does not mean one cannot square the position pre-futures expiration. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having said that I believe markets are efficient enough to preclude you from deriving a risk free profit from futures arbitrage. Even most sell side investment banks' trading systems are not agile enough to arbitrage futures contracts. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="848" LastEditDate="2013-10-03T05:18:21.840" LastActivityDate="2013-10-03T05:18:21.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9080" PostTypeId="1" AcceptedAnswerId="9083" CreationDate="2013-10-03T07:47:29.513" Score="6" ViewCount="1330" Body="&lt;p&gt;Wandering through QuantLib's &lt;a href=&quot;http://quantlib.org/reference/group__instruments.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;Financial instruments&lt;/strong&gt;&lt;/a&gt; documentation, I noticed no class for fixed-to-floater bonds exist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I was wondering what a suitable way to price such an instrument would be without the need to create a new class (in fact, fixed-to-floater should be just the discounted sum of a fixed rate bond and a floating rate one).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My idea is the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;to extract the clean price from an object of class&#xA;&lt;a href=&quot;http://quantlib.org/reference/class_quant_lib_1_1_fixed_rate_bond.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;&lt;code&gt;FixedRateBond&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; whose &lt;a href=&quot;http://quantlib.org/reference/class_quant_lib_1_1_schedule.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;&lt;code&gt;Schedule&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; has termination&#xA;date equal to the &quot;swap&quot; date and whose redemption is equal to zero;&lt;/li&gt;&#xA;&lt;li&gt;to extract the clean price from an object of class&#xA;&lt;a href=&quot;http://quantlib.org/reference/class_quant_lib_1_1_floating_rate_bond.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;&lt;code&gt;FloatingRateBond&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; whose issue date is equal to the &quot;swap&quot;&#xA;date;&lt;/li&gt;&#xA;&lt;li&gt;to sum 1 and 2.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Is the above proceeding correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any faster way?&lt;/p&gt;&#xA;" OwnerUserId="3058" LastEditorUserId="3058" LastEditDate="2013-10-03T07:54:01.467" LastActivityDate="2013-10-03T11:16:28.183" Title="Pricing Fixed-To-Floater bond in QuantLib" Tags="&lt;fixed-income&gt;&lt;quantlib&gt;&lt;floating-rate&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9081" PostTypeId="1" AcceptedAnswerId="9082" CreationDate="2013-10-03T09:25:25.790" Score="0" ViewCount="1428" Body="&lt;p&gt;I am quite notice at the business of backtesting for an automated strategy. I was wondering, can I/should I use High and Low for this purpose? On one hand, the algorithm will see these prices, but on the other, the order in which they are seen is not defined, so there is a potential ambiguity there. Also, buying at &quot;High&quot; is not realistic since the algorithm will never know that's it is the highest price for the day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What do you think or advise?&lt;/p&gt;&#xA;" OwnerUserId="6221" LastActivityDate="2013-10-03T09:53:12.787" Title="backtesting with open, close, high and low" Tags="&lt;equities&gt;&lt;backtesting&gt;&lt;automated-trading&gt;&lt;historical-data&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9082" PostTypeId="2" ParentId="9081" CreationDate="2013-10-03T09:53:12.787" Score="2" Body="&lt;p&gt;No you certainly should not use in simulation any data that you don't know in real environment because simply results will be much different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simulation should be created in environment as much possible similar to real environment. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You basically should use only Open values for making trades, High/Close/Low you can use for indicator calculation of past candles.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;High/Close states are not usable because you don't know in what order they appear, this can be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; - Open, High, Low, Close&#xA; - Open, Low, High, Close&#xA; - Open, High - 2, Low, High - 1, High, Close&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you are using OHLC data and you are calculating operation OnCandle appears then &lt;strong&gt;you can use OHLC from past candles and only Open from current&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general you can use OHLC in current candle for making trades but current candle High/Low should be created online using TickData stream.&lt;/p&gt;&#xA;" OwnerUserId="6175" LastActivityDate="2013-10-03T09:53:12.787" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9083" PostTypeId="2" ParentId="9080" CreationDate="2013-10-03T11:16:28.183" Score="5" Body="&lt;p&gt;I believe it's correct.  However, consider that it would be easy enough, and more clear, to create a new class (at least in C++; the task is more difficult if you also want to export it to Excel).  The new instrument should only inherit from &lt;code&gt;Bond&lt;/code&gt; and implement a constructor that builds the desired cash flows via a call to &lt;code&gt;FixedLeg&lt;/code&gt; and another to &lt;code&gt;IborLeg&lt;/code&gt;; you can look at the constructors of &lt;code&gt;FixedRateBond&lt;/code&gt; and &lt;code&gt;FloatingRateBond&lt;/code&gt; to see how it's done. Any other functionality would be inherited from the &lt;code&gt;Bond&lt;/code&gt; class.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2013-10-03T11:16:28.183" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9084" PostTypeId="1" CreationDate="2013-10-03T14:33:40.967" Score="1" ViewCount="124" Body="&lt;p&gt;This is more of a philosophical question than general question. Quantitative finance applies highly complicated mathematics and has attracted very smart people to this field lately given the high pay banks are willing to pay for such talent. However, in finance, the margin of error is huge because much of finance and investment relates to the future. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does it make sense to apply complicated mathematics to calculate with precision when the margin of error is +/-10%? &lt;/p&gt;&#xA;" OwnerUserId="6190" LastActivityDate="2013-10-03T14:33:40.967" Title="Does it make sense to apply complicated mathematics to calculate with precision when the margin of error is +/-10%?" Tags="&lt;mathematics&gt;" AnswerCount="0" CommentCount="2" ClosedDate="2013-10-03T20:19:36.680" ContentLicense="CC BY-SA 3.0" />
  <row Id="9085" PostTypeId="2" ParentId="2455" CreationDate="2013-10-03T14:49:59.110" Score="1" Body="&lt;p&gt;See this long document describing the methodology of the most comprehensive Northfield model&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.northinfo.com/documents/71.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.northinfo.com/documents/71.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="4910" LastActivityDate="2013-10-03T14:49:59.110" CommentCount="0" CommunityOwnedDate="2013-10-03T14:49:59.110" ContentLicense="CC BY-SA 3.0" />
  <row Id="9086" PostTypeId="1" AcceptedAnswerId="9087" CreationDate="2013-10-04T03:04:09.767" Score="3" ViewCount="241" Body="&lt;p&gt;Super basic question. I think I am doing this correctly, but just want a sanity check. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say I have a stochastic process $r(t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say I have an equation &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d(e^{\beta (t-s)}r(s))=\dots$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the $e^{\beta (t-s)}$ term is deterministic and $t\geq s &amp;gt; 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then say we want to integrate both sides from $s$ to $t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\int_s^t{d(e^{\beta (t-u)}r(u))}=\dots$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;we then have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$e^{\beta (t-t)}r(t)-e^{\beta (t-s)}r(s)=\dots$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r(t)-e^{\beta (t-s)}r(s)=\dots$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please set me straight if I have this wrong. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="5788" LastEditorUserId="5788" LastEditDate="2013-10-04T04:40:03.207" LastActivityDate="2013-10-04T04:40:03.207" Title="Integration of stochastic total derivative" Tags="&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9087" PostTypeId="2" ParentId="9086" CreationDate="2013-10-04T04:00:58.347" Score="4" Body="&lt;p&gt;I think there is a typo in your first equation.  The running variable should be $s$, as in $d\left( e^{\beta(t-s)} r(s) \right)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's start with your integral.  Let $R_u = e^{-\beta u} r_u$.  Your integral becomes&#xA;$$&#xA;e^{\beta t} \int_s^t d R_u \, .&#xA;$$&#xA;Recall that $dR_u = R_{u+du} - R_u$.  The integral evaluates to $e^{\beta t}(R_t -R_s)$, which simplifies to $r_t - e^{\beta(t-s)} r_s$, which is what you got.&lt;/p&gt;&#xA;" OwnerUserId="3188" LastActivityDate="2013-10-04T04:00:58.347" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9088" PostTypeId="1" CreationDate="2013-10-04T09:49:32.973" Score="0" ViewCount="523" Body="&lt;p&gt;I'm searching for the moments of geometric brownian motion using the gmm optimization program. the aim is to make the process y(t) of returns follows a normal distribution Are there any packages in MATLAB that are capable of this? &lt;/p&gt;&#xA;" OwnerUserId="6148" LastActivityDate="2013-10-04T10:37:58.927" Title="how to extract moments of GB from moment generating function?" Tags="&lt;finance&gt;&lt;quantitative&gt;&lt;matlab&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9089" PostTypeId="2" ParentId="9088" CreationDate="2013-10-04T10:37:58.927" Score="4" Body="&lt;p&gt;I found &lt;a href=&quot;http://www.columbia.edu/~ks20/FE-Notes/4700-07-Notes-GBM.pdf&quot; rel=&quot;nofollow&quot;&gt;these nice lecture note&lt;/a&gt; by Karl Sigman on the web. On page three you see if $X\sim N(\mu,\sigma)$ then the moment generating function (mgf) of $X$ is given by &#xA;$$M_X(s) = E(exp(sX)) = \exp( \mu s + \sigma^2 s^2 /2)$$&#xA;Thus for Brownian motion with drift $X_t$ you get &#xA;$$&#xA;M_{X_t}(s) = E(exp(s X_t)) = \exp( \mu t s + \sigma^2 s^2 t /2).&#xA;$$&#xA;Finally for $S_t = S_0 \exp(X_t)$, i.e. the geometric Brownian motion you get&#xA;$$&#xA;E[S_t^n] = S_0^n E[\exp(X_t)^n] =  S_0^n E[\exp(n X_t)] = S_0^n M_{X_t}(n),&#xA;$$&#xA;which can be calculated by the mgf of $X_t$. Then you get all moments by a simple formula.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2013-10-04T10:37:58.927" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9090" PostTypeId="2" ParentId="8964" CreationDate="2013-10-04T10:49:36.553" Score="3" Body="&lt;p&gt;To complete the perfect answer of Richard, I would add that pretending that the expected value of the GBM at $t$ is $X_0\exp(\mu t)$ amounts to claim that $E(exp X) = exp(EX)$ which is wrong “because the exponential is not linear.”  This is why there is this $\sigma^2/2$ term popping up, it is sometimes known as the “convexity correction”—the exponential being convex you have $E(exp X) \ge exp(EX)$ and you may find a more precise statement in Jensen's inequality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This could provide you with an argument which is easier to grasp as a mathematical derivation. This topic is adressed in Hull's classical book on derivatives (&lt;em&gt;12.3 The expected return&lt;/em&gt; in the 5th. edition).&lt;/p&gt;&#xA;" OwnerUserId="6123" LastActivityDate="2013-10-04T10:49:36.553" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9091" PostTypeId="1" CreationDate="2013-10-04T13:40:06.173" Score="7" ViewCount="278" Body="&lt;p&gt;This &lt;a href=&quot;https://quant.stackexchange.com/questions/848/time-series-similarity-measures&quot;&gt;question&lt;/a&gt; mentions &lt;a href=&quot;http://en.wikipedia.org/wiki/Distance_correlation&quot; rel=&quot;nofollow noreferrer&quot;&gt;distance correlation&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where has this concept been applied to financial data and provided new insight? &#xA;Do you know any examples or references?&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2019-02-19T02:32:08.667" Title="Applications of distance correlation" Tags="&lt;correlation&gt;&lt;statistical-finance&gt;&lt;dependence&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9092" PostTypeId="1" CreationDate="2013-10-04T15:23:29.030" Score="1" ViewCount="99" Body="&lt;p&gt;Consider you have a SWAP (any kind)&#xA;to hedge this SWAP, you will most likely use another Derivative,but can you use a cash|spot product to hedge this.&#xA;Like Cash Equity or FX Spot&lt;/p&gt;&#xA;" OwnerUserId="6231" LastActivityDate="2013-10-05T11:07:38.740" Title="Can you hedge a derivative with a CASH|spot product or does it have to be another derivative instrument" Tags="&lt;derivatives&gt;&lt;hedging&gt;&lt;swaps&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9095" PostTypeId="2" ParentId="8881" CreationDate="2013-10-04T19:38:54.453" Score="0" Body="&lt;p&gt;Let's generalize to the slightly more common case of an option on a spread of correlated assets $S_{1,2}$ with correlation coefficient $\rho$.  That is to say, write $s = S_1-S_2$, and you want&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;e^{-rT}\mathbb{E}\left[  (s_T-K)^+  \right]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $S_{1,2}$ follow geometric brownian motions (GBM) then the terminal distribution for $s_T$ is not in any simple form.  Let me note, however, that it is common among professionals to simply assume  $s$ follows an ordinary brownian motion with first two moments that match the corresponding moments of the &quot;true&quot; distribution, in which case the terminal distribution is a gaussian, and we can derive the option value&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;V=e^{-rT}(S_2-S_1) N\left( \frac{e^{-rT}(S_2-S_1)-K e^{-rT}}{v}  \right) + v \cdot n\left( \frac{e^{-rT}(S_2-S_1)-K e^{-rT}}{v} \right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;v := e^{rT}\sqrt{ S_1^2(e^{\sigma_1^2 T}-1)-2S_1S_2(e^{\rho \sigma_1\sigma_2 T}-1) + S_2^2 (e^{\sigma_2^2 T}-1)}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get an &quot;exact&quot; solution, you can instead observe that we write this as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{dS_1}{S_1} = r dt + \sigma_1 dW^{(1)} \\&#xA;\frac{dS_2}{S_2} = r dt + \sigma_2 \left( \rho dW^{(1)} + \sqrt{1-\rho^2} dW^{(2)}\right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in which case the expectation integral becomes&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;e^{-rT}\int_{z_1=-\infty}^{\infty} \int_{z_2=-\infty}^{\infty} (S_1(z_1)-S_2(z_1,z_2)-K)^+ n(z_1) n(z_2) dz_1 dz_2&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which we can change to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;e^{-rT}\int_{z_1=S_1^{-1}(K)}^{\infty} P( S_2^0, S_1(z_1)-K, r^\prime(z_1), \sigma^\prime(z_1) )  n(z_1)  dz_1 &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for adjusted drift $r^\prime(z_1)$ and adjusted vol $\sigma^\prime(z_1)$ in the Black-Scholes put option pricing formula $P(\cdot)$. Here for clarity $S_2^0$ indicates the initial value of $S_2$, while $S_{1,2}(\cdot)$ indicate the usual terminal value functions for GBMs using the customary volatilities and drifts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This integral is one-dimensional and can be efficiently evaluated using numerical quadrature, such as a trapezoid rule scheme.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2013-10-04T19:38:54.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9096" PostTypeId="2" ParentId="8896" CreationDate="2013-10-05T08:17:59.683" Score="1" Body="&lt;p&gt;You can have a look at :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;TradingWithPython library (TWP Library) &lt;a href=&quot;http://www.tradingwithpython.com/&quot; rel=&quot;nofollow&quot;&gt;http://www.tradingwithpython.com/&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like Quantopian / Zipline it uses Python Pandas library.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It includes an Interactive Brokers module to trade realtime.&lt;/p&gt;&#xA;" OwnerUserId="6235" LastActivityDate="2013-10-05T08:17:59.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9097" PostTypeId="2" ParentId="9092" CreationDate="2013-10-05T11:07:38.740" Score="1" Body="&lt;p&gt;Strictly speaking a vanilla swap is not really a derivative instrument, and vanilla swaps are often considered linear products. Having said that, there are a host of non-standard swap contracts on a myriad of underlying contingent assets which would make the swap qualify as a derivative non-linear instrument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Short answer is that it completely depends on the actual swap contract whether such can be hedged with cash instruments or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example: I can sell you a swap that pays on a monthly basis 5.5 times my average mood level against the rolling average monthly Nikkei225 returns. Such contract cannot be hedged with cash products because the underlying products are not all liquid and tradable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However a swap that pays an amount equal to the monthly coupon payments of a chosen traded bond vs another liquid interest rate benchmark can be easily hedged in cash instruments.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-10-05T11:07:38.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9101" PostTypeId="1" AcceptedAnswerId="9102" CreationDate="2013-10-06T04:24:49.753" Score="1" ViewCount="293" Body="&lt;p&gt;Traders hedge to reduce their risk. However, wouldn't reducing the position achieve the same results while keeping the risk management process simpler? At least, one need not worry about making the wrong hedging calculations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the pros and cons of each approach?&lt;/p&gt;&#xA;" OwnerUserId="6190" LastActivityDate="2013-10-06T09:28:27.533" Title="Is it better to hedge or reduce the position size?" Tags="&lt;hedging&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2013-10-06T15:37:17.480" ContentLicense="CC BY-SA 3.0" />
  <row Id="9102" PostTypeId="2" ParentId="9101" CreationDate="2013-10-06T09:28:27.533" Score="2" Body="&lt;p&gt;You may not be able to reduce a position. Either because there is no liquid markets (for exotic and less transparent derivatives markets) or your position is to big to reduce at once (if you take on big positions versus an institutional client (e.g., pension fund) you may not be able to go to the market to reduce it all).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Plus, the whole point of trading is to (facilitate clients and) make money. Reducing positions is less profitable than trading it out in general.&lt;/p&gt;&#xA;" OwnerUserId="6165" LastActivityDate="2013-10-06T09:28:27.533" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9104" PostTypeId="1" AcceptedAnswerId="9106" CreationDate="2013-10-06T13:11:39.077" Score="2" ViewCount="524" Body="&lt;p&gt;Leverage will increase gains when things go right but will also increase losses when things go wrong. Mathematically speaking, it does not change the risk/reward ratio (or does it?). Since investing/trading is all about getting a favorable risk/reward ratio, why do traders use leverage? &lt;/p&gt;&#xA;" OwnerUserId="6190" LastEditorUserId="3088" LastEditDate="2013-10-08T07:25:25.547" LastActivityDate="2013-10-08T07:25:25.547" Title="Why use leverage when it does not improve the risk/reward ratio?" Tags="&lt;trading&gt;&lt;leverage&gt;&lt;investing&gt;" AnswerCount="1" CommentCount="5" ClosedDate="2013-10-06T15:38:46.660" ContentLicense="CC BY-SA 3.0" />
  <row Id="9105" PostTypeId="1" CreationDate="2013-10-06T14:36:11.023" Score="1" ViewCount="1003" Body="&lt;p&gt;I recently come across Merton's model to estimate the default probability and recovery rate of the company. Here is the inputs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Market value of equity =  4,242,509,661&#xA;Debt to be paid =  3,397,334,000&#xA;equity Volatility = 34%&#xA;Risk-free rate = 0.38%&#xA;Time to maturity = 2.29&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I simply follow the way that Chapter 20 in John Hull 6th edition suggested, in which excel &quot;solver&quot; is used to find the total market value of the asset and its volatility.  However, the result is strange and I cannot get positive expected loss and recovery rate greater than 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your information, I initialize &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;V =  7,500,000,000 &#xA;sig_V = 10%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But the solution becomes&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;V =  7,500,000,000 &#xA;sig_V = 19%&#xA;Expected loss = 0.0046807&#xA;Recovery rate = 8.2132 &amp;gt; 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I initialize &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;V =  7,619,759,237 &#xA;sig_V = 10%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, the solution becomes,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;V =  7,619,759,237 &#xA;sig_V = 19%&#xA;Default probability = 0.00304&#xA;Recovery rate = 0.04853&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Did anyone come across the Merton's model before? Can anyone explain what's wrong of the model or what I did? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="6119" LastEditorUserId="35" LastEditDate="2013-10-06T15:50:45.757" LastActivityDate="2013-10-06T15:50:45.757" Title="Question about Merton model to estimate default probability and recovery rate of the company" Tags="&lt;black-scholes&gt;&lt;default&gt;&lt;recovery&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9106" PostTypeId="2" ParentId="9104" CreationDate="2013-10-06T14:40:52.160" Score="3" Body="&lt;p&gt;It is true that you don't change your risk/return ratio but you can scale the ingredients of this ratio, meaning that you can e.g. scale up the level of risk you are prepare to take to also lever up your returns. Through that mechanism you can make use of very small spreads.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2013-10-06T14:40:52.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9110" PostTypeId="2" ParentId="9068" CreationDate="2013-10-07T14:01:28.747" Score="2" Body="&lt;p&gt;The Heath-Jarrow-Morton representations of short interest rate models (such as Hull-White) will give you an expression for the evolution of the entire forward curve, but it doesn't make the problem any easier.  The closed form ZC formulae you mention above are probably your best bet.&lt;/p&gt;&#xA;" OwnerUserId="3491" LastActivityDate="2013-10-07T14:01:28.747" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9111" PostTypeId="1" CreationDate="2013-10-07T15:15:17.380" Score="2" ViewCount="424" Body="&lt;p&gt;I have the following questions for obtaining the credit rating:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Given that I have cumulative default probability of each credit rating from Global Corporate Average Cumulative Default Rates (1982-2002) in Standard &amp;amp; Poors, how can I get the recovery rate and expected loss for each credit rating?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What is the usual way to obtain the default probability and recovery rate? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="6119" LastEditorUserId="848" LastEditDate="2013-10-07T16:25:18.580" LastActivityDate="2013-10-07T16:25:18.580" Title="Obtaining the default probability and recovery rate for each credit rating?" Tags="&lt;default&gt;&lt;credit-ratings&gt;&lt;credit-risk&gt;&lt;recovery&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9113" PostTypeId="1" CreationDate="2013-10-08T02:47:43.813" Score="3" ViewCount="475" Body="&lt;p&gt;What are some indicators that a dark pool operator has effective anti-gaming controls in place? There are some that prohibit IOCs (immediate or cancel) but is that necessary? It seems like that could hurt the investor by limiting order types.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This sort-of &lt;a href=&quot;http://www.iijournals.com/doi/pdfplus/10.3905/jot.2010.5.4.010&quot; rel=&quot;nofollow&quot;&gt;user's guide to dark pools&lt;/a&gt; vaguely discusses some possible controls. Anyone have more technical knowledge?&lt;/p&gt;&#xA;" OwnerUserId="4782" LastEditorUserId="35" LastEditDate="2013-10-08T15:36:17.323" LastActivityDate="2013-11-26T14:26:59.130" Title="Effective anti-gaming controls in dark pools" Tags="&lt;market-making&gt;&lt;order-execution&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9117" PostTypeId="2" ParentId="9077" CreationDate="2013-10-08T21:32:43.263" Score="3" Body="&lt;p&gt;If the contract is actually triggered, then it will pay out depending on the actual recovery rate of the particulars of the circumstance.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To recap:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;nominal CDS recovery rate in ISDA docs - used as a convention in&#xA;the pricing of CDS contracts (spread vs upfront etc).  Has nothing&#xA;to do with any particular credit event. &lt;/li&gt;&#xA;&lt;li&gt;expected recovery rate - modeled when pricing bonds, the expectation of bond recovery in the&#xA;event of a default/credit event.&lt;/li&gt;&#xA;&lt;li&gt;actual realized recovery rate -&#xA;how much the bonds are actually trading for when a credit event is&#xA;declared, which determines the actual realized payout from the CDS&#xA;contract.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3491" LastActivityDate="2013-10-08T21:32:43.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9119" PostTypeId="1" AcceptedAnswerId="9122" CreationDate="2013-10-09T07:13:29.280" Score="1" ViewCount="81" Body="&lt;p&gt;I've seen a callable putable bond whose first exercise date is an exercise date both for the holder and the issuer. Moreover both strikes have the same value: 100. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder what does it mean. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess this bond is doomed to be redeemed at the first exercise date. Thus it's payoff is deterministic. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the impression that those contracts where issuer and holder have options at the same dates with the same strike have been poorly designed. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Am I wrong? &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6249" LastActivityDate="2013-10-09T13:17:12.583" Title="Is &quot;Issuer and Holder with same strike&quot; meaningless?" Tags="&lt;fixed-income&gt;&lt;swaption&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9120" PostTypeId="2" ParentId="9119" CreationDate="2013-10-09T12:10:11.447" Score="1" Body="&lt;p&gt;UBS launched a series of these around 1997-98.  One needs to see the Offering Memorandum to see the full details and the reference trigger for the put and call. In the case of the UBS bonds (they were the ibanker, not the issuer), they issues 3/10 and 3/30 put-table and callable bonds. What they really were (and what these probably are): the bond buyer bought a 3 year bond with an embedded UST CMT option in it that is WAY overpriced. In the case of the UBS bonds, I don't recall the specifics of the underlying option tenor, but the implied vol on the embedded option was marked up about 100% from what a similar OTC option would have traded at.  Under ALL circumstances it was a 3 year issue and the bond buyer also bought a way overpriced CMT option.  Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="6250" LastActivityDate="2013-10-09T12:10:11.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9121" PostTypeId="1" CreationDate="2013-10-09T12:17:38.177" Score="3" ViewCount="1955" Body="&lt;p&gt;Basic question to which I surprisingly did not find an answer on here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the best approximation to the break-even (with respect to stock price) for an option that was hedged fully at point of trade (and not adjusted later). (by fully I mean however many deltas the option had - not 100 deltas per option)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have seen the approximation Premium/Delta and $\sigma * (\Delta t)^{0.5}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are these model specific? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I incorrect to have thought that break-evens should be slightly asymmetric (the effect of charm will change the delta of the option leg, but the static stock hedge will not adjust)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any sources about delta hedged options are also appreciated.&lt;/p&gt;&#xA;" OwnerUserId="5054" LastEditorUserId="5054" LastEditDate="2013-10-16T22:08:02.013" LastActivityDate="2013-10-16T22:08:02.013" Title="Breakeven of a delta-hedged option" Tags="&lt;options&gt;&lt;delta-neutral&gt;&lt;delta-hedging&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9122" PostTypeId="2" ParentId="9119" CreationDate="2013-10-09T13:17:12.583" Score="2" Body="&lt;p&gt;These are relatively common, especially in convertible bonds.  You are correct that the &lt;em&gt;effective maturity&lt;/em&gt; of the bond becomes the call/put date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason for issuing them is fairly prosaic: a 10 year bond with a 3 year call/put date counts as a 10 year liability for accounting purposes, and of course a 3 year instrument for trading purposes.  The latter can help make the issue attractive to investors.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2013-10-09T13:17:12.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9124" PostTypeId="2" ParentId="9077" CreationDate="2013-10-10T03:15:21.763" Score="-1" Body="&lt;p&gt;Presuming the question refers to CDS pricing:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that a contract pays out on a credit event (no matter the scale of losses), while the value of the contract also depends on the value that can be recovered (see *NB below).  So in agreeing the price of a contract you have two variables to settle on (probability of an event, and the recovery rate).  To avoid a having a matrix of different contracts (i believe it started as such), and introduce some standardization, most (all?) CDS contracts will now use a standardized recovery rate as a pricing convention only (says nothing about the actual eventual recovery rate in case of default). Given this, the price depends only on one variable, the probability of default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;*NB Given a market price for a CDS, the higher the recovery rate you assume, the higher the default probability implied.&lt;/p&gt;&#xA;" OwnerUserId="3297" LastActivityDate="2013-10-10T03:15:21.763" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9125" PostTypeId="1" AcceptedAnswerId="9139" CreationDate="2013-10-10T06:24:24.240" Score="0" ViewCount="149" Body="&lt;p&gt;So I got risk neutral probabilities from stock option prices. How can I then map them to a physical measure?&lt;/p&gt;&#xA;" OwnerUserId="6247" LastEditorUserId="6247" LastEditDate="2013-10-10T10:44:21.163" LastActivityDate="2013-10-13T01:15:23.287" Title="Physical Option Implied Distribuition" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;research&gt;&lt;probability&gt;" AnswerCount="1" CommentCount="9" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9126" PostTypeId="1" AcceptedAnswerId="9132" CreationDate="2013-10-10T07:17:45.230" Score="4" ViewCount="1181" Body="&lt;p&gt;In Wilmott on Quantitative Finance Vol. 2, p. 528, Section 31.4.2, is given a power series expansion for a zero coupon bond&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Z(r,t;T)=1+a(r)(T-t)+b(r)(T-t)^2+c(r)(T-t)^3+\dots$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then it says to substitute this into the bond pricing equation, which is, of course&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Z_t+\frac{1}{2}w^2Z_{rr}+(u+\lambda w)Z_r-rZ=0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the result of which is given as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;-a-2b(T-t)-3c(T-t)^{2}+\frac{1}{2}\left(w^{2}-2(T-t)w\frac{\partial w}{\partial t}\right)\left(\left(T-t\right)\frac{\partial^{2}a}{\partial r^{2}}+(T-t)^{2}\frac{\partial^{2}b}{\partial r^{2}}\right)&#xA;$$&#xA;$$&#xA;\text{     }+\left(\left(u-\lambda w)-(T-t\right)\frac{\partial\left(u-\lambda w\right)}{\partial t}\right)(T-t)\left(\frac{da}{dr}+\left(T-t\right)^{2}\frac{db}{dr}\right)-r\left(1+a(T-t)+c(T-t)^{2}\right)+\dots=0&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My conundrum, for starters, is that I don't know how the first parenthical grouping in each of&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\left(w^{2}-2(T-t)w\frac{\partial w}{\partial t}\right)\left(\left(T-t\right)\frac{\partial^{2}a}{\partial r^{2}}+(T-t)^{2}\frac{\partial^{2}b}{\partial r^{2}}\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\left(\left(u-\lambda w)-(T-t\right)\frac{\partial\left(u-\lambda w\right)}{\partial t}\right)(T-t)\left(\frac{da}{dr}+\left(T-t\right)^{2}\frac{db}{dr}\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;terms came to be (and the latter line, it seems like errata for the partial in $r$, shouldn't it be $\left((T-t)\frac{da}{dr}+\left(T-t\right)^{2}\frac{db}{dr}\right)$ not preceded by the $(T-t)$ term (because when it distributes it will give the wrong power for $(T-t)$ on the $\frac{db}{dr}$ term?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I compute partial derivatives with respect to $t$, $r$, and $rr$ of $Z$ I don't get the same result for the partials of $r$ and $rr$. Obviously, some steps are missing. I do get the same first three terms as that given above, due to $Z_t$, but after that it diverges from the answer given until the $-rZ$ term at the end of the bond pricing equation (though, again, I do think it should have been a $b(T-t)^2$ instead of $c(T-t)^2$ in that last term.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know this is asking a bit much perhaps, but any help is appreciated. Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="5788" LastActivityDate="2013-10-11T16:17:29.600" Title="Yield curve fitting example in Wilmott on Quant Finance p.528" Tags="&lt;fixed-income&gt;&lt;yield-curve&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9129" PostTypeId="2" ParentId="8926" CreationDate="2013-10-11T02:23:03.467" Score="2" Body="&lt;p&gt;should be price returns, transforming your series as return=ln(Pt/Pt-1), in words, it means the natural logarithmic transformation of the ratio of price at time t to price at time t-1&lt;/p&gt;&#xA;" OwnerUserId="6267" LastActivityDate="2013-10-11T02:23:03.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9132" PostTypeId="2" ParentId="9126" CreationDate="2013-10-11T16:17:29.600" Score="6" Body="&lt;p&gt;Your observations are pretty much correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The groupings are because of the fine print &quot;&lt;em&gt;Note how I have expanded the drift and volatility terms at $t = T$; in the above these are evaluated at $r$ and $T$.&lt;/em&gt;&quot; on the same page (p.528). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, $w$ is a function of both $r$ and $t$. Since we want to use $w(r,T)$ instead of $w(r,t)$, we taylor expand $w(r,t)$ around $w(r,T)$ with respect to $t$. The same is true for functions of $w(r,t).$ Thus,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;w(r,t)^2 &amp;amp;= w(r,T)^2 + (t-T)\frac{\partial w(r,T)^2}{\partial t}\\&#xA;&amp;amp; = w(r,T)^2 -2 (T-t)w(r,T)\frac{\partial w(r,T)}{\partial t}&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same is true for $u(r,t) - \lambda w(r,t)$ where now $u$ may also be a function of $r$ and $t$:&#xA;\begin{align}&#xA;u - \lambda w(r,t) &amp;amp;= (u(r,T) - \lambda w(r,T)) + (t-T)\frac{\partial (u(r,T) - \lambda w(r,T))}{\partial t}\\&#xA;&amp;amp;= (u(r,T) - \lambda w(r,T)) - (T-t)\frac{\partial (u(r,T) - \lambda w(r,T))}{\partial t}&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this solves your conundrum.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Other points&lt;/h2&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Yes there is an errata:  it should be $\left((T-t)\frac{da}{dr}+\left(T-t\right)^{2}\frac{db}{dr}\right)$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It should have been a $b(T-t)^2$ instead of $c(T-t)^2$ in the last term as you point out at the end of your question.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="6185" LastActivityDate="2013-10-11T16:17:29.600" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9133" PostTypeId="1" AcceptedAnswerId="9134" CreationDate="2013-10-12T05:20:17.750" Score="1" ViewCount="4702" Body="&lt;p&gt;I am trying to figure out some of the commonly used approaches to deal with FX forwards (in a currency portfolio containing spots, forwards and swaps) that would allow me to calculate the one day VaR for the portfolio.  I currently only have spot prices in my historic dataset.  Any insight into this matter will be greatly appreciated.  &lt;/p&gt;&#xA;" OwnerUserId="2672" LastActivityDate="2013-10-12T10:22:25.053" Title="VaR for FX forwards" Tags="&lt;fx&gt;&lt;var&gt;&lt;forward&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9134" PostTypeId="2" ParentId="9133" CreationDate="2013-10-12T06:54:57.147" Score="3" Body="&lt;p&gt;You need to isolate the risk factors that impact your forward contract, which is your spot fx rate, and the two rates of each currency that underlies the forward contract. You therefore need to estimate the VaRs of each of those risk factors. You also need the correlations between the underlying risk factors. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, a forward to buy USD in exchange for Japanese yen breaks down to the following risk factors :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;USDJPY spot rate&lt;/li&gt;&#xA;&lt;li&gt;USD rate&lt;/li&gt;&#xA;&lt;li&gt;Yen rate&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You also need:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The VaR of each of the above risk factors&lt;/li&gt;&#xA;&lt;li&gt;The correlation between the above risk factors&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Take a look at the following which explains in very simple terms the basic concept:&#xA;&lt;a href=&quot;http://www.youtube.com/watch?v=Um8e_teI_dw&quot; rel=&quot;nofollow&quot;&gt;VaR of Forward Foreign Currency Contract&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Be careful, I find VaR a very flawed concept because it forces you to make tons of very shady assumptions, starting with the currency interest rates (in the past those were based on interbank lending rates which we all know were rigged). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Also, VaR does not capture counter party risk that arises from entering into an agreement with another party that exhibits risk of default. Keeping a big picture in mind never hurts: If you entered into forward agreements to hedge exposure to the underlying then it depends on how your risk department is setup: Most desks value forward agreements like any other asset on a daily basis, some corporates do not do such because the sole reason of the forwards is to lock in prices for future delivery and hence they do not interpret daily fluctuations in the forwards as a risk component. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-10-12T10:22:25.053" LastActivityDate="2013-10-12T10:22:25.053" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9135" PostTypeId="2" ParentId="8724" CreationDate="2013-10-12T12:40:24.290" Score="9" Body="&lt;p&gt;The Hull-White model can represents the risk free rate as a stochastic process, that is, in terms of expected return and volatility.  The zero curve only gives you expected returns and you have to find a source to calibrate volatility, as FQuant told you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Common volatility sources used for this calibration are historical series of the zero curve or swaptions volatilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do not calibrate volatilities, you will not price correctly anything more complicated than a floating note.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also please note two important short comings of the Hull-White model:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;It allows negative rates, which implies an error on the pricing of non linear (or non floored) instruments.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If payoffs are defined in terms of several rates (or the same rate at different times) then your price is likely to be sensitive to correlations of these rates, and Hull-White is not able to represent these correlations.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Point 1. was not that an issue for 10 years but now the rates are pretty low, so that in Hull-White model driven simulations there is a large proportion of rates taking negative values in the first years of the simulation. (I once saw more than 30%!)&lt;/p&gt;&#xA;" OwnerUserId="6123" LastEditorUserId="6123" LastEditDate="2013-11-14T19:43:39.227" LastActivityDate="2013-11-14T19:43:39.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9137" PostTypeId="1" CreationDate="2013-10-12T18:53:06.620" Score="1" ViewCount="383" Body="&lt;p&gt;May you can help me undertanding the following conclusion: Suppose we have an agent who has preferences over contingent claims, represented by a concave function $U$. This simply means that $\mathbb{E}U(X)\le\mathbb{E}U(Y)$ where $X,Y$ represent two claims. Now suppose that if two contingent claims have the same mean and the same variance they are indifferent for the agent. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we consider distributions concentrated on three points than the function $U$ must be quadratic. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not understand the last part, may you could show me that mathematically?&lt;/p&gt;&#xA;" OwnerUserId="6276" LastActivityDate="2013-10-12T18:53:06.620" Title="Quadratic utility function" Tags="&lt;probability&gt;&lt;finance&gt;&lt;economics&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9139" PostTypeId="2" ParentId="9125" CreationDate="2013-10-13T01:15:23.287" Score="0" Body="&lt;p&gt;You can use the &lt;a href=&quot;https://www.google.com/#q=recovery+theorem&quot; rel=&quot;nofollow&quot;&gt;Recovery Theorem&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1531" LastActivityDate="2013-10-13T01:15:23.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9140" PostTypeId="1" AcceptedAnswerId="9150" CreationDate="2013-10-13T02:14:52.950" Score="3" ViewCount="712" Body="&lt;p&gt;My &lt;a href=&quot;https://quant.stackexchange.com/questions/9126/yield-curve-fitting-example-in-wilmott-on-quant-finance-p-528&quot;&gt;last question&lt;/a&gt; is related.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the top of p. 529, it says, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;From the Taylor series expansion for $Z$ we find that the yield to maturity is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$-\frac{log Z(r,t;T)}{(T-t)}\approx-a+\left(\frac{1}{2}a^{2}-b\right)(T-t)+\left(ab-c-\frac{1}{3}a^{3}\right)(T-t)^{2}+\dots$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for short times to maturity.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know that we derive yield to maturity from the inverse of the zero coupon bond equation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Z(r,t;T)=e^{-r(T-t)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;by taking logs and dividing by $(T-t)$ and multiplying both sides by $-1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we plug the solutions for $a(r)$, $b(r)$, and $c(r)$ into the series expansion of $Z$ from p.528 we have that $Z$ is equal to &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;Z\approx-r(T-t)+(\frac{1}{2}r^2-\frac{1}{2}(u-\lambda w))(T-t)^2+...&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the solution provided on p. 529 shows that no such substitutions for the values of a, b, and c have yet been made.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking logs, dividing by $(T-t)$, and multiplying both sides by $-1$ on our equation does not give us&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$-\frac{log Z(r,t;T)}{(T-t)}\approx-a+\left(\frac{1}{2}a^{2}-b\right)(T-t)+\left(ab-c-\frac{1}{3}a^{3}\right)(T-t)^{2}+\dots$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and neither does starting with &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Z\approx 1+a(r)(T-t)+b(r)(T-t)^2+c(r)(T-t)^3$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and taking logs, etc..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, obviously I am starting from the wrong place. Can you help me see which $Z$ to start with? I don't believe it is the computations that I am having trouble with, I am having trouble seeing the plan, as Polya would say.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="5788" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2013-10-14T15:11:41.157" Title="Question on yield curve fitting from Wilmott on Quant Finance p.529" Tags="&lt;fixed-income&gt;&lt;yield-curve&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9141" PostTypeId="2" ParentId="2726" CreationDate="2013-10-13T06:01:16.147" Score="3" Body="&lt;p&gt;I have often wondered about this too.  I know it is an old thread but I had thought about asking something similar before I saw it.  Here are my thoughts:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) There is price-time priority in most (all?) equity exchanges, meaning whoever places a limit order at a price first gets their order executed first.  HFTs seem to change their mind and move quotes very fast in response to the very latest info.  So if you are a slower trader but are willing to commit to a price early and stay there, you will be filled ahead of traders with ultra-low latencies that change their minds a lot.  But as mentioned above, this will include trades where you would have like to have pulled your quotes before they are hit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) OTC dealers in illiquid products can make money without speed advantages - they often trade on the phone.  There are some advantages they have that a market maker in an electronic market would not, but maybe they have some practices that could be duplicated.  They try to avoid trading with informed counterparties (i.e. avoid buying from someone who tends to sell just before the price goes down, etc).  You would not be able to do this, but maybe you could identify time periods when you are likely to be up against better informed traders and pull your quotes.  Also, they do not rely on being able to get flat quickly like HFTs.  They instead carry inventory for relatively long periods and hedge.  Maybe you could do this if a stock was easy enough to hedge with liquid stuff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My guess - you could not compete with the fast guys to be a big player but it might be possible to find stocks where you could profitably deploy a limited amount of capital with the right strategy.  If the stock is liquid enough to do any size this way then the spreads would be too tight to make any money and it would attract more attention from informed traders.  But I am just reasoning through it and have never tried, would be very interested in hearing other perspectives.&lt;/p&gt;&#xA;" OwnerUserId="6280" LastActivityDate="2013-10-13T06:01:16.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9143" PostTypeId="2" ParentId="9140" CreationDate="2013-10-13T09:30:13.557" Score="4" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Is the author taking logs (and dividing by (T-t) etc) of our previous Z expansion from the previous page?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;He does, as you will see if you try to do the computation.  What did you prevent to find this out by yourself? (I am trying to be constructive.)&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Mathematically, it doesn't add up to what the author provides as the answer. What am I missing here?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The sequel of the book probably tells.&lt;/p&gt;&#xA;" OwnerUserId="6123" LastActivityDate="2013-10-13T09:30:13.557" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="9144" PostTypeId="1" AcceptedAnswerId="9145" CreationDate="2013-10-13T14:22:51.163" Score="1" ViewCount="3656" Body="&lt;p&gt;I am checking the closing prices(about 9000+ prices) of the stocks data to test for randomness.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The test I am using is Ljung Box test, in MFE toolbox for MATLAB, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used 300 data of closing prices, and 8 lags.&#xA;Q = test statistics.&#xA;pval = pvalue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[Q, pval] = ljungbox(closingPrices,lags);&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, no matter which 30 intervals of 300, I keep getting all the p-value as zero, meaning, reject null hypothesis and conclude that there is no serial correlation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i tried with different types of stocks, but all the p-value are all zero, which made the Ljung Box's test not very interesting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;May i know if I had used the Ljung Box Test wrongly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have any comments, please enlighten me, thank you very much.&lt;/p&gt;&#xA;" OwnerUserId="6034" LastActivityDate="2013-10-13T18:51:13.787" Title="How to apply Ljung Box Test?" Tags="&lt;time-series&gt;&lt;finance&gt;&lt;econometrics&gt;&lt;random-walk&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9145" PostTypeId="2" ParentId="9144" CreationDate="2013-10-13T18:51:13.787" Score="3" Body="&lt;p&gt;In the Ljung-Box &lt;a href=&quot;http://en.wikipedia.org/wiki/Ljung%E2%80%93Box_test&quot; rel=&quot;nofollow&quot;&gt;test&lt;/a&gt;, the null hypothesis is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$H_0$: &lt;strong&gt;&lt;em&gt;The data are independently distributed&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, your p-values of 0 indeed indicate that you should reject the null hypothesis, but it means that your data is &lt;strong&gt;&lt;em&gt;not&lt;/em&gt;&lt;/strong&gt; independently distributed, and in particular that there is some significant autocorrelation in the process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;This is obviously the case, because you use prices!!!&lt;/strong&gt; The price at time $t_{i+1}$ clearly depends of the price at time $t_i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to have an interesting result, you need to test the returns of the price series, as opposed to the prices themselves.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2013-10-13T18:51:13.787" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9146" PostTypeId="1" AcceptedAnswerId="9155" CreationDate="2013-10-13T21:04:09.443" Score="2" ViewCount="198" Body="&lt;p&gt;Sorry if this is too basic, but I have &lt;a href=&quot;https://docs.google.com/spreadsheet/ccc?key=0ApOiX8rMnwBhdEp3Y1Bma0g1OHJjNmlPZ2hnVnBuQkE&amp;amp;usp=sharing&quot; rel=&quot;nofollow noreferrer&quot;&gt;this spreadsheet&lt;/a&gt; that simulates asset growth of a portfolio under a given return and risk using MPT.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a plot of probability distribution of asset growth derived from it (return = 0.05, risk = 0.2). It shows that the variance becomes larger as you hold the asset longer.    &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/sdRbS.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This however, goes against the conventional wisdom that variance becomes smaller as you hold the portfolio longer. The simulation also shows that with return=0.05, risk=0.2, the most likely scenario (Mode) is that your asset will be at 100% on first year, 98% on fifth year and 95% on tenth year; i.e. the growth is negative. This also seems wrong.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I can't see what's wrong with the method. Here is what it's doing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1) Derive mean asset growth as follows:&#xA;    μ = LN(m)-LN((s/m)^2+1)/2&#xA;    where m is the expected return and s is the expected risk of the portfolio&#xA;&#xA;2) Derive standard deviation of asset growth as follows:&#xA;    σ = SQRT(LN((s/m)^2+1))&#xA;&#xA;3) Derive asset growth distribution as follows:&#xA;    y = 1/x*NORMDIST(LN(x),μ*n,σ * SQRT(n),FALSE)&#xA;    where y is frequency, x is asset growth, n is year&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now when you plot (x,y) for year n, you get the aforementioned chart. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions are,  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) Is the method correct according to MPT?&lt;br&gt;&#xA;b) Why does it differ from how actual asset growth behaves?  &lt;/p&gt;&#xA;" OwnerUserId="6274" LastActivityDate="2013-10-15T05:07:32.203" Title="What's wrong with this asset growth simulation?" Tags="&lt;modern-portfolio-theory&gt;&lt;simulations&gt;&lt;asset-allocation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9147" PostTypeId="1" CreationDate="2013-10-14T09:20:48.247" Score="0" ViewCount="130" Body="&lt;p&gt;I have built an asset allocation model (plain vanilla risk parity) but I would like to adapt the initial asset allocation with respect to potential futures changes in the trends of the assets under management. Let's say I'd like to add a little bit of &quot;active&quot;, staying in a quant framework. For instance, I'd like to forecast a switch in the bullish trend of fixed income securities to a bearish one and get a hedged position (reduce duration for instance) in my allocation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you please suggest the main references by either academics or professionals for quant forecasting models (macro, investors' sentiment, behavioural etc.)? Any advise would be much appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would appreciate something similar also with respect to liquidity: is there any quant model to tune my liquidity investment using forecasting methods? &lt;/p&gt;&#xA;" OwnerUserId="6282" LastEditorUserId="35" LastEditDate="2013-10-14T13:28:38.127" LastActivityDate="2013-10-14T13:28:38.127" Title="Plain vanilla risk parity with trends forecasting power" Tags="&lt;risk&gt;&lt;asset&gt;&lt;allocation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9148" PostTypeId="2" ParentId="9147" CreationDate="2013-10-14T12:22:13.353" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://www.thierry-roncalli.com/#papers&quot; rel=&quot;nofollow&quot;&gt;Thierry Roncalli&lt;/a&gt; adresses the issue of expected returns in risk parity in &lt;a href=&quot;http://www.thierry-roncalli.com/download/Dynamic-Risk-Parity.pdf&quot; rel=&quot;nofollow&quot;&gt;Introducing Expected Returns into Risk Parity Portfolios: A New Framework for Tactical and Strategic Asset Allocation&lt;/a&gt;. Maybe this preprint  contains some useful ideas for you,&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2013-10-14T12:22:13.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9149" PostTypeId="2" ParentId="9121" CreationDate="2013-10-14T12:26:00.960" Score="3" Body="&lt;p&gt;Lets give it a rough go then.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Two assumptions. (1) We disregard repo (to lend the stock you may want to short) or financing on your hedged position. And (2) We assume no trading of the gamma on the option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I would assume the break-even is equal to the expiry should be equal to... &#xA;(CALL) paidPremium/(1-hedgedDelta) + callStrike&#xA;(PUT) putStrike - paidPremium/(1-hedgedDelta)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume you pay 2.5 USD for a ATM CALL that is hedged ATM with delta 52%. You only make money if on expiry the spot it above your strike and you then only make money on (100-52) 48% delta that you have run. So you need to make 2.5 USD with 48% delta (is 5.21 USD per 'unhedged' delta). Which puts the breakeven-spot at 105.21?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other way around you can find it by dividing the premium by the hedged delta and take the hedge-level minus that value (for a CALL). The your short hedge has paid for the premium.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(sorry, i am not familiar with including formula's)&lt;/p&gt;&#xA;" OwnerUserId="6165" LastActivityDate="2013-10-14T12:26:00.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9150" PostTypeId="2" ParentId="9140" CreationDate="2013-10-14T15:11:41.157" Score="3" Body="&lt;p&gt;As @michipilli said, if&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$Z = 1+ as + bs^2 + cs^3$  (where I have substituted $T-t$ by $s$ for ease of notation and also suppressed the dependencies of $a$, $b$ and $c$) and &lt;/li&gt;&#xA;&lt;li&gt;$\log (1+\zeta) = \zeta - \frac{1}{2}\zeta^2 + \frac{1}{3}\zeta^3 + ...$ then,&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;\log Z &amp;amp;= (as + bs^2 + cs^3) - \frac{1}{2}(as + bs^2 + cs^3)^2 + \frac{1}{3}(as + bs^2 + cs^3)^3 + ...&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;-\frac{\log Z}{s} &amp;amp;= -\frac{1}{s}(as + bs^2 + cs^3) +\frac{1}{2s}(as + bs^2 + cs^3)^2 - \frac{1}{3s}(as + bs^2 + cs^3)^3 + ...&#xA;\end{align*}&#xA;Now,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$(as + bs^2 + cs^3)^2 = a^2s^2 + b^2s^4 + 2acs^4 + 2abs^3 + o(s^5)$&lt;/li&gt;&#xA;&lt;li&gt;$(as + bs^2 + cs^3)^3 = a^3s^3 + 3a^2bs^4 + o(s^5)$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Substituting back we get&#xA;\begin{align*}&#xA;-\frac{\log Z}{s} &amp;amp;= -a - bs - cs^2 + \frac{a^2s}{2} + \frac{b^2s^3}{2} + acs^3 + abs^2 - \frac{a^3s^2}{3} - a^2bs^3 + o(s^3)\\&#xA;&amp;amp;= -a + \left(\frac{a^2}{2} - b\right)s + \left(ab -c -\frac{a^3}{3}\right)s^2 + o(s^3)&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is what you desire.&lt;/p&gt;&#xA;" OwnerUserId="6185" LastActivityDate="2013-10-14T15:11:41.157" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9152" PostTypeId="1" AcceptedAnswerId="9154" CreationDate="2013-10-14T16:45:55.370" Score="-2" ViewCount="1536" Body="&lt;p&gt;Since the VIX is an annualized volatility, to convert it into other frequencies we must divide by the square root of time. So to convert a VIX of 15 into daily volatility, we would need to divide &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{15}{\sqrt{252}} = .94&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Monthly volatility is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{15}{\sqrt{12}} = 3.4&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and a quarterly volatility is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{15}{\sqrt{4}} = 7.5&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Two questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Why is it that if I multiply a monthly vol of 3.4 by 3 to convert it to quaretly, I do not get 7.5?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;20-day (i.e. monthly) realized volatility on the SPX is 17.29%. How is it that the monthly VIX is only 3.4%? Is the options marketing trading at such a low premium to realized vol?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/gXoZ4.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="4729" LastEditorUserId="4729" LastEditDate="2013-10-14T23:13:24.387" LastActivityDate="2018-09-12T20:53:39.673" Title="Volatility Scaling" Tags="&lt;vix&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9153" PostTypeId="2" ParentId="9152" CreationDate="2013-10-14T18:25:50.763" Score="3" Body="&lt;p&gt;$$&#xA;\frac{15}{\sqrt{12}} \approx 4.33&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;4.33 \times \sqrt{3} \approx 7.5&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="6127" LastEditorUserId="35" LastEditDate="2013-10-14T19:06:04.150" LastActivityDate="2013-10-14T19:06:04.150" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9154" PostTypeId="2" ParentId="9152" CreationDate="2013-10-14T21:00:06.687" Score="2" Body="&lt;p&gt;With regards to part 2, SPX monthly realized volatility is not 17% (I think what you're looking at is the last 20 days worth of data annualized). Annualized realized for the last 20 days worth of data is around 13% which means that monthly is around 3.75%. Thus, monthly VIX is above SPX realized which is normal in a low vol environment.&lt;/p&gt;&#xA;" OwnerUserId="5054" LastEditorUserId="5054" LastEditDate="2018-09-12T20:53:39.673" LastActivityDate="2018-09-12T20:53:39.673" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="9155" PostTypeId="2" ParentId="9146" CreationDate="2013-10-14T22:33:03.180" Score="4" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;This however, goes against the conventional wisdom that variance becomes smaller as you hold the portfolio longer.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Which conventional wisdom says this?  If the variance decreases with time, then the likelyhood of getting a return close to the &lt;em&gt;expected return&lt;/em&gt; increases (Cecbycev's inequality).  So you are telling me, I know more about the long-time future as about the short-time future.  It sounds really weird to me.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;i.e. the growth is negative. This also seems wrong.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Why does it seem wrong?  If you have a very high risk and a low return, you will most probably make a loss—beacause the log-normal distribution is not symmetrical—and this is what your spreadhseet tells you.  I do not understand why you are disatisfied or puzzled by this. Explore the spreadsheet by varying numbers.&lt;/p&gt;&#xA;" OwnerUserId="6123" LastEditorUserId="6123" LastEditDate="2013-10-15T05:07:32.203" LastActivityDate="2013-10-15T05:07:32.203" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9156" PostTypeId="2" ParentId="4775" CreationDate="2013-10-14T23:57:50.020" Score="3" Body="&lt;p&gt;Finance Journal Rankings: &#xA;Check this out:&#xA;&lt;a href=&quot;http://www.ubc.ca/okanagan/management/__shared/assets/ASA_Financial_Rankings19547.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.ubc.ca/okanagan/management/__shared/assets/ASA_Financial_Rankings19547.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6285" LastActivityDate="2013-10-14T23:57:50.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9159" PostTypeId="1" AcceptedAnswerId="9163" CreationDate="2013-10-15T14:10:31.110" Score="2" ViewCount="852" Body="&lt;p&gt;I'd like to research the impact of certain events and characteristics on the liquidity of the stocks over time. I've got a sample of 200 stocks and I use several measures of liquidity (Amihud, Bid-Ask spread, etc.). I've got around 5000 trading days and the data consists of all values of interest over time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example I made an index of Corporate Governance of the firm, allowing it to have a score from 1 to 10. Or I have a variable expressing the media coverage on that firm. And of course market cap, number of outstanding shares, free float, price, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first task, I'd guess, would be to model/measure 'normal liquidity' that is without certain events occurring. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this just regression with a lot of control variables or is this time series analysis? Or a combination... how should I start? Any introductionary resources would be welcomed.&lt;/p&gt;&#xA;" OwnerUserId="2402" LastActivityDate="2013-10-17T11:28:37.557" Title="Time Series or Regression" Tags="&lt;time-series&gt;&lt;equities&gt;&lt;regression&gt;&lt;liquidity&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9160" PostTypeId="2" ParentId="9159" CreationDate="2013-10-15T14:31:32.687" Score="0" Body="&lt;p&gt;Before you start, you might like to consider the following.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have a method to measure 'normal liquidity', you next might like to 'black out' the periods within your time series that are around your past events. This would require some logic and common sense. You can then calculate your measure of 'normal liquidity' with and without these events included. &lt;/p&gt;&#xA;" OwnerUserId="5775" LastActivityDate="2013-10-15T14:31:32.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9161" PostTypeId="1" CreationDate="2013-10-15T15:09:54.397" Score="12" ViewCount="880" Body="&lt;p&gt;I am looking for good papers of short term (&amp;lt;30 sec) volatility estimation AND short term volatility forecasting.&#xA;Do you have something in mind ?&lt;/p&gt;&#xA;" OwnerUserId="5339" LastEditorUserId="2299" LastEditDate="2013-10-27T08:55:31.703" LastActivityDate="2014-12-16T19:17:44.127" Title="What good papers of short term (&lt;30 seconds) volatility estimation" Tags="&lt;volatility&gt;&lt;high-frequency&gt;&lt;estimation&gt;&lt;market-microstructure&gt;&lt;high-frequency-estimators&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="11" ClosedDate="2014-12-17T01:22:04.977" ContentLicense="CC BY-SA 3.0" />
  <row Id="9162" PostTypeId="1" AcceptedAnswerId="9202" CreationDate="2013-10-15T16:16:01.907" Score="0" ViewCount="236" Body="&lt;p&gt;I am really struggling to prove to myself that when we can estimate the one-year holding period return for a three-year zero by using the following estimation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;S3 - Duration2*(f1,3- S3)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where Sn is spot rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I don't get is why duration is subscript to 2 instead of 3? I thought we can measure capital gain/loss approximately by taking the duration  multiplied by yield change.  How does (f1,3 -S3) measure the change in yield? Well let's say it's becoming a 2-year zero. Then why does it match to a duration of 2? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To me what is difficult is the fact that we are getting a different bond altogether (changing yield and changing duration), while the typical interpretation of yield change is constant duration and a parallel shift in interest rates.&lt;/p&gt;&#xA;" OwnerUserId="6287" LastActivityDate="2013-10-18T20:29:09.190" Title="Bond duration as estimation to holding return" Tags="&lt;return&gt;&lt;duration&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9163" PostTypeId="2" ParentId="9159" CreationDate="2013-10-15T16:43:41.153" Score="3" Body="&lt;p&gt;Definitely time series analysis. What you essentially want to do is some form of impact analysis. this can be done naturally using multivariate time series models like Vector Auto Regression models. Also when working with data to model liquidity you might want to use some specialized procedures like GARCH and ACD. Further there are methods to model non stationarities and there are extensions to non-linearities as well. Definitely time series analysis.&lt;/p&gt;&#xA;" OwnerUserId="6289" LastActivityDate="2013-10-15T16:43:41.153" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9166" PostTypeId="1" CreationDate="2013-10-16T09:02:04.973" Score="8" ViewCount="8568" Body="&lt;p&gt;We need to build a Fixed Income Portfolio Risk Analytics solution. Somehow due to administrative reason we can't use Quantlib which is written in C++, even call it through SWIG via JNI.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have tried Jquantlib, but it seems not 100% replica of original Quantlib which is written in C++ have bugs( for e.g. root not bracketed error in bond yield calculation).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So right now we can see two options &lt;a href=&quot;http://strata.opengamma.io/&quot; rel=&quot;nofollow noreferrer&quot;&gt;opengamma&lt;/a&gt;&#xA;and &lt;a href=&quot;https://github.com/odeyemis/maygard&quot; rel=&quot;nofollow noreferrer&quot;&gt;Maygard&lt;/a&gt; (the google &lt;a href=&quot;http://code.google.com/p/maygard/&quot; rel=&quot;nofollow noreferrer&quot;&gt;archive&lt;/a&gt;) which is written in Pure Java.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can any experienced users share their views on this two library or if they know any better pure Java-based libary alternative.&lt;/p&gt;&#xA;" OwnerUserId="3456" LastEditorUserId="26353" LastEditDate="2017-02-01T08:42:09.367" LastActivityDate="2020-10-28T12:52:40.020" Title="What is the best alternative of Quantlib library" Tags="&lt;fixed-income&gt;&lt;programming&gt;&lt;quant-trading-strategies&gt;&lt;risk-management&gt;&lt;quantlib&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="9167" PostTypeId="1" AcceptedAnswerId="9183" CreationDate="2013-10-16T09:05:53.503" Score="8" ViewCount="1770" Body="&lt;p&gt;Wikipedia defines the Epps effect as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In econometrics and time series analysis, the Epps effect, named after T. W. Epps, is the phenomenon that the empirical correlation between the returns of two different stocks decreases as the sampling frequency of data increases. The phenomenon is caused by non-synchronous/asynchronous trading and discretization effects.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Epps wrote this paper in 1979 and the speed of information propagation has increased dramatically since.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this effect still exist? If it does, what is the time horizon in practice when does the &quot;decoupling&quot; of assets happen now?&lt;/p&gt;&#xA;" OwnerUserId="2727" LastEditorUserId="2299" LastEditDate="2013-10-27T09:00:09.563" LastActivityDate="2013-10-27T09:00:09.563" Title="When does the Epps effect start?" Tags="&lt;correlation&gt;&lt;high-frequency&gt;&lt;market-data&gt;&lt;market-microstructure&gt;&lt;high-frequency-estimators&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9168" PostTypeId="1" AcceptedAnswerId="9310" CreationDate="2013-10-16T09:41:53.620" Score="11" ViewCount="1807" Body="&lt;p&gt;Assume some equity traded on a given exchange based on an &lt;em&gt;electronic limit open-order book&lt;/em&gt; $B$ that makes sequential updates as a function of time $t$. What are &quot;natural&quot; or common price functions $P: B \rightarrow \mathbb{R}_{\ge0}$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Two natural price functions are&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The average of the best bid and best offer&lt;/li&gt;&#xA;&lt;li&gt;The price of the most recent transaction&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;A disadvantage of the first price function is that it doesn't take into account the whole depth of the book. A disadvantage of the second price function is that it only updates when a transaction occurs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there more sophisticated price functions that take into account the whole depth of the book, and change for every update to the order book?&lt;/p&gt;&#xA;" OwnerUserId="3098" LastEditorUserId="3098" LastEditDate="2013-10-31T09:00:05.543" LastActivityDate="2013-10-31T13:30:52.290" Title="Price functions based on order book events" Tags="&lt;equities&gt;&lt;pricing&gt;&lt;market-microstructure&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="9171" PostTypeId="1" CreationDate="2013-10-16T20:26:41.883" Score="2" ViewCount="965" Body="&lt;p&gt;I'm relatively new in this field, so I have a couple of points that I need to clarify.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to know how I can estimate the correlation matrix necessary to implement a Cholesky decomposition for a model that has two different sources of risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's take for example an Heston model where we have two Brownian motions, $W_{s}$ and $W_{v}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of a portfolio composed by two stocks, in order to be able to simulate correlated paths:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;How do I estimate the correlation matrix of the variance process for the two stocks? Moving average std or other methods?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Because in Heston model $W_{s}$ and $W_{v}$ are correlated, so that we have  $\rho_{1}=corr(W_{1s},W_{1v})$ for the first asset and $\rho_{2}=corr(W_{2s},W_{2v})$ for the second asset, do I have to get two different matrixes of dimension $2\times2$ (one for each stock) or one matrix of dimension $4\times4$? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance!&lt;/p&gt;&#xA;" OwnerUserId="6297" LastEditorUserId="35" LastEditDate="2013-10-17T03:01:31.580" LastActivityDate="2013-11-16T21:06:10.363" Title="Correlated Wiener processes of different factors" Tags="&lt;correlation&gt;&lt;heston&gt;&lt;cholesky&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9172" PostTypeId="1" CreationDate="2013-10-16T21:03:54.617" Score="7" ViewCount="830" Body="&lt;p&gt;Let's take a GBM under $P$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS=\mu dt+\sigma dW_{t}^{P}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and then under $Q$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS=r dt+\sigma dW_{t}^{Q}$, where $dW_{t}^{Q} = dW_{t}^{P} + (\mu - r)/\sigma dt $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, let's say that I have calibrated my model on the mkt option prices (using B&amp;amp;S) getting the parameters that i need. Question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I have to simulate the path subtracting from $W^{Q}$ the market price of risk? Or what i only need is a brownian motion (knowing that $r$ in the drift part is already the result of the change of measure)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="6297" LastEditorUserId="6297" LastEditDate="2013-10-17T06:16:22.533" LastActivityDate="2017-11-14T09:53:44.400" Title="SDE simulation: P or Q?" Tags="&lt;simulations&gt;&lt;risk-neutral-measure&gt;&lt;girsanov&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9175" PostTypeId="1" AcceptedAnswerId="9177" CreationDate="2013-10-17T09:13:05.377" Score="2" ViewCount="544" Body="&lt;p&gt;Say, 4-legged multi-leg options order with below leg&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Order Qty - 100&#xA; - Buy 1 Option1 IBM 35 call 20160925&#xA; - Sell 2 Option2 IBM 25 put 20160827&#xA; - Buy 3 Option3 IBM 35 call 20150620&#xA; - Sell 4 IBM stock leg&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What would be the side of the entire complex options order above?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because another order of same legs can come with inverted sides later, which can trade with first order?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For this purpose, I need to determine side based on some approach, so I can Buy/Sell side in each case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What exactly is buying/selling above 4-legged(with one stock leg) mean and how to determine side in the system so as to match the identical vs inverted(opposite sides on legs) orders?&lt;/p&gt;&#xA;" OwnerUserId="6303" LastEditorUserId="6303" LastEditDate="2013-10-17T20:05:07.020" LastActivityDate="2013-10-22T00:20:11.043" Title="What is most reasonable approach to determine side of a multi-leg options order?" Tags="&lt;options&gt;&lt;option-strategies&gt;&lt;spread&gt;&lt;spread-options&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9176" PostTypeId="2" ParentId="9172" CreationDate="2013-10-17T09:17:39.707" Score="10" Body="&lt;p&gt;It depends on the purpose of your simulation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to model the asset price path for pricing some derivative then you need the risk-neutral measure (thus you take the risk-less rate as drift). &#xA;Why? Because the risk-neutral measure makes your pricing compatible with the pricing of other contracts in the market. It makes the prices consistent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to do some kind of risk management or portfolio optimization then you need the real world probability measure.&#xA;Why? Because if you want to model the asset statistically then you need the real drift (or some ad-hoc drift, or no drift at all).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Check the equation again: your SDE is not GBM - it should say $dS/S$ on the left-hand side.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2017-11-14T09:53:44.400" LastActivityDate="2017-11-14T09:53:44.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9177" PostTypeId="2" ParentId="9175" CreationDate="2013-10-17T11:07:29.460" Score="3" Body="&lt;p&gt;It depends on the exact structure. E.g., a butterfly can be bought or sold and every market participant understands which individual options are bought or sold given knowledge of the agreed spot level and distance of the wing from spot in regards to agreed strikes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please note that a butterfly can be structured as a combination of calls but also through puts due to the put-call parity argument that generally holds. I am saying this because just buying or selling &quot;a structure&quot; will introduce lots of ambiguity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above is just an example (3-legged), so an accurate answer cannot be given for the information you provided. Your 4-legged structure can turn out to be several different structures. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I recommend you always communicate the actual legs even if you trade an option structure, most every dealer trading option structures will include the actual legs and their sides to avoid confusion. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-10-17T11:18:00.883" LastActivityDate="2013-10-17T11:18:00.883" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9178" PostTypeId="1" AcceptedAnswerId="9188" CreationDate="2013-10-17T11:10:26.240" Score="2" ViewCount="14501" Body="&lt;p&gt;For a specific bond I need to calculate the time until each of the upcoming cash flow payments (for obvious reasons). So I wondered if there is a field (bulk data) that gives me all the dates of the coupons (if any)?&#xA;I tried the FLDS command but found nothing...&lt;/p&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2013-10-17T21:02:52.700" Title="Is there a Bloomberg field for a bonds (upcoming) coupon dates?" Tags="&lt;data&gt;&lt;fixed-income&gt;&lt;market-data&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9179" PostTypeId="1" CreationDate="2013-10-17T11:20:32.527" Score="10" ViewCount="3046" Body="&lt;p&gt;I am a bit new to this, and am trying to understand the concepts of the risk neutrality in interest-rate models. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I can't seem to understand is why the Vasicek model is risk-neutral? Following some logic in Wilmott's books about risk drift and risk-neutral drift, the drift term ($dr = \mbox{drift} \times dt + \mbox{vol} \times dX$) has to be compensated with a $\mbox{lambda} \times \mbox{vol}$ factor, i.e. market price at risk times volatility. This is not the case for the Vasicek model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see that there is some big concept I am missing, and as I said I am new to this so anyone who can explain this to me, please, I would be very grateful. &lt;/p&gt;&#xA;" OwnerUserId="6304" LastEditorUserId="35" LastEditDate="2013-10-17T13:35:32.530" LastActivityDate="2018-08-19T05:07:26.473" Title="Is Vasicek risk neutral?" Tags="&lt;interest-rates&gt;&lt;risk-neutral-measure&gt;&lt;vasicek&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9180" PostTypeId="2" ParentId="9159" CreationDate="2013-10-17T11:28:37.557" Score="3" Body="&lt;p&gt;&lt;strong&gt;Breakpoint approaches&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Test based&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be well received in a financial econometrics journal, you want test-based approaches. Depending on your question it is common to see a linear regression (least squares) where the parameter suspected of breaking is interacted with an indicator function $I(E)$ where $E$ is the event in question; this function assumes a unit value when $E$ occurs. This is almost always specified exogenously; see e.g. the contagion literature.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is less common but in some applications a VAR or VECM is what you want. You will want to review Joyeux (2007) for various test based breaking models within a VECM framework. Note that data generating process of your model is going to be restricted simply because the asymptotics haven't been worked out for many alternatives - this logically follows from how recent Johansen's framework is as well as the complexity of VARs/VECMs versus completely linear single equation models. It may be interesting to look at the impulse response functions of the models in different regimes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Endogenous approaches also fall under test based approaches. Here it is typical to analyse the residuals of an unbroken model and to determine the time location where the residuals is statistically 'large'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another typical approach is to fit a market model around the event and do a test on the cumulative abnormal returns. There is a dauntingly deep literature on how to get an unbiased test statistic in this instance. You may want to look into the 1980s paper by Sefcik and Thompson and GLS/WLS derivatives of this paper. They provide a dummy breakpoint framework which is statistically equivalent to the CAR approaches, and in my opinion more interpretable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other avenues:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Contagion literature (truly gigantic).&lt;/li&gt;&#xA;&lt;li&gt;Financial integration literature (stock and bond markets).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Non test based&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These are harder to publish: event studies basically need a test. But to get a truly thorough idea of what's happening - much better than a test in my opinion in all real world applications - to all your time series around the event, look at a power spectrum of your time series. This is done with the click of a button in the &lt;code&gt;biwavelet&lt;/code&gt; package in &lt;code&gt;R&lt;/code&gt; (there are around 10 others). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is for qualitative understanding - no official test comes from this. It is therefore not likely to publish (unless you're going for econophysics journals such as Physica A where you might not get an economist reviewer).&lt;/p&gt;&#xA;" OwnerUserId="6081" LastActivityDate="2013-10-17T11:28:37.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9181" PostTypeId="2" ParentId="9178" CreationDate="2013-10-17T12:07:52.830" Score="2" Body="&lt;p&gt;I am not sure if the exact upcoming coupon dates can be retrieved in BBG, but using the fields:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;DAYS_TO_NEXT_COUPON&lt;/strong&gt; or &lt;strong&gt;NXT_CPN_DT&lt;/strong&gt; (Days to next coupon / next coupon date)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;plus&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;CPN_FREQ&lt;/strong&gt; (coupon frequency)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;it should be easy to calculate the time until each upcoming coupon date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, these coupon dates would be an approximation (ie: they might be off by a couple of days), so I am not sure if this appraoch is good enough for you.&lt;/p&gt;&#xA;" OwnerUserId="5208" LastActivityDate="2013-10-17T12:07:52.830" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9182" PostTypeId="2" ParentId="9179" CreationDate="2013-10-17T13:27:08.050" Score="3" Body="&lt;p&gt;Vasicek model has parameters, which allow it to be calibrated to market prices (this means it becomes risk-neutral) or, if you'd like to, to history (and it becomes real-world model).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example of calibration to history see here: &lt;a href=&quot;http://www.sitmo.com/article/calibrating-the-ornstein-uhlenbeck-model/&quot; rel=&quot;nofollow&quot;&gt;http://www.sitmo.com/article/calibrating-the-ornstein-uhlenbeck-model/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Me thoughts on calibration to market see here: &lt;a href=&quot;http://guseynovrv.wordpress.com/2013/02/11/calibration-of-vasicek-model-part-iii-fitting-to-market/&quot; rel=&quot;nofollow&quot;&gt;http://guseynovrv.wordpress.com/2013/02/11/calibration-of-vasicek-model-part-iii-fitting-to-market/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPD. Few words more: change of drift with market price of risk so that to obtain risk neutral process is possible with IR models, but is not practical. See example here:  &lt;a href=&quot;http://www.ressources-actuarielles.net/EXT/ISFA/1226.nsf/0/0daceb518d4ed890c12576fe00412e59/&quot; rel=&quot;nofollow&quot;&gt;http://www.ressources-actuarielles.net/EXT/ISFA/1226.nsf/0/0daceb518d4ed890c12576fe00412e59/&lt;/a&gt;$FILE/MPR%20Ahmad-IS27v2.pdf&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's why calibration is the main tool with IR models.&lt;/p&gt;&#xA;" OwnerUserId="2870" LastEditorUserId="2870" LastEditDate="2013-10-17T13:56:35.500" LastActivityDate="2013-10-17T13:56:35.500" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9183" PostTypeId="2" ParentId="9167" CreationDate="2013-10-17T15:14:46.010" Score="7" Body="&lt;p&gt;I think it's alive and well. I don't think there's a specific &quot;decoupling&quot; time, but if you look at e.g. Munnix et al. &quot;&lt;a href=&quot;http://arxiv.org/abs/1009.6157&quot; rel=&quot;noreferrer&quot;&gt;Statistical causes for the Epps eﬀect in microstructure noise&lt;/a&gt;&quot;, it seems that the biased correlation is about 60% of the real value for 1 min data and about 90% for 5 min data, so you could say that 5 min is pretty safe, but 1 min is probably not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FYI, for example Zhang et al. &quot;&lt;a href=&quot;http://scholar.google.fi/scholar?hl=en&amp;amp;q=Estimating%20Covariation%3a%20Epps%20Effect,%20Microstructure%20Noise&amp;amp;btnG=&amp;amp;as_sdt=1,5&amp;amp;as_sdtp=&quot; rel=&quot;noreferrer&quot;&gt;Estimating Covariation: Epps Effect, Microstructure Noise&lt;/a&gt;&quot; present a fairly straightforward way to effectively remove the Epps effect by considering a certain difference of correlations such that the Epps effect/ bias cancels. It works if you happen to have the real tick data at hand, but if you only have, say, 1 min data from a broker etc. then I guess you pretty much have to live with the Epps effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think it is still better to use 1 min data instead of e.g. 5 min data due to the increased resolution (though I'm not sure). It's just that for 1 min data the correlations &lt;em&gt;could&lt;/em&gt; be better estimated by taking the Epps effect into account.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: By the way, the data in the Munnix paper seemed to be from 2007, so maybe things have changed since then...&lt;/p&gt;&#xA;" OwnerUserId="5636" LastEditorUserId="5636" LastEditDate="2013-10-17T18:07:03.027" LastActivityDate="2013-10-17T18:07:03.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9184" PostTypeId="2" ParentId="9171" CreationDate="2013-10-17T15:51:13.957" Score="1" Body="&lt;p&gt;You need to obtain a $4 \times 4$ correlation matrix.  As you effectively observe, you have four random processes driving the system, with $i \in 1,2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{dS_i}{S_i} = \mu_i dt + \sqrt{v_i} dW_{Si} \\&#xA;dv_i = \kappa(\bar{v}_{i}-v_i) dt + \xi \sqrt{v_i} dW_{vi}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each of the $W_{ji},j\in\{S,v\},i\in 1,2$ is a brownian motion correlated with the others, with coefficient $\rho_{i_1,j_1}^{i_2,j_2}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because $v$ is not observed, you cannot work backwards from historical market data to values of $W_{ji}$, so you cannot obtain correlations in the &quot;usual&quot; manner.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can estimate the parameters of each individual model (including the $\rho_{i,j_1}^{i,j_2}$ values) either by calibrating to historical time series data or to the options markets (depending on your application).  This leaves you with a set of cross correlations $\rho_{i_1,j_1}^{i_2,j_2},i_1\neq i_2$ to estimate, and you probably lack basket options to calibrate them from.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can calibrate these historically, perhaps using &lt;a href=&quot;http://web.mit.edu/~wingated/www/introductions/mcmc-gibbs-intro.pdf%E2%80%8E&quot; rel=&quot;nofollow&quot;&gt;Gibbs Sampling&lt;/a&gt; due to the complexity of the joint terminal distribution.  Alternatively, you could just go with estimates based on simple relationships.  That is, set&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\rho_{1,S}^{2,S} = \text{Corr}\left( \text{Ret}(\{S_1\}), \text{Ret}(\{S_2\}) \right)\\&#xA;\rho_{1,v}^{2,v} = \text{Corr}\left( \left\{\sigma_1^{\text{implied}}\right\}, \left\{\sigma_2^{\text{implied}}\right\} \right) \\&#xA;\rho_{1,S}^{2,v} = \rho_{1,v}^{2,S} = 0&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are unlikely (in my opinion) to be making estimation errors larger than your &lt;a href=&quot;http://www.actuaries.org.uk/sites/all/files/documents/pdf/0461-0469.pdf&quot; rel=&quot;nofollow&quot;&gt;model errors&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2013-10-17T15:51:13.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9185" PostTypeId="2" ParentId="9178" CreationDate="2013-10-17T19:02:10.650" Score="2" Body="&lt;p&gt;For any bond, you can type &lt;strong&gt;CSHF&lt;/strong&gt; (Cashflow Analysis) and export the coupon/principal schedule.&lt;/p&gt;&#xA;" OwnerUserId="5120" LastActivityDate="2013-10-17T19:02:10.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9186" PostTypeId="1" CreationDate="2013-10-17T19:16:05.677" Score="3" ViewCount="2567" Body="&lt;p&gt;I am using the famous &lt;a href=&quot;http://quanttrader.info/public/testForCoint.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;conintegrated pairs&lt;/a&gt; tutorial to just different stocks for cointegration. The adf.test yeilds perfect cointegration, which I feel must be incorrect. Here is why:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I run adf.test() on a cumsum of a random series, the plot looks like this:&lt;img src=&quot;https://i.stack.imgur.com/KqWda.png&quot; alt=&quot;enter image description here&quot;&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And it yields the following adf.test output:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Augmented Dickey-Fuller Test&#xA;data:  sp &#xA;Dickey-Fuller = -2.8333, Lag order = 4, &lt;strong&gt;p-value = 0.2314&lt;/strong&gt;&#xA;alternative hypothesis: stationary &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a spread I constructed, notice how it looks similar to the random walk:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/Q9FZs.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which yields the following adf.test() output:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Augmented Dickey-Fuller Test&#xA;data:  sprd3 &#xA;Dickey-Fuller = 3.719, Lag order = 7, &lt;strong&gt;p-value = 0.99&lt;/strong&gt;&#xA;alternative hypothesis: stationary &#xA;Warning message:&#xA;In adf.test(sprd3) : p-value greater than printed p-value&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas what could be going on here? Why is the p-value extremely different between the two cases? I have a hard time believing that the spread I constructed in the graph is has a p-value of .99...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&#xA;I have looked into this problem some more and have revealed a little more that may help us get to the bottom of the .99 p-value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is another spread I created: &#xA;&lt;img src=&quot;https://i.stack.imgur.com/Gg5Av.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The spread looks a little more stable than the previous one I posted. I ran the adf.test() on this spread two different ways. The first was &lt;strong&gt;adf.test(sprd1)&lt;/strong&gt;. This came up with a &lt;strong&gt;p-value of .99&lt;/strong&gt;, similar to what I have been experiencing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I use as.numeric() on the spread, the result is quite different. Executing &lt;strong&gt;adf.test(as.numeric(sprd1))&lt;/strong&gt; gives me a &lt;strong&gt;p-value of .07&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interesting. A little more info, the sprd1 data is an xts object with minute-by-minute data and no missing values. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;xts version: 0.8-8&#xA;zoo version: 1.7-9&#xA;R version: 2.14&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe older packages are causing the problem?&lt;/p&gt;&#xA;" OwnerUserId="5981" LastEditorUserId="5981" LastEditDate="2013-10-21T19:23:48.333" LastActivityDate="2013-10-21T19:23:48.333" Title="ADF test in R yielding perfect cointegration. How is this possible?" Tags="&lt;r&gt;&lt;cointegration&gt;&lt;pairs-trading&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9187" PostTypeId="2" ParentId="9171" CreationDate="2013-10-17T20:15:28.113" Score="0" Body="&lt;p&gt;thanks for your answer. Actually I though to use a similar method but using the historical returns and calculating the rolling volatility, obtaining a backward measure of the correlation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One more question: With $corr(\{\sigma_{1}^{implied}\},\{\sigma_{2}^{implied}])$ do you mean a correlation calculated from a chain of options (i.e. ATM for every maturity available for example) or other type of implied volatilities? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, adding all these terms together, and leaving 0 on the cross correlations, it is possible that the final correlation matrix is not positive definite. What do you think about? &lt;/p&gt;&#xA;" OwnerUserId="6297" LastActivityDate="2013-10-17T20:15:28.113" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9188" PostTypeId="2" ParentId="9178" CreationDate="2013-10-17T20:56:49.857" Score="4" Body="&lt;p&gt;What about &lt;strong&gt;DES_CASH_FLOW&lt;/strong&gt;?&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This field returns the securities cashflow schedule. All payment dates&#xA;  are included with the corresponding payment amount.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="6306" LastEditorUserId="6306" LastEditDate="2013-10-17T21:02:52.700" LastActivityDate="2013-10-17T21:02:52.700" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9189" PostTypeId="2" ParentId="4775" CreationDate="2013-10-17T22:22:06.617" Score="1" Body="&lt;p&gt;Another good collection of papers for Quantitative Finance: &lt;a href=&quot;http://ideas.repec.org/&quot; rel=&quot;nofollow&quot;&gt;IDEAS.REPEC.ORG&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5964" LastEditorUserId="35" LastEditDate="2013-10-17T23:01:53.660" LastActivityDate="2013-10-17T23:01:53.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9190" PostTypeId="1" AcceptedAnswerId="9221" CreationDate="2013-10-18T01:13:08.723" Score="3" ViewCount="1956" Body="&lt;p&gt;Background to question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hi, I was trying to fit a GARCH(1,1) model to the variance of log returns of a series, and ARMA(0,0) for the mean. I was using the fGarch package to do this. The aim of the modeling is to generate a predicted volatility number to feed into the Black-Scholes model to an generate option price and therefore option deltas. I plan to backtest the delta from GARCH volatility to hedge my option positions (as opposed to deltas derived from implied vol prices).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Questions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A) This might be a very noob question: I used the 'predict' function in the package to generate a 'n-day ahead' volatility forecast. As I understand GARCH, these numbers are annualized standard deviation numbers. To hedge a 1 month option I want to forecast 30 day volatility. I can simply put 'n-days ahead = 30 to get the numbers, but how do I combine those 30 numbers to get a annualized vol number?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;B) Could anyone also please explain how to use the nroll argument in the package? Basically I want rolling GARCH estimates of volatility. For example, at day 10, I want to use the past 10 days of data to get a vol prediction for day 11, at day 50 I want to use 50 days of data for vol prediction of day 51 etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="6307" LastActivityDate="2013-11-20T17:06:52.830" Title="GARCH(1,1) prediction in R - Basic Questions" Tags="&lt;options&gt;&lt;garch&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9192" PostTypeId="1" CreationDate="2013-10-18T11:24:06.050" Score="6" ViewCount="23252" Body="&lt;p&gt;Please advise how can i normalize stock prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recently, I've been using such formulas:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Log prices = Ln(Close(t))&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Close(t)-Mean&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;(Close(t)-Mean)/(StdDev)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Ln(Close(t))-Mean&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Is there any other ways?&lt;/p&gt;&#xA;" OwnerUserId="3092" LastActivityDate="2014-12-02T05:01:17.717" Title="How to normalize stock data" Tags="&lt;equities&gt;&lt;normalization&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="9193" PostTypeId="2" ParentId="9192" CreationDate="2013-10-18T12:50:13.030" Score="2" Body="&lt;p&gt;This answer can certainly be improved with more information: like which instruments, what time scale etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you can assume one instrument to be the 'base' instrument then the ratio of the prices is a good measure with both time series beginning at the same time. This is similar to calculating relative return. I have used this when backtesting a pairs trading system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More information might help me improve the answer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Happy to help.&lt;/p&gt;&#xA;" OwnerUserId="3461" LastActivityDate="2013-10-18T12:50:13.030" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9194" PostTypeId="2" ParentId="9179" CreationDate="2013-10-18T13:14:11.327" Score="9" Body="&lt;p&gt;Risk-neutrality isn't really a property of a model.  Instead, it describes a certain &lt;em&gt;calibration&lt;/em&gt; of a model (almost always represented by an SDE).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We say a model has been calibrated to risk-neutral probabilities if&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;model parameters can be inferred from traded security prices, and&lt;/li&gt;&#xA;&lt;li&gt;there's some anti-arbitrage assumption and hedging scheme available for those traded security prices&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The machinery is frequently abused to say that a risk-compensated model (with a nontrivial term for market price of risk) has been calibrated risk-neutrally.  That's mainly because the math is all the same.  Note also that even in the absence of hedging arguments, one can still often make large-$N$ portfolio arguments for security prices to all be priced on a consistent calibration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, in the specific case of the Vasicek model, we can imagine calibrating its parameters to, say, swap and swaption prices.  We won't match them all, but we'll do our best.  And to the extent the model represents reality, any new securities we see in the market can be fairly priced using the model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we were instead calibrating the Vasicek model to a time series of overnight rates, our calibration would not be risk-neutral, and would be more appropriate for risk computations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, note that the short rate in the Vasicek (or similar) model is not an investable security.  Market price of risk would not be applied directly to it.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2013-10-19T20:00:11.723" LastActivityDate="2013-10-19T20:00:11.723" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9195" PostTypeId="2" ParentId="4434" CreationDate="2013-10-18T13:35:02.430" Score="9" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;do input attributes need to be scaled?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;No. It is not required. It is only a heuristic [&lt;a href=&quot;http://www.researchgate.net/post/Worse_SVM_results_when_standardizing_data_than_without&quot; rel=&quot;noreferrer&quot;&gt;1&lt;/a&gt;]. It is primarily motivated because of the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;ol&gt;&#xA;&lt;li&gt;From the Feature Scaling &lt;a href=&quot;http://en.wikipedia.org/wiki/Feature_scaling&quot; rel=&quot;noreferrer&quot;&gt;article&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Since the range of values of raw data varies widely, in some machine learning algorithms, objective functions will not work properly without normalization. For example, the majority of classifiers calculate the distance between two points by the distance. If one of the features has a broad range of values, the distance will be governed by this particular feature. Therefore, the range of all features should be normalized so that each feature contributes approximately proportionately to the final distance.&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;  In summary,&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The recommendation for other algorithms like SVM is just 'recommendation'. It does not guarantee improved performance for instance.&lt;/li&gt;&#xA;&lt;li&gt;My suggestion is if this step is expensive, skip it. If it is not, then check to see if normalization does not deteriorate performance compared to building a Gradient boosted tree directly and decide accordingly.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="6185" LastActivityDate="2013-10-18T13:35:02.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9196" PostTypeId="1" CreationDate="2013-10-18T14:52:05.143" Score="7" ViewCount="428" Body="&lt;p&gt;Let the Vasicek model to be&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta r_{t}=k(\theta - r_{t-1})\Delta t+\sigma\Delta z_{t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Due to the fact that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta r_{t}=r_{t}-r_{t-1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if you let $\Delta t=1$, it is easy to see by replacement that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_{t}=k\theta+(1-k)r_{t-1}+\sigma\Delta z_{t}=\alpha+\beta r_{t-1}+\epsilon _{t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is a simple $AR(1)$ model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is quite useful because it allows you to estimate the SDE's parameters value through an easy OLS regression, without involving QMLE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Questions&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Could you show me the same proceeding starting from the formulation&#xA;of an $AR(2)$ model and coming to the related SDE?&lt;/li&gt;&#xA;&lt;li&gt;Could you show me&#xA;the general case of an $AR(p)$ process whose $p$-order is greater&#xA;than $2$?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3058" LastEditorUserId="3058" LastEditDate="2013-10-18T20:06:28.047" LastActivityDate="2013-10-19T09:58:29.213" Title="From $AR(p)$ to SDE" Tags="&lt;time-series&gt;&lt;stochastic-processes&gt;&lt;regression&gt;&lt;continuous-time&gt;&lt;vasicek&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9198" PostTypeId="1" CreationDate="2013-10-18T19:07:54.280" Score="0" ViewCount="232" Body="&lt;p&gt;If the spot VIX is the implied vol off of the options on the SPX Index. But which tradable product would that be? Can’t you technically only buy ETF’s that track the SPX (SPY) or buy the ES futures.  The spot VIX index is calculated off the S&amp;amp;P500 futures or the ETF’s?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, if the spot is based on the Cash SPX. What would the implied vol for options on 3Month S&amp;amp;P futures be? Would it be the same as the 3 Month VIX futures contracts?  What is the relationship between the implied vol on the SPX futures contracts and the equivalent time period VIX futures. wouldn't they be exactly the same?&lt;/p&gt;&#xA;" OwnerUserId="4729" LastActivityDate="2013-10-21T05:41:39.913" Title="VIX Calculations/Which product?" Tags="&lt;vix&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9200" PostTypeId="1" AcceptedAnswerId="9203" CreationDate="2013-10-18T19:40:29.063" Score="2" ViewCount="903" Body="&lt;p&gt;The VIX as a clear definition as defined in &lt;a href=&quot;http://www.cboe.com/micro/vix/vixwhite.pdf&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt;&#xA;I am interested to know why they came up with this formula. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I smell some reasonably complicated explanation here so any pointer to a paper would be fine with me.&#xA;Thanks&lt;/p&gt;&#xA;" OwnerUserId="5339" LastEditorUserId="5339" LastEditDate="2013-10-19T08:25:43.930" LastActivityDate="2013-10-19T08:25:43.930" Title="Why is the VIX computed that way?" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;vix&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9201" PostTypeId="2" ParentId="9196" CreationDate="2013-10-18T20:00:10.297" Score="5" Body="&lt;p&gt;Note that you can understand the $\Delta$ as an &quot;operator&quot; acting on $r$. So just act on $r$ twice:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta^2 r_t = r_t - 2 r_{t-1} + r_{t-2}. $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact if you write the $r$ as a vector, $r = (r_1, r_2, \ldots, r_N)$, then $\Delta$ is an $N\times N$ matrix with elements $\Delta_{i,j} = \delta_{i,j} - \delta_{i-1,j}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The AR(2) model can be written as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$  r_t - \phi_1 r_{t-1} - \phi_2 r_{t-2} = \epsilon_t.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can choose $a, b$ and $c$ such that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ a \Delta^2 r_t + b \Delta r_t +c r_{t-2} = r_t - \phi_1 r_{t-1} - \phi_2 r_{t-2} ,$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which gives $a= 2-\phi_1$, $b=\phi_1 - 1$ and $c = \phi_1 - \phi_2 -2$. So the AR(2) equation can be written as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ (2-\phi_1) \Delta^2 r_t + (\phi_1 - 1) \Delta r_t = -(\phi_1 - \phi_2 -2) r_{t-2}+ \epsilon_t.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's not quite trivial to take the limit to the SDE from here... that's because the coefficients of $\Delta^2 r_t$ and $\Delta r_t$ are of the same &quot;dimension&quot; (physicist's l33t sp33k), but the differentials are not, because they are of different order.  In fact, I think the limit only exists (or rather, converges to a second order SDE) only if you replace the $\epsilon_t$ with e.g. $\epsilon_t - \epsilon_{t-1}$, i.e. consider an ARMA(2,2) model instead of AR(2), but it's getting late... I can maybe edit/ add something more here tomorrow, if there's interest(?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: by the way, you can use OLS with SDEs without setting $\Delta t = 1$ and/or writing the SDE as an AR model etc. Just multiply the (original) equation by $r_t$, take the expectation $\mathbb E()$ and replace with sample mean :) That gives an estimate for the drift term. Do the same but multiply with $\Delta r_t$ to get an estimate for $\sigma$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ADDITIONAL STUFF:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So as Richard commented on the question, it's probably easier to start with an SDE. SO let's think of the following equation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{d^2 x(t)}{dt^2} + a \frac{d x(t)}{dt} + c x(t) = \sigma \eta(t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $\mathbb E (\eta(t) \eta(t')) = \delta (t-t')$ with the Dirac delta function $\delta(t)$. Although mathematicians won't like this, this is a well defined 2nd order SDE describing a harmonic oscillator (for $c&amp;gt;0$) with a linear drag (for $a&amp;gt;0$) and random kicks by $\eta(t)$. Now discretize by letting $dt \to \Delta t$ etc. and multiply the equation by $\Delta t ^2$ (and denote $X(t) = r_t$). We get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta^2 r_t + a \Delta t \Delta r_t + b \Delta t^2 r_t = \sigma \Delta t^2 \eta(t).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The key to arriving at an AR(2) model is the observation that, formally speaking, $\delta(t-t') = \frac{1}{dt} \delta_{t,t'}$ (you can check this by the Dirac delta definition and Riemann sums). Then $\Delta W_t := \Delta t \eta(t)$ is a standard white noise, and by defining new variables $\tilde a = a \Delta t, \tilde b = b \Delta t^2$ and $\tilde \sigma = \sigma \Delta t$, we get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta^2 r_t + \tilde a \Delta r_t + \tilde b r_t = \tilde \sigma \Delta W_t.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From this you can go to AR(2), as described above. So if you start from this eqution with the $\tilde a, \tilde b, \tilde \sigma$, if you don't do these rescalings, the SDE limit won't exist because the coefficients blow up! So e.g. $\tilde a$ has to approach zero linearly in $\Delta t$ when $\Delta t \to 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: and forget about my blabberings about ARMA...&lt;/p&gt;&#xA;" OwnerUserId="5636" LastEditorUserId="5636" LastEditDate="2013-10-19T09:58:29.213" LastActivityDate="2013-10-19T09:58:29.213" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9202" PostTypeId="2" ParentId="9162" CreationDate="2013-10-18T20:29:09.190" Score="0" Body="&lt;p&gt;I know the answer now... I don't know how I missed it :(&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sn - (n-1)(f1n - Sn) = S1&#xA;Sn = S1 + (n-1)(f1n-Sn)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where n-1 is Dur_n-1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;S1 is known, therefore it's the intercept. And hence:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sn is a linear function of Dur_n1&lt;/p&gt;&#xA;" OwnerUserId="6287" LastActivityDate="2013-10-18T20:29:09.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9203" PostTypeId="2" ParentId="9200" CreationDate="2013-10-19T06:32:20.613" Score="7" Body="&lt;p&gt;In that white paper itself they quote where it came from: “&lt;a href=&quot;http://elis.sigmath.es.osaka-u.ac.jp/research/gs-volatility_swaps.pdf&quot;&gt;More than you ever wanted to know about volatility swaps&lt;/a&gt;” by Kresimir Demeterfi, Emanuel Derman, Michael Kamal and Joseph Zou, Goldman Sachs Quantitative Strategies Research Notes, March 1999. This is a classic article which you should definitely read if you are trading volatility. While there might be a clearer explanation somewhere, this is the original and quite comprehensive work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For some intuitive ideas behind this, also see &lt;a href=&quot;http://onlyvix.blogspot.com.au/2011/09/intuitive-understanding-of-vix-formula.html&quot;&gt;this post&lt;/a&gt; in OnlyVIX blog.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The calculation of VIX itself is taking this Volatility Swaps idea and approximating it with discrete set of options (sum instead of integral), throwing away some ridiculously OTM options (prices of which are not representative at all). Since there is not always an expiration 30 days ahead, they approximate this point by interpolating (or extrapolating). These are merely some technical things they have to do to apply the formula.&lt;/p&gt;&#xA;" OwnerUserId="5086" LastEditorUserId="5086" LastEditDate="2013-10-19T06:42:00.637" LastActivityDate="2013-10-19T06:42:00.637" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9204" PostTypeId="1" AcceptedAnswerId="9231" CreationDate="2013-10-19T22:49:53.430" Score="2" ViewCount="5219" Body="&lt;p&gt;If two stocks have the same beta over same time period, does it mean they are 100% correlated over that time period?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a CAPM framework, a stock's beta is defined as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\beta_1={\rm Cov} (R_1, M) / {\rm Var} (M)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$R_1$ is the return vector of security 1&lt;/li&gt;&#xA;&lt;li&gt;$M$ is the market return vector.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Equating two betas means ${\rm Corr}(M, R_1) \cdot {\rm Std} (R_1) = {\rm Corr} (M, R_2) \cdot {\rm Std} (R_2)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not really sure where to go from here - the standard deviations of $R_1$ and $R_2$ might not be equal, and I'm not sure what the relation, if any is between the ${\rm Corr} (M, R2)$ and ${\rm Corr} (M, R1)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to this &lt;a href=&quot;http://www.jstor.org/discover/10.2307/2685695?uid=3739832&amp;amp;uid=2&amp;amp;uid=4&amp;amp;uid=3739256&amp;amp;sid=21102787273757&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt;, correlation is not transitive. If $R_1$ and $M$ are perfectly correlated, and $R_2$ and $M$ are perfectly correlated, it doesn't necessarily mean $R_1$ and $R_2$ are perfectly correlated.&lt;/p&gt;&#xA;" OwnerUserId="6307" LastEditorUserId="21023" LastEditDate="2016-10-27T20:33:45.553" LastActivityDate="2016-10-27T20:33:45.553" Title="Do two stocks with the same beta have a correlation of 1?" Tags="&lt;correlation&gt;&lt;beta&gt;&lt;capm&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9207" PostTypeId="1" AcceptedAnswerId="9235" CreationDate="2013-10-20T11:32:45.473" Score="11" ViewCount="1348" Body="&lt;p&gt;The &lt;a href=&quot;http://en.wikipedia.org/wiki/Fama%E2%80%93French_three-factor_model&quot;&gt;Fama-French three-factor risk model&lt;/a&gt; is given by&#xA;$$&#xA;r=R_f+\beta_m(K_m-R_f) + \beta_s\cdot\mathit{SMB}+\beta_v\cdot\mathit{HML}+\alpha&#xA;$$&#xA;where $r$ is the return, $R_f$ is the risk-free rate, $K_m$ is the market return, $SMB$ is the Small Minus Big factor and $HML$ is the High Minus Low factor. $\alpha$ and the $\beta$'s are estimated from the data and $\alpha$ can be interpreted as excess return not explained by the model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both $\beta_s$ and $\beta_v$ are highly significant and thus the CAPM (where $\beta_s = \beta_v = 0$) does not hold. This result can be explained in the two ways: the first is that this is a stock pricing anomaly and $\alpha$ can be obtained. This does not seem to be the case as the anomaly has persisted. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second is that investing in small cap or value stocks carries extra risk and that the FF 3-factor model just explains risk better than the CAPM does. This interpretation is in line with semi-strong EMH but does not satisfy me. Why should small cap or value stocks be more risky? Economists can come up with all kinds of interesting narratives but have these narratives been tested quantitatively? And what were the results?&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="56" LastEditDate="2013-10-21T00:59:54.277" LastActivityDate="2013-10-22T23:49:39.500" Title="Fama-French 3-factor model: factors implying risk" Tags="&lt;risk&gt;&lt;factor-models&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9208" PostTypeId="1" CreationDate="2013-10-20T14:38:06.320" Score="2" ViewCount="1059" Body="&lt;p&gt;The title says it all. I trade futures options exclusively and wanted to see if anyone had insight into the quote speedsrobustness coming into the API. I'm using the Excel DDE right now just building a matrix I find useful for entering trades but I pull the trigger on TWS. What I've found is quite often my ES quote on TWS is different than the one showing on the API. When I close Excel and reopen it the quotes match. Anyone else experiencing this? Any insight as to how IB's quote speeds compare to third party providers or is that even worth looking into since I trade option spreads?&lt;/p&gt;&#xA;" OwnerUserId="6325" LastActivityDate="2014-02-18T15:27:46.993" Title="IB API quotes and speed" Tags="&lt;options&gt;&lt;programming&gt;&lt;futures&gt;&lt;interactive-brokers&gt;&lt;spread-options&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9211" PostTypeId="2" ParentId="9186" CreationDate="2013-10-21T01:49:19.640" Score="3" Body="&lt;p&gt;Your spread does not look similar to the random walk. Many of the observations are the same as the previous observation. This means most of the first differences are zero, which is why the test indicates your series has a unit-root.  The current value is very good at explaining what the next value will be.&lt;/p&gt;&#xA;" OwnerUserId="56" LastEditorUserId="56" LastEditDate="2013-10-21T13:07:11.140" LastActivityDate="2013-10-21T13:07:11.140" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9212" PostTypeId="2" ParentId="9198" CreationDate="2013-10-21T05:41:39.913" Score="3" Body="&lt;p&gt;The VIX index is based on near expiry calls and puts on the S&amp;amp;P 500 index. The calls and puts are referencing the index ('SPX') as underlying and are traded on the CBOE. Please note that any options or futures that reference the VIX index are &lt;strong&gt;cash settled&lt;/strong&gt;. Also, for replication and hedging purposes it is important that &lt;strong&gt;VIX is&lt;/strong&gt; basically nothing else than &lt;strong&gt;the volatility of a variance swap&lt;/strong&gt; and because of the nature of this fact VIX can essentially be statically hedged in the underlying calls and puts. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To summarize, the tradable product are near expiry calls and puts on the S&amp;amp;P 500 index and you can statically replicate the VIX index by trading in the calls and puts, similarly to constructing a variance swap (though as noted above, VIX is the volatility of a variance swap not the value of the variance swap itself). The options in turn are based on the S&amp;amp;P 500 index &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are some references:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cboe.com/micro/VIX/pdf/VolatilityIndexQRG2012-01-30.pdf&quot; rel=&quot;nofollow&quot;&gt;Vix Product Sheet by CBOE&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://cfe.cboe.com/education/vixprimer/About.aspx&quot; rel=&quot;nofollow&quot;&gt;Vix Index Calculation&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cboe.com/Products/indexopts/spx_spec.aspx&quot; rel=&quot;nofollow&quot;&gt;S&amp;amp;P500 Index Option Contract Specs&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-10-21T05:41:39.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9213" PostTypeId="1" AcceptedAnswerId="9215" CreationDate="2013-10-21T09:11:06.770" Score="4" ViewCount="1348" Body="&lt;p&gt;I am working on an improvement of my company's order allocation system. We run a central Order Management System (OMS) but currently performance attribution from filled orders leaves room for improvement. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I look to understand how other systems handle order and trade allocation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example: Asset 'A'&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Fill1; buy A 500 shares; avg px x1&#xA;Fill2; buy A 300 shares; avg px x2&#xA;Fill3; sell A 700 shares; avg px x3&#xA;Fill4; sell A 100 shares; avg px x4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;One example how a trade could be defined is as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Trade1, avg entry px=x1; avg exit px=x3&#xA;Trade2, avg entry px=x2; avg exit px=(2*x3+x4)/3&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To compute performance of individual trades (not total performance as that is trivial) would you apply a FIFO-like approach or allocate filled shares and their filled price in a different way? The reason I attempt to break it down is for various reasons, among others TCA and to better analyze algorithm predictive power in detail. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you please share how you would approach this issue and if you know what you believe industry standard is? I want to have a better understanding before having it all spec'ed up and implemented by developers. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To avoid confusion, my question is not at all related to order matching on the exchange/ecn side, but fill allocation and trade performance attribution on the liquidity taking side.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-10-22T17:59:48.657" LastActivityDate="2013-10-22T17:59:48.657" Title="How do Order Management/Matching Systems match/allocate orders (and filled prices)?" Tags="&lt;order-handling&gt;&lt;performanceanalytics&gt;&lt;order&gt;&lt;allocation&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9214" PostTypeId="2" ParentId="9208" CreationDate="2013-10-21T13:29:19.513" Score="2" Body="&lt;p&gt;ES is supposed to update every 100 msec now in TWS.  I imagine the FOPs update slower than that, probably every 300 msec.  IB is not a real time feed like others, they aggregate the data and send it on schedule.  It's good because it doesn't lag, bad because you don't get every tick.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What Matt said is true and good but if you want to stick with Excel you could try the ActiveX spreadsheet instead of DDE.  Also, I remember there's a refresh rate setting for DDE.  But for real money I'd still go with something else.&lt;/p&gt;&#xA;" OwnerUserId="5872" LastActivityDate="2013-10-21T13:29:19.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9215" PostTypeId="2" ParentId="9213" CreationDate="2013-10-21T13:32:55.610" Score="8" Body="&lt;p&gt;Approaches like FIFO and LIFO are most useful for tax accounting.  If you don't have a tax accounting reason to do them, I'd recommend avoiding them, as they don't reflect actual realized gains (it's very rare for a position accounting system to move cash in and out of your account based on FIFO or LIFO).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm going to discuss everything here in Gross of Fees terms, since Net of  Fees complicates the discussion a bit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most position accounting systems use average cost accounting.  So, the average cost of your position is zero when you are flat (you have no position), and changes as your position gets further away from zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You realize gains when your position gets closer to zero/flat.  The average cost of that position does not change.  Your realized gain or loss is the difference between this &quot;closing&quot; transaction value and the average cost.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, how to discuss trades?  I think there are two practices that are rational and widely used in this space. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One approach is &quot;flat to flat&quot;.  If your positions are typically opened and closed in round lots, then flat to flat can make a lot of sense.  Even if you tend to open or close positions with partial fills, flat to flat measurement can make a lot of sense, and is pretty easy to do as the cumulative realized P&amp;amp;L of all transactions between the first opening trade and the last closing trade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other approach is to count every transaction that reduces the position (moves it closer to zero/flat) as a &quot;trade&quot;.  This allows you to report the realized P&amp;amp;L from that &quot;trade&quot; as well as track other statistics like time in market, excursion, drawdown, etc.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The third approach that I'll discuss is very algorithm specific, and widely used but not exactly generic.  If your algo can tag transactions as opening or closing fills, then you can do average cost accounting and use either the flat to flat or position-reducing methods described above on 'logical' rather than 'physical' positions and &quot;trades&quot;.  I think that this is some of the rationale behind things like LIFO and FIFO: trying to logically group transactions into &quot;trades&quot;.  I think that actually having the algo tag the fills and declare whether the transaction should be considered an opening or closing transaction avoids the subjective and arbitrary approaches provided by FIFO and LIFO, letting the intent of the algorithm control the definition. &lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="848" LastEditDate="2013-10-21T13:50:13.420" LastActivityDate="2013-10-21T13:50:13.420" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9216" PostTypeId="1" AcceptedAnswerId="9217" CreationDate="2013-10-21T14:48:53.950" Score="5" ViewCount="1041" Body="&lt;p&gt;The &lt;a href=&quot;http://en.wikipedia.org/wiki/Efficient-market_hypothesis#Semi-strong-form_efficiency&quot; rel=&quot;nofollow&quot;&gt;semi-strong efficient market hypothesis&lt;/a&gt; states that &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In semi-strong-form efficiency, it is implied that share prices adjust to publicly available new information very rapidly and in an unbiased fashion, such that no excess returns can be earned by trading on that information.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;During the last few years the definition of 'very rapidly' has been changed and new information will be processed in milliseconds which, if semi-strong EMH is true, would make price discovery nearly instantaneous.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the suspicion that with HFT the reaction to news is fast but not necessarily correct and that a number of corrections happen after an event due to better understanding of the new situation. Note that in this situation these corrections are a reaction &lt;em&gt;purely&lt;/em&gt; to the first news event and not to subsequent events.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for references on this phenonomen because if it's true it must lead to trading opportunities and if it's false it would be strong evidence for the semi-strong EMH on short time intervals. The answer could include a study on the behavior of the order book after big news events and its relation to the price after a somewhat longer period.&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="2299" LastEditDate="2015-02-13T06:23:40.797" LastActivityDate="2015-02-13T18:40:32.087" Title="Semi-strong efficiency and HFT" Tags="&lt;high-frequency&gt;&lt;market-microstructure&gt;&lt;asset-pricing&gt;" AnswerCount="6" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9217" PostTypeId="2" ParentId="9216" CreationDate="2013-10-21T16:02:09.153" Score="5" Body="&lt;p&gt;I would reckon this to be a very hard exercise. Unless you know the inner workings of such algorithm and how the news was exactly interpreted you have no idea about what went &quot;wrong&quot; and on which side such opportunities reside. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One thing I know for sure is that most all algos that capitalize on news capture primarily the numeric part of the news event. I believe only very few algorithms in 2013 seem to be capable of applying sufficient AI to not only interpret the linguistic nuances but to build a pricing model around the divergence in such news interpretation from market expectations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having performed some research on my own in foreign exchange instruments, responding to economic data/text releases, this explains why you one often sees an initial sharp reaction only to be followed by an even more pronounced correction or a second/third leg into the same direction. Having spoken to several broker dealers in the past I found that the latter correction often occurred off the back of semi-systematized or even discretionary accounts and not pure hft algorithms. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Subsequently, I concluded for the time being that my time was better spent elsewhere because I was unable to built an alpha model around such events simply because I could not conclusively forecast on which occasions the initial move was retraced and on which occasions it was magnified by the rest of market participants trading in the same direction. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I am definitely interested in what others have to say. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-10-22T17:54:52.040" LastActivityDate="2013-10-22T17:54:52.040" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9218" PostTypeId="2" ParentId="9216" CreationDate="2013-10-21T16:10:32.543" Score="2" Body="&lt;p&gt;If you can observe prices at a very high frequency, then &quot;news&quot; is defined as a lot more things than if you are observing prices at a lower frequency. So what you are calling corrections are also news for the high frequency guy because he can observe prices that fast, so do not consider these as corrections to the original news, consider this to be a situation where one kind of news has hit the market and other kinds of news are following that.&lt;/p&gt;&#xA;" OwnerUserId="6289" LastActivityDate="2013-10-21T16:10:32.543" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9219" PostTypeId="2" ParentId="9204" CreationDate="2013-10-21T16:18:40.757" Score="1" Body="&lt;p&gt;beta refers to the fact that on an average the stock has a degree of correlation with the movement of the index. the important thing is &quot;on an average&quot; because two different stocks may have the same beta but this average may have different weightages of different parts of that time period. so lets say that in the first part of the data, stock1 is not correlated much with the market, but stock2 is moderately correlated. now in the second part, stock1 is heavily correlated but stock2 is again moderately correlated. the values are such that the overall calculations put equal values for the beta for the two stocks for the entire time period. hence same beta does not imply mutual correlation.&lt;/p&gt;&#xA;" OwnerUserId="6289" LastActivityDate="2013-10-21T16:18:40.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9220" PostTypeId="2" ParentId="9192" CreationDate="2013-10-21T16:24:05.957" Score="4" Body="&lt;p&gt;Here are some more :&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Ln(Close) - Ln(Close1) : Close1 is previous close.&lt;/li&gt;&#xA;&lt;li&gt;(Close-Close1)*100/Close1&lt;/li&gt;&#xA;&lt;li&gt;(Close-LowN)/(HighN-LowN) : LowN and HighN are the low and high within the last N values.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Some more information about the problem would help.&lt;/p&gt;&#xA;" OwnerUserId="6289" LastActivityDate="2013-10-21T16:24:05.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9221" PostTypeId="2" ParentId="9190" CreationDate="2013-10-21T16:31:05.837" Score="1" Body="&lt;p&gt;Annualized volatility is not calculated generally by forecasting the volatility n days ahead. what is done is that the next period volatility is calculated and then it is multiplied by square root of n where n is the number of the periods contained in the year as the scaling factor. so if you calculate daily volatility and the number of trading days is 250 then the annual volatility is the next period standard deviation multiplied by square root of 250.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GARCH already uses all the past days data to predict the next period volatility. what you can do is to assign more weightage to the recent days values if you want 11 days or give more importance to longer term values if you want 50 values.&lt;/p&gt;&#xA;" OwnerUserId="6289" LastActivityDate="2013-10-21T16:31:05.837" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9222" PostTypeId="2" ParentId="2372" CreationDate="2013-10-21T18:28:58.747" Score="-2" Body="&lt;p&gt;To be a stationarity is when the roots of charateristic equation lies outside of the unit circle.&lt;/p&gt;&#xA;" OwnerUserId="6334" LastEditorUserId="35" LastEditDate="2013-10-21T19:24:06.870" LastActivityDate="2013-10-21T19:24:06.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9224" PostTypeId="2" ParentId="9175" CreationDate="2013-10-22T00:20:11.043" Score="0" Body="&lt;p&gt;I am a little confused about the question, but if I understand correctly, the convention is that if you BUY the complex order then positive qty is a buy, negative qty is a sell. If you're selling the order then positive qty is a sell, negative qty is a buy. &lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2013-10-22T00:20:11.043" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9225" PostTypeId="1" CreationDate="2013-10-22T05:17:18.557" Score="1" ViewCount="109" Body="&lt;p&gt;Does anybody have experience in valuation of mortgage backed floating notes? I have task to value the 4 different MBS floating notes. I know that it should be done through montecarlo, refinancing function should be created to consider the effects of prepayment. Need more exact and detailed advice on steps should be taken. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am interested if it makes sense to go with short way. To treat the floaters as regular floaters and value them as regular floater, then adjust for the prepayment and credit risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;any papers or advice from experienced professional are highly appreciated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="1179" LastEditorUserId="1179" LastEditDate="2013-10-22T05:30:47.990" LastActivityDate="2013-10-22T05:30:47.990" Title="Valuation of Mortgage Backed floating notes" Tags="&lt;valuation&gt;&lt;mbs&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9226" PostTypeId="1" CreationDate="2013-10-22T10:22:03.670" Score="3" ViewCount="1828" Body="&lt;p&gt;Does implied volatility of swap rates decreases both with start and tenor? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given a Swaption price and a discount curve I calculate the swap_rate from the curve, then &#xA;I define implied volatility as the &#xA;volatility $V_{impl}$ such that the price returned by BS formula with spot = strike &#xA;= swap_rate and volatility = $V_{impl}$ exactly matches the given swaption price.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've seen such implied volatility decreasing both with tenor and with start.&#xA;This surprises me. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder if there is a good reason for that. &lt;/p&gt;&#xA;" OwnerUserId="6249" LastActivityDate="2016-01-21T16:28:02.813" Title="European Swaptions: does implied volatility of swap rates decreases both with start and tenor?" Tags="&lt;interest-rates&gt;&lt;implied-volatility&gt;&lt;swaption&gt;&lt;irs&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9229" PostTypeId="2" ParentId="9216" CreationDate="2013-10-22T13:15:52.373" Score="2" Body="&lt;p&gt;I think the market participants behavior on the micro-level is not different in principle from the behavior on the macro-level. The challenges of better news interpretation, and faster response time are very similar on all levels. There may be a little bit more trading opportunities in HFT, but building HFT strategy and infrastructure is very expensive, therefore I think this hypothesis still holds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The uncertainty of news interpretations is clearly visible in the order book. The attached image visualizes today's pre- and post-news response of ES at 08:30 EST (the time on the graph is UTC). Before the news release, the order book is almost empty and volatility is high; then a large seller and then buyer appear in a wide range. Then, after few minutes the market &quot;fine-tunes&quot; the news interpretation, and returns to normal order book density. (note, the gray-level indicates total size of all orders at given level at given time)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/a7vKG.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="1515" LastActivityDate="2013-10-22T13:15:52.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9230" PostTypeId="2" ParentId="9213" CreationDate="2013-10-22T14:24:12.130" Score="0" Body="&lt;p&gt;Here is a suggestion for performance analysis. It visualizes the quality of individual decisions, taken by the trading strategy. For simplicity purposes lets consider only BUY trades (the SELL trades may be multiplied by -1). Define reasonable trading horizon. Organize all trades in the same graph where:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;x-axis is time around the execution, such that executions always occurs at t=0.&lt;/li&gt;&#xA;&lt;li&gt;y-axis is the asset's price minus avg. execution price&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Optionally, multiply each timeseries by corresponding trade's size. In this case the timeseries represents each trade's P&amp;amp;L.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/em20s.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Such view may provide very important insights about the strategy in addition to total performance. For example, you may observe that only a few trades contribute to total performance while the rest are &quot;noise&quot; trades. Then you can study what distinguishes these &quot;special&quot; decisions. Also, different effect like slippage can be easily observed and measured. You can also add a line that represents the average response. However, this method has its drawbacks, for instance, it doesn't account the position, but only the quality of individual decisions. &lt;/p&gt;&#xA;" OwnerUserId="1515" LastActivityDate="2013-10-22T14:24:12.130" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9231" PostTypeId="2" ParentId="9204" CreationDate="2013-10-22T14:56:35.967" Score="3" Body="&lt;p&gt;The answer is NO. It's mathematically incorrect. Simply look the correlation and covariance formulas.&#xA;But here is a gedankenexperiment (thought experiment) that demonstrates that it's incorrect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose, &lt;code&gt;R1 = M&lt;/code&gt;. Then the claim &lt;code&gt;Corr(M,R1) = Corr(M,R2)&lt;/code&gt; implies &lt;code&gt;1 = Corr(M,R2)&lt;/code&gt; for any &lt;code&gt;R2&lt;/code&gt;, which is obviously wrong.&lt;/p&gt;&#xA;" OwnerUserId="1515" LastActivityDate="2013-10-22T14:56:35.967" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9232" PostTypeId="1" CreationDate="2013-10-22T15:21:24.120" Score="0" ViewCount="2027" Body="&lt;p&gt;Given for example 6 bond prices and their respective 6 cashflows over a time period of 6 years, I have managed to derive the zero-coupon yield curve using the bootstrap method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it got lost on me when it came to deriving the par-yield curve. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help on this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="6343" LastActivityDate="2013-10-22T17:00:22.163" Title="Deriving the par-yield curve" Tags="&lt;fixed-income&gt;&lt;yield-curve&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9233" PostTypeId="2" ParentId="9213" CreationDate="2013-10-22T15:21:47.837" Score="5" Body="&lt;p&gt;I'll add my own experience here based on what we do at our firm, simply to provide more support for what Brian said in his answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fills that move a position further away from 0 contribute to the average price of the position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fills that move a position closer to 0 &quot;book profits&quot; against the average price of the position to that point in time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any fill that causes a position to cross 0 must be handled so that it hits 0 first, and then crosses to the other side to ensure proper accounting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In our world we refer to a &quot;trade&quot; as having an open time of the timestamp of the first fill that moves away from open position size of 0. The trade is closed or finalized when the size reaches 0 again. So the lifetime of the trade is simply the time spent not at position size of 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From your example, what you refer to as &quot;trades&quot; we call fills. The &quot;trade&quot; is the entire sequence of events that encompass moving from net position size of 0 and back again.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;t0 we own 0 shares of A&#xA;t1 buy  500 A at x1&#xA;t2 buy  300 A at x2, average price is now the wavg of the fills&#xA;t3 sell 700 A at x3, book x3 - avg price, position now 100 shares&#xA;t4 sell 100 A at x4, book x4 - avg price, position now 0 shares&#xA;position or &quot;trade&quot; is now closed and we start over again&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;t1&lt;/code&gt; is the open time of the trade. &lt;code&gt;t4&lt;/code&gt; is the closing time of the trade. The trade is made up of 4 total fills, 2 of which are &quot;opening&quot; fills and 2 are &quot;closing&quot; fills. A fill is an opening fill if it moves net size farther from 0. It is a closing fill if it moves net size closer to 0. Any time you reach 0 (or cross it) you close the trade and, in the case of crossing 0, start a new one. When I refer to &quot;crossing 0&quot; it is because we model long positions as positive size and short positions as negative size.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastEditorUserId="1355" LastEditDate="2013-10-22T16:15:06.810" LastActivityDate="2013-10-22T16:15:06.810" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9234" PostTypeId="2" ParentId="9232" CreationDate="2013-10-22T17:00:22.163" Score="1" Body="&lt;p&gt;If you look at &lt;a href=&quot;http://en.wikipedia.org/wiki/Par_yield&quot; rel=&quot;nofollow&quot;&gt;wikipedia&lt;/a&gt; then you find the definition that a par-yield is the coupon rate, such that bond prices are $100$. This is the definition. &#xA;Consider $N$ bond with a given coupon rates $c_i$, times to maturity $T_i$ prices $P_i$,for $i=1,\ldots,N$. Then you can calculated the yield-to-maturity for each bond $y_i$.&#xA;Some mathematics reveal that a bond with coupon rate equal to its yield-to-maturity is priced at par (its price is $100$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus the par-yield curve is a plot of the time-to-maturity and the yield-to-maturity of your bonds. &#xA;As a next step you could derive a zero-rate curve from it by bootstrapping.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2013-10-22T17:00:22.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9235" PostTypeId="2" ParentId="9207" CreationDate="2013-10-22T23:49:39.500" Score="9" Body="&lt;p&gt;There is no definitive answer to this question and there are infinite papers out there. I personally think they are better explained as mispricings. Several points: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Persistence of HML does not imply it has to be a risk factor. If there are idiosyncratic mispricings in individual stocks, then by construction, the ones that look cheap are going to be actually cheap. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a related (though somewhat involved) criticism of the risk-factor interpretation:&#xA;&lt;a href=&quot;http://finance.wharton.upenn.edu/~rlwctr/papers/9315.PDF&quot;&gt;http://finance.wharton.upenn.edu/~rlwctr/papers/9315.PDF&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Here is some nice evidence that those factors aren't risk-factors and are more likely mispricings. At least they seem better explained by characteristics than factors: &#xA;&lt;a href=&quot;http://ww.andreisimonov.com/Microstr_PhD/MSU_09/DanielTitman97.pdf&quot;&gt;http://ww.andreisimonov.com/Microstr_PhD/MSU_09/DanielTitman97.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) There are attempts to find theoretical explanations for those factors. For instance people hypothesized (if my memory works) that the value factor is correlated with human capital, and therefore despite value stocks have higher returns, growth stocks are better hedges for investors if you think they are optimizing overall (taking into account the variability of their human capital). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) Aside: yes those factors work quite consistently across time and markets:&#xA;&lt;a href=&quot;http://www.master272.com/finance/longshort/ff_growthvalue.pdf&quot;&gt;http://www.master272.com/finance/longshort/ff_growthvalue.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5667" LastActivityDate="2013-10-22T23:49:39.500" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9236" PostTypeId="1" AcceptedAnswerId="9237" CreationDate="2013-10-23T06:45:28.627" Score="4" ViewCount="247" Body="&lt;p&gt;As from the title, I would like to know where it is possible to find free research focused on fixed income markets' themes and topics, such as interest rates, credit risk related fundamentals, new issues and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;«Why isn't &lt;a href=&quot;http://www.ssrn.com/&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;SSRN&lt;/strong&gt;&lt;/a&gt; sufficient?» one could ask me; well, I'm looking for something which is more oriented to analyse present economic and financial events and less to build another stochastic model or neural networks' default probability, and such things.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Despite of this, however, a quantitative approach to research would be really appreciated, but I would be happy to find even just a few generic research sources.&lt;/p&gt;&#xA;" OwnerUserId="3058" LastActivityDate="2013-10-23T08:21:54.350" Title="Fixed Income free research available online" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;research&gt;&lt;econometrics&gt;&lt;macro-economics&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9237" PostTypeId="2" ParentId="9236" CreationDate="2013-10-23T08:21:54.350" Score="4" Body="&lt;p&gt;There are tons of quant related blogs out there, some of which contain relatively sophisticated content, others less so. Have a look at the following, which aggregates blogs:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://moneyscience.com&quot; rel=&quot;nofollow&quot;&gt;MoneyScience&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise I could point you to bank/sell-side research. Have a look at the freely available Reuters Messenger (RM), they maintain channels where you can be permissioned as long as you work in some professional financial-industry capacity. (www.fxww.com should have more information if you find difficulties getting the RM installed).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://customers.reuters.com/download/rm/rmall.aspx&quot; rel=&quot;nofollow&quot;&gt;Reuters Messenger&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Check out the 'FXWW' channel in particular. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2013-10-23T08:21:54.350" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9239" PostTypeId="1" CreationDate="2013-10-23T15:15:21.500" Score="3" ViewCount="275" Body="&lt;p&gt;What makes an option strategy long or short?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I got the impression that if it is a net debit (you pay to open the strategy) it is classified 'long' (strangle, straddle)&#xA;Then I learned about the call butterfly which is short (when debited to open) and long (when credited to open) and got confused.&#xA;What became further confusing is that the &lt;em&gt;long&lt;/em&gt; iron butterfly&#xA;&lt;a href=&quot;http://www.optionseducation.org/content/oic/en/strategies_advanced_concepts/strategies/long_iron_butterfly.html&quot; rel=&quot;nofollow&quot;&gt;http://www.optionseducation.org/content/oic/en/strategies_advanced_concepts/strategies/long_iron_butterfly.html&lt;/a&gt;&#xA;has the same PL characteristics as the &lt;em&gt;short&lt;/em&gt; call butterfly&#xA;&lt;a href=&quot;http://www.optionseducation.org/strategies_advanced_concepts/strategies/short_call_butterfly.html&quot; rel=&quot;nofollow&quot;&gt;http://www.optionseducation.org/strategies_advanced_concepts/strategies/short_call_butterfly.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some generalized rule that would apply to all strategies and provide explanation as to why a strategy is classified long or short?&lt;/p&gt;&#xA;" OwnerUserId="6346" LastActivityDate="2016-02-17T19:01:15.660" Title="stock option strategies long vs short" Tags="&lt;options&gt;&lt;option-strategies&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9240" PostTypeId="1" CreationDate="2013-10-23T15:28:50.323" Score="2" ViewCount="526" Body="&lt;p&gt;I read an interesting statement &lt;a href=&quot;http://advisor.morningstar.com/products/conference/brochure/ETF%20Total%20Cost%20Analysis.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&amp;quot;If an ETF’s market price tracks its NAV well, it is likely to have a&#xA;small market impact. On the other hand, if the market price is more&#xA;volatile than the fund’s NAV, a large order could move the price&#xA;before a market maker would be willing to step in and close that gap,&#xA;leading to higher market impact costs.&amp;quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Now, I am aware of the standard heuristic &amp;quot;&lt;span class=&quot;math-container&quot;&gt;$\beta$&lt;/span&gt;-exponent participation rate&amp;quot; market impact model as discussed by Almgren &lt;a href=&quot;http://www.courant.nyu.edu/%7Ealmgren/papers/eqf.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; and in this &lt;a href=&quot;https://quant.stackexchange.com/questions/43/is-there-a-standard-model-for-market-impact&quot;&gt;question&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;With ETFs and OTC trading, the situation seems to be quite different depending on what your counterparty does. They can&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Keep the position open&lt;/li&gt;&#xA;&lt;li&gt;Buy/Sell the position at the exchange&lt;/li&gt;&#xA;&lt;li&gt;Match it with a trade of different direction (in-house)&lt;/li&gt;&#xA;&lt;li&gt;Hedge&lt;/li&gt;&#xA;&lt;li&gt;Trigger the Creation/Redemption process&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Now some of these actions would directly impact the price while the others won't.&#xA;The question is: Is there a way or a model to quantify market impact effects in this case?&lt;/p&gt;&#xA;&lt;p&gt;I will be glad to accept specific models or empirical studies about this as an answer. Please do not hesitate to post your practical experience/findings (as a trader/market maker) in this topic as an answer as well!&lt;/p&gt;&#xA;" OwnerUserId="2727" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2013-10-23T15:33:58.767" Title="What is the market impact of OTC trading ETFs?" Tags="&lt;etf&gt;&lt;market-impact&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9241" PostTypeId="1" AcceptedAnswerId="9360" CreationDate="2013-10-23T15:55:53.063" Score="18" ViewCount="3841" Body="&lt;p&gt;I am trying to understand how &lt;a href=&quot;http://en.wikipedia.org/wiki/Fourier_transform&quot; rel=&quot;noreferrer&quot;&gt;Fourier transforms&lt;/a&gt; &amp;amp; &lt;a href=&quot;http://en.wikipedia.org/wiki/Characteristic_function_%28probability_theory%29&quot; rel=&quot;noreferrer&quot;&gt;Characteristics functions&lt;/a&gt; can be used to calculate option values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I am having difficulty following the process that is used in several introductory papers like: &lt;a href=&quot;http://www.math.nyu.edu/research/carrp/papers/pdf/fftpres.pdf&quot; rel=&quot;noreferrer&quot;&gt;Carr &amp;amp; Madam&lt;/a&gt;,  &lt;a href=&quot;http://faculty.baruch.cuny.edu/lwu/890/ADP_Transform.pdf&quot; rel=&quot;noreferrer&quot;&gt;Liuren Wu&lt;/a&gt;, &lt;a href=&quot;http://pfadintegral.com/docs/Schmelzle2010%20Fourier%20Pricing.pdf&quot; rel=&quot;noreferrer&quot;&gt;Schmelze&lt;/a&gt; or &lt;a href=&quot;http://www.math.utexas.edu/users/jjames/MatLabCode/Lecture_notes_2008d.pdf&quot; rel=&quot;noreferrer&quot;&gt;Chourdakis (chapter 4)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to obtain an intuitive understanding of this method, it will be very helpful if someone could provide me with an example on how to calculate option prices using this pricing technique.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since this is not homework, any intuitive example will be greatly appreciated.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; as a potential example, consider that we want to estimate the fair value of an European call option struck at $K = 12$ and with time to maturity $T = 2$ years. The underlying asset $S$ has initial price $S_0 = 10$ and its returns volatility is $\sigma = 0.25$. The risk free rate is $r = 0.05$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the previous example, the &lt;a href=&quot;http://es.wikipedia.org/wiki/Black-Scholes&quot; rel=&quot;noreferrer&quot;&gt;Black-Scholes equation&lt;/a&gt; indicates that the option fair value should be $1.07$. How can I reproduce this result using  Fourier transforms?&lt;/p&gt;&#xA;" OwnerUserId="5208" LastEditorUserId="5208" LastEditDate="2021-03-10T07:54:29.563" LastActivityDate="2021-03-10T07:54:29.563" Title="From Fourier Transforms to Option Values" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;modeling&gt;&lt;fourier-transform&gt;" AnswerCount="4" CommentCount="5" FavoriteCount="18" ContentLicense="CC BY-SA 3.0" />
  <row Id="9242" PostTypeId="1" CreationDate="2013-10-23T16:03:04.207" Score="3" ViewCount="239" Body="&lt;p&gt;This question has two parts, What is the state of the art in an academic or public knowledge sense of volatility forecast model evaluation? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since there are many methods out in the wild, and do correct me if I am wrong but I haven't been able to  find a complete list or any list for that matter of methods used so I'd like to start that here. It is very popular to use many of the different loss functions with arma-garch style models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some methods commonly used include:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Mean Absolute Error&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$MAE = n^{-1} \sum_{t=1}^n | \sigma_t - h_t|$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \boldsymbol{R^2 \ log}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$R^2LOG = n^{-1} \sum_{t=1}^n (log(\sigma_t^2 h_t^{-2}))^2 $&lt;/p&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="1764" LastEditDate="2013-10-24T02:20:47.167" LastActivityDate="2013-10-24T02:20:47.167" Title="evaluation of volatility models using loss functions" Tags="&lt;volatility&gt;&lt;performance-evaluation&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9244" PostTypeId="2" ParentId="549" CreationDate="2013-10-24T00:27:33.460" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://www.bitlisten.com/&quot; rel=&quot;nofollow&quot;&gt;BitListen&lt;/a&gt; -- &quot;Realtime Bitcoin transaction and trade visualizer&quot; is pretty neat.&lt;/p&gt;&#xA;" OwnerUserId="6349" LastActivityDate="2013-10-24T00:27:33.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9245" PostTypeId="1" CreationDate="2013-10-24T01:47:29.827" Score="1" ViewCount="1031" Body="&lt;p&gt;I'm trying to get into R because for some personal project, I need R and quantmod to create OHCL charts for me. I'm stuck at the candleChart creation step, and I'm not sure I understand why. Using a 'daily' input file works fine, but trying to create a hourly chart from hourly data is just a big failure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a sample of the data I'm using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; zz &amp;lt;- read.csv(dataFile, sep=&quot;,&quot;, header=TRUE, stringsAsFactors=T)&#xA;&amp;gt; head(zz)&#xA;                 DATE OPEN HIGH LOW CLOSE VOLUME&#xA;1 2012-10-23 02:00:00   22   22  22    22    171&#xA;2 2012-10-23 03:00:00   22   22  22    22    171&#xA;3 2012-10-23 04:00:00   22   22  22    22    171&#xA;4 2012-10-23 05:00:00   22   22  22    22    171&#xA;5 2012-10-23 06:00:00   22   22  22    22    171&#xA;6 2012-10-23 07:00:00   22   22  22    22    171&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see, the first data is all the same but there is one year of data in my input file, and prices goes up to 96 at the end.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I do next is create my xts object from this zz data frame like that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; xx &amp;lt;- xts(zz[,2:6], order.by=as.POSIXct(zz[, 1], tz=&quot;&quot;, format=&quot;%Y-%m-%d %H:%M:%S&quot;))&#xA;&amp;gt; head(xx)&#xA;                    OPEN HIGH LOW CLOSE VOLUME&#xA;2012-10-23 02:00:00   22   22  22    22    171&#xA;2012-10-23 03:00:00   22   22  22    22    171&#xA;2012-10-23 04:00:00   22   22  22    22    171&#xA;2012-10-23 05:00:00   22   22  22    22    171&#xA;2012-10-23 06:00:00   22   22  22    22    171&#xA;2012-10-23 07:00:00   22   22  22    22    171&#xA;&amp;gt; tail(xx)&#xA;                    OPEN HIGH LOW CLOSE VOLUME&#xA;2013-10-22 06:00:00   96   96  96    96    115&#xA;2013-10-22 07:00:00   96   96  96    96    115&#xA;2013-10-22 08:00:00   96   96  96    96    115&#xA;2013-10-22 09:00:00   96   96  96    96    115&#xA;2013-10-22 10:00:00   96   96  96    96    115&#xA;2013-10-22 11:00:00   96   96  96    96    118&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, it looks like (to me) the xts is correct. There is the date+time in unnamed columns 1 and remaining columns named correctly to be understood by chartCandle() from quantmod.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what happens when I try to plot it :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; candleChart(xx, name=tickerName, subset=&quot;last 3 weeks&quot;, bar.type = &quot;ohlc&quot;)&#xA;Error in periodicity(x) : can not calculate periodicity of 1 observation&#xA;&amp;gt; candleChart(xx)&#xA;Error in periodicity(x) : can not calculate periodicity of 1 observation&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm not sure why the first argument would be any subset of my XTS object ?&#xA;Also, I found that :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; periodicity(xx)&#xA;Error in periodicity(xx) : can not calculate periodicity of 1 observation&#xA;&amp;gt; periodicity(xx)&#xA;Error in periodicity(xx) : can not calculate periodicity of 1 observation&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The second call looks correct but I'm not sure why periodicity(xx) would think there is only 1 observation in my xts ?&lt;/p&gt;&#xA;" OwnerUserId="1858" LastActivityDate="2013-10-24T09:50:53.257" Title="How to plot custom hourly data into R with quantmod?" Tags="&lt;r&gt;&lt;quantmod&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9246" PostTypeId="2" ParentId="9242" CreationDate="2013-10-24T01:59:01.790" Score="1" Body="&lt;p&gt;In Forecasting Financial Market Volatility Ser-Huang Poon dedicated entire chapter to the question, so the issue is far from simple. I don't believe there one single best way because of many questions that depend on model form and application such as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should one evaluate volatility or variance, or perhaps ln(vol)?&#xA;What is the benchmark - volatility is latent, should one use implied, or realized, and which realized measure should be used?&#xA;What penalty should be used? L1 / L2? Points or percents?&#xA;In addition there are specific tests to compare one model again another, s.a. Diebold &amp;amp; Mariano tests.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually what I see in academic literature is several metrics, L1 and L2 norm on volatility, as well as standard Mincer-Zarnowitz regression. In practical applications I most often see L1 on volatility, volatility %, or Vega * volatility. &lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2013-10-24T01:59:01.790" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9247" PostTypeId="1" AcceptedAnswerId="10947" CreationDate="2013-10-24T03:24:10.210" Score="2" ViewCount="119" Body="&lt;p&gt;I'm going through Basel III &lt;a href=&quot;http://www.bis.org/bcbs/qis/biiiimplmoniwb_mar13.xls&quot; rel=&quot;nofollow&quot;&gt;monitoring workbook&lt;/a&gt; and &lt;a href=&quot;http://www.bis.org/bcbs/qis/biiiimplmoninstr_feb13.pdf&quot; rel=&quot;nofollow&quot;&gt;instruction&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's one row in &quot;General Info -&gt; A) General Bank Data -&gt; 1) Reporting Data&quot; part: &quot;CMG-relevant: Yes/No?&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder what does this mean? &#xA;Is &quot;CMG&quot; the Capital Monitoring Group mentioned in &lt;a href=&quot;https://en.wikipedia.org/wiki/Basel_Committee_on_Banking_Supervision&quot; rel=&quot;nofollow&quot;&gt;Basel Committee on Banking Supervision&lt;/a&gt;&#xA;which banks are CMG-relevant?&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2014-04-15T08:04:13.833" Title="What are the CMG-relevant banks according to Basel III?" Tags="&lt;basel&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9248" PostTypeId="2" ParentId="549" CreationDate="2013-10-24T05:02:42.377" Score="0" Body="&lt;p&gt;Chernoff faces are also a good and undervalued idea &lt;a href=&quot;http://en.wikipedia.org/wiki/Chernoff_face&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Chernoff_face&lt;/a&gt;. It is applicable to multivariate statistical data, which, I beleive, occur frequently in world of finance/&lt;/p&gt;&#xA;" OwnerUserId="2870" LastActivityDate="2013-10-24T05:02:42.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9249" PostTypeId="2" ParentId="9245" CreationDate="2013-10-24T09:50:53.257" Score="2" Body="&lt;p&gt;&lt;code&gt;periodicity&lt;/code&gt; calls:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;p &amp;lt;- median(diff(.index(x)))&#xA;if (is.na(p)) &#xA;  stop(&quot;can not calculate periodicity of 1 observation&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;p&lt;/code&gt; can be &lt;code&gt;NA&lt;/code&gt; if &lt;code&gt;x&lt;/code&gt; has 1 observation, or if you have missing values in your index (because there's no &lt;code&gt;na.rm=TRUE&lt;/code&gt; in the &lt;code&gt;median&lt;/code&gt; call.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; xx &amp;lt;- xts(1:10, as.POSIXct(c(1:5,NA,7:10),origin='1970-01-01'))&#xA;&amp;gt; periodicity(xx)&#xA;Error in periodicity(xx) : can not calculate periodicity of 1 observation&#xA;&amp;gt; candleChart(xx)&#xA;Error in periodicity(x) : can not calculate periodicity of 1 observation&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;NA&lt;/code&gt; in your index likely has to do with daylight saving time when you convert &lt;code&gt;zz[, 1]&lt;/code&gt; to &lt;code&gt;POSIXct&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="56" LastActivityDate="2013-10-24T09:50:53.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9252" PostTypeId="2" ParentId="9241" CreationDate="2013-10-24T18:22:55.223" Score="5" Body="&lt;p&gt;I think this &lt;a href=&quot;http://andrew.gibiansky.com/blog/economics/accelerating-options-pricing-via-fourier-transforms/&quot;&gt;blog post&lt;/a&gt; is quite good at explaining option pricing via fourier transforms.&lt;/p&gt;&#xA;" OwnerUserId="993" LastActivityDate="2013-10-24T18:22:55.223" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9253" PostTypeId="1" AcceptedAnswerId="9288" CreationDate="2013-10-24T20:18:29.063" Score="15" ViewCount="14316" Body="&lt;p&gt;I read that an option prices is the expected value of the payout under the risk neutral probability.  Intuitively why is the expectation taken with respect to risk neutral as opposed to the actual probabilty.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuitively why would risk neutral probability differ from actual probability?&lt;/p&gt;&#xA;" OwnerUserId="5723" LastEditorUserId="26242" LastEditDate="2018-05-16T10:27:21.267" LastActivityDate="2019-08-18T06:00:36.543" Title="Risk Neutral Probability" Tags="&lt;option-pricing&gt;&lt;risk-neutral-measure&gt;" AnswerCount="6" CommentCount="3" FavoriteCount="16" ContentLicense="CC BY-SA 3.0" />
  <row Id="9255" PostTypeId="1" AcceptedAnswerId="9261" CreationDate="2013-10-25T01:02:05.510" Score="1" ViewCount="645" Body="&lt;p&gt;I have ready in several websites that HFT can help increase market liquidity, although this is contested in some articles.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not familiar with the concept of market liquidity. What is the basis of the argument that HFT can help increase liquidity?&lt;/p&gt;&#xA;" OwnerUserId="6149" LastActivityDate="2013-10-25T17:35:36.563" Title="How could HFT help increase liquidity?" Tags="&lt;high-frequency&gt;&lt;liquidity&gt;" AnswerCount="1" CommentCount="2" ClosedDate="2013-10-25T13:29:47.210" ContentLicense="CC BY-SA 3.0" />
  <row Id="9256" PostTypeId="1" CreationDate="2013-10-25T01:05:57.370" Score="2" ViewCount="403" Body="&lt;p&gt;My goal is to test if ES (CVaR) empirically is a better risk measure than VaR for a set of given variables (assumed underlying distribution, confidence level, sample size) for different asset classes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As VaR and ES are like apples and oranges, they can not be compared directly. Most backtesting frameworks that I have found test explicitly VaR or ES (I am aware of the difficulties of backtesting ES) and these backtests are not comparable and it is seems hard to infer if e.g ES is superior to VaR from given samples. I assume there must be involved some function  that include a common success factor. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on this, I am wondering if there are any known approaches for statistically testing (backtests) and comparing VaR and ES?&lt;/p&gt;&#xA;" OwnerUserId="6204" LastActivityDate="2013-10-25T01:05:57.370" Title="Comparing Backtests of Value-at-Risk and Expected Shortfall" Tags="&lt;backtesting&gt;&lt;value-at-risk&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9257" PostTypeId="1" AcceptedAnswerId="9258" CreationDate="2013-10-25T01:08:48.777" Score="3" ViewCount="1207" Body="&lt;p&gt;In &lt;a href=&quot;https://quant.stackexchange.com/questions/293/categories-of-systematic-trading-strategies?rq=1&quot;&gt;this thread&lt;/a&gt;, the top answer discusses: &quot;&lt;code&gt;buy on bid, sell on ask&lt;/code&gt;&quot; as &quot;&lt;code&gt;market making&lt;/code&gt;&quot; strategies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;In layman terms, what does &quot;&lt;code&gt;buy on bid, sell on ask&lt;/code&gt;&quot; mean?&lt;/li&gt;&#xA;&lt;li&gt;Why are these techniques called &quot;&lt;code&gt;market making&lt;/code&gt;&quot;?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="6149" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2013-11-01T06:21:48.080" Title="Market making: buy on bid/sell on ask" Tags="&lt;market-making&gt;&lt;bid&gt;" AnswerCount="2" CommentCount="4" ClosedDate="2013-11-01T14:52:50.963" ContentLicense="CC BY-SA 3.0" />
  <row Id="9258" PostTypeId="2" ParentId="9257" CreationDate="2013-10-25T01:45:08.120" Score="10" Body="&lt;p&gt;Most organized markets have intermediaries to match buyers and sellers who may arrive at different rates.  These intermediaries are typically called market makers because they &quot;make markets&quot; by buying from people who want to sell and selling to people who want to buy.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since market makers take on risk to provide liquidity, they generally need to be compensated for their services.  This compensation usually comes in the form of what's called the &quot;bid/ask spread&quot;.  A market maker will buy at the bid price and sell at the ask (or offer) price.  These liquidity providers can thus earn a return by providing immediacy to impatient traders.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See Harold Demsetz (1968) &lt;a href=&quot;http://web.cenet.org.cn/upfile/100078.pdf&quot;&gt;&quot;The Cost of Transacting&quot;&lt;/a&gt; for an early reference on this subject.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is an extensive field to explain this field known as &quot;market microstructure&quot;.  &lt;a href=&quot;http://www.statalgo.com/2012/08/05/market-microstructure-2-an-overview/&quot;&gt;As I discussed in the past&lt;/a&gt;, there were traditionally two major types of models for explaining the spread within this literature: asymmetric information based models and inventory models. Inventory models were originally derived from Garman (1976). Asymmetric information models have received the most attention recently; there are two standard frameworks: the &quot;sequential trade framework&quot; by Glosten and Milgrom (1985) and the &quot;strategic trade framework&quot; developed by Kyle (1985).&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="848" LastEditDate="2013-10-25T07:56:52.643" LastActivityDate="2013-10-25T07:56:52.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9259" PostTypeId="2" ParentId="710" CreationDate="2013-10-25T01:56:58.487" Score="2" Body="&lt;p&gt;Yes.  You're right that queue position is less important in a pure pro-rata market.  But in a market that is very deep, such as Eurodollars, the cost of getting adversely selected (&quot;catching a falling dagger&quot;) is huge (very large bid/ask spread).  So it is critical to cancel any open orders quickly when the price is about to move.&lt;/p&gt;&#xA;" OwnerUserId="17" LastActivityDate="2013-10-25T01:56:58.487" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9261" PostTypeId="2" ParentId="9255" CreationDate="2013-10-25T12:33:13.840" Score="5" Body="&lt;p&gt;You can find a varying number of practitioners and academics on both sides of&#xA;this debate. To be honest, the question of whether &quot;High Frequency Traders&quot;&#xA;increase liquidity is ill-posed. The label is often misused and is broadly&#xA;encompasing of too many different types of traders.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, in general:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Any trader that posts resting limit orders is adding liquidity to the&#xA;market place.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Any limit order resting on the order book is immediately executable by any&#xA;trader with sufficient liquidity demands.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Passive traders attempt to limit when they trade by canceling their resting&#xA;orders when they believe a change in price is probably. Not doing so&#xA;exposes their orders to adverse selection.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;When a passive trader's orders are filled, especially when adversely&#xA;selected, they sometimes, depending on their specific circumstances, have&#xA;to immediately demand liquidity from the market place to reduce or limit&#xA;their risk.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The above applies to all participants, whether they are &quot;high frequency&quot; or&#xA;not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find firms that are primarily aggressive takers of liquidity. You can&#xA;also find firms that are primarily passive traders posting limit orders. This&#xA;is true of &quot;HFT&quot; firms all the way to individual traders.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many detractors believe that passive HFTs do not add high quality liquidity to the&#xA;market place. They point to high cancel/fill rates and other characteristics&#xA;of their order flow as evidence. In my mind this represents a type of &quot;model&#xA;bigotry&quot;. These traders are simply better than many other participants and are&#xA;using more sophisticated models. Without official market maker obligations a&#xA;HFT, indeed ANY trader, should be free to manage their orders in whichever way&#xA;they wish. If it means their liquidity is too hard for you to access, then you&#xA;as a counter party must either choose not to trade with them or become better.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll also add, some people even go so far as to suggest that aggressive&#xA;traders also add liquidity to the market place. After all, limit orders won't&#xA;be matched unless someone is willing to cross the spread and demand liquidity.&#xA;This is a point of view that likely differs significantly from the academic&#xA;viewpoint of liquidity. I first heard it from Jaffray Woodriff of QIM fame,&#xA;and have come to believe it to be true.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, to answer your question directly, what is the basis for the argument that&#xA;a &quot;high frequency trader&quot; increases liquidity? I'll provide two answers:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Any trader, whether a HFT or not, that posts orders is adding liquidity.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Any trader, whether a HFT or not, that takes liquidity is &quot;adding&#xA;liquidity&quot; to the market place by trading with a resting limit order.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1355" LastEditorUserId="1355" LastEditDate="2013-10-25T17:35:36.563" LastActivityDate="2013-10-25T17:35:36.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9262" PostTypeId="2" ParentId="9253" CreationDate="2013-10-25T14:15:49.443" Score="2" Body="&lt;p&gt;I think the classic explanation (any other measure costs money) may not be the most intuitive explanation but it is also the most clear in some sense and therefore does not really require a intuitive explanation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is to say: you could use any measure you want, measures that make sense, measures that don't but if the measure you choose is a measure different from the risk neutral one you will use money. Therefore, don't.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2013-10-25T14:15:49.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9263" PostTypeId="2" ParentId="728" CreationDate="2013-10-25T16:31:38.753" Score="2" Body="&lt;p&gt;There are three languages : c++, R , python. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Performance wise : c++ &gt; python &gt;&gt; R&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Packages available : R &gt;&gt; python &gt;&gt; c++&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ease of manual exploratory analysis : R &gt; python &gt;&gt; c++&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ease of adding GUI like features and interactivity: python &gt; c++ &gt;&gt; R&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ease of programming small projects : R &gt; python &gt;&gt; c++&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ease of programming large projects : c++ &gt; python &gt;&gt; R&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Scalability in performance : c++ &gt; python &gt;&gt; R&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ease of learning : python &gt; R &gt; c++&lt;/p&gt;&#xA;" OwnerUserId="6289" LastActivityDate="2013-10-25T16:31:38.753" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9264" PostTypeId="2" ParentId="9253" CreationDate="2013-10-25T16:41:58.763" Score="5" Body="&lt;p&gt;Risk neutral probability differs from the actual probability by removing any trend component from the security apart from one given to it by the risk free rate of growth. If you think that the price of the security is to go up, you have a probability different from risk neutral probability. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In very layman terms, the expectation is taken with respect to the risk neutral probability because it is expected that any trend component should have been discounted for by the traders and hence at any moment, there is no non-speculative reason to assume that the security is biased towards the upside or the downside.&lt;/p&gt;&#xA;" OwnerUserId="6289" LastActivityDate="2013-10-25T16:41:58.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9265" PostTypeId="1" AcceptedAnswerId="9266" CreationDate="2013-10-25T19:13:13.467" Score="0" ViewCount="2777" Body="&lt;p&gt;What exactly is a &lt;strong&gt;resting limit order&lt;/strong&gt;?  I could not find a definition on &lt;a href=&quot;http://en.wikipedia.org/wiki/Special%3aSearch?search=resting%20limit%20order&quot; rel=&quot;nofollow&quot;&gt;Wikipedia&lt;/a&gt; or &lt;a href=&quot;https://www.google.com/search?q=resting%20limit%20order&quot; rel=&quot;nofollow&quot;&gt;Google&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6149" LastActivityDate="2013-10-25T19:28:24.493" Title="What is a resting limit order?" Tags="&lt;limit-order-book&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2013-10-25T20:07:41.197" ContentLicense="CC BY-SA 3.0" />
  <row Id="9266" PostTypeId="2" ParentId="9265" CreationDate="2013-10-25T19:28:24.493" Score="3" Body="&lt;p&gt;An un-marketable limit order (buy limit price is &amp;lt; lowest offer, sell limit price is &gt; highest bid) that has a time in force allowing it to be placed onto a matching engine's limit order book. It is said to &quot;rest&quot; on the book. If the time in force is Immediate or Cancel and the order is unmarketable, it is canceled back to the participant unfilled.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2013-10-25T19:28:24.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9268" PostTypeId="2" ParentId="3108" CreationDate="2013-10-25T20:38:42.547" Score="0" Body="&lt;p&gt;I'm not sure this is what you were getting at, but I think the connection to the heat equation might be explainable.  The second derivative $\partial^2 V\over\partial S^2$ provides a measure of the divergence of $V$ from linearity in $S$.  In the heat equation that represents a local anomaly which will be smoothed out in time; in the BS pde one could see it as measuring the effect of risk aversion on pricing.  I.e., if investors have no risk aversion we would expect $V$ to be (locally) linear in $S$, but risk aversion causes them to weigh rises in $S$ less than falls.  Reinterpreting this in terms of risk-neutral probabilities, the option pricing is affected by these modified expectations.&lt;/p&gt;&#xA;" OwnerUserId="6362" LastActivityDate="2013-10-25T20:38:42.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9269" PostTypeId="2" ParentId="8962" CreationDate="2013-10-26T14:37:05.920" Score="0" Body="&lt;p&gt;The option price is a martingale only because of that speculative activity. if there is any reason for the prices to move, there is some speculator(s) who is putting in money to cash in on that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you have to price the option, you also consider any reason for the trend to exist in the price. So you have two components. One is your own speculative component and the other is the component of the rest of the market which is a martingale. You use the pricing theory for the martingale part as relative pricing applies to that. For your own speculation, you have to make adjustments.&lt;/p&gt;&#xA;" OwnerUserId="6289" LastActivityDate="2013-10-26T14:37:05.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9270" PostTypeId="1" CreationDate="2013-10-26T14:40:16.590" Score="2" ViewCount="315" Body="&lt;p&gt;I would like to learn more about the Greeks of portfolios of options:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In textbooks and websites, I commonly encounter the unqualified claim that &quot;The Greek measure of a portfolio is the sum of the Greeks of the individual portfolio components&quot;.  This statement is obviously true for constant portfolios (due to the linearity of mathematical derivatives), but I am pretty sure it cannot always be true for non-constant, non-self-financing portfolios.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I am unsure about, is whether the claim is always true for non-constant, self-financing portfolios.  For self-financing portfolios, dV = h·dS (where V is the value of the portfolio and S the vector of the values of portfolio components), so I expect that that the claim should be true for first derivatives such as delta and theta.  But what about second derivatives such as gamma?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would appreciate it very much if anyone could provide me with a proof that each of the Greeks of a self-financing portfolio is indeed the sum of the Greeks of the components.  Or if the proof is a bit lengthy, if you could refer me to a book (or article or website) where the proof is discussed in proper detail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="6368" LastActivityDate="2014-11-19T07:48:55.827" Title="Greeks of self-financing portfolio" Tags="&lt;portfolio&gt;&lt;greeks&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9271" PostTypeId="1" CreationDate="2013-10-26T17:19:23.300" Score="3" ViewCount="8601" Body="&lt;p&gt;I am looking for a broker who provides a free trading API for FX. The goal is to develop at-home algorithms in C# (possibly Qt) to run on a fake portfolio, and then later on real money with competitive broker fees.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would you know some comparison of such APIs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What do you think of OANDA? Dukascopy? TD Ameritrade?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here is the list of APIs I have found so far:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Delta Trading API&lt;/li&gt;&#xA;&lt;li&gt;FxSpyder&lt;/li&gt;&#xA;&lt;li&gt;AVAFx&lt;/li&gt;&#xA;&lt;li&gt;Dukascopy bank trading API&lt;/li&gt;&#xA;&lt;li&gt;TD Ameritrade&lt;/li&gt;&#xA;&lt;li&gt;FxCM&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="6369" LastEditorUserId="35" LastEditDate="2013-10-29T02:09:03.327" LastActivityDate="2014-06-14T22:17:16.777" Title="C# Broker API for FX Trading" Tags="&lt;fx&gt;&lt;algorithmic-trading&gt;&lt;programming&gt;" AnswerCount="4" CommentCount="9" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9273" PostTypeId="2" ParentId="9271" CreationDate="2013-10-26T22:04:58.900" Score="2" Body="&lt;p&gt;Take a look at FIX4.4 protocol, accessible from &lt;a href=&quot;http://www.dukascopy.com/swiss/english/forex/api/fix_api/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.dukascopy.com/swiss/english/forex/api/fix_api/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thread about C# libraries: &lt;a href=&quot;https://stackoverflow.com/questions/4876279/fix-library-for-net&quot;&gt;https://stackoverflow.com/questions/4876279/fix-library-for-net&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6175" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2013-10-26T22:04:58.900" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9276" PostTypeId="5" CreationDate="2013-10-27T09:14:58.183" Score="0" Body="&lt;p&gt;The essential questions asked here are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;how to estimate volatility using HF data?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://quant.stackexchange.com/questions/2589/how-to-calculate-historical-intraday-volatility/&quot;&gt;How to calculate historical intraday volatility?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://quant.stackexchange.com/questions/869/better-estimator-of-volatility-for-small-samples/874#874&quot;&gt;better estimator of volatility for small samples&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://quant.stackexchange.com/questions/2360/what-exactly-is-meant-by-microstructure-noise/3277#3277&quot;&gt;What exactly is meant by &amp;quot;microstructure noise&amp;quot;?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;how to estimate correlations using HF data?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://quant.stackexchange.com/questions/2882/how-to-manage-equity-portfolio-risk-intraday/3265#3265&quot;&gt;How to manage equity portfolio risk intraday?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://quant.stackexchange.com/questions/9167/when-does-the-epps-effect-start&quot;&gt;When does the Epps effect start?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://quant.stackexchange.com/questions/3516/how-to-model-time-series-of-illiquid-stocks-400-observations-transactions-pe/3535#3535&quot;&gt;How to model time series of illiquid stocks - 400 observations (transactions) per 8 hours?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In terms of literature, the links usually pointed to are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The Rosenbaum-Robert approach, the &lt;a href=&quot;http://www.citeulike.org/user/lehalle/article/8317402&quot; rel=&quot;nofollow&quot;&gt;price model with uncertainty zones&lt;/a&gt; is a model of trades and duration between trades (implicitly). It is worthwhile to try it.&lt;/li&gt;&#xA;&lt;li&gt;You can also use an &lt;a href=&quot;http://www.citeulike.org/user/lehalle/article/9217792&quot; rel=&quot;nofollow&quot;&gt;Hawkes process&lt;/a&gt;, it will have the nice effect of capturing clustering effects on trades.&lt;/li&gt;&#xA;&lt;li&gt;if you want to use correlation / dependency measurements, you will face the &lt;strong&gt;Epps effect&lt;/strong&gt;, so you should read at least &lt;a href=&quot;http://www.citeulike.org/user/lehalle/article/2904415&quot; rel=&quot;nofollow&quot;&gt;one Yoshida paper&lt;/a&gt; on the topic.&lt;/li&gt;&#xA;&lt;li&gt;On &lt;strong&gt;order-flow viewpoint&lt;/strong&gt; can be useful that for. There is a very good suite of papers by &lt;a href=&quot;http://www.citeulike.org/user/lehalle/article/8531765&quot; rel=&quot;nofollow&quot;&gt;Rama Cont and Adrien de Larrad&lt;/a&gt; on this topic.&lt;/li&gt;&#xA;&lt;li&gt;Zhang et al. &quot;&lt;a href=&quot;http://scholar.google.fi/scholar?hl=en&amp;amp;q=Estimating%20Covariation%3a%20Epps%20Effect,%20Microstructure%20Noise&amp;amp;btnG=&amp;amp;as_sdt=1,5&amp;amp;as_sdtp=&quot; rel=&quot;nofollow&quot;&gt;Estimating Covariation: Epps Effect, Microstructure Noise&lt;/a&gt;&quot; present a fairly straightforward way to effectively remove the Epps effect by considering a certain difference of correlations such that the Epps effect/ bias cancels.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://books.google.fr/books?id=idpLcmugvdMC&amp;amp;lpg=PA601&amp;amp;dq=lehalle%20market%20microstructure%20knowledge&amp;amp;hl=fr&amp;amp;pg=PA549#v=onepage&amp;amp;q&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;Market Microstructure knowledge needed to  control an intra-day trading process&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2013-10-27T09:23:49.427" LastActivityDate="2013-10-27T09:23:49.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9277" PostTypeId="4" CreationDate="2013-10-27T09:14:58.183" Score="0" Body="High frequency (or ultra high frequency) data cannot be used as continuous regularly sampled time series to build estimators of: volatility, traded volumes, correlations, etc..." OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2013-10-27T09:24:01.723" LastActivityDate="2013-10-27T09:24:01.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9278" PostTypeId="2" ParentId="9113" CreationDate="2013-10-27T14:11:03.663" Score="2" Body="&lt;p&gt;So to summarize the comments given, dark pools seem to do the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;banning of specific firms by the dark pool&lt;/li&gt;&#xA;&lt;li&gt;requiring a minimum order size&lt;/li&gt;&#xA;&lt;li&gt;banning of firms by the participants&lt;/li&gt;&#xA;&lt;li&gt;flow analysis to separate different types of players&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;To me it seems that this covers most of the reasonable actions they could possibly take and whether this is done seems to be a good indicator. It is up to you to decide how well the first and last item are implemented. By banning the majority of the firms you can effectively make a whitelist which allows you to only trade with firms you like.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2013-10-27T14:11:03.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9279" PostTypeId="1" CreationDate="2013-10-27T18:19:45.850" Score="4" ViewCount="313" Body="&lt;p&gt;I'm reading &lt;a href=&quot;http://www.mat.ub.edu/~corcuera/ifqfe3.pdf&quot; rel=&quot;nofollow&quot;&gt;this book&lt;/a&gt; and I'm looking at page 4, and we are considering the case where $C_t - P_t - S_t$ is &lt;strong&gt;negative&lt;/strong&gt;, which means that selling the call did not offset the cost of the stock and the put together. So, case 1), $S_T &amp;gt; K$, which means that the buyer of the call will exercise their option, so we will also have to give the buyer $K$ for the stock at time of maturity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, $C_t - P_t - S_t$ is money that we had to borrow in order to buy the cost of the stock and the put that was not offset by the money that we received by selling the call. So the interest at maturity of that money that we &lt;strong&gt;owe&lt;/strong&gt; is $(C_t - P_t - S_t)e^{r(T-t)}$. To that money that we owe, we add the money that we owe to the contract buyer, since we are in case 1) where the strike is larger than the call price. So &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$(C_t - P_t - S_t)e^{r(T-t)} + K &amp;lt; 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is money that we owe. But on the reference, they put the opposite sign; $$(C_t - P_t - S_t)e^{r(T-t)} + K &amp;gt; 0$$ like it was profit!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this a mistake, or am I misunderstanding something?&lt;/p&gt;&#xA;" OwnerUserId="6373" LastActivityDate="2013-10-28T03:04:28.143" Title="put-call parity equation" Tags="&lt;put-call-parity&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9281" PostTypeId="1" CreationDate="2013-10-27T23:16:06.310" Score="2" ViewCount="935" Body="&lt;p&gt;This is a very basic question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Computing the notional volume for futures contracts usually consists of something like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V_F = N \cdot P \cdot M \cdot FX$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $V_F$ is the dollar volume of the futures contract $F$, $N$ is the number of contracts, $P$ is the price, $M$ is the contract value (or multiplier), and $FX$ is the exchange rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, for E-Mini S&amp;amp;P 500 futures would be something like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V_{ES} = 1M \cdot \$1700 \cdot 50 \cdot 1 = \$85,000,000,000$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $50$ reflects the fact that one $ES$ contract is 50 indexes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: &lt;a href=&quot;https://www.cmegroup.com/trading/interest-rates/stir/eurodollar_quotes_volume_voi.html&quot; rel=&quot;nofollow&quot;&gt;the volume for $EDZ3$ was ~73,000 last Friday.&lt;/a&gt;  How can I convert this into a notional volume?  The Eurodollar contract reflects the 90-day interest on $1M.  &lt;/p&gt;&#xA;" OwnerUserId="3257" LastEditorUserId="18977" LastEditDate="2016-01-13T16:23:41.383" LastActivityDate="2016-01-13T16:23:41.383" Title="How to think about dollar volume in Eurodollar futures?" Tags="&lt;interest-rates&gt;&lt;futures&gt;&lt;eurodollars&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9282" PostTypeId="2" ParentId="9279" CreationDate="2013-10-28T01:14:40.730" Score="1" Body="&lt;p&gt;I think this is where your logic goes wrong:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(C_t − P_t − S_t)e^{r(T−t)} + K$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With reference to the above equation, you are saying that &quot;...To that money that we owe, we add the money that we owe to the contract buyer..&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yes, $(C_t − P_t − S_t)e^{&#xA;r(T−t)}$ is the money that we owe, but $K$ is not referring to money that we &lt;em&gt;also&lt;/em&gt; owe the contract buyer. $K$ is the strike price, so it is the money we &lt;strong&gt;receive&lt;/strong&gt; from the contract buyer at maturity when he exercises the option. Yes, the call option is in a losing position, but $K$ is not referring to the actual loss.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, the equation is really saying that the money we borrowed to finance this strategy (plus the accrued interest) is less than the amount we ended up receiving when the contract buyer exercised his option and bought the stock from us at the strike price. A net gain will also result if $S_t &amp;lt; K$ as well, which demonstrates that an arbitrage opportunity exists when $C_t - P_t &amp;gt; S_t - Ke^{-r(T-t)}$.&lt;/p&gt;&#xA;" OwnerUserId="6375" LastEditorUserId="6375" LastEditDate="2013-10-28T03:04:28.143" LastActivityDate="2013-10-28T03:04:28.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9283" PostTypeId="2" ParentId="9253" CreationDate="2013-10-28T08:40:49.917" Score="11" Body="&lt;p&gt;You're missing the point of the risk-neutral framework.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea is as follows: assume the real probability measure called $\mathbb{P}$. The thing is, because investors are not risk-neutral, you &lt;strong&gt;cannot&lt;/strong&gt; write that $v_0 = E_\mathbb{P} [ e^{-rT} V_T]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the &lt;a href=&quot;http://www.math.cornell.edu/~mec/Summer2008/spulido/fftap.html&quot; rel=&quot;noreferrer&quot;&gt;Fundamental Theorem of Asset Pricing&lt;/a&gt;, you know that if the market is arbitrage-free, then there exists a probability measure $\mathbb{Q}$ such that $v_0 = E_\mathbb{Q} [ e^{-rT} V_T]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what you do is that you define the probability measure $\mathbb{Q}$ sur that $v_0 = E_\mathbb{Q} [ e^{-rT} V_T]$ holds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously, they are not the same thing.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2013-11-21T08:14:07.150" LastActivityDate="2013-11-21T08:14:07.150" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9285" PostTypeId="2" ParentId="1350" CreationDate="2013-10-28T13:58:30.410" Score="2" Body="&lt;p&gt;Similar to the answer aleady given. We can use a measure $Q$ such that $E_Q[A_n] = 0$.&#xA;Let's reformulate the sequence as &#xA;$X_0 =x$ and $X_{n+1} = X_n + A_{n+1}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, beause expectation is linear:&#xA;$$&#xA;E_Q[X_{n+1}|F_n] = E_Q[X_n|F_n] + E_Q[A_{n+1}|F_n].&#xA;$$&#xA;Now assume that $\{F_n\}_{n=0}^\infty$ is the filtration that represents the information of $(X_n)_{n=0}^\infty$ (the sigma-algebra generated) with all the null-sets and the technical assumptions then&#xA;$$&#xA;E_Q[X_n|F_n] = X_n&#xA;$$&#xA;and $E_Q[A_{n+1}|F_n] = E_Q[A_{n+1}] = 0$&#xA;by independence and because $ E_Q[A_{n+1}] = 0$.&#xA;If we choose $Q$ such that it is equivalent to $P$ this should be the solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope I don't miss simething important here.&#xA;If $A_n \sim N(1,1)$ under $P$ then $Q$ could be $N(0,a)$ with $a&amp;gt;0$ which is equivalent and has the correct expectation. You can even calculate the change of measure.&#xA;If I am correct then it turns out that Q is not (!) unique. I am curious about following discussions.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2013-10-28T13:58:30.410" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9286" PostTypeId="1" AcceptedAnswerId="9294" CreationDate="2013-10-28T16:30:26.177" Score="4" ViewCount="988" Body="&lt;p&gt;I am currently trying to do a study in the interbank lending market, i plan to fit a &lt;code&gt;DCC&lt;/code&gt; model to model them, these series below is taken from &lt;code&gt;datastream&lt;/code&gt; and what i wanted to do is to get these series from each nation (chn, fra, ger, gre, hk, id, ita, jp, my, sing, skor, sp , th, uk, us)&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;overnight&lt;/code&gt; or &lt;code&gt;o/n&lt;/code&gt; and &lt;code&gt;tomorrow/next&lt;/code&gt; or &lt;code&gt;t/n&lt;/code&gt;  &lt;/li&gt;&#xA;&lt;li&gt;1 week&lt;/li&gt;&#xA;&lt;li&gt;1 month&lt;/li&gt;&#xA;&lt;li&gt;6 month&lt;/li&gt;&#xA;&lt;li&gt;1 year&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;what confused me was the naming of these series   &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;e.g. does &lt;code&gt;bangkok interbank rate 1 Yr&lt;/code&gt; represent all of Thailand &#xA;instead of the non existant &lt;code&gt;thailand interbank rate 1 Yr&lt;/code&gt;  &lt;/li&gt;&#xA;&lt;li&gt;e.g. does &lt;code&gt;t/n&lt;/code&gt; equal with &lt;code&gt;o/n&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;what is &lt;code&gt;EU-FRANC&lt;/code&gt; and &lt;code&gt;EU-MARK&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;middle rate&lt;/code&gt; vs &lt;code&gt;offered rate&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;and finally &lt;strong&gt;&lt;em&gt;could someone point me to what literature i should read ?&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;&#xA;&lt;strong&gt;note:&lt;/strong&gt;  i had read &lt;code&gt;Mishkin's Financial Market and Institutions&lt;/code&gt;, it doesnt help&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;these are the series that i had in my hand now&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;CHINA INTERBANK O/N - OFFERED RATE  &#xA;CHINA INTERBANK 1 WEEK - OFFERED RATE  &#xA;CHINA INTERBANK 1 MONTH - OFFERED RATE  &#xA;SHANGHAI INTERBANK RATE - 1 WEEK - MIDDLE RATE  &#xA;SHANGHAI INTERBANK RATE - 1 MONTH - MIDDLE RATE&#xA;SHANGHAI INTERBANK RATE - 6 MONTHS - MIDDLE RATE  &#xA;SHANGHAI INTERBANK RATE - 1 YEAR - MIDDLE RATE  &#xA;CHINA INTEREST ON EXC RES(DISC) - MIDDLE RATE  &#xA;CHINA RESERVE REQ. RATIO: SML BANK - MIDDLE RATE  &#xA;CHINA RESERVE REQ. RATIO: BIG BANK - MIDDLE RATE  &#xA;CHINA RES. REQ. RAT. RURAL CR. COOP. - MIDDLE RATE  &#xA;CHINA OVERNIGHT CALL DEP. RATE - MIDDLE RATE   &#xA;CHINA DEMAND depo RT(DISC) - MIDDLE RATE  &#xA;CHINA CALL DEPOSIT RATE, 1W - MIDDLE RATE  &#xA;CHINA REPO O/N - MIDDLE RATE  &#xA;CHINA REDISCOUNTING RATE - MIDDLE RATE &#xA;CHINA REPO 1 WEEK - MIDDLE RATE  &#xA;CHINA REPO 1 MONTH - MIDDLE RATE  &#xA;CHINA REPO 6 MONTH - MIDDLE RATE  &#xA;CHINA REPO 1 YEAR - MIDDLE RATE&#xA;FRANCE INTERBANK 1 YEAR - OFFERED RATE  &#xA;FRANCE INTERBANK 6 MONTH - OFFERED RATE  &#xA;FRANCE INTERBANK 1 MONTH - OFFERED RATE  &#xA;FRANCE PIBOR 1 MONTH - OFFERED RATE  &#xA;FRANCE PIBOR 1 MONTH MONTH AVG. - OFFERED RATE  &#xA;FRANCE EU-FRANC S/T (FT/ICAP/TR) - MIDDLE RATE  &#xA;FRANCE EU-FRANC 1WK (FT/ICAP/TR) - MIDDLE RATE  &#xA;FRANCE EU-FRANC 1M (FT/ICAP/TR) - MIDDLE RATE  &#xA;FRANCE EU-FRANC 6M (FT/ICAP/TR) - MIDDLE RATE  &#xA;FRANCE EU-FRANC 1YR (FT/ICAP/TR) - MIDDLE RATE  &#xA;FRANCE INTERBANK CALL (TMP) - OFFERED RATE  &#xA;FRANCE INTERBANK CALL (TMM) - MIDDLE RATE  &#xA;FRANCE INTERBANK CALL (TAM) - MIDDLE RATE  &#xA;GERMANY EU-MARK S/T (FT/ICAP/TR) - MIDDLE RATE  &#xA;GERMANY EU-MARK 1WK (FT/ICAP/TR) - MIDDLE RATE  &#xA;GERMANY EU-MARK 1M (FT/ICAP/TR) - MIDDLE RATE  &#xA;GERMANY EU-MARK 6M (FT/ICAP/TR) - MIDDLE RATE  &#xA;GERMANY EU-MARK 1 YR (FT/ICAP/TR) - MIDDLE RATE  &#xA;GERMANY INTERBANK OVERNIGHT - OFFERED RATE  &#xA;GERMANY INTERBANK 1 MONTH - OFFERED RATE  &#xA;GERMANY INTERBANK 6 MONTH - OFFERED RATE  &#xA;GERMANY INTERBANK 12 MONTH - OFFERED RATE  &#xA;MNY MKT - OVERNIGHT FF BANKS(DISC) - MIDDLE RATE  &#xA;MNY MKT - 1-MONTH FF BANKS(DISC) - MIDDLE RATE  &#xA;MNY MKT - 6-MONTH FF BANKS(DISC) - MIDDLE RATE  &#xA;MNY MKT - 12-MONTH FF BANKS(DISC) - MIDDLE RATE  &#xA;GREECE INTERBANK 6 MONTH - MIDDLE RATE  &#xA;GREECE INTERBANK 1 MONTH - MIDDLE RATE  &#xA;GREECE DEPOSIT OVERNIGHT - MIDDLE RATE  &#xA;GREECE DEPOSIT SPOT NEXT - MIDDLE RATE  &#xA;GREECE DEPOSIT TOMORROW NEXT - MIDDLE RATE  &#xA;GREECE LOMBARD - MIDDLE RATE  &#xA;GREECE DISCOUNT - MIDDLE RATE  &#xA;GREECE INTERVENTION - MIDDLE RATE  &#xA;GREECE OVERDRAFT - MIDDLE RATE  &#xA;GREECE DEPOSIT 1 WEEK - MIDDLE RATE  &#xA;GREECE DEPOSIT 6 MONTH - MIDDLE RATE  &#xA;GREECE DEPOSIT 1 YEAR - MIDDLE RATE  &#xA;HONG KONG PRIME - MIDDLE RATE  &#xA;HKD DEPO TOM/NEXT - MIDDLE RATE  &#xA;HKD INTERBANK FIX 2 WEEK - OFFERED RATE  &#xA;HKD DEPO OVERNIGHT - MIDDLE RATE  &#xA;HKD DEPO 1 WEEK - MIDDLE RATE  &#xA;HKD DEPO 1 MONTH - MIDDLE RATE  &#xA;HKD DEPO 6 MONTH - MIDDLE RATE  &#xA;HKD DEPO 1 YEAR - MIDDLE RATE  &#xA;HKD INTERBANK FIX 1 DAY - OFFERED RATE  &#xA;HKD INTERBANK FIX 1 WEEK - OFFERED RATE  &#xA;HKD INTERBANK FIX 1 MONTH - OFFERED RATE  &#xA;HKD INTERBANK FIX 6 MONTH - OFFERED RATE  &#xA;HKD INTERBANK FIX 1 YEAR - OFFERED RATE  &#xA;HONG KONG BASE RATE - MIDDLE RATE  &#xA;INDONESIAN INTERBANK O/N - MIDDLE RATE  &#xA;INDONESIAN INTERBANK 1W - MIDDLE RATE  &#xA;INDONESIAN INTERBANK 1M - MIDDLE RATE  &#xA;INDONESIAN INTERBANK 6M - MIDDLE RATE  &#xA;INDONESIAN INTERBANK 1Y - MIDDLE RATE  &#xA;INDONESIA BI RATE - MIDDLE RATE  &#xA;INDONESIA SBI 30 DAY - MIDDLE RATE  &#xA;ITALY INTERBANK 7 DAY - OFFERED RATE  &#xA;ITALY INTERBANK 1 MONTH - OFFERED RATE  &#xA;ITALY INTERBANK 6 MONTH - OFFERED RATE  &#xA;ITALY INTERBANK 12 MONTH - OFFERED RATE  &#xA;ITALY ATIC INTERBANK OVERNIGHT - MIDDLE RATE  &#xA;ITALY ATIC INTERBANK SPOT NEXT - MIDDLE RATE  &#xA;ITALY ATIC INTERBANK T/N - MIDDLE RATE  &#xA;ITALY EURO-LIRE T/N (FT/ICAP/TR) - MIDDLE RATE  &#xA;ITALY EURO-LIRE 1M (FT/ICAP/TR) - MIDDLE RATE  &#xA;ITALY EURO-LIRE 6M (FT/ICAP/TR) - MIDDLE RATE  &#xA;ITALY EURO-LIRE 1 YR (FT/ICAP/TR) - MIDDLE RATE  &#xA;ITALY EURO-LIRE 1WK (FT/ICAP/TR) - MIDDLE RATE  &#xA;TOKYO INTERBANK JP YEN 1W - OFFERED RATE  &#xA;TOKYO INTERBANK JP YEN 1M - OFFERED RATE  &#xA;TOKYO INTERBANK JP YEN 6M - OFFERED RATE  &#xA;TOKYO INTERBANK JP YEN 1Y - OFFERED RATE  &#xA;TOKYO INTERBANK EUROYEN 1W - OFFERED RATE  &#xA;TOKYO INTERBANK EUROYEN 1M - OFFERED RATE  &#xA;TOKYO INTERBANK EUROYEN 6M - OFFERED RATE  &#xA;TOKYO INTERBANK EUROYEN 1Y - OFFERED RATE  &#xA;JAPAN BASIC DISCOUNT RT(DISC) - MIDDLE RATE  &#xA;JAPAN GENSAKI T BILL OVERNIGHT - MIDDLE RATE  &#xA;JAPAN GENSAKI T BILL 1 WEEK - MIDDLE RATE  &#xA;JAPAN GENSAKI T BILL 1 MONTH - MIDDLE RATE  &#xA;JAPAN INTERBANK (OFFSHORE) 1M - OFFERED RATE  &#xA;JAPAN INTERBANK (OFFSHORE) 6M - OFFERED RATE  &#xA;JAPAN INTERBANK (OFFSHORE) 1Y - OFFERED RATE  &#xA;JAPAN PRIME LENDING SHORT TERM - MIDDLE RATE  &#xA;JAPAN PRIME LENDING LONG TERM - MIDDLE RATE  &#xA;JAPAN LIBOR CAPITAL. INDEX 1 MONTH - TOT RETURN IND  &#xA;JAPAN LIBOR CAPITAL. INDEX 6 MONTH - TOT RETURN IND  &#xA;JAPAN (TOKYO) FOREX SPOT MIL US - VOLUME TRADED  &#xA;JAPAN (TOKYO) FOREX SWAP MIL US - VOLUME TRADED  &#xA;MALAYSIA INTERBANK DEP. OVERNIGHT - MIDDLE RATE  &#xA;OVERNIGHT POLICY RATE - MIDDLE RATE  &#xA;MALAYSIA INTERBANK DEPOSIT 1 WEEK - MIDDLE RATE  &#xA;MALAYSIA INTERBANK DEPOSIT 1 MONTH - MIDDLE RATE  &#xA;MALAYSIA INTERBANK depo 6MS(DISC) - MIDDLE RATE  &#xA;MALAYSIA INTERBANK DEP. 1Y(DISC) - MIDDLE RATE  &#xA;MALAYSIA BASE LENDING - MIDDLE RATE  &#xA;MALAYSIA INTERBANK OVERNIGHT - MIDDLE RATE  &#xA;MALAYSIA INTERBANK 1 WEEK - MIDDLE RATE  &#xA;MALAYSIA INTERBANK 6 MONTH - MIDDLE RATE  &#xA;MALAYSIA INTERBANK 1 YEAR - MIDDLE RATE  &#xA;MALAYSIA DEPOSIT 1 MONTH - MIDDLE RATE  &#xA;MALAYSIA DEPOSIT 6 MONTH - MIDDLE RATE  &#xA;MALAYSIA DEPOSIT 1 YEAR - MIDDLE RATE  &#xA;MALAYSIA KLIBOR ONE MONTH - OFFERED RATE  &#xA;MALAYSIA KLIBOR SIX MONTH - OFFERED RATE  &#xA;MALAYSIA KLIBOR ONE YEAR - OFFERED RATE  &#xA;MALAYSIA RRR - COMMERCIAL BANKS - MIDDLE RATE  &#xA;MALAYSIA RRR - MERCHANT BANKS - MIDDLE RATE  &#xA;SINGAPORE DBS BANK PRIME RATE - MIDDLE RATE  &#xA;SINGAPORE INTERBANK CALL - MIDDLE RATE  &#xA;SINGAPORE INTERBANK 1 WEEK - MIDDLE RATE  &#xA;SINGAPORE INTERBANK 1 MONTH - MIDDLE RATE  &#xA;SINGAPORE INTERBANK 6 MONTH - MIDDLE RATE  &#xA;SINGAPORE INTERBANK 1 YEAR - MIDDLE RATE  &#xA;SINGAPORE REPO O/N - MIDDLE RATE  &#xA;SINGAPORE REPO 1 WEEK - MIDDLE RATE  &#xA;SINGAPORE REPO 1 MONTH - MIDDLE RATE  &#xA;SINGAPORE REPO OVERNIGHT - MIDDLE RATE  &#xA;SINGAPORE INTERBANK 0/N (MAS) - MIDDLE RATE  &#xA;SINGAPORE INTERBAN 1 MONTH (MAS) - MIDDLE RATE  &#xA;SINGAPORE SIBOR US 1 WEEK (MAS) - OFFERED RATE  &#xA;SINGAPORE SIBOR US 1 MONTH (MAS) - OFFERED RATE  &#xA;SINGAPORE SIBOR US 6 MONTH (MAS) - OFFERED RATE  &#xA;SINGAPORE SIBOR US 1 YEAR (MAS) - OFFERED RATE  &#xA;KOREA OVERNIGHT CALL RATE (BROKERED) - MIDDLE RATE  &#xA;SEOUL INTERBANK 1 MONTH - OFFERED RATE  &#xA;SEOUL INTERBANK 1 WEEK - OFFERED RATE  &#xA;SEOUL INTERBANK 1 YEAR - OFFERED RATE  &#xA;SEOUL INTERBANK 6 MONTH - OFFERED RATE  &#xA;BANK OF KOREA BASE RATE - MIDDLE RATE  &#xA;KO AGG. CDT CEILING LOANS RATE - MIDDLE RATE  &#xA;KO LIQUIDITY ADJST. LOANS RATE - MIDDLE RATE  &#xA;KO CALL RATE O/N ALL TRADES - MIDDLE RATE  &#xA;KOREAN WON SPOT WEEK IMPLIED DEPOSIT - MIDDLE RATE  &#xA;KOREAN WON 1 MONTH IMPLIED DEPOSIT - MIDDLE RATE  &#xA;KOREAN WON 6 MONTH IMPLIED DEPOSIT - MIDDLE RATE  &#xA;KOREAN WON 1 YEAR IMPLIED DEPOSIT - MIDDLE RATE  &#xA;SPAIN INTERBANK OVERNIGHT - MIDDLE RATE  &#xA;SPAIN INTERBANK 1 WEEK - MIDDLE RATE  &#xA;SPAIN INTERBANK 1 MONTH - MIDDLE RATE  &#xA;SPAIN INTERBANK 6 MONTH - MIDDLE RATE  &#xA;SPAIN INTERBANK 12 MONTH - MIDDLE RATE  &#xA;SPAIN INTERBANK W/A OVERNIGHT - MIDDLE RATE  &#xA;SPAIN INTERBANK W/A 1 WEEK - MIDDLE RATE  &#xA;SPAIN INTERBANK W/A 1 MONTH - MIDDLE RATE  &#xA;SPAIN INTERBANK W/A 6M(DISC) - MIDDLE RATE  &#xA;SPAIN INTERBANK W/A 12M(DISC) - MIDDLE RATE  &#xA;BANGKOK INTERBANK 1 WEEK - OFFERED RATE  &#xA;BANGKOK INTERBANK 1 MONTH - OFFERED RATE  &#xA;BANGKOK INTERBANK 6 MONTH - OFFERED RATE  &#xA;BANGKOK INTERBANK 1 YEAR - OFFERED RATE  &#xA;THAILAND INTERBANK O/N (BT) - MIDDLE RATE  &#xA;THAILAND PRIME RETAIL (BOT) - MIDDLE RATE  &#xA;THAILAND LENDING (BOT) - MIDDLE RATE  &#xA;THAILAND PRIME OFFERED (BOT) - MIDDLE RATE  &#xA;THAILAND BILATERAL REPO RATE 1 DAY - MIDDLE RATE  &#xA;THAILAND BILATERAL REPO RATE 7 DAY - MIDDLE RATE  &#xA;THAILAND LOAN/ LIQUIDITY (BOT) - MIDDLE RATE  &#xA;UK REPO BENCHMARK ON (LDN:BBA) 'DEAD' - MIDDLE RATE  &#xA;UK REPO BENCHMARK 1W (LDN:BBA) 'DEAD' - MIDDLE RATE  &#xA;UK REPO BENCHMARK 1M (LDN:BBA) 'DEAD' - MIDDLE RATE  &#xA;UK REPO BENCHMARK 6M (LDN:BBA) 'DEAD' - MIDDLE RATE  &#xA;UK REPO BENCHMARK IY (LDN:BBA) 'DEAD' - MIDDLE RATE  &#xA;UK INTERBANK 11 AM FIXING(USD)1 MTH - OFFERED RATE  &#xA;UK INTERBANK 11 AM FIXING(USD)6 MTH - OFFERED RATE  &#xA;UK INTERBANK 11 AM FIXING(USD)1 YR - OFFERED RATE  &#xA;UK LOCAL AUTHORITY DEPS O/N - MIDDLE RATE  &#xA;UK LOCAL AUTHORITY DEPOSIT 7 DAY - MIDDLE RATE  &#xA;UK LOCAL AUTHORITY DEPOSIT 1 MONTH - MIDDLE RATE  &#xA;UK LOCAL AUTHORITY DEPOSIT 6 MONTH - MIDDLE RATE  &#xA;UK LOCAL AUTHORITY DEPOSIT 1 YEAR - MIDDLE RATE  &#xA;UK INTERBANK OVERNIGHT - MIDDLE RATE  &#xA;UK INTERBANK 7 DAY - MIDDLE RATE  &#xA;UK INTERBANK 1 MONTH - MIDDLE RATE  &#xA;UK INTERBANK 6 MONTH - MIDDLE RATE  &#xA;UK INTERBANK 1 YEAR - MIDDLE RATE  &#xA;US BANK PRIME LOAN - MIDDLE RATE  &#xA;US OVERNIGHT REPO GC - AM - MIDDLE RATE  &#xA;US OVERNIGHT REPO GC - PM - MIDDLE RATE  &#xA;US BID SIDE REPO 12:00 TERM 1 WK. - MIDDLE RATE  &#xA;US BID SIDE REPO 12:00 TERM 1 MTH - MIDDLE RATE  &#xA;INDICATED BID SIDE REPO GC RATE - MIDDLE RATE  &#xA;INDICATED BID SIDE REPO GC TBILL - MIDDLE RATE  &#xA;US OVERNIGHT REPO MM 10:00 GC RATE - MIDDLE RATE  &#xA;US OVERNIGHT REPO MM 10:00 GC TBILL - MIDDLE RATE  &#xA;US LIBOR CAPITAL. INDEX 1 MONTH - TOT RETURN IND  &#xA;US LIBOR CAPITAL. INDEX 6 MONTH - TOT RETURN IND  &#xA;US PRIME RATE CHARGED BY BANKS - MIDDLE RATE  &#xA;US STATE &amp;amp; LOCAL BOND MIDDLE RATE - MIDDLE RATE  &#xA;US CONVENTIONAL FIXED MORTGAGES - MIDDLE RATE  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6333" LastEditorUserId="6333" LastEditDate="2014-05-20T00:55:15.163" LastActivityDate="2014-05-20T00:55:15.163" Title="How to Analyze Interbank Lending Market?" Tags="&lt;interest-rates&gt;&lt;interbank-rates&gt;&lt;jargon&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9288" PostTypeId="2" ParentId="9253" CreationDate="2013-10-28T19:41:15.517" Score="8" Body="&lt;p&gt;The following is a standard exercise that will help you answer your own question. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a one-period binomial lattice for a stock with a constant risk-free rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Determine the initial cost of a portfolio that perfectly hedges a contingent claim with payoff $uX$ in the upstate and $dX$ in the downstate (you can do this so long as the up and down price are different in your lattice). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming there exists no portfolio that yields a profit without downside risk (assume no arbitrage) and that your economy is frictionless and competitive, show that any other price for the contingent claim, other than the initial cost of the replicating portfolio you found, would lead to the existence of a portfolio that yields a profit without downside risk. Pause and reflect on the fact that you have determined the price of any contingent claim without any mention of probability. However, don't forget what you assumed! What did you actually need to do what you just did? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now that you know that the price of the initial portfolio is the &quot;arbitrage free&quot; price of the contingent claim, find the number $q$ such that you can express that price of the contingent claim as the &lt;em&gt;discounted payoff&lt;/em&gt; in the up state times a number $q$ plus the discounted payoff in the downstate times the number $1-q$. Solve for the number $q$. &lt;em&gt;Interpret&lt;/em&gt; the number $q$ as a probability and compute the expected value of the discounted stock with this probability. This should be the same as the initial price of the stock. Pause and reflect on the fact that you have determined the unique number $q$ between $0$ and $1$ such that the expected value (using $q$) of the discounted stock is the initial price and that you can compute the price of any contingent claim by computing its expected  (using $q$) discounted payoff. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is clear from what you have just done that if you chose any other number $p$ between $0$ and $1$ other than the $q$ and computed the expected (using $p$) discount payoff, then you would not recover the arbitrage free price (remember you have shown that any other price than the one you found leads to an arbitrage portfolio). This means that if you had a real world probability $p$ for your initial lattice, it is not the correct probability to use when computing the price.  &lt;/p&gt;&#xA;" OwnerUserId="6384" LastEditorUserId="27883" LastEditDate="2017-09-24T05:51:25.190" LastActivityDate="2017-09-24T05:51:25.190" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9289" PostTypeId="2" ParentId="1725" CreationDate="2013-10-28T21:34:19.327" Score="1" Body="&lt;p&gt;Check out the following link with videos: I believe Richard Olsen organised the first high-frequency trading conference: &lt;a href=&quot;http://www.birs.ca/events/2013/5-day-workshops/13w5008/videos&quot; rel=&quot;nofollow&quot;&gt;http://www.birs.ca/events/2013/5-day-workshops/13w5008/videos&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6384" LastActivityDate="2013-10-28T21:34:19.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9291" PostTypeId="1" AcceptedAnswerId="9292" CreationDate="2013-10-29T02:21:26.777" Score="3" ViewCount="1590" Body="&lt;p&gt;Just want to confirm whether Delta, Gamma, Theta, Vega will be calculated in the following way? Since we own 100 shares of stock while selling a call we need to subtract greek value from one? right? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Covered Call Delta = 1 - &quot;Long Call delta&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Covered Call Gamma = 1 - &quot;Long Call gamma&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Covered Call Theta = 1 - &quot;Long Call theta&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Covered Call Vega = 1 - &quot;Long Call vega&quot;&lt;/p&gt;&#xA;" OwnerUserId="4707" LastActivityDate="2016-04-15T07:16:24.847" Title="Calculating Greeks in Covered Calls?" Tags="&lt;options&gt;&lt;option-strategies&gt;&lt;call&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9292" PostTypeId="2" ParentId="9291" CreationDate="2013-10-29T02:41:27.610" Score="3" Body="&lt;p&gt;You are right for delta but wrong for other greeks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Delta of stock is 1 so &lt;code&gt;Covered call Delta = 1 - &quot;long call delta&quot;&lt;/code&gt; is correct&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However a stock doesn't have  &lt;code&gt;gamma&lt;/code&gt; , &lt;code&gt;theta&lt;/code&gt; or &lt;code&gt;vega&lt;/code&gt;. So these greeks of your covered call positions will be just that of short call. i.e &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Covered Call Gamma =  - &quot;Long Call gamma&quot;&#xA;&#xA;Covered Call Theta =  - &quot;Long Call theta&quot;&#xA;&#xA;Covered Call Vega =  - &quot;Long Call vega&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4597" LastActivityDate="2013-10-29T02:41:27.610" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9294" PostTypeId="2" ParentId="9286" CreationDate="2013-10-29T16:24:33.727" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;e.g. does bangkok interbank rate 1 Yr represent all of Thailand instead of the non existant thailand interbank rate 1 Yr&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Bangkok Interbank Offered Rate, BIBOR, Bank of Thailand Offered Rate are all synonyms, so yes, you can think of BIBOR1Y as Thailand Interbank 1Y.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;e.g. does t/n equal with o/n&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;No.  T/N (tom/next) is a deal that starts tomorrow and matures the next business day thereafter (or sometimes 2 days thereafter).&#xA;O/N (overnight) is a deal that starts today and matures tomorrow (sometimes the day after tomorrow).&#xA;S/N (spot next) is a deal that starts when the spot would be delivered and matures the day after that (sometimes 2 days after that).&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;what is EU-FRANC and EU-MARK&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Not sure exactly.  I think it's EUR today but before 1999 it is Deutsche Mark (DEM).  Same for EU-FRANC, it's EUR today but before 1999 it's the French Franc (FRF).&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;middle rate vs offered rate&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The offered rate is the rate at which someone lends you money.  The bid rate is the rate for which someone else borrows money of you.  And the middle rate is just the average of the two.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&lt;br/&gt;&#xA;Difference between SHIBOR and CHIBOR:&lt;br/&gt;&#xA;CHIBOR is the older curve (instantiated in 1996), SHIBOR is 10 years younger.&#xA;While you can find lots of transparency in SHIBOR (e.g. &lt;a href=&quot;http://www.shibor.org/shibor/web/html/sszz_e.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;) getting the same kind of information on CHIBOR is quite a struggle, &lt;a href=&quot;http://www.bloomberg.com/apps/news?pid=newsarchive&amp;amp;sid=aVvx.VchiafU&quot; rel=&quot;nofollow&quot;&gt;this article&lt;/a&gt; even claims CHIBOR has no global acceptance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Seeing that both IBORs are highly correlated though, and seeing that CHIBOR has a longer history, &lt;em&gt;I&lt;/em&gt;'d go with CHIBOR to represent China (at least for a historical analysis).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a continuous analysis, I'd keep my eye on both, should they ever diverge inexplicably it's probably because CHIBOR rate determination changed; or if it's SHIBOR's fault there will hopefully be some documentation on their official website or the websites of the panel banks.&lt;/p&gt;&#xA;" OwnerUserId="1040" LastEditorUserId="1040" LastEditDate="2013-10-30T06:08:58.630" LastActivityDate="2013-10-30T06:08:58.630" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9296" PostTypeId="2" ParentId="2589" CreationDate="2013-10-29T21:47:52.080" Score="2" Body="&lt;p&gt;The equivalence you are trying to find can only exist in the framework of static volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the problem is that in the real world, statistical volatility varies a lot with time; and worse off the relative rate at which it varies increases with smaller time increments.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So not only does the answer not apply in real-world markets, an estimation of its fiat theoretical existence becomes exponentially less precise with smaller time increments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I think the Heston model supports this because the random component of change in variance of stock price is proportional to the square root of its current self, although its not immediately obvious this follows.)&lt;/p&gt;&#xA;" OwnerUserId="6391" LastActivityDate="2013-10-29T21:47:52.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9298" PostTypeId="1" CreationDate="2013-10-29T22:38:02.950" Score="5" ViewCount="1930" Body="&lt;p&gt;What are the most popular ways to compare volatility models?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose I wanted to compare the forecasting accuracy of a GARCH(1,1) model with the historic 30 day volatility.  What method should I use?&lt;/p&gt;&#xA;" OwnerUserId="6392" LastActivityDate="2013-10-31T14:32:46.473" Title="How to compare volatility models?" Tags="&lt;volatility&gt;&lt;garch&gt;" AnswerCount="2" CommentCount="7" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9299" PostTypeId="2" ParentId="9298" CreationDate="2013-10-30T02:46:36.490" Score="4" Body="&lt;p&gt;There is no one right answer to this question, but a common starting place is to compare the &lt;em&gt;bias&lt;/em&gt; and &lt;em&gt;variance&lt;/em&gt; of the forecast vs. the realized variance.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take your forecasted variance $\hat y$ and regress them against the realized variance:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$y = \beta_0 + \beta_1 \hat y + \epsilon$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few things that you want to see:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The forecast should be unbiased, meaning that $\beta_1 \approx 0$.  If this is not the case, then you will consistently over or under-realize your prediction.&lt;/li&gt;&#xA;&lt;li&gt;The error should not have any clear structure.  So $\epsilon \mapsto N(0, \sigma)$; plot the residuals and look at them.&lt;/li&gt;&#xA;&lt;li&gt;You can view the &lt;em&gt;goodness-of-fit&lt;/em&gt; of your model by looking at things like the $R^2$ and the RMSE.&lt;/li&gt;&#xA;&lt;li&gt;Normalizing your returns by your forecast should result in a normal distribution: you can review this by using a qqplot.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Make sure that you evaluate your model on the time horizon that is relevant to you.  For instance, if you're rebalancing monthly, then it won't be especially important to predict the next day's volatility as much as if would if you were rebalancing daily.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As with any forecast, make sure that you have a sufficient sample size for significance, and use out-of-sample data to evaluate any parameters that you might fit if you use a structural model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some useful references:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Hansen and Lunde (2001) &lt;a href=&quot;http://www.rady.ucsd.edu/faculty/directory/valkanov/pub/classes/mfe/docs/HansenLunde_Garch.pdf&quot; rel=&quot;nofollow&quot;&gt;&quot;A comparison of volatility models: Does anything beat a GARCH(1,1)?&quot;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Hansen, Lunde, and Nason (2003) &lt;a href=&quot;http://mit.econ.au.dk/vip_htm/alunde/ACADEMIC/RESEARCH/PAPERS/MCSvola.pdf&quot; rel=&quot;nofollow&quot;&gt;&quot;Choosing the Best Volatility Models: The Model Conﬁdence Set Approach&quot;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="17" LastEditorUserId="17" LastEditDate="2013-10-30T03:14:19.430" LastActivityDate="2013-10-30T03:14:19.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9300" PostTypeId="2" ParentId="8345" CreationDate="2013-10-30T05:35:17.377" Score="7" Body="&lt;p&gt;Because the day count of your inquired date is 366 days:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Hkd daycount is act/365 therefore 366/365&lt;/li&gt;&#xA;&lt;li&gt;Usd daycount is act/360 therefore 366/360&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{7.7487}{7.7587} = \frac{1+r_2(\frac{366}{365})}{1+0.00965×\frac{366}{360}}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solving for $r_2 = 0.8486$.&lt;/p&gt;&#xA;" OwnerUserId="6395" LastEditorUserId="35" LastEditDate="2013-10-31T17:53:43.067" LastActivityDate="2013-10-31T17:53:43.067" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9301" PostTypeId="1" AcceptedAnswerId="9306" CreationDate="2013-10-30T10:51:52.333" Score="4" ViewCount="835" Body="&lt;p&gt;I have a network dump of market data in the FIX/FAST format (transported over UDP). Are there standard pieces of software (similar to Wireshark) that will parse and allow for inspection of the key-value pairs of the payload?&lt;/p&gt;&#xA;" OwnerUserId="3098" LastActivityDate="2013-10-30T15:23:40.397" Title="FIX/FAST packet analyzer" Tags="&lt;data&gt;&lt;market-microstructure&gt;&lt;tick-data&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9302" PostTypeId="1" AcceptedAnswerId="9307" CreationDate="2013-10-30T10:54:26.013" Score="1" ViewCount="2884" Body="&lt;p&gt;I have 3 states with two assets, stocks and bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The bond has a payoff of &lt;code&gt;1&lt;/code&gt; in every state of the world.&#xA;And the stock has a current price of $S_0 = 100$ and payoffs of $S_1(w_1)=80$, $S_1(w_3)=100$ and $S_1(w_3)=120$..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to compute the state price vectors:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that the state price vectors can be computed using $\sum_{k=1}^K \psi (D\theta)_k&amp;gt;0$ or just $W=D\times \theta $ where D is the payoff matrix, $\theta$ is the replication portfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also know that D is just the matrix of the payoffs therefore: $$\begin{pmatrix}&#xA;  1 &amp;amp; 80 \\&#xA;  1 &amp;amp; 100 \\&#xA;  1 &amp;amp; 120&#xA; \end{pmatrix} \times \begin{pmatrix}&#xA;  \psi_1 \\&#xA;  \psi_2&#xA; \end{pmatrix}$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, i do not know which W to chose?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There I appreciate your answers!&lt;/p&gt;&#xA;" OwnerUserId="5414" LastActivityDate="2013-10-30T19:34:53.370" Title="Determine state price vectors?" Tags="&lt;mathematics&gt;&lt;replication&gt;&lt;price&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9303" PostTypeId="2" ParentId="9301" CreationDate="2013-10-30T12:07:22.030" Score="2" Body="&lt;p&gt;Try the &lt;a href=&quot;http://www.b2bits.com/performance_lab/fast_antenna_codec/fast_codec_windows.html&quot; rel=&quot;nofollow&quot;&gt;FAST Antenna Codec for Windows&lt;/a&gt;.  You need a little wrapper app that reads the UDP data from your dump and feeds the payload (i.e. sans IP/UDP headers) to the codec.&lt;/p&gt;&#xA;" OwnerUserId="1040" LastActivityDate="2013-10-30T12:07:22.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9304" PostTypeId="1" CreationDate="2013-10-30T14:24:29.663" Score="4" ViewCount="294" Body="&lt;p&gt;I am looking for some references on quantifying the dependence between credit rating and bond yield. I have some data (found some Bloomberg indices which give average yield based on credit rating), but it is dense in some regions and sparse or non-existent in others.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to model this somehow, especially in low-B rating area... Could you please recommend me some references and/or some ideas?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt; Related Question on &lt;a href=&quot;https://quant.stackexchange.com/q/14911/3029&quot;&gt;interpolating probabilities of default&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3029" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2014-10-01T00:01:12.733" Title="Credit Rating vs Bond Yield" Tags="&lt;modeling&gt;&lt;credit-ratings&gt;&lt;yield&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9305" PostTypeId="2" ParentId="9298" CreationDate="2013-10-30T14:42:13.443" Score="-1" Body="&lt;p&gt;A model is one which has the ability to make predictions. So use the models you have to make predictions about volatility. The one which can predict the best has to be the best (don't think you have a choice in that). If the predictability is comparable, then use any one. If you cannot test which one is the predicting the best, then go back and study what is volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the edit after the first comment. For all volatility modelers, please read this paper first &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=970480&quot; rel=&quot;nofollow&quot;&gt;We Don't Quite Know What We are Talking About When We Talk About Volatility&lt;/a&gt;. Next it is important to understand that the process of volatility modeling is highly dependent on the context in which the volatility is going to be used in. There is no universal right answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, what do you believe in, price volatility or returns volatility and both have their space in financial research. next what time frame are you looking at, is it high frequency data ? or just intraday ? or end of day data. furthermore what do you want to predict using the model, because volatility itself is an invisible variable and hence you have to define some aspect of the market which you want to predict using your volatility model. So it could be to model the risk you face in the next period, or the prediction of the option price or simply the range of the market in the next period and believe me each of this is different. So using the model you would want to predict the measurable aspect of the market and then decide if the volatility model suits you or not. finally you have to understand if the model explains features of a volatility process the best, like regimes in volatility and spillovers to other instruments and the like. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is not a question answered so easily. Keep working.&lt;/p&gt;&#xA;" OwnerUserId="6289" LastEditorUserId="6289" LastEditDate="2013-10-31T14:32:46.473" LastActivityDate="2013-10-31T14:32:46.473" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9306" PostTypeId="2" ParentId="9301" CreationDate="2013-10-30T15:23:40.397" Score="2" Body="&lt;p&gt;I am using a native C++ implementation based on &lt;a href=&quot;https://code.google.com/p/quickfast/&quot; rel=&quot;nofollow&quot;&gt;QuickFAST&lt;/a&gt;, you can use the sample FileToMulticast to implement what you need. But if you are looking for a way do decode UMDF ( BM&amp;amp;FBOVESPA FIX/FAST) you must first take care with the UDP packages itself and re assembly the messages, before the decodification&lt;/p&gt;&#xA;" OwnerUserId="1360" LastActivityDate="2013-10-30T15:23:40.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9307" PostTypeId="2" ParentId="9302" CreationDate="2013-10-30T19:34:53.370" Score="2" Body="&lt;p&gt;The state price vector are the prices of securities which pay \$1 if and only if that state of the world occurs. This is just a question of being able to replicate the payoffs&#xA;$$&#xA;\begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix},&#xA;\begin{pmatrix} 0 \\ 1 \\ 0 \end{pmatrix},&#xA;\begin{pmatrix} 0 \\ 0 \\ 1 \end{pmatrix}&#xA;$$&#xA;with payoff vectors $\vec{b} = [1,1,1]^T$ and $\vec{s} = [80, 100, 120]^T$. This is just a matter of Gaussian Elimination.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is, however, that no such solution exists. That means it is not possible to determine state prices in such a scenario.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The high-level problem is, you need as many (independent) instruments as the states of the world, and you have 2 instruments for 3 states.&lt;/p&gt;&#xA;" OwnerUserId="3029" LastActivityDate="2013-10-30T19:34:53.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9308" PostTypeId="2" ParentId="8560" CreationDate="2013-10-30T20:11:26.930" Score="2" Body="&lt;p&gt;I agree that usual presentation of the replicating portfolio argument is deficient.  I think this may actually go back to Merton's 1973 paper on Black-Scholes, because his presentation is unclear in the same way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact the choice to buy $\partial V\over \partial S$ shares of the stock is &lt;em&gt;forced&lt;/em&gt; by the use of a self-financing portfolio.  I think the argument should go like the following.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Define a portfolio &#xA;$$\Pi = V- {\partial V\over \partial S} S + \psi P$$&#xA;where $P$ is price of a \$1 bond with the same maturity date as the option, and $\psi$ is some function of $t$ and $S$ such that $\Pi=0$ initially.  We assume a Mertonian demon continuously shuffles funds back and forth between the stock and bond investments so as to always have exactly $\partial V\over \partial S$ shares of the stock.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since this portfolio is self-financing by construction, the change in its value is due only to capital gains, i.e.&#xA;$$&#xA;{\mathrm d}\Pi = dV - {\partial V\over \partial S} {\mathrm d}S + \psi {\mathrm d}P.&#xA;$$&#xA;The only stochastic terms are in ${\mathrm d}V$ and ${\partial V\over \partial S} {\mathrm d}S $ and they cancel exactly, so ${\mathrm d}\Pi$ is deterministic.  Then, appealing to lack of arbitrage opportunities, $\Pi$ must grow at the safe prevailing interest rate.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But therefore, since initially $\Pi=0$, it must in fact always be zero.  Hence &#xA;$$&#xA;V={\partial V\over \partial S} S - \psi P&#xA;$$&#xA;is a self-financing replicating portfolio of $V$.&lt;/p&gt;&#xA;" OwnerUserId="6362" LastActivityDate="2013-10-30T20:11:26.930" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9309" PostTypeId="1" AcceptedAnswerId="9449" CreationDate="2013-10-31T00:25:39.367" Score="2" ViewCount="3594" Body="&lt;p&gt;Calculating sharpe ratio for shares is a straight forward task: (average returns - risk free ) / standard deviation. However i remain baffled as to how to tackle the task for options, can someone please advise regarding this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;consider the following example to obtain returns for American options:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;step 1) &#xA;- shares of xyz cost £21 each&#xA;- 100 call option contracts (10 shares each) cost £2000&#xA;- expiration date 11-11-2013&#xA;- strike price £25&#xA;- price of shares goes up to £30 and trader decides to execute option&#xA;&#xA;&#xA;* total cost: (25 * 1000) + 2000 = £27,000&#xA;* returns: 30,000 - 27,000 = £3,000&#xA;&#xA;step 2)&#xA;the confusion arises when you factor in that there are no previous returns. Conversely with shares such as aapl i can calculate weekly returns and easily calculate the average returns and standard deviation from these, for example if the following were aapl weekly returns: &#xA;week 1 : 500&#xA;week 2 : 480&#xA;week 3 : 550&#xA;week 4 : 600&#xA;week 5 : 650&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the average returns would be : 556 and standard deviation would be 70.21. How can i do the same with options? Would i need to go through a similar procedure of going back a date and doing step 1 again?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="3532" LastEditorUserId="3532" LastEditDate="2013-10-31T16:52:00.093" LastActivityDate="2013-11-14T19:30:20.683" Title="compute sharpe ratio for options?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;returns&gt;&lt;sharpe-ratio&gt;&lt;standard-deviation&gt;" AnswerCount="4" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="9310" PostTypeId="2" ParentId="9168" CreationDate="2013-10-31T00:37:58.547" Score="9" Body="&lt;p&gt;I recommend reading Cao, Hansch, and Wang (2004) &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=565324&quot; rel=&quot;noreferrer&quot;&gt;&quot;The Informational Content of an Open Limit Order Book&quot;&lt;/a&gt;.  They present a simple model for an order-book price called the weighted price ($\mbox{WP}$):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\mbox{WP}^{n_1 - n_2} = \frac{\sum_{j=n_1}^{n_2} (Q_j^d P_j^d + Q_j^s P_j^s)}{(Q_j^d + Q_j^s)}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$n$ is the order book level&lt;/li&gt;&#xA;&lt;li&gt;$Q_j$ is the size at level $j$&lt;/li&gt;&#xA;&lt;li&gt;$P_j$ is the price at level $j$&lt;/li&gt;&#xA;&lt;li&gt;$d$ is the &quot;demand&quot; side and $s$ is the &quot;supply&quot; side&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="17" LastEditorUserId="35" LastEditDate="2013-10-31T13:30:52.290" LastActivityDate="2013-10-31T13:30:52.290" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9313" PostTypeId="1" AcceptedAnswerId="9317" CreationDate="2013-10-31T03:22:12.417" Score="40" ViewCount="9551" Body="&lt;p&gt;I come from a different field (Machine learning/AI/data science), but aim to ask a philosophical question with the utmost respect:&#xA;Why do quantitative financial analysts (analysts/traders/etc.) prefer (or at least seem) traditional statistical methods (traditional = frequentist/regression/normal correlation methods/ts analysis) over newer AI/machine learning methods? I've read a million models, but it seems biased?&#xA;Background: I recently joined a 1B AUM (I know it's not a ton) asset management firm. I was asked to build a new model for a sector rotation strategy (basically predicting which SP 500 sector would do the best over 6 months-- chose to use forward rolling 6 month returns) they employ and my first inclination was to combine ARIMA (traditional) with random forest (feature selection) and a categorical (based on normal distribution standard deviation) gradient boosted classifier for ETFs in each sector. Not to be rude, but I beat the ValuLine timeliness for each sector. I used the above mentioned returns as my indicator and pretty much threw everthing at the wall for predictors initially (basically just combing FRED), then used randomForest to select features. I ended up combining EMA and percent change to create a pretty solid model that, like I said, beat ValuLine. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've read a lot of literature, and I  haven't seen anyone do anything like this. Any help in terms of pointing me in the right direction for literature? Or any answers to the overarching idea of why isn't there more machine learning in equity markets (forgetting social/news analysis)?&#xA;EDIT: For clarification, I'm really interested in long-term predictions (I think Shiller was right) based on macro predictors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks &lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS- I've been lurking for a while. Thanks for all the awesome questions, answers, and discussions.&lt;/p&gt;&#xA;" OwnerUserId="6399" LastActivityDate="2019-02-23T20:47:16.867" Title="Machine Learning vs Regression and/or Why still use the latter?" Tags="&lt;equities&gt;&lt;regression&gt;&lt;machine-learning&gt;" AnswerCount="6" CommentCount="13" FavoriteCount="64" ContentLicense="CC BY-SA 3.0" />
  <row Id="9314" PostTypeId="2" ParentId="9309" CreationDate="2013-10-31T09:08:22.773" Score="0" Body="&lt;p&gt;I guess it makes more general approach and calculate the Sharpe ratio on the portfolio level. Of course, if you want you could take a portfolio with only one option to get your answer. I don't think that really makes sense because of the dependence of the returns of different assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this general approach calculation is easy, for the ex post Sharpe ratio we have:&#xA;$$\frac{R_p - R_f}{\sigma_p}$$&#xA;where the subscript $p$ siginifies portfolio as you wrote yourself. If you want to do it ex ante just put a hat on $R_p$ and $\sigma_p$.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2013-10-31T09:08:22.773" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9315" PostTypeId="2" ParentId="9313" CreationDate="2013-10-31T10:45:00.653" Score="4" Body="&lt;p&gt;I was going to comment but it turned out to be quite elaborate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My experience with certain AI/ML methods is that they're not deterministic.  Take RBM for instance, a very wide-spread paradigm.  To train such a machine you have two approaches, backpropagation or Kullback-Leibler divergence.  Both require you to initialise the machine to a random state.  And that makes them non-deterministic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even more problematic for instance are methods like Simulated Annealing or Genetic Programming to find maxima or minima in a landscape where every single step contains a non-deterministic component.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general there's nothing wrong with a hint of non-determinism, especially in our racket where nearly everything is a stochastic process.  It just becomes a problem when you need a reproducible result, for instance when comparing a live session with some backtest.  It's just very hard to decompose tracking errors (e.g. divergence between paper session and live session) into systemic errors and the divergence of, say, the random generators (or more general the sources of non-determinism).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&lt;br/&gt;&#xA;Conversely, if you try to turn a non-deterministic algorithm into a deterministic one by using a fixed (or deterministic) sequence of ``non-determinism'' the algorithm will collapse to a variant that's probably less efficient than a good deterministic one (e.g. deterministic SA vs. greedy search); of course I can't prove that here but if I had to I'd show that the probability to pick a sequence of randomness out of all possible sequences of randomness that reflects exactly the invariants before or after each step of a greedy round is abyssmally small.&lt;/p&gt;&#xA;" OwnerUserId="1040" LastEditorUserId="1040" LastEditDate="2013-10-31T11:11:24.000" LastActivityDate="2013-10-31T11:11:24.000" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9316" PostTypeId="2" ParentId="9309" CreationDate="2013-10-31T10:56:42.877" Score="0" Body="&lt;p&gt;Now, I think in practice most people just take the realized returns and the formula and plug them in and thats that. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A more sophisticated way would be to model the distribution of stock prices and the volatility surface simultaneously and then transform the distribution via the Black Scholes formula (European options) to get the P&amp;amp;L.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, divide by the price to get the distribution of returns, calculate mean and standard deviation and plug this into the sharpe ratio formula. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This method is a LOT more complicated so the question is &quot;is it worth it?&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you already have a risk model that gives you the P&amp;amp;L distribution of the option, you should just use it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem with historical option returns is, that they are not even close to being iid ...&lt;/p&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2013-10-31T10:56:42.877" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9317" PostTypeId="2" ParentId="9313" CreationDate="2013-10-31T11:04:01.453" Score="47" Body="&lt;p&gt;Because of:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The (extreme) dominance of noise over signal&lt;/li&gt;&#xA;&lt;li&gt;The prevalence of non-repeating patterns (many of which we know are not going to repeat)&lt;/li&gt;&#xA;&lt;li&gt;A pathetic sample size for cross-validation &lt;/li&gt;&#xA;&lt;li&gt;Regime changes due to exogenous events. These are typically in the cross-val window which makes it even worse. (GFC, financial integration, trade law changes, interest rate adjustments by central banks, some idiot in a bank was hiding trades and loses 5 billions dollars, etc).&lt;/li&gt;&#xA;&lt;li&gt;It is well known that non-linear relationships are generally just artefacts of the in sample dataset&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;There is also the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Much price changes are driven by news such as a plane crashing or a merger announcement. Are you trying to forecast &lt;em&gt;news&lt;/em&gt; (!?) by getting your model to learn non-linear relationships on price data? It should be clear that, if American Airlines price falls due to a terrorist hijacking, it is not going to be useful to have a random forest learn any patterns that result since it will not repeat. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Because of these factors many (econometricians and practicioners) will try to use a priori knowledge to select features and impose constraints on the model in an attempt to improve generalization. This is perceived as necessary by econometricians since the data is too thin, noisy and nonstationary (i.e., the above reasons).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is not to say that &quot;machine learning&quot; methods such as Lasso, NNG, Elastic Nets or Ridge can't be applied. They result in essentially linear models and you can impose whatever a priori constraints on it through the metaparameters in the loss function or by using a variant that preserves hierarchies when using &#xA;indicator function interactions (Tibshirani 2013...). Edit: You will still need to select which features go into the algorithm (as a prior imposition) but you can use these to achieve slightly more sparsity than you would otherwise have and introduce some bias into your conditional expectation (or state probability if you're doing multinomial categorical GLM) for improvement in variance of sampling distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am however open to random forests with the right a priori constraints in place.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are indeed hundreds of papers that use machine learning to forecast financial markets. Just google something silly like &quot;fuzzy bayesian expert adaptive learners with PSO training S&amp;amp;P 500&quot; and you will get a lesson in the file-drawer effect, publication bias and substandard research methodologies (e.g. selecting 3 of 50 algorithms and 2 of 50 indices  and hoping it convinces people).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the above is an optimist's view of the industry. From those I've spoken to at low frequency funds they are simply ignorant of machine learning and couldn't apply it because they lack the knowledge and skills. If they were actually interested in being true quants, who knows how much damage they could do with deep learning or something. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to do real machine learning in finance and actually do something that is meritocratic/skill/scientific instead of almost completely random and full of people who practice nonsense, go to a HFT firm (not that most people practice non-sense in low frequency funds, just that many do and this is something that is absolutely impossible to get away with in HFT). That said, I am continually and consistently underwhelmed when I hear of the research methods of low frequency quant funds.&lt;/p&gt;&#xA;" OwnerUserId="6081" LastEditorUserId="6081" LastEditDate="2013-11-02T17:40:23.343" LastActivityDate="2013-11-02T17:40:23.343" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="9318" PostTypeId="1" AcceptedAnswerId="9319" CreationDate="2013-10-31T11:31:53.400" Score="1" ViewCount="351" Body="&lt;p&gt;What is the difference between the following two Brazilian futures contracts:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The &lt;a href=&quot;http://www.bmf.com.br/bmfbovespa/pages/contratos2/pdf/IbovespaFutures.pdf&quot; rel=&quot;nofollow&quot;&gt;Ibovespa Futures Contract&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;The &lt;a href=&quot;http://www.bmf.com.br/bmfbovespa/pages/contratos2/pdf/IND_futures_mini.pdf&quot; rel=&quot;nofollow&quot;&gt;Mini Ibovespa Futures Contract&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;As far as I can tell, both are priced in Brazilian Real (R$) following the Bovespa Index exactly. I would have guessed the &lt;em&gt;mini&lt;/em&gt; contract to be cheaper than the &lt;em&gt;full&lt;/em&gt; contract, or at least different in some way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How are the Ibovespa and Mini Ibovespa futures contracts different?&lt;/p&gt;&#xA;" OwnerUserId="3098" LastEditorUserId="2908" LastEditDate="2013-10-31T11:53:41.447" LastActivityDate="2013-10-31T11:56:25.557" Title="Difference between Ibovespa full and mini futures contract" Tags="&lt;futures&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9319" PostTypeId="2" ParentId="9318" CreationDate="2013-10-31T11:41:08.300" Score="2" Body="&lt;p&gt;Futures have a value per point. According to this page, the contract point value is 1 for the normal contract and 0.2 for the smaller one (Mini):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.terrafuturos.com.br/valor-dos-pontos-por-contrato_eng.php&quot; rel=&quot;nofollow&quot;&gt;http://www.terrafuturos.com.br/valor-dos-pontos-por-contrato_eng.php&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically you should have the same PL if you were using 5 minis or 1 normal contract, assuming that the price of the two futures is always equal (which I do not know if it is the case).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your documentation says that your PL is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\mathrm{\Delta{Points}} \cdot \mathrm{ValuePerPoint}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathrm{ValuePerPoint}$ is 1 for the large contract and 0.2 for the other.&lt;/p&gt;&#xA;" OwnerUserId="2908" LastEditorUserId="2908" LastEditDate="2013-10-31T11:56:25.557" LastActivityDate="2013-10-31T11:56:25.557" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9320" PostTypeId="2" ParentId="9270" CreationDate="2013-10-31T17:44:08.653" Score="1" Body="&lt;p&gt;If you look at the Black-Scholes demonstration using self-financing portfolio, it uses the assumption of continuous hedging.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because you continuously hedge and the function is differentiable, it contains the gamma as the delta is hedged continuously. (I think)&lt;/p&gt;&#xA;" OwnerUserId="2908" LastActivityDate="2013-10-31T17:44:08.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9321" PostTypeId="1" AcceptedAnswerId="9323" CreationDate="2013-10-31T19:37:37.370" Score="1" ViewCount="1947" Body="&lt;p&gt;What is the relationship between E-mini SPX futures and the SPX index. Besides the obvious, one is cash the other is a futures product. How does buying/selling in one product influence the other. If someone sells 1000 contracts of E-mini futures how does that affect the S&amp;amp;P500 Index?? The trade he made should only affect the futures market.  The seller isn’t technically selling shares in each individual stock within the SP500, so how does the cash market adjust to the sell order within the futures market??  &lt;/p&gt;&#xA;" OwnerUserId="4729" LastEditorUserId="1355" LastEditDate="2013-10-31T20:18:44.610" LastActivityDate="2013-11-01T10:24:48.177" Title="Relationship in Order Book between S&amp;P500 and S&amp;P500 Futures Contracts" Tags="&lt;spx&gt;" AnswerCount="1" CommentCount="5" ClosedDate="2013-10-31T21:59:25.470" ContentLicense="CC BY-SA 3.0" />
  <row Id="9323" PostTypeId="2" ParentId="9321" CreationDate="2013-10-31T21:27:23.490" Score="1" Body="&lt;p&gt;In general futures are contract which are marked to market everyday and are settled against the cash/underlying price at a future delivery date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the SPX, I think there are only deliveries in Mar, Jun, Sep and Dec. In theory, one can calculate the implied future price using the short rates and the spot price. One thing to note is that there is a convexity between forwards and futures as the future margin calls are done on a daily basis, while the forward does not exchange cash until delivery. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So basically, even though one does mot know what will be the price at delivery date, you can imply a non arbitrage price from the spot and short rates. This is what forces the spot and future to move somewhat in the same direction. Like with any product which can be replicated, if the price deviates by more than the bid-ask + slippage from the theoretical price, one will try to arbitrage the difference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I bumped into this interesting &lt;a href=&quot;http://kiddynamitesworld.com/so-you-want-to-understand-sp-futures-basis-trades-aka-index-arb/&quot; rel=&quot;nofollow&quot;&gt;link&lt;/a&gt; which mentions the dividends adjustment.&lt;/p&gt;&#xA;" OwnerUserId="2908" LastEditorUserId="2908" LastEditDate="2013-11-01T10:24:48.177" LastActivityDate="2013-11-01T10:24:48.177" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9324" PostTypeId="2" ParentId="9241" CreationDate="2013-10-31T21:59:30.447" Score="8" Body="&lt;p&gt;Aleš Černý  has very simple examples in his book. Alternatively, this paper seems to recap part of the chapter on Fourier series:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=559416&quot;&gt;Introduction to Fast Fourier Transform in Finance&lt;/a&gt; - Aleš Černý &lt;/p&gt;&#xA;" OwnerUserId="2908" LastEditorUserId="2908" LastEditDate="2013-11-01T13:36:16.463" LastActivityDate="2013-11-01T13:36:16.463" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9325" PostTypeId="2" ParentId="9055" CreationDate="2013-11-01T01:03:36.973" Score="4" Body="&lt;p&gt;In addition to the presented answers, I just wanted to mention that such a situation is described in Hull, page 419 (Chapter 19 Volatility Smiles, 19.8: &quot;When a single large jump is anticipated&quot;). This happens when probability distribution of returns is binomial. It can occur in a situation when market is expecting some announcement which will either significantly lift the asset price or drop it. &lt;/p&gt;&#xA;" OwnerUserId="5086" LastActivityDate="2013-11-01T01:03:36.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9327" PostTypeId="2" ParentId="8099" CreationDate="2013-11-01T03:45:14.150" Score="1" Body="&lt;p&gt;Edit: this no longer works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following is a list of every CIK at the SEC:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.sec.gov/edgar/NYU/cik.coleft.c&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.sec.gov/edgar/NYU/cik.coleft.c&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6411" LastEditorUserId="38104" LastEditDate="2018-12-29T03:54:53.983" LastActivityDate="2018-12-29T03:54:53.983" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="9328" PostTypeId="2" ParentId="9257" CreationDate="2013-11-01T06:21:48.080" Score="2" Body="&lt;p&gt;There are numerous examples of &quot;market making&quot; outside of finance a layman might relate better to. A &quot;market&quot; is simply a place that stands ready to make a buy/sell transaction on a product. In real life they are usually just called &quot;dealers&quot; and you often encounter them when you are visit a used car dealer, concert tickets scalpers or pawn shops. The price they quote to pay for an item is the &quot;bid&quot;, and the price quote to sell an item is the &quot;ask&quot;. Market maker by creating a &quot;market&quot; makes it for easier for customers to transact, and they also create price discovery by balancing out buys and sell orders. For this service they are compensated by the bid-ask spread. The main risk market makers take is holding inventory that may lose value.&lt;/p&gt;&#xA;" OwnerUserId="6412" LastActivityDate="2013-11-01T06:21:48.080" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9329" PostTypeId="5" CreationDate="2013-11-01T13:31:11.547" Score="0" Body="&lt;p&gt;Pairs trading is a market-neutral trading strategy enabling traders to profit from virtually any market conditions: uptrend, downtrend, or sideways movement. This strategy is categorized as a statistical arbitrage and convergence trading strategy.&lt;/p&gt;&#xA;" OwnerUserId="2908" LastEditorUserId="35" LastEditDate="2013-11-01T14:03:57.817" LastActivityDate="2013-11-01T14:03:57.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9330" PostTypeId="4" CreationDate="2013-11-01T13:31:11.547" Score="0" Body="Pairs trading is a market-neutral trading strategy enabling traders to profit from virtually any market conditions: uptrend, downtrend, or sideways movement. This strategy is categorized as a statistical arbitrage and convergence trading strategy." OwnerUserId="2908" LastEditorUserId="35" LastEditDate="2013-11-01T14:03:21.597" LastActivityDate="2013-11-01T14:03:21.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9331" PostTypeId="5" CreationDate="2013-11-01T13:34:57.237" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2013-11-01T13:34:57.237" LastActivityDate="2013-11-01T13:34:57.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9332" PostTypeId="4" CreationDate="2013-11-01T13:34:57.237" Score="0" Body="A collective investment constituted under a trust deed." OwnerUserId="2908" LastEditorUserId="2908" LastEditDate="2013-11-01T14:02:00.607" LastActivityDate="2013-11-01T14:02:00.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9333" PostTypeId="1" CreationDate="2013-11-01T14:29:04.277" Score="5" ViewCount="132" Body="&lt;p&gt;I am seeking a recommendation for an empirical paper on increased correlations of returns during the 2008 financial crisis, or  'tail correlation' during the crisis, if that is different, or whatever notions people use to describe all your stocks moving the same way when you least want them to.&lt;/p&gt;&#xA;" OwnerUserId="3539" LastEditorUserId="848" LastEditDate="2013-11-01T15:51:37.983" LastActivityDate="2013-11-01T15:51:37.983" Title="tail correlation during crisis" Tags="&lt;portfolio-management&gt;&lt;correlation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9334" PostTypeId="2" ParentId="9333" CreationDate="2013-11-01T15:51:01.260" Score="1" Body="&lt;p&gt;Maybe this question is a bit to broad but a starting point might be &lt;a href=&quot;http://www.ifa.com/pdf/Does%20Portfolio%20Theory%20Work%20HMM%20mbedits%205-19-09.pdf&quot; rel=&quot;nofollow&quot;&gt;Does Portfolio Theory Work During Financial Crises?&lt;/a&gt; by Markowitz.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2013-11-01T15:51:01.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9336" PostTypeId="1" AcceptedAnswerId="9358" CreationDate="2013-11-01T21:26:14.740" Score="4" ViewCount="5766" Body="&lt;p&gt;If a trade (lets say for example a 'simple' interest rate swap) is using IMM rolls (so the interest calculation periods start and end on IMM Wed dates), are there particular/special business day conventions that are (can) be used for rolling period start/end date, fixing date &amp;amp; settlement date - or is it just the 'usual' set of business day conventions i.e. following, modified following etc?&lt;/p&gt;&#xA;" OwnerUserId="6416" LastEditorUserId="35" LastEditDate="2013-11-02T02:47:32.490" LastActivityDate="2013-11-04T17:55:46.377" Title="IMM rolls: Are there special business day conventions?" Tags="&lt;roll-adjustment&gt;&lt;convention&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9337" PostTypeId="1" AcceptedAnswerId="9364" CreationDate="2013-11-01T22:35:07.233" Score="1" ViewCount="469" Body="&lt;p&gt;&lt;em&gt;The annual interest rate is 5.3% and the annualized volatility of a non-dividend paying stock over the next six months will be 12.5% (annualized). i) Construct binomial trees of 5, 10 and 30 periods to calculate the value of a European-style 6-month call option with strike price 8.3% above today's spot price. ii)Calculate the corresponding Deltas in the three cases.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well for the above problem, I stuck at how to construct the binomial tree model. For reference my knowledge of binomial tree model for stock option is the first 4 chapter of Shreve- Stochastic Calculus for finance.In his book, whenever he wants to construct a binomial model, he always have a up (u) factor, and down (d) factor for stock price, thus you can have the model pretty easily. In this problem, I am given the volatility, thus I have no idea how to start. Please help .&lt;/p&gt;&#xA;" OwnerUserId="6417" LastActivityDate="2013-11-05T17:34:22.570" Title="How to construct the binomial model for European option?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;binomial-tree&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9338" PostTypeId="1" CreationDate="2013-11-02T03:12:13.563" Score="1" ViewCount="151" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;A bank gives a loan $L$ for $m$ months and the monthly interest rate is $i$.&lt;br&gt;&#xA;  The bank requires monthly installments - which I calculate is $I = \frac{L}{m} + Li$. &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;I use this loan to buy stocks. If the stock price is $p(m = 0)$, then I can buy $\frac{L}{p(m = 0)}$ shares. I plan to pay the $m$ monthly installments only by selling the optimal number of stocks every $x$ months.  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How can I calculate if this plan will pay off? How do I optimize $x$? What variables should I be looking at? Can profit be made from this example? How much does the stock price have to rise to break even? I match abbreviations with their referents. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I just accept the loan of $L$ and do nothing with it except return it in $m$ installments, then my loss is only the total interest $=m \times Li$. So to break even, $m \times Li$ is what I need to gain from my stocks.  But this feels too simple and naive? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, the rate of return over the entire period = total interest/loan amount $= \frac{mi}{L}$? This feels wrong because it doesn't account for the fact that stocks will be sold every $x$ months to cover the $m$ monthly installments? I think $x\frac{ I}{p(m)}$ shares must be sold to cover $x$ monthly installments? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm already getting lost so maybe some numbers will help - suppose&lt;br&gt;&#xA;☻ $L = 10,000$ USD,&lt;br&gt;&#xA;☻ $m = 24$,&lt;br&gt;&#xA;☻ $i = 0.25\%$&lt;br&gt;&#xA;☻ $p(m = 0) = 80$,&lt;br&gt;&#xA;☻ The stock price is expected to go up to $100$ within the 24 months. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm new to financial math and only know first-year undergrad math. Sorry for any faults.&lt;/p&gt;&#xA;" OwnerDisplayName="user6420" LastEditorDisplayName="user6420" LastEditDate="2013-11-02T04:10:16.957" LastActivityDate="2019-09-28T02:01:35.210" Title="Rate of Return Required on Buying Stocks with Loan" Tags="&lt;returns&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9339" PostTypeId="2" ParentId="9241" CreationDate="2013-11-02T04:04:01.883" Score="5" Body="&lt;p&gt;Let $C$ be the price of the option, $S_t=S_0e^{X_t}$ be the stock price, $r$ be the risk-free rate, $K$ be the strike price, $T$ be the maturity time, $m=S_0/K$, $f$ be the density of $X_T$ and $\phi$ be the characteristic function $E(e^{i\xi X_T})$ which we assume is known.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;C = e^{-rT}E((S_T-K)^+) = e^{-rT}S_0\int_{-\infty}^\infty \left(e^x-m\right)\mathbb{I}_{\{x&amp;gt;\ln(m)\}}f(x)dx \\&#xA;= e^{-rT}S_0\int_{-\infty}^\infty e^{-ax}\left(e^{ax}\left (e^x-m\right)\mathbb{I}_{\{x&amp;gt;\ln(m)\}}\right)f(x)dx.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We exponentially damp the payoff is order to ensure its Fourier transform exists. Then we re-write the last in terms of the inverse Fourier transform of the Fourier transform of the damped payoff. Note that the damped payoff is integrable so long as $a&amp;lt;-1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the Fourier transform of the damped payoff is&#xA;$$ \mathcal{F}\left(e^{ax}\left (e^x-\frac{K}{S_0}\right)\mathbb{I}_{\{x&amp;gt;m\}}\right):=h(\xi) = \frac{m^{1+a+i\xi}}{(a+i\xi)(1+a+i\xi)} $$&#xA;which then allows&#xA;$$&#xA;C = e^{-rT}S_0\int_{-\infty}^{\infty}e^{-ax}\left( \frac{1}{2\pi}\int_{-\infty}^{\infty} h(\xi)e^{-ix\xi}d\xi \right) f(x)dx \\&#xA;= e^{-rT}S_0 Re\left( \int_{-\infty}^{\infty}e^{-ax}\left( \frac{1}{\pi}\int_{0}^{\infty} h(\xi)e^{-ix\xi}d\xi \right) f(x)dx \right) \\&#xA;= \frac{e^{-rT}S_0}{\pi}Re\left( \int_{0}^{\infty} \left( \int_{-\infty}^{\infty}f(x)e^{i(ia-\xi)x}dx \right)h(\xi)d\xi \right) \\&#xA;= \frac{e^{-rT}S_0}{\pi}S_0\ Re \left( \int_{0}^{\infty} \phi(ia-\xi)h(\xi)d\xi \right).&#xA;$$&#xA;The second step here is justified because the damped payoff is real. Hence $h$ is even in its real part and odd in its imaginary part. The third step requires Fubini's theorem which holds in most cases of interest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This expression can be used immediately to price a single option or allows discretisation in a form compatible with the FFT. If you use the FFT with $N$ discretisation points the output will be $N$ option prices calculated for $N$ levels of $m$ (which may be useful for calibration).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See Pascucci (2011) &lt;strong&gt;PDE and martingale methods in option pricing&lt;/strong&gt; (chapter 15) for more details and for a newer method using cosine expansions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. I have added an image of some simple Mathematica code for the GBM case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/q9ufC.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="6419" LastEditorUserId="6419" LastEditDate="2013-11-02T05:40:19.970" LastActivityDate="2013-11-02T05:40:19.970" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9340" PostTypeId="1" AcceptedAnswerId="10538" CreationDate="2013-11-02T11:39:13.540" Score="13" ViewCount="4321" Body="&lt;p&gt;The Hansen-Jagannathan bound &lt;a href=&quot;http://en.wikipedia.org/wiki/Hansen%E2%80%93Jagannathan_bound&quot;&gt;states&lt;/a&gt; that the maximum Sharpe ratio of a portfolio can't exceed the ratio of the standard deviation of a stochastic discount factor to its mean. I more or less understand the meaning of all three concepts: standard deviation, mean and stochastic discount factor but I'm at loss about how they relate here. So:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the intuition behind this result and why is this useful?&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2014-03-11T14:40:19.487" Title="Intuitive explanation of the Hansen-Jagannathan bound" Tags="&lt;sharpe-ratio&gt;&lt;stochastic-discount&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="9342" PostTypeId="1" CreationDate="2013-11-03T04:52:44.930" Score="2" ViewCount="391" Body="&lt;p&gt;Suppose I have 2 stocks and the only thing I know about them is their volatility and that they cointegrate. Let's say vol of stock A is 25% and B is 20%. Will I be able to find a hedge ratio only using the vol of 2 stocks? Assume that they track each other very closely and so mean reversion isn't an issue.&lt;/p&gt;&#xA;" OwnerUserId="3482" LastEditorUserId="3482" LastEditDate="2013-11-03T05:24:04.870" LastActivityDate="2013-11-03T05:24:04.870" Title="pairs trading or long short strategy given volatility of the stocks" Tags="&lt;cointegration&gt;&lt;pairs-trading&gt;&lt;longshort&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9346" PostTypeId="1" AcceptedAnswerId="9378" CreationDate="2013-11-03T17:41:49.077" Score="1" ViewCount="96" Body="&lt;p&gt;There's a better chance that stock price reaches an interval, say between \$16.91 and \$16.97, then a single price, say \$16.95. Hence, I generate an interval for a target price, instead of a single price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since there are multiple target prices in the interval, you'll need n target orders. You can't generate an order for each price in the interval as that would be too many.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the optimal value for n, and what should be each order's price?&lt;/p&gt;&#xA;" OwnerUserId="1504" LastEditorUserId="1504" LastEditDate="2013-11-03T20:18:38.147" LastActivityDate="2013-11-07T11:30:37.330" Title="Implementing Orders with Interval Estimates" Tags="&lt;order-handling&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9347" PostTypeId="1" CreationDate="2013-11-03T20:21:15.543" Score="6" ViewCount="1151" Body="&lt;p&gt;We know Black-Scholes is an imperfect model for options pricing.  Why is so much of the analysis of its defects focused on implied volatility?  The fact that IV varies for the same stock at the same time proves that BS is faulty (and cannot be fixed by making volatility time-dependent).  It also proves that $\sigma$ is not actually the standard deviation of the stock price, but just some fudge factor that is used to tweak results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why all the attention on this fudge-factor?  Once you know the model is defective I would think you should go back to the drawing board and see how the derivations of the BS pde could be modified to get a more sophisticated model.  But instead most of the attention in the literature seems to be on how to control the fudge-factor (&lt;a href=&quot;http://www.emanuelderman.com/writing/entry/lectures-on-the-smile-2008&quot; rel=&quot;noreferrer&quot;&gt;Derman has 12 lectures on The Smile&lt;/a&gt;), as if the BS equations had descended from heaven and our job as mortals was merely to provide midrashim on them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My own opinion is that people are too bemused by the famous cancellation of $\mu$ in the BS pde.  After all, that's what &lt;a href=&quot;http://www.nobelprize.org/nobel_prizes/economic-sciences/laureates/1997/press.html&quot; rel=&quot;noreferrer&quot;&gt;impressed the Nobel Prize committee&lt;/a&gt;, so it must be right.&#xA;But both Black &amp;amp; Schole's original derivation using asset pricing theory and Merton's later self-financing portfolio argument are enormous over-simplifications of the real world, and contra the Sveriges Rijksbank, Black, Scholes, &amp;amp; Merton did not show that &quot;... it is in fact not necessary to use any risk premium when valuing an option&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Merton's argument was the more sophisticated mathematically but also the less robust and flexible.  Continuously self-financing portfolios  will never be approached in reality: even if IT makes the continuous aspect feasible, the self-financing aspect will always be consumed in transaction fees.  But the asset pricing argument could easily be modified to allow greater suppleness.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The logical first pass at explaining the volatility smiles ought to be in going back and not making the facile assumptions that led to the cancellation of $\mu$ in the asset pricing argument.  This immediately introduces an extra parameter into the model that makes more sense than the IV fudge-factor and might in fact be able to explain much of the smile.  For example you might get a modified BS pde like&#xA;$$&#xA;rV=\mu S {\partial V \over \partial S} + {\partial V \over \partial t} + \frac{1}{2}\sigma^2S^2{\partial^2 V \over \partial S^2},&#xA;$$&#xA;which leads to a similarly modest change in the pricing formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you have no doubt inferred by now I'm not an expert.  Have these ideas already been explored and found wanting?&lt;/p&gt;&#xA;" OwnerUserId="6362" LastEditorUserId="19645" LastEditDate="2021-05-05T08:44:58.483" LastActivityDate="2021-05-05T08:44:58.483" Title="Black-Scholes: Why the focus on volatility?" Tags="&lt;black-scholes&gt;&lt;implied-volatility&gt;&lt;volatility-smile&gt;" AnswerCount="4" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9348" PostTypeId="2" ParentId="9313" CreationDate="2013-11-03T22:30:09.933" Score="7" Body="&lt;p&gt;It's probably because of the strong long-standing statistical underpinnings in economics and econometrics, and overall, risk prediction.  For example, look at current research with fat-tail distributions and calculations for Expected Tail Loss (ETL), etc.  These studies fit Student's t, Normal, Stable, and Pareto probability distributions to data and report that e.g. the Kolmogorov or Anderson-Darling goodness-of-fit distance is less for the normal distribution, that is, the normal distribution doesn't recover the area in the tails as well as the Stable and Student's t (for varying d.f.).  Next, moving into time-series analyses, there is still tremendous merit in using ARIMA, ARMA, ARCH, and GARCH-type fitting to explaining conditional means and variances, and autocorrelation.  You can simply use a handful of the methods listed above and perform an incredible amount of risk prediction that has scientific merit in financial risk management.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next, for ML, the more you delve into non-linear manifold learning (ISOMAP, Laplacian eigenmaps, etc), metaheuristics (evolutionary algorithms and evolutionary strategies such as genetic algorithms, covariance matrix self-adaptation, ant colony optimization, particle swarm optimization), neural adaptive learning (ANNs), and many other ML and AI supervised methods you are essentially getting further away from deterministic and stochastic derivative-based gradient descent and Newton-Raphson methods -- which provide parameter uncertainty.      &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recently, I started using particle swarm optimization for almost everything I optimize.  Sure, Newton-Raphson is faster, is more consistent, and can provide parameter uncertainty, but as I see it, to correctly model risk one needs to combine realizations from many different distributions to build up a final uncertainty distribution.  For this reason, the majority of time when I am not interested in Type I and II errors, power, AIC, etc, or for that matter the standard errors of coefficients, I typically spew out point estimates, and then use these as inputs to Monte Carlo analysis.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding random forests (RF), it is one of the best unsupervised and supervised classifiers out there.   RF simultaneously combines bootstrapping of the training samples and random feature selection to train each tree.  Unknown test objects not in the bootstrapped training sample (called out-of-bag, OOB) are then &quot;dropped&quot; down each trained tree.  Feature importance is then determine by comparing classification accuracy between permuted and unpermuted values of feature &lt;span class=&quot;math-container&quot;&gt;$j$&lt;/span&gt; for all objects in the OOB via dropping them down the same trained tree.  Breiman suggested using at least 5000 trees (&quot;don't be stingy&quot;) and in fact his main ML paper on RF used 50,000 trees per run.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Artificial neural networks (ANNs) have been shown to be a universal approximator, however, they become quite expensive when compared with Newton-Raphson, providing you know the objective function your are fitting (optimizing).  If you don't know the objective equation, then an ANN can be tremendously beneficial.  Like I have said to other colleagues, in these cases, &quot;the ANN is the equation.&quot;  For this latter framework, where the ANN is the equation, if you draw random quantiles from distributions for various risk factors, and clamp each set of quantiles to the input nodes of the ANN, train using CV, the utility of an ANN combined with Monte Carlo will be immense. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since it takes a decade or more to learn ML and AI at a level where you can tackle most any problem, there would be no expectation that someone with an extensive QF background would be able to pick it up quickly, and no expectation that the results would be better.  ML and AI are best implemented for near NP-hard problems such as timetabling, shift and airline scheduling, and logistics, where there is not a closed form analytic solution (equation) that describes your model.   &lt;/p&gt;&#xA;" OwnerDisplayName="user6430" LastEditorDisplayName="user6430" LastEditDate="2019-02-23T20:47:16.867" LastActivityDate="2019-02-23T20:47:16.867" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="9349" PostTypeId="2" ParentId="9347" CreationDate="2013-11-04T04:48:59.523" Score="6" Body="&lt;p&gt;First of all, may I point out two big misperceptions that you may have:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Implied Volatility (IV) is &lt;strong&gt;the&lt;/strong&gt; input to any vanilla option pricing model (not just Black Scholes (BS) that impacts the pricing the most. You can verify this by flipping through the different risk exposures (greeks and higher order sensitivities) and study mean volatilities in such risk factors and their impact on the pricing of such options.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Traders who price and buy/sell options in effect trade future realized volatility/expected variation in the underlying asset returns. Hence, option traders express views on such future asset price variation and thus buy and sell volatility. The term &amp;quot;implied&amp;quot; volatility is in my opinion a bit of a misnomer because the trade starts with an agreed level of volatility and not an option price.&lt;/p&gt;&#xA;&lt;p&gt;(In fact, you hardly ever hear any professional traders agreeing on an option price, they most often agree on the exact implied vols they trade at, and often times also trade the delta alongside the option (at least in equity space) in order to have the option delta-hedged at initiation.)&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Option pricing models are used to translate the expressed IV -&amp;gt; Price. When you see option prices on your trading screen then those are the outputs of automated pricing applications which as input take among couple other mostly statics, IV.&lt;/p&gt;&#xA;&lt;p&gt;Hence, your view of IV being a &amp;quot;fudge factor&amp;quot; is very simplistic. Most everything that is traded in an option in fact is IV. (Of course you have other option inputs but you would trade specific dividend swaps or interest rate derivatives, for example, if you wanted to express a view on such inputs). The option price is just a translation in order to pay for the implied volatility that is traded.&lt;/p&gt;&#xA;&lt;p&gt;And: Just because an option pricing model is imperfect does not make it worthless. In fact, I challenge you to come up with an alternative model that is equally simple (computationally as well as intuitively) and more accurate than B-S, I am sure the market will embrace it and thank you for your efforts.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;p&gt;I highly recommend to go through the following short paper: &lt;a href=&quot;http://www.math.nyu.edu/research/carrp/papers/pdf/faq2.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Option Pricing Q&amp;amp;A&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2013-11-05T01:04:43.247" CommentCount="19" ContentLicense="CC BY-SA 3.0" />
  <row Id="9350" PostTypeId="1" AcceptedAnswerId="38985" CreationDate="2013-11-04T05:21:28.467" Score="9" ViewCount="2644" Body="&lt;p&gt;I understand that stochastic volatility models should be used when the exotic option payoff is volatility dependent (such as variance swaps and volatility swaps).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Stochastic volailtiy models should also be used when the exotic option has forward starting features (such as with cliquet options). Can someone explain why should we use stochastic volatility models for forward starting options?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, given an exotic option, how would you decide whether to use a local volatility or stochastic volatility model for pricing it?&lt;/p&gt;&#xA;" OwnerUserId="6428" LastEditorUserId="11723" LastEditDate="2018-03-26T06:57:17.163" LastActivityDate="2018-03-26T06:57:17.163" Title="For pricing, what types of Exotic Options are suitable using Local Volatility Model or a Stochastic Volatility Model?" Tags="&lt;option-pricing&gt;&lt;implied-volatility&gt;&lt;stochastic-volatility&gt;&lt;exotics&gt;&lt;local-volatility&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="9351" PostTypeId="1" CreationDate="2013-11-04T06:02:50.637" Score="25" ViewCount="8096" Body="&lt;p&gt;I am fitting numerically an AR(1)/GARCH(1,1) process to index and stock log-returns, $r_t=\log(P_t/P_{t-1})$, where $P_t$ is the price at time $t$, and thus far am not clear on where the observed log returns would be used in an algorithm.  Several author groups have described (some in part) the components of the AR(1)/GARCH(1,1) approach, for example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E. Zivot:&#xA;$$&#xA;r_t=\mu + \phi (r_{t-1} - \mu ) + \epsilon_t&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rachev et al:&#xA;$$&#xA;\begin{split}&#xA;r_t&amp;amp;=\mu+\phi r_{t-1}\\&#xA;\epsilon_t&amp;amp;=\sigma_t \delta_t \quad \quad (\delta_t \textrm{ is an innovation})\\&#xA;\sigma_t &amp;amp;= \sqrt{\alpha_0 + \alpha_1 \epsilon_{t-1}^2 + \beta_1 \sigma_{t-1}^2}\\&#xA;\end{split}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Brummelhuis &amp;amp; Kaufman:&#xA;$$&#xA;\begin{split}&#xA;X_t&amp;amp;=\mu_t+ \sigma_t \epsilon_t\\&#xA;\mu_t&amp;amp;=\lambda X_{t-1}\\&#xA;\sigma_t &amp;amp;= \sqrt{\alpha_0 + \alpha_1 (X_{t-1}-\mu_{t-1})^2 + \beta_1 \sigma_{t-1}^2}\\&#xA;\end{split}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Jalal &amp;amp; Rockinger:&#xA;$$&#xA;\begin{split}&#xA;\mu_t&amp;amp;=\phi X_{t-1}\\&#xA;\epsilon_t &amp;amp;=X_t - \mu_t\\&#xA;\sigma_t &amp;amp;= \sqrt{\alpha_0 + \alpha_1 \epsilon_{t-1}^2 + \beta_1 \sigma_{t-1}^2}\\&#xA;\end{split}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My approach:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{split}&#xA;\mu_t&amp;amp;=\mu+\phi r_{t-1}\\&#xA;\epsilon_t&amp;amp;=r_t - \mu_t\\&#xA;\sigma_t &amp;amp;= \sqrt{\alpha_0 + \alpha_1 \epsilon_{t-1}^2 + \beta_1 \sigma_{t-1}^2}\\&#xA;\end{split}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the multiple descriptions above, my interpretation for an algorithm would be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;b&gt;Algorithm for AR(1)/GARCH(1,1):&lt;/b&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Initialize $\mu=0$, $\sigma_1 = 1$, $\epsilon_1=0$, $\mu=\phi=\alpha_0=\alpha_1=\beta_1=U(0,1)* 0.01$&lt;/li&gt;&#xA;&lt;li&gt;&lt;b&gt;For $t$ = 2 to $T$:&lt;/b&gt;&lt;/li&gt;&#xA;&lt;li&gt;$\quad \mu_t = \mu + \phi r_{t - 1}\quad \quad (\textrm{Log-returns lag-1 input here})$ &lt;/li&gt;&#xA;&lt;li&gt;$\quad \epsilon_t = r_t - \mu_t \quad \quad (\textrm{Log-returns lag-0 input here})$&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$\quad \sigma_t= \sqrt{\alpha_0 + \alpha_1 \epsilon_{t-1}^ 2 + \beta_1 \sigma_{t - 1} ^ 2}$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$\quad \hat{r}_t = \phi \mu_{t - 1} + \sigma_t \epsilon_t \quad \quad \textrm{OR}:  \hat{r}_t = \mu + \phi \mu_{t - 1} + \sigma_t \epsilon_t \quad \quad ???$  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;b&gt;Next $t$&lt;/b&gt;&lt;/li&gt;&#xA;&lt;li&gt;Calculate residual, $e_t=r_t-\hat{r}_t$&lt;/li&gt;&#xA;&lt;li&gt;Determine $MSE=\frac{1}{T}\sum_t e_t^2$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The algorithm proposed above is essentially the recursive part to calculate the predicted log-returns $\hat{r}_t$ from the input observed returns $r_t$.  Innovations or random quantiles from a probability distribution [such as N(0,1) or $t(\nu)$] would not be employed here since we are fitting a model, not simulating.  During each iteration, the  goodness-of-fit based on proposed parameters for the objective function would be based on $MSE=\frac{1}{T}\sum_t e_t$, which would be minimized via an optimization technique using non-linear regression, finite differencing, or MLE.  Metaheuristics could be used as well where initialization of chromosome (particle) values for  $(\mu,\phi,\alpha_0,\alpha_1,\beta_1)$ would occur at the first generation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of comparing results based R, MATLAB, SAS, etc. the parameterization would be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;mu=$\mu$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ar1=$\phi$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;garch0=$\alpha_0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;garch1=$\alpha_1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;garch2=$\beta_1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure whether the unconditional mean $\mu$ would be needed in line 6 of the algorithm, however.  Please comment on correctness of the algorithm, and possibly suggest coding changes.  Again, the goal is to algorithmically use numerical methods to solve for the parameters, not R, MATLAB, or SAS, etc.   &lt;/p&gt;&#xA;" OwnerDisplayName="user6430" LastEditorDisplayName="user6430" LastEditDate="2016-08-01T20:44:21.080" LastActivityDate="2018-03-24T17:28:59.373" Title="Algorithm to fit AR(1)/GARCH(1,1) model of log-returns" Tags="&lt;optimization&gt;&lt;garch&gt;&lt;algorithm&gt;&lt;arma&gt;&lt;curve-fitting&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="17" ContentLicense="CC BY-SA 3.0" />
  <row Id="9352" PostTypeId="1" AcceptedAnswerId="9353" CreationDate="2013-11-04T12:51:37.290" Score="1" ViewCount="691" Body="&lt;p&gt;I have some trouble solving the following question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have an european call and put option (with the same maturity date $T$ en strike $E=10$). The stock price now is $S=11$ and we use a continuous compound interest of $r=0.06$. Determine, using the put-call parity, an investment strategy to accomplish a risk-free profit based on the arbitrage principle if both options have value $V=2.5$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I cannot figure out how to approach this problem. The put-call parity alone does not seem to solve this problem. Help is very much appreciated.&lt;/p&gt;&#xA;" OwnerUserId="6433" LastActivityDate="2016-10-03T08:45:03.513" Title="Risk-free investment strategy for european call and put option" Tags="&lt;options&gt;&lt;risk&gt;&lt;arbitrage&gt;&lt;option-strategies&gt;&lt;put-call-parity&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9353" PostTypeId="2" ParentId="9352" CreationDate="2013-11-04T13:22:55.880" Score="1" Body="&lt;p&gt;The left hand side $(C-P)$ of the put-call partity equation provides the same pay-off as the right hand side $(S-K\times e^{-rT})$. Determine (by filling in the numbers) which part of the equation is relative cheap e.g. $(C-P) &amp;lt; (S-K\times e^{-rT})$. If this is the case, sell the $(S-K\times e^{-rT})$ and use the funds from selling to buy $(C-P)$. The pay-off from $C-P$ can be used to settle $(S-K\times e^{-rT})$ at maturity, the profit from initial selling and buying is the profit. &lt;/p&gt;&#xA;" OwnerUserId="6434" LastEditorUserId="20913" LastEditDate="2016-10-03T08:45:03.513" LastActivityDate="2016-10-03T08:45:03.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9355" PostTypeId="2" ParentId="9347" CreationDate="2013-11-04T14:55:51.337" Score="1" Body="&lt;p&gt;The focus on volatility comes about because all price changes &quot;look like&quot; volatility, no matter their source.  Improvements in volatility treatment are therefore conflated with improvements in the model, and typically when people consider altered models, they first look to how well the alterations do in providing prices that explain skew for the classical model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, though there are indeed many problems with the model I wouldn't necessarily agree with you that the research focus is on &quot;volatility&quot;.  It's more on the &quot;form of price changes&quot;, albeit only tractable ones.  Some of the flaws in the model lack clear treatment.  My favorite such problem is corporate actions, like spinoffs.  How would one propose to model that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fischer Black himself wrote a clear-eyed &lt;a href=&quot;http://www.nuclearphynance.com/User%20Files/1540/HolesBlackScholes.pdf&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; on the model's limitations, and how to use them.  If you want to ponder improvements, it's the right place to start.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You happen to focus on drift in your question, so I'll specifically address that. Drift is closely related (observationally) to using a mis-estimated discount rate in the classical formula.  This sort of issue can be perceived by examining implied vols for vanilla puts and calls at the same strike, which enjoy a pricing relation derived from the put-call parity formula (which is, I stress, model-free)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;C_K - P_K = e^{-rT}(F-K)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When those implied vols differ, either the model or its parameterization is in error.&#xA;As a matter of fact, many underlyings have this property.  Often the explanation is mundane: the carry cost is wrong.  Other times, the problem is more in the model, as it would be with a bad drift.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2013-11-04T14:55:51.337" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="9357" PostTypeId="1" CreationDate="2013-11-04T16:54:16.873" Score="2" ViewCount="74" Body="&lt;p&gt;This is CNY to US$:&#xA;&lt;img src=&quot;https://i.imgur.com/kW79BoM.jpg&quot; alt=&quot;exch.chn&quot;&gt;&#xA;This is HKD to US$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.imgur.com/fwkt1xH.jpg&quot; alt=&quot;exch.hk&quot;&gt;&#xA;Below are the log of the first difference of both graphs above:&#xA;&lt;img src=&quot;https://i.imgur.com/tB0bZWs.jpg&quot; alt=&quot;ret.exch&quot;&gt;&#xA;&lt;img src=&quot;https://i.imgur.com/Ne4ezRZ.jpg&quot; alt=&quot;ret.exch&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see that apparent similarity on the middle of graph. I thought that they were managed by different entity as CNY are managed by People Bank of China (PBC, Central Bank of China) and HKD by Hongkong Monetary Authority&#xA;CNY exchange rate is a &lt;em&gt;managed float&lt;/em&gt; while HKD is &lt;em&gt;pegged&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Were the similarity induced by the same response to the same crisis? Or is it only coincidence? Or was it coordinated between financial authority in China and Hongkong? Or the way of how HK pegged HKD similar to the way how China managed float on CNY?  &lt;/li&gt;&#xA;&lt;li&gt;What are the implication of it?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="6333" LastEditorUserId="18977" LastEditDate="2016-01-13T16:23:28.737" LastActivityDate="2016-01-13T16:23:28.737" Title="Why does graphic of log first difference of renminbi look similar to hkd?" Tags="&lt;fx&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9358" PostTypeId="2" ParentId="9336" CreationDate="2013-11-04T17:44:28.717" Score="2" Body="&lt;p&gt;For Interest Rate Swaps, IMM means the periods will be the third Wednesday of each quarter adjusted in following if needed. This means that the start and end dates of each period to compute your day count fraction will be using these dates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fixing date however will be such as the spot is the IMM start date. This means that for GBP it will be the same day and for USD it will be two working days before. This is pretty much the same than a swap rolling on a certain date except the date modifier sticks to an IMM instead of a certain day of the month.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, for some twisted reason, the CDS market decided that IMM dates should be the 20th of each quarter (adjusted as well in following).&lt;/p&gt;&#xA;" OwnerUserId="2908" LastEditorUserId="2908" LastEditDate="2013-11-04T17:55:46.377" LastActivityDate="2013-11-04T17:55:46.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9359" PostTypeId="2" ParentId="422" CreationDate="2013-11-04T18:33:03.003" Score="3" Body="&lt;p&gt;Disclosure: I am part of &lt;a href=&quot;http://lobster.wiwi.hu-berlin.de&quot; rel=&quot;nofollow&quot;&gt;lobster.wiwi.hu-berlin.de&lt;/a&gt; which providers data for academic research. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;NASDAQ's Historical TotalView-ITCH sample file:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On &lt;a href=&quot;ftp://emi.nasdaq.com/ITCH/&quot; rel=&quot;nofollow&quot;&gt;NASDAQ's public ftp&lt;/a&gt; you can find sample files of NASDAQ's Historical TotalView-ITCH. The files contain message data and have to be interpreted to get tick-by-tick data. I.e. you need to reconstruct the book.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Limit order book data reconstructed from NASDAQ's Historical TotalView-ITCH:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;a href=&quot;https://lobster.wiwi.hu-berlin.de/info/DataSamples.php&quot; rel=&quot;nofollow&quot;&gt;LOBSTER data samples&lt;/a&gt; you can find reconstructed data for several tickers traded on NASDAQ with book levels of 1,5,10,30,50.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similar data is available from &lt;a href=&quot;http://tradingphysics.com/Feeds/DownloadHistoricalITCH.aspx&quot; rel=&quot;nofollow&quot;&gt;TradingPhysics&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6435" LastActivityDate="2013-11-04T18:33:03.003" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9360" PostTypeId="2" ParentId="9241" CreationDate="2013-11-05T01:55:37.023" Score="9" Body="&lt;p&gt;When the pdf of a distribution is not known analytically, it's common to compute by taking the inverse Fourier transform of its characteristic function. The same idea applies here. Consider the discounted expectation formula of a European option&#xA;$$V (S,\tau) = e^{-r\tau} \mathbb{E}_{x_0} [\theta(x_T)] $$.&#xA;for log prices $x$ and time to expiry $\tau=T-t$. In integral form this is&#xA;$$V (S,\tau)= e^{-r\tau} \int_{-\infty}^\infty \theta(x_T) f(x_T|x_0) dx_T $$&#xA;where $f(x_T|x_0)$ is the transition probability density (i.e. probabiltiy of reaching $x_T$ given $x$). For assets following certain distributions, $f$ can be hard to find analytically and may not even exist (consider the &lt;a href=&quot;http://en.wikipedia.org/wiki/Alpha-stable_distribution&quot; rel=&quot;noreferrer&quot;&gt;stable distribution&lt;/a&gt;). However, for the large majority of distributions used in finance, the Fourier transform (or characteristic function) is. So recasting the pricing problem in the Fourier domain is quite natural. Let's do this by applying the Fourier transform to the discounted expectation formula. Introduce the damping $\exp (\alpha x)$ so that $\exp (\alpha x) \theta(x) \in \mathbb{L}^2(\mathbb{R})$&#xA;\begin{align}&#xA;\hat{V} (S,\tau) &amp;amp;= e^{-r \tau} \mathcal{F}  \{\mathbb{E}_{x_0} [e^{\alpha x} \theta(x_T)] \} \\&#xA;&amp;amp;= e^{-r\tau} \mathbb{E}_{x_0} [\hat{\theta}_\alpha(x_T) ] .&#xA;\end{align}&#xA;By Fourier inversion&#xA;\begin{align}&#xA;V(S, \tau) &amp;amp;= e^{-r\tau} \mathcal{F}^{-1} \{ \mathbb{E}_{x_0} [\hat{\theta}_\alpha (x_T) ]   \} \\&#xA;&amp;amp;= \frac{e^{-r\tau}}{2 \pi} \int_{-\infty+i \alpha}^{\infty+i \alpha} \hat{\theta}_\alpha (x_T) \mathbb{E}_{x_0} [e^{iux_T}] dx_T \\&#xA;&amp;amp;= \frac{e^{-r\tau}}{2 \pi}  \int_{-\infty+i \alpha}^{\infty+i \alpha} \hat{\theta}_\alpha (x_T) \mathbb{E}_{x_0} [e^{iux_T-iux_0+iux_0}] dx_T \\&#xA;&amp;amp;=\frac{e^{-r\tau}}{2 \pi} \int_{-\infty+i \alpha}^{\infty+i \alpha}  \hat{\theta}_\alpha (x_T) \phi(u;T) e^{iux_0} dx_T&#xA;\end{align}&#xA;where $\phi(u;T):=\mathbb{E}_{x_0} [e^{iu(x_T-x_0)}]$ is the characteristic function of the log price process. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To address your question of computation, MATLAB code is available for the Carr and Madan method. Using the &lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/37616-modern-pricing-method-using-transforms/content/Cos_Conv_Methods/CallPricingFFT.m&quot; rel=&quot;noreferrer&quot;&gt;MAIN FUNCTION&lt;/a&gt; and the characteristic function &lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/37616-modern-pricing-method-using-transforms/content/Cos_Conv_Methods/CharacteristicFunctionLib.m&quot; rel=&quot;noreferrer&quot;&gt;LIBRARY&lt;/a&gt;, you can call the function (untested):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CallPricingFFT('BlackScholes',14,10,12,2,0.05,0)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which will return your call option price of 1.073389...&lt;/p&gt;&#xA;" OwnerUserId="6437" LastEditorUserId="6437" LastEditDate="2013-11-05T05:21:19.877" LastActivityDate="2013-11-05T05:21:19.877" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9361" PostTypeId="1" AcceptedAnswerId="9362" CreationDate="2013-11-05T05:10:18.170" Score="6" ViewCount="321" Body="&lt;p&gt;I am attempting to arrive at the Black-Scholes formula for my own understanding. I can accept one can use the risk-free distribution &amp;amp; rate, so I am attempting to use the distrution to arrive at the result rather than PDEs. Here is what I have:&#xA;$$\lim\limits_{b \to \infty}\int_a^b pdf(s)(s-K)ds$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the initial price is $S_0$ I popped that in with $s$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\lim\limits_{b \to \infty}\int_a^b pdf(s*S_0)(s*S_0-K)ds$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $a = K / S_0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And since B-S formula choose the log normal I will use that for the pdf:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\lim\limits_{b \to \infty}\int_a^b \dfrac{1}{\sigma\sqrt{2\pi}}*  e^{\dfrac{-(ln(s*S_0)-\mu)^2}{2\sigma^2}}  - \int_a^b\dfrac{K}{S_0s\sigma\sqrt{2\pi}} * e^{\dfrac{-(ln(s*S_0)-\mu)^2}{2\sigma^2}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think I'm ok up to here but I could be off with where I'm putting my $S_0$'s... anyways the first integral looks scary but I found some help here: &lt;a href=&quot;https://stats.stackexchange.com/questions/9501/is-it-possible-to-analytically-integrate-x-multiplied-by-the-lognormal-probabi&quot;&gt;https://stats.stackexchange.com/questions/9501/is-it-possible-to-analytically-integrate-x-multiplied-by-the-lognormal-probabi&lt;/a&gt; so I'm pretty sure we're going to end up with something like this (for the first integral):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$e^{\mu+\frac{1}{2}\sigma}(\Phi(\beta)-\Phi(\alpha))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\beta = (ln(b) - \mu-\sigma^2)/\sigma$ and $\alpha = (ln(K/S_0) - \mu-\sigma^2)/\sigma$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I should probably mention here that I have been lazily mentally substituting $\sigma\sqrt{t}$ anytime I see $\sigma$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $b$ is going to $\infty$,$\Phi(\beta)$ is going to $1$. At this point we should also try getting rid of $\mu$. Since $S_0e^{rt}$ is the expected forward price we can set that equal to $e^{\mu+\sigma^2/2}$ and get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mu = ln(S_0) + rt - \sigma^2/2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the second integral, we are just going to get a difference of two log-normal CDFs (I think) times $K$. The first will again be $1$ since $b$ is going to $\infty$, so we get $K(1-LNCDF(a))$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My result is thus $S_0e^{rt}(1-\Phi(a)) - K(1-LNCDF(a))$ This doesn't look too familiar so I am wondering what I am doing wrong. Thanks!&lt;/p&gt;&#xA;" OwnerUserId="5092" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2013-11-06T14:48:13.390" Title="Trouble arriving at Black-Scholes Formula" Tags="&lt;black-scholes&gt;&lt;lognormal&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9362" PostTypeId="2" ParentId="9361" CreationDate="2013-11-05T06:28:21.563" Score="6" Body="&lt;p&gt;Here couple pointers to push you back on the right path (so I hope): &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Start with the payoff function and hence $S(T)$, which consists of $(W(T)-W(t))$ , $W$ being a Brownian Motion under the risk neutral measure)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;you can greatly simplify by working with a standard normal random variable:&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$$Y = \frac{-(W(T)-W(t))}{\sqrt{T-t}}$$, which helps to get rid of the indicator function and to derive d+ and d-, &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;you need to perform a change of variable to express part of your result as a function of the cdf.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You can find the full derivation in Steven Shreve, &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0387401016&quot; rel=&quot;nofollow&quot;&gt;Stochastic Calculus for Finance II&lt;/a&gt;, 2004 edition, pp.218 &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-11-06T14:48:13.390" LastActivityDate="2013-11-06T14:48:13.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9364" PostTypeId="2" ParentId="9337" CreationDate="2013-11-05T14:49:40.623" Score="1" Body="&lt;p&gt;In the case that volatility is given, you're very close. You can calculate $u$ and $d$ using volatility:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;u = e^{\mbox{volatility}*\sqrt{T}}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;d = \frac{1}{u} = e^{-\mbox{volatility}*\sqrt{T}}&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="6434" LastEditorUserId="35" LastEditDate="2013-11-05T17:34:22.570" LastActivityDate="2013-11-05T17:34:22.570" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9365" PostTypeId="2" ParentId="9338" CreationDate="2013-11-05T14:53:30.417" Score="1" Body="&lt;p&gt;Frankly this is barely understandable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume the nominal of the bond is $L$, the monthly interest rate is $i$, then you have to compute the monthly installments $C$ over $M$ months as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$L= \sum_{j=1}^M \frac{C}{(1+i)^j}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, we know that the price of a perpetuity is :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sum_{j=1}^\infty \frac{C}{(1+i)^j}=\frac{C}{i}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you can compute $L$ by subtracting a discounted perpetuity at time $M$ from a perpetuity at time $0$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$L= \sum_{j=1}^M \frac{C}{(1+i)^j}= \frac{C}{i} - \frac{1}{(1+i)^M} \frac{C}{i}=\frac{C}{i} \left( 1 - \frac{1}{(1+i)^M}  \right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In any way, you want to invest this amount in some stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't really understand the rest of the question.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2013-11-05T14:53:30.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9366" PostTypeId="1" CreationDate="2013-11-05T15:42:16.253" Score="2" ViewCount="241" Body="&lt;p&gt;I'm trying to do a regression on my panel data. Say I have T=3500 days of data and N=125 firms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since Matlab get's major memory issues (which I try to prevent by the usual solutions as seen on the Mathworks site), because my panel was too big, I decided to only look at  700 days of data and to take averages of a number of firms to get N=5.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I discovered that the way I take these averages/medians heavily influences my regression results. If I first sort the firms on the size of the dependent variable and then make 5 groups to average them, I'll get less significant results than when I used another (default) sorting (almost alphabetic). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what is the way to go in these kind of situations?&lt;/p&gt;&#xA;" OwnerUserId="2402" LastActivityDate="2013-12-09T22:16:06.993" Title="How to properly take averages to reduce data in regression/panel data analysis" Tags="&lt;equities&gt;&lt;regression&gt;&lt;paneldata&gt;" AnswerCount="0" CommentCount="7" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9368" PostTypeId="1" CreationDate="2013-11-05T23:05:44.210" Score="3" ViewCount="570" Body="&lt;p&gt;Could someone tell me a common method for pricing VIX Options please?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I need to use a Stochastic Vol Model? Or Local Vol Model is suitable as well?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should the model be modelling S&amp;amp;P 500 and then recalculate the VIX Index? Or model the VIX Index directly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="6428" LastActivityDate="2015-01-11T23:14:02.127" Title="How to value VIX Option?" Tags="&lt;vix&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9369" PostTypeId="1" AcceptedAnswerId="9384" CreationDate="2013-11-05T23:10:40.820" Score="1" ViewCount="288" Body="&lt;p&gt;Many discretionary traders swear by risk-reward ratio, as in &quot;The minimum risk-reward ratio for a Forex trade is 1:2.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do quantative traders use risk-to-reward ratio as well? If so, how do you calculate the minimum risk-reward ratio?&lt;/p&gt;&#xA;" OwnerUserId="1504" LastEditorUserId="467" LastEditDate="2013-11-07T08:07:07.213" LastActivityDate="2013-11-07T08:07:07.213" Title="Is the risk-reward ratio considered in Quantitative Finance?" Tags="&lt;risk&gt;" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="9370" PostTypeId="1" CreationDate="2013-11-05T23:15:36.277" Score="1" ViewCount="1000" Body="&lt;p&gt;Let's say that I'm issuing an Autocallable Note with the following features:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Underlying: FTSE 100&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Autocall Observation Frequency: Annual Observation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Autocall Level: 100% of Initial Level of FTSE 100 (The Note autocalls if FTSE 100 goes above Autocall Level at Observation Dates)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Annual Coupon: 10% (Coupon only pays out when the Note is autocalled. Coupon accumulates to next year if the note is not autocalled)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maturity: 6 years&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Knock-In Barrier: 60% of Initial Level of FTSE 100 (KI only observed at maturity. If the Note is neither Autocalled nor Knocked-In at maturity, investor get 100% money back)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the above Autocall Note, is the Issuer long or short vega? Please explain.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the issuer long or short interest rates? Or is it more complicated when it comes to interest rate risks of an Autocall Note?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, what other risks are there for the issuer?&lt;/p&gt;&#xA;" OwnerUserId="6428" LastEditorUserId="16595" LastEditDate="2018-06-18T16:23:10.583" LastActivityDate="2018-06-18T16:23:10.583" Title="Risks of issuing an Autocallable Note" Tags="&lt;risk&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9371" PostTypeId="2" ParentId="9370" CreationDate="2013-11-06T01:13:43.033" Score="1" Body="&lt;p&gt;Although, it will depend on current interest rate, if the issuer is paying &quot;coupon&quot; (which is strip of barrier options), the PV of those coupon (or the price of the barrier options) will have to be balanced out by something else. In above case, it will be PV of the interest earned on the notional of the note + option premium he pays for KI option. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So vega wise , issuer net vega will be sum of long vega due to KI put option and short vega due to strip of barrier options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interest rate wise, issuer is long interest rate as he has agreed to pay a fixed rate against the floating rate received on the note notional.&lt;/p&gt;&#xA;" OwnerUserId="4597" LastActivityDate="2013-11-06T01:13:43.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9372" PostTypeId="2" ParentId="2820" CreationDate="2013-11-06T01:22:04.987" Score="0" Body="&lt;p&gt;Take a look at someone using spectral analysis on the market: stock market analysis&#xA;&lt;a href=&quot;http://www.stockforecasttoday.com&quot; rel=&quot;nofollow&quot;&gt;http://www.stockforecasttoday.com&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6446" LastActivityDate="2013-11-06T01:22:04.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9373" PostTypeId="2" ParentId="9368" CreationDate="2013-11-06T01:26:10.317" Score="2" Body="&lt;p&gt;I am ignorant to VIX option pricing but I would start with this: &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1002/fut.20466/abstract?deniedAccessCustomisedMessage=&amp;amp;userIsAuthenticated=false&quot; rel=&quot;nofollow&quot;&gt;The performance of VIX option pricing models: Empirical evidence beyond simulation&lt;/a&gt; -- Working paper &lt;a href=&quot;https://msb040.msb.edu/faculty/bodurthj/unrestricted/teaching/articles/Derivatives/options/Wang-Daigler_The%20Performance%20of%20VIX%20Option%20Pricing%20Models-Empirical%20Evidence%20Beyond%20Simulation_2009.pdf&quot; rel=&quot;nofollow&quot;&gt;version&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2570" LastActivityDate="2013-11-06T01:26:10.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9374" PostTypeId="2" ParentId="557" CreationDate="2013-11-06T03:24:20.563" Score="8" Body="&lt;p&gt;Quickfix derivative with a large number of optimizations, much faster than the current release, especially for short messages. Includes sample application that measures latency over the loopback interface.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/akorobka/quickfix/tree/quickerfix&quot;&gt;https://github.com/akorobka/quickfix/tree/quickerfix&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Summary of the improvements&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several things that have an adverse impact on the performance of the current reference implementation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most of them have to do with a large amount of redundant object copying, implicit type conversions and small block memory allocations. These changes try to reduce these as much as possible through a redesign of the field object, use of more efficient field containers (Boost, Google Sparsehash) with a custom pool allocator, and streamlined Tx/Rx pipelines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other changes are basically brute force optimizations using more efficient serialization/deserialization code, each contributing 0-20% to the total speedup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Extensions&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each field type defines a nested Pack type that can be used for in-place field construction when adding a field to the message,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;msg.setField( FIX::ClOrdID::Pack( &quot;4&quot; ) );&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Double field constructors get an optional bool argument that specifies whether the value should be rounded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;msg.setField( FIX::DoubleField( field, value, precision, true ) );&lt;/em&gt;&lt;br&gt;&#xA;&lt;em&gt;msg.setField( FIX::Price( value, precision, true ) );&lt;/em&gt;&lt;br&gt;&#xA;&lt;em&gt;msg.setField( FIX::Price::Pack( value, precision, true ) );&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="6447" LastEditorUserId="6447" LastEditDate="2013-11-20T19:41:24.430" LastActivityDate="2013-11-20T19:41:24.430" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9375" PostTypeId="1" CreationDate="2013-11-06T06:03:25.660" Score="5" ViewCount="243" Body="&lt;p&gt;By using the canonical representation of a semimartingale in Eberlein, Glau and Papapantoleon's &quot;&lt;a href=&quot;http://www.stochastik.uni-freiburg.de/~eberlein/papers/analysis_090911.pdf&quot; rel=&quot;nofollow&quot;&gt;Analysis of Fourier Transform Valuation Formulas and Applications&lt;/a&gt;&quot;, on page 3: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$H = B + H^c + h(x) \ast (\mu − \nu) + (x − h(x)) \ast μ$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$h = h(x)$ is a truncation function,&lt;/li&gt;&#xA;&lt;li&gt;$B = (B_t)_{0 \leq t \leq T}$ is a predictable process of bounded variation,&lt;/li&gt;&#xA;&lt;li&gt;$H^c = (H^c_t )_{0 \leq t \leq T}$ is the continuous martingale part of $H$ with predictable quadratic characteristic,&lt;/li&gt;&#xA;&lt;li&gt;$\langle H^c \rangle = C$, and $\nu$ is the predictable compensator of the random measure of jumps $μ$ of $H$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here, $W \ast μ$ denotes the integral process of $W$ with respect to $μ$, and $W \ast (μ − \nu)$ denotes the stochastic integral of $W$ with respect to the compensated random measure $μ − \nu$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to find an SDE for $H_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the stochastic differential for $H_t$, $dH_t$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to use a &lt;a href=&quot;http://en.wikipedia.org/wiki/Feynman%E2%80%93Kac_formula&quot; rel=&quot;nofollow&quot;&gt;Feynman-Kac&lt;/a&gt; type formula to get the PDE for the characteristic function of $H_t$?&lt;/p&gt;&#xA;" OwnerUserId="6448" LastEditorUserId="467" LastEditDate="2013-11-07T08:10:48.570" LastActivityDate="2014-11-07T08:42:59.597" Title="What is the stochastic differential of a general semimartingale?" Tags="&lt;option-pricing&gt;&lt;stochastic-calculus&gt;&lt;martingale&gt;&lt;exotics&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9376" PostTypeId="1" CreationDate="2013-11-06T11:09:34.957" Score="1" ViewCount="261" Body="&lt;p&gt;I have a strong statistical background (particularly in Time Series analysis) and previously have spent a lot of time modelling sports, Baseball in particular. After reading &quot;Analysis of Financial Time Series&quot; by Ruey S. Tsay, I have become interested in quantitative finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to know the mentality that quants have when it comes to the stock market. What I mean by this is what is the general idea to be successful. I'm not asking exactly HOW to do it but merely what to focus on. For example to be successful with Baseball modelling I focused on predicting the distribution of competing teams' runs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I saw a comment here by Matt Wolf&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;If I have to summarize my take on financial markets then I would say success has &#xA;everything to do with managing risk in smart ways as well as seizing opportunities in&#xA;times of market inefficiencies and it has very little to nothing to do with forecasting &#xA;the future.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I understand that risk must be managed in smart ways and clearly to make any sort of expected profit, the only way to do this is to capitalise on market inefficiencies. However I do not get the part to do with forecasting the future. Surely this is necessary! Does it mean that success is not about POINT forecasts of the future but instead distributional forecasts e.g. option pricing seems all about distributional forecasting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I took away from it was that you shouldn't try to predict stock movements by some ARMA, ARIMA or a more general dependency equation or have I completely missed the point?&lt;/p&gt;&#xA;" OwnerUserId="6443" LastActivityDate="2013-11-06T11:48:58.660" Title="Quantitative finance mentality for success" Tags="&lt;quant-trading-strategies&gt;&lt;fundamentals&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2013-11-06T12:46:16.027" ContentLicense="CC BY-SA 3.0" />
  <row Id="9377" PostTypeId="2" ParentId="9376" CreationDate="2013-11-06T11:41:39.733" Score="4" Body="&lt;p&gt;This is a very subjective question. One thing you need to understand is that there are many types of quants and it is not always about predicting the future returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many quantitative analysts are involved in market-making, this is where you sell products at a slight cost to customers and try to stay more or less neutral to market moves. When you read about most of models that are discussed based on the non-arbitrage principle and replication, these models are used to find the fair price to quote to the customer. To simplify, it does not matter if the price will realise statistically if you can replicate the price via a hedge as the cost of the product will be the cost of the hedge. Most of the option models used for pricing are about finding a sensible interpolation/extrapolation for maturities/strikes that are not liquid in the market and producing hedges to manage the risk in order to lock the customer's margin.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some other people are involved in proprietary strategies, this is what most of people not working in finance believe that traders are doing: making money out of the market. Even in this topic, people are not always using forecasts, you could be using arbitrages where by using a combination of trades you could be locking money. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However it is true that some quants or traders will try to forecast a relationship, it could be anything like a pairs to trade which is statistically mean reverting, a relationship that leads to abnormal positive returns, noticing that the series has momentum, using regime switching to find periods where the momentum exists, ... etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So even though you could specialise in forecasts, there are other ways to make money out of the market. &lt;/p&gt;&#xA;" OwnerUserId="2908" LastEditorUserId="2908" LastEditDate="2013-11-06T11:48:58.660" LastActivityDate="2013-11-06T11:48:58.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9378" PostTypeId="2" ParentId="9346" CreationDate="2013-11-06T13:35:39.193" Score="1" Body="&lt;p&gt;Optimal value of n should be calculated based on how much amount you want to invest in that decision, that can be for example 200 000 of base currency, and minimum order size is 10 000 of base currency then you should have 200 000 / 10 000 = 20 orders in my opinion that are targeted at hotspots where is most single price points inside interval.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: When you have one target interval, I suggest split price range by orders amount.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you want target interval: .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;lr = 16.91;&#xA;rr = 16.97;&#xA;n = 20;&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;r = rr - lr = 16.97 - 16.91 = 0.06&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;step = r / n =  0.06 / 20 = 0.003&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;Order [Idx] =Idx * step + lr&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;eg.&#xA;Order [2] = 2 * 0.003 + lr = 16.916&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="6175" LastEditorUserId="6175" LastEditDate="2013-11-07T11:30:37.330" LastActivityDate="2013-11-07T11:30:37.330" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9379" PostTypeId="2" ParentId="2820" CreationDate="2013-11-06T16:50:30.407" Score="8" Body="&lt;p&gt;In the academic literature it is extremely widely applied in the last 20 years. I would estimate maybe 200 empirical papers, or more. For example a common finding is that higher frequency (daily) wavelet correlations have been high since 2007, attributable either to increasing financial interation or the financial crisis. It is also popular to estimate the time-varying variance as a non-parametric alternative to GARCH models. There are costs and benefits to this, sometimes we want to impose a hypothesis of a functional form onto the data if we have pre-existing knowledge we want to incorporate to improve generalisation of our estimate, or to ensure we are not fitting noise. You can also combine the two approaches; wavelets for the pass band filter and a parametric model for the volatility estimates. This will bais your test though. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically wavelet analysis and not Fourier analysis is popular due to the non-stationarity of the mean and variance in the time domain and other characeristics that vary in the frequency domain over time. Fitting a linear combination of trig basis functions is just not going to give you good results in finance. Autocorrelation also varies in the frequency domain. It is also prefered to STFT so that we do not have to assume stationarity within a time-band. Wavelets are intuitively nice with typical process assumptions in stochastic finance that assume a fractal like property of the price process (stemming from the assumption that our price is some function of a Wiener process). This is incorrect in practice due to phenomena such as the Epps effect and the discreteness of markets imposed by latency and microstructure, but for the time scales of interest to empirical researchers it is acceptable. Indeed these ultra high frequency crystals are generally not estimated for both computation and redundancy reasons (yet there are some papers; the unbiasedness of the white noise hypothesis test I am unsure of). Another reason is that Datastream and Bloomberg are the go-to databases and they are shocking for high frequency data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other findings surround frequency-dependent Granger causality testing, changepoint analysis and other analyses.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is also commonly used to analyse lead-lag relationships through the phase difference in the Morlet wavelet; since the complex sinusoid is fit you can compare the real and imaginary parts of the cofficient through the inverse tangent function to get a phase difference. This isn't a causal wavelet though so you will not be able to construct a time-frequency localised pair trading strategy with this unless your strategy can tolerate the edge effects, which I find to be highly dubious. Also, this is just for the bivariate setting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All in all, good if your goal is to get a qualitative understanding of interrelationships and correlations in the past, not necessarily good if you are trying to extrapolate into the future since it is &lt;em&gt;not&lt;/em&gt; built to be able to generalise. However, you can use it as part of something else if you want to extrapolate, but I am not allowed to share this.&lt;/p&gt;&#xA;" OwnerUserId="6081" LastEditorUserId="6081" LastEditDate="2013-11-06T16:56:39.283" LastActivityDate="2013-11-06T16:56:39.283" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9380" PostTypeId="1" CreationDate="2013-11-06T18:19:54.287" Score="10" ViewCount="4644" Body="&lt;p&gt;What is the general consensus for using a Cauchy distribution to model stock prices? I can't find much after researching online and wonder if it has been tried and discarded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My motivation is to find a distribution for the stochastic process governing infinitesimally small stock price movements $\Delta W_t$. The standard process used is the Wiener process depending on a normal random variable $\epsilon$ i.e. $\Delta W_t = \epsilon \sqrt{t}$. This results in the problem that resulting prices are normally distributed, but it is well known that stock prices have heavier tails than that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact it seems that if $\epsilon$ follows any finite variance distribution, it will result in normally distributed prices by the CLT.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am therefore looking for a stable distribution to model stock prices and the Cauchy immediately came to mind.&lt;/p&gt;&#xA;" OwnerUserId="6443" LastActivityDate="2021-02-12T08:31:55.657" Title="Consensus on Cauchy distribution for stock prices" Tags="&lt;option-pricing&gt;&lt;distribution&gt;&lt;brownian-motion&gt;" AnswerCount="8" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9381" PostTypeId="2" ParentId="9380" CreationDate="2013-11-06T19:10:45.997" Score="3" Body="&lt;p&gt;Maybe this could also be a comment but I think an it is not possible to answer this question with a 'yes and here is how you do it'.&lt;/p&gt;&#xA;&lt;p&gt;It has been tried, e.g. by me for a university research project. In this research we focused primarily on aggregation of returns and the main problem was the tractability of the resulting distributions and expressions, also when using, for example, the Student's &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt;. Note that the idea is rather obvious and lots of people must have played with it. If it works well, we would probably know by now. I guess that's the reason our professor was immediately skeptical about this approach and I can only say he was right.&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="848" LastEditDate="2021-02-12T08:31:55.657" LastActivityDate="2021-02-12T08:31:55.657" CommentCount="7" ContentLicense="CC BY-SA 4.0" />
  <row Id="9382" PostTypeId="1" AcceptedAnswerId="9385" CreationDate="2013-11-06T21:01:50.863" Score="2" ViewCount="161" Body="&lt;p&gt;During pre-open When checking the depth of one particularly bullish stock I am following (NZE:XRO went up 200% this year and 12% yesterday) I saw that the BUYs were much higher than the  ASKs by about 10%. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/pRGbs.png&quot; alt=&quot;XRO depth chart with a reverse spread&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What would happen at market open?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does the highest BUY get their trades in first (and at what price) &#xA;OR whoever placed their order first (and at what price)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Presumably some traders would cancel and re-place their order right before open.&#xA;Some of them may be placing orders to influence the price with no intention of letting those orders actually trade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it would be possible for there to be a reverse spread at market open.&#xA;(Say some one thinks the bubble is going to burst and just wants out so placed the order just before market close and is on a flight so can't change that now, while the demand has increased overnight and some are willing to trade at a higher price and willing to have a premium BUY price to get in on the game before the price goes even higher)&lt;/p&gt;&#xA;" OwnerUserId="6452" LastEditorUserId="6452" LastEditDate="2013-11-06T21:26:44.983" LastActivityDate="2013-11-07T06:39:38.837" Title="What happens at market open when there is a reverse spread during preopen?" Tags="&lt;market&gt;&lt;spread&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9384" PostTypeId="2" ParentId="9369" CreationDate="2013-11-07T02:39:52.083" Score="3" Body="&lt;p&gt;Maximizing expected return while minimizing risk is at the heart of the quantitative revolution in finance in &lt;a href=&quot;http://en.wikipedia.org/wiki/Modern_portfolio_theory&quot; rel=&quot;nofollow&quot;&gt;modern portfolio theory&lt;/a&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Starting with Harry Markowitz (1952) &lt;a href=&quot;http://www.jstor.org/discover/10.2307/2975974?uid=2&amp;amp;uid=4&amp;amp;sid=21102880396707&quot; rel=&quot;nofollow&quot;&gt;&quot;Portfolio Selection&quot;&lt;/a&gt;, a huge portion of quantitative finance is dedicated to refining the ideas around mean-variance portfolio optimization.  The objective is to find a weight vector $w$ that will minimize:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$w^T \Sigma w$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;subject to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R^T w = \mu$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When evaluating performance, &lt;a href=&quot;http://en.wikipedia.org/wiki/Sharpe_ratio&quot; rel=&quot;nofollow&quot;&gt;the Sharpe ratio&lt;/a&gt; is the most widely used performance measure, and it directly (if a little crude) addresses the trade-off between risk and reward. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S = \frac{E[R-R_f]}{\sqrt{\mathrm{var}[R]}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recommend reading Peter Bernstein's &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0471731749&quot; rel=&quot;nofollow&quot;&gt;&quot;Capital Ideas&quot;&lt;/a&gt; as a gentle introduction to this subject.&lt;/p&gt;&#xA;" OwnerUserId="17" LastEditorUserId="17" LastEditDate="2013-11-07T02:47:49.883" LastActivityDate="2013-11-07T02:47:49.883" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9385" PostTypeId="2" ParentId="9382" CreationDate="2013-11-07T06:39:38.837" Score="4" Body="&lt;p&gt;This is known as a 'crossed' book, the exchange will attempt to uncross the book at the price at which the maximum amount of volume can trade. In your example at the price of 42 there's only 3533 amount of buying quantity, and there are more than enough sellers to cover this. At a price of 40, there's now 3533+425 buying quantity willing to trade, and still enough sellers to cover. If we continue with this approach you get something like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/xQnAj.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, the maximum volume occurs at 38.50. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there are multiple prices (there can be 2 prices that are equally valid) that would cause the same volume to trade, they will pick the price that deviates the least from some kind of reference price (typically last traded from the day before, but might be adjusted due to dividends, etc)&lt;/p&gt;&#xA;" OwnerUserId="6453" LastActivityDate="2013-11-07T06:39:38.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9386" PostTypeId="2" ParentId="9309" CreationDate="2013-11-07T11:46:01.793" Score="2" Body="&lt;p&gt;It seems to me that you want to use the series of option prices to estimate the Sharpe ratio given the option prices in your sample. If so, the idea is to realise that for each option price you have at different times $t_1, t_2, ...$ you could actually close the position and realise the profit or loss. So, basically if you have the option prices you just compute the return as if you would close the position at that time. This way you obtain the evolution of the returns from which you get your average return R. On these returns you can also compute the standard deviation $\sigma_r$ and what's left is to compute the Sharpe ratio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess this is some kind of homework and you are not working with real money because the method above is not that sound. Anyway, I hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="5333" LastActivityDate="2013-11-07T11:46:01.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9388" PostTypeId="2" ParentId="9380" CreationDate="2013-11-07T15:01:38.083" Score="1" Body="&lt;p&gt;I have not tried it myself but if i may be allowed to forward you to a link of a particular filter sold as an indicator called the &lt;a href=&quot;http://www.jurikres.com/faq/faq_ama.htm&quot; rel=&quot;nofollow&quot;&gt;Jurik MA&lt;/a&gt;. If you check the link, there is a quote where they mention `&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;What we mean by a random walk is a time series produced by a cumulative sum of 5000 zero-mean, Cauchy distributed random numbers.`&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also this is supposed to be one of the better moving averages. So i guess this is a successful use of the Cauchy distribution. Apart from this I guess its mostly found in theory than in practice.&lt;/p&gt;&#xA;" OwnerUserId="6289" LastActivityDate="2013-11-07T15:01:38.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9389" PostTypeId="2" ParentId="1640" CreationDate="2013-11-07T19:05:30.107" Score="-3" Body="&lt;p&gt; easy2data financial section&#xA;With list of hang seng companies,nasdaq companies,cac 40 companies, S&amp;amp;P asia 50 companies etc...&lt;/p&gt;&#xA;" OwnerUserId="6459" LastActivityDate="2013-11-07T19:05:30.107" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9392" PostTypeId="1" CreationDate="2013-11-07T23:41:08.587" Score="8" ViewCount="1220" Body="&lt;p&gt;Suppose $B(t)$ is a standard Brownian motion, and $B_{1}(t)$ is given by &#xA; $dB_{1}(t)=\mu dt+dB(t)$. Suppose $P$ is the Wiener measure induced by $B(t)$ on the $C[0,\infty)$, and $P_{1}$ is the Law induced by $B_{1}(t)$ on $C[0,\infty)$. Here we follow the definitions of law is referred to  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://math.stackexchange.com/questions/90268/how-is-the-law-of-a-stochastic-process-defined/557519#557519&quot;&gt;https://math.stackexchange.com/questions/90268/how-is-the-law-of-a-stochastic-process-defined/557519#557519&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to Girsanov theorem ( for example, P155. Thereom 8.6.3 in Fifth Edtion, Stochastic Differential Equations: An introduction with Application), there exists a Law $Q$ such that $B_{1}(t)$ is a standard Brownian motion under $Q$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is $Q$ equal to $P_{1}$ ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought they are not equal to each other. The reason is that for fixed time $t$ the expectation of $B_{1}(t)$ under $Q$ is 0, and under $P_{1}$ its expectation should be $\mu t$. &#xA;  If my derivation is wrong, please point out where is my mistake. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I am correct, a new question is how to compute $\frac{d P_{1}}{dP}$? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recall that $\frac{d Q}{dP}$ is given by Girsanov theorem. Any references are very appreciated.  &lt;/p&gt;&#xA;" OwnerUserId="6460" LastEditorUserId="-1" LastEditorDisplayName="user1157" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2014-10-15T00:57:55.467" Title="How to compute the Radon-Nikodym derivative?" Tags="&lt;stochastic-processes&gt;&lt;brownian-motion&gt;&lt;girsanov&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9393" PostTypeId="2" ParentId="9392" CreationDate="2013-11-07T23:55:38.827" Score="2" Body="&lt;p&gt;No, that's the point of Girsanov's theorem. If $Q$ is equal to $P_1$, then nothing has changed. In order to make $B_1(t)$ a standard BM we need to transition to a new Law. Namely, $Q$. &lt;/p&gt;&#xA;" OwnerUserId="5176" LastActivityDate="2013-11-07T23:55:38.827" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9394" PostTypeId="2" ParentId="8875" CreationDate="2013-11-08T00:02:56.057" Score="3" Body="&lt;p&gt;Saying that you can't analyze something as is does not make it garbage. You can't eat flour &quot;as-is&quot;, but that doesn't mean you throw it out. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to use &quot;standard&quot; analysis tools, you must first transform the series into something compatible. Some examples of such a transformation include k-th order differences or a log transformation. These transformations allow one to analyze the data, while not losing the essence of the data. &lt;/p&gt;&#xA;" OwnerUserId="5176" LastActivityDate="2013-11-08T00:02:56.057" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9395" PostTypeId="2" ParentId="7950" CreationDate="2013-11-08T00:21:53.970" Score="3" Body="&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0471733873&quot; rel=&quot;nofollow&quot;&gt;This book&lt;/a&gt; goes through exactly this problem in quite detail (with C++ codes included). I've worked through it in the past, but can't sum it up off the top of my head. &lt;/p&gt;&#xA;" OwnerUserId="5176" LastActivityDate="2013-11-08T00:21:53.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9396" PostTypeId="1" CreationDate="2013-11-08T13:08:07.763" Score="5" ViewCount="276" Body="&lt;p&gt;Under the Longstaff-Schwartz LSM method for an American call, how should I account for a continuous dividend paying stock? I assume that it'll needs to be accounted for when simulating the underlying GBM stock paths but is there anywhere else where it differs from the LSM on a non-dividend paying stock? &lt;/p&gt;&#xA;" OwnerUserId="6467" LastActivityDate="2013-11-08T13:08:07.763" Title="LSM American Option pricing with dividends" Tags="&lt;american-options&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9397" PostTypeId="1" AcceptedAnswerId="9404" CreationDate="2013-11-08T13:45:15.587" Score="3" ViewCount="1585" Body="&lt;p&gt;C++ code taken from &lt;a href=&quot;http://quantlib.org/reference/_bonds_8cpp-example.html&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;code&gt;Bonds.cpp&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; and slightly amended:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#include &amp;lt;ql/quantlib.hpp&amp;gt;&#xA;#include &amp;lt;boost/timer.hpp&amp;gt;&#xA;#include &amp;lt;iostream&amp;gt;&#xA;#include &amp;lt;iomanip&amp;gt;&#xA;&#xA;using namespace QuantLib;&#xA;&#xA;int main(int, char* []) {&#xA;&#xA;    try {&#xA;&#xA;        // Just a couple of parameters&#xA;&#xA;        Calendar calendar = TARGET();&#xA;        Date settlementDate(18, September, 2008);&#xA;        settlementDate = calendar.adjust(settlementDate);&#xA;        Integer fixingDays = 3;&#xA;        Natural settlementDays = 3;&#xA;        Date todaysDate = calendar.advance(settlementDate, -fixingDays, Days);&#xA;        Settings::instance().evaluationDate() = todaysDate;&#xA;&#xA;        /* Now let's introduce two curves: the first one is a swap curve built from &#xA;        deposits and IRS, the second one is a credit spread curve which should be &#xA;        added to the former one to get a proper yield curve */&#xA;&#xA;        // Swap curve&#xA;&#xA;        DayCounter termStructureDayCounter = ActualActual(ActualActual::ISDA);&#xA;        double tolerance = 1.0e-5;&#xA;&#xA;        // Deposits&#xA;&#xA;        Rate d1wQuote = 0.043375;&#xA;        Rate d1mQuote = 0.031875;&#xA;        Rate d3mQuote = 0.0320375;&#xA;        Rate d6mQuote = 0.03385;&#xA;        Rate d9mQuote = 0.0338125;&#xA;        Rate d1yQuote = 0.0335125;&#xA;&#xA;        boost::shared_ptr&amp;lt;Quote&amp;gt; d1wRate(new SimpleQuote(d1wQuote));&#xA;        boost::shared_ptr&amp;lt;Quote&amp;gt; d1mRate(new SimpleQuote(d1mQuote));&#xA;        boost::shared_ptr&amp;lt;Quote&amp;gt; d3mRate(new SimpleQuote(d3mQuote));&#xA;        boost::shared_ptr&amp;lt;Quote&amp;gt; d6mRate(new SimpleQuote(d6mQuote));&#xA;        boost::shared_ptr&amp;lt;Quote&amp;gt; d9mRate(new SimpleQuote(d9mQuote));&#xA;        boost::shared_ptr&amp;lt;Quote&amp;gt; d1yRate(new SimpleQuote(d1yQuote));&#xA;&#xA;        // IRS&#xA;&#xA;        Rate s2yQuote = 0.0295;&#xA;        Rate s3yQuote = 0.0323;&#xA;        Rate s5yQuote = 0.0359;&#xA;        Rate s10yQuote = 0.0412;&#xA;        Rate s15yQuote = 0.0433;&#xA;&#xA;        boost::shared_ptr&amp;lt;Quote&amp;gt; s2yRate(new SimpleQuote(s2yQuote));&#xA;        boost::shared_ptr&amp;lt;Quote&amp;gt; s3yRate(new SimpleQuote(s3yQuote));&#xA;        boost::shared_ptr&amp;lt;Quote&amp;gt; s5yRate(new SimpleQuote(s5yQuote));&#xA;        boost::shared_ptr&amp;lt;Quote&amp;gt; s10yRate(new SimpleQuote(s10yQuote));&#xA;        boost::shared_ptr&amp;lt;Quote&amp;gt; s15yRate(new SimpleQuote(s15yQuote));&#xA;&#xA;        // Rate Helper&#xA;&#xA;        // Deposits&#xA;        DayCounter depositDayCounter = Actual360();&#xA;&#xA;        boost::shared_ptr&amp;lt;RateHelper&amp;gt; d1w(new DepositRateHelper(&#xA;                Handle&amp;lt;Quote&amp;gt;(d1wRate),&#xA;                1*Weeks, fixingDays,&#xA;                calendar, ModifiedFollowing,&#xA;                true, depositDayCounter));&#xA;        boost::shared_ptr&amp;lt;RateHelper&amp;gt; d1m(new DepositRateHelper(&#xA;                Handle&amp;lt;Quote&amp;gt;(d1mRate),&#xA;                1*Months, fixingDays,&#xA;                calendar, ModifiedFollowing,&#xA;                true, depositDayCounter));&#xA;        boost::shared_ptr&amp;lt;RateHelper&amp;gt; d3m(new DepositRateHelper(&#xA;                Handle&amp;lt;Quote&amp;gt;(d3mRate),&#xA;                3*Months, fixingDays,&#xA;                calendar, ModifiedFollowing,&#xA;                true, depositDayCounter));&#xA;        boost::shared_ptr&amp;lt;RateHelper&amp;gt; d6m(new DepositRateHelper(&#xA;                Handle&amp;lt;Quote&amp;gt;(d6mRate),&#xA;                6*Months, fixingDays,&#xA;                calendar, ModifiedFollowing,&#xA;                true, depositDayCounter));&#xA;        boost::shared_ptr&amp;lt;RateHelper&amp;gt; d9m(new DepositRateHelper(&#xA;                Handle&amp;lt;Quote&amp;gt;(d9mRate),&#xA;                9*Months, fixingDays,&#xA;                calendar, ModifiedFollowing,&#xA;                true, depositDayCounter));&#xA;        boost::shared_ptr&amp;lt;RateHelper&amp;gt; d1y(new DepositRateHelper(&#xA;                Handle&amp;lt;Quote&amp;gt;(d1yRate),&#xA;                1*Years, fixingDays,&#xA;                calendar, ModifiedFollowing,&#xA;                true, depositDayCounter));&#xA;&#xA;        // Setup IRS&#xA;        Frequency swFixedLegFrequency = Annual;&#xA;        BusinessDayConvention swFixedLegConvention = Unadjusted;&#xA;        DayCounter swFixedLegDayCounter = Thirty360(Thirty360::European);&#xA;        boost::shared_ptr&amp;lt;IborIndex&amp;gt; swFloatingLegIndex(new Euribor6M);&#xA;&#xA;        const Period forwardStart(1*Days);&#xA;&#xA;        boost::shared_ptr&amp;lt;RateHelper&amp;gt; s2y(new SwapRateHelper(&#xA;                Handle&amp;lt;Quote&amp;gt;(s2yRate), 2*Years,&#xA;                calendar, swFixedLegFrequency,&#xA;                swFixedLegConvention, swFixedLegDayCounter,&#xA;                swFloatingLegIndex, Handle&amp;lt;Quote&amp;gt;(),forwardStart));&#xA;        boost::shared_ptr&amp;lt;RateHelper&amp;gt; s3y(new SwapRateHelper(&#xA;                Handle&amp;lt;Quote&amp;gt;(s3yRate), 3*Years,&#xA;                calendar, swFixedLegFrequency,&#xA;                swFixedLegConvention, swFixedLegDayCounter,&#xA;                swFloatingLegIndex, Handle&amp;lt;Quote&amp;gt;(),forwardStart));&#xA;        boost::shared_ptr&amp;lt;RateHelper&amp;gt; s5y(new SwapRateHelper(&#xA;                Handle&amp;lt;Quote&amp;gt;(s5yRate), 5*Years,&#xA;                calendar, swFixedLegFrequency,&#xA;                swFixedLegConvention, swFixedLegDayCounter,&#xA;                swFloatingLegIndex, Handle&amp;lt;Quote&amp;gt;(),forwardStart));&#xA;        boost::shared_ptr&amp;lt;RateHelper&amp;gt; s10y(new SwapRateHelper(&#xA;                Handle&amp;lt;Quote&amp;gt;(s10yRate), 10*Years,&#xA;                calendar, swFixedLegFrequency,&#xA;                swFixedLegConvention, swFixedLegDayCounter,&#xA;                swFloatingLegIndex, Handle&amp;lt;Quote&amp;gt;(),forwardStart));&#xA;        boost::shared_ptr&amp;lt;RateHelper&amp;gt; s15y(new SwapRateHelper(&#xA;                Handle&amp;lt;Quote&amp;gt;(s15yRate), 15*Years,&#xA;                calendar, swFixedLegFrequency,&#xA;                swFixedLegConvention, swFixedLegDayCounter,&#xA;                swFloatingLegIndex, Handle&amp;lt;Quote&amp;gt;(),forwardStart));&#xA;&#xA;&#xA;        // A depo-swap curve&#xA;        std::vector&amp;lt;boost::shared_ptr&amp;lt;RateHelper&amp;gt; &amp;gt; depoSwapInstruments;&#xA;        depoSwapInstruments.push_back(d1w);&#xA;        depoSwapInstruments.push_back(d1m);&#xA;        depoSwapInstruments.push_back(d3m);&#xA;        depoSwapInstruments.push_back(d6m);&#xA;        depoSwapInstruments.push_back(d9m);&#xA;        depoSwapInstruments.push_back(d1y);&#xA;        depoSwapInstruments.push_back(s2y);&#xA;        depoSwapInstruments.push_back(s3y);&#xA;        depoSwapInstruments.push_back(s5y);&#xA;        depoSwapInstruments.push_back(s10y);&#xA;        depoSwapInstruments.push_back(s15y);&#xA;        boost::shared_ptr&amp;lt;YieldTermStructure&amp;gt; depoSwapTermStructure(&#xA;                new PiecewiseYieldCurve&amp;lt;Discount,LogLinear&amp;gt;(&#xA;                        settlementDate, depoSwapInstruments,&#xA;                        termStructureDayCounter,&#xA;                        tolerance));&#xA;&#xA;        return 0;&#xA;&#xA;    } catch (std::exception&amp;amp; e) {&#xA;        std::cerr &amp;lt;&amp;lt; e.what() &amp;lt;&amp;lt; std::endl;&#xA;        return 1;&#xA;    } catch (...) {&#xA;        std::cerr &amp;lt;&amp;lt; &quot;unknown error&quot; &amp;lt;&amp;lt; std::endl;&#xA;        return 1;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I'm not wrong, so far we've been obtaining a kind of risk free discount curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let me to introduce an additional credit spread curve in the form of an object handled by &lt;code&gt;RateHelper&lt;/code&gt; (kinda snippet to be inserted after the depo-swap curve of the code above):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;        ...&#xA;        Rate d1ySpread = 0.013;&#xA;        Rate d2ySpread = 0.011;&#xA;        Rate d3ySpread = 0.022;&#xA;        Rate d6ySpread = 0.0238;&#xA;        Rate d9ySpread = 0.0238;&#xA;        Rate d10ySpread = 0.0239;&#xA;&#xA;        boost::shared_ptr&amp;lt;Quote&amp;gt; d1ySpreadRate(new SimpleQuote(d1ySpread));&#xA;        boost::shared_ptr&amp;lt;Quote&amp;gt; d2ySpreadRate(new SimpleQuote(d2ySpread));&#xA;        boost::shared_ptr&amp;lt;Quote&amp;gt; d3ySpreadRate(new SimpleQuote(d3ySpread));&#xA;        boost::shared_ptr&amp;lt;Quote&amp;gt; d6ySpreadRate(new SimpleQuote(d6ySpread));&#xA;        boost::shared_ptr&amp;lt;Quote&amp;gt; d9ySpreadRate(new SimpleQuote(d9ySpread));&#xA;        boost::shared_ptr&amp;lt;Quote&amp;gt; d10ySpreadRate(new SimpleQuote(d10ySpread));&#xA;&#xA;        boost::shared_ptr&amp;lt;RateHelper&amp;gt; credit1y(new SwapRateHelper(&#xA;                Handle&amp;lt;Quote&amp;gt;(d1ySpreadRate), 1*Years,&#xA;                calendar, swFixedLegFrequency,&#xA;                swFixedLegConvention, swFixedLegDayCounter,&#xA;                swFloatingLegIndex, Handle&amp;lt;Quote&amp;gt;(),forwardStart));&#xA;        boost::shared_ptr&amp;lt;RateHelper&amp;gt; credit2y(new SwapRateHelper(&#xA;                Handle&amp;lt;Quote&amp;gt;(d2ySpreadRate), 2*Years,&#xA;                calendar, swFixedLegFrequency,&#xA;                swFixedLegConvention, swFixedLegDayCounter,&#xA;                swFloatingLegIndex, Handle&amp;lt;Quote&amp;gt;(),forwardStart));&#xA;        boost::shared_ptr&amp;lt;RateHelper&amp;gt; credit3y(new SwapRateHelper(&#xA;                Handle&amp;lt;Quote&amp;gt;(d3ySpreadRate), 3*Years,&#xA;                calendar, swFixedLegFrequency,&#xA;                swFixedLegConvention, swFixedLegDayCounter,&#xA;                swFloatingLegIndex, Handle&amp;lt;Quote&amp;gt;(),forwardStart));&#xA;        boost::shared_ptr&amp;lt;RateHelper&amp;gt; credit6y(new SwapRateHelper(&#xA;                Handle&amp;lt;Quote&amp;gt;(d6ySpreadRate), 6*Years,&#xA;                calendar, swFixedLegFrequency,&#xA;                swFixedLegConvention, swFixedLegDayCounter,&#xA;                swFloatingLegIndex, Handle&amp;lt;Quote&amp;gt;(),forwardStart));&#xA;        boost::shared_ptr&amp;lt;RateHelper&amp;gt; credit9y(new SwapRateHelper(&#xA;                Handle&amp;lt;Quote&amp;gt;(d9ySpreadRate), 9*Years,&#xA;                calendar, swFixedLegFrequency,&#xA;                swFixedLegConvention, swFixedLegDayCounter,&#xA;                swFloatingLegIndex, Handle&amp;lt;Quote&amp;gt;(),forwardStart));&#xA;        boost::shared_ptr&amp;lt;RateHelper&amp;gt; credit10y(new SwapRateHelper(&#xA;                Handle&amp;lt;Quote&amp;gt;(d10ySpreadRate), 10*Years,&#xA;                calendar, swFixedLegFrequency,&#xA;                swFixedLegConvention, swFixedLegDayCounter,&#xA;                swFloatingLegIndex, Handle&amp;lt;Quote&amp;gt;(),forwardStart));&#xA;&#xA;        std::vector&amp;lt;boost::shared_ptr&amp;lt;RateHelper&amp;gt; &amp;gt; creditInstruments;&#xA;        creditInstruments.push_back(credit1y);&#xA;        creditInstruments.push_back(credit2y);&#xA;        creditInstruments.push_back(credit3y);&#xA;        creditInstruments.push_back(credit6y);&#xA;        creditInstruments.push_back(credit9y);&#xA;        creditInstruments.push_back(credit10y);&#xA;        boost::shared_ptr&amp;lt;YieldTermStructure&amp;gt; creditTermStructure(&#xA;                new PiecewiseYieldCurve&amp;lt;Discount,LogLinear&amp;gt;(&#xA;                        settlementDate, creditInstruments,&#xA;                        termStructureDayCounter,&#xA;                        tolerance));&#xA;        ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The object &lt;code&gt;creditTermStructure&lt;/code&gt; could represent, as instance, a CDS spread curve, or such a term structure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having both the &lt;code&gt;depoSwapTermStructure&lt;/code&gt; and the &lt;code&gt;creditTermStructure&lt;/code&gt; built by the code above, I would like to produce a new object of class &lt;code&gt;YieldTermStructure&lt;/code&gt; by summing &lt;code&gt;depoSwapTermStructure&lt;/code&gt; and &lt;code&gt;creditTermStructure&lt;/code&gt; taking into account the misaligned time knots, that is, the code must sum the rates by the appropriate tenors (1Y depo-swap + 1Y credit spread, 2Y depo-swap + 2Y credit spread... and so on. As of the lacking credit spread maturities, such as 18Y, it should be interpolate known knots).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How is it possible to do such a thing using &lt;strong&gt;QuantLib&lt;/strong&gt;?&lt;/p&gt;&#xA;" OwnerUserId="3058" LastActivityDate="2013-11-09T10:45:09.433" Title="How to sum interest rate curves in QuantLib" Tags="&lt;interest-rates&gt;&lt;programming&gt;&lt;yield-curve&gt;&lt;quantlib&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9398" PostTypeId="2" ParentId="8483" CreationDate="2013-11-08T14:55:40.517" Score="2" Body="&lt;p&gt;Recovery rates are rarely &quot;modeled&quot; &lt;em&gt;per se&lt;/em&gt;, in the sense that most practitioners avoid treating them as random variables.  I doubt you want to buck that trend here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As jeff m implies in the comments, it's the cash flow that you really want to know about, so you'll find it more useful to think in terms of the mechanism behind recovery.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the issuer defaults, there's going to be a court case, and a whole bunch of lawyers are going to negotiate, under the supervision of a judge, who gets what from the remaining firm assets.  Around that time, experts in distressed debt will presumably be trading this bond based on their best guess as to the outcome of those negotiations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, what will this bond look like as a claim in those negotiations?  Well, normal bonds are often issued such that the coupon more-or-less compensates for default risk and time value of money, so as a shorthand practitioners think of the non-default value of the bond as being equal to the notional, and that's the number that influences recovery cash flow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Savvy players will know that this bond becomes worth much less over time, so you can expect the notional won't be accepted as a baseline.  Instead it will probably be viewed as future cashflows, discounted by a rate somewhere between risk-free and risky.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is all a roundabout way of saying that I would tend to take a recovery rate $\delta$ as usual, but include a risky discount rate $z$, and then set the recovery value of the instrument, conditional on default at time $\tau$ as the time-dependent value&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\sum_{n \ni t_n&amp;gt;\tau} \delta\cdot c_n\cdot \exp\left( -\int_\tau^{t_n} z(s)ds\right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in my pricing formulas.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2013-11-08T14:55:40.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9400" PostTypeId="1" CreationDate="2013-11-08T16:04:57.323" Score="4" ViewCount="424" Body="&lt;p&gt;I have calculated a hedge ratio that generates a mean reverting spread (stationary, without trends) 60-70% of the time. But the remaining 30% of the time, it seems like there is a trend in the spread. How do I handle such a case? Is there a way to account for that or make the spread stationary without trends?&lt;/p&gt;&#xA;" OwnerUserId="6471" LastActivityDate="2013-11-08T16:04:57.323" Title="pairs trading detrend the spread" Tags="&lt;pairs-trading&gt;&lt;spread&gt;&lt;hedge&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9402" PostTypeId="1" CreationDate="2013-11-09T03:10:38.117" Score="8" ViewCount="1130" Body="&lt;p&gt;I know long duration bonds, on a a single bond basis, exhibit convexity however do treasury futures prices and the 10 yr yield exhibit the same property? Below is a plot of continious ten year treasury futures (ZN contract)since 2003, where the Y-Axis is the price of ZN futures and the X-Axis is the yield/interest rates on the 10 year. While there should be a non-linear relationship between bond price and yield for a single bond, that doesn't seem to be the case when looking at the futures price/yield relationship. Why??&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Rin6J.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/p&gt;&#xA;" OwnerUserId="4729" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2014-02-21T12:01:10.650" Title="Bond Convexity Treasuries Futures" Tags="&lt;fixed-income&gt;&lt;convexity&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9403" PostTypeId="1" AcceptedAnswerId="9424" CreationDate="2013-11-09T10:37:21.317" Score="3" ViewCount="211" Body="&lt;p&gt;A trading system has $n$ colocated uplinks to TCP order entry gateways $g_1, \dots, g_n$ on a given exchange. Each gateway $g_i$ has a different order entry delay function $d_i(t)$ as a function of time $t$. (Note that I don't explicitly know the $d_i(t)$.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The game is to build a sample function $S(t)$ which picks a gateway $g_i$ minimising order entry delay at time $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What realtime statistical tests can be applied to the gateways to build a good sampling function $S$? (With TCP, it's easy to measure round-trip times since every message is ACKed.)&lt;/p&gt;&#xA;" OwnerUserId="3098" LastEditorUserId="3098" LastEditDate="2013-11-11T13:17:07.910" LastActivityDate="2013-11-11T16:10:33.947" Title="Mitigating gateway delay" Tags="&lt;high-frequency&gt;&lt;order-handling&gt;&lt;latency&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9404" PostTypeId="2" ParentId="9397" CreationDate="2013-11-09T10:45:09.433" Score="6" Body="&lt;p&gt;There's no class at this time to add two curves as you want, but it won't be much difficult to write it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The closest you'll get in the library is the &lt;code&gt;ZeroSpreadedTermStructure&lt;/code&gt; class, that shows the general idea: it inherits from &lt;code&gt;YieldTermStructure&lt;/code&gt; (by way of &lt;code&gt;ZeroYieldStructure&lt;/code&gt;) takes a &lt;code&gt;YieldTermStructure&lt;/code&gt; and a spread (constant, in this case) and override its own methods so that they return the sum of the two: for instance,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Rate ZeroSpreadedTermStructure::forwardImpl(Time t) const {&#xA;    return originalCurve_-&amp;gt;forwardRate(t, t, comp_, freq_, true)&#xA;        + spread_-&amp;gt;value();&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In your case, you'll have to write a similar class that takes two &lt;code&gt;Handle&lt;/code&gt;s to &lt;code&gt;YieldTermStructure&lt;/code&gt; instead.  Somewhat surprisingly, this will make your job easier.  You can still take &lt;code&gt;ZeroSpreadedTermStructure&lt;/code&gt; as a model for other tasks such as registering with the needed observers, but all you have to do in this case is inherit from &lt;code&gt;YieldTermStructure&lt;/code&gt; directly and override the single &lt;code&gt;discountImpl&lt;/code&gt; method:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;DiscountFactor YourClass::discountImpl(Time t) const {&#xA;    return baseCurve_-&amp;gt;discount(t, true)&#xA;         * spreadCurve_-&amp;gt;discount(t, true);&#xA;}    &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;since the sum of the rates implies the product of the corresponding discount factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you need more information, a description of the &lt;code&gt;YieldTermStructure&lt;/code&gt; hierarchy and the methods it implements (which is kind of longish to include here) is available at &lt;a href=&quot;http://implementingquantlib.blogspot.com/2013/09/chapter-3-part-2-of-n-yield-term.html&quot;&gt;http://implementingquantlib.blogspot.com/2013/09/chapter-3-part-2-of-n-yield-term.html&lt;/a&gt; and later posts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And of course, once you have your curve working, you're welcome to contribute it to QuantLib. The easier way would be to get a GitHub account and follow the instructions in the readme at &lt;a href=&quot;https://github.com/lballabio/quantlib&quot;&gt;https://github.com/lballabio/quantlib&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2013-11-09T10:45:09.433" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9405" PostTypeId="2" ParentId="9403" CreationDate="2013-11-09T11:47:16.900" Score="0" Body="&lt;p&gt;I think just picking minimum value for $d_i(t)$ will work optimal here, just how calculate that $d()$ function matters more, this can be last order delay from that gateway or some EMA of last X order delays. Important is query each gateway every some amount of time to prevent blocking gateway by one big anomaly delay that prevent $S(t)$ function from selecting that gateway in future.&#xA;$$ S(t) = g(\operatorname{argmin}_g d_g(t)) $$&lt;/p&gt;&#xA;" OwnerUserId="6175" LastActivityDate="2013-11-09T11:47:16.900" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9407" PostTypeId="2" ParentId="9380" CreationDate="2013-11-09T21:35:01.910" Score="1" Body="&lt;p&gt;I think the Cauchy distribution would result in extreme values that are much too large for a stock (asset) price returns.  The stable distribution, $S(\alpha,\beta,\mu,\sigma)$ would likely fit better since it can approximate the Cauchy, normal, t etc. (with skewness) based on its parameters: characteristic exponent $\alpha$, skewness $\beta$, location $\mu$, and scale $\sigma$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding infinite variance problems and use of other distributions, the Laplace and Logistic distributions seem to fit many log-returns for various assets.  Indeed, outliers are always a problem.  &lt;/p&gt;&#xA;" OwnerDisplayName="user6430" LastActivityDate="2013-11-09T21:35:01.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9409" PostTypeId="1" CreationDate="2013-11-09T21:49:04.823" Score="0" ViewCount="808" Body="&lt;p&gt;I am looking for R or Matlab code examples of multi-barrier-options (or multi-barrier reverse convertibles) with at least 3 underlyings. Do you have such code or can you point me to a place where I can find it.&lt;/p&gt;&#xA;" OwnerUserId="6476" LastEditorUserId="467" LastEditDate="2013-11-11T09:57:59.223" LastActivityDate="2013-11-11T09:57:59.223" Title="R or Matlab code for Multi-Barrier-Options (3 or more underlyings)" Tags="&lt;option-pricing&gt;&lt;programming&gt;&lt;exotics&gt;" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9411" PostTypeId="1" CreationDate="2013-11-10T03:19:10.003" Score="2" ViewCount="301" Body="&lt;p&gt;We can seem to get implied vol for a period from now to option expiration, but does anything tell us implied vol for the next trading day ?  Like if fomc is tomorrow the next day implied vol would be much higher.&lt;/p&gt;&#xA;" OwnerUserId="6478" LastActivityDate="2013-11-12T03:46:12.660" Title="How to calculate implied vol for next trading day?" Tags="&lt;implied-volatility&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9413" PostTypeId="1" CreationDate="2013-11-10T18:19:30.593" Score="-1" ViewCount="206" Body="&lt;p&gt;i have been working on this trading system that uses digital filters to generate signals. the system works fine during normal market hours. but it goes haywire when there is news release. i have specifically ensured that all signals generated within 2 hours of a news release be rejected. the problem is how to interpret the signals coming a few minutes after a news release. i was just wondering if there is a way of treating the huge spikes caused due to news release. any insight would be helpful.&#xA;PS: the system trades spot forex.&lt;/p&gt;&#xA;" OwnerUserId="6483" LastActivityDate="2014-09-14T20:36:49.303" Title="interpreting huge jumps" Tags="&lt;digital-signal-processing&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9415" PostTypeId="1" AcceptedAnswerId="9454" CreationDate="2013-11-11T02:27:12.033" Score="1" ViewCount="904" Body="&lt;p&gt;I'm reading Steven N. S. Cheung 's &quot;Economic Explanation&quot; (2001). In vol 2 ch 2 section 2, he mentions Comparative Cost, or &quot;the law of comparative advantage&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;after quoting the britain/spain clothes/wine example of D. Ricardo, he says, &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;... each country has its own comparative advantage, however, this presumes barter or same currency. If there're different currencies and the exchange rate is regulated, in some situation the so-called &quot;Purchasing Power Parity&quot; would not work. ... for example during the 1997 Asian Financial Crisis, almost all Asian countries' currencies depreciated, while HKD was tied to USD, so Hong Kong lost quite some Comparative advantage.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What I don't get is, why currency exchange rate regulation would disable the comparative advantage? Currencies are just agent of trading, exchange rate won't disable the comparative advantage, so exchange rate change shall also not disable it, right?&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2013-11-14T23:36:02.980" Title="the law of comparative advantage and exchange rate" Tags="&lt;fx&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9417" PostTypeId="1" AcceptedAnswerId="9420" CreationDate="2013-11-11T12:36:49.260" Score="0" ViewCount="2692" Body="&lt;p&gt;I have a large list of US equity tickers such as:&#xA;&quot;GIRO&quot;, &quot;ITUB&quot;, &quot;BITA&quot; etc&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and I would like to convert them into their corresponding RIC codes. Do you know how can I do it? I have access to Bloomberg and to Thomson EIKON...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks for your help!&lt;/p&gt;&#xA;" OwnerUserId="6486" LastActivityDate="2013-11-11T14:10:11.243" Title="converting US tickers into Reuters RIC" Tags="&lt;equities&gt;&lt;bloomberg&gt;&lt;reuters&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2013-11-11T15:01:45.087" ContentLicense="CC BY-SA 3.0" />
  <row Id="9418" PostTypeId="1" CreationDate="2013-11-11T13:49:04.347" Score="0" ViewCount="378" Body="&lt;p&gt;I am fitting the t-distribution to log-returns numerically (not using R, MATLAB, Stata, etc.), but rather using general programming.  Assuming the log-return values are $r_t$, and the $t$-variates are $x_t$, then given $r_t=ax_t + b$, and knowing the variance of t-distribution, $\nu/(\nu-2)$, the variance of $r_t$ becomes $\sigma^2(r_t)=a^2(\nu/(\nu-2))$.  Would the parameters to fit for the $r_t$ then be $b$, the location, and $a=\sqrt{\sigma^2(r_t)/(\nu/(\nu-2))}$, where $\sigma(r_t)$ is the measured standard deviation of the observed log-return?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution would be to first initialize $a=1$ and $b=0$ and then calculate &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\hat{r_t}=x_t=\frac{r_t-b}{a}=\frac{r_t-b}{\sqrt{\frac{\sigma^2(r_t)}{\frac{\nu}{\nu-2}}}}&#xA;$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;with minimization of $MSE=\frac{1}{T}\sum_t (r_t-\hat{r}_t)^2$ ?&lt;/p&gt;&#xA;" OwnerDisplayName="user6430" LastEditorDisplayName="user6430" LastEditDate="2015-12-21T15:35:10.930" LastActivityDate="2015-12-21T15:35:10.930" Title="Parameters for numerically fitting t-distribution to log-returns" Tags="&lt;optimization&gt;&lt;numerical-methods&gt;&lt;distribution&gt;&lt;curve-fitting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9419" PostTypeId="2" ParentId="9418" CreationDate="2013-11-11T14:06:41.153" Score="2" Body="&lt;p&gt;It could be much more simple: if you use the method of moments (MM) then you estimate the mean and the variance and for example the kurtosis of your sample. Then you fit the parameters to these statistics.&#xA;Alternatively you use maximum-likelihood (MLE).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For MM: from &lt;a href=&quot;http://en.wikipedia.org/wiki/Student%27s_t-distribution&quot; rel=&quot;nofollow&quot;&gt;wikipedia&lt;/a&gt; you get the mean and the variance. In your notation you can fit $b = \bar{r}$ so $b$ equals the empirical mean. The excess kurtosis is defined &lt;a href=&quot;http://en.wikipedia.org/wiki/Excess_kurtosis#excess_kurtosis&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; and you can solve for the parameter $\nu$ from the estimated kurtosis of $r_t$ without estimating its volatility (if I am not mistaken this cancels out due to the definition). Then you go back and estimate your $a$ from the sample variance and your fitted $\nu$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the MLE you would need to write down the density of $r_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another comment to your proposed method. It is not that far from what I propose. But you don't use higher moments in order to estimate $\nu$. Using the density (MLE) or the kurtosis (MM) you go beyond modelling mean and variance only.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2013-11-11T14:14:39.500" LastActivityDate="2013-11-11T14:14:39.500" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9420" PostTypeId="2" ParentId="9417" CreationDate="2013-11-11T14:10:11.243" Score="1" Body="&lt;p&gt;I think your request is too broad. ITUB, for example is an Italian company and has ADRs traded in several stock exchanges. Hence, if you do search in Eikon, you find multiple tickers for it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And I failed to find critea, which could yield single return value for each tickers you supplied.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used request: =RSearch(&quot;Equity&quot;, &quot;TickerSymbol:&quot; &amp;amp; B3 &amp;amp; &quot;*&quot;) where you place your ticker into B3 cell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For GIRO there are:&#xA;GIRO.PA&#xA;GIRO.PA1&#xA;GIROp.TQ&#xA;GIROp.BS&#xA;GIROp.CHI&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For BITA I had:&#xA;BITA.K&#xA;BITA.N&#xA;BITA.TH&#xA;BITA.P&#xA;BITA.DG&#xA;BITA.Z&#xA;BITA.B&#xA;BITA.C&#xA;BITA.W&#xA;BITA.DY&#xA;BITA.ZY&#xA;BITA.PH&#xA;BITA.MW&#xA;BITA.DF&#xA;BITA.ITC&#xA;BITA.NB&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And there were ever more tickers for ITUB.&#xA;When I added search criteria, number of results decreased.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have no Bloomberg, but when I used &lt;a href=&quot;http://bsym.bloomberg.com/sym/&quot; rel=&quot;nofollow&quot;&gt;http://bsym.bloomberg.com/sym/&lt;/a&gt; I had similar results:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Symbol: ITUB&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Market Sector: Equity&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Security Type: ADR, Common Stock&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And there were 14 BBGIDs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, I think there's no direct way to do it.&lt;/p&gt;&#xA;" OwnerUserId="2870" LastActivityDate="2013-11-11T14:10:11.243" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9421" PostTypeId="2" ParentId="9413" CreationDate="2013-11-11T14:57:53.973" Score="0" Body="&lt;p&gt;You have to &lt;strong&gt;mention more details&lt;/strong&gt; as in what are your assumptions when you fit the digital filter. Also whether &lt;strong&gt;&lt;em&gt;is it linear or not&lt;/em&gt;&lt;/strong&gt;. If not then what non-linearities have you taken into account. The answer depends on that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because you can either look at it as &lt;strong&gt;&lt;em&gt;a form of non-stationarity or a different process altogether&lt;/em&gt;&lt;/strong&gt;. Also how much time behind are you looking at to model the current situation, That will decide how long should you switch off the system after news has come. Finally you can make your &lt;strong&gt;&lt;em&gt;parameters adaptable to some external variable&lt;/em&gt;&lt;/strong&gt; to try and adjust for the news.&lt;/p&gt;&#xA;" OwnerUserId="6289" LastEditorUserId="6289" LastEditDate="2013-11-11T16:55:12.347" LastActivityDate="2013-11-11T16:55:12.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9422" PostTypeId="1" CreationDate="2013-11-11T15:14:29.277" Score="0" ViewCount="472" Body="&lt;p&gt;I need to calculate the dirty price of a US T bond given the below details:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume the coupons on a U.S. Treasury bond are paid on January 1st and July 1st. &#xA;The bond has a par of $1,000 and pays a semiannual coupon of 4.0% with a yield of 6.0%. &#xA;The bond has a settlement date on April 4th, 2011. The bond matures on January 1st, 2016 &#xA;such that there are ten (10) remaining semi-annual coupon payments. What is the dirty &#xA;price (a.k.a., full price) of the bond?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My initial thought was to calculate the PV of the bond and add accrued interest/&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;I've been told this is incorrect and I need to compound the present value forward at the yield for for the 93 days between the last coupon Jan 1 and the settlement date April 4.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$914.6980*(1.03)^(93/181) = $928.696 is the full (dirty) price as of settlement date&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question:&lt;/strong&gt;&#xA;Why can't I just add accrued interest the the PV as of Jan 1 ? Is the PV as of Jan 1 not the &quot;clean&quot; price ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;This is what I tried&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Use calculator to get PV:&#xA;&#xA;Number of periods = 10&#xA;Yield = 6/2&#xA;Payment = 20&#xA;Future Vale = 1000&#xA;Resulting in a PV of $914.698&#xA;&#xA;And then calculate the accrued interest from April 4 to July 1 using the ACT/ACT day     count such that:&#xA;AI = $20*(93/181)=$10.276&#xA;&#xA;Resulting in the dirty price 914.698 + 10.276= 924.974&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance. &lt;/p&gt;&#xA;" OwnerUserId="6489" LastEditorUserId="6489" LastEditDate="2013-11-11T15:51:22.020" LastActivityDate="2013-11-12T00:10:14.560" Title="Dirty price of US T bill" Tags="&lt;accrued-interest&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9423" PostTypeId="1" CreationDate="2013-11-11T15:31:08.290" Score="1" ViewCount="332" Body="&lt;p&gt;Can 2 senior unsecured bonds from the same obligor have different moody's credit ratings? Or do they both have to have the same rating because they are in the same capital structure?  Thanks&lt;/p&gt;&#xA;" OwnerUserId="6490" LastActivityDate="2013-11-27T15:39:27.283" Title="moody's credit ratings for senior unsecured bonds" Tags="&lt;credit&gt;&lt;credit-ratings&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9424" PostTypeId="2" ParentId="9403" CreationDate="2013-11-11T16:10:33.947" Score="3" Body="&lt;p&gt;If I understand correctly the TCP roundtrip time can be used as a posteriori proxi for the order entry gateway delay.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So assuming the roundtrip time is composed of gate delay and independent other delays $RTT_g(t) = dT_g(t) + d_g(t)$ with assumed $Cov(dT_g,d_g)=0$ and $Cov(d_i,d_j)=0$. Minimizing the this combination of gate delay and other delays is leading to the same goal. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps a univariate modeling of this $RTT_g(t)$ based on historical observed observations is suitable. Could be that a simple rolling mean/median and (robust) dispersion metric is enough? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found this &lt;a href=&quot;http://www.eecis.udel.edu/~bohacek/Papers/paper579.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.eecis.udel.edu/~bohacek/Papers/paper579.pdf&lt;/a&gt; paper about video streaming and congestion. They estimate a Cox-Ingersoll-Ross model (&lt;a href=&quot;https://en.wikipedia.org/wiki/Cox%E2%80%93Ingersoll%E2%80%93Ross_model&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Cox%E2%80%93Ingersoll%E2%80%93Ross_model&lt;/a&gt;) to estimate and predict delays.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dRTT_g = a (b-RTT_g)dt+\sigma\sqrt{RTT_g}dW_t$ with $dW_t$ brownian.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for this CIR there exist close form solutions for predictions which are chi-square family. so something like $S(t)=\text{argmin}_g \hat{RTT_g}(t+1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that i dont know if these gateway independence assumptions are not too strong, and i wonder if the gateway delay is not also a function of e.g. ordersize or previous usage. Good luck!&lt;/p&gt;&#xA;" OwnerUserId="6491" LastActivityDate="2013-11-11T16:10:33.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9427" PostTypeId="2" ParentId="9411" CreationDate="2013-11-12T03:46:12.660" Score="1" Body="&lt;p&gt;I'm going to start an answer on this and see if it generates discussion:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Firstly you can't get the implied vol to a specific period unless there are options that are liquid and traded around the period you are interested in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you have four periods of vol, but you don't have listed options between the time periods (usually).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;from now until the close of market, from close of market until open of market, from open of market to fomc inclusive, from fomc to next day close.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you might have information about the implied vol from now until close of market today (say there is an expiration on that day) and implied vol from now until close of market tomorrow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then&#xA;totalVol = integral(sigma_instantenous(t)^2*dt, 0, T)/T. We can substitute sigma_instantenous(t) = implied vol, then totalVol = impv^2/T. See &lt;a href=&quot;https://en.wikipedia.org/wiki/Realized_variance&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Realized_variance&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;totalSigma(now until eod tomorrow) = impv(now to eod tomorrow)^2*t(now to eod tomorrow)&#xA;totalSigma(now until eod today) = impv(now to eod tomorrow)^2*t(now to eod tomorrow)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;totalSigma from eod today to eodTomorrow = impv(now until eod tomorrow)-impv(now until eod today)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;note this period includes both the overnight return and the fomc event. This might give you an idea. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An alternative method is to take the model approach. Fit a model such as sabr to the implied volatility surface, you can interpolate to different time periods. Granted this will likely not nicely take into consideration your fomc event:) See for example &lt;a href=&quot;http://www.maths.ox.ac.uk/system/files/private/active/0/On%20expansions%20for%20the%20SABR%20model.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.maths.ox.ac.uk/system/files/private/active/0/On%20expansions%20for%20the%20SABR%20model.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1105" LastActivityDate="2013-11-12T03:46:12.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9428" PostTypeId="1" AcceptedAnswerId="9429" CreationDate="2013-11-12T09:37:18.590" Score="3" ViewCount="307" Body="&lt;p&gt;My question is a bit philosophical. As a risk manager I often have to tell portfolio managers to reduce risk (e.g. due to VaR limits or exposure limits). Then usually the discussion arises that if they had had more exposure to risky assets they would have participated more in the rally or in the rebound after the crash.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I tell them is things like: If we knew when the crash ends and the rebound starts - if it starts at all - then we were rich and would not work here anymore.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore a naive application of CAPM where more systematic risk leads to higher expected return is not true in all markets at all times (as e.g. Min VAR shows at least in a risk adjusted way).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What do you tell risk takers in order to tame their risk appetite? Where do you reference to in order to underpin your opinion?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A reference could be such as: &#xA;In a recent paper &lt;a href=&quot;https://lirias.kuleuven.be/bitstream/123456789/387170/1/jor_boudt_journal+of+risk.pdf&quot; rel=&quot;nofollow&quot;&gt;Boudt et al.&lt;/a&gt; give clear indications to minimize risk in a bear market and diversify risk in normal/bull markets of risky assets.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2013-11-12T14:42:40.897" Title="Risk and Reward in practice" Tags="&lt;risk&gt;&lt;risk-management&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9429" PostTypeId="2" ParentId="9428" CreationDate="2013-11-12T09:54:05.223" Score="6" Body="&lt;p&gt;I am a risk taker and I can say with confidence that you will never convince those individuals, you cited in your question, that they incur too much risk, because there will always be certain traders who prefer lottery tickets over longevity with the same firm (running high risk books unfortunately in the current environment runs equal to a free option; blow up and one gets dismissed but almost instantaneously welcomed at another trading house). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My advice is to simply make sure you have a clear mandate, numerically speaking. Sit down with upper management and agree on the risk limits for each trader and also agree which metric is to be used to assess such risk. VaR is a very flawed way to assess risk. A much better approach is to have strict loss limits and net exposure limits. Discuss with upper management what exact risks they want to be protected against. Some options trading houses, for example have strict delta exposure limits. Some equity desks mandate their traders to take no fx exposure or rates exposure nor dividend risk. Discuss whether Some equity desks have gross aggregate exposure limits, so even someone is 10bucks short stockA and long 10bucks of stockB that would amount to 20bucks gross exposure. Others run portfolio risk models, meaning they take correlation between assets into consideration. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In any case make sure the mandate is crystal clear and the methodology, used, as well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you can go to the PM or trader and do not need to argue. Everyone is on the same page and a risk limit is breached or not, simple as that. Running a tight ship, risk management wise, is one of the most important things to run a stable business. If you do not get the support cited above then I would, as risk manager, consider changing job. If upper management does not care about risk and whether limits are violated or not then that is a big fat red flag in my book.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2013-11-12T14:42:40.897" LastActivityDate="2013-11-12T14:42:40.897" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="9431" PostTypeId="2" ParentId="8405" CreationDate="2013-11-12T16:39:53.277" Score="3" Body="&lt;p&gt;The risk aversion coefficient is also referred to as the Arrow-Pratt risk aversion index. When λ is small (i.e., the aversion to risk is low), the pen- alty from the contribution of the portfolio risk is also small, leading to more risky portfolios. Conversely, when λ is large, portfolios with more exposures to risk become more highly penalized. If we gradually increase λ from zero and for each instance solve the optimization problem, we end up calculating each portfolio along the efficient frontier. It is a common practice to calibrate λ such that a particular portfolio has the desired risk profile. The calibration is often performed via backtests with historical data. For most portfolio allocation decisions in investment management applications, the risk aversion is somewhere between 2 and 4.----BY petter kolm's book&lt;/p&gt;&#xA;" OwnerUserId="6494" LastActivityDate="2013-11-12T16:39:53.277" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9432" PostTypeId="1" AcceptedAnswerId="9439" CreationDate="2013-11-12T18:59:44.327" Score="2" ViewCount="470" Body="&lt;p&gt;I am looking at the variance of (log) price changes in securities vs. the amount of social media discussion about them. I'm not interested in building a model. I'm just looking to see if there is a significant correlation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose the social media is represented by a numeric variable “sm”. All the series I'm working with are weakly stationary. The distribution of the price data is as one would expect: normal with fat tails. The basic stats of a typical set of “sm” observations, however, are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;nobs          240.000000&#xA;NAs             0.000000&#xA;Minimum         0.000000&#xA;Maximum       725.000000&#xA;1. Quartile    52.000000&#xA;3. Quartile   119.250000&#xA;Mean           99.245833&#xA;Median         82.000000&#xA;Sum         23819.000000&#xA;SE Mean         5.573789&#xA;LCL Mean       88.265806&#xA;UCL Mean      110.225861&#xA;Variance     7456.110861&#xA;Stdev          86.348775&#xA;Skewness        3.428570&#xA;Kurtosis       17.793173&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For price vs. “sm” contemporaneous, lag(1), and sometimes lag(2), the correlation is positive but small, about what I would expect. Because the distribution is not normal, I'm wondering if the cross-correlation matrix (&lt;em&gt;ccf() function in R&lt;/em&gt;) provides a reasonable assessment of cross correlation (assuming linearity). I welcome any comments regarding how to interpret these results as well as any comments on best-practices.&lt;/p&gt;&#xA;" OwnerUserId="6234" LastEditorUserId="35" LastEditDate="2013-11-12T21:13:05.870" LastActivityDate="2013-11-13T13:34:27.627" Title="Interpretation of cross-correlation matrix when one sample distribution is not normal" Tags="&lt;time-series&gt;&lt;r&gt;&lt;correlation-matrix&gt;&lt;normal-distribution&gt;&lt;best-practices&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9434" PostTypeId="2" ParentId="9271" CreationDate="2013-11-13T01:47:55.937" Score="1" Body="&lt;p&gt;I use &lt;a href=&quot;http://www.mbtrading.com/developersMain.aspx?page=sdk&quot; rel=&quot;nofollow&quot;&gt;MB Trading SDK&lt;/a&gt; for automated trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is COM based but easy to integrate with C#.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can setup a demo account and trade on it for free.&lt;/p&gt;&#xA;" OwnerUserId="2931" LastActivityDate="2013-11-13T01:47:55.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9435" PostTypeId="2" ParentId="9039" CreationDate="2013-11-13T01:52:13.983" Score="1" Body="&lt;p&gt;ForexConnect is an API for &lt;a href=&quot;http://fxcm.com&quot; rel=&quot;nofollow&quot;&gt;FXCM&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More information can be found in this PDF:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://files.fxcorporate.com/api/Getting%20Started.pdf&quot; rel=&quot;nofollow&quot;&gt;https://files.fxcorporate.com/api/Getting%20Started.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2931" LastActivityDate="2013-11-13T01:52:13.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9436" PostTypeId="1" CreationDate="2013-11-13T07:21:08.257" Score="5" ViewCount="2724" Body="&lt;p&gt;i just don't get it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Peak-load pricing &lt;a href=&quot;http://en.wikipedia.org/wiki/Peak-load_pricing&quot; rel=&quot;nofollow&quot;&gt;wiki&lt;/a&gt; page gives example:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;in public goods such as public urban transportation, where day demand&#xA;  (peak period) is usually much higher than night demand (off-peak&#xA;  period)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Price discrimination &lt;a href=&quot;http://en.wikipedia.org/wiki/Price_discrimination&quot; rel=&quot;nofollow&quot;&gt;wiki&lt;/a&gt; page gives example:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;For example, schedule-sensitive business passengers who are willing to&#xA;  pay \$300 for a seat from city A to city B cannot purchase a \$150&#xA;  ticket because the \$150 booking class contains a requirement for a&#xA;  Saturday night stay, or a 15-day advance purchase, or another fare&#xA;  rule that discourages, minimizes, or effectively prevents a sale to&#xA;  business passengers.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But I don't really see the difference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the example of urban transportation, people pay more to buy the convenience of &quot;peak period usage&quot;; while in the other example of air tickets, people pay more to buy the convenience of &quot;returning without spending a Saturday night stay&quot; (so that they could enjoy quality time with family) or &quot;without 15-day advance purchase&quot; (so that they need not spend time planning the detailed, maybe even trifle things that might happen in the future).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, a company might hire a secretary to book tickets in 15-days' advance, while need to pay the secretary; or, just buy air tickets when needed, while need to pay the premium of convenience. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;that convenience is really a need, why shall government bother?&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2017-03-03T17:03:00.727" Title="what's the difference between Peak-Load pricing and price discrimination?" Tags="&lt;pricing&gt;&lt;macro-economics&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9438" PostTypeId="2" ParentId="4593" CreationDate="2013-11-13T12:45:15.617" Score="1" Body="&lt;p&gt;The parameters θ, ν and r need to be estimated from the sample with some technique, but unfortunately there is no easy way to do that for a VG process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is, for example, &quot;maximum likelihood estimation&quot; that gives you the parameters that are &quot;most likely&quot; to have generated your sample, assuming your sample comes from a VG process. But MLE involves computing the likelihood function of a VG process which is extremely complex by itself (check its pdf on the VG process wikipedia page).&lt;/p&gt;&#xA;" OwnerUserId="6497" LastActivityDate="2013-11-13T12:45:15.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9439" PostTypeId="2" ParentId="9432" CreationDate="2013-11-13T13:34:27.627" Score="0" Body="&lt;p&gt;You could use &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;rcorr(x, y, type=c(&quot;pearson&quot;,&quot;spearman&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Correlations with significance levels&#xA;library(Hmisc)&#xA;rcorr(x, type=&quot;pearson&quot;) # type can be pearson or spearman&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;from the &lt;a href=&quot;http://cran.r-project.org/web/packages/Hmisc/Hmisc.pdf&quot; rel=&quot;nofollow&quot;&gt;Hmisc&lt;/a&gt; package. It gives asymptotic p-values.&lt;/p&gt;&#xA;" OwnerUserId="6491" LastActivityDate="2013-11-13T13:34:27.627" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9440" PostTypeId="1" CreationDate="2013-11-13T22:29:49.863" Score="1" ViewCount="151" Body="&lt;p&gt;When analysing currencies, the data always comes in pairs so it is hard to normalise a multivariate time series of data e.g. if I have GBPvsUSD, EURvsUSD and CADvsUSD then changes in the US economy will affect all these series in a potentially undesirable way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the consensus on instead of using exchange rates to analyse currencies, introducing a conditional variable i.e. the price of gold? We can then analyse the currencies using this to peg them against.&lt;/p&gt;&#xA;" OwnerUserId="6443" LastActivityDate="2014-08-27T06:33:58.113" Title="Analysing FX Data" Tags="&lt;fx&gt;&lt;currency&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9441" PostTypeId="1" CreationDate="2013-11-14T00:29:47.130" Score="4" ViewCount="345" Body="&lt;p&gt;Is it possible to synthesize a futures spread option using only the options on the spread's underlyings?  If so, how?  If not, is there another way?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, please show me how to synthesize NYMEX's &lt;a href=&quot;http://www.cmegroup.com/trading/energy/refined-products/rbob-crack-spread-swap-futures_contractSpecs_options.html&quot; rel=&quot;nofollow&quot;&gt;RBOB Gasoline Crack Spread Options&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user6500" LastEditorUserId="467" LastEditDate="2014-12-22T10:57:20.080" LastActivityDate="2014-12-22T10:57:20.080" Title="How to synthesize a futures spread option?" Tags="&lt;options&gt;&lt;futures&gt;&lt;spread&gt;&lt;synthetic&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9443" PostTypeId="1" CreationDate="2013-11-14T03:37:36.460" Score="5" ViewCount="175" Body="&lt;p&gt;My question is dealing with the  proportionality between Dividend Index Futures prices and Index prices. Indeed, we in the past we used to do a simple regression between these variables and use the same $\beta$ factor for future forecasts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, we observe that in Bull market, the dividends tends to cap, and thus the usage of the previous $\beta$ will lead to misforecasting and mishedge. While during Bear market the $\beta$ increases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to know if you have already seen in the literature something like this, and how would you deal with this to provide better estimations or regression between the two previous variables (or their returns)!&lt;/p&gt;&#xA;" OwnerUserId="6189" LastActivityDate="2013-11-14T03:37:36.460" Title="Dividend Index Futures" Tags="&lt;futures&gt;&lt;regression&gt;&lt;index&gt;&lt;dividends&gt;&lt;dynamic&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9444" PostTypeId="2" ParentId="9441" CreationDate="2013-11-14T10:43:22.017" Score="2" Body="&lt;p&gt;This spread can't be statically synthesized. However you can synthesize it dynamically by  trading in the underlying contracts. You would first value the option using standard theory (this involves solving a two-dimensional PDE, or using Monte Carlo) to get a price $V(F_1,F_2)$ in terms of the prices of the underlying futures contracts. Then the holdings in each of the underlyings are given by the deltas&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta_1 = \frac{\partial V}{\partial F_1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta_2 = \frac{\partial V}{\partial F_2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By re-adjusting your holdings at some specified frequency, you can replicate the payoff of the option.&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2013-11-14T10:43:22.017" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9445" PostTypeId="1" AcceptedAnswerId="9448" CreationDate="2013-11-14T11:14:31.687" Score="2" ViewCount="2128" Body="&lt;p&gt;I'm new to quantitative finance, so I'm confused with the so-called path dependency in binomial tree model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Originally I thought the path dependency exists because in binomial tree model, we will price the options in a back-propagating fashion. We evaluate the price at time T, and then go backwards to calculate the price at time T-1. The dependency is from $P_{T - 1}$ to $P_{T}$.&#xA;When I went over the Monte Carol Simulation approach to price options, I found that in Monte Carol Model, the price of option at time T depends on that at time T-1. The difference is that this dependency is from $P_T$ to $P_{T-1}$. However, per my understanding, we cannot say Monte Carol Simulation is a path dependent algorithm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how could I understand/explain the path dependency in binomial tree model when pricing options?&lt;/p&gt;&#xA;" OwnerUserId="3030" LastActivityDate="2013-11-14T19:40:18.937" Title="How to explain the path dependency in binomial tree model to price options?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;binomial-tree&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9446" PostTypeId="1" CreationDate="2013-11-14T12:47:52.810" Score="4" ViewCount="5361" Body="&lt;p&gt;I am a bit confused about how to formulate a problem where I have to price an option on a stock. Many papers say that stock prices are best modeled using a geometric Brownian motion (GBM), and I understand that GBM is a Markov process. But i have recently read about Martingales and I am confused. Are stock prices modeled as GBM or martingales? Is a martingale a special type of GBM where drift is zero?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you please explain to me in detail and in basic language the relation and differences between Markov, GBM, and Martingale processes. And can you please provide me with an example, starting with a GBM, and how to derive a Martingale process from that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much!!&lt;/p&gt;&#xA;" OwnerUserId="5190" LastActivityDate="2013-11-22T19:30:51.443" Title="Understanding the concept of Martingale pricing" Tags="&lt;options&gt;&lt;martingale&gt;&lt;markov&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9448" PostTypeId="2" ParentId="9445" CreationDate="2013-11-14T17:09:27.670" Score="5" Body="&lt;p&gt;In binomial tree models, there is no such a thing as a path.  The binomial tree represents information about the &lt;em&gt;distribution&lt;/em&gt; of the zero-curve at a given time and preserve enough information between different times to let you compute conditional expectations. Generally, you &lt;em&gt;can not&lt;/em&gt; price path-dependant instruments in a model based on trees—because there is no path.&#xA;In some sense, Monte-Carlo simulation are much more naive, because they produce market scenarios for the zero-curve. They are suited for the pricing of path-dependant instruments but are computationally more intensive than tree processes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are keen on this question, you can try to express the $\sigma$-algebra filtration with respect to which the price process $V$ of a derivative has to be measurable in order to be priced correctly by a tree model. (In the case of a Monte-Carlo simulation, this filtration is the filtration associated to the Brownian motion driving the simulation, so that there is no real limitation.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you interpret your tree as a finite automaton with stochastic transitions, you can use it to run path-simulations compatible with the tree.&lt;/p&gt;&#xA;" OwnerUserId="6123" LastEditorUserId="6123" LastEditDate="2013-11-14T19:40:18.937" LastActivityDate="2013-11-14T19:40:18.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9449" PostTypeId="2" ParentId="9309" CreationDate="2013-11-14T19:30:20.683" Score="0" Body="&lt;p&gt;I simply priced the options based on the volatility,strike price, issue date, expiration date (the greeks) using a binomial price engine and then calculated the returns based around this&lt;/p&gt;&#xA;" OwnerUserId="3532" LastActivityDate="2013-11-14T19:30:20.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9450" PostTypeId="1" AcceptedAnswerId="9459" CreationDate="2013-11-14T19:58:04.843" Score="2" ViewCount="245" Body="&lt;p&gt;In Parker's &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0521728355&quot; rel=&quot;nofollow&quot;&gt;The Economics of Entrepreneurship&lt;/a&gt; he explains how certain theoretical models predict seemingly bizzare things (e.g. people becoming more risk-averse resulting in them taking riskier jobs) by analogy to investment risk. He states that sometimes a portfolio's overall risk can be decreased by increasing the fraction of the portfolio which is invested in its riskiest asset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;He gives no citation for this, and playing around with some sample numbers I can't find an example of when this would be true. Could anyone point me to an example of when this would be true?&lt;/p&gt;&#xA;" OwnerUserId="5361" LastActivityDate="2013-11-15T12:11:55.143" Title="Portfolio risk decreased by increasing share of riskiest asset?" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;risk-models&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9453" PostTypeId="1" CreationDate="2013-11-14T21:29:37.140" Score="5" ViewCount="580" Body="&lt;p&gt;Suppose I divide a time series into 10 sequential time windows, where each window contains 1000 data points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to do test 5 different garch models using cross validation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for each model, I will fit it on 9 out of 10 time windows, and test it on data in the left-out window.  This will be done for 10 different &quot;left out&quot; windows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, for each optimised garch model, the latent volatility variable will be a problem when I step over the &quot;gap&quot; created by the left-out window.  The only time this won't be a problem is when the left-out window is either the first or last window.  In the 8 other cases, I will have to take a guess at the initial volatility to use, using something such as the sample variance, or rolling volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So 8 of the tests will have two starting points.  And 2 of the models will have 1 starting point.  And I will need to guess the volatility at each starting point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question is, with all the guessing of these starting points...  What is the recommended best practice?  And how valid will be cross validation results be?&lt;/p&gt;&#xA;" OwnerUserId="6392" LastActivityDate="2014-03-27T21:51:14.097" Title="Cross validation of a garch model" Tags="&lt;garch&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9454" PostTypeId="2" ParentId="9415" CreationDate="2013-11-14T23:36:02.980" Score="1" Body="&lt;p&gt;I haven't read the text you mention, but I'd note that the text says that Hong Kong lost some comparative advantage, not that exchange rate regulation disabled the comparative advantage.  So after the Asian currency crisis, the dollar price of goods and services from Indonesia was lower because of the currency devaluation whereas the dollar price of those goods and services were unchanged in Hong Kong (excluding price changes from economic impact of the crisis).  While trade balances are influential, short and long term financial flows can have an overwhelming impact on exchange rates.  Currency regulation can reduce exchange rate volatility, but there are related costs.  &lt;/p&gt;&#xA;" OwnerUserId="6234" LastActivityDate="2013-11-14T23:36:02.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9457" PostTypeId="1" CreationDate="2013-11-15T10:41:52.823" Score="3" ViewCount="107" Body="&lt;p&gt;Basically i am confused as to which formula to use for portfolio skew and kurtosis and how to use the same in the optimization problem. I would also like to know the options available regarding the software on which the optimization can be done.&lt;/p&gt;&#xA;&lt;h2&gt;Edit&lt;/h2&gt;&#xA;&lt;p&gt;Based on &lt;a href=&quot;https://quant.stackexchange.com/questions/58697/how-to-add-the-effect-of-skewness-in-the-portfolio-optimisation-objective-functi&quot;&gt;this post&lt;/a&gt;, we are able to include portfolio skewness, using the co-skewness matrix &lt;span class=&quot;math-container&quot;&gt;$M_3$&lt;/span&gt;, using a third-order Taylor series expansion, but how to also add in the minimization of portfolio skewness, &lt;span class=&quot;math-container&quot;&gt;$M_4$&lt;/span&gt; (fourth-order Taylor expansion)?&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\arg \max_w w^T\mu-\frac{1}{2}\gamma w^T\Sigma w+\frac{1}{6}\gamma^2 w^TM_3(w\otimes w)$$&lt;/span&gt;&lt;/p&gt;&#xA;" OwnerUserId="6513" LastEditorUserId="41390" LastEditDate="2020-10-25T03:17:32.847" LastActivityDate="2020-10-25T03:17:32.847" Title="Optimize an equity portfolio for the four central moments: problem formulation" Tags="&lt;portfolio-management&gt;&lt;portfolio-selection&gt;&lt;skewness&gt;&lt;statistical-finance&gt;&lt;kurtosis&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="9459" PostTypeId="2" ParentId="9450" CreationDate="2013-11-15T11:48:59.153" Score="2" Body="&lt;p&gt;This can for example be seen in &lt;a href=&quot;https://en.wikipedia.org/wiki/Modern_portfolio_theory&quot; rel=&quot;nofollow&quot;&gt;modern portfolio theory&lt;/a&gt; (Harry Markowitz, William Sharpe)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example consider a two asset portfolio with a full investment constraint ($w_1+w_2=1$) so we can write the proportion in asset 1 as $w_1=w$ and in asset 2 as $1-w$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The expected portfolio return $E[R_p]=wE[R_1]+(1-w)E[R_2]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And variance $\sigma_p^2 = w^2\sigma_1^2+(1-w)^2\sigma_2^2+2w(1-w)\rho_{12}\sigma_1 \sigma_2$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $\sigma_i$ is asset $i$'s standard deviation and $\rho_{12}$ is the correlation between the two.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the investor tries to optimize a mean variance tradeoff, where the variance is interpreted as risk. For example where there could be some risk preference parameter included if desired other than the $\frac{1}{2}$ which is included for convinience:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\min_w L(w) = \min_w (\frac{1}{2}\sigma_p^2 - E[R_p])$&#xA;Taking first order conditions by $dL(w)/dw=0$ gives&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{1}{2}\bigl(2w\sigma_1^2+2(w-1)\sigma_2^2+2(1-2w)\rho_{12}\sigma_1 \sigma_2\bigr) - \bigl(E[R_1]-E[R_2]\bigr)=0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$w(\sigma_1^2+\sigma_2^2-2\rho_{12}\sigma_1 \sigma_2 )-\sigma_2^2+\rho_{12}\sigma_1 \sigma_2 - \bigl(E[R_1]-E[R_2]\bigr)=0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$w = \frac{E[R_1]-E[R_2]+\sigma_2^2-\rho_{12}\sigma_1 \sigma_2 }{\sigma_1^2+\sigma_2^2-2\rho_{12}\sigma_1 \sigma_2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The minimum variance portfolio is found by $\min_w(\frac{1}{2}\sigma_p^2)$ and has first asset weight $w^*$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$w^* = \frac{\sigma_2^2-\rho_{12}\sigma_1 \sigma_2 }{\sigma_1^2+\sigma_2^2-2\rho_{12}\sigma_1 \sigma_2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now calculating the minimum variance portfolio weight for a couple of cases:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;s1=0.1;s2=0.1;rho=-1;print s1, s2, rho, (s2**2-rho*s1*s2)/(s1**2+s2**2-2*rho*s1*s2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So you can see the minimum variance portfolio weights. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; s1   s2  rho   w*&#xA;0.1  0.1  -1    0.5    // equal risk, perfect negative corr -&amp;gt; equal weight&#xA;0.2  0.1  -1    0.333  // asset 1 riskier -&amp;gt; lower weight&#xA;0.2  0.1   0    0.2    // asset 1 riskier and no hedge -&amp;gt; even lower weight&#xA;0.2  0.1   0.2  0.142  // asset 1 riskier and positive corr -&amp;gt; STILL POSITIVE W ! (no negative correlation required for a hedge!)&#xA;0.2  0.1   0.5  0.0    // asset 1 riskier and higher pos corr -&amp;gt; everything in asset 2&#xA;0.2  0.1   0.8 -0.33   // asset 1 riskier and high corr -&amp;gt; short asset 1&#xA;0.2  0.1   1   -1.0    // asset 1 riskier and perfect corr -&amp;gt; fully short ass 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;for example the case $\sigma_1=0.2,\sigma_2=0.1,\rho_{12}=0.2,w^*=0.142$ gives portfolio variance:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;w**2*s1**2+(1-w)**2*s2**2+2*w*(1-w)*rho*s1*s2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;$\sigma_p^2 = 0.91\%$ which is less than both individual asset variances $\sigma_1^2 = 4\%$ and $\sigma_2^2 = 1\%$ .&lt;/p&gt;&#xA;" OwnerUserId="6491" LastEditorUserId="6491" LastEditDate="2013-11-15T12:11:55.143" LastActivityDate="2013-11-15T12:11:55.143" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9461" PostTypeId="1" CreationDate="2013-11-15T13:49:09.077" Score="1" ViewCount="124" Body="&lt;p&gt;European options and binary (digital) options is similar?&#xA;How apply the Black &amp;amp; Scholes formula on binary option?&lt;/p&gt;&#xA;" OwnerUserId="6516" LastActivityDate="2013-11-15T13:49:09.077" Title="Binary options and European option is similar?" Tags="&lt;option-strategies&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9463" PostTypeId="1" AcceptedAnswerId="9467" CreationDate="2013-11-15T16:05:16.303" Score="1" ViewCount="280" Body="&lt;p&gt;I have data from exchange in transaction log format that indicating:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;price&lt;/li&gt;&#xA;&lt;li&gt;volume&lt;/li&gt;&#xA;&lt;li&gt;timestamp&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;That element indicating that &lt;strong&gt;timestamp&lt;/strong&gt; transaction was made on &lt;strong&gt;price&lt;/strong&gt; of size &lt;strong&gt;volume&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is how to convert that feed into tick-by-tick based data including:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;timestamp&lt;/li&gt;&#xA;&lt;li&gt;ask price&lt;/li&gt;&#xA;&lt;li&gt;bid price&lt;/li&gt;&#xA;&lt;li&gt;volume&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;That element indicating that &lt;strong&gt;timestamp&lt;/strong&gt; transaction was made of size &lt;strong&gt;volume&lt;/strong&gt;, and after that prices buy/sell prices are on level &lt;strong&gt;ask price&lt;/strong&gt; and &lt;strong&gt;bid price&lt;/strong&gt; for create future transaction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for help!&lt;/p&gt;&#xA;" OwnerUserId="6175" LastEditorUserId="6175" LastEditDate="2013-11-15T16:12:12.823" LastActivityDate="2013-11-16T00:21:19.383" Title="How to convert trasaction log to bid-ask ticks" Tags="&lt;market-data&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9465" PostTypeId="1" CreationDate="2013-11-15T19:30:15.277" Score="6" ViewCount="4209" Body="&lt;p&gt;For my recent project I am looking to build a software capable of visualizing financial charts in a dynamically and interactive matter. The workflow is as follows:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I gather data from my data provider of choice (real-time, asynchronous)&lt;/li&gt;&#xA;&lt;li&gt;I do some statistical analysis of my data (mostly using R and C)&lt;/li&gt;&#xA;&lt;li&gt;From (2) I get a new bunch of different time series data that I'd like to visualize (chart) using some nice GUI/ Rendering&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;As you'd guess step 3 drives me nuts. I've found a bunch of nice APIs for Browser based visualization like &lt;a href=&quot;http://www.highcharts.com/products/highstock&quot;&gt;StockChart SL&lt;/a&gt; or &lt;a href=&quot;http://www.highcharts.com/products/highstock&quot;&gt;Highcharts&lt;/a&gt; but what I really need seems to be rare: A library for an arbitrary programming language that I can use to build a standalone application. My needs are simple: I want it to be able to interact with the chart (thus, paning and if possible zooming), to be able to update the chart dynamically as new input data arrives (async.), and to be able to add &quot;objects&quot; to the Charts like standard deviations or moving averages (I don't need the library for the calculations but for the drawing).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, there is one more additional requirement: The software should come with a free license for non-commercial application as I am not willing to pay before I am perfectly comfortable with it).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone happen to know or worked with a library like this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this question complies with the rules of this site but I guess chances are that you guys have more specialized knowledge in the specific requirements I have for this library in contrast to standard plotting libs.&lt;/p&gt;&#xA;" OwnerUserId="6520" LastEditorUserId="6520" LastEditDate="2013-11-15T19:40:28.560" LastActivityDate="2020-05-25T09:21:37.847" Title="Library for interactive financial charts" Tags="&lt;programming&gt;&lt;r&gt;&lt;visualization&gt;&lt;library&gt;&lt;c&gt;" AnswerCount="5" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9466" PostTypeId="1" AcceptedAnswerId="9504" CreationDate="2013-11-15T19:34:30.407" Score="10" ViewCount="3906" Body="&lt;p&gt;What are the most common ways to model intraday trading volume, particularly for futures contracts? There are obviously a number of seasonal-type factors, like roll, economic news releases, time of day, etc. Are there any standard modeling techniques to deal with this type of problem, or any papers/books that are applicable?&lt;/p&gt;&#xA;" OwnerUserId="5251" LastEditorUserId="2299" LastEditDate="2013-11-19T21:39:57.793" LastActivityDate="2015-10-24T22:50:13.557" Title="What are common methods for modeling intraday trading volume?" Tags="&lt;time-series&gt;&lt;modeling&gt;&lt;market-microstructure&gt;&lt;econometrics&gt;&lt;volume&gt;" AnswerCount="2" CommentCount="8" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9467" PostTypeId="2" ParentId="9463" CreationDate="2013-11-16T00:21:19.383" Score="4" Body="&lt;p&gt;Trades don't indicate the quote. Consider a market like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bid     ask&#xA;100.01  100.02&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You see a trade for &lt;code&gt;100.02&lt;/code&gt;. Then you see another trade for &lt;code&gt;100.02&lt;/code&gt;. This second trade could have been taking more from the ask. However, if the earlier trade had wiped-out the ask, then the quotes may have been updated to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bid     ask&#xA;100.02  100.03&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I.e., the second trade took from the bid. But since all you saw was &lt;code&gt;100.02&lt;/code&gt;, you don't know whether is was from the bid or ask.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On top of that, an illiquid stock could have been displayed at&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bid     ask&#xA;100.01  100.05&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A trade for &lt;code&gt;100.02&lt;/code&gt; would have been against hidden liquidity and you would never know.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in conclusion, trades cannot be used to derive quotes. They are two different pieces of information. (Conversely, quotes cannot be used to derive trades, since disappearing liquidity may indicate either trades or cancelations, and you'd have no way of knowing.) If you want quotes, then you have to get quote data.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2013-11-16T00:21:19.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9469" PostTypeId="2" ParentId="8065" CreationDate="2013-11-16T15:00:41.753" Score="0" Body="&lt;p&gt;I am building a Ruby app. I just tested the Tradier API. Got it wired in no time. Good Market Data and no fund minimums for 30 days. &lt;/p&gt;&#xA;" OwnerUserId="6526" LastActivityDate="2013-11-16T15:00:41.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9472" PostTypeId="2" ParentId="9446" CreationDate="2013-11-17T05:59:24.967" Score="9" Body="&lt;p&gt;Roughly speaking, we can express the difference between a Markov process and a martingale as follows:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;A &lt;em&gt;Markov process&lt;/em&gt; is one for which conditioning its future value on its history is the same as conditioning its future value on its present value, so that $E(h(X_t)\,|\,X_u,\,u\leq s)=E(h(X_t)\,|\,X_s)$, for any appropriate function $h$;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A &lt;em&gt;martingale&lt;/em&gt; is a process whose expected future value equals its present value, when conditioned on its history, so that $E(X_t\,|\,X_u,\,u\leq s)=X_s$,&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;for all $s\leq t$. (Note that I am taking huge liberties by ignoring integrability conditions and other important caveats.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In words, we might say that Markov processes have the property that their histories provide no information in excess of the information contained in their present values. Similarly, we might say that martingales are processes for which the best estimate of their future value is their current value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These two concepts have an interesting history in Financial Economics. For example, the &lt;em&gt;Efficient Market Hypothesis&lt;/em&gt; effectively asserts that asset price processes are Markov. On the other hand, much of &lt;em&gt;Asset Pricing Theory&lt;/em&gt; characterises fair value for risky securities in terms of martingales, in one way or another.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer your question, although both the Markov condition and the martingale condition are expressed in terms of conditional expectations, they are in fact quite different notions. In particular, processes can be (1) Markov processes and martingales; (2) Markov processes but not martingales; (3) martingales but not Markov processes; and (4) neither martingales nor Markov process. A good exercise is to construct examples of all four types of process listed above (focus on discrete-time, rather than continuous-time).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Geometric Brownian motion&lt;/em&gt; is a process $X$ characterised by the stochastic differential equation&#xA;$$d X_t=\mu X_t\,dt+\sigma X_t\,d B_t,$$&#xA;for all $t\geq 0$, where $B$ is a standard Brownian motion. It is always Markov (incidentally, this explains why the price of an option written on a security that follows a geometric Brownian motion is a function of the current price of the security, and not its price history). However, $X$ is only a martingale when $\mu=0$ (in which case we refer to it as &lt;em&gt;driftless&lt;/em&gt; geometric Brownian motion. &lt;/p&gt;&#xA;" OwnerUserId="6529" LastActivityDate="2013-11-17T05:59:24.967" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9476" PostTypeId="1" CreationDate="2013-11-17T20:10:41.060" Score="9" ViewCount="8599" Body="&lt;p&gt;Say I have a market-making strategy that trades intraday. I start with a flat position and finish flat too. I end up with a daily P&amp;amp;L $p_{today}$. Over a year of trading I get $\vec{p} = (p_1,\dots,p_{252})$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no way to calculate returns here. As such I calculate $$Sharpe = S(\vec{p}) = \sqrt{252} \cdot \frac{\mathbb{E}[\vec{p}]}{\sqrt{\mathbb{V}[\vec{p}]}} = \sqrt{252} \cdot \frac{mean(p)}{sd(p)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions are :&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Am I right to do it like this?&lt;/li&gt;&#xA;&lt;li&gt;Do you usually bootstrap your Sharpe? (I do not but I am interested in your view of it.)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5339" LastEditorUserId="35" LastEditDate="2013-11-17T23:35:08.100" LastActivityDate="2014-07-08T20:35:14.363" Title="How do I calculate Sharpe ratio from P&amp;L?" Tags="&lt;market-making&gt;&lt;sharpe-ratio&gt;&lt;bootstrapping&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9478" PostTypeId="1" CreationDate="2013-11-17T22:57:45.263" Score="1" ViewCount="5324" Body="&lt;p&gt;The answers from these two replies seem to contradict each other.  The first numerator is bidSize&lt;em&gt;bidPrice + askSize&lt;/em&gt;askPrice but the second is bidSize&lt;em&gt;askPrice + askSize&lt;/em&gt;bidPrice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/9168/price-functions-based-on-order-book-events&quot;&gt;Price functions based on order book events&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/1348/control-for-bid-ask-bounce-in-high-frequency-trade-data&quot;&gt;Control for bid/ask bounce in high-frequency trade data?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know what I'm missing here?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I think the 2nd link above is correct formula but I'm likely misreading first link.&#xA;This because this paper seems to agree with 2nd link:&#xA;&lt;a href=&quot;http://home.uchicago.edu/~shim/Papers/HFT-FrequentBatchAuctions.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://home.uchicago.edu/~shim/Papers/HFT-FrequentBatchAuctions.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6532" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2013-11-17T23:29:16.590" Title="Question about weighted midpoint formula" Tags="&lt;limit-order-book&gt;&lt;algorithmic-trading&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9479" PostTypeId="2" ParentId="9478" CreationDate="2013-11-17T23:29:16.590" Score="4" Body="&lt;p&gt;It depends on your goal. Suppose we have a stock whose top-of-book quotes show far more size on the bid than on the ask.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want the weighted mid to reflect sentiment &lt;em&gt;at this moment&lt;/em&gt;, then certainly the market participants agree that the fair price is less than the mid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if you assume that these participants are informed market makers and your goal is to &lt;em&gt;infer momentum&lt;/em&gt;, then the participants believe that the price will revert upwards. I.e., the fair price is higher than the mid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For trading purposes, I would go with the second one. If I see dealers quoting more on the bid than ask, then I will assume that the price will increase over time, so I want my weighted mid to reflect that.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2013-11-17T23:29:16.590" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9480" PostTypeId="2" ParentId="9476" CreationDate="2013-11-17T23:42:21.960" Score="7" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;There is no way to calculate returns here.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Let me stop you right there. You didn't open a brokerage account with zero dollars. The money you put-up for margin is your starting position. After a year of trading, you have a stopping position represented by a different amount of money in your account. The change from your starting position to your stopping is your return.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Am I right to do it like this?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Your formula for annualized Sharpe ratio is correct, assuming you didn't introduce more margin into your brokerage account to do bigger trades. For a fair comparison using P&amp;amp;L, you must have the same amount of capital that you started with.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Do you usually bootstrap your Sharpe?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I've never heard of resampling applied to performance metrics like this. At least not by industry practitioners.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2013-11-17T23:42:21.960" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9481" PostTypeId="2" ParentId="9465" CreationDate="2013-11-18T02:05:52.693" Score="0" Body="&lt;p&gt;I see the point of your requirement that can adopt to an arbitrary language; but in my perspective mastering one UI language dedicated for your need is still useful; and it helps you to nail down to a set of APIs optimized for one language.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might want to use languages like C# which is advanced in terms of presentation and UI experience; or Java. I doubt the performance of JavaScript-based web-UI apps if the data set is big. But web is the future of all the apps so the judgement is on your own ;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just a suggestion: I am a dedicated UI programmer in C# in a financial firm, currently using (or have some experience in) these APIs:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Infragistics: average performance for big data; relatively easy to use (not free).&lt;/li&gt;&#xA;&lt;li&gt;DevExpress: slow performance for big data; very easy to use (not free either).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Cheers.&lt;/p&gt;&#xA;" OwnerUserId="6032" LastActivityDate="2013-11-18T02:05:52.693" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9482" PostTypeId="2" ParentId="1356" CreationDate="2013-11-18T02:54:52.397" Score="3" Body="&lt;p&gt;First of all, AM is always greater than or equal to GM&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;x_1 + x_2 + ... + x_n \geq \sqrt[n]{x_1x_2...x_n}~\forall x_i \geq 0&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can prove it by induction from $\frac{x_1 + x_2}{2} \geq \sqrt{x_1x_2}$ or put $f(x) = \ln(x), p_i = \frac{1}{n}$ to Jensen's inequality to get it.&#xA;The equality holds when $x_1 = x_2 = ... = x_n$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For author 1 and 2,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We want to diversify (put different weight) on $n$ different assets $p_i$ (including risk-free asset) with weight $w_i$ (assuming short-selling is possible and borrowing money is possible, $w_i \in \mathbb{R}$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume those assets follow $n$ geometric brownian motion with drift $\mathbf{\mu} = (\mu_1,\mu_2,...,\mu_n)$ and the covariance matrix of their volatility term is $\mathbf{C}$. One can show that the optimal weighting vector $\mathbf{w} = (w_1,w_2,...,w_n)$ should be&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\mathbf{w} = \mathbf{C}^{-1} \mathbf{\mu}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One verify the above to the one-dimensional case $\displaystyle w = \frac{\mu}{\sigma^2}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is known as volatility pumping in literature.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The result above is optimal, that's mean any other weighting vector will underperform the above (Of course, we have assumption that the asset is really following geometric brownian motion and our estimate of $\mu$ and $\mathbf{C}$ is correct). This answer the question of author 2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the asset move, the money you invested in the assets will change accordingly and move away from the correct weight you should put. Therefore you need to rebalance your portfolio to the optimal weight.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since we cannot rebalancing continuously, there is an error with an upper bound of $\displaystyle O(\frac{1}{\sqrt{n}})$, where $n$ is the number of rebalancing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume the transaction cost of rebalancing is zero, I don't think &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The benefit of rebalancing after a 10% movement is more than 10 times&#xA;  the benefit after a 1% movement, and the benefit from rebalancing&#xA;  after a 50% move is more than 5 times the benefit after a 10% move.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;is correct for author 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For author 3,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I pointed out AM is always greater than or equal to GM with equality holds when $x_1 = x_2 = ... = x_n$. I think he is correct. When an random variable $X$, we have $\mathrm{Var}(X)$, it would implies $P(X=\mu) = 1$ for some $\mu$, or $X$ is constant almost surely. In finite case, it simply means $x_1 = x_2 = ... = x_n$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the Taylor's series expansion argument, it should be talking about the proof of &lt;a href=&quot;http://en.wikipedia.org/wiki/It%C5%8D%27s_lemma&quot; rel=&quot;nofollow&quot;&gt;Ito's lemma&lt;/a&gt; (See Informal derivation section). The idea behinds the proof is to make a taylor's expansion at $x$ and $t$.&lt;/p&gt;&#xA;" OwnerUserId="4812" LastEditorUserId="4812" LastEditDate="2013-11-18T03:03:53.817" LastActivityDate="2013-11-18T03:03:53.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9488" PostTypeId="1" AcceptedAnswerId="9491" CreationDate="2013-11-18T18:34:06.130" Score="1" ViewCount="4741" Body="&lt;p&gt;Why does the value of the SMA and EMA for the current time appear to change when I change my timescale. I'm using ActiveTrader by Fidelity, but I'm hoping there's an general phenomenon so that someone here will know what's going on.&lt;/p&gt;&#xA;" OwnerUserId="5345" LastActivityDate="2013-11-18T19:23:55.510" Title="Why does the SMA and EMA appear to be relative to the timeframe?" Tags="&lt;charts&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9489" PostTypeId="2" ParentId="1804" CreationDate="2013-11-18T18:50:24.200" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://funds.ft.com/us/Screener/PreScreen&quot; rel=&quot;nofollow&quot;&gt;http://funds.ft.com/us/Screener/PreScreen&lt;/a&gt; can screen by inception date, i.e. &amp;lt;1 yr, 1-3, 3-5, 5-10, &gt;10 years.&lt;/p&gt;&#xA;" OwnerUserId="6546" LastActivityDate="2013-11-18T18:50:24.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9491" PostTypeId="2" ParentId="9488" CreationDate="2013-11-18T19:23:55.510" Score="4" Body="&lt;p&gt;The moving average in your platform is most likely based on closing prices of whatever time frame you're visualizing. Daily data would using daily closing prices; weekly data would use weekly closing prices; 5 minute data would use 5 minute closing prices, etc. Therefore, as you change time frame the data used to calculate the moving average changes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your platform may allow you to parameterize the moving average allowing you to tell it which time frame to base the calculation on. This way, when you're looking at a 5 minute chart you can still see the 50 day moving average, etc.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2013-11-18T19:23:55.510" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9493" PostTypeId="1" AcceptedAnswerId="9522" CreationDate="2013-11-18T22:36:37.700" Score="1" ViewCount="3740" Body="&lt;p&gt;I was not able to find a similar question when searching, but if I've missed one please feel free to point me to it. Unfortunately the closest example in the textbook was not terribly helpful either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am working on a problem that asks me to make use of the binomial model for discrete time option valuation with the objective of finding the probability that a call option finishes &quot;in the money,&quot; which is to say $S - K &amp;gt; 0$ where $S$ is the security value and $K$ is the strike price of the option. The problem doesn't say anything else, so I believe I want a general probability in terms of $p$ and $q$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have primarily used the binomial model to determine the &lt;em&gt;value&lt;/em&gt; of securities and options up to this point, so I'm not sure exactly where to start to find the probability.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The formulation we have used was of this form:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V_0 = (1 + i)^{-N}E(F(S_n))$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ = (1 + i)^{-N} \sum_{j=0}^N {N \choose j} \times (S_0 \times u^j \times d^{N-j}) \times p^j \times q^{N-j}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $u$ and $d$ are the factors by which a security increases or decreases in value each period. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I started by taking this model and replacing $F(S_n)$ with $F(S_n - K)$. But thinking about it that seems to only get me the expected value. If I just focus on the probability component, which is just binomial we have $p^j * q^{N-j}$ for any given event, but with knowing the other parameters I dont know how I am supposed to find out when the option is in the money or not (for example, this would depend on the values of $u$ and $d$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any and all help would be much appreciated!&lt;/p&gt;&#xA;" OwnerUserId="6547" LastEditorUserId="343" LastEditDate="2013-11-21T19:06:05.850" LastActivityDate="2013-11-21T19:06:05.850" Title="Finding Probabilities Using The Binomial Model" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;probability&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9494" PostTypeId="2" ParentId="9493" CreationDate="2013-11-18T23:27:39.283" Score="2" Body="&lt;p&gt;First find minimum value of j that assures the option is in the money.  This would be function of u,d,n,S,K,p,q&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any particular value of j has a probability associated with it.  You gave formula above.  Then you need sum probabilities from j=min j needed to n.  See wikipedia binomial distribution to find formula for sum. Sum is based on cdf of binomial distribution.  cdf is not closed form.&lt;/p&gt;&#xA;" OwnerUserId="6532" LastActivityDate="2013-11-18T23:27:39.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9495" PostTypeId="1" CreationDate="2013-11-19T03:48:50.967" Score="2" ViewCount="437" Body="&lt;p&gt;Does an option pricing model with a closed form European option price exist that takes into account randomly distributed drift, volatility, and variance rate?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I prefer a modification to the variance gamma model, but a modification to any other model is welcome.&lt;/p&gt;&#xA;" OwnerDisplayName="user6500" LastActivityDate="2014-09-05T01:22:37.483" Title="Closed form european option prices for a variance gamma process with a randomly distributed drift, volatility, and variance rate" Tags="&lt;option-pricing&gt;&lt;stochastic-processes&gt;&lt;distribution&gt;&lt;variance-gamma&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9496" PostTypeId="1" AcceptedAnswerId="9498" CreationDate="2013-11-19T06:44:33.907" Score="2" ViewCount="8290" Body="&lt;p&gt;Let's say we have two stocks, Stock A and Stock B.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both of them have the same standard deviation $\sigma$, and therefore have the same risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only difference is that Stock A has a perfect positive correlation $\rho=1$ to the market ($\beta&amp;gt;0$), while Stock B has a perfect negative correlation $\rho=-1$ to the market of ($\beta&amp;lt;0$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to CAPM, Stock B should pay me less than the market risk-free rate while Stock A should pay me more. If both have the same amount of risk, i.e. standard deviation, then why does Stock B pay me less than Stock A? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can only think of two reasons:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;There is less market supply of negative $\beta$ stocks than positive $\beta$ stocks, and therefore a higher price for negative $\beta$ stocks and lower returns.&lt;/li&gt;&#xA;&lt;li&gt;Since the market generally has positive returns (and a positive E[r]), a stock with a market correlation ($\rho$) of -1 has generally negative returns (and a negative E[r]).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Anyone care to give their opinion on this?&lt;/p&gt;&#xA;" OwnerUserId="6550" LastEditorUserId="6550" LastEditDate="2013-11-19T20:14:09.010" LastActivityDate="2015-05-04T15:10:07.577" Title="Why do stocks with a negative beta return less than the risk free rate?" Tags="&lt;correlation&gt;&lt;beta&gt;&lt;capm&gt;&lt;standard-deviation&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9497" PostTypeId="1" CreationDate="2013-11-19T10:13:15.257" Score="14" ViewCount="361" Body="&lt;p&gt;In &lt;a href=&quot;http://research.ivo-welch.info/journalcopy/2007-rfs.pdf&quot;&gt;Goetzmann et al.'s (2007)&lt;/a&gt; paper, the authors derive a &quot;Manipulation-Proof Performance Measure&quot; (MPPM), which is a performance measure that is impervious to performance manipulation by fund managers. The authors show that rankings based on MPPM are much more resistant to intentional performance manipulation relative to other popular measures such as the Sharpe ratio, Information ratio, Jensen's alpha etc. Specifically, the MPPM of a portfolio is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\widehat{\Theta}(\rho) = \frac{1}{(1-\rho)\Delta t} \ln\left(\frac{1}{T} \sum_{t=1}^T \left(\frac{1+r_t}{1+rf_t}\right)^{1-\rho} \right) \ \ \ \ \cdots \ (1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$T =$ total number of observations&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Delta t =$ length of time between observations&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_t =$ portfolio's annualized rate of return at time $t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$rf_t =$ risk-free rate at time $t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\rho =$ can be interpreted as the coefficient of relative risk aversion &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\widehat{\Theta}$ can be interpreted as the portfolio's premium return after adjusting for risk, i.e, the portfolio has the same &quot;score&quot; (ranking) as a risk-free asset whose continuously compounded return exceeds the risk-free rate by $\widehat{\Theta}$. Also, note that $\widehat{\Theta}$ does not require any specific distribution for the portfolio returns, $r_t$.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; I am trying to derive the asymptotic properties of a modified version of this MPPM. More specifically, instead of assuming a value for $\rho$ and computing the corresponding MPPM (as was done by Goetzmann et al.), my approach is to set $\widehat{\Theta} = 0$ and compute the implied relative risk aversion coefficient (IRRAC), $\hat{\rho}$. Calculating IRRAC from Eqn.$(1)$ is relatively straightforward using Newton–Raphson method or other linear optimization methods. However, I am not sure where to begin to derive the large sample (asymptotic) properties of IRRAC. More formally, as $T \rightarrow \infty$, what can we say about $\hat{\rho}$ where $\hat{\rho}$ satisfies $\widehat{\Theta}(\hat{\rho}) = 0$?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Attempt:&lt;/strong&gt; My attempt so far has been related to a 2nd order linear approximation to Eqn.$(1)$ rather than working directly with Eqn.$(1)$. Using Taylor series expansion and properties of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Generalized_mean&quot;&gt;Generalized Mean&lt;/a&gt;, we can show that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\widehat{\Theta}(\rho) \approx \frac{1}{\Delta t} \left[\overline{x} + \frac{1-\rho}{2} \left(s_x^*\right)^2\right] \ \ \ \ \ \cdots \ (2)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\overline{x} = \frac{1}{T} \sum_{t=1}^T x_t$ where $x_t = r_t - rf_t$, i.e, the excess return of the portfolio at time $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\left(s_x^*\right)^2 = \left(\frac{T-1}{T}\right)s_x^2$ where $s_x^2 = \frac{1}{T-1}\sum_{t=1}^T (x_t - \overline{x})^2$, i.e, the sample variance of the excess return of the portfolio at time $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From Eqn.$(2)$, an approximation to $\hat{\rho}$ is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\hat{\rho} \approx \frac{2\overline{x}}{\left(s_x^*\right)^2} +1 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can we somehow derive the asymptotic distribution of $\hat{\rho}$ from this approximation?&lt;/p&gt;&#xA;" OwnerUserId="6552" LastActivityDate="2013-11-19T10:13:15.257" Title="Proving the asymptotic distribution of Manipulation-Proof Performance Measure (MPPM) (Paper by Goetzmann et al.)" Tags="&lt;statistics&gt;&lt;research&gt;&lt;mathematics&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9498" PostTypeId="2" ParentId="9496" CreationDate="2013-11-19T14:06:39.517" Score="3" Body="&lt;p&gt;Focusing on intuition rather than theory, &lt;span class=&quot;math-container&quot;&gt;$\beta$&lt;/span&gt; can also be thought of as the &amp;quot;risk premium&amp;quot; of that specific asset relative to the market.&lt;/p&gt;&#xA;&lt;p&gt;In general, market risk premium links two very important aspects of the world: Consumption &amp;amp; Return.  So if we look at the world in two states, an &amp;quot;Up State&amp;quot; &amp;amp; &amp;quot;Down State&amp;quot;, here is what we would see:&lt;/p&gt;&#xA;&lt;h2&gt;States:&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Up State: Consumption High Probability: 50%&lt;/li&gt;&#xA;&lt;li&gt;Down State Consumption Low Probability: 50%&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2&gt;Risk Free Asset:&lt;/h2&gt;&#xA;&lt;p&gt;Price: 10&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Up State: 10.1&lt;/li&gt;&#xA;&lt;li&gt;Down State: 10.1&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2&gt;Stock A&lt;/h2&gt;&#xA;&lt;p&gt;Price : 20&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Up State: 40&lt;/li&gt;&#xA;&lt;li&gt;Down State: 10&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2&gt;Stock B&lt;/h2&gt;&#xA;&lt;p&gt;Price: 20&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Up State: 10&lt;/li&gt;&#xA;&lt;li&gt;Down State: 40&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;We can calculate the &lt;span class=&quot;math-container&quot;&gt;$\mathbb{E}[r]$&lt;/span&gt; for each asset by using the formula &lt;span class=&quot;math-container&quot;&gt;$\mathbb{E}[r] \triangleq \frac{EV}{BV}-1$&lt;/span&gt;.  If we multiply the final value by the probabilities, we can see that each asset has a return of &lt;span class=&quot;math-container&quot;&gt;$\frac{40\cdot .5 + 10\cdot .5}{20} - 1 = 0.25$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;So what's the difference? The difference between the two assets are what they pay &lt;strong&gt;during different levels of consumption.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;In the &amp;quot;Up State,&amp;quot; Consumption is high.  In historical terms, think of early 2007 or 2000 -- nobody wants a stock that is paying a 1% return (recall how frothy the stock market was and how compressed yield spreads were).   In the down state, Consumption is low, think of 2002 or 2008, people weren't spending -- they were paying down their debts and increasing savings.  So an investment with a &amp;quot;positive risk premium&amp;quot; (Asset A) or &amp;quot;positive &lt;span class=&quot;math-container&quot;&gt;$\beta$&lt;/span&gt;&amp;quot; pays you a high return when consumption is high and a low return (i.e. loss) when consumption is low.&lt;/p&gt;&#xA;&lt;p&gt;That's why Stock A pays you more, you must be compensated for taking the added risk of really bad returns when consumption is low, that's what &amp;quot;compensatory&amp;quot; or market risk is based on -- illustrated by an upward sloping, convex utility function of consumption.&lt;/p&gt;&#xA;" OwnerUserId="2153" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2013-11-19T14:06:39.517" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9500" PostTypeId="2" ParentId="4434" CreationDate="2013-11-19T15:51:01.987" Score="3" Body="&lt;p&gt;For class prediction (vs. class discovery), I always transform (remove scale effects) for input features.  Metrics for features with larger scale (range) can swamp metrics of features with smaller scale.  Depending on your method (there are numerous boosting approaches), you might also consider decorrelating features.  A golden rule regarding correlated features, at least with artificial neural networks, is that during connection weight learning time will be spent on figuring out the correlation -- herein lies the reason why many use linear dimensional reduction (e.g., PCA) prior to clamping objects to the input network nodes.        &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Overall, you should probably do both (with and without).  And recall, there are choices for scaling: (a) you can remove skewness (fat-tails), (b) mean-zero standardize, and (c) normalize in range [0,1], (d) determine direction cosines of the input features so feature values are within a unit circle. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Last, never use a single classifier unless you need to.  If possible, use an ensemble of classifiers so that one classifier can pick up on problematic objects when another breaks down.  The No Free Lunch theorem states that in the universe of all cost functions, no one classifier is better than another - so never assume you have the best solution when using a single classifier.  The Ugly Ducking theorem states that no one set of features is better than another -- so never assume your selected feature set is the best.  &lt;/p&gt;&#xA;" OwnerDisplayName="user6430" LastActivityDate="2013-11-19T15:51:01.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9504" PostTypeId="2" ParentId="9466" CreationDate="2013-11-19T21:39:27.497" Score="9" Body="&lt;p&gt;The best paper is probably &lt;a href=&quot;http://www.citeulike.org/user/lehalle/article/3040736&quot; rel=&quot;nofollow&quot;&gt;Relative Volume as a Doubly Stochastic Binomial Point Process - James Mcculloch&lt;/a&gt;.&#xA;In this paper the volume is modelled via a Point Process, and theoretical laws are derived (with confident intervals, etc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And we put elements about this in &lt;a href=&quot;http://www.worldscientific.com/worldscibooks/10.1142/8967&quot; rel=&quot;nofollow&quot;&gt;Market Microstructure in Practice&lt;/a&gt;, Chap 2.1. &#xA;Volume curves are analyzed, not only during the intraday auctions (comparing the volume curves over the world in GMT), but the intensity of order sent during the prefixing auctions.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2015-10-24T22:50:13.557" LastActivityDate="2015-10-24T22:50:13.557" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9506" PostTypeId="2" ParentId="9466" CreationDate="2013-11-20T08:41:34.730" Score="4" Body="&lt;p&gt;From my point of view, dynamic models like the one developped in  &lt;strong&gt;&lt;em&gt;Relative Volume as a Doubly Stochastic Binomial Point Process - James Mcculloch&lt;/em&gt;&lt;/strong&gt; to provide a dynamic forecast of the volume does not improve significantly the forecasting comparing to a static volume curve forecast using historical data (last month intraday data, and an EWMA algorithm). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've done some analysis of this kind in the past, and i can tell that from a practical point of vue (algorithmic execution), static forecast provide good results, you will have to deal with macroeconomic days separately!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find a paper made by PragmaSecurities, &lt;strong&gt;&lt;em&gt;Static VWAP: A Comparative Analysis&lt;/em&gt;&lt;/strong&gt;, that deal with this subject for equities (but i think you can extrapolate it futures) :&#xA;&lt;a href=&quot;http://www.pragmatrading.com/sites/default/files/pdf/static_vwap_a_comparative_analysis_-_2009.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.pragmatrading.com/sites/default/files/pdf/static_vwap_a_comparative_analysis_-_2009.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6189" LastEditorUserId="6189" LastEditDate="2013-11-20T08:49:56.263" LastActivityDate="2013-11-20T08:49:56.263" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9507" PostTypeId="2" ParentId="723" CreationDate="2013-11-20T09:09:59.243" Score="0" Body="&lt;p&gt;There are three interest rates in play here:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Discounting market valuation&lt;/li&gt;&#xA;&lt;li&gt;Discounting for collateral call valuation&lt;/li&gt;&#xA;&lt;li&gt;Interest paid upon collateral (determined by the CSA terms)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In order for the collateralisation process not to generate surplus value to either participant, considering a single cashflow received today and then repaid a day later will give the answer that we need 1 = 2 = 3. Otherwise there will be a net flow of cash on today or tomorrow (or both).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, consider net flows today. The person paying for the cash flow is paying out market value &amp;amp; receiving the collateral call value. We need 1 = 2 for the two to balance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, take net flows tomorrow. That same person will be receiving the cash flow and repaying collateral with interest. For the values of these to balance then we need 2 = 3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So then 1 = 2 = 3 in our example. Discounting for market value must follow discounting at the rate determined in the collateral agreement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And since you can essentially synethesize any derivative by pasting together 1-day cashflows of this nature then this also estabishes that 1 = 2 = 3 for all derivatives.&lt;/p&gt;&#xA;" OwnerUserId="6560" LastActivityDate="2013-11-20T09:09:59.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9509" PostTypeId="1" CreationDate="2013-11-20T16:10:03.383" Score="11" ViewCount="863" Body="&lt;p&gt;Could anyone please direct me to literature or methods for extrapolating the implied volatility surface towards small expiry? I'm looking to price very short time to expiry binary options (e.g. 5 minutes).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at the implied vol surface derived from the market, the shortest available being 1 month, what are suitable interpolation/extrapolation methods for modeling the surface at maturities &amp;lt; 1 month? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've seen suggestions that at small time there are closed or near-closed asymptotic expansions for IV, would it be possible to use this as a point and some form of spline interpolation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="5980" LastActivityDate="2020-12-24T02:39:10.673" Title="Extrapolating implied volatilities to small time" Tags="&lt;options&gt;&lt;volatility&gt;&lt;interpolation&gt;&lt;binary-options&gt;&lt;extrapolation&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9510" PostTypeId="2" ParentId="9465" CreationDate="2013-11-20T16:32:25.613" Score="1" Body="&lt;p&gt;Let me give you the perfect solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use Python.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The charting, graphing and analysis can be done using the &lt;a href=&quot;http://wiki.scipy.org/PyLab&quot; rel=&quot;nofollow&quot;&gt;PyLab&lt;/a&gt; environment. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can integrate the code into R using the package called &lt;a href=&quot;http://cran.r-project.org/web/packages/rPython/index.html&quot; rel=&quot;nofollow&quot;&gt;rPython&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can integrate it to C and many other languages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Python also comes with infinite more features. So instead of looking for a particular library, use Python.&lt;/p&gt;&#xA;" OwnerUserId="6289" LastActivityDate="2013-11-20T16:32:25.613" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9511" PostTypeId="2" ParentId="948" CreationDate="2013-11-20T18:41:03.210" Score="5" Body="&lt;p&gt;Have you considered the &lt;a href=&quot;http://www.hdfgroup.org/HDF5/&quot; rel=&quot;noreferrer&quot;&gt;HDF5&lt;/a&gt; data model? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit for Louis :&lt;/strong&gt; Why using HDF5 ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As stated in the HFDF short description page : &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;HDF5 is a unique technology suite that makes possible the management&#xA;  of &lt;strong&gt;extremely large&lt;/strong&gt; and complex data collections.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;HDF5 is a suitable solution when dealing with very large datasets and you need performance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Again, as stated in the provided link, you will find &lt;a href=&quot;http://www.hdfgroup.org/why_hdf/&quot; rel=&quot;noreferrer&quot;&gt;why using HDF5&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are also using python pandas library (wich is specialy designed to work with time series), Pandas provides HDF5 support for I/O&lt;/p&gt;&#xA;" OwnerUserId="4855" LastEditorUserId="4855" LastEditDate="2013-11-20T19:29:54.357" LastActivityDate="2013-11-20T19:29:54.357" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9512" PostTypeId="2" ParentId="3518" CreationDate="2013-11-20T21:25:37.633" Score="3" Body="&lt;p&gt;I deal recently with some analysis of the Volume time series, daily volume in € for European stocks. I found out that an ARIMA model works well. But, some EWMA could also provide good forecast if it's well parameterized.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also face some seasonality effect due to macroeconomic events, some you may need to clean you data and treat these days in a different way.&lt;/p&gt;&#xA;" OwnerUserId="6189" LastActivityDate="2013-11-20T21:25:37.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9513" PostTypeId="2" ParentId="9509" CreationDate="2013-11-20T21:47:51.617" Score="3" Body="&lt;p&gt;5 minutes is a very short time period!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have access to real time data of Implied Volatility and transaction Volume of the underlying of your option than you can take a look to the following article:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.frbatlanta.org/filelegacydocs/wp0406.pdf&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;&lt;em&gt;Volatility Forecasts, Trading Volume, and the ARCH versus Option-Implied Volatility Trade-off&lt;/em&gt;&lt;/strong&gt; &lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this article, the authors use the information from daily volume and implied volatility to forecast next day volatility. The Volume is used here as a Dummy variable to switch between the ARCH and the Expectation from IV. I'm not saying that it would work for your needs, but you can take a look to it, and I would be interested on your results!&lt;/p&gt;&#xA;" OwnerUserId="6189" LastActivityDate="2013-11-20T21:47:51.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9516" PostTypeId="2" ParentId="3872" CreationDate="2013-11-21T03:16:46.620" Score="1" Body="&lt;p&gt;Speaking from personal experience, you definitely do not need anything like the first response alluded to. I'm running a pretty sophisticated outfit without the need for any monthly fees for data, you can find everything online these days. Monthly fees for trades of course can run into a few hundred bucks a month. If you work on your programing skillz and get informative data, you dont need a fancy machine just a cheap server (mine's under $30/month).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, you can scrape by with $5000 and a good automated trading algorithm (sharpe in the low 3s and trading stocks/etfs that move more than the market usually does). 15K to 20K will of course mitigate losses from fixed trading costs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like the second response suggested the AI bot is the most important piece. It just comes down to hard work, stay up late and work on this most weekday nights and weekends. Don't read books, just learn how to code and stats from the internet.&lt;/p&gt;&#xA;" OwnerUserId="5024" LastActivityDate="2013-11-21T03:16:46.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9518" PostTypeId="2" ParentId="3518" CreationDate="2013-11-21T13:45:04.200" Score="2" Body="&lt;p&gt;Try the following :&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;perform the logarithmic transformation of the volume data.&lt;/li&gt;&#xA;&lt;li&gt;check if the transformed data fits the normal distribution nicely.&lt;/li&gt;&#xA;&lt;li&gt;if you are working with intraday volume, then adjust for the seasonality for time of the day effect, if using daily data, in some cases some special seasonalities like expiry day, etc might be applied but it may not be compulsory.&lt;/li&gt;&#xA;&lt;li&gt;fit an ARMA model.&lt;/li&gt;&#xA;&lt;li&gt;if you are still not satisfied, try using a long memory process.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="6289" LastActivityDate="2013-11-21T13:45:04.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9519" PostTypeId="1" CreationDate="2013-11-21T14:10:17.150" Score="2" ViewCount="125" Body="&lt;p&gt;Is it possible to trade a derivative product priced on the &lt;em&gt;volume&lt;/em&gt; traded of some underlying security or index?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does such a derivative exist on any exchange traded markets? Or anywhere?&lt;/p&gt;&#xA;" OwnerUserId="6570" LastEditorUserId="6570" LastEditDate="2013-11-22T09:08:20.713" LastActivityDate="2013-11-22T09:08:20.713" Title="Can I trade the volume of a security or index?" Tags="&lt;exotics&gt;" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="9520" PostTypeId="2" ParentId="4043" CreationDate="2013-11-21T14:56:59.660" Score="1" Body="&lt;p&gt;I am not confident that I understand specifically what you are asking, but I hope this helps:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;What are theoretical approaches to model and answer this question? &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This question is rather broad. I will say that in comparing a random collection of purchases and sales of securities, with only the time between the transactions as varying among different individuals, the long-term players will have a rather substantial statistical advantage (both relative to the mean and standard deviation of returns) for 3 rather simple reasons:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Less brokerage fees incurred&lt;/li&gt;&#xA;&lt;li&gt;Less tax paid (most jurisdictions have capital gains tax incentives for long-term holdings)&lt;/li&gt;&#xA;&lt;li&gt;More time earning money on unrealised tax liabilities&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This of course does not take into account your premise of over pricing of short term factors. To model such a thing would need to define your question more concisely.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;How should it be quantified? What are practical ways to do this?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Are you asking what practical ways there are of taking advantage of the fact that short term trades are overcrowded? At the risk of stating the obvious, you would need to take positions in securities which are priced on short term trends, and where those prices differ substantially from your assertion of the longer term trend price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since such a trend price is likely to be more strongly linked to intrinsic value of the underlying security than short term factors, you would probably do well if you could find the underlying value of the company, compare it to the current price, and purchase stock if the price undervalues the security.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This premise is underpinned by the &quot;art&quot; of &lt;em&gt;Value Investing&lt;/em&gt; (see Benjamin Graham). While this method of investing by its nature tends to resist quantification, attempts have been made to quantify the process of &lt;em&gt;Value Investing&lt;/em&gt; strategies, such as in &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1118328078&quot; rel=&quot;nofollow&quot;&gt;Quantitative Value&lt;/a&gt;, which is an interesting read. Benjamin Graham himself employed some basic quantitative metrics for measuring the value of stocks and bonds (he quantitatively defines a &lt;em&gt;Margin of Safety&lt;/em&gt; and also suggests an upper limit of a P/E ratio of 15 as a necessary but not sufficient condition for a stock to qualify as &quot;cheap&quot; and &quot;safe&quot; - what he would call &lt;em&gt;investment grade&lt;/em&gt;), but at its heart the method is largely qualitative and not particularly amenable to the subject matter of this website.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not aware of other longer term strategies that seek long-term profits on market irrationalities specifically, but I am sure there are others out there. Value investing is probably the most logical answer to your question though, as this method - almost by its definition - seeks to capitalise on irrational short-term pricing behaviour by taking long-term positions: precisely what you were asking about.&lt;/p&gt;&#xA;" OwnerUserId="6570" LastEditorUserId="6570" LastEditDate="2013-11-24T03:20:36.787" LastActivityDate="2013-11-24T03:20:36.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9521" PostTypeId="2" ParentId="3319" CreationDate="2013-11-21T15:24:03.270" Score="0" Body="&lt;p&gt;I think you are just inverting the stuff. (Like I did) You consider Z-spread what, in fact, is OAS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OAS: discount to add to treasury &lt;strong&gt;excluding&lt;/strong&gt; the option price. (Z-spread of an equivalent bond with no option)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Z-spread: discount to add to treasury for the option bond (thus accounting for the option).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is misleading because &quot;Option Adjusted&quot; calls for a spread adjusted to reflect the value of the option in the Bond and we instinctively go for it as the actual spread to use for the bond having the option. And, off course, it should reflect a higher discount for a call option, reducing the price of the issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They should call it: &quot;Option Excluded Spead&quot; or something like this... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take care, &lt;/p&gt;&#xA;" OwnerUserId="6571" LastActivityDate="2013-11-21T15:24:03.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9522" PostTypeId="2" ParentId="9493" CreationDate="2013-11-21T16:54:55.113" Score="1" Body="&lt;p&gt;Let's just deal with the aspect of probabilities. The answer is easier than you think. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the simplest one-step model. At the end, the stock will either be up (to $Su$) or down (to $Sd$). It will move up with a probability p or down with a probability (1-p). Here's how to calculate p:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ p = \frac {e^{rT} - d}{u - d} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, consider a stock (from &lt;em&gt;Hull&lt;/em&gt;), where $ u = 1.1, d=0.9, r=0.12, T $ is 3 months. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ p = \frac {e^{0.12 \times 0.25} - 0.9}{1.1 - 0.9} = 0.6523 $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now consider a two-step model. The stock will end up in one of three states.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;uu&lt;/li&gt;&#xA;&lt;li&gt;ud or du&lt;/li&gt;&#xA;&lt;li&gt;dd&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Note that because multiplication is commutative, $S \times d \times u = S \times u \times d$, and we got to state 2 through 1 down and 1 up, not caring whether the down or the up came first. (This is a &lt;em&gt;recombining&lt;/em&gt; tree. If we have dividends, the tree does not recombine and it becomes more complex.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The probabilities that each of the states will occur will correspondingly be:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$1 \times p^2$&lt;/li&gt;&#xA;&lt;li&gt;$2 \times p \times (1-p)$&lt;/li&gt;&#xA;&lt;li&gt;$1 \times (1-p)^2$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Why the factors 1, 2, 1 at the beginning? These correspond to the different paths to get there, namely {uu}, {ud, du}, {dd} having a set size of 1, 2, and 1. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The three-step model will have four final states. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;3 u / 0 d: $1 \times p^3$&lt;/li&gt;&#xA;&lt;li&gt;2 u / 1 d: $3 \times p^2 \times (1-p)$&lt;/li&gt;&#xA;&lt;li&gt;1 u / 2 d: $3 \times p \times (1-p)^2$&lt;/li&gt;&#xA;&lt;li&gt;0 u / 3 d: $1 \times (1-p)^3$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The factors 1, 3, 3, 1 correspond to the different paths to get to the final states, namely &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;{uuu}&lt;/li&gt;&#xA;&lt;li&gt;{uud, udu, duu}&lt;/li&gt;&#xA;&lt;li&gt;{udd, dud, ddu}&lt;/li&gt;&#xA;&lt;li&gt;{ddd}&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The multipliers are the &lt;em&gt;choose&lt;/em&gt; function that you described in your question. Another way to think of this is through Pascal's Triangle.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    1&#xA;   1 1&#xA;  1 2 1&#xA; 1 3 3 1&#xA;1 4 6 4 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Once you understand the pattern, it should be fairly easy to extend. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's a much better graph than I can draw at &lt;img src=&quot;https://i.stack.imgur.com/c7IeK.png&quot; alt=&quot;http://en.wikipedia.org/wiki/File:Arbre_Binomial_Options_Reelles.png&quot;&gt;, and no discussion of binomial option trees would be complete without it. While there are 3 paths to get to each of the middle boxes at the far right, there is only 1 path to get to the top box. &lt;/p&gt;&#xA;" OwnerUserId="343" LastActivityDate="2013-11-21T16:54:55.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9523" PostTypeId="1" CreationDate="2013-11-21T17:52:03.610" Score="1" ViewCount="1516" Body="&lt;p&gt;&lt;strong&gt;Objective:&lt;/strong&gt; Get a list of all the companies that were ever part of an index (e.g.: FTSE100) in a given period of time (scale: years/decades).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Method&lt;/strong&gt; I have in mind:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;1)&lt;/strong&gt; Create an empty list k.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2)&lt;/strong&gt; Get a list of the components of the index in the starting date and add them to k.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;3)&lt;/strong&gt; Iterate 2) daily until final date without adding what is already in the list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; Find all the companies that were at some point part of FTSE100 between January 1st 1980 and August 10th 2012.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Trouble:&lt;/strong&gt; I cannot seem to find the required daily data on the components of the index. I tried Yahoo, Google and a couple of other (free) providers. I believe this must available somewhere, so I welcome your suggestions on how to get my hands on it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your input!&lt;/p&gt;&#xA;" OwnerUserId="6572" LastActivityDate="2014-01-20T19:13:48.330" Title="Components of an index in a specific date" Tags="&lt;data&gt;&lt;index&gt;&lt;historical-data&gt;&lt;tick-data&gt;&lt;database&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9524" PostTypeId="2" ParentId="9523" CreationDate="2013-11-21T17:57:21.977" Score="1" Body="&lt;p&gt;Usually the index provider has such historical data on its website. For FTSE see &lt;a href=&quot;http://www.ftse.com/Media_Centre/Downloads/FTSE_100_Constituent_History.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5620" LastActivityDate="2013-11-21T17:57:21.977" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9525" PostTypeId="1" CreationDate="2013-11-21T18:04:26.757" Score="3" ViewCount="303" Body="&lt;p&gt;I'm implementing the CVA/DVA for some interest rates derivatives, with the short rate following a Hull-White model (one factor). Once I have calibrated the model and I get the results with the simulation, a quite interesting question arose.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, say an IRS: Which is the known interest rate used to compute the accrued interest? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know how to compute it?&lt;/p&gt;&#xA;" OwnerUserId="5595" LastEditorUserId="26242" LastEditDate="2018-05-15T16:28:11.290" LastActivityDate="2018-05-15T16:28:11.290" Title="Accrued Interest in Monte Carlo simulation for CVA/DVA computation" Tags="&lt;cva&gt;&lt;accrued-interest&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="9526" PostTypeId="1" AcceptedAnswerId="9545" CreationDate="2013-11-21T20:52:07.700" Score="4" ViewCount="138" Body="&lt;p&gt;Suppose you hold a share from company $Z$ whose vaue at time $t$ is $S_0+\sigma B_t$ where $B_t$ is Brownian Motion and $\sigma$ denotes some volatility. Now lets assume that company $Z$ may go bankrupt at some expoentially-distributed random variabl $T$ with mean $1/\lambda$. Now you plan to sell your share at the first time $H$ that the price exceeds $a$, i.e $H=\inf\{t: S_0+\sigma B_t&amp;gt;a\}$. If $H&amp;lt;T$ the vaue to you is $a\exp(-rH)$, otherwise it is worth nothing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you have any idea how I can derive the optimal choice of $a$ ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My intuitive way to solve this exercise is to first check what is the probability that $H&amp;lt;T$, i.e $P(H&amp;lt;T)$ Now I think I can use the Reflection Principle, so I define $S_t=\sup (S_0+\sigma B_t)$, then the Principle states that $P(S_T&amp;gt;a)=P(H&amp;lt;T)$. I think the solution to the problem is to find the maximal $a$ such that $P(S_T&amp;gt;a)$, but I do not know how to compute $P(S_T&amp;gt;a)$. &lt;/p&gt;&#xA;" OwnerUserId="6353" LastActivityDate="2013-11-24T12:40:41.503" Title="Optimal Choice of exceeding time" Tags="&lt;risk&gt;&lt;optimization&gt;&lt;finance&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9527" PostTypeId="1" CreationDate="2013-11-21T22:56:30.923" Score="9" ViewCount="3655" Body="&lt;p&gt;Suppose you are a market maker.  So you put a limit price out and hope someone will cross bid/ask spread to take your limit.   But there is risk that bad news could come out and market will gap.  So your limit gets hit ( price goes right through your limit ) and you are stuck with immediately loss due to market gaping.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this the main worry of the market maker ?  &lt;/p&gt;&#xA;" OwnerUserId="6573" LastEditorUserId="6573" LastEditDate="2013-11-21T23:13:30.560" LastActivityDate="2020-07-31T05:31:58.240" Title="Is price gaping the major risk that market maker has?" Tags="&lt;market-making&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9528" PostTypeId="1" CreationDate="2013-11-21T22:57:22.770" Score="3" ViewCount="119" Body="&lt;p&gt;Is there an efficient and commonly used optimization method for &quot;more complex&quot; investment strategies. For instance, say you have a function $f(X_1,...,X_n,c,v)$ where the $X_k$'s are your random returns for each month/year $k$ which are determined by historical simulation or some model and $c,v\in[a,b]$ are parameters. (By &quot;more complex&quot; i mean that the function $f$ is messy enough so that optimizing it analytically is not possible.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence I want to determine $\underset{c,v}{\operatorname{argmax}}g\left(f(X_1,...,X_n,c,v)\right)$ for some function $g$. Especially I'm wondering about a pension funds perspective. Then $g$ might be a risk measure such as value-at-risk or expected shortfall. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most intuitive way would be to just simulate the random variables and determine $g(f)$ for each $c$ and $v$. However, this is very time consuming. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I saw a similar question: &lt;a href=&quot;https://quant.stackexchange.com/questions/1577/portfolio-optimization-with-monte-carlo-sampling-from-predictive-distribution&quot;&gt;Portfolio optimization with monte carlo sampling from predictive distribution&lt;/a&gt; where stochastic optimization was suggested, but without any &quot;concrete answer&quot;. However, my intuition tells me that this must be a fairly common problem in larger financial institutions, so there must exist optimization methods that are more often used than others.&lt;/p&gt;&#xA;" OwnerUserId="4709" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2013-11-21T22:57:22.770" Title="Optimizing stochastic functions numerically" Tags="&lt;optimization&gt;&lt;monte-carlo&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9529" PostTypeId="2" ParentId="9527" CreationDate="2013-11-21T23:46:19.147" Score="10" Body="&lt;p&gt;At the risk of stating the obvious: market gaps are a problem only when the market maker is holding a position and the market gaps against them. So the gap problem is really an instance of a more general problem: &lt;em&gt;inventory management&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The market maker's goal is to profit from the bid-ask spread. They prefer to be flat, but at any given moment, they could be holding some inventory, waiting to  unload it. The market can go against them at those times. It could move slowly or it could move quickly. But if the market makers cannot unload their inventory profitably, they'll lose everything they gained today ... or more. In a gap market, the probability of unloading inventory profitably falls dramatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short, inventory management it critical for risk management.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My market maker friends say they are &quot;picking up pennies in front of a steam roller.&quot; They make a little profit on each transaction; they get crushed when they're holding inventory and the market moves against them.&lt;/p&gt;&#xA;" OwnerUserId="37" LastEditorUserId="37" LastEditDate="2013-11-21T23:54:23.117" LastActivityDate="2013-11-21T23:54:23.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9530" PostTypeId="2" ParentId="9527" CreationDate="2013-11-22T01:38:49.117" Score="4" Body="&lt;p&gt;A previous responder says &quot;market gaps are a problem only when the market maker is holding a position and the market gaps against them.&quot;  This is for sure a risk, but not the only risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There also can be a problem if you don't hold a position and the market gaps.  Suppose you hold no position on Sept 11, 2001 but you have limit order to buy. You are waiting for someone to hit your bid.  But then planes hit twin towers.  Your bid is filled at limit.  Market drops 1000 points right through your bid, filling you in process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In bid situation you risk downside risk and no upside.  In holding inventory you risk downside risk but can gain in upside swing.  You cannot gain in upside swing if no inventory and waiting on bid - in this case market runs from you.&lt;/p&gt;&#xA;" OwnerUserId="6574" LastActivityDate="2013-11-22T01:38:49.117" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9531" PostTypeId="1" AcceptedAnswerId="9534" CreationDate="2013-11-22T06:50:29.463" Score="1" ViewCount="66" Body="&lt;p&gt;I am struggeling with the question, for example lets take a swap with rate of 3.2 for one year and 3.6 for 2 years and Discount Factor 0.96899 for the first year and 0.93158 for the second year.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under the assumption that cash holidings are feasible the Dicount Factor stays the same for the 3rth year if the swap rate is unknown. However this leads me to the quesion:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is the discount function non increasing if pure cash holdings are feasible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I appreciate your answer!&lt;/p&gt;&#xA;" OwnerUserId="5414" LastActivityDate="2013-11-22T09:44:16.790" Title="Why is the discount function non increasing if pure cash holdings are feasible?" Tags="&lt;finance&gt;&lt;mathematics&gt;&lt;swaps&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9533" PostTypeId="2" ParentId="9525" CreationDate="2013-11-22T09:27:49.710" Score="0" Body="&lt;p&gt;An IRS contract will state in detail what interest is payable to whom and when. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The typical vanilla Xibor IRS at present has a CSA for daily-rebalanced cash accruing at OIS rates. So the coupons are fixed on Xibor, and between coupon payments the PV is collateralised with cash, rebalanced every day using OIS interest accrual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, some old CSAs permit posting other kinds of collateral, and even a choice of currency.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2013-11-22T09:27:49.710" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9534" PostTypeId="2" ParentId="9531" CreationDate="2013-11-22T09:44:16.790" Score="3" Body="&lt;p&gt;The essence of discounting is that now is less risky than later. So a contract to deliver £1 in 1 year is more risky than one to deliver £1 tomorrow, (the counterparty could suffer a credit event) so it is worth less.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Discount factors multiply; if I know that £1 at 1y is worth £0.98 today, and £1 at 2y is worth £0.98 at 1y (i.e. equal rates for both periods), then that £1 at 2y is worth £1 x 0.98 x 0.98 = £0.9604 today.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Increasing discount factors, then, are not impossible, they just imply negative interest rates. I guess the 'pure cash holdings' assumption is that you can always at worst deposit cash at 0% risk-free, so you wouldn't invest in anything with a negative rates; i.e. negative rates wouldn't exist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in reality negative rates are quite possible, and actually the case in some markets at present. They just indicate that interest rates are low enough and costs of carry high enough that you are charged for the assurance of keeping your money safe, rather than being paid interest to use the money.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2013-11-22T09:44:16.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9535" PostTypeId="2" ParentId="8881" CreationDate="2013-11-22T18:13:22.583" Score="0" Body="&lt;p&gt;The solution can be found in, say, Bjork's book.  Assume that the two Brownian motions are uncorrelated. I'm also swapping the symbols $S_{1,T}$ and $S_{2,T}$ in the payoff function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We use the stock $S_1$ as numeraire.  Note that&#xA;$$&#xA; \frac{V_t}{S_{1,t}} = \mathbb{E}^{Q^1} \left[ \frac{S_{1,T} \max \left(S_{2,T}/S_{1,T} - 1 \right)}{S_{1,T}} \middle\vert \mathcal{F}_t \right] = \mathbb{E}^{Q^1} \left[ \max \left(\frac{S_{2,T}}{S_{1,T}} - 1 \right) \middle\vert \mathcal{F}_t \right] \; .&#xA;$$&#xA;Let $Z_t \equiv S_{2,t}/S_{1,t} $.  Since $Z_t$ is a martingale under the $Q^1$ measure by definition,&#xA;$$&#xA;dZ_t = Z_t (\sigma_2 - \sigma_1) \; dW^{Q^1} \; .&#xA;$$&#xA;We are essentially pricing a European call with strike $K=1$ for a stock $Z_t$ that has no drift but has volatility $\sigma = | \sigma_2 - \sigma_1 |$.  The price is&#xA;$$&#xA; V_t = S_{1,t} \left\{ Z_t N(d_1) - N(d_2) \right\} = S_{2,t} N(d_1) - S_{1,t} N(d_2) \; ,&#xA;$$&#xA;where $d_1 = \frac{\log Z_t + \frac{1}{2} \sigma^2 (T-t)} {\sigma \sqrt{T-t}}$ and $d_2 = d_1 - \sigma \sqrt{T-t}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also Margrabe's formula [ &lt;a href=&quot;http://en.wikipedia.org/wiki/Margrabe&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Margrabe&lt;/a&gt;'s_formula ].&lt;/p&gt;&#xA;" OwnerUserId="3188" LastEditorUserId="3188" LastEditDate="2013-11-26T05:25:34.490" LastActivityDate="2013-11-26T05:25:34.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9536" PostTypeId="2" ParentId="9446" CreationDate="2013-11-22T18:43:14.580" Score="3" Body="&lt;p&gt;Just to give you two examples.  Note that&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;$dX_t =a \; dt + dW_t$ is Markov but is not a martingale.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$dX_t=(\int_0^t X_s ds) \; dW_t$ is a martingale but is not Markov.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="3188" LastActivityDate="2013-11-22T18:43:14.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9537" PostTypeId="1" CreationDate="2013-11-22T19:23:00.497" Score="2" ViewCount="231" Body="&lt;p&gt;&lt;strong&gt;Background&lt;/strong&gt;:&#xA;The red line is an index, which goes from 0 to 100, measuring uncertainty in the markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The dark blue line is a price index, which has a lower bound at 0, and virtually no upper bound. However since it's a fixed income index, it will tend to hover around 100, compared to a stock index which can exhibit clear strong trends. Please ignore the light blue line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The analyst in question compared the correlation between the uncertainly index levels (not returns) and ETF index levels (not returns), pre and post the financial crisis and concluded that there is a disconnect post crisis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question:&lt;/strong&gt; &#xA;Is such an analysis technically correct? I've always read about never regressing prices and always returns. Specifically,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) Whilst doing a cointegration analysis, we would have regressed the two price time series and looked at the stationarity of the error term. We would have concluded that before the crsis, the error term was stationary and post cris, it is not. How does that analysis compare to simply regressing the two series like it's done here&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) Also, since these two times, by construction are somewhat stationary (as opposed to stock prices), would simply regressing the price series be okay here?&lt;img src=&quot;https://i.stack.imgur.com/NXnPs.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="6307" LastActivityDate="2013-11-22T19:23:00.497" Title="Potential pitfalls in the use of correlation" Tags="&lt;time-series&gt;&lt;correlation&gt;&lt;regression&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9538" PostTypeId="2" ParentId="9446" CreationDate="2013-11-22T19:30:51.443" Score="3" Body="&lt;p&gt;You have been given good answers above. Basically, a stochastic process ${X_t}$ is a Markov process if $P(\{X_{t} \leq x\} | \mathcal{F}_{s}) = P(\{X_{t} \leq x\} | X_{s})$, for $s \leq t$. Here $\mathcal{F}_{s}$ is a $\sigma$-algebra, a special collection of subsets of the underlying sample space $\Omega$, containing all information about the process $\{X_t\}$ up to $s$. In words this means that the distribution of the future values of $\{X_t\}$ does not depend on the path taken up to time $s$, but only on the value of $X$ at time $s$, i.e. $X_s$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A martingale must be defined in terms of conditional expectations. A process $\{Y_t\}$ is a martingale with respect to the filtation $(\mathcal{F}_{t})_{t \geq 0}$ if $E\{Y_{t+h} | \mathcal{F}_{t}\} = Y_{t}$, for all $h \geq 0$. The best prediction of $Y_{t+h}$ given all information up to time $t$ is $Y_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To connect this to your question on GBMs, if $dX_{t} = \mu X_t dt + \sigma X_t dB_t$,&#xA;then $X_{t} = X_{0}e^{(\mu - \sigma^{2}/2)t + \sigma B_t}$. Solutions to stochastic differential equations are Markov Processes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The martingale property depends on the probability measure. Discounted stock prices are martingales under the risk-neutral measure (using the money-market account as numérarie), but discounted stock prices are not martingales under the real-world probability measure.&lt;/p&gt;&#xA;" OwnerUserId="6578" LastActivityDate="2013-11-22T19:30:51.443" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9539" PostTypeId="1" CreationDate="2013-11-23T12:41:00.350" Score="1" ViewCount="98" Body="&lt;p&gt;I am facing the problem of just having this information:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;6% coupon bond with 2.5 years to maturity, traded at a 100% clean price&#xA;4% coupon bond with 1.5 years to maturity, traded at a 98% clean price&#xA;A 6M deposit with 6M rate of 5% (MMY)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And I want to get the discount factors for each maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem is, I do not know where to start to get to each discount factor. Is there a straight method for this kind of problem?&lt;/p&gt;&#xA;" OwnerUserId="5414" LastEditorUserId="56" LastEditDate="2013-12-22T17:53:20.947" LastActivityDate="2013-12-22T17:53:20.947" Title="Get discount factors with limited knowledge?" Tags="&lt;finance&gt;&lt;mathematics&gt;&lt;bond&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9540" PostTypeId="2" ParentId="9539" CreationDate="2013-11-23T15:10:02.060" Score="5" Body="&lt;p&gt;The general idea is to bootstrap the discount factors in the correct order, based on the data you have given. I'm going to make some assumptions that your bonds are paying annual coupons. The longest maturity is 2.5 years, meaning you need discount factors for 6M, 1.5Y and 2.5Y.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The 6M deposit has a rate of 5%, this tells you that you should use the 5% rate to create the 6M discount factor (you wrote 6M rate = 5%, if the 5% was expressed in yearly terms the rate applicable would have been 2.5% = 5%/2). So know you have the discount factor for 6M,&#xA;$DF_{6M} = e^{-0.05*0.5}$. To retrieve the remaining discount factors you need to formulate equations, equations relating the given bond prices to an analytical expression involving the sought discount factors. For example, assuming the notional is equal to 1,&#xA;$0.98 = 0.04 DF_{6M} + (1+0.04) DF_{1.5Y}$. But you already know $DF_{6M}$, so from this equation you can solve for $DF_{1.5Y}$. Now write a similar equation for the longest maturity bond and solve for $DF_{2.5Y}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope it helps!&lt;/p&gt;&#xA;" OwnerUserId="6578" LastActivityDate="2013-11-23T15:10:02.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9541" PostTypeId="2" ParentId="9525" CreationDate="2013-11-23T19:02:32.750" Score="-1" Body="&lt;p&gt;Accrued interest is based on a fixed floating rate, there's nothing stochastic about those rates unless the IRS is calculated in arrears, which is not the standard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are talking about the future float leg fixings, those are the forward libor rates on each path of your simulation, discounted by the zero coupon or other numeraire of your choosing, along each path of your simulation.&lt;/p&gt;&#xA;" OwnerUserId="3491" LastActivityDate="2013-11-23T19:02:32.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9542" PostTypeId="2" ParentId="8099" CreationDate="2013-11-24T01:20:53.590" Score="5" Body="&lt;p&gt;Yahoo Finance has a mapping of tickers to CIKs, which is visible on their SEC Filings pages, e.g. &lt;a href=&quot;http://finance.yahoo.com/q/sec?s=KO+SEC+Filings&quot; rel=&quot;nofollow&quot;&gt;http://finance.yahoo.com/q/sec?s=KO+SEC+Filings&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This page links to documents on EDGAR, and at the bottom of the page there is a link, &quot;View All Filings on EDGAR Online&quot;, which contains the cik as a URL parameter:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;a href=&quot;http://www.edgar-online.com/brand/yahoo/search/?cik=21344&quot; data-rapid_p=&quot;39&quot;&amp;gt;&#xA;  &amp;lt;strong&amp;gt;View All Filings on EDGAR Online&amp;lt;/strong&amp;gt;&#xA;&amp;lt;/a&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And indeed, Coca-Cola's CIK is &lt;a href=&quot;http://www.sec.gov/cgi-bin/browse-edgar?action=getcompany&amp;amp;CIK=21344&quot; rel=&quot;nofollow&quot;&gt;21344&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Incorporating pabtorre's code for easier reading:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import re&#xA;import urllib2&#xA;&#xA;def get_cik(ticker):&#xA;  ''' this function uses yahoo to translate a ticker into a CIK '''&#xA;  url = &quot;http://finance.yahoo.com/q/sec?s=%s+SEC+Filings&quot; % (ticker)&#xA;  return int(re.findall('=[0-9]*', &#xA;                        str(re.findall('cik=[0-9]*',&#xA;                                       urllib2.urlopen(url).read())[0]))[0][1:])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This can probably be tidied up a bit but I gave it a try and it worked.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Cerin's comment referenced a discussion thread that lead me to discover in fact you can query EDGAR directly with ticker names. it's not clear to me why this wasn't apparent before, perhaps it's a new feature.  If you go to &lt;a href=&quot;http://www.sec.gov/cgi-bin/browse-edgar?action=getcompany&amp;amp;CIK=KO&amp;amp;count=100&amp;amp;output=xml&quot; rel=&quot;nofollow&quot;&gt;EDGAR's Company Search&lt;/a&gt; page you can type in a ticker and get the associated CIK &lt;em&gt;and&lt;/em&gt; companies filings; here's the result page for KO again - even better, the data is served up as XML, making it very easy to parse.&lt;/p&gt;&#xA;" OwnerUserId="6585" LastEditorUserId="6585" LastEditDate="2016-04-28T13:02:22.980" LastActivityDate="2016-04-28T13:02:22.980" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9543" PostTypeId="1" AcceptedAnswerId="9544" CreationDate="2013-11-24T08:06:14.660" Score="3" ViewCount="220" Body="&lt;p&gt;What does it mean by DBR 4s of Jan4, 2037? I know the Jan4, 2037 is the maturity. How about DBR and 4s? &lt;/p&gt;&#xA;" OwnerUserId="6588" LastActivityDate="2013-11-24T11:43:40.870" Title="A basic question about market jargon" Tags="&lt;terminology&gt;&lt;jargon&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9544" PostTypeId="2" ParentId="9543" CreationDate="2013-11-24T11:43:40.870" Score="3" Body="&lt;p&gt;DBR = Deutschland Bundesrepublik&lt;/p&gt;&#xA;&#xA;&lt;p&gt;DBR 4 = German Government Bond with a coupon of 4%.&lt;/p&gt;&#xA;" OwnerUserId="6578" LastActivityDate="2013-11-24T11:43:40.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9545" PostTypeId="2" ParentId="9526" CreationDate="2013-11-24T12:40:41.503" Score="2" Body="&lt;p&gt;It's been quite a while since I did this stuff, but I'll add my input.&#xA;Please correct me if appropriate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\{H &amp;lt; T\} = \{ \sup_{0\leq s \leq T} (S_{0} + \sigma B_{s}) &amp;gt; a \} = \{\sup_{0 \leq s \leq T} B_s &amp;gt; \frac{a-S_0}{\sigma}\}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Set $\mu := \frac{a-S_0}{\sigma}$ and $M_{T} := \sup_{0 \leq s \leq T} B_{s}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, $P(\{H &amp;lt; T\} = P(\{M_T &amp;gt; \mu \}) = 2\left(1 - \Phi\left(\frac{\mu}{\sqrt{T}}\right)\right)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Seek to maximize $V(a) := E\{ae^{-rH}1_{\{H &amp;lt; T\}}\} = a \int_{0}^{\infty}\lambda e^{-\lambda x} \int_{0}^{x}e^{-ry} \frac{d}{d\xi}\left(2 \Phi\left(\frac{\mu}{\sqrt{\xi}}\right)-1\right)(y) \, dy \, dx$.&lt;/p&gt;&#xA;" OwnerUserId="6578" LastActivityDate="2013-11-24T12:40:41.503" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9546" PostTypeId="1" AcceptedAnswerId="9557" CreationDate="2013-11-25T06:27:20.163" Score="5" ViewCount="1195" Body="&lt;p&gt;Why do I often see some very deep limit buys and limit sells in a limit book? For instance the bid-ask may be \$39.00-39.01 but I see some bids at \$20 or even \$10 and some ask at \$60 or even \$500. What's the point of doing so? To capture some potential long-tail events?&lt;/p&gt;&#xA;" OwnerUserId="2570" LastActivityDate="2014-04-28T20:57:17.350" Title="Deep bid ask orders" Tags="&lt;limit-order-book&gt;" AnswerCount="4" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9547" PostTypeId="1" CreationDate="2013-11-25T07:58:31.120" Score="0" ViewCount="249" Body="&lt;p&gt;I am trying to download intra day stock data for some 7000 symbols using google url :&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;a href=&quot;https://www.google.com/finance/getprices?q=RELIANCE&amp;amp;x=NSE&amp;amp;i=60&amp;amp;p=5d&amp;amp;f=d,c,o,h,l&amp;amp;df=cpct&amp;amp;auto=1&amp;amp;ts=1266701290218&quot; rel=&quot;nofollow&quot;&gt;https://www.google.com/finance/getprices?q=RELIANCE&amp;amp;x=NSE&amp;amp;i=60&amp;amp;p=5d&amp;amp;f=d,c,o,h,l&amp;amp;df=cpct&amp;amp;auto=1&amp;amp;ts=1266701290218&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;so i am scheduling the program to be run every day, the problem i am facing is that after some url hits google block the request and redirect to bot verification page, same thing is with yahoo. Is there any other source for intrday data which doesn't block the request?&lt;/p&gt;&#xA;" OwnerUserId="6112" LastActivityDate="2013-11-25T11:10:10.010" Title="download intra day data" Tags="&lt;finance&gt;&lt;yahoo&gt;&lt;intraday&gt;&lt;google&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2013-11-25T14:54:03.927" ContentLicense="CC BY-SA 3.0" />
  <row Id="9548" PostTypeId="1" CreationDate="2013-11-25T08:27:20.550" Score="0" ViewCount="4803" Body="&lt;p&gt;I have a question from a sample exam paper that I'm having some trouble figuring out. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is: Bavarian Sausage stock has an average historical return of 16.3% and a standard deviation of 5.3%. What is the probability that the return on Bavarian Sausage will be less than 11%?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ANS:    16%&#xA;1-.5-.34 = .16&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answer provided shows the upper and lower values to be .5 and .34 (50% and 34%). How do you arrive at these figures?&lt;/p&gt;&#xA;" OwnerUserId="6596" LastActivityDate="2017-03-04T08:10:25.153" Title="Probability of a return from historical average and standard deviation" Tags="&lt;statistics&gt;&lt;probability&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9549" PostTypeId="2" ParentId="9547" CreationDate="2013-11-25T11:10:10.010" Score="0" Body="&lt;p&gt;You can try KineTick, free EndOfDay data &lt;a href=&quot;http://www.kinetick.com/end-of-day&quot; rel=&quot;nofollow&quot;&gt;http://www.kinetick.com/end-of-day&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3092" LastActivityDate="2013-11-25T11:10:10.010" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9550" PostTypeId="1" CreationDate="2013-11-25T11:42:29.757" Score="1" ViewCount="2333" Body="&lt;p&gt;I would like to know from those that have used FIX (with Simple Binary Encoding) for HFT compares with the current (proprietary) protocols in use that often vary per counterparty.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interested in bandwidth utilization and development time differences. For example, do the various FIX engines (is there a list?) that support FIX SBE allow a software team to get to market quicker with their models than having to learn each proprietary trade protocol?&lt;/p&gt;&#xA;" OwnerUserId="3424" LastEditorUserId="56" LastEditDate="2013-12-22T17:55:45.377" LastActivityDate="2014-10-08T11:51:24.247" Title="HFT enhancements for FIX (Simple Binary Encoding) vs proprietary protocols performance and cost" Tags="&lt;trading&gt;&lt;high-frequency&gt;&lt;automated-trading&gt;&lt;fix&gt;&lt;quickfix&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9551" PostTypeId="2" ParentId="9548" CreationDate="2013-11-25T13:28:59.407" Score="2" Body="&lt;p&gt;The answer assumes a &lt;strong&gt;normal distribution&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see in this &lt;a href=&quot;http://en.wikipedia.org/wiki/File%3aStandard_deviation_diagram.svg&quot; rel=&quot;nofollow&quot;&gt;graph&lt;/a&gt;, in the normal distribution:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;50% of the outcomes are in the right hand part of the distribution (i.e. higher than the mean)&lt;/li&gt;&#xA;&lt;li&gt;34% of the outcomes are between the mean and 1 standard deviation&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The question wants you to determine the probability that your stock returns less than 11%. If you notice that the 11% are exactly 1 standard deviation away from the mean (11% = 16.3%-5.3%) you know that you can compute the probability by doing:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 (all the outcomes) - 0.5 (all the outcomes above the mean) - 0.34 (outcomes between mean and standard deviation, below the mean).&lt;/p&gt;&#xA;" OwnerUserId="3424" LastEditorUserId="467" LastEditDate="2013-11-25T16:30:10.880" LastActivityDate="2013-11-25T16:30:10.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9555" PostTypeId="2" ParentId="9423" CreationDate="2013-11-26T06:24:33.047" Score="0" Body="&lt;p&gt;Based on this documentation from Moodys&#xA;&lt;a href=&quot;https://www.moodys.com/sites/products/DefaultResearch/2007300000572017.pdf&quot; rel=&quot;nofollow&quot;&gt;https://www.moodys.com/sites/products/DefaultResearch/2007300000572017.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;this section on p.3 seems to imply that it is possible for 2 senior unsecured bonds from the same obligor to have different ratings:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;“In cases where the obligor has several debt issues outstanding at a given priority in the capital structure with &#xA;different credit ratings, the lowest credit rating is taken as the reference rating.”&lt;/p&gt;&#xA;" OwnerUserId="6490" LastActivityDate="2013-11-26T06:24:33.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9557" PostTypeId="2" ParentId="9546" CreationDate="2013-11-26T07:02:45.213" Score="8" Body="&lt;p&gt;I can think of 3 reasons:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Queue position&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) To be on the other side when an alogrithm has a disastrous error, which happens quite often on singular stocks and doesn't get reported (but someone will get fined) . I've seen cases where the price will drop over 99% almost instantaneously. For this to occur a backfiring algo will clear out the entire bid schedule, but keep issuing market orders, and a smart automated market making algo will take the other side for 1 cent. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) To capture errors by manual traders. For example if they enter an extra zero on their limit order.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For (1) to be true, the orders must be relatively near to the insides. For example an order 8 levels above the insides is likely to be for (1) and (1) only. An order many hundreds of levels away is not due to (1) but due to other factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All else held equal, the probability that (2) is the reason is up to the exchange in question. Some exchanges will reverse the trades when an algo breaks down making such orders futile, others won't. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On some exchanges, (3) is not even possible since the exchange matching engine will guarantee that you receive the best possible price for your trade.&lt;/p&gt;&#xA;" OwnerUserId="6081" LastEditorUserId="6081" LastEditDate="2014-04-21T11:47:03.957" LastActivityDate="2014-04-21T11:47:03.957" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9558" PostTypeId="1" CreationDate="2013-11-26T08:06:27.510" Score="3" ViewCount="143" Body="&lt;p&gt;I came across this literature and it seems like there are a number of ways people do this. You can do it for an option on any underlying as long as you can create the risk-neutral p.d.f. &#xA;If you agree with a particular estimation method please share why and how you would use your estimates in action. More importantly, how do you interpret your estimates for different underlying assets? &lt;/p&gt;&#xA;" OwnerUserId="6605" LastActivityDate="2013-11-26T08:06:27.510" Title="Estimating risk aversion (power or exponential utility) from options prices" Tags="&lt;options&gt;&lt;risk-neutral&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9559" PostTypeId="1" AcceptedAnswerId="10113" CreationDate="2013-11-26T15:03:26.140" Score="4" ViewCount="1156" Body="&lt;p&gt;I'm simply interested on hearing some views on which shortcomings arise by using the (multidimensional) SDE $$dS(t)=S(t)\alpha(t,S(t))dt+S(t)\sigma(t,S(t))dW(t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;as a model for asset prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know this is indeed quite general question, but I've often encountered this in my studies and most likely you guys have a lot more insight into this than I can figure out myself.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorDisplayName="user1157" LastEditDate="2014-01-30T10:09:28.617" LastActivityDate="2014-01-30T15:35:51.163" Title="Shortcomings of generalized Brownian motion for asset price modelling" Tags="&lt;modeling&gt;&lt;brownian-motion&gt;&lt;sde&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9560" PostTypeId="1" CreationDate="2013-11-26T17:48:20.863" Score="1" ViewCount="515" Body="&lt;p&gt;This is my first time using Black76 to value options on IR futures and I have a question on $F$ and $K$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand the price for an IR future is usually quoted as $100 - r$.  Do I use this price as $F$ in Black76 or do I have to use $r$ and also convert the strike $K$ to an interest rate?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I have to use interest rates for $F$ and $K$, how should I treat negative rates i.e. strike prices greater than 100?&lt;/p&gt;&#xA;" OwnerUserId="6607" LastEditorUserId="6505" LastEditDate="2013-11-27T11:22:35.037" LastActivityDate="2014-07-16T05:37:00.533" Title="Black 76 for Options on Interest Rate Futures" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;futures&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9562" PostTypeId="1" AcceptedAnswerId="9955" CreationDate="2013-11-26T22:33:13.613" Score="11" ViewCount="960" Body="&lt;p&gt;I am more of a probabilist than a financial mathematician. I am currently working on the features of American put options under a particular stochastic volatility model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like most stochastic volatility models, it is incomplete. (In fact, it would be nice if someone tell me a complete, stochastic volatility model, is there any?) In my current treatment, I have just treated the model as a maths toy. I have chosen an arbitrary risk neutral measure and try to say something about the value of options. (Of course, the proofs holds in any EMM.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Though the question I asked here is not extremely closely related to what I am doing, I would still like to know:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does someone choose an EMM? Do you restrict yourself to a subclass of EMM and give yourself some parameters which you try to fit using given data?&lt;/p&gt;&#xA;" OwnerUserId="3334" LastEditorUserId="6123" LastEditDate="2013-11-27T08:44:43.457" LastActivityDate="2014-03-27T10:33:03.103" Title="How to choose a risk-neutral measure when the market is incomplete?" Tags="&lt;option-pricing&gt;&lt;risk-neutral-measure&gt;&lt;american-options&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9563" PostTypeId="1" CreationDate="2013-11-27T10:28:46.350" Score="1" ViewCount="127" Body="&lt;p&gt;It seems that the group of durations commonly used in quantitative&#xA;analyse is $\mathbf{R}$ but it seems to me that $\mathbf{R_+^*}$ could&#xA;also be an interesting choice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While I am not aware of explicit references to $\mathbf{R}$ as the&#xA;group of durations, there is a few implicit hints in quantitative&#xA;literature that this choice has been made.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The elementar theory of interest rates is constructed around the&#xA;exponential, that morphism from to $\mathbf{R}$ to&#xA;$\mathbf{R_+^*}$, thus making the implicit statement that the group&#xA;of durations is $\mathbf{R}$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The usual modelisation of the volatility in LIBOR market models can&#xA;be written in terms of the first Hermite functions (forgetting&#xA;about the constant term) which are the eigenfunctions of the&#xA;Fourier transform on $\mathbf{R}$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Choosing $\mathbf{R}$ as the group of durations has shown to be&#xA;pertinent in deterministic settings, like classical mechanics. We are&#xA;however sudying information and stochastic processes, which introduce&#xA;a great assymetry between the past and the present on one side and the&#xA;future on another side: as a practical consequence, the group&#xA;structure on $\mathbf{R}$ is more an accident than anything else,&#xA;because there is no action of the group on the information we are&#xA;considering.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems however that choosing $\mathbf{R_+^*}$ as a group of&#xA;durations might be interesting:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The group $\mathbf{R_+^*}$ operates on lognormal processes by&#xA;rescaling the volatilities (with a square root).  If $R$ is the&#xA;vector space of allowed coefficient functions for Itô processes, we&#xA;have a seemingly interesting operation of $\mathbf{R_+^*}$ on $(Rdt&#xA;   + RdW)/Rdt$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The group $\mathbf{R_+^*}$ also can operate on forward rates,&#xA;i.e. on maturities.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Did anybody explore this road? Are there any evidence that this could&#xA;be a useful point of view?&lt;/p&gt;&#xA;" OwnerUserId="6505" LastActivityDate="2013-12-06T08:44:15.380" Title="What is the right group of durations?" Tags="&lt;mathematics&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9565" PostTypeId="1" CreationDate="2013-11-27T12:14:15.060" Score="3" ViewCount="123" Body="&lt;p&gt;I am considering some hedging strategy where portfolios of derivatives are built so that each portfolio is equivalent to a floating note, even if the instruments in the portfolio might be quite complicated, e.g. &lt;em&gt;bermudean snowballs.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I plan to price numerically these portfolios in a forward LIBOR market model calibrated to swaption prices and I am wondering which accuracy I should expect on the total portfolio prices, i.e. on the pricing of floater notes.&lt;/p&gt;&#xA;" OwnerUserId="6505" LastEditorUserId="6505" LastEditDate="2013-11-27T15:08:30.337" LastActivityDate="2013-12-04T15:13:21.087" Title="How accurately can the LIBOR market model price a floating note" Tags="&lt;market-model&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9566" PostTypeId="2" ParentId="9423" CreationDate="2013-11-27T15:39:27.283" Score="3" Body="&lt;p&gt;Yes, you can have two different ratings.  The &lt;strong&gt;issuer&lt;/strong&gt; has one credit rating, but the individual issues, even if they are both senior unsecured/secured with the same maturity, coupon, etc. can have different ratings.  The key factor is going to be the structure/provisions of the issue itself.  For example, an issue with a sinking fund is going to be viewed as a lower credit risk than an issue without one, even though the two issues could potentially have the same coupon and maturity.&lt;/p&gt;&#xA;" OwnerUserId="2732" LastActivityDate="2013-11-27T15:39:27.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9567" PostTypeId="2" ParentId="998" CreationDate="2013-11-27T16:51:36.623" Score="3" Body="&lt;p&gt;I live very close to their office on Long Island and went to Stony Brook University, where they hire from at times - and the only few couple of people I know that got hired there were pure genius. I really doubt they are a ponzi scheme! I drive by their gates every now and then, definitely secretive but totally legit in my books.&lt;/p&gt;&#xA;" OwnerUserId="5769" LastActivityDate="2013-11-27T16:51:36.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9568" PostTypeId="2" ParentId="4789" CreationDate="2013-11-27T17:08:19.167" Score="0" Body="&lt;p&gt;I've tried many of these too and often it not good. It's because there are no such thing as &quot;true price&quot;. You are trying to calculate thing that doesn't exist. Probably it makes sense to work with &quot;original&quot; information - bid, ask, orderbook itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also it's important how liquid instrument is. For liquid instruments you can just use ask + bid / 2. But if instrument has only one deel per week it would be much harder to calculate &quot;truePrice&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW &quot;The mean over all prices in the order-book&quot; is bad idea as a result can be very far from the bid+ask / 2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes &quot;combinations&quot; works good. For example you can use several of your approaches at the same time and just use min or max of several calculated truePrice.&lt;/p&gt;&#xA;" OwnerUserId="1337" LastActivityDate="2013-11-27T17:08:19.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9569" PostTypeId="1" CreationDate="2013-11-27T20:46:31.767" Score="1" ViewCount="1062" Body="&lt;p&gt;It is a usual practice to calculate realized volatility $\sigma$ using the square root of the usual variance estimator $\hat{{\sigma}²}$.&#xA;This is done using the stock log returns (practitioners sometimes BS variance). It is well known that the volatility scales as square root of time $\sigma_T = \sqrt{T} \cdot \sigma_1$. This is a trivial result when you model the stock dynamics as exponential brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions are now the following, would any scaling property hold if you calculate the volatility as square root of variance of stock prices, as after all one can calculate the variance of a exponential brownian motion.&lt;/p&gt;&#xA;" OwnerUserId="5339" LastEditorUserId="2587" LastEditDate="2013-11-28T11:25:52.660" LastActivityDate="2013-11-28T14:10:52.223" Title="Basics about the scaling property of volatility" Tags="&lt;volatility&gt;&lt;estimation&gt;&lt;variance&gt;&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9570" PostTypeId="2" ParentId="8877" CreationDate="2013-11-28T00:52:42.200" Score="2" Body="&lt;p&gt;Suggest the worked examples in Chapter 5 (and for credit spreads, Chapter 17) in van Deventer, Imai and Mesler, Advanced Financial Risk Management, 2nd edition, 2013, John Wiley &amp;amp; Sons, Singapore.  Good luck.&lt;/p&gt;&#xA;" OwnerUserId="6002" LastActivityDate="2013-11-28T00:52:42.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9571" PostTypeId="1" AcceptedAnswerId="9583" CreationDate="2013-11-28T08:17:56.510" Score="2" ViewCount="1242" Body="&lt;p&gt;How do we price credit risky bonds?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I discount the cash flows using LIBOR/zero rates, it won't take the credit riskiness into account. So should I use a rate based on the issuer's credit spread? Or is there a separate way to price in credit riskiness (maybe using default probabilities)?&lt;/p&gt;&#xA;" OwnerUserId="6617" LastEditorUserId="56" LastEditDate="2013-12-22T18:00:44.757" LastActivityDate="2013-12-22T18:00:44.757" Title="Pricing credit risky bonds" Tags="&lt;fixed-income&gt;&lt;bond&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9572" PostTypeId="1" CreationDate="2013-11-28T09:14:02.273" Score="3" ViewCount="570" Body="&lt;p&gt;anybody know how to construct a intraday stock price from NASDAQ TotalView-ITCH data?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would need to know the price in millisecond, so I would need two rows: timestamp (for every millisecond) and price (best bid/ask)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any help!&lt;/p&gt;&#xA;" OwnerUserId="6618" LastActivityDate="2013-11-29T04:59:18.373" Title="constructing best bid/ask from NASDAQ TotalView-ITCH data" Tags="&lt;historical-data&gt;&lt;tick-data&gt;&lt;nasdaq&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9573" PostTypeId="2" ParentId="9569" CreationDate="2013-11-28T11:37:08.893" Score="2" Body="&lt;p&gt;I don't know what you mean by &quot;any scaling&quot; rule. For the square-root of time I can say that it only needs uncorrelated returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume that the return from time point $1$ to $T$ is called $r_{1,T}$ and that it is given as $r_{1,T} = r_1 + r_2 + \cdots + r_T =  \sum_{t=1}^T r_t$ where $r_t, t=1,\ldots,T$ are the one-period (e.g. one day) returns. The condition (the sum) holds excactly true for log-returns and approximately for simple returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then we can calculate the variance&#xA;$$&#xA;VAR(r_{1,T}) = VAR(\sum_{t=1}^T r_t) = \sum_{t=1}^T VAR(r_t),  &#xA;$$&#xA;where the covariance terms vanish as we assume that the returns are uncorrelated. Otherwise we would have more covariance terms $COV(r_i,r_j)$ for $i \neq j$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we furthermore assume that $VAR(r_t)  = \sigma^2$ for $t=1,\ldots,T$ (this is stationary variance) then we get&#xA;$$&#xA;VAR(r_{1,T}) = \sum_{t=1}^T \sigma^2 = T \sigma^2.  &#xA;$$&#xA;and by taking the square-root we get the square-root of time scaling for volatility.&#xA;Note that we have used log-returns and that we have assume uncorrelated returns and stationary variance - nothing more.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2013-11-28T14:10:52.223" LastActivityDate="2013-11-28T14:10:52.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9574" PostTypeId="2" ParentId="9572" CreationDate="2013-11-28T13:32:06.637" Score="3" Body="&lt;p&gt;To construct best bid/ask from ITCH you must build a book incrementally from the messages in the data. Every message, except for system oriented messages, and non-displayed Trades, represent an order or an action on an order. Process the data, build a book, and you will naturally be left with the best bid/ask at the top of each side.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2013-11-28T13:32:06.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9575" PostTypeId="1" CreationDate="2013-11-28T14:57:28.377" Score="11" ViewCount="1516" Body="&lt;p&gt;Consider the setting of mean-variance portfolio optimisation: &lt;span class=&quot;math-container&quot;&gt;$n$&lt;/span&gt; assets with expected returns &lt;span class=&quot;math-container&quot;&gt;$\overline{r}_1,...,\overline{r}_n$&lt;/span&gt; and standard deviations &lt;span class=&quot;math-container&quot;&gt;$\sigma_1,...\sigma_n$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;For a certain fixed &lt;span class=&quot;math-container&quot;&gt;$\sigma$&lt;/span&gt; I am currently trying to derive a closed formula for highest rate of return (i.e. given &lt;span class=&quot;math-container&quot;&gt;$\sigma$&lt;/span&gt; I am trying to find the corresponding efficient portfolio on the efficient frontier of the feasible set).&lt;/p&gt;&#xA;&lt;p&gt;For example, if one wants to compute the minimum variance portfolio we can find the weights by simply computing&#xA;&lt;span class=&quot;math-container&quot;&gt;$$w_i = \frac{\sum_{k=1}^n \sigma_{k,i}^{-1}}{\sum_{j,k=1}^n \sigma_{k,j}^{-1}}$$&lt;/span&gt;&#xA;where &lt;span class=&quot;math-container&quot;&gt;$\sigma_{k,i}^{-1}$&lt;/span&gt; is the entry &lt;span class=&quot;math-container&quot;&gt;$(k,i)$&lt;/span&gt; in the inverse covariance matrix &lt;span class=&quot;math-container&quot;&gt;$\Sigma^{-1}$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Now, given &lt;span class=&quot;math-container&quot;&gt;$\sigma$&lt;/span&gt;, how do we find the highest possible &lt;span class=&quot;math-container&quot;&gt;$\overline{r}$&lt;/span&gt;? Using Lagrange multipliers I have derived the following equations, but am unsure whether I am going into the right direction:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$2\cdot\lambda\cdot\sum_{k=1}\sigma_{i,k}w_k = -\mu - \overline{r}_i \quad\quad \forall i=1,...,n$$&lt;/span&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\sum_{i,j=1}^n w_i w_j \sigma_{i,j}=\sigma^2$$&lt;/span&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\sum_{i=1}^n w_i = 1$$&lt;/span&gt;&#xA;How do I find the weights &lt;span class=&quot;math-container&quot;&gt;$w_1,...,w_n$&lt;/span&gt; for the efficient portfolio given a fixed value of &lt;span class=&quot;math-container&quot;&gt;$\sigma$&lt;/span&gt;?&lt;/p&gt;&#xA;" OwnerUserId="6621" LastEditorUserId="41390" LastEditDate="2020-10-25T03:27:01.180" LastActivityDate="2020-10-25T03:27:01.180" Title="Formula for the efficient portfolios in mean-variance optimisation?" Tags="&lt;optimization&gt;&lt;modern-portfolio-theory&gt;&lt;variance&gt;&lt;mean-variance&gt;&lt;standard-deviation&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="9576" PostTypeId="1" AcceptedAnswerId="9610" CreationDate="2013-11-28T20:18:45.317" Score="6" ViewCount="355" Body="&lt;p&gt;In several papers it is argued that for many Itô diffusion processes,&#xA;$$dX_t = a(t,X_t)dt+b(t,X_t)dB_t,$$&#xA;in mathematical finance the distribution of $X_T$ for fixed $T&amp;gt;0$ is unknown, which makes Monte Carlo simulations viable if not necessary even for the calculation of European options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, all models used in mathematical finance that come immediately to my mind are processes for which the distribution is known, such as geometric Brownian motion and the Cox-Ingersoll-Ross process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What would be examples for diffusion processes, preferably widely used, of the above form for which the distribution of $X_T$ is unknown?&lt;/p&gt;&#xA;" OwnerUserId="5656" LastEditorUserId="5656" LastEditDate="2013-12-02T10:27:48.770" LastActivityDate="2013-12-02T19:48:01.247" Title="Itô diffusion processes in finance with unknown distribution at a terminal value" Tags="&lt;stochastic-processes&gt;&lt;finance&gt;&lt;stochastic-calculus&gt;&lt;financial-engineering&gt;&lt;sde&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9577" PostTypeId="1" CreationDate="2013-11-28T20:28:29.480" Score="2" ViewCount="1072" Body="&lt;p&gt;I'm trying to implement a Kalman Filter for the parameter estimation of a linear gaussian two factor model in Matlab. (Schwartz Smith model for commodity prices) In other words: I try to compute the log-likelihood of the parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My model:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_t = A  X_{t-1} + \epsilon_X$ , with X beeing two-dimensional.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Y_t = \begin{pmatrix}&#xA;1  \\&#xA;1&#xA;\end{pmatrix}^T  X_t + \epsilon_Y$ , with Y beeing one-dimensional.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$A$ is time invariant and only depends on the parameters $\theta$, which I would like to determine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whats the variance of $\epsilon_Y$ ? I know, that it normally represents the noise of the measurement process, but I don't know what would be the equivalent in an economic context?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I managed to implement the filter and the results for experimenting with the variance are (mean = 0):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;For high variance: High log-likelihood in unreasonable areas far away from the real values. &lt;/li&gt;&#xA;&lt;li&gt;For very (!) small variance: Reasonable results close to real values, but extremly small &lt;em&gt;log&lt;/em&gt;-likelihoods around $-10^{12}$. I fear, that this will cause numerical issues in the upcoming maximum likelihood estimation. (I plan to use Metropolis Hastings)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Any help would be appreciated! Thanks!&lt;/p&gt;&#xA;" OwnerUserId="6624" LastActivityDate="2013-11-29T06:45:15.293" Title="Maximum Likelihood using a Kalman filter for two factor model" Tags="&lt;kalman&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9578" PostTypeId="1" AcceptedAnswerId="9582" CreationDate="2013-11-29T02:36:04.817" Score="2" ViewCount="375" Body="&lt;p&gt;Are there any known quantitative techniques to distinguish between market makers and other participants?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I manually MFT, have no knowledge of these specialties, and may be observing phenomena that really aren't there, but it seems that when I'm working an order between the spread, trying for a better than best offer price, the IV will drift away from its current average against my favor.  In fact, if I move my offer away from the opposing best, the best offer immediately moves to my previous offer with no change in underlying price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, if I'm bidding X, the offer is X+0.01, and the underlying moves from Y to Y-0.01, my order is not hit, but after I move my bid to X-0.01, and the underlying remains at Y-0,01, the ask moves to X.  I think I observe the analogue when selling as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm sure I leave signatures that indicate I am not algorithmically trading that I'm identified as a non-market maker, so is that why I'm perceiving this phenomenon, or is it merely coincidence?  If my observations are valid, what techniques are used to identify my orders as non-market making?&lt;/p&gt;&#xA;" OwnerDisplayName="user6500" LastActivityDate="2013-11-29T08:33:29.180" Title="Distinguish between market makers and other participants?" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;market-making&gt;&lt;algorithmic-trading&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9579" PostTypeId="2" ParentId="9577" CreationDate="2013-11-29T04:08:35.550" Score="2" Body="&lt;p&gt;Usually $var(e_x), var(e_y)$  variances are calibrated by maximum likelihood from data similar as you want to calibrate your parameters $\theta$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ratio $var(e_x)/var(e_y)$ tells you what are changes in your time-series&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$var(e_x)/var(e_y)$ is small: changes in time-series of observations are just noise and underlying state doesn't change much;&lt;/li&gt;&#xA;&lt;li&gt;$var(e_x)/var(e_y)$ is large: changes are due to change of state and observations data represent states almost exactly, without noise.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What you describe is reasonable:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;&quot;For high variance: High log-likelihood in unreasonable areas far away from the real values&quot;&lt;/em&gt; - if noise is high it is likely to have observations in a wide band around realized observations. In that case if you filter with KF it will smooth your data hardly to recover true states.&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;&quot;For very (!) small variance: Reasonable results close to real values, but extremly small log-likelihoods around&quot;&lt;/em&gt; - if noise variance is small, then your observations are unlikely to deviate anywhere from expected and this means you assume that your realized observations are almost exactly reflect your states so if you filter with KF it will pass via all you observations without any smoothing.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="6394" LastEditorUserId="6394" LastEditDate="2013-11-29T06:45:15.293" LastActivityDate="2013-11-29T06:45:15.293" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9580" PostTypeId="2" ParentId="9572" CreationDate="2013-11-29T04:59:18.373" Score="0" Body="&lt;p&gt;No choice to construct the book. Now the decision you have to make is for how many stocks you want to compute the bid-ask spreads and for how many days. You can use SAS but it is slow - so it may be fine for a few stocks on one day. Otherwise, Python is the best alternative (or C++). &lt;/p&gt;&#xA;" OwnerUserId="2570" LastActivityDate="2013-11-29T04:59:18.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9581" PostTypeId="2" ParentId="9576" CreationDate="2013-11-29T08:02:56.520" Score="3" Body="&lt;p&gt;If you allow $X_t$ to be two dimensional then a model with a stock price $X_t^1$ and its variance process $X_t^2$ (stochastic volatility) would fit your definition. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In such cases to my knowledge we often don't have a closed form of the density of $X_T^1$ but in some cases we have a closed form of the Laplace transform.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example is the &lt;a href=&quot;http://math.nyu.edu/~atm262/fall06/compmethods/a1/nimalinmoodley.pdf&quot; rel=&quot;nofollow&quot;&gt;Heston model&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2013-11-29T12:14:17.613" LastActivityDate="2013-11-29T12:14:17.613" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9582" PostTypeId="2" ParentId="9578" CreationDate="2013-11-29T08:33:29.180" Score="2" Body="&lt;p&gt;It's got nothing to do with you being identified as a market maker or not. It is simply that the other participants at that time are passive traders. The choice between hitting a bid or lighting a new level with a new offer are distinct and very different (especially, in some markets, in terms of fees paid or rebates received).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, you're not being identified as a non-market maker, you're simply trading in a market full of other passive limit traders (&quot;market makers&quot; either official or not). When you fade your bid some other participant sees an opportunity to improve the offer and does so. &lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2013-11-29T08:33:29.180" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9583" PostTypeId="2" ParentId="9571" CreationDate="2013-11-29T13:54:20.520" Score="2" Body="&lt;p&gt;Normally, you do indeed add a credit spread $s$ to the risk-free spreads to price the bond.    That is, if the coupons are $c_i$ at times $t_i$ and the notional is $Y$ then you price it as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;R\!B(t) =Y \exp{\left( -\int_t^T s(x)+r(x) dx  \right) } +\sum_{i \ni t_i&amp;gt;t}^{N_c} c_i \exp{\left( -\int_t^{t_i} s(x)+r(x) dx  \right) }&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Normally you have too little information to incorporate a term structure for $s$, so you just make it some constant $s_0$.  Once in a while you have enough information from other bonds or credit default swaps to determine a term structure.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2013-11-29T13:54:20.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9584" PostTypeId="1" CreationDate="2013-11-29T13:55:50.010" Score="1" ViewCount="84" Body="&lt;p&gt;Pretty basic question - what is the SIGN that should be used in cell A1 of the EIOPA Solvency II OF-B1 report?  So should share capital be displayed with a positive or negative value?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CP-13 extract:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/HswOQ.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As this wasn't clear from the LOG file..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/pRjib.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="5883" LastEditorUserId="5883" LastEditDate="2013-11-29T15:44:57.140" LastActivityDate="2013-11-29T15:44:57.140" Title="OF-B1 report - cell A1" Tags="&lt;solvency-ii&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9585" PostTypeId="1" AcceptedAnswerId="9609" CreationDate="2013-11-29T13:56:47.523" Score="3" ViewCount="463" Body="&lt;p&gt;Say I hold an equity and I want to calculate the Value-at-Risk over some period. Would one calculate the Value-at-Risk of the equity under a risk-neutral (as in martingale) measure or under the initial measure (arbitragefree and complete market assumed)? If for instance the asset price is assumed to be a Brownian motion, Risk neutrality (possibly) changes the drift and thus has significant consequences on the Value-at-Risk. So what is appropriate? And why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My guess is that one should indeed use the risk-neutral measure because the risk under the martingale measure is the ginuine risk that cannot be hedged. But I need a more throrough and formal explanation.&lt;/p&gt;&#xA;" OwnerUserId="6627" LastEditorUserId="6627" LastEditDate="2013-11-29T14:06:50.333" LastActivityDate="2013-12-02T12:26:42.490" Title="Which measure to determine Risk?" Tags="&lt;risk&gt;&lt;martingale&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9586" PostTypeId="1" CreationDate="2013-11-29T14:04:21.213" Score="6" ViewCount="6113" Body="&lt;p&gt;I'm looking for c/c++ implementation of &lt;a href=&quot;http://en.wikipedia.org/wiki/Order_book_%28trading%29&quot; rel=&quot;noreferrer&quot;&gt;OrderBook&lt;/a&gt;. I need implementation to reconstruct market data from FAST. I don't need to do &quot;matching&quot; because it already did by exchange, I only need to &quot;aggregate&quot; such structures:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;struct OrderUpdate {&#xA;    int32_t instrumentId;&#xA;    uint32_t MDEntryID;&#xA;    uint32_t MDUpdateAction;      // 0 - New 1 - Change 2 -Delete&#xA;    int64_t MDEntryPx_Mantissa;&#xA;    int16_t MDEntryPx_Exponent;&#xA;    int64_t MDEntrySize_Mantissa;&#xA;    int16_t MDEntrySize_Exponent;&#xA;    uint32_t RptSeq;&#xA;    uint32_t MDEntryTime;&#xA;    uint32_t OrigTime;&#xA;    int32_t SecurityTradingStatus;&#xA;    char MDEntryType;    // 0 - buy; 1 - sell; other values in documentation&#xA;    char MsgType;&#xA;};&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Main requirement is, of course, speed. I've found in internet several projects:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.ociweb.com/products/liquibook&quot; rel=&quot;noreferrer&quot;&gt;http://www.ociweb.com/products/liquibook&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/chuvpilo/OrderBook&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/chuvpilo/OrderBook&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/jordanbaucke/Limit-Order-Book&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/jordanbaucke/Limit-Order-Book&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://code.google.com/p/rex-matching-engine/&quot; rel=&quot;noreferrer&quot;&gt;https://code.google.com/p/rex-matching-engine/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.quantcup.org/&quot; rel=&quot;noreferrer&quot;&gt;http://www.quantcup.org/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Unfortunately most of these implementations are &quot;matching&quot; engines and not exactly what I'm looking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is better to use to reconstruct orderbook from FAST messages?&lt;/p&gt;&#xA;" OwnerUserId="1337" LastActivityDate="2013-11-29T14:24:17.373" Title="open-source implementation of orderbook from FAST?" Tags="&lt;programming&gt;&lt;limit-order-book&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="9587" PostTypeId="1" CreationDate="2013-11-29T14:06:49.507" Score="4" ViewCount="770" Body="&lt;p&gt;Is it possible to introduce dummy variables or explanatory variables in the GARCH variance equation (&lt;code&gt;garchset&lt;/code&gt; and &lt;code&gt;garchfit&lt;/code&gt;) in Matlab?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is done in the mean (ARMAX) equation through the input &lt;code&gt;Regress&lt;/code&gt; in &lt;code&gt;garchset&lt;/code&gt;, but I have not seen how it can be done for the variance equation as well. So how can I find a closed form solution to do it? I will appreciate any advice on the question.&lt;/p&gt;&#xA;" OwnerUserId="6148" LastEditorUserId="19645" LastEditDate="2016-02-26T16:53:03.583" LastActivityDate="2016-03-05T12:11:29.090" Title="Does Matlab support exogenous variables in GARCH models?" Tags="&lt;time-series&gt;&lt;garch&gt;&lt;matlab&gt;&lt;quantitative&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9588" PostTypeId="2" ParentId="9586" CreationDate="2013-11-29T14:24:17.373" Score="10" Body="&lt;p&gt;You don't just simply grab some random open source order book implementation and expect it to work. Every market is different. For example, markets have different rules for how you should handle priority in the order book (some are price-time, some are price-size-time, etc). Grabbing Joe Blow's code and expecting it to just work is only going to lead to pain and failure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have two separate issues. First, you must decode the FAST messages, and second you must build a book from them based on the specifications from the exchange and market in question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your question to be even be well-formed you should indicate exactly where the data is coming from. Of course, there is probably a 0% chance that someone is going to be able to provide an affirmative reference for you where you can download a working order book for the data you have.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2013-11-29T14:24:17.373" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="9589" PostTypeId="1" AcceptedAnswerId="9600" CreationDate="2013-11-29T18:30:53.957" Score="4" ViewCount="1552" Body="&lt;p&gt;I will not attach the whole code 'cause it would be just a huge waste of space and it would be not useful for this question's purpose.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I am going to attach here is a snippet code and its output, which shows what I'm not able to understand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The output&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Today is November 29th, 2013&#xA;Settlement date is December 4th, 2013&#xA;Evaluation date is November 29th, 2013&#xA;&#xA;Actual and implied curve evaluated at November 29th, 2013&#xA;The reference date is December 4th, 2013 for the Actual curve&#xA;The reference date is June 3rd, 2014 for the Implied curve&#xA;&#xA;---- Actual ----- Implied&#xA;&#xA;1 - 0.995917 --- 0.995485&#xA;2 - 0.990663 --- 0.987753&#xA;3 - 0.981329 --- 0.975887&#xA;4 - 0.966947 --- 0.959062&#xA;5 - 0.947756 --- 0.938374&#xA;6 - 0.925654 --- 0.914803&#xA;7 - 0.900713 --- 0.889055&#xA;8 - 0.874264 --- 0.862391&#xA;9 - 0.847481 --- 0.835015&#xA;10 - 0.819623 --- 0.806789&#xA;&#xA;We've just amended the evaluation date from November 29th, 2013 to May 29th, 2014&#xA;&#xA;Actual and implied curve evaluated at May 29th, 2014&#xA;The reference date is June 3rd, 2014 for the Actual curve&#xA;The reference date is June 3rd, 2014 for the Implied curve&#xA;&#xA;---- Actual ----- Implied&#xA;&#xA;1 - 0.995917 --- 0.995917&#xA;2 - 0.990673 --- 0.990673&#xA;3 - 0.981353 --- 0.981353&#xA;4 - 0.966986 --- 0.966986&#xA;5 - 0.947756 --- 0.947756&#xA;6 - 0.925689 --- 0.925689&#xA;7 - 0.900707 --- 0.900707&#xA;8 - 0.874121 --- 0.874121&#xA;9 - 0.847552 --- 0.847552&#xA;10 - 0.819667 --- 0.819667&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This output shows that, if your evaluation date is equal to November 29th, 2013 and you ask for an implied term structure whose reference date is on June 3rd, 2014, you get two curves that are different, as you would expect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, if you amend the evaluation date setting it to June 3rd, 2014 and ask for the implied term structure, the latter changes its shape.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The snippet code&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;...&#xA;            // +---------------------------------&#xA;            // | Dates at which to forecast term structures&#xA;            // +---------------------------------&#xA;&#xA;            Period forwardPeriod = 6 * Months;&#xA;&#xA;            Date forwardDate = calendar.advance(todaysDate, forwardPeriod);&#xA;            Date forwardSettlementDate = calendar.advance(forwardDate, settlementDays, Days);&#xA;&#xA;            // +---------------------------------&#xA;            // | Implied term structure&#xA;            // +---------------------------------&#xA;&#xA;            RelinkableHandle&amp;lt;YieldTermStructure&amp;gt; actualDiscountCurve;&#xA;            actualDiscountCurve.linkTo(depoSwapTermStructure);&#xA;            boost::shared_ptr&amp;lt;YieldTermStructure&amp;gt; impliedDiscountCurve(new ImpliedTermStructure(    actualDiscountCurve,        // Handle&amp;lt;YieldTermStructure&amp;gt;&#xA;                                                                                                    forwardSettlementDate       // Date referenceDate&#xA;                                                                                                ));&#xA;&#xA;            // +---------------------------------&#xA;            // | Printing today's discount factors&#xA;            // +---------------------------------&#xA;&#xA;            std::cout &amp;lt;&amp;lt; std::endl;&#xA;            std::cout &amp;lt;&amp;lt; &quot;Actual and implied curve evaluated at &quot; &amp;lt;&amp;lt; todaysDate &amp;lt;&amp;lt; std::endl;&#xA;            std::cout &amp;lt;&amp;lt; &quot;The reference date is &quot; &amp;lt;&amp;lt; actualDiscountCurve-&amp;gt;referenceDate() &amp;lt;&amp;lt; &quot; for the Actual curve&quot; &amp;lt;&amp;lt; std::endl;&#xA;            std::cout &amp;lt;&amp;lt; &quot;The reference date is &quot; &amp;lt;&amp;lt; impliedDiscountCurve-&amp;gt;referenceDate() &amp;lt;&amp;lt; &quot; for the Implied curve&quot; &amp;lt;&amp;lt; std::endl;&#xA;            std::cout &amp;lt;&amp;lt; std::endl;&#xA;            std::cout &amp;lt;&amp;lt; &quot;---- Actual ----- Implied&quot; &amp;lt;&amp;lt; std::endl;&#xA;            std::cout &amp;lt;&amp;lt; std::endl;&#xA;&#xA;            for(Time d = 1; d &amp;lt;= 10.0; d+= 1.0)&#xA;            {&#xA;                std::cout &amp;lt;&amp;lt; d &amp;lt;&amp;lt; &quot; - &quot; &amp;lt;&amp;lt; depoSwapTermStructure-&amp;gt;discount(d) &amp;lt;&amp;lt; &quot; --- &quot; &amp;lt;&amp;lt; impliedDiscountCurve-&amp;gt;discount(d) &amp;lt;&amp;lt; std::endl;&#xA;            }&#xA;&#xA;            // +---------------------------------&#xA;            // | Evaluate the bond with the implied curve at forward date&#xA;            // +---------------------------------&#xA;&#xA;            discountingTermStructure.linkTo(impliedDiscountCurve);&#xA;            Settings::instance().evaluationDate() = forwardDate;&#xA;            std::cout &amp;lt;&amp;lt; std::endl;&#xA;            std::cout &amp;lt;&amp;lt; &quot;We've just amended the evaluation date from &quot; &amp;lt;&amp;lt; todaysDate &amp;lt;&amp;lt; &quot; to &quot; &amp;lt;&amp;lt; forwardDate &amp;lt;&amp;lt; std::endl;&#xA;&#xA;            // +---------------------------------&#xA;            // | Printing discount factors at forward date&#xA;            // +---------------------------------&#xA;&#xA;            std::cout &amp;lt;&amp;lt; std::endl;&#xA;            std::cout &amp;lt;&amp;lt; &quot;Actual and implied curve evaluated at &quot; &amp;lt;&amp;lt; forwardDate &amp;lt;&amp;lt; std::endl;&#xA;            std::cout &amp;lt;&amp;lt; &quot;The reference date is &quot; &amp;lt;&amp;lt; actualDiscountCurve-&amp;gt;referenceDate() &amp;lt;&amp;lt; &quot; for the Actual curve&quot; &amp;lt;&amp;lt; std::endl;&#xA;            std::cout &amp;lt;&amp;lt; &quot;The reference date is &quot; &amp;lt;&amp;lt; impliedDiscountCurve-&amp;gt;referenceDate() &amp;lt;&amp;lt; &quot; for the Implied curve&quot; &amp;lt;&amp;lt; std::endl;&#xA;            std::cout &amp;lt;&amp;lt; std::endl;&#xA;            std::cout &amp;lt;&amp;lt; &quot;---- Actual ----- Implied&quot; &amp;lt;&amp;lt; std::endl;&#xA;            std::cout &amp;lt;&amp;lt; std::endl;&#xA;&#xA;            for(Time d = 1; d &amp;lt;= 10.0; d+= 1.0)&#xA;            {&#xA;                std::cout &amp;lt;&amp;lt; d &amp;lt;&amp;lt; &quot; - &quot; &amp;lt;&amp;lt; depoSwapTermStructure-&amp;gt;discount(d) &amp;lt;&amp;lt; &quot; --- &quot; &amp;lt;&amp;lt; impliedDiscountCurve-&amp;gt;discount(d) &amp;lt;&amp;lt; std::endl;&#xA;&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My question is related to my goal, which I briefly describe in the following points:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;with the evaluation date equal to today, I want to get the implied term structure with reference date equal to today + 6M;&lt;/li&gt;&#xA;&lt;li&gt;with the evaluation date equal to today + 6M, I want to price a bond whose &lt;code&gt;DiscountingBondEngine()&lt;/code&gt; uses the implied term structure above;&lt;/li&gt;&#xA;&lt;li&gt;this would allow me to estimate a kind of &quot;Theta&quot; for the bond according to a forecast (*) of the discount curve and not of a constant curve.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Anyone could clarify how to do such a thing &lt;strong&gt;without having a completely changed implied term structure after the evaluation date amending&lt;/strong&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(*) Actually, the forecast coming from the forward rates curve.&lt;/p&gt;&#xA;" OwnerUserId="3058" LastEditorUserId="3058" LastEditDate="2013-11-30T20:31:38.440" LastActivityDate="2013-11-30T21:15:54.067" Title="How to manage evaluation date changes in QuantLib while using ImpliedTermStructure Class" Tags="&lt;fixed-income&gt;&lt;programming&gt;&lt;yield-curve&gt;&lt;quantlib&gt;&lt;theta&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9590" PostTypeId="1" AcceptedAnswerId="9594" CreationDate="2013-11-29T19:10:50.030" Score="1" ViewCount="240" Body="&lt;p&gt;I have possibility of taking 2 types of real time streams from some exchange:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;bid-ask quotes (fresh quotes from order book)&lt;/li&gt;&#xA;&lt;li&gt;transaction log (transactions matched by exchange)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'm curious what information can give transaction log stream to market participants to give them advantage what I will not have using only bid-ask quotes stream or what advantage gives transaction log data at all.&lt;/p&gt;&#xA;" OwnerUserId="6175" LastActivityDate="2013-11-30T02:47:21.617" Title="Quotes and Transactions Streams from Exchange" Tags="&lt;limit-order-book&gt;&lt;quote&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9591" PostTypeId="2" ParentId="9590" CreationDate="2013-11-29T20:47:44.297" Score="1" Body="&lt;p&gt;These are two separate and distinct pieces of data. The relative &quot;advantage&quot; or &quot;disadvantage&quot; of one over another is entirely up to you and your model, not some rule of thumb. Each data set provides &quot;one half&quot;, if you will, of the view of the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quotes tell you what passive participants are willing to do. They are, in effect, an indication of interest to trade a certain size at a certain price. Think of this as &quot;what might happen&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Transactions tell you, essentially, &quot;what has happened&quot;. They are the prices and sizes that aggressive traders matched with passive traders. They are, by definition, historical only and are not forward looking unlike a quote which is in effect until cancelled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can not derive one data set from the other. They are separate and distinct. To have a full view of the market and what is happening, you need both.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2013-11-29T20:47:44.297" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9594" PostTypeId="2" ParentId="9590" CreationDate="2013-11-30T02:41:57.780" Score="1" Body="&lt;p&gt;They are both just partial reflections (not including the order book) of the real process that happens in exchange. If you want to answer the question yourself, it's essential to learn how Exchange's Matching Engines work. The real underlying information is what enters into the  matching engine (what traders send to it). For the sake of simplicity, there are just 3 types of messages:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;send_order (buy/sell, limit_price, quantity);&lt;/li&gt;&#xA;&lt;li&gt;cancel_order (order_id);&lt;/li&gt;&#xA;&lt;li&gt;replace_order (order_id, new_price, new_quantity)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The matching engine converts this process into different type of market data updates:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;transaction (price, quantity)&lt;/li&gt;&#xA;&lt;li&gt;order_book_update (... various formats)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Then your data provider may extract the best bid/ask from the order book. Once you know the process, it's up to you to decide (according to the characteristics of your strategy and the budget) which information is required, how detailed, and how fast should it be.&lt;/p&gt;&#xA;" OwnerUserId="1515" LastEditorUserId="1515" LastEditDate="2013-11-30T02:47:21.617" LastActivityDate="2013-11-30T02:47:21.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9598" PostTypeId="1" AcceptedAnswerId="9601" CreationDate="2013-11-30T17:50:06.580" Score="1" ViewCount="102" Body="&lt;p&gt;currently I am reading a paper called &quot;Portfolio optimisation under non-linear drawdown constraints in a semimartingale financial model&quot; for self-study reasons. The paper can be found here:&#xA;&lt;a href=&quot;http://arxiv.org/abs/1110.6289&quot; rel=&quot;nofollow&quot;&gt;http://arxiv.org/abs/1110.6289&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There, I found an equation I don't understand. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Chapter 7 the authors are trying to calculate a wealth process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The wealth process $X_t$ satisfies the following SDGL&#xA;$$dX_t = (X_t - w(\bar{X_t}))\frac{dV_t}{V_t}, (1)$$ since in chaper 7 everthing is continuous.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The process $V_t$ satisfies the follwing equation&#xA;$$dV_t=\pi_tdS_t := \sum{\pi_t^i}dS_t^i ,   (2) $$&#xA;for a preversibel $\pi_t$ and a d-dim semi-martingal $S_t$ with SDGL for every $i$&#xA;$$dS^i_t = S^i_t(\mu^i_t dt+\sum\sigma^{ij}_t dW^j_t) ,  $$&#xA;where $W_t = (W^1_t,\dots,W^d_t)$ is a d-dim  Wiener process.&#xA;Now the authors claim that by plugging $(2)$ in $(1)$ they obtain:&#xA;$$dX_t = (X_t - w(\bar{X_t}))\sum\pi^i_t\frac{dS_t^i}{S^i_t} , (3) $$ &#xA;where $\pi^i_t = (\frac{1}{1-\gamma(1-\alpha)}\theta'_i\sigma^{-1}_t)^i $. &#xA;I think the exact form of $\pi_i$ shouldn't matter, only that it is preversible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: How do the authors came up with $(3)$? The way I'am doing it is:&#xA;$$dX_t = (X_t - w(\bar{X_t}))\sum\pi^i_t\frac{dS_t^i}{V_t} .$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sadly, only $(3)$ seems to be consisting with the literature (one can find a similar solution for $(3)$ in &quot;On Portfolio Optimization under &quot;Drawdown&quot; Constraints&quot; &lt;a href=&quot;http://www.math.columbia.edu/~ik/Drawdown.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.math.columbia.edu/~ik/Drawdown.pdf&lt;/a&gt;) . What am I doing wrong? &lt;/p&gt;&#xA;" OwnerUserId="6640" LastActivityDate="2013-11-30T22:54:16.150" Title="Problems to understand a stochastic DGL equality" Tags="&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9599" PostTypeId="2" ParentId="9559" CreationDate="2013-11-30T19:10:37.643" Score="1" Body="&lt;p&gt;I dont know what you want to hear, but i have several points for you:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The main driver of uncertainty is a Wiener process, which goes back to the discrete binomial model for stock prices. In reality the main stochastic source could be something completly different. &lt;/li&gt;&#xA;&lt;li&gt;$\alpha$ and Vola $\sigma$ are depending directly on your stockprice. Why should they? the could easily depend on your Wiener-Process like in the CIR or Vasicec model.&lt;/li&gt;&#xA;&lt;li&gt;The Drift $\alpha$ and Vola $\sigma$ a depending both of $S_t$ and therefore no exogenous impacts can be modeled. Consider: $\alpha$ and $\sigma$ are both adapted on your Wiener-Filtration coming form $W$. This filtration at time $t$ can be interpreted as all the information you saw in the stockprices up to that point. In reality the Vola or Drift may change due to things that happen not depending on the stock market. Think of small random disturbends genereted by news in politics or catastrophes. For this are Stochstic Volatilty models needed.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="6640" LastActivityDate="2013-11-30T19:10:37.643" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9600" PostTypeId="2" ParentId="9589" CreationDate="2013-11-30T21:15:54.067" Score="5" Body="&lt;p&gt;It's hard to be sure without seeing the inputs, but I'm guessing that the implied curve changes shape because the original curve does (which you can see from your output: except for the 1-year and 5-years points, the actual discounts are different).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason the original curve changes is probably the different position of weekends or holidays (so that, for instance, the 1-month deposit might span 30, 31 or 32 calendar days); when you move the evaluation date, the actual curve uses the same rates over slightly different tenors which causes the discount factors to come out different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The implied curve is not so smart that it takes this into account; as you probably saw from its implementation, it's just a rescaling of the discount factors so that the discount factor at the new reference date is 1. Therefore, when the evaluation date is at today, it has the same shape as the original curve, and not the shape that the original curve would have at today+6M; when the evaluation date moves, the implied curve takes the new shape of the actual curve (as a matter of fact, it &lt;em&gt;equals&lt;/em&gt; the actual curve).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want the implied curve to maintain the same shape, you have to force the original curve to do the same. The way to do it depends on what specific term-structure class you're using; but for most of them, one workable solution should be to prevent the reference date of the original curve to move when you move the evaluation date. Instead of using the constructor that takes a number of settlement days and a calendar (as I'm guessing you're doing now) try using the one that takes an explicit reference date. The curve you'll build this way will keep that same reference date (and thus its shape) when the evaluation date changes, and in turn this should conserve the shape of the implied curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More information on the way that term structures move with the evaluation date is at &lt;a href=&quot;http://implementingquantlib.blogspot.com/2013/09/chapter-3-part-1-of-n-term-structures.html&quot; rel=&quot;noreferrer&quot;&gt;http://implementingquantlib.blogspot.com/2013/09/chapter-3-part-1-of-n-term-structures.html&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Oh, and thanks for the question. You just gave me one of my next blog posts...&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2013-11-30T21:15:54.067" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9601" PostTypeId="2" ParentId="9598" CreationDate="2013-11-30T22:54:16.150" Score="1" Body="&lt;p&gt;I haven't read all the paper, just the section you mentioned.  The previsible/predictable strategy $\pi_t$ represents the number of shares of the asset $S$ held at time $t$.  The paper looks to use power utility in some way, and as is common in those types of problems, generally you want to think of $\tilde{\pi}_t$, which is the percentage of wealth at time $t$ held in the risky assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Towards the bottom of p. 21, you can see that they define &#xA;$$&#xA;\tilde{\pi}_t := \pi_t S_t / V_t.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using $\tilde{\pi}_t$ instead of $\pi_t$ solves your problem I believe.  Also, equation (22) on p. 22 shows that the optimal $\tilde{\pi}$ has the form you describe above.&lt;/p&gt;&#xA;" OwnerUserId="3415" LastActivityDate="2013-11-30T22:54:16.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9604" PostTypeId="1" AcceptedAnswerId="10432" CreationDate="2013-12-01T14:09:29.210" Score="8" ViewCount="2556" Body="&lt;p&gt;I've read that realized kernels are the thing to use for calculating daily volatility from high-frequency data. So I've got minute data, how do I actually use such a kernel? Will it give me minute-ly volatility, do I have to normalize it somehow? Also, what data do I feed it - minute data since the start of the trading day, one day's worth of data, all historical data I have until this point, or something else?&lt;/p&gt;&#xA;" OwnerUserId="1217" LastEditorUserId="2299" LastEditDate="2014-03-02T17:42:32.543" LastActivityDate="2014-03-02T17:42:32.543" Title="How to use a realized kernel?" Tags="&lt;volatility&gt;&lt;market-microstructure&gt;&lt;estimation&gt;&lt;kernel&gt;&lt;intraday&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9605" PostTypeId="1" CreationDate="2013-12-01T14:14:46.397" Score="1" ViewCount="1110" Body="&lt;p&gt;I have a list of monthly returns of a 10 year Govt Bond. I am not sure if this is a good proxy for the monthly risk free rate of return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can somebody suggest how I can derive the monthly risk free rate of return from this monthly return of Govt Bonds. &#xA;Ofcourse, this is just a simple case. I don't want to take in account any default probabilities of the Govt (Sovereign risk etc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simple put is the monthly return of a 10 Year Govt bond a good proxy for risk free rate over a month?&lt;/p&gt;&#xA;" OwnerUserId="6644" LastActivityDate="2014-03-03T07:46:04.823" Title="Given monthly returns of 10-Year Govt Bond, how to get monthly risk free rate of return" Tags="&lt;finance&gt;&lt;bond&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9606" PostTypeId="1" AcceptedAnswerId="9607" CreationDate="2013-12-02T04:11:17.823" Score="2" ViewCount="381" Body="&lt;p&gt;I'm reading &quot;Principle of Economics&quot; by Mankiw. In Part III Market and Welfare, Ch 8 &quot;Application: the costs of taxation&quot;, it says:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Only 32% of a cut in U.S. labor taxes would be self-financed, the economists note, versus 54% self-financing in Europe. Just over 50% of a cut in U.S. capital taxes would pay for itself, the authors estimate, versus 79% in Europe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what does it mean by a tax cut be &quot;self-financing&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;self-financing&#xA;adj&#xA;(of a student, business, etc.) financing oneself or itself without external grants or aid&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So &quot;self-financing&quot; means someone can sustain without external aid. I just could not get it what a tax needs to be &quot;self-financing&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/pWhp9.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2013-12-02T10:13:15.263" Title="What does it mean by &quot;labor taxes cut is self-financed&quot;?" Tags="&lt;economics&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9607" PostTypeId="2" ParentId="9606" CreationDate="2013-12-02T10:05:37.377" Score="2" Body="&lt;p&gt;What is meant is the so called &lt;a href=&quot;http://en.wikipedia.org/wiki/Laffer_curve&quot; rel=&quot;nofollow&quot;&gt;Laffer effect or Laffer curve&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rationale is that when you cut taxes that this will stimulate business and thereby over-compensate the loss in taxes the government originally had.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2013-12-02T10:13:15.263" LastActivityDate="2013-12-02T10:13:15.263" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9608" PostTypeId="2" ParentId="9605" CreationDate="2013-12-02T12:12:37.460" Score="4" Body="&lt;p&gt;I would answer your question with no. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;First: what do you need the risk free rate for? If you want to price equity derivatives then probably a short money market rate would better fit this purpose.&lt;/li&gt;&#xA;&lt;li&gt;Second: the maturity. Look at yield curves. The short end is usually at a very different level than the 10 year rate. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So two times no. A small &quot;no&quot; for taking government rates for the risk free rate and a big &quot;no&quot; for taking the 10 year rate for a monthly rate.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2014-03-03T07:46:04.823" LastActivityDate="2014-03-03T07:46:04.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9609" PostTypeId="2" ParentId="9585" CreationDate="2013-12-02T12:26:42.490" Score="1" Body="&lt;p&gt;I strongly recommend not assesing risk using the risk neutral measure. Doesn't this already sound like a contradiction (risk and risk-neutral)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The risk neutral measure is there to derive prices (for derivatives e.g.) that fit to the prices of related contracts and traded assets. With &quot;fit&quot; I mean not allowing for arbitrage. For example if I calculate the forward price of a stock then I implicitely use the risk neutral probability measure and avoid arbitragy of trading the underlying spot. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The drift/expected value is related to interest rates and dividends due to arbitrage considerations - neither due to any risk considerations nor due to any idea where the spot price of the underlying could really be in the future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you call the other measure the physical measure then this is the one that should be used to measure risk. The problem is that it is by far not unique. For example if you measure risk by volatility (just as a starting point) then it is known that many volatility estimators exist. You can look at different observation periods, you can use weighted methods or e.g. GARCH. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Very often the expected value/drift of the asset whose risk you want to measure is assumed to be zero. For short periods of time this is very reasonable. Coming up with an expected value different from zero you risk to mix up your &quot;trading idea&quot; with your risk measure - which is in my mind not a good thing to do.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2013-12-02T12:26:42.490" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9610" PostTypeId="2" ParentId="9576" CreationDate="2013-12-02T16:46:49.470" Score="1" Body="&lt;p&gt;Any of a wide variety of local vol models, where (from your equation) $b(\cdot,\cdot)$ is some fitted surface, are unlikely to have closed-form solutions for the terminal distribution.  Indeed it's well-known that these models tend to have very unusual forward term structures of volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a specific example, take $b(\cdot,\cdot)$ to be an approximation derived from the first few terms of the 2-d Fourier representation of some high-resolution local vol fit $\tilde{b}(\cdot,\cdot)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Our SDE becomes&#xA;$$ dX_t=\mu(t)dt+dB_t\sum_{\vec{k}} \omega_{\vec{k}} \exp\left( i\vec{c}_{\vec{k}}\cdot \binom{t}{X_t} \right)   $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm pretty sure there will be no closed form.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2013-12-02T19:48:01.247" LastActivityDate="2013-12-02T19:48:01.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9612" PostTypeId="1" CreationDate="2013-12-02T21:06:05.127" Score="3" ViewCount="855" Body="&lt;p&gt;Is there an a name for the approach / strategy to artificially move a price either up or down by high volume buying or shorting. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;ie. Buying a large (say 5%) of a stock very quickly, thus artificially&#xA;  forcing the price up and then quickly selling of the asset once its&#xA;  risen.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;A) Is it the general consensus that if you buy a high volume of a stock (relative to the available stock) in a short period of time it will force the price up. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;B) Is it legal to do this ? &lt;/p&gt;&#xA;" OwnerUserId="3489" LastEditorUserId="848" LastEditDate="2013-12-03T15:02:14.973" LastActivityDate="2013-12-03T15:02:14.973" Title="Forcing price to rise or fall by high volume buying and shorting" Tags="&lt;volume&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9613" PostTypeId="2" ParentId="9612" CreationDate="2013-12-02T21:43:46.423" Score="3" Body="&lt;p&gt;What you refer to is called Layering, this is absolutely forbidden on every market as you would volontarily send misleading signal as to volume and then price.&#xA;Regulators have been fining people A LOT recently for such market manipulations as they are obvious.&#xA;Do not attempt to do such things !&lt;/p&gt;&#xA;" OwnerUserId="5339" LastActivityDate="2013-12-02T21:43:46.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9614" PostTypeId="2" ParentId="9612" CreationDate="2013-12-02T22:38:50.040" Score="10" Body="&lt;p&gt;This is called momentum ignition, and it is illegal. Any &quot;manipulative&quot; behaviour is illegal. I &lt;a href=&quot;http://www.sec.gov/answers/tmanipul.htm&quot;&gt;quote the SEC&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Manipulation is intentional conduct designed to deceive investors by controlling or artificially affecting the market for a security. Manipulation can involve a number of techniques to affect the supply of, or demand for, a stock. They include: spreading false or misleading information about a company; improperly limiting the number of publicly-available shares; or rigging quotes, prices or trades to create a false or deceptive picture of the demand for a security. Those who engage in manipulation are subject to various civil and criminal sanctions.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Layering or spoofing is another thing entirely, and is also illegal but harder to prove orders are non-bonafide unless the behaviour is egregious. These behaviours rely on creating a false sense of size on one side of the market to push it towards passive orders resting on another side of the market. For example, let's say I bid 15.00 and offer 15.01. If my 15.00 bid gets hit I then bid extreme size at 14.99 to give the impression of a large buying interest. Other participants tick the market higher, lifting my 15.01 offer. This is illegal because my order(s) at 14.99 are not &quot;bonafide&quot; as I don't intend to actually buy, but am instead trying to trick other participants to move the market higher.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your example is momentum ignition because you hope others will follow you higher so that you can sell the stock back to them. It does you no good to buy up all the stock between say, 15.00 and 15.05, if no bids follow behind you so that you can sell back to them at a price greater than your cost basis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example of enforcement action against layer/spoofing: &lt;a href=&quot;https://www.sec.gov/News/PressRelease/Detail/PressRelease/1365171484972&quot;&gt;https://www.sec.gov/News/PressRelease/Detail/PressRelease/1365171484972&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastEditorUserId="1355" LastEditDate="2013-12-03T12:26:31.370" LastActivityDate="2013-12-03T12:26:31.370" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9615" PostTypeId="2" ParentId="9560" CreationDate="2013-12-03T08:31:46.393" Score="1" Body="&lt;p&gt;I've ended up implementing a different model for -ve rates.  I've used Bachelier's (Guassian) model that allows negative values.  Most of the IR futures options are short-dated so model differences are within my tolerance. &lt;/p&gt;&#xA;" OwnerUserId="6607" LastActivityDate="2013-12-03T08:31:46.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9616" PostTypeId="1" AcceptedAnswerId="9627" CreationDate="2013-12-03T13:37:25.477" Score="10" ViewCount="1327" Body="&lt;p&gt;The quadratic optimization (min variance)&#xA;$$&#xA;w^{T} \Sigma w \rightarrow \text{min},&#xA;$$&#xA;where $w$ is the vector of portfolio weights and $\Sigma$ is the covariance matrix of asset returns, is a well studied problem. In practice we have to define certain constraints. These are easy linear, continuous ones (like $\sum_{i=1}^n w_i = 1$ or constraints on turn over) or difficult binary constraints (if an asset is bought than with at least $x\%$, a cardinality constraint, etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Setting $\hat{w} = w_{Pf} - w_{BM}$ as the vector of active weights of the portfolio relative to a benchmark, the above formula describes minimizing the (squared) tracking error. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The difficult binary constraints lead to mixed integer programming (MIP). Commercial solvers solve this by methods such as &lt;a href=&quot;http://en.wikipedia.org/wiki/Branch_and_bound&quot; rel=&quot;noreferrer&quot;&gt;branch and bound&lt;/a&gt; which are very time consuming for large problems (e.g. 1000+ assets).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I heard of an approach to formulate such problems as &lt;a href=&quot;http://en.wikipedia.org/wiki/Second-order_cone_programming&quot; rel=&quot;noreferrer&quot;&gt;second order cone programs (SOCP)&lt;/a&gt; and that such problems are usually solved more efficiently.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have plenty of experience with branche and bound and I would like to switch to SOCP. Do you know of any good refernce of SOCP and portfolio/TE optimization with hard real world constraints (especially with binary variables)? Do you have any experiences whether switching is worth the efforts?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: Let us assume that $\Sigma$ is well estimated and that variance makes sense. I know that this is debatable ...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&#xA;This paper Applications of second-order cone programming describes the formulation of a quadratically constrainted quadratic program as SOCP.&#xA;Will also have a look &lt;a href=&quot;http://www.stanford.edu/mwg-internal/de5fs23hu73ds/progress?id=jLj3389xg6&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT 2:&#xA;To formulate every detail.&#xA;I have the mixed-inter quadratic program (I formulate the TE case):&#xA;$$&#xA;w^{T} \Sigma w  + w^T c \rightarrow \text{min},&#xA;$$&#xA;with $0 \le w_i \le u$ for $i = 1,\ldots, N$ with $N \approx 1000$ and a constant vecor $c$. The constraints are of the form&#xA;$$&#xA;w_i \ge b_i*l \text{ for } i = 1,\ldots,N \\&#xA;\sum b_i \le K \\&#xA;b_i \in \{0,1\} \text{ for } i = 1,\ldots,N&#xA;$$&#xA;with a small real $l \in (0,1)$ and some large integer $K$.&#xA;Moreover I have lots of continuous constraints&#xA;$$&#xA; A w \le b.&#xA;$$&#xA;If I am totally precise then there are additional continuous variables that appear in the constraints only (these model turn over).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I follow the link above then this can be formulated as mixed SOCP with&#xA;$$&#xA; t \rightarrow \text{min}.&#xA;$$&#xA;and all the above constraints and one additional constraint:&#xA;$$&#xA;\| \Sigma^{1/2} w + \Sigma^{-1/2}c \| \le t.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a chance that the mixed-integer SOCP problem as formulated above can be solved more efficiently than the mixed-integer quadratic program (with linear and binary but no quadratic constraints)?&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="41390" LastEditDate="2020-11-19T04:32:49.483" LastActivityDate="2020-11-19T04:32:49.483" Title="Minimum Variance and Minimum Tracking Error portfolio as second order cone program" Tags="&lt;portfolio-optimization&gt;&lt;modern-portfolio-theory&gt;&lt;optimization&gt;&lt;mean-variance&gt;&lt;tracking-error&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="12" ContentLicense="CC BY-SA 4.0" />
  <row Id="9621" PostTypeId="1" CreationDate="2013-12-04T11:58:49.523" Score="1" ViewCount="451" Body="&lt;p&gt;I understand that there are no official figures of fx trading volume per currency, but are there any good estimates?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any fx exchange that is particularly forthcoming with its volume data, say on a monthly basis? Googling the answer has only been partially helpful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I am not a professional quant, but this is related to professional consulting for a large fund, so I figured this was a good place to ask.)&lt;/p&gt;&#xA;" OwnerUserId="6658" LastActivityDate="2014-08-27T06:14:35.187" Title="Estimate of fx trading volume" Tags="&lt;fx&gt;&lt;volume&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9622" PostTypeId="2" ParentId="9565" CreationDate="2013-12-04T15:13:21.087" Score="2" Body="&lt;p&gt;Calibrating to swaption prices would give you the right volatilities for your model, but you have to use the floating notes (or similar instruments, as swaps) in order to get the right drifts. In any case, your model have to be able to exactly replicate the floating notes prices in order to be considered a valid model, and you can feel comfortable to use it with more exotic products.&lt;/p&gt;&#xA;" OwnerUserId="6356" LastActivityDate="2013-12-04T15:13:21.087" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9623" PostTypeId="1" CreationDate="2013-12-04T16:33:20.270" Score="7" ViewCount="774" Body="&lt;p&gt;I have a very large covariance matrix (around 10000x10000) of returns, which is constructed using a sample size of 1000 for 10000 variables. My goal is to perform a (good-looking) Cholesky decomposition of this matrix. However, as expected, this matrix is near-singular with very small ( &amp;lt; 10^-10 ) eigenvalues (around 5K-6K out of 10K). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried a naive approach; doing an eigenvalue decomposition, and setting all the eigenvalues that are less than 10^-10 to 10^-10. In other words, if eigenvalue &amp;lt; 10^-10, then eigenvalue = 10^-10. After that, I reconstructed the matrix with the modified eigenvalue matrix. However, although I can perform Cholesky decomposition, it is very unstable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the best way to handle this PD approximation for large matrices?&lt;/p&gt;&#xA;" OwnerUserId="6660" LastEditorUserId="467" LastEditDate="2015-10-08T07:50:34.620" LastActivityDate="2015-10-08T07:50:34.620" Title="How to treat large (5K-10K) non-positive-definite (particularly near-singular) covariance matrices for Cholesky decomposition?" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;correlation-matrix&gt;&lt;random-matrix-theory&gt;&lt;covariance-matrix&gt;" AnswerCount="4" CommentCount="13" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9624" PostTypeId="1" AcceptedAnswerId="17200" CreationDate="2013-12-04T19:12:50.160" Score="1" ViewCount="1230" Body="&lt;p&gt;The revised version of Assets D1 (now &lt;strong&gt;S.06.02 – List of assets&lt;/strong&gt; under CP13) requires the following aggregations (&lt;a href=&quot;http://www.bafin.de/SharedDocs/Downloads/EN/Leitfaden/dl_lf_solvency_guidelines_submission_of_information_061113.pdf?__blob=publicationFile&quot; rel=&quot;nofollow&quot;&gt;page 24&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;CIC 71 (Cash), only one line per currency is to be reported;&lt;/li&gt;&#xA;&lt;li&gt;CIC 72 (Transferable deposits (cash equivalents)), only one line per pair(bank, currency) is to be reported;&lt;/li&gt;&#xA;&lt;li&gt;CIC 73 (Other deposits short term (less than one year)), only one line&#xA;per pair(bank, currency) is to be reported;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;CIC codes however are prefixed with a country code.  So my question is - should this report have just ONE line per currency, or one line per currency per XX71 code?  (and similarly for the other points..).  If the former, then how should the CIC code be represented?  (presumably 'CIC71').  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:  I don't see how this can be 'one line per currency' - as we also need to split between Life / Nonlife and RFFs..  Also, would 'look through' cash balances be aggregated too? &lt;/p&gt;&#xA;" OwnerUserId="5883" LastEditorUserId="5883" LastEditDate="2013-12-04T22:37:42.637" LastActivityDate="2015-04-01T15:59:58.477" Title="Solvency II Assets-D1 - aggregation of line items by CIC code" Tags="&lt;solvency-ii&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9625" PostTypeId="1" AcceptedAnswerId="9666" CreationDate="2013-12-04T19:38:26.417" Score="3" ViewCount="802" Body="&lt;p&gt;I am interested in the securitazion process and am looking for useful examples to help me understand how it can be applied &lt;strong&gt;in practice&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming I have a loan portfolio consisting of secured* and unsecured loans. The loans are further assigned a (internally assigned) risk rating. The loan payments are in a local currency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming I want to securitize this loan portfolio into tranches identified by:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;secured/unsecured&lt;/li&gt;&#xA;&lt;li&gt;risk rating&lt;/li&gt;&#xA;&lt;li&gt;currency exposure hedged* (or not)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;My question is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would I go about securitizing my existing loan portfolio into the tranches described above? What are the required steps?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anyone recommend an spreadsheet template online that I can use as a starting point for this exercise?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[[ Notes ]]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The collateral backing the secured loans fall into two categories: moveable and immovable assets&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;For the sake of simplicity/familiarity etc. assume that the currency hedging is done against the USD.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1733" LastEditorUserId="1733" LastEditDate="2013-12-04T23:56:53.187" LastActivityDate="2013-12-09T03:32:30.143" Title="Securitization of a loan portfolio" Tags="&lt;hedging&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9626" PostTypeId="2" ParentId="3319" CreationDate="2013-12-05T04:53:57.113" Score="3" Body="&lt;p&gt;Z-spread is the all-in spread, meaning spread from the risk profile AND from the call risk. The OAS factors out (subtracts) the additional spread associated with the embedded option, so the OAS will be lower. It's more useful than Z-spread because it allows for apples-to-apples comparisons between bullet maturities &amp;amp; callables. Remember, Z-spread is the spread that, when be added to the discount rate, will equate cash flows to price so this will naturally include spread from all sources, whereas OAS will not include the spread specifically from the option cost. &lt;/p&gt;&#xA;" OwnerUserId="6665" LastActivityDate="2013-12-05T04:53:57.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9627" PostTypeId="2" ParentId="9616" CreationDate="2013-12-05T04:59:07.730" Score="7" Body="&lt;p&gt;Without the discrete constraints, the minimum tracking error/variance problem is a quadratic program.  If you constrain the tracking error, you have a convex quadratically-constrained problem which is solved as an SOCP by modern commercial solvers.  SOCP does not address discrete constraints like cardinality of assets or minimum investment levels.  SOCP deals with continuous convex constraints.  Those constraints make the feasible region non-convex.  As an example, a portfolio of 50% A and 50% B has just 2 assets, and a portfolio of 50% B and 50% C has two assets, but any convex combination of those two portfolios will have 3 assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Linear vs. SOCP and continuous vs mixed-integer are orthogonal concepts.    Mixed-integer solvers usually require search trees.  The linear vs. SOCP determines what problem is solved at each node in the search tree.  With the commercial solvers cplex, and &lt;a href=&quot;http://www.gurobi.com/products/gurobi-optimizer/gurobi-overview&quot; rel=&quot;nofollow noreferrer&quot;&gt;Gurobi&lt;/a&gt; you can have continuous linear, mixed-integer linear, quadratic/SOCP continuous and quadratic/SOCP mixed-integer.  There's a &lt;a href=&quot;https://www.youtube.com/watch?feature=player_detailpage&amp;amp;v=y-uUDhOK1y0#t=520&quot; rel=&quot;nofollow noreferrer&quot;&gt;video&lt;/a&gt; by Gurobi on SOCP that has an aside on the futility of trying to make names for all the combinations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is possible for a good commercial solver to reliably solve problems like you describe with 1000's of assets in a reasonable amount of time (seconds to a few minutes), which combine sophisticated heuristics and &lt;a href=&quot;https://en.wikipedia.org/wiki/Branch_and_cut&quot; rel=&quot;nofollow noreferrer&quot;&gt;branch-and-cut&lt;/a&gt; algorithms.  The actual performance you will observe is very dependent on how you formulate the constraints and the quality of the solver.  There are a lot of ways to improve a formulation.  For example, the cardinality constraints are usually modeled with indicator variables&#xA;$$&#xA;y_i = \left\{\begin{array}{ll} 1 &amp;amp; \mbox{if $w_i &amp;gt; 0$} \\ 0 &amp;amp; \mbox{otherwise}  \end{array}\right.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is enforced with constraints&#xA;\begin{eqnarray}&#xA;w_i &amp;amp;\le y_i &amp;amp;\hspace{1in} \forall i \in \{1, \ldots, n\} \\&#xA;\sum_{i = 1}^n y_i  &amp;amp;\le k &amp;amp;&#xA;\end{eqnarray}&#xA;where $k$ is the cardinality limit.  The constraint $w_i \le y_i$ is very weak, however.  If you know of an a-priori upper bound on the $w_i$, say $u_i$, the you can add the constraint $$w_i \le u_i y_i$$ to the model.  If $u_i$ is much smaller than $1$, then the continuous relaxation at the nodes will be tighter and help prune the branching tree and guide the heuristics.  You can get an upper bound on the $w_i$ either from an explicit constraint (hard limit on the weight of any single asset), or from deriving it from the problem.j&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are actually trying to explicitly minimize $w^{T} \Sigma w$ for 1000's of assets, that means $\Sigma$ has over 1,000,000 entries and you have explicitly estimated the covariance of every pair of assets.  This is both difficult or impossible to do reliably and inefficient from a computation standpoint.  It would be better to make a &lt;a href=&quot;https://quant.stackexchange.com/questions/1914/which-approach-to-estimating-fundamental-factor-models-is-better-cross-sectiona&quot;&gt;factor model&lt;/a&gt;, where the returns on asset $i$ would be given by $r_i =  \epsilon_i + \sum_j \beta_{ij} r_j$.  Where $j$ indexes the factors, and $\sigma_i$ would be the variance of $\epsilon_i$.  If  $\Sigma^f$ was the variance/covariance of the factor returns, then you would have an objective&#xA;$$&#xA;\mbox{minimize} f^T \Sigma^f f + \sum_i \sigma_i^2 w_i^2 &#xA;$$&#xA;With additional constraints&#xA;$$&#xA; \sum_i \beta_{ij} w_i  = f_j  \hspace{0.5in} \forall j&#xA;$$&#xA;The continuous relaxation would be much smaller and so the node subproblems would solve much faster.  The $\sigma_i$ could be used to compute upper bounds on $w_i$ as well, since it is the variance that can't be hedged by other assets.&lt;/p&gt;&#xA;" OwnerUserId="1418" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2013-12-07T03:43:24.310" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="9628" PostTypeId="2" ParentId="9623" CreationDate="2013-12-05T08:27:42.527" Score="1" Body="&lt;p&gt;I think that your problem can be solves by using another estimator for your covariance matrix.  A so called shrinkage estimator leads to covariance matrix that is non-singular. Then a Cholesky decomposition should work (maybe there is even a short-cut in the shrinkage world, I will check alter on).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The R package &lt;a href=&quot;http://cran.r-project.org/web/packages/corpcor/index.html&quot; rel=&quot;nofollow&quot;&gt;corpcor&lt;/a&gt; contains functions to perform shrinkage estimation. More information can be found on the &lt;a href=&quot;http://strimmerlab.org/software/corpcor/&quot; rel=&quot;nofollow&quot;&gt;webpage of the developer&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2013-12-05T08:27:42.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9629" PostTypeId="1" CreationDate="2013-12-05T11:39:00.620" Score="10" ViewCount="357" Body="&lt;p&gt;Glimpsing through literature, I read that volatilities in the equity market started to display a smile after the crash in 1987.  But when did volatilities start to smile in capital markets?&lt;/p&gt;&#xA;" OwnerUserId="6505" LastEditorUserId="6505" LastEditDate="2013-12-05T14:33:48.867" LastActivityDate="2017-01-22T15:48:31.470" Title="When did volatilities start to smile in capital markets?" Tags="&lt;risk-management&gt;&lt;market-data&gt;" AnswerCount="4" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9631" PostTypeId="2" ParentId="9621" CreationDate="2013-12-05T13:10:32.730" Score="1" Body="&lt;p&gt;This blog entry has graphs of the major ECN and CLS volumes - it has the data you are looking for.   Suggest you ask the author where the data comes from (there is a contact button).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.marketfactory.com/the-missing-billions/&quot; rel=&quot;nofollow&quot;&gt;http://www.marketfactory.com/the-missing-billions/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5161" LastActivityDate="2013-12-05T13:10:32.730" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9633" PostTypeId="1" CreationDate="2013-12-05T22:34:56.483" Score="3" ViewCount="277" Body="&lt;p&gt;I recently attended an interview to work as a software developer in an Asset Management company. I was asked by the interviewer: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;What is the most important piece of information that should be reviewed before investing in a fund?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I highlighted that a low expense ratio, low turnover and low fees are the most important things to look. But this is not what the interviewer was looking for in my answer. I prompted him further to find out but he wouldn't say.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anything else more important that what i have mentioned when investing in a fund? I cant think of anything else apart from current performance against a benchmark? &lt;/p&gt;&#xA;" OwnerUserId="6668" LastActivityDate="2013-12-06T01:53:14.003" Title="Single Most Important Fact about a Fund - Interview Question" Tags="&lt;funds&gt;&lt;mutual-fund&gt;&lt;asset&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="1" ClosedDate="2013-12-06T08:49:58.923" ContentLicense="CC BY-SA 3.0" />
  <row Id="9634" PostTypeId="2" ParentId="9633" CreationDate="2013-12-06T01:47:50.390" Score="1" Body="&lt;p&gt;The single most important fact to keep in mind when reviewing a fund is that there is no single most important fact.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Left tail risk in a fund investment exists for a huge number of reasons. This could range from back office compliance, risk management/derivative use policies to the possibility that the strategies they're running are negatively skewed which attracts capital but will eventually go bust.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To review the potential upside of a fund is similarly complex. Perhaps for &lt;em&gt;this&lt;/em&gt; question, there is one single most important fact to keep in mind: that all your efforts to predict their performance are going to be almost completely futile, and in population terms you may be adding only marginally to your portfolio expected return, or you may be adding nothing. More plausible is that you are decreasing standard deviation through a review and thinking on the portfolio level, but not increasing expected return in a meaningful way. The exception would be if you are in the fund of an elite school and you get first access to the best PE deals from your alumni.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: If the answer he/she was looking for was &quot;risk management&quot;, then I accept this as a sensible question. Behavioural economics teaches us that people's utility functions are strongly loss averse, and industry knowledge tells us that fund returns are almost all the outcome of chance/luck, so risk management can in my mind be argued as the most important fact to keep in mind.&lt;/p&gt;&#xA;" OwnerUserId="6081" LastEditorUserId="6081" LastEditDate="2013-12-06T01:53:14.003" LastActivityDate="2013-12-06T01:53:14.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9636" PostTypeId="2" ParentId="9629" CreationDate="2013-12-06T12:15:39.673" Score="-2" Body="&lt;p&gt;I recall Rebanato in Volatility &amp;amp; Correlation mention early 90's in Yen denominated products and rapidly being adopted for the other majors. Sure there was money to be made doing these skew trades but markets in both volatility and the underlying were quite possibly truck wide.&lt;/p&gt;&#xA;" OwnerUserId="3237" LastActivityDate="2013-12-06T12:15:39.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9637" PostTypeId="1" AcceptedAnswerId="9663" CreationDate="2013-12-06T16:56:29.363" Score="0" ViewCount="293" Body="&lt;p&gt;I want to compare different error rates of different classifiers with the error rate from a weak learner (better than random guessing). So, my question is, what are a few choices for a simple, easy to process weak learner? Or, do I understand the concept incorrectly, and is a weak learner simply any benchmark that I choose (for example, a linear regression)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this question belongs to a different stackexchange, please let me know!&lt;/p&gt;&#xA;" OwnerUserId="5981" LastEditorUserId="5981" LastEditDate="2013-12-06T17:25:50.467" LastActivityDate="2013-12-08T23:52:18.300" Title="Choosing a weak learner" Tags="&lt;machine-learning&gt;&lt;classifier&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9639" PostTypeId="1" AcceptedAnswerId="9700" CreationDate="2013-12-06T19:47:13.697" Score="0" ViewCount="118" Body="&lt;p&gt;I am sorry if the following question is not quantitative finance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am reading this thing badly written lecture notes, which says&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$W^r_1 \equiv W_1/P_1^g = (W_0^rP_0^g)(1+R)=/P_1^g$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(1+R^r)\equiv W_1^r/W_0^r = (1+R)(1+\pi)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$R^r\equiv \Delta_1^r/W_0^r = (R-\pi)/(1+\pi)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am guessing $R^r$ is the rate of real return. $R$ is nominal rate of return and $\pi$ is inflation. &#xA;but what the hell is $P_1^g$ and $W_1^r$ I don't really understand the first formula in particular. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am guessing $W_1$ is the wealth at time 1?&lt;/p&gt;&#xA;" OwnerUserId="3334" LastActivityDate="2013-12-12T22:15:50.223" Title="decoding this formula about nominal and real return" Tags="&lt;return&gt;&lt;notation&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2014-01-02T19:39:33.563" ContentLicense="CC BY-SA 3.0" />
  <row Id="9640" PostTypeId="1" CreationDate="2013-12-06T22:54:49.777" Score="-1" ViewCount="118" Body="&lt;p&gt;Today Yahoo, Google, CNBC, etc. are all reporting an open for DDM of \$106.95,  a close of \$107.69 and a delta on the day of \$2.69. But the arithmetic difference between the open and the close is actually \$0.74. Why is there such a huge discrepancy?&lt;/p&gt;&#xA;" OwnerUserId="6678" LastEditorUserId="5656" LastEditDate="2013-12-07T00:45:53.663" LastActivityDate="2013-12-07T02:11:19.870" Title="Market Discrepancy in ETFs" Tags="&lt;etf&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2014-01-02T19:39:51.330" ContentLicense="CC BY-SA 3.0" />
  <row Id="9641" PostTypeId="2" ParentId="2526" CreationDate="2013-12-06T23:48:31.087" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;My concern is if k-means (AKA lloyd algorithm) could group points around a neighborhood of specific mean, but what if two curves with similar mean show different variance.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;K-means will groups curves which are close to an &quot;average curve&quot;, but not necessarily close to a constant mean. Three very separated clusters can have the same mean. One being a cluster whose average is oscillating, the other one around an affine function, and the third one a constant function. &#xA;In a sense you need to consider that each curve is a n-dimensional vector in the case where n is the number of points of discretization. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you really don't want to use K-means, there is always the so-called &quot;CLVQ algorithm&quot; (competitive learning vector quantization) It should give similarresults. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally, quantization / clustering has extended to the functional case in &quot;Functional quantization of Gaussian processes&quot; by Luschgy and Pagès (Journal of functional analysis). The main result is that if you assume that your curves are independent draws of a Gaussian process, the optimal quantizer of that Gaussian process will span a principal space of its covariance operator, in other words, it will span the same finite-dimensional space as the first Karhunen-Loève eigenfunctions. This result as then been used by Tarpey and Kinateder in &quot;Clustering Functional Data&quot; (Journal of classification).&lt;/p&gt;&#xA;" OwnerUserId="5654" LastActivityDate="2013-12-06T23:48:31.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9642" PostTypeId="1" CreationDate="2013-12-07T01:34:05.240" Score="0" ViewCount="130" Body="&lt;p&gt;I have a day's worth of LSE data (FTSE100 companies) and I also have their weightings for the FTSE100.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ignoring the net present value of money, how do I calculate the current value of the FTSE? I have multiplied the price of each underlying by its weighting and summed up but im not getting anything sensible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To confirm, here are some of the weightings I have (circa July 2013):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Vodafone: 5.658561&lt;/li&gt;&#xA;&lt;li&gt;Royal Dutch Shell(A): 5.00384&lt;/li&gt;&#xA;&lt;li&gt;Royal Dutch Shell(B): 3.513914&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So is it just:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(VOD_price x 5.658561) + (RDSA_price x 5.00384) + (RDSB_price x 3.513914).....&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or do I need to divide the weightings by 100 and do like above?&lt;/p&gt;&#xA;" OwnerUserId="5168" LastActivityDate="2013-12-10T15:41:19.477" Title="Calculate price of index from underlyings (weightings included)?" Tags="&lt;market-data&gt;&lt;arbitrage&gt;&lt;index&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9643" PostTypeId="2" ParentId="1640" CreationDate="2013-12-07T01:55:25.053" Score="27" Body="&lt;p&gt;Slightly ugly bash one-liner for a sorted JSON array:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;echo &quot;[\&quot;$(echo -n &quot;$(echo -en &quot;$(curl -s --compressed 'ftp://ftp.nasdaqtrader.com/SymbolDirectory/nasdaqlisted.txt' | tail -n+2 | head -n-1 | perl -pe 's/ //g' | tr '|' ' ' | awk '{printf $1&quot; &quot;} {print $4}')\n$(curl -s --compressed 'ftp://ftp.nasdaqtrader.com/SymbolDirectory/otherlisted.txt' | tail -n+2 | head -n-1 | perl -pe 's/ //g' | tr '|' ' ' | awk '{printf $1&quot; &quot;} {print $7}')&quot; | grep -v 'Y$' | awk '{print $1}' | grep -v '[^a-zA-Z]' | sort)&quot; | perl -pe 's/\n/&quot;,&quot;/g')\&quot;]&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;EDIT: Filtered out test stocks&lt;/p&gt;&#xA;" OwnerUserId="6679" LastEditorUserId="6679" LastEditDate="2013-12-11T02:52:02.210" LastActivityDate="2013-12-11T02:52:02.210" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9644" PostTypeId="2" ParentId="9640" CreationDate="2013-12-07T02:11:19.870" Score="2" Body="&lt;p&gt;The day's net change is typically displayed as the $Close$ to $Close$ difference. So today's close of $\$107.69$, yesterday's close is $\$105.00$. So the net change, $\$107.69 - \$105.00 = \$2.69$. If you were to calculate $Open$ to $Close$, you'd get what you expect, $\$0.74$.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2013-12-07T02:11:19.870" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9645" PostTypeId="2" ParentId="9642" CreationDate="2013-12-07T02:14:26.070" Score="2" Body="&lt;p&gt;You need to read up on how the FTSE is calculated. See this link: &lt;a href=&quot;http://www.ftse.com/Indices/UK_Indices/Downloads/uk_calculation.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.ftse.com/Indices/UK_Indices/Downloads/uk_calculation.pdf&lt;/a&gt;. It involves the market value of companies, not simply a weighted price average. There is a detailed example in the document I linked, which happens to be the very first Google result for &quot;ftse index calculation&quot;. &lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2013-12-07T02:14:26.070" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9646" PostTypeId="2" ParentId="8686" CreationDate="2013-12-07T07:59:47.073" Score="5" Body="&lt;p&gt;We just issued a paper studying and modelling orderbook dynamics, especially the way they replenish or empty &lt;a href=&quot;http://arxiv.org/abs/1312.0563&quot; rel=&quot;noreferrer&quot;&gt;Simulating and analyzing order book data: The queue-reactive model&lt;/a&gt;. We disclose the way the first queue evolve with respect to the size of others (best opposite and second or third queues).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other recent papers complement ours:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a theoretical one explaining how stabilizing behaviours can emerge: &lt;a href=&quot;http://arxiv.org/abs/1305.6323&quot; rel=&quot;noreferrer&quot;&gt;Efficiency of the Price Formation Process in Presence of High Frequency Participants: a Mean Field Game analysis&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;a PDE (Fokker-Planck) version of the order flows (with an intraday seasonality correction) &lt;a href=&quot;http://arxiv.org/abs/1304.6819&quot; rel=&quot;noreferrer&quot;&gt;A Fokker-Planck description for the queue dynamics of large tick stocks&lt;/a&gt; &lt;/li&gt;&#xA;&lt;li&gt;another one focused on direct analysis of the link between the state of the orderbook and the next event (midprice change or trade) &lt;a href=&quot;http://arxiv.org/abs/1312.0514&quot; rel=&quot;noreferrer&quot;&gt;Trade arrival dynamics and quote imbalance in a limit order book&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;an economic view of agent behaviour (in a theoretic model) &lt;a href=&quot;http://webhost.hec.fr/rosu/research/index.html&quot; rel=&quot;noreferrer&quot;&gt;A Dynamic Model of the Limit Order Book&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For intraday seasonalities analysis, have a look at Chapter 3 (&lt;em&gt;From Intraday Market Share to Volume Curves: Some Stationarity Issues&lt;/em&gt;) of &lt;a href=&quot;http://www.worldscientific.com/worldscibooks/10.1142/8967&quot; rel=&quot;noreferrer&quot;&gt;Market Microstructure in Practice&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Look at Figure 8 of the paper:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/8Tf36.png&quot; alt=&quot;orderbooks flows&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the x-axis you have the current size of the first queue (in Average Event size) and on the y-axis you read an intensity. Three colours figure the state of the best opposite queue (i.e. the best ask if you consider the best bid): in bleue for small sizes, green medium sizes and red large sizes:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Upper right chart gives you the limit order insertion flow&lt;/li&gt;&#xA;&lt;li&gt;Upper left one the cancellations&lt;/li&gt;&#xA;&lt;li&gt;Lower left the market orders&lt;/li&gt;&#xA;&lt;li&gt;and lower right the ratio you have in mind (one means &quot;nothing changes&quot;, lower than 1 the queue decreases, larger than one it increases).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2013-12-07T08:10:51.387" LastActivityDate="2013-12-07T08:10:51.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9647" PostTypeId="2" ParentId="557" CreationDate="2013-12-07T08:39:32.200" Score="2" Body="&lt;p&gt;I ran the performance test code included in QuickFix C++ and got the results below. As far as I can tell, this looks excellent. And I am running a commodity home desktop not a high-end trading server used by big shops. The build was done with VS 2012 at full optimization.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;G:\projects\quickfix\test\release\pt&gt;pt.exe -p 15000 -c 1000000&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Converting integers to strings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;num: 1000000, seconds: 0.016, num_per_second: 6.25e+007&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Converting strings to integers:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;num: 1000000, seconds: 0, num_per_second: 1.#INF&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Converting doubles to strings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;num: 1000000, seconds: 0.5, num_per_second: 2e+006&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Converting strings to doubles:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;num: 1000000, seconds: 0.219, num_per_second: 4.56621e+006&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Creating Heartbeat messages:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;num: 1000000, seconds: 0.75, num_per_second: 1.33333e+006&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Identifying message types:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;num: 1000000, seconds: 0.062, num_per_second: 1.6129e+007&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Serializing Heartbeat messages to strings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;num: 1000000, seconds: 0.516, num_per_second: 1.93798e+006&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Serializing Heartbeat messages from strings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;num: 1000000, seconds: 1.094, num_per_second: 914077&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Creating NewOrderSingle messages:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;num: 1000000, seconds: 2.312, num_per_second: 432526&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Serializing NewOrderSingle messages to strings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;num: 1000000, seconds: 0.75, num_per_second: 1.33333e+006&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Serializing NewOrderSingle messages from strings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;num: 1000000, seconds: 3.188, num_per_second: 313676&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Creating QuoteRequest messages:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;num: 1000000, seconds: 41.547, num_per_second: 24069.1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Serializing QuoteRequest messages to strings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;num: 1000000, seconds: 3.734, num_per_second: 267809&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Serializing QuoteRequest messages from strings:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;num: 1000000, seconds: 26.672, num_per_second: 37492.5&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Reading fields from QuoteRequest message:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;num: 1000000, seconds: 15.89, num_per_second: 62932.7&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Storing NewOrderSingle messages:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;num: 1000000, seconds: 3.485, num_per_second: 286944&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Validating NewOrderSingle messages with no data dictionary:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;num: 1000000, seconds: 0.11, num_per_second: 9.09091e+006&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Validating NewOrderSingle messages with data dictionary:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;G:\projects\quickfix\test\release\pt&gt;&lt;/p&gt;&#xA;" OwnerUserId="6681" LastEditorUserId="6681" LastEditDate="2013-12-07T08:45:07.873" LastActivityDate="2013-12-07T08:45:07.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9651" PostTypeId="1" CreationDate="2013-12-07T18:00:57.730" Score="3" ViewCount="356" Body="&lt;p&gt;I want to forecast the volatility (with Garch) of a canadian stock in 5 months with daily returns. How many data do I have to collect ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="6685" LastActivityDate="2014-01-02T17:37:19.267" Title="Evaluation volatility with Garch model" Tags="&lt;volatility&gt;&lt;finance&gt;&lt;garch&gt;&lt;models&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9652" PostTypeId="1" AcceptedAnswerId="9654" CreationDate="2013-12-07T18:23:30.840" Score="1" ViewCount="261" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;This is an edit to the previous question, on stationary process, which was answered by Richard below.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Let $x_t$ be a zero mean, time homogeneous Markovian process over time $t$ starting from $x_0=0$. What are the examples of $x_t$ where the variance at $t$ does not increase over $t$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) In discrete time and discrete state, the followig is a very simple example where the variance periodically oscillates over time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$x_{t+1} = \eta(1-|x_t|),\, x_0=0;\, \eta\in\{-1,1\},\mbox{ with probability of } \frac{1}{2} \mbox{ on each value of }\eta.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) In continuous time, but discontinuous path setting, is the following jump diffusion process a correct example?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dx_t = -\alpha x_t dt+dz_t+ y\eta dN_t,\, x_0 = 0,$$&#xA;where $\alpha\gg 0$, $z_t$ is the standard brownian motion with mean $0$ and standard deviation $t$, $N_t$ is the Poisson process with frequency $0&amp;lt;\lambda\ll 1$, $\eta$ takes on values $-1$ or $1$ with $0.5$ probability each, $z_{t_1}$, $N_{t_2}$ and $\eta$ are independent of each other at arbitrary $t_1$ and $t_2$, and constant $y\gg 1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On second thought, this is not a correct example. One can solve this equation and one will find the variance of this process is the sum of the variance from $dz_t$ and that from $dN_t$ due their independence. We will have to make the jumps negatively correlated to $z_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A better setup is to shift $x_t$ beyond a barrier directly back to the $x=0$ line. So the process resides on the topology of two cylinders touched along a longitude. However, it seems to me, even this set up with $x_t$ being either a standard Browniam motion or mean reverting one without any jump process still has its variance increasing with time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, I am still without a valid example in this setup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) What are the examples for continuous path? I suspect it is not possible. Can anyone prove this if it is indeed impossible?&lt;/p&gt;&#xA;" OwnerUserId="6686" LastEditorUserId="6686" LastEditDate="2013-12-10T17:35:47.593" LastActivityDate="2013-12-10T17:35:47.593" Title="Examples of non-increasing variance of a time homogeneous Markovian process" Tags="&lt;time-series&gt;&lt;stochastic-processes&gt;&lt;continuous-time&gt;&lt;markov&gt;" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="9653" PostTypeId="2" ParentId="7065" CreationDate="2013-12-07T19:31:10.230" Score="1" Body="&lt;p&gt;I own Gigasoft, if researching financial WPF charting, see our 7 meg demo download.  Fast to download, uninstalls easily with no issues, and demonstrate our robustness, speed, user code, and rendering quality: &lt;a href=&quot;http://www.gigasoft.com/wpfchart.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;link to financial .net wpf charting&lt;/a&gt;.  Date time handling, mult-axes, and extensive annotations are key to good financial use and we've spent years perfecting these features. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Sv1t4.jpg&quot; alt=&quot;enter image description here&quot;&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A customer was nice enough to send us this showing excellent use of annotations to produce a custom Gartley financial pattern ...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/muiK5.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="6688" LastActivityDate="2013-12-07T19:31:10.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9654" PostTypeId="2" ParentId="9652" CreationDate="2013-12-07T21:10:37.320" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;This is the answer to the first version of the question which asked whether a stationary process has an increasing variance over time.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;No the definition of (weakly) stationary (&lt;a href=&quot;http://en.wikipedia.org/wiki/Stationary_process&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Stationary_process&lt;/a&gt;) is that the variance is the same for each point in time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the literature it is often dealt with the covariance function.&#xA;For a stationary time series, the covariance between $X_t$ and $X_s$ only depends on the time span $|t-s|$. For the varianace of $X_t$ we have $t-s=0$.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="6686" LastEditDate="2013-12-09T21:24:57.420" LastActivityDate="2013-12-09T21:24:57.420" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9655" PostTypeId="2" ParentId="2841" CreationDate="2013-12-07T21:29:58.007" Score="2" Body="&lt;p&gt;It is true that you cannot infer the real World probabilities from the BSM formula directly. It is also equally true that the &quot;right value&quot; of the option in the real world is obtained by replacing the risk free rate with the expected return of the stock. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another example of this is simply to look at the real world price of a forward on the stock. If arbitrage, or replication, is not allowed would you systematically buy or sell a ten year forward on a stock where the forward is priced using the risk free rate?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As long as the expected return on the stock is above the risk free rate, which is consistent with most classical financial assumptions, you would chose to buy the forward. The equilibrium price for the forward when arbitrage is not allowed is obtained when the forward is priced using the expected return of the stock as the rate. Then you would be indifferent to buying or selling the forward.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The simple example of the forward pricing did not use any real world probabilities in pricing the forward. The probabilities might be behind how you came up with the expected rate of return, or the drift, of the stock if you wish but all you need to know to price the forward is actually the expected return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Derivatives people, like myself, might complain that this is truoblesome because you need to make an assumption of the drift of the stock to arrive at the answear. Well tough luck, that is what equities people need to do every day when pricing stocks.&lt;/p&gt;&#xA;" OwnerUserId="6689" LastActivityDate="2013-12-07T21:29:58.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9656" PostTypeId="2" ParentId="1374" CreationDate="2013-12-07T23:00:08.640" Score="4" Body="&lt;p&gt;I hope this help you.&#xA;We have to start from the very first step, namely how the Kelly formula is calculated. We have the chance to make a bet on a event $A$ that as an odd (decimal odds) $O_A$. We want bet only a fraction $f$ of our capital $V_0$. How much of our capital we have to bet? Well,  if we win will face with a capital $V_1$&#xA;$$&#xA;V_1=(1+(O_A-1)f)V_0&#xA;$$&#xA;If we loose we face with a capital&#xA;$$&#xA;V_1=(1-f)V_0&#xA;$$&#xA;We now imagine that we can bet again and again in the same event. After $n=w+l$ events, where $w$ are won events and $l$ are lost events, we face with a capital&#xA;$$&#xA;V_n=(1+(O_A-1)f)^w (1-f)^l V_0&#xA;$$&#xA;We can rearrange the previous equation in this term&#xA;$$&#xA;G_n=\frac{V_n}{V_0}=(1+(O_A-1)f)^w (1-f)^l&#xA;$$&#xA;We want calculate the the unitary growth $G_n$ and we perform a geometric mean applying the $1/n$ roots on both members&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;G_n^{\frac{1}{n}}=(1+(O_A-1)f)^{\frac{w}{n}} (1-f)^{\frac{l}{n}}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here it is the first assumption. If the two events $w$ and $l$ are not correlated, then we can apply the theorem of large numbers and state that for a large number of trials we must have&#xA;$$&#xA;\lim_{n\rightarrow +\infty} \frac{w}{n}=p \\ \lim_{n\rightarrow +\infty} \frac{l}{n}=q=(1-p)&#xA;$$&#xA;So we have&#xA;$$&#xA;\hat G=(1+(O_A-1)f)^p (1-f)^q&#xA;$$&#xA;A very interesting form is obtained if we apply the $log()$ on both side&#xA;$$&#xA;\log \hat G=\log ((1+(O_A-1)f)^p (1-f)^q)=p\log(1+(O_A-1)f)+q\log(1-f)&#xA;$$&#xA;and interpreting $(O_A-1)=r_p$ and $-1=r_q$&#xA;$$&#xA;\log \hat G=p\log(1+r_pf)+q\log(1+r_qf)=\sum_i p_i\log(1+r_i f)=E[\log(1+r f)]&#xA;$$&#xA;where $E[\circ]$ is the expected value operator. The Kelly criterion say that the value of $f$ we have to choose is that of maximize  $\log \hat G$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At this point we have made only one assumption, namely that theorem of large number works. The problem arise when we want to apply the previous formula in the continuum limit.&#xA;In the limit of infinite possible outcomes $i\rightarrow +\infty$ we have&#xA;$$&#xA;\lim_{i\rightarrow +\infty}\sum_i p_i\log(1+r_i f)=\int f(r)\log(1+r_i f)d r= E[\log(1+r f)]&#xA;$$&#xA;The only request in order to calculate the Kelly value of $f$ is that the $ E[\log(1+r f)]$ exists. This impose some restriction in the the convergence of $f(r)$ at infinity. If a $X$ is log-normal distributed variable, this means that must exist the first $\log$ momentum and the second $\log^2$ momentum, namely&#xA;$$&#xA;E[\log X]&amp;lt;+\infty\\&#xA;E[\log^2 X] &amp;lt;+\infty&#xA;$$&#xA;So if the return $r$ does not satisfy the first condition, then the value of $f$ we calculate from the Kelly criterion makes no sense and that is the why we can't apply Kelly criterion to the whole universe of distributions.&lt;/p&gt;&#xA;" OwnerUserId="2202" LastActivityDate="2013-12-07T23:00:08.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9657" PostTypeId="2" ParentId="4101" CreationDate="2013-12-08T02:35:21.057" Score="0" Body="&lt;p&gt;Minimum price movement for Bobl is 1 basis point with a value of €10.&#xA;Minimum price movement for Euribor is 0.5 basis point with a value of €12.50. This is usually called a half-tick. So a full-tick would have the value €25. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With these definitions, a tick is a basis point move for both the Bobl and the Euribor.  &lt;/p&gt;&#xA;" OwnerUserId="5107" LastActivityDate="2013-12-08T02:35:21.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9659" PostTypeId="1" AcceptedAnswerId="12633" CreationDate="2013-12-08T17:07:04.130" Score="8" ViewCount="895" Body="&lt;p&gt;I want to solve the following optimization problem: What is the optimal general trading strategy (in the sense of the highest &lt;a href=&quot;http://en.wikipedia.org/wiki/Sharpe_ratio&quot;&gt;Sharpe ratio&lt;/a&gt;) on a time series which is the result of a &lt;a href=&quot;http://en.wikipedia.org/wiki/Hidden_Markov_model&quot;&gt;Hidden Markov model&lt;/a&gt; with two states and two Gaussians with a known transition matrix and known mean and variance parameters?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The trading strategy should ideally be based only on easily observable technical indicators like intrinsic momentum or SMAs and volatility. My gut feeling is that the optimal lookback period for calculating these must depend on the transition matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am grateful (as usual) for ideas, literature, code (ideally R :-) and the like&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2013-12-11T10:24:46.747" LastActivityDate="2014-06-12T14:18:58.863" Title="Optimal trading strategy in toy world of simple Hidden Markov model with Gaussians" Tags="&lt;quant-trading-strategies&gt;&lt;optimization&gt;&lt;indicator&gt;&lt;markov-switching&gt;&lt;hidden-markov-model&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9660" PostTypeId="1" CreationDate="2013-12-08T18:41:42.190" Score="1" ViewCount="333" Body="&lt;p&gt;I am searching for a trading platform for a client. It must include control of trading limits (per user and with regard to the clients portfolio), connection to Bloomberg data, ability to value offered trades on fixed income products (plain vanilla and callables). No derivatives, and only occasionally equity. Trading is very low frequency, &amp;lt; 50 per day. About 99% of the assets are hold to maturity. I would appreciate any pointers. &lt;/p&gt;&#xA;" OwnerUserId="357" LastEditorUserId="1418" LastEditDate="2013-12-09T06:05:40.670" LastActivityDate="2014-01-28T14:33:55.233" Title="Market overview trading platforms (with OTC)" Tags="&lt;fixed-income&gt;&lt;software&gt;&lt;order-execution&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9661" PostTypeId="1" CreationDate="2013-12-08T19:15:45.213" Score="5" ViewCount="1070" Body="&lt;p&gt;It seems that some tail-risk centric groups are bent on using Paretian and t-distributions to account for tail risk when fitting log-returns.  It has been observed, however, that with and without filtering log-returns with ARMA/GARCH, fitting ecdf's to cdf's still results in better Laplace and logistic distribution fits when compared with stable, normal, or Student's t.  Given this, is there a reason why the bulk of the data and its best fitting distribution is not identified first, followed by consideration of tails?  If the focus is mostly tails, then the Cauchy is not bad, and a Cauchy with heavy tails could be realized by a stable distribution.   Independent of the infinite variance problem, why the constraint for mostly t-distributions? &lt;/p&gt;&#xA;" OwnerDisplayName="user6430" LastActivityDate="2018-09-30T11:06:58.460" Title="Fitting Student t-distributions to log-returns" Tags="&lt;probability&gt;&lt;garch&gt;&lt;distribution&gt;&lt;log-returns&gt;&lt;arma&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9663" PostTypeId="2" ParentId="9637" CreationDate="2013-12-08T23:52:18.300" Score="1" Body="&lt;p&gt;A classifier can be weak for a number of reasons, and it mainly depends on characteristics of the data. For example, if the data are not linearly separable, then linear regression will be weak (poor correlation between predicted class and true class labels).  However, if the data are linearly separable, then other classifiers may not work as well as linear regression.  If you used ensemble methods (committee of classifiers), you could compare results across classifiers.  You didn't mention anything about boosting, which is fundamental to weak learner applications.  Without going into detail, you could start with the most basic classifiers such as k-nearest neighbors(kNN), Naive Bayes classifier(NBC), learning vector quantization(LVQ), linear discriminant analysis(LDA), and then linear regression.  If the data depart from normality, then LDA may breakdown since covariance matrices are used, and if nonlinearly-separable data are present, regression may have larger error.  Certainly, as you increase classifier complexity such as with support vector machines, random forests, artificial neural networks, the earlier mentioned classifiers (kNN, NBC, LDA, LREG) may not work as well.  The main issue is that, as soon as you mention &quot;weakness,&quot; the theory of boosting overarches everything you are doing, and boosting involves more complex methods for making a weak learner stronger.  Hence, to pursue what you want to do, you may get &quot;trapped&quot; in boosting theory and become forced to only consider boosting issues -- which has its own unique assumptions.  Make sure you really have to work with a weak classifier instead of comparing classifiers via an ensemble.  (See Kuncheva's papers on the diversity issue for an ensemble of classifiers).             &lt;/p&gt;&#xA;" OwnerDisplayName="user6430" LastActivityDate="2013-12-08T23:52:18.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9664" PostTypeId="2" ParentId="9623" CreationDate="2013-12-09T00:21:58.527" Score="2" Body="&lt;p&gt;Let $t$ be the number of days (time periods), and let $p$ be the number of assets.  You have $t=1000$ and $p=10000$. For any given dataset, it is assumed that the sample covariance matrix $\mathbf{C}$ accurately represents the population covariance matrix  $\boldsymbol{\Sigma}$, however, as $p \rightarrow t$ or if $p &amp;gt; t$ (as in your case), the eigenvalues become unreliable and can also take on a value of zero, resulting in lack of positive definiteness.  With high-dimensional datasets becoming more popular, there is greater potential for the number of dimensions to approach the sample size ($p \rightarrow t$), leading to biased eigenvalues of $\mathbf{C}$ and $\mathbf{R}$.  Certainly, there will be $p-t$ zero eigenvalues whenever $p&amp;gt;t$ and one zero eigenvalue whenever $p=t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use singular value decomposition (SVD), which will extract the singular values (eigenvalues) along with the remaining singular values.  If $\mathbf{X}$ is your return matrix ($t$ rows, $p$ columns) then use the R syntax below to look at the eigenvalues (&quot;eigvals&quot;) from eigendecomposition versus the singular values (&quot;s&quot;) from SVD:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;R=cor(X);&#xA;&#xA;p &amp;lt;- ncol(X);&#xA;&#xA;t &amp;lt;- nrow(X);&#xA;&#xA;lambdae &amp;lt;- eigen(R);&#xA;&#xA;eigvals &amp;lt;- as.vector(lambdae$values);&#xA;&#xA;E&amp;lt;-as.matrix(lambdae$vectors);&#xA;&#xA;s&amp;lt;-svd(R)&#xA;&#xA;s$d   &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Last, if you are going to do anything with your data, you might perform dimension reduction by using the eigenvectors to represent your data for dimensions that have non-zero eigenvalues, as they are uncorrelated.  You could also use PCA after extracting the singular-values, and ignore the zero eigenvalues.  The loadings with the principal components will represent correlation between the original 10000 assets and the reduced orthogonal (non-correlated) dimensions. &lt;/p&gt;&#xA;" OwnerDisplayName="user6430" LastEditorDisplayName="user6430" LastEditDate="2015-10-08T00:15:04.157" LastActivityDate="2015-10-08T00:15:04.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9666" PostTypeId="2" ParentId="9625" CreationDate="2013-12-09T03:32:30.143" Score="2" Body="&lt;p&gt;This is going to vary country by country, since securities laws can differ quite a bit when it comes to securitizing.  That is largely governed by the relevant accounting rules which outline what assets you can take off your books.  Without a majority transfer of risk, the asset typically can't(and shouldn't) be securitized.  Securitization is very customizable, so this is going to be pretty general.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/6Y7zK.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tranches are going to be determined by  targeting specific investors and structuring the bond to fit their needs.  Deals are typically structured in a sequential paydown, where the senior tranche receives P&amp;amp;I until it fully amortizes.  Payments flow from the top down while losses and prepayments(if possible) flow from the bottom up.  Typically there is an un-rated equity tranche as the most junior piece, that the bank itself or a B-piece buyer holds to better align interests.  As for the actual loans being repackaged, there's a tradeoff with quality and balance.  The lower the ratio of tranche balance : collateral, the less risk, when the collateral balance is larger than the sum of the tranches, this is known as overcollateralization, which absorbs losses prior to any tranche.  In the simplest case, interest payments from all of the loans flow through at the weighted average coupon(WAC) of the underlying collateral net of any fees(servicing, escrow, etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tenor is going to be determined by the underlying's loan terms.  It can vary depending on what sort of prepayment and waterfall provisions exist.  A pool of 7-year IO loans is obviously going to limit the maturity to somewhere in that neighborhood.  Contraction/Extension risk is usually well defined by your position in the capital stack.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It sounds like you might have a mixed pool of IO and non-IO loans, which can be hedged using swaps.  The closer you move towards an IO structure, extension risk is going to increase and the bond is going to price closer to par.  You can slice and group the loans into as few or as many tranches as you like, you just have to find someone willing to buy it.&lt;/p&gt;&#xA;" OwnerUserId="2732" LastActivityDate="2013-12-09T03:32:30.143" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9667" PostTypeId="1" AcceptedAnswerId="14356" CreationDate="2013-12-09T06:59:49.793" Score="1" ViewCount="349" Body="&lt;p&gt;I was reading &lt;a href=&quot;http://en.wikipedia.org/wiki/Basel_II&quot; rel=&quot;nofollow&quot;&gt;Basel II wiki page&lt;/a&gt;, it says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The first pillar &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The first pillar deals with maintenance of regulatory&#xA;  capital calculated for three major components of risk that a bank&#xA;  faces: credit risk, operational risk, and market risk. Other risks are&#xA;  not considered fully quantifiable at this stage. &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The credit risk&#xA;  component can be calculated in three different ways of varying degree&#xA;  of sophistication, namely standardized approach, Foundation IRB,&#xA;  Advanced IRB and General IB2 Restriction. IRB stands for &quot;Internal&#xA;  Rating-Based Approach&quot;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Any idea what is such “General IB2 Restrition”?&#xA;I checked the &lt;a href=&quot;http://www.bis.org/publ/bcbs128.pdf&quot; rel=&quot;nofollow&quot;&gt;Basel II: International Convergence of Capital Measurement and Capital Standards: a Revised Framework, Comprehensive Version (BCBS) (June 2006 Revision)&lt;/a&gt; but couldn't find any definition.&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2014-08-20T00:56:09.110" Title="what is General IB2 Restriction in Basel II credit risk model" Tags="&lt;credit-risk&gt;&lt;basel&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9668" PostTypeId="5" CreationDate="2013-12-09T10:14:52.663" Score="0" Body="&lt;p&gt;The Financial Information eXchange (FIX) protocol is an electronic communications protocol initiated in 1992 for international real-time exchange of information related to the securities transactions and markets.&#xA;FIX has become the language of the global financial markets used extensively by buy and sell-side firms, trading platforms and even regulators to communicate trade information. This non-proprietary, free and open standard is constantly being developed to support evolving business and regulatory needs, and is used by thousands of firms every day to complete millions of transactions.&lt;/p&gt;&#xA;" OwnerUserId="2369" LastEditorUserId="2369" LastEditDate="2013-12-09T13:25:59.460" LastActivityDate="2013-12-09T13:25:59.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9669" PostTypeId="4" CreationDate="2013-12-09T10:14:52.663" Score="0" Body="The Financial Information eXchange (FIX) protocol is an electronic communications protocol initiated in 1992 for international real-time exchange of information related to the securities transactions and markets." OwnerUserId="2369" LastEditorUserId="2369" LastEditDate="2013-12-09T13:25:48.537" LastActivityDate="2013-12-09T13:25:48.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9671" PostTypeId="2" ParentId="2909" CreationDate="2013-12-09T13:45:43.223" Score="8" Body="&lt;p&gt;An easy way to perform what you need is do it this way:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if your data are daily then :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; prices &amp;lt;- data$cl&#xA;&amp;gt; log_returns &amp;lt;- diff(log(prices), lag=1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;would provide you with daily log returns, if you change the $lag=1$ to $lag=5$ then you will get weekly moving log returns.&lt;/p&gt;&#xA;" OwnerUserId="6189" LastActivityDate="2013-12-09T13:45:43.223" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9673" PostTypeId="1" CreationDate="2013-12-09T15:33:35.237" Score="13" ViewCount="947" Body="&lt;p&gt;Some time ago Almgren and Chriss proposed a method for portfolio optimization based on sorting criteria such as &lt;span class=&quot;math-container&quot;&gt;$r_1 &amp;gt; r_2 &amp;gt;... &amp;gt; r_N$&lt;/span&gt; instead of explicit expected returns: see &#xA;&lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=720041&quot; rel=&quot;nofollow noreferrer&quot;&gt;portfolios from sorts&lt;/a&gt; and &lt;a href=&quot;https://corp.bankofamerica.com/publicpdf/equities/Optimal_Portfolios.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;optimal portfolios from ordering information&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The 'portfolio of sorts' approach uses the centroid of the sort instead of returns, but otherwise has the same structure as a mean variance optimization, i.e. a linear program with quadratic constraints.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this approach used in practice, and if so, can anybody share their experience with it?&lt;/p&gt;&#xA;" OwnerUserId="6721" LastEditorUserId="34982" LastEditDate="2019-05-04T15:27:20.300" LastActivityDate="2019-06-03T16:03:05.327" Title="Portfolios from Sorts" Tags="&lt;optimization&gt;&lt;modern-portfolio-theory&gt;&lt;mean-variance&gt;&lt;expected-return&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="9674" PostTypeId="2" ParentId="373" CreationDate="2013-12-09T19:53:55.963" Score="4" Body="&lt;p&gt;The word cubature is just a replacement for quadrature in the infinite dimensional setting, such as the Wiener space as in the answer from @TheBridge. The term is used in the context of integrating functionals of stochastic processes &#xA;$$&#xA;E[F(X)]&#xA;$$&#xA;where X is random variable valued in a functional space such as a the solution of a SDE or simply the Brownian motion. The idea is to approximate this quantity by a quantity of the form&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\sum_{i=1}^N p_i F(\gamma_i)&#xA;$$&#xA;where $(\gamma_i)_{1 \leq i \leq N}$ are a set of deterministic functions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far, there are two main approaches to obtain cubature formulas in the infinite dimensional setting. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Functional quantization&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Functional quantization for numerics with an application to option pricing&lt;/em&gt;&#xA;By Gilles Pagès and Jacques Printems&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Polynomial cubature&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Cubature on Wiener spaces&lt;/em&gt; By Terry Lyons&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Method (1) is an infinite-dimensional counterpart of the midpoint rule over an interval, and like with the midpoint rule, you can use Richardson Romberg extrapolation with the number of discretisation points to improve the speed of convergence.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Method (2) is a infinite-dimensional counterpart of the Gauss integration. It is exact on polynomials of the Wiener Process in the sense of iterated integrals of the Brownian motion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thee quantization approach is applicable to Brownian diffusions but also fractional Brownian motion and other cases. &lt;/p&gt;&#xA;" OwnerUserId="5654" LastEditorUserId="5654" LastEditDate="2014-08-31T16:27:03.960" LastActivityDate="2014-08-31T16:27:03.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9675" PostTypeId="1" AcceptedAnswerId="9678" CreationDate="2013-12-09T21:51:10.233" Score="1" ViewCount="2281" Body="&lt;p&gt;Is there a way to get the math curriculum for FRM level 1 without purchasing the Exam? I wish to take a look at the math topics and see if I have any chance of cracking it. But  I could not find an online resource that lists the math topics required for FRM 1. &lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2013-12-10T02:02:37.223" Title="What are the math topics involved in FRM 1" Tags="&lt;risk-management&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9677" PostTypeId="1" CreationDate="2013-12-09T23:24:15.530" Score="9" ViewCount="3328" Body="&lt;p&gt;From point 38 on P.17 the default probability can be implied from market implied CDS spreads. &quot;Macro Surface&quot; method is mentioned, but I cannot get any clue of what it is? Where do I get the acedemic reference for that? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also what is the commonly used methodology to imply default probability for CVA/DVA calculation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The article &quot;Credit and Debit Valuation Adjustment&quot; can be seen in &lt;a href=&quot;http://www.ivsc.org/sites/default/files/IVSC%20CVA%20-DVA%20%20ED_0.pdf&quot;&gt;http://www.ivsc.org/sites/default/files/IVSC%20CVA%20-DVA%20%20ED_0.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6119" LastActivityDate="2015-05-15T06:27:48.947" Title="How is the default probability implied from market implied CDS spreads for CVA/DVA calculation?" Tags="&lt;credit&gt;&lt;default&gt;&lt;cva&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9678" PostTypeId="2" ParentId="9675" CreationDate="2013-12-10T02:02:37.223" Score="3" Body="&lt;p&gt;See below. You can find out more &lt;a href=&quot;http://www.garp.org/media/1216429/frm_study_guide_2014-web.pdf&quot; rel=&quot;nofollow&quot;&gt;here at the GARP website&lt;/a&gt;. You may need to register, but it's free. Download the study guide. The bullets below are from it.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Discrete and continuous probability distributions &lt;/li&gt;&#xA;&lt;li&gt;Population and sample statistics&lt;/li&gt;&#xA;&lt;li&gt;Statistical inference and hypothesis testing&lt;/li&gt;&#xA;&lt;li&gt;Estimating the parameters of distributions &lt;/li&gt;&#xA;&lt;li&gt;Graphical representation of statistical relationships&lt;/li&gt;&#xA;&lt;li&gt;Linear regression with single and multiple regressors &lt;/li&gt;&#xA;&lt;li&gt;The Ordinary Least Squares (OLS) method&lt;/li&gt;&#xA;&lt;li&gt;Interpreting and using regression coefficients, the t-statistic, and&#xA;other output&lt;/li&gt;&#xA;&lt;li&gt;Hypothesis testing and confidence intervals&lt;/li&gt;&#xA;&lt;li&gt;Heteroskedasticity and multicollinearity&lt;/li&gt;&#xA;&lt;li&gt;Simulation methods&lt;/li&gt;&#xA;&lt;li&gt;Estimating correlation and volatility using EWMA and GARCH models&lt;/li&gt;&#xA;&lt;li&gt;Volatility term structures&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2685" LastActivityDate="2013-12-10T02:02:37.223" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9679" PostTypeId="1" CreationDate="2013-12-10T05:37:34.553" Score="3" ViewCount="261" Body="&lt;p&gt;Suppose the hazard rate is $\lambda$&#xA;the default probability density function follow exponential &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$f(t) = \lambda e^{-\lambda t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and cumulative probability function is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$F(t) = 1 - e^{-\lambda t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the probability of default &lt;strong&gt;within&lt;/strong&gt; 3 years is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P(t&amp;lt;3) = F(3) = 1-e^{- 3 \lambda }$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the &lt;strong&gt;conditional&lt;/strong&gt; that it default in 3rd year given no default in the first 2 years is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P(t&amp;lt;3|t&amp;gt;2) = \frac{P(t&amp;lt;3)-P(t&amp;lt;2)}{P(t&amp;gt;2)} = \frac{P(t&amp;lt;3)-P(t&amp;lt;2)}{1-P(t&amp;lt;2)} = \frac{e^{-2 \lambda}-e^{-3 \lambda}}{e^{-2 \lambda}} = 1 -e^{-\lambda} \hspace{0.05in} $ (1)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if I consider &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;event A: no default in first 2 years &lt;/li&gt;&#xA;&lt;li&gt;event B: default in year 3&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$P(A \cap B) = P(A) * P(B) ={[P(t&amp;lt;3)-P(t&amp;lt;2)]*}{P(t&amp;gt;2)} \hspace{0.65in}$ (2)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which one is right for the default probability in year 3? (1) or (2), or neither&lt;/p&gt;&#xA;" OwnerUserId="6354" LastEditorUserId="1418" LastEditDate="2013-12-10T17:53:44.477" LastActivityDate="2013-12-10T17:53:44.477" Title="default probability" Tags="&lt;probability&gt;&lt;default&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9681" PostTypeId="2" ParentId="9642" CreationDate="2013-12-10T15:41:19.477" Score="0" Body="&lt;p&gt;When a person (or group) owns a large block of stock the FFF is going to be less than 1.0.  For example if Mr. Bill Gates owns 20% of MSFT, the FFF for MSFT is going to be 0.8.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The weighting is based on FFF times the value of shares outstanding.  So because MSFT has such a large market capitalization (shares * price) it has a bigger weight that ACME, a small company that no one has heard of.&lt;/p&gt;&#xA;" OwnerUserId="6710" LastActivityDate="2013-12-10T15:41:19.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9682" PostTypeId="2" ParentId="9660" CreationDate="2013-12-11T04:29:17.260" Score="3" Body="&lt;p&gt;Look into OLF's Findur &lt;a href=&quot;http://www.olf.com/software/financial-capital.html&quot; rel=&quot;nofollow&quot;&gt;http://www.olf.com/software/financial-capital.html&lt;/a&gt;&#xA;highly customizable trading platform, will not give you everything you mentioned out of the gate but has capability to get there with some development effort  &lt;/p&gt;&#xA;" OwnerUserId="5014" LastActivityDate="2013-12-11T04:29:17.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9683" PostTypeId="1" CreationDate="2013-12-11T11:01:28.120" Score="2" ViewCount="55" Body="&lt;p&gt;We are trying to be able to get back to the Position state when our software goes down unplanned  during the day.&#xA;So far it seems we can get all our bought and sold quantity based on execution log we keep.&#xA;However to find the outstanding positions it seems a bit tricky.&#xA;Any suggestions would be appreciated.&#xA;We do keep track of acknowledgments. &lt;/p&gt;&#xA;" OwnerUserId="6714" LastActivityDate="2013-12-11T11:01:28.120" Title="Recreate Positions after downtime. Suggestions requested" Tags="&lt;high-frequency&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9685" PostTypeId="1" AcceptedAnswerId="9698" CreationDate="2013-12-11T14:25:24.833" Score="3" ViewCount="359" Body="&lt;p&gt;I am simulating the price of a basket option with the help of equations from the report &lt;a href=&quot;http://www.it.uu.se/edu/course/homepage/projektTDB/vt07/Presentationer/Projekt3/Dimension_Reduction_for_the_Black-Scholes_Equation.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.it.uu.se/edu/course/homepage/projektTDB/vt07/Presentationer/Projekt3/Dimension_Reduction_for_the_Black-Scholes_Equation.pdf&lt;/a&gt; .. I am a beginner in using Numerical methods in Finance.. hence I am stuck at probably the most trivial questions.. &#xA;This paper uses BDF2 method.. &#xA;The method includes performing PCA and then translating coordinates according to the following equations..&#xA;\begin{equation}&#xA;\bar{x}=\textbf{Q'} \ln(S) + b{\tau}&#xA;\end{equation}&#xA;where $\tau=T-t$ and $b_i= \sum_{j=1}^d q_{ij} (r- \frac{\sigma_j^2}{2})$. I saw two different formulas in two different places.. alternate one was $b_i= \sum_{j=1}^d q_{ij} (r- \frac{\sigma_j}{2})$ , and I can't understand which one is correct.&#xA;By applying change of variables to the Black Scholes Equation we get,&#xA;\begin{equation}&#xA;\frac{\partial u}{\partial \tau} =\frac12 \sum\limits_{i=1}^d \lambda_i \frac{\partial^2 u}{\partial x_i^2}-ru&#xA;\end{equation}&#xA;where $(\bar{x},\tau) \in \mathbb{R}^d \times (0,T)$ and $\lambda_i$ is the eigenvalue number $i$ of the covariance matrix. &#xA;The payoff for the basket option is,&#xA;\begin{equation}&#xA;u(\bar{x},0)=\max(\sum\limits_{i=1}^d \mu_i \exp(\sum_{j=1}^d q_{ij} x_j),0)&#xA;\end{equation}&#xA;where $\bar{x} \in \mathbb{R}^d$.&#xA;Now my question is..&#xA;What is in the vector U? According to me the dimension of U should be no_of_underlying_assets, but then I don't understand how spatial discretization plays a role here. I understand that the initial condition of U is the contract function(eq. 12) but then, it appears as a 1 x 1 scalar to me. Am quite confused here.&lt;/p&gt;&#xA;" OwnerUserId="6670" LastEditorUserId="6670" LastEditDate="2013-12-11T15:15:01.840" LastActivityDate="2013-12-12T14:45:24.820" Title="Finite difference methods" Tags="&lt;option-pricing&gt;&lt;numerical-methods&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9686" PostTypeId="1" AcceptedAnswerId="9687" CreationDate="2013-12-11T14:36:37.200" Score="6" ViewCount="206" Body="&lt;p&gt;I recently heard someone mention an arbitrage strategy involving selling freshly issued bonds and buying the &quot;old batch&quot; as it has shown that the liquidity in the fresh batch motivates/drives up these prices though everything else is equal. It was supposedly used extensively by Long-term Capital Management (LTCM) in the 90ies with extreme leverage and is common knowledge in the industry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the phenomena called and where can I read more about it? Papers with examples and data are highly appreciated. &lt;/p&gt;&#xA;" OwnerUserId="6717" LastEditorUserId="6717" LastEditDate="2013-12-11T15:07:10.867" LastActivityDate="2013-12-11T15:07:10.867" Title="Arbitrage with freshly issued bonds" Tags="&lt;fixed-income&gt;&lt;arbitrage&gt;&lt;bond&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9687" PostTypeId="2" ParentId="9686" CreationDate="2013-12-11T14:47:23.040" Score="8" Body="&lt;p&gt;This is called on the run/off the run arbitrage, a type of convergence trade. The basic idea is that as the liquidity premium disappears for the on-the-run issue, the price will fall and converge to the price of previous issues. Here are a couple papers - &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://people.stern.nyu.edu/lpederse/courses/LAP/papers/SearchBargaining/VayanosWeill.pdf&quot;&gt;http://people.stern.nyu.edu/lpederse/courses/LAP/papers/SearchBargaining/VayanosWeill.pdf&lt;/a&gt;&#xA;&lt;a href=&quot;http://webuser.bus.umich.edu/ppasquar/onofftherun.pdf&quot;&gt;http://webuser.bus.umich.edu/ppasquar/onofftherun.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6715" LastActivityDate="2013-12-11T14:47:23.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9688" PostTypeId="1" CreationDate="2013-12-11T15:23:19.200" Score="4" ViewCount="247" Body="&lt;p&gt;I have a time series of assets ${A_1, A_2, ..., A_n}$, which is described by a sophisticated distribution having the following characteristic function:  $\phi(u; t;\theta)$, where $\theta$ is a vector of unknown parameters. &#xA;I need to esimate vector of unknown parameters $\theta$ of characteristic function. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to find a PDF using the inverse Fourier transform to use the maximum likelihood method, but the characteristic function is too complicated for that.&#xA;I also thought about building the empirical characteristic function using the time series of assets and to estimate parameters using the least square method, but I do not know how to build the empirical characteristic function, because time series is not just a sample of random variables, it is a random process that depends on time.&lt;/p&gt;&#xA;" OwnerUserId="6718" LastActivityDate="2013-12-11T15:23:19.200" Title="Time series (stochastic process) estimating parameters using characteristic function" Tags="&lt;time-series&gt;&lt;stochastic-processes&gt;&lt;parameter-estimation&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9689" PostTypeId="2" ParentId="8138" CreationDate="2013-12-11T16:25:26.247" Score="1" Body="&lt;p&gt;The prices you are looking for can be found at &lt;a href=&quot;https://www.google.com/finance/getprices?q=HM-B&amp;amp;x=STO&amp;amp;i=60&amp;amp;p=5d&amp;amp;f=d,c,o,h,l&amp;amp;df=cpct&amp;amp;auto=1&amp;amp;ts=1266701290218&quot; rel=&quot;nofollow&quot;&gt;https://www.google.com/finance/getprices?q=HM-B&amp;amp;x=STO&amp;amp;i=60&amp;amp;p=5d&amp;amp;f=d,c,o,h,l&amp;amp;df=cpct&amp;amp;auto=1&amp;amp;ts=1266701290218&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;URL breakdown, I am lazy so I copied&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;q= stock symbol on Google finance  x= exchange symbol i= interval (here 60 means 60 sec (1 minute interval)) &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;p= no of period(here 5d denotes 5days of data) &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;f= parameters (day, close, open, high and low) df= difference (cpct is may be in % change ) &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;auto =1, ts = time start…&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Source&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;a href=&quot;http://www.marketcalls.in/database/google-realtime-intraday-backfill-data.html&quot; rel=&quot;nofollow&quot;&gt;http://www.marketcalls.in/database/google-realtime-intraday-backfill-data.html&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Javascript page scraping...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a tip for dealing with the javascript driven pages when scraping. If you write a scraper in .Net, use a visible or invisible WebBrowser control, suppress errors and allow the page to load. After load, you can force the click state (control.InvokeMember(&quot;onclick&quot;)) on whatever control you need and you are good.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is a snipit in VB:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    WebB.ScriptErrorsSuppressed = True&#xA;    WebB.Navigate(&quot;http://......&quot;)&#xA;    WaitForPageLoad() 'this is custom, search stackoverflow for this&#xA;    Dim doc As HtmlDocument = WebB.Document&#xA;&#xA;&#xA;    For Each c As HtmlElement In doc.All&#xA;        If c.Name = &quot;someelementname&quot; Then&#xA;            Dim ctrlAll As HtmlElement = doc.All(c.Id)&#xA;            c.InvokeMember(&quot;onclick&quot;)&#xA;        End If&#xA;    Next&#xA;    WaitForPageLoad()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6719" LastActivityDate="2013-12-11T16:25:26.247" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9690" PostTypeId="2" ParentId="3284" CreationDate="2013-12-11T16:54:29.350" Score="3" Body="&lt;p&gt;I used EODData for about a year in order to truly get a feel for the data. I would say for the price it is great, but there are inconsistencies in the data. I had found some serious errors that were never patched. I am sure there were many more but I didn't catch them. If you use them, I would advise running through the data to check for anomalies since they apparently cannot do that. Their coverage of options and global equities is great for the price and it beats scraping Yahoo and Google.&lt;/p&gt;&#xA;" OwnerUserId="6719" LastActivityDate="2013-12-11T16:54:29.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9691" PostTypeId="1" AcceptedAnswerId="9696" CreationDate="2013-12-11T22:37:47.090" Score="5" ViewCount="9194" Body="&lt;p&gt;Can anyone explain how Trade-At-Settlement (TAS) order on futures market actually works?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have heard that it is guaranteed execution at the settlement price (or with some offset). How can it be guaranteed? What if there are more contracts to buy than sell, who would cover imbalance?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, is it possible to cancel TAS order?&lt;/p&gt;&#xA;" OwnerUserId="5978" LastEditorUserId="56" LastEditDate="2014-01-02T17:47:56.417" LastActivityDate="2014-01-02T17:47:56.417" Title="How do Trade-At-Settlement orders work?" Tags="&lt;futures&gt;&lt;order-execution&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9692" PostTypeId="1" AcceptedAnswerId="14243" CreationDate="2013-12-11T23:56:44.153" Score="4" ViewCount="6019" Body="&lt;p&gt;Where I can high-frequency intraday data on VIX? Is it available on Bloomberg Terminals? I see many questions posted on Quant.stackexechange about VIX options therefore I am sure someone knows where I can get intraday data.&lt;/p&gt;&#xA;" OwnerUserId="2570" LastActivityDate="2020-01-24T04:12:11.307" Title="VIX intraday data" Tags="&lt;data&gt;&lt;vix&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9693" PostTypeId="1" CreationDate="2013-12-12T01:16:16.660" Score="1" ViewCount="57" Body="&lt;p&gt;I was reading the 2013 research rankings article on Institutional Investor and came across the following quote: &quot;We do not expect spread widening in most markets, and we expect the primary calendar to remain strong.&quot;  The quote is in relation to fixed income markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What does &quot;primary calendar&quot; here mean?  &lt;/p&gt;&#xA;" OwnerUserId="6722" LastActivityDate="2013-12-13T07:50:04.453" Title="What does &quot;primary calendar&quot; mean?" Tags="&lt;fixed&gt;&lt;income&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9695" PostTypeId="1" AcceptedAnswerId="9725" CreationDate="2013-12-12T04:57:12.493" Score="7" ViewCount="3721" Body="&lt;p&gt;I have worked in quantitative trading for a couple of years so I know what that space is about. I am curious to know what quantitative investing is all about. Based on what I have read and talked to people about, it seems like quant investors tend to build factor portfolios (based on either fundamental or pricing data) and there is a lot of emphasis on portfolio construction and a decent risk model. People who typically work at quant asset managers are econometricians or statisticians as opposed to electrical engineers or physicists in the quant trading world. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on my naive interpretation as an outsider, it seems like quant asset managers build long-short portfolios on fundamental factors. Since there is a finite amount of information that a financial statement can provide, how does a quant manager generate alpha uniquely as a lot of these fundamental factors can be easily data mined (to see which ones work )? Not looking for any secret sauce here, I am just trying to understanding how the guys on the quant investment side justify the fee they charge their clients. &lt;/p&gt;&#xA;" OwnerUserId="1696" LastActivityDate="2014-02-08T14:41:36.987" Title="What is Quantitative Investing and how does it differ from Quantitative Trading?" Tags="&lt;factor-models&gt;&lt;investment&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9696" PostTypeId="2" ParentId="9691" CreationDate="2013-12-12T08:19:12.987" Score="9" Body="&lt;p&gt;Think of it like a forward trade on the settlement price.  If you are buying with a TAS you are agreeing to go long the futures contract at the settlement price (+/- the offset), and whoever you trade with is agreeing to go short at the same price.  It is guaranteed because the exchange becomes the counterparty for both traders and there is a margin deposit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can cancel an order if it has not executed yet.  There is a TAS order book where the prices are the offsets you are willing to trade at.  Once your order has been matched, you are either long or short the TAS contract and have to trade out of it if you don't want to actually do the futures trade at the close, just as if you had a position in a futures contract and wanted to get flat before the delivery process starts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;TAS contracts get into the news periodically because they are used in a manipulation strategy called &quot;banging the close&quot; where traders take a position in TAS contracts then try to move the settle price in their favor with trades around the close. Here is an example: &lt;a href=&quot;http://dodd-frank.com/second-recent-cftc-banging-the-close-case-results-in-various-cea-violations-fines-trading-bans/&quot; rel=&quot;noreferrer&quot;&gt;http://dodd-frank.com/second-recent-cftc-banging-the-close-case-results-in-various-cea-violations-fines-trading-bans/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6280" LastActivityDate="2013-12-12T08:19:12.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9697" PostTypeId="1" AcceptedAnswerId="35175" CreationDate="2013-12-12T12:57:03.890" Score="14" ViewCount="1781" Body="&lt;p&gt;In portfolio management one often has to solve problems of the quadratic form&#xA;$$&#xA;w^T \Sigma w + w^T c \rightarrow \min_{\omega}&#xA;$$&#xA;with portfolio weights $w \in \mathbb{R}^N$ a constant $c \in \mathbb{R}^N$ and a covariance matrix $\Sigma \in \mathbb{R}^{N \times N}$. Furthermore we assume real world continuous and binary (e.g. cardinality) constraints.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For estimating the covariance matrix $\Sigma$ we can e.g. use the sample covariance of the returns of all assets - let's call this an asset-by-asset model. It is known that some care has to be taken here if $N$ is big and so forth, but this is not the point of this question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand we can define factors $(F_k)_{k=1}^K$ with $K&amp;lt;N$. These factors have a covariance matrix $\Sigma_F \in \mathbb{R}^{K \times K}$. Denoting by $r_i$ the return of asset $i$ with $i = 1, \ldots, N$, we can write: &#xA;$$&#xA; r_i = \sum_{k=1}^K e_{i,k} F_k + \epsilon_i,&#xA;$$&#xA;with the meaning that the variation of the return is described by the exposures $e_{i,k}$ to the factors and some purely idiosyncratic risk $\epsilon_i$.&#xA;In this case the covariance matrix of returns is given by &#xA;$$&#xA;\hat{\Sigma} = e \Sigma_F e^T + \mathop{diag}(Var[\epsilon_1],\ldots,Var[\epsilon_N]),&#xA;$$&#xA;where $e \in \mathbb{R}^{N \times K}$ is the matrix of all exposures and the &quot;diag&quot; part adds the idiosyncratic parts of variance at the main diagonal. Note that $\hat{\Sigma} \in \mathbb{R}^{N \times N}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I sometimes read that a problem with covariance matrix $\hat{\Sigma}$ from the factor model is easier to solve than with $\Sigma$.&#xA;Is this true? If yes, then how can we see this? My personal answer so far is: no. Because both are $N \times N$ matrices and the structure does not help in general.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Especially if the factors are not orthogonal - what do we gain? If the factors come from a PCA then we might gain something but I wonder how many PCs we would need e.g. in a global equities portfolio ...&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="26595" LastEditDate="2017-05-11T08:56:32.347" LastActivityDate="2017-07-19T03:12:34.413" Title="Optimization: Factor model versus asset-by-asset model" Tags="&lt;portfolio-management&gt;&lt;portfolio-optimization&gt;&lt;factor-models&gt;&lt;asset-allocation&gt;&lt;covariance-matrix&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="9698" PostTypeId="2" ParentId="9685" CreationDate="2013-12-12T14:45:24.820" Score="2" Body="&lt;p&gt;$u$ is the value of the option, and is in fact a scalar (which, of course, is a function its several underlyings). You're studying a single option on a basket, not a basket of options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the two different formulas: you can pick the correct one just by looking at the units of its terms. The rate $r$ is the inverse of a time; each volatility $\sigma_j$ is the inverse of the square root of a time (you can see that from their definitions, or from their role in the Black-Scholes formula). The formula that combines them in a meaningful way is the one with the $\left( r - \frac{\sigma_j^2}{2} \right)$ term.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2013-12-12T14:45:24.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9699" PostTypeId="1" CreationDate="2013-12-12T16:09:20.413" Score="8" ViewCount="6215" Body="&lt;p&gt;I want to calculate the estimated default probability with only given data the monthly returns for the last 20 years, the risk-free rate ($R_f$), equity value (EV) and the face value of debt ($D$). My steps so far are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Find each month's lognormal returns: Ln(Month);&lt;/li&gt;&#xA;&lt;li&gt;Subtract from each result in step 1 the average of the lognormal returns and then raise them to the power of 2 and then sum it, in order to find the monthly equity volatility;&lt;/li&gt;&#xA;&lt;li&gt;Calculate the annualized equity volatility by doing &#xA;$$\left(1 + \frac{\textrm{monthly equity volatility}}{12}\right)^{12 \times 20} - 1$$&lt;/li&gt;&#xA;&lt;li&gt;Calculate Asset Value (AV) using the formula: AV = EV * equity volatility + D (not sure if its correct)&lt;/li&gt;&#xA;&lt;li&gt;Attempt to solve the equations to derive the asset volatility but get stuck when using the Excel solver.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;How to proceed?&lt;/p&gt;&#xA;" OwnerUserId="6728" LastEditorUserId="848" LastEditDate="2013-12-12T20:14:13.373" LastActivityDate="2015-08-11T17:51:00.877" Title="How to use Merton model to calculate default probability with monthly stock prices?" Tags="&lt;merton-model&gt;&lt;default-probability&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9700" PostTypeId="2" ParentId="9639" CreationDate="2013-12-12T17:43:09.543" Score="3" Body="&lt;p&gt;I'm guessing ${W_t^r}$ and ${W_t}$ correspond to real and nominal endowment at time $t$, respectively, and that ${P_t^g}$ is the price level at time $t$. In that case, $W_t^r \equiv W_t/P_t^g$ follows, and if endowment grows at a nominal interest rate $R_t$, then $W_t = W_{t-1}(1+R_t)$. We can write $W_{t-1}=(W_{t-1}^rP_{t-1}^g)$, so by substitution $W_t=(W_{t-1}^rP_{t-1}^g)(1+R_t)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suspect the last part of the first line, $=/P_1^g$, contains a typo. There should be no space between this and the previous text: that way we can substitute $W_t$ back into  the expression for $W_t^r$ and get to the adequate expression:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$W_t^r = (W_{t-1}^rP_{t-1}^g)(1+R_t)/P_t^g$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What bugs me is the second line: we can define the inflation rate $\pi_t$ as $P_t^g=(1+\pi_t)P_{t-1}^g$. We are given $(1+R_t^r)\equiv W_t^r/W_{t-1}^r$, so the equation should resolve to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\dfrac{W_t^r}{W_{t-1}^r}=\dfrac{W_t/P_t^g}{W_{t-1}/P_{t-1}^g}=\dfrac{W_t}{W_{t-1}}\dfrac{P_{t-1}^g}{P_t^g}=(1+R_t)\dfrac{1}{1+\pi_t}=\dfrac{1+R_t}{1+\pi_t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the above in hand, all we need to do is subtract one to arrive at your final expression:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$R_t^r=\dfrac{1+R_t}{1+\pi_t}-1=\dfrac{1+R_t-(1+\pi_t)}{1+\pi_t}=\dfrac{R_t-\pi_t}{1+\pi_t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; This, of course, is a &lt;a href=&quot;http://en.wikipedia.org/wiki/Fisher_equation&quot; rel=&quot;nofollow&quot;&gt;restatement of the Fisher equation&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6730" LastEditorUserId="6730" LastEditDate="2013-12-12T22:15:50.223" LastActivityDate="2013-12-12T22:15:50.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9701" PostTypeId="1" CreationDate="2013-12-12T20:18:08.653" Score="4" ViewCount="7251" Body="&lt;p&gt;I have question about the linear interpolation of interest rates. I am unable to reconcile the Bloomberg methodology for calculating risk-free rate between maturities. In theory it is a straight-line interpolation, but the numbers don't pan out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2 year US Sovereign Strips Yield: 0.333%(BEY)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3 year US Sovereign Strips Yield: 0.633%(BEY)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to the straight-line method the Yield for 2.826 year is 0.5808%(BEY)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While the interpolated 2.826 year Yield is 0.619% from Blg interpolation function(BEY)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in addition, the additional information is below&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 year US Sovereign Strips Yield: 0.11%(BEY)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2 year US Sovereign Strips Yield: 0.333%(BEY)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3 year US Sovereign Strips Yield: 0.633%(BEY)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4 year US Sovereign Strips Yield: 1.058%(BEY)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5 year US Sovereign Strips Yield: 1.426%(BEY)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anyone can calibrate the result from blg?&lt;/p&gt;&#xA;" OwnerUserId="6732" LastEditorUserId="6732" LastEditDate="2013-12-12T20:57:03.753" LastActivityDate="2016-03-30T15:54:31.183" Title="Bloomberg interest rate interpolation" Tags="&lt;interest-rates&gt;&lt;bloomberg&gt;" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9702" PostTypeId="2" ParentId="9699" CreationDate="2013-12-12T20:44:03.420" Score="2" Body="&lt;p&gt;detailed description of the solution of this problem using Excel is in the second chapter of the book &lt;a href=&quot;http://eu.wiley.com/WileyCDA/WileyTitle/productCd-0470660929.html&quot; rel=&quot;nofollow&quot;&gt;Credit Risk Modeling using Excel and VBA Gunter Löffler&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6718" LastEditorUserId="70" LastEditDate="2013-12-12T21:51:31.500" LastActivityDate="2013-12-12T21:51:31.500" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9704" PostTypeId="1" AcceptedAnswerId="9708" CreationDate="2013-12-13T00:21:51.597" Score="4" ViewCount="3249" Body="&lt;p&gt;I am not quite clear about this.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;When people mention Eurodollar are they mean Eurodollar Futures? &lt;/li&gt;&#xA;&lt;li&gt;One of the difference between Eurodollar and Forward Rate Agreement(FRA) is basically difference between futures and forward, which means daily settlement for futures. Is there anything else?&lt;/li&gt;&#xA;&lt;li&gt;If Eurodollar and FRA are both used to lock interest rate, are these same as Interest Rate Swap?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="6354" LastActivityDate="2013-12-13T03:25:35.037" Title="EuroDollar vs FRA" Tags="&lt;interest-rates&gt;&lt;futures&gt;&lt;forward&gt;&lt;irs&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9705" PostTypeId="1" CreationDate="2013-12-13T02:20:23.110" Score="1" ViewCount="185" Body="&lt;p&gt;I know this is a very elementary question but... when modeling asset prices through a stochastic process as in &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dS_t=S_t μ dt+S_t σdW_t,$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the following is a wiener process $$dW_t=σN(0,1)dt^{1/2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;how does the mean $μ$ and volatility $σ$ scale with the time interval $dt$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I am forecasting for 1 year in the future, in 1 day steps, $dt$=1/250=.004&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what if the mean parameter I have calculated for $μ$ and $σ$ is for daily returns, would the equation still hold? ie, I take a 20SMA of returns for the last 20 days, so my return is already daily. In all the literature I  have read $μ$ and $σ$ are already annual  which in my case is not helpful because I look at daily returns for assets not annual returns that have been scaled down to daily. &lt;/p&gt;&#xA;" OwnerUserId="4729" LastEditorUserId="4729" LastEditDate="2013-12-13T18:18:24.120" LastActivityDate="2013-12-13T18:18:24.120" Title="Scaling Intervals in Diffusion Process" Tags="&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9706" PostTypeId="2" ParentId="9705" CreationDate="2013-12-13T03:08:56.533" Score="2" Body="&lt;p&gt;First, your statement that $dW_t=\sigma\,dt^{1/2}$ is incorrect. In fact, it's not even meaningful (you can see this by noticing that the expression on the left-hand-side is an &quot;increment&quot; of Brownian motion, and hence random, while the expression on the right-hand side is deterministic). What you mean to say is that $W$ is a Brownian motion, and hence $\text{E}(W_t)=0$ and $\text{Var}(W_t)=t$. Or better, the quadratic variation of $W$ is $&amp;lt;W&amp;gt;_t=t$. It's important to remember that the &quot;increment&quot; $dW_t$ is simply a notational convenience - it's not really a well-defined concept, since the paths of Brownian motion have infinite first variation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, coming to your question, the in asset pricing models the parameters $\mu$ and $\sigma$ are usually specified as the &lt;em&gt;annual&lt;/em&gt; drift rate and the &lt;em&gt;annual&lt;/em&gt; volatility. If instead, you have estimated a daily drift rate $\mu_d$ and a daily volatility $\sigma_d$, then you can scale them as follows $\mu=252\mu_d$ and $\sigma=\sqrt{252}\sigma_d$, where we're using the convention that a year contains 252 trading days.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards&#xA;Hardy&lt;/p&gt;&#xA;" OwnerUserId="6529" LastActivityDate="2013-12-13T03:08:56.533" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9708" PostTypeId="2" ParentId="9704" CreationDate="2013-12-13T03:25:35.037" Score="8" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Yes. Although sometimes people mean the Euro/Dollar currency pair which can cause confusion.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Besides the daily mark-to-market, the counter-party risk is also removed through the clearing house for the futures.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;No. Eurodollar and FRA are not the same as swaps. A Eurodollar fixes an interest rate for a three month period in the future whereas a swap represents the different cash flows between floating and fixed rates during a period. However, the cash flow of a plain vanilla swap can be replicated with a sequence (strip) of Eurodollar contracts.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5107" LastActivityDate="2013-12-13T03:25:35.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9709" PostTypeId="2" ParentId="9693" CreationDate="2013-12-13T07:50:04.453" Score="1" Body="&lt;p&gt;&quot;Primary calendar&quot; in this context most likely means the schedule of emissions on the primary market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the primary calendar is strong, there are lots of emissions both in number and size.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2013-12-13T07:50:04.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9710" PostTypeId="2" ParentId="44" CreationDate="2013-12-13T09:51:59.337" Score="1" Body="&lt;p&gt;One approach which I've encountered in practice is Optimal risk budgeting (ORB). This method is similar to Black Litterman in the sense that it uses active investor views as a starting point. The mean variance optimization is then restricted to those assets for which an active investor  view is available, and the allocation is calculated with the constraint of an overall risk budget (a maximum tracking error or volatility of the portfolio).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;W. Lee &amp;amp; D.Y.Lam, 'Implementing Optimal Risk Budgeting', Journal of Portfolio Management 2001 (Vol 28) 73-80.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The ORB approach uses the view confidence of the investor as an estimate of the expected return. In practice, this is typically an expected return spread of an active view such as 'US equities will outperform EU equities by $x$'. The volatility of the view portfolio $r_L - r_S$ is commonly used to estimate this spread.&lt;/p&gt;&#xA;" OwnerUserId="6721" LastActivityDate="2013-12-13T09:51:59.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9715" PostTypeId="1" CreationDate="2013-12-13T14:10:39.270" Score="5" ViewCount="1007" Body="&lt;p&gt;I have been using the &lt;a href=&quot;http://cran.r-project.org/web/packages/tseries/tseries.pdf&quot; rel=&quot;nofollow&quot;&gt;tseries package&lt;/a&gt; of R (&lt;code&gt;get.hist.quote&lt;/code&gt;) to get historical quotes for various indices from yahoo finance. I am interested in DAX, VDAX, EB.REXX and DJ UBS Commodity Index.&#xA;When I tried to expand the time window for my analyses I saw that all time series except DAX and VDAX are discontinued.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Do you know why EB.REXX (the symbol was REX.DE) dissapeared on yahoo finance (I now use EB.REXX 10 years, REX0.DE, but it is also discontinued) and why I can not find DJ UBS Cdty Index (symbol: ^DJUBS) anymore?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use code like&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;require(tseries)&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;get.hist.quote(instrument=&quot;REX0.DE&quot;,start=&quot;2006-01-01&quot;,quote=c(&quot;AdjClose&quot;),compression=&quot;d&quot;) &#xA;get.hist.quote(instrument=&quot;^DJUBS&quot;,start=&quot;2006-01-01&quot;,quote=c(&quot;AdjClose&quot;),compression=&quot;d&quot;) &#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but both times series end in the 2nd half of 2012.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Do you know any R-compatible open data source where I can get&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;a price or performance index for German or core-EURO government bonds (like eb.rexx)&lt;/li&gt;&#xA;&lt;li&gt;a price or performance index for broad commodities (like DJ UBS Cdty Index)?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;EDIT:&#xA;I started to try &lt;code&gt;getSymbols&lt;/code&gt; of the &lt;a href=&quot;http://cran.r-project.org/web/packages/quantmod/quantmod.pdf&quot; rel=&quot;nofollow&quot;&gt;quantmode package&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;In google finance I found INDEXDB:RXPG for EB.REXX and INDEXDJX:DJUBS for DJ UBS - are these the correct indices? Where do I find any description of the data?&lt;/li&gt;&#xA;&lt;li&gt;The example taken from the manual - &lt;code&gt;getSymbols(&quot;MSFT&quot;,src=&quot;google&quot;)&lt;/code&gt; - works, but what I would need for the index data - &lt;code&gt;getSymbols(&quot;INDEXDB:RXPG&quot;,src=&quot;google&quot;)&lt;/code&gt; - does not ...&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2013-12-18T08:38:59.663" LastActivityDate="2017-08-19T19:06:04.947" Title="Open source equity/bond index data" Tags="&lt;data&gt;&lt;market-data&gt;&lt;index&gt;&lt;yahoo&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9717" PostTypeId="1" CreationDate="2013-12-13T18:24:56.763" Score="2" ViewCount="845" Body="&lt;p&gt;Am looking for a simple list of the NACE 2008 rev 2 codes (The European classifications for economic sectors).  The official publication is &lt;a href=&quot;http://ec.europa.eu/eurostat/documents/3859598/5902521/KS-RA-07-015-EN.PDF&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;, but is there an easily accessible list of the actual codes available anywhere?&lt;/p&gt;&#xA;" OwnerUserId="5883" LastEditorUserId="5883" LastEditDate="2016-02-08T16:24:55.890" LastActivityDate="2016-02-08T16:24:55.890" Title="List of 2008 NACE Rev 2 codes" Tags="&lt;european&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9718" PostTypeId="2" ParentId="9651" CreationDate="2013-12-13T23:44:26.653" Score="4" Body="&lt;p&gt;Fitting a time series on a given stock is really trade off between statistical risk and model error. If your time series is too short then your statistical error will be high. If your time series is too long, then the distribution of the market will probably have changed, and the your model error will be high.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5000 days is about 20 trading years. There is no way your choice of distribution will be meaningful a garch forecast. To add insult to injury, your forecast, tends to the unconditional variance very quickly $(\alpha +\beta)^n$ where $n$ is the number of days ahead. So if you are forecasting 105 days ahead, even if $\alpha + \beta$ quite high,$(\alpha +\beta)^{105}$ will be close to zero.  &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Choose a proper and meaningful forecast horizon&lt;/li&gt;&#xA;&lt;li&gt;Depending on your forecast horizon choose reasonable time frame.&lt;/li&gt;&#xA;&lt;li&gt;Do several change of point test to see if your distribution has changed. If it did, try to reduce the time frame.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="6743" LastEditorUserId="56" LastEditDate="2014-01-02T17:37:19.267" LastActivityDate="2014-01-02T17:37:19.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9719" PostTypeId="1" CreationDate="2013-12-13T23:54:48.970" Score="8" ViewCount="1535" Body="&lt;p&gt;Assume that you have a portfolio for which you have estimated a parametric model to the underlying instruments, but the distribution of the portfolio as a whole is too complicated to compute explicitly. Now you want to determine the expected shortfall by Monte Carlo simulations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know that for our r.v. $Y$ the empirical cdf can be estimated by $$\hat{F}_Y(y)=\frac{1}{n}\sum\limits_{i=1}^n I(Y_i \leq y)$$&#xA;and the quantiles can be estimated by $$\hat{y}_q=\text{inf}[y:\hat{F}_Y(y)\ge q] =\Upsilon_{[nq]+1}$$ where $\Upsilon_i$ is the i:th order statistic. Thus the ES can be estimated by $$\widehat{ES}_p(Y) = \frac{1}{p}\left(\sum\limits_{i=1}^{[np]}\frac{\Upsilon_i}{n}+\left(p-\frac{[np]}{n}\right)\Upsilon_{[np]+1}\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, as we will see for this numerical approximation is that it converges very slow for increasing sample size N! This is illustrated with an example where the random variable Y is standard normal (the x axis is N/100)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/FnxS1.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe you could naively repeat the simulation for fixed N (sufficiently large, eg. ~200*100) and then take the mean. But isn't there any other techniques that deal with this problem (especially in the case of heavy tails)? I've managed to find several different methods, for example using control variates, importance sampling, delta-gamma approximation etc. But none of these doesn't apply to the case of empirical ES. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;All comments, including references to articles, are welcome!&lt;/p&gt;&#xA;" OwnerUserId="4709" LastActivityDate="2014-01-27T14:05:02.367" Title="Estimation of Empirical Expected Shortfall of a heavy tailed distribution" Tags="&lt;monte-carlo&gt;&lt;estimation&gt;&lt;value-at-risk&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9721" PostTypeId="2" ParentId="9695" CreationDate="2013-12-14T15:08:22.847" Score="1" Body="&lt;p&gt;I would like to say the Portfolio Construction thing is weak and quite fake. Too much assumption which is too unrealistic are out there for these econometrician to play around. Think about how the Credit Crisis happened：every body was so happy about using model to combine the risky asset and assumed unrisky assets together to sell it. After the 2008, the model is the one who got blamed. It is ridiculous. Fundamental, long term investment needs more talent and bottom to top way to analysis. If you see it as a math game, you will lose for sure. They just play the limited number and lazy enough to get result quick without thinking. Warren Buffent never has any magic regression, right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I prefer the quant trading more. They take the risk and make the hard money.&lt;/p&gt;&#xA;" OwnerUserId="2162" LastActivityDate="2013-12-14T15:08:22.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9722" PostTypeId="1" CreationDate="2013-12-14T15:47:18.183" Score="2" ViewCount="306" Body="&lt;p&gt;I read Hull (2009) on implied volatilies. I understand that (given a negatively skewed return distribution) an OTM-Put is more worth than under a normal distribution and that a OTM-Call is worth less which leeds to the volatility skew for equity options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ITM-Puts and OTM-Calls imply the same volatility due to put-call-parity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there another inuitive explanation for why ITM-Puts are worth less under a negatively skewed distribution than under a normal distribution?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance!&lt;/p&gt;&#xA;" OwnerUserId="6748" LastActivityDate="2013-12-16T07:50:30.633" Title="ITM Puts under negatively skewed return distribution (volatility skew)" Tags="&lt;implied-volatility&gt;&lt;distribution&gt;&lt;return&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9724" PostTypeId="1" AcceptedAnswerId="9823" CreationDate="2013-12-15T01:23:37.920" Score="3" ViewCount="3433" Body="&lt;p&gt;This was an exam question at Cambridge University.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Let &lt;span class=&quot;math-container&quot;&gt;$S_t = S_0 \exp \left(\sigma W_t + (r-\dfrac{1}{2}\sigma^2) \right)$&lt;/span&gt; and a bank account returns a continuously-compounded rate of interest &lt;span class=&quot;math-container&quot;&gt;$r$&lt;/span&gt;. Consider the derivative which pays&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$Y = (\exp(T^{-1}\int^T_0\log(S_u)\text{d}u) - K)^+$&lt;/span&gt; at time T.&lt;/p&gt;&#xA;&lt;p&gt;What is the time-0 price for this derivative, and show it is less than the price of a European call.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;The price of this, if I am not wrong, is&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$S_0\exp(-\dfrac{1}{2}(r+\sigma^2/6)T) N(d_2) - Ke^{-rT}F(-d_1)$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;where &lt;span class=&quot;math-container&quot;&gt;$d_1 = \log(K/S_0-1/2(r-\sigma^2)T)/(\sigma\sqrt{T/3})$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$d_2 = -d_1+\sigma\sqrt{T/3}$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I don't see how this is less than the European call.&lt;/p&gt;&#xA;" OwnerUserId="3334" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2018-06-04T10:37:00.383" Title="How to prove price of Asian option under geometric averaging is cheaper than a European call?" Tags="&lt;black-scholes&gt;&lt;derivatives&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="9725" PostTypeId="2" ParentId="9695" CreationDate="2013-12-15T03:59:30.827" Score="7" Body="&lt;p&gt;Quant investing has the same basic problem as any approach to asset management: &lt;em&gt;capacity for capital invested&lt;/em&gt;. Unlike quant trading, quant investing deals with large assets. For this reason, the type of arbitrage opportunities pursued by quant traders are not feasible for investing - those strategies simply do not have the capacity necessary for asset management. Factor models are popular in the field because they have high capacity. The capacity comes from the core of factor modeling; you typically start by ranking &lt;em&gt;all&lt;/em&gt; securities by a given factor for inclusion in the long/short side of a portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, if all factors are based on fundamentals, how can you differentiate your model from anyone else? Firstly, new and interesting data emerges all the time. One recent example is &lt;a href=&quot;http://estimize.com&quot; rel=&quot;noreferrer&quot;&gt;estimize&lt;/a&gt;, which has crowd-sourced buy-side earnings estimates. Secondly, factors can be deconstructed into multiple sub-factors, combined to form composite factors, sliced by time, by industry, by season, or filtered using learning techniques. Or you could look at non-corporate data like the fed beige book, or census data, or social data, or industry specific measures. In short, the range of possible approaches is huge.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, the difficulty in quant investing with factors is that the search space is so large that it is very difficult to find a signal that works without falling prey to over-fitting. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at an example analysis and implementation is often helpful - here is a presentation and sample python implementation for a &lt;a href=&quot;http://blog.quantopian.com/short-interest-data-analysis-from-jessica-stauth/&quot; rel=&quot;noreferrer&quot;&gt;short-interest factor model&lt;/a&gt; (disclosure I work at Quantopian).&lt;/p&gt;&#xA;" OwnerUserId="799" LastActivityDate="2013-12-15T03:59:30.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9727" PostTypeId="2" ParentId="9722" CreationDate="2013-12-15T12:51:46.097" Score="0" Body="&lt;p&gt;I guess the cumulative distribution function of stock prices at maturity is an intuitive way to understand this (I'm not 100% sure).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume you would value an ITM Put by using simulation. If it is worth less than under BS, then the sum of simulated payoffs should be less than under normally distributed returns. This is the case if fewer stock prices below the strike of the ITM put are possible than under normally distributed returns. Hence the line of the CDF of stock prices of a normal distribution should be above the CDF of &quot;real&quot; stock prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For OTM Puts the opposite is the case. The CDF of &quot;real&quot; stock prices lies above the CDF of stock prices under normally distibuted returns. Stock prices below the strike of the OTM-Puts are more likely &quot;in reality&quot; which is why it's worth more than under BS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know if this is right - Maybe an alternative for using put call parity an OTM Calls and transferring it to ITM Puts.&lt;/p&gt;&#xA;" OwnerUserId="6748" LastActivityDate="2013-12-15T12:51:46.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9728" PostTypeId="1" CreationDate="2013-12-15T15:13:38.907" Score="3" ViewCount="3741" Body="&lt;p&gt;Have been looking for ways to down load stock price data using Yahoo Finance on Chinese Stocks. Symbol that ends with .SS = stock listed in Shanghai, .zz = stock listed in Shenzhen&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This link &lt;a href=&quot;http://finance.yahoo.com/d/quotes.csv?s=000625.sz&amp;amp;f=snohgl1v&quot; rel=&quot;nofollow&quot;&gt;http://finance.yahoo.com/d/quotes.csv?s=000625.sz&amp;amp;f=snohgl1v&lt;/a&gt; returns&lt;/p&gt;&#xA;&#xA;&lt;p&gt;000625.SZ      CHANGAN AUTOMOBIL      12.4      12.8      12.4      12.69      9787354 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This link &lt;a href=&quot;http://finance.yahoo.com/d/quotes.csv?s=600600.SS&amp;amp;f=snohgl1v&quot; rel=&quot;nofollow&quot;&gt;http://finance.yahoo.com/d/quotes.csv?s=600600.SS&amp;amp;f=snohgl1v&lt;/a&gt; returns&lt;/p&gt;&#xA;&#xA;&lt;p&gt;600600.SS      600600.SS      N/A      N/A      N/A      0      N/A    &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have done a few tests and and .SZ stocks return valid data but not for .SS stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However using this link &quot;table.finance.yahoo.com/table.csv?s=600600.SS&quot; the data is clearly there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Really confused as to why this is the case. Anyone has any ideas?&lt;/p&gt;&#xA;" OwnerUserId="6760" LastActivityDate="2017-09-19T04:47:17.993" Title="Yahoo Finance API" Tags="&lt;yahoo&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9729" PostTypeId="1" CreationDate="2013-12-15T15:40:46.547" Score="4" ViewCount="560" Body="&lt;p&gt;Do you have any idea about how we can prove, and under which conditions, that an equivalent martingale measure (EMM) in an incomplete market is unique? The assumptions we have made are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) that the stochastic process St of the asset is a semi martingale (continuous) and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) that this EMM exists.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, that the variance optimal measure is unique.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="6761" LastActivityDate="2014-04-08T19:22:55.713" Title="unique equivalent martingale measure in incomplete markets" Tags="&lt;stochastic-calculus&gt;&lt;martingale&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9730" PostTypeId="1" CreationDate="2013-12-15T15:49:01.550" Score="4" ViewCount="386" Body="&lt;p&gt;I have been working on a neural network based on certain technical indicators. As people familiar with neural networks would know after developing a hypothesis, the developer is also supposed to provide a set of data to learn from. Now if were a case of developing neural networks for spam fitering I would provided it with sets of spam and non spam data. But in my case how do I select the buy/sell point...do I just randomly select the entry points where can visually see the movement in price that I desire or is there a better approach?&lt;/p&gt;&#xA;" OwnerUserId="6762" LastActivityDate="2014-08-22T11:59:25.267" Title="selecting test data for neural networks" Tags="&lt;high-frequency&gt;&lt;machine-learning&gt;&lt;neural-networks&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9731" PostTypeId="2" ParentId="9730" CreationDate="2013-12-15T16:36:35.453" Score="0" Body="&lt;p&gt;I just look at the future and decide what position I would have wanted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $price_{t+interval} &amp;gt; price_t$ + transaction costs then position = 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;less than would be -1 and flat would be 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So now I would have a matrix of indicators and desired position at time t.&lt;/p&gt;&#xA;" OwnerUserId="5872" LastActivityDate="2013-12-15T16:36:35.453" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9733" PostTypeId="1" CreationDate="2013-12-15T20:58:17.967" Score="4" ViewCount="239" Body="&lt;p&gt;I was playing around in Excel the other day, simulating possible equity curve/P&amp;amp;L paths for a simple game I designed. The game is really trying to find an optimal risk managment strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I start of with an initial Capital: 100. &#xA;In each time increment you have the opportunity to risk a % of your capital on a coin flip, at each time period, you can either gain/lose the amount you bet on each flip. E.g. in the initial flip, if you gambled 25% of your capital, you can gain 25 or lose 25. The possibility of winning on each coin flip is 50% and the possibility of losing is 50%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I simulated over 4000 possible P/L paths over 10 coin flips and I kept coming out with a win ratio less than 50. The more I &lt;strong&gt;increased the amount invested&lt;/strong&gt; on each flip, the more I lost. The &lt;strong&gt;more coin flips&lt;/strong&gt; I played the more my win% dropped.  (Note, my definition of a win ratio is by the end of the 10th toss, how many of the simulations ended with a final capital greater than my initial capital of 100)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I decided later to alter the  % I invest on each coin flip based based on whether I won/lost the prior coin flip. In other words, if the last coin flip was win, the % amount I invest would be $x$ and if I lost the prior coin flip the % amount I invest would be $y%$. I came out with pretty startling results. I found that if I lost the prior flip, I should increase the amount I invest on the next flip. For the 4000 simulations among 10 flips, I came out with a 53% win ratio for % amount invested $x=3$ and $y=16$, ie, your increasing your bet size as you lose more. Is there any justification for this? Has anyone come to a similar conclusion from a similar simulation. Would love to post the excel spread sheet if anyone would like to take a look it. &lt;/p&gt;&#xA;" OwnerUserId="4729" LastEditorUserId="70" LastEditDate="2013-12-31T00:20:17.333" LastActivityDate="2013-12-31T00:20:17.333" Title="Random Brownian Simulation Startling Results" Tags="&lt;probability&gt;&lt;simulations&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9734" PostTypeId="2" ParentId="9733" CreationDate="2013-12-15T21:05:59.887" Score="0" Body="&lt;p&gt;Computers can't generate true random numbers without special devices, please read &lt;a href=&quot;http://en.wikipedia.org/wiki/Hardware_random_number_generator&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Hardware_random_number_generator&lt;/a&gt; for more information about that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In normal computer or excel pseudo random number generation often looks like walking over and over again over same hard coded table with seeding based on time with some modulo operations between.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think your conclusions with better results using some parameters in break-even game are just fitting to pseudo random number generator patterns in hard coded data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First you should use other random number generation stream like &lt;a href=&quot;http://www.random.org/&quot; rel=&quot;nofollow&quot;&gt;http://www.random.org/&lt;/a&gt; (true random numbers), and using that data you should converge in first algorithm to 50% (50/50, equal gain/loss), after that you can start testing hypothesis.&lt;/p&gt;&#xA;" OwnerUserId="6175" LastActivityDate="2013-12-15T21:05:59.887" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9735" PostTypeId="1" AcceptedAnswerId="9742" CreationDate="2013-12-15T23:20:48.293" Score="1" ViewCount="216" Body="&lt;p&gt;Exercise 2.3.1.5: The payoff of a power option is $h(S_T)$, where the function h is given by $h(x) = x^\beta(x-K)^+$. Prove that the payoff can be written as the difference of European payoffs on the underlying assets $S^{\beta+1}$ and $S^\beta$ with strikes depending on K and $\beta$.&lt;/p&gt;&#xA;" OwnerUserId="6765" LastActivityDate="2013-12-17T21:32:34.750" Title="A Question from &quot;Mathematical Methods for Financial Markets&quot; Chapter 2" Tags="&lt;quantitative&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9736" PostTypeId="2" ParentId="9729" CreationDate="2013-12-16T01:10:06.693" Score="4" Body="&lt;p&gt;Suppose that there are multiple martingale measures $Q_1$ and $Q_2$ that attain the minimal variance.  Then the convex combination $Q_* := \frac{1}{2}Q_1 + \frac{1}{2}Q_2$ is also a martingale measure.  Due to the strict convexity of $f(x) = x^2$, it can be shown that&#xA;$$&#xA;E_P \left[\frac{dQ_*}{dP}^2 \right] &amp;lt; \frac{1}{2} E_P \left[ \frac{dQ_1}{dP}^2 \right] + \frac{1}{2} E_P \left[ \frac{dQ_2}{dP}^2 \right].&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make this completely airtight, you need to use the notion of uniform convexity, i.e. $f \left(\frac{x+y}{2} \right) &amp;lt; \frac{1}{2} \left( f(x) + f(y) \right) -\epsilon | x - y|$, for some $\epsilon$.  The details are tedious but not hard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In any case, you have a contradiction, and the minimizer must be unique.&lt;/p&gt;&#xA;" OwnerUserId="3415" LastEditorUserId="3415" LastEditDate="2014-04-08T19:22:55.713" LastActivityDate="2014-04-08T19:22:55.713" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9737" PostTypeId="2" ParentId="9722" CreationDate="2013-12-16T07:50:30.633" Score="1" Body="&lt;p&gt;I think there are 2 approaches being a bit mixed up here.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;You can analyze the option market by looking at implied volatilities and apply Black-Scholes (BS), thus assuming that log-returns follow a Gaussian distribution. Implied volatilies are the parameters that bring together BS and market prices. Then you will observe a pattern of implied volatilies for varying moneyness. This is called the volaility smile (or skew) meaning that implied volatilities not at-the-money are generally higher than at-the-money. Keep in mind that the Gaussian distribution which is assumed in BS is not skewed. Put-Call parity holds if you look at one strike (e.g with a stock price of $100\$$ put call parity holds with a Put with strike $80\$$ (OTM) and a call with strike $80\$$ (ITM)).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;On the other hand you can apply another model to price options. E.g. some skewed distribution in a Lévy model. But these models usually have much more parameters than one  volatility parameter - maybe even a jump measure. What people do is: calibrate a model to the data and then calculated implied volatilies (for BS) that fit these model (!) prices. These (model-) implied volatilies also have a pattern and a model is assumed to be good if it can reproduce the smile observed at the market.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In this answer I try to write down my thoughts about implied volatilities of BS and skewed distributions of alternative models.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2013-12-16T07:50:30.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9738" PostTypeId="2" ParentId="9717" CreationDate="2013-12-16T08:45:20.403" Score="1" Body="&lt;p&gt;Found..  Doesn't contain the aggregations but it's easy to scrape the detailed codes from here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cso.ie/px/u/nacecoder/index.asp&quot; rel=&quot;nofollow&quot;&gt;http://www.cso.ie/px/u/nacecoder/index.asp&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5883" LastActivityDate="2013-12-16T08:45:20.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9739" PostTypeId="2" ParentId="9715" CreationDate="2013-12-16T13:07:44.757" Score="1" Body="&lt;p&gt;Perhaps the information &lt;a href=&quot;http://www.thertrader.com/2013/12/13/financial-data-accessible-from-r-part-iv/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; and in the preceding blog posts might be of help?&lt;/p&gt;&#xA;" OwnerUserId="252" LastActivityDate="2013-12-16T13:07:44.757" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9741" PostTypeId="1" CreationDate="2013-12-16T19:29:59.090" Score="2" ViewCount="870" Body="&lt;p&gt;I'm trying to calculate var for a portfolio of fixed income securities.&#xA;I initially want to just calculate undiversified VaR for each instrument.&#xA;I'm doing the following for each instrument&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Take historical daily log returns on YTM for coupon bond for say 2 years&lt;/li&gt;&#xA;&lt;li&gt;calculate mean and stdev as usual&lt;/li&gt;&#xA;&lt;li&gt;calculate VaR (change in yield) as -2.326*stdev(ln returns of YTM) + mean(ln returns of YTM)&lt;/li&gt;&#xA;&lt;li&gt;this as I understand is the 99% percentile of log returns of YTM which i then multiply with latest YTM to get actual change in yield&lt;/li&gt;&#xA;&lt;li&gt;Use duration formula i.e Change in price = Price * -Mod Duration * latest YTM * VaR (change in Yield)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Can someone please help me understand if this is incorrect? I know there are lot of issues with using YTM and not a cash flow mapping and also not even bootstrapping but is the general principal correct?&lt;/p&gt;&#xA;" OwnerUserId="6772" LastActivityDate="2013-12-16T19:29:59.090" Title="Fixed Income Var calculation" Tags="&lt;var&gt;&lt;calculation&gt;&lt;fixed&gt;&lt;income&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9742" PostTypeId="2" ParentId="9735" CreationDate="2013-12-16T21:10:14.410" Score="3" Body="&lt;p&gt;We have,&lt;br&gt;&#xA;$$ h(x) = x^\beta(x-K)^+ = x^\beta (x - K) \, \mathbf{1}_{[x&amp;gt;K]}$$&#xA;Thus we get,&#xA;$$ h(x) = x^{\beta+1}\mathbf{1}_{[x&amp;gt;K]} - K\,x^{\beta}\mathbf{1}_{[x&amp;gt;K]}$$&#xA;now $x \in [x&amp;gt;K]$ if and only if  $ x \in [x^{\beta}&amp;gt;K^{\beta}]$&#xA;Therefore,&lt;br&gt;&#xA;$$ h(x) = x^{\beta+1}\mathbf{1}_{[x^{\beta + 1}&amp;gt;K^{\beta + 1}]} - K\,x^{\beta}\mathbf{1}_{[x^{\beta}&amp;gt;K^{\beta}]}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus if we let  $\Phi_\text{Asset-or-nothing}^\text{dig}$ the contract function for an asset or nothing binary european call. we can Write:&lt;br&gt;&#xA;$$h(S_t) =\Phi_\text{Asset-or-nothing}^\text{dig}(S_{t}^{\beta + 1},K^{\beta + 1}) - K \,\Phi_\text{Asset-or-nothing}^\text{dig}(S_{t}^{\beta}, K^{\beta}) $$&lt;/p&gt;&#xA;" OwnerUserId="6743" LastEditorUserId="3188" LastEditDate="2013-12-17T21:32:34.750" LastActivityDate="2013-12-17T21:32:34.750" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9745" PostTypeId="1" CreationDate="2013-12-17T13:02:32.600" Score="4" ViewCount="2830" Body="&lt;p&gt;Will highly appreciate if anybody can provide logical financial proof why the Black-Scholes option pricing model overestimates the value for long-term options as described in this &lt;a href=&quot;http://www.hss.caltech.edu/~bcornell/PUBLICATIONS/2009%20Warren%20Buffet%20Black-Scholes%20and%20Long%20Dated%20Options.pdf&quot;&gt;paper &quot;Warren Buffett, Black-Scholes and the Valuation of Long-dated Options&quot; by Bradford Cornell&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1179" LastEditorUserId="848" LastEditDate="2013-12-19T18:49:42.153" LastActivityDate="2015-12-26T21:03:43.720" Title="Drawbacks of Black-Scholes option pricing model" Tags="&lt;options&gt;&lt;black-scholes&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9746" PostTypeId="1" CreationDate="2013-12-17T16:08:12.423" Score="5" ViewCount="2586" Body="&lt;p&gt;I am writing my thesis on VaR and ES risk measurements and have encountered &#xA;some issues with how to best test the accuracy of ES estimates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My understanding of the topic is that backtesting ES adequately is extremely difficult or even&#xA;impossible, as it is not an elicitable risk measure. And I also assume the number&#xA;of approaches in the literature are scarcity because of exactly this property. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However very recently D.Tasche et.al. (&lt;a href=&quot;http://arxiv.org/pdf/1312.1645v2.pdf&quot;&gt;http://arxiv.org/pdf/1312.1645v2.pdf&lt;/a&gt;) uploaded a paper&#xA;where it was argued that ES is not directly elicitable, but indirectly elicitable because it can be approximated&#xA;by several VaR estimates. Thus, they state ES can be backtested reasonably by backtesting&#xA;several VaRs (at different confidence levels) related to the ES estimate. Their specific proposition is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$&#xA;E{S_\gamma }(L) = {1 \over {1 - \gamma }}\int_\gamma ^1 q u(L)du \approx {1 \over 4}\left( {{{\rm{q}}_\gamma }{\rm{(L)  +  }}{{\rm{q}}_{0.75\gamma  + 0.25}}(L) + {{\rm{q}}_{0.5\gamma  + 0.5}}(L) + {{\rm{q}}_{0.25\gamma  + 0.75}}(L)} \right)$&#xA;where L is the loss distribution and gamma the chosen confidence level. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From my simple calculations, proxying financial data with a student-t(6) &#xA;the accumulated VaRs with this approach seems to deviate much from the analytical ES.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder if anyone find the Tasche et.al. approach appealing/adequate for backtesting ES?&#xA;Further I am also interested in knowing what the &quot;state of the art&quot; approach is in the industry (if any&#xA;particular) for backtesting ES. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="6204" LastActivityDate="2015-01-15T19:59:08.177" Title="Expected Shortfall (CVaR) Backtesting" Tags="&lt;backtesting&gt;&lt;var&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9747" PostTypeId="2" ParentId="9745" CreationDate="2013-12-17T16:14:46.027" Score="3" Body="&lt;p&gt;Instead of a logical proof, would you accept a little bit of hand waving?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Think about these two constants in Black-Scholes:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$r$, interest rate&lt;/li&gt;&#xA;&lt;li&gt;$\sigma$, volatility&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Also think about a long-term option, say, one whose expiration date is a year from now. Will $r$ and $\sigma$ be the same over the year? Probably not. And yet a constant interest rate and volatility are two assumptions. &lt;em&gt;That's&lt;/em&gt; the source of the mispricing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;---EDIT---&#xA;Here is a salient portion of Buffet's strawman argument:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Considering everything, I believe the probability of a decline in the&#xA;  index over a one-hundred-year period to be far less than 1%. But&#xA;  let’s use that figure and also assume that the most likely decline –&#xA;  should one occur – is 50%.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Here, I believe, is the assumption that makes Buffet think that B-S pricing would produce &quot;absurd results.&quot; Buffet is attacking &quot;geeks bearing formulas&quot; (which means you, dear reader of this thread). On what basis is he taking issue with Black-Scholes? Cornell explains.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This means that Buffett has two possible beefs [with the lognormal&#xA;  diffusion model from B-S]. First, the equity premium, and therefore,&#xA;  the drift should be larger. Second, something is wrong with the&#xA;  volatility.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Cornell dispenses of the first horn of the dilemma: &quot;The culprit is unlikely to be the drift.&quot; He points his finger at volatility:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The final candidate, other than the arbitrage argument on which the&#xA;  model is based, is the volatility. If Mr. Buffett is criticizing the&#xA;  use of the lognormal diffusion assumption when pricing long-term&#xA;  options, he is not alone. Recall that the lognormal assumption implies&#xA;  that volatility increases linearly with respect to the horizon over&#xA;  which it is measured as shown in equation (1) [lognormal distribution of B-S]. There is empirical&#xA;  evidence which indicates that &lt;em&gt;the linearity assumption fails to hold at long horizons.&lt;/em&gt; For example, Siegel (2008) reports that &lt;em&gt;the variance of real returns on the S&amp;amp;P 500 historically have failed to rise linearly with the horizon. If the long-run volatility is lower, the value of long-term put options will be less.&lt;/em&gt; For instance, a&#xA;  volatility of 15%, instead of 18%, reduces the estimated value of Mr.&#xA;  Buffett’s hypothetical put position to $1.5 million. It also reduces&#xA;  the probability that the index will be lower at expiration than at&#xA;  initiation.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;(emphasis mine)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short, Cornell is citing Siegel to say that the reason Buffet is getting &quot;absurd results&quot; is because his estimation of volatility is too high for the long run. &lt;/p&gt;&#xA;" OwnerUserId="343" LastEditorUserId="343" LastEditDate="2014-08-07T13:34:31.283" LastActivityDate="2014-08-07T13:34:31.283" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9748" PostTypeId="1" CreationDate="2013-12-17T16:18:21.497" Score="1" ViewCount="242" Body="&lt;p&gt;If I use theoretical prices under a normal valuation model, and I estimate their implied volatility using BLACK SCHOLES implied volatility, do I'll get corresponding log normal volatility?&lt;/p&gt;&#xA;" OwnerUserId="6247" LastActivityDate="2013-12-17T16:18:21.497" Title="BS Implied Volatility under Normal returns" Tags="&lt;black-scholes&gt;&lt;implied-volatility&gt;&lt;normal-distribution&gt;&lt;lognormal&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9749" PostTypeId="2" ParentId="716" CreationDate="2013-12-17T20:18:52.030" Score="2" Body="&lt;p&gt;There are several things you need to consider. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You need to use a large leverage to make it work, some brokers reduce the amount they pay in this case.&lt;/li&gt;&#xA;&lt;li&gt;If you use a leverage, there is substantial risk that one side of your trade cannot withstand the fluctuation of the market. So, your balance on one side will turn below required margin at some point and you need to deposit money using the profit you earned from another account. And there is transaction cost which is not a small amount because the cost applies to all of your earned money. Say, you invest 10,000 dollars and use 50:1 leverage, then you lose all your money at one account, you need to withdraw the profit from one broker which is more than 9,000 dollars and move it to the other broker. The cost could be several percent and you need to do it multiple times a year unless you have a low leverage which you would not choose at first place. Or you have a way to eliminate all or most cost associated with transferring funds from one broker to the other (You will also lose some days transferring money). When you do transfer, you need to close both trades and pay spreads. It's a lot of money.&lt;/li&gt;&#xA;&lt;li&gt;The difference is not enough for you to be profitable at all on oanda since Oanda doesn't have a low interest. It is just rolling over time.&lt;/li&gt;&#xA;&lt;li&gt;You might want to try some small brokers that pays much. But usually a higher interest pay is associated with a higher spread. And&#xA;the small brokers you invest is not secure for you money. If you are&#xA;really interested, you can try InstaFX. This is a company with no&#xA;regulation. But it pays well on some currency pairs like GBPAUD. But&#xA;again don't forget about spread and this type of company sometimes&#xA;have commission. (Yes, commission plus spread)&lt;/li&gt;&#xA;&lt;li&gt;Overall, it's probably not a very good idea to do so and not a long-lasting one. If you can make money this easy, OANDA would have lost a lot of money paying interest and changed their interest policy. They can change their interest rate at no time.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="6777" LastEditorUserId="6777" LastEditDate="2014-02-22T09:52:15.370" LastActivityDate="2014-02-22T09:52:15.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9751" PostTypeId="1" CreationDate="2013-12-18T09:31:32.180" Score="4" ViewCount="1567" Body="&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1118460146&quot; rel=&quot;nofollow&quot;&gt;Ernest Chan&lt;/a&gt; in its book &quot;Algorithmic Trading&quot; shows how to use the &lt;a href=&quot;http://www.cs.cmu.edu/~motionplanning/papers/sbp_papers/integrated3/kleeman_kalman_basics.pdf&quot; rel=&quot;nofollow&quot;&gt;Kalman Filter&lt;/a&gt; for mean reversion pair trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have seen that he uses the measurement prediction error for calculating the spread size. &#xA;In other works, he bases the spread calculation on:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;e = y_{t} - \hat{y} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where, $ \hat{y} $ is the measurement prediction based on the state variable predictor $ \hat{x}(k+1|k)$ where $k$ is the time/measurement. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering what the advantage of using the measurement prediction error instead of the residuals is. With residuals I mean $y - y_c$ where $y_c$ is the estimate of the measurement based on the updated/corrected state variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="6781" LastActivityDate="2013-12-18T09:31:32.180" Title="mean reversion with Kalman Filter - Spread calculation" Tags="&lt;spread&gt;&lt;kalman&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9752" PostTypeId="1" CreationDate="2013-12-18T12:35:55.547" Score="3" ViewCount="2143" Body="&lt;p&gt;I have buy and sell signals,and accordingly, I artificially generate a signal series,for which,I assign 1 to every buy and -1 to every sell:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(xts)&#xA;require(TTR)&#xA;close_series=rnorm(20,100,10)&#xA;date=seq(as.Date(&quot;2000/1/1&quot;), as.Date(&quot;2000/1/20&quot;), &quot;days&quot;)&#xA;close_xts=xts(close_series,date)&#xA;&#xA;x.points.buy=c(1,5,9,17)&#xA;x.points.sell=c(3,6,12,20)&#xA;buy.points=index(close_xts[x.points.buy])&#xA;sell.points=index(close_xts[x.points.sell])&#xA;&#xA;signal&amp;lt;- xts(rep(NA,length(close_xts)),index(close_xts)) &#xA;signal[buy.points]&amp;lt;-1&#xA;signal[sell.points]&amp;lt;--1&#xA;signal&amp;lt;-na.locf(signal)&#xA;returns &amp;lt;- ROC(close_xts,type=&quot;discrete&quot;)*signal&#xA;returns[is.na(returns)]&amp;lt;- 0&#xA;eq &amp;lt;- exp(cumsum(returns))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is giving me returns that seem to be too good to be true,I am not able to understand the fundamental methodology on the basis of which these cumulative returns show such huge figures.Can anyone please help me to understand this?&lt;/p&gt;&#xA;" OwnerUserId="6784" LastEditorUserId="6784" LastEditDate="2013-12-19T04:06:25.583" LastActivityDate="2014-08-04T12:22:19.150" Title="Calculating and interpreting cumulative returns is R" Tags="&lt;r&gt;&lt;returns&gt;" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9753" PostTypeId="1" CreationDate="2013-12-18T17:28:50.910" Score="3" ViewCount="723" Body="&lt;p&gt;Suppose that I want to calculate what the margin requirements should be for a Bitcoin futures contract, where the contract is the USD/BTC exchange rate (settled in Bitcoins).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've looked at the &lt;a href=&quot;https://www.theice.com/publicdocs/clear_us/SPAN_Explanation.pdf&quot; rel=&quot;nofollow&quot;&gt;SPAN method&lt;/a&gt; and a &lt;a href=&quot;http://longin.fr/Recherche_Publications/Articles_pdf/Longin_Optimal_margin_level_in_futures_markets.pdf&quot; rel=&quot;nofollow&quot;&gt;paper on calculating margin&lt;/a&gt;. The SPAN model seems kinda complicated and I can't really wrap my head around it and I'm not sure if the model described in the paper is actually used in a real exchange.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure how much of a stretch this would be, but could somebody demonstrate how the margin calculation would work for a Bitcoin futures contract? Or at least provide a some guidance on how to calculate the margin requirements.&lt;/p&gt;&#xA;" OwnerUserId="78" LastEditorUserId="20795" LastEditDate="2018-02-22T20:43:47.723" LastActivityDate="2018-02-22T20:43:47.723" Title="How can I calculate the margin requirements for a Bitcoin futures contract?" Tags="&lt;futures&gt;&lt;bitcoin&gt;&lt;margin&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9754" PostTypeId="2" ParentId="9753" CreationDate="2013-12-18T18:45:47.597" Score="1" Body="&lt;p&gt;The reason the SPAN method looks complicated is that it is used for calculating the margin requirements for portfolios of options and futures, and therefore has to deal with changing volatilies as well as spot prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you just want to calculate the margin requirement for futures, in principle it is much simpler, as you just need to worry about moves in the underlying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, it is difficult to come up with a sensible margin requirement for bitcoin, as the price fluctuations are so dramatic (and the typical size of fluctuations is probably time-varying to boot).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would probably make an attempt as follows -&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Measure the daily volatility $\sigma$ of Bitcoin (I have no idea what this is, but given that Bitcoin can easily gain or lose 50% in a single day, I expect that it is quite high). For example, an annualized volatility of 200% would give an approximate daily volatility of 12.5%.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Choose a multiple of the daily volatility to be your margin requirement. Maybe you should choose $4\sigma$, to take into account the extremely heavy tails, which would suggest a margin requirement of 50% of the portfolio value (almost not worth trading Bitcoin futures at all, in that case...)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="924" LastActivityDate="2013-12-18T18:45:47.597" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9755" PostTypeId="1" CreationDate="2013-12-18T21:05:11.540" Score="1" ViewCount="502" Body="&lt;p&gt;The solution to the SDE &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dx_t= -kx_t dt + cx_t dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$x_t = x_0 e^{\left(c - \frac{k^2}{2} \right)t}e^{-k W_t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with mean &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E} \left[ x_t \right] = x_0 e^{\left(c - \frac{k^2}{2}\right)t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W_)$ is the Wiener process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking to compute&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb{E} \left[ (W_s + W_t - 2W_0)^2 \right]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but am unsure of how to proceed.&lt;/p&gt;&#xA;" OwnerUserId="6788" LastEditorUserId="467" LastEditDate="2014-07-20T21:04:37.410" LastActivityDate="2014-07-20T21:06:27.357" Title="How to compute $\mathbb{E} \left[ (W_s + W_t - 2W_0)^2 \right]$?" Tags="&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9756" PostTypeId="2" ParentId="4593" CreationDate="2013-12-19T03:17:34.027" Score="2" Body="&lt;p&gt;Since the variance gamma process can actually be expressed as the difference of two gamma processes, the parameters are quite easy to estimate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking the mean (rate) and variance (rate) of the positive values and negatives will give you the variables necessary to estimate the total variance gamma process parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They are described in &lt;a href=&quot;http://bfi.cl/papers/Madan%20Carr%20Chang%201998%20-%20Variance%20Gamma%20process%20and%20option%20pricing.pdf&quot; rel=&quot;nofollow&quot;&gt;a more recent paper on the subject&lt;/a&gt; as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\mu^2_p}{\nu_p}=\frac{\mu^2_n}{\nu_n}=\frac{1}{\nu},$$&#xA;$$\frac{\nu_p\nu_n}{\mu_p\mu_n}=\frac{\sigma^2\nu}{2},$$&#xA;$$\frac{\nu_p}{\mu_p}-\frac{\nu_n}{\mu_n}=\theta\nu$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Shortcut &amp;amp; special cases&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\theta$ is the expected value of all samples.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $\nu=0$ then $\sigma$ is the variance of all samples.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $\theta=\sigma=1$ then the skewness of all samples is equal to $2\nu^2+3\nu$. &lt;/p&gt;&#xA;" OwnerDisplayName="user6500" LastEditorDisplayName="user6500" LastEditDate="2014-01-03T03:17:52.173" LastActivityDate="2014-01-03T03:17:52.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9757" PostTypeId="2" ParentId="9755" CreationDate="2013-12-19T09:09:11.610" Score="8" Body="&lt;p&gt;I would calculate it this way, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb{E}[(W_s+W_t−2W_0)^2] = \mathbb{E}\left[\left((W_s-W_0)+(W_t-W_0)\right)^2\right]\\ &#xA;\hspace{4cm}=\mathbb{E}[(W_s-W_0)^2]+\mathbb{E}[(W_t-W_0)^2]+2\mathbb{E}[(W_s-W_0)(W_t-W_0)] \\&#xA;\hspace{4cm}=s+t+2\mathbb{E}[W_sW_t]\\&#xA;\hspace{4cm}=s+t+2\min(s,t)$&lt;/p&gt;&#xA;" OwnerUserId="6189" LastEditorUserId="467" LastEditDate="2014-07-20T21:06:27.357" LastActivityDate="2014-07-20T21:06:27.357" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="9758" PostTypeId="1" CreationDate="2013-12-19T13:26:27.363" Score="1" ViewCount="646" Body="&lt;p&gt;The cash-or-nothing call option has a payoff that is equal to the strike price. All three options have the same expiry date.&lt;/p&gt;&#xA;" OwnerUserId="6792" LastActivityDate="2013-12-30T09:14:48.540" Title="How is holding an European call option equivalent to holding an asset-or-nothing call option and writing a cash-or-nothing call option?" Tags="&lt;options&gt;&lt;call&gt;&lt;cash-or-nothing&gt;&lt;payoff&gt;" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9759" PostTypeId="2" ParentId="9752" CreationDate="2013-12-19T14:58:37.350" Score="1" Body="&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/1yyM2.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the equity line i got after i repeated your code. how is this good ? may be you have run with only one set of numbers. any ways here are a few things you can do to come closer to reality :&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;take the close prices as lognormal distribution instead of a normal distribution.&lt;/li&gt;&#xA;&lt;li&gt;you are adding up the returns later on. this is only right if you have logarithmic differences instead of simple differences.&lt;/li&gt;&#xA;&lt;li&gt;run the same simulation with a lot of samples to get a distribution and then decide if it is good or bad.&lt;/li&gt;&#xA;&lt;li&gt;the fluctuations you will see in the equity line is because you have provided a huge value for the standard deviation.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="6289" LastActivityDate="2013-12-19T14:58:37.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9760" PostTypeId="1" CreationDate="2013-12-19T17:30:03.197" Score="3" ViewCount="740" Body="&lt;p&gt;I have a question in determining the risk-free rate of Ecuador. For developed countries like United States and Great Britain, the risk-free rate can be obtained in financial database such as Reuter or Bloomberg by directly obtaining the government bond/bills yields or swap rate curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, for developing countries such as Ecuador, I cannot obtain the risk-free rate based on Reuter or Bloomberg. As a result, how is its risk-free rate determined?&lt;/p&gt;&#xA;" OwnerUserId="6119" LastActivityDate="2016-12-22T11:43:53.810" Title="How to determine risk-free rate of Ecuador?" Tags="&lt;bond&gt;&lt;risk-free&gt;" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9762" PostTypeId="2" ParentId="9755" CreationDate="2013-12-19T23:02:56.003" Score="-1" Body="&lt;p&gt;Your solution $x_t$ is wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your mean is wrong too.  Note that $\mathbb{E}\left[ e^{W_t}\right] = e^\frac{t}{2}$.  I corrected the typo that was pointed out by Richard.&lt;/p&gt;&#xA;" OwnerUserId="3188" LastEditorUserId="3188" LastEditDate="2014-07-19T16:01:58.717" LastActivityDate="2014-07-19T16:01:58.717" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9763" PostTypeId="2" ParentId="9758" CreationDate="2013-12-20T00:31:49.407" Score="1" Body="&lt;p&gt;The payoff of an European call option is $(S_T-K)^+$. At maturity, if the spot price is greater than (or equal to) the strike price, then holding an asset-or-nothing call option has payoff $S_T$, writing a cash-or-noting call option $K$, which together give the payoff of the European call in this scenario. If the spot price is less than the strike, then all the three assets have 0 payoff. These suffice to show that the two are equivalent.&lt;/p&gt;&#xA;" OwnerUserId="6765" LastActivityDate="2013-12-20T00:31:49.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9764" PostTypeId="2" ParentId="942" CreationDate="2013-12-20T05:52:20.557" Score="2" Body="&lt;p&gt;Yahoo data is good enough, but it has its quirks. As people have mentioned, sometimes it does miss out on corporate actions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I remember a while back I was looking at price for Ford (F) around 1999 , and computing my own adjusted close using yahoo's methodology and noticed that yahoo was missing a dividend payment in 1999(which I verified from bloomberg). Interestingly enough, yahoo had incoporated that missing data point in their adjusted price calculation.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Point being, its not perfect but its good enough ( in 99% of the cases). It might be a good idea to purchase EOD data  so you can atleast get them to fix any issues with it.   &lt;/p&gt;&#xA;" OwnerUserId="1696" LastActivityDate="2013-12-20T05:52:20.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9767" PostTypeId="1" CreationDate="2013-12-22T01:28:29.813" Score="3" ViewCount="2099" Body="&lt;p&gt;Singer-Terhaar is part of CFA II and III curriculum. It estimates risk premium for some asset, traded at some local market, as weighted average of expected premiums for the case of &#xA;(1) local market, completely integrated with global, and &#xA;(2) local market completely isolated from global. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For integrated case, risk premium (RP) for asset i&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;RP_i = \rho_{i,M} \times \sigma_i \times (RP_M/\sigma_M) &#xA;$$&#xA;,i.e. correlation of asset with global investable market times deviation times GIM's Sharpe ratio. For isolated case CFA recommends just dropping rho term from the formula above. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Weighting parameter (&quot;integration&quot;) is then used to multiply to integrated estimate, and to sum with (1-weighting_parameter) times isolated estimate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is: how to estimate integration? &lt;/p&gt;&#xA;" OwnerUserId="6535" LastActivityDate="2015-04-30T21:23:30.013" Title="How to estimate market integration parameter in Singer-Terhaar model for E(r)?" Tags="&lt;equities&gt;&lt;returns&gt;&lt;capm&gt;&lt;expected-return&gt;&lt;asset-pricing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9768" PostTypeId="1" AcceptedAnswerId="9769" CreationDate="2013-12-22T02:26:23.540" Score="3" ViewCount="155" Body="&lt;p&gt;The two equations commonly found online for GBM are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\begin{matrix} S_{ t }=S_{ 0 }\exp\left( \left( \mu -\frac { \sigma ^{ 2 } }{ 2 }  \right) t+\sigma W_{ t } \right)  \\ S_{ t }=S_{ 0 }\exp\left(\mu t+\sigma W_{ t } \right)  \end{matrix}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found the first one on &lt;a href=&quot;http://en.wikipedia.org/wiki/Geometric_brownian_motion&quot; rel=&quot;nofollow&quot;&gt;Wikipedia&lt;/a&gt;, and the second one in &lt;a href=&quot;http://www.columbia.edu/~ks20/4703-Sigman/4703-07-Notes-BM-GBM-I.pdf&quot; rel=&quot;nofollow&quot;&gt;a Columbia university PDF about simulation of GBMs, Page 4&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1231" LastEditorUserId="70" LastEditDate="2013-12-23T10:35:58.723" LastActivityDate="2013-12-23T12:37:38.307" Title="What is the difference between these two equations for GBMs?" Tags="&lt;brownian-motion&gt;&lt;random-walk&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9769" PostTypeId="2" ParentId="9768" CreationDate="2013-12-22T03:09:03.580" Score="2" Body="&lt;p&gt;The first the solution to:&#xA;$$dS_t = S_t\left[\mu dt +\sigma dW_t\right]$$&#xA;The second is the solution to:&#xA;$$ dS_t = S_t\left[\left(\mu -\frac{\sigma^2}{2}\right)dt + \sigma dW_t\right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The difference is that the first one is a martingale when $\mu$ is equal to zero while the second one is not:&#xA;$$ \mathbb{E}[S_0 exp(\sigma W_t)]= S_0exp(-\frac{\sigma^2}{2}t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The one usually used in a financial engineering context is the first one.&lt;/p&gt;&#xA;" OwnerUserId="6743" LastEditorUserId="6189" LastEditDate="2013-12-23T12:37:38.307" LastActivityDate="2013-12-23T12:37:38.307" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9772" PostTypeId="1" CreationDate="2013-12-22T13:02:27.460" Score="5" ViewCount="6888" Body="&lt;p&gt;So, I am working on a strategy that has pin-pointed some very interesting events in the form of extremely low volatility. The phenomena spans the past few years and a wide variety of symbols. Now, to research this further I want to investigate correlation with other external (or internal) events such as released company news, quickly spreading rumors, or even insider trading and other &quot;public&quot; factors that usually have great price impact.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;On my wish-list is a site or database where I can input a symbol and date and it spits out news, press releases and other relevant &quot;events&quot; around that time. Does anyone know of such service or has used such in the past?&lt;/strong&gt; I have tried the most obvious; Google and Yahoo Finance but they seem to not have that many events at all, especially going back a few years...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="6717" LastActivityDate="2018-03-16T13:52:07.503" Title="Where to find historical stock news and other events?" Tags="&lt;equities&gt;&lt;data&gt;&lt;market-data&gt;&lt;historical-data&gt;&lt;news&gt;" AnswerCount="5" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9773" PostTypeId="1" CreationDate="2013-12-22T14:51:38.740" Score="2" ViewCount="1582" Body="&lt;p&gt;I want to implement my models in R and trade according to them with my IB account. Now I am wondering, how I should solve this problem? Do I need to program with C an access (&lt;a href=&quot;https://www.interactivebrokers.com/en/?f=%2Fen%2Fsoftware%2Fibapi.php&quot; rel=&quot;nofollow&quot;&gt;https://www.interactivebrokers.com/en/?f=%2Fen%2Fsoftware%2Fibapi.php&lt;/a&gt;) or is there a solution, where I only need R and IB? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do profeesional people solve this issue? And what about the IBrokers package in R, is it still valid? It seems to me a bit outdated, is there a better package? Thanks for sharing your wisdom in advance!&lt;/p&gt;&#xA;" OwnerUserId="5395" LastActivityDate="2020-04-15T08:09:14.123" Title="IB with R which package?" Tags="&lt;programming&gt;&lt;r&gt;&lt;trading&gt;&lt;interactive-brokers&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9774" PostTypeId="1" CreationDate="2013-12-22T15:21:17.433" Score="2" ViewCount="180" Body="&lt;p&gt;My question is from Nicholson-Snyder's text , E-book &lt;a href=&quot;https://www.google.co.in/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;ved=0CCwQFjAA&amp;amp;url=http%3A%2F%2Fwww-bcf.usc.edu%2F~ebayrak%2Fteaching%2F500F12%2FXYZ.pdf&amp;amp;ei=qQK3Uq_WIMumrQfUgoH4AQ&amp;amp;usg=AFQjCNES-AhfZS7ktOPZ1tSLvjC4PxqHhw&amp;amp;sig2=FkPz3kF5gQjDDMcYDeTApQ&amp;amp;bvm=bv.58187178,d.bmk&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is &lt;a href=&quot;https://i.stack.imgur.com/WJmyi.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;, from page 217 of the book. (I can't post image as my reputation is not enough.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How did we get $W_g=W_b$ from $\dfrac{U'(W_g)}{U'(W_b)}=1$ ?&lt;/p&gt;&#xA;" OwnerUserId="6814" LastActivityDate="2014-01-22T10:15:27.640" Title="How did we get $W_g=W_b$ from $\dfrac{U'(W_g)}{U'(W_b)}=1$?" Tags="&lt;risk&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9775" PostTypeId="1" CreationDate="2013-12-22T17:03:34.613" Score="6" ViewCount="3367" Body="&lt;p&gt;I am analyzing the volatility of financial stock returns and let's say I have a pretty good model to forecast tomorrows volatility of the stock returns. So let's say for simplicity reasons I have a GARCH(1,1). With this model I forecasted the volatility tomorrow and I now want to trade on it. The volatility tells me how much the stock returns and therefore the stock itself will &quot;change&quot;/fluctuate. If I have the volatility and if I am pretty sure about the probability of my correctness, how should I trade this? Should I e.g. invest in a straddle? And if yes, how should I determine the optimal options/ options conditions I should use?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: So my basic question is: I have the value for the volatility forecast and I know that there are certain option-combinations to trade on high and low volatility, but how can I connect these strategies to my forecasted value, to my real value I calculated?&lt;/p&gt;&#xA;" OwnerUserId="5395" LastEditorUserId="5395" LastEditDate="2013-12-22T17:32:38.117" LastActivityDate="2015-09-27T09:15:39.903" Title="How to trade volatility?" Tags="&lt;volatility&gt;&lt;quant-trading-strategies&gt;&lt;trading&gt;&lt;garch&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9776" PostTypeId="2" ParentId="9768" CreationDate="2013-12-22T21:51:55.527" Score="0" Body="&lt;p&gt;The standard form of a geometric Brownian motion is $dS_t = S_t(\mu dt+\sigma dB_t)$, where B is a BM and $\mu$ and $\sigma$ are two real numbers. When you write this process in closed form: it is $S_t = S_0 exp(\mu t + \sigma B_t - \sigma ^2 t/2)$. The process $(S_t e^{-\mu t}, t\geq 0)$ is a martingale.&lt;/p&gt;&#xA;" OwnerUserId="6765" LastActivityDate="2013-12-22T21:51:55.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9777" PostTypeId="2" ParentId="2567" CreationDate="2013-12-23T01:15:32.637" Score="1" Body="&lt;p&gt;Suppose the logarithm of the price follows a standard Brownian bridge from $O$ to $C$ hitting high (maximum) of $H$ and low (minimum) of $L$ on the way. The paths can be constructed with the application of the reflection principle. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take first the simpler task of constructing Brownian paths with OHC property. We start with a Brownian bridge connecting the opening price $O$ at opening time $t=0$ with price $2H-C$ at closing time $t=1$. Amongst the paths constructed, delete the ones cross below $H$ from above after having crossed above $H$ from below for the first time. For each of the remaining path, reflect the part beyond the stopping time of first crossing $H$ around $H$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The original task can be accomplished by repeatedly and carefully applying the exact same principle of reflection. The algorithm is a bit more complicated though. We divide all the path into disjoint subsets be sequence of hitting time of $H$ and $L$ between the opening point $O$ (let's set the price of $O$ at $0$ and starts at time $0$ and ends at time $1$) and closing point $C$. In the following description of the algorithm, I am going to sacrifice rigour for sake of descriptive simplicity --- until someone asks questions and ask me to filling th details. A path possessing the required property will start from $0$ and alternatingly hit $H$ and $L$ then end at $C$. Let $h_k$ be the stopping time of the path hitting price $H$ for the $k$'th time after the path hits $L$. So between $O$ and $C$, the set of hitting time sequences in order of occurrence is $\{(h_1,l_1),(h_1,l_1,h_2),(h_1,l_1,h_2,l_2),...\}$ union with $\{(l_1,h_1),(l_1,h_1,l_2),(l_1,h_1,l_2,h_2),...\}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The paths generating each hitting time sequence correspond to a subset of Brownian bridges emanating from $0$ and ending at different price points $p$ at time $t=1$ with density proportional to $e^{-p^2}$. Let $k$ run through all natural numbers. For $(l_1,h_1,...,l_k,h_k)$, the Brownian bridge ends at $p=C-2k(H-L)$; for sequence $(l_1,h_1,...,l_k)$ it ends at $p=-C-2k(H-L)+2H$; for $(h_1,l_1,h_2,l_2,...,h_k,l_k)$, it ends at $p=C+2k(H-L)$; for $(h_1,l_1,h_2,l_2,...,h_k)$, it ends at $p=-C+2(k-1)(H-L)+2H$. Amongst all the Brownian bridge paths thus constructed any path hitting any price line in the set $B=\{H+i(H-L): i\in \mathbf Z\}$ for consecutively the second time is eliminated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now fold or reflect all thus constructed along the price lines of $\{H+i(H-L): i\in \mathbf Z\}$. The paths thus formed are those required.&lt;/p&gt;&#xA;" OwnerUserId="6686" LastEditorUserId="6686" LastEditDate="2013-12-25T16:03:31.167" LastActivityDate="2013-12-25T16:03:31.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9778" PostTypeId="2" ParentId="9774" CreationDate="2013-12-23T02:08:52.523" Score="1" Body="&lt;p&gt;$U$ is usually strictly concave. So $U'$ is strictly decreasing and is therefore injective.&lt;/p&gt;&#xA;" OwnerUserId="6686" LastActivityDate="2013-12-23T02:08:52.523" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9780" PostTypeId="2" ParentId="942" CreationDate="2013-12-23T13:27:15.837" Score="5" Body="&lt;p&gt;There is a &lt;strong&gt;major bug&lt;/strong&gt; when you are getting information from exchanges &lt;strong&gt;outside USA&lt;/strong&gt;. If you get the adjusted prices for BOVESPA (Brazilian Stock Exchange) for example, it will only consider the events that happened using the US Calendar and not the Brazilian calendar of working days, this leads to a lack of information on other exchanges.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Be aware of this if you are retrieving information for other exchanges.&lt;/p&gt;&#xA;" OwnerUserId="6822" LastActivityDate="2013-12-23T13:27:15.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9781" PostTypeId="2" ParentId="9775" CreationDate="2013-12-23T13:42:49.283" Score="2" Body="&lt;p&gt;Since you are talking about using volatility of stocks you could just use the straddle strategy both on long or short.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will answer only with theory about trading strategies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are 100% certain (we know this is not possible, but let´s take this as an assumption just for the sake of theory matter) of the volatily you can go two ways:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;High Volatility:&lt;/strong&gt;&#xA;You will be long on a straddle, this means you would buy a call and a put option with similar prices to take advantage of any direction&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Low Volatility:&lt;/strong&gt;&#xA;You can be short on a straddle, this means you would sell both call an put option with really similar prices and earn the premium of the options.&lt;/p&gt;&#xA;" OwnerUserId="6822" LastEditorUserId="13496" LastEditDate="2015-09-27T09:15:39.903" LastActivityDate="2015-09-27T09:15:39.903" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9782" PostTypeId="1" CreationDate="2013-12-23T20:53:37.863" Score="1" ViewCount="274" Body="&lt;p&gt;I would like to do a linear regression of daily stock price returns, vs the price as a percentage of the 52 week high.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i.e. [next week return] = A * [Price / 52 Week High ] + B&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where A and B are constants.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[Price / 52 Week High] will not be normally distributed, so the previous regression will not be very valid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I normalise it to make it more valid?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a better way for me to see how [Price / 52 Week High] affects the future return?&lt;/p&gt;&#xA;" OwnerUserId="6392" LastActivityDate="2013-12-23T20:53:37.863" Title="How To Regress Returns Vs Price as Pct of 52 week high?" Tags="&lt;regression&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9783" PostTypeId="2" ParentId="9775" CreationDate="2013-12-24T02:43:28.897" Score="2" Body="&lt;p&gt;One thing that is missing from this discussion - only buy the straddle if your forecast for future realized volatility is higher than the implied volatility for which the straddles are currently selling. Nonetheless, having a one-day-ahead forecast isn't much good without knowing at least the expected path of implied volatility priced into options, for the implied volatility is not a constant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When buying or selling your straddle, you'll want to make sure that it is delta-neutral. That is how you pick the strike, or time the purchases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for what other instruments work better, there are broker-quoted &quot;variance swaps&quot;, which are linear derivatives on the future realized variance.  It might also be worthwhile to look into listed ETPs on various volatility indexes like the VIX, or VIX futures themselves if you are comfortable with them. There are numerous subtleties to VIX index pricing, and all the related indices.&lt;/p&gt;&#xA;" OwnerUserId="3491" LastActivityDate="2013-12-24T02:43:28.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9784" PostTypeId="1" CreationDate="2013-12-24T10:05:24.350" Score="1" ViewCount="242" Body="&lt;p&gt;I'm trying Sierra Chart for trading Bitcoin.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to display relative spread for a given volume.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;spread_rel = 200.0 * (ask - bid) / (bid + ask)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;where bid is bid price for a volume V&lt;/li&gt;&#xA;&lt;li&gt;and ask is ask price for a volume V&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Ideally I would like to display it numerically and also to plot it&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ever saw Analysis / Studies / &quot;Time and Sales Bid&amp;amp;Ask&quot; but I think it's only for highest bid and lowest ask.&#xA;Moreover it's an absolute difference... not a relative difference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I first need to calculate bid and ask price for a given V volume using orderbook depth).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also want to draw text on a chart.&#xA;and also plot this &lt;code&gt;spread_rel&lt;/code&gt; value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;it will help me a lot to understand how SC works.&lt;/p&gt;&#xA;" OwnerUserId="6235" LastActivityDate="2013-12-24T10:05:24.350" Title="Calculate display and plot relative spread using Sierra Chart" Tags="&lt;programming&gt;&lt;c&gt;&lt;sierrachart&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9785" PostTypeId="1" CreationDate="2013-12-24T12:58:52.823" Score="2" ViewCount="233" Body="&lt;p&gt;I'm working with the nataf transformation - AkA Gaussian copula - and trying to establish the range of joint bivariate pdf's it can approximate, and what limitations it puts on those joint pdf's. I've scoured the net and library’s but am unable to find such information. Does anyone know? Or know of a research that looks specifically at this? &lt;/p&gt;&#xA;" OwnerUserId="6826" LastActivityDate="2013-12-28T21:37:25.267" Title="What are the general limitations of Gaussian copulas with regards to the range of joint pdf's it can approximate?" Tags="&lt;copula&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9786" PostTypeId="5" CreationDate="2013-12-24T13:21:10.927" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2013-12-24T13:21:10.927" LastActivityDate="2013-12-24T13:21:10.927" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9787" PostTypeId="4" CreationDate="2013-12-24T13:21:10.927" Score="0" Body="Sierra Chart is a proprietary computer program used for charting and technical analysis of financial markets." OwnerUserId="6235" LastEditorUserId="6235" LastEditDate="2013-12-24T15:38:51.123" LastActivityDate="2013-12-24T15:38:51.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9791" PostTypeId="1" CreationDate="2013-12-26T08:58:17.067" Score="7" ViewCount="877" Body="&lt;p&gt;I have m assets, and have estimated their future returns and covariance matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to invest in an evenly weighted n product basket from this universe, where 0&amp;lt;n&amp;lt;m.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do i find the basket with the highest sharpe, without having to calculate the sharpe for every possible portfolio?&lt;/p&gt;&#xA;" OwnerUserId="6392" LastEditorUserId="6392" LastEditDate="2013-12-26T15:52:49.053" LastActivityDate="2014-01-02T03:56:25.740" Title="how to choose top n assets?" Tags="&lt;sharpe-ratio&gt;&lt;tactical-asset-allocation&gt;&lt;portfolio-optimization&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9792" PostTypeId="1" CreationDate="2013-12-26T09:52:38.310" Score="1" ViewCount="43" Body="&lt;p&gt;Recently I created a simulation of a GBM. The time between the prices were sampled from an exponential distribution. The log rate of return was sampled from&#xA;$\sigma \sqrt { { t }_{ i }-{ t }_{ i-1 } } { Z }_{ i }+(\mu -\frac { { \sigma  }^{ 2 } }{ 2 } )({ t }_{ i }-{ t }_{ i-1 })$ where ${ Z }_{ i }\sim N(0,1)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I estimated the drift of prices from the simulation without using the time between the prices, I was able to get back the drift I programmed into the simulation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I concluded that the time between prices doesn't affect the estimation of parameters of a GBM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this conclusion correct?&lt;/p&gt;&#xA;" OwnerUserId="1231" LastActivityDate="2013-12-26T09:52:38.310" Title="Does the time between prices created from a GBM affect the estimation of parameters of the GBM?" Tags="&lt;random-walk&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9794" PostTypeId="2" ParentId="9791" CreationDate="2013-12-26T18:48:19.607" Score="9" Body="&lt;p&gt;If $Q$ is your covariance matrix, and $r$ is a vector of your expected returns, then the maximum Sharpe ratio is given by the following math program.&#xA;$${\rm maximize} \frac{r^t x}{\sqrt{0.5 x^t Q x}}$$&#xA;subject to &#xA;$$ 1^t x = m$$&#xA;$$ x \in \{0,1\}^n$$&#xA;Where $x$ is a vector of indicators of which of the $n$ assets are part of the $m$ selected assets.  While the objective is not convex, its solution lies of the efficient frontier of $$\rm{maximize}\ r^t x, -0.5 x^t Q x.$$&#xA;You can compute the efficient frontier of the return/variance by solving the following mixed-integer convex-quadratic program for multiple values of $r^*$.&#xA;$$ {\rm minimize} \frac{1}{2} x^t Q x - \epsilon r^t x$$&#xA;subject to &#xA;$$ r^t x \ge r^*$$&#xA;$$ 1^t x = m$$&#xA;$$ x \in \{0,1\}^n$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $r$ is a vector of expected returns, and $r^*$ is a target expected return.  The optimal value for any any value of $r^*$ that is feasible will yield a point on the efficient frontier.  The portfolio with the best Sharpe ratio will be on the efficient frontier, so by iteratively solving the above problem for multiple values of $r^*$, you can find the value of $r^*$ that yields the best Sharpe ratio.  The highest feasible value for $r^*$ can be computed by taking the top $m$ expected returns.&lt;/p&gt;&#xA;" OwnerUserId="1418" LastEditorUserId="1418" LastEditDate="2014-01-02T03:56:25.740" LastActivityDate="2014-01-02T03:56:25.740" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9797" PostTypeId="1" AcceptedAnswerId="9803" CreationDate="2013-12-26T23:18:36.697" Score="1" ViewCount="154" Body="&lt;p&gt;I've got an interest rate swap, it has a right-to-break with a bermudan exercise schedule. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For each exercise, the settlement date is specified as an already-adjusted business day. The &quot;last notification date&quot; (i.e. expiry) for each exercise is specified as 5 business days prior to the settlement date, using the business day convention 'NONE' and the holiday cities given.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the correct way to determine the adjusted notification date in this case? Note that this contract is specified in FpML, if that makes any difference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The FpML looks as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;bermudaExerciseDates&amp;gt;&#xA;  &amp;lt;relativeDates&amp;gt;&#xA;   &amp;lt;periodMultiplier&amp;gt;-5&amp;lt;/periodMultiplier&amp;gt;&#xA;   &amp;lt;period&amp;gt;D&amp;lt;/period&amp;gt;&#xA;   &amp;lt;dayType&amp;gt;Business&amp;lt;/dayType&amp;gt;&#xA;   &amp;lt;businessDayConvention&amp;gt;NONE&amp;lt;/businessDayConvention&amp;gt;&#xA;   &amp;lt;businessCenters&amp;gt;&#xA;     &amp;lt;businessCenter&amp;gt;GBLO&amp;lt;/businessCenter&amp;gt;&#xA;     &amp;lt;businessCenter&amp;gt;USNY&amp;lt;/businessCenter&amp;gt;&#xA;     &amp;lt;businessCenter&amp;gt;AUSY&amp;lt;/businessCenter&amp;gt;&#xA;   &amp;lt;/businessCenters&amp;gt;&#xA;   &amp;lt;dateRelativeTo href=&quot;cashSettlementPaymentDate&quot; /&amp;gt;&#xA;  &amp;lt;/relativeDates&amp;gt;&#xA;&amp;lt;/bermudaExerciseDates&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6416" LastEditorUserId="6416" LastEditDate="2013-12-26T23:37:14.127" LastActivityDate="2014-01-26T21:43:55.393" Title="ISDA: Interpreting a date specified as x business days prior to another date with a business day convention of 'NONE'" Tags="&lt;convention&gt;&lt;date&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9798" PostTypeId="1" CreationDate="2013-12-27T00:26:53.353" Score="25" ViewCount="47281" Body="&lt;p&gt;There's the standard S&amp;amp;P 500 index (SPX) and the rarer used S&amp;amp;P 500 Total Return index (SPTR). If you compare graphs, you'll find that the latter grows faster. Supposedly, SPTR assumes reinvestment of dividends while SPX doesn't. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What does SPX assume you do with your dividends? Put them under the pillow interest-free, or invest them at the risk-free rate? Even SPX must somehow account for dividends, or else each time a company issues a dividend (which is of course accompanied by a drop in stock price), the index would drop.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume (but do not know) that ETFs or index funds that claim to track S&amp;amp;P 500 would reinvest dividends, and so I'd expect that their prices would follow SPTR instead of SPX. However, from looking at graphs, the opposite seems to be the case. Obviously I'm missing something.&lt;/p&gt;&#xA;" OwnerUserId="6841" LastActivityDate="2020-03-20T14:08:14.720" Title="Difference between S&amp;P 500 index and S&amp;P 500 Total Return index?" Tags="&lt;index&gt;&lt;etf&gt;&lt;dividends&gt;&lt;mutual-fund&gt;" AnswerCount="5" CommentCount="2" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9800" PostTypeId="2" ParentId="2753" CreationDate="2013-12-27T14:14:48.697" Score="3" Body="&lt;p&gt;Both models are based on a spread, which has to be as stationary / mean reverting as possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ y_t = \beta_0 + \beta_1 x_t + \epsilon_t $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In pairs trading, $y_t$ and $x_t$ are log prices, and (e.g.) the Johansen cointegration test is used to identify candidates for a pairs trade. For entry and exit points an error correction model is used. In the Avellaneda &amp;amp; Lee (AL) paper the $y_t$ and $x_t$ are indeed the returns. Mean reversion is modeled as an Ornstein-Uhlenbeck process on the cumulated residuals&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ X_k = \sum_{t=1}^k \epsilon_t,\ \  k = 1,2,...,T$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which are stationary (mean zero) by construction. Since the residuals are cumulated or 'integrated' they are stable and may display mean reversion, much like in traditional pairs trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see two important differences: the AL method is (as the title says) a statistical arbitrage approach where $x_t$ are risk factors or baskets of securities, such as the PCA and ETF examples in the paper: it is not limited to pairs. Also, in AL there is no explicit test of the cointegration strength, as the mean reversion is built into the model.&lt;/p&gt;&#xA;" OwnerUserId="6721" LastActivityDate="2013-12-27T14:14:48.697" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9802" PostTypeId="2" ParentId="9453" CreationDate="2013-12-27T19:59:21.250" Score="2" Body="&lt;p&gt;My guess would be most people approach this using rolling regressions.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My approach would be to generate a matrix using all the lookbacks that you want to predict the present on each row and a corresponding squared return, then subsample the two.  &lt;/p&gt;&#xA;" OwnerUserId="1368" LastActivityDate="2013-12-27T19:59:21.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9803" PostTypeId="2" ParentId="9797" CreationDate="2013-12-27T21:09:10.610" Score="1" Body="&lt;p&gt;Business day convention NONE means no adjustment when a day is not a business day, so I would assume the adjusted notification date to be five days prior to the adjusted settlement date regardless of holidays or weekends. Not sure how that would work out in practice though.&lt;/p&gt;&#xA;" OwnerUserId="993" LastActivityDate="2013-12-27T21:09:10.610" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9805" PostTypeId="1" AcceptedAnswerId="9807" CreationDate="2013-12-28T04:37:44.923" Score="1" ViewCount="671" Body="&lt;p&gt;I am trying to develop a trading model. It uses certain technical and fundamental features and the model learns from the past. I have a 3-class output - bullish, neutral and bearish.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On trying neural networks, I got a train accuracy of around 85%, cross validation accuracy of 75% and test accuracy of 75% with both CV set and test set carved out from the complete set. I am doing it on matlab 2010 using nprtool. The software does the carve-outs of the CV set and test set (20% each and the rest of 60% is used for training).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After training I use the same model to test on a different data. Here the accuracy drops to around 34% (which I would assume is just random classification with 3 classes). The new data I test with is very similar to the data used to train. I also tried swapping the data sets, but the results are same. I used the command below to test with the model (the same was used to test the accuracy of the train data too with Xtest replaced with Xtrain). Here net denotes the trained model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;output = sim(net, Xtest');&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For NN I used 100,000 samples, 250 input features and 100 nodes in the hidden layer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried a similar thing using libsvm (called from matlab). Here too I face the same. During training, the parameters are optimized through cross validation and the CV accuracy comes up to 73%. However when tested on new data the accuracy drops to around 35%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For SVM I trained with 20,000 samples and 250 features. I use the command below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;[outputTest, accuracyTest, prob] = svmpredict(Ytest,Xtest,model);&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please help if someone has come across a similar issue and has a remedy.&lt;/p&gt;&#xA;" OwnerUserId="5473" LastActivityDate="2013-12-28T21:21:48.897" Title="Machine Learning on matlab 2010" Tags="&lt;backtesting&gt;&lt;trading&gt;&lt;machine-learning&gt;&lt;neural-networks&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9806" PostTypeId="2" ParentId="9805" CreationDate="2013-12-28T13:44:41.167" Score="0" Body="&lt;p&gt;There can be several reasons for this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The &lt;code&gt;&quot;new data&quot;&lt;/code&gt; that you use post-training &amp;amp; post-validation is &lt;code&gt;not drawn&lt;/code&gt; from the same distribution as the one that you used to create/draw your training, testing and validation data.&lt;/li&gt;&#xA;&lt;li&gt;Since you have not mentioned anything related to the input features in your data-set, I am assuming that the &lt;code&gt;stock/option/derivative/instrument price&lt;/code&gt; is one of them. I also assume that you know that the price movement is &lt;code&gt;stochastic&lt;/code&gt; in nature (or at least the current accepted model is that price movements exhibit a stochastic random-walk behavior). You need to account for this. You can take a look at any standard textbook on quantitative finance (e.g. Wilmott).&lt;/li&gt;&#xA;&lt;li&gt;You might be &lt;code&gt;overfitting the model&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;The &lt;code&gt;curse of dimensionality&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Your data is not &lt;code&gt;normalized/preprocessed&lt;/code&gt; in the right way. Again, I can't say more as I don't know how your data looks like.&lt;/li&gt;&#xA;&lt;li&gt;In principle, it is a very HARD problem. If it was easy, well, all of us'd be retired. I mean there is &lt;code&gt;no free-lunch&lt;/code&gt;. :)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="6847" LastEditorUserId="6847" LastEditDate="2013-12-28T14:00:48.027" LastActivityDate="2013-12-28T14:00:48.027" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9807" PostTypeId="2" ParentId="9805" CreationDate="2013-12-28T21:21:48.897" Score="0" Body="&lt;p&gt;Firstly, look at Jurik Research WAV and DDR modules to see one particular approach for time series data compression and decorrelation prior to input into ANNs.  From recent research, it also seems like better results have been obtained using wavelets on lagged (2,5,10 bar) data along with indicators and summary statistics such as skewness, kurtosis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have too many inputs, and if there is any correlation between them, you will be defeating the purpose of ANNs.  A basic rule of ANNs is that they will waste time learning the correlation between input features, so if it is removed and orthogonal inputs (zero correlation) are used, the results may be better.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Last, intermarket analyses has also produced better results than staying within assets.  That is, start looking at other indices (lagged and unlagged) as inputs.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't fret over poor results -- I have obtained similar results using normalized data, 4 wavelets representing highs and four wavelets representing lows (and a variety of lags) for a 2-class problem (tomorrow is a gain(y&gt;0) or loss(y&amp;lt;0)) with very poor results. &lt;/p&gt;&#xA;" OwnerDisplayName="user6430" LastActivityDate="2013-12-28T21:21:48.897" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9808" PostTypeId="2" ParentId="9785" CreationDate="2013-12-28T21:37:25.267" Score="1" Body="&lt;p&gt;The joint pdfs can exhibit whatever the characteristics are of the two random variables.  This includes location (mean), spread(sigma), skewness, kurtosis, other moments, etc.  As was pointed out above however, you need to ensure that normal is the best fitting distribution for your data.  Copulas are used for simulation, which requires knowing the appropriate distribution of the data you are trying to simulate.   &lt;/p&gt;&#xA;" OwnerDisplayName="user6430" LastActivityDate="2013-12-28T21:37:25.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9809" PostTypeId="1" CreationDate="2013-12-28T22:03:46.513" Score="1" ViewCount="203" Body="&lt;p&gt;For my thesis I am evaluating two mutual fund portfolios in order to check for differences in manager performance. My hypothesis is that there will be no differences in performance (in terms of alpha) between the two portfolios. Unfortunately even though one group seems to outperform the other all alphas are statistically insignificant. Do I reject the hypothesis (because one outperforms the other) or accept the hypothesis (because none of the alphas are signficant)? Thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="6848" LastActivityDate="2013-12-29T21:57:01.007" Title="Compare fund managers with insignificant alphas?" Tags="&lt;capm&gt;&lt;statistical-significance&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9811" PostTypeId="1" CreationDate="2013-12-29T00:20:25.137" Score="1" ViewCount="69" Body="&lt;p&gt;In this article on the Multilevel Monte Carlo method on page 8, &lt;a href=&quot;http://people.maths.ox.ac.uk/gilesm/files/mcqmc06.pdf&quot; rel=&quot;nofollow&quot;&gt;http://people.maths.ox.ac.uk/gilesm/files/mcqmc06.pdf&lt;/a&gt;, Giles uses a correction term to improve the weak convergence rate of the lookback option payoff&#xA;$$P = e^{-rT}(S_T - \min_{0\leq t\leq T} S_t)$$&#xA;when using the approximation&#xA;$$\hat{S}_{\min} = \min_{0\leq n \leq N}(\hat{S}_n-\beta^{*}b(nh,\hat{S}_n)\sqrt{h})$$&#xA;where $\hat{S}_n$ are the grid values of a discretized diffusion process $S_t$ defined via $dS_t = a(t,S_t)dt+b(t,S_t)$ using the step size $h$ and with $\beta^{*}\approx0.58$. This correction term was introduced by Broadie, Glasserman and Kou, and extended by Gobet in &lt;a href=&quot;http://hal.archives-ouvertes.fr/docs/00/39/64/22/PDF/BoundaryCorrectionGobetMenozziSPAJune09.pdf&quot; rel=&quot;nofollow&quot;&gt;http://hal.archives-ouvertes.fr/docs/00/39/64/22/PDF/BoundaryCorrectionGobetMenozziSPAJune09.pdf&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As proven in Gobet's article and noted in the article by Giles, the correction term improves the discretization error to $o(\sqrt{h})$ from the original order $O(\sqrt{h})$. Giles subsequently concludes that this restores overall $O(h)$ weak convergence from the original weak convergence order $O(\sqrt{h})$. I do not understand how a discretization error of $o(\sqrt{h})$ is sufficient to achieve the overall convergence order. How can removing the leading error term in the discretization improve the result to such a degree?&lt;/p&gt;&#xA;" OwnerUserId="5656" LastEditorUserId="5656" LastEditDate="2013-12-29T07:58:02.470" LastActivityDate="2013-12-29T07:58:02.470" Title="Weak convergence of Lookback payoff with correction term" Tags="&lt;stochastic-processes&gt;&lt;monte-carlo&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9812" PostTypeId="2" ParentId="9775" CreationDate="2013-12-29T04:29:57.200" Score="0" Body="&lt;p&gt;Don't forget about liquidity holes and transaction costs. You can use more complicated structures, to trade volatility; however, they all come with their own issues. You do need to focus on all the costs and calculate your edge against your forecast and both the entry and exit for the straddles plus possible other risk factors. Focus on ATM straddles to begin with.&lt;/p&gt;&#xA;" OwnerUserId="6849" LastEditorUserId="6849" LastEditDate="2013-12-29T05:29:39.923" LastActivityDate="2013-12-29T05:29:39.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9813" PostTypeId="1" AcceptedAnswerId="9821" CreationDate="2013-12-29T15:59:05.293" Score="2" ViewCount="1162" Body="&lt;p&gt;I wrote a simulation of a geometric Brownian motion which works like this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;${ t }_{ i }-{ t }_{ i-1 } \sim Exp(\lambda )$&lt;/li&gt;&#xA;&lt;li&gt;${ Z }_{ i }\sim N(0,1)$&lt;/li&gt;&#xA;&lt;li&gt;${ Y }_{ i }\sim { e }^{ \sigma \sqrt { { t }_{ i }-{ t }_{ i-1 } } { Z }_{ i }+\left( \mu -\frac { { \sigma  }^{ 2 } }{ 2 }  \right) \left( { t }_{ i }-{ t }_{ i-1 } \right)  }$&lt;/li&gt;&#xA;&lt;li&gt;$S({ t }_{ 1 })=S({ t }_{ 0 })\times { Y }_{ 1 }$&lt;/li&gt;&#xA;&lt;li&gt;$S({ t }_{ 2 })=S({ t }_{ 1 })\times { Y }_{ 2 }=S({ t }_{ 0 })\times { Y }_{ 1 }\times { Y }_{ 2 }$&lt;/li&gt;&#xA;&lt;li&gt;$S({ t }_{ k })=S({ t }_{ k-1 })\times { Y }_{ k }=S({ t }_{ 0 })\times { Y }_{ 1 }\times { Y }_{ 2 }\times\dots \times{ Y }_{ k }$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In order to verify that my code is correct, I tried to estimate the parameters of my simulation from samples taken from it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My parameter estimation strategy was like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I knew $\mathrm{E}[{ t }_{ i }-{ t }_{ i-1 }] = \frac{1}{\lambda}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $\ln { \frac { S({ t }_{ i+1 }) }{ S({ t }_{ i }) } \sim N(\tilde { \mu  } ,\tilde { \sigma  } ) } $, I just used the parameter estimation techniques for normal distributions to estimate $\tilde { \mu  }$ and $\tilde { \sigma  }$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $\tilde { \sigma  } = \sigma \sqrt{ { t }_{ i }-{ t }_{ i-1 }}$, I reasoned that $\sigma = \frac { \tilde { \sigma  } }{ \sqrt{ \mathrm{E}[{ t }_{ i }-{ t }_{ i-1 }]} } $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $\tilde { \mu  } = \left( \mu -\frac { { \sigma  }^{ 2 } }{ 2 }  \right) \left( { t }_{ i }-{ t }_{ i-1 } \right)  $, I reasoned that $\mu = \frac { \tilde { \mu  } }{ \mathrm{E}[{ t }_{ i }-{ t }_{ i-1 }] } + \frac { { \sigma  }^{ 2 } }{ 2 }$ where I used the $\sigma$ estimated from above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is my logic correct? I did not use any formal reasoning, so I am not confident my method for estimating parameters is correct. Can someone help me?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is not homework. I am just trying to write program which behaves like the financial markets.&lt;/p&gt;&#xA;" OwnerUserId="1231" LastActivityDate="2013-12-30T08:34:25.643" Title="Are my estimates of parameters of geometric brownian motion correct?" Tags="&lt;statistics&gt;&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9815" PostTypeId="1" CreationDate="2013-12-29T17:48:17.270" Score="2" ViewCount="135" Body="&lt;p&gt;I am attempting to determine the hypothetical market value of a stock for a company emerging from bankruptcy as of a date &lt;em&gt;prior&lt;/em&gt; to actual the issuance of the stock. For example, let's say the formerly bankruptcy company issues new equity on February 1, 2013. I would like to value that equity as of January 1, 2013.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=110388&quot; rel=&quot;nofollow&quot;&gt;This article&lt;/a&gt; performs a similar study, and valued the equity like this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We discount the firm's market value of equity to the PV date, using a discount rate based on the capital asset pricing model (CAPM) and levered equity beta . . . . This value is added to the value of the reorganized company's debt to calculate the market value.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Is this the best approach? And if not, what alternative approach would be better?&lt;/p&gt;&#xA;" OwnerUserId="6851" LastEditorUserId="6851" LastEditDate="2013-12-29T18:29:37.680" LastActivityDate="2013-12-29T18:29:37.680" Title="Best method for determining the market value of a stock before it is issued" Tags="&lt;beta&gt;&lt;capm&gt;&lt;valuation&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9816" PostTypeId="1" CreationDate="2013-12-29T18:34:44.003" Score="2" ViewCount="1479" Body="&lt;p&gt;I am currently working through questions in Bjork's Arbitrage Theory in Continuous Time. However, I am unable to solve the following question, 7.2 in the book. A solution would be greatly appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the Black Scholes model. A company has produced the derivative the Golden Logarithm, henceforth abbreviated as the GL. The holder of the GL with maturity time T, denoted as GL(T), will, at time T, obtain the sum lnS(T). Note that if S(T)&amp;lt;1 this means that the holder has to pay a positive amount to the company. Determine the arbitrage free price process for the GL(T)&lt;/p&gt;&#xA;" OwnerUserId="6852" LastActivityDate="2019-09-11T12:15:02.813" Title="Arbirtage free price process question in Bjork's Arbitrage Theory in Continuous Time" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;arbitrage&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9817" PostTypeId="2" ParentId="9809" CreationDate="2013-12-29T20:04:56.227" Score="1" Body="&lt;p&gt;Given that you're correctly measuring Alpha, the difference lies in the Beta exposures of the two managers.  You may not be capturing certain tilts, which would show up in your error or incorrectly categorized as Beta.  Consider the simple case where you have returns grouped into just technology vs. Energy for instance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$R_p$ = $B_0$ + $B_t$$R_m$  + $B_e$$R_m$+ $e$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there isn't a distinction for cap size, you could have large cap energy firms significantly outperform small cap energy, but wouldn't know it from the regression. Make sure you're correctly benchmarking returns before concluding insignificant alpha.&lt;/p&gt;&#xA;" OwnerUserId="2732" LastEditorUserId="2732" LastEditDate="2013-12-29T21:57:01.007" LastActivityDate="2013-12-29T21:57:01.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9818" PostTypeId="1" CreationDate="2013-12-30T00:00:13.567" Score="1" ViewCount="901" Body="&lt;p&gt;I am unsuccessfully trying to find the Implied Volatilities for the SPX on a given date using information of the CBOE, as well as Open Interest, but as I run the code I am getting and error message that I cannot resolve.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; ## library(RQuantLib)&#xA;&amp;gt; library(RQuantLib)&#xA;Loading required package: Rcpp&#xA;&amp;gt; ## library(Rcpp)&#xA;&amp;gt; library(Rcpp)&#xA;&amp;gt; ## Black-Scholes Function&#xA;&amp;gt; BS &amp;lt;-&#xA;+ function(S, K, T, r, sig, type=&quot;C&quot;){&#xA;+    d1 &amp;lt;- (log(S/K) + (r + sig^2/2)*T) / (sig*sqrt(T))&#xA;+    d2 &amp;lt;- d1 - sig*sqrt(T)&#xA;+    if(type==&quot;C&quot;){&#xA;+      value &amp;lt;- S*pnorm(d1) - K*exp(-r*T)*pnorm(d2)&#xA;+    }&#xA;+    if(type==&quot;P&quot;){&#xA;+      value &amp;lt;- K*exp(-r*T)*pnorm(-d2) - S*pnorm(-d1)&#xA;+    }&#xA;+    return(value)&#xA;+  }&#xA;&amp;gt; ## Function to find BS Implied Vol using Bisection Method&#xA;&amp;gt; implied.vol &amp;lt;-&#xA;+  function(S, K, T, r, market, type){&#xA;+    sig &amp;lt;- 0.20&#xA;+    sig.up &amp;lt;- 1&#xA;+    sig.down &amp;lt;- 0.001&#xA;+    count &amp;lt;- 0&#xA;+    err &amp;lt;- BS(S, K, T, r, sig, type) - market   &#xA;+    ## repeat until error is sufficiently small or counter hits 1000&#xA;+    while(abs(err) &amp;gt; 0.00001 &amp;amp;&amp;amp; count&amp;lt;1000){&#xA;+      if(err &amp;lt; 0){&#xA;+        sig.down &amp;lt;- sig&#xA;+        sig &amp;lt;- (sig.up + sig)/2&#xA;+      }else{&#xA;+        sig.up &amp;lt;- sig&#xA;+        sig &amp;lt;- (sig.down + sig)/2&#xA;+      }&#xA;+      err &amp;lt;- BS(S, K, T, r, sig, type) - market&#xA;+      count &amp;lt;- count + 1&#xA;+    }  &#xA;+    ## return NA if counter hit 1000&#xA;+    if(count==1000){&#xA;+      return(NA)&#xA;+    }else{&#xA;+      return(sig)&#xA;+    }&#xA;+  }&#xA;&amp;gt; ## read in data&#xA;&amp;gt; dat &amp;lt;- read.csv('C:/Users/Edgar Martinez/Downloads/SPX_data.csv')&#xA;&amp;gt; ## read in data&#xA;&amp;gt; dat &amp;lt;- read.csv('C:/Users/Edgar Martinez/Downloads/SPX_data.csv')&#xA;&amp;gt; ## calculate implied vol for Call&#xA;&amp;gt;  S &amp;lt;- 1841.36&#xA;&amp;gt;  T &amp;lt;- 20/365&#xA;&amp;gt;  r &amp;lt;- 0.01  &#xA;&amp;gt;  n &amp;lt;- dim(dat)[1]&#xA;&amp;gt;  c.vol.Ask &amp;lt;- rep(0,n)&#xA;&amp;gt;  c.vol.Bid &amp;lt;- rep(0,n)&#xA;&amp;gt;  p.vol.Ask &amp;lt;- rep(0,n)&#xA;&amp;gt; p.vol.Bid &amp;lt;- rep(0,n)&#xA;&amp;gt; for(i in 1:n){&#xA;+    c.vol.Ask[i] &amp;lt;- implied.vol(S, dat$K[i], T, r, dat$C.Ask[i], &quot;C&quot;)&#xA;+    c.vol.Bid[i] &amp;lt;- implied.vol(S, dat$K[i], T, r, dat$C.Bid[i], &quot;C&quot;)&#xA;+    p.vol.Ask[i] &amp;lt;- implied.vol(S, dat$K[i], T, r, dat$P.Ask[i], &quot;P&quot;)&#xA;+    p.vol.Bid[i] &amp;lt;- implied.vol(S, dat$K[i], T, r, dat$P.Bid[i], &quot;P&quot;)&#xA;+  }&#xA;&#xA;**Error in while (abs(err) &amp;gt; 1e-05 &amp;amp;&amp;amp; count &amp;lt; 1000) { : &#xA;  missing value where TRUE/FALSE needed**&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6854" LastEditorUserId="56" LastEditDate="2013-12-30T14:58:15.797" LastActivityDate="2013-12-30T15:38:19.083" Title="Error message in calculation Implied Volatility" Tags="&lt;volatility&gt;&lt;black-scholes&gt;" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9819" PostTypeId="2" ParentId="9818" CreationDate="2013-12-30T07:47:47.170" Score="1" Body="&lt;p&gt;In a while loop, the condition expression is evaluated and, if TRUE, the block is executed. The error tells you that the condition in the loop did not evaluate to TRUE or FALSE, but to NA. So check how you define/compute 'count' and 'err'.&lt;/p&gt;&#xA;" OwnerUserId="6857" LastEditorUserId="6857" LastEditDate="2013-12-30T08:09:28.950" LastActivityDate="2013-12-30T08:09:28.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9820" PostTypeId="2" ParentId="9818" CreationDate="2013-12-30T08:18:37.030" Score="0" Body="&lt;p&gt;I see two ways:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Could you use &lt;code&gt; EuropeanOptionImpliedVolatility&#xA;&lt;/code&gt; which is contained in RQuantLib ?&lt;/li&gt;&#xA;&lt;li&gt;use the &lt;code&gt;print &lt;/code&gt; command and look at the values for count and err in each iteration. For a simple example look at this&#xA;&lt;code&gt;&#xA;c = 1;&#xA;print(paste(&quot;Hallo:&quot;,c));&#xA;&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2013-12-30T08:18:37.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9821" PostTypeId="2" ParentId="9813" CreationDate="2013-12-30T08:34:25.643" Score="1" Body="&lt;p&gt;First to point this out. You do not simulate standard geometric Brownian motion but time-changed GBM where the distribution of time is an exponential distribution with parameter $\lambda$ independent of the GBM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the technique of time change one usually assumes that the expected time is unbiased. &#xA;If you write each time interval as&#xA;$$&#xA; (t_i - t_{i-1}) \Lambda_i&#xA;$$&#xA;with $\Lambda_i \sim Exp(\lambda)$ one usually assumes that $E[ (t_i - t_{i-1}) \Lambda_i] = t_i - t_{i-1}$, and thus in short that $E[\Lambda_i ] = 1$. This can only be achieved if you use $\Lambda_i \sim Gamma(1/\lambda,1/\lambda)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You end up with a &lt;a href=&quot;http://en.wikipedia.org/wiki/Variance_gamma_process&quot; rel=&quot;nofollow&quot;&gt;Variance-Gamma process&lt;/a&gt; for the Brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You were on the right track. Define $X_i = \ln(S_{t_i}/S_{t_{i-1}}))$.&#xA;This process is a variance-gamma process with drift. You find ways to calibrate this process on the mentioned wikipedia page. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the additional parameter $\lambda$ it does not suffice to look at expected value and variance only. You need one higher moment - usually kurtosis.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2013-12-30T08:34:25.643" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9822" PostTypeId="2" ParentId="9791" CreationDate="2013-12-30T08:35:25.410" Score="3" Body="&lt;p&gt;For such a problem (&quot;selecting n out of m&quot;) you can use optimisation heuristics.  These algorithms work well even for large n and m, and they are flexible: you may as well select a portfolio that minimises some other function, for instance, the portfolio's drawdown.  The downside is that you may have to do some programming yourself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example very similar to your problem is described in &quot;Heuristic&#xA;Methods in Finance&quot; ( &lt;a href=&quot;http://ssrn.com/abstract=1794290&quot; rel=&quot;nofollow&quot;&gt;http://ssrn.com/abstract=1794290&lt;/a&gt; ) The R code for&#xA;the example is here&#xA;&lt;a href=&quot;http://cran.r-project.org/web/packages/NMOF/vignettes/LSselect.pdf&quot; rel=&quot;nofollow&quot;&gt;http://cran.r-project.org/web/packages/NMOF/vignettes/LSselect.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6857" LastActivityDate="2013-12-30T08:35:25.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9823" PostTypeId="2" ParentId="9724" CreationDate="2013-12-30T08:44:11.263" Score="2" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;first - a nice and short note for the calculation can be found &lt;a href=&quot;http://financelab.nctu.edu.tw/Students/chiu/geometric.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;second: what do they mean by cheaper? The pay-off is different - so what can we compare. The only meaning is that if the stock has an implied volatility of $\sigma$ then the continuously sampled Asian option has an implied vol of $\sigma/3$ (check your $d_1$ there is something wrong in the numerator). So we can say that given the same moneyness the Asian option looks like a standard European option but with a third of its implied vol. Thus the Asian is cheaper.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Another reference &lt;a href=&quot;http://www.cb.cityu.edu.hk/mwg-internal/de5fs23hu73ds/progress?id=gzyuLZQcC5&quot; rel=&quot;nofollow&quot;&gt;Theory of Continuously-sampled Asian Option pricing&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2013-12-30T08:52:18.890" LastActivityDate="2013-12-30T08:52:18.890" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9824" PostTypeId="2" ParentId="9758" CreationDate="2013-12-30T09:14:48.540" Score="3" Body="&lt;p&gt;Formally, a long call payoff can be split as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$(S_T-K)^+ = (S_T-K)\cdot 1_{\{S_T&amp;gt;K\}} $$&#xA;$$= S_T\cdot 1_{\{S_T&amp;gt;K\}} - K\cdot 1_{\{S_T&amp;gt;K\}},$$&#xA;that is, long an asset-or-nothing digital call payoff and short a cash-or-nothing digital call payoff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, $1_A$ is $1$ if event $A$ takes place, and it is $0$ otherwise.&lt;/p&gt;&#xA;" OwnerUserId="6858" LastActivityDate="2013-12-30T09:14:48.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9825" PostTypeId="1" AcceptedAnswerId="9842" CreationDate="2013-12-30T11:40:20.613" Score="6" ViewCount="651" Body="&lt;p&gt;I have a friend in the industry who said they are interested in the model I gave in the title. Whether they use it, idk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS_t= S_t(rdt+ \sigma_t dW_t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And $\sigma_t$ is the exponential of an OU process. The brownian motions are negatively correlated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this thing have name? Is it widely used? What is it called?&lt;/p&gt;&#xA;" OwnerUserId="3334" LastEditorUserId="3334" LastEditDate="2013-12-30T12:43:20.660" LastActivityDate="2014-11-10T22:01:05.793" Title="Stochastic volatility model with exponential OU volatility" Tags="&lt;stochastic-volatility&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9826" PostTypeId="2" ParentId="9825" CreationDate="2013-12-30T12:11:35.360" Score="4" Body="&lt;p&gt;The model is similar to the Barndorﬀ-Nielsen - Shephard model. But this model is much more general.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand in this paper by &lt;a href=&quot;http://www.javaquant.net/papers/Heston-original.pdf&quot; rel=&quot;nofollow&quot;&gt;Heston&lt;/a&gt; it is exactly your form that is used. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Already Scott in 1987 considered a model of your form (see &lt;a href=&quot;https://ideals.illinois.edu/bitstream/handle/2142/29058/optionpricingwhe1249scot.pdf?sequence=1&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally in &lt;a href=&quot;http://cnwewel.files.wordpress.com/2010/01/diplomathesis.pdf&quot; rel=&quot;nofollow&quot;&gt;this thesis&lt;/a&gt; you find the names Hull-White model (of course there is the interest rate model too) and Heston model for this kind of model (sometimes only in the case that the variance is modelled as square-root process, sometimes in OU-case too).&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2013-12-30T12:11:35.360" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9827" PostTypeId="1" AcceptedAnswerId="9829" CreationDate="2013-12-30T12:14:01.563" Score="8" ViewCount="666" Body="&lt;p&gt;Although this is probably a basic question, this is probably also the right forum to post it in :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought I understood beta, but know I am really confused...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The beta between my portfolio (weekly returns) and the benchmark (ACWI in Danish Kroner) is 0,48. So historically my portfolio has had half the volatility of the benchmark. Great.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I turn the calculation around and look at the benchmark relative to my portfolio (I hope it makes sense) I get a beta of 0,74. So the benchmark has now been less volatile, than my portfolio. I can this be? I would expect the beta of the benchmark relative to my portfolio to be greater than 1...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a link to the data (weekly) if needed:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.market-trends.net/?attachment_id=4060&quot;&gt;http://www.market-trends.net/?attachment_id=4060&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kind regards&lt;/p&gt;&#xA;&#xA;&lt;p&gt;René&lt;/p&gt;&#xA;" OwnerUserId="6859" LastActivityDate="2014-06-29T21:37:02.813" Title="How to interpret beta meaningfully?" Tags="&lt;portfolio&gt;&lt;beta&gt;&lt;benchmark&gt;&lt;calculation&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9828" PostTypeId="2" ParentId="9818" CreationDate="2013-12-30T15:05:05.573" Score="0" Body="&lt;p&gt;If &lt;code&gt;sig==0&lt;/code&gt;, then &lt;code&gt;BS&lt;/code&gt; returns &lt;code&gt;NaN&lt;/code&gt; because of dividing by zero on this line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;d1 &amp;lt;- (log(S/K) + (r + sig^2/2)*T) / (sig*sqrt(T))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That then causes &lt;code&gt;err&lt;/code&gt; to be &lt;code&gt;NaN&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="56" LastActivityDate="2013-12-30T15:05:05.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9829" PostTypeId="2" ParentId="9827" CreationDate="2013-12-30T15:26:52.473" Score="4" Body="&lt;p&gt;I did not look at the data, but recall that beta is a parameter in the following equation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;r_A = \alpha + \beta r_B + \epsilon&#xA;$$&#xA;relating two returns (random variables, samples) $r_A$ and $r_B$. To calculate beta you peform&#xA;$$&#xA;\beta = \frac{cov(r_A,r_B)}{var(r_B)}.&#xA;$$&#xA;Thus if assets $A$ and $B$ exchange roles, then only the denominator changes. In your example the variance of your benchmark is smaller than the variance of your portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Futhermore note that the $\epsilon$ above models all volatility/risk that remains and that is not explained by $r_B$. If $r_B$ and $r_A$ are not too much related then the beta does not tell you too much about risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the CAPM beta plays a more prominent role. But this is a slightly different story.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2013-12-30T15:26:52.473" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9830" PostTypeId="2" ParentId="9818" CreationDate="2013-12-30T15:38:19.083" Score="1" Body="&lt;p&gt;Try to put some parenthesis to your condition, i experienced many issues liked to this in the past.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+    while( (abs(err) &amp;gt; 0.00001) &amp;amp;&amp;amp; (count &amp;lt; 1000) ){&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6189" LastActivityDate="2013-12-30T15:38:19.083" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9831" PostTypeId="1" AcceptedAnswerId="9834" CreationDate="2013-12-30T16:54:33.430" Score="-1" ViewCount="1612" Body="&lt;p&gt;I have the &lt;code&gt;Total Return Index(RI)&lt;/code&gt; for several companies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that I can calculate the log retunrs with $ln(RI_t/RI_{t-1})$. Therefore my first guess would be to calculate the total returns like that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$RI_t/RI_{t-1}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this true?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I appreciate your answer!&lt;/p&gt;&#xA;" OwnerUserId="5414" LastActivityDate="2013-12-30T19:51:50.080" Title="Calculate the total returns from the total return index" Tags="&lt;time-series&gt;&lt;equities&gt;&lt;statistics&gt;&lt;return&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2014-01-02T14:45:43.527" ContentLicense="CC BY-SA 3.0" />
  <row Id="9832" PostTypeId="2" ParentId="9733" CreationDate="2013-12-30T18:21:40.793" Score="5" Body="&lt;p&gt;When I run this simulation I see the same results, and it makes sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the straight 50%/50%, I found that my win ration was about 38% and my loss ratio 61%.  The reason it wasn't 50/50 was that if I had consecutive up flips my value could keep going up, but if I had consecutive down flips I would 0 out and the sequence would have to end as I had lost all my money...  With it being random the chance of zeroing out isn't that unlikely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I increased the number of flips from 10 to 100 my win ratio dropped to 9% and my loss ratio is about 90%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I tried using your alternative method of modifying the %'s based on the previous result, the results were even worse.  At 10 flips only 7 out of 10000 had made any money, at 100 flips 0 survived...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Slight Correction&lt;/strong&gt;&#xA;It's not that you are zeroing out, it's that if you subtract 25% and then add 25% you don't end up with the same number.  So if you have 3 consecutive subtractions followed by three consecutive additions starting from 100 you end up with ~82.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I change the code to use absolute values for +/- rather then percents I get a 30% win and 60% loss.  When I remove the stop at 0 so that it can go negative it comes out to 50/50.  This is regardless of whether or not I use a fixed amount on win/lose, or if I used the alternate x/y strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Interesting side note&lt;/strong&gt;&lt;br&gt;&#xA;I'm not sure what your game is actually going to be, but perhaps this page on Random Walks might be of interest: &lt;a href=&quot;http://en.wikipedia.org/wiki/Random_walk&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Random_walk&lt;/a&gt;.  They have a nice graphs on the right hand side showing multiple series starting at 0 and moving in a random up/down pattern.&lt;/p&gt;&#xA;" OwnerUserId="6860" LastEditorUserId="6860" LastEditDate="2013-12-30T22:10:43.107" LastActivityDate="2013-12-30T22:10:43.107" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9834" PostTypeId="2" ParentId="9831" CreationDate="2013-12-30T19:51:50.080" Score="3" Body="&lt;p&gt;No, it would be $$(RI_{t}-RI_{t-1})/RI_{t-1}$$&lt;/p&gt;&#xA;" OwnerUserId="5872" LastActivityDate="2013-12-30T19:51:50.080" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9836" PostTypeId="1" CreationDate="2013-12-31T00:59:03.503" Score="3" ViewCount="141" Body="&lt;p&gt;As title, If there is no delisting constraint, then I can treat the redemption right as the put right on the convertible bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there is redemption right on delisting, what is the conventional method to value the redemption right on delisting of underlying shares held by the holder in the convertible bonds? How is the delisting catered in the valuation? Is there any reference to discuss the valuation of convertible bonds with such redmeption right? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="6119" LastActivityDate="2013-12-31T00:59:03.503" Title="How is the redemption right on delisting of underlying shares held by holder in the convertible bond valued?" Tags="&lt;valuation&gt;&lt;convertible-bond&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9837" PostTypeId="2" ParentId="26" CreationDate="2013-12-31T02:17:10.380" Score="4" Body="&lt;p&gt;Where you have a strong view on &lt;em&gt;lots&lt;/em&gt; of points in your Black-implied volatility surface, both in time and strike, then some of the popular stochastic volatility models introduce &lt;em&gt;calibration error&lt;/em&gt;, so you might want to stick the honest local volatility model (non-parametric, calibrate-able to whatever you know about the Black-implied vol surface). If you still want to directly manipulate the shape of the &lt;em&gt;forward skew&lt;/em&gt; (that is, the prices of forward starting options), or keep other good parts of stochastic volatility mentioned in answers above, then you need to look up &lt;em&gt;stochastic local volatility&lt;/em&gt; models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="6858" LastActivityDate="2013-12-31T02:17:10.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9838" PostTypeId="2" ParentId="9816" CreationDate="2013-12-31T04:15:08.627" Score="1" Body="&lt;p&gt;In general, the arbitrage-free price process $V_t$ at time $0 \le t \le T$ for a European claim $X =f(S_T)$ under the B-S model (which it looks like you have) is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V_t(X) = B_t\mathbb{E}_\mathbb{Q}[B_T^{-1}X | \mathcal{F}_t],$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $B_t$ is the bond price process, $\mathbb{Q}$ is the measure making the discounted B-S stock price process a $\mathbb{Q}$-martingale, and $\mathcal{F}_t$ is the sigma field for the Brownian Motion.  This might be the &quot;process&quot; the question asks for, but you would need to evaluate this expectation at each $t$ to actually use it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example of computing the initial value using an arbitrary payoff at maturity, $X = f(S_T)$, so all you'll have to do is replace the $f$ with your logarithm payoff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume you're familiar with the B-S stock price process under the risk-neutral Brownian motion, $S_t = S_0\exp(\sigma \widetilde{W}_t + (r - \frac{1}{2}\sigma^2)t)$, where $\widetilde{W}_t$ is a $\mathcal{N}(0, t)$-distributed random variable for fixed $t$ under the $\mathbb{Q}$ measure, $r$ is the risk-free rate and $\sigma$, the volatility.  Note the argument of the exponential function is a $\mathcal{N}((r - \frac{1}{2}\sigma^2)t, \sigma^2 t)$-distributed random variable for fixed $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Define the random variable $Y$ ~ $\mathcal{N}(-\frac{1}{2}\sigma^2 T, \sigma^2 T)$.  Then $S_T = S_0\exp(Y + rT)$, and letting $p(Y)$ denote the pdf of $Y$, from the formula for $V_t$ we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V_0 = \mathbb{E}_\mathbb{Q}[\mathrm{e}^{-rT}f(S_0\exp(Y + rT))] \\ = \mathrm{e}^{-rT} \int_{-\infty}^\infty f(S_0\exp(y + rT))p(y)\mathrm{d}y \\ = \mathrm{e}^{-rT} \int_{-\infty}^\infty f(S_0\exp(y + rT))\frac{1}{\sqrt{2 \pi \sigma^2 T}}\exp\left(\frac{-(y + \frac{1}{2}\sigma^2T)^2}{2 \sigma^2 T}\right)\mathrm{d}y.$$&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2013-12-31T04:15:08.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9839" PostTypeId="2" ParentId="7921" CreationDate="2013-12-31T05:35:04.323" Score="2" Body="&lt;p&gt;Scale and range are your biggest issues.  If one input has values which range from e.g. 2300-3500, and another from 0 to 18, then the large scale of the first will swamp the other and provide greater informativity into your learning algorithm.  Therefore, normalize into range [0,1] or mean-zero standardize - like you have already done.  Be careful with mean-zero standardization, however, since means only apply to skew-zero normal distributions, and not to log-normally distributed (right-tailed) skewed distributions.  You could input the ranks of your skewed features values, but ranks are known to be rectangularly distributed, so convert ranks to percentiles, and then to van der Waerden scores (which are standard normal distributed without skewness).         &lt;/p&gt;&#xA;" OwnerDisplayName="user6430" LastEditorDisplayName="user6430" LastEditDate="2016-04-17T14:41:20.333" LastActivityDate="2016-04-17T14:41:20.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9840" PostTypeId="2" ParentId="7526" CreationDate="2013-12-31T17:32:26.727" Score="1" Body="&lt;p&gt;It will only work for the latest data, but you can get latest dividend information and latest split date/ratio from yahoo, it comes with the other company stats &lt;em&gt;(here is a sample of the output)&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;ForwardAnnualDividendRate&amp;gt;0.36&amp;lt;/ForwardAnnualDividendRate&amp;gt;&#xA;&amp;lt;ForwardAnnualDividendYield&amp;gt;1.10%&amp;lt;/ForwardAnnualDividendYield&amp;gt;&#xA;&amp;lt;TrailingAnnualDividendYield&amp;gt;0.33&amp;lt;/TrailingAnnualDividendYield&amp;gt;&#xA;&amp;lt;TrailingAnnualDividendYield&amp;gt;1.00%&amp;lt;/TrailingAnnualDividendYield&amp;gt;&#xA;&amp;lt;p_5YearAverageDividendYield&amp;gt;1.40%&amp;lt;/p_5YearAverageDividendYield&amp;gt;&#xA;&amp;lt;PayoutRatio&amp;gt;32.00%&amp;lt;/PayoutRatio&amp;gt;&#xA;&amp;lt;DividendDate&amp;gt;Sep 10, 2013&amp;lt;/DividendDate&amp;gt;&#xA;&amp;lt;Ex_DividendDate&amp;gt;Nov 13, 2013&amp;lt;/Ex_DividendDate&amp;gt;&#xA;&amp;lt;LastSplitFactor term=&quot;new per old&quot;&amp;gt;5:4&amp;lt;/LastSplitFactor&amp;gt;&#xA;&amp;lt;LastSplitDate&amp;gt;Dec 11, 2013&amp;lt;/LastSplitDate&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Replace &quot;GRC&quot; with your stock symbol in the following URL:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://query.yahooapis.com/v1/public/yql?q=SELECT%20%2a%20FROM%20yahoo.finance.keystats%20WHERE%20symbol=%27GRC%27&amp;amp;env=store://datatables.org/alltableswithkeys&quot; rel=&quot;nofollow&quot;&gt;http://query.yahooapis.com/v1/public/yql?q=SELECT%20*%20FROM%20yahoo.finance.keystats%20WHERE%20symbol%3D'&lt;strong&gt;GRC&lt;/strong&gt;'&amp;amp;env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is an automated scrape of &lt;a href=&quot;http://finance.yahoo.com/q/ks?s=GRC&quot; rel=&quot;nofollow&quot;&gt;http://finance.yahoo.com/q/ks?s=GRC&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6860" LastActivityDate="2013-12-31T17:32:26.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9842" PostTypeId="2" ParentId="9825" CreationDate="2014-01-01T07:34:16.833" Score="6" Body="&lt;p&gt;Let $dS_t = \mu_tS_tdt + \sigma_tS_tdW_t$ be the underlying GBM (Geometric Brownian Motion)-like dynamics as in the question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $B_t$ a Brownian motion such that $d[B,W]_t = \rho dt$, $\rho\in[-1,1].$&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;CIR (Cox-Ingersoll-Ross) for $\sigma_t^2$ (when combined with GBM-like underlying dynamics, it is the popular Heston SV model)&#xA;$$d\sigma_t^2 = \kappa(\theta - \sigma_t^2)dt + \zeta \sigma_tdB_t$$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;GBM for $\sigma_t^2$  and $\rho=0$ (when combined with GBM-like underlying dynamics, it is the Hull-White SV model)&#xA;$$d\sigma_t^2 = -\kappa\sigma_t^2dt + \zeta \sigma_t^2dB_t$$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;(Yours) Exponential OU for $\sigma_t$ (when combined with GBM-like underlying dynamics, it has no special name)&#xA;$$d\ln \sigma_t = \kappa(\theta - \ln \sigma_t)dt + \zeta dB_t$$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Lognormal for $\sigma_t$ (when combined with GBM-like underlying dynamics, it has no special name)&#xA;$$d\sigma_t = \kappa(\theta - \sigma_t)dt + \zeta \sigma_tdB_t$$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;They can all be useful, depending on what you want or, simply, as benchmark of one against the other (when calibrated to the same targets). Note that if you are willing to revisit the underlying dynamics itself, you get other SV (stochastic volatility) models. For example, look up SABR or SLV (stochastic local volatility) models. &lt;/p&gt;&#xA;" OwnerUserId="6858" LastEditorUserId="6858" LastEditDate="2014-01-01T09:36:15.320" LastActivityDate="2014-01-01T09:36:15.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9843" PostTypeId="2" ParentId="3649" CreationDate="2014-01-01T11:37:49.170" Score="2" Body="&lt;p&gt;i have a really interesting answer..&#xA;clearly delta of an ATM call is approximately 0.5 in BS setting since we can do a taylor series expansion of N(d1) = 1/2 + 1/root(2pi) *d1 which goes to 1/2 at maturity..assuming r=q=0&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but above is a model dependent result...it assumes log normal distribution in stock price..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a model independent result....&#xA;at maturity...we know delta is either 1 or 0 depending on whether the stock is ITM or OTM..&#xA;But delta = - dc(T)/dk...which is a digital...and this can be replicated by 1/2dk of portfolio of call spreads...at maturity...the call spread value is 1/2...&lt;/p&gt;&#xA;" OwnerUserId="6872" LastEditorUserId="6872" LastEditDate="2014-01-01T15:34:27.460" LastActivityDate="2014-01-01T15:34:27.460" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9848" PostTypeId="2" ParentId="7921" CreationDate="2014-01-02T04:16:46.370" Score="2" Body="&lt;p&gt;There is no right approach a priori. Try all approaches that make decent sense and pick the one that maximises a utility function on out of sample PnL and risk (or some similar decision rule). &lt;/p&gt;&#xA;" OwnerUserId="6081" LastActivityDate="2014-01-02T04:16:46.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9850" PostTypeId="2" ParentId="557" CreationDate="2014-01-02T11:36:12.290" Score="2" Body="&lt;p&gt;Most of the answers here are pretty correct. However, when talking about performance we use to forget the foundation of all this: The programmin language and platform.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will summarize it like this: Need high-performance? Go for C (C++ in this case, since there is no pure C version of QuickFix). Choosing QuickFixJ, QuickFix .NET or any other implementation won't never be as fast as a pure C implementation of the FIX Protocol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am working on it by the way, and surprised that nobody did before (mainly for the HFT business)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Happy New Year!&lt;/p&gt;&#xA;" OwnerUserId="6879" LastActivityDate="2014-01-02T11:36:12.290" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9853" PostTypeId="1" CreationDate="2014-01-02T22:00:03.877" Score="6" ViewCount="315" Body="&lt;p&gt;We are thinking of applying to become a registered market-maker on different European exchanges. The name varies from exchange to exchange (Liquidity provider on Euronext for instance).&#xA;Could anybody tell me on say Euronext or LSE&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;how long does it take&lt;/li&gt;&#xA;&lt;li&gt;what are the upsides/downsides&lt;/li&gt;&#xA;&lt;li&gt;what are contractual requirements&lt;/li&gt;&#xA;&lt;li&gt;do all the market makers on an exchange incur the same cost/reward or is it possible to &quot;bargain&quot; with the exchange.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I know that some exchanges signed special agreements with a few players giving them special fees. &lt;/p&gt;&#xA;" OwnerUserId="5339" LastActivityDate="2014-01-02T22:00:03.877" Title="How to become a registered market maker on an exchange" Tags="&lt;market-making&gt;&lt;exchange&gt;&lt;european&gt;&lt;fees&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="1" ClosedDate="2014-01-03T16:22:05.113" ContentLicense="CC BY-SA 3.0" />
  <row Id="9854" PostTypeId="1" CreationDate="2014-01-03T12:10:09.677" Score="2" ViewCount="176" Body="&lt;p&gt;Is there a standard method (statistical or model based) to reproject rates risk obtained on a full set of tenors onto a smaller subset of tenors ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's imagine that I got a delta in the following form:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Delta in $ per bps move.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;FRA  3M      3.5&#xA;&#xA;FUT  H14     4.5&#xA;FUT  M14     4.4&#xA;FUT  U14     4.6&#xA;FUT  Z14     4.8&#xA;FUT  H15     4.9&#xA;FUT  M15     4.4&#xA;FUT  U15     4.6&#xA;FUT  Z15     4.6 &#xA;&#xA;SWAP  2Y     6.2&#xA;SWAP  3Y     6.6&#xA;SWAP  4Y     8&#xA;SWAP  5Y     10&#xA;SWAP  6Y     12&#xA;SWAP  7Y     18&#xA;SWAP  8Y     17&#xA;SWAP  9Y     10&#xA;SWAP 10Y     17&#xA;SWAP 11Y     18&#xA;SWAP 12Y     680&#xA;SWAP 13Y     610&#xA;SWAP 14Y     6&#xA;SWAP 15Y     0&#xA;SWAP 16Y     0&#xA;SWAP 17Y     0&#xA;SWAP 18Y     0&#xA;SWAP 19Y     0&#xA;SWAP 20Y     0&#xA;SWAP 25Y     0&#xA;SWAP 30Y     0&#xA;SWAP 50Y     0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Let's say I would like to see my risk with these tenors as I do not want to trade the other tenors, what would be the most appropriate to obtain a way to convert the risk from one set of tenor to another ?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;FRA  3M  &#xA;&#xA;FUT  H14 &#xA;FUT  M14 &#xA;FUT  U14 &#xA;FUT  Z14 &#xA;FUT  H15 &#xA;FUT  M15 &#xA;FUT  U15 &#xA;FUT  Z15 &#xA;&#xA;SWAP  2Y &#xA;SWAP  5Y &#xA;SWAP 10Y &#xA;SWAP 15Y &#xA;SWAP 20Y &#xA;SWAP 30Y &#xA;SWAP spread 30Y/50Y&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2908" LastEditorUserId="2908" LastEditDate="2014-01-03T15:50:52.837" LastActivityDate="2014-01-03T15:50:52.837" Title="How to reproject rates risk on a subset of tenors" Tags="&lt;interest-rates&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9858" PostTypeId="1" AcceptedAnswerId="9866" CreationDate="2014-01-04T15:14:51.217" Score="1" ViewCount="2014" Body="&lt;p&gt;I read conflicting opinions about the inclusion of lagged dependent variables in modeling, and I guess it is partly up to the researcher and depending on the scope and goal of the research.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm currently modeling the liquidity of German stocks, with panel data regression (fixed time effects), and my independent variables are price (logged), freefloat number of shares (logged) en book-to-market-value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using E-views, my results are OK, except for a Durbin-Watson value around 1.5.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming Durbin Watson is valid for paneldata (but for the seperate stocks, DW is also too low ), we have autocorrelation in the errors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a problem because:.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;(i) Estimates of the regression coefficients are inefficient. &#xA;(ii) Forecasts based on the regression equations are sub-optimal. &#xA;(iii) The usual significance tests on the coefficients are invalid.&lt;/em&gt; &#xA;[source: Granger]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Including a lagged dependent variable, i.e. liquidity from the day before, solves this issue and as expected increases the R^2 a bit more. But I am not really sure if this is the way to go. This is modeling liquidity where liquidity of the previous day is the most important factor.... Another option would be that I'm missing a independent variable?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically the papers of Achen(To Lag or Not to Lag? Re-evaluating the Use of Lagged&#xA;Dependent Variables in Regression Analysis)  and Wilkins (Why Lagged Dependent Variables Can Supress the Explanatory Power of Other Independent Variables) talk about these issues.&lt;/p&gt;&#xA;" OwnerUserId="2402" LastEditorUserId="2402" LastEditDate="2014-01-04T17:20:39.370" LastActivityDate="2017-02-21T11:27:41.590" Title="Lagged dependent variable, yes or no?" Tags="&lt;time-series&gt;&lt;regression&gt;&lt;paneldata&gt;&lt;lags&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9859" PostTypeId="1" AcceptedAnswerId="9888" CreationDate="2014-01-04T17:30:13.070" Score="1" ViewCount="571" Body="&lt;p&gt;I was given the returns of a cross-asset class portfolio of ETFs and I conducted PCA to obtain factors on dates from T-n, T-3, T-2,..., T. What I would like to do is decompose the market moves from T+1, T+2, ... onwards into combinations of the PCs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions is, what sort of algorithm or optimization method can I use to obtain a set of factor weightings that explain the maximal amount of variance in the market moves going forward. Furthermore, this optimization method should be capable of outputting a list of maxima , not just one, so that the stability of the optimal factor weightings can be assessed over time, since the optimal factor weightings for one day/time period may not be the same as the optimal factor weightings over a larger period.&lt;/p&gt;&#xA;" OwnerUserId="6893" LastEditorUserId="6893" LastEditDate="2014-01-04T18:29:25.067" LastActivityDate="2015-12-28T18:30:27.767" Title="Optimizing Principal Component factor weightings over time" Tags="&lt;time-series&gt;&lt;optimization&gt;&lt;factor-models&gt;&lt;etf&gt;&lt;pca&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9861" PostTypeId="1" CreationDate="2014-01-04T23:53:42.570" Score="3" ViewCount="159" Body="&lt;p&gt;[I already posted this question on the math forum of stackexchange and I was advised that I should post this question here]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Evans and Jovanovic (1989) you will find a model for entrepreneurs with credit constraints. The part that is important for my question follows. Here it is the production function and the income equation that one should maximize:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{aligned}&#xA;y &amp;amp;= \theta k^{\alpha}\\&#xA;I &amp;amp;= y + r(z - k)\\&#xA;\max(\theta k^{\alpha} + r(z - k)) &amp;amp;\text{such that } k \leq \lambda z&#xA;\end{aligned}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where ${\lambda}\ge1$ and it is a measure of constraints. For the rest of the notation: $y$ are the earnings of the individual from production; $I$ is income; $k$ is capital; $\theta$ is a skill measurement; $r$ it is the interest rate; $z$ is the initial wealth of the individual or household that he, or the household, lends too; $\alpha$ is a technology parameter. If you are interested in more details of the model, here it is a link: &lt;a href=&quot;http://www.rand.org/content/dam/rand/www/external/icj/centers/small_business/course/files/le_materials/le_evans_and_jovanovic.pdf&quot; rel=&quot;nofollow&quot;&gt;Evans and Jovanovic (1989)&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So here comes my doubt. This model is about putting credit constraints for a hypothetical entrepreneur. The entrepreneur borrows $k$ in such situation but only pays the interests: $rk$; for example, in each period we could be analyzing (I mean hypothetically, I did not give a time frame for the equation), he only pays the interests of what he borrowed i.e. he does not pay a principal on what he borrowed plus interests, only interests are deducted from his income. The individual seems to &lt;em&gt;rent&lt;/em&gt; capital rather than &lt;em&gt;borrow&lt;/em&gt; it in a more familiar way. So I'll ask you: does this interpretation makes sense? If so, is there a larger reason for economic modeling making this kind of implicit assumption? &lt;/p&gt;&#xA;" OwnerUserId="6897" LastEditorUserId="6897" LastEditDate="2016-05-11T20:06:48.187" LastActivityDate="2016-05-11T20:06:48.187" Title="A doubt about Evans and Jovanovic (1989) economic model for entrepreneurs with credit constraints" Tags="&lt;interest-rates&gt;&lt;optimization&gt;&lt;modeling&gt;&lt;finance&gt;&lt;economics&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9862" PostTypeId="1" CreationDate="2014-01-05T00:26:28.383" Score="1" ViewCount="2368" Body="&lt;p&gt;While performing a montecarlo simulation of stock prices using the milstein scheme is it possible to take into account the dividend yield into the simulation itself somehow, if we are given a continuous dividend yield?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or is this something that has to be considered while valuing various derivatives using those simulated paths?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am fairly new to quant finance, so pardon me if this turns out to be a stupid question.&lt;/p&gt;&#xA;" OwnerUserId="6899" LastActivityDate="2021-05-27T18:02:00.433" Title="MonteCarlo simulation of stock prices using milstein scheme with dividend yield?" Tags="&lt;monte-carlo&gt;&lt;dividends&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9864" PostTypeId="2" ParentId="3649" CreationDate="2014-01-05T03:30:32.093" Score="2" Body="&lt;p&gt;First of all, even though you can read it in many places, $\Delta_{Call} = \Phi(d_+)$ is not the probability of finishing ITM. For two reasons: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;it is computed under the risk neutral probability. Not the historic one. &lt;/li&gt;&#xA;&lt;li&gt;even under the risk neutral probability $Q(S_T&amp;gt;K) = \Phi(d_-)$ not $d_+$. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In the BS model under the historic probabilty $P(S_T&amp;gt;K) = P(S_te^{(\mu-\sigma^2/2)(T-t)+\sigma(W_T-W_t)} &amp;gt; K) = \Phi\left(\frac{1}{\sigma\sqrt{T-t}}(\log(S_t/K) + (\mu-\sigma^2/2)(T-t))\right)$. Basically you get $\Phi(d_-)$ but with the real drift $\mu$ instead of the risk-free rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what does the Delta really looks like? As was explained: &#xA;$$&#xA;  \Delta_{Call} = \Phi(d_+) = \Phi\left(\frac{1}{\sigma\sqrt{T-t}}(\log(S_te^{r(T-t)}/K) + \sigma^2(T-t)/2))\right)&#xA;$$ &#xA;So if you are ATMF i.e. $S_te^{r(T-t)} = K$ then the log term cancels out:&#xA;$$&#xA;  \Delta_{Call}^{ATMF} = \Phi\left(\frac{1}{2}\sigma\sqrt{T-t}\right) &#xA;$$ &#xA;In particular, the volatility term is positive so $\Delta_{Call}^{ATMF} &amp;gt; 0.5$. We can then make a first order approximation: &#xA;$$&#xA;  \Delta_{Call}^{ATMF} = \Phi\left(\frac{1}{2}\sigma\sqrt{T-t}\right) \approx \Phi(0) + \Phi'(0)\frac{1}{2}\sigma\sqrt{T-t} \approx 0.5 + 0.2\sigma \sqrt{T-t}.&#xA;$$ &#xA;since $\Phi'(0) = \frac{1}{\sqrt{2\pi}} \approx 0.4$. So you have a nice simple approximation for the Delta of an ATMF Call. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: You should ask yourself what happens when $\sigma \to \infty$.&lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2014-01-05T03:30:32.093" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9866" PostTypeId="2" ParentId="9858" CreationDate="2014-01-05T23:07:51.540" Score="1" Body="&lt;p&gt;If there is autocorrelation than you need to add the lagged dependent variable. By not including it, your regression is suffering from the omitted variable bias. You say that by doing this you will be &quot;modelling liquidity where liquidity of the previous day is the most important factor&quot; but since your regression &quot;demands&quot; adding the LDV (due to the AC) then most likely this period's liquidity is strongly dependent on last period's liquidity. &lt;/p&gt;&#xA;" OwnerUserId="6905" LastActivityDate="2014-01-05T23:07:51.540" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9870" PostTypeId="2" ParentId="549" CreationDate="2014-01-06T21:20:41.737" Score="8" Body="&lt;p&gt;To me, coloring by data value is a great way to bring applications alive. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/c31UQ.jpg&quot; alt=&quot;palette-coloring by data value&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Kqvo7.jpg&quot; alt=&quot;coloring by reference line&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If traditional ways are not enough, probably taking 3D in use would be a way:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/tP9vv.jpg&quot; alt=&quot;3D surface with coloring&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/XtMNr.jpg&quot; alt=&quot;3D gradient bars&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And of course 2D heatmap is a very handy for sure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm developing data visualization software components with 3D technologies, so definitely all feedback and ideas are welcome :-)&lt;/p&gt;&#xA;" OwnerUserId="6911" LastActivityDate="2014-01-06T21:20:41.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9872" PostTypeId="1" AcceptedAnswerId="9879" CreationDate="2014-01-07T10:02:58.530" Score="5" ViewCount="564" Body="&lt;p&gt;I have studied option pricing using Geometric Brownian Motion to generate sample paths. Because of the normal distribution, it is easy to create a covariance matrix and get correlated asset returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am interested in learning more about Mandelbrot's Multi Fractal model of asset returns and it's applications. From what I can find, there exist much work about forecasting volatility using the multi fractal model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For my purposes, I am more interested in being able to generate sample paths, i.e. produce time series data. Further I would be interested in somehow modeling correlation between assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does there exist papers dealing with these problems from the viewpoint of the multi fractal model of asset returns?&lt;/p&gt;&#xA;" OwnerUserId="5888" LastActivityDate="2014-01-08T15:28:41.123" Title="Multifractal Model, Generating Sample Paths with Correlations between Assets" Tags="&lt;time-series&gt;&lt;correlation&gt;&lt;returns&gt;&lt;fractals&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9874" PostTypeId="2" ParentId="9020" CreationDate="2014-01-07T18:55:51.233" Score="1" Body="&lt;p&gt;An open-source reference implementation is available:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/real-logic/simple-binary-encoding&quot; rel=&quot;nofollow&quot;&gt;https://github.com/real-logic/simple-binary-encoding&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is a Java program that will translate the XML-based data dictionary into Java, C++, and C# bindings.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2014-01-07T18:55:51.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9875" PostTypeId="2" ParentId="9550" CreationDate="2014-01-07T18:58:39.867" Score="2" Body="&lt;p&gt;This is a really confused question and the OP clearly doesn't work in this industry. Any connection to an exchange &lt;strong&gt;requires&lt;/strong&gt; using the format the exchange has chosen. I.e., you don't get a choice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, I don't know of a single exchange that allows order entry via SBE. CME Group will use SBE for their new market-data feed (replacing FAST compression), but that's it.&lt;/p&gt;&#xA;" OwnerUserId="35" LastActivityDate="2014-01-07T18:58:39.867" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9876" PostTypeId="2" ParentId="557" CreationDate="2014-01-07T19:01:54.307" Score="10" Body="&lt;p&gt;I have not tested QuickFIX performance but I thought I'd share performance numbers from two open source FIX engines I have written.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/penberg/libtrading&quot;&gt;Libtrading&lt;/a&gt;, a FIX engine written in C, has &lt;em&gt;16 μs&lt;/em&gt; round-trip time for NewOrderSingle-ExecutionReport ping-pong test. The test is being run on a 2-way 2.7GHz Sandy Bridge i7 CPU running Fedora 19 with Linux 3.11.6 with both client and server running on the same machine. The numbers include time spent in the Linux TCP/IP stack which is around 5 μs RTT on the machine. This translates to roughly &lt;em&gt;6 μs&lt;/em&gt; overhead per FIX message.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/penberg/falcon&quot;&gt;Falcon&lt;/a&gt;, an experimental FIX engine written in Java, has &lt;em&gt;23 μs&lt;/em&gt; round-trip time for similar test where the server is actually provided by libtrading. This is around &lt;em&gt;9 μs&lt;/em&gt; per-message overhead which is 50% more than the C FIX engine.&lt;/p&gt;&#xA;" OwnerUserId="6914" LastActivityDate="2014-01-07T19:01:54.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9877" PostTypeId="1" CreationDate="2014-01-08T03:17:40.363" Score="3" ViewCount="2353" Body="&lt;p&gt;I am looking for historical VWAP pricing data for north american equities. I haven't been able to find a free/cheap data source. Do you guys know of one ? Also, is there a way to proxy for an equities VWAP price without having access to tick data ?&lt;/p&gt;&#xA;" OwnerUserId="1696" LastActivityDate="2019-04-23T15:00:55.297" Title="Do you know any data source for historical VWAP data?" Tags="&lt;market-data&gt;&lt;vwap&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9878" PostTypeId="1" AcceptedAnswerId="9930" CreationDate="2014-01-08T13:23:36.067" Score="1" ViewCount="327" Body="&lt;p&gt;Given an estimation procedure and real data, how would one compute the mean squared error? What value represents the &quot;true&quot; realized volatility in the case of calculating the Mean Squared Error in estimation? I'm specifically interested in intraday estimation error (one minute trade data for example)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for example:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;I want to estimate the realized volatility statistic on 1 day's&#xA;worth of real 1 minute data&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I'm going to use block bootstrapping as my estimation procedure&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I run the block bootstrapping estimation algorithm and get an estimated realized volatility value&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;To compute the estimation error, I need a true realized volatility value for this 1 day of 1 minute data.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;What can I use for this &quot;true&quot; realized volatility value for the specific data that I am estimating from? &lt;/p&gt;&#xA;" OwnerUserId="5456" LastEditorUserId="2299" LastEditDate="2014-01-12T09:29:09.360" LastActivityDate="2014-01-12T09:29:09.360" Title="What is the realized volatility's estimation error?" Tags="&lt;volatility&gt;&lt;risk&gt;&lt;market-microstructure&gt;&lt;estimation&gt;&lt;bootstrapping&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9879" PostTypeId="2" ParentId="9872" CreationDate="2014-01-08T14:25:11.567" Score="4" Body="&lt;p&gt;The paper &lt;a href=&quot;http://wstein.org/home/wstein/www/home/simuw/simuw08/refs/fractal/mandelbrot-a_multifractal_model_of_asset_returns.pdf&quot; rel=&quot;noreferrer&quot;&gt;&quot;A Multifractal Model of Asset Returns&quot;&lt;/a&gt; by B. Mandelbrot, A. Fisher and L. Calvet (1997) discusses the creation of multifractal processes in Section 3.4.&lt;/p&gt;&#xA;" OwnerDisplayName="user1157" LastActivityDate="2014-01-08T14:25:11.567" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9880" PostTypeId="2" ParentId="9872" CreationDate="2014-01-08T15:28:41.123" Score="4" Body="&lt;p&gt;Not acutally a paper, but there is even a book on Multifractal Models. It is, to my knowledge, the standard reference on this topic by Calvet and Fisher:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0121500136&quot; rel=&quot;noreferrer&quot;&gt;Multifractal Volatility: Theory, Forecasting, and Pricing (Academic Press Advanced Finance)&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2014-01-08T15:28:41.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9881" PostTypeId="2" ParentId="748" CreationDate="2014-01-08T16:49:22.177" Score="1" Body="&lt;p&gt;I think the closest to an &quot;analytical&quot; answer (and I do not mean in terms of the accuracy, but in the sense that you can solve it by using pen and paper instead of a computer) would be to use linearization. Consider $g(X_1,X_2)=e^{X_1}+e^{X_2}$, we'd now like to compute $VaR_\alpha(g(X_1,X_2))$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Linearization of $g$ gives:$$g(X_1,X_2)\approx g(\mathbf{\mu}) + \nabla g^T(\mu)(\mathbf{X}-\mathbf{\mu})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus we have that $$VaR_\alpha(g(X_1,X_2)) \approx VaR_\alpha(g(\mathbf{\mu}) + \nabla g^T(\mu)(\mathbf{X}-\mathbf{\mu})) = VaR_\alpha(\nabla g^T(\mu)(\mathbf{X}-\mathbf{\mu})) - g(\mathbf{\mu})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where the last equality holds due to the translation invariance of value-at-risk. Now we have that $$\nabla g^T(\mu)(\mathbf{X}-\mathbf{\mu})= e^{\mu_1}(X_1-\mu_1) + e^{\mu_2}(X_2-\mu_2) = e^{\mu_1}X_1+e^{\mu_2}X_2 -\mu_1e^{\mu_1} - \mu_2e^{\mu_2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once again we can move out the constants due to the translation invariance of value-at-risk. (Note that I skip the risk-free rate).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we have $$VaR_\alpha(g(X_1,X_2)) \approx VaR_\alpha(e^{\mu_1}X_1+e^{\mu_2}X_2)+e^{\mu_1} + e^{\mu_2} -\mu_1e^{\mu_1} - \mu_2e^{\mu_2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $X_1,X_2$ are just normally distributed, so will their sum be. Thereafter its just straightforward computations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Worth noting is that linear approximation only works well when the probability mass in centered closely around the mean, i.e. if tails are light and variance is small. It becomes particularly worrisome since in the value at risk we're measuring probabilities far out in the tail.&lt;/p&gt;&#xA;" OwnerUserId="4709" LastActivityDate="2014-01-08T16:49:22.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9882" PostTypeId="2" ParentId="4019" CreationDate="2014-01-08T16:59:48.113" Score="6" Body="&lt;p&gt;There is the white paper &lt;a href=&quot;http://www.d-fine.com/fileadmin/d-fine/hochgeladen/Fachartikel/WhitePaper_Vols_NegIR_V1_1_en.pdf&quot; rel=&quot;nofollow&quot;&gt;&quot;New volatility conventions in negative interest environment - Current developments and necessary adjustments of IT systems in trading, risk management and accounting&quot;&lt;/a&gt; by M. Beinker and H. Planck (2013), which discusses recent developments and also gives an introduction to the &lt;strong&gt;displaced diffusion model&lt;/strong&gt;, which can handle negative interest rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more detail on the displace diffusion model, see &quot;Volatility and Correlation: The Perfect Hedger and the Fox&quot; by R. Rebonato which contains more detailed information in Chapter 16.&lt;/p&gt;&#xA;" OwnerDisplayName="user1157" LastEditorDisplayName="user1157" LastEditDate="2014-01-14T12:33:42.917" LastActivityDate="2014-01-14T12:33:42.917" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9883" PostTypeId="1" AcceptedAnswerId="9887" CreationDate="2014-01-08T18:31:45.903" Score="0" ViewCount="222" Body="&lt;p&gt;In general, under an EMM, does there necessarily exist a replicating portfolio for every derivative?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe the answer to this is false. A simple example is a discrete time, trinomial model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a complete market, i.e. the EMM is unique, does there necessarily exist a replicating portfolio for (at least all European) derivatives?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the only 2 models I know - being Black-scholes and Binomial model, this is true, but is this true in general?&lt;/p&gt;&#xA;" OwnerUserId="3334" LastActivityDate="2014-01-08T23:40:27.613" Title="Under an EMM, does there necessarily exist a replicating portfolio?" Tags="&lt;risk-neutral-measure&gt;&lt;replication&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9884" PostTypeId="1" CreationDate="2014-01-08T19:21:31.017" Score="1" ViewCount="204" Body="&lt;p&gt;From a continuous standpoint, I understand why an ATM call has delta = 0.5 and for ITM call, the delta approaches 1 since each move in the underlying corresponds to same unit of value change in call option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Howwever, if we take a discrete case where call option expires in 1 period. If strike price is 100 and the underlying is at 100. If the underlying moves to 105 in 1 period, then dS = 5 and the change in call option is also 5? So then this ratio of $\frac{dc}{dS} = 1$ not 0.5?&lt;/p&gt;&#xA;" OwnerUserId="6918" LastActivityDate="2014-01-09T11:55:20.927" Title="Calculating deltas of call options?" Tags="&lt;options&gt;&lt;option-pricing&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9887" PostTypeId="2" ParentId="9883" CreationDate="2014-01-08T23:31:42.047" Score="0" Body="&lt;p&gt;This is known to be true in very wide generality.  In the mathematical finance literature, it is often called the second fundamental theorem of asset pricing.  The proof echoes, in some respects the martingale representation theorem.  Intuitively, if there are some derivatives that cannot be hedged perfectly, there is some flexibility in arbitrage-free ways of pricing these derivatives, and this leads to the existence of multiple EMM's.  &lt;/p&gt;&#xA;" OwnerUserId="3415" LastEditorUserId="3415" LastEditDate="2014-01-08T23:40:27.613" LastActivityDate="2014-01-08T23:40:27.613" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9888" PostTypeId="2" ParentId="9859" CreationDate="2014-01-09T00:24:40.430" Score="1" Body="&lt;p&gt;Your approach is a good one.  But before you venture too far, you should be aware of issues related to zero eigenvalues (positive semi-definiteness) of your correlation matrix $\mathbf{R}$  or covariance matrix $\mathbf{C}$.  Let $p$ be the number of assets, and $t$ the number of, for example, day or bars.  You probably have many more times in the time series than you do assets, and thus, $t\gg p$.  Since you are turning the dataset on its side, and treating days like variables, and assets like observations, there will be $t-p$ zero eigenvalues in your covariance matrix $\mathbf{C}$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the above, don't ever lose sight of the basic premise of, for example, Markowitzian portfolio optimization, where the covariance between assets (not days) is determined, and the number of days is exceedingly large (250 trading days per year) when compared with the number of assets.  By default, Markowitz did not need to worry too much about zero eigenvalues of $\mathbf{C}$ when introducing his theory since $t\gg p$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a solution, you could therefore use singular value decomposition (SVD) on your $\mathbf{C}$, which is ideal for large dimension and low example datasets.  When done, what you will observe is that certain days (bars) will &quot;load&quot; on certain principal components -- so you essentially be identifying groups of trading days which are similar.  Since principal components are by definition orthogonal (zero correlation between them), you will need to think of a way to project your results into the future.  Overall, however, there will be high merit in what you are doing for the ETFs involved, since you will be able to understand the structure of trading days for the basket of ETFs and days used.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's a complex undertaking, and since so many issues are involved surrounding the problem of $t \gg p$, you will undoubtedly run into the Marcenko-Pastur law involving $\gamma=p/t$ and random data matrices.  Look at, for example, Johnstone's &lt;a href=&quot;http://www.stat.harvard.edu/NESS10/Johnstone-slides.pdf&quot; rel=&quot;nofollow&quot;&gt;talk&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user6430" LastEditorDisplayName="user6430" LastEditDate="2015-12-28T18:30:27.767" LastActivityDate="2015-12-28T18:30:27.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9892" PostTypeId="1" CreationDate="2014-01-09T11:04:52.260" Score="0" ViewCount="1824" Body="&lt;p&gt;Let $M(h)$ be the moment-generating function, then the cumulant generating function is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$K(h)=\text{ln}M(h)=\\&#xA;    =\kappa_1h+\frac{1}{2!}h^2\kappa_2+\frac{1}{3!}h^3\kappa_3+\ldots$$ where $\kappa_1, \kappa_2, \ldots$, are the cumulants.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $L=\sum_{j=1}^Nc_jx_j$ is a function of $N$ independent variables, then the cumulant-generating function for $L$ is given by&#xA;                  $$ K(h)=\sum_{j=1}^NK_j(c_jh). $$&lt;/p&gt;&#xA;" OwnerUserId="6148" LastEditorUserId="2727" LastEditDate="2014-01-10T08:45:01.763" LastActivityDate="2014-01-10T08:45:01.763" Title="How can I calculate the Cumulant-Generating Function in Matlab?" Tags="&lt;matlab&gt;" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="9893" PostTypeId="1" AcceptedAnswerId="9894" CreationDate="2014-01-09T11:20:51.203" Score="1" ViewCount="545" Body="&lt;p&gt;Reading through examples of legal front running, I'm struggling to understand how &quot;penny jumping&quot; (&lt;a href=&quot;http://www.wikinvest.com/wiki/Front-running&quot; rel=&quot;nofollow&quot;&gt;http://www.wikinvest.com/wiki/Front-running&lt;/a&gt;) can be profitable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose stock ABC is trading at a spread of \$50.1 - \$50.9 and trader Alice has placed a very large day buy order at the \$50.1 level. Trader Bob who is supposed to profit and limit his risk is placing an order at \$50.2, one tick up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now your typical description would say something like: &quot;if ABC's price rises above \$50.2, Bob will profit, but if it doesn't he'll be able to sell for \$50.1 as part of Alice's large limit order.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Down:&lt;/strong&gt; This is a buy order, so if the price goes down it is because there is sell pressure, and sellers are eventually crossing the spread. When Bob's buy order has traded he can still scratch trade by selling back against the impenetrable $50.1 bid level, and he didn't lose much. His risk is indeed limited.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Up: (Here's what I don't understand.)&lt;/strong&gt; If the price goes up it means more bidders are joining the queue on the bid side pushing the levels up above \$50.2 where Bob's order resides. Bob's order will not get done at all - where's the profit here? We'll simply discover by the end of the day from the average close price that &quot;ABC went up&quot;.&lt;/p&gt;&#xA;" OwnerUserId="6930" LastActivityDate="2014-01-09T12:03:40.160" Title="Penny jumping in the direction of the price" Tags="&lt;trading&gt;&lt;investing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9894" PostTypeId="2" ParentId="9893" CreationDate="2014-01-09T11:52:05.400" Score="1" Body="&lt;p&gt;In the &lt;em&gt;Up&lt;/em&gt; scenario, there is not one possible outcome. There are multiple possible outcomes within &lt;em&gt;Up&lt;/em&gt;. This could be (i) fill and price goes up, (ii) partial fill and price goes up, (iii) no fill prices goes up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All three outcomes have positive value in expectation, with that value descending as we go from (i) to (iii). The third outcome is profitable in expectation as well because we have front-queue position which is very valuable assuming the tick size isn't too small, which it doesn't seem it be if that trader is placing 10 cents above the inside.&lt;/p&gt;&#xA;" OwnerUserId="6081" LastEditorUserId="6081" LastEditDate="2014-01-09T12:03:40.160" LastActivityDate="2014-01-09T12:03:40.160" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9895" PostTypeId="2" ParentId="9884" CreationDate="2014-01-09T11:55:20.927" Score="3" Body="&lt;p&gt;The theoretical idea of Delta hedging is placed in a setting of infinitesimally small time steps. In such small time steps and if no jumps occur (eg. in the diffusion case) the underlying can not move that much and Delta makes sense (at least theoretically). In continuous time things work out. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As in practice (or in simulations) the Delta hedge can only be done in small discrete time steps (not continuously) and thus only captures a part of the change in value, it is merely an approximation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case the time step is discrete and the move is too large. Thus the Delta Hedge does not work at all. &lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-01-09T11:55:20.927" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9896" PostTypeId="1" CreationDate="2014-01-09T14:31:24.723" Score="3" ViewCount="70" Body="&lt;p&gt;I have a question about the following &lt;a href=&quot;http://arxiv.org/abs/1301.5568&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; by Beatrice Acciaio, Mathias Beiglböck, Friedrich Penkner, Walter Schachermayer. At the very beginning of the paper, on page 3, there are two definitions which are not clear to me. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Why can we assume W.l.o.g. that the prices of the options are $0$?&lt;/li&gt;&#xA;&lt;li&gt;In the definition of admissible measures, equation (1.1), how is this definition motivated? Especially why &#xA;$$\int_{\mathbb{R}^T_+}\varphi_i(x)d\pi(x)\le 0, \forall i\in I $$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="17133" LastActivityDate="2014-01-09T14:31:24.723" Title="FTAP in the model independent case, paper by Schachermayer" Tags="&lt;arbitrage&gt;&lt;mathematics&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9897" PostTypeId="2" ParentId="7784" CreationDate="2014-01-09T17:35:03.300" Score="-1" Body="&lt;p&gt;the following link contains a very detailed and helpful tutorial about how to perform a cointegration test in R (i tried it myself and it works):&#xA;www.fordham.edu/economics/vinod/R-chicken-eggs-coint.doc‎&#xA;in addition it answer your question about necessity of unite-root testing;&#xA;good luck;&#xA;Amer. &lt;/p&gt;&#xA;" OwnerUserId="6932" LastActivityDate="2014-01-09T17:35:03.300" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9907" PostTypeId="1" CreationDate="2014-01-09T22:24:44.240" Score="3" ViewCount="354" Body="&lt;p&gt;The classic mean-reversion strategy is to calculate an &quot;expected return&quot; (alpha) by computing the raw return for each security and then remove the part which you think is market driven. Statistically you just do a PCA and remove the projection of the return over the sum of eigenspaces. Then you will trade the residuals as a reversion signal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Today I looked at cross sectional correlation (every stock every day in the same vector) of stock return  against the forward returns (return of the stock in the future) and realized that the correlation was better than the correlation between residuals and forward returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is then: is this fact well known, is that the case all day or just around particular moments? I have a personal explanation but I am curious to see what you think of it.&lt;/p&gt;&#xA;" OwnerUserId="5339" LastEditorUserId="56" LastEditDate="2014-01-09T22:34:11.243" LastActivityDate="2014-01-09T22:34:11.243" Title="Correlation between idiosyncratic residuals and forward returns" Tags="&lt;statistics&gt;&lt;correlation&gt;&lt;returns&gt;&lt;algorithmic-trading&gt;&lt;expected-return&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9910" PostTypeId="1" CreationDate="2014-01-10T03:39:12.703" Score="1" ViewCount="1060" Body="&lt;p&gt;Preferably in monthly or weekly denomination, for at least 20 years.  Preferably in Excel format, but csv, or other format is fine too.  I try to google but couldn't find anything, maybe I just wasn't doing it right.&lt;/p&gt;&#xA;" OwnerUserId="6939" LastActivityDate="2014-01-10T14:18:56.840" Title="Where can I find monthly/weekly historical data for gold and silver" Tags="&lt;data&gt;&lt;commodities&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2014-01-10T14:25:37.457" ContentLicense="CC BY-SA 3.0" />
  <row Id="9911" PostTypeId="1" AcceptedAnswerId="9921" CreationDate="2014-01-10T04:00:47.403" Score="20" ViewCount="11329" Body="&lt;p&gt;Can I get some recommendations for a book on market microstructure? I'm not looking for some author's questionable methods for trading, I'm just looking for a book that provides me with facts about how order books, closing auctions, order execution, etc. really works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm also NOT looking for the type of depth that a HFT would be interested in. I know that whole books can be written about the various plumbing of a particular exchange. I'm simply looking for a general overview of how exchanges work.&lt;/p&gt;&#xA;" OwnerUserId="5380" LastEditorUserId="2299" LastEditDate="2014-01-16T19:50:32.080" LastActivityDate="2020-06-11T22:29:17.200" Title="Book on market microstructure" Tags="&lt;market-microstructure&gt;&lt;books&gt;" AnswerCount="7" CommentCount="0" FavoriteCount="35" ContentLicense="CC BY-SA 3.0" />
  <row Id="9912" PostTypeId="2" ParentId="9772" CreationDate="2014-01-10T04:04:27.557" Score="1" Body="&lt;p&gt;I believe historical Reuters data can be downloaded online. Search for Reuters Key Developments Corpus.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The author of this paper (&lt;a href=&quot;http://people.csail.mit.edu/azar/wp-content/uploads/2011/09/thesis.pdf&quot; rel=&quot;nofollow&quot;&gt;http://people.csail.mit.edu/azar/wp-content/uploads/2011/09/thesis.pdf&lt;/a&gt;) used data like this.&lt;/p&gt;&#xA;" OwnerUserId="5380" LastActivityDate="2014-01-10T04:04:27.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9913" PostTypeId="2" ParentId="9892" CreationDate="2014-01-10T07:27:26.780" Score="1" Body="&lt;p&gt;I am trying to make things clear with this answer.&#xA;In the case of the normal distribution it holds that the moment generating function (mgf) is given by &#xA;$$&#xA;M(h) = \exp(\mu h + \frac12 \sigma^2 h^2),&#xA;$$&#xA;where $\mu$ is the mean and $\sigma^2$ is the variance.&#xA;Thus the cumulant generating function $C(h)$ which is given by $C(h) = \ln (M(h))$ reduces to&#xA;$$&#xA;C(h) =  \mu h + \frac12 \sigma^2 h^2.&#xA;$$&#xA;I am sure you can evaluate this in Matlab.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of log-normal the mgf is not defined.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-01-10T07:27:26.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9915" PostTypeId="2" ParentId="9911" CreationDate="2014-01-10T10:18:55.783" Score="10" Body="&lt;p&gt;Classical book on market microstructure is: &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0195144708&quot; rel=&quot;noreferrer&quot;&gt;Trading and Exchanges: Market Microstructure for Practitioners&lt;/a&gt; by Larry Harris. It's a bit outdated (2002) and missing few recent market developments like dark pools etc. but the way it currently is it's already highly recommended reading. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally I'm waiting for the next edition of the same book, and surely many others waiting as well (though not sure it will ever be published, even so Larry Harris is still actively engaged in the industry and academy).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The current market microstructure - probably the best source would be academic papers, I'm not aware of recent good books on this topic.&lt;/p&gt;&#xA;" OwnerUserId="6941" LastEditorUserId="2611" LastEditDate="2014-09-28T00:50:41.473" LastActivityDate="2014-09-28T00:50:41.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9916" PostTypeId="1" CreationDate="2014-01-10T13:46:48.000" Score="3" ViewCount="451" Body="&lt;p&gt;Currently, I am looking deeper into the topic of &lt;a href=&quot;http://en.wikipedia.org/wiki/Second-order_cone_programming&quot; rel=&quot;nofollow&quot;&gt;second-order cone programming&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Could you suggest packages that solve SOCP-problems in R?&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With your answer, please provide a &lt;strong&gt;short description&lt;/strong&gt; of the approach the solver takes to arrive at the solution. The software should be &lt;em&gt;non-commerial&lt;/em&gt; and ideally either on &lt;em&gt;CRAN or R-forge&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2014-01-10T13:46:48.000" Title="What R-packages for SOCP problems are there?" Tags="&lt;r&gt;&lt;optimization&gt;&lt;numerical-methods&gt;&lt;software&gt;&lt;portfolio-optimization&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9917" PostTypeId="2" ParentId="9910" CreationDate="2014-01-10T14:18:56.840" Score="1" Body="&lt;p&gt;Try &lt;a href=&quot;http://www.dukascopy.com/swiss/english/marketwatch/historical/&quot; rel=&quot;nofollow&quot;&gt;http://www.dukascopy.com/swiss/english/marketwatch/historical/&lt;/a&gt; You can download it as a csv file. Look for XAUUSD (Gold) &amp;amp; XAGUSD(Silver) under the list of instruments.&lt;/p&gt;&#xA;" OwnerDisplayName="user6441" LastActivityDate="2014-01-10T14:18:56.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9918" PostTypeId="2" ParentId="9911" CreationDate="2014-01-10T14:30:59.920" Score="0" Body="&lt;p&gt;This one covers basics reasonably well: &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0956399207&quot; rel=&quot;nofollow&quot;&gt;DMA&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2014-01-10T14:30:59.920" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9919" PostTypeId="2" ParentId="9911" CreationDate="2014-01-10T16:57:06.543" Score="5" Body="&lt;p&gt;There is a lot of papers on the subject that tend to stay more up to date than the books (since there's new papers coming out all of the time)... of course no 1 paper will give you the depth of concepts you can take from a book like Harris' but, after reading that book, they can be very helpful for updating the concepts. :) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;arxiv is IMHO the best source for such papers... these are a few that came out last year and were pretty interesting... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://arxiv.org/pdf/1312.0563.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://arxiv.org/pdf/1312.0563.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://arxiv.org/pdf/1312.0514.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://arxiv.org/pdf/1312.0514.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://arxiv.org/pdf/1310.1103.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://arxiv.org/pdf/1310.1103.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6186" LastActivityDate="2014-01-10T16:57:06.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9921" PostTypeId="2" ParentId="9911" CreationDate="2014-01-10T18:14:43.463" Score="13" Body="&lt;p&gt;I've not yet read it, but Lehalle's recent book is bound to be a goldmine of good micro-structure bits and pieces. &lt;a href=&quot;http://www.worldscientific.com/worldscibooks/10.1142/8967&quot; rel=&quot;noreferrer&quot;&gt;Market Microstructure in Practice&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; I'm reading the book now, so far it's quite good.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastEditorUserId="1355" LastEditDate="2014-01-23T17:29:13.707" LastActivityDate="2014-01-23T17:29:13.707" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9924" PostTypeId="1" CreationDate="2014-01-10T23:20:00.620" Score="4" ViewCount="938" Body="&lt;p&gt;This is my first post to Quantitative Finance, so I hope my question is formatted the right way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am starting to research the effects of earnings surprises on certain equity indices. Is there a source, such as an academic paper or database, for:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Companies that have had a high incidence of positive and/or negative earnings surprises over the last 5 to 10 years?&#xA;Statistics on the frequency and severity of earnings surprises on the day of and a few days after the event?&#xA;Statistics about the medium-term performance (the following quarter, for example) of stocks with large negative or positive surprises?&#xA;Industries with more earning surprises than others?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much in advance for your help.&lt;/p&gt;&#xA;" OwnerUserId="6950" LastEditorUserId="70" LastEditDate="2014-01-11T03:07:44.400" LastActivityDate="2014-09-05T08:41:43.527" Title="Measuring historical earnings surprises, their frequency and severity" Tags="&lt;equities&gt;&lt;statistics&gt;&lt;database&gt;&lt;statistical-finance&gt;&lt;earnings&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9925" PostTypeId="2" ParentId="9924" CreationDate="2014-01-11T06:48:49.473" Score="0" Body="&lt;p&gt;building these statistics is just a matter of getting the right data... the actual earnings are easy to find on EDGAR... using their very friendly and fast FTP site. &#xA;The estimates could take a little more work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;yahoo earnings has a few entries, but it is not very complete, and you have to crawl day by day instead of doing it by symbol... which can be a pain... &#xA;msn money seems to have pretty complete info and the navigation is done by symbol so it sounds quicker, specially if you only need a few stocks and don't care about little details like the time when the reported... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://investing.money.msn.com/investments/earnings-estimates?symbol=aapl&quot; rel=&quot;nofollow&quot;&gt;http://investing.money.msn.com/investments/earnings-estimates?symbol=aapl&lt;/a&gt;&#xA;&lt;a href=&quot;http://biz.yahoo.com/research/earncal/today.html&quot; rel=&quot;nofollow&quot;&gt;http://biz.yahoo.com/research/earncal/today.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;once you have the data, you would need to define what a suprise is (maybe estimate a distribution of the error on the estimate and get those that are more than 2 std from the mean?) and voila! you have your event. &#xA;At that point you just need to get daily stock prices and see the moves in the days after each event. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;last step is, once you have your results, share them back with the community by uploading them to quandl :) &lt;/p&gt;&#xA;" OwnerUserId="6186" LastActivityDate="2014-01-11T06:48:49.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9926" PostTypeId="2" ParentId="9911" CreationDate="2014-01-11T07:47:30.600" Score="3" Body="&lt;p&gt;I'd go with either Anatoly Schmidt's &lt;em&gt;Financial Markets and Trading&lt;/em&gt; or Joel Hasbrouck's &lt;em&gt;Empirical Market Microstructure&lt;/em&gt;. Both have plenty of math, and that's pretty much required when talking about market microstructure.&lt;/p&gt;&#xA;" OwnerUserId="6953" LastActivityDate="2014-01-11T07:47:30.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9928" PostTypeId="2" ParentId="9877" CreationDate="2014-01-11T13:30:15.953" Score="1" Body="&lt;p&gt;Have you checked out www.quantopian.com? They host minute-bar OHLCV data for US equities starting in Jan 2002 and updated nightly. You can't download the data wholesale but you can backtest and paper trade for free using their Python IDE. There's also a pre-canned VWAP() API call that you can use to roll your own custom VWAP.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Full disclosure, I work for Quantopian. But I really think its the best deal going - I don't know of any other comparable free data source.&lt;/p&gt;&#xA;" OwnerUserId="6955" LastActivityDate="2014-01-11T13:30:15.953" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9929" PostTypeId="1" AcceptedAnswerId="9952" CreationDate="2014-01-11T17:21:44.743" Score="4" ViewCount="1515" Body="&lt;p&gt;(Apologies for any formatting mistakes)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Within the Black Scholes model, given that you are estimating the volatility from historical data - and all other parameters assumed exact - one usually substitutes the sample variance as a point estimate for the square of the volatility and evaluates the BScall using that point estimate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, why do we use a function of the point estimate instead of the expected value of the distribution of the estimate? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The sample variance follows a Chi-Squared distribution, so we now have a distribution of values of the Call Option based on the observed sample variance and degrees of freedom.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;D\sim BSCall \left( \frac{(n-1) \text{s}^2}{\chi_{n-1} ^2} \right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Expected Value of that distribution is rarely equal to the function of the point estimate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example, assume sample variance was .25 out of 52 weekly returns (so n=51 values used to estimate variance):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;S=100\\&#xA;K=95\\&#xA;r=0.10  \\&#xA; s^2=.25\\&#xA;T=0.25\\&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yields the point estimate of&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;BSCall(s^2)=13.6953&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;E[D]=13.8372&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with 95% confidence intervals of {12.2222, 15.9196}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/0XxSA.png&quot; alt=&quot;Distribution of BS Call using Chi Squared&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;P[D&amp;gt;BSCall(s^2)]=0.525&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question is two fold: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;For using historical data, why do we use a function of the point estimate instead of the expected value of the distribution of the estimate?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If using the point estimate, does the above imply there is a 52% chance the call option is actually undervalued? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="6956" LastEditorUserId="6956" LastEditDate="2014-01-11T18:38:08.803" LastActivityDate="2014-01-22T17:25:51.453" Title="Expected value of Black-Scholes" Tags="&lt;volatility&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9930" PostTypeId="2" ParentId="9878" CreationDate="2014-01-12T09:27:03.150" Score="3" Body="&lt;p&gt;Unfortunately, financial markets are not like physical measures, where you know the &quot;true&quot; value of a physical variable but you just access to it thanks to noised sensors. We do not know the &quot;true&quot; volatility, just because there is not such one value...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In statistics you have two kinds of modelling procedures:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;the ones dedicated to estimate the &lt;strong&gt;unknown values of parameters of a known structural model&lt;/strong&gt;. Here you have the usual &quot;confidence intervals&quot; approach.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;the ones for &lt;strong&gt;simultaneously inferring from data the shape (i.e. &quot;class&quot;) of the model and its parameters&lt;/strong&gt;. Here you have the usual issues coming from &quot;overfitting&quot;, and the usual approaches are &quot;cross validation&quot;, &quot;regularization - penalization&quot;, &quot;Vapnik-Chervonenkis dimensions&quot;, etc.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In finance you are very often in the second case, and especially for volatility: for instance its value is not the same if your underlying model includes jumps or not... what is the &quot;true&quot; one? Moreover (as I commented) at your time scale (1 min) you face the &lt;a href=&quot;https://quant.stackexchange.com/tags/market-microstructure/info&quot;&gt;microstructure noise&lt;/a&gt;, see &lt;a href=&quot;https://quant.stackexchange.com/questions/2360/what-exactly-is-meant-by-microstructure-noise/3277#3277&quot;&gt;my answer here for a brief&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But come back to my generic answer on &quot;knowledge discovery&quot; via statistical modelling: &lt;em&gt;what can you test if you believe you have a good new estimation procedure&lt;/em&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can test your prediction capability of course, but you will have to face a lot of &lt;em&gt;ugly features&lt;/em&gt; of intraday volatility:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;it is not iid, even not ergodic, since &lt;strong&gt;it has a seasonality&lt;/strong&gt; (see &lt;a href=&quot;http://www.worldscientific.com/worldscibooks/10.1142/8967&quot; rel=&quot;nofollow noreferrer&quot;&gt;Market Microstructure in Practice&lt;/a&gt; for intraday seasonalities).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;once you removed the seasonality, &lt;strong&gt;it is clustered&lt;/strong&gt; (we cannot ignore it since &lt;a href=&quot;http://www.nobelprize.org/nobel_prizes/economic-sciences/laureates/2003/engle-facts.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Robert Engle&lt;/a&gt;'s Nobel prize).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;moreover, &lt;strong&gt;it is path dependent&lt;/strong&gt; (I mean, even &lt;em&gt;inside a volatility cluster&lt;/em&gt; as defined by Engle)...&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Thus if you wan to challenge existing estimation procedure, you will have to remove the first two features and demonstrate on the &lt;em&gt;deseasonalized data, cluster by cluster&lt;/em&gt;. Of course you could alternatively try to perform a change of state space to estimate something else than volatility. Like use it to estimate the seasonality or the switching probabilities themselves...&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2014-01-12T09:27:03.150" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9931" PostTypeId="1" AcceptedAnswerId="9942" CreationDate="2014-01-12T09:27:07.087" Score="0" ViewCount="851" Body="&lt;p&gt;&lt;strong&gt;Settings&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let you're trading a security whose probability to be equal to $S_{T}$ at time $T$ follows a p.d.f. like the ones in the picture below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/vEvRD.gif&quot; alt=&quot;P.d.f. examples&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(That is just an example found with Google images, assume you're considering just one of the expiry dates shown above, e.g. $T=60$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are trading with a capital equal to $M$ dollars; your main goal is to maximise your expected payoff at time $T$, and you have some constraints to achieve this result:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;you cannot go short, this is long only;&lt;/li&gt;&#xA;&lt;li&gt;your capital, $M$, must be split in a number of parts which is equal or less than $k$, that is, you cannot average your position more than $k-1$ times in addition to the first entry. This means that your position average price will be the weighted average of a maximum of $k$ security prices;&lt;/li&gt;&#xA;&lt;li&gt;you cannot borrow money, then no leverage involved;&lt;/li&gt;&#xA;&lt;li&gt;at least one entry must be made.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Below an instance in which using the whole capital, $M$, at the first trade was the best choice possible:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/jj9TP.gif&quot; alt=&quot;An example of what the price could do in the future&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From such a description my guess is that what a trader should try to do is to take advantage of the security's volatility: if my average price at $t=T$ is below $S_{T}$ I am  earning moneys, then I am involved in a trade off between a greater but less likely profit and a smaller but more likely profit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Possible objection&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Hey, mate, if $E[S_{T}]$ (expected value) is above $S_{0}$ you've just to buy it now and keep it until $T$, isn'it?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I don't think so. Consider the following security's path:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/qpOLw.jpg&quot; alt=&quot;Google&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's easy to see that if the trader does not use the whole capital, $M$, buying the stock at $t=0$, but instead he uses the remainder to buy the valley (about June), his performance will be better. Yes, he's also running the risk to buy surging prices, as well...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What the analytical formula of the expected payoff would be? I guess it &lt;strong&gt;cannot&lt;/strong&gt; be the sum of probability-weighted returns due to overlapping events;&lt;/li&gt;&#xA;&lt;li&gt;once the aforementioned payoff formula has been discovered, how to maximise your expected payoff varying the $k$ entry prices along the time which goes from $t=0$ to $t=T$?&lt;/li&gt;&#xA;&lt;li&gt;If an analytical solution did not exist, what a possible simulative approach would be? Could some Monte Carlo simulations help?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Hint&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do not let a &quot;classic&quot; p.d.f. trick you: what if the security p.d.f. was something like this...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ynyd9.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="3058" LastEditorUserId="3058" LastEditDate="2014-01-12T09:49:56.373" LastActivityDate="2014-01-13T20:54:59.370" Title="Expected payoff and weighted average price" Tags="&lt;probability&gt;&lt;payoff&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9932" PostTypeId="2" ParentId="1114" CreationDate="2014-01-12T14:37:33.317" Score="1" Body="&lt;p&gt;Rev.,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am an options trader that is rarely, if ever, delta-neutral because I am using the options to make directional bets on the move of the underlying instrument.  I expend virtually 99% of my analysis on the potential direction, magnitude and resistance points of the price-move in the underlying.  About 1% of my analysis is on the behavior of the options themselves in order to minimize slippage.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using options to make bets on direction allows traders like me to benefit from directional price-moves with leverage without the capital required to reap the same benefits from trading the underlying instrument.  However, it is not for the faint-at-heart because you are fighting theta (time-decay) every day.  Whereas traders using the underlying can usually afford to be wrong a lot longer.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Market Makers are usually always delta-neutral because they are writing the options and making their money on the arbitrage between bid-ask or options quotes in different markets, among many others.  They instantly hedge their positions (go delta-neutral) in order to protect themselves against option value swings that would erase their profit margin. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are entire careers devoted to particular option trading styles.  So, there are a multitude of opinions and theories.  I just wanted to give you a snapshot of what I do.&lt;/p&gt;&#xA;" OwnerUserId="6958" LastActivityDate="2014-01-12T14:37:33.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9934" PostTypeId="2" ParentId="9859" CreationDate="2014-01-12T20:38:23.413" Score="2" Body="&lt;p&gt;Have you considered using 'incremental' singular value decomposition to calculate your component scores? Each future market move (or increment) forces a recalculation of component scores given the new data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This paper outlines an algorithm to do this &lt;a href=&quot;http://www.merl.com/reports/docs/TR2006-059.pdf&quot; rel=&quot;nofollow&quot;&gt;Fast Low-Rank Modifications of the Think&#xA;Singular Value Decomposition&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This paper develops an identity for additive modifications of a&#xA;  singular value decomposition (SVD) to reflect updates, downdates,&#xA;  shifts, and edits of the data matrix. This sets the stage for fast and&#xA;  memory-efficient sequential algorithms for tracking singular values&#xA;  and subspaces.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="6963" LastActivityDate="2014-01-12T20:38:23.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9935" PostTypeId="1" AcceptedAnswerId="9941" CreationDate="2014-01-12T22:54:28.710" Score="6" ViewCount="1123" Body="&lt;p&gt;For the purposes of Sharpe ratio, I calculate a trading strategy's daily returns using realized P/L only:&#xA;$$&#xA;\frac{K(t + 1) - K(t)}{K(t)},&#xA;$$&#xA;where $K(t)$ is the cash balance after market close on day $t$. Assume no transfer is made from or to the account.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recently, someone suggested I use account balance(cash balance + market value of all positions) instead, to include the day's unrealized P/L.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which one should I use?&lt;/p&gt;&#xA;" OwnerUserId="1504" LastEditorUserId="848" LastEditDate="2014-01-14T06:28:43.513" LastActivityDate="2014-01-14T06:28:43.513" Title="Calculate Daily Returns for Sharpe Ratio" Tags="&lt;returns&gt;&lt;sharpe-ratio&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9936" PostTypeId="1" CreationDate="2014-01-13T02:51:54.573" Score="6" ViewCount="1141" Body="&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; Is there any open-source project/library, which can act as a &quot;local exchange&quot; for agents (algorithms), running on the same computer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Clarification:&lt;/strong&gt; by &quot;local exchange&quot; I mean, that the agents, who have the accounts on this exchange are &quot;algorithms&quot;, running on the same computer. That is, in this question I don't speak about creation of any exchange market for other people or companies to trade on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To clarify I will provide a couple of use-cases and a set desirable features. In what follows, the Exchange library stays for the hypothetical library I want to find.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Use-case 1: trading system&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Imagine, that you have 4 algorithms, which could manage a certain amount of money on stock exchange market and (hopefully) generating some profit. Say you have 4000 Tögrögs and you want to reduce risks by diversification: you want to give 1000 Tögrögs to each algorithm, so if one fails, the most you can loose is 1000 Tögrögs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Imagine, you have a stock exchange broker and you opened one account with it. You don't want to open 3 more accounts (e.g. because this would be too expensive for you). Instead, you want each of 4 algorithms to have a virtual account in the Exchange library, so they could send their orders to the Exchange library, and the library would&#xA;1. check if the account contains enough money; 2. if it does, forward the orders to the exchange market; 3. cancel the buying and selling orders between the accounts, when possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I started by saying, that the purpose of this scheme is diversification. However, there are 3 additional benefits:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Providing a unified interface to the trading algorithms: of course, you need to deal with API of the broker to submit the trades. But in the scheme above, you need to do it once by writing a gateway for the Exchange library, instead of thinking about API while implementing each of 4 algorithms.&lt;/li&gt;&#xA;&lt;li&gt;Local cancellation of orders allows for otherwise impossible trades. Imagine, for example, that algorithm A wants to pay 10.00 Tögrögs for one stock WWD of the corporation &quot;Worldwide&quot;. However the broker has a commission of 0.10 Tögrögs, so the Exchange library obtains an order and puts the BUY order at 9.90 Tögrögs (so if the order is matched, the total amount paid will be 10.00 = 9.90 + 0.10 commission). However it puts a BUY order at the price 10.00 to the &quot;local&quot; market. Later on, while order was not matched, algorithm B decides to sell 1 stock WWD at 9.95. Given commission, the SELL order could be sent to the broker only at 10.05 or higher, but the order can be locally cancelled with the order of algorithm A immediately.&lt;/li&gt;&#xA;&lt;li&gt;Trades of otherwise untradeable pairs. Imagine, algorithm A decides, that one stock of WWD is worth 25 Lunar Dollars, but it is traded only in Tögrögs (with a current price of 10.00). While you don't have access to any gateway, that could exchange Tögrögs to lunar dollars, algorithm D has 30 Lunar Dollars and is happy to exchange them to 10 Tögrögs. This trade was submitted to the Exchange library, but couldn't be forwarded anywhere. Given that algorithm A decides to exchange 1 stock of WWD to 10 Tögrögs, and then exchange 10 Tögrögs to 30 Lunar Dollars by matching D's order, generating an (assumed) profit of 5 Lunar Dollars.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Use-case 2: economic hypothesis testing&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Imagine, you want to observe a phenomena, that if agents follow a certain strategy, market goes through 30-year cycles. You decide to model it on your computer. You implement a simplistic model, in which there are 7 types of goods and 10000 agents, which can buy, sell, produce and consume them. What you need is a marketplace, where buyers and sellers can meet. You could use the Exchange library as such a marketplace and have 10000 accounts for the agents and no external gateways. You could then run the experiment, plot the prices and check, if the phenomena can be observed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Desirable features&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Two interfaces.&lt;/strong&gt; The library should have an interface for interaction with agents (accounts), as well as an interface for interaction with external world (gateways). There should be a possibility to have multiple accounts and multiple gateways.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Local exchange.&lt;/strong&gt; The Exchange library should implement local &quot;marketplace&quot;, where agents could exchange goods/stocks/currencies.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Flexibility of gateways.&lt;/strong&gt; E.g. if API's of two brokers allow automatic transfer of stocks between them, there should be a way to add this procedure as a gateway.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Scalability.&lt;/strong&gt; There should be a simple way to write the algorithms for the agents in C++, as it allows for efficient complex processing of Gigabytes of data. On the other hand, one should be able to implement simple agents with small amount of code.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Linux.&lt;/strong&gt; One should be able to run the programs, written using the Exchange library on Linux, because both servers and computers, used for heavy computations, use Linux.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Reliability.&lt;/strong&gt; E.g. while a transaction can fail for objective reasons, it should never happen twice. Some transactions (e.g. transfer of funds between brokers) could take as long as a week, so the fact, that a transaction is ongoing, shouldn't prevent us from shutting down the application and starting it later on with the same state. There should be a way to recover from crashes.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Async/efficiency.&lt;/strong&gt; E.g. while waiting for a response from one gateway, the library shouldn't become unresponsive or slow down processing of unrelated transactions.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Extended question:&lt;/strong&gt; It feels to me, that this is a very natural library to write. That's why I'm asking if anyone have done at least something similar. It feels I'm inventing a bicycle, and there even if this wasn't implemented yet, there are at least things I could start with and add my own code on top. If not, I would like to know, why, because this would probably mean, that people think differently, than I am, and may be I'm missing something. So the extended question is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there something similar to the library I've described above, and if there isn't, then why?&lt;/p&gt;&#xA;" OwnerUserId="6966" LastEditorUserId="6966" LastEditDate="2014-01-13T08:45:53.540" LastActivityDate="2014-01-13T16:44:59.707" Title="Is there any open-source library, implementing &quot;exchange&quot; to be used for algorithms running on the same computer?" Tags="&lt;programming&gt;&lt;risk-management&gt;&lt;software&gt;&lt;diversification&gt;&lt;exchange&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9938" PostTypeId="2" ParentId="9936" CreationDate="2014-01-13T09:07:34.650" Score="8" Body="&lt;p&gt;There is the &lt;a href=&quot;https://code.google.com/p/hudson/&quot; rel=&quot;noreferrer&quot;&gt;Hudson C++ trading simulation library&lt;/a&gt; on google code. Hudson is free and open-source under the GNU GPL v3. It also contains functionality for computing statistics and tools for integration with your trading strategy implementation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the website&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Hudson calculates various statistics, including compound annualized growth rate, % winners/losers, realized drawdown, position excursion analysis, month-to-month returns, Sharpe ratio and geometric standard deviation of monthly returns. The report statistics are easily extensible by inheriting from the Report class and adding your own calculation based on recorded transactions and historical data. The trader API supports backtesting of any custom long/short trading strategy, such as portfolio backtesting of multiple symbols, pairs-trading and spread-trading strategies. For a spread trading example, check the January trader (JanTrader). This class implements a trading strategy analyzing the seasonal microcap effect that occurs around the end of the year.&#xA;  The Asset Allocator example (AATrader) evaluates the performance of 5 asset classes (World Equities, SP500, Commodities, US Bonds and REIT) on a monthly basis and make allocation decisions based on each index SMA.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerDisplayName="user1157" LastEditorDisplayName="user1157" LastEditDate="2014-01-13T16:44:59.707" LastActivityDate="2014-01-13T16:44:59.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9940" PostTypeId="2" ParentId="9935" CreationDate="2014-01-13T15:27:29.260" Score="2" Body="&lt;p&gt;For a single day as long as $K(t+1)$ includes the intraday cash flows it is the same, however if you do not simulate your cash balance interest rate you forget that your cash get compounded over time, which is slightly incorrect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is why someone suggested you simulate your cash balance. This is more correct as well if you are not always 100% invested or if you have access to leverage as you get interest or get charged for being in credit/debit.&lt;/p&gt;&#xA;" OwnerUserId="2908" LastEditorUserId="848" LastEditDate="2014-01-14T06:28:05.883" LastActivityDate="2014-01-14T06:28:05.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9941" PostTypeId="2" ParentId="9935" CreationDate="2014-01-13T20:38:25.227" Score="4" Body="&lt;p&gt;I would absolutely use a mark-to-market value in your daily pnl for the purposes of evaluating performance (e.g. Sharpe). So, yes, that would include the value of open positions in addition to your cash balance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you hold something for a year, that performance was earned one day at a time, not all at once. If you only look at cash, you will have a large cash flow when you exit a position, and that will overstate the volatility of your returns. The difference in standard deviation between [0,0,0,0,0,0,0,0,99] vs [11,11,11,11,11,11,11,11,11] is significant, even though they total the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The effect of interest might be relevant (as BlueTrin as suggested), but is secondary to the importance of using mark-to-market.&lt;/p&gt;&#xA;" OwnerUserId="5550" LastActivityDate="2014-01-13T20:38:25.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9942" PostTypeId="2" ParentId="9931" CreationDate="2014-01-13T20:54:59.370" Score="1" Body="&lt;p&gt;There is no advantage to spreading your entry into multiple tranches, unless you have private information (i.e. not priced-in to the market) that prices will fall first, before rising. If the security is following a random walk, with each incremental return being independent, it doesn't matter whether the price has risen or fallen since t=0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think you should look at each day's return (or whatever sub-increment you wish to use) as an independent investment. On each day, your total return is that day's return times the amount of invested capital on-or-before that day. If you think that there is a positive expectation -- that prices will on average rise for each of these days -- then you should invest all capital at t=0. Any capital not invested at t=0 is forgoing a day's worth of that expected return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While you were focused only on expected return, the answer doesn't change when you look at a risk-adjusted metric like Sharpe. You are building a portfolio of 1-day returns. If they all have the same expected return, and all have the same expected volatility, and all are independent, then an efficient portfolio is an equal weighting of all days. I.e., invest it all at t=0.&lt;/p&gt;&#xA;" OwnerUserId="5550" LastActivityDate="2014-01-13T20:54:59.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9944" PostTypeId="1" CreationDate="2014-01-14T12:44:36.610" Score="1" ViewCount="107" Body="&lt;p&gt;I would like to confirm the way to counting number of weeks for calculating historical weekly volatility in Bloomberg. Given an option with issue date from 14/1/2014 to 13/1/2019, is the proper way to count the number of week by using excel function,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ROUNDUP((13/1/2019 - 14/1/2014)/7,0)+1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for the purpose of calculating historical volatility based on term-matching principle. Is there any reference to describe the way to count the number of weeks for the purpose of calculating historical volatility based on term-matching principle?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="6119" LastActivityDate="2014-01-14T12:44:36.610" Title="Clarifying the way in counting number of weeks for calculating historical weekly volatility in Bloomberg" Tags="&lt;volatility&gt;&lt;bloomberg&gt;&lt;excel&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9946" PostTypeId="2" ParentId="9929" CreationDate="2014-01-14T22:10:14.510" Score="2" Body="&lt;p&gt;Black-Scholes is just a model that tries to replicate what the market is doing. Unfortunately, any theoretical estimate of volatility (that is not the implied) that you come up with will be wrong. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, you don't want to use historical volatilities at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only correct volatility to use is the IMPLIED VOLATILITY.  And the reason why it works is because it is designed to be the one that makes the model work. (sounds redundant, but this is why it's called implied... the one Implied by the model)&lt;/p&gt;&#xA;" OwnerUserId="6746" LastActivityDate="2014-01-14T22:10:14.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9947" PostTypeId="2" ParentId="9701" CreationDate="2014-01-14T23:40:36.213" Score="0" Body="&lt;p&gt;I don't think a linear interpolation is performed. The fact that the interpolated value is higher than a linear model suggest a concave function. I performed an experiment with the Nelson-Siegel interpolation model using your data. I put the data in a csv file and ran the following code (Book2.csv) is my data and the exercise was performed on R&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library('YieldCurve')&#xA;a &amp;lt;- read.csv(&quot;../Book2.csv&quot;)&#xA;matur &amp;lt;- a[,1]&#xA;rate.corporate &amp;lt;- t(matrix(a[, 2], dimnames = list(paste(&quot;M&quot;, c(1:dim(a)[1])) ,&quot;2013-11-    18&quot;)))&#xA;r.corp.xts &amp;lt;- as.xts(rate.corporate, descr='xts from matrix')&#xA;NSpars &amp;lt;- Nelson.Siegel(rate=r.corp.xts, maturity=matur)&#xA;NSrates(NSpars,2.826)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And the answer was 5.905% which is still short of the 6+% answer that bloomberg gives you, but higher than linear.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you just have to find out what methodology is used by bloomberg. Cubic splines, nelson-siegel, etc.&lt;/p&gt;&#xA;" OwnerUserId="6746" LastActivityDate="2014-01-14T23:40:36.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9948" PostTypeId="1" CreationDate="2014-01-15T08:07:15.253" Score="4" ViewCount="391" Body="&lt;p&gt;What nonparametric &quot;Model Free&quot; methods exist to measure intraday seasonality? I would like to estimate intraday seasonality in any of&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The volatility &lt;/li&gt;&#xA;&lt;li&gt;The traded volume&lt;/li&gt;&#xA;&lt;li&gt;The bid ask spread&lt;/li&gt;&#xA;&lt;li&gt;or something as esoteric as the rate of orders with a frequency higher than a specified threshold.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;One approach that I was going to explore was time series or sequential clustering followed by transition probability estimation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for your time&lt;/p&gt;&#xA;" OwnerUserId="5456" LastEditorUserId="2299" LastEditDate="2014-05-04T16:55:20.513" LastActivityDate="2014-05-04T16:55:20.513" Title="What nonparametric methods exist for estimating intraday seasonalities?" Tags="&lt;market-microstructure&gt;&lt;estimation&gt;&lt;intraday&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9949" PostTypeId="1" CreationDate="2014-01-15T09:46:26.637" Score="0" ViewCount="160" Body="&lt;p&gt;PCA seems to be very popular in dimension reduction applications and for extracting the top PCs which explain the data. One such application in futures is on the term structure to obtain the level, slope and curvature components. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, since the sign of the PCs can be anything(because +EigenVector and -EigenVector are both valid solutions), how do we infer anything about the slope of the term structure by using the slope PC? The slope could be either positive or negative since the sign of PC is not significant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I handle this sign issue when working with PCA?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="1926" LastActivityDate="2014-01-15T10:17:09.730" Title="Inferring signals in absence of sign of principal components (PCA)?" Tags="&lt;futures&gt;&lt;pca&gt;&lt;term-structure&gt;&lt;principal-components&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9950" PostTypeId="2" ParentId="9949" CreationDate="2014-01-15T10:17:09.730" Score="1" Body="&lt;p&gt;A PCA explains the variation in data. A slope PC is usually identified by the pattern of the signs of the loadings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the loadings of short term contracts have the same sign which is different from the sign of the loading of longer term contracts then such a PC is identified as slope PC.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It means that if this PC goes up or down it affects short term contracts in the opposite way to long tgerm contracts. The sign is irrelevant as this holds for up and down moves.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-01-15T10:17:09.730" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="9951" PostTypeId="1" CreationDate="2014-01-15T11:11:28.683" Score="0" ViewCount="56" Body="&lt;p&gt;What does rational expectation (RE) mean in agent-based modeling context? What are the relationships between RE and expectation and outcome? &lt;/p&gt;&#xA;" OwnerUserId="6985" LastEditorUserId="16595" LastEditDate="2018-07-31T05:07:07.947" LastActivityDate="2018-07-31T05:07:07.947" Title="Rational expectation meaning" Tags="&lt;expected&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9952" PostTypeId="2" ParentId="9929" CreationDate="2014-01-15T14:12:05.940" Score="4" Body="&lt;p&gt;Two parts&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Real world vs risk neutral&lt;/strong&gt;: Can we even estimate risk neutral volatility using historical data? There is a difference in distribution of the underlying stock price under the real world and risk neutral measures. Luckily, changing to the risk neutral measure &lt;em&gt;does not affect volatility, only the drift&lt;/em&gt;. Thus, a real world measure of volatility will properly estimate the risk neutral volatility. In the BS framework, we assume that the stock price is an Ito drift diffusion process with constant coefficients. In equations;&#xA;$$S_t = S_0 \exp\{(\mu - \sigma^2/2)t + \sigma W_t\} = S_0 \exp\{(r - \sigma^2/2)t + \sigma (W_t - \frac{\mu - r}{\sigma}t)\} \\&#xA;= S_0 \exp\{(r - \sigma^2/2)t + \sigma W_t^\star\} $$&#xA;see that volatility is the same when writing the equation for stock price in real world or risk neutral. &lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Estimation&lt;/strong&gt;: There is more good news, if you look into &lt;em&gt;Statistical Inference&lt;/em&gt; by Casella and Berger you may find that given any function $f$, and any maximum likelihood estimator $\hat\Theta$ that the maximum likelihood estimator $\widehat{f(\Theta)}$ is exactly $f(\hat\Theta)$ this is sometmies referred to as &quot;plug-in-principal of MLE&quot;. Thus when you are plugging in your MLE estimate $\hat\sigma^2$ into the BS formula in this case taking the place of $f$ &lt;em&gt;you're still obtaining the MLE&lt;/em&gt;. Because it is the MLE, we also know that it attains the cramer rao lower bound on variance asymptotically! Still more good news, we can introduce (asymptotic) pricing confidence intervals into our analysis by simply using the &lt;a href=&quot;http://en.wikipedia.org/wiki/Delta_method#Univariate_delta_method&quot; rel=&quot;nofollow&quot;&gt;delta method&lt;/a&gt;  approximation of variance for an estimator! &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="4910" LastEditorUserId="4910" LastEditDate="2014-01-22T17:25:51.453" LastActivityDate="2014-01-22T17:25:51.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9954" PostTypeId="2" ParentId="1207" CreationDate="2014-01-15T15:05:38.230" Score="0" Body="&lt;p&gt;ycharts is a reliable source for historical eps and other balance sheet stats (i.e. a/r, capex) but data beyond five years back requires a subscription.&lt;/p&gt;&#xA;" OwnerUserId="6989" LastActivityDate="2014-01-15T15:05:38.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9955" PostTypeId="2" ParentId="9562" CreationDate="2014-01-15T17:03:59.270" Score="5" Body="&lt;p&gt;Hum, &#xA;that's one of the most important questions in financial engineering, that why no answer is proposed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have available data as option prices, you may calibrate a parametric EMM but nothing can tell that it's the best EMM (cause there is no best EMM). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So make a choice and defend your choice by saying 'it's simple and allows beautiful result' like every body use to do.&lt;/p&gt;&#xA;" OwnerUserId="6990" LastActivityDate="2014-01-15T17:03:59.270" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9956" PostTypeId="2" ParentId="9948" CreationDate="2014-01-15T17:06:02.440" Score="2" Body="&lt;p&gt;What is your objective? There are many approaches that can accomplish this in broad terms but whether it is sensible depends on your application.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example if you are interested in intraday breaks in the levels process you can look at OLS with a priori indicator function breaks, or perhaps a univariate Kalman filter with a stochastic slope coefficient specified as a random walk process (or close to it, as long as it isn't explosive). You want a mean reverting element so, for the bid ask spread at least, you could do a stochastic vector error correction model where various parameters can be time-adjusting intraday according to polynomial kernels, since 2011 this is an active area of research. Each equation's dependent variable is the log-change in the bid and offer levels, respectively - look at Engle's writings in early 2000s for a static version which you will need to extend yourself to be time-varying. This is simple since by the assumption of a unit cointegrating vector we are able to estimate each equation with OLS, thus a Kalman Filter application is easy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For volatility you could consider the GARCH family with the parameters as time-varying, or with dummy variables in the variance equation. For the non-parametric approach that you desire you could look at wavelet volatility which is varying intraday in both the time and frequency domains.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to measure seasonality in the correlation dynamics there are various methods. If you sample data in bars and not at ticks (since numerical optimisation of MLE is extremely tedious for more than 2000 rows), you can use parametric or non-parametric stochastic copulas (non-Gaussian) such as the symmetrized Joe-Clayton copula. This presumes that both the intraday linear correlation and asymptotic tail correlations (as well as all quantile correlations over the reals) are time-varying. If you are primarily interested in correlation that is only sensitive to monotone relations, you can do an integral transform on this parameter and recover the time-varying kendall tau or spearman rho. Again for the non-parametric version there are various filters from signal processing to efficiently evaluate dynamic correlations, and you can also investigate time-dynamic wavelet phase-differencing through an inverse tangent transform of the real and imaginary coefficients as well as wavelet covariation - mostly if you are also interested in intraday frequency-domain shifts in the correlations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For other approaches you should view the econophysics literature which is quite big in this kind of pattern mining. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I struggle to see how this could be useful apart from an empirical/science perspective. Perhaps if you are liquidating, I can understand this analysis.&lt;/p&gt;&#xA;" OwnerUserId="6081" LastActivityDate="2014-01-15T17:06:02.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9957" PostTypeId="1" AcceptedAnswerId="9959" CreationDate="2014-01-15T18:28:18.977" Score="0" ViewCount="148" Body="&lt;p&gt;How does a cross trade pose a disadvantage to the retail client. In this &lt;a href=&quot;http://www.wisegeek.com/what-is-a-cross-trade.htm&quot; rel=&quot;nofollow&quot;&gt;explanation&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It says:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;This opens the door for one or both parties to not receive the best price for either portion of the dual transaction&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If broker A is buying and broker B is selling and the trade is not recorded in the exchange, then how does it affect the retail investor? If the trade does  not record in the exchange, will the trade still affect the price?&lt;/p&gt;&#xA;" OwnerUserId="218" LastEditorUserId="2299" LastEditDate="2014-01-15T21:45:52.400" LastActivityDate="2014-01-15T21:45:52.400" Title="How does a cross trade pose a problem to the retail investor" Tags="&lt;market-microstructure&gt;&lt;order-execution&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9958" PostTypeId="2" ParentId="9948" CreationDate="2014-01-15T21:32:39.570" Score="2" Body="&lt;p&gt;It could be useful for optimal trading to have accurate estimates of the intraday seasonalities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Seasonalities come from a mix of:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;rythms (for instance European curves are impacted by US open and news announces)&lt;/li&gt;&#xA;&lt;li&gt;events (news)&lt;/li&gt;&#xA;&lt;li&gt;market design (proximity of fixing auctions)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;From an estimation viewpoint, you see that the more you can take these effects into account (to be able to remove/add them), the better.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you removed what you could, I guess that a good judge is the predictive capability of your model. Of course it means it is easier on variables that are &lt;em&gt;less path dependant&lt;/em&gt; that others (like volumes that are less path dependant than volatility).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/G2iIs.png&quot; alt=&quot;Worldwide volume seasonalities&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just as an illustration, here is the &lt;strong&gt;worldwide volume seasonalities&lt;/strong&gt; extracted from &lt;a href=&quot;http://www.worldscientific.com/worldscibooks/10.1142/8967&quot; rel=&quot;nofollow noreferrer&quot;&gt;Market Microstructure in Practice&lt;/a&gt; (Part 2.1.2).&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2014-01-15T21:32:39.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9959" PostTypeId="2" ParentId="9957" CreationDate="2014-01-15T21:44:30.190" Score="1" Body="&lt;p&gt;I guess this remark refers mainly to &quot;penny stocks&quot;. In the US (it is not true in Europe where crossing is far more regulated) it may be possible to choose to cross at any point inside the bid-ask spread. It means that if it is closer to the bid than to the ask, it will advantage the buyer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;a href=&quot;http://www.citeulike.org/user/lehalle/article/11101402&quot; rel=&quot;nofollow&quot;&gt;Sub Penny Trading in US Equity Markets&lt;/a&gt; (by Romain Delassus, Stéphane Tyc), this point is discussed in detail.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2014-01-15T21:44:30.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9960" PostTypeId="1" CreationDate="2014-01-15T23:02:35.190" Score="11" ViewCount="3538" Body="&lt;p&gt;I have read that the Sharpe ratio imposes a normality assumption, but I fail to see how. Standard deviation is statistic for any type of distribution. Anyone have any ideas? &lt;/p&gt;&#xA;" OwnerUserId="6997" LastEditorUserId="2379" LastEditDate="2014-01-16T05:12:40.183" LastActivityDate="2017-04-05T03:03:36.203" Title="Normality assumption in Sharpe ratio" Tags="&lt;statistics&gt;&lt;sharpe-ratio&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9961" PostTypeId="2" ParentId="9960" CreationDate="2014-01-16T03:48:28.187" Score="16" Body="&lt;p&gt;You are correct that you can compute Sharpe ratios on portfolios with any return distribution.  The issue is comparing Sharpe ratio's of non-normally distributed portfolios (which in reality is almost &lt;a href=&quot;http://www.edge.org/response-detail/25401&quot;&gt;any&lt;/a&gt; portfolio).  To take an extreme example.  Consider two portfolios, with returns in excess of benchmark.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;50% chance of 10% return, 50% chance of a 20% return&lt;/li&gt;&#xA;&lt;li&gt;50% chance of 10% return, 50% chance of a 100% return&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The Sharpe ratios are&#xA;$$&#xA;1. \frac{0.5 \cdot 0.1 + 0.5 \cdot 0.2}{\sqrt{0.5 (0.1 - 0.15)^2 + 0.5 (0.2 - 0.15)^2}} = 3 \\&#xA;2. \frac{0.5 \cdot 0.1 + 0.5 \cdot 1}{\sqrt{0.5 (0.1 - 0.55)^2 + 0.5 (1 - 0.55)^2}} \approx 1.22&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Portfolio 2 clearly dominates portfolio 1, but its Sharpe ratio is much lower.&lt;/p&gt;&#xA;" OwnerUserId="1418" LastEditorUserId="2727" LastEditDate="2014-01-16T09:37:08.987" LastActivityDate="2014-01-16T09:37:08.987" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9962" PostTypeId="2" ParentId="2019" CreationDate="2014-01-16T07:10:16.793" Score="3" Body="&lt;p&gt;Some more references. Here are three starting books:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;for generic knowledge: &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0521819164&quot; rel=&quot;nofollow&quot;&gt;Theory of Financial Risk and Derivative Pricing: From Statistical Physics to Risk Management&lt;/a&gt;, by Bouchaud and Potters;&lt;/li&gt;&#xA;&lt;li&gt;for risk + statistical approach: &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/3642009646&quot; rel=&quot;nofollow&quot;&gt;Risk and Asset Allocation&lt;/a&gt;, by Meucci;&lt;/li&gt;&#xA;&lt;li&gt;for microstructure: &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/9814566160&quot; rel=&quot;nofollow&quot;&gt;Market Microstructure in Practice&lt;/a&gt;, by Lehalle and Laruelle.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2014-01-16T07:10:16.793" CommentCount="0" CommunityOwnedDate="2014-01-16T07:10:16.793" ContentLicense="CC BY-SA 3.0" />
  <row Id="9966" PostTypeId="1" AcceptedAnswerId="9967" CreationDate="2014-01-16T17:23:06.640" Score="1" ViewCount="2491" Body="&lt;p&gt;Is there a difference between a crossing network and an ECN? The wikipedia &lt;a href=&quot;http://en.wikipedia.org/wiki/Crossing_network&quot; rel=&quot;nofollow&quot;&gt;page&lt;/a&gt; for Crossing Network says that ECN is a type of crossing network. But crossing network has the smell of a semi-legal practice while ECN is perfectly legal. So what is the difference&lt;/p&gt;&#xA;" OwnerUserId="218" LastEditorUserId="2299" LastEditDate="2014-01-16T19:39:52.893" LastActivityDate="2014-01-18T09:03:32.697" Title="Is there a difference between crossing network and ECN" Tags="&lt;market-microstructure&gt;&lt;electronic-trading&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9967" PostTypeId="2" ParentId="9966" CreationDate="2014-01-16T19:50:01.860" Score="2" Body="&lt;p&gt;ECN is a &lt;strong&gt;regulatory status&lt;/strong&gt; in the US, like MTF (Multilateral Trading Facility), and soon OTF (Organized Trading Facility) are in Europe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;&lt;em&gt;Crossing network&lt;/em&gt;&quot; is a generic term used to describe a pool where brokers cross orders of their clients. The broker can choose to apply or not for the ECN (or MTF) status. On the one hand it is more &quot;transparent&quot; for users, on the other hand once it is regulated it is often easier for the broker to cross orders without asking for too explicitly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It it thus not that obvious. Moreover you can ask the rulebook of its crossing engine to your broker and choose another one if you are not happy with it. Regulated pools nevertheless often offer guarantees for clearing (do your broker is his own clearer in its crossing network? oops).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Europe with the &lt;a href=&quot;http://europa.eu/rapid/press-release_MEMO-14-15_en.htm&quot; rel=&quot;nofollow&quot;&gt;just issued new version of MiFID&lt;/a&gt;, all pools will have to be regulated (but that's why OTF are created, they are not that constraining, but they will not be allowed on equities).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way &quot;&lt;strong&gt;Dark pool&lt;/strong&gt;&quot; is a generic term too. You have similarly regulated or not dark pools, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Update&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Reporting: in Europe, trades in MTF have to be reported; in the US, &lt;a href=&quot;http://www.finra.org/Industry/Regulation/Guidance/p038942#306&quot; rel=&quot;nofollow&quot;&gt;it seems to be the case&lt;/a&gt; for ECN trades.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2014-01-18T09:03:32.697" LastActivityDate="2014-01-18T09:03:32.697" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9968" PostTypeId="1" AcceptedAnswerId="9969" CreationDate="2014-01-16T21:08:08.443" Score="2" ViewCount="1007" Body="&lt;p&gt;Are there any free online liquidity seeking algorithms? Possible an open source implementation? Not looking for anything state-of-the-art, but just to get an idea how they work.&lt;/p&gt;&#xA;" OwnerUserId="218" LastEditorUserId="2299" LastEditDate="2014-01-16T21:28:46.157" LastActivityDate="2017-08-15T15:03:20.630" Title="Liquidity seeking algorithms open source implementation" Tags="&lt;market-microstructure&gt;&lt;algorithmic-trading&gt;&lt;liquidity&gt;&lt;order-execution&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9969" PostTypeId="2" ParentId="9968" CreationDate="2014-01-16T21:18:32.793" Score="5" Body="&lt;p&gt;In the paper &lt;a href=&quot;http://epubs.siam.org/doi/abs/10.1137/090780596&quot; rel=&quot;noreferrer&quot;&gt;Optimal split of orders across liquidity pools: a stochastic algorithm approach (2011)&lt;/a&gt; we present the theoretical aspect of liquidity seeking, thus you will learn how they work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a seminal (once again) &lt;a href=&quot;http://www.streambase.com/wp-content/uploads/downloads/StreamBase_White_Paper_Smart_Order_Routing_low.pdf&quot; rel=&quot;noreferrer&quot;&gt;white paper by Robert Almgren on iceberg chasing&lt;/a&gt; that is very informative too.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2014-01-16T21:18:32.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9970" PostTypeId="2" ParentId="9911" CreationDate="2014-01-16T22:08:23.117" Score="24" Body="&lt;p&gt;My two favorites books on microstructure are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Barry Johnson's &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0956399207&quot; rel=&quot;noreferrer&quot;&gt;Algorithmic Trading and DMA&lt;/a&gt; - very good on technological aspects and for an overview of needed implementations;&lt;/li&gt;&#xA;&lt;li&gt;L and Laruelle's &lt;a href=&quot;http://www.worldscientific.com/worldscibooks/10.1142/8967&quot; rel=&quot;noreferrer&quot;&gt;Market Microstructure in Practice&lt;/a&gt; - for common knowledge and understanding of market microstructure and its mechanisms.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Recently, three new books have been published:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.crcpress.com/The-Financial-Mathematics-of-Market-Liquidity-From-Optimal-Execution-to/Gueant/p/book/9781498725477&quot; rel=&quot;noreferrer&quot;&gt;The Financial Mathematics of Market Liquidity: From Optimal Execution to Market Making&lt;/a&gt;, by Olivier Guéant - useful for optimal trading in practice, to be read by quants.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.cambridge.org/fr/academic/subjects/mathematics/mathematical-finance/algorithmic-and-high-frequency-trading?format=HB&amp;amp;isbn=9781107091146#mofWFcFCJpTFs4iK.97&quot; rel=&quot;noreferrer&quot;&gt;Algorithmic and High-Frequency Trading&lt;/a&gt;, by A. Cartea, S. Jaimungal, and J Penalva - useful for a stochastic-control oriented on different optimal trading frameworks, to be read be researchers starting in the domain.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.crcpress.com/Quantitative-Trading-Algorithms-Analytics-Data-Models-Optimization/Guo-Lai-Shek-Wong/p/book/9781498706483&quot; rel=&quot;noreferrer&quot;&gt;Quantitative Trading: Algorithms, Analytics, Data, Models, Optimization&lt;/a&gt;, by Xin Guo, Tze Leung Lai, Howard Shek, Samuel Po-Shing Wong - for a generic overview (including software programming) of automated trading.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;On the theoretical (economical) aspect, you have two good books:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Vives' &lt;a href=&quot;http://www.amazon.fr/Information-Learning-Markets-Impact-Microstructure/dp/0691145962/&quot; rel=&quot;noreferrer&quot;&gt;Information and Learning in Markets - The Impact of Market Microstructure&lt;/a&gt; - for a theoretical overview;&lt;/li&gt;&#xA;&lt;li&gt;Foucault et al.'s &lt;a href=&quot;http://www.amazon.fr/Market-Liquidity-Theory-Evidence-Policy/dp/0199936242/&quot; rel=&quot;noreferrer&quot;&gt;Market Liquidity: Theory, Evidence, and Policy&lt;/a&gt; - more focussed on recent evolutions.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In terms of skills, you need to be able to learn statistics, (stochastic) control and optimization. That for I would consider to read:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Meucci's &lt;a href=&quot;http://www.amazon.fr/Risk-Asset-Allocation-Attilio-Meucci/dp/3642009646/&quot; rel=&quot;noreferrer&quot;&gt;Risk and Asset Allocation&lt;/a&gt; - of course it is not written explicitly for microstructure, but if I had to learn from scratch multivariate statistics for financial markets, I will definitely use this one.&lt;/li&gt;&#xA;&lt;li&gt;you should take a book on stochastic control, take the one you want, but frankly my favorite is Soner's &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0387260455&quot; rel=&quot;noreferrer&quot;&gt;Controlled Markov Processes and Viscosity Solutions&lt;/a&gt;. It may be too theoretical for what you need to control a trading algorithm, but it may be the occasion to read a good book on control.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2017-08-20T20:02:19.350" LastActivityDate="2017-08-20T20:02:19.350" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9971" PostTypeId="2" ParentId="613" CreationDate="2014-01-17T00:03:10.857" Score="1" Body="&lt;p&gt;At least for daily data: if you can afford to replace holes in your data by lines with N/A values (e.g. null), a possible approach is to simply store the date of the first row as a comment in your file, and then deterministically compute the date of any other row using its offset to the first row.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A key benefit is being able to use such a file as a time-indexed memory-mapped file (no need to load into memory), without involving a hashmap. Works like a charm (I implemented it in C#).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a great, R-compatible (among others), memory-mapped file implementation, I can highly recommend &lt;a href=&quot;http://discretelogics.com/teafiles/&quot; rel=&quot;nofollow&quot;&gt;TeaFiles&lt;/a&gt; (free an open source).&lt;/p&gt;&#xA;" OwnerUserId="1187" LastEditorUserId="1187" LastEditDate="2014-01-17T10:13:01.030" LastActivityDate="2014-01-17T10:13:01.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9972" PostTypeId="2" ParentId="7169" CreationDate="2014-01-17T02:40:13.417" Score="7" Body="&lt;p&gt;Not sure about all of the complicated math and programming above, but I can tell you that, if you want to calculate for 1 Standard Deviation from the current stock price X days away, the following calculation will give you a +/- value from the current stock price.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 StdDev Move = (Stock Price X Implied Volatility X the Square Root of 'how many days') all divided by the Square Root of 365.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Add this value to the stock price for the Upper Range and subtract it for the Lower Range.  This will be 68% of the expected range (which is what is considered the normal move for a stock most of the time - 1 Standard Deviation).  &lt;/p&gt;&#xA;" OwnerUserId="7006" LastActivityDate="2014-01-17T02:40:13.417" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9973" PostTypeId="2" ParentId="1343" CreationDate="2014-01-17T06:37:27.620" Score="1" Body="&lt;p&gt;Measuring liquidity is a key problem in market risk management, it is probably due to its multi-dimension property (tightness, depth and resiliency.). Loosely speaking , market liquidity refers to the ease with which an asset can be traded. It should be distinguish from funding liquidity which refers to the ability to fulfill its commitments. Regarding market liquidity: There are several metrics available to measure it but, as far i read, no one reach a consensus . Some are based on intraday data (contents of the book order ..) but most parts of metrics are based on daily data (prices returns). &#xA;We can distinguish three mains types of liquidity metrics depending’s if they are focus on the quantity (turnover ratio,volume..) , the volume/return relation (volume to return ratio, Amivest metric, ) or more on the tightness dimension (bid ask spread based metrics). &#xA;Liquidity literature is very large, I recommend you these authors: Chordia , Subrahmanyam , Brunnermeier, and Amihud.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rfs.oxfordjournals.org/content/22/6/2201&quot; rel=&quot;nofollow&quot;&gt;http://rfs.oxfordjournals.org/content/22/6/2201&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2014-01-17T06:37:27.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9974" PostTypeId="2" ParentId="2019" CreationDate="2014-01-17T07:57:41.140" Score="2" Body="&lt;p&gt;I recommend to you : &quot;Market Risk Analysis&quot; by Alexander Carol for the &quot;finance&quot; part and &quot;Time Series Analysis&quot; by Hamilton for the &quot;maths/stats&quot; part; &lt;/p&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2014-01-17T07:57:41.140" CommentCount="0" CommunityOwnedDate="2014-01-17T07:57:41.140" ContentLicense="CC BY-SA 3.0" />
  <row Id="9975" PostTypeId="1" AcceptedAnswerId="10020" CreationDate="2014-01-17T09:45:57.603" Score="11" ViewCount="891" Body="&lt;p&gt;I am trying to price an option on the Spanish CPI. The option is a European call with a single observation date. However, I am fairly new to inflation modelling, so there are two areas in which I would greatly appreciate any insights:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Market data&lt;/strong&gt;: I have already retrieved some data on Euro zone inflation swaps. However, I have not been able to recover any volatility information. Are you aware of any instruments that can be used to obtain expected inflation and implied volatilities for the Spanish market? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Modelling framework&lt;/strong&gt;: Given the simplicity of the option (and the potential lack of market data), my initial idea would be to keep things simple and employ a short rate model like &lt;a href=&quot;http://en.wikipedia.org/wiki/Vasicek_model&quot;&gt;Vasicek&lt;/a&gt; or &lt;a href=&quot;http://en.wikipedia.org/wiki/Hull%E2%80%93White_model&quot;&gt;Hull &amp;amp; White&lt;/a&gt;. However, I am not sure if I may be missing any relevant factors by using these models. Do you think this modelling framework could be appropriate in this particular case?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5208" LastEditorUserId="848" LastEditDate="2014-01-17T10:29:33.260" LastActivityDate="2014-01-23T08:17:03.247" Title="Inflation modelling" Tags="&lt;options&gt;&lt;modeling&gt;&lt;inflation&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9976" PostTypeId="1" CreationDate="2014-01-17T14:32:07.477" Score="4" ViewCount="899" Body="&lt;p&gt;After reading a few references here to wavelets, I'm trying to denoise (or at least 'compress') a time-series of forex prices using a Daubechy04 wavelet (forward tranform, 8 most important (in absolute value) coeffients are kept among the 64 values, reverse-transform).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When a down or up trend is occuring, there is a border-effect since the first and last values differ, on the last point (and the first, but that doesn't matter, since it's possible to remove some of the first points).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The wavelet is in &lt;strong&gt;red&lt;/strong&gt;, (in blue, a moving average)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/TpsCr.png&quot; alt=&quot;enter image description here&quot;&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(This happens also, with Discrete Fourier tranform, where I believe it's normal since they assume periodicity)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to diff (&lt;code&gt;b[i] = a[i+1]-a[i]&lt;/code&gt;) then undiff the series before the tranform: terrible results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another try with  &lt;code&gt;b[i] = a[i] - ((a[63]-a[0])/63*i + a[0])&lt;/code&gt; (subtracting the line between the two extremities: better 'visual' result&#xA;&lt;img src=&quot;https://i.stack.imgur.com/XWYqe.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;br&gt;&#xA;but not perfect, several time steps further.. (the end slope is not matching well):&#xA;&lt;img src=&quot;https://i.stack.imgur.com/pQ34k.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm also reading Wavelet thresholding methods, because this idea of relying on a fixed number of coefficients (8) is maybe problematic&lt;/p&gt;&#xA;" OwnerUserId="5625" LastEditorUserId="5625" LastEditDate="2014-04-28T23:30:29.300" LastActivityDate="2015-05-02T00:46:56.383" Title="How to eliminate border effects on Wavelet denoising?" Tags="&lt;wavelet&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9977" PostTypeId="1" AcceptedAnswerId="9978" CreationDate="2014-01-17T23:11:14.773" Score="8" ViewCount="5603" Body="&lt;p&gt;I was reading on the topic, and would like to be sure that my understanding is correct. For the benchmark I would consider American banking system as I've mostly used sources such as FRS and Federal Bank of New York when doing reading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Banks are required to keep some percentage of their deposit money (say, 10%) in vault cash or at Fed. If the bank A does not have enough reserve, it has to borrow it either from another bank B (with an excess reserve) or directly from the Discount Window at Fed. The Discount rate at the latter is usually relatively high as Fed wants banks to borrow from each other, so bank A is likely to make an overnight loan with bank B. The rate at which this loan is made is called Fed Funds Effective Rate (well, the latter is a weighted average of all such rates) which is kept by Fed close to the target Fed Funds Rate by performing Open Market Operations. This is all clear to me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is not that clear are the reasons why some banks would have not enough reserves whereas others will have excess reserves. I guess, at least one reason is the change in the value of deposits: if bank A had 100M in deposits and kept 10M as a reserve, if 2M deposits were withdrawn then it has a reserve of 8M whereas it has to keep 9.8M = 10%$\times $98M reserves, so the bank A needs to get 1.8M somewhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess, there may be another reason which is heterogeneity in the investment opportunities. Suppose, bank A still holds 100M and has 10M in reserves. Now, there appears a very sweet deal which requires investing 1M today to get 2M back at the end of month. If bank A invests this 1M, then it has only 9M as reserves and needs to borrow 1M from somebody else. This somebody else may have excess reserves since such sweet deal was not available to him, it was only available to bank A - otherwise why give 1M to bank A for a fairly little interest, if you can double this money in a month.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My questions are:&lt;/strong&gt; is this second reason underlying interbank lending reasonable? Is it also related to middle-term loans made at LIBOR rate (I don't think they are used just to meet reserve requirements, or are they)? Are there any other common reasons why banks borrow from each other - or equivalently why some banks would like to borrow whereas others would like to lend?&lt;/p&gt;&#xA;" OwnerUserId="464" LastActivityDate="2014-01-23T17:42:20.953" Title="Why banks borrow from each other" Tags="&lt;banks&gt;&lt;libor&gt;&lt;interbank-rates&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="9978" PostTypeId="2" ParentId="9977" CreationDate="2014-01-18T04:25:02.207" Score="6" Body="&lt;p&gt;First point to consider : some banks are by nature &quot;positive&quot; in their account to the central banks , for instance classical saving banks tend to get more deposit than loans; conversely others are more engage in loans activity (investments banks..) and are  by &quot;nature&quot;  borrowers on Interbank markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly (the point you underestimate), mandatory reserves is not the only point, when a bank A lends money to someone it has also a certain percentage of that loan that it has to keep as &quot;capital requirement&quot; ( cf Basel agreements) : it is the main source of central money &quot;leaks&quot;. This capital requirement is much more money's bank central consuming than reserve requirements. That’s the reason why banks borrow each other’s and why central banks have, at the end, the control of the money supply.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NB : In case the bank A lends (pure money creation) a certain amount to, let’s say &quot;M.Doe&quot; , bank A needs to keep a percentage of this amount in capital reserve. Moreover If M.Doe keeps this money in its bank (A) there is no others problems, however if M.Doe use  this money to pay M.H which has an account in another bank (B) then the bank A will have to give central banks money to banks B, and this  a source of liquidity needs. (cf money multiplier)&lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2014-01-18T11:49:18.957" LastActivityDate="2014-01-18T11:49:18.957" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="9979" PostTypeId="2" ParentId="9976" CreationDate="2014-01-18T07:58:19.773" Score="2" Body="&lt;p&gt;What you are after are causal wavelets, which is an approach to wavelet filtering that only takes in present and past data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://soliton.ae.gatech.edu/people/dcsl/papers/aiaa04.pdf&quot; rel=&quot;nofollow&quot;&gt;http://soliton.ae.gatech.edu/people/dcsl/papers/aiaa04.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6081" LastEditorUserId="6081" LastEditDate="2014-01-18T16:17:03.353" LastActivityDate="2014-01-18T16:17:03.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9980" PostTypeId="1" CreationDate="2014-01-18T09:54:06.687" Score="5" ViewCount="355" Body="&lt;p&gt;How would I price an option when the underlying security is unable to trade above a certain price? I assumed this would be as simple as restricting the limits of integration of the PDF to B (the barrier) instead of infinity but it doesn't work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if the present price is 30, the barrier is 40, and the strike is 35 then the option price will never exceed $5. If the strike exceeds the barrier the call option is always worthless.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After 5 days and numerous attempts it works for all all possible prices, barriers and strikes &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Define barrier to be  $p_d$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Strike $p_s$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Present price $p_1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Criteria:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$p_s \le p_b$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if $p_b \le p_s$ the option is worthless&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The barrier has two effects: it makes calls cheaper for all strikes and it can restrict the maximum call price from $p_1$ to something less &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the barrier itself is not a barrier option meaning that the option doesn't become worthless if it's crossed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The maximum call price $m$ is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$m=(p_1-g_1)H(p_1-g_1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$g_1=p_s-\left[(p_d-p_1)+(p_s+p_1-p_d)H(p_d-p_1-p_s)\right]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where H is the heaviside function&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be tested plugging in various barriers, strikes, and initial prices. If $p_1=30,p_s=35,p_d=40$ then $m=5$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, if $p_1 \le p_d-p_s$ then $m=p_1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And otherwise $m=p_d-p_s$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Between the strike and the barrier you have a restricted black-scholes :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$u=\ln(p_1)+(r-\alpha^2/2)t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$a=\sqrt{t}\alpha$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\int_{p_s}^{p_b}{\frac{e^{-rt}(y-p_s)}{ay\sqrt{2\pi}}\exp{\left[-\frac{(\ln(y) - u)^2}{2a^2 }\right]}}\,dy$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As $p_b \to \infty$ you have the classic black-scholes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As $\alpha,r,t \to \infty$ it goes to zero and the maximum theroetical price $m$ takes over. Otherwise the call is somewhere in-between.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Probability of expiring above the barrier:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$N(d_1)=\int_{p_d}^{\infty}{\frac{e^{-rt}}{p_1a\sqrt{2\pi}}\exp{\left[-\frac{(\ln(y) - u)^2}{2a^2 }\right]}}\,dy$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And a probability below it: $1-N(d_1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Evaluating the integrals and substituting:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\begin{align}&#xA;     d_1 &amp;amp;= \frac{1}{\alpha\sqrt{t}}\left[\ln\left(\frac{p_1}{p_d}\right) + \left(r + \frac{\alpha^{2}}{2}\right)t\right] \\&#xA;     d_2 &amp;amp;= \frac{1}{\alpha\sqrt{t}}\left[\ln\left(\frac{p_1}{p_d}\right) + \left(r - \frac{\alpha^{2}}{2}\right)t\right] \\&#xA;     d_3 &amp;amp;= \frac{1}{\alpha\sqrt{t}}\left[\ln\left(\frac{p_1}{p_s}\right) + \left(r + \frac{\alpha^{2}}{2}\right)t\right] \\&#xA;     d_4 &amp;amp;= \frac{1}{\alpha\sqrt{t}}\left[\ln\left(\frac{p_1}{p_s}\right) + \left(r - \frac{\alpha^{2}}{2}\right)t\right] \\&#xA;\end{align}&#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The call is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\left[mN(d_1)+(p_1(N(d_3)-N(d_1))+p_se^{-rt}(N(d_2)-N(d_4)))(1-N(d_1))\right]H(p_d-p_s)$&lt;/p&gt;&#xA;" OwnerUserId="7014" LastEditorUserId="7014" LastEditDate="2014-01-25T11:36:23.280" LastActivityDate="2015-05-24T03:06:01.347" Title="Pricing options under restricted domain" Tags="&lt;options&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9981" PostTypeId="1" CreationDate="2014-01-18T10:35:59.903" Score="2" ViewCount="1173" Body="&lt;p&gt;&lt;strong&gt;1. I am looking for a derivation of the Nelson-Siegel model&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$y(m)=a+b\left( \frac{1-e^{-\lambda m}}{\lambda m}\right)+c\left( \frac{1-e^{-\lambda m}}{\lambda m} -e^{-\lambda m} \right)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is supposed to follow the Differential Equation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$y''(m)+uy'(m)+vy(m)=0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, taking the derivative of $y$ and plugging that into the Differential Equation does not work. &#xA;Where can I find a mathematical derivation and the assumptions beeing made? Just saying that the term structure follows aboves process is not enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2. Why does the Nelson-Siegel model allow arbitrage? And how do I proof it?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ive already looked at this post&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/3323/why-isnt-the-nelson-siegel-model-arbitrage-free&quot;&gt;Why isn&amp;#39;t the Nelson-Siegel model arbitrage-free?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;without finding it very helpful. The paper of Bjoerk and Christensen shows inconsistency of the NS-model with Hull-White and Ho-Lee but I do not understand why arbitrage opportunities follow from this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any mathematical proof of arbitrage opportunities within the NS model?&lt;/p&gt;&#xA;" OwnerUserId="7015" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2014-02-18T13:27:46.870" Title="Derivation of the Nelson-Siegel model and proof of arbitrage" Tags="&lt;interest-rates&gt;&lt;arbitrage&gt;&lt;models&gt;&lt;yield-curve&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="9982" PostTypeId="1" CreationDate="2014-01-18T11:27:15.230" Score="4" ViewCount="727" Body="&lt;p&gt;Assume I have a stochastic ODE&#xA;$$dS = a(S)dt + b(S)dW,$$&#xA;with Euler approximation&#xA;$$\hat{S}_{n+1}=F_n(\hat{S}_n)=\hat{S}_n+a(\hat{S}_n)h+b(\hat{S}_n)Z_n\sqrt{h}.$$&#xA;This allows me to create sample paths based on drawing normally distributed random numbers $Z_n$ from $N(0,1)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the estimated value of my option is&#xA;$$\hat{V}=\frac{1}{N}\sum_i f(S^i_T)$$&#xA;where $f$ is the payoff function and $S^i_T$ is the i-th sample path of the process at time $T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume the ODE and $f$ have various parameters, for example starting value $S_0$, risk-free interest rate $r$ and volatility $\sigma$. Furthermore, f is sufficiently continous such that the derivatives&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$D_n=\frac{\partial F_n(\hat{S}_n)}{\partial \hat{S}_n } $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;exist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on these quantities, how can I compute sensitivities using the &lt;strong&gt;adjoint method&lt;/strong&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Links: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Related question: &lt;a href=&quot;https://quant.stackexchange.com/q/3329/1157&quot;&gt;How to get greeks using Monte-Carlo for arbitrary option?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Related paper: &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=19F57F6AEFBFB9A44C4CE41872EAD1BD?doi=10.1.1.132.2360&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Smoking Adjoints: fast evaluation of Greeks in Monte Carlo calculations, Giles and Glasserman, 2005&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerDisplayName="user1157" LastEditorUserId="-1" LastEditorDisplayName="user1157" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-10-14T13:29:58.920" Title="How to compute greeks using the adjoint Monte Carlo approach?" Tags="&lt;monte-carlo&gt;&lt;sensitivities&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9985" PostTypeId="2" ParentId="9977" CreationDate="2014-01-18T19:41:37.730" Score="1" Body="&lt;p&gt;The interbank rate probably isn't reasonable given your second example. However, between the constant capital flows going back and forth between thousands of banks on a daily basis and the asymmetric nature of the banking model, it's difficult and unrealistic to determine a fair market rate between the two parties. As far as I'm concerned, bank A got the better end of the deal even if bank B did walk away with some haircut. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Benchmark rates found in LIBOR, Treasury Yields, Discount Window Rates, are the best the banking system can do as far as a one-rate-fits all solution. So in the event bank B wants to loan his excess reserves again, he at least have some starting point on how much to charge...&lt;/p&gt;&#xA;" OwnerUserId="6989" LastActivityDate="2014-01-18T19:41:37.730" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="9986" PostTypeId="2" ParentId="9980" CreationDate="2014-01-19T01:09:40.680" Score="1" Body="&lt;p&gt;Well first we would have to write a stochastic process taking values on a bounded space in the real numbers. Check out the dynamics proposed by Detemple, Garcia and Rindisbacher (&lt;a href=&quot;http://www.nccr-finrisk.uzh.ch/media/pdf/paperJF_detemple_garcia_rindisbacher.pdf&quot; rel=&quot;nofollow&quot;&gt;2003&lt;/a&gt;). They call it the NMRCEV process see equation 23 page 12. Essentially just think of it as an extended CEV Ornstein-Uhlenbeck process which is bounded. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A slightly easier dynamics to use might be something like, assume the risk neutral dynamics are given by something&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dS_t = (\kappa(1_{S_t &amp;lt; 0} - 1_{S_t &amp;gt; U}) + r) dt + \sigma dW_t(1_{S_t &amp;gt; 0}1_{S_t &amp;lt; U}) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think that creates an absorbing state at the upper barrier for any non-zero interest rate but that may or may not be desirable. For anything resembling no arbitrage, it's likely required. You can price with and without $r$ and see the difference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you could just use Monte Carlo simulation to price the option or better yet under the right assumptions there is no reason you couldn't write those expectations as integrals of the  standard normal density. &lt;/p&gt;&#xA;" OwnerUserId="4910" LastActivityDate="2014-01-19T01:09:40.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9987" PostTypeId="2" ParentId="9977" CreationDate="2014-01-19T06:12:02.480" Score="1" Body="&lt;p&gt;&quot;Capital requirements&quot; is a misnomer as a minimum quota is not being placed on liabilities thus equities but on assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Banks are required by most national laws to hold a portion of assets &quot;in reserve&quot;, cash or deposits at the banknote issuer, a central bank.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A reason why one bank might have a deficit of reserves is because it has met with withdrawals in excess the rate that loans have been repaid, frequently the result of higher relative demand.  Withdrawals are paid with cash or accounts at the banknote issuer.  To satisfy reserve requirements, a bank need only to borrow reserves from another.  The worst case is that reserves are drying up because they're being used to satisfy withdrawals made out of fear of a bank's bad assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The opposite is the most likely case for a normally functioning bank: it has experienced less relative demand relative to the rate of deposits, so it has an excess of cash that needs to be loaned.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Overnight rates are the interest rates charged for the loans made by those with excess reserves to those in deficit.  They are overnight because interest rates are usually adjusted overnight to allow those in deficit to attract withdrawals or slow new loans while those in excess can pay less interest rates for deposits while simultaneously lowering interest rates demanded for loans to attract more demand.&lt;/p&gt;&#xA;" OwnerDisplayName="user6500" LastActivityDate="2014-01-19T06:12:02.480" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9988" PostTypeId="2" ParentId="3319" CreationDate="2014-01-19T12:27:20.460" Score="3" Body="&lt;p&gt;Sorry for interefering in the discussion as a guest, but I'm studying this topic at the moment for FRM Part II exam, in the context of MBS valuation through Monte Carlo simulation, and at the beginning I had exactly the same doubt. This is the explanation I gave myself and I don't know if it can help:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you use Z-spread you are not simulating cash flows taking into account the option (in my case, mortgage prepayment by mortgagor), so the resulting sum of the &quot;scheduled&quot; cash flows is higher and, in order to reconcile it with the market price of the security you need, from a purely mathematical point of view, a smaller discount factor (for each time bucket, more precisely), i.e. a higher spread to put in the equation.&#xA;When, instead, you calculate cash flows using Monte Carlo simulation and take into account interest rate volatility (by means of some assumptions in the model), this means you are considering teh option possibility and this automatically reflects in a smaller value of the scheduled cash flows. This in turn implies that you need a higher discount factor, i.e. a smaller spread, to reconcile this value with the market value of the security.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I think you should interpret the spread not as what an investor demands, but as what an investor actually earns, over the treasury (or LIBOR, depends on the model) curve by holding the security to maturity. The OAS is smaller because you earn less than holding a security without the embedded option, and this is because the cash flows are actually less.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the conclusion is that z-spread has to take into account the option risk (so it has to be higher) because this is not taken into account in the structure of the cash flows. Instead, this is not necessary with MT simulation for the reason explained above, i.e. optionality is accounted for in the structure of cash flows and not in the OAS, so in this sense it is an &quot;option adjusted&quot; spread, and I think it more realistically reflects, to an investor, the real value of a security especially if compared with securities without optionality. In this sense we can say, quoting Miles answer above, that OAS &quot;compensates for credit and liquidity risk only&quot;, and for this reason this is the spread that should be used if one wants to compare the MBS with, for example, a security (like a traditional bond) that embeds itself only credit and liquidity risk. The presence of the &quot;compensation&quot; for option risk in the z-spread, instead, distorts this commparison and is neither a realistic representation of what the MBS really earns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sorry if I've been too verbose, but I hope this clarifies your doubt.&lt;/p&gt;&#xA;" OwnerUserId="7028" LastActivityDate="2014-01-19T12:27:20.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9990" PostTypeId="2" ParentId="9981" CreationDate="2014-01-19T13:00:50.620" Score="3" Body="&lt;p&gt;The book by Francis Diebold &amp;amp; Glenn Rudebusch &quot;Yield Curve Modeling and Forecasting&quot; addresses both a dynamic extension of Nelson-Siegel and an arbitrage-free version - may be helpful for what you are looking for. Link below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0691146802&quot; rel=&quot;nofollow&quot;&gt;http://www.amazon.com/Yield-Curve-Modeling-Forecasting-Nelson-Siegel/dp/0691146802/ref=sr_1_2?ie=UTF8&amp;amp;qid=1390136363&amp;amp;sr=8-2&amp;amp;keywords=diebold+and+rudebusch&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6139" LastActivityDate="2014-01-19T13:00:50.620" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9993" PostTypeId="1" CreationDate="2014-01-19T16:39:24.253" Score="0" ViewCount="197" Body="&lt;p&gt;In &lt;a href=&quot;http://www.sec.gov/edgar.shtml&quot; rel=&quot;nofollow&quot;&gt;SEC&lt;/a&gt; &lt;a href=&quot;http://en.wikipedia.org/wiki/XBRL&quot; rel=&quot;nofollow&quot;&gt;XBRL&lt;/a&gt; financial filings, why do the date ranges for duration contexts not match the context's quarter?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g. The markup for the context &quot;D2012Q3&quot; may look like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;xbrli:context id=&quot;D2012Q3&quot;&amp;gt;&#xA;    &amp;lt;xbrli:entity&amp;gt;&#xA;        &amp;lt;xbrli:identifier scheme=&quot;http://www.sec.gov/CIK&quot;&amp;gt;0000826083&amp;lt;/xbrli:identifier&amp;gt;&#xA;    &amp;lt;/xbrli:entity&amp;gt;&#xA;    &amp;lt;xbrli:period&amp;gt;&#xA;        &amp;lt;xbrli:startDate&amp;gt;2011-07-30&amp;lt;/xbrli:startDate&amp;gt;&#xA;        &amp;lt;xbrli:endDate&amp;gt;2011-10-28&amp;lt;/xbrli:endDate&amp;gt;&#xA;    &amp;lt;/xbrli:period&amp;gt;&#xA;&amp;lt;/xbrli:context&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see, the context is for the 3rd quarter of 2012, but only covers the date range from 2011-7-30 to 2011-10-28, which is 11 months before the 3rd quarter of 2012. Why is this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And this pattern isn't even consistent, because other contexts, even for the same company, may look like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;xbrli:context id=&quot;D2011Q4YTD&quot;&amp;gt;&#xA;    &amp;lt;xbrli:entity&amp;gt;&#xA;        &amp;lt;xbrli:identifier scheme=&quot;http://www.sec.gov/CIK&quot;&amp;gt;0000826083&amp;lt;/xbrli:identifier&amp;gt;&#xA;    &amp;lt;/xbrli:entity&amp;gt;&#xA;    &amp;lt;xbrli:period&amp;gt;&#xA;        &amp;lt;xbrli:startDate&amp;gt;2010-01-30&amp;lt;/xbrli:startDate&amp;gt;&#xA;        &amp;lt;xbrli:endDate&amp;gt;2011-01-28&amp;lt;/xbrli:endDate&amp;gt;&#xA;    &amp;lt;/xbrli:period&amp;gt;&#xA;&amp;lt;/xbrli:context&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here, Q4 of 2011 has date ranges covering an entire year. Presumably, the YTD indicates an aggregation over several quarters, but I still don't understand where they're the date ranges from or what they signify.&lt;/p&gt;&#xA;" OwnerUserId="7029" LastActivityDate="2014-03-25T10:46:36.697" Title="SEC XBRL Context Dates" Tags="&lt;sec&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9994" PostTypeId="1" CreationDate="2014-01-19T18:39:15.810" Score="4" ViewCount="917" Body="&lt;p&gt;This is the situation someone I know is in:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;She has good understandings of stochastic calculus and the very basics about black-scholes and binomial model, but nothing more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Her background is in statistics and she has a lot of experiences in time series modelling.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;what would be good books to look at for a job as a quant in a fund or an investment bank?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the section in 'Heard on the street' is a nice for interviewing but it is written more like a 'crash course' for interview rather than a proper financial mathematical treatise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Though this may be off topic: some general advice is also nice, but I am mainly looking for a book)&lt;/p&gt;&#xA;" OwnerUserId="3334" LastActivityDate="2014-04-27T11:11:09.997" Title="a good book on option pricing from theoretical and practical aspect" Tags="&lt;option-pricing&gt;&lt;statistics&gt;&lt;reference-request&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9995" PostTypeId="2" ParentId="9993" CreationDate="2014-01-19T21:20:50.130" Score="1" Body="&lt;p&gt;The standard is outlined &lt;a href=&quot;http://www.xbrl.org/Specification/XBRL-RECOMMENDATION-2003-12-31+Corrected-Errata-2005-04-25.htm#_4.6.1&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;id&lt;/code&gt; field needs only to be relatively unique based on some factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason why dates are inconsistent from year to year is because those are the dates the books are opened and closed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Those dates are governed by regulation and the internal intricacies of a company in question which are both many.&lt;/p&gt;&#xA;" OwnerDisplayName="user6500" LastActivityDate="2014-01-19T21:20:50.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9996" PostTypeId="1" AcceptedAnswerId="10000" CreationDate="2014-01-20T01:20:51.497" Score="4" ViewCount="873" Body="&lt;p&gt;If I use interpolation technique such as cubic spline to estimate volatility of Swaption with different strike,(with a given forward rate, swap and option maturity) will this be arbitrage free? What is the main differences compared to using stochastic model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="7033" LastActivityDate="2014-01-20T08:22:18.220" Title="Is Cubic spline Interpolation on swaption Volatility arbitrage free?" Tags="&lt;volatility&gt;&lt;swaption&gt;&lt;volatility-smile&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="9997" PostTypeId="2" ParentId="8633" CreationDate="2014-01-20T02:43:27.710" Score="1" Body="&lt;p&gt;You are right, &quot;exogeneous transaction costs&quot; (transaction taxes, brokerage fees...) are related to illiquidity sources. In the literature, these costs impact prices because investors require compensation for its cost.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Empirically, liquidity has been helpful to explain some market facts such that the small firm effect, the equity premium puzzle... Loosely speaking if you are interested in good material you have the choice either to study the literature (very large) on market microstructure or the literature on liquidity and asset pricing. In this latter literature, the market is seen as a friction market and illiquidity costs (frictions) are taken into accounts by investors. Then, returns (=prices) are impacted by illiquidity. A very good introduction to this literature is given in : Amihud, Y., Mendelson, H., &amp;amp; Heje Pedersen, L. (2005). Liquidity and Asset Prices . nowpublishers Inc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Two others references :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Acharya, V., &amp;amp; Pedersen, L. (2005). Asset pricing with liquidity risk. Journal of Financial Economics, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Amihud, Y., &amp;amp; Mendelson, H. (1986). Asset pricing and the bid-ask spread. Journal of financial Economics, 17.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2014-01-20T03:05:30.187" LastActivityDate="2014-01-20T03:05:30.187" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="9998" PostTypeId="1" AcceptedAnswerId="10022" CreationDate="2014-01-20T03:12:47.200" Score="6" ViewCount="261" Body="&lt;p&gt;&lt;s&gt;The &lt;a href=&quot;http://en.wikipedia.org/wiki/Augmented_Dickey%E2%80%93Fuller_test&quot; rel=&quot;nofollow&quot;&gt;Augmented Dickey-Fuller Test&lt;/a&gt; can be used to measure how well &lt;em&gt;ranked&lt;/em&gt; certain pairs are against others for co-integration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So then say we have a known co-integration between &lt;code&gt;X&lt;/code&gt; and &lt;code&gt;Y&lt;/code&gt; and between &lt;code&gt;Y&lt;/code&gt; and &lt;code&gt;Z&lt;/code&gt;, is there a constraint to the range of co-integration between &lt;code&gt;X&lt;/code&gt; and &lt;code&gt;Z&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if we know &lt;code&gt;coint(X,Y) = -0.1&lt;/code&gt; and &lt;code&gt;coint(Y,Z) = -0.3&lt;/code&gt; can we then use these in some formula which would then say with certainty that &lt;code&gt;-x.x &amp;lt; coint(X,Z) &amp;lt; -x.x&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is similar to the correlation constraint of the same scenario given by &lt;a href=&quot;http://link.springer.com/article/10.1007/BF02293804#page-1&quot; rel=&quot;nofollow&quot;&gt;(Olkin, 1981)&lt;/a&gt;.&lt;/s&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT - As Richard has pointed out, I may have misunderstood the ADF Test. I'll rephrase the question here:&lt;br&gt;&#xA;If we know $X$ is cointegrated (via some test e.g. &lt;a href=&quot;http://en.wikipedia.org/wiki/Cointegration#The_Engle.E2.80.93Granger_two-step_method&quot; rel=&quot;nofollow&quot;&gt;Engle Granger&lt;/a&gt;) with $Y$ and $Y$ with $Z$, is there some measure of how probable $X$ will be cointegrated with $Z$?&lt;/p&gt;&#xA;" OwnerUserId="7034" LastEditorUserId="2587" LastEditDate="2014-01-21T12:26:07.757" LastActivityDate="2014-01-22T16:18:09.303" Title="Co-integration constraints of coint(X,Z) given coint(X,Y) and coint(Y,Z)?" Tags="&lt;statistics&gt;&lt;correlation&gt;&lt;cointegration&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="9999" PostTypeId="1" CreationDate="2014-01-20T06:56:48.817" Score="2" ViewCount="78" Body="&lt;p&gt;Looking at the contract specifications for &lt;a href=&quot;http://www.cmegroup.com/trading/agricultural/grain-and-oilseed/soybean-meal_contractSpecs_options.html#prodType=AME&quot; rel=&quot;nofollow&quot;&gt;Soybean Meal&lt;/a&gt; and &lt;a href=&quot;http://www.cmegroup.com/trading/agricultural/grain-and-oilseed/soybean-oil_contractSpecs_options.html#prodType=AME&quot; rel=&quot;nofollow&quot;&gt;Soybean Oil&lt;/a&gt; (same for &lt;a href=&quot;http://www.cmegroup.com/trading/agricultural/grain-and-oilseed/corn_contractSpecs_options.html&quot; rel=&quot;nofollow&quot;&gt;Corn&lt;/a&gt;, &lt;a href=&quot;http://www.cmegroup.com/trading/agricultural/grain-and-oilseed/wheat_contractSpecs_options.html#prodType=AME&quot; rel=&quot;nofollow&quot;&gt;Wheat&lt;/a&gt;, and other major stuff I checked) serial options on CME I see the following expiration rule:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;the last Friday which precedes by at least two business days the last&#xA;  business day of the calendar month... If such Friday is not a business day, then the last day&#xA;  of trading in such option shall be the business day prior to such&#xA;  Friday.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However, for &lt;a href=&quot;http://www.cmegroup.com/trading/agricultural/grain-and-oilseed/soybean_contractSpecs_options.html&quot; rel=&quot;nofollow&quot;&gt;Soybeans&lt;/a&gt;, it states:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The last Friday which precedes by at least two business days the last&#xA;  business day of the month preceding the option month.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is a bit confusing as it may suggest that expiration should be transferred to the previous Friday week back, rather than one day back (in case of holiday). As it is now, it states that the expiration is Friday (and not any other day would do). Since all other contract specifications have matching descriptions, I find it strange that this one is different. So, is it merely a slightly clumsy statement of the same rule, or the expiration dates for Soybean options are different for some reason? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was unable to find expiration data for months when the would-be-expiration falls on holiday, which are December 2010 and 2015.&lt;/p&gt;&#xA;" OwnerUserId="5086" LastEditorUserId="467" LastEditDate="2014-01-20T16:13:39.913" LastActivityDate="2014-01-20T16:13:39.913" Title="How to interpret CME's specification regarding grains options expirations?" Tags="&lt;options&gt;&lt;commodities&gt;&lt;cme&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10000" PostTypeId="2" ParentId="9996" CreationDate="2014-01-20T08:22:18.220" Score="6" Body="&lt;p&gt;There is nothing in simple cubic spline fitting routines that would prevent arbitrage. Even with conscientious use of knot points and smoothing techniques you may end up with simple spread and local volatility arbitrage conditions. Stochastic volatility models on the other hand can explicitly constrain your solutions to prevent call/ put spread arbitrage at least on each tenor. Arbitrage free surface construction routines can guarantee lack of static arbitrage. &lt;a href=&quot;http://arxiv.org/pdf/1204.0646.pdf&quot;&gt;This paper will help.&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3237" LastActivityDate="2014-01-20T08:22:18.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10001" PostTypeId="2" ParentId="708" CreationDate="2014-01-20T09:32:33.023" Score="1" Body="&lt;p&gt;I have studied what happens in the Betfair horse racing markets in the few minutes prior to the off and without knowing anything about racing or markets for that matter I trade buying and selling fast and making small profits/losses as I go. The key is discipline, accept small losses when they occur and NEVER follow a trade into play.&#xA;Although I trade only on instinct I make more correct decisions than not however the move from smaller stakes to larger stakes is very daunting as I am sure emotions will start to creep in as the amounts of MY money become larger and therefore the risks greater.&lt;/p&gt;&#xA;" OwnerUserId="7035" LastActivityDate="2014-01-20T09:32:33.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10003" PostTypeId="2" ParentId="9994" CreationDate="2014-01-20T13:34:18.970" Score="2" Body="&lt;p&gt;I would recommmend her &lt;em&gt;An introduction to the mathematics of financial derivatives&lt;/em&gt; by Neftci and some programming books(&lt;em&gt;Numerical Recipes. The Art of Scientific Computing&lt;/em&gt; by william H press, &lt;em&gt;C++ Design Patterns and Derivatives Pricing&lt;/em&gt;  by Joshi).&lt;/p&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2014-01-20T13:34:18.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10004" PostTypeId="2" ParentId="7181" CreationDate="2014-01-21T00:13:55.353" Score="6" Body="&lt;p&gt;As with many machine learning technologies, you can run a separate training and testing phase before deploying it live for prediction. All it does is build a collection of decision trees based on the parameters you give it - if the output field is a factor, you get classification (a finite enumerated set of values); if it's numeric, you get prediction. One approach might be to add a column forwhether a commodity reaches a given profit level within an affordable time period; the random forest can then build a logic to correlate that against all the other input columns (such as technical indicators, etc).&lt;/p&gt;&#xA;" OwnerUserId="7042" LastActivityDate="2014-01-21T00:13:55.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10005" PostTypeId="2" ParentId="942" CreationDate="2014-01-21T02:53:29.670" Score="2" Body="&lt;p&gt;Yahoo Historical Prices will seem fine for a while, and then you'll discover &lt;a href=&quot;http://answers.yahoo.com/question/index?qid=20140120182234AAqXfO2&quot; rel=&quot;nofollow&quot;&gt;missing dates&lt;/a&gt;, or that it stops getting updated for a week or so.&lt;/p&gt;&#xA;" OwnerUserId="5520" LastActivityDate="2014-01-21T02:53:29.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10006" PostTypeId="2" ParentId="7181" CreationDate="2014-01-21T05:00:41.147" Score="2" Body="&lt;p&gt;It could help with things like fraud detection, analysis of bankruptcy probability, default risk, unsupervised learning for qualitative/descriptive purposes, or for a purely backwards looking supervised analysis on returns again for descriptive/understanding purposes (variable important, etc, perhaps impulse response analysis).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It may also be good at forecasting low-frequency volatility which is well known to be easy to forecast; intuitively this works because it is likely to be combinations of events that cause very high volatility which is difficult to incorporate into a GARCH variance equation. You could just rely on the forest to learn regimes, breaks, etc (consider a dynamic forest).&lt;/p&gt;&#xA;" OwnerUserId="6081" LastActivityDate="2014-01-21T05:00:41.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10009" PostTypeId="2" ParentId="7181" CreationDate="2014-01-21T08:48:24.583" Score="4" Body="&lt;p&gt;A while ago I have implemented a binary fuzzy decision tree forest to classify credit applications as a semesters project.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say a tree looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C1&#xA;   C11&#xA;      -&amp;gt; X&#xA;      -&amp;gt; Y&#xA;   C12&#xA;      C121&#xA;         -&amp;gt; A&#xA;         -&amp;gt; B&#xA;      -&amp;gt; U&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The benefits of decision tree techniques in general are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Comprehensibility&lt;/strong&gt;: The paths down the tree have a direct interpretation: &quot;If condition C1 and condition C11 then X&quot;. For example &quot;If debt&gt;0 and income == 0 then no_credit.&quot;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Expert knowledge&lt;/strong&gt;: It is possible to change the trees based on background knowledge.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Extensibility&lt;/strong&gt;: It is possible to include other classification tools at the nodes, for example you could have a neural network which detects trends and then go down the tree depending on the output of the network.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Decicion tree forests have additional benefits:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Adaptation&lt;/strong&gt;: If the problem splits into several domains, the trees can fit to their region more closely.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Smaller trees&lt;/strong&gt;: The trees can be restricted to much smaller size, which makes them easier to understand.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Confidence information&lt;/strong&gt;: If a lot of the trees in the forrest vote for the same classification, this can be seen as a measure of confidence.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;On the downside forests can be much more expensive to compute and manage. Also, whereas a single tree can avoid overfitting by using standard pruning techniques, there does not seem to be concensus which is the best approach for forrests, yet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any application of machine learning techniques this approach is only as good as the data and the indicators used to train it on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interesting papers include&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.worldscientific.com/doi/abs/10.1142/S0219622006001824&quot; rel=&quot;nofollow&quot;&gt;A decision tree-based classification approach to rule extraction for security analysis&lt;/a&gt;, by Ren et al. (2006)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ec.iem.cyut.edu.tw/drupal/sites/default/files/%2895%29a%20personalized%20recommender%20system%20based%20on%20web%20usage%20mining%20and%20decision%20tree%20induction.pdf&quot; rel=&quot;nofollow&quot;&gt;A personalized recommender system based on web usage mining and decision tree induction&lt;/a&gt;, by Cho et al. (2002)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://dl.acm.org/citation.cfm?id=1189455&quot; rel=&quot;nofollow&quot;&gt;Dynamics of modeling in data mining: interpretive approach to bankruptcy prediction&lt;/a&gt;, by Sung et al. (1999)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S037872060100091X&quot; rel=&quot;nofollow&quot;&gt;Business data mining — a machine learning perspective&lt;/a&gt;, by Bose and Mahapatra (2001)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerDisplayName="user1157" LastEditorDisplayName="user1157" LastEditDate="2014-01-21T12:00:10.050" LastActivityDate="2014-01-21T12:00:10.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10010" PostTypeId="1" CreationDate="2014-01-21T08:53:06.643" Score="0" ViewCount="469" Body="&lt;p&gt;If you look into the &lt;a href=&quot;http://www.nasdaqtrader.com/content/technicalsupport/specifications/dataproducts/NQGlimpseSpecification.pdf&quot; rel=&quot;nofollow&quot;&gt;description&lt;/a&gt; of Nasdaq ITCH data, you see two types of order entries in the book: Message of Type A and F. Under type F, you will see the identity of the market participant (MPID). In other words, you know the firm that supplies liquidity. Why liquidity providers may disclose their identity? What are their motivation to do so? Do they get a higher maker fee? &lt;/p&gt;&#xA;" OwnerUserId="2570" LastActivityDate="2015-02-21T06:41:14.983" Title="Disclosure of the liquidity provider identity in ITCH" Tags="&lt;limit-order-book&gt;&lt;liquidity&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10011" PostTypeId="1" CreationDate="2014-01-21T11:06:44.847" Score="1" ViewCount="2086" Body="&lt;p&gt;If $EC(S_0, K, \sigma, r, T)$ represents the price of a European call option with strike $K$, expiry $T$, initial price $S_0$, volatility $\sigma$ and where the constant interest rate is $r$, then I want to express the price of a down-and-out call option in terms of $EC$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, I wish to show that the price of a down-and-out call with strike $K$ and a barrier at $S_0 e^b &amp;lt; min\{S_0, K\}$ can be expressed as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$EC(S_0, K, \sigma, r,T) - e^{2\mu b / \sigma^2} EC(S_0, K, \sigma, r, T),$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\mu = r - \frac{1}{2} \sigma^2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be really appreciated. Thanks!&lt;/p&gt;&#xA;" OwnerUserId="7047" LastActivityDate="2014-01-23T16:00:01.100" Title="Price of a down-and-out call in terms of European call" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10013" PostTypeId="2" ParentId="9998" CreationDate="2014-01-21T12:54:43.877" Score="1" Body="&lt;p&gt;I am trying to give a some comments (too much for a real comment) a start: $X$ cointegrated with $Y$ means there is a $\beta_1$ such that&#xA;$$&#xA; X_t - \beta_1 Y_t = u_t,&#xA;$$&#xA;and $u_t$ is stationary. $\beta_1$ can be estimated by&#xA;$$&#xA;\beta_1 = \frac{Cov(X_t,Y_t)}{Var(Y_t)} = Cor(X_t,Y_t) \frac{\sqrt{Var(X_t)}}{\sqrt{Var(Y_t)}}.&#xA;$$&#xA;For $Y$ and $Z$ we have&#xA;$$&#xA;  Y_t - \beta_2 Z_t = v_t,&#xA;$$&#xA;with $v_t$ stationary and $\beta_2 = Cor(Z_t,Y_t) \frac{\sqrt{Var(Y_t)}}{\sqrt{Var(Z_t)}}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the question is whether there is a $\beta_3$ such that&#xA;$$&#xA; X_t - \beta_3 Z_t = e_t&#xA;$$&#xA;with $e_t$ stationary. We would estimate &#xA;$$&#xA;  \beta_3 = Cor(X_t,Z_t) \frac{\sqrt{Var(X_t)}}{\sqrt{Var(Z_t)}}.&#xA;$$&#xA;As linear combinations of stationary time series are stationary we get&#xA;$$&#xA;k_t =  u_t - v_t =  X_t - \beta_1 Y_t - (Y_t - \beta_2 Z_t) = X_t - (1+\beta_1) Y_t + \beta_2 Z_t &#xA;$$&#xA;and we have trivially found a linear combination of the three that is stationary - this is multicointegration. At the moment I don't know whether this can be simplified - maybe someone else does.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-01-21T12:54:43.877" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10014" PostTypeId="2" ParentId="10010" CreationDate="2014-01-21T13:30:31.020" Score="4" Body="&lt;p&gt;The two types of orders are called &quot;Attributed&quot; and &quot;Non-Attributed&quot;. Venues will sometimes provide incentives to encourage order attribution. For example, Direct Edge has their &quot;Edge Attribution Incentive Program&quot; which you can read about on &lt;a href=&quot;http://www.directedge.com/Trading/EDGXFeeSchedule.aspx&quot; rel=&quot;nofollow&quot;&gt;their price list&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe NASDAQ has offered incentives for attribution in the past, but I don't think they do with their current price list. Attribution is used, but I wouldn't say it is wide spread. For example, here is the list of MPIDs that show up in the NASDAQ ITCH feed on 2013-02-06 (A random date I snagged from our data store. Also, ignore &lt;code&gt;tzero&lt;/code&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;MPID TABLE - 160&#xA;&#xA;tzero   CDRG    CANT    SBSH    BOOK    ADAM    FLTL    SALI    WEDB    CKCC    &#xA;ROTH    RILY    KING    MWRI    DOWL    MSRO    GLBL    EURP    RWPC    RHCO    &#xA;PRCO    JANY    NORT    CHLM    SOHO    AVON    SUSQ    PIPR    MSCO    ATDF    &#xA;MAXM    FBCO    OTAA    TMBR    ETMM    FBRC    BTIG    WCHV    IMCC    CRTC    &#xA;JPMS    GSCO    TRIM    RAJA    BARD    COWN    RBCM    HBIF    NITP    NEED    &#xA;VERT    LEHM    NITE    PERT    STFL    SUFI    XGWD    JEFF    MLCO    UBSS    &#xA;VFIN    BMOC    DRWS    JSSF    VNDM    MURF    WBLR    OPCO    KBWI    KELL    &#xA;PACS    DADA    DBAB    MERI    WABR    BERN    LAZA    PUMA    BBNT    BMUR    &#xA;DRCO    STXG    KEYB    SDLR    BKMM    SUNR    OCTG    INTL    MZHO    BOSC    &#xA;KOSE    DOTC    RONI    BNKS    AABA    LEER    INET    JPTC    LTCO    NTFN    &#xA;SPHN    MONR    BRUT    CWCO    IMPC    PAUL    WDCO    EGRO    SMHI    BARR    &#xA;WUND    COWL    FANC    TEJS    LAFC    FUND    AXGP    ALPS    NOBL    MACQ    &#xA;ROBT    BMAK    DLNY    AGIS    DAIN    MICA    BKRT    FSWC    ASCM    GRST    &#xA;PERS    SWEN    CCMB    CSTI    NQRE    TRWN    PENA    HAMR    SSGI    GLEN    &#xA;ACAP    VRTU    NQPM    BNCH    TRLN    NATL    WBRO    PMCI    CFGN    BCAP    &#xA;TOOL    AFCO    COWX    AUTO    GUGS    GFIS    MBAY    VIRT    NQMO    CEMM&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Finally, there might be some requirement to attribute your orders if you participate in NASDAQ's QMM or DLP program. You might check the detailed descriptions to see if there is. Ultimately, a firm is only going to attribute their order if (a) there is no downside to doing so; or (b) the upside, i.e. additional rebate or qualification, is significantly large to negate the downside.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;ADDED:&lt;/strong&gt;&#xA;To expand on the above. If you look at the message statistics for the same day, 2013-02-06, you see the following for adding new orders:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ADD ORDER      : 92532210&#xA;ADD ORDER MPID : 3389849    &amp;lt;&amp;lt;--- this one is the attributed order&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So you're looking at about a $3.7\%$ attribution rate for orders on this particular day.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastEditorUserId="1355" LastEditDate="2014-01-21T15:58:36.727" LastActivityDate="2014-01-21T15:58:36.727" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10015" PostTypeId="1" AcceptedAnswerId="10035" CreationDate="2014-01-21T19:58:47.260" Score="1" ViewCount="456" Body="&lt;p&gt;I'm looking into whether there is ANY information out there regarding the implementation of the Lattice Boltzmann method for pricing options (or other financial tasks).  I am very new to the world of finance and it struck me that this might have a useful application (apart from fluid modelling).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently, I am a full-time MS student studying computational fluid dynamics while working part-time as a derivative structuring intern, and I figured it might be a nice future research topic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any info would be much appreciated.&lt;/p&gt;&#xA;" OwnerUserId="7051" LastActivityDate="2014-01-23T13:09:46.397" Title="Lattice Boltzmann method for pricing options" Tags="&lt;options&gt;&lt;derivatives&gt;&lt;pricing&gt;&lt;lattice&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10016" PostTypeId="1" AcceptedAnswerId="15845" CreationDate="2014-01-21T23:16:28.720" Score="0" ViewCount="1439" Body="&lt;p&gt;I would appreciate if someone could correct me if i am wrong in my suggestion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;I am using PCA to :&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;find measure of &lt;strong&gt;cointegration&lt;/strong&gt; between selected assets&lt;/li&gt;&#xA;&lt;li&gt;find the eigenvector and its portfolio with a &lt;strong&gt;market-neutral position&lt;/strong&gt; (min variance)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Unfortunately i am not sure whether i am doing it the right way. Here is my algorithm : &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;getting the base matrix N x M : N - number of assets, M - number of history samples&lt;/li&gt;&#xA;&lt;li&gt;getting simple covariance matrix : Cov = E[(X - E[X])(Y - E[Y])]&lt;/li&gt;&#xA;&lt;li&gt;solving eigenproblem using Jacobi's Rotation method : [example][1]&lt;/li&gt;&#xA;&lt;li&gt;finding the index of the biggest eigenvalue by module : MinVariance = Min(Abs(eigenvalue))&lt;/li&gt;&#xA;&lt;li&gt;eigenvector can be found as a column in the rotation matrix by index of eigenvalue&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The question is :&lt;/strong&gt; did i miss something in this list of actions according to my initial purposes mentioned above?&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I am asking because i already calculated these weights for selected&#xA;  currencies but they look odd to me because e.g. EURUSD and GBPUSD seem&#xA;  to be opposite to each other when everyone knows that they are highly&#xA;  correlated and moves together most of the time&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;a href=&quot;http://c.mql5cdn.com/3/28/USDCHFM1.png&quot; rel=&quot;nofollow&quot;&gt;http://c.mql5cdn.com/3/28/USDCHFM1.png&lt;/a&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Here is my implementation of PCA on a C++ similar language called MQL&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;a href=&quot;http://www.mql5.com/ru/forum/16512/page3#comment_732844&quot; rel=&quot;nofollow&quot;&gt;http://www.mql5.com/ru/forum/16512/page3#comment_732844&lt;/a&gt; (see&#xA;  attachment)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="6855" LastEditorUserId="6855" LastEditDate="2014-01-22T15:58:05.297" LastActivityDate="2014-12-13T12:26:31.570" Title="Step-by-Step PCA algorithm (checking correctness without math packages)" Tags="&lt;modern-portfolio-theory&gt;&lt;pca&gt;&lt;covariance-estimation&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10017" PostTypeId="1" CreationDate="2014-01-22T00:32:30.603" Score="3" ViewCount="634" Body="&lt;p&gt;I would like to compute the time-0-price for a lookback option using Black Scholes formula, the explicit formula is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S_0[(\frac{2r+\sigma^2}{2r})\Phi((\frac{2r+\sigma^2}{2\sigma/\sqrt{T}}))-e^{-rT}((\frac{2r-\sigma^2}{2\sigma/\sqrt{T}}))-\frac{\sigma^2}{2r}]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know how to get to this price in theory, I looked into the book &quot;Methods in Financial Modelling&quot; by Musiela which is cited by wikipedia for a derivation but I am not very happy in the way he is doing all the calculations, do you have any reference for a nice clear derivation of this formula? It would be very helpful.&lt;/p&gt;&#xA;" OwnerUserId="6275" LastActivityDate="2014-01-23T12:51:43.317" Title="Lookback option explicit formula using Black Scholes" Tags="&lt;black-scholes&gt;&lt;reference-request&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10019" PostTypeId="2" ParentId="10017" CreationDate="2014-01-22T07:59:25.453" Score="1" Body="&lt;p&gt;The original framework for lookback options was devolped by Goldman, Sosin &amp;amp; Satto in  &lt;a href=&quot;http://efinance.org.cn/cn/fe/19791202Path%20Dependent%20Options%20Buy%20at%20the%20Low,%20Sell%20at%20the%20High%20pp.%201111-1127.pdf&quot; rel=&quot;nofollow&quot;&gt;Path Dependent Options: &quot;Buy at the Low, Sell at the High&quot;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can probably find some additional details &lt;a href=&quot;http://efinance.org.cn/cn/fe/19791202Path%20Dependent%20Options%20Buy%20at%20the%20Low,%20Sell%20at%20the%20High%20pp.%201111-1127.pdf&quot; rel=&quot;nofollow&quot;&gt;there&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="5208" LastActivityDate="2014-01-22T07:59:25.453" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10020" PostTypeId="2" ParentId="9975" CreationDate="2014-01-22T09:34:00.417" Score="6" Body="&lt;p&gt;One approach is to include the nominal rates, real rates and inflation in the model and then &lt;strong&gt;represent the inflation as a kind of exchange rate&lt;/strong&gt; between nominal and real rates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Jarrow and Yildrim presented such an approach in their paper &lt;a href=&quot;http://forum.johnson.cornell.edu/faculty/jarrow/084%20Tips%20JFQA%202003.pdf&quot; rel=&quot;nofollow&quot;&gt;&quot;Pricing Treasury Inflation Protected Securities and Related Derivatives using an HJM Model&quot;&lt;/a&gt; (2002). The definitive resource is &lt;a href=&quot;http://www.amazon.de/Interest-Rate-Models-Practice-Inflation/dp/3540221492/ref=sr_1_1?ie=UTF8&amp;amp;qid=1390464472&amp;amp;sr=8-1&amp;amp;keywords=brigo%20interest%20rate%20models&quot; rel=&quot;nofollow&quot;&gt;&quot;Interest Rate Models - Theory and Practice&quot;&lt;/a&gt; by Brigo and Mercurio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Belgrade and Ebenhamou discuss an extension to model the &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=583642&quot; rel=&quot;nofollow&quot;&gt;impact of seasonality in inflation derivatives pricing&lt;/a&gt;. Instead of changing the stochastic dynamics of the model, they reshape the forward curve of the CPI (i.e. they directly &lt;strong&gt;apply a static seasonal bump to the forward curve&lt;/strong&gt;).&lt;/p&gt;&#xA;" OwnerDisplayName="user1157" LastEditorDisplayName="user1157" LastEditDate="2014-01-23T08:17:03.247" LastActivityDate="2014-01-23T08:17:03.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10022" PostTypeId="2" ParentId="9998" CreationDate="2014-01-22T10:28:50.097" Score="3" Body="&lt;p&gt;&lt;em&gt;Regarding you comments, I'm adding an answer here because I will not have enough space to explain my point, so please forgive for this.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets start from the beginning, and assume :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1)   $X_t - \beta_1Y_t = \epsilon_t$ ($\epsilon_t$ is stationary)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2)  $Y_t - \beta_2Z_t = \eta_t$ ($\eta_t$ is stationnary) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;then (1) + $\beta_1$(2) gives $X_t - \beta_1\beta_2Z_t = \epsilon_t+\beta_1\eta_t = \nu_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even is $\epsilon_t$ and $\eta_t$ are stationary processes, the linear combination is stationary only if these processes are &lt;em&gt;independent&lt;/em&gt; (which is a strong assumption), or in a weak assumption, they should be &lt;em&gt;joint weak stationarity&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed, to be stationary, $\nu_t$ should have an autocovariance which is independent of time $t$, while:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Cov(\nu_{t+h}, \nu_t) = Cov(\epsilon_{t+h}+\beta_1\eta_{t+h}, \epsilon_t+\beta_1\eta_t) = [Cov(\epsilon_{t+h}, \epsilon_{t})+ \beta_1^2Cov(\eta_{t+h}, \eta_t)] + \beta_{1}[Cov(\eta_{t+h}, \epsilon_t)+Cov(\epsilon_{t+h}, \eta_t)]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, $Cov(\eta_{t+h}, \epsilon_t)$ and $Cov(\epsilon_{t+h}, \eta_t)$ are not only functions of $h$ but also of $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $\epsilon_t$ and $\eta_t$ are independent, then these covariances are 0, the first ones are independent of $t$ which leads to the desired result. But, as I said, in reality you only need that $\epsilon_t$ and $\eta_t$ be &lt;em&gt;Joint Weakly Stationary&lt;/em&gt;, which means that $\forall t_1, t_2~~  Cov(\epsilon_{t_1}, \eta_{t_2})=f(|t_2-t_1|)$ (or $h$ if $t_1=t+h$ and $t_2=t$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please find in this link a disscusion about this topic:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://math.stackexchange.com/questions/377333/sum-of-stationary-process&quot;&gt;https://math.stackexchange.com/questions/377333/sum-of-stationary-process&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6189" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2014-01-22T16:18:09.303" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10023" PostTypeId="1" CreationDate="2014-01-22T11:13:35.343" Score="8" ViewCount="2781" Body="&lt;p&gt;I have calculated weights of selected assets in a market-neutral portfolio (presumably with min variance) using PCA and simple data covariance matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The question is :&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is obvious that Cov Matrix contains estimation error so i need to shrink it, the best choice probably would be &lt;strong&gt;to implement Ledoit-Wolf estimator&lt;/strong&gt; but seems that i do not completely understand the formula for Shrinkage Intensity &lt;a href=&quot;http://www.ledoit.net/honey.pdf&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;, &lt;strong&gt;could somebody provide a link displaying how to use it on finite samples&lt;/strong&gt;?&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;As an alternative i also found this explanation why covariance matrix&#xA;  is often inverted before solving eigenproblem :&#xA;  &lt;a href=&quot;http://scikit-learn.org/stable/modules/covariance.html#sparse-inverse-covariance&quot; rel=&quot;noreferrer&quot;&gt;http://scikit-learn.org/stable/modules/covariance.html#sparse-inverse-covariance&lt;/a&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;As far as i understood - inverse of covariance matrix it is so called&#xA;  precision matrix (or sparse estimator) which helps to eliminate&#xA;  spurious relationships caused by estimation error of covariance matrix&#xA;  and thus i would like to ask - can simply inverted covariance matrix&#xA;  be a replacement for more complex estimator like Ledoit-Wolf?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;P. S. in general i need a good estimator for covariance matrix but in case of Ledoit-Wolf would be good to see how it is calculated on a real data to understand how exactly it works and how to implement it e.g. using C++.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update :&lt;/strong&gt; as for the question about general algorithm of the code below, as far as i understand Ledoit-Wolf estimator is kind of mix of the smart averaging and weighting coefficients and the main idea is to decrease spurious variances by recalculating them with averaged values where each values has its own intensity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The more basic algorithm (just a suggestion) would be to set growing weighting coefficients from recent return to older ones (sorry, do not remember exact book where it was described).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, i tried to apply this estimator on Forex market and could not find significant differences between original covariance matrix and the one with applied estimator. This is part of another question but i decided to use existing library for PCA instead of improving my own so i switched to alglib.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit.&lt;/strong&gt; Ok, i implemented mentioned estimator and to make sure whether it is correct or not i am trying to do the same thing in R. At the moment i have following implementation.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;struct SSeries // supposed to be an array of structures of different assets&#xA;{&#xA;    string mName;&#xA;    double mMean;&#xA;    double mPoints[]; // returns of specific asset&#xA;};&#xA;&#xA;// series - array of returns, size N x M, N - number of assets, M - returns&#xA;// covs - covariance matrix, N X N&#xA;// estimators - buffer for calculated estimation matrix&#xA;// order = N&#xA;// depth = M&#xA;&#xA;void GetEstimator(SSeries&amp;amp; series[], SSeries&amp;amp; covs[], SSeries&amp;amp; estimators[], const int order, const int depth)&#xA;{&#xA;    double &#xA;        R = 0, // average return (first 2 lines with formulas in Appendix A)&#xA;        A = 0, // value of &quot;П&quot; in the formula below (Pi)&#xA;        B = 0, // value of &quot;p&quot;&#xA;        C = 0, // value of &quot;v&quot; (gamma)&#xA;        cross = 0;&#xA;&#xA;    // Shrink Target&#xA;&#xA;    for (int k = 0; k &amp;lt; order; k++) &#xA;    {&#xA;        double summary = 0;&#xA;&#xA;        for (int n = k + 1; n &amp;lt; order; n++) &#xA;        {&#xA;            double divisor = covs[k].mPoints[k] * covs[n].mPoints[n] &amp;gt; 0 ? 1 : -1; // just to make sure that MathSqrt will apply to positive number (square root)&#xA;            summary += covs[k].mPoints[n] / MathSqrt(covs[k].mPoints[k] * covs[n].mPoints[n] * divisor) * divisor;&#xA;        }&#xA;&#xA;        R += summary;&#xA;    }&#xA;&#xA;    R = R * 2 / ((order - 1) * order); // average return&#xA;&#xA;    // Shrink Intensity - weighting coefficient for items in covariance matrix k = (П - p) / v&#xA;&#xA;    for (int k = 0; k &amp;lt; order; k++) &#xA;    {&#xA;        double summaryA = 0;&#xA;&#xA;        for (int n = 0; n &amp;lt; order; n++) &#xA;        {&#xA;            double Akn = 0; // equivalent of П[i][j]&#xA;&#xA;            for (int i = 0; i &amp;lt; depth; i++)&#xA;            {&#xA;                double X = series[k].mPoints[i] - series[k].mMean; // substract mean from first series&#xA;                double Y = series[n].mPoints[i] - series[n].mMean; // substract mean from second series&#xA;                Akn += (X * Y - covs[k].mPoints[n]) * (X * Y - covs[k].mPoints[n]);&#xA;            }&#xA;&#xA;            double divisor = covs[k].mPoints[k] * covs[n].mPoints[n] &amp;gt; 0 ? 1 : -1; // make value positiove before taking its square root&#xA;&#xA;            estimators[k].mPoints[n] = k == n ? covs[k].mPoints[n] : R * MathSqrt(covs[k].mPoints[k] * covs[n].mPoints[n] * divisor) * divisor; // for diagonal elements use variance instead of covariance&#xA;            summaryA += Akn / depth; // calculation of &quot;П&quot; in the formula above&#xA;            cross += k == n ? summaryA : 0; // calculate only variances (diagonal)&#xA;        }&#xA;&#xA;        A += summaryA; // &quot;П&quot; - sum of asymptotic variances of the entries of the sample covariance matrix scaled by&#xA;    }&#xA;&#xA;    for (int k = 0; k &amp;lt; order; k++) &#xA;    {&#xA;        double summaryB = 0, summaryC = 0; // calculation of &quot;p&quot; and &quot;v&quot; using existing cov matrix and recently calculated average return R&#xA;&#xA;        for (int n = 0; n &amp;lt; order; n++) &#xA;        {&#xA;            double aCovKk = 0, aCovNn = 0;&#xA;&#xA;            for (int i = 0; i &amp;lt; depth; i++)&#xA;            {&#xA;                double X = series[k].mPoints[i] - series[k].mMean;&#xA;                double Y = series[n].mPoints[i] - series[n].mMean;&#xA;                aCovKk += (X * X - covs[k].mPoints[k]) * (X * Y - covs[k].mPoints[n]);&#xA;                aCovNn += (Y * Y - covs[n].mPoints[n]) * (X * Y - covs[k].mPoints[n]);&#xA;            }&#xA;&#xA;            double divisorA = covs[n].mPoints[n] / covs[k].mPoints[k] &amp;gt; 0 ? 1 : -1;&#xA;            double divisorB = covs[k].mPoints[k] / covs[n].mPoints[n] &amp;gt; 0 ? 1 : -1;&#xA;&#xA;            aCovKk /= aCovKk;&#xA;            aCovNn /= aCovNn;&#xA;            summaryB += k == n ? 0 : (R / 2) * (aCovKk * MathSqrt(covs[n].mPoints[n] / covs[k].mPoints[k] * divisorA) * divisorA + aCovNn * MathSqrt(covs[k].mPoints[k] / covs[n].mPoints[n] * divisorB) * divisorB);&#xA;            summaryC += (estimators[k].mPoints[n] - covs[k].mPoints[n]) * (estimators[k].mPoints[n] - covs[k].mPoints[n]);&#xA;        }&#xA;&#xA;        B += summaryB;&#xA;        C += summaryC;&#xA;    }&#xA;&#xA;    B += cross; // &quot;p&quot; supposed to be a sum of asymptotic variances and covariances&#xA;&#xA;    double intensity = MathMax(0, MathMin(1, ((A - B) / C) / depth)); // formula for weighting coefficient&#xA;&#xA;    for (int k = 0; k &amp;lt; order; k++) &#xA;    {&#xA;        for (int n = 0; n &amp;lt; order; n++) &#xA;        {&#xA;            estimators[k].mPoints[n] = estimators[k].mPoints[n] * intensity + (1 - intensity) * covs[k].mPoints[n]; // apply calculated intensity - formula (2) in the chapter &quot;3.3 Shrinkage Constant&quot;&#xA;        }&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6855" LastEditorUserId="6855" LastEditDate="2014-03-16T23:44:04.797" LastActivityDate="2014-03-16T23:44:04.797" Title="Explanation or implementation of Ledoit-Wolf estimator (without math packages)" Tags="&lt;pca&gt;&lt;covariance-estimation&gt;&lt;covariance-matrix&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10025" PostTypeId="2" ParentId="7705" CreationDate="2014-01-22T13:33:42.710" Score="1" Body="&lt;p&gt;I would suggest writing the joint density as the product of the conditional densities then estimate parameters using an optimization package. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The joint density is given by &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f(r_0, \ldots, r_T) = f(r_0) \prod_{t=1}^T f(r_t|r_0, \ldots, r_{t-1})$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;then the log likelihood function is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$L = \log(f(r_0)) + \sum_{t=1}^T \log(f(r_t | r_0, \ldots, r_{t-1}) )$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may have some issues trying to optimize this function because of the number of parameters in your hyperbolic errors. These parameters may share quite a bit of information and lead to very flat slowly converging likelihood surfaces. This happens frequently with student T distribution when doing joint estimation of $\sigma$ and $\nu$ parameters. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See page 17 of Ruey S Tsay &lt;em&gt;Analysis of Financial Time Series (2nd Ed)&lt;/em&gt; for another similarly brief discussion with the normal distribution as an example&lt;/p&gt;&#xA;" OwnerUserId="4910" LastActivityDate="2014-01-22T13:33:42.710" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10026" PostTypeId="2" ParentId="7705" CreationDate="2014-01-22T17:07:21.583" Score="0" Body="&lt;p&gt;Your model is wrong , there are no innovations errors in EWMA models. Indeed the EWMA model belongs to the moving average class of estimators. Then to obtain $\sigma_{t}$ you just need $\lambda$ and $r_{t}$ :&#xA;The volatility is given by :&#xA;$\sigma =\sqrt{(1-\lambda)\sum_{t=1}^{T} \lambda^{t-1}(r_{t}-r)^{2}} $.(remark: there is no subscript $t$ associated with the volatility term: it is an &lt;strong&gt;unconditional&lt;/strong&gt; volatility process) . Loosely speaking, EWMA allows us to compute the long term average variance .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is based on an &lt;strong&gt;i.i.d returns model&lt;/strong&gt; : we obtain a subscript $t$ after estimation because the &lt;strong&gt;estimate&lt;/strong&gt; change over time but in fact there is no conditional variance process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way you presented your model is specific for ARCH type models (conditional variance process) such as :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;conditional&lt;/strong&gt; mean process : $r_{t} = \sigma_{t} \epsilon_{t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;conditional&lt;/strong&gt; variance process   $\sigma_{t} =.... Garch,Figarch,Aparch...$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\epsilon_{t}$ follows a specific distirbution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ARCH and Moving averages models are &quot;concurents&quot; models to estimate volatility and correlations, they can't be applied simultaneously.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ps:As far as i know,  in MLE estimation $\sigma_{t}$ is always integrated in the Likelihood function.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2014-01-22T19:00:23.693" LastActivityDate="2014-01-22T19:00:23.693" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10028" PostTypeId="1" AcceptedAnswerId="10030" CreationDate="2014-01-23T00:19:05.503" Score="1" ViewCount="491" Body="&lt;p&gt;I'm trying to understand what is considered &quot;material&quot; information held by an executive of a company. There is company information that an executive (say insider) will know that a public investor will not be privy to, but at which point does the information become material and at which point is the executive required to divulge the information into the public arena?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;example:&#xA;A mining company sends a rock to a lab to test it for gold. The company has stated that results will be announced in 4 weeks.&#xA;The company obtains results (good or bad) from the lab after one week. They are now in possession of material information until the 4 week period they stipulated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally - I assume the lab is now considered an insider and cannot act on their information for profit. But this must happen all the time or is it very tightly controlled/regulated/respected?&lt;/p&gt;&#xA;" OwnerUserId="3406" LastActivityDate="2014-01-23T03:34:41.853" Title="what is considered material information?" Tags="&lt;trading&gt;&lt;market-making&gt;&lt;information&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2014-01-23T13:41:55.607" ContentLicense="CC BY-SA 3.0" />
  <row Id="10029" PostTypeId="1" AcceptedAnswerId="10033" CreationDate="2014-01-23T00:26:04.847" Score="4" ViewCount="2337" Body="&lt;p&gt;A common way to select orders parameters  (ex: to choose the number of AR terms to be included in the model ) in time series modelling is to rely on some Information Criteria (AIC, BIC, Hannan Quinn..) to measure the relative quality of the model : let’s call it Rule A.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then in a second time, robustness tests are performed ( Ljung box test , Engle test ..). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However the methodology is not clear to me when I need to choose a model for a serie which has both autocorrelations in the mean and variance process :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I noticed that the model selected (by using rule A) &lt;strong&gt;is not&lt;/strong&gt; always the same if :&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I use a “two steps method ”  : First , I select orders parameters of the mean process using rule A , secondly, keeping the parameters obtained  in the first step,  I use rule A again to select parameters in the variance process.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Example :&#xA; I fit all ARMA(p,q)  to the series with (p,q)=0:2  and select the most parsimonious one. Let’s say the best model is p=&lt;strong&gt;1&lt;/strong&gt; and q=&lt;strong&gt;2&lt;/strong&gt;.&#xA;Second step : if fit all ARMA(&lt;strong&gt;1,2&lt;/strong&gt;)-GARCH(s,t) models to the serie with (s,t)=0:2 and I select the &quot;best&quot; s,t  parameters using rule A again. If we let p:q to be in the range  0:4 and s,t  in the range 0:2 they are $5^2 + 3^2$  models to be estimated .&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;OR a “direct way” modelling: I fit directly the full ARMA(p,q)-GARCH (s,t) to the time serie  and select the best model (p,q,s,t) using rule A again.&#xA;However in this case the number of combinations (number of models to be fitted) can be very high :if we let p:q to be in the range  0:4 and s,t  in the range 0:2 they are $5^2 \times 3^2$  candidat models (it takes time and CPU..) .&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Obviously the second method will evaluate the model selected by the two steps method and it &lt;em&gt;may&lt;/em&gt; gives the strongest significant results.  I said “may” because it is possible than the model selected by the direct method do not pass the misspecification part ..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is : How can I deal with this cost/efficiency problem ? How should I proceed ?&lt;/p&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2014-01-23T10:38:16.963" Title="How should we select efficiently orders parameters in time series modelling?" Tags="&lt;time-series&gt;&lt;parameter&gt;&lt;methodology&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10030" PostTypeId="2" ParentId="10028" CreationDate="2014-01-23T03:34:41.853" Score="1" Body="&lt;p&gt;The &lt;a href=&quot;https://www.cfainstitute.org/pages/index.aspx&quot; rel=&quot;nofollow&quot;&gt;CFA&lt;/a&gt; institute defines &quot;material&quot; information as information that would change the price of a security if it was released or that a reasonable person would want to know before making an investment decision.  Non-Public information is information that is not available to the general public.  That could include information that was released to only a select group of analysts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your example, the lab would be in possession of material non-public information.  The legality of trading on that information is for a lawyer to answer, but it would be a violation of the CFA code of ethics.&lt;/p&gt;&#xA;" OwnerUserId="1418" LastActivityDate="2014-01-23T03:34:41.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10032" PostTypeId="1" CreationDate="2014-01-23T08:43:10.280" Score="1" ViewCount="1965" Body="&lt;p&gt;I'm using a cloud machine with 512 RAM to store tick data in mysql, but I'm having trouble querying candle data. My current solution is to select all data within a time interval and do the tick -&gt; candle conversion in the browser, but that calculation is too heavy for long time ranges. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I looked at similar questions, did some research on time series databases, even considered database as service solutions. (I'm still contacting one of them to see if they would provide the missing data for candles)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given about 5 tick data per second (these belong to different assets),&#xA;And low budget hardware (512 RAM, 1 Core, 15 GB empty disk),&#xA;When I need to aggregate the data into candles of arbitrary periods,&#xA;Which existing database solution would be more appropriate?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current solution is to store an additional indexed columns with time rounded to 5 minutes, 10 minutes, 30 minutes, 1 hour, 5 hours, 1 day and I wrote mysql queries which can produce &lt;code&gt;asset/open/high/low/close/start_time/end_time&lt;/code&gt; rows according to these columns in an attempt to speed up the queries. However, whatever index I use and however I optimize the queries, they end up taking seconds (and not milliseconds) which is unacceptable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any databases built to solve my problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: guys at tempodb said that they just added &lt;code&gt;first&lt;/code&gt; and &lt;code&gt;last&lt;/code&gt; aggregate functions to their api :-)&#xA;Min, max, first and last is all I needed to create bar data&lt;/p&gt;&#xA;" OwnerUserId="6977" LastEditorUserId="6977" LastEditDate="2014-01-24T08:59:46.220" LastActivityDate="2014-02-26T20:39:21.643" Title="Free database for storing intraday tick data and querying bar (candle) data on budget hardware" Tags="&lt;database&gt;" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="10033" PostTypeId="2" ParentId="10029" CreationDate="2014-01-23T10:38:16.963" Score="3" Body="&lt;p&gt;I will try to give a simple technique for Identifying $ARIMA(p,d,q)$ orders for a time series. It's an empirical technique, but the results are very closed to techniques based on $AIC$ or $BIC$ criterions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;-Indentifying the Integration order&lt;/strong&gt; $d$ :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's the first parameter to determine, indeed the ARMA models are based on the assumption that your time series $\{x_t\}$ is stationary. So, you should start by testing the stationarity of $x_t$ using Dickey–Fuller test for example (the is many other tests). If it's stationary then $d=0$, otherwise try a first integration $y_t = \Delta x_t = (x_{t+1}-x_t)$ and test for stationarity (generaly a first integration is sufficient), hence $d=1$, other whise try a first integration on $y_t$, thus $d=2$ and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's assume $d=0$ (so that your x_t is already stationary)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;-Indentifying the AutoRegressive (AR) order&lt;/strong&gt; $p$ :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To determine this order, plot the &lt;em&gt;Partial AutoCorrelation Function&lt;/em&gt; (PACF) of $x_t$, then $p$ will be the maximum lag at which the PACF is significant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;-Indentifying the Moving Average (MA) order&lt;/strong&gt; $q$ :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Plot the &lt;em&gt;AutoCorrelation Function&lt;/em&gt; (ACF) of $x_t$, and set $q$ to be the maximum lag at wich the ACF is significant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus you get your empirical model $ARIMA(p,d,q)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are using &lt;strong&gt;R&lt;/strong&gt;, you can to try to fit a model to your series by using &lt;code&gt;auto.arima&lt;/code&gt; function from &lt;code&gt;forecast&lt;/code&gt; package, and you will notice that the $AIC$ and $BIC$ criterions of this model are very closed the those of the automatic fitted model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The techniques I explained above are inspired from the book &lt;strong&gt;Analysis of Financial Time Series&lt;/strong&gt; ($3^{rd}$ Edition, by RUEY S. TSAY)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From my opinion, it's more interesting to do it this way, because you understand the relations between your parameters($\theta_i, \phi_j$ of the ARMA) and the ACF, PACF values, but also the economical justifications(how much laged days...).&lt;/p&gt;&#xA;" OwnerUserId="6189" LastActivityDate="2014-01-23T10:38:16.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10034" PostTypeId="2" ParentId="10017" CreationDate="2014-01-23T12:51:43.317" Score="2" Body="&lt;p&gt;The derivation on page 238 in &lt;strong&gt;Martingale Methods in Financial Modelling&lt;/strong&gt; by Marek Musiela, Marek Rutkowski is very detailed and you won't find anything better.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't hesitate to ask about details here if there are something that you do not understand!&lt;/p&gt;&#xA;" OwnerUserId="2376" LastActivityDate="2014-01-23T12:51:43.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10035" PostTypeId="2" ParentId="10015" CreationDate="2014-01-23T12:57:28.357" Score="1" Body="&lt;p&gt;On one side there's a lot like &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S1007570411006502&quot; rel=&quot;nofollow&quot;&gt;A lattice Boltzmann model for the Fokker–Planck equation&lt;/a&gt;, on the other get a look at any PDE pricing method under diffusions. Also &lt;a href=&quot;http://www.ntu.edu.sg/home/nprivault/papers/fokker_planck.pdf&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; is more directly on pricing.&lt;/p&gt;&#xA;" OwnerUserId="3015" LastEditorUserId="3015" LastEditDate="2014-01-23T13:09:46.397" LastActivityDate="2014-01-23T13:09:46.397" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10036" PostTypeId="2" ParentId="10011" CreationDate="2014-01-23T15:35:26.333" Score="5" Body="&lt;p&gt;No, you cannot decompose a barrier option as a linear combination of European options. You can find the derivation of the formula in Musiela &amp;amp; Rutkowsi pg.235, for example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I can tell you that your formula is wrong because if $S_t&amp;lt;S_0e^b$ the price should be zero but in your equation this does not happen. Also note that your equation is nothing else than&#xA;$$&#xA;(1 - e^{2\mu\sigma^2})C(T,K)&#xA;$$&#xA;which implies that a barrier option is equivalent to a leveraged call option, and this is not true.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: The knock-out call formula for completeness. Strike $K$, barrier level $H&amp;gt;K$&#xA;$$&#xA;\Pi_{\text{KO-Call}}(S_0;T,K,H) = C(S_0;T,K) - \left(\frac{S}{H}\right)^{\frac{2(r-q)}{\sigma^2}-1}C\left(\frac{H^2}{S_0};T,K\right) \ .&#xA;$$&#xA;This formula is valid for $S_0&amp;gt;H$. Note that the price is zero when $S_0=H$ .&lt;/p&gt;&#xA;" OwnerUserId="1704" LastEditorUserId="1704" LastEditDate="2014-01-23T16:00:01.100" LastActivityDate="2014-01-23T16:00:01.100" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10037" PostTypeId="2" ParentId="9509" CreationDate="2014-01-23T16:16:54.503" Score="4" Body="&lt;p&gt;A really simple and arbitrage free solution is to extrapolate flat volatility on the same moneyness.&#xA;Let's say that you want an implied volatility for strike &lt;span class=&quot;math-container&quot;&gt;$K$&lt;/span&gt; at time &lt;span class=&quot;math-container&quot;&gt;$t&amp;lt;t_1$&lt;/span&gt;, and &lt;span class=&quot;math-container&quot;&gt;$t_1$&lt;/span&gt; is the first pillar on the surface.&lt;/p&gt;&#xA;&lt;p&gt;You look at the moneyness level &lt;span class=&quot;math-container&quot;&gt;$k=K/F_t$&lt;/span&gt;, then look for &lt;span class=&quot;math-container&quot;&gt;$K'$&lt;/span&gt; to get the volatility at the same moneyness level of the first pillar &lt;span class=&quot;math-container&quot;&gt;$k=K'/F_{t_1}$&lt;/span&gt;. This is &lt;span class=&quot;math-container&quot;&gt;$K'=\frac{K}{F_t}F_{t_1}$&lt;/span&gt;.&#xA;Then, you take the volatility&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;\sigma\left(t_1,\frac{K}{F_t}F_{t_1}\right)\ . &#xA;$$&lt;/span&gt;&#xA;It is easy to show that this method is calendar arbitrage free assuming the Black-Scholes dynamics.&lt;/p&gt;&#xA;" OwnerUserId="1704" LastEditorUserId="51439" LastEditDate="2020-12-24T02:39:10.673" LastActivityDate="2020-12-24T02:39:10.673" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="10039" PostTypeId="2" ParentId="9719" CreationDate="2014-01-24T08:30:56.977" Score="5" Body="&lt;p&gt;Glassermann et al. have published an approach where the &lt;strong&gt;loss distribution is approximated by a quadratic function in the risk factors&lt;/strong&gt;. Based on this estimation they can apply importance sampling and stratified sampling to reduce the variance of the monte carlo estimate. I have not implemented their technique, but their numerical results look very good.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find the paper here:&#xA;&lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.47.923&quot; rel=&quot;noreferrer&quot;&gt;&quot;Variance reduction techniques for estimating Value-at-Risk&quot;&lt;/a&gt;, R. Glassermann, P. Heidelberger, and P. Shahabuddin, Management Science, 46(10), p. 1349-1364, 2000.&lt;/p&gt;&#xA;" OwnerDisplayName="user1157" LastActivityDate="2014-01-24T08:30:56.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10040" PostTypeId="2" ParentId="9660" CreationDate="2014-01-24T08:57:24.553" Score="0" Body="&lt;p&gt;ION's MarketView will do a lot of that too, but they didn't have equity coverage last time I looked. Historically the firm came out of the inter dealer EGB market (MTS).&lt;/p&gt;&#xA;" OwnerUserId="7075" LastEditorUserId="7075" LastEditDate="2014-01-28T14:33:55.233" LastActivityDate="2014-01-28T14:33:55.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10041" PostTypeId="1" CreationDate="2014-01-24T10:10:01.743" Score="2" ViewCount="810" Body="&lt;p&gt;I want to use Quasi Monte Carlo to try and improve the convergence of a simulation I am running.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The random numbers are simply to produce the observation errors for a standard linear regression model. Which is then estimated using a number of different regression techniques. This is done repeatedly to estimate the mean square error of each model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm fairly new to Quasi Monte Carlo but is is likely to help in this situation I am just using it to produce 10k random numbers. It seems that generally I can expect quicker convergence of the order of (1/n) rather than n^(-0.5):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Quasi-Monte_Carlo_method&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Quasi-Monte_Carlo_method&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However it also states that the QMC numbers are not truly random, so I just wonder what the implications might be for any statistical tests I might want to run on the results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1.) I guess what I want to know are the pros and cons of MC v QMC. (would you always want to use QMC if its available?) 2.) What tests can I use to ascertain which is best for my application? (seems any test that depends on the numbers being truly random will fail?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that this can be done in Matlab using&lt;/p&gt;&#xA;&#xA;&lt;p&gt;q = qrandstream('halton',NSteps,'Skip',1e3,'Leap',1e2); &#xA;RandMat = qrand(q,NRepl); &#xA;z_RandMat = norminv(RandMat,0,1);&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is taken from this paper.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=1519239&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=1519239&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems there are other low discrepancy numbers such as Sobol sequence available in Matlab and again would just like to know what tests I can use to ascertain which is best for my situation.&lt;/p&gt;&#xA;" OwnerUserId="7077" LastActivityDate="2014-01-24T14:38:10.533" Title="Quasi Monte Carlo in Matlab" Tags="&lt;monte-carlo&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10042" PostTypeId="1" AcceptedAnswerId="10044" CreationDate="2014-01-24T14:37:09.100" Score="1" ViewCount="5690" Body="&lt;p&gt;Many papers, e.g. in The Journal of Finance, discuss DGTW adjusted returns (or DGTW abnormal returns) instead of just returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are these and how does one compute them?&lt;/p&gt;&#xA;" OwnerUserId="7078" LastEditorDisplayName="user1157" LastEditDate="2014-01-24T17:38:23.143" LastActivityDate="2020-07-12T19:08:50.913" Title="What are DGTW adjusted returns?" Tags="&lt;returns&gt;&lt;finance&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10043" PostTypeId="2" ParentId="10041" CreationDate="2014-01-24T14:38:10.533" Score="2" Body="&lt;p&gt;One of the main things you give up is a simple halting condition for your estimation algorithm.  With pseudorandom numbers, the algorithm can keep track of the standard error, and stop when it has passed a threshold:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;error_est = Inf&#xA;n = 0&#xA;while not error_est &amp;lt; target_precision:&#xA;    n = n + 1&#xA;    x = new_random_sample()&#xA;    samples.append( F(x) )&#xA;    error_est = 3 * std_deviation( samples ) / sqrt(n)&#xA;value_est = mean( samples ) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since with QR sequences your error estimate can't be taken from the standard deviation, you cannot apply this algorithm.  Instead, practitioners often either just choose a number of samples to take &lt;em&gt;a priori&lt;/em&gt;, or set up a halting condition that checks for the running mean to be changing very little.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for tests of one sequence versus another, the typical approach is to set up a large suite of sample problems.  The winner is then the QR sequence that has the best computation time to precision tradeoff on the problem suite.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When we did this for equity exotics in the 1990s, we found Niederreiter sequences beat Sobol and Faure, though by a very small amount.       &lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2014-01-24T14:38:10.533" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10044" PostTypeId="2" ParentId="10042" CreationDate="2014-01-24T14:53:20.263" Score="4" Body="&lt;p&gt;Following Daniel, Grinblatt, Titman, and Wermers (1997) &amp;quot;D.G.T.W.!&amp;quot;, DGTW subtracts from each stock&#xA;return the return on a portfolio of ﬁrms matched on market equity, market-book, and prior one-year return quintiles.&lt;/p&gt;&#xA;&lt;p&gt;Daniel, K., Grinblatt, M., Titman, S., Wermers, R., 1997. &lt;a href=&quot;http://terpconnect.umd.edu/%7Ewermers/dgtw.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Measuring mutual fund performance with characteristic-based benchmarks&lt;/a&gt;, Journal of Finance 52, 1035–1058.&lt;/p&gt;&#xA;&lt;p&gt;The DGTW paper tries to &lt;strong&gt;decide whether stock funds are good in picking stocks and timing the market&lt;/strong&gt;. My understanding is that the intended application of DGTW returns is to have a criterion for stocks which outperfrom its benchmark and then make conclusions about the stock-picking abilities of the fund manager. Of course the same principle applies for other stock picking entities, such as computer algorithms.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Edit&lt;/em&gt;: you can &lt;a href=&quot;http://terpconnect.umd.edu/%7Ewermers/ftpsite/Dgtw/coverpage.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;download&lt;/strong&gt; the benchmark returns&lt;/a&gt; from the homepage of one of the authors.&lt;/p&gt;&#xA;" OwnerDisplayName="user1157" LastEditorUserId="-1" LastEditorDisplayName="user1157" LastEditDate="2020-07-12T19:08:50.913" LastActivityDate="2020-07-12T19:08:50.913" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="10045" PostTypeId="2" ParentId="9034" CreationDate="2014-01-24T17:57:17.300" Score="3" Body="&lt;p&gt;Glassermans's book suggests the &lt;strong&gt;stock price&lt;/strong&gt; as the default idea for a control variate.&#xA;In this paper, &lt;a href=&quot;http://arno.uvt.nl/show.cgi?fid=92651&quot; rel=&quot;nofollow&quot;&gt;&quot;Efficient, almost exact simulation of the Heston stochastic volatility model&quot;&lt;/a&gt;, by Haastrecht and Pelsser, (2008) the authors claim that this approach also works well for the Heston model (see appendix A2).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The book is very approachable and available online: &lt;a href=&quot;https://camjclub.wikispaces.com/file/view/Monte%20Carlo%20Methods%20In%20Financial%20Engineering.pdf/367817134/Monte%20Carlo%20Methods%20In%20Financial%20Engineering.pdf&quot; rel=&quot;nofollow&quot;&gt;Monte Carlo Methods in Financial Engineering&lt;/a&gt;, Paul Glasserman, 2003. &lt;/p&gt;&#xA;" OwnerDisplayName="user1157" LastActivityDate="2014-01-24T17:57:17.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10046" PostTypeId="2" ParentId="10032" CreationDate="2014-01-24T19:37:10.563" Score="1" Body="&lt;p&gt;I would recommend de-normalising the data or using a document database such as NoSQL or MongoDB. These provide a speed advantage when performing select statements as there would be no need to lookup or join data from other tables. An advantage of using a document database is that they store data in an industry standard format such as JSON or XML so it should be easy to pull all the data client side and perform your transformations there instead of having to rely on your server to perform the calculations.&lt;/p&gt;&#xA;" OwnerUserId="7081" LastActivityDate="2014-01-24T19:37:10.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10047" PostTypeId="1" CreationDate="2014-01-25T08:45:49.557" Score="2" ViewCount="292" Body="&lt;p&gt;Good morning!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was looking at an order book yesterday and saw orders which I haven't seen before. Normally an order in the order book consists of the total volume, the price and how many sellers/buyers are ready to buy/sell for this price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/rZQez.png&quot; alt=&quot;Order Book snippet&quot;&gt;&#xA;&lt;br&gt;1722 is the volume, 3 is the amount of buyers and 13.80 is the price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Now to the question&lt;/strong&gt;: The order which I found were strange, had a volume, a price, but no amount of buyers/sellers. The looked like &lt;em&gt;1722(-) 13.80&lt;/em&gt;. What also was very strange was that there was always for example a volume of 4000 on the byers site and the exactly same volume on the sellers site, but they did never hit each other, there was always a spread. A third strange thing was that these orders were updated nearly every 5 seconds, so I think these orders must come from a computer system and not from a human being.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone please explain to me what these orders were? I would also appreciate some background information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance.&lt;/p&gt;&#xA;" OwnerUserId="7087" LastEditorUserId="7087" LastEditDate="2014-01-27T10:04:57.567" LastActivityDate="2015-05-15T08:23:09.060" Title="Where do these Orders come from and what do they mean?" Tags="&lt;order&gt;&lt;orderbook&gt;" AnswerCount="2" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="10048" PostTypeId="1" AcceptedAnswerId="17608" CreationDate="2014-01-25T15:40:57.847" Score="9" ViewCount="8224" Body="&lt;p&gt;I would like to understand the role of alpha (intercept) in the regression-based asset pricing model or $n$-factor models; one of the most famous of those one is the Fama-French 3-factor model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;About this kind of model particularly, what's the meaning of the intercept? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that, technically speaking, from an econometric point of view, it should be the value assumed by the dependent variable on average, given the independent variables of the model set to be equal to 0. But, how can you interpret that from an economic point of view? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does it have to be necessarily significant and equal to zero in order that the model can model properly the asset prices?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I looked some answers for the internet, but I found only contradictory opinions.&#xA;Thanks for helping.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-05-01T11:26:35.357" LastActivityDate="2020-03-04T20:53:55.150" Title="What's the meaning of the intercept in asset pricing model?" Tags="&lt;regression&gt;&lt;econometrics&gt;&lt;factor-models&gt;&lt;asset-pricing&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10049" PostTypeId="1" AcceptedAnswerId="10051" CreationDate="2014-01-25T20:23:18.620" Score="4" ViewCount="351" Body="&lt;p&gt;I am unsure how to start with the following problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have two contingent claims where contingent claim (1) pays $\int_0^T S_u du$ and contingent claim (2) pays $(\log S_T)^2$ at time $T$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I would like to use the Black-Scholes model to get their time-zero prices&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the BS formula $C(S_0,K,\sigma,r,T)=S_0\Phi(d_1)-Ke^{-rT}\Phi(d_2)$ with $d_1=d_2+\sigma\sqrt{T}, d_2=\frac{\log{K/S_0}-(r-\frac{1}{2} \sigma^2)T}{\sigma\sqrt{T}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where I can I include the expressions from above?&lt;/p&gt;&#xA;" OwnerUserId="6353" LastActivityDate="2014-01-27T21:41:44.003" Title="Time-zero price of two specific contingent claims" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10050" PostTypeId="1" AcceptedAnswerId="10059" CreationDate="2014-01-25T20:36:06.137" Score="1" ViewCount="292" Body="&lt;p&gt;I'm hoping that someone could help better explain why $\sigma$ (equation 2.19) must be multiplied by $\frac{4n}{4n + 1}$.  Obviously all the math is there.  Perhaps someone can make this easier to understand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reference is here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://books.google.com/books?id=mhB8Yx8jshcC&amp;amp;pg=PA25&quot; rel=&quot;nofollow&quot;&gt;http://books.google.com/books?id=mhB8Yx8jshcC&amp;amp;pg=PA25&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6151" LastEditorUserId="6151" LastEditDate="2014-01-25T20:56:51.890" LastActivityDate="2014-01-26T20:38:37.233" Title="First Exit Time Based Volatility" Tags="&lt;volatility&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10051" PostTypeId="2" ParentId="10049" CreationDate="2014-01-25T22:00:58.490" Score="3" Body="&lt;p&gt;Assuming the filtration is generated by Brownian Motion, you know that the price of a contingent claim is just the expectation under the risk neutral measure $Q$. Hence for the first one&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E_Q[\int_0^TS_udu]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $S$ has the dynamic: $S_t=S_0e^{\sigma W^Q_t-(\frac{1}{2}\sigma^2-r)t}$, where $W^Q_t=W_t+\frac{\mu-r}{\sigma}$ is the Girsanov chagned Brownian Motion. Hence $S_t$ has a lognormal distribution under $Q$. Therefore $S_t&amp;gt;0$ and you can use Fubinis Theorem to interchange the order of integration:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$e^{-rT}\int_0^T S_0E_Q[S_u]du=S_0\int_0^Te^{-\frac{1}{2}\sigma^2u+\frac{1}{2}\sigma^2u+ru}du=\frac{1}{r}e^{-rT}S_0(e^{rT}-1)=\frac{1}{r}S_0(1-e^{-rT})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can approach the second one in the exact same way. &lt;/p&gt;&#xA;" OwnerUserId="17133" LastEditorUserId="17133" LastEditDate="2014-01-27T21:15:37.500" LastActivityDate="2014-01-27T21:15:37.500" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="10052" PostTypeId="2" ParentId="10049" CreationDate="2014-01-26T01:35:27.060" Score="2" Body="&lt;p&gt;I think we can compute the price of the first contingent claim at time 0 without using any models (e.g., Black-Scholes). For the first claim, &#xA;$$&#xA; V_0 = e^{-r T} \mathbb{E}^Q \left[ \int_0^T S_u \; du\middle \vert \cal{F}_0\right] &#xA; = e^{-r T} \int_0^T \mathbb{E}^Q \left[ S_u \middle \vert \cal{F}_0\right] du \; .&#xA;$$&#xA;Since the price of a forward that matures at time $T$ is $\mathbb{E}^Q \left[ S_T \middle \vert \cal{F}_0\right] = S_0 e^{rT}$, I get&#xA;$$&#xA;V_0 = \frac{S_0}{r} \left( 1-e^{-rT}\right) \; .&#xA;$$&#xA;I want to stress again that this result is model-free.&lt;/p&gt;&#xA;" OwnerUserId="3188" LastEditorUserId="3188" LastEditDate="2014-01-27T21:41:44.003" LastActivityDate="2014-01-27T21:41:44.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10053" PostTypeId="1" AcceptedAnswerId="10056" CreationDate="2014-01-26T05:06:43.920" Score="5" ViewCount="3145" Body="&lt;p&gt;I have a bunch of time series; i need to clean them before modelling. So far I just know the “filtering/smoothing” method :&#xA;-Ex: moving average methodology (filter the data with a moving average (filter), then obtain a noise (serie  minus filter) and remove data points which correspond to a high noise (i.e with a specific threshold) :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(simple) Example of the moving average filter method with three outliers :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Data and filter :&#xA;&lt;img src=&quot;https://i.stack.imgur.com/owrCl.png&quot; alt=&quot;enter image description here&quot;&gt;&#xA;Noise and threshold :&#xA;&lt;img src=&quot;https://i.stack.imgur.com/GbEqG.png&quot; alt=&quot;enter image description here&quot;&gt;&#xA;Cleaned data :&#xA;&lt;img src=&quot;https://i.stack.imgur.com/0FFRS.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you recommend a specific filter ? do you know a better &lt;strong&gt;automatic&lt;/strong&gt; method ?&lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2014-01-26T13:41:50.707" LastActivityDate="2014-01-27T16:55:32.717" Title="How to remove outliers in financial times series?" Tags="&lt;time-series&gt;&lt;numerical-methods&gt;&lt;outliers&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10054" PostTypeId="2" ParentId="10048" CreationDate="2014-01-26T09:08:20.420" Score="8" Body="&lt;p&gt;Glad you've asked :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Technically speaking, in factor model $\alpha$ stays for return or risk premia, which asset pays when all factor returns are zero. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, to answer question in more details, we have to specify, are we dealing in our model with return ($R_i$ for asset $i$) or with risk premia over risk free ($R_i-R_f$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the first case, interpretation of $\alpha$ is straightforward: most probably, it's $R_f$. As for latter case, this is one of white spot in my understanding of modern finance. I don't know correct answer. As far as I understand, in efficient market it should be equal to zero. If not - market is inefficient. Or there is still some risk factor which is priced, but not reflected in the model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or may be something else. In fact, for several months after discovering &lt;a href=&quot;http://quant.stackexchange.com&quot;&gt;http://quant.stackexchange.com&lt;/a&gt; I was going to ask that question myself someday :) So, let me humbly join the questioning crowd.&lt;/p&gt;&#xA;" OwnerUserId="6535" LastEditorUserId="6535" LastEditDate="2014-01-26T09:13:51.043" LastActivityDate="2014-01-26T09:13:51.043" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10055" PostTypeId="2" ParentId="10053" CreationDate="2014-01-26T14:25:54.323" Score="3" Body="&lt;p&gt;The is many techniques for Outliers Detection. I separate them into &lt;em&gt;Global&lt;/em&gt; and &lt;em&gt;Local&lt;/em&gt; techniques.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-One of the &lt;em&gt;Global&lt;/em&gt; techniques I usually use is the &lt;strong&gt;Winsorization&lt;/strong&gt; which consiste on replacing the extremes values on the density distribution by the value corresponding to a certain quantile. For example, you replace all the values bellow the 5% quantile by this one, and all the values above the 95% quantile by this one. This technique could be helpful if you want to exclude a certain period, let say a crisis period, from you data to have only the regular period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-For local techniques, I would recommend the &lt;a href=&quot;http://www.dbs.ifi.lmu.de/Publikationen/Papers/LOF.pdf&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Local Outlier Factor&lt;/strong&gt;&lt;/a&gt;, I discovered it recently, and I believe that it's a good technique to deal with some unexpected events on the market for a singular day, or for data issues from the data providers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For &lt;strong&gt;automatic&lt;/strong&gt; methods, the first one is very easy to implement, you just need to specify the quantile threshold, the second one is bit more complicated but there is some implementation in &lt;strong&gt;R&lt;/strong&gt; that could help!&lt;/p&gt;&#xA;" OwnerUserId="6189" LastActivityDate="2014-01-26T14:25:54.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10056" PostTypeId="2" ParentId="10053" CreationDate="2014-01-26T15:20:48.170" Score="10" Body="&lt;p&gt;Not so fast! I think it is of the utmost importance to first examine whether the data points are real outliers, i.e. noise that is contaminating the data, or perhaps the most important pieces of the time series!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example when you look at US stock market data of the last 50 years and remove only the ten biggest moves because they are &lt;em&gt;outliers&lt;/em&gt; you get a completely different time series!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://books.google.de/books?id=7wMuF4A4XF8C&amp;amp;lpg=PP1&amp;amp;dq=the%20black%20swan&amp;amp;pg=PA276#v=onepage&amp;amp;q&amp;amp;f=false&quot; rel=&quot;noreferrer&quot;&gt;See page 276 of &lt;em&gt;The Black Swan from Nassim Taleb&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you have to be &lt;em&gt;extremely&lt;/em&gt; careful and double check all the data points you remove by whatever available method out there!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general what you consider an outlier also very much depends on the model you are using. So what seems to be an outlier in one model (e.g. a linear model) is part of the package in a more complex model (e.g. a non-linear model). So it is also a matter of experience how to proceed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So all in all I think there is no easy answer to your question. A good starting point may be the first chapter of the following new book (2013) which is available online:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.charuaggarwal.net/outlierbook.pdf&quot; rel=&quot;noreferrer&quot;&gt;Outlier analysis by C. Aggarwal&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On a more practical note you can use the forecast-package in R in its new version 5.0 from Rob Hyndman. The new version was just released (27/01/2014) and has upgraded functionality for preprocessing time series and outliers:&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://robjhyndman.com/hyndsight/forecast5/&quot; rel=&quot;noreferrer&quot;&gt;http://robjhyndman.com/hyndsight/forecast5/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2014-01-27T12:40:26.400" LastActivityDate="2014-01-27T12:40:26.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10059" PostTypeId="2" ParentId="10050" CreationDate="2014-01-26T20:38:37.233" Score="5" Body="&lt;p&gt;Before answering our question, I would like to remind you of the following definition:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Unbiased Estimator:&lt;/strong&gt;   $\hat{\theta}$ is an unbiased estimator of $\theta$ if $\mathbb{E}[\hat{\theta}]=\theta$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's assume having a sample $\{x_1, x_2,..., x_n\}$, and you want an Unbiased Estimator of it's variance $\sigma^2$, then the following estimator satisfies this property :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\hat{\sigma^2} = \frac{1}{n-1}\sum_{i=1}^{n}(x_i - \hat{\bar{x}})^2$, where $\hat{\bar{x}}=\frac{1}{n}\sum_{i=1}^{n}x_i$ (which is also an unbiased estimator of the mean $\bar{x}$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you want an unbiased estimator of the standard deviation $\sigma$, then you cannot just take the square root of $\hat{\sigma^2}$, because due to the &lt;a href=&quot;http://en.wikipedia.org/wiki/Jensen%27s_inequality&quot;&gt;Jensen's Inequality&lt;/a&gt;&#xA;applied to the case of a concave function $x \rightarrow \phi(x)$ (which the case of $x \rightarrow \sqrt x$) taking the square root of the previous estimator leads to an biased estimator of the standard deviation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But fortunately, an application of &lt;a href=&quot;http://en.wikipedia.org/wiki/Cochran%27s_theorem&quot;&gt;Cochran's Theorem&lt;/a&gt; shows that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if we denote $s = \sqrt{\frac{1}{n-1}\sum_{i=1}^{n}(x_i - \hat{\bar{x}})^2}$ then $\sqrt{n-1}\frac{s}{\sigma}$ has a $\chi_{n-1}$ distribution. Which leads to :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb{E}[s]= (\sqrt{\frac{2}{n-1}}\frac{\Gamma(\frac{n}{2})}{\Gamma(\frac{n-1}{2})}) \sigma = (1 + \frac{1}{4n} + O(\frac{1}{n^2})) \sigma = (\frac{4n+1}{4n} + O(n^{-2}))\sigma\approx\frac{4n+1}{4n}\sigma$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence if you want to get an unbiased estimator of the standard deviation (to a certain approximation) you need to use:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$s' = \frac{4n}{4n+1} s$ and thus $$\mathbb{E}[s']= \frac{4n}{4n+1} \mathbb{E}[s]=(\frac{4n}{4n+1})(\frac{4n+1}{4n})\sigma = \sigma$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this will help!&lt;/p&gt;&#xA;" OwnerUserId="6189" LastActivityDate="2014-01-26T20:38:37.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10060" PostTypeId="1" CreationDate="2014-01-26T22:19:51.033" Score="1" ViewCount="265" Body="&lt;p&gt;have any practitioners here worked with the downside deviation metric? I've looked a little into its concepts but wish to know its utility in practice (if any). Does it bring any value to risk measurement or allocation strategies?&lt;/p&gt;&#xA;" OwnerUserId="6989" LastEditorDisplayName="user1157" LastEditDate="2014-01-31T14:53:20.347" LastActivityDate="2014-01-31T14:53:20.347" Title="Downside deviation" Tags="&lt;risk&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10061" PostTypeId="1" AcceptedAnswerId="10062" CreationDate="2014-01-27T02:58:40.733" Score="0" ViewCount="902" Body="&lt;p&gt;How can I calculate the sum of square deviations between two normalized price series according to &lt;a href=&quot;http://stat.wharton.upenn.edu/~steele/Courses/434/434Context/PairsTrading/PairsTradingGGR.pdf&quot; rel=&quot;nofollow&quot;&gt;(Gatev et. co 2006)&lt;/a&gt;? My normalized price series of stocks $X$ and $Y$ consist of the cumulative total daily (log) returns of adjusted close series for stock data taken from Yahoo Finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to some research on the internet it seems I am to:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Divide the time series of the share prices by the price on the first&#xA;  day of the pairs identification period and then subtract the two new&#xA;  time series from each other, square these differences and sum the&#xA;  result. The smaller the value, the more likely the two stocks are to&#xA;  be a good pair.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If that were the case, I would end up with the formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$SSD=\sum(\frac{x_1,x_2,..,x_n}{x_1}-\frac{y_1,y_2,..,y_n}{y_1})^2$$&#xA;Where $X=(x_1,x_2,..x_n)$ and $Y=(y_1,y_2,..y_n)$ are stock price series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But according to other research, sum of squared deviations refers simply to sum of squares, so then the formula is:&#xA;$$SS = \sum((x_1,x_2,..,x_n)-\frac{x_1+x_2+..+x_n}{n})^2,or\sum(X-\bar{X})^2$$&#xA;But how would I incorporate $Y$ into the second one? Subtract the two results so $SS(X)-SS(Y)$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If anyone could shed some light on the issue, that'd be fantastic!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="7034" LastEditorUserId="7034" LastEditDate="2014-01-27T03:25:29.150" LastActivityDate="2014-01-27T07:17:34.370" Title="Calculating the Sum of Squared Deviations between two Normalized Price Series" Tags="&lt;equities&gt;&lt;statistics&gt;&lt;price&gt;&lt;mean&gt;&lt;normalization&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10062" PostTypeId="2" ParentId="10061" CreationDate="2014-01-27T07:17:34.370" Score="0" Body="&lt;p&gt;Choosing to mark this question &quot;Answered&quot; as @user2763361 has pointed out that there is no &quot;correct&quot; answer. I've chosen to go with the first equation according to a UBS Monograph. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="7034" LastActivityDate="2014-01-27T07:17:34.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10063" PostTypeId="2" ParentId="4201" CreationDate="2014-01-27T08:37:55.490" Score="8" Body="&lt;p&gt;Short answer: &lt;strong&gt;there are multiple optimal mixed (i.e. non-deterministic) strategies&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long answer: There is an equivalent game, called &lt;a href=&quot;https://en.wikipedia.org/wiki/Liar%27s_dice&quot; rel=&quot;noreferrer&quot;&gt;bluff or liar's dice&lt;/a&gt;, which is played using dice. Each player has a number of dice, and can see only their own rolls. The game consists of claims on the whole pool of the dice of all players, for example &quot;there are at least 4 dice showing 5&quot;. The players take turns where they can either call or raise. A raise means to either increase the number each dice has to show, or increase the number of dice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For two players and since liar's dice is a zero-sum game, you can apply the &lt;a href=&quot;https://en.wikipedia.org/wiki/Minimax&quot; rel=&quot;noreferrer&quot;&gt;mini-max argument&lt;/a&gt; to show that it must have at least one optimal strategy. For more players Nash showed that there is always a set of optimal strategies at &lt;a href=&quot;https://en.wikipedia.org/wiki/Nash_equilibrium&quot; rel=&quot;noreferrer&quot;&gt;Nash equilibrium&lt;/a&gt;. These can't be deterministic strategies though, since a deterministic strategy would reveal information about the players dice to the opponent. Lanctot and Long use a computer program to find a &lt;a href=&quot;http://webdocs.cs.ualberta.ca/~lanctot/files/675proj/report.pdf&quot; rel=&quot;noreferrer&quot;&gt;solution for 2 the dice, 2 people game&lt;/a&gt; of bluff. They also show how &lt;em&gt;Liar's dice can be expressed as a linear program&lt;/em&gt;. Since linar programs have have convex feasible regions, Liar's dice has multiple pairs of optimal strategies at Nash equilibrium.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We don't know much about how these optimal strategies look like, though.&lt;/p&gt;&#xA;" OwnerDisplayName="user1157" LastEditorDisplayName="user1157" LastEditDate="2014-01-27T14:00:03.670" LastActivityDate="2014-01-27T14:00:03.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10064" PostTypeId="1" AcceptedAnswerId="10074" CreationDate="2014-01-27T09:38:53.197" Score="4" ViewCount="755" Body="&lt;p&gt;I would like to learn more on how &lt;strong&gt;optimal control&lt;/strong&gt; problems are solved for financial applications. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The approach seems to have a lot of interesting applications such as&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;optimal consumption&lt;/li&gt;&#xA;&lt;li&gt;choosing optimal stopping times&lt;/li&gt;&#xA;&lt;li&gt;robust control&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What is the intuitive idea behind the HJB equations and how are they used?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A good introduction or book recommendation would be appreciated as well.&lt;/p&gt;&#xA;" OwnerDisplayName="user1157" LastEditorDisplayName="user1157" LastEditDate="2014-01-27T10:13:49.283" LastActivityDate="2014-01-27T19:19:09.347" Title="How are the Hamilton–Jacobi–Bellman equations used to solve optimal control problems?" Tags="&lt;modern-portfolio-theory&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10065" PostTypeId="1" AcceptedAnswerId="10066" CreationDate="2014-01-27T09:47:56.027" Score="9" ViewCount="3317" Body="&lt;p&gt;Fama-Macbeth (1973) introduce a two stage cross-sectional regression method (&lt;a href=&quot;http://en.wikipedia.org/wiki/Fama%E2%80%93MacBeth_regression&quot;&gt;http://en.wikipedia.org/wiki/Fama%E2%80%93MacBeth_regression&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) If I was to regress stock prices (or returns) on a condtioning set using the Fama-Macbeth regression method, what are the econometric assumptions behind this model? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Is the model still used today or is another model now prefered?&lt;/p&gt;&#xA;" OwnerUserId="7078" LastEditorUserId="7078" LastEditDate="2014-01-27T09:54:21.097" LastActivityDate="2014-01-28T19:53:53.313" Title="What are the econometric assumptions in the Fama-Macbeth procedure (1973)?" Tags="&lt;equities&gt;&lt;statistics&gt;&lt;finance&gt;&lt;econometrics&gt;&lt;statistical-finance&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10066" PostTypeId="2" ParentId="10065" CreationDate="2014-01-27T10:24:16.037" Score="5" Body="&lt;p&gt;2) Alternative to Fama-MacBeth is Fama-French approach. Explanation of difference see, for example, here: &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1271935&quot; rel=&quot;noreferrer&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1271935&lt;/a&gt;&#xA;Fama-French approach was used by Carhart (introduced momentum), Pastor-Stambaugh (introduced liquidity), Fama-French themselves (used it to build 5-factor model), and many other (elsevier or google for &quot;fama french factor model&quot;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fama-MacBeth approach was used in Chen, Roll, Ross, 1986, which is believed to be quite important paper for APT.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is also PCA approach to modelling asset returns. See, e.g., Luedecke, 1984, Connor and Korajczyk, 1988. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In industry, still, scholar models are not used. Practitioners develop their own models, sometimes kept as closely held secret, sometimes - made available to public (BARRA, CSFB, Morgan Stanley, Salomon-Smith-Barney, Bloomberg). Sometimes these models are just overcomplicated versions of scholar models, built with the same approaches. Sometimes they try to use some combination, for example Bloomberg family of models combine PCA with macro- and fundamental approaches. &lt;/p&gt;&#xA;" OwnerUserId="6535" LastEditorUserId="6535" LastEditDate="2014-01-27T10:37:51.660" LastActivityDate="2014-01-27T10:37:51.660" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10068" PostTypeId="2" ParentId="9719" CreationDate="2014-01-27T14:05:02.367" Score="1" Body="&lt;p&gt;The best approach depends very much on your specific requirements and constraints. For example if you know a importance sampling distribution, you can estimate ES but you need to weight the observations in the empirical distribution much as you do when using the MC-estimator for the expectation see these &lt;a href=&quot;http://www.e.kth.se/~hult/KTH_IS_course2.pdf&quot; rel=&quot;nofollow&quot;&gt;slides&lt;/a&gt;. I never really found importance sampling in practice useful though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did successfully implement the approach considered &lt;a href=&quot;http://arxiv.org/pdf/0802.2426&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. The &quot;reduced model&quot; which is necessary for this can be derived from a delta-gamma model, i.e. quadratic approximation model.&lt;/p&gt;&#xA;" OwnerUserId="482" LastActivityDate="2014-01-27T14:05:02.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10072" PostTypeId="2" ParentId="4589" CreationDate="2014-01-27T17:10:28.823" Score="13" Body="&lt;p&gt;To complement @SRKX comment ,i'll try to explain the &quot;simple mathematical proof&quot; beetween both formula :&#xA;I assume you know the geometric or arithmetic brownian motion :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Geometric: &#xA;\begin{equation*}&#xA;dS = \mu S dt + \sigma Sdz &#xA;\end{equation*}&#xA;Arithmetic :&#xA;\begin{equation*}&#xA;dS = \mu  dt + \sigma dz &#xA;\end{equation*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then another important stochastic tool you need to know is the so called Ito Lemma  : Loosely speaking, if a random variable $x$  follows an Ito process : (drift = $ a(x,t) $ et variance = $ b(x,t)^{2} $):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation*}&#xA;dx = a(x,t) dt + b(x,t) dz&#xA;\end{equation*}&#xA;Then another function $G$ which depends of $x$ and $t$ will respect also (ito lemma) the following process :&#xA;\begin{equation*}&#xA;dG = (\frac{\partial G}{\partial x}a + \frac{\partial G}{\partial t}+ \frac{1}{2}\frac{\partial^{2} G}{\partial x^{2}} b^{2}) dt + \frac{\partial G}{\partial x} bdz&#xA;\end{equation*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we replace $x$ by the stock price and take its logarithm: $ G = ln(S)$. We also know :&#xA;\begin{equation*}&#xA;dS = \mu S dt + \sigma Sdz &#xA;\end{equation*}&#xA;then $  a = \mu S $ et $b =  \sigma S $&#xA;and&#xA;\begin{equation*}&#xA;\frac{\partial G}{\partial S} =\frac{1}{S}, \frac{\partial^{2} G}{\partial S^{2}} = - \frac{1}{S^{2}},\frac{\partial G}{\partial t} =0&#xA;\end{equation*}&#xA;using Ito lemma :&#xA;\begin{equation*}&#xA;dG = (\mu - \frac{\sigma^{2}}{2})dt + \sigma dz&#xA;\end{equation*}&#xA;Thus if we investigate the variation of $ln(S)$ (=G) between date zero and date $T$   :&#xA;\begin{equation*}&#xA;ln(S_{T})-ln(S_{0}) \sim \phi[(\mu - \frac{\sigma^{2}}{2})T, \sigma \sqrt{T}]&#xA;\end{equation*}&#xA;\begin{equation*}&#xA;ln(S_{T}) \sim \phi[ln(S_{0})+(\mu - \frac{\sigma^{2}}{2})T, \sigma \sqrt{T}]&#xA;\end{equation*}&#xA;If we  integrate :&#xA;\begin{equation*}&#xA;S(t) = S(0) \exp{(\mu - \frac{\sigma^{2}}{2})t + \sigma (z(t)-z(0))}&#xA;\end{equation*}&#xA;or&#xA;\begin{equation*}&#xA;S(t) = S(0) \exp{(\mu - \frac{\sigma^{2}}{2})t + B_{t}}&#xA;\end{equation*}&#xA;where $ B_{t} $ is a brownian motion.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2014-02-13T18:49:48.087" LastActivityDate="2014-02-13T18:49:48.087" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10074" PostTypeId="2" ParentId="10064" CreationDate="2014-01-27T19:19:09.347" Score="1" Body="&lt;p&gt;See for reference&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Merton 1971 &lt;em&gt;Optimum consumption and portfolio rules in a continuous-time model&lt;/em&gt; is an excellent application of the topic.&lt;/li&gt;&#xA;&lt;li&gt;As @phi mentioned &lt;em&gt;Arbitrage theory in Continuous Time&lt;/em&gt; by Bjork  is an excellent resource as well.&lt;/li&gt;&#xA;&lt;li&gt;Dixit and Pindyck &lt;em&gt;Investment Under Uncertainty&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The pitfall is essentially that in many problems we face the curse of dimensionality. This implies that PDE based approaches are less than practical (often practically impossible in many respects). There is one study which expands on Merton's 1971 work to FOUR ASSETS which essentially represented countries. Recent work by DeTemple Garcia and Rindisbacher 2003 solve the problem of intertemporal portfolio using Monte Carlo methods. See &lt;a href=&quot;https://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=2&amp;amp;cad=rja&amp;amp;ved=0CDEQFjAB&amp;amp;url=http%3A%2F%2Fwww.nccr-finrisk.uzh.ch%2Fmedia%2Fpdf%2FpaperJF_detemple_garcia_rindisbacher.pdf&amp;amp;ei=za7mUtb0MargsASyroHYAw&amp;amp;usg=AFQjCNFZtnt3_4LlJ62nNBgbOPmNWlA1rg&amp;amp;sig2=QPEmfmkZBndbTHjfnCUo0Q&amp;amp;bvm=bv.59930103,d.cWc&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;A Monte Carlo Method for Optimal Portfolios&lt;/em&gt;&lt;/a&gt; Parallel processing on existing infrastructure may make this a more practical approach to intertemporal asset allocation. &lt;/p&gt;&#xA;" OwnerUserId="4910" LastActivityDate="2014-01-27T19:19:09.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10076" PostTypeId="2" ParentId="10032" CreationDate="2014-01-27T20:01:44.723" Score="0" Body="&lt;p&gt;Personally, I use HDF5/PyTables (very quick given that it's free) for the data storage component then use pandas to resample the data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll likely be better off just using flat files than a relational database IMHO. &lt;/p&gt;&#xA;" OwnerUserId="122" LastActivityDate="2014-01-27T20:01:44.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10077" PostTypeId="1" AcceptedAnswerId="10083" CreationDate="2014-01-27T21:15:58.143" Score="7" ViewCount="6888" Body="&lt;p&gt;I am looking for&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a &lt;strong&gt;list&lt;/strong&gt; of day count conventions. Is the &lt;a href=&quot;http://en.wikipedia.org/wiki/Day_count_convention&quot; rel=&quot;nofollow noreferrer&quot;&gt;list on Wikipedia&lt;/a&gt; complete or do you know others?&lt;/li&gt;&#xA;&lt;li&gt;Which &lt;strong&gt;rules of thumb&lt;/strong&gt; are there to choose day count conventions when none is specified, depending for example on product, country or underlying?&lt;/li&gt;&#xA;&lt;li&gt;Are there &lt;strong&gt;special cases&lt;/strong&gt; which can provoke software bugs?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Edit: results and rules-of-thumb DCC so far:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;1/1&lt;/strong&gt; - ?&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;30/360 US&lt;/strong&gt; - US for corporate, US municipal, and some US Agency bonds&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;30E/360&lt;/strong&gt; - money market Switzerland&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;30E+/360&lt;/strong&gt; - ?&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;30E/360 ISDA&lt;/strong&gt; - ?&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;30/360&lt;/strong&gt; - for corporate bonds, agency and municipal bonds, mortgage backed securities, Eurobonds,  US corporate bonds&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;ACT/360&lt;/strong&gt; - for US T-bills, US commercial paper; US and Euro &amp;amp; Switzerland money markets, mortgages&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;ACT/364&lt;/strong&gt; - Kenya, Zimbabwe&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;ACT/365&lt;/strong&gt; - US Treasury bonds, US treasury notes,  UK gilts; German bunds, South Africa (all markets)&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;ACT/365L&lt;/strong&gt; - ?&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;ACT/365 Fixed&lt;/strong&gt; - ?&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;ACT/ACT&lt;/strong&gt; - New Euro bonds, LIFFE UK bond futures, LIFFE German bund futures&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;ACT/ACT ISDA&lt;/strong&gt; - ?&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;ACT/ACT ISMA&lt;/strong&gt; - ?&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;ACT/ACT ICMA&lt;/strong&gt; - ?&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;ACT/ACT AFB&lt;/strong&gt; - ?&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;NL/365&lt;/strong&gt; - ?&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;BUS/252&lt;/strong&gt; - Brazil&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Refs: &lt;br/&gt;&#xA;&lt;a href=&quot;http://en.wikipedia.org/wiki/Day_count_convention&quot; rel=&quot;nofollow noreferrer&quot;&gt;Wikipedia: day_count_convention&lt;/a&gt;&lt;br/&gt;&#xA;&lt;a href=&quot;http://www.quantonline.co.za/documents/FxDerivatives%20Fin.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Foreign Exchange Derivatives&lt;/a&gt;, by Kotze, 2011&lt;br/&gt;&#xA;&lt;a href=&quot;https://quant.opengamma.io/Interest-Rate-Instruments-and-Market-Conventions.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Interest Rate Instruments and Market Conventions Guide&lt;/a&gt;, by OpenGamma, 2013&lt;br/&gt;&#xA;&lt;a href=&quot;http://www.clarusft.com/implementing-bus252-daycount-convention/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Implementing BUS/252 Daycount Convention&lt;/a&gt;, by Kennedy 2012&lt;br /&gt;&#xA;&lt;a href=&quot;http://eclipsesoftware.biz/DayCountConventions.html#x3_04&quot; rel=&quot;nofollow noreferrer&quot;&gt;ESI: Day Count Conventions&lt;/a&gt;, by Eclipse Software Inc.&lt;br /&gt;&#xA;&lt;a href=&quot;http://www.fincad.com/support/developerfunc/mathref/Daycount.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;Day Count Conventions and Accrual Factors&lt;/a&gt;, by Fincad Corp.&lt;/p&gt;&#xA;" OwnerDisplayName="user1157" LastEditorUserId="18748" LastEditorDisplayName="user1157" LastEditDate="2020-05-19T04:58:36.910" LastActivityDate="2020-05-19T04:58:36.910" Title="Which day count conventions are there and where do they apply?" Tags="&lt;convention&gt;&lt;daycounting&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="10078" PostTypeId="1" CreationDate="2014-01-28T02:43:45.163" Score="3" ViewCount="736" Body="&lt;p&gt;I understand that the ATM volatility of Swaption moves quite frequently and the SABR will need to be recalibrated. Which parameter should I recalibrate?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any financial meanings why we only recalibrate on certain parameters?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="7108" LastActivityDate="2016-12-27T17:07:01.750" Title="Recalibrating SABR parameters for Swaption ATM volatility" Tags="&lt;volatility&gt;&lt;models&gt;&lt;stochastic-volatility&gt;&lt;swaption&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10079" PostTypeId="1" AcceptedAnswerId="10107" CreationDate="2014-01-28T02:45:56.020" Score="1" ViewCount="676" Body="&lt;p&gt;It seems that I should be able to readily compute U.S. market capitalization percentage of global capitalization using data reported from &lt;a href=&quot;http://www.world-exchanges.org/statistics/monthly-reports&quot; rel=&quot;nofollow&quot;&gt;this page&lt;/a&gt; at the World Federation of Exchanges.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I do this?&lt;/p&gt;&#xA;" OwnerUserId="7109" LastEditorUserId="7109" LastEditDate="2014-01-30T02:47:36.303" LastActivityDate="2014-01-30T02:58:04.203" Title="How can I determine U.S. market capitalization percent using WFE data?" Tags="&lt;market-data&gt;&lt;market-capitalization&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10080" PostTypeId="2" ParentId="10079" CreationDate="2014-01-28T03:41:57.830" Score="0" Body="&lt;p&gt;Surprisingly, you're right, I've got 34.16%&lt;/p&gt;&#xA;" OwnerUserId="6535" LastActivityDate="2014-01-28T03:41:57.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10081" PostTypeId="2" ParentId="10060" CreationDate="2014-01-28T03:58:27.507" Score="1" Body="&lt;p&gt;To my knowledge, it's coherent risk measure, featured in Markowitz, 1959. And yes, it is used by practitioners, but as it seems to me - mostly for the purpose of performance evaluation. &lt;/p&gt;&#xA;" OwnerUserId="6535" LastActivityDate="2014-01-28T03:58:27.507" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10082" PostTypeId="2" ParentId="10047" CreationDate="2014-01-28T04:08:42.613" Score="-2" Body="&lt;p&gt;Some execution platforms or markets have a policy to execute order in full volume at one price (fill-or-kill). You would use it on thin market to ensure low slippage. For example, in your case a buy order for 1000 would be filled by 70% at 14.10, which is 30 cents away from best bid, 25 cents (1.7%) away from midquote, and could be considered as too costly by somebody. So, this somebody submitted fill-o-kill order. He bets on hidden liquidity, when the guy on 14.00 in reality have more than 30 to offer, but shy to advertise it to the market :) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually this FoK-order would blink for a second and then cancelled automatically. Perhaps, that's the lag in the platform which makes it visible for more than one picosecond. Or yoctosecond. Or whateversmallsecond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just hypothesis, actually, it might be everything, depending on the market.&lt;/p&gt;&#xA;" OwnerUserId="6535" LastEditorUserId="6535" LastEditDate="2014-01-28T04:16:16.287" LastActivityDate="2014-01-28T04:16:16.287" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10083" PostTypeId="2" ParentId="10077" CreationDate="2014-01-28T12:09:40.190" Score="3" Body="&lt;p&gt;There are lots, decide which ones you actually need for your project - follow the coding maxim You Ain't Gonna Need It. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Be aware that those rules have variants: Actual/365 has 2 varieties, fixed and actual, 30/360 has at least 3 varieties (see that Wikipedia article). Then there is Brazillian Bus/252, etc etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider using a library (like Fincad or Quantlib) which has this stuff set up already and save your time and effort for more interesting things.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2014-01-28T12:09:40.190" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10084" PostTypeId="1" CreationDate="2014-01-28T13:34:17.953" Score="4" ViewCount="1074" Body="&lt;p&gt;I'm looking for documentation on how trade execution is ordered on exchanges with non standard order types. Especially linked/contingent/stop type orders. Any exchange that implements these with continuous auction trading would be good as i'm just trying to get the general idea. I've been searching for terms like &quot;order matching rules&quot; &quot;trade priority rules&quot; etc., but all that comes up are the exchange xxx rules, which deals with trading regulations and not the intricacies of the matching algorithm. Probably i'm just searching for the wrong term. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do get the general idea of price/time and price/pro-rate priority, but this only extends to the basic limit/market orders. As far as i know any special order is added to the book as a basic order whenever it's condition is met, timestamped at the time it was triggered. This however still leads to ambiguity. An example of such a situation is this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The buy side of the books is this: &#xA;size / price &#xA;100 @ 100 &#xA;100 @ 98 &#xA;200 @ 96 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also these stop loss orders are placed. &#xA;size / Stop price / time / od &#xA;10 / 100 / 12:00 / s1&#xA;10 / 100 / 12:01 / s2&#xA;10 / 98 / 11:59  / s3&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume there are no hidden orders. Now a market sell is placed for a size of 300. This raises multiple questions: &#xA;- Is the adding+matching routine of a single order atomic? I.e. the market orders first matches 100 lots @ 100,-. Will any triggered stop orders be added to the book or will the order first be matched with the book as-is? Same goes for the case where the 100 @ 100 bid was actually an iceberg order&#xA;- Say the entire market sell was matched setting the last price at 96. All stop order are now triggered. Stop s1 was placed before s2, yet they were triggered at the same time. s3 was placed even earlier but, triggered later and has a worse price trigger price. So how does the exchange determine the order in which the generated market orders are matched?&lt;/p&gt;&#xA;" OwnerUserId="7112" LastActivityDate="2014-01-28T13:34:17.953" Title="Where do i find the trade execution priority rules for special order types on continous auction markets" Tags="&lt;order-execution&gt;&lt;exchange&gt;&lt;orderbook&gt;" AnswerCount="0" CommentCount="6" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10085" PostTypeId="1" AcceptedAnswerId="10086" CreationDate="2014-01-28T16:32:47.883" Score="1" ViewCount="166" Body="&lt;p&gt;In the wikipedia page on &lt;a href=&quot;http://en.wikipedia.org/wiki/Value_at_risk&quot; rel=&quot;nofollow&quot;&gt;VaR&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The example says:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;For example, if a portfolio of stocks has a one-day 5% VaR of $1 million, there is a 0.05 probability that the portfolio will fall in value by more than $1 million over a one day period if there is no trading.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is the reason for the clause 'if there is no trading'?&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2014-01-29T11:37:41.497" Title="Understanding the VaR example on wikipedia" Tags="&lt;var&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10086" PostTypeId="2" ParentId="10085" CreationDate="2014-01-28T16:51:20.043" Score="0" Body="&lt;p&gt;I think it's related to the parameters of your portfolio! Indeed, as it's a 1-Day VaR, then it tells you that you have 5% propability that your portfolio would fall under 1$M, because the market movements are random and you have 5% chances to be on the bad side of these movements. But if you make a trade (or completely liquidate your position on this portfolio) than you will change the parameters (for example : credit default probability will change if you swap a CCC bond with a AAA bond) of your portfolio!&lt;/p&gt;&#xA;" OwnerUserId="6189" LastEditorUserId="2587" LastEditDate="2014-01-29T11:37:41.497" LastActivityDate="2014-01-29T11:37:41.497" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10087" PostTypeId="1" CreationDate="2014-01-28T16:54:03.683" Score="6" ViewCount="428" Body="&lt;p&gt;My aim is to be able to read and understand almost all of the book by Brigo and Mercurio including HJM, LMM and the Local Vol models. So that I am able to implement these models on my  own. My question is what background do I need to be able to do this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have read Rannie and Baxter as an introduction to Stochastic Calculus and am now reading the book by Shreve. Do I need to read anything else after Shreve as a preparation or will it be sufficient? I am happy to read and put in the hours, as long it helps me understand and master Brigo and Mercurio and then more advanced books on this topic as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your guidance is much appreciated.&lt;/p&gt;&#xA;" OwnerUserId="7117" LastActivityDate="2014-02-28T14:41:14.747" Title="Background required for the book by Brigo and Mercurio" Tags="&lt;interest-rates&gt;&lt;books&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10088" PostTypeId="2" ParentId="10079" CreationDate="2014-01-28T18:26:12.423" Score="0" Body="&lt;p&gt;The United States GDP as a percentage of world GDP is frequently between ~20% and ~30%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A country's total market capitalization starts approximately at GDP and then is shifted up or down based upon inflation, bubbles, busts, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most large countries now have equity markets of some form, so the US's share of market capitalization is trending towards its share of GDP from the time where only a few countries had developed equity markets such as the US, the UK, and the Dutch.&lt;/p&gt;&#xA;" OwnerDisplayName="user6500" LastActivityDate="2014-01-28T18:26:12.423" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10089" PostTypeId="1" AcceptedAnswerId="10121" CreationDate="2014-01-28T19:22:02.530" Score="4" ViewCount="204" Body="&lt;p&gt;This question concerns game theory and market equilibria which is rarely of focus here at QSE, but at the same time I believe this is a more appropriate place for such question rather than MSE.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;There is only one good. There are $N$ consumers and $M$ producers. &lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;Each consumer $i$ can buy at most $E_i$ of good from different producers in total. No matter how much he buys, $\xi_i$ is the highest price he may consider paying for the unit of good.&lt;/li&gt;&#xA;  &lt;li&gt;Each producer can sell at most $Q_i$ of good to different consumers in total. Now matter how much he sells, $r_i&amp;gt;0$ is the lowest price at which he may consider selling the unit of good.&lt;/li&gt;&#xA;  &lt;li&gt;The amount of good the consumer $i$ buys from the producer $j$ is $L_{ij}$, the corresponding price is denoted by $p_{ij}$.&lt;/li&gt;&#xA;  &lt;li&gt;Each consumer $i$ has a utility function $U_i(p_{i1},\dots,p_{iM},L_{i1},\dots,L_{iM})$ which he wants to maximize.&lt;/li&gt;&#xA;  &lt;li&gt;Each producer $j$ has a utility function $V_j(p_{1j},\dots,p_{Nj},L_{1j},\dots,L_{Nj})$ which he wants to maximize.&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I am pretty sure that this problem is rather classical, and I am looking for the game-theoretical formulation of this problem. So far I do not wonder about the existence or uniqueness of Nash equilibrium, just about the formulation: what are the decision variables etc. Some references would also be useful. I think that in such case one may talk about a matrix of equilibrium prices that equalizes the demand and supply, however I am not sure how to approach this formally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would also be interested in an extension when all the players are consumers and producers at the same time. That is, there are $N+M$ players which of them having constraints &#xA;$$&#xA;  -E_i\leq\sum_{j=1}^{N+M}L_{ij}\leq Q_i&#xA;$$&#xA;meaning that each player can buy from one counterparty and sell to another one.&lt;/p&gt;&#xA;" OwnerUserId="464" LastActivityDate="2017-03-14T14:57:15.323" Title="Particular kind of market game" Tags="&lt;economics&gt;&lt;game-theory&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10090" PostTypeId="2" ParentId="10065" CreationDate="2014-01-28T19:53:53.313" Score="3" Body="&lt;p&gt;The key assumption is that there is no time-series correlation between the error terms.  Fama-MacBeth can deal with cross-sectional correlations.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See Samuel Thompson's &quot;Simple formulas for standard errors that cluster by both firm and time&quot; in the Journal of Financial Economics (2011) for a treatment of different regression methods for testing equity pricing models.&lt;/p&gt;&#xA;" OwnerUserId="6630" LastActivityDate="2014-01-28T19:53:53.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10093" PostTypeId="1" CreationDate="2014-01-28T22:09:46.890" Score="4" ViewCount="502" Body="&lt;p&gt;When building a market maker that rests limits orders on both sides of the book, what microstructure effects should we be looking at to price those orders?  I’m targeting liquid futures markets, and expecting to trade 1-3% of the daily volume.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Current effects that we find useful include the book imbalance (the ratio of volume on the best bid vs the volume on the best offer), and recent trades (someone removing liquidity on the bid is bearish).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What else might impact pricing, and related issues such as portfolio valuation?&lt;/p&gt;&#xA;" OwnerUserId="77" LastEditorUserId="2345" LastEditDate="2014-06-19T20:04:41.277" LastActivityDate="2014-06-19T20:04:41.277" Title="Microstructure effects for a market maker?" Tags="&lt;market-microstructure&gt;&lt;market-making&gt;" AnswerCount="0" CommentCount="8" FavoriteCount="0" ClosedDate="2014-01-29T08:24:36.643" ContentLicense="CC BY-SA 3.0" />
  <row Id="10094" PostTypeId="1" AcceptedAnswerId="10098" CreationDate="2014-01-29T00:17:52.150" Score="0" ViewCount="103" Body="&lt;p&gt;Are there any &lt;a href=&quot;https://en.wikipedia.org/wiki/Proof-of-work_system&quot; rel=&quot;nofollow&quot;&gt;proof-of-work systems&lt;/a&gt; used by exchanges?  If not, are there any interesting proposals worth reading?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In principle, there might be applications for proof-of-work systems in preventing algorithms from flooding exchanges either to manipulate prices or gain information, or perhaps to limit the advantages of physical proximity.  An exchange might require a proof-of-work computation when withdrawing an order, for example, which makes placing and withdrawing a large number of orders unsafe. &lt;/p&gt;&#xA;" OwnerUserId="1431" LastActivityDate="2014-01-29T08:06:48.870" Title="Are proof-of-work systems used by exchanges?" Tags="&lt;high-frequency&gt;&lt;algorithmic-trading&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10098" PostTypeId="2" ParentId="10094" CreationDate="2014-01-29T08:06:48.870" Score="2" Body="&lt;p&gt;Proof of work systems are generally used where you do not trust the client; the Bitcoin one is used to slow down the generation of new coins and is adaptive; if hardware speeds up, the work gets harder.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By contrast, an exchange has a contractual agreement with the client, and can require it to authenticate, encrypt etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The central problem, though, is that exchanges want to be low-latency, which is the opposite of a proof-of-work system. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A more convincing solution to the current problems of HFT is to have a minimum (or fixed) order lifetime; any order is valid for x seconds. Much of the HFT activity involves submitting and cancelling orders very quickly just to test the water and discover information about the order book, or to fool less sophisticated algorithms. By fixing the order lifetime, the orders can actually be filled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, if there was a kind of Bitcoin-style exchange with a public interface, there might be cause for trust-less transactions, but I suspect that would involve escrow of margin, rather than proof of work on the interface.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2014-01-29T08:06:48.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10099" PostTypeId="2" ParentId="10087" CreationDate="2014-01-29T14:25:16.597" Score="3" Body="&lt;p&gt;You can start to understand Brigo and Mercurio from the standard Shreve material but it does not look at things from the perspective of semimartingales which will possibly be confusing at some point. You're probably going to want to understand $d[X,Y]_t$ quadratic variation notion vs just the whole &quot;$(dW(t))^2 = dt$&quot; concept from the Shreve book that I'm assuming OP is referring to. Shreve wrote another excellent book &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0387976558&quot; rel=&quot;nofollow&quot;&gt;Karatzsas and Shreve, Brownian Motion and Stochastic Calculus&lt;/a&gt; with the follow up &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0387948392&quot; rel=&quot;nofollow&quot;&gt;Methods of Mathematical Finance&lt;/a&gt; both of which I can absolutely recommend as being challenging but amazing to learn from, something like &quot;blue rudin&quot; at times.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is another book which I have never read personally but have heard great things about regarding stochastic calculus with respect to semimartingales &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0521775949&quot; rel=&quot;nofollow&quot;&gt;Diffusions, Markov Processes, and Martingales: Volume 1, Foundations&lt;/a&gt; and &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0521775930&quot; rel=&quot;nofollow&quot;&gt;Diffusions, Markov Processes and Martingales: Volume 2, Itô Calculus&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;The books mentioned above would certainly make Brigo and Mercurio easier to understand but there is no reason that they can't be used for reference, once you're through Shreve I and II.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="4910" LastActivityDate="2014-01-29T14:25:16.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10101" PostTypeId="1" AcceptedAnswerId="10115" CreationDate="2014-01-29T17:37:46.017" Score="8" ViewCount="3679" Body="&lt;p&gt;It seems that shrinking the covariance matrix is especially useful if the number of individual stocks is greater than the number of data points. However is there any special gain if you're not constrained by the data ?&lt;/p&gt;&#xA;" OwnerUserId="5005" LastActivityDate="2014-01-30T12:14:06.210" Title="Portfolio Optimization : Shrinkage of Covariance Matrix when data is available" Tags="&lt;covariance-estimation&gt;&lt;portfolio-optimization&gt;" AnswerCount="2" CommentCount="7" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10102" PostTypeId="2" ParentId="10101" CreationDate="2014-01-29T19:32:41.723" Score="5" Body="&lt;p&gt;There's more than one way to shrink a covariance matrix. You can think of shrinking a covariance matrix as part of general class of estimators that limit the norms of a matrix. You could alternately think of shrinkage as a form of Bayesian analysis. Given the broad set of techniques one could use, it can be more helpful to think in terms of techniques to reduce estimation risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, suppose you simulate some data (really you want to simulate a mean and covariance with error and then simulate data using those parameters) and then apply techniques that reduce the impact of estimation error while constructing an efficient frontier. If you do this many times, you will find that the techniques that reduce the estimation error will be closer to what the frontier would look like if you knew the true mean and covariance than if you used the sample parameters. So to this extent, techniques do reduce estimation error would be a good thing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, the techniques lead to more diversified (less concentrated) portfolios and increase stability over time, which tends to reduce turnover. It's not necessarily clear that the techniques would lead to better returns, however. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2014-01-29T19:32:41.723" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10103" PostTypeId="1" CreationDate="2014-01-29T20:36:05.757" Score="4" ViewCount="1790" Body="&lt;p&gt;I want to measure the covariance structure of various asset returns based on varying investment periods. &lt;a href=&quot;http://www.nber.org/papers/w11119&quot; rel=&quot;nofollow&quot;&gt;Campbell and Viceira (2005) &lt;/a&gt;  do this, using known return predictors (i.e. dividend yield, yield spread,..) to describe asset returns with an AR(1) process. They find US stock and US gov bond correlations between close to 0 and up to 0.6 , depending on the lenght of the investment period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I want to analyse &lt;em&gt;ex post&lt;/em&gt; return data (ranging from 1 month to at least 20 years), starting at 1969. Overlapping data will be used to get a (hopefully) sufficient amount of data points. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now to my question: I am aware that rolling returns induce autocorrelation, this will effect the asset return volatility as well as the correlation coefficients. So I'm looking for correction methods to get rid of the auto correlation probelm. So far I have found something called Generalised Least Square (GLS) which seems to work for overlapping data in case of regression analysis. However I am not sure if this is really applicable in my case since I am measuring correlation coefficients.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any corrections for overlapping sample autocorrelation when calculating asset return correlation coefficients?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you might have noticed I am fairly new to the world of econometrics. I have only used excel so far, but am eager to learn R.&lt;/p&gt;&#xA;" OwnerUserId="7127" LastEditorUserId="2379" LastEditDate="2014-01-31T18:51:00.383" LastActivityDate="2014-01-31T18:51:00.383" Title="Need overlapping sample autocorrelation correction for calculating asset return correlations" Tags="&lt;correlation&gt;&lt;covariance&gt;&lt;auto-correlation&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10104" PostTypeId="2" ParentId="7140" CreationDate="2014-01-29T21:00:50.353" Score="1" Body="&lt;p&gt;The &lt;a href=&quot;http://www.albanese.co.uk/global.pdf&quot; rel=&quot;nofollow&quot;&gt;Global Calibration&lt;/a&gt; paper outlines a method which is one approach to resolve inconsistencies between pricing and calculating risk measures.&lt;/p&gt;&#xA;" OwnerUserId="993" LastActivityDate="2014-01-29T21:00:50.353" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10107" PostTypeId="2" ParentId="10079" CreationDate="2014-01-30T02:46:55.393" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://www.world-exchanges.org/statistics/monthly-reports&quot; rel=&quot;nofollow&quot;&gt;Download the Excel report&lt;/a&gt; for the year you'd like to analyze.  If you choose December, all months of that year will be available for analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then click on the &lt;kbd&gt;Market cap&lt;/kbd&gt; sheet.  Under the Americas exchanges header, for any month of interest, add the NASDAQ and NYSE values, then divide the sum by the WFE total and multiply by 100.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most recent data available at the time of this answer was December 2012.  At this time, the U.S. markets were responsible for 34.3% of world market capitalization.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Data validated from these two articles:  &lt;a href=&quot;http://data.worldbank.org/indicator/CM.MKT.LCAP.CD&quot; rel=&quot;nofollow&quot;&gt;1&lt;/a&gt;, &lt;a href=&quot;http://www.aei-ideas.org/2013/01/world-stock-market-capitalization-at-54-6-trillion/&quot; rel=&quot;nofollow&quot;&gt;2&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7109" LastEditorUserId="7109" LastEditDate="2014-01-30T02:58:04.203" LastActivityDate="2014-01-30T02:58:04.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10108" PostTypeId="1" AcceptedAnswerId="10110" CreationDate="2014-01-30T03:01:32.150" Score="3" ViewCount="138" Body="&lt;p&gt;I'm looking at 30Y 4.0% Freddie Mac MBS prices as of yesterday, approximately 104:10. Meanwhile, 30Y FRM Freddie Mac quotes are 4.39%. Why are the MBS priced at such a premium, even though the coupon is below the interest rate? Does it have to do with prepayment assumptions? Could anyone please shed some light? Thank you!&lt;/p&gt;&#xA;" OwnerUserId="5407" LastActivityDate="2015-11-03T06:14:53.903" Title="Why are some MBS's with coupons below the FRM rate priced at a premium?" Tags="&lt;mbs&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10110" PostTypeId="2" ParentId="10108" CreationDate="2014-01-30T05:48:12.910" Score="2" Body="&lt;p&gt;Here are some general contributing factors. I could be more specific, but you haven't given specifics about &lt;em&gt;which&lt;/em&gt; Freddie, 30-year, 4% MBS price you are quoting. I'm going to assume it's the front-month TBA price.  I'm also going to assume the 4.39% rate is the &lt;a href=&quot;http://www.freddiemac.com/pmms/&quot; rel=&quot;nofollow&quot;&gt;PMMS rate&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The PMMS is the primary market rate (what the borrower pays). The investor doesn't receive the full primary rate. The investor receives the coupon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Freddie takes a portion of the interest as payment for guaranteeing the loan against default (the &lt;a href=&quot;http://www.investopedia.com/terms/g/guarantee_fees.asp&quot; rel=&quot;nofollow&quot;&gt;&quot;guarantee fee&quot; or &quot;gfee&quot;&lt;/a&gt;). And investors aren't interested in collecting payments, dealing with escrow, etc, so they pay a servicer to do that (the &lt;a href=&quot;http://www.investopedia.com/terms/s/servicing_fee.asp&quot; rel=&quot;nofollow&quot;&gt;&quot;service fee&quot;&lt;/a&gt;, or &quot;base service fee&quot;).  These two fees can easily reduce the interest rate the investor receives by 50 basis points or more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you guessed, the remainder of the difference between the PMMS and the current coupon MBS is largely due to prepayment assumptions. For TBAs, the cheapest-to-deliver pool is also a contributing factor.&lt;/p&gt;&#xA;" OwnerUserId="56" LastActivityDate="2014-01-30T05:48:12.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10111" PostTypeId="1" CreationDate="2014-01-30T07:20:23.140" Score="2" ViewCount="108" Body="&lt;p&gt;The European Banking authority has published the&#xA;&lt;a href=&quot;http://www.eba.europa.eu/-/eba-consults-on-draft-technical-standards-on-prudent-valuation&quot; rel=&quot;nofollow&quot;&gt;&quot;EBA consults on draft technical standards on prudent valuation&quot;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How will these requirements for prudent valuation affect derivatives pricing, if at all?&lt;/p&gt;&#xA;" OwnerDisplayName="user1157" LastEditorDisplayName="user1157" LastEditDate="2014-01-30T07:45:40.450" LastActivityDate="2014-01-30T07:45:40.450" Title="How will the European requirements for prudent valuation affect derivatives pricing?" Tags="&lt;pricing&gt;&lt;banking-regulations&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10112" PostTypeId="2" ParentId="10103" CreationDate="2014-01-30T09:00:05.790" Score="2" Body="&lt;p&gt;I would advice you not to do any overlapping analysis. The results will be hard to interpret and misleading.&#xA;I have seen many &quot;practioners&quot; looking at histograms of overlapping returns. They saw interesting patterns and found funny explanations - which were simply wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are new to econometrics then correction methods (do there exist helpful techniques ?) will be black boxes to you. Then you should not apply them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally Generalised Least Square (GLS) - I assume you mean &lt;a href=&quot;http://en.wikipedia.org/wiki/Generalized_least_squares&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt;. How should this help you to correct overlapping samples? &lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-01-30T09:00:05.790" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10113" PostTypeId="2" ParentId="9559" CreationDate="2014-01-30T09:26:36.327" Score="5" Body="&lt;p&gt;I would like to add a few more points to @Phun's already very good answer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is interesting because generalized Brownian motion already covers a lot of cases:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This example includes all possible models of an asset price process&#xA;  that is always positive, has no jumps, and is driven by a single&#xA;  Brownian motion for each asset.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(Shreve, Stochastic Calculus for Finance II, p. 148)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Shortcomings:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Brownian Motion is continuous, i.e. &lt;strong&gt;no jumps&lt;/strong&gt; in the stock price paths.&lt;/li&gt;&#xA;&lt;li&gt;It &lt;strong&gt;cannot become zero&lt;/strong&gt;, whereas companies can default.&lt;/li&gt;&#xA;&lt;li&gt;The likelihood of &lt;strong&gt;large price movements&lt;/strong&gt; is smaller than observed in real markets. See for example &lt;a href=&quot;http://users.math.yale.edu/mandelbrot/webbooks/wb_fin.html&quot; rel=&quot;nofollow&quot;&gt;Mandelbrot's criticism&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;The distribution of relative movements following the normal distribution is &lt;strong&gt;symmetric&lt;/strong&gt;, in practice a common pattern is: many small movements up, and fewer but larger movements down. &lt;/li&gt;&#xA;&lt;li&gt;In practice large movements tend to be clustered together, followed by long periods of little movements, i.e. &lt;strong&gt;no regimes&lt;/strong&gt;.&#xA;See for example &lt;a href=&quot;http://www.princeton.edu/ceps/workingpapers/186malkiel.pdf&quot; rel=&quot;nofollow&quot;&gt;&quot;The clustering of stock price movements&quot;&lt;/a&gt;, by Malkiel et al., 2009.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerDisplayName="user1157" LastEditorDisplayName="user1157" LastEditDate="2014-01-30T15:35:51.163" LastActivityDate="2014-01-30T15:35:51.163" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10114" PostTypeId="1" CreationDate="2014-01-30T11:22:37.457" Score="2" ViewCount="2187" Body="&lt;p&gt;I am struggling with the following problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An investor is considering a &lt;strong&gt;European call option&lt;/strong&gt;, whose price $C_0$ is yet to be determined, on the shares of a company called XYZ. You know that :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the share price at $t=0$ for company XYZ is denoted $P_0 = 500$.&lt;/li&gt;&#xA;&lt;li&gt;the strike price of the option is $K=510$&lt;/li&gt;&#xA;&lt;li&gt;expiration date is $T=2$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In 2 months, the value of the option will be $C_2=  Max[P_2-510,0]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;During the first month the investor believes that the probability the share increases by5% is 0.35, the probability that it increases by 2% is 0.5 and the probability the share falls by 4% is 0.15.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In The second month the investor believes that the probability the share increases by 4% is 0.3, the probability that it increases by 1% is 0.45 and the probability the share falls by 3% is 0.25&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Calculate the price the investor is willing to pay for the option assuming they want to make 3% expected return over the period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I calculate the expected return using a tree graph (in the picture below). The result is 11.177 (summing up all the value of the option by the probabilities) and that is a return of 2.2%. (Please keep in mind that if the share price is below the strike price the value option is 0)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/pnMPy.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem here is that I need to get the fair price, knowing the expected return... so I need to do exactly the opposite.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the formula to get the price the investor is willing to pay in order to get a 3% expected return?&lt;/p&gt;&#xA;" OwnerUserId="7130" LastEditorUserId="467" LastEditDate="2014-05-10T00:19:49.317" LastActivityDate="2014-05-10T10:34:30.523" Title="fair price for a call option" Tags="&lt;options&gt;&lt;call&gt;&lt;european&gt;" AnswerCount="2" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="10115" PostTypeId="2" ParentId="10101" CreationDate="2014-01-30T12:14:06.210" Score="4" Body="&lt;p&gt;When using the estimated covariance in the context of mean-variance optimization, then, yes, shrinking the covariance matrix is useful even when you have sufficient data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A good reference is &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1483412&quot; rel=&quot;nofollow&quot;&gt;Golts and Jones, A Sharper Angle on Optimization&lt;/a&gt;, who discuss convariance shrinkage among other techniques and give two examples of the usefulness of shrunk covariance estimates in forming (unconstrained) optimal portfolios. The first is desensitizing the optimizer to small variations in alphas of highly correlated assets. The second is controlling leverage. &lt;/p&gt;&#xA;" OwnerUserId="6961" LastActivityDate="2014-01-30T12:14:06.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10116" PostTypeId="1" AcceptedAnswerId="10122" CreationDate="2014-01-30T16:50:15.353" Score="1" ViewCount="286" Body="&lt;p&gt;I have two questions. I would prefer a reference if possible.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Is the value of vega bounded for $\sigma\in [0,\infty)$? (I assume so, I imagine it goes to 0 as $\sigma$ go to infinity.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Are there any well established properties of vega? (e.g. convexity/monotonicity? How fast does it go to 0, as $\sigma\rightarrow\infty$? How does it behave as $\sigma\rightarrow 0$?)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;A partial answer would be more than welcome.&lt;/p&gt;&#xA;" OwnerUserId="3334" LastEditorDisplayName="user1157" LastEditDate="2014-01-30T17:25:09.270" LastActivityDate="2014-01-31T08:37:23.317" Title="How does Vega of a call/put behave under the Black-Scholes model?" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10117" PostTypeId="1" CreationDate="2014-01-30T17:26:29.410" Score="2" ViewCount="2237" Body="&lt;p&gt;Ok, let's say I'm trading a spread of two stocks, X &amp;amp; Y, The spread is calculated as a ratio (Spread = X / Y). I use rolling stats to calculate the mean, standard deviation and hence the z-score of the spread, as such, I take the usual entry/exit signals of entering trades when the z-score exceeds 2 the then closing them on return to zero. There are, of course, the usual ways of sizing the legs. (dollar neutral for example). What I want to do is size the legs according to a z-score stop loss. Let's say that I'm going to define a z-score that exceeds 4 as my disaster stop. Given the amount of my account (in dollars) I want to lose if the stop is hit, how do I size the legs on entry of the trade? (Let's assume the mean and standard deviation remain constant).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update:&#xA;In the meantime I've been pondering this, this only thing I can think of is to hold one leg constant and work backward. This can be done for each leg in turn. But I'd still be interested in other ideas.&lt;/p&gt;&#xA;" OwnerUserId="1397" LastEditorUserId="1397" LastEditDate="2014-01-30T21:04:09.437" LastActivityDate="2014-04-30T15:24:03.270" Title="Position Sizing For Ratio Pairs Trade" Tags="&lt;pairs-trading&gt;&lt;position-sizing&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10120" PostTypeId="1" CreationDate="2014-01-31T02:32:44.217" Score="4" ViewCount="389" Body="&lt;p&gt;I have a days-worth of level 2 market data. I am calculating S&amp;amp;P500 index arbitrage. I have a few questions about the calculation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Should I be summing all the bids and asks from the stocks separately and then do the discounting on the sum of the bids, discounting on the sum of the asks and then compare with the E-Mini future bid and ask- all separately? Or in contrast should I be using mid values throughout? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I calculate the prices separately and (see question below) I ask for the best bid/ask of at least quantity 1 I end up getting stupid values like S&amp;amp;P500 total of all stock bids is 1687 but the ask sum is like 1200.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Related to the above, do you only choose the best &quot;bid&quot; (or &quot;ask&quot;) dependent on the quantity available in the orderbook and if so, what quantity level do you choose to select the best bid/ask? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there is an order with quantity 1 (which is many price levels away from the main liquidity) it can cause problems if I just ask for the &quot;best&quot; price level.&lt;/p&gt;&#xA;" OwnerUserId="5168" LastActivityDate="2014-01-31T02:32:44.217" Title="Calculating index arbitrage" Tags="&lt;quant-trading-strategies&gt;&lt;arbitrage&gt;&lt;index&gt;&lt;algorithmic-trading&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10121" PostTypeId="2" ParentId="10089" CreationDate="2014-01-31T03:13:41.207" Score="2" Body="&lt;p&gt;There are severa ways you could formulate this problem in game theoretic terms. Hoping this is not too basic an answer for you : from what you write, the two canonical approaches would be to frame things in terms of Cournot oligopolies (firms simultaneously set &lt;em&gt;quantities&lt;/em&gt; and prices result from the market clearing condition supply=demand)  or Bertrand oligopolies (firms simultaneously set &lt;em&gt;prices&lt;/em&gt; and quantities result from the market clearing condition supply=demand). You can find a lot of reference on these two models on google.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you read these references, you will see that your assumptions do not really fit into either the Bertrand or Cournot models. Your model is somewhat more complicated (and probably slightly under-specified if you want to get to any clearcut conclusion). In particular, to be able to frame your questions in terms of the &lt;strong&gt;&lt;em&gt;canonical&lt;/em&gt;&lt;/strong&gt; Bertrand or Cournot you would need &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;To be able to derive an aggregate demand function linking any price level with an aggregate quantity which would sell at this price. In particular, you need to know more than the higher price agents are ready to pay. One way to do derive such a demand function would be to specify further the profile of consumer's utility function (then you can derive consumers' optimal quantity for every price, and build an aggregate demand function).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;To give up the idea that firm are not able to produce more than a certain quantity. In the &lt;strong&gt;canonical&lt;/strong&gt; models, each firm must be able to produce as much as it wants, possibly covering the whole demand if it so wanted.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Now, this does not mean it is impossible to accommodate your current model into something close to the canonical Cournot and Bertrand models. But it would certainly require quite a bit of work. Regarding you interest in capacities constraints for instance, you may want to read the part of section 12.C from &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0195073401&quot; rel=&quot;nofollow noreferrer&quot;&gt;Mas-Collel, Whinston and Green, Microeconomic theory&lt;/a&gt; which covers this issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, finally, that in any model that allows for different firms to sell positive quantities at &lt;em&gt;different&lt;/em&gt; prices, you will need to add hypothesis on the rationing mechanism. Unless all firms end up either selling at the same price, or selling nothing, you will end up in a situation where some consumers pay say $p$ whereas others pay  $p' &amp;lt; p$ for the same good. Arguably the consumers who pay $p$ would like to pay $p'$ instead (assuming, as you did, that there is only one identical good). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, either the situation does not last and everyone ends up buying from the producer that charges $p'$, or it lasts but some firms face an excess demand, and there must be a rationing mechanism in your model specifying who is allowed to buy from the cheap producer and who is not. You could assume, for example, that some consumer have a priority access to the production of some firms, or that the rationing takes place via a lottery (or anything else, but you will need to make it clear which rationing mechanism you choose in order to close your model).&lt;/p&gt;&#xA;" OwnerUserId="7132" LastEditorUserId="7132" LastEditDate="2017-03-14T14:57:15.323" LastActivityDate="2017-03-14T14:57:15.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10122" PostTypeId="2" ParentId="10116" CreationDate="2014-01-31T08:23:09.897" Score="1" Body="&lt;p&gt;if we write down the formula for vega we get&#xA;$$&#xA;\text{vega} = S \sqrt{T} e^{-q T} \frac{1}{\sqrt{2\pi}} \exp(- \frac{d_1^2}2)&#xA;$$&#xA;where&#xA;$$&#xA;d_1 = \frac{\log(S/K) + (r-q +\sigma^2/2)T}{\sigma \sqrt{T}}.&#xA;$$&#xA;We have &#xA;$$&#xA;\lim_{\sigma \rightarrow  \infty} d_1 = \infty,&#xA;$$&#xA;as $\sigma^2$ grows quicker than $\sigma$ for $\sigma \rightarrow  \infty$ and therefore&#xA;$$&#xA;\lim_{\sigma \rightarrow  \infty} \text{vega} = 0,&#xA;$$&#xA;due the definition above and the continuous functions involved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore &#xA;$$&#xA;\lim_{\sigma \rightarrow  0} d_1 \text{ is unbounded},&#xA;$$&#xA;because&#xA;$$&#xA;\lim_{\sigma \rightarrow  0} d_1 = \lim_{\sigma \rightarrow  0} \frac{\log(S/K)}{\sigma \sqrt{T}} + \frac{(r-q) \sqrt{T}}{\sigma} +\sigma/2 \sqrt{T}&#xA;$$&#xA;and the first two summands are unbounded for $\sigma \rightarrow  0$ and the third tends to zero.&#xA;Thus depending on $\log(S/K)$ - the moneyness - and $r-q$ we get&#xA;$$&#xA;\lim_{\sigma \rightarrow  0} d_1 = \pm \infty&#xA;$$&#xA;and in any case&#xA;$$&#xA; \lim_{\sigma \rightarrow  0} \text{vega} = 0.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the second part of convexity/monotonicity you need $\frac{\partial \text{vega}}{\partial \sigma}$ this is called &lt;a href=&quot;http://en.wikipedia.org/wiki/Vanna%E2%80%93Volga_pricing&quot; rel=&quot;nofollow&quot;&gt;Volga&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wilmot has the formula for Volga &lt;a href=&quot;http://www.wilmottwiki.com/wiki/index.php?title=Call_option&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; but I did not check it. You can analyze it in order to analyze montonicity. You need its derivative for convexity ...&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2014-01-31T08:37:23.317" LastActivityDate="2014-01-31T08:37:23.317" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10124" PostTypeId="1" CreationDate="2014-01-31T14:40:51.047" Score="1" ViewCount="573" Body="&lt;p&gt;Everyone says $N(d_2)$ is the probability of the option being exercised but stocks that have really high volatility have really expensive options indicating a high likelihood of expiring in the money. If volatility is very high we see that s $N(d_2)$  goes to 0, so doesn't that contradict our first statement? Isn't  $N(d_1)$ the true probability?&lt;/p&gt;&#xA;" OwnerUserId="7136" LastActivityDate="2014-02-01T09:59:30.813" Title="probablity expiring in the money ..basic question" Tags="&lt;options&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10125" PostTypeId="5" CreationDate="2014-01-31T14:56:11.107" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-01-31T14:56:11.107" LastActivityDate="2014-01-31T14:56:11.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10126" PostTypeId="4" CreationDate="2014-01-31T14:56:11.107" Score="0" Body="Should be estimator." OwnerDisplayName="user1157" LastEditorDisplayName="user1157" LastEditDate="2014-01-31T15:01:26.563" LastActivityDate="2014-01-31T15:01:26.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10128" PostTypeId="1" AcceptedAnswerId="10130" CreationDate="2014-01-31T19:35:48.170" Score="2" ViewCount="462" Body="&lt;p&gt;What is the best way to score a portfolio's diversity based on it's returns covariance matrix?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that if my portfolio has two securities and their returns' correlation coefficient is -1 that is a good diversified portfolio. Now I would like to know how do I score a portfolio with more than 2 securities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the theory is valid, should I calculate the correlation coefficient of N variables ? What's the formula for that?&lt;/p&gt;&#xA;" OwnerUserId="7009" LastEditorDisplayName="user1157" LastEditDate="2014-01-31T21:42:14.293" LastActivityDate="2014-02-02T09:12:32.947" Title="How to score a portfolio's diversity based on security returns?" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;covariance&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10130" PostTypeId="2" ParentId="10128" CreationDate="2014-01-31T21:40:23.707" Score="4" Body="&lt;p&gt;There are several measures discussed in the literature, the classical approach is &lt;a href=&quot;http://en.wikipedia.org/wiki/Modern_portfolio_theory&quot; rel=&quot;nofollow&quot;&gt;Markowitz mean-variance portfolio optimization&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The formula for portfolio return variance is&#xA;$$\sigma_p^2 = \sum_i w_i^2 \sigma_{i}^2 + \sum_i \sum_{j \neq i} w_i w_j \sigma_i \sigma_j \rho_{ij}$$&#xA;where $\rho_{ij}$ are the correlations betweent the assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Others suggeste measures are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Normalized portfolio variance (NV)&lt;/strong&gt;, which is obtained by dividing the portfolio variance&#xA;by the average variance of stock returns in the portfolio:&#xA;$$ NV = \frac{\sigma^2_p}{\bar{\sigma}^2}$$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Sum of squared portfolio weights (SSPW)&lt;/strong&gt;, where $w_i$ is the portfolio weight assigned to stock $i$ in the portfolio and w_m is the portfolio weight assigned by the market (i.e. an index): &#xA;$$\sum_N (w_i-w_m)^2 $$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For more references, see for example:&lt;br/&gt;&#xA;Goetzmann and Kumar, &lt;a href=&quot;ftp://economia.unica.it/mattana/Modelli_Mercati_Finanziari/Slides/Lecture_2/CRAA.pdf&quot; rel=&quot;nofollow&quot;&gt;Equity portfolio diversification&lt;/a&gt;, Review of Finance, 2008&lt;br/&gt;&#xA;Google will give you a lot of results, I found this &lt;a href=&quot;http://cssanalytics.wordpress.com/2011/08/09/forecast-free-algorithms-a-new-benchmark-for-tactical-strategies/&quot; rel=&quot;nofollow&quot;&gt;Minimum Correlation Algorithm&lt;/a&gt; interesting.&lt;/p&gt;&#xA;" OwnerDisplayName="user1157" LastEditorDisplayName="user1157" LastEditDate="2014-02-02T09:12:32.947" LastActivityDate="2014-02-02T09:12:32.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10133" PostTypeId="1" CreationDate="2014-02-01T02:53:05.460" Score="1" ViewCount="1319" Body="&lt;p&gt;I am just wondering if there is any way we could calculate a CDS Spread (not harzard rate) on a CDS curve. Most of the papers that I have come across so far discuss about interpolating the hazard rates using numerical root-finding algorithms by setting the break-even spread to 0. However can I assume that the hazard rates derived this way will give me a &quot;proper&quot; interpolation on the CDS spread? i.e., say if I have the 3 month and 6 month CDS spread, and I need to price the spread for a 4 month CDS, would it be OK if I simply assume the risky PV for the first 3 months is already 0 given the hazard rates that I have derived and just working on figuring out the final one month spread? Is there a direct, nice formula to compute for such a spread given hazard rate using piecewise constant hazard rate assumption between 3 month and 4 month?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="3595" LastActivityDate="2014-10-03T19:58:55.580" Title="Interpolation on CDS rates" Tags="&lt;spread&gt;&lt;cds&gt;&lt;interpolation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10134" PostTypeId="1" CreationDate="2014-02-01T02:57:44.727" Score="2" ViewCount="566" Body="&lt;p&gt;For the FVA calculation, is the funding spread (either borrowing or lending) treated as a piecewise constant function (i.e., if the length of the exposure is 5 month and I know the 3 and 6 months funding spread (say 10bps and 20bps respectively), can I just apply that 10bps and make it the 5 month funding spread?) or it should be treated similarly as the CDS curve (i.e., assuming piecewise constant hazard rates), I would think it seems to make more sense to treat it as a CDS curve however my understanding of the funding spread is more like an interest rate curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="3595" LastActivityDate="2014-02-01T02:57:44.727" Title="Funding spread in FVA calculation" Tags="&lt;spread&gt;&lt;interpolation&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10135" PostTypeId="2" ParentId="10124" CreationDate="2014-02-01T09:59:30.813" Score="3" Body="&lt;p&gt;This is indeed a very basic question. Please have a look at the following paper which will answer all your questions in a very intuitive and step-by-step fashion:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.ltnielsen.com/wp-content/uploads/Understanding.pdf&quot; rel=&quot;nofollow&quot;&gt;Understanding $N(d_1)$ and $N(d_2)$: Risk-Adjusted Probabilities in the Black-Scholes Model by Lars Tyge Nielsen&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2014-02-01T09:59:30.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10137" PostTypeId="1" AcceptedAnswerId="10141" CreationDate="2014-02-01T11:39:59.843" Score="2" ViewCount="192" Body="&lt;p&gt;There is a lot of research on how the government yield curve can be used to predict the economy. The government yield curve is often seen as a leading indicator. But for which variables is the curve a lagging indicator? In other words, which economic indicators lead the government yield curve?&lt;/p&gt;&#xA;" OwnerUserId="7015" LastActivityDate="2014-02-03T23:43:38.460" Title="Economic indicators leading the yield curve" Tags="&lt;yield-curve&gt;&lt;prediction&gt;&lt;indicator&gt;&lt;macro-economics&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10138" PostTypeId="1" AcceptedAnswerId="10156" CreationDate="2014-02-01T12:52:33.210" Score="3" ViewCount="889" Body="&lt;p&gt;Let's assume we have data for daily volumes traded on some asset (and open interests as well). Now if we are planning to make a trade we don't want to fat-finger it and want it to be of a reasonable size. That is, we certainly know that if we try to make a trade larger than the whole daily volume, it just won't go through or will significantly alternate the price. The question is: how can we estimate this volume we can safely trade?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I'm not looking for any precise model which will be used in a trade execution. What I'm trying to get is some rough upper boundary for a single trade. As I mentioned, this boundary is certainly lower than the daily volume. We know that. Now, is there a tougher estimate? &lt;/p&gt;&#xA;" OwnerUserId="5086" LastEditorUserId="5086" LastEditDate="2014-02-01T22:23:03.000" LastActivityDate="2014-02-06T05:21:21.670" Title="Estimate reasonable trade sizing based on daily volume" Tags="&lt;volume&gt;&lt;position-sizing&gt;&lt;open-interest&gt;" AnswerCount="3" CommentCount="7" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10139" PostTypeId="2" ParentId="10138" CreationDate="2014-02-01T14:50:03.493" Score="2" Body="&lt;p&gt;You must look at passive volumes available on certain levels in orderbook, that feature is called market depth.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a possibility that daily volume is correlated somehow with depth on market levels around a price, but I think you must gather some data and model that relationship when you want do that in this way.&lt;/p&gt;&#xA;" OwnerUserId="6175" LastActivityDate="2014-02-01T14:50:03.493" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10141" PostTypeId="2" ParentId="10137" CreationDate="2014-02-01T19:40:12.063" Score="1" Body="&lt;p&gt;In the United States, the Federal Reserve is always late to adjust to rising inflation with an extreme outlier in the mid-1990s.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Inflation always leads the flattening of the yield curve since the Fed raising interest rates which flattens the yield curve is usually in response to rising inflation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Poorly managed currencies or even the US in the 1970s will distort this phenomenon.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In the absence of a clear monetary control such as the Fed or Hong Kong using the overnight rate to control inflation, the next best criteria is a falling exchange rate like the present situation or East Asia in 1997 as the affected countries place a much higher value on exchange rates than inflation so will only indirectly respond to inflation by trying to maintain a high exchange rate with high interest rates causing an inverted yield curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can help with emerging markets, but they seldom &quot;play by the rules&quot;, so that criteria will be less accurate yet still best.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For developed markets such as the US, Europe, Hong Kong, and to a much lesser extent Japan, rising inflation is the early leading indicator, and rising overnight rates is the later indicator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For completely undeveloped corrupt markets, I have found no correlation.&lt;/p&gt;&#xA;" OwnerDisplayName="user6500" LastEditorDisplayName="user6500" LastEditDate="2014-02-03T23:43:38.460" LastActivityDate="2014-02-03T23:43:38.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10142" PostTypeId="2" ParentId="10138" CreationDate="2014-02-01T21:14:16.010" Score="3" Body="&lt;p&gt;Actually your question englobes many questions. In my opinion, you shouldn't only focus on the total volume you're going to execute on a specific day, but also on how you're going to split it into meta-orders(orders of small amounts) all over the day. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to have:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;A model for daily volume (&lt;em&gt;which i think is what are you looking for, then an ARIMA(3-5, 1, 1-2) provides satisfying results&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A model for Inra-day volume (&lt;em&gt;more study should be done on this, see for example &lt;a href=&quot;http://www.qfrc.uts.edu.au/research/research_papers/rp146.pdf&quot; rel=&quot;nofollow&quot;&gt;McCulloch&lt;/a&gt;&lt;/em&gt;) &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A model for market impact (&lt;em&gt;see &lt;a href=&quot;http://www.courant.nyu.edu/~almgren/papers/optliq.pdf&quot; rel=&quot;nofollow&quot;&gt;Almgren &amp;amp; Chriss&lt;/a&gt;, which is by the way a reference in optimal execution, but they generally assume the volume known&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A cost function that you want to minimize&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Some hypothesis on the market micro-structure&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And then you can trade your huge volume (or Iceberg) according to the execution strategy you get.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this helps!&lt;/p&gt;&#xA;" OwnerUserId="6189" LastActivityDate="2014-02-01T21:14:16.010" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10144" PostTypeId="1" AcceptedAnswerId="10147" CreationDate="2014-02-02T02:35:40.203" Score="6" ViewCount="579" Body="&lt;p&gt;what's the relationship between forecasted stock volatility and implied volatility? I know that implied volatility is the volatility calculated by BS formula, is there any relationship between implied volatility and underlying asset volatility?(forecasted or historical)&lt;/p&gt;&#xA;" OwnerUserId="7144" LastActivityDate="2019-11-30T04:16:37.617" Title="what's the relationship between forecasted stock volatility and implied volatility?(option)" Tags="&lt;options&gt;&lt;volatility&gt;&lt;black-scholes&gt;&lt;implied-volatility&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10146" PostTypeId="1" CreationDate="2014-02-02T03:26:48.747" Score="3" ViewCount="118" Body="&lt;p&gt;Are there any free or relatively cheap sources of aggregate data on credit risk for specific geographic regions, ages, and so on?  &lt;/p&gt;&#xA;" OwnerUserId="7145" LastActivityDate="2015-12-04T20:26:15.430" Title="Finding Credit Risk Population Data" Tags="&lt;data&gt;&lt;risk&gt;&lt;market-data&gt;&lt;modeling&gt;&lt;credit&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10147" PostTypeId="2" ParentId="10144" CreationDate="2014-02-02T04:25:12.513" Score="3" Body="&lt;p&gt;One is computed from &lt;strong&gt;historical stock time-series&lt;/strong&gt;, that is, from &lt;strong&gt;observed past&lt;/strong&gt;, the other is computed from &lt;strong&gt;traded option prices&lt;/strong&gt; (prices of bets made on the stock with payoff at a future time), that is, from a &lt;strong&gt;view on the future&lt;/strong&gt; paid for with cash. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;They are both equally important and useful (if one has enough data to compute them). Loosely speaking, historical one tends to be lower than the implied one, but the comparison needs to be done carefully, given their specific definition elements. A priori there is no expectation for an actual &quot;relationship&quot; between the two. They should rather be viewed as complementing each other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BS formula is the way to relate traded option prices and implied volatility. This is done assuming a specific geometric Brownian motion dynamics for stock, and many other things. That's why one refers to implied volatility as BS-implied volatility not to be confused with possibly other model implied volatility (like say, Bachelier model, whose dynamics are assumed arithmetic Brownian motion). Implied volatilities can be viewed as expectations of future realized volatilities (see also trading of variance/volatility swaps). &lt;/p&gt;&#xA;" OwnerUserId="6858" LastEditorUserId="6858" LastEditDate="2019-11-30T04:16:37.617" LastActivityDate="2019-11-30T04:16:37.617" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="10149" PostTypeId="1" AcceptedAnswerId="10173" CreationDate="2014-02-02T17:50:55.900" Score="6" ViewCount="10542" Body="&lt;p&gt;I calculated values for put options (european and american) using the implicit finite difference method and compared them to black/scholes values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The values for american put options are higher than the values for european put options (BS and finite differences), which is in line with theory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I applied the same code to call options, setting the lower boundary to 0 and the upper boundary to S(max)-K. The values using finite differences for american and european options are roughly the same. The BS Value lies considerably above both values. I expected the values of the european options to be almost the same and the american option value to exceed both.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My code is more or less based on the following source (for put options, for call options i simply changed the payoffs to max(S-K,0) and changed the boundary conditions (see above).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.quantcode.com/modules/mydownloads/singlefile.php?lid=248&quot; rel=&quot;noreferrer&quot;&gt;http://www.quantcode.com/modules/mydownloads/singlefile.php?lid=248&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anybody have an idea? I changed the grid size, which didn't change much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance!&lt;/p&gt;&#xA;" OwnerUserId="6748" LastActivityDate="2014-02-13T00:21:12.623" Title="Value of American Call vs Value of European Call when using implicit finite differences" Tags="&lt;option-pricing&gt;&lt;numerical-methods&gt;&lt;american-options&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10150" PostTypeId="1" CreationDate="2014-02-02T18:08:29.060" Score="-2" ViewCount="1610" Body="&lt;p&gt;Is it possible to get interest rate swaps on mortgages?  If not, why not?  Are there models that describe this?  Any direction would be great.&lt;/p&gt;&#xA;" OwnerUserId="7145" LastEditorUserId="218" LastEditDate="2020-07-02T15:26:47.543" LastActivityDate="2020-07-02T15:26:47.543" Title="Is it more common to hedge a mortgage bond portfolio with other bonds as opposed to Interest Rate Swaps?" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;modeling&gt;&lt;credit&gt;&lt;mbs&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2014-02-08T07:50:36.910" ContentLicense="CC BY-SA 4.0" />
  <row Id="10151" PostTypeId="2" ParentId="7994" CreationDate="2014-02-03T07:52:42.447" Score="0" Body="&lt;p&gt;You can have a look at Heston (1993) who gives a closed form solution for options under stochastic volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rfs.oxfordjournals.org/content/6/2/327.short&quot; rel=&quot;nofollow&quot;&gt;http://rfs.oxfordjournals.org/content/6/2/327.short&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keep in mind that an investor demands extra compensation for volatility risk. Breeden's consumption based model offers a way of determining this premium. When calibrating a stochastic volatility model those extra premiums are already contained in market prices. &lt;/p&gt;&#xA;" OwnerUserId="6748" LastActivityDate="2014-02-03T07:52:42.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10153" PostTypeId="1" CreationDate="2014-02-03T12:26:12.417" Score="8" ViewCount="3168" Body="&lt;p&gt;i have and question concerning the T-forward price definition on the Robert J.Elliot's book : Mathematics of Financial Markets. On his chapter 9, definition 9.1.3 p.249. He give the formula without explaining how can it possible. I've tried to understand why but without success, so i post the question here to request your help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Giving two asset $S^1$ and $S^0$ which are risky and riskless asset, $P^{*}$ is the risk-neutral probability on what the discounted risky asset is a martingale (after Girsanov transform). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;He defined T-Forward price $F(t,T)$ as the price of the risky asset agreed at time $t\leq T$ that will be paid for $S^1$ at time $T$. Then he says that such a price satisfied that the claim $S^1_T - F(t,T)$ is a martingale (under risk-neutral probability), more strongly, a zero martingale. Then he give the formula&lt;br&gt;&#xA;$$&#xA;0=E^{*}\left(\frac{S^1_T - F(t,T)}{S^0_T}\bigg|\mathscr{F}_t\right)&#xA;$$&#xA;This argument confused me. After what i learned, the claim which is zero has to be $S^1_T - F(T,T)$, we can have it because the forward price converge to the spot price at maturity time. So the formula has to be&lt;br&gt;&#xA;$$&#xA;0=E^{*}\left(\frac{S^1_T - F(T,T)}{S^0_T}\bigg|\mathscr{F}_t\right)&#xA;$$&#xA;in my sens. But if i do what i thought, i can not manipulate the formula in order to have the final result as he mentioned so far in the book &#xA;$$&#xA;F(t,T) = \frac{S^1_t}{B(t,T)}&#xA;$$&lt;br&gt;&#xA;where $B(t,T)$ is the zero coupon bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This point is important for me because it help to understand all theory of numeraire change, and the T-Forward price for another claim. Can anyone have some suggest please? Thanks &lt;/p&gt;&#xA;" OwnerUserId="3507" LastEditorUserId="4910" LastEditDate="2014-02-03T14:25:43.960" LastActivityDate="2014-05-20T22:37:19.260" Title="T-Forward Price on risk-neutral measure" Tags="&lt;risk-neutral&gt;&lt;numerairechange&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10155" PostTypeId="1" CreationDate="2014-02-03T15:59:45.827" Score="2" ViewCount="86" Body="&lt;p&gt;After implementing some FDM to price some option, there are gaps between our grid points that may be of interest.  From reading around, it appears common to use bilinear interpolation to estimate these gap values.  However, there are more accurate interpolation schemes available.  Are more sophisticated forms of interpolation, like bicubic interpolation, commonly used in industry or wherever, and if so which ones?  Or is bilinear, or even nearest-neighbour, generally sufficient?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that when deciding on different numerical methods to tackle certain problems we must meet our required accuracy and computing budget.  I'm mainly asking because when using implicit methods our grid can be courser, and while our solved grid points are more accurate and the method is unconditionally stable, we still lose some &quot;information&quot; when we need to estimate gap values.&lt;/p&gt;&#xA;" OwnerUserId="7051" LastEditorUserId="7051" LastEditDate="2014-02-03T16:04:54.610" LastActivityDate="2014-02-03T16:04:54.610" Title="Multivariate interpolation for estimating FDM in-between grid points" Tags="&lt;option-pricing&gt;&lt;interpolation&gt;&lt;finite-difference-method&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10156" PostTypeId="2" ParentId="10138" CreationDate="2014-02-03T16:22:32.233" Score="6" Body="&lt;p&gt;From your comments I have deciphered that what you actually want to know is what the maximum amount of size is that you can trade at any time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Holding aside exchange irregularities, the answer to this is the total amount of size on one side of the book in the direction that you want to trade (e.g. bid side if you want to sell), at the time that you want to trade plus a number of micro or milliseconds between now and when your order arrives to the matching engine. You would also need to add hidden liquidity either at mid or deeper into the book that you will run into if you submit such a market order - the extent to which this will contribute to the total trade-able size on one side of the book at some point in time is exchange and trader dependent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In expectation, the above figure can be slightly increased by improving the best ask with a limit order at the same instant as you submit your massive market order, absorbing any buy market orders that are issued at the same time that you are cleaning out the bid schedule.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This maximum volume can be more than the average daily traded volume and has no theoretical upper limit (EDIT: A comment points out that there is one; the market capitalisation of the stock in question). But it will have a practical upper limit since market makers will not want to over-size a particular level near the insides, because doing so would expose them to the risk of adverse selection without compensation from queue-position and the average time it takes for a queue to recycle (i.e. if the queue is too thick, then queueing on top of it will only lead to bad fills). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Be warned: This may be perceived as market manipulation by either the exchange or regulator. If the former sees it this way, they may cancel your trade and fine you.&lt;/p&gt;&#xA;" OwnerUserId="6081" LastEditorUserId="6081" LastEditDate="2014-02-06T05:21:21.670" LastActivityDate="2014-02-06T05:21:21.670" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10158" PostTypeId="2" ParentId="3486" CreationDate="2014-02-04T06:52:08.687" Score="1" Body="&lt;p&gt;You can only make a decision on whether to early exercise an American call option on an equity underlying with current information.  In your question you anticipate a movement in the underlying higher in the future.  This has no economic bearing on whether to exercise early. Given your inputs of $S=25$, $E=20$ and $T=1.0$ and assuming interest rate of $0$ and no dividends all you can say is that the option must be worth at least $5$ in the market.  There will be no early exercise.  Now what if $T = 0.02$ or approximately 1 week and tomorrow the stock goes ex-dividend for $2.00$?  Back before the OCC starting adjusting strike prices for large dividends you would exercise early to capture the dividend. Tomorrow the stock will be $23$ and the intrinsic value will go from $5$ to $3$. If you did not exercise early then you would lose out on $\$2$ by holding call option to expiration.&lt;/p&gt;&#xA;" OwnerUserId="7160" LastEditorUserId="38" LastEditDate="2014-02-10T22:31:38.530" LastActivityDate="2014-02-10T22:31:38.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10159" PostTypeId="1" CreationDate="2014-02-04T08:50:33.423" Score="2" ViewCount="1571" Body="&lt;p&gt;I am trying to access a data feed for 10 year sovereign bond yields for countries, say the G20. I have tried world bank and IMF data api sources but to no avail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The data feed is used to update an excel spreadsheet in order to calculate real yields.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many Thanks,&#xA;Ivan&lt;/p&gt;&#xA;" OwnerUserId="7161" LastActivityDate="2014-02-04T13:00:34.760" Title="Data feed for 10 year government bond yields" Tags="&lt;excel&gt;&lt;bond-yields&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ClosedDate="2014-02-04T13:26:14.027" ContentLicense="CC BY-SA 3.0" />
  <row Id="10161" PostTypeId="2" ParentId="10159" CreationDate="2014-02-04T13:00:34.760" Score="1" Body="&lt;p&gt;I think that a combination of &lt;a href=&quot;http://www.quandl.com/&quot; rel=&quot;nofollow&quot;&gt;Quandl&lt;/a&gt; and the &lt;a href=&quot;http://research.stlouisfed.org/fred2/categories/32264&quot; rel=&quot;nofollow&quot;&gt;St. Louis Federal Reserve's database (FRED)&lt;/a&gt; should have what you're looking for.  FRED also has an &lt;a href=&quot;http://research.stlouisfed.org/fred-addin/&quot; rel=&quot;nofollow&quot;&gt;excel add-in&lt;/a&gt; that would take care of getting the feeds into excel format for you.  Quandl also has an &lt;a href=&quot;http://www.quandl.com/help/packages/excel-add-in&quot; rel=&quot;nofollow&quot;&gt;excel add-in&lt;/a&gt; and API resources for other languages too including Python, R, Matlab, Stata, Julia, Java, .NET, C/C++ and many more.&lt;/p&gt;&#xA;" OwnerUserId="5831" LastActivityDate="2014-02-04T13:00:34.760" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10162" PostTypeId="2" ParentId="8594" CreationDate="2014-02-04T13:46:31.853" Score="7" Body="&lt;p&gt;Check out following link. In page 23 you'll find the derivation.&#xA;&lt;a href=&quot;http://faculty.washington.edu/ezivot/econ424/portfolioTheoryMatrix.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://faculty.washington.edu/ezivot/econ424/portfolioTheoryMatrix.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7163" LastActivityDate="2014-02-04T13:46:31.853" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10163" PostTypeId="2" ParentId="10149" CreationDate="2014-02-04T14:39:23.640" Score="0" Body="&lt;p&gt;A Log-Transform did not help - I guess it has to do with dividends. When a stock does not pay dividends a risk-neutral investor should have no incentive to exercise a call option before expiration. Correct me if I'm wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Including a dividend rate (which diminished the risk free rate) should give incentive to exercise early and therefore make an american call option more worth than an european call option&lt;/p&gt;&#xA;" OwnerUserId="6748" LastActivityDate="2014-02-04T14:39:23.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10165" PostTypeId="1" AcceptedAnswerId="10193" CreationDate="2014-02-05T15:17:45.773" Score="-3" ViewCount="166" Body="&lt;p&gt;Just looking at &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.tradingeconomics.com/japan/foreign-bond-investment&quot; rel=&quot;nofollow&quot;&gt;http://www.tradingeconomics.com/japan/foreign-bond-investment&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wondering how can foreign bond investment be negative? You can have 0 investment, you can have positive investment, but how can value of investment be negative? Is it Bank of Japan buying back their own debt?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I get that it's a cash flow, but that doesn't explain the source of negative cash flows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why the down votes? I'm a newbie...&lt;/p&gt;&#xA;" OwnerUserId="5924" LastEditorUserId="5924" LastEditDate="2014-02-06T14:38:15.197" LastActivityDate="2014-02-09T21:01:12.223" Title="How can foreign investment have a negative figure?" Tags="&lt;fixed-income&gt;&lt;investing&gt;&lt;fundamentals&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10166" PostTypeId="1" CreationDate="2014-02-06T00:04:42.480" Score="1" ViewCount="341" Body="&lt;p&gt;I'm attempting a &quot;hello world&quot; of live algorithmic trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A script that pulls in tick data, presents it visually, and allows me to buy / sell at the press of a button.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also a toggle between { fake money + historical data } or { real money + current data }&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm entirely new to this scene; my background is in maths / computer programming.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also my enquiry is mainly academic; I would like to learn the basic principles through creating basic functional machines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe that what I need to do is find some broker that offers a web API, and allows free or low cost accounts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I find such a broker?  Every one I have found so far requires an initial deposit of several hundred dollars or more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm hoping to find some broker that allows you to open a free account, and practice with historical data and fake money, and then allows you to trade with real money, but with tiny amounts, say $1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuitively I would expect such a service to exist, as it would be a good way to attract a customer base. And I would expect so go to their website and see maybe a &quot;Hello World&quot; style script written in Python, to help get you started.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I can't find any!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anyone offering this service?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And is that question is off topic, then my apologies, and may I ask instead: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where would be an appropriate forum for such an enquiry?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: &lt;a href=&quot;http://www.tradingwithpython.com/&quot; rel=&quot;nofollow&quot;&gt;http://www.tradingwithpython.com/&lt;/a&gt; looks good!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT (August 2016): &lt;a href=&quot;https://www.quantopian.com&quot; rel=&quot;nofollow&quot;&gt;https://www.quantopian.com&lt;/a&gt; is where it is at!&lt;/p&gt;&#xA;" OwnerUserId="7172" LastEditorUserId="7172" LastEditDate="2016-08-13T21:49:02.807" LastActivityDate="2016-08-13T21:49:02.807" Title="Brokers offering low-cost / free accounts" Tags="&lt;trading&gt;&lt;automated-trading&gt;&lt;algorithmic-trading&gt;" AnswerCount="2" CommentCount="1" ClosedDate="2014-02-14T07:02:38.007" ContentLicense="CC BY-SA 3.0" />
  <row Id="10168" PostTypeId="2" ParentId="8196" CreationDate="2014-02-06T13:55:01.833" Score="3" Body="&lt;p&gt;Have you checked the &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/0304405X76900222&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; by Merton from the seventies? He gives the price of an option as an infinite series (eq. 16), whose every term seems monotonous in $\sigma$.&lt;/p&gt;&#xA;" OwnerUserId="7177" LastActivityDate="2014-02-06T13:55:01.833" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10169" PostTypeId="2" ParentId="9924" CreationDate="2014-02-06T19:28:14.003" Score="1" Body="&lt;p&gt;There are many issues with doing this type of study.  Will you be looking only at EPS surprises?  Many times the bottom line EPS is not relevant to the earnings of the company since it contains extraordinary items.  You may want to consider revenue surprises.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Investors are typically looking at a lot more than just the EPS when earnings are released. They're looking at the company's guidance for future earnings.  So it's difficult to say what percentage of a stock's price movement is due to the earnings result and what percentage is reacting to the company's guidance for its future earnings potential.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;StarMine (Thompson Reuters) has been following analyst estimates.  With any data set of analyst estimates, you need to consider whether you'll use the mean estimate, the median estimate and whether you'll consider the range of estimates.  Sometimes a star analyst's estimate carries more clout than the average of all analyst estimates.  Also, sometimes investors believe the consensus estimate and sometimes there is more of a &quot;whisper&quot; number that is not officially publicized but generally expected.  For example, people may expect a company will beat analyst estimates, yet the analysts haven't come out and increased their estimates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could also consider using company guidance vs. reported earnings.&lt;/p&gt;&#xA;" OwnerUserId="6234" LastActivityDate="2014-02-06T19:28:14.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10170" PostTypeId="1" CreationDate="2014-02-07T01:40:34.490" Score="8" ViewCount="1189" Body="&lt;p&gt;I'm building an automated option trading bot that executes common options multi-leg strategies (straddles, spreads) and I want to learn the best way to execute my orders. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you know, the bid-ask spread on thinly traded or just mediumly traded option series is very large; toss-in a multi-leg, you get a bid/ask spread that's just not reasonable for price discovery. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The naive execution is to just submit a order at the full size at the mid of the bid/ask of all of your spreads. But that order is rarely best execution and if it is filled right away, you know that you could've gotten a better price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I'd like to seek out some papers/algorithms that can come up with the best execution for both discretionary orders and must-filled hedging orders. &lt;/p&gt;&#xA;" OwnerUserId="7183" LastEditorDisplayName="user1157" LastEditDate="2014-02-07T07:36:40.763" LastActivityDate="2014-02-09T07:38:51.773" Title="Papers and algorithms on bidding schemes for best order execution?" Tags="&lt;options&gt;&lt;liquidity&gt;&lt;order-execution&gt;&lt;order&gt;&lt;quote&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10171" PostTypeId="2" ParentId="10150" CreationDate="2014-02-07T02:07:56.630" Score="2" Body="&lt;p&gt;Assuming the underlying mortgages that have been pooled into a Mortgage-Backed Security (MBS) are freely prepayable, the notional of the interest swap is unknown at inception. Therefore, you have two options - estimate a notional schedule to the best of your ability assuming some future evolution of interest rates (which are an important driver of prepayments) and tie your swap notional to this schedule (known as an amortizing swap), or even more rare, ask a dealer to quote you a &quot;balance-guaranteed&quot; swap that will exactly mimic the notional of the MBS. Obviously, since you are now asking the dealer to take on the prepayment risk, these swaps in most instances are so prohibitively expensive that they are rarely seen in the real world.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, interest rate exposure on MBS is typically hedged by estimating the sensitivity (DV01) at different points on the curve using an embedded prepayment model that is sensitive to interest rates and offsetting the risk with the appropriate amount of bullet swaps at each point on the curve.  &lt;/p&gt;&#xA;" OwnerUserId="6139" LastActivityDate="2014-02-07T02:07:56.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10172" PostTypeId="2" ParentId="10170" CreationDate="2014-02-07T08:09:59.627" Score="5" Body="&lt;p&gt;It is possible to think of a strategy for splitting orders for one large sell over time as a function $x_t$ which describes how much to sell at each timestep $t$. If the instantaneous trading rate $\dot{x_t}$ is too large, i.e. too much is sold at once you get immediate impact which is bad. If selling takes too much time, there is the risk of negative price movements, so both should be balanced. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt; Gatheral and Schied have suggested an approach to this problem to &lt;strong&gt;optimize trade execution under market impact&lt;/strong&gt;. The idea is to model two components of market impact into the SDE, &lt;em&gt;permanent impact&lt;/em&gt; and &lt;em&gt;short term impact&lt;/em&gt;. The result is an optimization problem of the form&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$minimize\quad E\left[\int_0^T (\dot{x}^2_t+ k^2x^2+\lambda x_t S_t)dt\right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $k$ and $\lambda$ are parameters for immediate and permanent impact, and $\dot{x}$ is the instantaneous speed of selling the asset. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;References:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;J. Gatheral and A. Schied, &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2034178&quot; rel=&quot;noreferrer&quot;&gt;Dynamical Models of Market Impact and Algorithms for Order Execution&lt;/a&gt;, Handbook on Systemic Risk, Cambridge University Press, 579-602 (2013).&lt;/li&gt;&#xA;&lt;li&gt;A. Schied, &lt;a href=&quot;http://arxiv.org/abs/1204.2717&quot; rel=&quot;noreferrer&quot;&gt;Robust strategies for optimal order execution in the Almgren-Chriss framework&lt;/a&gt;. Applied Mathematical Finance, 20, 264-286 (2013).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Comments:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;One nice point of their formulation is that they are able to derive a &lt;strong&gt;closed form solution&lt;/strong&gt; for the optimal strategy, so this can be evaluated quickly.&lt;/li&gt;&#xA;&lt;li&gt;They do not include trading costs, so I don't know how that impacts your optimal strategy.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerDisplayName="user1157" LastEditorDisplayName="user1157" LastEditDate="2014-02-07T18:35:10.970" LastActivityDate="2014-02-07T18:35:10.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10173" PostTypeId="2" ParentId="10149" CreationDate="2014-02-07T12:19:48.063" Score="2" Body="&lt;p&gt;I guess that, in your model, the stock does not pay dividends. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The price of an European Call option written for a stock that does not pay dividends is always higher than its intrinsic value. Therefore, in that case, &lt;em&gt;Prices of European and American Call options are equal&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this is not true for Put options, since Put values are short interest rates (Calls are long interest rates). If interest rates are zero, American and European Puts have the same price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that you are always better waiting until maturity to exercise the option, if the stock does not pay dividends, since otherwise you will lose the time value. When a stock pays dividends it might be better to exercise the day before the stock goes ex-dividend, because the drop in price of the stock may not compensate for the time value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is an idea of what is going on, by the way, not a formal proof.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; Clarified that, assuming no dividends, an European and American Call options have the same price. Assuming no interest rates ($r=0$) the same happens for Puts. &lt;/p&gt;&#xA;" OwnerUserId="1704" LastEditorUserId="1704" LastEditDate="2014-02-13T00:21:12.623" LastActivityDate="2014-02-13T00:21:12.623" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10174" PostTypeId="2" ParentId="10166" CreationDate="2014-02-07T19:44:03.443" Score="2" Body="&lt;p&gt;Python / R (my favorite) / mathlab are fine to make a quick analysis, visualize data, prototype and backtest your strategy. But I'm not aware of any trading platform that runs with them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keep going with whatever you feel comfortable for prototyping, but I would invest time to learn C (or even C++ on phase II, if you have enough time) as many trading platforms have C-like languages where you could implement the results of your analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would suggest a desktop platform, instead of web-base ones.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I started with MT4 (metatrader), because:&#xA;- mql4 language is C-like what means in the future you could probably move your results to other platforms with minor problems.&#xA;- There are plenty brokers (specially Forex ones) that offer demo accounts for MetaTrader with 0$ cost. (example: FXCM, ... - search on the web, you'll find a lot of them. Make sure you get the demo account for MT4)&#xA;- it runs on Windows, but I've seen it also running on Linux (using wine), so it may even work on Mac too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finding something similar for stocks is going to be more difficult. (I haven't find any). &#xA;I remember using Visual Chart, where if I'm right you have free end-of-day data (even for 1 m time series) that you could export as xls or csv.&#xA;It may be useful as a data source for stocks worldwide (US &amp;amp; Europe). (www.visualchart.com).&#xA;They use Visual Basic if you want to program something. But with a little bit of practise you may build your program in C / C++, make a windows DLL and call it from within visualchart ... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It could be great if anyone has something else ...&lt;/p&gt;&#xA;" OwnerUserId="6451" LastActivityDate="2014-02-07T19:44:03.443" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10175" PostTypeId="1" AcceptedAnswerId="10255" CreationDate="2014-02-07T23:38:03.153" Score="2" ViewCount="271" Body="&lt;p&gt;I have implemented two different expressions (&lt;a href=&quot;http://corporate.morningstar.com/ib/documents/MethodologyDocuments/IBBAssociates/BlackLitterman.pdf&quot; rel=&quot;nofollow&quot;&gt;Idzorek&lt;/a&gt; p.6, &lt;a href=&quot;http://www.blacklitterman.org/Black-Litterman.pdf&quot; rel=&quot;nofollow&quot;&gt;Walters&lt;/a&gt; p.51) of a posterior mean return calculation within a Black-Litterman framework. My results are the same, irrespective of the implemented expression, but if compared to the results published by Idzorek they differ. Also the R package BLCOP returns yet more confusing results. What am I missing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is corresponding code...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Equilibrium returns from CAPM, Idzorek p.5&#xA;mu = c(0.08, 0.67, 6.41, 4.08, 7.43, 3.70, 4.80, 6.60)/100&#xA;assetNames = c(&quot;US bonds&quot;, &quot;Int bonds&quot;, &quot;US large grow&quot;, &quot;US large value&quot;,&#xA;               &quot;US small grow&quot;, &quot;US small value&quot;, &quot;Int dev EQ&quot;, &quot;Int emerg EQ&quot;)&#xA;# Views (returns and pick matrix), Idzorek p.7, p.13&#xA;Q = c(5.25, 0.25, 2)/100 &#xA;P = matrix(0, ncol = 8, nrow = 3, dimnames = list(NULL, assetNames))&#xA;P[1,7] = 1&#xA;P[2,1] = -1; P[2,2] &amp;lt;- 1&#xA;P[3, 3:6] = c(0.9, -0.9, .1, -.1)&#xA;# Prior covariance-variance matrix, Idzorek table 5&#xA;entries = c(0.001005,0.001328,-0.000579,-0.000675,0.000121,0.000128,&#xA;             -0.000445, -0.000437, 0.001328,0.007277,-0.001307,-0.000610,&#xA;             -0.002237,-0.000989,0.001442,-0.001535, -0.000579,-0.001307,&#xA;             0.059852,0.027588,0.063497,0.023036,0.032967,0.048039,-0.000675,&#xA;             -0.000610,0.027588,0.029609,0.026572,0.021465,0.020697,0.029854,&#xA;             0.000121,-0.002237,0.063497,0.026572,0.102488,0.042744,0.039943,&#xA;             0.065994 ,0.000128,-0.000989,0.023036,0.021465,0.042744,0.032056,&#xA;             0.019881,0.032235 ,-0.000445,0.001442,0.032967,0.020697,0.039943,&#xA;             0.019881,0.028355,0.035064 ,-0.000437,-0.001535,0.048039,0.029854,&#xA;             0.065994,0.032235,0.035064,0.079958 )&#xA;sigma = matrix(entries, ncol = 8, nrow = 8)&#xA;# Equilibrium variance uncertainty, Idzorek p. 15&#xA;tau = 0.25&#xA;omega = diag(c((P[1,]%*%sigma%*%P[1,])*tau, &#xA;               (P[2,]%*%sigma%*%P[2,])*tau, &#xA;               (P[3,]%*%sigma%*%P[3,]))*tau)&#xA;# BL master formula for posterior mu in Walters, Appendix E&#xA;mu_JWalters = mu+(tau*sigma%*%t(P))%*%inv((tau*P%*%sigma%*%t(P))+omega)%*%(Q-P%*%mu)&#xA;# BL master formula for posterior mu in Idzorek p. 6&#xA;mu_Idzorek = inv(inv(tau*sigma)+(t(P)%*%inv(omega)%*%P))%*%((inv(tau*sigma)%*%mu)+(t(P)%*%inv(omega)%*%Q))&#xA;# BL posterior mu using BLCOP package&#xA;views = BLViews(P, Q,confidences=diag(omega), assetNames)&#xA;mu_BLCOP = posteriorEst(views=views,mu=mu,tau=tau,sigma=sigma)@posteriorMean&#xA;posteriorMuSet = round(cbind(mu_JWalters,mu_Idzorek,mu_BLCOP),digits=4)*100&#xA;dimnames(posteriorMuSet) = list(assetNames,c(&quot;Walters&quot;, &quot;Idzorek&quot;, &quot;BLCOP&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;... and the result is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;               Walters Idzorek BLCOP&#xA;US bonds          0.05    0.05  0.08&#xA;Int bonds         0.32    0.32  0.67&#xA;US large grow     6.75    6.75  6.41&#xA;US large value    4.51    4.51  4.08&#xA;US small grow     7.95    7.95  7.43&#xA;US small value    4.15    4.15  3.70&#xA;Int dev EQ        5.11    5.11  4.80&#xA;Int emerg EQ      7.16    7.16  6.60&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is quit different from the actual results in &lt;a href=&quot;http://corporate.morningstar.com/ib/documents/MethodologyDocuments/IBBAssociates/BlackLitterman.pdf&quot; rel=&quot;nofollow&quot;&gt;Idzorek&lt;/a&gt;. Any ideas are much appreciated!&lt;/p&gt;&#xA;" OwnerUserId="7186" LastActivityDate="2014-02-15T08:27:03.240" Title="Why does my posterior mean differs from Idzorek's results?" Tags="&lt;portfolio-management&gt;&lt;portfolio&gt;&lt;covariance&gt;&lt;mean-variance&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10176" PostTypeId="2" ParentId="7862" CreationDate="2014-02-08T00:45:56.937" Score="3" Body="&lt;p&gt;Have a look at fPortfolioBacktest. An example can be found here: &lt;a href=&quot;https://r-forge.r-project.org/scm/viewvc.php/pkg/fPortfolioBacktest/man/portfolioBacktesting.Rd?view=markup&amp;amp;revision=4086&amp;amp;root=rmetrics&quot; rel=&quot;nofollow&quot;&gt;https://r-forge.r-project.org/scm/viewvc.php/pkg/fPortfolioBacktest/man/portfolioBacktesting.Rd?view=markup&amp;amp;revision=4086&amp;amp;root=rmetrics&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: you may want to try backtestPlot(smoothedPortfolios) to visualise the strategy performance.&lt;/p&gt;&#xA;" OwnerUserId="7186" LastEditorUserId="7186" LastEditDate="2014-02-08T14:47:32.523" LastActivityDate="2014-02-08T14:47:32.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10177" PostTypeId="2" ParentId="10170" CreationDate="2014-02-08T07:51:30.417" Score="5" Body="&lt;p&gt;With respect to what you need, you have to consider different aspects of optimal trading:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the &lt;a href=&quot;http://www.courant.nyu.edu/~almgren/papers/optliq.pdf&quot; rel=&quot;noreferrer&quot;&gt;Almgren-Chriss framework&lt;/a&gt; (cited by Anna, since Jim and Alex -amongst others- extended it) focus on obtaining an &lt;strong&gt;optimal trading rate&lt;/strong&gt;, it is nice but not really what you need. You can nevertheless use it to plan / schedule your trading during the day.&lt;/li&gt;&#xA;&lt;li&gt;but what you need is to obtain prices at which your algorithm need to post orders; you have Avellaneda-Stoikov like frameworks. I believe the most advanced form is in the two Guéant-Fernandez-L papers:&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Guéant, O., Lehalle, C.-A., Fernandez-Tapia, J., Sep. 2012. Dealing with the inventory risk: a solution to the market making problem. Mathematics and Financial Economics. URL &lt;a href=&quot;http://arxiv.org/abs/1105.3115&quot; rel=&quot;noreferrer&quot;&gt;http://arxiv.org/abs/1105.3115&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Guéant, O., Lehalle, C.-A., Fernandez-Tapia, J., 2012. Optimal Execution with Limit Orders. SIAM Journal on Financial Mathematics 13 (1), 740-764. &lt;a href=&quot;http://arxiv.org/abs/1106.3279&quot; rel=&quot;noreferrer&quot;&gt;http://arxiv.org/abs/1106.3279&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Then you have literature on hedging with transaction costs, one typical paper is &lt;em&gt;D. Possamaï, N. Touzi and M. Soner, Homogenization and asymptotics for small transaction costs: the multidimensional case.&lt;/em&gt; &lt;a href=&quot;http://www.cmap.polytechnique.fr/~touzi/Possamai-Soner-Touzi-19.01.2013.pdf&quot; rel=&quot;noreferrer&quot;&gt;arXiv:1212.6275&lt;/a&gt;. Another paper of interest for you is Stoikov-Saglam's one, since it simultenaously make the market on the option and the underlying stock: &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1393818&quot; rel=&quot;noreferrer&quot;&gt;Option Market Making Under Inventory Risk&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Is it enough to solve your problem? unfortunately not! you will need a lot of empirical work to put all this together since there is not &quot;off the shelf&quot; solution by now. I would just attract you attention to a paper recently accepted by &lt;a href=&quot;http://www.tandfonline.com/toc/rquf20/current#.UvXhw0J5M1E&quot; rel=&quot;noreferrer&quot;&gt;Quantitative Finance&lt;/a&gt;: &lt;em&gt;Realtime market microstructure analysis: online transaction cost analysis - by Azencott, Beri, Gadhyan, Joseph, L, Rowley&lt;/em&gt; (2013) &lt;a href=&quot;http://arxiv.org/abs/1302.6363&quot; rel=&quot;noreferrer&quot;&gt;http://arxiv.org/abs/1302.6363&lt;/a&gt; . In this paper we develop an approach to conduct empirical analysis of market microstructure in real-time.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2014-02-08T07:51:30.417" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10178" PostTypeId="1" AcceptedAnswerId="10182" CreationDate="2014-02-08T09:06:54.827" Score="1" ViewCount="91" Body="&lt;p&gt;If you are the book keeper for a publicly traded company and you misrepresent the financial earnings of the company (even if by accident) for an earnings quarter, is this illegal?&lt;/p&gt;&#xA;" OwnerUserId="7188" LastActivityDate="2014-02-08T12:55:51.073" Title="Is it illegal for a publicly traded company to publish inaccurate financial data?" Tags="&lt;research&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10179" PostTypeId="2" ParentId="10146" CreationDate="2014-02-08T10:53:10.383" Score="2" Body="&lt;p&gt;If you need data for the EU, you can look here - &lt;a href=&quot;http://www.eba.europa.eu/&quot; rel=&quot;nofollow&quot;&gt;http://www.eba.europa.eu/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6905" LastActivityDate="2014-02-08T10:53:10.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10180" PostTypeId="1" AcceptedAnswerId="10186" CreationDate="2014-02-08T11:11:47.023" Score="6" ViewCount="254" Body="&lt;p&gt;I'm trying to follow the derivation of the stochastic vol pde for an option price - as given in Gatheral (The vol surface), Wilmott on Quant Finance and many other places. As usual one starts off with a portfolio $\Pi = C + \Delta S + \Delta_1 V$, from which we want to derive a PDE which the option price $C(t,S,\sigma)$ satisfies. Apply Ito's formula, and choosing the hedge ratios appropriately we can make this portfolio riskless. After some algebra we end up with something like&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$g(S, C,C_t, C_S, C_{SS}, C_\sigma, C_{\sigma,s})=g(S,V,V_t, V_S, V_{SS}, V_\sigma, V_{\sigma,s})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i.e. a relationship $g$ between the derivatives of $V$ and $C$ (in particular I'm referring to the first equation on page 6 &lt;a href=&quot;http://www.math.ku.dk/~rolf/teaching/ctff03/Gatheral.1.pdf&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;).  Now this is the part I don't understand, right under that equation the author says something along the lines, &quot;Since the left hand side is a function of $C$ only and the right hand side is a function of $V$ only, the only way the equality can be true is if both sides equal to some function $f$ of the independent variables $S$, $\sigma$ and $t$&quot;. Can someone explain why this is so exactly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And also why without loss of generality can we assume this function takes the form $f(t,S,\sigma)=\alpha-\phi \beta \sqrt{\sigma}$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The complete derivation can be found &lt;a href=&quot;http://www.math.ku.dk/~rolf/teaching/ctff03/Gatheral.1.pdf&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1130" LastEditorUserId="1130" LastEditDate="2014-02-08T13:10:33.590" LastActivityDate="2014-02-08T22:35:29.210" Title="Derivation of the Stochastic Vol PDE" Tags="&lt;option-pricing&gt;&lt;implied-volatility&gt;&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10181" PostTypeId="2" ParentId="10114" CreationDate="2014-02-08T12:16:16.130" Score="1" Body="&lt;p&gt;If I understand correctly you have calculated our investors expected payoff using his probabilities to 11.177USD. He wants a three percent return so the value he assigns is 11.177/1.03 = 10.85USD. Simple as that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then have another argument a la Black and Scholes to show that you can replicate the payoff to another cost. If that cost is lower, your investor have another incentive to buy.&lt;/p&gt;&#xA;" OwnerUserId="7189" LastActivityDate="2014-02-08T12:16:16.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10182" PostTypeId="2" ParentId="10178" CreationDate="2014-02-08T12:55:51.073" Score="1" Body="&lt;p&gt;Intentional misrepresentation of financial records is most likely punishable by law. You may want to compare the outcome of &lt;a href=&quot;http://en.wikipedia.org/wiki/Accounting_scandals&quot; rel=&quot;nofollow noreferrer&quot;&gt;accounting scandals&lt;/a&gt;.&#xA;The degree of punishment may depend however on the the jurisdiction not only of the company and type of company but also where it is listed. Whether an individual is accountable often depends on the position and responsibilities the individuals hold. The &lt;a href=&quot;http://www.sec.gov/about/laws.shtml#sox2002&quot; rel=&quot;nofollow noreferrer&quot;&gt;Sarbanes-Oxley Act&lt;/a&gt; is one of the more prominent ordinances governing accounting issues for US listed companies.&lt;/p&gt;&#xA;&lt;p&gt;Accidental errors do occur from time to time. Apart from the ethical obligations for some professionals there may be legal obligations regarding the correction of such errors. For example &lt;a href=&quot;http://www.iasplus.com/en/standards/ias/ias8&quot; rel=&quot;nofollow noreferrer&quot;&gt;IAS8&lt;/a&gt; defines how errors should be handled in within the IFRS framework and the there is guidance on errors in &lt;a href=&quot;http://www.sec.gov/divisions/corpfin/guidance/8-kinterp.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;SEC 8K&lt;/a&gt; filings. I am not sure regarding the punishment for corporate or individuals if errors are not handled appropriately.&lt;/p&gt;&#xA;" OwnerUserId="7186" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2014-02-08T12:55:51.073" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10183" PostTypeId="2" ParentId="9695" CreationDate="2014-02-08T14:33:48.727" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Quantitative_investing&quot; rel=&quot;nofollow noreferrer&quot;&gt;Quantitative investing&lt;/a&gt; is using primarily quantitative information to justify the investment decision. This is different from an &lt;a href=&quot;http://pages.stern.nyu.edu/%7E%20adamodar/New_Home_Page/invmgmt/invmgt1.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;investment process&lt;/a&gt; which relies primarily on expert &lt;a href=&quot;http://www.jstor.org/discover/10.2307/2978668?uid=3737760&amp;amp;uid=2129&amp;amp;uid=2&amp;amp;uid=70&amp;amp;uid=4&amp;amp;sid=21103410237747&quot; rel=&quot;nofollow noreferrer&quot;&gt;judgement&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Example: when assessing a companies financial reporting quality a quantitative investor may rather run a &lt;a href=&quot;http://www.cfapubs.org/doi/full/10.2469/faj.v69.n5.8&quot; rel=&quot;nofollow noreferrer&quot;&gt;fraud detection model&lt;/a&gt; where a non-quantitative investor may rather judge the &lt;a href=&quot;http://www.journalofaccountancy.com/Issues/2001/Feb/WhyEmployeesCommitFraud&quot; rel=&quot;nofollow noreferrer&quot;&gt;reliability, character, opportunity and other factors&lt;/a&gt; of the CFO.&lt;/p&gt;&#xA;&lt;p&gt;Quantitative decision making can be applied not only to trading but also to research, portfolio construction, execution and other investment disciplines.&lt;/p&gt;&#xA;" OwnerUserId="7186" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2014-02-08T14:41:36.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10184" PostTypeId="2" ParentId="8683" CreationDate="2014-02-08T14:56:59.760" Score="0" Body="&lt;p&gt;Accurate performance reporting is an important subject. The amount and timing of monies in an account is just one of the aspects affecting the performance. Others include taxes, fees, day count convention and benchmark construction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the frameworks often referenced for that matter are the Globale Investment Performance Standards (&lt;a href=&quot;http://www.gipsstandards.org/Pages/index.aspx&quot; rel=&quot;nofollow&quot;&gt;GIPS&lt;/a&gt;). The standards are available for &lt;a href=&quot;http://www.gipsstandards.org/standards/current/Pages/index.aspx&quot; rel=&quot;nofollow&quot;&gt;download&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7186" LastEditorUserId="7186" LastEditDate="2014-02-08T16:10:55.593" LastActivityDate="2014-02-08T16:10:55.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10185" PostTypeId="2" ParentId="4239" CreationDate="2014-02-08T17:14:23.300" Score="0" Body="&lt;p&gt;I believe there are several questions being asked. Since there are several behavioural patters that could be measured I suggest to first identify which is of most interest. See &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0195304217&quot; rel=&quot;nofollow&quot;&gt;Hersh&lt;/a&gt; for a good summary of patterns.&#xA;For most behavioural patterns that I can think of you would need transaction data. &lt;/p&gt;&#xA;" OwnerUserId="7186" LastActivityDate="2014-02-08T17:14:23.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10186" PostTypeId="2" ParentId="10180" CreationDate="2014-02-08T22:35:29.210" Score="6" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;So we have the identity $$g(S,\sigma, t, C,C_t,C_S,...)=g(S, t,\sigma, V,V_t,V_S,...)$$&#xA;where &#xA;$S$, $\sigma$, and $t$ are independent variables and $V=V(S,\sigma,t)$, $C=C(S,\sigma,t)$ are some unknown functions. But we can also treat the above identity formally &#xA;and assume that the &lt;em&gt;functions&lt;/em&gt; $C,C_t,C_S,...,V,V_t,V_S,... $ are themselves independent &lt;em&gt;parameters&lt;/em&gt; or &lt;em&gt;variables&lt;/em&gt;. Now, if we fix all variables except for $C$ and compute the partial derivative $\partial g/\partial C$ we will find that&#xA;$$\frac{\partial g}{\partial C}=0$$&#xA;for all values of $S,\sigma, t,C_t,C_S,...,V,V_t,V_S,...$ since the &lt;em&gt;right-hand side&lt;/em&gt; of the identity does not depend on $C$. This imples that $g$ is constant with respect to $C$. Similarly, one can get that&#xA;$$\frac{\partial g}{\partial V}=0$$&#xA;since the &lt;em&gt;left-hand side&lt;/em&gt; of the identity does not depend on $V$. Hence, $g$ is constant with respect to $V$ as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can repeat this argument for $C_t,C_S,...,V_t,V_S,... $, which would imply that $g$&#xA;does not depend on any of those formal variables. However, we cannot apply the same argument to any of the variables $S$, $\sigma$ or $t$, since &lt;em&gt;both&lt;/em&gt; sides of the identity depend on each of the them. In other words,&#xA;$$ g(S,\sigma, t, C,C_t,C_S,...)=g(S, t,\sigma, V,V_t,V_S,...)=f(S,\sigma, t)$$&#xA;for some function $f=f(S,\sigma, t)$. The above argument is not dissimilar to the standard trick of  &lt;a href=&quot;http://en.wikipedia.org/wiki/Separation_of_variables#Partial_differential_equations&quot; rel=&quot;noreferrer&quot;&gt;separation of variables&lt;/a&gt; which is used to solve simple partial differential equations.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Now, we can simply express the unknown function $f$ in terms of another arbitrary function $\phi=\phi(S,\sigma, t)$:&#xA;$$f= -(\alpha-\phi\beta).$$&#xA;We do not know the function $\phi$ explicitly, of course. However, it is just slightly more convenient to deal with $\phi$ rather than $f$, and, besides, the former can be interpreted  as the 'market price of risk'.  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="70" LastActivityDate="2014-02-08T22:35:29.210" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10187" PostTypeId="2" ParentId="10170" CreationDate="2014-02-09T07:38:51.773" Score="3" Body="&lt;p&gt;I can speak from experience that options with next to no volume and ridiculously large spreads have market makers that accept nothing short of 5% effective spreads, right below liquidation value for deep in the money, and quickly nothing for out of the money.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, the parameters should be expected to move against your fund flows very quickly.  I've found it difficult to enter and exit large positions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If one takes the approach of walking orders from the bid to the ask, the bid will become quickly crowded out, and the parameters move even faster.  The same is true for walking from the ask.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If one tries to make a good estimation of the parameters, they seem to move more slowly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Parameters don't move quite as much when trading the position instead of entering and exiting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is probably common knowledge, but I had to experience to believe it.&lt;/p&gt;&#xA;" OwnerDisplayName="user6500" LastActivityDate="2014-02-09T07:38:51.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10188" PostTypeId="1" CreationDate="2014-02-09T11:52:15.260" Score="1" ViewCount="267" Body="&lt;p&gt;Firstly, I do not have a quant finance background. This is new to me, and I imagine that this is a basic question for this group.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am calculating the price of a binary/digital option with closed-form equations derived from a Black-Scholes analysis. More specifically, I am using the Black-Scholes valuation for a &lt;a href=&quot;http://en.wikipedia.org/wiki/Binary_option#Cash-or-nothing_call&quot; rel=&quot;nofollow&quot;&gt;Cash-or-nothing call&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The option period that I have been asked to calculate ends every hour, on the hour. I am sampling the underlying every 5 seconds. How should I scale and/or calculate my volatility if I want to use the &lt;a href=&quot;http://optionstradingbeginner.blogspot.co.uk/2010/11/historical-volatility-part-2-formula-to.html&quot; rel=&quot;nofollow&quot;&gt;'normal' approach&lt;/a&gt; (but assuming a 0 mean). These are all annualised to one year. Should I still do the same?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More specifically, I am curious how I scale the standard deviation of the sum of the square log returns in this case?&lt;/p&gt;&#xA;" OwnerUserId="7197" LastActivityDate="2014-03-17T12:38:07.690" Title="Volatility calculation for intra-day cash-or-nothing call binary option" Tags="&lt;volatility&gt;&lt;binary-options&gt;&lt;cash-or-nothing&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10189" PostTypeId="1" AcceptedAnswerId="10269" CreationDate="2014-02-09T13:48:28.447" Score="4" ViewCount="313" Body="&lt;p&gt;I'm looking to piece together a robust optimization model that handles robust optimization with fixed transaction costs and other combinatorial variables (e.g. asset count constraints).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's what I've been able to find so far:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.corc.ieor.columbia.edu/reports/techreports/tr-2002-04.pdf&quot; rel=&quot;nofollow&quot;&gt;Goldfarb and Iyengar 2004&lt;/a&gt; describes an SOCP robust counterpart to QCP problems. But it doesn't discuss combinatorial variables (explicitly).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://faculty.washington.edu/mfazel/portfolio-final.pdf&quot; rel=&quot;nofollow&quot;&gt;Lobo, Fazel, and Boyd 2006&lt;/a&gt; demonstrate a heuristic that solves the affine transaction cost problem via a heuristic that only requires ~5-6 runs of the underlying convex optimization problem to achieve a near optimal solution. Their underlying convex problem is not robust, however.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Is there a resource that pieces both of these together? &lt;/p&gt;&#xA;" OwnerUserId="2119" LastEditorUserId="2119" LastEditDate="2014-02-09T19:44:39.253" LastActivityDate="2014-02-22T22:10:52.273" Title="Is there any academic material regarding robust optimization with fixed transaction costs?" Tags="&lt;optimization&gt;&lt;robust-optimization&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10190" PostTypeId="2" ParentId="10166" CreationDate="2014-02-09T15:04:40.180" Score="0" Body="&lt;p&gt;I think Interactive Brokers offers everything you want.  They do have a low cost student(by age) offering but it's not free.  You can test your program for free if you use a demo account but it's very limited.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They do have paper trading and live trading accounts that are better than the demo account but you must pay for real time data.  This is required even if you just want historical data and there's a limited amount of that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are no python examples from IB but there is an IbPy open source solution that I've never used.  There are plenty of C and Java examples from IB.&lt;/p&gt;&#xA;" OwnerUserId="5872" LastActivityDate="2014-02-09T15:04:40.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10191" PostTypeId="2" ParentId="8138" CreationDate="2014-02-09T17:48:06.460" Score="2" Body="&lt;p&gt;Marketwatch has financials for a lot of companies, including H&amp;amp;M: &lt;a href=&quot;http://www.marketwatch.com/investing/stock/hmb/financials?countrycode=se&quot; rel=&quot;nofollow noreferrer&quot;&gt;Annual Financials for H&amp;amp;M Hennes &amp;amp; Mauritz AB Series B&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Pn78B.jpg&quot; alt=&quot;preview of H&amp;amp;M financials&quot;&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user1157" LastActivityDate="2014-02-09T17:48:06.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10192" PostTypeId="2" ParentId="10189" CreationDate="2014-02-09T18:02:31.793" Score="0" Body="&lt;p&gt;You could refer Dimitris Bertsimas's &lt;a href=&quot;http://www.mit.edu/~dbertsim/papers.html#Robust&quot; rel=&quot;nofollow&quot;&gt;work on Robust Optimization&lt;/a&gt;. One of his &lt;a href=&quot;http://www.mit.edu/~dbertsim/papers/Robust%20Optimization/Robust%20Multiperiod%20Portfolio%20Management%20in%20the%20Presence%20of%20Transaction%20Costs.pdf&quot; rel=&quot;nofollow&quot;&gt;notable works&lt;/a&gt; that may be relevant include robust optimization formulations of the multiperiod portfolio optimization problem in the presence of transaction costs. &lt;/p&gt;&#xA;" OwnerUserId="1424" LastActivityDate="2014-02-09T18:02:31.793" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10193" PostTypeId="2" ParentId="10165" CreationDate="2014-02-09T21:01:12.223" Score="1" Body="&lt;p&gt;There a likely multiple source of this indicator becoming negative in general. In this particular case this is probably related to the investment of &lt;a href=&quot;http://uk.reuters.com/article/2013/10/31/japan-economy-capflow-idUKL3N0IL0O420131031&quot; rel=&quot;nofollow&quot;&gt;Japanese monies in foreign bonds&lt;/a&gt;. Which in turn looks to be an effect of the quantitative easing by the Bank of Japan.&lt;/p&gt;&#xA;" OwnerUserId="7186" LastActivityDate="2014-02-09T21:01:12.223" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10194" PostTypeId="1" AcceptedAnswerId="10198" CreationDate="2014-02-09T21:26:02.183" Score="4" ViewCount="12693" Body="&lt;p&gt;What is the best way to simulate the short rate $r(t)$ in a simple one factor Hull White process? Suppose I have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;dr(t) = (\theta(t)-\alpha r(t))dt+\sigma dW_t&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\theta(t)$ is calibrated to swap curve, constants $\alpha$ and $\sigma$ are calibrated to caps using closed form solution for zero-coupon bond options. The best way I can think to do it is an Euler discretisation, that is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;r(t+\Delta t) = r(t) + \theta(t)\Delta t - \alpha r(t) \Delta t + \sigma \sqrt {\Delta t} Z&#xA;$$&#xA;where $Z \sim N(0,1)$. In this case, I need $t$ to go from 0 to 10 years, ideally in 0.25 increments. But with Euler, I'd need to use small $\Delta t$, so perhaps 0.025 or less? Once I have string of $r(t)$, I can easily calculate $P(t,T)$ zero coupon bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Appreciate any other ideas or if someone could point me in the right direction. I'm quite new to rates modelling!&lt;/p&gt;&#xA;" OwnerUserId="7166" LastEditorUserId="2587" LastEditDate="2014-02-10T12:40:32.090" LastActivityDate="2017-06-11T09:34:31.963" Title="Simulating the short rate in the Hull-White model" Tags="&lt;monte-carlo&gt;&lt;hullwhite&gt;" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10195" PostTypeId="2" ParentId="8138" CreationDate="2014-02-09T21:49:44.537" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://financials.morningstar.com/income-statement/is.html?t=HNNMY&amp;amp;region=usa&amp;amp;culture=en-US&amp;amp;ownerCountry=USA&quot; rel=&quot;nofollow&quot;&gt;Morningstar&lt;/a&gt; is the best one I've found so far. It has all the data required &lt;em&gt;and&lt;/em&gt;, as I've recently found, can export it quite easily to CSV. The key is to send the right parameters to &lt;code&gt;/ajax/ReportProcess4CSV.html&lt;/code&gt;. In what scenarios scraping this is allowed, I do not know. I will endeavor to find out once I start building this application.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For anyone looking to do the same thing, the following parameters are the ones I use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$defaults = array(&#xA;            't'             =&amp;gt; '',      // The ticker&#xA;            'reportType'    =&amp;gt; '',      // 'is', 'bs' or 'cf' depending on what you want&#xA;            'period'        =&amp;gt; 12,&#xA;            'dataType'      =&amp;gt; 'A',&#xA;            'columnYear'    =&amp;gt; 5,&#xA;        );&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The last three parameters are not there for you to change but simply have to be part of the URL.&lt;/p&gt;&#xA;" OwnerUserId="5363" LastActivityDate="2014-02-09T21:49:44.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10197" PostTypeId="2" ParentId="1933" CreationDate="2014-02-10T11:04:55.837" Score="1" Body="&lt;p&gt;You want to know about their recent staff turnover and hiring rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You want to be at a place that is both stable and growing slowly, and doesn't hire and fire employees (overlapping but distinct criteria). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the first point, I would avoid new and fast growth firms unless you don't mind being fired in a year since you were hired liberally and the growth has slowed. HFT firms tend to start strong (often because the founders adopted strategies from their previous research/employers), then experience reduced profitability because the research isn't producing what's needed to keep going, or they can't compete with bigger firms continued investments into new tech. There is actual academic evidence for this effect (can't find the paper now) and it is well known in industry that it is very hard to get a HFT firm running for the long-term.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The exception could be if you are actually very very good then you can make it big if you are a key player in such a firm in its growth stage. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the second point, you want to be one of the very few candidates that has been offered a job in the last 6 months, while also requiring that the firm is quite profitable. This shows they are willing to invest in you instead of hire you and let you go as soon as they see you're not in the top 20% of the distribution of capability that they assigned to you throughout the interview process. Your capability is a random variable from their perspective and it is not uncommon to try a candidate to see if the realisation of this random variable is in the upper end of the distribution originally assigned to the candidate - if not, you may just be gone after a short stint.&lt;/p&gt;&#xA;" OwnerUserId="6081" LastEditorUserId="6081" LastEditDate="2014-02-10T13:54:25.647" LastActivityDate="2014-02-10T13:54:25.647" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10198" PostTypeId="2" ParentId="10194" CreationDate="2014-02-10T12:32:16.803" Score="5" Body="&lt;ul&gt;&#xA;&lt;li&gt;In fact you can calibrate $\theta(t)$ piecewise constant and $\alpha$ and $\sigma$ to bond prices only. You don't need the swaption prices in mM.  If you let $\sigma(t)$ depend on $t$ (this is called the generalized Hull-White model) then you need information about the options market.&lt;/li&gt;&#xA;&lt;li&gt;For the model as you write it you don't necessarily need MC to calculate zero-coupon bond prices and thus discount factors. It is not that easy but following procedures as described &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1514192&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt; could help.&lt;/li&gt;&#xA;&lt;li&gt;if you stick to MC: For $\Delta t$ I would use it small like $1/250 \approx 0.004$. This is one time-step per banking-day. You should be able to simulate many paths with all the $10*250=2500$ random variables. Without digging into the theoretical aspects of choosing the step-size. If this takes too long then double the step size $\approx 0.008$. Maybe much bigger steps work too. But this looks natural to me.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;A remark: if there were no mean-reversion then I would use much bigger step-sizes. You could take steps up to the coupon dates. But in order to feel mean reversion I would keep the step size small. Another thing is negative rates. In HW you can have them and they exist in reality these days. Again: mean reversion to a non-negative $\theta(t)$ will keep rates positive most of the time if $\Delta t$ is small.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2014-02-10T12:39:51.853" LastActivityDate="2014-02-10T12:39:51.853" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10199" PostTypeId="2" ParentId="9699" CreationDate="2014-02-11T07:46:47.367" Score="1" Body="&lt;p&gt;your steps are a bit too complicated to me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in Step 1 and 2 you do two things: you caculate monthly log-returns and then their standard decviation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given prices $P_t$ indexed by time the log return is given by&#xA;$$&#xA;r_t = \ln(P_t/P_{t-1}) = \ln(P_t) - \ln(P_{t-1}).&#xA;$$&#xA;The formula for standard-deviation (the sample estimator of it) should be clear:&#xA;$$&#xA;\sigma = \frac1{n-1} \sum_{t=1}^n (r_t-\bar{r})^2, &#xA;$$&#xA;where $\bar{r}$ is the average return. Usually software packages have a function for standard-deviation.&#xA;Then you annualize volatility $\sigma_a $ by the square-root of time rule:&#xA;$$&#xA;\sigma_a = \sigma \sqrt{12}.&#xA;$$&#xA;So much for the first three steps. Your formula 3 is a mixture of various ways to calculate yearly and monthly returns from one another (geometric returns not log returns). But for calculating a yearly vola you need the formula above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Last comments: &#xA;Be sure you understand the math. If you mix up volatility and returns then you need to study some more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second: for a text book example: ok, use the past $20$ years of data. For  real life: don't estimate a default probability for the, say, comming year using data that is that old. The world changes and so do firms and I don't expect data from $20$ years ago to be relevant at the moment.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="4910" LastEditDate="2015-08-11T17:51:00.877" LastActivityDate="2015-08-11T17:51:00.877" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10200" PostTypeId="1" AcceptedAnswerId="10202" CreationDate="2014-02-11T10:23:51.747" Score="3" ViewCount="254" Body="&lt;p&gt;I'm doing a panel data analysis where the log of the freefloat number of outstanding shares is one of the explanatory variables, but it fails the Augmented Dickey Fuller and Person Phillips unit root tests. But intuitively I suspect it to be stationary but with structural breaks. (I know these unit root tests to be sensitive to breaks.)![nosfhl][1]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The image shows this variable for 108 stocks, and over a time-span of 15 years. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you say something useful about the nature of these timeseries?&lt;/p&gt;&#xA;" OwnerUserId="2402" LastEditorUserId="2402" LastEditDate="2014-02-25T16:50:45.683" LastActivityDate="2014-02-25T16:50:45.683" Title="Is the number of outstanding shares a stationary series?" Tags="&lt;time-series&gt;&lt;stationarity&gt;" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10201" PostTypeId="1" CreationDate="2014-02-11T11:51:53.897" Score="1" ViewCount="116" Body="&lt;p&gt;Can anyone show me how to answer this please?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A stock has beta of 2.0 and stock specific daily volatility of 0.04. Suppose that yesterday’s closing price was 95 and today the market goes up by 3%. What’s the probability of today’s closing price being at least 98?&lt;/p&gt;&#xA;" OwnerUserId="4603" LastActivityDate="2014-02-11T11:51:53.897" Title="Stock Price Question" Tags="&lt;normal-distribution&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10202" PostTypeId="2" ParentId="10200" CreationDate="2014-02-11T12:28:50.767" Score="5" Body="&lt;p&gt;To quote Wikipedia:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In mathematics, a stationary process (or strict(ly) stationary process or strong(ly) stationary process) is a stochastic process whose joint probability distribution does not change when shifted in time. Consequently, parameters such as the mean and variance, if they are present, also do not change over time and do not follow any trends.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Clearly, the underlying distribution can change due to one of the factors user2763361 names. I think even more could be named. Hence, the the number of outstanding shares is &lt;em&gt;not&lt;/em&gt; a stationary series. Note that this conclusion can be made a priori and that even if the series passes the test they should be considered non-stationary as user2763361 notes in the comments.&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="848" LastEditDate="2014-02-11T14:10:03.490" LastActivityDate="2014-02-11T14:10:03.490" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10204" PostTypeId="1" CreationDate="2014-02-11T14:26:28.887" Score="3" ViewCount="725" Body="&lt;p&gt;Bloomberg, in its documentation, explains that it calculates the short rate volatility for its Hull White implementation by multiplying the e.g. 10y IRS rate (divided by 100) by the 10y cap vol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I must be missing something obvious.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;---Update---&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally got a response in terms of more documentation, and a half sentence that mentions lognormal vs normal, which I'm assuming means they are saying that the cap vol is a Black (i.e. lognormal) volatility of dr/r, but we want a normal volatility for the Hull-White model of dr (which they use). So multiply by r both sides.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which is, I suppose, approximately the right idea? Except why the 10y cap vol and 10y rate, when the Hull-White model is a one-factor model of the short rate; the 10y rate is not the short rate, even if we assume the volatility is constant and equal to the value at 10y.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastEditorUserId="1314" LastEditDate="2014-02-13T15:47:26.523" LastActivityDate="2014-02-13T15:47:26.523" Title="Reasoning for Bloomberg's short rate volatilty calculation" Tags="&lt;volatility&gt;&lt;interest-rates&gt;&lt;hullwhite&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10205" PostTypeId="2" ParentId="10200" CreationDate="2014-02-11T15:24:53.517" Score="1" Body="&lt;p&gt;I would argue that this is the very definition of a non-stationary process.  We know that shares outstanding are incrementally added to or removed from by the company issuing or repurchasing shares.  These innovations are added to the previous outstanding share count.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first instinct would be to model this as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Y_i = Y_{i-1} + dX$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or perhaps something jumpier.  Definitely not stationary.&lt;/p&gt;&#xA;" OwnerUserId="3491" LastActivityDate="2014-02-11T15:24:53.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10206" PostTypeId="2" ParentId="10200" CreationDate="2014-02-11T17:31:48.797" Score="1" Body="&lt;p&gt;You can't include the levels in OLS. You will get biased coefficient and standard error estimates. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Look to include this as some sort of ratio with other predictors based on theory, and test the ratio's stationarity. I can't yet imagine how this point would work but think about it. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Maybe you can test the order of integration and use multiple differencing. It could be applicable if you find evidence for $I(n)$ with $n &amp;gt; 1$ (which it will be if it is in fact integrated). The issue is that you're using daily data and thus do not have much info about the population process. Any test on $n$ will give you wildly varying results (the straight lines will be $I(0)$ for example). If you can find something in the literature to estimate $n$ based on a panel/cross-section, then this is good news for your paper.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You may also want to look into nonstationary panel data analysis (google this). I've messed around with this a bit and it's tough to get it to give sensible estimates, but maybe I did it wrong. I do not remember if this regression methodology is applicable to your problem and time series. This may require $I(1)$ which I do not think some of your series adheres to (although maybe you can convince a sufficiently bad reviewer that this is the case). From what I can recall you can expect good results with $I(1)$ series entered as levels and small finite samples. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="6081" LastActivityDate="2014-02-11T17:31:48.797" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10208" PostTypeId="1" AcceptedAnswerId="10209" CreationDate="2014-02-11T18:28:07.067" Score="1" ViewCount="334" Body="&lt;p&gt;If I see a Bid at 181.77 and and Ask at 181.78 for SPY and then immediately see a trade filled at 181.77 on BATS, then what can we conclude about market making activity?&#xA;i.e At what price did the market maker buy from the seller and at what price did he sell to the buyer? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought since MM takes the other side of each trade, he bought at 181.78 and sold at 181.77 but obviously this is false since he is at a loss here.&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2014-02-11T19:43:07.727" Title="Estimate the market maker's price from the posted Bid/Ask and Trade price" Tags="&lt;market-making&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10209" PostTypeId="2" ParentId="10208" CreationDate="2014-02-11T19:43:07.727" Score="1" Body="&lt;p&gt;Market making refers to an activity in the markets that provides a market for a given securities. Each market has different rules on market making (see &lt;a href=&quot;http://www.londonstockexchange.com/traders-and-brokers/rules-regulations/market-making/market-making.htm&quot; rel=&quot;nofollow&quot;&gt;LSE rules&lt;/a&gt;). However, I do not see a need for a market maker to fill at a loss necessarily, because he may warehouse the securities. That is, he may still hold securities that were bought at an even lower price and he may choose to sell these before he sells more expensive ones. &lt;/p&gt;&#xA;" OwnerUserId="7186" LastActivityDate="2014-02-11T19:43:07.727" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10210" PostTypeId="1" AcceptedAnswerId="10212" CreationDate="2014-02-11T21:38:56.383" Score="6" ViewCount="1830" Body="&lt;p&gt;Assuming the Black Scholes model and pricing formula of a European call option. Then, if the call is ITM, i.e. if $ln(\frac{S}{K})&amp;gt;0$, the $d_1$-term will go towards infinity as $\sigma$ goes to zero. This also implies that the $d_2$-term will go to infinity and the normal cdfs will both approach 1. This creates a lower bound $S-e^{-r(T-t)}K$ for the option price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let's assume I want to compute the implied volatility for the ITM call option, but the price of call is smaller than lower bound of the B.S. pricing formula. Then the equation I'm trying to solve for the IV does not have a solution. Precisely this is happening as I'm trying to compute the IV of deep ITM calls. However, usually one talks about the volatility smile, where deep ITM calls has larger volatility than ATM calls. Is there any reasonable interpretation of this?&lt;/p&gt;&#xA;" OwnerUserId="4709" LastActivityDate="2016-07-19T10:31:34.413" Title="Lower bound of ITM Calls when computing Implied Volatility" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;implied-volatility&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10211" PostTypeId="2" ParentId="4599" CreationDate="2014-02-11T23:33:22.023" Score="1" Body="&lt;p&gt;My back testing has shown that in the case of really big market moves, dynamic delta hedging of short positions can increase risk in comparison to no hedging, and in fact cause large losses.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For confirmation, see &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.536.1775&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Cont, Tankov and Voltchkova, Hedging with options in models with jumps&lt;/a&gt; which concludes just that.&lt;/p&gt;&#xA;" OwnerUserId="7214" LastEditorUserId="1757" LastEditDate="2017-12-01T01:40:22.153" LastActivityDate="2017-12-01T01:40:22.153" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10212" PostTypeId="2" ParentId="10210" CreationDate="2014-02-11T23:35:25.110" Score="6" Body="&lt;p&gt;The lower bound is not just a BS-specific bound. It is a no-arbitrage bound and so if the price is lower than this, you have an arbitrage opportunity (some good explanation &lt;a href=&quot;http://www.scribd.com/doc/27707038/3-No-Arbitrage-Bound-on-Option&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;). It doesn't mean it is present in the market necessarily, because mid price is not necessarily the price you can trade and when you take spread into account this is likely to go away. It is quite often the case for ITM options because data for them is of lower quality (low liquidity). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When the price is exactly on that border (zero time value), it actually would mean that the implied volatility is exactly zero, because you are essentially stating that there is zero probability of price going higher than the strike. &lt;a href=&quot;http://en.wikipedia.org/wiki/Volatility_smile&quot; rel=&quot;nofollow noreferrer&quot;&gt;Volatility smile&lt;/a&gt; is a topic on its own, and there are books written about this phenomenon. From the practical point of view, however, you again need to think about the quality of the data - while in theory you should have some sort of nice smooth volatility smile, when you are working with real data you can get some weird results. First thing is that using ITM options is a bad idea because price quality is more likely bad than good, use only OTM's. Implied volatilities &quot;in theory&quot; should match, but OTM put price is a better estimate of a fair price than ITM call price. Also keep in mind that &quot;smile&quot; doesn't mean that it is symmetric, in fact it can take &lt;a href=&quot;http://www.theoptionsguide.com/volatility-smile.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;different kinds of shapes&lt;/a&gt; (sometimes &lt;a href=&quot;https://quant.stackexchange.com/questions/9055/concave-volatility-smile&quot;&gt;quite weird&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just as a final note, since you are talking about &lt;em&gt;deep&lt;/em&gt; ITM calls (or OTM puts), the volatility can go up due to the fact that the prices are quantized. That is, all OTM puts from some point will cost exactly \$0.01, simply because there is nothing below that. Obviously, the implied volatility for higher strike will be higher in such case, with this price fixed and you'll see it going straight up from some point. This can be mistaken for the genuine volatility smile, while it is not it - in theory, option price should go below \$0.01 to fractions and the implied volatility would be completely different.&lt;/p&gt;&#xA;" OwnerUserId="5086" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2014-02-11T23:45:17.323" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10213" PostTypeId="2" ParentId="10210" CreationDate="2014-02-12T01:07:05.187" Score="3" Body="&lt;p&gt;Most likely you are looking at bid prices which are lower that fair (theoretical) price. It is very common that bid price of an ITM option is below the lower bound as bid-ask spreads are wide.&#xA;The IV of ITM call at theoretical price should match IV of OTM put at corresponding strike. If this does not happen then check your forward price, rates and dividends.&lt;/p&gt;&#xA;" OwnerUserId="7216" LastActivityDate="2014-02-12T01:07:05.187" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10214" PostTypeId="1" CreationDate="2014-02-12T09:58:20.067" Score="11" ViewCount="744" Body="&lt;p&gt;I am trying to develop a short course on financial theory, covering the fundamentals of forward and options pricing, and 'efficient market' theory.  I want to reduce the amount of mathematics to a minimum. This is not because the audience does not include mathematicians (it does) but rather because in my view mathematics generally detracts from the simplicity and beauty of a subject. Mathematics also focuses on the process of derivation from assumptions, rather than the assumptions themselves. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is whether this would be possible for financial theory. In particular (a) are there any basic principles of financial theory that cannot be grasped without complex mathematics and (2) are there any important results (i.e. derived results) which cannot be explained except by complex mathematics?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a sense of where I am coming from, this page &lt;a href=&quot;http://mathworld.wolfram.com/PythagoreanTheorem.html&quot;&gt;http://mathworld.wolfram.com/PythagoreanTheorem.html&lt;/a&gt; on beautiful versus complicated proofs of Pythagoras.&lt;/p&gt;&#xA;" OwnerUserId="7220" LastEditorUserId="7220" LastEditDate="2014-02-12T10:30:11.670" LastActivityDate="2014-02-16T14:12:01.127" Title="Is it possible to understand financial theory without mathematics?" Tags="&lt;mathematics&gt;&lt;theory&gt;&lt;no-arbitrage-theory&gt;&lt;proof&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10215" PostTypeId="2" ParentId="10214" CreationDate="2014-02-12T12:24:40.853" Score="4" Body="&lt;p&gt;For the binary tree model the full replication property of all possible options can be shown using basic algebra and the no-arbitrage argument. It's beautiful how simple it is actually.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find the complete derivation in Shreve's Stochastic Calculus for Finance I: The Binomial Asset Pricing Model.&lt;/p&gt;&#xA;" OwnerDisplayName="user1157" LastActivityDate="2014-02-12T12:24:40.853" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10218" PostTypeId="2" ParentId="10214" CreationDate="2014-02-12T17:47:42.163" Score="3" Body="&lt;p&gt;A very good book covering such fundamentals with no or only a minimal amount of maths — highly recommended!&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://books.google.de/books?id=iqMdG4TTWNYC&amp;amp;lpg=PP1&amp;amp;ots=FCP8K8OXTv&amp;amp;dq=puzzles%20of%20finance&amp;amp;hl=en&amp;amp;pg=PP1#v=onepage&amp;amp;q&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;Puzzles of Finance: Six Practical Problems and Their Remarkable Solutions&lt;/a&gt; by Mark P. Kritzman&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The topics that are covered here are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Siegel's Paradox&lt;/li&gt;&#xA;&lt;li&gt;Likelihood of Loss&lt;/li&gt;&#xA;&lt;li&gt;Time Diversification&lt;/li&gt;&#xA;&lt;li&gt;Why the Expected Return Is Not To Be Expected&lt;/li&gt;&#xA;&lt;li&gt;Half Stocks All the Time or All Stocks Half the Time?&lt;/li&gt;&#xA;&lt;li&gt;The Irrelevance of Expected Return on Option Valuation&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Another well received title, perhaps even more fitting here, is the following:&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://books.google.de/books?id=5Dx-dGmls00C&amp;amp;lpg=PP1&amp;amp;dq=Essays%20in%20Derivatives&amp;amp;hl=de&amp;amp;pg=PP1#v=onepage&amp;amp;q&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;Essays in Derivatives by Don Chance&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;From the preface:&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;My primary objective in a book like this is to create something about&#xA;  derivatives that is easy to read. Derivatives can be a painful subject&#xA;  to learn, and many legal pads are used up, sometimes frustratingly, in&#xA;  working through some of the principles covered in technical&#xA;  derivatives books. This book is different. While I do not advise that&#xA;  you curl up with it by a warm ﬁre, a loyal dog, and a loved one, I do&#xA;  think you can relax in an easy chair and read it without pen and paper&#xA;  at your side. To that extent, this book is unique. Rarely will you ﬁnd&#xA;  a derivatives book without equations.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2014-02-16T14:12:01.127" LastActivityDate="2014-02-16T14:12:01.127" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10220" PostTypeId="2" ParentId="9621" CreationDate="2014-02-12T18:59:52.400" Score="2" Body="&lt;p&gt;The foreign exchang comitee publishes a report for North America, the &lt;a href=&quot;http://www.newyorkfed.org/fxc/volumesurvey/&quot; rel=&quot;nofollow&quot;&gt;FX Volume Survey&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the website:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The Foreign Exchange Committee launched its inaugural Survey of North&#xA;  American Foreign Exchange Volume in October 2004 in order to provide&#xA;  the market with frequent information on the size and structure of&#xA;  foreign exchange activity in North America.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The survey contains information on&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Spot Transactions&lt;/li&gt;&#xA;&lt;li&gt;Forward Transactions &lt;/li&gt;&#xA;&lt;li&gt;Foreign Exchange Swaps Transactions &lt;/li&gt;&#xA;&lt;li&gt;Over the Counter Options &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerDisplayName="user1157" LastEditorDisplayName="user1157" LastEditDate="2014-02-13T14:16:03.110" LastActivityDate="2014-02-13T14:16:03.110" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10222" PostTypeId="1" AcceptedAnswerId="10223" CreationDate="2014-02-12T20:16:17.070" Score="1" ViewCount="155" Body="&lt;p&gt;For example I am put a limit order of size 10 at top bid.&#xA;moments later, my algorithm detects we should have size of 50 here. So we request a update on this order.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, will we lose the current queue position due to this update?&lt;/p&gt;&#xA;" OwnerUserId="7226" LastActivityDate="2014-02-13T15:35:23.397" Title="Change of order size" Tags="&lt;market-microstructure&gt;&lt;limit-order-book&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10223" PostTypeId="2" ParentId="10222" CreationDate="2014-02-12T21:43:12.923" Score="4" Body="&lt;p&gt;Yes. Increasing the size of an order is like cancelling and reinserting it. You lose queue priority and insert behind the other orders.&lt;/p&gt;&#xA;" OwnerUserId="2284" LastActivityDate="2014-02-12T21:43:12.923" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10229" PostTypeId="1" AcceptedAnswerId="10296" CreationDate="2014-02-13T13:32:43.493" Score="5" ViewCount="1536" Body="&lt;p&gt;I would like to calibrate Hull-White model using volatility data.I am using &lt;a href=&quot;http://www.cmpr.co.kr/asset/research_material/implementing_interest_rate_models.pdf&quot; rel=&quot;noreferrer&quot;&gt;[Park (2004)]&lt;/a&gt; paper as a reference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;He suggests to minimize the following objective function:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/UsH1p.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the first term is theoretical (H-W) conditional volatility [st. dev.] of changes of the spot rates and the second term is defined as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Wcir0.png&quot; alt=&quot;enter image description here&quot;&gt; which is sample variance of observed market data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question is:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;why do we subtract variance from volatility[standard deviation] in the objective function? (i.e. not variance - variance).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;NOTE: Initially, I thought this was a mistake, but the same expression is used for the two factor model as well (formula (158) in the paper). In addition, I tried to calibrate the model using both (standard deviation - variance) and (standard deviation - standard-deviation) approaches. It seems like the results from (standard deviation-variance) case, as in Park(2004), make more sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank You&lt;/p&gt;&#xA;" OwnerUserId="7229" LastActivityDate="2014-02-18T10:15:55.750" Title="Calibrating Hull-White using volatility data" Tags="&lt;volatility&gt;&lt;variance&gt;&lt;calibration&gt;&lt;hullwhite&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10231" PostTypeId="1" CreationDate="2014-02-13T13:51:34.290" Score="2" ViewCount="1218" Body="&lt;p&gt;Is it wrong to use 'real world' probabilities for option valuation, even when the market is not liquid enough to delta hedge the option? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My instinct is that it is wrong, because the time value of the option is determined by the cost of delta hedging. But if I am selling the option without hedging, then I do not have that cost.  Indeed, we can imagine my company is split into two separate desks: Desk A which completely delta hedges with desk B, at an agreed reference rate, and Desk B, which trades the delta hedge only, with A.  When the option expires, the profit/loss of desk A should reflect the tracking error of the hedging, caused by the difference between realised and implied volatility. But since A is directly trading with B, and since the positions are equal and opposite, whatever A loses, B will make, and conversely.  So volatility is irrelevant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed there seems to be a bit of a paradox here. Suppose desk A significantly underestimates volatility, e.g. suppose it prices the option using 1% vol instead of 20%.  Then A will lose massively in tracking error. But desk B will make it all back!  So, oddly I as the owner of both desks am indifferent to the premium that A charges for the option. And so it makes no sense to value my unhedged option position. I can charge the counterparty a fee, and that can be whatever they are willing to pay.  But from my point of view it makes no sense to use option pricing methodology. My concern about real-world probabilities are relevant only to risk management, i.e. reserving an appropriate amount of capital in the event that the market collapses and I am left with a large trading loss. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="7220" LastActivityDate="2014-02-14T09:57:56.457" Title="Is it wrong to use 'real world' probabilities for option valuation?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;risk-management&gt;&lt;delta-hedging&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10234" PostTypeId="2" ParentId="10231" CreationDate="2014-02-13T14:21:09.073" Score="2" Body="&lt;p&gt;I think the main point of your question lies in the assumption that you cannot (delta) hedge your option. When you cannot hedge the argument for risk-neutrality breaks down and you have to use real world probabilities.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2014-02-13T14:21:09.073" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10239" PostTypeId="2" ParentId="8271" CreationDate="2014-02-13T16:49:59.720" Score="3" Body="&lt;p&gt;The approach of reflecting is expensive, since the $d$-simplex has $d$ maximal faces, all of which have to be checked for intersection at each step. Additionally, if the random walk moves into a corner, the number of moves which have to be discarded can become very high. Depending on the configuration of the constraints this could well be your best solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I understood your question correctly, the question boils down to sampling from the intersection of the boundary of one simplex ($E$) and the volume of another ($A$) simultaneously.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suggestions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Rejection&lt;/strong&gt;: if the admissible regions for the two conditions are not too different, it could be efficient to create points inside $A$, test for inclusion in $E$ and reject the point if not.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Restart&lt;/strong&gt;: if the random walk creates too many discarded moves, start from a new location using the rejection method above.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Projection&lt;/strong&gt;: Create an interior point for $E$ and check if the closest point on $A$ is still inside $E$.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Adaptive step-size:&lt;/strong&gt; You can calculate the distance from the boundary of $A$ and $E$ and choose half the step size, of course this will add a bias to the generation proces, this could be a problem.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Algorithm for one simplex:&lt;/strong&gt; There is a nice trick for the unit simplex by Donald Rubin, which is discussed on the &lt;a href=&quot;https://cs.stackexchange.com/questions/3227/uniform-sampling-from-a-simplex&quot;&gt;computer science&lt;/a&gt; site, to sample from the unit simplex. The result can be scaled afterwards to match a general simplex:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Create $n-1$ uniformly distributed random values between 0 and 1 and sort them.&lt;br/&gt; [Example: 0.1, 0.3, 0.5, 0.55]&lt;/li&gt;&#xA;&lt;li&gt;Add 0 and 1 to the list.&lt;br/&gt;&#xA;[Example: 0, 0.1, 0.3, 0.5, 0.55, 1]&lt;/li&gt;&#xA;&lt;li&gt;Use the differences between the values, they will sum to 1.&lt;br/&gt;&#xA;[Example: 0.1, 0.2, 0.2, 0.05, 0.45]&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit&lt;/em&gt;: Strictly speaking it is not a hard problem, since it can be solved in polynomial time; it would be though if you were &lt;a href=&quot;http://en.wikipedia.org/wiki/Integer_programming&quot; rel=&quot;nofollow noreferrer&quot;&gt;looking for integer weights&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user1157" LastEditorUserId="-1" LastEditorDisplayName="user1157" LastEditDate="2017-04-13T12:48:38.567" LastActivityDate="2014-02-13T17:09:21.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10241" PostTypeId="2" ParentId="181" CreationDate="2014-02-13T19:48:26.607" Score="1" Body="&lt;p&gt;If we take &lt;a href=&quot;http://plato.stanford.edu/entries/determinism-causal/&quot; rel=&quot;nofollow&quot;&gt;causal determinism&lt;/a&gt; as a given, the behaviour of markets is in the end &lt;em&gt;just physics&lt;/em&gt;. In principle you could simulate everything, including uncertainties due to the uncertainty-princple and obtain true expected values. This means that &lt;strong&gt;there is a perfect model for the markets&lt;/strong&gt;. Any other model, if it agrees on the market values of interest for all given inputs, can be validated against this perfect model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gödel's incompletenes theorem states that given a set of axioms there will always be statements about the natural numbers which cannot be shown to be true or false. This is independent of available computing power.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To compare: given sufficient computing power it is possible to check a given market model, in contrast there are axiomatic systems where it is not possible to check a given statement for correctnes. That is the reason why I wouldn't expect intuitively an anlogon to Gödel's theorem for the markets.&lt;/p&gt;&#xA;" OwnerDisplayName="user1157" LastActivityDate="2014-02-13T19:48:26.607" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10242" PostTypeId="2" ParentId="176" CreationDate="2014-02-13T20:48:54.937" Score="7" Body="&lt;p&gt;The most important questions in my opinion (besides all the mathematical questions and robustness tests that have to be performed anyway) are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Why is this model working in the first place?&lt;/li&gt;&#xA;&lt;li&gt;What is the economic rationale behind it?&lt;/li&gt;&#xA;&lt;li&gt;Why have the returns not been arbitraged away?&lt;/li&gt;&#xA;&lt;li&gt;Who is paying for your returns and why?&lt;/li&gt;&#xA;&lt;li&gt;Is this situation likely to be sustainable?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;When you cannot satisfactorily answers these questions chances are that your results are too good to be true. &lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2014-02-13T20:48:54.937" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10243" PostTypeId="1" CreationDate="2014-02-13T22:06:32.767" Score="1" ViewCount="67" Body="&lt;p&gt;If a stock is having ask = 100$ for 100 shares Ask size, and I put a buy market order for 1000 shares, is there an approach to estimate that this buy order will move up the stock price by what %?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for a general approach as I understand that the question may not have a definite answer. Let us assume no iceberg orders or dark pools.&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2014-02-13T22:06:32.767" Title="Estimate the effect of a buy order on stock price" Tags="&lt;order-execution&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10244" PostTypeId="2" ParentId="176" CreationDate="2014-02-14T01:44:32.243" Score="4" Body="&lt;p&gt;Not knowing what type of model you have, I am going to guess that these general steps will make the user of the model feel confident/comfortable about using your model.&#xA;In my opinion, you have shown that your model does reasonably well: &#xA;1). If you  input historical data and see if the output is reasonably close to what the real historical output was.&#xA;2). Not fall into the trap of over-fitting.&#xA;3). Not use obscure reasons for calibration i.e there should be at least some mathematical justification.&#xA;4). The simple test cases are the most overlooked, make sure they are passed successfully.&#xA;5). Try to break it and explain why it did.&lt;/p&gt;&#xA;" OwnerUserId="5821" LastActivityDate="2014-02-14T01:44:32.243" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10245" PostTypeId="2" ParentId="10231" CreationDate="2014-02-14T09:57:56.457" Score="4" Body="&lt;p&gt;I think you need to go even one step further than vonjd went in his reply. If liquid trading of the underlying is not possible, not only the arbitrage argument underlying risk neutral pricing breaks down. In that case there is simply no reason why the prices of those two assets (the option and its underlying) should be related in any way at all. So in my opinion the real question is not risk neutral versus real world probabilities but whether the option has a uniquely defined price at all. These markets are called &quot;incomplete&quot; and one workaround (at least in theory) is to work with multiple risk-neutral measures all compatible with the available market data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice all markets are incomplete and the solution is either to constantly recalibrate your model (i.e. to change the risk neutral measure all the time) and otherwise ignore the issue or to come up with non-probabilistic ways to arrive at prices. This process is actually the standard approach to pricing. It is called &quot;negotiating&quot; and you seem to allude to this in your second paragraph as well. Real world probabilities might enter negotiations among other things.&lt;/p&gt;&#xA;" OwnerUserId="482" LastActivityDate="2014-02-14T09:57:56.457" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10246" PostTypeId="1" AcceptedAnswerId="10248" CreationDate="2014-02-14T10:31:28.140" Score="4" ViewCount="680" Body="&lt;p&gt;The movement of the zero rate curves can be decomposed into a shift movement (the level of interest rates) and a twist movement (the slope of the curve) and butterfly (the curvature of the curve). If we want to stress the net interest income (NII) of a bank by shocking these three factors, how do we attribute the change in NII of each of these factors?&#xA;So far, I have identified following steps. Please correct me if I am going wrong or missing something somewhere:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Find the Shift, Twist and Butterfly (STB) - Which one is industry practice to arrive at the shift, twist and butterfly factors from the current term structure- PCA or factor model?&lt;/li&gt;&#xA;&lt;li&gt;Shock S,T,B - Apply the required shock to the Eigen vectors of the three factors&lt;/li&gt;&#xA;&lt;li&gt;Find the new yield curve - Add the new Eigen vectors weighted by their Eigen values to arrive at the new yield curve.&lt;/li&gt;&#xA;&lt;li&gt;Recalculate NII based on the new yield curve - The thing that is not clear to me is how do I attribute the change in NII to the shocks given to shift, twist and butterfly.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="7239" LastActivityDate="2014-02-14T14:06:25.573" Title="Attributing the change in NII to Shift, Twist and Butterfly" Tags="&lt;fixed-income&gt;&lt;yield-curve&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10247" PostTypeId="2" ParentId="9465" CreationDate="2014-02-14T13:55:43.080" Score="-1" Body="&lt;p&gt;For Windows desktop, best interactivity and performance can be achieved with &lt;a href=&quot;https://www.arction.com/lightningchart-trader-net/&quot; rel=&quot;nofollow noreferrer&quot;&gt;LightningChart .NET Trader&lt;/a&gt;.&#xA;It's DirectX accelerated to achieve maximum FPS and minimal lag. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See this short &lt;a href=&quot;https://www.youtube.com/watch?v=C3JPXwu-9m0&quot; rel=&quot;nofollow noreferrer&quot;&gt;LightningChart Trader video&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/NRPM3.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/NRPM3.jpg&quot; alt=&quot;Technical indicators in LightningChart Trader&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For JavaScript, web and mobile, you can consider using WebGL accelerated &lt;a href=&quot;https://www.arction.com/lightningchart-js/&quot; rel=&quot;nofollow noreferrer&quot;&gt;LightningChart JS&lt;/a&gt;. &#xA;See this &lt;a href=&quot;https://arction.github.io/lcjs-showcase-trading/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Github project&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/zeSY8.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/zeSY8.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm tech lead LightningChart.  &lt;/p&gt;&#xA;" OwnerUserId="6911" LastEditorUserId="6911" LastEditDate="2020-05-25T09:21:37.847" LastActivityDate="2020-05-25T09:21:37.847" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="10248" PostTypeId="2" ParentId="10246" CreationDate="2014-02-14T14:06:25.573" Score="3" Body="&lt;p&gt;Your steps 1. to 3. sound reasonable. I am not sure about industry practice (what industry?) I always do step 1. using PCA on historical correlations. If you plan to do a regulatory exercise better check with your regulator what he prefers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most interesting to me is step 4. which - I think - is in general impossible to do. This can be achieved only in very special cases. From what you describe, you model single discrete stress scenarios such as +/-100bps flat, which is good since it is a very special case. Assuming one stress each for S,T,B you have in total 7 = 2^3-1 different scenarios (3 single stresses of S,T,B , 3 where you have two stresses S&amp;amp;T, S&amp;amp;B and T&amp;amp;B and one where you stress S&amp;amp;T&amp;amp;B). If your portfolio reacts in a &quot;simple&quot; fashion (technically: The stresses do not interact) then Delta(S&amp;amp;T) = Delta(S) + Delta(T) and so on and you can decompose in the obvious way by reporting the marginal changes, i.e. the differences from each single stress. If your portfolio is more complicated, you are in big trouble and you should seriously consider whether such an attribution makes sense at all. If your stress factors are random variables you need to apply the thinking above in a regression context. &lt;/p&gt;&#xA;" OwnerUserId="482" LastActivityDate="2014-02-14T14:06:25.573" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10254" PostTypeId="1" CreationDate="2014-02-15T06:08:13.913" Score="-2" ViewCount="127" Body="&lt;p&gt;Suppose a consumer has log-utility over wealth, defined by $u(W) = \ln(W)$.&#xA;Suppose this consumer has $100$, and is considering taking a gamble in which&#xA;the consumer flips a coin, and gets $20$ she flips heads and $0$ if she flips tails.&#xA;What is the most amount of money the consumer would be willing to pay to&#xA;play take this gamble? What if the consumer has $1, 000$ dollars of wealth?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I feel like this question is incomplete since we do not know how much the person need to give in order to play the game. Do we know that information in order to solve this problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If no, could anyone tell me the direction and piece of information needed to solve for this question?&lt;/p&gt;&#xA;" OwnerUserId="7250" LastEditorUserId="848" LastEditDate="2014-02-15T12:00:53.470" LastActivityDate="2014-02-15T12:07:33.490" Title="What is the most amount of money the consumer would be willing to pay to play take this gamble?" Tags="&lt;risk&gt;&lt;interest-rates&gt;&lt;investing&gt;&lt;calculation&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10255" PostTypeId="2" ParentId="10175" CreationDate="2014-02-15T08:27:03.240" Score="0" Body="&lt;p&gt;To each closure on this: I attribute the difference to Idzorek to rounding errors. And on a side node, Idzorek sets the sample variance equal to the prior variance, an issue that kept myself busy until I found that detail confirmed by Walters paper.&lt;/p&gt;&#xA;" OwnerUserId="7186" LastActivityDate="2014-02-15T08:27:03.240" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10256" PostTypeId="2" ParentId="10254" CreationDate="2014-02-15T08:48:31.900" Score="-1" Body="&lt;p&gt;If there is not a  entry fee, I cannot lose money for at worst, I win 0USD.&lt;/p&gt;&#xA;" OwnerUserId="7252" LastActivityDate="2014-02-15T08:48:31.900" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10258" PostTypeId="2" ParentId="10254" CreationDate="2014-02-15T11:38:42.827" Score="1" Body="&lt;p&gt;This is a basic utility exercise. I would guess the additional assumption you are missing to solve the exercise is that the player would be willing to accept the fair game but nothing worse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make this a fair game, the maximal amount which could be paid to enter the game, would result in zero expected loss of utility (nobody would accept anything worse). In other words, the expected utility must match the utility of the starting wealth $W_0$:&#xA;$$ \mathrm{E}[\ln(W)]=\ln(W_0)$$&#xA;Since this game has only two outcomes you can easily compute the expectation from the tree of possible outcomes&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    / Head: 100 + 20 - entry fee&#xA;   / (50%)&#xA;  /&#xA;100&#xA;  \&#xA;   \ (50%)&#xA;    \ Tail: 100 + 0 - entry fee&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From this we can compute the expectation directly:&#xA;$$\mathrm{E}[\ln(W)] = 0.5\ln(120-x) + 0.5\ln(100-x)=\ln(100)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The result is approximately 9.5 (&lt;a href=&quot;http://www.wolframalpha.com/input/?i=0.5%E2%88%97ln%28120%E2%88%92x%29%2b0.5%E2%88%97ln%28100%E2%88%92x%29=ln%28100%29&quot; rel=&quot;nofollow&quot;&gt;you can check here&lt;/a&gt;), and if you repeat with a starting wealth of 1000, the result is approx. 9.9, since the richer person doesn't care as much about loosing a few bucks as the poorer guy does.&lt;/p&gt;&#xA;" OwnerDisplayName="user1157" LastEditorDisplayName="user1157" LastEditDate="2014-02-15T12:07:33.490" LastActivityDate="2014-02-15T12:07:33.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10259" PostTypeId="2" ParentId="10188" CreationDate="2014-02-15T12:04:52.260" Score="1" Body="&lt;p&gt;Black–Scholes usually assumes your time and volatility are annualised. Accordingly, when you calculate the volatility term you would usually annualise it to 252 or 260 (or however many trading days a year are applicable to your situation). Accordingly, the time remaining term of the Binary Option must also be expressed as a fraction of a year (again, 252, or 260, days or..). By way of example, if you have a 1 hour option just starting, this T term would be expressed as a year (1/no-hours-tradeable-year). As the option period passes, you would decrease the T term so it is always expressed as part of a year.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In summary, providing the way in which you scale volatility by time and the way you express your T term of the Black–Scholes are in the same, you'll be fine.&lt;/p&gt;&#xA;" OwnerUserId="5775" LastActivityDate="2014-02-15T12:04:52.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10261" PostTypeId="1" AcceptedAnswerId="10264" CreationDate="2014-02-15T13:25:11.997" Score="3" ViewCount="3404" Body="&lt;p&gt;I have a question I am not sure how to approach:&#xA;Suppose interest rates is 50%, a stock worth \$1 today can be worth \$2, \$1, \$0.5 next year. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the option that pays \$1 only when S = \$2 is traded in the market and is worth \$0.125, calculate the price and replicating portfolio of the option that pays \$0.5 when S = \$1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It has something to do with pay-off matrix but I don't know how to apply it?&lt;/p&gt;&#xA;" OwnerUserId="6919" LastEditorUserId="467" LastEditDate="2014-02-15T16:37:21.780" LastActivityDate="2014-02-16T13:38:58.160" Title="How to replicate this option?" Tags="&lt;options&gt;&lt;replication&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10262" PostTypeId="2" ParentId="27" CreationDate="2014-02-15T13:57:50.150" Score="1" Body="&lt;p&gt;you get a volatility skew by imposing a neumann-like barrier&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if market makers think a stock won't surpass a certain threshold, a skew is inevitable if one were to match the pricing under a barrier with the BS formula&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/User:Barrieroption/sandbox&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/User:Barrieroption/sandbox&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7136" LastActivityDate="2014-02-15T13:57:50.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10263" PostTypeId="1" AcceptedAnswerId="10292" CreationDate="2014-02-15T15:36:53.203" Score="0" ViewCount="138" Body="&lt;p&gt;There are N data sets in periods occurring weekly/monthly, across a 10-year historical  timeline.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In each period, five dates are observed (labelled a to e), where a denotes the day the period starts/an event occurs (T=0), while b to e denotes subsequent days following the event (T = 2 to 4).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;--&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An illustration is created to better understand how the components  are structured and fed into the formulae for statistical inference.&#xA;&lt;img src=&quot;https://i.stack.imgur.com/waVbl.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question: Is there a method to &lt;strong&gt;elicit principal components&lt;/strong&gt; from the N data sets, and also find correlation? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;P.S. This model intends to observe events/numbers (e.g. in the economic calendar) occurring weekly and monthly that affects changes in market prices.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="6603" LastEditorUserId="2299" LastEditDate="2014-02-18T08:22:57.927" LastActivityDate="2014-02-18T08:28:27.220" Title="Can we model components in a set of multivariate multi-period time-series data?" Tags="&lt;time-series&gt;&lt;correlation&gt;&lt;garch&gt;&lt;pca&gt;&lt;epps-effect&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10264" PostTypeId="2" ParentId="10261" CreationDate="2014-02-15T15:53:45.027" Score="5" Body="&lt;p&gt;If I understand well, you have a market with 3 states: up, flat or down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have 3 instruments:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The stock&lt;/li&gt;&#xA;&lt;li&gt;The risk-free rate (50%)&lt;/li&gt;&#xA;&lt;li&gt;The option&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If you can create a portfolio today with these 3 instruments that can replicate de payoff of the option you have to price, then the &lt;strong&gt;law of one price&lt;/strong&gt; tells you that the price of the option should be the price of this portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, you have to solve a system of 3 equations with 3 unknown:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume you will hold $a$ stock, $b$ risk-free bond, $c$ option, and using fraction notation for 0.5, 1.5, the system is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Up State&lt;/em&gt;: $a \cdot 2 + b \cdot \frac{3}{2} + c \cdot 1=0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Flat State&lt;/em&gt;: $a \cdot 1 + b \cdot \frac{3}{2} + c \cdot 0=\frac{1}{2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Down State&lt;/em&gt;: $a \cdot \frac{1}{2} + b \cdot \frac{3}{2} + c \cdot 0=0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the third equation, you get $a=-3b$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Substituting into the second, you get $-3b+\frac{3}{2}b = \frac{1}{2}$ which yield $b=-\frac{1}{3}$ and hence $a=-3 \cdot \left( - \frac{1}{3} \right)=1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, substituting in the first equation, you get $1 \cdot 2 + \left( - \frac{1}{3} \right) \cdot  \frac{3}{2} + 1 \cdot c =0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This yields $c= - \frac{3}{2}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the portfolio holding 1 stock, selling $\frac{1}{3}$ risk-free bond and selling $\frac{3}{2}$ options replicates perfectly the payoff of the option you have to price. The price of this option is hence $1 \cdot 1\$ - \frac{1}{3} \cdot 1\$ - \frac{3}{2} \cdot 0.125\$=0.48\$$&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2014-02-16T13:38:58.160" LastActivityDate="2014-02-16T13:38:58.160" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10265" PostTypeId="2" ParentId="176" CreationDate="2014-02-15T15:55:36.437" Score="2" Body="&lt;p&gt;What constitutes valid is often - a part from &lt;a href=&quot;http://en.wikipedia.org/wiki/Model_risk&quot; rel=&quot;nofollow&quot;&gt;model risk&lt;/a&gt; discussed above - an agreement between subject matter experts in a specific field or company. And hence, different fields require different standards.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used to work in social science, and top journals would find things perfectly valid if Crombach Alpha, Power, R-Square, F-score and factor significance on the regressions were within reasonable ranges.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Within risk management the bar is much higher, there is even a &lt;a href=&quot;http://www.risk.net/journal#Journal-of-Risk-Model-Validation&quot; rel=&quot;nofollow&quot;&gt;journal on risk model validation&lt;/a&gt;. And if you follow the &quot;Cutting Edge&quot; section in Risk you will find that academics even within one field may occasionally disagree on what is considered valid - re FVA.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To cite an other example, spatial econometrics faces &lt;a href=&quot;http://irx.sagepub.com/content/11/3/279.short&quot; rel=&quot;nofollow&quot;&gt;different criteria&lt;/a&gt; in model validation.&lt;/p&gt;&#xA;" OwnerUserId="7186" LastEditorUserId="7186" LastEditDate="2014-02-15T16:15:46.663" LastActivityDate="2014-02-15T16:15:46.663" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10267" PostTypeId="1" CreationDate="2014-02-15T21:24:46.557" Score="4" ViewCount="264" Body="&lt;p&gt;Assume $X_{t}$ is a Levy process with triplet $(\sigma^{2}, \lambda, \nu)$, here $\nu$ is the Levy measure of $X_{t}$. Define $\tau_{1},\tau_{2},\dots$ be the time gap between the successive jumps happen. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two questions for me. First, is $\tau_{i}$ well defined?. Second, the answer of first one is yes, we know $\tau_{i}$ are i.i.d. Then how to find the distribution of $\tau_{i}$? Can we prove the expectation of $\tau_{i}$ is finite or even its variance is finite according to the information of Levy measure $\nu$?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can do this when the Levy process $X_{t}$ is Poisson process or negative binomial process. I have difficulty when the probability density function of $\nu$ is continuous. For example, the case that $X_{t}$ is a Gamma process. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any references would be very appreciated.  &lt;/p&gt;&#xA;" OwnerUserId="6460" LastEditorUserId="3415" LastEditDate="2014-02-15T22:18:43.033" LastActivityDate="2014-02-15T22:18:43.033" Title="The distribution of jump gaps for Levy processes" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10268" PostTypeId="2" ParentId="10267" CreationDate="2014-02-15T22:06:31.720" Score="3" Body="&lt;p&gt;This is a good shorter reference: &lt;a href=&quot;http://www.impan.pl/CZM/tankov.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.impan.pl/CZM/tankov.pdf&lt;/a&gt;.  Cont and Tankov have also written a longer book about modelling with Levy processes that I think is really good.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's going to be a strong connection between the sequence of jump times and the Levy measure $\nu$.  In a single unit of time, $ \nu(dx)$ is a measure (not necessarily a probability) that records the expected number of jumps of size dx.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if $\nu$ is not a finite measure, then I don't think it makes sense to talk about the jump times.  They're basically happening all the time.  So, for example, if you tried to define $\tau_1 = \inf \{ t \geq 0 : \Delta t \neq 0 \}$, $\tau_1$ would be equal to zero.  This is why I say the notion isn't meaningful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, suppose that $\nu$ is a finite measure.  This is closer to the setting of a Poisson process, where $\nu$ is $\lambda$ times a point mass at 1, or for a compound Poisson process, $\lambda$ times the pdf of the jump size distribution.  So analogously, let $\lambda' = \nu(\mathbb{R})$.  This is the expected number of jumps per unit of time.  Then the jump times (ignoring size) will come like a Poisson process with intensity $\lambda'$, so the individual gaps have the corresponding exponential distribution.&lt;/p&gt;&#xA;" OwnerUserId="3415" LastActivityDate="2014-02-15T22:06:31.720" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10269" PostTypeId="2" ParentId="10189" CreationDate="2014-02-16T02:01:36.570" Score="3" Body="&lt;p&gt;It depends on what you want to optimize with transaction costs:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;liquidation&lt;/li&gt;&#xA;&lt;li&gt;hedging&lt;/li&gt;&#xA;&lt;li&gt;allocation&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The two best reference I have in mind are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Gökay, S., Roch, A., Soner, 2011. &lt;strong&gt;Liquidity models in continuous and discrete time&lt;/strong&gt;. In: Di Nunno, G., Øksendal, B. (Eds.), &lt;em&gt;Advanced Mathematical Methods for Finance&lt;/em&gt;. Springer Berlin Heidelberg, pp. 333-365. URL &lt;a href=&quot;http://dx.doi.org/10.1007/978-3-642-18412-3_13&quot; rel=&quot;nofollow&quot;&gt;http://dx.doi.org/10.1007/978-3-642-18412-3_13&lt;/a&gt; - is a review paper covering:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;optimal liquidation&lt;/li&gt;&#xA;&lt;li&gt;hedging&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;for portfolio allocation, you have a nice review paper here: Kolm, P., Dec. 2009. &lt;strong&gt;Stochastic optimal control and dynamic portfolio analysis&lt;/strong&gt;. In: &lt;em&gt;Workshop on High-Frequency Finance and quantitative strategies&lt;/em&gt;. Courant Institute, NYU. URL &lt;a href=&quot;http://www.slideshare.net/pkolm/60-years-of-portfolio-optimization-practical-challenges-and-current-trends&quot; rel=&quot;nofollow&quot;&gt;http://www.slideshare.net/pkolm/60-years-of-portfolio-optimization-practical-challenges-and-current-trends&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You will not find in the literature a paper covering exactly a specific problem.&#xA;Nevertheless my viewpoint is that the difficulties in your case (i.e. mixing combinatorial constraints, robust optimization and transaction costs) comes from the way to insert transaction costs in existing frameworks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As it is explained into the Soner et al. paper: there is one paper by Almgren dealing with &quot;&lt;em&gt;when should I end liquidation?&lt;/em&gt;&quot;. It is an important question since trading infinitesimally can be perceived as a solution to market impact minimization. With M Labadie, we extensively covered this aspect of discretizing a liquidation process in &quot;&lt;a href=&quot;http://arxiv.org/abs/1205.3482&quot; rel=&quot;nofollow&quot;&gt;Optimal starting times, stopping times and risk measures for algorithmic trading: Target Close and Implementation Shortfall&lt;/a&gt;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question &quot;&lt;em&gt;when should I end selecting lines for a portfolio?&lt;/em&gt;&quot; (i.e. not that far from asset count constraints) is in fact close to the previous one. &#xA;Not deep enough to justify an academic paper according to me, since once you choose:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;a utility function (i.e. a criterion), &lt;/li&gt;&#xA;&lt;li&gt;a market impact (i.e. transaction cost) model,&lt;/li&gt;&#xA;&lt;li&gt;the parameters or model features you want to be robust to&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;the result should come straightforward thanks to a combination of techniques described in the papers I cited.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2014-02-22T22:10:52.273" LastActivityDate="2014-02-22T22:10:52.273" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10270" PostTypeId="1" CreationDate="2014-02-16T05:20:43.067" Score="0" ViewCount="2402" Body="&lt;p&gt;I use &lt;code&gt;getSymbols&lt;/code&gt; to download historical information over an environment with 200 tickers but I cannot seem to keep the date information from becoming an index.  I tried to specify &lt;code&gt;return.class&lt;/code&gt; to &lt;code&gt;&quot;ts&quot;&lt;/code&gt; and &lt;code&gt;&quot;zoo&quot;&lt;/code&gt; also but no luck...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also used &lt;code&gt;get.hist.quote&lt;/code&gt; with similar success...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BUT the only thing that works is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;xom &amp;lt;- read.csv(&quot;http://ichart.yahoo.com/table.csv?s=xom&amp;amp;a=11&amp;amp;b=31&amp;amp;c=2012&quot;, stringsAsFactors=F)&#xA;&#xA;&#xA;# The first column contains dates.  The as.Date&#xA;# function can convert strings into Date objects.&#xA;#&#xA;    xom_dates &amp;lt;- as.Date(xom[,1])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is there ANY way to preferably use the getSymbols to format one column with the dates as as.Date as above??  Help &lt;/p&gt;&#xA;" OwnerUserId="6854" LastEditorUserId="7259" LastEditDate="2014-02-16T11:00:24.107" LastActivityDate="2014-02-16T11:00:24.107" Title="I want to keep a column in getSymbols or get.hist.quote with the Date as as.Date format" Tags="&lt;r&gt;&lt;quantmod&gt;" AnswerCount="1" CommentCount="2" ClosedDate="2014-02-22T03:50:46.913" ContentLicense="CC BY-SA 3.0" />
  <row Id="10271" PostTypeId="2" ParentId="10270" CreationDate="2014-02-16T10:48:53.597" Score="2" Body="&lt;p&gt;You cannot add a date column to an object returned by &lt;code&gt;getSymbols&lt;/code&gt; or &lt;code&gt;get.hist.quote&lt;/code&gt;. These function return matrices. Matrices can only store data of the same type, in this case the matrices contain &lt;code&gt;double&lt;/code&gt; values (real numbers).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can add a column of class &lt;code&gt;Date&lt;/code&gt; to the objects if you transform them into a data frame:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For &lt;code&gt;getSymbols&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quantmod)&#xA;getSymbols('IBM', from = &quot;2014-02-10&quot;)&#xA;&#xA;IBM&#xA;#            IBM.Open IBM.High IBM.Low IBM.Close IBM.Volume IBM.Adjusted&#xA;# 2014-02-10   176.97   177.65  176.25    177.14    3540400       177.14&#xA;# 2014-02-11   176.81   180.39  176.80    179.70    4647300       179.70&#xA;# 2014-02-12   179.52   181.25  179.26    180.24    3983000       180.24&#xA;# 2014-02-13   178.22   182.36  177.86    181.84    4482000       181.84&#xA;# 2014-02-14   181.26   184.43  180.99    183.69    4659900       183.69&#xA;&#xA;dat1 &amp;lt;- as.data.frame(IBM)&#xA;dat1$date &amp;lt;- time(IBM)&#xA;&#xA;dat1&#xA;#            IBM.Open IBM.High IBM.Low IBM.Close IBM.Volume       date&#xA;# 2014-02-10   176.97   177.65  176.25    177.14    3540400 2014-02-10&#xA;# 2014-02-11   176.81   180.39  176.80    179.70    4647300 2014-02-11&#xA;# 2014-02-12   179.52   181.25  179.26    180.24    3983000 2014-02-12&#xA;# 2014-02-13   178.22   182.36  177.86    181.84    4482000 2014-02-13&#xA;# 2014-02-14   181.26   184.43  180.99    183.69    4659900 2014-02-14&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The approach is similar for &lt;code&gt;get.hist.quote&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(tseries) &#xA;res &amp;lt;- get.hist.quote(instrument = &quot;ibm&quot;,  start = &quot;2014-02-10&quot;)&#xA;&#xA;res&#xA;#              Open   High    Low  Close&#xA;# 2014-02-10 176.97 177.65 176.25 177.14&#xA;# 2014-02-11 176.81 180.39 176.80 179.70&#xA;# 2014-02-12 179.52 181.25 179.26 180.24&#xA;# 2014-02-13 178.22 182.36 177.86 181.84&#xA;# 2014-02-14 181.26 184.43 180.99 183.69&#xA;&#xA;dat2 &amp;lt;- as.data.frame(res)&#xA;dat2$date &amp;lt;- time(res)&#xA;&#xA;dat2&#xA;#              Open   High    Low  Close       date&#xA;# 2014-02-10 176.97 177.65 176.25 177.14 2014-02-10&#xA;# 2014-02-11 176.81 180.39 176.80 179.70 2014-02-11&#xA;# 2014-02-12 179.52 181.25 179.26 180.24 2014-02-12&#xA;# 2014-02-13 178.22 182.36 177.86 181.84 2014-02-13&#xA;# 2014-02-14 181.26 184.43 180.99 183.69 2014-02-14&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7259" LastActivityDate="2014-02-16T10:48:53.597" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10274" PostTypeId="1" AcceptedAnswerId="10284" CreationDate="2014-02-16T23:15:16.837" Score="1" ViewCount="1693" Body="&lt;p&gt;I'm trying to bootstrap spot rates given coupon-paying bond data. To simplify my problem, assume we are working with only 3 given data, the price/coupon rate on semi-annual bonds maturing in 0.5, 1, and 2 years. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can infer the 0.5 and 1 year spot rates from the given data. How do I infer the 1.5 and 2 year spot rates? If it simplifies the problem, assume that the spot rate changes linearly from 1 to 2 years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an analytic solution to find the 1.5 and 2 year spot rates? Do I need some iterative process?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any leads on this problem would help. Thanks!&lt;/p&gt;&#xA;" OwnerUserId="5407" LastActivityDate="2014-02-17T14:03:56.130" Title="Interpolating spot rates given intermittent coupon-bond prices." Tags="&lt;fixed-income&gt;&lt;yield-curve&gt;&lt;bond&gt;&lt;interpolation&gt;&lt;spot-rate&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10279" PostTypeId="1" CreationDate="2014-02-17T05:51:56.087" Score="3" ViewCount="650" Body="&lt;p&gt;I've noticed that for a given strike price, the shorter expiration dates of options have more pronounced volatilities&lt;/p&gt;&#xA;&#xA;&lt;p&gt;why is that?&lt;/p&gt;&#xA;" OwnerUserId="7265" LastActivityDate="2014-04-18T19:26:17.367" Title="Why are short expiries associated with more pronounced volatility skews?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;trading&gt;&lt;skew&gt;" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10281" PostTypeId="2" ParentId="10279" CreationDate="2014-02-17T08:54:02.627" Score="0" Body="&lt;p&gt;What you suggest is mainly true in times of stress. The shorter maturity deals are priced with larger implied volatility to incorporate the short term volatility in the market. &lt;/p&gt;&#xA;" OwnerUserId="1215" LastActivityDate="2014-02-17T08:54:02.627" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10282" PostTypeId="1" CreationDate="2014-02-17T11:26:35.873" Score="3" ViewCount="244" Body="&lt;p&gt;Assume the stock follows a process, which is defined by the following stochastic differential equation&#xA;$$\frac{dS}{S}=r(t)dt+\sigma(S,t)dW,$$&#xA;so that the stock price process has local volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;European options&lt;/strong&gt;: based on the prices for European options for all strikes and maturities, I can compute a probability density distribution at all times conditional on the current spot price. The idea is that I can differentiate the differentiate the price of the option  $C(S,K) = \int_{0}^{\infty} max(S-K,0)\phi(S)ds$ two times, to get a formula for  the transition probability density function:&#xA;$$\frac{\partial^2C}{\partial K^2}(K,T)=-\phi(S)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Asian options&lt;/strong&gt;:&#xA;In this setting, is there additional information about the process, which I can extract from the prices of path-dependent options?&lt;/p&gt;&#xA;" OwnerDisplayName="user1157" LastEditorDisplayName="user1157" LastEditDate="2014-02-18T10:42:54.140" LastActivityDate="2014-02-24T20:10:53.253" Title="What information about the stochastic process is available from path-dependent options?" Tags="&lt;option-pricing&gt;&lt;sde&gt;&lt;local-volatility&gt;&lt;asian-option&gt;" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10284" PostTypeId="2" ParentId="10274" CreationDate="2014-02-17T14:03:56.130" Score="1" Body="&lt;p&gt;Assume we have $r(t)$ continuously compounded spot rate for maturity $t$. The price of the 2-year bond with semi-annual coupon $C$ is known to be $P$. We already have $r(0.5)$ and $r(1)$. We need $r(2)$ and $r(1.5) = f(r(1), r(2))$. Then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;P = C [e^{-0.5 \times r(0.5)} + e^{-r(1)}+e^{-1.5 \times r(1.5)}] + (1+C)e^{-2 \times r(2)}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using linear interpolation, $r(1.5) = 0.5 [r(2) + r(1)]$. Substituting in, we get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;P = C [e^{-0.5 \times r(0.5)} + e^{-r(1)}+e^{-1.5 \times 0.5 [r(2) + r(1)]}] + (1+C)e^{-2 \times r(2)}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best way to solve for $r(2)$ is with some optimisation technique. If you want to use an iterative approach, a simple Newton-Rhapson will be good enough.&lt;/p&gt;&#xA;" OwnerUserId="7166" LastActivityDate="2014-02-17T14:03:56.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10285" PostTypeId="1" AcceptedAnswerId="10304" CreationDate="2014-02-17T17:33:11.290" Score="7" ViewCount="1328" Body="&lt;p&gt;I would like to model Korean government bond futures.&#xA;So far I know two concepts (just a short, incomplete description)&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;cash-settled futures (e.g. Australia): The average yield of a basket of bonds is calculated and thereby a notional bond price. Quotation in $100-yield$.&lt;/li&gt;&#xA;&lt;li&gt;bond futures with physical delivery (e.g. Germany, US): Conversion factors for all bonds in a basket can be calculated which leads (with some more inputs) to a cheapest-to-deliver and the futures price corresponds more or less to the forward price of the cheapest-to-deliver (taking into account the conversion factor).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If I read &lt;a href=&quot;http://inc.krx.co.kr/attach/eng/sta/10-year_Korean_Treasury_Bond_%28LKTB%29_Futures.pdf&quot; rel=&quot;nofollow&quot;&gt;this document&lt;/a&gt;, taken from page of &quot;Korea exchange&quot;, correctly then the Korean 3yr and 5yr futures belong to class (1) and the 10 yr belongs to class (2). &#xA;But when I go to Bloomberg it seems that all three futures contracts are of class (1) - yield based, cash settled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any experts around for these markets? Is it true that all 3 futures contracts work the same way, namely yield based and cash settled? &lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2014-02-18T09:23:48.387" LastActivityDate="2014-02-19T13:03:52.067" Title="Korean Bond futures market: is there a fundamental difference between 3yrs, 5yrs and 10yrs contracts?" Tags="&lt;futures&gt;&lt;bond-futures&gt;&lt;yield-futures&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10289" PostTypeId="1" AcceptedAnswerId="10295" CreationDate="2014-02-18T00:20:27.243" Score="1" ViewCount="878" Body="&lt;p&gt;the expected value of the option given the next period up, down values is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ Pexp = (p Price_{next, up} + (1 - p) Price_{next, down})/R$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where p is defined as $p = \frac{\exp(-r \times \Delta t) - d}{u - d}$ w/o a dividend yield and $p = \frac{\exp(-(r - q) \times \Delta t) - d}{u-d}$ with a dividend yield&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I know from &lt;a href=&quot;http://en.wikipedia.org/wiki/Binomial_options_pricing_model&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; that R is something like $\exp(-r \times \Delta t)$ however with a continuous dividend yield of q would it be $\exp(-(r-q) \times \Delta t)$ changing in a similar way that p changes?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Binomial_options_pricing_model&quot; rel=&quot;nofollow&quot;&gt;Wikipedia&lt;/a&gt; says that it souldn't be, but trying both ways the second one gives the same result as the example &lt;a href=&quot;http://www1.american.edu/academic.depts/ksb/finance_realestate/mrobe/685/6pp/Lect_12&amp;amp;13p6.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;, slide 22, so I think that R should change in a similar way that p changes and effectively the new risk free rate is adjusted by q.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks&lt;/p&gt;&#xA;" OwnerUserId="6583" LastActivityDate="2014-02-19T07:26:40.950" Title="binary tree options pricing model with dividend value - How should I discount the option at?" Tags="&lt;options&gt;&lt;option-pricing&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10291" PostTypeId="1" AcceptedAnswerId="10357" CreationDate="2014-02-18T08:04:26.203" Score="5" ViewCount="357" Body="&lt;p&gt;Let us assume one is interested in pricing an option with a very long maturity (up to 20 or 30 years) on a liquid underlying. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The market won't have liquid quotes for the higher maturities. Still you would like to incorporate some assumptions on the long-term vol in the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the best approaches here ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Some generic ideas/thoughts&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Calibrate to the liquid vol surface and neglect the lack of&#xA;information for long maturities &lt;/li&gt;&#xA;&lt;li&gt;Use the illiquid quotes but with some&#xA;adjustments (perhaps addying some margin) &lt;/li&gt;&#xA;&lt;li&gt;Incorporate historical data&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-02-24T19:57:26.630" Title="Model calibration to illiquid assets when pricing options with long maturities" Tags="&lt;volatility&gt;&lt;option-pricing&gt;&lt;calibration&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10292" PostTypeId="2" ParentId="10263" CreationDate="2014-02-18T08:20:43.133" Score="0" Body="&lt;p&gt;Your question is more about &quot;&lt;em&gt;how to estimate correlations between variables sampled at different frequencies?&lt;/em&gt;&quot; than about PCA. After all, PCA is just diagonalization of the covariance (or correlation) matrix, aiming to obtain &lt;em&gt;principal vectors&lt;/em&gt; driving the joint dynamics of your variables in an $L^2$ sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since data are by construction not synchronized at the high frequency rate (i.e. you never have simultaneous trades or quote updates on two different instruments), this issue is celebrated as the &lt;strong&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Epps_effect&quot; rel=&quot;nofollow noreferrer&quot;&gt;Epps effect&lt;/a&gt;&lt;/strong&gt; in intra-day finance (one day I will create a &quot;&lt;a href=&quot;https://quant.stackexchange.com/tags/epps-effect/info&quot;&gt;tag wiki page&lt;/a&gt;&quot; to describe it in detail). But it apply to any other covariance computations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &quot;simplest&quot; way to counter the Epps effect has been proposed by Ayashi and Yoshida in &quot;&lt;a href=&quot;http://www.citeulike.org/user/lehalle/article/2904415&quot; rel=&quot;nofollow noreferrer&quot;&gt;On Covariance Estimation of Non-synchronously Observed Diffusion Processes&lt;/a&gt;&quot;. Thus you should have a look at this paper. They propose adjustments to the following simple principle: &quot;&lt;strong&gt;do computations on overlapping periods only&lt;/strong&gt;&quot;. Of course it introduces bias, and they explain how to compensate them.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2014-02-18T08:28:27.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10293" PostTypeId="5" CreationDate="2014-02-18T08:26:43.553" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-02-18T08:26:43.553" LastActivityDate="2014-02-18T08:26:43.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10294" PostTypeId="4" CreationDate="2014-02-18T08:26:43.553" Score="0" Body="The Epps effect is the stylized fact that the more accurate you are on two time series (i.e. the more you sample them), the lower the correlations according to the usual formula.&#xD;&#xA;It applies to any time series that do not exist at the same sampling rate: if you oversample one of them you create false information, if you undersample the other you throw away potentially meaningful information." OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2014-02-18T08:54:59.817" LastActivityDate="2014-02-18T08:54:59.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10295" PostTypeId="2" ParentId="10289" CreationDate="2014-02-18T08:43:32.330" Score="1" Body="&lt;p&gt;&lt;strong&gt;No the discounting factor that you use for backward induction won't change.&lt;/strong&gt; (confer &lt;a href=&quot;http://homepage.ntu.edu.tw/~jryanwang/course/Financial%20Computation%20or%20Financial%20Engineering%20%28graduate%20level%29/FE_Ch04%20Binomial%20Tree%20Model.pdf&quot; rel=&quot;nofollow&quot;&gt;here Chapter IV&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is only seems confusiong due to the mathematical formulation. &#xA;Introducing continuous dividends basically adjusts your stock price (down) by discoutning the divididend (for it is paid out and thus dicreases the stock value). Your &quot;risk-free&quot; stock value at $t$ becomes $S_0 e^{r\Delta t}e^{-q \Delta t}$ instead of $S_0 e^{r\Delta t}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This leads to the following equation&#xA;$$ S_0 e^{r\Delta t}e^{-q \Delta t}=pS_0u+(1-p)S_0d$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solving for $p$ gives your the desired result&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note that there are several approaches to modelling dividends in a binomial model setting.  &lt;a href=&quot;http://homepage.ntu.edu.tw/~jryanwang/course/Financial%20Computation%20or%20Financial%20Engineering%20%28graduate%20level%29/FE_Ch04%20Binomial%20Tree%20Model.pdf&quot; rel=&quot;nofollow&quot;&gt;Same document as above (Chapter IV)&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="7279" LastEditDate="2014-02-19T07:26:40.950" LastActivityDate="2014-02-19T07:26:40.950" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10296" PostTypeId="2" ParentId="10229" CreationDate="2014-02-18T10:15:55.750" Score="2" Body="&lt;p&gt;I took a look at the paper and would contend that it is a typo. I would assume he just copy-pasted the equation - for it is exactly the same for the two factor model cf. eq (157) and eq (41)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you follow his reasoning and his notation it would make no sense to use the observed sample variance. He always denotes the variace by $\sigma^2$ and the standard-deviation by $\sigma$ or $\sigma(t)$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, it would make no sense to compare standard deviation to variance - your objective function would be not very sensitive to changes in the observed variances. For variances being the squared number of a $\sigma &amp;lt;1$ will always be much smaller. Also you objective function would not evaluate the case $\sigma = \sigma^{obs}$ properly, with $\sigma &amp;gt; (\sigma^{obs})^2$. &lt;/p&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-02-18T10:15:55.750" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10297" PostTypeId="2" ParentId="10282" CreationDate="2014-02-18T13:11:16.190" Score="0" Body="&lt;p&gt;The Price of an American option &lt;strong&gt;may contain&lt;/strong&gt; information on the expected behaviour of it's holder. When might he/she exercise the option ? Contrary to European options that don't. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus when you are primarily interested in &quot;reconstructing&quot; the transition density - I would stick with the European-Option-Prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If however you were to price path dependant options it would be wise to calibrate you model to these. &lt;/p&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-02-18T13:11:16.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10298" PostTypeId="2" ParentId="9677" CreationDate="2014-02-18T13:13:39.740" Score="3" Body="&lt;p&gt;There are quite a few methods to calculate default probabilities from CDS data. Simply you start at the shortest tenor, assume constant hazard rate. Then for the next tenor, you assume the previous hazard rate is still valid till the previous tenor, and the hazard rate between the previous tenor and new tenor is calibrated so that CDS PV matches the market price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Macro Surface method is explained in the document. Actually we use this proxy method but never seen it named as this. Simply you map your illiquid CDS to liquid index CDS that have similar rating, industry, country. In the mapping you can assign some scaling, that is calibrated historically to from the liquid single names to liquid indices. The issue usually is to figure out the liquid single name CDSs. You might need some trader input.&lt;/p&gt;&#xA;" OwnerUserId="1215" LastActivityDate="2014-02-18T13:13:39.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10300" PostTypeId="1" CreationDate="2014-02-19T08:25:01.377" Score="23" ViewCount="3218" Body="&lt;p&gt;Given the multitude of existing interest rate models (ranging from simple to very complex) it would be interesting to know when the additional complexity actually makes sense. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The models I have in mind: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Simple one factor (e.g. HW)&lt;/li&gt;&#xA;&lt;li&gt;Two factor models&lt;/li&gt;&#xA;&lt;li&gt;Two or one factor models with stochastic volatility&lt;/li&gt;&#xA;&lt;li&gt;LIBOR-Market, HJM, SABR and SABR-LMM model&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Are there any rules of thumb to decide which model to use for which product?&lt;/strong&gt;&#xA;(Perhaps there is some book dealing with that topic that I am not aware of)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 22.02.2014:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While trying to answer the question myself I found the &lt;a href=&quot;http://www.actuaries.org/AFIR/Colloquia/Nuernberg/Buehler_Uhrig_Walter_Weber.pdf&quot; rel=&quot;noreferrer&quot;&gt;follwing very interesting paper&lt;/a&gt; on the emperical comparison of interest rate models. Here the authors mainly compare how well the different models can fit market data and hit the relevant market pries after being calibrated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Thus a follow up Question:&lt;/strong&gt; (that is also related to the &lt;a href=&quot;https://quant.stackexchange.com/questions/176/model-validation-criteria&quot;&gt;question on model validation&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Does it suffice to hit the market pries spot on after calibration for a model to &#xA;qualify for being used in pricing for an instrument ? Or are there other aspects to be&#xA;considered? (computational speed, statistical fittness, robustness of the hedges) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Let's assume my model fits the market data really well - backtesting however shows that the hedges it provides don't work that well. Also the model might not be able to statistially fit the path of the underlying. E.g. mean reversion can be observed in some markets but not in others. One could argue that risk neutrality does not necessarily entail meaningful real-world scenarios etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;I have good theoretical grasp of the models but have mainly used them for risk management (thus generating paths and analysing what happens to a portfolio or the balance sheet of an enterprise)&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-12-08T19:36:05.490" Title="Which interest rate model for which product" Tags="&lt;interest-rates&gt;&lt;pricing&gt;&lt;models&gt;" AnswerCount="2" CommentCount="8" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="10302" PostTypeId="1" CreationDate="2014-02-19T11:25:34.620" Score="1" ViewCount="756" Body="&lt;p&gt;I am looking to find/estimate the &quot;greeks&quot;/option price sensitivities/derivatives for a basket option situation. In specific the change in price of a put option associated with a change in weight of a given asset in a portfolio. I think a finite difference method (FDM) with MCMC simulations would work for a two asset situation but wasn't sure how to carry it out for more than two assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say you have three assets/stocks (with no dividends): A,B,C in a basket with their respective estimated mean returns, estimated standard deviations, and estimated correlations/covariance matrix. Instead of three strikes for each asset, you have a single portfolio strike that is 10% below the 'current' portfolio. The 'current' portfolio weights are presented/given by the 'client'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can relatively simply MCMC simulate the three stocks, and assign the given weights from initiation to calculate portfolio terminal value (assuming no rebalancing), and estimate various 'standard' greeks. And for a two asset portfolio, the &lt;code&gt;weight of asset 2&lt;/code&gt; is just &lt;code&gt;1 - weight of asset 1&lt;/code&gt;, so in terms of finding the change in option price due to a change in weight of each asset, which is what originally looked like a two variable problem, (i.e. to find the change in option price by changing the weight of asset 1 and asset 2), becomes a one variable problem, as any change in the weight of asset 1 will implicitly change the weight of asset 2, making simulation and calculation of the sensitivities easier. But this simplification/dimension reduction does not exist for a three or more asset situation, so I was wondering how would one do it for a three or more asset situation?&lt;/p&gt;&#xA;" OwnerUserId="7289" LastActivityDate="2014-02-20T11:52:01.637" Title="Basket Option weight sensitivity calculation" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;greeks&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10303" PostTypeId="2" ParentId="10302" CreationDate="2014-02-19T13:02:51.030" Score="1" Body="&lt;p&gt;I would define the weights $w_1,\ldots,w_n$ as whatever number you want and the basket given by&#xA;$$&#xA;B_t = \sum_{i=1}^n \frac{w_i}{W}S_t^{(i)}\ , \qquad W = \sum_{i=1}^nw_i&#xA;$$&#xA;so the weights always sum to one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This doesn't make much sense, however, because you are changing the product, not a market variable. This meaning that when the weights change, the basket is discountinuous and you cannot replicate this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only way to replicate the basket would be to keep the past performance fixed as &#xA;$$&#xA;B_{t} = \frac{B_{t_1}^1}{B^1_{t_0}}\times \cdots \times \frac{B_{t_k}^k}{B_{t_{k-1}}^k}\times \frac{B_t^{k+1}}{B_{t_k}^{k+1}}&#xA;$$&#xA;Where each $t_i$ is a time where you rebalance the weights, and each $B^i$ is a baseket with the weights defined during the period $[t_{i-1},t_i)$.&lt;/p&gt;&#xA;" OwnerUserId="1704" LastActivityDate="2014-02-19T13:02:51.030" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10304" PostTypeId="2" ParentId="10285" CreationDate="2014-02-19T13:03:52.067" Score="3" Body="&lt;p&gt;Checking calculation with Bloomberg it seems that all 3 Korean bond futures contracts are of type (1). The pdf in the link must be out-dated.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-02-19T13:03:52.067" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10305" PostTypeId="1" CreationDate="2014-02-19T19:00:20.013" Score="0" ViewCount="1066" Body="&lt;p&gt;If I have given vectors for return and volatility (i.e. I have two 1x10 vectors), and I assume at first that their correlation is 0 (meaning my covariance-variance matrix is just diagonal), how do I simulate daily stock prices for the 10 year period? &lt;/p&gt;&#xA;" OwnerDisplayName="user7294" LastActivityDate="2014-02-19T19:20:08.567" Title="How do I simulate stock prices for a 10 asset portfolio, over a period of 10 years in MATLAB?" Tags="&lt;portfolio-management&gt;&lt;monte-carlo&gt;&lt;portfolio&gt;&lt;simulations&gt;&lt;matlab&gt;" AnswerCount="1" CommentCount="2" ClosedDate="2014-02-19T20:06:33.793" ContentLicense="CC BY-SA 3.0" />
  <row Id="10306" PostTypeId="2" ParentId="10305" CreationDate="2014-02-19T19:20:08.567" Score="1" Body="&lt;p&gt;A very simple approach could be the following: draw a random number for each day for each stock. If you refer to &quot;average/mean&quot; by return and to &quot;standard deviation/variance&quot; by volatility, you could use these for the distribution parameters of the random numbers per stock. If you dislike that values can go below zero, apply Euler's exponential function on each random number. &lt;a href=&quot;http://en.wikipedia.org/wiki/Monte_Carlo_methods_in_finance&quot; rel=&quot;nofollow&quot;&gt;This link&lt;/a&gt; and its references explain a similar approach.&lt;/p&gt;&#xA;" OwnerUserId="2284" LastActivityDate="2014-02-19T19:20:08.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10307" PostTypeId="1" CreationDate="2014-02-19T20:54:38.457" Score="1" ViewCount="336" Body="&lt;p&gt;what I am puzzled about is, why dont we instead of having &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;dX_t = \sqrt{V_t} dB_t - (\frac{1}{2} V_t^2-r-\lambda\Phi(\rho)) dt - \rho dZ_{\lambda t}\nonumber&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;we just have &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;dX_t = V_t dB_t - (\frac{1}{2} V_t-r-\lambda\Phi(\rho)) dt - \rho dZ_{\lambda t}\nonumber&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where \begin{equation}&#xA;dV_t = -\lambda V_t dt + dZ_{\lambda t}\nonumber&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been working on American put problem for this. Without the squre root, I think some things can be simplified in a much nicer manner. Though I have not done any computation, without the square root, $V$ is 'in the same dimension' as the log price. The equation has a nice interpretation that a jump in 'volatility' correspond to a jump in price rather than a jump in 'volatility squared' correspond to a jump in price?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Paper: &lt;a href=&quot;http://economics.ouls.ox.ac.uk/13781/1/read.pdf&quot; rel=&quot;nofollow&quot;&gt;http://economics.ouls.ox.ac.uk/13781/1/read.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3334" LastEditorUserId="3334" LastEditDate="2014-02-21T12:05:29.473" LastActivityDate="2014-08-11T07:43:50.843" Title="why is the BNS model the way it is" Tags="&lt;option-pricing&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10308" PostTypeId="2" ParentId="10302" CreationDate="2014-02-20T10:40:18.597" Score="0" Body="&lt;p&gt;This is perhaps not a concrete solution to your problem but the space in the comments is limited :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your setupt you are not actually pricing an option on a basket but on a dynamically allocated portfolio. Thus conventional pricing and hedging approaches won't apply. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also you are underestimating porfolio optimization algarithms. To find an optimal strategy you actually have to deal with weight sensitivity !&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Here an easy example:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say you want to have a static allocation at $t=0$ that gives you the highest expected porfolio value at $T$. So you set up your porfolio once and let it rest until maturity - thus your weights don't change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let's assume the expected porfolio value at $T$ is given by some continuous function $\mathbb{E}[P_T]=f(w_1,w_2,w_3,\vec{a})$ where $\vec{a}$ is a vector of model parameters for your capital market model (e.g. $\mu, \sigma$ in the B&amp;amp;S-case) and the $w_i$ are weights of your three stocks (with $w_1+w_2+w_3=1$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say your model parameters don't change over time. To optimize $\mathbb{E}[P_T]$ you have to run a multidimensional optimization algorithm on $f(w_1,w_2,w_3,\vec{a})$ with respect to $(w_1,w_2,w_3)$ Thus a three dimensional problem. Algorithms like gradient decent or &lt;a href=&quot;http://de.wikipedia.org/wiki/Levenberg-Marquardt-Algorithmus&quot; rel=&quot;nofollow&quot;&gt;levenberg marquardt&lt;/a&gt; explictily use derivatives to find the solution. For a concrete application of gradient descent to a portfolio selection problem &lt;a href=&quot;http://www.columbia.edu/~gi10/Papers/cvar.pdf&quot; rel=&quot;nofollow&quot;&gt;confer the following paper&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Some further thoughts:&lt;/strong&gt;&#xA;Your approach could also be seen as a way to analyse how options on equity-funds behave under changes in the fund composition. I would argue that this is already partially covered by the option's sensitivity to changes in volatility. If you change your portfolio composition by adding more of a volatile stock the effective volatility of your fund-value-process will increase.&lt;/p&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="7279" LastEditDate="2014-02-20T11:52:01.637" LastActivityDate="2014-02-20T11:52:01.637" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10309" PostTypeId="1" CreationDate="2014-02-20T14:36:04.600" Score="3" ViewCount="537" Body="&lt;p&gt;What is an option strategy that someone could employ to simply go long/short volatility?? Assuming I want 0 delta(0 gamma if possible) risk in my option position, how do I take a directional view on volatility? I know that Strangles/Straddles/Iron Condors are all ways to play volatility expansion if it goes beyond the width of your strikes. Not to mention you do maintain a 0 delta position until the price starts trending one way or the other for Strangle/Iron Condors. Are these option positions only way to play pure implied vol?&lt;/p&gt;&#xA;" OwnerUserId="4729" LastActivityDate="2014-03-19T21:14:29.080" Title="Directional View of Volatility" Tags="&lt;volatility&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10311" PostTypeId="2" ParentId="176" CreationDate="2014-02-20T16:02:04.477" Score="5" Body="&lt;p&gt;I agree with many of the other comments and answers. In addition, I would recommend the paper by Gelman and Shalizi on &lt;a href=&quot;http://www.stat.columbia.edu/~gelman/research/published/philosophy.pdf&quot; rel=&quot;noreferrer&quot;&gt;&quot;Philosophy and the practice of Bayesian Statistics&quot;&lt;/a&gt;, even if you're not a Bayesian. I would emphasize Section 4 on Model checking. They note the importance of posterior predictive checks, i.e. if I forecast from a model, would I get sensible results. They also recommend simulating fake data assuming the model is true and comparing it to the actual data. I regularly use these tools.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2014-02-20T16:02:04.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10312" PostTypeId="1" CreationDate="2014-02-20T17:06:56.113" Score="4" ViewCount="288" Body="&lt;p&gt;Assuming I have a dividend paying asset $S$ with dividend process $D$. Now I would like to use the bank account process $B$ as numeraire and determine the dynamics of $S$ under the the corresponding EMM $Q^B$. From Björk's book I have that $$\frac{S(t)}{B(t)}+\int_0^t \frac{dD(s)}{B(s)}$$&#xA;must be a martingale under $Q^B$ (actually this is not the entirely true for all cases, but if $B$ only has the dt-term it will be). Then I could find the dynamics of $S$ under the new measure by first finding the dynamics of the expression above, i.e. $$d\Big(\frac{S}{B}\Big) + \frac{dD}{B}$$&#xA;using Ito's formula. When the dynamics are in GBM-form I will neatly be able to factor out the $S/B$-term. Then, after using Girsanov Theorem, $dW = \varphi + dW^{Q^B}$, I would end up with a dt-term $$\frac{S}{B}\big((\alpha - r + \delta) + \varphi (\sigma +\delta)\big)$$&#xA;which must be equal to 0 since it should be a martingale. Here I have assumed the following dynamics of the processes&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dB = rBdt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS= \alpha S dt + \sigma S dW$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dD = \delta S dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I could easily solve for $\varphi$ and then the dynamics under the new measure follows. However, now assume the stock is traded on a foreign market with corresponding exchange rate $E$, then I'd like to determine $S_d$ (which is the process of $S$ in domestic currency) defined by $S_d = S \cdot E$. Analogously we have the dividend process $D_d$. In this case $S_d$ will still have dynamics on GBM-form with different parameters. The $D_d$ term will change quite dramatically though (I get $dD_d = (\delta S_d + D_d \mu_E)dt + \sigma_E D_d dW$, where $\mu_E, \sigma_E$ are the parameters in the GBM of the exchange rate). Since not all terms include $S_d$ I will not be able to factor that out when I solve for $\varphi$ as in the previous case. So I can't find the new dynamics in this manner. Is there something I'm missing or could I approach this problem differently?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Maybe it would be easier to find the dynamics of just $S$ and $E$ under the new measure, and then find the dynamics of $S_d$ by $S_d=S \cdot E$? I could find the dynamics of $E$ by the fact that $E/B$ must be a martingale under the measure (is this true?).&lt;/p&gt;&#xA;" OwnerUserId="4709" LastEditorUserId="4709" LastEditDate="2014-02-20T18:23:20.780" LastActivityDate="2014-02-20T18:23:20.780" Title="Finding the dynamics of a dividend paying asset under arbitrary numeraire" Tags="&lt;black-scholes&gt;&lt;stochastic-processes&gt;&lt;martingale&gt;&lt;homework&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10314" PostTypeId="2" ParentId="10307" CreationDate="2014-02-21T07:01:52.020" Score="0" Body="&lt;p&gt;The second equation where you would be using variance instead of standard deviation won't provide &quot;meaningful&quot; paths.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason is: variance has no meaning/interpretation in space. If you consider a normal distribution of stock returns the standard deviation is actually a number that tells you the difference between the expected value and some quantile. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Variance on the other hand does not have such a direct interpretation. You could for example run an exponential Brownian motion with a $\sigma^2$ instead of $\sigma$ but this would equal a path with an underlying volatility of $\sigma^4$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of taking $\sqrt{V_t}$ one could try work with a square-root process. Thus applying Itô to $d(\sqrt{V_t})$. This way you might get rid of the  $\sqrt{V_t}$ term in $dX_t$. &lt;/p&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="7279" LastEditDate="2014-02-21T07:09:59.533" LastActivityDate="2014-02-21T07:09:59.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10315" PostTypeId="2" ParentId="10307" CreationDate="2014-02-21T08:02:49.117" Score="1" Body="&lt;p&gt;I would put it differently. Modelling variance in an additive way (an OU process is in some regard additive) is more natural than e.g. a gemetric Brownian motion model (which on the other hand does not model mean reversion). Volatility as it is a square-root is by no means additive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $(B_t)_{t \ge 0}$ be Brownian motion then we have&#xA;$$&#xA;VAR(B_t) = t = VAR(B_s-B_0)+VAR(B_t-B_s) = s+(t-s) = t.&#xA;$$&#xA;This is true for the variance but by no means for volatility.&#xA;Also think of GARCH modelling where $\sigma^2$ is modelled and not $\sigma$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally if you model the variance then you have to take the square-root if you use it as a multiplier that represents volatility.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2014-02-21T09:20:16.770" LastActivityDate="2014-02-21T09:20:16.770" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10316" PostTypeId="2" ParentId="9402" CreationDate="2014-02-21T08:42:25.703" Score="6" Body="&lt;p&gt;I dont think you can see convexity in such a plot, since each of these prices are not observed from a single bond deliverable, but from different coupon bond deliveries. If the delivery was always based on same coupon type bond and quite similar maturity (&lt;a href=&quot;http://www.cmegroup.com/trading/interest-rates/us-treasury/10-year-us-treasury-note_contract_specifications.html&quot; rel=&quot;noreferrer&quot;&gt;http://www.cmegroup.com/trading/interest-rates/us-treasury/10-year-us-treasury-note_contract_specifications.html&lt;/a&gt;, ZN deliverable grades go from 6.5 to 10 years), then you would have observed the convexity effect.&lt;/p&gt;&#xA;" OwnerUserId="1215" LastActivityDate="2014-02-21T08:42:25.703" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10318" PostTypeId="1" CreationDate="2014-02-21T15:14:53.683" Score="2" ViewCount="156" Body="&lt;p&gt;I have a non-stationary series of bond yields $x_{t}$ that are logged and differenced &#xA;$$y_{t}\equiv ln\left(x_{t}\right)-ln\left(x_{t-4}\right)&#xA; $$ &#xA;From that, I get a series of forecasted values $\widetilde{y}_{t}&#xA; $. &#xA;Since ultimately what I want is actual yields, I need to back out the unlogged levels.To do this, I need first to un-difference, then take exponentials. The second step is obvious. What about the first?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I want&#xA;$$ln\left(\widetilde{x}_{t}\right)=\widetilde{y}_{t}+ln\left(\widetilde{x}_{t-4}\right)$$&#xA;but all I have is $\widetilde{y}_{t}$, because I forecasted the $y_{t}$ rather than $ln\left(x_{t}\right)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any thoughts? Is it possible? If so how? &lt;/p&gt;&#xA;" OwnerUserId="7309" LastEditorUserId="2379" LastEditDate="2014-02-21T18:39:22.613" LastActivityDate="2014-02-21T18:43:30.693" Title="how to back out levels from a forecast of differenced series" Tags="&lt;time-series&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10319" PostTypeId="2" ParentId="9380" CreationDate="2014-02-21T17:00:29.620" Score="5" Body="&lt;p&gt;The consensus nowadays is that stable distributions are not a well fit, although they do possess heavy tails. In particular Cauchy has too fat tails. &#xA;The reasons for this are disparate, however the first that comes to mind is that empirically longer horizons show a decrease in tail thickness, approaching normality for 1-year returns (although this has been contested e.g. by Taleb). Stable distributions by construction do not reproduce such effect; tempered-stable distributions have been introduced to adress such problem, however it's a hack that could be avoided by using other distributions in the first place. You can check the Levy family for some better alternatives.&lt;/p&gt;&#xA;" OwnerUserId="3015" LastActivityDate="2014-02-21T17:00:29.620" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10320" PostTypeId="2" ParentId="10318" CreationDate="2014-02-21T17:37:28.530" Score="-1" Body="&lt;p&gt;Simply calculate the cumulative sum. But you still need the intercept/a constant. From differences you cannot get the level of the original series. Tiny example: &#xA;series: 5,6,7,8 /&#xA;differences: 1,1,1 /&#xA;cumulative sum: 1,2,3&lt;/p&gt;&#xA;" OwnerUserId="2284" LastActivityDate="2014-02-21T17:37:28.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10321" PostTypeId="2" ParentId="10318" CreationDate="2014-02-21T17:56:13.533" Score="1" Body="&lt;p&gt;You can recover the levels of $X$ at time $t$ if you have $X(0)$ as well as all first differences until $X(t)$. Then $X(t) = X(0) + \sum_{i=1}^t (X(i)-X(i-1))$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case $X:=ln(Y)$, apply the above algorithm to find $ln(Y(t))$ from which $Y(t)=e^{X(t)}$. &lt;/p&gt;&#xA;" OwnerUserId="6081" LastActivityDate="2014-02-21T17:56:13.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10322" PostTypeId="2" ParentId="10318" CreationDate="2014-02-21T18:43:30.693" Score="1" Body="&lt;p&gt;You have &#xA;$$ln\left(x_{t-4}\right)$$ &#xA;so you don't need to get an estimate for &#xA;$$ln\left(\widetilde{x}_{t-4}\right)$$ &#xA;just plug that in, add your forecast for $y_{t}$, then take the exponential. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2014-02-21T18:43:30.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10323" PostTypeId="1" AcceptedAnswerId="10330" CreationDate="2014-02-21T19:48:57.627" Score="3" ViewCount="214" Body="&lt;p&gt;I have the following scenario:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $X_i$ denote the event where some institution $i$ 'defaults' (don't worry about the exact definition of a default here, it is not relevant to the question at hand). Now, I have 10 institutions in my sample and I have calculate the following probabilities:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P(X_1 \cap X_2 \cap \cdots \cap X_9 | X_{10})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P(X_1 \cap X_2 \cap \cdots \cap X_{8} \cap X_{10} | X_{9})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\vdots$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P(X_2 \cap \cdots \cap X_{9} \cap X_{10} | X_{1})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In words, the above expressions represent the (joint) probability of default of the 'remaining' institutions given that a particular institution has defaulted. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To calculate these probabilities, I know the underlying probability distribution that describes the entire system, i.e., $p(x_1, x_2, \cdots. x_{10})$, so for example, calculating the probability $P(X_1 \cap X_2 \cap \cdots \cap X_9 | X_{10})$ just simply requires me to find $\frac{P(X_1 \cap \cdots \cap X_{10})}{P(X_{10})}$ where both the denominator and numerator can be calculated by integrating over certain regions of the probability density function $p(x_1, x_2, \cdots. x_{10})$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, I wish to find one summary value that describes the average probability of default of this system, e.g. say $P(X_1 \cap X_2 \cap \cdots \cap X_9 | X_{10})= 0.4$, $P(X_1 \cap X_2 \cap \cdots \cap X_{8} \cap X_{10} | X_{9})= 0.3$ etc, how can I &quot;combine&quot; this $0.4$, $0.3$, etc into one value that describes the &quot;average&quot; probability of default of this system? My initial method is just to take the arithmetic average of each conditional probability, but that is mathematically incorrect conditional probabilities aren't summable (except when they are conditioned on the same event). So are there any other measures/techniques I can use to somehow &quot;combine&quot; these single probabilities into &quot;one&quot; value?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Let me put this into context to make things more concrete.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pretend each event is the event where a bank defaults. By default, I mean that the bank's assets drop below some pre-determined threshold. Then, say we have a sample of 10 banks. The entire &quot;system&quot; is the universe of these 10 banks. I want to find what is the &quot;contribution&quot; of each bank's default on the rest of the system, that is, given that one bank defaults, how does that affect the probability of default of the rest of the system (i.e., the remaining 9 banks). To do this, I have modeled the underlying (joint) asset distribution of this system of banks. Then, computing the probability $P(X_1 \cap X_2 \cap \cdots \cap X_9 | X_{10})$ represents the &quot;contribution&quot; of the default of the 10th bank on the rest of the system. Similarly, &#xA;$P(X_1 \cap X_2 \cap \cdots \cap X_{8} \cap X_{10} | X_{9})$ represents the impact of the default of the 9th bank on the rest of the system. Now given I have computed the &quot;contribution&quot; of each bank's default, I want to find a &lt;strong&gt;single&lt;/strong&gt; value that describes the average &quot;contribution&quot; of each bank's default on the rest of the system. &lt;/p&gt;&#xA;" OwnerUserId="6552" LastEditorUserId="6552" LastEditDate="2014-02-21T19:58:05.683" LastActivityDate="2014-02-22T09:39:24.610" Title="Summary statistic for the average probability of default?" Tags="&lt;statistics&gt;&lt;probability&gt;&lt;default&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10325" PostTypeId="2" ParentId="4079" CreationDate="2014-02-22T03:37:21.360" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://ycharts.com/&quot; rel=&quot;nofollow&quot;&gt;YCharts&lt;/a&gt; provides historical data and charts for the number of shares outstanding. Here is &lt;a href=&quot;http://ycharts.com/companies/YHOO/shares_outstanding&quot; rel=&quot;nofollow&quot;&gt;Yahoo's chart&lt;/a&gt; as an example.&lt;/p&gt;&#xA;" OwnerUserId="7313" LastActivityDate="2014-02-22T03:37:21.360" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10329" PostTypeId="1" CreationDate="2014-02-22T08:57:37.873" Score="1" ViewCount="62" Body="&lt;p&gt;This is an abstracted version of the problem I'm facing and I have to tell you first, my question might not be precise and or even correct, so I hope you understand and in that case can improve the point. I'm striking a problem field that I'm not very familiar with. But case is this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is an organization that has lets say 7 departments. Departments are getting a share of the money, say 1000000. There are several variables that affects the final share of the sum 1M per department. Variables are divided to sections and meters:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Section (S) 1, 2, 3 and 4 which all has meters (m), lets say:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;S1: m1, m2&#xA;S2: m1, m2, m3&#xA;S3: m1, m2&#xA;S4: m1, m2, m3, m4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Total score is calculated by summing up all meters on all sections. And total score is used to calculate portion of the share. There is some other math involved at this point, but I'm simplifying the problem now for this question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Departments also have some variables, like size by employers, their salary, activities performed and such, which defines initial sum they get. But total of all departments is 1M.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now after certain time period, say 4 months, variables are checked and new portion of the share is calculated based on sections and their and meters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This raises a problem, which might not be apparent on simple example given above, but what is the actual question and problem of mine. Departments will get certain percentage of the share, so bigger departments will get bigger and smaller will get smaller. It looks like this is not rightful and equal in this system, because more the bigger departments get, slice from the share is bigger and it affects increasingly on smaller departments. At the moment share is somewhat percentage (linear) based, but I was thinking if share could be functionally (logarithm) defined, or something else. Does anyone has insight to this kind of problem?&lt;/p&gt;&#xA;" OwnerUserId="7316" LastActivityDate="2016-06-19T03:57:54.577" Title="How to rightfully balance the share of the organization between departments after variable changes?" Tags="&lt;mathematics&gt;&lt;budgeting&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10330" PostTypeId="2" ParentId="10323" CreationDate="2014-02-22T09:39:24.610" Score="2" Body="&lt;p&gt;I have an Idea perhaps it helps you a bit (even though it deviates somewhat from your original setup). Let's assume you know the &quot;anaffected&quot; default probabilities for each bank $P(X_1&amp;lt;=C_1), \dots, P(X_n&amp;lt;=C_n)$. (Here I assumed that bank $i$ defaults when it's value falls below a certain value $C_i$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now e.g. for bank $n$ you can calulate $P(X_1&amp;lt;=C_1|X_n&amp;lt;=C_n), \dots, P(X_{n-1}&amp;lt;=C_{n-1}|X_{n}&amp;lt;=C_{n})$. Thus the default probabilites conditioned on the default of bank $n$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you could calculate $d_i(n)=P(X_1&amp;lt;=C_1|X_n&amp;lt;=C_n) - P(X_1&amp;lt;=C_1)$ for $i\in\{1,\dots , n-1\}$ to determine whether the default probability of $X_1$ increased or decreased after the default of $X_n$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now add some weights $(w_1, \dots , w_{n-1})$ bcause the default of one bank might be seen as having more impact than the default of another.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally by taking $\sum_{i=1}^{n-1} w_i d_i(n)$ you would get a number telling you how the default of $X_n$ &quot;impacts&quot; the system. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here I still haven't used all the &quot;correlation-information&quot; into account (some of it is already contained in the probablities $P(X_1&amp;lt;=C_1|X_n&amp;lt;=C_n)$) This information (or at least some of it) could also be included into the weights $w_i$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way could be to calculate the average number of banks that would default if e.g. $X_i$ defaulted. To do that you will have to calculate the conditional expectation $\mathbb{E}[ \sum_{j=1,j\neq i}^{n} 1_{X_j&amp;lt;=C_j}|X_i&amp;lt;=C_i]$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Setting &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$w_i=\mathbb{E}[ \sum_{j=1,j\neq i}^{n} 1_{X_j&amp;lt;=C_j}|X_i&amp;lt;=C_i]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;will give you weights that incoporate more information on the correlation among the banks.&lt;/p&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-02-22T09:39:24.610" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10331" PostTypeId="1" CreationDate="2014-02-22T10:18:55.870" Score="1" ViewCount="387" Body="&lt;p&gt;Your client would like to buy a digital call option. the digital call option pays the buyer in one years time (i.e at maturity ) &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;N=1m SGD, if the SGD USD spot rate at maturity is above a prescribed level k_0 and nothing otherwise &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Risk management of this structure is done, via conservative replication, with a pair of call options of strikes $K_1$ and $K_2$, $K_2$ &gt; K_1 and with a spread size $\Delta K =K_2-K_1&amp;gt;0$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; From the seller point of view, how would you choose the strikes $K_1 , K_2$ and notionals $N_1,N_2$ (possibly negative) of these call options as a function of $K_0$, $\Delta K$, and $N$ in such a way that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) you overestimate the actual amount paid to the client if the spot falls between $K_1$ and $K_2 $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) and match exactly actual amount otherwise?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anybody can help me with this, and if possible ,explain what is meant by conservative replication as well as how can the notionals be negative? It does not make sense that i am a seller of a call option and i give a negative payout? &lt;/p&gt;&#xA;" OwnerUserId="7315" LastEditorUserId="7315" LastEditDate="2014-02-22T12:53:23.200" LastActivityDate="2014-03-01T15:25:52.180" Title="Risk management of options" Tags="&lt;options&gt;&lt;risk&gt;&lt;portfolio&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10332" PostTypeId="1" CreationDate="2014-02-22T15:09:35.517" Score="1" ViewCount="830" Body="&lt;p&gt;To price a vanilla option, the following information are required :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Strike price;&lt;/li&gt;&#xA;&lt;li&gt;Underlying price;&lt;/li&gt;&#xA;&lt;li&gt;Volatility;&lt;/li&gt;&#xA;&lt;li&gt;Maturity;&lt;/li&gt;&#xA;&lt;li&gt;Dividends rate;&lt;/li&gt;&#xA;&lt;li&gt;Repo rate;&lt;/li&gt;&#xA;&lt;li&gt;Interest rate;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The strike, underlying price, maturity, Interest rates are known;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The volatility is implied from an options panel in the market;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But practically, where do we get the dividends and repo rates from ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="7120" LastActivityDate="2014-02-25T16:23:02.270" Title="Practical equity options pricing" Tags="&lt;options&gt;" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10333" PostTypeId="2" ParentId="10331" CreationDate="2014-02-22T15:51:06.980" Score="2" Body="&lt;p&gt;In what follows, I assume no default and no frictions.&#xA;A perfect hedge for your short position in a binary call would be a long position in a digital call with the same notional, strike price, and maturity date. Your goal is to super-replicate the payoff from a long digital call by a static position with a pair of co-terminal vanilla calls, one with strike K1 and the other with strike K2 &gt; K1. The notional of the target digital call is N&gt;0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a super-replicating portfolio. Set K2 = K0. Set K1 = K2 - ΔK. Buy one call with strike K1 and notional N1 = N/ΔK. Sell one call with strike K2 and notional N2 = N/ΔK. Done. &#xA;If you wish, you can think of the second call position as Buy one call with strike K2 and with negative notional N2 = -N/ΔK, but this would be an unconventional view. The super-replicating portfolio above would be an example of conservative replication.&lt;/p&gt;&#xA;" OwnerUserId="7320" LastActivityDate="2014-02-22T15:51:06.980" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10334" PostTypeId="1" CreationDate="2014-02-22T19:04:38.760" Score="3" ViewCount="15489" Body="&lt;p&gt;I need data for my thesis research on liquidity of foriegn exchange for  order flow (aggregated daily) per currency traded for a period over the last 10-15 years. help!!&lt;/p&gt;&#xA;" OwnerUserId="7322" LastEditorUserId="7279" LastEditDate="2014-02-22T19:20:59.570" LastActivityDate="2021-04-14T16:51:10.777" Title="where can i get data for foreign exchange order flow" Tags="&lt;data&gt;&lt;fx&gt;&lt;finance&gt;" AnswerCount="4" CommentCount="3" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="10335" PostTypeId="2" ParentId="4804" CreationDate="2014-02-22T19:07:11.703" Score="1" Body="&lt;p&gt;First, find out which ETFs are correlated with one another over time.  Let the data matrix $\mathbf{X}$ of ETF price returns have $t$ rows and $p$ columns, where the $t$ rows are bars or days, and the $p$ columns in the dataset are ETFs.  Next, determine the correlation matrix $\mathbf{R}$ for the ETF-to-ETF correlation, and then run principal components analysis (PCA) to identify which ETFs &lt;em&gt;load&lt;/em&gt; or are correlated with each principal component (PC).  To understand PCA, if you have a correlation matrix $\mathbf{R}$ for e.g. 50 ETFs, then PCA will create 50 PCs which have zero correlation between each other.   For each ETF, there will be a &lt;em&gt;loading&lt;/em&gt; value (i.e., correlation) for each PC.  If the price returns of several ETFs are correlated, they will likely load on the same PC.  Commonly, loading values (correlation) of 0.45 and greater are considered to be large enough to warrant further investigation.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use the loadings of each ETFs on the various PCs to group together ETFs whose price returns are correlated.  For example, bank ETFs may correlate (loading&gt;0.45) with the 1st PC, oil ETFs with the 2nd PC, emerging growth ETFs on the 3rd, and so on.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assets (ETFs) commonly don't always correlate with everything else, but will correlate with assets in the same sector.  PCA creates artificial vectors (eigenvectors) which have zero correlation with one another, and therefore by observing which ETFs correlate mostly (&gt;0.45) with a given PC, you can essentially group.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;PCA is wholly linear, and there are non-linear methods such as Laplacian Eigenmaps, Local Linear Embedding, Locally Preserving Projections, Diffusion Maps, etc. which can be employed.  Another term for the non-linear techniques is &quot;distance metrics learning.&quot;      &lt;/p&gt;&#xA;" OwnerDisplayName="user6430" LastActivityDate="2014-02-22T19:07:11.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10336" PostTypeId="1" CreationDate="2014-02-22T21:10:36.583" Score="3" ViewCount="4090" Body="&lt;p&gt;Not looking to start a debate. Just want to learn more about the field and am looking for some websites with high quality, informative content.&lt;/p&gt;&#xA;" OwnerUserId="7323" LastActivityDate="2014-02-24T07:40:18.563" Title="What are some of the best quantitative finance websites?" Tags="&lt;quantitative&gt;&lt;learning&gt;&lt;resource&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="4" ClosedDate="2014-02-24T13:39:21.320" CommunityOwnedDate="2014-02-24T08:11:58.460" ContentLicense="CC BY-SA 3.0" />
  <row Id="10337" PostTypeId="2" ParentId="10336" CreationDate="2014-02-22T21:49:47.990" Score="2" Body="&lt;p&gt;Besides this site which in my opinion has a huge adventage on how the questions and answers are presented, two major players come to mind. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.wilmott.com/index.cfm?NoCookies=Yes&amp;amp;forumid=1&quot; rel=&quot;nofollow&quot;&gt;The Wilmott Forum&lt;/a&gt; &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://www.quantnet.com/&quot; rel=&quot;nofollow&quot;&gt;And the QuantNet-Community&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I would say QuantNet is more on the educational and job-search side. You will find a lot of resources with respect to interview question and acedemic master programms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wilmott is has lots of everything. You could check out some of the &lt;a href=&quot;http://www.wilmott.com/blogs.cfm&quot; rel=&quot;nofollow&quot;&gt;blogs here&lt;/a&gt; for example. Also to my knowledge many quants have their personal websites where they share their research and perspektives. &lt;/p&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-02-22T21:49:47.990" CommentCount="0" CommunityOwnedDate="2014-02-24T08:11:58.460" ContentLicense="CC BY-SA 3.0" />
  <row Id="10338" PostTypeId="1" AcceptedAnswerId="10342" CreationDate="2014-02-22T22:25:32.127" Score="4" ViewCount="1716" Body="&lt;p&gt;I got stuck on the following question whilst learning about basic option pricing.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A stock is valued at \$75 today. An option will pay \$1 the first time the stock reaches \$100 in value, which it is assumed will happen with probability one at some point in the future. Find the price of the option and construct a replicating portfolio.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;At first glance, this seems like some sort of continuous time problem, but I'm hoping that there's a simpler way to do things. How should one approach this sort of question?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: For simplicity, let's assume there's no interest in this scenario.&lt;/p&gt;&#xA;" OwnerUserId="7324" LastEditorUserId="7324" LastEditDate="2014-02-22T22:36:02.497" LastActivityDate="2014-02-26T10:13:16.557" Title="Price an option and find a replicating portfolio" Tags="&lt;option-pricing&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10339" PostTypeId="2" ParentId="10336" CreationDate="2014-02-22T22:33:39.983" Score="4" Body="&lt;p&gt;It depends the kind of information you look for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Questions and answer.&lt;/strong&gt;&#xA;This web site is really the best I know on quant finance. You can browse &quot;tags&quot; and go the the associated wiki pages to have summarized information.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Wilmott Forum is not that bad;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.nuclearphynance.com&quot; rel=&quot;nofollow&quot;&gt;Nuclear Phynance&lt;/a&gt; is good too.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Generic knowledge.&lt;/strong&gt;&#xA;It depends on what area on finance you are interested in.&#xA;Frankly I would recommend the &lt;strong&gt;web sites of market authorities&lt;/strong&gt;, they often publish reports and &lt;em&gt;policy papers&lt;/em&gt;. The website of the &lt;a href=&quot;http://www.louisbachelier.org/&quot; rel=&quot;nofollow&quot;&gt;Louis Bachelier Institute&lt;/a&gt; (in French only) is nice too, and more systematically quant oriented.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the best is to &lt;strong&gt;read books&lt;/strong&gt;, for instance a mix of very classical ones and more recent ones.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2014-02-22T22:33:39.983" CommentCount="0" CommunityOwnedDate="2014-02-24T08:11:58.460" ContentLicense="CC BY-SA 3.0" />
  <row Id="10341" PostTypeId="1" CreationDate="2014-02-23T03:16:06.643" Score="1" ViewCount="149" Body="&lt;p&gt;How does buying back stock affect a company's credit spread?  Would it cause it to get smaller?  Any clarification would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="7274" LastActivityDate="2017-03-13T16:41:46.273" Title="How does buying back stock affect a company's credit spread?" Tags="&lt;finance&gt;&lt;credit&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10342" PostTypeId="2" ParentId="10338" CreationDate="2014-02-23T04:06:22.450" Score="4" Body="&lt;p&gt;Assume the stock pays no dividends before 100 dollars is hit. Interest rates can be arbitrary. Buy 1/100 of a share for 75 cents. Hold until $100 is hit then sell. The payoff of 1 dollar is replicated for an upfront cost of 75 cents. The arbitrage-free value of the option is 75 cents.&lt;/p&gt;&#xA;" OwnerUserId="7320" LastActivityDate="2014-02-23T04:06:22.450" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10343" PostTypeId="1" CreationDate="2014-02-23T07:59:17.767" Score="6" ViewCount="352" Body="&lt;p&gt;This question is related to the discussion on &lt;a href=&quot;https://quant.stackexchange.com/questions/176/model-validation-criteria&quot;&gt;Model Validation Criteria&lt;/a&gt;&#xA;However it appeard to be very high level to me and I would like to go more into detail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not working at a pricing desk the following has always puzzled me: &#xA;&lt;strong&gt;How are quants able to verify whether their calculated prices are any good?&lt;/strong&gt;&#xA;&lt;em&gt;(by &quot;calculated prices&quot; I mean the ones output by some model - e.g. B&amp;amp;S, Heston )&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One could perhaps distingusih the two:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;A priori &lt;/li&gt;&#xA;&lt;li&gt;A posteriori&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I would assume a priory mainly consists of model choice (fitting the market data etc.) - Thus the A priori part is related to &lt;a href=&quot;https://quant.stackexchange.com/questions/10300/which-interest-rate-model-for-which-product&quot;&gt;this question&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alas, I am quite clueless what an a posteriori check would look like. &#xA;What would be the benchmark one would check against ?&lt;/p&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2014-02-23T14:45:59.207" Title="How are quants able to verify whether their calculated prices are any good" Tags="&lt;option-pricing&gt;&lt;equities&gt;&lt;fixed-income&gt;&lt;models&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10345" PostTypeId="1" AcceptedAnswerId="10372" CreationDate="2014-02-23T16:05:18.443" Score="6" ViewCount="518" Body="&lt;p&gt;this is a complex topic that interests me, have researched myself, &amp;amp; is debated heavily in the media and there is lots of writing, even entire books/documentaries. maybe somewhat surprisingly, even after ½ decade there seems not to be strong consensus (possibly due to some interconnection with political povs). in conformance with stackexchange guidelines, am not actually looking for &quot;discussion&quot; or &quot;personal opinions&quot; but instead mainly just summary/citations of the leading authoritative analysis &amp;amp; the basic general position categories that are taken on this question. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;what was the quant role in 2008 crash?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;note some connection with &lt;a href=&quot;https://quant.stackexchange.com/questions/1658/has-high-frequency-trading-hft-been-a-net-benefit-or-cost-to-society&quot;&gt;Has high frequency trading (HFT) been a net benefit or cost to society?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(edit: was asked for a ref)&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;here is wired article 2/09 which blames (in part) overreliance on the Gaussian copula formula by quants (used widely in valuing mortgage debt instruments). &lt;a href=&quot;http://www.wired.com/techbiz/it/magazine/17-03/wp_quant?currentPage=all&quot; rel=&quot;nofollow noreferrer&quot;&gt;Recipe for disaster: the formula that killed wall st&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2021" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2014-02-25T16:46:06.337" Title="what was the quant role in the 2008 crash?" Tags="&lt;research&gt;&lt;automated-trading&gt;&lt;market&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10346" PostTypeId="1" CreationDate="2014-02-23T17:15:44.633" Score="5" ViewCount="892" Body="&lt;p&gt;I'm performing a Monte Carlo to calculate value at risk (with a 3 dimension risk factor)&#xA;Now, I would like to calculate the error of the estimation of the VaR with respect to the number of simulations (drawing a graph of estimation error with respect the number of simulations)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the formula for the error on the VaR?&lt;/p&gt;&#xA;" OwnerUserId="7329" LastEditorUserId="848" LastEditDate="2014-02-23T19:59:02.973" LastActivityDate="2014-02-26T02:30:51.753" Title="How to Calculate a Monte Calo VaR estimation error" Tags="&lt;monte-carlo&gt;&lt;var&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10347" PostTypeId="1" AcceptedAnswerId="10365" CreationDate="2014-02-23T23:12:58.760" Score="1" ViewCount="129" Body="&lt;p&gt;I'm studying for a test and am stuck on this practice question: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With interest rates equal to 0, two different stocks $S_1$ and $S_2$, both valued at \$1 today, can be worth \$2 or \$0.50 at some point in the future. If the option that pays \$1 when both $S_1 = S_2 = \$2$ is traded in the market and is worth \$0.125, calculate the price and replicating portfolio of the option that pays \$1 when $S_1 = \$2$ but $S_2 = \$0.5$. You may leave your answer in matricial form.&lt;/p&gt;&#xA;" OwnerUserId="7334" LastEditorUserId="2379" LastEditDate="2014-02-24T14:31:46.230" LastActivityDate="2014-02-25T14:27:28.393" Title="Pricing options with two assets" Tags="&lt;option-pricing&gt;&lt;homework&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10348" PostTypeId="1" CreationDate="2014-02-23T23:38:15.600" Score="3" ViewCount="280" Body="&lt;p&gt;In order to find the minimum variance hedge ratio when holding a portfolio of vanilla call options and hedging with stock, you can do an OLS regression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a binomial model framework, given parameters So, K, sigma, r, T, and the number of periods in the tree, how can you calculate the minimum variance hedge ratio?&lt;/p&gt;&#xA;" OwnerUserId="6893" LastActivityDate="2014-08-08T13:20:42.197" Title="Minimum Variance Hedge Ratio in Binomial Framework" Tags="&lt;regression&gt;&lt;hedging&gt;&lt;binomial-tree&gt;&lt;minimum-variance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10349" PostTypeId="2" ParentId="1462" CreationDate="2014-02-24T00:05:41.190" Score="2" Body="&lt;p&gt;If you're willing to write a bit more code, the &lt;a href=&quot;http://wiki.quantsoftware.org&quot; rel=&quot;nofollow&quot;&gt;QuantSoftware ToolKit&lt;/a&gt; is able to backtest algorithms. Pulling stock data from Yahoo is simply a function call - it's even cached. If you know Python (especially NumPy and Pandas), you're ready to go.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the wiki:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Key components of QSTK are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Data: A data access package that enables fast reading of historical data (qstkutil.DataAccess).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Processing tools: Uses pandas, a Python package designed for time series evaluation of equity data.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Portfolio optimization: Using the CVXOPT library.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Event studies: An efficient event analyzer, Event_Profiler.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Simulation: A simple backtester, quicksim, that includes transaction cost modeling.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The source is also on &lt;a href=&quot;https://github.com/QuantSoftware/QuantSoftwareToolkit&quot; rel=&quot;nofollow&quot;&gt;GitHub&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7335" LastActivityDate="2014-02-24T00:05:41.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10350" PostTypeId="2" ParentId="10336" CreationDate="2014-02-24T07:40:18.563" Score="2" Body="&lt;p&gt;Agree, a little broad topic. There are sites that use quant to pick stocks. fotatah.com is an example of site. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It all depends on your goals (academic, trading,  etc.)&lt;/p&gt;&#xA;" OwnerUserId="7337" LastActivityDate="2014-02-24T07:40:18.563" CommentCount="1" CommunityOwnedDate="2014-02-24T08:11:58.460" ContentLicense="CC BY-SA 3.0" />
  <row Id="10351" PostTypeId="2" ParentId="10346" CreationDate="2014-02-24T13:53:22.143" Score="4" Body="&lt;ol&gt;&#xA;&lt;li&gt;Do $N$ MC simulations of $M$ samples, calculating your estimate of VaR for each one $\{\widehat{VaR}_i\}_{i=1}^N$ and you now have an IID sample!&lt;/li&gt;&#xA;&lt;li&gt;Take the sample (or unbiased) standard deviation for your estimate of VaR (this is probably what you mean by error) $SD(\widehat{VaR})=\sqrt{\frac{1}{N-1} \sum_{i=1}^N (\widehat{VaR}_i - \overline{VaR})^2}$ and of course $\overline{VaR}=\frac{1}{N}\sum_{i=1}^N\widehat{VaR}_i$&lt;/li&gt;&#xA;&lt;li&gt;Increase $M$ to get your plot, plot $M$ against $SD(\widehat{VaR})$ for each value $M \in [\underline{M}, \overline{M}]$ you might want to use something like $\underline{M}=50$ and $\overline{M}=1000$ depending on the application.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt; There probably are more tractable things to do but by the fact that OP is already in Monte-Carlo world, this is the Monte-Carlo answer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 2&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;N = 1000&#xA;M = seq(50, 1000, by=10)&#xA;&#xA;VaRstdevs = rep(0, length(M))&#xA;&#xA;i=1&#xA;for(nscenarios in M) {&#xA;  varsample = rep(0, N)&#xA;  for(sim in 1:N) {&#xA;    samp = rnorm(nscenarios, 0, 0.3/sqrt(252)) # 30% annualized sd MC sim&#xA;    varsample[sim] = -1.0*quantile(samp, 0.05) # VaR 95%&#xA;  }&#xA;  VaRstdevs[i] = sd(varsample)&#xA;  i=i+1&#xA;}&#xA;&#xA;plot(M, VaRstdevs)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/cpivb.png&quot; alt=&quot;MC VaR&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="4910" LastEditorUserId="4910" LastEditDate="2014-02-25T13:51:05.367" LastActivityDate="2014-02-25T13:51:05.367" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10352" PostTypeId="1" CreationDate="2014-02-24T14:08:37.310" Score="3" ViewCount="200" Body="&lt;p&gt;Does anyone know how to derive the Variance of Bin Zhou's volatility estimator (Theorem 1) in 'High-Frequency Data and Volatility in Foreign-Exchange Rates' (1996)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://public.econ.duke.edu/~get/browse/courses/201/spr11/DOWNLOADS/MicroStructure/Zhou-JBES-1996.pdf&quot; rel=&quot;nofollow&quot;&gt;Zhou 1996&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be greatly appreciated. &lt;/p&gt;&#xA;" OwnerUserId="7341" LastActivityDate="2014-02-24T14:08:37.310" Title="Derivation of variance of Zhou (1996) volatility estimator" Tags="&lt;volatility&gt;&lt;time-series&gt;&lt;high-frequency&gt;&lt;estimation&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10353" PostTypeId="2" ParentId="10341" CreationDate="2014-02-24T14:56:48.017" Score="4" Body="&lt;p&gt;All else being equal, buying back stock would cause a company's credit spread to widen (increase). This is because a share buyback involves shrinking the firm's assets (spending cash to buy back the stock) and shrinking equity/retained earnings, while leaving the liabilities unchanged (or increasing them in the case of a leveraged buy back). This is an increase in leverage, which would leave the firm more exposed to bankruptcy (and hence credit risk). &lt;/p&gt;&#xA;" OwnerUserId="5120" LastEditorUserId="5120" LastEditDate="2017-03-13T16:41:46.273" LastActivityDate="2017-03-13T16:41:46.273" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10354" PostTypeId="1" AcceptedAnswerId="29877" CreationDate="2014-02-24T15:14:18.387" Score="6" ViewCount="784" Body="&lt;p&gt;From a paper that shortly addresses an alternative approach to VIX-like index building:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/l23cg.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/WPTMT.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To test this approach, I've built a fake book of B&amp;amp;S options with constant volatility equal to $\sigma=20\%$, $0\%$ risk free rate and $0\%$ cost of carry. I focused my attention on $T=15$ days maturity (roughly $0.0411$ years on $365$ basis).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/D0r7x.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Starting from the assumption that Bakshi, Kapadia and Madan (2003) approach is correct, one should get as a result a VIX-like object whose value is equal to $20\%$ if he applied the formula to the book above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From partial moments to VIX-like value with fake $\sigma=20\%$ options:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;H1  =   0,001647398&#xA;H2  =   -4,6183E-06&#xA;H3  =   7,30375E-06&#xA;mu  =   -0,000823234&#xA;VAR =   0,040070196&#xA;VIX =   sqrt(VAR) = 20%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My VBA code so you can easily reproduce my results:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Public Function VAR_T(F As Double, K_C As Range, K_P As Range, C As Range, P As Range, rf As Double, t As Double) As Double&#xA;&#xA;    ' F         Underlying forward value&#xA;    ' K_C       Range of Call options' strike prices&#xA;    ' K_P       Range of Put options' strike prices&#xA;    ' C         Range of Call options' prices (same extent of K_C is mandatory)&#xA;    ' P         Range of Put options' prices (same extent of K_P is mandatory)&#xA;    ' rf        Risk free rate (as instance of EUR, EONIA spot is suggested)&#xA;    ' t         Time to expiry in years on 365 basis&#xA;&#xA;    Dim kH1 As Double&#xA;    Dim kmu_t As Double&#xA;&#xA;    kH1 = H1_T(F, K_C, K_P, C, P)&#xA;    kmu_t = mu_T(F, K_C, K_P, C, P, rf, t)&#xA;    VAR_T = (Exp(rf * t) * kH1 - (kmu_t) ^ 2) / t&#xA;&#xA;    ' Squared root of VAR_T is the underlying volatility on expiry date equal to today + t&#xA;&#xA;End Function&#xA;&#xA;Public Function mu_T(F As Double, K_C As Range, K_P As Range, C As Range, P As Range, rf As Double, t As Double) As Double&#xA;&#xA;    Dim kH1 As Double&#xA;    Dim kH2 As Double&#xA;    Dim kH3 As Double&#xA;&#xA;    kH1 = H1_T(F, K_C, K_P, C, P)&#xA;    kH2 = H2_T(F, K_C, K_P, C, P)&#xA;    kH3 = H3_T(F, K_C, K_P, C, P)&#xA;&#xA;    mu_T = Exp(rf * t) - 1 - Exp(rf * t) / 2 * kH1 - Exp(rf * t) / 6 * kH2 - Exp(rf * t) / 24 * kH3&#xA;&#xA;End Function&#xA;&#xA;Public Function H1_T(F As Double, K_C As Range, K_P As Range, C As Range, P As Range) As Double&#xA;&#xA;    Dim n_C As Integer&#xA;    Dim n_P As Integer&#xA;    Dim partial_moment_C()&#xA;    Dim partial_moment_P()&#xA;&#xA;    n_C = K_C.Count&#xA;    n_P = K_P.Count&#xA;&#xA;    ReDim partial_moment_C(n_C)&#xA;    ReDim partial_moment_P(n_P)&#xA;&#xA;    For i = 1 To n_C&#xA;        partial_moment_C(i) = 2 * (1 - Log(K_C(i) / F)) / (K_C(i) ^ 2) * C(i)&#xA;    Next&#xA;&#xA;    For i = 1 To n_P&#xA;        partial_moment_P(i) = 2 * (1 + Log(F / K_P(i))) / (K_P(i) ^ 2) * P(i)&#xA;    Next&#xA;&#xA;    H1_T = Application.Sum(partial_moment_C) + Application.Sum(partial_moment_P)&#xA;&#xA;End Function&#xA;&#xA;Public Function H2_T(F As Double, K_C As Range, K_P As Range, C As Range, P As Range) As Double&#xA;&#xA;    Dim n_C As Integer&#xA;    Dim n_P As Integer&#xA;    Dim partial_moment_C()&#xA;    Dim partial_moment_P()&#xA;&#xA;    n_C = K_C.Count&#xA;    n_P = K_P.Count&#xA;&#xA;    ReDim partial_moment_C(n_C)&#xA;    ReDim partial_moment_P(n_P)&#xA;&#xA;    For i = 1 To n_C&#xA;        partial_moment_C(i) = (6 * Log(K_C(i) / F) - 3 * (Log(K_C(i) / F)) ^ 2) / (K_C(i) ^ 2) * C(i)&#xA;    Next&#xA;&#xA;    For i = 1 To n_P&#xA;        partial_moment_P(i) = (6 * Log(F / K_P(i)) + 3 * (Log(F / K_P(i))) ^ 2) / (K_P(i) ^ 2) * P(i)&#xA;    Next&#xA;&#xA;    H2_T = Application.Sum(partial_moment_C) - Application.Sum(partial_moment_P)&#xA;&#xA;End Function&#xA;&#xA;Public Function H3_T(F As Double, K_C As Range, K_P As Range, C As Range, P As Range) As Double&#xA;&#xA;    Dim n_C As Integer&#xA;    Dim n_P As Integer&#xA;    Dim partial_moment_C()&#xA;    Dim partial_moment_P()&#xA;&#xA;    n_C = K_C.Count&#xA;    n_P = K_P.Count&#xA;&#xA;    ReDim partial_moment_C(n_C)&#xA;    ReDim partial_moment_P(n_P)&#xA;&#xA;    For i = 1 To n_C&#xA;        partial_moment_C(i) = (12 * (Log(K_C(i) / F)) ^ 2 - 4 * (Log(K_C(i) / F)) ^ 3) / (K_C(i) ^ 2) * C(i)&#xA;    Next&#xA;&#xA;    For i = 1 To n_P&#xA;        partial_moment_P(i) = (12 * (Log(F / K_P(i))) ^ 2 + 4 * (Log(F / K_P(i))) ^ 3) / (K_P(i) ^ 2) * P(i)&#xA;    Next&#xA;&#xA;    H3_T = Application.Sum(partial_moment_C) + Application.Sum(partial_moment_P)&#xA;&#xA;End Function&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you use the functions above to calculate the VIX-like value of the fake options, you will get $20\%$ as expected; but, if you build fake options using a huge implied volatility, something like $\sigma=80\%$, my code returns an implied model free volatility of... $62\%$!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Possibilities:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I am wrong with my understanding of the aforementioned formulas; &lt;/li&gt;&#xA;&lt;li&gt;I am wrong with the implementation of the aforementioned formulas in VBA code;&lt;/li&gt;&#xA;&lt;li&gt;Bakshi, Kapadia and Madan (2003) approach underestimate volatility, which sounds unlikely... what am I not taking into account?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3058" LastEditorUserId="3058" LastEditDate="2014-02-24T20:30:24.957" LastActivityDate="2016-08-29T09:37:09.507" Title="Does Bakshi, Kapadia and Madan (2003) VIX building approach underestimate volatility?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;vix&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10356" PostTypeId="2" ParentId="10332" CreationDate="2014-02-24T19:55:18.950" Score="3" Body="&lt;p&gt;You get the repo rate from asking your broker.  Most of the time the underlying is not on &quot;special&quot; so you get whatever standard rate appears in your contract.  You obtain dividends from BDVD or a similar service.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2014-02-24T19:55:18.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10357" PostTypeId="2" ParentId="10291" CreationDate="2014-02-24T19:57:26.630" Score="2" Body="&lt;p&gt;At long maturities, the real problem tends more to be model error than volatility estimation: over that kind of time period most companies undergo significant capital structure changes, for which there are very few models.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2014-02-24T19:57:26.630" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10358" PostTypeId="2" ParentId="10282" CreationDate="2014-02-24T20:10:53.253" Score="1" Body="&lt;p&gt;There is no difference in information, though the fitting algorithm may increase in complexity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First note that in practice you &lt;em&gt;never&lt;/em&gt; have an entire curve or surface of prices $C(K,T)$ of any kind of option.  You only have a finite number of observations and even those typically have a bid and an offer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would therefore argue that the correct picture of the problem is as follows: given an $n$-parameter specification $\sigma(S, t; \vec{\mu})$ based on parameters $\mu_1,\dots,\mu_n$, which surface best fits a set of $M$ market observations $V_1,\dots,V_M$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The case you cite on European calls takes some unspecified intermediate formula of call prices at a given maturity $T$, then differentiates it to get a snapshot of the integrated variance to $T$.   Doing this for several maturities $T_1,\dots,T_N$ sort-of specifies local vols $\sigma(S, t)$ but only by adding a few further assumptions.  So, you see, even the European option case you cite is not so clear-cut, having missed both the initial price curve spec and the inter-maturity spec.  If you consider those price curve parameters, you see that they are elements of your $\vec{\mu}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moving back to our more general picture, once you have chosen your functional form $\sigma(\cdot, \cdot; \vec{\mu})$ (whatever it may be), you can use it along with a nonlinear optimizer (perhaps simulated annealing) to fit your local vols to any set of market data you like, including exotics prices.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2014-02-24T20:10:53.253" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10359" PostTypeId="1" AcceptedAnswerId="10367" CreationDate="2014-02-25T09:24:45.367" Score="32" ViewCount="14651" Body="&lt;p&gt;The Feynman-Kac theorem states that for an Ito-process of the form&#xA;$$dX_t = \mu(t, X_t)dt + \sigma(t, X_t)dW_t$$&#xA;there is a measurable function $g$ such that&#xA;$$g_t(t,x) + g_x(t, x) \mu(t,x) + \frac{1}{2} g_{xx}(t,x)\sigma(t,x)^2 = 0$$&#xA;with an appropriate boundary condition $h$: $g(T,x) = h(x)$. We also know that $g(t,x)$ is of the form&#xA;$$g(t,x)=\mathbb{E}\left[h(X_T) \big| X_t=x\right].$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means that I can price an option with payoff function $h(x)$ at $T$ by solving the differential equation without regard to the stochastic process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an intuitive explanation how it is possible to model the stochastic behaviour of the Ito-process by a differential equation, even though the differential equation does not have a stochastic component?&lt;/p&gt;&#xA;" OwnerDisplayName="user1157" LastEditorUserId="4910" LastEditorDisplayName="user1157" LastEditDate="2015-12-14T19:41:09.307" LastActivityDate="2018-01-21T21:14:26.170" Title="Is there an intuitive explanation for the Feynman-Kac-Theorem?" Tags="&lt;brownian-motion&gt;&lt;differential-equations&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="25" ContentLicense="CC BY-SA 3.0" />
  <row Id="10360" PostTypeId="2" ParentId="10359" CreationDate="2014-02-25T09:51:07.563" Score="9" Body="&lt;p&gt;The Feynman-Kac theorem primarily makes sense in a pricing context.  If you know that some function solves the Feynman-Kac equation you can represent it's soluation as an Expectation with respect to the process. (&lt;a href=&quot;http://www.frouah.com/finance%20notes/The%20Feynman-Kac%20Theorem.pdf&quot; rel=&quot;noreferrer&quot;&gt;confer this document&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand a pricing function solves the FK-PDE. Thus often one would try solving the PDE to get a closed form pricing formula. (&lt;a href=&quot;http://www.iam.uni-bonn.de/people/ankirchner/lectures/OP_WS1314/OP_chap_three.pdf&quot; rel=&quot;noreferrer&quot;&gt;confer this document starting with page 22&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You wouldn't use the Feynman-Kac to simulate a stochastic process. On the other hand you can use a stochastic process in order to find a solution to the FK-PDE (&lt;a href=&quot;http://www.cs.fsu.edu/~mascagni/mcpdenew.pdf&quot; rel=&quot;noreferrer&quot;&gt;see here&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 26.02.2014:&lt;/strong&gt;&#xA;I found a document that tries to explain the connection between the transition density and the FK-PD ( &lt;a href=&quot;http://www.math.ucla.edu/~samxu/FeynmanKac.pdf&quot; rel=&quot;noreferrer&quot;&gt;see here starting with page 5&lt;/a&gt;) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also there is a connection between the FK-Formula and the Sturm-Liouville equations that can be used for the decomposition of Brownian paths. (&lt;a href=&quot;http://www.maths.univ-evry.fr/pages_perso/jeanblanc/pubs/jpy_kk.pdf&quot; rel=&quot;noreferrer&quot;&gt;see this paper&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="7279" LastEditDate="2014-02-26T14:51:12.880" LastActivityDate="2014-02-26T14:51:12.880" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10362" PostTypeId="1" AcceptedAnswerId="10363" CreationDate="2014-02-25T10:11:18.190" Score="2" ViewCount="1404" Body="&lt;p&gt;I'm working with sovereign ratings at present. With regard to Moody's there are a few things unclear to me in their definitions. Both questions refer to the sovereign rating history in Bloomberg CSDR (&lt;code&gt;Foreign Currency LT debt&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;What does a &lt;code&gt;(P)&lt;/code&gt; prefix indicate? Example (taken from Cyprus): &lt;code&gt;(P)Caa3&lt;/code&gt;, &lt;code&gt;(P)B3&lt;/code&gt; and &lt;code&gt;(P)Ba3&lt;/code&gt;. It is not clear to me what this prefix indicates and I couldn't find any explanation in their methodolgy. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What does the rating &lt;code&gt;WR&lt;/code&gt; stand for?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="7350" LastActivityDate="2014-02-25T11:05:54.313" Title="Moody's Sovereign Ratings: Clarification on Definitions and Symbols" Tags="&lt;historical-data&gt;&lt;database&gt;&lt;bloomberg&gt;&lt;credit-ratings&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10363" PostTypeId="2" ParentId="10362" CreationDate="2014-02-25T11:05:54.313" Score="4" Body="&lt;p&gt;(P) prefix : As a service to the market and typically at the request of an issuer, Moody's will assign a provisional rating when it is highly likely that the rating will become final after all documents are received, or an obligation is issued into the market.  A provisional rating is denoted by placing a (P) in front of the rating. Such ratings may also be assigned to shelf registrations under SEC rule 415. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;WR is the Rating withdrawn for reasons including: debt maturity, calls, puts, conversions, etc., or business reasons (e.g. change in the size of a debt issue), or the issuer defaults&lt;/p&gt;&#xA;" OwnerUserId="7351" LastActivityDate="2014-02-25T11:05:54.313" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10365" PostTypeId="2" ParentId="10347" CreationDate="2014-02-25T14:27:28.393" Score="0" Body="&lt;p&gt;&lt;strong&gt;Hint&lt;/strong&gt;&#xA;The future world has 4 states: $(0.5,0.5), (2,0.5), (0.5,2), (2,2)$. You have 4 instruments - cash, each stock, and an option they are both \$2 which is traded. Take $x,y,z,w$ of each and match the portfolio to the price of the option in each market state.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You get 4 equations and 4 unknowns, solve, and supposedly you get a unique solution, which immediately yields the replicating portfolio.&lt;/p&gt;&#xA;" OwnerUserId="3029" LastActivityDate="2014-02-25T14:27:28.393" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10366" PostTypeId="1" AcceptedAnswerId="10368" CreationDate="2014-02-25T14:37:53.290" Score="0" ViewCount="8877" Body="&lt;p&gt;Similar to &lt;a href=&quot;https://quant.stackexchange.com/questions/739/are-public-historical-time-series-available-for-ratings-of-sovereign-debt]&quot;&gt;an earlier question&lt;/a&gt;, I am now looking at S&amp;amp;P's sovereign ratings. Here, as in the case of Moody's, a few things are unclear to me in terms of the definitions used by Standard &amp;amp; Poor's.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Several sovereign ratings (Foreign Currency LT Debt, obtained through &lt;code&gt;CSDR&lt;/code&gt; in Bloomberg Terminal), contain a suffix &lt;code&gt;u&lt;/code&gt;. For the case of Belgium, example given, ratings are denoted as &lt;code&gt;AAu&lt;/code&gt; or &lt;code&gt;AA+u&lt;/code&gt;. What does the &lt;code&gt;u&lt;/code&gt; stand for? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What does the rating &lt;code&gt;SD&lt;/code&gt; stand for?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="7350" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-11-11T12:35:49.967" Title="S&amp;P's Sovereign Ratings: Clarification on Definitions and Symbols" Tags="&lt;historical-data&gt;&lt;database&gt;&lt;bloomberg&gt;&lt;credit-ratings&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10367" PostTypeId="2" ParentId="10359" CreationDate="2014-02-25T14:54:19.717" Score="15" Body="&lt;p&gt;&lt;strong&gt;Martingales + Markovian&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the motivation. Conditional expectations are martingales by the tower property of conditional expectations (an easy exercise to show). Suppose $r=0$, by the risk neutral pricing theorem $E^\star\left[h(X_T)\bigg|\mathscr{F}_t,\,X_t=x\right]$ is the price of any derivative security with $X$ as the underlying asset and payoff function $h$ assuming for the moment that the underlying security and the derivative itself pay no intermediate cashflows. In a Markovian setting, it must be the case that the price of the derivative is a measurable function of the current asset price and the time to maturity only, say a function $g(t, x)$. Then, by Ito's lemma $d(g(t, x))=\ldots$. Because $g$ is a (shifted) martingale, &lt;em&gt;the drift term must be equal to zero&lt;/em&gt;. The boundary condition comes from no arbitrage, see this by noticing what is $g(T, x)$ from the definition given at first (remember measurability when taking conditional expectation).&lt;/p&gt;&#xA;" OwnerUserId="4910" LastActivityDate="2014-02-25T14:54:19.717" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10368" PostTypeId="2" ParentId="10366" CreationDate="2014-02-25T15:47:20.787" Score="1" Body="&lt;p&gt;SD is selective default&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.reuters.com/article/2013/06/28/us-cyprus-downgrade-standardandpoors-idUSBRE95R0YQ20130628&quot; rel=&quot;nofollow&quot;&gt;http://www.reuters.com/article/2013/06/28/us-cyprus-downgrade-standardandpoors-idUSBRE95R0YQ20130628&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;+u is unsolicited rating&#xA;&lt;a href=&quot;http://lexicon.ft.com/Term?term=unsolicited-rating&quot; rel=&quot;nofollow&quot;&gt;http://lexicon.ft.com/Term?term=unsolicited-rating&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1215" LastActivityDate="2014-02-25T15:47:20.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10369" PostTypeId="2" ParentId="10332" CreationDate="2014-02-25T16:23:02.270" Score="1" Body="&lt;p&gt;For dividends, you could pull the info from dividend futures, or use the implied dividends backed out via put-call parity.  Risk-free rates you can get from whatever yield curve you are using for discounting, or more generally (as Raphael mentioned) using whatever your specific funding curve is.&lt;/p&gt;&#xA;" OwnerUserId="3491" LastActivityDate="2014-02-25T16:23:02.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10370" PostTypeId="2" ParentId="10359" CreationDate="2014-02-25T16:30:26.860" Score="4" Body="&lt;p&gt;The way I think of it is that the PDE describes the flow of a time dependent probability distribution. The stochastic process describes individual realisations (random walks with a drift), but if you ran a large number of them you'd build up a distribution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The PDE says how that distribution changes in time (first term) due to deterministic drift (the second term) and diffusion (the third term, which is the link between 'lots of random walkers' and the spreading probability distribution which describes how far they've got, on average). Usually the probability distribution starts off as a delta function due to the known initial condition.&lt;/p&gt;&#xA;" OwnerUserId="7356" LastActivityDate="2014-02-25T16:30:26.860" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10371" PostTypeId="1" CreationDate="2014-02-25T16:42:29.033" Score="1" ViewCount="142" Body="&lt;p&gt;I'm trying to wrap my head around what happens to the net interest received when an invester goes short a bond future to fully hedge the duration of his long position in an actual bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does it effectively neutralize duration while still paying him a fixed rate? Or does the math work out such that he ends up effectively receiving the equivalent of a floating rate, as he would if he hedged duration with a fixed-floating swap?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume the following for simplicity:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Coupons are paid out continuously, not semi-annually&lt;/li&gt;&#xA;&lt;li&gt;The bond is priced at par and coupon rate is the risk free rate&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;To be clear, he doesn't just short the same number of bond-futures as bonds he's holding because that just means he hedged the duration of the principal but not the coupons. He has to short a bit more than the number of bonds he is long by, right? So, if the rates spike up, his long bond position decreases in market value, but his short bond future position increases in market value MORE, effectively giving him gains equivalent to being long a floating rate?&lt;/p&gt;&#xA;" OwnerUserId="7355" LastActivityDate="2014-02-25T16:42:29.033" Title="How do bond futures affect effective rate when used to hedge a bond's duration?" Tags="&lt;interest-rates&gt;&lt;futures&gt;&lt;duration&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10372" PostTypeId="2" ParentId="10345" CreationDate="2014-02-25T16:46:06.337" Score="5" Body="&lt;p&gt;&lt;strong&gt;TLDR: Massive expansion of credit fuelled by rehypothecation, a general shift to repo, then the scale tips and everyone pays as credit collapses. Quants were there, but I don't think they can be simply blamed for all the ills of the world&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a general disagreement about what caused what, so some of this is guesswork. I'm marking this a community wiki so that other users can correct my mistakes, and so I don't get downvoted to oblivion for saying something stupid. This is just a starting point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the 90s there was a boom - rates were high, credit risks were lowish and demand was high for high-return investments to beat inflation and bond returns. In order to facilitate lending in this environment, quants began to rehypothecate assets with lower ratings into higher-rated  assets via tranching; by combining a portfolio of variable quality assets into a vehicle that defaults on one tranche first, then the next, you can reserve the best tranche as a high quality asset. These now-acceptable high-rated assets could be used for repo (repurchase) collateral, and permitted a vast expansion of the repo markets as the pool of available capital exploded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rehypothecation process expanded into mortgages; by bundling and tranching residential mortgages, another vast pool of variable-quality assets could yield highly-rated collateral. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this usage of repo brought with it another change; quants were increasingly using credit instruments to pin down and insure against counterparty risk. This increased awareness of counterparty risk as part of trading pushed interbank lending in the 00s away from cash-based lending and toward collateralisation. Yet the market still behaved as though 3m cash rates were a good indicator of funding costs, and specifically the Libor/Euribor indices were accurate measures of those rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This sets the stage, then; a large repo-funded expansion of credit, where the repo collateral is largely rehypothecated debt based on commercial paper, mortgages, bonds and anything else that could be bought and tranched. Because of all this available credit, and the high value placed on any asset that could be sold, lenders expanded into subprime mortgages, among other things, and standards for borrowers slipped. Many businesses by this point had opted to sell and lease back assets or run on low cash margins as overnight and short-term lending was easy to obtain and enabled more aggressive business practices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where are the quants? Sitting happily with complex models which assured them that something very unusual would have to happen for their hedges to go wrong, or their counterparty protection to dry up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The trigger came when an increasing number of those subprime borrowers began to default; banking had undergone a transition from an austere and risk-averse business to a highly retail-oriented one, and mortgages had been offered with low introductory rates. When borrowers transitioned to the higher rates after introductory periods, they began to default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What followed was an avalanche of downgrades; first subprime mortgages were being downgraded. That, itself, wasn't too much of a problem - the number and proportion of subprime mortgages was not huge. But what it did do was drag down the ratings of mortgage-backed assets. The repo system is based on the ratings of collateral, not the actual type, so as this class of assets dropped below required grades, institutions had to start withdrawing other asset classes to replace them. But this pulled the rug from under some institutions who were overexposed, and &lt;em&gt;their&lt;/em&gt; ratings started to fall. The greatly-expanded pool of repo collateral and thus created money began a sudden contraction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the pace of this contraction accelerated, a lot of quant models started to fall apart. The size of the movements was outside the scope of normal or lognormal models, and the interdependency of risks was suddenly realised. An unfortunate position where much of the insurance against counterparty risk was backed by a small pool of underwriters like AIG meant that not only had counterparty risk suddenly spiked, but the value of the insurance dropped.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Credit contracted ever more quickly, taking company after company and institution after institution with it. But the remaining players held OTC instruments with other counterparties and there was no transparency regarding exposure. All remaining un-collateralised lending dried up, because a bank could not tell who had now-toxic positions and the chances were that whoever wanted to borrow was a liability. The credit contraction, caused company failures and then job losses, which caused the economic outlook to worsen, and the rest of the market (outside credit and money) turned to a bear market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the natural sciences, the laws of the universe are unchanging and impervious to the experiments you do on them. Momentum appears to be universally conserved. In finance, however, all the models are based on what the quants can see in the market, and the market is always changing. The boom lasted so long that the market fundamentally changed its construction - unsecured lending was no longer the normal way to do business, which had made collateral itself the keystone of liquidity. The models, which had been back-tested and so on, were not built to handle all of the above occurring together; there were quotes like the amazing one from Viniar, CFO of Goldman: “We were seeing things that were 25-standard deviation moves, several days in a row,” - if you're seeing 25 standard deviations at all, your model is broken.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is possible to blame quants for a lot of stages here; for misunderstanding the risks, for creating the world of rehypothecation, for missing the correlations between risks, etc. But remember that beneath the bubbles were trends; the internet and electronic communication were spreading across the globe, business practices were changing, the sophistication of financial models was blossoming. Inside a bubble, everything feels like a trend; the shift to collateralised lending must have felt, if anything, like a reduction in risk rather than an increase, particularly if you compared a portfolio based on unsecured lending with minimal counterparty protection with one fully collateralised with sophisticated hedges against various counterparty risks.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2014-02-25T16:46:06.337" CommentCount="2" CommunityOwnedDate="2014-02-25T16:46:06.337" ContentLicense="CC BY-SA 3.0" />
  <row Id="10373" PostTypeId="1" AcceptedAnswerId="10375" CreationDate="2014-02-25T20:18:09.483" Score="3" ViewCount="190" Body="&lt;p&gt;Engle's comment in his seminal paper &lt;a href=&quot;http://www.nobelprize.org/nobel_prizes/economic-sciences/laureates/2003/engle-lecture.pdf&quot; rel=&quot;nofollow&quot;&gt;&quot;Risk and Volatility: Econometric models and Financial Practice&quot;&lt;/a&gt; mentions that&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I had recently worked extensively with the Kalman Filter and&#xA;  knew that a likelihood function could be decomposed into the sum of its predictive&#xA;  or conditional densities.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What is the significance of this statement? Could someone elaborate what this means and how this can be used?&lt;/p&gt;&#xA;" OwnerUserId="7359" LastEditorUserId="2379" LastEditDate="2014-02-26T15:52:18.253" LastActivityDate="2014-02-26T15:52:18.253" Title="Time-Varying Volatility and Conditional Likelihood" Tags="&lt;volatility&gt;&lt;garch&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10374" PostTypeId="1" CreationDate="2014-02-25T20:42:32.080" Score="0" ViewCount="55" Body="&lt;p&gt;What is shorting a asset that has negative price.&#xA;Can anyone give me an example?&lt;/p&gt;&#xA;" OwnerUserId="7269" LastActivityDate="2014-02-25T20:54:49.817" Title="What is shorting a asset that has negative price. Can anyone give me an example?" Tags="&lt;general&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2014-05-04T08:03:19.993" ContentLicense="CC BY-SA 3.0" />
  <row Id="10375" PostTypeId="2" ParentId="10373" CreationDate="2014-02-25T20:48:24.840" Score="4" Body="&lt;p&gt;Basically he's just saying that you don't have to estimate parameters assuming they're the same in every period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Arch and Garch parameters are typically estimated via maximum likelihood. In MLE, parameters are estimated by &#xA;$$&#xA;\theta  \equiv argmax\left\{ \sum_{t=1}^{T}ln\left(f\left(x_{t}|\theta\right)\right)\right\}&#xA;$$&#xA;where $\theta$ are some parameters and $f(x)$ is the probability density function. Note that this applies the same $\theta$ to each of the different $x$'s. A Kalman filter is often used for modelling time-varying coefficients. In that case, the distribution is different in every period. So it's like adjusting the above to&#xA;$$&#xA;\theta  \equiv argmax\left\{ \sum_{t=1}^{T}ln\left(f\left(x_{t}|\mu_{t}, \sigma&#xA; \right)\right)\right\}&#xA;$$&#xA;where the $\mu_{t}$ represents the mean of a distribution as it changes in time based on the Kalman filter. The logic can be extended to the Arch/Garch case. However, instead of focusing on a time-varying mean, they are focusing on a time-varying variance. So it might instead look something like&#xA;$$&#xA;\theta  \equiv argmax\left\{ \sum_{t=1}^{T}ln\left(f\left(x_{t}|\mu, \sigma_{t}&#xA; \right)\right)\right\}&#xA;$$&#xA;where $\sigma_{t}$ is conditional on the parameters $\theta$ that would be estimated as part of the Garch process.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2014-02-25T20:48:24.840" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10376" PostTypeId="1" CreationDate="2014-02-25T20:50:46.223" Score="2" ViewCount="2943" Body="&lt;p&gt;After I ftp into the SEC Edgar site (ftp.sec.gov) I am able to pull the appropriate financial statements (i.e., 10-k, 10-q, 8-k, etc.) onto my local computer. However, when I go to open these files, I can't seem to make much sense of them. There are large parts of the files which look like garbage.  These parts usually occur after the following tag: begin 644 Financial_Report.xls.  This looks like it corresponds to the an excel file that for some reason is then embedded into the xbrl.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I grabbing the right files and am I looking at them correctly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, one of the 8-k's that I grabbed was the following (you can paste this into a browser) and if you go halfway down, there's quite a bit of garbage there. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;ftp://ftp.sec.gov/edgar/data/1112412/0001193125-13-028328.txt&quot; rel=&quot;nofollow&quot;&gt;ftp://ftp.sec.gov/edgar/data/1112412/0001193125-13-028328.txt&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&#xA;BK&lt;/p&gt;&#xA;" OwnerUserId="7360" LastActivityDate="2014-03-25T20:32:46.803" Title="Reading XBRL Data from the SEC FTP SITE" Tags="&lt;ftp&gt;&lt;edgar&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10377" PostTypeId="2" ParentId="10374" CreationDate="2014-02-25T20:54:49.817" Score="3" Body="&lt;p&gt;Three examples would be spreads, butterflies, and double-butterflies.  They can all have negative prices.  Reverse the sign of the quantity on all the legs and you're short the synthetic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the Jan-Feb calendar spread would buy 1 Jan and sell 1 Feb contract.  If you wanted to be short the spread, you would sell 1 Jan and buy 1 Feb contract.&lt;/p&gt;&#xA;" OwnerUserId="56" LastActivityDate="2014-02-25T20:54:49.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10379" PostTypeId="1" CreationDate="2014-02-25T22:38:49.597" Score="0" ViewCount="780" Body="&lt;p&gt;Is there an alternative to Bloomberg for someone who only needs historical data (stocks, futures, indices) as well as what Bloomberg calls 'reference data' - i.e. what is the multiplier of ESU4, what is the ticker of the 3rd VIX future, what is the cost of a given ETF, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most providers I have found only supply historical price data and not much else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="290" LastActivityDate="2021-03-25T10:23:54.337" Title="Bloomberg Alternative for Quant Fund" Tags="&lt;data&gt;&lt;historical-data&gt;&lt;bloomberg&gt;" AnswerCount="5" CommentCount="7" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10380" PostTypeId="1" CreationDate="2014-02-25T22:46:31.437" Score="1" ViewCount="233" Body="&lt;p&gt;The one period market model is made of 4 securities(A, B, C, D) and has 4 future states.&#xA;Assume the market model is complete. and the state prices are (-2, 2, 4, 8).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given that I dont know the payoff of each security in each state; neither do i know the spot price of each security.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I find an arbitrage opportunity?&lt;/p&gt;&#xA;" OwnerUserId="7269" LastEditorUserId="7269" LastEditDate="2014-02-25T23:03:18.380" LastActivityDate="2014-02-25T23:03:18.380" Title="What is the arbitrage opportunity in Arrow-Debreu One Period market Model" Tags="&lt;homework&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10381" PostTypeId="1" CreationDate="2014-02-26T01:35:12.387" Score="3" ViewCount="413" Body="&lt;p&gt;An ARCH (autoregressive conditional heteroscedastic) (1) model is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_t=\mu +a_t$, where $a_t=$return residual, and $\mu$ is the drift of the stock return&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$a_t=\sigma_t\epsilon_t$, where $\sigma_t=$standard deviation at time $t$ and $\epsilon_t=$ white noise&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma_t^2=\alpha_0+\alpha_1a_{t-1}^2$, where $\alpha_1&amp;lt;1$ so that the process is stationary&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Random walk 3 states that returns are dependent but uncorrelated, such that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Cov(\epsilon_t,\epsilon_{t-k})=0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Cov(\epsilon_t^2,\epsilon_{t-k}^2)\neq0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we take the square root of $\sigma^2$, then $\sigma_t=\sqrt{\alpha_0+\alpha_1a_{t-1}^2}$ so $a_t=\sqrt{\alpha_0+\alpha_1a_{t-1}^2}\epsilon_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore the dependence of $a_t$ and $a_{t-1}$ is nonlinear, therefore they are uncorrelated but dependent, and satisfies RW3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone confirm if this looks correct?&lt;/p&gt;&#xA;" OwnerUserId="7303" LastActivityDate="2014-03-05T10:03:00.013" Title="How come the existence of ARCH effect is not a violation of Random Walk Hypothesis 3?" Tags="&lt;garch&gt;&lt;random-walk&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10382" PostTypeId="2" ParentId="10346" CreationDate="2014-02-26T02:30:51.753" Score="2" Body="&lt;p&gt;Let's say your return realization for path $i$ is $r_i = \beta\cdot f_i$, where $f_i=(f_{1i}, f_{2i}, f_{3i})$ - factors realizations, and $\beta$ - factor coefficients. So, your VaR is $VaR=percentile(r_i,\alpha)$, where $\alpha$ - confidence.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The simplest Monte Carlo stopping criterion is to keep adding paths $i$ and computing VaR on the growing sample until VaR &quot;stops changing&quot;. For instance you can keep track of the MAX change in VaR during the last N paths, and wait until it becomes smaller than the required tolerance.&lt;/p&gt;&#xA;" OwnerUserId="7365" LastActivityDate="2014-02-26T02:30:51.753" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10383" PostTypeId="1" CreationDate="2014-02-26T06:51:17.583" Score="2" ViewCount="194" Body="&lt;p&gt;i have 3 currencies AUD, USD and EU&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to work out the mathematical formula to work out if there is a spread/arbitrage opportunity as well as the maximum amount that can be conducted ( for instance, if transferring from USD to EUR is limited by $100USD, then that is the limiting factor).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;here is a wiki describing the transaction flow &lt;a href=&quot;https://en.wikipedia.org/wiki/File:Triangular-arbitrage.svg&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/File:Triangular-arbitrage.svg&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7366" LastActivityDate="2014-02-26T06:51:17.583" Title="Triangular Arbitrage formula" Tags="&lt;research&gt;" AnswerCount="0" CommentCount="1" ClosedDate="2014-02-27T00:22:28.143" ContentLicense="CC BY-SA 3.0" />
  <row Id="10384" PostTypeId="2" ParentId="10338" CreationDate="2014-02-26T09:36:30.400" Score="2" Body="&lt;p&gt;First let's recapitulate:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The market is free of arbitrage if (and only if) there exists a&#xA;martingale measure; &lt;/li&gt;&#xA;&lt;li&gt;The market is complete if and only if the&#xA;martingale measure is unique; &lt;/li&gt;&#xA;&lt;li&gt;In an arbitrage-free market, not&#xA;necessarily complete, the price of any attainable claim is uniquely&#xA;given, either by the value of the associated replicating strategy, or&#xA;by the risk neutral expectation of the discounted claim pa yoff under any of the equivalent (risk-neutral) martingale measures.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;It is hard to make an assumption on the existence of an equivalent martingale measure if the market dynamics are not given (e.g. if you don't know what stochastic processs drives the underlying asset)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Showing that an equivalent martingale measure exists depends on the setting. A lot has been researched here. I can &lt;a href=&quot;http://www.aefin.es/AEFIN_data/articulos/pdf/A21-2_953713.pdf&quot; rel=&quot;nofollow&quot;&gt;recommend the following paper&lt;/a&gt; that gives a decent overview. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $S_t$ be the stock process. If $r=0$ and if there is an equivalent martingale measure $Q$ than $S_t exp(-rt)$=$S_t$ must be a martingale (due to $r=0$ we have no discounting). Thus $\mathbb{E}^Q[S_t]=S_0$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $P_t$ be the porflio we use to hedge the claim. For us to create an arbitrage $P_0=0$ and $\mathbb{P}(P_T\geq 0)=1$ at some time $T$ in the future must hold. If we were to finance $w$-shares of the stock by borrowing our portfolio would be $P_0=wS_0 - wS_0=0$. At every time $t$ in the future the expected return will be $\mathbb{E}^Q[wS_t - wS_0]=0$. Now $S_t$ is a martingale. This means that $\forall t , \mathbb{P}(S_t&amp;lt;S_0)&amp;gt;0$. For if  $\mathbb{P}(S_t&amp;lt;S_0)=0$ for some $t$ it would follow that $\mathbb{E}^Q[S_0]&amp;lt;\mathbb{E}^Q[S_t]$ and $S_t$ would not be a martingale. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means that you always have a positive probility of loss nomatter how long you keep your stock (denoted by $\forall t , \mathbb{P}(S_t&amp;lt;S_0)&amp;gt;0$) Thus the arbitrage you constructed above can not exist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note that in above setting the price your instrument would be $\mathbb{E}^Q[0.01 \cdot S_\tau]=0.01 \cdot S_0=0.01 \cdot 75=0.75$. I used &lt;a href=&quot;http://en.wikipedia.org/wiki/Optional_stopping_theorem&quot; rel=&quot;nofollow&quot;&gt;optional sampling&lt;/a&gt; here (with $\tau$ being the stopping time of $S_t$ reaching $100$). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alose note that I use $\mathbb{E}^Q[0.01 \cdot S_\tau]$ for $0.01 \cdot S_t$ is the porfolio that replicates the payout and as you know price of the instrument equals price of hedging etc.&lt;/p&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="7279" LastEditDate="2014-02-26T10:13:16.557" LastActivityDate="2014-02-26T10:13:16.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10385" PostTypeId="2" ParentId="10334" CreationDate="2014-02-26T11:33:46.410" Score="0" Body="&lt;p&gt;Why don't you try&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.bankofengland.co.uk/markets/Pages/forex/fxjsc/default.aspx&quot; rel=&quot;nofollow&quot;&gt;http://www.bankofengland.co.uk/markets/Pages/forex/fxjsc/default.aspx&lt;/a&gt;&lt;br&gt;&#xA;&lt;a href=&quot;http://www.ny.frb.org/markets/foreignex.html&quot; rel=&quot;nofollow&quot;&gt;http://www.ny.frb.org/markets/foreignex.html&lt;/a&gt;&lt;br&gt;&#xA;&lt;a href=&quot;http://www.aciforex.org/&quot; rel=&quot;nofollow&quot;&gt;http://www.aciforex.org/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but the thing about FX order flow is there are so many order types: prices/quotes, natural flow, hedging, to mention just a few.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2014-02-26T11:33:46.410" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10386" PostTypeId="1" CreationDate="2014-02-26T12:27:54.233" Score="1" ViewCount="182" Body="&lt;p&gt;If I am not wrong, EURIBOR3M futures with maturity $T$, whose price is $F_{T}$, are quoted like contracts which express the underlying forward rates, $r_{T}$, as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_{T}=\frac{100-F_{T}}{100}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now consider a generic Call option, with strike $K$ and maturity $T$, written on EURIBOR3M futures, and its implied volatility, that is $\sigma(T,K)$; you could also consider an historical estimator of $F_{T}$ volatility, like its log-differences rolling standard deviation, which would return $v(T)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, here's the question: how would you define the volatility of $r_{T}$ knowing the volatility of $F_{T}$ and their relationship expressed above? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S.: it should be a function of $\sigma(T,K)$ or $v(T)$, because, if I am right, it must be&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_{T,t}-r_{T,t-1}=\frac {F_{T,t-1}- F_{T,t}}{100}$$&lt;/p&gt;&#xA;" OwnerUserId="3058" LastActivityDate="2014-02-26T12:27:54.233" Title="What's the link between EURIBOR3M futures volatility and rates volatility?" Tags="&lt;volatility&gt;&lt;interest-rates&gt;&lt;futures&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10387" PostTypeId="1" AcceptedAnswerId="10389" CreationDate="2014-02-26T15:32:21.767" Score="4" ViewCount="229" Body="&lt;p&gt;Engle comments in &lt;a href=&quot;http://www.nobelprize.org/nobel_prizes/economic-sciences/laureates/2003/engle-lecture.pdf&quot; rel=&quot;nofollow&quot;&gt;&quot;Risk and Volatility: Econometric models and Financial Practice&quot;&lt;/a&gt; that&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If the price of risk were constant over time, then rising conditional&#xA;  variances would translate linearly into rising expected returns. Thus&#xA;  the mean of the return equation would no longer be estimated as zero,&#xA;  it would depend upon the past squared returns exactly in the same way&#xA;  that the conditional variance depends on past squared returns. This&#xA;  very strong coefficient restriction can be tested and used to estimate&#xA;  the price of risk. It can also be used to measure the coefficient of&#xA;  relative risk aversion of the representative agent under the same&#xA;  assumptions.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What return equation is he referring to? What else is being described here?&lt;/p&gt;&#xA;" OwnerUserId="7359" LastEditorUserId="12" LastEditDate="2014-02-26T18:13:24.947" LastActivityDate="2014-02-27T03:32:33.607" Title="What return equation is Engle referring to in his Nobel lecture?" Tags="&lt;volatility&gt;&lt;garch&gt;&lt;econometrics&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10388" PostTypeId="2" ParentId="214" CreationDate="2014-02-26T15:39:14.983" Score="11" Body="&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/L%C3%A9vy_arcsine_law&quot; rel=&quot;noreferrer&quot;&gt;Levy's Arcsine Law&lt;/a&gt; for Brownian motion is quite paradoxical.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you should guess the amount of time a Brownian path spends above or below zero, which percentage of time would you intuitively assume to be the most probable?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would have guessed 50:50 above and below should be the most probable case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is wrong and Levy's Arcsine Law explains the correct distribution: Let the amount of time $T_t$ that Brownian motion spends in the positive half-line $[0,\infty)$ during the period $[0,t]$. Then for any $0\le p \le 1$ and any $t\ge 0$, we have&#xA;$$P(T_t\le p t)=\frac{2}{\pi}\arcsin \sqrt{p} = \int_0^p\frac{1}{\pi \sqrt{u(1-u)}}du.$$&#xA;The integral shows that the probability mass is &lt;strong&gt;minimal&lt;/strong&gt; for the 50:50 case! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following plot shows the probability distribution for $p$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/sj6iu.png&quot; alt=&quot;distribution of p&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The theorem can be shown using the Feynman-Kac representation theorem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more details see M. Steele's book Stochastic Calculus and Financial Applications.&lt;/p&gt;&#xA;" OwnerDisplayName="user1157" LastEditorUserId="70" LastEditDate="2014-06-26T18:31:29.293" LastActivityDate="2014-06-26T18:31:29.293" CommentCount="1" CommunityOwnedDate="2014-02-26T15:39:14.983" ContentLicense="CC BY-SA 3.0" />
  <row Id="10389" PostTypeId="2" ParentId="10387" CreationDate="2014-02-26T16:37:25.643" Score="4" Body="&lt;p&gt;The return equation is just an econometric equation that models stock returns (or other asset returns) as a function of: (i) intercept (i.e. the average return), (ii) some independent variables/features, (iii) noise that has zero mean and time-varying variance. There are sometimes other things in the return equation too that form more advanced models. The main difference between a return equation in this kind of modelling and in standard OLS is that the variance of the errors (and hence returns) is allowed to change over time, dropping the homoscedasticity assuption .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The return equation in ARCH/GARCH type models is usually given by $R(t) = \mu(t) + \epsilon(t)$, where $R(t)$ is the evenly spaced return, $\mu(t)$ is some intercept (perhaps $\mu(t) = \mu(z) \forall t \not=z \wedge t,z\in \mathbb{R}_+$ specifying the population expected return at time step $t$, and $\varepsilon(t) := \sigma(t) z(t) \sim D(0,\sigma(t)^2)$ is some heteroscedastic disturbance, whose direction is unpredictable but whose variance is predictable within some error. Such a prediction equation is given by a variance equation (as opposed to a return equation).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above is a simple return equation. You can have whatever you like. It is common to see $R(t) = \mu(t) + \sum_{i=1}^N \beta_i(t)f_i(X_i(t)) + \varepsilon(t)$ where $f_i$ is a transform (perhaps identity mapping), $X_i$ is a feature, $\beta_i(t)$ are time-varying or time-invariant factor loadings with their own distributions. Even more generally this equation can model a vector of returns and we would be entering the territory of MGARCH modelling. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my mind, this is all superseded by machine learning models. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe what he's talking about can and has been modelled as a GARCH-IN-MEAN model (GARCH-M), where the garch term makes a fancy appearance in the mean equation (ie the return equation). I believe this is what's used to analyse the dynamics between noise and informed traders in the academic literature. The most basic return equation you have above has it that $E[R(t)] = E[\mu(t)]$ &lt;strong&gt;&lt;em&gt;which is often set to zero a priori when modelling daily or higher frequencies&lt;/em&gt;&lt;/strong&gt;, thus leaving the modelled return equation as the zero mean $R(t) := z(t)\sigma(t)$. Or if this assumption is not made, the calibrated mean would be small for stocks. By supposing that $R(t)$ depends linearly and positively on $\sigma(t)$, and since $E[\sigma(t)]&amp;gt;0$, we can see what he means when he says the mean will no longer be zero in the return equation. The coefficient estimate on this term in the return equation can be interpreted as the compensation that investors need for holding an asset that gives them the risk inherent in $\sigma(t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the coefficient estimate is $&amp;gt;0$, we would say that we have suggestive evidence that the representative agent (a mathematical object whose properties/state are supposed to model the 'average' agent) is risk seeking, and risk averse for $&amp;lt;0$ estimate.&lt;/p&gt;&#xA;" OwnerUserId="6081" LastEditorUserId="6081" LastEditDate="2014-02-27T03:32:33.607" LastActivityDate="2014-02-27T03:32:33.607" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10390" PostTypeId="1" AcceptedAnswerId="10427" CreationDate="2014-02-26T18:28:19.993" Score="3" ViewCount="11748" Body="&lt;p&gt;I would like to calculate the Yearly Sharpe Ratio on &lt;a href=&quot;http://www.msci.com/products/indices/performance.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;MSCI World index&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have &lt;strong&gt;monthly values of the index&lt;/strong&gt; that falls back up to Jan/1970, hence about: &lt;strong&gt;44 years, 528 months&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to calculate Sharpe Ratio we need standard deviation of the yearly rate or returns, there are two ways to calculate this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Which one is the right way to calculate yearly sharpe ratio? 1 or 2 OR 3? And why?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;WAY 1)&lt;/strong&gt; I calculate &lt;strong&gt;rolling yearly rate of returns&lt;/strong&gt;, and then I simply calc the mean and the stddev&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just to make it clear, I calc the rolling yearly Rate of Returns (&lt;code&gt;RoR&lt;/code&gt;) in this way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;RoR1 = (Val(12) - Val(0)) / Val(0)&#xA;RoR2 = (Val(13) - Val(1)) / Val(1)&#xA;RoR3 = (Val(14) - Val(2)) / Val(2)&#xA;...&#xA;RoRN = (Val(N) - Val(N-12)) / Val(N-12)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;Val(N)&lt;/code&gt; is the value of the MSCI World index at time &lt;code&gt;N&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, we calc about &lt;strong&gt;&lt;code&gt;N-12 RoRs&lt;/code&gt;&lt;/strong&gt; which for my sample is &lt;strong&gt;516 RoRs&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I would just find the mean (&lt;code&gt;M&lt;/code&gt;) and the &lt;code&gt;stddev&lt;/code&gt; of the previously calulated &lt;code&gt;RoR&lt;/code&gt;s&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;WAY 2)&lt;/strong&gt; I calculate &lt;strong&gt;yearly rate of returns&lt;/strong&gt;, and then I simply calc the mean and the stddev&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just to make it clear, I calc the yearly Rate of Returns (&lt;code&gt;RoR&lt;/code&gt;) in this way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;RoR1 = (Val(12) - Val(0)) / Val(0)&#xA;RoR2 = (Val(24) - Val(12)) / Val(12)&#xA;RoR3 = (Val(36) - Val(24)) / Val(24)&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hence we calc about &lt;strong&gt;44 RoRs&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;WAY 3)&lt;/strong&gt; we calculate the yearly Sharpe ratio by using the mean and stddev of &lt;strong&gt;annualized monthly rate of returns&lt;/strong&gt; (see for instance &lt;a href=&quot;http://corporate.morningstar.com/IT/documents/MethodologyDocuments/MethodologyPapers/StandardDeviationSharpeRatio_Definition.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;this Morningstar paper that explains it&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this 3rd way adds a bit of complexity (&lt;a href=&quot;https://quant.stackexchange.com/questions/2260/&quot;&gt;and some arguments about whether is correct to annualize stddev by simply multiplying by sqrt of 12&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And I don't understand why would even someone look at this 3rd way, when way 1 or 2 could suffice.&lt;/p&gt;&#xA;" OwnerUserId="1466" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2014-03-02T02:16:08.347" Title="Sharpe Ratio, annualized monthly returns vs annual returns vs annual rolling returns?" Tags="&lt;sharpe-ratio&gt;&lt;mean&gt;&lt;standard-deviation&gt;&lt;annualized&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10391" PostTypeId="2" ParentId="2163" CreationDate="2014-02-26T19:53:15.197" Score="3" Body="&lt;p&gt;In terms of implied volatilities you will see that winter volatility carries a premium over summmer. Your vega hedging will be based on some sort of implied volatility correlational anaylsis between contract you are hedging and what you are hedging with.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Volatility surface will have peaks for winter months and troughs for summer months on the time dimension. Skew on a particular volatility is not affected by the premium of winter volatility over summer volatility.&lt;/p&gt;&#xA;" OwnerUserId="7359" LastActivityDate="2014-02-26T19:53:15.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10392" PostTypeId="1" AcceptedAnswerId="10393" CreationDate="2014-02-26T21:59:13.813" Score="1" ViewCount="1886" Body="&lt;p&gt;I was asked this in an interview and I messed it up lol. This might actually be really basic. Let's say I signed a forward contract to buy NASDAQ at 4000 one year from now. How can I hedge this cash flow?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was thinking of buying a put at 4000 strike, so that if S_t &gt;= 4000, I don't exercise the put and sell at market price, whereas if S_t &amp;lt; 4000, I exercise the put. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, this way I have a -P cash flow at time 0. I was thinking of borrowing P at time 0, but this means I have to pay more in the future. So I am not sure how to fully hedge the position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="5007" LastActivityDate="2014-02-27T02:15:32.233" Title="How to hedge a forward contract" Tags="&lt;options&gt;&lt;hedge&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10393" PostTypeId="2" ParentId="10392" CreationDate="2014-02-26T23:13:21.737" Score="1" Body="&lt;p&gt;&quot;However, this way I have a -P cash flow at time 0.&quot; - yes, and this is one of the ways to hedge a forward. There is no free lunch - you are cutting risks and paying the price of a put for it. Hedging is a process of limiting your risks, and you certainly can't guarantee a positive overall cashflow, but you do guarantee you won't loose more than P. By definition, it is hedging and your answer can't be claimed as completely wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the asker probably wanted you to know that NASDAQ is currently at over 4000 and so you can potentially go short (you can sell future with same expiration if it is over 4000) and then buy it back at lower price and thus exercising and arbitrage opportunity. I wonder if the price of the forward has been mentioned because if it is assumed free, the question is really a bit weird. Usually there is no arbitrage and you can do the same thing at a small loss, it doesn't make any sense when talking about NASDAQ, but does make sense if you are talking about commodities when you want something delivered and don't want to overpay in the future, but also don't want to use option because you also don't want to speculate. &lt;/p&gt;&#xA;" OwnerUserId="5086" LastEditorUserId="5086" LastEditDate="2014-02-27T02:15:32.233" LastActivityDate="2014-02-27T02:15:32.233" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="10394" PostTypeId="1" AcceptedAnswerId="10404" CreationDate="2014-02-27T01:45:36.200" Score="4" ViewCount="1699" Body="&lt;p&gt;I'm trying to build an intuitive understanding of the following&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The price of the replicating portfolio at time $t$ of the floating rate receiver is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P_t^{swap}=P_{t,t_0}-P_{t,t_N}-\bar{R}\sum_{n=1}^N(t_n-t_{n-1})P_{t,t_n}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Some notation:&#xA;$\bar{R}$ is the fixed rate.&#xA;$P_{t,t_n}$ is the value at time $t$ of a zero coupon bond with maturity $t_n$. And we have future times $t_0,…,t_N$.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My understanding of this is still very young and I have several questions as a result:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So is $P_t^{swap}$ essentially the money it would take to buy the side of the swap (at time $t$) that receives the floating rate, and therefore pays out the fixed rate? e.g. if $P_t^{swap}=0$, you wouldn't make money or lose money in entering this swap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As we're the floating rate receiver here, we have to pay out the fixed rate every $t_n$ and hence the final term in the expression? It's just been modelled as a sum of zero coupon bonds?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What does $P_{t,t_0}-P_{t,t_N}$ really mean? The value of a zero coupon bond maturing at time $t_0$ minus the value of a zero coupon bond maturing at time $t_n$ (I hope that's right to say) it surely always $&amp;gt;0$, as who would rather buy a zero coupon bond that matures at a later time? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And finally, how is the combination of these three terms the value of the floating rate receiver's replicated portfolio? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope it's clear what these questions mean and apologies for anything I've missed.&lt;/p&gt;&#xA;" OwnerUserId="7375" LastEditorUserId="12240" LastEditDate="2016-08-22T07:55:26.333" LastActivityDate="2016-08-22T07:55:26.333" Title="Plain Vanilla Interest Rate Swap" Tags="&lt;swaps&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10395" PostTypeId="1" CreationDate="2014-02-27T04:23:11.040" Score="2" ViewCount="381" Body="&lt;p&gt;I am trying to calculate the historical PE ratios of a stock, but which date should I use to get the stock price in calculating the PE ratio?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current approach is to use the stock price of a day after the stock's financial results are released. My rationale is the market will take a day to react to the stock's financial results, and the stock price will adjust accordingly, assuming that the market is efficient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if the stock's financial earning is annouced on 1 Feb 2010, I will take the stock price on 2 Feb 2010 to calculate the PE ratio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this make sense?&lt;/p&gt;&#xA;" OwnerUserId="2700" LastEditorUserId="2700" LastEditDate="2014-03-01T14:06:16.723" LastActivityDate="2014-03-01T15:00:16.693" Title="Best practice approach for calculating the PE-ratio" Tags="&lt;equities&gt;&lt;valuation&gt;&lt;fundamentals&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10397" PostTypeId="2" ParentId="10379" CreationDate="2014-02-27T06:56:36.610" Score="6" Body="&lt;p&gt;Here is what you can definitely use: Thomson Reuters Eikon&lt;/p&gt;&#xA;" OwnerUserId="5821" LastActivityDate="2014-02-27T06:56:36.610" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10398" PostTypeId="2" ParentId="10394" CreationDate="2014-02-27T11:01:06.747" Score="5" Body="&lt;p&gt;To explain it I will need some preliminaries. A forward starting payer swap (or receiver swap of the floating leg) is an instrument where the holder pays fixed and receives floating at some predetermined points in time in the future. (The payment/exhange dates of fixed and floating could differ - e.g. the fixed leg is paid annualy and the floating is paid semi-annualy)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we introduce the simply compounded forward interest rate for $T&amp;gt;S$,  $F(t,T,S)=\frac{1}{T-S}(\frac{P(t,S)}{P(t,T)}-1)$. Thus the rate prevailing at time $t$ for the expiry $S&amp;gt;t$ and maturity $T&amp;gt;t$. (The rate you would receive if you decided at $t$ to lend money at $S$ for a duration of $T-S$)&#xA;&lt;strong&gt;These are the floating rates.&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value of a Swap is $leg_{fixed}-leg_{floating}$. Assuming a fixed rate of $K$, a notional $N=1$ and that fixed and floating are paid at the same times $(t_1,\dots t_n)$ you have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Formula&lt;/strong&gt; $(*)$:  $P^{swap}_t=\sum_{i=1}^{n}(t_i-t_{i-1}) P(t,t_i)(F(t,t_i,t_{i+1})-K)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; the first rate to be swaped is fixed at $t_0$ but the first payment is due at $t_1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Above formula is very straight forward: You are just discounting the differences between the fixed rate and the floating rates - for this is the payoff of the swap seen at time $t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we insert the formula for the $F(t,t_i,t_{i+1})$ that we have defined above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P^{swap}_t=\sum_{i=1}^{n}(t_i-t_{i-1}) P(t,t_i)(\frac{1}{t_i-t_{i-1}}(\frac{P(t,t_{i-1})}{P(t,t_i)}-1)-K)$&#xA;$P^{swap}_t=\sum_{i=1}^{n}[P(t,t_{i-1})-P(t,t_i)]-K\sum_{i=1}^{n}(t_i-t_{i-1})P(t,t_i)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The telescopic sume $\sum_{i=1}^{n}[P(t,t_{i-1})-P(t,t_i)]$ simplifies to $P(t,t_0)-P(t,t_n)$ and you arrive at&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Formula&lt;/strong&gt; $(**)$:   $P^{swap}_t=P(t,t_0)-P(t,t_n)-K\sum_{i=1}^{n}(t_i-t_{i-1})P(t,t_i)$ &#xA; which is the formula in your question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note that $P(t,t_n)+K\sum_{i=1}^{n}(t_i-t_{i-1})P(t,t_i)$ is the value of a bond with coupon $K$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whereas Formula $(*)$ helps in understanding the products functionality Formumla $(**)$ gives you the hedge.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you have already note the $K$ will be selected so that $P(t,t_0)-(P(t,t_n)+K\sum_{i=1}^{n}(t_i-t_{i-1})P(t,t_i))=0$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus to hedge the floating receiver swap one goes short a zero bond $P(t,t_0)$ and holds a long position in a coupon bearing bond with coupon $K$. As the fixed rate payer you will be perfectly hedged for the coupon bond will always give you the necessary fixed payments $K$&lt;/p&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-02-27T11:01:06.747" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10401" PostTypeId="1" AcceptedAnswerId="10402" CreationDate="2014-02-27T13:03:00.837" Score="24" ViewCount="5141" Body="&lt;p&gt;It seems quants increasingly use econometric models at work.&#xA;As someone who has sold his soul to probability theory and stochastical analysis I would like to catch up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What are the econometric tools a quant should be able to wield ?&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I see it, the answer will be highly dependant on where one works. Thus perhaps it would make sense to distinguish:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Buy side &lt;/li&gt;&#xA;&lt;li&gt;Sell side &lt;/li&gt;&#xA;&lt;li&gt;Fixed Income &lt;/li&gt;&#xA;&lt;li&gt;Equity &lt;/li&gt;&#xA;&lt;li&gt;Risk Management and Model&#xA;Validation&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Book suggestions that cover the necessary knowledge will be appreciated. Also, if someone feels like it, a list of topics (e.g. ARCH, GARCH etc.) would also be very helpful. &lt;/p&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2016-03-13T22:47:54.803" Title="What is the necessary level of Econometrics-Know-How for a quant" Tags="&lt;risk-models&gt;&lt;econometrics&gt;&lt;quants&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="56" ContentLicense="CC BY-SA 3.0" />
  <row Id="10402" PostTypeId="2" ParentId="10401" CreationDate="2014-02-27T13:38:03.253" Score="33" Body="&lt;p&gt;I can only talk about quantitative trading. As a rule of thumb, &lt;strong&gt;the lower frequency you work in, the more econometrics is important, whereas for a higher frequency, the more econometrics becomes useless&lt;/strong&gt;. (I would still recommend a top econometrician for HFT since they have what it takes to succeed, it's just the models aren't out-of-the-box applicable.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if I was interviewing someone who was educated in econometrics for a quantitative research position, I would hope for (given the relevance to financial time-series):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried to put in a legend, &lt;strong&gt;&lt;em&gt;^&lt;/em&gt;&lt;/strong&gt; is something you should learn later and &lt;strong&gt;&lt;em&gt;^^&lt;/em&gt;&lt;/strong&gt; is something you should learn after learning &lt;strong&gt;&lt;em&gt;^&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;&lt;strong&gt;^^&lt;/em&gt;&lt;/strong&gt; Kalman filters for dynamic linear models. &lt;/li&gt;&#xA;&lt;li&gt;GARCH (learn ARCH first).&lt;/li&gt;&#xA;&lt;li&gt;ARMA(p,q)/ARIMA(p,i,q)/AR(p)/MA(q).&lt;/li&gt;&#xA;&lt;li&gt;ACF/PACF.&lt;/li&gt;&#xA;&lt;li&gt;Econometric forecast evaluation (RMSE,MSE,MAE).&lt;/li&gt;&#xA;&lt;li&gt;Thorough OLS understanding. Assumptions and consequences of violation.&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;&lt;strong&gt;^&lt;/em&gt;&lt;/strong&gt; Regime switching and threshold models.&lt;/li&gt;&#xA;&lt;li&gt;Cointegration models such as VECM and Engle-Granger and basic $I(n)$ theory along with ADF/PP unit root testing. &lt;/li&gt;&#xA;&lt;li&gt;VARs.&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;&lt;strong&gt;^&lt;/em&gt;&lt;/strong&gt; Quantile regression.&lt;/li&gt;&#xA;&lt;li&gt;Basic knowledge of dimensionality reduction algorithms (the more the better, but I wouldn't have this as an expectation for an econometrics candidate).&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;&lt;strong&gt;^&lt;/em&gt;&lt;/strong&gt; Impulse response functions.&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;&lt;strong&gt;^&lt;/em&gt;&lt;/strong&gt; Monte carlo applications to construct sampling distributions and the idea of the bootstrap, along with general knowledge of at least one bootstrap estimator. &lt;/li&gt;&#xA;&lt;li&gt;A good knowledge of hypothesis testing, sampling distributions, population/sample concepts, lag length selection, consistency/power/bias, variance/bias tradeoff, maximum likelihood, PDF/CDF, qualitative knowledge of different distributions commonly used.&lt;/li&gt;&#xA;&lt;li&gt;A knowledge of why and how econometricians pre-process data, take differences, introduce variables and account for non-linearities with simple transforms on the individual features, interactions between features, ratios of features and indicator function breaks (either data determined or, usually more appropriately, determined a priori).&lt;/li&gt;&#xA;&lt;li&gt;Comovement not necessarily as a slope phenomenon; linear correlations (and its pitfalls), rank correlations, three-way relationship between correlation, linear regression slope and cointegrating vector, how to test for spillovers in a linear DGP, and more global and advanced dependence estimators (such as copula, wavelet, mutual information, IRFs  through VECM/VAR, forecast error variance decompositions, among others).&lt;/li&gt;&#xA;&lt;li&gt;The difference between &lt;em&gt;residual analysis&lt;/em&gt; and &lt;em&gt;test set cross-validation&lt;/em&gt;, and how both relate to overfitting and model generalisation. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I would not care about:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Panel modelling.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I would also like to see hopefully (most likely picked up from self-study):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;&lt;strong&gt;^^&lt;/em&gt;&lt;/strong&gt; Wavelets (DWT/CWT/phase difference analysis/frequency-domain bivariate correlation) and STFT should be a part of an econometricians toolbox.&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;&lt;strong&gt;^^&lt;/em&gt;&lt;/strong&gt; Dynamic correlation estimators (DCC-GARCH, stochastic copulas)&lt;/li&gt;&#xA;&lt;li&gt;A knowledge of generalization theory picked up from machine learning lectures.&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;&lt;strong&gt;^^&lt;/em&gt;&lt;/strong&gt; Methods like NNG to get better OLS estimates. Boosting and bagging linear DGPs for better generalisation. &lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;&lt;strong&gt;^^&lt;/em&gt;&lt;/strong&gt; Perpendicular regression and LAD estimators when least squares is not appropriate given some assumption violation, if the conditional expectation is not wanted (conditional median is theoretically desirable), or if you don't want to inadvertently do least-rectangles upon a misspecification of the causal relationship, or you want the loss to be less skewed by outliers.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here is some voluntary stuff that either I have seen some top guys working on in industry &lt;em&gt;or&lt;/em&gt; in an econometrics paper, and I would be very impressed to see knowledge in these areas:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Stochastic optimal control (a large quantitative global macro fund is doing work on this)&lt;/li&gt;&#xA;&lt;li&gt;Bayesian time-series (a reputable, large systematic fund had some research on this)&lt;/li&gt;&#xA;&lt;li&gt;I would like to see knowledge of how to come up with a DGP and figure out how to estimate it with numerical methods. As an example, how to embed exogenous variables in the forcing equation in Patton's symmetrized Joe-Clayton copula, then figure out how to optimize the density numerically and bootstrap unbiased and consistent standard errors. Another would be to derive a Kalman estimator to extract time-varying yield curve parameters (curvature, slope, etc). Everyone is estimating simple MGARCH and VECM models since you can just plug the data into &lt;code&gt;R&lt;/code&gt;, so it is doubtful there is alpha here. Probably there is some alpha for the guys that can estimate parsimonious models that others simply can not because they are not in the top 1% of econometricians.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here is some stuff that's probably not needed in &lt;strong&gt;low frequency&lt;/strong&gt; quantitative research:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Advanced optimisation theory. GAs, stochastic gradient descient and Newton's are all you will be expected to know.&lt;/li&gt;&#xA;&lt;li&gt;Non-linear machine learning.&lt;/li&gt;&#xA;&lt;li&gt;Non-linear dimensionality reduction or manifold learning. All you are expected to know is PCA, ICA and the concept of the time-series factor model.&lt;/li&gt;&#xA;&lt;li&gt;Digital signal processing &lt;em&gt;not&lt;/em&gt; related to comovement estimators. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;There is one thing from another field that may be required:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Ornstein-Uhlenbeck SDEs for a pairs trading fund.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You'll notice I've listed almost all the mainstream stuff that's applicable to time-series. So most of what you'll get in a financial time-series course is what would be the expectation I think.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that I did not list high frequency econometrics models, since I think they are not useful in high frequency finance. If you are going for such a position you will be interviewed by computer scientists and electrical engineers who will more likely ask you a question about asymptotic time complexity than about econometrics.   &lt;/p&gt;&#xA;" OwnerUserId="6081" LastEditorUserId="6081" LastEditDate="2014-02-27T16:46:25.150" LastActivityDate="2014-02-27T16:46:25.150" CommentCount="20" ContentLicense="CC BY-SA 3.0" />
  <row Id="10403" PostTypeId="2" ParentId="10401" CreationDate="2014-02-27T19:29:17.580" Score="7" Body="&lt;p&gt;@user2763361 has a very thorough list of useful econometric topics for quantitative finance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would add missing, mixed frequency, and irregular data as major issues that I'm either constantly dealing with or begrudgingly ignoring. Seasonal adjustment is important too for some data (like electricity futures), though the subject is also related to his mention of ARMA models. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;He might be right on recommending not to focus too much on Panel Modelling. My recollection of graduate school econometrics was constantly trying to remember whether to use random or fixed effects. I think it had to do a) the frequentist approach to Panel analysis and b) my class' focus on labor market analysis instead of the topics I may have found more useful. Nevertheless, while analyzing Panel data is less important than many of the other topics, that does not mean it has no place in Quantitative Finance. I have found a lot of value reading the literature on hierarchical and multi-level modelling. Hence, I strongly recommend Gelman's Bayesian Data Analysis. At a minimum, it will cure you from thinking about random versus fixed effects.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2014-02-27T19:29:17.580" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10404" PostTypeId="2" ParentId="10394" CreationDate="2014-02-27T19:48:37.337" Score="6" Body="&lt;p&gt;There are several ways to understand how to price a swap. One way is to see it as a sum of Forward Rate Agreements that you can price individually. This is more or less what Probilitator explained.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A simpler way imho is this: if you are receiver of floatting leg the value of the swap at $t\leq T_0$&lt;br&gt;&#xA;$$&#xA;  Swap_t = Leg_{Float,t} - Leg_{Fixed,t}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think you already understand how to price the fixed leg (it is a sum of coupons so its price is just the sum of the discounted coupons) so let's look at the floating leg. Simply put you just have to roll a dollar from one date of payment of the floatting leg to the next. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will write $L(T,\delta)$ for the linear rate at time $T$ for maturity $T+\delta$ so $P(T,T+\delta) = (1+\delta L(T,\delta))^{-1}$. More precisely consider the following simple strategy: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;at time $t$, buy a ZCB with maturity $T_0$ and you sell a ZCB with maturity $T_N$ (so you will have to pay $1$ at time $T_N$).&lt;/li&gt;&#xA;&lt;li&gt;at time $T_0$, you receive $1$. Use it to buy ZCB's with maturity $T_1$. You can buy $1/P(T_0,T_1)$ such ZCB. (You still have to pay $1$ at time $T_N$).&lt;/li&gt;&#xA;&lt;li&gt;at time $T_1$, you receive $1/P(T_0,T_1) = 1 + (T_1-T_0)L(T_0,T_1-T_0)$. You pay $(T_1-T_0)L(T_0,T_1-T_0)$ and you still have $1$. Once again you use it to buy ZCB's with maturity $T_2$. (You still have to pay $1$ at time $T_N$).&lt;/li&gt;&#xA;&lt;li&gt;continue until the last date of the swap $T_N$.&lt;/li&gt;&#xA;&lt;li&gt;at time $T_N$, you receive $1/P(T_{N-1},T_N) = 1 + (T_{N}-T_{N-1})L(T_{N-1},T_{N}-T_{N-1})$. You use the $(T_{N}-T_{N-1})L(T_{N-1},T_{N}-T_{N-1})$ to pay the floating rate and you use the $1$ to pay the person you sold the ZCB with maturity $T_N$ to. &#xA;You have replicated the floating leg and all you needed to start with is the money to buy one ZCB while selling another one so by absence of arbitrage &#xA;$$&#xA;  Leg_{Float,t} = P(t,T_0) - P(t,T_N)&#xA;$$  &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Hope this answers your question. &lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2014-02-27T19:48:37.337" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10405" PostTypeId="1" AcceptedAnswerId="10406" CreationDate="2014-02-27T19:54:18.233" Score="4" ViewCount="2584" Body="&lt;p&gt;This might be another basic derivatives question. When interest rate rises, stock prices generally fall. Assuming an option's underlying is a stock, this should lower the option's price as well. However, according to many sources, when interest rate rises, options prices rise. What causes this and does this actually cancel out the effect of lower underlying prices?&lt;/p&gt;&#xA;" OwnerUserId="5007" LastActivityDate="2019-09-30T17:10:08.773" Title="Effect of interest rate on options prices" Tags="&lt;options&gt;&lt;interest-rates&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10406" PostTypeId="2" ParentId="10405" CreationDate="2014-02-27T21:24:42.790" Score="2" Body="&lt;p&gt;Personally I think there is no easy answer to this question. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Economically a rise of interest rates often means an increased demand for capital. Banks need more money to lend to the industry thus they increase rates to entice consumers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand a demand for capital on the side of the economy often means increased market activity - companies want to invest more. More market activity can translate into higher market volatility. And higher volatility translates to higher option prices. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, let us assume stock prices do fall because of rising interest rates. It has been observed that market volatility goes up in a bear market. (e.g. &lt;a href=&quot;http://books.google.de/books?id=hIvLUJJ4tAgC&amp;amp;pg=PA196&amp;amp;lpg=PA196&amp;amp;dq=increase%20in%20market%20volatility%20bear%20market&amp;amp;source=bl&amp;amp;ots=UDfeQsMaXu&amp;amp;sig=YqVEdMTwLcO7RlwqrrobFvXQHtc&amp;amp;hl=de&amp;amp;sa=X&amp;amp;ei=NqsPU9T4IMajhgfLqYDQBg&amp;amp;ved=0CDQQ6AEwAA#v=onepage&amp;amp;q=increase%20in%20market%20volatility%20bear%20market&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;confer the following book - page 196&lt;/a&gt;) Once again you would have a higher volatility and thus higher option prices. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How an option reacts to interest rates depends on it's maturity and also on the type of option. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Generally: The higher the maturity the more sensitive the&#xA;  product is to changes in the interest rates (for you discount over a&#xA;  longer period of time)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I can recomend &lt;a href=&quot;http://demonstrations.wolfram.com/ExploringTheBlackScholesFormula/&quot; rel=&quot;nofollow&quot;&gt;this mathematica tool for the B&amp;amp;S Model&lt;/a&gt;. You can play around with it to get a feel for how option prices react to changes in different parameters. If you crank up the maturity you will notice the price surface will shift significantly more if you change the interest rate. For a low maturity the changes will be minuscule&lt;/p&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-02-27T21:24:42.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10407" PostTypeId="1" AcceptedAnswerId="10409" CreationDate="2014-02-27T22:49:08.040" Score="7" ViewCount="1104" Body="&lt;p&gt;I often see questions like &quot;Given this payoff graph (example below), construct a portfolio that replicates it.&quot; I want to know if there is an efficient method/algorithm to find the individual pieces that comprise it (long/short puts/calls/stock).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/fE5ku.gif&quot; alt=&quot;Iron Butterfly&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So to pose this more mathematically, given  profit and loss function below where $x$ is the stock price at expiration and given that each option type has a fixed premium (not necessarily the same, but maybe an easy assumption to start with), can you efficiently recreate this from individual options?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;  P(x)=&#xA;\begin{cases}&#xA;p_0(x),  &amp;amp; x \le \beta_0 \\&#xA;p_1(x), &amp;amp; \beta_0 \le x \le \beta_1 \\&#xA;\qquad. \\&#xA;\qquad. \\&#xA;\qquad. \\&#xA;p_n(x), &amp;amp; \beta_{n-1} \le x \le \beta_n \\&#xA;\end{cases}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know that each $p_i(x)$ is either constant or linear and every basic option type has a function associated with it. For example shorting one call with strike price k and premium p gives the function:&#xA;$$&#xA;\begin{cases}&#xA;p,  &amp;amp; x \le k \\&#xA;-x+k+p, &amp;amp; x \ge k \\&#xA;\end{cases}&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="7388" LastEditorUserId="12" LastEditDate="2014-03-04T10:48:37.807" LastActivityDate="2014-03-04T11:07:43.230" Title="Algorithmical replication of a profit and loss function using different options" Tags="&lt;options&gt;&lt;option-strategies&gt;&lt;algorithm&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10408" PostTypeId="2" ParentId="10379" CreationDate="2014-02-28T00:28:49.387" Score="0" Body="&lt;p&gt;try also Datastream. but at the end it really depends on the type of financial data that you need.&lt;/p&gt;&#xA;" OwnerUserId="6486" LastActivityDate="2014-02-28T00:28:49.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10409" PostTypeId="2" ParentId="10407" CreationDate="2014-02-28T03:55:24.767" Score="5" Body="&lt;p&gt;Assume $p_i(x)$ is a payoff of one particular option. You can try to reproduce the diagram using a bunch of options with strikes on the breakpoints (underlying is useless, because its payoff can always be modelled by buy&amp;amp;sell of a certain call and put). Then you can create a system of &lt;code&gt;k&lt;/code&gt; equations with &lt;code&gt;n&lt;/code&gt; unknowns (number of each kind of option). All other things can be fixed, such as strikes are at breakpoints; everything over ATM will be calls, everything below will be puts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sum w_i p_i(X) = Y$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $X$ is a breakpoint and $Y$ is return at $X$; $w_i$ are coefficients you are trying to find. In addition, you will need two points anywhere to the right from the rightmost breakpoint and one to the left from the leftmost one, otherwise you are not fixing the slopes of the far OTM tails. All in all, this is a system of linear equations (because $p_i(X)$ is either 0, or some linear return if an option is ITM) and as such should be easy to solve. As an additional parameter, to account for cash you can add another same variable to each of the equations - this will basically shift PnL up or down.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is the system described above won't always have solutions. To ensure you'll always have one in general, you will have to either include both puts and calls for each of the breakpoints, or add the underlying. This will likely produce infinite number of solutions, but that's relatively easy to handle. I'm quite sure many standard PnL's will be resolvable without this amendment.&lt;/p&gt;&#xA;" OwnerUserId="5086" LastEditorUserId="5086" LastEditDate="2014-03-03T22:08:43.117" LastActivityDate="2014-03-03T22:08:43.117" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10410" PostTypeId="2" ParentId="10405" CreationDate="2014-02-28T04:50:38.200" Score="1" Body="&lt;p&gt;By derivating the Black-Scholes formula in function of r (ρ=∂C/∂r), you get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ρ_call=0.01TKe^(-rT) N(d_2 )=ρ_put+0.01TKe^(-rT)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see that call prices increase (and put prices decrease) if interest rates (risk-free) increase.&lt;/p&gt;&#xA;" OwnerUserId="7391" LastActivityDate="2014-02-28T04:50:38.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10411" PostTypeId="1" CreationDate="2014-02-28T13:44:25.037" Score="6" ViewCount="165" Body="&lt;p&gt;While skeeming the relevant literature and web-sites I noticed that mostly the concept of the incomplete market is reduced to the following statement&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;A market is incomplete if there are more sources of noise than&#xA;  tradeable assets&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This might work well as a rule of thumb but does not really explain the underlying consequences (e.g. what it actually means for the market participants) - also it doesn't aid in visualizing understanding the concept.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to find a comprehensive and easily accessible reference on the topic online but was unsuccessfull. Thus I thought qaunt SE is the perfect place to colaborate on one! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Explain/Illustrate: What is an icomplete market in a quant finance sense ?&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;examples on how a hedges might not work  &lt;/li&gt;&#xA;&lt;li&gt;explanation via Arrow-Debtreu&#xA;securities and exchange of risk  &lt;/li&gt;&#xA;&lt;li&gt;reading suggestions/literature references &lt;/li&gt;&#xA;&lt;li&gt;how can a market be completed (e.g. introduction of a volatility index that can be traded etc.)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-02-28T13:44:25.037" Title="The concept of an incomplete market" Tags="&lt;pricing&gt;&lt;hedging&gt;&lt;market&gt;" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10412" PostTypeId="1" AcceptedAnswerId="10413" CreationDate="2014-02-28T15:18:28.913" Score="0" ViewCount="2715" Body="&lt;p&gt;In standard Black-Scholes Model, compute the price of an asset-or-nothing put and asset-or-nothing call options. Write down the put-call parity relation between the asset-or-nothing call and put option prices. &lt;/p&gt;&#xA;" OwnerUserId="7387" LastEditorUserId="7279" LastEditDate="2014-02-28T15:46:37.707" LastActivityDate="2014-02-28T15:46:37.707" Title="Asset-or-nothing Option Valuation in the Black and Scholes model" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;quant-trading-strategies&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10413" PostTypeId="2" ParentId="10412" CreationDate="2014-02-28T15:39:49.887" Score="2" Body="&lt;p&gt;the answer for calculating the prices can be found &lt;a href=&quot;http://en.wikipedia.org/wiki/Binary_option#Cash-or-nothing_call&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; - see chapter: Black–Scholes valuation ;) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The put-call parity in that case is pretty straight forward:&#xA;$P=Se^{-qT}-C$. Using the results presented on the Wikipedia page in the aforementioned section this can be proved as follows&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P=Se^{-qT}-C$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$=Se^{-qT}-Se^{-qT}\Phi(d_1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$=Se^{-qT}(1-\Phi(d_1))=Se^{-qT}\Phi(-d_1)$&lt;/p&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-02-28T15:39:49.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10415" PostTypeId="2" ParentId="10390" CreationDate="2014-02-28T17:07:37.817" Score="6" Body="&lt;p&gt;There are sufficiently different ways to calculate the Sharpe ratio that the best advice I can give is to do whatever your boss wants. Also, if it is for a paper or research document, just make clear you document your method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My approach is usually to calculate the highest frequency Sharpe ratio I can based on the data. The higher frequency choice is to get a better estimate of the standard deviation. I might then put the annualized value in parentheses after it, mainly as others are more familiar with what a good annual Sharpe would be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I almost always discuss the Sharpe ratio as relative to something else, i.e. the Sharpe of a portfolio strategy relative to some index or benchmark. It can be difficult to interpret these ratios by themselves.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For annualization, CAGRs are generally preferred to multiplying the return by the frequency, which really only holds if you assume a normal distribution for log returns. The CAGR is perhaps most common and can be thought of as the annualized return you would get if you invested in the portfolio over the relevant horizon. The only problem with CAGRs is that it's not clear what the standard deviation should be that goes with it. Most people just multiply the standard deviation by the square root of 12. It's probably not correct, but it's what everybody does so you probably should too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As Richard notes in the comments, what you calculate also depends on how you need the statistic to be interpreted. The most common way the Sharpe ratio is used is as an ex-post evaluation of portfolio performance. However, it is also possible to use the Sharpe ratio in portfolio optimization, which requires a forward-looking forecast of what the Sharpe ratio of a portfolio will be in the future. The relevant forward looking Sharpe ratio for optimization relies on the arithmetic returns and standard deviations since that is what is required to aggregate from security returns to portfolio returns. However, the ex post evaluation Sharpe ratio above was using CAGR, which is a geometric return. The goal in that case is to figure out what you actually returned on an annualized basis, rather than the distribution of the return as some point in the future.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastEditorUserId="2379" LastEditDate="2014-02-28T21:23:03.127" LastActivityDate="2014-02-28T21:23:03.127" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10416" PostTypeId="2" ParentId="10407" CreationDate="2014-02-28T17:33:11.810" Score="8" Body="&lt;p&gt;You can find an exact algorithm with a step-by-step explanation here:&#xA;&lt;a href=&quot;https://www.dropbox.com/s/t4fq067kzx26mhw/project_paper.pdf&quot; rel=&quot;nofollow&quot;&gt;https://www.dropbox.com/s/t4fq067kzx26mhw/project_paper.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see from the URL it is an archived document because the original site is unfortunately long gone and the tool referenced in the paper with it :-(&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it should be helpful anyway to understand what is going on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Notice to the owner of the paper: I put up this paper because it is no longer available on the web and it is a great piece of work. If you are the owner and have a problem with that: Please contact me and I will delete it immediately - Thank you&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2014-03-04T11:07:43.230" LastActivityDate="2014-03-04T11:07:43.230" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10417" PostTypeId="1" CreationDate="2014-02-28T18:07:50.620" Score="4" ViewCount="100" Body="&lt;p&gt;Is there a good quantitative model to estimate how much slippage is required to execute a particular option spread trade?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, let's say you want to execute an Iron Condor.  Given X, Y, Z market conditions, how much slippage does one need to give up from mid-price to have the order executed?&lt;/p&gt;&#xA;" OwnerUserId="7389" LastActivityDate="2014-02-28T18:07:50.620" Title="Forecasting amount of slippage in executing option spreads" Tags="&lt;options&gt;&lt;spread&gt;&lt;slippage&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10419" PostTypeId="1" CreationDate="2014-03-01T00:15:08.597" Score="1" ViewCount="470" Body="&lt;p&gt;Currently I am working with huge data frame which consists of a lot firms. For each firm in my sample I calculated asset volatility ( I am using Merton default probability model, so I have used 2 equation approach to calculate asset value and asset volatility). Then I have divided  my sample into parts (let s call them portfolios) based on industry and size factor. Now I would like to calculate the asset volatility of each part ( portfolio) in order to use it in the analysis. My problem is that I cannot calculate pairwise correlation between firms in the same portfolio and that s reason I have directed myself here. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Possibly you have heard about the modeled volatility of KMV Merton model which you can access:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?rep=rep1&amp;amp;type=pdf&amp;amp;doi=10.1.1.204.1352&quot; rel=&quot;nofollow&quot;&gt;http://citeseerx.ist.psu.edu/viewdoc/download?rep=rep1&amp;amp;type=pdf&amp;amp;doi=10.1.1.204.1352&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to approximate their calculations but as it is not elaborated there I would kindly ask you suggestions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards,&#xA;Jack&lt;/p&gt;&#xA;" OwnerUserId="7400" LastActivityDate="2014-03-01T00:15:08.597" Title="How to calculate modeled asset volatility by industry factor?" Tags="&lt;volatility&gt;&lt;merton-model&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10420" PostTypeId="1" AcceptedAnswerId="10421" CreationDate="2014-03-01T01:48:55.023" Score="3" ViewCount="503" Body="&lt;p&gt;For two stocks that are independent and identically distributed (iid), do they have the same beta? Does the number of data points matter?&lt;/p&gt;&#xA;" OwnerUserId="7401" LastEditorUserId="2379" LastEditDate="2014-03-01T06:55:35.870" LastActivityDate="2014-03-01T16:02:44.337" Title="Beta and the Assumption of IID Returns" Tags="&lt;beta&gt;&lt;capm&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10421" PostTypeId="2" ParentId="10420" CreationDate="2014-03-01T02:16:06.317" Score="0" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;For two stocks that are independent and identically distributed (iid), do they have the same beta? &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;No. If you have two stocks perfectly negatively correlated, then ones' beta would be positive, and the other's - negative, as long as the beta is not zero.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Does the number of data points matter?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;No, as long as your statistics are significant.&lt;/p&gt;&#xA;" OwnerUserId="7365" LastEditorUserId="7365" LastEditDate="2014-03-01T16:02:44.337" LastActivityDate="2014-03-01T16:02:44.337" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10422" PostTypeId="1" CreationDate="2014-03-01T06:11:38.257" Score="3" ViewCount="1188" Body="&lt;p&gt;When a trader gets conclusion of the volatility is being underestimated (via volatility cone or some other technology), actually there are multiple ways for his trading. (Let's assume the underlying instrument is equity).&#xA;1. Long an option and hedge the delta, to gain from the rallying of volatility.&#xA;2. Long straddle strategy to gain from the stock price movement.&#xA;3. Long gamma strategy to gain from the stock price movement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course there are more strategies but I just listed these 3 to make the discussion simple and clearer. Let's assume the volatility does rally as expected.&#xA;For #1, it makes money from option price rallying as the higher volatility. (Here the volatility is defined as Standard Deviation of stock log returns)&#xA;For #2, it makes money from movement of stock price. (Movement should exceed the profit-loss boundary of straddle. E.g. 87.0-95.0)&#xA;For #3, it makes money from movement of stock price. (Movement should cover the time decay of option)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The #2 and #3 are equivalent to #1 to some extent, as the higher volatility also means the larger price movement. But they are still not exactly same.&#xA;When vol rallies 12%, #1 profits, however maybe the stock price movement can not reach the profit-loss boundary for #2 or can not cover the time decay for #3.&#xA;Option trading is complex and traders have to using math model for risk measurement (and pricing). And seems the models for option are almost based on volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question 1:&lt;/strong&gt; How to measure the risk of option strategies like #2 and #3. (I mean the pre-check of risk before trading, not calculating Var at end of a trading day). The models focus on stock volatility could not measure the stock price movement exactly I think, like mentioned above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another question is about the risk management after trading. Var is usually used for the portfolio risk management, but option trading has more greeks explored than other trading like cash equity. In our example the main risk of #3 is theta (time decay) risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question 2:&lt;/strong&gt; So is there any other specific method/model/formula to measure risk for option trading against greeks (like theta in #3) apart from Var? (Some institutions like Bank and Market Maker pay more attention to Var maybe because of the regulation like basel II?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Much appreciate if you could help on these 2 questions of option market practice. Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="7402" LastEditorUserId="7402" LastEditDate="2014-03-01T14:30:24.737" LastActivityDate="2014-03-03T00:24:53.300" Title="Pre-trade evaluation and risk assessment of option trading strategies (in market practice)" Tags="&lt;options&gt;&lt;risk&gt;&lt;greeks&gt;&lt;strategy&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10423" PostTypeId="2" ParentId="10395" CreationDate="2014-03-01T15:00:16.693" Score="1" Body="&lt;p&gt;According to &lt;a href=&quot;http://books.google.de/books?id=jrpZ4_OP6zMC&amp;amp;pg=PT110&amp;amp;dq=price%20earnings%20ratio%20calculation%20formula&amp;amp;hl=de&amp;amp;sa=X&amp;amp;ei=u-0RU_XkI-qI7Aab7YHQCg&amp;amp;ved=0CHoQ6AEwCQ#v=onepage&amp;amp;q=price%20earnings%20ratio%20calculation%20formula&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;this reference&lt;/a&gt; there are indeed several types of P/E-Ratios (&lt;em&gt;trailing P/E&lt;/em&gt; that is based on previous earnings and &lt;em&gt;forward P/E&lt;/em&gt; which is based on projected earnings)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also several books calculate the P/E according to the following formula&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P/E-Ratio = \frac{Average Common Stock Price}{Net Income Per Share}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Confer &lt;a href=&quot;http://books.google.de/books?id=Ic-Qcclsa0YC&amp;amp;pg=PA98&amp;amp;dq=price%20earnings%20ratio%20calculation%20formula&amp;amp;hl=de&amp;amp;sa=X&amp;amp;ei=u-0RU_XkI-qI7Aab7YHQCg&amp;amp;ved=0CFoQ6AEwBQ#v=onepage&amp;amp;q=price%20earnings%20ratio%20calculation%20formula&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;source1&lt;/a&gt;, &lt;a href=&quot;http://books.google.de/books?id=BqGtaIf3xT4C&amp;amp;pg=PA98&amp;amp;dq=price%20earnings%20ratio%20calculation%20formula&amp;amp;hl=de&amp;amp;sa=X&amp;amp;ei=u-0RU_XkI-qI7Aab7YHQCg&amp;amp;ved=0CFMQ6AEwBA#v=onepage&amp;amp;q=price%20earnings%20ratio%20calculation%20formula&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;source2&lt;/a&gt; and &lt;a href=&quot;http://books.google.de/books?id=U7lV2lov0iMC&amp;amp;pg=PT91&amp;amp;dq=price%20earnings%20ratio%20calculation%20formula&amp;amp;hl=de&amp;amp;sa=X&amp;amp;ei=u-0RU_XkI-qI7Aab7YHQCg&amp;amp;ved=0CEsQ6AEwAw#v=onepage&amp;amp;q=price%20earnings%20ratio%20calculation%20formula&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;source3&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately I couldn't find how the average-stock-price ist supposed to be calculated. (Does one use a rolling average and if that is the case with which time-window )&#xA;Some accounting figures and assumptions also seem to be involved into calculating this performance indicator. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://books.google.de/books?id=EUtah5w2_5wC&amp;amp;pg=PA145&amp;amp;dq=average%20common%20stock%20price&amp;amp;hl=de&amp;amp;sa=X&amp;amp;ei=8_IRU-fnNaS07QbvvYHwBQ&amp;amp;ved=0CE0Q6AEwAw#v=onepage&amp;amp;q=average%20common%20stock%20price&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; I also found an interesting comment cautioning that in case of a very volatile stock one should use the latest stock price to get a meaningful P/E-Ratio&lt;/p&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-03-01T15:00:16.693" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10424" PostTypeId="2" ParentId="10331" CreationDate="2014-03-01T15:25:52.180" Score="0" Body="&lt;p&gt;The convention in the world of finance is that notionals are always nonnegative.&#xA;In mathematical finance, notional could be real-valued, so let's call it MFNotional to distinguish. &#xA;If MFnotional is negative, then it means short an option. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example to indicate how I arrived at N1 = N/ΔK. Suppose K0 = 0.8, ΔK= 0.2, and N = 1m SGD. Then K2 = 0.8 and K1 = 0.6. &#xA;Let X denote the unknown exchange rate at expiry with X SGD = 1 USD. &#xA;The goal is to super-replicate the payoff 1( X &gt; 0.8) m SGD.&#xA;Suppose we scale down our payoff substantially to just 1(X &gt; 0.8) SGD i.e. divide out the 1m SGD notional. &#xA;The  vanillas to be used to super-replicate 1(X &gt; 0.8) SGD&#xA;pay (X-0.6)^+ SGD and (X - 0.8)^+SGD for each SGD of notional. Consider the payoff from 5 (X - 0.6)^+ - 5 (X - 0.8)^+.&#xA;Notice 5 = 1/(0.2). Refer to the vanilla position as a call spread.&#xA;The notional in the long call is 5 SGD and the notional in the short call is also 5 &#xA;SGD.&#xA;If X &amp;lt; 0.6, the call spread payoff vanishes as does 1(X &gt; 0.8).&#xA;If X&gt; 0.8, then call spread payoff = 1 SGD as is 1(X&gt; 0.8). If X inbetween 0.6 and 0.8 then call spread payoff is  5 (X - 0.6) SGD &gt;= 0 SGD so we overestimate/super-replicate the digital call payoff of 0 SGD.&#xA;When we recognize that the actual notional of the target is 1m SGD rather than 1 SGD, then we have to scale up the notionals  in the two calls by a factor of 1m, so that they become 5m SGD each.&#xA;Notice that N1 = N/ΔK = 1m SGD/(0.2) = 5m SGD.    &lt;/p&gt;&#xA;" OwnerUserId="7320" LastActivityDate="2014-03-01T15:25:52.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10425" PostTypeId="2" ParentId="9605" CreationDate="2014-03-01T18:38:20.147" Score="0" Body="&lt;p&gt;jup, just devide it through 12 :) &#xA;Example /between 2004-2008):&#xA;Average annualized T.Bill rate =3,27%&#xA;Monthly Riskfree rate = 3,27%/12 = 0,272%&lt;/p&gt;&#xA;" OwnerUserId="7410" LastActivityDate="2014-03-01T18:38:20.147" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10426" PostTypeId="2" ParentId="9605" CreationDate="2014-03-01T19:07:32.743" Score="0" Body="&lt;p&gt;here's your answer &lt;img src=&quot;https://i.stack.imgur.com/ViOa6.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;basically, I'm saying NO, it's not a good proxy at all&lt;/p&gt;&#xA;" OwnerUserId="7365" LastActivityDate="2014-03-01T19:07:32.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10427" PostTypeId="2" ParentId="10390" CreationDate="2014-03-01T23:21:23.107" Score="2" Body="&lt;p&gt;Here is an example calculation according to the formula by &lt;a href=&quot;http://www.stanford.edu/~wfsharpe/art/sr/sr.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;William F. Sharpe, 1994&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The OP's method of annualising the variance (as used below), is also specified by the Committee of European Securities Regulators in this &lt;a href=&quot;http://www.esma.europa.eu/system/files/10_673.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;document&lt;/a&gt;, page 5, box 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For this example, taking 24 months of returns of risk-free proxy (US 4-week &lt;a href=&quot;http://www.federalreserve.gov/releases/h15/data.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;T-bills&lt;/a&gt;) and an example stock, (and using &lt;em&gt;Mathematica&lt;/em&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;riskfree = {0.02, 0.06, 0.06, 0.07, 0.07, 0.05,&#xA;   0.07, 0.09, 0.07, 0.11, 0.13, 0.04, 0.05, 0.08, 0.08,&#xA;   0.05, 0.02, 0.03, 0.02, 0.04, 0.02, 0.11, 0.05, 0.02};&#xA;&#xA;index = {2.54, 6.06, -0.75, -6.46, 1.39, 0.21,&#xA;  -0.15, 6.47, -6.23, -1.86, 0.78, 6.01, -0.69, 6.21, -5.04,&#xA;   3.19, -8.13, 2.06, -6.08, 1.6, -3.23, 0.8, 4.39, -5.81};&#xA;&#xA;(* annualised mean excess return *)&#xA;amer = 12*Mean[index - riskfree];&#xA;&#xA;(* annualised standard deviation *)&#xA;asd = StandardDeviation[index - riskfree]*Sqrt[12]&#xA;&#xA;(* ex-post Sharpe ratio *)&#xA;ratio = amer/asd&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;-0.133975&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&quot;&lt;em&gt;A negative Sharpe ratio indicates that a risk-less asset would perform better than the security being analysed.&lt;/em&gt;&quot; - Investopedia&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(* plot cumulative returns *)&#xA;crf = FoldList[Times, 100, riskfree/100 + 1];&#xA;cidx = FoldList[Times, 100, index/100 + 1];&#xA;ListLinePlot[{crf, cidx}, DataRange -&amp;gt; {0, 24},&#xA; PlotLegends -&amp;gt; {&quot;Risk-free&quot;, &quot;Stock&quot;}]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/CGRUA.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="7178" LastEditorUserId="7178" LastEditDate="2014-03-02T02:16:08.347" LastActivityDate="2014-03-02T02:16:08.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10428" PostTypeId="2" ParentId="9604" CreationDate="2014-03-02T06:00:45.177" Score="3" Body="&lt;p&gt;Using a realized kernel for calculating volatility will give you results in the same resolution as the data you feed them. So if you feed them minute-by-minute data, then the volatility will be calculated minute-by-minute. What that really means is that only once per minute will you have a good estimate of the volatility of whatever asset you're looking at. The other 99.99% of the the time, the market might introduce changes which may throw that estimate out of the window.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're not interested in high-frequency volatility estimates, then it's a completely different matter. You'd be better off trying to pre-filter your data before feeding it to the realized kernel. The goal there is to reduce the noise so that the remaining signal matches up to the frequency you wish to use. So if you want to have a day-by-day estimate based on minute-by-minute data, you can probably get a pretty good result by boiling down the minute-by-minute event data into a hour-by-hour events.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not familiar with such algorithms that give weight to temporal heuristics such as day-of-week or month-in-year or year-by-year cycles. Unless you know you're using such an algorithm, then there's no reason to feed more than a just today's data if you want an estimate for the current day. If anything, adding more data only causes the estimate to become duller, giving you only week- or month-accurate estimates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't weight your data at all, then feeding in all your historical data might give you a volatility estimate for the next decade, but it will be off by a mile in the short term.&lt;/p&gt;&#xA;" OwnerUserId="7414" LastActivityDate="2014-03-02T06:00:45.177" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10429" PostTypeId="1" AcceptedAnswerId="10435" CreationDate="2014-03-02T09:28:05.237" Score="6" ViewCount="3290" Body="&lt;p&gt;I am about to implement a variation of the LIBOR-Market-Model (complete with Least-Square-Montecarlo, calibration, pricing etc.)  and decided to implement it in C#.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The implementation will involve working with statistical data, numerical optimisation and monte carlo. &#xA;Being fluent in R, C++, C# and Mathematica I usually distribute the workload among the platforms according to their strengths. Thus: Mathematica for optimization, R for statisical analysis and C#/C++ for brutforce montecarlo etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Last week I was given the task to create a distributable pricing-/risk-management-environment for the Libor-Market-Model that can be accessed via MS-Excel. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I opted for C# because it is very easy to interface with Excel via Excel-DNA &lt;em&gt;(I did the interface with C++ once but it is no where as convenient as C#)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Thus I am looking for well documented solutions for:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;statistics &lt;em&gt;(for the estimation of a convariance matrix)&lt;/em&gt; - perhaps linking to R ?&lt;/li&gt;&#xA;&lt;li&gt;numerics &lt;em&gt;(rank reduction, matrix decomposition)&lt;/em&gt;  - ALGLIB - is there an alternative ?&lt;/li&gt;&#xA;&lt;li&gt;optimization &lt;em&gt;( for&#xA;calibration - &lt;strong&gt;above all I need non-gradient methods&lt;/strong&gt;)&lt;/em&gt; &lt;/li&gt;&#xA;&lt;li&gt;visualisation &lt;em&gt;(people from risk management usually&#xA;like pretty graphs :)&lt;/em&gt; - C# has a charting environment. I have never used it before and do not know whether it is any good. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Also note:&lt;/strong&gt; I am allowed to make a somewhat altered version of the code &lt;strong&gt;avaliable to the public&lt;/strong&gt;. Thus it would be nice for the packages/add-ins to be avaliable for free for non commercial usage.&lt;/p&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="1718" LastEditDate="2014-03-02T21:11:32.817" LastActivityDate="2014-03-03T11:56:08.670" Title="Free and tested optimization, statistical and visualization packages for C#" Tags="&lt;pricing&gt;&lt;programming&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="10430" PostTypeId="1" CreationDate="2014-03-02T16:36:20.500" Score="1" ViewCount="81" Body="&lt;p&gt;Assume we have the following function:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f(p) = \frac{1}{(1-p)d}\ln\left(\frac{1}{T}\sum_{t=1}^{T}\left[\frac{1+X_t}{1+Y_t} \right]^{1-p} \right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d$ is a constant&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$T$ is a constant&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_t$ for $t = 1, 2, \cdots, T$ are random variables (it is actually the portfolio's annualized rate of return at time $t$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Y_t$ for $t = 1, 2, \cdots, T$ are random variables (it is actually the risk-free rate at time $t$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$p$ is defined such that it is value that satisfies $f(p) = 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the sampling and/or asymptotic distribution for the statistic $p$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;By sampling distribution I mean the following:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution to $f(p) = 0$ doesn't have a closed-form solution, but it is obvious that the resulting value of $p$ depends on $X_t$ and $Y_t$, so $p$ can be treated as a random variable that depends on the random variables $X_t$ and $Y_t$. Then for every (fixed) $T$ observations of $X_t$ and $Y_t$, we have a corresponding value $p$ that satisfies $f(p) = 0$, what is the sampling distribution of $p$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;By asymptotic distribution I mean the following:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similar to above, now assume $T$ isn't fixed, then clearly the solution $p$ to $f(p)=0$ implicitly depends on $T$, then what is the asymptotic distribution of $p$ as $T \rightarrow \infty$?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Assume you are allowed the following assumptions to achieve the above:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) You can make any distributional assumptions regarding $X_t$ and $Y_t$, e.g., $X_t$ and $Y_t$ are independent from each other, also $X_t$, $Y_t$ for $t = 1, 2, \cdots, T$ are independently and identically distributed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Rather than making distributional assumptions about $X_t$ and $Y_t$, assume you can make some assumptions about the processes $\{X_t\}$ and $\{Y_t\}$, e.g., both processes are stationary (or weakly stationary) etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Any assumption you see fit to yield a solution.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;This is what I've tried so far.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we let $Z_t = \frac {1 + X_t} {1 + Y_t}$, then we have $\displaystyle f(p) = \frac {1} {(1 - p)d} \ln\left(\frac {1} {T} \sum_{t=1}^T Z_t^{1-p} \right)$. Setting this equation to $0$ and rearranging, we have:&#xA;$$\sum_{t=1}^T Z_t^{1-p} = T$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The my question becomes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Sampling distribution: For a fixed $T$, what is the distribution of $p$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Asymptotic distribution: For $T \rightarrow \infty$, what is the distribution of $p$?&lt;/p&gt;&#xA;" OwnerUserId="6552" LastActivityDate="2014-03-02T16:36:20.500" Title="Sampling and/or asymptotic distribution of a function" Tags="&lt;statistics&gt;&lt;research&gt;&lt;returns&gt;&lt;mathematics&gt;" AnswerCount="0" CommentCount="14" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10431" PostTypeId="2" ParentId="10429" CreationDate="2014-03-02T16:43:58.777" Score="1" Body="&lt;p&gt;the usual suspects have .NET/C# bindings or implementations: IMSL, NAG&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another interesting alternative is the developers of &lt;a href=&quot;http://www.solver.com/&quot; rel=&quot;nofollow&quot;&gt;Excel Solver add-in&lt;/a&gt;. They have an advanced package way beyond Excel's add-in. Do I recommend it? Of course, not, but it's an option nevertheless.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would forget C#, and use a proper binary libraray, tried and tested, anything from BLAS to GSL. In the end you're using Excel, it's a binary code, so there's no point in using VM-based solutions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE:&#xA;The reasons why I recommend binary library:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;it's always better to use the library which is popular, because that way it has a lesser chance of containing an error. imagine the matrix inversion code written in Fortran, which was in use since '60s. what is a chance of a serious error in it? everyone knows how they behave. so you take the binary code of this library, and pretty much guarantee that it has no bugs. who writes numerical code in C#?! very few people. basically, nobody. what's the point? it'll work only on Windows, and scientists use all sorts of hardware, most of it on Unix flavors.&lt;/li&gt;&#xA;&lt;li&gt;if you were writing pure .NET app, then it makes a sense to at least consider a library written in C#, because that would be native to its host platform. you're developing Excel app, which is a binary application. connecting to VM-executed code brings no advantages, and potentially introduces problems, e.g. with performance&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7365" LastEditorUserId="7365" LastEditDate="2014-03-02T19:31:36.690" LastActivityDate="2014-03-02T19:31:36.690" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10432" PostTypeId="2" ParentId="9604" CreationDate="2014-03-02T17:42:13.867" Score="9" Body="&lt;p&gt;The use of kernels to estimate volatility using intraday data is &quot;&lt;em&gt;nothing more&lt;/em&gt;&quot; than combining:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;intraday volatility estimation&lt;/li&gt;&#xA;&lt;li&gt;kernel smoothing&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Thus you have to take care about the &quot;usual pits&quot; of these two approaches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Intraday volatility estimation.&lt;/strong&gt; I hope you know the &quot;&lt;a href=&quot;https://quant.stackexchange.com/a/3264/2299&quot;&gt;signature plot&lt;/a&gt;&quot; effect. Of course if you use the proper estimation method, it should take care of if, but just in case you should check that you do not suffer from it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Kernel smoothing.&lt;/strong&gt; You will have to tune the time scale of your kernel. Of course theoretical papers like &lt;a href=&quot;http://www.citeulike.org/user/lehalle/article/13076621&quot; rel=&quot;nofollow noreferrer&quot;&gt;Designing Realized Kernels to Measure the ex post Variation of Equity Prices in the Presence of Noise&lt;/a&gt; do not really have to do it since their results are asymptotic but real life is not.&#xA;Moreover you may know that since you will have at date $t$ information of previous dates in your estimator $\hat\sigma_t$, if you multiply it by a statistic from the past $X_{t-\delta t}$ you will obtain a &quot;trace&quot; of the correlation between $X$ and $\sigma$ (i.e. somewhere inside $\mathbb{E}(\hat\sigma_t \cdot X_{t-\delta t})$ you have a term in $\mathbb{E}(K(\delta t) \cdot \sigma_{t-\delta t} \cdot X_{t-\delta t})$, where $K$ is your kernel). It may add biais if you use your kernel volatility estimate to build other estimators. And not only for multiplications.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2014-03-02T17:42:13.867" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10435" PostTypeId="2" ParentId="10429" CreationDate="2014-03-02T20:56:47.907" Score="12" Body="&lt;p&gt;A popular open-source option for the numerics in .NET is Math.NET (&lt;a href=&quot;https://github.com/mathnet/mathnet-numerics&quot;&gt;https://github.com/mathnet/mathnet-numerics&lt;/a&gt;). It has both managed implementations and allows you to use the optimized MKL native libraries. This use of .NET as a front-end to an optimized native library is quite common.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Meta.Numerics (&lt;a href=&quot;http://www.meta-numerics.net&quot;&gt;http://www.meta-numerics.net&lt;/a&gt;) is an alternative open-source library which is quite strong on various statistical distributions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ILNumerics (&lt;a href=&quot;http://ilnumerics.net/&quot;&gt;http://ilnumerics.net/&lt;/a&gt;) is free or paid for, and gives a highly optimized managed numerics library - with performance that is comparable with C or Fortran, though not as fast as MKL. It also has rich visualization tools.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Extreme Optimization (&lt;a href=&quot;http://www.extremeoptimization.com/&quot;&gt;http://www.extremeoptimization.com/&lt;/a&gt;) is a rich commercial library.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For linking to R, you'd use R.NET (&lt;a href=&quot;https://rdotnet.codeplex.com/&quot;&gt;https://rdotnet.codeplex.com/&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For charting (WinForms or WPF), OxyPlot (&lt;a href=&quot;https://oxyplot.codeplex.com/&quot;&gt;https://oxyplot.codeplex.com/&lt;/a&gt;) is a great open-source project. If you already use Excel as your substrate, you might rather use Excel's charting - you'll probably have a more coherent solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For optimization (and stuff like machine learning) you might consider Accord.NET (&lt;a href=&quot;http://accord-framework.net/&quot;&gt;http://accord-framework.net/&lt;/a&gt;) (LGPL license). However, the built-in GRG solver in Excel is excellent if your problem fits. Constrained, non-linear, derivative-free optimization codes (some merged into Accord.NET) are discussed here: &lt;a href=&quot;http://cureos.blogspot.com/2012/05/derivative-free-nonlinear-optimization.html&quot;&gt;http://cureos.blogspot.com/2012/05/derivative-free-nonlinear-optimization.html&lt;/a&gt; .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another optimization library is from Microsoft - the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ff524509%28v=vs.93%29.aspx&quot;&gt;Microsoft Solver Foundation 3.1&lt;/a&gt; now has a Nelder-Mead solver for nonlinear programming problems. While there is a matching Excel add-in for driving the Solver Foundation, you might also &lt;a href=&quot;http://mikejuniperhill.blogspot.com/2013/06/using-ms-solver-foundation-and-c-in.html&quot;&gt;integrate it as worksheet functions using Excel-DNA&lt;/a&gt;. The licensing is a bit confusing though, and I'm not sure it's being actively developed any more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a final link, I'll add Dodoni.net (&lt;a href=&quot;https://dodoni.codeplex.com/&quot;&gt;https://dodoni.codeplex.com/&lt;/a&gt;): &lt;em&gt;&quot;Dodoni.net is a free/open-source library with the aim to provide a framework for quantitative finance (pricing and risk management) as well as for general numerical methods (i.e. numerical integration, FFT, optimization etc.). The main idea is to construct a flexible and easy to use toolbox which is easy extendable by 3th party libraries.&quot;&lt;/em&gt; It includes native back-end bindings, and integration into Excel via &lt;a href=&quot;http://excel-dna.net&quot;&gt;Excel-DNA&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1718" LastEditorUserId="1718" LastEditDate="2014-03-03T11:56:08.670" LastActivityDate="2014-03-03T11:56:08.670" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10437" PostTypeId="2" ParentId="10422" CreationDate="2014-03-03T00:24:53.300" Score="2" Body="&lt;p&gt;Apart from the usual risks measured by Greeks there's risk associated with volatility dynamics. Volatility surface moves with stock movement and is usually dependant on stock price level. This risk is usually modelled by extensions to volatility models that take underlying price into account or stochastic volatility models (e.g. SABR).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way to do pre-trade risk check would be to analyse Greeks, look at Greeks dynamics with underlying and volatility movement (the so called risk matrix) assuming the shape of volatility surface changes with underlying price movement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The risk management after putting a position on is the same as pre-trade - follow the same rules and check your risk on time intervals (e.g. every hour) or price movements (e.g. when stock moves more that 1 daily standard deviation).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets compare the three strategies:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Long OTM call, delta hedged&lt;/li&gt;&#xA;&lt;li&gt;ATM straddle&lt;/li&gt;&#xA;&lt;li&gt;Long OTM call&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;A long ATM delta-hedged call is equivalent to ATM straddle in every way so I assume you are talking about OTM options in #1. I've picked calls just as example, it's similar with puts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Long OTM call, delta hedged&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With this strategy you can choose optimal gamma-to-vega ratio by picking the strike of OTM call. The strategy will make money from both gamma and vega but will have more exposure to vol surface dynamics compared to straddle. It's very common that such strategy loses money in a rising market due to vol surface dynamics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;ATM straddle&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This strategy is similar to the first one but has more chances to make money in a rising market. The profit-loss boundary is only applicable if you intend to hold the position until expiry. The strategy usually  profits on large intra-day movements, there's no reason to hold until expiry. Read about gamma scalping for more info.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Long OTM call&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is not a volatility play, it's a directional bet so the risks are very different. Again, losing money in a rising market is not uncommon with this strategy.&lt;/p&gt;&#xA;" OwnerUserId="7216" LastActivityDate="2014-03-03T00:24:53.300" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10438" PostTypeId="1" CreationDate="2014-03-03T02:13:43.010" Score="1" ViewCount="179" Body="&lt;p&gt;I have an incomplete data set that looks like this:&#xA;&lt;img src=&quot;https://i.imgur.com/HhWD5oq.png&quot; alt=&quot;Imgur&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and I believe that it will continue to form a sigmoid-like shape. How can fit a sigmoid curve to this data given my assumption about what the complete shape should look like?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to do this in R.&lt;/p&gt;&#xA;" OwnerUserId="4801" LastEditorUserId="848" LastEditDate="2014-03-03T06:27:10.683" LastActivityDate="2014-03-03T06:27:10.683" Title="Fitting a sigmoid function to incomplete, structured, data" Tags="&lt;curve-fitting&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10439" PostTypeId="1" AcceptedAnswerId="10442" CreationDate="2014-03-03T06:28:23.047" Score="4" ViewCount="279" Body="&lt;p&gt;This is a question I came across while reading:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$W = (W_t)_{t\geq{0}}$ is a standard BM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\mu\in \mathbb{R}$, and let $\tau_{a}^{\mu}$ = $\inf(t&amp;gt;0;W_t = a + \mu{t})$ be the first passage time of a BM to the boundary $a+\mu{t}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to know:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;the Laplace transform of $\tau_{a}^{\mu}$;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;the probability $\mathbb{P}(\tau_{a}^{\mu} &amp;lt; \infty)$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I am thinking of using Girsanov Theorem to transform the BM. All solutions welcome.&lt;/p&gt;&#xA;" OwnerUserId="6765" LastEditorUserId="7279" LastEditDate="2014-03-03T08:13:59.453" LastActivityDate="2014-03-03T09:20:29.600" Title="Linear-Boundary Crossing Problem for Brownian Motion" Tags="&lt;finance&gt;&lt;brownian-motion&gt;&lt;quantitative&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10442" PostTypeId="2" ParentId="10439" CreationDate="2014-03-03T09:20:29.600" Score="3" Body="&lt;p&gt;&lt;strong&gt;Question 2&lt;/strong&gt;  has a straight forward solution using a differential equation approach: $\mathbb{P}(\tau^\mu_a&amp;lt;\infty)=1$&#xA;The &lt;a href=&quot;http://disi.unal.edu.co/~gjhernandezp/mathcomm/slides/bm.pdf&quot; rel=&quot;nofollow&quot;&gt;following link (pp. 21 f.)&lt;/a&gt; explains it nicely (and is also very detailed) - could not write it much better.&#xA;If you were to google &quot;brownian motion linear boundary&quot; you will get additional results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also if you are generally interested in this type of problem I can recommend the following paper on &lt;a href=&quot;http://arxiv.org/pdf/0902.2569.pdf?origin=publication_detail&quot; rel=&quot;nofollow&quot;&gt;Integral Equations and the first passage time of BM&lt;/a&gt;. It contains a short literature review and deals with a more general boundry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question 1&lt;/strong&gt; mainly entails finding the density function for $\tau^\mu_a$ &#xA;This density is also known as the &lt;a href=&quot;http://books.google.de/books?id=uLgeYHOxZCcC&amp;amp;pg=PA47&amp;amp;dq=Bachelier-Levy%20formula,&amp;amp;hl=de&amp;amp;sa=X&amp;amp;ei=kkQUU9yaFoKGswa9_IHIAw&amp;amp;ved=0CCMQ6AEwAQ#v=onepage&amp;amp;q=Bachelier-Levy%20formula,&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;Bachelier-Levy formula&lt;/a&gt; (&lt;a href=&quot;http://homepages.ulb.ac.be/~grdeelst/Blatter.pdf&quot; rel=&quot;nofollow&quot;&gt;also see here&lt;/a&gt;) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$p(t)=\frac{a}{t^{3/2}}\Phi(\frac{a+\mu t}{\sqrt{t}})$ with $\Phi(y)=\frac{1}{\sqrt{2\pi}}e^{-y^2/2t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Inserting this result into the general formula for the laplace transform gives:&#xA;$\mathcal{L}(\tau^\mu_a)(s)=\mathbb{E}[e^{-s \tau^\mu_a}]=\int_{-\infty}^{+\infty}e^{-sx}p(x)dx$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The desired result then follows by straight forward integration.&lt;/p&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-03-03T09:20:29.600" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10444" PostTypeId="2" ParentId="4049" CreationDate="2014-03-03T12:37:18.500" Score="11" Body="&lt;p&gt;To recover the Black-Scholes pricing equation, you should first express the standard normal cdf in terms of its characteristic function analogous to the Heston solution:&#xA;$$&#xA;N(x) = \frac{1}{2} - \frac{1}{\pi} \int_0^{\infty} Re [\frac{e^{-i\phi x} f(\phi)}{i\phi}] d\phi&#xA;$$&#xA;where $f(\phi)$ is the characteristic function of the standard normal distribution:&#xA;$$&#xA;f(\phi) = e^{-\frac{1}{2}\phi^2}.&#xA;$$&#xA;Hence, the Black-Scholes formula becomes&#xA;$$&#xA;    C(S,t) = S P_1 - K e^{-r(\tau)} P_2,&#xA;$$&#xA;where&#xA;$$&#xA;    P_j = \frac{1}{2} - \frac{1}{\pi} \int_0^{\infty} Re [\frac{e^{-i\phi d_j} f(\phi)}{i\phi}] d\phi \\&#xA;    f_j = e^{-\frac{1}{2}\phi^2}, \\&#xA;    d_1 = \frac{\ln(\frac{S}{K})+(r+\frac{\nu_0}{2})(\tau)}{\sqrt{\nu_0}\sqrt{\tau}} \\&#xA;    d_2 = \frac{\ln(\frac{S}{K})+(r-\frac{\nu_0}{2})(\tau)}{\sqrt{\nu_0}\sqrt{\tau}} = d_{1}-\sqrt{\nu_0}\sqrt{\tau}.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The distribution in the Black-Scholes model is standardized whereas in the Heston model, it is not. It may be easier to first transform the $P_j$ terms so that they have a similar structure. With $x=\log(S)$, the $P_j$ terms can be rewritten as:&#xA;$$&#xA;    P_1 = \frac{1}{2} + \frac{1}{\pi} \int_0^{\infty} Re [\frac{e^{-i\phi \log(K)} e^{i\phi x + i\phi r \tau } f_1(\phi)}{i\phi}] d\phi \\&#xA;    f_1 = e^{\frac{1}{2} i v_0\tau\phi -\frac{1}{2} v_0 \tau \phi^2}, \\&#xA;    P_2 = \frac{1}{2} + \frac{1}{\pi} \int_0^{\infty} Re [\frac{e^{-i\phi \log(K)} e^{i\phi x + i\phi r \tau } f_2(\phi)}{i\phi}] d\phi \\&#xA;    f_2 = e^{-\frac{1}{2} i v_0\tau\phi -\frac{1}{2} v_0 \tau \phi^2}. \\&#xA;$$&#xA;In this form, you should be able to show that the Heston model converges to the Black-Scholes model as $\sigma \to 0$ when $\theta = v_0$ (although the details may be rather tedious to go through...). You may want to try equivalent formulations of the solution, other than Heston's original (e.g. the form in Gatheral: The Volatility Surface or Cont &amp;amp; Tankov: Financial modeling with Jump Processes), which avoid the division by zero problem a bit.&lt;/p&gt;&#xA;" OwnerUserId="7396" LastEditorUserId="7396" LastEditDate="2014-03-04T16:43:22.613" LastActivityDate="2014-03-04T16:43:22.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10446" PostTypeId="1" CreationDate="2014-03-03T18:06:49.507" Score="0" ViewCount="294" Body="&lt;p&gt;I'm trying to compare trading venues using a quantitative product selection matrix (and eventually software vendors using a different matrix specifically for vendors), and I was wondering if anyone could give me some input on what features are most important when it comes to Foreign Exchange trading venues.  I really need to learn how to obtain the concrete numbers on the important features such as latency numbers, fixed / variable costs, or liquidity as the company websites do not provide this information.  This information is crucial to my analysis and I'm currently at a loss on how to obtain it.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/7766/how-do-you-evaluate-an-fx-market-ems&quot;&gt;This post is an example of the sort of information I'm looking for.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Your aggregator should be coding not just to the FIX feeds but the specialized protocols. FIX just gives the bare minimum. For example, Hotspot's FIX certainly works but is throttled and doesn't have the full market data detail. You need their Itch. For Currenex, you need their Itch and Ouch.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would I go about finding out that Hotspot's FIX doesn't provide market data detail?  Only by using the platform for trading? Certain platforms requiring additional features while others really do not is exactly the kind of information I'm after.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the list of companies I'm trying to obtain information on.  I realize I've listed some software vendors, but I'm currently focused on the trading venues.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;FXall &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Currenex &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Integral&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Market Factory&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;HotSpot FX&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;First Derivatives&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;PLC SmartTrade&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Technologies&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;FlexTrade&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Apama&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Portware&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Thank you very much for any advice anyone has to offer.  Also, I have only been doing research on FX trading venues / software vendors for a month or two so I apologize in advance if I am focusing on the wrong ideas.&lt;/p&gt;&#xA;" OwnerUserId="7426" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2014-03-04T14:37:31.620" Title="How to obtain specific information on FX trading systems?" Tags="&lt;high-frequency&gt;&lt;fx&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10447" PostTypeId="2" ParentId="10446" CreationDate="2014-03-03T18:25:04.290" Score="2" Body="&lt;p&gt;I'm guessing that your question will be closed soon, but I wish to help you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your question doesn't make complete sense. Are you looking for a &quot;trading platform&quot; as in an electronic trading venue, or a software built around handling market data and order execution?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FXAll, Currenex, Hotspot and Integral are trading venues, while Apama, FlexTrade and Portware are software vendors that focus on market data management and order execution.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2014-03-03T18:25:04.290" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10451" PostTypeId="1" CreationDate="2014-03-03T23:44:37.463" Score="6" ViewCount="10428" Body="&lt;p&gt;In the case of a vanilla bond I know that the duration will be less than the time to maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I am observing that for a non-vanilla bond, the duration is greater than time to maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can somebody provide the intuition for this? How is this possible and why this is the case?&lt;/p&gt;&#xA;" OwnerUserId="7432" LastActivityDate="2020-02-05T17:46:48.913" Title="Can the duration of a bond be greater than Time to Maturity" Tags="&lt;bond&gt;&lt;duration&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10454" PostTypeId="2" ParentId="10451" CreationDate="2014-03-04T08:12:19.370" Score="5" Body="&lt;p&gt;Like Aksakal already mentioned in his comment it might depend on the duration formula you use.&#xA;(see e.g. the &lt;a href=&quot;http://en.wikipedia.org/wiki/Bond_duration&quot; rel=&quot;noreferrer&quot;&gt;wikipedia page&lt;/a&gt; or &lt;a href=&quot;http://www.treasurer.ca.gov/cdiac/publications/duration.pdf&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;) It can also depend on the type of  instrument as mentioned by Richard. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This topic has also been already discussed &lt;a href=&quot;http://www.wilmott.com/messageview.cfm?catid=3&amp;amp;threadid=78122&quot; rel=&quot;noreferrer&quot;&gt;on the Wilmott Forum&lt;/a&gt; &lt;em&gt;(their proposed solution is a reverse floater)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Theoretically &lt;strong&gt;bonds with embedded options&lt;/strong&gt; (e.g. callable bonds) could also produce a duration greater than their maturity. For such instruments a different approach is needed to calculate their duration.(see &lt;a href=&quot;http://en.wikipedia.org/wiki/Bond_duration&quot; rel=&quot;noreferrer&quot;&gt;effective duration&lt;/a&gt; - you will have to scroll down a bit ) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Duration_{eff}=\frac {V_{-\Delta y}-V_{+\Delta y}}{2(V_0)\Delta y}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus if there was a strong assymmetry in the sensitivity to up and down movements of the interest rate the effective duration could produce large and even negative values. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; the effective duration is the weighted sum of directional derivatives. The resulting value no longer has an interpreation as a point in time. It is &lt;strong&gt;primarily a price sensitivity measure&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Another approach&lt;/strong&gt; to reproducing a negative duration is to use the &quot;break-even&quot;-interpretation&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Some interpret duration as the &quot;break even point&quot; or&#xA;  length of time needed to hold a security to break even.  A 100 bond&#xA;  that sells for 110 needs extra dividend payments to break even. Thus: the higher the earlier cashflows the lower the duration.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Thus most straight forward case to reproduce a duration greater than time to maturity is &lt;strong&gt;adding a negative cash-flow&lt;/strong&gt; - this way we postpone the &quot;break even point&quot; &lt;em&gt;(I must admit - the resulting product will no longer be a stereotypical bond)&lt;/em&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using &lt;a href=&quot;http://en.wikipedia.org/wiki/Bond_duration&quot; rel=&quot;noreferrer&quot;&gt;the Macaulay duration&lt;/a&gt; and assuming that the discount factors are given by $e^{-t*Yield_t}$ I have created a simple example (see table below) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the example below we have an extreme case:  negative cash-flow quite early and the offsetting cash-flows are only due at the end of maturity. Thus the formula outputs a duration greater than time to maturity Indicating that the &quot;break-even&quot; happens very late.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The interpretation of duration as the &quot;break-even-time&quot; has only an indicational value. Thus it is often not the actual break-even-time but more of an indicator of how long you might have to wait until you have rcouperated your investment. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/m5qU6.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="7279" LastEditDate="2014-03-04T09:42:08.680" LastActivityDate="2014-03-04T09:42:08.680" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10455" PostTypeId="1" CreationDate="2014-03-04T10:27:43.753" Score="0" ViewCount="2861" Body="&lt;p&gt;What is the difference between the Markit Manufacturing PMI and the ISM Manufacturing PMI? The monthly number differs a lot, my understanding is that they are trying to indicate the same thing.&lt;/p&gt;&#xA;" OwnerUserId="7406" LastEditorUserId="16595" LastEditDate="2018-07-22T20:36:26.297" LastActivityDate="2018-07-22T20:36:26.297" Title="Markit PMI vs ISM PMI" Tags="&lt;index&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10456" PostTypeId="2" ParentId="4336" CreationDate="2014-03-04T11:12:46.113" Score="0" Body="&lt;p&gt;I suggest you to take a look to the &lt;a href=&quot;http://www.ccruncher.net&quot; rel=&quot;nofollow&quot;&gt;CCruncher project&lt;/a&gt;, an open-source project for credit risk modeling. It is a framework consisting of two elements: a &lt;a href=&quot;http://www.ccruncher.net/ccruncher.pdf&quot; rel=&quot;nofollow&quot;&gt;technical document&lt;/a&gt; (introducing the t-Student multi-factor copula model, parameters estimation, etc.), and a software program that implements the Monte Carlo procedure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently, CCruncher considers that factors are industry sectors. It allows the risk disaggregation by region, location, types of obligors, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The discussion 'single factor vs multi-factor' can be responded in the parameter calibration stage and depends on the available historical data and AIC/BIC/DIC values.&lt;/p&gt;&#xA;" OwnerUserId="7438" LastActivityDate="2014-03-04T11:12:46.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10457" PostTypeId="2" ParentId="399" CreationDate="2014-03-04T11:40:52.183" Score="2" Body="&lt;p&gt;It is not as simple as changing a value. You need to replace the current factor loadings by feasible values. Furthermore, factor loadings have  dependencies between them, that means that when you change one of them, the other factors are affected by this change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the &lt;a href=&quot;http://www.ccruncher.net/ccruncher.pdf&quot; rel=&quot;nofollow&quot;&gt;CCruncher Technical Document&lt;/a&gt; there is a proposal to do so. It propose to estimate the factor loadings uncertainty, and then transfer this uncertainty to the portfolio credit risk measure (EL, VaR, ES).&lt;/p&gt;&#xA;" OwnerUserId="7438" LastActivityDate="2014-03-04T11:40:52.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10458" PostTypeId="1" AcceptedAnswerId="15434" CreationDate="2014-03-04T14:34:00.820" Score="10" ViewCount="883" Body="&lt;p&gt;The Longstaff-Schwartz LSM approach is nowadays ubiquitous(at least in the academic literature) in pricing path dependant derivatives. Up to now I have mostly worked with lattice methods. My experience in impelemting those has shown that there are often ways to tweak them and also lot of pittfalls along the way. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To those of you who have some experience in working with LSM:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Aside from the usual Monte-Carlo-Optimization techniques (e.g. variance reduction, importance sampling etc.) &lt;strong&gt;are there any optimizations that are particular to the LSM approach ?&lt;/strong&gt;&#xA;&lt;em&gt;(Perhaps some paper on the choice of the interpolating polynomial) ?&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What are possible pittfalls when implementing and working with the&#xA;model ? When can LSM go really wrong/ in which cases does it fail to price correctly ?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="7279" LastEditDate="2014-03-04T17:01:18.110" LastActivityDate="2018-10-21T16:59:13.283" Title="Practical implementation of Least Squares Monte Carlo (tweaks and pittfalls)" Tags="&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;best-practices&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="10459" PostTypeId="2" ParentId="10446" CreationDate="2014-03-04T14:37:31.620" Score="1" Body="&lt;p&gt;different features? a euro is a euro no matter where it's traded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have to identify what you want to do. Why are you trading? Do you want execution only, or delivery? Are you covering cashflows or taking speculative positions? Are you going to trade manually or with automation? How many provider relationships do you want to refer to? Do you want to trade with banks, or peer to peer? What technology do you want to use? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then put the various ECN and measure their strengths and weaknesses.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2014-03-04T14:37:31.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10460" PostTypeId="2" ParentId="1106" CreationDate="2014-03-04T14:39:58.503" Score="1" Body="&lt;p&gt;Have a look at Treasury Operations Handbook by Philip J.L. Parker &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Link: &lt;a href=&quot;http://www.amazon.co.uk/dp/1446194507&quot; rel=&quot;nofollow&quot;&gt;http://www.amazon.co.uk/dp/1446194507&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2014-03-04T14:39:58.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10462" PostTypeId="2" ParentId="7994" CreationDate="2014-03-04T17:10:56.920" Score="1" Body="&lt;p&gt;The paper by Marc Romano and Nizar Touzi, Section 3, contains a general proof that a stochastic volatility model cannot be complete in the sense that the addition of the option completes the market (in the sense of Harrison and Pliska) generated by the underlying and risk-free borrowing/lending:&#xA;&lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.407.6122&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow&quot;&gt;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.407.6122&amp;amp;rep=rep1&amp;amp;type=pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The paper only deals with a bivariate diffusion with correlated Wiener noise. &lt;/p&gt;&#xA;" OwnerUserId="7396" LastActivityDate="2014-03-04T17:10:56.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10464" PostTypeId="2" ParentId="10401" CreationDate="2014-03-05T02:47:15.900" Score="3" Body="&lt;p&gt;As an overview, &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1119990726&quot; rel=&quot;nofollow&quot;&gt;Expected Returns&lt;/a&gt;, by Antti Ilmanen, was recommended to me. He has a preference for data over theory, so it will appeal to quants. The book is longish, and got a bit heavy at times, but he covers all the investment products and all styles of investing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The biggest problem might be that it is now 3 years old, and was heavily influenced by events in 2007/2008. I wonder if the author is working on a 2nd edition...&lt;/p&gt;&#xA;" OwnerUserId="1587" LastActivityDate="2014-03-05T02:47:15.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10465" PostTypeId="1" AcceptedAnswerId="10466" CreationDate="2014-03-05T04:15:05.240" Score="5" ViewCount="4421" Body="&lt;p&gt;After the financial crisis in 2008, many people (including me) don't really believe that stock returns can be described in terms of the normal distribution (Gaussian distribution).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But besides the Gaussian distribution, is there any other distribution that was found to be a better way of describing how the stock market behaves?&lt;/p&gt;&#xA;" OwnerUserId="129" LastEditorUserId="12" LastEditDate="2014-03-06T07:41:59.147" LastActivityDate="2014-03-09T10:11:52.133" Title="An alternative to the Gaussian distribution to describe/fit market stock returns" Tags="&lt;equities&gt;&lt;normal-distribution&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10466" PostTypeId="2" ParentId="10465" CreationDate="2014-03-05T07:59:34.980" Score="7" Body="&lt;p&gt;I think one has to distinguish between pricing and fitting/reproducing empirical stock returns. A model might fit the empirical stock returns extremly well but fail to reproduce derivative prices.  In my answer I will assume that you are interested in reproducing the empirical stock returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Mandelbrot and the Stable Paretian Hypothesis&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most salient difference between the Normal distribution and the real world data are the &lt;strong&gt;heavy tails&lt;/strong&gt;. &#xA;This has been first noted (or at least publicly asserted) by &lt;a href=&quot;http://de.wikipedia.org/wiki/Beno%C3%AEt_Mandelbrot&quot; rel=&quot;noreferrer&quot;&gt;Bernoit Mandelbrot&lt;/a&gt; and resulted in his &lt;strong&gt;&lt;a href=&quot;http://web.williams.edu/Mathematics/sjmiller/public_html/341/handouts/Fama_MandelbroitAndStableParetianHypothesis.pdf&quot; rel=&quot;noreferrer&quot;&gt;Stable Paretian Hypothesis&lt;/a&gt;&lt;/strong&gt;. Mandelbrot argued that contrary to the Gaussian-Haypothesis the variance of stock returns can be infinite resulting in heavy tails. He proposes the use of  &lt;a href=&quot;http://en.wikipedia.org/wiki/Stable_distribution&quot; rel=&quot;noreferrer&quot;&gt;stable distributions&lt;/a&gt; with infinite variance - that also known as &lt;strong&gt;stable paretian distributions&lt;/strong&gt;. (for more on the stable paretian distributions see once again the paper on elaborating on the &lt;a href=&quot;http://web.williams.edu/Mathematics/sjmiller/public_html/341/handouts/Fama_MandelbroitAndStableParetianHypothesis.pdf&quot; rel=&quot;noreferrer&quot;&gt;Stable Paretian Hypothesis&lt;/a&gt;)  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus most contemporary approaches focuse on designing distributions (or processes with transition densities) that feature heavy tails. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Concrete suggestions&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all I don't think &quot;the one&quot; distribution for stock returns actually exists. Heavy-Tail ones will in most cases outperform the Normal distribution. The concrete choice may depend on the data one is working with. Still, there is a couple of examples worth mentioning. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;strong&gt;Heston-Model&lt;/strong&gt; does a decent job in capturing the high kurtosis and the fat tails of stock returns. The paper &lt;a href=&quot;http://arxiv.org/pdf/cs/0305055v1.pdf&quot; rel=&quot;noreferrer&quot;&gt;Goodness-of-fit of the Heston model&lt;/a&gt; provides a detailes analysis. As it turns out the Heston-Model is well suited for reproducing daily and up to monthly returns but doesn't perform as well with annual stock returns. The original paper on the transition density of the HM can be &lt;a href=&quot;http://arxiv.org/pdf/cond-mat/0203046.pdf&quot; rel=&quot;noreferrer&quot;&gt;found here&lt;/a&gt;. The authors also have their own paper discussing how well the Heston-Model performs with respect to empirical stock returns (&lt;a href=&quot;http://physics.umd.edu/~yakovenk/papers/PhysicaA-324-303-2003.pdf&quot; rel=&quot;noreferrer&quot;&gt;Comparison between the probability distribution&#xA;of returns in the Heston model and empirical&#xA;data for stock indexes&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can also wholeheartedly recommend the paper on &lt;a href=&quot;http://www.econ.boun.edu.tr/content/wp/EC2013_16.pdf&quot; rel=&quot;noreferrer&quot;&gt;the Goodness-of-fit of the Heston, &lt;strong&gt;Variance-Gamma&lt;/strong&gt; and&#xA;&lt;strong&gt;Normal-Inverse Gaussian Models&lt;/strong&gt;&lt;/a&gt;&#xA;It is very extensive, comprehensive and simultaneously provides a good introduction to the respective models&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Due to it's fat tails the &lt;strong&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Student%27s_t-distribution&quot; rel=&quot;noreferrer&quot;&gt;student-t distribution&lt;/a&gt;&lt;/strong&gt; also performes reasonably well at reproducing market stock returns. &lt;em&gt;As Aksakal has already mentioned in the comments below Student t is not a stable distribution.&lt;/em&gt; Still, there are some references using it to fit stock returns and even to construct a random walk. For a reference on the prior confer the paper by Eckhard Platen on &lt;a href=&quot;http://www.qfrc.uts.edu.au/research/research_papers/rp194&quot; rel=&quot;noreferrer&quot;&gt;Empirical Evidence&#xA;on Student-tLog-Returns of Diversied World Stock Indices&lt;/a&gt;. A construction of student t random walk can be found in &lt;a href=&quot;http://books.google.de/books?id=ZABv5sBn7Y4C&amp;amp;pg=PA476&amp;amp;lpg=PA476&amp;amp;dq=student%20t%20transition%20density&amp;amp;source=bl&amp;amp;ots=rGrXoZGRiy&amp;amp;sig=Sc0Jb0BbDCU9Pkugel8u9OC2iuk&amp;amp;hl=de&amp;amp;sa=X&amp;amp;ei=_lYXU_OcI4eN4gSduYD4Aw&amp;amp;ved=0CEEQ6AEwAQ#v=onepage&amp;amp;q=student&amp;amp;f=false&quot; rel=&quot;noreferrer&quot;&gt;A Benchmark Approach to Quantitative Finance&lt;/a&gt; by Platen and Heath. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How to go from transition density to the distribution of returns&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My explanation above did not calrify how knowing the transition density of a process also gives information on the distribution/density of the returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume a process $\ln(X_t)$ has the transition density $p(s,x,t,y)$. $p(s,x,t,y)$ can be interpreted as the probability of the process to move from $X_s=x$ at time $s$ to $X_t=y$ at time $t$. Thus if we set $s=0, x=0$ and $t=\Delta t$ (e.g. one day, one weel etc) we arrive at a density $p(0,0,\Delta t,y)$. This function describes the probability of the process to increass by $y$ within a time step of $\Delta t$. Thus depending on choice of $\Delta t$ wone is able to retrieve the theoretical. distribution of daily, montly, etc. returns. &lt;/p&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="7279" LastEditDate="2014-03-06T14:53:16.080" LastActivityDate="2014-03-06T14:53:16.080" CommentCount="23" ContentLicense="CC BY-SA 3.0" />
  <row Id="10467" PostTypeId="2" ParentId="141" CreationDate="2014-03-05T08:51:32.697" Score="11" Body="&lt;p&gt;Quandl is a free one, with good economic and market data and an API&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.quandl.com/&quot;&gt;http://www.quandl.com/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6356" LastActivityDate="2014-03-05T08:51:32.697" CommentCount="0" CommunityOwnedDate="2014-03-05T08:51:32.697" ContentLicense="CC BY-SA 3.0" />
  <row Id="10468" PostTypeId="1" CreationDate="2014-03-05T09:30:51.220" Score="0" ViewCount="1008" Body="&lt;p&gt;I have a sorted &lt;strong&gt;historical&lt;/strong&gt; P&amp;amp;L vector of 250 days and say, I want to calculate the 90% VaR on this distribution. I will look for the 225 element (90% * 250 = 225) and this will be my Value at Risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now how to back test the VaR model ? If I look for the number of days in last year that the Loss exceeded the VaR, it will always be 25 days, since by &lt;strong&gt;construction&lt;/strong&gt;, it's the number which corresponds to the quantile of the VaR...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And in case the VaR model is not valid, what is usually done ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I missing something please ? Thanks&lt;/p&gt;&#xA;" OwnerUserId="7120" LastActivityDate="2014-03-05T12:28:55.087" Title="How to backtest the VaR model?" Tags="&lt;backtesting&gt;&lt;var&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10469" PostTypeId="2" ParentId="10381" CreationDate="2014-03-05T10:03:00.013" Score="1" Body="&lt;p&gt;I would confirm it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For time series forecasting, one can use 3 versions of random walk:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;RW model 1 (basic geometric random walk): stock returns in different periods are statistically independent (uncorrelated) and identically distributed (constant volatility)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;RW model 2: stock returns in different periods are statistically independent bot not identically distributed: volatility might change deterministically over time or depend on the current price level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;RW model 3: stock returns in different periods are statistically independent (uncorrelated) but not otherwise independent, so the volatility in one period might depend on the volatility in recent periods.  (G)ARCH models give a particular behaviour for such volatility dependence: it follows an autoregressive process. &lt;/p&gt;&#xA;" OwnerUserId="2872" LastActivityDate="2014-03-05T10:03:00.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10470" PostTypeId="2" ParentId="10468" CreationDate="2014-03-05T10:57:25.103" Score="1" Body="&lt;p&gt;you should backtest in the future. Thus you calculate your VaR based on the last 250 business days and then look at the return tomorrow. You have to do this in a rolling/sliding fashion.&#xA;Your approach is in-sample and what you should do is out-of-sample.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The number of violations should be binomial. Furthermore you could do a runs test to test whether your violations do not cluster too much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having said this: the model will be ok but not good. In volatile times you will have too many violations. But it will be better than a Gaussian model as you capture the tails better.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2014-03-05T12:28:55.087" LastActivityDate="2014-03-05T12:28:55.087" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10471" PostTypeId="2" ParentId="1343" CreationDate="2014-03-05T11:06:38.590" Score="0" Body="&lt;p&gt;Any spread that adds to the risk free rate is made by credit spread (the counterparty will not return the security) and liquidity spread (the need of the market for that security). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a Repurchase agreement, when you give a security against receiving cash, the credit risk still stays with you. The haircut in the repo's security is to cover the market risk. In addition, any dividents the counterparty receives will be manufactured/repayed to you. The repo-rate will therefore be the liquidity spread of the security against the currency you make the repo within. The term of the spread is the duration of the repo. A perfectly liquid security will have the spread zero. The extra cost supported due to this spread is the price of illiquidity. &lt;/p&gt;&#xA;" OwnerUserId="2872" LastActivityDate="2014-03-05T11:06:38.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10472" PostTypeId="2" ParentId="9746" CreationDate="2014-03-05T11:12:50.490" Score="1" Body="&lt;p&gt;You can find a backtest for expected shortfall detailed in the paper below&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kerkhof, F.L.J., &amp;amp; Melenberg, B. (2004). Backtesting for risk-based regulatory capital. Journal of Banking and Finance, 28, 1845-1865.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best,&#xA;JK&lt;/p&gt;&#xA;" OwnerUserId="7448" LastActivityDate="2014-03-05T11:12:50.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10473" PostTypeId="1" CreationDate="2014-03-05T11:58:02.033" Score="4" ViewCount="6140" Body="&lt;p&gt;I've been trying to find out more about options positions which are both delta neutral and gamma neutral--created with some kind of calendar spread. Supposedly, such a trade will be perfectly hedged with relation to the underlying so that the value of the position will change only through a change in vega and possibly a small amount of theta. This would seem to be a good way to trade reversions of implied volatility...creating a positive vega position when betting on increasing implied volatility and creating a negative vega position when betting on decreasing implied volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It sounds like this would be a superior way to trade volatility since being gamma neutral would remove the need for continuous delta hedging. However, I don't read much about people doing this. What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="7449" LastActivityDate="2019-09-01T14:39:23.993" Title="Delta Neutral / Gamma Neutral Positions" Tags="&lt;options&gt;&lt;volatility&gt;&lt;implied-volatility&gt;&lt;delta-hedging&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10474" PostTypeId="1" CreationDate="2014-03-05T12:11:54.270" Score="2" ViewCount="366" Body="&lt;p&gt;I've read that the Zakamouline method suggests the best optimal hedging of options when taking transaction costs into account. I've read the article but am having difficulty understanding it well enough to put it into practice. Does anyone know what the equation would look like in Excel?&lt;/p&gt;&#xA;" OwnerUserId="7449" LastActivityDate="2014-03-05T12:11:54.270" Title="Zakamouline Optimal Hedging of Options with Transaction Costs" Tags="&lt;options&gt;&lt;delta-hedging&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10475" PostTypeId="1" CreationDate="2014-03-05T12:28:12.177" Score="5" ViewCount="1154" Body="&lt;p&gt;In the HJM model, in case we have 3 factors, do these factors have an economic meaning at all ?&lt;/p&gt;&#xA;" OwnerUserId="7450" LastActivityDate="2014-03-06T07:05:58.847" Title="3 Factor HJM model, do these factors have an economic meaning?" Tags="&lt;interest-rates&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10476" PostTypeId="1" AcceptedAnswerId="10478" CreationDate="2014-03-05T12:44:03.097" Score="1" ViewCount="157" Body="&lt;p&gt;Assume we have a VaR model wich says : the lost should not exceed X for more 3 days and we come up with more days where the lost exceeded X, what is usually done for the VaR model ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do we switch to Monte Carlo VaR ?&#xA;Do we keep the same VaR and add a security factor in the computing the required capital ?&#xA;Do we switch to excepcted shortfall ?&lt;/p&gt;&#xA;" OwnerUserId="7120" LastActivityDate="2014-03-05T13:41:53.893" Title="What would be an alternative if the VaR model is not acceptable?" Tags="&lt;var&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10477" PostTypeId="2" ParentId="10473" CreationDate="2014-03-05T12:56:30.793" Score="3" Body="&lt;p&gt;You can construct delta and gamma neutral option portfolio, but:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It won't generally stay neutral forever, so you would still have to constantly rebalance it by trading additional options (thus paying more transaction costs and creating mess in the portofolio). Anything will break the neutrality - underlying move, time passage, implied volatility change etc.&lt;/li&gt;&#xA;&lt;li&gt;Since you are trading different options, you gain additional risk exposure in implied volatility spreads.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you want to have large vega but small gamma, you can always trade options with long time to expiry. And conversely by trading options with short time to expiry you can have large gamma while having only small vega exposure.&lt;/p&gt;&#xA;" OwnerUserId="3120" LastActivityDate="2014-03-05T12:56:30.793" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10478" PostTypeId="2" ParentId="10476" CreationDate="2014-03-05T13:41:53.893" Score="3" Body="&lt;p&gt;In general I would answer your question in the following way: Alternatives to VaR which share most of its helpful properties but not its shortcomings are the so called coherent risk measures. They have the following properties:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;monotonicity &lt;/li&gt;&#xA;&lt;li&gt;sub-additivity&lt;/li&gt;&#xA;&lt;li&gt;homogeneity and &lt;/li&gt;&#xA;&lt;li&gt;translational invariance&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;One example would be the conditional value-at-risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find more on Wikipedia:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Coherent_risk_measure&quot; rel=&quot;nofollow&quot;&gt;coherent risk measures&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Expected_shortfall&quot; rel=&quot;nofollow&quot;&gt;conditional value-at-risk&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="12" LastActivityDate="2014-03-05T13:41:53.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10479" PostTypeId="1" CreationDate="2014-03-05T13:48:04.747" Score="2" ViewCount="256" Body="&lt;p&gt;Would the exposures between standard method and internal rating based method for credit risk under Basel III remain same?I could not find any documents for IRB approach under Basel III. Is it still evolving?&lt;/p&gt;&#xA;" OwnerUserId="7452" LastActivityDate="2014-03-05T13:48:04.747" Title="regarding Basel III IRB method for credit risk" Tags="&lt;risk&gt;&lt;risk-management&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10480" PostTypeId="1" AcceptedAnswerId="17540" CreationDate="2014-03-05T13:54:09.147" Score="8" ViewCount="1003" Body="&lt;p&gt;volatility clustering and mean reversion are very well known properties that one could use when trading. Traders, especially in options world, do take realized vol into account (e.g. by forecasting it or looking at which percentile does the current volatility correspond). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am wondering if also intraday volumes have the same kind of properties that can be exploited somehow. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see that some traders look at volume profiles and use indicators like VWAP (volume-weighted averaged price) and PVP (peak volume price, thus the price where the largest intraday volume was traded). In general they assume that intraday volumes tend to generate a symmetric distribution thus following this kind of rule to forecast the price direction: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;if the PVP&gt;VWAP then the volumes distribution is skewed upside and this generates a &quot;pressure&quot; to prices to move downwards, at least untile the VWAP. &#xA;With PVP &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is an exception to this rule: when the price action is on one the extremes of the volume distribution (e.g. price&gt;PVP&gt;VWAP) then the previous logic doesn't apply (even if the PVP&gt;VWAP).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any statistical evidence that intraday volumes actually tend to generate symmetric distributions thus making it possible to exploit the temporary skewness that is generated intraday?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any study on that or anyone willing to share her/his experience on that? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for your help. &lt;/p&gt;&#xA;" OwnerUserId="7451" LastActivityDate="2015-04-28T12:20:04.300" Title="Do intraday volume and volatility share the same properties?" Tags="&lt;volatility&gt;&lt;trading&gt;&lt;econometrics&gt;&lt;volume&gt;&lt;intraday&gt;" AnswerCount="1" CommentCount="10" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10481" PostTypeId="1" CreationDate="2014-03-05T16:53:04.663" Score="0" ViewCount="40" Body="&lt;p&gt;can you provide me with some ideas to assess the profitability of round-trips? That is when I buy 100 shares of IBM at 10\$ and I resell them two days later at 11\$, how can I measure the profit made? Using which benchmark? How can I compare two round-trips on different stocks at different points in time? What do practitioners do in Banks/funds? &lt;/p&gt;&#xA;" OwnerUserId="6486" LastEditorUserId="1355" LastEditDate="2014-03-05T19:58:46.950" LastActivityDate="2014-03-05T19:58:46.950" Title="measuring the performance of round-trips on stocks" Tags="&lt;quant-trading-strategies&gt;&lt;performance-evaluation&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10482" PostTypeId="2" ParentId="10475" CreationDate="2014-03-05T19:17:47.347" Score="2" Body="&lt;p&gt;One of the motivations for multifactor models such as Two-Factor-HW, HJM and LMM (Lobor-Market-Model) is derived from the properties of the yield curve.&#xA;One can run a  Principal-Component-Analysis on yield-curve data in order to analyse the number of independant factors contributing to yield curve movements. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It has been shown that there are generally &lt;strong&gt;three types of movements a yield curve can undergo&lt;/strong&gt; (and thus also three factors driving it's movements):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;rougly flat (parallel shift → average rate)&lt;/li&gt;&#xA;&lt;li&gt;upward or downward sloping (tilt → slope )&lt;/li&gt;&#xA;&lt;li&gt;hump shaped (flex →curvature)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;One factor models such as Hull-White can only capture parallel shifts of the yield curve. Two factor models can either reproduce the tilt or the hump. With a three factor model all three common yield curve patterns can be modelled. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://books.google.de/books?id=9KA2F8BL53EC&amp;amp;pg=PA135&amp;amp;dq=yield%20curve%20principal%20component%20analysis&amp;amp;hl=de&amp;amp;sa=X&amp;amp;ei=wHQXU5O4EqSJ4AS78YGoCw&amp;amp;ved=0CEYQ6AEwAQ#v=onepage&amp;amp;q=yield%20curve%20principal%20component%20analysis&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;Fixed Income Markets and Their Derivatives&lt;/a&gt; (See p. 136 ) mentions/explains that the first two componetns of a PCA explain up to 95-98% of the variations of the yield curve. The remaining variation is mostly picked up by the fird factor. (I will also refer you to &lt;a href=&quot;http://books.google.de/books?id=KWURQ5uGn50C&amp;amp;pg=PA10&amp;amp;dq=yield%20curve%20principal%20component%20analysis&amp;amp;hl=de&amp;amp;sa=X&amp;amp;ei=wHQXU5O4EqSJ4AS78YGoCw&amp;amp;ved=0CDwQ6AEwAA#v=onepage&amp;amp;q=yield%20curve%20principal%20component%20analysis&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;Interest Rate Risk Modeling: The Fixed Income Valuation Course&lt;/a&gt; as an alternative source)&lt;/p&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="7279" LastEditDate="2014-03-06T07:05:58.847" LastActivityDate="2014-03-06T07:05:58.847" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10483" PostTypeId="2" ParentId="7994" CreationDate="2014-03-05T20:59:31.360" Score="2" Body="&lt;p&gt;I think a sketch of the proof would look like this &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say you start from &#xA;$$&#xA;  dS_t = S_t \odot (\mu_t dt + \sigma_t dW_t)&#xA;$$ &#xA;where $S$ is an vector valued process of your $n$ risky assets prices, $W$ a standard $k$-dimensionnal brownian motion under the historic probability, $\sigma_t$ an $n \times k$ matrix valued process and $\odot$ is the Hadamard coordinate by coordinate product of vectors. Add $S^0_t = e^{\int_0^t r_u du}$ the cash (risk free asset).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A risk premium process $\lambda$ is a solution of $\sigma_t\lambda_t = \mu_t - r_t \mathbf 1$ (with $\mathbf 1$ the $n$-dimensional vector of $1$'s). For each such solution you get a risk neutral probability $\mathbb{Q}^\lambda|_{\mathcal{F}_t} = \exp( - \int_0^t  \lambda_s dW_s - \frac{1}{2} \int_0^t |\lambda_s|^2 ds) \mathbb{P}|_{\mathcal{F}_t}$. Indeed you can write &#xA;$$&#xA;  dS_t = S_t \odot ( r_t \mathbf 1 dt + \sigma_t (\underbrace{dW_t + \lambda_t dt}_{dW^\lambda_t}) )&#xA;$$&lt;br&gt;&#xA;and Girsanov theorem tells you that $dW_t + \lambda_t dt$ is a $\mathbb{Q}^\lambda$-brownian motion. So $S/S^0$ is a local martingale under $\mathbb{Q}^\lambda$ (for the historic brownian filtration).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $k&amp;gt; n$ (for exemple $k=2$ and $n= 1$ in the Heston model) and $\sigma_t$ is of full rank then you get an infinite number of risk premiums so you have an infinite number of risk neutral probability measures so your market is incomplete. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess the devil is in the details like the integrability condition for $\lambda$ to actually define a probability measure but I think that's the basic idea.  &lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2014-03-12T19:42:42.007" LastActivityDate="2014-03-12T19:42:42.007" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10484" PostTypeId="2" ParentId="10473" CreationDate="2014-03-05T23:25:54.927" Score="8" Body="&lt;p&gt;Calendar spreads have a number of disadvantages for trading Vega:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Vega in different months are generally not additive, some traders use root-time-Vega but it does not remove the additional risk.&lt;/li&gt;&#xA;&lt;li&gt;You are trading time spread not just volatility, so be careful&lt;/li&gt;&#xA;&lt;li&gt;Calendar spreads are affected by dividends and rate changes - another source of risk.&lt;/li&gt;&#xA;&lt;li&gt;A gamma-neutral calendar spread is only neutral at a particular time and spot price. Options in different month have different Speed (DgammaDspot) and Color (dgammaDtime) which means that your position will be dis-balanced quickly.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Take a look at gamma-neutral ratio spread. It is much more stable and does not require frequent adjustments. It will be close to Vega-neutral as well but it's long Vomma so the position makes money with any change in volatility. The position will also have some residual delta which you can neutralize by trading stock.&#xA;E.g.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Short 10 puts at strike X&lt;/li&gt;&#xA;&lt;li&gt;Long 12 puts at a lower strike Y&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Disadvantage will be the skew risk (relative changes in IV of strikes X and Y). It also loses neutrality over time so some adjustments will be necessary if you hold the position for days/weeks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Butterflies and straddles are also good for short Vega plays. Make sure you gave them enough consideration before moving over to more complex stuff.&lt;/p&gt;&#xA;" OwnerUserId="7216" LastActivityDate="2014-03-05T23:25:54.927" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="10486" PostTypeId="1" CreationDate="2014-03-06T10:44:50.353" Score="1" ViewCount="50" Body="&lt;p&gt;Let's say we want to optimize the a function $f(x_1,\dots, x_n)$ with $(x_1, \dots , x_n) \in \mathbb{D}^n$. For the sake of simplicity let $\mathbb{D}^n$ be the unit sphere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We chose an optimization Algorithm $ALG_1(\vec{v})$ (here $\vec{v}$ is an input-vector necessary to intialise and run the algo. e.g. the starting-point)  and apply it to our problem. Now often one does not know whether the algorithm converges to  &quot;the maximum / minimum&quot; (on $\mathbb{D}^n$). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus I don't think that one would blindly accept the first output. One way of validating the result might be to run $ALG_1(\vec{v})$ with different $\vec{v}_1, \dots , \vec{v}_m$. Another could be using a different algorithm as a benchmark. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do people in quant finance (e.g. portfolio optimization) approach this problem ?&lt;/p&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-03-06T10:44:50.353" Title="Approaches to check/validate the output of an optimization algorithm" Tags="&lt;optimization&gt;&lt;algorithm&gt;&lt;best-practices&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10487" PostTypeId="1" CreationDate="2014-03-06T13:12:30.787" Score="3" ViewCount="170" Body="&lt;p&gt;I'm self-studying Skiadas' &lt;em&gt;Asset Pricing Theory&lt;/em&gt;, and find the definition of &lt;strong&gt;constrained market&lt;/strong&gt; on page 21 confusing(you can find it &lt;a href=&quot;http://press.princeton.edu/chapters/s8906.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; in the sample chapter).&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Deﬁnition 1.26. A &lt;strong&gt;constrained market&lt;/strong&gt; is a closed convex set of cash ﬂows &#xA;  $X \subseteq \Bbb R^{1+K}$ such that $0 \in X$ and for some $\epsilon &amp;gt; 0$, &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$x \in X$ and $0 &amp;lt; \| x \| &amp;lt;\epsilon$ implies $\frac{\epsilon}{\| x \|}x \in X.$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I know this definition renders missing market and short-sale constraints as special cases, but the underlying idea of this formulation still eludes me.&lt;/p&gt;&#xA;" OwnerUserId="7461" LastEditorUserId="7461" LastEditDate="2014-03-08T07:09:33.980" LastActivityDate="2014-03-08T07:09:33.980" Title="What's the underlying idea of definition of constrained market in Skiadas' Asset Pricing Theory?" Tags="&lt;modeling&gt;&lt;theory&gt;&lt;market-model&gt;&lt;convexity&gt;&lt;intuition&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10489" PostTypeId="1" AcceptedAnswerId="10514" CreationDate="2014-03-06T17:40:05.793" Score="6" ViewCount="1036" Body="&lt;p&gt;This topic has been prompted by the following question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/4239/measuring-behavioral-finance-effects-in-fund-portfolio-manager-analysis&quot;&gt;Measuring Behavioral Finance Effects in Fund/Portfolio Manager Analysis&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After reading it and the comments below I started thinking whether behavioral finance could be incorporated into pricing paradigms used by quants.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Couldn't option pricing to at least some extent benefit from it?  E.g. with &lt;strong&gt;american options pricing&lt;/strong&gt; - when pricing one mostly uses the continuation value to analyse whether the holder would exercise or not.&lt;/li&gt;&#xA;&lt;li&gt;Does literature on the interfacing of behavioural finance and pricing exit?&lt;/li&gt;&#xA;&lt;li&gt;How relevant is it in portfolio optimization ?&lt;/li&gt;&#xA;&lt;li&gt;What about an application to credit risk modeling ? &lt;strong&gt;Or Risk-Management in general&lt;/strong&gt;. In Basel III or Solvency II where the companies assets are projected into the future. This projections also include assumptions on how the management will act in certain situations.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2014-03-09T10:50:31.720" Title="Is Behavioral Finance relevant to quants?" Tags="&lt;option-pricing&gt;&lt;models&gt;&lt;behavioral-finance&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10490" PostTypeId="1" AcceptedAnswerId="10497" CreationDate="2014-03-06T18:52:47.337" Score="2" ViewCount="66" Body="&lt;p&gt;Suppose your portfolio has $w_0$ amount of bonds with yield $r_0$. Now you buy additional $w_1$ amount of bonds  with yield $r_1$, then buy additional $w_2$ amount of bonds with yield $r_2$. Eventually your portfolio yield is $$r_f = \frac{\sum_0^2 w_i \cdot r_i}{\sum _0 ^2 w_i }$$. &#xA;And change in yield is $r_f - r_0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is, how do you attribute this difference to each of the two purchases?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The obvious answer is, first find the yield after you bought $w_1$, compare that to the original yield $r_0$, and let this difference be the contribution of $w_1$. Then find the yield after buying $w_2$, compare to the yield after buying $w_1$, and set the difference as the contribution of $w_2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that there is no natural order which the purchase decisions are made. We could have bought $w_2$ first and then bought $w_1$. If we use the same technique then we will calculate a difference level of attribution for the two purchasing decisions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am thinking that I should use the average of the two techniques above. But I am suspecting that there is a better measurement out there?&lt;/p&gt;&#xA;" OwnerUserId="7467" LastActivityDate="2014-03-07T08:22:49.400" Title="Attributing change in yield as a result of structural change" Tags="&lt;fixed-income&gt;&lt;returns&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10491" PostTypeId="2" ParentId="8511" CreationDate="2014-03-06T20:10:39.860" Score="1" Body="&lt;p&gt;Did the portfolio manager have the option of investing in emerging markets?  If yes, use MSCI All-World.  If the portfolio has holdings based in countries with &quot;developed markets&quot; yet has has emerging markets exposure to revenue/earnings, the convention is to use MSCI World.&lt;/p&gt;&#xA;" OwnerUserId="6234" LastActivityDate="2014-03-06T20:10:39.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10492" PostTypeId="2" ParentId="8507" CreationDate="2014-03-06T20:14:13.523" Score="1" Body="&lt;p&gt;Normalize for trading days if possible.&lt;/p&gt;&#xA;" OwnerUserId="6234" LastActivityDate="2014-03-06T20:14:13.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10494" PostTypeId="1" CreationDate="2014-03-07T00:31:13.623" Score="0" ViewCount="297" Body="&lt;p&gt;Can someone prove to me how $dW_t=W_t-W_s$, where $t=s+1$, the difference of the Wiener process eventually equates to  $dW_t=z*(dt)^{(1/2)}$ where $z$ is standard normal, $N(0,1)$ in the following SDE: $dS_t=S_t μ dt+S_t σdW_t$?&lt;/p&gt;&#xA;" OwnerUserId="4729" LastEditorUserId="7279" LastEditDate="2014-03-07T10:39:48.703" LastActivityDate="2014-03-07T11:35:57.210" Title="Wiener process proof" Tags="&lt;stochastic-processes&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10495" PostTypeId="2" ParentId="10487" CreationDate="2014-03-07T00:33:44.340" Score="3" Body="&lt;p&gt;I have asked myself the very same question when I first read the book. As far as I can tell, the &quot;scalability&quot; condition is only imposed for technical reasons. It simplifies the subsequent proof of the Fundemental Theorem of Asset Pricing in constrained markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several papers that have shown that the theorem is valid for conic constraints. Examples are &lt;a href=&quot;http://ac.els-cdn.com/S030440680200085X/1-s2.0-S030440680200085X-main.pdf?_tid=542c7c34-a585-11e3-a33d-00000aacb362&amp;amp;acdnat=1394147965_8c21e6fa5616c9580bfd4e6065d5f79b&quot; rel=&quot;nofollow&quot;&gt;Napp&lt;/a&gt; or &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S0304406897000591#&quot; rel=&quot;nofollow&quot;&gt;Pham &amp;amp; Touzi&lt;/a&gt;. The main result from Napp shows what steps are necessary to obtain the theorem with general conic constraints on the amount that investors are able to hold of each asset.&lt;/p&gt;&#xA;" OwnerUserId="7396" LastActivityDate="2014-03-07T00:33:44.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10496" PostTypeId="2" ParentId="7994" CreationDate="2014-03-07T07:43:47.720" Score="5" Body="&lt;p&gt;It's really quite simple.  It's just a matter of the fact that we can change measure on the stochastic volatility while not changing the fact that the stock is a martingale.  Once we can do this, we have payoffs that have different values under different measures, so the market can't be complete.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For clarity, just consider a stock S, a money market account M and a Brownian motions B and W.  Let dS = a dt + v dB,  dM = r dt, and dv = b dt + w dW, where our filtration is generated by B and W, and a, r, b, and w are adapted processes.  Using M as numeraire (i.e. - divide by M so as to express all prices in terms of shares of M or equivalently, assuming interest rates are zero), then under an equivalent martingale measure, assets and admissible strategies are martingales, so now S is a martingale, so dS' = v' dB', and dv' = b' dt + w' dW'. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The point is we can change measure to add a drift to W.  Since dS' = v' dB', this doesn't change the fact that S' has zero drift, so S' remains a martingale.  But it does change the distribution of v', and thus the distribution of S'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the market was complete, all contingent claims on S would be replicable.  Their prices would be equal to the initial value of the replicating strategy, and hence fixed.  However, since the distribution of S' changes when we change the drift of W, there are contingent claims on S which will have different values depending on the drift we add to W.  Hence the market is incomplete.&lt;/p&gt;&#xA;" OwnerUserId="7470" LastEditorUserId="7470" LastEditDate="2014-03-12T19:02:06.130" LastActivityDate="2014-03-12T19:02:06.130" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10497" PostTypeId="2" ParentId="10490" CreationDate="2014-03-07T08:14:20.460" Score="2" Body="&lt;p&gt;This is not a perfect solution but perhaps the following approach could also serve you well as an indicator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming you are only using a finite number (e.g. $n$) of bonds with fixed yields $r_i$ you can write  $r_f(w_1, \dots,w_n)=\frac{\sum_0^n w_ir_i}{\sum_0^n w_i}$ with most of the weights being zero. Using the quotient rule you can now calculate derivatives  $r^j_f(w_1,\dots,w_n)=\frac{\sum_{i=0}^n w_i(r_j-r_i)}{(\sum_{i=0}^n w_i)^2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus given a concrete portfolio-composition $\vec{w}=(w_1,\dots,w_n)$ you can calculate the vector of derivatives $(r^0_f(\vec{w}),\dots,r^n_f(\vec{w}))$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intepretation: Having a portfolio $\vec w$ how will the porfolio yield be affected by marginal changes in the weights $w_i$. You could also do something like $r^j_f(\vec w)(w^{new}_j-w^{old}_j$) to approxiate the change in yield. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One can also do the above for $\tilde r_f(\vec w)=r_f(\vec w)-r_0=\frac{\sum_0^n w_i(r_i-r_0)}{\sum_0^n w_i}$&lt;/p&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="7279" LastEditDate="2014-03-07T08:22:49.400" LastActivityDate="2014-03-07T08:22:49.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10498" PostTypeId="2" ParentId="10494" CreationDate="2014-03-07T10:30:26.847" Score="1" Body="&lt;p&gt;The question is not 100% clear. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you set $X = W_t-W_s$ where $t-s = 1$ then this is equal in distribution to $W_1-W_0$ and the defining property of Brownian motion is that increments are normally distributed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the general case $W_t-W_s$ is $N(0,t-s)$, where the second parameter is variance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you set $dW_t = W_{t+dt}-W_t = Z \sqrt{dt}$, where $dt&amp;gt;0$ is not infinitesimal but just some positive real number and $Z$ is standard normal (mean $0$ and variance $1$), then the first &quot;$=$&quot; is a definiton and the second &quot;$=$&quot; is &quot;equal in distribution&quot;.  &lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-03-07T10:30:26.847" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10499" PostTypeId="2" ParentId="10494" CreationDate="2014-03-07T11:35:57.210" Score="2" Body="&lt;p&gt;I think this question might be asking for the central limit theorem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we consider a process W which varies as a series of independent random steps, then the &lt;a href=&quot;http://en.wikipedia.org/wiki/Central_limit_theorem&quot; rel=&quot;nofollow&quot;&gt;Central Limit Theorem&lt;/a&gt; tells us that after many steps, the value of W will be normally distributed.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2014-03-07T11:35:57.210" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10501" PostTypeId="1" CreationDate="2014-03-07T12:41:58.243" Score="3" ViewCount="264" Body="&lt;p&gt;What are the advantages and disadvantages of the Public Market Equivalent measure in private equity? Why is it that the volatility of the cash flows do not matter? This topic has been discussed in a &lt;a href=&quot;http://arno.uvt.nl/show.cgi?fid=131980&quot; rel=&quot;nofollow&quot;&gt;paper by Sorensen and Jagannathan 2013&lt;/a&gt;, but I can't seem to understand the logic behind it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="5190" LastEditorUserId="7279" LastEditDate="2014-03-07T13:07:40.427" LastActivityDate="2014-03-07T13:07:40.427" Title="The Public Market Equivalent measure in private equity" Tags="&lt;equities&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10502" PostTypeId="2" ParentId="7802" CreationDate="2014-03-07T15:05:40.720" Score="1" Body="&lt;p&gt;How about:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Each tick is a bid or ask order for some amount. Dukascopy could have order feeds into a number of FX platforms and aggregate the orders found there. They could be iceberg orders. When there's an execution the liquidity is removed from the order book to the trade book. The time this takes to propagate through execution venues can create liquidity mirages. Alternatively orders are simply cancelled.&lt;/li&gt;&#xA;&lt;li&gt;In one second you could have tens (or more) of orders across a range of prices. So during the second you have the open, high, low, close and a volume number which is probably the gross turnover of orders that were seen on the Dukascopy (or aggregate) book.&lt;/li&gt;&#xA;&lt;li&gt;Data on trades exists but it's in a different book to an order book. Plus it may involve proprietary positions (ie inventory, see &lt;a href=&quot;http://www.math.nyu.edu/faculty/avellane/HighFrequencyTrading.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.math.nyu.edu/faculty/avellane/HighFrequencyTrading.pdf&lt;/a&gt;). Then again, regulations these days require most FX (except spot) trades to be reported to trade repositories. You could try those (ie &lt;a href=&quot;http://www.regis-tr.com/&quot; rel=&quot;nofollow&quot;&gt;http://www.regis-tr.com/&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;li&gt;I would say it's a mixture between the proprietary order flow and order flow across several well known FX platforms (EBS, Reuters, leading banks).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2014-03-07T15:05:40.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10503" PostTypeId="2" ParentId="739" CreationDate="2014-03-08T00:14:38.933" Score="0" Body="&lt;p&gt;Unfortunately with the S&amp;amp;P ratings it is unclear when the latest changes were made:&#xA;&lt;a href=&quot;http://www.standardandpoors.com/ratings/sovereigns/ratings-list/en/us/?subSectorCode=39&amp;amp;sectorId=1221186707758&amp;amp;subSectorId=1221187348494&quot; rel=&quot;nofollow&quot;&gt;http://www.standardandpoors.com/ratings/sovereigns/ratings-list/en/us/?subSectorCode=39&amp;amp;sectorId=1221186707758&amp;amp;subSectorId=1221187348494&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If anyone is able to find any historic S&amp;amp;P country credit ratings please post them&lt;/p&gt;&#xA;" OwnerUserId="7477" LastActivityDate="2014-03-08T00:14:38.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10506" PostTypeId="1" CreationDate="2014-03-08T15:38:09.347" Score="1" ViewCount="82" Body="&lt;p&gt;I have the following SWAP contract : T1UH4 which is a 2-Year Deliverable Interest Rate Swap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Product info : &#xA;&lt;a href=&quot;http://www.cmegroup.com/trading/interest-rates/deliverable-swaps/2-year-deliverable-interest-rate-swap-futures.html&quot; rel=&quot;nofollow&quot;&gt;http://www.cmegroup.com/trading/interest-rates/deliverable-swaps/2-year-deliverable-interest-rate-swap-futures.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Who is the issuer and the counter part of this SWAP in case I trade it ? Is it by default the CME Group ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="7120" LastActivityDate="2014-08-11T10:31:37.910" Title="Who is the issuer and the counter part of this instrument?" Tags="&lt;swaps&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10507" PostTypeId="1" AcceptedAnswerId="10510" CreationDate="2014-03-08T18:49:31.073" Score="2" ViewCount="4549" Body="&lt;p&gt;I came upon the term &quot;implied state price density&quot; in a couple of papers. &#xA;As far as I understand the concept one basically tries to extract the &quot;pricing density&quot; from the market data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the sake of simplicity we assume a constant interst rate $r$ and also don't make any assumptions on the model used to evolve $S_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C(t,S_t,K,r,T)=e^{-r(T-t)}\int_0^{\infty}(S_T-K)^+f(S_T|S_t)dS_T$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to Douglas T. Breeden and Robert H. Litzenberger in their paper &lt;a href=&quot;http://www.jstor.org/discover/10.2307/2352653?uid=3737864&amp;amp;uid=2134&amp;amp;uid=379195251&amp;amp;uid=2&amp;amp;uid=70&amp;amp;uid=3&amp;amp;uid=379195241&amp;amp;uid=60&amp;amp;sid=21103507185001&quot; rel=&quot;nofollow&quot;&gt;Prices of State-Contingent Claims Implicit in Option Prices&lt;/a&gt; one can recover the density via the formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$p(S_T|S_t)=e^{r(T-t)}\frac{\partial^2 C(t,S_t,K,r,T)}{\partial K^2}|_{K=S_T}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How does one arrive at this formula?&lt;/strong&gt; I tried to differentiate $C(t,S_t,K,r,T)$ but according to the rules for differentiating parameter integrals this is not how one can arrive at above formula (what am I missing?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. You can read the paper online for free at JSTOR after you register. Or just email me and I will sent you the pdf-file&lt;/p&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="7279" LastEditDate="2014-03-08T20:25:46.700" LastActivityDate="2014-03-08T21:41:26.663" Title="Implied state price density (Question 1 - derivation of the formula)" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;implied&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10510" PostTypeId="2" ParentId="10507" CreationDate="2014-03-08T21:41:26.663" Score="1" Body="&lt;p&gt;Look the first answer of this thread: &lt;a href=&quot;https://quant.stackexchange.com/questions/1621/how-to-derive-the-implied-probability-distribution-from-b-s-volatilities&quot;&gt;How to derive the implied probability distribution from B-S volatilities?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also many papers in Dupire volatility have your formula derivation. For example, look at (10) in &lt;a href=&quot;http://www.javaquant.net/papers/DupireLocalVolatility.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.javaquant.net/papers/DupireLocalVolatility.pdf&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="7486" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2014-03-08T21:41:26.663" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10513" PostTypeId="2" ParentId="10465" CreationDate="2014-03-09T09:20:28.863" Score="7" Body="&lt;p&gt;My take on the whole issue is as follows: We cannot be sure to find &lt;em&gt;the one and only true model&lt;/em&gt;, the only thing we can do is to identify the most prevalent so called stylized facts and try to model them parsimoniously. The following paper was already mentioned in the comments:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cmap.polytechnique.fr/~rama/papers/empirical.pdf&quot; rel=&quot;noreferrer&quot;&gt;Empirical properties of asset returns: stylized facts and statistical issues by Rama Cont (2000)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One route to go is to use more complicated yet better fitting distributions, the other route (the one I prefer and actively do research on) is to use mixtures of simpler distributions (e.g. normal distributions again). Most of the stylized facts mentioned in the abovementioned paper (p. 224) can be modeled by a simple mixture of normals. As a starting point I would recommend the following excellent paper:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1919497&quot; rel=&quot;noreferrer&quot;&gt;Regime Changes and Financial Markets by Andrew Ang and Allan G. Timmermann (2011)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the abstract:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;[...] In empirical estimates, the regime switching means, volatilities,&#xA;  autocorrelations, and cross-covariances of asset returns often differ&#xA;  across regimes, which allow regime switching models to capture the&#xA;  stylized behavior of many financial series including fat tails,&#xA;  heteroskedasticity, skewness, and time-varying correlations. [...]&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Have e.g. a look at figure 1 (p. 27): There you see how a mixture of just two normals can very well and parsimoniously model fat tails. &lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2014-03-09T10:11:52.133" LastActivityDate="2014-03-09T10:11:52.133" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10514" PostTypeId="2" ParentId="10489" CreationDate="2014-03-09T10:50:31.720" Score="7" Body="&lt;p&gt;Behavioral Finance is a wide topic, which I believe is still today underestimated by many financial professionals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can it be used by quants?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well, in portfolio optimization it can be used &quot;as an overlay&quot; in the form of constraints where the optimal portfolio can not be too different from the current portfolio, because clients have behavioral biases which make them will to keep roughly the same allocation. The CFA Level 3 curriculum discusses this topic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For option pricing it would have to be integrated in the model. The problem is, quants use models to simplify the reality and be able to derive &quot;simple&quot; close-form solutions&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;&quot;All models are wrong, but some are useful.&quot;&lt;/em&gt; &lt;a href=&quot;http://en.wikiquote.org/wiki/George_E._P._Box&quot;&gt;George Box&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Adding behavioral finance in pricing models would essentially make them more complicated and hence more difficult to apply. I have not read a specific article that I remember, but a quick google search pointed me to this &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1664996&quot;&gt;study&lt;/a&gt; which confirms that people have indeed been looking into this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The real question to answer is &lt;em&gt;does the addition of the behavioral finance concept to a model provide a big enough payoff from the market to compensate investment managers for the sophistication?&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2014-03-09T10:50:31.720" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10516" PostTypeId="1" CreationDate="2014-03-09T15:27:46.457" Score="12" ViewCount="1265" Body="&lt;p&gt;Please let me know where I have been mistaken!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let the SDE satisfied by the GBM $S(t)$ be&#xA;$$&#xA;\frac{dS(t)}{S(t)} = \mu dt + \sigma dW(t).&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, the underlying BM $X(t)$ will satisfy&#xA;$$&#xA;dX(t) = \left( \mu - \frac{1}{2} \sigma^2 \right)dt + \sigma dW(t).&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To simulate the GBM for times $t_0 &amp;lt; t_1 &amp;lt; \ldots &amp;lt; t_n$, generate $n$ iid $\mathcal{N}(0,1)$ RVs, $Z_i$, $\quad i = 1,2,\ldots, n$ and set&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;S(t_{i+1}) = S(t_i)\exp\left(\left( \mu - \frac{1}{2} \sigma^2 \right)(t_{i+1} -t_i) + \sigma \sqrt{t_{i+1} - t_i} Z_{i+1} \right).&#xA;$$&#xA;Then&#xA;$$&#xA;\frac{S(t)}{S(0)} = \exp\left(\underbrace{\left(\mu - \frac{1}{2} \sigma^2\right) t + \sigma \sqrt{t}Z}_{\mathcal{N}\left(\left(\mu - \frac{\sigma^2}{2}\right)t, \sigma^2 t\right)} \right)&#xA;$$&#xA;and so&#xA;$$&#xA;\log \frac{S(t)}{S(0)} \sim \mathcal{N}\left(\left(\mu - \frac{\sigma^2}{2}\right)t, \sigma^2 t\right).&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think I'm missing something because when I use this mean and variance (in the equation directly above) for testing the normality of the log returns ($\log \frac{S(t)}{S(0)}$), I get ridiculous answers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be specific, with $S_0 = 20$, $\mu = 2$, $\sigma^2 = 1$ and partitioning $[0,1]$ into 100 subintervals, generating the GBM at these 100 points gives a range of values from 15.399 to 97.1384 for the $S(t_i)$.  Then the log returns, $\log S(t_i)/S_0$, range from -0.26143 to 1.5804.  The means I'm using for each $\log S(t_i)/S_0$ are (in increasing order of $i$) $0.015, 0.03, 0.045, \ldots, 1.5$ and the variances are $0.01,0.02, \ldots, 1$ since these are the parameters in the supposed normal distribution as described above.  Finally, when these log returns are normalized using this mean and variance their values range from -2.7643 to 0.080404, which is clearly not $\mathcal{N}(0,1)$-distributed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE:  The test I am using to test for normality (Anderson-Darling) relies on independent samples from a (supposed) normal distribution, and as a couple people have pointed out in the comments, $\log S(t_i)/S_0$ is dependent on $\log S(t_{i-1})/S_0$.  Indeed, changing to testing returns of the form $\log S(t_i)/S(t_{i-1})$ results in a &quot;pass&quot; for the Anderon-Darling test (giving $A^2 = 0.244$ for those familiar).&lt;/p&gt;&#xA;" OwnerUserId="6866" LastEditorUserId="6866" LastEditDate="2014-03-11T21:17:43.260" LastActivityDate="2016-07-08T20:30:52.263" Title="Distribution of Geometric Brownian Motion" Tags="&lt;monte-carlo&gt;&lt;probability&gt;&lt;simulations&gt;&lt;brownian-motion&gt;" AnswerCount="2" CommentCount="7" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10517" PostTypeId="1" CreationDate="2014-03-09T16:11:55.097" Score="-2" ViewCount="62" Body="&lt;p&gt;Whenever a price is changed, you can find the percent of increase or the percent of decrease by using the following formula:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$$\frac{\text{percent of change}}{100}=\frac{\text{change in price}}{\text{original price}}$$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;To find the change in price, you calculate the difference between the original price and the new price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the &quot;percent of change&quot; the change in price represented as a percent of the original price?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does the proportion:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;percent of change&quot; is to $100$ as change in price is to original price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;make sense? Also, don't we lose the percent symbol if the original price is $100?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since then &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$$\text{percent of change}=\text{change in price}$$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So does &quot;percent of change&quot; now just become a portion of the original price?&lt;/p&gt;&#xA;" OwnerUserId="7495" LastActivityDate="2014-03-09T18:06:05.353" Title="What does &quot;percent of change&quot; mean?" Tags="&lt;price&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2014-03-09T19:54:26.717" ContentLicense="CC BY-SA 3.0" />
  <row Id="10518" PostTypeId="2" ParentId="10517" CreationDate="2014-03-09T18:06:05.353" Score="2" Body="&lt;p&gt;price went from \$200 to \$202, this is &quot;one percent change&quot;, because $\frac{\$2}{\$200}100=1$&lt;/p&gt;&#xA;" OwnerUserId="7365" LastActivityDate="2014-03-09T18:06:05.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10519" PostTypeId="1" AcceptedAnswerId="10522" CreationDate="2014-03-09T21:06:53.320" Score="10" ViewCount="29697" Body="&lt;p&gt;I have read about different implementations of HFT systems on FPGAs.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Argon HFT system (&lt;a href=&quot;http://trading-gurus.com/argon-design-an-fpga-based-hft-platform/&quot; rel=&quot;noreferrer&quot;&gt;http://trading-gurus.com/argon-design-an-fpga-based-hft-platform/&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Hardware-only implementations or hybrid solutions &lt;a href=&quot;http://msrg.org/publications/pdf_files/2010/moTrading-Efficient_Event_Processing_through_.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://msrg.org/publications/pdf_files/2010/moTrading-Efficient_Event_Processing_through_.pdf&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Domain Specific Langauges for FPGAs to implement feed handlers (&lt;a href=&quot;http://msrg.org/publications/pdf_files/2010/moTrading-Efficient_Event_Processing_through_.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://msrg.org/publications/pdf_files/2010/moTrading-Efficient_Event_Processing_through_.pdf&lt;/a&gt;).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Vendors like Cisco claim they have achieved the same results with high performance NIC's (&lt;a href=&quot;http://www.cisco.com/c/dam/en/us/products/collateral/switches/nexus-3000-series-switches/white_paper_c11-716030.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.cisco.com/c/dam/en/us/products/collateral/switches/nexus-3000-series-switches/white_paper_c11-716030.pdf&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, what part of HFT systems are mostly implemented on FPGAs nowadays? Are FPGAs still very popular? Is only the feed handler implemented on the FPGAs? Because some of these systems described above only have a feed handler implemented on the FPGA, because the strategy changes too much, or is too hard to implement on FPGAs. Others claim that they have also implemented trading strategies on FPGAs or using high performance NICs instead of FPGAs to build HFT systems. I've read about different approaches but I find it hard to compare as most of the results are tested on different input sets.&lt;/p&gt;&#xA;" OwnerUserId="7492" LastActivityDate="2016-07-28T10:31:18.630" Title="How are HFT systems implemented on FPGA nowadays?" Tags="&lt;trading&gt;&lt;high-frequency&gt;&lt;fpga&gt;" AnswerCount="6" CommentCount="1" FavoriteCount="17" ContentLicense="CC BY-SA 3.0" />
  <row Id="10520" PostTypeId="2" ParentId="10519" CreationDate="2014-03-09T21:55:59.873" Score="2" Body="&lt;p&gt;Your question really makes not much sense. It's like asking how much of the wiring in trading infrastructure uses optic fiber and how much of it uses copper. The best answer that we can give to you is that an FPGA is not a magic bullet.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Vendors like Cisco claim they have achieved the same results with high&#xA;  performance NIC's&#xA;  (&lt;a href=&quot;http://www.cisco.com/c/dam/en/us/products/collateral/switches/nexus-3000-series-switches/white_paper_c11-716030.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.cisco.com/c/dam/en/us/products/collateral/switches/nexus-3000-series-switches/white_paper_c11-716030.pdf&lt;/a&gt;).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is an incorrect interpretation of Cisco's white paper. There's very little overlap between the use cases of switching fabric and those of a FPGA.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;what part of HFT systems are mostly implemented on FPGAs nowadays?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Currently, FPGAs are often used in our printers and TV set-top boxes.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="4660" LastEditDate="2014-03-09T22:04:21.070" LastActivityDate="2014-03-09T22:04:21.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10521" PostTypeId="1" CreationDate="2014-03-10T04:05:49.383" Score="3" ViewCount="5360" Body="&lt;p&gt;Does anyone know of a webpage (or webpages) of current delistings for NASDAQ &amp;amp; NYSE?&lt;/p&gt;&#xA;" OwnerUserId="2952" LastActivityDate="2020-05-04T14:32:45.537" Title="Tracking delistings on NASDAQ &amp; NYSE" Tags="&lt;nasdaq&gt;&lt;nyse&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10522" PostTypeId="2" ParentId="10519" CreationDate="2014-03-10T07:30:47.327" Score="13" Body="&lt;p&gt;Here's a way to think about it: imagine you can do something in an ASIC (i.e. directly in hardware). However, the process of fabrication is in itself expensive, and you get a design that you cannot change afterwards. ASICs make sense for predefined tasks such as Bitcoin mining, well-known data processing algorithms, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand we have ordinary CPUs (as well as coprocessor CPUs and GPUs) which are general-purpose, but process a small (in terms of concurrent instructions) set of instructions at a very high speed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FPGAs are the middle ground. They are 'hardware emulators' and as such can be considered to be 10x slower than actual hardware, but still way more performant for &lt;em&gt;concurrent&lt;/em&gt; operations than CPUs provided you are able to utilize the die to spread your logic accordingly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some uses of FPGAs are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Video transcoding (e.g. HD video decoding in TVs) as well as various data acquisition boards&lt;/li&gt;&#xA;&lt;li&gt;Fixed data structure parsing (Regex parsing)&lt;/li&gt;&#xA;&lt;li&gt;Discrete system simulation (for example, simulating the outcome of a card game)&lt;/li&gt;&#xA;&lt;li&gt;Lots of 'properly embedded' applications such as e.g. in aerospace or scientific research&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The problem with FPGAs for quant uses is that it's not so good for floating-point calculations, particularly since ordinary CPUs are already optimized for that with things like SIMD. However, for anything fixed-point or fixed-size data structures, FPGA design allows you to configure the device to do a lot of processing at the same time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some things done in trading are using FPGA for feed handlers (parsing directly from the network stream) as well as building certain parts of the trading structure (e.g. order books) in hardware in order to be able to deal with the rapidly changing data structure without loading the CPU.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FPGAs mainly aim to address the concern of quickly processing data without paying the propagation costs. This is particularly in contrast with devices such as GPGPU (or any PCI-dwelling card, such as Xeon Phi) which pay performance penalties for getting data to/from the device. That said, DMA options are improving in this regard, too.&lt;/p&gt;&#xA;" OwnerUserId="1217" LastActivityDate="2014-03-10T07:30:47.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10523" PostTypeId="1" AcceptedAnswerId="10575" CreationDate="2014-03-10T14:47:01.020" Score="3" ViewCount="2267" Body="&lt;p&gt;Using the second derivative of the Call-Option-Price one can try to recover the pricing density. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;Formally:&lt;/em&gt;&lt;/strong&gt; Assuming a constant interst rate $r$ and also not making any assumptions on the model used to evolve $S_t$ &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$C(t,S_t,K,r,T)=e^{-r(T-t)}\int_0^{\infty}(S_T-K)^+f(S_T|S_t)dS_T$&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The density is then recovered via&lt;br&gt;&#xA;  $p(S_T|S_t)=e^{r(T-t)}\frac{\partial^2 C(t,S_t,K,r,T)}{\partial&#xA; K^2}|_{K=S_T}$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;As a follow-up to my &lt;a href=&quot;https://quant.stackexchange.com/questions/10507/implied-state-price-density-question-1-derivation-of-the-formula&quot;&gt;last question&lt;/a&gt;: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;What are the applications of this recovered density ?&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;How can we Interpret it ?&lt;/strong&gt; (can it be considered the &quot;real&quot; probability density ? - seeing how it is used in a pricing context it should still be risk neutral) &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2014-03-13T20:41:23.713" Title="Implied probability density (Question 2 - Applications and Interpretation)" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;implied&gt;&lt;density&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10524" PostTypeId="1" AcceptedAnswerId="10588" CreationDate="2014-03-10T16:04:14.197" Score="2" ViewCount="309" Body="&lt;p&gt;Say you have in your hand a transition matrix published by Moody, and you also collected the rating information for a sample of bonds, which you use to form your own transition matrix. How can we use our sample to test whether if Moody's transition matrix is correct?&lt;/p&gt;&#xA;" OwnerUserId="7467" LastActivityDate="2014-03-14T21:31:09.333" Title="How to perform significance test on transition matrices" Tags="&lt;fixed-income&gt;&lt;credit-ratings&gt;&lt;transition-matrix&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10525" PostTypeId="1" CreationDate="2014-03-10T16:08:20.897" Score="1" ViewCount="639" Body="&lt;p&gt;Fama-Bliss discount bonds are defined through a straight forward calculation (Famma, Bliss 1987). For the purposes of a project I need to derive forward rates, yields &amp;amp;c. for periods not included in the CRSP bond file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is I cannot find the algorithm they use to select the bonds to be included in the calcuation. CRSP provides a description of the screening process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.crsp.com/products/documentation/fama-bliss-discount-bonds-%E2%80%93-monthly-only&quot; rel=&quot;nofollow&quot;&gt;http://www.crsp.com/products/documentation/fama-bliss-discount-bonds-%E2%80%93-monthly-only&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;but it is vague enough that it would warrant a significant amount of guess and check.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know precisely how the screening algorithm functions? Better yet, code (any language)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="7507" LastActivityDate="2014-03-10T16:08:20.897" Title="What is the algorithm for the Fama-Bliss instrument selection?" Tags="&lt;data&gt;&lt;fixed-income&gt;&lt;algorithm&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10526" PostTypeId="2" ParentId="10506" CreationDate="2014-03-10T16:28:21.907" Score="1" Body="&lt;p&gt;The counterparty could be practically anyone, since the rulebook says&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;51104. DELIVERIES ON EXPIRING FUTURES CONTRACTS&#xA;51104.A. Requirements for Participation in Delivery&#xA;For an account carried by a clearing member to make or accept delivery on an expiring futures contract,&#xA;the holder of such account is required to be:&#xA;1.  an Eligible Contract Participant, as that term is defined in Section 1a(18) of the Commodity&#xA;Exchange Act (7 USC §1a(18) and 17 CFR 1.3(m)), and&#xA;2.  either an IRS Clearing Member (CME Rule 90005.A.) or an IRS Participant registered with CME by an IRS Clearing Member (CME Rule 8F009. and CME Rule 90005.B.).&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This may make you think you need to worry about counterparty risk quite a bit.  However you are effectively facing CME since&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;51104.G. Clearing House Financial Safeguards&#xA;A futures contract made under these Rules shall be a Base Guaranty Fund Product subject to the&#xA;Clearing House financial safeguards provided by the General Guarantee Fund (CME Rule 802.A.).&#xA;An IRS Contract that is delivered or accepted for delivery in fulfillment of a futures contract made under&#xA;these Rules shall be an IRS Product subject to the Clearing House financial safeguards provided by the&#xA;IRS Guaranty Fund (CME Rule 8G07.)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="254" LastActivityDate="2014-03-10T16:28:21.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10527" PostTypeId="1" AcceptedAnswerId="10535" CreationDate="2014-03-10T18:05:05.310" Score="8" ViewCount="810" Body="&lt;p&gt;I am looking for a builder of Yield curves by tenors (O/N, 1M, 3M, 6M, 12M) respect to a given discount curve based on multi-curve framework as described below :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://arxiv.org/pdf/1006.4767v1.pdf&quot;&gt;Interest-rate Modelling with Multiple Yield Curves&lt;/a&gt; – &lt;em&gt;A Pallavicini, M Tarenghi – [2010]&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you know any pricing libraries that can meet my requirements and then proposes consistent pricing framework for IRS, FRA, IR options, etc ?&lt;/p&gt;&#xA;" OwnerUserId="1859" LastActivityDate="2017-07-28T19:22:19.730" Title="Looking for a pricing library supporting Mutli-curve Framework" Tags="&lt;yield-curve&gt;&lt;irs&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10531" PostTypeId="1" CreationDate="2014-03-11T01:15:09.790" Score="3" ViewCount="79" Body="&lt;p&gt;(One of) the standard explanation people gave for momentum is under-reaction of stockholders to firm-specific news. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this is true, then it seems that these stocks should have more momentum, and also a longer horizon of momentum returns: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) stocks held less by institutions and more by households (who check their portfolios and news less frequently) &#xA;2) stocks that are less liquid (news go into prices slower)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same could potentially be said about the difference in momentum across asset classes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any evidence? Any references/ thoughts welcome. &lt;/p&gt;&#xA;" OwnerUserId="5667" LastActivityDate="2014-03-11T01:15:09.790" Title="Is there evidence that illiquid stocks, held less by institutions, have more price momentum?" Tags="&lt;liquidity&gt;&lt;momentum&gt;" AnswerCount="0" CommentCount="7" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10533" PostTypeId="1" AcceptedAnswerId="10534" CreationDate="2014-03-11T05:02:52.627" Score="3" ViewCount="505" Body="&lt;p&gt;Currently I am trying to get a hold of MPT, asset allocation and related applications.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While reading a particular resource, it says diversification works best for &quot;normal&quot; financial markets and provides less risk reduction during market turmoil.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Can someone explain how and why less risk buffer during crisis?&lt;/li&gt;&#xA;&lt;li&gt;How or why does correlation between assets in portfolio increase during such?&lt;/li&gt;&#xA;&lt;li&gt;Can't we have a diversified portfolio like 7-12 approach which could withstand financial crisis and still perform better?&lt;/li&gt;&#xA;&lt;li&gt;If can't then what's the approach for crisis in terms of managing investments?&lt;/li&gt;&#xA;&lt;li&gt;How to find low correlated asset to shield and perform front of crisis? &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3178" LastActivityDate="2014-05-14T15:12:18.967" Title="Why does it &quot;say&quot; portfolio diversification not suitable during market turmoil?" Tags="&lt;portfolio-management&gt;&lt;correlation&gt;&lt;modern-portfolio-theory&gt;&lt;diversification&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10534" PostTypeId="2" ParentId="10533" CreationDate="2014-03-11T06:25:44.020" Score="5" Body="&lt;p&gt;Accurately stated: Diversification helps during turmoil, but helps less as what would be expected by using $w^T \Omega w$ as the portfolio variance where the off-diagonal covariances are estimated during tranquil periods. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is because correlations and covariances change during turmoil, typically &lt;em&gt;increasing&lt;/em&gt;. This reduces the benefit of diversification since the off-diagonal elements, $\sigma_{i,j}(t)$, tend to now be larger when $t$ belongs to a turmoil regime. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is true only up to the point of assets that suffer from contagion. In fact the exact opposite is true for assets that are considered to be safe haven assets, such as gold, some currencies (USD,JPY,CHF,perhaps GBP) and some government fixed income instruments. Here, diversification &lt;strong&gt;&lt;em&gt;works better&lt;/em&gt;&lt;/strong&gt; during market turmoil since these assets can be relied on in most cases to increase in value during such conditions. Thus the statement is true only assuming you are investing in assets that suffer from contagion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, the extent to which contagion (technically defined as an increase in general comovement  - which itself is not technically defined - between asset prices during crises) exists at all not a settled question. I refer you to Forbes and Rigobon (2001) and follow up papers. This is because the fact that $\sigma(t)$ tends to increase during crises causes a bias in $E[(\rho(t))]$ where $\rho$ is the Pearson estimator and $E$ is the expectation. Note that this was the state in mid 2000s, and the literature could have settled the question since then. Wavelets and copulas have both shown it in at least one paper which are not susceptible to such biases in a way that I am aware of; the FB (2001) result is for Pearson's correlation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a portfolio management perspective, I recommend looking into time-varying multivariate copulas of the flavour of the Symmetrized Joe-Clayton Copula and later derivatives such as the SCAR in order to calibrate the left-tail comovement during turmoil periods. I am aware of only a very small contagion literature that takes this approach but I feel it is the best approach for this question. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However many practitioners will take a qualitative, and not quantitative approach. Many in the industry actually refuse to rely on any sort of mathematical optimisation due to the estimation error in $E[R(t)]$ and $\hat{\rho(t)}$ (as well as pure ignorance of academic literature since Markowitz), and will instead try to diversify by using a subjective mish-mash of sector exposure, style exposure, factor exposure, country exposure, asset class exposure, and so on. I am not against this approach. This is only possible on the asset-class level optimisation (although this can still be applied at the stock level, for example, by using Black-Litterman).&lt;/p&gt;&#xA;" OwnerUserId="6081" LastEditorUserId="6081" LastEditDate="2014-05-14T15:12:18.967" LastActivityDate="2014-05-14T15:12:18.967" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10535" PostTypeId="2" ParentId="10527" CreationDate="2014-03-11T08:23:30.870" Score="6" Body="&lt;p&gt;Quantlib supports multi-curve framework (to the best of my knowledge).&#xA;By the way, there's a &quot;newer&quot; version of that paper (authored by Pallavicini &amp;amp; Brigo).&#xA;&lt;a href=&quot;http://arxiv.org/abs/1304.1397&quot;&gt;http://arxiv.org/abs/1304.1397&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2219548&quot;&gt;This&lt;/a&gt; paper might also be useful for you, very practical and basically answers any question you could have.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also see &lt;a href=&quot;http://quantlib.10058.n7.nabble.com/Multicurve-discounting-td9444.html&quot;&gt;this&lt;/a&gt; discussion about multi-curve discounting within quantlib.&lt;/p&gt;&#xA;" OwnerUserId="5350" LastActivityDate="2014-03-11T08:23:30.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10536" PostTypeId="2" ParentId="10533" CreationDate="2014-03-11T08:52:47.723" Score="7" Body="&lt;p&gt;This is indeed a subtle point. What is generally meant with this statement is that correlation is going up in bear markets, so it is not so much the &quot;turmoil&quot; part (i.e. volatility per se) but the &quot;trend&quot; (i.e. negative in this case) part. Putting it another way is that when you control for volatility not the correlation but the covariance (which is the part entering the optimization algorithm for MPT) is going up in bear market regimes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several ways to tackle this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way is that you can impose a dynamic risk management overlay, i.e. you can try to identify in which regime you are at the moment (with whatever method, e.g. stress indicators, hidden markov models etc.) and leave the market (e.g. partially) in times of unrest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way is to have a look at the temporal correlation structure of different markets, assets etc. so that you try to find which ones preserve or develop a more beneficial set in times of crises (there is a good paper from Kritzman, which I cannot find right now).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A third way would be to try to model the dependence structure with more sophisticated methods, like copulas or random matrix theory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can of course also try to combine all or some of the methods above.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2014-03-11T08:52:47.723" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10537" PostTypeId="1" CreationDate="2014-03-11T09:43:34.327" Score="0" ViewCount="111" Body="&lt;p&gt;Let us suppose that a factory needs to know when certain products are increasing the profit.&#xA;This factory produces an huge number of products each with different targets. So the factory need to compare their trend in a relative fashion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, the &lt;code&gt;trend&lt;/code&gt; itself is not so good when comparing more products. For instance, explore this scenario:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;product A: goes from 50 sold pieces  in January to 100 sold pieces in December.&lt;/li&gt;&#xA;&lt;li&gt;product B: goes from 100 sold pieces in January to 150 sold pieces in December.&lt;/li&gt;&#xA;&lt;li&gt;product C: goes from 100 sold pieces in January to 200 sold pieces in December.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(for simplicity let us suppose the unit price is the same for all products and does not varies in time)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Trend&lt;/code&gt; of product A equals the &lt;code&gt;trend&lt;/code&gt; of product B, but product A doubled the sold pieces. Also, &lt;code&gt;trend&lt;/code&gt; of product B is greater than the &lt;code&gt;trend&lt;/code&gt; of product A, while both have doubled their sold pieces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder what is a good standard indicator to capture such behaviour: an indicator that have the same value for products which double their profit. So that A and C have the same value which is greater than B.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess representing the trend a-dimensionally should resolve this problem:  this would prevent the dependency of the number of pieces and should result in a more relative indicator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I don't have only two points: not only January and December, but let's say, a set of points for each month. Currently, as trend I use linear regression. I know that dividing this trend (which has dimension of pieces/month) by the first point will normalize it. But I find the using of the first point arbitrary. Why not the second one? why not the average?&lt;/p&gt;&#xA;" OwnerUserId="7517" LastEditorUserId="7517" LastEditDate="2014-03-25T08:13:25.000" LastActivityDate="2014-03-25T08:13:25.000" Title="Standard way to represent trend in an a-dimensional way" Tags="&lt;trends&gt;" AnswerCount="3" CommentCount="2" ClosedDate="2014-03-23T14:39:15.980" ContentLicense="CC BY-SA 3.0" />
  <row Id="10538" PostTypeId="2" ParentId="9340" CreationDate="2014-03-11T11:03:59.833" Score="9" Body="&lt;p&gt;The HJ bounds state that&#xA;$$ \frac{\sigma(m)}{\mathbb{E}[m]} \geq \frac{|\mathbb{E}[R^e]|}{\sigma(R^e)} $$&#xA;where $R^e$ is the excess return of an asset or portfolio, $\sigma$ denotes standard deviation, $\mathbb{E}$ denotes expectation w.r.t. the statistical measure, and $m$ is a stochastic discount factor (or state-price density/kernel, etc.) that prices the return:&#xA;$$ 0 = \mathbb{E}[mR^e] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Economically, the HJ bound is therefore a restriction on the set of possible discount factors that can price a given set of (excess) returns and, at the same time, a restriction on the set of returns that can be observed for a given discount factor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Chapter 21 of John Cochrane's book on asset pricing contains a nice discussion of what the HJ bounds tell us about the Equity Premium Puzzle (the following is more or less on-to-one from the chapter)&#xA;Empirically, the HJ bound implies that the SDF has to be very volatility with a mean near one. This fact has been used a lot in the investigation of the equity premium puzzle. The Sharpe ratio of the US market is about 0.5 (8% return with 16% volatility). The average risk-free rate is 1%, so $\mathbb{E}[m] = 0.99$ (Assuming there is a risk-free rate $R^f = 1+r^f$, we have $\mathbb{E}[m] = \frac{1}{R^f}$). Therefore, $\sigma(m) \geq 0.5$ on an annual basis. Following the basic consumption model, this either implies very extreme risk aversion or consumption growth volatility. &lt;/p&gt;&#xA;" OwnerUserId="7396" LastEditorUserId="7396" LastEditDate="2014-03-11T14:40:19.487" LastActivityDate="2014-03-11T14:40:19.487" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10539" PostTypeId="2" ParentId="10537" CreationDate="2014-03-11T12:22:02.320" Score="1" Body="&lt;p&gt;So why not&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;trend = (sales_period_end - sales_period_start) / sales_period_start&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;?&lt;/p&gt;&#xA;" OwnerUserId="7520" LastActivityDate="2014-03-11T12:22:02.320" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10540" PostTypeId="1" AcceptedAnswerId="10541" CreationDate="2014-03-11T13:12:20.050" Score="3" ViewCount="592" Body="&lt;p&gt;I am trying to price a call option on a mutual fund. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the lack of market implied data, I am going to estimate the fund´s &lt;strong&gt;expected volatility&lt;/strong&gt; using as a reference its historical volatility (calculated over a period comparable to the option maturity). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I am not sure how to estimate the fund´s &lt;strong&gt;expected return&lt;/strong&gt;.&#xA;Some alternatives are: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Use an appropriate &lt;strong&gt;risk free rate and deduct the annual fees&lt;/strong&gt; of the underlying fund&lt;/li&gt;&#xA;&lt;li&gt;Use the &lt;strong&gt;historical return&lt;/strong&gt; as expected return and neglect the annual fees&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;(1) will be consistent with the traditional risk-neutral framework while (2) can be backed by the lack of market implied information, the potential limitations in hedging the call option, and the fact that historical returns may exhibit some statistical persistence in mutual funds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which alternative do you think is more appropriate? Given the fund´s historical returns  and the current risk-free rates (1) and (2) produce very different option values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; Per comments I understand that there might be no generally accepted answer for this question. Therefore I will use both risk-neutral and real-world distributions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the real-world distribution, once I have estimated $\mu$ and $\lambda =\frac{\mu-r_f}{\sigma}$ my idea will be :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Estimate the real-world terminal distribution using $\mu$ instead of $r_f$. For instance using: $\frac{dS}{S} = \mu dt + \sigma dW_t$&lt;/li&gt;&#xA;&lt;li&gt;Calculate the expected payoff under the real-world terminal distribution&lt;/li&gt;&#xA;&lt;li&gt;Discount this payoff using an appropriate discount rate based on $\mu$ and $\lambda$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Do you think this approach is enough or are there other details that I should take into account.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, which will be an appropriate discount rate for the real-world payoffs? I am inclined to use a simple CAPM approach $e^{-r_dt}$ with $r_d = r_f + \beta(E(r_m) - r_f)$, but this do not make any explicit use of  $\lambda$, so I am uncertain here. &lt;/p&gt;&#xA;" OwnerUserId="5208" LastEditorUserId="5208" LastEditDate="2014-03-17T10:39:52.797" LastActivityDate="2014-03-17T10:39:52.797" Title="Call option on a Mutual Fund" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;historical-data&gt;&lt;expected-return&gt;&lt;funds&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10541" PostTypeId="2" ParentId="10540" CreationDate="2014-03-11T14:01:27.380" Score="3" Body="&lt;p&gt;In effect, you are wondering whether to price this option on&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;risk-free probability distributions (B-S drift $r_f$), or&lt;/li&gt;&#xA;&lt;li&gt;real-world ones (B-S drift $\mu$, however calibrated)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;One cannot short the mutual fund, so the argument for using risk-free is weakened.  But, there are various economic equilibrium arguments why using it may still be OK.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use the real-world distribution, it is important to include a discount reflecting your price for risk -- one cannot just use the real-world terminal distribution in the Black-Scholes pricing formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you choose the simplest possible form for the price of risk, $\frac{\mu-r_f}{\sigma}$ in a geometric brownian motion, then you actually end up recovering the Black-Scholes formula with the risk-free rate $r_f$ as drift for fund value $S$. ( A more complicated risk alteration to the Black-Scholes SDE will not necessarily provide so simple a conclusion.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, if your own aversion to risk is different from that of other market participants for some reason, characterized by an amount $-\Delta \mu$, you can view this as an adjustment to the effective drift of the fund value $S$, substituting $r_f+\Delta \mu$ as the drift.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't forget to correct for dividends, which many mutual funds pay.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2014-03-11T14:01:27.380" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10542" PostTypeId="2" ParentId="10537" CreationDate="2014-03-11T15:41:24.583" Score="2" Body="&lt;p&gt;I can't really understand anything after the first paragraph (-1 therefore).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Making an assumption about what you meant with your first sentence, your question is how to determine whether product $A$ is going to be profitable in the future. You therefore need a forecasting model that gives $Q[Profits(t)|decision]$ (quantiles) or $E[Profits(t)|decision]$ (expectation) for each $t \in \mathbb{R}^+$ which you can discount. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This could be a combination of subjective factors (upcoming legislation that's relevant to your product, new competitor is starting up, etc) and statistical models. The model attempt that you're talking about would be the (very) beginning of an investigation on the statistical side. You would need to collect a lot of data and map this data to the next-period outcome (number of products sold of each time period, or profit from that product of each time period) using a regression/supervised learning model, and then extrapolate into the future. A simple approach would be something like ARIMA-X with seasonality and with sufficient data you can look into non-linear machine learning models. If you have insufficient time-series you can only use seasonality and time features to extrapolate since you will not be able to reduce the frequency sufficiently to achieve your objectives with exogenous features. Panel approaches may be good due to insufficient data in a univariate setting, if the products are similar.&lt;/p&gt;&#xA;" OwnerUserId="6081" LastActivityDate="2014-03-11T15:41:24.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10543" PostTypeId="2" ParentId="10537" CreationDate="2014-03-11T15:54:47.717" Score="1" Body="&lt;p&gt;Look into indices, like the consumer price index.  Your question needs more clarification though because a positive change in quantity does not necessarly translate into a positive change in profit. You need to take into account the unit price. Do all products have the same price? If not, you need compare profits not quanties.&#xA;Do the prices stay constant over the observation period? If so, then a percent change in profits is enough to compare them.if the prices changed over time, then you need to build an index.&lt;/p&gt;&#xA;" OwnerUserId="7337" LastActivityDate="2014-03-11T15:54:47.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10544" PostTypeId="1" AcceptedAnswerId="10550" CreationDate="2014-03-11T16:46:19.920" Score="8" ViewCount="1187" Body="&lt;p&gt;There has been a considerable body of work for finding trading strategies that minimize the slippage wrt arrival price. For instance, the following are on of the most well known papers:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[1] Robert Almgren, Neil Chriss, &quot;Optimal execution of portfolio transactions&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[2] Robert Almgren, &quot;Optimal execution with nonlinear impact functions and trading-enhanced risk&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[3] Mauricio Labadie, Charles-Albert Lehalle, &quot;Optimal trading algorithms and self-similar processes: a p-variation approach&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One criticism I have for these papers is the optimal trading quantities are independent on the price realization. More precisely, the number of shares to trade at time $t$ do not depends on the price I can observe at that moment which is an important piece of information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any academic work where the price realization is incorporated in the decision process?&lt;/p&gt;&#xA;" OwnerUserId="6065" LastActivityDate="2014-03-11T20:57:30.370" Title="Optimal Executions for Minimizing Slippage" Tags="&lt;quant-trading-strategies&gt;&lt;trading&gt;&lt;algorithmic-trading&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10545" PostTypeId="2" ParentId="10519" CreationDate="2014-03-11T17:10:46.790" Score="5" Body="&lt;p&gt;FPGA's are really nothing more than the same logic blocks repeated again and again throughout the silicon, with configurable switches to connect the logic blocks together.  This makes FPGA's very good--and fast--at dealing with repetitive problems that can be described in a hardware circuit that does not change during operation.  And you can have literally thousands or tens of thousands of these circuits, all working in parallel at the same time, in just one FPGA.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CPU's on the other hand are based around the ALU, which loads instructions, loads data, operates on the data, maybe stores the results, and then does it all over again.  CPU's then are very good--and fast--at dealing with problems that are continually changing--both in size and in scope and at switching between different tasks.  Today's CPU or core will have tens to hundreds of ALU's with parallel pipelines for data and instructions, which makes them very fast at complex problems that can be worked on in parallel.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These designs make FPGA's faster at simpler problems that can be attacked with a vast parallel architecture--such as condensing down multiple data feeds in less than micro-second, wire-to-wire, or triggering a pre-calculated buy, sell or cancel on a price that matches a particular pattern.  CPU's are faster at more complex problems that require less parallelism, such as calculating the basket of buys, sells and cancels needed to keep a portfolio risk-adjusted or integrating a number of price and news sources of varying age and quality into trading indicators used by traders and management to decide what adjustments they will make to the trading system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where FPGA's are used in HFT depends a lot on the architecture of particular shop.  They are best used performing simple, repetitive, wide tasks and performing them quickly.  CPU's are a Swiss knife that can do most anything, especially where the requirements are changing and the dimensions of the problem are not fully understood at the outset.&lt;/p&gt;&#xA;" OwnerUserId="7522" LastActivityDate="2014-03-11T17:10:46.790" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10546" PostTypeId="1" AcceptedAnswerId="10605" CreationDate="2014-03-11T17:18:57.280" Score="1" ViewCount="2359" Body="&lt;p&gt;As assessed by the title, I'm trying to estimate a GARCH(p,q) model to forecast stock market volatility and, in order to be able to do that, I've to identify the optimal number of lags, p and q, to fit the model properly.&#xA;Can someone of you suggest me the proper function/procedure to do that in Matlab?&#xA;I looked for that in Mathworks and in the Internet, but I found nothing whatsoever.&#xA;Thanks for helping.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2014-03-21T14:52:36.443" Title="Optimal lag length selection criterion in GARCH(p,q) model using MATLAB" Tags="&lt;volatility&gt;&lt;garch&gt;&lt;matlab&gt;&lt;lags&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10547" PostTypeId="1" CreationDate="2014-03-11T18:15:50.970" Score="1" ViewCount="279" Body="&lt;p&gt;Could someone give recommendations regarding volatility tools / web sites that they find useful? I am looking for information that my brokerage platform does not provide. Specifically, I want to see strike / time skews on options and, if available, accurate measures of 2nd order Greeks. Real time would be preferred but I'll settle for end-of-day if necessary. So far, I have found the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;iVolatility.com&#xA;Optionistics.com&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also explored www.volcube.com, which I found to be an interesting training site but I wasn't sure how valuable it would be to continue down their training/gaming system. If anyone could speak to that I would be grateful. I did find their articles very helpful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't mind paying a reasonable subscription price for a good service.&lt;/p&gt;&#xA;" OwnerUserId="7449" LastActivityDate="2014-03-12T17:47:06.640" Title="Volatility tools / web sites?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;implied-volatility&gt;&lt;greeks&gt;&lt;volatility-smile&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10548" PostTypeId="1" CreationDate="2014-03-11T19:46:21.483" Score="2" ViewCount="79" Body="&lt;p&gt;Suppose we have two time series, if one has autocorrelations and the other is non stationary how do we test whether they Granger cause a returns series?&lt;/p&gt;&#xA;" OwnerUserId="7524" LastActivityDate="2014-03-11T19:46:21.483" Title="Econometrics - Granger Causality" Tags="&lt;returns&gt;&lt;econometrics&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10549" PostTypeId="1" CreationDate="2014-03-11T20:51:56.503" Score="2" ViewCount="127" Body="&lt;p&gt;If we have a time series of returns and two time series of indicators, how would we test the use of these indicators if they are autocorrelated or nonstationary (VAR Models dont produce significant results).&lt;/p&gt;&#xA;" OwnerUserId="7524" LastActivityDate="2014-08-09T00:21:52.067" Title="Econometrics - Testing" Tags="&lt;var&gt;&lt;econometrics&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10550" PostTypeId="2" ParentId="10544" CreationDate="2014-03-11T20:57:30.370" Score="6" Body="&lt;p&gt;You are right, these work use deterministic control. Framework using stochastic control exist:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Bouchard, B., Dang, N.-M., Lehalle, C.-A., 2011. &lt;strong&gt;Optimal control of trading algorithms: a general impulse control approach&lt;/strong&gt;. SIAM J. Financial Mathematics 2 (1), 404-438. URL &lt;a href=&quot;http://epubs.siam.org/doi/abs/10.1137/090777293?af=R&quot; rel=&quot;noreferrer&quot;&gt;http://epubs.siam.org/doi/abs/10.1137/090777293?af=R&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Kharroubi, I., Pham, H., Jun. &lt;strong&gt;Optimal portfolio liquidation with execution cost and risk&lt;/strong&gt;. SIAM J. Finan. Math., 1(1), 897–931. (35 pages) URL &lt;a href=&quot;http://arxiv.org/abs/0906.2565&quot; rel=&quot;noreferrer&quot;&gt;http://arxiv.org/abs/0906.2565&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Guéant, O., Lehalle, C.-A., Fernandez-Tapia, J., 2012. &lt;strong&gt;Optimal Execution with Limit Orders&lt;/strong&gt;. SIAM Journal on Financial Mathematics 13 (1), 740-764. &lt;a href=&quot;http://arxiv.org/abs/1106.3279&quot; rel=&quot;noreferrer&quot;&gt;http://arxiv.org/abs/1106.3279&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Bayraktar, E., Ludkovski, M., Jun. 2012. &lt;strong&gt;Liquidation in limit order books with controlled intensity&lt;/strong&gt;. Mathematical Finance. URL &lt;a href=&quot;http://arxiv.org/abs/1105.0247&quot; rel=&quot;noreferrer&quot;&gt;http://arxiv.org/abs/1105.0247&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For market making you have few papers too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is a picture of the first paper in the list. You can see on the left the locally traded volume (in red) and on the right 3 mean trajectories (conditioned by the presence of a trend).&#xA;&lt;img src=&quot;https://i.stack.imgur.com/IMLXt.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is a very good idea to use stochastic control; of course it is more CPU consuming than deterministic control. In between you have the Almgren and Lorenz paper:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Almgren, R., Lorenz, J., 2006. &lt;strong&gt;Bayesian adaptive trading with a daily cycle&lt;/strong&gt;. Journal of Trading. &lt;a href=&quot;http://www.courant.nyu.edu/~almgren/papers/drift.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.courant.nyu.edu/~almgren/papers/drift.pdf&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2014-03-11T20:57:30.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10551" PostTypeId="1" AcceptedAnswerId="10582" CreationDate="2014-03-11T22:39:34.490" Score="5" ViewCount="204" Body="&lt;p&gt;I find asset pricing theory very vague and full of assumptions, especially the consumption-based modern theory. In its essence, the theory states that asset prices depend on the covariance between consumption and the asset's payoff - if an asset pays well in bad states of consumption, it warrants a higher price and vice versa. The logic behind this is ok, but what bugs me is that I don't see people behaving like this in reality, and I don't see any reason they should.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most people who participate actively in the stock market, for example, are either traders working for an institution, or investors with a decent amount of extra capital (people rarely invest in the stock market if the amount of money invested would significantly affect their consumption). Now, I really don't think traders' or fund managers' consumption levels in bad economic states is much affected by their work performance. At least it's hard to see the link. Secondly, most private investors investing in the stock market have financial buffer - they are already backed up for recessions, and just want to see their extra money grow. They don't care that much if their investment pays off well in recessions particularly. If the investment shows up a profit, they are equally happy regardless of what the economic state is because that profit will not be used to improve their level of consumption in that particular time since they are already covered.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I missing something here? Do you agree with me? I know that behavioral finance probably answers many of my questions, but nevertheless, consumption-based pricing theory is taught in finance programs and serves as a fundamental theory of everything. Again, I think that the theory is otherwise sound but the assumption that people who make investment decisions are driven by their future consumption level in different economic states is vague.&lt;/p&gt;&#xA;" OwnerUserId="7526" LastActivityDate="2014-03-14T09:04:09.970" Title="Critique against consumption-based asset pricing theory?" Tags="&lt;asset-pricing&gt;&lt;utility-theory&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10552" PostTypeId="2" ParentId="10549" CreationDate="2014-03-11T22:41:19.557" Score="1" Body="&lt;p&gt;The classical assumptions of linear regression are that the errors are uncorrelated and the variance of errors is constant (homoskedastic). So regress the returns against the indicators and test for autocorrelation and heteroskedasticity in the errors. If you don't observe any, then there's no issue with conventional hypothesis testing. If you do, use White or Newey-West standard errors (standard in most statistical packages), as appropriate, to compute new t-statistics, then proceed with hypothesis testing.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2014-03-11T22:41:19.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10555" PostTypeId="1" AcceptedAnswerId="10557" CreationDate="2014-03-12T09:07:26.873" Score="1" ViewCount="115" Body="&lt;p&gt;I'm trying to calculate the result of an simple example on page 326-327, in &lt;a href=&quot;http://pages.stern.nyu.edu/~lpederse/courses/LAP/papers/ShortSales/HarrisonKreps78.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Harrison and Kreps(1978)&lt;/a&gt;. It's pricing a piece of asset whose dividend stream is a simple Markovian process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/iTMAz.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/n8J18.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's my attempt to replicate investor $1$'s evaluation of this asset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$p^1(0) = 0 + \frac{3}{4} ( \frac{1}{2} p^{1}(0)  + \frac{1}{2} p^{1}(1) )$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$p^1(1) = 1+  \frac{3}{4} ( \frac{2}{3} p^{1}(0) + \frac{1}{3} p^{1}(1) )$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I substitute the numerical value given in the bottom of second screenshot, they don't match. Do I miss something?&lt;/p&gt;&#xA;" OwnerUserId="7461" LastActivityDate="2014-03-12T11:06:17.420" Title="Pricing a piece of asset whose dividend stream following a Markovian matrix" Tags="&lt;asset-pricing&gt;&lt;markov&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10556" PostTypeId="1" CreationDate="2014-03-12T10:53:47.563" Score="2" ViewCount="920" Body="&lt;p&gt;Is it possible to express, given an annualized Sharpe Ratio value, what is an expected maximum/average time spent in a draw-down or something in this manner?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. with SR of 10, you'd expect to spend e.g. about 1 day losing money every 2 weeks and not more than 3?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;: I was partly motivated to pose this question by reading about Virtu Financial Inc. going public and reporting it has only had 1 losing day in the last 5 years. What Sharpe Ratio would that imply?&lt;/p&gt;&#xA;" OwnerUserId="2826" LastActivityDate="2014-03-12T23:31:41.103" Title="Sharpe Ratio and time spent in loss" Tags="&lt;data&gt;&lt;risk&gt;&lt;backtesting&gt;&lt;sharpe-ratio&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10557" PostTypeId="2" ParentId="10555" CreationDate="2014-03-12T11:06:17.420" Score="4" Body="&lt;p&gt;Your equations are for cum-dividend prices, i.e. the price plus dividend today. The paper refers to ex-dividend prices. The correct two equations for investor group $a=1$ are&#xA;\begin{align}&#xA;p^1(0) =&amp;amp;\ \frac{3}{4} \left(\frac{1}{2}p^1(0) + \frac{1}{2}(1+p^1(1))\right) \\&#xA;p^1(1) =&amp;amp;\ \frac{3}{4} \left(\frac{2}{3}p^1(0) + \frac{1}{3}(1+p^1(1))\right)&#xA;\end{align}&#xA;When you solve these two equations for $p^1(0)$ and $p^1(1)$ you get the correct results.&lt;/p&gt;&#xA;" OwnerUserId="7396" LastActivityDate="2014-03-12T11:06:17.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10558" PostTypeId="1" AcceptedAnswerId="10563" CreationDate="2014-03-12T14:08:06.910" Score="6" ViewCount="784" Body="&lt;p&gt;Today I have a search of historical NASDAQ back to 70s and noticed the index was slightly increasing in 70s-early 90s and rising up and down in recent decade of years. Why would that happen? The only reason I can think of is there isn't much computer trading involved so the market wasn't crazy like today? How do you think &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/TX3p3.png&quot; alt=&quot;NASDAQ Index (1975 - 2014)&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="7532" LastActivityDate="2016-06-27T20:55:02.957" Title="Why was NASDAQ(or other index) not fluctuating in 70s and 80s?" Tags="&lt;historical-data&gt;&lt;nasdaq&gt;" AnswerCount="5" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10559" PostTypeId="2" ParentId="10556" CreationDate="2014-03-12T15:05:57.907" Score="3" Body="&lt;p&gt;In my opinion: no. &#xA;Looking at sharpe-ratio in an ex-post way you only divide average return (above risk free) by volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Volatlity can have many patterns. A draw-down is something path dependent. There is no strict implication from draw-down to volatility. One can assume that having observed a large draw-down the asset has had rather large volatility. But there is no strict and direct connection.&#xA;In fact it would be over-simplifying - don't do this.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-03-12T15:05:57.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10561" PostTypeId="1" CreationDate="2014-03-12T17:24:58.330" Score="1" ViewCount="58" Body="&lt;p&gt;Is there a general rule to determining when to separate objectives when developing a multi-objective portfolio optimization?  For example, one might start with a standard portfolio optimization of maximizing expected return, while minimizing some risk metric.  E.g:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\text{maximize} \sum_{i=1}^N w_i*r_i$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\text{minimize} \sum_{i=1}^N\sum_{j=1}^n w_iw_j\sigma_{ij}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\text{subject to} \sum_{i=1}^N w_i = 1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, lets make things more complicated.  Lets assume that the portfolio is an existing portfolio with long and short term gains/losses.  We can define a tax cost function, $T_i(w_i)$ which returns the tax cost of a change in weight from holding i's current position to the new position dependent on long/short term gains/losses.  One thought is to simply wrap this into the first objective above:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\text{maximize} \sum_{i=1}^N w_i*r_i - T_i(w_i)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or, one could create a third objective:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\text{minimize} \sum_{i=1}^N T_i(w_i)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What should one keep in mind while making a decision between wrapping a new objective into an existing objective function, versus creating a new objective to solve on?  (other applications might be when creating a portfolio that aims for both yield and growth, or minimizing on multiple risk metrics)&lt;/p&gt;&#xA;" OwnerUserId="7535" LastActivityDate="2014-03-12T17:24:58.330" Title="How do I determine what is a separate objective in a multi-objective portfolio optimization?" Tags="&lt;optimization&gt;&lt;modern-portfolio-theory&gt;&lt;algorithm&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10562" PostTypeId="2" ParentId="10547" CreationDate="2014-03-12T17:47:06.640" Score="1" Body="&lt;p&gt;www.livevol.com seems to offer good services but it seems pretty expensive. It all depends on your needs. It is probably a good service for semi-professional option trader. &lt;/p&gt;&#xA;" OwnerUserId="7451" LastActivityDate="2014-03-12T17:47:06.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10563" PostTypeId="2" ParentId="10558" CreationDate="2014-03-12T17:58:20.433" Score="12" Body="&lt;p&gt;The volatility in the indices long ago was similar in magnitude to what it is today.  The problem you are seeing in your plots is one of compounding and scaling.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Think of it this way- back in the mid 70's the magnitude of NASDAQ pricing was around \$100.  Today it is on the order of \$4000, a change of 40x.  In linear terms, a 1% change in the index today (\$40) would have been a 40% change in the index back in 1975.  This goes the other way as well, so on a linear y-axis plot, a moderate swing in value in 1975 (say 1%, or \$1.00) is indistinguishable in 2014 terms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a way to see the relative volatility over the years in a plot, and that is to use a logarithmic y-axis.  I see you are using google's charting app.  Under the chart there is a &quot;settings&quot; button.  Click it, and select &quot;logarithmic vertical axis.&quot;  It makes a big difference.&lt;/p&gt;&#xA;" OwnerUserId="7535" LastEditorUserId="7535" LastEditDate="2014-03-12T18:21:00.097" LastActivityDate="2014-03-12T18:21:00.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10564" PostTypeId="2" ParentId="10551" CreationDate="2014-03-12T18:55:31.800" Score="1" Body="&lt;p&gt;Consumption-based asset pricing theories are about representative agents, not necessarily about traders and investors in financial institutions. The agents are assumed to follow behaviors based on how people generally would decide whether to invest and how much to invest. The idea is that the average person in the economy does not invest for the joy of investing, in and of itself, nor do they save simply to be misers. Rather, they save and invest in anticipation that they will need to spend money in retirement or when unemployed. Thus, the theory is not about consumption today, necessarily, but about consumption in the future. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, suppose I am employed in a highly cyclical sector. If there is a recession, I will be laid off. This can be thought of like a bond with a default rate conditional on the state of the economy. I will then need to spend money out of savings. If my savings are primarily invested in highly cyclical sectors, then I will be doubly exposed to the risks of a decline in the market. Effectively my bond (employment) will default (end) and my investments in cyclical sectors will fall. This will leave me less money to finance my consumption.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While these models are popular in academic finance programs, the techniques are not all that popular among practicing quants, except to the extent that they mirror conventional approaches.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastEditorUserId="2379" LastEditDate="2014-03-12T19:01:06.600" LastActivityDate="2014-03-12T19:01:06.600" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10565" PostTypeId="1" AcceptedAnswerId="10583" CreationDate="2014-03-12T21:24:19.813" Score="8" ViewCount="663" Body="&lt;p&gt;I was running a bunch of simple simulations in excel the other day in excel. Using the NORM.INV(RAND(),0,1) to simulate daily stock returns I noticed that the more compounded the returns, ie, the more I multiplied the normally distributed variable with themselves in the form (1+ NORM.INV(RAND(),0,1))*(1+ NORM.INV(RAND(),0,1))...(1+ NORM.INV(RAND(),0,1)) the more and more the distribution of the final returns clumped around its mean and the fatter the tails became. Is this the same property the stock market exhibits, stock market returns might be normally distributed dover one unit of time, but the more and more returns compound the distribution changed and becomes leptokurtic??&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/LwF5i.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/46WwR.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="4729" LastEditorUserId="70" LastEditDate="2014-03-15T20:35:18.230" LastActivityDate="2014-03-15T20:35:18.230" Title="Normally Distributed Returns Become Leptokurtic Due to Compounding" Tags="&lt;probability&gt;&lt;normal-distribution&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10566" PostTypeId="2" ParentId="10556" CreationDate="2014-03-12T23:31:41.103" Score="3" Body="&lt;p&gt;You can interpret the empirical Sharpe Ratio (average return divided by standard deviation of returns) as the number of standard deviations that the mean return is from 0. Assuming a normal distribution for the returns, you can calculate how likely it is that the asset will have a negative return. If you know the mean and standard deviation themselves, you could also calculate the probability of having a return above/below any threshold (same logic applies to excess returns).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this only works for normally distributed returns. For any other (more realistic) distribution, you would need to know more parameters to say anything precise.&lt;/p&gt;&#xA;" OwnerUserId="7396" LastActivityDate="2014-03-12T23:31:41.103" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10567" PostTypeId="2" ParentId="4079" CreationDate="2014-03-13T00:30:18.863" Score="1" Body="&lt;p&gt;user25064 gave &lt;a href=&quot;http://www.quandl.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.quandl.com/&lt;/a&gt;, which is a good source.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To use quandl.com to retrieve shares outstanding history the following works: &#xA;&lt;a href=&quot;http://www.quandl.com/api/v1/datasets/OFDP/DMDRN_MSFT_FLOAT.json?&amp;amp;trim_start=2003-12-31&amp;amp;trim_end=2012-12-31&amp;amp;sort_order=desc&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.quandl.com/api/v1/datasets/OFDP/DMDRN_MSFT_FLOAT.json?&amp;amp;trim_start=2003-12-31&amp;amp;trim_end=2012-12-31&amp;amp;sort_order=desc&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I gave json since it is just the easiest form to deal with. But several other formats are available.&#xA;&quot;MSFT&quot; in the URL can be replaced with any stock symbol and quandl.com &quot;offers free and unlimited access&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: This is an old answer. It no longer works&lt;/p&gt;&#xA;" OwnerUserId="7336" LastEditorUserId="7336" LastEditDate="2016-11-28T16:02:16.033" LastActivityDate="2016-11-28T16:02:16.033" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10568" PostTypeId="1" AcceptedAnswerId="25990" CreationDate="2014-03-13T06:54:51.263" Score="0" ViewCount="460" Body="&lt;p&gt;I have been told that under Basel II the minimum PD that one can assign to any portfolio/segment classified under the retail asset class is 0.33%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But Google searches return nothing and I can't seem to find any references to it in the accord document?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this true and where is it mentioned in the accord?&lt;/p&gt;&#xA;" OwnerUserId="5934" LastActivityDate="2016-05-13T19:55:26.893" Title="Minimum PD under Basel II retail asset?" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;risk-models&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10569" PostTypeId="1" CreationDate="2014-03-13T07:49:46.253" Score="1" ViewCount="1417" Body="&lt;p&gt;I am looking to compare the ex-ante predictions against the post values. I am using a look back period of ranges from 1 year to 5 years to construct my covariance matrix that I am using for my ex-ante predictions (calculation below). I am unsure of how to determine the best look back period? &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   te_ante = sqrt(relative_wgts * cov_matrix * relative_wgts') * sqrt(4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I'm calculating the te_ante every quarter hence the sqrt(4) to give me an annualised te_ante.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7530" LastActivityDate="2014-05-29T22:23:18.260" Title="Ex-Ante tracking error how to determine the look back period" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;tracking-error&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10570" PostTypeId="2" ParentId="10569" CreationDate="2014-03-13T09:39:08.340" Score="1" Body="&lt;p&gt;As pointed out by Hull (2012). Options, futures and other derivatives. (8th edition, p305):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;A compromise that seems to work reasonably well is to use closing prices from daily data over the most recent 90 to 180 days. Alternatively, as a rule of thumb, n can be set equal to the number of days to which the volatility is to be applied.&quot;&lt;/p&gt;&#xA;" OwnerUserId="6434" LastActivityDate="2014-03-13T09:39:08.340" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10571" PostTypeId="2" ParentId="10565" CreationDate="2014-03-13T10:23:17.453" Score="2" Body="&lt;p&gt;As @Joshua Ulrich points out your distribution gets wider. Approximately, what you do is, you simulate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;Y = X_1 + \dots + X_n&#xA;$$&#xA;and $X_i$ is standard normal. Of yourse the variance increases with $n$ (and standard deviation with $\sqrt{n}$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But: greater variance does not mean heavier tails as suprises. If you want to put this in an easy number (besides the more complex tail index) you should look at kurtois, which is given (assuming zero expectation) by&#xA;$$&#xA;kurt(X) = \frac{E[X^4]}{Var[X]^2}&#xA;$$&#xA;thus you normalize for increasing variance. For details look at &lt;a href=&quot;http://en.wikipedia.org/wiki/Kurtosis&quot; rel=&quot;nofollow&quot;&gt;wikipedia&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. the t-distribution can have heavier tails than normal but with the same variance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: In your compound you do a $-1$ in the end - right?&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-03-13T10:23:17.453" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10572" PostTypeId="1" AcceptedAnswerId="10820" CreationDate="2014-03-13T15:35:34.397" Score="6" ViewCount="315" Body="&lt;p&gt;I am trying to price a floating rate bond with a capped and floored interest rate.&#xA;The strikes of the caps and floors vary, but are known in advance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to do this with QuantLibXL, but I am having trouble at every step. I would appreciate if you could just comment on my general approach, then I will try to fill the gaps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current approach is to use &lt;code&gt;qlFloatingRateBond&lt;/code&gt; and pass it a range of strikes (one for each coupon) for both &lt;code&gt;Caps&lt;/code&gt; and &lt;code&gt;Floors&lt;/code&gt; arguments. Then I imagine I have to use &lt;code&gt;qlBlackCapFloorEngine&lt;/code&gt; as pricing engine, is that right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The latter needs then an &lt;code&gt;OptionletVolatilityStructure&lt;/code&gt;, which I strip from a swaption vol cube using &lt;code&gt;qlOptionletStripper1&lt;/code&gt;. &lt;strike&gt;The issue I have here is that AFAIK Bloomberg’s VCUB returns only Cap volatilities for each option tenor relative to the ATM strike, while &lt;code&gt;qlOptionletStripper1&lt;/code&gt; wants &quot;absolute&quot; ones. What do you suggest here?&lt;/strike&gt; &lt;em&gt;Update: The volatilities returned are in fact &lt;strong&gt;not&lt;/strong&gt; relative to the ATM strike, but absolute.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much.&lt;/p&gt;&#xA;" OwnerUserId="1132" LastEditorUserId="1132" LastEditDate="2014-03-20T09:29:45.227" LastActivityDate="2014-04-04T12:17:49.770" Title="Pricing a bond with variable strike collar with QuantLibXL" Tags="&lt;quantlib&gt;&lt;floating-rate&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10575" PostTypeId="2" ParentId="10523" CreationDate="2014-03-13T20:41:23.713" Score="4" Body="&lt;p&gt;1) A straigthforward application is to price any complex payoff &lt;strong&gt;at maturity&lt;/strong&gt; using this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By that I mean a payoff that is such that the price of the option is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P = e^{-r(T-t)}E[f(S_T)] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which you can then calculate by integrating $f(S_T)$ w.r.t. to your density.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the challenges though is to have a proper marks and inter/extrapolation for the implied vols of the wings (i.e. far away from current forward) so that your density does not become negative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore another application for this density is that it is a good way to check for no arbitrage on a term option volatility curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Yes, it is just the probability which you can hedge against by using derivatives on the market. It's a bit like if a horse has 1 against 4 odds, that does not mean that there is a 20% chance that he will win, it just (sort of) means that if you have some product whose price needs to know that probability, the right number to put in the price is 20% because the hedging instrument you will use (i.e. better 1 against 4 on that horse, or against) will cost exactly that.&lt;/p&gt;&#xA;" OwnerUserId="2599" LastActivityDate="2014-03-13T20:41:23.713" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10576" PostTypeId="1" CreationDate="2014-03-13T23:24:57.550" Score="5" ViewCount="344" Body="&lt;p&gt;I'd like ask everyone a more concurrency programming but definitely quant-finance related question. How do you deal with staleness of data in market hours as quote ticks are streaming and your model is calculating its values based on previous ticks (possibly stale quotes) to make trading decisions? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Concrete example, deriving the implied volatility of an ETF according to the IV of its components. In an ETF with several hundred components, quote ticks are streaming in constantly and the model needs to respond to the changing ticks. Let's assume that there is no way to derive a composite IV with a single quote tick but the model has to be re-calculated as a whole. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The naive concurrent programming model of lock on write would make the app woefully inefficient as there'd be thousands of writes (quote ticks) before the app can &quot;read&quot; from it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other naive approach is to make the updated quote ticks visible to your reader thread, the app thread or business logic. However, this gets complicated because it forces the algo writer to be conscious of writing good concurrent code and know the concept of atomicity and immutability (e.g., what happens if you derive a metric half way in your code based on stale quotes before it got stale, and then use that variable to make the trading decision). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm curious how you have solved or thought about this problem. Thanks in advance for your help and much appreciated!&lt;/p&gt;&#xA;" OwnerUserId="7183" LastEditorUserId="7183" LastEditDate="2014-03-13T23:44:58.867" LastActivityDate="2014-03-13T23:44:58.867" Title="Algorithmic Trading Model Calculation and Stale Data" Tags="&lt;option-pricing&gt;&lt;programming&gt;&lt;modeling&gt;&lt;automated-trading&gt;&lt;algorithmic-trading&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10580" PostTypeId="2" ParentId="139" CreationDate="2014-03-14T08:18:25.690" Score="1" Body="&lt;p&gt;How about trading the full string of options?&#xA;&lt;a href=&quot;http://www.cboe.com/data/variancestrips/intro.aspx&quot; rel=&quot;nofollow&quot;&gt;http://www.cboe.com/data/variancestrips/intro.aspx&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7546" LastActivityDate="2014-03-14T08:18:25.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10582" PostTypeId="2" ParentId="10551" CreationDate="2014-03-14T09:04:09.970" Score="2" Body="&lt;p&gt;I can understand your concerns, but I think you are expecting too much from these theories. We cannot explain aggregate behavior from first principle based on a sound theory of individual decisions under uncertainty and I personally doubt that there will ever be such a Grand Unification in economics. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consumption-based asset pricing models are more related to macroeconomics than microeconomics. The goal is not to depict how individual investors behave exactly, but to derive testable implications for aggregate market behavior. For example, one of the most restrictive versions is the one period CAPM, which is probably the most widely used asset pricing model out there. There is absolutely nothing realistic about the assumptions of the model, but it does serve as a guideline because the predictions it makes are sufficiently accurate for some applications. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I wouldn't necessarily say that asset pricing is full of assumptions. There are only two fundamental assumptions: No arbitrage (or no-free lunch with vanishing risk) and more wealth is always preferred to less wealth. In this generality, however, not much can be said; nothing useful anyway. If you want strong implications you also need strong assumptions - it's always a trade-off - because we cannot verify theories by direct experimentation with economic systems.&lt;/p&gt;&#xA;" OwnerUserId="7396" LastActivityDate="2014-03-14T09:04:09.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10583" PostTypeId="2" ParentId="10565" CreationDate="2014-03-14T11:42:22.810" Score="3" Body="&lt;p&gt;Basically, what you are asking is: What is the distribution of&#xA;$$ Y = \prod_{i=1}^n X_i $$&#xA;where the $X_i$ are i.i.d. and $X_i \sim N(\mu, \sigma^2)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, $Y$ has a very complicated distribution. Check out the discussion in&#xA;&lt;a href=&quot;https://math.stackexchange.com/questions/161757/what-is-the-distribution-of-a-random-variable-that-is-the-product-of-the-two-nor?lq=1&quot;&gt;https://math.stackexchange.com/questions/161757/what-is-the-distribution-of-a-random-variable-that-is-the-product-of-the-two-nor?lq=1&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://math.stackexchange.com/questions/133938/what-is-the-density-of-the-product-of-k-i-i-d-normal-random-variables?lq=1&quot;&gt;https://math.stackexchange.com/questions/133938/what-is-the-density-of-the-product-of-k-i-i-d-normal-random-variables?lq=1&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you can easily calculate are the moments of $Y$ since the $X_i$ are i.i.d.:&#xA;So&#xA;$$&#xA;\mathbb{E}[Y] =  \mathbb{E}\left[\prod{i=1}^n X_i\right] =  \prod{i=1}\mu =\mu^n\\&#xA;\mathbb{V}[Y] = \mathbb{E}[Y^2] - \mathbb{E}[Y]^2 =  \mathbb{E}[\left(\prod{i=1}^n X_i\right)^2] - \mu^{2n} = &#xA;\prod_{i=1}^n \mathbb{E}[X_i^2] - \mu^{2n} = \left(\sigma^2 + \mu^2\right)^n - \mu^{2n} \\&#xA;\mathbb{E}[(Y-\mathbb{E}[Y])^4] = \mathbb{E}[Y^4] - 4\mathbb{E}[Y^3]\mu^n + 6\mathbb{E}[Y^2]\mu^{2n} - 4\mathbb{E}[Y] \mu^{3n} + \mu^{4n}&#xA;= \prod_{i=1}^n \mathbb{E}[X_i^4] + 6 \left(\sigma^2 + \mu^2\right)^n\mu^{2n} - 3 \mu^{4n}&#xA;\\&#xA;= 3^n \sigma^{4n} + 6 \left(\sigma^2 + \mu^2\right)^n\mu^{2n} - 3 \mu^{4n}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The expression for the kurtosis of $Y$ is therefore&#xA;$$ kurt(Y) = \frac{3^n\sigma^{4n} + 6 \left(\sigma^2 + \mu^2\right)^n\mu^{2n} - 3 \mu^{4n}}{\left(\sigma^2 + \mu^2 \right)^n - \mu^{2n}} $$&#xA;which is increasing in n.&lt;/p&gt;&#xA;" OwnerUserId="7396" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2014-03-14T11:42:22.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10584" PostTypeId="1" AcceptedAnswerId="10601" CreationDate="2014-03-14T12:58:43.667" Score="0" ViewCount="262" Body="&lt;p&gt;Can anyone give any reference for using the geometric mean to average the returns from several indices?  Note, this question is not about the usual use of geometric mean to obtain the average return from a single time series.  It is about averaging several indices in a single time step, so for example :-&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;January 2014&#xA;index 1 return = 3%&#xA;index 2 return = 5%&#xA;index 3 return = -2%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;E.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;returns = {3, 5, -2};&#xA;meanreturn = (GeometricMean[returns/100. + 1] - 1)*100&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Answer: 1.95711 %&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current thought as to why the geometric mean might be used to average returns in a single time period is that it produces a lower result than the arithmetic mean, so for generally positive returns with a leptokurtic bias (shown red c/w blue normal dist.) the geometric mean would damp out the contribution of the higher returns.  This seems a bit of a kluge though; any references welcome.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/EkDcb.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Averages generated from randomly generated distributed returns around a value of 1%&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="7178" LastEditorUserId="7178" LastEditDate="2014-03-25T15:38:54.227" LastActivityDate="2014-07-22T06:33:12.990" Title="Use of geometric mean for average return of several indices" Tags="&lt;equities&gt;&lt;statistics&gt;" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10585" PostTypeId="1" AcceptedAnswerId="10607" CreationDate="2014-03-14T13:22:43.183" Score="3" ViewCount="629" Body="&lt;p&gt;Over the years I have developed several tools - including pricing, optimization and calibration tools - most in VBA, C# and C++&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to make them publicly avaliable. Aside from putting up my own site what other distribution channels could one use ?&#xA;(R has a great platform for package distribution (CRAN) - something like that won't be avaliable for excel-VBA or C# - still, perhaps there is some place online where finance tools tend to cluster)&lt;/p&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2016-02-12T14:12:02.963" Title="Places to make quant code/tools publicly avaliable" Tags="&lt;option-pricing&gt;&lt;database&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10586" PostTypeId="1" CreationDate="2014-03-14T14:25:22.990" Score="3" ViewCount="48" Body="&lt;p&gt;I crossposted this &lt;a href=&quot;https://math.stackexchange.com/questions/708761/characterizing-relation-has-no-less-information-than-between-information-syst&quot;&gt;question&lt;/a&gt; on math.stackexchange.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Background:&lt;/strong&gt; Suppose that an investor's utility is both determined by the state and her action taken. A fact of life is that she can't observe the realized state. However, she can deduce the probability of each state conditional on different signals. One natural question is whether the investor will be better off if signals are more informative. Contrasted with game theoretical setting, &lt;a href=&quot;http://dirkbergemann.commons.yale.edu/files/2013/01/LeshnoSpector92.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Blackwell's theorem&lt;/a&gt; answers this question affirmatively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An information system relates signals to states by assigning probabilities. Let's say states be indexed by a finite set $I$, signals be indexed by another finite set $J$. $Q$ is a $|I| \times |J|$ matrix. $Q_{ij}$ represents the probability that at the $i$th state, the $j$th signal displays. Thus $Q$ is a Markovian matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For two information systems $M$, $N$, we say $M$ is not less informative than $N$ if there exists a matrix $U$ with appropriate dimension such that $MU = N$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; Is there a way to justify this characterization other than appealing to Blackwell's theorem which seems to be tautological?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried some simple square matrices. For example, it matches intuition that identity matrix is the maximal informative matrix. At least in some situations the inverse of a invertible Markovian matrix could be not Markovian. But I don't find them convincing enough.&lt;/p&gt;&#xA;" OwnerUserId="7461" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2014-03-14T14:25:22.990" Title="Characterizing relation &quot; has no less information than&quot; between information systems represented by Markovian matrices" Tags="&lt;expected-return&gt;&lt;theory&gt;&lt;information&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10587" PostTypeId="1" AcceptedAnswerId="10599" CreationDate="2014-03-14T17:59:37.503" Score="1" ViewCount="117" Body="&lt;p&gt;This is an FX question. I want to track short term (overnight or next best thing) rates for major/em ccys. What's the best way of doing this? Is there an index I can follow? Preferably something published for free somewhere. :)&lt;/p&gt;&#xA;" OwnerUserId="5924" LastActivityDate="2014-03-17T03:52:18.043" Title="What is a good index to track short term interest rates?" Tags="&lt;interest-rates&gt;&lt;automated-trading&gt;&lt;fx&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10588" PostTypeId="2" ParentId="10524" CreationDate="2014-03-14T21:31:09.333" Score="2" Body="&lt;p&gt;Depending upon how much data you have, you might find &lt;a href=&quot;http://www.bis.org/publ/cgfs23violi.pdf&quot; rel=&quot;nofollow&quot;&gt;Violi (2004)&lt;/a&gt; useful. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.194.3115&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow&quot;&gt;Nickell et al. (2000)&lt;/a&gt;, while principally considering time-dependent stability tests, refers a bit to significance testing between the matrices of different agencies and might also provide some insight.&lt;/p&gt;&#xA;" OwnerUserId="7536" LastActivityDate="2014-03-14T21:31:09.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10589" PostTypeId="1" AcceptedAnswerId="10590" CreationDate="2014-03-14T23:40:13.677" Score="9" ViewCount="8459" Body="&lt;p&gt;This can either be a silly question or a question with no sure rigorous answer but defined with some convention. Any way, here it is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the (industrial recognized) definition of the return of a long-short portfolio? Normally, return is defined as profit/initial investment. The initial portfolio may be predominantly short or even neutral (net zero dollar). Should we take the initial investment as the sum of the absolute value of the investment, because the short most likely requires collateral? If so, should one take the leverage rate into account? &lt;/p&gt;&#xA;" OwnerUserId="6686" LastActivityDate="2014-03-25T17:20:44.300" Title="Definition of Return of A Long/short Portfolio" Tags="&lt;returns&gt;&lt;modern-portfolio-theory&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10590" PostTypeId="2" ParentId="10589" CreationDate="2014-03-15T16:22:16.317" Score="10" Body="&lt;p&gt;The initial investment is the capital in the account used to support the portfolio, &lt;em&gt;not&lt;/em&gt; the cost of the assets in the portfolio.  For example, when you sell a stock or bond short, your account doesn't actually accrue any cash.  Instead you start receiving a regular cash flow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There isn't necessarily a difference between these quantities in a long-only portfolio but for a long-short portfolio of any kind you automatically must make some assumption about the &lt;em&gt;leverage&lt;/em&gt; -- the amount of cash required to support a given position size.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your portfolio is a set of positions with notional values $A_i$ (possibly including cash $A_0$) and it is supported by capital $K$ then the &lt;em&gt;gross leverage&lt;/em&gt; is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;L_G =\frac1K \sum_{i&amp;gt;0} |A_i|&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After a month, if your positions are now worth $\tilde{A}_i$ then your one-month return on capital is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;r =\frac1K \sum_i (\tilde{A}_i-{A}_i)&#xA;$$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This obviously depends on the capital $K$, so return is dependent on leverage assumptions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Depending on the riskiness of a strategy and how well it can be measured within their existing risk control software, prime brokers will typically allow leverage between 2:1 and 20:1.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your position exceeds the agreed leverage ratio at any time, you will receive a &lt;em&gt;margin call&lt;/em&gt;, where you will either have to come up with some further long positions to assign to the portfolio, or liquidate some existing positions to cash.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2014-03-18T13:49:37.737" LastActivityDate="2014-03-18T13:49:37.737" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10591" PostTypeId="1" AcceptedAnswerId="10665" CreationDate="2014-03-15T21:52:06.260" Score="5" ViewCount="815" Body="&lt;p&gt;Let $X_t$ be a Levy Process and $e^{X_t}$ the corresponding exponential Levy process. Using the Esscher transform for a change of measure for which the Radon-Nykodym derivative is &#xA;$$\frac{d\mathbb{Q}}{d\mathbb{P}} = \frac{e^{\theta X_T}}{E[e^{\theta X_T}]},$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking to find the Esscher parameter $\theta$ such that the measure $\mathbb{Q}$ is &lt;strong&gt;risk neutral&lt;/strong&gt;, i.e. such that the following equation is satisfied:&#xA;$$&#xA;E^{\mathbb{Q}}[e^{X_T} \vert \mathcal{F}_t] = e^{X_t}&#xA;$$&#xA;where $T&amp;gt;t$ and $\mathcal{F}_t$ is the filtration at time t. My goal is to find an explicit formula for $\theta$ in terms of characteristic functions of the Levy process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What I have tried:&lt;/strong&gt; &#xA;Using Bayes' rule  $$ E^{\mathbb{Q}}[X \vert \mathcal{F}] = \frac{E^{\mathbb{P}}[ X f \vert \mathcal{F}]}{E^{\mathbb{P}} [f \vert \mathcal{F}]}&#xA;$$&#xA;where $f$ is a Radon-Nykodym derivative $dQ/dP$,&#xA;we get $$&#xA;E^{\mathbb{P}} \left[ \frac{e^{\theta X_T}}{E^{\mathbb{P}}[e^{\theta X_T}]} e^{X_T} \bigg| \mathcal{F}_t \right]\frac{1}{ E^{\mathbb{P}} \left[ \frac{e^{\theta X_T}}{E^{\mathbb{P}}[e^{\theta X_T}]} \big| \mathcal{F}_t \right]} = e^{X_t} \Leftrightarrow\\&#xA;E^{\mathbb{P}} [e^{(\theta +1) X_T} | \mathcal{F}_t] = e^{X_t} E^{\mathbb{P}}[e^{\theta X_T} | \mathcal{F}_t]$$ Since $e^{(\theta+1)X_t}$ is $\mathcal{F}_t$-measurable, this can be written $$ e^{(\theta +1 )X_t} E^{\mathbb{P}}[e^{(\theta +1)(X_T-X_t)} | \mathcal{F}_t] = e^{X_t} E^{\mathbb{P}}[e^{\theta X_T} | \mathcal{F}_t]$$ By stationarity of increments of the Levy process this can be written $$&#xA;e^{\theta} E^{\mathbb{P}}[e^{(\theta +1)X_{T-t}} | \mathcal{F}_t] = E^{\mathbb{P}}[e^{\theta X_T} | \mathcal{F}_t]&#xA;$$&#xA;Now by making the substitution $\theta +1 = iu$ we rewrite the equation in terms of characteristic functions:&#xA;$$&#xA;e^{\theta} e^{(T-t)\psi(u)} = e^{t\psi(u)}E(e^{-X_T}|\mathcal{F}_t)&#xA;$$&#xA;Where $\psi$ is the characteristic exponent. This is almost what I need, except the extra expectation. What to do with it? I have a somewhat limited knowledge of filtrations for continuous time models so I am not sure whether the above calculations are correct either.&lt;/p&gt;&#xA;" OwnerUserId="7555" LastEditorUserId="7555" LastEditDate="2014-03-20T14:41:00.493" LastActivityDate="2014-03-22T14:06:56.563" Title="Risk neutral Esscher transform of exponential Levy processes" Tags="&lt;modeling&gt;&lt;risk-neutral-measure&gt;" AnswerCount="2" CommentCount="14" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10592" PostTypeId="1" CreationDate="2014-03-15T23:29:28.077" Score="-1" ViewCount="89" Body="&lt;p&gt;Given that $B=Ce^{-y} + Ce^{-2y}+ (100+C)e^{-3y}$&#xA;where B is the bond price, C is the coupon. and It is a 3 years annual coupon bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to find $\frac{dD}{dC}$ where $D$ is the modified duration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My steps:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1.modified duration = D&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;$D = \frac{-1}{B} * \frac{dB}{dy}$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$D = \frac{-1}{B}  (-Ce^{-y} - 2Ce^{-2y} - 3Ce^{-3*y} - 300e^{-3y})$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Then find $\frac{dD}{dC}$ &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$\frac{dD}{dC} = \frac{1}{B}  (e^{-y} + 2e^{-2y} + 3e^{-3y}) $&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Am I correct ? &lt;/p&gt;&#xA;" OwnerUserId="7269" LastEditorUserId="7279" LastEditDate="2014-03-19T10:51:07.397" LastActivityDate="2014-03-19T10:51:07.397" Title="Calculating the sensitivity of the modified bond duration to changes in the coupon rate" Tags="&lt;bond&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10593" PostTypeId="1" CreationDate="2014-03-16T07:01:58.770" Score="0" ViewCount="509" Body="&lt;p&gt;I am preparing a study about Volatility and Variance Swaps.&#xA;Does anyone know where I can found historical public data regarding this instruments?&#xA;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="7557" LastActivityDate="2020-11-04T12:05:45.070" Title="Volatility swaps historical data" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10594" PostTypeId="2" ParentId="10376" CreationDate="2014-03-16T17:35:35.530" Score="1" Body="&lt;p&gt;There is a promising-looking &lt;a href=&quot;http://cran.r-project.org/web/packages/XBRL/index.html&quot; rel=&quot;nofollow&quot;&gt;R package to read XBRL data&lt;/a&gt; which I have yet to try myself.  But it looks like it does the legwork for you.&lt;/p&gt;&#xA;" OwnerUserId="69" LastActivityDate="2014-03-16T17:35:35.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10595" PostTypeId="1" CreationDate="2014-03-16T21:17:40.373" Score="1" ViewCount="161" Body="&lt;p&gt;I'm working with a heterogenous basket of instruments (in volatility terms). Risk parity allocation seems to be useful for the portfolio( * 1/Volatility). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, there are times when the volatility of a couple of instruments drops down significantly compared to the rest of the universe. Risk parity asset allocation shifts too much capital to the low-vol instruments(20-50%) which is highly undesirable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basic improvement to the allocation approach introducing a cutoff rule based on comparing the risk parity allocation to a naive equal weight approach and limiting the allocation to a maximum percentage(10-20%). However, this doesn't seem to be optimal especially when universe size becomes too small or too large.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas/improvements/suggestions on how to deal with risk allocation in heterogenous universes while actively avoiding concentrating the portfolio weights to a few instruments?&lt;/p&gt;&#xA;" OwnerUserId="1926" LastActivityDate="2014-03-26T18:02:54.107" Title="Controlling portfolio concentration" Tags="&lt;risk-management&gt;&lt;asset-allocation&gt;&lt;algorithm&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10596" PostTypeId="2" ParentId="10558" CreationDate="2014-03-16T21:31:50.490" Score="1" Body="&lt;p&gt;Always use a semi-logarithmic scale when looking at prices. It makes percentage moves of equal heights on your graphs.&lt;/p&gt;&#xA;" OwnerUserId="7544" LastActivityDate="2014-03-16T21:31:50.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10597" PostTypeId="2" ParentId="10595" CreationDate="2014-03-16T21:46:52.267" Score="5" Body="&lt;p&gt;I would create categories, and work on risk parity among the categories. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise, variance is not really a good measure of downside risk: &#xA;Change your risk measure, use a rolling window historical VaR or Expected Shortfall at some horizon that matches your investment style. downside semi-variance could do the trick too if don't want to change your algo too much. &lt;/p&gt;&#xA;" OwnerUserId="7544" LastActivityDate="2014-03-16T21:46:52.267" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10598" PostTypeId="2" ParentId="10593" CreationDate="2014-03-17T03:09:31.210" Score="2" Body="&lt;p&gt;There are no free resources that provide historical bid and ask prices for option chains. You should consider buying them from a data provider.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, you can start accumulating data from yahoo using the getOptionChain function of the {quantmod} R package.&lt;/p&gt;&#xA;" OwnerUserId="7544" LastActivityDate="2014-03-17T03:09:31.210" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10599" PostTypeId="2" ParentId="10587" CreationDate="2014-03-17T03:52:18.043" Score="4" Body="&lt;p&gt;Look for the Overnight LIBOR or OIS rates for each currency. It's easier to find LIBOR rates by the way, but OIS are closer to being risk-free. In a nutshell, LIBOR rates contain bank related credit risk which may induce bias your analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also available for the USD is the fed funds rate and the ECB refinancing rate for the EUR.&lt;/p&gt;&#xA;" OwnerUserId="7544" LastActivityDate="2014-03-17T03:52:18.043" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10601" PostTypeId="2" ParentId="10584" CreationDate="2014-03-17T14:05:44.760" Score="3" Body="&lt;p&gt;I can offer an intuitive answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The limit when your equally weighted portfolio is continuously rebalanced will give you the geometric mean.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is because the excess return of the better performing strategies will be allocated towards the least performing strategies, compounding high returns with low returns.&lt;/p&gt;&#xA;" OwnerUserId="7544" LastActivityDate="2014-03-17T14:05:44.760" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10603" PostTypeId="2" ParentId="10516" CreationDate="2014-03-18T00:54:17.410" Score="-1" Body="&lt;p&gt;What you are missing is the sum of errors. Though the sum is i.i.d but if you want to match your numbers, then your need to sum them correctly. sqrt(ti+1 - ti)zi + sqrt(ti - ti-1)zi-1 is not equal to sqrt(ti+1 - ti-1)(zi-zi-1). Still getting familiar with the math symbols, but I think you get the idea. Log(St/S0) is definitely normal but to compare numerically, you need to take into account the correct sum of errors. &lt;/p&gt;&#xA;" OwnerUserId="7468" LastActivityDate="2014-03-18T00:54:17.410" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10605" PostTypeId="2" ParentId="10546" CreationDate="2014-03-18T03:02:21.263" Score="3" Body="&lt;p&gt;work you way from GARCH(4,4) to GARCH(0,0) removing the intercept too. 5*5*2-1 = 49 estimations&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Make sure your coefficients are all statistically significant at least to 95% confidence.&lt;/li&gt;&#xA;&lt;li&gt;Make sure you have no autocorrelation in your error terms. pacf and acf should be clean.&lt;/li&gt;&#xA;&lt;li&gt;Likelihood ratio tests assess whether you lose explaining power from removing/adding lags.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Lastly your real test should be an out-of-sample study of the forecast error distribution, and really look at whether your GARCH adds value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's ok to have a biased estimation of the conditional variance if the forecast error variance is smaller than a non-biased estimation. But again, that depends on the use you have for your forecast.&lt;/p&gt;&#xA;" OwnerUserId="7544" LastActivityDate="2014-03-18T03:02:21.263" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10607" PostTypeId="2" ParentId="10585" CreationDate="2014-03-18T17:16:14.223" Score="3" Body="&lt;p&gt;Github and Bitbucket are both good options for a git repository.  If you want other people to look at your code and help build on it, Github is the better choice.  If privacy is what matters most, you can get a free private repository from Bitbucket.  On github, only public repositories are free.&lt;/p&gt;&#xA;" OwnerUserId="3415" LastActivityDate="2014-03-18T17:16:14.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10608" PostTypeId="2" ParentId="10558" CreationDate="2014-03-18T21:34:14.423" Score="0" Body="&lt;p&gt;try to get a chart with prices for stocks that are not adjusted for dividends and splits, (from quandl, or yahoo) and you will see that the stocks were moving just like they do today, and even more since they didn't trade in decimals. &lt;/p&gt;&#xA;" OwnerUserId="6186" LastActivityDate="2014-03-18T21:34:14.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10609" PostTypeId="1" AcceptedAnswerId="10650" CreationDate="2014-03-19T00:09:10.637" Score="3" ViewCount="1582" Body="&lt;p&gt;Given that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$e^{r\Delta t}(u+d)-ud-e^{2r\Delta t} = \sigma^2\Delta t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to show that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$u=e^{\sigma\sqrt{\Delta t}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know I must somehow use Taylor's approximation $e^x = 1 + x + \frac{x^2}{2}+...$ and ignore terms of $\Delta t$ higher than 1, but I can't seem to get to the value of $u$. Can someone show me this derivation?&lt;/p&gt;&#xA;" OwnerUserId="2812" LastActivityDate="2014-03-21T22:12:21.527" Title="How can I show that $u=e^{\sigma\sqrt{\Delta t}}$ in the binomial option pricing model" Tags="&lt;risk-neutral-measure&gt;&lt;binomial-tree&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10610" PostTypeId="2" ParentId="10609" CreationDate="2014-03-19T04:05:09.390" Score="5" Body="&lt;p&gt;Not all binomial trees take $u=e^{\sigma\sqrt{\Delta t}}$.  Thinking of the binomial tree as a discrete approximation (on a grid) to a continuous process, it makes sense that a variety of choices for where to place grid points will work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a listing of a few different choices of $u$, see the Tian Tree settings and others.  From &lt;a href=&quot;http://www.sitmo.com/article/binomial-and-trinomial-trees/&quot;&gt;this Sitmo page&lt;/a&gt; you can see, for example, that Jarrow and Rudd take&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;u = e^{(r-q-\frac12 \sigma^2)\Delta t + \sigma\sqrt{\Delta t}}&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2014-03-19T04:05:09.390" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10611" PostTypeId="1" CreationDate="2014-03-19T06:05:07.620" Score="2" ViewCount="720" Body="&lt;p&gt;I had been working on algorithm which uses the Hurst Exponent. Once i random walk simulation on matlab, x = cumsum(randm(1000,1)), I was able to get a hurst value close to 0.5.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To analyze the use of Hurst Exponent in mean aversion or mean reversion, may i know what are the equation models that i can used to run Monte Carlo simulations?&lt;/p&gt;&#xA;" OwnerUserId="6034" LastActivityDate="2014-03-19T12:05:05.170" Title="What are the equation that gives hurst exponent of value &gt;0.7 and &lt;0.3?" Tags="&lt;matlab&gt;&lt;hurst-exponent&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10612" PostTypeId="1" AcceptedAnswerId="10643" CreationDate="2014-03-19T06:32:05.573" Score="1" ViewCount="12303" Body="&lt;p&gt;It is said that the time series has a stochastic trend if the first autocorrelation coefficient will be near 1. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q1) What does it mean by the above statement?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q2) How do we calculate the first autocorrelation of a time series?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any comments on the matter will be well-appreciated.&lt;/p&gt;&#xA;" OwnerUserId="6034" LastActivityDate="2014-03-20T14:41:13.753" Title="What does it mean by autocorrelation coefficient near 1?" Tags="&lt;time-series&gt;&lt;stochastic-processes&gt;&lt;auto-correlation&gt;&lt;stationarity&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10613" PostTypeId="2" ParentId="10612" CreationDate="2014-03-19T07:09:48.863" Score="4" Body="&lt;p&gt;Autocorrelation is the correlation of a series with itself. Suppose $X = {X_1, X_2, X_3, ...}$ is your time series. Then the autocorrelation between $X_t$ amd $X_s$ is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{E[(X_t-\mu_t)(X_s-\mu_s)]}{\sigma_t \sigma_s}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be simplified quite a lot if the series you have is stationary (a common assumption), in which case the autocorrelation depends only on the lag $k$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{E[(X_t-\mu)(X_{t+k}-\mu)]}{\sigma^2}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, (for Q2), the lag $k$ is 1. In practice, this means if you have a time series of $x_1, x_2, ..., x_n$ elements, you would calculate the correlation (using Excel CORR() perhaps) between the sub-series $x_1, x_2, ..., x_{n-1}$ and $x_2, x_3, ..., x_n$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A positive (negative) autocorrelation means that an increase in your time series is often followed by another increase (a decrease). If the autocorrelation is close to 1, then an increase is almost certainly followed by another increase. In other words, the average value of the time series is increasing. Alternatively, a decrease is almost certainly followed by a decrease. In other words, the average level of the time series is decreasing. The &quot;trend&quot; part follows trivially.&lt;/p&gt;&#xA;" OwnerUserId="7166" LastActivityDate="2014-03-19T07:09:48.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10615" PostTypeId="2" ParentId="10611" CreationDate="2014-03-19T08:01:17.560" Score="4" Body="&lt;p&gt;The corresponding process would be &#xA;&lt;em&gt;fractional brownian motion&lt;/em&gt; (see &lt;a href=&quot;http://en.wikipedia.org/wiki/Fractional_Brownian_motion&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is parametrized by the Hurst Exponent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the referenced site you find a link to some matlab code for simulating realizations of fractional BM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to see some fractional Gaussian Noise in action (Matlab) you can do so&#xA;&lt;a href=&quot;http://www.symmys.com/node/131&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Further more you might want to look into ARFIMA processes...&lt;/p&gt;&#xA;" OwnerUserId="2727" LastEditorUserId="2727" LastEditDate="2014-03-19T12:05:05.170" LastActivityDate="2014-03-19T12:05:05.170" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10616" PostTypeId="2" ParentId="10612" CreationDate="2014-03-19T09:31:15.053" Score="2" Body="&lt;p&gt;1.) Autocorrelation is the correlation of a time series against the lagged version of itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2). First autocorrelation is the correlation of the time series against the lag(1) version of itself. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's look at the example below &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Period_Numbers = [1,2,3,4,5,6,7,8,9,10]&#xA;Time_Series = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;First Autocorrelation is calculated by taking the correlation of periods 1 to 9 and periods 2 to 10. That is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Autocorrelation_lag1 =  Correlation of [(10, 20, 30, 40, 50, 60, 70, 80, 90), (20, 30, 40, 50, 60, 70, 80, 90, 100)]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a an explanation from Investopedia - &lt;a href=&quot;http://www.investopedia.com/terms/a/autocorrelation.asp&quot; rel=&quot;nofollow&quot;&gt;http://www.investopedia.com/terms/a/autocorrelation.asp&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7576" LastActivityDate="2014-03-19T09:31:15.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10617" PostTypeId="2" ParentId="10592" CreationDate="2014-03-19T10:42:52.110" Score="1" Body="&lt;p&gt;For the sake of completeness:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking pbr142's comment into account and working in the setting you described. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Set $f(C,y)=Ce^{-y} + 2Ce^{-2y} + 3Ce^{-3*y} + 300e^{-3y}$. Write $B(C,y)$ instead of $B$. Applying the quotient rule to $\frac{\partial D(C,y)}{\partial C}$ with $D(C,y)=\frac{f(C,y)}{B(C,y)}$. This leads to the following expression&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{\partial D(C,y)}{\partial C}=\frac{(e^{-y} + 2e^{-2y} + 3e^{-3y})B(C,y)-(e^{-y} + e^{-2y} + e^{-3y})f(C,y)}{B(C,y)}$&lt;/p&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-03-19T10:42:52.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10618" PostTypeId="2" ParentId="10591" CreationDate="2014-03-19T11:38:48.813" Score="1" Body="&lt;p&gt;In the paper &lt;a href=&quot;http://pages.stern.nyu.edu/~dbackus/Disasters/Gerber_Shiu_94.pdf&quot; rel=&quot;nofollow&quot;&gt;OPTION PRICING BY ESSCHER TRANSFORMS&lt;/a&gt; the authors explore this topic extensively and provie equations that enable the calculation of the risk neutral $\theta$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note that you can easily deal with the expectation in &#xA;$$&#xA;e^{\theta} e^{(T-t)\psi(u)} = e^{t\psi(u)}E(e^{-X_T}|\mathcal{F}_t)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if the process $X_t$ itself has nice properties. One could solve it in the GBM cases. A solution should also be attainable &lt;strong&gt;if the process' transition density is known&lt;/strong&gt; explicitly.&lt;/p&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="7279" LastEditDate="2014-03-22T14:06:56.563" LastActivityDate="2014-03-22T14:06:56.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10621" PostTypeId="1" CreationDate="2014-03-19T16:09:18.573" Score="2" ViewCount="93" Body="&lt;p&gt;If the convertible bond has dividend-protection, how can we cater it in the binomial model? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there is dividend protection at or above 1%, can we impose input of dividend yield of 1% in the binomial model/Monte-Carlo simulation? If so, is there any reference to explain such method? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="6119" LastActivityDate="2014-03-19T16:09:18.573" Title="How can dividend protection be considered in the binomial model in pricing the convertible bond?" Tags="&lt;convertible-bond&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10622" PostTypeId="1" CreationDate="2014-03-19T16:56:09.580" Score="1" ViewCount="234" Body="&lt;p&gt;The way I understand it is that there are three main parameters to a convertible debt investment. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;An investment amount&lt;/li&gt;&#xA;&lt;li&gt;A discount rate&lt;/li&gt;&#xA;&lt;li&gt;A trigger event &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Now under most of the examples I have seen, a trigger event for a given investment will occur, a post money valuation will be made based of the subsequent investment, at that point the convertible debt will be converted and a discount rate applied to it to calculate the initial investors final equity amount. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I have on numerous occasions seen the discount rate being referred to as an &quot;interest rate&quot; and I stand confused in trying to understand if the length of time till the trigger event somehow effects the final discount rate of a convertible debt investment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So say for example you negotiate a convertible debt investment with a 12% discount rate, does this mean that if the trigger event occurs in 1 month you might only have a 1% discount rate?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fundamentally what I am asking is, does time have an effect on the discount rate or is this a set value regardless of the period of time elapsed till the trigger event? If the value is set, why is it often referred to as an interest rate?&lt;/p&gt;&#xA;" OwnerUserId="7582" LastActivityDate="2014-07-23T10:25:24.347" Title="Discount rate, convertible debt and the effect of time" Tags="&lt;equities&gt;&lt;convertible-bond&gt;&lt;investment&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10623" PostTypeId="1" CreationDate="2014-03-19T17:36:55.470" Score="10" ViewCount="4331" Body="&lt;p&gt;I am looking for methods to select points in time when delta hedging plain vanilla European options under trading costs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is easy to come up with ad hoc ideas such as&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Time-based: for example at fixed time intervals.&lt;/li&gt;&#xA;&lt;li&gt;Price-based: hedge when the price has moved a more than a given percentage.&lt;/li&gt;&#xA;&lt;li&gt;Delta-based: hedge when the option delta has reached a given threshold.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;How is the delta hedging frequency choosen in practice? Could you point out more sophisticated methods in the literature? Would Taleb's book on dynamic delta hedging be a good investment?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Edit: What I have found so far:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Option Pricing and Replication with Transaction Costs, Leland, Journal of Finance, 1985. &lt;br /&gt;He disscusses rehedging at ﬁxed regular intervals.&lt;/li&gt;&#xA;&lt;li&gt;Hedging of Option Portfolios and Options on Several Assets with Transaction Costs and Nonlinear Partial Diﬀerential Equations, V. Zakamouline, 2008.&lt;br /&gt;Extends Leland's approach to other options, especially path-dependent options.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerDisplayName="user1157" LastEditorDisplayName="user1157" LastEditDate="2014-03-20T11:12:02.703" LastActivityDate="2018-10-16T03:01:47.450" Title="Delta hedging frequency for plain vanilla European options under trading costs" Tags="&lt;delta-hedging&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10624" PostTypeId="1" AcceptedAnswerId="10629" CreationDate="2014-03-19T18:30:11.317" Score="2" ViewCount="464" Body="&lt;p&gt;&quot;Consider a credit rating system consisting of four states, A,B,and D(default) with the following annual credit transition probability:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A= [ 0.7, 0.2, 0.1; 0.2, 0.5,0.3; 0,0,1]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a company rated B, calculate the value of a 100 dollar bond with maturity three years from now and an annual coupon of $5.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's my thinking: Find A^2 and A^3, and the second row, third column is the probability of default for year 2, and 3 respectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, Value = coupon payment*exp-(rate*time)*probability of default (for the three payments).&#xA;The rate would come from second row, second column from matrix A. Would that be right?&lt;/p&gt;&#xA;" OwnerUserId="7583" LastEditorUserId="7583" LastEditDate="2014-03-25T15:25:24.483" LastActivityDate="2014-03-25T15:25:24.483" Title="Price of Bond given credit state matrix" Tags="&lt;transition-matrix&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10625" PostTypeId="2" ParentId="10623" CreationDate="2014-03-19T19:34:55.817" Score="10" Body="&lt;p&gt;First when transaction costs are involved the trader has to make a tradeoff between return and risk. Continuous rebalancing/hedging could lead to infinite transaction costs but provides (in theory) a perfect hedge. Discrete hedging enables to minimize transaction cost but leads to hedging errors and more risk. To find a price one must introduce an optimization criteria (e.g. a utility function)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As already mentioned it is hard to name &quot;the one approach&quot; that is done in practice. I will thus refer you to some texts to get you started on the topic. Banks etc. will develop their own methods using results from research/academia. Good methods equal good money - so people will not readily part with their secrets. Knowing the theory and the reasoning behing some of the approaches will, however, enable you to make your own condlusions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Some interesting papers/results on the topic:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You have already found: &lt;a href=&quot;http://pages.stern.nyu.edu/~lpederse/courses/LAP/papers/Derivatives/Leland85.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Option pricing and replication&#xA;with transaction costs by Leland&lt;/a&gt; It is one of the first papers an&#xA;the topic and a fairly easy read for the hedge is done in a B&amp;amp;S&#xA;setting. &lt;/li&gt;&#xA;&lt;li&gt;Unfortunately the results derived by the authors do not&#xA;always hold. Thus you should read the following paper &lt;a href=&quot;http://edoc.hu-berlin.de/series/speps/2003-22/PDF/22.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;On Leland’s&#xA;Option Hedging Strategy with Transaction Costs&lt;/a&gt; for a more&#xA;comprehensive understanding of the strategy suggested by Leland.  &lt;/li&gt;&#xA;&lt;li&gt;Another approach is&#xA;presented by Clewlow and Hodges in &lt;a href=&quot;http://www.math.ku.dk/~rolf/Klaus/ptc-T-dt-region-090112/Clewlow%201997%20log%20exp.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Optimal Delta-Hedging under&#xA;transaction costs&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.math.ethz.ch/~hmsoner/pdfs/38-Soner-FS-98.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Option pricing with transaction costs and a nonlinear Black-Scholes equation&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For a good overview I also suggest &lt;a href=&quot;https://stacks.stanford.edu/file/druid:qx719jf6675/Thesis-augmented.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;the following Phd-Thesis&lt;/a&gt; - e.g. check the Bibliography. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Some general remarks:&lt;/strong&gt;&#xA;A method must not be sophisticated to work well. There are different types of hedging approaches. Some traders might use algorithms other might trust their gut. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should also be aware that the hedge itself strongly depends on the type of product and on the assumptions you made on the model/market. A hedge of a plain vanilla call will differ depending on the model (e.g. B&amp;amp;S vs. Heston) An American option is hedged differently than a European one. The model assumptions on the other hand depend on the type of product you want to price/hedge. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also there is often a big gap between what is written in books and done in practice. The productive solutions are frequently a mixture of different approaches presented in different sources.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some quant stack exchange topics that you might find interesting/relevant:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/10422/pre-trade-evaluation-and-risk-assessment-of-option-trading-strategies-in-market&quot;&gt;Pre-trade evaluation and risk assessment of option trading&#xA;strategies (in market practice)&lt;/a&gt; &lt;em&gt;(this question does not&#xA;explicitly deal with delta hedging but is interesting/relevant from a&#xA;&quot;practical&quot; perspective)&lt;/em&gt; &lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/4599/when-does-delta-hedging-result-in-more-risk&quot;&gt;When does delta hedging result in more&#xA;risk?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="36178" LastEditDate="2018-10-15T19:21:07.860" LastActivityDate="2018-10-15T19:21:07.860" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="10626" PostTypeId="2" ParentId="10309" CreationDate="2014-03-19T21:14:29.080" Score="4" Body="&lt;p&gt;Iron condors/strangles/straddles (or any other option strategies) are affected by volatility, but are NOT pure volatility plays.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;All option strategies are affected by a myriad of factors besides volatility, including but not limited to: directional movement in the underlying (delta), rate in change of delta (gamma), time passing (theta), interest rates changes (rho), etc..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to take a pure directional bet on volatility, you can use volatility-related futures, such as the VIX futures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cboe.com/micro/vix/vixfuturesprices.aspx&quot; rel=&quot;nofollow&quot;&gt;CBOE VIX Futures&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Futures on VIX provide a pure play on implied volatility independent of the direction and level of stock prices. VIX futures may also provide an effective way to hedge equity returns and to diversify portfolios.&lt;/p&gt;&#xA;" OwnerUserId="6108" LastActivityDate="2014-03-19T21:14:29.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10627" PostTypeId="2" ParentId="10589" CreationDate="2014-03-19T21:26:29.333" Score="-1" Body="&lt;p&gt;*&#xA;For a given period t and a set of securities and cash denoted with index i which individually have returns r and weights w in a portfolio the portfolio return could be computed as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;R = \sum_i  w^s _i r^s _i + w_i^l r_i^l &#xA;$$&#xA;where the sups l and s mean short and and long respectively. Note that the weights need to sum up to unity&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\sum_i (w^s_i + w^l_i) =1 &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note that the weights of the shorts are negative&lt;/p&gt;&#xA;&#xA;&lt;p&gt;hope this helps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;*adding an example.&#xA;time = 0, sec1 = 0, sec2 = 0, margin cash = 0, available cash = 100.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;time = 1, sec1 = 80, sec2 = 0, margin cash = 0, available cash = 20.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;time = 2, sec1 = 80, sec2 = -40, margin cash = 60, available cash = 0. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;weights thus can be read as: sec1 = 80% sec2 = -40% margin cash = 60% sum= 100% &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This sort of normalization makes attribution with short positions possible, so it may help you as well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;*Source: 'Performance Attribution with Short Positions' Dr. Jose Menchero, The Journal of Performance Measurement&lt;/p&gt;&#xA;" OwnerUserId="5821" LastEditorUserId="5821" LastEditDate="2014-03-25T17:20:44.300" LastActivityDate="2014-03-25T17:20:44.300" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10628" PostTypeId="2" ParentId="9730" CreationDate="2014-03-19T21:39:53.503" Score="1" Body="&lt;p&gt;Neural networks are a supervised machine learning algorithm.   Unlike unsupervised machine learning, the key to supervised machine learning is the selection of input factors and explicit labeling of outputs.    &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Input factors have to be manually selected, such as your combination of technical / fundamental / statistical indicators. Outputs have to be explicitly labeled (buy / sell signals) based on your selected input factors.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, a super-simple example could be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;f1 = X day moving average crossing above Y day moving average&lt;/p&gt;&#xA;&#xA;&lt;p&gt;f2 = ADX above Z&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You would then create a training set using these factors and labeling your output:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;f1 = 0, f2 = 0 --&gt; hold&lt;/p&gt;&#xA;&#xA;&lt;p&gt;f1 = 1, f2 = 1 --&gt; buy&lt;/p&gt;&#xA;&#xA;&lt;p&gt;f1 = 1, f2 = 0 --&gt; buy&lt;/p&gt;&#xA;&#xA;&lt;p&gt;f1 = 1, f2 = 1 --&gt; sell&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then train your NN network against this training set.  Once the NN is trained, you should run the NN set on an out-of-sample test set to evaluate the performance of the NN.&lt;/p&gt;&#xA;" OwnerUserId="6108" LastActivityDate="2014-03-19T21:39:53.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10629" PostTypeId="2" ParentId="10624" CreationDate="2014-03-19T22:43:01.200" Score="4" Body="&lt;p&gt;Assuming recovery rate to be zero. The transition matrix is a table with three possible states for each group:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;         A        B        D&#xA;&#xA;    A   0.7      0.2      0.1&#xA;&#xA;    B   0.2      0.5      0.3&#xA;&#xA;    D   0.0      0.0      1.0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since the question is about a company that is rated B now you expect that there is a 50% probability that the company will stay in B for the next period and that there is a 30% change it will default and that there is a 20% change that it will upgrade to A. Furthermore you assume the whole transition matrix is valid for two more periods. So to derive the calculations for this question I recommend you construct an event tree for a company that is B now using the multiplication rule for the probabilities:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;                                              B&#xA;              0.2                            0.5                  0.3&#xA;               A                              B                    D&#xA;       0.14  0.04   0.02             0.1     0.25    0.15     0.0 0.0 0.3   &#xA;        A      B      D               A        B       D       A   B   D&#xA;      0.014  0.012  0.02            0.01     0.075   0.15             0.3&#xA;        D      D      D               D        D       D               D    &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see, there are three rows of number representing the probability of the rating for the three years you need to find the expected payments for, you can also call it the average cash flow, i.e. if you had e.g. 10000 of these bonds (each with a different company and their defaults are uncorrelated, a terrible representation of the real world non the less) you could expect these average payments multiplied with 10000. So the expected cash flow (average payment) of after the first year is: $c_1=0.7*\$5+0.3*\$0 = \$3.5$ i.e there is a 70% change you will receive \$5 and a 30% change you'll get nothing, on average you'll get \$3.5. For the second year you can see that 47% have defaulted on average up to that point so the cash flow becomes $c_2=(1-0.47)*\$5=\$2.65$. For the third year you receive the face value of the bond \$100 plus the coupon for the companies that haven't defaulted up to that point. (note that I don't show redundant calculations of the event tree for the 3rd year) so that the expected cash flow of the third year is: $c_3=(1-0.581)*(\$105) = \$43.995$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you have obtained the time value of the expected payments and then you need to find the present value and set that as the price of the bond now. Assuming you have a yield curve (e.g. the funding rate), then you can obtain discount factors $D_t$ for the $t=1,2,$ and $3$ year points so that the bond price is: $$P_{t=0}=D_1*c_1+D_2*c_2+D_3*c_3$$ Assuming that you would recover something from the defaulted companies means you would need to add some amount to the bond price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Back to your question on obtaining the default probabilities from matrix multiplication. The transition matrix is called A, not to be confused with the credit rating A. You can obtain the sum of the default probabilities for the second year by the matrix multiplication $AA$, it is located in row 2 column 3, i.e. the number 0.47 and in the same location is the number 0.581 for $(AA)A$ so you are absolutely right.&lt;/p&gt;&#xA;" OwnerUserId="7584" LastEditorUserId="7584" LastEditDate="2014-03-19T23:10:25.313" LastActivityDate="2014-03-19T23:10:25.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10631" PostTypeId="1" AcceptedAnswerId="10635" CreationDate="2014-03-20T00:03:50.397" Score="1" ViewCount="3675" Body="&lt;p&gt;Given call option price, what is the simplest formula to get the volatility value ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Test Data:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Stock price  : $60&#xA;Option strike: $65&#xA;Call option price: $1.766&#xA;Duration (in year) : 0.25   (equivalent to 63 trading days)&#xA;Interest rate: 0.25%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Result:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Volatility: 30%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am especially looking for a formula that can be programmed into C#.&lt;/p&gt;&#xA;" OwnerUserId="7586" LastActivityDate="2014-03-20T08:43:39.847" Title="Calculate volatility from call option price" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10632" PostTypeId="2" ParentId="74" CreationDate="2014-03-20T01:12:20.857" Score="2" Body="&lt;p&gt;There's nothing fundamentally different between options and cash instruments, so you really just need a backtesting platform that has good functionality for backtesting multiple instruments simultaneously with the same reference time frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm assuming that you're looking for something halfway between in terms of level of sophistication and cost required to upkeep. One such tool that comes to mind is &lt;a href=&quot;http://www.deltixlab.com/&quot; rel=&quot;nofollow&quot;&gt;Deltix&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2014-03-20T01:12:20.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10633" PostTypeId="1" AcceptedAnswerId="10638" CreationDate="2014-03-20T02:33:27.713" Score="6" ViewCount="8841" Body="&lt;p&gt;I'd like to calculate a probability distribution for prices given the option prices for that stock? Any ideas how to do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My desire is to do this daily and then see how the price PD changes over time and see if that can give any insight to the market's evolving view. I couldn't find any prior art on the later, any suggestions would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="2186" LastActivityDate="2014-03-20T07:33:48.657" Title="How do I calculate probability distribution of stock prices given option prices?" Tags="&lt;options&gt;&lt;probability&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10635" PostTypeId="2" ParentId="10631" CreationDate="2014-03-20T03:48:13.047" Score="4" Body="&lt;p&gt;Implied volatility cannot be calculated analytically with a closed formula.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, you have to approximate it numerically. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are multiple methods to compute IV on an option:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bi-section method&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Newton-Raphson method&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secant method&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A quick google search came up with the following code for C++ using bi-section and newton methods:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.garagebandhedgefund.com/formulas/12-black-scholes-implied-volatility/c#&quot; rel=&quot;nofollow&quot;&gt;Implied volatility calculations in C++&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6108" LastActivityDate="2014-03-20T03:48:13.047" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10636" PostTypeId="2" ParentId="74" CreationDate="2014-03-20T04:07:07.687" Score="3" Body="&lt;p&gt;Unlike backtesting stocks or futures, backtesting multi-legged option spreads does have its unique challenges.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way to backtest your options strategies is to download historical option data (&lt;a href=&quot;http://www.marketdataexpress.com/&quot; rel=&quot;nofollow&quot;&gt;Market Data Express&lt;/a&gt;) and use a technical analysis Excel plugin  (&lt;a href=&quot;http://ta-lib.org/&quot; rel=&quot;nofollow&quot;&gt;TA-Lib&lt;/a&gt;).   You can then create an Excel spreadsheet to automatically enter / adjust your spread trades as certain technical conditions are hit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A better way is to use an automated options backtesting software, such as (&lt;a href=&quot;http://www.optionstack.com/&quot; rel=&quot;nofollow&quot;&gt;OptionStack&lt;/a&gt;).  Using this tool, you can create rules to automatically enter and adjust your option spreads as market conditions change.  In fact, you can backtest years of complex option spreads (collars, condors, etc..) in seconds.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, this software is currently in beta and there appears to be a sign-up waiting list.&lt;/p&gt;&#xA;" OwnerUserId="6108" LastActivityDate="2014-03-20T04:07:07.687" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10637" PostTypeId="2" ParentId="10633" CreationDate="2014-03-20T04:14:00.273" Score="6" Body="&lt;p&gt;One approach is to take the entire option chain, and calculate the prices for adjacent butterflies along the chain.  The risk / reward of each of the butterflies represent the empirical probability that the market is pricing for the underlying to move between the strikes of the butterfly.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make sure it is a proper probability distribution, you will want to normalize these empirical probabilities so that the sum of the entire probabilities from all the butterflies equals 1.&lt;/p&gt;&#xA;" OwnerUserId="6108" LastActivityDate="2014-03-20T04:14:00.273" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10638" PostTypeId="2" ParentId="10633" CreationDate="2014-03-20T07:33:48.657" Score="7" Body="&lt;p&gt;you should have a look at &lt;strong&gt;implied probability densities&lt;/strong&gt;. They do exactly what you are asking - extracting the pricing density from option prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is done by differentiating the option price with respect to the call.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are two links. The first one explains the procedure the second one deals with where such densities can be applied&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/10507/implied-state-price-density-question-1-derivation-of-the-formula&quot;&gt;Implied state price density (Question 1 - derivation of the formula)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/10523/implied-probability-density-question-2-applications-and-interpretation&quot;&gt;Implied probability density (Question 2 - Applications and Interpretation)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2014-03-20T07:33:48.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10639" PostTypeId="2" ParentId="10631" CreationDate="2014-03-20T08:43:39.847" Score="1" Body="&lt;p&gt;&lt;strong&gt;Theory:&lt;/strong&gt; First of all you must decide which implied volatility you want. Probably you are looking for the Black and Scholes implied vol. (but one could also caclute Heston implied vols etc)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we are in a B&amp;amp;S setting one desires to retrieve the implied vol by solving the &lt;a href=&quot;http://de.wikipedia.org/wiki/Black-Scholes-Modell#Optionspreise_im_Black-Scholes-Modell&quot; rel=&quot;nofollow noreferrer&quot;&gt;B&amp;amp;S pricing equation&lt;/a&gt; for $\sigma$. Unfortunately there is no analytical solution and you will have to use a numerical root finder. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Delta hedge has already provided some frequently used algorithms. I will also mention &lt;a href=&quot;http://en.wikipedia.org/wiki/Brent%27s_method&quot; rel=&quot;nofollow noreferrer&quot;&gt;Brent's Method&lt;/a&gt; here. You will have to decide which one you like best. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general there are two main criteria you should consider&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;numerical stability &lt;/li&gt;&#xA;&lt;li&gt;speed &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(for more &lt;a href=&quot;https://stackoverflow.com/questions/8483522/comparing-root-finding-of-a-function-algorithms-in-python&quot;&gt;see here&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Implementation in C#&lt;/strong&gt; - for most algorithms you will find pseudocode online which can be easily translated into C# (see e.g. the one for &lt;a href=&quot;http://en.wikipedia.org/wiki/Newton%27s_method#Pseudocode&quot; rel=&quot;nofollow noreferrer&quot;&gt;Newton's Method&lt;/a&gt;). Every root finder can be coded up in C#. If you are in a hurry just google &quot;root finder c#&quot; and this will give you some already implemented methods.&lt;/p&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="-1" LastEditDate="2017-05-23T11:33:46.017" LastActivityDate="2014-03-20T08:43:39.847" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10642" PostTypeId="1" AcceptedAnswerId="10822" CreationDate="2014-03-20T12:20:08.073" Score="2" ViewCount="353" Body="&lt;p&gt;I am trying to bootstrap the Optionlet volatility surface from a Cap/Floor volatility surface using QuantLibXL. To be specific, the data is from ICAP:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    STK  ATM   0  0.25  0.5  [...]&#xA;1Y  0.31 77.95    81.9  71.8&#xA;18M 0.34 83.08    89.2  76.6&#xA;2Y  0.37 86.03    96.2  80.1&#xA;[...]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, I can set up without errors &lt;code&gt;qlCapFloorVolTermSurface&lt;/code&gt;, and &lt;code&gt;qlOptionletStripper1&lt;/code&gt;, but when I trigger the actual computation, e.g., with &lt;code&gt;qlOptionletStripper1CapFloorVolatilities&lt;/code&gt;, I get the error&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;qlOptionletStripper1CapFloorVolatilities - could not bootstrap optionlet&#xA;type: Put&#xA;strike: 25.000000 %&#xA;atm: 1.311340 %&#xA;price: 0.125286&#xA;annuity: 0.501145&#xA;expiry: March 22nd, 2017&#xA;error: root not bracketed f[0,24] -&amp;gt; [-1.3213e-002, -1]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I understand that the root searching algorithm cannot find a solution in  the specified range, but what can one do here &lt;em&gt;in practice?&lt;/em&gt; Have I missed something?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Additional info:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The optionlet stripper takes as argument an IborIndex, for which I am using an Euribor object with an &lt;code&gt;qlInterpolatedYieldCurve&lt;/code&gt; on a composite yield curve called &quot;(45) - Euro&quot; in Bloomberg.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Strangely, the ATM rate indicated in the output does not at all match what it should be, namely according to the optionletstripper1.cpp:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;atmOptionletRate_[i] = iborIndex_-&gt;fixing(optionletDates_[i]);&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The fixing at March 22nd, 2017 retrieved with qlYieldTSZeroRate, is 0.60310%, not 1.311340%. Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="1132" LastEditorUserId="1132" LastEditDate="2014-03-20T16:14:51.700" LastActivityDate="2014-04-04T13:27:04.780" Title="QuantLibXL - Optionlet bootstrapping failure" Tags="&lt;options&gt;&lt;quantlib&gt;&lt;bootstrapping&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10643" PostTypeId="2" ParentId="10612" CreationDate="2014-03-20T14:41:13.753" Score="1" Body="&lt;p&gt;you hypothesize that your data is generated by the following process: $y_t=\phi_0+\sum_{k=1}^P\phi_ky_{t-k}+\varepsilon_t$, where $\phi_k$ are your autocorrelation coefficients, and $\varepsilon_T$ - random errors. Next, you estimate your $\phi_t$ using one of the methods of estimation of autoregressive processes AR(P) of order P, e.g. see &lt;a href=&quot;http://en.wikipedia.org/wiki/Autoregressive_model&quot; rel=&quot;nofollow&quot;&gt;AR(P)&lt;/a&gt;, there's no point in doing manually, use statistical packages like Stata.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you have to choose order P, there are ways of doing it, such as trying many different Ps and comparing their &lt;a href=&quot;http://en.wikipedia.org/wiki/Akaike_information_criterion&quot; rel=&quot;nofollow&quot;&gt;AIC&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;next, you test your model for the unit root. in case of P=1, i.e. $y_t=\phi_0+\phi_1y_{t-1}+\varepsilon_t$, this is testing whether $\phi_1=1$. there are ways of testing this hypothesis too. if it's very close to 1 then you have a unit root.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;what does this mean? it means that your $y_t$ will drift away over time, it's non-stationary. it is not a deterministic trend like $y_t=\beta t$, where you know where and how fast it's going. on the other hand you know that $|E[y_\infty]|=\infty$. if you have no unit root then the process is stationary and in the long run your $y_\infty$ will not deviate too much from where it is now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;examples. interest rates are stationary, they don't have stochastic trends. in ancient Egypt  some 4-5 thousands years ago the interest rate on the unsecured personal loans were around 20% annual. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;asset prices are not stationary, they have drifts, possible both stochastic and deterministic. look at house prices 50 years ago and now, they grew maybe 10-folds if not more.&lt;/p&gt;&#xA;" OwnerUserId="7365" LastActivityDate="2014-03-20T14:41:13.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10644" PostTypeId="1" CreationDate="2014-03-20T14:56:07.237" Score="4" ViewCount="2406" Body="&lt;p&gt;I want to write a quantitative stock trading program based on fundamental analysis. It would crunch through prices, financial reports to look for value stocks. It can support backtesting of strategy with historical data to maximize annual return and sharpe ratio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All the studies, libraries or codes on quantitative trading that I can find are based on some form of technical analysis or arbitrage. Why isn't there any fundamental analysis trading algorithm? given that it is a cornerstone of investing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you know any example of such algorithm, please share with me.&lt;/p&gt;&#xA;" OwnerUserId="7591" LastEditorUserId="7591" LastEditDate="2014-03-21T03:09:31.580" LastActivityDate="2014-03-21T04:26:25.543" Title="How to incorporate fundamental analysis in quantitative trading algorithm?" Tags="&lt;equities&gt;&lt;quant-trading-strategies&gt;&lt;algorithmic-trading&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="2" ClosedDate="2014-03-21T17:59:12.873" ContentLicense="CC BY-SA 3.0" />
  <row Id="10645" PostTypeId="1" AcceptedAnswerId="10647" CreationDate="2014-03-20T16:14:35.467" Score="3" ViewCount="1500" Body="&lt;p&gt;I am working on a ratings transition matrix and I wondered how people scale it down to shorter time periods (although one should more or less stick to the estimation period i know).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is clear that one can scale it to a longer time period by repeatedly multiplying the matrix with itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would you scale the matrix down to a, say monthly, transition matrix?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found a result on &lt;em&gt;reversible&lt;/em&gt; Markov Chains and thought the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $M$ be the transition matrix of a reversible markov chain, then one can factor it into&#xA;$$ M = S D$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with a symmetric matrix $S$ and a diagonal matrix $D$. It appears that also the converse holds true.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if we had a &lt;em&gt;reversible&lt;/em&gt; markov chain, we could raise the matrix to a fraction by taking the eigenvalue decomposition of $S = E^{T}\Lambda E$ and raising $S$ as well as $D$ to the appropriate power.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So we define &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \bar{M}:= E^T \Lambda^{\frac{1}{n}}E D^{\frac{1}{n}}$$ and say that $\bar{M}$ is now $M^{\frac{1}{n}}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is: Is this way appropriate? Does it make any sense (from a mathematical viewpoint - I know that downscaling a transition matrix is debatable)? Are ratings transition matrices from a  &lt;em&gt;reversible&lt;/em&gt; markov chain? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main question is: What are the commonly used method to raise ratings transition matrices to a fraction? &lt;/p&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2014-03-22T07:37:38.827" Title="Scaling of a transition matrix" Tags="&lt;credit-ratings&gt;&lt;markov&gt;&lt;time-scale&gt;&lt;transition-matrix&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10646" PostTypeId="2" ParentId="4410" CreationDate="2014-03-20T17:01:59.050" Score="0" Body="&lt;p&gt;Cost-wise the following sources look promising. While not strictly finance related, you can filter the input news down to the categories applicable to your needs:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://datasift.com/&quot; rel=&quot;nofollow&quot;&gt;http://datasift.com/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.dataminr.com/&quot; rel=&quot;nofollow&quot;&gt;http://www.dataminr.com/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="3308" LastActivityDate="2014-03-20T17:01:59.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10647" PostTypeId="2" ParentId="10645" CreationDate="2014-03-20T18:24:03.347" Score="4" Body="&lt;p&gt;You are right, the rules to time-scale a T-years transition matrix $M_T$ are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$M_{k·T} = M_T^k$&lt;/li&gt;&#xA;&lt;li&gt;$M_{T/k} = \sqrt[k]{M_T}$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The root of a matrix M can be obtained using the spectral decomposition:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$M = P·D·P^{-1} \Longrightarrow M^k = P·D^k·P^{-1}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $P$ and $D$ are the eigenvectors and eigenvalue matrices of $M_T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: The Perron-Frobenius tells that transition matrix eigenvalues satisfies |λ|≤1. This allows negative and complex eigenvalues. The following R code shows a transition matrix with a negative eigenvalue:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M = matrix(ncol=3, nrow=3, 0)&#xA;M[1,1]=0.1; M[1,2]=0.8; M[1,3]=0.1&#xA;M[2,1]=0.8; M[2,2]=0.1; M[2,3]=0.1&#xA;M[3,1]=0.0; M[3,2]=0.0; M[3,3]=1.0&#xA;eigen(M)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: As indicated in &lt;em&gt;&lt;a href=&quot;http://www.researchgate.net/profile/Alexander_Kreinin/publication/215992315_Regularization_Algorithms_for_Transition_Matrices/file/d912f50d38c9e9ca02.pdf&quot; rel=&quot;nofollow&quot;&gt;Regularization Algorithms for Transition Matrices&lt;/a&gt;&lt;/em&gt;, the root of a transition matrix can be an invalid transition matrix or may not be unique. In this case, we must transform this matrix to the relevant Markov matrix. This process is called &lt;em&gt;regularization&lt;/em&gt;. In the referenced document there exist some algorithms to regularize a transition matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: I suspect that the transition matrices with a single absorbent state and strictly diagonal dominant has ​​real and positive eigenvalues, but I have no proof.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can obtain more info at &lt;a href=&quot;http://www.ccruncher.net/ccruncher.pdf&quot; rel=&quot;nofollow&quot;&gt;CCruncher technical document&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7438" LastEditorUserId="7438" LastEditDate="2014-03-22T07:37:38.827" LastActivityDate="2014-03-22T07:37:38.827" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10648" PostTypeId="2" ParentId="37" CreationDate="2014-03-20T19:21:29.000" Score="3" Body="&lt;p&gt;Try &lt;a href=&quot;http://www.activetick.com/activetick/contents/PersonalServicesDataAPIPricing.aspx&quot; rel=&quot;nofollow&quot;&gt;http://www.activetick.com/activetick/contents/PersonalServicesDataAPIPricing.aspx&lt;/a&gt;  this is very cheap 300 per month for unlimted symbols starts from $50 per month&lt;/p&gt;&#xA;" OwnerUserId="7597" LastActivityDate="2014-03-20T19:21:29.000" CommentCount="1" CommunityOwnedDate="2014-03-20T19:21:29.000" ContentLicense="CC BY-SA 3.0" />
  <row Id="10649" PostTypeId="2" ParentId="10644" CreationDate="2014-03-20T19:21:37.510" Score="2" Body="&lt;p&gt;Most of what you see on the web is done by amateurs.  Many professionals do use 10K and 10Q information in so-called &quot;quant&quot; strategies, but electronic stores of this information don't come free.  As a consequence, you don't see a lot on the web about using fundamentals in model-driven investment strategies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.capitaliq.com/home/what-we-offer/information-you-need/financials-valuation/compustat-financials.aspx&quot; rel=&quot;nofollow&quot;&gt;Compustat/CapitalIQ&lt;/a&gt; is the most well-known fundamental data source.  FactSet and Bloomberg clean and modify Compustat data before passing it on to their customers.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2014-03-20T19:21:37.510" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10650" PostTypeId="2" ParentId="10609" CreationDate="2014-03-20T19:41:39.340" Score="2" Body="&lt;p&gt;I see your porblem - Hull unfortunately does not explain the reasoning behind the approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The hint the books gives is correct. Using Taylor series $e^x$ can be written as $e^x = 1 + x + \frac{x^2}{2}+...$. Hull also incoporates a dividend rate $q$ but we can disregard it here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$p$ is given by $p=\frac{e^{r\Delta }-d}{u-d}$. We also have $u=\frac{1}{d}$. So to complete our setup wie primarily just need to find a propper $u$ that satisfies equation $(*)$&#xA;$$e^{r\Delta t}(u+d)-ud-e^{2r\Delta t} = \sigma^2\Delta t  $$&#xA;One can assume that $u$ will be some function of $\Delta t$ and thus write $u(\Delta t)$. Furthermore we do not need $u(\Delta t)$ to solve $(*)$ for huge $\Delta t$. If we assume that the function has some taylor approximation we can just work with the truncated taylors some for it will approximate $u(\Delta t)$ well enough for small $\Delta t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So we set $u(\Delta t) = e^{-\sigma\sqrt{\Delta t}}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now obviosly this choice does not satifsy equation $(*)$. Still we would  use the result if it's second order taylor approximation will do the job (thus fullfill the equation quite well for smaller $\Delta t$) - remember we can use a taylor expansion to approximate the function - this is the somewhat simplified statement of &lt;a href=&quot;http://en.wikipedia.org/w/index.php?title=Taylor%27s_theorem&amp;amp;action=edit&amp;amp;section=3&quot; rel=&quot;nofollow&quot;&gt;Taylor's Theorem&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second order Taylor Sum for $e^t$ is given by $e^t \approx 1+t+0.5t^2$. Inserting $\sigma \sqrt{\Delta t}$ for $t$ gives $e^{\sigma \sqrt{\Delta t}}\approx 1+\sigma \sqrt{\Delta t}+0.5\sigma^2 \Delta t$. And thus $u(\Delta t) \approx 1+\sigma \sqrt{\Delta t}+0.5\sigma^2 \Delta t$ and $d(\Delta t) \approx 1-\sigma \sqrt{\Delta t}+0.5\sigma^2 \Delta t$ for small enough $\Delta t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the same tecnique we approximate the $e^{r\Delta t},e^{2 r\Delta t}$ terms by their first order taylor sums and get $e^{r\Delta t}=1+r \Delta t$ and $e^{2 r\Delta t}=1+2r \Delta t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you substite the terms in equation $(*)$ by the approximations derived here and kill/ignore all the terms containing $(\Delta t)^2$ you will get the desired result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$(1+r\Delta t)(1+\sigma \sqrt{\Delta t}+0.5\sigma^2 \Delta t+1-\sigma \sqrt{\Delta t}+0.5\sigma^2 \Delta t)-(1+\sigma \sqrt{\Delta t}+0.5\sigma^2 \Delta t)(1-\sigma \sqrt{\Delta t}+0.5\sigma^2 \Delta t)-(1+2r\Delta t) = \sigma^2\Delta t  $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simplify (thus just carry out the multiplication) whenver you encounter a term containg $(\Delta t)^2$ (e.g. $\sigma^4(\Delta t)^2$) just set it to zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit on the background for the choice of $u$&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By using the relation $d=1/u$ one can simplify equation $(*)$ to&#xA;$$&#xA;u^2-\frac{1+e^{2r\Delta t}+\sigma^2\Delta t}{e^{r\Delta t}}u+1=0&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Setting $A=0.5\frac{1+e^{2r\Delta t}+\sigma^2\Delta t}{e^{r\Delta t}}=0.5(e^{-r\Delta t}+e^{r\Delta t}+\sigma^2\Delta t e^{r\Delta t})$ one arrives at the quadratic equation $u^2-2Au+1=0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solving this equation gives $u=A+\sqrt{A^2-1}, d=A-\sqrt{A^2-1}$ Now if one inserts the actual formula for $A$ into this equations, substitutes $e^{r \Delta t},e^{-r \Delta t}$ with $1+r \Delta t,1-r \Delta t$, simplifies and then neglects all the terms containing $(\Delta t)^2$ or higher one arrives at&#xA;$$&#xA;u=1+\sigma \sqrt{\Delta t}+0.5\sigma^2 \Delta t&#xA;$$&#xA;This is the second order Taylor approximation of $e^{ \sigma \sqrt{\Delta t}}$&lt;/p&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="7279" LastEditDate="2014-03-21T22:12:21.527" LastActivityDate="2014-03-21T22:12:21.527" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10652" PostTypeId="1" AcceptedAnswerId="10656" CreationDate="2014-03-21T04:06:24.170" Score="4" ViewCount="3731" Body="&lt;p&gt;How is the MA model useful in modeling financial data, for example the stock indices?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, from what i understand in the AR (auto-regressive) model portion, we can use the ADF test to check for the stationarity of the time series. If it is stationary, it is likely that the new trend will follow the old trend. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in the case of the MA model, when we suspect that there is a MA component, how do we make use of the knowledge to analyze and predict whether the market movement?&lt;/p&gt;&#xA;" OwnerUserId="6034" LastActivityDate="2014-03-23T01:49:40.030" Title="How is the MA (moving average model) useful?" Tags="&lt;time-series&gt;&lt;auto-correlation&gt;&lt;stationarity&gt;&lt;arma&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10653" PostTypeId="2" ParentId="10644" CreationDate="2014-03-21T04:26:25.543" Score="3" Body="&lt;p&gt;There are no &quot;fundamental algos&quot; analogous to &quot;technical algos&quot;. Instead, quantitative useof fundamental data assumes applying multifactor models to predicting returns and other intrument parameters. That models vary from &quot;academical&quot; (like Fama-French 3-factor or Chen, Roll, Ross) to proprietary models of guys from industry: MSCI Barra, Bloomberg, CSFB, Morgan Stanley, Salomon Smith Barney are in the &quot;open access&quot;, to some extent.&lt;/p&gt;&#xA;" OwnerUserId="6535" LastActivityDate="2014-03-21T04:26:25.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10654" PostTypeId="1" CreationDate="2014-03-21T13:42:11.300" Score="1" ViewCount="64" Body="&lt;p&gt;I would like to evaluate the performance of a portfolio mananger. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know his trades, and the initial portfolio holdings. I do not know, however the amount held on his cash account. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, I cannot know whether stocks are bought with cash from previous sales (by completely selling a stock bought before), or with new cash inflows. How could I measure the performance of his portfolio? I woud like to have a CAPM like approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks&lt;/p&gt;&#xA;" OwnerUserId="6486" LastEditorUserId="6486" LastEditDate="2014-03-21T14:18:57.840" LastActivityDate="2014-03-21T14:18:57.840" Title="evaluating portfolio performance without knowing the amount held on cash accounts" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;performance-evaluation&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10655" PostTypeId="2" ParentId="10546" CreationDate="2014-03-21T14:52:36.443" Score="1" Body="&lt;p&gt;If you have the optimization toolkit, you can download a free software package written by Kevin Sheppard of the Mann Quantitative Finance Institute at the Uni of Oxford.  He has all the tools you'll need.  Link below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally, there's no agreed upon methodology to do what you want to do.  You should start by plotting the auto-correlations of your time series and the partial auto-correlations and taking a look to see where the bulk of concentration is.  This should give you a starting point.  Since GARCH/ARCH/etc. are auto-regressive, the number of lags is not &lt;em&gt;super&lt;/em&gt; important. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then test up from 1/1 to whatever you deem necessary.  Compare BICs.  I wouldn't go with AIC simply because it doesn't punish noise from added lags enough.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.kevinsheppard.net/wiki/MFE_Toolbox&quot; rel=&quot;nofollow&quot;&gt;http://www.kevinsheppard.net/wiki/MFE_Toolbox&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7601" LastActivityDate="2014-03-21T14:52:36.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10656" PostTypeId="2" ParentId="10652" CreationDate="2014-03-21T16:04:02.530" Score="5" Body="&lt;p&gt;In terms of interpretation, an $MA$ model simply means that the time series is a function of the error from previous periods. You might find it informative to consider plotting simple $AR(1)$ models alongside various $ARMA(1,1)$ to develop a more intuitive understanding. For instance, the $AR(1)$ model (chosen as it is common for financial time series)&#xA;$$x_{t}=\beta x_{t-1}+\epsilon_{t}&#xA; $$&#xA;versus the $ARMA(1,1)$&#xA;$$y_{t}=\beta y_{t-1}+\theta\epsilon_{t-1}+\epsilon_{t}$$&#xA;for different values of $\theta$ but the same error for each (you may also consider adjusting the mean to ensure it is zero for all). The resulting time series can look very different depending on whether $\theta$ is near $1$ or $-1$. If $\theta$ is near 1, then $y_{t}$ will tend to exhibit some follow through compared to $x_{t}$. By contrast, if $\theta$ is near $-1$, then the series will look more stationary. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For prediction, you can basically just use the formula of whatever $MA$ model it is. Most statistical packages have this functionality built in as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, I don't fit a lot of MA models. The main reason is that it is possible to express an $MA(q)$ model as an $AR(\infty)$ model (and vice-versa for expressing $AR(p)$ models as $MA(\infty)$ models). Further, autoregressive models can be fit by least squares, while moving average models cannot (usually maximum likelihood). As a result, rather than spend a lot of time identifying the correct $ARMA(p, q)$ model, it is usually easier to just increase the number of lags in an $AR(p)$ until any moving average components have disappeared from the autocorrelation function (as in the Box-Jenkins methodology) or they're no longer significant or some other approach based on AIC/BIC as in auto.arima for R.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastEditorUserId="2379" LastEditDate="2014-03-23T01:49:40.030" LastActivityDate="2014-03-23T01:49:40.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10657" PostTypeId="2" ParentId="2402" CreationDate="2014-03-21T19:23:15.687" Score="1" Body="&lt;p&gt;BS is increasing with respect to volatility, and bounded from above, i.e. the call by $F$ and put by $K$, as volatility goes to infinity. So it can not be convex with respect to volatility.&lt;/p&gt;&#xA;" OwnerUserId="6686" LastEditorUserId="6686" LastEditDate="2014-03-21T20:18:13.790" LastActivityDate="2014-03-21T20:18:13.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10661" PostTypeId="1" CreationDate="2014-03-22T11:02:22.183" Score="0" ViewCount="108" Body="&lt;p&gt;P - price that the asset was purchased.&#xA;Q - price that it was sold&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P = Q/(1+r+B(R_m - r))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the financial meaning  of denominator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for help.&lt;/p&gt;&#xA;" OwnerUserId="7605" LastActivityDate="2014-03-22T12:40:04.123" Title="CAPM as pricing formula" Tags="&lt;capm&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10662" PostTypeId="2" ParentId="10661" CreationDate="2014-03-22T12:40:04.123" Score="4" Body="&lt;p&gt;The CAPM states that the expected return of an asset i is related to the expected market return by&#xA;$$\mathbb{E}[R_i] = r_f + \beta_i (\mathbb{E}[R_M] - r_f) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the CAPM is a correct description of risk and return, then the next period price&#xA;Q should be given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ Q = P (1+r_f + \beta_i (\mathbb{E}[R_M] - r_f)) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your formulation, the denominator is the factor by which the asset's price should apprecitate over the period of observation.&lt;/p&gt;&#xA;" OwnerUserId="7396" LastActivityDate="2014-03-22T12:40:04.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10663" PostTypeId="1" CreationDate="2014-03-22T13:03:41.953" Score="1" ViewCount="301" Body="&lt;p&gt;According to &lt;a href=&quot;http://en.wikipedia.org/wiki/It%C5%8D%27s_lemma&quot; rel=&quot;nofollow&quot;&gt;Ito's Lemma&lt;/a&gt; there is no restriction on the continuity of the stochastic process. The restrictions are on the continuity of the pay-off so that second derivatives with respect to underlying exists.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the list of financial instruments where their evolution (derivative) cannot be explained by Ito's Lemma? I have thought about barrier but the PV of those options are also continuous.&lt;/p&gt;&#xA;" OwnerUserId="1215" LastEditorUserId="1215" LastEditDate="2014-03-23T07:48:13.737" LastActivityDate="2014-05-26T21:47:16.550" Title="List of financial derivatives Ito's Lemma does not apply" Tags="&lt;stochastic-processes&gt;&lt;derivatives&gt;" AnswerCount="1" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="10664" PostTypeId="1" CreationDate="2014-03-22T13:20:27.083" Score="1" ViewCount="366" Body="&lt;p&gt;I know there are some sites for practicing equity investing. But could you provide me with suggestions concerning options trading etc. I read Natenbergs book on Options and want to test  things like delta and gamma hedging in real life, without risking money yet.&lt;/p&gt;&#xA;" OwnerUserId="7606" LastActivityDate="2014-03-22T13:20:27.083" Title="Mock/practice trading for options (delta/gamma hedging etc.)" Tags="&lt;options&gt;&lt;delta-hedging&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10665" PostTypeId="2" ParentId="10591" CreationDate="2014-03-22T13:49:59.863" Score="1" Body="&lt;p&gt;I got a solution to this problem by posting an excerpt of it at math.stackexchange: &#xA;&lt;a href=&quot;https://math.stackexchange.com/questions/716242/equation-involving-expectations-of-levy-processes&quot;&gt;https://math.stackexchange.com/questions/716242/equation-involving-expectations-of-levy-processes&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7555" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2014-03-22T13:49:59.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10666" PostTypeId="1" CreationDate="2014-03-22T15:04:46.370" Score="5" ViewCount="2454" Body="&lt;p&gt;Views on timeframes for backtesting vary considerably.  Curious on what timeframe/trade size leads to a statistically significant result.  For example, what backtest period is reasonable for a system that trades roundtrip once per day and results in ~250 trades per year?  Two years, five years, ten years?  Intuitively I struggle with problem because market character/direction also impacts a strategies performance which can span multiple years and so that would suggest the test should span multiple bull and bear markets among other things.  So trying to find a reasonable balance that is practical but also statistically significant. &lt;/p&gt;&#xA;" OwnerUserId="7608" LastActivityDate="2014-04-27T18:48:44.880" Title="Backtesting Period" Tags="&lt;backtesting&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10669" PostTypeId="1" CreationDate="2014-03-22T23:54:53.150" Score="4" ViewCount="6192" Body="&lt;p&gt;Quick question: is there a difference between credit VaR and VaR or are they the same thing?&lt;/p&gt;&#xA;" OwnerUserId="7583" LastEditorUserId="13462" LastEditDate="2017-04-14T13:10:10.940" LastActivityDate="2017-04-14T13:10:10.940" Title="Difference between VaR and credit VaR?" Tags="&lt;credit-risk&gt;&lt;value-at-risk&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10671" PostTypeId="1" CreationDate="2014-03-23T05:45:15.673" Score="3" ViewCount="8118" Body="&lt;p&gt;I recently have started to look at some data from CRSP, and they have a metric called Value Weighted Return (two versions with and without distributions).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I looked it up, it seemed that this metric was not used anywhere else, and the explanation on the site did not help (quoted below):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;VWRETD indices contain either the daily or monthly returns, including all distributions, on a value-weighted market portfolio (excluding American Depository Receipts (ADRs)).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How is this useful? What is the portfolio? If we don't know the portfolio, what makes this number meaningful?&lt;/p&gt;&#xA;" OwnerUserId="7613" LastActivityDate="2014-03-26T16:02:25.697" Title="Value Weighted Return" Tags="&lt;time-series&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10672" PostTypeId="1" CreationDate="2014-03-23T08:11:27.320" Score="4" ViewCount="5411" Body="&lt;p&gt;Can we interchangeably use Cholesky decomposition of covariance and correlation matrix to generate simulations? If not, in which situations do we use one or the other and why? &#xA;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="7239" LastEditorUserId="7279" LastEditDate="2014-03-23T13:56:39.180" LastActivityDate="2017-07-06T12:06:36.397" Title="Does one use the covariance or correlation matrix in cholesky decomposition to generate correlated samples" Tags="&lt;monte-carlo&gt;&lt;correlation-matrix&gt;&lt;value-at-risk&gt;&lt;covariance-matrix&gt;&lt;cholesky&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10673" PostTypeId="2" ParentId="10672" CreationDate="2014-03-23T13:05:59.060" Score="3" Body="&lt;p&gt;You can use the either, as both necessarily are symmetric positive definite; covariance is a personal preference. It's really just a matter of scaling, as $\mathcal{N}(0,\Sigma)$  is distributionally  $\sqrt{\Sigma} \mathcal{N}(0,1)  $.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Correlation would require additional scaling (i.e. multiplication of every $\mathcal{N}(0,\rho)$ element by its respective volatility, and therefore requires more operations).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.springer.com/mathematics/quantitative+finance/book/978-0-387-00451-8&quot; rel=&quot;nofollow&quot;&gt;Glasserman (p. 72-74)&lt;/a&gt; also uses the covariance matrix  for his introduction to Cholesky factorization, so I suspect it is not unusual, however I have also seen correlation (e.g. example of @Probilitator). &lt;/p&gt;&#xA;" OwnerUserId="7536" LastActivityDate="2014-03-23T13:05:59.060" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10674" PostTypeId="2" ParentId="10669" CreationDate="2014-03-23T14:04:50.477" Score="2" Body="&lt;p&gt;They are different metrics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I understand it: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Market risk VaR is a not a &lt;a href=&quot;http://en.wikipedia.org/wiki/Coherent_risk_measure&quot; rel=&quot;nofollow&quot;&gt;coherent risk&#xA;measure&lt;/a&gt;, because&#xA;it is not subadditive. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Market returns are generally considered on a shorter time horizon relative to&#xA;credit returns, which has implications for expected return drift (namely,&#xA;credit return drift is likely more substantial, as credit is longer&#xA;dated). &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Credit return distributions are also considerably more skewed.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Credit VaR effectively subtracts the expected portfolio value from a confidence cutoff value (often something like from 95 to 99.9 percentile). I.e. it is the value at the confidence cutoff less then expected value of the tail region for which it is the right bound. &lt;a href=&quot;http://www.wiley.com/WileyCDA/WileyTitle/productCd-0470481803.html&quot; rel=&quot;nofollow&quot;&gt;Malz has a bit more on credit risk VaR in Chapter 6.9.1 a&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Somewhat Related (and confusing, since a few resources I have seen have referred to CVaR as either credit and conditional VaR):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Conditional VaR (or expected shortfall) is $\frac{\int_{-\infty}^c f(x) x \, \mathrm{d}x}{\mathbb{P}\{x \le c\}}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $c$ denotes the value threshold that corresponds to the percentile of interest. It is coherent. &lt;/p&gt;&#xA;" OwnerUserId="7536" LastActivityDate="2014-03-23T14:04:50.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10675" PostTypeId="2" ParentId="9061" CreationDate="2014-03-23T15:15:29.150" Score="6" Body="&lt;p&gt;The issue with any extension method you may use is that it has influence on the coefficents post boundary one way or another. Traditional methods (zero padding, symetric, polynomial extrapolation etc) carry because of the circularity of the wavelet function incluence into the coefficients. You can attempt to use any of the extensions commented if the signal you are considering is symetrical or if the signal ends and start with 0 or if it is periodic, however be very carefull in considering the boundary coefficients if your signal is not of any cathegories mentioned as in forecasting the signal forward you may have no edge effect but you will carry an error when you extrapolate (extrapolated signal vs you dont know actual). So your edge coefficients will be as good as your forecast, in addition depending which one you use orthogonatily may be lost. Therefore if your interest is in obtaining non affected coefficient on the edges for prediction to my knowledge is not possible with orthogonal wavelets. To forecast on the edges you can use the following methods:   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A linear pass filter - This is using the redundant Haar wavelet replacing the symmetric low pass filter (B3 Spline filter) by a simple non symmetric filter. Then the scaling coefficients are calculated { ½ * (smoothed data t-1 -1(t)+smoothed data t-1 (t-2^j-1))} while the wavelet coefficients is obtained by calculating the difference between two successive smoothed versions (two neighboring resolution levels), effectively shifting the wavelet function on the time series data one point at a time, instead of 2j points at a time as with the normal DWT, where j denotes the current level of resolution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also use non boundary coefficients for prediction. However you will have to exclude a large number of coefficients at each side of the signal per level of resolution (more on the right than on the left due to the window used by the WT) and boundary coefficients increase the higher the level. So you are realistically left with the lowest resolution levels which have the lower number of boundary coefficients (However this is where most of the energy of the signal is contained).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can design an special ﬁlter to replace original ﬁlters at the signal borders (including the boundary elements). Such ﬁlters are adapted to interval boundaries and thus, do not require signal values outside the interval. However the function employed carries assumptions and can make the comparison of edge coeficients with rest of the transform function not straight forward or correct. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other considerations: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Is your signal continous or discrete (MRD is good for high frequency while discrete for less frequent evently spaced signals) &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Selection of length of the filter   &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How good is the frequency representation of the different wavelets.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Shift sensitivity, small shifts in the input signal can cause major variations in the distribution of energy between DWT coeﬃcients at diﬀerent scales. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I hope this helps&lt;/p&gt;&#xA;" OwnerUserId="7616" LastEditorUserId="7616" LastEditDate="2014-03-30T23:29:03.207" LastActivityDate="2014-03-30T23:29:03.207" CommentCount="1" CommunityOwnedDate="2014-03-26T10:02:17.337" ContentLicense="CC BY-SA 3.0" />
  <row Id="10679" PostTypeId="1" AcceptedAnswerId="10680" CreationDate="2014-03-23T19:42:25.330" Score="6" ViewCount="1159" Body="&lt;p&gt;Somehow I can't find the explicit definition of when two processes are supposed to be orthogonal or independent anywhere. I think orthogonality and independence should mean the same thing in this context.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Up to now I always assumed independence/orthogonality of two wiener processes meant $ dW_i(t) dW_j(t)  =  \delta_{ij} dt $&#xA;Or in a different notation $[W_i,W_j]_t=\delta_{ij}t$. &#xA;Unfortunately this is just a consequence of independence not the actual definition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Thus the questions:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;are independence and orthogonality equivalent for a stochastic process?&lt;/li&gt;&#xA;&lt;li&gt;what are the metric and the space used to define orthogonality of stochastic processes ?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="6901" LastEditDate="2014-03-23T21:56:59.543" LastActivityDate="2014-03-23T22:45:41.663" Title="Definition of orthogonality and independence for a stochastic processes" Tags="&lt;stochastic-processes&gt;&lt;probability&gt;&lt;theory&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10680" PostTypeId="2" ParentId="10679" CreationDate="2014-03-23T21:04:25.197" Score="5" Body="&lt;p&gt;Orthogonality and independence are different concepts.  The concepts are the same for Wiener processes because in the context of normal random variables, independence is equivalent to orthogonality (i.e. uncorrelatedness)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Independence is the standard definition for probability.  Let $\mathcal{F}, \mathcal{G}$ be the sigma algebras generated by two processes, $X_\cdot, Y_\cdot$.  Then $X$ and $Y$ are independent if $\mathcal{F}, \mathcal{G}$ are.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For orthogonality, the condition is actually only defined for things similar to continuous square-integrable martingales.  By similar, I mean that things can be extended to processes which are locally square integrable, locally martingales, have discontinuities, semimartingales.  But, for $X$ and $Y$ continuous square integrable martingales, then $X$ is orthogonal to $Y$ if $XY$ is a martingale. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A good reference for this topic is Protter's book.  Can look up the exact section if you're interested.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;edit&lt;/strong&gt;, in response to Probilitator's questions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Independence for random vectors: Let $\Omega, \mathcal{H}, \mu$ be a probability space, on which $(X_i)$ and $(Y_i)$ are all defined.  $X_i$ is a measurable map from $\Omega$ to $\mathbb{R}$, so it induces a subsigma algebra $\mathcal{F}_i \subset \mathcal{H}$.  You can then take $\mathcal{F}$ as the sigma algebra generated by the $\mathcal{F}_i$.  You can similarly get $\mathcal{G}$ from the $Y_i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also start from the point of view of a mapping into $\mathbb{R}^n$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As sigma algebras, $\mathcal{F} \perp \mathcal{G}$ if for any $A \in \mathcal{F}, B \in \mathcal{G}$, $\mu(A \cap B) = \mu(A) \cdot \mu(B)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next, for the statement about normal random variables, if $X,Y$ are jointly normal and uncorrelated, you calculate the function $f(s,t) = E \left[ \exp(sX + tY) \right]$.  You can evaluate this exactly using a bare hands Riemann integral of the normal density.  Then you show that $f$ can be factored into functions of $s$ and $t$, which is the equivalent characterization of independence.&lt;/p&gt;&#xA;" OwnerUserId="3415" LastEditorUserId="3415" LastEditDate="2014-03-23T22:45:41.663" LastActivityDate="2014-03-23T22:45:41.663" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="10681" PostTypeId="1" AcceptedAnswerId="10687" CreationDate="2014-03-23T22:55:44.497" Score="17" ViewCount="6548" Body="&lt;p&gt;A Geometric Brownian motion satisfying the SDE $dS_t = rS_t dt+\sigma S_t dW_t$ has the analytic solution&#xA;$$S_t = S_0\exp\left\{\left(r-\frac{\sigma^2}{2}\right)t\right\}\exp\{\sigma W_t\}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recently in an interview I was asked the following (I am paraphrasing):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The magnitude of uncertainty of the movement of $S_t$ is represented by $\sigma$ and is clearly captured in the term $\exp\{\sigma W_t\}$. But intuitively, why does $\sigma$ appear again in the term $r-\frac{\sigma^2}{2}$? That is, why are we deducting $\frac{\sigma^2}{2}$ from our drift $r$? What is the interpretation?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Does anybody know how to interpret it?&#xA;&lt;br&gt;&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;(I originally asked my question on MSE &lt;a href=&quot;https://math.stackexchange.com/questions/722368/geometric-brownian-motion-volatility-interpretation&quot;&gt;https://math.stackexchange.com/questions/722368/geometric-brownian-motion-volatility-interpretation&lt;/a&gt;, but it was suggested I seek proper help here)&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="6621" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2019-02-27T22:09:16.023" Title="Geometric Brownian motion - Volatility Interpretation (in the drift term)" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;" AnswerCount="8" CommentCount="0" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="10682" PostTypeId="2" ParentId="10681" CreationDate="2014-03-23T23:47:27.787" Score="2" Body="&lt;p&gt;$$S_t = S_0\exp((r-\frac{\sigma^2}{2})t+\sigma W_t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is not yet a martingale for it is not dirftless.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a probabilistic point of vew the &quot;drift adjustment&quot; comes into play so that the expected value of $S_t$ will be $e^{rt}$ rathern than $e^{(r+0.5\sigma^2)t}$. &#xA;For the expected value of a log-normaly distributed variable with mean $\mu$ and vol $\sigma$ equals $e^{(\mu+0.5\sigma^2)t}$(see &lt;a href=&quot;http://de.wikipedia.org/wiki/Logarithmische_Normalverteilung&quot; rel=&quot;nofollow&quot;&gt;the very detailed Wikipedia article&lt;/a&gt;) Thus by setting $\mu= (r-0.5\sigma^2)t$ we arrive at $E[S_t]=e^{rt}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now in most cases $r$ will denote the market risk free rate. Thus on average our stock will earn only that rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can interpret the $-0.5\sigma^2$ to be the volatility-dependent drift adjustment which insures the risk neutrality of the process. Thus if judging by average returns the ivnestor won't care whether he will be invested in the risk-free portfolio or into the market portfolio.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To pick up the comment  on MSE - the discounted expected payoff will then be $S_0$ and the discounted process $e^{-rt}S_t$ will be a martingale. This further supports that the thus created market setting is fair.&lt;/p&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="7279" LastEditDate="2014-03-24T00:15:11.740" LastActivityDate="2014-03-24T00:15:11.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10683" PostTypeId="2" ParentId="10681" CreationDate="2014-03-24T01:28:59.433" Score="12" Body="&lt;p&gt;The convexity of the exponential function of the stochastic variable $W$ makes its expectation greater than the exponentiation of the expectation of $W$. This is an example of Jensen's inequality, $E[e^{\sigma W}]&amp;gt; e^{\sigma E[W]}=1$. $\sigma$ can be interpreted as the magnitude of the convexity of the exponential function. This can be seen by Taylor expanding the $e^{\sigma W}$ around $W=0$ up to the quadratic term. The convexity thus produces a drift increasing with respect to $\sigma$. We know the drift should be $e^{rt}$. Therefore the factor in front should scale down the drift from the convexity measured by $\sigma$.&lt;/p&gt;&#xA;" OwnerUserId="6686" LastEditorUserId="6686" LastEditDate="2014-03-24T22:05:19.887" LastActivityDate="2014-03-24T22:05:19.887" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10685" PostTypeId="1" AcceptedAnswerId="10686" CreationDate="2014-03-24T12:44:34.720" Score="1" ViewCount="318" Body="&lt;p&gt;I am considering the option between using direct exchange connections vs using a vendor like Bloomberg for market data. I am interested in daily data and potentially tick by tickdata. Initially I am fine with delayed (tick data) but with the option to have realtime data in the future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other than not having to develop multiple connections to exchanges are there any other advantages of using a single provider for market data ? My concerns are things like the accuracy and the completeness of data. For eg will there be a lot of daily routine work involved in cleaning or correcting data with direct exchange data oppose to data vendors ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any advice would be much appreciated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&#xA;Vips&lt;/p&gt;&#xA;" OwnerUserId="7423" LastActivityDate="2014-03-24T14:09:48.703" Title="Direct exchange data via a Vendor" Tags="&lt;data&gt;&lt;historical-data&gt;&lt;exchange&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10686" PostTypeId="2" ParentId="10685" CreationDate="2014-03-24T13:55:25.770" Score="2" Body="&lt;p&gt;Yes definitely, the biggest challenge of using direct exchange feeds is the cost of maintenance. Here are a few issues to consider in your position: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Cost of maintenance&lt;/strong&gt;. This includes the time it takes to write a feed handler and keep it up-to-date against the exchange's feed API; the cost of colocation, and (often) higher licensing costs of receiving the feed directly at the co-lo facility. &lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;High availability and redundancy&lt;/strong&gt;. Blooomberg &lt;em&gt;very rarely&lt;/em&gt; goes down. It's not easy to achieve the same on your own without economies of scale.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Performance&lt;/strong&gt;. An average vendor's market data feed will generally complete the entire internal processing path in under 1 ms. This sounds easy to achieve using open source tools, but is rather remarkable because many pieces have to come together and most vendors would've spent a lot of resources tuning the performance of their feed handlers.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Other related problems that get unlocked&lt;/strong&gt;. Running a direct feed handler opens up a whole can of worms. How do you extract and maintain your symbol mapping? How do you receive that data in your office (presumably you're not working at, say, D.E. Shaw in their facility that's opposite Aurora) - do you have an IPsec-capable router that's facing WAN?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Based on your statement that you are &quot;interested in daily data and &lt;strong&gt;potentially tick by tickdata&lt;/strong&gt;...&quot;, I believe that you are better served by a market data vendor. You will not think of data provided by tickdata.com if your trading activities require a direct feed.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="4660" LastEditDate="2014-03-24T14:09:48.703" LastActivityDate="2014-03-24T14:09:48.703" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10687" PostTypeId="2" ParentId="10681" CreationDate="2014-03-24T15:00:44.423" Score="11" Body="&lt;p&gt;I will try to answer this a bit differently.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rigorous answer: because Ito calculus tells us that we need the second order term. Look at&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;S_t = S_0\exp(\mu t + \sigma B_t).&#xA;$$&lt;/span&gt; &#xA;Assume that &lt;span class=&quot;math-container&quot;&gt;$S_0$&lt;/span&gt; is known and fixed and look at &#xA;by Ito's formula&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;d(S_t/S_0) = \mu dt + \sigma B_t + \frac{\sigma^2}{2} dt.&#xA;$$&lt;/span&gt;&#xA;Then with some abuse of notation:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;E[d(S_t/S_0)] = \mu t + \frac{\sigma^2}{2} t,&#xA;$$&lt;/span&gt;&#xA;and we get the convexity term. So it is again the crucial story of Ito calculus: second order terms don't vanish (as in usual calculus) - they just stay. If you want to see this from the SDE then you have to use the Stratonovich formulation (see e.g. &lt;a href=&quot;http://www.pims.math.ca/files/monahan_2d.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The intuitive answer:&#xA;Just look at &lt;span class=&quot;math-container&quot;&gt;$E[\exp(\sigma W_t)]$&lt;/span&gt;. You can think of this as&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;\exp(\sigma W_t) \approx \exp(Z \sqrt{t} \sigma)&#xA;$$&lt;/span&gt;&#xA;where &lt;span class=&quot;math-container&quot;&gt;$Z$&lt;/span&gt; takes the values &lt;span class=&quot;math-container&quot;&gt;$\pm 1$&lt;/span&gt; with probability &lt;span class=&quot;math-container&quot;&gt;$1/2$&lt;/span&gt; (note that the noise gets &lt;span class=&quot;math-container&quot;&gt;$\sqrt t $&lt;/span&gt; whereas a drift term would get a &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt;).&#xA;Then the expectation is &#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;E[\exp(\sigma W_t)] \approx \frac12 (\exp(\sqrt{t} \sigma)+\exp(-\sqrt{t} \sigma)),&#xA;$$&lt;/span&gt;&#xA;using the Taylor series expansion this is &#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;\frac12 ((1+ \sqrt{t} \sigma + \frac{t \sigma^2}{2} + \text{terms of higher order}) + (1- \sqrt{t} \sigma + \frac{t \sigma^2}{2} + \text{terms of higher order}  )),&#xA;$$&lt;/span&gt;&#xA;and you see that the terms of order &lt;span class=&quot;math-container&quot;&gt;$\sqrt{t}$&lt;/span&gt; cancel out. You get something like&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;E[\exp(\sigma W_t)] \approx 1 + \frac{t \sigma^2}{2} + \text{terms of higher order} \approx \exp(\frac{t \sigma^2}{2}).&#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a last comment if you have &lt;span class=&quot;math-container&quot;&gt;$\exp(\sigma W_t)$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$W_t$&lt;/span&gt; is symmetric then the positive outcomes draw the expectation up, &lt;span class=&quot;math-container&quot;&gt;$\exp(\sqrt{t} \sigma)$&lt;/span&gt; is further away from &lt;span class=&quot;math-container&quot;&gt;$\exp(0)=1$&lt;/span&gt; than &lt;span class=&quot;math-container&quot;&gt;$\exp(-\sqrt{t} \sigma)$&lt;/span&gt; e.g. for &lt;span class=&quot;math-container&quot;&gt;$\sqrt{t} = 0.1$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$\sigma=0.2$&lt;/span&gt; you have&#xA;&lt;span class=&quot;math-container&quot;&gt;$ 1.020201$&lt;/span&gt; versus &lt;span class=&quot;math-container&quot;&gt;$0.9801987$&lt;/span&gt; - thus if it goes up it goes further up from &lt;span class=&quot;math-container&quot;&gt;$1$&lt;/span&gt; then if it goes down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The very short answer: because &lt;span class=&quot;math-container&quot;&gt;$W_t$&lt;/span&gt; is symmetric around &lt;span class=&quot;math-container&quot;&gt;$0$&lt;/span&gt; but &lt;span class=&quot;math-container&quot;&gt;$\exp(x)$&lt;/span&gt; is not symmetric around &lt;span class=&quot;math-container&quot;&gt;$1$&lt;/span&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2019-01-26T17:42:34.323" LastActivityDate="2019-01-26T17:42:34.323" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="10689" PostTypeId="1" AcceptedAnswerId="10802" CreationDate="2014-03-24T18:01:18.663" Score="13" ViewCount="9779" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;The Baye's rule for conditional expectations states&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$$ E^Q[X|\mathcal{F}]E^P[f|\mathcal{F}]=E^P[Xf|\mathcal{F}] $$&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;With $f=dQ/dP$ - thus being the Radon-Nikodyn derivative and $X$ being&#xA;  some random variable and $\mathcal{F}$ being some sigma-algebrad.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For I wasn't able to find the proof in any of the books that I usually use I tried to prove it myself. This rule is &lt;strong&gt;often used in the context of the change of numeraire technique&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The proof uses the definition/characterization of conditional expectations. Thus one mainly needs to show&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\int_A E^Q[X|\mathcal{F}]E^P[f|\mathcal{F}]dP=\int_AE^P[Xf|\mathcal{F}]dP $$ &#xA;For all $A\in\mathcal{F}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Again using the characterisation of conditional expectation the right side  equals $\int_A Xf dP$ and with $f$ being the Radon-Nikodyn-derivative this is equal to $\int_A X dQ$ thus&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\int_AE^P[Xf|\mathcal{F}]dP=\int_A X dQ $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other side using measurability of $E^Q[X|\mathcal{F}]$ with respect to $\mathcal{F}$ the left side equals&#xA;$$\int_A E^P\left[(E^Q[X|\mathcal{F}] f)\vert \mathcal{F}\right] dP$$&#xA;Once again using the characterisation of conditional expectation this is&#xA;$$\int_A E^P\left[(E^Q[X|\mathcal{F}] f)\vert \mathcal{F}\right] dP=\int_A fE^Q[X|\mathcal{F}]  dP$$&#xA;Finally with $f$ being the Radon-Nikodyn density one arrives at&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\int_A fE^Q[X|\mathcal{F}] =\int_A E^Q[X|\mathcal{F}] dQ=\int_A X dQ$$&#xA;and thus &#xA;$$\int_A E^Q[X|\mathcal{F}]E^P[f|\mathcal{F}]dP=\int_A X dQ$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This concludes the proof.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Two question:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;does anyone know of a source where I could cross-check that&lt;/li&gt;&#xA;&lt;li&gt;is there an alternative way to proof the result ?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-04-03T10:05:20.600" Title="Baye's rule for conditional expectations (Proof review)" Tags="&lt;probability&gt;&lt;numerairechange&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="10690" PostTypeId="1" CreationDate="2014-03-24T21:29:08.927" Score="5" ViewCount="121" Body="&lt;p&gt;When perturbing a key rate in order to assess sensitivity of portfolio value, what sort of interpolation is standard? A book I am looking at says linear, but this seems pretty unrealistic to me--and of real significance for longer durated portfolios or shorter term perturbations. Anyone familiar with literature on the matter? Thanks. &lt;/p&gt;&#xA;" OwnerUserId="7550" LastActivityDate="2016-07-04T10:54:49.487" Title="What type of interpolation should be used in key rate perturbation models?" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10691" PostTypeId="1" CreationDate="2014-03-24T21:32:42.600" Score="6" ViewCount="2791" Body="&lt;p&gt;Recently I've read some books about quantative approach to fundamental investing:&#xA;- What works on Wall Street - James O'Shaughnessy&#xA;- Quantitative Value - Wesley Gray, Tobias Carlisle&#xA;- Quantitative Strategies - Richard Tortoriello&#xA;Basically, their research methodology, can be summarized as, we have a set of indicators:&#xA;- value (E/P, EBIT/TEV, S/P, ...)&#xA;- momentum (RSI, ...)&#xA;- quality (Piotroski score,...)&#xA;- growth (PEG, ...)&#xA;We rank stocks and assign to deciles. We decide how often we rebalance portfolio (rather low frequency) and which strategy to apply. We calculate return,cagr, sharpe etc. for every decile/strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for free/open-source framework/library to reproduce similar research. I can't use yahoo data (non-yahoo stock exchange), so I need to load my own data. I consider to use python pandas for this, but maybe a better solution exists. Unfortunately, I've only found libraries for pair trading and technical analysis for single stock. &lt;/p&gt;&#xA;" OwnerUserId="7624" LastActivityDate="2014-12-10T21:39:01.670" Title="Backtesting with fundamentals" Tags="&lt;equities&gt;&lt;backtesting&gt;&lt;quantitative&gt;&lt;fundamentals&gt;&lt;momentum&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10697" PostTypeId="1" CreationDate="2014-03-25T10:40:22.430" Score="2" ViewCount="133" Body="&lt;p&gt;Assume that a trader trades in several stocks with different volatilities. The return of the trader's portfolio would be the weighted average of returns and the risk would be a function of the the underlying assets' volatilities and correlation as stated by the Modern Portfolio Theory. Assume also that the total wealth of the trader is also recorded daily and can thus be regarded as an &quot;index&quot;. Would the volatility of this &quot;index&quot; given by the standard deviation of the changes in the trader's wealth &#xA;$$&#xA;Var(W)= \frac{\sum_i^n(W_i - \bar{W})^2}{n}&#xA;$$&#xA;be the same as the volatility of the underlying assets given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;Var(W)=\sum_iπ_iVar(P_i)+\sum_i \sum_j,j≠iπ_iπ_jCov(P_i,P_j)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that it would be different if the index is traded such as closed-ended mutual funds. But what if the index is not traded and is simply a reflection of the underlying profits/losses?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="5190" LastEditorUserId="5190" LastEditDate="2014-03-26T17:00:27.003" LastActivityDate="2014-03-26T17:00:27.003" Title="Is the volatility of a trader's wealth equal to the volatility of the underlying assets traded?" Tags="&lt;volatility&gt;&lt;risk&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio&gt;&lt;theory&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10698" PostTypeId="2" ParentId="9993" CreationDate="2014-03-25T10:46:36.697" Score="2" Body="&lt;p&gt;This has to do with Fiscal Year End. In your particular case for CIK = 826083, which is Dell Inc, Fiscal Year End is 0129, which means January 29th.&#xA;D2012Q3 means is is in FY = 2012, End of the year is 012912, because it's the report for Q3, you count 3 months behind and the end of Q3 is 102811.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Same for the second example you gave, as it is the same company.&#xA;D2011Q4YTD means FY = 2011 so ends 012811 which is the one stated in the XBRL extract that you gave us.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. You should check www.finviews.com, we have already done all the work. We can provide all the XBRL reports directly into Excel, and when a company files its reports (10Q, 10K) with the SEC, it takes us less than 2 minutes to have all the data in Excel as the company published, so you can do your financial modelling afterwards.&lt;/p&gt;&#xA;" OwnerUserId="7629" LastActivityDate="2014-03-25T10:46:36.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10699" PostTypeId="2" ParentId="10376" CreationDate="2014-03-25T10:58:38.287" Score="0" Body="&lt;p&gt;You are looking at the wrong place.&#xA;For your particular example, check this link: &lt;a href=&quot;http://www.sec.gov/Archives/edgar/data/1112412/000119312513028328/0001193125-13-028328-index.htm&quot; rel=&quot;nofollow&quot;&gt;http://www.sec.gov/Archives/edgar/data/1112412/000119312513028328/0001193125-13-028328-index.htm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see that the link that you gave us is the complete submission text file, which is not XBRL. The XBRL files are the 6 files at the bottom of the link I gave you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively you should check the bottom of this link:&#xA;&lt;a href=&quot;http://www.sec.gov/Archives/edgar/data/1112412/000119312513028328/&quot; rel=&quot;nofollow&quot;&gt;http://www.sec.gov/Archives/edgar/data/1112412/000119312513028328/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. You should check www.finviews.com, we have already done all the work. We can provide all the XBRL reports directly into Excel, and as soon as a company files its reports (10Q, 10K etc..) with the SEC, it takes us less than 2 minutes to have all the data (main statements to start with) in Excel as the company published, so you can do your financial modelling afterwards.&lt;/p&gt;&#xA;" OwnerUserId="7629" LastEditorUserId="7629" LastEditDate="2014-03-25T20:32:46.803" LastActivityDate="2014-03-25T20:32:46.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10700" PostTypeId="2" ParentId="10697" CreationDate="2014-03-25T12:22:03.000" Score="1" Body="&lt;p&gt;Sure, the variance of the total wealth can be expressed in terms of the variances and covariances of the prices of the assets. If &#xA;$$ W = \sum_{i} \pi_i P_i $$&#xA;where $\pi_i$ is the total dollar amount invested in asset $i$ with price $P_i$. The variance of total wealth is then&#xA;$$ Var(W) = \sum_i \pi_i Var(P_i) + \sum_i \sum_{j, j\neq i} \pi_i \pi_j Cov(P_i, P_j) $$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also express the variance of final wealth in terms of the variance of the returns of the assets in the portfolio. If $W$ is the final wealth and $W_0$ is the initial wealth, then&#xA;$$ W = R_P W_0$$&#xA;where $R_P = 1 + r_P$ is the gross return of the portfolio and $r_P$ the rate of return. If $w_i$ is the portfolio weight of asset $i$, then&#xA;$$ r_P = \sum_i w_i r_i $$&#xA;and&#xA;$$ Var(r_P) = \sum_i w_i Var(r_i) + \sum_i \sum_{j,j\neq i} w_i w_j Cov(r_i, r_j). $$&#xA;Since $Var(R_P) = Var(1+r_p) = Var(r_p)$, you can use this to calculate the variance of $W$:&#xA;$$ Var(W) = W_0^2 \left( \sum_i w_i Var(r_i) + \sum_i \sum_{j,j\neq i} w_i w_j Cov(r_i, r_j) \right).$$&lt;/p&gt;&#xA;" OwnerUserId="7396" LastEditorUserId="7396" LastEditDate="2014-03-26T11:46:23.373" LastActivityDate="2014-03-26T11:46:23.373" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10703" PostTypeId="1" AcceptedAnswerId="10708" CreationDate="2014-03-25T18:28:01.963" Score="1" ViewCount="994" Body="&lt;p&gt;My understanding is that forward rates are calculated by comparing interbank interest rates of the 2 currencies for a currency pair, with the points being the difference between spot and the forward rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that's the case, then forward points would update quite often (with fluctuations in the spot rate), but within bank platforms, they're fairly static. Do they create static forward points for the day?&lt;/p&gt;&#xA;" OwnerUserId="5412" LastActivityDate="2014-03-27T15:00:52.907" Title="How often do banks update forward points?" Tags="&lt;fx&gt;&lt;forward&gt;&lt;interest&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10706" PostTypeId="1" AcceptedAnswerId="10707" CreationDate="2014-03-26T08:23:52.807" Score="1" ViewCount="250" Body="&lt;p&gt;There is a plethora of pseudo-random-generators out there. Some of them are definetly better and some of them severily underperform.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My standard tool is &lt;a href=&quot;http://en.wikipedia.org/wiki/Mersenne_twister&quot; rel=&quot;nofollow&quot;&gt;Mersenne Twister&lt;/a&gt; - when I need to generate some decent pseudo randoms. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still I never actually explicitly tested how the random-generator-choice affects the prices of derivatives.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Are there any papers on this topic out there ?  &lt;/li&gt;&#xA;&lt;li&gt;Does a &quot;gold-standard&quot; exist ? &lt;em&gt;(a standard generator that is very widespread&#xA;in quant circles)&lt;/em&gt; &lt;/li&gt;&#xA;&lt;li&gt;What are your personal experiences with the effects&#xA;of generator-choice?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-03-26T14:04:56.357" Title="Effects of random-generator-choice on derivative's price" Tags="&lt;option-pricing&gt;&lt;probability&gt;&lt;random-variables&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10707" PostTypeId="2" ParentId="10706" CreationDate="2014-03-26T10:44:14.547" Score="3" Body="&lt;p&gt;Mersenne Twister is currently the most used PRNG in the quant world. It was even incorporated in C++11 so it can be considered standard nowadays. Any PRNG with reasonable statistical quality shall perform well (equivalently) for pricing, so that differences relate more to convenience (speed, parallelizability etc..). If the statistical quality is poor then you shall avoid a PRNG in general, not just for pricing (so I won't point to comparison papers). However quality needed for pricing is lower than e.g. for cryptography (in that respect you could use e.g. AES as a slower reference to be sure your PRNG does not hide nasty surprises; conversely you couldn't use MT for crypto). I tend to use WELL because it's statitically better than MT, yet still fast enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for statistical quality, one usually wants a PRNG to pass the DieHard and DieHarder test suites, that's usually more than enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quasi MC is a more complex topic altogether where all you need is uniform distribution of the samples, not randomness. The analysis is totally different and somewhat more involved.&lt;/p&gt;&#xA;" OwnerUserId="3015" LastEditorUserId="3015" LastEditDate="2014-03-26T14:04:56.357" LastActivityDate="2014-03-26T14:04:56.357" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10708" PostTypeId="2" ParentId="10703" CreationDate="2014-03-26T13:01:21.197" Score="1" Body="&lt;p&gt;Forward points are calculated by the short term interest rate desks (STIR) and, because central banks and governments don't often change their money market base rates, the fluctuations set by the interest rate markets are infrequent. The interest rates depend on the money markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Forex all-in rates are calculated depending on the interest rate premium, or discount, between the two currencies at the time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The equation is &lt;code&gt;spot +/- forward pips = all-in&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The volatility is mainly due to spot, because that depends on, well, a different risk profile than future interest rates.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2014-03-26T13:01:21.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10710" PostTypeId="2" ParentId="7174" CreationDate="2014-03-26T14:43:14.300" Score="1" Body="&lt;p&gt;ArturoP, as John said, instead of minimizing EV/EBIT, you could as well maximize the inverse ratio EBIT/EV, thus eliminating the division by 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could think of the ratio (e.g. EBIT/EV) as a utility function, i.e. how well you evaluate a company based on the 2 variables, such as U(EBIT,EV) = EBIT/EV.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll notice that the ratio above works well when EBIT &gt;= 0. But it is less intuitive when EBIT &amp;lt; 0, since presumably expansive non-profitable companies are the worst case. A workaround for that could be splitting your domain into 2, and define a negative utility as the example below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA; W \sim U(EBIT,EV) = \begin{cases}&#xA; \frac{EBIT}{EV}, &amp;amp; \text{ if } EBIT &amp;gt;= 0\\ &#xA; EBIT.EV, &amp;amp; \text{ if } EBIT &amp;lt; 0 &#xA; \end{cases}&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So that your allocation weights W are somehow proportional to your utility.&lt;/p&gt;&#xA;" OwnerUserId="1519" LastActivityDate="2014-03-26T14:43:14.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10711" PostTypeId="2" ParentId="10671" CreationDate="2014-03-26T16:02:25.697" Score="1" Body="&lt;p&gt;your question is related to the concept of the market portfolio in &lt;a href=&quot;http://en.wikipedia.org/wiki/Capital_asset_pricing_model&quot; rel=&quot;nofollow&quot;&gt;CAPM&lt;/a&gt; and similar approaches in asset pricing. in theory this market portfolio includes all assets imaginable, not only stocks but everything from land to resources on Earth. in practice, it is represented by proxies, i.e. the substitutes, which are usually the traded securities. it's actually even more restricted to something like S&amp;amp;P 500 stocks, i.e. 500 largest equities. once you figure out which stocks you include, it's easy to compute the value-weighted return on them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the usefulness of these indices in their relation to asset pricing theory, such as CAPM or &lt;a href=&quot;http://en.wikipedia.org/wiki/Arbitrage_pricing_theory&quot; rel=&quot;nofollow&quot;&gt;APT&lt;/a&gt;. you can test various hypotheses based on these theories. you can also form portfolios based on correlations to the market portfolios (actually, their proxies)&lt;/p&gt;&#xA;" OwnerUserId="7365" LastActivityDate="2014-03-26T16:02:25.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10712" PostTypeId="1" CreationDate="2014-03-26T17:50:41.980" Score="8" ViewCount="610" Body="&lt;p&gt;Or simply: &lt;em&gt;why do we call equivalent martingale measures as risk-neutral measures&lt;/em&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the utility or game theory, when we consider a person's preferences to certain outcomes, we often deal with the utility functions. For example, if we consider an investor with a utility function $U$ whose return on a portfolio $\Pi$ is $x_\Pi$, we assume that he choose a portfolio that maximizes his expected utility&#xA;$$&#xA;  \Pi^* \quad\text{ such that }\quad\mathsf E U(x_{\Pi^*}) = \sup_{\Pi}\mathsf E U(x_\Pi).&#xA;$$&#xA;In particular, we say that an investor is risk-averse (risk-seeking) whenever $U$ is concave (convex). We say that an investor is risk-neutral when $U(x) = ax + b$ is an affine function. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The risk-neutral valuation - taking expectations w.r.t. martingale measures equivalent to the real-world ones - is used in quant finance a lot for the pricing purposes. I do understand the theory behind this method, and the relation with non-arbitrage arguments. I wonder though, whether there is any relation with the risk-neutrality as in the paragraph above.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I thought of the following idea: let us think of a fair price for a contract (when we write it) as the highest one at which the agent will buy it. The agent $A$ with utility $U_A$ and expectation of prices $\mathsf E_A$ has to make a choice between the zero utility (when he does not buy contract) and&#xA;$$&#xA;  \mathsf E_AU_A(\mathrm e^{-rT}C_T - C_0)&#xA;$$&#xA;where $T$ is maturity of the contract, $r$ is a rate used to compute present value of future cashflow, $C_T$ is the payoff of the contract, $C_0$ is the price of the contract. Hence, we need to solve the equation&#xA;$$&#xA;  \mathsf E_AU_A(\mathrm e^{-rT}C_T - C_0) = 0&#xA;$$&#xA;with unknown $C_0$. Assuming that agent is risk-neutral, we obtain&#xA;$$&#xA;  C_0 = \mathrm e^{-rT}\cdot\mathsf E_A(C_T).&#xA;$$&#xA;At the same time, pricing using the $\Delta$-hedging in the Black \&amp;amp; Scholes framework gives us&#xA;$$&#xA;  C_0 = \mathrm e^{-rT}\cdot\mathsf E_Q(C_T)&#xA;$$&#xA;where $Q$ is a risk-neutral measure. Hence, if we assume that our agent is risk neutral, then his expectations (at least at any given time $T$) have to be given exactly by the measure $Q$.&lt;/p&gt;&#xA;" OwnerUserId="464" LastEditorUserId="2587" LastEditDate="2014-03-27T10:20:45.843" LastActivityDate="2014-03-27T10:20:45.843" Title="Does risk-neutral measure have anything to deal with risk-neutrality in utility theory?" Tags="&lt;option-pricing&gt;&lt;risk-neutral-measure&gt;&lt;utility-theory&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10713" PostTypeId="2" ParentId="10666" CreationDate="2014-03-26T17:51:02.113" Score="3" Body="&lt;p&gt;What you are asking is more of an opinion. In fact there is no right or wrong answer perhaps.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The caution with using statistics with real world backtests is that if anything looks good on one parameter, e.g. Sharpe ratio, it will look good on t-stat, p-value and pretty much everything else. The primary reason for backtest is to check if there are periods in the history when the backtests showed poor results in spite of an overall good performance. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The answer perhaps depends on the average holding period of your positions. If your trading strategy's average holding period is 2 months to say 6 months, even if the strategy re-balances (or trades) daily or weekly, it is better to use a long time, preferably 15 years. Definitely include two bear and two bull markets. A long term frame will highlight weaknesses in your models. If you are trading short term strategies that turnover within a 1 week or less, around 7-8 years may suffice. For intra-day or other high frequency strategies, which is probably your case, 3-5 years will do. More than 5 years may actually be incorrect for high frequency strategies as the market microstructure might have changed. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;To distinguish backtested strategies that work out of sample versus those that won't, a better thing could be to concentrate on segments of your universe, i.e. will the same strategy work well (albeit with weaker attractiveness) if you take out parts of your universe (e.g. does it work well on large cap stocks OR does it only work well on small cap stocks, etc.).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Lastly, it's very easy to find strategies that worked well for 20 years and just when you start to trade it, it no longer works (in-sample bias). Backtested strategies that tend to work out of sample, in practice, also have an clear edge that you can define. Ask yourself what is the asymmetry in your strategy. Does your strategy makes sense! Example, take a hypothetical rule like &quot;multiply price by 2.3, add 5 and subtract sqrt of volume&quot; - even if this backtested well, there is no reason for it to work. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5948" LastActivityDate="2014-03-26T17:51:02.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10714" PostTypeId="2" ParentId="10595" CreationDate="2014-03-26T18:02:54.107" Score="1" Body="&lt;p&gt;Are you working with futures data (mixing rate futures with equity futures) OR allocating between macro instruments?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so, using non-linear variants of GARCH (GJR-GARCH, TGARCH etc.) are common way to solve your risk parity allocation issue that you might be facing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One common related issue is not that the volatility to a couple of instruments drop down significantly per se as much as that the volatility of those instruments which saw a drop in volatility happened to pick up very rapid and the portfolio was unable to response to fast increase in volatility of such instruments. The non-linear variants of GARCH can resolve this too as they can pick up very fast increases or decreases in volatility than regular GARCH or EWMA volatility. &lt;/p&gt;&#xA;" OwnerUserId="5948" LastActivityDate="2014-03-26T18:02:54.107" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10716" PostTypeId="1" CreationDate="2014-03-26T20:36:27.163" Score="3" ViewCount="188" Body="&lt;p&gt;Doing some research modeling/estimating volatility in the bitcoin market. There is quite a bit of scope for arbitrage within crypto-currency markets. Wonder if this has any impact on my volatility estimates? does it impact statistical significance or out of sample estimation accuracy?  &lt;/p&gt;&#xA;" OwnerUserId="7640" LastEditorUserId="7279" LastEditDate="2014-03-27T10:33:53.363" LastActivityDate="2014-03-28T11:08:48.840" Title="What impact does arbitrage have on realised volatility estimates?" Tags="&lt;volatility&gt;&lt;time-series&gt;&lt;high-frequency&gt;&lt;garch&gt;&lt;martingale&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10718" PostTypeId="2" ParentId="9562" CreationDate="2014-03-26T21:50:01.927" Score="11" Body="&lt;p&gt;A stochastic volatility model for a single risky asset can't be complete because you have two sources of randomness. But you can easily make it complete by adding a derivative whose value depends on the volatility. For example, if you add a variance swap in the Heston model then it becomes complete. This allows you to calibrate the model.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But your question is even more relevent when considering models with jumps (like discontinuous Levy process) because jumps are a &quot;sum&quot; of Poisson processes so each size of jump adds another source of randomness. You would need to add an infinite number of derivatives to make the market complete which is absurd. From the point of view of probability changes this is because you can find equivalent probabilities that change the drift but also the distribution of the jumps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The originial approach by Merton is to consider that you don't want the distribution of jumps to change so there is a unique risk neutral probability doing that. The probability change is the same as in the Black-Scholes model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other approaches use utility functions but now you are just asking yourself which utility function to use. This seems worse since you step away from the no arbitrage philosophy based on assumptions on markets and go back to modelling people's aversion to risk as if people were rational optimizing machines.   &lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2014-03-26T21:50:01.927" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10719" PostTypeId="2" ParentId="10712" CreationDate="2014-03-26T23:41:12.860" Score="6" Body="&lt;p&gt;An agent with utility function $U$ values a final position $X_T$ by $E\left[U(X_T)\right]$.  You can think of this as a function mapping random variables to $\mathbb{R}$, $X_T \mapsto E \left[U(X_T)\right]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A risk-neutral mapping should be a linear mapping of the kind above.  In other words, $f$ should map some space of random variables to $\mathbb{R}$, and satisfy $$a \cdot f(X_T) + b \cdot f(Y_T) = f(a \cdot X_T + b \cdot Y_T)$$ for scalar $a,b$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using a martingale measure, the valuation rule is $X_T \mapsto E \left[ \frac{dQ}{dP} X_T \right]$.  Note that this is a linear map.  Therefore, it's like a risk-neutral agent is pricing the positions.&lt;/p&gt;&#xA;" OwnerUserId="3415" LastEditorUserId="3415" LastEditDate="2014-03-27T07:08:00.503" LastActivityDate="2014-03-27T07:08:00.503" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10721" PostTypeId="2" ParentId="9562" CreationDate="2014-03-27T10:33:03.103" Score="6" Body="&lt;p&gt;There are several ways to choose a particular EMM. I believe that the most popular approach is to use a &quot;distance&quot; between $\mathbb{P}$ and $\mathbb{Q}$. Most papers use a minimal entropy approach(for example, &lt;a href=&quot;http://link.springer.com/article/10.1007/s007800200097&quot; rel=&quot;noreferrer&quot;&gt;Fujiwara and Miyahara&lt;/a&gt;, &lt;a href=&quot;http://www.math.ethz.ch/~mschweiz/Files/FEMS_final.pdf&quot; rel=&quot;noreferrer&quot;&gt;Esche and Schweizer&lt;/a&gt;, or &lt;a href=&quot;http://www.tandfonline.com/doi/abs/10.1080/14697680600573099#.UzP-O_l5N5o&quot; rel=&quot;noreferrer&quot;&gt;Hubalek and Sgarra&lt;/a&gt;) or a relative q-entropy approach (for example, &lt;a href=&quot;http://arxiv.org/pdf/0710.5594.pdf&quot; rel=&quot;noreferrer&quot;&gt;Jeanblanc, Klöppel, &amp;amp; Miyahara&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In applications, the Escher transform is also used very frequently to establish a relationship between $\mathbb{P}$ and $\mathbb{Q}$. The transform is sort of an exponential tilting of the probability measure.&lt;/p&gt;&#xA;" OwnerUserId="7396" LastActivityDate="2014-03-27T10:33:03.103" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10722" PostTypeId="1" CreationDate="2014-03-27T11:05:50.617" Score="1" ViewCount="595" Body="&lt;p&gt;Say I know the price probability distribution, e.g., &lt;code&gt;lognormal(p,s)&lt;/code&gt;, of a stock &lt;code&gt;X&lt;/code&gt; at a future time &lt;code&gt;T&lt;/code&gt; that is perhaps one or two years into the future. &lt;code&gt;p&lt;/code&gt; is price and &lt;code&gt;s&lt;/code&gt; is a standard deviation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What should I trade to maximize my expected total return at time &lt;code&gt;T&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should I for example roll over short-term stock options, long-term stock options, buy the stock using some amount of leverage, etc?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some way or tool that calculates this automatically?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I need to change this problem or my thinking so that the solution is not to simply use infinite amounts of leverage?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;--&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am assuming I have some positive amount of capital C to invest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Available instruments are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Long and short stocks&lt;/li&gt;&#xA;&lt;li&gt;Long and short call and put options&lt;/li&gt;&#xA;&lt;li&gt;Stock futures and swaps&lt;/li&gt;&#xA;&lt;li&gt;T-Bills, notes and bonds&lt;/li&gt;&#xA;&lt;li&gt;(If it makes things easier we can ignore warrants and convertibles)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2394" LastEditorUserId="2394" LastEditDate="2014-03-28T17:26:06.350" LastActivityDate="2014-07-16T04:46:53.583" Title="Given future price probability distribution, what is a strategy that maximizes return?" Tags="&lt;quant-trading-strategies&gt;&lt;option-strategies&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10723" PostTypeId="2" ParentId="10703" CreationDate="2014-03-27T11:21:00.650" Score="0" Body="&lt;p&gt;What platforms are you looking at (and at what time of day)? FX Forwards are not static, certainly for major currencies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indicative prices are published to platforms like Reuters and Bloomberg by various brokers and banks periodically, but they are not a reflection of actual trading prices, just occasional snapshots. If you want a current price you have to call your broker. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Watching a single broker source for EUR/USD right now, I can see multiple updates every second, to most of the tenors out to 10y. And that's just the published values which are filtered and rounded and so on. If you aggregate together lots of such sources, you get a much clearer picture of real second-to-second price changes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also be aware that banks are more likely to put up prices based on orders they are seeking to fill, with some spread away from the market. If you want more realistic, tighter prices, you need to look at broker feeds.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2014-03-27T11:21:00.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10724" PostTypeId="2" ParentId="10716" CreationDate="2014-03-27T12:17:22.503" Score="1" Body="&lt;p&gt;If you look at it from a mathematical point of view - presence of arbitrage should not matter for volatility estimates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Absence of arbitrage can be associated with the existence of an equivalent martingale measure for the bank account numeraire. (&lt;a href=&quot;http://en.wikipedia.org/wiki/Fundamental_theorem_of_asset_pricing&quot; rel=&quot;nofollow&quot;&gt;first fundamental theorem of asset pricing&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's assume the real world process is something like $dS_t=\mu(t,S_t)dt+\sigma(t,X_t)dW_t$. &#xA;If we can get rid of the drift $\mu(t,S_t)dt$ by deviding by a suitable numeraire $N_t$ the process $S_t/N_t$ will be a martingale. By the change of numeraire approach we could also immideately derive an equivalent martingale measure for the bank account $B(t)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now  assume there is arbitrage in the market. It follows that we can't make our process driftless under any numeraire. Thus the dynamics of our market asset is such that absence of arbitrage can't be guaranteed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still it won't matter for we are only concerned with the properties of the drift and not with the properties of the volatility term. Thus the drift could be seen to be primarily responsible for arbitrage in the setting shown abovel. For the drift does not matter when estimating volatility, arbitrage should not have an effect on vol.-estimates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Still this is purely theoretic&lt;/strong&gt; - perhaps someone working with HF-data can contribute another perspective :)&lt;/p&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="7279" LastEditDate="2014-03-27T12:25:12.003" LastActivityDate="2014-03-27T12:25:12.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10725" PostTypeId="2" ParentId="8257" CreationDate="2014-03-27T13:21:57.410" Score="3" Body="&lt;p&gt;I know this is a really old question but here is something I ran into while trying to do essentially the same thing. One of the problems that you face when trying to detect patterns using (say) k means clustering is how do you encapsulate a pattern. For example, suppose on a certain day the index goes up 2% over a minute and then goes down 1% over the next 10 minutes and then on some other day, the index goes up 2% in 3 minutes and then goes down 1% over the next 15 minutes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do you enforce that these two cases are close together using your chosen distance measure? An approach that worked pretty well for me was using dynamic time warping to rank my history of cases versus the current pattern that I see in the market. This method is resistant to squeezing together or dilation of patterns in time(or number of trades if you so wish).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have a look at &lt;a href=&quot;http://systematicinvestor.wordpress.com/2012/01/20/time-series-matching-with-dynamic-time-warping/&quot; rel=&quot;nofollow&quot;&gt;DTW example&lt;/a&gt; here. I believe it is close to what you have in mind. However I would like to add the disclaimer that using purely price patterns for prediction is a path fraught with many dangers. &lt;/p&gt;&#xA;" OwnerUserId="7645" LastEditorUserId="7645" LastEditDate="2014-03-27T13:34:57.547" LastActivityDate="2014-03-27T13:34:57.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10726" PostTypeId="2" ParentId="10703" CreationDate="2014-03-27T15:00:52.907" Score="0" Body="&lt;p&gt;Completely agree with rupweb's answer. Unfortunately cant upvote due to no rep. Just detailing that forward points basically represent the interest rate differential in the two currencies under consideration(as per Covered Interest Rate Parity). As the bank generally knows what its funding is in each of the currencies for a particular time frame and since this does not change very frequently, the forward points themselves do not change by much within a day. However if you ask for a quote then the trader on the bank side may move his quote to reflect his view on the currencies/interest rates or the way his book is axed which might result in some fluctuations in quotes at different times of the day. Other than that most of the volatility you see in a deliverable/non-deliverable forward price comes only from moves in the spot.&lt;/p&gt;&#xA;" OwnerUserId="7645" LastActivityDate="2014-03-27T15:00:52.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10727" PostTypeId="1" CreationDate="2014-03-27T16:22:28.567" Score="2" ViewCount="681" Body="&lt;p&gt;Consider a credit rating system consisting of three credit states, A, B and D (default)&#xA;with the following annual credit transition probability:&#xA;T = [0.7 0.2 0.1;0.2 0.5 0.3; 0 0 1].&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a company rated B, calculate:&#xA;a) The credit spread, calculated semi-annually, ten years into the future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The semi-annually is throwing me off. I know that credit spread = - ln q where q is the solvency. For ten years into the future, we simply take T^10 and the solvency is just 1-default. But they want the credit spread calculated semiannually, ten years into the future. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I'm wondering if it's asking two different questions ie. calculate credit spread semiannually (T^1/2) and ten years into the future (T^10), or is there a way to calculate the semi annual rate ten years into the future?&lt;/p&gt;&#xA;" OwnerUserId="7583" LastEditorUserId="7583" LastEditDate="2014-03-27T16:43:42.270" LastActivityDate="2014-03-27T16:43:42.270" Title="Credit Spread, Transition Matrix" Tags="&lt;transition-matrix&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10728" PostTypeId="2" ParentId="8257" CreationDate="2014-03-27T18:15:16.183" Score="2" Body="&lt;p&gt;I believe what you are looking for is called Seasonal pattern. Here is a good source - &lt;a href=&quot;http://signalfinancialgroup.com/Seasonal/SeasonalOverview.php&quot; rel=&quot;nofollow&quot;&gt;http://signalfinancialgroup.com/Seasonal/SeasonalOverview.php&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7576" LastActivityDate="2014-03-27T18:15:16.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10730" PostTypeId="2" ParentId="10663" CreationDate="2014-03-27T20:58:23.100" Score="1" Body="&lt;p&gt;adam I still think that your question is a bit vague but perhaps the following will be of some help to you. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all Itô's theorem is a tool. It will never give you the price by itself. While working out the concrete formula one might end up using it in one context or another. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case of a european option, a borel measurable function $h$ and $X_t$ being an Itô Process one has &#xA;$$g(t,x)=\mathbb{E}[h(X_T)|X_t=x]$$&#xA;It can be shown that $g(t,x)$ is smooth and thus we can apply Itô.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of american options we can exercise whenver we want. Let $\Phi(s,X_s)$ be the value if the option is exercised at time $s$. &#xA;The generic price-formula for an american type option is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$v(t,x)=\sup_{t\leq \tau \leq T}\mathbb{E}[\Phi(\tau,X_\tau)|X_t=x] $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Due to the supremum one can no longer simpli apply Itô directly to $v(t,X_t)$. There are some cases where the $\sup$ of a function will also be smooth but that must not necessarily be the case.&lt;/p&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-03-27T20:58:23.100" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10731" PostTypeId="1" CreationDate="2014-03-28T00:17:56.440" Score="2" ViewCount="18070" Body="&lt;p&gt;Bloomberg provides PX_BID and PX_ASK on a daily basis, but it's not clear exactly where these numbers come from. Are they closing bid and ask prices, or are they averaged over the entire day? For stocks, are they pulled directly from Nasdaq/NYSE dealers/specialists? Also, if anybody knows, were they pulled from the exchanges even before Regulation NMS?&lt;/p&gt;&#xA;" OwnerUserId="7648" LastActivityDate="2019-12-30T14:47:57.037" Title="Are PX_BID and PX_ASK on Bloomberg closing bid/ask? or are they daily averaged?" Tags="&lt;market-data&gt;&lt;finance&gt;&lt;historical-data&gt;&lt;bloomberg&gt;&lt;statistical-finance&gt;" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10732" PostTypeId="2" ParentId="2207" CreationDate="2014-03-28T00:59:01.890" Score="1" Body="&lt;p&gt;This is a very good question.  In part, you can find a comparison by going to &lt;a href=&quot;http://www.randommatrixportfolios.com/&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;Randommatrixportfolios.com&quot;&gt;randommatrixportfolios.com&lt;/a&gt; and looking at the wealth charts for e.g. the Dow 30 portfolios, say, the 2-year data.  You will note that portfolios based regressing the log-returns of price on the &amp;quot;signal&amp;quot; PCs (principal components) based on the Marcenko-Pastur noise cutoff and using the residuals as price returns in the portfolio resulted in much more wealth after two years when compared with (i) removing the main market component as well as the 3 shrinkage methods.  The various portfolios were :&lt;/p&gt;&#xA;&lt;p&gt;-MinVar - Minimum variance portfolio, tangency is used for unbalanced, whereas minimum variance is use for rebalanced portfolios.&lt;/p&gt;&#xA;&lt;p&gt;-EWMA - Exponential weighted moving average determination of returns and standard deviation.&lt;/p&gt;&#xA;&lt;p&gt;-RES - Component subtraction used to remove effect of the first principal component of the correlation matrix on returns.&lt;/p&gt;&#xA;&lt;p&gt;-MP - Component subtraction used to remove effect of noise eigenvectors (below Marcenko-Pastur cutoff, lambda+), on returns.&lt;/p&gt;&#xA;&lt;p&gt;-RESMP - Component subtraction employed to remove effects of greatest principal component and noise eigenvectors below MP cutoff.&lt;/p&gt;&#xA;&lt;p&gt;-DK - Daniels-Kass shrinkage of correlation matrix.&lt;/p&gt;&#xA;&lt;p&gt;-LW - Ledoit-Wolf shrinkage of correlation matrix.&lt;/p&gt;&#xA;&lt;p&gt;-SS - Schafer-Strimmer shrinkage of correlation matrix.&lt;/p&gt;&#xA;&lt;p&gt;There are portfolios, however, for which the shrinkage methods result in more wealth, but overall we like the MP (Marcenko-Pastur noise-signal) component removal method.&lt;/p&gt;&#xA;&lt;p&gt;We also removed volatility clustering from the raw log-returns of price data using ARCH(1)/GARCH(1,1) models, and the results were not that different.&lt;/p&gt;&#xA;&lt;p&gt;As a totally relevant aside, we wrote an entire chapter on covariance filtering methods, introduced conjectures for MP, and equations which could be used to develop algorithms in Chap 28 of &lt;a href=&quot;https://rads.stackoverflow.com/amzn/click/com/0470170816&quot; rel=&quot;nofollow noreferrer&quot; rel=&quot;nofollow noreferrer&quot;&gt;enter link description here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user6430" LastEditorUserId="-1" LastEditorDisplayName="user6430" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2014-03-28T01:23:24.313" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10733" PostTypeId="2" ParentId="522" CreationDate="2014-03-28T01:16:59.377" Score="2" Body="&lt;p&gt;Look at &lt;a href=&quot;http://randommatrixportfolios.com/&quot; rel=&quot;nofollow&quot;&gt;randommatrixportfolios.com&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user6430" LastEditorUserId="12" LastEditDate="2014-03-28T08:26:34.943" LastActivityDate="2014-03-28T08:26:34.943" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10734" PostTypeId="2" ParentId="2074" CreationDate="2014-03-28T01:30:59.140" Score="2" Body="&lt;p&gt;Here it is: &quot;Rebonato, R., Jackel, P. The most general methodology to create a valid correlation matrix for risk management and option pricing purposes.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recall: a covariance matrix will be the same as a correlation matrix if scale is removed.  I used this method for ensuring positive definite correlations matrices.  &lt;/p&gt;&#xA;" OwnerDisplayName="user6430" LastActivityDate="2014-03-28T01:30:59.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10735" PostTypeId="2" ParentId="934" CreationDate="2014-03-28T01:51:52.630" Score="2" Body="&lt;p&gt;It depends on the data, horizon, inputs, etc.  Wavelet transforms seems to be good for reducing time, and PCA seems to be good for reducing assets.  There's been a lot of work done in this area, so e.g., look at Jurik Research WAV and DDR modules. Their results indicate that you don't know which bars (days for EOD) are the most informative and also which features are the most informative -  so collapsing via wavelet offers an advantage.  I looked at NN a lot and don't think knowing the past helps predict the future.  The patent that Vantagepoint got approved made no sense at all -- but maybe their intermarket analyses helps?&lt;/p&gt;&#xA;" OwnerDisplayName="user6430" LastEditorDisplayName="user6430" LastEditDate="2016-04-17T14:42:48.910" LastActivityDate="2016-04-17T14:42:48.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10736" PostTypeId="2" ParentId="2309" CreationDate="2014-03-28T02:31:34.563" Score="3" Body="&lt;p&gt;The Yield to horizon for this example is 7.83%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a handy guide using this &lt;a href=&quot;http://finance.thinkanddone.com/tadBHRR.exe&quot; rel=&quot;nofollow&quot;&gt;http://finance.thinkanddone.com/tadBHRR.exe&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Bond price before change in YTM&#xA;Interest compounded semi annually&#xA;Par value of bond is 1000&#xA;Coupon rate on bond is 0.04&#xA;Initial YTM on bond is 0.0428945&#xA;Years till maturity are 14&#xA;Price = coupon rate x par value x PVIFA(ytm%, n) + par value x PVIF(ytm%, n)&#xA;PVIFA(0.0428945, 14) = 10.364105182304&#xA;PVIF(0.0428945, 14) = 0.55543689025767&#xA;Price = 0.04 x 1000 x 10.364105182304 + 1000 x 0.55543689025767&#xA;Price = 414.56420729215 + 555.43689025767&#xA;Price = 970&#xA;&#xA;Bond price after change in YTM&#xA;Interest compounded semi annually&#xA;Par value of bond is 1000&#xA;Coupon rate on bond is 0.04&#xA;Initial YTM on bond is 0.025&#xA;Years till maturity are 14&#xA;Price = coupon rate x par value x PVIFA(ytm%, n) + par value x PVIF(ytm%, n)&#xA;PVIFA(0.025, 14) = 11.690912169602&#xA;PVIF(0.025, 14) = 0.70772719575996&#xA;Price = 0.04 x 1000 x 11.690912169602 + 1000 x 0.70772719575996&#xA;Price = 467.63648678406 + 707.72719575996&#xA;Price = 1175.36&#xA;Horizon rate of return&#xA;&#xA;Bond price using initial YTM = 970&#xA;Bond price after change in YTM = 1175.36&#xA;Change in YTM = 0.025&#xA;Bond horizon = 14&#xA;horizon rate = (1175.36/970)^(1/14) * (1+0.025) - 1&#xA;horizon rate = (1.2117137655957)^(0.071428571428571) * 1.025 - 1&#xA;horizon rate = 1.0138113426005 * 1.025 - 1&#xA;horizon rate = 1.0391566261655 - 1&#xA;horizon rate = 3.92%&#xA;Annual horizon rate = 7.83%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The 7.83% is the nominal yield to horizon, the annualized yield to horizon is indeed 7.9847% computed as (1+yth)^2-1 or [(1.0391566261655)^2 - 1] as there are two compounding periods per year&lt;/p&gt;&#xA;" OwnerDisplayName="user5487" LastEditorDisplayName="user5487" LastEditDate="2014-03-28T03:02:44.750" LastActivityDate="2014-03-28T03:02:44.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10737" PostTypeId="1" CreationDate="2014-03-28T04:50:52.617" Score="3" ViewCount="529" Body="&lt;p&gt;I think I understand the fact that when marginal utilities of the same function are equal (a consequence of the actuarially fair insurance), the independent variables in it must be equal -- right? But what it is the reason in this for a consumer being risk averse? What a &lt;span class=&quot;math-container&quot;&gt;$u''&amp;lt;0$&lt;/span&gt; changes in comparison to a &lt;span class=&quot;math-container&quot;&gt;$u&quot;&amp;gt;0$&lt;/span&gt; condition?&lt;/p&gt;&#xA;&lt;p&gt;Edit: Example found &lt;a href=&quot;http://www.econport.org/econport/request?page=man_ru_applications_insurance&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&amp;quot;As a risk-averse consumer, you would want to choose a value of &lt;span class=&quot;math-container&quot;&gt;$x$&lt;/span&gt; so as to maximize expected utility, i.e.&lt;/p&gt;&#xA;&lt;p&gt;Given actuarially fair insurance, where &lt;span class=&quot;math-container&quot;&gt;$p = r$&lt;/span&gt;, you would solve: &lt;span class=&quot;math-container&quot;&gt;$\max \left[pu(w - px - L + x) + (1-p)u(w - px)\right]$&lt;/span&gt;, since in case of an accident, you total wealth would be &lt;span class=&quot;math-container&quot;&gt;$w$&lt;/span&gt;, less the loss suffered due to the accident, less the premium paid, and adding the amount received from the insurance company.&lt;/p&gt;&#xA;&lt;p&gt;Differentiating with respect to &lt;span class=&quot;math-container&quot;&gt;$x$&lt;/span&gt;, and setting the result equal to zero, we get the first-order necessary condition as: &lt;span class=&quot;math-container&quot;&gt;$(1-p)pu'(w - px - L + x) - p(1-p)u'(w - px) = 0$&lt;/span&gt;,&lt;/p&gt;&#xA;&lt;p&gt;which gives us: &lt;span class=&quot;math-container&quot;&gt;$u'(w - px - L + x) = u'(w - px)$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Risk-aversion implies &lt;span class=&quot;math-container&quot;&gt;$u'' &amp;lt; 0$&lt;/span&gt;, so that equality of the marginal utilities of wealth implies equality of the wealth levels, i.e.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$w - px - L + x = w - px$&lt;/span&gt;,&lt;/p&gt;&#xA;&lt;p&gt;so we must have &lt;span class=&quot;math-container&quot;&gt;$x = L$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;So, given actuarially fair insurance, you would choose to fully insure your car. Since you're risk-averse, you'd aim to equalize your wealth across all circumstances - whether or not you have an accident.&lt;/p&gt;&#xA;&lt;p&gt;However, if &lt;span class=&quot;math-container&quot;&gt;$p$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$r$&lt;/span&gt; are not equal, we will have &lt;span class=&quot;math-container&quot;&gt;$x &amp;lt; L$&lt;/span&gt;; you would under-insure. How much you'd underinsure would depend on the how much greater &lt;span class=&quot;math-container&quot;&gt;$r$&lt;/span&gt; was than &lt;span class=&quot;math-container&quot;&gt;$p$&lt;/span&gt;.&amp;quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Now, how the condition &lt;span class=&quot;math-container&quot;&gt;$u''&amp;lt;0$&lt;/span&gt; changes anything to reach the result expressed above?&lt;/p&gt;&#xA;" OwnerUserId="6897" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2015-05-23T19:05:55.333" Title="Why is that a risk averse consumer buys the optimum insurance when there is actuarially fair insurance?" Tags="&lt;risk&gt;&lt;finance&gt;&lt;mathematics&gt;&lt;economics&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10738" PostTypeId="2" ParentId="10731" CreationDate="2014-03-28T10:09:01.957" Score="4" Body="&lt;p&gt;PX_BID and PX_ASK are the static equivalents of BID and ASK, the latter two of which populate in &quot;real time&quot; (i.e. as they are dynamically updated). So the PX_BID and PX_ASK values are dependent upon when you pulled the data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bloomberg's source depends on the asset in question and the exchange on which they are listed, but the data does come from the exchange, an associated MM, or an ECN initially. I'm not sure about data pre-Reg NMS.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Perhaps a sidebar, but something that might be of interest: because there is less incentive to reduce publishing delays for trades relative to quotes (i.e. since trade delay allows transient post-hedge advantages for the traders, while old quotes are penalized), &lt;a href=&quot;http://www.acsu.buffalo.edu/~keechung/MGF743/Readings/Inferring%20trade%20direction%20from%20intraday%20data.pdf&quot; rel=&quot;nofollow&quot;&gt;trades are more stale than quotes&lt;/a&gt;. This could account for unusual PX values for last trade vs. the quotes. However, propagation delays in quotes can also be significant, often artificially reducing the NBBO given a delay-induced offsetting effect, which sometimes shows a locked or crossed market. This should also be considered when pulling quotes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might find &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1945577&quot; rel=&quot;nofollow&quot;&gt;Rosenthal (2011)&lt;/a&gt; useful, as well, if you are interested.&lt;/p&gt;&#xA;" OwnerUserId="7536" LastEditorUserId="7536" LastEditDate="2014-03-28T10:27:24.927" LastActivityDate="2014-03-28T10:27:24.927" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10739" PostTypeId="2" ParentId="10716" CreationDate="2014-03-28T11:08:48.840" Score="1" Body="&lt;p&gt;Perhaps not the most encouraging answer, but: I would think that it is contingent upon the specific implementation, magnitude, regularity, and transiency of arbitrage available as well as the volatility estimate time-scale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a very simple case, the existence of arbitrage opportunities would likely result in larger fraction of informed traders (relative to liquidity traders). This larger fraction should result in market makers that quote wider spreads than they would otherwise to protect themselves from being the counterparty of an arbitrageur rather than the desired liquidity trader. However, the existence of arbitrage opportunities may also imply that we observe a decreased influence of liquidity traders relative to the informed traders, who trade uni-directionally. This may an offsetting effect, depending on the magnitude of the arbitrage.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Effectively, as your volatility time-scale gets more granular, the more it is &quot;polluted&quot; by a bid-ask bounce, artificially raising volatility. There are ways to attempt to correct for this and other higher frequency-based issues, e.g. &lt;a href=&quot;http://www.bauer.uh.edu/rsusmel/phd/roll1984.pdf&quot; rel=&quot;nofollow&quot;&gt;Roll (1984)&lt;/a&gt;, &lt;a href=&quot;http://www.princeton.edu/~yacine/twoscales.pdf&quot; rel=&quot;nofollow&quot;&gt;Zhang et al. (2005)&lt;/a&gt;, &lt;a href=&quot;http://users.ox.ac.uk/~ofrcinfo/file_links/finecon_papers/2004fe01.pdf&quot; rel=&quot;nofollow&quot;&gt;Barndorff-Nielsen and Shephard (2004)&lt;/a&gt;, and &lt;a href=&quot;http://www.newyorkfed.org/research/staff_reports/sr465.pdf&quot; rel=&quot;nofollow&quot;&gt;Andersen&#xA; et al. (2010)&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7536" LastActivityDate="2014-03-28T11:08:48.840" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10740" PostTypeId="1" CreationDate="2014-03-28T11:56:08.423" Score="2" ViewCount="153" Body="&lt;p&gt;In a paper I encountered the following notation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P(Z\leq z,u\leq Y\leq v)=C(F_{Z}(z),F_{Y}(v)-F_{Y}(u))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I don't see why this holds in relation to uniform random variables. Usually&#xA;$$P(Z\leq,Y\leq v)=P(F_{Z}(Z)\leq F_{Z}(z),F_{Y}(Y)\leq F_{Y}(v))=P(U_{1}\leq F_{Z}(z), U_{2}\leq F_{Y}(v))=C(F_{Z}(z),F_{Y}(v))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But probability above i would write&#xA;$$P(Z\leq z,u\leq Y\leq v)=P(F_{Z}(Z)\leq F_{Z}(z),F_{Y}(Y)\leq F_{Y}(v))-P(F_{Z}(Z)\leq F_{Z}(z),F_{Y}(Y)\leq F_{Y}(u))$$&#xA;and then use copulas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone explain to me where the copula $C(F_{Z}(z),F_{Y}(v)-F_{Y}(u))$ comes from in terms of uniform random variables?  &lt;/p&gt;&#xA;" OwnerUserId="7649" LastActivityDate="2014-03-28T15:37:50.197" Title="Where does this copula come from?" Tags="&lt;probability&gt;&lt;copula&gt;&lt;joint-probability&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10741" PostTypeId="2" ParentId="10737" CreationDate="2014-03-28T13:54:26.863" Score="1" Body="&lt;p&gt;this is related to the concept of &lt;a href=&quot;http://en.wikipedia.org/wiki/Jensen%27s_inequality&quot; rel=&quot;nofollow&quot;&gt;Jensen inequality&lt;/a&gt;. basically, $\frac{f(x-|\delta|)+f(x+|\delta|)}{2}\ne f(x)$, for convex functions it's $&amp;gt;f(x)$, and for concave ones $&amp;lt;f(x)$. risk averse guys have concave utilities, that's the relation you need to look at&lt;/p&gt;&#xA;" OwnerUserId="7365" LastActivityDate="2014-03-28T13:54:26.863" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10742" PostTypeId="2" ParentId="10731" CreationDate="2014-03-28T14:32:08.273" Score="3" Body="&lt;p&gt;They represent the current &lt;code&gt;BID&lt;/code&gt; and &lt;code&gt;ASK&lt;/code&gt; at the time you query them. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you look up those fields in the terminal &lt;code&gt;FLDS&amp;lt;GO&amp;gt;&lt;/code&gt; you will see they are marked as reference data, that means they are not continually updated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They are refreshed each time you query them.  They come from the NBBO quote at the time you query them.&lt;/p&gt;&#xA;" OwnerUserId="743" LastActivityDate="2014-03-28T14:32:08.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10743" PostTypeId="1" CreationDate="2014-03-28T14:32:32.617" Score="2" ViewCount="482" Body="&lt;p&gt;Do options where the strike itself is a stochastic process exist? If they do - what are the motivations for such a product and where is it used ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;  Call-Option with stochastic strike:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$(S_T(\omega) - K_T(\omega))^+$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $K_t$ is a stochastic process. $K_T$ could for example be of the form $K_T=f(X_T)$ where $f$ is a measurable function. &lt;/p&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-04-01T08:06:00.500" Title="Options with a stochastic strike" Tags="&lt;options&gt;&lt;option-pricing&gt;" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10744" PostTypeId="2" ParentId="10740" CreationDate="2014-03-28T15:37:50.197" Score="2" Body="&lt;p&gt;if you agree that the marginal probability $P(u\le Y\le v)=F_Y(v)-F_Y(u)$, then your formula follows immediately, because next you simply plug the marginals into the copula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;your 3rd equation for the joint probabilities is incorrect for $P(Z\le z,u\le Y\le v)$, I'm not sure where you got it from&lt;/p&gt;&#xA;" OwnerUserId="7365" LastActivityDate="2014-03-28T15:37:50.197" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10745" PostTypeId="2" ParentId="10743" CreationDate="2014-03-28T16:00:13.893" Score="3" Body="&lt;p&gt;Asian options: strike is average of underlying over tenor.  Underlying is stochastic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Options with kock-ins/knock-outs:  Underlying is stochastic and may cross the kock threshold as it evolves.  Option value depends on this cross or lack thereof (boolean).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Options on Options, too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Motivations for Asian options you can google.  Kock-ins and knock-outs lower the cost of an option so that a buyer who needs them for hedging purposes can more cheaply acquire downside protection.  Generally applies to Currency/Interest Rate hedging.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Options on options are more of a theoretical construct, although I'm sure they exist in practice.  Generally useful for valuing complex projects with optionality when standard DCF approaches would not fully capture the stochasticity of the project's value.  Dixit has a good chapter on this, I believe.&lt;/p&gt;&#xA;" OwnerUserId="7601" LastActivityDate="2014-03-28T16:00:13.893" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10746" PostTypeId="1" CreationDate="2014-03-29T09:44:41.910" Score="12" ViewCount="1961" Body="&lt;p&gt;Actuaries (at least in Europe) are frequently severily lacking in quant finance topics. At best they are familiar with B&amp;amp;S model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;People going into quant finane or striving to become a quant on the other hand are often not aware that their knowledge could also be applied in an insurance context. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Classic quant-work-related topics are: options pricing, portfolio optimisation, credit risk.&#xA;&lt;strong&gt;This topics are also ery relevant to insurers.&lt;/strong&gt; The example below shows why. I will also add more examples later on. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example (portfolio optimization)&lt;/strong&gt;&#xA;Consider a car insurer's portfolio. Such a portfolio consists of many individual contracts. Premium calculation is based on the equivalence principle. Premiums paid by the insured must at least cover the losses. Thus such a portfolio can generate positive or negative annual returns. Positive if premiums paid &gt; losses, Negatative if premiums paid &amp;lt; losses.&#xA;Also these returns change over time and are volatile. The portfolio also has a market value - even though the market is not nearly as liquid as the one for standard derivatives and the bid/ask spreads can be huge. Still, one can interpret one such portfolio as a stock with possible negative dividend. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A reinsurance company often holds fractions of such portfolios. Thus to optimize the potfolio structure they can apply portfolio-optimization theory. As far as I know there are even a couple of reinsurers out there that actually do that. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Literature:&lt;/strong&gt;&#xA;&lt;em&gt;(some books and papers to showcase the interfacing of actuarial evaluation and derivatives pricing techniques)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.actuaries.org/EVENTS/Congresses/Cancun/afir_subject/afir_25_moller.pdf&quot;&gt;On Valuation and Risk Management at the Interface of Insurance and&#xA;Finance&lt;/a&gt; (suggested in the comments) &lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://events.em-lyon.com/AFFI/Papers/350.pdf&quot;&gt;Pricing and Hedging Variable&#xA;Annuities&lt;/a&gt; (because of the comprehensive list of references) &lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.actuaries.org/AFIR/Colloquia/Rome2/Bauer_Bergmann_Kiesel.pdf&quot;&gt;ON&#xA;THE RISK-NEUTRAL VALUATION OF LIFE INSURANCE CONTRACTS WITH NUMERICAL&#xA;METHODS IN VIEW&lt;/a&gt; (application of monte carlo least squares to the pricing of early ecercise features inbedded in in life insurance contracts)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Questions:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Literature suggestions on the application of option pricing,&#xA;portfolio optimization etc. to insurance related topics &lt;/li&gt;&#xA;&lt;li&gt;Further examples as the one above&lt;/li&gt;&#xA;&lt;li&gt;What could quants working for banks/funds learn from actuaries ?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="7279" LastEditDate="2014-03-30T06:10:57.613" LastActivityDate="2015-05-11T11:29:53.220" Title="On the interface between Quant finance and actuarial-science/insurance-math" Tags="&lt;options&gt;&lt;portfolio-management&gt;&lt;credit&gt;" AnswerCount="3" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10748" PostTypeId="1" AcceptedAnswerId="10764" CreationDate="2014-03-29T17:24:02.210" Score="3" ViewCount="95" Body="&lt;p&gt;I'm trying to understand the derivation of a ML-estimator and more specifically the rewriting of the covariance matrix Sigma. In this rewriting a lemma is used to show that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;(1) \hspace{1.4 cm}\Omega=\sigma^2_{c}\boldsymbol{1}\boldsymbol{1'} + \sigma^2_{\varepsilon}I_T=(\sigma^2_{\varepsilon}+T\sigma^2_{c})\boldsymbol{1}(\boldsymbol{1}'\boldsymbol{1})^{-1}\boldsymbol{1}'+\sigma^2_{\varepsilon}(I_T- \boldsymbol{1}(\boldsymbol{1}'\boldsymbol{1})^{-1}\boldsymbol{1}')$$&#xA;$$\Omega^{-1}=\frac{1}{\sigma^2_{\varepsilon}+T\sigma^2_{c}}\boldsymbol{1}(\boldsymbol{1}'\boldsymbol{1})^{-1}\boldsymbol{1}'+\frac{1}{\sigma^2_{\varepsilon}}(I_t-\boldsymbol{1}(\boldsymbol{1}'\boldsymbol{1})^{-1}\boldsymbol{1}')$$&#xA;$$|\Omega|=(\sigma^2_{\varepsilon}+T\sigma^2_{c})\sigma^{{2(T-1)}}_{\varepsilon}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Lemma states:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/SyEXv.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone explain the second equality in (1)?&lt;/p&gt;&#xA;" OwnerUserId="7078" LastEditorUserId="7078" LastEditDate="2014-03-31T17:49:03.867" LastActivityDate="2014-03-31T17:56:36.123" Title="Understanding the derivation of a ML-estimator" Tags="&lt;derivation&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10749" PostTypeId="1" CreationDate="2014-03-29T23:47:30.103" Score="7" ViewCount="1371" Body="&lt;p&gt;I'm trying to compute the implied volatility of a binary option but I cannot get some of the strikes to reach a convergent solution using either a Monte Carlo pricing model or an analytical Black Scholes model, minimizing using Newton's method. Since binaries are essentially the derivative of a vanilla call wrt the strike, is it even possible to always compute an implied volatility?&lt;/p&gt;&#xA;" OwnerUserId="7659" LastActivityDate="2016-01-08T06:10:29.613" Title="Does an implied volatility always exist for a binary option?" Tags="&lt;implied-volatility&gt;&lt;binary-options&gt;" AnswerCount="5" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10753" PostTypeId="2" ParentId="7696" CreationDate="2014-03-30T13:45:02.783" Score="5" Body="&lt;p&gt;I think what you are missing is simply the Vega-Gamma relation in the Black-Scholes model. Namely:&#xA;$$&#xA;  Vega = \frac{\partial v}{\partial \sigma} = \sigma(T-t)S^2  \frac{\partial^2 v}{\partial S^2} = \sigma \tau S^2 \Gamma&#xA;$$ &#xA;Plugging this into your coverage error, you get its expression in terms of the Vega which is the most natural measurement of your exposure to implied volatility.  &lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2014-03-30T13:45:02.783" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10755" PostTypeId="1" CreationDate="2014-03-30T18:24:07.113" Score="3" ViewCount="355" Body="&lt;p&gt;I have recently started to look up algorithmic trading but I am finding it hard to find references related to this field.I am math major with a sound knowledge in Statistics, various programming paradigms, Graph Algorithms and a bit of randomized algorithms.&#xA;The references may be in form of books,online resources anything which is accessible.&#xA;It would be great if these references could be broken down into those related to High frequency trading and Low frequency trading. &lt;/p&gt;&#xA;" OwnerUserId="7668" LastEditorUserId="7668" LastEditDate="2014-04-12T08:50:11.147" LastActivityDate="2014-04-12T08:50:11.147" Title="Reference for Algorithmic Trading" Tags="&lt;algorithmic-trading&gt;&lt;reference-request&gt;&lt;books&gt;&lt;soft-question&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ClosedDate="2014-03-30T23:49:08.717" ContentLicense="CC BY-SA 3.0" />
  <row Id="10756" PostTypeId="2" ParentId="10749" CreationDate="2014-03-30T20:12:43.107" Score="5" Body="&lt;p&gt;No, there is an upper limit to a binary option's value, based on the interest rate and how much of the distribution can be packed under the payoff region.  Essentially&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C =  e^{-rT} \int_K^\infty \psi(S_T) dS_T$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for calls and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ P = e^{-rT} \int_0^K \psi(S_T) dS_T$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for puts.  Neither of the integrals can ever exceed 1.0 and often they take on a smaller maximum in $\sigma$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are working with market ask prices, it is entirely possible they are above the Black-Scholes maximum, especially for binary puts.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2014-03-30T20:12:43.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10757" PostTypeId="2" ParentId="7657" CreationDate="2014-03-31T01:13:26.467" Score="0" Body="&lt;p&gt;Yes, multivariate GARCH is what you should consider. Imho, you can look at a book, analysis of financial time series, by Ruey S. Tsay, in chapter 10, they discussed multivariate volatility models. You can google this book, download the pdf of second edition, hope it helps.&lt;/p&gt;&#xA;" OwnerUserId="6116" LastActivityDate="2014-03-31T01:13:26.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10759" PostTypeId="1" AcceptedAnswerId="10766" CreationDate="2014-03-31T03:10:03.843" Score="4" ViewCount="245" Body="&lt;p&gt;I'm a physicist who's research has lead him into the theory of stochastic differential equations.  If this question is not appropriate for this forum, please feel free to delete it.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I've been following through Bernt Oksendal's &lt;em&gt;Stochastic Differential Equations: An Introduction with Applications&lt;/em&gt;  (5th edition).  In it, he discusses a time homogeneous, one dimensional stochastic process $\{X_t\}_{t \ge 0}$, which solves the SDE &#xA;$$&#xA;dX_t = a(X_t) dt + b(X_t) dW_t, \quad X_0 = x_0 \quad \mathbb{P} - a.s.&#xA;$$&#xA;(This of course assumes that $a(\cdot)$ and $b(\cdot)$ are Ito integrable and I'm happy to take them as smooth infinitely differentiable bounded functions that vanish at infinity.)   My question involves considering two additional (smooth) functions $f(x)$ and $g(x)$  where $f(x) \ne g(x)$ in general but do satisfy the equality,&#xA;$$&#xA;f(x_0) = g(x_0).&#xA;$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is given this equality, must we conclude from the backward Kolomogorov equation that &#xA;$$&#xA;\mathbb{E}(f(X_T) ) = \mathbb{E}(g(X_T) )&#xA;$$&#xA;for any time $T \ge 0$?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am lead to this conclusion because the backward Kolmogorov equation says that,  we can consider&#xA;$$&#xA;u(t, x_0) = \mathbb{E}( g(X_t) )&#xA;$$&#xA;where $u(t, x)$ solves the PDE&#xA;$$&#xA;\frac{\partial}{\partial t} u(t, x) = a(x) \frac{\partial u}{\partial x} (t, x) + \frac{1}{2}b(x) \frac{\partial^2u}{\partial x^2} (t, x)&#xA;$$&#xA;with the initial condition, $u(0, x_0) = g(x_0)$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now instead of considering $g$ we considered the function $\mathbb{E}( f(X_t) )$.  I believe I would write down the &lt;strong&gt;same&lt;/strong&gt; equation subject to the &lt;strong&gt;same&lt;/strong&gt; initial condition.  This leads me to conclude that $ \mathbb{E}(f(X_T) ) = \mathbb{E}(g(X_T) )$, regardless of how  $f(x)$ and $g(x)$ may behave away from $x_0$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My intuition says this is not correct and that the derivative information about $f$ and $g$ must be factored into it some how.  Is it that the initial condition is really a boundary condition and we are really saying that $u(0, x) = g(x)$ for any $x$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having typed this out I think I might have answered my own question, but any feedback would be appreciated!  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks. &lt;/p&gt;&#xA;" OwnerUserId="7670" LastActivityDate="2014-03-31T14:23:16.613" Title="backward Kolmogorov equations - Markov properties" Tags="&lt;stochastic-calculus&gt;&lt;mathematics&gt;&lt;markov&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10761" PostTypeId="1" CreationDate="2014-03-31T06:25:14.677" Score="5" ViewCount="1093" Body="&lt;p&gt;I am confused on the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When we price swaption, the market convention is to use Black's Model which assumes forward swap rate is following Black's model under the Q(t) measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When we tries to use SABR, the forward swap rate is again model depending on the value of Beta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we were to calibrate SABR for Swaption volatility, will there be a inconsistency with specifying the model for forward swap rate?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for clarifying&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ken&lt;/p&gt;&#xA;" OwnerUserId="7108" LastEditorUserId="7108" LastEditDate="2014-03-31T06:31:58.003" LastActivityDate="2014-05-31T15:22:22.183" Title="SABR model inconsistent with Black Swaption Pricing" Tags="&lt;volatility&gt;&lt;stochastic-volatility&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10763" PostTypeId="1" CreationDate="2014-03-31T09:58:28.360" Score="8" ViewCount="643" Body="&lt;p&gt;Assume that we want to calculate the time $t=0$ price of a bond:&#xA;$B(0,T) = E_P[\exp(-\int_0^T r_s ds)]$,&#xA;where $r$ is the interest rate following the SDE&#xA;$dr_t=k(\theta-r_t)dt+\sigma dB_t=b(r_t)dt+\sigma dB_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was shown that one could write the price as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$B(0,T) = E_{\hat{P}}[\exp(-\int_0^TB^{*}_sds)\exp(\int_0^Tb(B^{*}_s)dB^{*}s-\frac{1}{2}\int_0^Tb^2(B^{*}_s)ds)]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $B_t^{*}$ is the &quot;new&quot; Brownian motion from the Girsanov theorem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I try to implement it, it results in prices that are too low. Here is what I did:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $dr_t=b(r_t)dt+\sigma dB_t$, Girsanov's theorem gives a new Brownian motion with dynamics $dB_t^{*}=\frac{1}{\sigma}b(r_t)dt+dB_t$, and the dynamics of $r_t$ becomes&#xA;$dr_t=\sigma dB_t^{*}$. So $r_t=r_0+\sigma B_t^{*}$ and $dB_t^{*}= \frac{1}{\sigma}b(r_0+\sigma B_t^{*})dt+dB_t$. With this last expression I tried to use Euler discretization to find $B_t^{*}$, then finally I approximated the three integrals as sums. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong? Secondly, I also wonder what the starting point of $B_t^{*}$ should be, i.e. $B_0^{*}$.&lt;/p&gt;&#xA;" OwnerUserId="7673" LastActivityDate="2014-04-02T11:56:46.140" Title="Use of Girsanov's theorem in bond pricing" Tags="&lt;stochastic-processes&gt;&lt;bond&gt;&lt;financial-engineering&gt;&lt;girsanov&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10764" PostTypeId="2" ParentId="10748" CreationDate="2014-03-31T12:22:21.693" Score="2" Body="&lt;p&gt;I agree with vanguard2k's comment: A few more details on the notation would be helpful. But, as far as I can tell, the second equality is a simple expansion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, $\mathbf{1}'\mathbf{1} = T$ (assuming the vectors are elements of $\mathbb{R}^T$). The expression $\mathbf{1} (\mathbf{1}'\mathbf{1})^{-1} \mathbf{1}'$ is therefore nothing else than a $T\times T$ matrix with $\frac{1}{T}$ in every element.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume that scalar addition to a matrix actually means that a matrix with the scalar as each element is added, i.e. that $\sigma_c^2 + \sigma_{\epsilon}^2 \mathbf{I}_T := \sigma_c^2 \mathbf{1}\mathbf{1}' + \sigma_{\epsilon}^2 \mathbf{I}_T$. Then you can write:&#xA;\begin{align}&#xA; \sigma_c^2 + \sigma_{\epsilon}^2 \mathbf{I}_T =&amp;amp;\ \sigma_c^2 T \frac{1}{T} \mathbf{1}\mathbf{1}' + \sigma_{\epsilon}^2 \mathbf{I}_T \\&#xA;=&amp;amp;\ T \sigma_c^2 \mathbf{1}(\mathbf{1}'\mathbf{1})^{-1} \mathbf{1}' + \sigma_{\epsilon}^2 \mathbf{I}_T + \sigma_{\epsilon}^2\mathbf{1}(\mathbf{1}'\mathbf{1})^{-1} \mathbf{1} - \sigma_{\epsilon}^2\mathbf{1}(\mathbf{1}'\mathbf{1})^{-1} \mathbf{1}' \\&#xA;=&amp;amp;\ (\sigma_{\epsilon}^2 + T \sigma_c^2) \mathbf{1}(\mathbf{1}'\mathbf{1})^{-1} \mathbf{1}' + \sigma_{\epsilon}^2 (\mathbf{I}_T - \mathbf{1}(\mathbf{1}'\mathbf{1})^{-1} \mathbf{1}')&#xA;\end{align}&lt;/p&gt;&#xA;" OwnerUserId="7396" LastEditorUserId="7396" LastEditDate="2014-03-31T17:56:36.123" LastActivityDate="2014-03-31T17:56:36.123" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10765" PostTypeId="2" ParentId="10749" CreationDate="2014-03-31T13:12:31.917" Score="3" Body="&lt;p&gt;Ofcourse, It is always possible to find the implied volatility.&#xA;The value of &lt;em&gt;binary call&lt;/em&gt; is &#xA;$$&#xA;{e}^{-r(T-t)}N(d_2) &#xA;$$&#xA;where&#xA;$$&#xA;d_2=\frac{ln(\frac{S}{E})+(r-D-\frac{\sigma^2}{2})\tau}{\sigma\sqrt\tau}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, there is nothing that can ever ever stop the newton raphson method to find a $\sigma$ for which the value of binary call is given and is &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;positive&lt;/li&gt;&#xA;&lt;li&gt;if that given value is &lt;em&gt;BC&lt;/em&gt; then essentially&#xA;$$&#xA;0&amp;lt;BC&amp;lt;{e}^{-r\tau}                 &#xA;$$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Just, change your code to incrementally change the error value as well as starting point on the newton raphson until it reaches the correct solution.&#xA;Note: Use the CDF function approximation, as it is better on the extremities than the excel built in NormsDist &#xA;$$&#xA;d = \frac{1}{1 + 0.2316419 * |x|}&#xA;$$&#xA;$$&#xA;a_1 = 0.31938153&#xA;$$&#xA;$$&#xA;a_2 = -0.356563782&#xA;$$&#xA;$$&#xA;a_3 = 1.781477937&#xA;$$&#xA;$$&#xA;a_4 = -1.821255978&#xA;$$&#xA;$$&#xA;a_5 = 1.330274429&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;y = d * (a_1+d*(a_2+d*(a_3+d*(a_4+d*a_5))))&#xA;$$&#xA;$$&#xA;cdf = 1 - \frac{1}{(2\pi)^2} * e^{(-0.5x^2)} * y&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Except when If x &amp;lt; 0, Then &#xA;$$&#xA;cdf = 1 - cdf&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="7351" LastEditorUserId="7351" LastEditDate="2014-03-31T13:40:49.873" LastActivityDate="2014-03-31T13:40:49.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10766" PostTypeId="2" ParentId="10759" CreationDate="2014-03-31T14:23:16.613" Score="3" Body="&lt;p&gt;The initial condition for the backward Kolmogorov PDE is that&#xA;$$ u(0,x) = g(x) $$&#xA;for all $x$ in the relevant domain and not just at a particular point. So if your functions $f$ and $g$ agree only at a single point the initial conditions are in fact different. &lt;/p&gt;&#xA;" OwnerUserId="7396" LastActivityDate="2014-03-31T14:23:16.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10767" PostTypeId="1" CreationDate="2014-03-31T15:18:44.897" Score="1" ViewCount="587" Body="&lt;p&gt;I would like to generalize Paul Teetor's &lt;a href=&quot;http://quanttrader.info/public/betterHedgeRatios.pdf&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;A Better Hedge Ratio&lt;/strong&gt;&lt;/a&gt;, which uses prcomp() to determine a ratio between two legs. I am hoping to extend this to multiple legs, but am having trouble finding accurate results. Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="5981" LastActivityDate="2014-04-03T08:07:09.357" Title="How can I use PCA to determine spread ratios for multiple legs?" Tags="&lt;principal-components&gt;&lt;optimal-hedge-ratio&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10769" PostTypeId="1" AcceptedAnswerId="10772" CreationDate="2014-03-31T17:42:13.333" Score="4" ViewCount="2402" Body="&lt;p&gt;I am somewhat confused when it comes to modern portfolio theory, mean-variance portfolio optimization and its quadratic programming formulation.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Issue 1: Formulation of mean-variance portfolio optimization&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I learned that the mean-variance portfolio is given by the problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Minimize with respect to $\mathbf{x}$:&#xA;$\mathbf{x}^T \mathbf{\Sigma}\mathbf{x}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Subject to the constraints: $\mathbf{\mu}^T\mathbf{x} \geq r, \mathbf{1}^T\mathbf{x}=1 $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\mathbf{x}$ is the portfolio and $r$ is the target return&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;However, on Wikipedia I find that modern portfolio theory involves the following optimization problem:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Minimize with respect to $\mathbf{x}$:&#xA;$\mathbf{x}^T \mathbf{\Sigma}\mathbf{x} - q\times\mathbf{\mu}^T\mathbf{x}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Subject to the constraint: $\mathbf{1}^T\mathbf{x}=1 $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&lt;strong&gt;How are these two formulations identical?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Issue 2: Form of quadratic programming problem&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;In most references (among other on &lt;a href=&quot;http://en.wikipedia.org/wiki/Quadratic_programming#Problem_formulation&quot; rel=&quot;nofollow&quot;&gt;Wikipedia&lt;/a&gt;) the quadratic programming problem is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Minimize with respect to $\mathbf{x}$:&#xA;$\frac{1}{2} \mathbf{x}^T Q\mathbf{x} + \mathbf{c}^T \mathbf{x}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Subject to the constraints:&#xA;$ A\mathbf{x} \leq \mathbf b, $&#xA;$ E\mathbf{x} = \mathbf d $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;However, the R function quadprog::solve.QP solves the following problem:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Minimize with respect to $\mathbf{x}$:&#xA;$\frac{1}{2} \mathbf{x}^T Q\mathbf{x} - \mathbf{g}^T \mathbf{x}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Subject to the constraints:&#xA;$ K\mathbf{x} \geq \mathbf m $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the sign of c is opposite&lt;/li&gt;&#xA;&lt;li&gt;the inequality constraint is opposite&lt;/li&gt;&#xA;&lt;li&gt;the equality constraint is missing&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&lt;strong&gt;How are these two identical? I can accept the sign change for $\mathbf c$ as cosmetic but the rest...&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="7677" LastEditorUserId="7677" LastEditDate="2014-04-01T10:52:57.223" LastActivityDate="2014-04-01T10:52:57.223" Title="Mean-variance portfolio &amp; quadratic programming" Tags="&lt;optimization&gt;&lt;modern-portfolio-theory&gt;&lt;mean-variance&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10771" PostTypeId="2" ParentId="10749" CreationDate="2014-03-31T17:56:50.663" Score="-1" Body="&lt;p&gt;An out-of-the money binary call option will have two implied volatilities. After the first implied volatility keep looking at increasingly higher implied volatilities. After a while the binary call option price doesn't rise further, i.e. the &lt;a href=&quot;http://www.binaryoptions.com/binary-call-option-vega/&quot; rel=&quot;nofollow&quot;&gt;binary call vega&lt;/a&gt; falls to zero, and then the binary call option price starts falling as implied volatility continues to rise, i.e. the vega turns negative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why this condition exists is down to the value of an out-of-the-money call being capped (at roughly 0.5) but as implied volatility keeps rising there is an increased likelihood that the option will be worthless.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's no point in me proving this here so try it yourselves using the above equations.&lt;/p&gt;&#xA;" OwnerUserId="7678" LastActivityDate="2014-03-31T17:56:50.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10772" PostTypeId="2" ParentId="10769" CreationDate="2014-03-31T19:54:57.733" Score="4" Body="&lt;p&gt;With respect to issue one, it can be simpler to consider the case where the constraint on the expected return is an equality. In that case, the first problem can be transformed to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Minimize with respect to $\left\{ x,\lambda_{1},\lambda_{2}\right\} $: $x'\Sigma x + \lambda_{1} (\mu'x - r) + \lambda_{2} (1'x - 1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;by the technique of Lagrangian multipliers, while the second can be transformed to &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Minimize with respect to $\left\{ x,\lambda_{2}\right\} $: $x'\Sigma x - q \mu'x + \lambda_{2} (1'x - 1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, you could solve the first one and set $q \equiv -\lambda_{1}$ to effectively get the equivalent problem in the second. Since the $r$ is a constant, you can add it's term back in and it wouldn't have any impact on the final optimization (in the second, that is). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my experience, one can easily switch between a maximize return, minimize risk, or maximize utility framework for simple portfolio optimization problems. However, if you incorporate transaction costs or perform robust optimization or some other sophisticated approach, the efficient frontiers might exhibit some differences. Ultimately, you have to make a decision about which to use (it is probably more common to minimize risk subject to constraints) and just do that consistently when constructing efficient frontiers or portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With respect to issue two, optimizers are often different in their specifications. You typically will have to adjust your problem to be in the form of whatever the optimizer is. For instance, multiplying your $c$ by $-1$, multiply $A$ and $b$ by -1 each, and adding additional inequality constraints to create equality constraints (because you can express one equality as two inequalities). &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2014-03-31T19:54:57.733" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10773" PostTypeId="2" ParentId="10194" CreationDate="2014-03-31T20:27:50.727" Score="2" Body="&lt;p&gt;Once the single-factor Hull-White model is calibrated, you can compute zero-coupon bond prices in closed form (i.e., without running simulations).  See &lt;a href=&quot;http://en.wikipedia.org/wiki/Hull%E2%80%93White_model#Analysis_of_the_one-factor_model&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Hull%E2%80%93White_model#Analysis_of_the_one-factor_model&lt;/a&gt; .&lt;/p&gt;&#xA;" OwnerUserId="3188" LastActivityDate="2014-03-31T20:27:50.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10774" PostTypeId="1" AcceptedAnswerId="10776" CreationDate="2014-04-01T02:20:31.773" Score="6" ViewCount="1644" Body="&lt;p&gt;I'm trying to understand Numéraire concept so am reading the &lt;a href=&quot;http://en.wikipedia.org/wiki/Num%C3%A9raire&quot; rel=&quot;noreferrer&quot;&gt;wiki&lt;/a&gt; page:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I couldn't understand the last formula's 2nd equation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ E_{Q}\left[\left.\frac{M(0)}{M(T)}\frac{N(T)}{N(0)}\frac{S(T)}{N(T)}\right| \mathcal{F}(t)\right]/ E_Q\left[\left.\frac{M(0)}{M(T)}\frac{N(T)}{N(0)}\right| \mathcal{F}(t)\right]   = \frac{M(t)}{N(t)}E_{Q}\left[\left.\frac{S(T)}{M(T)}\right| \mathcal{F}(t)\right] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why so? Which part from the left hand side is mapped into $\frac{M(t)}{N(t)}$ and which part mapped to $E_{Q}\left[\left.\frac{S(T)}{M(T)}\right| \mathcal{F}(t)\right] $?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just for reference, below is copied from the wiki page.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-- begin of wiki &gt;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a financial market with traded securities, one may use a change of numéraire to price assets. For instance, if $M(t)=exp(∫_0^t r(s)ds)$ is the price at time $t$ of $\$1$ that was invested in the money market at time $0$, then all assets (say $S(t)$), priced in terms of the money market, are martingales with respect to the risk-neutral measure, (say $Q$). That is&#xA;$$\frac{S(t)}{M(t)}=E_Q\left[\left.\frac{S_T}{M_T} \right| F_t\right], ∀t≤T$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, suppose that $N(t)&amp;gt;0$ is another strictly positive traded asset (and hence a martingale when priced in terms of the money market). Then, we can define a new probability measure $Q^N$ by the Radon–Nikodym derivative&#xA;$$\frac{d Q^N}{dQ}=\frac{N_T/N_0}{M_T/M_0}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, by using the abstract Bayes' Rule it can be shown that $S(t)$ is a martingale under $Q^N$ when priced in terms of the new numéraire, $N(t)$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$  E_{Q^N}\left[\left.\frac{S(T)}{N(T)}\right| \mathcal{F}(t)\right] $$&#xA;$$= E_{Q}\left[\left.\frac{M(0)}{M(T)}\frac{N(T)}{N(0)}\frac{S(T)}{N(T)}\right| \mathcal{F}(t)\right]/ E_Q\left[\left.\frac{M(0)}{M(T)}\frac{N(T)}{N(0)}\right| \mathcal{F}(t)\right] $$&#xA;$$  = \frac{M(t)}{N(t)}E_{Q}\left[\left.\frac{S(T)}{M(T)}\right| \mathcal{F}(t)\right] = \frac{M(t)}{N(t)}\frac{S(t)}{M(t)} = \frac{S(t)}{N(t)} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&amp;lt;&amp;lt; end of wiki--&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2014-04-01T07:34:23.640" Title="Numéraire -- couldn't understand the wiki explanation" Tags="&lt;risk-neutral-measure&gt;&lt;numerairechange&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10775" PostTypeId="1" CreationDate="2014-04-01T02:37:46.917" Score="5" ViewCount="738" Body="&lt;p&gt;1) Suppose S is the stock price, how to hedge a derivative that pays $1/S_t$ at time $t$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Suppose there will be a dividend of amount $d$ between $t$ and $T$, how to hedge a derivative that pays $100 $*$ S_T/S_t$ at time $T$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The person who asked me the question said we don't need to assume the distribution of S here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="7679" LastActivityDate="2016-10-29T14:44:21.860" Title="How to hedge a derivative that pays the reciprocal of the stock price?" Tags="&lt;option-pricing&gt;&lt;equities&gt;&lt;derivatives&gt;&lt;asset-pricing&gt;" AnswerCount="3" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10776" PostTypeId="2" ParentId="10774" CreationDate="2014-04-01T07:34:23.640" Score="7" Body="&lt;p&gt;If you are interested in the proof of the Baye's Rule for conditional expectations you can find &lt;a href=&quot;https://quant.stackexchange.com/questions/10689/bayes-rule-for-conditional-expectations-proof-review&quot;&gt;it here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The sake of completeness:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The Baye's rule for conditional expectations states&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$$ E^Q[X|\mathcal{F}]E^P[f|\mathcal{F}]=E^P[Xf|\mathcal{F}] $$&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;With $f=dQ/dP$ - thus being the Radon-Nikodyn derivative and $X$ being&#xA;  some random variable and $\mathcal{F}$ being some sigma-algebrad.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now we need to apply that rule to the change of numeraire context.&#xA;From the Change of Numeraire Theorem we not that $dQ^N/dQ^M$ is given by &#xA;$$&#xA;f=\frac{dQ^N}{dQ^M}=\frac{M(0)N(T)}{M(T)N(0)}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the next step we insert this $f$ into above theorem and also subtitute $X$ for $S(T)/N(T)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ E^{Q^N}\left[\frac{S(T)}{N(T)}|\mathcal{F}_t\right]E^{Q^M}\left[\frac{M(0)N(T)}{M(T)N(0)}|\mathcal{F}_t\right]=E^{Q^M}\left[\frac{S(T)}{N(T)}\frac{M(0)N(T)}{M(T)N(0)}|\mathcal{F}_t\right] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{S(T)}{N(T)}\frac{M(0)N(T)}{M(T)N(0)}$ simplifies to $\frac{S(T)}{M(T)}\frac{M(0)}{N(0)}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Now perhaps the crucial step.&lt;/strong&gt; $N(t)$ is a numeraire and thus a tradeable asset. $M(t)$ is also a numeraire and $Q^M$ is its equivalent measure. Thus $N(t)/M(t)$ is a martingale under $Q^M$. This leads to &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E^{Q^M}\left[\frac{M(0)N(T)}{M(T)N(0)}|\mathcal{F}_t\right]=\frac{M(0)N(t)}{M(t)N(0)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Deviding by this fraction results in&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ E^{Q^N}\left[\frac{S(T)}{N(T)}|\mathcal{F}_t\right]=\frac{N(0)M(t)}{N(t)M(0)}E^{Q^M}\left[\frac{S(T)}{M(T)}\frac{M(0)}{N(0)}|\mathcal{F}_t\right]= \frac{N(0)M(t)}{N(t)M(0)}\frac{M(0)}{N(0)}E^{Q^M}\left[\frac{S(T)}{M(T)}|\mathcal{F}_t\right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This leads to &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E^{Q^N}\left[\frac{S(T)}{N(T)}|\mathcal{F}_t\right]=\frac{M(t)}{N(t)}E^{Q^M}\left[\frac{S(T)}{M(T)}|\mathcal{F}_t\right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we know that $S(t)/M(t)$ is a martingale under $Q^M$. Thus the desired result follows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E^{Q^N}\left[\frac{S(T)}{N(T)}|\mathcal{F}_t\right]=\frac{M(t)S(t)}{N(t)M(t)}$$&lt;/p&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2014-04-01T07:34:23.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10777" PostTypeId="1" CreationDate="2014-04-01T07:47:18.010" Score="8" ViewCount="234" Body="&lt;p&gt;I was reading the papers co-authored by Harrison, Kreps and Pliska, that initiated the formal research on the connection between pricing, martingale measures, arbitrage and completeness. I have some issues relating some of the ideas, though, and would be happy if somebody could help me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a more or less abstract setting, one considers an ordered topological space $X$ of cash flows, a subspace $M\subseteq X$ of traded instruments and a &lt;em&gt;positive&lt;/em&gt; linear functional $\pi:M\to \Bbb R$. The 1st FTAP that relates absence of arbitrage to the existence of EMM concerns continuous extension of $\pi$ to $X$ which is still positive. As an example, one can consider&#xA;$$&#xA;  M = \left\{m = m_0 + \int_0^T H_t\;\mathrm dS_t \right\}&#xA;$$&#xA;where $H$ is some &quot;good&quot; strategy and $S$ is a vector of traded assets. In such case, one defines $\pi(m) = m_0$ as an initial cash endowment required to get $m$ at the maturity time $T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess, the existence of a unique positive extension of $\pi$ to the whole $X$ implies the completeness of the market: that is, we can price everything in a consistent way and there is a unique way to do this. Apparently, this automatically leads to the representability of any $x\in X$ as $x_0 + \int_0^T H_t \mathrm dS_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the same time, I do not understand, how the existence of at least one continuous positive extension may be related to the absence of arbitrage. That is, I would imagine an arbitrage being rather existence of two strategies $H'$ and $H''$ such that &#xA;$$&#xA;  m'_0 + \int_0^T H'_t\;\mathrm dS_t = m''_0 + \int_0^T H''_t\;\mathrm dS_t&#xA;$$&#xA;with $m'_0 \neq m''_0$. But this rather says $\pi$ &lt;em&gt;is not uniquely defined even on&lt;/em&gt; $M$ instead of &lt;em&gt;it is not possible to extend&lt;/em&gt; $\pi$ &lt;em&gt;to&lt;/em&gt; $X$. Does that mean that the latter two statements are equivalent?&lt;/p&gt;&#xA;" OwnerUserId="464" LastActivityDate="2015-03-30T02:31:53.033" Title="FTAP a-la Harrison, Kreps and Pliska" Tags="&lt;pricing&gt;&lt;martingale&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10778" PostTypeId="2" ParentId="10743" CreationDate="2014-04-01T08:06:00.500" Score="1" Body="&lt;p&gt;I believe your example describes the payoff of a simple spread option. Some may argue that in reality this spread option has zero strike:&#xA;$$&#xA;(S_T(\omega) - K_T(\omega)-0)^+&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which leads us to the question: What exactly strike is anyway? Is it uniquely identifiable term in each payoff function? No It isn't.&lt;/p&gt;&#xA;" OwnerUserId="3120" LastActivityDate="2014-04-01T08:06:00.500" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10779" PostTypeId="1" AcceptedAnswerId="10783" CreationDate="2014-04-01T08:59:19.503" Score="7" ViewCount="1389" Body="&lt;p&gt;I understand that quasi-random numbers have much better convergence, but are there any reasons for me to use pseudo-random numbers instead?&lt;/p&gt;&#xA;" OwnerUserId="4862" LastActivityDate="2014-08-28T20:44:45.247" Title="What are the merits of pseudo random numbers over quasi random numbers in monte-carlo simulation?" Tags="&lt;monte-carlo&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10780" PostTypeId="2" ParentId="10194" CreationDate="2014-04-01T09:33:39.973" Score="1" Body="&lt;p&gt;Note that you can also use trees instead of running monte carlo (if a closed form solution is not avaliable) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I know it is even an industry standard to work with the Hull-White tree instead of monte-carlo. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For mote informiation you can have a look at the paper: &lt;a href=&quot;http://www.math.kth.se/~lang/arkiv/finans/exjobb/gratte/usingh-winteresttrees.pdf&quot; rel=&quot;nofollow&quot;&gt;USING HULL-WHITE INTEREST-RATE TREES&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-04-01T09:33:39.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10781" PostTypeId="1" CreationDate="2014-04-01T09:48:28.437" Score="1" ViewCount="88" Body="&lt;p&gt;I am considering extending a multi-factor fixed income stochastic model (e.g. LIBOR-Market) to use stochastic correlation matrices instead of determinstic ones. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For pricing instruments with short maturities stochastic correlation would not really make sense - for the correlation structure is in general much more stable than the volaltility. Thus in the short run it is often sufficient to work with a determinstic correlation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instruments with long maturities (as often encountered in fixed income markets) are a different matter entirely. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Questions:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Are there precedents of such models (either equity or fixed income)? &lt;/li&gt;&#xA;&lt;li&gt;Whould the added value be worth the effort ? (or is it enough to deal with stochastic volatility which is certainly more important)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-04-01T09:48:28.437" Title="Incorporating a stochastic correlation structure into a multi-factor model" Tags="&lt;option-pricing&gt;&lt;pricing&gt;&lt;models&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10782" PostTypeId="1" AcceptedAnswerId="10786" CreationDate="2014-04-01T10:56:13.017" Score="2" ViewCount="871" Body="&lt;p&gt;I am trying to figure out the following, for me unfamiliar type of question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given is a single asset portfolio: the Delta of the portfolio is 15, the value of the asset is 10 and the daily volatility is 2.2%. From this, I have to calculate the one-day 98% VaR of the portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have not encountered a situation where the Delta is directly related to the VaR so I am not sure how I should approach this problem. Help is very much appreciated.&lt;/p&gt;&#xA;" OwnerUserId="6433" LastActivityDate="2015-11-20T11:09:23.223" Title="Value at Risk from Delta of a single asset portfolio" Tags="&lt;volatility&gt;&lt;portfolio-management&gt;&lt;var&gt;&lt;greeks&gt;&lt;delta&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10783" PostTypeId="2" ParentId="10779" CreationDate="2014-04-01T11:20:58.283" Score="7" Body="&lt;p&gt;Quasi Random Numbers are more tricky than it might seem, using them as a black box like with PRNGs is risky. E.g. an unscrambled Sobol' sequence is uniform only asymptotically, while for realistic sample sizes there are subvolumes with significantly different densities. You often do not realize that because the convergence graph looks good anyway, it gives no clue of the bias, and worse the low dimensional marginals $are$ indeed uniform, thus masking the problem. The same holds for lattice rules and other sequences, where empty spaces might interact with important features of the integrand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand a good PRNG gives an unbiased result by default (see also &lt;a href=&quot;https://quant.stackexchange.com/questions/10706/effects-of-random-generator-choice-on-derivatives-price/10707#10707&quot;&gt;here&lt;/a&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A useful compromise is to use randomized QMC, that is multiple QMC point sets shifted by a random offset. That way you get an unbiased estimator and also an error estimate; the downside is of course that convergence will not be as fast as for QMC.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Only use QMC if you know well what you're doing.&lt;/p&gt;&#xA;" OwnerUserId="3015" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2014-04-01T11:20:58.283" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10784" PostTypeId="2" ParentId="10761" CreationDate="2014-04-01T12:06:04.143" Score="-1" Body="&lt;p&gt;My understanding is you can calibrate with atm vol which should be close with either model then the otm vols are taken care of by the beta parameter from sabr&lt;/p&gt;&#xA;" OwnerUserId="7682" LastActivityDate="2014-04-01T12:06:04.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10786" PostTypeId="2" ParentId="10782" CreationDate="2014-04-01T17:24:47.783" Score="3" Body="&lt;p&gt;Given that by delta means that if the price goes up by 0.01% i.e. one basis point, you gain 15 and vice versa if the price goes down by one basis point. You know that the daily standard deviation is 2.2%, than again you know that $ 220*15 = 3300$ is the standard deviation of your portfolio. So, since we are using a normal distribution you can look at a table which describes the standard deviate for $\alpha=100\%-98\%=2\%$. If I remember correctly the standard deviate for $\alpha=2\%$ is $2.05$ and that gives you the loss measure called $VAR=-3300*2.05=-6765$ &lt;/p&gt;&#xA;" OwnerUserId="7584" LastEditorUserId="7584" LastEditDate="2014-04-02T15:52:19.107" LastActivityDate="2014-04-02T15:52:19.107" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10788" PostTypeId="2" ParentId="8631" CreationDate="2014-04-02T01:29:07.313" Score="0" Body="&lt;p&gt;use a smoothing spline, there's a ton of literature on the subject, such as &lt;a href=&quot;http://ideas.repec.org/p/fip/fedgfe/95-1.html&quot; rel=&quot;nofollow&quot;&gt;this one&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7365" LastActivityDate="2014-04-02T01:29:07.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10789" PostTypeId="2" ParentId="10763" CreationDate="2014-04-02T06:24:36.920" Score="6" Body="&lt;h2&gt;Bond Price Dynamics&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I do not know the source of the bond dynamics you show above but seeing how we are dealing with an affine model there is a very elegant way to derive those.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Due to the model being affine the bond price is given by&#xA;$$P(t,T)=A(t,T)e^{-r(t)B(t,T)}$$&#xA;you can find the exact formulas for $A(t,T)$ and $B(t,T)$ &lt;a href=&quot;http://web.mst.edu/~bohner/fim-10/fim-chap4.pdf&quot; rel=&quot;noreferrer&quot;&gt;in this document&lt;/a&gt; (or just read the relvant chapter in &lt;a href=&quot;http://www.damianobrigo.it/book.html&quot; rel=&quot;noreferrer&quot;&gt;Brigo Mercurio&lt;/a&gt;. If you are curious to know how one arrives at above pricing formula I suggest &lt;a href=&quot;http://www.emis.de/journals/HOA/JAMDS/8/11.pdf&quot; rel=&quot;noreferrer&quot;&gt;this paper&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now that we know above closed form formua, getting the dynamics of $P(t,T)$ is just a matter of applying Itô and using some algebra&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;$$&#xA;dP(t,T)=r_tP(t,T)dt-\sigma B(t,T)P(t,T)dW_t&#xA;$$&lt;/h2&gt;&#xA;&#xA;&lt;h2&gt;Getting a solution for $r_t$&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The generalized Vasicek model is given by&#xA;$$&#xA;dr_t=\kappa(t)(\theta(t)-r_t)d t+\sigma(t)dW_t&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The unique solution is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;r_t=A^{-1}(t)\left[r_0+\int_0^tA(s)\kappa(s)\theta(s)ds+\int_0^t A(s)\sigma(s)dW_s\right]&#xA;$$&#xA;with $A(t)=\exp\left(\int_0^t\kappa(s)ds\right)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Seeing how you have constant and not time dependant parameters the above simplifies to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;r_t=e^{-\kappa t}\left[r_0+\int_0^t\kappa\theta e^{\kappa s} ds+\int_0^t \sigma e^{\kappa s} dW_s\right]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;P.S.:&lt;/strong&gt; To arrive at the above solution one simply applies Ito's Formula to $d(r_t \cdot e^{\int_0^t\kappa(s)ds})$&lt;/p&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="7279" LastEditDate="2014-04-02T11:56:46.140" LastActivityDate="2014-04-02T11:56:46.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10791" PostTypeId="2" ParentId="10779" CreationDate="2014-04-02T08:00:13.943" Score="3" Body="&lt;p&gt;I would argue (this  is also what Quartz already hinted at) that PRNGs are far easier to set up than a well functioning QMC and are thus generally user-friendlier&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Excel and R both offer a PRNG. (but not a QMC) Thus someone working with these software will be more likely to use a PRNG than to painstakingly implement a QMC. Also as Quartz explained one needs a certain level of Know-How to understand the intricacies of Quasi Monte Carlo. Not many people have that or a willing to invest the time and effort if a PRNG-approach also works (albeit not so fast)&lt;/p&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-04-02T08:00:13.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10792" PostTypeId="1" AcceptedAnswerId="10793" CreationDate="2014-04-02T14:08:12.850" Score="8" ViewCount="452" Body="&lt;p&gt;I am looking for either a &lt;strong&gt;review paper&lt;/strong&gt; or individual papers on &lt;strong&gt;portfolio selection&lt;/strong&gt; using &lt;strong&gt;robust statistics or regularization&lt;/strong&gt; (e.g. LASSO, Ridge, etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e. a review on methods along the lines of:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;M Carrasco, N Noumon, Optimal portfolio selection using regularization, 2011&#xA;&lt;a href=&quot;http://www.admissions.american.edu/cas/economics/info-metrics/pdf/upload/Carrasco-Nov-2011-submission.pdf&quot;&gt;http://www.admissions.american.edu/cas/economics/info-metrics/pdf/upload/Carrasco-Nov-2011-submission.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;D Goldfarb, G Iyengar, Robust portfolio selection problems, 2003&#xA;&lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.100.7182&amp;amp;rep=rep1&amp;amp;type=pdf&quot;&gt;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.100.7182&amp;amp;rep=rep1&amp;amp;type=pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7677" LastActivityDate="2014-04-03T05:25:24.800" Title="Overview of robust/regularized portfolio selection" Tags="&lt;modern-portfolio-theory&gt;&lt;portfolio-selection&gt;&lt;portfolio-optimization&gt;&lt;robust-optimization&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10793" PostTypeId="2" ParentId="10792" CreationDate="2014-04-02T15:15:29.263" Score="4" Body="&lt;p&gt;The Lyxor white paper &lt;a href=&quot;http://www.lyxor.com/publications/white-papers/wp/82/&quot; rel=&quot;nofollow&quot;&gt;Regularization of Portfolio Allocation&lt;/a&gt; contains a lot on this topic. The head of quant research there, Thierry Roncalli, also held a &lt;a href=&quot;http://www.thierry-roncalli.com/download/big-data-in-asset-management.pdf&quot; rel=&quot;nofollow&quot;&gt;talk&lt;/a&gt; about this recently.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2014-04-03T05:25:24.800" LastActivityDate="2014-04-03T05:25:24.800" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10794" PostTypeId="1" CreationDate="2014-04-02T20:13:57.347" Score="3" ViewCount="1471" Body="&lt;p&gt;what is the good way to pricing american option on bond future?&#xA;From bonk fixed income securities 3rd by Tuckman, I understand how to pricing European option on bond future, but I still have no clue how to pricing american option.&lt;/p&gt;&#xA;" OwnerUserId="7699" LastEditorUserId="7279" LastEditDate="2014-04-03T18:23:13.227" LastActivityDate="2015-01-30T04:32:47.060" Title="Pricing an american style option on a bond future" Tags="&lt;option-pricing&gt;&lt;american-options&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10795" PostTypeId="1" CreationDate="2014-04-03T07:05:44.990" Score="10" ViewCount="1628" Body="&lt;p&gt;First I'll describe the way I understood things so far from the literature, feel free to correct me here, and then I formulate some questions. I'd search through QSE, but haven't found so far similar question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The BS model assumes the stock to follow an SDE with a linear diffusion term, hence constant volatility:&#xA;$$&#xA;  \mathrm dS_t = \mu S_t \mathrm dt + \sigma S_t\mathrm dW_t.&#xA;$$&#xA;Although model showed reasonable match with market prices back in early 70s, in a decade it was noticed that when assuming constant volatilities calibrated e.g. with ATM options, options on the same stock with different maturities/strikes differ in value from what BS model suggests.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Implied volatility $\sigma_{\mathrm{imp}}(K,T)$ hence was defined as a value of constant volatility which is when put in BS formula returns the &lt;em&gt;market price&lt;/em&gt; for the option with maturity $T$ and strike $K$. Since the plot of $\sigma_{\mathrm{imp}}$ appeared far from being flat and showed infamous skew/smile effects, it was clear that assuming any constant level of volatility &lt;em&gt;does not lead to observed market prices&lt;/em&gt;. Due to this reason, Derman and others in mid-90s introduced the local volatility model&#xA;$$&#xA;  \mathrm dS_t = \mu S_t\mathrm dt + \sigma_{\mathrm{loc}}(S_t,t)\mathrm dW_t&#xA;$$&#xA;and suggested calibrating $\sigma_{\mathrm{loc}}$ with $\sigma_{\mathrm{imp}}$ rather than e.g. with historical volatilities. Further, there were even models of dynamics for the entire volatility surface - I think there are some people doing this now with SPDEs.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Now, the implied volatility is a model-dependent concept. Even if that would be a very good estimate of market's expectation about the future volatility (which some people don't think to be true), that means assuming that everybody on the market is using the same model. E.g. classical implied volatility is computed via BS formulae, so taking it into account requires assuming most people on the market are using BS to price e.g. vanillas. Does it make sense?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Implied volatility necessary contains some noisy information - e.g. demand/supply of OTM options make their prices more volatile than those of ATM options, which is not an intrinsic property of the stock (which volatility is supposed to be). Even if one decides to use local deterministic/stochastic volatility model, why don't calibrate this on the historical data? I do know the criticism of the latter method, but since most of the models are Markovian anyways, that seem to justify historical approach way better than the implied one, doesn't it?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="464" LastActivityDate="2018-05-12T10:30:59.527" Title="Why use implied volatility" Tags="&lt;implied-volatility&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10796" PostTypeId="1" CreationDate="2014-04-03T07:44:40.237" Score="1" ViewCount="109" Body="&lt;p&gt;I need to compute the delta of an option for which I know a) the time to maturity, b) the price of the option, c) the price of the underlying asset.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;what is the formula to get this delta&lt;/li&gt;&#xA;&lt;li&gt;It seems that the volatility is a parameter of this formula (yes, I have some clue of the answer of the first question ;). What is this vol? Where can I get it?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="134" LastEditorUserId="134" LastEditDate="2014-04-03T07:59:23.397" LastActivityDate="2014-04-03T08:18:32.297" Title="what is the vol in the BS formula?" Tags="&lt;volatility&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10797" PostTypeId="2" ParentId="10767" CreationDate="2014-04-03T08:07:09.357" Score="1" Body="&lt;p&gt;In the case of N components:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;compute the NxN covariance matrix&lt;/li&gt;&#xA;&lt;li&gt;compute the N eiggenvectors and take the one that has the signs that you want&lt;/li&gt;&#xA;&lt;li&gt;the weights of this eiggen vector corresponds to the basket of N components that you wish to create&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="134" LastActivityDate="2014-04-03T08:07:09.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10798" PostTypeId="2" ParentId="10795" CreationDate="2014-04-03T08:08:13.433" Score="2" Body="&lt;p&gt;I am not a trader and will pass on question 1 for now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer your second question. You want you model to be able to reproduce market prices of certain vanilla instruments. This way you achieve consistency with the market. Thus if you want to price an exotict call option you will calibrate your model to liquid call option prices. If the option has more optionality than a standard call it should be more expensive than one. If you calibrated your model to market quotes this will be the case. For historical data this relationship might not hold.&lt;/p&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-04-03T08:08:13.433" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10799" PostTypeId="2" ParentId="10796" CreationDate="2014-04-03T08:18:32.297" Score="2" Body="&lt;p&gt;Recall that the delta of an option is the sensitivity of its price to changes in the underlying's stock price:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta = \frac{\partial V}{\partial S} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, &lt;strong&gt;if you assume the BS framework&lt;/strong&gt;, you find that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V(t,T,K,\sigma,r) = S_t \Phi(d_1) - e^{-r(T-t)} K \Phi(d_2)$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly, $\Delta = \frac{\partial V}{\partial S}= \Phi(d_1)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that $d_1$ is a function of $S,K,r,\sigma,t$ and $T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;a) time to maturity&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is $\tau=T-t$.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;b) the price of the option&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is $V$.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;c) the price of the underlying asset&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is $S_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With only this information I do no think you can solve the problem, but I assume you should have somewhere the strike price $K$ and the interest rate $r$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do, then you can find the implied volatility $\hat{\sigma}$ by solving computationally:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\hat{\sigma}=\underset{\sigma}{\arg \min} \left[ \left(S_t \Phi(d_1) - e^{-r(T-t)} K \Phi(d_2)\right)  - V \right]^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then compute the delta...&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2014-04-03T08:18:32.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10800" PostTypeId="1" CreationDate="2014-04-03T09:27:42.580" Score="2" ViewCount="1245" Body="&lt;p&gt;Path-dependent options in BS framework is intuitive to price with monte-carlo under risk-neutral measure, however it appears that several kinds can be priced with PDEs. I understand how does the story goes for Asian options: the payoff depends on more than just asset price and time, so we introduce a new variable, our model happens to be Markovian again, completeness is still in place - hence just write down Kolmogorov-like equation for the option price for the risk-neutral measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case of barrier options, we often don't even need to enlarge the state space: only introduce the additional boundary conditions at barriers. However, in Wilmott's &quot;Mathematics of Financial Derivatives&quot; and &quot;PWOQF2&quot; the derivation is rather informal and hand-shaky, something like &lt;em&gt;&quot;before hitting the barrier the option's price satisfies the BS equation&quot;&lt;/em&gt;. It's not that clear to me, though, why is that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another book I've checked was &quot;Martingale methods&quot; by Musiela and Rutkowski - there they just compute expectation of present value, having indicators for barrier events - they use joint distribution of max/min of Brownian motion with Brownian motion itself; there everything is formal, but not expressed in the framework of PDEs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thus interested in:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Formal derivation of PDE and boundary conditions for barrier options in the BS model. I've also checked out Shreve's 2nd volume, Section 7.3.2 - but yet again the argument in Lemma 7.3.2 there is a bit informal on the one hand, and on the other - the rest of the proof is done via martingale methods.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Can you advise any &quot;classical&quot; book on math finance which follows the PDE approach (rather than martingale/expectation approach) and is mathematically rigor?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="464" LastActivityDate="2017-09-08T16:01:30.527" Title="PDE pricing of barrier options in BS" Tags="&lt;mathematics&gt;&lt;reference-request&gt;&lt;exotics&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10801" PostTypeId="2" ParentId="10795" CreationDate="2014-04-03T09:28:22.527" Score="12" Body="&lt;p&gt;My try to answer this question with some other questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is the BS model right? No. Is it useful: yes. Taking a traded price and the BS Model there is only one input factor that is not given by the market: the implied volatility. It is a measure to compare options across time and strike. &lt;/li&gt;&#xA;&lt;li&gt;Are there better models? yes. Those that you mention: The local vol models. There are stochastic vol models, Lévy models and if calibrated correctly they perform much better than the BS model. In fact the BS model often is a trivial special case of the more complicated models. How are those models evaluated? One way is to see if the BS-implied vol of the prices calculated by these models fits the BS-implied vol that can be observed on the market. Again the BS-implied vol can be used to do comparisons. &lt;/li&gt;&#xA;&lt;li&gt;Why not use historical data? The volatility that you use for an option that expires in the future has only limited connection to past/observed volatility. E.g. if I trade an option on NIKKEI and the Fokushima catastrophy happens then implied vol will rise immediately. Historical vol will rise only gradually. In short: implied vol is forward looking and reactive whereas historical vol is backward looking and slow.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-04-03T09:28:22.527" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10802" PostTypeId="2" ParentId="10689" CreationDate="2014-04-03T10:05:20.600" Score="7" Body="&lt;p&gt;Is this the proof you are looking for?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/XEKkC.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-- from Shreve, S. E.'s book &quot;Stochastic calculus for finance II, continuous-time Models&quot;, chapter 5.&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2014-04-03T10:05:20.600" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10804" PostTypeId="1" CreationDate="2014-04-03T12:31:41.687" Score="2" ViewCount="384" Body="&lt;p&gt;Let an implied volatility curve/surface is made up by optionlets or swaptions Black's implied volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you wanted to price, say, a FRN with cap and/or floor, a CMS &lt;em&gt;et cetera&lt;/em&gt; you would input the array/matrix filled by that IV curve/surface in you pricing model: regardless of the model, it's very likely it takes as input that curve/surface.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;is it actually possible to find a &lt;strong&gt;constant&lt;/strong&gt; volatility value which&#xA;returns a fair value close enough to the one obtained via&#xA;curve/surface? (*)  &lt;/li&gt;&#xA;&lt;li&gt;If said value existed, how would it be? Could it&#xA;be a weighted average of all the curve/surface implied volatilities?&#xA;Or just the ATM ones?&lt;/li&gt;&#xA;&lt;li&gt;If said value existed and it could be expressed&#xA;by a weighted average, how the weights should be? Maybe something&#xA;related to swaptions options &amp;amp; swap tenors? Something else?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(*) When I say «close enough» I mean that I would be okay with a rough and/or heuristic proxy, too. I do not actually need any accurate value.&lt;/p&gt;&#xA;" OwnerUserId="3058" LastActivityDate="2014-04-03T12:31:41.687" Title="Weighted average implied optionlet/swaptions volatility" Tags="&lt;implied-volatility&gt;&lt;derivatives&gt;&lt;swaption&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10805" PostTypeId="1" CreationDate="2014-04-03T14:31:38.603" Score="0" ViewCount="759" Body="&lt;p&gt;I am trying to reproduce a method presented in a scientific paper. They used the following dataset:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;daily closing prices of S&amp;amp;P500 stocks (the first 100, alphabetically by ticker, with a full year of data from Jan 9, 1998 to Jan 8, 1999)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea of how to go about getting these data? I have two problems:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;What were the components &amp;amp; ticker symbols then?&lt;/li&gt;&#xA;&lt;li&gt;Is the data too old to be accessible free of charge?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If there is an easy routine in python or R to get this dataset that would be more than welcome. Otherwise I can cobble one together once I know how to solve the above two issues.&lt;/p&gt;&#xA;" OwnerUserId="7677" LastActivityDate="2014-04-04T02:31:08.313" Title="S&amp;P500 components at specific date" Tags="&lt;historical-data&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ClosedDate="2014-04-04T12:23:43.153" ContentLicense="CC BY-SA 3.0" />
  <row Id="10806" PostTypeId="2" ParentId="10795" CreationDate="2014-04-03T14:37:12.073" Score="2" Body="&lt;p&gt;I'll try to anwswer too. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) You seem to try to interpret implied volatility as having a statistical nature. In fact implied volatility is nothing but (today's) market prices except that you look at them through Black and Scholes &quot;glasses&quot;. Why the Black-Scholes model? There are many reasons for that.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;this is the simplest sensible model: basically you just assume that log-returns are iid normally distributed. &lt;/li&gt;&#xA;&lt;li&gt;you get a clear interpretation of sensitivities and how to hedge the different risks (the most basic example being Delta = derivative of option price w/r to asset price = amount of stock needed to hedge)&lt;/li&gt;&#xA;&lt;li&gt;you get closed formula for calls and puts (you can actually read the replicating portfolio on this formula)  &lt;/li&gt;&#xA;&lt;li&gt;you get the probabilistic and the PDE approach.&lt;/li&gt;&#xA;&lt;li&gt;and you get all that with basically a single parameter to calibrate: the volatility. So all other things being fixed, you get a one to one correspondance between call (or put) prices and volatility. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As convenient as it is, this model is way too simplistic for many well known reasons (fat tails volatility clustering etc...) but a simple model beats an accurate one if the latter isn't useful for the practionner. Implied volatility allows you to import the understanding you get from Black-Scholes into more realistic models. For example, it gives you a natural and visual idea of how far your stock returns are from being normally distributed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) As you said calibration on historical data is bad because it simply doesn't work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all there is a practical problem: you have to obtain and treat your historical data. In particular you have to chose a range, sampling frequency and estimator. A typical problem is that if your window is too small you will get a poor estimation, but if your window is too large you will adapt to market changes only days after they occur (same problem with VaR estimation).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That being said there is a more fundamental explanation based on the market efficiency hypothesis which says that all available information is incorporated in the current price (One can debate about the accuracy of this hypothesis. I consider it as a good rule of thumb). This means that all the work you might do to calibrate based on historical data is pointless since all the past information is already in the current price or equivalently in the implied volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the fact that models are Markovians is actually an argument for the implied approach rather than the historical one. You want to make predictions about the future and by definition a markovian process's future only depends of its past through its current state so you should focus on the present (current price = implied volatility) rather than the past (historical data).      &lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2018-05-12T10:30:59.527" LastActivityDate="2018-05-12T10:30:59.527" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="10807" PostTypeId="2" ParentId="10795" CreationDate="2014-04-03T15:21:58.503" Score="4" Body="&lt;p&gt;we use implied vol for similar reasons why we use duration. we know that security prices are not linear functions of rates, yet we look at the duration, because it gives us an idea of sensitivity to a rate. implied vol gives you a measure of volatility, it doesn't perfectly describe it, but as long as we know this, it's still a valuable metric.&lt;/p&gt;&#xA;" OwnerUserId="7365" LastActivityDate="2014-04-03T15:21:58.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10808" PostTypeId="1" AcceptedAnswerId="10831" CreationDate="2014-04-03T15:34:33.597" Score="3" ViewCount="1109" Body="&lt;p&gt;I read the Euan Sinclair's book (Volatility trading) in which he suggests different volatility estimators (Close-to-close, Parkinson, Garman-Klass, ...).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am inquiring about what is the best stock volatility measure to explain, let's say, the stock price returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's suppose that I want to test the effect of stock market volatility changes on stock market returns using the following model:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;R(t) = α + β*VOL(t) + ε(t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where R(t) is the stock returns in time t and VOL(t) is the volatility in time t.&#xA;As suggested by Sinclair, there're different volatility measures. &#xA;My question is what proxy measure I choose among all to describe in the best way this relationship among volatility and stock returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does it makes sense to regress the stock returns on the single volatility measures and so to compare the related t-statistics (or p-values) and the R^2 of each model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or does there exist a statistical technique to do this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for all the help you'll give me.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2014-04-04T16:22:10.470" LastActivityDate="2018-01-02T00:53:02.920" Title="How to compare different volatility measures?" Tags="&lt;volatility&gt;&lt;equities&gt;&lt;statistics&gt;&lt;risk-models&gt;&lt;econometrics&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10809" PostTypeId="2" ParentId="10794" CreationDate="2014-04-03T18:29:24.710" Score="2" Body="&lt;p&gt;American Options are a tricky subject and pricing them is almost never easy. A lot depends on the model etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming you that you a familiar with monte carlo and that you know the risk neutral dynamics of your porcess - you could use monte carlo least squares.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The paper on the topic is easily accesible and not too technical. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suggested reading: &lt;a href=&quot;http://www.math.ethz.ch/~hjfurrer/teaching/LongstaffSchwartzAmericanOptionsLeastSquareMonteCarlo.pdf&quot; rel=&quot;nofollow&quot;&gt;Valuing American Options by Simulation: A Simple Least-Squares Approach&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-04-03T18:29:24.710" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10810" PostTypeId="1" AcceptedAnswerId="10812" CreationDate="2014-04-03T18:52:34.770" Score="1" ViewCount="323" Body="&lt;p&gt;Why is there systematic negative divergence between the VIX index and the VXX ETF meant to track it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://finance.yahoo.com/q/bc?s=%5EVIX&amp;amp;t=5y&amp;amp;l=on&amp;amp;z=l&amp;amp;q=l&amp;amp;c=vxx&quot; rel=&quot;nofollow&quot;&gt;http://finance.yahoo.com/q/bc?s=%5EVIX&amp;amp;t=5y&amp;amp;l=on&amp;amp;z=l&amp;amp;q=l&amp;amp;c=vxx&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7709" LastActivityDate="2014-04-03T20:31:07.100" Title="Why systematic divergence between ^VIX and VXX?" Tags="&lt;vix&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10811" PostTypeId="2" ParentId="10800" CreationDate="2014-04-03T19:37:19.080" Score="2" Body="&lt;p&gt;Some more concrete sources on Barrier option in the B&amp;amp;S setting and PDEs&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.51.3560&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow&quot;&gt;PDE methods for pricing barrier options (quite technical)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.maths.usyd.edu.au/u/pubs/publist/preprints/2004/buchen-39.pdf&quot; rel=&quot;nofollow&quot;&gt;Pricing Europ ean Barrier Options&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;More of a general remark to PDE approaches in finance&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ilya as far as I know the literature on that topic is quite limited. Solving a PDE means solving a PDE - it does not matter in which context. Most economists leave the solving of PDEs if they arise in a pricing context to pure mathematicians. This is why almost no finance book will teach you how to solve one explictly - this is either something you learn in pure math or physics or delgegate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think you are might be interested in &quot;interfacing theorems&quot; like &lt;a href=&quot;http://en.wikipedia.org/wiki/Feynman%E2%80%93Kac_formula&quot; rel=&quot;nofollow&quot;&gt;Feynman-Kac&lt;/a&gt; that establish the link between pricing and PDE. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also to my knowledge there is no unifying PDE-based approach to pricing derivatives.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still there are some books that have more extensive sections on PDE-theory e.g. &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/8847017807&quot; rel=&quot;nofollow&quot;&gt;PDE and Martingale Methods in Option Pricing&lt;/a&gt;&#xA;You might also find the &lt;a href=&quot;https://cermics.enpc.fr/reports/CERMICS-2007/CERMICS-363.pdf&quot; rel=&quot;nofollow&quot;&gt;following report&lt;/a&gt; quite comprehensive. (The focus however is not on finding closed-form solution but rather on numerical schemes)&lt;/p&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="6781" LastEditDate="2014-04-09T09:27:06.317" LastActivityDate="2014-04-09T09:27:06.317" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10812" PostTypeId="2" ParentId="10810" CreationDate="2014-04-03T20:31:07.100" Score="5" Body="&lt;p&gt;Because VXX is not designed to track the spot VIX. &lt;a href=&quot;http://blogs.cfainstitute.org/insideinvesting/2014/02/12/doing-what-it-says-on-the-tin-the-value-of-volatility-etps/&quot;&gt;http://blogs.cfainstitute.org/insideinvesting/2014/02/12/doing-what-it-says-on-the-tin-the-value-of-volatility-etps/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2378" LastActivityDate="2014-04-03T20:31:07.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10814" PostTypeId="2" ParentId="10805" CreationDate="2014-04-04T02:31:08.313" Score="1" Body="&lt;p&gt;I don't know about free of charge, but if you're subscribed to WRDS or similar data sources, then &lt;a href=&quot;http://faq.library.upenn.edu/recordDetail?id=36133&amp;amp;action=&amp;amp;library=manchester_business&amp;amp;institution=manchester&quot; rel=&quot;nofollow&quot;&gt;here's&lt;/a&gt; how to get the historical S&amp;amp;P 500 constituents data&lt;/p&gt;&#xA;" OwnerUserId="7365" LastActivityDate="2014-04-04T02:31:08.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10815" PostTypeId="1" AcceptedAnswerId="10821" CreationDate="2014-04-04T07:44:29.007" Score="1" ViewCount="144" Body="&lt;p&gt;I am looking for efficient numerical approaches for pricing American options when two or more sources of noise are involved (the simplest case coming to mind would be the Heston Model)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Eventhough I am familiar with lattice methods I don't see how this could work in a &quot;poly-noise&quot; setting. A solution might present itself in the form of MCLSQ (Monte Carlo Least Squares). To my knowldge this method however produces somewhat large deviations ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Questions:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What are the prevaliant approaches to dealing with this type of situation numerically ?&lt;/li&gt;&#xA;&lt;li&gt;How does&#xA;one benchmark these approximating algorithms if no close form&#xA;solution for the option-price exists ?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="7712" LastEditorUserId="7712" LastEditDate="2014-04-04T11:18:43.290" LastActivityDate="2014-04-04T12:50:47.620" Title="Efficient numerical approaches for pricing American Options with multiple sources of noise" Tags="&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;american-options&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10816" PostTypeId="2" ParentId="10815" CreationDate="2014-04-04T09:54:39.280" Score="1" Body="&lt;p&gt;Regarding your second question: one possible approach is to reduce the instrument you are trying to value to something simpler, for which an analytical solution are an alternative methodology does exist. You can then vary parameters and check that the valuation is behaving as expected. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are using simulations because your price process is more complicated, you can generally tweak the parameters so that it reduces to some other process, which allows an alternative valuation method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answer is a bit generic, but your question does not have a lot of detail either.&lt;/p&gt;&#xA;" OwnerUserId="7713" LastActivityDate="2014-04-04T09:54:39.280" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10819" PostTypeId="1" CreationDate="2014-04-04T11:34:18.167" Score="8" ViewCount="512" Body="&lt;p&gt;R that originated as a purely statistical tool has meanwhile blossomed into a comprehensive workbench for different tasks. &#xA;I am familiar with Mathematica and don't like how it forces a license on you. Also the handling of big data and outputting of tables ins quite cumbersome in my opinion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Meanwhile R offers (beside the statistical tools) via different packages&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Some support for object oriented coding approach&lt;/li&gt;&#xA;&lt;li&gt;Monte Carlo generators galore &lt;/li&gt;&#xA;&lt;li&gt;Optimization packages &lt;/li&gt;&#xA;&lt;li&gt;Numerical Integration&lt;/li&gt;&#xA;&lt;li&gt;…&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What functionalities is R still lacking that one needs for everyday quant work?&#xA;&lt;em&gt;Here &quot;functionalities&quot; also encompass interfaceablity  with C++, C#, speed and&#xA;ease of use.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="7712" LastEditorUserId="467" LastEditDate="2014-04-04T14:30:49.647" LastActivityDate="2014-04-07T12:16:12.427" Title="What quant-related functionalities is R lacking compared to commercial software like Mathematica and Matlab?" Tags="&lt;programming&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10820" PostTypeId="2" ParentId="10572" CreationDate="2014-04-04T12:17:49.770" Score="3" Body="&lt;p&gt;Answering my own question:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;use &lt;code&gt;qlFloatingRateBond&lt;/code&gt; and pass it a range of strikes (one for each coupon) for both Caps and Floors arguments&lt;/li&gt;&#xA;&lt;li&gt;use &lt;code&gt;BondEngine&lt;/code&gt; as pricing engine&lt;/li&gt;&#xA;&lt;li&gt;use &lt;code&gt;IborCouponPricer&lt;/code&gt; with Type argument equal to &quot;IborByBlack&quot; as coupon pricer - This pricer also takes an &lt;code&gt;OptionletVolatilitySurface&lt;/code&gt; as input&lt;/li&gt;&#xA;&lt;li&gt;the &lt;code&gt;OptionletVolatilitySurface&lt;/code&gt; can be created by an &lt;code&gt;OptionletStripper1&lt;/code&gt; from a &lt;code&gt;CapFloorVolTermSurface&lt;/code&gt;, (NB. We have to use the &lt;code&gt;StrippedOptionletAdapter&lt;/code&gt; to mold the &lt;code&gt;OptionletStripper1&lt;/code&gt; object into an &lt;code&gt;OptionletVolatilitySurface&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;create a &lt;code&gt;CapFloorVolTermSurface&lt;/code&gt; with data, e.g., from ICAP (on Bloomberg terminals, these can be found in &lt;code&gt;VOLS&lt;/code&gt;), making sure that the IborIndex argument has the same tenor as the input data, i.e., 1Y&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1132" LastActivityDate="2014-04-04T12:17:49.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10821" PostTypeId="2" ParentId="10815" CreationDate="2014-04-04T12:50:47.620" Score="2" Body="&lt;p&gt;Generally speaking, if you have two or three sources of noise, you are still going to be &lt;em&gt;much&lt;/em&gt; better off pricing American options on a lattice than via LSMC.  Too often, LSMC becomes the refuge of academics lacking patience to learn proper lattice techniques.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, you can frequently reduce the difficulty of pricing American options by considering the &lt;em&gt;american exercise premium&lt;/em&gt; $P$, defined as the difference in value between an american-exercise option and its european-exercise equivalent&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;P = A - E&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have some complicated stochastic model, but enjoy a technique $f(\cdot)$ for pricing european-exercise options&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\tilde{E} = f(x_E;\vec\mu)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and you can define some much simpler model $g(\cdot)$ that is good enough for estimating the premium&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\tilde{P} \approx g(x_A; \vec\nu) - g(x_E; \vec\nu)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then your american option price can be estimated as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\tilde{A} \approx \tilde{E}  + \tilde{P}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the american exercise premium is large then relative error in $\tilde{P}$ will be important and this trick will not work as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, if exercise probability is large, or exercise is likely to happen long before the option tenor, then the trick will fail, since we have introduced a dependency on $\vec\mu$ at (european) timescales well past the relevant timescales for the actual american option.  &lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2014-04-04T12:50:47.620" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10822" PostTypeId="2" ParentId="10642" CreationDate="2014-04-04T13:27:04.780" Score="2" Body="&lt;p&gt;Answering my own question:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;All the indicated numbers as obtained from ICAP need to be divided by 100, as they are percentages&lt;/li&gt;&#xA;&lt;li&gt;The &lt;code&gt;OptionletStripper1&lt;/code&gt; takes an IborIndex, which should have a tenor equal to 1Y. I had set it to 6M, and that seemed to cause problems&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Ouch!&lt;/p&gt;&#xA;" OwnerUserId="1132" LastActivityDate="2014-04-04T13:27:04.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10823" PostTypeId="2" ParentId="10819" CreationDate="2014-04-04T15:31:08.850" Score="-3" Body="&lt;p&gt;the main thing that R is lacking is the proper help and product documentation in comparison to Stata, Matlab, SAS and similar commercial software.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;there's a package called OxMetrics, which has an interesting algebraic approach to model specification and scripting. it's hard to explain, but when you use it, it saves a lot of time, because it automates a typical model development life-cycle tasks and steps. I haven't seen a similar functionality in R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE: if you speak with R enthusiasts they may say that R has all functionality you need through user supplied libraries. it's a truly open source platform, which comes under &lt;a href=&quot;http://www.r-project.org/COPYING&quot; rel=&quot;nofollow&quot;&gt;GNU license&lt;/a&gt;. the open source developers never complain for the lack of functionality, because when they do the standard answer is &quot;why don't you write this module and contribute?&quot; and this is the great attitude, which keeps the community engaged. however, this makes your question somewhat poorly defined, because as i noted, one could claim that any functionality is either already there in some form, or &quot;why don't you write this yourself?&quot; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, maybe you should clarify a bit what do you mean by &quot;lacking&quot; functionality. e.g. I doubt that R has anything close to Mathematica's computer algebra capabilities, but I'm pretty sure someone somewhere might have written something to integrate it with REDUCE or other open-source package.&lt;/p&gt;&#xA;" OwnerUserId="7365" LastEditorUserId="7365" LastEditDate="2014-04-05T13:26:27.717" LastActivityDate="2014-04-05T13:26:27.717" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="10824" PostTypeId="1" CreationDate="2014-04-04T16:23:35.620" Score="1" ViewCount="1207" Body="&lt;p&gt;By using &lt;code&gt;http://finance.yahoo.com/d/quotes.csv?s=STOCKNAME&amp;amp;f=&lt;/code&gt;I am able to download a CSV file, does anyone know what the symbol for beta is? It should go after &lt;code&gt;&amp;amp;f=&lt;/code&gt; e.g. the symbol for the stock name is &lt;code&gt;n&lt;/code&gt; and it goes in as such: &lt;code&gt;http://finance.yahoo.com/d/quotes.csv?s=STOCKNAME&amp;amp;f=n&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance for your help!&lt;/p&gt;&#xA;" OwnerUserId="7717" LastActivityDate="2014-04-04T16:23:35.620" Title="Downloading Quotes in CSV format from Yahoo Finance - Beta symbol?" Tags="&lt;beta&gt;&lt;yahoo&gt;&lt;quote&gt;&lt;csv&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10826" PostTypeId="1" CreationDate="2014-04-04T16:51:58.213" Score="3" ViewCount="124" Body="&lt;p&gt;Obviously, when ownership of some security is transferred from party A to party B, both parties' balances must be updated and recorded in an atomic transaction. Call this &quot;an execution&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in an exchange, what conditions dictate the moment a trade is actually executed? Specifically, are there a fixed number of &quot;trading moments&quot; during a day, or is it all &quot;fluid&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or asked another way, do executions take place as soon as possible when buy/sell price conditions are met? Or are there a fixed number of execution timeslots in the course of a day in which buyer/seller matchups are sought?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any resources appreciated. If the exchanges were open-source, I'd go read the code. ;-)&lt;/p&gt;&#xA;" OwnerUserId="7716" LastActivityDate="2014-04-07T11:15:00.967" Title="When do trades actually execute on an exchange?" Tags="&lt;exchange&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10827" PostTypeId="2" ParentId="4609" CreationDate="2014-04-04T21:45:54.307" Score="2" Body="&lt;p&gt;Richard nails it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One needs to distinguish the forward price (or just &quot;forward&quot;), which is a number that denotes at which strike you can now enter a forward without upfront payment, and the value of a forward contract, which is typically zero at inception (if the strike chosen is indeed the forward price), but then varies over time, and ends up as $S(T) - K$ at T, with whatever strike K was chosen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, if there are no dividends and other cost of carry besides rates r, the forward price at 0 for expiry T is indeed $K = S(0) e^{rT}$, and thus the value at time $t$ of a forward contract expiring at time $T$ that was entered at time 0 is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S(t) - S(0)e^{rt}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which, incidentally, shows nicely that a forward has a delta of 1, at least in the absence of dividends and other distractions (which is why, incidentally, I think delta-one desks should be renamed to gamma-zero... :-)&lt;/p&gt;&#xA;" OwnerUserId="7715" LastActivityDate="2014-04-04T21:45:54.307" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10828" PostTypeId="2" ParentId="7082" CreationDate="2014-04-04T21:53:01.657" Score="1" Body="&lt;p&gt;It's pretty straightforward to replicate (in theory!) by just buying a call struck at b, and another one struck at b+1, and another one struck at b+2, and another one struck at b+3, and so on, and then buy a put struck at b, and another one struck at b-1, and another one struck at b-2, etc., and then scaling the whole thing and adding c.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can easily construct any European payoff, i.e. any payoff that is some function f(S(T)) for a fixed T, if you have call options (expiring at T) at any strike available.&lt;/p&gt;&#xA;" OwnerUserId="7715" LastActivityDate="2014-04-04T21:53:01.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10830" PostTypeId="1" AcceptedAnswerId="11164" CreationDate="2014-04-05T03:02:41.433" Score="3" ViewCount="574" Body="&lt;p&gt;How do i test the significance of Sharpe ratio of a strategy whether it is any different from another strategy ?? How do i get a p-value out of it ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What should be the H0 in the hypothesis testing ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was hinted by my professor that i would require bootstrap&lt;/p&gt;&#xA;" OwnerUserId="6131" LastActivityDate="2014-05-05T03:48:07.243" Title="How do i test the significance of Sharpe ratio of a strategy using bootstrap" Tags="&lt;bootstrap&gt;&lt;sharpe&gt;&lt;ratio&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10831" PostTypeId="2" ParentId="10808" CreationDate="2014-04-05T11:01:16.910" Score="1" Body="&lt;p&gt;In most of the literature on the information content of various volatility estimator the relevant question is whether a particular estimator can predict (is correlated) with future realized volatility. Hence, the testing regression would be&#xA;$$ RV(t,T) = \alpha + \beta VOL(t) + \epsilon(t) $$&#xA;where RV(t,T) is an estimate of the realized volatility from t to T, usually either from 5 minute tick data or daily closing prices. This regression is a backtest whether your VOL estimator at time t is actually predictive of subsequent volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A different test would be to run a multiple regression&#xA;$$ RV(t,T) = \alpha + \beta_1 VOL_1(t) + \dots + \beta_K VOL_K(t) + \epsilon(t) $$&#xA;with K different volatility estimators to test if one (or some) VOL estimators subsume the information of others.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Testing whether volatility is able to predict returns is a different question, either related to the leverage effect of volatility feedbacks. A nice paper in this regard&#xA;is &lt;a href=&quot;https://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=2&amp;amp;ved=0CDYQFjAB&amp;amp;url=http://rfs.oxfordjournals.org/content/13/1/1.abstract&amp;amp;ei=M-I_U_KHN-zY4QSIj4HwBQ&amp;amp;usg=AFQjCNEKV17wrAnJoE0MLjJB7nclDBEk8A&amp;amp;sig2=Fc2_99cMv1e6mgKHCpJ6Cw&amp;amp;bvm=bv.64125504,d.bGE&amp;amp;cad=rja&quot; rel=&quot;nofollow&quot;&gt;Bekaert and Wu (2000)&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7396" LastActivityDate="2014-04-05T11:01:16.910" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10832" PostTypeId="1" CreationDate="2014-04-05T13:04:56.570" Score="2" ViewCount="15160" Body="&lt;p&gt;Given sales and profitability data for two time periods, how would I go about calculating the impact of price, cost, volume and mix margin % (bps)? I can do the analysis as a gross margin $ bridge, but I'm unable to convert that to margin %.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to create something like this: &lt;a href=&quot;http://www.pwc.com/en_GX/gx/technology/publications/assets/technology-news-gross-margin-analysis.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.pwc.com/en_GX/gx/technology/publications/assets/technology-news-gross-margin-analysis.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at that analysis, I can't reconcile how $2.5M in price be favorable 120 bps to margin. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Std Margin of \$174.2m (57.2%) &lt;br&gt;&#xA;Price of \$2.5m (1.2%)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would suggest that margin after the price change is 58.4%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Working backwards&#xA;Std Margin of $174.2 at 57.2% would mean:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Revenue: \$304.54m (174.2 / .572)&lt;br&gt;&#xA;Cost: $130.34m&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A $2.5m price increase would be 174.2+2.5 = 176.7m of margin on 304.54+2.5 = 307.04m revenue, which is only 57.5% margin or 30 bps difference. How does 120 bps get derived?&lt;/p&gt;&#xA;" OwnerUserId="7724" LastEditorUserId="7724" LastEditDate="2014-04-05T13:22:52.607" LastActivityDate="2021-02-18T16:04:40.460" Title="Margin % Bridge - Effect of Price, Cost, Volume" Tags="&lt;margin&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10833" PostTypeId="2" ParentId="10819" CreationDate="2014-04-05T15:36:14.180" Score="7" Body="&lt;p&gt;For Windows - Parallel processing and GPU computing - are two areas. R has numerous packages for parallel processing but all of them require you to replicate the whole environment for each worker which massively degrades the performance of parallel processing and in most real life cases, there is almost no speed up because of the reduced memory available to each worker. It's getting better in R but still far behind Matlab's super easy parfor function that doesn't need to replicate the environment for every worker.&lt;/p&gt;&#xA;" OwnerUserId="5948" LastEditorUserId="5948" LastEditDate="2014-04-05T23:50:42.880" LastActivityDate="2014-04-05T23:50:42.880" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10837" PostTypeId="1" CreationDate="2014-04-06T01:59:26.247" Score="1" ViewCount="102" Body="&lt;p&gt;Is there a way to find the Producer price index for a commodity during two different years by using the NAICS code of the commodity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I know the NAICS code for cast iron steel bearings as 332991P and I want to find the PPI for it in 2002 and 2014. I tried to use the Bureau of Labor Statistics Websites but It it much more confusing than I thought it would be&lt;/p&gt;&#xA;" OwnerUserId="5042" LastActivityDate="2014-04-06T01:59:26.247" Title="Having trouble finding PPI for commodity using NAICS code" Tags="&lt;commodities&gt;&lt;products&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10838" PostTypeId="1" AcceptedAnswerId="11298" CreationDate="2014-04-06T02:37:47.917" Score="2" ViewCount="640" Body="&lt;p&gt;when I using Bloomberg excel plugins to retrieve the ticks and compare with Reuter RDF data, for some UK equity stocks in same days, the number of ticks and sum of total value is difference, why will that happen? &lt;/p&gt;&#xA;" OwnerUserId="7730" LastActivityDate="2015-03-14T11:37:07.843" Title="Bloomberg ticks is difference from Reuter ticks?" Tags="&lt;equities&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10839" PostTypeId="2" ParentId="10826" CreationDate="2014-04-06T11:10:04.640" Score="3" Body="&lt;p&gt;It's exchange dependent. An answer to each question which applies to every exchange doesn't exist. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But for the major developed world exchanges, execution happens in continuous time and not discrete time and transaction will occur instantaneously when conditions are met (e.g. a buyer crosses the spread). So a few nanoseconds or microseconds after the buy message reaches the exchange matching engine (as fast as the exchange is able to process the message). The exchange will usually then send a trade confirmation message to all participants which is received (assuming colo) less than 1 milliseconds afterwards (or an update from which this trade can be deduced as having just occurred).&lt;/p&gt;&#xA;" OwnerUserId="6081" LastEditorUserId="6081" LastEditDate="2014-04-07T11:15:00.967" LastActivityDate="2014-04-07T11:15:00.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10841" PostTypeId="1" AcceptedAnswerId="10845" CreationDate="2014-04-06T14:06:02.170" Score="3" ViewCount="318" Body="&lt;p&gt;We have a stock at price 1 dollar which pays no dividend. Also we assume zero interest rate. When the price hits $H$ dollars for the first time where $H&amp;gt;1$, we can exercise the option and receive 1 dollar. What is the price of the option?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can price this option assuming the stock price follows a geometric brownian motion under risk neutral measure which gives me the price as $\frac{1}{H}$. I am curious if we can price this option without this assumption, using only no arbitrage principle.&lt;/p&gt;&#xA;" OwnerUserId="6055" LastActivityDate="2014-04-07T06:59:47.960" Title="How to price this option without using BS framework" Tags="&lt;option-pricing&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10842" PostTypeId="1" CreationDate="2014-04-06T18:49:01.330" Score="1" ViewCount="4630" Body="&lt;p&gt;This question is a bit confused, but please bear with me. Now and then I see people use the terminology &quot;price volatility&quot; and &quot;yield volatility&quot; in connection with bond options. I understand the concept of implied volatility for equity options, and I know that option prices are often quoted in terms of their implied volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this something similar? Take a Bond options for example. Given a market price in e.g. EUR it is possible (analogues to equity options using Black-Scholes) to find an implied volatility (using Black-76). I guess this is the so called price (bond) volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when it comes to the so called &quot;yield volatility&quot;. I cannot understand how these are implied. I have spent some time on Google trying to find a solid source where I can read more about this, but I can't find it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance for any assistance!&lt;/p&gt;&#xA;" OwnerUserId="2376" LastActivityDate="2018-10-06T12:17:32.710" Title="Price volatility and yield volatility" Tags="&lt;options&gt;&lt;volatility&gt;&lt;implied-volatility&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10843" PostTypeId="2" ParentId="10842" CreationDate="2014-04-06T20:29:54.963" Score="1" Body="&lt;p&gt;They are not referring to any implied volatility but actual volatility, i.e. statistical standard deviation. The price volatility is the annualized standard deviation of bond price changes and the yield volatility the annualized standard deviation of bond yield changes. These quantities are usually estimated using a historical estimator. If you have n observations of a quantity X with a sample mean of $\bar{x}$ then its standard deviation is estimated as:&#xA;$$ \hat{\sigma}_x = \left( \frac{1}{n-1} \sum_{i=1}^{n} (x_i-\bar{x})^2\right)^{\frac{1}{2}}$$&#xA;Most frequently, daily closing price/yield observations are used in which case you have to multiply with $\sqrt{N}$ where N are the number of days per year (depending on the day count convention).&lt;/p&gt;&#xA;" OwnerUserId="7396" LastActivityDate="2014-04-06T20:29:54.963" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10844" PostTypeId="1" CreationDate="2014-04-07T02:49:07.930" Score="4" ViewCount="1270" Body="&lt;p&gt;I am reading a paper that very briefly talks about some volatility arbitrage strategies. It's so brief that I do not exactly understand how it works. It says one of the strategy is based on &quot;short spot index volatility, long on implied volatility&quot; on the premise that IV &gt; realized volatility. I know how one can trade implied volatility (using a delta-hedged option portfolio), but how can I trade spot volatility?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other arbitrage strategy is supposedly based on volatility smile: &quot;short stock smile, long stock volatility&quot;. So unless there is a way to trade spot volatility, this seems like a contradiction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to trade spot volatility?&lt;/p&gt;&#xA;" OwnerUserId="2916" LastActivityDate="2019-08-27T14:05:38.290" Title="Trading spot volatility" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;arbitrage&gt;&lt;volatility-smile&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10845" PostTypeId="2" ParentId="10841" CreationDate="2014-04-07T06:59:47.960" Score="4" Body="&lt;p&gt;The dynamics of the underlying stock process are obviously crucial to the derivative's price. Thus if you don't necessarily assume $S_t$ to be log normally distributed (B&amp;amp;S-Model) you won't get the same price even if the market is arbitrage free.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&#xA;Assume $S_t=C$ $ \forall t \in \mathbb{R}^+$ and $r=0$.  Thus $S_t$ is constant and the interest rate equals zero. In this setting $S_t$ will be a martingale under the bank account numeraire. To be more precise &#xA;$$E\left[e^{-\int^t_0 r_s ds}S_t |\mathcal{F}_u\right]=E\left[e^{-\int^t_0 0 ds}C|\mathcal{F}_u\right]=C$$. Now with $S_t$ being contant this mmeans&#xA;$$E\left[e^{-\int^t_0 r_s ds}S_t |\mathcal{F}_u\right]=S_u$$&#xA;By the first fundamental theorem of asset pricing our market is thus free of arbitrage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let us assume we are pricing the instrument described in your question. And let $H&amp;gt;C$.&#xA;&lt;em&gt;Obviosuly it's price is obiously equals zero&lt;/em&gt; for the proces is constant and will never hit the &quot;knock-in-boundary&quot; $H$&lt;/p&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-04-07T06:59:47.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10846" PostTypeId="1" CreationDate="2014-04-07T09:07:09.940" Score="6" ViewCount="194" Body="&lt;p&gt;Seeing how very few actually read the Quant Finance meta I intentionally post it here on the main site.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;To the more powerful admins:&lt;/strong&gt; &#xA;could you leave it here for a day or two and move it to meta afterwards? (please) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On Area51 I was told to &lt;a href=&quot;https://quant.meta.stackexchange.com/questions/1396/when-are-we-going-to-graduate&quot;&gt;post the question on Meta&lt;/a&gt; - perhaps we can raise awareness of the Quant SE staff via some views or votes. I must admit I have no idea whome to ask to get genuin &lt;strong&gt;&lt;em&gt;feedack on what the site is lacking from the perspektive of the SE-Staff&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="-1" LastEditDate="2017-03-16T15:46:50.533" LastActivityDate="2014-04-07T15:51:54.170" Title="Graduating Quantitative Finance (please don't move it to meta immidiately)" Tags="&lt;general&gt;" AnswerCount="0" CommentCount="9" FavoriteCount="1" ClosedDate="2016-03-12T17:35:19.290" ContentLicense="CC BY-SA 3.0" />
  <row Id="10847" PostTypeId="2" ParentId="10819" CreationDate="2014-04-07T11:30:27.327" Score="2" Body="&lt;p&gt;I use both R and Matlab. In my experience Matlab is often more convenient for optimization problems. For example the excellent convex optimization software &lt;a href=&quot;http://cvxr.com/cvx/&quot; rel=&quot;nofollow&quot;&gt;cvx&lt;/a&gt; is written in Matlab. There are also quite a few quants who publish their code in Matlab.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also debugging in R can be painful - I like R apart from these quibbles.&lt;/p&gt;&#xA;" OwnerUserId="6721" LastEditorUserId="6721" LastEditDate="2014-04-07T12:16:12.427" LastActivityDate="2014-04-07T12:16:12.427" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10848" PostTypeId="1" AcceptedAnswerId="10850" CreationDate="2014-04-07T12:21:45.640" Score="1" ViewCount="121" Body="&lt;p&gt;This it taken from &quot;Heard on the Street&quot;, Section B. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Consider a market with $0$ risk-free rate, no transactions costs etc. The IBM stock costs \$75 and does not pay dividends. Design a security which pays \$1 if IBM stock reaches \$100. What does it cost? &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The answer is \$.75 which can be proved by no-arbitrary considerations. At the same time, risk-neutral pricing suggests that the price is&#xA;$$&#xA;  \mathsf P\{\text{IBM has hit \$100 at least once}\} = 1.&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="464" LastActivityDate="2014-04-07T13:07:39.333" Title="Simple pricing example confusion" Tags="&lt;option-pricing&gt;&lt;arbitrage&gt;&lt;pricing&gt;&lt;risk-neutral-measure&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10849" PostTypeId="1" CreationDate="2014-04-07T12:48:34.503" Score="1" ViewCount="715" Body="&lt;p&gt;I'd like to evaluate 3-4 instruments on one price chart.&#xA;For example: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Stock A: 90,05 90,15 90,25 90,09 &lt;/li&gt;&#xA;&lt;li&gt;Stock B: 0,0045 0,0049 0,0039 0,0040&lt;/li&gt;&#xA;&lt;li&gt;Stock C: 1998,1 1998,7 1998,8 1997&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I try to use:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Ln(close) - too different values, to put them on one chart, same results with Close(0)-Average(10)&lt;/li&gt;&#xA;&lt;li&gt;returns Close(0)-Close(-1), (Close(0)-Close(-1))*100/Close(-1) - deviations are too small for evaluating&#xA;&lt;img src=&quot;https://i.stack.imgur.com/4x5hq.png&quot; alt=&quot;returns charts&quot;&gt;&#xA;Is there any way to normalize different price data on one Y axis to get look like this&#xA;&lt;img src=&quot;https://i.stack.imgur.com/pPKxo.png&quot; alt=&quot;3 stocks on one chart&quot;&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="3092" LastActivityDate="2014-04-07T21:58:53.790" Title="Different range price data on one chart" Tags="&lt;normalization&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10850" PostTypeId="2" ParentId="10848" CreationDate="2014-04-07T13:07:39.333" Score="2" Body="&lt;p&gt;As I see it the question does not enforce that the market is free of arbitrage. This is why you can get to contradicting prices. Thus you can't actually apply a risk-neutral argument here without making additional assumptions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You yourself provide the example of such an arbitrage. If the underlying process had a B&amp;amp;S dynamics you could just borrow money for free, buy the stock and wait until it hits the $100 mark.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Seeing how one does not know the dynamics of the underlying process it makes sense to enter into the static hedge of holding 0.75 of the stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Related Question:&lt;/strong&gt; &lt;a href=&quot;https://quant.stackexchange.com/questions/10338/price-an-option-and-find-a-replicating-portfolio/10384#10384&quot;&gt;Price Option and find replicating portfolio&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2014-04-07T13:07:39.333" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10851" PostTypeId="1" CreationDate="2014-04-07T15:18:15.853" Score="1" ViewCount="109" Body="&lt;p&gt;I have the following likelihood function:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/1d5Tw.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm given this information about the $\Omega$ matrix ($\boldsymbol{1}$ is a $T \times 1$ vector of ones):&#xA;&lt;img src=&quot;https://i.stack.imgur.com/YLjFa.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to be able to show that the likelihood function can be rewritten to this:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/sKuPa.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think there is a misprint in the article, hence the screen images from the article I attached are wrong, meaning that $\Omega^{-1}$ is supposed to be&#xA;$$\Omega^{-1}=\frac{1}{\sigma^2_{\varepsilon}+T\sigma^2_{c}}\boldsymbol{1}(\boldsymbol{1}'\boldsymbol{1})^{-1}\boldsymbol{1}'+\frac{1}{\sigma^2_{\varepsilon}}(I_t-\boldsymbol{1}(\boldsymbol{1}'\boldsymbol{1})^{-1}\boldsymbol{1}')$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and not as stated above. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far I've inserted the expression for $\Omega^{-1}$ in the top log-likelihood function. However, especially the last expression of the rewritten log-likelihood function bothers me, i.e. this part:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation*}&#xA;\begin{split}&#xA;...&amp;amp;&#xA;&amp;amp;+\frac{1}{2}\frac{1}{\sigma^2_{\varepsilon}}\frac{1}{N}\sum_{i=1}^{N}&#xA;\left(Y_i-\boldsymbol{1}\bar{Y}_i-\left(X_i-\boldsymbol{1}\bar{X}_i\right)\beta\right)'\left(Y_i-\boldsymbol{1}\bar{Y}_i-\left(X_i-\boldsymbol{1}\bar{X}_i\right)\beta\right).&#xA;\end{split}&#xA;\end{equation*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone see the solution?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also have this lemma, but not sure if it is to be used in the rewritting of the likelihood function:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/wlhbU.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="7078" LastEditorUserId="7078" LastEditDate="2014-04-09T10:48:37.113" LastActivityDate="2014-04-09T10:48:37.113" Title="Derivation of a ML estimator" Tags="&lt;estimation&gt;" AnswerCount="0" CommentCount="10" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10852" PostTypeId="1" AcceptedAnswerId="10857" CreationDate="2014-04-07T20:23:24.043" Score="1" ViewCount="481" Body="&lt;p&gt;I would appreciate some help with the math in this paper : &lt;a href=&quot;http://www.math.nyu.edu/faculty/avellane/HighFrequencyTrading.pdf&quot; rel=&quot;nofollow&quot;&gt;High Frequency Trading in a Limit Order Book&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, I would like to understand how the authors calculated the expected value of price at terminal time T at current time t. What substitution was made to arrive at equation (3) on page 2 (from the value function directly above?). &lt;/p&gt;&#xA;" OwnerUserId="7748" LastActivityDate="2014-04-08T10:58:27.827" Title="Simple question about expected value of brownian motion" Tags="&lt;brownian-motion&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10853" PostTypeId="1" CreationDate="2014-04-07T20:27:38.470" Score="2" ViewCount="1471" Body="&lt;p&gt;Consider first the simple convergent strategy to invest some amount $X$ in a game, if you win you simply take the winnings and keep playing a subsequent game. In the case of a loss, you believe in your belief and doubles up in the same game until finally you win. This strategy would mostly experience small winnings up until some point when the losses are huge, in other words the distribution is heavily left skewed with a fat tail. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now consider the divergent strategy to double winnings in case the game is won, i.e. holding on winners, and turn to the subsequent game in case of a loss. This strategy does instead experience small losses up until some rare occasions when there are huge winnings. The distribution of the divergent strategies is instead heavily right skewed, also with fat tails. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Going long in options, anticipating these rare events when the stock price plummets/sky rockets, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reality is rarely black and white, and more often than not you'll probably not able to classify more complex strategies as either divergent or convergent. But in general, is there any tendency in the hedge fund industry to prefer one over the other. It feels like there are a lot of greedy managers who would prefer earning lots of money fast, then there is this rare event which causes the fund to experience great losses and possibly even go bankrupt. However, it feels like the divergent strategy is a more sensible choice to stay competitive in the long run.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By looking at the larger and more successful managers/fund, what type of strategies do they use. &lt;/p&gt;&#xA;" OwnerUserId="4709" LastEditorUserId="6781" LastEditDate="2014-04-09T09:37:17.983" LastActivityDate="2014-04-09T09:37:17.983" Title="Divergent or Convergent Strategies? Which is the way to go?" Tags="&lt;risk&gt;&lt;strategy&gt;&lt;best-practices&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10854" PostTypeId="2" ParentId="10849" CreationDate="2014-04-07T21:58:53.790" Score="2" Body="&lt;p&gt;have you tried to rebase the timeseries? if the start and end dates are same, you could basically have 100*(1+returns). easy to then plot either directly or log of the new time series.&lt;/p&gt;&#xA;" OwnerUserId="932" LastActivityDate="2014-04-07T21:58:53.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10855" PostTypeId="2" ParentId="9495" CreationDate="2014-04-07T22:35:46.997" Score="1" Body="&lt;p&gt;In general, there cannot be a closed-form solution of a random coefficients VG model. The reason is the drift-restriction that needs to be imposed to ensure that the discounted price process is a martingale under the risk-neutral measure. Using the bank account as numeraire, the restriction is&#xA;$$ \frac{1}{\beta} &amp;gt; \theta + \frac{\sigma^2}{2} $$&#xA;where $\beta$ is the variance rate of the gamma subordinator, and $\theta$ and $\sigma$ are the drift and diffusion coefficient of the driving Brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What can be done is to make the volatility of the driving process stochastic using a second (independent) process. So you could have a square-root process driving the volatility while the main process is subordinated to a gamma time. The book by &lt;a href=&quot;http://www.worldscientific.com/worldscibooks/10.1142/7928&quot; rel=&quot;nofollow&quot;&gt;Barndorff-Nielsen and Shiryaev&lt;/a&gt;, Chapter 12, contains some hints how to do that. The procedure would be analogous to the derivation of the regular VG characteristic function, but you would get the conditional characteristic function of the stochastic volatility model chosen instead of the normal distribution characteristic function from a regular Brownian motion. If you carefully select the volatility model, you can take the expectation with respect to the gamme time and get a closed-form solution of the characteristic function.&lt;/p&gt;&#xA;" OwnerUserId="7396" LastActivityDate="2014-04-07T22:35:46.997" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10856" PostTypeId="2" ParentId="10852" CreationDate="2014-04-07T22:54:29.657" Score="1" Body="&lt;p&gt;I only glanced at it for a second.  But, looks like the underlying process is arithmetic Brownian motion, and they're computing conditional expectation of it's expectation at time t.  So, basically, use the fact that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \exp(\sigma W_t - \frac{1}{2}\sigma^2 t)$$ is a martingale, and then with the remaining independent increment, calculate directly using the pdf of the normal density.&lt;/p&gt;&#xA;" OwnerUserId="3415" LastActivityDate="2014-04-07T22:54:29.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10857" PostTypeId="2" ParentId="10852" CreationDate="2014-04-07T23:22:48.663" Score="1" Body="&lt;p&gt;The equation can easily be derived from the characteristic function of the geometric Brownian motion. As stated in the footnote, the authors use&#xA;$$ \frac{dS_t}{S_t} = \sigma dW_t $$&#xA;as the underlying model. The change in stock price $X_T = S_T - S_t$ is therefore normally distributed with mean 0 and variance $\sigma^2 (T-t)$. The characteristic function of the stock price change then follows as:&#xA;$$ \phi(u) = \mathbb{E}\left[ e^{iuX_T} \right] = e^{-\frac{1}{2} u^2 \sigma^2 (T-t)}. $$&#xA;The expression they evaluate can then be transformed as:&#xA;\begin{align}&#xA;\mathbb{E} \left[ -\exp\left\{-\gamma(x+qS_T)\right\}\right] =&amp;amp;\ -e^{-\gamma x} \mathbb{E} \left[ -\exp\left\{-\gamma q (S_T - S_t + S_t)\right\}\right] \\&#xA;=&amp;amp;\ -e^{-\gamma x} e^{-\gamma q s} \mathbb{E} \left[ -\exp\left\{-\gamma q X_T\right\}\right] \\&#xA;=&amp;amp;\ -e^{-\gamma x} e^{-\gamma q s} \phi(i\gamma q) = -e^{-\gamma x} e^{-\gamma q s} e^{\frac{1}{2} \gamma^2 q^2 \sigma^2 (T-t)}&#xA;\end{align}&lt;/p&gt;&#xA;" OwnerUserId="7396" LastEditorUserId="7396" LastEditDate="2014-04-08T10:58:27.827" LastActivityDate="2014-04-08T10:58:27.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10858" PostTypeId="1" AcceptedAnswerId="10871" CreationDate="2014-04-08T02:17:27.203" Score="8" ViewCount="1159" Body="&lt;p&gt;Many papers in the microstructure literature assume an order arrival rate of the form&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\lambda^a(\delta) = \lambda^b(\delta) = Ae^{-k\delta}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, an order that's placed $\delta$ away from the mid-price is likely to be executed with probability $Ae^{-k\delta}$. How would you choose k and A given data from a real contract?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular, this is used in the seminal paper by Avellanda and Stoikov (&lt;a href=&quot;http://www.math.nyu.edu/faculty/avellane/HighFrequencyTrading.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.math.nyu.edu/faculty/avellane/HighFrequencyTrading.pdf&lt;/a&gt;) in section 2.5&lt;/p&gt;&#xA;" OwnerUserId="5251" LastEditorUserId="7279" LastEditDate="2014-04-08T18:06:16.397" LastActivityDate="2014-04-09T16:56:02.003" Title="How do you calibrate a poisson arrival rate process?" Tags="&lt;market-microstructure&gt;&lt;limit-order-book&gt;&lt;order-execution&gt;&lt;calibration&gt;" AnswerCount="1" CommentCount="10" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10859" PostTypeId="1" AcceptedAnswerId="10866" CreationDate="2014-04-08T04:38:30.540" Score="2" ViewCount="329" Body="&lt;p&gt;In many books and derivations of the Black-Scholes PDE one sees that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Pi=V-\Delta F \Rightarrow d\Pi=dV-\Delta dF$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which implicitly assumes that $d\Delta=0$. Somewhere down the road one then deduces that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta=\frac{\partial V}{\partial F}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to simplify the equation. Doesn't this contradict the initial assumption that $d\Delta=0$? If one performs a full differentiation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Pi=V-\Delta F \Rightarrow d\Pi=dV-\Delta dF - F d\Delta$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the rest of the story goes wrong. Isn't it true that $\Delta = \Delta(t, S)$, i.e. is depending on time and the underlying stochastic process and hence has to be differentiated?&lt;/p&gt;&#xA;" OwnerUserId="7750" LastActivityDate="2014-04-08T13:38:02.683" Title="Black-Scholes derivation assumption contradiction" Tags="&lt;black-scholes&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10861" PostTypeId="1" AcceptedAnswerId="10862" CreationDate="2014-04-08T07:24:50.347" Score="4" ViewCount="1961" Body="&lt;p&gt;Taking a class in financial derivatives (book we use is Tomas Bjork´s Arbitrage theory in continuous time) but can´t understand the exact meaning of how the Wiener process is defined. In the book one can read: &quot;the Wiener process will be a continuous function of time which is nondifferentiable at every point. This a typical trajectory is a continuous curve consisting entirely of corners and it is of course quite impossible to draw a figure of such an object.&quot; Just by looking at a trajectory of a Wiener process I´ll say it is nowhere differentiable and thus non-smooth and non-continuous but here he says it is still continuous? &lt;/p&gt;&#xA;" OwnerUserId="7752" LastActivityDate="2014-04-10T11:13:35.580" Title="How can the Wiener process be nowhere differentiable but still continuous?" Tags="&lt;wiener&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10862" PostTypeId="2" ParentId="10861" CreationDate="2014-04-08T07:49:56.533" Score="3" Body="&lt;p&gt;The most basisc understanding of continuity  of curve is:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;You can draw it with a pen/pencil without lifting your hand. Thus the&#xA;  curve has no jumps that will force you to raise/shift your palm in&#xA;  order to continue drawing.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The function $f(x)=|x|$ is continuous but not differentiable at the origin. If you look at the relevant Wikipedia entries on continuity and differentiability the difference will become clear. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note that the continuity of the Brownian-Motion is the main reason why hedging in continuous time works so well theoretically. If one introduces jumps thus making the paths no longer continuous the theory becomes much more elaborate and complicated.&lt;/p&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-04-08T07:49:56.533" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10863" PostTypeId="1" CreationDate="2014-04-08T10:46:12.967" Score="2" ViewCount="55" Body="&lt;p&gt;I failed to evaluate the integral of $\frac{e^{ax}}{x\sinh(bx)}$ with respect to $x$ from negative infinite to positive infinite. What techniques can I use to evaluate the integrals of such kind for the Meixner Levy process for the purpose of numerical analysis?&lt;/p&gt;&#xA;" OwnerUserId="7662" LastEditorUserId="16595" LastEditDate="2018-07-18T19:29:54.760" LastActivityDate="2018-07-18T19:29:54.760" Title="Integration in the context of modelling with the Meixner Process" Tags="&lt;mathematics&gt;&lt;numerical-methods&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="10865" PostTypeId="2" ParentId="10863" CreationDate="2014-04-08T13:07:32.380" Score="2" Body="&lt;p&gt;The integral diverges, hence numerical integration will not yield a meaningful result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed, using the &lt;a href=&quot;http://en.wikipedia.org/wiki/Hyperbolic_function#Taylor_series_expressions&quot; rel=&quot;nofollow&quot;&gt;Taylor expansion of the hyperbolic sine&lt;/a&gt; one has that  $$x \sinh (bx)= x\frac{e^{bx}-e^{-bx}}{2}=bx^2+\frac{b^3x^4}{6}+...$$&#xA;Therefore, at the vicinity of $x=0$&#xA;$$\frac{e^{ax}}{x \sinh (bx)}\sim\frac{1}{bx^2}$$&#xA;which is a non-integrable singularity even in terms of &lt;a href=&quot;http://en.wikipedia.org/wiki/Cauchy_principal_value&quot; rel=&quot;nofollow&quot;&gt;the Cauchy principal value&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="70" LastActivityDate="2014-04-08T13:07:32.380" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10866" PostTypeId="2" ParentId="10859" CreationDate="2014-04-08T13:38:02.683" Score="2" Body="&lt;p&gt;$\Pi$ is the value of a delta-hedged portfolio (option plus a short position in Δ underlying). &#xA;The notation for $\Delta$ is overloaded. Here it represents the number of underlying contracts (f.ex shares) in your delta hedged portfolio, equal to the greek $\Delta$ when the portfolio is created. Therefore in the calculation of $d \Pi$, $\Delta$ (the number of shares in your portfolio) is treated as a constant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yes, &lt;strong&gt;the greek&lt;/strong&gt; $\Delta$ evolves as the option approaches maturity and wrt $F$ and you will have to rebalance your portfolio. But this is not contemplated in the infinitesimal $d \Pi$. &lt;/p&gt;&#xA;" OwnerUserId="6781" LastActivityDate="2014-04-08T13:38:02.683" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10867" PostTypeId="2" ParentId="10853" CreationDate="2014-04-08T17:29:08.773" Score="2" Body="&lt;p&gt;Well, well ... First of all, i doubt people would think of hedge fund strategies in the way you are thinking. If I were to classify, the first order of a super high-level classification would be, for example, equity stock  selection (e.g. say Apple vs Google, etc.), macro selection (e.g. currencies, commodities, country bets via stock indices, etc.), or bond/fixed income selection (e.g. NY muni vs. NJ muni, etc.). A second level of classification would be, frequency, i.e. short term, long term, etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Coming back to what you wrote, the largest managers are usually all very highly diversified and NO they won't be taking absurd bets any one thing (and kill any golden goose). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of what you asked, the best hedge fund managers typically have (or aim to have) multiple strategies that would usually end up in a distribution (of daily returns) as close as possible to normal (due to central limit theorem), but with the mean of the returns as positive as possible (or rather the mean/std as high as possible). so, using your lingo, they are neither divergent nor convergent. Managers with daily returns that are either divergent or convergent wouldn't survive for long. &lt;/p&gt;&#xA;" OwnerUserId="5948" LastActivityDate="2014-04-08T17:29:08.773" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10869" PostTypeId="5" CreationDate="2014-04-08T17:50:29.920" Score="0" Body="&lt;p&gt;Market makers have to deal with two opposite forces&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;on the one hand if they accept to provide liquidity at the bid and ask (ie to seller and buyers) continuously, they should make a lot of money while gaining ask minus bid.&lt;/li&gt;&#xA;&lt;li&gt;on the other hand if the price move while they provide liquidity to the market, they may loose a lot of money.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In short: &lt;strong&gt;they like when price do not move&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The bad news for market makers is conditionally to a price move, they will systematically be in the bad direction:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;if the price goes down (they will be hit at the bid), they will have bough (high) and now the price is low&lt;/li&gt;&#xA;&lt;li&gt;if the price goes up (they will be hit at the ask), they will have sold (low) and now the price is high&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;this is called &lt;strong&gt;adverse selection&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://icme.stanford.edu/news/charles-albert-lehalle-leads-lecture-series-icme-students&quot; rel=&quot;nofollow noreferrer&quot;&gt;chapter 1 of C.-A. Lehalle's lecture at Stanford&lt;/a&gt; for details.&lt;/p&gt;&#xA;" OwnerUserId="-1" LastEditorUserId="2299" LastEditDate="2017-06-17T17:45:52.230" LastActivityDate="2017-06-17T17:45:52.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10870" PostTypeId="4" CreationDate="2014-04-08T17:50:29.920" Score="0" Body="Market makers provide liquidity to the market by quoting bid and ask prices for most of the time. The pricing in absolute terms is not as important as finding relative mispricing. The market microstructure is often used to develop trading strategies." OwnerUserId="464" LastEditorUserId="464" LastEditDate="2014-04-08T17:59:14.633" LastActivityDate="2014-04-08T17:59:14.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10871" PostTypeId="2" ParentId="10858" CreationDate="2014-04-08T18:17:55.223" Score="2" Body="&lt;p&gt;Here is how I would approach such a calibration. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming we have the necessary market data one can easily construct the emprical distribution of the arrival rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\lambda_{emp}(\delta)$ be the empirical distribution. &#xA;Then one can define a metric  by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;m(k,A,N)=\sum_{i=1}^N |\lambda_{emp}(i)-\lambda^a(i)|&#xA;$$&#xA;After you have decided upon a suitable $N$ (it would be formally correct to set $N=\infty$ but I don't think this is necessary to get a decent calibration result)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One can now run an optimisation routine on $m(k,A,N)$ to determine parameters $k,A$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This approach will output a parameterisation that minimizes the asolute distance in probability mass.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note however that this would give you a &quot;backward looking&quot; calibration for one will be fitting to historical data.&lt;/p&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-04-08T18:17:55.223" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10873" PostTypeId="1" CreationDate="2014-04-08T20:55:39.217" Score="1" ViewCount="209" Body="&lt;p&gt;Are power contracts traded on any stock markets ? What about OTC markets ?  I ask about the derivatives where payoff is some exponential function of difference between strike and spot price.&lt;/p&gt;&#xA;" OwnerUserId="2044" LastActivityDate="2014-08-07T19:17:23.203" Title="Are power contracts traded on any stock market?" Tags="&lt;options&gt;&lt;equities&gt;&lt;derivatives&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10874" PostTypeId="1" CreationDate="2014-04-08T22:08:30.227" Score="0" ViewCount="218" Body="&lt;p&gt;Suppose we have a stock $X$ at which trades at 100 dollars. We suppose the stock follows a geometric brownian motion. We know that the interest rate is zero and annual volatility is 10 percent. How can we hedge the risk?&lt;/p&gt;&#xA;" OwnerUserId="6055" LastActivityDate="2014-08-08T11:15:04.603" Title="hedging with known volatility" Tags="&lt;equities&gt;&lt;hedging&gt;" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10875" PostTypeId="2" ParentId="10873" CreationDate="2014-04-08T22:49:30.293" Score="0" Body="&lt;p&gt;Levered ETFs have the behavior similar to power contracts, but there aren't any listed options. Some banks should be able to sell you OTC contracts, although I doubt you can do any arbitrage like trade if you are hoping to do - the bid and ask will kill you!&lt;/p&gt;&#xA;" OwnerUserId="5948" LastActivityDate="2014-04-08T22:49:30.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10877" PostTypeId="2" ParentId="10874" CreationDate="2014-04-09T08:23:07.807" Score="1" Body="&lt;p&gt;You sell your stock $S$ against some cash.&lt;/p&gt;&#xA;" OwnerUserId="172" LastActivityDate="2014-04-09T08:23:07.807" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10879" PostTypeId="2" ParentId="10844" CreationDate="2014-04-09T15:29:03.783" Score="2" Body="&lt;p&gt;you never directly trade spot volatility per se, you exchange it for something else :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;if you want to exchange it for &lt;em&gt;spot implied&lt;/em&gt; volatility, you buy a volatility swap.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;if you want to exchange it for &lt;em&gt;forward implied&lt;/em&gt; volatility you get options.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="172" LastEditorUserId="172" LastEditDate="2019-08-27T14:05:38.290" LastActivityDate="2019-08-27T14:05:38.290" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="10880" PostTypeId="2" ParentId="10861" CreationDate="2014-04-09T15:45:59.797" Score="9" Body="&lt;p&gt;Think of the Wiener process as a curve into which you could zoom in ever deeper and deeper and it will still be completely wiggly (= a fractal). That means that even if you tried to put a tangent line onto it, it would find no stable support (= no differentiability) - yet the whole curve is completely closed, i.e. could be drawn without raising your pen (= continuity):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Rzbuc.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Source: &lt;a href=&quot;http://en.wikipedia.org/wiki/Wiener_process&quot; rel=&quot;noreferrer&quot;&gt;http://en.wikipedia.org/wiki/Wiener_process&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2014-04-09T15:45:59.797" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10882" PostTypeId="1" CreationDate="2014-04-09T16:32:39.797" Score="9" ViewCount="7728" Body="&lt;p&gt;So I was reading &lt;em&gt;Robert McDonald's &quot;Derivatives Markets&quot;&lt;/em&gt; and it says Eurodollar futures price can be used to obtain a strip of forward interest rates. We can then use this to obtain the implied forward LIBOR term structure and build the interest rate swap curve.&#xA;The book also provides a concrete example to illustrate its point but somehow I cannot seem to understand it. &lt;img src=&quot;https://i.stack.imgur.com/wwgSx.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/WjJiu.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There was no assumption about the terms of the swap, so I was kinda confused. Is it correct to say that the swap rates calculated in the table are based on an interest rate swap that starts in June with quarterly payments? &lt;br/&gt;&#xA;Moreover, can this method be extended to determine the swap rate on a deferred interest rate swap, i.e., one that instead starts on Sep/Dec with payments being made semi-annually/annually?&#xA;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="5286" LastActivityDate="2016-08-18T01:29:36.797" Title="Calculate interest rate swap curve from Eurodollar futures price" Tags="&lt;swaps&gt;&lt;eurodollars&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10883" PostTypeId="2" ParentId="10874" CreationDate="2014-04-09T18:44:09.407" Score="0" Body="&lt;p&gt;You need a risk model to understand the sources of risk for your stock. If the risk factors can be traded then you can use the factor loadings to hedge your risk.&lt;/p&gt;&#xA;" OwnerUserId="2142" LastActivityDate="2014-04-09T18:44:09.407" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10884" PostTypeId="1" AcceptedAnswerId="14332" CreationDate="2014-04-09T18:52:12.620" Score="1" ViewCount="455" Body="&lt;p&gt;I'm constructing money-neutral spread by this formula:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Spread = log(P1) - log(P2), where P1 and P2 is prices of two instruments&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But sometimes spread can get into negative zone, when log(P1) &amp;lt; log(P2). How to avoid this and make spread always positive?&lt;/p&gt;&#xA;" OwnerUserId="5938" LastActivityDate="2014-08-08T09:10:53.450" Title="Avoiding negative spread in pairs trading" Tags="&lt;pairs-trading&gt;&lt;spread&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10885" PostTypeId="1" CreationDate="2014-04-09T20:00:44.277" Score="3" ViewCount="466" Body="&lt;p&gt;The standard Libor-Forward-Market-Models provides a way of modelling the evolution of forward rates in time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However the model does not seem to be well suited for the modelling of zero-bonds. But rather it seems to have been primarily developed to price swaptions and caps of different levels of complexity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming no counterparty and no liquidity risk - can one use the Libor-Forward-Model to model the evolution of the bond-yield curve ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My approach: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If one defnes the forward rate via &#xA;$$&#xA;F(t,T_{k-1},T_k)=\frac{1}{T_k-T_{k-1}}[P(t,T_{k-1})/P(t,T_k)-1]&#xA;$$&#xA;Note: This is not entirely correct - see &lt;a href=&quot;http://press.princeton.edu/chapters/s7425.html&quot; rel=&quot;nofollow&quot;&gt;Modern Pricing of Interest-Rate Derivatives&lt;/a&gt; (p. 32) - but is mostly assumed to hold in a theoretical context.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the following I am going to use the shorter notations $F(t,T_{k-1},T_k)=F_k(t)$ and $\tau_k=T_k-T_{k-1}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let us assume we have a set of co-terminal (or often called spanning) forward rates &#xA;$F_1(t), \dots, F_n(t)$ with $T_1, \dots, T_n$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the above definition of the forward rate one can write (for $k&amp;gt;i$)&#xA;$$&#xA;\ln(P(t,T_k)/P(t,T_i))=\ln\left(1 /\left[\prod^k_{j=i+1}(1+\tau_k F_j(t))\right]\right)=-\sum^k_{j=i+1}\ln(1+\tau_j F_j(t))&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus for $t=T_i$ the dynamics of the $(T_k-T_i)$-year-yield will be given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{1}{T_k-T_i}\ln(P(T_i,T_k)/P(T_i,T_i))=\frac{1}{T_k-T_i}\ln(P(T_i,T_k))=-\frac{1}{T_k-T_i}\sum^k_{j=i+1}\ln(1+\tau_j F_j(t))&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus can I use the relationship&#xA;$$&#xA;\ln(P(T_i,T_k))=-\sum^k_{j=i+1}\ln(1+\tau_j F_j(t))$$&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; Can I use above relationshp to describe the evolution of a zero-coupon-bond up ti it's Maturity $T_k$ ?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="7712" LastActivityDate="2014-04-09T20:00:44.277" Title="Bond (yield curve) dynamics in the Forward-LIBOR-market-model" Tags="&lt;interest-rates&gt;&lt;yield-curve&gt;&lt;libor&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10886" PostTypeId="1" CreationDate="2014-04-09T23:26:18.987" Score="5" ViewCount="3169" Body="&lt;p&gt;I know about &lt;a href=&quot;https://github.com/quantopian/zipline&quot; rel=&quot;nofollow&quot;&gt;zipline&lt;/a&gt; and &lt;a href=&quot;https://github.com/panpanpandas/ultrafinance&quot; rel=&quot;nofollow&quot;&gt;ultrafinance&lt;/a&gt;, but as far as I know, they don't support fx trading. Which libraries do?&lt;/p&gt;&#xA;" OwnerUserId="7654" LastEditorUserId="11807" LastEditDate="2015-10-17T20:37:13.827" LastActivityDate="2019-10-27T17:40:06.710" Title="Are there Python algorithmic trading libraries supporting forex?" Tags="&lt;fx&gt;&lt;python&gt;&lt;library&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10887" PostTypeId="1" AcceptedAnswerId="10889" CreationDate="2014-04-10T04:23:05.937" Score="1" ViewCount="204" Body="&lt;p&gt;It is &lt;a href=&quot;http://www.californiastemcell.com/about-us/executive-advisory-board/edward-o-thorp/&quot; rel=&quot;nofollow&quot;&gt;said&lt;/a&gt; that Edward O. Thorp was able to harness small correlations for reliable financial gain. I've seen some strategies based on strong correlations which did not seem particularly reliable. Does anyone have an idea or a paper to how the small correlation exploitation could work? I can only think of some kind of relative value arbitrage.&lt;/p&gt;&#xA;" OwnerUserId="2916" LastActivityDate="2014-04-14T20:57:09.843" Title="Harnessing small correlations for reliable profit" Tags="&lt;correlation&gt;&lt;arbitrage&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10889" PostTypeId="2" ParentId="10887" CreationDate="2014-04-10T07:27:14.160" Score="2" Body="&lt;p&gt;it is based on &lt;a href=&quot;http://en.wikipedia.org/wiki/Kelly_criterion&quot; rel=&quot;nofollow noreferrer&quot;&gt;Kelly criterion&lt;/a&gt;. mentioned in one of stackexchange posts &lt;a href=&quot;https://quant.stackexchange.com/questions/352/volatility-pumping-in-practice&quot;&gt;here&lt;/a&gt;&#xA;.&lt;/p&gt;&#xA;" OwnerUserId="2297" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2014-04-10T07:27:14.160" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10890" PostTypeId="2" ParentId="10861" CreationDate="2014-04-10T11:13:35.580" Score="3" Body="&lt;p&gt;There are many examples of &quot;non-random&quot; curves that are continuous everywhere, and yet differentiable nowhere. For example, the one defined by the formula&#xA;$$&#xA;  f(x) = \sum_{k=0}^\infty 2^{-k}\cos(2^kx).&#xA;$$&#xA;You may think of it as a limit of partial sums $f_n(x) =\sum_{k=0}^n 2^{-k}\cos(2^kx)$. Each $f_n$ is differentiable, and consists of a combination of sinusoids with different frequency and magnitude. As $n\to\infty$ there are more and more frequencies present, which makes tangent lines (very much related to differentiability) behave poorer and poorer. In the limit, there is no single point which admit a tangent line.&lt;/p&gt;&#xA;" OwnerUserId="464" LastActivityDate="2014-04-10T11:13:35.580" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10892" PostTypeId="2" ParentId="8443" CreationDate="2014-04-10T14:07:50.007" Score="2" Body="&lt;p&gt;2) you only take trading days for your analysis because taking in account days on which no price changes took place would shift results in a wrong direction. For exmple, you mostly take 250 trading days p.a.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Your time interval up to 2007 is okay and excludes the financial crisis, which is a non-normal circumstance. Therefore, your time interval can be regarded as representing the usual case. If possible, try to get some data which includes the financial crisis in order to get an impression of how the capm performs during extreme market conditions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) If you want to add adjustments, it will get complex very fast. The second problem is that whoever supervises your analysis might not accept your adjustments. If instruments have a very short data track, maybe leave them out. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;5) Should be OK, however if you can get daily data, it is always the better way. But as the volatility is quite low in those rates compared to stock quotes, switching to monthly data is legitimate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;6) I do not fully understand what you mean. If everything is in Swedish, why convert it into another currency? However, if you add a benchmark in another currency, you have to express all time series in the same currency, of course. To do so, get daily FX data and convert the stock quotes every day into the corresponding benchmark currency (or vice versa).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;7) Try to include benchmarks, which represent your portfolio more than the MSCI World. You can still include him and see what the broader diversification changes return and risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope that helps a bit. Sorry if I didn't fully understand some questions. &lt;/p&gt;&#xA;" OwnerUserId="7765" LastActivityDate="2014-04-10T14:07:50.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10895" PostTypeId="1" CreationDate="2014-04-10T21:22:22.067" Score="1" ViewCount="179" Body="&lt;p&gt;What determines whether an investment should be made using debt vs. equity?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, startups are often financed with equity, while mortgages are always financed using debt. What characteristics about the investment (like risk, uncertainty, information, duration, etc) inform whether one or the other type of instrument is most efficient?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would love a precise answer, in particular if there is a text book answer for this.&lt;/p&gt;&#xA;" OwnerUserId="7770" LastActivityDate="2014-06-14T05:44:06.160" Title="Debt vs. Equity?" Tags="&lt;equities&gt;&lt;investment&gt;&lt;debt&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10896" PostTypeId="2" ParentId="10886" CreationDate="2014-04-10T23:58:47.413" Score="2" Body="&lt;p&gt;I currently use a combination of matplotlib and Oanda's FX API.  Their API is REST based, and would essentially allow for any type of library to handle calculations. A python wrapper for the Oanda API is on &lt;a href=&quot;https://github.com/oanda/oandapy&quot; rel=&quot;nofollow&quot;&gt;github&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7762" LastEditorUserId="5420" LastEditDate="2014-07-10T17:29:02.517" LastActivityDate="2014-07-10T17:29:02.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10897" PostTypeId="1" AcceptedAnswerId="10949" CreationDate="2014-04-11T07:17:41.890" Score="2" ViewCount="189" Body="&lt;p&gt;Suppose we have an asset $A$, and we have modelled the cashflows for this asset to be $\{C_{1},\ldots C_{k}\}$ which occur at time $\{T_{1},\ldots T_{k}\}$. Now the present value of the asset can be obtained by discounting each cashflow -- that is the present value of the asset/instrument, assuming that the time now is denoted as $t=0$ is given by &#xA;$ PV(0) = \sum_{j=1}^{k} C_j\times D(T_{j}) $&#xA;where $D(T_{j})$ is the appropriate discount factor at time $T_j$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, to what extent does the asset/instrument type play in determining how to construct the discount factors $D(T_j)$.For instance if the asset $A$ is a bond, which is being financed by a loan from a bank then should not the discount factors be obtained from lending rates from banks. If $A$ is represents a single leg of a swap, which is financed by LIBOR say then should not the discount factors be derived from swap data. Finally how about the role currency plays -- for instance if $A$ is financed in USD, even if its a swap or a bond, should the discounting be done using a currency curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short, how do we arrive at which benchmark instruments we need to construct the discount function?&lt;/p&gt;&#xA;" OwnerUserId="7772" LastActivityDate="2014-04-15T10:02:59.760" Title="Discounting based on instrument type" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;stochastic-discount&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10899" PostTypeId="1" AcceptedAnswerId="10912" CreationDate="2014-04-11T08:36:36.170" Score="5" ViewCount="471" Body="&lt;p&gt;So far I have just theoretical knowledge of risk measure and never used them in application. Therefore I have some basic question how risk measures are used in reality and how they are implemented in R. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Let's assume you are managing a portfolio containing some assets. In particular I'm interested in VaR and CVaR. VaR is a quantile of the loss distribution. In reality one would calculate the VaR for the returns to see what the current risk of your portfolio is. This leads to a series of VaR over time, is this correct?&lt;/li&gt;&#xA;&lt;li&gt;How CVaR implemented in R? I know there is the PerformanceAnalytics&#xA;package containing the function ES. But how does this function&#xA;calculate the CVaR? Moreover, this function (ES) has as argument a&#xA;vector, matrix, data frame, timeSeries or zoo object of asset&#xA;returns. How does the calculation differs if the argument is a data&#xA;frame of asset returns or a timeSeries object?&lt;/li&gt;&#xA;&lt;li&gt;Closely related to 2. How are Time Series used to calculate VaR/CVar?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I'm very thankful for any explanations / references.&lt;/p&gt;&#xA;" OwnerUserId="17133" LastEditorUserId="17133" LastEditDate="2014-04-11T13:03:19.270" LastActivityDate="2015-02-10T14:53:38.543" Title="quantiative risk measure how they are implemented in R and their use" Tags="&lt;risk&gt;&lt;r&gt;&lt;risk-models&gt;&lt;var&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10903" PostTypeId="1" AcceptedAnswerId="10952" CreationDate="2014-04-11T11:24:43.003" Score="4" ViewCount="960" Body="&lt;p&gt;I'm trying to simulate a 3-factor HJM model. I got the algorithms from Glasserman book. In my case, I have $3$ maturity:$ 0.25y, 0.5y, 0.75y$. So my time grid is: $t_0=0,t_1=0.25,t_2=0.5,t_3=0.75$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to price the zero-coupon bonds with: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$B(0,t_j)=\exp(-\sum_{i=0}^{j-1}r(t_i)h_i),\quad \text{where}\quad h_i=t_i-t_{i-1}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;formula. $h_i=\frac{3}{12} \forall i$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$D(t_j)=B(0,t_j)$ and the starting value of $D$ is $1$, as its written in the algorithm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the first &quot;for&quot; cycle the index is going only untill $M-1$, which is $2$, so it wont be multipled with $r(t_2)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$i=1$ $\rightarrow$ $D=D*\exp(-r(t_0)\frac{3}{12} )$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$i=2$ $\rightarrow$ $D=D*\exp(-r(t_1)\frac{3}{12} ). $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After that the algorithm stops, so I either have to change the max indext to $M$ or just multiple with $\exp(-r(t_2))$ in the end, but i dont think these are the good solutions. Or if in the $i=1$ case, my first update on bondprice would be $r(t_1)$, that would be good too, but then I dont know where $\exp(-r(0))$ is in the algorithm.&lt;/p&gt;&#xA;" OwnerUserId="7778" LastEditorUserId="7778" LastEditDate="2014-04-11T20:26:27.313" LastActivityDate="2014-04-15T18:34:49.507" Title="HJM simulation problem" Tags="&lt;forward&gt;&lt;heath-jarrow-morton&gt;&lt;short-rate&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10904" PostTypeId="1" AcceptedAnswerId="10909" CreationDate="2014-04-11T11:56:18.477" Score="2" ViewCount="199" Body="&lt;p&gt;The plot below depicts the delta of a standardized at-the-money 30-day put option on the S&amp;amp;P500 tracker SPY over a 14-year period. This is data from OptionMetrics and standardized prices are calculated using linear interpolation from the volatility surface&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: Why does delta increase (i.e. decrease in absolute value) during the 2008 financial crisis?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Link: &lt;a href=&quot;https://imgur.com/Gpi5djq&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://imgur.com/Gpi5djq&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Delta of a put option over time, whose characteristics are constant. I.e. the underlying option characteristics is modeled so that it is perpetually at the money and 30 days from expiry&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/VSciG.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="6397" LastEditorUserId="6397" LastEditDate="2014-04-11T15:18:12.527" LastActivityDate="2014-04-11T15:18:12.527" Title="Delta of a standardized at-the-money 30-day put option" Tags="&lt;greeks&gt;&lt;delta&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10905" PostTypeId="1" CreationDate="2014-04-11T12:33:10.000" Score="40" ViewCount="79461" Body="&lt;p&gt;I would like to compile a list of open source trading platforms. Something that would give an overview and comparison of different architectures and approaches. &lt;/p&gt;&#xA;" OwnerUserId="3308" LastEditorUserId="33410" LastEditDate="2018-11-20T02:27:28.960" LastActivityDate="2021-02-16T08:01:00.023" Title="What open source trading platform are available" Tags="&lt;trading&gt;" AnswerCount="15" CommentCount="3" FavoriteCount="50" CommunityOwnedDate="2014-06-10T14:21:29.883" ContentLicense="CC BY-SA 3.0" />
  <row Id="10906" PostTypeId="2" ParentId="10905" CreationDate="2014-04-11T12:46:58.277" Score="5" Body="&lt;p&gt;List of links/projects I stumbled upon while doing the research: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.traderslaboratory.com/forums/tools-trade/11086-open-source-trading-platforms-master-list-2.html&quot; rel=&quot;noreferrer&quot;&gt;Open Source Trading Platforms&lt;/a&gt; (might be outdated)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="3308" LastActivityDate="2014-04-11T12:46:58.277" CommentCount="0" CommunityOwnedDate="2014-06-10T14:21:29.883" ContentLicense="CC BY-SA 3.0" />
  <row Id="10907" PostTypeId="1" CreationDate="2014-04-11T13:00:24.853" Score="4" ViewCount="401" Body="&lt;p&gt;Using copula formulation for the following probability:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{P}(X\leq x,y_{1}\leq Y\leq y_{2})=\mathbb{P}(X\leq x,Y\leq y_{2})-\mathbb{P}(X\leq x,Y\leq y_{1})$$&#xA;$$=C(F_{X}(x),F_{Y}(y_{2}))-C(F_{X}(x),F_{Y}(y_{1}))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no need or requirement for the two copulas above to be the same. Is there a link between these two copulas? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I read somewhere that there should be a link of the type of convolution copula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know if there is a link or perhaps has some references of research concerning this topic? &lt;/p&gt;&#xA;" OwnerUserId="7649" LastActivityDate="2014-04-11T15:36:01.257" Title="Convolution copula?" Tags="&lt;probability&gt;&lt;copula&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10908" PostTypeId="1" CreationDate="2014-04-11T13:28:11.733" Score="0" ViewCount="305" Body="&lt;p&gt;I designed an strategy that operates with 30-second bars on e-mini SP500. It works fine in the back-testing and the out-sample, also performs well in every walk-forward test I have tried.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, when it comes to a real simulation (using TradeStation as platform and broker), if fails miserably due to slippage, because a price difference of 0.25$ is enough to make it a losing strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder if high-frequency trading can solve this problem, and in such case if there is any way to access to this kind of technology. Is there any broker offering simulated accounts with HFT capabilities? Any contest or simulation software to test my strategy?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much.&lt;/p&gt;&#xA;" OwnerUserId="7779" LastActivityDate="2014-04-13T10:08:08.743" Title="Accessible HTF? (Slippage reduction)" Tags="&lt;high-frequency&gt;&lt;slippage&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10909" PostTypeId="2" ParentId="10904" CreationDate="2014-04-11T14:09:40.543" Score="1" Body="&lt;p&gt;Delta increases as volatility increases. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular, the formula for delta of a put is $$\Delta=-exp\left(-qt\right)\Phi\left(-d_{1}\right)&#xA; $$&#xA;with&#xA;$$d_{1}\equiv\frac{ln\left(S/K\right)+\left(r-q+\frac{\sigma^{2}}{2}\right)t}{\sigma\sqrt{t}}&#xA; $$&#xA;setting $S=K$ and $r=q$ you would get&#xA;$$d_{1}\equiv\frac{\sigma}{2}\sqrt{t}&#xA; $$&#xA;By the chain rule, an increase in $\sigma$ leads to an increase in $d_{1}$, which leads to a decrease in the $\Phi(-d_{1})$ term but an increase in $\Delta$.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastEditorUserId="2379" LastEditDate="2014-04-11T14:45:15.647" LastActivityDate="2014-04-11T14:45:15.647" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10910" PostTypeId="2" ParentId="10908" CreationDate="2014-04-11T14:37:53.587" Score="1" Body="&lt;p&gt;I know it's not what you want to hear, but the smaller the time-frame the more limit orders should be focused on (which can change the design of a strategy entirely).  Due to the nature of the futures markets, having a gap in liquidity can obviously cause discrepancies with market orders, but can guarantee some nature of being filled using limits. &lt;/p&gt;&#xA;" OwnerUserId="7762" LastActivityDate="2014-04-11T14:37:53.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10911" PostTypeId="2" ParentId="10907" CreationDate="2014-04-11T15:36:01.257" Score="4" Body="&lt;p&gt;Is'nt it true that your first line can be written as&#xA;$$&#xA;F_{X,Y}(x,y_2) - F_{X,Y}(x,y_1),&#xA;$$&#xA;where $F_{X,Y}$ is the joint cdf of $(X,Y)$. If we assume that the distributions of $X$ and $Y$ are continuous without atoms (I have to check the exact formulation), then it is clear from Sklar's theorem that there is exactly one copula $C$ such that $$F_{X,Y}(x,y) = C(F_X(x),F_Y(y)).$$&#xA;So the answer is: no the &quot;two&quot; copulas are just one.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-04-11T15:36:01.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10912" PostTypeId="2" ParentId="10899" CreationDate="2014-04-11T15:54:11.957" Score="1" Body="&lt;p&gt;For the first, people regularly compute VaR or CVaR over time and plot the results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For two and three, the documentation for the ETL function says that you can either calculate it using a Gaussian approach or Cornish-Fisher expansion. These are both analytical methods. The Gaussian approach uses only the mean and variance (effectively assuming that the distribution of returns is a Gaussian distribution with whatever mean and variance you provide), while the Cornish-Fisher also takes into account the skewness and kurtosis of the distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use the function to calculate a univariate CVaR for one or more series. The underlying formula would not change for different data types so long as you are considering a univariate CVaR. However, if you choose to calculate the CVaR of a portfolio (by changing the portfolio_method parameter, I believe), then the formulas change to handle the multivariate relationships between the different securities. In this case, the Cornish-Fisher expansion typically becomes burdensome for large portfolios because the co-skewness and co-kurtosis matrices become huge.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To resolve this issue, the more general way to calculate VaR and CVaR is to represent the distribution of returns by scenarios. Some people use the historical distribution of returns in this way, but you can also use simulations from more general distributions. Given a vector of portfolio weights, you can calculate the portfolio returns for each scenario. Then you can find the VaR of the portfolio by the quantile function. The CVaR is then just the average of the returns less than the VaR. This can be done quite easily in just about any language.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wouldn't say time series are used to calculate VaR and CVaR. Rather, time series methods or techniques can be used to produce estimates of the expected distribution of returns. VaR and CVaR are functions on those distributions. xts is used in PerformanceAnalytics mainly as a data container, i.e. to make it easier to work with returns and dates. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2014-04-11T15:54:11.957" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10913" PostTypeId="1" CreationDate="2014-04-11T16:18:49.630" Score="3" ViewCount="1047" Body="&lt;p&gt;I am having trouble taking the following limit of CVaR/VaR for a normal distribution as alpha approaches 1:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\lim_{\alpha \to 1} \frac{\mu + \sigma \frac{\phi^{-1}(\alpha)}{1-\alpha}}{\mu + \sigma \phi^{-1}(\alpha)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First I tried pulling the $(1-\alpha)$ out of the CVaR denominator to get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\lim_{\alpha \to 1} \frac{\mu(1-\alpha) + \sigma {\phi^{-1}(\alpha)}}{(1-\alpha)(\mu + \sigma \phi^{-1}(\alpha))}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I thought maybe I need to use L'Hopital's rule, but I have no idea how to do that with an inverse normal imbedded in my function.  I feel that I'm probably missing something simple (and my days of calculus are too far behind me).  Any hints for how to compute this limit?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks.&lt;/p&gt;&#xA;" OwnerUserId="7781" LastEditorUserId="7781" LastEditDate="2014-04-11T21:25:46.923" LastActivityDate="2014-04-12T21:28:25.340" Title="CVaR/VaR Ratio as alpha goes to 1" Tags="&lt;stochastic-calculus&gt;&lt;value-at-risk&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10914" PostTypeId="1" CreationDate="2014-04-11T16:57:09.937" Score="3" ViewCount="1883" Body="&lt;p&gt;Why are the betas of individual securities essentially the same whether we use daily or weekly data when calculating?&lt;/p&gt;&#xA;" OwnerUserId="7759" LastEditorUserId="2379" LastEditDate="2014-04-11T21:07:43.633" LastActivityDate="2014-04-11T21:07:43.633" Title="Beta and Frequency of Data" Tags="&lt;beta&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10915" PostTypeId="2" ParentId="10914" CreationDate="2014-04-11T18:17:22.203" Score="3" Body="&lt;p&gt;Suppose you have $$X\equiv\left(x_{1},\: x_{2}\right)&#xA; $$ where $x_{1}$ are the daily log returns of the security and $x_{2}$ are the daily log returns of the market. Assume further that $X$ is iid multivariate normal $$X\sim N\left(\mu,\Sigma\right)&#xA; $$&#xA;People frequently calculate beta as&#xA;$$\beta_{1,2}\equiv\frac{\Sigma_{1,2}}{\Sigma_{2,2}}&#xA; $$&#xA;If you convert $X$ from a daily series to a weekly series, you could say that the weekly variables are just the sum of the daily variables. Due to the properties of a normal distribution, this means you could write &#xA;$$X_{weekly}\sim N\left(5\mu,5\Sigma\right)&#xA; $$&#xA;This implies a weekly beta of&#xA;$$\beta_{1,2}^{weekly}\equiv\frac{5\Sigma_{1,2}}{5\Sigma_{2,2}}=\frac{\Sigma_{1,2}}{\Sigma_{2,2}}$$&#xA;or that the beta is the same as the daily version.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a few wrinkles to this argument. First, returns may not be iid normally distributed, which would mean that the covariance of the weekly data may not be proportional to the covariance of the daily data. Second, the beta that really matters to an investor is the forward-looking beta on arithmetic returns. That beta is more complicated to calculate since it involves the conversion between the log returns and the arithmetic returns.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2014-04-11T18:17:22.203" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10916" PostTypeId="2" ParentId="10913" CreationDate="2014-04-11T18:43:53.767" Score="2" Body="&lt;p&gt;I don't know what you did when you tried pulling out $1-\alpha$, the correct expression would be&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\lim_{\alpha \to 1} \frac{\mu(1-\alpha) + \sigma {\phi^{-1}(\alpha)}}{(1-\alpha)(\mu + \sigma \phi^{-1}(\alpha))}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyhow, you can try using the substitution $\Phi^{-1}(\alpha) = x$, $x \to \infty$ and $\alpha = \Phi(x)$. Then the expression becomes&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\lim\limits_{x \to \infty} \frac{\mu + \sigma x/(1-\Phi(x))}{\mu + \sigma x}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then perhaps you can you L'Hospitals from hereon. It becomes a bit messy though, but with some effort you might be able to do it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you have the answer?&lt;/p&gt;&#xA;" OwnerUserId="4709" LastActivityDate="2014-04-11T18:43:53.767" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10917" PostTypeId="1" CreationDate="2014-04-11T21:14:56.923" Score="0" ViewCount="425" Body="&lt;p&gt;I'm looking for a list of ADR's (for a simulation) that I can screen by either market cap or volume? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If anyone knows of a free way to get such a list it would be much appreciated. &lt;/p&gt;&#xA;" OwnerUserId="7783" LastEditorUserId="743" LastEditDate="2014-07-17T20:03:24.617" LastActivityDate="2015-05-14T00:18:06.540" Title="list of ADR's by volume or market cap" Tags="&lt;market-data&gt;&lt;data-mining&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10918" PostTypeId="1" AcceptedAnswerId="10919" CreationDate="2014-04-12T04:36:27.333" Score="1" ViewCount="146" Body="&lt;p&gt;I am having some difficult showing what the following equals, where $x$ and $y$, $x&amp;gt;y$, distinct times:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb{E}[\Delta W_x \Delta W_y]$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where each $\Delta W_t = W_t - W_{t-1}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have decomposed it into its four terms, which allows taking expectations of the product of some W term and another, which I think is 0 by independence, but that makes this entire expectation 0, which makes the overall covariance I am solving for to be 0, which seems off to me. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The full problem I am trying to solve is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Cov(\Delta Z_t + \Delta\epsilon_t, \Delta Z_{t-i} + \Delta\epsilon_{t-i})$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Z_t = \kappa W_t$ and $i = 1,2,3,...$, $W$ and $\epsilon $ independent,&#xA;  so guidance with how to would be even more appreciated, really. &lt;/p&gt;&#xA;" OwnerUserId="7550" LastEditorUserId="7550" LastEditDate="2014-04-12T05:27:19.443" LastActivityDate="2014-04-12T14:06:55.800" Title="Differenced Brownian Motion covariance" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10919" PostTypeId="2" ParentId="10918" CreationDate="2014-04-12T14:06:55.800" Score="3" Body="&lt;p&gt;A key property of Brownian motion is independent increments. So if $x-1 &amp;gt; y$, then &#xA;$$ \mathbb{E}[\Delta W_x \Delta W_y] = 0 $$&#xA;because the time intervals [x-1,x] and [y-1,y] do not overlap.&#xA;If they do overlap, i.e. $x-1 \leq y &amp;lt; x$, then&#xA;\begin{align}&#xA;\mathbb{E}[\Delta W_x \Delta W_y] =&amp;amp;\ \mathbb{E}[(W_x - W_{x-1}) (W_y-W_{y-1})] \\&#xA;=&amp;amp;\ \mathbb{E}[(W_x - W_y + W_y - W_{x-1}) (W_y - W_{x-1} + W_{x-1} -W_{y-1})] \\&#xA;=&amp;amp;\ \mathbb{E}[(W_y - W_{x-1})^2] = y-x+1&#xA;\end{align}&#xA;where the second to last step uses the independent increments property and the last step uses the fact that the second moment of Brownian motion is equal to the time step.&lt;/p&gt;&#xA;" OwnerUserId="7396" LastActivityDate="2014-04-12T14:06:55.800" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10920" PostTypeId="1" CreationDate="2014-04-12T16:19:28.233" Score="6" ViewCount="399" Body="&lt;p&gt;Recently I have been reading a lot on the market models. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One thing that keeps escaping me - why is the Libor-market model (LMM) assumed to e free of aritrage in continuous time ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To me this means that there must be a Numeraire so that all the bond-price-processes $P(t,T^*)$ with $T^* &amp;gt;t$ and $T^* \in [0,T]$ (with $T&amp;gt;T^*$ ) are martingales und the measure associated with that numeraire.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To state that the LMM is free of aritrage someone must have determines the relevant numeraire and done all the necessary checks. &lt;strong&gt;Is there a book or paper where those resuls can be found?&lt;/strong&gt; &lt;/p&gt;&#xA;" OwnerUserId="7712" LastActivityDate="2015-04-21T18:44:47.633" Title="Why is the LIBOR-market model free of arbitrage?" Tags="&lt;arbitrage&gt;&lt;libor&gt;&lt;risk-free&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10921" PostTypeId="1" AcceptedAnswerId="10922" CreationDate="2014-04-12T18:40:42.587" Score="3" ViewCount="282" Body="&lt;p&gt;Earlier I had the question (5.11 Tomas Bjork):  &lt;br/&gt;&#xA;$$ \frac{\partial F}{\partial t}+\frac{1}{2}x^2\frac{\partial^2 F}{\partial t^2}+x = 0 $$&#xA;$$ F(T,x) = ln(x^2) $$&#xA;And solve it using Feynman-Kac. The PDE gives the stochastic differential $dX=XdW$ so to solve the PDE I need what $X$ that solves the stochastic differential. An example in the book showed how to solve a differential of the type above and did it by letting $Z=lnX$, compute its differential $dZ$ (which then become independent of Z, which I guess is the point), solve for Z, and then for X just raise the exponential function with the solution for Z (since $Z=lnX$). This all went fine. &lt;br/&gt;&#xA;  &lt;br/&gt;&#xA;Now I have a question considering the standard BS-model where I´m supposed to derive the arbitrage free proce process for the contingent claim $X=(S(T)^{\beta})$, $\beta=const.$  &lt;br/&gt;&#xA;  &lt;br/&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Standard BS-model gives the differential for $S$ which is $dS=rSdt+\sigma S dW$. Thinking of the earlier question I gave it a try doing as before. Setting $Y=S^{\beta}$, and computing $dY$ gives:  &lt;br/&gt;&#xA;$dY = Y(r\beta +\frac{\beta(\beta-1)}{2}\sigma^2)dt+\sigma \beta Y dW$  &lt;br/&gt; for which I then need the $Y$ that solves this $dY$. Doing as above however, setting $Z=ln Y$ (with $Z_0 = ln s_0$), computing $$dZ = \frac{1}{Y}dY-\frac{1}{2Y^2}(dY)^2 = dt(\beta r+\frac{\beta(\beta-1)}{2}\sigma^2-\frac{\beta^2\sigma^2}{2})+\beta \sigma dW$$ &#xA;Integrating and raising the exponential function would give the solution $Y$ for $dY$:&#xA;$$ Y = s_0 exp(\int^T_t(\beta r+\frac{\beta(\beta-1)}{2}\sigma^2-\frac{\beta^2\sigma^2}{2})dt + \int^{W_T}_{W_t}\beta \sigma dW)$$ which then would give the price process $$\pi = s_0^\beta exp[\beta(\beta r+\frac{\beta(\beta-1)}{2}\sigma^2-\frac{\beta^2\sigma^2}{2})(T-t)]$$ &#xA;This result, according to the solutions manual is wrong however. It has this extra term $\frac{\beta^2\sigma^2}{2}$ which appears when doing the extra step of letting $Z=lnY$ and so on but I can´t understand what the difference is from the first case and why this doesn´t work. Please let me know if something is unclear and I´ll try to revise. &lt;/p&gt;&#xA;" OwnerUserId="7752" LastActivityDate="2014-04-12T20:24:52.463" Title="Pricing of a simple contingent claim" Tags="&lt;arbitrage&gt;&lt;black&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10922" PostTypeId="2" ParentId="10921" CreationDate="2014-04-12T20:24:52.463" Score="3" Body="&lt;p&gt;You're making it much more complicated than it has to be. Remember that the arbitrage free price is given by $e^{-r(T-t)}\mathbb{E}(\Phi(S_T))$ (to be correct, this should be conditioned on the appropriate sigma-algebra. I'll exclude that for ease of writing). Now use Itos on $\ln(S_t) = X_t$, this yields, after integration (Note that you integrate from $t$ to $T$ in all integrals. I see that you've written the integral from $W_t$ to $W_T$, this is incorrect): &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_T = S_t \cdot \text{exp}((r-\sigma^2/2)(T-t) + \sigma Z$ where $Z \in N(0,\sqrt{T-t})$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now insert this into the expression for the price:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$e^{-r(T-t)}\mathbb{E}(S_T^{\beta})=S_t^{\beta}e^{-r(T-t)+\beta(r-\sigma^2/2)(T-t)}\mathbb{E}(e^{\beta Z})=S_t^{\beta}e^{-r(T-t)+\beta(r-\sigma^2/2)(T-t)+\beta^2\sigma^2(T-t)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This you can rewrite as you'd like. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I mentioned previously. Note that you integrate from $t$ to $T$ and you'll get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_T - X_t = \int_t^T (...)du + \int_t^T(...)dW_u$. Writing the last integral with limits $W_t$ to $W_T$ is incorrect!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this makes it clear to you! This is the usual way to price contingent claims, using the PDE directly is only necessary when you can't compute the price analytically and must approximate it using numerical methods (you can use Monte-Carlo simultation also, for this the PDE is not required either).&lt;/p&gt;&#xA;" OwnerUserId="4709" LastActivityDate="2014-04-12T20:24:52.463" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10923" PostTypeId="2" ParentId="10913" CreationDate="2014-04-12T21:28:25.340" Score="4" Body="&lt;p&gt;If the loss distribution is normal with mean $\mu$ and variance $\sigma^2$, then the Value-at-Risk and Expexted Shortfall (or CVaR) at level $\alpha \in (0, 1)$ are&#xA;\begin{align*}&#xA;\mbox{VaR}_\alpha &amp;amp; = \mu + \sigma \Phi^{-1}(\alpha) , \\&#xA;\mbox{ES}_\alpha  &amp;amp; = \mu + \sigma \frac{\phi\{\Phi^{-1}(\alpha)\}}{1 - \alpha} ,&#xA;\end{align*}&#xA;where $\phi$ denotes the density function of the standard normal distribution, and $\Phi$ its distribution function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recall that the derivative of the density is $\phi'(z) = -z\phi(z)$.&#xA;Then, setting $x = \Phi^{-1}(\alpha)$ and by l'Hopital's rule, the limit of the ratio is&#xA;$$&#xA;\lim_{\alpha \to 1} \frac{\mbox{ES}_\alpha}{\mbox{VaR}_\alpha}&#xA; = \lim_{x \to \infty}&#xA;     \frac{\mu \{1 - \Phi(x)\} + \sigma \phi(x)}{(\mu + \sigma x) \{1 - \Phi(x)\} } &#xA; = \lim_{x \to \infty}&#xA;     \frac{1}{1 - \sigma \frac{1 - \Phi(x)}{(\mu + \sigma x)\phi(x)}},&#xA;$$&#xA;and by l'Hopital's rule&#xA;$$&#xA;\lim_{x \to \infty} \frac{1 - \Phi(x)}{(\mu + \sigma x)\phi(x)}&#xA; = \lim_{x \to \infty} \frac{1}{(\mu + \sigma x)x - \sigma}&#xA; = 0.&#xA;$$&#xA;Thus, &#xA;$$&#xA;\lim_{\alpha \to 1} \frac{\mbox{ES}_\alpha}{\mbox{VaR}_\alpha} = 1 .&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="5669" LastActivityDate="2014-04-12T21:28:25.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10924" PostTypeId="1" AcceptedAnswerId="11065" CreationDate="2014-04-13T08:53:55.520" Score="1" ViewCount="178" Body="&lt;p&gt;In Example 4.5 of Section 4.8 on Duration of Options, Futures and Other Derivatives (p.92), a bond's price and duration are computed assuming continuous compounding where the bond yield is y = 12%. The price is B $\approx$ 94.213, and the duration is D $\approx$ 2.653. Then, the formula $\frac{\Delta B}{B} = -D\Delta y$ is tested for accuracy. The claim is that if bond yield increases from 12% to 12.1%, then the bond price will decrease from 94.213 to 93.963.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next, Hull talks about Modified Duration in Example 4.6 where semiannual compounding is instead used. y = 12% is converted to y = 12.3673%. The modified duration is $D* = \frac{D}{1+\frac{y}{m}} = \frac{2.653}{1+\frac{12.3673%}{2}} = 2.4985$. The next claim is that if bond yield increases from 12.3673% to 12.4673%, then the bond price will decrease from 94.213 to 93.978 using the formula $\frac{\Delta B}{B} = -\frac{D\Delta y}{1+\frac{y}{m}} = -D*\Delta y$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is regarding the second claim. Why still 94.213 in &quot;94.213 to 93.978&quot; ? Shouldn't we recompute the bond price using semiannual compounding?&lt;/p&gt;&#xA;" OwnerUserId="7788" LastActivityDate="2014-04-25T18:38:08.207" Title="If we modify duration, should we modify bond price? Options Futures and Other Derivatives" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;duration&gt;&lt;bond-yields&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10925" PostTypeId="2" ParentId="10908" CreationDate="2014-04-13T10:08:08.743" Score="1" Body="&lt;p&gt;You're playing against people who would take the opportunities you're going for in microseconds or milliseconds. What kind of latency are you getting with TradeStation? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to do two things:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;measure this latency.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;get tick by tick data and do a &lt;em&gt;real&lt;/em&gt; backtest. Probably your opportunities are gone in 10 milliseconds so you need to do this.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="6081" LastActivityDate="2014-04-13T10:08:08.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10926" PostTypeId="1" AcceptedAnswerId="10929" CreationDate="2014-04-13T10:08:59.093" Score="1" ViewCount="409" Body="&lt;p&gt;Merchant power plant is one that can be turned on whenever you want. Suppose it is generating electricity from natural gas and we have a spark-spread option. Why is that the person who owns plant is said as long the power and short the natural gas? Shouldn't it be the opposite where he short power and long the natural gas?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am little confused why it long the power and short the natural gas?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Need some guidance.&lt;/p&gt;&#xA;" OwnerUserId="5839" LastEditorUserId="5839" LastEditDate="2014-04-13T10:17:05.250" LastActivityDate="2014-04-15T07:10:51.297" Title="Why long power and short gas for Merchant power plant" Tags="&lt;options&gt;&lt;option-strategies&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10929" PostTypeId="2" ParentId="10926" CreationDate="2014-04-13T17:45:59.227" Score="2" Body="&lt;p&gt;When you have a power plant, your gain (financial) is Power Price - coef1 * Gas Price - coef2 * CO2 Price - other cost.&#xA;So if you want to secure your supply, you have to be Long Gas and CO2 and Short Power.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Physical commo is the opposite, you are short gas and long Power (when the Power price rise, you earn more money).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Financial strategies must be opposite of Physical position to secure the margin.&lt;/p&gt;&#xA;" OwnerUserId="7610" LastActivityDate="2014-04-13T17:45:59.227" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10932" PostTypeId="1" CreationDate="2014-04-14T08:55:35.993" Score="4" ViewCount="1031" Body="&lt;p&gt;In a summary I am trying to do the following &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Bond Subset 1 :&lt;/strong&gt;  Get list of USD Bonds --&gt; Filter out Bonds which have YTM &gt; y% DUR &gt; 10 Y etc. ..  This gives us Bonds which we are interested in. So in the end we will have a &lt;strong&gt;subset of these Bonds&lt;/strong&gt; in final portfolio &lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Bond Subset 2 :&lt;/strong&gt; List of Bonds which &lt;strong&gt;we surely&lt;/strong&gt; need to include . Unlike previous subset these bonds should definitely  include in final portfolio &lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Constraints :&lt;/strong&gt;&lt;br&gt;&#xA;a.  Match Total Duration and Key Rate Duration :  Given the DV01 profile of the client’s liability the resulting portfolio should match this profile with +- X% deviation &#xA;b.  Apply Sector Constraints : Total in  Financial Sector &amp;lt;= 0.25 of Total etc. .. &#xA;c.  Lower and Upper Limits of investment in single security &#xA;d.  Maximum Number of securities in resulting portfolio = N &lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Objective&lt;/strong&gt; : Achieve Yield = Y % or Maximize Yield &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So I created a set of inequalities to satisfy these contraints and I have my objective function defined as well. I am using matlab fmincon to achieve this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;  fmincon tries to include all bonds in the optimization and the results is such that constraints are not satisfied. I need to be able to selectively pick or remove bonds from the Subset 1. Which means that I need the solver to have &lt;strong&gt;variable number of variables&lt;/strong&gt;. To solve this problem I am looking at finding &lt;strong&gt;best way to sample subsets of Bonds 1&lt;/strong&gt; and run solver on this so that I am left with portfolio with satisfies the contraints. Does anyone have any ideas on such a sampling problem in portfolio optimization. (Please dont suggest considering all combinations of bonds possible to find subsets for which constraints are satisfied and I get max yeild, since performance of the code is very important here and number of securities are about 1000 ) &lt;/p&gt;&#xA;" OwnerUserId="1386" LastEditorUserId="1386" LastEditDate="2014-04-14T09:43:23.610" LastActivityDate="2014-04-17T10:08:21.290" Title="Sampling problem in portfolio optimization" Tags="&lt;portfolio-selection&gt;&lt;matlab&gt;&lt;portfolio-optimization&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10933" PostTypeId="2" ParentId="10932" CreationDate="2014-04-14T09:09:06.777" Score="4" Body="&lt;p&gt;If I understand you correctly, then you have a filter defined for your portfolio that is defined by &quot;1.&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A) So you either filter out these bonds before you start anything that has to do with the optimization. This should be the way to go if you are interested in speeding up your program.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;B) If you want to do everything in the optimization, then you need constraints of the form&#xA;$$&#xA;w_i = 0 \text{ if asset }i \text{ does not pass the filter} &#xA;$$&#xA;doing this you have all bonds in you optimization universe but you have unnecessarily many variables. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. If your univers is $10^6$ bonds and only $20\%$ satisfy the filter then using A) you only have 200 000 variables and using B) you have $10^6$ variables and 800 000 with a trivial constraint.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another issue is that your problem is very big ...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT After some comments by the OP: What you want to do is an optimization with cardinality constraint. Such constraints are difficult to handle. With these you leave the realm of continuous optimization and you enter mixed-integer quadratic programs. You either need some heuristics that you believe in or better you look for a (most of the time) commercial solver that can handle integer constraints.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you do is you introduce additional variables $k_i,i=1,\ldots,n$ and the constraints&#xA;$$&#xA;k_i \in \{0,1\} \\&#xA;w_i \le k_i \\&#xA;\sum k_i \le K&#xA;$$&#xA;for some integer $K$. The objective function is unchanged.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2014-04-14T10:59:18.660" LastActivityDate="2014-04-14T10:59:18.660" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="10935" PostTypeId="2" ParentId="10932" CreationDate="2014-04-14T15:04:55.230" Score="3" Body="&lt;p&gt;I would use a &lt;a href=&quot;http://en.wikipedia.org/wiki/Metropolis%E2%80%93Hastings_algorithm&quot; rel=&quot;nofollow&quot;&gt;Metropolis Monte Carlo &lt;/a&gt;/ &lt;a href=&quot;http://en.wikipedia.org/wiki/Simulated_annealing&quot; rel=&quot;nofollow&quot;&gt;simulated annealing&lt;/a&gt; approach to solve your problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Start with an arbitrary fully invested portfolio which satisfies constraints (2), (3) and the cardinality constraint $N \le K$. Then choose one of the following trial moves:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Select two bonds $i,j$ at random and perform a random weight shift $w_i \rightarrow w_i + \delta w$, $w_j \rightarrow w_j - \delta w$, or&lt;/li&gt;&#xA;&lt;li&gt;Remove a bond at random and rescale the portfolio weights to $\sum w_i = 1$, or&lt;/li&gt;&#xA;&lt;li&gt;add a new bond to the portfolio and rescale weights&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;After each of these trial moves, check if all the constraints are satisfied, and use the Metropolis condition to accept the trial configuration with probability  $\min(1,\exp((o_{trial} - o_{old})/T))$. $o_{trial}, o_{old}$ is the objective function and $T$ is a 'temperature' which is initialized such that the exponential of the Metropolis condition is of order 1. $T$ is gradually reduced until the portfolio is 'frozen' into an optimal or near-optimal configuration. This terminates the optimization.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remarks: trial move 1 should be choosen much more frequently (perhaps 90%), and if the portfolio is long-only then this restricts the possible trial moves in 1.&lt;/p&gt;&#xA;" OwnerUserId="6721" LastEditorUserId="6721" LastEditDate="2014-04-14T15:36:16.700" LastActivityDate="2014-04-14T15:36:16.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10936" PostTypeId="1" AcceptedAnswerId="10955" CreationDate="2014-04-14T17:58:31.547" Score="3" ViewCount="690" Body="&lt;p&gt;I am a math student and I am trying to understand the budget constraint in Sharpe Ratio optimization for portfolio design.   Recall the budget constraint requires that the sum of the portfolio weights is 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now suppose all of the expected returns are negative and identical.   Then the budget constraint will result in a negative Sharpe ratio.  However without this constraint the Sharpe ratio will be positive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems to me that the less restrictive budget constraint that the sum of portfolio weights not equal to 0 should be used instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a reason why the sum of portfolio weights has to be 1 ( or even positive).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks &lt;/p&gt;&#xA;" OwnerUserId="5723" LastActivityDate="2014-04-16T14:33:48.750" Title="Budget Constraint in Sharpe Ratio Optimization" Tags="&lt;portfolio-management&gt;&lt;mathematics&gt;&lt;portfolio-selection&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10937" PostTypeId="2" ParentId="10936" CreationDate="2014-04-14T18:25:34.833" Score="1" Body="&lt;p&gt;Portfolio management is about solving problems in the real world. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the real world, it is highly unlikely that EVERY asset has a negative expected return. If all the assets in your universe have negative returns, expand your universe to include a short-term fixed income security that is bound to produce a return greater than (or at a minimum equal to) zero. Alternately, assume it is a recession and every asset has a negative return over a short horizon. Even then, it is highly unlikely that the negative return is identical for all. This would suggest that some long-only managers could lose less money by focusing on the securities that are likely to fall less in a recession. Long-short managers could go short some of the other securities with even weaker expected returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's no mathematical reason you can't have a budget constrained between 0 and 1, even if you don't consider a risk-free or short-term fixed income instrument. Then, the optimal portfolio would invest in nothing. In the real world, budget constraints are driven more by business reasons than any mathematical reason. Investors don't want to pay equity (or hedge fund) manager fees for investment management companies to not invest their money in anything. Further, many managers are not judged on an absolute basis, but a relative one. What matters is what their benchmark is doing or what their peers are doing. So even if the benchmark declines, they can still make large institutional managers happy if they decline by less than the benchmark.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2014-04-14T18:25:34.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10938" PostTypeId="2" ParentId="10887" CreationDate="2014-04-14T20:57:09.843" Score="0" Body="&lt;p&gt;Correlations between what?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Correlations between stock A and another stock B - relative value arbitrage - not sure if small correlations will help here. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Correlations between stock A and its future stock return Ra - its called Information Coefficient. Try &lt;a href=&quot;http://www.barra.com/newsletter/nl163/SevIns3NL163.asp&quot; rel=&quot;nofollow&quot;&gt;Fundamental Law of Active Management&lt;/a&gt; and many similar web info on Fundamental Law for more information. &lt;/p&gt;&#xA;" OwnerUserId="5948" LastActivityDate="2014-04-14T20:57:09.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10939" PostTypeId="1" CreationDate="2014-04-14T22:24:40.630" Score="3" ViewCount="2783" Body="&lt;p&gt;I have some trouble with the following code. Some jump and a decentered path are present but it's not the case, normally for Black Scholes diffusion!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is anyone see a problem in my code ?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import numpy as np&#xA;import matplotlib.pyplot as plt&#xA;&#xA;mu  = 0&#xA;sig = 0.5&#xA;&#xA;def generate(S0, T, nt, sig, mu):&#xA;    nt = int(nt)&#xA;    T = float(T)&#xA;    dt  = T / nt&#xA;&#xA;    St  = [S0] * nt&#xA;&#xA;    t   = linspace(0,T,nt)&#xA;    dWt = np.random.normal(0, 1, nt)&#xA;    dWt[0] = 0.&#xA;    Wt  = dWt.cumsum()&#xA;&#xA;    return S0 * np.exp(sig * sqrt(float(dt)) * Wt + (mu - sig**2/2.) * t)&#xA;&#xA;    for i in range(100):&#xA;    plt.plot(generate(180., 2., 252*2, sig, mu))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/8tAsI.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="7610" LastEditorUserId="2183" LastEditDate="2017-07-05T21:45:47.463" LastActivityDate="2017-07-05T21:45:47.463" Title="Black Scholes diffusion well coded in Python" Tags="&lt;black-scholes&gt;&lt;python&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10940" PostTypeId="1" CreationDate="2014-04-14T23:32:33.273" Score="1" ViewCount="10538" Body="&lt;p&gt;Can anybody please explain in layman terms why the DV01 of a eurodollar futures contract is 25? I can mathematically calculate in different ways, but not able to convince myself, especially how is it still $25 if somebody is buying a contract in the middle of the 3-month period. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="7801" LastActivityDate="2016-04-21T22:07:47.167" Title="Dv01 of Eurodollar futures contract" Tags="&lt;eurodollars&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10943" PostTypeId="2" ParentId="10895" CreationDate="2014-04-15T04:48:29.950" Score="2" Body="&lt;p&gt;Equity is for the bulls; debt is for the bears. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It depends on what kind of capital is available for financing and what the group needing capital can offer in terms of security. Early stage startups have nothing to offer but future returns (especially if they are cash-flow negative). A high risk investment with little collateral and a high burn rate may not be able to find debt financing at any interest rate, but there may be an investor willing to take an equity position. Alternatively, a bank may not see much upside in a single-family home, so would not be willing to take an equity position, but would be willing to except a lower rate of return on a 80% LTV.&lt;/p&gt;&#xA;" OwnerUserId="7803" LastActivityDate="2014-04-15T04:48:29.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10944" PostTypeId="2" ParentId="10926" CreationDate="2014-04-15T06:49:36.040" Score="2" Body="&lt;p&gt;As alexis0587 said, with any gross producer margin (GPM) spread, you capture the differential of outputs less inputs since that reflects your profit for running the plant:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\pi = p_e-p_{ng}-p_h-\kappa$$  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\pi$ denotes profit, $p_e$ electricity price, $p_{ng}$ energy-equivalent factor adjusted natural gas price, $p_h$ equivalent factor adjusted emissions costs, and $\kappa$ denotes maintenance and other costs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So effectively, if the spark spread increases (decreases) as you are operating the plant, $\pi$ incrases (decreases). Your position behaves as though you are long the synthetic asset of &quot;spark spread&quot; which is inherently long electricity and short natural gas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suspect this may be confusing you: as a producer, you may wish to hedge against increasing natural gas prices by buying futures, say, thereby being long the inputs, but the hedge is to &lt;em&gt;offset potential losses incurred from holding your primary position&lt;/em&gt; of long the GPM spread (long outputs, short inputs). &lt;/p&gt;&#xA;" OwnerUserId="7536" LastEditorUserId="7536" LastEditDate="2014-04-15T07:10:51.297" LastActivityDate="2014-04-15T07:10:51.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10945" PostTypeId="2" ParentId="10940" CreationDate="2014-04-15T07:07:35.190" Score="10" Body="&lt;p&gt;ED contracts are quoted as: $100-LIBOR_{3M}$, where the three-month LIBOR rate is annualized. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, an annualized rate of 3.00% would yield a quote of 97. A one basis point change would now yield a quote of 96.99 or 97.01, resulting in a loss or gain in \$25. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By construction, the DV01 is \$25, which effectively results in the fact that the underlying reference is roughly \$1,000,000 since each contract is for 1/4 of the year and $\$10^6 \times \frac{90}{360} \times 0.0001 = \$25$ (although the precise amount varies with the days in the period). Really, depending upon the interval day count, it is possible to have notional values from &lt;a href=&quot;http://www.cmegroup.com/trading/interest-rates/files/eurodollar-futures-reference-guide.pdf&quot;&gt;\$1.046M to \$0.947M&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So really the answer to your question is because the CME defines the contract that way.  &lt;/p&gt;&#xA;" OwnerUserId="7536" LastActivityDate="2014-04-15T07:07:35.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10946" PostTypeId="2" ParentId="7402" CreationDate="2014-04-15T07:41:04.683" Score="4" Body="&lt;p&gt;thanks for all answers above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;William's answer is more direct. actually i was quite new to the calibration area one year ago, so my question is quite simple but that simplicity might mislead others to a complex context.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to comment on my own question in case anyone new to it might drop it, Damiano Brigo's book Interest Rate Models Theory and Practice (2006) could serve as a simple start-up.&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2014-04-15T07:41:04.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10947" PostTypeId="2" ParentId="9247" CreationDate="2014-04-15T08:04:13.833" Score="0" Body="&lt;p&gt;I think CMG means &quot;Crisis Management Groups&quot;&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2014-04-15T08:04:13.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10948" PostTypeId="2" ParentId="8768" CreationDate="2014-04-15T08:22:07.293" Score="0" Body="&lt;p&gt;to answer my own question, there's no popular model for the question, that $dS/S=\mu(t)dt+\sigma(t)dW$, and $\sigma(t)$ is correlated with $\mu(t)$. the general framework should be stochastic volatility model, but need do the extension on my own.&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2014-04-15T08:22:07.293" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10949" PostTypeId="2" ParentId="10897" CreationDate="2014-04-15T10:02:59.760" Score="2" Body="&lt;p&gt;Essentially the market splits this discounting into 2 parts; risk-free discounting and credit risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take a market IRS in USD; it will fix on USD Libor (fixed in London). But Libor is a measure of unsecured interbank lending, and a standard IRS contract these days is cash collateralised and daily margined, so Libor isn't really a good fit, so the discounting instead is done using OIS rates (Fed funds in the US, Eonias in EUR, Sonias in UK etc). Margins generally accrue at OIS rates too, just to complete the circle. Thus we use OIS as a measure of the risk free rate term structure, and calculate the risk-free PV of a given set of cash flows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The credit risk, on the other hand, is particular to a counterparty; it depends on the collateral arrangements we have with them and our perception of their riskiness. The collateralisation of a particular instrument will be written first into the contract (the Credit Support Annex to the ISDA contract for IRS) and secondly into collateral netting agreements between the counterparties. If we have a large portfolio of outstanding swaps between us, a lot of the exposure will net out and leave us needing less collateralisation. On the other hand, if we only actually exchange collateral rarely, or use lower quality collateral like CP or ABS, then it gets a bigger haircut and we need more of it, raising the cost of the collateral maintenance. This side of it is generally covered by a charge called the Credit Valuation Adjustment, which a desk in a bank will take responsibility for and charge other desks to receive the risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus a price might be 1.24% quoted, with a further 5bp CVA charge for a given counterparty.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the CVA desk takes our risk for a given price, we can value the instrument on a risk free basis first, then adjust it for the counterparty. Otherwise we would need to calculate all the credit default curves in order to discount an instrument separately for each counterparty.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An interesting effect of CVA is that if you only assume your counterparty is risky, and ignore your own credit risk (unilateral CVA), you will end up just discounting their flows and end up with a wider spread - you would need more compensation to take either side. However, if you discount your own cash flows too (bilateral CVA), you find that for example for an IRS, both legs are discounted, so the price itself does not move unless there is an asymmetry in your perception of your risk vs theirs.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2014-04-15T10:02:59.760" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10952" PostTypeId="2" ParentId="10903" CreationDate="2014-04-15T18:34:49.507" Score="2" Body="&lt;p&gt;I am not sure about this specific algorithmic implementation, but I am a bit confused by your indexes and suspect you might be as well (e.g. $M$ not defined, you're showing cases of $i$ looping when it seems you mean $j$). I think it would be useful to revisit the basics:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $D_t \in (0,1]$ be the present value factor for a cash flow at time $t$. By construction, $D_0 = 1$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Often, $B(0,t_j) = \text{exp}\{\int_0^{t_j} r(t) \ dt\}$ denotes a money market account as a numeraire. The discrete equivalent, as in your implementation, is $B(0,t_j) = \text{exp}\{\sum_{i=0}^{j} r(t_i) \Delta t_i\}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are building your rates from data from zeroes, you would take the reciprocal $B(0,t_j)^{-1}$, and equate this with the price for the zero with maturity $t_j$ (adjusting for quoting by multiplying by 100). It looks like this is what your $B(0,t_j)$ denotes, from the $-1$ in the exponential. This makes sense (since Bond begins with a &quot;b&quot;), but it could be initially confusing if you are reading papers with the other notation. Anyway, I will use your notation hereafter.  &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Anyway, in your implementation: &#xA;Since your $\Delta t$ is constant,&#xA;$$&#xA;B(0,t_j) = \text{exp}\left(-\Delta t \sum_{i=0}^{j} r(t_i)\right)  \\&#xA;$$&#xA;where $r(0) = 0$ and $r$ is the annualized rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For clarity, the first iteration, $j=1$, yields: &#xA;$$&#xA;B(0,t_1) = \text{exp}\{-0.25(0+r(t_1))\} \\&#xA;$$&#xA;and the second iteration, $j=2$, yields:&#xA;$$&#xA;B(0,t_1) = \text{exp}\{-0.25(0+r(t_1)+r(t_2))\} \\&#xA;$$&#xA;Iterating this for all of your $t$ values should give you what you are looking for. &lt;/p&gt;&#xA;" OwnerUserId="7536" LastActivityDate="2014-04-15T18:34:49.507" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10953" PostTypeId="2" ParentId="10940" CreationDate="2014-04-15T19:42:17.787" Score="3" Body="&lt;p&gt;Jacob nailed it, but I'll add something else that might have been confusing you. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can never buy eurodollar futures part way through the 3-month period. They always have 3 month of life to them, starting just after the expiration of the futures contract. So they will always be paying/receiving 3 months worth of interest. And therefore Jacob's math applies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you could enter into eurodollar futures after the start of the term, then the DV01 would diminish over time, as you expected. But that product doesn't exist as a futures contract.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Jacob's math is made simpler and more accurate because eurodollar futures are cash settled, so there isn't really a term at all. It's just a formula that the CME asserted, which vaguely replicates a 3 month loan/deposit.&lt;/p&gt;&#xA;" OwnerUserId="5550" LastActivityDate="2014-04-15T19:42:17.787" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10955" PostTypeId="2" ParentId="10936" CreationDate="2014-04-15T20:04:34.443" Score="2" Body="&lt;p&gt;I see your argument with the math. &quot;1&quot; is an arbitrary choice of positive numbers, and you could choose anything. In the end, you're going to scale the whole thing to fit your capital anyway.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are using a numerical optimizer, it will be happier with something noticeably away from 0 and away from infinity, so I recommend choosing a specific positive number, rather than just a &gt;0 constraint.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The real world doesn't present situations where all assets have negative returns and you have a positive budget constraint. John's idea of adding cash/t-bills should fix the problem from a mechanics/math point of view.&lt;/p&gt;&#xA;" OwnerUserId="5550" LastActivityDate="2014-04-15T20:04:34.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10956" PostTypeId="1" CreationDate="2014-04-15T21:57:02.213" Score="2" ViewCount="1391" Body="&lt;p&gt;I want to price an American swaption but I am not sure about what I am doing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tree methods and PDE discretization seem difficult to adapt to a swaption. &#xA;I am trying a Monte-Carlo approach. (in another subject I am trying a PDE approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First I have american option retrograde equations (timestep $\delta$t):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ V_t = max(\phi(S_t), E(e^{-r \delta t} V_{t+\delta t} | F_t )   $$&#xA;$$ V_T = \phi(S_T) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(source: my old courses)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And Black's formula for an European call swaption:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ C_t = (\delta \sum_{j=n+1}^{M+1} Z_t^{T_j})[R(t,T_n,T_m) \Phi(d_1) - \hat{R} \Phi(d_2)] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(&lt;a href=&quot;http://www.columbia.edu/~mh2078/market_models.pdf%E2%80%8E&quot; rel=&quot;nofollow noreferrer&quot;&gt;source&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are my questions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Is it possible to mix american option retrograde equation with the Black's formula ? What do I need to use for the payoff $\phi$ ? for the expectation (under probability ?) ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) What do I need then ? I think the next step is to introduce a model for r, Z or R, calibrate it and then I can simulate it and go for the classical monte carlo method for american option. What are my options now ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Is there any better MC method (QMC or Longshaft-Schwartz) wich would be more adapted ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have asked another question to the community about PDE Pricing for American swaption: &lt;a href=&quot;https://quant.stackexchange.com/questions/10967/american-swaption-pricing-with-pde-discretization&quot;&gt;American Swaption Pricing with PDE discretization&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I think my main question is in fact really simple. If I want to work with known simulated paths ($S_t$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I calculate the $V_t$ backwards simply using $V_t = max(\Phi(S_t),V_{t + \delta t})$ ? &lt;/p&gt;&#xA;" OwnerUserId="5052" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2014-06-28T00:18:02.000" Title="American Swaption Pricing with Monte-Carlo method" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;monte-carlo&gt;&lt;swaption&gt;&lt;black-scholes-pde&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10958" PostTypeId="2" ParentId="1198" CreationDate="2014-04-16T08:04:15.357" Score="2" Body="&lt;p&gt;I know that this question is quite old, but I uploaded a matlab implementation of the method to fileexchange:&#xA;&lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/46253-arbitrage-free-smoothing-of-the-implied-volatility-surface&quot; rel=&quot;nofollow&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/46253-arbitrage-free-smoothing-of-the-implied-volatility-surface&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7396" LastActivityDate="2014-04-16T08:04:15.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10959" PostTypeId="1" CreationDate="2014-04-16T09:27:35.613" Score="3" ViewCount="371" Body="&lt;p&gt;I have some work to do on the drivers of government bond spreads - ie. across terms (not across governments) of the yield curve, say 5yr and 20yr bond spreads from the same government issuer - and am having a bit of conceptual difficulty with this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have done some reading and get a sense that potential drivers could be: &#xA;credit risk (measured by Credit default swap (CDS) rates); &#xA;liquidity risk (measured by bid-ask apreads); &#xA;risk aversion; &#xA;crisis-period variable (a indicator variable assigned a value 1 during the latest financial crisis); &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should I just take the difference of these variables (and assume the differencing renders the variables stationary) and then run OLS regression of the bond spreads on the drivers?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there better ways to go about this? Would PCA have any application here?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance for any advice&lt;/p&gt;&#xA;" OwnerUserId="7814" LastActivityDate="2018-05-24T15:58:14.403" Title="Bond Spread Drivers" Tags="&lt;fixed-income&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10960" PostTypeId="1" AcceptedAnswerId="10961" CreationDate="2014-04-16T09:31:03.147" Score="9" ViewCount="4606" Body="&lt;p&gt;I was recommended to read something about Brownian Bridge. Could someone familiar with BB give some recommendation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It was mentioned that BB benefits in 2 places&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;BB could reduce the simulation paths, this reduces computation effort, especially when the underlying factors are a lot (say 20-30). &#xA;I noticed that Papageorgiou1 has a paper &quot;The Brownian Bridge Does Not Offer a Consistent Advantage in Quasi-Monte Carlo Integration&quot; (2002). So does this point still hold?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;BB could reduce the computation effort on path-dependent derivatives. For example, during pricing of a barrier option, a path could be simulated with monthly scenarios of the factors; then BB could be used to estimate the probability of the path &quot;knock-out&quot; of the barrier.&#xA;Which paper/book would you recommend on this topic?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2014-04-29T12:32:23.860" Title="Usage of Brownian Bridge?" Tags="&lt;monte-carlo&gt;&lt;brownian-motion&gt;&lt;numerical-methods&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10961" PostTypeId="2" ParentId="10960" CreationDate="2014-04-16T14:11:29.147" Score="3" Body="&lt;p&gt;The Papageorgiou paper is presumably referring specifically to &lt;em&gt;quasi&lt;/em&gt;-random sequences used in path generation.   Researchers had noticed that, in high dimensions, QR sequences tend to have good space coverage for the first couple of dimensions:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/6vWvH.png&quot; alt=&quot;First Two&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but terrible coverage for the latter dimensions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/VR6Hp.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Plots here are points 101-200 from a 32-dimensional QR sequence)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One solution proposed was to make sure most variation was from the first few dimensions by taking terminal path values from them, and then &quot;filling in&quot; the path with lower-quality latter dimensions.   In practice I believe this has been superseded by scrambling tricks.  See &lt;a href=&quot;ftp://ftp.math.hkbu.edu.hk/pub/techreport/math256.pdf.gz&quot; rel=&quot;nofollow noreferrer&quot;&gt;this paper&lt;/a&gt; for a decent review.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know of a paper covering bridges for &quot;knock-out&quot; probabilities, which is more of a practitioner's trick than an academic's research project, though the computational aspects might well be covered in something like &lt;a href=&quot;https://www.goodreads.com/book/show/100827.Options_Futures_and_Other_Derivatives&quot; rel=&quot;nofollow noreferrer&quot;&gt;Hull&lt;/a&gt; or &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/052159233X&quot; rel=&quot;nofollow noreferrer&quot;&gt;Shaw&lt;/a&gt;.  The math is not particularly tricky.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2014-04-17T13:02:10.797" LastActivityDate="2014-04-17T13:02:10.797" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10962" PostTypeId="2" ParentId="10936" CreationDate="2014-04-16T14:33:48.750" Score="3" Body="&lt;p&gt;In many cases, clients want to be fully invested and don't want their assets lying around in cash. Hence the budget constraint $\sum_i w_i = 1$ is fairly common in practice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, there are also cases where the constraint $\sum_i w_i = 0$ is applied: the result is a dollar neutral portfolio with long and short positions, but no net investment (short positions with $w_i &amp;lt; 0$ are allowed in this case). Finally, it is also possible to discard the budget constraint altogether and constrain the volatility or the tracking error instead. In that case, the portfolio has a risk budget constraint.&lt;/p&gt;&#xA;" OwnerUserId="6721" LastActivityDate="2014-04-16T14:33:48.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10963" PostTypeId="1" CreationDate="2014-04-16T16:57:35.283" Score="0" ViewCount="55" Body="&lt;p&gt;The following is a result I get from a pair trading model. I am trying to figure out the significance of the below but failing. Can someone help me out i.e. a resource or possibly an explanation on the significance/result of this:&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Results Summary (Test 1)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Data: &#xA;Effective sample size: 58583&#xA;Model: H1&#xA;Lags: 1&#xA;Statistic: trace&#xA;Significance level: 0.05&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;r  h  stat      cValue   pValue   eigVal&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;0  0  9.3117    15.4948  0.3847   0.0001&lt;br&gt;&#xA;1  0  2.0914    3.8415   0.1483   0.0000  &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Results Summary (Test 2)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Data: &#xA;Effective sample size: 58582&#xA;Model: H1&#xA;Lags: 2&#xA;Statistic: trace&#xA;Significance level: 0.05&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;r  h  stat      cValue   pValue   eigVal&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;0  0  9.1995    15.4948  0.3957   0.0001&lt;br&gt;&#xA;1  0  2.0402    3.8415   0.1535   0.0000  &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Thanks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: I am new to quantitative analysis. Please recommend a book which would be good for an absolute newbie.&lt;/p&gt;&#xA;" OwnerUserId="7816" LastActivityDate="2014-04-16T16:57:35.283" Title="Significance of Data" Tags="&lt;quant-trading-strategies&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10965" PostTypeId="1" CreationDate="2014-04-16T19:06:57.290" Score="0" ViewCount="64" Body="&lt;p&gt;Engle Granger test is giving me a ans = 0.&#xA;The correlation factor is: 0.8+&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this imply the No cointegration hypothesis is true? i.e. as per my understanding that there is cointegration?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using matlab.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks. I am completely new to matlab and this level of statistics/econometrics. I have been trading pairs using lower level stats and looking to improve the model.&lt;/p&gt;&#xA;" OwnerUserId="7816" LastActivityDate="2014-04-16T19:06:57.290" Title="Engle Granger test returns a 0 in matlab, while correlation factor is .80+. Am I doing something wrong?" Tags="&lt;matlab&gt;&lt;quantitative&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="10966" PostTypeId="1" CreationDate="2014-04-16T19:21:43.300" Score="2" ViewCount="364" Body="&lt;p&gt;I am looking at some academic studies regarding volume of stock traded.  Yahoo Finance is used as the data source for volume.  Does anyone know where the volume figure comes from?  Is it a compilation of feeds from a number of exchanges?  Or just a couple of exchanges?&#xA;Assuming that the volume reported by Yahoo Finance is a subset of total volume traded, does anyone have an opinion as to whether or not the figure is representative of what actually trades in a particular day? &lt;/p&gt;&#xA;" OwnerUserId="6234" LastActivityDate="2014-04-17T13:16:40.777" Title="source for yahoo finance equities volume traded" Tags="&lt;equities&gt;&lt;trading&gt;&lt;yahoo&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10967" PostTypeId="1" CreationDate="2014-04-16T19:25:31.613" Score="2" ViewCount="473" Body="&lt;p&gt;So I am still trying to price an american swaption. (MC approach here: &lt;a href=&quot;https://quant.stackexchange.com/questions/10956/american-swaption-pricing-with-monte-carlo-method&quot;&gt;American Swaption Pricing with Monte-Carlo method&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've found in Paul Wilmott, The mathematics of financial derivatives, a PDE for swaption:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \partial_tV + \frac{1}{2}w^2\partial_{rr}V+(u-\lambda w) \partial_rV-rV = 0 $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;with terminal condition:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ V(r,T)= max(V_S(r,T)-E,0) $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $V_S(r,t)$ is the price of a swap of maturity $T_S$. I think I can use the same formula: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ V_t = (\delta \sum_{j=n+1}^{M+1} Z_t^{T_j})[R(t,T_n,T_m) \Phi(d_1) - \hat{R} \Phi(d_2)] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.columbia.edu/~mh2078/market_models.pdf%E2%80%8E&quot; rel=&quot;nofollow noreferrer&quot;&gt;Source&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Is it ok to work with that ? Where is handled the fact that we have accrual payments ? what would be the expression of E ? $V_S(\hat{r},T)$ ? I think in my case that $T=T_S$ is this possible ? this would mean that the last value is 0, no ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code seems simple to change between European and american option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) The notations are not consistants, what would be the link between r,Z,R ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I think we have to choose a model for r (such that $w², u-\lambda w$ are simple).Vasicek for exemple will give:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ w^2 = \alpha_0 $$ &#xA;$$ u - \lambda w = -\gamma_0 r(t) + \eta_0 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Is this a good approach ? In term of simulating Z,R after r ? In term of calibrating the model ? (I understand that it depends on what data I will have access to, but for the moment I don't know that, I am not working with swaption for financial market). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think after the choice of the model it won't be a problem to discretize my PDE. &lt;/p&gt;&#xA;" OwnerUserId="5052" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2014-04-16T19:25:31.613" Title="American Swaption Pricing with PDE discretization" Tags="&lt;option-pricing&gt;&lt;american-options&gt;&lt;swaption&gt;&lt;black-scholes-pde&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10968" PostTypeId="1" AcceptedAnswerId="20660" CreationDate="2014-04-16T19:53:10.313" Score="5" ViewCount="464" Body="&lt;p&gt;In a trading manual I got during a course, the value of the ATM Call-Spread is approximated by $CS_{ATM}=\frac{1}{2}StrD+(F-m)\times\Delta CS$&#xA;The lecturer skipped the part where he derived this approximation. And couldn't answer why this formula holds. So does anyone have a clue?&#xA;StdrD=Strike Difference, &#xA;m= midpoint between the strikes of the call spread&#xA;F=future&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Delta CS$ was approximated by $0.33\times\frac{StrD}{Straddle}$ (which is a consequence of the normal distribution)&#xA;Where we take straddle equal to a standard deviation (actually $\sqrt(\frac{2}{\pi})$ times would be more precise.&lt;/p&gt;&#xA;" OwnerUserId="2402" LastActivityDate="2015-10-07T14:50:26.100" Title="At-the-money Call Spread approximation" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;spread&gt;&lt;call&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10970" PostTypeId="2" ParentId="10956" CreationDate="2014-04-17T02:48:21.133" Score="2" Body="&lt;p&gt;American options pricing (swaption is just a kind of option) is a bit tricky due to the early exercise. &lt;a href=&quot;http://www.global-derivatives.com/index.php?id=14&amp;amp;option=com_content&amp;amp;task=view&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; is a page listing possible approaches, including some numeric methods, and some close form approximation formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I understand, lattice methods (tree, PDE discretization such as forward shooting) are fine to price American options. There're complains on the converge speed but I'm not sure how serious it is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When it comes to path dependent options, Monte Carlo probably is the most popular method, as now the tree cannot recombine. The problem is now in each path we cannot look ahead into the future to compute $\mathbb{E}\{V(t_{i+1},W_{t_{i+1} } )  |  W_{t_i} \}$ , as that information we will not have in real life. Binomial tree won’t have such a trouble, but Monte Carlo world is no longer a filtration.&#xA;Longstaff (2001) proposed a regression estimation. L.C.G.Rogers improved it a bit afterwards.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if your model is not path dependent, I'd second Brian on adopting trees or other lattice methods.&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2014-04-17T02:48:21.133" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10971" PostTypeId="1" CreationDate="2014-04-17T06:47:55.093" Score="1" ViewCount="1566" Body="&lt;p&gt;I am using .net/c++ version of quickfix.&#xA;How does logging effect Quickfix performance?&#xA;If I disable logging to file, can it help to increase performance of quickfix?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;" OwnerUserId="7820" LastActivityDate="2015-01-10T21:17:59.087" Title="How does logging effect Quickfix performance?" Tags="&lt;fix&gt;&lt;programming&gt;&lt;quickfix&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10972" PostTypeId="2" ParentId="10959" CreationDate="2014-04-17T07:19:04.920" Score="2" Body="&lt;p&gt;A good piece of literature on this is &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/0022-1082.00402/abstract&quot; rel=&quot;nofollow noreferrer&quot;&gt;Colin-Dufresne et al. (2001), &amp;quot;The Determinants of Credit Spread Changes&amp;quot;, Journal of Finance, 56, 2177-2207.&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;I think differencing all variables is a good idea in this case. Not only because of stationarity concerns but also because of unobserved time-invariant issuer-level characteristics.&lt;/p&gt;&#xA;&lt;p&gt;I do not see the case for a PCA here. Usually you use PCA to reduce dimensionality of sometimes highly correlated variables. Here you have variables at hand that seem to capture different risk premia.&lt;/p&gt;&#xA;" OwnerUserId="7344" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2014-04-17T07:19:04.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10974" PostTypeId="1" CreationDate="2014-04-17T07:52:36.357" Score="3" ViewCount="236" Body="&lt;p&gt;We are testing Markov switching models to forecast risk regimes, similar to the paper by &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2066848&quot; rel=&quot;nofollow&quot;&gt;Kritzman, Page and Turkington&lt;/a&gt;. We find that in some cases the &lt;a href=&quot;http://en.wikipedia.org/wiki/Baum%E2%80%93Welch_algorithm&quot; rel=&quot;nofollow&quot;&gt;Baum-Welch&lt;/a&gt; algorithm converges very slowly or not at all. Apparently this issue is known for hidden Markov models in speech recognition and other fields, where several alternatives to Baum-Welch have been proposed: for example, &lt;a href=&quot;http://acl.ldc.upenn.edu/D/D07/D07-1031.pdf&quot; rel=&quot;nofollow&quot;&gt;Bayesian estimation&lt;/a&gt; by M. Johnson or estimators based on an &lt;a href=&quot;http://www.merl.com/publications/docs/TR98-19.pdf&quot; rel=&quot;nofollow&quot;&gt;entropic prior&lt;/a&gt; by M. Brand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have these alternatives been applied to financial times series? Is there a reason to favor one particular approach, apart from slow convergence?&lt;/p&gt;&#xA;" OwnerUserId="6721" LastEditorUserId="6721" LastEditDate="2014-04-17T08:06:31.320" LastActivityDate="2014-04-17T08:06:31.320" Title="Markov switching model estimation" Tags="&lt;models&gt;&lt;calibration&gt;&lt;hidden-markov-model&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10976" PostTypeId="2" ParentId="10932" CreationDate="2014-04-17T10:08:21.290" Score="1" Body="&lt;p&gt;Assume that instead of a possible portfolio of 1000 bonds, the portfolio may only contain M bonds. The input vector then needs to contain both the weightings and the choice of bonds, but how can you present the choice of bonds as an input vector?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider sorting the candidate bonds by Macaulay duration. Given a single Macaulay duration value, then, you could locate the nearest 2 bonds to that duration, and weight each of them according to the closeness of the duration match. E.g. I want 2.75y duration and I have bonds with durations of 2y and 3y, so weight them 75% 3y and 25% 2y. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The input vector is then a set of duration values, and a set of weights, like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dur   wt&#xA;1.0   0.25&#xA;2.75  0.5&#xA;5     0.15&#xA;25    0.1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That would become a portfolio like this (I'm putting in rough numbers):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dur   wt&#xA;0.97  0.24&#xA;1.2   0.01&#xA;2.0   0.125&#xA;3.0   0.375&#xA;5.0   0.15&#xA;20    0.005&#xA;25.1  0.095&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you're keen to minimise the size of the portfolio, then you can filter out values below some threshold when you score the portfolio with your objective function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've avoided just picking the nearest bond to a given duration here because minimisers generally work best with smooth objective functions; if the trial vector shifts slightly and a different bond is selected, the jump is sudden rather than smooth and may represent a local maximum. This way there is a smooth transition between selecting the 2yr vs the 2.5yr bond. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can replace the Macaulay duration with any linear scale which measures the set of bonds; it is going to be used fairly blindly by the minimisation algorithm as a black box. The key is to have a way to move a pointer smoothly along the spectrum of bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One interesting possibility is to include a penalty dependent on the number of bonds in use; if you can quantify the value of having of 5 bonds over 10, then you can include that. A small penalty permits the minimiser to initially concentrate on getting to the right area of the search space, and then later to optimise the tradeoffs that suit the smaller detail, e.g. eliminating a bond from the portfolio by raising the weights of the values around it. Again, make the penalty smooth; perhaps the total bond count plus the smallest non-zero weight.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2014-04-17T10:08:21.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10977" PostTypeId="1" AcceptedAnswerId="11035" CreationDate="2014-04-17T11:50:48.893" Score="4" ViewCount="1534" Body="&lt;p&gt;I wanted to optimize a portfolio based on a portfolio-wide CVaR constraint (i.e. $CVaR_p \leq 0.08$). Unfortunately, I only find solution that minimizes the entire CVaR of the Portfolio.&#xA;&lt;img src=&quot;https://i.stack.imgur.com/qZBZV.jpg&quot; alt=&quot;Exhibit Gordon 2007&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you mind telling me if I need to add a restriction or how to change the utility function?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, you find the initial data and optimization &lt;a href=&quot;http://www.leippold.ch/matlab.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Link&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Edit&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I removed some stupid elements. I will give a full answer once I finished the semester at the university.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Links&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Paper &lt;a href=&quot;http://www.engineering.uiowa.edu/~krokhmal/pdf/cvar.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Portfolio Optimization with Conditional Value-at-Risk Objective and Constraints&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7373" LastEditorUserId="7373" LastEditDate="2014-05-02T08:35:54.413" LastActivityDate="2014-05-02T08:35:54.413" Title="Portfolio optimization with Portfolio CVaR Constraint" Tags="&lt;portfolio&gt;&lt;portfolio-optimization&gt;&lt;cvar&gt;" AnswerCount="1" CommentCount="10" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10978" PostTypeId="2" ParentId="10966" CreationDate="2014-04-17T13:16:40.777" Score="-2" Body="&lt;p&gt;Any share can be listed on any exchange. However Yahoo allows you to get the Price Data per exchange. So the Price Data (including volume) you download will be the volume that was traded on the exchange that you have specified to get the Data from. Not an accumulation of exchanges that the company may be listed on.&#xA;When you type a ticker in google, the exchange is listed after the company name. For example type BHP, an australian company. The exchanges they are listed on show below that, and you can request that data specific to the exchange you are interested in.&#xA;Hope that helps. &lt;/p&gt;&#xA;" OwnerUserId="7835" LastActivityDate="2014-04-17T13:16:40.777" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="10979" PostTypeId="1" AcceptedAnswerId="10981" CreationDate="2014-04-17T16:45:34.863" Score="0" ViewCount="367" Body="&lt;p&gt;I am software developer with no previous experience or knowledge in finance and have recently been starting to build my knowledge in this area. I am working through the book: Paul Wilmott Introduces Quantitative Finance. I ran into an exercise question that I haven't been able to fully figure and was hoping someone could enlighten me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;A share currently trades at $60. A European call with exercise price $58 and expiry&#xA;in three months trades at $3. The three month default-free discount rate is 5%. A&#xA;    put is offered on the market, with exercise price $58 and expiry in three months, for&#xA;$1.50. Do any arbitrage opportunities now exist? If there is a possible arbitrage, then&#xA;construct a portfolio that will take advantage of it. (This is an application of put-call&#xA;parity.)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have been able to figure out that there is in fact arbitrage (I think anyway) in this situation using the formula C - P = S - Ee^-r(T - t) which gives a value of 1.5 on the left side and 2.8 on the right. The part I can't figure out is how to construct a portfolio to take advantage of the arbitrage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, if anyone can clarify what it means when C - P is less than the right side of that equation vs. when it is greater than the right side would be very helpful as well.&lt;/p&gt;&#xA;" OwnerUserId="7838" LastActivityDate="2014-04-17T22:14:48.367" Title="PWIQF excercise solution" Tags="&lt;put-call-parity&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10980" PostTypeId="1" CreationDate="2014-04-17T21:52:00.583" Score="3" ViewCount="595" Body="&lt;p&gt;I am currently attempting to model and forecast volatility of bitcoin but have not been able to find a GARCH model that fits the data appropriately. I've used tick data sampled at 1 hour intervals over a 2 year period and converted it into hourly returns. The best model i have been able to produce so far is an asymmetric garch (3,3) model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The portmanteau stat is 198.4**&lt;/p&gt;&#xA;&#xA;&lt;p&gt;alpha(1)+beta(1)      1.02753&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried GARCH-M,EGARCH,TGARCH all up to (3,3). &lt;strong&gt;For some reason I cannot specify (p,q) to be any higher than 3? What steps can I take to improve the model further?&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would it be beneficial to account for seasonality or jumps similair to todrov (2011) and andersen and bollerslev(2005)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: limited programming knowledge so would prefer to avoid R, output produced by PCGIVE10. &lt;/p&gt;&#xA;" OwnerUserId="7640" LastEditorUserId="7640" LastEditDate="2014-04-17T21:59:58.493" LastActivityDate="2014-04-23T22:19:04.543" Title="How would you correct a GARCH model to deal with non mean reverting volatility?" Tags="&lt;volatility&gt;&lt;high-frequency&gt;&lt;garch&gt;&lt;forecasting&gt;&lt;bitcoin&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10981" PostTypeId="2" ParentId="10979" CreationDate="2014-04-17T22:14:48.367" Score="1" Body="&lt;p&gt;The put-call parity equation: $$c-p = S_0 - Ke^{-rT}$$ &#xA;can be seen as a equality in cash flows--namely, buying a call and selling a put have equivalent cash flows to the underlying stock price less the strike price of the options. Taking this into $t=0$ means the current price of the call less the current price of the put must equal the present value of the stock less the present value of the strike (which is just $S_0 - Ke^{-rT}$). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if the LHS costs 1.5, the RHS costs 2.8, and both have the same payouts, what do you do? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You buy the cheaper: $c-p$, and sell the more expensive. Buy the call, sell the put, and sell the stock. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$t=0:	\\&#xA;	\text{Call}:  -3.00 \\&#xA;	\text{Put}:   +1.50 \\&#xA;	\text{Stock}: +60.00 \\ $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reinvest 58.5 at 5%, 3-mo, which at $t=T$ yields: $58.5 e^{.05\times .25} = 59.24$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$t=T: \\&#xA;	\text{Call}:  \max(S_T-58, 0)\\&#xA;	\text{Put}:   -\max(58-S_T, 0) \\&#xA;	\text{Stock}: -S_T \\$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, if the stock price is above the strike, the call is worth $S_T-58$, the put is worthless. If the stock is below the strike, the put is worth $58-S_T$, the call is worthless. So through your combined position, you just buy at the strike, 58.&#xA;So, your position is worth $59.24-58=1.24$ at time $t=T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Side note: it's probably worthwhile to check out &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0131499084&quot; rel=&quot;nofollow&quot;&gt;Hull's book&lt;/a&gt; for basic derivative questions.&lt;/p&gt;&#xA;" OwnerUserId="7536" LastActivityDate="2014-04-17T22:14:48.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10983" PostTypeId="1" AcceptedAnswerId="11010" CreationDate="2014-04-18T06:38:38.050" Score="8" ViewCount="5432" Body="&lt;p&gt;I'm trying to confirm my understanding of the 2 models. It is my understanding that the black-scholes is a special case of a binomial model with infinite steps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this mean that if I were to start with a Binomial model with 1 step and increase steps towards infinity I would approach the same value concluded by the black-scholes?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so does this mean I could use the implied volatility from Black-scholes formula derived from the market price of an option with the rest of the values (r, t, K, S, σ(IV) ) and approach the same market price from the black-scholes as # of steps approaches infinity? Would this only be the case for a European call with more disagreement on the value of American options with early exercise?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="7840" LastActivityDate="2017-08-17T05:14:46.540" Title="Black Scholes vs Binomial Model" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;binomial&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10984" PostTypeId="2" ParentId="10279" CreationDate="2014-04-18T12:01:01.247" Score="3" Body="&lt;p&gt;You have to remember that implied volatility comes from a &quot;wrong&quot; model to give the right answer. Option prices are determined by supply and demand (subject to a few arbitrage bounds). A higher implied volatility for OTM/ITM options relative to ATM options simply means that the prices of these options are higher than the Black-Scholes model would imply (using constant ATM implied volatility as the volatility of the underlying price diffusion).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Black-Scholes model makes several strong assumptions, none of which are true. The implied volatility smile is simply an expression of &quot;how wrong&quot; the model is relative to market prices. For short maturities, Black-Scholes option for OTM options are basically zero. The reason is that the stock price is modeled as a (continuous) diffusion and therefore there is only a very small chance that the money will finish in the money. Market participants, on the other hand, may think that the probability is actually much higher because prices do jump and change rapidly within small time frames. Hence, the pronounced shape of the implied volatility smile at short maturities.&lt;/p&gt;&#xA;" OwnerUserId="7396" LastActivityDate="2014-04-18T12:01:01.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10988" PostTypeId="2" ParentId="7429" CreationDate="2014-04-18T18:35:14.833" Score="2" Body="&lt;p&gt;If I correctly understood, you have a big training set and EMD calculated over the whole set at once. Then you use &lt;em&gt;a part&lt;/em&gt; of training set and the corresponding part of EMD to infer prediction. The problem here is that you peep into the future having EMD on the edge of the working window calculated using information &lt;em&gt;out&lt;/em&gt; of the window. Hence, surely you should calculate EMD (and any other derivative of the training data) using only in-window (past) data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EMD is in some way similar to &lt;a href=&quot;http://en.wikipedia.org/wiki/Singular_spectrum_analysis&quot; rel=&quot;nofollow&quot;&gt;SSA&lt;/a&gt; which has more theoretical foundation. Perhaps, it can interest you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Considering usage of non-casual methods in machine learning, I believe it's not a crime. I have neither proof nor disproof though, therefore I too am interested in the related information.&lt;/p&gt;&#xA;" OwnerUserId="7841" LastActivityDate="2014-04-18T18:35:14.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10989" PostTypeId="1" AcceptedAnswerId="10991" CreationDate="2014-04-18T19:06:37.940" Score="0" ViewCount="5224" Body="&lt;p&gt;Where can I find American historical Savings Account interest (Bank) rates? If you can, please attach corresponding links.&lt;/p&gt;&#xA;" OwnerUserId="7846" LastEditorUserId="1531" LastEditDate="2014-04-19T16:51:25.237" LastActivityDate="2014-04-19T16:51:25.237" Title="Were can I find Historical Interest Rate Data?" Tags="&lt;interest-rates&gt;&lt;market-data&gt;&lt;historical-data&gt;&lt;quantitative&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="10990" PostTypeId="2" ParentId="10279" CreationDate="2014-04-18T19:26:17.367" Score="1" Body="&lt;p&gt;To expand on pbr142, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the implied volatility (vis. Black &amp;amp; Scholes) is persistently higher for short-expiry contracts away from the money, the problem is the model, not the thing that's modeled. The price of a contract at a given point in time is the &quot;correct&quot; price at that point in time (or we should move this to philosophy.stackexchange.com). So how come these contracts aren't described as well by a simple, closed-form (at least in Europe) model? Some possibilities:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Informed trading.&lt;/strong&gt; Since the premium is so much lower, the potential long-side reward/penalty for being right/wrong is significantly greater/lower for a pronounced move. Conversely, without some perceived edge (which can come in the form of non-public information, better research, or a better model), a trader is less likely to go long, since her time to react is less and premium decay is greater. The short side of the contract (probably also more likely to be a market maker) has to guard against this posibility. Indeed, insider trading is &lt;a href=&quot;http://www.sec.gov/spotlight/insidertrading/cases.shtml&quot; rel=&quot;nofollow&quot;&gt;often revealed by large, anomalous OTM-short-expiry positions&lt;/a&gt;. If informed traders have an observed tendency to cluster in to these types of contracts, smart sellers should insist on a greater premium. My guess is that this accounts for the bulk of the difference.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Greater short-side risk of ruin.&lt;/strong&gt; While smooth probability distributions may turn out to model risk pretty well on an infinite time horizon (we'll have to wait a bit to find out), they don't have a great track record with extreme events in the here-and-now. For any given extreme event (which isn't trying to hear about sigma), the maximum potential loss on the short side approaches parity on a per-contract basis. On a cost/benefit basis, it's therefore much greater. This should condition a greater premium. Additionally, while it might be possible to eek out a degree of distributional independence with a smart portfolio strategy under normal conditions, anecdotal evidence (we've only had thirteen-ish bubbles since we started keeping track, according to Goldman, who seems to &lt;a href=&quot;http://www.rollingstone.com/politics/news/the-great-american-bubble-machine-20100405&quot; rel=&quot;nofollow&quot;&gt;know a thing or two&lt;/a&gt;) suggests that under extreme conditions, independence falls away. So offsetting extreme risk is much trickier.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Behavioral features.&lt;/strong&gt; I mostly included this one to have three bullet points, but it's probably true. What's the implied volatility of a lottery ticket?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Black &amp;amp; Scholes or similar implied volatility can still be a helpful descriptive parameter, particularly on a comparative basis. It is usefully wrong.&lt;/p&gt;&#xA;" OwnerUserId="7847" LastActivityDate="2014-04-18T19:26:17.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10991" PostTypeId="2" ParentId="10989" CreationDate="2014-04-18T20:29:22.857" Score="1" Body="&lt;p&gt;4-week US Treasury bill rates would give you a good proxy for USD cash interest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can download them from here: &lt;a href=&quot;http://www.federalreserve.gov/releases/h15/data.htm&quot; rel=&quot;nofollow&quot;&gt;http://www.federalreserve.gov/releases/h15/data.htm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;The return on domestically held short-dated government bonds is normally perceived as a good proxy for the risk free rate.&quot; - &lt;a href=&quot;http://en.wikipedia.org/wiki/Risk-free_interest_rate&quot; rel=&quot;nofollow&quot;&gt;wikipedia&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7178" LastEditorUserId="7178" LastEditDate="2014-04-18T20:35:11.500" LastActivityDate="2014-04-18T20:35:11.500" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="10992" PostTypeId="1" CreationDate="2014-04-18T20:29:48.633" Score="5" ViewCount="808" Body="&lt;p&gt;Assume we model the dynamics of a tradable asset as follows&#xA;$$ S_t = S_0 \exp\left[\sigma W_t +(\alpha-\beta\lambda-\frac{1}{2}\sigma^2)t+J_t \right] $$&#xA;where $W_t$ is a standard Brownian motion independent from $J_t = \sum_{i=1}^{N_t} Y_i$ a compound Poisson process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What conditions should $\alpha$ and $\beta$ verify for this dynamics to be a valid &lt;strong&gt;risk-neutral&lt;/strong&gt; dynamics?&lt;/p&gt;&#xA;" OwnerUserId="7843" LastEditorUserId="19887" LastEditDate="2016-09-30T07:08:13.357" LastActivityDate="2016-09-30T13:57:04.963" Title="Risk neutral measure for jump processes" Tags="&lt;risk-neutral-measure&gt;&lt;jump-diffusion&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="10993" PostTypeId="1" AcceptedAnswerId="11020" CreationDate="2014-04-18T20:59:35.423" Score="1" ViewCount="768" Body="&lt;p&gt;Let's suppose USD/EUR price in USD follows a GBM with&#xA;$$ dS_t = rS_tdt + \sigma S_tdW_t $$&#xA;What process does EUR/USD follow in EUR?&lt;/p&gt;&#xA;" OwnerUserId="6055" LastActivityDate="2014-11-22T20:05:40.837" Title="FX Rate dynamics" Tags="&lt;fx&gt;&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10996" PostTypeId="1" CreationDate="2014-04-19T04:20:37.963" Score="1" ViewCount="64" Body="&lt;p&gt;Are the historical data sets of short term treasury bill rates considered the same as the historical data sets of savings account interest rates because by definition they are both risk free rates of returns?&lt;/p&gt;&#xA;" OwnerUserId="7846" LastActivityDate="2014-04-23T22:44:17.140" Title="&quot;Equivalent&quot; data sets despite different numbers" Tags="&lt;interest-rates&gt;&lt;historical-data&gt;&lt;interest&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="10997" PostTypeId="1" AcceptedAnswerId="10998" CreationDate="2014-04-19T05:42:59.610" Score="0" ViewCount="570" Body="&lt;p&gt;I am currently studying managerial economics by W. Bruce Allen. The book is good. Are there any good book with quizzes , that makes economics sweeter? Books that relate to real world facts and figure would be better.&lt;/p&gt;&#xA;" OwnerUserId="7850" LastActivityDate="2014-04-19T09:27:51.703" Title="What are the good book to understand economics?" Tags="&lt;economics&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2014-04-19T19:36:55.127" ContentLicense="CC BY-SA 3.0" />
  <row Id="10998" PostTypeId="2" ParentId="10997" CreationDate="2014-04-19T09:22:27.347" Score="1" Body="&lt;p&gt;A good introductory book with a lot of data and statistics provided is: &quot;Macroeconomics: Understanding the Global Economy&quot; by David Miles and Andrew Scott. You can find the link to the book here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1119995728&quot; rel=&quot;nofollow&quot;&gt;Macroeconomics - Miles/Scott&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It uses a lot of real world examples to relate economic concepts with real data and explain observed economic phenomena.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are interested also in Microeconomics I would recommend Mankiw and Krugman which you can find here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1429283424&quot; rel=&quot;nofollow&quot;&gt;Microeconomics - Krugman&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0538453044&quot; rel=&quot;nofollow&quot;&gt;Microeconomics - Mankiw&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7851" LastEditorUserId="7851" LastEditDate="2014-04-19T09:27:51.703" LastActivityDate="2014-04-19T09:27:51.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="10999" PostTypeId="1" AcceptedAnswerId="11018" CreationDate="2014-04-19T12:29:53.460" Score="8" ViewCount="10935" Body="&lt;p&gt;I have a big dataset containing zero-coupon bond yields with different relative maturities. I fix a time horizon on my dataset and I want to calculate instantaneous forward rate. I'm going to write how I calculated:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The yield curve is given by:&#xA;$Y(t,T)=-\frac{\log(P(t,T))}{T-t}$ formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So by inverting it we get bondprice:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P(t,T)=\exp(-Y(t,T)(T-t))$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We get instantaneous forward rate from partial derivate of $\log(P(t,T))$ by $T$ so the formula I use is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$f(t,T_k)=-\frac{\log(P(t,T_k))-\log(P(t,T_{k-1}))}{T_k-T_{k-1}}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $T_0=0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My goal is to set up an observation matrix of instant. forward rates for volatility estimation in a model and I want to be sure if my pre-calculations are fine. Thanks for help in advanced.&lt;/p&gt;&#xA;" OwnerUserId="7778" LastActivityDate="2014-04-21T07:55:29.683" Title="Calculating instantaneous forward rate from zero-coupon yield curve" Tags="&lt;yield-curve&gt;&lt;forward-rate&gt;&lt;bond&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="11000" PostTypeId="1" CreationDate="2014-04-19T14:25:41.807" Score="9" ViewCount="23652" Body="&lt;p&gt;I used SPY data to fit GARCH(1,1) in my model.&#xA;My data starts from Jan, 2000 until Dec, 2013.&#xA;I compared the volatility using runSD on the 21 rolling window and GARCH(1,1).&#xA;It looks a pretty good fit so far. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question would be how can I forecast the future volatility going forward from Dec, 2013? Should I just use the coefficient to calculate the next day's volatility? But what about if I want to simulate 10 days ahead? Is there a simple way to do this in R?&#xA;I looked at ugarchroll and I don't really understand that function. Hope you guys can shed some lights!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are the coeffs and summary of GARCH using tseries package:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Call:&#xA;garch(x = dailyreturn[, 1], order = c(1, 1))&#xA;&#xA;Coefficient(s):&#xA;       a0         a1         b1  &#xA;1.637e-06  8.857e-02  9.001e-01  &#xA;&#xA;&#xA;Call:&#xA;garch(x = dailyreturn[, 1], order = c(1, 1))&#xA;&#xA;Model:&#xA;GARCH(1,1)&#xA;&#xA;Residuals:&#xA;    Min      1Q  Median      3Q     Max &#xA;-7.1755 -0.5418  0.0716  0.6266  4.0432 &#xA;&#xA;Coefficient(s):&#xA;    Estimate  Std. Error  t value Pr(&amp;gt;|t|)    &#xA;a0 1.637e-06   2.266e-07    7.223  5.1e-13 ***&#xA;a1 8.857e-02   7.074e-03   12.520  &amp;lt; 2e-16 ***&#xA;b1 9.001e-01   7.916e-03  113.703  &amp;lt; 2e-16 ***&#xA;---&#xA;Signif. codes:  0 ?**?0.001 ?*?0.01 ??0.05 ??0.1 ??1&#xA;&#xA;Diagnostic Tests:&#xA;    Jarque Bera Test&#xA;&#xA;data:  Residuals&#xA;X-squared = 358.7767, df = 2, p-value &amp;lt; 2.2e-16&#xA;&#xA;&#xA;    Box-Ljung test&#xA;&#xA;data:  Squared.Residuals&#xA;X-squared = 7.8313, df = 1, p-value = 0.005135&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7456" LastActivityDate="2017-09-06T04:13:27.470" Title="GARCH(1,1) good fit found, how to predict one day volatility ahead?" Tags="&lt;r&gt;&lt;garch&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="11001" PostTypeId="1" CreationDate="2014-04-19T16:00:46.263" Score="3" ViewCount="266" Body="&lt;p&gt;I am compiling a list of all studies that examine the effects of fund manager reputation, track record and skill on fund returns and capital flows across both mutual funds and hedge funds. The purpose is to look at the difference in the results these studies propose and the different models used to study reputation and track record.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you post some of the most notable works in this field of research?&#xA;I have several papers already, but i just want to make sure i have a complete overview.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="5190" LastEditorUserId="5190" LastEditDate="2014-04-19T17:07:31.737" LastActivityDate="2014-04-24T00:00:48.180" Title="Effects of Fund manager reputation, track record, and skill on funds returns and capital flows" Tags="&lt;mutual-fund&gt;&lt;hedge-fund&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11005" PostTypeId="1" AcceptedAnswerId="11006" CreationDate="2014-04-19T18:56:11.463" Score="2" ViewCount="4331" Body="&lt;p&gt;Have a problem regarding the expected value of the Wiener process inside a function, namely: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Compute $E[cos(W_t)]$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To extend my question, what is the general method of computing these E´s when it is wrapped up inside some function? For this I have a hunch of having to use some Taylor series for the cosine but how do I know? When do I need some special method apart from just using Ito´s?&lt;/p&gt;&#xA;" OwnerUserId="7752" LastActivityDate="2014-04-22T20:55:30.533" Title="How to calculate the expected value of a function of a standard brownian motion (Wiener process)" Tags="&lt;wienerprocess&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11006" PostTypeId="2" ParentId="11005" CreationDate="2014-04-19T20:59:26.293" Score="4" Body="&lt;p&gt;In this particular case, the simplest way to compute the expected value is to write $\cos(x) = \Re(e^{ix})$ and use the formula for the characteristic function of a Gaussian variable: if $Z \sim  \mathcal{N}(\mu,\sigma^2)$, $E[e^{iuZ}] = e^{iu\mu - \frac{1}{2}u^2 \sigma^2 }$ (simply write the expected value as an integral $\int_{\mathbb{R}} e^{iuz} \frac{1}{\sqrt{2\pi \sigma^2}} e^{\frac{(z-\mu)^2}{2\sigma^2}} dz$, regroup the exponentials and &quot;complete the square&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, since $W_t \sim \mathcal{N}(0,t)$, we get &#xA;$$&#xA;  E[\cos(W_t)] = E[\Re(e^{iW_t})] = \Re(E[e^{iW_t}]) = \Re(e^{-t/2}) = e^{-t/2}.      &#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2014-04-22T20:55:30.533" LastActivityDate="2014-04-22T20:55:30.533" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="11007" PostTypeId="2" ParentId="1102" CreationDate="2014-04-19T21:26:43.977" Score="13" Body="&lt;p&gt;I think this is a no-brainer. Only log-returns make sense. The average return can only be computed by averaging the sum of individual log returns. Taking the average of standard (relative) returns does not give you an average of the individual returns. Consider a simple case where the value of an investment alternates between 100 and 50 an odd number of times. The standard return series would be:  -0.5, 1, -0.5, …1 (-50% and +100%). The average of that sum gives us 0.25 (25%) – nonsense for an investment whose final value is the same as what we started with. The log returns, on the other hand give us alternating log returns of -0.6931, +0.6931, whose average is 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The difference between log returns and standard returns goes to zero as we shorten the period over which we evaluate the value of an investment: LN(P(n)/P(n-1)) is approximately equal to P(n)/P(n-1) – 1.  Thus there would not be much difference between standard and log returns (and the computed Sharpe Ratio) if daily measurements were made. The scaling of that Sharpe Ratio from daily returns to annual returns is performed by the sqrt of the number of trade days (252), but that, of course assumes the return distribution is iid, which is not really the case. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Andrew W. Lo has a nice paper that considers the scaling of the Sharpe ratio when the return series is correlated (&quot;The Statistics of Sharpe Ratios&quot;) &lt;/p&gt;&#xA;" OwnerUserId="7855" LastEditorUserId="7855" LastEditDate="2014-04-19T21:34:11.530" LastActivityDate="2014-04-19T21:34:11.530" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="11008" PostTypeId="2" ParentId="3607" CreationDate="2014-04-20T02:38:52.553" Score="9" Body="&lt;p&gt;I think this is a no-brainer. Only log-returns make sense. The average return can only be computed by averaging the sum of individual log returns. Taking the average of standard (relative) returns does not give you an average of the individual returns. Consider a simple case where the value of an investment alternates between 100 and 50 an odd number of times. The standard return series would be: -0.5, 1, -0.5, …1 (-50% and +100%). The average of that sum gives us 0.25 (25%) – nonsense for an investment whose final value is the same as what we started with. The log returns, on the other hand give us alternating log returns of -0.6931, +0.6931, whose average is 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The difference between log returns and standard returns goes to zero as we shorten the period over which we evaluate the value of an investment: LN(P(n)/P(n-1)) is approximately equal to P(n)/P(n-1) – 1. Thus there would not be much difference between standard and log returns (and the computed Sharpe Ratio) if daily measurements were made. The scaling of that Sharpe Ratio from daily returns to annual returns is performed by the sqrt of the number of trade days (252), but that, of course assumes the return distribution is iid, which is not really the case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Andrew W. Lo has a nice paper that considers the scaling of the Sharpe ratio when the return series is correlated (&lt;a href=&quot;https://www.researchgate.net/publication/228139699_The_Statistics_of_Sharpe_Ratios&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;The Statistics of Sharpe Ratios&quot;&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="7856" LastEditorUserId="22053" LastEditDate="2019-07-26T06:40:24.350" LastActivityDate="2019-07-26T06:40:24.350" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="11010" PostTypeId="2" ParentId="10983" CreationDate="2014-04-20T08:14:41.163" Score="7" Body="&lt;p&gt;As anticlimactic as this may be, I'm going to answer my own question here..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found this article that shows the connections between the two models..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://epublications.bond.edu.au/cgi/viewcontent.cgi?article=1126&amp;amp;context=ejsie&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://epublications.bond.edu.au/cgi/viewcontent.cgi?article=1126&amp;amp;context=ejsie&lt;/a&gt; &#xA; (&lt;a href=&quot;https://web.archive.org/web/20170817005109/http://epublications.bond.edu.au/cgi/viewcontent.cgi?article=1126&amp;amp;context=ejsie&quot; rel=&quot;nofollow noreferrer&quot;&gt;mirror&lt;/a&gt;) that shows &lt;/p&gt;&#xA;&#xA;&lt;p&gt;that prices do converge as N Periods increases. Also they provide all the Excel formulas to recreate their work if anyones interested.&lt;/p&gt;&#xA;" OwnerUserId="7840" LastEditorUserId="2183" LastEditDate="2017-08-17T05:14:46.540" LastActivityDate="2017-08-17T05:14:46.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11011" PostTypeId="2" ParentId="11005" CreationDate="2014-04-20T14:06:18.040" Score="-3" Body="&lt;p&gt;Yes, I was thinking Taylor series approximation. Another possibility is to use bootstrapping or Jacknife, which is a linear approximation of bootstrapping.  &lt;/p&gt;&#xA;" OwnerUserId="7468" LastActivityDate="2014-04-20T14:06:18.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11014" PostTypeId="1" AcceptedAnswerId="11068" CreationDate="2014-04-20T19:32:31.950" Score="5" ViewCount="185" Body="&lt;p&gt;I am looking at one day of AAPL quotes (3 Dec 2012) from TAQ to examine quote-based high frequency vol estimators. However, I found that a number of exchanges, when quoting noncompetitively,  seem to display persistent values that I cannot seem to justify (i.e. the levels are so far that I can't imagine they correspond to any regulation-based requirement). Can anyone reconcile this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The red vertical lines represent open and close.&#xA;&lt;img src=&quot;https://i.stack.imgur.com/mdvxE.png&quot; alt=&quot;asks&quot;&gt; &lt;img src=&quot;https://i.stack.imgur.com/FKkmM.png&quot; alt=&quot;bids&quot;&gt; &#xA;where &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;A  = American Stock Exchange &#xA;B  = Boston Stock Exchange &#xA;C  = National (Cincinnati) Stock Exchange &#xA;D  = NASD (ADF) &#xA;E  = Market Independent (SIP - Generated) &#xA;I  = ISE &#xA;M  = Chicago Stock Exchange &#xA;N  = NYSE &#xA;P  = NYSE Arca &#xA;T/Q= NASDAQ Stock Exchange &#xA;S  = Consolidated Tape System &#xA;W  = CBOE &#xA;Z  = BATS &#xA;J  = DirectEdge A &#xA;K  = DirectEdge X &#xA;X  = NASDAQ OMX PSX &#xA;Y  = BATS Y-Exchange Inc.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7536" LastEditorUserId="7536" LastEditDate="2014-04-21T08:22:09.880" LastActivityDate="2014-04-26T04:16:09.940" Title="Attribution of unusual persistence in noncompetitive TAQ quotes levels?" Tags="&lt;market-data&gt;&lt;market-microstructure&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11015" PostTypeId="2" ParentId="11001" CreationDate="2014-04-20T22:31:53.880" Score="4" Body="&lt;p&gt;Two of the most cited papers are &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/0022-1082.00066/abstract&quot; rel=&quot;nofollow&quot;&gt;Sirri, E.R., Tufano, P., 1998. Costly Search and Mutual Fund Flows. Journal of Finance 53 (5). 1589–1622&lt;/a&gt; and &lt;a href=&quot;http://faculty.chicagobooth.edu/john.cochrane/teaching/35150_advanced_investments/chevalier_ellison_jpe.pdf&quot; rel=&quot;nofollow&quot;&gt;Chevalier, J., Ellison, G., 1997. Risk Taking by Mutual Funds as a Response to Incentives. Journal of Political Economy 105 (6). 1167–1200.&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7344" LastActivityDate="2014-04-20T22:31:53.880" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11016" PostTypeId="1" CreationDate="2014-04-21T06:18:36.943" Score="2" ViewCount="803" Body="&lt;p&gt;The typical example of path dependant derivatives are knock-ins and knock-outs. &#xA;At the same time vanilla American options can also be considered to be highly path dependant. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Does a more or less formal defintion/classification of &quot;path dependency&quot; exist ?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="7712" LastActivityDate="2014-04-25T13:23:53.157" Title="When can a derivative be considered to be path dependant?" Tags="&lt;options&gt;&lt;derivatives&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11017" PostTypeId="2" ParentId="11016" CreationDate="2014-04-21T07:44:51.720" Score="0" Body="&lt;p&gt;A stochastic process that is non-ergodic is inherently &quot;path dependent.&quot; You can think of this a number of ways, but for me, most intuitively in the MC context.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A Markov chain is non-ergodic if it is not positive recurrent or if it is periodic. Alternatively, as the transitions in the chain increase, a non-ergodic chain's probability measure will not be greater than zero AND independent of its initial probability distribution (more on this in the famed &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0471257095&quot; rel=&quot;nofollow&quot;&gt;Feller II&lt;/a&gt;). That is, an ergodic MC can eventually reach any other state with some positive probability. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another useful source might be &lt;a href=&quot;http://www.math.psu.edu/sarig/506/ErgodicNotes.pdf&quot; rel=&quot;nofollow&quot;&gt;Omri Sarig's notes on ergodicity&lt;/a&gt;, depending on level of formality you are looking for.&lt;/p&gt;&#xA;" OwnerUserId="7536" LastActivityDate="2014-04-21T07:44:51.720" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11018" PostTypeId="2" ParentId="10999" CreationDate="2014-04-21T07:46:45.347" Score="9" Body="&lt;p&gt;Your overall approach is correct. However to my knowledge it is formally more appealing to work with a parameterized and smoothed yield curve. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically one assumes that the yield curve can be described by a smooth function $r(t,\alpha, \beta,\gamma)$ (mostly of three parameters)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given a set of market data $Y(t,T_1)\dots Y(t, T_n)$ one looks for parameters $\alpha,\beta,\gamma$ so that the distance $\sum_{i=1}^n (r(T_i,\alpha,\beta,\gamma)-Y(t,T_i))^2$ is minimized (depending on the choice of $r$ one might have to use a numerical optimization routine) After $\alpha, \beta,\gamma$ have been found they are seen as fixed inputs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This method has two significant advantages:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Due to the continuity of $r(t,\alpha, \beta,\gamma)$ one can&#xA;calculate yields for maturities not quoted by the market via&#xA;$r(T,\alpha, \beta,\gamma)$&lt;/li&gt;&#xA;&lt;li&gt;$r(t,\alpha, \beta,\gamma)$ is smooth. Thus $P(t,T)=exp(-r(T-t,\alpha,\beta,\gamma)(T-t))$ is a smooth function&#xA;and one can easily calculate $f(t,T)=-\frac{\partial&#xA;    P(t,T)}{\partial T}$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For more on yield curve construction I refer you to the &lt;a href=&quot;http://comisef.eu/files/wps031.pdf&quot;&gt;Nelson–Siegel–Svensson&lt;/a&gt; model&lt;/p&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="7279" LastEditDate="2014-04-21T07:55:29.683" LastActivityDate="2014-04-21T07:55:29.683" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11019" PostTypeId="1" AcceptedAnswerId="11040" CreationDate="2014-04-21T08:25:53.463" Score="13" ViewCount="20729" Body="&lt;p&gt;I have a question about the prediction of volatility and returns of a time series. Basically it is a question about &lt;code&gt;predict&lt;/code&gt; in the &lt;code&gt;fGarch&lt;/code&gt;package. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following code is from the book &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470414359&quot; rel=&quot;noreferrer&quot;&gt;Analysis of financial time series&lt;/a&gt; and it is an example of AR/GARCH models for the log returns of the SP500&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(fGarch)&#xA;sp5=read.table(&quot;http://faculty.chicagobooth.edu/ruey.tsay/teaching/fts/sp500.dat&quot;)#Load data&#xA;plot(sp5,type=&quot;l&quot;)&#xA;m1=garchFit(formula=~arma(3,0)+garch(1,1),data=sp5,trace=F)&#xA;summary(m1)&#xA;m2=garchFit(formula=~garch(1,1),data=sp5,trace=F,cond.dist=&quot;std&quot;)&#xA;summary(m2)&#xA;stresi=residuals(m2,standardize=T)&#xA;plot(stresi,type=&quot;l&quot;)&#xA;Box.test(stresi,10,type=&quot;Ljung&quot;)&#xA;predict(m2,5)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;First we assume an ARMA/GARCH model. However, we see that all the coefficient from the AR model are not significant. Hence we model a pure GARCH time series. My question is about the very last command. Running this command gives the following output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    &amp;gt; predict(m2,5)&#xA;  meanForecast  meanError standardDeviation&#xA;1  0.008455044 0.05330089        0.05330089&#xA;2  0.008455044 0.05327886        0.05327886&#xA;3  0.008455044 0.05325781        0.05325781&#xA;4  0.008455044 0.05323769        0.05323769&#xA;5  0.008455044 0.05321847        0.05321847&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is here the meanForecast and why is it always the same number? Is there a way to get the n-th volatility forecast  as well as the n-th return forecast, e.g. the predicted volatility for the next day as well as the return. In the case of the model &lt;code&gt;m2&lt;/code&gt; the volatility forecast will be the return forecast, since we assume a pure GARCH model. But how can we extract both in the &lt;code&gt;m1&lt;/code&gt;case?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: as asked by user12348 here are my outputs of &lt;code&gt;summary(m1)&lt;/code&gt; and &lt;code&gt;summary(m2)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; summary(m1)&#xA;&#xA;Title:&#xA; GARCH Modelling &#xA;&#xA;Call:&#xA; garchFit(formula = ~arma(3, 0) + garch(1, 1), data = sp5, trace = F) &#xA;&#xA;Mean and Variance Equation:&#xA; data ~ arma(3, 0) + garch(1, 1)&#xA;&amp;lt;environment: 0x6ac79b0&amp;gt;&#xA; [data = sp5]&#xA;&#xA;Conditional Distribution:&#xA; norm &#xA;&#xA;Coefficient(s):&#xA;         mu          ar1          ar2          ar3        omega  &#xA; 7.7077e-03   3.1968e-02  -3.0261e-02  -1.0649e-02   7.9746e-05  &#xA;     alpha1        beta1  &#xA; 1.2425e-01   8.5302e-01  &#xA;&#xA;Std. Errors:&#xA; based on Hessian &#xA;&#xA;Error Analysis:&#xA;         Estimate  Std. Error  t value Pr(&amp;gt;|t|)    &#xA;mu      7.708e-03   1.607e-03    4.798 1.61e-06 ***&#xA;ar1     3.197e-02   3.837e-02    0.833  0.40473    &#xA;ar2    -3.026e-02   3.841e-02   -0.788  0.43076    &#xA;ar3    -1.065e-02   3.756e-02   -0.284  0.77677    &#xA;omega   7.975e-05   2.810e-05    2.838  0.00454 ** &#xA;alpha1  1.242e-01   2.247e-02    5.529 3.22e-08 ***&#xA;beta1   8.530e-01   2.183e-02   39.075  &amp;lt; 2e-16 ***&#xA;---&#xA;Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1&#xA;&#xA;Log Likelihood:&#xA; 1272.179    normalized:  1.606287 &#xA;&#xA;Description:&#xA; Wed Apr 23 18:07:32 2014 by user:  &#xA;&#xA;&#xA;Standardised Residuals Tests:&#xA;                                Statistic p-Value     &#xA; Jarque-Bera Test   R    Chi^2  73.04843  1.110223e-16&#xA; Shapiro-Wilk Test  R    W      0.9857968 5.961505e-07&#xA; Ljung-Box Test     R    Q(10)  11.56744  0.3150483   &#xA; Ljung-Box Test     R    Q(15)  17.78746  0.2740041   &#xA; Ljung-Box Test     R    Q(20)  24.11916  0.2372259   &#xA; Ljung-Box Test     R^2  Q(10)  10.31614  0.4132084   &#xA; Ljung-Box Test     R^2  Q(15)  14.22819  0.5082978   &#xA; Ljung-Box Test     R^2  Q(20)  16.79404  0.6663039   &#xA; LM Arch Test       R    TR^2   13.34305  0.3446074   &#xA;&#xA;Information Criterion Statistics:&#xA;      AIC       BIC       SIC      HQIC &#xA;-3.194897 -3.153581 -3.195051 -3.179018 &#xA;&#xA;&amp;gt; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and for &lt;code&gt;summary(m2)&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; summary(m2)&#xA;&#xA;Title:&#xA; GARCH Modelling &#xA;&#xA;Call:&#xA; garchFit(formula = ~garch(1, 1), data = sp5, cond.dist = &quot;std&quot;, &#xA;    trace = F) &#xA;&#xA;Mean and Variance Equation:&#xA; data ~ garch(1, 1)&#xA;&amp;lt;environment: 0x6b70f70&amp;gt;&#xA; [data = sp5]&#xA;&#xA;Conditional Distribution:&#xA; std &#xA;&#xA;Coefficient(s):&#xA;        mu       omega      alpha1       beta1       shape  &#xA;0.00845504  0.00012485  0.11302582  0.84220210  7.00318063  &#xA;&#xA;Std. Errors:&#xA; based on Hessian &#xA;&#xA;Error Analysis:&#xA;        Estimate  Std. Error  t value Pr(&amp;gt;|t|)    &#xA;mu     8.455e-03   1.515e-03    5.581 2.39e-08 ***&#xA;omega  1.248e-04   4.519e-05    2.763  0.00573 ** &#xA;alpha1 1.130e-01   2.693e-02    4.198 2.70e-05 ***&#xA;beta1  8.422e-01   3.186e-02   26.432  &amp;lt; 2e-16 ***&#xA;shape  7.003e+00   1.680e+00    4.169 3.06e-05 ***&#xA;---&#xA;Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1&#xA;&#xA;Log Likelihood:&#xA; 1283.417    normalized:  1.620476 &#xA;&#xA;Description:&#xA; Wed Apr 23 18:09:17 2014 by user:  &#xA;&#xA;&#xA;Standardised Residuals Tests:&#xA;                                Statistic p-Value    &#xA; Jarque-Bera Test   R    Chi^2  99.61249  0          &#xA; Shapiro-Wilk Test  R    W      0.9836345 9.72802e-08&#xA; Ljung-Box Test     R    Q(10)  11.37961  0.3287173  &#xA; Ljung-Box Test     R    Q(15)  18.2163   0.2514649  &#xA; Ljung-Box Test     R    Q(20)  24.91842  0.2045699  &#xA; Ljung-Box Test     R^2  Q(10)  10.52266  0.3958941  &#xA; Ljung-Box Test     R^2  Q(15)  16.14586  0.3724248  &#xA; Ljung-Box Test     R^2  Q(20)  18.93325  0.5261686  &#xA; LM Arch Test       R    TR^2   14.88667  0.247693   &#xA;&#xA;Information Criterion Statistics:&#xA;      AIC       BIC       SIC      HQIC &#xA;-3.228325 -3.198814 -3.228404 -3.216983 &#xA;&#xA;&amp;gt; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="17133" LastEditorUserId="26204" LastEditDate="2017-02-06T08:49:51.107" LastActivityDate="2017-02-06T08:49:51.107" Title="GARCH model and prediction" Tags="&lt;time-series&gt;&lt;programming&gt;&lt;garch&gt;&lt;prediction&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="11020" PostTypeId="2" ParentId="10993" CreationDate="2014-04-21T09:03:31.900" Score="4" Body="&lt;p&gt;This will be the inverse process &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{1}{S_t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Applying Itô's formula the dynamics are then given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d\frac{1}{S_t}=\frac{-1}{S_t^2}dS_t+\frac{1}{S_t^3}dS_tdS_t$$ some simple algebra then leads to &#xA;$$d\frac{1}{S_t}=\frac{1}{S_t}(\sigma^2 -r)dt+\frac{1}{S_t}\sigma dW_t$$&lt;/p&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-04-21T09:03:31.900" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11022" PostTypeId="2" ParentId="11016" CreationDate="2014-04-21T13:38:01.250" Score="4" Body="&lt;p&gt;For practitioners, a derivative is &lt;em&gt;not&lt;/em&gt; path-dependent if its value can be expressed as an expectation of discounted future values at some specific tenor $T$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;V(0) = E\left[ \left. V(T) \exp{\left(-\int_0^T r(s)ds\right)} \right| {\cal{I}_0} \right]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously this is convenient when it happens because one only needs to worry about probability densities inside the expectation for the single tenor $T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;American-exercise options fail to meet this criterion since their value depends on an exercise strategy, written here as a stopping time $\tau$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;A(0) = \sup_{\tau \leq T} E\left[ \left. V(\tau) \exp{\left(-\int_0^\tau r(s)ds\right)} \right| {\cal{I}_0} \right]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other options fail to meet the criterion because their value depends on fixings $t&amp;lt;T$, or barrier conditions, etc. etc.  In many such cases, the path dependence is &lt;em&gt;weak&lt;/em&gt;, in the sense that one can introduce a single extra dimension to the SDE/PDE, for example a &lt;a href=&quot;https://cs.uwaterloo.ca/research/tr/1996/28/CS-96-28.pdf&quot; rel=&quot;nofollow&quot;&gt;current tabulation of running average&lt;/a&gt; price, and solve accordingly.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2014-04-25T13:23:53.157" LastActivityDate="2014-04-25T13:23:53.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11023" PostTypeId="1" CreationDate="2014-04-21T15:29:28.257" Score="3" ViewCount="248" Body="&lt;p&gt;I have a certain non-stock asset that has 1 transaction every 1 to 8 months.&lt;br&gt;&#xA;I also have a price index of that class of asset compiled by another party on monthly basis.&lt;br&gt;&#xA;If I regress $price = \alpha' + \beta' index$, the $R^2$ is 0.975 to 0.999 for every asset. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I obtain an estimate of $\beta$ of CAPM $R_i = R_f + \beta(R_m-R_f)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now, I am blindly guessing it through the following steps:&lt;br&gt;&#xA;1. Regress $price = \alpha' + \beta' index$, obtain $\alpha'$ and $\beta'$&lt;br&gt;&#xA;2. Generate interpolated monthly price $\widehat{price}_t$ by plugging in the monthly index&lt;br&gt;&#xA;3. Generate monthly asset return $\hat{R}_{t+1}=\frac{\widehat{price}_{t+1}}{\widehat{price}_t}-1$&lt;br&gt;&#xA;4. Generate monthly market return $\hat{R}_{m_{t+1}}=\frac{index_{t+1}}{index_t}-1$&lt;br&gt;&#xA;5. Regress $\hat{R_{t}}$ on $\hat{R}_{m_{t}}$ and obtain $\beta$ of CAPM&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this method valid? If not, what would be the proper convention?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Possibly relevant references:&lt;br&gt;&#xA;&lt;a href=&quot;https://eckner.com/papers/unevenly_spaced_time_series_analysis.pdf&quot; rel=&quot;nofollow&quot;&gt;Eckner, Andreas (2012). A Framework for the Analysis of Unevenly Spaced Time Series Data.&lt;/a&gt;&lt;br&gt;&#xA;&lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/0304405X77900411&quot; rel=&quot;nofollow&quot;&gt;Scholes, M. and J. Williams (1977). Estimating betas from nonsynchronous data.&lt;/a&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Possibly relevant questions:&lt;br&gt;&#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/2616/how-do-you-estimate-the-volatility-of-a-sample-when-points-are-irregularly-space&quot;&gt;How do you estimate the volatility of a sample when points are irregularly spaced?&lt;/a&gt;&lt;br&gt;&#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/2565/how-to-interpolate-gaps-in-a-time-series-using-closely-related-time-series&quot;&gt;How to interpolate gaps in a time series using closely related time series?&lt;/a&gt;  &lt;/p&gt;&#xA;" OwnerUserId="7864" LastEditorUserId="7864" LastEditDate="2014-04-23T20:36:36.937" LastActivityDate="2014-04-23T20:36:36.937" Title="Estimating Beta from unevenly spaced price history" Tags="&lt;volatility&gt;&lt;time-series&gt;&lt;returns&gt;&lt;regression&gt;&lt;beta&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11024" PostTypeId="2" ParentId="9546" CreationDate="2014-04-21T16:18:43.450" Score="4" Body="&lt;p&gt;Some exchanges have agreements with market makers to provide liquidity (the market makers often get some kind of preferential treatment in return). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Often these agreements will include obligations to be actively quoting some minimum percentage of the time, on both sides of the book (bid &amp;amp; offer). Quoting non-marketable prices is one way to meet these obligations and retain one's status as a designated market maker, while avoiding execution risk in inclement or unfavorable markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other times it's to profit off trade errors (someone fat fingers an order and puts 100,000 shares in at &quot;market&quot;, eating through the book, all the way up to the very deep and very profitable buried quote).&lt;/p&gt;&#xA;" OwnerUserId="6653" LastActivityDate="2014-04-21T16:18:43.450" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11025" PostTypeId="1" CreationDate="2014-04-21T17:13:35.890" Score="-2" ViewCount="1482" Body="&lt;p&gt;I want to ask why ARMA-GARCH is more and more popolar, and what's the advantage of this model.&lt;/p&gt;&#xA;" OwnerUserId="7865" LastActivityDate="2014-04-21T19:12:25.830" Title="What's the disadvantage of ARMA-GARCH model?" Tags="&lt;risk-management&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11026" PostTypeId="1" CreationDate="2014-04-21T18:49:36.830" Score="8" ViewCount="691" Body="&lt;p&gt;Given a time series $u_i$ of returns (where $i=1,\dotsc,t$), $\sigma_i$ is calculated from GARCH(1,1) as &#xA;$$&#xA;\sigma_i^2=\omega+\alpha u_{i-1}^2 +\beta \sigma_{i-1}^2.&#xA;$$ &#xA;What is the mathematical basis to say that $u_i^2/\sigma_i^2$ will exhibit little autocorrelation in the series? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hull's book &quot;Options, Futures and Other Derivatives&quot; is an excellent reference. In 6th ed. p. 470, &quot;How Good is the Model?&quot; he states that &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If a GARCH model is working well, it should remove the autocorrelation. We can test whether it has done so by considering the autocorrelation structure for the variables $u_i^2/\sigma_i^2$. If these show very little autocorrelation our model for $\sigma_i$ has succeeded in explaining autocorrelation in the $u_i^2$.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Maximum likelihood estimation for variance ends with maximizing&#xA;$$&#xA;-m \space \ln(v) -\sum_{i=1}^{t} u_i^2/v_i&#xA;$$&#xA;where $v_i$ is variance = $\sigma_i^2$.&lt;br&gt;&#xA;This function does not really mean $u_i^2/v_i$ being minimized, because $-\ln(v_i)$ gets larger and so does $u_i^2/v_i$ as $v_i$ gets smaller.&#xA;However, it makes intuitive sense that dividing $u_t$ return by its (instant or regime) volatility explains away volatility-related component of the time series.&#xA;I am looking for a mathematical or logical explanation of this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think Hull is not very accurate here as the time series may have trends etc.; also, there are better approaches to finding i.i.d. from the times series than using $u_i^2/\sigma_i^2$ alone. I particularly like Filtering Historical Simulation- Backtest Analysis by &lt;a href=&quot;https://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=2&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0CDcQFjAB&amp;amp;url=http%3A%2F%2Fwww.researchgate.net%2Fpublication%2F2353795_Filtering_Historical_Simulation._Backtest_Analysis%2Ffile%2F3deec529c80e177c9c.pdf&amp;amp;ei=HGxVU6iyB7fKsQTK34H4Cg&amp;amp;usg=AFQjCNENXDU7kMeG1ougDwXMQUWvDpUDSg&amp;amp;bvm=bv.65058239,d.cWc&quot; rel=&quot;nofollow&quot;&gt;Barone-Adesi (2000)&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="19645" LastEditDate="2016-09-25T08:06:37.770" LastActivityDate="2016-09-25T08:06:37.770" Title="Does GARCH derived variance explain the autocorrelation in a time series?" Tags="&lt;garch&gt;&lt;simulations&gt;&lt;auto-correlation&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11027" PostTypeId="2" ParentId="11025" CreationDate="2014-04-21T19:00:06.247" Score="0" Body="&lt;p&gt;You would use GARCH to account for stochastic volatility in a time series of returns. However, the returns time series may have components other than that can be explained by stochastic vol, such as trends or moving average. Therefore, ARMA or AR or some such series is used to de-trend. In risk managment it can be used for back testing, calculating VaR or ES. A good reference for this is Filtered Historical Simulation by Barone-Adesi(2000). Link for &lt;a href=&quot;https://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=2&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0CDcQFjAB&amp;amp;url=http%3A%2F%2Fwww.researchgate.net%2Fpublication%2F2353795_Filtering_Historical_Simulation._Backtest_Analysis%2Ffile%2F3deec529c80e177c9c.pdf&amp;amp;ei=HGxVU6iyB7fKsQTK34H4Cg&amp;amp;usg=AFQjCNENXDU7kMeG1ougDwXMQUWvDpUDSg&amp;amp;bvm=bv.65058239,d.cWc&quot; rel=&quot;nofollow&quot;&gt;FHS&lt;/a&gt;. Also Kevin Dowd has good chapter explaining this - &quot;Measuring Market Risk 2nd Ed, Chapter 4&quot; -link &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470013036&quot; rel=&quot;nofollow&quot;&gt;Dowd&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="7867" LastEditDate="2014-04-21T19:12:25.830" LastActivityDate="2014-04-21T19:12:25.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11029" PostTypeId="2" ParentId="3156" CreationDate="2014-04-21T23:04:49.847" Score="19" Body="&lt;p&gt;As of April 2014, the 32-bit version of kdb+ is now free to try.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This free version may not be used in production systems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only technical limitation vs. the 64-bit version is that you can only address up to 4GB of memory per process.&lt;/p&gt;&#xA;" OwnerUserId="1108" LastEditorDisplayName="user5352" LastEditDate="2015-12-05T14:50:21.710" LastActivityDate="2015-12-05T14:50:21.710" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="11030" PostTypeId="1" AcceptedAnswerId="14222" CreationDate="2014-04-22T04:51:23.313" Score="2" ViewCount="110" Body="&lt;p&gt;Suppose I have two random variables, $X_1$ and $X_2$, that are independent (but not identically distributed) and assume both have hazard functions $\lambda_1(s)$ and $\lambda_2(s)$, for $s &amp;gt; 0$. Then how can I derive the hazard function of $\min(X_1, X_2)$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Let $S$ describe the lifetime of a person, then define $\theta_s(t) = P(S &amp;gt; s+t | S &amp;gt; s)$ as the survival function. Then define the hazard function as $\lambda(s) = \lim_{t \rightarrow 0}  \frac{1}{t} (1-\theta_s(t)) = -\theta_s'(0)$&lt;/p&gt;&#xA;" OwnerUserId="6552" LastEditorUserId="6552" LastEditDate="2014-04-23T15:40:23.127" LastActivityDate="2014-08-13T13:19:45.043" Title="Distribution of minimum of hazard functions" Tags="&lt;stochastic-processes&gt;&lt;probability&gt;&lt;mathematics&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11032" PostTypeId="1" CreationDate="2014-04-22T11:32:06.080" Score="1" ViewCount="688" Body="&lt;p&gt;I have a question regarding regular option pricing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the standard Black-Scholes model, with interest r and volatility $\sigma$, I have to  eetermine the arbitrage free price at time $t$ of an option which at $T&amp;gt;t$ pays the holder the amount of 100 USD dollar if the stock price is between 50 and 100 USD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e. an option with payoff function: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\phi(S) = 100 ~ \text{if} ~ 50&amp;lt;S_T&amp;lt;100 ~ \text{else} ~ 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A thorough walk through in how to calculate this price would be highly appreciated. &lt;/p&gt;&#xA;" OwnerUserId="7752" LastEditorUserId="467" LastEditDate="2015-08-21T04:02:45.213" LastActivityDate="2015-11-15T22:54:43.137" Title="How to price this option using the Black Scholes model?" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;pricing&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11034" PostTypeId="2" ParentId="11023" CreationDate="2014-04-22T12:54:08.103" Score="2" Body="&lt;p&gt;No, it's not. First, what you ought to be regressing are returns, not prices. Second, by interpolating you're underestimating the variance of the asset price in the interval between index price observations. Through your choice of interpolation method, you're essentially picking an arbitrary price in the middle.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you ought to be doing is maximum likelihood estimation (MLE). You'll have to assume a parameterized family of joint stochastic processes and estimate the parameters given the price observations. Whenever you don't have synchronous data, you'll have a probability distribution for the missing price conditional on all other data points (in its future and in its past). Hence the distribution you'll be using to maximise the likelihood of the observed price will be wider than otherwise.&lt;/p&gt;&#xA;" OwnerUserId="7873" LastActivityDate="2014-04-22T12:54:08.103" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11035" PostTypeId="2" ParentId="10977" CreationDate="2014-04-22T15:05:09.807" Score="0" Body="&lt;p&gt;Writing a linear solver with a CVaR-Constraint is time-consuming. &quot;&lt;a href=&quot;http://www.aorda.com&quot; rel=&quot;nofollow&quot;&gt;Portfolio Safeguard&lt;/a&gt;&quot; of &quot;American Optimal Decision Inc.&quot; is optimized for such kind of problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to get it work, you must add the following elements:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Data&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;matrix_scenarios (a matrix of all your returns)&lt;/li&gt;&#xA;&lt;li&gt;matrix_returns (a vector containing the expected returns)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Function&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;CVaR (cvar_risk)&lt;/li&gt;&#xA;&lt;li&gt;linear (linear)&lt;/li&gt;&#xA;&lt;li&gt;standard deviation (st_risk)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Problem&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;variance as objective&lt;/li&gt;&#xA;&lt;li&gt;CVaR as constraint&lt;/li&gt;&#xA;&lt;li&gt;budget as constraint&lt;/li&gt;&#xA;&lt;li&gt;Box variables&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Optimization&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;you can run the optimization by pressing &lt;kbd&gt;CTRL&lt;/kbd&gt; + &lt;kbd&gt;o&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Later I will illustrate the process.&lt;/p&gt;&#xA;" OwnerUserId="7373" LastEditorUserId="7373" LastEditDate="2014-05-02T08:15:47.710" LastActivityDate="2014-05-02T08:15:47.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11037" PostTypeId="2" ParentId="11032" CreationDate="2014-04-22T15:09:59.260" Score="2" Body="&lt;p&gt;I am too lazy to write up a longer answer and I do not know how to write LateX, so here you go&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://ciberconta.unizar.es/bolsa/binary.pdf&quot; rel=&quot;nofollow&quot;&gt;Pricing formulas for Double Knock Out and Binary&#xA;Range Options&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2015-08-21T10:28:03.823" LastActivityDate="2015-08-21T10:28:03.823" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="11038" PostTypeId="1" CreationDate="2014-04-22T16:08:34.517" Score="6" ViewCount="785" Body="&lt;p&gt;I know from Karatzas &amp;amp; Shreve (1991) that a Brownian Bridge $B(t)$ from $a$ to $b$ on time interval $[0,T]$ satisfies:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$B(t)=a(1-t/T) + b*t/T + [W(t) - W(T)*t/T]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W(t)$ is a standard one-dimensional Brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the above equation we can get its distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is what's the distribution of the Brownian Bridge $B(t)$ from $a$ to $b$ on time interval $[T_1, T_2]$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea or reference?&lt;/p&gt;&#xA;" OwnerUserId="6910" LastEditorUserId="467" LastEditDate="2016-06-19T12:10:05.857" LastActivityDate="2016-08-18T12:42:07.740" Title="What is the distribution of Brownian Bridge over a given time interval?" Tags="&lt;probability&gt;&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11039" PostTypeId="1" CreationDate="2014-04-22T20:11:50.553" Score="3" ViewCount="151" Body="&lt;p&gt;Do you know a study with a methodology for selecting tactical bands (or the allowed deviation from a strategic asset allocation)? Thanks&lt;/p&gt;&#xA;" OwnerUserId="2257" LastActivityDate="2016-05-23T07:11:23.330" Title="Quantitative method to select tactical bands for asset allocation" Tags="&lt;asset-allocation&gt;&lt;tactical-asset-allocation&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11040" PostTypeId="2" ParentId="11019" CreationDate="2014-04-22T23:32:29.287" Score="5" Body="&lt;p&gt;The mean could be the long run variance which is &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sig2 = fit.Constant/(1-fit.GARCH{1}-fit.ARCH{1});&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I hope this explains.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, note I ran this model through Matlab, I get different values. you can paste your m1 and m2 values and some other intermediate results so I can see why Matlab differs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: The question refers to forecasting the returns. Using AR-GARCH model,  $$r_t=  μ+\epsilon_t$$ &#xA;$$ z_t=\epsilon_t/σ_t $$ $z_t$ is white noise or i.i.d, and can take any distribution.&#xA;$$σ_t^2=w+\alpha \epsilon_{t-1}^2+\beta σ_{t-1}^2$$&#xA;The predict function in R is forecasting $r_{t+k}$ where k is the periods into the future. It is also possible to forecast future variance, $σ_{t+k}^2$,as shown, using GARCH formula above.&lt;/p&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="7867" LastEditDate="2014-04-24T14:22:43.847" LastActivityDate="2014-04-24T14:22:43.847" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="11041" PostTypeId="2" ParentId="11000" CreationDate="2014-04-23T06:29:52.840" Score="6" Body="&lt;p&gt;Ah, this is becoming a common question, just in R now. Please look at this [question] (&lt;a href=&quot;https://quant.stackexchange.com/questions/11019/garch-model-and-prediction&quot;&gt;GARCH model and prediction&lt;/a&gt;), it has R code to do the prediction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In brief, you keep predicting one day ahead.  $\sigma_{t+k}^2 =w+\alpha u_{t+k-1}^2+\beta \sigma_{t+k-1}^2$. You already know $ w,\space  \alpha \space and \space  \beta $ the starting values are the last values in the returns time series and Garch variance at that time. So, the first forecast will become $\sigma_{t+1}^2 =w+\alpha u_{t}^2+\beta \sigma_{t}^2$ and 2nd day forecast will be $\sigma_{t+2}^2 =w+\alpha u_{t+1}^2+\beta \sigma_{t+1}^2$ and so on...&lt;/p&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2014-04-23T06:29:52.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11042" PostTypeId="1" CreationDate="2014-04-23T08:31:20.257" Score="2" ViewCount="289" Body="&lt;p&gt;I stumbled over Thomas Cover's work on algorithmic portfolio selection; apparently, an outfit called &quot;Mountain View Analytics&quot; attempted to implement the suggestions from Cover's research.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, I can't find a trace of information about whether this worked and what happened to them - does anyone have a recommendation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers,&#xA;Rotaist&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: It seems Thomas Cover &lt;a href=&quot;http://bulletin.imstat.org/2012/05/obituary-thomas-cover-1938%E2%80%932012/&quot; rel=&quot;nofollow&quot;&gt;died in 2012&lt;/a&gt;, but I haven't found any more information about the fund.&lt;/p&gt;&#xA;" OwnerUserId="7878" LastEditorUserId="7878" LastEditDate="2014-04-24T14:56:08.490" LastActivityDate="2014-04-24T14:56:08.490" Title="What happened to Mountain View Analytics?" Tags="&lt;portfolio&gt;&lt;portfolio-optimization&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11043" PostTypeId="1" CreationDate="2014-04-23T09:01:10.740" Score="0" ViewCount="983" Body="&lt;p&gt;To calculate volatility, which price in FTSE table is used? &#xA;When do we use close price for calculating volatility? &#xA;Do we use adjclose (adjusted close price) for calculating volatility as well?&#xA;when and how do we use adjclose price?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="7879" LastActivityDate="2014-04-23T13:53:06.527" Title="Close price or adjclose price to calculate volatility?" Tags="&lt;volatility&gt;&lt;ftse&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11045" PostTypeId="1" CreationDate="2014-04-23T11:01:25.530" Score="7" ViewCount="1163" Body="&lt;p&gt;Package RHmm (R)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a vector which I fit into a hmm model in an attempt to select an optimal number of states for a hidden markov model. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x&amp;lt;-c(-0.0961421466,-0.0375458485,0.0681121271,0.0259201028,0.0016780785,0.0311860542,      &#xA;0.0067940299,0.0126520055,0.0357599812,0.0007679569,0.0409759326,0.0560839083,-0.0272581160,-0.0439501404,0.0321578353,0.0196158110,-0.0097262133,-0.0226182376,0.0119897380,-0.0099522863,-0.0359443106,-0.0039363349,-0.0476283592,-0.0383203835,-0.0518624079,0.0187455678,0.0950535435,0.0057115192,-0.0307805051,-0.0272725295,-0.0254645538,-0.0102565781,-0.0267986024,-0.0482906267,-0.0256826510,-0.0414746754,-0.0470666997,0.0284912760,0.1021992517,0.0875572274,0.0064152031,0.0200731787,-0.0091688456,-0.0575608699,-0.0442028942,-0.0277449185,-0.0115369429,0.0084710328,0.0745290085,0.0159369842,-0.0784550401,-0.0934970644,-0.0978390888,0.0160188869,0.0275268626,-0.0552651617,0.0033928140,0.0468507896,0.0374087653,0.0521167410,-0.0177752833,-0.0592673076,0.0514406681,0.0847486437,0.0738066194,-0.0098354049,-0.0572274292,0.0478305465,0.0096885221,-0.0445535022,-0.0153455265,-0.0105375508,0.0100704249,-0.0035215994,0.0243363762,0.0504443519,0.0570023276,0.0395103033,-0.0612817210,-0.0557737453,-0.0273657697,-0.0220077940,0.0083501817,0.0275081574,0.0323161331,0.0385741087,0.0175820844-0.0410599399,-0.0071019642,0.0431060115,-0.0107360128,-0.0007280372,0.0360799385,-0.0061620858  0.0164458899 -0.0050461344 -0.0578381588  0.0097198169  0.0027277926 -0.0127642317,&#xA;-0.0037062560, -0.0045482803,  0.0367596953, 0.0021176710,-0.0319243533,-0.0194663776,0.00 91915981,0.0061495737,-0.0090424506,0.0127655251,0.0161735008,0.0193814765,-0.0208605478,-0.0598025722,0.0022554035,0.0473633792,0.0247213549,-0.0063206694,-0.0201626938,0.0207952819,0.0379032576,0.0151612333,0.0038692090,0.0111271847,0.0497851603,0.0273431360,-0.0172488883,-0.0038909126,0.0264670631,-0.0065249612,-0.0467169856,-0.0255090099,0.0082489658, 0.0352569415,0.0272149172,0.0074228928,-0.0040191315,-0.0170611558,-0.0309531801,-0.0327952044,-0.0239372287,-0.0212792531,-0.0132712774,0.0086866983,-0.0007553260,0.0107026497,0.0065106253,-0.0321813990,-0.0081734233,0.0296845524,0.0268925281,-0.0025994962,-0.0038915206, -0.0126335449,0.0040244308,0.0227324065,0.0114903822,-0.0031516422,0.0031563335,0.0137143092,0.0026222849,0.0035802606,0.0111382363,-0.0008037881, -0.0282458124, 0.0056121633, 0.0254201390,0.0033781147,-0.0166139097,-0.0124559340,0.0088520417,0.0072600174, -0.0050320069,-0.0114740312,-0.0066160556, -0.0042080799, -0.0205501042,0.0027078715,  0.0122158472,-0.0206261771,-0.0267682015,-0.0107602258,0.0088477499,0.0165057256, 0.0106637013,0.0115216769,0.0278296526,0.0026376283,-0.0231543960,-0.0141964203)&#xA;&#xA;#partitions test/train&#xA;nhs &amp;lt;- c(2,3,4) #number of possible states&#xA;S&amp;lt;-runif(length (x))&amp;lt;= .66&#xA;train&amp;lt;-print(S)&#xA;&#xA;# mean conditional density of log probability of seeing the partial sequence of obs &#xA;for(i in 1:length(nhs)){&#xA;pred &amp;lt;- vector(&quot;list&quot;, length(x))&#xA;    for(fold in 1:length(x)){&#xA;        fit &amp;lt;- HMMFit(x [which(train==TRUE)],dis=&quot;NORMAL&quot;,nStates=nhs[i],&#xA;        asymptCov=FALSE)&#xA;        pred[[fold]] &amp;lt;-  forwardBackward(fit, x[which(train==FALSE)])&#xA;   }&#xA;error[i] &amp;lt;- pred[[fold]]$LLH&#xA;  }&#xA;nhs[which.max(error)]    # Optimal number of hidden states (method max log-likehood)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Every time I run the model trying to obtain the best number of states for the hidden markov model, I get a different number of states as I believe the model is trained over randomnly selected new values and also the local min. This does not happen if I just fit the model. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#score proportional to probability that a sequence is generated by a given model&#xA;nhs &amp;lt;- c(2,3,4)&#xA;for(i in 1:length(nhs)){&#xA;    fit &amp;lt;- HMMFit(x, dis=&quot;NORMAL&quot;, nStates= nhs[i], asymptCov=FALSE)&#xA;    VitPath = viterbi(fit, x)&#xA;   error[i] &amp;lt;- fit[[3]]&#xA;}&#xA;error&amp;lt;-c(error) &#xA;error[is.na(error)] &amp;lt;- 10000&#xA;nhs[which.min(error)]    # Optimal number of hidden states (method min AIC)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However the results of the two are very different. Which one is better? On one hand I have a model where I can test on new samples. On the other hand, the second provides best fit on seen samples. In the case of the model if I repeat the test given that the training/test set change (random) the resulting number of states changes as sample train/test changes. In this case what method should I use as to be certain that the model  provides generalization (the number of states result is best). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What additional methods may I employ as to be able to select an optimal number of states&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks &lt;/p&gt;&#xA;" OwnerUserId="7616" LastEditorUserId="7616" LastEditDate="2014-05-05T23:57:30.767" LastActivityDate="2015-10-19T15:43:56.893" Title="Hidden Markov Models methods for selecting optimal number of states" Tags="&lt;r&gt;&lt;hidden-markov-model&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11046" PostTypeId="2" ParentId="11045" CreationDate="2014-04-23T11:25:23.590" Score="9" Body="&lt;p&gt;To determine the optimal number of states in a HMM is indeed an intricate one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please have a look at the following paper:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1925058&quot;&gt;The Number of Regimes Across Asset Returns: Identification and Economic Value by M. Gatumel and F. Ielpo (2011)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the abstract:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A shared belief in the financial industry is that markets are driven&#xA;  by two types of regimes. Bull markets would be characterized by high&#xA;  returns and low volatility whereas bear markets would display low&#xA;  returns coupled with high volatility. Modeling the dynamics of&#xA;  different asset classes (stocks, bonds, commodities and currencies)&#xA;  with a Markov-Switching model and using a density-based test, we&#xA;  reject the hypothesis that two regimes are enough to capture asset&#xA;  returns' evolutions for many of the investigated assets. Once the&#xA;  accuracy of our test methodology has been assessed through Monte Carlo&#xA;  experiments, our empirical results point out that between two and five&#xA;  regimes are required to capture the features of each asset's&#xA;  distribution. Moreover, we show that only a part of the underlying&#xA;  number of regimes is explained by the distributional characteristics&#xA;  of the returns such as kurtosis. A thorough out-of-sample analysis&#xA;  provides additional evidence that there are more than just bulls and&#xA;  bears in financial markets. Finally, we highlight that taking into&#xA;  account the real number of regimes allows both improved portfolio&#xA;  returns and density forecasts.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;On the other hand you have to think about what to do with these states after you identified them. Normally you want to put a trading strategy on top of it. So if you have five states... now what? My motto is to keep it simple, so in most cases I would still use only two states since this translates very intuitively into being long and being flat.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you chose three states you will often find that one state is a very short &lt;em&gt;crash state&lt;/em&gt; which captures all the extreme (left) tails. You cannot really use that because as soon as you identify this &lt;em&gt;crash state&lt;/em&gt; in real time it is too late already. You can normally dodge these tails better with a two state model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I would love to hear other experiences too!&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2014-04-23T11:31:15.330" LastActivityDate="2014-04-23T11:31:15.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11047" PostTypeId="2" ParentId="11043" CreationDate="2014-04-23T13:53:06.527" Score="1" Body="&lt;p&gt;The adjusted close price accounts for corporate actions such as stock splits and dividends, distributions and rights offerings (&lt;a href=&quot;http://www.investopedia.com/terms/a/adjusted_closing_price.asp&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Stock splits in particular would give the illusion of significant volatility and impact your estimates with outliers that are not due to market activity. Therefore, I would suggest using the adjusted close prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, and depending of what exactly you are trying to achieve, you may still need to treat cash dividends and rights offerings with special care.&lt;/p&gt;&#xA;" OwnerUserId="6781" LastActivityDate="2014-04-23T13:53:06.527" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11049" PostTypeId="2" ParentId="10980" CreationDate="2014-04-23T22:19:04.543" Score="1" Body="&lt;p&gt;For the question in your title,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The mean reversion of the volatility is due to the Moving Average part of the volatility process. The solution would be to set $\beta = 0$. In other words you have to use an AR process for the volatility (so an ARCH model for price). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The restriction in p and q come from the estimation process of the parameters. &#xA;You test different combinations of parameters to find the most likely.&#xA;By augmenting the number of parameter you will have more combinations to test and the overall likelihood of good candidates will also grow. So the difficulty to estimate parameters is growing very fast with p and q. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My experience in finding adapted models is that you can't test every models and find one of them wich works. You have to study data. You won't be able to improve the model without understanding wath is wrong with your model (lack of seasonality/mean reversion/jump etc ?). &lt;/p&gt;&#xA;" OwnerUserId="5052" LastActivityDate="2014-04-23T22:19:04.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11050" PostTypeId="2" ParentId="10996" CreationDate="2014-04-23T22:44:17.140" Score="3" Body="&lt;p&gt;From a note of P. Krugman (&lt;a href=&quot;http://economistsview.typepad.com/economistsview/2006/05/interest_rates_.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;link&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/SmqmG.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So no it is not. Why ? &#xA;I would say 3 cause:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First: Dynamics, saving rates are longterm figures. Offer and demand would be different for these products. Some time there is a lack of liquidity and a need of financement, so a huge demand in short term bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second: bank margin, reserve policies, they have to earn some money, they have to support some risk, follow rules and laws...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Third:  risk free rates of returns is a theoretical construction, there is no such thing in real life. Some rates would approach it but wont be the same.&lt;/p&gt;&#xA;" OwnerUserId="5052" LastActivityDate="2014-04-23T22:44:17.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11051" PostTypeId="2" ParentId="11001" CreationDate="2014-04-23T23:53:57.900" Score="1" Body="&lt;p&gt;For hedge funds, the main factors that drive capital flows are (not sure about actual research papers) ...&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Risk-adjusted performance (over prior 4-6 years) is very strongly correlated to capital flows and by far the most dominant factor. Absolute return is mostly ignored, unless the absolute return is very low (i.e. sub 5%) and similarly leverage is mostly ignored, unless the leverage is super high. Reputation matters very little except perhaps for new launches - in fact Reputation builds up mostly on the backs of risk-adjusted performance. Its common for a lot of investors to rank hedge fund managers (by Sharpe Ratio) over two disjoint non-overlapping 3-4 year periods (e.g. 2008-2011 and 2011-2014 would be two such 3-year periods). This is usually done via a double sort. As managers start to rank high on both disjoint periods they see assets rise, and vice versa. You will find most super large hedge funds also rank among top quartile funds in such two disjoint periods (i.e. they are large for a reason!). Exceptions are activist hedge funds, which are really private equity investors operating as hedge funds and their investor audience is usually family offices who prefer high magnitude of returns rather than institutions.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Another related performance measure that quite a few investors look at is percentage of rolling 12-month periods that a fund was positive. (e.g. a 60 month track record will give 49 rolling 12-month return numbers). A lot of top funds are positive only around 51%-52% of the individual months, but once you convert it to rolling 12-month returns, the percentage rises to 80%. The idea here is that what is the probably that once you invest, the manager will likely be positive a year from now. Longer periods &gt;6 years are used, because there are many carry-like funds (FX managers, Fixed Income RV, Convert RV managers) who are positive quite a lot for a while, and then tend to blow up in every bear market. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;So conditioning on the strategy that the manager follows, e.g. fixed income rv, macro, equity long/short, convert arb, mortgages will explain capital flows further. This will also largely account for the effect that a hedge fund manager holds too much illiquid assets, etc. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Another thing that matters a lot in the hedge fund world is Ratings by Prominent Consultants like Albourne. If a manager gets rated A or upgraded by Alborne, even if they are vanilla, they will see a lot of assets flowing to them. Downgrades usually result in serious loss of assets.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Another key criteria is whether the manager is below or above a magical AUM of USD 100mn. A lot of large investors have restrictions from investing with hedge funds less than USD 100mn irrespective of performance. Some super-large pensions are limited to hedge funds with AUM more than USD 500mn. So use a dummy variable for AUM less than USD 100mn and that should give you a good additional factor to explain capital flows. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Most investors avoid a 1-man investment team shops or less than 2-man operations team shops. Too small size of the team could be another minor factor to explain capital flows. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Other minor factors would include: any unique operational issue or unusual conflicts (e.g. a SEC ruling on any PM), whether the manager allows managed accounts or not, annual redemption is a dead no for many investors, but these factors could be hard to capture.   &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5948" LastEditorUserId="5948" LastEditDate="2014-04-24T00:00:48.180" LastActivityDate="2014-04-24T00:00:48.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11052" PostTypeId="1" AcceptedAnswerId="11054" CreationDate="2014-04-24T02:04:06.273" Score="14" ViewCount="11007" Body="&lt;p&gt;Is there any paper that describes in detail how the profit is extracted in directional volatility bet (vol arb)? I mean in the case that I bet the realized volatility will be lower than currently implied vol, I take a short position in call and long in the underlier to get delta hedge. So now, how do I actually make profit on realized volatility? What if the actual volatility during the following period is lower, so my bet was correct, but the implied volatility stays the same for the whole period anyway? If under those circumstances I liquidate the position, wouldn't the profit be 0?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For some reason I struggle to wrap my mind around this, but on the other hand I can see how pure option strategy like short straddle work....&lt;/p&gt;&#xA;" OwnerUserId="2916" LastActivityDate="2014-04-24T18:01:33.777" Title="Volatility arbitrage - how is the profit extracted?" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;arbitrage&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="11053" PostTypeId="2" ParentId="11052" CreationDate="2014-04-24T03:31:42.410" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;What if the actual volatility during the following period is lower, so my bet was correct, but the implied volatility stays the same for the whole period anyway? If under those circumstances I liquidate the position, wouldn't the profit be 0?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I think I know where your confusion comes from.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) this isn't arb - it is not a risk free strategy &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;arbitrage is the practice of taking advantage of a price difference between two or more markets&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The key point being that there are two or more markets. In true arbitrage, you have to have simultaneous buying interest and selling interest with a positive netback. In your scenario you have a single market so you cannot have arbitrage (ignoring stat and other time arb). You'd just be buying and selling into the same market. In your strategy you need to hold the asset until the market agrees with your value, but during that time lots of things can happen (fundamentals change, margin call, market/credit risk in general)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) implied volatility and observed volatility are very different things&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IV can do whatever it wants, and is dictated by buyers and sellers. Observed volatilities often correlate with IV but they don't have to. It depends on the market and the outlook on the asset.&lt;/p&gt;&#xA;" OwnerUserId="7884" LastEditorUserId="7884" LastEditDate="2014-04-24T03:39:40.827" LastActivityDate="2014-04-24T03:39:40.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11054" PostTypeId="2" ParentId="11052" CreationDate="2014-04-24T08:14:29.667" Score="15" Body="&lt;p&gt;Setting aside, that it's not pure riskless arbitrage, but rather statistical arbitrage:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can extract the profit by performing continuous delta hedging. If you constantly adjust your hedge position you gain/lose money by delta hedging. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Being long option (gamma long), you sell at higher prices and buy at lower ones. Over the course of time you realize profit. If the option ends up in the money, your hedge would still be an open position, but it will then be fully covered by option exercise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With short position its the otherwise, you buy high and sell low. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the end, you hope that your hedging lost/gained less/more money than you sold/bought the option for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice you watch you portolio and its greeks daily and can see whether you are winning or losing. Let's assume you adjust the delta hedge at the end of the every day. I'm denoting market move as $\delta S$. The value of your option at the end of the day can be approximated as:&#xA;$$&#xA;O(t+1,S+\delta S) \approx O(t,S) + \Delta\,\delta S + \frac{1}{2} \gamma (\delta S)^2 + \theta&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, if the volume of your hedge at the beginning of the day was exactly $-\Delta$, the $\Delta \delta S$ change of the value is compensated and you are left with &#xA;$$&#xA;P(t+1,S+\delta S) \approx P(t,S) + \frac{1}{2} \gamma (\delta S)^2 + \theta &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(now $P$ stands for the value of the whole portfolio of option + hedge)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The $\theta$ term is completely deterministic. You are guaranteed to lose/gain some value every day while being long/short the option. The term with $\gamma$ depends on your luck. Notice, that the $(\delta S)^2$ term is always positive. So the whole term has the same sign as gamma. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, if you are e.g. gamma positive (and your theta is negative), you are losing theta term every day, and gaining gamma term depending on the market move. If the market moves will turn out to be generally higher on average, the gamma term will earn more over time than the theta terms will lose. But you can see the luck factor  in there. The bigger the difference between real and implied volatility there is, the less luck is needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the option is priced fair, the gamma term will be equal to theta term &lt;em&gt;on average&lt;/em&gt;:&#xA;$$&#xA;\rm{E}\biggl(\frac{1}{2} \gamma (\delta S)^2\biggr) = -\theta&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="3120" LastActivityDate="2014-04-24T08:14:29.667" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="11055" PostTypeId="1" AcceptedAnswerId="11056" CreationDate="2014-04-24T14:38:50.463" Score="6" ViewCount="1288" Body="&lt;p&gt;I've come across several posts regarding parameter estimation for O-U models given some stationary data (say, some sort of mean reverting spread), but I can't seem to find an answer as to &lt;strong&gt;why&lt;/strong&gt; modeling the data as a continuous O-U bears a benefit over modeling it as an AR(1) process. Are the parameters more robust/precise when treating the process as O-U versus AR(1)?  I suppose O-U may give better estimates at higher frequencies. Any insight would be great.&lt;/p&gt;&#xA;" OwnerUserId="7889" LastActivityDate="2014-04-29T23:10:43.263" Title="Ornstein versus AR(1) for modeling stationary data" Tags="&lt;time-series&gt;&lt;pairs-trading&gt;&lt;stationarity&gt;&lt;parameter-estimation&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11056" PostTypeId="2" ParentId="11055" CreationDate="2014-04-24T15:29:33.573" Score="4" Body="&lt;p&gt;O-U is continuous time mean reverting process, hence used to model stationary series. It has closed form analytic solution. This allows insight into stationary processes and act like asymptotic limiting case for calculating coefficients that matter. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: You can see AR(1) below&#xA;$$x_{k+1} = c + a x_k + b\varepsilon_k$$&#xA;and by substituting c=θμΔt, a=−θΔt and $b = \sigma\sqrt{\Delta t} \space$ &#xA;you will get OU &#xA;$$ x_{k+1} = \theta(\mu - x_k)\Delta t + \sigma \varepsilon_k\sqrt{\Delta t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is simple discretization to show they are same and how the parameters can be translated. O-U can be used to detect the steady state parameters. As you see paramaters are interchangeable, frequency used in AR and O-U should be same, then it will be frequency agnostic. I am doing some work on pair trading using O-U I will re-edit at some later time.&lt;/p&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="7867" LastEditDate="2014-04-29T23:10:43.263" LastActivityDate="2014-04-29T23:10:43.263" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="11057" PostTypeId="2" ParentId="9546" CreationDate="2014-04-24T17:57:36.150" Score="5" Body="&lt;p&gt;Don't discount the fact that it could be a fund testing a strategy or order type.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do this all the time.  I'll take an algo that should penny on say, VWAP, and make it penny on VWAP - $10 to ensure that it works but if it does go a bit crazy then atleast I have a buffer before it starts going active.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Same thing with order types,  if I'm testing a new fix field I'll send an order that is way off the market so its easy to see it out there without the noise of other traders.&lt;/p&gt;&#xA;" OwnerUserId="743" LastActivityDate="2014-04-24T17:57:36.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11058" PostTypeId="2" ParentId="11052" CreationDate="2014-04-24T18:01:33.777" Score="1" Body="&lt;p&gt;If you are really after volatility arbitrage, rather have an opinion on volatility, you can use VIX options and futures. This can help you manage your views on volatility far more concisely than by buying and selling individual securities and delta hedge them. Delta hedging has a lot of transaction cost, and time and effort involved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are buy side and have large book  then exploiting inefficiencies in individual securities may be okay. If you are a dealer then delta hedging is a necessity and part of the business.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Id you are EOD trader may be VIX ETF/ETNs may be good.&lt;/p&gt;&#xA;" OwnerUserId="7867" LastActivityDate="2014-04-24T18:01:33.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11059" PostTypeId="1" CreationDate="2014-04-24T19:50:07.590" Score="4" ViewCount="677" Body="&lt;p&gt;I have a question regarding the pricing of convertible bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If  I value the convertible bond with two different underlying assets, how can I incorporate two volatility and the correlation in the model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far, I can find the reference of setting up the binomial model as in P.160 to P. 162 in Peter James - Options Theory. However, this binomial model is applied to price options and I am not sure whether I can use the binomial model to price convertible bonds as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, if one of the underlying is non-listed company and the other is listed company, how can I assess the correlation between that non-listed company and the listed company? If two companies are listed companies, I can easily compute the correlation of the stocks based on historical price data. On the other hand, it is different story if one of the company is non-listed. In addition, if the non-listed company is the subsidary of the listed company, how can I assess the correlation between such non-listed company and the listed company?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, is there any reference to describe the pricing of convertible bond with two different underlying assets?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="6119" LastActivityDate="2017-12-03T15:50:27.490" Title="A question about pricing convertible bond with two different underlying assets" Tags="&lt;option-pricing&gt;&lt;binomial-tree&gt;&lt;convertible-bond&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11060" PostTypeId="1" CreationDate="2014-04-24T19:51:04.663" Score="1" ViewCount="94" Body="&lt;p&gt;From where can I get a list of historical component lists for the FTSE AIM Index as well as other indices?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see that there is a page for data sources &lt;a href=&quot;https://quant.stackexchange.com/questions/141/what-data-sources-are-available-online&quot;&gt;here&lt;/a&gt;, but that page does not contain what I am looking for.&lt;/p&gt;&#xA;" OwnerUserId="6392" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2014-04-25T13:12:25.980" Title="FTSE AIM Components From 2000, 2001, ... 2013" Tags="&lt;data&gt;&lt;market-data&gt;&lt;index&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11061" PostTypeId="1" AcceptedAnswerId="11064" CreationDate="2014-04-25T09:34:20.343" Score="3" ViewCount="252" Body="&lt;p&gt;I am reading a paper and get a problem here, the following terms are all from standard BS models.&#xA;the paper says using the well known fact&#xA;$$Se^{-q(T-t)}N^{'}(d1)=Ke^{-r(T-t)}N^{'}(d2)$$ here the differentiation is respect to $T$.For instance $N^{'}(T^2+1)=2T$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So anyone could give some hints to get this fact?&lt;/p&gt;&#xA;" OwnerUserId="7602" LastEditorUserId="7602" LastEditDate="2014-04-26T00:28:34.233" LastActivityDate="2014-04-26T00:28:34.233" Title="derive black scholes greeks" Tags="&lt;black-scholes-merton&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11063" PostTypeId="2" ParentId="11060" CreationDate="2014-04-25T13:12:25.980" Score="-1" Body="&lt;p&gt;&lt;a href=&quot;http://www.google.co.uk/finance/historical?q=INDEXFTSE%3aAXX&quot; rel=&quot;nofollow&quot;&gt;http://www.google.co.uk/finance/historical?q=INDEXFTSE:AXX&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A simple google search for &quot;FTSE 100 AIM historical data&quot; brings up numerous sources. &lt;/p&gt;&#xA;" OwnerUserId="7759" LastActivityDate="2014-04-25T13:12:25.980" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11064" PostTypeId="2" ParentId="11061" CreationDate="2014-04-25T13:59:05.167" Score="3" Body="&lt;p&gt;The first equality is a bit tedious to derive but straight-forward. As commented by vanguard2k, the notation $N'(x)$ is meant to denote the density function of the standard normal distribution:&#xA;$$ N'(x) = n(x) := \frac{1}{\sqrt{2\pi}} e^{-\frac{x^2}{2}} $$.&#xA;Simply insert the $d_{i}$ terms,&#xA;$$ d_1 = \frac{\log\left(\frac{S}{K}\right) + (r-q+\frac{1}{2}\sigma^2)(T-t)}{\sigma\sqrt{T-t}} $$&#xA;$$ d_2 = \frac{\log\left(\frac{S}{K}\right) + (r-q-\frac{1}{2}\sigma^2)(T-t)}{\sigma\sqrt{T-t}} $$&#xA;and rearrange.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second equality cannot be, in general, correct. Simply write out the lhs to see that. Or note that the maximum of the standard normal pdf is slighlty less than 0.4. So for T&gt;0.2, the equality is incorrect.&lt;/p&gt;&#xA;" OwnerUserId="7396" LastActivityDate="2014-04-25T13:59:05.167" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11065" PostTypeId="2" ParentId="10924" CreationDate="2014-04-25T18:38:08.207" Score="0" Body="&lt;p&gt;Got this. Recomputing the bond price would just give the same bond price :))&lt;/p&gt;&#xA;" OwnerUserId="7788" LastActivityDate="2014-04-25T18:38:08.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11066" PostTypeId="2" ParentId="9546" CreationDate="2014-04-25T21:25:34.900" Score="5" Body="&lt;p&gt;I fully agree with all potential rationals written here to put bids and asks deep in the book. All these interests are part of what we should name the latent order book, since potentially agent would be glad to buy or sell at such prices in an hypothetical future. Philosophically, I would say that the more mature a market is, the less you should see such orders, since agents would be confident in using electronic means to post orders when needed, thus nobody would have to post an order hours in advance (you should be able to convert price distance into hours using the volatility of an instrument).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/mwWBl.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have a look at &lt;a href=&quot;https://www.bitstamp.net/market/order_book/&quot; rel=&quot;nofollow noreferrer&quot;&gt;bitcoins orderbooks&lt;/a&gt; today (see inserted image) and you will see a lot of such orders: the latent orderbook is visible for such a recent instrument (you will never see LOB that full on equity markets: in such mature markets the orderbooks shapes are beta-like). For US equity markets the orderbook is far more &quot;hidden&quot; since a lot of agents are confident their trading algorithms will post orders when needed, thus they do not have to disclose their interests in advance.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="1531" LastEditDate="2014-04-28T20:57:17.350" LastActivityDate="2014-04-28T20:57:17.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11068" PostTypeId="2" ParentId="11014" CreationDate="2014-04-26T04:16:09.940" Score="2" Body="&lt;p&gt;The venues all have one thing in common (as best I can tell from looking at your colors): they are all inverted pricing venues (a fee is paid by the maker, and a rebate is paid to the taker).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you're seeing is likely caused by temporary liquidity shortages at those venues, most commonly as a result of aggressive takers sweeping a level and wiping out posted liquidity as the stock moves. The persistent orders you are seeing are just that: some trader has posted orders at these levels, and there is simply no liquidity between the posted orders and the top that has just been wiped out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's nothing strange going on here. A stock like AAPL does not have a dense book. If you were to look at the price levels, you'll see quite a few gaps, even on traditional maker/taker venues. Consider for a moment that a 0.01 minimum tick increment on a 600 dollar stock means every penny is worth a mere 0.16 bps!&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2014-04-26T04:16:09.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11069" PostTypeId="1" AcceptedAnswerId="11073" CreationDate="2014-04-26T04:21:06.690" Score="1" ViewCount="400" Body="&lt;p&gt;Can someone give a mathematical proof as to why including a constant in a linear regression equivalent is to running a regression with demeaned data and zero constant?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More specifically, consider the linear regression&#xA;$$Y = b_0 + b_1 X_1 + b_2 X_2 + ... b_k X_k + e$$&#xA;where $X$'s and $Y$ are vectors, and the same regression with demeaned regressors $$\bar{Y} = b_1 \bar{X}_1 + b_2 \bar{X}_2 + ... b_k \bar{X}_k + e,$$ where the $\bar{Y}$ and the $\bar{X}_i$ are demeaned.  It turns out that you'll obtain the same coefficients $\{b_i\}_{1 \leq i \leq k}$ in both regressions, but I struggle to prove this.&lt;/p&gt;&#xA;" OwnerUserId="7900" LastActivityDate="2014-04-26T14:51:20.510" Title="Constant term in linear regresion" Tags="&lt;time-series&gt;&lt;regression&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11071" PostTypeId="1" CreationDate="2014-04-26T12:21:12.897" Score="1" ViewCount="319" Body="&lt;p&gt;I'm using Glasserman 3.16 and 3.17 algorithm to price bonds. The algorithms evaluates the forward rates and the discount factor $B(0,t_j)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: How can I price bonds in a future time? I want to calculate $B(t_i,t_j)$ bond prices at time $t_i&amp;gt;0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My idea was to use the basic discrete bond price formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$B(t_i,t_j)=\exp\left(-\sum_{l=i}^{j-1}f(t_i,t_l)(t_{l+1}-t_l)\right)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;while I'm using the forward rates that I calculated from algorithm 3.17. But I'm not sure if it's correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example my time-grid is $0=t_0&amp;lt;t_1=0.25&amp;lt;t_2=0.5&amp;lt;\dots&amp;lt;t_M$. I calculate bond price $B(0.25,0.5)=0.990605$ (which is same as $B(0,0.25)$ evaluated from my initial forward rates), but if I calculate $B(0.25,0.5)$ from my yield data matrix, I get $B(0.25,0.5)=0.9938$ (I assume that at time $0$, $B(0.25,0.5)$ should be close to $B(0,0.25)$ at time $0.25$.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More details: I have my initial forward rates $f(0,t_1),\dots,f(0,t_M)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I calculate $f(t_1,t_1)$ with $f(t_1,t_1)\leftarrow f(0,t_1)+\mu(0,t_1)*\sum_{k=1}^{d}\sigma_k(t_0,t_1)*Z_i$, where $Z_i \sim N(0,\sqrt{t_1-t_0})$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From my bond price formula: $B(t_1,t_2)=\exp\left(-\sum_{l=1}^{1}f(t_1,t_l)(t_{l+1}-t_l)\right)=\exp(-f(t_1,t_1)(t_2-t_1))$&lt;/p&gt;&#xA;" OwnerUserId="7778" LastActivityDate="2014-04-26T12:21:12.897" Title="Bond pricing with HJM simulation" Tags="&lt;forward&gt;&lt;heath-jarrow-morton&gt;&lt;bond&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11072" PostTypeId="1" AcceptedAnswerId="11086" CreationDate="2014-04-26T12:56:43.420" Score="2" ViewCount="408" Body="&lt;p&gt;I'm a little confused by what I see as an inconsistency between quoted £ swap rates and £ LIBOR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the FT on 25/4/14:&lt;br&gt;&#xA;1-year Swap (semi-annual): Bid - $0.63\%$; Ask - $0.66\%$&lt;br&gt;&#xA;LIBOR: 6-month - $R_{0.5}=0.63006\%$; 1-year - $R_{1}=0.92438\%$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on the LIBOR rates, I calculated a 1-year swap rate as:&#xA;\begin{equation}&#xA;R_{swap}=2\times\frac{1-\left(1+R_1\right)^{-1}}{\left(1+R_{0.5}\right)^{-0.5}+\left(1+R_{1}\right)^{-1}}=0.9216\%&#xA;\end{equation}&#xA;Although I'm not sure whether 6-month LIBOR is quoted as annual or semi-annual compounding,  for such small rates the impact is negligible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If anybody could tell me where I've gone wrong (and the basis for the 6-month LIBOR quote), I'd greatly appreciate it.&lt;/p&gt;&#xA;" OwnerUserId="7903" LastActivityDate="2014-04-28T10:38:25.813" Title="Is this an inconsistency between Swap and LIBOR?" Tags="&lt;swaps&gt;&lt;libor&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11073" PostTypeId="2" ParentId="11069" CreationDate="2014-04-26T14:51:20.510" Score="1" Body="&lt;p&gt;Including a constant is &quot;equivalent&quot; to working on demeaned data only for certain cases.  However among these cases is ordinary least squares (OLS) regression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, if you think of your fitting procedure as following a method of moments then you will have equivalence.  Take our model as&#xA;$$&#xA;Y  =  \alpha + \beta X + u&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say our model coefficients were chosen such that $E(u) \neq 0$, then the presumed symmetry of the distribution of $u$ would mean a &quot;better&quot; model is available by adding a further constant to $\alpha$.  Therefore, we have a primary statistical condition that the first moment of $u$ be zero, and therefore&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;E(Y)=\alpha+ \beta E(X)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, there are plenty of ways to fit regressions that are &lt;em&gt;not&lt;/em&gt; methods of moments.   For example, various &lt;a href=&quot;http://en.wikipedia.org/wiki/M-estimator&quot; rel=&quot;nofollow&quot;&gt;M-estimators&lt;/a&gt; are &quot;moment-like&quot; but do not share this equivalence.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2014-04-26T14:51:20.510" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11074" PostTypeId="1" CreationDate="2014-04-26T21:39:14.750" Score="1" ViewCount="34" Body="&lt;p&gt;Hello I was wondering if someone could help me with the following question relating to the stability of an equilibrium in a two good exchange economy and the Walrasian auctioneer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The setting is the following: we consider an exchange economy with two individuals $A$ and $B$ and two goods $x$ and $y$ and consider price vectors that differ from the equilibrium price vector. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A reasonable rule is that if there is current excess demand for commodity $x$, i.e. $E_x&amp;gt;0$ then the auctioneer ought to put $p_x$ up a bit; if there is excess supply ($E_x&amp;lt;0$) then if the price is not already 0, it ought to come down a bit, i.e. &#xA;$E_x(\textbf{p}) &amp;gt; 0 \implies \uparrow p_x$, $E_x(\textbf{p}) &amp;lt;0 \implies \downarrow p_x$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No trade takes place if the prices called out by the auctioneer are non-market clearing prices. If this were not the case, and trade would take place at non-market-clearing (out-of-equilibrium prices) then actual wealth in the economy would change. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the statement I have trouble understanding. My lecture notes claim the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;suppose that with initial allocation $(e^A,e^B)$ equilibrium prices are $(p_x,p_y)$.  (here $e^A=(e_x^A,e_y^A)$ denotes the initial endowment of $A$, and similarly for $B$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Suppose trade is done at non-equilibrium prices $(\tilde{p}_x, \tilde{p}_y)$, excess demand is rationed, excess supply is not sold. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;This leads to new endowments $((e^A)',(e^B)')$ and new equilibrium prices $(p_x',p_y')$. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The equilibrium $(p_x,p_y)$ will not be reached in this process. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I have trouble seeing how step 3 and 4 follow and was hoping someone could explain this to me. &lt;/p&gt;&#xA;" OwnerUserId="7907" LastActivityDate="2014-04-26T21:39:14.750" Title="Stability of Equilibrium in 2 good exchange economy" Tags="&lt;economics&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11075" PostTypeId="2" ParentId="3284" CreationDate="2014-04-27T03:57:08.130" Score="8" Body="&lt;p&gt;I am an Oracle Database Administrator.  I subscribe to EODdata for daily minute-tick price data.  When I upload their datasets into my database I run consistency checks before the data is finalized.  I can confirm the wildly swinging price spikes other users have identified, plus data gaps, plus the same stock listed on multiple exchanges, plus entire multiple-hour blocks of trading data simply missing - in other words, as a database professional, when you run a fine-toothed comb across their data using multiple orthogonal angles, you will find just about every category of &quot;dirty data&quot; in their datasets.  Why do I still use them?  I can run scripts on my database that identify and resolve obvious problems automatically, and for my backtesting purposes that suffices.  But for anybody who doesn't have Oracle database resources or raw machine power to resolve dirty data, I would recommend against EODdata.  And yes, OH YES, tech support is abysmal - effectively non-existent.  I have even offered my services to Nick Kruger to help him provide a higher quality data product, but no answer.  If you google &quot;Nick Kruger EODdata&quot; or &quot;EODdata quality&quot; you will always find the same user answers, and that is, &quot;you get what you pay for.&quot;  I have been actively trying to find a higher quality data source (hard to beat $30 a month for EODdata) - I'd be willing to pay triple that cost for good data and decent tech support, but so far have not found it.&lt;/p&gt;&#xA;" OwnerUserId="7909" LastActivityDate="2014-04-27T03:57:08.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11076" PostTypeId="1" AcceptedAnswerId="11077" CreationDate="2014-04-27T05:20:19.560" Score="2" ViewCount="580" Body="&lt;p&gt;I have a call option with 2 expiry in two years. For the first 9 months I cannot excercise the option. After that the I can exercise at any time. I am pricing this option using a binomial tree using the traditional back-propagation method. However at node 9 (i.e. month 9) I have to switch from an American option node i.e. $= \max(\max(S-K,0)$, discounted exercise) to $\max(S-K,0)$ for a european call. Hence it almost does not matter what happens after month 9 and the value is a european option. Is my thinking here correct?&lt;/p&gt;&#xA;" OwnerUserId="2685" LastEditorUserId="70" LastEditDate="2014-04-27T18:18:57.970" LastActivityDate="2014-04-27T18:18:57.970" Title="Will pricing a Bermudan option default to a value of a European option?" Tags="&lt;options&gt;&lt;call&gt;&lt;binomial&gt;&lt;bermudan&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11077" PostTypeId="2" ParentId="11076" CreationDate="2014-04-27T10:12:40.150" Score="1" Body="&lt;p&gt;With timesteps of one month, and the ability to exercise after 9 months, you still need to consider early exercise at node 9 (representing the start of month 10, just as node 0 represents start of month 1).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before the American part kicks in, the tree methodology will revert back to European style, in that you do not have to consider early exercise at that node. However, you are not valuing max(S-K,0) from node 8 to node 0 -- you are valuing the discounted payoff of potential early exercise between nodes 9 and 24. For node $(i,j)$, with $i\le8$, you are valuing:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;V_{i,j}&amp;amp;=&amp;amp;E\left(\displaystyle\sup_{9\le \tau \le 24}max\left(S_{\tau}-K,0\right)B_\tau^{-1}\left| \right.\mathcal{F}_{i,j}\right) \, B_i\\&#xA;&amp;amp;=&amp;amp;e^{-r_i\delta_i}\, \left(V_{i+1,j+i} \, p_{i,j} + V_{i+1,j} \, (1-p_{i,j})\right),&#xA;\end{eqnarray}&#xA;where $r_i$ is the risk-free rate, $\delta_i$ is your timestep, $p_{i,j}$ is the risk-neutral up probability at node $(i,j)$ and  $V_{i+1,j+i}$ and $V_{i+1,j}$ are the values at nodes representing an up jump and down jump respectively.&lt;/p&gt;&#xA;" OwnerUserId="7903" LastEditorUserId="7903" LastEditDate="2014-04-27T12:56:41.790" LastActivityDate="2014-04-27T12:56:41.790" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11078" PostTypeId="2" ParentId="10666" CreationDate="2014-04-27T10:45:56.467" Score="1" Body="&lt;p&gt;I don't think there's a robust statistical approach, without making some arrogant assumptions. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Because your statistical test window is also the window over which you have done your research, your test size is biased in ways you can not predict. For a statistical test to reliably reflect the chosen $\alpha$, your data not only needs to meet the estimator's assumptions, but you need to have pre-specificed your null and alternative hypotheses ahead of time. This is not the case in trading research: You try $N$ hypotheses, then run your statistical test on the most successful hypothesis. If $N&amp;gt;1$, you suddenly have a test that's heavily biased towards showing statistical significance of your system. I also don't think it's possible to know the extent of this bias of the test statistic since it's not something that increases linearly with $N$ (and there cannot be a concrete definition of $N$). &lt;/li&gt;&#xA;&lt;li&gt;You could address this to &lt;em&gt;some small extent&lt;/em&gt; by, for example, assuming $\alpha = 0.05$ and do some Monte Carlo with GBMs (correlations within the underlying Wiener processes) or with cointelated processes plugged into your system (note that you will have to plug these GBMs into every system you have ever tried, which means great source code management! I hope you have SVN or Github!). &lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;There is also the trade off between statistical power and overfitting as you extend your test horizon, the former is calculable under distributional assumptions and the latter is not calculable. That is, your power is weaker over shorter horizons, encouraging conservative inference, but overfitting to temporary opportunities (or more likely noise) is more of a problem which encourages a type 1 error.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Of course you need to assume statistical stationarity, and the inefficiency that you have supposedly captured is going to last. Note that this implies that your null and alternative hypotheses that you will be testing &lt;strong&gt;are not&lt;/strong&gt; the hypotheses that you wish to test. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you don't care about the above, you can use:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/1891/how-much-data-is-needed-to-validate-a-short-horizon-trading-strategy/1904#1904&quot;&gt;How much data is needed to validate a short-horizon trading strategy?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6081" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2014-04-27T18:48:44.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11080" PostTypeId="1" CreationDate="2014-04-27T16:31:13.370" Score="1" ViewCount="218" Body="&lt;p&gt;I have a call option with expiry in two years. In my case the option is bermudan style with first 9 months w/o ability to exercise (i.e. European) and after exercise at any time (i.e. American), but I believe this may not matter and will accept answer for purely american options. This option starts with let's say 100 shares as underlying, and then every quarter the &quot;notional&quot; increases by say 20 shares. So Q1 = 120, Q2 = 140 ... etc. How can I implement this in a binomial tree? Should I price each of the increases as a forward starting option? I.e. value the first increase as 21 month option with 6 month lock-out period and discount? Any other ideas? I know the strike at inception of the option.&lt;/p&gt;&#xA;" OwnerUserId="2685" LastEditorUserId="2685" LastEditDate="2014-04-27T23:40:19.637" LastActivityDate="2014-04-27T23:40:19.637" Title="How to price an option with a &quot;step up&quot; feature using binomial tree?" Tags="&lt;options&gt;&lt;binomial&gt;&lt;bermudan&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11082" PostTypeId="1" CreationDate="2014-04-27T21:47:19.407" Score="1" ViewCount="63" Body="&lt;p&gt;I want to know about some methods like Methods-of-Moments, Quasi-Maximum Likelihood method, Baysian methods using Markov Chain Monte Carlo methods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any reference to have an idea of these methods? What are the other methods?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any special reference for mathematical finance?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="7879" LastActivityDate="2014-04-27T21:47:19.407" Title="What are the estimation methods for SV models?" Tags="&lt;volatility&gt;&lt;estimation&gt;&lt;stochastic&gt;&lt;methods&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11083" PostTypeId="2" ParentId="3319" CreationDate="2014-04-28T00:50:19.047" Score="-1" Body="&lt;p&gt;As previously stated, the OAS is really an Option Excluded Spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Z-Spread is the spread that includes option risk and is therefore higher. Higher spread means higher discount rate which means lower Price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The optionality of a callable bond, which benefits the issuer, results in a lower price and higher yield for the investor. This makes perfect sense to me.&lt;/p&gt;&#xA;" OwnerUserId="7915" LastActivityDate="2014-04-28T00:50:19.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11084" PostTypeId="1" CreationDate="2014-04-28T02:28:05.407" Score="1" ViewCount="388" Body="&lt;p&gt;I'm in the process of constructing volatility cones for several assets and I want to make sure the data is free of biases. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that using overlapping data introduces an artificial degree of correlation between samples and I have the formula for adjustment however I'm unsure how to apply it to the data set. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not necessarily concerned with looking at the mean and variance of the entire data set as I am in looking at the absolute values (min, max, 90th percentile, etc) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm wondering if each sample (i.e. 30 day window) needs to be adjusted or whether the bias only applied to the variance of entire data set (the variance of variance of overlapping returns)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any clarification is greatly appreciated. Thank you very much&lt;/p&gt;&#xA;" OwnerUserId="7917" LastActivityDate="2014-04-28T02:28:05.407" Title="Adjusting for variance bias when using overlapping data" Tags="&lt;options&gt;&lt;volatility&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11086" PostTypeId="2" ParentId="11072" CreationDate="2014-04-28T10:38:25.813" Score="8" Body="&lt;p&gt;Firstly, understand that the 1y Libor is not useful here; the swap is 2 6-month periods, which will each fix on 6m Libor. These days, the *ibor fixings at different tenors are essentially separate, and 0x6 &amp;amp; 6x12 do not compound up to 0x12.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So we have 6m fixing at 0.63006%, and a 1y swap at 0.645% mid. To do this properly, we would need a discounting curve based on SONIA (the GBP OIS curve) as a standard 6m Libor GBP IRS will be daily margined and OIS accrued these days. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dates, for precision:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Fixing date 25/4/14&#xA;GBP spot 25/4/14 (t+0 ccy)&#xA;6m 27/10/14 (185 days)&#xA;1y 27/4/15 (182 days)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Cash flow at 6m, for an NPA of £1m (GBP IRS rates are quoted Actual/365):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C_{0.5} = (0.0063006 \times (185/365)) \cdot 1,000,000 = £3,193.45$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cash flow at 1y: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C_1 = (L_{0.5} (182/365)) \cdot 1,000,000 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Against this, we have the fixed leg. Now GBP 6m IRS are usually quoted Semi-annual as well, so we have 2 payments again:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$K_{0.5} = (0.00645\times (185/365)) \cdot 1,000,000 = £3,269.18$$&#xA;$$K_1 = (0.00645\times (182/365)) \cdot 1,000,000 = £3,216.16$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We need to discount these back to Spot to find out how much the unknown payment needs to be to net out ($D(t)$ is discount factor at $t$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{PV}(\text{float}) = C_{0.5} D_{0.5} + C_1 D_1 $$&#xA;$$\text{PV}(\text{fixed}) = K_{0.5} D_{0.5} + K_1 D_1 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that most IRS are not quoted Semi-annual vs 6; often it is Annual vs 6, so the fixed and float will not line up like this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since this is a Par swap, $\text{PV}(\text{float}) = \text{PV}(\text{fixed})$, so:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C_{0.5} D_{0.5} + C_1 D_1 = K_{0.5} D_{0.5} + K_1 D_1$$&#xA;$$C_1 D_1 = (K_{0.5} - C_{0.5}) D_{0.5} + K_1 D_1$$&#xA;$$C_1 = (K_{0.5} - C_{0.5}) \frac{D_{0.5}}{D_1} + K_1 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Choose $D_{0.5}=0.9987$ and $D_1=0.9975$ for simplicity (~0.25%):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C_1 = (3,269.18 - 3,193.45) \frac{0.9987}{0.9975} + 3,216.16\\&#xA;= 75.73 \times 1.00120 + 3,216.16 = £3,291.98$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C_1 = (L_{0.5} (182/365)) 1,000,000$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rearranging:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$L_{0.5} = \frac{C_1}{ 1,000,000} . \frac{365}{182} \\&#xA;= 0.660205 \% $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus the implied 6m Libor fixing on 27/10/14 is $0.660205\%$. Sanity check: $(0.63 + 0.66)/2 = 0.645$, which matches our 1y rate. By all means redo that separately for Bid and Ask to get a 2-sided value.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2014-04-28T10:38:25.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11087" PostTypeId="1" AcceptedAnswerId="11088" CreationDate="2014-04-28T12:58:48.667" Score="7" ViewCount="394" Body="&lt;p&gt;I am reading Cochrane's lecture note &lt;a href=&quot;http://faculty.chicagobooth.edu/john.cochrane/teaching/35150_advanced_investments/week_1_notes.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;He mentioned that when you regress annual return on time t on that of time t-1, you will have neither statistically significant nor economically significant slope. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I performed a quick test with python as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import statsmodels.formula.api as smf&#xA;import pandas as pd&#xA;import pandas.io.data as web&#xA;import datetime as dt&#xA;ts_spy = web.get_data_yahoo(&quot;^GSPC&quot;, start=&quot;1/1/1929&quot;)&#xA;ts_ret = ts_spy.Close.pct_change()&#xA;&#xA;df_reg = pd.concat([ts_ret.shift(1), ts_ret], axis=1)&#xA;&#xA;df_reg.columns =[&quot;prev&quot;, &quot;cur&quot;]&#xA;results = smf.ols(&quot;cur ~ prev&quot;, data=df_reg).fit()&#xA;print results.summary()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The result I got was not as claimed in the note.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;     OLS Regression Results                            &#xA;==============================================================================&#xA;Dep. Variable:                    cur   R-squared:                       0.001&#xA;Model:                            OLS   Adj. R-squared:                  0.001&#xA;Method:                 Least Squares   F-statistic:                     12.60&#xA;Date:                Mon, 28 Apr 2014   Prob (F-statistic):           0.000387&#xA;Time:                        08:50:08   Log-Likelihood:                 52035.&#xA;No. Observations:               16180   AIC:                        -1.041e+05&#xA;Df Residuals:                   16178   BIC:                        -1.041e+05&#xA;Df Model:                           1                                         &#xA;==============================================================================&#xA;                 coef    std err          t      P&amp;gt;|t|      [95.0% Conf. Int.]&#xA;------------------------------------------------------------------------------&#xA;Intercept      0.0003   7.64e-05      4.306      0.000         0.000     0.000&#xA;prev           0.0279      0.008      3.549      0.000         0.012     0.043&#xA;==============================================================================&#xA;Omnibus:                     4891.255   Durbin-Watson:                   1.998&#xA;Prob(Omnibus):                  0.000   Jarque-Bera (JB):           298584.422&#xA;Skew:                          -0.614   Prob(JB):                         0.00&#xA;Kurtosis:                      24.009   Cond. No.                         103.&#xA;==============================================================================&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6804" LastEditorUserId="6804" LastEditDate="2014-04-29T19:04:56.903" LastActivityDate="2014-04-29T19:04:56.903" Title="Why do I have a statistically significant slope regressing R(t) on R(t-1)" Tags="&lt;time-series&gt;&lt;equities&gt;&lt;statistics&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11088" PostTypeId="2" ParentId="11087" CreationDate="2014-04-28T13:13:27.767" Score="6" Body="&lt;p&gt;Why do you have 16180 observations? Is this daily data over 64 years or higher frequency data? I am guessing so by the magnitude of the intercept. At any rate, your test power would be huge with this large sample size, meaning small relationships will be statistically significant. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What Cochrane said is contingent on data frequency. At a high frequency it is untrue that you would find only statistical insignificance, as returns are very positively autocorrelated at these high sampling frequencies.&lt;/p&gt;&#xA;" OwnerUserId="6081" LastActivityDate="2014-04-28T13:13:27.767" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11089" PostTypeId="2" ParentId="10737" CreationDate="2014-04-28T14:20:01.383" Score="2" Body="&lt;p&gt;It is the &lt;a href=&quot;http://mathworld.wolfram.com/SecondDerivativeTest.html&quot; rel=&quot;nofollow&quot;&gt;second derivative test&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From your example:&lt;br&gt;&#xA;For $u'(w-px-L+x)-u'(w-px)=0$ to be at a maximum, we need  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;&amp;amp;\frac{d}{dx}&amp;amp;\left[u'(w-px-L+x)-u'(w-px)\right]\\&#xA;&amp;amp;=&amp;amp;(1-p)u''(w-px-L+x)+pu''(w-px)&amp;lt;0.&#xA;\end{eqnarray}&#xA;For a risk averse individual, $u''(x)&amp;lt;0$ because of Jensen's Inequality, hence the condition is met.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A more thorough walkthrough than your example can be found &lt;a href=&quot;http://eml.berkeley.edu/users/webfac/card/e101a_s05/101insurance.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7903" LastActivityDate="2014-04-28T14:20:01.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11090" PostTypeId="1" CreationDate="2014-04-28T15:52:55.607" Score="1" ViewCount="1065" Body="&lt;p&gt;For some bonds I work with the last coupon date is not equal to bond's maturity date.  E.g. the last coupon date is April 25th, 2020 and maturity date is April 25th, 2021. I looked at Schedule class and MakeSchedule() and I don't see a clear way to reflect this. I feel it can't be that hard, though. Would appreciate if someone gives me a hint. Thank you!     &lt;/p&gt;&#xA;" OwnerUserId="7922" LastActivityDate="2015-03-03T13:56:51.663" Title="novice question on fixed coupon schedule in QuantLib" Tags="&lt;quantlib&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11093" PostTypeId="1" AcceptedAnswerId="11095" CreationDate="2014-04-28T23:04:10.093" Score="3" ViewCount="276" Body="&lt;p&gt;I'm not sure if this should be asked elsewhere, but it seems like a good place as any.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Options have a &lt;em&gt;strike price&lt;/em&gt;, they have an &lt;em&gt;underlying instrument&lt;/em&gt;, and they have an &lt;em&gt;expiry&lt;/em&gt;. They are also either call or put options, but what is the &lt;strong&gt;noun&lt;/strong&gt; to describe that?&lt;/p&gt;&#xA;" OwnerUserId="6570" LastEditorUserId="2183" LastEditDate="2017-08-08T06:04:41.020" LastActivityDate="2017-08-08T06:04:41.020" Title="What noun is used to describe whether an option is call or put?" Tags="&lt;options&gt;&lt;terminology&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11094" PostTypeId="2" ParentId="11087" CreationDate="2014-04-28T23:40:42.657" Score="1" Body="&lt;p&gt;You are right. Daily or even monthly financial series have serial correlation and lag 1 is generally the most correlated. Over the year, many competing forces may act on the market to randomize the returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not sure the purpose of this exercise you are doing, but you can remove this auto-correlation if you want, using ARCH/GARCH(1,1).&lt;/p&gt;&#xA;" OwnerUserId="7867" LastActivityDate="2014-04-28T23:40:42.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11095" PostTypeId="2" ParentId="11093" CreationDate="2014-04-29T01:10:26.743" Score="2" Body="&lt;p&gt;The &quot;right&quot; or (to make my post long enough) &quot;CP&quot; or &quot;CallPutIndicator&quot;&lt;/p&gt;&#xA;" OwnerUserId="508" LastActivityDate="2014-04-29T01:10:26.743" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="11096" PostTypeId="1" CreationDate="2014-04-29T04:36:09.203" Score="2" ViewCount="1466" Body="&lt;p&gt;I am an aspiring quant that would like to get a head start learning stochastic calculus, which books FROM EXPERIENCE are the most reader friendly?&lt;/p&gt;&#xA;" OwnerUserId="7926" LastActivityDate="2014-04-29T07:10:44.130" Title="Stochastic Calculus in Quantitative analysis" Tags="&lt;quant-trading-strategies&gt;&lt;stochastic-processes&gt;&lt;quantitative&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11099" PostTypeId="2" ParentId="11096" CreationDate="2014-04-29T07:10:44.130" Score="6" Body="&lt;p&gt;For a basic introduction, the three chapters in Hull's &lt;em&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0132777428&quot;&gt;Options, Futures, and Other Derivatives&lt;/a&gt;&lt;/em&gt; on Binomial Trees, Wiener Processes and Ito's Lemma, and The Black-Scholes-Merton Model helped me start to understand the basic concepts within a broader context.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After that, Shreve's two books seems to be pretty popular (see &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0387249680&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0387401016&quot;&gt;here&lt;/a&gt;). He explains things pretty thoroughly in my opinion and his writing is pretty clear, which I like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For someone starting out wanting to learn on their own, though, I've heard his books can be a bit tough to wade through. If you find that to be the case, check out Mikosch's &lt;em&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/9810235437&quot;&gt;Elementary Stochastic Calculus With Finance in View&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another one that might be helpful is &lt;em&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/3540761756&quot;&gt;Basic Stochastic Processes&lt;/a&gt;&lt;/em&gt; by Brzezniak and Zastawniak. It reviews basic probability and other fundamentals, and has solved exercises, which could be really nice for someone starting off and learning on their own.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And then another one I've seen mentioned is &lt;em&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1852333766&quot;&gt;Mathematical Methods for Financial Markets&lt;/a&gt;&lt;/em&gt;. I haven't read it personally, but judging from the Table of Contents it seems to cover a good breadth of advanced topics if that's more of interest to you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which one you go with kind of depends on your experience, what math/stats you've taken, your personal preferences for style and writing/math balance so to speak. But hopefully this gives you enough to get your started :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Oh, and I also came across &lt;a href=&quot;http://www.math.nyu.edu/faculty/kohn/pde_finance.html&quot;&gt;this&lt;/a&gt; page from an NYU class on partial differential equations for finance. It has PDF lecture notes that might be helpful, depending on what you're looking for. Specifically, the Lecture 1 notes start off with a discussion of the &quot;Links between stochastic differential equations and PDE.&quot;)&lt;/p&gt;&#xA;" OwnerUserId="7385" LastActivityDate="2014-04-29T07:10:44.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11100" PostTypeId="1" AcceptedAnswerId="11121" CreationDate="2014-04-29T07:27:19.240" Score="2" ViewCount="913" Body="&lt;p&gt;I recently noticed that the price history for Google (GOOG) on Yahoo Finance only goes back to when the stock split. For a while I thought they just hadn't gotten around to adjusting the close prices for the split, but it still hasn't been &quot;fixed&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just wondering if this is normal for Yahoo Finance when a stock splits or not? If so, when might the historical price data from before the split to come back? I use Yahoo data for some of my backtesting, and while I don't necessarily need the Google data, it would be nice to have the entire price history back up and running for purposes of data purity and completeness, so that if I run a backtest on the S&amp;amp;P 500, I don't have holes like that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this just normal and temporary, that's fine, but if not I'd like to know in case I should invest some time in finding and writing web scraping algos for another source for daily stock data.&lt;/p&gt;&#xA;" OwnerUserId="7385" LastActivityDate="2014-05-01T00:42:35.793" Title="Google historical prices on Yahoo Finance before split?" Tags="&lt;historical-data&gt;&lt;yahoo&gt;&lt;adjusted&gt;&lt;google&gt;&lt;split&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11101" PostTypeId="1" CreationDate="2014-04-29T08:31:40.397" Score="2" ViewCount="2805" Body="&lt;p&gt;I have two portfolio's called Comb &amp;amp; Global. They both have the same investable universe lets says 3000 stocks &amp;amp; are measured against the same benchmark. So it is possible that both funds hold the same stocks. I would like to examine the correlation of the ex-ante between the two funds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know I can calculate the ex-ante tracking error as below,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;te = sqrt((port_wgt - bm_wgt)' * cov_matrix * (port_wgt - bm_wgt))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also know the correlation is calculated by&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; p = cov(x,y) / stdev(x) * stdev(y)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I was wondering the best way to calculate the ex ante correlation between the two funds? Is there a relationship between the two funds weights that I can make use of?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I should have mentioned that the two portfolios are sub portfolios and are combined into one portfolio. So I wanted to see the correlation of the ex ante tracking error between the two sub portfolio's.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I realised I can do the following,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;port_wgts - number_of_companies x 2 matrix&#xA;cov_matrix - number_of_companies x number_of_companies matrix&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so the below line will return a 2x2 covariance matrix.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;port_wgts' * cov_matrix * prt_wgts&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I have the variances of both sub portfolios - taking the square root of this gives me the tracking error for both. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Convert the 2 X 2 covariance matrix to a correlation matrix by the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  D = Diag(cov_matrix)^(1/2)&#xA;  corr_matrix = D^-1 * cov_matrix * D^-1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I now have the correlation between the two sub portfolios just using the weights.&lt;/p&gt;&#xA;" OwnerUserId="7530" LastEditorUserId="7530" LastEditDate="2014-04-30T16:00:21.417" LastActivityDate="2016-05-28T16:11:24.113" Title="ex ante tracking error correlation between funds" Tags="&lt;risk&gt;&lt;covariance&gt;&lt;correlation-matrix&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11102" PostTypeId="2" ParentId="10960" CreationDate="2014-04-29T10:17:18.253" Score="2" Body="&lt;p&gt;1) Brownian Bridge is used in Quasi Monte Carlo pricing of asian options to reexpress paths in a basis where few selected components/subspaces bring the most contribution, so as to align these to the best distributed dimensions/subspaces of a low discrepancy sequence. This allows for better coverage and thus faster convergence and paths amount reduction. However for different kinds of options such important directions will be different so that BB will perform worse, and Papageorgiou showed a pathologic example where the standard incremental path construction performs better (and BB worst), simply by using a payoff most responsive to the individial increments and nearly indifferent to the average. &#xA;This can be generalized: given any option payoff and a LDS sequence an optimal path construction will be determined. Or given any path construction and LDS sequence one can find both a &quot;friendly&quot; or an indifferent payoff.&#xA;Check &quot;New brownian bridge&quot; paper for a first variation on the theme. Also Leobacher and Sloan both wrote on this topic, but that might be beyond your needs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) This sounds strange to me: the analytical step with BB will not be easier, especially outside of a GBM setting. If you mean to perform all by simulation then considerations in 1) still hold.&lt;/p&gt;&#xA;" OwnerUserId="3015" LastActivityDate="2014-04-29T10:17:18.253" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11103" PostTypeId="1" AcceptedAnswerId="11114" CreationDate="2014-04-29T10:31:58.877" Score="17" ViewCount="6788" Body="&lt;p&gt;This may be a very obvious question, but can someone tell me where and when the names &lt;em&gt;call&lt;/em&gt; and &lt;em&gt;put&lt;/em&gt; originated?&#xA;And similarly, where do the terms &lt;em&gt;American&lt;/em&gt; and &lt;em&gt;European&lt;/em&gt; option come from?&#xA;Aside from the explanation that it has nothing to do with the continents, I have not seen a textbook that says anything about why they are called that way.&lt;/p&gt;&#xA;" OwnerUserId="7396" LastActivityDate="2021-02-01T19:28:44.690" Title="Why are options called what they are called?" Tags="&lt;options&gt;" AnswerCount="10" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="11104" PostTypeId="2" ParentId="10960" CreationDate="2014-04-29T12:32:23.860" Score="3" Body="&lt;p&gt;You can find a brief but useful explanation of Brownian bridge techniques in &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0984422102&quot; rel=&quot;nofollow&quot;&gt;Andersen and Piterbarg&lt;/a&gt; (page 125), which includes references for further reading.  It's probably the best place to start.  They discuss valuing barrier options specifically, and discuss the performance issues mentioned here.  Later (pg 647), they use Brownian bridges in constructing a Libor market model, which is a useful example.&lt;/p&gt;&#xA;" OwnerUserId="7891" LastActivityDate="2014-04-29T12:32:23.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11105" PostTypeId="2" ParentId="11103" CreationDate="2014-04-29T13:05:06.930" Score="2" Body="&lt;p&gt;Call and put are more or less obivous. For the expression &quot;European&quot; and &quot;American&quot; I once read that &quot;American&quot; options are more complex and &quot;European&quot; options are easier. So somebody (I just googled the story but didn't find it) thought that &quot;easier&quot; should be called &quot;European&quot;. &#xA;This does not fully answer you question but maybe somebody finds the source.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I just read in this &lt;a href=&quot;http://dennis-winkler.de/html/europaische_und_amerikanische_.html&quot; rel=&quot;nofollow&quot;&gt;German link&lt;/a&gt; that American options used to be traded in the US only and European only in Europe ... I wonder whether this is correct ...&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-04-29T13:05:06.930" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="11106" PostTypeId="2" ParentId="11101" CreationDate="2014-04-29T13:13:42.263" Score="0" Body="&lt;p&gt;It is unclear to me what you ask. You have the covariance matrix and today's weights - then you get an ex-ante TE. Why do you need ex-ante correlation? Ex-ante means that weights are fixed and you take an estimator of the future covariance matrix. What you get is an ex-ante TE (if you scale by $\sqrt{T}$ and you have $T$ periods in a year). If weights change tomorrow then you have and new ex-ante TE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you observe the funds for a while and you calculate the TE between the two funds NAVs then you get the ex-post (i.e. realized) TE.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-04-29T13:13:42.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11110" PostTypeId="2" ParentId="11090" CreationDate="2014-04-29T22:16:57.463" Score="2" Body="&lt;p&gt;You can obtain the desired effect by tweaking the bond construction. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, let's say you're creating a 4-years bond with semiannual coupons paying 3%, but missing the last. This makes for 7 coupons. Instead, you'll create the schedule as usual (so you have 8 periods), but specify a null last coupon when creating the bond. So: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Schedule schedule = ...;  // as for a &quot;normal&quot; bond;&#xA;&#xA;std::vector&amp;lt;Rate&amp;gt; coupons(8, 0.03);  // 8 coupons...&#xA;coupons.back() = 0.0;   // but the last one pays 0%.&#xA;&#xA;FixedRateBond bond(settlementDays, faceAmount,&#xA;                   schedule, coupon,&#xA;                   accrualDayCounter);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will give you the correct price; the disadvantage is that you'll have a coupon paying 0%, which is less clean than having just the ones that actually exist. If this turns out to be a problem, you can inherit from &lt;code&gt;FixedRateCouponBond&lt;/code&gt; and delete the coupon in the constructor. But I would guess it's way easier to just filter out null cash flows in your client code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use the same trick for most kinds of bond; e.g., for floating-rate bonds you can cancel the last coupon by passing a null gearing.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2014-04-29T22:16:57.463" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="11113" PostTypeId="2" ParentId="10117" CreationDate="2014-04-30T05:29:04.510" Score="1" Body="&lt;p&gt;Interesting idea. I would like to have the  reference you are using for this scheme? You are treating X/Y as a stock and then using Bollinger Band kind of signalling mechanism. I would think you would define the entry/exits more strictly to make it profitable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are making a lot of trades using this system, then from backtesting, you can figure out your winning and losing trades and probabilities and use &lt;a href=&quot;http://www.investopedia.com/articles/trading/04/091504.asp&quot; rel=&quot;nofollow&quot;&gt;Money Management using Kelly Fraction&lt;/a&gt; for sizing trade investment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Bollinger band(+/- 2 sigma from mean), generally 14 or 21 day rolling window, when stock is above mean (z-score 0), it tends to stay up. It is a trend following indicator. With z-score&gt;0, you can stay with positive trend. Of course, you need to build in some loss rule like 5-8% loss from mean to avoid whipsaws. A trend up is higher high and higher lows, trend down the opposite. You initiate a trade only if the trend is established. If the stock moves downward then play that once the trend develops. If the sigma becomes small then it tends to explode either to the up or down side. You could hedge this by buying a strangle one sigma away cheap and then once you make money ride with this system. I have outlaid this as if you are using S=Y/X as a stock. In pair trading, if you buy a spread and it widens it is the same thing.&lt;/p&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="7867" LastEditDate="2014-04-30T15:24:03.270" LastActivityDate="2014-04-30T15:24:03.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11114" PostTypeId="2" ParentId="11103" CreationDate="2014-04-30T13:44:05.050" Score="14" Body="&lt;p&gt;Regarding the terms 'American' and 'European':&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Though primary sources are scarce, it is likely that privilege trading in the US was present from the late 18th century beginnings of trade in securities, perhaps earlier in the produce markets. Over time, this trade developed differently from Europe due to differing settlement practices. In the US, “each day is a settling day and a clearing day for transactions of the day before ... This is a marked difference from European practice” where “trading for the account” (prolongationsgeschäfte) involves monthly or fortnightly settlement periods with allowance for continuation of the position until the next settlement date (Emery 1896, p.82). The continuation process for a buyer seeking to delay delivery involves the immediate sale of the stock being delivered and the simultaneous repurchase for the next settlement date. As this transaction would involve the lending of money, an&#xA;  additional ‘contango’ payment would typically be required. As a consequence of these settlement differences, in the US (American) options developed with fixed exercise prices, possible exercise prior to delivery and premiums paid in advance. In Europe, premiums for (European) options would be due on the scheduled future delivery date which coincided with a regular settlement date, exercise could only take place on the delivery date and the exercise price would be adjusted to determine a market clearing ‘price’ for the option at the time of purchase. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;From &quot;&lt;a href=&quot;http://www.sfu.ca/~poitras/heinz_%24%24.pdf&quot;&gt;The Early History of Options Contracts&lt;/a&gt;&quot; by Geoffrey Poitras.&lt;/p&gt;&#xA;" OwnerUserId="7891" LastActivityDate="2014-04-30T13:44:05.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11119" PostTypeId="1" AcceptedAnswerId="11120" CreationDate="2014-04-30T21:31:36.620" Score="0" ViewCount="549" Body="&lt;p&gt;If so, is there a derivation anywhere that shows this? I was told that this could be done in a class but I don't see how it's possible.&lt;/p&gt;&#xA;" OwnerUserId="2812" LastActivityDate="2018-08-26T16:29:33.897" Title="Can one use the Greeks (delta,gamma,theta) to show that the Black-Scholes call formula satisfies the Black-Scholes PDE?" Tags="&lt;black-scholes&gt;&lt;greeks&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11120" PostTypeId="2" ParentId="11119" CreationDate="2014-04-30T22:03:51.303" Score="1" Body="&lt;p&gt;It's quite straightforward when you plug in the formulae for the greeks into the PDE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Preliminaries:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Delta =\frac{\partial c_t}{\partial S_t}=\Phi(d_1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Gamma=\frac{\partial^2 c_t}{\partial S_t^2}=\frac{\phi(d1)}{S_t\sigma\sqrt{u}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Theta=\frac{\partial c_t}{\partial t}=-rKe^{ru}\Phi(d_2)-S_t\phi(d_1)\frac{\sigma}{2\sqrt{u}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Black Scholes PDE:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;rc_t&amp;amp;=&amp;amp;\Theta+rS_t\Delta + \frac{1}{2}S_t^2\sigma^2\Gamma\\&#xA;RHS&amp;amp;=&amp;amp;-rKe^{ru}\Phi(d_2)-S_t\phi(d_1)\frac{\sigma}{2\sqrt{u}}+rS_t\Phi(d_1)+\frac{1}{2}S_t^2\sigma^2 \frac{\phi(d1)}{S_t\sigma\sqrt{u}}\\&#xA;&amp;amp;=&amp;amp;-rKe^{ru}\Phi(d_2)-\frac{S_t\phi(d_1)\sigma}{2\sqrt{u}}+rS_t\Phi(d_1)+ \frac{S_t\sigma\phi(d1)}{2\sqrt{u}}\\&#xA;&amp;amp;=&amp;amp;rS_t\Phi(d_1)-rKe^{ru}\Phi(d_2)\\&#xA;&amp;amp;=&amp;amp;rc_t\\&#xA;&amp;amp;=&amp;amp;LHS&#xA;\end{eqnarray}&lt;/p&gt;&#xA;" OwnerUserId="7903" LastEditorUserId="16160" LastEditDate="2018-08-26T16:29:33.897" LastActivityDate="2018-08-26T16:29:33.897" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="11121" PostTypeId="2" ParentId="11100" CreationDate="2014-05-01T00:42:35.793" Score="4" Body="&lt;p&gt;The stock was split into two share classes, the series that you might be looking for is under the ticker GOOGL.&lt;/p&gt;&#xA;" OwnerUserId="3491" LastActivityDate="2014-05-01T00:42:35.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11122" PostTypeId="1" CreationDate="2014-05-01T01:02:28.380" Score="1" ViewCount="3558" Body="&lt;p&gt;Is it possible calculate Value at Risk on an asset without a time horizon?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What kind of variables do you need? Variables that are on the table are value, standard deviation, beta, market return, risk free rate, and its realized return. And, of course, confidence level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone give me an example of necessary variables for this kind of calculation with a 95% confidence level?&lt;/p&gt;&#xA;" OwnerUserId="7957" LastActivityDate="2019-04-09T13:02:20.477" Title="How can I calculate Value at Risk?" Tags="&lt;value-at-risk&gt;" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11125" PostTypeId="2" ParentId="11122" CreationDate="2014-05-01T08:22:37.140" Score="1" Body="&lt;p&gt;First you decide what timeframe your VaR has to have. Next you decide what level of VaR you are going to have. Many examples use 1 day 99%, but you could use 1 month 95% VaR or whatever as long as it makes sense. When you have chosen those parameters you need to find the standard deviation of your portfolio. The standard deviation is the square root of the portfolio variance which you can see how is calculated here (among other things, e.g.):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Modern_portfolio_theory&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Modern_portfolio_theory&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can either use historical data (which most examples do) or a market implied variance covariance matrix or a hybrid of those things. First I assume the parameters mentioned in your question are not given and you are going to use historical data. Maybe you need modify the data so it's historical returns for a specific time series. Then you can find the variance covariance matrix for your historical data. When you have found the portfolio variance for the data you need to scale for time. So, if your data is monthly and you want 1 day VaR you need to devide with the square root of 21 because that is the average amount of business days in one month, then you have a proxy of the daily standard deviation of your portfolio. You multiply with the square root of time if your data is daily and you want a monthly VaR. The next thing you do is to look up the standard deviate for your choice of VaR level. For example if you want 95% VaR the standard deviate for that is when $\alpha = 5\%$ then the standard deviate is &lt;strong&gt;1.96&lt;/strong&gt; and there you have it the VaR:  $$VaR = - 1.96 * \sigma_p$$ and some people use the the expected return of the portfolio for the timeframe also in the VaR calculation i.e. $$VaR = \mu_p - 1.96*\sigma_p$$ In your case your portfolio is just one asset an there is there for no covariance matrix, just the expected return $\mu$ and the standard deviation $\sigma$. Usually the default timeframe for the standard deviation is anually. To get a daily VaR from an annual standard deviation you need to devide the annual $\sigma$ with $\sqrt{252}$ to get a daily $\sigma$. &lt;/p&gt;&#xA;" OwnerUserId="7584" LastEditorUserId="7584" LastEditDate="2014-05-01T09:00:27.567" LastActivityDate="2014-05-01T09:00:27.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11126" PostTypeId="2" ParentId="7112" CreationDate="2014-05-01T09:06:46.597" Score="2" Body="&lt;p&gt;Stocks in the market can be twisted in braids and knots according to this paper&#xA;&lt;a href=&quot;http://arxiv.org/abs/1404.6637&quot; rel=&quot;nofollow&quot;&gt;http://arxiv.org/abs/1404.6637&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is a direct way to apply topology in finance.&lt;/p&gt;&#xA;" OwnerUserId="7962" LastActivityDate="2014-05-01T09:06:46.597" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11127" PostTypeId="2" ParentId="11122" CreationDate="2014-05-01T10:44:47.607" Score="0" Body="&lt;p&gt;Value at risk means the considering investing in a risky asset.Value at risk is a tool for the risk assessment.Especially in the area of finance and business value of risk is calculated.This is always used in the short form that is VaR or it is abbreviated  is a risk measure.There are different approaches for calculating the value at risk.There is a formula for calculating the delta-normal method given below:-&#xA;VaR=alpha*sigma*Exposure&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the above formula Alpha indicates the normal deviation.Sigma indicates the volatility of the underlying assets. Exposure is the particular risk  factor.&lt;/p&gt;&#xA;" OwnerUserId="7963" LastActivityDate="2014-05-01T10:44:47.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11128" PostTypeId="2" ParentId="10761" CreationDate="2014-05-01T14:57:53.423" Score="2" Body="&lt;p&gt;To calibrate BS you compute volatility $\sigma$, to calibrate SABR you compute implied $\alpha$, the volvol and $\beta$, the skewness. These parameters does not play the same role. So you can't really use the parameters of one models to calibrate another. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But you can build equivalent parmaters, i.e. compute an equivalent vol under SABR to use BS pricing formula. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Look at the asymptotic solution paragraph:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/SABR_volatility_model&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/SABR_volatility_model&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5052" LastActivityDate="2014-05-01T14:57:53.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11129" PostTypeId="2" ParentId="10844" CreationDate="2014-05-01T15:21:28.090" Score="2" Body="&lt;p&gt;nicolas is quite right.  For completeness, AccuShares has registered new products (the VIX Up and VIX Down shares, filing &lt;a href=&quot;http://www.sec.gov/Archives/edgar/data/1580167/000089109214002129/e57915s1.htm#pro1_030&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;) which are designed to track spot VIX.  However, this approach has not worked out particularly well in the past (consider &lt;a href=&quot;http://seekingalpha.com/article/24387-crude-etf-critics-and-the-macroshares-affair&quot; rel=&quot;nofollow&quot;&gt;UCR and DCR&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="7891" LastActivityDate="2014-05-01T15:21:28.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11130" PostTypeId="2" ParentId="11093" CreationDate="2014-05-01T15:22:27.633" Score="-1" Body="&lt;p&gt;I would say &quot;option style&quot;. From &lt;a href=&quot;http://en.wikipedia.org/wiki/Option_style&quot; rel=&quot;nofollow&quot;&gt;Wikipedia&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In finance, the style or family of an option is a general term denoting the class into which the option falls, usually defined by the dates on which the option may be exercised. The vast majority of options are either European or American (style) options. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="7166" LastActivityDate="2014-05-01T15:22:27.633" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11131" PostTypeId="2" ParentId="11122" CreationDate="2014-05-01T16:37:23.310" Score="2" Body="&lt;p&gt;OP is asking if VaR can be calculated without time horizon. @steinbitur has given you the variables to be used in VaR etc. You can google and find links to VaR on wiki. Basically &lt;strong&gt;You cannot calculate VaR without time horizon.&lt;/strong&gt; VaR is defined as worst possible loss in a given time horizon with given level of confidence. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is possible that your portfolio returns are mean reverting, in which case, you may just have a maximum loss, regardless of time horizon, then it reverts. You could define a Maximum VaR loss theoretically. In reality the markets are random and to think you have such ideal portfolio will fly in the face of risk management. The regulators and Basel all have time horizon associated with it.&lt;/p&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="7867" LastEditDate="2014-05-01T17:12:12.637" LastActivityDate="2014-05-01T17:12:12.637" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11132" PostTypeId="1" AcceptedAnswerId="11134" CreationDate="2014-05-02T02:21:40.820" Score="6" ViewCount="1457" Body="&lt;p&gt;What are the most useful results that I should put on a mathematical finance cheat sheet? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I missing anything important:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/daleroberts/math-finance-cheat-sheet&quot;&gt;&lt;a href=&quot;https://github.com/daleroberts/math-finance-cheat-sheet&quot;&gt;https://github.com/daleroberts/math-finance-cheat-sheet&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="393" LastActivityDate="2014-05-05T21:14:09.970" Title="What should I put on a math finance cheat sheet?" Tags="&lt;theory&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11133" PostTypeId="2" ParentId="11093" CreationDate="2014-05-02T05:47:26.570" Score="1" Body="&lt;p&gt;A specific option is generally defined as follows and in the following order:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Underlying&lt;/li&gt;&#xA;&lt;li&gt;Exchange/ Trading Class&lt;/li&gt;&#xA;&lt;li&gt;Expiry&lt;/li&gt;&#xA;&lt;li&gt;Strike&lt;/li&gt;&#xA;&lt;li&gt;Call/Put&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Whether an Option is European or American generally follows from the above but you can still include a field/property to explicitly mention it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But for the purpose of this discussion you should &lt;strong&gt;not&lt;/strong&gt; denote whether an option is a call or put by using &quot;Right&quot; because the option is turning out to be an obligation if you hold a short position in the option. I know that some brokers denote a call or put as &quot;Right&quot; but it is inaccurate and can cause confusion. I would recommend to use terminology such as &quot;CallPut&quot; or &quot;PutCall&quot; or &quot;OptionType&quot;. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2014-05-02T05:47:26.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11134" PostTypeId="2" ParentId="11132" CreationDate="2014-05-02T06:33:21.740" Score="5" Body="&lt;p&gt;There is a very famous math finance cheat sheet already (by Prof. Wystup), you can find the content here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://mathfinance2.com/Products/CheatSheet#Content&quot;&gt;https://mathfinance2.com/Products/CheatSheet#Content&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2014-05-02T06:33:21.740" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11135" PostTypeId="2" ParentId="11132" CreationDate="2014-05-02T07:38:08.737" Score="0" Body="&lt;p&gt;Depending on how long you want the cheat sheet to be, I think maybe touching on some numerical methods that are of importance would be useful. Simply because quant jobs will often require intense analysis of the error in your models and the algorithms that implement them, something along those lines I could see being useful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, many quant interviews may consist of asking for pseudocode implementations of various ideas, so when it comes to automating the process of solving a differential equation to use in a model, numerical computation becomes important. Especially for firms where speed of deployment is a concern, knowing how to control error and create streamlined and robust numerical algorithms that run quickly will be important.&lt;/p&gt;&#xA;" OwnerUserId="7385" LastActivityDate="2014-05-02T07:38:08.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11138" PostTypeId="1" CreationDate="2014-05-02T10:29:11.867" Score="2" ViewCount="80" Body="&lt;p&gt;versus a standard Generalised Black and Scholes model (if there are any?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have read the paper but I am not to sure about its practical implications as would people with more experience using this model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Source&lt;/strong&gt;: &lt;a href=&quot;http://people.oregonstate.edu/~thomanen/Geo599/Schwartz_Miltersen.pdf&quot; rel=&quot;nofollow&quot;&gt;http://people.oregonstate.edu/~thomanen/Geo599/Schwartz_Miltersen.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="134" LastActivityDate="2014-05-02T10:29:11.867" Title="What is the main reasons to use Miltersen &amp; Schartz (1998) model for commodity futures options" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;models&gt;&lt;factor-models&gt;&lt;commodities&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11139" PostTypeId="2" ParentId="11122" CreationDate="2014-05-02T12:00:27.807" Score="0" Body="&lt;p&gt;If the variable of interest shows ergodicity (I.e., exhibits a well - defined long run distribution), one could consider a &quot;long run&quot; VaR in principle. Otherwise, I agree that a time horizon must be specified.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the ergodic case, the information required to calculate the VaR is a characterization of the long run distribution.&lt;/p&gt;&#xA;" OwnerUserId="11767" LastEditorUserId="11767" LastEditDate="2014-05-02T12:05:39.660" LastActivityDate="2014-05-02T12:05:39.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11140" PostTypeId="1" CreationDate="2014-05-02T12:02:32.857" Score="-2" ViewCount="7142" Body="&lt;p&gt;I'm strongly interested to computing Elliott Wave to any given Timeseries. Does anybody tried?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any phython library to do that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for an algorithm taht if I give to it a time series, it label each movement according to &lt;a href=&quot;http://en.wikipedia.org/wiki/Elliott_wave_principle&quot; rel=&quot;nofollow&quot;&gt;Elliott Wave principle&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7827" LastEditorUserId="467" LastEditDate="2015-03-02T03:25:35.243" LastActivityDate="2016-05-02T07:24:28.200" Title="How to apply Elliott wave priciple to any Time Series?" Tags="&lt;time-series&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11141" PostTypeId="1" AcceptedAnswerId="11154" CreationDate="2014-05-02T12:17:40.393" Score="4" ViewCount="1331" Body="&lt;p&gt;It appears &lt;code&gt;q/KDB&lt;/code&gt; is being using for Time series analysis for &lt;code&gt;HFT&lt;/code&gt;. &#xA;What are some of the advantages of using &lt;code&gt;q/KDB&lt;/code&gt; for &lt;code&gt;HFT&lt;/code&gt; time series over other regular time series. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does it provide for multivariate statistical testing etc done normally on time series? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does it provide easy to use facilities for Statistical Arb and technical analysis? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any free versions of &lt;code&gt;q/KDB&lt;/code&gt; to use and learn?&lt;/p&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="743" LastEditDate="2014-06-11T21:14:15.427" LastActivityDate="2014-06-11T21:14:15.427" Title="What features does q /KDB provide for HFT use?" Tags="&lt;programming&gt;&lt;quant-trading-strategies&gt;&lt;trading&gt;&lt;high-frequency&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11144" PostTypeId="2" ParentId="11140" CreationDate="2014-05-02T13:14:21.577" Score="0" Body="&lt;p&gt;Have not seen any Python libraries for that strangely. I have a feeling you wont find any. Fibonacci Numbers are easy to calculate in Python. &lt;/p&gt;&#xA;" OwnerUserId="7867" LastActivityDate="2014-05-02T13:14:21.577" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11145" PostTypeId="1" CreationDate="2014-05-02T13:56:06.833" Score="3" ViewCount="157" Body="&lt;p&gt;Modeling for interest rate derivatives (such as bermudan swaptions) is said to have undergone significant changes since the crisis.   Prior to the crisis, counterparty default risk was often ignored, allowing modelers to unify many curves that are now separated.  Part of the story is in the Risk article &lt;a href=&quot;http://www.risk.net/risk-magazine/feature/2270178/goldman-and-the-ois-gold-rush-how-fortunes-were-made-from-a-discounting-change&quot; rel=&quot;nofollow&quot;&gt;Goldman and the OIS Gold Rush&lt;/a&gt; (paywall alert).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am interested in articles or answers that characterize these changes, both in terms of what assumptions were changed and what that meant in terms of numerically modeling portfolios of interest rate derivatives.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2014-05-02T13:56:06.833" Title="Pre- Versus post-2008 Crisis Rates Modeling" Tags="&lt;options&gt;&lt;fixed-income&gt;&lt;credit-risk&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11147" PostTypeId="1" CreationDate="2014-05-02T18:52:43.840" Score="3" ViewCount="225" Body="&lt;p&gt;Suppose we have an index whose value is calculated by a weighted geometric mean. Now we want to recreate the index using its underlying components. How would we go about calculating the hedge ratios for the underlying components? Would the hedge ratios be dynamic?&lt;/p&gt;&#xA;" OwnerUserId="5940" LastActivityDate="2014-05-02T18:52:43.840" Title="Calculating the Hedge Ratio" Tags="&lt;hedging&gt;&lt;index&gt;&lt;optimal-hedge-ratio&gt;&lt;nonlinear&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11149" PostTypeId="1" AcceptedAnswerId="41120" CreationDate="2014-05-03T05:34:53.277" Score="5" ViewCount="1339" Body="&lt;p&gt;I am working on hedging agency MBSs using treasury bonds. So my question raise as which treasury bond should more likely be a hedging underlying of a MBS. What is the matching criteria usually for MBS hedging? Duration matching, coupon matching, maturity matching, or others.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any MBS hedging opinions comments are welcome! I am using optimal monte carlo to do the hedge, so I need a more related hedging instrument.&lt;/p&gt;&#xA;" OwnerUserId="7978" LastActivityDate="2021-01-30T12:39:55.433" Title="What is the hedging underlying of MBS" Tags="&lt;fixed-income&gt;&lt;hedging&gt;&lt;bond&gt;&lt;mbs&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11151" PostTypeId="1" CreationDate="2014-05-03T09:38:12.200" Score="3" ViewCount="929" Body="&lt;p&gt;i'm following the &quot;&lt;a href=&quot;https://class.coursera.org/compinvesting1-002&quot; rel=&quot;nofollow noreferrer&quot;&gt;Computational Investing 1&lt;/a&gt;&quot; course at Coursera.org, I was affascinated by the Beta arbitrage of CAPM&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Video: &lt;a href=&quot;https://class.coursera.org/compinvesting1-002/lecture/view?lecture_id=119&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://class.coursera.org/compinvesting1-002/lecture/view?lecture_id=119&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It shows, that if I found Betas and weights, I could make profit in Bearish and bullish markets. &#xA;Strategy: SHORT for the Higher Beta, and LONG for Lower beta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is that really works? What are the bad scenarios? What he didn't say?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/UxNQi.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you know some code in R or Python, that calculate Betas? Someone has already applied this theory?&lt;/p&gt;&#xA;" OwnerUserId="7827" LastEditorUserId="7827" LastEditDate="2014-05-03T09:44:10.197" LastActivityDate="2014-05-14T11:57:24.973" Title="Beta arbitrage in CAPM" Tags="&lt;beta&gt;&lt;capm&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11152" PostTypeId="1" CreationDate="2014-05-03T12:41:30.307" Score="0" ViewCount="118" Body="&lt;p&gt;how market makers set the time factor to calculate option greeks on the expiration day?&#xA;does they set time equal 1/24or 2/24 when only 1hour or 2hour left? what frequency market makers update new time to calculate greeks so that they hedge better? &lt;/p&gt;&#xA;" OwnerUserId="7980" LastActivityDate="2014-05-03T21:05:20.863" Title="how market makers set the time factor to calculate option greeks on the expiration day?" Tags="&lt;greeks&gt;&lt;expiration&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11153" PostTypeId="1" CreationDate="2014-05-03T13:47:14.460" Score="4" ViewCount="997" Body="&lt;p&gt;I would like to know if there is a way (or theory) to manage a multi-strategy, multi-instruments portfolio that would calculate the optimal weight to allocate capital for each combination of strategy and instrument (sometimes we may find one strategy works for many instrument or vice versa).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first idea is that we can treat each combination of strategy and instrument as a imaginary instrument and introduce Markowitz's portfolio theory to find the optimal weight.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I also learned that the estimated return and covariance is very noisy in practice and deduce very different results from CAPM. May not be a ideal way. Another problem is that my strategies could be various across types and timeframe (from intra-day to month holding times). Estimating average return on daily basis could be misleading and underestimate return of strategies that works infrequently (for instance, strategies that take advantage on annual earning announcement or monthly FOMC meeting).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I checked Kelly formula and found the answer from it is exactly as Markowitz's theory. Thus, most issues on mean-variance theory (e.g. noise of estimation for mean and variance) applies here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder if anyone can share some thoughts on this issue. Any idea/example?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks.&lt;/p&gt;&#xA;" OwnerUserId="7981" LastActivityDate="2014-09-17T13:10:07.130" Title="Capital Allocation for Portfolio of Multi-Strategy and Multi-Instrument" Tags="&lt;quant-trading-strategies&gt;&lt;portfolio-management&gt;&lt;risk-management&gt;&lt;modern-portfolio-theory&gt;&lt;kelly-criterion&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11154" PostTypeId="2" ParentId="11141" CreationDate="2014-05-03T16:31:41.657" Score="1" Body="&lt;p&gt;KDB is a column oriented database and is optimized for time series. As far as I know there are no libraries available for statistical testing and you pretty much have to write things on your own.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This page has tutorials&#xA;&lt;a href=&quot;http://code.kx.com/wiki/Main_Page&quot; rel=&quot;nofollow&quot;&gt;http://code.kx.com/wiki/Main_Page&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can download the free version from here&#xA;&lt;a href=&quot;http://kx.com/software-download.php&quot; rel=&quot;nofollow&quot;&gt;http://kx.com/software-download.php&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most popular book is below&#xA;&lt;a href=&quot;http://code.kx.com/wiki/JB%3aQforMortals2/contents&quot; rel=&quot;nofollow&quot;&gt;http://code.kx.com/wiki/JB:QforMortals2/contents&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2142" LastActivityDate="2014-05-03T16:31:41.657" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11156" PostTypeId="2" ParentId="11152" CreationDate="2014-05-03T21:05:20.863" Score="1" Body="&lt;p&gt;That's usually taken care of in software, and expiration tenors are &lt;em&gt;always&lt;/em&gt; set fractionally, because it is both (a) easier and (b) more reliable not to have two different code paths.  Allow me to note as well that &quot;days to expiration&quot; is often only for display to humans, with systems working internally using years, seconds, or voltime.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Back when we were market-making options, we didn't use an intraday volatility profile but I always thought we should have and I'm sure quality options market-makers today use one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you are asking questions at this rather elementary level (no offense intended), then aside from &quot;fractional days&quot; you should be at least as motivated to learn about&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;those intraday volatility profiles&lt;/li&gt;&#xA;&lt;li&gt;overnight versus live trading volatility&lt;/li&gt;&#xA;&lt;li&gt;holiday management &lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.tradingnerd.com/2006/10/real-reason-stocks-often-times-pin.html&quot; rel=&quot;nofollow&quot;&gt;pin risk&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="254" LastActivityDate="2014-05-03T21:05:20.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11158" PostTypeId="2" ParentId="11132" CreationDate="2014-05-04T08:46:43.150" Score="2" Body="&lt;p&gt;At this stage your sheet is focus on &quot;&lt;em&gt;stochastic calculus for derivative pricing&lt;/em&gt;&quot;. It is just a subset of math finance.&#xA;You are missing:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;risk management (VaR, quantiles, etc) -- more statistics than stochastic calculus. See for instance the content of &lt;a href=&quot;http://www.symmys.com/attilio-meucci/book&quot; rel=&quot;nofollow&quot;&gt;Attilio Meucci's book&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;quantitative trading (optimal trade scheduling, smart order routing, microstructure) -- more control and point processes. See for instance the content of &lt;a href=&quot;http://www.worldscientific.com/worldscibooks/10.1142/8967&quot; rel=&quot;nofollow&quot;&gt;Lehalle-Laruelle's book&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You may consider that portfolio allocation is a subset of the first topic and thus include it in it. Or have another section on its own that for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may thus need at least three double pages instead of one...&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2014-05-05T21:14:09.970" LastActivityDate="2014-05-05T21:14:09.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11160" PostTypeId="1" CreationDate="2014-05-04T15:44:15.657" Score="0" ViewCount="142" Body="&lt;p&gt;Can someone help me with calculating Stochastic Volatility (of stocks and options) using SAS or R or Matlab please? I am new to SAS and I am trying to use Heston model, White-Hull model or any other suitable model but have no idea how to do this in SAS/ R/Matlab. Any help, any codes, any tips, any warnings are all welcome. I am using FTSE data at the moment. Thank you in advance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Seer&lt;/p&gt;&#xA;" OwnerUserId="7985" LastActivityDate="2014-05-04T15:44:15.657" Title="Stochastic Volatility for Stocks, FTSE" Tags="&lt;volatility&gt;&lt;models&gt;&lt;codes&gt;&lt;ftse&gt;&lt;stochastic&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11163" PostTypeId="1" CreationDate="2014-05-04T23:14:00.497" Score="3" ViewCount="158" Body="&lt;p&gt;&lt;em&gt;My question covers a more or less classical portfolio optimization situation with a twist: How to partition assets into minimally correlated portfolios, with and without asset overlap.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have $N$ assets of which I know their price series and thus also covariance matrix. I would like to create a number of portfolios with them them (each with maximum utility, such as minimum variance), &lt;strong&gt;such that the mutual correlation of these portfolios is minimized&lt;/strong&gt;. (A suitable objective function for the correlation norm could be the sum of the first or third powers of the portfolios' upper triangular covariance matrix.) There's two variants of how to do this:&#xA;(a) without overlap (i.e., an asset may be appear in at most one portfolio), and &#xA;(b) with overlap (i.e., an asset may appear in multiple portfolios)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, I could approach this problem by brute force (metaheuristic) optimization, but this will become expensive quickly due to combinatorial complexity as $N$ increases. What I'm hoping is that there's a more statistically guided way, be it analytical or semi-analytical to guide a heuristic optimization approach, to partition the assets into minimally correlated portfolios.&lt;/p&gt;&#xA;" OwnerUserId="7192" LastActivityDate="2014-06-05T07:29:47.927" Title="Partition assets into minimally correlated portfolios" Tags="&lt;portfolio-management&gt;&lt;correlation&gt;&lt;portfolio-optimization&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11164" PostTypeId="2" ParentId="10830" CreationDate="2014-05-05T03:48:07.243" Score="5" Body="&lt;p&gt;&quot;It's compliated&quot; because the trading strategy performance will depend on the data which is most likely serially correlated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you want to look into bootstrap approaches for time series such as the block bootstrap, or the wild bootstrap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another approach would be to look into 'random portfolios' or an approximation thereof.  The basic idea is to test how much better your portfolios performs relative to a naive benchmark.&lt;/p&gt;&#xA;" OwnerUserId="69" LastActivityDate="2014-05-05T03:48:07.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11165" PostTypeId="1" AcceptedAnswerId="11213" CreationDate="2014-05-05T13:27:45.780" Score="1" ViewCount="102" Body="&lt;p&gt;Return of an investment for a given period is by definition: &#xA;$$r = \frac{P}{W_0} - 1$$&#xA;where $P$ is the price of the investment at the end of the period, and $W_0$ is the initial investment. I want to understand how much the return changes in terms of percentage, with respect to that of the price. This naturally is the definition of elasticity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Elasticity can be calculated as:&#xA;$$\epsilon = \frac{\partial{r}}{\partial{P}} \cdot \frac{P}{r} = \frac{P}{P-W_0}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if we have a leverage of 2x, we should have a elasticity of 2. However, I do not seem to be able to connect these two concepts. If $W_0$ is normalized to 1, then the formula becomes:&#xA;$$\epsilon = \frac{P}{P-1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When $\epsilon = 2$, this implies that P = 2. However, this says that only when $P$ is twice that initial investment $W_0$ that the leverage is 2. When price is higher, the leverage &lt;strong&gt;decreases&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where did I get the logic wrong?&lt;/p&gt;&#xA;" OwnerUserId="6804" LastActivityDate="2014-05-09T09:03:34.600" Title="How to reason about leverage in terms of elasticity" Tags="&lt;portfolio-management&gt;&lt;finance&gt;&lt;leverage&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11166" PostTypeId="1" CreationDate="2014-05-05T15:09:04.583" Score="4" ViewCount="2247" Body="&lt;p&gt;I am trying to figure out how to turn implied yield volatility of a short-term interest rate into implied price volatility. Is there an equation to do this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have come across the equation for a bond:&#xA;(price_vol = yield_vol*modified_duration*forward_yield)&#xA;But, I do not believe this is correct for a STIR option.&lt;/p&gt;&#xA;" OwnerUserId="5981" LastEditorUserId="26556" LastEditDate="2019-07-18T13:13:13.067" LastActivityDate="2019-07-18T13:13:13.067" Title="What equation will convert implied yield volatility to implied price volatility?" Tags="&lt;options&gt;&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;implied-volatility&gt;&lt;bond&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11167" PostTypeId="2" ParentId="11163" CreationDate="2014-05-05T16:30:52.983" Score="1" Body="&lt;p&gt;You can start by doing Principal Component Analysis on the returns data and treat principal components as your portfolios .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To ensure that you have non-negativ weights you can use Non-negative Sparse PCA. There is an R implementation in the &lt;a href=&quot;http://cran.r-project.org/web/packages/nsprcomp/index.html&quot; rel=&quot;nofollow&quot;&gt;nsprcomp&lt;/a&gt; package. &lt;code&gt;nsprcomp&lt;/code&gt; is the necessary function and &lt;code&gt;nneg&lt;/code&gt; is the parameter you need to set. &lt;/p&gt;&#xA;" OwnerUserId="2142" LastEditorUserId="848" LastEditDate="2014-06-05T07:29:47.927" LastActivityDate="2014-06-05T07:29:47.927" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11168" PostTypeId="1" CreationDate="2014-05-05T16:34:31.837" Score="2" ViewCount="1202" Body="&lt;p&gt;Im trying to calculate monthly ZCB bond prices with a fixed maturity T, over a period of months via Monte Carlo methods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my attempt:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the first month, the price is &#xA;$P_{t_0}(0,T) = E[exp(-\int_{t_0}^T r_s ds)]$,&#xA;for the second month, the price is &#xA;$P_{t1}(0,T) = E[exp(-\int_{t1}^{T+t1} r_s ds)]$,&#xA;and so on up to the last month.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I construct N interest rate paths $r_t$ via Euler discretization, and approximate the expectations by taking the mean of each row of the matrix with elements&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;exp[-(T/M+1)*sum(r_s[t_i:t_{i+M}, j])]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where M is the number of months between maturity T and the &quot;start month&quot; of the bond price,&#xA;j from 1 to N.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The maturity T is 3 years. So I let dt = 1/12 (in the Euler discretization) and T=3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where does it all go wrong?&lt;/p&gt;&#xA;" OwnerUserId="7939" LastEditorUserId="467" LastEditDate="2014-11-17T08:54:55.717" LastActivityDate="2014-11-17T08:54:55.717" Title="How to price zero coupon bonds with the Monte Carlo method?" Tags="&lt;stochastic-processes&gt;&lt;monte-carlo&gt;&lt;pricing&gt;&lt;bond&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="11169" PostTypeId="1" AcceptedAnswerId="11172" CreationDate="2014-05-05T21:24:45.740" Score="7" ViewCount="1541" Body="&lt;p&gt;As titled, my question consists on asking for why in the most of academic papers one almost always finds that when you try to model asset returns, one needs to adjust for risk factors before analyzing asset portfolio returns. Someone can explain why is it important and how to do that?&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2014-05-09T10:27:46.663" LastActivityDate="2014-05-09T10:27:46.663" Title="Why are factor models so popular for risk analysis of portfolios?" Tags="&lt;risk&gt;&lt;finance&gt;&lt;factor-models&gt;&lt;asset-pricing&gt;&lt;asset-returns&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="11170" PostTypeId="1" CreationDate="2014-05-05T21:28:12.730" Score="3" ViewCount="741" Body="&lt;p&gt;I was wondering whether there are a set of assumptions for portfolio optimisation with higher moments (including kurtosis and skewness) as there are for regular mean-variance optimisation?&lt;/p&gt;&#xA;" OwnerUserId="5190" LastActivityDate="2014-05-05T22:36:25.890" Title="What are the assumptions of portfolio optimisation with higher moments?" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;mean-variance&gt;&lt;portfolio-optimization&gt;&lt;markowitz&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11171" PostTypeId="2" ParentId="11170" CreationDate="2014-05-05T22:36:25.890" Score="4" Body="&lt;p&gt;There are many papers on this subject (try googling portfolio optimization skewness kurtosis) that can describe the assumptions of including skewness and kurtosis in a utility function (if that's what you're interested in). I would highlight two main points. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Mean-variance optimization does not make an assumption of normality. Assume returns are distributed by a multivariate normal distribution with particular mean and covariance parameters and then construct a portfolio. Then perform the same optimization assuming a multivariate t distribution with the same parameters and a degree of freedom parameter. The result will be different portfolios that will become more alike as you increase the degrees of freedom. &#xA;This is because the parameter for covariance in a multivariate normal distribution matches the covariance as a moment, but that is not true for a multivariate t (or more general multivariate distributions). So people saying mean-variance assumes normality is disingenuous. It's probably more accurate to say that it doesn't incorporate the full shape of a distribution of portfolio returns as well as other techniques can.&lt;/li&gt;&#xA;&lt;li&gt;When you say portfolio optimization with higher moments, there are many different options. I tend to askew the techniques that rely on analytical techniques. If estimating a covariance matrix is hard, a co-kurtosis matrix is a waste of time. This means that you are best off relying on a scenario-based representation of returns. &#xA;For instance, in the example in point 1, you could randomly generate returns from both the multivariate normal and t. In the optimization, you could use an analytical formula to get the mean and covariance (calculated from the scenarios), but then you could calculate the actual portfolio returns under the simulation and calculate the skewness and kurtosis of those, instead of relying on an analytical formula. The downside of this approach is that it requires you to specify preferences on portfolio skewness and kurtosis. I find it hard enough to be confident in my preferences for a trade-off between mean and variance, so I'm not inclined to try to have even more opinions on how these moments are traded off. &#xA;The most common alternative is to rely on techniques like CVaR/ES that try to capture tail risks. CVaR has many useful properties that make it easier to deal with than adding in skewness and kurtosis terms to utility functions.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2014-05-05T22:36:25.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11172" PostTypeId="2" ParentId="11169" CreationDate="2014-05-05T22:54:34.460" Score="4" Body="&lt;p&gt;There are a few reasons to use factor models. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most importantly, stocks tend to move together. Stated alternately, the first principal component of the securities in a domestic market tends to explain a large share of the variance. If you're concerned with multiple securities (as in portfolio optimization), then you have to account for this or you will estimate too large a diversification effect. More sophisticated factor models also try to explain things like why do small cap stocks tend to outperform large cap stocks. Why do stocks with low P/Bs tend to outperform stocks with high P/Bs. And so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dimensionality is also a major reason. For $N$ assets, a covariance matrix has $N$ variance terms and $N(N-1)/2$ correlation terms. A factor model with $F$ factors has $N$ idiosyncratic variance terms (assuming you are making that assumption for the errors), $F$ factor variances, and $NF$ betas. So long as $2F&amp;lt;N(N-1)/(N+1)$, you're estimating fewer parameters with a factor model.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2014-05-05T22:54:34.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11173" PostTypeId="1" AcceptedAnswerId="11178" CreationDate="2014-05-05T23:58:33.947" Score="1" ViewCount="1002" Body="&lt;p&gt;I have a return history for a universe of risky assets and I've run a principal component algorithm and obtained a loadings matrix (num_factors by num_assets) for the first 5 factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a portfolio as well (a subset of the above universe) with weights w for each of the assets.  This portfolio has a variance \sigma^2.  How do I figure out the percentage of the variance in the portfolio that comes from factor 1?&lt;/p&gt;&#xA;" OwnerUserId="5689" LastEditorUserId="5689" LastEditDate="2014-05-09T21:20:15.640" LastActivityDate="2014-05-09T21:20:15.640" Title="Calculating Variance Explained from PCA Loadings" Tags="&lt;variance&gt;&lt;pca&gt;&lt;factor-loading&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11175" PostTypeId="1" CreationDate="2014-05-06T02:27:24.830" Score="2" ViewCount="2606" Body="&lt;p&gt;Looking for places which can give me historical tick data for free or for the cheapest price.&#xA;Don't really need it to be live , can be delayed too.&#xA;What are my options.&#xA;Mainly looking for tick data for one contract - i.e. NYMEX WTI crude&lt;/p&gt;&#xA;" OwnerUserId="7991" LastActivityDate="2014-05-09T15:08:14.007" Title="Where can i find tick data for futures contracts" Tags="&lt;tick-data&gt;" AnswerCount="1" CommentCount="3" ClosedDate="2014-05-09T17:04:14.440" ContentLicense="CC BY-SA 3.0" />
  <row Id="11176" PostTypeId="2" ParentId="11169" CreationDate="2014-05-06T06:56:24.463" Score="2" Body="&lt;p&gt;Another important reason for using risk-adjusted returns is to disentangle &quot;skill&quot; from &quot;risk-taking&quot;. Think of a equation for a fund's performance like: $r_{i,t}-r_f=\alpha_i+\epsilon_{i,t}$ where $\alpha_i$  gives you the average excess return of fund $i$. Alpha is often interpreted as measure of a managers' skill in timing the market and selecting securities. If one fund simply takes illiquid assets than on average he will gain a greater alpha. But this is simply because he receives the additional risk premia for holding illiquid securities and not because of the fund managers skill. Therefore one needs additional risk factors to &quot;control&quot; for the additional risk premia. And this is what &quot;risk-adjusting&quot; means. &lt;/p&gt;&#xA;" OwnerUserId="7344" LastActivityDate="2014-05-06T06:56:24.463" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11177" PostTypeId="1" CreationDate="2014-05-06T07:56:46.963" Score="2" ViewCount="508" Body="&lt;p&gt;I am trying to find the empirical copula linking two random variables $X$ and $Y$. &#xA;I have some data available but it's limited with respect to the variable $Y$ and I am not convinced it's enough data and will lead to the right copula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The variable $Y$ can attain any value greater than 0 and I am interested in the probability&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{P}(X\leq u, Y\leq 1)=C(F_{X}(u),F_{Y}(1))$$&#xA;for different $u$.&#xA;I have data pairs for $Y\leq 2$, but no data pairs for $Y$ greater than 2. &#xA;As I am only interested in the copula linking the probability of $\mathbb{P}(Y\leq 1)$ and $\mathbb{P}(X\leq u)$ and not interested in probabilities of $Y$ greater than 2, can I use the data with values of $Y$ up to 2 and not greater or do I need data for all possible values of $Y$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been stuck on this for a few weeks now and could really use some help.&lt;/p&gt;&#xA;" OwnerUserId="7649" LastEditorUserId="41390" LastEditDate="2020-08-29T14:42:34.040" LastActivityDate="2020-08-29T14:42:34.040" Title="Empirical bivariate copula when one variable is restricted" Tags="&lt;data&gt;&lt;probability&gt;&lt;copula&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="11178" PostTypeId="2" ParentId="11173" CreationDate="2014-05-06T09:57:57.023" Score="7" Body="&lt;p&gt;PCA gives you a decomposition of the covariance matrix of the form&#xA;$$&#xA;\Sigma = V \Lambda V^T&#xA;$$&#xA;where $\Lambda$ is diagonal with the eigenvalues in the diagonal.&#xA;Your portfolio variance is&#xA;$$&#xA;w^T \Sigma w = (V^T w )^T \Lambda (V^T w)&#xA;$$&#xA;On the other hand if you take your return matrix $R$ and define &#xA;$$&#xA;F = V^T R&#xA;$$&#xA;then the covariance matrix of these so called principle portfolios is $\Lambda$.&#xA;You find this &lt;a href=&quot;http://www.cass.city.ac.uk/__data/assets/pdf_file/0003/213699/Meucci-ReDefining-and-Managing-Diversification.pdf&quot;&gt;here by Meucci&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact he writes $V^{-1} R$ for the return of principle portfolios&#xA;and defines the weights $w^* = V^{-1} w$ for the weight of the original portfolio on the principle portfolios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;He then defines $v_n = (w^*)^2 \lambda_n^2$ for the contribution of the n-th principle portfolio to the portfolio variance. If you relate this to the total volatility of the portfolio then you are done. Note that $V$ is orthogonal which means that $V^{-1} = V^T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recommend to read the following &lt;a href=&quot;http://www.lyxor.com/publications/white-papers/wp/82/&quot;&gt;white paper&lt;/a&gt; or &lt;a href=&quot;http://systematicedge.wordpress.com/2013/06/02/principal-component-analysis-in-portfolio-management/&quot;&gt;this blog entry&lt;/a&gt; or &lt;a href=&quot;http://www.northinfo.com/documents/515.pdf&quot;&gt;this&lt;/a&gt; to get more details.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2014-05-06T10:41:38.370" LastActivityDate="2014-05-06T10:41:38.370" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11179" PostTypeId="2" ParentId="11177" CreationDate="2014-05-06T11:37:28.763" Score="1" Body="&lt;p&gt;For the empirical copula between $X$ and $Y$ as well as for the (estimate of the) probability $P(X\leq u, Y\leq 1)$ you would need additional assumptions before you restrict to $Y\leq 1$ or $Y\leq 2$. But you could calculate $P(X\leq u\mid Y\leq 1)$, i.e. the empirical distribution of $X$ conditional on $Y\leq 1$, just using data with $Y\leq 1$. This is proportional to $P(X\leq u, Y\leq 1)$ and sometimes all one needs.&lt;/p&gt;&#xA;" OwnerUserId="482" LastActivityDate="2014-05-06T11:37:28.763" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11180" PostTypeId="1" AcceptedAnswerId="11335" CreationDate="2014-05-06T12:57:57.407" Score="4" ViewCount="2054" Body="&lt;p&gt;I am looking for a C# .Net library that provides trade performance analytics similar to R-PerformanceAnalytics. Basic return statistics, draw-downs, risk-adjusted returns, risk (variations), distributional analytics,...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I checked all the general Math/Stats C# libraries and I can certainly whip up analytics from several such libraries but something that covers more specific financial asset return analysis did not come across my search. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even basic trade analytics such as risk/reward, MAR, MAE/MFE, drawdowns would be helpful, just to generate some quick stats for a side-project.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I am not interested in a R solution as I am already aware of the R PerformanceAnalytics package. I am looking for a C# library, commercial or open-source. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2014-05-09T17:36:45.273" LastActivityDate="2014-05-17T10:58:05.700" Title="Looking for C# library that provides/contains performance analytics" Tags="&lt;returns&gt;&lt;performance-evaluation&gt;&lt;performanceanalytics&gt;&lt;programming&gt;" AnswerCount="2" CommentCount="19" ContentLicense="CC BY-SA 3.0" />
  <row Id="11182" PostTypeId="1" AcceptedAnswerId="12862" CreationDate="2014-05-06T15:35:37.250" Score="6" ViewCount="1556" Body="&lt;p&gt;I stumbled over the term &lt;a href=&quot;http://en.wikipedia.org/wiki/Non-negative_matrix_factorization&quot; rel=&quot;nofollow&quot;&gt;Non-negative matrix factorization&lt;/a&gt; in presentations such as &lt;a href=&quot;http://daotunglam.free.fr/Works/MachineLearning.pdf&quot; rel=&quot;nofollow&quot;&gt;Application of Machine Learning to Finance&lt;/a&gt; and this &lt;a href=&quot;http://www.thierry-roncalli.com/download/big-data-in-asset-management.pdf&quot; rel=&quot;nofollow&quot;&gt;Big Data in Asset Management&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The basic idea is to decompose a positive (!) matrix $A$ in&#xA;$$&#xA;A = BC.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then one can interpret $B$ as factor loadings and $C$ as factors.&#xA;I assume that $A$ is not a correlation matrix (which is not necessarily positive) neither a return matrix for the same reason.&#xA;The authors of the first presentation use the logarithm of stock prices shifted to the right as input.&#xA;I tried this myself and did not find any useful decomposition. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have used stock prices and also shifted returns (just adding $1$) to have the whole matrix positive. &#xA;Then I applied the R function &lt;code&gt;nnmf&lt;/code&gt; of the package NMFN which uses the Multiplicative Update Algorithm. I get some &quot;factors&quot; but the interpretation is by far not clear. In the presentation they say that one can (probably) recognize a bear and a bull market factor. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Did you ever try such a decomposition? Which input do you use? Which algorithm and which factors do you analyze? Thanks!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS:I am aware of PCA but I wanted to try an alternative. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: For NMF I am having a look at &lt;a href=&quot;http://papers.nips.cc/paper/3104-nonnegative-sparse-pca.pdf&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; as a first start.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Apparently there are is another stream of research of cardinality constraint and non-negative exposures in PCA. Christian Sigg provides an R-package and Matlab code for doing this &lt;a href=&quot;http://sigg-iten.ch/learningbits/2013/05/27/nsprcomp-is-on-cran/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2014-05-08T13:22:28.863" LastActivityDate="2014-07-01T12:47:45.750" Title="Non-negative matrix factorization for factor analysis of stocks" Tags="&lt;equities&gt;&lt;quant-trading-strategies&gt;&lt;factor-models&gt;&lt;pca&gt;&lt;factor-loading&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="11183" PostTypeId="1" CreationDate="2014-05-06T19:11:15.187" Score="4" ViewCount="710" Body="&lt;p&gt;For the two-variable case, what are the practical differences between using the Engle-Granger procedure versus the Johansen test for cointegration? Is one universally more powerful than the other? Will one give more false positives or false negatives than the other? Should Johansen always be preferred?&lt;/p&gt;&#xA;" OwnerUserId="5251" LastActivityDate="2016-05-06T14:20:23.073" Title="What's the practical difference between the Johansen vs Engle-Granger tests for cointegration?" Tags="&lt;cointegration&gt;&lt;best-practices&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11184" PostTypeId="1" AcceptedAnswerId="11185" CreationDate="2014-05-06T21:04:52.323" Score="2" ViewCount="2734" Body="&lt;p&gt;Find correlation vector like $[ d e f ]$ where d, e and f represent correlation of P(portfolio) with its assets A, B and C respectively. The assets A, B, C can be another portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order for that, is it possible to find a correlation matrix including the portfolio along with its asset, given the correlation matrix for the assets in the portfolio? For example, for 3 assets A,B, C you have correlation matrix as&#xA;$$\left(\begin{matrix}&#xA; 1 &amp;amp; a &amp;amp; b  \\&#xA; a &amp;amp; 1 &amp;amp; c \\&#xA; b  &amp;amp; c &amp;amp; 1&#xA;\end{matrix}\right)$$&#xA;Now, using this or some other data concisely get a new correlation matrix for assets A,B,C, and P(for portfolio) like&#xA;$$\left(\begin{matrix}&#xA; 1 &amp;amp; a &amp;amp; b &amp;amp; d \\&#xA; a &amp;amp; 1 &amp;amp; c &amp;amp; e\\&#xA; b  &amp;amp; c &amp;amp; 1 &amp;amp; f \\&#xA; d  &amp;amp; e &amp;amp; f &amp;amp; 1 &#xA;\end{matrix}\right) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt; The real interest is getting the $[ d e f ]$ vector, which can be generalized in matrix form. Let P be combined portfolio consisting of N assets or sub portfolios. &#xA;Let Vector Cov(P)= [Cov(P,1) Cov(P,2) ... Cov(P,N)]', $\Sigma$ is the variance covariance matrix of portfolio P, and vector w=[w(P,1) w(P,2) ... w(P,N)] then&#xA;$$Cov(P)= \Sigma w $$&#xA;$$ D=diag(sqrt(diag(\Sigma)) $$&#xA;$$ Corr(P)=D^{-1} Cov(P) D^{-1} $$&lt;/p&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="7867" LastEditDate="2014-05-13T15:45:34.450" LastActivityDate="2020-08-16T06:50:01.700" Title="Given a correlation martrix, calculate portfolio's correlation with its assets" Tags="&lt;correlation&gt;&lt;portfolio&gt;&lt;factor-models&gt;&lt;correlation-matrix&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11185" PostTypeId="2" ParentId="11184" CreationDate="2014-05-06T21:28:07.267" Score="3" Body="&lt;p&gt;It's probably easiest to think about it in terms of a covariance matrix and then convert it to a correlation matrix after. If instead of the first matrix you have some covariance matrix of the assets $\Sigma$, then you could get the portfolio variance, for one portfolio, as $w' \Sigma w $, where you could have $w\equiv\left(w_{1},w_{2},w_{3}\right)'$. Alternately, you could construct a matrix $W$, such that $W\equiv\left[\begin{array}{cc}&#xA;I &amp;amp; w\end{array}\right]&#xA; $, where $I$ is a $3 \times 3$ identity matrix in your case (but really could be something more general). Calculating $W' \Sigma W$ would give you a matrix such that the top left $3 \times 3$ is the original covariance matrix and then is appended with the variance of the portfolio and its covariance with the securities. You can then convert the covariance matrix to a correlation matrix to have the final result you want.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastEditorUserId="2379" LastEditDate="2014-05-06T21:38:33.277" LastActivityDate="2014-05-06T21:38:33.277" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="11186" PostTypeId="1" AcceptedAnswerId="11187" CreationDate="2014-05-07T05:39:45.770" Score="3" ViewCount="336" Body="&lt;p&gt;We have a Cox-Ross-Rubinstein model with parameters $u$ (&quot;up&quot;), $d$ (&quot;down&quot;) , $r$ (interest rate) and $q$ (equivalent martingale probability) $(q=(1+r-d)(u-d)^{-1})$ . We have a contingent claim with payoff &#xA;$$&#xA;X=S_1(N)^c&#xA;$$&#xA;where $S_1(N)$ is the final price, and $c$ is a positive integer.&#xA;I need to show that the initial valuation of a claim is:&#xA;$$&#xA;\pi_X(0) = S_1(0)^c(1+r)^{-N}\left(u^cq+d^c(1-q)\right)^N&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that &#xA;\begin{align}&#xA;\pi_X(0) &amp;amp; = E_Q[\frac{X}{S_0(N)}] \\&#xA;&amp;amp; = (1+ r)^{-N}E_Q[S_1(N)^c] \\&#xA;&amp;amp; = (1+ r)^{-N} \sum_{j=0}^N(S_1(0)u^jd^{N-j})^c{N \choose k}q^j(1-q)^{N-j}&#xA;\end{align}&#xA;and then the $S_1(0)$ can be taken out which gives me the first part, but then I'm not really sure how to proceed. I don't see how the &quot;T choose k&quot; bit is going to disappear, or how we can get rid of the summation sign.&lt;/p&gt;&#xA;" OwnerUserId="7998" LastEditorUserId="7903" LastEditDate="2014-05-07T13:36:20.113" LastActivityDate="2014-05-07T13:36:20.113" Title="Valuation of Cox-Ross-Rubinstein Model" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;finance&gt;&lt;valuation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11187" PostTypeId="2" ParentId="11186" CreationDate="2014-05-07T11:11:45.643" Score="1" Body="&lt;p&gt;There was an error in your expected value, which I have corrected - the probabilities and the binomial coefficient (the &quot;N choose k&quot;) should not be raised to the power $c$. With that correction, it is a simple application of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Binomial_theorem&quot; rel=&quot;nofollow&quot;&gt;Binomial theorem&lt;/a&gt;:&#xA;\begin{eqnarray}&#xA;\left(u^cq+d^c(1−q)\right)^N&amp;amp;=&amp;amp;\sum_{j=0}^N {N \choose j}(u^cq)^{j}(d^c(1−q))^{N-j}\\&#xA;&amp;amp;=&amp;amp;\sum_{j=0}^N {N \choose j} \left(u^j d^{N-j}\right)^c q^j (1-q)^{N-j}&#xA;\end{eqnarray}&lt;/p&gt;&#xA;" OwnerUserId="7903" LastActivityDate="2014-05-07T11:11:45.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11189" PostTypeId="1" CreationDate="2014-05-07T12:14:42.893" Score="1" ViewCount="522" Body="&lt;p&gt;In Sinclair's book, wee need to compare standard deviation with &quot;true volatility&quot; to check the power of the model suggested, close -to-cloce, or Parkinson formula, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What do we mean here by &quot;true&quot; volatility when we calculate standard deviation, with what we have to compare it with?&lt;/p&gt;&#xA;" OwnerUserId="7985" LastEditorUserId="467" LastEditDate="2014-05-09T08:45:26.187" LastActivityDate="2014-05-09T09:12:56.270" Title="What does &quot;true&quot;volatility mean in volatility comparison?" Tags="&lt;volatility&gt;" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11190" PostTypeId="1" AcceptedAnswerId="11245" CreationDate="2014-05-07T13:01:22.010" Score="7" ViewCount="16267" Body="&lt;p&gt;What is the definition of price pressure and what does it imply?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a number of paper I read that the price pressure can influence the portfolio returns; can you explain why and in which way it can do that?&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-04-23T10:53:52.323" LastActivityDate="2017-03-16T07:26:55.270" Title="What is the price pressure?" Tags="&lt;finance&gt;&lt;market-microstructure&gt;&lt;asset-pricing&gt;&lt;asset-returns&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="11192" PostTypeId="2" ParentId="11169" CreationDate="2014-05-07T14:11:44.803" Score="4" Body="&lt;p&gt;Portfolio returns  are analyzed to account for risk factors only to determine what the risk factor contributed to the returns, was it the underlying assets or the skill of the portfolio manager. Fama French model explains the returns in terms of principal component such SMB and HML besides the market related returns from CAPM. These links have more detais likes of which you may have already read &lt;a href=&quot;http://www.bogleheads.org/wiki/Fama_and_French_three-factor_model&quot; rel=&quot;nofollow&quot;&gt;Fama and French Three Factor Model&lt;/a&gt;, and this &lt;a href=&quot;http://www.bogleheads.org/wiki/Fama-French_three-factor_model_analysis&quot; rel=&quot;nofollow&quot;&gt;Factor Analysis example&lt;/a&gt;. What ever is left over is either alpha (skill) or stochastic ( luck) return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edited: correct the example link&lt;/p&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="7867" LastEditDate="2014-05-07T15:52:32.867" LastActivityDate="2014-05-07T15:52:32.867" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11194" PostTypeId="1" CreationDate="2014-05-07T15:29:51.100" Score="2" ViewCount="2605" Body="&lt;p&gt;I'm self-studying several questions on Ruey S. Tsay's &lt;a href=&quot;http://faculty.chicagobooth.edu/ruey.tsay/teaching/&quot; rel=&quot;nofollow&quot;&gt;teaching page&lt;/a&gt;. I'm experiencing some difficulty getting the correct answer for &lt;a href=&quot;http://faculty.chicagobooth.edu/ruey.tsay/teaching/bs41202/sp2014/fexam13.pdf&quot; rel=&quot;nofollow&quot;&gt;final exam 2013&lt;/a&gt; Problem B Question 3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given a Student-t GARCH (1,1) model, I believe that the correct way to calculate 1-Day $VaR$ would be to take the 1-Day predicted mean ($\mu_t$) and standard deviation ($\sigma_t$) and apply the formula: $VaR_{0.99} = \mu_t+t_{0.99}\cdot \sigma_t$. To get the $VaR$ in dollar terms we multiply this by the position size, $1 million.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In applying the results below, I took $\mu_t=-0.001711227, \sigma_t=0.02180995$ and the t-distribution degrees of freedom from the shape parameter in the results, $5.483$. However, this gives the wrong answer. The correct answer is $VaR = $$54,687, which can be found in the &lt;a href=&quot;http://faculty.chicagobooth.edu/ruey.tsay/teaching/bs41202/sp2014/fexam13s.pdf&quot; rel=&quot;nofollow&quot;&gt;solutions manual&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The results are here:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; summary(m3)&#xA;Title: GARCH Modelling&#xA;Call: garchFit(formula = ~garch(1,1), data=xt, cond.dist=&quot;std&quot;, trace = F)&#xA;Mean and Variance Equation:&#xA;data ~ garch(1, 1) [data = xt]&#xA;Conditional Distribution: std&#xA;Error Analysis:&#xA;Estimate Std. Error t value Pr(&amp;gt;|t|)&#xA;mu -1.711e-03 3.698e-04 -4.627 3.71e-06 ***&#xA;omega 6.235e-06 2.499e-06 2.495 0.0126 *&#xA;alpha1 4.833e-02 1.027e-02 4.707 2.51e-06 ***&#xA;beta1 9.421e-01 1.227e-02 76.812 &amp;lt; 2e-16 ***&#xA;shape 5.483e+00 5.379e-01 10.192 &amp;lt; 2e-16 ***&#xA;---&#xA;Standardised Residuals Tests:&#xA;Statistic p-Value&#xA;Ljung-Box Test R Q(10) 14.9856 0.1325876&#xA;Ljung-Box Test R^2 Q(10) 5.575123 0.849608&#xA;Information Criterion Statistics:&#xA;AIC BIC SIC HQIC&#xA;-4.780660 -4.770210 -4.780667 -4.776892&#xA;&amp;gt; predict(m3,1)&#xA;meanForecast meanError standardDeviation&#xA;1 -0.001711227 0.02180995 0.02180995&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="4862" LastEditorUserId="4862" LastEditDate="2014-05-07T16:13:51.547" LastActivityDate="2018-12-27T14:33:33.860" Title="Calculating the VaR from a GARCH(1,1) with Student-t innovations" Tags="&lt;r&gt;&lt;var&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11195" PostTypeId="1" AcceptedAnswerId="11202" CreationDate="2014-05-07T16:25:47.920" Score="1" ViewCount="1129" Body="&lt;p&gt;I want to construct some time-varying BBX copulas, however, I found that patron's package does not contain time-varying BBX copula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anybody know where I can download them?&lt;/p&gt;&#xA;" OwnerUserId="8005" LastEditorUserId="467" LastEditDate="2014-05-07T17:03:47.170" LastActivityDate="2014-05-08T10:41:46.847" Title="Where can I find implementations of the time-varying copula (BBX) in Matlab or R?" Tags="&lt;copula&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="11196" PostTypeId="2" ParentId="3156" CreationDate="2014-05-07T18:25:34.820" Score="14" Body="&lt;p&gt;I don't like KDB+/q.&#xA;For KDB+ experts, I am not picking a fight.&#xA;The following is just my own understanding on KDB+ and TimeSeries Database.&#xA;You're warmly welcome to correct me if anything wrong in your eyes :).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all, during my near one year's KDB+/q development experience, I never ever find a paper based benchmark result indicating KDB+/q significantly out performs other storage system in time.&#xA;By storage system, I don't limit the scope to disk based RDBMS.&#xA;So I don't know why everybody in quant finance is talking about KDB+ and impressed by its efficiency without data backing their points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, I once talked with an Oracle Certificated DBA about KDB+.&#xA;From my description, the first word he came up is an in-memory cache not even a full fledge database.&#xA;Maybe he is right to some extent, isn't he?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next is the so-called TimeSeries.&#xA;More than one manager advocating KDB+ from different positions and companies talked to me KDB+ is a TimeSeries Database.&#xA;However, I don't think TimeSeries is a feature of KDB+, whose real feature is the column oriented storage engine.&#xA;That is to say with a column oriented storage engine, that KDB+ is friendly to store TimeSeries data.&#xA;While in these days, column oriented storage engine does not belong to KDB+ exclusive.&#xA;For traditional RDBMS, like MySQL, you can also find corresponding column storage engines in the open source communities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The last and the most important, I want to talk about the developer friendliness.&#xA;KDB+ is distributed along with a DSL, which is q.&#xA;q is very developer unfriendly.&#xA;When an error encountered, it just raise the error type, without any line information for you to anchor, which increase the difficulty to bug fixing and code maintenance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatives to KDB+ I can come up with:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;to give the system column oriented storage, a traditional K-V store&#xA;works, even a column storage backed RDBMS;&lt;/li&gt;&#xA;&lt;li&gt;for the in-memory feature, a lot of open source implementation of in-memory cache,&#xA;like redis, memcached, etc.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The key feature for the alternative, I think, is that the API is written in standard C/C++.&#xA;You could have a lot of utilities to ease your development.&lt;/p&gt;&#xA;" OwnerUserId="3030" LastActivityDate="2014-05-07T18:25:34.820" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="11199" PostTypeId="2" ParentId="11189" CreationDate="2014-05-08T02:14:36.860" Score="2" Body="&lt;p&gt;Sinclair also writes: &quot;volatility measurement is something of an art.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One aspect of volatility trading, and the one which you allude to, is to trade deviations of &lt;strong&gt;future realized volatility&lt;/strong&gt; against implied volatility. So, the task is to estimate/model future realized volatility as a predictor of &lt;strong&gt;true volatility&lt;/strong&gt; and Sinclair simply said that realized volatility (whether it be daily or intraday) functions as building block for many models to predict true volatility, that volatility measure utilized to trade against implied volatility. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2014-05-08T02:14:36.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11200" PostTypeId="1" AcceptedAnswerId="11203" CreationDate="2014-05-08T08:32:33.700" Score="1" ViewCount="9968" Body="&lt;p&gt;I have two sub portfolios (lets call them portfolio a &amp;amp; portfolio b - a portfolio is just a vector of weights that sum to 1) that combine to create a total portfolio. I also have a 2 x 2 covariance matrix. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; | Variance a     Covariance ab |   &#xA; | Covariance ab  Variance b    |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;By taking the square root of the diagonals of this covariance matrix and I able to create a 2 x 2 correlation matrix so I can get the correlation between portfolio a and b.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I would like to know is the correlation of portfolio a with the total portfolio (that is portfolio a and portfolio b combined) &amp;amp; the correlation of portfolio b with the total portfolio?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I should mention that portfolios a &amp;amp; b have the same investable universe. So let says our investable universe is 2000 stocks. portfolio a is a 2000 x 1 vector as is portfolio b. Row i in both vectors correspond to the same company which is linked to another matrix.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  Company             Portfolio a        portfolio b&#xA;  ABC                 0                  0.25&#xA;  DEF                 0.1                0.05&#xA;  GHJ                 0.05               0.05&#xA;  IJK                 0.12               0&#xA;  ...                 ...                ...&#xA;  2000th Company      0.03               0.02&#xA;&#xA;  Total               1                  1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The 2 x 2 covariance matrix was calculated by the following,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   P' * COV * P&#xA;&#xA;   P is a 2000 x 2 matrix column 1 is portfolio a, 2nd column is portfolio b&#xA;   COV is a 2000 x 2000 matrix of all the stock variance &amp;amp; covariances.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt; In reference to user12348 post. &lt;a href=&quot;https://quant.stackexchange.com/questions/11184/given-a-correlation-martrix-calculate-portfolios-correlation-with-its-assets&quot;&gt;Another Post&lt;/a&gt; provides alternate solution, while Marco's  solution also works.  &lt;/p&gt;&#xA;" OwnerUserId="7530" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2018-04-01T10:42:30.917" Title="Calculate correlation between two sub portfolios and the combined portfolio" Tags="&lt;statistics&gt;&lt;portfolio-management&gt;&lt;correlation&gt;&lt;modern-portfolio-theory&gt;&lt;covariance&gt;" AnswerCount="4" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11201" PostTypeId="2" ParentId="11189" CreationDate="2014-05-08T08:50:42.593" Score="0" Body="&lt;p&gt;It is becoming more and more common to calculate realized vol using intraday data, usually 5 minutes. This is used to compare performance of other volatility estimators.&lt;/p&gt;&#xA;" OwnerUserId="7451" LastActivityDate="2014-05-08T08:50:42.593" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11202" PostTypeId="2" ParentId="11195" CreationDate="2014-05-08T10:41:46.847" Score="2" Body="&lt;p&gt;Implementations of the BBx families are available from the &lt;a href=&quot;http://cran.r-project.org/web/packages/VineCopula/index.html&quot; rel=&quot;nofollow&quot;&gt;VineCopula&lt;/a&gt; R-package from CRAN. Spatially and spatio-temporally varying bivariate copulas are provided through the R-package &lt;a href=&quot;https://r-forge.r-project.org/projects/spcopula/&quot; rel=&quot;nofollow&quot;&gt;spcopula&lt;/a&gt; from r-forge. Temporal support will need some additional work as it was not part of the initial design. The tuning of the copulas' parameter can be done via a dependence function that relates distance with Kendall's tau or Spearman's rho. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will find the method &quot;tailIndex&quot; (from package copula) that provides the upper and lower tail coefficients for any copula object passed to it. Numerical inversion could be a first attempt to use it as parameter tuning function. However, be aware that the solution might not be unique (i.e. for two or more parameter families). Additional criteria will most likely be necessary for sensible fits.&lt;/p&gt;&#xA;" OwnerUserId="8016" LastActivityDate="2014-05-08T10:41:46.847" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11203" PostTypeId="2" ParentId="11200" CreationDate="2014-05-08T13:59:39.667" Score="3" Body="&lt;p&gt;You can obtain the covariance between 2 portfolios by multiplying the row vector, containing the weights of portfolio A with the variance-covariance matrix of the assets and then multiplying with the column vector, containing the weights of assets in portfolio B. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equally you can set up a new portfolio A+B by creating a new column vector that contains the combined weights of column vectors A and B and perform same as above to obtain your covariance between A and A+B. Same follows for B and A+B.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2014-05-13T08:50:58.420" LastActivityDate="2014-05-13T08:50:58.420" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="11204" PostTypeId="1" CreationDate="2014-03-10T13:15:41.143" Score="10" ViewCount="231" Body="&lt;p&gt;I have issues with this problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\{X_t, t\in \Bbb N\}$ be a 2-state stationary Markov chain, with transition $M$ (and $M(1,2)\neq 0 \neq M(2,1)$), let $\{W_t, t\in \Bbb N\}$ be a strong Gaussian white noise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $$&#xA;Y_t = b_{X_t} + \sigma_{X_t} W_t&#xA;$$&#xA;How to prove that $\{Y_t, t\in \Bbb N\}$ is an ARMA(1,1) process?&lt;/p&gt;&#xA;" OwnerUserId="7671" OwnerDisplayName="mookid" LastEditorUserId="2587" LastEditDate="2014-05-12T09:17:44.363" LastActivityDate="2014-05-12T09:17:44.363" Title="2-state HMM / ARMA process?" Tags="&lt;probability&gt;&lt;stochastic-processes&gt;&lt;time-series&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11205" PostTypeId="1" CreationDate="2014-05-08T15:13:08.647" Score="0" ViewCount="103" Body="&lt;p&gt;I'm looking into modelling monthly stock prices and want to start off by using data from Yahoo Finance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that the closing prices given there are adjusted for stock splits and dividends, but I'd like to use the given raw data and adjust it myself. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For modelling purposes, should I adjust the past prices for dividends? I've researched this and read mixed opinions expressed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My thought process was that suppose XYZ closes at 100 before a dividend of 0.05 is implemented. On the next day, the stock should ideally open at 99.95 and automatically account for the dividend given out. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this right or am I really wrong? Sorry if this is a noob question. &lt;/p&gt;&#xA;" OwnerUserId="8017" LastActivityDate="2014-09-06T17:39:43.487" Title="Adjusting open, highs and lows for past monthly stock prices?" Tags="&lt;dividends&gt;&lt;adjusted&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11207" PostTypeId="2" ParentId="11200" CreationDate="2014-05-08T16:01:35.930" Score="8" Body="&lt;p&gt;To clarify notation, you have an universe of $n=2000 \space$  stocks and two portfolio vectors $\mathbf{a},\mathbf{b}\in\mathbb{R}^{n}$ with $\left\|\mathbf{a}\right\|_{1}=\left\|\mathbf{b}\right\|_{1}=1$. Further, you have Estimators for the true Variance $\operatorname{Var}\left[\mathbf{a}\right]$ resp. $\operatorname{Var}\left[\mathbf{b}\right]$ and the Covariance $\operatorname{Cov}\left[\mathbf{a},\mathbf{b}\right]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Normally you'd multiply the portfolio weights with the random return vector $\boldsymbol{\mu}\in\mathbb{R}^{n}$ to get the portfolio returns $p_{\mathbf{a}} := \mathbf{a}^{T}\boldsymbol{\mu}$. This portfolio return now is a random variable and it makes sense to speak of its Variance etc. In slight abuse of Notation you can call the portfolio value $a$, which is now a real number. The same holds for the portfolio value $b$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a new portfolio $\alpha{a}+\beta{b}=:{c}\in\mathbb{R}\space$ with weights $\alpha+\beta=1$ you want to know $\operatorname{Var}\left[{c}\right]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For two correlated random vectors the following holds (&lt;a href=&quot;http://en.wikipedia.org/wiki/Covariance#Properties&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Covariance#Properties&lt;/a&gt;):&#xA;$$\operatorname{Var}\left[{c}\right] = \operatorname{Var}\left[\alpha{a}+\beta{b}\right] = \alpha^{2}\operatorname{Var}\left[{a}\right] + \beta^{2}\operatorname{Var}\left[{b}\right] + 2\alpha\beta\operatorname{Cov}\left[{a},{b}\right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also see this if you write down the quadratic form of your Variance-Covariance-Matrix of portfolios ${a}, {b}$ with the corresponding weighting vector that forms portfolio ${c}$. For that, note that&#xA;$$&#xA;{c} = \begin{pmatrix}&#xA;\alpha\\\beta&#xA;\end{pmatrix}^{T}&#xA;\begin{pmatrix}&#xA;{a}&#xA;\\&#xA;{b}&#xA;\end{pmatrix}&#xA;= \alpha{a}+\beta{b}&#xA;$$&#xA;holds. Therefore you can write&#xA;$$\operatorname{Var}\left[{c}\right] &#xA;=&#xA;\operatorname{Var}\left[&#xA;\begin{pmatrix}&#xA;\alpha\\\beta&#xA;\end{pmatrix}^{T}&#xA;\begin{pmatrix}&#xA;{a}&#xA;\\&#xA;{b}&#xA;\end{pmatrix}\right]&#xA;\overset{(1)}{=}&#xA;\begin{pmatrix}&#xA;\alpha\\\beta&#xA;\end{pmatrix}^{T}\operatorname{Var}\left[&#xA;\begin{pmatrix}&#xA;{a}&#xA;\\&#xA;{b}&#xA;\end{pmatrix}\right]&#xA;\begin{pmatrix}&#xA;\alpha\\\beta&#xA;\end{pmatrix}$$ $$&#xA;=&#xA;\begin{pmatrix}&#xA;\alpha\\\beta&#xA;\end{pmatrix}^{T}&#xA;\begin{pmatrix}&#xA;\operatorname{Var}\left[{a}\right] &amp;amp; \operatorname{Cov}\left[{a},{b}\right]&#xA;\\&#xA;\operatorname{Cov}\left[{a},{b}\right] &amp;amp; \operatorname{Var}\left[{b}\right]&#xA;\end{pmatrix}&#xA;\begin{pmatrix}&#xA;\alpha\\\beta&#xA;\end{pmatrix}$$ $$&#xA;= &#xA;\alpha^{2}\operatorname{Var}\left[{a}\right] + \beta^{2}\operatorname{Var}\left[{b}\right] + 2\alpha\beta\operatorname{Cov}\left[{a},{b}\right]\textrm{,}&#xA;$$&#xA;with (1) the matrix-wise principle on how to get a constant out of the Variance, see (&lt;a href=&quot;http://en.wikipedia.org/wiki/Covariance#A_more_general_identity_for_covariance_matrices&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Covariance#A_more_general_identity_for_covariance_matrices&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are interested in&#xA;$$&#xA;\operatorname{Cov}\left[{a},{c}\right]&#xA;= \operatorname{Cov}\left[{a},\alpha{a}+\beta{b}\right]$$ $$&#xA;\overset{(2)}{=}  \alpha\operatorname{Cov}\left[a,a\right]+\beta\operatorname{Cov}\left[a,b\right]&#xA;=&#xA;\alpha\operatorname{Var}\left[a\right]+\beta\operatorname{Cov}\left[a,b\right]&#xA;\textrm{.}&#xA;$$&#xA;The equality (2) follows from the definition of Covariance and some manipulations:&#xA;$$&#xA;\operatorname{Cov}\left[{a},{c}\right]&#xA;=&#xA;\operatorname{Cov}\left[{a},\alpha{a}+\beta{b}\right]$$&#xA;$$=&#xA;\mathbb{E}\left[\left(a-\mathbb{E}\left[a\right]\right)\left(\alpha{a}+\beta{b} - \mathbb{E}\left[\alpha{a}+\beta{b}\right]\right)\right]$$ $$&#xA;=&#xA;\mathbb{E}\left[\left(\alpha{a^{2}}-2\alpha{a}\mathbb{E}\left[a\right]+\alpha\mathbb{E}\left[a\right]^{2}\right) + \left(\beta{ab}-\beta{a\mathbb{E}\left[b\right]}-\beta{b}\mathbb{E}\left[a\right]+\beta\mathbb{E}\left[a\right]\mathbb{E}\left[b\right]\right)\right]$$&#xA;$$&#xA;=&#xA;\mathbb{E}\left[\alpha\left(a-\mathbb{E}\left[a\right]\right)^{2} + \beta\left(a-\mathbb{E}\left[a\right]\right)\left(b-\mathbb{E}\left[b\right]\right)\right]&#xA;=&#xA;\alpha\operatorname{Var}\left[{a}\right] + \beta\operatorname{Cov}\left[a,b\right]&#xA;$$&#xA;You can get the Correlation from the Covariance in the obvious way, devide the Covariance by the square root of the product of the Variances of both random variables. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope I didn't miscalculate and that is the answer you were looking for. &lt;/p&gt;&#xA;" OwnerUserId="6980" LastEditorUserId="7867" LastEditDate="2014-05-13T05:25:30.897" LastActivityDate="2014-05-13T05:25:30.897" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11209" PostTypeId="1" AcceptedAnswerId="11215" CreationDate="2014-05-08T18:54:11.197" Score="4" ViewCount="208" Body="&lt;p&gt;I read the following statement in the book python for data analysis, chapter 11, and I was wondering if someone could give me intuition about why regression has this effect? The purpose of the exercise was to compare a basic correlation between microsoft and apple versus a dynamic regression. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;One issue with correlation between two assets is that it does not capture differences in&#xA;volatility. Least-squares regression provides another means for modeling the dynamic&#xA;relationship between a variable and one or more other predictor variables.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7935" LastActivityDate="2014-08-19T02:53:50.457" Title="Why does regression capture differences in volatility?" Tags="&lt;equities&gt;&lt;python&gt;&lt;calculation&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11212" PostTypeId="1" CreationDate="2014-05-09T03:27:42.800" Score="0" ViewCount="667" Body="&lt;p&gt;Assume an individual is a buyer, i.e., long, of one Forward Rate Agreement and a seller, i.e., short, of one Eurodollar Futures contract. Does the collective portfolio have positive or negative convexity? Why?&lt;/p&gt;&#xA;" OwnerUserId="8022" LastActivityDate="2014-05-09T03:27:42.800" Title="Convexity of Portfolio Containing Eurodollar Future and Forward Rate Agreement" Tags="&lt;convexity&gt;&lt;eurodollars&gt;&lt;forward-rate&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11213" PostTypeId="2" ParentId="11165" CreationDate="2014-05-09T09:03:34.600" Score="1" Body="&lt;p&gt;Your math is right. If we normalize $W_{0}=1$, we have a return of&#xA;$$&#xA;r\left(P\right) = P-1&#xA;$$&#xA;and a price-elasticity of return of&#xA;$$&#xA;\epsilon\left(P\right) = \frac{P}{P-1}&#xA;\mathrm{.}&#xA;$$&#xA;If your price $P$ goes from its initial value $W_{0}=1$ to $P=2$, you make a return of $r\left(2\right) = 1$. If your investment has a final price of $P=3$, your return would be $r\left(3\right) = 2$. So when you go from a price of $P=2$ to a price of $P=3$, your return goes from $r\left(2\right) = 1$ to $r\left(3\right) = 2$. &#xA;For a price of $P=4$ your return wold be $r\left(4\right) = 3$. So if you go from a price $P=3$ to a price of $P=4$ (note that the price rises again $1$ unit), your return only increases from $r\left(3\right) = 2$ to $r\left(4\right) = 3$. &#xA;The first time your return doubled, the second time you only made $50\%$ more return. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is what the equation says. You look at relative the &lt;strong&gt;local&lt;/strong&gt; change of return due to price changes (the derivative). This is always constant. But it makes a huge difference for your gain in return if your price goes from $1$ to $2$ or if it goes, say, from $101$ to $101$.&lt;/p&gt;&#xA;" OwnerUserId="6980" LastActivityDate="2014-05-09T09:03:34.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11214" PostTypeId="2" ParentId="11189" CreationDate="2014-05-09T09:12:56.270" Score="0" Body="&lt;p&gt;I haveen't read that book, but I'll try to answer anyway from a pure statistics point of view. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You assume a model and some random variables or a stochastic process which models the part of reality you are interested in, i.e. the value of a stock or its return in time. If the model is true this stochastic process is assumed to have generated the data you can observe and the task at hand is to estimate certain proberties of the stochastic process. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume with standard derivation Sinclair means the empirical standard derivation, which is an &lt;strong&gt;estimator&lt;/strong&gt; of the theoretical standard derivation, i.e. the &lt;strong&gt;true volatility&lt;/strong&gt; in the model. This is along the same lines as the &lt;em&gt;mean&lt;/em&gt; of a sample&#xA;$$&#xA;\frac{1}{n}\sum_{i=1}^{n} x_{i}&#xA;$$&#xA;is an &lt;em&gt;estimator&lt;/em&gt; for the &lt;em&gt;expected value&lt;/em&gt; of the theoretical quantity that generated your sample, according to your model. &lt;/p&gt;&#xA;" OwnerUserId="6980" LastActivityDate="2014-05-09T09:12:56.270" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11215" PostTypeId="2" ParentId="11209" CreationDate="2014-05-09T09:33:43.860" Score="6" Body="&lt;p&gt;I guess what they are trying to say here is that, assume you have two time series $X$ and $Y$ which are exactly the same i.e. $X=Y$, the correlation is :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\rho_{X,Y}= \frac{Cov(X,Y)}{\sigma_X \sigma_Y}\overset{X=Y}{=}\frac{Cov(X,X)}{\sigma_X \sigma_X}=\frac{\sigma_X^2}{\sigma_X^2}=1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now assume a time series $Z=2 \cdot X$, you have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma_Z=2 \sigma_X$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Cov(X,Z)=Cov(X,2X)=2 Cov(X,X) = 2 \sigma_X^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\rho_{X,Z}= \frac{Cov(X,Z)}{\sigma_X \sigma_Z}=\frac{2 \sigma_X^2}{2\sigma_X^2}=1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fact that $Z$ is twice as volatile as $Y$ &lt;em&gt;does not appear&lt;/em&gt; in the correlation measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In regression you would fit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Y_t=\alpha_Y + \beta_Y X_t + \epsilon_t ~ \text{and} ~ Z_t=\alpha_Z + \beta_Z X_t + \epsilon_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your regression would give you $\alpha_Y=\alpha_Z=0$, $\beta_Y=1$ and $\beta_Z=2$, which shows that $Z$ and $Y$ have &lt;em&gt;a different relationship&lt;/em&gt; with $X$.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="11835" LastEditDate="2014-08-19T02:53:50.457" LastActivityDate="2014-08-19T02:53:50.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11217" PostTypeId="1" CreationDate="2014-05-09T09:55:40.717" Score="11" ViewCount="3531" Body="&lt;p&gt;I ask because those functions are on the TI BA II Plus financial calculator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I saw some interesting answers but I don't think a calculator would be practical in their environment.&lt;/p&gt;&#xA;" OwnerUserId="6819" LastEditorUserId="6819" LastEditDate="2019-10-24T12:30:39.837" LastActivityDate="2019-10-24T12:47:42.413" Title="Are the sin, cos, tan functions used in some financial calculations?" Tags="&lt;modeling&gt;" AnswerCount="7" CommentCount="5" FavoriteCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="11218" PostTypeId="2" ParentId="11190" CreationDate="2014-05-09T10:46:40.587" Score="1" Body="&lt;p&gt;According to the literature in market microstructure, the price pressure is defined as &quot;the change in price when large quantities of &#xA;a security are traded&quot;. &lt;a href=&quot;http://newyorkfed.org/research/conference/2010/cb/Ambrose_Cai_Helwege1.pdf&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt;&#xA;you can find an example of how price pressure influences the bond market and in which the authors provide a complete definition of the phaenomenon and the relative problem of the information effects. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other suggestions and help will be grateful. &lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-04-22T15:58:25.420" LastActivityDate="2015-04-22T15:58:25.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11219" PostTypeId="2" ParentId="11217" CreationDate="2014-05-09T11:00:21.703" Score="7" Body="&lt;p&gt;One can use the Karhunen–Loève expansion to approximate a trajectory of a Wiener Process, which can be used to model the evolvement of returns in time. (&lt;a href=&quot;http://en.wikipedia.org/wiki/Karhunen%E2%80%93Lo%C3%A8ve_theorem#The_Wiener_process&quot;&gt;http://en.wikipedia.org/wiki/Karhunen%E2%80%93Lo%C3%A8ve_theorem#The_Wiener_process&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Though the Karhunen–Loève expansion has theoretical advantages to other variants to generate a trajectory of a Wiener Process, many users will use different methods because on computers evaluation of trignometric is very expensive in terms of calculation time. &lt;/p&gt;&#xA;" OwnerUserId="6980" LastActivityDate="2014-05-09T11:00:21.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11220" PostTypeId="2" ParentId="9623" CreationDate="2014-05-09T11:36:09.093" Score="1" Body="&lt;p&gt;From LEP's answer:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;there will be p−t zero eigenvalues whenever p&gt;t and one zero eigenvalue whenever p=t.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is the main reason, your true covariance matrix will have p-t eigenvalues exactly 0. With computer arithmetic you'll have lots of eigenvalues around machine precision, usually about 10^-15. So there should not only be around 5K-6K zero eigenvalues, but about 9K. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You also might want to have a look at &lt;a href=&quot;http://eprints.ma.man.ac.uk/232/01/covered/MIMS_ep2006_70.pdf&quot; rel=&quot;nofollow&quot;&gt;Computing the nearest correlation matrix—a problem from finance by Nicholas J. Higham&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="6980" LastActivityDate="2014-05-09T11:36:09.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11221" PostTypeId="2" ParentId="11205" CreationDate="2014-05-09T12:52:00.493" Score="1" Body="&lt;p&gt;The line of thinking is theoretically correct and it is right if you assume that: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;no other event happened during the trading day or in recent periods (if, for instance, one has a stock split recently, you will take into account also that and so on for all corporate events);&lt;/li&gt;&#xA;&lt;li&gt;The dividend is a cash-dividend (in the case you will have a stock-dividend things are slightly different);&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;As regards the first question, since you cannot assume those hypothesis in the real world, you have to consider adjusted prices, that, however, are provided by yahoo_finance (the last column in the historical data table).&#xA;It depends on the kind of survey you have to do, but, generally, it is better to conduct an empirical analysis by using adjusted-prices because of the reasons above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the second one, you are in wrong because in that way you're adjusting prices only for cash-dividends, overlooking the other corporate finance events.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also &lt;a href=&quot;https://quant.stackexchange.com/questions/4165/why-does-the-adjusted-closing-price-take-into-account-dividends?rq=1&quot;&gt;Here&lt;/a&gt; you can find an answer given on this site that you could find pretty useful.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2014-05-09T14:53:26.103" LastActivityDate="2014-05-09T14:53:26.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11222" PostTypeId="2" ParentId="11217" CreationDate="2014-05-09T14:39:59.250" Score="5" Body="&lt;p&gt;You can use $\sin$ or $\cos$ to model seasonality. If all you have is a calculator it might be the most practical way.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2014-05-09T14:39:59.250" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11223" PostTypeId="2" ParentId="11175" CreationDate="2014-05-09T15:08:14.007" Score="1" Body="&lt;p&gt;Unfortunately, tick data usually comes with a price.  Cheap tick data will generally be filtered (say we have 100 orders hitting the bid like a machine gun, filtered data will show a small percentage of those orders), and unfiltered data can run a pretty penny, so it really depends on how dependent your strategy is on filtered/unfiltered data.  The market standard (as far as my understanding) for tick data is going to be IQFeed.  They are directly tied into the exchanges, and provide unfiltered data.  If you have a futures account, you can have them waive an exchange fee (which is generally $75 a month).  It's currently who I use for futures/equities data.  If filtered data doesn't bother you, I've heard that Interactive Brokers offers an API which allows you to grab historical data.&lt;/p&gt;&#xA;" OwnerUserId="7762" LastActivityDate="2014-05-09T15:08:14.007" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11224" PostTypeId="1" CreationDate="2014-05-09T16:39:02.470" Score="7" ViewCount="2341" Body="&lt;p&gt;I'd like to start automating my trading strategies. I'm not looking for a fast and easy solution, therefore the programming language is not important for me, I am ready to spend an extra year to master the required technologies if needed. I'm very good with R, VBA and SQL, used Python a bit, but don't know any C++/C#/Java.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for a recommendation on what framework and related programming language to learn. I can't afford any expensive solutions, a free open-source framework would be ideal. I trade futures and stocks with IB and my trading strategies mostly use a combination of simple technical rules. However, sometimes I really need to get some extra data to generate an entry or exit signal, e.g. check if today's date is present in some list of dates in the database, or generate a custom breadth indicator (like at the moment some condition is true for at least X% of stocks from certain list of stocks). I can fairly easily backtest such strategies in R with my own backtester, but I have no idea if ready frameworks for automated trading allow that. Having read some articles and forum posts I realized that I probably need CEP to program such rules. If so, then as far as I know I'm limited to AlgoTrader among free solutions. However, I've read opinions that AlgoTrader is extremely complicated to understand even with a solid background in Java, which I lack at the moment, and that it lacks proper documentation. Is there anyone, who uses AlgoTrader, in here? Are there any alternatives that allow to program algos similar to what I described above?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In theory I can send trading signals from R, but I'd like to get more reliability, speed (I don't need HFT, but recalculating custom breadth indicators for several systems takes time) and some ready framework that can be used to both backtest and trade using the same code to generate signals. In addition, there are probably other good reasons that I'm not aware of why hardly anyone uses R for automated trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any recommendations?&lt;/p&gt;&#xA;" OwnerUserId="5555" LastActivityDate="2018-12-01T15:20:25.963" Title="Please advise on the choice of an automated trading framework" Tags="&lt;automated-trading&gt;&lt;algorithmic-trading&gt;&lt;cep&gt;" AnswerCount="5" CommentCount="8" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="11225" PostTypeId="1" CreationDate="2014-05-09T18:02:05.787" Score="1" ViewCount="351" Body="&lt;p&gt;&lt;br/&gt;&#xA;I'm analyzing two financial time series with Johansen method. A high Correlation coefficient using the Pearson method will help me to detect spurious cointegration models to avoid?&#xA;&lt;br/&gt;&lt;br/&gt; &#xA;If this is not the case, which is the best method would provide clue about it?&#xA;&lt;br/&gt;&lt;br/&gt;&#xA;Thank you &lt;/p&gt;&#xA;" OwnerUserId="7357" LastActivityDate="2014-08-05T10:57:33.073" Title="High correlation will help detect spurious regression over cointegration?" Tags="&lt;time-series&gt;&lt;correlation&gt;&lt;cointegration&gt;&lt;econometrics&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11226" PostTypeId="2" ParentId="10506" CreationDate="2014-05-09T18:35:31.173" Score="0" Body="&lt;p&gt;While linked to swaps, these are listed futures contracts like any other and are traded in open markets.  They are not themselves swap contracts.  Therefore there is no 'issuer' exactly, nor a counterparty, at least not the same sense as swaps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See details &lt;a href=&quot;http://www.cmegroup.com/trading/interest-rates/files/dsf-overview.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;http://www.cmegroup.com/trading/interest-rates/deliverable-irs-futures-overview.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7891" LastActivityDate="2014-05-09T18:35:31.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11227" PostTypeId="2" ParentId="11224" CreationDate="2014-05-09T20:24:37.580" Score="6" Body="&lt;p&gt;To be honest you're not likely to get a very satisfying answer to your question.  Not because its a bad question, but because &quot;regular people&quot; can't just go hooking their home grown trading systems up to a live market. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I'd like to start automating my trading strategies.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;First off you'll need a system that can interface with your broker.  If you're not a fund then you won't be able to certify your own fix engine for trading, which means you're path of least resistance is probably to interface with something like IB.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In that case your best bet is to read up on the Interactive Brokers api &lt;a href=&quot;https://www.interactivebrokers.com/en/?f=%2Fen%2Fsoftware%2Fibapi.php%3Fib_entity%3Dllc&quot; rel=&quot;noreferrer&quot;&gt;https://www.interactivebrokers.com/en/?f=%2Fen%2Fsoftware%2Fibapi.php%3Fib_entity%3Dllc&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="743" LastActivityDate="2014-05-09T20:24:37.580" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11228" PostTypeId="2" ParentId="10114" CreationDate="2014-05-09T21:59:14.960" Score="2" Body="&lt;p&gt;From the format of your question, I imagine it comes from some exercises set.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so, I would be curious to see it, because it looks really weird to me.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Calculate the price the investor is willing to pay for the option assuming they want to make 3% expected return over the period.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That doesn't make sense. Indeed, what you are trying to price is a European call option. Technically, its value can be calculated using a hedging argument. The fact that the investor wants to make 3% is irrelevant. The price is fair according to the underlying model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To compute the price, you cannot use &lt;strong&gt;real-world&lt;/strong&gt; probabilities, because you would need to adjust the expectation of the future according to the investor's utility function which depends on his risk aversion. The way to go is to use &lt;strong&gt;risk-neutral&lt;/strong&gt; probability measure, but I don't think you can do this with the information you provide us with.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, please have a look at the source of your question and see if they do specify that the probabilities are risk-neutral. Please specify where that comes from.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2014-05-10T10:34:30.523" LastActivityDate="2014-05-10T10:34:30.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11229" PostTypeId="1" CreationDate="2014-05-09T23:17:17.170" Score="4" ViewCount="2910" Body="&lt;p&gt;I am trying to understand bond-valuation and construction of yield curve. I don't have any exposure to bootstrapping or what-so-ever as of now. So it's appreciated to have an example but not too technical (not too advanced mathematical terms - but straight forward).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;a href=&quot;http://en.wikipedia.org/wiki/Yield_curve#Construction_of_the_full_yield_curve_from_market_data&quot; rel=&quot;nofollow&quot;&gt;Wiki shows that yield curve has three types of rates involved.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have seen online that some uses interpolation (non-/linear) to construct the full yield curve with tenors. And for lending and borrowing, most institutions take yield curve as the benchmark.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Why is the curve constructed using cash, future and swap rates?&lt;/li&gt;&#xA;&lt;li&gt;What are these future rates? Bond futures or interst rate futures?&lt;/li&gt;&#xA;&lt;li&gt;Cash rates plotted in the curve are directly used for lending/borrowing within institutions. What about the the futures rates and swap rates in the yield curve? Are these taken as it is or just as a reference to derive &quot;in-house&quot; rates?&lt;/li&gt;&#xA;&lt;li&gt;Are there risks lenders/borrowers facing by taking rates plotted in the yield curve as it is?&lt;/li&gt;&#xA;&lt;li&gt;Are there functions availabile in C# to interpolate and build full yield curve using &lt;a href=&quot;http://www.treasury.gov/resource-center/data-chart-center/interest-rates/Pages/TextView.aspx?data=yield&quot; rel=&quot;nofollow&quot;&gt;USD-daily tresury yield curve&lt;/a&gt;?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3178" LastActivityDate="2014-09-16T07:53:49.243" Title="Why is &quot;full&quot; Yield Curve (term structure of interest rates) 3 component based?" Tags="&lt;interest-rates&gt;&lt;yield-curve&gt;&lt;swaps&gt;&lt;yield-futures&gt;&lt;bond-futures&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11230" PostTypeId="2" ParentId="11224" CreationDate="2014-05-10T03:33:50.130" Score="3" Body="&lt;p&gt;There's some pretty basic frameworks for IB.  One that's pretty simple to modify is &lt;a href=&quot;http://sourceforge.net/projects/jsystemtrader/&quot; rel=&quot;nofollow&quot;&gt;http://sourceforge.net/projects/jsystemtrader/&lt;/a&gt; .  I haven't looked in a while but it uses only market orders.  The development has gone on to a version that uses market depth.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's also things like Ninja Trader but paid per month.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's what I do and I just use java with IB.  I have a feeling you're going to write so much code that the framework isn't going to be much work in the end.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you said R and Python I'll just add&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://cran.r-project.org/web/packages/IBrokers/index.html&quot; rel=&quot;nofollow&quot;&gt;http://cran.r-project.org/web/packages/IBrokers/index.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://code.google.com/p/ibpy/&quot; rel=&quot;nofollow&quot;&gt;https://code.google.com/p/ibpy/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I haven't used either and don't know how well they work.  I'm pretty sure the R package can download historical data.  One thing to remember with un-updated frameworks is the API can change a bit and no longer work without some tweaks.&lt;/p&gt;&#xA;" OwnerUserId="5872" LastEditorUserId="5872" LastEditDate="2014-05-10T16:12:23.883" LastActivityDate="2014-05-10T16:12:23.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11231" PostTypeId="1" AcceptedAnswerId="11233" CreationDate="2014-05-10T12:57:05.880" Score="3" ViewCount="362" Body="&lt;p&gt;For a bond with market price $P_t$ and fixed payments $c_n$, I'm told the yield to maturity is given by the solution $Y$ to the equation &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P_t=\sum_{n=1}^N c_n e^{-Y(t_n-t)}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Firstly, I'm not great a rearranging such equations to not sure how to find an expression for $Y$ from here. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also could someone explain what each $t_n$ is? As in, in the equation what's the difference between the fixed $t$ and the $t_n$?&lt;/p&gt;&#xA;" OwnerUserId="7375" LastActivityDate="2014-05-10T14:10:59.107" Title="Yield to Maturity" Tags="&lt;yield-curve&gt;&lt;bond&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11233" PostTypeId="2" ParentId="11231" CreationDate="2014-05-10T14:04:05.083" Score="0" Body="&lt;p&gt;I think $t_n$ is the time the nth coupon is paid and $t_n$-t is the time difference between the time the coupon is paid at the time the bond is issued.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if a bond is issued on May 10 and coupons are paid on June 10, July 10 and August 10, then the $t_n$ - t's are 1/12, 2/12 and 3/12.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Y cannot be solved directly. It's like Internal Rate of Return. Use Goal Seek in Excel.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://ph.answers.yahoo.com/question/index?qid=20081123061034AA419b4&quot; rel=&quot;nofollow&quot;&gt;https://ph.answers.yahoo.com/question/index?qid=20081123061034AA419b4&lt;/a&gt;&#xA;YTM: &lt;a href=&quot;http://www.youtube.com/watch?v=NV0S8pKvje8&quot; rel=&quot;nofollow&quot;&gt;http://www.youtube.com/watch?v=NV0S8pKvje8&lt;/a&gt;&#xA;Goal Seek: &lt;a href=&quot;http://www.youtube.com/watch?v=7QIBvMPC9vM&quot; rel=&quot;nofollow&quot;&gt;http://www.youtube.com/watch?v=7QIBvMPC9vM&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="7788" LastEditDate="2014-05-10T14:10:59.107" LastActivityDate="2014-05-10T14:10:59.107" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11234" PostTypeId="1" AcceptedAnswerId="11236" CreationDate="2014-05-10T14:53:07.767" Score="2" ViewCount="3190" Body="&lt;p&gt;My example is saving for college:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;assume a start of 0 balance&lt;/li&gt;&#xA;&lt;li&gt;deposits of 200 made monthly, every year they increase by (g) 2% to account for salary increases, first deposit made at the &lt;em&gt;end&lt;/em&gt; of the first month&lt;/li&gt;&#xA;&lt;li&gt;Interest Rate (r) is constant at 8% (effective rate)&lt;/li&gt;&#xA;&lt;li&gt;Goes for (n=15) years&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What is the future value?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even though I can convert the yearly rate into a compounded monthly rate to match the yearly rate, I can't use the &quot;future value of a growing annuity&quot; formula, that assumes timing of growth and payment are the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is acceptable to make it a two or three steps (like use equation 1 to solve for a new value for payment to plug that into equation 2), I am just trying to avoid making calculations for each and every year as I'm doing now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;n(1) = 2486&lt;br&gt;&#xA;n(2) = 5222.23&lt;br&gt;&#xA;n(15)= 75693&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;br&gt;&#xA;I found my own answer as well below that combines well known formulas to get to the same answer (and I presume, with substitution, would be equivalent to the accepted answer)&lt;/p&gt;&#xA;" OwnerUserId="8031" LastEditorUserId="16595" LastEditDate="2018-10-10T03:34:37.993" LastActivityDate="2018-10-10T03:34:37.993" Title="Is there a formula for future value of a growing annuity with yearly payment growth and monthly payments?" Tags="&lt;mathematics&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11236" PostTypeId="2" ParentId="11234" CreationDate="2014-05-10T17:01:15.447" Score="1" Body="&lt;p&gt;You can calculate it with the formula below, which is produced from a double sum.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;P. S. The initial examples are for an annuity due (savings type annuity).&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Future value = (r*(-1 + r^y)*(-b^(1 + a) + r^((1 + a)*y))*z)/((-1 + r)*(-b + r^y)) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;r = 1 + monthly rate = 1.08^(1/12) = 1.00643&#xA;y = months per year = 12&#xA;a = years - 1 = 14&#xA;b = deposit increase rate + 1 = 1.02&#xA;z = initial deposit amount = 200&#xA;&#xA;(r*(-1 + r^y)*(-b^(1 + a) + r^((1 + a)*y))*z)/((-1 + r)*(-b + r^y)) = 76180.4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Mathematica was used to produce the formula from the double sum:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/JNiNJ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The double sum is produced from the workings below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/G2gY8.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Edit&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To illustrate the robustness of the formula here is another example with different period parameters: a &lt;em&gt;twice-yearly&lt;/em&gt; deposit of 200 for &lt;em&gt;three&lt;/em&gt; years, again incrementing annually by 2%, with 8% interest rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Running the calculation in four forms produces the same result.  This proves the formula's robustness.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;r = 1 + six-monthly rate = 1.08^(1/2) = 1.03923&#xA;y = periods per year = 2&#xA;a = years - 1 = 2&#xA;b = deposit increase rate + 1 = 1.02&#xA;z = initial deposit amount = 200&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/r8lKg.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(r*(-1 + r^y)*(-b^(1 + a) + r^((1 + a)*y))*z)/((-1 + r)*(-b + r^y)) = 1402.25&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;2nd Edit&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recalculation for ordinary annuity (loan type), rather than annuity due (savings). - ref. &lt;a href=&quot;http://www.investopedia.com/articles/03/101503.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;Calculating The Present And Future Value Of Annuities&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/RBVdq.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;((-1 + r^y)*(-b^(1 + a) + r^((1 + a)*y))*z)/((-1 + r)*(-b + r^y)) = 1349.32&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7178" LastEditorUserId="7178" LastEditDate="2014-05-11T00:29:06.637" LastActivityDate="2014-05-11T00:29:06.637" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="11237" PostTypeId="1" AcceptedAnswerId="11241" CreationDate="2014-05-10T21:20:38.810" Score="2" ViewCount="728" Body="&lt;p&gt;My question is that when we have autocorrelation in daily volatilities can we scale daily volatility to annual basis using square-root-of-time rule?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does it breach the main assumption of the rule that says volatility is constant across period?&#xA;Thank you&lt;/p&gt;&#xA;" OwnerUserId="8032" LastEditorUserId="2587" LastEditDate="2014-05-12T08:55:19.737" LastActivityDate="2014-05-12T11:57:31.023" Title="Square-root-of-time and autocorrelation" Tags="&lt;volatility&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11239" PostTypeId="2" ParentId="11217" CreationDate="2014-05-10T23:26:42.653" Score="8" Body="&lt;p&gt;Fourier methods use sine and cosine functions, and are used in calculating option prices, VaR, time series analysis etc. It is an alternative process for doing many things in finance. Some links &lt;a href=&quot;https://quant.stackexchange.com/questions/7377/applications-of-fourier-theory-in-trading&quot;&gt;Fourier Methods in trading on StackExchange&lt;/a&gt; and &lt;a href=&quot;http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0CCgQFjAA&amp;amp;url=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FFourier_analysis&amp;amp;ei=6LRuU77QKubLsAT_5oLQDQ&amp;amp;usg=AFQjCNFdRUAJbOB7VH2q-D0zKs8w4ITb8g&amp;amp;bvm=bv.66111022,d.cWc&quot; rel=&quot;nofollow noreferrer&quot;&gt;Wiki&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2014-05-10T23:26:42.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11240" PostTypeId="2" ParentId="9623" CreationDate="2014-05-11T01:13:39.497" Score="2" Body="&lt;p&gt;Your issue demonstrated in R with interesting solution &lt;a href=&quot;https://quant.stackexchange.com/questions/1020/equity-risk-model-using-pca?rq=1&quot;&gt;Equity Risk Model Using PCA&lt;/a&gt;. Another useful link in Matlab by Nick Higham himself &lt;a href=&quot;http://nickhigham.wordpress.com/2013/02/13/the-nearest-correlation-matrix/comment-page-1/&quot; rel=&quot;nofollow noreferrer&quot;&gt;NCM implementation by Nick Higham&lt;/a&gt; written for Matlab. Another good discussion on shrinkage and other aspects of &lt;a href=&quot;https://quant.stackexchange.com/questions/2529/how-do-i-adjust-a-correlation-matrix-whose-elements-are-generated-from-different/2580#2580&quot;&gt;Correlation Adjustment&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2014-05-11T02:37:58.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11241" PostTypeId="2" ParentId="11237" CreationDate="2014-05-11T05:26:23.857" Score="1" Body="&lt;p&gt;If the time series has autocorrelation then you are right then square root of time scaling is not applicable. Normally autocorrelation is removed using GARCH framework or ARMA/GARCH framework then you get heteroskedastic volatility by definition of GARCH.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the second part of the question, say, you are looking at Black-scholes model. For that the volatility is assumed to be constant and is the volatility at maturity. So, volatility used is the forecasted volatility at maturity. You can forecast that volatility using GARCH also, for the sake of fitting into the BS formula. &lt;/p&gt;&#xA;" OwnerUserId="7867" LastActivityDate="2014-05-11T05:26:23.857" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="11242" PostTypeId="1" CreationDate="2014-05-11T07:01:57.020" Score="1" ViewCount="98" Body="&lt;p&gt;I am building a service similar to the BullionVault where users can buy and sell bullion. They will be placing their Buy and Sell orders on the service. Matched orders will get executed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is this: &lt;br/&gt;&#xA;When there is a matching buy and sell order, where, the selling price is significantly lower than the buy orders buying price, how should the price be determined?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These are the Options I could think of : &lt;br/&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Either the buyers price is taken or the sellers price is taken and one of them gets the benefit.&lt;/li&gt;&#xA;&lt;li&gt;The difference between prices is split in half and both of them benefit.&lt;/li&gt;&#xA;&lt;li&gt;The exchange buys from the seller and sells to the buyer in real time, so the difference is picked up by the exchange.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As this is similar to how the stock markets work, I am trying to understand how this type of a trade is executed in those exchanges. &lt;/p&gt;&#xA;" OwnerUserId="8034" LastEditorUserId="2299" LastEditDate="2014-05-11T08:36:39.420" LastActivityDate="2019-11-24T09:33:19.080" Title="In a mis-matched trade who profits?" Tags="&lt;market-microstructure&gt;&lt;trading-systems&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11244" PostTypeId="2" ParentId="11242" CreationDate="2014-05-11T08:36:14.560" Score="4" Body="&lt;p&gt;Your question is generic about &lt;em&gt;matching engines&lt;/em&gt;, you should googlize about it or/and read a good book on market microstructure like &lt;a href=&quot;https://worldscientific.com/worldscibooks/10.1142/10739&quot; rel=&quot;nofollow noreferrer&quot;&gt;Market Microstructure in Practice&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short to answer to your question: the seller or the buyer came first in the market inserting a &lt;em&gt;limit order&lt;/em&gt;, providing liquidity to other participants. Then came the other side with a &lt;em&gt;marketable order&lt;/em&gt;, consuming liquidity. The outcome of a consumer matching a provider generates a &lt;em&gt;trade&lt;/em&gt; &lt;strong&gt;at the price of the limit order&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is about &lt;em&gt;who came first&lt;/em&gt; in the market. When you provide liquidity, you &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;set the price of a potential future trade,&lt;/li&gt;&#xA;&lt;li&gt;pay (the bid-ask spread) less than if you consume liquidity,&lt;/li&gt;&#xA;&lt;li&gt;disclose your interest,&lt;/li&gt;&#xA;&lt;li&gt;are exposed to adverse selection.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2019-11-24T09:33:19.080" LastActivityDate="2019-11-24T09:33:19.080" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="11245" PostTypeId="2" ParentId="11190" CreationDate="2014-05-11T09:16:07.783" Score="9" Body="&lt;p&gt;If you want to learn more about &lt;em&gt;price pressure&lt;/em&gt;, you should look after &lt;strong&gt;market impact of metaorders&lt;/strong&gt;, which is a more adequate term.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because of the &lt;em&gt;microstructure&lt;/em&gt; (i.e. the mix of orderbboks dynamics, trading rules, participants behaviours and habits, etc), the more you buy or sell, the more you influence the price an unfavorable way (for your trades). &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Just think about the orderbooks: you at least consume liquidity in them, pushing the price to an higher level (for a large buy order). This is &lt;strong&gt;instantaneous impact&lt;/strong&gt; of an isolated (large) trade.&lt;/li&gt;&#xA;&lt;li&gt;then liquidity providers come back in the book, slowly relaxing the price to its former level, except if new information changed the &quot;latent price&quot; (think about a fed annoucement: new information, new price).&lt;/li&gt;&#xA;&lt;li&gt;but if you come back with another trade, and another, etc. You prevent the price coming back, creating &lt;strong&gt;transient impact&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;li&gt;of course doing this, it can be consider that you provides (or exploit) information, thus the &quot;latent price&quot; slowly and simultaneously glides during the trading of your large &lt;em&gt;metaorder&lt;/em&gt;. &lt;/li&gt;&#xA;&lt;li&gt;At the end of this process you stop trading and can measure your &lt;strong&gt;temporary impact&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;li&gt;last but not least the price relaxes at a largest time scale, leading to a situation where only the &lt;strong&gt;permanent impact&lt;/strong&gt; of your trade remains in the market.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In &lt;a href=&quot;http://www.worldscientific.com/worldscibooks/10.1142/8967&quot; rel=&quot;nofollow noreferrer&quot;&gt;Market Microstructure in Practice&lt;/a&gt;, we provide a picture of empirical market impact measured on more than 300000 metaorders (during at least 4 hours each):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/bEnIn.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The y-axis is the price move (expressed in a generic unit).&#xA;Before 100%, note the concavity of the impact on price, &#xA;after 100% of the metaorder, you can see the relaxation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More recently a new paper provided more insight of price impact, splitting price moves between impact and investor's predictions (i.e. alpha): &lt;a href=&quot;http://arxiv.org/abs/1412.0217&quot; rel=&quot;nofollow noreferrer&quot;&gt;Market impacts and the life cycle of investors orders, by Emmanuel Bacry, Adrian Iuga, Matthieu Lasnier, Charles-Albert Lehalle&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2014-12-20T13:08:57.440" LastActivityDate="2014-12-20T13:08:57.440" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11246" PostTypeId="2" ParentId="11217" CreationDate="2014-05-11T09:16:26.927" Score="2" Body="&lt;p&gt;Solving some heat/diffusion equations under certain conditions &lt;a href=&quot;http://en.wikipedia.org/wiki/Heat_equation#Solving_the_heat_equation_using_Fourier_series&quot; rel=&quot;nofollow&quot;&gt;needs trigonometric functions&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Black-Scholes reduces to a &lt;a href=&quot;http://www.math.tamu.edu/~stecher/425/Sp12/blackScholesHeatEquation.pdf&quot; rel=&quot;nofollow&quot;&gt;heat&lt;/a&gt;/&lt;a href=&quot;http://www.francoiscoppex.com/blackscholes.pdf&quot; rel=&quot;nofollow&quot;&gt;diffusion&lt;/a&gt; equation by a change of variables.&lt;/p&gt;&#xA;" OwnerUserId="7788" LastActivityDate="2014-05-11T09:16:26.927" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11247" PostTypeId="1" AcceptedAnswerId="11249" CreationDate="2014-05-11T12:20:16.843" Score="3" ViewCount="250" Body="&lt;p&gt;To implement a portfolio generator, I require a set of suitable stocks. Ideally it would use the components of the MSCI World Index and use the index weights for the probability of picking a stock (the system uses heuristics to build a robust portfolio but must be provided with random - but weighted - seed stocks).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently, I am improvising by using traded volumes of the 6000 global stocks with the top market capitalization (and weighted by market cap). Since my EOD data source does not even contain market cap, I estimate that by using traded volume, too. Very shaky, e.g. a very volatile but rather negligible stock may end up in my set.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to get the MSCI World Index components and weights at moderate costs? Any other suitable index e.g. from the S&amp;amp;P DJ family would be fine, too.&lt;/p&gt;&#xA;" OwnerUserId="5628" LastActivityDate="2014-05-11T21:35:42.787" Title="Need weighted global stock index data (components / weights)" Tags="&lt;equities&gt;&lt;data&gt;&lt;index&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11249" PostTypeId="2" ParentId="11247" CreationDate="2014-05-11T21:35:42.787" Score="1" Body="&lt;p&gt;This information is available on subscription basis. I had found DJI weights on some site. However, DJI is price weighted, so its component weights change everyday. Using this requires adjustments to the results, hence, not advisable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Link for &lt;a href=&quot;https://www.google.com/fusiontables/DataSource?docid=1WPXwv58K-PLPFwo7uKjDkMnHzH1Lj_2tl1N47xQ&quot; rel=&quot;nofollow&quot;&gt;S%P Component weights&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="7867" LastActivityDate="2014-05-11T21:35:42.787" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11250" PostTypeId="1" AcceptedAnswerId="11259" CreationDate="2014-05-12T05:48:36.490" Score="4" ViewCount="1613" Body="&lt;p&gt;hi question is how to price a long dated option most computationally efficiently? With European, you use Black Shoals (yes assumption constant vol/rates...etc) but it's a simple algebraic formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With American, then what? If you use binomial tree, each step one day, with 20 days you'd have a million nodes...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do you efficiently for example price an American option with say 10 years tenure?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone implemented with variable &quot;Delta T&quot;? where prices relatively stable coarser &quot;Delta Time&quot; and where prices fluctuates more uses a finer &quot;Delta Time&quot;? Any good paper (Url please)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="8037" LastActivityDate="2014-05-13T14:17:03.173" Title="How to price long dated options most efficiently?" Tags="&lt;american-options&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11251" PostTypeId="1" AcceptedAnswerId="11256" CreationDate="2014-05-12T06:11:37.393" Score="0" ViewCount="287" Body="&lt;p&gt;I'm trying to estimate volatility following Shreve book, so I need observations of $f(t_j,t_j+\tau_k)$ and $f(t_j+\delta,t_j+\tau_k)$, where $t_J&amp;lt;t_{J-1}&amp;lt;\dots&amp;lt;0$ and $\tau_k$ are relative maturities and f is inst. forward rate($\delta$ is small that $t_j+\delta&amp;lt;t_{j+1}$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found this one: &lt;a href=&quot;http://tinyurl.com/83we3db&quot; rel=&quot;nofollow&quot;&gt;http://tinyurl.com/83we3db&lt;/a&gt;&#xA;It contains the inst. forward rate values, but are those data in the form of $f(t_j,t_j+\tau_k)$ or just $f(0,\tau_k)$ for every day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where can I find data for zero-coupon bonds to calculate these values?&#xA;Thanks for help in advance.&lt;/p&gt;&#xA;" OwnerUserId="7778" LastActivityDate="2014-05-12T15:28:12.213" Title="Where can I find historical data for volatility estimation?" Tags="&lt;volatility&gt;&lt;data&gt;&lt;estimation&gt;&lt;forward&gt;&lt;historical&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11252" PostTypeId="1" CreationDate="2014-05-12T08:50:38.390" Score="5" ViewCount="2446" Body="&lt;p&gt;I have heard that insurance companies make use of swaps and am just trying to get some clarity on that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An insurance company (assume life insurance) has a fixed obligation to pay in the distant future (policy holder's death), ie. a substantial fixed lumpsum. For that the company receives from the holder (monthly) premiums (are these fixed or floating?). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does it use swaps? If the premiums are fixed, then it could exchange those for floating with an interest-rate swap, but to what end? How exactly do they use swaps to manage their risk, and make a profit?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any help provided&lt;/p&gt;&#xA;" OwnerUserId="8038" LastActivityDate="2021-03-16T13:17:35.473" Title="How do insurance companies use interest-rate swaps?" Tags="&lt;swaps&gt;&lt;insurance&gt;" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11254" PostTypeId="1" CreationDate="2014-05-12T14:56:50.417" Score="1" ViewCount="371" Body="&lt;p&gt;Suppose I have a large enough set of prices of an asset, from which I can extract the following function: $f:T\to\mathcal{D}$, where $T$ is a fixed finite set of time intervals (say, 1 minute, 2 minutes, ..., $N$ minutes), and $\mathcal{D}$ is a set of finite discrete distributions of $\mathbb{R}$, such that $f(t)=D$ means the following: the (empirical) distribution of log-returns of a price in a time interval of length $t$ is $D$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I assume most distributions $D$ will appear unimodal, if I tend to see them as random samples of an unknown underlying continuous unimodal distribution, a Gaussian kernel distribution estimation might be useful to model $D$ without over-smoothing. So, let $g:T\to\mathcal{D}'$ be a function which given a time interval $t\in T$ returns the Gaussian KDE of $f(t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll now describe a method for pricing binary options (cash-or-nothing call): suppose the current price is $s$, the strike price is $k$, the time to maturity is $t$ (and assume $t\in T$), and assume there are no dividends. Let $\varphi$ be the cumulative distribution function of $g(t)$. Then, the price $c$ of the option is simply&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$c = \varphi\left(\ln\left(\frac{k}{s}\right)\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you think this is an appropriate pricing model? Do you see any expected pitfalls?&lt;/p&gt;&#xA;" OwnerUserId="2723" LastEditorUserId="2723" LastEditDate="2014-05-12T15:11:32.047" LastActivityDate="2014-05-12T15:11:32.047" Title="Pricing binary options with kernel density estimation" Tags="&lt;option-pricing&gt;&lt;binary-options&gt;&lt;kernel&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11255" PostTypeId="2" ParentId="11250" CreationDate="2014-05-12T15:04:52.073" Score="3" Body="&lt;p&gt;The standard Black Scholes pricing framework (and its required inputs) is not an optimal model for long-dated European options. Among others put delta is severely understated. Also, you want to keep in mind that implied volatility for long term options exhibits strong auto-correlation with time and reflects a geometric decay pattern. This should lead to the next question then whether the volatility process modeled should not be given much more importance for long-term options over short-term options. Keyword: Stochastic volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the modeling of rates that are input to your pricing model, it has been shown that stochastic rate processes do not really improve the model for long-dated options).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;American options of such long-dated nature can be conveniently modeled using monte-carlo simulations. The seminal paper by Longstaff and Schwartz show how this is done but there are a number other papers that target American option pricing through monte-carlo as well.  &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2014-05-12T15:04:52.073" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="11256" PostTypeId="2" ParentId="11251" CreationDate="2014-05-12T15:28:12.213" Score="1" Body="&lt;p&gt;The chart you linked to offers data for the &quot;instantaneous forward rate&quot; which are the rates you are looking for (f(tj,tj+τk)). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the construction of the zero-coupon yield curves (cited from the ECB website):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;The ECB estimates zero-coupon yield curves for the euro area and derives forward and par yield curves. A zero coupon bond is a bond that pays no coupon and is sold at a discount from its face value. The zero coupon curve represents the yield to maturity of hypothetical zero coupon bonds, since they are not directly observable in the market for a wide range of maturities. They must therefore be estimated from existing zero coupon bonds and fixed coupon bond prices or yields. The forward curve shows the short-term (instantaneous) interest rate for future periods implied in the yield curve. The par yield reflects hypothetical yields, namely the interest rates the bonds would have yielded had they been priced at par (i.e. at 100).&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Selection of bonds&#xA;The following criteria are applied when selecting bonds:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Only bonds issued in euro by euro area central government (European System of Accounts 1995: sector code 'S.1311') are selected.&lt;/li&gt;&#xA;&lt;li&gt;Only bonds with an outstanding amount of at least € 5 billion are included.&#xA;*Bonds with special features, including ones with specific institutional arrangements, are excluded.&lt;/li&gt;&#xA;&lt;li&gt;Only fixed coupon bonds with a finite maturity and zero coupon bonds are selected, including STRIPS . Variable coupon bonds, including inflation-linked bonds, and perpetual bonds, are not included.&lt;/li&gt;&#xA;&lt;li&gt;Only actively traded central government bonds with a maximum bid-ask spread per quote of three basis points are selected. The prices/yields are those at close of market on the reference day.&lt;/li&gt;&#xA;&lt;li&gt;In order to reflect a sufficient market depth, the residual maturity brackets have been fixed as ranging from three months up to and including 30 years of residual maturity.&lt;/li&gt;&#xA;&lt;li&gt;An outlier removal mechanism is applied to bonds that have passed the above selection criteria. Bonds are removed if their yields deviate by more than twice the standard deviation from the average yield in the same maturity bracket. Afterwards, the same procedure is repeated.&quot;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2014-05-12T15:28:12.213" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11257" PostTypeId="2" ParentId="11252" CreationDate="2014-05-12T15:31:25.650" Score="5" Body="&lt;p&gt;Swaps are used &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;for hedging purposes against directional rates movements (insurance companies hold loads of fixed income instruments and are thus hugely exposed to overall rate levels, depending on holding period and portfolio turnover) and &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;to insure against inflation (insurance firms receive fixed premium payments), &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;to target portfolio duration&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This is not an exhaustive list...&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2014-05-12T15:31:25.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11258" PostTypeId="2" ParentId="11252" CreationDate="2014-05-12T19:59:57.307" Score="2" Body="&lt;p&gt;In addition to what Matt Wolf pointed out, insurance companies use interest rate swaps to hedge certain liabilities arising out of their variable and indexed annuities business.  It's somewhat dated, but &lt;a href=&quot;http://www.mckinsey.com/~/media/mckinsey/dotcom/client_service/risk/working%20papers/10_responding_to_the_variable_annuity_crisis.ashx&quot; rel=&quot;nofollow&quot;&gt;this McKinsey report&lt;/a&gt; discusses those types of liabilities and how (if...) insurance companies hedge them.&lt;/p&gt;&#xA;" OwnerUserId="7891" LastActivityDate="2014-05-12T19:59:57.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11259" PostTypeId="2" ParentId="11250" CreationDate="2014-05-12T20:22:09.730" Score="3" Body="&lt;p&gt;Briefly:  instead of using trees you should be using &lt;a href=&quot;http://www.iam.uni-bonn.de/people/ankirchner/lectures/OP_WS1314/OP_chap_six.pdf&quot; rel=&quot;nofollow&quot;&gt;implicit&lt;/a&gt; (or Crank-Nicholson) PDE schemes.  They allow the timesteps to be much larger for a given equity price grid, and allow for boundary conditions to limit the range of equity prices to a realistic regime.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are (at least) two major markets that have a lot of long-dated american-exercise options:  bermudan interest-rate swaptions and convertible bonds.  Though I generally agree with Matt that there is good reason to use stochastic vol in these markets, they do not traditionally do so, leaving stochastic vol modeling mainly to exotics desks.  Bermudan swaptions, for example, are usually handled in multifactor interest rate models and don't provide a close analogue for your question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In convertible bonds, the embedded conversion option is exercised at the discretion of the bondholder and typically lasts for many years.  This is much closer to what you are asking about. You can therefore get some good inspiration by looking into that literature.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One trick that works (surprisingly?) well is to include random volatility without specifying an extra stochastic factor for it.  This is done by linking volatility to the stock price, as in &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=355308&quot; rel=&quot;nofollow&quot;&gt;Andersen's paper&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The SDE changes from&#xA;$$&#xA;\frac{dS}S = r(t) dt + \sigma(t) dW&#xA;$$&#xA;to&#xA;$$&#xA;\frac{dS}S = r(t) dt + \sigma(S,t) dW&#xA;$$&#xA;where we can take a variety of forms for $\sigma$, such as&#xA;$$&#xA; \sigma(S,t) ={ \sigma(t) \over S^{2}}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The discretization for an implicit PDE solver is then almost exactly as for Black-Scholes.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2014-05-13T14:17:03.173" LastActivityDate="2014-05-13T14:17:03.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11261" PostTypeId="1" CreationDate="2014-05-12T23:51:02.583" Score="11" ViewCount="21508" Body="&lt;p&gt;Delta of Future is exactly one I thought. This &lt;a href=&quot;https://www.riskprep.com/blog/92-the-delta-of-a-futures-contract&quot;&gt;post&lt;/a&gt; here, says otherwise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, quoting John Hull again:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f = \text{Value of Future contract} = S_{t=0} - K \exp(-rT)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $S$ it the spot price, $S_{t=0}$ is the spot price today, $r$ is the risk-free rate and $T$ is the time to maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta = \frac{df}{dS} = \frac{dS}{dS} - \frac{d[K \exp(-rT)]}{dS} = 1 - 0 = 1.0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As $K$ is constant, $T$ is constant, and the risk-free rate is not dependent on $S$. So I don't see why Delta of future contracts isn't exactly 1.0 (in contrary to argument from Riskprep.com article).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Futures are traded on Delta One desks after all.&lt;/p&gt;&#xA;" OwnerUserId="8037" LastEditorUserId="20795" LastEditDate="2019-09-08T11:15:25.740" LastActivityDate="2019-09-08T11:15:25.740" Title="Are Futures exactly Delta One?" Tags="&lt;futures&gt;&lt;delta&gt;" AnswerCount="5" CommentCount="5" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="11262" PostTypeId="2" ParentId="11261" CreationDate="2014-05-13T01:16:24.683" Score="10" Body="&lt;p&gt;Forward delta is 1 (defined as change in the value of the forward with respect to an instantaneous change in the price of the underlying, holding everything else constant). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However for a meaningful discussion of the differences in forward and futures pricing,  the forward price delta of forwards should be considered and it is exp(r(T-t)).Though the delta of the two are identical the value of a portfolio holding a forward vs futures contract will change over time and here is why: The difference arises from the fact that interest rates are not constant but random and forwards are OTC products that are settled at maturity while futures are settled daily. This subtle difference leads to different cash flows because money that is deposited into your account or that you need to cough up because of daily margin settlements can be invested/must be borrowed at prevailing interest rates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if the underlying discount rate process and underlying asset price process are positively correlated then if asset prices rise conversely interest rates will be lower and surpluses that are deposited into your account on a daily basis must be invested at lower rates. The opposite when asset prices fall, you need to deposit variation margin and need to borrow at higher rates. Hence, the futures contract must be priced lower than the forward in this example to make the futures contract equally attractive. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2014-05-13T06:57:48.733" LastActivityDate="2014-05-13T06:57:48.733" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="11263" PostTypeId="2" ParentId="11261" CreationDate="2014-05-13T01:49:08.490" Score="2" Body="&lt;p&gt;At time $t$ the price of a futures contract with maturity at time $T$ is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$&#xA;F(t,T) = S(t)e^{r(T-t)},&#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $S(t)$ is the spot price at time $t$ and $r$ is the interest rate. The delta of the futures contract is hence&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$&#xA;\frac{\partial F}{\partial S} = e^{r(T-t)}.&#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For $r&amp;gt;0$ we therefore have $\partial F/\partial S&amp;gt;1$ for $t&amp;lt;T$.&lt;/p&gt;&#xA;" OwnerUserId="5107" LastActivityDate="2014-05-13T01:49:08.490" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="11264" PostTypeId="1" CreationDate="2014-05-13T01:54:01.767" Score="10" ViewCount="24758" Body="&lt;p&gt;My bollinger band comes out like the below, which doesn't seem right. Any idea what is wrong with my code for calculating upper and lower bollinber bands?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I obtained my data from here&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;start, end = dt.datetime(1976, 1, 1), dt.datetime(2013, 12, 31)&#xA;sp = web.DataReader('^GSPC','yahoo', start, end) &#xA;here are my bollinger calculations&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;calculation for bollinger band&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ave = pd.stats.moments.rolling_mean(self[name], window) &#xA;std = pd.stats.moments.rolling_std(self[name], window)&#xA;self['upper'] = ave + (2 * std)&#xA;self['lower'] = ave - (2 * std)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/YzrMk.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="7935" LastEditorUserId="7396" LastEditDate="2014-05-13T06:59:49.157" LastActivityDate="2017-08-31T20:47:50.203" Title="Calculating Bollinger Band Correctly" Tags="&lt;python&gt;&lt;moving-average&gt;&lt;charts&gt;" AnswerCount="4" CommentCount="4" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="11266" PostTypeId="1" AcceptedAnswerId="11275" CreationDate="2014-05-13T04:06:20.263" Score="2" ViewCount="231" Body="&lt;p&gt;Pennachi's &quot;Asset Pricing&quot; chapter 4 derives:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{E[R_{i}-R_{f}]}{\sigma_{R_{i}}}=-\rho_{m_{01},R_{i}}\frac{\sigma_{m_{01}}}{E[m_{01}]}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, he states that the fact that $-1\leq \rho_{m_{01},R_{i}} \leq 1$ implies that:&#xA;$$&#xA;\left | \frac{E[R_{i}-R_{f}]}{\sigma_{R_{i}}} \right | \leq \frac{\sigma_{m_{01}}}{E[m_{01}]}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This last step is not clear to me, could you please explain how it follows? Wikipedia says that it follows from Cauchy–Schwarz inequality, but I cannot figure out how.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. There is a question about H-J bounds already, but there is an intuitive explanation, and I couldn't find an answer over there.&lt;/p&gt;&#xA;" OwnerUserId="8046" LastActivityDate="2014-05-13T15:01:37.190" Title="Hansen-Jagannathan bounds derivation: last step is not clear" Tags="&lt;sharpe-ratio&gt;&lt;stochastic-discount&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11267" PostTypeId="1" CreationDate="2014-05-13T07:07:09.453" Score="3" ViewCount="212" Body="&lt;p&gt;I use Rugarch for a long time in order to calibrate GARCH models on FX rates time series and perform simulations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to understand the ugarchroll method. However even if I can find plenty of examples and indications on how this method has to be used in the documentation as well as in the vignette, I still do not get what rolling estimation exactly is and what is its purpose.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you give me some explanations ? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="8047" LastActivityDate="2019-04-03T15:49:20.530" Title="rugarch and rolling estimation" Tags="&lt;r&gt;&lt;garch&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11269" PostTypeId="2" ParentId="11200" CreationDate="2014-05-13T08:55:38.710" Score="2" Body="&lt;p&gt;Let there be n stocks, 2 portfolio a and b. c is a combined portfolio of portfolio a and portfolio b. $\Sigma $ is variance-covariance matrix of the n assets. Weight vectors for portfolios a and b are $$w_{pa},w_{pb}\in\mathbb{R}^{n} ,$$ $$\left\|w_{pa}\right\|_{1}=\left\|w_{pb}\right\|_{1}=1  $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then&#xA;$$ Var(a)= w_{pa}' \Sigma w_{pa} $$&#xA;$$Var(b)= w_{pb}' \Sigma w_{pb}$$&#xA;$$Cov(a,b)=w_{pa}' \Sigma w_{pb} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us define combined portfolio c such that its weight vector $$w_{pc}\in\mathbb{R}^{n},$$ $$\left\|w_{pc}\right\|_{1}=1  $$ $$\alpha w_{pa}+\beta w_{pb}=:w_{pc}\in\mathbb{R}\space$$ with weights $\alpha+\beta=1$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then we have in matrix form:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{pmatrix}&#xA;Cov(a,c) &#xA; \\ Cov(b,c)&#xA;\end{pmatrix}=\begin{pmatrix}&#xA;Var(a) &amp;amp; Cov(a,b) \\ &#xA;Cov(a,b)) &amp;amp; Var(b) &#xA;\end{pmatrix} \begin{pmatrix}&#xA;\alpha &#xA; \\ \beta&#xA;\end{pmatrix}$$&#xA;It can also be expressed in terms of the asset weights in the sub portfolios as:&#xA;$$\begin{pmatrix}&#xA;Cov(a,c) &#xA; \\ Cov(b,c)&#xA;\end{pmatrix}=\begin{pmatrix}&#xA;\alpha w_{pa}' \Sigma w_{pa}  + \beta w_{pa}' \Sigma w_{pb} \\&#xA;\beta w_{pb}' \Sigma w_{pb}  + \alpha w_{pa}' \Sigma w_{pb}&#xA;\end{pmatrix}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This reconciles the matrix calculations in &lt;a href=&quot;https://quant.stackexchange.com/questions/11184/given-a-correlation-martrix-calculate-portfolios-correlation-with-its-assets&quot;&gt;solution to this question&lt;/a&gt; and what @MarcoBietig has posted here. Here is &lt;a href=&quot;https://quant.stackexchange.com/questions/11184/given-a-correlation-martrix-calculate-portfolios-correlation-with-its-assets&quot;&gt;multivariate portfolio solution&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2014-05-14T00:50:03.140" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11270" PostTypeId="1" AcceptedAnswerId="11369" CreationDate="2014-05-13T09:57:48.123" Score="1" ViewCount="124" Body="&lt;p&gt;Say I want to buy historically recorded raw feed from an European exchange (say LSE).&#xA;Is there a vendor that would sell me this data ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: By raw feed I mean the order by order feed (or equivalent) that would enable me to build the entire book at any point in day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers&lt;/p&gt;&#xA;" OwnerUserId="5339" LastEditorUserId="5339" LastEditDate="2014-05-20T07:14:02.010" LastActivityDate="2014-05-20T16:46:38.370" Title="Where can I buy historic raw recording of an exchange" Tags="&lt;market-data&gt;&lt;feed&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="11271" PostTypeId="1" AcceptedAnswerId="12632" CreationDate="2014-05-13T10:23:57.053" Score="1" ViewCount="3871" Body="&lt;p&gt;I have a Forex trading signal generator written in Node.js and now I am looking for a Forex broker with a free Node.js compatible API.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The requirements are simple:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;be able to send new trade orders&lt;/li&gt;&#xA;&lt;li&gt;close trades&lt;/li&gt;&#xA;&lt;li&gt;get active trades&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The orders are the usual stop loss/take profit trades.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Free API meaning, no flat fee charges or big minimum deposit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Only interested in ECN/STP brokers and ideally the API to work with demo accounts for testing purposes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="8052" LastEditorUserId="8052" LastEditDate="2014-05-15T07:57:46.190" LastActivityDate="2020-06-30T01:14:15.300" Title="Forex brokers with free API compatible with Node.js" Tags="&lt;programming&gt;&lt;automated-trading&gt;&lt;fx&gt;" AnswerCount="4" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11272" PostTypeId="2" ParentId="11180" CreationDate="2014-05-13T14:08:54.313" Score="3" Body="&lt;p&gt;The &lt;a href=&quot;http://cran.rstudio.com/package=PerformanceAnalytics&quot; rel=&quot;nofollow&quot;&gt;PerformanceAnalytics&lt;/a&gt; library reflects several years worth of development by Brian Peterson and Peter Carl, as well as multiple collaborators.  It is fairly widely used, tested and debugged.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basic software engineering practices suggest that you should strive to re-use it if possible.  Options for that include&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;accessing a remote R instance via &lt;a href=&quot;http://www.rforge.net/Rserve/&quot; rel=&quot;nofollow&quot;&gt;RServe&lt;/a&gt; (though you may be unhappy with the state of RServe clients on Windows / C# as per your comments)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;accessing a remote R instance via a RESTful service such as &lt;a href=&quot;https://www.opencpu.org/&quot; rel=&quot;nofollow&quot;&gt;OpenCPU&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;placing your jobs on a queue (for which I like Redis) and having the R worker pick'em up from the queue via &lt;a href=&quot;http://cran.rstudio.com/package=rredis&quot; rel=&quot;nofollow&quot;&gt;rredis&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The last option is the loosest coupling and may be easiest to test.  I would rather go down any of these routes than trying to rewrite &lt;a href=&quot;http://cran.rstudio.com/package=PerformanceAnalytics&quot; rel=&quot;nofollow&quot;&gt;PerformanceAnalytics&lt;/a&gt;. Don't forget that the package itself has dependencies you may have to port as well.&lt;/p&gt;&#xA;" OwnerUserId="69" LastActivityDate="2014-05-13T14:08:54.313" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="11273" PostTypeId="1" CreationDate="2014-05-13T14:09:01.007" Score="0" ViewCount="158" Body="&lt;p&gt;I've been trying to access the papers that state that kind of problem, but most of them need payment for access and I am on a student budget.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that maximizing profits=maximizing stock value in a world of certainty, but why is that maximizing stock value will be different from maximizing expected profits in a world of uncertainty? &lt;/p&gt;&#xA;" OwnerUserId="6897" LastEditorUserId="70" LastEditDate="2014-05-13T18:23:45.380" LastActivityDate="2015-08-06T20:32:45.940" Title="Why is that maximizing stock value, under uncertainty, is a better option than maximizing profits?" Tags="&lt;equities&gt;&lt;economics&gt;&lt;present-value&gt;" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="11274" PostTypeId="1" CreationDate="2014-05-13T14:36:51.143" Score="14" ViewCount="1524" Body="&lt;p&gt;Relative value of large cap volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We all track the VIX as a measure of volatility, but we often forget that the VIX  is volatility indicator for the large cap index within the SP500. We can construct volatility measures of volatility for different sectors/industries (tech, healthcare, financial, etc.).  There is volatility on size mid-cap indices, small cap. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One thing that caught my eye the other day was the volatility on the Russell 2000, which is the volatility on the small cap indices and which is currently trading at 20, is about 8 points higher than volatility on the VIX, the large cap volatility index. Historically, the VIX has always been 70% of the RVX.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at a historical chart of the ratio of VIX:RVX I saw that the ratio tended to increase in major market corrections and tended to approach parity before reversing around. Besides the fact this indicator could be used for market timing, I would like to get many of your takes as to why the volatility expectations on large cap stocks increases faster and reaches the same level as that of small caps. How?? It is clear that small cap stocks are riskier, have a higher beta and are less capitalized than larger firms. This relationship I have described was not a one time instance, it has repeated many times and therefore worth noting here. I appreciate all your feedback.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/e72hP.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="4729" LastEditorUserId="4729" LastEditDate="2014-05-13T17:59:34.783" LastActivityDate="2014-05-28T02:51:22.347" Title="Relationship between Large Cap and Small Cap Volatility" Tags="&lt;volatility&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="11275" PostTypeId="2" ParentId="11266" CreationDate="2014-05-13T15:01:37.190" Score="1" Body="&lt;p&gt;I believe that last sentence on &lt;a href=&quot;http://en.wikipedia.org/w/index.php?title=Hansen%E2%80%93Jagannathan_bound&amp;amp;oldid=577246751&quot; rel=&quot;nofollow&quot;&gt;Wikipedia&lt;/a&gt; isn't about the last step you're showing. So let's ignore that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically in the first equation $a=rb$ and we have $|r| \leq 1$ so certainly $b&amp;gt;a$ as we have in the second equation. Taking absolutes just drops the signs.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2014-05-13T15:01:37.190" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11276" PostTypeId="2" ParentId="11151" CreationDate="2014-05-13T16:42:29.280" Score="-1" Body="&lt;p&gt;you can simply use excel using &quot;single index model&quot; &lt;/p&gt;&#xA;" OwnerUserId="8056" LastActivityDate="2014-05-13T16:42:29.280" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11278" PostTypeId="1" CreationDate="2014-05-13T22:43:36.620" Score="1" ViewCount="124" Body="&lt;p&gt;I'm looking into simple-to-implement and efficient order 1.5 strong SDE integration schemes for my system. My noise is diagonal &lt;em&gt;and&lt;/em&gt; additive (possibly time-varying). Thus methods designed for either Itô or Stratonovich are fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any explicit, derivative-free, order 1.5 methods that only require &lt;em&gt;a single random variate&lt;/em&gt; per dimension per time-step (or that reduce to this in the diagonal additive noise case)? Based on a proof by &lt;a href=&quot;http://www.jstor.org/stable/2156972&quot; rel=&quot;nofollow&quot;&gt;Rümelin 1982&lt;/a&gt;, acccording to &lt;a href=&quot;http://dx.doi.org/10.1016/S0168-9274%2896%2900027-X&quot; rel=&quot;nofollow&quot;&gt;Burrage &amp;amp; Burrage 1996&lt;/a&gt; (p.&amp;nbsp;83):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;More general Runge-Kutta type schemes can be constructed but it is possible to show that a strong order of 1.5 cannot be surpassed if just the increments $\Delta W_n$ of the Wiener process are used.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In the same Burrage &amp;amp; Burrage paper, a method claimed to be order 1.5 strong is developed&lt;sup&gt;1&lt;/sup&gt; that indeed just uses one random variate. In simple tests, the Burrage &amp;amp; Burrage scheme performs slightly better than Euler-Maruyama (order 1.0 strong for additive noise), but I've yet to do anything formal. However, in a later paper &lt;a href=&quot;http://dx.doi.org/10.1098/rspa.2003.1247&quot; rel=&quot;nofollow&quot;&gt;(Burrage, et al. 2004)&lt;/a&gt;, what looks to be the identical method (p. 388) is labelled as order 1.0 strong. Additionally, in my perusal of the recent literature, every explicit stochastic Runge-Kutta method of order 1.5 strong has required at least two random variates, e.g., those in &lt;a href=&quot;http://dx.doi.org/10.1137/09076636X&quot; rel=&quot;nofollow&quot;&gt;Rößler 2010&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, what's the deal? Is there such a scheme? And if so, can anyone point me to one? Or are there reasons why I might not be coming across such schemes in the literature (other than that they might be less exciting academically)? Perhaps order 1.5, being the limit for a single random variable, is hard to achieve in practice for real problems? Hence, why methods that claim to be order 1.5 generally use at least two variates in order achieve the desired order of convergence.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt; &lt;sub&gt;Let me know and I'll include the equations for the integration scheme if you think it necessary.&lt;/sub&gt;&lt;/p&gt;&#xA;" OwnerUserId="5657" LastEditorUserId="5657" LastEditDate="2014-05-16T20:21:22.797" LastActivityDate="2014-05-16T20:21:22.797" Title="Order 1.5 strong SDE integration methods for systems with diagonal additive noise" Tags="&lt;simulations&gt;&lt;numerical-methods&gt;&lt;sde&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11279" PostTypeId="1" AcceptedAnswerId="11283" CreationDate="2014-05-13T23:18:35.250" Score="1" ViewCount="1186" Body="&lt;p&gt;I thought I had &lt;em&gt;understood&lt;/em&gt; futures contract. But it seems the daily settlements &lt;em&gt;betray&lt;/em&gt; my understanding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Futures contract provides price &amp;amp; product safety to involved two parties.&#xA;E.g. Wheat Farmer and Baker&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems Futures contract poisitions (long, short) are credit/debit accordingly based on current market price using daily settlement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the price is &lt;strong&gt;locked&lt;/strong&gt; then why is this daily settlement doing? &lt;a href=&quot;http://www.investopedia.com/university/futures/futures2.asp&quot; rel=&quot;nofollow&quot;&gt;The profits and losses of a futures contract depend on the daily movements of the market for that contract and are calculated on a daily basis.&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Are we talking about Famer and Baker here or about the traders who bid and trade on futures available in the exchanges?&lt;/li&gt;&#xA;&lt;li&gt;Or else, futures contract is not observed as an independent element but that has an effect pre/post transaction. e.g. Famer agreed to sell Wheat for 4 dollar per bussel in 1 years time. In one years time market price is 5 dollar. If he had sold wheat in the market he would have earned extra 1 dollar. But it doesn't mean he is at a loss. &lt;strong&gt;Is he?&lt;/strong&gt; On the other hand Baker may choose to keep the wheat for bread production or sell it to get 1$ profit. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;I just want to understand who is affected by daily settlement - the farmer/baker or traders.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of interest-rate/credit/bond futures, I guess this could even be more confusing - unless I figure it out now with commodity aspect.&lt;/p&gt;&#xA;" OwnerUserId="3178" LastEditorUserId="3178" LastEditDate="2014-05-14T05:05:50.667" LastActivityDate="2014-05-14T08:19:50.187" Title="Why does Futures contract credit and debit a position daily, if it has &quot;locked&quot; the price?" Tags="&lt;futures&gt;&lt;derivatives&gt;&lt;commodities&gt;&lt;longshort&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11280" PostTypeId="1" AcceptedAnswerId="11284" CreationDate="2014-05-14T00:07:13.193" Score="2" ViewCount="183" Body="&lt;p&gt;I know that many funds have local index (i.e., SPX in US) as their benchmark. Why are investors interested in such kind of returns instead of absolute returns. From the first glance I'd think one would only care to make the maximum amount of money rather than be positive in relation to some index. I often hear how people talk about &quot;if everything falls 50%, but your allocation falls 48%, that's like +2%&quot;. At the same time I can't understand why wouldn't you then invest in absolute return fund which might actually make money in this period, and in such case could be considered over +50% return if it is so important to outperform index...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, the question is: why funds with index benchmarks exist and who is interested in such, versus absolute return.&lt;/p&gt;&#xA;" OwnerUserId="5086" LastEditorUserId="5086" LastEditDate="2014-05-14T00:16:55.623" LastActivityDate="2014-06-01T11:09:40.327" Title="What is the motivation for index benchmark?" Tags="&lt;soft-question&gt;&lt;benchmark&gt;" AnswerCount="5" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11281" PostTypeId="2" ParentId="11217" CreationDate="2014-05-14T01:10:37.790" Score="4" Body="&lt;p&gt;When you do Monte Carlo simulation and would like to draw sample from the normal distribution $\mathcal{N}(\mu,\sigma^2)$, you may use &#xA;&lt;a href=&quot;http://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform&quot; rel=&quot;nofollow&quot;&gt;Box-Muller transform&lt;/a&gt; and come up with formulas using $\sin$ and $\cos$.&lt;/p&gt;&#xA;" OwnerUserId="4812" LastActivityDate="2014-05-14T01:10:37.790" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11282" PostTypeId="2" ParentId="11279" CreationDate="2014-05-14T01:30:22.590" Score="1" Body="&lt;p&gt;The daily mark-to-market reduces the counterparty risk by making sure every day that the counterparties can pay for their losses. For a forward contract, on the other hand, there is no daily mark-to-market and one simply have to trust that the counterparty can pay up (or deliver/take delivery of goods) at settlement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets consider the Farmer. Yes, his price is locked by the futures contract but he might not actually have the crop right now. For example, he might want to lock in the price of next years crop. However the crop might go bad or the machinery breaks down so he might not have any crop to deliver. He then needs to buy the crop in the spot market to honor his contract or buy back the contract he sold in the market. This may realize a loss for him which he may or may not be able to take. So we can either trust that he can do it, or we can make sure he can do it by mark-to-market his accounts every day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets consider the Baker. He might have locked in the price of wheat but the spot price has since plunged, bringing down the price of bread, and taking delivery on his contract will mean that he can't produce bread at a profit. By selling his contract in the market he realizes the same loss. If he doesn't have enough funds this will take him out of business and he hence might default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By making sure that all accounts can meet the daily financial requirements of the contract, the mark-to-market is an important tool to reduce the magnitude of a counterparty default regardless if we are talking about farmer/bakers or traders.&lt;/p&gt;&#xA;" OwnerUserId="5107" LastEditorUserId="5107" LastEditDate="2014-05-14T05:18:10.637" LastActivityDate="2014-05-14T05:18:10.637" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="11283" PostTypeId="2" ParentId="11279" CreationDate="2014-05-14T08:19:50.187" Score="1" Body="&lt;p&gt;I try to answer your questions in the order asked:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;If the price is locked then why is this daily settlement doing?&lt;/strong&gt; This mechanism is in place in order to reduce counterparty and credit risk. Each exchange maintains its own clearing house and each exchange member is obligated to clear their trades with the clearing firm at the end of each day. In turn the exchange member, settles their client accounts daily as well. The reason is that in case of a default at maximum one day's worth of price movement multiplied by the amount of defaulted contracts and contract multiplier is at risk. This makes it much less risky for the clearing house as well as for brokers and all market participants, evidenced through the fact that so far not one clearing house has gone into default. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Are we talking about Famer and Baker here or about the traders who bid and trade on futures available in the exchanges?&lt;/strong&gt; We are talking about everyone involved in the chain. If a farmer or baker were to receive one large sum at contract expiration and somewhat the payment fell through because someone defaulted in between this would cause serious economic damage no matter whether the payment is eventually made or not. Thus, daily settlement reduces risk for everyone. Equally traders (well the brokerage houses that employ traders) benefit from reduced risk through daily settlement. It really is a good system in place and so far I have not heard of serious contenders that challenged this specific mechanic. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You need to familiarize yourself with the purpose of engaging in futures trades. There are speculators that simply buy and sell and there are hedgers. Farmers and bakers would belong to the hedger category. There have been well-covered scandals where commodity houses or commercial players heavily engaged in speculation (copper scandal at Sumitomo) but general commercial players engage in futures markets in order to hedge exposure. So, a baker would buy long futures contracts to lock in a price he would be paying at a future delivery date. Equally, a farmer would sell a futures contract that obligates him to deliver the underlying at a future date for a certain price in exchange. Keep in mind that anyone can trade futures, not just hedgers, hence the category &quot;speculators&quot;. Depending on whether market participants buy/sell futures to open new positions or close positions, &quot;open interest&quot; in such futures contracts increases or decreases. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I recommend you read up on some futures basics such as in Hull &quot;Options, Futures &amp;amp; Other Derivatives&quot;. You need to understand that daily settlement has nothing to do with the final contract settlement, regardless of whether it is cash settled or whether physical goods change hands. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this answers your questions.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2014-05-14T08:19:50.187" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="11284" PostTypeId="2" ParentId="11280" CreationDate="2014-05-14T08:25:17.653" Score="3" Body="&lt;p&gt;Summary Answer: Those are interested to benchmark against indexes who sell such index products (pricing data, trade marks, rights to use and publish), and of course portfolio managers because they look generally much better when indexed against indexes than when being assessed through risk-adjusted returns. The general public is sadly just too uninformed to complain much. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cynical and Winding Answer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the precisely same reason than airlines asking you to fasten your seat belts. Its not that a seat belt would make the slightest of differences when a plane crashes, but it makes people feel safe and cared, you know, that warm fuzzy feeling, when during 2008 your investment advisor called you up and cheerfully let you know that his stock picks performed 10% better than the overall market. Unfortunately you lost 40% of your market value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I take a very critical approach to most motivations by market practitioners in the financial arena. What I have learned early on is that 1-2% are truly smart and outstanding alpha generators, another 8-9% perform vital and important support functions to sustain the 1-2% alpha generators, and all the rest in this industry are like pilot fish around sharks (defined as parasites and those feasting on leftovers). There is a whole indexing service industry subculture where such sales men arrive at your office to tout their latest wares in custom tailored suits, sun-tanned faces, wrist watches twice the size of their arms. The first time you see it you will be amazed, then surprised, and in the end you will run out of the meeting room screaming because you realized that a lot of your retirement and investment portfolios is eaten up by such people. They wine and dine your portfolio managers and he insists along all his colleagues during the daily investment meetings that portfolios must be benchmarked against indexes they themselves choose. A portfolio manager's, or better, fund sales person's worst nightmare is the term &quot;risk adjusted return metrics&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I being cynical or bitter? Cynical yes, bitter no, but as soon as you witness just enough of the shenanigans that most in this industry are engaged in you gotta start laughing and smiling a lot more which is often taken as cynicism.  &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2379" LastEditDate="2014-05-14T14:36:27.507" LastActivityDate="2014-05-14T14:36:27.507" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="11285" PostTypeId="2" ParentId="11280" CreationDate="2014-05-14T08:40:08.097" Score="3" Body="&lt;p&gt;The first reason is the answer to this question :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;should I bother invest in your fund and not simply invest in the S&amp;amp;P500 etf ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second is :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are you a fraud ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If someone claims to use a long only strategy with stocks from the S&amp;amp;P500, you expect his fund returns to be correlated to the S&amp;amp;P500 to some extent. If it is not the case =&gt; fraud.&lt;/p&gt;&#xA;" OwnerUserId="5819" LastActivityDate="2014-05-14T08:40:08.097" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11286" PostTypeId="2" ParentId="11264" CreationDate="2014-05-14T08:43:52.613" Score="2" Body="&lt;p&gt;Try to plot the rolling mean against your quotes for SP and see if it makes sense. Although you line of code to compute the rolling mean is correct, there might be something wrong in the data that you pass as input.&lt;/p&gt;&#xA;" OwnerUserId="5819" LastActivityDate="2014-05-14T08:43:52.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11287" PostTypeId="2" ParentId="11151" CreationDate="2014-05-14T11:57:24.973" Score="3" Body="&lt;p&gt;This is in essence the idea behind Andrea Frazzini's paper '&lt;a href=&quot;http://pages.stern.nyu.edu/~lpederse/papers/BettingAgainstBeta.pdf&quot; rel=&quot;nofollow&quot;&gt;Betting Against Beta&lt;/a&gt;'. There are various ETFs that aim to exploit the premium.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In R, you can do just do a linear regression using the &lt;code&gt;lm(Y~X)&lt;/code&gt; which includes an intercept or using &lt;code&gt;lm(Y~X+0)&lt;/code&gt; which regresses without an intercept. Assuming you've saved the model in variable &lt;code&gt;lm.r&lt;/code&gt;, then to get the coefficients, you simply &lt;code&gt;coef(lm.r)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In package &lt;code&gt;PerformanceAnalytics&lt;/code&gt;, there are built in functions whereby you can just plug in the parameters, independent and dependent and risk free rate to give out the coefficients.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For python, you should take a look in the &lt;code&gt;pandas&lt;/code&gt; package for regression analysis. Last time I checked its inside the package but was being moved to &lt;code&gt;stats-model&lt;/code&gt; package for reasons beyond me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope that helps&lt;/p&gt;&#xA;" OwnerUserId="2318" LastActivityDate="2014-05-14T11:57:24.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11288" PostTypeId="1" CreationDate="2014-05-14T12:15:46.337" Score="1" ViewCount="5037" Body="&lt;p&gt;In &lt;a href=&quot;https://www.lme.com/en-gb/trading/contract-types/futures/prompt-date-structure/&quot; rel=&quot;nofollow&quot;&gt;LME website Prompt Date Structure is explained as this.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why there are prompt dates? LME trading calendar isn't universal to all other calanedars found in the market. So how do &quot;Non-tradable dates and substitute prompt dates&quot; affect other trading calendars? How are traders from other regions trading at their local calendar/exchanges do adjustments or how does prompt dates affect them?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone give a simplified example using above concept with regards to a metal trading in an Asian region?&lt;/p&gt;&#xA;" OwnerUserId="3178" LastActivityDate="2014-12-15T16:45:16.340" Title="What is Prompt Date Structure?" Tags="&lt;date&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11290" PostTypeId="1" AcceptedAnswerId="11296" CreationDate="2014-05-14T14:26:47.623" Score="0" ViewCount="919" Body="&lt;p&gt;When receiving a value date of D from the counterparty for a trade in NZD/USD, is D assumed to be &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;date D in Auckland&lt;/li&gt;&#xA;&lt;li&gt;date D in New York&lt;/li&gt;&#xA;&lt;li&gt;date D in UTC&lt;/li&gt;&#xA;&lt;li&gt;date D in some arbitrary time zone&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are lots of online references to market close being 7AM Auckland time for NZD/USD trades, but I cannot find any places that describe the convention for which timezone the trade and value dates (which are just raw dates, with no time or time zone qualification) are specified in. In addition, the FIX type for this field in an Execution Report simply says it is a &quot;local market date&quot;; it's not clear whether this means &quot;the local market for the primary currency&quot; or &quot;the local market of the counterparty&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This matters because, when calculating exposure, you need to be able to determine the UTC 'close of market' time by which the trade must be reconciled. Since Auckland is ~16 hours ahead of New York, it's important to know whether the counterparty's value date is 'date in Auckland' versus 'date somewhere else'.&lt;/p&gt;&#xA;" OwnerUserId="8062" LastActivityDate="2014-05-14T17:25:42.873" Title="Forex trades: what time zone are trade and value dates specified in?" Tags="&lt;fx&gt;&lt;time&gt;&lt;date&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11291" PostTypeId="2" ParentId="11280" CreationDate="2014-05-14T15:07:39.737" Score="3" Body="&lt;p&gt;There are a few things:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Non-cynical:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Active absolute return managers tend to underperform passive benchmarks after fees. So if you can get a manager that can outperform a passive benchmark (perhaps who has a mostly passive strategy with some active tilts), then you are &#xA;doing well.&lt;/li&gt;&#xA;&lt;li&gt;Your scenario of a portfolio dropping 48% is not realistic. Most asset allocation guys will diversify with safe haven assets that are negatively correlated with typical risky assets during market turmoil. This could include gold, USD, CHF, US bonds, a negative beta manager, or some financial engineering products. Thus your expectation in a crisis might be better than only going to absolute return under certain allocations (and it wouldn't be - 48%). The key is to think on the &lt;strong&gt;allocation level&lt;/strong&gt; instead of the level you were thinking of which is the &lt;strong&gt;manager level&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Cynical:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The boards of pension funds and endowments will fire you if you do not make some acceptable quartile of performance among peers. Even if you are max $E[R(t)]$ and min $\sigma(R(t))$ by investing in absolute return in a statistical &lt;em&gt;population&lt;/em&gt; sense, it is completely irrelevant to career risk. By choosing absolute return you will be maximising the variance of your returns &lt;em&gt;around your peers&lt;/em&gt; (peer-relative tracking error), thus maximising career risk. If it comes to a trade off between career risk and the lower utility of your clients, the manager of the endowment and its investment consultant will choose to lower the utility of their clients (in my experience). (Liquidity providers are demonised, but who are the real cancers here?)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="6081" LastActivityDate="2014-05-14T15:07:39.737" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11292" PostTypeId="2" ParentId="11217" CreationDate="2014-05-14T15:15:58.687" Score="3" Body="&lt;p&gt;Trigonometric functions show up in econometric models for business cycles. For example: the average length of a cycle of an AR(2) process is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ k = \frac{2 \pi}{\cos^{-1}( \phi_1/ (2 \sqrt{-\phi_2}))}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For an AR(2) model given by&#xA;$ r_t = \phi_0 + \phi_1 r_{t-1} + \phi_2 r_{t-2} + a_t$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;with complex roots, $\phi_1^2 + 4\phi_2 &amp;lt;0 $&lt;/p&gt;&#xA;" OwnerUserId="6721" LastActivityDate="2014-05-14T15:15:58.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11293" PostTypeId="2" ParentId="11280" CreationDate="2014-05-14T15:20:16.910" Score="0" Body="&lt;p&gt;It's called &quot;keeping up with the Jones.&quot; A lot of people are less worried about how much money they will make, than whether they keep up with (and therefore get to live and retire in the same style as) their friends, coworkers, or some other reference group. That applies to most fund trustees. Most of them like to compare notes with their peers on the golf course, and their primary concern is NOT to be &quot;embarrassed.&quot; &lt;/p&gt;&#xA;" OwnerUserId="2345" LastActivityDate="2014-05-14T15:20:16.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11295" PostTypeId="1" AcceptedAnswerId="11338" CreationDate="2014-05-14T15:51:45.027" Score="1" ViewCount="260" Body="&lt;p&gt;Assume I wanted to compute the alpha (in CAPM sense, i.e. $r_i - r_f = \alpha_i + \beta_i(r_m - r_f) + \epsilon_i$) of a stock. So I take, say, monthly returns of a stock $i$ for 1 year. Subtract the riskfree rate from this and call this $Y_i$. Now I take the corresponding benchmarket return and similarly i subtract the risk free rate from this and call it $X_i$. Now, to compute $\alpha_i$ I perform a linear regression for the model: $Y_i=\alpha_i + \beta_i X_i + \epsilon_i$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if I wanted to compute $\alpha$ for an equally weighted portfolio of stocks listed on different exchanges in different countries (assume risk free rate equal). Then we have the portfolio return&#xA;$$r_p = \frac{1}{n}\sum_{i=1}^{n}r_i = \\\frac{1}{n}\sum_{i=1}^{n}(r_f + \alpha_i + \beta_i(r_m-r_f)) = \\r_f + \frac{1}{n}\sum_{i=1}^{n}\alpha_i + \frac{1}{n}\sum_{i=1}^{n}\beta_i (r_m-r_f)$$&#xA;Can I now say that $\alpha_p = \frac{1}{n}\sum_{i=1}^{n}\alpha_i$ and $\beta_p=\frac{1}{n}\sum_{i=1}^{n}\beta_i$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Here $r_m$ is the benchmark for each corresponding asset, I didn't use a notation for this though..)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, if the portfolio strategy is a buy-and-hold with horizon 1 year before being balanced and the alphas are monthly, is it safe to annualize them in the most naive manner $(1+\alpha)^{12}-1$?&lt;/p&gt;&#xA;" OwnerUserId="4709" LastEditorUserId="2299" LastEditDate="2014-05-17T13:29:26.410" LastActivityDate="2014-05-17T20:59:20.797" Title="Calculate alpha (CAPM) in &quot;cross country-portfolio&quot;" Tags="&lt;portfolio&gt;&lt;capm&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11296" PostTypeId="2" ParentId="11290" CreationDate="2014-05-14T17:25:42.873" Score="1" Body="&lt;p&gt;This kind of question is exactly why spot FX takes T + 2 to settle.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Exactly why you are looking for a convention is, I would say, because the whole thing depends on the conventions your trading partners use. You need to refer to the provider from whom you are getting the data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For me, the trade date is most likely the time of the provider pricing engine that serves the local market. If the pricing engine is pricing NZD/USD out of New York then trade date would be specified in NYK time. That way, we can run the history of pricing the trade at a later date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similar for value date calculations, when adjusting spot prices by the forward pips it must be, again, the local time of the interest rate pricing engine. So a 1 week forward priced out of NYK has an NYK value date calculation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could get interesting when the interest rate desk is pricing out of Singapore but the spot desk is still pricing out of NYK.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the value date is not necessarily the settlement date. It ought to be, because that's how you know the amount with which to settle. But the cut off time for settlement depends on the bank. I guess your bank has to confirm the time zone by which they expect to be credited by you. Or you have to pay the penalty for late settlement. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess it all comes down to the clearing desks may work on a different time zone to the pricing desks.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2014-05-14T17:25:42.873" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11298" PostTypeId="2" ParentId="10838" CreationDate="2014-05-14T21:03:10.280" Score="4" Body="&lt;p&gt;Since MiFID 1 in Europe (you may have heard &lt;a href=&quot;http://www.consilium.europa.eu/uedocs/cms_data/docs/pressdata/en/ecofin/142575.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;MiFID 2 has been recently adopted&lt;/a&gt;), all trades have to be reported somewhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reporting channels are numerous:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;regulated markets have &lt;em&gt;in books&lt;/em&gt; and &lt;em&gt;off the book&lt;/em&gt; reporting feeds&lt;/li&gt;&#xA;&lt;li&gt;MTF have their own, sometimes one for their Lit book and the other for their Dark one&lt;/li&gt;&#xA;&lt;li&gt;remaining OTC trades have been reported for long on Markit Boat, now the BATS reporting facility records most of them.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;It means that depending to which feeds your provider (namely Bloomberg or Reuters)  is connected, you will not see the same subset of trades. Moreover you have some options (for instance on Bloomberg), to decide to exclude OTC trades for instance; it means that depending on the profile you use to log yourself, you will not see the same data...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a snapshot of one week of trading (via the &lt;a href=&quot;http://fragmentation.fidessa.com/fragulator/&quot; rel=&quot;nofollow noreferrer&quot;&gt;fidessa fragulator&lt;/a&gt;, plugged on Markit Boat if I remember well):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/sohQB.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you could miss a lot of data if you do not have all the feeds. &#xA;Moreover there is potentially some double counting... &#xA;An &lt;a href=&quot;http://tabbforum.com/opinions/a-european-consolidated-tape-how-much-longer-must-we-wait&quot; rel=&quot;nofollow noreferrer&quot;&gt;European consolidated tape&lt;/a&gt; should (or could) address all these points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want more details, you show read &lt;a href=&quot;http://www.worldscientific.com/worldscibooks/10.1142/8967&quot; rel=&quot;nofollow noreferrer&quot;&gt;Market Microstructure in Practice&lt;/a&gt;. With co-authors, we try to explain all these in detail ;{)}&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2014-05-15T05:12:12.827" LastActivityDate="2014-05-15T05:12:12.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11299" PostTypeId="1" AcceptedAnswerId="11302" CreationDate="2014-05-15T05:58:38.670" Score="3" ViewCount="523" Body="&lt;p&gt;I have a toy model in Excel for the growth of a investment portfolio. I assume iid lognormal annual growth factors:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;=EXP(mu+sigma*NORM.S.INV(RAND()))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where mu and sigma are calculated to get a given mean and standard deviation right.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would really like to play around with something that has fatter tails, but with the same mean and standard deviation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you have a suggestion that is easily implementable (in &lt;em&gt;one&lt;/em&gt; cell)? Can you also point out how to compute its parameters given mean and standard deviation? And, finally, if there is an additional parameter, could you provide a 'reasonable' value for it (annual returns, bunch of asset classes in one portfolio)? That would be great.&lt;/p&gt;&#xA;" OwnerDisplayName="user8063" LastEditorDisplayName="user8063" LastEditDate="2014-05-15T08:57:22.637" LastActivityDate="2014-05-15T09:49:36.947" Title="Is there an easily implementable alternative to lognormal growth (something with fatter tails)?" Tags="&lt;modeling&gt;&lt;monte-carlo&gt;&lt;distribution&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11301" PostTypeId="1" CreationDate="2014-05-15T08:45:41.183" Score="4" ViewCount="417" Body="&lt;p&gt;I am currently working on my thesis where I discuss the Merton default probability model. I have a huge sample of US firms for the period 1990-2010. I use both numerical and complex iterative approach to estimate asset volatility and asset value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a problem with the numerical approach because when I estimate asset value and asset volatility (in statistical software R &lt;a href=&quot;https://stackoverflow.com/questions/23618277/for-loop-using-nleqslv-package-in-r?noredirect=1#comment36262600_23618277&quot;&gt;with this code&lt;/a&gt;) for some firms in the sample I get a negative annual asset volatility. This does not make sense as something which is result of square root can't be negative, but it could be due estimation in numerical approach. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone come across something like this or what are your thoughts regarding this phenomenon.&lt;/p&gt;&#xA;" OwnerUserId="8032" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2018-04-29T12:20:58.957" Title="How to interpret negative asset volatility numerical results in Merton model?" Tags="&lt;volatility&gt;&lt;merton-model&gt;&lt;black-scholes-merton&gt;&lt;default-risk&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11302" PostTypeId="2" ParentId="11299" CreationDate="2014-05-15T08:52:17.253" Score="2" Body="&lt;p&gt;If you mean by fat tails just fatter tails than the gaussian distribtuion, i.e. a distribution with finite variance, for instance the &lt;a href=&quot;http://en.wikipedia.org/wiki/Student%27s_t-distribution&quot; rel=&quot;nofollow&quot; title=&quot;Student's t-distribution&quot;&gt;Student's t-distribution&lt;/a&gt; has fatter tails than the normal distribution. If you mean distributions with infinite variance, you have to have a look at &lt;a href=&quot;http://en.wikipedia.org/wiki/Levy_distribution&quot; rel=&quot;nofollow&quot;&gt;Lévy distribution&lt;/a&gt;.&#xA;In a first attempt you could just substitute the standard normal distribution with Student's t-distribution. Your formular would look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;=EXP(mu+sigma*T.INV(RAND(),DoF))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For degrees of freedom ($\operatorname{DoF}$) you have to specify an integer, preferably $\operatorname{DoF}&amp;gt;2$ so that the variance is finite. For $\operatorname{DoF}\to\infty$ Student's t-distribution converges against the standard normal distribution. The smaller the $\operatorname{DoF}$, the fatter the tails (to the extreme that for $\operatorname{DoF}\leq 2$ the variance does not exist and for $\operatorname{DoF}\leq 1$ the expectation does not exist).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some words of caution: You can scale Student's t-distribution like you do with the standard normal distribution, but the rescaled parameter $\sigma$ is not the standard deviation. Have a look at the &lt;a href=&quot;http://en.wikipedia.org/wiki/Student%27s_t-distribution#In_terms_of_scaling_parameter_.CF.83.2C_or_.CF.832&quot; rel=&quot;nofollow&quot;&gt;scaling behaviour of Student's t-distribution&lt;/a&gt;. To get the right variance, you have to scale with&#xA;$$&#xA;\sigma := \sqrt{\operatorname{Var}\left[X\right]\frac{\operatorname{DoF}-2}{\operatorname{DoF}}}&#xA;\textrm{,}&#xA;$$&#xA;where $\operatorname{Var}\left[X\right]$ denotes the variance of your rescaled Student's t-distribution $X:=\mu+\sigma T$ with $T\sim t\left(\operatorname{DoF}\right)$. The expecated value $\mu$ is the same. Reasonable values for $\operatorname{DoF}$ are $3,\ldots,30$, the smaller the fatter are the tails. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The $\operatorname{exp}$ function in your model transforms instantaneous returns to normal growth factors. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A second word of caution: Normally you would simulate a realisation of a stochastic process which has incemrents distributed like $\mathcal{N}\left(\mu,\sigma^{2}\right)$. You can add up this log-returns to get to the overall return. With $\operatorname{exp}$ you get back to the value process of your portfolio. This works, because the sum of gaussian random variables stays gaussian. In fact, because of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Central_limit_theorem&quot; rel=&quot;nofollow&quot;&gt;central limit theorem&lt;/a&gt; the sum of random variables with finite variance which are not too dependent will converge in distribution to the gaussian distribution. So if you'd replicate the described strategy with Student's t-distributed random variables instead of gaussian random variables and $\operatorname{DoF}&amp;gt;2$ (finite variance), the resulting sum will converge in distribution to a gaussian one and you'd lose the fat tail property of Student's t-distribution.&lt;/p&gt;&#xA;" OwnerUserId="6980" LastEditorDisplayName="user8063" LastEditDate="2014-05-15T09:49:36.947" LastActivityDate="2014-05-15T09:49:36.947" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11304" PostTypeId="2" ParentId="11301" CreationDate="2014-05-15T12:02:37.883" Score="1" Body="&lt;p&gt;Although I, admittedly, did not go hunting through your code for an error, I have seen this phenomenon before using this model.  This model (like all other models) isn't perfect.  This is especially true when you can only observe those parameters that come from the balance sheet quarterly.  There are scenarios where no asset vol can imply the current market prices.  Usually, the is an explanation for this, such as a pending LBO, but sometimes, it's just that investors like the credit and hate the equity so much, that no reasonable vol can be implied.&lt;/p&gt;&#xA;" OwnerUserId="8069" LastActivityDate="2014-05-15T12:02:37.883" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11306" PostTypeId="1" AcceptedAnswerId="11308" CreationDate="2014-05-15T15:30:27.527" Score="7" ViewCount="12399" Body="&lt;p&gt;I want to calculate realized/historical volatility for the underlying products of various options using the Garman-Klass estimator, but I can't see to find an equation, although I know it involves OHLC data. In the comments there is a link to the equation, but I still am looking for a little explanation. Why does this work? What is the variable &quot;F&quot;?&lt;/p&gt;&#xA;" OwnerUserId="5981" LastEditorUserId="5981" LastEditDate="2014-05-15T16:12:09.260" LastActivityDate="2019-06-14T04:36:28.350" Title="What is the equation for Garman-Klass volatility?" Tags="&lt;volatility&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11307" PostTypeId="2" ParentId="11234" CreationDate="2014-05-15T15:36:27.173" Score="0" Body="&lt;p&gt;I later figured out you can calculate a special payment and fit it into the normal future value of a growing annuity function that is set up in terms of years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, solve for the get the monthly rate, this compounded by 12 will bring us back to r&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$monthlyRate=(1+r)^{1/n}-1 = .006434$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then figure out the effective annual payment (basically accounts for the different lengths of time of interest for each payment) by using the monthly payment in an ordinary annuity for a single year (n=12 months)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$annualPayment= \frac{pmt}{monthlyRate}((1+monthlyRate)^n-1)=2486.77$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now since growth and rate are already defined in terms of a year, we get to use a standard growing annuity formula for annual periods:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$futureValue=\frac{annualPayment}{r-g}((1+r)^n-(1+g)^n) = 75693$&lt;/p&gt;&#xA;" OwnerUserId="8031" LastActivityDate="2014-05-15T15:36:27.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11308" PostTypeId="2" ParentId="11306" CreationDate="2014-05-15T16:31:29.253" Score="12" Body="&lt;p&gt;In the &lt;a href=&quot;https://cran.r-project.org/web/packages/TTR/TTR.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;R TTR package&lt;/a&gt; the Garman-Klass volatility is given by&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Historical Open-High-Low-Close Volatility: Garman Klass&#xA;# https://web.archive.org/web/20100326172550/http://www.sitmo.com/eq/402&#xA;if( calc==&quot;garman.klass&quot; ) {&#xA;  s &amp;lt;- sqrt( N/n * runSum( .5 * log(OHLC[,2]/OHLC[,3])^2 -&#xA;             (2*log(2)-1) * log(OHLC[,4]/OHLC[,1])^2 , n ) )&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which corresponds to*&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA; \sigma = \sqrt{ \frac{Z}{n} \sum&#xA;  \left[ \textstyle\frac{1}{2}\displaystyle&#xA;\left( \log \frac{H_i}{L_i} \right)^2  - (2\log 2-1)&#xA;\left( \log \frac{C_i}{O_i} \right)^2 \right] }.&#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think this code is fairly self-explanatory but what's what?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Z =&lt;/code&gt; Number of closing prices in a year, &lt;code&gt;n =&lt;/code&gt; number of historical prices used for the volatility estimate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;* &lt;span class=&quot;math-container&quot;&gt;$\LaTeX$&lt;/span&gt; taken from the vignette.&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="848" LastEditDate="2019-06-14T04:36:28.350" LastActivityDate="2019-06-14T04:36:28.350" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="11311" PostTypeId="1" AcceptedAnswerId="11342" CreationDate="2014-05-16T02:33:01.240" Score="8" ViewCount="1634" Body="&lt;p&gt;What is the difference between a random process that is adapted to a filteration and one that had the martingale property. It seems the two notions are quite similar and would be helpful to construct examples when they are the same and when they differ. &lt;/p&gt;&#xA;" OwnerUserId="7772" LastActivityDate="2014-05-18T08:59:36.257" Title="Difference betweem martingale property and adapted filteration" Tags="&lt;probability&gt;&lt;finance&gt;&lt;risk-neutral-measure&gt;&lt;asset-pricing&gt;&lt;martingale&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11313" PostTypeId="2" ParentId="11288" CreationDate="2014-05-16T04:36:38.930" Score="2" Body="&lt;p&gt;By Prompt dates, LME means dates on which contract trades. Normally, you see monthly contracts. Prompt month is also front month. LME is providing daily contracts up to 3 months out, then weekly and so on as in your reference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally prompt month is the front month or nearby month that is closest unexpired month. You can replace month by day or week as is the frequency. Probably better to talk interms of prompt contract. Trading systems have mechanism of determining prompt month ( aka front month, nearby month). By the same token for daily contracts they can have first nearby contract. you get the picture.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no trading without knowing the market in which you are trading. &#xA;If you are in Asia trading nn LME you have to follow LME rules. It does not matter where you are - what matters is where you are trading. All traders, anywhere, have to follow the calendar of the market they are trading. E.g. If you are in UK, trading S&amp;amp;P in NYSE, then you have to know you cannot trade on July 4th as that is a holiday. If you are holding a position you want to sell that day, you cannot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All trading systems are market aware, they plug into them holidays, settling currencies, settlement rules etc which local traders know and expect them there in their trading system.&lt;/p&gt;&#xA;" OwnerUserId="7867" LastActivityDate="2014-05-16T04:36:38.930" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11314" PostTypeId="1" CreationDate="2014-05-16T06:10:02.873" Score="1" ViewCount="96" Body="&lt;p&gt;Instead of deriving correlation matrix on standardized returns (z scores) would it not be more accurate to kernel smooth the cdf and then norminv the cdf values for the return z score and then calculate the correlation? I would prefer to capture long term correlation than the instantaneous correlation at infinitesimal time steps. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Correlation of linear returns before and after the kernel smoothing in Matlab seems to be quite different results. I am wondering what do you think is right or is there a better way?  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[u1,x1,bw]=ksdensity(Z(:,1),Z(:,1),'function','cdf');&#xA;[u2,x2,bw]=ksdensity(Z(:,2),Z(:,2),'function','cdf');&#xA;[u3,x3,bw]=ksdensity(Z(:,3),Z(:,3),'function','cdf');&#xA;[u4,x4,bw]=ksdensity(Z(:,4),Z(:,4),'function','cdf');&#xA;[u5,x5,bw]=ksdensity(Z(:,5),Z(:,5),'function','cdf');&#xA;&#xA;&#xA;% gaussian copula   &#xA;[corr_gaussian]=copulafit('Gaussian',[u1 u2 u3 u4 u5]);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Before kernel smoothing&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1   0.126   -0.0653 -0.1374 0.5652&#xA;0.126   1   0.5937  0.6417  0.5946&#xA;-0.0653 0.5937  1   0.8845  0.4278&#xA;-0.1374 0.6417  0.8845  1   0.4306&#xA;0.5652  0.5946  0.4278  0.4306  1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After kernel smoothing              &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1   0.3008  0.3631  0.3654  0.3653   &#xA;0.3008  1   0.2958  0.3259  0.3077&#xA;0.3631  0.2958  1   0.5962  0.5695&#xA;0.3654  0.3259  0.5962  1   0.6295&#xA;0.3653  0.3077  0.5695  0.6295  1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7867" LastActivityDate="2014-05-16T06:10:02.873" Title="Effect of kernel smoothing on correlation" Tags="&lt;correlation-matrix&gt;&lt;copula&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11315" PostTypeId="1" CreationDate="2014-05-16T13:05:42.230" Score="2" ViewCount="76" Body="&lt;p&gt;The concept of &lt;a href=&quot;http://en.wikipedia.org/wiki/Microcredit&quot; rel=&quot;nofollow&quot;&gt;micro credit&lt;/a&gt; has been around for a while. Recall that &lt;a href=&quot;http://en.wikipedia.org/wiki/Muhammad_Yunus&quot; rel=&quot;nofollow&quot;&gt;Muhammad Yunus&lt;/a&gt; together with Grameen Bank were awarded the Nobel price in this context.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't have references at hand but I heard that the interest rate that obligors pay for such loans are quite high (but they would pay even more at standard banks if they gave them money at all). The cost per credit are high too - which is a problem.&#xA;On the other hand micro credit can be seen as development aid - a sales argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All together the concept could be a great field for mutual-funds (I saw one or two).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question: why is the concept of micro credit not more fashionable (maybe some quant/economic reasons)?&#xA;Who are the players? Do there exist large mutual funds or other securities to participate in this kind of business? I know that there are platforms - but they are not-for-profit directly to retail customers - right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I just found a &lt;a href=&quot;http://www.theguardian.com/global-development-professionals-network/2013/nov/19/microcredit-south-africa-loans-disaster&quot; rel=&quot;nofollow&quot;&gt;guardian article&lt;/a&gt; that describes the problems of the concept of micro credit business in South Africa. If I read this correctly then the concept did not help the poor there to get out or poverty.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2014-05-16T13:15:15.840" LastActivityDate="2014-06-03T17:04:16.403" Title="The role of micro credit in finance" Tags="&lt;credit&gt;&lt;credit-risk&gt;&lt;mutual-fund&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11316" PostTypeId="2" ParentId="11311" CreationDate="2014-05-16T13:13:37.887" Score="2" Body="&lt;p&gt;A random process that is adapted to a filtration is measurable (ie X_t is F_t-measurable) but not necessarily a martingale. X_t is a martingale if E(X_t | F_s) = X_s for s &amp;lt; t.&lt;/p&gt;&#xA;" OwnerUserId="8072" LastActivityDate="2014-05-16T13:13:37.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11317" PostTypeId="2" ParentId="11311" CreationDate="2014-05-16T13:27:32.497" Score="1" Body="&lt;p&gt;For a stochastic process $\left(X_{t}\right)$ to be adopted to a filtration $\left(\mathcal{F}_{t}\right)_{t\in T}$ the random variable $X_{t}$ must be $\mathcal{F}_{t}$-measurable for each $t\in T$. A stochastic process is a collection of random variables $X_{t}$, indexed by some set $T$. Each random variable is a mapping from a probability space into a measurable space. A &lt;a href=&quot;http://en.wikipedia.org/wiki/Sigma-algebra&quot; rel=&quot;nofollow&quot;&gt;measurable space&lt;/a&gt; is a set together with a collection of subsets of this set which fulfill certain properties. This collection is called a $\sigma$-algebra. It is nearly the same as a &lt;a href=&quot;http://en.wikipedia.org/wiki/Topological_space&quot; rel=&quot;nofollow&quot;&gt;topology&lt;/a&gt;, but for a slight technical difference (countable vs finite intersection of sets belong to the collection). A topology is essentially a collection of open sets. For two topological space one can define a mapping from one into the other. If this function respects the openness of sets, i.e. the preimage of an open set is open, we say this mapping is &lt;em&gt;continuous&lt;/em&gt;. In much the same light a $\sigma$-algebra includes (sub)sets which are &lt;em&gt;measurable&lt;/em&gt;, i.e. it makes sense to give that subset a measure (a volume). &lt;a href=&quot;http://en.wikipedia.org/wiki/Measurable_function&quot; rel=&quot;nofollow&quot;&gt;Measurable functions&lt;/a&gt; are functions where the preimage of a measurable set is measurable. In Probability Theory we call a measurable function a &lt;em&gt;random variable&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a stochastic process is a collection of (different) random variables, i.e. measurable functions, a filtration is the sequence of the different $\sigma$-algebras of these random variables. So a stochastic process is adapted to a filtration, if this filtration makes every single random variable measurable according to its $\sigma$-algebra. &#xA;I hope this was not too technical. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand a &lt;a href=&quot;http://en.wikipedia.org/wiki/Martingale_%28probability_theory%29&quot; rel=&quot;nofollow&quot;&gt;martingale&lt;/a&gt; is a stochastic process with the martingale property:&#xA;$$&#xA;\textrm{for all}\space s,t\in T \textrm{ with } s\leq t\textrm{ it holds that }\mathbb{E}_{\mathbb{P}}\left[X_{t}\mid\mathcal{F}_{s}\right] = X_{s}\space\left(\mathbb{P}\textrm{-almost surely}\right)&#xA;$$&#xA;This defining property depends on the probability measure $\mathbb{P}$ and the filtration $\left(\mathcal{F}_{t}\right)$. So a stochastic process is only a martingale &lt;em&gt;with respect to a filtration $\left(\mathcal{F}_{t}\right)$ and a probability measure $\mathbb{P}$&lt;/em&gt; if it fulfills the martingale property. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the adapted filtration is a building block of the definition of a martingale. &lt;/p&gt;&#xA;" OwnerUserId="6980" LastEditorUserId="6980" LastEditDate="2014-05-18T08:59:36.257" LastActivityDate="2014-05-18T08:59:36.257" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="11318" PostTypeId="1" CreationDate="2014-05-16T14:03:24.403" Score="2" ViewCount="1039" Body="&lt;p&gt;I know that a lot of work has been done characterizing the first four moments of monthly hedge fund returns across a variety of fund types and strategies, and that work indicates that the higher moments are likely important.  See for example &lt;a href=&quot;http://www.frbatlanta.org/news/conferen/06fmc/06fmc_malkiel.pdf&quot; rel=&quot;nofollow&quot;&gt;Malkiel and Saha 2005&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However that information alone does not suggest any particular model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone seen an expansion of the normal density or any other type of distribution used to model hedge fund returns, either for Monte Carlo simulation or some other application?&lt;/p&gt;&#xA;" OwnerUserId="7891" LastEditorUserId="7891" LastEditDate="2014-05-16T15:43:34.147" LastActivityDate="2014-06-03T16:39:09.980" Title="How to model hedge fund returns?" Tags="&lt;distribution&gt;&lt;hedge-fund&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11319" PostTypeId="1" CreationDate="2014-05-16T14:30:02.410" Score="0" ViewCount="89" Body="&lt;p&gt;I'm going to participate in a game of making portfolios. The objective of the game is to make the portfolio with the bigger ROI over 16 weeks. Over each week every player can see the ROI of each player and the amount of investment instruments (equities) they used to get to that ROI over the week. Each player starts with the same amount of money and doesn't influence in anything the market. Does &lt;a href=&quot;http://en.wikipedia.org/wiki/Game_theory&quot; rel=&quot;nofollow&quot;&gt;game theory&lt;/a&gt; or any other theory suggest that I can win this game by &quot;mimicking&quot; the more successful portfolios? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was thinking of a traffic lane kind of theory but I'm not making bigger conclusions than that. Hope you guys can help me. By the way I'm a computer engineer and I'm a beginner in this area so if you could use common financial terms that would be of help. Thank you!&lt;/p&gt;&#xA;" OwnerUserId="7728" LastEditorUserId="848" LastEditDate="2014-06-03T16:40:58.087" LastActivityDate="2014-06-03T16:40:58.087" Title="Making portfolios better than others for a 16 week portfolio game?" Tags="&lt;portfolio-management&gt;&lt;modeling&gt;&lt;portfolio-selection&gt;&lt;game-theory&gt;&lt;game&gt;" AnswerCount="1" CommentCount="3" ClosedDate="2014-05-16T15:02:35.160" ContentLicense="CC BY-SA 3.0" />
  <row Id="11321" PostTypeId="2" ParentId="11319" CreationDate="2014-05-16T14:57:06.443" Score="2" Body="&lt;p&gt;These games are usually won by luck. &#xA;If there is no fee for buying stocks I'd diversify, i.e. buy many different stocks, to get stable returns. After some weeks you'll see which profit you'll need to beat. Depending on the rules if options are allowed you could invest in highly leveraged derivatives and hope you win. As there is no point not to try to win I only see gambling as a valid strategy. But you should not start too early, depending on the number of participants. If one of your gambles fails, it is nearly impossible to come back. &lt;/p&gt;&#xA;" OwnerUserId="6980" LastActivityDate="2014-05-16T14:57:06.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11322" PostTypeId="2" ParentId="11318" CreationDate="2014-05-16T15:03:23.847" Score="-1" Body="&lt;p&gt;I think the return distribution of a given hedge funds depends very much on its strategy. It can be well diversified (index-like return distribution, like gaussian with bigger tails) or it can basically have a strategy like some vanilla derivative (long/short call, put, straddle, butterfly). Depending on this the returns are convoluted with the payoff-function of the derivative the hedge funds strategy mimics. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess I'd try to classify hedge fund returns according to this. &lt;/p&gt;&#xA;" OwnerUserId="6980" LastActivityDate="2014-05-16T15:03:23.847" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11323" PostTypeId="1" CreationDate="2014-05-16T16:58:33.937" Score="2" ViewCount="255" Body="&lt;p&gt;I devised a pair trading strategy going long XXX and short B*YYY. B is the quantity of shares of YYY I need to short.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is I can’t go short on YYY, but there is an inverse ETF for YYY called ZZZ.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming that ZZZ is a good replicator of shorting YYY, how should I calculate the quantities I should buy for XXX and ZZZ to imitate the long/short trade?&lt;/p&gt;&#xA;" OwnerUserId="2257" LastActivityDate="2014-06-22T16:12:11.027" Title="Replicating the short part of a long-short trade using inverse ETFs" Tags="&lt;cointegration&gt;&lt;pairs-trading&gt;&lt;etf&gt;&lt;longshort&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11324" PostTypeId="2" ParentId="11318" CreationDate="2014-05-16T18:08:48.293" Score="2" Body="&lt;p&gt;I think modelling hedge fund returns is a very interesting yet demanding task. Your model will have to strike a balance between the tangibility of the model on the one hand and the possibility of parameter estimation on the other. Plus I think you will encounter hedge funds that resist all modelling attempts because there strategies are just too elusive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following very recent paper does a decent job in my opinion. They model hedge fund returns as a combination of factors (they use even investable ETFs to replicate the hedge fund returns) and estimate the parameters through a three step process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2411910&quot; rel=&quot;nofollow&quot;&gt;In Search of Missing Risk Factors: Hedge Fund Return Replication with ETFs&lt;/a&gt; by J. Duanmu, Y. Li and A. Malakhov (March 2014)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the abstract:&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Properly considering all potential risk factors through tradable&#xA;  liquid portfolios in the context of a risk based factor model is&#xA;  paramount to quantifying the benefits of investing in hedge funds. We&#xA;  attempt to span the space of potential risk factors with exchange&#xA;  traded funds (ETFs). We develop a methodology of hedge fund return&#xA;  replication with ETFs based on cluster analysis and LASSO factor&#xA;  selection that overcomes multicollinearity among ETFs and the data&#xA;  mining bias. We find that the overall out-of-sample accuracy of hedge&#xA;  fund replication with ETFs increases with the number of ETFs&#xA;  available. This is consistent with our interpretation of ETF returns&#xA;  as proxies to a multitude of alternative risk factors that could be&#xA;  driving hedge fund returns.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;We further consider portfolios of “cloneable” and “non-cloneable”&#xA;  hedge funds, defined as top and bottom in-sample R2 matches. We find&#xA;  superior risk-adjusted performance for “non-cloneable” funds, while&#xA;  “cloneable” funds fail to deliver significantly positive risk-adjusted&#xA;  performance. We conclude that our methodology provides value in both&#xA;  identifying skilled managers of “non-cloneable” hedge funds, and also&#xA;  successfully replicating out-of-sample returns that are due to&#xA;  alternative risk exposures of “cloneable” hedge funds, thus providing&#xA;  a transparent and liquid alternative to investors who may find these&#xA;  return patterns attractive.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can then also use the resultant model to feed it into a monte carlo simulation because it is then only a combination of (tradable) ETFs which can be modeled and estimated with greater ease. So you effectively broke the whole task down into simpler subtasks which is always a good strategy.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2014-05-16T18:08:48.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11325" PostTypeId="1" CreationDate="2014-05-16T19:08:37.887" Score="2" ViewCount="3701" Body="&lt;p&gt;I am trying to build out a probability of default model for a bond. Given the current price of a bond and the current risk free rate, I am trying to calculate the probability of default. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So assume a bullet bond with a 5 year maturity. Let say the coupons pay annually for simplicity and they pay out a 5% on a 100 par. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Y1   Y2  Y3  Y4  Y5&#xA; $5 $5 $5 $5 $105&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Let say there is a risk this bond default and we estimate the recoveries on the bond are 40 cents on the dollar. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So here are all the possible scenarios for this bond&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    $40  Default Yr1&#xA;    $5 $40 Default Yr2&#xA;    $5 $5 $40 Default Yr3&#xA;    $5 $5 $5 $40 Default Yr4&#xA;    $5 $5 $5 $5 $40 Default Yr5&#xA;    $5 $5 $5 $5 $105 No Default Yr5&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Lets call the value of the bond is V. So Given all these payoffs. The value of the bond should be the E(V), the expected value of all the possible payoffs. But what probability density should I use to weight the possible scenarios? I could assume that on any given year the probability Firm XYZ will default is 2%. Hence the probability the firm survives year 1 is 98%, the firm surivevs to year 2 is (98%)^2, year 3 (98%)^3, survives to year 4 (98%)^4, survives year 5 (98%)^2&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(.02)&#xA;(.98)(.02)&#xA;(.98) (.98)(.02)&#xA;(.98) (.98) (.98)(.02)&#xA;(.98) (.98) (.98) (.98)(.02)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But obviously these probability do not produce a pdf because they do not sum to 1. Obviously the probabilities listed above do not include all the real of possibilities and that is why? What should I be weighing by? Thank you for your help.&lt;/p&gt;&#xA;" OwnerUserId="4729" LastActivityDate="2014-06-22T23:46:38.980" Title="Implied Probability of Default from Bond Prices" Tags="&lt;default-risk&gt;&lt;default-probability&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11326" PostTypeId="2" ParentId="11224" CreationDate="2014-05-16T20:24:39.660" Score="2" Body="&lt;p&gt;There is also &lt;a href=&quot;http://ibconnector.com/&quot; rel=&quot;nofollow&quot;&gt;http://ibconnector.com/&lt;/a&gt;, which is free, afaik, and an alternative to IBrokers. I've worked with it before and for basic orders, it was very fast and reliable.&lt;/p&gt;&#xA;" OwnerUserId="1988" LastActivityDate="2014-05-16T20:24:39.660" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11327" PostTypeId="1" CreationDate="2014-05-17T00:28:48.033" Score="1" ViewCount="1738" Body="&lt;p&gt;Given that $P(0,T)=e^{-RT}$, how does one get the formula for the instantaneous forward rate below? Specifically, how does one get to the partial derivative in the formula?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm sure the answer is obvious but I haven't been over my calculus in a while.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Z8Dcf.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2812" LastActivityDate="2014-05-17T02:11:17.880" Title="Derive instantaneous forward rate" Tags="&lt;interest-rates&gt;&lt;forward-rate&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11328" PostTypeId="2" ParentId="11295" CreationDate="2014-05-17T01:28:14.987" Score="2" Body="&lt;p&gt;Basically you have two equations as follows:&#xA;-Regression:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R_i = α + β \cdot R_m + e_i$$&#xA;-CAPM equation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E(R_i) = r_f + β\left[E(R_m) - r_f\right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In CAPM sense, there is no α . It only exists as idiosyncratic return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You would need lot more than one year of data to estimate the coefficients for regression. You can check p-values to see if the coefficients are significant ie less than or equal to .05. Since you will be doing the multivariate OLS your data requirement will increase even more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually your portfolio consisting of equal weights of securities can mislead thinking. Remember there is diversification effects in a portfolio; portfolio volatility will be smaller, beta of the portfolio will also change. This will lead to a different alpha at the portfolio level. In other words, you cannot just average the alpha of assets to get portfolio alpha.&lt;/p&gt;&#xA;" OwnerUserId="8076" LastEditorUserId="8076" LastEditDate="2014-05-17T19:05:41.683" LastActivityDate="2014-05-17T19:05:41.683" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11329" PostTypeId="2" ParentId="11327" CreationDate="2014-05-17T01:35:29.420" Score="3" Body="&lt;p&gt;You can start with &#xA;$$P(t,T)=exp({-\int_t^T f_t(u).du})$$&#xA;then take derivative wrt to T&#xA;$$R_F(0,T)=f_0(T)=-\frac{\partial} {\partial T}{ ln(P(0,T))} $$&lt;/p&gt;&#xA;" OwnerUserId="8076" LastEditorUserId="8076" LastEditDate="2014-05-17T02:11:17.880" LastActivityDate="2014-05-17T02:11:17.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11331" PostTypeId="1" AcceptedAnswerId="11334" CreationDate="2014-05-17T03:50:41.793" Score="1" ViewCount="495" Body="&lt;p&gt;Can someone explain how to get equation 27.14 below? I understand the first usage of Ito's Lemma to get $d(\ln f-\ln g)$ but I do not understand how to use Ito's Lemma to go from $d(\ln \frac{f}{g})$ to $d(\frac{f}{g})$. Can someone help to elucidate this process?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/gtOiI.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2812" LastActivityDate="2014-05-17T15:19:41.697" Title="How to derive equivalent martingale measure using Ito's Lemma" Tags="&lt;martingale&gt;&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11333" PostTypeId="1" CreationDate="2014-05-17T08:31:49.963" Score="0" ViewCount="1533" Body="&lt;p&gt;I want to find the price of Zero coupon bond given a short rate model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think about Merton, Vasiceck, CIR, Ho &amp;amp; Lee models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Given a simulation of $r_t$ how can I calculate $ P(t,T) = \mathbb{E}^Q\left[\left. \exp{\left(-\int_t^T r_s\, ds\right) } \right| \mathcal{F}_t \right] $ ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the simulations i think it would be easy to calculate the integral. But how to calculate the integral knowing $\mathcal{F}_t$ ? Am I supposed to find an expression of $r_s$ depending on $r_t$ ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) How to deal with the risk neutral probability here ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Would this approach still be ok with a time dependant model ? (Hull White) &#xA;Would this approach still be good with multiple factor model ? (Logstaff Schwartz)&lt;/p&gt;&#xA;" OwnerUserId="5052" LastEditorUserId="467" LastEditDate="2014-05-17T16:07:29.207" LastActivityDate="2014-06-16T16:22:58.557" Title="How to price zero coupon bonds with short term rates model?" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;short-rate&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="11334" PostTypeId="2" ParentId="11331" CreationDate="2014-05-17T08:36:36.397" Score="2" Body="&lt;p&gt;You have two processes, $X_t:=\log{\frac{f}{g}}$ and $Y_t=\frac{f}{g}$. Note, I use $\log$ for the natural logarithm. Hence we have $Y_t=\exp{(X_t)}$. Therefore, applying Itô:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dY_t=\exp{(X_t)}dX_t + \frac{1}{2}\exp{(X_t)}d\langle X,X\rangle_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the dynamics of $X_t$, we get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dY_t=\frac{f}{g}[-\frac{(\sigma_f-\sigma_g)^2}{2}dt+(\sigma_f-\sigma_g)dz]+\frac{f}{g}\frac{(\sigma_f-\sigma_g)^2}{2}d\langle z, z\rangle_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think $z$ is a Brownian Motion, such that $d\langle z,z\rangle_t=dt$, which yields the desired result. If $z$ is not a BM, please provide additional information.&lt;/p&gt;&#xA;" OwnerUserId="17133" LastEditorUserId="17133" LastEditDate="2014-05-17T15:19:41.697" LastActivityDate="2014-05-17T15:19:41.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11335" PostTypeId="2" ParentId="11180" CreationDate="2014-05-17T10:08:25.733" Score="1" Body="&lt;p&gt;Long story short, thanks to Dirk Eddelbuettel's suggestion I played a bit with rredis and indeed it offers quite a number interesting solutions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I still decided to start to write my own performance analytics library (albeit obviously smaller and more specific to my use case) in combination with an established Math/Stats library because I need more fine-grained performance attribution metrics, such as sliding lookback windows, custom distributional assumptions, different formulaic approach to measuring risk-adjusted returns for trades of extremely short holding periods...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having delved a bit more into parallel execution in R and understanding how to run several R sessions on a single machine or in distributed fashion explains why there is no real need/demand to equip a single R session with multithreaded capabilities. Credits to Dirk and his pointing me into the rredis and indirectly to the distributed workload processing direction in R. I so far heavily rely on a fully customized research platform and Matlab and thus have not done a whole lot with R. I left when R still could not handle larger datasets and when there was no 64-bit version available (at least not for Windows), which kind of defeated the whole purpose to peruse a statistical computing platform from the start (at least for someone working with larger time series data). Obviously, quite a number of things have changed and it is interesting to see the explosion in growth of use cases and packages such as adapters that connect R with various data stores, other libraries, languages, ...&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2014-05-17T10:58:05.700" LastActivityDate="2014-05-17T10:58:05.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11336" PostTypeId="1" AcceptedAnswerId="11376" CreationDate="2014-05-17T10:41:17.057" Score="0" ViewCount="624" Body="&lt;p&gt;I am interested in Quandl Open Data, from Quandl.com&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These data are also denoted as Wiki Data since it relies on users to flag errors. In particular on their &lt;a href=&quot;http://blog.quandl.com/blog/quandl-open-data&quot; rel=&quot;nofollow&quot;&gt;website&lt;/a&gt;, they say:   &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This new data source is different because it is “original”; the data is manufactured by us and Quandl users. The definitive version of the data actually lives on Quandl and not elsewhere. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Unfortunately it remains unclear how the term &quot;original&quot; should be intended, that is whether they buy data from exchanges and/or they compare and transform other free data sources.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since these data has a straightforward API, many quants here might find it a viable testbed, to validate some code or models before going in production and it is likely that the followers of this community are involved with these free historical data and can share their knowledge. &lt;/p&gt;&#xA;" OwnerUserId="3434" LastEditorUserId="3434" LastEditDate="2014-05-18T11:07:57.523" LastActivityDate="2014-05-21T08:44:35.280" Title="Source of Quandl Open Data" Tags="&lt;data&gt;&lt;market-data&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="11337" PostTypeId="2" ParentId="11333" CreationDate="2014-05-17T16:06:39.817" Score="2" Body="&lt;p&gt;If you do not know anything about the dynamics of you short-rate $r_t$, then there is no way to express the price of the zero coupon bond better than what your already have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ P(t,T) = \mathbb{E}^Q\left[\left. \exp{\left(-\int_t^T r_s\, ds\right) } \right| \mathcal{F}_t \right] $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use a model given in this &lt;a href=&quot;http://en.wikipedia.org/wiki/Short-rate_model&quot; rel=&quot;nofollow&quot;&gt;page&lt;/a&gt; where you should be able to find close formulas for the zero coupon bond, if available, in their respective wiki pages or in FI books.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2014-05-17T16:06:39.817" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11338" PostTypeId="2" ParentId="11295" CreationDate="2014-05-17T20:52:00.493" Score="1" Body="&lt;h3&gt;Error term&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The error term tells the difference between the theoretical and the observed values of the dependent variable. As such it is referred to the single observations. In  your equation, as you say, $i$  stands for the $i$-th share, therefore the meaning of $\varepsilon_i$ is unclear (as it can't be the $i$-th  observation) and the related equations too.  Perhaps you should add to the given equation(s) a second index, say $j$, related to the  $j$-th  observation.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;CAPM and alpha&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;There is a problem with your question in that the CAPM assumes alphas to be zeros.  Your claims is trivially true since the average of many zeros will still be zero, but perhaps this is not what you are looking for. &lt;/p&gt;&#xA;&#xA;&lt;h3&gt;CAPM test&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;CAPM assumptions can be violated, therefore one might want to test whether in actual markets the share alphas are zeros or not. When alphas are not zero, you may wonder what is the relation between their value with respect to a portfolio and its single constituents. &lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Portfolio alpha with a linear model&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Consider a generic linear model relating  a portfolio and the market  return in excess of the risk-free rate:&#xA;$$&#xA;r_{pj} -r_f = \alpha_p + \beta_p (r_{mj} -r_f ) + \varepsilon_{pj}&#xA;$$&#xA;where the equation is related to the  $j$-th observation of the portfolio and market excess return.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same model with respect to the $i$-th portfolio constituent is:&#xA;$$&#xA;r_{ij} -r_f = \alpha_i + \beta_i (r_{mj} -r_f ) + \varepsilon_{ij}&#xA;$$&#xA;The portfolio is equally weighted,  therefore (for each $j$-th observation) &#xA;\begin{align}&#xA;r_{pj}=\frac{1}{n}\sum_j^n r_{ij} \tag{*}\label{*} &#xA;\end{align}&#xA;By means of some statistical methods one can find the &lt;em&gt;estimated&lt;/em&gt; alphas and betas, that is the &quot;best&quot; $\alpha_*,  \beta_*$ to minimise  the $\varepsilon$-errors between theoretical and observed return values. This is normally found solving:&#xA;$$\min_{\alpha_i,\,\beta_i} \sum_{j=1}^n \hat{\varepsilon}_{ij}^{\,2} =&#xA;\min_{\alpha_i,\,\beta_i} \sum_{j=1}^n \left(&#xA;                     r_{ij} -r_f  -  \alpha_i - \beta_i (r_{mj} -r_f ) \right)&#xA;$$&#xA;and&#xA;$$\min_{\alpha_p,\,\beta_p} \sum_{j=1}^n \hat{\varepsilon}_{pj}^{\,2} =&#xA;\min_{\alpha_p,\,\beta_p} \sum_{j=1}^n \left(&#xA;                     r_{pj} -r_f  -  \alpha_p - \beta_p (r_{mj} -r_f ) \right)&#xA;$$&#xA;For a general linear model, $ y = \alpha + \beta x$, the solution (estimator) is known to be (see for example &lt;a href=&quot;http://en.wikipedia.org/wiki/Simple_linear_regression#Fitting_the_regression_line&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;):&#xA;\begin{align} \tag{**}\label{**} &#xA;\hat\beta = \frac{ \sum\limits_{j=1}^{N} (x_{j}-\bar{x})(y_{j}-\bar{y}) }{ \sum\limits_{j=1}^{N} (x_{j}-\bar{x})^2 }&#xA;\end{align}&#xA;where  $\bar{*}$ is the sample mean, e.g. (replacing summation dummy to avoid name clash):&#xA;$$&#xA;\bar{x}=\frac{1}{N}\sum_h^N x_h&#xA;$$&#xA;Substituting to \eqref{**} our excess returns, with respect to the  $i$-th share beta, we get:&#xA;\begin{align}&#xA;\hat\beta_i &amp;amp;= &#xA;     \frac{ \sum\limits_{j=1}^{N} \left( r_{mj} -r_f - \frac{1}{N}\sum\limits_h^N (r_{mh} -r_f)  \right)&#xA;                         \left( r_{ij} -r_f - \frac{1}{N}\sum\limits_h^N (r_{ih} -r_f)  \right) }&#xA;          { \sum\limits_{j=1}^{N} \left( r_{mj} -r_f  -\frac{1}{N}\sum\limits_h^N (r_{mh} -r_f)  \right)^2 } \notag\\&#xA;     &amp;amp;=\frac{ \sum\limits_{j=1}^{N} \left( r_{mj}  - \frac{1}{N}\sum\limits_h^N r_{mh}   \right)&#xA;                         \left( r_{ij}  - \frac{1}{N}\sum\limits_h^N r_{ih}   \right) }&#xA;          { \sum\limits_{j=1}^{N} \left( r_{mj}  -\frac{1}{N}\sum\limits_h^N r_{mh}   \right)^2 } &#xA;\notag&#xA;\end{align}&#xA;As for the portfolio beta, we have:&#xA;\begin{align}&#xA;\hat\beta_p  &#xA;     &amp;amp;=\frac{ \sum\limits_{j=1}^{N} \left( r_{mj}  - \frac{1}{N}\sum\limits_h^N r_{mh}   \right)&#xA;                         \left( r_{pj}  - \frac{1}{N}\sum\limits_h^N r_{ph}   \right) }&#xA;          { \sum\limits_{j=1}^{N} \left( r_{mj}  -\frac{1}{N}\sum\limits_h^N r_{mh}   \right)^2 } &#xA;\notag&#xA;\end{align}&#xA;Replacing the portfolio return definition from \eqref{*}, we obtain:&#xA;\begin{align}&#xA;\hat\beta_p  &#xA;     &amp;amp;=\frac{ \sum\limits_{j=1}^{N} \left( r_{mj}  - \frac{1}{N}\sum\limits_h^N r_{mh}   \right)&#xA;             \left( \frac{1}{n}\sum\limits_i^n r_{ij} &#xA;               -\frac{1}{N}\sum\limits_h^N \frac{1}{n}\sum\limits_i^n r_{ih} \right) }&#xA;          { \sum\limits_{j=1}^{N} \left( r_{mj}  -\frac{1}{N}\sum\limits_h^N r_{mh}   \right)^2 } &#xA;\notag\\&#xA;     &amp;amp;=\frac{ \sum\limits_{j=1}^{N} \left( r_{mj}  - \frac{1}{N}\sum\limits_h^N r_{mh}   \right)&#xA;             \frac{1}{n}\sum\limits_i^n \left(  r_{ij} &#xA;               -\frac{1}{N}\sum\limits_h^N  r_{ih} \right) }&#xA;          { \sum\limits_{j=1}^{N} \left( r_{mj}  -\frac{1}{N}\sum\limits_h^N r_{mh}   \right)^2 } &#xA;\notag\\&#xA;     &amp;amp;=   \frac{1}{n}\sum\limits_i^n &#xA;\frac{ \sum\limits_{j=1}^{N} \left( r_{mj}  - \frac{1}{N}\sum\limits_h^N r_{mh}   \right)&#xA;           \left(  r_{ij}   -\frac{1}{N}\sum\limits_h^N  r_{ih} \right) }&#xA;          { \sum\limits_{j=1}^{N} \left( r_{mj}  -\frac{1}{N}\sum\limits_h^N r_{mh}   \right)^2 } =&#xA;          \frac{1}{n}\sum\limits_i^n  \hat\beta_i \notag&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for alpha the general estimator, this is:&#xA;$$&#xA; \hat\alpha  = \bar{y} - \hat\beta\,\bar{x}&#xA;$$&#xA;Therefore:&#xA;$$&#xA; \hat\alpha_i  = \frac{1}{N}\sum\limits_h^N (r_{ih} -r_f) - \hat\beta_i\,\frac{1}{N}\sum\limits_h^N (r_{mh} -r_f)&#xA;$$&#xA;and&#xA;$$&#xA; \hat\alpha_p  = \frac{1}{N}\sum\limits_h^N (r_{ph} -r_f) - \hat\beta_p\, \frac{1}{N}\sum\limits_h^N (r_{mh} -r_f)&#xA;$$&#xA;Replacing the portfolio  return definition from \eqref{*}:&#xA;\begin{align}&#xA; \hat\alpha_p  &amp;amp;= \frac{1}{N}\sum\limits_h^N \left(\frac{1}{n}\sum\limits_i^n r_{ih}  -r_f\right) &#xA;- \frac{1}{n}\sum\limits_i^n  \hat\beta_i          \frac{1}{N}\sum\limits_h^N (r_{mh} -r_f) \notag\\&#xA; &amp;amp;= \frac{1}{N}\sum\limits_h^N \frac{1}{n}\sum\limits_i^n \left( r_{ih}  -r_f\right) &#xA;- \frac{1}{n}\sum\limits_i^n  \hat\beta_i          \frac{1}{N}\sum\limits_h^N (r_{mh} -r_f) \notag\\&#xA; &amp;amp;= \frac{1}{n}\sum\limits_i^n  \left( \frac{1}{N}\sum\limits_h^N  ( r_{ih}  -r_f ) &#xA;-  \hat\beta_i         \frac{1}{N}\sum\limits_h^N (r_{mh} -r_f)\right) &#xA; = \frac{1}{n}\sum\limits_i^n   \hat\alpha_i&#xA;\notag&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is just to give you a general idea of the problem. &lt;/p&gt;&#xA;" OwnerUserId="3434" LastEditorUserId="3434" LastEditDate="2014-05-17T20:59:20.797" LastActivityDate="2014-05-17T20:59:20.797" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11340" PostTypeId="1" AcceptedAnswerId="11341" CreationDate="2014-05-17T22:01:41.560" Score="3" ViewCount="473" Body="&lt;p&gt;What is the best way (most common) to discover if a stock is trending or not? (Despite drawing a line). A hurst exponent? A linear regression maybe? &lt;/p&gt;&#xA;" OwnerUserId="8081" LastEditorUserId="2587" LastEditDate="2014-05-20T07:13:10.390" LastActivityDate="2014-05-20T15:02:32.257" Title="Trend estimation techniques" Tags="&lt;equities&gt;&lt;programming&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11341" PostTypeId="2" ParentId="11340" CreationDate="2014-05-17T22:08:24.747" Score="0" Body="&lt;p&gt;See the average directional movement index (ADX):-&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;At its most basic the Average Directional Index (ADX) can be used to&#xA;  determine if a security is trending or not.&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://stockcharts.com/school/doku.php?id=chart_school%3atechnical_indicators%3aaverage_directional_#trend_strength&quot; rel=&quot;nofollow&quot;&gt;http://stockcharts.com/school/doku.php?id=chart_school%3atechnical_indicators%3aaverage_directional_#trend_strength&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's easy to calculate.  There is an example spreadsheet on the link page.&lt;/p&gt;&#xA;" OwnerUserId="7178" LastEditorUserId="7178" LastEditDate="2014-05-17T23:22:31.037" LastActivityDate="2014-05-17T23:22:31.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11342" PostTypeId="2" ParentId="11311" CreationDate="2014-05-18T03:12:45.440" Score="5" Body="&lt;p&gt;Let's consider a random process $X$.  If $X$ is an adapted process, then we know, without any uncertainty, what its value is at the present time.  This idea is formalized with measure theory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For $X$ to be a martingale, it needs to have the following property: at any given time, our best estimate of the value at some point in the future (i.e. forecast), is the present value.   In other words, the present and previous values never make us believe there's a local trend in time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Implicit in this belief is the idea that we know what the present value is.  In other words, every martingale is necessarily adapted for the concept to make sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Examples: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Let $Y_t = t$ be deterministic and increasing.  It is adapted but not a martingale.  This is the only real counterexample, since martingale implies adapted.  But one other.&lt;/li&gt;&#xA;&lt;li&gt;Let $\Omega = \{a,b\}$.  let $t \in [0,1,2]$, and let $Y_0 = 0, Y_1(a) = 1, Y_2(a) = 0, Y_1(b) = -1, Y_2(b) = 0$.  Let the filtration be the one generated by $Y$, so that $Y$ is by default adapted.  But, $Y$ is not a martingale.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3415" LastActivityDate="2014-05-18T03:12:45.440" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11346" PostTypeId="1" CreationDate="2014-05-18T11:54:34.523" Score="2" ViewCount="115" Body="&lt;p&gt;Actually I want to add volume traded of a stock in my Garch(1,1) model to forecast the volatility.In Matlab I can specify the model as garch(1,1) and then use estimate and forecast commands.But I am not sure how to specify my volume augmented garch(1,1) model in Matlab.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help on this would be very appreciated.&lt;/p&gt;&#xA;" OwnerUserId="8089" LastActivityDate="2014-05-18T11:54:34.523" Title="volume augmented garch(1,1) model in matlab" Tags="&lt;risk&gt;&lt;garch&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11347" PostTypeId="1" CreationDate="2014-05-18T13:30:11.710" Score="0" ViewCount="2194" Body="&lt;p&gt;My firm is looking for an out-of-the-box database system to store and query high-frequency tick data. What are the best options? It seems that kdb+ is the market leader in this field.&lt;/p&gt;&#xA;" OwnerUserId="8090" LastActivityDate="2014-05-20T03:18:26.603" Title="Databases for storing and querying high frequency tick-level data?" Tags="&lt;data&gt;&lt;database&gt;" AnswerCount="3" CommentCount="6" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11348" PostTypeId="2" ParentId="1424" CreationDate="2014-05-19T03:10:20.807" Score="0" Body="&lt;p&gt;A few companies offer data for redistribution at more reasonable prices than directly from the exchange.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few years back I worked on a project for an online service and they chose &lt;a href=&quot;http://quotemedia.com/&quot; rel=&quot;nofollow&quot;&gt;QuoteMedia&lt;/a&gt; for their back-end feed.&lt;/p&gt;&#xA;" OwnerUserId="8094" LastActivityDate="2014-05-19T03:10:20.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11349" PostTypeId="2" ParentId="10153" CreationDate="2014-05-19T05:02:17.193" Score="2" Body="&lt;p&gt;First lets analyse the claim that $\frac{(S_t - F(t,T)}{S_{0}}$ is a martingale under a given risk neutral measure $P^{*}$. Recall that the crucial property of a martingale is that at some point in time $t$, a process $\tilde{S}_{t}$ is a martingale iff for some time $t+\Delta$, the expected value of $\tilde{S}_{t+\Delta}$ is $S_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So lets start, assume we have a filteration denoted by $I_t$ -- here intuitively $I_t$ corresponds to information that we have at time $t$ in our probability space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\tilde{S}_{t} = \frac{(S_{t+\Delta} - F(t+\Delta,T)}{S_{0}}$. Now lets take the expected value of this process with respect to the information we have at time $t$.&#xA;\begin{equation}&#xA;E_{P^{*}}(\tilde{S}_{t+\Delta}|I_{t})  = E_{P^{*}}(\frac{S_{t+\Delta} - F(t+\Delta,T)}{S_{0}})\ldots(1)&#xA;\end{equation}&#xA;If we assume that the return on stock price is a weiner process, then using the linearity property of expectations we have that,&#xA;\begin{equation}&#xA;E_{P^{*}}(S_{t+\Delta}/S_{0}) = S_{t}.&#xA;\end{equation}&#xA;Similarly, under the risk neutral probability measure we have that  $F(t+\Delta ,T) = F(t,T)$ -- this is by definition of the risk neutral forward price for time $[t,T]$.&#xA;If we substitute this into the equation (1) we get that, &#xA;\begin{equation}&#xA;E_{P^{*}}(\tilde{S}_{t+\Delta}|I_{t}) = \tilde{S}_{t}.&#xA;\end{equation}&#xA;This proves the desired result -- the process $\tilde{S}_t$ is a martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To see what this really means, lets analyse what $\tilde{S}_{t}$ comprises of. In particular $\tilde{S}_{t}$ comprises of stock and bonds. Using your notation here, we are long a single stock given by $S_t$ and short a bond with yield $F(t,T)$. If this portfolio replicates the payout of the derivative security, as we say it does, then the expected price of the security at time $t+\Delta$ is the price of the portfolio at time $t$ -- this is because of the martingale property proved above. In fact more is true. Since we are pricing this under a risk neutral measure, we can also say that this expected price is in fact the arbitrage free price of the portfolio, and hence the arbitrage price of the underlying security.&lt;/p&gt;&#xA;" OwnerUserId="7772" LastEditorUserId="7772" LastEditDate="2014-05-19T05:25:21.207" LastActivityDate="2014-05-19T05:25:21.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11350" PostTypeId="2" ParentId="11347" CreationDate="2014-05-19T07:47:22.897" Score="2" Body="&lt;p&gt;An alternative is the &lt;a href=&quot;https://teafiles.codeplex.com/&quot; rel=&quot;nofollow&quot;&gt;TeaFiles file format&lt;/a&gt;. It's simple and boasts a high performance but I believe you'll have to reinvent some wheels.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2014-05-19T07:47:22.897" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11351" PostTypeId="2" ParentId="11347" CreationDate="2014-05-19T10:06:20.617" Score="1" Body="&lt;p&gt;kdb+ seems to be the leader but their programming language is a pain really. Personally I use a HDF5. It is a No-SQL database. It integrates very nicely with python.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been very happy with it so far.&lt;/p&gt;&#xA;" OwnerUserId="5819" LastActivityDate="2014-05-19T10:06:20.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11352" PostTypeId="2" ParentId="3746" CreationDate="2014-05-19T10:24:53.877" Score="4" Body="&lt;p&gt;In response to the original question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Drawdown optimization is a convex problem, see our recent article:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://ssrn.com/abstract=2430918&quot; rel=&quot;nofollow&quot;&gt;http://ssrn.com/abstract=2430918&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We do not address the issue of choosing a &quot;good&quot; risk model to feed the optimizer. However, even when using the history, drawdown does capture something that volatility and expected shortfall do not account for, namely path dependency (serial correlation). An initial analysis of the path dependency of drawdown is in the above article. The value added (if any) by optimizing drawdown rather than variance or shortfall is a project we are currently working on.&lt;/p&gt;&#xA;" OwnerUserId="8096" LastActivityDate="2014-05-19T10:24:53.877" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11353" PostTypeId="1" CreationDate="2014-05-19T10:56:07.480" Score="3" ViewCount="546" Body="&lt;p&gt;Non-maturing deposits (NMD) is a deposit without maturity date. The deposit rate is normally low. Banks could adjust the rate at any time. The customer can withdraw without penalty, however, in real life, the deposit is observed to be &quot;sticky&quot; when LIBOR rate changes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, how shall such NMD amount be modeled for Fund Transfer Pricing (FTP) purpose?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FTP measures the performance of a unit. If the internal funding cost is set as 3 months LIBOR rate, and deposit department could encourage people to put 3 months fixed deposit with (LIBOR rate - 1%) rate, their performance is 1%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's a &quot;Stable - Floating parts model&quot; for the NMD deposits: The NMD is divided into 2 parts, a Stable Part, considered as &quot;core balance&quot; and a Floating Part as &quot;non-core balance&quot;. The Floating Part is seen as volatile and assumed a very short maturity, e.g. 1 month; while the Stable Part is assigned a longer maturity, e.g. 1 year, and each month, 1/12 of the core part would be considered re-priced.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The assumptions seem too arbitrary to me: why the Floating Part is assumed to be withdrawn in 1 month's time? Why the Stable Part is estimated to run-off in 1 year? And how to decide each part has how big a portion? In real life the NMD amount keep rising, we can't observe a &quot;real&quot; withdraw.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm a bit lost now, any ideas please?&lt;/p&gt;&#xA;" OwnerUserId="2161" LastEditorUserId="2161" LastEditDate="2014-05-29T10:41:07.197" LastActivityDate="2014-05-29T10:41:54.573" Title="&quot;Stable-Floating&quot; model for non-maturing deposit for FTP purpose" Tags="&lt;modeling&gt;&lt;pricing&gt;&lt;ftp&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11356" PostTypeId="1" CreationDate="2014-05-19T14:52:53.300" Score="3" ViewCount="413" Body="&lt;p&gt;Recently I've tried SciChart and VisiBlox - beautiful charting tools. Are there any free or open-source tools for visualizing charts in C#?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for answers.&lt;/p&gt;&#xA;" OwnerUserId="3092" LastEditorUserId="35" LastEditDate="2020-05-25T18:58:56.753" LastActivityDate="2020-06-24T20:07:41.017" Title="What are some popular free/open-source charting controls?" Tags="&lt;programming&gt;&lt;charts&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="11357" PostTypeId="1" CreationDate="2014-05-19T19:53:07.273" Score="1" ViewCount="395" Body="&lt;p&gt;I'm about to embark on training a neural network on daily forex data, with a view to obtaining a predictive network. I'm also interested in using data other than the forex currency pair data itself, in a manner similar to intermarket analysis. What other time series data does the panel think will provide meaningful input? Obviously, various other forex cross rates are important, along with perhaps interest rate time series. But what about perhaps less intuitively obvious time series? I'm more interested in time series that have a justifiably fundamental reason for inclusion rather than those that might simply exhibit historical correlation. Links to online references/papers, e.g. SSRN etc. would be very welcome.   &lt;/p&gt;&#xA;" OwnerUserId="252" LastActivityDate="2015-04-23T12:56:49.913" Title="Intermarket analysis - related time series?" Tags="&lt;time-series&gt;&lt;fx&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11358" PostTypeId="2" ParentId="10153" CreationDate="2014-05-19T19:59:50.543" Score="5" Body="&lt;p&gt;For the buyer of a forward contract the payoff is $S_T - K$ at time $T$ since at this date he pays $K$ and gets the underlying in exchange. Consider the following strategy: buy the stock $S$ and sell $K$ zero-coupon bonds with maturity $T$. At any time $t$, your portfolio's value is &#xA;$$&#xA;  \Pi_t = S_t - KB(t,T)&#xA;$$ &#xA;In particular at time $T$, it is $S_T - KB(T,T) = S_T - K$ the price of our forward contract so by abscence of arbitrage the forward contract must have the same value as our portfolio at each $t \leq T$ (otherwise you could buy the cheaper one, sell the other, invest the difference at the risk free rate and make almost surely a profit at time $T$).&lt;br&gt;&#xA;$$&#xA;  Forward_t = S_t - KB(t,T)&#xA;$$&#xA;By definition the $T$-forward price $F_t^T$ is the &quot;fair strike&quot; $K$ set at $t$ so that the value at $t$ of the forward contract is zero. Clearly we must set&lt;br&gt;&#xA;$$&#xA;  K = F_t^T = \frac{S_t}{B(t,T)}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's take a look at the martingale approach. Just like for any contingent claim we have the martingale property&#xA;$$&#xA;  \frac{Forward_t}{S^0_t} =  E^*[ \frac{Forward_T}{S^0_T} | \mathcal{F}_t ] =  E^*[ \frac{S_T - K}{S^0_T} | \mathcal{F}_t ] &#xA;$$&#xA;which is another way of saying we have the pricing formula &#xA;$$&#xA;  Forward_t = S^0_t E^*[ \frac{S_T - K}{S^0_T} | \mathcal{F}_t ] = E^*[e^{-\int_t^T r_s ds}(S_T -K) | \mathcal{F}_t  ] &#xA;$$&#xA;Separating the $S$ and $K$ parts we get&#xA;$$&#xA;  Forward_t = S^0_t E^*[ \frac{S_T}{S^0_T} | \mathcal{F}_t ] -  KS^0_t E^*[ \frac{1}{S^0_T} | \mathcal{F}_t ] = S_t - K B(t,T)&#xA;$$&#xA;The last equality follows &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;for the first term from the fact that $\frac{S}{S^0}$ is a martingale: $E^*[ \frac{S_T}{S^0_T} | \mathcal{F}_t ]  = \frac{S_t}{S^0_t} $ (we assume $S$ pays no dividend).&lt;/li&gt;&#xA;&lt;li&gt;for the second term from the definition of $B(t,T)$ as the price of a contract that pays 1 at time $T$. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And once again we find that $T$-forward price of $S$ at time $t$ is &#xA;$$&#xA;  F_t^T = \frac{S_t}{B(t,T)}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that it is not true that the formula &quot;has to be&quot;&#xA;$$&#xA;0=E^{*}\left(\frac{S^1_T - F(T,T)}{S^0_T}\bigg|\mathscr{F}_t\right)&#xA;$$&#xA;Just because its (conditional) expectation has to be zero doesn't mean the random variable has to be zero! Obviously the $T$-forward price at time $T$ is $F(T,T) = S_T$ but at $t &amp;lt; T$ the forward price $F_t^T$ is higher than the spot price $S_t$ and it can be higher or lower than what $S_T$ will eventually be. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope that helps. &lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2014-05-20T22:37:19.260" LastActivityDate="2014-05-20T22:37:19.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11359" PostTypeId="1" CreationDate="2014-05-19T22:28:10.367" Score="1" ViewCount="8225" Body="&lt;p&gt;For a particular stock, what's the simplest way to calculate betas for the Fama-French factors SMB and HML?&lt;/p&gt;&#xA;" OwnerUserId="5251" LastActivityDate="2015-07-30T11:45:02.707" Title="How can I calculate Fama-French betas for a particular stock?" Tags="&lt;beta&gt;&lt;factor-models&gt;&lt;factor-loading&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11361" PostTypeId="2" ParentId="11347" CreationDate="2014-05-20T03:18:26.603" Score="0" Body="&lt;p&gt;velocity analytics might be a choice.&lt;/p&gt;&#xA;" OwnerUserId="8102" LastActivityDate="2014-05-20T03:18:26.603" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11362" PostTypeId="2" ParentId="11359" CreationDate="2014-05-20T07:06:13.187" Score="3" Body="&lt;p&gt;Not sure what the question is.&#xA;As John points out: the method is linear regression. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the data you could look at Kenneth &lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html#HistBenchmarks&quot; rel=&quot;nofollow&quot;&gt;French's wegpage&lt;/a&gt;&#xA;for US stocks. &#xA;In the wikipedia &lt;a href=&quot;http://en.wikipedia.org/wiki/Fama%E2%80%93French_three-factor_model&quot; rel=&quot;nofollow&quot;&gt;article&lt;/a&gt; you find the links to factors for other countries (UK, Germny, Switzerland) - though I have not checked these links.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note however that the Fama-French model works better for portfolios than for individual stocks.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-05-20T07:06:13.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11363" PostTypeId="2" ParentId="11340" CreationDate="2014-05-20T07:19:25.397" Score="1" Body="&lt;p&gt;As in the answer by Chris Degen, various technical indicators for trend estimation exist (just to mention one additional: the moving average and moving average cross over).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;a href=&quot;https://www.otexts.org/fpp&quot; rel=&quot;nofollow&quot;&gt;this free ebook&lt;/a&gt; by Rob Hyndman and George Athana­sopou­los present various time series techniques for forecasting. These are ARIMA models and exponential smoothing methods. They can be used to estimate a trend in time series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But be careful if I remember correctly then they state that stock prices are hard to forecast (if not impossible).&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2014-05-20T15:02:32.257" LastActivityDate="2014-05-20T15:02:32.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11364" PostTypeId="1" CreationDate="2014-05-20T08:15:43.737" Score="3" ViewCount="442" Body="&lt;p&gt;I would like to know which formula to use in order to optimize a portfolio based on highest Treynor and Jensens Alpha. I am aware that usually one optimize a portfolio by highest Sharpe ratio (the tangency portfolio) by following formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\textbf{w}_{tan} = \frac{1}{(\boldsymbol{\mu}^e)^\top\boldsymbol{\Sigma}^{-1}\textbf{1}}\boldsymbol{\Sigma}^{-1}\boldsymbol{\mu}^e.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which formula can I use to maximize Treynor or Jensens Alpha, or do I need to create a maximization problem?&lt;/p&gt;&#xA;" OwnerUserId="8104" LastActivityDate="2014-05-24T00:01:15.057" Title="Create optimal portfolio by Treynor and Jensens Alpha" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio-selection&gt;&lt;performance-evaluation&gt;&lt;portfolio-optimization&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11366" PostTypeId="2" ParentId="11364" CreationDate="2014-05-20T12:36:25.577" Score="5" Body="&lt;p&gt;This optimization is trivial&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;w^{T,J}_i = \begin{cases} 1 \quad \text{if } i=\arg \max_i R^{T,J}(S_i) \\0 \quad \text{otherwise} \end{cases}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is to say, when you optimize only one weight will be nonzero.  That's because these ratios incorporate no notion of distributional width, and therefore do not reward diversification.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With no concentration penalty, they will simply put all their weight on the most &quot;attractive&quot; asset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally, if you take any quantitative attribute $a$ of a stock, and apply it as a whole to the portfolio by summing it over the entire collection, you get exposure&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;a_\bf{w}=\bf{w}^*\bf{a}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To achieve unit exposure to this attribute while minimizing variance, you optimize (using Lagrange multipliers), obtaining &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\bf{w}_a=\frac{\bf{\Sigma}^{-1}\bf{a}}{\bf{a}^*\bf{\Sigma}^{-1}\bf{a}}&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2014-05-24T00:01:15.057" LastActivityDate="2014-05-24T00:01:15.057" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11369" PostTypeId="2" ParentId="11270" CreationDate="2014-05-20T16:46:38.370" Score="2" Body="&lt;p&gt;You can buy data directly from every exchange I've looked at. LSE sells data as well &lt;a href=&quot;http://www.londonstockexchange.com/products-and-services/reference-data/reference-data.htm&quot; rel=&quot;nofollow&quot;&gt;right here on their webpage&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sounds like you're looking for their &lt;a href=&quot;http://www.londonstockexchange.com/products-and-services/reference-data/trade/trade-data.htm&quot; rel=&quot;nofollow&quot;&gt;Trade Data&lt;/a&gt; product which includes order book information: &quot;Provides an end-of-day download file of the day's Order Book activity, including all trades, orders and deletions in Order Book securities since October 1997...&quot;&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2014-05-20T16:46:38.370" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11370" PostTypeId="1" AcceptedAnswerId="11371" CreationDate="2014-05-20T18:28:48.193" Score="3" ViewCount="221" Body="&lt;p&gt;When doing the PCA analysis, you end up with eigenvalues which are ordered by how much variance they explained for each eigenvector. Say, the eigenvectors since they are orthogonal, do not represent the reality - I want to stick with the original factors only, but determine which are the most important and which add up to providing, say, 90% of the variance?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, is Jacobian rotation more conducive to finding dominant original factors?&lt;/p&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="7867" LastEditDate="2014-05-20T18:59:05.530" LastActivityDate="2014-05-20T23:36:35.083" Title="After PCA on original factors, how to tell which original factors are dominant?" Tags="&lt;pca&gt;&lt;factor-loading&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11371" PostTypeId="2" ParentId="11370" CreationDate="2014-05-20T23:36:35.083" Score="2" Body="&lt;p&gt;When I use PCA, I follow a few typical steps. First, I would apply PCA to the covariance matrix, I would then designate certain eigenvalues as dominant or significant (such as by those that contribute up to $x\%$ of variance or by RMT), and then I would identify the eigenvectors that match up with those significant eigenvalues. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think you're with me at this point. It appears you want to know how to determine which of the inputs to the covariance matrix match up with the eigenvectors (i.e. how much does year $Y$ contribute to eigenvalue $N$, in your example). One way to make that determination is to square the eigenvector $N$. This squared eigenvector should sum up to $1$. Thus, you can consider each of these squared values like a percent of contribution to the eigenvector (and thus the eigenvalues). For your example, you could plot these squared values against the years for each to get a sense of how it changes as you change eigenvectors.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2014-05-20T23:36:35.083" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11373" PostTypeId="1" CreationDate="2014-05-21T02:18:36.807" Score="3" ViewCount="4174" Body="&lt;p&gt;Does anyone know where I can find a list of all stocks traded on the NYSE in a table that also includes what sector they are in? I want to look at some data using info both from the individual stock and from the sector but I cannot find a comprehensive list containing both pieces of information.&lt;/p&gt;&#xA;" OwnerUserId="8110" LastActivityDate="2019-11-21T14:17:01.397" Title="List of Stocks by Sector" Tags="&lt;equities&gt;" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11376" PostTypeId="2" ParentId="11336" CreationDate="2014-05-21T08:44:35.280" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;data is sourced via users from brokers and then validated against free public sources.  There are many people watching and using the data, so if there are any differences between WIKI data and other sites, we usually discover very quickly and figure out what is going on&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Perhaps  the brokers sell data as part of the service so they wouldm't be happy to get their name published.&#xA;So the model is Wiki-like in the sense of user contributions, but not in the sense of disclosing &quot;quotations&quot;.&lt;/p&gt;&#xA;" OwnerUserId="3434" LastActivityDate="2014-05-21T08:44:35.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11377" PostTypeId="2" ParentId="11373" CreationDate="2014-05-21T09:28:42.207" Score="2" Body="&lt;p&gt;I just ran the &lt;em&gt;Mathematica&lt;/em&gt; code below to make a list of stocks and sectors you can access here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.dropbox.com/s/zkzpcnksvfygamp/nyse.xls&quot; rel=&quot;nofollow&quot;&gt;https://www.dropbox.com/s/zkzpcnksvfygamp/nyse.xls&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Mathematica&lt;/em&gt; uses curated data from Yahoo.  Items that lack sector information have been omitted.  The list may be incomplete but it might provide something for you to work with.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;members = FinancialData[&quot;NYSE&quot;, &quot;Members&quot;];&#xA;names = If[SameQ[Head[#], FinancialData], &quot;-&quot;, #] &amp;amp;@&#xA;     FinancialData[#, &quot;Name&quot;] &amp;amp; /@ members;&#xA;companies = If[SameQ[Head[#], FinancialData], &quot;-&quot;, #] &amp;amp;@&#xA;     FinancialData[#, &quot;Company&quot;] &amp;amp; /@ members;&#xA;sectors = If[SameQ[Head[#], FinancialData], &quot;-&quot;, #] &amp;amp;@&#xA;     FinancialData[#, &quot;Sector&quot;] &amp;amp; /@ members;&#xA;data = Transpose[{members, names, companies, sectors}];&#xA;data2 = DeleteCases[data, {_, _, _, Missing[&quot;NotAvailable&quot;] | &quot;-&quot;}];&#xA;data3 = SortBy[data2, Last];&#xA;Export[&quot;nyse.xls&quot;, &#xA;  Prepend[data3, {&quot;Symbol&quot;, &quot;Name&quot;, &quot;Company&quot;, &quot;Sector&quot;}]];&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7178" LastActivityDate="2014-05-21T09:28:42.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11378" PostTypeId="1" CreationDate="2014-05-21T09:58:56.970" Score="2" ViewCount="271" Body="&lt;p&gt;Is there a way to retrieve the implied correlation between stock price and zero coupon bonds?&lt;/p&gt;&#xA;" OwnerUserId="7649" LastActivityDate="2014-05-22T12:57:26.883" Title="Implied Correlation using market quotes" Tags="&lt;correlation&gt;&lt;bond&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11379" PostTypeId="2" ParentId="11274" CreationDate="2014-05-21T12:44:12.353" Score="4" Body="&lt;p&gt;Could it be a result of the fact that stocks get stickier as the market cap decreases? &#xA;Once the 2008/2009 exploded liquidity dried up in the small and micro-cap arena and bid/ask spreads prevented any trading.&#xA;This is also a consequence of the fact that in the small-micro-mid cap a larger share of the players have a buy-and-hold style.&lt;/p&gt;&#xA;" OwnerUserId="6781" LastActivityDate="2014-05-21T12:44:12.353" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11380" PostTypeId="2" ParentId="11378" CreationDate="2014-05-21T12:55:57.350" Score="2" Body="&lt;p&gt;as in the question about &lt;a href=&quot;https://quant.stackexchange.com/questions/8689/average-correlation-of-index-portfolio&quot;&gt;average/implied correlation&lt;/a&gt; to do this in a straight way (in a perfect world where all this were given) you would need: immplied vol for the stock, implied vol for the bond and implied vol for an option on a portfolio/basket that contains both assets. If you get a quote for the latter then this sounds possible. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have never seen an exchange traded product with a basket of stocks and bonds - so you would need something OTC. Using such OTC prices I would be careful do derive further conclusions.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2014-05-21T14:57:44.157" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11381" PostTypeId="2" ParentId="11373" CreationDate="2014-05-21T14:21:39.117" Score="0" Body="&lt;p&gt;Your best bet is to use the &lt;a href=&quot;http://finviz.com/screener.ashx&quot; rel=&quot;nofollow&quot;&gt;stock screener&lt;/a&gt; over at &lt;a href=&quot;http://finviz.com&quot; rel=&quot;nofollow&quot;&gt;FINVIZ&lt;/a&gt;. You can limit the results to NYSE listed stocks and can easily export to CSV using the &quot;export&quot; link at the bottom right of the table.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bear in mind, industry/sector classifications are no uniform. You'll find different classification methods depending on where you look. &lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2014-05-21T14:21:39.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11382" PostTypeId="1" AcceptedAnswerId="11384" CreationDate="2014-05-21T14:49:13.953" Score="0" ViewCount="319" Body="&lt;p&gt;What are the best sources to find free Forex historical Fundamental Data in a .csv format?&lt;/p&gt;&#xA;" OwnerUserId="8081" LastActivityDate="2014-05-21T16:34:20.417" Title="Forex Fundamental Data Sources" Tags="&lt;data&gt;&lt;fx&gt;&lt;csv&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2014-05-21T20:35:21.943" ContentLicense="CC BY-SA 3.0" />
  <row Id="11384" PostTypeId="2" ParentId="11382" CreationDate="2014-05-21T16:34:20.417" Score="0" Body="&lt;p&gt;You could try Integral True FX &lt;a href=&quot;http://www.truefx.com/?page=downloads&quot; rel=&quot;nofollow&quot;&gt;http://www.truefx.com/?page=downloads&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2014-05-21T16:34:20.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11388" PostTypeId="1" CreationDate="2014-05-22T02:57:25.330" Score="2" ViewCount="1460" Body="&lt;p&gt;What are the principal components? How they are calculated? What is their relationship with  eigenvalues and eigenvectors? This is a lead-in question to explain PCA basics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: PCA is implemented in many software packages. It has lots of parameters which cause problems if one does not have a clear idea of what to expect as output and which parameters one should use. This lead-in question gives you some test cases to try, double check your outputs, and other interesting relationships between eigenvectors and eigenvalues.&lt;/p&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="7867" LastEditDate="2014-06-13T20:21:54.210" LastActivityDate="2014-06-13T20:21:54.210" Title="What is PCA and how does it relate to eigenvectors and eigenvalues?" Tags="&lt;pca&gt;&lt;eigenvalue&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11389" PostTypeId="2" ParentId="11388" CreationDate="2014-05-22T02:57:54.187" Score="8" Body="&lt;p&gt;PCA(Principal Component Analysis) is the most interesting topic in QF. PCA is at the heart of quantitative data analysis. It is used in factor analysis, factor loadings, finding principal component of interest rate term structure for derivative and option pricing, data compression, eigenfaces( find the best match from a set of pictures with a , say,  fuzzy face), you name it. So it behooves one to understand the basics because it will help one to understand the more advance concepts in PCA calculations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope the answer and the thinking behind the logic is appealing and matches yours.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are many ways to do this. I am using SVD, Eigen decomposition, which will work with matrix A being positive semi-definite. RMT is a relatively new field. To cover the basics this is a good start. Normally eigenvectors and eigenvalues relationship is shown as &#xA;$$ A v = \lambda v $$&#xA;where $ v \space is \space eigenvector$ and $\lambda \space is \space eigenvalue $ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An interesting property of eigenvector is that is you multiply it with a scalar, and multiply with A on the left, you will find vector reproduce on the right side, with factor k, with same eigenvalues. ( Exercise).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mind you, it is a mistake to think that eigenvectors are same as principal components, however, they are related as shown below. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have a random dataset X as below, then what is principal component and how is data related to A matrix?&#xA;&lt;a href=&quot;http://matlabdatamining.blogspot.com/2010/02/principal-components-analysis.html&quot;&gt;Numerical example&lt;/a&gt; shows using MATLAB. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;X = [269.8 38.9 50.5&#xA;272.4 39.5 50.0&#xA;270.0 38.9 50.5&#xA;272.0 39.3 50.2&#xA;269.8 38.9 50.5&#xA;269.8 38.9 50.5&#xA;268.2 38.6 50.2&#xA;268.2 38.6 50.8&#xA;267.0 38.2 51.1&#xA;267.8 38.4 51.0&#xA;273.6 39.6 50.0&#xA;271.2 39.1 50.4&#xA;269.8 38.9 50.5&#xA;270.0 38.9 50.5&#xA;270.0 38.9 50.5&#xA;];&#xA;&#xA;[n m]=size(A)&#xA;&#xA;n =&#xA;    15&#xA;m =&#xA;     3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Let us convert X to zscores, we can  B=zscore(X) or for clarity&#xA;    B = (X - repmat(mean(X),[n 1])) ./ repmat(std(X),[n 1])&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;B =&#xA;   -0.0971   -0.0178    0.0636&#xA;    1.3591    1.5820   -1.5266&#xA;    0.0149   -0.0178    0.0636&#xA;    1.1351    1.0487   -0.8905&#xA;   -0.0971   -0.0178    0.0636&#xA;   -0.0971   -0.0178    0.0636&#xA;   -0.9932   -0.8177   -0.8905&#xA;   -0.9932   -0.8177    1.0178&#xA;   -1.6653   -1.8842    1.9719&#xA;   -1.2173   -1.3509    1.6539&#xA;    2.0312    1.8486   -1.5266&#xA;    0.6870    0.5155   -0.2544&#xA;   -0.0971   -0.0178    0.0636&#xA;    0.0149   -0.0178    0.0636&#xA;    0.0149   -0.0178    0.0636&#xA;&#xA;&amp;gt;    cov(B)&#xA;&#xA;ans =&#xA;&#xA;    1.0000    0.9902   -0.8433&#xA;    0.9902    1.0000   -0.8831&#xA;   -0.8433   -0.8831    1.0000&#xA;&#xA;&amp;gt;    corr(B)&#xA;&#xA;ans =&#xA;&#xA;    1.0000    0.9902   -0.8433&#xA;    0.9902    1.0000   -0.8831&#xA;   -0.8433   -0.8831    1.0000&#xA;&#xA;&amp;gt;    corr(X)&#xA;&#xA;ans =&#xA;&#xA;    1.0000    0.9902   -0.8433&#xA;    0.9902    1.0000   -0.8831&#xA;   -0.8433   -0.8831    1.0000&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Interesting Note: for standardized data mean=0, variance =1, &#xA;   $$A=cov(B)=corr(B)=corr(X)$$&#xA;However, note&#xA;$$ cov(B) &amp;lt;&amp;gt; cov(X) $$&#xA;Therefore be careful of how you calculate the covariance matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note here A used in beginning is the covariance matrix of standardized input.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Decomposing matrix A or cov(B) gives us eigenvectors V and eigenvalues D as below.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[V D]=eig(cov(B))&#xA;&#xA;V =&#xA;&#xA;    0.6505    0.4874   -0.5825&#xA;   -0.7507    0.2963   -0.5904&#xA;   -0.1152    0.8213    0.5587&#xA;&#xA;&#xA;D =&#xA;&#xA;    0.0066         0         0&#xA;         0    0.1809         0&#xA;         0         0    2.8125&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Interesting to note that B'*B gives you a matrix proportional to cov(B).&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;B'*B&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ans =&#xA;&#xA;   14.0000   13.8622  -11.8068&#xA;   13.8622   14.0000  -12.3640&#xA;  -11.8068  -12.3640   14.0000&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It is off by a factor of 14.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;B'*B/14&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ans =&#xA;&#xA;    1.0000    0.9902   -0.8433&#xA;    0.9902    1.0000   -0.8831&#xA;   -0.8433   -0.8831    1.0000&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Dividing by 14 gives you the covariance matrix , A or cov(B).&#xA;Why is this so. Because &lt;a href=&quot;http://www.encyclopediaofmath.org/index.php/Covariance_matrix&quot;&gt;Covariance estimator&lt;/a&gt; is given as: &#xA;$$ \frac{1}{n-1} \sum_{i=1}^{n} (X_i- \overline{X}) {(X_i- \overline{X})}'$$ &#xA;where $ \overline{X}=0 $&#xA;we get $$ Covariance matrix (estimator)=\frac{1}{n-1} B B' $$&#xA;That mystery is solved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note we can get matrix A or cov(B), also using Spectral Decomposition &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;V*D*V'&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ans =&#xA;&#xA;    1.0000    0.9902   -0.8433&#xA;    0.9902    1.0000   -0.8831&#xA;   -0.8433   -0.8831    1.0000&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Principal components are defined as scores in Matlab. We can get the principal components from eigenvalue&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;    score=B*V&#xA;&#xA;score =&#xA;&#xA;   -0.0571   -0.0003    0.1026&#xA;   -0.1277   -0.1226   -2.5786&#xA;    0.0157    0.0543    0.0373&#xA;    0.0536    0.1326   -1.7779&#xA;   -0.0571   -0.0003    0.1026&#xA;   -0.0571   -0.0003    0.1026&#xA;    0.0704   -1.4579    0.5637&#xA;   -0.1495    0.1095    1.6299&#xA;    0.1041    0.2496    3.1841&#xA;    0.0319    0.3647    2.4306&#xA;    0.1093    0.2840   -3.1275&#xA;    0.0892    0.2787   -0.8467&#xA;   -0.0571   -0.0003    0.1026&#xA;    0.0157    0.0543    0.0373&#xA;    0.0157    0.0543    0.0373&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We have three principal components above. Let us name them from left to right as PC1, PC2 and PC3. If you look at the eigenvectors last column you will see &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[-0.5825        -0.5904         0.5587]'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The way the score is obtained from matrix multiplication between B and V, you can see that PC3 consists of -58.25% of first factor (in B) , -59.04% of 2nd factor and 55.87% of 3rd factor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which one is the most dominant?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;    var(score)&#xA;&#xA;ans =&#xA;&#xA;    0.0066    0.1809    2.8125&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The right most vector, PC3, explains the most of the variance in the data X.&#xA;you can do&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;varB=sort(var(score),'descend')&#xA;      varB =&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   2.8125    0.1809    0.0066&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;cumsum(varB) / sum(varB)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ans =&#xA;&#xA;0.9375 0.9978 1.0000&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So the dominant principal component(PC3) explains 94% of the variance. If you are finding the principal component that explains the variance in data then PCA works fine. If you are using PCA for data that has other information content then you need something different. Also, covariance matrix can be skewed by the outliers, I find that interesting. What if I am only interested in outliers. Outliers could be representing the Black Swans?! Then may be you are interested in the least important PC. You can plot the scores and see how it matches the outlier data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One last thing, how do you get back the original data from score or principal components?&#xA;As I showed earlier&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;    B = (X - repmat(mean(X),[n 1])) ./ repmat(std(X),[n 1]) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;    X = (B  .* repmat(std(X),[n 1]) + repmat(mean(X),[n 1]))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which really is how we get X from B. How about the score?&#xA;We know score is B*V so B=score*V' because then B=B*V*V' and V*V'=1 or identity matrix.&#xA;therefore, &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;    X = (score*V'  .* repmat(std(X),[n 1]) + repmat(mean(X),[n 1]))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In pseudo equation form, PC: principal component &#xA;$$  original \space data = PC * eigenvector' * stdev(X) + mean $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have answered the following question in this&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;how to get eigenvectors, eigenvalues and PCA&lt;/li&gt;&#xA;&lt;li&gt;how to relate eigenvectors to PCA components&lt;/li&gt;&#xA;&lt;li&gt;determine which eigenvalues explain the most variance&lt;/li&gt;&#xA;&lt;li&gt;how much do the factors contribute to the principal component&lt;/li&gt;&#xA;&lt;li&gt;double check which principal component is dominant&lt;/li&gt;&#xA;&lt;li&gt;How to get the original data back&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="7867" LastEditDate="2014-05-22T09:11:08.477" LastActivityDate="2014-05-22T09:11:08.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11390" PostTypeId="2" ParentId="11274" CreationDate="2014-05-22T04:14:30.213" Score="3" Body="&lt;p&gt;\$VIX and \$RVX strongly correlated with market action. Therefore, I agree with @SelfTaght line  of reasoning to find the differentiating factor.  &lt;a href=&quot;http://www.wiwi.uni-frankfurt.de/kolleg/alumni/kalodera/option_stock_liquidity.pdf&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt; provides some additional information - &quot;Call purchases increase with positive returns and decrease on days with negative returns, while put purchases behave exactly the opposite way. However,both call and put sales increase on days with large positive or negative returns.&quot; Leveraged portfolio also add to the decline (sell pressure) due to margin requirements or day trading rules etc. However, The small or micro cap stocks do not benefit from buy and hold. Warren Buffet types, pension funds hold big names, big caps, partly mandated by their charter, which typically have lower volatility. That is why \$RVX is generally larger than \$VIX.&lt;/p&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="7867" LastEditDate="2014-05-28T02:51:22.347" LastActivityDate="2014-05-28T02:51:22.347" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11391" PostTypeId="1" CreationDate="2014-05-22T08:02:14.810" Score="1" ViewCount="297" Body="&lt;p&gt;I used a simple market model (Black 76)  to price an american swaption. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's a formula similar to B&amp;amp;S, with another numeraire and forward rate as underlying. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used the SDE:  $$ dF = \sigma * F dW $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I want to price a contract wich is the sum of 4 swaptions with different Tenors, so I have to simulate 4 forward rates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should I take into account the correlation between the forward rate or can I simply simulate the rates independently ? &lt;/p&gt;&#xA;" OwnerUserId="5052" LastActivityDate="2014-05-26T12:29:17.040" Title="Forward rates diffusion" Tags="&lt;black-scholes&gt;&lt;interest-rates&gt;&lt;forward&gt;" AnswerCount="1" CommentCount="12" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11392" PostTypeId="1" CreationDate="2014-05-22T08:35:47.223" Score="2" ViewCount="731" Body="&lt;p&gt;What is the link between option Greeks (i.e. vega, delta, gamma, theta) and implied volatility surface (IVS) movements? Could you say that their 'information content' is the same. i.e. that out of movements of the one you could derive the movements of the other at the same point in time?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Some Background to why I am asking this question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have two sets of data from Optionmetrics: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;An interpolated IVS (of the SPY) as constant point of time to maturity (30,60,..180 days) and constant points of Delta &lt;/li&gt;&#xA;&lt;li&gt;Option greeks data (vega, delta, gamma, theta) for an option that is modeled to be perpetually at the money and at 30 days of expiration. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Regression these sets on each other, and also using principal components techniques reveals that both sets of data are essentially the same 'information' (or you could say they have the same variation).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is whether is due to the manner in which Optiometrics handles/interpolates the data or that this is something structural and founded in theory. That why I ask the above - I would like to know whether to what extent theoretically this similarity is also the case.&lt;/p&gt;&#xA;" OwnerUserId="6397" LastEditorUserId="6397" LastEditDate="2014-05-25T16:37:33.280" LastActivityDate="2014-07-05T16:22:22.087" Title="The implied volatility surface and the option Greeks - to what extent is the information contained in their daily movements the same?" Tags="&lt;implied-volatility&gt;&lt;regression&gt;&lt;greeks&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11394" PostTypeId="2" ParentId="11325" CreationDate="2014-05-22T11:10:07.633" Score="2" Body="&lt;p&gt;This does not sum to 1 because you have forgotten to add the 6th scenario, the  NonDefault (ND). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If Ps is the probability of survival and Pd the probability of default, the ND has the probability Ps^5.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This makes: &#xA;Pd+&#xA;Ps*Pd+&#xA;...&#xA;Ps^4*Pd+&#xA;Ps^5=&#xA;Pd*(1+Ps+...+Ps^4)+Ps^5=&#xA;Pd*(1-Ps^5)/(1-Ps)+Ps^5=&#xA;(1-Ps)**(1-Ps^5)/(1-Ps)+Ps^5=1.&lt;/p&gt;&#xA;" OwnerUserId="2872" LastActivityDate="2014-05-22T11:10:07.633" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11395" PostTypeId="2" ParentId="11378" CreationDate="2014-05-22T12:57:26.883" Score="2" Body="&lt;p&gt;As Richard pointed out you will need the implied volatility (iV) for the option on the stock, the iV of an option with the zero bond as underlying and the iV of an option on the stock and zero bond combined (most likely an OTC derivative). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then easily derive the implied correlation :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;impliedCorrel = (pow(iV[stock],2) + pow(iV[zBond],2) - pow(iV[otcDeriv],2)) / (2*iV[stock]*iV[zBond])&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(sorry I am not good at laTeX, and credit to Richard for having first pointed out the implied volatility of the basket option)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Implied correlations can be more easily derived for currencies, where you would just replace the iV of the otc derivative by the iV of the cross currency option contract (most use otc contracts, others futures options on the currencies). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In either way, make sure you pick the implied vol of the at-the-money-forward and matching expiries for a more accurate result.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2014-05-22T12:57:26.883" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11396" PostTypeId="1" AcceptedAnswerId="11434" CreationDate="2014-05-22T13:47:42.960" Score="4" ViewCount="4465" Body="&lt;p&gt;While poking around in Bloomberg I stumbled upon the following data set: &lt;em&gt;EUR SWPT BVOL OIS&lt;/em&gt; for various maturities. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously OIS must suggest OIS-discounting but how is it related to the Black-Implied-Volatility ? Does one simply use the OIS-rate instead of the LIBOR rate as the risk-free reference rate when inverting Black's Formula ?&lt;/p&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-05-26T00:37:55.360" Title="What exactly is the OIS Black VOL?" Tags="&lt;volatility&gt;&lt;black-scholes&gt;&lt;discounting&gt;" AnswerCount="1" CommentCount="10" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="11397" PostTypeId="1" CreationDate="2014-05-22T16:28:53.447" Score="1" ViewCount="6819" Body="&lt;p&gt;I am trying to calculate the implied volatility using newton-raphson in python, but the value diverges instead of converge. What is wrong with the code?&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;s = stock price&#xA;k = strike&#xA;t = time to maturity&#xA;rf = risk free interest&#xA;cp = +/-1 call/put&#xA;price = option price&#xA;&#xA;def newtonRap(cp, price, s, k, t, rf):&#xA;    v = sqrt(2*pi/t)*price/s&#xA;    print &quot;initial volatility: &quot;,v&#xA;    for i in range(1, 10):&#xA;        d1 = (log(s/k)+(rf+0.5*pow(v,2))*t)/(v*sqrt(t))&#xA;        d2 = d1 - v*sqrt(t)&#xA;        gamma = norm.pdf(d1)/(s*v*sqrt(t))&#xA;        price0 = cp*s*norm.cdf(cp*d1) - cp*k*exp(-rf*t)*norm.cdf(cp*d2)&#xA;        v = v - (price0 - price)/gamma&#xA;        print &quot;price, gamma, volatility\n&quot;,(price0, gamma, v)&#xA;        if abs(price0 - price) &amp;lt; 1e-10 :&#xA;            break&#xA;    return v&#xA;&#xA;&#xA;v = newtonRap(cp=1, price = 1.52, s=23.95, k=24, t=71.0/365, rf=0.05)&#xA;print v&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;initial volatility:  0.36069926906  &#xA;price, gamma, volatility  &#xA;(1.6055072570611344, 0.10385864414094476, -0.46260492259786345)  &#xA;price, gamma, volatility  &#xA;(-1.8488599102758396, -0.080851497020229368, -42.129859511995726)  &#xA;price, gamma, volatility  &#xA;(-23.767706818545953, -1.6137689013848907e-22, -1.5669967860233743e+23)  &#xA;price, gamma, volatility  &#xA;(-23.767706818545953, -0.0, -inf)  &#xA;&#xA;RuntimeWarning: divide by zero encountered in double_scalars  &#xA;  v = v - (price0 - price)/gamma  &#xA;RuntimeWarning: invalid value encountered in double_scalars  &#xA;  d1 = (log(s/k)+(rf+0.5*pow(v,2))*t)/(v*sqrt(t))  &#xA;price, gamma, volatility  &#xA;(nan, nan, nan)  &#xA;price, gamma, volatility  &#xA;(nan, nan, nan)  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6346" LastEditorUserId="19663" LastEditDate="2017-08-11T20:25:13.480" LastActivityDate="2017-08-11T20:25:13.480" Title="estimate implied volatility using newton-raphson in python" Tags="&lt;implied-volatility&gt;&lt;numerical-methods&gt;&lt;python&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11398" PostTypeId="1" CreationDate="2014-05-22T17:25:23.353" Score="1" ViewCount="97" Body="&lt;p&gt;Lets assume that the underlying follows a Brownian motion and the market has the standard properties of the Black Scholes setting. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to find a hedging portfolio for every discounted price process X which is a supermartingale?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: The price process X is a stochastic process such that  $X_0\ge E[X_t]$ and $X_t \ge \max(V_t, 0)$ for all t. That is the process is at least self-financing an at every time it is possible to pay oft the value of the option if its exercised.&lt;/p&gt;&#xA;" OwnerDisplayName="user1157" LastEditorDisplayName="user1157" LastEditDate="2014-05-22T18:11:26.857" LastActivityDate="2014-05-22T18:11:26.857" Title="Existence of a hedging portfolio and martingale property" Tags="&lt;hedging&gt;&lt;martingale&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11400" PostTypeId="1" AcceptedAnswerId="11402" CreationDate="2014-05-22T23:07:47.383" Score="7" ViewCount="1244" Body="&lt;p&gt;I am just starting on Interest Rate Swaps &amp;amp; curve construction. While reading few materials on Interest Rate Swap, it's indicated for e.g. &quot;Floating Coupon Index: 6 month USD LIBOR&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;LIBOR is the London Inter Bank Overnight Rate. How does it matter for USD?&#xA;If a security is USD denominated, shouldn't it be valued using some USD based interest rate e.g. Treasury security rates? &lt;strong&gt;Why does USD based security valuation have to give a &lt;em&gt;thing&lt;/em&gt; about what London Banks &lt;em&gt;think&lt;/em&gt;?&lt;/strong&gt; US still remains the largest bond market in the world...though. Even following link states &lt;em&gt;USD LIBOR is what London banks prepared to lend $$$.00&lt;/em&gt;...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It doesn't seem to stop there, as couple of other currencies have their LIBORs available as well. Why there has to be a USD LIBOR in the first place? &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Reference:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://global-rates.com/interest-rates/libor/american-dollar/american-dollar.aspx&quot; rel=&quot;noreferrer&quot;&gt;The US Dollar LIBOR interest rate is the average interbank interest rate at which a large number of banks on the London money market are prepared to lend one another unsecured funds denominated in US Dollars. The US Dollar (USD) LIBOR interest rate is available in 7 maturities, from overnight (on a daily basis) to 12 months. &#xA;The US dollar LIBOR interest rate serves as a base rate for all sorts of other products such as savings accounts, mortgages and loans. Alongside the US Dollar LIBOR there are also LIBOR interest rates in 4 other currencies... &lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3178" LastActivityDate="2014-05-23T06:24:21.300" Title="Why is USD LIBOR used for USD denominated securities?" Tags="&lt;interest-rates&gt;&lt;swaps&gt;&lt;valuation&gt;&lt;libor&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11401" PostTypeId="2" ParentId="11400" CreationDate="2014-05-23T05:13:12.320" Score="9" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Why does USD based security valuation have to give a thing about what London Banks think?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Your question is based on false premises: the USD Libor is not determined by polling London based banks as you seem to believe, but banks on the London money market.  The difference is important, as there are—of course—banks which are not based in London and active on the London money market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://www.bbalibor.com/panels/usd&quot;&gt;USD panel&lt;/a&gt; has the following members:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Bank of America&lt;/li&gt;&#xA;&lt;li&gt;Bank of Tokyo-Mitsubishi UFJ Ltd&lt;/li&gt;&#xA;&lt;li&gt;Barclays Bank plc&lt;/li&gt;&#xA;&lt;li&gt;BNP Paribas&lt;/li&gt;&#xA;&lt;li&gt;Citibank NA&lt;/li&gt;&#xA;&lt;li&gt;Credit Agricole CIB&lt;/li&gt;&#xA;&lt;li&gt;Credit Suisse&lt;/li&gt;&#xA;&lt;li&gt;Deutsche Bank AG&lt;/li&gt;&#xA;&lt;li&gt;HSBC&lt;/li&gt;&#xA;&lt;li&gt;JP Morgan Chase&lt;/li&gt;&#xA;&lt;li&gt;Lloyds Banking Group&lt;/li&gt;&#xA;&lt;li&gt;Rabobank&lt;/li&gt;&#xA;&lt;li&gt;Royal Bank of Canada&lt;/li&gt;&#xA;&lt;li&gt;Société Générale&lt;/li&gt;&#xA;&lt;li&gt;Sumitomo Mitsui Banking Corporation&lt;/li&gt;&#xA;&lt;li&gt;The Norinchukin Bank&lt;/li&gt;&#xA;&lt;li&gt;The Royal Bank of Scotland Group&lt;/li&gt;&#xA;&lt;li&gt;UBS AG&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If these banks are in the panel, one can assume that their activity on the London money market is particularly relevant for USD securities. As we see, many of them are neither based in London or the UK nor in the US. &lt;/p&gt;&#xA;" OwnerUserId="6123" LastActivityDate="2014-05-23T05:13:12.320" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11402" PostTypeId="2" ParentId="11400" CreationDate="2014-05-23T06:18:57.283" Score="5" Body="&lt;p&gt;The importance here is that it actually does not matter in what time zone or market the libor rates are set. Key is that it is supposed (!!!) to be a gauge at what rate contributing banks could borrow funds at in the inter-bank market. Like you can go to any African country and borrow or lend US dollar, so can any Japanese, European, or American bank borrow and lend US dollar in either New York, London, or any other money center. London was chosen out of convenience because it has traditionally been accepted as a convenient time zone (vs Japan or the US) for international trade, such as currency exchange and for many international fixed income asset classes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The importance of Lie-bor has been greatly diminished due to the following, however:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Due to the most recent rate setting scandal&lt;/li&gt;&#xA;&lt;li&gt;Because of the changes in dynamics in the money and rates market (a. increased market focus on IOER and RRP rates rather than fed fund target rate,and b. the Fed will possibly change its policy rate to RRP)&lt;/li&gt;&#xA;&lt;li&gt;Because the current low spread of libor over top-tier CP begs a lot of questions as to whether libor adequately reflects the risk it is suppose to price (given historical context of the spread). The market right now scrambles at deciding whether this is the new normal or not.&lt;/li&gt;&#xA;&lt;li&gt;Some research points to recommendations that OIS should not only be used as &quot;risk-free rate&quot; (this term imho should actually be removed from all textbooks) for collateralized portfolios but also uncollateralized ones, in effect replacing libor as curve input. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The biggest change I see and hear fixed income traders talk about is the new ways curves are constructed. The point is that libor itself is of decreasing importance actually. It is the curves that result from adding certain spreads on top of libor curves that matter. If market consensus now shifts to sourcing different rates to construct the base curve then libor rate usage will be phased out gradually. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But keep in mind that a huge amount of derivatives and outstanding rates and even credit products are still based on libor, hence this is not something that will change overnight. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2014-05-23T06:24:21.300" LastActivityDate="2014-05-23T06:24:21.300" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11403" PostTypeId="1" AcceptedAnswerId="11408" CreationDate="2014-05-23T06:42:08.760" Score="6" ViewCount="1707" Body="&lt;p&gt;Currently in a journey of learning and getting my hands a bit dirty with Interest Rate Swaps. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Why there are multiple &lt;em&gt;customized&lt;/em&gt; curves built by many even within one desk? For e.g. Short Rates desk and FI desks seem to have multiple curves of their own.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What are the usually accepted underlying securities and rates building these curves?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I also came across with the jargon and questions like &quot;Forecasting curves&quot;. What does it mean by forecasting curve? (opposed to a discounting curve). Is it something like calculating floating leg's cash flows using forward rate? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3178" LastEditorUserId="848" LastEditDate="2014-05-24T06:53:32.540" LastActivityDate="2019-08-28T08:06:33.163" Title="Why are multiple custom curves (swap) built for one desk?" Tags="&lt;forecasting&gt;&lt;forward-rate&gt;&lt;discounting&gt;&lt;discount-factor-curve&gt;&lt;interest-rate-swap&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11404" PostTypeId="5" CreationDate="2014-05-23T08:20:32.703" Score="0" Body="&lt;p&gt;How Do Investors Hedge?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hedging techniques generally involve the use of complicated financial instruments known as derivatives, the two most common of which are options and futures. We're not going to get into the nitty-gritty of describing how these instruments work, but for now just keep in mind that with these instruments you can develop trading strategies where a loss in one investment is offset by a gain in a derivative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.investopedia.com/articles/basics/03/080103.asp&quot; rel=&quot;nofollow&quot;&gt;* Reference 1&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Hedge_%28finance%29&quot; rel=&quot;nofollow&quot;&gt;* Reference 2&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3178" LastEditorUserId="3178" LastEditDate="2014-05-23T16:26:11.180" LastActivityDate="2014-05-23T16:26:11.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11405" PostTypeId="4" CreationDate="2014-05-23T08:20:32.703" Score="0" Body="[Think of it as insurance. When people decide to hedge, they are insuring themselves against a negative event. This doesn't prevent a negative event from happening, but if it does happen and you're properly hedged, the impact of the event is reduced. So, hedging occurs almost everywhere, and we see it everyday.](http://www.investopedia.com/articles/basics/03/080103.asp)" OwnerUserId="3178" LastEditorUserId="3178" LastEditDate="2014-05-23T16:26:04.280" LastActivityDate="2014-05-23T16:26:04.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11406" PostTypeId="1" AcceptedAnswerId="11411" CreationDate="2014-05-23T09:52:14.707" Score="6" ViewCount="2527" Body="&lt;p&gt;Under what conditions should the drift be real world and when risk neutral when simulating&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Delta Hedging &lt;/li&gt;&#xA;&lt;li&gt;option pricing&lt;/li&gt;&#xA;&lt;li&gt;trading strategy&lt;/li&gt;&#xA;&lt;li&gt;any other?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For 2. it should be risk neutral. For 1., it could be either as it should result in correct option pricing. For 3. it should be real world.&#xA;Do you agree?&lt;/p&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="7279" LastEditDate="2014-05-23T10:29:29.533" LastActivityDate="2014-05-23T14:04:47.897" Title="When to use the real world drift and when the risk neutral one for a Monte-Carlo simulation?" Tags="&lt;monte-carlo&gt;&lt;simulations&gt;&lt;risk-neutral-measure&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11407" PostTypeId="2" ParentId="11406" CreationDate="2014-05-23T10:25:47.170" Score="3" Body="&lt;p&gt;To my knowledge the real world drift plays a crucial role in risk management. The reason being that one is not interested in risk adjusted paths but in real-world scenarios that might actually occure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still you should be aware that &quot;the real world drift&quot; is a somewhat controversial topic in quant circles. Nobody knows exactly how to get it. Mostly you end up doing what you consider to be more or less theoretically and empirically justified. &lt;/p&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-05-23T10:25:47.170" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="11408" PostTypeId="2" ParentId="11403" CreationDate="2014-05-23T10:43:18.747" Score="8" Body="&lt;h2&gt;Chapter 1: Goldilocks is ousted by the bears&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Once upon a time, the banks used a fixing called LIBOR as a measure of the risk-free interest rate. Then the big hairy crisis came along and ate all our assumptions, leaving just the bones of the fixing (upon which everything else still fixes) and the mantle of risk-free rate proxy was passed on to a family of Overnight fixings, called Sonia, Eonia and -ahem- FedFundEffective. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since everything (e.g. FRAs, 3m Interest Rate Futures, OTC IRS, Deliverable Swap Futures, cross-currency basis swaps, 3m-OIS basis, etc) still fixes on LIBOR (or other xIBOR depending on the currency), the questions now are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What do you expect the xIBOR fixing to be for any given term?&lt;/li&gt;&#xA;&lt;li&gt;What do you expect the Overnight fixing to be for any given term?&lt;/li&gt;&#xA;&lt;li&gt;How much is your CVA desk going to charge you to cover the credit risk?&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So to value a forward-starting IRS, I need both an Overnight curve for discounting, but also a curve of forecasted fixings to estimate the cash flows themselves. When there was 1 curve, it was far simpler.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Summary: Once there was 1 fixing, and it was a proxy for the risk free rate, so there was 1 curve of discount factors. Now it is no longer such a proxy, but because liquid instruments fix on these other fixings, you have to build curves to work out what those fixings are expected to be as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-- Edit for great good and new RFR --&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Chapter 2: Goldilocks returns&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Regulatory changes (viz: the ARRC, EMIR, the BoE) have deemed that even the mantle of Libor (and cousins Euribor, etc) must now be offered up to the be burnt in the witch's oven. So instead of having a 1m Libor, 3m Libor and 6m Libor curves, the instruments which use those fixings must be replaced by new RFR (Risk Free Rates, or, Daughter of Goldilocks). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a return to the single curve world - all your multicurves are belong to RFR. FedFunds is being replaced (in usage) by a comfy SOFR, Eonia by the inpronouncable €STR (in October 2019) and TOIS has already become SARON. Sonia is dead, long live Sonia.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Chapter 2.5: Goldilocks and the mirror&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Goldilocks II gives us backward looking 'in arrears' fixings - they are fixed in light of actual trades. This is in contrast to the forward-looking originals in Libor and Euribor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once Goldilocks II returns and kills all the bears (prophesied to be 2022), there is still a shadow in the wings (I mean, how else can we make the 3rd and 4th films of the trilogy): the buy side and the FI markets both want a forward looking fixing like the fixing they once knew, so they may well make up a sister fixing to Goldilocks II, a mirror fixing which looks forward. This would then be either a second curve or a lag adjustment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in summary, most of the textbooks were written during Goldilocks I's reign, some have since been written during the Bear Junta, and the next chapter is as yet unwritten.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastEditorUserId="1314" LastEditDate="2019-08-28T08:06:33.163" LastActivityDate="2019-08-28T08:06:33.163" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="11411" PostTypeId="2" ParentId="11406" CreationDate="2014-05-23T14:04:47.897" Score="8" Body="&lt;p&gt;In general these are the two basic approaches to QuantFinance:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sell side (market maker, risk neutral): You use risk-neutral probabilities (&quot;$\mathbb{Q}$&quot;) e.g. in option pricing (to e.g. calculate your greeks and hedge your portfolio), so that you live on the spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Buy side (market/risk taker): You use real-world probabilites (&quot;$\mathbb{P}$&quot;) for e.g. trading strategies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also this excellent article:&#xA;&lt;br&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1717163&quot;&gt;'P' Versus 'Q': Differences and Commonalities between the Two Areas of Quantitative Finance by Attilio Meucci&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the abstract:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;There exist two separate branches of finance that require advanced&#xA;  quantitative techniques: the &quot;Q&quot; area of derivatives pricing, whose&#xA;  task is to &quot;extrapolate the present&quot;; and the &quot;P&quot; area of quantitative&#xA;  risk and portfolio management, whose task is to &quot;model the future.&quot;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;We briefly trace the history of these two branches of quantitative&#xA;  finance, highlighting their different goals and challenges. Then we&#xA;  provide an overview of their areas of intersection: the notion of risk&#xA;  premium; the stochastic processes used, often under different names&#xA;  and assumptions in the Q and in the P world; the numerical methods&#xA;  utilized to simulate those processes; hedging; and statistical&#xA;  arbitrage.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="12" LastActivityDate="2014-05-23T14:04:47.897" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="11412" PostTypeId="2" ParentId="11397" CreationDate="2014-05-23T15:08:41.870" Score="-1" Body="&lt;p&gt;&lt;code&gt;&#xA;def newtonRap(cp, price, s, k, t, rf):&#xA;    v = sqrt(2*pi/t)*price/s&#xA;    print &quot;initial volatility: &quot;,v&#xA;    for i in range(1, 100):&#xA;        d1 = (log(s/k)+(rf+0.5*pow(v,2))*t)/(v*sqrt(t))&#xA;        d2 = d1 - v*sqrt(t)&#xA;        vega = s*norm.pdf(d1)*sqrt(t)&#xA;        price0 = cp*s*norm.cdf(cp*d1) - cp*k*exp(-rf*t)*norm.cdf(cp*d2)&#xA;        v = v - (price0 - price)/vega&#xA;        print &quot;price, vega, volatility\n&quot;,(price0, vega, v)&#xA;        if abs(price0 - price) &amp;lt; 1e-25 :&#xA;            break&#xA;    return v&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="6346" LastActivityDate="2014-05-23T15:08:41.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11413" PostTypeId="1" AcceptedAnswerId="11442" CreationDate="2014-05-23T15:39:23.773" Score="1" ViewCount="359" Body="&lt;p&gt;As we all know , return time series marked features: fat tail or negative skewness and peakedness.  For a similar problem of variance computation, we can compute variance by garch model and other derivatives.In other words,Does we predict skewnenss like predicting variance by garch model and other derivatives ?  does the existing model for skewness exist ? According to modern fiancial  theory(investors like high return ,high skewness or positive skewness ,dislike variance ,kurtosis),we can deduce$\frac{ \partial {\text{variance}}}{\partial{\text{skewness}}}&amp;lt;0$ and$\frac{ \partial {\text{variance}}}{\partial{\text{kurtosis}}}&amp;gt;0$.and kurtosis ? Two seeming useful links:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.portfolioprobe.com/2012/01/16/a-slice-of-sp-500-skewness-history/&quot; rel=&quot;nofollow&quot;&gt;http://www.portfolioprobe.com/2012/01/16/a-slice-of-sp-500-skewness-history/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://blog.datapunks.com/2011/10/market-skewness/&quot; rel=&quot;nofollow&quot;&gt;http://blog.datapunks.com/2011/10/market-skewness/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Any comments are appreciated&lt;/p&gt;&#xA;" OwnerUserId="8124" LastEditorUserId="8124" LastEditDate="2014-05-23T15:47:21.490" LastActivityDate="2014-05-26T15:23:33.570" Title="how to compute daily skewness of S&amp;P daily return timeseries under no other more high - frequency time series?" Tags="&lt;time-series&gt;&lt;variance&gt;&lt;skewness&gt;&lt;kurtosis&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11414" PostTypeId="2" ParentId="11323" CreationDate="2014-05-23T15:49:39.233" Score="1" Body="&lt;p&gt;Hedginge/Adjusting would be with the Beta of the inverse ETF.  Usually, Long/Short strategy would involve an ETF and a stock in which you would Beta adjust the ETF position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use an ETF, I don't see anything wrong with this as long as their is some level of correlation between the Short and the Long. You want them to mean revert in a determined time horizon so correlation is important. Not too high or too low.&lt;/p&gt;&#xA;" OwnerUserId="3526" LastActivityDate="2014-05-23T15:49:39.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11416" PostTypeId="2" ParentId="10622" CreationDate="2014-05-23T18:36:32.157" Score="1" Body="&lt;p&gt;You are mixing terms here. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The definition of an &quot;interest rate&quot; is typically a simple interest rate as applies to the Principal of a loan. The unpaid interest rate is not compounded. This is owed at the conclusion of the loan or when converted to debt. Typically rolled into the equity stake.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The definition of &quot;discount&quot; is what the convertible debt holder would be rewarded as an early investor. If the Priced round comes in @ $\$1.00$ per share and the convertible debt holder has a 25% discount then they would convert their loan at $\$1.00 \times (1-0.25)$ or $\$0.75$ per share.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is another major term called &quot;the Cap&quot; which sets a ceiling at the first priced round. This is critical to the deal terms. More on this later.&lt;/p&gt;&#xA;" OwnerUserId="8125" LastEditorUserId="848" LastEditDate="2014-05-24T10:15:53.463" LastActivityDate="2014-05-24T10:15:53.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11420" PostTypeId="1" CreationDate="2014-05-24T07:48:21.057" Score="0" ViewCount="419" Body="&lt;p&gt;Price time series are not stationary. So we difference them and get the return time series, which are stationary. Does this mean, it is always a good idea to model only the return series of financial assets. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, do we not need to model prices ever ?&lt;/p&gt;&#xA;" OwnerUserId="8127" LastActivityDate="2014-05-24T23:12:14.473" Title="Modeling Financial Time Series" Tags="&lt;time-series&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11421" PostTypeId="1" CreationDate="2014-05-24T09:54:02.173" Score="2" ViewCount="456" Body="&lt;p&gt;Can someoe help with this :&#xA;What is the precise arbitrage argument demonstrating that the price of an american option should be continuous around an ex-dividend date?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="8128" LastEditorUserId="8128" LastEditDate="2014-05-26T11:54:52.820" LastActivityDate="2014-06-27T07:17:23.803" Title="american option and cash dividends" Tags="&lt;option-pricing&gt;&lt;discrete-dividends&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11422" PostTypeId="2" ParentId="11420" CreationDate="2014-05-24T10:20:25.827" Score="0" Body="&lt;p&gt;Sometimes prices are directly modeled, for example equity valuation. In Time Series analysis you're right that prices are not directly modeled but I wouldn't say are not modeled ever. They are modeled &lt;em&gt;indirectly&lt;/em&gt; using the returns. Since often it's the price of an asset you're interested in.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2014-05-24T10:20:25.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11423" PostTypeId="1" CreationDate="2014-05-24T11:37:12.940" Score="1" ViewCount="187" Body="&lt;p&gt;I'm fiddling with estimation of stochastic volatility models and have build up a somewhat flexible framework using indirect inference. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to try and throw a lot of different continuous time models into it and see how it performs. &#xA;I only need it to be reasonable easy to simulate and not have to many parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know of Heston type models (i.e. square root processes) and the CEV type processes with and without mean reversion. Multifactor is an option but generally the fewer parameters the easier for me (as always).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope to get your input, thanks.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="2553" LastEditDate="2015-06-22T16:56:10.870" LastActivityDate="2015-06-22T16:56:10.870" Title="Reference request about stochastic volatility model" Tags="&lt;volatility&gt;&lt;stochastic-volatility&gt;&lt;heston&gt;" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="11424" PostTypeId="1" AcceptedAnswerId="11429" CreationDate="2014-05-24T14:38:53.140" Score="3" ViewCount="826" Body="&lt;p&gt;I'm trying to implement this model shown here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S0304407611000388&quot; rel=&quot;nofollow&quot;&gt;http://www.sciencedirect.com/science/article/pii/S0304407611000388&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As part of the modelling process I have to calculate the unconditional variance of X see page 10). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma_R^2=\int_u^t \exp^{-A s}\Sigma \Sigma^T \exp^{-A^T s}ds$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They say they use a closed form result from here&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.google.co.uk/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CDEQFjAA&amp;amp;url=http%3A%2F%2Fwww.markfisher.net%2F~mefisher%2Fpapers%2Fterm_prem.pdf&amp;amp;ei=-6yAU6K_M4ziO4m9gPgK&amp;amp;usg=AFQjCNEeJcmAiEzZbfcrWfTGP2uCP5GMFg&amp;amp;bvm=bv.67720277,d.ZWU&quot; rel=&quot;nofollow&quot;&gt;http://www.google.co.uk/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CDEQFjAA&amp;amp;url=http%3A%2F%2Fwww.markfisher.net%2F~mefisher%2Fpapers%2Fterm_prem.pdf&amp;amp;ei=-6yAU6K_M4ziO4m9gPgK&amp;amp;usg=AFQjCNEeJcmAiEzZbfcrWfTGP2uCP5GMFg&amp;amp;bvm=bv.67720277,d.ZWU&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;see the eqn directly below eqn (3.10) on p5 sadly I can not understand this result much less transform it in to the DNS/AFDNS framework&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However the solution is presented here in the DNS/AFNS fraemwork &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1974033&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1974033&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\int_u^t \exp^{-A s}\Sigma \Sigma^T \exp^{-A^T s}ds=\Lambda \Gamma \Lambda^{-1}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the (i,j)th element of $\Gamma$ is $=\frac{\sigma_{ij}}{\lambda_i+ \lambda_j}(1-\exp^{-(\lambda_i + \lambda_j)\delta T})$ where $\sigma_{i,j}$ is the element (i,j) of the covariance matrix ($\Sigma \Sigma^T $) assumed constant, and $\Lambda$ is the eigenvector of $\kappa(s_t):=A$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately the solution I found does not say what the $\lambda$ are. I assume they must be the eigenvalues of A? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q1.) Can someone please confirm  my hunch about the $\lambda$ being the eigenvalues&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q2.) Can someone either show me or point me to a reference where I can see how this derivation is done.&lt;/p&gt;&#xA;" OwnerUserId="7077" LastEditorUserId="7867" LastEditDate="2014-05-25T16:13:29.733" LastActivityDate="2019-05-14T22:59:50.177" Title="Variance of Multi-Dimensional OU process" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11425" PostTypeId="1" CreationDate="2014-05-24T15:33:01.363" Score="1" ViewCount="39" Body="&lt;p&gt;I know if we define a function f(x) and its cdf is F(x). The inverse function of cdf is inverseF.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can define its median as follows: median = inverseF(0.5). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if I want to get the median for a bivariate function f(x,y). How to define it? Thanks very much!&lt;/p&gt;&#xA;" OwnerUserId="8005" LastActivityDate="2014-05-24T16:18:06.560" Title="How to define the median for bivariate function?" Tags="&lt;probability&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11426" PostTypeId="2" ParentId="11420" CreationDate="2014-05-24T16:03:03.093" Score="2" Body="&lt;p&gt;Not sure of the context of your question. I can think of the following instances.&#xA;1. If you are doing stationarity test on a time series, normally you start out with returns series. The difference you take there is to determine the lag that gives you the stationary time series, used in cointegration.&#xA;2. Prices are not stationary so are the returns many times.&#xA;3. I have seen some do pair trading based on ratio of prices of stocks, it works when they find a pair that has a spread that is stationary. &#xA;4. Risk management uses prices in a more direct way by valuing portfolio for VaR etc.&lt;/p&gt;&#xA;" OwnerUserId="7867" LastActivityDate="2014-05-24T16:03:03.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11427" PostTypeId="2" ParentId="11425" CreationDate="2014-05-24T16:18:06.560" Score="1" Body="&lt;p&gt;The standard median is not defined in multiple dimensions but a generalized notion exists as explained in this &lt;a href=&quot;https://stats.stackexchange.com/questions/43009/what-are-the-multidimensional-versions-of-median&quot;&gt;CrossValidated answer&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2014-05-24T16:18:06.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11429" PostTypeId="2" ParentId="11424" CreationDate="2014-05-24T16:40:21.203" Score="2" Body="&lt;p&gt;This interesting question provides excellent links to  Dynamic Nelson-Siegel Term Structure Models for interest rates for No Arbitrage and exposes key formulation in an interesting way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Appendix in p37 of ssrn link says $\lambda$ is market price of diffusion risk. However, in the DNS model the  $\lambda$ is eigenvalues of $\kappa$, which then part of covariance matrix elements as you described.  See section 5.2 of the ssrn reference for an example. Actually you can the data from Bloomberg for the period and be able to validate their results.&lt;/p&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="7867" LastEditDate="2014-05-26T01:02:40.377" LastActivityDate="2014-05-26T01:02:40.377" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="11430" PostTypeId="1" AcceptedAnswerId="11432" CreationDate="2014-05-24T22:27:55.177" Score="3" ViewCount="867" Body="&lt;p&gt;I'm following loosely the exposition given in &quot;Monte Carlo Methods in Financial Engineering by Glasserman.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a multifactor OU process:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dX(t)=C(b-X(t))dt+DdW(t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where C and D are d*d matrices and b and X(t) are vectors on length d, and W is a d dimensional brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;He notes that this can be used to define an &quot;exact&quot; discretization  similar to the 1D case (Shown below)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1D case:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dr(t)=\alpha(b-r(t))dt+\sigma dW(t)$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;which has solution&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r(t)=exp^{-\alpha(t-u)}r(u)+\alpha\int_u^t \exp^{- \alpha(t-s)}b(s) ds+ \sigma \int_u^t \exp^{- \alpha(t-s)}dW(s)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and can be simulated as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r(t+1)=exp^{-\alpha(t_{i+1}-t_i)}r(t_i)+\mu(t_i,t_{t+1})+\sigma_r(t_i,t_{i+1})Z_{i_1} $ -- EQ1 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\mu(u,t)=\alpha \int_u^t \exp^{-\alpha(t-s)}b(s)ds$&lt;br&gt;&#xA;if b is constant&#xA;$\mu=b(1-\exp^{-\alpha(t_{i+1}-t_i)})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma_r^2(u,t)=\sigma^2 \int_u^t \exp^{-2\alpha(t-s)}ds=\frac{\sigma^2}{2 \alpha}(1-exp^{-2 \alpha(t-u)})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;returning to multi-factor case&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The general solution is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X(t)=exp^{-C(t-u)}X(u)+\int_u^t \exp^{- C(t-s)}b ds+ \int_u^t \exp^{- C(t-s)}DdW(s)$ -- EQ2&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However he also goes on to show that when C is diagonizable using $VCV^{-1}=\Delta$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dY(t)=VX(t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which after simplification becomes&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dY(t)=\Delta(\tilde{b}-Y(t))dt+d \tilde W(t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $\tilde{W}$ a $BM(0,\Sigma)$ where $\Sigma=VDD'T'$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be modeled as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Y_j(t+1)=exp^{-\lambda_j (t_{i+1}-t_i)}Y_j(t_i)+(\exp^{\lambda_j(t_{i+1}-t_i)}-1)\tilde{b}_j +\sqrt{\frac{1}{2 \lambda_j}(1-exp^{(-2\lambda_j(t_{i+1}-t_i)})}\xi_j(i+1)$ EQ3&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\xi(1), \xi(2)$ are independent $N(0,\Sigma)$.&lt;br&gt;&#xA;Which reduces to a system of scalar simulations&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then recover the $X(t)$ using $X(t)=V(t)^{-1}Y(t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1.) Could I run the multifactor OU process without doing the diagonalisation, i.e using the general solution Eq2 and the discretization scheme shown in EQ1? (if not why not?)  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I realize that the second solution utilizing the diagonalisation is prolly neater (and faster) but I would like to be able to simulate the process two ways so that I can test the models against each other. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2.) If the answer to question 1 is no that how can I benchmark my model to enusre it's correct.&lt;/p&gt;&#xA;" OwnerUserId="7077" LastEditorUserId="7867" LastEditDate="2014-05-25T13:20:06.993" LastActivityDate="2014-05-25T13:20:06.993" Title="Monte Carlo for MultiFactor Ornstein Uhlenbeck" Tags="&lt;stochastic-processes&gt;&lt;monte-carlo&gt;&lt;simulations&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11431" PostTypeId="2" ParentId="11420" CreationDate="2014-05-24T23:12:14.473" Score="0" Body="&lt;p&gt;Nobody stops you from modelling prices if your price series were stationary. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Modelling needs stationarity assumption because distributions cannot be fit to non-iid random variables. Non-iid random variables cannot use maximum-likelihood to fit parameters.&lt;/p&gt;&#xA;" OwnerUserId="2142" LastActivityDate="2014-05-24T23:12:14.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11432" PostTypeId="2" ParentId="11430" CreationDate="2014-05-24T23:46:12.100" Score="4" Body="&lt;p&gt;EQ1 is uni-variate case. EQ2 is multivariate case, in which you have to use correlated $X_t$. His way of doing is making $Y_t$ independent so that you can simulate freely. He does so by finding PC on $\Delta$. Alternatively, you could generate correlated $X_t$ in your simulation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To benchmark your model / code, you should first test and reproduce a given example of multivariate OU and see if you match the solution. There are ways to use exact solution &lt;a href=&quot;https://www.math.lsu.edu/cosa/new3-3-09%5B214%5D.pdf&quot; rel=&quot;nofollow&quot;&gt;Multivariate exact solution &lt;/a&gt;, &lt;a href=&quot;http://www.fisica.uniud.it/~milotti/DidatticaTS/Segnali/Gillespie_1996.pdf&quot; rel=&quot;nofollow&quot;&gt;another by Gillespie, goes up to bi-variate case&lt;/a&gt; and here is &lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/30184-exact-numerical-simulation-of-the-ornstein-uhlenbeck-process&quot; rel=&quot;nofollow&quot;&gt;Gillespie implemented in Matlab&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="7867" LastEditDate="2014-05-25T02:58:16.980" LastActivityDate="2014-05-25T02:58:16.980" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11434" PostTypeId="2" ParentId="11396" CreationDate="2014-05-25T08:41:33.767" Score="3" Body="&lt;p&gt;Reformatting for an answer: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;OIS (vols) - vols backed out of/for pricing in the presence of multiple curves&lt;/li&gt;&#xA;&lt;li&gt;LIBOR (vols) - vols backed out of/for pricing in the 'old' way where discount=forward and basis is negligible&lt;/li&gt;&#xA;&lt;li&gt;Black (vols) - Black-76 inverted volatilities&lt;/li&gt;&#xA;&lt;li&gt;Normal (vols) - Normal/Bachelier (?) inverted volatilities&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;FINCAD primer on the 'new curves math': &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2311745&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2311745&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One would not want to drop an OIS vol into an old LIBOR Market Model, but Fabio Mercurio and others have extended LMM to encompass multiple curves with deterministic or stochastic basis functions. &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1621547&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1621547&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Various parties quote vols both coming from a LIBOR- or an OIS- space, the Bloomberg function VCUB fits a volatility surface and interpolates and ticks out vols in both OIS- and LIBOR- spaces.  Hovering over the various grid points on the various pages of VCUB should be a good place to start for pulling in vols into your own LMM model.  A good test of whether you are using the right vols in the right places (and of everything else in your pipeline) is to try and recover the prices/premia of caplets/swaptions that you initially fed into VCUB.  And as others have mentioned, being persistent on &amp;lt;HELP&gt; can quickly get you in touch with some very knowledgeable people.&lt;/p&gt;&#xA;" OwnerUserId="3491" LastEditorUserId="3491" LastEditDate="2014-05-26T00:37:55.360" LastActivityDate="2014-05-26T00:37:55.360" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="11435" PostTypeId="1" CreationDate="2014-05-25T10:06:08.270" Score="7" ViewCount="3084" Body="&lt;p&gt;I am looking for a (hopefully significantly cheaper) alternative to bloomberg - primarily for fixed income data. Perhaps some survice that has a more modular fee structure (so that I only have to pay for more or less what I need)&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;It should at least provide:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Quotes for swaptions and caps (different trikes, tenors etc.)  Curves&lt;/li&gt;&#xA;&lt;li&gt;swap-curves etc&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;Motivation:&lt;/strong&gt;&#xA;I hardly ever work with equity data and mostly need fixed income quotes to calibrate my models etc. Unfortunately my department does not have it's own terminal (due to budgetary reasons) and I always have to bum data off some co-worker (or use his/her terminal - mostly late at night). My reasoning: if I can show a viable and cheap Bloomberg alternative for the data I actually need, my superiors might reconsider.&lt;/p&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2019-10-11T11:45:55.450" Title="Bloomberg alternatives for fixed income data" Tags="&lt;data&gt;&lt;bloomberg&gt;&lt;reuters&gt;" AnswerCount="6" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11436" PostTypeId="2" ParentId="11435" CreationDate="2014-05-25T21:21:46.457" Score="4" Body="&lt;p&gt;CME group has free &lt;a href=&quot;http://www.cmegroup.com/trading/interest-rates/cleared-otc/irs-curve-data.html&quot; rel=&quot;nofollow&quot;&gt;Swap curves&lt;/a&gt;. It also seems that they have quotes on the &lt;a href=&quot;http://www.cmegroup.com/trading/interest-rates/cleared-otc/&quot; rel=&quot;nofollow&quot;&gt;product feature page&lt;/a&gt;. Hope this works for you, -if it does, maybe you can comment about the costs when you find out. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="7867" LastActivityDate="2014-05-25T21:21:46.457" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11437" PostTypeId="1" AcceptedAnswerId="11462" CreationDate="2014-05-25T23:44:01.627" Score="0" ViewCount="360" Body="&lt;p&gt;Wilmott book states that its enough to know the expected present value of all cash flow in risk-neutral framework to price derivatives. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I know, to obtain arbitrage-free market we need our discounted price process to be martingale under the risk neutral $Q$ measure. Why does that imply the statement?&lt;/p&gt;&#xA;" OwnerUserId="7778" LastActivityDate="2014-05-27T21:52:41.080" Title="Why is it enough to know the expected present value of cash flow in risk-neutral framework to price derivatives?" Tags="&lt;derivatives&gt;&lt;pricing&gt;&lt;risk-neutral-measure&gt;&lt;martingale&gt;" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11440" PostTypeId="2" ParentId="11391" CreationDate="2014-05-26T11:58:18.603" Score="1" Body="&lt;p&gt;The filtration is hardly the problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say you want to price a 1x4 and a 2x3 years swaption. Thus you model three forward rates $L(t,T_1,T_2), L(t,T_2, T_3),  L(t,T_3,T_4)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The swaprate $S_{\alpha,\beta}(t)$ depends on the forward rates $L_i(t,T_{i-1},T_i)$ with $i \in (\alpha+1, \dots, \beta)$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus the price of the 1x4 swaption given by $P(0,T_1)E^1[(S_{1,4}(T_1)-K)^+]$. Under the $Q^1$ measure only one rate can have the log-normal dynamics !! &lt;strong&gt;Thus you can't just model the three forward rates as log-normal !!!!&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you can do however is to directly model the swap rates $S_{1,4}, S_{2,4}$. You can assume log-normal dynamics for both and simulate them with whatever correlation structure you think is plausible. In this case you can also just add the expectations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whether you model the rates as correlated or not depends on your market data !! Obviously the correlation structure will have an effect on the price. &lt;/p&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="7279" LastEditDate="2014-05-26T12:29:17.040" LastActivityDate="2014-05-26T12:29:17.040" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="11441" PostTypeId="1" CreationDate="2014-05-26T14:59:44.213" Score="0" ViewCount="119" Body="&lt;p&gt;Is GNP a continuous, static or a dynamic model ? What about GDP ? What I do know is that it has yearly discrete values. However, when it is modeled, it becomes a continuous graph. So what exactly is the answer ? &lt;/p&gt;&#xA;" OwnerUserId="8136" LastActivityDate="2014-05-26T16:01:14.620" Title="GNP/GDP and modelling" Tags="&lt;programming&gt;&lt;modeling&gt;&lt;models&gt;&lt;continuous-time&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2014-05-27T10:00:15.993" ContentLicense="CC BY-SA 3.0" />
  <row Id="11442" PostTypeId="2" ParentId="11413" CreationDate="2014-05-26T15:23:33.570" Score="0" Body="&lt;p&gt;skewness and kurtosis can both be predicted by models similar to garch and its derivatives.&#xA;For more details:&lt;a href=&quot;http://www.romeo-tedongap.com/medias/paramcondskewfjpt2013final.pdf&quot; rel=&quot;nofollow&quot;&gt; a new published paper here  &lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8124" LastActivityDate="2014-05-26T15:23:33.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11443" PostTypeId="2" ParentId="11441" CreationDate="2014-05-26T16:01:14.620" Score="2" Body="&lt;p&gt;First of all, GNP and GDP are economic time series and they are not economic model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly, you can also get these time series with different frequency, as quarterly data, avalaible on &lt;a href=&quot;http://stats.oecd.org/index.aspx?queryid=350&quot; rel=&quot;nofollow&quot;&gt;OECD&lt;/a&gt; website. In the case you need for lower frequency data you can get it by interpolation (as, for instance, the cubic spline interpolation); This is the &lt;a href=&quot;http://www.mathworks.it/it/help/matlab/ref/spline.html&quot; rel=&quot;nofollow&quot;&gt;Matlab tutorial&lt;/a&gt; for conducting the cubic spline interpolation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly, as regards the graph you did, I am not sure to underastand completely your question; anyway, it is continuous simply because the software link all time series points together in the graph, but this doesn't mean that you have a continuous function; you have a continuous graph that describe a discrete function.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2014-05-26T16:01:14.620" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11444" PostTypeId="1" CreationDate="2014-05-26T20:20:56.370" Score="1" ViewCount="1387" Body="&lt;p&gt;I have found volatility in the black model for swaption for different maturity (1-2-3-6-9M, 1Y, 18M, 2-10Y, 15-20-25-30Y) and Tenor (1-10Y, 15-20-25-30Y). Now I need another values (Maturity: 2, Tenor: 12).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I work with Excel without add-ins, I tried linear interpolation between (2,10) and (2,15), but I have some doubt on this method. I know some advanced inteprolation techniques (spline) in 2 dimension wich I could use for a given maturity, but it could take some time to implement a bicubic spline interpolation method. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could also use a (Maturity,Tenor) Interpolation, but I have some odd values for short maturity/short tenor. I would like to remove these &quot; outliers&quot;. There is only discussion on advanced volatility interpolation for option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What would be a reliable/fast method to interpolate Volatility(Maturity,Tenor) ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't need a generic interpolation method but some suggestion on how to improve them for volatility interpolation, or a more complex interpolation method (not too complex) wich has given some good results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are my data so you could see what I am doing, the graph is a 1D cubic interpolation on maturity (step 1/12) then on tenor (step 1).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/JBRoF.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="5052" LastEditorUserId="5052" LastEditDate="2014-05-28T16:59:21.860" LastActivityDate="2014-05-28T16:59:21.860" Title="Interpolation of volatility curve for Swaption" Tags="&lt;volatility&gt;&lt;swaption&gt;&lt;black&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11445" PostTypeId="1" AcceptedAnswerId="11476" CreationDate="2014-05-26T20:21:53.890" Score="3" ViewCount="193" Body="&lt;p&gt;Do any standard/generic approaches exist on how to extend an interest rate model to incorporate credit risk?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first thing that comes to mind would be to just model the credit spread separately - perhaps assuming some correlation with the main process. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Risky-Bonds could then be valued by pricing them in the original model (e.g. Hull White) first and by adding the spread afterwards - $P(t,T)_\text{rn} e^{-\operatorname{spread}(t,T)}$ with $P(t,T)_\text{rn}$ denoting the &quot;risk-neutral&quot; price in the &quot;base&quot;-model.&lt;/p&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="7332" LastEditDate="2014-05-27T06:56:48.770" LastActivityDate="2014-05-28T15:56:31.743" Title="Introducing credit risk to an already implemented interest rate model" Tags="&lt;fixed-income&gt;&lt;credit&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11446" PostTypeId="2" ParentId="11444" CreationDate="2014-05-26T21:15:56.960" Score="2" Body="&lt;p&gt;One of the most used interpolation techniques is the cubic spline interpolation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Spline_interpolation&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; you can find an overview of that, while, on &lt;a href=&quot;http://www.mathworks.it/it/help/matlab/ref/spline.html&quot; rel=&quot;nofollow&quot;&gt;Mathworks.com&lt;/a&gt;, you can find the tutorial to implement that in Matlab directly simply by using the &lt;em&gt;spline(x,Y,xx)&lt;/em&gt; command function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is not difficult to implement and, moreover, it gives pretty reliable results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I never tried to interpolate options data, but, anyway, it is proved it works pretty well on the most of macroeconomic time-series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case you need for interpolating in 2-d, you can use the bi-cubic interpolation technique; &lt;a href=&quot;http://www.mathworks.it/it/help/vision/ug/interpolation-methods.html#f13689&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; you can find an example in Matlab.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2014-05-26T21:51:00.823" LastActivityDate="2014-05-26T21:51:00.823" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11449" PostTypeId="2" ParentId="9271" CreationDate="2014-05-27T01:18:34.137" Score="0" Body="&lt;p&gt;try this&#xA;&lt;a href=&quot;http://syscoderblog.blogspot.com.au/2014/05/net-api-for-dukascopy-broker.html&quot; rel=&quot;nofollow&quot;&gt;http://syscoderblog.blogspot.com.au/2014/05/net-api-for-dukascopy-broker.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;it is a .Net (C# VB) API for dukascopy broker&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It has a very nice demo and a monitor utility&lt;/p&gt;&#xA;" OwnerUserId="8139" LastEditorUserId="8139" LastEditDate="2014-05-27T02:31:05.483" LastActivityDate="2014-05-27T02:31:05.483" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11451" PostTypeId="1" AcceptedAnswerId="11456" CreationDate="2014-05-27T04:47:46.780" Score="1" ViewCount="176" Body="&lt;p&gt;I hope I'm asking this at the right place.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This pertains to actuarial exam MFE/3F on Financial Economics. If $\sigma$ is &quot;volatility&quot; and $\Omega$ the elasticity of the stock, one formula that is taught in this course is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma_{\text{option}} = \sigma_{\text{stock}} \cdot  |\Omega|\text{,}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &quot;option&quot; means a call or a put. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://faculty.atu.edu/mfinan/actuarieshall/DFEM.pdf&quot; rel=&quot;nofollow&quot;&gt;Finan (Proposition 31.1, pp. 234-235)&lt;/a&gt; proves this statement. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, does this formula make an implicit assumption that the Black-Scholes assumptions have to hold? &lt;/p&gt;&#xA;" OwnerUserId="7690" LastActivityDate="2014-05-27T12:37:49.413" Title="Volatility of Option" Tags="&lt;volatility&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11454" PostTypeId="2" ParentId="11435" CreationDate="2014-05-27T07:18:29.323" Score="5" Body="&lt;p&gt;Macrobond, a swedish company might be something to consider. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.macrobond.com/&quot; rel=&quot;noreferrer&quot;&gt;http://www.macrobond.com/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8039" LastActivityDate="2014-05-27T07:18:29.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11456" PostTypeId="2" ParentId="11451" CreationDate="2014-05-27T12:37:49.413" Score="1" Body="&lt;p&gt;From  the definitions and the proof given in the paper you only need a risk neutral measure and the possibility to hedge.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The assumptions you need to make are the absence of arbitrage opportunities (AOA) and the market completeness. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You also work with a constant volatility. I think the result can be generalized to non-constant volatility. There is still an embeded assumption we often forget: the existence of a volatility. The use of a given model will guarantee the existence of the vol,  But no need of a bs model.&lt;/p&gt;&#xA;" OwnerUserId="5052" LastActivityDate="2014-05-27T12:37:49.413" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11457" PostTypeId="1" AcceptedAnswerId="12615" CreationDate="2014-05-27T13:14:42.707" Score="8" ViewCount="5082" Body="&lt;p&gt;I have to validate  the use of the &lt;a href=&quot;http://www.cdsmodel.com/cdsmodel/documentation.page?&quot; rel=&quot;noreferrer&quot;&gt;ISDA CDS standard model&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't understand me wrong - I am sure that the ISDA model is &quot;good&quot; I just need to know what it is in detail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can download an Excel-plugin and C code but I can not find a full documentation of the model. I assume that it is a constant hazard rate model or a present value model using the probabilities of default similar to what one can find e.g. in Hull. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have a link to the official and full documentation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I have &lt;a href=&quot;http://developers.opengamma.com/quantitative-research/Pricing-and-Risk-Management-of-Credit-Default-Swaps-OpenGamma.pdf&quot; rel=&quot;noreferrer&quot;&gt;found this&lt;/a&gt; where the authors write about the ISDA CDS standard model. It would nevertheless be useful to have the official documentation by ISDA.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2014-05-27T13:31:10.290" LastActivityDate="2015-03-02T18:00:36.227" Title="Documentation of the ISDA CDS standard model" Tags="&lt;credit&gt;&lt;pricing-formulae&gt;&lt;credit-risk&gt;&lt;cds&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="11458" PostTypeId="1" CreationDate="2014-05-27T13:27:53.670" Score="3" ViewCount="639" Body="&lt;p&gt;&lt;strong&gt;Short version&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why do we take market prices as the prices to be estimated and predicted? The common answer is &lt;a href=&quot;http://en.wikipedia.org/wiki/Efficient_market_hypothesis#Theoretical_background&quot; rel=&quot;nofollow noreferrer&quot;&gt;efficient markets hypothesis&lt;/a&gt; as in &quot;Market agents do their best effort given their information set, therefore market prices are optimal.&quot; Is there another way?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I should add that it is the academic way of doing this. If you are to publish a paper you show how well your model represents the market compared to other models. See an example&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.researchgate.net/publication/222404856_GARCH_vs._stochastic_volatility_Option_pricing_and_risk_management&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.researchgate.net/publication/222404856_GARCH_vs._stochastic_volatility_Option_pricing_and_risk_management&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Long Version&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose I have a nice option pricing model (say Model A) to estimate some option contracts' fair prices. I use this model to estimate some of the contracts existing in the market. Let's denote the set of the price estimates as &quot;Estimate Set A&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And let's say there is another option pricing model (say Model A) doing the same thing and get some estimates as &quot;Estimate Set B&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And then we have the market prices since those are exchange traded options. And let's call them, well, &quot;Market Prices&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;I would like to know whether model A or model B is a 'better' option pricing model.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From what I have seen on numerous academic studies, the convention is to use an error  function like root mean squared error (RMSE) and sometimes relative pricing error or some other derivation and take the Market Prices set to measure the error from. To illustrate let's say there are 4 contracts Estimate set A consists of (1, 2, 3, 4) and estimate set B consist of (4, 1, 3, 2) and market prices are (2, 3, 2, 3).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;RMSE of A:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sqrt{(1-2)^2+(2-3)^2+(3-2)^2+(4-3)^2} = 2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;RMSE of B:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sqrt{(4-2)^2+(1-3)^2+(3-2)^2+(2-3)^2} = \sqrt{10} \sim 3.16$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Conclusion: A is better than B&lt;/em&gt;&lt;/strong&gt; (of course it is slightly more complicated)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only rationale I can find from the literature behind this logic is the assumption that comes from efficient markets hypothesis.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;All that is required by the EMH is that investors' reactions be random&#xA;  and follow a normal distribution pattern so that the net effect on&#xA;  market prices cannot be reliably exploited to make an abnormal profit,&#xA;  especially when considering transaction costs (including commissions&#xA;  and spreads). Thus, any one person can be wrong about the&#xA;  market—indeed, everyone can be—but &lt;em&gt;the market as a whole is always&lt;/em&gt;&#xA;  &lt;em&gt;right&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Option pricing performance convention is built right atop of this hypothesis. The problem is the implicit assumption of the market price optimality. If the market prices are optimal then there is no way a model can be used as a trading strategy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose your model estimate the price of the contract as 1.5 (say dollars) and the market price of the contract is 1.2. If you gauged your model with the market prices you should accept you are off 0.3$. So why bother with a model, even more why bother with trading?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any other way?&lt;/p&gt;&#xA;" OwnerUserId="8147" LastEditorUserId="26595" LastEditDate="2017-08-05T02:52:47.983" LastActivityDate="2021-01-02T01:57:57.977" Title="Is there any other way to measure option pricing model performance than proximity to market prices?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;benchmark&gt;" AnswerCount="6" CommentCount="7" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11459" PostTypeId="2" ParentId="11421" CreationDate="2014-05-27T14:04:26.273" Score="-2" Body="&lt;p&gt;If in the domain considered it is never optimal to exercise, then the price of an American option converges to the price of an European option. This means that the price of an American option is continuous in a domain of non-exercise as it is the case for European Options (&lt;em&gt;1&lt;/em&gt;). This also means that the price of an American Option could be replicated by a portfolio of European options, one for each of the time-segment where early exercise is never optimal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(&lt;em&gt;1&lt;/em&gt;) I'd like to point out that this is, afaik, true for any model as option models give continuous prices for European products &lt;strong&gt;by design&lt;/strong&gt; (with proper parameter choice) - it would be a trading/hedging hell otherwise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only time the holder of an American call option should consider early exercise is just prior to the stock going ex-dividend. There is where you may have your discontinuity as at exercise opportunity the value of American call is the max between the value of the product shall the owner not exercise and the value of the exit opportunity. Mark Joshi in &quot;The concepts and practice of Methematical finance&quot; explains better this, here I am just trying to pass along an intuition. The idea is to work backwards, from maturity to T=0, looking at the European replication and at the exercise opportunity work out the max.&#xA;Similar argument applies to American puts where we could create a mesh of intervals where it is never optimal to exercise between points of possible early exercise, that over the entire life-time of the option.&lt;/p&gt;&#xA;" OwnerUserId="6781" LastEditorUserId="6781" LastEditDate="2014-05-28T06:49:01.330" LastActivityDate="2014-05-28T06:49:01.330" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="11460" PostTypeId="2" ParentId="11458" CreationDate="2014-05-27T14:35:40.787" Score="1" Body="&lt;p&gt;&lt;strong&gt;This may well off-topic, but I'd like to clarify on the concept of risk-neutral pricing, which is the framework where most of the option pricing models operate.&lt;/strong&gt; This should maybe add a perspective over the topic and this should give a partial answer to your very open-ended question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When we are talking about option pricing, we are generally talking about &lt;strong&gt;&quot;risk-neutral&quot;&lt;/strong&gt; pricing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The goal is to price a product in a risk-neutral framework is to take some liquid products and put them together to replicate the payoff of some other  product (look up the derivation of the B-S formula).  In the business, once your pay-off has been replicated, you can hedge risk exposures through liquid products. This is particularly cornerstone in the case of a dealer of OTC products.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perfect replication of a pay-off is not always possible. Therefore, you may want to extract &quot;information&quot; from liquid products to price your OTC. This is the context where I have seen the use of RMSE as a mean to gauge the quality of the calibration of your model - first you fit the model to your liquid products, then you use the model to price your OTC.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One other goal of model calibration might be extract information from a term structure, an array of securities. In this case, I have in mind, for example, local and stochastic vol models. The benefit of such models is to manage an entire portfolio of options in the present of a volatility smile/smirk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In conclusion, risk-neutral pricing does not lead to any conclusion over market expectations. The goal is to price something and hedge away the risk with the liquid assets, available on the market right now.&lt;/p&gt;&#xA;" OwnerUserId="6781" LastEditorUserId="6781" LastEditDate="2014-05-27T14:42:18.007" LastActivityDate="2014-05-27T14:42:18.007" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11461" PostTypeId="2" ParentId="11437" CreationDate="2014-05-27T15:25:26.730" Score="2" Body="&lt;p&gt;This tackles the second part of your question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a world were interest rates are always zero (for simplicity sake), if the discount price process is a martingale, we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E[X_T | F_t] = X_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In an arbitrage free world, every price process is a martingale in the risk-neutral measure. Having martingale price processes means that if we build a hedged portfolio of value $P=0$ today, for the expected value to be possibly positive and the expected value to be zero, there must be positive probability of the portfolio ending up having a loss. This rules out the existence of an arbitrage by its definition (see definition here): generating profits without the risk of a loss.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the first question:&#xA;This is a financial engineering statement. The modus-operandi is to decompose financial product in their cash-flows and then discount them to present value. Not sure if I could add much more on that.&lt;/p&gt;&#xA;" OwnerUserId="6781" LastActivityDate="2014-05-27T15:25:26.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11462" PostTypeId="2" ParentId="11437" CreationDate="2014-05-27T17:22:41.820" Score="2" Body="&lt;p&gt;To give you another perspective:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us assume that the world had only one risky/noisy asset $S(t)$ and let us further assume that at time $T$ our process cann only have $n$ states - namely $(S_1, \dots, S_n)$ and that the interest rate was flat and given by $r$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let's say we have a payoff funtion $f(x): \mathbb{R}\to\mathbb{R}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Working under the risk neutral measure $Q$ the time $t$ price of the derivative paying $f(S(T))$ at time $t=0$ is given by&#xA;$$&#xA;V(0)=e^{-rT}\mathbb{E}^Q[f(S(T))]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we know that $S(T)$ only has $n$ different states and can thus decompose above expectation into&#xA;$$&#xA;V(0)=e^{-rT}\mathbb{E}^Q[f(S(T))]=e^{-rT}\sum_{i=1} \mathbb{E}^Q[f(S_i)]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Thus our price is determined by the expected present values of the&#xA;  different cash-flows that can be generated by our instrument/product.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In above case one would actually already know the price for every function $g(x):\to\mathbb{R}\to\mathbb{R}$ if all the probabilities &#xA;$P_i=\mathbb{P}^Q(S(T)=S_i)$ were known.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The price would then be given by&#xA;$$&#xA;V(0)=e^{-rT}\mathbb{E}^Q[g(S(T))]=e^{-rT}\sum_{i=1} P_ig(S_i)&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-05-27T17:22:41.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11464" PostTypeId="2" ParentId="85" CreationDate="2014-05-27T19:00:37.420" Score="3" Body="&lt;p&gt;There is a whole family of GARCH option pricing models; ones with complex distributions, leverage effects, skewness parameters etc. For an example see &lt;a href=&quot;http://www.jstor.org/discover/10.2307/30046228?uid=3738736&amp;amp;uid=2&amp;amp;uid=4&amp;amp;sid=21103805739541&quot; rel=&quot;nofollow&quot;&gt;Christoffersen and Jacobs (2004)&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some example GARCH models:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;NGARCH&lt;/li&gt;&#xA;&lt;li&gt;EGARCH&lt;/li&gt;&#xA;&lt;li&gt;TGARCH&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Some distributions that can be used:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Hyperbolic&lt;/li&gt;&#xA;&lt;li&gt;Normal Inverse Gaussian&lt;/li&gt;&#xA;&lt;li&gt;Variance Gamma&lt;/li&gt;&#xA;&lt;li&gt;and the generalized form Generalized Hyperbolic&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="8147" LastEditorUserId="848" LastEditDate="2014-05-28T07:01:38.963" LastActivityDate="2014-05-28T07:01:38.963" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11466" PostTypeId="2" ParentId="11437" CreationDate="2014-05-27T21:52:41.080" Score="0" Body="&lt;p&gt;Simply put, it is all about modelling the underlying asset(s) and option price is the discounted value of that asset's price in the future. Martingale measure pricing is somewhat close to &quot;steady-state&quot; from markov chain literature. If you know the expected steady-state price of your asset in the future you can discount it by the risk-free rate to get your fair price.&lt;/p&gt;&#xA;" OwnerUserId="8147" LastActivityDate="2014-05-27T21:52:41.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11469" PostTypeId="2" ParentId="85" CreationDate="2014-05-28T08:11:32.437" Score="1" Body="&lt;p&gt;There seems to be a tendency to include ever more risk factors into the models. CVA is a good example: based on credit default swaps it is possible to calibrate model parameters and include the risk of default into a Monte Carlo pricer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The book &lt;a href=&quot;http://www.amazon.de/Counterparty-Credit-Risk-challenge-financial/dp/047068576X&quot; rel=&quot;nofollow&quot;&gt;Counterparty Credit Risk: The new challenge for global financial markets (Amazon)&lt;/a&gt; discusses counter party risk in detail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the implementation perspective: Mathworks has a nice practical discussion of &lt;a href=&quot;http://www.mathworks.de/de/help/fininst/examples/counterparty-credit-risk-and-cva.html&quot; rel=&quot;nofollow&quot;&gt;counterparty credit risk and CVA&lt;/a&gt; including example code. &lt;/p&gt;&#xA;" OwnerDisplayName="user1157" LastActivityDate="2014-05-28T08:11:32.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11470" PostTypeId="2" ParentId="11458" CreationDate="2014-05-28T08:30:42.617" Score="1" Body="&lt;p&gt;You could go for a backtesting strategy and measure the p&amp;amp;l that trading according to your model would generate over different time intervals. Your model might be off the market prices today, but if your model is better, there will be a time-frame where it aligns again. This would be an opportunity to make money. One could say you would have found a model arbitrage opportunity.&lt;/p&gt;&#xA;" OwnerDisplayName="user1157" LastActivityDate="2014-05-28T08:30:42.617" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11471" PostTypeId="1" AcceptedAnswerId="11473" CreationDate="2014-05-28T08:31:33.137" Score="6" ViewCount="1609" Body="&lt;p&gt;Do successful applications of chaos theory to quant finance exist ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While still in the university I remember some people mentioning how chaos theory and fractals could be applied in a finance context. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The topic has kind of escaped my radar until now. Usually I am quite skeptical when it comes to the application of new research to quant finance. Often the added value isn’t significant but the increase in complexity is.  It starts with some famous researching mentioning how some purely theoretical concept might be applied e.g. in pricing derivatives.  This precipitates a small landslide of academic research (mostly done by  PhD students). &#xA;After a while people in finance notice those ideas and try first implementations which then show the added benefit to be only marginal. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;As I seet it generally two aspects of &lt;a href=&quot;http://en.wikipedia.org/wiki/Chaos_theory#cite_note-65&quot; rel=&quot;nofollow&quot;&gt;chaos theory&lt;/a&gt; could be suited for&#xA;  a financial application: &lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;spontaneous order (might be used to model how market prices come to    pass)&lt;/li&gt;&#xA;  &lt;li&gt;distinguishing between random and chaotic data (might be usefuly when dealing with financial time series)&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Some references that I personally find interesting&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://halshs.archives-ouvertes.fr/docs/00/43/60/81/PDF/guegan_WPB07054.pdf&quot; rel=&quot;nofollow&quot;&gt;Chaos in Economics and Finance&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.wilmott.com/messageview.cfm?catid=3&amp;amp;threadid=72287&quot; rel=&quot;nofollow&quot;&gt;Is Chaos theory in finance dead?&lt;/a&gt; (nice discussion on Willmott forum)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0465043577&quot; rel=&quot;nofollow&quot;&gt;The Misbehavior of Markets&lt;/a&gt; (book by Mandelbrot)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0471585246&quot; rel=&quot;nofollow&quot;&gt;Fractal Market Analysis: Applying Chaos Theory to Investment and Economics&lt;/a&gt; (book by Edgar Peter)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The book by mandelbrot intrigues me the most - I put it on my to read list out of curiosity&lt;/p&gt;&#xA;" OwnerUserId="7279" LastEditorUserId="7279" LastEditDate="2014-05-28T19:19:37.283" LastActivityDate="2020-04-29T23:33:27.920" Title="Successfull applications of Chaos Theory in Quant Finance" Tags="&lt;option-pricing&gt;&lt;research&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11472" PostTypeId="2" ParentId="11471" CreationDate="2014-05-28T11:00:28.097" Score="4" Body="&lt;p&gt;&lt;a href=&quot;http://users.math.yale.edu/mandelbrot/webbooks/wb_fin.html&quot; rel=&quot;nofollow&quot;&gt;Benoit Mandelbrot&lt;/a&gt; applied fractals and self-similarity to financial markets and the hurst exponent has its roots in chaos theory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Look at &lt;a href=&quot;http://www.wilmott.com/pdfs/0503_bouchaud.pdf&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; article from Wilmott magazine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just a personal note:&#xA;I have not worked that much with this kind of theory so far but I also have not seen any of my peers being exceptionally sucessfull with these methods.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-05-28T11:00:28.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11473" PostTypeId="2" ParentId="11471" CreationDate="2014-05-28T11:15:38.870" Score="3" Body="&lt;p&gt;I think one notable application of chaos theory (in the sense of non-linear dynamics) in financial markets is the work done by phyicist Didier Sornette.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find most of his publications and projects (actually lots of them) here on his page at the ETH Zürich: &lt;a href=&quot;http://www.er.ethz.ch/fco&quot; rel=&quot;nofollow&quot;&gt;http://www.er.ethz.ch/fco&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2014-05-28T11:15:38.870" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11475" PostTypeId="2" ParentId="675" CreationDate="2014-05-28T12:35:46.497" Score="2" Body="&lt;p&gt;&lt;em&gt;Disclaimer: I am the author and I just pushed it to sourceforce&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://lobianco.org/antonello/personal%3aportfolio%3aportopt&quot; rel=&quot;nofollow&quot;&gt;PortOpt&lt;/a&gt; is a open-source wrapper to &lt;a href=&quot;http://quadprog.sourceforge.net/&quot; rel=&quot;nofollow&quot;&gt;Quadprog++&lt;/a&gt; (a C++ quadratic solver) for solving portfolio optimisation problems that supports agents' linear indifference curves toward risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It has a python binding that let optimise portfolio problems as easy as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import portopt&#xA;results = portopt.solveport(covar_matrix,means_vector,risk_adv_coef)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However at this moment it doesn't contain anything else than solving the portfolio optimisation (and in particular, it doesn't have functions for alternative covariance functions nor lower partial moment portfolio optimization).&lt;/p&gt;&#xA;" OwnerUserId="8154" LastEditorUserId="467" LastEditDate="2014-05-28T13:19:23.337" LastActivityDate="2014-05-28T13:19:23.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11476" PostTypeId="2" ParentId="11445" CreationDate="2014-05-28T15:56:31.743" Score="3" Body="&lt;p&gt;Here are some practical tips for selecting stochastic processes for spread curves, for example, in Monte Carlo simulation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typically you formulate a joint stochastic model for yields at key maturities due to data limitations.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The corporate yield curves generally maintain order with the AAA yield below AA yield, AA yield below A yield, etc.  If, for example, you are simulating the evolution of three curves: the risk-free base, A- rated, and B-rated, then use stochastic models for relative spreads that preserve order.  Let $r(t,T_i)$, $r_A(t,T_i)$, and $r_B(t,T_i)$ denote the risk-free, A-rated, and B-rated yields, respectively, at time $t$ corresponding to some maturity $T_i$.  Let $s_A(t,T_i)=r_A(t,T_i)-r(t,T_i)$ and $s_{A,B}(t,T_i)=r_B(t,T_i)-r_A(t,T_i)$ denote the relative spreads.  You can enforce the order by using log-type processes for the spreads to prevent negative values. For example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d\log S_A=\mu(S_A,t)dt+\sigma(S_A,t)dZ_A, \\\ d\log S_{A,B}=\mu(S_{A,B},t)dt+\sigma(S_{A,B},t)dZ_{AB}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Z_A(t)$ and $Z_{AB}(t)$ are correlated Brownian processes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The next requirement is that the simulated term structures do not exhibit arbitrage opportunities (negative forward yields).  This can be controlled to some extent with several additonal features:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) Correlation of the vector of Brownian processes driving the random fluctuations - there is one Brownian process corresponding to each curve and each key maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) Incorporating mean-reversion in the drift terms. Additionally mean reversion is a commonly observed characteristic of yield movements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, these two measures may not be sufficient to eradicate arbitrage violations from all sample paths. A final measure that generally works is to allow a coupling of the yields at different maturities in the drifts. One way to do this is to use a vector-autoregressive model.&lt;/p&gt;&#xA;" OwnerUserId="8153" LastActivityDate="2014-05-28T15:56:31.743" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11477" PostTypeId="1" CreationDate="2014-05-28T20:04:57.850" Score="3" ViewCount="1981" Body="&lt;p&gt;Take two stocks, WWE and XPO, both traded on NYSE. Today, May 28, 2014,&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;XPO has options expiring August 2014...&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.google.com/finance/option_chain?q=NYSE%3AXPO&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Jy21d.png&quot; alt=&quot;XPO options&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;...while WWE doesn't:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.google.com/finance/option_chain?q=NYSE%3AWWE&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/YzUv3.png&quot; alt=&quot;WWE options&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From my experience, the missing expiration month options do eventually show up, so I've linked the screenshots above to Google Finance to check later.&lt;/p&gt;&#xA;" OwnerUserId="8158" LastEditorUserId="8158" LastEditDate="2014-05-29T23:13:05.170" LastActivityDate="2014-05-30T01:06:13.607" Title="Why do some stock options have expiration dates for a given month, while others don't?" Tags="&lt;options&gt;&lt;expiration&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11478" PostTypeId="1" CreationDate="2014-05-28T21:44:15.107" Score="0" ViewCount="946" Body="&lt;p&gt;What can we say about an asset which $\beta$ calculated using the CAPM model (regressing the excess returns of the stock vs excess returns of the market) is insignificant?&lt;/p&gt;&#xA;" OwnerUserId="8159" LastEditorUserId="70" LastEditDate="2014-05-29T10:25:26.307" LastActivityDate="2014-05-29T13:15:01.233" Title="What does it mean if $\beta$ is insignificant in the CAPM model?" Tags="&lt;risk-models&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11479" PostTypeId="2" ParentId="11477" CreationDate="2014-05-29T02:13:50.840" Score="1" Body="&lt;p&gt;It's on a different expiration cycle.&lt;/p&gt;&#xA;" OwnerUserId="8160" LastActivityDate="2014-05-29T02:13:50.840" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="11480" PostTypeId="2" ParentId="11478" CreationDate="2014-05-29T07:27:10.747" Score="2" Body="&lt;p&gt;Look at the process of &lt;em&gt;estimating&lt;/em&gt; your $\beta$ (since if you ask about significance, you have an estimation viewpoint): you try to fit a linear model between your returns $r$ and a factor returns $F$ like&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r = \beta \cdot F + \epsilon,$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\epsilon$ is your &lt;em&gt;tracking error&lt;/em&gt; around the factor (or more accurately around the part of your returns explained by the factor).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your question about $\beta$ being significantly different from zero, can now be read as a linear regression significance question. They is a common knowledge about this.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;For instance the &lt;a href=&quot;http://reliawiki.org/index.php/Simple_Linear_Regression_Analysis#Hypothesis_Tests_in_Simple_Linear_Regressionhttp://reliawiki.org/index.php/Simple_Linear_Regression_Analysis#Hypothesis_Tests_in_Simple_Linear_Regression&quot; rel=&quot;nofollow noreferrer&quot;&gt;t-test&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;but you can ask &lt;a href=&quot;http://www.uv.es/uriel/4%20Hypothesis%20testing%20in%20the%20multiple%20regression%20model.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;a lot of other questions&lt;/a&gt; about the significance of your $\beta$.&lt;/li&gt;&#xA;&lt;li&gt;&quot;of course&quot; you can face different conclusions coming from different tests, here is a &lt;a href=&quot;https://stats.stackexchange.com/questions/24720/significance-of-coefficients-in-linear-regression-significant-t-test-vs-non-sig&quot;&gt;cross-stackexchange link about this&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2014-05-29T07:27:10.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11481" PostTypeId="1" CreationDate="2014-05-29T07:36:43.000" Score="1" ViewCount="72" Body="&lt;p&gt;In Islamic Finance there is a contract called &quot;Salaf&quot; or &quot;Salam&quot; which is similar to Forwards except in time of payment which happens in the entering contract day (exactly unlike the Forwards).&#xA;Some people says It isn't Forward but some other include Salaf in Forwards for instance&#xA;Muhammad Ayub in &quot;&lt;a href=&quot;http://eu.wiley.com/WileyCDA/WileyTitle/productCd-0470030690.html&quot; rel=&quot;nofollow&quot;&gt;Understanding Islamic Finance&lt;/a&gt;&quot;: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Bai‘ Salam is an ancient form of forward contract wherein...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So the Question is which is the main point &quot;Time of Delivery&quot; or &quot;Time of Payment&quot; in Forwards? &lt;/p&gt;&#xA;" OwnerUserId="8162" LastEditorUserId="2299" LastEditDate="2014-05-29T12:48:50.930" LastActivityDate="2014-05-29T12:48:50.930" Title="What is the main point in the Forward contracts definition?" Tags="&lt;forward&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11484" PostTypeId="1" CreationDate="2014-05-29T13:17:58.553" Score="5" ViewCount="445" Body="&lt;p&gt;I am reading an &lt;a href=&quot;http://www.thalesians.com/archive/public/academic/finance/papers/Zumbach_2000.pdf&quot;&gt;article&lt;/a&gt; by Zumbach and Müller whose name is &lt;em&gt;Operators on Inhomogeneous Time Series&lt;/em&gt;. This is interesting in general, but my main goal is to learn a good and efficient method to calculate volatility of inhomogeneous time series (of prices).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far I was calculating volatility in the following way: I have created an artificial regular time series, spaced by 5 seconds (say), and calculated the simple standard deviation of the returns of these intervals, and annualized. In the paper I'm reading, the authors explain that this method is noisy and that it loses data (and this is clear). In addition, they claim that while this method uses $L^2$ norm, it may be a better option to use $L^1$ norm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question 1.&lt;/strong&gt; why? If I'm going to treat volatility as some sense of standard deviation, why would I use a definition which is less similar?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Later, the authors provide their own volatility operator, which uses three parameters, $\tau$, $\tau'$ and $p$. $\tau$ is the time being checked, but $\tau'$, which is more important, is the time interval in question (for example, in my method, $\tau'$ would be 5 seconds). $p$ is the norm dimension - that is, if we &quot;work&quot; in $L^2$, $p$ would be 2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Their definition involves two previously defined operators - the norm operator which is the square root of the moving average of the square values, and the differential operator, which is a very weird operator involving empirical constants which the authors claim that are much better than the common return operator $r[\tau](t) = x(t) - x(t-\tau)$. It looks like this:&#xA;$$\Delta[\tau] = \gamma(EMA[\alpha\tau,1] + EMA[\alpha\tau,2] - 2EMA[\alpha\beta\tau,4])$$&#xA;where $\gamma=1.22208$, $\beta=0.65$ and $\alpha^{-1}=\gamma(8\beta-3)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question 2.&lt;/strong&gt; why? Should I really use an empirical formula, instead of simply use a (perhaps a little bit noisy) interpolation scheme and simply calculate returns and their standard deviations?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you see any real profit in the above mentioned idea?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question 3.&lt;/strong&gt; Don't you think it worth working with log-returns instead of returns in general?&lt;/p&gt;&#xA;" OwnerUserId="2723" LastActivityDate="2014-05-29T13:17:58.553" Title="Calculating volatility of inhomogeneous time series" Tags="&lt;volatility&gt;&lt;time-series&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11485" PostTypeId="1" CreationDate="2014-05-29T14:16:57.493" Score="2" ViewCount="109" Body="&lt;p&gt;I am trying to generate a custom tick index using two indices (Let's say australian index ASX 200 and Japenese Index NKY). Japan index ticks every 10 seconds...and australia ticks every 30/35 seconds. So obvious problem is ticks don't line up! Apart from a generic solution of interpolation is there any other way to combine them?&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;If I use the old tick of australian index, whenever a new japan index tick occurs then a news event in the middle of two austrlian ticks might create a problem. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is it correct to use some sort of poisson process on arrival of australian index ticks? Probabilities might serve as weights!!&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The custom index might be used to price a 1 minute binary option so keeping current information is important. &lt;/p&gt;&#xA;" OwnerUserId="8163" LastActivityDate="2014-05-29T14:16:57.493" Title="Tick Data Poisson Process" Tags="&lt;tick&gt;&lt;binary&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11486" PostTypeId="1" CreationDate="2014-05-29T18:04:36.067" Score="2" ViewCount="3437" Body="&lt;p&gt;Why does CDS spreads track the implied volatility on equities? What is the fundamental relationship that would keep the two inline from deviating too far from each other?&lt;/p&gt;&#xA;&lt;p&gt;My speculation: Could it be because CDS spreads are not necessarily “pure” compensation of default risk but also include spread volatility risk and that this spread volatility is a larger driver of the CDS spreads than default risk compensation and because it is highly correlated with equity volatility, that is the reason why bond insurance and stock insurance move in tandem.  If it is the case, then CDS spreads are not “pure” default risk compensation, has anyone then built a way to filter out the spread volatility risk to arrive at the “Pure CDS Spread Default Compensation Risk ” for an issuer?&#xA;Knowing the tight relationship between has anyone built an implied probability of default based on equity volatility for an obligor?&lt;/p&gt;&#xA;&lt;p&gt;Would appreciate all your opinion on the topic.&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Aa6Wo.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/p&gt;&#xA;" OwnerUserId="4729" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2014-06-17T21:21:30.583" Title="CDS Spreads and Equity Volatility" Tags="&lt;implied-volatility&gt;&lt;cds&gt;&lt;default-probability&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="11488" PostTypeId="2" ParentId="7696" CreationDate="2014-05-29T20:26:43.273" Score="2" Body="&lt;p&gt;This is a not a theoritcal/academic answer relating the two by an equation. But from a practicioners stand point. The relationship between vol and gamma depends on the strategy your putting on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example. In a Short Straddle/Strangle/Butterfly/Iron Condor. Your short theta and the risks your taking are gamma risk, even though your delta neutral, and &lt;strong&gt;implied&lt;/strong&gt; vol risk. If Implied vol rises, your contracts go up in value and since your short the contracts, your position takes a negative hit. Not to mention if &lt;strong&gt;realized&lt;/strong&gt; volatility does rise, and the stock moves toward your break-even zones, either by trending up or trending down, you also lose money.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which raises another question is this always the case, can there be a position constructed such that one is long theta (same thing as saying short gamma) but long volatility (long vega)?? The answer is yes. In a long calendar spread your technically short theta, the theta on the further out option that your selling is greater than theta on the shorter maturity contract which is being bought, your net short premium from the spread, your long theta, short gamma, but yet your long vega/volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the answer to your question - it depends. Just my 2 cents&lt;/p&gt;&#xA;" OwnerUserId="4729" LastEditorUserId="24999" LastEditDate="2016-10-26T18:17:21.233" LastActivityDate="2016-10-26T18:17:21.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11490" PostTypeId="2" ParentId="11477" CreationDate="2014-05-30T01:06:13.607" Score="1" Body="&lt;p&gt;There is a good explanation of this on &lt;a href=&quot;http://www.investopedia.com/articles/optioninvestor/03/090303.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;Investopedia&lt;/a&gt;. A few quotes summarizing the issue:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;Not All Stocks Trade the Same Options&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;When stock&#xA;options first began trading, each stock was assigned to one of three&#xA;cycles: January, February or March. There is no meaning as to which&#xA;cycle a stock was assigned - it was purely random.&lt;/p&gt;&#xA;&lt;p&gt;Stocks assigned to the January cycle had options available only in the&#xA;first month of each quarter: January, April, July and October. Stocks&#xA;assigned to the February cycle had only the middle months of each&#xA;quarter available: February, May, August and November. Stocks on the&#xA;March cycle had the end months of each quarter available: March, June,&#xA;September and December.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;The Modified Expiration Cycles&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;the original rules were modified, and in 1990, the CBOE decided that&#xA;every stock would always have the current month plus the following&#xA;month available to trade.&lt;/p&gt;&#xA;&lt;p&gt;Every stock has at least four expiration months trading. Under the new&#xA;rules, the first two months are always the two near months, but for&#xA;the two farther-out months, the rules use the original cycles.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Adding LEAPS&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;If a stock has LEAPS available, then more than four expiration months will be available.&lt;/p&gt;&#xA;&lt;p&gt;LEAPS are long-term options that, with some exceptions, are no more&#xA;than three years out and usually trade with a January expiration date.&#xA;If a stock does have LEAPS, then new LEAPS are issued in May, June or&#xA;July depending on the cycle to which the stock is assigned.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;But you really need to read through all of the article (and follow the links there) to understand the issue, it is quite convoluted.&lt;/p&gt;&#xA;" OwnerUserId="5086" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2014-05-30T01:06:13.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11491" PostTypeId="1" CreationDate="2014-05-30T04:06:35.243" Score="0" ViewCount="126" Body="&lt;p&gt;Is there a function in Bloomberg that allows the user to search the best performing stocks for a given year, say 2011, in any given stock exchange?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I want to see the best performing stocks in 2011 for all stocks listed on the NYSE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, is there a function that allows me to specify a time frame, say 5/5/2011 to 5/5/2012, and see the best performing stocks from that specific time frame?&lt;/p&gt;&#xA;" OwnerUserId="8168" LastActivityDate="2014-06-01T14:20:57.503" Title="Best performing stocks in given year" Tags="&lt;historical-data&gt;&lt;bloomberg&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11492" PostTypeId="1" AcceptedAnswerId="11493" CreationDate="2014-05-30T04:34:41.780" Score="5" ViewCount="553" Body="&lt;p&gt;Consider a forward rate agreement on LIBOR (say), which starts 2 months from now, expires after 3 months  and has strike $K$, and is based on $3M$ LIBOR -- $FRA_{2\times 5}$. Now the present value of this contract is,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\frac{\alpha\cdot (L_{3m}(2m) - K)}{1 + \alpha\cdot L_{3m}(2m)}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\alpha$ is the relevant day count fraction, $L_{3m}(2m)$ refers to the 3 month LIBOR rate in 2 months time (assume unit notional for ease).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see the term $1 + \alpha\cdot L_{3m}(2m)$ in the above equation as a discount rate applied to the pay out $L_{3m}(2m) - K$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why do we apply the $L_{3m}(2m)$ rate for the discounting? Why not apply a short term money market rate or any other rate for that matter -- I guess I am also asking how we choose the rate that we apply for the discounting?&lt;/p&gt;&#xA;" OwnerUserId="7772" LastActivityDate="2014-05-30T07:55:32.970" Title="meaning of discount term in FRA value" Tags="&lt;fixed-income&gt;&lt;derivatives&gt;&lt;forward&gt;&lt;forward-rate&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11493" PostTypeId="2" ParentId="11492" CreationDate="2014-05-30T07:55:32.970" Score="3" Body="&lt;p&gt;A very good and up-to-date question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whether you use the LIBOR-rate or any other rate for discounting depends on what you decide to be the fundamental rates in the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before the crisis LIBOR-rates were mostly seen as the fundamental market rates (or the &quot;risk-neutral&quot; rates). After the crisis it turned out that these rates were not completely free of default risk. This is why noawadys an increasing number of banks has started to use the OIS-curve as the base curve. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the paper &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2211800&quot; rel=&quot;nofollow&quot;&gt;LIBOR vs. OIS: The Derivatives Discounting Dilemma&lt;/a&gt; Hull and White present a solid case in favor of OIS discounting. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the concrete application to forward-contracts this entails that one might end up using a different rate than LIBOR for discounting - e.g. ones base on overnight indexed swaps (OIS). Thus you will have to work with two curves instead of one (LIBOR + the curve you use for discounting)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As always Fabio Mercurio already did most of the work again. You will find an approah on how to deal with forward-contracts in a multi-curve setting in his paper: &#xA;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1563685&quot; rel=&quot;nofollow&quot;&gt;LIBOR Market Models with Stochastic Basis&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;An easy rule of thumb when to use LIBOR and when the e.g. OIS-curve:&lt;/strong&gt; When the transactions involved in the product are&#xA;  collaterized $\to$ use OIS or an equivalent. For non-collaterized&#xA;  transaction discounting with LIBOR can be used.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-05-30T07:55:32.970" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11494" PostTypeId="1" AcceptedAnswerId="11495" CreationDate="2014-05-30T10:53:39.263" Score="1" ViewCount="1477" Body="&lt;p&gt;I wanted to quickly confirm some simple calculations for the Black 76 greeks and was making use of the formulas on this website:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://riskencyclopedia.com/articles/black_1976/&quot; rel=&quot;nofollow&quot;&gt;http://riskencyclopedia.com/articles/black_1976/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have an issue with their statement of Rho and I wanted to check with you guys. Their version  for a call has:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\rho = \tau e^{-r\tau}K\Phi(d_2)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whereas I feel it should be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\rho = \tau e^{-r\tau}(K\Phi(d_2) - F \Phi(d_1))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\rho = - \tau C$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $C$ is the Black76 call option price:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C = e^{-r\tau}(F \Phi(d_1) - K\Phi(d_2))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would really appreciate your input as the one person to post on my comment disagrees with me!&lt;/p&gt;&#xA;" OwnerUserId="8171" LastActivityDate="2014-05-30T11:50:03.110" Title="What is the Rho of an option on a futures contract priced using the Black 76 model?" Tags="&lt;options&gt;&lt;futures&gt;&lt;greeks&gt;&lt;black76&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11495" PostTypeId="2" ParentId="11494" CreationDate="2014-05-30T11:50:03.110" Score="2" Body="&lt;p&gt;I agree with you. &#xA;In the setting of Black 76 we consider an option on a forward/futures price $F$.&#xA;$F$ is modelled as geometric Brownian motion and in contrast to the usual BM model the futures price does not grow with the risk-less rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you formula for the call (C) is correct. Note that in general neither $F$, $d_1$ nor $d_2$ contain the term $r$. Then taking the derivative w.r.t. $r$ we arrive at your formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case where the forward price can be found by cost-of-carry pricing (e.g. options on equity indices things simplify because then&#xA;$$F_t = S_0 \exp((r-q)t),$$&#xA;which simplifies further if $q=0$&#xA;Then the $r$ terms cancles out but then in fact we are back in the BS model.&#xA;Thus I would say: if cost-of-carry in the sense of the above formula holds, then Black-Scholes and Black 76 are just the same thing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the example pf VIX-futures cost-of-carry does not hold and one needs B76 (if one wants to model VIX-futures as GBM which is debateable).&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-05-30T11:50:03.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11496" PostTypeId="2" ParentId="2775" CreationDate="2014-05-30T19:29:30.140" Score="1" Body="&lt;p&gt;I have a bit of experience backtesting options. I would love to know a benchmark applicable to all stocks. Unfortunately, it might now exist, IMHO. Each stock has own benchmark for position entry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using Oscreener tool, I discovered that most stocks with strong fundamentals have cyclical performance in upward direction. Sometimes 20day Moving avarage = down is a good sign for position entry with some stocks and some other times 20 day MA - UP is a good sign to enter the market for some other stocks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, I am a directional trader and mostly use Calls when volatility is below the average to avoid any risks. Hope this helps in your findings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good luck!&lt;/p&gt;&#xA;" OwnerUserId="4707" LastActivityDate="2014-05-30T19:29:30.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11497" PostTypeId="2" ParentId="3750" CreationDate="2014-05-30T19:48:35.110" Score="0" Body="&lt;p&gt;Well, I would say this: Shorting options is like picking pennies from a hot manhole. You may get lucky once, twice, xx times but one day you'll get burned and the recurring reward may not cover the recovery expences. So, the short answer is - The benefit from shorting options is very risky.&#xA;This is based on my backtesting experience using oscreener tool.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps in your research.&lt;/p&gt;&#xA;" OwnerUserId="4707" LastActivityDate="2014-05-30T19:48:35.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11500" PostTypeId="2" ParentId="11486" CreationDate="2014-05-30T20:11:44.990" Score="6" Body="&lt;p&gt;For an individual firm, a theoretical model of the capital structure was developed by Robert Merton in 1974.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The simplest form of this model assumes the firm has zero-coupon debt maturing at some future time $T$. Default is defined as the condition where the value of the firm's assets fall below the outstanding debt.  The firm equity is viewed as a call option on the assets expiring at $T$ with strike price equal to the face value of the debt. The model can be used to infer the probability of default and the appropriate credit spread for pricing the risky debt.  The inputs to the model are the current value of the firm's assets, the debt structure and, of great relevance to your question,  the volatility of the assets.  In practice, the asset volatility must be inferred from the observable realized or implied volatility of the stock price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Merton model has been applied widely in systems designed to estimate default probability.  KMV (now part of Moody's) was one of the first companies to develop a commercially available system of this type.  While the basic Merton model underlies such systems, there are many nuances in its implementation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, in short, there are indeed practioners who try to infer implied default probability from equity volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Such a model can also be the foundation for a trading strategy - so-called capital structure arbitrage.  It does not always work out well as the theretical equity-credit relationship can diverge for extended periods or at the worst possible time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A good example of how capital structure arbitrage can go astray are the events surrounding the downgrade of General Motors debt to junk in 2005.  After the downgrade, models signaled a long bond / short equity position.  These positions were squeezed badly as Kirk Kerkorian began making an offer on the stock in an attempt to take control of GM.   &lt;/p&gt;&#xA;" OwnerUserId="8153" LastEditorUserId="8153" LastEditDate="2014-05-30T20:19:21.230" LastActivityDate="2014-05-30T20:19:21.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11502" PostTypeId="2" ParentId="3319" CreationDate="2014-05-30T22:17:02.560" Score="2" Body="&lt;p&gt;Lots of answers, but I'll throw in something very simple and practical.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bonds are priced based the spread investors are willing to pay above treasuries. When they determine the price on a bond with optionality, aka the spread, this price is reflected in the Z Spread. The Z Spread is the complete spread required by investors to compensate for all of the risk, including the embedded optionality, of the bond. OAS simply implies, what would the spread on this bond be if there wasn't any optionality as priced in by the market. &lt;/p&gt;&#xA;" OwnerUserId="8177" LastActivityDate="2014-05-30T22:17:02.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11503" PostTypeId="2" ParentId="3750" CreationDate="2014-05-31T00:03:23.910" Score="-2" Body="&lt;p&gt;Sometimes those limited risk position are too expensive and will only profit under extreme conditions.  On average, you should always add short gamma to your position.&lt;/p&gt;&#xA;" OwnerUserId="8160" LastActivityDate="2014-05-31T00:03:23.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11504" PostTypeId="2" ParentId="11458" CreationDate="2014-05-31T01:11:14.053" Score="1" Body="&lt;p&gt;Speaking from a practitioner's point of view, some of the these would be:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Model sensitivity: what happens when the price shifts by a small&#xA;amount..are we still able to price correctly or do we have to adjust&#xA;the model?&lt;/li&gt;&#xA;&lt;li&gt;Greeks: Is the model able to calculate the greeks accurately/quickly?&lt;/li&gt;&#xA;&lt;li&gt;Model &quot;speed&quot;: How long does it take to calculate the price &amp;amp; greeks..one of the most   important factors for practioners usually. the model should also be able to price non-   vanilla instruments quickly (e.g. asian options, barrier options etc.)&lt;/li&gt;&#xA;&lt;li&gt;Calibration: how many instruments are necessary to ensure a stable model environment? can we use this model for non-liquid markets?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If you are really only interested in the academic way, then I would assume that some of these points would still be quite important. Your model should still be able to calculate greeks, converge quickly and maybe most importantly, not be overparameterized.&lt;/p&gt;&#xA;" OwnerUserId="5350" LastActivityDate="2014-05-31T01:11:14.053" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11505" PostTypeId="1" CreationDate="2014-05-31T04:10:59.400" Score="2" ViewCount="396" Body="&lt;p&gt;I am looking for a hedge fund database that provides returns daily. Is there any data provider that gives daily data?&lt;/p&gt;&#xA;" OwnerUserId="5890" LastActivityDate="2021-03-30T13:59:59.757" Title="Hedge fund database with daily data" Tags="&lt;data&gt;&lt;historical-data&gt;" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11506" PostTypeId="1" AcceptedAnswerId="11507" CreationDate="2014-05-31T11:23:25.240" Score="2" ViewCount="115" Body="&lt;p&gt;I am planning to run regression of half-hourly stock volume against the half-hourly news volume for that particular stock. I am looking at 2 years of data for my analysis.&#xA;However, I am stuck thinking about what should be done to the non-trading hours period on each day?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be specific:&#xA;1. Should I regress the data only for the working hour of the exchange, which means that the Y -values in my regression will contain the &quot;stock volume&quot; in each 30 minutes from 9:30-16:00 on each day from start date to the end date of my regression period and X-values will be the corresponding &quot;news volume&quot; in each 30 minutes?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OR&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Do I need to make the data evenly spaced in 30 minutes and include the &quot;non-trading hours&quot; for each day with &quot;zeros&quot; as the stock volume and the news volume?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I believe the regression result will be different in both the cases. Need an urgent advise.&lt;/p&gt;&#xA;" OwnerUserId="8180" LastActivityDate="2014-06-03T06:07:24.127" Title="Regression of TAQ half-hourly stock volume data against news volume" Tags="&lt;regression&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11507" PostTypeId="2" ParentId="11506" CreationDate="2014-05-31T12:42:13.857" Score="2" Body="&lt;p&gt;Do not run the zeros against the zeros. This is similar to how weekends are treated in academic studies. There is not five days with two additional days of 0 in the regressions for each week in the sample... there is just the five days (although I do encourage you to read about the weekend effect). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your hypothesis is that there exists a function $Volume(t) = f(News(t)) + e(t)$. When the market is closed, no such function can exist, so what are you supposedly estimating with the zeros in the regression equation? If you include the zeroes, then what you are saying to the model is that during these times $Volume(t)=0$ &lt;strong&gt;because&lt;/strong&gt; $News(t)=0$. Yet we know this is false, and that they are both zero because $t \in \{Market Close\}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are really concerned about the irregularly spaced time series, you could consider a more legitimate data generating process:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ Volume(t) = f(News(t))*I(t \in \{Market Open\}) + c*I(t \in \{Market Close\}) + e(t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $I$ is an indicator function. However you will notice that this will give you identical parameter estimates (if $f$ is linear with an intercept) as if you simply estimated the original equation during trading hours only.&lt;/p&gt;&#xA;" OwnerUserId="6081" LastEditorUserId="6081" LastEditDate="2014-06-03T06:07:24.127" LastActivityDate="2014-06-03T06:07:24.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11508" PostTypeId="2" ParentId="8875" CreationDate="2014-05-31T15:02:43.003" Score="-2" Body="&lt;p&gt;did you try to study the cointegration of your data with other data?&#xA;if cointegration exist than you may make benefit from research such:&#xA;Risk Management of Co-integrated Commodities&#xA;Karl Larsson and Marcus Nossman (2011)&lt;/p&gt;&#xA;" OwnerUserId="8181" LastActivityDate="2014-05-31T15:02:43.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11509" PostTypeId="2" ParentId="103" CreationDate="2014-05-31T15:05:27.317" Score="2" Body="&lt;p&gt;I learned something about decision sciences, stochastic processes and mathematical modeling in college &lt;em&gt;before&lt;/em&gt; I learned something about quantitative finance, so I had struggled to grasp the concept which is so familiar and yet so alien. Here is my two bits. I might overlap with some of the previous answers at some parts, but the approach is different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before explaining risk neutral or martingale measure framework we need to clarify something. The objective of option pricing is &lt;strong&gt;to find a fair price&lt;/strong&gt;. The definition of the fair price is the value which both side of the contract (long and short) should make the exact amount of money as if they were agreeing on a deposit with a fixed amount of interest rate (called risk-free rate with common abbreviation &lt;em&gt;r&lt;/em&gt;). Plus some of the fine print; no friction (no taxes, no spread, borrow and lend at the same rate r).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make things even easier with an example assume r is 0 and we live in a perfectly deterministic world. The price of asset A is 100 today and will be 120 in three months. Finally assume that I can only do a transaction (buy or sell the asset itself) after three months. Call it a rigged game if you like. If I were to write a European Call option contract with strike price 100 and maturity three months &lt;strong&gt;the fair price of the contract would be 20&lt;/strong&gt;. Because in three months I will need to sell the asset for 100 to the counterparty (the person who bought the contract from me) and I have to buy it from the market for 120. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There we go. The buyer gave me 20 at t=0 and I bought the asset from the market for 120 and gave it to the buyer for 100. Then the buyer sold the asset to the market for 120. I have nothing in my hands and the buyer got his 20 back. In other words, we only killed time by doing a bunch of transactions and we are on square one. &lt;strong&gt;This is called equilibrium.&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course real world is harsher. First of all real world is quite complex and stochastic (at least to us). You can sell and buy assets most of the time. And risk free rate can be different than 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Risk neutral pricing framework is only a way to estimate the fair price, albeit a popular one. &lt;strong&gt;The basic trick is to replace the drift with the risk-free rate&lt;/strong&gt;. Then you discount your prediction on the asset by the risk free rate. The expected value of your outcome is the same as your current position. &lt;strong&gt;In other words, on average you don't get an extra dime than putting your money into a deposit or a solid bond.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also see that in the classical CAPM model. They essentially say 'No matter how or what you trade, on average you can't make more or less than the risk free rate.' This is the equilibrium state. If you are familiar with the concept it is similar to a steady-state markov chain. You can also relate with the common belief 'You can't beat the market (or index).'&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Complete markets assumption is the core part of the option pricing (at least the distinguished BS pricing). It simply says (by the fundamental theorems of asset pricing - Shreve's book) the market is arbitrage-free (otherwise it would be trivial and there won't) and &lt;strong&gt;risk-neutral measure is unique&lt;/strong&gt;. Oh, there can be more than one (enter the Levy processes or GARCH pricing), it is unsurprisingly called incomplete markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All those paragraphs and I haven't mentioned hedging yet. Recall the assumption you can't trade before three months. If you relax that assumption the price of the option drops to zero. Because since I know it will be 120 in three months and risk free rate is 0, I can immediately buy the asset for 100 and hedge myself completely. If I can sell the option for more than 0 to a sucker I make extra money (in other words arbitrage). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if we relax the deterministic part, in a complete market you can do the hedging by buying and selling the underlying asset continuously as the price of the underlying changes. It is also called delta hedging. The result will be the same though, no extra money to neither side on average.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;On average&quot; or &quot;expectation&quot; are fundamental concepts that you need to set straight. I especially like &lt;a href=&quot;http://www.gamblinghelp.biz/wpblog/gambling-dice-theory-blaise-pascal-and-chevalier-de-mere/&quot; rel=&quot;nofollow&quot;&gt;Chevalier de Mere example&lt;/a&gt; or casino example ('House always wins') in such cases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want me to speak more enigmatic so my words ring more true I quote &lt;a href=&quot;http://en.wikipedia.org/wiki/Complete_market&quot; rel=&quot;nofollow&quot;&gt;Wikipedia&lt;/a&gt;: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;In economics, a complete market (or complete system of markets) is&#xA;  one in which the complete set of possible gambles on future&#xA;  states-of-the-world can be constructed with existing assets without&#xA;  friction.&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Some footnotes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Risk neutrality in decision sciences indicates the indifference between two games (or lotteries); one pays a fixed amount say 10, and the other indicates a win (more than 10 with probability p&amp;lt;1) and a loss (less than 10 wp 1-p) but the expected value of the game is the same amount of the risk free payoff 10. Risk seekers take the bet, risk averse people take the fixed amount.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Option pricing, portfolio optimization, risk management and similar areas all have the same objective, modeling and predicting the future value of an asset. But they usually differ in methodology. There are some bridges though, see &lt;a href=&quot;http://pages.stern.nyu.edu/~dbackus/Disasters/Gerber_Shiu_94.pdf&quot; rel=&quot;nofollow&quot;&gt;Gerber and Shiu's paper&lt;/a&gt; on using an actuarial method called Esscher transform and come up with the BS model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The popularity of the risk neutral pricing or complete markets comes from you don't need to think about the preferences (whether the agents are risk seeking or risk averse, so you have an 'objective' assessment). &lt;/p&gt;&#xA;" OwnerUserId="8147" LastActivityDate="2014-05-31T15:05:27.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11510" PostTypeId="1" CreationDate="2014-05-31T19:00:13.637" Score="3" ViewCount="102" Body="&lt;p&gt;I am working with the following copula, and have a few questions about it:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C(x,y) = xy + \theta (1-x)(1-y)xy$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here $\theta \in [-1,1]$ and $x,y \in [0,1]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, I am trying to show this copula is d-increasing.  To do this, I took &#xA;$\frac{\partial C}{\partial x \partial y}$ hoping  $\frac{\partial C}{\partial x \partial y} \geq 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I ended up with was &#xA;$\frac{\partial C}{\partial x \partial y} = 1 + \theta - \theta (1-2x-2y+4xy)$. &#xA;If I think of the case where $x=0, y=1, \theta = -1$ then this is equal to -1 so my condition isn't satisfied.  Am I going about this the wrong way? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, I am trying to calculate the copula of $(x,y^2)$.  My first thought was just to plug in $x=x, y=y^2$ into my original copula.  However I thought I couldn't do this because it would violate the assumption of uniform margins (as $y^2$ would no longer be uniform).  Any hints here?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks!&lt;/p&gt;&#xA;" OwnerUserId="7781" LastActivityDate="2014-08-01T18:18:36.490" Title="Properties of a Symmetric Copula" Tags="&lt;statistics&gt;&lt;probability&gt;&lt;copula&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11511" PostTypeId="2" ParentId="11435" CreationDate="2014-06-01T01:06:58.440" Score="2" Body="&lt;p&gt;If you're on the buy-side, you could also ask whether any of your counter parties may have what you need. For example, when it comes to fixed income data, Barclays Live and Morgan Markets (free to clients) may very well be better.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="848" LastEditDate="2014-06-01T08:20:28.367" LastActivityDate="2014-06-01T08:20:28.367" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11512" PostTypeId="2" ParentId="8631" CreationDate="2014-06-01T04:44:40.173" Score="3" Body="&lt;p&gt;There are quite a few strategies you could take.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Use models that are more resistant to noises. As others have already mentioned, parametric models such as Nelson-Siegel or Svensson may do the trick. I have also used Merrill Lynch Exponential Spline Model successfully (&lt;a href=&quot;http://www.bankofcanada.ca/wp-content/uploads/2010/02/wp04-48.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.bankofcanada.ca/wp-content/uploads/2010/02/wp04-48.pdf&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Change your objective function. For example, if you're currently minimizing &#xA;$$\sum(P_\text{market} - P_\text{model})^2, $$&#xA;try minimizing&#xA;$$\sum |P_\text{market} - P_\text{model}|. $$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Exclude the outlier altogether. This is actually done quite frequently in practice... For example, most US yield curve models exclude the on-the-run (most recently auctioned issues) and first-off-the-run issues. Some banks also exclude old seasoned bonds as well as &quot;outliers&quot;, which are bonds whose prices deviate from the model by a certain amount.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you want to be precise, you can introduce hypothetical bonds into the estimation. For example, you can calculate the spreads to a benchmark curve (say swap curve) for the two neighboring bonds; linearly interpolate to get the appropriate spread for the outlier bond; price this bond based on that spread and insert it back into the estimation set.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2014-06-01T04:49:47.577" LastActivityDate="2014-06-01T04:49:47.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11513" PostTypeId="2" ParentId="11280" CreationDate="2014-06-01T11:09:40.327" Score="0" Body="&lt;p&gt;&lt;strong&gt;Why do index benchmarks exist?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Benchmarks are needed to quantify alpha.  It's a relative measure after all&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Why invest in slightly more passive index relative funds over absolute return?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Index tracking funds are popular because of a wide spread belief in market efficiency&lt;/p&gt;&#xA;" OwnerUserId="7682" LastActivityDate="2014-06-01T11:09:40.327" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="11514" PostTypeId="2" ParentId="11505" CreationDate="2014-06-01T14:18:31.670" Score="1" Body="&lt;p&gt;I used to use a source called &lt;a href=&quot;https://www.evestment.com/about/acquisitions/hedgefund-net&quot; rel=&quot;nofollow&quot;&gt;HedgeFundnet&lt;/a&gt;, which was acquired by Evestment in 2011.&lt;/p&gt;&#xA;" OwnerUserId="2345" LastActivityDate="2014-06-01T14:18:31.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11515" PostTypeId="2" ParentId="11491" CreationDate="2014-06-01T14:20:57.503" Score="1" Body="&lt;p&gt;For each major index, Bloomberg has functions that will give you the best performers for each relevant period; past week, past month, past quarter, past year, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would take one of these &quot;runs,&quot; and then re-set the start and end dates to the ones that you want.&lt;/p&gt;&#xA;" OwnerUserId="2345" LastActivityDate="2014-06-01T14:20:57.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11516" PostTypeId="2" ParentId="8875" CreationDate="2014-06-01T16:43:51.077" Score="9" Body="&lt;p&gt;There is a lot of ways to understand why stationarity allows to apply &lt;em&gt;usual&lt;/em&gt; time series analysis. Here is one more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Very often, the theoretical justification of what you do in time series need to be able to identify the &lt;strong&gt;mean formula&lt;/strong&gt; and the &lt;strong&gt;expectation&lt;/strong&gt;:&#xA;$$\frac{1}{N}\sum_{n=1}^N X_n \underset{N\rightarrow +\infty}{\longrightarrow} \mathbb{E} X, $$&#xA;where the $X_n$ are drawn from the distribution of $X$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or at least you need something like that:&#xA;$$\mathbb{E}\left( \frac{1}{N}\sum_{n=1}^N X_n \right)= \mathbb{E} X. $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There two equalities &lt;strong&gt;are false&lt;/strong&gt; when the $X_n$ are not i.i.d. And when you speak about non stationarity, it is about facing a &lt;strong&gt;stochastic process&lt;/strong&gt; $X_n$ that would better written $X_t$ and not occurrences of the same random variable.&#xA;For more details about what stationary means, see the excellent &lt;a href=&quot;http://www.citeulike.org/user/lehalle/article/7342108&quot; rel=&quot;noreferrer&quot;&gt;Azencott, R. and D. Dacunha-Castelle (1986, June). Series of Irregular Observations: Forecasting and Model Building (Applied Probability) (1 ed.). Springer.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It means that:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;it will be a little harder to define your $X_n$ (filtration, measurable, adapted, etc -- you know all these words...)&lt;/li&gt;&#xA;&lt;li&gt;in fact $X_n+X_m$ has potentially not the same behaviour that two times $X_n$. &lt;strong&gt;And that is really an issue to use classical time series results.&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;That being said, what can we do with financial time series? &quot;&lt;em&gt;simply&lt;/em&gt;&quot; consider them as stochastic processes, and by chance we have an enormous literature about such processes (the best reference: &lt;a href=&quot;http://www.citeulike.org/user/lehalle/article/1681881&quot; rel=&quot;noreferrer&quot;&gt;Shiryaev, A. N. (1999, April). Essentials of Stochastic Finance: Facts, Models, Theory (1st ed.). World Scientific Publishing Company.&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;first of all we know (from a theoretical perspective), that results on &lt;strong&gt;Brownian motions&lt;/strong&gt; can be (more or less) used on the &lt;em&gt;smooth&lt;/em&gt; ones. Thanks to the Doob-Meyer theorem (of course there can be an ugly time change in between, but nevertheless it is convenient for theoretical needs).&lt;/li&gt;&#xA;&lt;li&gt;for practical use (as it have been answered already) the best approach is to try to reduce your process to a stationary one... It is not always easy. That for you need to guess a change of variable and to check that your succeeded into splitting your process in two parts: one is easy to deal with (like a deterministic function of time or of external information), the other (potentially multi dimensional) should be stationary.&lt;/li&gt;&#xA;&lt;li&gt;of course you can deal with non stationary processes if needed, but it is not that easy. A typical example are Hawkes processes; they are not stationary but you can deal with them (it is somehow an &lt;em&gt;extreme&lt;/em&gt; example since they are not smooth at all neither, but it is the first example I have in mind).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2014-06-01T16:49:44.327" LastActivityDate="2014-06-01T16:49:44.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11517" PostTypeId="1" CreationDate="2014-06-01T17:02:59.150" Score="0" ViewCount="158" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I was wondering whether any literatures existed on how to properly&#xA;  estimate correlation matrices from historical data.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Obviously the entire procedures allows a lot of leeway. The frequency of the data (daily, montly etc.), &lt;strong&gt;sample size&lt;/strong&gt;, the atual method used to extract the correlation from the time-series and so on &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the amount of decisions that have to be made and thus the amount of errors that can be made as well it would be nice to have some sources to turn to.&lt;/p&gt;&#xA;" OwnerUserId="7279" LastActivityDate="2014-07-03T06:00:29.437" Title="Sample size and historical correlation matrices" Tags="&lt;option-pricing&gt;&lt;equities&gt;&lt;correlation&gt;&lt;correlation-matrix&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11518" PostTypeId="1" CreationDate="2014-06-01T18:31:11.103" Score="4" ViewCount="237" Body="&lt;p&gt;I asked a question similar to this previously:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://dsp.stackexchange.com/questions/16341/simulating-a-state-space-model&quot;&gt;https://dsp.stackexchange.com/questions/16341/simulating-a-state-space-model&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I think I have a better handle on it now and want to re-ask it:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I simply want to simulate data from a state space model where the state variables follow an AR(1) process (see the code in the first link above).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the burn in issues (see link below) I assume it's better to determine empirically how many observations are required until the system reaches its theoretical unconditional variance then ensure that I simulate at least 2 times that amount before using the x(t) generated by the AR(1) process in my state space model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.mathworks.co.uk/help/econ/simulate-stationary-arma-processes.html&quot; rel=&quot;nofollow&quot;&gt;http://www.mathworks.co.uk/help/econ/simulate-stationary-arma-processes.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q1.) If I want to simulate data from my state space model is it necessary to ensure that the AR(1) process is in it's equilibrium state first?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q2.) From the simulated data I will be able to estimate the observation and state error variances as well as the AR(1) parameters and the unconditional mean and variance of the process (averaged over many sample runs). Assuming these empirical values all match their corresponding theoretical ones, can I then be fully satisfied that the state space model which is based on the AR(1) process has been implemented correctly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q3.) How can I estimate what the likely error bounds should be on the parameters that I propose to estimate in Q2?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Baz&lt;/p&gt;&#xA;" OwnerUserId="7077" LastEditorUserId="7077" LastEditDate="2014-06-01T19:45:32.623" LastActivityDate="2014-06-04T13:14:29.763" Title="Simulating state space model with AR(1) dynamics" Tags="&lt;time-series&gt;&lt;kalman&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11519" PostTypeId="2" ParentId="11505" CreationDate="2014-06-02T07:40:34.967" Score="1" Body="&lt;p&gt;I am not sure about daily data, but you could have a peek at &lt;a href=&quot;http://www.barclayhedge.com&quot; rel=&quot;nofollow&quot;&gt;barclayhedge&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6781" LastActivityDate="2014-06-02T07:40:34.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11520" PostTypeId="2" ParentId="11505" CreationDate="2014-06-02T12:00:57.407" Score="3" Body="&lt;p&gt;Most hedges funds only allow monthly subscriptions and redemptions; which means they will only publish official prices on a monthly basis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If someone does publish daily data view it with suspicion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having said that &lt;a href=&quot;https://www.hedgefundresearch.com&quot; rel=&quot;nofollow&quot;&gt;HFRX&lt;/a&gt; publish numbers on a daily basis.&lt;/p&gt;&#xA;" OwnerUserId="7682" LastActivityDate="2014-06-02T12:00:57.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11521" PostTypeId="2" ParentId="11435" CreationDate="2014-06-02T13:45:41.503" Score="4" Body="&lt;p&gt;Reuters is making a huge push with their &lt;code&gt;Eikon&lt;/code&gt; terminals.  I think their prices are under NDA but you can often get one at a big discount to the $1700/month the &lt;code&gt;Bloomberg&lt;/code&gt; charges and they are starting to close the feature gap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll still need to pay the market data fees if you want real time quotes, but those fees can often be in the low 100/month range if you only need a few product categories.&lt;/p&gt;&#xA;" OwnerUserId="743" LastActivityDate="2014-06-02T13:45:41.503" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11522" PostTypeId="1" AcceptedAnswerId="11534" CreationDate="2014-06-02T14:26:20.983" Score="3" ViewCount="846" Body="&lt;p&gt;I wish to understand some basic fact about the (primitive) simulation of stock prices with geometric Brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $S(t)$ is the stock price at time $t$, and the stock price follows geometric Brownian motion distribution, then it should satisfy&#xA;$$dS(t) = S(t)\left(\mu dt + \sigma d B(t)\right)$$&#xA;where $B(t)$ is a standard linear Brownian motion, and $\mu$ is sometimes called &lt;em&gt;drift&lt;/em&gt;. Solving this for $S(t)$ gives&#xA;$$S(t) = S(0)\cdot \exp\left(\sigma B(t) + \left(\mu-\frac{\sigma^2}{2}\right)t\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming there is no drift (there is no trend, perhaps), we obtain the following:$$S(t) = S(0)\cdot \exp\left(\sigma B(t) -\frac{\sigma^2}{2}t\right)$$&#xA;hence&#xA;$$\ln\frac{S(1)}{S(0)} \sim \mathcal{N}(0,\sigma^2)-\frac{\sigma^2}{2}$$&#xA;and in particular&#xA;\begin{eqnarray*}&#xA;\mathbb{E}\left(\ln\frac{S(1)}{S(0)}\right) &amp;amp;=&amp;amp; \int_{-\infty}^\infty&#xA;x\cdot\mathbb{P}\left(\mathcal{N}(0,\sigma^2) = x +\frac{\sigma^2}{2}\right) dx\\&#xA;&amp;amp;=&amp;amp; \int_{-\infty}^\infty x \cdot \frac{1}{\sigma\sqrt{2\pi}}\cdot\exp\left(-\frac{\left(x+\frac{\sigma^2}{2}\right)^2}{2\sigma^2}\right) dx&#xA;\end{eqnarray*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like&#xA;$$\mathbb{E}\left(\ln\frac{S(1)}{S(0)}\right) = -\frac{\sigma^2}{2}$$&#xA;which is what I would have expected. However, the more interesting expectation I couldn't compute:&#xA;\begin{eqnarray*}&#xA;\mathbb{E}\left(\frac{S_1}{S_0}\right)&#xA;&amp;amp;=&amp;amp; \int_{-\infty}^\infty x\cdot \mathbb{P}\left(\exp\left(\mathcal{N}(0,\sigma^2)-\frac{\sigma^2}{2}\right)=x\right)dx\\&#xA;&amp;amp;=&amp;amp; \int_{-\infty}^\infty x\cdot\mathbb{P}\left(\mathcal{N}(0,\sigma^2)=\ln{x}+\frac{\sigma^2}{2}\right)dx\\&#xA;&amp;amp;=&amp;amp; \int_{-\infty}^\infty \frac{x}{\sigma\sqrt{2\pi}}\cdot \exp\left(-\frac{\left(\ln{x} + \frac{\sigma^2}{2}\right)^2}{2\sigma^2}\right)dx = ?&#xA;\end{eqnarray*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would expect that expectation to be 1, as there is no drift. However, I can't do the integration. Is that true to assume that the result of the integral is 1?&lt;/p&gt;&#xA;" OwnerUserId="2723" LastActivityDate="2014-06-03T19:22:57.457" Title="Modelling driftless stock price with geometric Brownian motion" Tags="&lt;modeling&gt;&lt;brownian-motion&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11524" PostTypeId="1" CreationDate="2014-06-02T17:24:51.177" Score="2" ViewCount="291" Body="&lt;p&gt;Background: I want to compare two trading strategies in term of profitability. The red one is an active trading strategy, which involves many entry and exit to a specific market. The blue one is a passive strategy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.imgur.com/2WrkrVo.jpg?1&quot; alt=&quot;Plot 1&quot;&gt;&#xA;Both portfolios start at some unit 3. The units on the x-axis are months. As you can see, the active one clearly outperforms the passive strategy in absolute terms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I compare both portfolios in terms of returns (edit: discrete returns ) and cumulative returns (something like cumprod(1+Return)):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.imgur.com/lBgPNCO.jpg?1&quot; alt=&quot;Plot 2&quot;&gt;&#xA;It seems that the opposite is the case: the passive strategy works better.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could this be?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is part of the code in using R:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quantmod)&#xA;library(tseries)&#xA;&#xA;# calculating returns&#xA;&#xA;portfolio.active &amp;lt;- c(3e+07, 6680419, 6980132, 7268161, 7519643, 7739132, 7941601, &#xA;  8119644, 8286440, 8435480, 8595353, 8772177, 9000774, 27468724.0476, &#xA;  9162873.0476, 9503273.0476, 9791440.0476, 10097455.0476, 10415108.0476, &#xA;  10682368.0476, 10932171.0476, 11190461.0476, 11462988.0476, 11746256.0476, &#xA;  12009560.0476, 34328954.4748696, 34768365.0921479, 35236579.0753889, &#xA;  35677036.3138312, 36108728.4532286, 36549254.940358, 36940331.9682198, &#xA;  37325742.7650882, 37687802.4699096, 38047092.8534561, 38444050.8555604, &#xA;  38856683.6680768, 18480549.6680768, 18699486.6680768, 18927669.6680768, &#xA;  19157485.6680768, 19415315.6680768, 19665072.6680768, 19874970.6680768, &#xA;  20094206.6680768, 20321975.6680768, 20534633.6680768, 41857739.8826469, &#xA;  42284688.8294499, 42704716.7384891, 43167351.1698227, 43670970.266804, &#xA;  44206667.5020768, 25078572.5020768, 25262687.5020768, 25460188.5020768, &#xA;  25670408.5020768, 25900891.5020768, 26185010.5020768, 26468094.5020768, &#xA;  26791336.5020768, 27124813.5020768, 27445686.5020768, 27797816.5020768, &#xA;  28169749.5020768, 28530619.5020768, 28851193.5020768, 29171192.5020768, &#xA;  29524403.5020768, 29857673.5020768, 30123254.5020768, 52942557.9825139, &#xA;  53849640.4759476, 54747134.4838801, 55628563.3490706, 56548288.9297752, &#xA;  57481335.6971165, 58443190.0477816, 59434776.1722589, 60455073.163216, &#xA;  61472733.5614635, 62515720.9408897, 63555565.7658731, 64621180.7518809, &#xA;  65678814.0768534, 44286709.0768534, 44509648.0768534, 44736037.0768534, &#xA;  44940967.0768534, 45122736.0768534, 45299951.0768534, 45497061.0768534, &#xA;  68541626.0566368, 69672562.8865713, 70826805.0117255, 72040304.2709264, &#xA;  73279397.5043863, 74510491.38246, 75774686.0529157, 77045174.9557362, &#xA;  78316420.3425059, 79621694.014881, 80943414.135528, 82281678.5825687, &#xA;  83625612.666084, 84910659.5807195, 70986088.5807195, 71134875.5807195, &#xA;  71259144.5807195, 71382746.5807195, 86070512.2301142, 87344355.8111198, &#xA;  72406044.8111198, 72574841.8111198, 72734093.8111198, 72876348.8111198, &#xA;  73013152.8111198, 73157845.8111198, 73342328.8111198, 73526765.8111198, &#xA;  73704118.8111198, 73898514.8111198, 74081870.8111198, 74300600.8111198, &#xA;  74525126.8111198, 74756092.8111198, 74992670.8111198, 75240955.8111198, &#xA;  75485445.8111198, 75736352.8111198, 75978887.8111198, 76218754.8111198, &#xA;  76455194.8111198, 94467009.4053774, 96003672.7583715, 97418126.8703449, &#xA;  98674820.7069723, 99865496.8768364, 101027265.490504, 102209284.496743, &#xA;  103354028.483106, 104263543.933757, 105014241.45008, 105668830.221786, &#xA;  106264097.965369, 106848550.504178, 107464710.478752, 108105916.584609, &#xA;  108725723.839694, 91768810.839694, 109049526.184452, 109660203.531085, &#xA;  110252368.630153, 94067536.630153, 94240657.630153, 94440021.630153, &#xA;  94687041.630153, 94938224.630153, 95175768.630153, 95433874.630153, &#xA;  95743316.630153, 96077069.630153, 96389386.630153, 96724956.630153, &#xA;  97052499.630153, 97410241.630153, 98093042.630153, 98769541.630153, &#xA;  99552139.630153, 100431061.630153, 101345311.630153, 102241667.630153, &#xA;  103005198.630153, 103578174.630153, 129996171.902754, 130572488.264856, &#xA;  131216645.87363, 131938337.425934, 132712375.672167, 133628091.064305, &#xA;  94297376.0643046, 95030984.0643046, 95750240.0643046, 96575296.0643046, &#xA;  97249725.0643046, 97755334.0643046, 141077560.446541, 142591792.928667, &#xA;  144226845.487583, 145871031.526141, 147674969.949348, 149584899.560693, &#xA;  151524517.091663, 153666063.599892, 155935199.13905, 158279424.966107, &#xA;  160706376.148921, 163234823.133664, 165841139.143032, 168577517.938892, &#xA;  127864050.938892, 128484705.938892, 129103980.938892, 129759917.938892, &#xA;  130434392.938892, 131118780.938892, 131759054.938892, 132479828.938892, &#xA;  133227604.938892, 134109332.938892, 134952558.938892, 136083238.938892, &#xA;  137206719.938892, 138478067.938892, 139996228.938892, 141580951.938892, &#xA;  143068867.938892, 144160194.938892, 145172631.938892, 146430708.938892, &#xA;  147709646.938892, 149254901.938892, 150654198.938892, 151985116.938892, &#xA;  240918508.942675, 241825968.659692, 242366046.656365, 242519545.152581, &#xA;  242543797.107096, 242648899.419176, 242891548.318595, 243061572.402418, &#xA;  243191205.241033, 243337119.964177, 243483122.236156, 208208237.236156, &#xA;  208482926.236156, 208784318.236156, 209112574.236156, 209601255.236156, &#xA;  210075285.236156, 210553892.236156, 210973504.236156, 211499146.236156, &#xA;  211986447.236156, 212568324.236156, 213018802.236156, 213301380.236156, &#xA;  251743071.638948, 251868943.174768, 251978086.383477, 252095676.157123, &#xA;  252213320.805996, 252339427.466399, 252448774.551634, 252532924.143151, &#xA;  252583430.72798, 252617108.518744, 252650790.79988, 252684477.571986, &#xA;  252701323.203824, 252709746.581265, 252726593.897703, 252735018.1175, &#xA;  252743442.618104, 252768716.962366, 252844547.577454, 252911972.790142, &#xA;  252979415.982886, 253055309.80768, 253131226.400623, 253215603.47609, &#xA;  253300008.677248)&#xA;&#xA;&#xA;portfolio.passive &amp;lt;- c(6680419, 6980132, 7268161, 7519643, 7739132, 7941601, 8119644, &#xA;  8286440, 8435480, 8595353, 8772177, 9000774, 9223828, 9510477, &#xA;  9850877, 10139044, 10445059, 10762712, 11029972, 11279775, 11538065, &#xA;  11810592, 12093860, 12357164, 12611636, 12826134, 13020162, 13205887, &#xA;  13411967, 13586583, 13738107, 13890114, 14033013, 14176096, 14379071, &#xA;  14632186, 14858552, 15077489, 15305672, 15535488, 15793318, 16043075, &#xA;  16252973, 16472209, 16699978, 16912636, 17117129, 17309938, 17499182, &#xA;  17669704, 17838570, 18030597, 18248752, 18432867, 18630368, 18840588, &#xA;  19071071, 19355190, 19638274, 19961516, 20294993, 20615866, 20967996, &#xA;  21339929, 21700799, 22021373, 22341372, 22694583, 23027853, 23293434, &#xA;  23552161, 23807208, 24037208, 24239999, 24430692, 24636197, 24838827, &#xA;  25024759, 25167083, 25292732, 25396830, 25531909, 25750800, 25982456, &#xA;  26197851, 26420790, 26647179, 26852109, 27033878, 27211093, 27408203, &#xA;  27587764, 27761184, 27940101, 28100963, 28275165, 28449068, 28580697, &#xA;  28738500, 28872981, 29016478, 29153880, 29281553, 29397565, 29511990, &#xA;  29657419, 29806206, 29930475, 30054077, 30189731, 30345050, 30481739, &#xA;  30650536, 30809788, 30952043, 31088847, 31233540, 31418023, 31602460, &#xA;  31779813, 31974209, 32157565, 32376295, 32600821, 32831787, 33068365, &#xA;  33316650, 33561140, 33812047, 34054582, 34294449, 34530889, 34784441, &#xA;  35030472, 35288003, 35537392, 35777282, 35993896, 36182795, 36309410, &#xA;  36428366, 36551784, 36678261, 36799218, 36930272, 37056381, 37192817, &#xA;  37315361, 37443448, 37559161, 37678255, 37796705, 37943123, 38116244, &#xA;  38315608, 38562628, 38813811, 39051355, 39309461, 39618903, 39952656, &#xA;  40264973, 40600543, 40928086, 41285828, 41968629, 42645128, 43427726, &#xA;  44306648, 45220898, 46117254, 46880785, 47453761, 47874224, 48446901, &#xA;  49082644, 49735039, 50465013, 51353940, 52223225, 52956833, 53676089, &#xA;  54501145, 55175574, 55681183, 56126394, 56426107, 56695598, 57013205, &#xA;  57401606, 57732898, 58059337, 58331657, 58599952, 58940697, 59221343, &#xA;  59514294, 59891103, 60293258, 60784791, 61405446, 62024721, 62680658, &#xA;  63355133, 64039521, 64679795, 65400569, 66148345, 67030073, 67873299, &#xA;  69003979, 70127460, 71398808, 72916969, 74501692, 75989608, 77080935, &#xA;  78093372, 79351449, 80630387, 82175642, 83574939, 84905857, 85860403, &#xA;  86533153, 86693118, 86848759, 86933744, 86987679, 87166596, 87400230, &#xA;  87530962, 87793484, 88192304, 88594919, 88869608, 89171000, 89499256, &#xA;  89987937, 90461967, 90940574, 91360186, 91885828, 92373129, 92955006, &#xA;  93405484, 93688062, 94046149, 94442209, 94722786, 94994784, 95253442, &#xA;  95412993, 95558123, 95756774, 95872809, 96042503, 96225790, 96353440, &#xA;  96481780, 96623966, 96805068, 96962756, 97096340, 97134658, 97129276, &#xA;  97141765, 97210259, 97308354, 97369925, 97419651, 97417259, 97374617&#xA;)&#xA;&#xA;&#xA;ts.plot(ts(portfolio.active, start=1990, frequency=12)/1000000,ts(portfolio.passive, start=1990, frequency=12)/1000000, col=c(&quot;red&quot;,&quot;blue&quot;), ylab=&quot;in million dollars&quot;)&#xA;abline(h=0)&#xA;&#xA;return.ma.trading   &amp;lt;- ROC(portfolio.active, type =&quot;discrete&quot;)&#xA;return.buy.and.hold &amp;lt;- ROC(portfolio.passive, type =&quot;discrete&quot;)&#xA;&#xA;return.ma.trading[is.na(return.ma.trading)] &amp;lt;- 0&#xA;return.buy.and.hold[is.na(return.buy.and.hold)] &amp;lt;- 0&#xA;&#xA;cumret.ma.trading &amp;lt;- cumprod(1+return.ma.trading) &#xA;cumret.buy.and.hold &amp;lt;- cumprod(1+return.buy.and.hold) &#xA;&#xA;par(mfrow=c(2,2))&#xA;plot.ts(return.ma.trading)&#xA;plot.ts(return.buy.and.hold)&#xA;plot.ts(cumret.ma.trading)&#xA;plot.ts(cumret.buy.and.hold)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8190" LastEditorUserId="8190" LastEditDate="2014-06-02T20:28:13.660" LastActivityDate="2014-06-02T20:28:13.660" Title="trading strategy outperforms passive strategy in absolute terms, but in returns vice versa. how could this be?" Tags="&lt;quant-trading-strategies&gt;&lt;r&gt;&lt;trading&gt;&lt;returns&gt;" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="11525" PostTypeId="5" CreationDate="2014-06-02T18:46:05.883" Score="0" Body="&lt;p&gt;Bloomberg L.P. is a privately held financial software, data and media company headquartered in New York City.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They are known in the fiance world for their &lt;code&gt;Bloomberg Terminal&lt;/code&gt; and data feeds.&lt;/p&gt;&#xA;" OwnerUserId="743" LastEditorUserId="743" LastEditDate="2014-06-02T19:33:53.603" LastActivityDate="2014-06-02T19:33:53.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11526" PostTypeId="4" CreationDate="2014-06-02T18:46:05.883" Score="0" Body="Bloomberg L.P. is a privately held financial software, data and media company headquartered in New York City." OwnerUserId="743" LastEditorUserId="743" LastEditDate="2014-06-02T19:33:58.943" LastActivityDate="2014-06-02T19:33:58.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11527" PostTypeId="2" ParentId="11522" CreationDate="2014-06-02T19:21:53.137" Score="1" Body="&lt;p&gt;If $S_t = S_0 e^{(\mu-\sigma^2/2)t + \sigma W_t}$, we can compute&#xA;$$\mathbb{E}^Q\left[S_T\middle\vert \mathcal{F}_0\right] = S_0 e^{r T} = \text{forward price of } S_T \text { at time } 0. $$&#xA;To show the details, &#xA;$\mathbb{E}^Q\left[S_T\middle\vert \mathcal{F}_0\right] = S_0 e^{(r-\sigma^2/2) T} \mathbb{E}^Q\left[e^{\sigma W_T} \middle\vert \mathcal{F}_0\right]$.  To compute $\mathbb{E}^Q\left[e^{\sigma W_T} \middle\vert \mathcal{F}_0 \right]$, note that, for $X \sim \mathcal{N}(\mu,\sigma^2)$, $\mathbb{E}\left[e^X \right]=e^{\mu+\sigma^2/2}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, since $r=0$ and $T = 1$, &#xA;$$\mathbb{E}^Q\left[\frac{S_1}{S_0}\middle\vert \mathcal{F}_0\right] = 1. $$&lt;/p&gt;&#xA;" OwnerUserId="3188" LastEditorUserId="3188" LastEditDate="2014-06-03T19:22:57.457" LastActivityDate="2014-06-03T19:22:57.457" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="11528" PostTypeId="1" CreationDate="2014-06-02T19:57:43.840" Score="0" ViewCount="3166" Body="&lt;p&gt;I am using python and the cvxopt library to calculate an efficient frontier, per the docs:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://cvxopt.org/examples/book/portfolio.html&quot; rel=&quot;nofollow&quot;&gt;http://cvxopt.org/examples/book/portfolio.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I cannot figure out how to add a constraint so that there is an upper bound on a particular asset's maximum allowed weight. Is that possible using cvxopt?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my code so far that produces an efficient frontier with no constraints, except I believe b, which sets the max sum of weights to 1. I'm not sure what G, h, A, and mus do, and the docs don't really explain. Where does the 10**(5.0*t/N-1.0) in the formula for mus come from?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;from math import sqrt&#xA;from cvxopt import matrix as cmatrix&#xA;from cvxopt.blas import dot as cdot &#xA;from cvxopt.solvers import qp, options &#xA;&#xA;# Number of assets&#xA;n = 4&#xA;# Convariance matrix&#xA;S = cmatrix( [[ 4e-2,  6e-3, -4e-3,   0.0 ], &#xA;             [ 6e-3,  1e-2,  0.0,    0.0 ],&#xA;             [-4e-3,  0.0,   2.5e-3, 0.0 ],&#xA;             [ 0.0,   0.0,   0.0,    0.0 ]] )&#xA;# Expected return&#xA;pbar = cmatrix([.12, .10, .07, .03])&#xA;&#xA;# nxn matrix of 0s&#xA;G = cmatrix(0.0, (n,n))&#xA;# Convert G to negative identity matrix&#xA;G[::n+1] = -1.0&#xA;# nx1 matrix of 0s&#xA;h = cmatrix(0.0, (n,1))&#xA;# 1xn matrix of 1s&#xA;A = cmatrix(1.0, (1,n))&#xA;Aadd = cmatrix(0.0, (n,n))&#xA;# Convert Aadd to identity matrix&#xA;Aadd[::n+1] = 1.0&#xA;A = cmatrix(np.vstack((A,Aadd)))&#xA;&#xA;# bounds &#xA;b = cmatrix([1.0,1.0,1.0,1.0,1.0])&#xA;&#xA;N = 100&#xA;mus = [ 10**(5.0*t/N-1.0) for t in range(N) ]&#xA;options['show_progress'] = False&#xA;xs = [ qp(mu*S, -pbar, G, h, A, b)['x'] for mu in mus ]&#xA;returns = [ cdot(pbar,x) for x in xs ]&#xA;risks = [ sqrt(cdot(x, S*x)) for x in xs ]&#xA;&#xA;&#xA;sharpes = [x/y for x,y in zip(returns,risks)]&#xA;max_sharpe = max(sharpes)&#xA;max_index = sharpes.index(max_sharpe)&#xA;print xs[max_index]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  File &quot;&amp;lt;ipython-input-45-8e583df5adc5&amp;gt;&quot;, line 29, in &amp;lt;module&amp;gt;&#xA;    xs = [ qp(mu*S, -pbar, G, h, A, b)['x'] for mu in mus ]&#xA;&#xA;  File &quot;C:\Users\Anaconda\lib\site-packages\cvxopt\coneprog.py&quot;, line 4496, in qp&#xA;    return coneqp(P, q, G, h, None, A,  b, initvals)&#xA;&#xA;  File &quot;C:\Users\Anaconda\lib\site-packages\cvxopt\coneprog.py&quot;, line 1986, in coneqp&#xA;    raise ValueError(&quot;Rank(A) &amp;lt; p or Rank([P; G; A]) &amp;lt; n&quot;)&#xA;&#xA;ValueError: Rank(A) &amp;lt; p or Rank([P; G; A]) &amp;lt; n&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8193" LastEditorUserId="8193" LastEditDate="2014-06-03T05:02:53.190" LastActivityDate="2014-06-03T18:17:59.877" Title="How do I do a mean variance optimization with constraints?" Tags="&lt;optimization&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;&lt;python&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11529" PostTypeId="2" ParentId="4740" CreationDate="2014-06-03T01:23:41.027" Score="2" Body="&lt;p&gt;As Brian B states above the short answer includes Money market accounts, swaps and zero coupon bonds among other instruments. Lets say we have an interest rate derivative that we need to value via replication. Now if we think of what we mean by a replicating portfolio its clear that the main ingredient needed is to match the &lt;em&gt;pay structure\payout&lt;/em&gt; of the interest rate derivative with &lt;em&gt;existing&lt;/em&gt; market instruments -- thus the instruments needed depend on the payout of the derivative. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if we have an interest rate swap (IRS), we see that the cash flow (and hence payout) of the instrument is the same as if we had a chain (sequence) of forward rate agreements (FRA's). Similarly we can look at modeling the IRS with bonds of an appropriate tenor. There is no single definitive answer, because depending on the economics of the IRS, we may not have FRA's that match the payout, or we may not have bonds with correct maturities, we may have the bonds, but they may not be liquid enough to be valued etc. This notion is known as the completeness/incompleteness of the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence given a interest rate derivative, usually it would be the case that the existing market instruments are interest related products, but the actual components that make up the replicating portfolio depend on the pay out structure of the derivative, and the ability to be able to obtain market prices for the assets in the replicating portfolio. In fact, if these two conditions are met, then it does not matter which portfolio of underlying instruments you use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However if these conditions are not met, then you usually have to make do with what is available or modify/proxy instruments to obtain a valuation -- in practice, this is most often the case.&lt;/p&gt;&#xA;" OwnerUserId="7772" LastActivityDate="2014-06-03T01:23:41.027" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11530" PostTypeId="2" ParentId="11518" CreationDate="2014-06-03T05:15:15.330" Score="1" Body="&lt;p&gt;Q1- for AR(1) only one 1 lag, ie burn in, should be sufficient. However, you could do 50 to feel comfortable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q2- Matching the theoretical one is not a possibility&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q3. (update) AIC/BIC tests on the simulated series can help select the best one. You can get the logL values from KF or estimate functions in Matlab.&lt;/p&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="7867" LastEditDate="2014-06-04T13:14:29.763" LastActivityDate="2014-06-04T13:14:29.763" CommentCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="11531" PostTypeId="2" ParentId="11517" CreationDate="2014-06-03T05:22:10.790" Score="2" Body="&lt;p&gt;There is a wide knowledge on correlation estimation, see other questions and answers:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;principal component analysis (PCA) - &lt;a href=&quot;https://quant.stackexchange.com/questions/1020/equity-risk-model-using-pca/&quot;&gt;Equity Risk Model Using PCA&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;random matrix theory (RMT) - &lt;a href=&quot;https://quant.stackexchange.com/questions/2207/cleansing-covariance-matrices-via-random-matrix-theory&quot;&gt;Cleansing covariance matrices via Random matrix theory&lt;/a&gt; or &lt;a href=&quot;https://quant.stackexchange.com/questions/522/random-matrix-theory-rmt-in-finance/525#525&quot;&gt;Random matrix theory (RMT) in finance&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;shrinkage - &lt;a href=&quot;https://quant.stackexchange.com/questions/10101/portfolio-optimization-shrinkage-of-covariance-matrix-when-data-is-available/10115#10115&quot;&gt;Portfolio Optimization : Shrinkage of Covariance Matrix when data is available&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2014-06-03T05:22:10.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11532" PostTypeId="2" ParentId="4740" CreationDate="2014-06-03T10:29:08.560" Score="2" Body="&lt;p&gt;Let $0 \leq T &amp;lt; U$. Consider a European call on a U-Bond (Zero-coupon bond maturing at time U) with time of maturity $T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you do is that you hedge the call option with the aid of the U-Bond and the T-Bond. I could go in to more details on how to do this in particular models, but I would basically just write the same things as in this book:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Interest Rate Models - Theory and Practice: With Smile, Inflation and Credit&lt;/strong&gt;&#xA;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/3540221492&quot; rel=&quot;nofollow&quot;&gt;http://www.amazon.com/Interest-Rate-Models-Practice-Inflation/dp/3540221492&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2376" LastActivityDate="2014-06-03T10:29:08.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11533" PostTypeId="1" AcceptedAnswerId="11546" CreationDate="2014-06-03T13:48:40.097" Score="3" ViewCount="4233" Body="&lt;p&gt;Could we think of IMM dated swaps as forward swaps (since they trade only on specified dates and they might not be the current date)? For example, today is June 2nd, the next IMM swap is June 14 (not the spot date). &lt;/p&gt;&#xA;" OwnerUserId="8198" LastActivityDate="2014-06-04T11:33:15.960" Title="IMM Swaps vs. Forward Swaps" Tags="&lt;swaps&gt;&lt;forward&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11534" PostTypeId="2" ParentId="11522" CreationDate="2014-06-03T15:49:44.157" Score="4" Body="&lt;p&gt;To solve the expectation directly, you need to remember that a density function is not the same as the probability of the event.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have, $\frac{S_1}{S_0} \sim \ln \mathcal{N} \left(-\frac{\sigma^2}{2},\sigma\right)$, therefore,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\mathbb{E}\left(\frac{S_1}{S_0}\right) &amp;amp;=&amp;amp; \int_{-\infty}^\infty x\, f_{\frac{S_1}{S_0}}(x)dx\\&#xA;&amp;amp;=&amp;amp;\int_{-\infty}^\infty x \, \frac{1}{x\sqrt{2\pi}\sigma}\exp\left[-\frac{\left(\ln x+\frac{\sigma^2}{2}\right)^2}{2\sigma^2}\right]dx.&#xA;\end{eqnarray}&#xA;The usual substitution method aims to manipulate the expression into looking like a standard normal. To do this we use $z=\frac{\ln x + \frac{\sigma^2}{2}}{\sigma}-\sigma$ and we get the substitutions $dx=x \sigma dz$ and $x=\exp(\sigma z + \frac{\sigma^2}{2})$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\mathbb{E}\left(\frac{S_1}{S_0}\right) &amp;amp;=&amp;amp; \int_{-\infty}^\infty \frac{1}{\sqrt{2\pi} \sigma} \sigma \exp\left(\sigma z + \frac{\sigma^2}{2}\right) \exp\left( \frac{-z^2 - 2\sigma z -\sigma^2}{2} \right)dz\\&#xA;&amp;amp;=&amp;amp;\int_{-\infty}^\infty \frac{1}{\sqrt{2\pi}}\exp\left(-\frac{z^2}{2}\right) dz\\&#xA;&amp;amp;=&amp;amp;1.&#xA;\end{eqnarray}&lt;/p&gt;&#xA;" OwnerUserId="7903" LastActivityDate="2014-06-03T15:49:44.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11535" PostTypeId="2" ParentId="11318" CreationDate="2014-06-03T16:39:09.980" Score="0" Body="&lt;p&gt;The higher &quot;moments&quot; are skewness and kurtosis. My former boss at Value Line wrote a paper that suggests that stocks that are &quot;rich&quot; in these higher &quot;moments&quot; tend to outperform. The reason would be the greater &quot;optionality&quot; (option potential) of stocks with these characteristics.&lt;/p&gt;&#xA;" OwnerUserId="2345" LastActivityDate="2014-06-03T16:39:09.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11536" PostTypeId="2" ParentId="11315" CreationDate="2014-06-03T16:55:39.280" Score="1" Body="&lt;p&gt;Micro finance did not work in certain parts of South Africa. That's not surprising. Neither this, nor anything else is a &quot;panacea&quot; (cure-all) for various financial problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Micro finance apparently works in SOME parts of the world (India, Bangladesh, etc.), where the ethos and institutional framework make it viable. It may work better with women (who have less access to other credit and are more susceptible to peer pressure), than with men. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Practically by definition, microfinance is not highly scalable. It works, if at all, &quot;locally,&quot; where local lenders know and understand local entrepreneurs. That's why it doesn't lend itself well to large institutional activity from e.g., mutual funds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fact that it works SOMEWHERE is very much to its credit, and probably what won it the Nobel Prize. In so doing, it made the world's financial &quot;space&quot; somewhat more &quot;complete&quot; than it would otherwise be.&lt;/p&gt;&#xA;" OwnerUserId="2345" LastEditorUserId="2345" LastEditDate="2014-06-03T17:04:16.403" LastActivityDate="2014-06-03T17:04:16.403" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="11538" PostTypeId="2" ParentId="11528" CreationDate="2014-06-03T18:17:59.877" Score="1" Body="&lt;p&gt;If you don't know the meaning of the other matrices, I'd look more at the docs and the definition of the quadratic program:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://cvxopt.org/userguide/coneprog.html#quadratic-programming&quot; rel=&quot;nofollow&quot;&gt;http://cvxopt.org/userguide/coneprog.html#quadratic-programming&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is also an example from the book:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.ee.ucla.edu/~vandenbe/publications/mlbook.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.ee.ucla.edu/~vandenbe/publications/mlbook.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And there is a good deal of explanation there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, if you don't want to get into that I'd look at CVXPY which allow much simpler constraints (from their page):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Construct the problem.&#xA;x = Variable(n)&#xA;objective = Minimize(sum_squares(A*x - b))&#xA;constraints = [0 &amp;lt;= x, x &amp;lt;= 1]&#xA;prob = Problem(objective, constraints)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="8201" LastActivityDate="2014-06-03T18:17:59.877" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11539" PostTypeId="1" AcceptedAnswerId="12631" CreationDate="2014-06-03T19:36:39.807" Score="4" ViewCount="497" Body="&lt;p&gt;Let's say we have a stock which our only actions are buy, sell and hold (with or without shorting). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we have sufficient past data of the stock, how can you determine the optimal trading action every time-stamp in the past in an efficient or even optimal way? Transaction costs, bid-ask spread and slippage would definitely have to be included.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can think of this as a black-box optimization problem, but the search space is large, so  the search would be inefficient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to search the literature for pointers, but nothing came out of it. Has anyone researched good ways to do this?&lt;/p&gt;&#xA;" OwnerUserId="8202" LastActivityDate="2014-06-12T04:46:45.340" Title="Determining optimal trading signals (buy/sell) from past data" Tags="&lt;equities&gt;&lt;optimization&gt;&lt;history&gt;" AnswerCount="3" CommentCount="9" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11540" PostTypeId="1" AcceptedAnswerId="11559" CreationDate="2014-06-03T20:01:35.203" Score="1" ViewCount="184" Body="&lt;p&gt;I am reading Rebonato's Volatility and Correlation (2nd Edition) and I think it's a great book.  I'm having difficulty trying to derive a formula he used that he described as the expression for standard deviation in a simple binomial replication example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}\sigma_S\sqrt{\Delta t}=\frac{\ln S_2-\ln S_1}{2}\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This expression is equation (2.48) on page 45.  You can read that page and get some context from Google Books:&#xA;&lt;a href=&quot;http://goo.gl/uDgYg3&quot; rel=&quot;nofollow&quot;&gt;http://goo.gl/uDgYg3&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand continuous compounding is used in the example, if that helps any.  It's a little confusing because the equations he listed a few pages above (pg.43; not available in Google Books) use a discrete rate of return, not continuous compounding.  But in any case, this discrepancy does not seem to provide any hint as to how the standard deviation is obtained.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help is much appreciated.&lt;/p&gt;&#xA;" OwnerUserId="3510" LastActivityDate="2014-06-04T21:17:45.417" Title="Standard Deviation as listed in Rebonato's Volatility and Correlation: Binomial Replication 2.3.4 Worked-Out Example" Tags="&lt;volatility&gt;&lt;binomial-tree&gt;&lt;standard-deviation&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11541" PostTypeId="2" ParentId="11540" CreationDate="2014-06-03T21:24:47.690" Score="1" Body="&lt;p&gt;The binomial tree is a discrete approximation of the continuous lognormal stochastic process for the underlying asset price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The tree specifies a price $S_{ij}$ at node $(i,j)$ where $j$ is the time index and $i$ indexes the asset price at a fixed time. Potentially, a very large number of parameters could be used to construct a tree, but these are usually restricted in number in the more computationally efficient recombining tree -- in order to match the first two moments of the continuous distribution.  These parameters are the time step size $\Delta t$, the up/down move parameters $u$ and $d=1/u$ and branching probability $p$. In this way the price at nodes $(i+1,j+1)$ and $(i,j+1)$ are given by,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S_{i+1,j+1} = S_{ij}u \\\ S_{i,j+1} = S_{ij}d$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The parameters u and d are specified as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$u = e^{\sigma \sqrt{\Delta t}} \\d= 1/u = e^{-\sigma \sqrt{\Delta t}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\sigma$ is the annualized volatility of the asset&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The remaining parameter $p$ is set to match the risk-neutral drift.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can back out the volatility from these equations as follows&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma \sqrt{\Delta t}= \frac{1}{2}[\ln(u)-\ln(d)]=\frac{1}{2}[\ln(S_{i+1,j+1}/S_{ij})-\ln(S_{i,j+1}/S_{ij})]=\frac{1}{2}[\ln(S_{i+1,j+1})-\ln(S_{i,j+1})]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and using the notation in the reference&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma \sqrt{\Delta t}= \frac{1}{2}[\ln(S_{2})-\ln(S_{1})].$$&lt;/p&gt;&#xA;" OwnerUserId="8153" LastActivityDate="2014-06-03T21:24:47.690" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11542" PostTypeId="2" ParentId="10794" CreationDate="2014-06-04T00:17:09.020" Score="4" Body="&lt;p&gt;Pricing a bond futures contract is already a very difficult task (because of the embedded delivery option), not to mention an American option on it. Bottom line, you'll need to build either a tree/lattice or run some monte carlo simulations. Here's a sketch of how you could go about doing it –&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Using a term structure model, generate the distribution of the yields/prices of all the deliverables between the price date and the last delivery date. You may want to have time slices on at least the spot settlement date, some potential exercise dates, the last trade date of the futures, the first delivery date, and the last delivery date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The term structure model can be as simple as a short-rate model (e.g., Vasicek or Hull-White) and you can build trees/lattices following standard literature. The model can be calibrated using either on-the-run bonds or cheapest-to-delivers. In practice, however, many people diffuse bond yields directly (Tuckman alluded to it in his book) – starting from today's spot yields, you can use 2-3 principal component factors to diffuse the yields into the future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Once you have a grid of bond deliverable prices, you can price the bond futures contract using backward induction. If you ignore the end-of-month option (bond futures expire one week before the last delivery date) and timing option (bonds can be delivered any time between the first delivery date and the last delivery ate), you could assume that delivery happens on the last delivery date. In this case, it's trivial to see which bond should be delivered on each node in a tree or path in a MC simulation (the cheapest one). This allows you to compute the bond futures' price throughout the grid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Finally, given the bond futures tree/lattice/MC simulated paths, it should be straightforward to price the option on the bond futures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These models can be super complex. The delivery option part is particularly tricky and you should work closely with market makers with regard to the assumptions. For example, what volatility should you use to calibrate the model; do you want to model unauctioned bonds too; etc.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2014-06-04T00:17:09.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11543" PostTypeId="2" ParentId="11533" CreationDate="2014-06-04T00:23:38.083" Score="2" Body="&lt;p&gt;Yes, that's exactly right. IMM swap are swaps that resets on IMM dates. Otherwise, the math is exactly the same as a standard swap.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2014-06-04T00:23:38.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11545" PostTypeId="1" CreationDate="2014-06-04T10:27:43.700" Score="1" ViewCount="881" Body="&lt;p&gt;I have a list of tickers (~11,500) in a .txt/.csv file and accompanying fund data from yahoo finance. I'm wondering if there is a reasonably easy/accessible way to use this list to obtain expense ratios from yahoo finance or elsewhere? Is it a case of writing a C#/Javascript to queery the YQL 11500 times to &lt;a href=&quot;http://finance.yahoo.com/q/pr?s=TICKER&quot; rel=&quot;nofollow&quot;&gt;http://finance.yahoo.com/q/pr?s=TICKER&lt;/a&gt; and then store data from the section: Annual Report Expense Ratio (net):    X.YZ% ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help greatly appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best wishes&lt;/p&gt;&#xA;" OwnerUserId="8208" LastActivityDate="2014-07-08T05:13:39.307" Title="Obtaining Expense Ratio Data" Tags="&lt;programming&gt;&lt;yahoofinance&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11546" PostTypeId="2" ParentId="11533" CreationDate="2014-06-04T11:33:15.960" Score="2" Body="&lt;p&gt;Broadly, yes. An IMM dated swap is usually just a standard swap starting on an IMM date. However, there are a few closely related instruments which you could be asking about:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;IMM-anniversary swap - this not only starts on an IMM date, but also keeps to IMM dates for the roll schedule. It is a better match when hedging with IR futures, because an IMM-start swap would prefer Calendar anniversaries to IMM ones, and small date mismatches will occur.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Deliverable swap futures - in this case, the instrument is a future, not a swap, so it has all the complexity of pricing a future. The delivered swap, however, is a standard swap starting on the appropriate IMM date.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Note, by the way, that there are IMM dates in every month (third Wednesday), but usually it is the Mar/Jun/Sep/Dec cycle that is traded. If you need to hedge a May IMM swap, there are serial futures albeit they have nowhere near the liquidity of the major months.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2014-06-04T11:33:15.960" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11547" PostTypeId="1" CreationDate="2014-06-04T11:33:52.357" Score="0" ViewCount="1423" Body="&lt;p&gt;I have been trying to get a good picture of PV01 and DV01(PVBP). I was going through below link.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.investopedia.com/exam-guide/cfa-level-1/fixed-income-investments/price-value-basis-point.asp&quot; rel=&quot;nofollow&quot;&gt;This measure is the absolute value of the change in price of a bond for a one basis point change in yield. It is another way to measure interest-rate risk. &lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I find Price Value of Basis Point explanation from Fabozzi Hand Book is clearer. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;PVBP is measure of the price volatility of a bond to quantify&#xA;interest-rate risk—the price value of a basis point (PVBP). &#xA;This measure, also called the dollar value of an 01 (DV01), &#xA;is the absolute value of the change in the price of a bond &#xA;for a 1 basis point change in yield. That is,&#xA;**PVBP = | initial price − price if yield is changed by 1 basis point |**&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To me it sounds like YTM than the current yield. Isn't it YTM it is referring to?&#xA;I understand the calculations and relationship between Price and Interest Rate in terms of a bond. Price of a bond is affected by a change in interest rate and yield remains the same. So in my understanding such changes in interest rate only matters for YTM and not current yield. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what &lt;em&gt;yield&lt;/em&gt; is this article really referring to?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;On a latter note, can someone direct me to a good material for PV01 calcualtion?&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="3178" LastEditorUserId="3178" LastEditDate="2014-06-04T12:02:22.293" LastActivityDate="2014-08-03T17:09:40.803" Title="Price change of a bond towards yield and YTM" Tags="&lt;bond&gt;&lt;bond-yields&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11548" PostTypeId="2" ParentId="11539" CreationDate="2014-06-04T14:09:04.067" Score="1" Body="&lt;p&gt;I think what you're trying to do is to construct a portfolio from inside out, i.e. picking stocks based on idiosyncratic factors. I have never heard anyone (within the industry) succeed with this, and, to my knowledge, the literature in this direction is pretty slim. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main reason is that in finance, the Markowitz approach is dominant to this day. Put simply, because a portfolio holds a variety of stocks, you always have to consider how they interact, that is, consider their correlation. As volatility is not additive (partly due to correlation), you should not invest in stocks by looking at them individually, but consider the entire portfolio. If a stock is negatively correlated with another, their movements will cancel out, so if your knowledge of the future is incomplete, it will enhance the portfolio as a whole.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The closest thing to what you intend would probably be fundamental analysis, but the research does not show consistent outperformance afaik. Alternatively, look into smart beta asset allocation, which considers underlying risk factors for portfolio consruction.&lt;/p&gt;&#xA;" OwnerUserId="1976" LastActivityDate="2014-06-04T14:09:04.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11549" PostTypeId="2" ParentId="11547" CreationDate="2014-06-04T14:55:46.413" Score="1" Body="&lt;p&gt;This can actually get quite confusing. Some people use them to mean different things, but many use them to mean exactly the same thing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's typically no ambiguity in DV01. It is a $dP/dy$ calculation and represents the change in price when the yield of a bond changes by 1 basis point. I need to emphasize that you're changing the bond's &lt;em&gt;own&lt;/em&gt; yield (typically yield to maturities for government bonds) and you're NOT changing the yield CURVE!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you shock the entire yield curve in a parallel way by 1 basis point and computes the change in price based on the new yield CURVE, we typically refer to that as the &quot;effective DV01&quot; or &quot;effective '01&quot;. In practice, the curve shocked is typically the par yield curve (a theoretic curve representing the yields of bonds trading at $100). As a result, the effective DV01 tends to be higher than DV01. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;PVBP is a terminology used more frequently in the swap/swaption world (although Lehman and JPM use &quot;PVBP&quot; on their reports, even though they mean &quot;DV01&quot;). Strictly speaking, it is the present value of a stream of 1bp coupon payments – this is why it's also called the &quot;annuity factor.&quot; For example, if you have a 1-year swap and its fixed side has two cash flows, 6m from today and 1y from today. Then the PVBP of the fixed side is literally just $$d(0.5) + d(1),$$ where $d(t)$ is the discount factor for time $t$. Similar computations can be done for the floating leg. When people talk about the PVBP of a swap without specifying which leg it is, it refers to the fixed leg.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The DV01 of a swap is different. It is the change in the value of a swap when we bump the entire swap curve (some houses bump the par swap curve, some houses bump the instruments going into the curve construction). In reality, a lot of people use the PVBP of a swap instead of the &quot;true&quot; DV01 because the former is much easier to compute (just summing up discount factors). For par swaps, the two are pretty much the same anyways.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, PV01 typically refers to PVBP, but again, some use it to mean DV01, and yet others use it to mean effective DV01. It's a crazy world out there...&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2014-06-04T15:39:19.630" LastActivityDate="2014-06-04T15:39:19.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11551" PostTypeId="1" CreationDate="2014-06-04T15:57:42.023" Score="2" ViewCount="213" Body="&lt;p&gt;Seems that the answer to the first part should be yes, but haven't seen any references or examples. E.g. suppose I want to hedge XLF position with FAZ. Do people use close to current returns, or just recent? What's the risk / cost of intraday rebalance? &lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2014-12-15T03:41:23.510" Title="Do people hedge with leveraged ETFs intraday? How?" Tags="&lt;etf&gt;&lt;intraday&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11552" PostTypeId="2" ParentId="399" CreationDate="2014-06-04T17:26:04.643" Score="1" Body="&lt;p&gt;The &quot;factor loadings&quot; are really the weights attributed to different variables that predict default. If you increase the value of these factor loadings, you increase the prediction of default, thereby making the model more conservative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whether factor loadings are high enough ex ante is often defined by ex post events. If you had a sample of firms a certain percentage, x, of which defaulted, you might begin by adding up the predicted default rate of the sample and comparing it to x. If the predicted rate were too low/high, you would increase/decrease the factor loadings in order to get the predicted default rate to approximate the actual default rate, x.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is an iterative process that requires a bunch of trial and error, and basically assumes that the future samples of companies will be much like the ones on which you did your adjustments of factor loadings.&lt;/p&gt;&#xA;" OwnerUserId="2345" LastActivityDate="2014-06-04T17:26:04.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11553" PostTypeId="2" ParentId="10971" CreationDate="2014-06-04T17:42:00.807" Score="1" Body="&lt;p&gt;I answered a stackoverflow question that was pretty much identical &lt;a href=&quot;https://stackoverflow.com/a/23344419/25981&quot;&gt;over here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe it was you who cross posted.  Long story short, logging has a real cost.  Sadly there isn't alot you can do to get around it with a stock quickfix implementation.&lt;/p&gt;&#xA;" OwnerUserId="743" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2014-06-04T17:42:00.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11554" PostTypeId="5" CreationDate="2014-06-04T17:49:05.570" Score="0" Body="&lt;p&gt;C# is a multi-paradigm programming language encompassing strong typing, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is often used in place of C++ in area's where speed is important but is not the main concern.  It was originally available for windows only but it now has a very robust implementation for Linux at &lt;a href=&quot;http://www.mono-project.com/Main_Page&quot; rel=&quot;nofollow&quot;&gt;http://www.mono-project.com/Main_Page&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="743" LastEditorUserId="743" LastEditDate="2014-06-04T19:21:45.177" LastActivityDate="2014-06-04T19:21:45.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11555" PostTypeId="4" CreationDate="2014-06-04T17:49:05.570" Score="0" Body="C# is a multi-paradigm programming language encompassing strong typing, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines." OwnerUserId="743" LastEditorUserId="743" LastEditDate="2014-06-04T19:21:30.857" LastActivityDate="2014-06-04T19:21:30.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11556" PostTypeId="1" AcceptedAnswerId="11569" CreationDate="2014-06-04T19:16:08.960" Score="23" ViewCount="12050" Body="&lt;p&gt;I'm a VIX newbie and I'm trying to understand why the VIX futures market is usually in a state of contango.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All I can figure is that the sellers of VIX futures contracts demand high &quot;prices&quot; (because the seller is the holder of the short position and makes money when the price falls), and since there are willing buyers, namely ETNs and ETFs that are trying to track the S&amp;amp;P 500 VIX SHORT-TERM FUTURES INDEX (SPVIXSTR) through the purchase and sale of VIX futures, the contracts get sold.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, the farther out the futures contract expires, the less certain the seller is about what the value of the VIX and the SPVIXSTR will be at the future's expiration date. The greater uncertainty over a longer term results in the seller demanding higher premiums over a longer term than he would demand over a shorter term.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems like a prudent buyer of VIX futures wouldn't buy contracts that are priced so high.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems like the VIX futures market should be in a state of contango about as frequently as it is in a state of backwardation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What causes contango in the VIX futures market, and why is it the usual state of the market?&lt;/p&gt;&#xA;" OwnerUserId="1427" LastEditorUserId="1427" LastEditDate="2014-06-05T03:35:04.013" LastActivityDate="2017-05-15T22:19:55.520" Title="Why is the VIX futures market usually in a state of contango?" Tags="&lt;volatility&gt;&lt;futures&gt;&lt;vix&gt;" AnswerCount="5" CommentCount="3" FavoriteCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="11558" PostTypeId="2" ParentId="11556" CreationDate="2014-06-04T20:24:01.150" Score="8" Body="&lt;p&gt;Your question is an important one, but I am not aware of any particularly satisfying answer.  There are several papers on this issue -- see &lt;a href=&quot;http://www.fma.org/Singapore/Papers/The_Term_Structure_of_VIX.pdf&quot;&gt;Luo and Zhang 2009&lt;/a&gt; and &lt;a href=&quot;http://www.researchgate.net/publication/227622455_The_new_market_for_volatility_trading/file/9c960525f59024cc8f.pdf&quot;&gt;Zhang et al 2010&lt;/a&gt;, just for example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One thing to note is that VIX futures are not &lt;em&gt;always&lt;/em&gt; in contango -- after large jumps in the VIX, they can even be in rather steep backwardation.  I have heard arguments that this behavior indicates that the futures markets expect the VIX level to revert to a historical mean, which is lower after a jump but higher during 'quiet' periods.  Therefore, the futures curve perhaps 'points' to the expected mean.  Thinking of the VIX as mean reverting is intuitive (though incomplete), so this explanation has some appeal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think your explanation regarding uncertainty makes some sense.  Certainly, traditional arguments regarding storage costs used to explain other futures markets do not apply to the VIX, as it is simply a calculated value.  Then again, I'm not sure even those markets' term structures are perfectly understood.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's also important to note that VIX futures contango predates VIX ETNs/ETFs, so their trading activity may not be fundamental to the slope of the term structure.  If you've ever looked at a volume chart for front month VIX futures, however, you will see plainly that rolling VIX strategies are a huge component of that market's volume.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which is all a long way of saying:  I do not know, and would be very interested in hearing other explanations.&lt;/p&gt;&#xA;" OwnerUserId="7891" LastEditorUserId="7891" LastEditDate="2014-06-04T20:30:34.600" LastActivityDate="2014-06-04T20:30:34.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11559" PostTypeId="2" ParentId="11540" CreationDate="2014-06-04T21:17:45.417" Score="1" Body="&lt;p&gt;Consider a one-period, two-state market model. The known asset price at time $t=0$ is $S_0.$  At time $\Delta t$, the asset price can be $S_1$ with probability $\pi_1$ or $S_2$ with probability $\pi_2$, where $\pi_1+\pi_2=1$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this example the probabilities are fixed as $\pi_1=\pi_2= \frac{1}{2}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Define log-returns over this period as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R_1 = \ln(S_1/S_0), \\R_2 = \ln(S_2/S_0).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The expected return is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E(R)= \pi_1R_1+\pi_2R_2=\frac{1}{2}[\ln(S_1)+\ln(S_2)]-\ln(S_0).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The deviations of returns around the mean are &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R_1-E(R)= [\ln(S_1)-\ln(S_0)]-\{\frac{1}{2}[\ln(S_1)+\ln(S_2)]-\ln(S_0)\}=\frac{1}{2}[\ln(S_1)-\ln(S_2)]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R_2-E(R)= [\ln(S_2)-\ln(S_0)]-\{\frac{1}{2}[\ln(S_1)+\ln(S_2)]-\ln(S_0)\}=\frac{1}{2}[\ln(S_2)-\ln(S_1)]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the variance of return is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$var(R)= E[(R-E(R))^2]=\pi_1(R_1-E(R))^2+\pi_2(R_2-E(R))^2=\frac{1}{2}\frac{[\ln(S_1)-\ln(S_2)]^2}{4}+\frac{1}{2}\frac{[\ln(S_2)-\ln(S_1)]^2}{4}=\frac{[\ln(S_2)-\ln(S_1)]^2}{4}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The one-period volatility is the standard deviation of return and is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma_P=\sqrt{var(R)}= \frac{1}{2}[\ln(S_2)-\ln(S_1)].$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $\sigma$ denotes the annualized volatility then &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma\sqrt{\Delta t}= \sigma_P= \frac{1}{2}[\ln(S_2)-\ln(S_1)].$$&lt;/p&gt;&#xA;" OwnerUserId="8153" LastActivityDate="2014-06-04T21:17:45.417" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11562" PostTypeId="2" ParentId="11392" CreationDate="2014-06-05T14:27:18.500" Score="0" Body="&lt;p&gt;Gamma and delta are related, insofar as gamma is just the second derivative (or delta) of the delta (first derivative) of the value of the option with respect to price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Theta and vega are related insofar as they are the derivative of price with respect to time (theta) and volatility (vega) respectively. They can be linked by a &quot;cross derivative&quot; of volatility with respect to time.&lt;/p&gt;&#xA;" OwnerUserId="2345" LastActivityDate="2014-06-05T14:27:18.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11563" PostTypeId="2" ParentId="8507" CreationDate="2014-06-05T14:27:41.243" Score="1" Body="&lt;p&gt;I have never seen such an adjustment.  While monthly data are irregularly sampled in time (in every way...calendar days, trading days, seconds, etc), that irregularity is likely to be a smaller effect than your choice of data frequency (monthly, weekly, daily data).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, your question is intriguing because in other fields they do have to deal with irregularly sampled time series data and methods (apparently) exist.  See &lt;a href=&quot;http://www.nonlin-processes-geophys.net/18/389/2011/npg-18-389-2011.pdf&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt; for example.  This is way outside of my field so I can't vouch for the paper but the issue is interesting.&lt;/p&gt;&#xA;" OwnerUserId="7891" LastActivityDate="2014-06-05T14:27:41.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11564" PostTypeId="1" AcceptedAnswerId="11570" CreationDate="2014-06-05T15:41:35.893" Score="19" ViewCount="10862" Body="&lt;p&gt;I'm trying to understand why it's useful to shrink the covariance matrix for portfolio construction or in fact general. Think I missing something. I know if you have 5,000 stocks it's a lot of calculations but if we assume that computing power is not a problem.&lt;/p&gt;&#xA;" OwnerUserId="8170" LastActivityDate="2014-06-10T15:44:20.017" Title="Why shrink the covariance matrix?" Tags="&lt;statistics&gt;&lt;portfolio-management&gt;&lt;covariance&gt;&lt;portfolio-optimization&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="11565" PostTypeId="2" ParentId="11217" CreationDate="2014-06-05T16:08:30.610" Score="3" Body="&lt;p&gt;Trigonometric functions are WAVE phenomena. As such, they are best used to model so-called periodic functions, that is, functions with cycles of a fixed period in length. That's why they are good for modelling, seasonal, annual, &quot;blue moon&quot; (once every two and half years),  or other functions with set &quot;periods.&quot;&lt;/p&gt;&#xA;" OwnerUserId="2345" LastActivityDate="2014-06-05T16:08:30.610" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11566" PostTypeId="2" ParentId="11564" CreationDate="2014-06-05T16:14:51.527" Score="7" Body="&lt;ol&gt;&#xA;&lt;li&gt;Transaction costs - even for banks, funds etc, every trade has an associated cost, so if you would be buying a small number of shares, it's probably cheaper to carry the risk and not make those small trades.&lt;/li&gt;&#xA;&lt;li&gt;The source data is imperfect, and contains noise. A lot of the smaller components are simply artefacts of that noise so it would be both an unnecessary expense and an additional unwanted risk to include them all.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;When you come to rebalance the portfolio, the fewer items in the basket, the fewer trades are needed to rebalance the whole thing. Also, many of the small components will have the greatest variance, so you will end up dumping all of the holding and buying something else. By comparison, the largest components should be the most stable, and so theoretically can be left unchanged within some bound.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2014-06-05T16:14:51.527" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11567" PostTypeId="2" ParentId="11564" CreationDate="2014-06-05T16:54:53.877" Score="8" Body="&lt;p&gt;The estimation of a covariance matrix is unstable unless the number of historical observations $T$ is greater than the number of securities $N$ (5000 in your example). Consider that 10 years of data represents only 120 monthly observations and about 2500 daily observations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Depending on the application, using data dating farther back than 10 years may be impractical and undesirable for many reasons -- de-listed stocks, regime changes, etc.  In fact, risk management applications often require covariance estimations over recent periods of time (1-3 years).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Computational applications ranging from portfolio construction to Monte Carlo simulation generally require that the estimated covariance matrix is non-singular and positive definite. &#xA;If N is greater than T, then the estimated covariance matrix will be singular. Furthermore a variety of small sample problems persist until the number of observations is an order of magnitude larger than the number of securities.&lt;/p&gt;&#xA;" OwnerUserId="8153" LastActivityDate="2014-06-05T16:54:53.877" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11568" PostTypeId="1" CreationDate="2014-06-05T17:32:52.420" Score="3" ViewCount="375" Body="&lt;p&gt;I am going through the derivation of CMS convexity from the notes of&#xA;&lt;a href=&quot;https://www.google.co.uk/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=2&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0CC4QFjAB&amp;amp;url=http://www.javaquant.net/papers/Lecture4_2013.pdf&amp;amp;ei=qYqQU-HNOMmr7Aa7r4CQCw&amp;amp;usg=AFQjCNFyD-zqvGBCM2vrmrCjG7SIdnI4kw&amp;amp;sig2=BiH-MPgmvyIavpQyhcbIaA&amp;amp;bvm=bv.68235269,d.d2k&quot; rel=&quot;nofollow&quot;&gt;Lesniewski&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a transformation from $T_p$ forward measure to annuity measure $Q$ as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;P(0,T_p)E^{Q_{T_p}}\left[S(T_0,T)\right]=A(0,T_0,T_n)E^Q\left[S(T_0,T)\frac{P(T_0,T_p)}{A(t,T_0,T_n)}\right]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $A(t,T_0,T)=\sum_{1\le j \le n} \alpha_i P(t,T_i) $ is price of annuity at t paying $\alpha_i$ at $T_1,...,T_n$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is there an additional $P(T_0,T_p)$ term (zero coupon price of a bond maturing at $T_p$ and starting at $T_0$O in above equation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 1&lt;/strong&gt;:I guess his notation is not clear. Right hand side can be written as $E[S(T_0;T_0,T)D(0,T_p)]$ where $D(t,T_p)=E\left[e^{-\int_t^{T_p}r dt}\right]$ and $S(T_0;T_0,T)$ is the swap spread at $T_0$ for the period from $T_0$ to $T$. $E[S(T_0;T_0,T)D(0,T_p)]=E^{Q_{T_p}}[S(T_p;T_0,T)]P(0,T_p)$ assuming $T_p$ is after $T_0$. At the same time $E[S(T_0;T_0,T)D(0,T_p)]=A(0;T_0,T_n)E^Q \left[S(T_0;T_0,T)\frac{D(T_0,T_p)}{A(T_0;T_0,T_n)}\right]$ through measure change&lt;/p&gt;&#xA;" OwnerUserId="1215" LastEditorUserId="3188" LastEditDate="2014-12-10T17:28:42.497" LastActivityDate="2015-06-08T20:45:56.023" Title="Girsanov theorem in CMS convexity derivation" Tags="&lt;stochastic-calculus&gt;&lt;swaps&gt;&lt;convexity&gt;&lt;girsanov&gt;&lt;cms&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11569" PostTypeId="2" ParentId="11556" CreationDate="2014-06-05T18:19:35.053" Score="8" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Your questions about contango in VIX futures have close analogies in &#xA;options too.   The Black &amp;amp; Scholes model suggests that all time &#xA;frames and all strikes should have the same implied volatility, but &#xA;they don't.   I think one of the reasons is that the B&amp;amp;S model &#xA;assumes that stock returns are distributed in a normal (gaussian) &#xA;distribution, but the actual returns don't match a gaussian distribution all that well.   For example the actual occurrence of big crashes / gains is much more likely than a normal distribution would predict. Since crashes do occur people are willing to pay what the B&amp;amp;S considers a premium to have some insurance against downswings. I view it as being an insurance cost, so the longer youwant the insurance for, the more it will cost you. If you look at the &lt;a href=&quot;http://www.cboe.com/data/volatilityindexes/volatilityindexes.aspx&quot;&gt;term structure of SPX options&lt;/a&gt; you'll see a term structure that looks a lot like the VIX futures curve.  The VIX futures on settlement will use the SPX options expiring one month later as the prices for settlement  (e.g., Nov VIX futures will settle to Dec SPX options).     &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The VIX futures tend to go no higher than around &lt;a href=&quot;http://sixfigureinvesting.com/2014/01/what-is-the-arbitrage-driven-range-for-vix-futures/&quot;&gt;9% above&lt;/a&gt; their&#xA;equivalent SPX option VIX style implied volatility value , so I&#xA;suspect above that some sort of arbitrage gets attractive, and the&#xA;price difference is limited.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;One other thought about VIX futures.   They are attractive because&#xA;you don't have to place your bets as specifically as you do if you&#xA;are buying out of the money puts for insurance against crashes.   If&#xA;you buy puts and the market rallies your puts are left very out of&#xA;the money, whereas the VIX can spike up regardless of where the value&#xA;of the SPX index is.    Clearly people are willing to pay a premium&#xA;for VIX futures, and I don't think they are stupid.   At lot of them&#xA;lived through the 2000 and 2008 bear markets--that leaves an&#xA;impression on you.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="8227" LastEditorUserId="8227" LastEditDate="2014-06-05T18:25:14.507" LastActivityDate="2014-06-05T18:25:14.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11570" PostTypeId="2" ParentId="11564" CreationDate="2014-06-05T19:32:52.490" Score="12" Body="&lt;p&gt;Have a look at this classic paper:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://repositori.upf.edu/bitstream/handle/10230/560/691.pdf?sequence=1&quot;&gt;Honey, I Shrunk the Sample Covariance Matrix by O. Ledoit and M. Wolf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The abstract answers your question already:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The central message of this article is that no one should use the&#xA;  sample covariance matrix for portfolio optimization. It is subject to&#xA;  estimation error of the kind most likely to perturb a mean-variance&#xA;  optimizer. Instead, a matrix can be obtained from the sample&#xA;  covariance matrix through a transformation called shrinkage. This&#xA;  tends to pull the most extreme coefficients toward more central&#xA;  values, systematically reducing estimation error when it matters most.&#xA;  Statistically, the challenge is to know the optimal shrinkage&#xA;  intensity. Shrinkage reduces portfolio tracking error relative to a&#xA;  benchmark index, and substantially raises the manager's realized&#xA;  information ratio.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;N.B.: Shrinking in this context does &lt;em&gt;not&lt;/em&gt; mean use fewer values!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to perform a few experiments in R yourself the &lt;a href=&quot;http://cran.r-project.org/web/packages/tawny/&quot;&gt;package tawny&lt;/a&gt; is for you.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2014-06-05T19:38:53.567" LastActivityDate="2014-06-05T19:38:53.567" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11571" PostTypeId="2" ParentId="11149" CreationDate="2014-06-05T21:18:22.583" Score="-1" Body="&lt;p&gt;Cheapest to deliver treasury bonds as hedging underlying would be the most related instrument I can think of for your Monte-Carlo type. This leads to matching via conversion factors. &#xA;I am basing my answer to the similarities of your method to Monte-Carlo tree search.&lt;/p&gt;&#xA;" OwnerUserId="2872" LastActivityDate="2014-06-05T21:18:22.583" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11572" PostTypeId="2" ParentId="11556" CreationDate="2014-06-05T21:36:35.920" Score="5" Body="&lt;p&gt;VIX futures tend to rise when the S&amp;amp;P 500 falls -- the correlation of returns is about -0.7. If there were no contango in VIX futures, everyone would buy them to get free insurance against stock market declines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a recent working paper making this argument -- note the last sentence of the abstract.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://skinance.com/documents/EWFS_Eraker_and_Wu.pdf&quot; rel=&quot;nofollow&quot;&gt;http://skinance.com/documents/EWFS_Eraker_and_Wu.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Explaining the Negative Returns to VIX Futures and ETNs: An&#xA;  Equilibrium Approach&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Bjørn Eraker and Yue Wu&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Abstract&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;We study the returns to investing in VIX futures and VIX Exchange&#xA;  Traded Notes (ETNs). We document a substantial negative return premium&#xA;  for both ETNs and the futures. For example, a one month constant&#xA;  maturity portfolio of futures loses about 12BP per day on average. We&#xA;  propose an equilibrium model to explain the negative returns. In this&#xA;  model, increases in volatility endogenously lead to decreasing stock&#xA;  prices. The negative return premium is an equilibrium outcome because&#xA;  long VIX futures positions hedge against low returns/ high volatility&#xA;  states (i.e, ﬁnancial crisis).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="8228" LastEditorUserId="8228" LastEditDate="2014-06-27T16:21:12.493" LastActivityDate="2014-06-27T16:21:12.493" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11573" PostTypeId="2" ParentId="7960" CreationDate="2014-06-05T23:26:26.167" Score="0" Body="&lt;p&gt;I think the question is asking to prove (ii) using (iii) alone, which precludes using Ito's lemma outright.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed, for $T&amp;gt;0$ and $\Pi=\{t_{0}=0,t_{1},\ldots,t_{n}=T\}$, we get from Taylor's theorem applied to $f(w)=\frac{1}{2}w^{2}$, &#xA;$$\frac{1}{2}(W(T))^{2}=\sum_{i=0}^{n-1}W(t_{i}))(W(t_{i+1})-W(t_{i}))+\frac{1}{2}\sum_{i=0}^{n-1}(W(t_{i+1})-W(t_{i}))^{2}.$$&#xA;Higher order terms vanish because $f^{(k)}\equiv0$ for $k\geq3$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to (iii), the second term is $\frac{1}{2}T$ and the first term is just an Ito sum which converges to the Ito integral $\int_{0}^{T}W(s)\;dW(s)$ as $||\Pi||=\max_{i}|t_{i+1}-t_{i}|\to0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus (as the LHS is unaffected by taking limits),&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{1}{2}(W(T))^{2}=\int_{0}^{T}W(s)\;dW(s)+\frac{1}{2}T.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rearranging terms we get&#xA;$$\int_{0}^{T}W(s)\;dW(s)=\frac{1}{2}(W(T))^{2}-\frac{1}{2}T$$&#xA;which is what (i) asserts, but obtained from (more or less) first principles (i.e. (iii)).&lt;/p&gt;&#xA;" OwnerUserId="8230" LastActivityDate="2014-06-05T23:26:26.167" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11574" PostTypeId="1" AcceptedAnswerId="12597" CreationDate="2014-06-06T05:54:49.797" Score="7" ViewCount="458" Body="&lt;p&gt;It is a good tradition of the quant teams of the major banks to predict the World Cup. As an example see this new paper from Goldman Sachs:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.goldmansachs.com/our-thinking/outlook/world-cup-and-economics-2014-folder/world-cup-economics-report.pdf&quot; rel=&quot;noreferrer&quot;&gt;The World Cup and Economics 2014&lt;/a&gt; (Brazil will win by the way ;-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They partly do this for fun, for publicity (I just read about this report on Bloomberg) and also for demonstrating typical quant tools in a lighthearted manner (which can be very instructive).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question&lt;/strong&gt;&lt;br&gt;&#xA;Do you know of any other reports of this kind and how to get them?&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2014-06-06T08:20:21.107" LastActivityDate="2018-06-02T07:27:49.357" Title="Quant teams predicting the World Cup" Tags="&lt;reference-request&gt;&lt;prediction&gt;&lt;quantitative&gt;&lt;methods&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11577" PostTypeId="1" CreationDate="2014-06-06T09:50:47.427" Score="11" ViewCount="4350" Body="&lt;p&gt;I have $\frac{dS_t}{S_t} = rdt + \sigma dW_t$ as usual under the money-market numéraire and I need to price options with payoffs &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$(S_T f(S_T))^+$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I express the stock dynamics using the stock as numéraire, and how do I get the stock distribution under the equivalent measure.&lt;/p&gt;&#xA;" OwnerUserId="8236" LastEditorUserId="467" LastEditDate="2015-11-22T11:34:11.923" LastActivityDate="2015-11-22T15:31:14.373" Title="How to use the stock as a numeraire to price a derivative with payoff of the form $(S_T f(S_T))^+$?" Tags="&lt;stochastic-calculus&gt;&lt;derivatives&gt;&lt;numerairechange&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="11579" PostTypeId="2" ParentId="4019" CreationDate="2014-06-06T15:31:20.300" Score="2" Body="&lt;p&gt;The NPV of a zero coupon bond Z,  in the currency in which it has been emitted:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Z(t)= Notional*[Z(0)* exp (yiled (Z;t)*t)]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;yield(Z;t)=Z(0)*t+ epsilon&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where &lt;/p&gt;&#xA;&#xA;&lt;p&gt;-----  t is the time since the bond has been emitted&lt;/p&gt;&#xA;&#xA;&lt;p&gt;----   epsilon is the the normal distribution N(0;1)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-----   Z(0)=m(0) ; it's the unit selling price when the Zero coupon bond went on the market&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Or, more generally, for a treasury bond émission Z=g, emitted at t=t0=23.02.2005 by the government G=government(UK) with a maturity Tau=10 years (23.02.2015) its price g at emission is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;g(N;t0)=M*f(t0)=999'000'000  GBP(2005)=999'000'000 GBP &amp;lt;&lt;strong&gt;&lt;em&gt;*&lt;/em&gt;&lt;/strong&gt;(!)&lt;strong&gt;****&lt;/strong&gt;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;N=total notional of the treasury bonds of the government G(the total amount of money the government G borrowed at t0, and not the notional of 1 piece of emitted bond)=1'000'000'000=1Ml&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The government G(23.02.2015) returns (no government defaults in own currency) at the maturity $\Tau$ of the bond emission an amount &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$N * f($$\tau$$)=N*GBP(23.02.2015)=10^9 $GBP&lt;/p&gt;&#xA;&#xA;&lt;p&gt;N=cardinal of cash_amount/face_value at time $\tau$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;M=purchasing_cash/face value at time $t_0$=999'000'000&lt;/p&gt;&#xA;&#xA;&lt;p&gt;f(t)=face value at moment t =utility, function of purchasing power parity as government can choose to print more money at $\tau$ For a non-government bond or for a G bond, but not in own currency, f() represents the credit risk. &amp;lt;&lt;strong&gt;&lt;em&gt;*&lt;/em&gt;&lt;/strong&gt;(!!)&lt;strong&gt;****&lt;/strong&gt;&gt;&#xA;$N*f(\Tau)=M*f(t_0)=M*1$&#xA;f(t0)=1 because it is the reference/scaling value&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Purchasig power(t)=N*currency(t) = f(t)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;g(f(TAU))=f(t0)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;/p&gt;&#xA;&#xA;&lt;p&gt;f(t)=instant face value at moment t = c(t)=instant unit of currency of country with government G at t =c(t;G) at t &lt;/p&gt;&#xA;&#xA;&lt;p&gt;c=country function &amp;lt;&lt;strong&gt;&lt;em&gt;*&lt;/em&gt;&lt;/strong&gt;(!!)&lt;strong&gt;****&lt;/strong&gt;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$0&amp;lt;=f(t)=f(t;c)=P(t)^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P^2(t)=purchasing power parity(t) of the country with government G at time t&lt;/p&gt;&#xA;&#xA;&lt;p&gt;g(P^2(2015))=P^2(2005)   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;g(t;tau(t))=ExpectedValue[ g(t;t) * exp( (y_g(t;tau(t))&lt;em&gt;t) ) ] &lt;strong&gt;*&lt;/em&gt;!!!**&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;yield y_g(t;tau(t))=g(t;t)&lt;em&gt;tau(t) + b_g   &lt;strong&gt;&lt;/em&gt;(!!!!!)**&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;timeToMaturity from moment t &amp;lt; 2015  tau=tau(t)=2015-t&lt;/p&gt;&#xA;&#xA;&lt;p&gt;y_g(t;T(t))=y_g(t) &lt;strong&gt;&lt;em&gt;(4)&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;!!:The instant yield of the treasury bond at moment t = instant risk-free rate at t&lt;/p&gt;&#xA;&#xA;&lt;p&gt;y(t)=r(t)=y(t)        &amp;lt;&lt;strong&gt;&lt;em&gt;*&lt;/em&gt;&lt;/strong&gt;(!!)&lt;strong&gt;****&lt;/strong&gt;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;y(t;tau(t))=r(t)  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;y(t;2015-t)=r(t)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;r(t)=a_g(2005)*(2015-t) + b_g&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b_g = constant specific to bond g =  epsilon, extracted from a  Normal(0,1)=N(0,1)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a_g(2005) = alpha= a_g(2015) drift specific to bond g (on planet Earth, as the drift on planet risk-free is zero)&lt;/p&gt;&#xA;" OwnerUserId="2872" LastEditorUserId="2872" LastEditDate="2014-07-16T17:01:06.507" LastActivityDate="2014-07-16T17:01:06.507" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="11580" PostTypeId="1" AcceptedAnswerId="11584" CreationDate="2014-06-06T15:48:53.140" Score="9" ViewCount="5079" Body="&lt;p&gt;I know that SVI volatility surfaces are very popular among financial practitioners. I understand that this is not really a model for some underlying asset (such as Black Scholes, Heston etc.) but merely a parametrization of the Black Scholes implied volatility surface.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another example is the Malz FX Volaility parametrization.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: Why do practitioners prefer these parametrization to the plain Black Scholes implied surface?&lt;/p&gt;&#xA;" OwnerUserId="2376" LastActivityDate="2017-04-21T13:51:25.620" Title="Why parameterize the Black Scholes implied volatility surface?" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="11581" PostTypeId="1" CreationDate="2014-06-06T17:11:47.347" Score="1" ViewCount="271" Body="&lt;p&gt;I'm trying to estimate factor loadings on portfolios over time for portfolios that are traded pretty frequently. I have a sense that several portfolios are loading on the Fama-French HML factor dynamically, and OLS estimates show that there is not a statistically significant loading on the HML factor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to estimate the portfolios' loadings on the market and HML factors over time using the Kalman filter, but I also want to make sure I don't overfit a model and include extraneous variables. Is there a standard procedure for ensuring that I'm not adding unnecessary variables to a Kalman filter regression?&lt;/p&gt;&#xA;" OwnerUserId="5216" LastActivityDate="2014-06-06T17:11:47.347" Title="Variable Selection with Kalman Filter" Tags="&lt;regression&gt;&lt;factor-models&gt;&lt;factor-loading&gt;&lt;kalman&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11583" PostTypeId="1" AcceptedAnswerId="11585" CreationDate="2014-06-06T19:50:36.270" Score="4" ViewCount="618" Body="&lt;p&gt;Should it stick around until liquidity shows up? (GTC)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should it cancel any size for which there is no liquidity? (IOC)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there such a thing as Market GTC or Market Orders must always be IOC?&lt;/p&gt;&#xA;" OwnerUserId="8241" LastActivityDate="2015-01-07T00:45:29.983" Title="What is the correct / expected behavior for a market order sent to an empty book?" Tags="&lt;market-data&gt;&lt;market-making&gt;&lt;limit-order-book&gt;&lt;order&gt;&lt;orderbook&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11584" PostTypeId="2" ParentId="11580" CreationDate="2014-06-06T20:03:52.777" Score="19" Body="&lt;p&gt;There is no &quot;plain Black Scholes implied surface&quot; because implied volatilities come from options market prices (calls and put). If you had a whole continuum of call prices $C : \mathbb{R}_+ \times \mathbb{R}_+ \to \mathbb{R}_+$, $(T,K) \mapsto C(T,K)$ you would get a implied volatility function $\sigma_I : \mathbb{R}_+ \times \mathbb{R}_+ \to \mathbb{R}_+$ describing your implied volatiliy surface by inverting the Black Scholes formula for each expiry and strike:&#xA;$$&#xA;  C(T,K) = Call_{BS}(T,K,\sigma_I(T,K)).&#xA;$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But there is only a finite number of strikes and maturities available on any market so you only get a finite number of implied volatilies $\sigma_I(T_i,K_j)$. Instead of a whole surface, you just have a cloud of points. There is an infinite number of surfaces passing through these points and each of them corresponds to a different family of marginal distributions for your price process $(S_T)$ (at least if the surface satisfies no arbitrage conditions). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in order to get an actual surface you need to interpolate/extrapolate between points while making sure the surface you get is arbitrage free. This is not easy because the buttefly condition $\partial^2_{KK} C(T,K) \geq 0$ (convexity of the call payoff = positivity of a butterfly) translate to a second order differential inequality for implied volatility. This imposes strict and non explicit restrictions on your interpolation procedure. This is why pratictioners prefer to start from a parametrization which is arbitrage free by design and then try to fit it to the cloud of implied volatility points.    &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For details, see &quot;Arbitrage Free Implied Volatility Surfaces&quot; by M. Roper &lt;a href=&quot;http://www.maths.usyd.edu.au/u/pubs/publist/preprints/2010/roper-9.pdf&quot;&gt;http://www.maths.usyd.edu.au/u/pubs/publist/preprints/2010/roper-9.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2014-06-08T15:44:55.747" LastActivityDate="2014-06-08T15:44:55.747" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="11585" PostTypeId="2" ParentId="11583" CreationDate="2014-06-06T21:08:58.813" Score="3" Body="&lt;p&gt;This differs from exchange to exchange but in Toronto (TSX) the rule is that the &lt;strong&gt;unfilled amount becomes a limit order at the last sale price.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;A market priced order is an instruction to trade the order at prices currently &#xA;established by the opposite side of the market.&#xA;&#xA;Such orders have no trader defined limit on the potential trade price but these &#xA;orders are subject to TMX bid/ask price limits and TMX freeze price limits to prevent &#xA;unintentional trade-to-trade price gaps which may otherwise occur if the opposite side of&#xA;the market is thinner than the trader submitting the market order had expected. &#xA;&#xA;If there is not enough volume in the book to fill the order, the unfilled quantity of&#xA;the Market order is booked at the Last Sale Price. &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From &lt;a href=&quot;http://www.tmx.com/en/pdf/TMX-Order-Types-Guide.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having said that, If you have a use case where you are &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;sending out market orders and&lt;/li&gt;&#xA;&lt;li&gt;clearing out the order book&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Let me know so I can either trade against you or get the heck out of your way:)&lt;/p&gt;&#xA;" OwnerUserId="743" LastActivityDate="2014-06-06T21:08:58.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11586" PostTypeId="1" AcceptedAnswerId="11587" CreationDate="2014-06-07T09:55:27.290" Score="3" ViewCount="410" Body="&lt;p&gt;How existence of market-maker affects short-term directional trading?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Normally when playing short-term directional we play against market marker that will cover losses from uninformed traders.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when market-makers are not commonly present at exchange?&#xA;In my opinion its moving game to middle and long-term only, because of transaction costs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other way, when market-making is zero-sum play that forces pay uninformed traders cost created by directional bets from informed traders, then short-term play will profit in general from uninformed traders costs.&#xA;Based on that, it looks like its only moving profits from uninformed traders to informed that allow directional traders make more profit and trading at higher frequency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Did I missing something here? Did market market existence in general allow play short-term directional strategy?&lt;/p&gt;&#xA;" OwnerUserId="6175" LastEditorUserId="6175" LastEditDate="2015-10-24T16:00:07.417" LastActivityDate="2015-10-24T16:00:07.417" Title="Market-Maker existence impact to short-term informed directional trading" Tags="&lt;market-microstructure&gt;&lt;market-making&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11587" PostTypeId="2" ParentId="11586" CreationDate="2014-06-07T10:34:29.823" Score="2" Body="&lt;p&gt;Market makers do exist when exchange don't pay rebates. The lack of rebates will cause the spread to be wider, enticing market makers to enter. There will just be a different &quot;average spread&quot; that represents the higher compensation requested by market makers to participate in a market without rebates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even if there were no traders acting as pure/dedicated market makers, there would still be limit orders by execution traders which can be adversely selected for profit by a good short-term directional algorithm (under a few assumptions...).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately I didn't understand your last two paragraphs.&lt;/p&gt;&#xA;" OwnerUserId="6081" LastEditorUserId="6081" LastEditDate="2014-06-07T10:40:26.020" LastActivityDate="2014-06-07T10:40:26.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11588" PostTypeId="1" AcceptedAnswerId="12605" CreationDate="2014-06-07T18:34:34.663" Score="1" ViewCount="199" Body="&lt;p&gt;I may have to get involved in some projects using Basel II, III model for risk modeling, to which I have no background. Are there any good book/tutorials to recommend? What are the underlying statistical models for Basel II/III. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="8246" LastActivityDate="2014-06-09T22:07:53.463" Title="regarding Basel II III model" Tags="&lt;risk&gt;&lt;value-at-risk&gt;&lt;basel&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="11589" PostTypeId="2" ParentId="636" CreationDate="2014-06-07T18:43:52.603" Score="1" Body="&lt;p&gt;Do not concur with the paradigm behind this thinking:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;The problem is, a random process will consistently generate lots and lots of S&amp;amp;R levels, and you can be 100% sure that those S&amp;amp;R levels mean absolutely nothing. Think about it, how can a random process NOT turn and go the other way?&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Random&quot; means 50/50. Whoever believe the markets are random walks do not (should not) trade.&#xA;&quot;Random process&quot;?? Maybe a &quot;probabilistic process&quot; would be a less misleading term...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;You can calculate the odds.&quot;: well, there is much more to this then meets the eye of the typical statistician...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking into:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bayesian statistics for creating &lt;em&gt;causality&lt;/em&gt; based models for decision making &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&quot;Risk Assessment and Decision Analysis with Bayesian Networks&quot; &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The Bayesian Counterpart of Pearson's Correlation Test - Publishable Stuff&#xA;www.sumsar.net/blog/2013/08/bayesian-estimation-of-correlation/&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;[David Barber]Bayesian Reasoning and Machine Learning&#xA;web4.cs.ucl.ac.uk/staff/D.Barber/textbook/090310.pdf&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&quot;probabilistic models&quot; and &quot;probabilistic programming&quot;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;talks.cam : Quantitative Trading with Bayesian Methods&#xA;talks.cam.ac.uk/talk/index/35417&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For order book modeling&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Work of Hugh Christensen&#xA;Rebuilding The Limit Order Book: Bayesian Inference on Hidden States. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Uses from proven traders of Bayesian statistics &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;www.futuresmag.com/2013/05/24/setting-stops-the-bayesian-way?t=technology&amp;amp;page=4&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Traders using order book/ order flow trading&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Book &quot;order flow trading for fun and profit&quot;&#xA;www.forexfactory.com/showthread.php?p=6824792&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;www.orderflowanalytics.com/english/&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Disclaimer: no relevant affiliations.&lt;/p&gt;&#xA;" OwnerUserId="8247" LastActivityDate="2014-06-07T18:43:52.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="11590" PostTypeId="1" AcceptedAnswerId="12600" CreationDate="2014-06-08T12:06:50.047" Score="6" ViewCount="585" Body="&lt;p&gt;I am looking at Kemna and Vorst's paper:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A PRICING METHOD FOR OPTIONS BASED ON AVERAGE ASSET VALUES. see &lt;a href=&quot;http://www.javaquant.net/papers/Kemna-Vorst.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.javaquant.net/papers/Kemna-Vorst.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\text{d}S_t = S_tr\text{d}t + S_t\sigma\text{d}W_t$. Let $t_0 \leq t \leq T$, define $A(t)=\frac{1}{T-t_0}\int^T_{t_0}S_\tau\text{d}\tau$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Asian option has pay off $(A(T)-K)^+$. Let $C(s,a,t)$ be the time $t$ price the Asian option with $S(t)=s, A(t)=a$. This paper claims on the top of page 5 that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\lim\limits_{s\rightarrow\infty}\frac{\partial C(s,a,t)}{\partial s}=\frac{T-t}{T-t_0}e^{-r(T-t)}$, but this is not what I arrived at.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my heuristic/non-rigorous derivation. When $S(t)$ is sufficiently large, then you will almost certainly be in the money. Then &lt;/p&gt;&#xA;&#xA;&lt;p&gt;the value of the option should approximately be $C(a,s,t) = e^{-r(T-t)}\bigg((a-K)+\mathbb E\bigg(\frac{1}{T-t_0}\int^T_tS_\tau\text{d}\tau\bigg)\bigg)= e^{-r(T-t)}\bigg((a-K)+\bigg(\frac{s}{r(T-t_0)}(e^{r(T-t)}-1)\bigg)\bigg)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(This agrees with (15) in the paper, even)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so I calculate the derivative to be $\frac{1}{r(T-t_0)}(1-e^{-r(T-t)})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is stated the paper seems to be the time derivative of my answer, see (13). Did I make a mistake or there is a mistake in this classical paper?&lt;/p&gt;&#xA;" OwnerUserId="3334" LastActivityDate="2014-06-19T01:54:36.250" Title="Boundary condition for Asian Option under Black-Scholes model" Tags="&lt;black-scholes&gt;&lt;asian-option&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="11591" PostTypeId="2" ParentId="11577" CreationDate="2014-06-08T12:25:13.527" Score="4" Body="&lt;p&gt;Let $\text{d}S_t = \mu S_t \text{d}t +\sigma S_t\text{d}W_t$. under the real-world measure&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With $S_t$ being numeraire, then $e^{rt}/S_t$ must be a martingale under the equivalent martingale measure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under the real world measure, &#xA;$\frac{e^{rt}}{S_t}= \exp(rt -\mu t-\sigma W_t+\frac{1}{2}\sigma^2t)$, where $W_t$ is a Brownian motion under this measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you need to make a Cameron-Martin-Girsanov transform to make $\frac{e^{rt}}{S_t}$ a martignale. This essential comes down to $r-\mu+\frac{1}{2}\sigma^2 = -\frac{1}{2}\sigma^2$, or $\mu = r+\sigma^2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so under the risk-neutral measure with $S_t$ being numeraire, $S_t=S_0\exp(r+\sigma^2t-\frac{1}{2}\sigma B_t)$, where $B_t$ is a Brownian motion under the risk-neutral measure.. To find time $t&amp;lt;T$ value $V_t$ of an asset with pay off $S_TF(S_T)$, then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{V_t}{S_t} = \mathbb E[\frac{S_TF(S_T)}{S_T}|\mathcal{F}_t]=E[F(S_T)|\mathcal{F}_t]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, for example, if $F(\cdot) = (K-\cdot)^+$, you can still use Black-Scholes formula though you need to figure out the appropriate parameter and might need to multiply by a factor. Essentially, this is because $S_t$ is still log-normal distributed. &lt;/p&gt;&#xA;" OwnerUserId="3334" LastEditorUserId="3334" LastEditDate="2014-06-09T18:54:38.147" LastActivityDate="2014-06-09T18:54:38.147" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12592" PostTypeId="1" AcceptedAnswerId="12595" CreationDate="2014-06-08T18:07:49.260" Score="17" ViewCount="16977" Body="&lt;p&gt;I am trying to determine a step-by-step algorithm for calculating a portfolio's VaR using monte carlo simulations. It seems to me that the literature for this is extraordinarily opaque for something as common as VaR. To simplify things, I want to initially consider only a portfolio of stocks and at a later stage include derivatives.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are the steps I have managed to pickup using different sources:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Estimate the portfolio's current value $P_0$. &lt;/li&gt;&#xA;&lt;li&gt;Build the portfolio's covariance matrix using stock historical data.&lt;/li&gt;&#xA;&lt;li&gt;Create the Cholesky decomposition of the covariance matrix.&lt;/li&gt;&#xA;&lt;li&gt;Generate a vector of n independent standard normal variates&lt;/li&gt;&#xA;&lt;li&gt;multiply the matrix resulting from the Cholesky decomposition with the vector of standard normal variates in order to get a vector of correlated variates.&lt;/li&gt;&#xA;&lt;li&gt;Calculate the assets' terminal prices using geometric brownian motion. &#xA;$$ S_i(T) = S_i(0) \exp\left(\left(\mu-\frac{\sigma^2}{2}\right)T + \sigma\sqrt{T}\epsilon_i\right)$$&#xA;where $\epsilon_i$ corresponds to the correlated random variate for asset i obtained from the vector of correlated variates.&lt;/li&gt;&#xA;&lt;li&gt;reevaluate the portfolio's value at time $T$, $P_T$, using the stock prices generated in the previous step.&lt;/li&gt;&#xA;&lt;li&gt;Calculate the portfolio return using $$R_T=\frac{P_T - P_0}{P_0}$$ &lt;/li&gt;&#xA;&lt;li&gt;Repeat steps 4-8 many times (for example $n=10000$ simulations).&lt;/li&gt;&#xA;&lt;li&gt;Sort the returns in ascending order.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I have the following questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;How do I extract the VaR from the sorted portfolio returns?&lt;/li&gt;&#xA;&lt;li&gt;How do I define the time horizon T?&lt;/li&gt;&#xA;&lt;li&gt;I have seen examples where the whole stock path is discretized using a relation of the form:&#xA;$$ S_{(t+dt)} = S_t + S_t\mu dt + S_t \sigma \sqrt{dt} \epsilon_i $$&#xA;Do we need to do that or simply evaluating the stock's terminal price using the formula in point 6 is enough?        &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="9249" LastEditorUserId="9271" LastEditDate="2014-06-11T09:22:31.033" LastActivityDate="2018-10-28T08:40:54.570" Title="Is there a step-by-step guide for calculating portfolio VaR using monte carlo simulations" Tags="&lt;monte-carlo&gt;&lt;var&gt;&lt;portfolio&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="26" ContentLicense="CC BY-SA 3.0" />
  <row Id="12593" PostTypeId="2" ParentId="11556" CreationDate="2014-06-08T20:43:55.107" Score="8" Body="&lt;p&gt;VIX is a measure of volatility -- something that changes explicitly with uncertainty.  The chances of uncertainty arising tomorrow, is lower than the chances of uncertainty increasing in the longer term.  A long-dated option should therefore have more &quot;potential uncertainty&quot; baked into the price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When pricing normal futures, the price is a martingale, the expectation being movement at the risk free rate.  With the VIX, this seems not to be the case, the expectation is that it will revert to it's historical average, however this mean-reversion isn't grounded in theory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, because the VIX has a negative correlation with the market in bad times, and little correlation in good times, in a CAPM world, it has a negative beta in the bad state of the world, and a near 0 beta in the good state of the world.  This implies that people will want to hold it simply for diversification, even though the return most of the time may be negative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The intuition that follows, is that longer futures have more &quot;time-value&quot; embedded in them, because the future state of the VIX is not only unknowable, but, really hard to forecast. They are also worth &quot;paying a little more&quot; for, because they will pay off big in the bad state, but not lose too much in the good state.&lt;/p&gt;&#xA;" OwnerUserId="9251" LastActivityDate="2014-06-08T20:43:55.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12595" PostTypeId="2" ParentId="12592" CreationDate="2014-06-08T23:54:25.420" Score="15" Body="&lt;p&gt;You have the correct approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) The simulation generates sampled portfolio values, $P_1,P_2, \dots, P_n$ at time $t=T$.  VaR is specified as a left-tail percentile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Order the sample as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P_{(1)} \leq P_{(2)} \leq \dots \leq P_{(n)}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are considering $VaR_\alpha$ at the $100(1-\alpha) \% $ confidence level , then choose the smallest integer $k$ that exceeds $n\alpha$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, at the $99 \%$ level $\alpha = 0.01$. With $n=10,000$ simulations, $k = (10000)(0.01) = 10$ and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$VaR_{99 \%} = P|_{t=0} -P_{(10)} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;expressed as the worst loss relative to the initial portfolio value the would be exceeded with probability less than $0.01$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) The time horizon can be arbitrary, but banks usually calculate VaR at $1$-day and $10$-day time horizons.  The $10$-day Var is used to set market-risk capital requirements and the $1$-day VaR is used in back-testing  to check the fidelity of the calculation. For example, given a calculated $1$-day VaR at the $99\%$ confidence level, then the portfolio is expected to lose a larger amount over a $1$-day period no more than $1$ day out of $100$.  The test is conducted by determining the number of times the VaR threshold would have been exceeded over the past $100$ days (using historical return observations) and the current composition of the portfolio. If the number of exceedences is too large, then bank regulators will impose an increased capital penalty.  An allowance is made for sampling error, so the test requirement might be that VaR threshold should not be exceeded more than $2$ times out of $100$, for example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the determination of credit loss due to counterparty default, the time horizon might be as long a year. In the determination of credit exposure the time horizon could be vary long -- for example, out to the longest time-to-maturity among all the derivatives in the portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(3) In your example, you selected a stochastic process with an exact solution for the joint distribution of asset prices at the time horizon. Simulating the evolution of the asset prices at intermediate time steps was not necessary. This might not be possible if the risk factors used to determine future portfolio value have more complicated stochastic models  that preclude an exact solution over a longer time horizon.  Another case where time-stepping over shorter intervals may be necessary is when the portfolio has many path-dependent derivatives such as knock-out options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Different situations may arise in practice. For example a bank may choose  to calculate $1$-day VaR and estimate $10$-day VaR by multiplying by $\sqrt{10}$, rather than simulate in discrete $1$-day steps over the $10$-day horizon.  This would be beneficial if it leads to a lower capital requirement.  In general it is best practice to make the most accurate determination. Trying to game the calculation may lead to a penalty.&lt;/p&gt;&#xA;" OwnerUserId="8153" LastActivityDate="2014-06-08T23:54:25.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12596" PostTypeId="2" ParentId="1707" CreationDate="2014-06-09T06:47:12.437" Score="4" Body="&lt;p&gt;If you only need to pick 5 out of 10 and want equal weights then just enumerate all 252 possibilities (as pointed out above) and compute the portfolio volatility &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(\textbf{1}'K^{(i)}\textbf{1})^{1/2} = \left( \sum_{ij}K^{(i)}_{ij} \right)^{1/2}$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $K^{(i)}$ is the covariance matrix for the $i$th subset. Then use whatever subset gives the lowest portfolio volatility. Here you are minimizing portfolio volatility so you will be biased towards lower volatility stocks. If you don't care about volatility per se and just want to minimize the contribution to portfolio risk related to correlation (somewhat loosely defined) then you can use the &lt;a href=&quot;http://www.iijournals.com/doi/abs/10.3905/JPM.2008.35.1.40&quot; rel=&quot;nofollow&quot;&gt;Most Diversified Portfolio&lt;/a&gt; (MDP) method. This method aims to minimize the diversification ratio&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{w'\sigma^{(i)}}{\left(w'K^{(i)}w\right)^{1/2}} =\frac{\sum_j\sigma_j}{ \left( \sum_{ij}K^{(i)}_{ij} \right)^{1/2}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Again, just plug in values for each subset and use whatever gives the largest value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally, I would argue that a few aspects of what your doing are inefficient.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Why equal weights? If you have a covariance matrix then you can almost always find less risky portfolios. Each stock has a different volatility so equal weights tends to take too much risk in more volatile stocks.&lt;/li&gt;&#xA;&lt;li&gt;Why consider only your top 10? It is possible your best 5-stock portfolio includes stocks outside of your top-10 rankings due to correlations.&lt;/li&gt;&#xA;&lt;li&gt;Instead, consider attempting to generate &lt;em&gt;expected returns&lt;/em&gt; for your stocks. You can do this by running a simple linear regression using your sorting metric.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;As has been pointed out, the full mean-variance optimization is hard to solve when you have a cardinality constraint and a large number of stocks to consider. A common approach is to employ &lt;a href=&quot;http://www.stanford.edu/class/ee364b/lectures/l1_slides.pdf&quot; rel=&quot;nofollow&quot;&gt;$l_1$ norm based methods&lt;/a&gt;. The gist of it is instead of solving the standard mean-variance QP&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\min_w \{ \lambda w'Kw - r'w \}, w \geq 0, \sum_i w_i = 1$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;drop the budget constraint and add an $l_1$ penalty, i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\min_w \{ \lambda w'Kw - r'w + \gamma ||w||_1 \}, w \geq 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you slowly increase $\gamma$ the $w$ vector will get sparser. Stop once you only have 5 non-zero values. Afterwards, re-scale the weights to sum to one. This version of the problem is a convex relaxation of the actual cardinality constrained problem. The $l_1$-norm penalty can also be motivated as the solution to a robust portfolio optimization problem where returns are uncertain, but satisfy a box constraint.  &lt;/p&gt;&#xA;" OwnerUserId="3398" LastActivityDate="2014-06-09T06:47:12.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12597" PostTypeId="2" ParentId="11574" CreationDate="2014-06-09T10:59:50.233" Score="1" Body="&lt;p&gt;I saw &lt;a href=&quot;https://www.deutschebank.nl/nl/docs/The_World_Cup_Hackers_Handbook.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;this paper by Deutsche&lt;/a&gt; through &lt;a href=&quot;http://ftalphaville.ft.com/marketslive/2014-06-09/?&quot; rel=&quot;nofollow noreferrer&quot;&gt;FT Alphaville Markets live&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="848" LastEditDate="2018-06-02T07:27:49.357" LastActivityDate="2018-06-02T07:27:49.357" CommentCount="3" CommunityOwnedDate="2014-06-09T10:59:50.233" ContentLicense="CC BY-SA 4.0" />
  <row Id="12598" PostTypeId="2" ParentId="10983" CreationDate="2014-06-09T11:32:32.727" Score="2" Body="&lt;p&gt;FYI, the binomial distribution converges to normal as n goes to infinity, which is a nice way of thinking about the relationship between BS and the binomial tree models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.m.wikipedia.org/wiki/Binomial_distribution&quot; rel=&quot;nofollow&quot;&gt;see here&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7682" LastActivityDate="2014-06-09T11:32:32.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12599" PostTypeId="2" ParentId="10348" CreationDate="2014-06-09T12:18:12.117" Score="1" Body="&lt;p&gt;If the stock you'd like to hedge with is the same as the option's underlying obviously just find the net delta and hedge with that amount of stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have different types of stocks and would like to hedge with an index you can multiply the delta with the beta of each stock versus the index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Beta is analogous to delta in a way. With delta we describe how to hedge an option with its underlying stock. Beta similarily is the minimum variance hedge between a stock on its index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously beta is a less accurate measure than delta however.&lt;/p&gt;&#xA;" OwnerUserId="7682" LastActivityDate="2014-06-09T12:18:12.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12600" PostTypeId="2" ParentId="11590" CreationDate="2014-06-09T15:58:00.543" Score="7" Body="&lt;p&gt;Your analysis is correct. From the risk neutral process &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dS_t = rS_tdt + \sigma S_tdW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;we get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}(S_\tau|\mathbb{F}_t) = S_te^{r(\tau-t)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}(\int_{t}^{T}S_\tau d\tau|\mathbb{F}_t) = \frac{S_t}{r}[e^{r(T-t)}-1]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, as $S \rightarrow \infty$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C(S,A,t) \sim \frac{S_te^{-r(T-t)}}{r(T-T_0)}[e^{r(T-t)}-1] = \frac{S_t}{r(T-T_0)}[1-e^{-r(T-t)}] \texttt{  ---EQ (1)}$$  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&#xA;$$\lim_{S \rightarrow \infty} \frac{\partial C}{\partial S}=\frac{e^{-r(T-t)}}{r(T-T_0)}[e^{r(T-t)}-1].  \texttt{  ---EQ (2)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most likely, the authors used the truncated Taylor approximation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$e^{r(T-t)}-1 \approx r(T-t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to obtain&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\lim_{S \rightarrow \infty} \frac{\partial C}{\partial S}=\frac{T-t}{T-T_0}e^{-r(T-t)} .$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it is not clear if there was oversight or intent in the expression appearing in the paper. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However both forms of the boundary condition are valid, more or less. There is no closed-form solution for the  Asian option without some form of approximation that probably makes the difference in the two forms of the boundary condition irrelevant.  Furthermore if the solution is derived by solving the PDE numerically then the application of a far-field boundary condition must be implemented at the boundary of a truncated domain --  numerical error again will be more significant than any discrepancy in the boundary condition.&lt;/p&gt;&#xA;" OwnerUserId="8153" LastEditorUserId="7867" LastEditDate="2014-06-17T05:37:51.837" LastActivityDate="2014-06-17T05:37:51.837" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12601" PostTypeId="2" ParentId="11545" CreationDate="2014-06-09T15:59:06.580" Score="0" Body="&lt;p&gt;If you're building a technical system that you want to be easily updatable, then yes. a C# query is probably your best bet. A cursory search around Yahoo reveals no-such functionality, and the fact that no one else has jumped on this question with an answer only serves to bolster that case. If you need help with implementation (which isn't in your question) just let me know, and I'll put together a toy example. Good Luck!&lt;/p&gt;&#xA;" OwnerUserId="8148" LastActivityDate="2014-06-09T15:59:06.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12602" PostTypeId="2" ParentId="12592" CreationDate="2014-06-09T16:26:27.417" Score="1" Body="&lt;p&gt;I suggest you to refer to Chapter 9, &quot;Applications of Risk Management&quot; in &quot;Monte Carlo Methods in Financial Engineering&quot; by Glasserman. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Calculating VaR for a portfolio of derivatives rests on using Delta-Normal approximation&lt;/p&gt;&#xA;" OwnerUserId="2142" LastActivityDate="2014-06-09T16:26:27.417" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12603" PostTypeId="2" ParentId="11545" CreationDate="2014-06-09T17:03:36.660" Score="0" Body="&lt;p&gt;I once used some code from &lt;a href=&quot;https://stackoverflow.com/a/17771096/2855515&quot;&gt;SO&lt;/a&gt; to do a similar task.  Here's a bit of a modification.  It's slow but you don't need it often.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;syms &amp;lt;- c('VDIGX','VFIAX')&#xA;library(RCurl)&#xA;library(stringr)&#xA;for(sym in syms){&#xA;  try({&#xA;    url &amp;lt;- paste0(&quot;http://finance.yahoo.com/q/pr?s=&quot;, sym,&quot;+profile&quot;)&#xA;    profile &amp;lt;- getURL(url)&#xA;    row  &amp;lt;- str_extract(profile, &quot;Expense Ratio.*?&amp;lt;/tr&amp;gt;&quot;)&#xA;    cell &amp;lt;- str_extract(row, &quot;&amp;lt;td.*&amp;lt;/td&amp;gt;&quot;)&#xA;    mer &amp;lt;- str_replace_all( cell, &quot;&amp;lt;.*?&amp;gt;&quot;, &quot;&quot; )&#xA;    cat(sym,cell,&quot; &quot;)&#xA;  })&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5872" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2014-06-09T17:03:36.660" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12604" PostTypeId="2" ParentId="4777" CreationDate="2014-06-09T17:10:55.173" Score="2" Body="&lt;p&gt;One aspect you seem not to have so far considered is the ability to trade OTC spread options. A gas-fired power plant is naturally exposed to the &quot;spark spread&quot; (the difference between the market price of a unit of power and the cost of the gas required to produce that power).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These are traded OTC between utilities, banks and standalone energy traders and allow a power plant to hedge on a forward basis the exposure to this spread. The reason such &lt;em&gt;spread options&lt;/em&gt; come into play is because a power plant does not &lt;em&gt;have&lt;/em&gt; to be on. It essentially provides the owner of the plant, the &lt;em&gt;option&lt;/em&gt; to collect the payoff&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$(E_i - G_i)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i.e. they receive&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P_i = \max (E_i - G_i )$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;on each hour $i$ that the plant is able to operate. This is an oversimplified view because in reality there are costs associated with turning a power plant on and off that are missed by this framework.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is not such an issue if the plant is a &quot;base-load&quot; plant (i.e. it is economical to run it 24/7 rather than for only the &lt;em&gt;peak&lt;/em&gt; hours during the day). In the case of a baseload plant, the operating company could sell a one month spread option (on the spark spread) for the month ahead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value obtained from selling such an option would incorporate the intrinsic value present in the month ahead spark spread, as well as the option value of being able to take advantage of any increases in the power price.&lt;/p&gt;&#xA;" OwnerUserId="8171" LastActivityDate="2014-06-09T17:10:55.173" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12605" PostTypeId="2" ParentId="11588" CreationDate="2014-06-09T22:07:53.463" Score="1" Body="&lt;p&gt;A good place to start is the BIS (Bank for International Settlements) site. To be more specific on the Basel Committee on Banking Supervision part of the site.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.bis.org/bcbs/index.htm&quot; rel=&quot;nofollow&quot;&gt;http://www.bis.org/bcbs/index.htm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my case (Brasil´s Basel III) the central bank page is the best place to look for the specifics of Basel III implementation for my country. I imagine that´s the case in other countries as well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also like this Accenture Basel III Handbook for reference (&lt;a href=&quot;http://www.accenture.com/SiteCollectionDocuments/PDF/Accenture-Basel-III-Handbook.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.accenture.com/SiteCollectionDocuments/PDF/Accenture-Basel-III-Handbook.pdf&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As i said it is important to pay attention to the specifics of your country implementation, as it can change from country to country.&lt;/p&gt;&#xA;" OwnerUserId="9257" LastActivityDate="2014-06-09T22:07:53.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12606" PostTypeId="1" CreationDate="2014-06-09T23:54:46.850" Score="0" ViewCount="2453" Body="&lt;p&gt;Can someone explain to me what is direction/non-directional risk?&#xA;Went through few sites but couldn't understand much.&lt;/p&gt;&#xA;" OwnerUserId="9259" LastActivityDate="2014-06-10T16:13:15.730" Title="Directional/Non-Directional Risk" Tags="&lt;risk&gt;&lt;finance&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12608" PostTypeId="1" AcceptedAnswerId="12616" CreationDate="2014-06-10T08:52:09.857" Score="8" ViewCount="320" Body="&lt;p&gt;In the &lt;em&gt;Proceedings of the Estonian Academy of Sciences, Physics and Mathematics&lt;/em&gt; (2003), I saw the following sentence:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Surprisingly, in the case of developed markets, short-term $H$ results showed almost no persistance in memory.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If I understand the meaning of the Hurst exponent well enough, this means that developed markets are close to being efficient in micro-scales.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've done some calculations on a week of data of EUR/USD prices from February 2012, and the Hurst exponent I've found (using the algorithm by &lt;code&gt;sagemath&lt;/code&gt;) was around 0.5 (actually floating from 0.495 to 0.505). The prices were mid prices, sampled every second.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you think it is a &quot;safe&quot; to assume that in such small timescales (~1 sec.), in (highly-)developed markets, the Hurst exponent is ~0.5? That is, is it &quot;safe&quot; to assume that in these markets/timescales the pattern of the prices may be modelled by geometric Brownian motion, in which the standard deviation may change, but also may be assumed to be constant over short (~1 min.) time periods?&lt;/p&gt;&#xA;" OwnerUserId="2723" LastActivityDate="2014-06-10T23:22:59.243" Title="Estimating the Hurst exponent in short terms in developed markets" Tags="&lt;brownian-motion&gt;&lt;hurst-exponent&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12609" PostTypeId="1" AcceptedAnswerId="12610" CreationDate="2014-06-10T14:02:07.920" Score="2" ViewCount="5472" Body="&lt;p&gt;I try to use the finite difference method to get the approximately gamma value, but there is an issue I can't solve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, I set $h$ to 1 basis point of underlying asset value, but the result is not right; then I use market value of gamma find $h$ to compare it with my original setting. I found the different value of underlying assets give different h. For example, to get market gamma, 500 underlying asset should set h to 0.35 basis point of underlying value and 20 underlying asset should set h to 0.58 basis point of underlying value.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to set the step size(h) for the finite difference method?  I wonder if there is a $h$ to optimal result. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The formula I used:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   f(x)'' = (f(x+h)-2*f(x)+f(x-h ))/h^2 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7699" LastEditorUserId="848" LastEditDate="2014-06-10T14:36:35.070" LastActivityDate="2014-06-11T06:51:20.360" Title="calculate gamma value using finite difference method" Tags="&lt;option-pricing&gt;&lt;gamma&gt;&lt;finite-difference-method&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12610" PostTypeId="2" ParentId="12609" CreationDate="2014-06-10T15:30:27.543" Score="3" Body="&lt;p&gt;The problem with your formula is the equation sign $=$.  The second order finite difference is only an approximation to the true gamma:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ f^{\prime \prime}(x) \approx \frac{f(x+h)-2f(x)+f(x-h)}{h^2}. $$ $h$ can not be a result. Ideally, it should be &lt;em&gt;small&lt;/em&gt; (whatever that means), so your original choice of $1\text{bp}$ seems appropriate for this approximation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To test the approximation, I would calculate the theoretical option Gammma from the BS-Model, then the approximation for smaller and smaller values of $h$. If it converges, the implementation is correct. Then, you can worry about other, more subtle, things.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Probabtly one of the more subtle points in this context is the notation. It is unclear what is meant by $f(x+h)$. For a simple approximation of a smooth functions derivative, everything is clear. Since we know that with a price increase, at least the implied volatility will change as well (as the moneyness of the option changes). Departing from the black-scholes-framework for some it might be more appropriate to calculate something like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ f^{\prime \prime}(x) \approx \frac{f_{\text{up}}(x+h)-2f(x)+f_{\text{down}}(x-h)}{h^2}. $$ where $f_{\text{up}}$ and $f_{\text{down}}$ are different from $f$. Simply because the other parameters of the pricing function implicitly depend on the (changed) stock price.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastEditorUserId="2727" LastEditDate="2014-06-11T06:51:20.360" LastActivityDate="2014-06-11T06:51:20.360" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12611" PostTypeId="2" ParentId="11564" CreationDate="2014-06-10T15:44:20.017" Score="5" Body="&lt;p&gt;Go ahead and compute a &lt;em&gt;sample&lt;/em&gt; covariance matrix with 5,000 stocks on a few years (or less) of daily or monthly returns data. This can be done almost instantly on a modern computer. There is a very good chance that this matrix will not be a covariance matrix. You can check by inspecting the eigenvalues. If any are negative then you don't have a covariance matrix, as a covariance matrix must be &lt;em&gt;positive semi-definite&lt;/em&gt;. In theory, a sample covariance matrix is always positive semi-definite, but when it is computed with finite precision that is often not the case. Most portfolio construction techniques, in particular those based on convex quadratic programming, further require that the supplied covariance matrix is &lt;em&gt;positive definite&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, the sample covariance matrix isn't really a viable option for a lot of portfolio construction methods. There are several ways to get a positive definite covariance matrix. All of these can considered &lt;em&gt;shrinkage&lt;/em&gt; methods. In general, you want to use whatever method gives the most accurate estimates while guaranteeing positive definiteness. &lt;/p&gt;&#xA;" OwnerUserId="3398" LastActivityDate="2014-06-10T15:44:20.017" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12612" PostTypeId="2" ParentId="12606" CreationDate="2014-06-10T16:13:15.730" Score="1" Body="&lt;p&gt;These terms mean different things in different circles.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Options traders would consider any exposure to price changes in the underlying to be a directional risk. A hedged option position  still has non-directional risk though, since option prices can change without any change in the price of the underlying. Equities traders would generally not consider exposure to a price change in a stock as necessarily constituting directional risk. They are more likely to only consider exposure to price changes in the broad market or sector as a directional risk. Macro traders generally only consider exposure to changes in major aggregates (e.g. crude oil prices, the dollar) to constitute directional risk.&lt;/p&gt;&#xA;" OwnerUserId="3398" LastActivityDate="2014-06-10T16:13:15.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12613" PostTypeId="2" ParentId="12609" CreationDate="2014-06-10T16:17:37.753" Score="1" Body="&lt;p&gt;I'd say that the shock size depends on the situation/asset. If your model produces somewhat noisy PVs, it is advisable to use a slightly larger $h$ to avoid numerical issues. You may also want to base your decision on empirical hedging performance. This may or may not help, but most bond index providers (Citi/Barclays) use a shock size of 25bp when reporting effective durations &amp;amp; convexities. &lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2014-06-10T16:17:37.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12614" PostTypeId="1" AcceptedAnswerId="12706" CreationDate="2014-06-10T18:00:13.093" Score="5" ViewCount="1169" Body="&lt;p&gt;I'm trying to use the Fourier inversion formula to plot the PDF of an Affine Stochastic Intensity Reduced Form Credit Model, given its characteristic function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The characteristic function of an affine process $\lambda(t)$ is commonly given as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\phi_{\lambda(t)}(u) = \mathrm{E}[e^{iu\lambda(t)}] = \exp(A(t-s,iu)+B(t-s,iu)\lambda(s))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Fourier inversion formula for PDF is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f_{\lambda(t)}(x)=\frac{1}{\pi}\int_0^\infty \mathrm{\Re}[e^{-iux}\phi_{\lambda(t)}(u)]du$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking a CIR process (I’m aware that CIR has a $\chi^2$ Closed-Form PDF and the use of CIR here is just for illustration) which has coefficients:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$A(T)=\frac{2\kappa\theta}{\sigma^2}\log\left(\frac{2\gamma e^{\frac{1}{2}(\kappa+\gamma)T} }{(\kappa+\gamma)(e^{\gamma T}-1)+2\gamma}\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$B(T)=\frac{2 (e^{\gamma T}-1) }{(\kappa+\gamma)(e^{\gamma T}-1)+2\gamma}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In matlab script then, using quadrature for the integral, I (try to) calculate the PDF at the $\lambda$-points &lt;code&gt;X = (0:0.005:0.1)&lt;/code&gt; for &lt;code&gt;T=1&lt;/code&gt; with the code below. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly there is a problem though (quite probably with &lt;code&gt;fcnPhi&lt;/code&gt; below ) - Would greatly appreciate any help here&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;kappa = .07;&#xA;theta = .2;&#xA;sigma = .06;&#xA;lambda0 = .06;&#xA;T = 1;&#xA;gamma = 1;&#xA;&#xA;A = ((2*kappa*theta)/(sigma^2))* log(2*gamma*exp(0.5*(kappa+gamma)*(T))./((kappa+gamma)*(exp(gamma*(T))-1)+2*gamma));&#xA;B = 2*(exp(gamma*(T))-1)/((kappa+gamma)*(exp(gamma*(T))-1)+2*gamma);&#xA;&#xA;fcnPhi = @(u)( exp(u.*(A + B*lambda0)) );&#xA;&#xA;X = (0:0.005:0.1)';&#xA;for i = 1:size(X,1)&#xA;    x = X(i);&#xA;    fcnPdfIntgrl = @(u)( real( exp(-1i.*u.*x) .* fcnPhi(u) ) );&#xA;    pdf_X(i,1) = (1/pi) * integral(fcnPdfIntgrl,0,10000);&#xA;end&#xA;plot(X,pdf_X);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9268" LastEditorUserId="9268" LastEditDate="2014-06-11T16:50:00.087" LastActivityDate="2017-04-26T10:12:17.240" Title="PDF Calculation by Fourier Inversion of Characteristic Function for Affine Intensity Process in Matlab" Tags="&lt;stochastic-processes&gt;&lt;credit&gt;&lt;matlab&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12615" PostTypeId="2" ParentId="11457" CreationDate="2014-06-10T19:49:46.257" Score="9" Body="&lt;p&gt;I could not find any such detailed documentation after some weeks of looking (not non-stop obviously). It is appallingly documented. I do understand fully what it does though so am happy to field some questions on it if you like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a nutshell, I can tell you it is a standard reduced-form credit model under a constant hazard rate (i.e. homogeneous Poisson process). As such it assumes that the default-intensity is not stochastic and is therefore totally unsuitable for any type of quant modelling. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, it is not intended for modelling but only serves as a market-standard converter from Quoted Spreads to CDS Upfront. Somewhat analogously to Black-Scholes Implied Vol, nobody thinks that the underlying follows a simple drift diffusion - IV is only a quoting mechanism for option &quot;value&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is the Upfront $UF = (S_{ISDA}-C)RPV01_{ISDA}$ that is the market-value of the CDS contract and the Quoted Spreads are only a quoting convention which, in conjunction with the ISDA Standard Converter produce that Upfront mark-to-market - (in this way, Quoted Spreads $S_{ISDA}$ are specifically intended for ISDA &quot;Model&quot; $RPV01_{ISDA}$ Conversion). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could equally come up with your own model (based on say a CIR intensity diffusion) which would have its own spreads $S_{CIR}$ (different to the market quoted spreads) but MUST convert via $RPV01_{CIR}$ to the same Upfront $UF$ which is the value actually exchanged in trading. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(S_{CIR}-C)RPV01_{CIR} = UF = (S_{ISDA}-C)RPV01_{ISDA}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need the ISDA model only in so far as, given a timeseries of Quoted Spreads you need to convert to a timeseries of Upfronts (points-upfront) to subsequently apply your own stochastic model to (the daily differences in points-upfront, which has a convex relationship to the daily differences in quoted spreads). Outside of the spread-to-upfront conversion the ISDA &quot;model&quot; has no (intended or practical) usefulness at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Read  &lt;a href=&quot;http://www.damianobrigo.it/cdsbigbang.pdf&quot; rel=&quot;noreferrer&quot;&gt;Damiano Brigo&lt;/a&gt; and also the Barclays' &quot;STANDARD CORPORATE CDS HANDBOOK&quot; (2010).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a Matlab mex file of the ISDA Source Code Converter which I would happily share with you, but you will need to parse the ISDA Swap Fixings XML Files yourself, to reproduce exactly what you see on Bloomberg CDSW&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best Rgds,&#xA;Mark&lt;/p&gt;&#xA;" OwnerUserId="9268" LastEditorUserId="9268" LastEditDate="2014-06-11T11:58:40.263" LastActivityDate="2014-06-11T11:58:40.263" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12616" PostTypeId="2" ParentId="12608" CreationDate="2014-06-10T23:22:59.243" Score="5" Body="&lt;p&gt;I don't believe it means they are efficient. It could only imply that your sample has no persistence (notice I'm not using the term auto-correlation) in the returns, if you did use returns instead of prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Evidence of EMH via the Hurst exponent is an extrapolation that you cannot make. It just says you cannot reject the null regarding this test. There are several ways in which markets could have inefficiencies while displaying H=0.5. It does not imply allocation efficiency, operational efficiency nor information efficiency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A good counter-example is finding heteroskedasticity in the variance, which is not consistent with the EMH and consistent with finding no auto-correlation in the returns.&lt;/p&gt;&#xA;" OwnerUserId="7544" LastActivityDate="2014-06-10T23:22:59.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12617" PostTypeId="1" CreationDate="2014-06-11T01:09:59.113" Score="7" ViewCount="1520" Body="&lt;p&gt;I have a question about VaR mapping for FX forwards. Please bear with me while I outline the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Philippe Jorion's book discusses VaR mapping; a means to break down complex instruments into simple risk factors and calculate the amount of risk against these risk factors across the portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The example given for FX forwards is a 1 year contract to buy 100 MM EUR for 138.09 MM USD. The forward rate is $1.3013. The FX contract is broken down into 3 components: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;a long position in the EUR spot ($1.2877)&#xA;a long position in a EUR risk free bill (2.281%)&#xA;a short position in a USD risk free bill (3.330%)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A VaR is given for each of the above positions, along with a correlation matrix. The author then calculates the present value of the cash flows from each of the 3 positions above as such:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PV cash flow of long position in the EUR spot = $$130.09 * 1/(1+USD risk free bill rate) = 125.89$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PV of the cash flow of long position in the EUR risk free bill = $$100 * EUR spot * 1/(1+EUR risk free bill rate) = 125.90$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PV of the cash flow of short position in the USD risk free bill = $$-130.09 * 1/(1+USD risk free bill rate) = - $125.89$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The PV cash flows are then multiplied by the given VaRs for those risk factors and summed up to produce an aggregate undiversified var. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't understand why the cash flow for the EUR spot long position is being calculated the way it is. It makes no sense to me. Seeing as it is a spot rate why is it's cash flow not simply spot * 100 MM EUR notional ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a YouTube video on this problem in case my textual description isn't clear. &#xA;&lt;a href=&quot;https://www.youtube.com/watch?v=Um8e_teI_dw&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.youtube.com/watch?v=Um8e_teI_dw&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(This contrived question is a topic on my Financial Risk Manager exam)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="7369" LastEditDate="2017-01-06T13:23:42.413" LastActivityDate="2017-01-06T13:23:42.413" Title="VaR mapping - Forward Foreign Currency Contract" Tags="&lt;fx&gt;&lt;var&gt;&lt;forward&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12618" PostTypeId="1" AcceptedAnswerId="19547" CreationDate="2014-06-11T07:53:18.750" Score="8" ViewCount="13826" Body="&lt;p&gt;I have a project where I would like to track some tick data and create some indicators to follow it. I am thinking of using Node.js for this project, but I would like to know from those in industry if they have come across it in their own or others systems and if they use any particular JavaScript finance libraries.&lt;/p&gt;&#xA;" OwnerUserId="3424" LastActivityDate="2015-08-30T20:47:06.907" Title="Is node.js being used in systematic trading software?" Tags="&lt;programming&gt;&lt;trading-systems&gt;&lt;tick-data&gt;" AnswerCount="5" CommentCount="2" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="12619" PostTypeId="2" ParentId="11539" CreationDate="2014-06-11T13:25:28.477" Score="1" Body="&lt;p&gt;you can smooth your data and then find the zeros of the slope of the smoothed data. You can adjust for the costs with the degree of smoothing.&lt;/p&gt;&#xA;" OwnerUserId="5332" LastActivityDate="2014-06-11T13:25:28.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12620" PostTypeId="2" ParentId="12618" CreationDate="2014-06-11T14:52:17.183" Score="11" Body="&lt;p&gt;We use &lt;code&gt;Node&lt;/code&gt; for reporting but not as part of our main signal generating trading system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be honest the answer will almost certainly be yes for every common programming technology as it just takes one person to use it somewhere to make the answer yes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just look at OCaml, before Jane street, most techno logiest on the street had never heard of it and now its very well known.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Probably the canonical answer for this type of question should be this one:&#xA;&lt;a href=&quot;https://quant.stackexchange.com/a/304/743&quot;&gt;https://quant.stackexchange.com/a/304/743&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;META RANT&lt;/strong&gt;&#xA;In general I find these kind of questions a bit troubling for this site for two reasons:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;for any given programming language or stack if you ask is anyone using this for trading the answer is mostly likely yes.  &lt;/li&gt;&#xA;&lt;li&gt;There is no real outcome or call to action from the question.  If someone answers yes, so what?  if someone answers no, so what?  What is the canonical answer to a question like this that &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Or put another way, what answer would make the poster happy here?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;END RANT&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="743" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2014-06-11T14:52:17.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12621" PostTypeId="5" CreationDate="2014-06-11T16:08:16.330" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-06-11T16:08:16.330" LastActivityDate="2014-06-11T16:08:16.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12622" PostTypeId="4" CreationDate="2014-06-11T16:08:16.330" Score="0" Body="A trading system is a computer program that will submit orders to the market.  It can be user driven or completely automated. " OwnerUserId="743" LastEditorUserId="743" LastEditDate="2014-06-11T16:55:28.140" LastActivityDate="2014-06-11T16:55:28.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12623" PostTypeId="5" CreationDate="2014-06-11T16:09:11.883" Score="0" Body="&lt;p&gt;Complex event processing (CEP) consists of high-speed processing of many events across all the layers of an organization, identifying the most meaningful events within the event cloud, analyzing their impact, and taking subsequent action in real time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;a href=&quot;http://en.wikipedia.org/wiki/Complex_event_processing&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Complex_event_processing&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="743" LastEditorUserId="743" LastEditDate="2014-06-11T16:55:39.633" LastActivityDate="2014-06-11T16:55:39.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12624" PostTypeId="4" CreationDate="2014-06-11T16:09:11.883" Score="0" Body="Complex event processing (CEP) consists of high-speed processing of many events across all the layers of an organization." OwnerUserId="743" LastEditorUserId="743" LastEditDate="2014-06-11T16:55:36.603" LastActivityDate="2014-06-11T16:55:36.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12625" PostTypeId="5" CreationDate="2014-06-11T16:15:05.060" Score="0" Body="&lt;p&gt;Algorithmic trading is the process of taking in inputs such as market data, current news, and producing orders without human intervention.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://en.wikipedia.org/wiki/Algorithmic_trading&quot; rel=&quot;nofollow&quot;&gt;Algorithmic Trading&lt;/a&gt; for more details.&lt;/p&gt;&#xA;" OwnerUserId="743" LastEditorUserId="743" LastEditDate="2014-06-11T16:55:32.560" LastActivityDate="2014-06-11T16:55:32.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12626" PostTypeId="4" CreationDate="2014-06-11T16:15:05.060" Score="0" Body="Algorithmic trading is the process of taking in inputs such as market data, current news, and producing orders without human intervention." OwnerUserId="743" LastEditorUserId="743" LastEditDate="2014-06-11T16:55:44.900" LastActivityDate="2014-06-11T16:55:44.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12627" PostTypeId="1" AcceptedAnswerId="12628" CreationDate="2014-06-11T17:36:29.397" Score="2" ViewCount="1662" Body="&lt;p&gt;How is implied vol calculated if the quoted prices are out of the range for any possible volatility? E.g. Current quote on &lt;a href=&quot;http://www.cboe.com/micro/binaries/introduction.aspx&quot; rel=&quot;nofollow&quot;&gt;CBOE&lt;/a&gt; for options expiring on Aug 16, 2014&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Calls   Last Sale   Net     Bid     Ask     Vol     Open Int    &#xA;BSZ1416H1900-E  0.0     0.0     0.66    0.81    0   0   14 Aug 1900.00      BSZ1416T1900-E  0.0     0.0     0.20    0.32    0   0&#xA;BSZ1416H1950-E  0.0     0.0     *0.45   0.60*   0   0   14 Aug 1950.00       BSZ1416T1950-E     0.0     0.0     0.40    0.55    0   0&#xA;BSZ1416H2000-E  0.0     0.0     0.20    0.32    0   0   14 Aug 2000.00      BSZ1416T2000-E  0.0     0.0     0.67    0.82    0   0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For BSZ1416H1950-E both the bid and ask are outside of the range. (cannot upload the picture I created, it showed that max value attainable is .4 around 50% volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Normally supply/demand, liquidity are all figured into IV. How do you find IV? What is the mechanism to handle such things for building vol surface? How are such differences used, in a control variate like manner, perhaps, to estimate the price at some time in the future? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="7867" LastEditDate="2014-06-11T18:39:32.263" LastActivityDate="2018-05-02T09:26:53.620" Title="BInary Option implied volaltility" Tags="&lt;implied-volatility&gt;&lt;binary-options&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12628" PostTypeId="2" ParentId="12627" CreationDate="2014-06-11T20:44:14.820" Score="5" Body="&lt;p&gt;Are you sure you are using the correct pricing formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a binary (digital) call that pays $1$, the simple Black-Scholes price at time $t=0$ is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ C_d = e^{-rT}N(d_2)$$&#xA;$$d_2 = \frac{\text{ln}(F/K) - \frac1{2}\sigma^2T}{\sigma \sqrt{T}}$$&#xA;where $N$ is the standard normal distribution function, $F=Se^{(r-q)T}$ is the forward index price, $S$ is the spot index price, $K$ is the strike price, $T$ is the time to expiration and $\sigma$ is the implied volatility.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are some current values&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S = 1942, r = 0.25\%, q = 1.97\%.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the 14 Aug 1950 call&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$K = 1950, T = 64 \ \text{days}=0.1752 \ \text{years} ,$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and assuming an implied volatility of $\sigma = 12\%$, the binary call price is $0.43$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the quotes you are showing look reasonable under the current implied volatility conditions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of your general question about finding implied volatility, there are two issues. (1) How to build a no-arbitrage pricing model that will correctly match market prices of vanilla calls and puts, and (2) how to price more exotic options (such as binary options) in the new framework.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, observed market prices of SPX index options are not consistent with simple Black-Scholes assumptions -- an underlying that follows geometric Brownian motion with constant volatility. The actual prices look like expecations under a probability distribution that is not lognormal -- perhaps more skewed. Implied volatility -- that value which makes the Black-Scholes formula match the market price -- varies both with strike price and time to expiration.  In theory, if we knew the market price of a call option $C(S,t;K,T)$ for every conceivable strike price $K$ when the index price is $S$ at time $t$, then for a given time-to-expiration $T$ we could find the implied probability density function as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f(S) = e^{r(T-t)}\frac{\partial^2}{\partial K^2}C(S,t;K,T).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, there are not enough market price observations to use this formula directly in a meaningful way -- but it suggests there are broader stochastic models (with more degrees of freedom) that can be used to generate no-arbitrage option prices that match market prices. One of the more popular approaches is the local volatility model that assumes the underlying index price follows a stochastic process of the form&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dS_t=\mu S_t dt + \sigma(S_t)S_tdW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W_t$ is a Brownian motion and the volatility $\sigma(\cdot)$ is not a constant but a deterministic function of the underlying price. There is an extensive literature on the local volatility model indicating how to calibrate the function $\sigma(\cdot)$ to match market prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a binary option, it is not entirely clear what simple pricing appoach should be used when vanilla calls and puts exhibit an implied volatility skew. One possibility is to find the price in terms of a replicating portfolio of vanilla options.  If a binary option pays $1$ when the index is above a strike price $K$ then it can be replicated, in theory,approximately using a call spread. We would buy a number $1/\delta$ of ordinary calls with strike price $K$ and sell the same number of calls with strike price $K+\delta.$  In this way&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C_d(S,t;K,T) \approx  \frac1{\delta} \big[C(S,t;K,T)-C(S,t;K+\delta , T)\big]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally we would make $\delta$ as small as possible, but there are practical limitations in terms of available strikes and the eventual leverage that would be applied. Nevertheless, this replication model suggests how the binary option might be priced in the presence of a volatility skew. Taking the limit as $\delta \rightarrow 0$ we get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C_d(S,t;K,T) \approx  \frac{\partial}{\partial K} C(S,t;K,T),$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and this relationship indicates how to extract the price of the binary option that is consistent with the prices of vanilla options in a framework (eg. local volatility) where implied volatility depends on strike.&lt;/p&gt;&#xA;" OwnerUserId="8153" LastEditorUserId="8153" LastEditDate="2014-06-13T21:10:58.413" LastActivityDate="2014-06-13T21:10:58.413" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12629" PostTypeId="1" CreationDate="2014-06-11T21:22:31.147" Score="-1" ViewCount="299" Body="&lt;p&gt;Ok. So as of 6/10/2014's market close the SPY was 195.6 and the VIX closed at a ridiculous recent low of 10.99. Now because the VIX (IV) is the implied volatility of 1 month contracts on the SPX and because this 1 month figure is quoted annually, we take the current value of the VIX and multiply it by sqrt(20/250) to convert it to a true monthly figure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So given a VIX of 10.99, the SPX a 1stdv move to the upside and downside will be 195.6(+/-)10.99*sqrt(20/250)*195.6, ie, 201 and 189 on the SPY, 1 month from now. If it goes above 201 or below 189, the move is greater than a 1stdv move. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I ran a historical test to see how close the SPX has abided by the VIX, 1 month prior. So I ran a historical test from 1/2/2001 to 6/10/2014, on daily data of the SPY and the VIX. Because I lose one of month of VIX data because due to the forward lag, we have a sample size of 3358 days. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Running through how many days we broke above:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1stdev  234 329 1074.56&#xA;2stdev  0   47  167.9&#xA;3stdv   0   9   10.074&#xA;4stdev  0   1   &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The 1st number is the days above the upper stdev band&#xA;The 2nd number is the days below the lower stdev band&#xA;The 3rd number is the total # of days beyond nth stdev by the normal distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the results it seems that the market is more normal that we actually though. But other empirical evidence has shown otherwise. From the results I am seeing, It seems to suggest equity prices are normally distributed. We don't see more fat tailed events more than the normal distribution suggests. Can someone shed light if I ran the analysis incorrectly??&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Uzu9W.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="4729" LastEditorUserId="4729" LastEditDate="2014-06-14T01:42:55.060" LastActivityDate="2014-07-09T14:21:41.723" Title="Is the market really Normal. Is Implied Volatility Historically Correct?" Tags="&lt;implied-volatility&gt;&lt;spx&gt;&lt;standard-deviation&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12630" PostTypeId="2" ParentId="2815" CreationDate="2014-06-12T03:19:27.773" Score="2" Body="&lt;p&gt;If you are using Spatial Econometrics toolbox in Matlab you could use the lrratio function which implements a sequence of such tests beginning at a maximum lag (specified by the user) down to a minimum lag (also specified by the user). &#xA;(more info in &lt;a href=&quot;http://fmwww.bc.edu/ec-p/software/matlab/mbook.pdf&quot; rel=&quot;nofollow&quot;&gt;http://fmwww.bc.edu/ec-p/software/matlab/mbook.pdf&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="9280" LastActivityDate="2014-06-12T03:19:27.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12631" PostTypeId="2" ParentId="11539" CreationDate="2014-06-12T04:46:45.340" Score="1" Body="&lt;p&gt;The specific procedure depends on details of the problem such as&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What is the objective function? Sharpe ratio? Terminal wealth?&lt;/li&gt;&#xA;&lt;li&gt;What is the model of transaction costs? &lt;/li&gt;&#xA;&lt;li&gt;What is the data resolution? (If it's very high the problem may become challenging computationally).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;There are many papers, e.g. &lt;a href=&quot;http://www.stanford.edu/~boyd/papers/pdf/portfolio.pdf&quot; rel=&quot;nofollow&quot;&gt;this one&lt;/a&gt;, that solve various problems of this sort. These are most certainly not black-box optimization problems. There are specific, and well-motivated objective functions, constraints, and dynamics. You should understand that, in general, the size of the search space is not a good guide as to whether the problem can be solved efficiently or not. Brute force exhaustive search is almost never utilized for non-trivial optimization problems. It is often the case that a problem over an infinite set (e.g a linear program) is much easier than a problem over a finite set (e.g. an integer program).  &lt;/p&gt;&#xA;" OwnerUserId="3398" LastActivityDate="2014-06-12T04:46:45.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12632" PostTypeId="2" ParentId="11271" CreationDate="2014-06-12T05:47:28.020" Score="3" Body="&lt;p&gt;The predominant protocols/APIs offered by FX ECNs are FIX and ITCH.  So you might want to look out for node.js implementations of these, e.g. &lt;a href=&quot;https://github.com/falconair/nodefix&quot; rel=&quot;nofollow&quot;&gt;nodefix&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without that ``extra'' layer, the trading venue that comes closest to your (bulleted) requirements would be &lt;a href=&quot;http://www.currenex.com/trading_services_api_integration.html&quot; rel=&quot;nofollow&quot;&gt;Currenex&lt;/a&gt; with their STP connectivity, a RESTful API based on &lt;a href=&quot;http://www.fixtradingcommunity.org/pg/structure/tech-specs/fix-protocol&quot; rel=&quot;nofollow&quot;&gt;FIXML&lt;/a&gt;.  I put `extra' in quotes because it's now up to you to provide a neat internal framework that exposes node.js routines to your generator and FIXML to the Currenex API.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for your additional constraints, I think they're a bit off-place.  See it from their point of view: Any ECN with liquidity in the interbank league would put &lt;em&gt;their systems at risk&lt;/em&gt; by offering such a service directly to just about anyone.  And a broker connected to an ECN would somehow have to pass on the connection costs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So your best bet might be dealers.  They're much more likely to support your scenario (or at least might do in the future), for instance for stocks I've found &lt;a href=&quot;https://developers.tradeking.com/documentation/node&quot; rel=&quot;nofollow&quot;&gt;Tradeking&lt;/a&gt;, a node.js API around FIXML (much like Currenex').  They have an FX marketplace too (broker-dealer by the looks of things), maybe you could ask them to open their API to that.&lt;/p&gt;&#xA;" OwnerUserId="1040" LastActivityDate="2014-06-12T05:47:28.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12633" PostTypeId="2" ParentId="9659" CreationDate="2014-06-12T05:50:16.343" Score="3" Body="&lt;p&gt;I don't understand how technical indicators are at all relevant to the question. State probabilities can be generated directly from the returns if the model is known. There is no need to guess at heuristic trading rules based on technical indicators.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $r_t$ be the return at time $t$. Your model is&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$E\{r_t  | s_t=i\} \sim N(\mu_i,\sigma^2_i), i=0,1$&lt;/li&gt;&#xA;&lt;li&gt;$P\{s_t=i | s_{t-1}, s_{t-2}, ...\} = P\{s_t=i|s_{t-1}\}$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In other words, the state is Markov and returns are normal with known mean, variance in either state. Suppose we are standing at time $t$. We need to first determine $P\{s_t = 0 | r_{t-1}, ..., r_0\} = p_t$. Use the &lt;a href=&quot;http://en.wikipedia.org/wiki/Forward%E2%80%93backward_algorithm&quot; rel=&quot;nofollow&quot;&gt;forward backward algorithm&lt;/a&gt; aka dynamic programming and implemented in most HMM packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now&#xA;$$E\{r_t\} = p_t\mu_0 + (1-p_t)\mu_1$$&#xA;and&#xA;$$Var\{r_t\} = p_t\sigma_0^2 + (1-p_t)\sigma_1^2.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we need to choose our position $x$ to maximize the Sharpe &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{E\{x'r\}}{\sqrt{Var\{x'r\}}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is equivalent (up to a scaling factor) to the mean-variance problem&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\min_x \{\lambda x' \Sigma x - x'\bar{r} \},$$&#xA;where $\Sigma$ is a diagonal matrix with $Var\{r_t\}, t= 0,1,...,T$ on the diagonal and $\bar{r} = E\{r\}$. The proof of this fact is by contradiction. Suppose there is an $x$ with higher Sharpe that isn't the solution to the mean-variance problem, $x^*$. We can scale $x$ by a positive constant $\alpha$ so that we have $\alpha \bar{r}'x = \bar{r}'x^*$ . At the same time, we know that&#xA;$$\alpha\sqrt{x'\Sigma x} &amp;lt;    \sqrt{(x^*) ' \Sigma x^*}$$&#xA;because $x^*$ isn't Sharpe-optimal. Squaring both sides gives&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\alpha^2 x'\Sigma x  &amp;lt; (x^*) ' \Sigma x^*.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fact that $\alpha x$ has the same mean and strictly lower variance contradicts the assumption that $x^*$ is the solution. We thus conclude that the mean variance solution is always Sharpe optimal. Note that in more general problems (e.g. with constraints) this equivalence doesn't necessarily hold. Now the solution to the mean-variance problem (take derivative and set to zero) is just $\frac{1}{2 \lambda}\Sigma^{-1} \bar{r}$. However, at time $t$ we don't have to worry about anything other than $x_t$. It is possible to compute $x$ for future times that are optimal with respect to current expectations, but in practice it is better to re-run the forward-backward algorithm after we observe the next return and then re-compute $x_{t+1}$. The optimal solution therefore is to bet proportionally to  $\frac{E\{r_t\}}{Var\{r_t\}}$. This has an intuitive interpretation as &#xA;$$\frac{E\{r_t\}}{Var\{r_t\}} = \frac{E\{r_t\}}{\sqrt{Var\{r_t\}}} \frac{1}{\sqrt{Var\{r_t\}}}$$&#xA;so that&#xA;$$x_t\sqrt{Var\{r_t\}} = \frac{E\{r_t\}}{\sqrt{Var\{r_t\}}},$$&#xA;i.e. take risk proportional to expected Sharpe at each time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have transaction costs then you need to consider future means and variances, which makes the problem more difficult, but doable.   &lt;/p&gt;&#xA;" OwnerUserId="3398" LastEditorUserId="3398" LastEditDate="2014-06-12T14:18:58.863" LastActivityDate="2014-06-12T14:18:58.863" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="12636" PostTypeId="1" CreationDate="2014-06-12T13:25:51.710" Score="5" ViewCount="629" Body="&lt;p&gt;I am modelling the 3M yield of US Treasuries using an ARMA/ GARCH approach. Most interest rate models (e.g. Vasicek) describe the process as follows:     &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_{t}-r_{t-1} = some ARMA+  \epsilon_t  $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $r_t$ is the yield of a bond. Why do you use the yield instead of the return of the yield (relative price change to last period)? For example if you model stock returns you use the return as well. I am very well aware of the relation between price and yield of a bond.&lt;/p&gt;&#xA;" OwnerUserId="9283" LastActivityDate="2014-12-01T04:44:43.457" Title="Intuition behind interest rate models" Tags="&lt;garch&gt;&lt;models&gt;&lt;arma&gt;&lt;interest&gt;&lt;yield&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12637" PostTypeId="1" AcceptedAnswerId="12640" CreationDate="2014-06-12T16:18:56.443" Score="0" ViewCount="1173" Body="&lt;p&gt;In the context of mutual funds the KID directive forces us to calculate 5 year ex-post volatility of a (market) fund (weekly returns). Thus each week we look back in the past and calculate volatility (annualized) using the last $5*52 = 260$ weekly returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given a $5$ year history and thus a recent ex-post volatility&#xA;how can we set an ex-ante limit for a market fund in order not to breach a certain level of ex-post volatility in the next period?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To start a chain of thoughts:&#xA;We are given returns $r_1,\ldots, r_{260}$ now and one week later we are given returns $r_2\ldots r_{260}$ and a new return which we assume ex-ante to be normally distributed with volatility $\sigma$ then the future ex-post variance is given by (assume an average return of $0$ for simplicity)&#xA;$$&#xA;1/259 \sum_{i=2}^{260} r_i^2 + 1/259 X^2 \sigma^2/52,&#xA;$$&#xA;where $X^2$ is chi-squared distributed with $1$ df (the factor $1/259$ is the usual factor for the variance estimator and $1/52$ scales annualized variance to weekly). &#xA;Thus if we want that the ex-post vol is below a threshold $t$ we need&#xA;that&#xA;$$&#xA;1/259 \sum_{i=2}^{260} r_i^2 + 1/259 X^2 \sigma^2/52 \le t^2&#xA;$$&#xA;and thus&#xA;$$&#xA;X^2 \sigma^2/52 \le 259*t^2-\sum_{i=2}^{260} r_i^2,&#xA;$$&#xA;and we could use this equation to set a limit on ex-ante vol.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2014-06-13T06:45:37.323" LastActivityDate="2014-06-13T08:30:45.740" Title="Controling ex-post volatility by ex-ante limits" Tags="&lt;volatility&gt;&lt;risk-management&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12638" PostTypeId="1" CreationDate="2014-06-12T19:47:36.600" Score="8" ViewCount="1741" Body="&lt;p&gt;The results are very different.I know the code from quantlib and the result of quantlib seem right(close to market price). Is there anyone know why the value from fOptions is so large or fOptions used different approach? Thank you  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  library(fOptions)&#xA;    library(RQuantLib)&#xA;&#xA;    TypeFlag&amp;lt;-&quot;c&quot;&#xA;    S&amp;lt;-530.32&#xA;    X&amp;lt;-550&#xA;    Time&amp;lt;-283/365&#xA;    r&amp;lt;-0.000703&#xA;    b&amp;lt;-0.05&#xA;    sigma&amp;lt;-0.2442&#xA;&#xA;    fOptions.BAW&amp;lt;-BAWAmericanApproxOption(TypeFlag, S, X, Time, r, b, sigma,&#xA;                                          title = NULL, description = NULL)&#xA;    quantlib.BAW&amp;lt;-AmericanOption(&quot;call&quot;, S, X,&#xA;                                 b, r, Time, sigma,&#xA;                                 timeSteps=150, gridPoints=149, engine=&quot;BaroneAdesiWhaley&quot;)&#xA;&#xA;    modelName&amp;lt;-c(&quot;fOptions.BAW&quot;,&quot;quantlib.BAW&quot;)&#xA;    result &amp;lt;-cbind(modelName,&#xA;             c(fOptions.BAW@price,quantlib.BAW[1]$value))&#xA;    colnames(result)&amp;lt;-c(&quot;Model&quot;,&quot;Value&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/jn5fS.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="7699" LastActivityDate="2021-04-16T18:54:38.027" Title="The option values are different from two r package - foptions,rquantlib" Tags="&lt;option-pricing&gt;&lt;r&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12639" PostTypeId="2" ParentId="636" CreationDate="2014-06-13T07:06:21.643" Score="2" Body="&lt;p&gt;S&amp;amp;R levels can be obtained quite easily. However, you will not find this data in most references. Professional day traders use value areas from the previous day as well a forming value areas in the current session. There are several crucial levels gathered from the previous GLOBEX session. These can be derivied from any market. These support/resistance levels can be used in conjunction with similar markets and Indecies. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;These levels are not traded based upon this information alone, but in conjunction with several other crucial indicators. I could write a book on how this is accomplished; It is also of great importance to understand the levels with the other data, in real time, as well as the use of discretionary constants. This is a paradox, but based upon years of active participation in incorporating these ideas into an outline to guide each individual trade, in a market/markets, which change everyday.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have not come across any such complete information on how this is accomplished, nor any consistently successful trader that has documented such a strategy. I am aware of the effectiveness of such a methodology and know why one will never come across such information, in print form. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A key to understanding support/resistance is to first understand that, while helpful, especially when using the CORRECT daily levels, price is the last data/imformation to be posted. Therefore, any technical analysis that is based upon price alone, will not hold up to any models over time. If this where not true, HFT algorithms would be able to identify this and all market activity would cease.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although thsi doesn't answer your question drectly, I wanted to shed some light on the complexity of the mixture of relative data one needs to identify, establish, comprehend and reduce into the least amount of data required to make immediate correlations so immediate action can be tamen, o ce the criteria is met, to take a trade with a higher probability of success, on a consistent basis, in a market structure that changes daily. While this craft is rewarding, once you are able find these aforementioned mechanisms, it is time consuming and 99.8???% will not discover even this much content I've presented here. The majority will seek price action alome, complimented by levels of support/resistance (price action). Again,  I reiterate,  price is the last element in the process to move. Those that base their strategy on that concept alone, had best do so with a simulated account.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This leaves many questions unanswered,  but at least you know what the questions are, which places you with qn edge that over 90% do not know. Why would I divulge such valuable information? I wish I had figured this out many years ago, when I traded my first Futures trade. What took me a long time to figure out, can help you, so you dont follow that mistaken path. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I surmise Price action remains popular because it is the easiest way to look at a chart; Because people, like nature, look for the path of least resistance (which is often an illusion) and because one can get luck using price action in a strong trending market, with short term success. This is why I had a difficult time guiding myself from the seemingly easy way to get rich quick... and turn a large fortune into a small one. In the early 90's, I had a remarkable run shorting the British Pound using Fibonacci numbers for s/r levels a d price action alome. What I had not known was that a man by the name, George Soros, was also shorting the British Pound...Eventually breaking the Bank of England. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of the three largest trades in history, Soros was imvolved in two of them; This being the largest. That was pure dumb luck on my part. That run ended up costing me much more over time as well as wasting valuable time trying to figure out why this method stopped working. A bit of fundimenta analysis is still a requirement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the first and only post I've ever written on such information. I have no monetary interest in doing such. My only interest is perfecting my art as a day trader. But since much of this was taught to me by an unknown market wizard, I want to pay it forward. This post should contain my email address, but since I'm new to this forum, I'm not sure you are able to contact me directly. You may contact me at survivormanbrad@gmail.com. If I do not get back to you, try again, as that is not my main email and I only go through them periodically. However, now that I've given this information, I will afford time for inquiries. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bradley&lt;/p&gt;&#xA;" OwnerUserId="9287" LastActivityDate="2014-06-13T07:06:21.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12640" PostTypeId="2" ParentId="12637" CreationDate="2014-06-13T08:30:45.740" Score="1" Body="&lt;p&gt;The chain of thoughts above seem to work. I post some &lt;code&gt;R&lt;/code&gt; code where I implemented this. Seems to work well. Comments are welcome!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;r.hist = rnorm(5*52,0,0.18/sqrt(52)) ## 18% vola&#xA;limit.vol = 0.2 ## limit 20% vola&#xA;&#xA;## next period 5% confidence&#xA;&#xA;gap = 0.2^2/52*259-sum(r.hist[2:259]^2)&#xA;var.treshold = gap/qchisq(0.95, 1)&#xA;target.vol = sqrt(var.treshold*52)&#xA;cat(&quot;Target vola&quot;,round(target.vol*100),&quot;%&quot;)&#xA;## simulate&#xA;ex.post.vol = NULL&#xA;N = 1000&#xA;new.ret = rnorm(N,0,target.vol/sqrt(52))&#xA;for (i in 1:N){&#xA;r.new = c(r.hist[2:259],new.ret[i])&#xA;ex.post.vol = c(ex.post.vol,sd(r.new)*sqrt(52))&#xA;}&#xA;&#xA;plot(ex.post.vol,main=&quot;Sampled ex-post vol one week later&quot;)&#xA;quantile(ex.post.vol,0.95)&#xA;quantile(ex.post.vol,0.99)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-06-13T08:30:45.740" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12641" PostTypeId="1" AcceptedAnswerId="12642" CreationDate="2014-06-13T15:43:06.597" Score="3" ViewCount="384" Body="&lt;p&gt;Did value of ratio between informed and uninformed traders at market, making difference to profitability of short-term directional trading on that market?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My guess is yes and better play short-term directional on market when is more uninformed traders in relation to informed, because at this market spread will be maintained by market makers on lowest value to possible profits/short-term volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That may be correct or not, maybe someone have other point of view on this question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: To simplify,&#xA;It's possible to make a guess that specific markets can be better environment for play short-term directional strategy based on estimated ratio between uninformed and informed traders at them? And why?&lt;/p&gt;&#xA;" OwnerUserId="6175" LastEditorUserId="6175" LastEditDate="2014-06-17T22:10:54.040" LastActivityDate="2014-06-17T22:10:54.040" Title="Short-term directional trading" Tags="&lt;market-microstructure&gt;&lt;market-making&gt;&lt;spread&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12642" PostTypeId="2" ParentId="12641" CreationDate="2014-06-13T16:10:45.610" Score="1" Body="&lt;p&gt;I'm still not entirely certain exactly is the question you want answered. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are you asking is &quot;uninformed&quot; flow more valuable than &quot;informed&quot; flow, then the answer is an emphatic yes otherwise funds like Citadel wouldn't pay so much for it.   See &lt;a href=&quot;http://www.zerohedge.com/article/citadel-set-control-975-e-trades-order-flow&quot; rel=&quot;nofollow&quot;&gt;here for details&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only issue to consider is that will you be able to get a piece of the &quot;uninformed&quot; flow?  With most of the brokers selling their flow these days its unlikely that you'd be able to see any of this flow before a fund like Citadel has taken advantage of it.&lt;/p&gt;&#xA;" OwnerUserId="743" LastEditorUserId="743" LastEditDate="2014-06-13T17:39:43.170" LastActivityDate="2014-06-13T17:39:43.170" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12643" PostTypeId="2" ParentId="12627" CreationDate="2014-06-13T19:26:49.023" Score="3" Body="&lt;p&gt;The skew plays an important part for pricing binaries. In S&amp;amp;P the VIX increases on declines and decreases on rises. We can explain a part of the premium by assuming the Black-Schole Call option captures the underlying volatility. Let us represent call option as $C(K,\sigma)$ and binary $V_{Binary}(K,\sigma)$ Then we can write &#xA;$$ V_{Binary}(K,\sigma) = -\frac {\partial C}{\partial K}(K,\sigma)$$&#xA;Apply chain rule,&#xA;$$= -\left[\frac{\partial C(K,\sigma)}{\partial K} \frac{\partial K}{\partial K} + \frac{\partial C(K,\sigma)}{\partial \sigma} \frac{\partial \sigma}{\partial K}\right] $$&#xA;The term $-\frac{\partial C(K,\sigma)}{\partial K}  \texttt{ is quoted} \space V_{Binary} $  and  $ \frac{\partial C(K,\sigma)}{\partial \sigma}$ is vanilla call option vega and $\frac{\partial \sigma}{\partial K} $ is the skew of the vanilla call option. &#xA;Therefore,&#xA;$$ $V_{Binary}(K,\sigma) = V_{Binary}(S,t) - C_{Vega}(S,t) * C_{Skew}(K,\sigma) $$&#xA;$$ =e^{-rT} N(d_2) - S \sqrt {T} N'(d_1) * Skew $$&#xA;Skew can be estimated from the SPX options close to the strike K. The above equation has all the values that are readily available. Of course, on top of that there is premium for supply/demand, liquidity etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a note, the SPX contracts are very liquid but the liquidity in Binaries is another add on.  Binaries are embedded in  &lt;a href=&quot;http://www.risk.net/structured-products/feature/2222490/demystifying-digital-options&quot; rel=&quot;nofollow noreferrer&quot;&gt;many structured products&lt;/a&gt; and there are many way to use them for &lt;a href=&quot;http://www.stat.nus.edu.sg/~stalimtw/MFE5010/PDF/L2note.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;creating new products&lt;/a&gt; or risk management. BSZ maybe are being used as lotto play. Hopefully more players will recognize its importance and increase demand.&lt;/p&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="34018" LastEditDate="2018-05-02T09:26:53.620" LastActivityDate="2018-05-02T09:26:53.620" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="12644" PostTypeId="2" ParentId="10749" CreationDate="2014-06-13T20:03:37.290" Score="1" Body="&lt;p&gt;Implied volatility is used to explain the market price, generally of vanilla options. &#xA;Binary Call values goes to zero when $\sigma \rightarrow \infty $. Increasing volatility does not increase price as it does for vanilla options.&#xA;You can another  &lt;a href=&quot;https://quant.stackexchange.com/questions/12627/binary-option-implied-volaltility/12643#12643&quot;&gt;question that shed more light&lt;/a&gt;. The quoted SPZ binaries on CBOE on SPX are completely out of the range of maximum binary values. The bid and ask are both higher. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Binaries as you know, as you stated, they are derivative of vanilla options, so better to limit implied vol to vanilla options then explain the difference in binaries in terms of  market factors such as skew, supply/demand, liquidity. In that sense, the implied volatility is not calculatable in the traditional sense or does not exist. I hope this explains it all.&lt;/p&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2014-06-13T20:03:37.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12646" PostTypeId="1" AcceptedAnswerId="12671" CreationDate="2014-06-14T00:06:41.673" Score="1" ViewCount="503" Body="&lt;p&gt;I am just reading about basis risk.  It is being described as risk of the price of the hedging instrument not fluctuating the same as the instrument itself.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was just wondering, if we bought a future to lock in a price, why would it matter what the price of the future is?  Only unless we decide to sell the contract it would matter right?  &lt;/p&gt;&#xA;" OwnerUserId="9259" LastActivityDate="2014-06-16T20:37:36.013" Title="Basis Risk for Futures/Options" Tags="&lt;options&gt;&lt;risk&gt;&lt;finance&gt;&lt;futures&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12647" PostTypeId="2" ParentId="9701" CreationDate="2014-06-14T03:22:44.120" Score="0" Body="&lt;p&gt;I don't have access to BBG right now, but are you sure these are not straight quoted STRIPS yields? Coupon &amp;amp; principal STRIPS are relatively actively traded in the US and these may just be generic STRIPS yields.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2014-06-14T03:22:44.120" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12649" PostTypeId="1" CreationDate="2014-06-14T09:40:14.997" Score="0" ViewCount="125" Body="&lt;p&gt;I'm trying to find a concept on this question,in my understanding investors differ on risk preference,the question said investors hold efficient portfolios because they are generally risk averse? agree or disagree with some explanation..&lt;/p&gt;&#xA;" OwnerUserId="9293" LastActivityDate="2014-07-14T23:25:04.963" Title="investors hold efficient portfolios because generally they are risk averse" Tags="&lt;portfolio-management&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12650" PostTypeId="2" ParentId="4948" CreationDate="2014-06-14T09:50:56.847" Score="6" Body="&lt;p&gt;If you wander about the theoretical result of fitting parameters, the book &lt;em&gt;GARCH Models, Structure, Statistical Inference and Financial Applications&lt;/em&gt; of FRANCQ and ZAKOIAN provides a step-by-step explanation. I think that it is not a big problem to implement these steps to R.&lt;/p&gt;&#xA;" OwnerUserId="9294" LastActivityDate="2014-06-14T09:50:56.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12651" PostTypeId="1" AcceptedAnswerId="12652" CreationDate="2014-06-14T10:30:52.270" Score="5" ViewCount="1911" Body="&lt;p&gt;Could someone please provide me with a clear and concise definition of the $\tau$ parameter in the Black-Litterman model? It seems one is rather hard to come by. I understand it to be the 'weight on views', but this is a little vague.&lt;/p&gt;&#xA;" OwnerUserId="9295" LastActivityDate="2014-11-17T09:08:56.307" Title="What is the tau parameter in the Black-Litterman model?" Tags="&lt;black-litterman&gt;" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12652" PostTypeId="2" ParentId="12651" CreationDate="2014-06-14T13:01:57.783" Score="2" Body="&lt;p&gt;I don't believe there is one generally accepted method and a number of papers are written on this issue. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1117574&quot; rel=&quot;nofollow&quot;&gt;Black-Litterman Approach: Original Model and Extensions (2008)&lt;/a&gt; by Meucci has an overview and I believe is generally useful to learn more. It suggests using $\tau = \frac{1}{T}$ but notes more complicated approaches exist. &lt;a href=&quot;http://www.palgrave-journals.com/jam/journal/v1/n2/abs/2240011a.html&quot; rel=&quot;nofollow&quot;&gt;A demystification of the Black–Litterman model: Managing quantitative and traditional portfolio construction (2000)&lt;/a&gt; by Satchell Scowcroft &quot;propose an ingenious model where $\tau$ is stochastic, but extra parameters need to be calibrated.&quot; (Meucci). &lt;a href=&quot;http://www.master272.com/finance/BL/JWalters_Black-Litterman.pdf&quot; rel=&quot;nofollow&quot;&gt;The Black Litterman Model: A Detailed Exploration&lt;/a&gt; (2008) by Walters gives another overview. Of course, you can't miss Idzoreks A &lt;a href=&quot;http://www.indiceperu.com/lecturas/paper13.pdf&quot; rel=&quot;nofollow&quot;&gt;step-by-step guide to the Black-Litterman model (2004)&lt;/a&gt;. This &lt;a href=&quot;http://mikespivey.wordpress.com/2012/07/20/tauidzorek/&quot; rel=&quot;nofollow&quot;&gt;blog&lt;/a&gt; might also be of interest.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2014-06-14T13:01:57.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12653" PostTypeId="1" AcceptedAnswerId="12654" CreationDate="2014-06-14T14:36:04.213" Score="0" ViewCount="722" Body="&lt;p&gt;The Black-Scholes formula entails market completeness, so the price of an option is only the cost associated with dynamically hedging the option. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where does this cost come from? I don't see how sustaining a replicating portfolio in a frictionless market can cost anything. &lt;/p&gt;&#xA;" OwnerUserId="7555" LastEditorUserId="7555" LastEditDate="2014-06-14T14:59:45.820" LastActivityDate="2014-06-15T00:02:13.073" Title="Intuitive understanding of Black-Scholes pricing" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;hedging&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12654" PostTypeId="2" ParentId="12653" CreationDate="2014-06-14T15:43:38.853" Score="4" Body="&lt;p&gt;I think you misinterpreted what you read. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The whole point of the frictionless market assumption is that you can forget about any cost or any bound on volumes or latency associated with transactions used to rebalance a self-financed portfolio. So you are right when you say that sustaining a replicating portfolio doesn't cost anything. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This implies that the price of the option has to be equal to the &lt;strong&gt;initial value&lt;/strong&gt; of any replicating portfolio (and by absence of arbitrage all replicating portoflios have the same initial value).   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a mathematical point of vue, your mistake comes from assuming that any martingale (like the actualized value of a self-financing portfolio $\widetilde{\Pi}_t := e^{-\int_0^t r_s ds} \Pi_t$, for $t\leq T$, under the risk neutral probability) has zero expected value when actually it just has constant expectated value. So if $\Pi$ is a replicating portfolio, the value of your derivative is equal to $\Pi_0$ and it can be non zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take any simple example. If your terminal payoff is almost surely positive (like a call or put option), you will need some money (or to borrow some) to start your replication strategy. The replication of a bond with fixed coupons rates or the floating leg of a swap is quite enligntening imho. &lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2014-06-15T00:02:13.073" LastActivityDate="2014-06-15T00:02:13.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12655" PostTypeId="1" AcceptedAnswerId="12883" CreationDate="2014-06-14T15:54:51.020" Score="3" ViewCount="544" Body="&lt;p&gt;I have some trouble understanding a chapter in &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/032112720X&quot; rel=&quot;nofollow&quot;&gt;George Pennacchi textbook &quot;Asset Pricing&quot;&lt;/a&gt;. Here the author shows that the square of a Wiener Process $[dz(t)]^2$ converges to $dt$ for infinitesimally short time periods. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the definition of the Itô-Integral for $\int_0^T[dz(t)]^2$: \begin{equation} \lim_{n\rightarrow\infty}E_0[(\sum_{i=1}^n [\Delta z_i^2]-\int_0^T[dz(t)]^2)^2]=0 \end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then he states that \begin{equation} E_0[(\sum_{i=1}^n [\Delta z_i^2] -T)^2]=2T\Delta t \end{equation}, which is the equation I cannot derive. The limit for this expression as $\Delta t \rightarrow 0$ is 0 which is obvious. But what I am also not able to grasp is why this result together with the definition of the Itô Integral finally shows that \begin{equation} \int_0^T[dz(t)]^2=\int_0^T dt \end{equation} &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone give me some assistance in understanding this important outcome?&lt;/p&gt;&#xA;" OwnerUserId="7344" LastEditorUserId="7344" LastEditDate="2014-06-14T20:12:39.027" LastActivityDate="2014-07-15T06:39:37.697" Title="Why does [dz(t)]^2 converge to dt over infinitesimally short time periods?" Tags="&lt;asset-pricing&gt;&lt;continuous-time&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12656" PostTypeId="2" ParentId="11271" CreationDate="2014-06-14T22:10:51.453" Score="2" Body="&lt;p&gt;Check out &lt;a href=&quot;https://github.com/mForex/mForex.API.TypeScript&quot; rel=&quot;nofollow&quot;&gt;https://github.com/mForex/mForex.API.TypeScript&lt;/a&gt;, it is TypeScript wrapper for their websocket protocol. &lt;/p&gt;&#xA;" OwnerUserId="9300" LastEditorUserId="848" LastEditDate="2015-06-21T10:42:00.907" LastActivityDate="2015-06-21T10:42:00.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12657" PostTypeId="2" ParentId="9271" CreationDate="2014-06-14T22:17:16.777" Score="0" Body="&lt;p&gt;Here it is, C# API for FX trading in ECN model: &lt;a href=&quot;https://github.com/mForex/mForex.API&quot; rel=&quot;nofollow&quot;&gt;https://github.com/mForex/mForex.API&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I know, you can create free demo account and subsequently request for API, the only disadvantage is the fact, that real account are in PLN only.  &lt;/p&gt;&#xA;" OwnerUserId="9300" LastActivityDate="2014-06-14T22:17:16.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12658" PostTypeId="2" ParentId="12649" CreationDate="2014-06-14T22:57:04.230" Score="1" Body="&lt;p&gt;By definition, an efficient portfolio is one that is &quot;best in its (risk) class.&quot; That's the main rationale for holding it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are some efficient portfolios for risk averse investors (low risk, accompanied by relatively low return), and others for risk loving investors (high risk, highest return). But in either case, they are (by definition) the highest return portfolios available for their risk levels.&lt;/p&gt;&#xA;" OwnerUserId="2345" LastActivityDate="2014-06-14T22:57:04.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12659" PostTypeId="2" ParentId="12651" CreationDate="2014-06-15T04:00:06.373" Score="3" Body="&lt;p&gt;Jay Walter's Paper on &quot;The Factor Tau in the Black-Litterman Model&quot;&#xA;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1701467&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1701467&lt;/a&gt; is also useful to review &lt;/p&gt;&#xA;" OwnerUserId="7110" LastActivityDate="2014-06-15T04:00:06.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12660" PostTypeId="1" CreationDate="2014-06-15T05:21:24.040" Score="1" ViewCount="63" Body="&lt;p&gt;Below is the topics covered in my undergraduate economics program. I want to know which course should I take to get a full overview of topics in finance today.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Econometrics&lt;/li&gt;&#xA;&lt;li&gt;Micro, Macro Economics&lt;/li&gt;&#xA;&lt;li&gt;Insurance&lt;/li&gt;&#xA;&lt;li&gt;Investment (first half luenberger textbook)&lt;/li&gt;&#xA;&lt;li&gt;Asset pricing (discrete time, CAPM, continuous time with black scholes model, pricing kernel and risk neutral method, stochastic calculus)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="9301" LastEditorUserId="9301" LastEditDate="2014-06-15T16:33:19.197" LastActivityDate="2014-06-15T16:33:19.197" Title="Which more topic should be covered in my undergraduate program?" Tags="&lt;finance&gt;" AnswerCount="1" CommentCount="3" ClosedDate="2014-06-16T19:50:26.353" ContentLicense="CC BY-SA 3.0" />
  <row Id="12661" PostTypeId="1" AcceptedAnswerId="12873" CreationDate="2014-06-15T08:57:04.287" Score="4" ViewCount="235" Body="&lt;p&gt;In a GARCH model like the following&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$y_t=\sigma_tz_t,\\&#xA;\sigma_t^2=\omega(1-\alpha-\beta)+\alpha y_{t-1}^2+\beta \sigma_{t-1}^2$$&#xA;where $z_t$ is assumed to be iidN(0,1), we say that conditional on past information $y_t$ has the gaussian density&#xA;$$f(y_t|y_{t-1},\sigma_{t-1}^2)=\frac{1}{\sqrt{2\pi\sigma^2_t}}exp\left(\frac{1}{2\sigma^2_t}y_t^2\right)$$ &#xA;Am I correct in making the following conclusion?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;So when conditioning on the past, we know what the value of $\sigma^2_t$ is. Consequently, we can state that $y_t$ is conditionally normally distributed as $N(0,\omega(1-\alpha-\beta)+\alpha y_{t-1}^2+\beta \sigma_{t-1}^2)$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7078" LastActivityDate="2014-07-15T23:38:41.067" Title="Understanding the conditioning in a GARCH process" Tags="&lt;volatility&gt;&lt;garch&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12663" PostTypeId="2" ParentId="11583" CreationDate="2014-06-15T13:14:14.333" Score="0" Body="&lt;p&gt;As mentioned above, the action depends upon the market.  Many exchanges in the USA do not provide the market order type; all orders are priced.  The time in force (TIF) is independent of the order type, generally.&lt;/p&gt;&#xA;" OwnerUserId="6815" LastActivityDate="2014-06-15T13:14:14.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12664" PostTypeId="2" ParentId="12660" CreationDate="2014-06-15T13:53:54.153" Score="0" Body="&lt;p&gt;Asset pricing, but it depends on what kind of finance you're talking about.&lt;/p&gt;&#xA;" OwnerUserId="8208" LastEditorUserId="848" LastEditDate="2014-06-15T14:26:36.573" LastActivityDate="2014-06-15T14:26:36.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12665" PostTypeId="1" AcceptedAnswerId="12669" CreationDate="2014-06-15T14:44:11.357" Score="1" ViewCount="227" Body="&lt;p&gt;Consider a one step binomial tree model for stock price. The classical setup is as below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At time $t=0$, the stock price is $S_0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At time $t=1$, the stock has probability $p$ to jump up to price $S_1^u = uS_0$ (define $u:=S_1^u/S_0$); and probability $q=1-p$ to jump down to price $S_1^d = dS_0$ (define $d:=S_1^d/S_0$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let the risk free interest rate as $r$. Normally, $1+r &amp;lt; pu + qd$, so &#xA;$$\frac{1}{1+r} \mathbb{E}[S_1] = \frac{pu+qd}{1+r}S_0 &amp;gt; S_0$$&#xA;, or, at time $0$ the stock is priced as $S_0$, lower than the discounted value of stock price expectation at time $1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, my question is , can we interpret the underbid of the stock price, $\frac{1}{1+r} \mathbb{E}[S_1] - S_0$, as the risk premium, or the cost because of uncertainties?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so, is there any related formula? For example, an equation linking the stock price and its volatility $\sigma$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ps. in the risk neutral world, the probabilities are  $\tilde p=\frac{1+r-d}{u-d}$ and $\tilde q = 1-\tilde p=\frac{u-1-r}{u-d}$, and we have $S_0 = \frac{1}{1+r} (\tilde p S_1^u + \tilde q S_1^d) = \mathbb{\tilde E}\left[\frac{S_1}{1+r}\right]$&#xA;, in other words, the stock price $S_t$ is a martingale, under numeraire $(1+r)$ and risk neutral measure. These are all smart and classic, but not related to my question.&lt;/p&gt;&#xA;" OwnerUserId="2161" LastEditorUserId="2161" LastEditDate="2014-06-15T15:20:04.270" LastActivityDate="2014-08-16T02:56:16.117" Title="Is stock price priced in the uncertainty?" Tags="&lt;equities&gt;&lt;binomial-tree&gt;&lt;pricing-formulae&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12666" PostTypeId="2" ParentId="11486" CreationDate="2014-06-15T19:02:52.050" Score="4" Body="&lt;p&gt;The relationship between volatility and CDS is very interesting. Volatility in finance is synonym of risk. There are many aspects of volatility. There are 2 primary ways to find CDS premium, one is using structural model and the other is reduced form or intensity based model. Structural models use equity valuation, outstanding debt and equity volatility to determine the probability of default. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The strong correlation is what prompts the use of structural models. However, the information needed for correct information is only known to insiders and is disclosed at certain intervals through SEC disclosures. In the mean time, investors gauge this from equity performance in the market; surely insider or informed players buy puts pending doom or bad news.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;VIX may be a good proxy for volatility. It is, generally, a fear gauge. However, it moves in the wrong direction, eg. Between Oct 12-19, 2011 it moved up along with the market. Such brief periods of disconnections have been seen many times. Volatility increase does not always indicate doom. It can also go up if the market is expecting good news, like take over, good earnings news. Exploding VIX can also be interpreted at the bottom signalling an end downside and explosion to the upside sometime, depending upon when the upside comes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a low interest environment the number of defaults go down. This causes the CDS premium to go down. This, besides volatility, is also reflected in the structural models.There are many factor models that take into account various accounting ratio and volatility to predict defaults more accurately. There are in-house in-cycle and out-of-cycle credit rating models companies use for rating counter parties. But volatility is a large integral part.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All in all the VIX should correspond to CDS.&lt;/p&gt;&#xA;" OwnerUserId="7867" LastActivityDate="2014-06-15T19:02:52.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12669" PostTypeId="2" ParentId="12665" CreationDate="2014-06-16T03:54:01.887" Score="0" Body="&lt;p&gt;I'm not sure if I understand you perfectly, but basically, you have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}(S_1)= p S_0 u + (1-p) S_0 d = S_0\left[p (u-d) +d \right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is simply the expectation (i.e. there is no pricing here).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice that this means that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}\left[\frac{S_1}{S_0}\right]=p (u-d) + d$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the expected rate of return is $1+R_S=p (u-d) + d$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the investment was risk-free, it should yield $1+R_f$. So, you can say that the risk premium in there is $(1+R_S)-(1+R_f)=R_S-R_f=p (u-d) + d -1 -R_f$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice that the volatility of the stock price here is determined by the choice of the $u$ and $d$ parameters.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2014-06-16T03:54:01.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12670" PostTypeId="1" CreationDate="2014-06-16T05:56:41.840" Score="7" ViewCount="9474" Body="&lt;p&gt;I would like to know if anyone has experience with a good open source kalman filter implementation in C++ that I could use. I require an implementation that supports computation of likelihood similar to KFAS in R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks,&#xA;Pavy&lt;/p&gt;&#xA;" OwnerUserId="9310" LastActivityDate="2014-06-17T14:08:46.510" Title="robust open source Kalman filter library in C++" Tags="&lt;programming&gt;&lt;kalman&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12671" PostTypeId="2" ParentId="12646" CreationDate="2014-06-16T07:46:25.047" Score="1" Body="&lt;p&gt;If you look e.g. in Hull's book in the section about hedging then you get more details. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short:&#xA;You have a position of $X$ (thousand) Euros in a bond/basket of stocks and you want to hedge this position by shorting $N$ futures contracts that correlate to these instruments (Bund/Treasury futures or equity index futures).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You hedge because you think that there is some difficult time in the next say week. You don't simply sell your position (the bond/the stocks) for various reasons (could be: you are not allowed to have too much cash in the portfolio, transaction costs are too high ...) so you short a derivative. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the change in price of the derivative has little to do with your bond/stock then this will not be a good hedge but just another position. This risk is called basis risk.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-06-16T07:46:25.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12672" PostTypeId="1" CreationDate="2014-06-16T08:15:16.207" Score="2" ViewCount="65" Body="&lt;p&gt;If you are modeling an exotic, like a binary or a barrier, and hedging it with vanillas that have strikes quite close to the exotic's strike, then a large asset step size, for example,  $\delta S = \frac {K_{max} -K_{min}}{\beta}$, with $\beta = 1 \space or \space 2$, where $K_{min}$ and $K_{max}$ are the min and max of strikes in the basket, does not allow the payoff shape to be correctly modeled. It introduces substantial error in the valuation. To resolve this sort of problem what approaches using FDM do exist?&lt;/p&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="7867" LastEditDate="2014-06-16T14:33:16.340" LastActivityDate="2014-06-16T16:17:43.863" Title="What different techniques exist for modeling exotics near payoff discontinuities in Finite Difference method?" Tags="&lt;hedging&gt;&lt;exotics&gt;&lt;finite-difference-method&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12673" PostTypeId="1" CreationDate="2014-06-16T12:15:57.770" Score="5" ViewCount="805" Body="&lt;p&gt;Here is the problem : we should adopt the point of view of an industrial company which purchases electricity as an input in its production line and which wants to achieve the following two goals : &#xA;&lt;strong&gt;-minimize the variance of its total purchase price&lt;/strong&gt; on a weekly/monthly/yearly basis depending on the delivery period of the futures used&#xA;&lt;strong&gt;-minimize its purchase price&lt;/strong&gt; and beats the yearly average spot price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The specific features of the electricity market to take into account are the fact that electricity is a non-storable good which leads to some jumps in the spot prices which are then more volatile than futures prices. Moreover, futures contracts are designed with delivery periods on specific lengthes of time : month, quarter or year depending on the contract. &#xA;For instance, you fix a certain price today for receiving a fixed volume of electricity everyday for the next month/quarter/year. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, we have two constraints to take into account : &#xA;-the industrial company wants to buy at list 25% of its electricity on the spot market to manage its volume risk&#xA;-&lt;strong&gt;the company can only be long&lt;/strong&gt; : we cannot sell electricity on the spot or futures market. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first idea was to compute the minimum variance portfolio weights to allocate to spot, futures with montly delivery, quarterly delivery and yearly delivery. Though the problem comes from the fact that modern portfolio theory applies to assets' returns assuming that we can either be Long/short an asset whereas here we are only interested in prices since the company can only be long. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your help should you have any insight or references. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Vincent&lt;/p&gt;&#xA;" OwnerUserId="9313" LastActivityDate="2014-06-16T21:28:50.800" Title="Electricity market : how to design an optimal hedging strategy using spot and futures markets for an industrial consumer?" Tags="&lt;futures&gt;&lt;modern-portfolio-theory&gt;&lt;hedging&gt;&lt;minimum-variance&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12674" PostTypeId="2" ParentId="12670" CreationDate="2014-06-16T13:44:35.297" Score="6" Body="&lt;p&gt;We use &lt;a href=&quot;http://kalman.sourceforge.net/&quot; rel=&quot;noreferrer&quot;&gt;KFilter&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;here is a link to their &lt;a href=&quot;http://kalman.sourceforge.net/doc/example.html#expage&quot; rel=&quot;noreferrer&quot;&gt;documentation&lt;/a&gt; page for you to peruse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you share a bit more about how you want to use the filter then it may help us.  However please note that suggest me a library questions are typically not on topic on any of the stack exchange sites&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To update the answer to include the function the user wanted....&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the documentation to get &lt;a href=&quot;http://kalman.sourceforge.net/doc/a00010.html#ac0985755b9fbeb6330aef0c34546a91&quot; rel=&quot;noreferrer&quot;&gt;the error covariance matrix&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="743" LastEditorUserId="743" LastEditDate="2014-06-17T14:08:46.510" LastActivityDate="2014-06-17T14:08:46.510" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12675" PostTypeId="1" CreationDate="2014-06-16T15:38:21.633" Score="0" ViewCount="218" Body="&lt;p&gt;I am looking at a company's financial report and there is a table in it that lists returns over different annualized periods. It ranges from 1 year to 20 years. Would a 2 year return in this table be defined as the average return you would get in two years based off previous returns, or is it the average return based only on the last two years of data?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, how is this calculated? Annualized returns are raised to the 1/n power, where n is the number of years, so would a 2 year return just be 2/n power?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="9314" LastActivityDate="2014-06-17T07:44:51.443" Title="What does 2 Year Annualized mean compared to 1 Year Annualized" Tags="&lt;returns&gt;&lt;annualized&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12676" PostTypeId="2" ParentId="12672" CreationDate="2014-06-16T16:17:43.863" Score="1" Body="&lt;p&gt;Some techniques I can think of include&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Use a brownian bridge to get a crossing probability for points near the boundary&lt;/li&gt;&#xA;&lt;li&gt;Use implicit stepping in your PDE solver (which increases smoothness) as opposed to explicit stepping (which &quot;rings&quot; near discontinuities)&lt;/li&gt;&#xA;&lt;li&gt;Employ control variates, by using the same grid to price related instruments having easy analytic pricing solutions&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="254" LastActivityDate="2014-06-16T16:17:43.863" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12677" PostTypeId="1" CreationDate="2014-06-16T17:10:37.863" Score="6" ViewCount="554" Body="&lt;p&gt;What are the most popular platforms used for quantitative equity portfolio management/research? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've only used Barra so far for their factor models. Is there any specific feature or model you think that'll be really helpful for such a product? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for a product so that I can focus on idea/strategy generation rather than spending a lot of time in preparing data or other fundamental work.&lt;/p&gt;&#xA;" OwnerUserId="5861" LastActivityDate="2015-03-30T04:35:56.470" Title="Platform for Quantitative equity portfolio" Tags="&lt;portfolio-management&gt;&lt;quantitative&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="4" CommunityOwnedDate="2014-06-17T06:43:07.110" ContentLicense="CC BY-SA 3.0" />
  <row Id="12678" PostTypeId="2" ParentId="12646" CreationDate="2014-06-16T20:37:36.013" Score="0" Body="&lt;p&gt;In the context of commodities, the spread between the price as delivered and the price of the liquid forward/futures contract is very much a risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More often than not, you are not fixing the price at the liquid point and the future can only be used as a dirty hedge to the risk you are attempting to hedge.  For example, say I'm a power plant operator attempting to hedge the cost of natural gas to run my plant.  This past winter, the price of NG in the northeast blew out and was delivering for \$50-60/MMBtu over NYMEX prices of high \$4, low \$5/MMBtu.  Hedging with NYMEX Henry Hub gas (which delivers near Louisiana) wouldn't really have done you much good.&lt;/p&gt;&#xA;" OwnerUserId="2176" LastActivityDate="2014-06-16T20:37:36.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12679" PostTypeId="2" ParentId="12677" CreationDate="2014-06-16T20:42:55.437" Score="1" Body="&lt;p&gt;Here's a few that have overlaps/synergies with Barra:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Wharton Research Data Services (WRDS)&lt;/li&gt;&#xA;&lt;li&gt;S&amp;amp;P Capital IQ Compustat&lt;/li&gt;&#xA;&lt;li&gt;FactSet Research Systems&lt;/li&gt;&#xA;&lt;li&gt;Eze OMS Portfolio Modeling and Analytics&lt;/li&gt;&#xA;&lt;li&gt;Axioma Portfolio Analytics&lt;/li&gt;&#xA;&lt;li&gt;Fincluster fcbank&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="1764" LastEditDate="2015-03-30T04:35:56.470" LastActivityDate="2015-03-30T04:35:56.470" CommentCount="1" CommunityOwnedDate="2014-06-17T06:43:07.110" ContentLicense="CC BY-SA 3.0" />
  <row Id="12680" PostTypeId="2" ParentId="12673" CreationDate="2014-06-16T21:28:50.800" Score="2" Body="&lt;p&gt;Only certain aspects of the risks that you bear in power markets given exposure to variable quantity swaps can be hedged.  To your point, you have to have some expectation of what the load will look like.  Even if you immediately go out and buy power against this expected qty you are subject to the risk that the load will deviate from said qty.  There is no product except for 'load-following' fixed price contracts sold by power retailers (who charge extremely high margins) that offer protection against this risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is plenty of literature out there on load forecasting models -- no need to overengineer this.  Typically simulation of temperatures (via OU process) can be married to a linear/nonlinear historical regression of the load in question to produce some long-term estimate of the load.  You should try to capture behavior at an hourly level to best estimate the shape of the load.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for when to hedge, a model of the forward market price distribution will be your best guide to timing the market.  Without going into specific details, this presentation by the guys at Hess's power marketing arm is very good:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.slideshare.net/EricMeerdink/euci-may2011-ericmeerdink&quot; rel=&quot;nofollow&quot;&gt;http://www.slideshare.net/EricMeerdink/euci-may2011-ericmeerdink&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2176" LastActivityDate="2014-06-16T21:28:50.800" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12681" PostTypeId="2" ParentId="12665" CreationDate="2014-06-17T02:05:08.483" Score="0" Body="&lt;p&gt;I think I got the quantitative explanation in Steven E. Shreve's &quot;Stochastic calculus for finance II&quot;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/CYDX3.png&quot; alt=&quot;ch 5.2.2&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2014-06-17T02:05:08.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12682" PostTypeId="1" AcceptedAnswerId="12685" CreationDate="2014-06-17T05:31:39.560" Score="1" ViewCount="143" Body="&lt;p&gt;If an investor bought a stock, could another private party access that information anywhere? Does the SEC/exchange itself create a real time/ historical record of who holds what stocks, and is that available to the public?&lt;/p&gt;&#xA;" OwnerUserId="9318" LastActivityDate="2014-06-17T13:08:21.100" Title="Is the purchase of a stock publicly accessible?" Tags="&lt;equities&gt;&lt;trading&gt;&lt;market-data&gt;&lt;automated-trading&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12684" PostTypeId="2" ParentId="12675" CreationDate="2014-06-17T07:44:51.443" Score="1" Body="&lt;p&gt;In your question you do not provide any reference. I believe that we are in front of two possibilities: annualized linear returns and Compound Annual Growth Rate (CAGR). If compounding is not mentioned, I would assume annualized linear returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;$n$-years Annualized linear returns&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$n$ = number of years&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ n * r_A = r_* $, where $r_*$ is the return over the $n$ years time span.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;n-years CAGR&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ (1 + r_{CAGR})^n = (1 + r_*) $, where $r_*$ is the return over the $n$ years time span.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;A few additional notes:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;With &quot;small&quot; returns, linear returns approximate CAGR. In $ (1 + r) * (1 + r) = (1 + 2*r + r^2) $, if $r$ is &quot;small&quot;, $r^2$ may be negligible&lt;/li&gt;&#xA;&lt;li&gt;Fractions of years may be tricky: for example 1 year and six months leads to $n = 1.5$&lt;/li&gt;&#xA;&lt;li&gt;A third type of returns exists: &lt;a href=&quot;http://finance.wharton.upenn.edu/~pbond/teaching/Review%20of%20continuous%20compounding.pdf&quot; rel=&quot;nofollow&quot;&gt;continuous compounding&lt;/a&gt;. I list continuous compounding here for completeness sake but I do not think, based on my experience, that it is used in practice to present results in a financial report. It is interesting to look at their relationship with &lt;a href=&quot;http://www.mathestate.com/tools/Financial/r01/LogarithmicReturns.html&quot; rel=&quot;nofollow&quot;&gt;logarithmic returns&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="6781" LastActivityDate="2014-06-17T07:44:51.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12685" PostTypeId="2" ParentId="12682" CreationDate="2014-06-17T08:16:44.910" Score="2" Body="&lt;p&gt;I do not believe that the exchange is capable of tracking down the person or legal entity who has been part of any recorded transaction and in particular linking the activity of market intermediaries to the ultimate interests of beneficial owners. However, under certain conditions, the person or legal entity has to report to the SEC his identity and his stake in the company. The concept of &lt;a href=&quot;http://www.law.cornell.edu/cfr/text/17/240.13d-3&quot; rel=&quot;nofollow&quot;&gt;beneficial ownership&lt;/a&gt; governs disclosure obligations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Insiders and 10%+  beneficial owners&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Form 3&quot; is &lt;a href=&quot;http://research.thomsonib.com/help/sec_guide04-03-02.htm#13G&quot; rel=&quot;nofollow&quot;&gt;the initial statement which identifies holdings of registrant's securities owned by directors, officers and 10 percent shareholders. A Form 3 must be filed within 10 days after the event&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Changes in ownership for insiders and 10%+ shareholders must be announced with &lt;a href=&quot;http://www.sec.gov/about/forms/form4data.pdf&quot; rel=&quot;nofollow&quot;&gt;&quot;form-4&quot;&lt;/a&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Form-5&quot; is &lt;a href=&quot;http://en.wikipedia.org/wiki/Form_5&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;an SEC filing submitted to the Securities and Exchange Commission on an annual basis by company officers, directors, or beneficial (10%) owners, which summarizes their insider trading activities.&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;5%+ beneficial owners:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Filing &quot;&lt;a href=&quot;https://www.sec.gov/answers/sched13.htm&quot; rel=&quot;nofollow&quot;&gt;SCD 13-D&lt;/a&gt;&quot; is required by 5%+ owners within 10 days of the acquisition event.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Filing &quot;&lt;a href=&quot;http://www.sec.gov/divisions/corpfin/guidance/reg13d-interp.htm&quot; rel=&quot;nofollow&quot;&gt;SCH 13-G&lt;/a&gt;&quot; is an annual filing required by all reporting persons owning 5% or more of the company.&lt;/p&gt;&#xA;" OwnerUserId="6781" LastActivityDate="2014-06-17T08:16:44.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12687" PostTypeId="1" AcceptedAnswerId="12693" CreationDate="2014-06-17T13:00:29.113" Score="11" ViewCount="2459" Body="&lt;p&gt;I am trying to teach myself about interest rate swaps, how they are priced, etc... Easy enough - just comparing cash flows of fixed and floating rate bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, what I'm struggling with is how the future interest rates (as well as the discount factors) are being determined. These are never clearly explained and the articles/books simply say 'we use this term structure' or 'that term structure'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a more general context, my question is how do they determine with &lt;em&gt;certainty&lt;/em&gt; (which is what the texts seem to imply) the value of something (ie the interest rate) that only materialises in the future? They never explicitly state that we use the returns (or yields) on a certain product, to &lt;em&gt;predict&lt;/em&gt; what the interest rates might be in the future...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If my inferred understanding is correct, what they are actually doing is talking about different ways to get an estimate of what they THINK the interest rates in the future will be. The different methods being those which use for example some variant of the yield curve of zero-coupon Treasury securities, where the yield on each product with maturity T years is used as the interest rate realised in year T.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is not immediately obvious, or explained, why these methods make sense; have they been verified empirically at some point and are now taken as granted to be true or good enough estimates?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;PS:&lt;/strong&gt; I am particularly interested in answers more closely related to industry practice as opposed to academic research.&lt;/p&gt;&#xA;" OwnerUserId="6782" LastEditorUserId="6782" LastEditDate="2014-06-19T07:46:45.093" LastActivityDate="2019-04-02T03:59:22.937" Title="Deriving Interest Rates" Tags="&lt;interest-rates&gt;&lt;yield-curve&gt;&lt;swaps&gt;&lt;discount-factor-curve&gt;" AnswerCount="3" CommentCount="5" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="12688" PostTypeId="2" ParentId="12682" CreationDate="2014-06-17T13:08:21.100" Score="1" Body="&lt;p&gt;There is a great answer as to when an investor has to file.  The only other piece of information that you might have available to you, is the broker number of the buyer or seller as listed on the trade notification.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For most of the big firms this won't help you as their retail , buy side and their own internal flow will all be seen under that number.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can help you if the buyer/seller is a fund with their own broker number.&lt;/p&gt;&#xA;" OwnerUserId="743" LastActivityDate="2014-06-17T13:08:21.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12690" PostTypeId="2" ParentId="12687" CreationDate="2014-06-17T13:26:24.623" Score="1" Body="&lt;p&gt;How are the future interest rates determined?&#xA;Two ways. 1) They are observed in the market, i.e. they are the best estimate of the market participants. One way is to use Bloomberg. 2) You can create your own discount curve and from that calculate the forward rates. Discount and forward curves for non-collateralized swaps must be consistent, otherwise arbitrage is possible. Note how 1) and 2) relate. You can observe in 1), but you have to be consistent with 2).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How &quot;certain&quot; are these future estimates?&#xA;They are not. Goldman Sachs, in one of their pitches to my client, has beautifully shown how forward rates constantly overestimate the actual rates. Note that  the estimate of forward rates, as observed in the market, change on a second-by-second basis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to derive interest rates?&#xA;You, without Bloomberg or Reuters, cannot do it. You can see Libor rates online (1Y), you can see futures prices (1-3 years), but for everything beyond you need Swap prices. These are determined by trades between majore banks, unless you have a subscription to that data, I don't think this is publicly available information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What else plays a role in determining interest rates?&#xA;With all the theory of Hull and Co. interest rates, like any other price, are determined by the whims of players. I had a client who entered into 17 swaps (total 4bn USD) with 8 banks. Every single bank gave him different rates. This was in 1 day. Reason? One bank didn't care about future busines, one bank wanted the IPO, other wanted all derivatives business in the future. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another issue is - every major bank has their own model to determind the curves (discount and forward). They have to somewhat similar, but algorithms differ.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Last, but not least, we haven't even touched  on OIS. Whole different game.&lt;/p&gt;&#xA;" OwnerUserId="2685" LastActivityDate="2014-06-17T13:26:24.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12691" PostTypeId="1" AcceptedAnswerId="12709" CreationDate="2014-06-17T13:44:17.743" Score="0" ViewCount="2211" Body="&lt;p&gt;first post so if I write something silly don't hold it against me. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I calculated beta for almost all the stocks that compose the FTSE100. &#xA;All have beta &amp;lt; 1. This, as far as I understand it, means that they are all less volatile than the benchmark index. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, how can it be?&#xA;Shouldn't some of the stocks that compose the index be more volatile??&lt;/p&gt;&#xA;&#xA;&lt;p&gt;--EDIT--&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I downloaded 1 year long historical data for FTSE100 and for several stocks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I calculated the daily movements (% returns) with the formula:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(close_price_today - close_price_yesterday) /close_price_yesterday&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;for each day except the last naturally. &#xA;Did the same for both FTSE100 and all the stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then used slope function using FTSE100 using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;=SLOPE(array%ret_stock , array%ret_FTSE100)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the values are all above 0 and all below 1 (highest is approximately 0.6)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a sample of what I did:&#xA;&lt;a href=&quot;https://docs.zoho.com/file/egrja03b89e74f3ca4dac91e8a02b0d950156&quot; rel=&quot;nofollow&quot;&gt;https://docs.zoho.com/file/egrja03b89e74f3ca4dac91e8a02b0d950156&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9323" LastEditorUserId="9323" LastEditDate="2014-06-18T10:05:13.083" LastActivityDate="2014-06-25T09:54:12.647" Title="Beta of FTSE100 stocks against benchmark index FTSE100" Tags="&lt;volatility&gt;&lt;beta&gt;&lt;ftse&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12692" PostTypeId="2" ParentId="12687" CreationDate="2014-06-17T14:18:24.377" Score="3" Body="&lt;p&gt;I don't think they are implying that future interest rates are predictable. They may be speaking of implied forward rates as predictors of future rates or, generally, of the yield curve as an expectation of the future path of short-term interest rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $P(0,T_1)=1/(1+r_1)$ and $P(0,T_2)=1/(1+r_2)$ are the prices today of two &quot;risk-free&quot; zero coupon bonds maturing at $T_1 =1$  year and $T_2 =2$ years, respectively, then we know with certainty the interest we recieve if held to maturity.  What we don't know is if it will be better to buy the 2-year bond or buy the 1-year bond and roll into another 1-year bond at maturity.  The 1-year forward rate embedded in these prices is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f(0,T_1,T_2)= \frac{P(0,T_1)}{P(0,T_2)}-1.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is the future 1-year zero-coupon rate that makes an investor indifferent between the two strategies:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$1+r_2= [1+r_1][1+f(0,T_1,T_2)]$$  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are three principal yield-curve theories: Pure Expectation, Liquidity Preference and Market Segmentation.  These are used to explain (not necessarily predict) the shape of the yield curve.  At best the models are trying to find an unbiased expected future term-structure around which the random fluctuations will be centered.  As with all theories of finance there are limitations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With research reports from sell-side banks, the Federal Reserve, independent economists, etc. there is a plethora of interest rate forecasts by month, quarter, year etc.  All I can say is I know a study that examined the success of the forecasts from a major survey conducted annually in the financial press with a decades long history.  The study showed that the success rate of the forecasters just predicting the DIRECTION of the change in the UST 10-year rate was less than 50%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a short-term investing perspective, trying to predict interest rate changes is, more or less, a coin toss.  There are characteristics like mean reversion and short-lived anomalies in the shape of the term structure that are better to pursue. &lt;/p&gt;&#xA;" OwnerUserId="8153" LastActivityDate="2014-06-17T14:18:24.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12693" PostTypeId="2" ParentId="12687" CreationDate="2014-06-17T14:38:23.440" Score="16" Body="&lt;p&gt;There are two parts to your question and I'd like to answer them separately.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Curve Construction&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;On a daily basis, you can observe prices on a large variety of instruments, whose prices are driven by news and trading flows. Based on market prices of these instruments, there are a number of ways to create discount curves/forward curves. At a very high level (overly simplistic), what you need to do is 1) assume a functional form for the discount curve, 2) based on this discount curve, price a basket of bonds (or swaps) and compute the total pricing errors, and 3) optimize the parameters of your discount function so that the price errors are minimized.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For government markets, the most popular functional forms are cubic splines (particularly cubic b-splines), Vasicek-Fong exponential splines, and to a certain degree, the Nelson-Siegel or Svensson models. These are all extremely well documented models that you can find just by googling. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For swap markets, we also typically fit some form of a spline to the quoted LIBOR, futures, par swap rates, OIS rates and basis swaps. If you have access to Andersen and Piterbarg's &quot;Interest Rate Modeling&quot; (Volume I), there is an excellent chapter dedicated to &quot;modern&quot;  curve construction techniques.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Forward Rates vs Forecasts&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Simply put, forward rates are NOT good predictors of future interest rates. In fact, they are not even representative of market &quot;expectation&quot; of future interest rates. My favorite reading for this topic is Antii Ilmanen's &quot;Understanding the Yield Curve.&quot; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A quick summary: Broadly speaking, the yield curve is the sum of three parts –&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ \text{yield} = \text{expectations} + \text{bond risk premium} + \text{convexity bias} $$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) The &lt;span class=&quot;math-container&quot;&gt;$\text{expectations}$&lt;/span&gt; component is the market's &quot;true&quot; expectation for future interest rates, which may or may not be accurate forecasts of realized rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) &lt;span class=&quot;math-container&quot;&gt;$\text{Bond risk premium}$&lt;/span&gt;/Term premium – Since 10-year bonds/swaps have longer duration than 3-month cash, they have more interest rate risk. Therefore, investors may demand more compensation (i.e., higher interest rate) on an ex-ante basis to be willing to take on the extra interest rate risk. This is why even if market expectation is flat, the yield curve (at least front and intermediate parts) should be a bit upward sloping.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) &lt;span class=&quot;math-container&quot;&gt;$\text{Convexity bias}$&lt;/span&gt; – Both bonds and swaps are positively convex; longer maturity bonds/swaps are more convex. As a result, when rates move in either direction, they'll outperform linear or negatively convex instruments. Because of this &quot;convexity advantage,&quot; investors are willing to accept a lower yield for longer maturity bonds/swaps. This is why in the &quot;old days,&quot; the very long end of the yield curve tends to dip.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Performing such decomposition is actually not that easy and there are a few ways to do it. But a key observation is that forward rates frequently overestimate subsequently realized rates. This is known as the &quot;forward rate bias&quot; and is frequently quoted as evidence of positive bond risk premium. You can see this phenomenon quite clearly in the following chart, which plots the 5-year forward 1-year rate and actual realized 1-year rate 5-years later. I should emphasize that the pattern is not always true and in fact was quite untrue in the 1970s.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/hl9zE.png&quot; alt=&quot;5-Year Forward 1-Year Rate and Realized 1-Year Rate 5-Years Later&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="26595" LastEditDate="2019-04-02T03:59:22.937" LastActivityDate="2019-04-02T03:59:22.937" CommentCount="8" ContentLicense="CC BY-SA 4.0" />
  <row Id="12694" PostTypeId="1" AcceptedAnswerId="14535" CreationDate="2014-06-17T15:34:56.783" Score="5" ViewCount="197" Body="&lt;p&gt;I have had this question for a long time. For example, if I wire 50M USD from China&#xA;to the US, does the Chinese bank physically deliver 50M USD cash to the US bank? or is it just changing a number in the computer? If it's done digitally, then how does the US bank ensure that the Chinese bank isn't just creating USD out of thin air?&lt;/p&gt;&#xA;" OwnerUserId="9325" LastActivityDate="2014-08-29T16:31:50.500" Title="How does US banks ensure that other country's banks aren't counterfeiting USD?" Tags="&lt;currency&gt;&lt;banks&gt;&lt;banking-regulations&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12696" PostTypeId="1" CreationDate="2014-06-17T16:23:10.180" Score="2" ViewCount="377" Body="&lt;p&gt;Yesterday, I was at a lecture where the speaker said that the impact of derivatives was often to make senior debt, in effect, subordinated debt (in terms of priority, recovery rates, etc.)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do derivatives accomplish this result? Are they usually listed on the balance sheet? (I have thought that most of the time, they were off balance sheet contingent liabilities)? Does one need to &quot;recast&quot; the balance sheet to display their position/impact, even if they are technically off balance sheet? Or is it the case that they weaken the income statement, basically the interest and debt service coverage ratios to the degree that formerly &quot;safe&quot; senior debt is  no long so safe?&lt;/p&gt;&#xA;" OwnerUserId="2345" LastActivityDate="2020-02-09T07:03:31.370" Title="How do derivatives affect capital structures?" Tags="&lt;derivatives&gt;&lt;capital-structure&gt;" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12697" PostTypeId="1" AcceptedAnswerId="12698" CreationDate="2014-06-17T17:43:56.187" Score="2" ViewCount="542" Body="&lt;p&gt;What does this mean:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;Front-end vols have been trading lognormally while longer tails have traded normally.&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I read this in a research report, in the context of swaptions, which does not explain this further. My limited knowledge tell me it has something to do with correlation of vol with rates but I'm not sure. Could someone please help?&lt;/p&gt;&#xA;" OwnerUserId="7117" LastActivityDate="2014-06-17T17:57:46.213" Title="Swaptions vol trading lognormally" Tags="&lt;volatility&gt;&lt;swaption&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12698" PostTypeId="2" ParentId="12697" CreationDate="2014-06-17T17:57:46.213" Score="3" Body="&lt;p&gt;Typically, strategists run a regression of changes in implied vols against changes in rates. If rates are highly directional with implied vols (regression coefficient is positive and statistically significant), then it would imply a more lognormal relationship. If the two series are not correlated or very weakly correlated, then the relationship is considered more normal. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what this guy is saying is that the &quot;top-left&quot; corner of the vol surface has been more directional with rates (rates go higher, vols go higher), while longer tails (10y-30y tails) are less directional.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2014-06-17T17:57:46.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12699" PostTypeId="5" CreationDate="2014-06-17T18:03:52.607" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-06-17T18:03:52.607" LastActivityDate="2014-06-17T18:03:52.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12700" PostTypeId="4" CreationDate="2014-06-17T18:03:52.607" Score="0" Body="An interest rate is the rate at which interest is paid by a borrower (debtor) for the use of money that they borrow from a lender (creditor)." OwnerUserId="743" LastEditorUserId="743" LastEditDate="2014-06-17T21:06:12.863" LastActivityDate="2014-06-17T21:06:12.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12701" PostTypeId="5" CreationDate="2014-06-17T18:06:14.387" Score="0" Body="&lt;p&gt;The &lt;a href=&quot;http://en.wikipedia.org/wiki/Kalman_filter&quot; rel=&quot;nofollow&quot;&gt;Kalman filter&lt;/a&gt;, also known as linear quadratic estimation (LQE), is an algorithm that uses a series of measurements observed over time, containing noise (random variations) and other inaccuracies, and produces estimates of unknown variables that tend to be more precise than those based on a single measurement alone.&lt;/p&gt;&#xA;" OwnerUserId="743" LastEditorUserId="743" LastEditDate="2014-06-17T21:06:16.287" LastActivityDate="2014-06-17T21:06:16.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12702" PostTypeId="4" CreationDate="2014-06-17T18:06:14.387" Score="0" Body="The [Kalman filter][1], also known as linear quadratic estimation (LQE), is an algorithm that uses a series of measurements observed over time, containing noise (random variations) and other inaccuracies, and produces estimates of unknown variables that tend to be more precise than those based on a single measurement alone.&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;  [1]: http://en.wikipedia.org/wiki/Kalman_filter" OwnerUserId="743" LastEditorUserId="743" LastEditDate="2014-06-17T21:06:08.167" LastActivityDate="2014-06-17T21:06:08.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12703" PostTypeId="1" CreationDate="2014-06-17T18:17:57.800" Score="9" ViewCount="3231" Body="&lt;p&gt;I know that in order to use the risk-neutral valuation principle, that is, pricing options as their payoff function under a risk neutral measure, one has to have a complete market. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in the context of incomplete markets: What does the risk-neutral price represent if the option is not replicable? Am I right in assuming it would still be arbitrage-free prices, but without the possibility to eliminate the risk of the option by a hedging strategy? &lt;/p&gt;&#xA;" OwnerUserId="7555" LastActivityDate="2014-06-19T05:57:39.617" Title="Risk-neutral pricing in incomplete markets" Tags="&lt;option-pricing&gt;&lt;risk-neutral-measure&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12705" PostTypeId="2" ParentId="11486" CreationDate="2014-06-17T20:57:56.693" Score="2" Body="&lt;p&gt;RRL's answer is entirely correct in terms of the theoretical reason underpinning the relationship between equity IV and CDS spreads.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;CDS spreads are not “pure” default risk compensation&quot; - no they are not since the ISDA Quoted Spreads assume a homogeneous Poisson process (implying that instantaneous default risk is a constant over the life of a contract) as per &lt;a href=&quot;https://quant.stackexchange.com/questions/11457/documentation-of-the-isda-cds-standard-model/12615#12615&quot;&gt;Documentation of the ISDA CDS standard model&lt;/a&gt;. We know credit risk changes, so the likelihood and impact of these changes are subsumed into the ISDA homogeneous intensity (&amp;amp; therefore ISDA spread).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Real Hazard Rates (instantaneous conditional default probabilities) under the Q-measure contain similar risks to those &quot;lived-out&quot; under the P measure: a slow-ish change in credit quality (diffusion) and sudden events (jumps) implying the need for (at least) an affine stochastic model (a la Duffie) under the Q-measure which compensates the investor for the likelihood and impact of these credit risk changes (as well as the underestimation of even the current credit risk) by the &quot;credit risk premium&quot; as per papers:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.darrellduffie.com/uploads/working/duffieberndtdouglasfergusonschranz2005.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.darrellduffie.com/uploads/working/duffieberndtdouglasfergusonschranz2005.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.finance-innovation.org/risk08/files/6934648.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.finance-innovation.org/risk08/files/6934648.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, In terms of the &quot;purity&quot; of credit risk I'd suggest you have a look at &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Restructuring Clauses in CDS ISDA docs(e.g. Mod Mod) &lt;/li&gt;&#xA;&lt;li&gt;Liquidity Risk&lt;/li&gt;&#xA;&lt;li&gt;Counterparty Risk&lt;/li&gt;&#xA;&lt;li&gt;Interest Rate Risk [all of its Principal Components] (although small compared to credit risk it factors into the Upfront calculation)&lt;/li&gt;&#xA;&lt;li&gt;Recovery Risk (ISDA Spreads assume 40% for Senior) which is stochastic in its own right&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="9268" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2014-06-17T21:21:30.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12706" PostTypeId="2" ParentId="12614" CreationDate="2014-06-17T21:00:45.957" Score="0" Body="&lt;p&gt;Need to solve Riccati Equations with Complex Boundary Conditions for Char Function, no general closed form solution (apart from the &quot;Basic&quot; Affine model,  CIR etc) a la Duffie &lt;a href=&quot;http://www.mit.edu/~junpan/dps.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.mit.edu/~junpan/dps.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solution for CIR below&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;kappa = 2;&#xA;theta = .05;&#xA;sigma = .02;&#xA;lambda0 = .03;&#xA;T = 1;&#xA;&#xA;X = (0.03:0.001:0.07)';&#xA;&#xA;c = 2*kappa/(sigma^2*(1 - exp(-kappa*T))); % Scaling Factor&#xA;q = 2*theta*kappa/sigma^2 - 1; % Deg-of-Freedom&#xA;u = c*exp(-kappa*T)*lambda0;&#xA;v = c*X;&#xA;&#xA;pdf_1 = 2*c*ncx2pdf(2*v,2*q+2,2*u);&#xA;&#xA;fcnA = @(u)( -(2*kappa*theta/(sigma^2)) * log( 1 - ((sigma^2)/(2*kappa)) .* 1i.*u.*(1-exp(-kappa*T)) )  );&#xA;fcnB = @(u)( (1i.*u.*exp(-kappa*T)) ./ (1 - ((sigma^2)/(2*kappa)).*1i.*u.*(1-exp(-kappa*T)) ) );&#xA;fcnPhi = @(u)( exp( fcnA(u) + fcnB(u)*lambda0 ) );&#xA;&#xA;pdf_2 = NaN(size(X));&#xA;for i = 1:size(X,1)&#xA;    x = X(i);&#xA;    fcnPdfIntgrl = @(u)( real( exp(-1i.*u.*x) .* fcnPhi(u) ) );&#xA;    pdf_2(i,1) = (1/pi) * integral(fcnPdfIntgrl,0,Inf,'RelTol',1e-10,'AbsTol',1e-10);&#xA;end&#xA;&#xA;&#xA;subplot(6,1,1:2);&#xA;plot(X,pdf_1);&#xA;title('Probability Density Function by \chi^2');&#xA;subplot(6,1,3:4);&#xA;plot(X,pdf_2);&#xA;title('Probability Density Function by Fourier Inversion of CF');&#xA;&#xA;U = (0:10:4000);&#xA;subplot(6,1,5);&#xA;plot(U,real(fcnPhi(U)));&#xA;title('Characteristic Function');&#xA;subplot(6,1,6);&#xA;plot(U,fcnPdfIntgrl(U));&#xA;title('Fourier Inversion Integrand');&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9268" LastEditorUserId="9268" LastEditDate="2014-06-17T21:11:02.037" LastActivityDate="2014-06-17T21:11:02.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12707" PostTypeId="1" AcceptedAnswerId="12715" CreationDate="2014-06-18T05:25:46.857" Score="8" ViewCount="5452" Body="&lt;p&gt;I am trying to price a simple U.S. treasury in QuantLib, using two methods. The first method calls FixedRatebond.dirtyPrice(...), passing in a YTM and other parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second method involves building a FlatForward YieldTermStructure with the same YTM and parameters as method #1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The two methods give me slightly different dirty prices, and I expect them to be the same. Can anyone explain what I have done wrong, or,  explain why the dirty price should be different using the two methods?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is some sample code (full disclosure: this code was plagiarized from &lt;a href=&quot;http://quantcorner.wordpress.com/2011/01/31/us-treasury-notes-and-quantlib/&quot;&gt;here&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;try {&#xA;    // date set up&#xA;    Calendar calendar = TARGET();&#xA;&#xA;    Date settlementDate(28, January, 2011);&#xA;    // the settlement date must be a business day&#xA;    settlementDate = calendar.adjust(settlementDate);&#xA;&#xA;    // Evaluation date&#xA;    Integer fixingDays = 1;&#xA;    Natural settlementDays = 1;&#xA;    Date todaysDate = calendar.advance(settlementDate, -fixingDays, Days);&#xA;    Settings::instance().evaluationDate() = todaysDate;&#xA;&#xA;    // bond set up  &#xA;    Real faceAmount = 100.0;&#xA;    Real redemption = 100.0;&#xA;    Date issueDate(27, January, 2011);&#xA;    Date maturity(31, August, 2020);&#xA;    Real couponRate = 0.03625;&#xA;    Real yield = 0.034921;&#xA;&#xA;    RelinkableHandle&amp;lt;YieldTermStructure&amp;gt; discountingTermStructure;&#xA;    boost::shared_ptr&amp;lt;YieldTermStructure&amp;gt; flatTermStructure(&#xA;    new FlatForward(&#xA;        settlementDate,&#xA;        yield,&#xA;        ActualActual(ActualActual::Bond),&#xA;        Compounding::Compounded,&#xA;        Semiannual));&#xA;    discountingTermStructure.linkTo(flatTermStructure);&#xA;&#xA;    // Pricing engine&#xA;    boost::shared_ptr&amp;lt;PricingEngine&amp;gt; bondEngine(&#xA;        new DiscountingBondEngine(discountingTermStructure));&#xA;&#xA;     // Rate&#xA;    Schedule fixedBondSchedule(&#xA;        issueDate,&#xA;        maturity,&#xA;        Period(Semiannual),&#xA;        UnitedStates(UnitedStates::GovernmentBond),&#xA;        BusinessDayConvention::Unadjusted,&#xA;        BusinessDayConvention::Unadjusted,&#xA;        DateGeneration::Rule::Backward,&#xA;        false);&#xA;&#xA;    FixedRateBond fixedRateBond(&#xA;        settlementDays,&#xA;        faceAmount,&#xA;        fixedBondSchedule,&#xA;        std::vector&amp;lt;Rate&amp;gt;(1, couponRate),&#xA;        ActualActual(ActualActual::Bond),&#xA;        BusinessDayConvention::Unadjusted,&#xA;        redemption,&#xA;        issueDate);&#xA;&#xA;    //Calculate pricing without term structure&#xA;    Real cp = fixedRateBond.cleanPrice(yield, fixedRateBond.dayCounter(), Compounding::Compounded, Semiannual);&#xA;    Real dp = fixedRateBond.dirtyPrice(yield, fixedRateBond.dayCounter(), Compounding::Compounded, Semiannual);&#xA;    Rate ytm = fixedRateBond.yield(cp, fixedRateBond.dayCounter(), Compounding::Compounded, Semiannual);&#xA;    Real accrued = fixedRateBond.accruedAmount();&#xA;&#xA;    fixedRateBond.setPricingEngine(bondEngine);&#xA;&#xA;&#xA;    // write column headings&#xA;    Size widths[] = { 18, 15, 15};&#xA;&#xA;    std::cout &amp;lt;&amp;lt; std::setw(widths[0]) &amp;lt;&amp;lt;  &quot;                 &quot;&#xA;        &amp;lt;&amp;lt; std::setw(widths[1]) &amp;lt;&amp;lt; &quot;Without TS&quot;&#xA;        &amp;lt;&amp;lt; std::setw(widths[2]) &amp;lt;&amp;lt; &quot;With TS&quot;&#xA;        &amp;lt;&amp;lt; std::endl;&#xA;&#xA;    Size width = widths[0]&#xA;                    + widths[1]&#xA;                            + widths[2];&#xA;    std::string rule(width, '-'), dblrule(width, '=');&#xA;&#xA;    std::cout &amp;lt;&amp;lt; rule &amp;lt;&amp;lt; std::endl;&#xA;&#xA;    std::cout &amp;lt;&amp;lt; std::setw(widths[0]) &amp;lt;&amp;lt; &quot;Clean Price&quot;&#xA;        &amp;lt;&amp;lt; std::setw(widths[1]) &amp;lt;&amp;lt; std::setprecision (8) &amp;lt;&amp;lt; cp&#xA;        &amp;lt;&amp;lt; std::setw(widths[2]) &amp;lt;&amp;lt; std::setprecision (8) &amp;lt;&amp;lt; fixedRateBond.cleanPrice()&#xA;        &amp;lt;&amp;lt; std::endl;&#xA;&#xA;    std::cout &amp;lt;&amp;lt; std::setw(widths[0]) &amp;lt;&amp;lt; &quot;Dirty Price&quot;&#xA;        &amp;lt;&amp;lt; std::setw(widths[1]) &amp;lt;&amp;lt; std::setprecision (8) &amp;lt;&amp;lt; dp&#xA;        &amp;lt;&amp;lt; std::setw(widths[2]) &amp;lt;&amp;lt; std::setprecision (8) &amp;lt;&amp;lt; fixedRateBond.dirtyPrice()&#xA;        &amp;lt;&amp;lt; std::endl;&#xA;&#xA;    std::cout &amp;lt;&amp;lt; std::setw(widths[0]) &amp;lt;&amp;lt; &quot;Accrued&quot;&#xA;        &amp;lt;&amp;lt; std::setw(widths[1]) &amp;lt;&amp;lt; std::setprecision (8) &amp;lt;&amp;lt; accrued&#xA;        &amp;lt;&amp;lt; std::setw(widths[2]) &amp;lt;&amp;lt; std::setprecision (8) &amp;lt;&amp;lt; fixedRateBond.accruedAmount()&#xA;        &amp;lt;&amp;lt; std::endl;&#xA;&#xA;    return 0;&#xA;&#xA;} catch (std::exception&amp;amp; e) {&#xA;    std::cerr &amp;lt;&amp;lt; e.what() &amp;lt;&amp;lt; std::endl;&#xA;    return 1;&#xA;} catch (...) {&#xA;    std::cerr &amp;lt;&amp;lt; &quot;unknown error&quot; &amp;lt;&amp;lt; std::endl;&#xA;    return 1;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;}&lt;/p&gt;&#xA;" OwnerUserId="9329" LastActivityDate="2019-09-19T08:38:05.317" Title="Pricing a FixedRateBond in Quantlib: yield vs TermStructure" Tags="&lt;fixed-income&gt;&lt;quantlib&gt;&lt;bond&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12708" PostTypeId="2" ParentId="12703" CreationDate="2014-06-18T08:26:01.073" Score="11" Body="&lt;p&gt;&lt;strong&gt;Q: What does the risk-neutral price represent if the option is not replicable?&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://users.iems.northwestern.edu/~staum/IncompleteMarkets.pdf&quot; rel=&quot;noreferrer&quot;&gt;In an incomplete market, there is no unique martingale measure but instead a set $Q$ of equivalent martingale measures&lt;/a&gt;. Consequently, there is an interval of arbitrage-free prices:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \Big( inf_{\mathbf{Q} \in Q} E_{\mathbf{Q}}[DX], sup_{\mathbf{Q} \in Q} E_{\mathbf{Q}}[DX] \Big)$, where $E_{\mathbf{Q}}[DX]$ is the expected discounted payoff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This interval may be too broad to serve us in our pricing or market making.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q: Am I right in assuming it would still be arbitrage-free prices?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here I will follow &quot;Arbitrage Theory in Continous Time&quot; by T. Björk. Björk focuses on an incomplete market where there are more random sources than there are traded assets. It may be otherwise the case that market frictions and liquidity issues forbid the replication of payoffs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quoting Björk (page 209): &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In particular, if we take the price of one particular &quot;benchmark&quot;&#xA;  derivative as a priori given, then the prices of all other derivatives&#xA;  will be uniquely determined by the price of the benchmark&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If we have two claims $Y$ and $Z$ whose dynamcs follow :&#xA;$$\Pi(t;Y) = F(t, X(t)) $$ &#xA;$$\Pi(t,Z) = G(t, X(t)$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can still put together a portfolio based on $F$ and $G$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dF = \alpha_F F dt + \sigma_F F dW$$&#xA;$$dG = \alpha_G G dt + \sigma_G G dW$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\alpha_F = \frac{F_t + \mu F_x + \frac{1}{2} \sigma^2F_{xx}}{F}$$&#xA;$$ \sigma_F = \frac{\sigma F_x}{F} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and correspondingly for $\alpha_G$ and $\sigma_G$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The dynamics of the self-financing portfolio then follow:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dV = V \big( u_F \alpha_F + u_G \alpha_G \big) dt + V \big( u_F \sigma_F + u_G \sigma_G \big) dW$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can make the portfolio locally riskless imposing:&#xA;$$u_F + u_G = 1$$ &#xA;$$u_F \sigma_F + u_G \sigma_G = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above leads to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dV = V \frac{\alpha_G \sigma_F - \alpha_F \sigma_G}{\sigma_F - \sigma_G} dt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\alpha_G \sigma_F - \alpha_F \sigma_G}{\sigma_F - \sigma_G} = r$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\alpha_F -r}{\sigma_F} = \frac{\alpha_G -r}{\sigma_G} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means that all the derivatives products share the same market price of risk. Therefore, it may not be possible to replicate the payoff but it may be possible to extract information (the market price of risk) from the derivatives market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What if no &quot;benchmark&quot; derivative is available? There are different strategies whose main goal is to bound the interval of allowed arbitrage free prices so that it would be possible to define a bid-ask spread. For example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Indifference prices: the idea is to identify a payoff that, under a preference function, would be indifferent for the investor&lt;/li&gt;&#xA;&lt;li&gt;Minimize the hedging risk with a portfolio under a specific utility function&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;See for example &lt;a href=&quot;http://users.iems.northwestern.edu/~staum/IncompleteMarkets.pdf&quot; rel=&quot;noreferrer&quot;&gt;this&lt;/a&gt; and &lt;a href=&quot;http://hal.archives-ouvertes.fr/docs/00/16/71/52/PDF/25-IntroJME9.pdf&quot; rel=&quot;noreferrer&quot;&gt;this&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6781" LastEditorUserId="6901" LastEditDate="2014-06-19T05:57:39.617" LastActivityDate="2014-06-19T05:57:39.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12709" PostTypeId="2" ParentId="12691" CreationDate="2014-06-18T10:52:58.537" Score="2" Body="&lt;p&gt;Beta is calculated as Rstock = alpha + beta*Rindex. When you use slope in excel the first value is for the y's so you are doing it wrong, you should have slope(Stock returns, Index returns). While that is the formula you use above it is not the one in the excel, with the data you provide I get a beta of 0.96.&lt;/p&gt;&#xA;" OwnerUserId="8226" LastActivityDate="2014-06-18T10:52:58.537" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12710" PostTypeId="1" CreationDate="2014-06-18T11:41:06.947" Score="8" ViewCount="276" Body="&lt;p&gt;Hedging American Swaption&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hello, I priced an American swaption using Black model with swap rates diffusion to find the european (call) price at t.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ C_t = (\delta \sum_{j=n+1}^{M+1} Z_t^{T_j})[R(t,T_n,T_m)  - \hat{R}]^{+} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dR(t,T_n,T_M) =  \sigma R(t,T_n,T_M) dW_t $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I found the early exercice boundary via MC Simulation, with this method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.maths.ed.ac.uk/~s0237075/projectm3s/projectm3s.pdf&quot;&gt;PRICING AMERICAN OPTIONS USING MONTE CARLO SIMULATION&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The choice of this method rely on the need to have an explicit criterion for the optimal exercise, and because I had to add a depreciaton factor on the the principal amount (contract linked to a loan). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you may know, it is not very interesting to compute greeks with finite difference of a Mc Price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I want to hedge this american swaption, so I am trying to calculate the $\Delta$ of the contract.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that Malliavin calculus can give good results in this domain, but I can't find any paper for the implementation of the method for an american swaption.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found this paper for american option, but I am not sure to be able to adapt it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://eprints.maths.ox.ac.uk/1381/1/J_Newbury.pdf&quot;&gt;Applications of Malliavin calculus to the pricing&#xA;and hedging of Bermudan options&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you think this approach could be generalised to American Swaption ? &#xA;What would be your approach to hedging an American Swaption ? &lt;/p&gt;&#xA;" OwnerUserId="5052" LastActivityDate="2014-07-08T22:41:32.143" Title="American Swaption Heding with Malliavin Calculus" Tags="&lt;hedging&gt;&lt;american-options&gt;&lt;swaption&gt;&lt;malliavin-calculus&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12715" PostTypeId="2" ParentId="12707" CreationDate="2014-06-18T14:24:37.247" Score="12" Body="&lt;p&gt;Day-count conventions. You can't live with them, you can't live without them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason the prices differ is that the pricing engine can't calculate correctly the time over which the first coupon is discounted, and thus it gets slightly different discount factors to apply to the coupon amounts. Please sit down, it'll take some explaining.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ultimately, both methods calculate the dirty price by adding the coupon amounts, each discounted according to its payment date. Where they differ is in the calculation of the discount factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The method that takes a yield and the corresponding conventions calculates discounts, as can be expected, by compounding the yield. The discount &lt;span class=&quot;math-container&quot;&gt;$D_1$&lt;/span&gt; for the first coupon is obtained by accruing the yield over the remaining life of the coupon; the discount &lt;span class=&quot;math-container&quot;&gt;$D_2$&lt;/span&gt; for the second coupon, by accruing it over its life and compounding it with the previous result; and so on until the last coupon. The problem is that, in order to calculate the accrual time correctly according to the passed act/act(b) day count convention, you also need a reference period which is given by the frequency of the coupons and in this case is 6 months. So, for instance, the accrual time for the first coupon (from Jan 28, 2011 to Feb 28, 2011) must be calculated as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dayCounter.yearFraction(Date(28,January,2011), Date(28,February,2011),&#xA;                        Date(28,August,2010),  Date(28,February,2011));&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which returns &lt;code&gt;0.08423913043478261&lt;/code&gt; (the third and fourth dates are the start and end date of the 6-months reference period). If the coupons were annual, the result would be slightly different: the reference start date above would be Feb.28 2010, returning &lt;code&gt;0.08493150684931507&lt;/code&gt;. The overload of the &lt;code&gt;dirtyPrice&lt;/code&gt; method that takes a yield uses coupon information to select the correct reference period and calculates the first discount factor according to the first value above. The result is &lt;code&gt;0.997087920498809&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, the method that relies on the pricing engine uses the yield term structure &lt;code&gt;t&lt;/code&gt; and just asks for &lt;code&gt;t.discount(coupon.date())&lt;/code&gt; for each of the coupons: the interface of the &lt;code&gt;discount&lt;/code&gt; method doesn't allow to pass any extra info about the reference period. Internally, the best that the term structure can do is to calculate&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dayCounter.yearFraction(Date(28,January,2011), Date(28,February,2011));&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which, by default, takes as start and end of the reference period the same two dates that are passed, making the above equivalent to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dayCounter.yearFraction(Date(28,January,2011), Date(28,February,2011),&#xA;                        Date(28,January,2011), Date(28,February,2011));&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;this returns &lt;code&gt;0.08333333333333333&lt;/code&gt;, and the corresponding discount factor for the first coupon is &lt;code&gt;0.9971191880350325&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This difference accounts for the change in prices (the other coupons have no effect: they're all regular 6-months coupon, and for them the reference period equals the life of the coupon, making T equal to &lt;code&gt;0.5&lt;/code&gt; in both cases). The price returned by &lt;code&gt;dirtyPrice()&lt;/code&gt; is &lt;code&gt;101.08980828425344&lt;/code&gt;; the one returned by &lt;code&gt;dirtyPrice(yield, ...)&lt;/code&gt; is &lt;code&gt;101.08663832294855&lt;/code&gt;; and if we correct for the different discount factors above, we get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;101.08980828425344 * 0.997087920498809 / 0.9971191880350325 = 101.08663832294862&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;that reconciles the prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a final note: this only happens with those day-count conventions that require a reference period. If you try your code with one that doesn't (say, act/360) the two methods will give you the same price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update (September 2019):&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is now possible to create an instance of the &lt;code&gt;ActualActual&lt;/code&gt; day counter that uses the correct reference periods for the calculation.  Instantiate it as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;DayCounter dayCounter = ActualActual(ActualActual::Bond, fixedBondSchedule);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and use it for both the discount curve and the bond.  When asked for year fractions, it will retrieve the correct reference period(s) from the schedule and use them.  This will give the correct results.&lt;/p&gt;&#xA;" OwnerUserId="308" LastEditorUserId="308" LastEditDate="2019-09-19T08:38:05.317" LastActivityDate="2019-09-19T08:38:05.317" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="12716" PostTypeId="2" ParentId="9677" CreationDate="2014-06-18T15:57:20.733" Score="3" Body="&lt;p&gt;Your reference says &quot;This method derives implied CDS spreads &#xA;for unobservable issuers through the interpolation or extrapolation of observable CDS. It is a factor model that constructs CDS spread surface as a function of credit rating and maturity.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this is for issuers which do not have any CDS contracts priced (there are no CDS spreads to bootstrap). I've never heard of it and I'm pretty sure that this is just their own phrase for a simple linear regression model where the betas are {1} or {0}, {1} indicating membership of a factor group {AAA,AA,BBB} {3yr,5yr,7yr}. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For my own part, if you wish to do this I would suggest using also Country, Sector, and Leverage Factors.&lt;/p&gt;&#xA;" OwnerUserId="9268" LastActivityDate="2014-06-18T15:57:20.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12718" PostTypeId="1" AcceptedAnswerId="12719" CreationDate="2014-06-19T02:32:05.100" Score="2" ViewCount="14862" Body="&lt;p&gt;When reading the book of &lt;code&gt;Financial Risk Forecasting&lt;/code&gt;, I saw the following example. I am not very clear about two points marked with yellow and green respectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the first point marked with yellow color, why $VaR^{1\%}=100$, I think it should equal to $-100$ instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the second point marked with green color, I do not understand how to get $50$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/RhfFA.jpg&quot; alt=&quot;enter image description here&quot;&gt; &lt;/p&gt;&#xA;" OwnerUserId="8251" LastEditorUserId="8228" LastEditDate="2014-06-23T19:11:16.930" LastActivityDate="2015-12-01T09:12:00.903" Title="Why is Value at Risk non-negative?" Tags="&lt;value-at-risk&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12719" PostTypeId="2" ParentId="12718" CreationDate="2014-06-19T04:13:19.353" Score="3" Body="&lt;p&gt;Value at risk is quoted by absolute value. This is the amount of money you can lose, so everyone knows the sign by default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the second question, the last line explains it. Probability of at least one of the assets losing money is ~9.6%. Probability of both losing money is pretty small and is ignored. So, since 9.6% &gt; 5%, it means that you lose on one of the assets, which is 50% of your portfolio with higher than 5% probability (so, it's your value at risk). This is where 50 comes from.&lt;/p&gt;&#xA;" OwnerUserId="5086" LastActivityDate="2014-06-19T04:13:19.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12720" PostTypeId="2" ParentId="12718" CreationDate="2014-06-19T07:20:41.070" Score="0" Body="&lt;p&gt;I think that in theory the VaR can be negative. The VaR is only a given quantile of your loss distribution depending on the confidence level you set and the time horizon you wanna consider (how many loses can I afford next year/quarter/month/week/day etc). Imagine that the loss distribution you are looking at contains only negative values (gains in that case) then whatever the confidence level, your VaR will be negative. In practice, the VaR tends to be always positive because we use high confidence levels such as 95% or 99% and we observe random variables taking their values in R (set of all real values)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your last example just illustrates one of the VaR shortcomings : it is not subaddative, meaning that the sum of the VaR of two portfolios can be lower than the VaR of the combined two which is not consistent with the theory of diversification. &lt;/p&gt;&#xA;" OwnerUserId="9313" LastActivityDate="2014-06-19T07:20:41.070" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12721" PostTypeId="1" AcceptedAnswerId="12722" CreationDate="2014-06-19T11:41:48.673" Score="-1" ViewCount="111" Body="&lt;p&gt;I would like to figure out how to calculate &lt;code&gt;av.variance&lt;/code&gt; and &lt;code&gt;av.cov&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know how to calculate portfolio variance( for large portfolio), &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;var(p)=1/n avarage variance+(1-1/n)avarage covariance,&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If we have a pair of correlation of five asset and standard deviation of each five asset, how are we going to calculate &lt;code&gt;avarage covariance&lt;/code&gt; and &lt;code&gt;avarage variance&lt;/code&gt; so that we can put the data in above formula?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It confuse me because some questions &lt;code&gt;avarage covariance&lt;/code&gt; and &lt;code&gt;avarage variance&lt;/code&gt; are given.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks,i  got you&lt;/p&gt;&#xA;" OwnerUserId="9293" LastEditorUserId="743" LastEditDate="2014-06-20T20:37:39.303" LastActivityDate="2014-06-20T20:37:39.303" Title="how to calculate avarage variance and avarage covariance" Tags="&lt;portfolio-management&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12722" PostTypeId="2" ParentId="12721" CreationDate="2014-06-19T14:07:12.363" Score="0" Body="&lt;p&gt;$w$ is a vector of portfolio weights.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Portfolio variance $Var(r_p)$ is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Var(r_p) = w^T V w$$ where $V$ is your asset variance-covariance matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me know if this helps: in theory $w = 1/n$ where $n$ is the number of assets should lead to some sort of &quot;average&quot; covariance even if I think &quot;averages&quot; do not really apply to this context.&lt;/p&gt;&#xA;" OwnerUserId="6781" LastActivityDate="2014-06-19T14:07:12.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12723" PostTypeId="1" CreationDate="2014-06-19T16:57:22.347" Score="1" ViewCount="343" Body="&lt;p&gt;In the past I have calibrated simple short rate models to the term structure by using maximum likelihood to get the parameters of the Vasicek/CIR sde, and then use the ZCB formula and the current yield curve to calibrate the market price of risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am interested in doing the same for the Black-Karansinksi model. However, to my limited knowledge, it has no closed form ZCB prices. I imagine this means that the market price of risk needs to be otpimized numerically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My very poor attempt at a recipe is -:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Project a bunch of realizations of the sde using a grid of values&#xA;for the market price of risk. &lt;/li&gt;&#xA;&lt;li&gt;Discount back using the realized short rate for all the time points&#xA;for which we have bond prices and take an average to give the&#xA;estimated expectation. &lt;/li&gt;&#xA;&lt;li&gt;Implement some sort of grid    search for the best parameter    that&#xA;minimizes norm between the    estimated and the actual values?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;How should this be done properly?&lt;/p&gt;&#xA;" OwnerUserId="5863" LastEditorUserId="8228" LastEditDate="2014-06-23T19:11:23.893" LastActivityDate="2014-07-25T08:03:43.797" Title="Black–Karasinski - Market Price of Risk" Tags="&lt;optimization&gt;&lt;short-rate&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12724" PostTypeId="2" ParentId="7174" CreationDate="2014-06-19T17:03:45.267" Score="1" Body="&lt;p&gt;An EV&amp;lt;0 is an &quot;ideal&quot; situation (for a value investor). When you find such a rare bird, give it the maximum portfolio weight allowed by your investment policy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Given your statement, &quot;the smaller the better,&quot; I'm assuming that your portfolio weights are some &quot;reciprocoal&quot; of your calculated ratio.)&lt;/p&gt;&#xA;" OwnerUserId="2345" LastActivityDate="2014-06-19T17:03:45.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12725" PostTypeId="1" AcceptedAnswerId="12732" CreationDate="2014-06-19T17:19:12.753" Score="1" ViewCount="3668" Body="&lt;p&gt;Suppose that I enter an Equity Swap, such that I pay a floating rate and I receive the equity return. The payment is every one year for both the rate and the return, and the swap expires in one year. I have been told that shorting the stock should fully hedge the swap. However, I worked out the cash flows as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    Time       |       0       |        1        |        2        |&#xA;&#xA;Pay rate       |       0       |   -S_0 * r_0    |   -S_1 * r_1    |&#xA;Receive Equity |       0       |   S_1 - S_0     |   S_2 - S_1     |&#xA;Short Stock    |      S_0      |        0        |      -S_2       |&#xA;Reinvest       |     -S_0      |        0        |   S_0*(1+r_f)^2 |&#xA;&#xA;    Total      |       0       |     not zero    |    not zero     |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;r_f is the annual risk free rate, r_0 and r_1 are the annual floating rates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I missing something here? Is shorting one stock enough or do we have to short another stock at time 1? How should the cash flows be?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="5007" LastActivityDate="2014-06-20T12:15:40.117" Title="Hedging a Long Equity Swap by Shorting the Stock" Tags="&lt;hedging&gt;&lt;swaps&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12726" PostTypeId="2" ParentId="3284" CreationDate="2014-06-20T01:29:49.823" Score="5" Body="&lt;p&gt;I tried them and was very disappointed .No support,no phone number,no answer to several emails.I would strongly suggest using someone else.&lt;/p&gt;&#xA;" OwnerUserId="9345" LastActivityDate="2014-06-20T01:29:49.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12727" PostTypeId="1" CreationDate="2014-06-20T03:38:29.017" Score="2" ViewCount="677" Body="&lt;p&gt;Just trying to check my logic here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $Z(t,T)$ be a Zero-Coupon Bond with maturity $T$ bought at time $t$, $S_m$ be the spot interest rate for time $m$ and $S_n$ for time $n$ respectively, where $n &amp;gt;m$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was trying to prove to myself that holding a portfolio of long $Z(t,n)$  and short $\frac{(1+S_m)^m}{(1+S_n)^n}$ units of $Z(t,m)$ &quot;locks&quot; or implies that the interest rate between time $m$ and $n$ is the forward interest rate $f(m,n)$ where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$[1+f(m,n)]^{n-m} = \frac{(1+S_n)^n}{(1+S_m)^m}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far, I've shown that at time $m$, the value of the portfolio is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{Z(t,n) - 1}{[1+f(m,n)]^{n-m}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And at time $n$, the value of the portfolio must be zero; otherwise there would exist an arbitrage portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I'm having trouble making the last argument (or so I think). So far, I've framed it in the following way, which I feel is rather lackluster.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Since there cannot exist an arbitrage portfolio, thus the fair forward rate at which we re-invest our $Z(t,m)$ at time $m$ MUST be the forward rate $f(m,n)$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I suppose my real question is - what is the proper way to do a no-arbitrage/replication proof? And what is the real-world context in terms of this proof? How would this be applied: say at time $m$, our $m$-maturity ZCB matures, and we are obligated to pay the shorted ZCB out. I'm having trouble thinking of/visualizing no-arbitrage.&lt;/p&gt;&#xA;" OwnerUserId="9346" LastEditorUserId="467" LastEditDate="2014-06-20T05:00:25.877" LastActivityDate="2014-06-20T05:00:25.877" Title="Simple Forward Interest Rate Proof" Tags="&lt;replication&gt;&lt;no-arbitrage-theory&gt;&lt;forward-rate&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12728" PostTypeId="1" CreationDate="2014-06-20T09:28:47.630" Score="2" ViewCount="322" Body="&lt;p&gt;im trying to predict crash time by using lppl model(JLS). My codes can run, but the error is to high....I try with some other initial values, but still can't reduce the error.....How i can reduce Standard Residual Error???or i need to change my data window????&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; library(tseries)&#xA; library(zoo)&#xA; ts &amp;lt;- get.hist.quote(instrument=&quot;^KLSE&quot;, start=&quot;1992-01-01&quot;, end=&quot;1997-01-01&quot;,&#xA;                      quote=&quot;Close&quot;, provider=&quot;yahoo&quot;, origin=&quot;1970-01-01&quot;, &#xA;                      compression=&quot;d&quot;, retclass=&quot;zoo&quot;)&#xA; df &amp;lt;- data.frame(ts)&#xA; df &amp;lt;- data.frame(Date=as.Date(rownames(df)),Y=df$Close)&#xA;     df &amp;lt;- df[!is.na(df$Y),]&#xA; library(minpack.lm)&#xA; df$days &amp;lt;- as.numeric(df$Date-df[1,]$Date)\&#xA;f &amp;lt;- function(pars, xx){pars$a+pars$b*(pars$tc-xx)^pars$m*   (1+pars$c*cos(pars$omega*log(pars$tc-xx)+pars$phi))}&#xA; resids &amp;lt;- function(p,observed,xx){df$Y-f(p,xx)}&#xA; nls.out&amp;lt;-nls.lm(par=list(a=300, b=-400, tc=1308, m=0.5, omega=19.5, phi=-30, c=-14), fn=resids, observed=df$Y, xx=df$days, control=nls.lm.control(maxiter=1024, ftol=1e-6, maxfev=1e6))&#xA; par &amp;lt;- nls.out$par&#xA; nls.final&amp;lt;-nls(Y~a+(tc-days)^m*(b+c*cos(omega*log(tc-days)+phi)), data=df, start=par, algorithm=&quot;plinear&quot;, control=nls.control(maxiter=1024, minFactor=1e-8))&#xA; summary(nls.final)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Formula: &lt;code&gt;Y ~ a + (tc - days)^m * (b + c * cos(omega * log(tc - days) + phi))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  Parameters:&#xA;         Estimate Std. Error t value Pr(&amp;gt;|t|)&#xA;   a      1.138e+04  1.929e+08   0.000    1.000&#xA;   b     -1.071e+04  1.816e+08   0.000    1.000&#xA;  tc      1.331e+03  9.911e+02   1.343    0.180&#xA;   m      3.032e-03  1.888e+00   0.002    0.999&#xA;   omega  2.399e+01  1.985e+03   0.012    0.990&#xA;   phi   -5.955e+01  1.298e+04  -0.005    0.996&#xA;   c      1.715e-03  2.915e+01   0.000    1.000&#xA;   .lin   2.351e+00  3.982e+04   0.000    1.000&#xA;&#xA;    Residual standard error: 75.75 on 752 degrees of freedom&#xA;&#xA;Number of iterations to convergence: 55    &#xA;Achieved convergence tolerance: 3.632e-06 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9341" LastEditorUserId="7202" LastEditDate="2014-07-03T07:50:41.753" LastActivityDate="2014-07-03T07:50:41.753" Title="Johansen-Ledoit-Sornette Model" Tags="&lt;index&gt;&lt;curve-fitting&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12729" PostTypeId="1" AcceptedAnswerId="12754" CreationDate="2014-06-20T09:48:41.630" Score="6" ViewCount="2131" Body="&lt;p&gt;Do quants need to know Accounting?&lt;/p&gt;&#xA;&lt;p&gt;In my school's undergrad Quant program, we had Financial Accounting and Managerial Accounting, which were listed as prerequisites for our undergrad Finance subjects.&lt;/p&gt;&#xA;&lt;p&gt;I am taking grad Quant now in the same school, and I have not seen Accounting ever turn up again except in Financial Statements. In fact, our first grad Finance course, Derivatives Pricing 1 (Chapters 1-11 of Hull's Options, Futures and Other Derivatives), has been added to the new curriculum of the undergrad Quant program, and I know someone who took it at the same time as Financial Accounting. This person did not even yet take Managerial Accounting.&lt;/p&gt;&#xA;&lt;p&gt;Even though Derivatives Pricing 1 can apparently be taken without Financial Accounting, I guess it's possible that Accounting may show up in future courses or in the real world.&lt;/p&gt;&#xA;&lt;p&gt;If so, in what scenarios for example?&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;From comments:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;It is completely useless for research/software (i.e., the technical side) in a short-term quantitative trading firm/fund. In fact it is detrimental because of the opportunity cost associated with not learning computer science/math/stats while you were spending time learning accounting. – user2763361 Jun 21 '14 at 8:36&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;@user2763361 Please post that as an answer so that I can downvote it. – user508 Jun 21 '14 at 16:10&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;@user508 Could you explain here in comments? That would be more useful to the community than a downvote. My point was specifically regarding research/software in short-term quantitative trading (e.g holding period 30 seconds). I don't see how this could be controversial. The opportunity cost of not learning more about hardware or machine learning is quite huge when the field is so competitive to get entry into. My firm gets over 100 PhD level applicants for each position. You can bet that we do not care in the slightest what they know about accounting. – user2763361 Jun 21 '14 at 22:20&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;... and for good reason. They could have instead learned more about GPU programming, or digital signal processing... Opportunity costs actually exist because the candidates had finite time to study. – user2763361 Jun 21 '14 at 22:32&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="7788" LastEditDate="2020-08-11T11:01:58.337" LastActivityDate="2020-08-11T11:01:58.337" Title="Do quants need to know Accounting?" Tags="&lt;data&gt;&lt;finance&gt;&lt;quant-trading-strategies&gt;&lt;accounting&gt;&lt;financial&gt;" AnswerCount="7" CommentCount="11" FavoriteCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="12730" PostTypeId="2" ParentId="12729" CreationDate="2014-06-20T10:05:25.950" Score="1" Body="&lt;p&gt;A quant may find accounting useful occasionally but it is really tangential knowledge. I would not consider typical financial or managerial accounting as pre requisites for a Quant Fin program.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, certain quants in fixed income or credit do end up dealing with intricacy of cash flows. Accounting background will help in those scenarios.&lt;/p&gt;&#xA;" OwnerUserId="3237" LastActivityDate="2014-06-20T10:05:25.950" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12731" PostTypeId="1" AcceptedAnswerId="12743" CreationDate="2014-06-20T11:41:42.667" Score="1" ViewCount="329" Body="&lt;p&gt;In Tomas Bjork's &lt;a href=&quot;http://f3.tiera.ru/2/F_Finance/FD_Derivatives/Bjoerk%20T.%20Arbitrage%20theory%20in%20continuous%20time%20%28OUP,%201998%29%28ISBN%200198775180%29%28T%29%28S%29%28324s%29_FD_.pdf&quot; rel=&quot;nofollow&quot;&gt;Arbitrage Theory in Continuous Time&lt;/a&gt; (or &lt;a href=&quot;http://ideabuds.com/wp-content/uploads/2012/09/Tomas-Bjoerk-Arbitrage-Theory-in-Continuous-Time.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;), $\exists$ this proposition&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Proposition 2.9 Suppose that a claim X is reachable with replicating portfolio h. Then any price at t=0 of the claim X, other than $V_0^{h}$ will lead to an arbitrage possibility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My prof uses $V_0({\phi})$ instead of $V_0^{h}$, but $\phi$ still refers to the portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\Pi(t;x)$ be the price of the contingent claim at time t. Then, $\Pi(0;x)$ must = $V_0({\phi})$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the proof written on the board:&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Suppose $\Pi(0;x)$ &gt; $V_0({\phi})$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The arbitrage strategy is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sell (or short sell) the claim for $\Pi(0;x)$, and obtain the portfolio $\phi$ worth $V_0({\phi})$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Left over amount is $\Pi(0;x)$ - $V_0({\phi})$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At t = 1, the payoff for the claim X w/c you will be liable for will be covered the value of the portfolio $V_1({\phi})$ at t=1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose $\Pi(0;x)$ &amp;lt; $V_0({\phi})$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The arbitrage strategy is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sell (or short sell) the portfolio worth $V_0({\phi})$. Use that amount to buy claim worth $\Pi(0;x)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Left over amount is $V_0({\phi}) - \Pi(0;x)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At t = 1, you will get payoff X, w/c is equal to $V_1({\phi})$.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Soooo I tried constructing the arbitrage strategy for the first part to see the exact profit, but I seem to be missing a step.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Suppose $\Pi(0;x)$ &gt; $V_0({\phi})$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;At t = 0&lt;/strong&gt;,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;transaction $ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $ cash flow&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 short/sell claim for $\Pi(0;x)$ $ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $ +$\Pi(0;x)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2 Buy $\phi$ $ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $ -$V_0({\phi})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3 Invest $\Pi(0;x)$ - $V_0({\phi})$ at R until t=1 $ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $ -($\Pi(0;x)$ - $V_0({\phi})$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $ 0&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;At t = 1&lt;/strong&gt;,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;transaction $ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $ cash flow&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 collect investment $ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $ +($\Pi(0;x)$ - $V_0({\phi})$)(1+R)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2 Portfolio grows in value $\phi$ $ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $ +$V_1({\phi})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3 [...]? $ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $ -$V_1({\phi})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4 Close short position if needed $ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $ 0&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Profit $ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $ +($\Pi(0;x)$ - $V_0({\phi})$)(1+R)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Where does the $V_1({\phi})$ go? I was thinking that we were supposed to borrow $\frac{V_1({\phi})}{1+R}$ at t=0 so it would look something like:&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Suppose $\Pi(0;x)$ &gt; $V_0({\phi})$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;At t = 0&lt;/strong&gt;,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;transaction $ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $ cash flow&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 short/sell claim for $\Pi(0;x)$ $ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $ +$\Pi(0;x)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2 Buy $\phi$ $ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $ -$V_0({\phi})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3 Borrow $\frac{V_1({\phi})}{1+R}$ at R until t=1 $ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $ +$\frac{V_1({\phi})}{1+R}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4 Invest $\Pi(0;x)$ - $V_0({\phi})$ + $\frac{V_1({\phi})}{1+R}$ at R until t=1 $ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $$-(\Pi(0;x)$ - $V_0({\phi})$ + $\frac{V_1({\phi})}{1+R})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $ 0&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;At t = 1&lt;/strong&gt;,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;transaction $ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $ cash flow&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 collect investment $ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $$(\Pi(0;x)$ - $V_0({\phi})$ + $\frac{V_1({\phi})}{1+R})(1+R)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2 Pay debt $\phi$ $ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $ -$V_1({\phi})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3 Close short position if needed $ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $ 0&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Profit $ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $ +($\Pi(0;x)$ - $V_0({\phi})$)(1+R)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Or is there some action for the missing step that makes both of them equivalent?&lt;/p&gt;&#xA;" OwnerUserId="7788" LastActivityDate="2014-06-22T11:29:42.910" Title="Arbitrage Strategy Proof in Bjork" Tags="&lt;arbitrage&gt;&lt;portfolio&gt;&lt;continuous-time&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12732" PostTypeId="2" ParentId="12725" CreationDate="2014-06-20T12:15:40.117" Score="0" Body="&lt;p&gt;What is the floating rate that you receive? The trade should be fair. This means that at the beginning the discounted pay-offs should be equal.&#xA;This is the no-arbitrage condition and it only holds if you are able to short the stock. Then we can find a replicating strategy.&#xA;At time zero both sides of the trade could do the following (we assume no dividend for the stock for simplicity): &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;enter the contract&lt;/li&gt;&#xA;&lt;li&gt;short the stock - you receive $S_0$ cash for this&lt;/li&gt;&#xA;&lt;li&gt;invest the cash at the market rate for one year $r_1$&lt;/li&gt;&#xA;&lt;li&gt;after one year you close the short on the stock and pay $S_1$ for this. You still have the invested $S_0*(1+r_1)$ from the cash.&lt;/li&gt;&#xA;&lt;li&gt;after this year you receive $S_1/S_0-1$ from the counterpart which is the performance of your short and you pay $r_1$ - the sum of all is zero.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The other side can do this:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The arbitrage free forward price for the stock at time zero is $F_1 = S_0 (1+r_1)$&lt;/li&gt;&#xA;&lt;li&gt;The other side of the trade can enter at this forward price and gets $S_1$ at time $1$ from this foward contract and &quot;gives&quot; it to you. The remaining $r_1$ is what you pay.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;After all: shorting the stock, closing the short on your side, a forward trade on the other side makes things fair.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Things get difficult if you have to estimate dividends, if we consider the real workd where both paries usually get different rates and other transaction costs and fees enter.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-06-20T12:15:40.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12733" PostTypeId="1" CreationDate="2014-06-20T12:47:28.530" Score="3" ViewCount="379" Body="&lt;p&gt;This is my first time posting a question. I have very limited experience in the field of stochastic calculus and interest rate modelling. I have been tasked with implementing the short rate model introduced in Jamshidian and Zhu (1997) for the purpose of estimating stressed interest rates for interest rate risk in the banking book. The model is specified as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/pkjHu.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In effect it is a log normal short rate model that has a standard Ornstein Uhlenbeck process as the stochastic driver. The model also includes PCA of the yield curve hence the beta weights on the Y_k terms in the discretized version of the model which is specified as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/KCGhu.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is how do I get this solution? I have no idea of how to solve the SDEs so that I end up with the discretized version shown above. I include a link to the original paper by Jamshidian and Zhu.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.ime.usp.br/~rvicente/risco/jamshidian.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.ime.usp.br/~rvicente/risco/jamshidian.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reference to the short rate model are made on p3 and p9. I hope that I have stated the question clearly. Any help would be greatly appreciated because I am about to pull my hair out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="9348" LastActivityDate="2014-08-01T08:03:42.757" Title="Solving the Jamshidian Zhu (1997) PCA short rate model" Tags="&lt;stochastic-processes&gt;&lt;short-rate&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12734" PostTypeId="1" CreationDate="2014-06-20T16:41:09.360" Score="2" ViewCount="77" Body="&lt;p&gt;I have a set of annualized returns over 4 time periods: 10yr, 5yr, 3yr and 1yr.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to weight each return to have a &quot;more representative&quot; return?&lt;/p&gt;&#xA;" OwnerUserId="2257" LastActivityDate="2014-06-22T15:13:33.240" Title="Weighting several returns over different time frames" Tags="&lt;returns&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12735" PostTypeId="1" CreationDate="2014-06-20T18:30:16.503" Score="4" ViewCount="410" Body="&lt;p&gt;The book of &lt;a href=&quot;http://www.financialriskforecasting.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Financial Risk forecasting by Danielsson&lt;/a&gt; gives the following example about VAR manipulation. I have two questions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) If $0&amp;gt; VAR_1 &amp;gt; VAR_0$ , why the following figure plots it as $-VAR_1&amp;gt; -VAR_0$. I think $-VAR_1$ should be placed at the left side of $-VAR_0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) I am not clear how does the manipulation strategy marked with yellow work. In other words, why it can lower the expected profit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/BLOTN.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/bQQ2t.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="8251" LastEditorUserId="848" LastEditDate="2014-07-23T09:58:28.297" LastActivityDate="2014-07-23T09:58:28.297" Title="questions on VAR manipulation" Tags="&lt;options&gt;&lt;risk&gt;&lt;risk-management&gt;&lt;risk-models&gt;&lt;value-at-risk&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12737" PostTypeId="2" ParentId="12729" CreationDate="2014-06-21T06:02:52.213" Score="9" Body="&lt;p&gt;It seems logical to me to have a Financial accounting course in a quant program. Quants can have a lot of different occupations, from derivative pricing to quant analyst in a &quot;research&quot; (i.e. analysis) dept. of a broker, a risk dept., a fund (as an analyst or as a potfolio manager), or quant execution trader (the list is far longer). In the case of being quant analyst in the analysis dept of a broker, you will need financial analysis for sure (just have a look at the &lt;a href=&quot;http://www.cfainstitute.org/programs/cfaprogram/courseofstudy/Pages/cbok.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;CFA program&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have in mind the occupation of quant in a derivative pricing team (can be in the equity or fixed income dept of an investment bank), it is not the only one. And to my eyes not a first choice today; it seems to me that &lt;strong&gt;liquidity is the hot topic&lt;/strong&gt; nowadays, hence working around this area at very short term (intraday trading) or very long term (asset allocation), or around the topic of &quot;collaterallization&quot;, or the funding of the bank, is nice. And financial accounting could be of use in some of these jobs.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2017-02-13T23:20:54.867" LastActivityDate="2017-02-13T23:20:54.867" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12738" PostTypeId="2" ParentId="12729" CreationDate="2014-06-21T06:18:26.163" Score="18" Body="&lt;p&gt;Accounting is a vital skill if you end up in a managerial position, and unless your career goal is to always be a cog in someone else's clockwork, then you will eventually find yourself in a managerial/senior partnership position even through quant research. I still play a critical role in my firm's quant strategies team, but here's a few things I've had to do that relate to accounting that you'd find common on the buy-side:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Fighting those inconsistencies in our PBs/clearing firms' trade execution reports.&lt;/li&gt;&#xA;&lt;li&gt;Negotiating fund administrators' fee structures and services and interfacing their platform(s) with our internal tools.&lt;/li&gt;&#xA;&lt;li&gt;Voting on the decision whether to take incentive fees or allocations.&lt;/li&gt;&#xA;&lt;li&gt;Voting on the decision on 475(f) election (at a multi-asset class hedge fund, where the proportion of short-term gain isn't immediately clear and knowledge of individual strategies' PnL was important in making this decision).&lt;/li&gt;&#xA;&lt;li&gt;Defending a cap table and business valuation (merger of two prop firms).&lt;/li&gt;&#xA;&lt;li&gt;Voting on a decision whether to restructure our fund management company as an LP (this was intricately tied to our partners' bonuses, because of changes to NII and SE tax policy arising from the Affordable Care Act).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Now, purely on the quant research and strategy development end, accounting is an extremely useful skill for obtaining and scrubbing your primary data source for trading decisions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Price-moving information, e.g. book value, debt/equity ratio, operating income to interest expenses, could be contained in unstructured accounting statements.&lt;/li&gt;&#xA;&lt;li&gt;Trading opportunities could arise from discrepancies due to reporting practices, e.g. mark-to-market, mark-to-close etc.&lt;/li&gt;&#xA;&lt;li&gt;Trading opportunities could arise from accounting inconsistencies, e.g. miscategorization.&lt;/li&gt;&#xA;&lt;li&gt;Market price of assets may be overestimated/underestimated significantly if they are based on expected future cash flows.&lt;/li&gt;&#xA;&lt;li&gt;Valuation based on discounted cash flow.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="4660" LastEditDate="2014-06-23T23:20:48.700" LastActivityDate="2014-06-23T23:20:48.700" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12739" PostTypeId="2" ParentId="11325" CreationDate="2014-06-21T12:22:01.943" Score="0" Body="&lt;p&gt;As you have the market price of the bond given, you may infer an unconditional default probability as follows:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Calculate the price of the bond under riskfree rate, say its 110$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Divide the Market Price by the Riskfree Price, say $105/110 = 0.95$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Hence the implied default probability is expectedly $5\%$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other way you are describing seems to me not what was asked, as you could specify any distribution for the hazard rates, but it was asked for the 'implied default probability'. You would then need to fit the parameters of the distribution-implied price to the market price using some numerical optimizer (e.g. Least Squares).&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-06-21T12:22:01.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12740" PostTypeId="2" ParentId="3451" CreationDate="2014-06-21T20:58:31.847" Score="1" Body="&lt;p&gt;I have not found any literature directly handling this. But you could pose the question in terms of risk management of stationary series. Here is &lt;a href=&quot;http://e-collection.library.ethz.ch/eserv/eth:25077/eth-25077-01.pdf&quot; rel=&quot;nofollow&quot;&gt;extreme values in stationary series&lt;/a&gt;. You can try this &lt;a href=&quot;http://fmwww.bc.edu/ec-p/wp708.pdf&quot; rel=&quot;nofollow&quot;&gt;Quantile Cointegrating Regression&lt;/a&gt;. This &lt;a href=&quot;http://www.edhec-risk.com/edhec_publications/all_publications/RISKReview.2012-01-13.5722/attachments/EDHEC_Working_Paper_Sensitivity_of_portfolio_VaR_and_CVaR_F.pdf&quot; rel=&quot;nofollow&quot;&gt;Sensitivity of portfolio VaR and CVaR to portfolio return characteristics&lt;/a&gt; is an interesting twist. Here is an another version of the paper you cited&lt;a href=&quot;http://www.carolalexander.org/publish/download/JournalArticles/PDFs/RIBF_16_65-90.pdf&quot; rel=&quot;nofollow&quot;&gt;Cointegration and Asset Allocation&lt;/a&gt; or &lt;a href=&quot;http://www.silverline-pub.co.uk/Capital%20Markets/Cointegration.htm&quot; rel=&quot;nofollow&quot;&gt;cointegration&lt;/a&gt;.It will be interesting to go through them in detail. Of course, MC would be a sure way to do VaR or CVaR. You may find that the VaR may vary for the sub samples of the in-sample dataset. To me, that variability may be more important in predicting or monitoring the out-of-sample VaR on day to day basis. I do not have any literature showing whether the stationarity broke down or improved during the credit crisis of 2008, considering you are short one vs another or how sensitive the cointegrated series are wrt correlation changes. Would be nice to have a regime switching model to detect when the changes are occurring. Normally the portfolio is already experiencing drawdown  by the time the model realizes the change. Need to give some more thought to EVT and drawdown.&lt;/p&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="7867" LastEditDate="2014-06-21T21:15:52.790" LastActivityDate="2014-06-21T21:15:52.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12741" PostTypeId="1" AcceptedAnswerId="12747" CreationDate="2014-06-22T09:00:33.813" Score="6" ViewCount="686" Body="&lt;p&gt;Basic macroeconomics theory states that stock prices are inversely correlated with interest rates, i.e., when interest rates rise, borrowing is more costly, and thus companies with huge debt would be hurt. As a result, their expected earnings would be forecast to decline, which would eventually translate to declining stock prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, history suggests than they are not always negatively correlated. Therefore, under what conditions does the opposite hold, i.e., stock prices are positively correlated with interest rates?&lt;/p&gt;&#xA;" OwnerUserId="5007" LastEditorUserId="5007" LastEditDate="2014-06-22T09:09:24.087" LastActivityDate="2017-03-13T02:28:28.723" Title="Why can sometimes stock prices rise when interest rates rise?" Tags="&lt;equities&gt;&lt;interest-rates&gt;" AnswerCount="6" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12742" PostTypeId="2" ParentId="12734" CreationDate="2014-06-22T11:18:17.743" Score="1" Body="&lt;p&gt;You can weight the returns and use them in calculations as shown below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From this site:-&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://disc.sci.gsfc.nasa.gov/giovanni/additional/users-manual/G3_operation_time_series_stats.shtml&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://disc.sci.gsfc.nasa.gov/giovanni/additional/users-manual/G3_operation_time_series_stats.shtml&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The weighted mean is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/52yaE.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the weighted standard deviation is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/oYdLy.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, making up some annualised returns for time spans, 1 yr, 3 yrs, 5 yrs &amp;amp; 10 yrs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;r = {0.01, 0.02, 0.03, 0.04}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and some weights based on decaying relevance with, say &lt;code&gt;τ = 2&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a = {e^(-1/τ), e^(-3/τ), e^(-5/τ), e^(-10/τ)}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and fixing their total to be 1&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;w = a/Σa&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;{0.660361, 0.242933, 0.0893701, 0.00733595}&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;the weighted mean return is 0.0144 and weighted s.d. is 0.00972&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, by using weights that sum to 1 the formulae are simplified, Σw and (Σw)^2 = 1.&lt;/p&gt;&#xA;" OwnerUserId="7178" LastEditorUserId="7178" LastEditDate="2014-06-22T15:13:33.240" LastActivityDate="2014-06-22T15:13:33.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12743" PostTypeId="2" ParentId="12731" CreationDate="2014-06-22T11:24:36.597" Score="1" Body="&lt;p&gt;If $V_0(\phi) &amp;lt; \Pi(0,x)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;at $t=0$&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You sell short the claim and collect $\Pi(0,x)$ &lt;/li&gt;&#xA;&lt;li&gt;You buy the portfolio $\phi$ for $V_0(\phi)$&lt;/li&gt;&#xA;&lt;li&gt;You put the money $\Pi(0,x) - V_0(\phi)$ in your risk-free&#xA;instruments&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;at $t=1$&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;At $t=1$ you'll be liable the payoff of the claim you have shorted. The money you owe the counterpart long the claim is $\Pi(1,x)$.  &lt;/li&gt;&#xA;&lt;li&gt;$\phi$ is the replicating portfolio hence $V_1(\phi) = \Pi(1,x)$. You can sell the portfolio $\phi$ and get $V_1(\phi)$&lt;/li&gt;&#xA;&lt;li&gt;Therefore, you are left with $(\Pi(0,x) - V_0(\phi)) (1+R)$ in your&#xA;bank account.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I don't think you'll need to borrow $V_1(\phi) / (1+R)$ at $t=0$: you can already finance the long position in the portfolio with part of the proceeds from the short sale of the claim. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In any case, you don't know the value $V_1(\phi)$ at $t=0$. All you know is that $V_1(\phi) = \Pi(1,x)$ at $t=1$.&lt;/p&gt;&#xA;" OwnerUserId="6781" LastEditorUserId="6781" LastEditDate="2014-06-22T11:29:42.910" LastActivityDate="2014-06-22T11:29:42.910" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12744" PostTypeId="2" ParentId="3156" CreationDate="2014-06-22T13:09:06.283" Score="8" Body="&lt;p&gt;Have a look at &lt;a href=&quot;https://github.com/kevinlawler/kona&quot; rel=&quot;noreferrer&quot;&gt;Kona&lt;/a&gt; which is a FOSS project trying to be compatible. Also &lt;a href=&quot;https://github.com/tavmem&quot; rel=&quot;noreferrer&quot;&gt;Tom Szczesny&lt;/a&gt; has done some work on its predecessors namely A. I hope this helps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also if you are not looking for a perfect substitute you can have a look at other Time Series Databases like &lt;a href=&quot;https://github.com/influxdata/influxdb&quot; rel=&quot;noreferrer&quot;&gt;InfluxDB&lt;/a&gt;, Java Chronicles, &lt;a href=&quot;https://github.com/OpenTSDB/opentsdb&quot; rel=&quot;noreferrer&quot;&gt;OpenTSDB&lt;/a&gt;, &lt;a href=&quot;https://github.com/kairosdb/kairosdb&quot; rel=&quot;noreferrer&quot;&gt;KairosDB&lt;/a&gt; which are all Open Source. There are commercial ones as well out of which OneTick is targeted at Tick Data management.&lt;/p&gt;&#xA;" OwnerUserId="909" LastEditorUserId="18728" LastEditDate="2016-05-20T05:53:06.573" LastActivityDate="2016-05-20T05:53:06.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12745" PostTypeId="2" ParentId="12741" CreationDate="2014-06-22T13:22:18.543" Score="1" Body="&lt;p&gt;If the companies asset duration is smaller than the liability duration the correlation with interest rates can be higher than a typical firm. More particularly look for surplus in insurance portfolios and pension plans with a positive duration. If interest rates rises the surplus increases strengthening the BS which will have a more higher price impact.&lt;/p&gt;&#xA;" OwnerUserId="909" LastActivityDate="2014-06-22T13:22:18.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12746" PostTypeId="2" ParentId="12741" CreationDate="2014-06-22T14:08:35.463" Score="2" Body="&lt;p&gt;Rising interest rates are sometimes a proxy for rising &lt;strong&gt;growth.&lt;/strong&gt; So if stocks benefit from higher growth more than they are hurt by higher interest rates, stocks will rise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A statement that &quot;stocks fall when interest rates rise&quot; assumes &quot;all other things being equal.&quot; In the first paragraph, that was not the case.&lt;/p&gt;&#xA;" OwnerUserId="2345" LastActivityDate="2014-06-22T14:08:35.463" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12747" PostTypeId="2" ParentId="12741" CreationDate="2014-06-22T19:06:22.543" Score="8" Body="&lt;p&gt;In the chart below, I'm showing the rolling correlations between stock returns and bond returns. (The relationship would be flipped if you are studying stock returns vs interest rates).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see, for the bulk of the history since 1960s, bond returns and stock returns were indeed positively correlated; i.e., when stocks went up, bonds went up too (and interest rate declined). The past 15 years or so, however, bond returns and stock returns have turned negative (i.e., stocks go up, bonds go down/interest rate goes up).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The historical &quot;norm&quot; was that negative supply shocks tended to cause the equity market to tank, while the coinciding high inflation hurt bonds as well. Nowadays, with inflation expectation very well anchored, bonds have largely become synonymous with recession-hedges – people buy bonds (cause rates to decline) when stocks are performing poorly (&quot;flight-to-quality&quot;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The past few years' experience is also interesting. The Fed buying up a lot of Treasuries (quantitative easing) plus the zero-interest-rate-policy has emboldened risk taking, sending S&amp;amp;P to records.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So to sum up, how stocks &amp;amp; interest rates move relative to each other is very much dependent on the macro backdrop.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reference: Antii Ilmanen's &quot;Expected Returns&quot; (2011)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/DbEQ8.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/DbEQ8.png&quot; alt=&quot;Stock/Bond Correlations&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2017-03-13T02:28:28.723" LastActivityDate="2017-03-13T02:28:28.723" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12748" PostTypeId="1" CreationDate="2014-06-22T22:32:23.290" Score="0" ViewCount="171" Body="&lt;p&gt;I have a time series of gold prices, on which I want to build an ARIMA model. The series is autocorrelated and if I can difference as often as I want, it always is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First:&#xA;data:  d1gold&#xA;Dickey-Fuller = -18.5829, Lag order = 19, p-value = 0.01&#xA;alternative hypothesis: stationary&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second:&#xA;data:  d2gold&#xA;Dickey-Fuller = -32.6297, Lag order = 19, p-value = 0.01&#xA;alternative hypothesis: stationary&#xA;.. and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What can I do to fit the data in an ARIMA model?&#xA;Data: &lt;a href=&quot;https://drive.google.com/file/d/0B7cBu_0IHA17a1lQUlpsS1BJXzg/edit?usp=sharing&quot; rel=&quot;nofollow&quot;&gt;https://drive.google.com/file/d/0B7cBu_0IHA17a1lQUlpsS1BJXzg/edit?usp=sharing&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best Regards&#xA;Erik&lt;/p&gt;&#xA;" OwnerUserId="9358" LastActivityDate="2014-08-21T06:48:13.380" Title="Infinite autocorrelation - Unit root?" Tags="&lt;finance&gt;&lt;auto-correlation&gt;&lt;forecast&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12749" PostTypeId="2" ParentId="12729" CreationDate="2014-06-22T23:08:27.253" Score="2" Body="&lt;p&gt;There are two reasons for a quant to know accounting. The first is that a fair number of &quot;quant&quot; problems are, or at least can be cast as, accounting problems. This includes time series or &quot;non-parametric&quot; analysis of accounting numbers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second reason is that accounting numbers are sometimes faked, meaning that a quant has to be able to deconstruct accounting numbers in order not to be fooled. Enron Corp. looked like a good investment to many quants; until you realize that their numbers were phony.&lt;/p&gt;&#xA;" OwnerUserId="2345" LastEditorUserId="2345" LastEditDate="2015-01-26T19:21:17.380" LastActivityDate="2015-01-26T19:21:17.380" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12750" PostTypeId="2" ParentId="11325" CreationDate="2014-06-22T23:46:38.980" Score="0" Body="&lt;p&gt;You missed counting event that no default happens.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can check out my blog on this topic:&#xA;&lt;a href=&quot;http://rickyzhang.asuscomm.com/blog/?p=29&quot; rel=&quot;nofollow&quot;&gt;http://rickyzhang.asuscomm.com/blog/?p=29&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9360" LastActivityDate="2014-06-22T23:46:38.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12751" PostTypeId="1" CreationDate="2014-06-23T00:42:44.953" Score="2" ViewCount="108" Body="&lt;p&gt;Have a somewhat meta question here. I am part of a trading risk management implementation project. I also manage day to day risk reporting to management and the trading desks. Our implementation was successful in that the risk modeling is much more accurate than the spreadsheets. However there are still issues with the system that turn up and create an impact to pnl for the books. The swings up and down due to system issues send a bad message about the amount of market risk that is being taken on &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to apply something like a haircut to the book value and smooth out these technology related issues, but I'm not sure if that is an acceptable business practice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume that you have no say or input on the state of the system itself&lt;/p&gt;&#xA;" OwnerUserId="7884" LastEditorUserId="12050" LastEditDate="2014-09-23T16:59:22.597" LastActivityDate="2015-04-21T17:44:47.630" Title="is there an accepted method for quantifying risk of inaccuracy of nascent trm systems?" Tags="&lt;risk&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12753" PostTypeId="2" ParentId="12748" CreationDate="2014-06-23T01:58:19.827" Score="1" Body="&lt;p&gt;Check your calculations, gold prices are indeed auto-correlated. &lt;code&gt;acf(diff(log(OilGold$price_gold)))&lt;/code&gt; will yield no auto-correlation in gold log-returns.&lt;/p&gt;&#xA;" OwnerUserId="7544" LastActivityDate="2014-06-23T01:58:19.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12754" PostTypeId="2" ParentId="12729" CreationDate="2014-06-23T06:00:00.820" Score="2" Body="&lt;p&gt;Certain structural models of credit risk/default require some background in accounting, but not much. That these credit models are getting baked into the Basel regulations for CVA, CoCo bonds, and so on, makes it marginally more important to know. There's also an entire industry based on convertible bond and capital structure arbitrage where knowing accounting is vital. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just do what interests you, and don't worry about anonymous folks saying this or that is crucial, they are only talking their book, as they say. &lt;/p&gt;&#xA;" OwnerUserId="3491" LastActivityDate="2014-06-23T06:00:00.820" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12755" PostTypeId="2" ParentId="12735" CreationDate="2014-06-23T07:29:53.037" Score="4" Body="&lt;p&gt;First, I am quite sure that this is a typo and it should be&#xA;$$&#xA;0 &amp;lt; VaR_1 &amp;lt; VaR_0&#xA;$$&#xA;then &#xA;$$&#xA;-VaR_0 &amp;lt; -VaR_1&#xA;$$&#xA;and the plot is correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, the put strategy does not change only the expected profit but the whole distribution of the P&amp;amp;L. If you buy a put with strike $K_1 = -VaR_1$ then you get compensated for losses below $K_1$. But you have to buy this option and pay a premium for it,say $P_1$ - this is a certain loss. To make this hedge cheaper you can sell a put at a lower strike $K_0$ at the price $P_0$. Then you will be compensated for any loss between $K_1$ and $K_0$ and you pay for it $P_1-P_0$. The premium payments change your expected profit but additionally the whole P&amp;amp;L is altered. &lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-06-23T07:29:53.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12756" PostTypeId="1" CreationDate="2014-06-23T10:23:16.187" Score="1" ViewCount="1867" Body="&lt;p&gt;I know this question will be quickly destroyed and my account summarily banned, but I just have to ask:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a trader using machine-learning algorithms (SVMs, ANNs, GAs, Decision Trees) for quantitative finance, without seasoned financial intuition, what would be considered a good confidence / success rate?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know this will depend on the following, as well as other items I'm not aware of:&lt;br&gt;&lt;br&gt;&#xA;-Market / Sector (stocks, commodities, FOREX, etc.)&lt;br&gt;&#xA;-Principal investment&lt;br&gt;&#xA;-Frequency of trades&lt;br&gt;&#xA;-Share price&lt;br&gt;&#xA;-News Volatility of sector&lt;br&gt;&#xA;-Range of dates used for datasets&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please feel free to list other considerations... But in the end, to make the question crystal clear I'd really like a target number. 75%?  At 60% I would be roughly taking 1 step forward for every 10 steps taken. Any less and I might as well flip a coin.  If it varies, please list the considerations under which they do so.  If possible, it would be preferable to use these models to support trades over a period of days rather than seconds/minutes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have other suggestions for how to go about things based on low/high, principal, markets to consider, share prices, etc. please feel free.  If my question does not make sense, please tell me why.  Thank you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-At this point I was simply trying to predict up and down movements over a 5 day period. Simple. 45%.&lt;br&gt;&#xA;-Free Yahoo data be my market data source... daily quotes.  Wasn't sure if intra-day information would be helpful.&lt;br&gt;&#xA;-I've attempted ANNs, SVMs, and some GAs so far.&lt;br&gt;&#xA;-I wasn't looking for real-time trading, but instead looking to identify regular tides over a several day period.&lt;br&gt;&#xA;-Maybe if I can get my error high enough, I can simply trade opposite my predictions! (no, seriously though)&lt;/p&gt;&#xA;" OwnerUserId="9365" LastEditorUserId="9365" LastEditDate="2014-06-23T14:40:32.827" LastActivityDate="2019-09-25T23:11:19.173" Title="What Is A Good Success Rate Using Machine Learning For A Beginner?" Tags="&lt;forecasting&gt;&lt;machine-learning&gt;&lt;neural-networks&gt;" AnswerCount="4" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12758" PostTypeId="1" AcceptedAnswerId="12762" CreationDate="2014-06-23T12:34:41.043" Score="1" ViewCount="199" Body="&lt;p&gt;I have a Dynamic Nelson Siegel (DNS) based rv model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to know if I can use pre and post-crises curves interchangeably in my calibration and out of sample testing. I.e. those without OIS discounting pre-crises and those with OIS discounting that we observe today?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had hoped that even though they are derived differently the market rates themselves will not have changed in terms of their relative value (if 2-10 looks flat then it still looks flat post crises) same for butterfly trades (and their dynamics should also be unchanged). The differences are in the PnL of the host institutions who can no longer fund at Libor but for my purposes i.e. relative value (I am hoping) it is not necessary to introduce this complication am I right. I can just calculate the PnL in terms of the basis point changes observed (I effectively assume that I am an institution that can fund at Libor throughout)? Or is it like comparing apples and oranges?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Baz&lt;/p&gt;&#xA;" OwnerUserId="7077" LastActivityDate="2018-05-24T11:42:24.507" Title="OIS discounting pre and post crises" Tags="&lt;fixed-income&gt;&lt;yield-curve&gt;&lt;curve-fitting&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12759" PostTypeId="1" AcceptedAnswerId="12761" CreationDate="2014-06-23T13:23:22.777" Score="0" ViewCount="5504" Body="&lt;p&gt;As some of your may know from my other posts, I am working on a Dynamic Nelson Siegel (DNS) based relative value trading model. On simulated data (which satisfies all the assumptions) of the DNS it worked well (unsurprisingly). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I now need to get real data/results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Part of the logic of the model is to look at the relative value of the most liquid points say 2,5,10y relative to all the remaining points. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it's important that the zero coupon data represents ideally traded or at least traceable rates for all tenors rather than stale rates or even interpolated rates (as in this case I am just comparing different interpolation schemes!).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know of a Bloomberg page that offers such rates? Or at least makes a distinction between which rates are real and which are interpolated?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks Baz&lt;/p&gt;&#xA;" OwnerUserId="7077" LastEditorUserId="7077" LastEditDate="2014-06-23T14:04:23.600" LastActivityDate="2015-11-02T20:44:42.630" Title="Bloomberg Zero Coupon Rates" Tags="&lt;fixed-income&gt;&lt;yield-curve&gt;&lt;bloomberg&gt;&lt;curve-fitting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12760" PostTypeId="2" ParentId="12756" CreationDate="2014-06-23T14:03:09.253" Score="0" Body="&lt;p&gt;Honestly, if you get 50.1% you should be happy:)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Predicting the future is just plain hard and if you can do it reliably then, by definition,  you've found a way to make money.  Think about how many hedge funds and how many Phd's are working on this right now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The biggest issues you'll come across are curve fitting and survivor ship bias.  ie you'll tune your learning model to the data you have for back testing and what often happens is that after a bit of tuning your model perfectly predicts what happened on the day you test it and that's about the only time it accurately predicts what the market does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sorry if that sounds bleak but its incredibly hard to accurately predict the future, Or put another way, success in machine learning for a beginner is probably just not making things worse than random guessing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some questions to help flesh out what you are doing...&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;What specifically are you trying to predict?  &lt;/li&gt;&#xA;&lt;li&gt;What is your market data source?&lt;/li&gt;&#xA;&lt;li&gt;What ml algorithms are you using?&lt;/li&gt;&#xA;&lt;li&gt;Can they run in real time?  &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As to what percentage of being correct you should really look to target.... it is a function based on how much you lose/gain for each order you put out.  &lt;/p&gt;&#xA;" OwnerUserId="743" LastEditorUserId="743" LastEditDate="2014-06-23T14:25:46.703" LastActivityDate="2014-06-23T14:25:46.703" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12761" PostTypeId="2" ParentId="12759" CreationDate="2014-06-23T14:04:28.137" Score="3" Body="&lt;p&gt;For the US Treasury market, zero coupon bonds are traded and they are called STRIPS. You can access them through &quot;S GOVT&quot; (coupon Strips) or &quot;SP GOVT&quot; (principal strips) on BBG.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With regard to relative value trading, it's actually pretty rare that we fit models to zeros, because a lot of them are not liquid and trade differently from their coupon counterparts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, what you should do is to fit your model to coupon bonds or par swaps directly. Like you said, you could potentially fit the 2y, 10y, and 30y bonds, then look at relative value elsewhere. Once you have fit a model to coupon Treasuries, you can then assess STRIPS against this same model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For some real life examples, Tuckman's Fixed Income Securities (3rd Edition) Chapter 11 is quite good.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2014-06-23T14:04:28.137" CommentCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="12762" PostTypeId="2" ParentId="12758" CreationDate="2014-06-23T14:26:32.110" Score="0" Body="&lt;p&gt;For RV purposes, I have actually continued to use libor discounting for simplicity; otherwise, you'd have to model multiple curves, which become very difficult to work with...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That being said, the curve has been trading very differently after the crises. For example, 5y typically didn't deviate that much from 2y and 10y on relative value basis historically, but after the crisis, 5s traded RIDICULOUSLY rich relative to 2s and 10s ALWAYS (until recently). Doesn't mean your model doesn't work any more, but it does make interpreting model output a bit more challenging.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2014-06-23T14:26:32.110" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12763" PostTypeId="1" CreationDate="2014-06-23T14:30:16.543" Score="1" ViewCount="1566" Body="&lt;p&gt;Question about forward vs spot simply-compounded spot interest rate.Some definitions&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$P(a,b)$ a zero coupond price at time $a$ and maturity $b$&lt;/li&gt;&#xA;&lt;li&gt;$L(a,b)$ simply compounded spot interest rate set at time $a$ and payement at time $b$&lt;/li&gt;&#xA;&lt;li&gt;$F(t,a,b)$ simply compounded forward interest rate at time $t$, set at time $a$ and payement at time $b$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For a timeline $t&amp;lt;T&amp;lt;S$, we have formula for spot rate&#xA;\begin{equation}&#xA;L(t,T) = \frac{1}{T-t}[\frac{1}{P(t,T)}-1]&#xA;\hspace{1cm}&#xA;L(T,S) = \frac{1}{S-T}[\frac{1}{P(T,S)}-1]&#xA;\end{equation}&#xA;By arbitrage free hypothesis, we have the zero coupond relation $P(t,S) = P(t,T)P(T,S)$, hence&#xA;\begin{equation}&#xA;P(t,S)(S-T)L(T,S) = P(t,T) - P(t,S)&#xA;\end{equation}&#xA;On the other hand, we have the formula for forward interest rate &#xA;\begin{equation}&#xA;F(t,T,S)=\frac{1}{S-T}[\frac{P(t,T)}{P(t,S)}-1]&#xA;\leftrightarrow&#xA;P(t,S)(S-T)F(t,T,S) = P(t,T) - P(t,S)&#xA;\end{equation}&#xA;The idea is $F(t,T,S)$ has to be a forward rate at time $t$ of the spot rate $L(T,S)$, but what i've proved, they are equal. I see that is not logic, but i can not see what was wrong in my formula. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone help me please?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="3507" LastEditorUserId="30479" LastEditDate="2019-03-09T14:04:14.913" LastActivityDate="2019-03-09T14:04:14.913" Title="forward vs spot simply-compounded spot interest rate" Tags="&lt;forward-rate&gt;&lt;libor&gt;&lt;spot-rate&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12764" PostTypeId="2" ParentId="12756" CreationDate="2014-06-23T17:55:38.590" Score="2" Body="&lt;p&gt;You're thinking about this the wrong way, in my opinion. Win/loss percentage is worthless in isolation. You must consider the symmetry of your winners and losers. You can have a win % of only 40% and still have a wonderful strategy if your your winners are significantly larger than your losers (this is the classic trend follower PnL distribution).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, you could flip a coin and see 50% prediction accuracy. That would be outstanding if your winners are 2x larger than your losers.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2014-06-23T17:55:38.590" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12765" PostTypeId="2" ParentId="12763" CreationDate="2014-06-23T18:51:31.400" Score="4" Body="&lt;p&gt;The flaw is $L(T,S)$ is a future spot rate that is determined at time $T&amp;gt;t$ and unknown at present.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is correct that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$F(t,T,S)=\frac{1}{S-T}\left[\frac{P(t,T)}{P(t,S)}-1\right]&#xA;\iff&#xA;P(t,S)(S-T)F(t,T,S) = P(t,T) - P(t,S),&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;as this is just the definition of the forward rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, you are saying that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac1{P(t,T)}\frac1{P(T,S)}=\frac1{P(t,S)},$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P(T,S)=\frac1{1+L(T,S)(S-T)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The zero-coupon bonds maturing at $T$ and $S$ have known prices at present.  You don't know that buying the $T$-maturity bond today and rolling into a new $S-T$-maturity zero-coupon bond at future time $T$ will produce the same return as buying an $S$-maturity bond today.&lt;/p&gt;&#xA;" OwnerUserId="8153" LastEditorUserId="8153" LastEditDate="2015-01-08T01:48:13.377" LastActivityDate="2015-01-08T01:48:13.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12766" PostTypeId="2" ParentId="12729" CreationDate="2014-06-23T19:07:54.080" Score="4" Body="&lt;p&gt;There are various kinds of &quot;quants&quot;. If you are an equity quant building quantitative stock selection models using fundamentals such as price/earnings, EBITDA/EV, or especially accruals, then you should be knowledegable about accounting. If you become a fixed income derivatives quant, accounting is less important. Education should not be expected to prepare you narrowly for a very specific job.&lt;/p&gt;&#xA;" OwnerUserId="8228" LastActivityDate="2014-06-23T19:07:54.080" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12767" PostTypeId="1" AcceptedAnswerId="12768" CreationDate="2014-06-23T22:48:52.133" Score="23" ViewCount="6658" Body="&lt;p&gt;I understand there is an awful lot of Quantitative Math required for statistical arbitrage/algorithmic trading. However, would someone &quot;in the know&quot; be able to tell me whether there is less quantitative requirement for being a market-maker? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My (simplistic) viewpoint on market making is you simply want to keep quoting, collect the exchange rebates and if you get hit on one side of the bidask spread you need to hedge that trade. Using this (admitedly simplistic) viewpoint, I got the impression there was far less PhD-level mathematics involved than stat arb/algo trading?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ask because myself and a group of friends are low-latency programmers and we are pondering whether we could realistically start up a small market-making business and utilise our low-latency experience. However, with our speciality on the technical side and no PhD mathematicians, we weren't sure how plausible it was.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming it was plausible would you suggest beginning with a smaller exchange/market? Straight equities vs index futures/options, does it matter? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any useful advice would be most welcome.&lt;/p&gt;&#xA;" OwnerUserId="6089" LastActivityDate="2019-01-16T09:38:11.273" Title="Quantitative Math required for Market-making?" Tags="&lt;equities&gt;&lt;high-frequency&gt;&lt;market-making&gt;&lt;exchange&gt;" AnswerCount="4" CommentCount="4" FavoriteCount="18" ContentLicense="CC BY-SA 3.0" />
  <row Id="12768" PostTypeId="2" ParentId="12767" CreationDate="2014-06-23T23:11:29.597" Score="11" Body="&lt;p&gt;Successful strategies in both areas can have the same math requirement. It just depends on the algorithm. PhD level mathematics is not a requirement in either area, despite the impression you may get from academic papers (note that a lot of these papers use math to build a sim market, which is completely dislocated from what a researcher needs to do). I feel that, if anyone is bogged down in esoteric math in either area, &lt;a href=&quot;http://arxiv.org/abs/1402.1281&quot; rel=&quot;noreferrer&quot;&gt;their strategy is about to break down&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you primarily need to be good at is data analysis and statistical modelling, and being able to come up with good ideas. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why do you guys think you will be successful without a research background? I have spoken to a few low-latency software engineers who hadn't had research exposure yet and I can give a 100% guarantee that they would not have made a cent if they were out on their own and had to build strategies. Trading is an actual profession and an actual skillset that is not as simple as &quot;adjusting your quotes around the inside levels&quot;. Academic papers aren't going to help with strategy either (I haven't read something that would make money yet).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In summary, you should not be concerned about a lack of math ability (my position still applies if half you guys are math PhDs), you should be concerned about a lack of trading ability. &lt;/p&gt;&#xA;" OwnerUserId="6081" LastEditorUserId="6081" LastEditDate="2014-06-24T00:27:52.683" LastActivityDate="2014-06-24T00:27:52.683" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12769" PostTypeId="2" ParentId="12767" CreationDate="2014-06-24T05:40:44.053" Score="18" Body="&lt;p&gt;The primary quant skill needed to make the market is &lt;strong&gt;optimal control&lt;/strong&gt; (a typical paper is &lt;a href=&quot;http://arxiv.org/abs/1105.3115&quot; rel=&quot;noreferrer&quot;&gt;Guéant, O., L, and J. Fernandez-Tapia (2013, September). Dealing with the inventory risk: a solution to the market making problem. Mathematics and Financial Economics 4 (7), 477-507&lt;/a&gt;), because you need to control your inventory and adjust your quotes accordingly:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;be more aggressive on your long leg&lt;/li&gt;&#xA;&lt;li&gt;and less on your short one.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;But it has to be done with respect to your cost function (how do you valuate the risk of having a position, the cost of your short inventory, the fees, what are you assumptions on the price moves, etc). In reality if you do that for a large institution the risk of your inventory would probably be measured on the whole book of the firm (it adds questions about correlations --thus Epps effect--, etc). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, you will need to &lt;strong&gt;hedge your inventory&lt;/strong&gt;: if you make the market on derivatives, you will need to understand the marginal variations of their value with respect to changes in their underlying (i.e. the &quot;greeks&quot; stuff, see &lt;a href=&quot;http://link.springer.com/article/10.1007/s11147-009-9036-3&quot; rel=&quot;noreferrer&quot;&gt;Stoikov, S. and M. Saglam (2009). Option market making under inventory risk.&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course you need to have some knowledge in microstructure: Kyle (&lt;a href=&quot;http://www.jstor.org/discover/10.2307/1913210?uid=3738016&amp;amp;uid=2&amp;amp;uid=4&amp;amp;sid=21104363615663&quot; rel=&quot;noreferrer&quot;&gt;Kyle, A. P. (1985). Continuous auctions and insider trading. Econometrica 53 (6), 1315-1335.&lt;/a&gt;) and Glosten-Milgrom (&lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/0304405X85900443&quot; rel=&quot;noreferrer&quot;&gt;Glosten, L. R. and P. R. Milgrom (1985, March). Bid, ask and transaction prices in a specialist market with heterogeneously informed traders. Journal of Financial Economics 14 (1), 71-100.&lt;/a&gt;) like literature: adverse selection, market impact, etc.&#xA;And since the devil is in the detail; you need to know order types, trading rules, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, I have a (long) list of papers on quant market making on &lt;a href=&quot;http://www.citeulike.org/user/lehalle/tag/market-making&quot; rel=&quot;noreferrer&quot;&gt;my citeulike account&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2014-06-24T20:08:17.813" LastActivityDate="2014-06-24T20:08:17.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12770" PostTypeId="1" AcceptedAnswerId="12771" CreationDate="2014-06-24T10:54:27.807" Score="5" ViewCount="2756" Body="&lt;p&gt;I see &lt;a href=&quot;https://quant.stackexchange.com/questions/10882/calculate-interest-rate-swap-curve-from-eurodollar-futures-price&quot;&gt;this&lt;/a&gt; posted but no answer given. I think it would be a good idea if we have a question on here to illustrate an example of how to price an interest rate swap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far, I understand that that for a plain vanilla swap, you will need to get the present values of the fixed leg cash flows, and the floating leg cash flows. These legs can then be added or subtracted to give the price of the swap for the buyer/seller.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The difficulty arises when deciding which interest rate to use for:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Discounting fixed leg cash flows&lt;/li&gt;&#xA;&lt;li&gt;Discounting floating leg cash flows&lt;/li&gt;&#xA;&lt;li&gt;Predicting the floating leg coupon reference rate fluctuation&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If Eurodollar futures are supposed to be used, are the different maturity spot rates (100 - quoted price?) simply used to get the implied forward interest rates for all cash flow periods until maturity? These forward rates then used to discount the cash flow legs?&lt;/p&gt;&#xA;" OwnerUserId="6782" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2014-06-25T14:20:00.123" Title="Pricing an interest rate swap using Eurodollar futures" Tags="&lt;pricing&gt;&lt;eurodollars&gt;&lt;interest-rate-swap&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12771" PostTypeId="2" ParentId="12770" CreationDate="2014-06-24T14:21:06.687" Score="3" Body="&lt;p&gt;Two things: 1) The eurodollar implied futures rates need to be convexity-adjusted before they can be used as forward rates (futures rate = forward rate + convexity bias). 2) Discounting should be done using the OIS discount curve, not the LIBOR curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More specifically (and ignoring market conventions such as day count), let's say you're pricing a 1-year swap (6m fixed vs 3m floating) and let's assume that all the Eurodollar futures are perfectly aligned with the floating leg (i.e., there's no stub period and start &amp;amp; end dates are matched). Then step 1 is to compute the implied forward rates from the Eurodollar futures, which are $100 - \text{ED prices} - \text{convexity adjustments}$, where the convexity adjustments can be obtained using simple models or from dealers. Then the par swap rate is solved from&#xA;$$ \frac{c}{2} \cdot d(0.5) + \frac{c}{2} \cdot d(1.0) = F_{0,0.25}\cdot 0.25 \cdot d(0.25) + F_{0.25,0.5}\cdot 0.25 \cdot d(0.5) + F_{0.5,0.75}\cdot 0.25 \cdot d(0.75) + F_{0.75,1}\cdot 0.25 \cdot d(1), $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $c$ is the par coupon rate you're solving for, $F_{t_1,t_2}$'s are the forward rates between $t_1$ and $t_2$, and $d(t)$ is the OIS discount factor from time $t$ back to the settlement date.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2014-06-25T14:20:00.123" LastActivityDate="2014-06-25T14:20:00.123" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12772" PostTypeId="1" AcceptedAnswerId="12784" CreationDate="2014-06-24T14:43:34.297" Score="-1" ViewCount="82" Body="&lt;p&gt;I like to ask a practical question regarding the exercise of European Options:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As we know, one may exercise a European option only at maturity $T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But for example, if the option can be exercised only today at 21:00:00h, it would be impossible to exercise the option at exactly that time for practical reasons. I know there are cash-based options, but with actual delivery of the underlying, it is not a trivial &quot;in-the-money exercise&quot; decision, because you may want to exercise the option to own the asset for other reasons (for example price impact, transaction costs, market access, time preference) and the exact market price to determine in-the-money may be not available (outdated illiquid) or differ across different trading platforms.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;So what exactly happens at maturity of a European option? Is there a timeframe after market closing to decide on the exercise, or is it &quot;in-the-money&quot; automatically tied to some market price?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;When do we actually get the underlying asset after exercising?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If the option is not exercised/vested immediately, this might create some arbitrage opportunity because market price may change in between.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-06-25T05:30:16.933" Title="European Option Technical Exercise" Tags="&lt;options&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12773" PostTypeId="2" ParentId="12751" CreationDate="2014-06-24T15:29:45.023" Score="1" Body="&lt;p&gt;Can you describe what kind of problems you are having? What are the system issues that you are talking about? As long as you understand the limitation of the system, you can always caveat the result by placing some arbitrary 'haircut' to discount the potential error in said limitations&lt;/p&gt;&#xA;" OwnerUserId="9374" LastActivityDate="2014-06-24T15:29:45.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12774" PostTypeId="1" CreationDate="2014-06-24T15:42:34.157" Score="6" ViewCount="3144" Body="&lt;p&gt;I tend to think that hedge funds that actively trade (and most of the ones I have seen trade very actively), don't use optimization methods like &lt;code&gt;MVO&lt;/code&gt; or &lt;code&gt;Black-Litterman&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not only do they need to come up with &lt;code&gt;E(R)&lt;/code&gt; and risk levels for their thousands of positions, but because their portfolio turns over so often, the outputs are pretty much meaningless the next day. Am I correct in this assumption?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IF so, who uses optimization methodologies? Mutual funds? Pension Funds?&lt;/p&gt;&#xA;" OwnerUserId="9374" LastEditorUserId="743" LastEditDate="2014-06-24T19:18:20.410" LastActivityDate="2015-07-03T07:52:13.083" Title="Do hedge fund trading desks use portfolio optimization?" Tags="&lt;optimization&gt;&lt;hedge-fund&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="12775" PostTypeId="1" AcceptedAnswerId="12777" CreationDate="2014-06-24T20:55:38.970" Score="2" ViewCount="222" Body="&lt;p&gt;I can't understand how immediate prices are formulated in stock &amp;amp; currency (Forex) markets.&#xA;I have been informed that every tick means one new deal that closed in current price, but this can't be satisfactory explanation for me, because if some bank for example wants to by a huge amount of stocks or some currency, this amount (in general) will not be freely available as a whole in the market in a unified price (as I think), that is, it should be distributed among many owners/traders/investors,also , it is possible that there will be 10 deals of the same tool in the same time with different prices and amounts, am I right? then how the current price is determined?&lt;/p&gt;&#xA;" OwnerUserId="9375" LastActivityDate="2014-06-27T14:16:15.143" Title="How current prices is formulated in markets?" Tags="&lt;equities&gt;&lt;fx&gt;&lt;price&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12776" PostTypeId="2" ParentId="12775" CreationDate="2014-06-24T21:09:37.920" Score="0" Body="&lt;p&gt;Current price is determinated based on limit orders (passive view on market) laying in order book at exchange.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Order_book_%28trading%29&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Order_book_%28trading%29&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Incoming market orders are matched against limit orders in book using exchange matching engine (regulations)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Matching_engine&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Matching_engine&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6175" LastEditorUserId="6175" LastEditDate="2014-06-24T21:47:31.693" LastActivityDate="2014-06-24T21:47:31.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12777" PostTypeId="2" ParentId="12775" CreationDate="2014-06-24T21:52:48.663" Score="2" Body="&lt;p&gt;On exchanges, there is such orderbook with sufficient amount of limitorders, so when you place an order (market or limit), the &quot;best&quot; limitorders for you will be hitted and change the price last traded price. The price you see is actually just the midpoint between the currently best available bid and ask prices in the orderbook. Therefore, this price might be quite misleading if the orderbook is not sufficiently deep and prices change very fast from small orders.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there comes a large block order, all the limitorders that suffice the orderprice will be executed at once and the market price will jump. Usually especially for forex exchanges, the volume of available limitorders is so large that the price change by a single order is rather small.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are correct that there may be the issue of multiple different orders at once. As today's order systems can usually track orders down to nanoseconds, this should be rather an unlikely case but yes may occur. From my knowledge there are various ways in how to handle the order priority in such case, for example the order with the best price (e.g. highest buy-order) would be executed first as it places more value, or the one with highest volume, or some random order. Also see &lt;a href=&quot;http://www.investopedia.com/study-guide/series-62/trading-securities/priority-exchange-orders/&quot; rel=&quot;nofollow&quot;&gt;http://www.investopedia.com/study-guide/series-62/trading-securities/priority-exchange-orders/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;--&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The price is the midpoint between the best available bid-ask (not all limitorders), and yes it does not consider the actual deepness of these limitorders. For liquid assets this is a rather entirely neglegible issue, but for unliquid stocks socalled 'pennystocks', you will almost surely get a 'worse' price than what is shown when you order because the best limitorder is not deep enough and so the second-best order will be hitted (by a market order, for limitorder it will only be partially filled), and so the displayed new 'best price' changes to the next-best available bid-ask midpoint.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By looking at the orderbook (which is usually not public for this reason), you may indeed predict the price change from your order. But you can not profit from this prediction, because this price change is caused by your own order (with your own order, you loose exactly the price change, so you cannot profit from it); you may try to manipulate though, by creating some price change which is only through a thin orderbook, to cause fear among other traders who then trade aswell, but it is in general not allowed and orderbook usually not public for this reason.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;--&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best bid or ask price respectively, is defined as the highest bid (the best available limitorder at which you would sell) and lowest ask (the cheapest available price at which you would buy) of all available limit orders in the order book.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, Bid and Ask never cross (in particular $bid&amp;lt;ask$ to avoid immediate arbitrage by selling higher and buying lower), because if an order crosses the best bid or ask respectively, it is immediately filled by that best order which hence vanishes, and the second-best unfilled order becomes the new available best bid /ask respectively).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may look at this public Bitcoin-orderbook: &lt;a href=&quot;https://www.bitstamp.net/market/order_book&quot; rel=&quot;nofollow&quot;&gt;https://www.bitstamp.net/market/order_book&lt;/a&gt;&#xA;You see that only small amount of sellers are willing to buy at high prices (bid), or sell at low price respectively (ask), and in the mid of this lowest ask and highest bid would be the currently displayed price. Note that bitstamp shows its price as the last traded price, while at exchanges it is defined as midpoint of best bid-ask because the latest price might actually be long time ago, while the limitorders are always current.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There may be special cases where one would rather use things such as VWAP (volume-weighted-average-price) as displayed price, but for liquid standard assets it would be the midpoint of best bid-ask.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-06-27T14:16:15.143" LastActivityDate="2014-06-27T14:16:15.143" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12778" PostTypeId="1" AcceptedAnswerId="12803" CreationDate="2014-06-24T22:00:17.057" Score="8" ViewCount="2189" Body="&lt;p&gt;I read that the Fundamental Theorem of Asset Pricing states, that a market is arbitrage-free if and only if there exists an equivalent martingale measure Q, under which the discounted asset price process becomes a martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why does the existence of Q matter for arbitragefree property, if we have the physical measure P under which there potentially actually is an arbitrage opportunity?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From my understanding, if the market is not arbitragefree under physical probability measure P, why would it be so just if there exists such theoretical measure Q?&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="2376" LastEditDate="2014-06-25T07:23:54.357" LastActivityDate="2020-01-09T12:54:09.010" Title="Arbitragefree Pricing: Q vs. P" Tags="&lt;probability&gt;&lt;arbitrage&gt;&lt;pricing&gt;&lt;risk-neutral-measure&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="12779" PostTypeId="2" ParentId="12767" CreationDate="2014-06-24T22:58:53.607" Score="9" Body="&lt;p&gt;Unfortunately, the ability and tools to develop a low latency trading system are extremely commoditized and will be insufficient for you to make a living in this field. An overwhelming majority of electronic market makers are staffed 100% by PhDs because trading experience and research compose their primary differentiators, e.g.:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;SIG EMM - 100% PhD.&lt;/li&gt;&#xA;&lt;li&gt;DRW EMM - Almost 100% PhD.&lt;/li&gt;&#xA;&lt;li&gt;Chopper EMM - Only 1 non-PhD.&lt;/li&gt;&#xA;&lt;li&gt;Two Sigma EMM - About 80% PhD.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The list goes on. There are a few shops that hire mainly among those with B.Sc-level mathematics background, but these shops were also all started by former veterans of floor trading and/or early adopters of electronic trading, e.g.:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Optiver&lt;/li&gt;&#xA;&lt;li&gt;Tower Research Capital&lt;/li&gt;&#xA;&lt;li&gt;Virtu Financial&lt;/li&gt;&#xA;&lt;li&gt;GETCO&lt;/li&gt;&#xA;&lt;li&gt;IMC Financial Markets&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;...or late adopters who were former veterans from Citadel, Tower Research, SIG etc. and spun off, e.g.:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Hudson River Trading&lt;/li&gt;&#xA;&lt;li&gt;Jane Street&lt;/li&gt;&#xA;&lt;li&gt;Headlands Technologies&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;One will be very mistaken if he expects to take @lehalle's list of papers and some coding ability across the profitability hurdle. I wouldn't dream of doing so alone even though I wrote an entire custom UDP/TCP layer against reduced architecture in the early stages of my firm. You could downvote and ignore this advice, but I welcome you to inject a few dollars into the market.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="4660" LastEditDate="2014-07-05T08:09:12.760" LastActivityDate="2014-07-05T08:09:12.760" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12780" PostTypeId="1" CreationDate="2014-06-24T23:08:10.970" Score="1" ViewCount="215" Body="&lt;p&gt;This question is from Rebonato's Volatility and Correlation 2nd Edition.  Rebonato states that if $\sigma_T^2T$ is not strictly increasing, it would be simple to set up an arbitrage.  Unfortunately (for me) I can't figure out how to do this.  Could someone please point me in the right direction.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That page in the book can be found in section 3.6.1 on Google Books here: &lt;a href=&quot;http://goo.gl/RC4Wur&quot; rel=&quot;nofollow&quot;&gt;http://goo.gl/RC4Wur&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3510" LastEditorUserId="70" LastEditDate="2014-06-24T23:25:28.400" LastActivityDate="2014-06-25T16:47:01.747" Title="In a Black-Scholes world, why must volatility be strictly increasing in time-to-expiration?" Tags="&lt;black-scholes&gt;&lt;arbitrage&gt;&lt;black&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12781" PostTypeId="2" ParentId="12780" CreationDate="2014-06-24T23:54:57.253" Score="1" Body="&lt;p&gt;The author argues, that the Black Option price increases with $\sigma^2_TT$, which means that if this input would decrease with maturity, and one would have two options, the option with longer maturity would be worth less than the option with shorter maturity. But the option with the longer maturity contains the maturity of the shorter option, so it must be worth at least as much. This is a contradiction: You cant have an option worth less (by decreasing $\sigma^2_TT$) in the model if by nature you have that it must be worth more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More maturity always increases the value of the option, because of its asymmetric payoff you get additional potential gain while your loss over that time is bounded. Any model that does not include this would imply arbitrage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may also argue on the case of constant $\sigma^2_TT$: You cannot have an option with longer maturity, that is worth the same. You would then buy the option with longer maturity and sell the one with shorter maturity, to get more &quot;hedge&quot; for the same price. Nobody would buy the option with the shorter maturity, if you can have a longer maturity for exactly same price, so any such option would vanish/cease to exist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So $\sigma^2_TT$ must be strictly increasing to avoid arbitrage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;--&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a specific arbitrage portfolio, we would need additional assumptions on the dynamics and type of the option. For a European call, if the options with two maturities have same price, we sell the option with shorter maturity and buy the option with longer maturity for it (same price, zero initial value):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At expiration of the first option, if the options are out/at the money, the first option expires worthless, but we can sell the option with the higher remaining maturity immediately to make a profit.&#xA;If the options are in the money, the first option we sold is exercised, but we are hedged with an option that is worth more than the exercise value (intrinsiv value+time value), so we can again sell the option with the higher maturity to finance the exercise of the sold call and receive in addition the time value premium.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is therefore a riskfree arbitrage profit, if $\sigma^2_TT$ was constant over time. If $\sigma^2_TT$ was even decreasing, the call with higher maturity would be even cheaper than the one with shorter maturity, so we would make immediate profit at the beginning, and at the end.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence the Call value must have $\sigma^2_TT$ strictly increasing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For puts and American options the proof would go analogous.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-06-25T16:47:01.747" LastActivityDate="2014-06-25T16:47:01.747" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12782" PostTypeId="1" AcceptedAnswerId="12785" CreationDate="2014-06-25T01:47:23.050" Score="8" ViewCount="1511" Body="&lt;p&gt;With regulators tightening the tether, tradings are shrinking and exotic products are fading out, or as my quant friends told me so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the lag of education to the market, more MFE graduates are entering the market but the desk quants and library quants positions are downsizing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also the Basel is pushing for standard approaches for CVA and Daniel K Tarullo from FED even suggests &lt;a href=&quot;http://www.bis.org/review/r140509d.htm&quot; rel=&quot;noreferrer&quot;&gt;replace in-house VaR calculation&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So is there still future for pricing quants? Is it a bad time to consider entering this area?&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2014-06-25T05:33:18.150" Title="Does pricing quant still have bright future?" Tags="&lt;career&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12783" PostTypeId="2" ParentId="12741" CreationDate="2014-06-25T03:15:06.300" Score="2" Body="&lt;p&gt;If you're more of a Derivatives prices thinker, the drift of the Stock Price under the risk neutral measure is the risk free rate. Which means that the diffusion for the stock price $dS_t = r(S_t, t) dt + \sigma(S_t, t) dW_t$ has a larger drift.&lt;/p&gt;&#xA;" OwnerUserId="9377" LastActivityDate="2014-06-25T03:15:06.300" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12784" PostTypeId="2" ParentId="12772" CreationDate="2014-06-25T05:30:16.933" Score="1" Body="&lt;p&gt;The price of underlying at expiration is determined by &quot;fixing&quot; or &quot;settlement&quot;. Different options on different assets have different fixing processes described by exchanges. This information is provided by exchange at which the product is traded. It is often simply the end-of-day settlement price of the underlying. Sometimes, there is a special trading period during which the prices are aggregated to determine the underlying value (i.e., VIX fixing). You don't need to do anything for it, it is automatically exercised into whatever it is supposed to exercise. &lt;/p&gt;&#xA;" OwnerUserId="5086" LastActivityDate="2014-06-25T05:30:16.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12785" PostTypeId="2" ParentId="12782" CreationDate="2014-06-25T05:33:18.150" Score="8" Body="&lt;p&gt;Of course banks will continue to structure non linear products, other participants to consume them. Thus pricing and hedging them will be needed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the one hand &lt;strong&gt;less exotic products and more &quot;standard&quot; ones&lt;/strong&gt; are needed, giving birth to larger flow desks and business. But on the other hands &lt;strong&gt;regulation change the way to valuate them&lt;/strong&gt; (think about CVA and collateralization in general), modifying the payoffs and demanding to store more details about the products. Regulators and policy makers demand to &lt;strong&gt;do all that faster&lt;/strong&gt;, and to compute risks on more products (clearing more nonlinear products).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an industry, the financial firms reacts by:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;using &lt;strong&gt;software vendors&lt;/strong&gt; more than in house tools; thus quants doing this kind of tasks will be more in software vendors than banks and funds,&lt;/li&gt;&#xA;&lt;li&gt;moving the sophisticated projects from front teams to &lt;strong&gt;risk and IT dept&lt;/strong&gt; (in the latter case in &quot;big data&quot; groups inside IT dept).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;if you join a &lt;strong&gt;vendor&lt;/strong&gt;, you will be needed to be very rigorous and to be able to comply with sophisticated functional specs (and invest time in project management knowledge), you will have access to management roles (more people to synchronize), and potentially have to do client facing. If you are in &lt;strong&gt;risk dept&lt;/strong&gt;, you will be ask to have a boarder view that just implementing Euler scheme, and to use robust models rather than fancy ones, but to partnership with academics and vendors to prototype and study nice ones. If you are in &lt;strong&gt;IT depts&lt;/strong&gt; you will have to mix pricing with big data requirement: more data to use, faster, disseminate to more people.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quants will have to face &lt;strong&gt;other challenges outside of pricing&lt;/strong&gt;: dealing with liquidity at any scale, quant asset management, and big data new challenges (not only use bog data and process them fast, but implement &quot;client relationship management&quot; using facebook like techniques, use open data, etc). But it is another story...&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2014-06-25T05:33:18.150" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12787" PostTypeId="2" ParentId="12723" CreationDate="2014-06-25T07:10:51.867" Score="1" Body="&lt;p&gt;I made a micro-test and the trinomial tree seems to be fast enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;(From my original comment)&lt;/em&gt;&#xA;As described in &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/3540221492&quot; rel=&quot;nofollow&quot;&gt;Brigo &amp;amp; Mercurio illustrate&lt;/a&gt;, a numerical procedure to evaluate the Black and Karasinki model has been presented in Hull and White, &quot;Branching Out&quot;, Risk magazine, 1994. Hull and White make use of a trinomial tree, which may indeed more computationally efficient than Monte Carlo, especially if you have to iterate over the parameter space for calibration purposes. Let me know if you find the original paper by Hull-White or Brigo-Mercurio. &lt;/p&gt;&#xA;" OwnerUserId="6781" LastActivityDate="2014-06-25T07:10:51.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12788" PostTypeId="1" AcceptedAnswerId="12878" CreationDate="2014-06-25T08:47:30.427" Score="15" ViewCount="5796" Body="&lt;p&gt;Self-financing is an important concept in financial product replicating, normally used in pricing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I read about several ways to derive Black-Scholes-Merton (BSM) formula. Seems some approaches actually rely on replicating, implying the self-financing prerequisite. But it turns out that such approaches missed to check the condition!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is my understanding correct? Details as below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Reference:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[German] Helyette Geman, Nicole El Karoui, Jean-Charles Rochet &quot;Changes of Numeraire, Changes of Probability Measure and Option Pricing&quot;  Journal of Applied Probability, Vol. 32, No. 2 (Jun., 1995) , pp. 443-458.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[Shreve] Steven E. Shreve  &quot;Stochastic calculus for finance II&quot;, 2004.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[Hull] John Hull, &quot;Options, Futures, and Other Derivatives&quot;, 2009.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Self-financing&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to [German], a portfolio &#xA;$$\begin{equation*}&#xA;V(t)=\sum_{k=1}^n w_k(t) S_k(t)&#xA;\tag{G-1}&#xA;\end{equation*}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is defined as self-financing if&#xA;$$\begin{equation*}&#xA;dV(t)=\sum_{k=1}^n w_k(t) \,d S_k(t)&#xA;\tag{G-2}&#xA;\end{equation*}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;holds. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A simple example of non-self-financing product would be an American option. Hence, if a deriving of the BSM formula/equation does not exclude &lt;/p&gt;&#xA;&#xA;&lt;p&gt;American options, it probably neglected the self-financing prerequisite.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;BSM Equation and Formula&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As [Shreve] Chapter 4.5.3 put, BSM equation is:&#xA;$$\begin{equation*}&#xA;c_t(t,x)+rxc_x(t,x)+\frac{1}{2}\sigma^2x^2c_{xx}(t,x)=rc(t,x)&#xA;\tag{S-4.5.14}&#xA;\end{equation*}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for all $t\in[0,T)$ and $x\ge 0$, where $c(t,x)$ is the call option price at time $t$ for underlying asset $x$, and $c_t$, $c_x$ are partial differentials.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution of BSM Equation (Shreve 4.5.14) is BSM Formula, as [Shreve] provided in Ch 4.5.4 :&#xA;$$\begin{equation*}&#xA;c(t,x)=xN(d_+(T-t,x))-Ke^{-r(T-t)}N(d_-(T-t,x))&#xA;\tag{S-4.5.19}&#xA;\end{equation*}$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;BSM Formula Derivation #1: from BSM Equation&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[Shreve] provides (S-4.5.19) without touching the detailed steps solving the backward parabolic equation; it only use Exercise 4.9 to show that it  fulfills (S-4.5.14). This is alright. The problem is how [Shreve] establish (S-4.5.14), as excerpted below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Stock price modeled by the geometric Brownian motion is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{equation*}&#xA;\,\text{d}S(t) = \alpha S(t) \,\text{d}t + \sigma S(t) \,\text{d}W(t)&#xA;\tag{S-4.5.1}&#xA;\end{equation*}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Set up the replicating portfolio as&#xA;$$\begin{equation*}&#xA;X(t)=\Delta(t)S(t)+\Gamma(t)M(t)&#xA;\tag{S-4.10.16}&#xA;\end{equation*}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means at each time t, the investor holds $\Delta(t)$ shares of stock. The position &#xA;$\Delta(t)$ can be random but must be adapted to the filtration associated with &#xA;the Brownian motion $W(t), t &amp;gt; 0$. The remainder of the portfolio value, &#xA;$X(t) — \Delta(t)S(t)$, is invested in the money market account. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming constant rate of interest as $r$, one has&#xA;$$\begin{align} &#xA;\,\text{d}X(t) &amp;amp;= \Delta\,\text{d}S  + r(X - \Delta\,S )\,\text{d}t\\ &#xA;&amp;amp;= \Delta (\alpha S \,\text{d}t + \sigma S \,\text{d}W) + r(X - \Delta S )\,\text{d}t\\ &#xA;&amp;amp;= rX\,\text{d}t + \Delta\,(\alpha - r) S \,\text{d}t + \Delta\,\sigma S\,\text{d}W \tag{S-4.5.2}  \\ &#xA;\,\text{d}(e^{-rt}S(t)) &amp;amp;= -re^{-rt}S\,\text{d}t+e^{-rt}\,\text{d}S \\ &#xA;&amp;amp;= (\alpha-r)e^{-rt}S\,\text{d}t + \sigma e^{-rt} S\,\text{d}W  \tag{S-4.5.4}  \\ &#xA;\,\text{d}(e^{-rt}X(t)) &amp;amp;= -re^{-rt}X \,\text{d}t+e^{-rt}\,\text{d}X \\ &#xA;&amp;amp;= \Delta\,(\alpha-r)e^{-rt}S\,\text{d}t + \Delta\,\sigma e^{-rt} S\,\text{d}W \\ &#xA;&amp;amp;= \Delta\,\text{d}(e^{-rt}S(t)) \tag{S-4.5.5}  \\ &#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $c(t,x)$ denote the value of the call option&#xA;at time $t$ if the stock price at that time is $S(t) = x$. [Shreve] says since &quot; Black, Scholes, and Merton argued that &#xA;the value of this call at any time should depend on the time (more precisely, &#xA;on the time to expiration) and on the value of the stock price at that time&quot;, there is nothing random &#xA;about the function $c(t,x)$&#xA;-- I understand this implies the option price is a Markov process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Calculating $\,\text{d}c(t,S(t))$, one has&#xA;$$\begin{align} &#xA;\,\text{d}c(t,S(t)) &amp;amp;= \left[c_t+\alpha Sc_x+\frac{1}{2}\sigma^2S^2c_{xx}\right]dt  + \sigma Sc_x dW(t) \tag{S-4.5.6}  \\ &#xA;\,\text{d}(e^{-rt}c(t,S(t)) &amp;amp;= -re^{-rt}c(t,S(t))\,\text{d}t + e^{-rt}\,\text{d}c(t,S(t)) \\&#xA;&amp;amp;= e^{-rt}[-rc+c_t+\alpha Sc_x+\frac{1}{2}\sigma^2 S^2 c_{xx}]\,\text{d}t \\&#xA;&amp;amp; + e^{-rt} \sigma Sc_x\,\text{d}W \tag{S-4.5.7} \\&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here the trick comes -- [Shreve] says, &quot;a (short option) hedging portfolio starts with some initial capital $X(0)$ and &#xA;invests in the stock and money market account so that the portfolio value &#xA;$X(t)$ at each time $t\in[0, T]$ agrees with $c(t, S(t))$&quot;, this happens if and only if &#xA;$X(0)=c(0,S(0))$ and&lt;br&gt;&#xA;$$\begin{equation*}&#xA;d(e^{-rt}X(t))=d(e^{-rt}c(t,S(t)),\forall t\in [0,T)&#xA;\tag{S-4.5.8}&#xA;\end{equation*}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Comparing (S-4.5.5) and (S-4.5.7), (S-4.5.8) leads to, $\forall t \in [0, T)$,&#xA;$$\begin{align} &#xA;\Delta(t) &amp;amp;= c_x(t,S(t)) \tag{S-4.5.11} \\&#xA;(\alpha-r)Sc_x &amp;amp;= -rc+c_t+\alpha Sc_x + \frac{1}{2}\sigma^2S^2c_{xx}  \tag{S-4.5.12} \\&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally (S-4.5.12) means (S-4.5.14), the BSM equation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, there is a loophole - the self-financing of the replicating portfolio $X(t)$. Actually the first step of (S-4.5.2), or explicitly,&#xA;$$\begin{equation*}&#xA;\,\text{d}X(t) = \Delta\,\text{d}S  + r(X - \Delta\,S )\,\text{d}t&#xA;\tag{S-4.10.9}&#xA;\end{equation*}$$&#xA;implies the self-financing condition (G-2).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[Shreve] Exercise 4.9.10 touches the self-financing topic but does &lt;em&gt;not&lt;/em&gt; prove that $X(t)$  is self-financing. &#xA;Instead, Exercise 4.9.10 only says that the self-financing condition, or (S-4.10.9),  is equivalent to&#xA;$$\begin{equation*}&#xA;S(t)\,\text{d}\Delta(t)+\,\text{d}S(t)\,\text{d}\Delta(t)+M(t)\,\text{d}\Gamma(t)+\,\text{d}M(t)\,\text{d}\Gamma(t)=0&#xA;\tag{S-4.10.15}&#xA;\end{equation*}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and with such condition the Black-Scholes formula (S-4.5.14) stands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, finding two alternative loopholes, doesn't solve either on of them!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To prove a call option fulfills either (S-4.5.9) or (S-4.5.15) need analyze the property of the call option. This was not done in [Shreve]; it only states call option price $c(t,S(t))$ is a Markov process. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, [Shreve] presents &lt;strong&gt;method #1&lt;/strong&gt; in but doesn't exclude BSM equation (S-4.10.14) and consequently BSM Formula (S-4.5.19) to be applied to American options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;BSM Formula Derivation #2: as an expectation under the risk neutral measure&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In [Shreve] Chapter 5.2.4 &amp;amp; 5.3.2 it explains how to derive it as an expectation under the risk neutral measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Define Discount Process as&lt;br&gt;&#xA;$$\begin{equation*}&#xA;D(t):=exp\left\{-\int_0^tR(s)\,\text{d}s\right\}&#xA;\tag{S-5.2.17}&#xA;\end{equation*}$$&#xA;, where $R(t)$ is the adapted interest rate process. Then one has&lt;br&gt;&#xA;$$\begin{equation*}&#xA;\,\text{d}D(t) = -R(t)D(t)\,\text{d}t&#xA;\tag{S-5.2.18}&#xA;\end{equation*}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $V(T)$ is the pay-off of a derivatives at time $T$. The target is to set up the replicating process  $$\begin{equation*}&#xA;X(t)=\Delta(t)S(t)+\Gamma(t)M(t)&#xA;\tag{S-4.10.16}&#xA;\end{equation*}$$&#xA;such that&#xA;$$\begin{equation*}&#xA;X(T) = V(T), a. s.&#xA;\tag{S-5.2.28}&#xA;\end{equation*}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming (S-5.2.28) is possible, similar to (S-4.5.2), one has &#xA;$$\begin{align} &#xA;\,\text{d}X(t)  &amp;amp;= \Delta(t)\,\text{d}S(t) + R(t)(X(t)-\Delta(t)S(t))\,\text{d}t \\ &#xA;  &amp;amp;= RX \,\text{d}t + \Delta (\alpha(t)-R(t))S \,\text{d}t+\Delta \sigma S \,\text{d}W \\ &#xA;  &amp;amp;= RX \,\text{d}t + \Delta \sigma S [\Theta(t)\,\text{d}t + \,\text{d}W(t)]\tag{S-5.2.25} \\&#xA;\end{align}$$&#xA;, where &#xA;$$\begin{equation*}&#xA;\Theta(t)=\frac{\alpha(t)-R(t)}{\sigma(t)}&#xA;\tag{S-5.2.21}&#xA;\end{equation*}$$&#xA;is the market price of risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, similarly, comparable to (S-4.5.5)&#xA;$$\begin{align} &#xA;\,\text{d} (D(t)X(t)) &amp;amp;= \Delta(t) \sigma(t) D(t) S(t) [\Theta(t)S(t)\,\text{d}t + \,\text{d}W(t)] \\ &#xA;  &amp;amp;= \Delta(t) \,\text{d} (D(t)S(t)) \tag{S-5.2.26} \\&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By Girsanov Theorem, one define measure $\tilde {\mathbb{P}}$ by the Radon-Nikodym derivative process&#xA;$$\begin{equation*}&#xA;Z(t) = exp \left\{ -\int_0^t \Theta(u) \,\text{d}W(u) - \frac{1}{2}\int_0^t \Theta^2(u) du \right\}&#xA;\tag{S-5.2.11}&#xA;\end{equation*}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;, under which $\,\text{d}\tilde{W}$ defined as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align} &#xA;\tilde{W} (t) &amp;amp;= W(t) + \int_0^t \Theta(u) du \tag{S-5.2.12}\\ &#xA;d\tilde{W}(t) &amp;amp;= dW(t) + \Theta(t) dt  \\&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is a Brownian Motion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then (S-5.2.26) becomes&#xA;$$\begin{equation*}&#xA;d(D(t)X(t)) = \Delta(t)\sigma(t)D(t)S(t)d\tilde{W}(t)&#xA;\tag{S-5.2.27}&#xA;\end{equation*}$$&#xA;, which means under measure $\tilde{\mathbb{P}}$, $D(t)X(t)$ is a martingale. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So due to Martingale Representation Theorem, (S-5.2.28) is achievable; at the same time,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{equation*}&#xA;D(t)X(t) = \tilde{\mathbb{E}}[D(T)X(T)\mid \mathscr{F}(t)] = \tilde{\mathbb{E}}[D(T)V(T)\mid \mathscr{F}(t)] &#xA;\tag{S-5.2.29}&#xA;\end{equation*}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;, so one can from (S-5.2.29) to define $V(t)$ as&#xA;$$\begin{equation*}&#xA;D(t)V(t) = \tilde{\mathbb{E}}[D(T)V(T) \mid \mathscr{F}(t)], 0\le t\le T&#xA;\tag{S-5.2.30}&#xA;\end{equation*}$$&#xA;or&#xA;$$\begin{equation*}&#xA;V(t) = \tilde{\mathbb{E}}\left[  exp\left\{-\int_t^TR(u)du\right\}V(T) \mid \mathscr{F}(t)\right], 0\le t\le T&#xA;\tag{S-5.2.31}&#xA;\end{equation*}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Applying (S-5.2.31) to call option, notice in this product $V(T) = (S(T)-K)^+$, one has&#xA;$$\begin{equation*}&#xA;c(t, S(t)) = \tilde{\mathbb{E}}[e^{-r(T-t)} (S(T)-K)^+ \mid \mathscr{F}(t)]&#xA;\tag{S-5.2.32}&#xA;\end{equation*}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, stock price  geometric Brownian motion assumption&#xA;$$\begin{equation*}&#xA;\,\text{d}S(t) = \alpha S(t) \,\text{d}t + \sigma S(t) \,\text{d}W(t)&#xA;\tag{S-4.5.1}&#xA;\end{equation*}$$&#xA;leads to&#xA;$$S(t)=S(0)e^{\sigma \tilde{W}(t) + (r-\frac{1}{2}\sigma^2)}$$&#xA;Then after applying such result of $S(t)$ and make use of the normal distribution properties, BSM formula is derived.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem of &lt;strong&gt;Deriving BSM Formula method #2&lt;/strong&gt; is similar to the problem in &lt;strong&gt;Deriving BSM Formula method #1&lt;/strong&gt; -- that from $X(t) = \Delta(t)S(t)+\Gamma(t)M(t)$ one cannot directly get the first step of (S-5.2.25):&#xA;$$dX(t) = \Delta(t)dS(t) + R(t)(X(t)-\Delta(t)S(t))dt $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here actually implies the self-financing condition, which is not checked. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Naturally, the whole deriving does not exclude American options to arrive  (S-5.2.32) and consequently BSM Formula (S-4.5.19) to be applied.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;BSM Formula Derivation #3: by Feynman-Kac Theorem&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[Shreve] introduced this option in Ch 6.4. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, Discounted Feynman-Kac Theorem is introduced. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Theorem 6.4.3  Consider the stochastic &#xA;differential equation &#xA;$$\begin{equation*}&#xA;dX(u) = \beta(u, X(u)) du + \gamma(u, X(u)) dW(u).  &#xA;\tag{S-6.2.1}&#xA;\end{equation*}$$&#xA;Let $h(y)$ be a Borel-measurable function and let $r$ be constant. Fix $T &amp;gt; 0$, and &#xA;let $t \in [0,T]$ be given. Define the function &#xA;$$\begin{equation*}&#xA;f(t, x) = \mathbb{E}^{t,x}  [e^{-r(T-t)}h(X(T))]. &#xA;\tag{S-6.4.3}&#xA;\end{equation*}$$&#xA;(We assume that $\mathbb{E}^{t,x} \mid h(X(T)) \mid &amp;lt; \infty$ for all $t$ and $x$.) Then $f(t,x)$ satisfies &#xA;the partial differential equation &#xA;$$\begin{equation*}&#xA;f_t(t, x) + \beta(t, x)f_x(t, x) + \frac{1}{2}\gamma^2(t, x)f_{xx}(t, x) = rf(t, x)  &#xA;\tag{S-6.4.4}&#xA;\end{equation*}$$&#xA;and the terminal condition &#xA;$$\begin{equation*}&#xA;f(T, x) = h(x),  \forall x  &#xA;\tag{S-6.4.5}&#xA;\end{equation*}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With Discounted Feynman-Kac Theorem ready, it's easy to go ahead. For $V(T) $ defined, and $V(t)=\tilde{\mathbb{E}}[e^{-r(T-t)}h(S(T)) \mid \mathscr{F}(t)]$, naturally there's a $v(t,x)$ so that $V(t)=v(t,S(t))$ and $v(t,x)$ fulfills BSM equation&#xA;$$\begin{equation*}&#xA;v_t+rxv_x+\frac{1}{2}\sigma^2x^2v_{xx}=rv&#xA;\tag{S-6.4.9}&#xA;\end{equation*}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if one applies $V(T) = (S(T)-K)^+$ , the call option boundary constraint, it's easy to see the rest is like &lt;strong&gt;BSM Formula Derivation #1&lt;/strong&gt; -- to solve a backward parabolic equation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem in &lt;strong&gt;BSM Formula Derivation #3&lt;/strong&gt; is, we can define such a $v(t,x)$, however, we still need self-financing condition to say that $c(t,x) = v(t,x)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, it seems, all 3 approaches in [Shreve] deriving BSM formula actaully implies prerequisite of self-financing condition, and neglected it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've also checked John Hull's book [Hull], it's even worse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, Is my understanding correct that [Shreve]'s BSM formula missed the self-financing prerequisite? If so, is there any book on pricing covered this part?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Added after reading the replies below&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you all, especially Brian B. and emcor's long post.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks but I've to say you guys missed my point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me explain why self-financing is pre-required during Shreve's arguments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short, Shreve methods 1 assumes self-financing implicitly, and derives BSM Equation (BSM PDE), based on whicch BSM Formula is derived, or: Self-financing =&gt;  BSM PDE =&gt;  BSM Formula.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My original post was asking: how to prove call option is self-financing? without this first step we can't reach BSM PDE nor BSM Formula. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's why I can't accept @emcor's post as basically actually says &quot;self-financing is fulfilled under the assumed Black-Scholes PDE&quot; , or BSM PDE =&gt; Self-financing. Now this makes up a circular argument: BSM PDE =&gt;  Self-financing (emcore) and Self-financing =&gt; BSM PDE =&gt;  BSM Formula (Shreve).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's examine a bit details in Shreve's step of portfolio replication.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically Shreve is saying the a portfolio is set up as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X(t) = \Delta(t) S(t) + \Gamma(t) M(t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;, and this replicates the call option, so &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X(t) = c(t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;. Then from here after use ito's lemma and argue there's no $dt$ item BSM PDE is set up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For $M(t)$, we always has&#xA;$$dM(t) = r M(t) dt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let's check time $t_1$ and the time $t_2$ shortly after $t_1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to replicate $c(t)$, it's required&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{cases}&#xA;X(t_1) = \Delta(t_1) S(t_1) + \Gamma (t_1) M(t_1)\\&#xA;X(t_2) = \Delta(t_2) S(t_2) + \Gamma (t_2) M(t_2)&#xA;\end{cases}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In otherwords,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dX(t_1) = X(t_2) - X(t_1) = d(\Delta(t_1)S(t_1)) + d(\Gamma(t_1)M(t_1)) \\&#xA;=S(t_1)d(\Delta(t_1)) + \Delta(t_1)d(S(t_1) +d(S(t_1))\cdot d(\Delta(t_1)) \\&#xA; + \Gamma(t_1)d(M(t_1)) + M(t_1)d(\Gamma(t_1)) + d(M(t_1)) \cdot d(\Gamma(t_1))  &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, after the portfolio is adjusted to $X(t_1) = \Delta(t_1) S(t_1) + \Gamma (t_1) M(t_1)$, during the short period from $t_1$ to $t_2$, the portfolio becomes&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X'(t_2) = \Delta(t_1) S(t_2) + \Gamma(t_1) M(t_2)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;, or $$dX'(t_1) = X'(t_2) - X(t_1) = \Delta(t_1) dS(t_1) + \Gamma(t_1) d M(t_1)  $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make such replicating portfolio $X(t)$ makes sense, it must be able to &quot;rebalance&quot; at time $t_2$ from $X'(t_2)$ to $X(t_2)$, in otherwords, $X(t_2)$ shall be equals to $X'(t_2)$, or &#xA;$$dX'(t_1) = dX(t_1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This leads to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S(t_1)d(\Delta(t_1)) + \Delta(t_1)d(S(t_1) +d(S(t_1))\cdot d(\Delta(t_1)) \\&#xA; + \Gamma(t_1)d(M(t_1)) + M(t_1)d(\Gamma(t_1)) + d(M(t_1)) \cdot d(\Gamma(t_1))  &#xA; = \Delta(t_1) dS(t_1) + \Gamma(t_1) d M(t_1) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S(t_1)d(\Delta(t_1))  +d(S(t_1))\cdot d(\Delta(t_1)) &#xA; + M(t_1)d(\Gamma(t_1)) + d(M(t_1)) \cdot d(\Gamma(t_1))   =  0 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Replacing $t_1$ to $t$ one gets&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S(t)d(\Delta(t))  +d(S(t))  d(\Delta(t)) &#xA; + M(t)d(\Gamma(t)) + d(M(t)) d(\Gamma(t))   =  0 $$&#xA;This is exactly (S-4.10.15).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If (S-4.10.15) holds, we can say that $X(t) = X'(t), \forall t$, or all along the way from time $0$ to $T$, the replicating portfolio can rebalance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Only under such condition, we can say &#xA;$$dX(t) = dX'(t) = \Delta(t) dS(t) + \Gamma(t) dM(t) = &#xA;\Delta(t) dS(t) + \Gamma(t) r M(t) dt \\&#xA;= \Delta(t) dS(t) + r (X(t) - \Delta(t) S(t))  dt$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The last one is exactly (S-4.10.9).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, what is self-financing? It means the car does not have leaking tyres; it means the portfolio is well enclosed, the pay-off are up to the market movements, but no one is going to &quot;steal&quot; money from the portfolio or have to add in more money to the portfolio -- it just evolves. The rebalance is only continuously change the composition of the portfolio, not its expected value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To summarize, (S-4.10.9) and (S-4.10.15) are equivalent, they means self-financing. And self-financing is the prerequisite for deriving BSM Equation.&lt;/p&gt;&#xA;" OwnerUserId="2161" LastEditorUserId="2161" LastEditDate="2014-06-29T13:12:30.890" LastActivityDate="2019-11-23T16:09:14.890" Title="Self-financing and Black-Scholes-Merton formula" Tags="&lt;black-scholes&gt;&lt;stochastic-calculus&gt;" AnswerCount="6" CommentCount="10" FavoriteCount="18" ContentLicense="CC BY-SA 3.0" />
  <row Id="12789" PostTypeId="2" ParentId="12774" CreationDate="2014-06-25T09:03:10.973" Score="3" Body="&lt;p&gt;I work on Quant hedge fund. My answer is: YES and NO:) &#xA;Advanced optimization techniques are popular in academia but less useful on the street.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, the answer really depends on which type of strategies you are trading.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;For equities long-short portfolios&lt;/strong&gt;, some level of optimization is needed, partly because they need to trade on large sizes on hundreds of stocks. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Statistical arbitrage guys&lt;/strong&gt; tend to have market-neutral positions, and they need optimization to achieve beta or dollar neutrality. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;For futures trading shops&lt;/strong&gt;, the scope of optimization is rather small. Since contract value of futures is usually large and contract size is integer number only, you don't usually need to use sophisticated optimization technique to decide whether you want to trade 8 lots or 10 lots. In this case, maybe integer programing is more relevant.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;For fundamental guys&lt;/strong&gt;, their position sizing is quite discretionary, and optimization is not usually required.  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="9381" LastActivityDate="2014-06-25T09:03:10.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12790" PostTypeId="2" ParentId="12691" CreationDate="2014-06-25T09:42:46.197" Score="0" Body="&lt;p&gt;The computation of Beta is rather simple. Please try using my following procedures: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;ret_i = ret_{i} - ret_{rf}&#xA;$$&#xA;$$&#xA;ret_b = ret_{benchmark} - ret_{rf}&#xA;$$&#xA;then &#xA;$$&#xA;\beta_{i} = \frac{cov(ret_p, ret_b)}{var(ret_b)}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where  $ ret_b $ is the benchmark return net of risk-free rate, $ret_i$ is the stock return net of risk-free rate, $ cov $ is the covariance operator and $var$ is the variance operator. $\beta_{i}$ is the beta of the $i_{th}$ stock in the portfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case benchmark return is FTSE100 Index, and stock return is the return of a given component stock in this universe. And risk-free rate can be taken as 0 given the low-interest environment of developed markets. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally low beta stocks are less volatile than high beta stocks. Usually large cap stocks tend to have lower beta than small-cap stocks. Beta can be used as a proxy for volatility and riskiness of a security, although they are not equivalent. &lt;/p&gt;&#xA;" OwnerUserId="9381" LastEditorUserId="9381" LastEditDate="2014-06-25T09:54:12.647" LastActivityDate="2014-06-25T09:54:12.647" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12792" PostTypeId="1" CreationDate="2014-06-25T10:14:00.530" Score="3" ViewCount="1892" Body="&lt;p&gt;I trade use a completely automated approach where all signals are generated by proprietary trading strategies. However, recently I encountered an challenging problem: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Imagine we have 3 Strategies that all make 5% return annually with the same volatility and &lt;strong&gt;they rarely trade together&lt;/strong&gt;. &lt;strong&gt;The question is how to make the best use of capital to maximize the portfolio returns.&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;A. The naive approach&lt;/strong&gt; is to allocate 1/3 of cash to each strategy, and we will end up with &#xA;$ 1/3 * 5 + 1/3 * 5 + 1/3 * 5 = 5\% $. This is effectively the weighted average approach. It does have the merit of diversification, but the cash is undoubtedly utilized inefficiently. This is in fact the lower bond of portfolio returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;B. Another approach&lt;/strong&gt; is to try to share the risk capital among the 3 strategies in some efficient way. Ideally, if they never trade together and we are allocating the full capital to each strategy should any signal sets up, then we will end up the upper bond of return, which is $ 5\% * 3 = 15\%$ for the entire portfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In reality, 3 strategies tend to have trades that set up together. So, what do you think is the optimal solution for achieving maximum capital utilization? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Svisstack has provided a good starting point for discussion. Now, I will refine my questions based on his reply:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;How to combine signals efficiently when there are N strategies, shall we keep capital fully invested while weighting each strategy by their performance? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What type of strategies, if combined together, can yield maximum benefits? For example, shall we combine two strategies that are both based on similar hypothesis, similar holding period, or two strategies that rarely traded together regardless of other characteristics?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is it wise to combine 2 strategies that traded on different assets? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="9381" LastEditorUserId="9381" LastEditDate="2014-06-26T02:16:00.203" LastActivityDate="2014-06-26T02:16:00.203" Title="How to combine trading signals to achieve higher capital efficiency?" Tags="&lt;quant-trading-strategies&gt;&lt;trading&gt;&lt;automated-trading&gt;&lt;algorithmic-trading&gt;&lt;trading-systems&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12793" PostTypeId="1" CreationDate="2014-06-25T12:28:42.257" Score="21" ViewCount="6928" Body="&lt;p&gt;&lt;strong&gt;I'm always wondering whether anyone has utilized regime-switching models successfully in forecasting or trading.&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Academia has long discussed this topic in-depth, such as using &lt;a href=&quot;http://econweb.ucsd.edu/~jhamilton/palgrav1.pdf&quot;&gt;Regime Switching models&lt;/a&gt; for detection of abrupt market dislocation or structural changes. Popular techniques include modeling the underlying process as a Markov Process with certain distributions, and use such model to estimate the transition probability matrix. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The premise of this approach is attractive: if we can apply different approaches based on different market regimes, then the modeling process can better reflect the reality.&#xA;However, like any other model, the reliability of such model is not convincing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally, I've tried implementing some Regime-switch models proposed by academics and test their explanatory power for detecting market shifts (such as shift of cycles, volatility levels, etc), but the results are always disappointing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can any fellow friends here share your opinions? &#xA;Cheers. &lt;/p&gt;&#xA;" OwnerUserId="9381" LastEditorUserId="70" LastEditDate="2014-06-25T13:13:17.003" LastActivityDate="2019-03-30T18:38:12.720" Title="Regime-Switching Model for detecting market shifts" Tags="&lt;volatility&gt;&lt;quant-trading-strategies&gt;&lt;automated-trading&gt;&lt;algorithmic-trading&gt;&lt;market-regimes&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="20" ContentLicense="CC BY-SA 3.0" />
  <row Id="12795" PostTypeId="2" ParentId="12792" CreationDate="2014-06-25T14:26:16.397" Score="-1" Body="&lt;p&gt;Can't you combine them with a Black-Litterman model of their covariant risk/return?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.researchgate.net/profile/Petter_Kolm/publication/230329526_Incorporating_Trading_Strategies_in_the_BlackLitterman_Framework/file/3deec519f9ee0c45cd.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.researchgate.net/profile/Petter_Kolm/publication/230329526_Incorporating_Trading_Strategies_in_the_BlackLitterman_Framework/file/3deec519f9ee0c45cd.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This should work well enough, though I would recommend also implementing Idzorek's extension for numerically calculating the appropriate omega matrix based on view confidence as a percentile:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://datalab.morningstar.com/knowledgebase/aspx/files/Step_by_Step_Guide_to_the_Black_Litterman_Model.pdf&quot; rel=&quot;nofollow&quot;&gt;http://datalab.morningstar.com/knowledgebase/aspx/files/Step_by_Step_Guide_to_the_Black_Litterman_Model.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have also been meaning to get around to reading Meucci's book, which apparently covers this sort of thing:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/3642009646&quot; rel=&quot;nofollow&quot;&gt;http://www.amazon.com/Asset-Allocation-Springer-Finance-Textbooks/dp/3642009646&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3491" LastActivityDate="2014-06-25T14:26:16.397" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12796" PostTypeId="2" ParentId="12792" CreationDate="2014-06-25T15:00:45.403" Score="1" Body="&lt;p&gt;Your problem going into maximize trading capital using 3 strategies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Optimal scenario should use all available capital for 3 strategies,&#xA;in way that when only 1 strategy trading then using all available capital,&#xA;when second trying to create trade while first taken all capital, &#xA;then half of capital can be moved from 1 strategy to cover 2 strategy trades &#xA;or 2strategy wait for release capital from 1 strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When third strategy try to get in then same,&#xA;should wait for capital release or capital allocation from 1 and 2 strategy&#xA;should be moved to cover third strategy trades in proper ratio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your scenario when 3 strategies have same performance estimation,&#xA;capital should be spitted equally between active (trading) strategies at every moment.&lt;/p&gt;&#xA;" OwnerUserId="6175" LastActivityDate="2014-06-25T15:00:45.403" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12797" PostTypeId="2" ParentId="235" CreationDate="2014-06-25T16:59:07.893" Score="18" Body="&lt;p&gt;Assume the price follows a lognormal process. We can convert it into a problem of finding the probability of a standard Brownian motion particle starting from $0$ and hitting $x$ before time $t$, or its first passage time $\tau_x$ being less than $t$. This can be derived through the reflection principle. The paths crossing $x$ are exactly paired up by the segment post crossing through mirror reflection about $x$. We divide the set of path crossing $x$ into two groups. The first &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Case 1) No drift. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the strong Markov property, at the moment a path first touches $x$, the probabilities of the particle taking on either of two path mirror reflecting about the line $x$ are the same, therefore the total probability of touching $x$ is twice of that of particle reaching above $x$&#xA;$$P(\tau_x&amp;lt;t) = \frac{2}{\sqrt{2\pi t}}\int_x^\infty e^{-\frac{y^2}{2t}} {\rm d}y=\sqrt{\frac{2}{\pi}}\int_{\frac{x}{\sqrt t}}^\infty e^{-\frac{y^2}{2}} dy={\rm erfc}\Big(\frac{x}{\sqrt{2t}}\Big).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Case 2) The drift is $vt$, where $v$ is a constant. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The probability measure is &#xA;\begin{align}&#xA;dP(y) &amp;amp;= \frac{1}{\sqrt{2\pi}}\exp\Big(-\frac{(y-vt)^2}{2t}\Big)\frac{{\rm d}y}{\sqrt t} \\&#xA;&amp;amp;= \frac{1}{\sqrt{2\pi}}\exp\Big(vy-\frac{1}{2}v^2t\Big)\exp\Big(-\frac{y^2}{2t}\Big)\frac{{\rm d}y}{\sqrt t}.&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The set of paths crossing $x$ can be partitioned into two disjoint subsets, one ends at $t$ above $x$ and the other ends below. The probability $P_1$ of the first set is obtained directly using the first expression above&#xA;\begin{align}&#xA;P_1 &amp;amp;= \frac{1}{\sqrt{2\pi}}\int_x^{\infty}\exp\Big(-\frac{(u-vt)^2}{2t}\Big)\frac{{\rm d}u}{\sqrt t} \\&#xA;&amp;amp;=\frac{1}{\sqrt{2\pi}}\int_{\frac{x}{\sqrt t}-v\sqrt t}^\infty e^{-\frac{y^2}{2}} dy \\&#xA;&amp;amp;= \frac{1}{2}{\rm erfc}\Big(\frac{1}{\sqrt 2}\Big(\frac{x}{\sqrt t}-v\sqrt t\Big)\Big).&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the second set, the paths that end in $[y-dy,y],\, y&amp;lt;x$ is a subset of the set of all the paths that start from $0$ and end in $[y-dy,y],\, y&amp;lt;x$. That former set one-to-one corresponds to the set of paths starting from $0$ ending in $[2x-y,2x-y+dy]$. The second expression for the probability measure indicates we can treat the first exponential as a factor or a random variable dependent only on the final time $t$ and the second a new probability measure. The first factor can also be interpreted as a Radon-Nikodym derivative or Jacobian between two probability measures. This new measure makes any two path sets reflectively symmetric about $x$ have the same measure just as in the driftless case, which allows us to compute the probability of second set  using that of the first set when driftless. So the probability $P_2$ of the second set is&#xA;\begin{align}&#xA;P_2 &amp;amp;= \frac{1}{\sqrt{2\pi}}\int_{-\infty}^x\exp\Big(vu-\frac{1}{2}v^2t\Big)\exp\Big(-\frac{(2x-u)^2}{2t}\Big)\frac{{\rm d}u}{\sqrt t} \\&#xA;&amp;amp;=\frac{e^{2vx}}{\sqrt{2\pi}}\int_{\frac{x}{\sqrt{t}}+v\sqrt t}^\infty e^{-\frac{y^2}{2}} {\rm d}y \\&#xA;&amp;amp;= \frac{e^{2vx}}{2}{\rm erfc}\Big(\frac{1}{\sqrt 2}\Big(\frac{x}{\sqrt t}+v\sqrt t\Big)\Big).&#xA;\end{align}&#xA;Therefore the probability of the particle passing $x$ or the first passage time $\tau_x$ of $x$ less than $t$ is the sum of the above two probability &#xA;$$P(\tau_x&amp;lt;t)=P_1+P_2.$$&lt;/p&gt;&#xA;" OwnerUserId="6686" LastEditorUserId="6686" LastEditDate="2015-03-30T07:40:26.603" LastActivityDate="2015-03-30T07:40:26.603" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12798" PostTypeId="1" CreationDate="2014-06-25T17:59:21.237" Score="3" ViewCount="225" Body="&lt;p&gt;When reading a tutorail on extreme value theory, I once meet the following claim &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Heavy tailed  marginals  are a preferable feature of models for financial time series.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why finanical time series show a pattern of heavy tailed marginals? Are there any economic facts underlying this observation?&lt;/p&gt;&#xA;" OwnerUserId="9343" LastActivityDate="2014-06-26T23:53:19.827" Title="economic facts that causes the financial time series to be heavy tailed" Tags="&lt;volatility&gt;&lt;time-series&gt;&lt;econometrics&gt;&lt;economics&gt;&lt;macro-economics&gt;" AnswerCount="5" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12799" PostTypeId="2" ParentId="12798" CreationDate="2014-06-25T18:06:54.250" Score="1" Body="&lt;p&gt;Extreme events in financial markets, like the crash of 1987, occur more frequently in the real world than a normal distribution would predict. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The economic facts that drive those extreme events are varying. Such extreme declines have been observed over many different time periods (Tulip-mania for instance), which suggests that it is more likely inherent to the fundamental nature of human beings. Nevertheless, such underlying biological forces need some economic conditions to manifest themselves. These are often unique to each specific crash (i.e., the economic conditions behind the crash of 1987 are different than the internet crash are different than the subprime crisis).&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2014-06-25T18:06:54.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12800" PostTypeId="1" CreationDate="2014-06-25T18:52:54.687" Score="2" ViewCount="527" Body="&lt;p&gt;For a call option, we know that the vega is the derivative of the price wrt to the volatility.&#xA;However the volatility, in that context, actually refers to the implied volatility of the specific call contract at this moment, which is inferred from the option price. &#xA;So, knowing this, what is the purpose of the vega ? We are essentially saying &quot;if the implied vol rises by 1%, the price rises by X&quot;, but the cause that will trigger a change in the implied vol is the price of the option itself.&lt;/p&gt;&#xA;" OwnerUserId="1242" LastActivityDate="2014-06-27T00:10:42.647" Title="what is the actual point of vega on real option data" Tags="&lt;options&gt;&lt;derivatives&gt;&lt;greeks&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12801" PostTypeId="2" ParentId="12793" CreationDate="2014-06-25T19:54:59.593" Score="15" Body="&lt;p&gt;&lt;a href=&quot;https://www.windhamcapital.com/&quot; rel=&quot;noreferrer&quot;&gt;Windham Capital Management&lt;/a&gt; is using hidden markov models for their Risk Regime Strategies. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mark Kritzman, who is also CEO, has published an article about the general outline of the strategy (with source code so you can replicate the results!):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regime Shifts: Implications for Dynamic Strategies (corrected August 2012) by M. Kritzman, S. Page, D. Turkington]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Abstract:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Regime shifts present significant challenges for investors because&#xA;  they cause performance to depart significantly from the ranges implied&#xA;  by long-term averages of means and covariances. But regime shifts also&#xA;  present opportunities for gain. The authors show how to apply&#xA;  Markov-switching models to forecast regimes in market turbulence,&#xA;  inflation, and economic growth. They found that a dynamic process&#xA;  outperformed static asset allocation in backtests, especially for&#xA;  investors who seek to avoid large losses.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Edit: The paper is now behind a paywall... if you find a free version pls. let me know in the comments, I will then update the answer.&lt;br&gt;&#xA;Edit2: The following presentation may provide useful: &lt;a href=&quot;http://boston.qwafafew.org/wp-content/uploads/sites/3/2017/01/Regime-Shifts_Turkington_QWAFAFEW.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://boston.qwafafew.org/wp-content/uploads/sites/3/2017/01/Regime-Shifts_Turkington_QWAFAFEW.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2019-03-30T18:38:12.720" LastActivityDate="2019-03-30T18:38:12.720" CommentCount="7" ContentLicense="CC BY-SA 4.0" />
  <row Id="12802" PostTypeId="2" ParentId="12798" CreationDate="2014-06-25T19:58:33.017" Score="3" Body="&lt;p&gt;Volatility changes over time. Even if daily returns are normal, assuming the conditional volatility each day is known, the unconditional distribution of daily returns will have excess kurtosis. For example, if daily returns have a standard deviation of 1%, 90% of the time, and a standard deviation of 3%, 10% of the time, the presence of the high-volatility 3% standard deviation state will cause daily returns to exhibit fat tails. Mixtures of normals can be used to model distributions with tails that are heavier than normal.&lt;/p&gt;&#xA;" OwnerUserId="8228" LastActivityDate="2014-06-25T19:58:33.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12803" PostTypeId="2" ParentId="12778" CreationDate="2014-06-25T21:35:17.723" Score="12" Body="&lt;p&gt;In the derivatives context, &quot;arbitrage free&quot; means &lt;strong&gt;almost surely&lt;/strong&gt; for the probability measure under consideration. This is in opposition with statistical arbitrage used at high frequencies for example. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;More precisely the assumption is that there is no $T\geq 0$ and self-financed portfolio $V$ such that $V_0 = 0$, $P(V_T &amp;lt; 0) = 0$ and $P(V_T &amp;gt; 0) &amp;gt; 0$. This property remains true if we replace $P$ by any equivalent measure $Q$. Simply apply $P(A) = 0 \Leftrightarrow Q(A) = 0$ to $A = \{V_T &amp;lt; 0\}$ and $A = \{V_T &amp;gt; 0\}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have an equivalent martingale measure $Q$, then you can't have arbitrage. Let's prove this. Let $V$ be a self-financed portfolio such that $V_T \geq 0$ $Q$-almost surely and $Q(V_T &amp;gt; 0) &amp;gt; 0$. Write $\widetilde{V}_t = e^{-\int_0^t r_sds} V_t$ then we also have $\widetilde{V}_T \geq 0$ $Q$-almost surely and $Q(\widetilde{V}_T &amp;gt; 0) &amp;gt; 0$ (these properties are invariant under change of numeraire). Since the discounted value $\widetilde{V}$ is a $Q$-martingale, $V_0 = \widetilde{V}_0 = E^Q[\widetilde{V}_T] &amp;gt; 0$. This proves that you can't have an arbitrage strategy under $Q$ so you can't have one under $P$ either. This proves the easy half of the fundamental theorem of asset pricing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you might and should wonder why bother with finding a martingale measure $Q$? The answer is that it is very useful because by definition discounted assets (and all self-financed portfolios) are martingales. So computations of derivatives prices are much easier since the expectation of a martingale at $T$ is equal to its initial value (observable at least in theory on the market). The difference with the real world (the $P$-world) is that you don't need to estimate the drift (return) of the underlying assets (predicting if a stock is going to go up or down on a given day is a very difficult thing to do for deep statistical reasons). If you set jumps aside, the value of an option will only depend on the volatility of the underlying. The difference between the real returns are already priced in the market risk premium $\lambda$ used to define the change from the historial to the risk neutral measure (cf. Girsanov's theorem: $\frac{dQ}{dP}|_{\mathcal{F}_t} = \exp( -\int_0^t \lambda_s dW_s - \frac{1}{2}\int_0^t |\lambda_s|^2 ds)$).&lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2014-06-25T23:48:35.133" LastActivityDate="2014-06-25T23:48:35.133" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12804" PostTypeId="2" ParentId="235" CreationDate="2014-06-25T22:03:12.980" Score="1" Body="&lt;p&gt;The required probability is equivalent to asking: what is the probability that the geometric brownian motion of the underlying touches the strike for the first time before the given time $T$?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A strategy for solving this related to &lt;a href=&quot;https://quant.stackexchange.com/questions/8846/brownian-motion-first-passage-time/9053#9053&quot;&gt;Brownian motion - first passage time&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After transforming from geometric brownian motion to brownian motion via the log, the full distribution of the first passage time of a random walker (with a given drift and vol) to a boundary (which should be $log(K/S_0)$ where $K$ is the strike and $S_0$ is the initial stock price), is given by the Inverse Gaussian Distribution.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The explicit form for the distribution is given here &lt;a href=&quot;http://goo.gl/lzGZ9Y&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://goo.gl/lzGZ9Y&lt;/a&gt;.  Using the notation in that link, the parameters of the IG distribution would be $\mu=log(K/S_0)/d$ and $\lambda=(log(K/S_0))^2/\sigma^2$ where $d, \sigma$ are the drift and volatility of the geometric brownian motion.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, you will want to compute the probability that this random variable, the first passage time of ordinary brownian motion with drift $d$ and volatility $\sigma$ to a fixed boundary at $log(K/S_0)$,  is $&amp;lt;= T$, by straightforward integration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe the CDF is known in closed form (see e.g. &lt;a href=&quot;http://goo.gl/DUK9fh&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://goo.gl/DUK9fh&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="915" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2014-06-25T22:38:17.703" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12805" PostTypeId="2" ParentId="12798" CreationDate="2014-06-26T02:33:08.283" Score="1" Body="&lt;p&gt;A naive reason has been explained by  Nassim Nicholas Taleb in his book titled &lt;a href=&quot;http://en.wikipedia.org/wiki/The_Black_Swan_%28Taleb_book%29&quot; rel=&quot;nofollow&quot;&gt;Black Swan&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a deeper look, one should be aware that no historical data analysis can truly estimate the real tail risk of financial markets. By the same token, standard deviation, max drawdown, expected shortfall, VaR, Conditional Var... No single or combination of such metrics can truly estimate the tail risk. Major News, market shocks and dislocations, randomness, etc can all lead to extreme behaviors and heavily tailed marginals. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I once wrote a thesis on Extreme Value Theory, and my work is basically concerned on modeling the occurrence of large-impact and low-probability extreme events on various domains. And our finding is that almost all extreme events will converge to a &lt;a href=&quot;http://en.wikipedia.org/wiki/Generalized_Pareto_distribution&quot; rel=&quot;nofollow&quot;&gt;Generalized Pareto Distribution&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="9381" LastActivityDate="2014-06-26T02:33:08.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12806" PostTypeId="2" ParentId="12798" CreationDate="2014-06-26T13:40:16.427" Score="0" Body="&lt;p&gt;It appears to be related to behavioral psychology.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &quot;space,&quot; there will be a statistical chance to two asteroids colliding, and a much larger number of near misses. But no asteroid will observe the &quot;near miss&quot; of two other asteroids and adjust its behavior or trajectory accordingly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In human affairs, a &quot;near miss&quot; could produce just the result that was originally missed, as human beings panic and adjust their behavior to increase the possibility of a collision. Thus, &quot;tail events&quot; have to include not just the collisions that would have occurred naturally, but a number of (original) near misses that turned into &quot;hits.&quot;&lt;/p&gt;&#xA;" OwnerUserId="2345" LastActivityDate="2014-06-26T13:40:16.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12808" PostTypeId="2" ParentId="12800" CreationDate="2014-06-26T18:38:07.027" Score="0" Body="&lt;p&gt;As an option trader you may well prefer model and forecast volatility rather than the specific price dynamics of the stock and option contract. This is a straight-forward consequence of the Black-and-Scholes framework (*). If you own an option, knowing vega allows you compute the expected PnL on your position and manage risks with respect to your realized volatility forecasts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(*) As a matter of fact, the real-world stock-price drift is not an input of the B&amp;amp;S formula.&lt;/p&gt;&#xA;" OwnerUserId="6781" LastActivityDate="2014-06-26T18:38:07.027" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12809" PostTypeId="2" ParentId="12800" CreationDate="2014-06-26T19:41:55.763" Score="2" Body="&lt;p&gt;Think of it this way, the change in option premium is roughly the sum of changes due to delta, gamma, theta, rho, and vega. Now for a long dated option, gamma and theta don't change dramatically day to day, and let's say you have delta hedged your option. Then your P&amp;amp;L is mostly just driven by changes in implied vol – i.e., vega.  So vega matters a great deal when you are trying to manage risks of an option book – you can isolate different sources of risk (due to underlying, due to time, due to implied vol) and hedges them accordingly.  Similarly, there are also strategies to trade (almost) purely on implied vol – if you carefully hedge out all the other risks, then your P&amp;amp;L will be completely driven by vega. This, of course, is because of the one-to-one mapping between implied vol and option pmreium, just like you said.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I thought about it more. If you are familiar with bonds, I think they provide a good analogy. As you may know, bond price and bond yields also form 1-to-1 mapping, with &quot;DV01&quot; or &quot;Duration&quot; measuring the sensitivity of bond price to yield changes. The value of &quot;DV01&quot; (or duration) is that they provide a consistent framework for measuring interest rate risks. Two bonds might be trading at very different prices (e.g., if one has much higher coupon than the other), but they may have similar duration, so the two have similar risks. Simply put, bond prices are not particularly meaningful, but bond yields are more comparable (that's why we plot the &quot;yield&quot; curve, not bond &quot;price&quot; curve...), and yield-based risk metrics are also more useful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Options are the same. Prices are not particularly meaningful, while implied vols are more comparable across different options, allowing for easier comparison, hedging, and P&amp;amp;L attribution. As I mentioned above, if you can carefully manage other risks, it's possible to trade vega directly. In fact, we frequently look at stuff like spreads of two implied vols and trade on relative value in this way.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2014-06-27T00:10:42.647" LastActivityDate="2014-06-27T00:10:42.647" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12810" PostTypeId="1" AcceptedAnswerId="12820" CreationDate="2014-06-26T22:06:03.503" Score="4" ViewCount="869" Body="&lt;p&gt;In this paper on p315:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.ssc.upenn.edu/~fdiebold/papers/paper55/DRAfinal.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.ssc.upenn.edu/~fdiebold/papers/paper55/DRAfinal.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They explain that they use Levenberg Marquardt (LM) (along with BHHH) to maximize the likelihood.&#xA;However as I understand it LM can only be used to solve Least Squares (LS) problems?&#xA;Are the LS and MLE solutions the same for this type of problem? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that when the errors are normal like in OLS then the solutions are the same.&#xA;Here the processes being estimated are AR(1) so the errors are normal even though the overall process is not. Can I still treat the MLE and LS solution interchangeably in this situation? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In which case can I just apply LM to solve the the LS solution safe in the knowledge that the optimal LS parameters are also the ones that will solve the MLE problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or does the LM algorithm have to be changed in some way so that it can be applied directly to the MLE estimation? If so how?&lt;/p&gt;&#xA;" OwnerUserId="7077" LastEditorUserId="848" LastEditDate="2014-06-28T08:18:56.540" LastActivityDate="2014-06-28T08:18:56.540" Title="How to apply Levenberg Marquardt to Max Likelihood Estimation" Tags="&lt;stochastic-processes&gt;&lt;optimization&gt;&lt;econometrics&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12811" PostTypeId="1" AcceptedAnswerId="12813" CreationDate="2014-06-26T23:51:22.013" Score="2" ViewCount="125" Body="&lt;p&gt;I am trying to prove that&#xA;$$\lim_{K\searrow0}\frac{P(K,T)}{K} = \mathbb P(S_T=0)$$&#xA;where $P(K,T)$ denotes the put option price with maturity $T$ and strike $K$ for some stock $S$. Assuming interest rates $r=0$ we write&#xA;$$\lim_{K\searrow0}\frac{P(K,T)}{K} = \lim_{K\to0}\frac{\int_0^K(K-S)f(S)dS}{K}$$&#xA;$$= \lim_{K\searrow0} \left(\int_0^Kf(S)dS - \frac1K\int_0^KSf(S)dS\right)$$&#xA;$$= \lim_{K\searrow0} \left(\mathbb P(S_T\le K) - \frac1K\mathbb E[S_T1_{S_T&amp;lt;K}]\right)$$&#xA;where $f(S)$ is the density of $S_T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now $\lim_{K\searrow0} \mathbb P(S_T\le K) = \mathbb P (S_T=0)$, but I am not sure whether it is &quot;obvious&quot; that $\frac1K\mathbb E[S_T1_{S_T&amp;lt;K}]$ tends to zero as $K$ tends to zero.&lt;/p&gt;&#xA;" OwnerUserId="6621" LastEditorUserId="6621" LastEditDate="2014-06-27T10:29:05.083" LastActivityDate="2014-06-27T10:29:05.083" Title="How do I prove that $\lim_{K\searrow0}\frac{P(K,T)}{K} = \mathbb P(S_T=0)$?" Tags="&lt;options&gt;&lt;put&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12812" PostTypeId="2" ParentId="12798" CreationDate="2014-06-26T23:53:19.827" Score="0" Body="&lt;p&gt;Inhomogeneous time/sampling.  Autocorrelation.  Stochastic volatility.  Jumps.  Leverage.  &lt;/p&gt;&#xA;" OwnerUserId="3491" LastActivityDate="2014-06-26T23:53:19.827" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12813" PostTypeId="2" ParentId="12811" CreationDate="2014-06-27T00:36:55.853" Score="4" Body="&lt;p&gt;$$\lim_{K\searrow0}\frac{P(K,T)}{K} = \lim_{K\to0}\frac{\int_0^K(K-S)f(S)dS}{K}$$&#xA;$$= \lim_{K\searrow 0} \left(\int_0^Kf(S)dS - \frac1K\int_0^KSf(S)dS\right)$$&#xA;$$= \lim_{K\searrow 0} \big(\mathbb P(S_T\le K)\big) - Sf(S)\big\vert_{S=K=0}$$&#xA;$$= \mathbb P(S_T=0),$$&#xA;where $f(S)$ is the density of $S_T$.&lt;/p&gt;&#xA;" OwnerUserId="6686" LastActivityDate="2014-06-27T00:36:55.853" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="12815" PostTypeId="1" AcceptedAnswerId="12825" CreationDate="2014-06-27T08:26:57.560" Score="0" ViewCount="48" Body="&lt;p&gt;What is the common point between pricing models on options on Interest Rates and options on Volatility?&lt;/p&gt;&#xA;" OwnerUserId="9396" LastActivityDate="2014-06-27T14:18:24.753" Title="Common point between IR and Vol option pricing models?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;interest-rates&gt;&lt;models&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12816" PostTypeId="1" AcceptedAnswerId="12818" CreationDate="2014-06-27T08:33:46.267" Score="1" ViewCount="292" Body="&lt;p&gt;Which are the two conditions necessary to claim that the future spot price will have as many chances to be above or below the current forward price?&lt;/p&gt;&#xA;" OwnerUserId="9396" LastActivityDate="2015-08-10T16:15:02.023" Title="Future spot price versus current forward price" Tags="&lt;probability&gt;&lt;forward&gt;&lt;spot-rate&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12817" PostTypeId="2" ParentId="12788" CreationDate="2014-06-27T10:11:49.423" Score="7" Body="&lt;p&gt;It is true that the self-financing property of the replicating portfolio seems not explicitly presumed nor shown in Shreve's derivation of the Black-Scholes formula. One may note that a replicating portfolio is by definition a self-financing portfolio which replicates the payoff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem as I see is that Shreve is just suggesting some portfolio and solves the PDE, without actually showing that it is replicating and self-financing. He omits the expression for the weight of the riskfree asset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Self-financing property is fulfilled, and can be shown as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A portfolio &lt;span class=&quot;math-container&quot;&gt;$V_t=\alpha_tS_t+\beta_t B_t$&lt;/span&gt; (for stock &lt;span class=&quot;math-container&quot;&gt;$S_t$&lt;/span&gt; and riskfree bond &lt;span class=&quot;math-container&quot;&gt;$B_t$&lt;/span&gt;) is self-financing iff&#xA;&lt;span class=&quot;math-container&quot;&gt;$$dV_t=\alpha_tdS_t+\beta_tdB_t$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Shreve's definition of self-financing in (G-2) &quot;&lt;span class=&quot;math-container&quot;&gt;$V(t)=\sum_{k=1}^n w_k(t) S_k(t)$&lt;/span&gt;&quot; is rather unclear, the sum here means &lt;span class=&quot;math-container&quot;&gt;$n=2$&lt;/span&gt; with &lt;span class=&quot;math-container&quot;&gt;$S_1(t)=B_t$&lt;/span&gt;, the first asset being a bond, and &lt;span class=&quot;math-container&quot;&gt;$S_2(t)=S_t$&lt;/span&gt;, the stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To replicate a claim &lt;span class=&quot;math-container&quot;&gt;$C(S_t,t)$&lt;/span&gt; by a self-financing portfolio of stock and bond: &lt;span class=&quot;math-container&quot;&gt;$dV_t=dC_t$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The dynamics of &lt;span class=&quot;math-container&quot;&gt;$dC$&lt;/span&gt; can be specified using Ito Lemma on &lt;span class=&quot;math-container&quot;&gt;$C(S_t,t)$&lt;/span&gt; (naturally assuming &lt;span class=&quot;math-container&quot;&gt;$C\in C^2$&lt;/span&gt;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$dC=\partial_tCdt+\partial_sCdS+\frac{1}{2}\sigma^2S_t^2\partial_{SS}Cdt=\partial_SCdS_t+(\partial_tC+\frac{1}{2}\sigma^2S_t^2\partial_{SS}C)dt$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we equate this expression for the option dynamics to explicitly show the self-financing weights: &lt;span class=&quot;math-container&quot;&gt;$dC=\alpha_tS_t+\beta_t B_t$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We show that the Black-Scholes PDE is equivalent to following existing self-financing portfolio, by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$\partial_tC+\frac{1}{2}\sigma^2S_t^2\partial_{SS}C=rC-rS_t\partial_S C$&lt;/span&gt; by BS-PDE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So when &lt;span class=&quot;math-container&quot;&gt;$C$&lt;/span&gt; satisfies the BS-PDE, this means existence of self-financing portfolio, inserting the PDE into &lt;span class=&quot;math-container&quot;&gt;$dC$&lt;/span&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$dC=\partial_SCdS_t+(C-S_t\partial_SC)rdt$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In reference to Shreve's notation, this is equivalent to &lt;span class=&quot;math-container&quot;&gt;$dX(t) = \Delta dS_t +r(X_t-\Delta S_t )dt $&lt;/span&gt; with &lt;span class=&quot;math-container&quot;&gt;$\Delta(t)=\partial_SC$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$X(t)=C_t$&lt;/span&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We further have the bond-dynamics &lt;span class=&quot;math-container&quot;&gt;$dB_t=B_trdt$&lt;/span&gt;, so:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$dC=\partial_SCdS_t+(\frac{C_t}{B_t}-\frac{S_t}{B_t}\partial_SC)dB_t$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, the factors for &lt;span class=&quot;math-container&quot;&gt;$dS_t$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$dB_t$&lt;/span&gt; are exactly the replicating portfolio weights:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$\left(\alpha_t=\partial_SC_t,\,\beta_t=\dfrac{C_t}{B_t}-\dfrac{S_t}{B_t}\partial_SC_t\right)$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, the Black-Scholes PDE implies the above existing self-financing portfolio (which by the boundary condition replicates the final payoff aswell), and the Black-Scholes formula remains valid replicating price (for all 3 approaches).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For American options, the PDE would stay the same, but its boundary conditions would change (as @BrianB posted below), including an optimal exercise free boundary function, at which the option is exercised prior maturity when reached by the stockprice. In particular for an American Put, there is no closed form solution under the required boundary conditions, so the replicating portfolio cannot be determined. For an American Call (without dividends), the solutions are the same as for European Call, because one would not exercise an American Call prior maturity, but rather just sell it to capture the positive time value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As per request, the proof can also be written the other way round:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let &lt;span class=&quot;math-container&quot;&gt;$\left(\alpha_t=\partial_SC_t,\,\beta_t=\dfrac{C_t}{B_t}-\dfrac{S_t}{B_t}\partial_SC_t\right)$&lt;/span&gt; some self-financing portfolio &lt;span class=&quot;math-container&quot;&gt;$V$&lt;/span&gt; to replicate an option &lt;span class=&quot;math-container&quot;&gt;$C(S_t,t)$&lt;/span&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, using the bond-dynamics, &lt;span class=&quot;math-container&quot;&gt;$dB_t=B_trdt$&lt;/span&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$dV=\partial_SCdS_t+(\frac{C_t}{B_t}-\frac{S_t}{B_t}\partial_SC)dB_t=\partial_SCdS_t+(C-S_t\partial_SC)rdt$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From Ito Lemma, we find the dynamics of &lt;span class=&quot;math-container&quot;&gt;$C(S_t,t)$&lt;/span&gt; aswell:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$dC=\partial_tCdt+\partial_sCdS+\frac{1}{2}\sigma^2S_t^2\partial_{SS}Cdt=\partial_SCdS_t+(\partial_tC+\frac{1}{2}\sigma^2S_t^2\partial_{SS}C)dt$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equating &lt;span class=&quot;math-container&quot;&gt;$dC=dV$&lt;/span&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$\partial_SCdS_t+(\partial_tC+\frac{1}{2}\sigma^2S_t^2\partial_{SS}C)dt=\partial_SCdS_t+(C-S_t\partial_SC)rdt$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This implies &lt;span class=&quot;math-container&quot;&gt;$\partial_tC+\frac{1}{2}\sigma^2S_t^2\partial_{SS}C=rC-rS_t\partial_S C$&lt;/span&gt;, which is the BS-PDE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the above self-financing portfolio for &lt;span class=&quot;math-container&quot;&gt;$C(S_t,t)$&lt;/span&gt; implies BS-PDE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The specific form of &lt;span class=&quot;math-container&quot;&gt;$C(S_t,t)$&lt;/span&gt; depends on its particular boundary condition (e.g. &lt;span class=&quot;math-container&quot;&gt;$C(S_T,T)=(S_T-K)^+)$&lt;/span&gt; for a call) to make the portfolio replicating, then &lt;span class=&quot;math-container&quot;&gt;$C$&lt;/span&gt; can be determined as solution of BS-PDE. For American Put, the PDE has boundary conditions that cannot be solved, such that self-financing weights do not exist in closed form.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2019-11-23T16:09:14.890" LastActivityDate="2019-11-23T16:09:14.890" CommentCount="7" ContentLicense="CC BY-SA 4.0" />
  <row Id="12818" PostTypeId="2" ParentId="12816" CreationDate="2014-06-27T10:26:19.210" Score="1" Body="&lt;p&gt;I'm not expert on this field so may not able to answer your question precisely, but I can try the best to offer you some hints. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to the pure &lt;a href=&quot;http://pages.stern.nyu.edu/~sternfin/asangvin/ExpHyp.pdf&quot; rel=&quot;nofollow&quot;&gt;expectations hypothesis&lt;/a&gt;(PEH), forward rates provide unbiased predictions about future spot rates. Even if the PEH can be rejected, various scholars including Fama has provided evidence for the weaker form of this hypothesis. &lt;a href=&quot;http://www1.american.edu/academic.depts/ksb/finance_realestate/mrobe/674/Refs/karolyi.pdf&quot; rel=&quot;nofollow&quot;&gt;Stephen&lt;/a&gt; has also argued that forward rate adjusted for term-premium can be used as a predictor for future spot rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.bde.es/f/webbde/SES/Secciones/Publicaciones/PublicacionesSeriadas/DocumentosTrabajo/97/Fic/dt9715e.pdf&quot; rel=&quot;nofollow&quot;&gt;Francisco de Castro and Alfonso Novales&lt;/a&gt; has also found a robust cointegration relation between forward and future spot rate in the currency market with a unit coefficient, confirms the unbiasedness of the hypothesis. However, he also finds unbiasedness does not imply that the daily forward price is good predictor for future spot rate, as in fact, the opposite is true. This unpredictability suggests a non-stationary risk premium equal to the forward premium, making the implied forward rates to be constantly fluctuating around the true value. &lt;strong&gt;Therefore, if the conintegration relation is true and the conclusion of unpredictability is verified, then there is some support for your claim.&lt;/strong&gt; &lt;/p&gt;&#xA;" OwnerUserId="9381" LastActivityDate="2014-06-27T10:26:19.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12820" PostTypeId="2" ParentId="12810" CreationDate="2014-06-27T11:50:00.887" Score="5" Body="&lt;p&gt;An AR(1), once the time series and lags are aligned and everything is set-up, is in fact a standard regression problem. Let's look, for simplicity sake, at a &quot;standard&quot; regression problem. I will try to draw some conclusions from there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say we want to run a linear regression where we want to approximate $y$ with $$h_(x) = \sum_0^n \theta_i x_i = \theta^T x $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OLS is a special case of a broader family of algorithms where the chosen cost function is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ J(\theta) = \frac{1}{2} \sum_{i=1}^{m} (h_\theta(x_i) - y_i)^2 $$, where $\theta$ are the weights, $y$ is the regressand (features), $x$ the regressor (target variable) and $i$ denotes the $i$th sample element. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We could give a probabilistic interpretation to the above &quot;mechanical&quot; machine learning model.&#xA;We have to write:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ y_i = \theta^T x_i + \epsilon_i$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we assume that $\epsilon_i \sim N(0, \sigma^2)$, we know that &#xA;$$ p(\epsilon_i) = \frac{1}{\sqrt{2 \pi} \sigma} \exp \bigg(-\frac{\epsilon_i^2}{2 \sigma^2} \bigg)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can then write the conditional probability&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ p(y_i | x_i; \theta) = \frac{1}{\sqrt{2 \pi} \sigma} \exp \bigg(-\frac{(y_i - \theta^T x_i)^2}{2 \sigma^2} \bigg)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The likelihood function is then:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ L(\theta) = \prod_{i=1}^m p(y_i | x_i; \theta)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ log L(\theta) = \prod_{i=1}^m \frac{1}{\sqrt{2 \pi} \sigma} \exp \bigg(-\frac{(y_i - \theta^T x_i)^2}{2 \sigma^2} \bigg) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which after some reshuffling becomes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ log L(\theta) = m \log{\frac{1}{\sqrt{2 \pi} \sigma}} - \frac{1}{\sigma^2}\frac{1}{2}\sum_{i=1}^{m}(y_i - \theta^T x_i)^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is in fact exactly the same optimization problem: you can trim the above and leave just the $J(\theta)$ function from the OLS problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q: I know that when the errors are normal like in OLS then the solutions are the same. Here the processes being estimated are AR(1) so the errors are normal even though the overall process is not. Can I still treat the MLE and LS solution interchangeably in this situation?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the derivation above we see that the MLE does not consider $\theta$ as a random variable, as is it otherwise the case in other methodology (Bayesian MAP)&#xA;Therefore, I believe that you could treat MLE and LS interchangeably knowing that errors are normal. For proper inference: BLUE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q: does the LM algorithm have to be changed in some way so that it can be applied directly to the MLE estimation? If so how?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe this is the true as the optimization problem is the same.&lt;/p&gt;&#xA;" OwnerUserId="6781" LastEditorUserId="848" LastEditDate="2014-06-28T08:18:20.727" LastActivityDate="2014-06-28T08:18:20.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12821" PostTypeId="2" ParentId="11182" CreationDate="2014-06-27T12:38:49.897" Score="0" Body="&lt;p&gt;I am not sure if I have correctly understood your problem. But, as you want to detect the market sentiment (bear/bull), you imply that there is extra information in the market that is not included in the stock prices yet. You should then rather use a collective factorization on (on-line) news monitoring, in order to detect previously unknown topics, as you assume that the market (returns) are not aware of the change/do not include the information. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By defining topics based on words related to stocks/economic sectors of interest to you, they will show on as bursts (natural calamities) or periodically (weekly broadcasted TV shows) and the goal is to map the topics discovered at time t+1 with those discovered at time t. Monitoring the textual Yahoo news stream, with the goal of predicting the word distribution for each topic at time t, would be a good starting point, in my opinion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A good paper on this would be &quot;Detect and Track Latent Factors with Online Nonnegative Matrix Factorization&quot; by Bin Cao &amp;amp; all. &lt;/p&gt;&#xA;" OwnerUserId="2872" LastEditorUserId="2872" LastEditDate="2014-06-30T13:46:19.077" LastActivityDate="2014-06-30T13:46:19.077" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12822" PostTypeId="2" ParentId="12788" CreationDate="2014-06-27T13:34:10.307" Score="2" Body="&lt;p&gt;You seem particularly frustrated that these formula derivations are not excluding, e.g., American options.  But keep in mind that, up through the derivation of the PDE, there is nothing in them that assumes a particular payoff condition.  The PDEs such as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{equation*}&#xA;f_t(t, x) + \beta(t, x)f_x(t, x) + \frac{1}{2}\gamma^2(t, x)f_{xx}(t, x) = rf(t, x)  &#xA;\tag{S-6.4.4}&#xA;\end{equation*}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;apply to &lt;em&gt;all&lt;/em&gt; payoffs (satisfying a few conditions), including American options and other exotics.  In particular, it is just as possible to replicate American option value (or, at least, optimally-exercised American option value) with stocks and bonds as it is to replicate European option value within the BSM framework.  I refer you to emcor's carefully constructed answer (which I have upvoted, and recommend you accept) on some of those aspects.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, here's something that will really drive you nuts: what happens when we extend the BSM SDE&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{equation*}&#xA;\,\text{d}S(t) = \alpha S(t) \,\text{d}t + \sigma S(t) \,\text{d}W(t)&#xA;\end{equation*}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to include random jumps&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{equation*}&#xA;\,\text{d}S(t) = \alpha S(t) \,\text{d}t + \sigma S(t) \,\text{d}W(t) -  S(t) \, j(Z(t)) \, d \, \Pi(t)&#xA;\end{equation*}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for a poisson process $\Pi$ and a function of some extra unobserved random process $Z$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, replication becomes impossible due to the unknown jump sizes.  Yet to price options we still use effectively the same PDE derivation.  The economic argument for validity becomes one not of exact replication, but rather of replication converging in distribution to options portfolio value for a dealer holding an $N$-instrument portfolio as $N$ grows large.  (One can also apply economic equilibrium argument with essentially the same mathematical consequences).&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2014-06-27T13:34:10.307" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12824" PostTypeId="1" CreationDate="2014-06-27T13:55:48.730" Score="0" ViewCount="369" Body="&lt;p&gt;I already asked a question related to this here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/12810/how-to-apply-levenberg-marquardt-to-max-likelihood-estimation&quot;&gt;How to apply Levenberg Marquardt to Max Likelihood Estimation&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know understand how Levenberg Marquardt (LM) can be applied to the objective function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the paper on p315:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.ssc.upenn.edu/~fdiebold/papers/paper55/DRAfinal.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.ssc.upenn.edu/~fdiebold/papers/paper55/DRAfinal.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the authors also state that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;We maximize the likelihood by iterating the Marquardt and Berndt–Hall–Hall–Hausman algorithms, using numerical derivatives, optimal stepsize, and a convergence criterion of 10^-6 for the change in the norm of the parameter vector from one iteration to the next.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know what precisely they mean by this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you run the LM fully and then take the optimal parameter set found and use those as initial guesses for the BHHH algorithm, then run the BHHH and take those solutions as initial guesses to the LM and repeat until convergence?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or are they iterating step by step? So you do the same as above but rather than running a full optimization each time, you simply so one step at a time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even your best guesses would be most welcome.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Baz&lt;/p&gt;&#xA;" OwnerUserId="7077" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2014-06-27T14:37:24.750" Title="Combining BHHH and Levenberg Marquardt" Tags="&lt;stochastic-processes&gt;&lt;optimization&gt;&lt;econometrics&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12825" PostTypeId="2" ParentId="12815" CreationDate="2014-06-27T14:18:24.753" Score="0" Body="&lt;p&gt;One common point is that both implied volatility and interest rates come with term structures.   This is exploited by H Buehler in &lt;a href=&quot;http://opus4.kobv.de/opus4-tuberlin/frontdoor/deliver/index/docId/1318/file/buehler_hans.pdf&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt; (and a few of his others).  In particular, in Equation 2.10 he defines a variance curve model $v$ as a martingale represented as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;dv_t(T) = \sum_{j=1}^d \beta^j_t(T) \, dW^j_t&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is more or less the same as the HJM interest rate model.  He then goes on to derive when this can describe a variance curve and how to compute consistent functionals with it, namely that for a process $z$ one has to satisfy a variance-establishing equation like 3.1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\partial_x G = \sum_{i=1}^m \mu_i \partial_{z_i} G +\frac12 \sum_{i,k=1}^m \left( \sum_{j=1}^d \sigma_i^{(j)}  \sigma_k^{(j)}  \right) \partial_{z_i,z_k} G&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I really like all this machinery, though in practice I found it extremely difficult to implement for a volatility exotics trading system.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2014-06-27T14:18:24.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12826" PostTypeId="2" ParentId="12824" CreationDate="2014-06-27T14:37:24.750" Score="1" Body="&lt;p&gt;Well, given that either LM or BHHH is supposed to stop when the &lt;a href=&quot;http://en.wikipedia.org/wiki/Karush%E2%80%93Kuhn%E2%80%93Tucker_conditions&quot; rel=&quot;nofollow&quot;&gt;Kuhn-Tucker condition&lt;/a&gt; is satisfied, I infer it has to be stepwise.  I would say otherwise if, say, they were potentially using something like &lt;a href=&quot;http://www.mat.univie.ac.at/~neum/glopt/mss/DesP96.ps.gz&quot; rel=&quot;nofollow&quot;&gt;SALO&lt;/a&gt; (simulated annealing with local optimization), where one algorithm could profitably run in full as a sub-step of the other.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2014-06-27T14:37:24.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12827" PostTypeId="1" CreationDate="2014-06-27T17:04:16.680" Score="0" ViewCount="190" Body="&lt;p&gt;I would like to know if the dividend yield of and index is correlated with the dividend yields of it's components separately?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The purpose of this, is to use the dividend yield of the index as a proxy in order to estimate the dividend shocks in the context of historical Value At Risk!&lt;/p&gt;&#xA;" OwnerUserId="6189" LastEditorUserId="467" LastEditDate="2015-02-12T06:14:03.343" LastActivityDate="2015-08-11T08:55:07.677" Title="What is the correlation of and Index's dividend yield relative to its constituents?" Tags="&lt;dividends&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12828" PostTypeId="2" ParentId="12788" CreationDate="2014-06-27T18:34:19.653" Score="-2" Body="&lt;p&gt;Shreve did not in my opinion approach the problem rigorously.  The only economically meaningful portfolio is one that is self-financing (in Shreve's words, you cannot decided tomorrow what to invest in today).  However he did not explicitly state in his derivation that the portfolio was self-financing, and that is where I feel he lacks rigor.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Shreve starts his derivation with a portfolio X with dynamics $$dX=\Delta dS_t +r(X_t-\Delta S_t)dt $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A more rigorous approach is the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a market with the following assets:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ S_t, \,\, M_t $$ which satisfy $$ dS=\mu Sdt+\sigma S dW_t, \,\, dM=r M dt $$&#xA;Let X be a portfolio containing S and M:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X_t = \Delta S_t + \Gamma M_t $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Further, let $$d X_t = \Delta dS_t +\Gamma dM_t\,\,(\mathrm{self}\,\, \mathrm{financing}) $$&#xA;$$=\Delta dS_t + r\Gamma M_t dt $$&#xA;Rearranging, $$ \Gamma M_t= X_t-\Delta S_t $$&#xA;Substituting this into the previous equation yields $$dX_t = \Delta dS_t +r(X_t-\Delta S_t )dt $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Shreve's derivation then follows.&lt;/p&gt;&#xA;" OwnerUserId="9402" LastActivityDate="2014-06-27T18:34:19.653" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12830" PostTypeId="1" CreationDate="2014-06-28T02:28:40.930" Score="1" ViewCount="865" Body="&lt;p&gt;Trying to understand which regression model is more popular in retail credit card industry Logistic regression or GLM with Poisson distribution and why?&lt;/p&gt;&#xA;" OwnerUserId="9406" LastEditorUserId="2553" LastEditDate="2015-03-24T16:13:00.570" LastActivityDate="2017-03-15T19:03:11.493" Title="For Probability of Default in retail credit what is more popular logistic regression or GLM with Poisson distribution and why?" Tags="&lt;regression&gt;&lt;credit-risk&gt;&lt;credit-scoring&gt;&lt;poisson&gt;&lt;logit&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12832" PostTypeId="2" ParentId="751" CreationDate="2014-06-28T07:20:20.423" Score="1" Body="&lt;p&gt;&lt;em&gt;std(PPS)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PPS = Packets Per Second (wiki article: &lt;a href=&quot;http://en.wikipedia.org/wiki/Network_packet&quot; rel=&quot;nofollow&quot;&gt;network packets&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The standard deviation of packets per second received from a liquidity source are directly related to the number of quotes per second, or the number of trades per second occurring on that liquidity source.  Thus, the higher the number of network / data packets per second, the more volatility there will be on that specific venue, or the market as a whole.  &lt;em&gt;std(PPS)&lt;/em&gt; can be used as a leading indicator of volatility in a sub-second trading environment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This answer is based on my personal experience of analyzing multiple liquidity providers (data sources) in real-time to predict / mitigate volatility or stressed markets.&lt;/p&gt;&#xA;" OwnerUserId="9407" LastActivityDate="2014-06-28T07:20:20.423" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12835" PostTypeId="1" CreationDate="2014-06-29T00:07:06.463" Score="2" ViewCount="675" Body="&lt;p&gt;I originally thought that you have an orderbook per stock and orders would be filled on the time at which they arrive. Arrive first and you get the best price and the qty in the orderbook is reduced by however large the first order was. Second order arrives, that gets the next best price etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I keep hearing/reading this isn't the case and HFT players in particular get an unfair advantage on order routing/orderbook filling. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could somebody please explain what are these unfair order execution techniques? I am surprised how anything but first-order-gets-filled-first could be legal.&lt;/p&gt;&#xA;" OwnerUserId="6089" LastEditorUserId="467" LastEditDate="2014-06-30T07:56:33.397" LastActivityDate="2014-07-05T02:58:07.570" Title="What are the unfair order execution/routing advantages HFT firms apparently have?" Tags="&lt;high-frequency&gt;&lt;limit-order-book&gt;&lt;order-execution&gt;&lt;order-handling&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12836" PostTypeId="2" ParentId="12835" CreationDate="2014-06-29T00:31:27.557" Score="5" Body="&lt;p&gt;I have heard of several allegations in the recent days, but they are mostly baseless.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, there are a rare, few trading venues whose matching rules are most often accused of giving unfair order execution advantages to certain firms. These usually arise from violations of the standard price-time priority:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.iextrading.com/services/&quot; rel=&quot;noreferrer&quot;&gt;IEX&lt;/a&gt;'s broker priority rule. &quot;All orders will be matched according to price-broker-time priority.&quot; This disadvantages orders with non-broker status.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rules.nyse.com/NYSE/Help/Map/rules-sys77.html&quot; rel=&quot;noreferrer&quot;&gt;NYSE and NYSE MKT's&lt;/a&gt; parity rules. These benefit DMMs and floor brokers, retaining the character and spirit of the NYSE specialist privileges.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Finally, the practice of payment for order flow has also received strong criticism for giving certain firms unfair advantages. It must be noted however that it's a common mistake to identify an order flow internalizer as a &quot;HFT&quot; firm. The leading order flow internalizers (e.g. Wolverine, Morgan Stanley, Citi, UBS) are &lt;strong&gt;not&lt;/strong&gt; conventionally known as &quot;HFT&quot; firms. &lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2014-06-29T00:31:27.557" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12837" PostTypeId="2" ParentId="9827" CreationDate="2014-06-29T21:37:02.813" Score="1" Body="&lt;p&gt;Another way to look at it is that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align} &#xA;\beta &amp;amp;= \frac{cov(R_p,R_M)}{var(R_M)}\\&#xA;&amp;amp;= \rho(R_p,R_M)\frac{\sigma(R_p)}{\sigma(R_M)}&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, the beta is the product of the correlation between your portfolio and the market and the ratio of their volatility. You can then see why the inverse beta is not what you expected.&lt;/p&gt;&#xA;" OwnerUserId="2393" LastActivityDate="2014-06-29T21:37:02.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12839" PostTypeId="2" ParentId="12774" CreationDate="2014-06-30T06:41:46.697" Score="6" Body="&lt;p&gt;Portfolio optimization techniques are used quite a bit by hedge funds. I think you misunderstand how portfolio optimization operates in the context of an active trading strategy. Your question suggests a view of portfolio optimization as a tool to adjust portfolio weights arrived at by a separate, active strategy. Under that approach, you are correct, the weights would no longer be optimal if the active strategies are allowed to turn positions over without any re-optimization of weights.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, there is nothing stopping funds from optimizing their portfolio daily and even intra-day. Also rather than thinking of the trading strategy and portfolio optimizer as distinct systems, consider these as a single, integrated system. The &quot;trading strategies&quot; are really just E(R) (in your symbology). If the view on a stock changes then E(R) changes and the portfolio can be re-optimized to reflect this change. This way, the portfolio optimization is the source of the trade rather than something tacked on afterwards. The more often E(R) change significantly, the more &quot;active&quot; the strategy is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a substantial literature describing portfolio optimization techniques intended for active management. This &lt;a href=&quot;http://people.stern.nyu.edu/lpederse/papers/DynamicTrading.pdf&quot; rel=&quot;noreferrer&quot;&gt;paper&lt;/a&gt; is a nice place to start. The distinguishing characteristic of these approaches is that they account for transaction costs. Absent costs, it is adequate to just compute optimal weights whenever an input changes using standard techniques. Accounting for costs requires us to model how the weights are changing in time, which standard techniques do not address. I also suggest you take a look at the optimal execution literature, as there is much overlap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although many funds do use portfolio optimization with active strategies, there are various reasons why some funds choose not to. Some lack the specialized expertise to formulate and solve the relevant problems quickly and reliably. Many funds reason that finding accurate return forecasts is more important than portfolio risks and so focus their resources on the former. It can also be difficult to get portfolio managers and traders to accept a single optimized solution as they often prefer to have control over their own positions. Lastly and perhaps most importantly, portfolio optimization has a definite stigma attached to it by the practitioner community. I believe the oft committed mistake is in thinking of portfolio optimization as a &quot;turn the crank&quot; procedure rather than as certain general ideas that usually need to be carefully applied to the specific problem domain. &lt;/p&gt;&#xA;" OwnerUserId="3398" LastActivityDate="2014-06-30T06:41:46.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12840" PostTypeId="2" ParentId="334" CreationDate="2014-06-30T07:17:22.260" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Most money is not quantitatively managed, as you point out. If those managers don't use any quantitative methods in their process then it doesn't really matter if MVO is a 50+ or 500+ year old concept. Also, since there are many subtleties to proper application of these techniques to a particular strategy, it is unlikely that a manager would use them if she didn't understand them thoroughly. Among quant managers, the techniques are quite common although they are certainly not universally applied. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You seem to be thinking about this in a bit of a black and white way. A lot of people use these methods so there is a market for software implementations. The universe of potential MVO users includes prop shops, banks, hedge funds, fund of funds, mutual funds, and individuals. This is a diverse set of market participants. There are users and non-users of MVO in all of these groups.  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The basic issue is that MVO can often lead to (provably) worse performance when estimates of returns are too far from realized values. The percentage of money managers that produce numerical return predictions as part of their process is really quite small. Many self-proclaimed quant funds trade mechanical buy-sell rules tuned via back-testing and do not use any explicit models for forecasting. In this context, return predictions are slapped on after-the-fact so that MVO can be attempted. This can create systematic errors in the forecasts that completely undermine the optimization. Proper application of the techniques needs to combine good models of forward returns, sensible constraints, adequate accounting for and modeling of transaction costs, and accurate forecasts of volatilities and correlations. Messing up any of these components can ruin the system. Few managers have the expertise to apply the methods successfully. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3398" LastActivityDate="2014-06-30T07:17:22.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12841" PostTypeId="2" ParentId="12774" CreationDate="2014-06-30T07:35:16.860" Score="4" Body="&lt;p&gt;My experience in statistical arbitrage desks (primarily equities) and CTAs is somehow different than @Simon's. From my perspective, I have used and seen plenty of portfolio optimization tools. However, I have most often operated in a &lt;strong&gt;layered architecture&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A layered architecture is an architecture where independent automated traders are stacked, each and everyone independent from the others. For example, if the desk would only trade stock pairs, in such architecture you would have $n$ automated pair strategies on $n$ different pairs. Every strategy aims for market neutrality, according to the definition of market neutrality most appropriate for the strategy implemented within the trader. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On top of the automated traders there's the porfolio management software which: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;allocates capital between the traders exploiting a portfolio optimization algorithm; Therefore, the input of the optimization problem is not the expected distribution of each single asset returns but the expected distribution of the returns of each trading strategy &lt;/li&gt;&#xA;&lt;li&gt;consolidates orders, netting off positions: a buy order of 10&#xA;SPX from trader A, and a sell order of 5 from trader B will trigger&#xA;a buy order of 5 at porfolio level;&lt;/li&gt;&#xA;&lt;li&gt;manages risks, enforces compliance, etc&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In terms of literature, the most popular portfolio optimization book I have seen on desks is Attilio Meucci's &quot;Risk and Asset Allocation&quot; (Springer, 2009)&lt;/p&gt;&#xA;" OwnerUserId="6781" LastActivityDate="2014-06-30T07:35:16.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12842" PostTypeId="2" ParentId="7964" CreationDate="2014-06-30T07:46:55.687" Score="3" Body="&lt;p&gt;The NFA member brokers report retail account profitability figures quarterly. There is a &lt;a href=&quot;http://forexmagnates.com/exclusive-q1-2014-us-forex-profitability-report-fewer-traders-more-profits/&quot; rel=&quot;nofollow&quot;&gt;site&lt;/a&gt; that aggregates this data to facilitate comparisons. You can look back at the last several reports. You'll see that the correct figure is closer to 65% and that it's quite stable through time.&lt;/p&gt;&#xA;" OwnerUserId="3398" LastActivityDate="2014-06-30T07:46:55.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12843" PostTypeId="2" ParentId="3733" CreationDate="2014-06-30T08:11:11.317" Score="2" Body="&lt;p&gt;This is an pretty general question&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are essentially asking how to estimate the regression function&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Y[t]-Y[t-1] = m(X_i [t], ..., X_p[t]) + \epsilon[t]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;without any additional structure. Here is a basic list of questions to consider. Keep in mind that the more you can guide these procedures with domain knowledge the better your results will likely be.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;A couple of your questions suggest that you suspect many of your $X_i$ are irrelevant to $Y$. You suggest PCA. I think PCA is most useful when the $X_i$ are extremely correlated. If your $X_i$ are not correlated then selection techniques such as LASSO and stepwise regression may provide more insight.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;There are many methods for fitting non-linear forms for $m( )$. Before you launch into these it is useful if you can further restrict the function space. Remember, the set of all non-linear functions in $p$ variables can be vast and many of these functions will fit the data despite being nonsense. Common restrictions include additivity and smoothness.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Some suggestions for fitting $m( )$ include: neural nets, regression trees, boosting, random forests, support vector regression, and multivariate adaptive regression splines. Some of these methods can automatically select variables as part of the fitting process. This avoids the problem with step (1) you point out, namely that those methods are linear and ignore potentially important non-linear relationships.  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3398" LastActivityDate="2014-06-30T08:11:11.317" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12844" PostTypeId="1" CreationDate="2014-06-30T09:11:11.117" Score="2" ViewCount="882" Body="&lt;p&gt;Is there any function for plotting the evolution of portfolio weights over time in r?. I have a matrix of portfolio weights from an equal weighting strategy at rebalancing times and want to plot weights of the stocks  over time on a single plot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for example:you want to backtest equal weight strategy where you allocate weights equally at each rebalancing dates for each stock. I have a matrix of weights:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;             A       B            C       D              E           F&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;2001-12-01 0.03225806 0.03225806 0.03225806 0.03225806 0.03225806 0.03225806&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2002-12-01 0.03225806 0.03225806 0.03225806 0.03225806 0.03225806 0.03225806&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2003-12-01 0.03225806 0.03225806 0.03225806 0.03225806 0.03225806 0.03225806&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2004-12-01 0.03225806 0.03225806 0.03225806 0.03225806 0.03225806 0.03225806&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2005-12-01 0.03225806 0.03225806 0.03225806 0.03225806 0.03225806 0.03225806&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2006-12-01 0.03225806 0.03225806 0.03225806 0.03225806 0.03225806 0.03225806&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2007-12-01 0.03225806 0.03225806 0.03225806 0.03225806 0.03225806 0.03225806&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2008-12-01 0.03225806 0.03225806 0.03225806 0.03225806 0.03225806 0.03225806&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2009-12-01 0.03225806 0.03225806 0.03225806 0.03225806 0.03225806 0.03225806&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2010-12-01 0.03225806 0.03225806 0.03225806 0.03225806 0.03225806 0.03225806&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2011-12-01 0.03225806 0.03225806 0.03225806 0.03225806 0.03225806 0.03225806&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to plot the stocks(A,B,..) on a single plot where the y axis will be the allocatons and x axis the time ie plotting a transition map for weights over time using R&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards&lt;/p&gt;&#xA;" OwnerUserId="9321" LastEditorUserId="9321" LastEditDate="2014-06-30T09:31:00.560" LastActivityDate="2014-06-30T10:31:17.837" Title="Plot Evolution of portfolio weights over time in R" Tags="&lt;equities&gt;&lt;programming&gt;&lt;portfolio-management&gt;&lt;backtesting&gt;&lt;r&gt;" AnswerCount="1" CommentCount="6" ClosedDate="2014-06-30T10:54:27.230" ContentLicense="CC BY-SA 3.0" />
  <row Id="12848" PostTypeId="2" ParentId="12844" CreationDate="2014-06-30T10:31:17.837" Score="1" Body="&lt;p&gt;You can use the &lt;code&gt;zoo&lt;/code&gt; package:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(zoo)&#xA;W &amp;lt;- matrix(rep(0.03225806,66),nrow=11)&#xA;T &amp;lt;- seq(as.Date(&quot;2001-12-01&quot;), as.Date(&quot;2011-12-01 &quot;), &quot;years&quot;)&#xA;M &amp;lt;- read.zoo(data.frame(T,W))&#xA;colnames(M) &amp;lt;- c(LETTERS[1:6])&#xA;plot.zoo(M)&#xA;plot.zoo(M,plot.type = &quot;single&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12" LastActivityDate="2014-06-30T10:31:17.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12849" PostTypeId="2" ParentId="4846" CreationDate="2014-06-30T11:08:48.517" Score="2" Body="&lt;p&gt;This Excel addin is rather simplistic, but its free and easy, I use it privately in Excel: &lt;a href=&quot;https://pmstockquote.codeplex.com/&quot; rel=&quot;nofollow&quot;&gt;https://pmstockquote.codeplex.com/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-06-30T11:08:48.517" CommentCount="0" CommunityOwnedDate="2014-06-30T15:32:03.123" ContentLicense="CC BY-SA 3.0" />
  <row Id="12850" PostTypeId="1" AcceptedAnswerId="12852" CreationDate="2014-06-30T12:19:39.590" Score="2" ViewCount="8593" Body="&lt;p&gt;I hope this question is on-topic. It is not relally a quant question but it is a question that quants in risk management in asset management firms have to answer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the KIID (key investor information document) directive investment funds have to be categorized as market funds, life-cycle funds, structured funds, total return and absolute return funds (see an ESMA paper &lt;a href=&quot;http://www.esma.europa.eu/system/files/10_673.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;) in order to decide about the methodology to calculate the SRRI (synthetic risk reward indicator).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The difference between an absolute return fund and a total return fund is hard to tell in practice. Which are your strongest arguments/relevant traits of the fund that you use to decide?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would you categorize: a multi asset class (stocks, bonds) momentum strategy - how  a multi asset class risk parity strategy? &lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-06-30T13:28:00.783" Title="How to distinguish total return and absolute return funds in the KIID" Tags="&lt;risk-management&gt;&lt;mutual-fund&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12851" PostTypeId="2" ParentId="12835" CreationDate="2014-06-30T13:24:00.583" Score="3" Body="&lt;p&gt;In addition to @madilyn's answer, there is one point that needs to be addressed and that is often called an unfair advantage although it is merely a competitive advantage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take the US Equities market. There are now several venues on which the same symbols are traded. If one HFT acquires information about one symbol in one venue - e.g. due to a limit order being filled - it might try to act upon that information very quickly on the other venues on which it is also active. That may result in surprising behavior to people with little knowledge of market microstructure. For instance, quotes on other venues may be cancelled before every chunk of a single order sent to a broker (and naïvely routed) has reached its venue, resulting in partial fills or slippage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;HFT firms pay dearly for connectivity and colocation and work on very tight profit margins. In return, they get the possibility of making more efficient use of new information than most other market participants. If you take speed away, the vast majority of venues (and the most active ones) do not offer any particular advantage to an HFT than to any other participant. As for speed, it is a matter of access like in any other field, and criticizing HFTs because of that is like arguing that floor traders had an unfair advantage in the days when pit trading was the only way to trade actively. There is a service being provided, people investing time and money to do that, competition driving profits down and costs up. Nothing unfair to it, really.&lt;/p&gt;&#xA;" OwnerUserId="788" LastActivityDate="2014-06-30T13:24:00.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12852" PostTypeId="2" ParentId="12850" CreationDate="2014-06-30T13:28:00.783" Score="2" Body="&lt;p&gt;In general, Absolute Return is from pure price appreciation, Total Return includes all related asset cashflows (dividends, coupons etc.) aswell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to the ESMA document, it has nothing to do with that: A Total Return Fund is a fund with a return target to be achieved at smallest possible (but unbounded) risk, an Absolute Return Fund has a Risk (VaR) limit under which the return is maximized.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A momentum strategy is long-short for maximum return, so its Total Return Fund.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A risk parity strategy defines a maximum risk level, under which the portfolio is then optimized for maximum return, so its Absolute Return Fund.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-06-30T13:28:00.783" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12854" PostTypeId="2" ParentId="2019" CreationDate="2014-06-30T13:53:08.570" Score="4" Body="&lt;p&gt;Paul Wilmott on Quantitative Finance. &lt;/p&gt;&#xA;" OwnerUserId="2872" LastActivityDate="2014-06-30T13:53:08.570" CommentCount="0" CommunityOwnedDate="2014-06-30T13:53:08.570" ContentLicense="CC BY-SA 3.0" />
  <row Id="12855" PostTypeId="1" CreationDate="2014-06-30T15:19:58.520" Score="1" ViewCount="122" Body="&lt;p&gt;Given two random variables $X$ and $Y$ and let $K$ be a constant value. Assume the expectation $\mathbb{E}[X(Y-K)^{+}]$ is given for all possible values of $K\geq 0$. Is there a way to derive the joint probability distribution of $X$ and $Y$ from this??&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The expectation can be written as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}[X(Y-K)^{+}]=\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}x(y-K)^{+}dF(x,y)$$&#xA;and when density exists&#xA;$$=\int_{-\infty}^{\infty}\int_{K}^{\infty}x(y-K)f(x,y)dxdy$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both marginal distributions $F_{X}$ and $F_{Y}$ are known and densities exists as well.&#xA;Is there any way I can derive the joint distribution if the expected value is given for all values of $K$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been stuck on this for a while now, even rough approximations would be of much use to me or a collection of properties that can be solved numerically. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone please help me?&lt;/p&gt;&#xA;" OwnerUserId="7649" LastEditorUserId="9336" LastEditDate="2014-06-30T18:57:09.747" LastActivityDate="2014-06-30T18:57:09.747" Title="Joint distribution from expectations" Tags="&lt;option-pricing&gt;&lt;probability&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12856" PostTypeId="2" ParentId="4022" CreationDate="2014-06-30T16:03:03.803" Score="1" Body="&lt;p&gt;1) JPY yield curve is currently upward sloping, not inverted...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Empirically, an upward sloping yield curve predicts recessions, not an inverted one. See this famous paper &lt;a href=&quot;http://newyorkfed.org/research/current_issues/ci2-7.pdf&quot; rel=&quot;nofollow&quot;&gt;http://newyorkfed.org/research/current_issues/ci2-7.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2014-06-30T16:03:03.803" CommentCount="1" CommunityOwnedDate="2014-06-30T16:03:03.803" ContentLicense="CC BY-SA 3.0" />
  <row Id="12857" PostTypeId="2" ParentId="12855" CreationDate="2014-06-30T16:52:24.407" Score="2" Body="&lt;p&gt;It is not possible to derive the joint distribution from the expectation under the given information here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fact that you have the expectation for all $K$ says nothing about the joint distribution $f(x,y)$ because $K$ just shifts the mean of $Y$ but gives no information on the joint probability for $(x,y)$. You may particularly note if $f(x,y)$ have &gt;1 parameter, it means more degrees of freedom than implied by just given K.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To find the joint distribution from the expectation, we would need at least the actual distribution types of $X$ and $Y$, and information on their dependence.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the above expression is meant as derivative price by riskneutral expected payoff, we may have some additional no-arbitrage conditions but that presumption isnt given here aswell.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-06-30T16:52:24.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12858" PostTypeId="2" ParentId="12855" CreationDate="2014-06-30T18:46:24.990" Score="0" Body="&lt;p&gt;Emcor is correct, especially the part regarding the unmatched number of degrees of freedom between that of the known and unknown functions. We can make the problem even clearer. Your problem is essentially finding density $f(x,y)$ given $\int xf(x,y)dx, \forall y$. This obviously has infinitely many solutions.&lt;/p&gt;&#xA;" OwnerUserId="6686" LastActivityDate="2014-06-30T18:46:24.990" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12859" PostTypeId="1" CreationDate="2014-07-01T08:07:59.590" Score="2" ViewCount="1593" Body="&lt;p&gt;Reworded the question for clarity (see edits for original post):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can one &lt;strong&gt;knowingly&lt;/strong&gt; foresee where a 50/50 prediction model will be profitable? &lt;br&gt;&lt;br&gt; For previous posts: I understand that if I have a 50/50 chance of winning the grand prize for a lottery, it should take two ticket purchases to win (assuming the there is a pattern from an algorithm that hasn't changed between purchases). Obviously this is not a realistic scenario.  &lt;br&gt;&lt;br&gt;I am assuming that each movement is independent of the last, so the only way I see a 50/50 model as profitable is when predicting large moves is successful half the time and stop losses are implemented to cap the losses.  A 50.1-60 / 49.9-40 can be profitable if transaction costs are low, but only under in a high-frequency environment... Although it takes a long time to get from London to Paris taking 6 steps forward and 5 steps back.&lt;/p&gt;&#xA;" OwnerUserId="9365" LastEditorUserId="9365" LastEditDate="2014-07-11T08:40:54.093" LastActivityDate="2014-08-26T04:06:25.053" Title="Implementing A 50/50 Prediction Model Strategy" Tags="&lt;risk&gt;&lt;forecasting&gt;&lt;prediction&gt;" AnswerCount="4" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12860" PostTypeId="2" ParentId="12859" CreationDate="2014-07-01T08:33:07.987" Score="2" Body="&lt;p&gt;A prediction model that is correct $50\%$ of the time can be profitable if the model gains more when it is right than it loses when it is wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could simplify it like this: A trading strategy is profitable if your trades have positive expected value.&#xA;Now suppose that your gains when your model is right equals the losses when your model is wrong.&#xA;If your model is correct $50\%$ of the time your expected value is $0$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you take the costs of opening and closing your positions into account you have to subtract these transaction costs form your gains and add them to your losses.&#xA;Now your expected value of your trading stragey is negative. On average, you lose the transaction costs on each trade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you want to know how much prediction power a model should have to be profitable you could do a simple analysis of the average gains when your model is right and of the losses when your model is wrong. You can back out the prediction power needed from this equation. Then calculate how much prediction power you need in excess of $50\%$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course you could also take into account that transaction costs change with the market environment, that prediction accuracy is subject to estimation error as well as varous other issues.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2014-07-01T08:33:07.987" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12861" PostTypeId="1" CreationDate="2014-07-01T08:51:17.293" Score="5" ViewCount="395" Body="&lt;p&gt;Can Fourier transforms be used to derive the joint probability density function of stochastic interest rates and stock price Brownian motions of call options under stochastic interest rates?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So lets say we have for the interest rate the following process&#xA;$$dr(t)=\lambda(\theta-r(t))dt+\sigma^{r}dW^{r}(t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and for the stock process&#xA;$$dS(t)=r(t)S(t)dt+\sigma^{S}S(t)dW^{S}(t)$$&#xA;A regular vanilla call option price is then given as&#xA;$$\mathrm{Call}(t,K)=\mathbb{E}^{Q}\left[e^{-\int_{0}^{t}r(s) ds}(S(t)-K)^{+}\right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can the joint density $f(W^{r}(t),W^{S}(t))$ be derived from call option prices by use of the Fourier Transform?&lt;/p&gt;&#xA;" OwnerUserId="7649" LastEditorUserId="848" LastEditDate="2014-07-01T19:50:18.447" LastActivityDate="2014-07-01T22:31:56.817" Title="Using Fourier Transforms for stock option pricing with stochastic interest rates" Tags="&lt;options&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12862" PostTypeId="2" ParentId="11182" CreationDate="2014-07-01T09:30:35.823" Score="2" Body="&lt;p&gt;In the chapter that deals with NMF of the book &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0596529325&quot; rel=&quot;nofollow&quot;&gt;&quot;Programming collective intelligence&quot;&lt;/a&gt; , the author did NMF on several stock trading volumes and found some comovement. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I &lt;a href=&quot;http://scholar.google.com/scholar?q=NMF%20in%20stock&amp;amp;hl=en&amp;amp;btnG=Search&amp;amp;as_sdt=1%2C5&amp;amp;as_sdtp=on&quot; rel=&quot;nofollow&quot;&gt;googled&lt;/a&gt; a little. &lt;a href=&quot;http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=5304773&amp;amp;tag=1&quot; rel=&quot;nofollow&quot;&gt;This&lt;/a&gt; did NMF on 40 chinese stock close prices. &lt;a href=&quot;http://link.springer.com/chapter/10.1007/978-3-642-35527-1_43&quot; rel=&quot;nofollow&quot;&gt;This&lt;/a&gt; developed A variant of nonnegative matrix factorization for Stock Trend Extraction.  Another &lt;a href=&quot;http://scholar.google.com/scholar?start=10&amp;amp;q=nonnegative%20matrix%20factorization%20in%20stock&amp;amp;hl=en&amp;amp;as_sdt=0,5&quot; rel=&quot;nofollow&quot;&gt;google&lt;/a&gt; found &lt;a href=&quot;http://www.researchgate.net/publication/241740301_Analysis_of_Financial_Data_Using_NonNegative_Matrix_Factorization/file/3deec5295f56be34d2.pdf&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; also did NMF on stock close prices. &lt;a href=&quot;http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=6341758&quot; rel=&quot;nofollow&quot;&gt;This&lt;/a&gt; develops a method of Automatic Relevance Determination with demonstration on stock prediction task.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my opinion, for these unsupervised learning methods such as NMF, you may need to seek hard to find the interpretation of latent factors. They might perform very well on some data, while totally meaningless in some other. They are good tools to help you explore the probable factors that affecting the outcome.&lt;/p&gt;&#xA;" OwnerUserId="5427" LastEditorUserId="5427" LastEditDate="2014-07-01T12:47:45.750" LastActivityDate="2014-07-01T12:47:45.750" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12863" PostTypeId="2" ParentId="12861" CreationDate="2014-07-01T12:52:25.643" Score="5" Body="&lt;p&gt;You have there an &lt;strong&gt;incomplete market model&lt;/strong&gt;, because the risky asset contains two sources of risk $W^S,W^r$ , which means that the option price cannot be hedged by a riskfree portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For such models, $Q$ has infinitely many solutions which means you cannot find the joint density in &lt;em&gt;any&lt;/em&gt; way.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-07-01T12:52:25.643" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12864" PostTypeId="1" AcceptedAnswerId="12866" CreationDate="2014-07-01T13:59:12.853" Score="2" ViewCount="542" Body="&lt;p&gt;I'm trying to experiment with a simulated simple arbitrage strategy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not doing this to actually invest, I'm just curious if the market is inefficient enough for this to be feasible. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Every morning, I take the top 5 gainers and losers as per Google Finance, then record in excel what my balance would be if I shorted the gainers and bought the losers. My &quot;trades&quot; are each for $200,000 worth of stock. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because I am going both long and short 1 million dollars, on paper It looks like my shorts pay for my longs and I only have to pay for trade fees and whatever the loss might be at the end of the day. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How much capital would you actually need to do this? Nobody would just let you start shorting stocks to raise money (I think), so how much would you need to run this strategy? If you start with 0 dollars, any returns would leave you with an infinite growth rate.  How else could you calculate return?&lt;/p&gt;&#xA;" OwnerUserId="8231" LastActivityDate="2014-07-01T20:04:11.860" Title="How Much Capital is Needed to Start an Arbitrage Strategy?" Tags="&lt;equities&gt;&lt;trading&gt;&lt;arbitrage&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12866" PostTypeId="2" ParentId="12864" CreationDate="2014-07-01T14:16:58.070" Score="2" Body="&lt;p&gt;Excluding trade costs (which is a big assumption), you would need to consider margin..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.finra.org/Investors/smartInvesting/AdvancedInvesting/MarginInformation/p005922&quot; rel=&quot;nofollow&quot;&gt;http://www.finra.org/Investors/smartInvesting/AdvancedInvesting/MarginInformation/p005922&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming 1MM Short with 25% margin, you would need 250K in a margin account.  This would be marked to market and you might get a margin call if your shorts climb.&lt;/p&gt;&#xA;" OwnerUserId="8201" LastActivityDate="2014-07-01T14:16:58.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12867" PostTypeId="2" ParentId="12859" CreationDate="2014-07-01T18:59:46.940" Score="-1" Body="&lt;p&gt;Expected = win rate * avg winner + (1 - win rate) * avg loser - trading costs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if win rate = 1/2; avg winner = 10; avg loser = -5; trading cost = 1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E = 5 - 2.5 - 1 = 1.5&lt;/p&gt;&#xA;" OwnerUserId="5332" LastActivityDate="2014-07-01T18:59:46.940" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12868" PostTypeId="1" CreationDate="2014-07-01T19:27:58.260" Score="5" ViewCount="810" Body="&lt;p&gt;In the paper &lt;a href=&quot;http://www.him.uni-bonn.de/uploads/media/pas_or.pdf&quot; rel=&quot;nofollow&quot;&gt;Response to Paul A Samuelson letters and papers onthe Kelly Capital Growth Investment Strategy&lt;/a&gt; pages 5 and 6 Dr William T Ziemba, gives a praticle example on Kelly Growth.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I’m trying to replicate the simulation explained there on R :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step 1 : Create the Table as da Data.Frame&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Win.Prob &amp;lt;- c(0.57,0.38,0.285,0.228,0.19)&#xA;Odds &amp;lt;- c(&quot;1-1&quot;,&quot;2-1&quot;,&quot;3-1&quot;,&quot;4-1&quot;,&quot;5-1&quot;)&#xA;Implied.Odds &amp;lt;-c(0.5,0.333,0.25,0.2,0.167)&#xA;Edge &amp;lt;- c(0.07,0.0467,0.035,0.028,0.0233)&#xA;Advantage &amp;lt;- c(0.14,0.14,0.14,0.14,0.14)&#xA;Opt.Kelly &amp;lt;- c(0.14,0.07,0.0467,0.035,0.028)&#xA;Prob.Chose.Bet &amp;lt;- c(0.1,0.3,0.3,0.2,0.1)&#xA;Cum.Prob.Bet &amp;lt;- c(0.1,0.4,0.7,0.9,1)&#xA;Kelly.Example &amp;lt;- data.frame(Win.Prob,Odds,Implied.Odds,Edge,Advantage,Opt.Kelly,Prob.Chose.Bet,Cum.Prob.Bet)&#xA;remove(Win.Prob,Odds,Implied.Odds,Edge,Advantage,Opt.Kelly,Prob.Chose.Bet,Cum.Prob.Bet)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step 2 : Create the function that replicates the simulation&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Initiate the function that takes 3 variables (Initial Wealth, Decision Points, Number of Simulations)&#xA;&#xA;kelly.simulation &amp;lt;- function(InitialWealth,SimulationNumber,SimulationSteps,KellyFraction) {&#xA;&#xA;  #Initiate a Matrix that generates SimulationSteps*SimulationNumber random numbers and Attribute to the Bet choice&#xA;  simu_bets &amp;lt;- matrix(sample.int(5, size = SimulationSteps*SimulationNumber, replace = TRUE, prob = c(.1,.3,.3,.2,.1)),nrow=SimulationSteps,ncol=SimulationNumber)&#xA;&#xA;  #Take the chosen bet in simu_bets and create a new matrix of Optimal Kelly Bets based on the table in Kelly.Example&#xA;  simu_kellybets &amp;lt;- ifelse(simu_bets == 1,Kelly.Example$Opt.Kelly[1],&#xA;                           ifelse(simu_bets == 2,Kelly.Example$Opt.Kelly[2],&#xA;                              ifelse(simu_bets == 3,Kelly.Example$Opt.Kelly[3],&#xA;                                         ifelse(simu_bets == 4,Kelly.Example$Opt.Kelly[4],Kelly.Example$Opt.Kelly[5]))))&#xA;&#xA;  #Take the chosen bet in simu_bets and create a new matrix of Winning Probability based on the table in Kelly.Example&#xA;   simu_prob &amp;lt;- ifelse(simu_bets == 1,Kelly.Example$Win.Prob[1],&#xA;                      ifelse(simu_bets == 2,Kelly.Example$Win.Prob[2],&#xA;                         ifelse(simu_bets == 3,Kelly.Example$Win.Prob[3],&#xA;                                    ifelse(simu_bets == 4,Kelly.Example$Win.Prob[4],Kelly.Example$Win.Prob[5]))))&#xA;&#xA;  #Generate a new matrix of random number and compare to the prob of winning 1 means you won the bet 0 means you lost&#xA;  simu_rnd &amp;lt;- matrix(runif(SimulationSteps*SimulationNumber,0,1),nrow=SimulationSteps,ncol=SimulationNumber)&#xA;  simu_results &amp;lt;- ifelse(simu_prob&amp;gt;=simu_rnd,1,0)&#xA;&#xA;  #Generate a new matrix simu_results * simu_bets and creat the wealth simulation over each timestep&#xA;  bet_combined &amp;lt;- simu_results * simu_bets&#xA;  bet_combined[bet_combined==0] &amp;lt;- -1&#xA;  multiplier &amp;lt;- 1 + simu_kellybets * bet_combined*KellyFraction&#xA;  Wealth_Matrix &amp;lt;- apply(rbind(InitialWealth, multiplier), 2, cumprod)&#xA;  row.names(Wealth_Matrix) &amp;lt;- NULL &#xA;&#xA;  #return the variation of wealth over each step for the defined number of simulations (Rows = Each Bet Decision Point / Column = Each simulation)&#xA;  return(Wealth_Matrix)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step 3 : Run the Simulation and Attribute the Resulting Matrix to a Variable called &lt;em&gt;kelly.sim&lt;/em&gt; with 700 steps and 1000 simulations and Fraction = 1&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; kelly.sim &amp;lt;- kelly.simulation(InitialWealth=1000,SimulationNumber=1000,SimulationSteps=700,KellyFraction=1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step 4 : Check the results of the last row of the simulations (in the example row number 701)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;max(kelly.sim[701,])&#xA; [1] 47800703&#xA;mean(kelly.sim[701,])&#xA; [1] 270680.9&#xA;min(kelly.sim[701,])&#xA; [1] 3.377048&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In your oppinion these code replicates the simulation described in the paper ?&lt;/p&gt;&#xA;" OwnerUserId="9257" LastEditorUserId="9257" LastEditDate="2014-07-11T14:58:31.573" LastActivityDate="2015-04-17T17:20:17.233" Title="Kelly Capital Growth Investment Strategy (Example in R)" Tags="&lt;r&gt;&lt;simulations&gt;&lt;kelly-criterion&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12869" PostTypeId="2" ParentId="12861" CreationDate="2014-07-01T22:31:56.817" Score="2" Body="&lt;p&gt;There are a couple ways I can think to approximate this from market data, but none use Fourier transforms.  &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Assuming that you have specified the processes under the risk neutral measure (since S is presumably under the risk neutral measure I am assuming that r is specified under the risk neutral measure) then you can calibrate the parameters to the market (for example, by minimizing the squared error over the unknown parameters).  Given the parameters you can  compute the (market implied) joint density, if not analytically than by solving the Focker-Plank equation numerically.  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Augment the market with a risk free bond.  Then you can price the option under the forward measure.  Taking the second derivative with respect to the strike recovers the  forward density of the stock (See the discussion &lt;a href=&quot;https://quant.stackexchange.com/questions/413/on-recovering-probability-distributions-from-option-prices-how-to-subtract-i&quot;&gt;here&lt;/a&gt; for an example of how to do this).  This doesn't recover the joint density but does allow pricing of any european option with the same expiry date.  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you are after the risk-neutral covariance between the two process one can augment the market to include forward and future contracts.  Let $f=\tilde{\mathbb{E}}[S_T]$ be the future price and $F=\frac{S_0}{B(0, T)}$ be the forward price where $B(0, T)=\tilde{\mathbb{E}}[e^{-\int_0 ^T r(s) ds}]=\tilde{\mathbb{E}}[D(0, T)]$  is the price of a zero-coupon default-free bond.  Then clearly Cov(S, D)=$\tilde{\mathbb{E}}[S_T D(0, T)]-\tilde{\mathbb{E}}[S_T]\tilde{\mathbb{E}}[D(0, T)]=S_0-fB(0, T)$. This is greater than zero if and only if $S_0&amp;gt;fB(0, T)$ which is equivalent to $F&amp;gt;f$.  So if the forward price is larger than the future price the correlation between S and D is positive, or equivalently, S and r are negatively correlated.  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="9403" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2014-07-01T22:31:56.817" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12871" PostTypeId="1" AcceptedAnswerId="14010" CreationDate="2014-07-02T04:08:03.197" Score="1" ViewCount="719" Body="&lt;p&gt;I believe inflation is greatly affecting my sample data, even when using percent-changes for movements.  I have read &lt;a href=&quot;http://www.herc.research.va.gov/resources/faq_a03.asp&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; post, which recommends the formula ((Current-Base Year CPI) * Price) / (Historical Year CPI)  - and uses the U.S Consumer Price Index For All Urban Consumers. However, there are many of these indexes (Apparel, Energy, Housing, etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the standard practice for quants, and is this even necessary?  (I see no other questions on this stack, and this post earned me a tubmleweed).&lt;/p&gt;&#xA;" OwnerUserId="9365" LastEditorUserId="9365" LastEditDate="2014-07-11T08:51:33.353" LastActivityDate="2014-07-11T18:02:07.753" Title="How To Account For Inflation Over Historical Data" Tags="&lt;forecasting&gt;&lt;historical-data&gt;&lt;inflation&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12872" PostTypeId="1" CreationDate="2014-07-02T04:14:44.197" Score="1" ViewCount="506" Body="&lt;p&gt;I want to learn about the latest methods used to measure credit risk, which I believe is same as counterparty risk. Can you please direct me some links for this. I have come across a few of them but each of them seems to be talking a different way to measure counterparty risk. eg basel-3 .&lt;/p&gt;&#xA;" OwnerUserId="9430" LastEditorUserId="467" LastEditDate="2014-07-13T17:38:18.650" LastActivityDate="2014-09-12T02:31:27.297" Title="Counterparty risk tutorials" Tags="&lt;credit-risk&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12873" PostTypeId="2" ParentId="12661" CreationDate="2014-07-02T05:55:41.093" Score="4" Body="&lt;p&gt;$$&#xA;E\left[ {{y_t}|{{\cal F}_{t - 1}}} \right] = E\left[ {{\sigma _t}{z_t}|{{\cal F}_{t - 1}}} \right] = {\sigma _t}E\left[ {{z_t}} \right] = 0&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;{\mathop{\rm var}} \left[ {{y_t}|{{\cal F}_{t - 1}}} \right] = {\mathop{\rm var}} \left[ {{\sigma _t}{z_t}|{{\cal F}_{t - 1}}} \right] = \sigma _t^2{\mathop{\rm var}} \left[ {{z_t}} \right] = \sigma _t^2&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;{y_t}|{{\cal F}_{t - 1}} \sim {\cal N}\left( {0,\sigma _t^2} \right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you are right in your conclusion. Unconditional variance is a constant&#xA;$$&#xA;E\left[ {y_t^2} \right] = E\left[ {E\left[ {y_t^2|{{\cal F}_{t - 1}}} \right]} \right] = E\left[ {\sigma _t^2} \right] = {\sigma ^2} \\&#xA;{\sigma ^2} = \omega \left( {1 - \alpha  - \beta } \right) + \alpha {y ^2} + \beta {\sigma ^2}\\&#xA;{\sigma ^2} = \frac{{\omega \left( {1 - \alpha  - \beta } \right)}}{{1 - \left( {\alpha  + \beta } \right)}}&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="2142" LastEditorUserId="7078" LastEditDate="2014-07-15T23:38:41.067" LastActivityDate="2014-07-15T23:38:41.067" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12874" PostTypeId="2" ParentId="12733" CreationDate="2014-07-02T06:06:36.330" Score="1" Body="&lt;p&gt;Why don't you use the Monte-Carlo method suggested in the paper ? Essentially u need a joint distribution of the discount factor and the short rate model. For details related to Vasicek you may check Glasserman's textbook&lt;/p&gt;&#xA;" OwnerUserId="2142" LastActivityDate="2014-07-02T06:06:36.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12875" PostTypeId="2" ParentId="12677" CreationDate="2014-07-02T06:13:46.897" Score="1" Body="&lt;p&gt;Your need to also specify the frequency at which you are trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For long to medium u can also consider ITG&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Day trading you can consider Flextrade, Portware&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If u are solo then interactive brokers. If you are adventurous then quantstrat&lt;/p&gt;&#xA;" OwnerUserId="2142" LastActivityDate="2014-07-02T06:13:46.897" CommentCount="1" CommunityOwnedDate="2014-07-02T06:13:46.897" ContentLicense="CC BY-SA 3.0" />
  <row Id="12876" PostTypeId="2" ParentId="12655" CreationDate="2014-07-02T06:23:24.723" Score="-4" Body="&lt;p&gt;Intuitively you are measuring the distance between two random variables which under limiting case turns out to be very small. So you can use one instead of another. &lt;/p&gt;&#xA;" OwnerUserId="2142" LastActivityDate="2014-07-02T06:23:24.723" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12877" PostTypeId="2" ParentId="12636" CreationDate="2014-07-02T06:26:02.090" Score="1" Body="&lt;p&gt;These are not yield. They are instantaneous short rates which are not directly observable in the market. &lt;/p&gt;&#xA;" OwnerUserId="2142" LastActivityDate="2014-07-02T06:26:02.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12878" PostTypeId="2" ParentId="12788" CreationDate="2014-07-02T06:28:07.040" Score="1" Body="&lt;p&gt;OK, I think now I got the point, after comparing to Shreve's &quot;Stochastic calculus for finance I, The binomial asset pricing model&quot;, the simpler case. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The pricing theory in continuous time is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Define the wealth process $X(t)$, by definition, it is self-financing: $$d X(t) = \Delta(t) dS(t) + r (X(t) - \Delta(t)S(t)) dt$$&lt;/li&gt;&#xA;&lt;li&gt;Define risk-neutral measure $\widetilde{\mathbb{P}}$. Then $D(t)X(t)$ is a martingale under $\widetilde{\mathbb{P}}$.&lt;/li&gt;&#xA;&lt;li&gt;Define price of the derivative security $V(t)$ via conditional expectation of discounted final paying off. &#xA;$$D(t)V(t) := \widetilde{\mathbb{E}}[D(T)V(T) \mid \mathscr{F}(t)], 0\le t\le T&#xA;\tag{S04b-5.2.30}$$&#xA;By denition $D(t)V (t)$ is a martingale.&lt;/li&gt;&#xA;&lt;li&gt;By Martingale Representation Theorem (Theorem S04b-5.3.1), $X(t) = V (t)$ can be achieved via choosing $$X(0)=V(0)$$ and &#xA;$$\Delta (t) = \frac{\widetilde{\Gamma}(t)}{\sigma(t)D(t)S(t)}, 0\leq t \leq T \tag{S04b-5.3.8}$$ &#xA;So the replication prole is set up.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Shreve04b is slightly different from Shreve04a as in binomial tree part it's easy to define $V_i$ during backward replicating.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Shreve04b $\S 4$ deriving BSM formula omitted some points, that's true; but $\S 5$ covered all that up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So Shreve's book is correct (how smart it could be to find that out? :p)&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2014-07-02T06:28:07.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12879" PostTypeId="2" ParentId="8697" CreationDate="2014-07-02T07:04:41.020" Score="1" Body="&lt;p&gt;It's really important to vectorize operations as much as possible when working with big data in R when speed is a consideration. The code below is an example of multiple regression performed on a matrix with 1000 rows and 10000 columns with the independent variables of interest in each column. The same 5 covariates are also controlled for in every model. It should take less than 10 seconds to run.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;n &amp;lt;- 1000&#xA;m &amp;lt;- 10000&#xA;k &amp;lt;- 5&#xA;S &amp;lt;- matrix(2*rnorm(n*m), n, m) # matrix containing (simulated) independent variables of     interest in each column &#xA;y &amp;lt;- rnorm(n)&#xA;X0 &amp;lt;- matrix(rnorm(n*k), n, k) # # matrix containing (simulated) covariates&#xA;X &amp;lt;- cbind(1, X0)&#xA;&#xA;&#xA;U1 &amp;lt;- crossprod(X, y)&#xA;U2 &amp;lt;- solve(crossprod(X), U1)&#xA;ytr &amp;lt;- y - X %*% U2 &#xA;U3 &amp;lt;- crossprod(X, S)&#xA;U4 &amp;lt;- solve(crossprod(X), U3)&#xA;Str &amp;lt;- S - X %*% U4 &#xA;Str2 &amp;lt;- colSums(Str ^ 2)&#xA;&#xA;b &amp;lt;- as.vector(crossprod(ytr, Str) / Str2) # Beta's for each column in S after controlling for covariates   &#xA;## calculate residual error&#xA;sig &amp;lt;- (sum(ytr ^ 2) - b ^ 2 * Str2) / (n - k - 2)&#xA;## calculate standard error for beta&#xA;err &amp;lt;- sqrt(sig * (1 / Str2))&#xA;p &amp;lt;- 2 * pnorm(-abs(b / err))&#xA;logp &amp;lt;- -log10(p) # -log10 p-values for each Beta estimate&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9433" LastEditorUserId="9433" LastEditDate="2014-07-02T07:10:00.227" LastActivityDate="2014-07-02T07:10:00.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12882" PostTypeId="2" ParentId="12655" CreationDate="2014-07-02T13:48:43.363" Score="2" Body="&lt;p&gt;Intuitively, because of the central limit theorem: wiener process is a limit of a random walk, and after n steps a random walk moves away from the origin by ~ $\sqrt{n}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: here is a complete answer. First the formula for the sum. The trick is the following simple observation: if $X_1,.. X_n$ are independent zero mean, then $E(\sum X_i)^2 = \sum{EX_i^2}$. In the case of the formula, independent zero mean incremnents are $d_i=\Delta z_i^2 - T/N,$ since z(t) is Brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The sum in question is $$E(\sum{\Delta z_i}^2-T)^2 = E(\sum{d_i})^2 = \sum{E(d_i^2)} =  \sum(E\Delta z_i^4 - 2 T / N * E(\Delta z_i^2) + T^2/N^2) = 2 T^2 / N = 2 T * \Delta t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, for the relation to the last equality: the right hand side is T. The left hand side is in some (precise) sense is the limit of $\sum{\Delta z_i^2}$ One standard way to prove convergences in probability, is to estimate the second moment of the difference. This is the formula we just proved.&lt;/p&gt;&#xA;" OwnerUserId="1552" LastEditorUserId="1552" LastEditDate="2014-07-02T21:10:08.827" LastActivityDate="2014-07-02T21:10:08.827" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="12883" PostTypeId="2" ParentId="12655" CreationDate="2014-07-02T14:22:51.520" Score="5" Body="&lt;p&gt;Beware, oversimplification ahead! (This means that the following is technically not correct, in fact it is false! But: It gives an intuition what is going on!)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you toss a coin and calculate heads as $-1$ and tails as $1$ you get a mean of $0$ with a variance of $1$. When you add up multiple coin tosses, i.e. create a random process $dz(t)$, the mean stays the same, i.e. $0$ -&gt; this process is a &lt;a href=&quot;http://en.wikipedia.org/wiki/Martingale_(probability_theory)&quot; rel=&quot;nofollow&quot;&gt;martingale&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you square this process: On average you will get $\frac{(-1)^2+1^2}{2}=1$, which means that your mean gets one unit bigger per timestep -&gt; $[dz(t)]^2=dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So here you see how a martingale could become a process which grows with time on average when you square it - or in more general terms: how a symmetric process could become asymmetric through a non-linear transformation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following is a very nice exposition showing these ideas in a very intuitive manner:&lt;br&gt;&#xA;&lt;a href=&quot;http://web.williams.edu/Mathematics/fmorgan/MorganBlackScholes.pdf&quot; rel=&quot;nofollow&quot;&gt;Stochastic Calculus and the Nobel Prize Winning Black-Scholes Equation by Frank Morgan&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Addendum&lt;/em&gt;&lt;br&gt;&#xA;To address the question why this discrete intuition might make sense even in the continuous case you have to know that the abovementioned stochastic process results in a binomial tree. The basis of this tree is, as the name suggests, the &lt;a href=&quot;http://en.wikipedia.org/wiki/Binomial_distribution&quot; rel=&quot;nofollow&quot;&gt;binomial distribution&lt;/a&gt;. When you simultaneously reduce the size of and increase the number of time steps this binomial distribution becomes (under some technical conditions) the &lt;a href=&quot;http://en.wikipedia.org/wiki/Normal_distribution&quot; rel=&quot;nofollow&quot;&gt;normal distribution&lt;/a&gt;. This is the result of the &lt;a href=&quot;http://en.wikipedia.org/wiki/De_Moivre%E2%80%93Laplace_theorem&quot; rel=&quot;nofollow&quot;&gt;de Moivre–Laplace theorem&lt;/a&gt;. The corresponding continuous stochastic process is a &lt;a href=&quot;http://en.wikipedia.org/wiki/Wiener_process&quot; rel=&quot;nofollow&quot;&gt;Wiener process&lt;/a&gt; (also often called standard Brownian motion), which closes the circle.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2014-07-15T06:39:37.697" LastActivityDate="2014-07-15T06:39:37.697" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="12884" PostTypeId="1" AcceptedAnswerId="12913" CreationDate="2014-07-02T14:38:50.783" Score="1" ViewCount="190" Body="&lt;p&gt;I am in the process of analyzing historical options data, and I keep finding options that mysteriously disappear before they are due to expire. For example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the QQQ $69 Put,  &lt;br /&gt;&#xA;&lt;a href=&quot;http://www.eoddata.com/stockquote/OPRA/QQQ140322P00069000.htm&quot; rel=&quot;nofollow&quot;&gt;http://www.eoddata.com/stockquote/OPRA/QQQ140322P00069000.htm&lt;/a&gt;  &lt;br /&gt;&#xA;there is no data after 03/11/14&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the QQQ $70 Put, &lt;br /&gt;&#xA;&lt;a href=&quot;http://www.eoddata.com/stockquote/OPRA/QQQ140322P00070000.htm&quot; rel=&quot;nofollow&quot;&gt;http://www.eoddata.com/stockquote/OPRA/QQQ140322P00070000.htm&lt;/a&gt;  &lt;br /&gt;&#xA;is fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that all QQQ Puts with strike below $70 mysteriously disappears after 03/11/14, despite some of them having significant open interest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have found this in a dataset I obtained through another vendor as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the cause of these disappearances? Is it a data problem or were they halted trading for some reason?&lt;/p&gt;&#xA;" OwnerUserId="7887" LastEditorUserId="7887" LastEditDate="2014-07-02T14:52:25.263" LastActivityDate="2014-07-04T07:26:34.607" Title="Mysterious disappearance of options from historical datasets" Tags="&lt;options&gt;&lt;historical-data&gt;&lt;option-strategies&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12886" PostTypeId="1" AcceptedAnswerId="12888" CreationDate="2014-07-02T17:17:23.660" Score="5" ViewCount="11438" Body="&lt;p&gt;I have calculated the implied volatility for all strikes of a certain product (options on futures) and approximated the ATM volatility. My question is how can I figure out the implied volatility for a 25 delta call and -25 delta put? I have come across a lot of information about delta, but can't quite put it together to solve this specific problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to implement &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1618602&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;Mixon's skew measure&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5981" LastEditorUserId="5981" LastEditDate="2014-07-02T17:23:25.187" LastActivityDate="2017-03-15T22:04:26.533" Title="How can I calculate the strike price or implied volatility from a given delta?" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;delta&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12887" PostTypeId="2" ParentId="12886" CreationDate="2014-07-02T17:36:59.487" Score="1" Body="&lt;p&gt;Found a nice source, hopefully someone can verify: &lt;a href=&quot;http://www.elitetrader.com/vB/showthread.php?p=3482827&quot; rel=&quot;nofollow&quot;&gt;http://www.elitetrader.com/vB/showthread.php?p=3482827&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The trick is to back into the strike by using the delta formula (of course). Here is the R code posted at the site above:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;BSStrikeFromDelta &amp;lt;- function(S0, T, r, sigma, delta, right)&#xA;{&#xA;strike &amp;lt;- ifelse(right==&quot;C&quot;, &#xA;S0 * exp(-qnorm(delta * exp((r)*T) ) * sigma * sqrt(T) + ((sigma^2)/2) * T),&#xA;S0 * exp(qnorm(delta* exp((r)*T) ) * sigma * sqrt(T) + ((sigma^2)/2) * T))&#xA;return( strike);&#xA;}   &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5981" LastActivityDate="2014-07-02T17:36:59.487" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12888" PostTypeId="2" ParentId="12886" CreationDate="2014-07-02T17:45:17.643" Score="3" Body="&lt;p&gt;For Black-Scholes, $\Delta_C=\partial_{S} C=N(d_1)$, $d_1= \frac{\ln\left(\frac{S_t}{K}\right) + \left(r + \frac{\sigma^2}{2}\right)(T - t)}{\sigma\sqrt{T - t}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may fit the volatility $\sigma$ to this term by $$\Delta_C({\hat{\sigma}})=0.25$$Note that $\Delta_P=1-\Delta_C$ by Put-Call-Parity.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-07-02T17:45:17.643" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="12889" PostTypeId="2" ParentId="12788" CreationDate="2014-07-02T20:20:13.370" Score="2" Body="&lt;p&gt;Let me begin to say that this was one of the most interesting and well written questions I've read in a long time. Even though you have already answered your own question I would like to clear out some terminology and also present my theory as for why many people make the same mistake as Shreve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First I would like to point out that it makes no sense to say that a product (e.g. an American option) is self-financing. The concepts of self-financing and replication applies to (portfolio) strategies only. For example in (G-1) $\  w(t) = \left(w_1(t), w_2(t), ..., w_n(t)\right)_{t \geq 0} \ $ is the portfolio strategy, and $V_w(t)$ is the corresponding value process. And it is $w$ which is self-financing, not the value process $V_w$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now to the important point. Shreve's derivation in §4 follow the same argument as Black-Scholes original proof. The idea is to assume many things (e.g. self-financing) and later show that they are true. With this direct approach you save a lot of work, since the only thing that matters is that your &lt;strong&gt;candidate&lt;/strong&gt; strategy $(\Delta, \Gamma)$ is self-financing, and hence replicating. I guess many people read through B-S paper but didn't wait for the finishing touches. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the formal way if ending Shreve's §4-derivation. To prove that the portfolio strategy $(\Delta, \Gamma)$ is self-financing is actually a &lt;strong&gt;direct consequence of Itô's Lemma&lt;/strong&gt;. This might be another reason why Shreve left it out?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\int_0^t \Delta(u) dS(u) + \int_0^t \Gamma(u) dB(u) \\ = \int_0^t\frac{\partial C}{dS}(u,S(u)) dS(u) + \int_0^t \left(\frac{\partial C}{dt}(u,S(u))+\frac{\sigma^2}{2}S^2(u)\frac{\partial^2 C}{dS^2}(u,S(u)) \right)du \\ = C(t,S(t)) - C(0,S(0)).$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is exactly the integral form of (G-2) and hence proves that the strategy $(\Delta, \Gamma)$ is self-financing.&lt;/p&gt;&#xA;" OwnerUserId="2376" LastEditorUserId="2376" LastEditDate="2014-07-03T15:36:44.517" LastActivityDate="2014-07-03T15:36:44.517" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="12891" PostTypeId="1" CreationDate="2014-07-03T08:21:42.357" Score="2" ViewCount="1674" Body="&lt;p&gt;I have been working on the EXCEL DDE sample worksheet and works fine and now I would to upgrade to ActiveX instead of DDE as I heard it is more robust but I found the refresh rate of ActiveX is even slower than the one in the DDE connection. Is there a way to change the smallest default value from &quot;1 second to smaller value in order to speed up the refresh rate? the refresh rate of DDE can down to several milliseconds. Much appreciate if anyone could help me. Thanks&lt;/p&gt;&#xA;" OwnerUserId="9443" LastActivityDate="2014-07-09T16:31:56.297" Title="IP API Active X for Excel refresh rate" Tags="&lt;programming&gt;&lt;interactive-brokers&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12892" PostTypeId="1" AcceptedAnswerId="12921" CreationDate="2014-07-03T08:24:11.567" Score="4" ViewCount="6458" Body="&lt;p&gt;I have built a program that prices financial assets and it does this in part by calculating the IRR. The problem is that it does not run as quickly as I would like it to. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I currently use the Newton-Raphson method of calculating roots of equations, but then switch to the Interval Bisection method after a set number of tries. This is because there is a chance that the Newton-Raphson method cannot find the IRR, for instance, due to asymptotes. My understanding is that the Newton-Raphson method is more efficient for the cases that it actually works with, which is why my system is currently set up like this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a more efficient formula or algorithm that I can use to calculate the IRR of a financial asset than the ones that I am currently employing? Or, if there is none, is there a way I can change my current order of calculations to make it more efficient?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are in need of any of the formulas that I use to actually be written in this question, please let me know. Thank you for your time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The pricing software that I have designed is a PHP extension written in the C language. This is because it is a web based program. I cannot change languages due to reasons to do with the company that I work for, so, despite them being good suggestions, I cannot use PERL or the Excel IRR function. I didn't mention the languages before as I didn't think that they were too important due to the fact that I am looking for an increase in mathematical efficiency, not computational.&lt;/p&gt;&#xA;" OwnerUserId="9442" LastEditorUserId="9442" LastEditDate="2014-07-04T07:59:01.297" LastActivityDate="2020-09-10T04:17:25.623" Title="What is the Most Efficient Way to Calculate the Internal Rate of Return IRR?" Tags="&lt;programming&gt;&lt;pricing&gt;&lt;asset-pricing&gt;&lt;pricing-formulae&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12893" PostTypeId="1" AcceptedAnswerId="12896" CreationDate="2014-07-03T09:24:09.533" Score="4" ViewCount="5329" Body="&lt;p&gt;Does anyone know of a reliable (free) source of historical stock split information? There's a YQL api for pulling down 'key stats' on a symbol but it only contains the &lt;em&gt;LastSplitDate&lt;/em&gt;. Adjusted close prices aren't interesting because I'm trying to determine when anomalies in fundamental technical analyses occur due to 'discontinuous' OHLC prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(there's some similar questions out there, but none that seem to directly ask about a known free data source)&lt;/p&gt;&#xA;" OwnerUserId="9441" LastActivityDate="2019-02-13T05:15:27.983" Title="Free stock split history data source?" Tags="&lt;equities&gt;&lt;yahoo&gt;&lt;split&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12895" PostTypeId="2" ParentId="12859" CreationDate="2014-07-03T10:43:02.910" Score="-1" Body="&lt;p&gt;Turns out you can make money where you lose most of the time with Parrondo's paradox!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.google.com/webhp?sourceid=chrome-instant&amp;amp;ion=1&amp;amp;espv=2&amp;amp;ie=UTF-8#q=parrondo&quot; rel=&quot;nofollow&quot;&gt;https://www.google.com/webhp?sourceid=chrome-instant&amp;amp;ion=1&amp;amp;espv=2&amp;amp;ie=UTF-8#q=parrondo&lt;/a&gt;'s%20paradox&lt;/p&gt;&#xA;" OwnerUserId="7682" LastActivityDate="2014-07-03T10:43:02.910" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12896" PostTypeId="2" ParentId="12893" CreationDate="2014-07-03T11:40:15.707" Score="4" Body="&lt;p&gt;some links which might help you &#xA;&lt;a href=&quot;http://quant.caltech.edu/historical-stock-data.html&quot; rel=&quot;nofollow&quot;&gt;http://quant.caltech.edu/historical-stock-data.html&lt;/a&gt;&#xA;In the quantmod R package ,the split information is in the &quot;Dividend Only&quot; CSV:&#xA;&lt;a href=&quot;http://ichart.finance.yahoo.com/x?s=IBM&amp;amp;a=00&amp;amp;b=2&amp;amp;c=1962&amp;amp;d=04&amp;amp;e=25&amp;amp;f=2011&amp;amp;g=v&amp;amp;y=0&amp;amp;z=30000&quot; rel=&quot;nofollow&quot;&gt;http://ichart.finance.yahoo.com/x?s=IBM&amp;amp;a=00&amp;amp;b=2&amp;amp;c=1962&amp;amp;d=04&amp;amp;e=25&amp;amp;f=2011&amp;amp;g=v&amp;amp;y=0&amp;amp;z=30000&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9447" LastActivityDate="2014-07-03T11:40:15.707" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12897" PostTypeId="1" AcceptedAnswerId="12899" CreationDate="2014-07-03T12:35:48.243" Score="0" ViewCount="768" Body="&lt;p&gt;I need to calculate the effective interest rate a company X is paying on the total debt it has been loaned (to arrive at the Cost of Debt) for the FY 2011-12. Its long term borrowings are a mix of bonds that will be redeemed on different dates carrying different coupon rates as such:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;10,700 Bonds of face value of 1,000,000/- each, allotted on 10th September 2008, are redeemable at par on 10th September 2018. The bonds carry a coupon rate of 11.00 % p.a. payable annually on 15th September.&lt;/li&gt;&#xA;&lt;li&gt;14,150 Bonds of face value of 1,000,000/- each, allotted on 21st December 2011, are redeemable at par on 21st December 2016 with put/call option after 18 months from the date of allotment. The bonds carry a coupon rate of 9.28 % p.a. annually on 21st June each year.&lt;/li&gt;&#xA;&lt;li&gt;16,000 Bonds of face value of 1,000,000/- each, allotted on 11th December 2008, are redeemable at par on 11th December 2016. The bonds carry a coupon rate of 10.70 % p.a. payable annually on 30th June each year.&lt;/li&gt;&#xA;&lt;li&gt;158 Bonds of face value of 26,000,000/- each allotted on 18th July, 2001 are redeemable in 13 equal installments from the end of the 3rd year upto the end of 15th year from the date of allotment. Accordingly, 8th installment was paid in July 2011. The Bonds carry a coupon rate of 10.25% p.a. payable annually on 30th September.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;My question is, how do I arrive at the pre-tax Cost of Debt for this company, if it is to be calculated as the interest rate on its borrowings?&lt;/p&gt;&#xA;" OwnerUserId="9448" LastActivityDate="2016-11-11T18:17:01.317" Title="How to calculate the pre-tax cost of debt for a mix of bonds allotted to a company?" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;debt&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12898" PostTypeId="2" ParentId="12891" CreationDate="2014-07-03T13:13:46.347" Score="2" Body="&lt;p&gt;Don't use either &lt;code&gt;DDE&lt;/code&gt; or &lt;code&gt;ActiveX&lt;/code&gt;, go with the excel &lt;a href=&quot;http://support.microsoft.com/kb/285339&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;RTD server&lt;/code&gt; api&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's the basis behind the &lt;code&gt;Bloomberg BDP&lt;/code&gt; plugin and we use it at work to push real time data to many spreadsheets.. It's now the recommended way to push data into a spreadsheet and it has a built in &lt;a href=&quot;https://www.tradingtechnologies.com/support/knowledge-base/0/919/&quot; rel=&quot;nofollow&quot;&gt;refresh rate parameter&lt;/a&gt; which can be any millisecond interval, or immediate if you want data pushed as fast as possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer the question about building an RTD server, follow this &lt;a href=&quot;http://weblogs.asp.net/kennykerr/Rtd3&quot; rel=&quot;nofollow&quot;&gt;tutorial,&lt;/a&gt; its pretty trivial to do if you can write C#.  However you'll need IB to give you an api to programatically get the quotes you want to populate the RTD server.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long story short you shouldn't be using either ActiveX or DDE to push quotes to excel as this is antiquated technology.&lt;/p&gt;&#xA;" OwnerUserId="743" LastEditorUserId="743" LastEditDate="2014-07-09T16:31:56.297" LastActivityDate="2014-07-09T16:31:56.297" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12899" PostTypeId="2" ParentId="12897" CreationDate="2014-07-03T14:03:46.463" Score="0" Body="&lt;p&gt;For FY2012 you may calculate the yield on each bond, and then use marketvalue-weighted average to arrive at pre-tax cost of debt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you dont have market prices, I would suggest face-weighted coupon average.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-07-03T23:51:05.040" LastActivityDate="2014-07-03T23:51:05.040" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12900" PostTypeId="2" ParentId="12891" CreationDate="2014-07-03T14:27:21.047" Score="1" Body="&lt;p&gt;In VBA &lt;strong&gt;Application.RTD.ThrottleInterval&lt;/strong&gt; controls the refresh rate of RTD functions in Excel. Note that a value that is too small may take away too much CPU resource and makes Excel slow to respond. A nicer solution is have some in memory object/process to handle data update and print it out to Excel.&lt;/p&gt;&#xA;" OwnerUserId="5861" LastActivityDate="2014-07-03T14:27:21.047" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12901" PostTypeId="1" CreationDate="2014-07-03T14:42:51.317" Score="3" ViewCount="1103" Body="&lt;p&gt;I am considering a simple Heston Model Market with one risky and one riskless asset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The dynamics of the riskless asset is simply $dB_t=r*B_t*dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The dynamics of the risky asset is as follows,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ dS_t=r*S_t*dt+\sqrt{V(t)}*S_t*dW_t, S_0&amp;gt;0 $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ dV_t= \alpha*(\beta-V_t)*dt+\gamma*\sqrt{V_t}*dW^{\rho}_t, V_0=\sigma^2 $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ W^{\rho}_t = \rho*W_t +\sqrt{1-\rho^2}*W^*_t $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W_t,W^*_t$ are independent standard one-dimentional Brownian Motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to ask firstly, whether there exist a explicit solution for $S_t$ and $V_t$. If yes, can you please tell me what is it and how to find it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly, when i simulate this market and compute the price of simple European call option on this risky asset using Monte Carlo $C_{Heston}$ and then compute the implied volatility in the Black and Scholes Market, i cannot find implied volatility for some values of the strike price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;this is the equation i am using to find implied volatility of Heston Model in Black and Scholes Market,&#xA;$s*exp(r*T)*\Phi(\frac{(ln(s/K)+(r+(1/2)*\sigma^2)*T)}{(\sigma*\sqrt{T})})-K*\Phi(\frac{(ln(s/K)+(r-(1/2)*\sigma^2)*T)}{(\sigma*\sqrt{T})}) = C_{Heston}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\Phi$ is CDF of Normal(0,1).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;solving for $\sigma$ using computer algebra gives,&#xA;$RootOf(-S_0*exp(r*T)*erf((1/4)*\frac{(T*Z^2+2*r*T+2*\ln(S_0/K))*\sqrt{2}}{(Z*\sqrt{T})})+erf((1/4)*\frac{(-T*Z^2+2*r*T+2*ln(S_0/K))*\sqrt{2}}{(Z*\sqrt{T})})*K-S_0*exp(r*T)+K+2*C_{Heston})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but this is becoming complex for some values of $K$ in the model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question is does the implied volatility of Heston Model in Black Scholes Model for European Call Option exist for all values of the strike price $K\gt 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please answer in easy to understand and elaborate manner as i am new to this subject.&lt;/p&gt;&#xA;" OwnerUserId="9450" LastEditorUserId="9450" LastEditDate="2014-07-03T16:33:51.967" LastActivityDate="2014-08-29T15:55:06.153" Title="Does Implied Volatility always exist?" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;implied-volatility&gt;&lt;european&gt;&lt;black-scholes-pde&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12904" PostTypeId="1" AcceptedAnswerId="12905" CreationDate="2014-07-03T17:53:20.620" Score="0" ViewCount="1061" Body="&lt;p&gt;I am writing a program that creates realizations of a GBM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Starting from an initial price, I get the following price with this formula:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;NewPrice = PreviousPrice * Exp(Volatility * N10 * Sqrt(DaysElapsed) + Drift * DaysElapsed)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Volatility  is the annual percentage volatility / 100 / sqrt(250)&lt;/li&gt;&#xA;&lt;li&gt;Drift the annual percentage Drift / 100 / 250&lt;/li&gt;&#xA;&lt;li&gt;N01 is a standard normal realization&lt;/li&gt;&#xA;&lt;li&gt;DaysElapsed are the days elapsed from previous price (this is a small fraction in my case)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I am not sure that I am doing this right. Is the above line correct ? Please, suggest the right code expression or other possible corrections. Thank you!&lt;/p&gt;&#xA;" OwnerUserId="5132" LastEditorUserId="5132" LastEditDate="2014-07-11T11:54:39.757" LastActivityDate="2014-07-11T11:54:39.757" Title="Getting the next price of a GBM (Geometric Brownian Motion)" Tags="&lt;stochastic-processes&gt;&lt;simulations&gt;&lt;stochastic-volatility&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12905" PostTypeId="2" ParentId="12904" CreationDate="2014-07-03T18:15:52.163" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Geometric_Brownian_motion&quot; rel=&quot;nofollow&quot;&gt;GBM&lt;/a&gt; is defined as $$ S_t = S_{t-1}\exp\left( \left(\mu - \frac{\sigma^2}{2} \right)dt + \sigma dW_t\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, in your notation, assuming your daily parameters:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ S_{new} = S_{previous}\cdot\exp\left( \left({drift} - \frac{{volatility}^2}{2} \right)days + volatility \,\sqrt{days}\,N(0,1)\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So your formula was incorrect. The youtube you quote is only true for 1-year timesteps (while you have $days$ steps).&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-07-03T18:44:30.123" LastActivityDate="2014-07-03T18:44:30.123" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="12907" PostTypeId="1" CreationDate="2014-07-03T20:21:02.177" Score="0" ViewCount="463" Body="&lt;p&gt;Here is the &quot;twin&quot; question of &lt;a href=&quot;https://quant.stackexchange.com/questions/12904/getting-the-next-price-of-a-gbm-geometric-brownian-motion&quot;&gt;Getting the next price of a GBM (Geometric Brownian Motion)&lt;/a&gt; but for GBM with reversion&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As in that case, I'd like to write a formula for the &lt;strong&gt;next price&lt;/strong&gt;, as function of:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-PreviousPrice&#xA;-DayElapsed    (this can be any fraction, however small, of a day)&#xA;-Drift         (daily drift = annual drift% / 100 / 250)&#xA;-ReversionSpeed&#xA;-Volatility   (daily volatility = annual volatility% / 100 / sqrt(250))&#xA;-N01  (standard normal realization)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I got from a site this stuff (which seems a bit too involved for my taste):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; expTerm1 = Exp(ReversionSpeed * DayElapsed)&#xA; Term1   = Log(PreviousPrice) * expTerm1&#xA;&#xA; OneMinusexpTerm1   = (1 + expTerm1)&#xA; Term2 = (Log(InitialPrice) - Drift  / ReversionSpeed ) * OneMinusexpTerm1      &#xA;&#xA; OneMinus_expTerm_2   = 1 - (expTerm1 * expTerm1)&#xA; Term3   = (Volatility * Volatility ) * OneMinus_expTerm_2 / (4 * ReversionSpeed )&#xA; Term4   = Volatility * N01  * Sqrt(OneMinus_expTerm_2 / (2 * ReversionSpeed))&#xA;&#xA; NextPrice = Math.Exp(Term1 + Term2 + Term3 + Term4) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Could you kindly a better expression (or appropriate corrections to the above) **using my notation and parameters above (assumed &amp;lt;&gt; 0) ** (and/or any useful integration, of course) ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(The source for my &quot;attempt&quot; above is: &lt;a href=&quot;http://marcoagd.usuarios.rdc.puc-rio.br/sim_stoc_proc.html#mc-mrd&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://marcoagd.usuarios.rdc.puc-rio.br/sim_stoc_proc.html#mc-mrd&lt;/a&gt; but I am not sure if I got this right.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S.&#xA;I just want to get 1 preliminary implementation, using all the above parameters (those are constants specified by the user)(volatility, drift, reversion speed, reversion price or &quot;mean&quot;). One of your own choice would do. I am NOT after modeling any instrument in particular, at this time. Will see later the conceptual variations. It's just for testing my software interface. (Later will focus on other concepts). Thank you&lt;/p&gt;&#xA;" OwnerUserId="5132" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2014-07-16T08:57:26.970" Title="Getting the next price of a GBM with reversion" Tags="&lt;simulations&gt;&lt;brownian-motion&gt;&lt;mean-reversion&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12908" PostTypeId="2" ParentId="12907" CreationDate="2014-07-03T23:17:44.937" Score="3" Body="&lt;p&gt;1) The reversion speed $\eta$ is just a scaling factor &gt;0 to control the sensitivity to mean deviations, it has no unit as such.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) There are various simulation formulas in your reference link. Can you please specify which of these you want to simulate?&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-07-03T23:17:44.937" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12909" PostTypeId="2" ParentId="12636" CreationDate="2014-07-04T01:59:32.300" Score="2" Body="&lt;p&gt;Some models do use ln(r_t), like Black–Derman–Toy and the Black–Karasinski models. Mainly to avoid negative interest rates in low rates / high volatility environments through the use of the log-normal distribution. Negative rates can wreak havoc in option premiums for example.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;They are interest rates indeed, that we call short rates, not yield on treasuries. The idea is to find a stochastic process that models only the risk of changes in instantaneous interest rate and not those of the change in maturity, creditworthiness, liquidity, etc.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Interest rate curve models that tackle dynamics of the interest rate curve like HJM take their root in non-arbitrage arguments by stating that equivalent securities must have the same price and that longer maturity treasuries are effectively composed of strips of shorter maturity bonds, which links the treasury curve components.&lt;/p&gt;&#xA;" OwnerUserId="7544" LastActivityDate="2014-07-04T01:59:32.300" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12910" PostTypeId="2" ParentId="7860" CreationDate="2014-07-04T02:29:29.463" Score="1" Body="&lt;p&gt;One could use a GARCH of his choice to estimate the volatility. A mean over your period would be a good indicator, otherwise the instant conditional sd is as good as it gets. Another way could be via an exponential smoothing of the risk-metrics type. Your question is not so clear is to be honest.&lt;/p&gt;&#xA;" OwnerUserId="7544" LastActivityDate="2014-07-04T02:29:29.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12911" PostTypeId="1" AcceptedAnswerId="12914" CreationDate="2014-07-04T03:52:08.203" Score="4" ViewCount="405" Body="&lt;p&gt;In Tomas Bjork's &lt;a href=&quot;http://f3.tiera.ru/2/F_Finance/FD_Derivatives/Bjoerk%20T.%20Arbitrage%20theory%20in%20continuous%20time%20%28OUP,%201998%29%28ISBN%200198775180%29%28T%29%28S%29%28324s%29_FD_.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Arbitrage Theory in Continuous Time&lt;/a&gt; (or &lt;a href=&quot;http://ideabuds.com/wp-content/uploads/2012/09/Tomas-Bjoerk-Arbitrage-Theory-in-Continuous-Time.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;), $\exists$ what seems to be 2 inconsistent definitions of arbitrage:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first definition is for the &lt;strong&gt;single period Binomial model&lt;/strong&gt; &lt;img src=&quot;https://i.stack.imgur.com/p824Y.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second definition is for the &lt;strong&gt;multi period Binomial model&lt;/strong&gt; &lt;img src=&quot;https://i.stack.imgur.com/sExsR.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second suggests that there is a possibility of the portfolio value ending up zero while the first does not...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;...Why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Oh, I forgot to mention: My prof uses the latter definition to replace the first definition for the one-period. E said something about different conditions or something. (I'll ask about it during next consultation hours.)&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="7788" LastEditDate="2014-07-04T10:22:53.467" LastActivityDate="2014-07-06T22:59:35.323" Title="Inconsistent Definition of Arbitrage in Bjork?" Tags="&lt;arbitrage&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12912" PostTypeId="2" ParentId="12892" CreationDate="2014-07-04T05:12:06.003" Score="0" Body="&lt;p&gt;No reputation for comments (sorry).  What programming language / libraries are you using?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think that the Excel library just does 20 iterations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might find it useful to look at the Perl module &lt;a href=&quot;http://search.cpan.org/~erwan/Finance-Math-IRR-0.10/lib/Finance/Math/IRR.pm&quot; rel=&quot;nofollow&quot;&gt;Finance::Math::IRR&lt;/a&gt;  That particular library uses a secant method.  The Gnumeric gnumeric.org apparently uses Newton's.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a very short paper by &lt;a href=&quot;http://www.ceser.in/ceserp/index.php/ijamas/article/view/1929&quot; rel=&quot;nofollow&quot;&gt;Moten &amp;amp; Thron&lt;/a&gt; that offers an improvment to the secant method that they claim is more efficient.&lt;/p&gt;&#xA;" OwnerUserId="801" LastActivityDate="2014-07-04T05:12:06.003" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12913" PostTypeId="2" ParentId="12884" CreationDate="2014-07-04T07:26:34.607" Score="4" Body="&lt;p&gt;The data has definitely not disappeared, it's a problem with your vendor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There has been a corporate action on 2014-02-27 and hence the strike prices have been adapted accordingly.  According to &lt;a href=&quot;http://bsym.bloomberg.com&quot; rel=&quot;nofollow&quot;&gt;Bloomberg bsym&lt;/a&gt; your P69 (composite ID BBG004L7P7L6) became P68.63, and P70 (BBG004L7P8C4) became P69.63.&lt;/p&gt;&#xA;" OwnerUserId="1040" LastActivityDate="2014-07-04T07:26:34.607" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12914" PostTypeId="2" ParentId="12911" CreationDate="2014-07-04T07:58:25.230" Score="0" Body="&lt;p&gt;My initial answer was incorrect, I was thinking to quickly (or slowly!?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I agree with you that these two definitions are &lt;strong&gt;not consistent&lt;/strong&gt;. The first definition is much more strict since it does not allow for any outcome $\omega \in \Omega = \{\omega_1, \omega_2\}$ such that $V_1^h(\omega)=0$. We only have 2 outcomes since we are considering the single period Binomial model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a side note, here are three equivalent definitions of an arbitrage portfolio $h$ (same notation as in Björk).&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$V_h^0 = 0$, $V_h^1 \geq 0$, and $\ E[V_h^1]&amp;gt;0.$&lt;/li&gt;&#xA;&lt;li&gt;$V_h^0 = 0$, $P(V_h^1 \geq 0)=1$, and $\ P(V_h^1 &amp;gt; 0)&amp;gt;0.$&lt;/li&gt;&#xA;&lt;li&gt;$V_h^0 = 0$, $V_h^1 \geq 0$, and $\ V_h^1 \neq 0$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2376" LastEditorUserId="2376" LastEditDate="2014-07-04T11:42:27.877" LastActivityDate="2014-07-04T11:42:27.877" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12915" PostTypeId="2" ParentId="12911" CreationDate="2014-07-04T09:22:49.037" Score="2" Body="&lt;p&gt;I agree with the question and not with the answer. Definition (2.2) means that $\omega$ for which $V^h_1(ω )=0$ is such that $P(\omega) = 0$, ie an event with measure (probability) 0. &lt;/p&gt;&#xA;" OwnerUserId="8072" LastActivityDate="2014-07-04T09:22:49.037" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12916" PostTypeId="1" AcceptedAnswerId="12969" CreationDate="2014-07-04T09:37:46.913" Score="1" ViewCount="445" Body="&lt;p&gt;I am now working with forward rates and have somehow been asked to use an &quot;intuitive&quot; formula for forward  rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{F(0,s,T)}{F(0,t,T)} = \frac{F(s,s,T)}{F(s,t,T)} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can understand the logic behind it but i am failling at proving/disproving it.&#xA;I've tried to rewrite it in term of Zero Coupon Bond Price, in short term rates,  but the equation are not working. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it because the previous equation does not hold ? Or is this because I am lacking some argument ? &lt;/p&gt;&#xA;" OwnerUserId="5052" LastActivityDate="2014-07-08T12:40:00.813" Title="Forward rates formulae" Tags="&lt;interest-rates&gt;&lt;forward&gt;&lt;bond&gt;&lt;short-rate&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12917" PostTypeId="1" AcceptedAnswerId="12930" CreationDate="2014-07-04T11:36:34.320" Score="4" ViewCount="691" Body="&lt;p&gt;Spin-off from &lt;a href=&quot;https://quant.stackexchange.com/questions/12911/inconsistent-definition-of-arbitrage-in-bjork&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Tomas Bjork's &lt;a href=&quot;http://f3.tiera.ru/2/F_Finance/FD_Derivatives/Bjoerk%20T.%20Arbitrage%20theory%20in%20continuous%20time%20%28OUP,%201998%29%28ISBN%200198775180%29%28T%29%28S%29%28324s%29_FD_.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Arbitrage Theory in Continuous Time&lt;/a&gt; (or &lt;a href=&quot;http://ideabuds.com/wp-content/uploads/2012/09/Tomas-Bjoerk-Arbitrage-Theory-in-Continuous-Time.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;), $\exists$ 2 inconsistent definitions of arbitrage, which is correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first definition is for the &lt;strong&gt;single period Binomial model&lt;/strong&gt; &lt;img src=&quot;https://i.stack.imgur.com/p824Y.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second definition is for the &lt;strong&gt;multi period Binomial model&lt;/strong&gt; &lt;img src=&quot;https://i.stack.imgur.com/sExsR.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second suggests that there is a possibility of the portfolio value ending up zero while the first does not...isn't arbitrage a free lunch? That is you will SURELY gain? And if you don't gain, how can you still call that arbitrage?&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2014-07-05T10:52:27.637" Title="Which is the correct definition of arbitrage?" Tags="&lt;arbitrage&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12918" PostTypeId="2" ParentId="12917" CreationDate="2014-07-04T11:48:02.733" Score="0" Body="&lt;p&gt;They are definitions, so it makes no sense in asking which one is correct. However, the second one is the one that makes most sense, and it is the one you will see in most literature.&lt;/p&gt;&#xA;" OwnerUserId="2376" LastActivityDate="2014-07-04T11:48:02.733" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12919" PostTypeId="1" AcceptedAnswerId="12927" CreationDate="2014-07-04T13:30:08.287" Score="2" ViewCount="147" Body="&lt;p&gt;In &lt;a href=&quot;http://cooconnect.com/news/citi-paper-warns-hedge-funds-on-collateral-management-and-rising-financing-costs&quot; rel=&quot;nofollow&quot;&gt;this discussion of a Citi paper&lt;/a&gt;, on the impact of collateral management and rising financing costs for hedge funds, there is a quote from Sandy Kaul's statement:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Sandy Kaul, head of business advisory services at Citi, said EMIR and&#xA;  the implementation of bilateral margining for non-cleared derivatives&#xA;  in 2015 would lead to a steady increase in collateral demands but&#xA;  remained hopeful the challenge was not insurmountable. “I do not&#xA;  believe the collateral shortfall will adversely affect the hedge fund&#xA;  industry. The impact will be felt more strongly in the traditional&#xA;  asset management space. Hedge funds, unlike traditional asset&#xA;  managers, have &lt;strong&gt;the ability to strategically deploy their liquid&#xA;  collateral and transform illiquid assets&lt;/strong&gt; and this should alleviate&#xA;  the challenge,” said Kaul.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Question: What is meant by &quot;the ability of hedge funds to transform illiquid assets&quot;?&lt;/p&gt;&#xA;" OwnerDisplayName="user1157" LastEditorUserId="4660" LastEditDate="2014-07-05T10:01:57.303" LastActivityDate="2014-07-05T10:23:14.983" Title="Ability of hedge funds to transform illiquid assets" Tags="&lt;hedge-fund&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12920" PostTypeId="1" AcceptedAnswerId="12922" CreationDate="2014-07-04T14:01:17.243" Score="0" ViewCount="2145" Body="&lt;p&gt;When calculating CAGR for intervals shorter than a year (or intervals that are longer than, but not integer years in length), should you use the 252 trading days or the 365.25 calendar days?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The formula I am using follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CAGR = ( Current Value / Initial Value ) ^ (1 / (Days passed / Days in the year)) - 1&lt;/p&gt;&#xA;" OwnerUserId="8231" LastActivityDate="2016-07-28T07:30:56.217" Title="Trading days or Calendar days for Compound Annual Growth Rate?" Tags="&lt;returns&gt;&lt;asset-returns&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12921" PostTypeId="2" ParentId="12892" CreationDate="2014-07-04T14:37:14.177" Score="1" Body="&lt;p&gt;You could try &lt;a href=&quot;http://en.wikipedia.org/wiki/Brent%27s_method&quot; rel=&quot;nofollow&quot;&gt;Brent's method&lt;/a&gt;, it works well.&lt;/p&gt;&#xA;" OwnerUserId="3491" LastEditorUserId="848" LastEditDate="2014-07-04T14:40:17.000" LastActivityDate="2014-07-04T14:40:17.000" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12922" PostTypeId="2" ParentId="12920" CreationDate="2014-07-04T18:43:14.977" Score="1" Body="&lt;p&gt;You can use both standards, but when you apply or compare this rate the standards must be equal, and it should be noted which convention you used.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that 300/365 yeardays would in percentage be equal to 205/250 tradingdays, so its really just a convention that would make no difference in actual time.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-07-04T18:43:14.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12923" PostTypeId="2" ParentId="12919" CreationDate="2014-07-04T23:05:45.777" Score="0" Body="&lt;p&gt;The passage is indeed quite vague. I would interpret it as to say, Hedge Funds in general are subject to less regulations and restrictions, which gives them more flexibility to invest into alternative asset classes, and trade them more frequently and flexible than a usual restricted asset manager. An example might be private equity, where a hedge fund is usually investor and management board same time, which also means they can sell off their investment easier than an asset manager just holding a private equity share without control.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-07-04T23:05:45.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12924" PostTypeId="1" AcceptedAnswerId="12947" CreationDate="2014-07-05T00:08:10.540" Score="1" ViewCount="328" Body="&lt;p&gt;If a trader shorts an option and dynamically delta hedges to ensure the delta is equal to 0 if that option expires out of the money does the trader profit that options extrinsic value at the time of selling it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To me this makes sense as even if Vol rises or the option moves ITM, at expiration all extrinsic value goes to 0 and since the delta is hedged the trader will profit the extrinsic value that they sold. But I feel like I must be missing something, where am I mistaken?&lt;/p&gt;&#xA;" OwnerUserId="9459" LastActivityDate="2014-07-07T05:29:53.807" Title="Does a delta hedged short option guarantee profit of extrinsic value at expiration?" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12925" PostTypeId="1" CreationDate="2014-07-05T01:43:36.750" Score="3" ViewCount="2771" Body="&lt;p&gt;I understand the derivation of both:take dP/dR and divide by P which will give you both 1) modified duration OR 2) macaulay duration / (1+r)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/hJJY5.jpg&quot; alt=&quot;example&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(notice the weighted average time built into the function from taking the derivative - the math makes sense)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is about intuition: how can discounting the weighted average time to maturity by an extra period be equal to the sensitivity of %price to %yield?&#xA;Perhaps using continuously compounded returns can help in the intuition?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should I memorize the fact and move on and not require intuition behind it&lt;/p&gt;&#xA;" OwnerUserId="9460" LastEditorUserId="16595" LastEditDate="2018-12-29T10:47:20.377" LastActivityDate="2018-12-29T10:47:20.377" Title="What is the intuition behind the fact that Modified duration = Macaulay Duration / (1+r)?" Tags="&lt;interest-rates&gt;&lt;duration&gt;&lt;bond&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="12926" PostTypeId="2" ParentId="12835" CreationDate="2014-07-05T02:58:07.570" Score="0" Body="&lt;p&gt;Haim Bodek wrote a lot of research, not all those order types still exist, but it's a fascinating read:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://haimbodek.com/research.html&quot; rel=&quot;nofollow&quot;&gt;http://haimbodek.com/research.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3491" LastActivityDate="2014-07-05T02:58:07.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12927" PostTypeId="2" ParentId="12919" CreationDate="2014-07-05T10:23:14.983" Score="0" Body="&lt;p&gt;I agree with @emcor that this statement is vague. I believe the key to understanding the intended meaning is this part:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Hedge funds, &lt;strong&gt;unlike traditional asset managers&lt;/strong&gt;, have the ability to strategically deploy their liquid collateral and transform illiquid assets.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The SEC requires mutual funds to limit their investments in illiquid securities to a maximum of 15% of each of their total assets, and in particular 10% for money market funds. As such, it is a general assumption that mutual funds cannot do much that involves illiquid assets anyway.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, mutual funds are more limited in their use of derivatives, leverage and debt issuance than hedge funds. Any transaction, especially in derivatives, in which the fund may become liable to a third party in an amount exceeding the cost of investment requires that the fund segregates liquid assets having a value equal to the amount of the potential obligations daily mark-to-market. e.g. It may be more difficult to purchase equities in an African country and then enter a total return swap agreement, for whatever reason, to transfer risk on those equities.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2014-07-05T10:23:14.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12928" PostTypeId="2" ParentId="12920" CreationDate="2014-07-05T10:28:23.170" Score="3" Body="&lt;p&gt;It depends on what makes more economic sense:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;If you are calculating CAGR for FX (which is traded effectively 24/7) strategy returns for instance, it would seem fair to use 365.25 calendar days.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you are calculating CAGR for internal reporting of trading strategy returns on a product with 5 market sessions per week, it would seem fair to use 252 calendar days.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you are reporting CAGR to a potential LP investor or fund allocator, they would be more interested in the CAGR they will experience at the individual tax year level, so it would also seem fair to use 365.25 calendar days.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2014-07-05T10:28:23.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12929" PostTypeId="2" ParentId="10971" CreationDate="2014-07-05T10:35:00.790" Score="1" Body="&lt;p&gt;Same answer as @chollida - any kind of logging has real computational cost. You can improve on the QuickFIX implementation without disabling the logging functionality by increasing the buffer size, or using message middleware to pass the logging task to another thread or core (which therefore amortizes the total computation time in the QuickFIX path).&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2014-07-05T10:35:00.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12930" PostTypeId="2" ParentId="12917" CreationDate="2014-07-05T10:52:27.637" Score="4" Body="&lt;p&gt;I think you are seeking a pragmatic definition of arbitrage instead of a theoretical definition. For practical definitions, there are two kinds of arbitrage: &lt;em&gt;statistical arbitrage&lt;/em&gt; and &lt;em&gt;deterministic&lt;/em&gt; arbitrage. Suppose you have a lottery with 10 identical tickets only. Each ticket sells for \$10. The single, grand prize of the lottery is \$1000. Hence, the expectation value of each ticket is +$90.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Statistical arbitrage&lt;/strong&gt;: If you can purchase any 1 of these tickets, this would be called a statistical arbitrage opportunity since the odds are in your favor. Provided a secondary market is allowed, you can probably &lt;em&gt;expect to&lt;/em&gt; sell this ticket to another party for close to $90.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Deterministic arbitrage&lt;/strong&gt;: If you can purchase all 10 of these tickets, this would be called a deterministic (or &lt;em&gt;pure&lt;/em&gt;) arbitrage opportunity since odds no longer matter and you have a lock on the profit &lt;em&gt;with respect to market risk&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take note that arbitrage scenarios are conventionally understood to refer to such opportunities with respect to &lt;em&gt;market risk only&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this first case, even though the odds are in your favor, it doesn't necessarily mean that one should take the opportunity - the risk-reward should be acceptable to your appetite, opportunity costs and risk aversion. The great extent of variability in these factors cause the actual participants who may purchase your ticket from the secondary market to offer varying prices. The market risk is non-negligible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the second case, you can probably sell these tickets immediately to another party for close to $900. There is still some degree of credit counterparty risk, carry costs (e.g. you have to spend some effort keeping those tickets safe and cannot simply keep those tickets lying on the ground in public), but these are negligible, so the actual participants who may purchase your tickets from the secondary market in this case would probably offer a very narrow range of prices. Hence, the market risks are effectively negligible.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2014-07-05T10:52:27.637" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12931" PostTypeId="2" ParentId="11392" CreationDate="2014-07-05T16:00:27.140" Score="1" Body="&lt;p&gt;If you want to calculate the change of a greek, lets say Delta, from a change in the volatility, you would need &lt;strong&gt;Vanna&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Vanna=\partial_\sigma\Delta=\partial_\sigma\partial_S C$$, which under Black-Scholes becomes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;Vanna=\left(\sqrt{T-t+\frac{1}{\sigma}}\right)\phi\left(d_1\right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\phi\left(\cdot\right)$ is the standardnormal density &#xA;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;d_1=\frac{\ln\left(\frac{S}{K}\right)+\left(r+\frac{\sigma^{2}}{2}\right)(T-t)}{\sigma\sqrt{T-t}}&#xA;$$&#xA;(from: Franke, J. Haerdle, W.K., Hafner, C.M., 'Statistics of Financial markets - An Introduction', 2nd Edition, Springer, 2008, pg. 110)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consequently the new greek is approximately: $\Delta_{t+1}\approx\Delta_t+Vanna(\sigma_{t+1})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see, it is not straightforward, but in general you just derive the corresponding greek with respect to $\sigma$ to find the relationship.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-07-05T16:22:22.087" LastActivityDate="2014-07-05T16:22:22.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12932" PostTypeId="1" AcceptedAnswerId="12949" CreationDate="2014-07-05T16:37:32.107" Score="7" ViewCount="897" Body="&lt;p&gt;I have been aggregating some tick data from &lt;a href=&quot;http://developer.oanda.com/docs/v1/stream/#rates-streaming&quot; rel=&quot;nofollow noreferrer&quot;&gt;Oanda's streaming API&lt;/a&gt; to try and get an idea of the relative cost and best time to trade different currency pairs. The idea was to plot the spread of the different pairs as a very rough guide to answering the above questions, however some of my results are very unintuitive. For EUR_USD, the plot looks like I would expect, there are some spikes throughout the day (possibly caused by news events) and the spread widens periodically at around 19:00 EDT.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/vfHK4.png&quot; alt=&quot;EUR_USD&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However if I plot multiple pairs I am getting very unintuitive results. Below the spread for USD_SGD is consistently above the USD_MXN and USD_NOK spreads however I was under the impression SGD was quite liquid (Ignore the first blank patch as this was due to a power outage while aggregating data).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/gC4r1.png&quot; alt=&quot;SGDMXNNOK&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was thinking this could be the case for several reasons:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;While the spread is higher the liquidity and therefore price impact and overall cost of trading SGD could still be less&lt;/li&gt;&#xA;&lt;li&gt;Oanda specifically has high spreads for this pair since they are not competitive as a broker for this pair for whatever reason&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If I look at another set of pairs such as USD_CHF and USD_INR, this seems to reinforce the idea that the spread is not very indicative of the cost associated with trading the pair, or at least below a certain volume of ticks per minute, as I find it hard to believe that the USD_INR can have a spread that much lower that USD_CHF.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/GJfDp.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To summarize my question I was wondering if any of the above reasons seems reasonable for why these unintuitive results are appearing and if looking at the spread as a very rough proxy is even worthwhile or if the approximation is far too crude to be useful.&lt;/p&gt;&#xA;" OwnerUserId="5420" LastActivityDate="2014-07-07T09:02:25.877" Title="Transaction Costs for Currency Pairs" Tags="&lt;fx&gt;&lt;liquidity&gt;&lt;transaction-costs&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12933" PostTypeId="2" ParentId="12767" CreationDate="2014-07-05T19:50:40.737" Score="2" Body="&lt;p&gt;No. All you need is to be naturally smart, and not lack common sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well, clearly, a bare minimum of education (the 4 operations should suffice)   ;-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also sometimes, too much specialized education may really be detrimental (it's common the case of Physics PhDs, who have an harmful tendency towards predictive models).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually, and generally speaking, a Statistics background is the best (clearly, most it's up to the individual. You will surely find clueless statisticians too, no doubt).&lt;/p&gt;&#xA;" OwnerUserId="5132" LastActivityDate="2014-07-05T19:50:40.737" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12934" PostTypeId="1" CreationDate="2014-07-05T19:52:18.587" Score="-1" ViewCount="177" Body="&lt;p&gt;i'm writing my BA Thesis about &quot;Equally-weighted Risk contributions&quot;. Can anyone recommend math books for further understanding of Risk contributions?&lt;/p&gt;&#xA;" OwnerUserId="9465" LastEditorUserId="848" LastEditDate="2014-07-05T20:50:32.813" LastActivityDate="2014-07-16T20:39:40.860" Title="Math basics of Equally-weighted Risk contributions" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;risk-models&gt;&lt;mathematics&gt;&lt;asset-allocation&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12935" PostTypeId="1" CreationDate="2014-07-05T23:47:26.420" Score="0" ViewCount="506" Body="&lt;p&gt;I notice a divergence in my own code, but it's evident even in public code:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.thalesians.com/finance/index.php/Knowledge_Base/Finance/Option_Pricing_in_Python_and_Simple_English&quot; rel=&quot;nofollow&quot;&gt;http://www.thalesians.com/finance/index.php/Knowledge_Base/Finance/Option_Pricing_in_Python_and_Simple_English&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pricing a vanilla option thusly shows large differences in instrument value:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;::: BinomialTreeEuropeanCallPrice(50., 50., 0.065, 0.7, 1.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;14.770372341296639&lt;/p&gt;&#xA;&#xA;&lt;p&gt;::: MonteCarloEuropeanCallPrice(50., 50., 0.065, 0.7, 1.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;15.790992991711446&lt;/p&gt;&#xA;&#xA;&lt;p&gt;::: MonteCarloEuropeanCallPrice(50., 50., 0.065, 0.7, 1.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;15.708282373460175&lt;/p&gt;&#xA;&#xA;&lt;p&gt;::: MonteCarloEuropeanCallPrice(50., 50., 0.065, 0.7, 1.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;16.329354195310856&lt;/p&gt;&#xA;&#xA;&lt;p&gt;::: BinomialTreeEuropeanCallPrice(50., 50., 0.065, 0.7, 1., N=40)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;14.797836571920467&lt;/p&gt;&#xA;&#xA;&lt;p&gt;::: MonteCarloEuropeanCallPrice(50., 50., 0.065, 0.7, 1., N=150, pathCount=10000)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;15.465674502595983&lt;/p&gt;&#xA;&#xA;&lt;p&gt;::: MonteCarloEuropeanCallPrice(50., 50., 0.065, 0.7, 1., N=150, pathCount=10000)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;15.716431314886879&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even with sd ~ 40, the standard error on the monte carlo is ~ 0.4, so the price difference is over 2 se away. Is MC convergence truly that slow? Or is the step size just too large causing an upward bias?&lt;/p&gt;&#xA;" OwnerUserId="9466" LastActivityDate="2014-07-09T23:47:08.207" Title="Divergence between binomial pricing and monte carlo simulation for vanilla european call?" Tags="&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;european&gt;&lt;binomial&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12936" PostTypeId="1" AcceptedAnswerId="12937" CreationDate="2014-07-06T05:07:52.410" Score="0" ViewCount="94" Body="&lt;p&gt;Currently, I'm implementing a feature of an open source project (&lt;a href=&quot;https://github.com/yccheok/jstock/issues/7&quot; rel=&quot;nofollow&quot;&gt;https://github.com/yccheok/jstock/issues/7&lt;/a&gt;), which requires me to calculate the rate of return of a stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's take the following scenario.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;User purchased 1000 units stock with unit price 1 dollar at 1st&#xA;  January 2013. He didn't perform any sell transaction &amp;amp; buy transaction&#xA;  in between. At 31st December 2013, the stock price reached 2 dollar.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The rate of return of the stock for year 2013 is 100%&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(Value of investment at 31st December 2013 - Cost of investment at 1st January 2013) / (Cost of investment at 1st January 2013) * 100%&#xA;&#xA;(1000 * $2 - 1000 * $1) / (1000 * $1) * 100% = 100%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But, what if the user had purchased another &lt;strong&gt;1000 units of same stock with unit price 1 dollar at 1st March 2013&lt;/strong&gt;. What should be the rate of return of the stock for year 2013?&lt;/p&gt;&#xA;" OwnerUserId="2244" LastEditorUserId="2244" LastEditDate="2014-07-06T05:34:20.493" LastActivityDate="2014-07-06T09:24:37.040" Title="Calculate rate of return of a stock, if there is a buy transaction occurs during the middle of financial year" Tags="&lt;equities&gt;&lt;investment&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12937" PostTypeId="2" ParentId="12936" CreationDate="2014-07-06T06:50:48.970" Score="1" Body="&lt;p&gt;That is what &lt;a href=&quot;http://www.jagoinvestor.com/2009/08/what-is-irr-and-xirr-and-how-to.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;XIRR&lt;/a&gt; does or can you read this &lt;a href=&quot;https://stackoverflow.com/questions/5179866/xirr-calculation&quot;&gt;answer&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically it tries to find an interest rate that works out to the same numbers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think Excel and Google Docs use the Newton approximation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.mftransparency.org/calculating-interest-rates-using-newtons-method/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.mftransparency.org/calculating-interest-rates-using-newtons-method/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's also a java implementation available on github called &lt;a href=&quot;https://github.com/ept/jxirr&quot; rel=&quot;nofollow noreferrer&quot;&gt;jxirr&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9468" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2014-07-06T09:24:37.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12939" PostTypeId="2" ParentId="12932" CreationDate="2014-07-06T07:48:12.507" Score="3" Body="&lt;p&gt;The cost of forex trading is reflected through the bid-ask spread  you pay as a retail client to a broker.  period.  There spread IS indicative of the cost of trading the pair, AT that specific point in time (and OANDA does not reject your trades or recall trades on any rates they offer at a specific time, up to a specific trade size). So what you are doing makes sense, but you can't think about an &quot;average spread&quot; for a pair over an entire trading day.  The spreads for all pairs will vary through out the day.  Let me explain...  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Spreads will be wider ANY time there is major market activity on forex; this isn't OANDA just widening spreads for the sake of it; they run automated pricing algorithms.  Sure, spreads can be manually widened in anticipation of a major news event (like NFP @ 8.30 am first friday of each month, or an anticipated fed reserve release (or any major central reserve bank release for smaller pairs).  A nice reference for known news events that will likely affect spreads is &lt;a href=&quot;http://www.forexfactory.com/&quot; rel=&quot;nofollow&quot;&gt;http://www.forexfactory.com/&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best time to trade though depends on your trading strategy, or your goals in general.   If you want to trade break volatility models, you're best to trade at times when you know prices tend to be more volatility.  If you must trade on tight spreads, with a mean reversion model in which you don't care about momentum, then trade at off-peak market hours (after lunch time EST is a relatively quiet period for a few hours).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OANDA produces FX rates using dynamic spreads.  What these means is that at any given time the prices OANDA quotes to its customers are a function of the rates being offered by its liquidity providers (the providers are proprietary, but they do include many major banks internationally), who OANDA will hedge its exposures with. OANDA does not take positions against its customers, rather it hedges any position build ups.  This is public knowledge, albeit not well known.  If you go to any other major forex broker (that does NOT charge commissions to help protect against market slippage for the broker), you'll see wider spreads around the same times that OANDAs spreads widen.  The fact that OANDA doesn't charge commissions is an advantage.  A disadvantage is that you are subject to sometimes wider spreads during volatility periods because of the dynamic spreads, compared to other brokers offering FX trading (e.g. Interactive Brokers may have tighter spreads, but you'll get hit with a commission on each trade too). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The spikes you see through the day may &lt;em&gt;sometimes&lt;/em&gt; be due to anticipated news events, but often the spikes are simply because the wider 'forex market' is experiencing widening spreads, for various reasons, but typically unexpected news/fundamentally related, or high volume trades for certain pairs going on for a couple of major liquidity providers which leads them to widen their spreads (with others following suit). The wider forex market consists of the major banks, hedge funds, etc who do massive forex flows each day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The spreads will in fact widen on EURUSD several times a day, when major markets open (London, New York, Hong Kong/Tokyo).  During these times, FX prices tend to be much more volatility, just like between 9.30am and 10am EST on the NASDAQ and NYSE (and hence spreads by FX liquidity providers around the world will also be wider, as the major sources of profit (and protection against losses) in providing liquidity is the spread).  Take a look also around 8am EST. The spike you see at 19 EDT/EST reflects volatility in the forex market from the Asian markets opening (you'll see major spikes on USDJPY around this time for obvious reasons).  A nice introduction to modelling forex volatility through the day is provided in the old book An Introduction to High Frequency Finance (Picton, Olsen, et al)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The spread for USDSGD being wider than USDCHF is a function of the spreads being offered by other liquidity providers.  I don't really follow your point that these are &quot;very unintuitive results&quot;?  Spreads on different pairs are a function of a variety of factors.  OANDAs spreads on USDSGD will be dependent, in part, on what the spreads are for the liquidity providers that they choose to hedge with.  It could be the case that other FX brokers can offer tighter spreads, if they can find liquidity providers who will offer then tighter spreads in turn, or if those brokers are prepared to internalize the flow they get on those pairs and either accept the risk (although it cannot be verified, it is said that some market makers hold (unhedged) exposures in some currencies in excess of 10s of millions) or maybe they do something with that flow of a proprietary trading nature.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From my experience, the most actively traded pairs are EURUSD, USDJPY, EURJPY, GBPUSD, AUDUSD and related crosses.  I would consider pairs related to CHF to be more liquid than SGD in general, so the spreads by liquidity providers for brokers will, in general, be tighter for these more liquid pairs.&lt;/p&gt;&#xA;" OwnerUserId="7149" LastEditorUserId="7149" LastEditDate="2014-07-07T02:36:34.487" LastActivityDate="2014-07-07T02:36:34.487" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12940" PostTypeId="1" CreationDate="2014-07-06T15:07:33.733" Score="3" ViewCount="1769" Body="&lt;p&gt;The vast majority of what I have read about quantitave finance is to do with option pricing and time series analysis for forecasting. However the economy as a whole behaves as a dynamic system with people forecasting stock prices then having a direct impact on future stock prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have read some interesting research on this in terms of a general economic viewpoint, but has there been anything in terms of a quantitive finance outlook? The economic theory is generally called Complex Economics but I couldn't find an a analagous Complex Quantitave Finance.&lt;/p&gt;&#xA;" OwnerUserId="6443" LastEditorUserId="12" LastEditDate="2014-07-06T15:32:45.077" LastActivityDate="2014-07-07T12:10:34.623" Title="Non-linear Dynamical Systems and Quantitave Finance" Tags="&lt;reference-request&gt;&lt;nonlinear&gt;&lt;dynamic&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12941" PostTypeId="2" ParentId="12940" CreationDate="2014-07-06T15:32:30.013" Score="3" Body="&lt;p&gt;This book might be what you are looking for:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://books.google.de/books?id=AJsgAwAAQBAJ&amp;amp;lpg=PP1&amp;amp;dq=inauthor%3A%22Jean-Philippe%20Bouchaud%22&amp;amp;pg=PP1#v=onepage&amp;amp;q&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;Theory of Financial Risk and Derivative Pricing. From Statistical Physics to Risk Management by J.-P. Bouchaud and M. Potters&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As one reviewer from amazon wrote:&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Econophysics (the application of techniques developed in the&#xA;  physical sciences to economic, business and financial problems) has&#xA;  emerged as a newly active field of interdisciplinary research. `Theory&#xA;  of Financial Risks' (written by two of the pioneers of this field)&#xA;  highlights very clearly the contribution that physicists can make to&#xA;  quantitative finance. From the outset the point of view of the book is&#xA;  one of empirical observation (of the statistical properties of asset&#xA;  price dynamics) followed by the development of theories attempting to&#xA;  explain these results and enabling quantitative predictions to be&#xA;  made. This philosophy is reflected in the structure of the book. [...]&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Excerpts can be found on the accompanying site of Cambridge University Press: &lt;a href=&quot;http://www.cambridge.org/de/academic/subjects/physics/econophysics-and-financial-physics/theory-financial-risk-and-derivative-pricing-statistical-physics-risk-management-2nd-edition&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;EDIT&lt;/em&gt;&lt;br&gt;&#xA;I know of no current overarching book but there are several papers out there that address the issues of evolving trading strategies in an artificial stock market. Try the following &lt;a href=&quot;https://www.google.de/webhp?sourceid=chrome-instant&amp;amp;ion=1&amp;amp;espv=2&amp;amp;ie=UTF-8#newwindow=1&amp;amp;q=artificial%20stock%20market%20evolution%20trading%20strategies&quot; rel=&quot;nofollow&quot;&gt;google search&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2014-07-07T12:10:34.623" LastActivityDate="2014-07-07T12:10:34.623" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12942" PostTypeId="1" CreationDate="2014-07-06T18:12:52.273" Score="2" ViewCount="151" Body="&lt;p&gt;Ive seen my junk inbox overflowing recently with a few stocks being pushed extremely heavily via unsolicited emails from a variety of 'firms', my guess is that these are done by the same individual / group of individuals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The last stock i saw rose c. 70% during the period of the emails before plummeting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any regulations baring shorting these 'shadily marketed stocks' ?&lt;/p&gt;&#xA;" OwnerUserId="3489" LastActivityDate="2014-07-07T19:45:25.123" Title="Shorting 'pump and dumps' legal?" Tags="&lt;short-selling&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12943" PostTypeId="2" ParentId="12934" CreationDate="2014-07-06T19:32:13.713" Score="0" Body="&lt;p&gt;This sounds like risk parity to me. For example, instead of a traditional portfolio of 60% equity + 40% fixed income, you'd allocated 50% of ex-ante risk to equity and 50% of ex-ante risk to fixed income. This strategy is extremely well studied. Just google &quot;risk parity&quot; and you'll find a lot of literature.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2014-07-06T19:32:13.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12945" PostTypeId="2" ParentId="12935" CreationDate="2014-07-07T03:43:43.417" Score="4" Body="&lt;p&gt;The Black-Scholes price of this option is approximately $14.8$. When I run a Monte Carlo simulation with $10000$ paths and &quot;exact&quot; time stepping, I get results very close to this value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are simulating the terminal asset price with the first-order Euler approximation over multiple time steps: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S(t+\Delta t)= S(t) + rS(t)\Delta t + \sigma S(t)\sqrt{\Delta t}\xi,$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\xi \sim N(0,1).$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will lead to an inaccurate simulation for high volatility (eg. $70\%).$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The exact solution for geometric Brownian motion over a time step is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S(t+\Delta t)= S(t)\exp[(r-\sigma^2/2)\Delta t]\exp[\sigma\sqrt{\Delta t}\xi].$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With a low-order time stepping scheme you are introducing an upward bias.  Either use the exact solution over the time step, or a higher-order numerical method for the SDE, or simply simulate the terminal asset price in one step as as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S(T)= S(0)\exp[(r-\sigma^2/2)T]\exp[\sigma\sqrt{T}\xi].$$&lt;/p&gt;&#xA;" OwnerUserId="8153" LastActivityDate="2014-07-07T03:43:43.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12946" PostTypeId="1" CreationDate="2014-07-07T05:05:35.113" Score="0" ViewCount="29" Body="&lt;p&gt;I tried looking for some decent way to get stock data for general commodities.&#xA;I went looking on Yahoo Finance and found &lt;a href=&quot;https://nz.finance.yahoo.com/q?p=finance.yahoo.com&amp;amp;s=GCN14.CMX&quot; rel=&quot;nofollow&quot;&gt;https://nz.finance.yahoo.com/q?p=finance.yahoo.com&amp;amp;s=GCN14.CMX&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this data doesn't update and has no historical data either as the other stocks on Yahoo Finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does someone know what I'm overlooking or another way to get some commodity data online? Pref with some API like Yahoo Finance offers.&lt;/p&gt;&#xA;" OwnerUserId="9479" LastActivityDate="2014-07-07T05:05:35.113" Title="Commodity prices on Yahoo finance" Tags="&lt;yahoo&gt;&lt;commodities&gt;" AnswerCount="0" CommentCount="2" ClosedDate="2014-07-07T05:10:15.300" ContentLicense="CC BY-SA 3.0" />
  <row Id="12947" PostTypeId="2" ParentId="12924" CreationDate="2014-07-07T05:29:53.807" Score="1" Body="&lt;p&gt;Consider your question in the idealized case of zero transaction cost and where the underlying stock price follows geometric Brownian motion with constant volatility -- identical to the implied volatility used to price the option. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the delta hedge is rebalanced over time short time intervals of length $\Delta t,$ then the cost of hedging is a random variable that converges almost surely to the option price in the limit as $\Delta t \rightarrow 0$.  In practice, of course, it is impossible to continuously delta hedge. Furthermore, in the presence of transaction costs the hedging cost with continuous rebalancing  diverges to infinity -- Brownian motion has unbounded variation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, the hedging cost for any realistic strategy has some distribution around the option price with non-zero variance for $\Delta t &amp;gt; 0$.  The actual cost will depend on the path of the underlying price.  Even if the option expires OTM, there are paths where the cost can be very low -- underlying price runs steadily in the OTM direction, and there are paths where the cost can be very high -- underlying price oscillates frequently through the strike price close to expiration and finishes OTM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In summary, with delta-hedging over non-zero time steps, the hedging cost (conditioned on the option expiring OTM) is not less than the option price with certainty.       &lt;/p&gt;&#xA;" OwnerUserId="8153" LastActivityDate="2014-07-07T05:29:53.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12948" PostTypeId="2" ParentId="12932" CreationDate="2014-07-07T08:28:28.063" Score="1" Body="&lt;p&gt;The reason SGD spreads are higher than MXN is onshore / offshore regulation. The Government of Singapore doesn't like their currency to cross their border outside of specified hours and this controls the liquidity in the pair. There is another currency pair - SGO, or Singapore offshore.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise, IMHO, FXQuantTrader has pretty much answered your questions about spreads. In FX pricing, everybody kinda follows everybody else. But, spreads depend on client relationships as well as the market.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2014-07-07T08:28:28.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12949" PostTypeId="2" ParentId="12932" CreationDate="2014-07-07T09:02:25.877" Score="5" Body="&lt;p&gt;You've got your calculation of the spread wrong, for what you're trying to do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at the spot prices: SGD = USD 0.8, MXN = USD 0.077, NOK = USD 0.16. So in descending order they are SGD, NOK, MXN. The order of levels on your chart is SGD, NOK, MXN. INR vs CHF is the same: CHF = USD 1.1, INR = USD 0.017, so you get a larger spread for CHF in dollar terms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You don't want to know what the dollar cost is of buying 1 unit of some currency and selling it again. You do want to know how many dollars you are left with if you start with $1m and go to the currency and back.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example: right now, I'm seeing EUR at 1.35962-70, and AUD at 0.9364-5. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Via EUR: USD 1m -&gt; EUR 735,456 -&gt; USD 999,941, so I'm down \$59, or 0.0059%. &lt;/li&gt;&#xA;&lt;li&gt;Via AUD: USD 1m -&gt; AUD 1,067,806 -&gt; USD 999,893, so I'm down \$107 or 0.0107%.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Make sure you're taking into account whether the currency is traded X per USD or USD per X (weak/strong).&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2014-07-07T09:02:25.877" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12950" PostTypeId="1" AcceptedAnswerId="12970" CreationDate="2014-07-07T09:18:37.733" Score="12" ViewCount="1935" Body="&lt;p&gt;I am currently studying the Momentum strategy and its differences in results (returns) when we change the formula describing momentum. There are indeed no accurate formulas for implementing the momentum strategy in an investment fund.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, you can use the last close price minus the first close price of the last 6 months (or 1 month); but you can also use the average of the last 6 months prices minus the average of the last 7 days prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a few examples of definitions/formulas like that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I have the purpose of testing a lot of those formulas using a MATLAB code, but I can't find those definitions, especially recent and creative ones.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if any of you has a link or a list with all those different formulas/definitions, or even any thoughts regarding a recent and decent momentum formula, that would be great.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I would like to add more explanation regarding my request.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;--&gt; I am looking for more &quot;unofficial&quot; definition of momentum (exactly the opposite of those I gave as an example see above). In other words, definitions that are different from the classic definition of Jegadeesh &amp;amp; Titman&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;An example of a creative, and unexpected definitions would be the &quot;physical price momentum&quot; found in the article &quot;Physical Approach to Price Momentum and Its Application to Momentum Strategy&quot; (Jaehyung Choi, 2014). In this article, they use the momentum definition from physics litterature, and compute the momentum returns in S&amp;amp;P500, by using it... and receive larger return than with the &quot;traditional&quot; momentum definition.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Another example is from the article &quot;Eureka! A Momentum Strategy that Also Works in Japan&quot; (Denis B. Chaves, 2012) that uses the idiosyncratic returns from market regressions for his own definition of momentum.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="9481" LastEditorUserId="9481" LastEditDate="2014-07-07T15:37:28.697" LastActivityDate="2014-07-08T14:41:02.350" Title="The Definition(s) of Momentum" Tags="&lt;quant-trading-strategies&gt;&lt;momentum&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="12951" PostTypeId="1" CreationDate="2014-07-07T10:30:16.697" Score="2" ViewCount="264" Body="&lt;p&gt;I'd appreciate help with the following questions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose there are two stocks $A$ and $B$ with expected returns $E_A, E_B &amp;gt;0$ and volatilities  $v_A, v_B &amp;gt;0$, respectively . Also, suppose their correlation is $\rho_{AB} = \rho &amp;lt;0$. Given a dollar amount $D&amp;gt;0$ to invest &lt;em&gt;without shorting&lt;/em&gt;, how should $D$ be invested in $A,B$ so that i) Expected return is maximized? ii) Overall volatility is minimized?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My second question: same questions (i) and (ii) but now with shorting allowed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuitively, volatility is a standard deviation of a stock's price (or return) over a fixed period of time. Therefore (for a fixed period of time), in the case $E_A &amp;gt; E_B$ and $v_A&amp;gt;v_B$, I'd expect a 'middle-ground' determined by comparing the ratios $E_A/v_A$ with $E_B/v_B$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, how might Sharpe ratio play into these questions? (would it measure the 'strength' of a strategy?) Also, how approach this question for $n&amp;gt;2$ stocks $A_1,\ldots, A_n$? I would think to set $A = A_1$ and $B = A_2 +\cdots + A_n$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Concrete (mathematical) answers as well as general references to tackle these problems is appreciated.&lt;/p&gt;&#xA;" OwnerUserId="9482" LastEditorUserId="9482" LastEditDate="2014-07-09T12:06:44.800" LastActivityDate="2014-07-09T12:13:57.763" Title="2 stocks, no shorting vs shorting. (concrete questions, mean-variance)" Tags="&lt;volatility&gt;&lt;correlation&gt;&lt;modern-portfolio-theory&gt;&lt;pairs-trading&gt;&lt;expected-return&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12952" PostTypeId="2" ParentId="12951" CreationDate="2014-07-07T12:33:18.053" Score="0" Body="&lt;p&gt;Firstly, to answer your question for part (i), this part of the question makes&#xA;no sense - your expected return is unbounded and is asymptotically&#xA;linear with respect to risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let ${\bf w}\in\mathbb{R}^{2}$ denote your vector of weights, $\Omega$&#xA;denote the covariance matrix and $\iota$ denote a unit exposure vector&#xA;(defined by $\iota_{j}:=1\ \forall j, j \in \mathbb{Z}^{*}$). We have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$&#xA;\mu_{P}={\bf w}\cdot\mu=\sum w_{i}\mu_{i}&#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$&#xA;\sigma_{P}^{2}={\bf w}^{T}\Omega{\bf w}=\sum_{i\neq j}w_{i}w_{j}\sigma_{i}\sigma_{j}\rho_{ij}&#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$n\in\mathbb{Z}^{*}$ equality constraints of form $g_{k}\left({\bf w}\right)=c,\ c\in\mathbb{R},k=1,...,n$&#xA;are imposed. We define the Lagrangian:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$&#xA;\mathcal{L}\left({\bf w},k_{1},...,k_{n}\right):=\dfrac{1}{2}{\bf w}^{T}\Omega{\bf w}+k_{1}g_{k}\left({\bf w}\right)+...k_{2}g_{k}\left({\bf w}\right)&#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, for a single constraint that you are fully invested, you solve for the Lagrange multipliers for:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$&#xA;\mathcal{L}\left({\bf w},l\right)=\dfrac{1}{2}{\bf w}^{T}\Omega{\bf w}+l\left(1-{\bf w}\cdot\iota\right)&#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, you can find the minimum variance (volatility) portfolio:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$&#xA;{\bf w}_{min}=l\Omega^{-1}\iota=\dfrac{\Omega^{-1}}{\iota^{T}\Omega^{-1}\iota}&#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This answers your question for part (ii).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for your remaining question about shorting, this could be expressed&#xA;as an inequality constraint ${\bf w}\geq{\bf 0}$ for ${\bf w},{\bf 0}\in\mathbb{R}^{2}$.&#xA;Then, you can formulate this as a classical nonlinear programming&#xA;problem and solve the first order necessary conditions (Karush-Kuhn-Tucker&#xA;conditions).&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2014-07-07T12:33:18.053" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12956" PostTypeId="2" ParentId="12935" CreationDate="2014-07-07T13:58:42.967" Score="1" Body="&lt;p&gt;You can also include variance reduction techniques in you monte carlo simulations, such as control variates or antithetic variates. Both aim at reducing the variability of your simulated option price and are very popular for monte carlo simulations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Antithetic_variates&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Antithetic_variates&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Control_variates&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Control_variates&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both are very simple to implement, especially antithetic variates which correspond to a second path for your underlying with negatively correlated random numbers to the first path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Antithetic variates usually work very well and should reduce the variability of your results substantially. Control variates depend on the design of your valuation model and the payoff structure of the derivative. You can also combine both.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The book by Glasserman about Monte Carlo Techniques in Financial Engineering gives some excellent guidance.&lt;/p&gt;&#xA;" OwnerUserId="6748" LastActivityDate="2014-07-07T13:58:42.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12958" PostTypeId="2" ParentId="12950" CreationDate="2014-07-07T15:29:08.060" Score="5" Body="&lt;p&gt;You may want to have a look at the papers by&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Jegadeesh &amp;amp; Titman (1993) Returns to Buying Winners and Selling&#xA;Losers: Implications for Stock Market Efficiency&lt;/li&gt;&#xA;&lt;li&gt;De Bondt &amp;amp; Thaler (1985) Does the stock market overreact?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;They are (afaik) the by far most cited publications on momentum (and the calendar-time-method to calculate momentum returns). You should get a basic definition of momentum in stock returns and momentum in general after having read both papers. There is also tons of research about momentum in other asset classes.&lt;/p&gt;&#xA;" OwnerUserId="6748" LastActivityDate="2014-07-07T15:29:08.060" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12959" PostTypeId="1" AcceptedAnswerId="12961" CreationDate="2014-07-07T15:41:46.340" Score="8" ViewCount="140" Body="&lt;p&gt;How would you go about valuing a European warrant that entitles you to a) 1 share of a company and 2) 1 warrant on that same company?&lt;/p&gt;&#xA;" OwnerUserId="9487" LastEditorUserId="848" LastEditDate="2014-07-07T15:45:21.830" LastActivityDate="2014-07-09T19:50:39.923" Title="Valuing a warrant on a warrant" Tags="&lt;options&gt;&lt;valuation&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12960" PostTypeId="1" CreationDate="2014-07-07T15:50:25.453" Score="2" ViewCount="62" Body="&lt;p&gt;Let's say in a simple world, we have 3 persons, a banker, a businessman and a worker. Then we apply the current monetary system in this economy. So for the system to get started, we need a banker to create money for this economy. The banker lends the businessman USD120 (money created out of thin air) for 1 day with 10% interest to start a business to make food for everyone. (As you can see the total population is only 3). The businessman hires the worker to make food from whatever source for USD40 wages. (Let’s assumed the production can supply more then 3 persons) Then the businessman sells the food in the market for USD40 per meal. Obviously everyone needs to eat so the banker and worker will buy 1 meal each. The businessman himself gets the meal for free of course. In the end of the day, here is the accounting for this economy:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The businessman started off with USD120, he paid USD40 wages and made USD80&#xA;from selling the food. Therefore his net worth was USD160.&lt;/li&gt;&#xA;&lt;li&gt;The worker earns USD40 and spends USD40 for food. (Balance zero).&lt;/li&gt;&#xA;&lt;li&gt;The banker didn't have money to buy food, so he &quot;created&quot; the money&lt;br&gt;&#xA;to buy food for himself. Therefore in total he had created USD160 for&lt;br&gt;&#xA;the economy.&lt;/li&gt;&#xA;&lt;li&gt;The businessman has to pay the banker back the principal USD120 +&lt;br&gt;&#xA;interest USD12. So his net worth now is USD160 - USD132 = USD28.&lt;/li&gt;&#xA;&lt;li&gt;The banker made USD12 after cancelling out the debt USD120. So he took&lt;br&gt;&#xA;USD12 to offset USD40 he spent earlier. However he left with USD28 in&lt;br&gt;&#xA;debt which is exactly the balance of the economy.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;With this simplest model of economy, can I say that money creation (or quantitative easing) is nothing wrong at all?&lt;/li&gt;&#xA;&lt;li&gt;Let's assume that the banker is also a government, if the economy is well managed, isn't the government always be in debt for the sake of public interest? &lt;/li&gt;&#xA;&lt;li&gt;If the above is true, can we say that a government with surplus in accounting would mean poverty in public? (For example, if the banker would have collected income tax say 20% from the worker, he would not have enough to buy food. Of cause instead of becoming poor the worker could also ask for a pay rise in order to make a living. But that would affect businessman's income too.)&lt;/li&gt;&#xA;&lt;li&gt;A super well managed economy will leave no one in excess/lack of money but fulfill the need of living which is goods and services that everyone gets to enjoy. (For instance if the food price was USD12/meal and wages was USD12, then everyone including banker will have zero balance. Isn't this a perfect economic system?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="9486" LastActivityDate="2014-07-07T15:50:25.453" Title="Isn't a perfect economic system always in debt?" Tags="&lt;quantitative&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="1" ClosedDate="2014-07-07T16:52:48.547" ContentLicense="CC BY-SA 3.0" />
  <row Id="12961" PostTypeId="2" ParentId="12959" CreationDate="2014-07-07T16:33:11.327" Score="7" Body="&lt;p&gt;You are essentially dealing with two options:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$EU\,{Warrant}(S_t) = BlackScholesCall(S_t)+CompoundCall(S_t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Black-Scholes formula is known, and Compound Option pricing has various approaches in research which you may find.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-07-09T19:50:39.923" LastActivityDate="2014-07-09T19:50:39.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12962" PostTypeId="2" ParentId="12951" CreationDate="2014-07-07T18:02:18.710" Score="2" Body="&lt;p&gt;The concrete (general) answer to part (ii) of my question seems to be contained in Equation 8 of the following link:&#xA;&lt;a href=&quot;http://www.columbia.edu/~ks20/FE-Notes/4700-07-Notes-portfolio-I.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.columbia.edu/~ks20/FE-Notes/4700-07-Notes-portfolio-I.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular, interpreting $\sigma$ as volatility, take for example $E_A=0.10,\sigma_A=0.15,E_B=0.25,\sigma_B=0.40$ and $\rho =−0.2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get that about 83 percent of the money should be invested in $A$ and 17 percent for $B$. Namely, if $D = 1000$, then about 830 into $A$ and 170 into $B$. No shorting is required in this case since $\rho &amp;lt;0$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The return, as calculated from Eq. (4) in the above pdf, in this case is about $+125$ in profit.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Update. Regarding (i). Please correct me if I'm wrong, but as for &quot;maximizing return&quot; it seems we want to maximize the following function: $R(a) = aE_A + (1-a)E_B$. Since $R(a)$ is linear in $a$, then we see that $\max R(a)$ subject to  $0\leq a \leq 1$, occurs at $a = 1$ iff $E_A\geq E_B$ or either at $a = 0$ iff $E_A &amp;lt; E_B$. Certainly though, the approach should be different if we are maximizing return with respect to a specified level of risk or volatility in the desired portfolio (help on this last point would be appreciated).&lt;/p&gt;&#xA;" OwnerUserId="9482" LastEditorUserId="9482" LastEditDate="2014-07-09T12:13:57.763" LastActivityDate="2014-07-09T12:13:57.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12963" PostTypeId="2" ParentId="12942" CreationDate="2014-07-07T19:21:36.810" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Are there any regulations baring shorting these 'shadily marketed stocks' ?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In the markets I'm most familiar with, Canadian, the answer is no.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be honest the biggest hurdle you'll come across is how do you short penny stocks that are being pumped and dumped?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) There will often be no options on these so you can't use that avenue&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Where will you get borrow on the stock, if its a penny stock, getting the borrow to short can be tough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) If you can get borrow, its likely to be expensive, Can you afford to hang onto the borrow long enough to cover your short?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If after all that you can short the stock then you need to consider, do you have the stomach to short and watch the stock rise due to the &quot;pump&quot;/hype the stock is getting?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Will you close the short after your first margin call?  What about your second one?&lt;/p&gt;&#xA;" OwnerUserId="743" LastEditorUserId="743" LastEditDate="2014-07-07T19:45:25.123" LastActivityDate="2014-07-07T19:45:25.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12964" PostTypeId="1" CreationDate="2014-07-08T02:20:44.050" Score="1" ViewCount="207" Body="&lt;p&gt;HJM model, $df(t,T) = \mu(t,T) dt + \xi (t, T)dW(t)$, is  defined in risk-neutral measure $\mathbb{Q}$, according to Brigo's &quot;Interest Rate Models&quot; book.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder, how could I transform it to  real measure $\mathbb{P}$? Is it mentioned in any book?&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2014-07-08T02:20:44.050" Title="How to convert HJM model risk-neutral measure $\mathbb{Q}$ to real measure $\mathbb{P}$?" Tags="&lt;interest-rates&gt;&lt;risk-neutral-measure&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12965" PostTypeId="2" ParentId="11545" CreationDate="2014-07-08T05:07:47.283" Score="2" Body="&lt;h1&gt;Python version of Brian's R code:&lt;/h1&gt;&#xA;&lt;p&gt;Brian's code automatically grabs the first expense ratio it finds, which is the one you wanted.  This version is a little more explicit.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;import urllib2, re&#xA;stockSymbols = [ &amp;quot;VDIGX&amp;quot;, &amp;quot;VFIAX&amp;quot; ]&#xA;expenses = [ [ &amp;quot;Fund&amp;quot;, &amp;quot;Most Recent Expense Ratio&amp;quot; ] ]&#xA;for stockSymbol in stockSymbols:&#xA;    page = urllib2.urlopen(&amp;quot;http://finance.yahoo.com/q/pr?s=&amp;quot; + stockSymbol + &amp;quot;+profile&amp;quot; )&#xA;    data = page.read()&#xA;    row = re.findall(&amp;quot;Annual Report Expense Ratio.*?&amp;lt;/tr&amp;gt;&amp;quot;, data)&#xA;    if len(row) &amp;gt; 0:&#xA;        ER = re.findall(&amp;quot;&amp;lt;td.*?&amp;gt;(\d+\.\d+).*?&amp;lt;/td&amp;gt;&amp;quot;, row[0] )[0]&#xA;        expenses.append( [ stockSymbol, ER ] )&#xA;    else:&#xA;        print stockSymbol, &amp;quot;does not appear to be a fund with an expense ratio&amp;quot;&#xA;print &amp;quot;\n&amp;quot;.join( i[0] + &amp;quot;,&amp;quot; + i[1] for i in expenses )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9494" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2014-07-08T05:13:39.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12966" PostTypeId="1" CreationDate="2014-07-08T08:40:11.667" Score="2" ViewCount="76" Body="&lt;p&gt;I have a strategy &lt;em&gt;f&lt;/em&gt; that takes parameters &lt;em&gt;x&lt;/em&gt;,&lt;em&gt;y&lt;/em&gt; (for &lt;em&gt;x&lt;/em&gt;,&lt;em&gt;y&lt;/em&gt; taking values in integer ranges). I get two grids (of returns and volatility values) from computing &lt;em&gt;f(xi,yi)&lt;/em&gt; for integer ranges &lt;em&gt;x1 &amp;lt;= xi &amp;lt;= x2&lt;/em&gt; and &lt;em&gt;y1 &amp;lt;= yi &amp;lt;= y2&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question: what is the standard optimization techniques of determining areas in this discrete grid that are robust with respect to &lt;b&gt;both&lt;/b&gt; returns and volatility values? The simplest way that comes to mind is given by this pseudo-code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;threshold_ret = ...;   // minimum required threshold&#xA;threshold_vol = ...;   // maximum allowed volatility&#xA;threshold_rr = ...;    // minimum required returns stability radius &#xA;threshold_rv = ...;    // minimum required volatility stability radius&#xA;candidates = empty list;&#xA;foreach (xi,yi) do&#xA;     ret = returns at xi,yi;&#xA;     vol = volatility at xi,yi;&#xA;     rr = maximum stability radius for returns grid at xi,yi;&#xA;     rv = maximum stability radius for volatility grid at xi,yi;&#xA;     if (ret &amp;gt; threshold_ret) and (vol &amp;lt; threshold_vol) and&#xA;        (rr &amp;gt; threshold_rr) and (rv &amp;gt; threshold_rv) then&#xA;            add (xi,yi,rr,rv) to candidates list;&#xA;     end if&#xA;end for&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also, assume I have two acceptable regions &lt;em&gt;R1&lt;/em&gt; and &lt;em&gt;R2&lt;/em&gt; from the candidates list. For &lt;em&gt;R1&lt;/em&gt;, let stability radius for returns grid be &lt;em&gt;rr1&lt;/em&gt;, and for volatility grid be &lt;em&gt;vr1&lt;/em&gt;. similarly, let these quantities be &lt;em&gt;rr2&lt;/em&gt; and &lt;em&gt;vr2&lt;/em&gt; for region &lt;em&gt;R2&lt;/em&gt;. Given that there are different cases such as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(rr1 &amp;gt; rr2) and (vr1 &amp;lt; vr2)&#xA;(rr1 &amp;lt; rr2) and (vr1 &amp;lt; vr2)&#xA;(rr1 &amp;gt; rr2) and (vr1 &amp;gt; vr2)&#xA;(rr1 &amp;gt; rr2) and (vr1 &amp;gt; vr2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;what is the reasonable metric to use to select from these regions? What if there are many such regions?&lt;/p&gt;&#xA;" OwnerUserId="9498" LastEditorUserId="848" LastEditDate="2014-07-08T08:54:59.157" LastActivityDate="2014-07-08T08:54:59.157" Title="robust regions in grid search" Tags="&lt;volatility&gt;&lt;quant-trading-strategies&gt;&lt;returns&gt;&lt;optimization&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12968" PostTypeId="2" ParentId="12916" CreationDate="2014-07-08T12:07:57.200" Score="-1" Body="&lt;p&gt;Here is a simple (trivial) non-finance answer for the case of flat interest rates. Multiply both the denominator $F(s,t, T)$ and the numerator $F(s,s,T)$ with $e^{rs}$.&lt;/p&gt;&#xA;" OwnerUserId="8072" LastEditorUserId="8072" LastEditDate="2014-07-08T12:13:16.263" LastActivityDate="2014-07-08T12:13:16.263" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="12969" PostTypeId="2" ParentId="12916" CreationDate="2014-07-08T12:40:00.813" Score="4" Body="&lt;p&gt;Note that $\frac{F(0,s,T)}{F(0,t,T)} = \frac{T-t}{T-s}\frac{B(0,s)-B(0,T)}{B(0,t)-B(0,T)}$ and $\frac{F(s,s,T)}{F(s,t,T)} = \frac{T-t}{T-s}\frac{B(s,s)-B(s,T)}{B(s,t)-B(s,T)}$. Multiplying the numerator and denominator of the last expression with $B(0,s)$ and noting that $B(0,s)B(s,u)=B(0,u)$ (investing one Dollar for $s$ years and then for another $u-s$ years is equivalent to investing one Dollar for $u$ years) leads to the required expression.&lt;/p&gt;&#xA;" OwnerUserId="8072" LastActivityDate="2014-07-08T12:40:00.813" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12970" PostTypeId="2" ParentId="12950" CreationDate="2014-07-08T14:41:02.350" Score="8" Body="&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2422183&quot;&gt;Kenetic Component Analysis&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I am to summarize the work of the authors from a broader view than that which is taken in the abstract, essentially the &lt;em&gt;price process&lt;/em&gt; is decomposed into position, velocity and acceleration reminiscent of projectile motion in classical mechanics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I added this as an answer so that if @Pierre wants to accept it he may.&lt;/p&gt;&#xA;" OwnerUserId="4910" LastActivityDate="2014-07-08T14:41:02.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12971" PostTypeId="1" CreationDate="2014-07-08T15:25:02.593" Score="7" ViewCount="17615" Body="&lt;p&gt;What happens to the Security market line (within the CAPM model) when the risk-free rate turns negative?&lt;/p&gt;&#xA;" OwnerUserId="9502" LastEditorUserId="467" LastEditDate="2014-07-22T15:36:36.260" LastActivityDate="2020-03-27T11:51:07.430" Title="What are the implication of a negative risk-free rate on SML?" Tags="&lt;capm&gt;" AnswerCount="5" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="12974" PostTypeId="1" AcceptedAnswerId="12975" CreationDate="2014-07-08T16:28:20.083" Score="0" ViewCount="76" Body="&lt;p&gt;currently, I'm calculating the return of a stock, for individual year and multiple years. I tend to answer the following question.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Return of a stock for end of year 2010 (Individual year)&lt;/li&gt;&#xA;&lt;li&gt;Return of a stock for end of year 2011 (Individual year)&lt;/li&gt;&#xA;&lt;li&gt;Return of a stock for beginning of year 2010 till end of year 2011 (Multiple years)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Assuming,&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I purchase 1 unit of stock at 1st January 2010, at price $1&lt;/li&gt;&#xA;&lt;li&gt;No further buy transaction &amp;amp; sell transaction in between, in beginning of year 2010 till end of year 2011&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Here's my calculation&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Return for end of year 2010 (Stock price reach $2.5 at end of year)&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Date            Price&#xA;01/01/2010      -$1.0 (Invest)&#xA;31/12/2010      $2.5&#xA;&#xA;XIRR([01/01/2010, 31/12/2010], [-1.0, 2.5]) = 1.506&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Return for end of year 2011 (Stock price reach $1.8 at end of year)&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;We assume stock opening price at the beginning of year is $2.5.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Date            Price&#xA;01/01/2011      -$2.5 (Invest)&#xA;31/12/2011      $1.8&#xA;&#xA;XIRR([01/01/2011, 31/12/2011], [-2.5, 1.8]) = -0.2806&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Return for beginning of year 2010 till end of year 2011 (Multiple years)&lt;/h2&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Date            Price&#xA;01/01/2010      -$1.0 (Invest)&#xA;31/12/2011      $1.8&#xA;&#xA;XIRR([01/01/2010, 31/12/2011], [-1.0, 1.8]) = 0.3422&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I was wondering, is there any relationship between 0.3422 (Return for multiple years) and 1.506 (Return for individual year), -0.2806 (Return for individual year).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way for me to derive 0.3422, based on value 1.506 &amp;amp; -0.2806 ?&lt;/p&gt;&#xA;" OwnerUserId="2244" LastEditorUserId="2244" LastEditDate="2014-07-08T16:56:39.590" LastActivityDate="2014-07-08T16:56:39.590" Title="Is there any relationship between investment return of a stock, for individual year (Yearly return) and multiple years (Overall annualized return)" Tags="&lt;equities&gt;&lt;returns&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12975" PostTypeId="2" ParentId="12974" CreationDate="2014-07-08T16:48:43.787" Score="3" Body="&lt;p&gt;Are you sure the return for two years is 0.7214? It should be 0.3422 per year if you are using 31/12/2011, and 0.3416 if you are using 01/01/2012 as the end date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming the last number (because it makes for two full years, therefore easier to calculate), yes, there is a formula to derive it from the return of the individual years. It's the &lt;a href=&quot;http://en.wikipedia.org/wiki/Geometric_average&quot; rel=&quot;nofollow&quot;&gt;geometric average&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;=SQRT((1+1.506) * (1-0.2806)) - 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6659" LastActivityDate="2014-07-08T16:48:43.787" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12976" PostTypeId="2" ParentId="12971" CreationDate="2014-07-08T17:14:24.047" Score="5" Body="&lt;p&gt;The risk-free rate is the y-intercept of the Security market line. If the risk free rate goes negative the y-intercept of the Security market line would simply be below the x-axis. So if the risk-free rate decreases the whole line shifts down. This just means people are willing to pay for safety. According to the formula for the SML:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;E(Ri) : expected return of a security&lt;/li&gt;&#xA;&lt;li&gt;E(Rm) : expected return of the market&lt;/li&gt;&#xA;&lt;li&gt;B : systematic risk&lt;/li&gt;&#xA;&lt;li&gt;Rm : market risk&lt;/li&gt;&#xA;&lt;li&gt;Rf : risk-free rate&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;E(Ri) = Rf + B(E(Rm) - Rf)&lt;/p&gt;&#xA;" OwnerUserId="9501" LastActivityDate="2014-07-08T17:14:24.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12979" PostTypeId="2" ParentId="9476" CreationDate="2014-07-08T20:35:14.363" Score="4" Body="&lt;p&gt;It is true that intraday/market-making strategies don't have a reasonable &quot;return&quot; metric.  For this reason you can't characterize them with the Sharpe Ratio, which depends on a capital basis and how that basis is leveraged (not to mention the risk-free rate on the capital basis).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you're asking is how to characterize the performance of a daily stream of dollar income that doesn't have a capital basis.  Typically I would start with mean, standard deviation, and skewness.  Or I might ask for %Winning days and AvgWin/AvgLoss, or Profit Factor.  Bootstrapping your data does not benefit any of these measures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I would go to other metrics where bootstrapping (i.e., resampling the returns to generate different return paths) could be beneficial.  E.g., max drawdown, or max time to recover (i.e., return to high water mark).&lt;/p&gt;&#xA;" OwnerUserId="8164" LastActivityDate="2014-07-08T20:35:14.363" CommentCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="12980" PostTypeId="5" CreationDate="2014-07-08T21:49:53.690" Score="0" Body="&lt;p&gt;In finance, the asset returns are the change in the value of an investment over-time mainly cause of:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;change in the market value of the asset;&lt;/li&gt;&#xA;&lt;li&gt;interests perceived by the investor;&lt;/li&gt;&#xA;&lt;li&gt;dividends;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;It can includes taxes, commission paid when it is computed as net value.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-04-30T13:38:12.387" LastActivityDate="2015-04-30T13:38:12.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12981" PostTypeId="4" CreationDate="2014-07-08T21:49:53.690" Score="0" Body="The asset rate of returns is the profit on a particular investment; it includes any change in the asset value, interest, commission or dividends and so, all other cash-flows which an investors receive or pays due to the investment." OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-04-30T13:38:15.893" LastActivityDate="2015-04-30T13:38:15.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12984" PostTypeId="1" CreationDate="2014-07-09T02:59:09.870" Score="2" ViewCount="289" Body="&lt;p&gt;This is for planning and risk management. I am stuck on the following thoughts -&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Back-test the trading strategy for a period similar to the one you expect and then project.&lt;/li&gt;&#xA;&lt;li&gt;Do the above using empirical distribution of the back-test period, similar to FHS.&lt;/li&gt;&#xA;&lt;li&gt;For portfolio, GARCH estimate variance into the future time steps, run MC using empirical distribution. This is like to except time varying volatility, also, you are doing it at each asset level. May use copula and draw correlated noise.&lt;/li&gt;&#xA;&lt;li&gt;Assume regardless of the market condition that trader or manager will find suitable trades and use his Sharpe ratio or %gain. Here draw-down will be difficult to handle. May be assume he will stick within his risk limits.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Please provide references with your answers. &lt;/p&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="7867" LastEditDate="2014-07-09T14:12:57.077" LastActivityDate="2015-07-06T07:31:44.527" Title="How to projectP&amp;L or drawdowns on pair trading , trading and portfolios?" Tags="&lt;portfolio-management&gt;&lt;trading&gt;&lt;risk-management&gt;&lt;pairs-trading&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2015-07-06T11:15:00.427" ContentLicense="CC BY-SA 3.0" />
  <row Id="12985" PostTypeId="2" ParentId="12629" CreationDate="2014-07-09T03:15:35.867" Score="1" Body="&lt;p&gt;You need to use log of prices, because log of returns are normally distributed.&#xA;So or where x is return-&#xA;$$ x=-\frac{1}{\tau} ln(\frac{S_{t+\tau}}{S_{t}}) $$&#xA;The annualized standard deviation can be scaled as +/-$ n\frac{\sigma}{\sqrt{\tau}} $ where n is your multiple. You can either ignore or estimate drift.&#xA;or look at it another way, S refers to the index&#xA;$$ln (S_t) = ln(S_{t-1}) + \left( \left(\mu - \frac{\sigma^2}{2} \right)dt + \sigma dW_t\right)$$     &lt;/p&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="7867" LastEditDate="2014-07-09T14:21:41.723" LastActivityDate="2014-07-09T14:21:41.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12987" PostTypeId="2" ParentId="12984" CreationDate="2014-07-09T10:58:44.463" Score="1" Body="&lt;p&gt;Backtesting on a past realization does not provide any meaningful &quot;estimate&quot;, as the variance of the &quot;estimate&quot; would be undefined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More meaningful would be to make distributional assumptions and get estimates through extensive Monte Carlo simulations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly, the estimates that you get would be &quot;meaningful&quot; under your specific distributional assumption, and, in practice, under mild deviations from these assumptions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(It remains understood that the mkt has no obligation whatsoever to &quot;follow&quot; your assumptions and distributions, and that is just a work model for you to get some indication. In addition, keep in mind that a simulated environment does not include the effect of your orders, which may and, with significant orders, actually is not negligible).&lt;/p&gt;&#xA;" OwnerUserId="5132" LastEditorUserId="5132" LastEditDate="2014-07-11T00:57:18.883" LastActivityDate="2014-07-11T00:57:18.883" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12988" PostTypeId="2" ParentId="10874" CreationDate="2014-07-09T11:12:34.683" Score="0" Body="&lt;p&gt;You first need to define &quot;hedge&quot;. Or else the question remains undefined, and the minimum risk is achieved not trading at all  ;-)&lt;/p&gt;&#xA;" OwnerUserId="5132" LastActivityDate="2014-07-09T11:12:34.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12990" PostTypeId="1" CreationDate="2014-07-09T14:07:42.990" Score="1" ViewCount="154" Body="&lt;p&gt;I am trying to find for each european bond in my database a proper Benchmark to compare them with the Bloomberg benchmarks for bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What i have done so far is to extract a list of all government bonds in Europe and calculate a simple linear formula where I compare 4 fields with each goverment bond:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- Coupon&#xA;- Maturity Date&#xA;- Issue Date&#xA;- Volume&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the formula used is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;f(bond,govBond) = abs(bondcoupon - govcoupon)*coefCoupon + abs (bondMaturityDate - gov MaturityDate)*coefMaturity + ...&#xA;Where the coef are used to give the same weight to each field&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, to find a proper benchmark, I choose the min value returned by this function (i.e the closest gov bond using these criterias).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The results of this approach is approximately a 25% match with Bloomberg list of Benchmark.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this a &quot;convenient&quot; way to benchmark bonds? I know that those 4 criterias are not sufficient (Maybe use Yield points from a yield curve or tenor, there are a lot of fields to choose) but I have chosen those 4 fields to simplify the computing (database contains at least 10000 bonds).&lt;/p&gt;&#xA;" OwnerUserId="7844" LastActivityDate="2014-07-09T22:52:18.153" Title="How to benchmark bonds?" Tags="&lt;bond&gt;&lt;benchmark&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="12991" PostTypeId="1" CreationDate="2014-07-09T14:38:08.543" Score="2" ViewCount="1181" Body="&lt;p&gt;Ultimately I'm trying to calculate stdev contribution, but I've hit a hurdle.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;20x20 correlation matrix for various assets&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Standard deviations for each asset&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Returns for each asset&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Weights corresponding to various portfolios&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I've derived:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Covariance Matrix&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Variance/Stdev for each of the portfolios&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I want:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Risk contributions for each asset in each portfolio, but that requires correlation of each asset to each individual portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So that's my hang up.  I can't seem to figure out how to calculate Covar(asset,portfolio) or correl(asset,portfolio).  &lt;/p&gt;&#xA;" OwnerUserId="9515" LastActivityDate="2014-07-10T07:02:24.460" Title="Correlation of asset to portfolio, given certain variables" Tags="&lt;correlation&gt;&lt;portfolio&gt;&lt;covariance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="12992" PostTypeId="1" CreationDate="2014-07-09T14:50:32.530" Score="4" ViewCount="1302" Body="&lt;p&gt;My question is about option based portfolio insurance in practice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some insurance companies offer products where there is a mutual fund (equity and bonds) and a guarantee attached. This guarantee is usually given by some investment bank.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The bank can either apply a CPPI model or it can apply option based insurance meaning that it acts as if it had sold a put option on the mutual fund. Talking about the option case: what do banks in practice do?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it usual to&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;hedge the risk by selling futures?&lt;/li&gt;&#xA;&lt;li&gt;swap the risk somehow?&lt;/li&gt;&#xA;&lt;li&gt;apply strict risk limits for the mutual fund?&lt;/li&gt;&#xA;&lt;li&gt;demand a certain strategy for the fund?&lt;/li&gt;&#xA;&lt;li&gt;anything else?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What is the best practice for options based portfolio insurance?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&#xA;To be more precise about the product: in Austria we have a pensions system financed by the state (by contributions by  the labor force). As this will probably not suffice for the future the population is motivated to invest in retirement pension insurance contracts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These insurance contracts are mainly saving contracts where monthly payments are invested in a mutual fund that holds 30% stocks and 70% bonds. Additional to this there are premiums by the state. Furthermore these insurance contracts need to have guarantees attached such that you get at least all your money invested back after a minimum time of say 10 years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume that this system is applied in other countries as well. So this question is rather general.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;final edit: there are insurance companies who sell these products in retail. Then there is the guarantee that can be implemented by an investment bank as option based portfolio insurance. I hope the term &quot;insurance&quot; is clear wherever it appears in my question.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2014-07-28T15:30:59.620" LastActivityDate="2014-07-28T15:30:59.620" Title="Option based portfolio insurance in practice" Tags="&lt;options&gt;&lt;portfolio-management&gt;&lt;insurance&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12993" PostTypeId="2" ParentId="12991" CreationDate="2014-07-09T14:55:47.557" Score="5" Body="&lt;p&gt;If $\Sigma$ is the covariance matrix of all assets and $w$ is the column vector of weightings of the asset in a certain portfolio. Then&#xA;$$&#xA;w^T \Sigma w = VAR&#xA;$$&#xA;is the variance of the portfolio. The contribution to volatility of asset $i$ is given by&#xA;$$&#xA;w_i (\Sigma w)_i/\sqrt{VAR},&#xA;$$&#xA;where $(\Sigma w)_i$ is the $i_{th}$ entry in the vector $\Sigma w$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that $(\Sigma w)_i$ is the covariance of the asset $i$ to the porfolio with weights $w$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can read more details in the following working paper and the references therein: &#xA;&lt;a href=&quot;http://arxiv.org/abs/1009.3638&quot; rel=&quot;nofollow&quot;&gt;http://arxiv.org/abs/1009.3638&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Proof: Write $r_p = \sum_{j=1}^n w_j r_j$, where $r_p$ is the portfolio return, then&#xA;$$&#xA;cov(r_i,\sum_{j=1}^n w_j r_j) = \sum_{j=1}^n w_j cov(r_i,r_j) = (\Sigma w)_i.&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2014-07-10T07:02:24.460" LastActivityDate="2014-07-10T07:02:24.460" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="12994" PostTypeId="1" CreationDate="2014-07-09T18:24:28.130" Score="0" ViewCount="951" Body="&lt;p&gt;I have a working excel workbook connected to Interactive brokers DDE API. I am struggling to upgrade to a more robust environment like Java. I tried to change it to ActiveX for Excel but the refreshing rate is limited and IB does not support microsoft RTD server. Can anybody suggest the easiest way to migrate my DDE workbook to Java. Since IB provides a java sample which provide the basic connection between TWS. Is it possible to feed the quote from Java API into the excel for calculation? &lt;/p&gt;&#xA;" OwnerUserId="9443" LastActivityDate="2015-04-27T03:32:24.847" Title="Excel to Java for Interactive brokers" Tags="&lt;programming&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="12995" PostTypeId="2" ParentId="12990" CreationDate="2014-07-09T22:52:18.153" Score="1" Body="&lt;p&gt;You represent your bond as a vector of 4 equivalently weighted parameter and try to find the optimal representation for the 1-norm. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Parameters are not equivalent, more than that they have non linear ties, it is not okay to represent a bond with a set of common parameters. If you have a family of bond with the same Coupon, Issue Date, Volume and different maturity date, the method will return the coupon with the nearest maturity date. But in fact you would probably be more interested to find the bond such that yield to maturity is the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You would have to find a better representation first.&lt;/p&gt;&#xA;" OwnerUserId="5052" LastActivityDate="2014-07-09T22:52:18.153" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="12996" PostTypeId="2" ParentId="12907" CreationDate="2014-07-09T23:18:52.693" Score="4" Body="&lt;p&gt;The formula is given in your link. For the real world probability without jump: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$x_t = x_{t-1} e^{-\eta \Delta t} +  \hat{x}(1-e^{-\eta \Delta t}) +\sigma \sqrt{\frac{1-e^{- 2 \eta \Delta t}}{2 \eta}} N(0,1) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$x_t$: price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$x_{t-1}$: PreviousPrice&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\hat{x}$: long term mean (a parameter)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Delta t$: Time step (one fraction)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\eta$: ReversionSpeed&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma$: Volatility   (daily volatility = annual volatility% / 100 / 250)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$N(0,1)$: Standard normal realisation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an R implementation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;set.seed(1) # Initialize the random number generation&#xA;&#xA;ReversionSpeed=0.1 #parameter&#xA;Timestep=1 &#xA;Volatility =0.1 &#xA;T = 50 # number of timesteps&#xA;x=0.5 #initial price&#xA;EquilibriumPrice=0.4 #equilibrium price&#xA;&#xA;for (i in 1:T){&#xA;  PreviousPrice = x[i-1]  &#xA;  N01 = rnorm(1,0,1)&#xA;  NextPrice = exp(log(PreviousPrice) * exp(-ReversionSpeed * Timestep) + log(EquilibriumPrice) * (1 - exp(-ReversionSpeed * Timestep))  + Volatility * N01  * sqrt((1 - (exp(-2*ReversionSpeed * Timestep))) / (2 * ReversionSpeed))) &#xA;  x=rbind(x,NextPrice)&#xA;}&#xA;&#xA;plot(x)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using these notation you should be able to deduce the risk neutral simulation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see it, I have given the parameters some values. In practice you should find the parameters that correspond to your asset. This is not easy. &#xA;This process is Called Calibration. You can look at the most common methods: Maximum likelihood estimation. This is an optimisation technique: given the recursive equation (the equation above) you find the theoretical distribution in function of the parameters, you then try to find the sets of parameters which is the most likely to give prices previously observed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want my opinion on models in general: It really depends on your data as models have evolved to fit specific datasets. But You need to choose the model first, not fitting a model to your dataset. (this imply you have to learn about models). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Models with jumps are used to take into account the fact that price distribution are heavy tailled. It is easy to consider them better than a model without jumps on the paper, but they are way more difficult to use in practice (specifficaly the calibration part, this imply you should learn about Calibration). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you reaaly want to use these complex tools without learning about models and ways to use them in practice (I do not recommend that) you should look at libraries for common languages as you won't be able to implement the models and methods easily. I suggest you to use R and its packages.&lt;/p&gt;&#xA;" OwnerUserId="5052" LastEditorUserId="5052" LastEditDate="2014-07-12T17:23:45.193" LastActivityDate="2014-07-12T17:23:45.193" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="12997" PostTypeId="2" ParentId="12935" CreationDate="2014-07-09T23:47:08.207" Score="-1" Body="&lt;p&gt;I would bet on the slowness on Monte carlo method. Your volatlity is quite high. The error would decrease as var/sqrt(pathcount)= var *0.01, where var is the variance of the final price. 50*0.7*0.01=0.35 ~ 0.4&lt;/p&gt;&#xA;" OwnerUserId="5052" LastActivityDate="2014-07-09T23:47:08.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14001" PostTypeId="1" AcceptedAnswerId="14372" CreationDate="2014-07-10T08:18:09.317" Score="4" ViewCount="6445" Body="&lt;p&gt;Some friends recommend to me Linear Gauss Markov model, saying it's interesting to have a look at it. Basically it's a framework different from HJM, with potential to extend, and the merit is that it's linear, so won't be so interwined as Hull White models, -- or so I was told.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just did a brief search, it's from Patrick Hagan, there are several of his papers, &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&quot;Markov Interest Rate Models&quot;, 1999, about the model, and  &lt;/li&gt;&#xA;&lt;li&gt;&quot;Methodology for Callable Swaps and Bermudan Exercise Into Swaptions&quot;, 2004&lt;/li&gt;&#xA;&lt;li&gt;&quot;Accrual Swaps and Rangge Notes&quot;, 2005, about the calibration &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;But besides that seems LGM was not so popular in other sources. For example, Damiano Brigo's book &quot;Interest Rate Models Theory and Practice&quot; and Leif Andersen's &quot;Interest Rate Modeling&quot; are two famous books, but neither mentioned LGM model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Did I miss something, or it's not so popular because for some reason, or did the two books just happen not to contain LGM?&lt;/p&gt;&#xA;" OwnerUserId="2161" LastEditorUserId="848" LastEditDate="2014-07-10T08:43:59.873" LastActivityDate="2019-01-15T21:12:12.140" Title="How popular is the Linear Gauss Markov (LGM) model?" Tags="&lt;interest-rates&gt;&lt;modeling&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14002" PostTypeId="1" CreationDate="2014-07-10T12:55:19.550" Score="2" ViewCount="1203" Body="&lt;p&gt;Editing my question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have decided to use multiple factor model to model my stress test. I am using factor shock method to implement the propagation of shocks. I am doing this according to a book &quot;Multi-Asset Investing: A Practical Guide to Modern Portfolio Management&quot; by Yoram Lustig. According to this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;The investor shocks any risk factor in the portfolio by a chosen amount. The adjusted returns of other risk factors are modelled through a &lt;strong&gt;covariance matrix&lt;/strong&gt; based on their correlation with the shocked risk factor. Finally, the hypothetical impact on the portfolio is calculated.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have run multiple factor regression on 5 factors against the assets in the portfolio and got the respective loadings (betas) for these 5 factors. I also have a covariance matrix of the factor returns. Now, I do not know how can I put a shock in this matrix. My question is how I design now that I shock one variable in the matrix and I get the returns of others. And then I can calculate the predicted/hypothetical return in that scenario.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: I cannot use Vector Auto Regression as it is not a recommended method for modelling stock returns.&#xA;The question may be naive, may be I am missing some really basic point here. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks &lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Manurag&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Thanks for your reply!!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I will explain a bit more of my problem. I want to perform a stress test on my portfolio of equities. So basically, I want to see the impact of shock in macroeconomic factors (e.g. 10 year interest rate) on the portfolio P&amp;amp;L. Theoretically, my approach is &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Obtain a set of relevant macroeconomic factors.&lt;/li&gt;&#xA;&lt;li&gt;Shock any one of these factors.&lt;/li&gt;&#xA;&lt;li&gt;Propagate this shock to other factors as the macroeconomic factors are generally correlated. Obtain the new values of factors.&lt;/li&gt;&#xA;&lt;li&gt;On the basis of risk model, calculate the portfolio P&amp;amp;L based on new set of risk factors.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So I want to know about some model or some similar thing that I can program, preferably in R, so that it becomes possible for me to do, say:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Change interest rate by -10% and see how it effects the portfolio P&amp;amp;L.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks again&#xA;Manurag&lt;/p&gt;&#xA;" OwnerUserId="11520" LastEditorUserId="11520" LastEditDate="2014-07-27T23:04:09.650" LastActivityDate="2014-07-27T23:04:09.650" Title="How to see the impact of one variable on a set of other variables?" Tags="&lt;regression&gt;&lt;covariance&gt;&lt;multivariate&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14003" PostTypeId="2" ParentId="14002" CreationDate="2014-07-10T13:42:00.580" Score="1" Body="&lt;p&gt;Your question is formulated in a very general way, this is why any answer will need to be general as well. In a nutshell and in full generality you need to estimate the joint distribution from your historical data since in most cases correlations alone are not sufficient to define the joint distribution. In a second step you can calculate the distribution contingent on one of the variables being shocked. Whether this is easy or difficult depends on the joint distribution and your specific requirements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you have the contingent distributions you can derive all convenient indicators, i.e. the &quot;impact&quot;, you desire.&lt;/p&gt;&#xA;" OwnerUserId="482" LastActivityDate="2014-07-10T13:42:00.580" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14004" PostTypeId="1" AcceptedAnswerId="14012" CreationDate="2014-07-11T05:32:30.003" Score="1" ViewCount="428" Body="&lt;p&gt;In Tomas Bjork's &lt;a href=&quot;http://f3.tiera.ru/2/F_Finance/FD_Derivatives/Bjoerk%20T.%20Arbitrage%20theory%20in%20continuous%20time%20%28OUP,%201998%29%28ISBN%200198775180%29%28T%29%28S%29%28324s%29_FD_.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Arbitrage Theory in Continuous Time&lt;/a&gt; (or &lt;a href=&quot;http://ideabuds.com/wp-content/uploads/2012/09/Tomas-Bjoerk-Arbitrage-Theory-in-Continuous-Time.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;), $\exists$ these propositions&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/z7rMU.png&quot; alt=&quot;Prop 2.24&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/Jqt65.png&quot; alt=&quot;Prop 2.25&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does the first formula follow from from the algorithm? I get that $\Pi(0;X) = V_0(0)$, but I don't really get what $E^{Q}[X]$ means...is that equal to $q_uu+q_dd$? Anyway using the algorithm I got $V_0(k) = \frac{1}{(1+R)^T} \sum_{l=0}^{T} V_T(k+l)q_u^{T-l}q_d^{l}$...is $\sum_{l=0}^{T} V_T(l)q_u^{T-l}q_d^{l}$ supposed to be $=q_uu+q_dd$?&lt;/p&gt;&#xA;" OwnerUserId="7788" LastActivityDate="2014-07-11T20:24:22.797" Title="Prove that the binomial algorithm implies the arbitrage free price at t=0 of a T-claim" Tags="&lt;arbitrage&gt;&lt;risk-neutral-measure&gt;&lt;binomial&gt;&lt;risk-neutral&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14005" PostTypeId="1" CreationDate="2014-07-11T06:41:54.910" Score="3" ViewCount="852" Body="&lt;p&gt;In&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.principlesofforecasting.com/files/pdf/Granger-stockmarket.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.principlesofforecasting.com/files/pdf/Granger-stockmarket.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Granger makes survey of some arguments. In section I there are two hypothesis H01, and H02.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;H01: Stock prices are a martingale&lt;/p&gt;&#xA;&#xA;&lt;p&gt;H02: A market is efficient with respect to information set I, if it is impossible to make economic profits by trading on the basis of this information set&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe I am missing something but stock prices better not be martingales as profitable companies should increase in value as time passes. The price will stay the same if period profits are returned to the shareholders. Otherwise nobody would invest. Hence dividend adjusted prices should be submartingales, at least for profitable companies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Same goes for H02, I am buying the stock knowing that the company is generating earnings, and even if I am buying at fair value I will have positive returns on the average.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the catch here? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="11526" LastEditorUserId="12" LastEditDate="2014-07-11T07:26:30.847" LastActivityDate="2014-09-06T13:38:28.490" Title="Martingale Stock Prices" Tags="&lt;martingale&gt;&lt;emh&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14007" PostTypeId="2" ParentId="10905" CreationDate="2014-07-11T09:50:44.843" Score="3" Body="&lt;p&gt;Can take a look the other pointers from wikipedia &lt;a href=&quot;http://en.wikipedia.org/wiki/Algorithmic_trading&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Algorithmic_trading&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another list is here: &lt;a href=&quot;http://algotradingindia.blogspot.it/2012/05/open-source-trading-platforms-list.html&quot; rel=&quot;nofollow&quot;&gt;http://algotradingindia.blogspot.it/2012/05/open-source-trading-platforms-list.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For hedge funds there is a famous top solution publicly available (referenced by wiki), but not &quot;open source&quot;. (&quot;Open source&quot; stuff is usually put around by enthusiasts with no clue about real algo trading.)&lt;/p&gt;&#xA;" OwnerUserId="5132" LastEditorUserId="5132" LastEditDate="2014-07-11T09:56:09.773" LastActivityDate="2014-07-11T09:56:09.773" CommentCount="0" CommunityOwnedDate="2014-07-11T09:50:44.843" ContentLicense="CC BY-SA 3.0" />
  <row Id="14008" PostTypeId="1" CreationDate="2014-07-11T13:27:01.677" Score="2" ViewCount="272" Body="&lt;p&gt;I cannot find any vendor that sell the full depth order by order data historically.&#xA;I called Euronext and for some sick reason they &quot;have the data&quot; but &quot;do not sell it&quot;. Do you guys know where I can buy it ?&lt;/p&gt;&#xA;" OwnerUserId="5339" LastActivityDate="2014-07-11T15:19:08.910" Title="Where can I buy historic raw order by order data for Euronext market?" Tags="&lt;data&gt;&lt;market-data&gt;&lt;european&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14009" PostTypeId="2" ParentId="14008" CreationDate="2014-07-11T15:19:08.910" Score="4" Body="&lt;p&gt;For NYSE EuroNext data I think &lt;a href=&quot;http://www.nyxdata.com/Data-Products/Euronext-Cash-Full-Order-Book-FOB&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; is the page to start at.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems to be what you are after &lt;a href=&quot;http://www.nyxdata.com/nysedata/default.aspx?tabID=1098&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are sample files provided &lt;a href=&quot;ftp://ftp.nyxdata.com/Historical%20Data%20Samples/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; showing hte format of their many historical data sets.&lt;/p&gt;&#xA;" OwnerUserId="743" LastActivityDate="2014-07-11T15:19:08.910" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14010" PostTypeId="2" ParentId="12871" CreationDate="2014-07-11T17:34:19.630" Score="2" Body="&lt;p&gt;The U.S. Consumer Price Index For All Urban Consumers (&lt;a href=&quot;http://research.stlouisfed.org/fred2/series/CPIAUCSL&quot; rel=&quot;nofollow&quot;&gt;http://research.stlouisfed.org/fred2/series/CPIAUCSL&lt;/a&gt;) is the CPI you hear in the news, and is the standard inflation number. &lt;/p&gt;&#xA;" OwnerUserId="8231" LastActivityDate="2014-07-11T17:34:19.630" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14011" PostTypeId="2" ParentId="12871" CreationDate="2014-07-11T18:02:07.753" Score="2" Body="&lt;p&gt;There are actually a lot of options nowadays. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Adjusting your data using historical realized inflation is certainly one way to go. And as @User1996 mentioned, the CPI for All Urban Consumers is the frequently quoted &quot;headline&quot; number. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, to the extent that asset prices reflect inflation expectations, it might be better to use forward-looking inflation expectations instead. For example, you could use inflation swaps (which are not perfect measure, since they embed an inflation risk premium). An excellent series that I frequently use in my own research is Cleveland Fed's inflation expectations estimates (&lt;a href=&quot;http://www.clevelandfed.org/research/data/inflation_expectations/&quot; rel=&quot;nofollow&quot;&gt;http://www.clevelandfed.org/research/data/inflation_expectations/&lt;/a&gt;, there's an Excel spreadsheet at the bottom). These are also based on inflation swap, but subtracts out inflation risk premium.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also publish some inflation expectations data on my blog &lt;a href=&quot;http://hungrydummy.com/chart/&quot; rel=&quot;nofollow&quot;&gt;http://hungrydummy.com/chart/&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2014-07-11T18:02:07.753" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14012" PostTypeId="2" ParentId="14004" CreationDate="2014-07-11T20:24:22.797" Score="1" Body="&lt;p&gt;I believe this is the way that Björk proposes, however I believe &quot;my&quot; way below is more elegant. The trick in Björk's case is to realize that in each &quot;iteration&quot; we get an expeted value:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V_0(0) = \frac{1}{1+R}\left(q_u V_{1}(1) + q_d V_1(0) \right) \\ = \frac{1}{(1+R)^{2}} \left( q_u^2 V_2(2) + 2q_uq_d V_2(1) + q_d V_2(0) \right) \\ = \frac{1}{(1+R)^{2}}E^Q[V_2].$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Continuing in the same fashion you will arrive at&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V_0(0) = \frac{1}{(1+R)^{T}}E^Q[V_T],$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;however to make this formal you should make some kind of induction argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My Method&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My methods does not use &lt;strong&gt;Proposition 2.24&lt;/strong&gt; but instead the fact that we already know the single period Binomial Model and the Law of total expectation. We already know that &lt;strong&gt;Proposition 2.25&lt;/strong&gt; holds true if $T=1$ since this reduces to the single-period Binomial model. So assume that $T \geq 2$ and assume that &lt;strong&gt;Proposition 2.25&lt;/strong&gt; holds true for $T-1$ periods. We when know from the induction assumption that. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \Pi(1; X) = \frac{1}{(1+R)^{T-1}}E^Q[\Phi(S_T)|Z_1] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \Pi(0; X) = \frac{1}{(1+R)}  E^Q[\Pi(1; X)],$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and hence&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \Pi(0; X) = \frac{1}{(1+R)}  E^Q[\Pi(1; X)] = \frac{1}{(1+R)^{T}} E^Q[E^Q[\Phi(S_T)|Z_1]] \\ = \frac{1}{(1+R)^{T}} E^Q[\Phi(S_T)].$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This concludes the proof of &lt;strong&gt;Proposition 2.25&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What does $E^Q[X]$ mean:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $Z_1,...,Z_T$ are independent random variables&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E[f(Z_1,...,Z_T)] = \sum_{z_1,...,z_T=\text{u or d}} f(z_1,...,z_T)P(Z_1=z_1)\cdots P(Z_T=z_T) \\ = \sum_{z_1,...,z_T=\text{u or d}} f(z_1,...,z_T)p_{z_1} \cdots p_{z_T}. $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This sum means that we sum over all possible outcomes/paths. Since we often use a martingale/risk neutral probability measure it is convenient to introduce the notation to denote the expectation under the probability measure $Q$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E^Q[f(Z_1,...,Z_T)] = \sum_{z_1,...,z_T=\text{u or d}} f(z_1,...,z_T)Q(Z_1=z_1)\cdots Q(Z_T=z_T) \\ = \sum_{z_1,...,z_T=\text{u or d}} f(z_1,...,z_T)q_{z_1} \cdots q_{z_T}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case $X=\Phi(S_T)$ which is a function of $Z_1,...Z_T$. Note also that $S_T = su^Yd^{T-Y}$ where $Y$ is the number of up-moves. The sum above over all outcomes can also be written as in Björk, using binomial coefficients:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E^Q[f(Z_1,...,Z_T)] = \sum_{z_1,...,z_T=\text{u or d}} f(z_1,...,z_T)q_{z_1} \cdots q_{z_T} \\ = \sum_{j=0}^T {T \choose j}q_u^j q_d^{T-j}\Phi(su^kd^{T-k})$$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope it all checks out, I'm used to a different notation when working with the Binomial Model!&lt;/p&gt;&#xA;" OwnerUserId="2376" LastActivityDate="2014-07-11T20:24:22.797" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14013" PostTypeId="1" CreationDate="2014-07-13T09:27:02.407" Score="0" ViewCount="89" Body="&lt;p&gt;Currently, I have the following transactions.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;01/01/2000 I used $1000 to purchase stocks&#xA;30/05/2000 I received $100 stock dividend.&#xA;31/12/2000 I sold all stocks for $2000.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hence, if I use XIRR to calculate&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;01/01/2000  -1000 (Invest in stock)&#xA;30/05/2000  100 (Received dividend)&#xA;31/12/2000  2000 (Sales in stock)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My yearly return is &lt;strong&gt;1.157284223&lt;/strong&gt; (115.73%)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the above calculated XIRR, may I know how much % does the received dividend contribute to the total XIRR? Is there any proper formula to calculate so?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wish to get x &amp;amp; y figure.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I am having annualized return 115.73%. Out of this 115.73% annualized&#xA;  return, x% is contributed by dividend gain, y% is contributed by stock&#xA;  sales.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The reason I ask so, as I'm currently building a portfolio performance chart.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/1AI40.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need to break down my yearly XIRR to different segments (dividend, sales gain, paper gain)&lt;/p&gt;&#xA;" OwnerUserId="2244" LastEditorUserId="2244" LastEditDate="2014-07-13T15:39:07.643" LastActivityDate="2014-07-13T16:27:06.460" Title="Break down XIRR to different segments" Tags="&lt;equities&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14015" PostTypeId="1" AcceptedAnswerId="14016" CreationDate="2014-07-13T11:13:00.660" Score="13" ViewCount="2437" Body="&lt;p&gt;Coming from physics, I am used to the fact that the Ito interpretation of most natural stochastic equations is wrong, and one should be using Stratonovich calculus instead (of course they are interchangeable, but going from one interpretation to the other will change the form of the equations). The situation is more subtle than I put it, as there are systems where Ito is in fact the more natural one. Even some very recent papers addressing the dilemma have come up with claims of cases where neither approach seems to work particularly well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am wondering why in finance it seems that people are only using the Ito approach. I've heard claims that the Stratonovich definition might open up arbitrage in some cases, but I would be interested in hearing about the generality of this statement and if it should always be true. Finally, and more importantly, I would like to know the intuition behind picking Ito calculus in finance in the first place.&lt;/p&gt;&#xA;" OwnerDisplayName="user8040" LastActivityDate="2014-07-14T02:34:08.673" Title="Why Ito calculus?" Tags="&lt;stochastic-calculus&gt;&lt;mathematics&gt;&lt;itos-lemma&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="14016" PostTypeId="2" ParentId="14015" CreationDate="2014-07-13T13:34:27.017" Score="9" Body="&lt;p&gt;In fact Ito and Stratonovich calculus are both mathematically equivalent. In the following paper you can e.g. see that both derivations lead to the same result, i.e. the Black-Scholes equation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://arxiv.org/abs/physics/0001040&quot;&gt;Black-Scholes option pricing within Ito and Stratonovich conventions by J. Perello, J. M. Porra, M. Montero and J. Masoliver&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the abstract:&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Options financial instruments designed to protect investors from the&#xA;  stock market randomness. In 1973, Fisher Black, Myron Scholes and&#xA;  Robert Merton proposed a very popular option pricing method using&#xA;  stochastic differential equations within the Ito interpretation.&#xA;  Herein, we derive the Black-Scholes equation for the option price&#xA;  using the Stratonovich calculus along with a comprehensive review,&#xA;  aimed to physicists, of the classical option pricing method based on&#xA;  the Ito calculus. We show, as can be expected, that the Black-Scholes&#xA;  equation is independent of the interpretation chosen. We nonetheless&#xA;  point out the many subtleties underlying Black-Scholes option pricing&#xA;  method.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The main fact that in finance the Ito calculus is chosen over Stratonovich is that it has a natural interpretation and intuition: Because the left endpoints of the intervals in the limiting process are being chosen this could be interpreted as the fact that in finance you don't know any future stock prices. In the Stratonovich calculus you choose the midpoints which would lie in the future (and are therefore, strictly speaking, unknown).&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2014-07-13T13:34:27.017" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14017" PostTypeId="2" ParentId="14015" CreationDate="2014-07-13T15:15:19.887" Score="11" Body="&lt;p&gt;My understanding is because the Ito's integration definition keeps the martingale property.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With Brownian motion $W(t, \omega)$ defined, to define stochastic integration  in a Riemann–Stieltjes style:&#xA;$$\int_0^t f(t, \omega) d W(t, \omega) = \lim_{\| \Delta_n\| \to 0 } \sum_{i=1}^{n} f(\tau_i,\omega) \left ( W(t_i, \omega) - W(t_{i-1}, \omega) \right ) $$&#xA;, the choice to made is that which point from $[t_{i-1}, t_i]$ shall $\tau_i$ pick?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $\tau_i = (t_{i-1}+t_i) /2 $, this is the Stratonovich integration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But look at the $f(t,\omega)$, if it's determined, or denoted as $f(t)$, we have  $\int_0^t f(t) d W(t, \omega)$ is a martingale. This is natural (by intuition) as $W(t, \omega)$ is a martingale, as a special case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So we hope the intuition goes on, that for a general $f(t,\omega)$, the integration is also a martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This lead to $\tau_i = t_{i-1}$, the Ito's integration.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;On @amlrg 's comment, about choosing martingale or non-arbitrage while defining stochastic calculus, it's a bit long so I'm appending the answer here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well, I'm not a math guy so below is just my guessing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My guess is that when Ito etc were building up the theory, comparing to &quot;non-arbitrage&quot;, &quot;martingale&quot; might be more interesting as it has more applications, a simpler concept, and more potential to extend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Non-arbitrage&quot; is about pricing in quant finance, besides that there were multiple kinds of problems related to stochastic calculus, for reference, pls consult examples given in Oksendal's book &quot;Stochastic Differential Equations&quot; chapter 1.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, martingale is simpler. To define non-arbitrage other concepts such as self-financing, conditional expectation are needed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Martingale is also a more fundamental concept. This makes it easier to extend the Ito calculus. If the $f(t,\omega)$ does not have bounded squared variation, so long as the exceptions has $0$ Lebesgue measure, the Ito integral still works: it's no longer a martingale, but still has &quot;&lt;a href=&quot;http://en.wikipedia.org/wiki/Local_martingale&quot;&gt;local martingale&lt;/a&gt;&quot; property. It's said that it can be further extend to &lt;a href=&quot;http://en.wikipedia.org/wiki/Malliavin_calculus&quot;&gt;Malliavin calculus&lt;/a&gt;, applying to the calculus of variations, defined on Hilbert space etc.. but that is already beyond my poor limited math knowledge.&lt;/p&gt;&#xA;" OwnerUserId="2161" LastEditorUserId="2161" LastEditDate="2014-07-14T02:34:08.673" LastActivityDate="2014-07-14T02:34:08.673" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14018" PostTypeId="1" CreationDate="2014-07-13T15:15:21.330" Score="0" ViewCount="2766" Body="&lt;p&gt;I did my best, but I could not find answer for this one - is there any good and in-depth source of knowledge about using Python for technical analysis ? Obviously, there are plenty of tutorials, blogs etc., but they are scattered around the web. I'm looking for something comprehensive. &lt;/p&gt;&#xA;" OwnerUserId="9369" LastActivityDate="2014-07-14T14:47:36.630" Title="Technical analysis in Python - source of knowledge" Tags="&lt;analysis&gt;&lt;python&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14019" PostTypeId="2" ParentId="12872" CreationDate="2014-07-13T15:26:00.117" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://www.maths.univ-evry.fr/pages_perso/jeanblanc/doctorat.html&quot; rel=&quot;nofollow&quot;&gt;Good lecture on credit risk here.&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more recent and advanced tools  you should read books and articles from: Brigo, Rebonato, Pykhtin.&lt;/p&gt;&#xA;" OwnerUserId="5052" LastActivityDate="2014-07-13T15:26:00.117" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14020" PostTypeId="2" ParentId="14013" CreationDate="2014-07-13T15:34:45.517" Score="0" Body="&lt;p&gt;You use 4 number (dividend/investment at first date, sales/investment at second date) to build one number. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is an infinite number of possibilities to obtain a given results so no you can't give the dividend part with only XIRR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have the investments/dividends/sales/dates well you can remove the sales and use only the dividends if you want the dividends part. &lt;/p&gt;&#xA;" OwnerUserId="5052" LastActivityDate="2014-07-13T15:34:45.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14021" PostTypeId="1" AcceptedAnswerId="14026" CreationDate="2014-07-13T16:13:14.187" Score="0" ViewCount="335" Body="&lt;p&gt;I looked onto different questions and answers about application of PCA on this site and found this interesting article :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://systematicedge.wordpress.com/2013/06/02/principal-component-analysis-in-portfolio-management/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://systematicedge.wordpress.com/2013/06/02/principal-component-analysis-in-portfolio-management/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It shows that after application of the PCA it is possible to get Eigen Portfolio that is permanently growing like almost straight line going up. I am using AlgLib to apply PCA to the list of currency timeseries and looking at the charts i am almost sure that it is applied correctly at least because it correctly identifies the currency pair that adds the most variance to the portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, neither eigenportfolio in my case look like the one displayed on this screenshot (PC4) :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What i need is :&lt;/strong&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/BojBa.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;This is what i usually get for MIN variance :&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/nv3sF.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;This is what i usually get for MAX variance :&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/vF2T5.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt; : how can i get the chart that would look like the one marked as PC4 on the screenshot above?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update # 1 :&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a lot of code and it is not well-formed so i will display only meaningful calculations with the following terms : &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Prices = Returns&lt;/li&gt;&#xA;&lt;li&gt;iOrder = K = number of assets, currency pairs&lt;/li&gt;&#xA;&lt;li&gt;iDepth = N = number of observations, prices for each currency pair&lt;/li&gt;&#xA;&lt;li&gt;Period = Time Frame e.g. 1 Day = in this example it means that 1&#xA;observation = 1 daily price&lt;/li&gt;&#xA;&lt;li&gt;iSeries = Matrix K x N = source matrix that contains data&#xA;synchronized by time&lt;/li&gt;&#xA;&lt;li&gt;iCharts = Matrix K x N = matrix that contains correctly scaled returns e.g. log(returns)&lt;/li&gt;&#xA;&lt;li&gt;Synthetics = plot that mimics open position on portfolio&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;1) &lt;em&gt;Synchronize(iPrices, Period, iOrder, iDepth)&lt;/em&gt; - synchronize assets by date and time&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) &lt;em&gt;GetEquityMatrix(iSeries, iCharts, iOrder, iDepth)&lt;/em&gt; - measure every currency in USD (i can use Log(Prices) here instead)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) &lt;em&gt;CAlglib::PCABuildBasis(iCharts, iDepth, iOrder, result, iEigenValues, iEigenVectors)&lt;/em&gt; - actual calculation of eigen values and eigen vectors&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) &lt;em&gt;Synthetics[N] = Sum(iCharts[0...K][N] x iEigenVectors[0...K][IndexOfVectorWithNeededVariance e.g. 0])&lt;/em&gt; - calculation of N-th value on the chart&lt;/p&gt;&#xA;" OwnerUserId="6855" LastEditorUserId="6855" LastEditDate="2014-07-13T17:51:37.413" LastActivityDate="2014-07-14T08:51:02.287" Title="How to get permanently growing chart within PCA" Tags="&lt;portfolio&gt;&lt;pca&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14022" PostTypeId="2" ParentId="14013" CreationDate="2014-07-13T16:27:06.460" Score="1" Body="&lt;p&gt;Not 100% sure but does the following work? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dividend gain:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-1000 purchase &#xA;  100 dividend&#xA; 1000 sell (ignoring sell profit) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sell profit:&#xA;-1000 purchase &#xA; 2000 sell&lt;/p&gt;&#xA;" OwnerUserId="9468" LastActivityDate="2014-07-13T16:27:06.460" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="14023" PostTypeId="2" ParentId="14018" CreationDate="2014-07-13T20:13:26.670" Score="2" Body="&lt;p&gt;I'd put this down as a comment, but don't have the reputation to do so. There is (or at least used to be) a &lt;a href=&quot;https://www.coursera.org/course/compinvesting1&quot; rel=&quot;nofollow&quot;&gt;two part MOOC course over at Coursera&lt;/a&gt; by one of the developers of &lt;a href=&quot;http://wiki.quantsoftware.org/index.php?title=QuantSoftware_ToolKit&quot; rel=&quot;nofollow&quot;&gt;QuantSoftware Toolkit&lt;/a&gt;. This is not an endorsement of the course or the software, just a statement of fact (for the record, I did do a part of the course, but found it too simplistic and dropped out. The library was easy enough to use, though, with extensive tutorials as to its inner workings available online). &lt;/p&gt;&#xA;" OwnerDisplayName="user8040" LastActivityDate="2014-07-13T20:13:26.670" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14024" PostTypeId="1" CreationDate="2014-07-13T20:42:59.467" Score="1" ViewCount="126" Body="&lt;p&gt;I asked a related question here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/12810/how-to-apply-levenberg-marquardt-to-max-likelihood-estimation?rq=1&quot;&gt;How to apply Levenberg Marquardt to Max Likelihood Estimation&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried the approach suggested it works for some of the parameters but not the variances.&#xA;I spoke to the author of the paper and he said he used Eviews to do the analysis, and that Eviews has a function that allows maxlikelihood estimation via the Marquardt algorithm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given that the Marquardt algorithm is generally used to solve least square type problems what is Eviews doing to allow it to be applied to maximum likelihood problems?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1.) Does it change the Marquardt algorithm? If so how?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2.) Does it reformulate the log likelihood maximization as a least squares problem? If so how?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Baz &lt;/p&gt;&#xA;" OwnerUserId="7077" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2014-07-13T20:42:59.467" Title="Max Likelihood via Marquardt Optimisation" Tags="&lt;time-series&gt;&lt;stochastic-processes&gt;&lt;optimization&gt;&lt;econometrics&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14025" PostTypeId="1" AcceptedAnswerId="14028" CreationDate="2014-07-14T02:26:39.253" Score="0" ViewCount="192" Body="&lt;p&gt;So for the backtesting , is it necessary to make an adjustment for the last day of the current contract and the first day of the next far contract? Even if there's is a gap, that's the actual price, u can't avoid the roll yield.&lt;/p&gt;&#xA;" OwnerUserId="7602" LastActivityDate="2014-07-14T17:26:25.523" Title="why people want to get a continuous time series from futures data?" Tags="&lt;futures&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14026" PostTypeId="2" ParentId="14021" CreationDate="2014-07-14T08:51:02.287" Score="1" Body="&lt;p&gt;Trying to answer:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;in the blog post that you mention the author looks at three equity funds and one REIT fund. One could say that these markets are different to FX markets (for various reasons but let's start with the question whether there is a risk premium in FX markets).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;what he does is the usual PCA analysis on the data. You find various questions in this forum and more links there. Look e.g. &lt;a href=&quot;https://quant.stackexchange.com/questions/11173/calculating-variance-explained-from-pca-loadings/11178#11178&quot;&gt;here: Calculating Variance Explained from PCA Loadings&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;when you have understood the math (you can't go on without understanding the math) then you see that PCA is an analysis tool for what has happened. Apparently there is a principle portfolio that looks like an upward sloping trend. Just recall that the eigenvalue attached to PC 4 is rather small compared to the eigenvalues of 1-3. Thus if in-sample small changes could change the picture in-sample (!). Out-of-sample things can go totally different.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2014-07-14T08:51:02.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14027" PostTypeId="2" ParentId="12992" CreationDate="2014-07-14T10:20:05.683" Score="3" Body="&lt;p&gt;It depends on the exact nature of the risk in question as well as the mandate of the options desk at the bank. Generally such products are &quot;created&quot; and hedged at exotic option sell-side desks. There are a myriad of different kinds of risk the bank and hence the insurance company may offer their clients insurance against. It could range from inflation risk, broad directional risk, volatility, correlation, and what have you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, I do not think there is a one-size-fits-all answer to your question. But as you brought up a mutual fund (equity and bonds) with insurance attached I try to add my thoughts in this area:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A number of scenarios could play out:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The desk may want to hedge against directional risk in which case it could either buy put options on broad bond and equity indexes, enter into forward agreements with other banks to custom tailor the hedge, it could source the hedge through internal trades with other desks to offload their exposure and hedge at cheaper cost. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Often times, however, it goes the other way around. A large exotic desk may sit on large baskets of cash equity, for example and it may package them and sell a correlation product, oftentimes attached to other products in order to market it as &quot;insurance&quot; or &quot;hedge&quot;. To mind come various correlation products that were sold during 2008/2009. Such desk would then approach a retail based bank to distribute said product or they may pitch the product to insurance companies which may buy the products for their own internal hedge or structure an insurance product with the sell-side bank to sell as insurance product to their own clients (and I guess that is what you mentioned).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Another possibility is that they simply knit-pick certain risk exposures, some of which they hedge out and others they happily take onto their own books if it suits their view. This may become less common now with reduced proprietary risk taking but nonetheless it is still done. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Edit, to reflect the additional information provided in the question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally, I have not heard about restrictions that are imposed on any mutual fund manager in order to insure against a possible loss of invested capital. However, that does not mean that insurance companies or in general issuers of such principal insured assets would not involve portfolio managers in order to work very closely with banks that structure such assets. Now, it happens, and I hear of banks that structure the whole product, hoping that their in-house asset managers get to manage the invested principal and the product is simply sold to insurance companies or other middle-men who mark up the price and then pass it to their clients. But it can also as well happen that buy side firms only outsource the insurance portion to structuring desks at banks. It depends on the relationships, the amount of principal that is expected to be invested, on the resources of the firm that actually invests the assets which of the two alternative routes is favored. Again, there is no single approach that is always taken but it really depends on above mentioned factors. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2014-07-14T13:26:24.690" LastActivityDate="2014-07-14T13:26:24.690" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14028" PostTypeId="2" ParentId="14025" CreationDate="2014-07-14T11:09:33.807" Score="1" Body="&lt;p&gt;Yes, you do need. Back-testing without contract rolling will result in artificial profits or loss that are not realizable in live trading. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose a particular market is in backwardation, a positive roll yield is therefore expected. To roll into the longer out contract upon expiration, you expect a lower price to establish the new position. So in live trading, you will unwind the current contract before expiration at the prevailing rate, and take the same position in the next contract. This process is called rolling, and you will realize no gains or loss, assuming transaction cost is negligible. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To simulate this process in back-testing, you will make the continuous price series, so the artificial price gap in the rolling day is filled. Otherwise, assuming you have a long position upon expiration that you will hold overnight, the back-testing will show an artificial gain in portfolio values if the market is in backwadation, or an artificial loss if the market is in cantango. &lt;/p&gt;&#xA;" OwnerUserId="9381" LastEditorUserId="7602" LastEditDate="2014-07-14T17:26:25.523" LastActivityDate="2014-07-14T17:26:25.523" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14029" PostTypeId="2" ParentId="14018" CreationDate="2014-07-14T14:47:36.630" Score="0" Body="&lt;p&gt;Not sure if it helps you directly but matplotlib (a library for graphs in Python) has some examples of use of technical analysis ie:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://matplotlib.org/examples/pylab_examples/finance_work2.html?highlight=finance&quot; rel=&quot;nofollow&quot;&gt;http://matplotlib.org/examples/pylab_examples/finance_work2.html?highlight=finance&lt;/a&gt;&#xA;&lt;a href=&quot;http://matplotlib.org/examples/pylab_examples/finance_demo.html?highlight=finance&quot; rel=&quot;nofollow&quot;&gt;http://matplotlib.org/examples/pylab_examples/finance_demo.html?highlight=finance&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11540" LastActivityDate="2014-07-14T14:47:36.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14031" PostTypeId="2" ParentId="12661" CreationDate="2014-07-14T22:20:58.723" Score="1" Body="&lt;p&gt;You can use the known result, that when $X\sim N(0,1)$, then $aX\sim N(0,a^2)$ where $a=\sigma_t$ is conditionally constant.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-07-14T22:20:58.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14032" PostTypeId="2" ParentId="2870" CreationDate="2014-07-15T00:28:12.917" Score="2" Body="&lt;p&gt;Most portfolios offer positive returns, and minimum variance portfolios are not exceptions to this rule. But by offering &quot;minimum variance,&quot; they also offer the lowest possibility of a negative deviation large enough to pull the actual return (expected return minus deviation), into negative territory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This property is attractive, which is to say that (all other things being equal), investors will be willing to &quot;pay up&quot; for it, until the anticipated return falls below some other market-based threshold&lt;/p&gt;&#xA;" OwnerUserId="2345" LastEditorUserId="2345" LastEditDate="2015-10-26T15:47:12.377" LastActivityDate="2015-10-26T15:47:12.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14033" PostTypeId="2" ParentId="7013" CreationDate="2014-07-15T00:55:33.517" Score="-1" Body="&lt;p&gt;Remember that Sharpe ratio includes a risk-free rate of return (&quot;RFR&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unless the RFR is zero, then excluding days when you have no position is not correct and will technically overstate your Sharpe ratio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And if you're using a RFR of zero then what you're actually providing is the signal-to-noise ratio.  (Although yes, I acknowledge that in recent years the RFR is &lt;em&gt;practically&lt;/em&gt; zero.  But that doesn't justify these other incorrect answers.)&lt;/p&gt;&#xA;" OwnerUserId="8164" LastEditorUserId="8164" LastEditDate="2014-07-15T15:47:15.363" LastActivityDate="2014-07-15T15:47:15.363" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14034" PostTypeId="5" CreationDate="2014-07-15T01:08:36.243" Score="0" Body="&lt;p&gt;&lt;strong&gt;Excess&lt;/strong&gt; return per unit of deviation in return.  Often confused with the simple mean / standard-deviation, a.k.a. signal-to-noise ratio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A correct Sharpe ratio is defined with respect to a benchmark, against which its excess return can be computed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice Sharpe ratio (SR) is annualized.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A very good reference is &lt;a href=&quot;https://www.tandfonline.com/doi/abs/10.2469/faj.v58.n4.2453&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Statistics of Sharpe Ratios, by Andrew W. Lo&lt;/a&gt;. It is explained in this paper &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the link with the &lt;strong&gt;t-statistic&lt;/strong&gt;: if a strategy has a Sharpe ratio or &lt;span class=&quot;math-container&quot;&gt;$S$&lt;/span&gt; that is computed on &lt;span class=&quot;math-container&quot;&gt;$N$&lt;/span&gt; days, then the &lt;em&gt;t-stat&lt;/em&gt; of the strategy is &lt;span class=&quot;math-container&quot;&gt;$S/\sqrt{N}$&lt;/span&gt;&lt;/li&gt;&#xA;&lt;li&gt;the correction that must be made if the strategy is &lt;strong&gt;not stationary&lt;/strong&gt; to translate the SR computed on &lt;span class=&quot;math-container&quot;&gt;$N_1$&lt;/span&gt; days to the one computed on &lt;span class=&quot;math-container&quot;&gt;$N_2$&lt;/span&gt; days: obviously if the strategy is mean reverting at long time scale, the longer the window of computation, the lower the SR.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="8164" LastEditorUserId="2299" LastEditDate="2019-07-31T05:52:21.193" LastActivityDate="2019-07-31T05:52:21.193" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="14035" PostTypeId="4" CreationDate="2014-07-15T01:08:36.243" Score="0" Body="Excess return per unit of deviation in return." OwnerUserId="8164" LastEditorUserId="8164" LastEditDate="2014-07-15T05:30:12.160" LastActivityDate="2014-07-15T05:30:12.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14036" PostTypeId="1" AcceptedAnswerId="14038" CreationDate="2014-07-15T02:12:37.947" Score="2" ViewCount="4600" Body="&lt;p&gt;I am trying to compute the Sharpe ratio for my portfolio.  To check that I am doing this correctly, I am first trying to compute it for SPY (the S&amp;amp;P 500 index).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;S.R. = mean({SPY return j - risk-free return j})/std dev({SPY return j})&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am using annualized monthly returns that I compute from the SPY index itself.  For the risk-free return, I am using the 10-year T-bill.  Again, I am using &lt;em&gt;monthly&lt;/em&gt; data, same as Yahoo! and Morningstar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is how I compute the annualized monthly return for month j:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;temp = [ ( (value at month j) - (value at month j-1) ) ] / (value at month j-1)&#xA;return for month j = (1+temp)^12 - 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For some reason, I get 0.61 for the Sharpe Ratio.  Yahoo! and Morningstar report it to be about 1.3, again amortized monthly.  What am I doing wrong?  Here is some sample data:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;        S&amp;amp;P price   T-bill price      S&amp;amp;P return   T-bill return&#xA;...&#xA;Jan-14  176.55      1165.31     &#xA;Feb-14  184.59      1209.48           0.706417809  0.562739592&#xA;Mar-14  186.12      1212.98           0.104125623  0.035283725&#xA;Apr-14  187.41      1198.61           0.086417122  -0.133255532&#xA;May-14  191.76      1218.43           0.316991962  0.217509175&#xA;Jun-14  195.72      1230.87           0.277986402  0.129637856&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For some reason the computation doesn't work out for me.  Can anyone see what I am doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="11554" LastEditorUserId="848" LastEditDate="2014-07-15T05:40:14.337" LastActivityDate="2018-04-25T21:20:14.867" Title="Sharpe Ratio - my own calculation differs from Yahoo finance, Morningstar" Tags="&lt;sharpe-ratio&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14037" PostTypeId="2" ParentId="14036" CreationDate="2014-07-15T04:10:11.080" Score="2" Body="&lt;p&gt;To compute Sharpe Ratio the risk-free rate has to be proxied by something like the 1-month T-Bill yield. The 10-year Treasury Bond return is not a &quot;risk-free&quot; return.&lt;/p&gt;&#xA;" OwnerUserId="8153" LastActivityDate="2014-07-15T04:10:11.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14038" PostTypeId="2" ParentId="14036" CreationDate="2014-07-15T05:26:36.683" Score="7" Body="&lt;p&gt;Your approach of computation is not very standard. Specifically, you do not need to compute the annualized monthly return. One can compute the annualized Sharpe ratio from return sampled at any frequency using the following Generalized formula: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ Sharpe  = \frac{E|R_p - R_{rf}|}{\sqrt{var(R_p - R_{rf})}} * \sqrt{N}$$ &#xA;where $R_{rf}$ is the benchmark/ risk-free return, $R_p$ is the portfolio return, $N$ is the number of sampling periods in a year. The portfolio return and risk-free rate can be of any interval (daily, weekly, monthly, etc), as long as they are consistent with each other. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, the risk-free rate is effectively 0 nowadays, and N is 12 assuming you are using monthly returns, and N is 252 if you are using daily returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope it helps. &lt;/p&gt;&#xA;" OwnerUserId="9381" LastActivityDate="2014-07-15T05:26:36.683" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="14040" PostTypeId="1" AcceptedAnswerId="14041" CreationDate="2014-07-15T06:44:27.783" Score="1" ViewCount="94" Body="&lt;p&gt;I have started reading an introductory book called: A Course in Derivative Securities by Kerry Back. On page 12 they mention the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The delta of the call option is $\delta = (C_{u} - C_{d}) / (S_{u} - S_{d})$ and then they rewrite this to $\delta S_{u} - C_{u} = \delta S_{d} - C_{d}$, where $S_{u}$ is the stock price in the &quot;up state&quot;, $S_{d}$ for the &quot;down state&quot; and $C_{u} = max(0, S_{u} - K)$, $K$ is the exercise price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I am wondering, besides from the math, why is it, intuitively, that $\delta S_{u} - C_{u} = \delta S_{d} - C_{d}$ on day 0. Does this also hold on any other day? If so, could someone intuitively tell me why (I get the derivation though, but I lack the deeper understanding of why).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot!&lt;/p&gt;&#xA;" OwnerUserId="11558" LastActivityDate="2014-07-15T16:58:41.377" Title="Interpretation of equation derived from the delta of a call European call option" Tags="&lt;no-arbitrage-theory&gt;&lt;binomial&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14041" PostTypeId="2" ParentId="14040" CreationDate="2014-07-15T09:46:00.730" Score="1" Body="&lt;p&gt;Call Delta is generally defined as $$\Delta_C=\partial_S C=\frac{dC}{dS}=\frac{C_u-C_d}{S_u-S_d}$$, so it is the derivative or tangential change in $C$ from change in $S$, discretized in the Binomial Model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As we know, this derivative goes symmetrically both ways, when $C_u$ goes up or $C_d$ down, so one can in general rewrite this equation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta S_u-C_u=\Delta S_d-C_d$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As explained, this holds on every day just by the definition of $\Delta$, but it has no direct intuitive interpretation yet as such. You may say that for no-arbitrage, a symmetric structure is in general &quot;better&quot;, but the result here is just a consequence of discretizing the derivative in $\Delta$. Later on, one may find that Delta also happens to be the stock-weight for a replicating portfolio.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-07-15T09:46:00.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14042" PostTypeId="1" AcceptedAnswerId="14043" CreationDate="2014-07-15T09:55:27.913" Score="-1" ViewCount="1091" Body="&lt;p&gt;What is the difference between &lt;strong&gt;Total Long Term Debt&lt;/strong&gt; and &lt;strong&gt;Net Total Long Term Debt&lt;/strong&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below you can see a picture revealing that they are not equal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZqmQO.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="7379" LastActivityDate="2014-07-15T10:09:27.140" Title="Difference between Total Long Term Debt and Net Total Long Term Debt" Tags="&lt;financial-engineering&gt;&lt;debt&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14043" PostTypeId="2" ParentId="14042" CreationDate="2014-07-15T10:09:27.140" Score="1" Body="&lt;p&gt;Net Debt = Total Debt - Cash&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also see from the graph, that Net Debt is always below Total Debt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cash (and liquid marketable securities) is deducted from Debt, because it could be in theory directly used to repay the debt, hence only &quot;Net Debt&quot; is important; think a company with 1mio Debt and 1mio Cash, one would not say it was in debt because it can essentially repay any time.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-07-15T10:09:27.140" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14044" PostTypeId="2" ParentId="14040" CreationDate="2014-07-15T12:32:14.220" Score="1" Body="&lt;p&gt;Intuitively, holding $\delta$ stocks in your portfolio is going to make you money if the stock goes up (but you're going to lose on the option you've sold), and lose you money if the stock goes down (but you make on the option which becomes worthless).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The equality is the basis for the concept of $\delta$-neutrality, ie whatever happens, your portfolio value is unaffected, and is equal to today's value (discounted by the risk free rate)&lt;/p&gt;&#xA;" OwnerUserId="11540" LastActivityDate="2014-07-15T12:32:14.220" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14045" PostTypeId="1" AcceptedAnswerId="14048" CreationDate="2014-07-15T13:07:26.653" Score="0" ViewCount="60" Body="&lt;p&gt;I understand what we mean when we say: &lt;strong&gt;Net Preferred Equity Issued&lt;/strong&gt; it is the total amount of Preffered Stocks plus their price. But does the chart mean when it says &lt;strong&gt;(Purchased)&lt;/strong&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What other can it be?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Please correct me in anything i got wrong...)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/pr5us.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="7379" LastActivityDate="2014-07-15T17:22:51.910" Title="(Purchased) terminology on Net Preferred Equity Issued" Tags="&lt;equities&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14046" PostTypeId="1" CreationDate="2014-07-15T15:30:04.043" Score="0" ViewCount="361" Body="&lt;p&gt;Given data that has been fit to a loess model, can you make reliable decisions on future trades given a good past fit? Has anyone here done so and can give an example of their use case?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am yet to decide what data set to use.&lt;/p&gt;&#xA;" OwnerUserId="3424" LastActivityDate="2015-02-16T21:51:18.250" Title="How to construct a deterministic trading model based on a loess (local regression) model?" Tags="&lt;automated-trading&gt;&lt;regression&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14047" PostTypeId="2" ParentId="14040" CreationDate="2014-07-15T16:58:41.377" Score="0" Body="&lt;p&gt;Its not the day that matters. Delta will remain the same on subsequent days if the price of the option and its underlying remain unchanged since the time the delta was calculated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Delta is a linear approximation and measures only the slope, but options are non-linear instruments, they have a convexity. Delta holds only for small changes in underlying so any large change in underlying means that delta needs to be revalued.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, $\delta S_u - C_u = \delta S_d - C_d$ holds by definition of delta hedging and how delta is evaluated.  &lt;/p&gt;&#xA;" OwnerUserId="2142" LastActivityDate="2014-07-15T16:58:41.377" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14048" PostTypeId="2" ParentId="14045" CreationDate="2014-07-15T17:22:51.910" Score="1" Body="&lt;p&gt;The (Purchased) means is that the company can also buy back preferred stock and thus create the negative &quot;Net Preferred Equity Issued&quot; that you see around 2010. So the purchased is talking about the company purchasing preferred stock rather than issuing preferred stock.&lt;/p&gt;&#xA;" OwnerUserId="9501" LastActivityDate="2014-07-15T17:22:51.910" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14049" PostTypeId="1" AcceptedAnswerId="14114" CreationDate="2014-07-15T20:53:00.910" Score="3" ViewCount="1472" Body="&lt;p&gt;I'm attempting to implement aforementioned SVCJ model by &lt;a href=&quot;http://web.stanford.edu/~kenneths/dps.pdf&quot; rel=&quot;nofollow&quot; title=&quot;Duffie et al.&quot;&gt;Duffie et al&lt;/a&gt; in MATLAB. so far without success. It's supposed to price vanilla (european) calls . parameters provided, the expected price is: ~6.0411. The function throws the error:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Warning: Reached the limit on the maximum number of intervals in use. Approximate bound on error is&#xA;1.1e+03. The integral may not exist, or it may be difficult to approximate numerically to the requested&#xA;accuracy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using quadv instead of integral didn't yield the expected result, but instead just returned NaNs.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    function price = SVCJDuffie2000Test(S0, K, V0, r, mus, muv, lambda, kappav, ...&#xA;        thetav, sigmav, sigmas, rho, rhoj, q, t, T)&#xA;        % this function should in theory calculate the analytical solution for&#xA;        % the SVCJ model by Duffie et al&#xA;        %&#xA;        %&#xA;        %&#xA;        %&#xA;        % T=0.25&#xA;        % K = 100;&#xA;        % S0 = 85;&#xA;        % kappav=4;&#xA;        % lambda=4;&#xA;        % rhoj=-0.5;&#xA;        % rho=-0.5;&#xA;        % thetav=0.04;&#xA;        % r=0.05;&#xA;        % sigmas=0.06;&#xA;        % mu =  0.2380&#xA;        % muv=0.02;&#xA;        % muJ = -0.04; &#xA;        % sigmav=0.1;&#xA;        % V0 = 0.25;&#xA;        %&#xA;        %&#xA;        % mus = log((1+mu)*(1-rhoj*muv))-0.5*(sigmas^2);&#xA;        % SVCJDuffie2000Test( S0, K, V0, r, mus, muv, lambda, kappav,  thetav, sigmav, sigmas, rho, rhoj, 0,0,T )&#xA;&#xA;         % S0, V0, r, mu, muv, lambda, kappav, &#xA;         % thetav, sigmav, sigmas, rho, rhoj, &#xA;         y          = log(S0);&#xA;         X0         = y;&#xA;         % nu, initial vola, nubar long run mean vola&#xA;         nu         = V0;&#xA;         c          = K;&#xA;         nubar      = thetav;&#xA;         sigmav     = sigmav;&#xA;         sigmacy    = sigmas;&#xA;         mucy       = mus;&#xA;         mucv       = muv;&#xA;         rhoj       = rhoj;&#xA;         rhobar     = rho;&#xA;         kappav     = kappav;&#xA;         zetabar    = q;&#xA;         lambdac    = lambda;&#xA;         % specific to SVCJ model&#xA;         lambdabar  = lambda;&#xA;         r          = r;&#xA;&#xA;&#xA;&#xA;         % not needed for SVJJ, ie SVCJ&#xA;         sigmay    = 0;&#xA;         lambday   = 0;&#xA;         lambdav   = 0;&#xA;         muv        = 0;&#xA;         muy        = 0;&#xA;&#xA;         mubar = thetafunc(1,0) - 1&#xA;&#xA;        function retval = alphabar(tau,u)&#xA;            thetainter = lambdabar^-1*(lambdac*fc(u,tau));&#xA;            retval = alpha0(tau, u) - lambdabar*tau*(1+mubar*u)+lambdabar*thetainter;&#xA;        end&#xA;&#xA;&#xA;        function retval = betabar(tau,u)&#xA;            a = u*(1-u);&#xA;            b = sigmav*rhobar*u-kappav;&#xA;            gamma = sqrt(b^2+a*sigmav^2);&#xA;            retval = a*(1-exp(-gamma*tau)) / (2*gamma-(gamma+b)*(1-exp(-gamma*tau)));&#xA;        end&#xA;&#xA;&#xA;        function retval = alpha0(tau, u)&#xA;           a = u*(1-u);&#xA;           b = sigmav*rhobar*u-kappav;&#xA;           gamma = sqrt(b^2+a*sigmav^2);&#xA;           retval = -r*tau+(r-zetabar)*u*tau-kappav*nubar*...&#xA;                (((gamma+b)/sigmav^2)*tau + ...&#xA;                (2/sigmav^2)*log(1-((gamma+b)/(2*gamma))*(1-exp(-gamma*tau))));&#xA;        end&#xA;&#xA;&#xA;&#xA;        function retval = fy(u,tau)&#xA;            retval = tau*exp(muy*u+1/2*sigmay^2*u^2);&#xA;        end&#xA;&#xA;        function retval = fv(u,tau)&#xA;            a = u*(1-u);&#xA;            b = sigmav*rhobar*u-kappav;&#xA;            gamma = sqrt(b^2+a*sigmav^2);&#xA;            c_ = 1 - rhoj*mucv*u;&#xA;            retval =  (gamma-b)/((gamma-b)+muv*a)*tau-(2*muv*a)/((gamma*c_)^2-(b*c_-muv*a)^2)...&#xA;                *log(1-((gamma+b)*c_-muv*a)/(2*gamma)*(1-exp(-gamma*tau)));&#xA;        end&#xA;&#xA;        function retval = fc(u,tau)&#xA;            a = u*(1-u);&#xA;            b = sigmav*rhobar*u-kappav;&#xA;            c_ = 1 - rhoj*mucv*u;&#xA;            gamma = sqrt(b^2+a*sigmav^2);&#xA;            d_ = (gamma-b)/((gamma-b)*c_+mucv*a)*tau-(2*mucv*a)/((gamma*c_)^2-(b*c_-mucv*a)^2)...&#xA;                *log(1-((gamma+b)*c_-mucv*a)/(2*gamma*c_)*(1-exp(-gamma*tau)));&#xA;            retval = exp(mucy*u+sigmacy^2*u^2/2)*d_;&#xA;        end&#xA;&#xA;        function retval = thetafunc(c1, c2)&#xA;            retval = lambdabar^-1*(lambdac*thetacfunc(c1,c2));&#xA;        end&#xA;&#xA;        function retval = thetayfunc(c)&#xA;            retval = exp(muy*c+1/2*sigmay^2*c^2);&#xA;        end&#xA;&#xA;        function retval = thetavfunc(c)&#xA;            retval = 1/(1-muv*c);&#xA;        end&#xA;&#xA;        function retval = thetacfunc(c1,c2)&#xA;            retval = exp(mucy*c1+1/2*sigmacy^2*c1^2) / ...&#xA;                (1-mucv*c2-rhoj*mucv*c1);&#xA;        end&#xA;&#xA;&#xA;&#xA;        function retval = psi(y_, u,  t, T)&#xA;            retval =  exp(alphabar(T-t,u)+u*y_+ betabar(T-t,u)*nu);&#xA;        end&#xA;&#xA;        % extended transform p.13&#xA;        function retval = psichi(nu_, u, y, t, T)&#xA;            retval =  exp(alphabar(T-t,u)+u*y+ betabar(T-t,u)*nu_);&#xA;        end&#xA;&#xA;        function retval = Gab(a,b, y, X0_, T)&#xA;            integratefunc = @(nu_) imag(psi(complex(a,nu_*b),X0_, 0, T) * exp(complex(0,-nu_*y))) / nu_;&#xA;            retval = psi(a,X0_,0,T)/2  - 1/pi*integral(integratefunc, 0, Inf, 'ArrayValued',true);&#xA;            %retval = 1;&#xA;        end&#xA;&#xA;        % depends on payoff function, see p. 6, 18&#xA;        %aT = -r*T;&#xA;        %bT = 0;&#xA;        %d = 1;&#xA;&#xA;&#xA;        % could also be:    &#xA;        aT = 0;&#xA;        bT = 1;&#xA;        d = -r*T;&#xA;&#xA;&#xA;&#xA;        GbTplusdminusd = Gab(bT+d,-d,-log(c),X0,T)&#xA;        GbTminusd =Gab(bT,-d,-log(c),X0,T)&#xA;&#xA;        price = exp(aT)*GbTplusdminusd-c*exp(aT)*GbTminusd;&#xA;    end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Functions in the paper:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thetainer: p. 23&lt;/p&gt;&#xA;&#xA;&lt;p&gt;alpha0: p.22&lt;/p&gt;&#xA;&#xA;&lt;p&gt;alphabar: p.22&lt;/p&gt;&#xA;&#xA;&lt;p&gt;betabar: p.22&lt;/p&gt;&#xA;&#xA;&lt;p&gt;fy,fv,fc: p. 23&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thetayfunc, thetacfunc, thetavfunc: p. 22&lt;/p&gt;&#xA;&#xA;&lt;p&gt;psi: p.21 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gab: p. 13&lt;/p&gt;&#xA;&#xA;&lt;p&gt;not a function, but depending on the derivative type:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GbTplusdminusd,GbTminusd, price: p. 18&lt;/p&gt;&#xA;&#xA;&lt;p&gt;lambdabar = lambda, according to: p. 24&lt;/p&gt;&#xA;" OwnerUserId="5276" LastEditorUserId="5276" LastEditDate="2014-07-22T00:00:37.370" LastActivityDate="2020-02-04T18:38:51.233" Title="SVCJ (SVJJ) Duffie et. al Model implementation in Matlab" Tags="&lt;options&gt;&lt;stochastic-calculus&gt;&lt;stochastic-volatility&gt;&lt;matlab&gt;&lt;differential-equations&gt;" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14050" PostTypeId="1" CreationDate="2014-07-16T00:16:41.513" Score="2" ViewCount="746" Body="&lt;p&gt;Sorry, I wanted to ask this on the finance/money forum, but they don't support LaTeX there.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Let's say we are valuing a company using the DCF methodology with a 5-year projection period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We project free cash flows of $F_{1},\ldots,F_{5}$. Then if $w$ is the WACC of this company and $g$ is the perpetual growth rate from year 5 forward, the sum of the future cash flows discounted at $w$ is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V_{1}:=F_{1}(1+w)^{-1}+\ldots+F_{5}(1+w)^{-5}+F_{5}\sum_{t=6}^{\infty}\frac{(1+g)^{t-5}}{(1+w)^{t}}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This formula for the Gordon Growth model replaces the infinite sum with the easily computed geometric series $$F_{5}\sum_{t=1}^{\infty}\frac{(1+g)^{t}}{(1+w)^{t}}=F_{5}\frac{1+g}{w-g},$$ and therefore (basically) &lt;strong&gt;DOUBLE COUNTS (!!)&lt;/strong&gt; the cash flows $F_{1},\ldots,F_{5}$ to get&#xA;$$\begin{align*}&#xA;V_{2}&amp;amp;:=F_{1}(1+w)^{-1}+\ldots+F_{5}(1+w)^{-5}+F_{5}\sum_{t=1}^{\infty}\frac{(1+g)^{t}}{(1+w)^{t}}\\&#xA;&amp;amp;=F_{1}(1+w)^{-1}+\ldots+F_{5}(1+w)^{-5}+F_{5}\frac{1+g}{w-g}\\&#xA;&amp;amp;\gg V_{1}.\end{align*}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What am I missing here?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even if you could convince me of the legitimacy of $F_{5}(1+g)^{t-5}\mapsto F_{1}(1+g)^{t}$ in order to get a uniformly indexed sum (and hence a geometric series), i.e. $F_{5}$ equals the 6-fold growth of $F_{0}$ before we first start to sum it, I would still be very hard to convince of the legitimacy that we should also not truncate the series and re-index the sum at $t=1$.&lt;/p&gt;&#xA;" OwnerUserId="8230" LastEditorUserId="8230" LastEditDate="2014-07-16T17:40:31.587" LastActivityDate="2015-03-16T09:38:17.957" Title="Logic behind Gordon Growth Model in a DCF analysis?" Tags="&lt;dcf&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14052" PostTypeId="2" ParentId="10334" CreationDate="2014-07-16T02:35:04.207" Score="5" Body="&lt;p&gt;As Joshua mentioned, spot fx is decentralized.  Furthermore, brokers (broker dealers) are reluctant to share their order-flow, mainly because it would likely reveal they are running a partial/full b-book (aggregation or internalizing client trades).  This has become a sensitive topic in retail trading circles due to the temptation of dealers to 'trade against you' or manipulate your trades, especially if they suspect you are an well-informed trader.  Even with an A-book, the order flow is still variable across brokers (as aggregation can go through several liquidity providers before reaching its final destination).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best place to get as close to real time statistics on [retail] fx order flow would be &lt;a href=&quot;http://www.myfxbook.com/community/outlook&quot; rel=&quot;noreferrer&quot;&gt;MyFxBook community outlook&lt;/a&gt;.  They sample volume from all their real [verified] trading accounts that connect to them to track statistics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More comprehensive surveys of daily volume from the institutional side:&#xA;&lt;a href=&quot;http://fxandmm.thomsonreuters.com/market-tools/market-volumes/&quot; rel=&quot;noreferrer&quot;&gt;Reuters FX Spot Volumes&lt;/a&gt; and &lt;a href=&quot;http://www.icap.com/investor-relations/monthly-volume-data.aspx&quot; rel=&quot;noreferrer&quot;&gt;ICAP Monthly Volume Data&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most comprehensive place that keeps track of nearly all daily foreign exchange notional volumes on a regular basis are the Bank for International Settlements &lt;a href=&quot;http://www.bis.org/statistics/derstats.htm&quot; rel=&quot;noreferrer&quot;&gt;(BIS) Semi-annual and Triennial surveys&lt;/a&gt;.  When you here a broker advertise &quot;forex does 4+ &lt;em&gt;trillion&lt;/em&gt; dollar a day in volume, BIS is where they get those stats from. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other honorable mentions:  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) &lt;a href=&quot;http://www.integral.com/products/fx_trade_vault.htm&quot; rel=&quot;noreferrer&quot;&gt;Integral FX TradeVault&lt;/a&gt;. A paid service, but integral is one of the larger aggregators in the industry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) &lt;a href=&quot;http://www.lmax.com/exchange&quot; rel=&quot;noreferrer&quot;&gt;LMAX Exchange&lt;/a&gt;.  They do not publish their daily volumes yet to the general public, but being the first transparent 'exchange' for spot forex (no last look order book), it will be interesting to see the related statistics from their order flow as they become a larger player.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) &lt;a href=&quot;http://www.ForexMagnates.com&quot; rel=&quot;noreferrer&quot;&gt;ForexMagnates&lt;/a&gt; . Many of the larger players and brokers from around the world do post their individual monthly volumes within a few days after the previous month closes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) &lt;a href=&quot;http://www.fxcmapps.com/trading-station/real-volumetransactions-indicators/&quot; rel=&quot;noreferrer&quot;&gt;FXCM Real Volume and Transactions indicators&lt;/a&gt;.  FXCM is a large player in the retail world as well as institutional, and has a lot of combined order flow, although the indicator is supposed to only do retail order flow from fxcm customers only.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;More and more brokers will begin posting their order flow as the industry encourages more transparency.  Post Dodd-Frank/post LIBOR manipulation regulations encourages more institutions to do accurate trade reporting for OTC products, so real time or more frequent volume data is just the next logical step. &lt;/p&gt;&#xA;" OwnerUserId="2566" LastActivityDate="2014-07-16T02:35:04.207" CommentCount="0" CommunityOwnedDate="2014-07-16T02:35:04.207" ContentLicense="CC BY-SA 3.0" />
  <row Id="14053" PostTypeId="2" ParentId="141" CreationDate="2014-07-16T03:11:10.470" Score="6" Body="&lt;p&gt;The master list already has &lt;a href=&quot;http://www.dukascopy.com/swiss/english/marketwatch/historical/&quot; rel=&quot;noreferrer&quot;&gt;dukascopy listed for forex historical tick data&lt;/a&gt;.  Dukas also now has selected CFDs of indices, metal/energy, and individual stocks.  The forex data for the majors go back to 1997 or so.  It's free, so you get what you pay for.  The data that is more recent (last 5 years) has almost 0 gaps on the majors and crosses. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What was also not mentioned was that you need to either use their jForex platform to download the data or you'd have to download the data manually from their website.  This could become quite cumbersome. There are two tools that will automate most of this for you:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.tickstory.com/&quot; rel=&quot;noreferrer&quot;&gt;TickStory&lt;/a&gt;&lt;br&gt;&#xA;&lt;a href=&quot;http://www.strategyquant.com/tickdatadownloader/&quot; rel=&quot;noreferrer&quot;&gt;StrategyQuant's Tick Data Downloader&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With those free tools, you can also export the data into csv format, which can then be used in most charting applications.  In the case of metatrader 4, you need to convert the csv into their binary format (.FXT).  &lt;a href=&quot;http://eareview.net/tick-data/convert-tick-data&quot; rel=&quot;noreferrer&quot;&gt;Birt's free csv2fxt script&lt;/a&gt; can help with that.  I also used Birt's TDS to get variable spreads with the backtests done in mt4. &lt;/p&gt;&#xA;" OwnerUserId="2566" LastActivityDate="2014-07-16T03:11:10.470" CommentCount="0" CommunityOwnedDate="2014-07-16T03:11:10.470" ContentLicense="CC BY-SA 3.0" />
  <row Id="14054" PostTypeId="2" ParentId="10722" CreationDate="2014-07-16T04:46:53.583" Score="1" Body="&lt;p&gt;If you have an accurate 'future price probability distribution' (I will simplify this phrase: prediction), you buy the futures contracts (or any instrument) using leverage in a grid that covers the expected range and trade it aggressively with increased sizes over the range (e.g. martingale).  You can also increase the sizes significantly when the 'prediction' is more short term (over a shorter range) as the drawdown is affected by the total range length prices travel from the first trade + all maximum subsequent trades made in that basket.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.traderslaboratory.com/forums/forex-trading-laboratory/11152-dollar-cost-averaging-spreadsheet-alternative-method.html&quot; rel=&quot;nofollow&quot;&gt;This is an example spreadsheet&lt;/a&gt; which simulates how to setup the grid from the first trade, and calculates the drawdowns and points to breakeven at each trade level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While you can technically use stocks, you only get 1:2 leverage in most cases.  Futures you can have leverage of up to 1:2000 from the exchange (Eurodollar) and day trading can give you 2x or more from your broker (assuming you close your positions out before daily close).  Forex derivatives operate similarly.   And you really do not have the manipulation or fraud that you do in stock market, assuming you are with a 'proper' broker.&lt;/p&gt;&#xA;" OwnerUserId="2566" LastActivityDate="2014-07-16T04:46:53.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14055" PostTypeId="1" CreationDate="2014-07-16T08:28:42.190" Score="2" ViewCount="671" Body="&lt;p&gt;I used the daily returns of SPX Index, SPY US Equity, and SPA Index. I then calculate their standard deviation as hedging instruments with respect to SPX Index, i.e., (spx_ret - spy_ret) or (spx_ret - spa_ret). However, the results I obtained were strange:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;SD (spx_ret - spy_ret) = 0.0012959&#xA;SD (spx_ret - spa_ret) = 0.0006794&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can an ETF have a larger tracking error? I thought Futures are almost like a &quot;perfect hedge&quot; and ETFs have huge tracking error due to management and rebalancing fees. Am I missing something in the calculation?&lt;/p&gt;&#xA;" OwnerUserId="5007" LastEditorUserId="5007" LastEditDate="2014-07-16T23:40:36.063" LastActivityDate="2014-07-16T23:40:36.063" Title="ETFs have lower tracking error than Futures?" Tags="&lt;futures&gt;&lt;hedging&gt;&lt;etf&gt;&lt;tracking-error&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14056" PostTypeId="1" CreationDate="2014-07-16T14:31:06.013" Score="1" ViewCount="156" Body="&lt;p&gt;Price deviation = financial bubbles. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;i try to fit the following stock price index to predict recession. I couldn't fit the model with the data(Data are not available in yahoo finance for the particular period, so I bought the data and typed). Can anyone help me to point out my mistakes??? the codes (R 2.14.2) are as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; library(tseries)&#xA; library(zoo)&#xA; ts&amp;lt;- structure(c(505.47, 528.03, 526.19, 553.65, 543.49, 541.74, 541.01, 535.38, 545.80, 553.46, 559.10, 560.05, 561.83, 562.50, 557.92, 559.16, 552.60, 548.78, 549.41, 544.66, 541.34, 536.32, 529.30, 524.20, 520.57, 521.03,  523.08, 526.70, 530.70, 522.69, 521.81, 521.77, 518.20, 513.11, 508.25, 508.26, 508.22, 507.37, 510.36, 518.80, 514.59, 517.24, 517.59, 516.60, 514.99, 522.36, 525.98, 533.54, 530.44, 535.43, 534.69, 530.30, 531.40, 537.03, 531.09, 531.67, 533.16, 536.19, 554.57, 556.73, 555.85, 553.21, 545.74, 528.60, 535.64, 535.72, 537.59, 539.04, 537.38, 537.07, 536.18, 532.32, 532.09, 528.21, 528.38, 529.41, 529.32, 530.33, 531.42, 531.75, 530.90, 532.69, 537.85, 542.45, 543.30, 540.61, 541.13, 540.64, 545.52, 549.78,  550.48,  551.80, 554.38, 556.22, 552.16, 552.99, 557.34, 555.66, 553.48, 552.37, 551.90, 548.69, 546.63,  552.28,  569.23, 569.65, 572.23, 570.57, 572.27, 571.64, 568.78, 570.55, 569.84, 573.28, 568.75, 570.64, 575.81,  589.84, 603.35, 604.45, 600.76,  594.63, 595.75, 597.78,  607.67, 618.72, 619.06, 615.73,  610.86,  602.29,  603.16,  600.66, 605.06, 601.93, 597.83, 598.64,  593.93, 590.94, 584.01,  586.95, 588.36, 592.42,  595.22,  591.74, 594.49, 600.40, 597.96, 603.19, 609.33, 609.90, 607.40, 604.27, 602.71, 597.69, 593.21, 588.37, 588.12, 586.46, 573.61, 563.69, 571.31, 567.51, 564.51, 568.19, 575.83, 575.75, 572.46, 572.57, 573.95, 582.90, 583.71, 581.02, 583.62, 585.12, 591.63, 597.47, 603.02,  604.46,  603.56, 605.71, 603.97, 603.08,  598.65, 593.03, 590.34, 590.91, 594.09, 592.86, 592.48, 591.93, 592.52, 591.20, 600.17, 589.09, 585.33,  586.74, 588.43, 586.23, 587.16, 585.39, 584.67, 589.52, 590.55, 600.17, 602.15, 603.19, 596.50, 596.58,  594.05, 593.52, 594.00, 598.60, 596.55, 591.14, 592.33, 596.47, 596.08, 595.75, 596.70,  595.97,  603.72,  611.57, 616.08, 617.94, 612.36, 611.74,  605.33, 602.76,  605.16, 608.79, 602.24, 593.53,  589.70,  585.77,  590.71, 598.56,  601.53, 601.39, 603.54, 602.58, 598.27, 597.11, 595.16, 597.80, 594.57, 592.18,  581.94, 568.25, 556.24, 560.01, 564.21, 567.66, 565.56, 561.27, 559.51, 567.56, 574.73, 573.50, 572.92,  577.71, 581.17, 584.84, 586.61, 584.19, 580.79, 583.74, 585.91, 585.15, 587.13, 587.54, 587.99, 588.32, 590.84,  593.07, 602.60, 610.65, 605.93, 602.28, 598.10, 594.59, 594.33, 590.70, 592.04, 593.08, 592.63, 602.72,  605.13, 606.56, 606.17, 608.05, 612.33, 614.96, 615.85, 623.87, 630.07, 633.32, 633.31, 637.13, 641.31,  649.06, 653.07, 659.33, 660.35, 654.60, 648.93, 645.32, 646.80, 652.23, 650.62,  646.25, 641.90, 641.77,  637.39, 642.60, 643.79, 643.02, 641.84, 638.79, 640.48, 641.89, 637.23, 641.51, 636.40,  637.61, 635.56,  635.93, 633.52, 633.94, 635.26,  632.54, 628.88, 632.89, 636.11, 641.08, 643.60, 644.94, 645.04, 646.39,  645.03, 642.95, 642.66, 643.96, 632.83, 630.89, 633.66, 636.26, 629.51, 621.46, 616.46, 614.28,  619.81,  617.49, 624.37, 624.12, 622.61, 625.93, 626.34, 624.89, 618.41, 624.49, 628.38, 639.24, 642.95, 644.90,  641.60, 639.97, 638.62, 635.84, 635.42, 634.91, 635.01, 625.81, 623.11, 629.43, 635.59, 632.28, 634.22,  638.83, 638.19, 634.87, 637.00, 636.44, 636.67, 638.34, 637.93, 631.79, 637.37, 637.25, 638.05, 634.81, 637.79, 640.39, 640.24, 636.33, 634.65, 634.42, 638.87, 638.92, 643.25, 649.56, 651.45, 656.13,  655.89,  661.35, 657.23, 655.24, 657.13, 655.58, 660.60, 660.73, 662.02, 664.95, 672.53, 691.70, 691.45, 691.65, 693.44, 692.57, 695.43, 705.00, 719.61, 717.37, 706.08, 706.46, 712.95, 716.54, 710.99, 712.67,  718.04,  720.00, 720.36, 725.46, 729.43,  735.11, 729.35, 724.48, 731.37, 735.39, 736.07, 735.25, 740.06,  741.27,  735.06, 732.15,  728.16, 736.28, 734.93, 737.53, 746.29, 743.16, 739.42, 736.51, 720.46, 735.25,  724.96, 717.96, 701.66, 708.80, 722.07, 720.58, 721.17, 719.84, 734.73, 732.51, 731.67, 732.66,  733.98, 728.05, 722.82, 718.86, 719.30, 714.23, 735.78, 742.50, 745.90, 761.60, 759.76, 757.65, 758.86, 755.57, 763.97,  764.70, 766.08, 763.46, 771.67, 781.99, 785.49, 778.66, 779.87, 780.60, 780.42, 776.16, 771.91, 772.76,  784.91, 791.02, 798.82, 805.51, 805.26, 805.47, 805.72, 811.78, 808.49, 821.00, 851.10, 851.40, 848.40, 849.70, 842.50, 833.00, 820.70, 820.30, 817.70, 816.40, 819.70, 819.60, 816.40, 818.60, 819.30,  830.30,  837.80, 846.10, 849.90, 846.50, 853.83, 859.87, 852.26, 859.87, 865.77, 874.34, 884.62, 895.15, 905.71,  911.38, 919.03, 927.46, 914.53, 926.16, 922.95, 937.09, 934.11, 930.49, 929.85, 934.53, 946.72, 971.99,  967.05, 972.36, 982.03, 977.06, 944.94, 921.52, 937.66, 950.89, 967.60, 972.47, 961.37, 951.30,  957.81,  956.57, 984.92, 989.40, 966.88, 970.30,  970.31,  976.34, 972.10, 996.45, 1015.42, 1017.51, 1023.92, 1041.11,  1063.25, 1060.79, 1067.34, 1075.85, 1090.35, 1092.66, 1116.09, 1112.59, 1109.53, 1098.08, 1096.61, 1121.38, 1152.24, 1178.46, 1205.28, 1223.05, 1231.86, 1231.73, 1275.32, 1288.85, 1313.35, 1314.46, 1248.69), .Dim = c(595L, 1L), .Dimnames = list(NULL, &quot;Close&quot;), index = structure(c(7900,7901, 7902, 7903, 7904, 7907, 7908, 7909, 7910, 7911, 7914, 7915, 7916, 7917, 7918, 7921, 7922,  7923,7924, 7925, 7928, 7929, 7930, 7931, 7935, 7936, 7937, 7938,7939, 7942, 7943, 7944, 7945,7946,  7949, 7950, 7951, 7952, 7953, 7956, 7957, 7958, 7959, 7960, 7963, 7964, 7965,  7966, 7967, 7970,  7971,   7972, 7973, 7974,  7977, 7979, 7980, 7981, 7984, 7985,7986, 7987, 7988, 7991, 7992, 7993, 7994, 7995,  7998, 7999, 8000, 8001, 8002, 8005, 8006, 8007,8008,  8009, 8012, 8013, 8014, 8015, 8016, 8019, 8020,   8021, 8022,  8023, 8026, 8027, 8029, 8030, 8033, 8034, 8036,8037, 8040, 8041,  8042, 8043, 8044, 8047,  8048, 8049, 8050, 8051, 8054, 8055, 8056, 8057, 8058, 8061, 8062, 8063, 8064, 8065, 8071, 8072, 8075,  8076, 8077, 8078, 8079, 8082, 8083, 8084, 8085, 8086, 8089, 8090, 8091,8092, 8093,8096, 8097, 8098,  8099,8100,8103, 8104, 8105, 8106, 8107, 8110, 8111, 8112, 8113, 8114, 8117, 8118, 8119, 8120,  8121,  8124, 8125, 8126, 8127, 8128, 8133, 8134, 8135,8138, 8139, 8140, 8141, 8142,8145,8146, 8147, 8148,  8149, 8152, 8153,8154, 8155, 8159, 8160,8161, 8162, 8163, 8166, 8167, 8168, 8169, 8170, 8174, 8175,  8176, 8177, 8180, 8181, 8182,  8183, 8184, 8187, 8188, 8189, 8190, 8191, 8194, 8195, 8196, 8198,  8201,  8202, 8203, 8204, 8205, 8208, 8209, 8210, 8211, 8212, 8215, 8216, 8217, 8219, 8222, 8223, 8224,  8225,  8226, 8229, 8230, 8231, 8232, 8233, 8236, 8237, 8238, 8239, 8240, 8243, 8244, 8245, 8246, 8247,  8250, 8251, 8252, 8253, 8254, 8257, 8258,8259, 8260, 8261, 8264, 8265, 8266, 8267, 8268, 8271, 8272,  8273,  8274, 8275, 8279, 8280, 8281, 8282, 8285, 8286,  8288, 8289, 8292, 8293, 8294, 8295, 8296, 8299,  8300,  8301, 8302, 8303, 8306, 8307, 8308, 8309, 8310,8313, 8314, 8315, 8316, 8317, 8320, 8321, 8322,  8323,  8324, 8327, 8328, 8329, 8330, 8331, 8335, 8336, 8337, 8338, 8341, 8342, 8343, 8344, 8345, 8348, 8349,  8350, 8351, 8352, 8355, 8356, 8357, 8358, 8359, 8362, 8363, 8364, 8365, 8366, 8369, 8370, 8371, 8372,  8373, 8376, 8377, 8378, 8379,8380,8383, 8384, 8385, 8386, 8387, 8390,8391,8392, 8393,8397,8398,  8399, 8400, 8404, 8405, 8406,8407,  8408,8411, 8412, 8413, 8414, 8415, 8418, 8419,8420, 8421, 8426,  8427, 8428, 8429, 8433, 8434, 8435, 8436,8439, 8440, 8441, 8442, 8443, 8446, 8447, 8448, 8449, 8450,  8453,  8454, 8455, 8456, 8457, 8460, 8461, 8462,  8463, 8464, 8467, 8468, 8469, 8470, 8471, 8474,  8475, 8476, 8477, 8478, 8481, 8482, 8488, 8489, 8490, 8491,  8492, 8495, 8496,  8497, 8498, 8499, 8502, 8503, 8504, 8505, 8506, 8509, 8510, 8511, 8512, 8513, 8516, 8517, 8518, 8519, 8520, 8523, 8524, 8525, 8527, 8530,  8531, 8532, 8533, 8534, 8537, 8538,  8539, 8540, 8541, 8544, 8545, 8546, 8547, 8548, 8552,  8553, 8554, 8555, 8558, 8559, 8560, 8561, 8562,  8565, 8566, 8567, 8568, 8569, 8573, 8574, 8575, 8576,  8579, 8580, 8581, 8582, 8583,  8586, 8587, 8588, 8589, 8590,8593, 8594, 8595,  8596, 8597, 8600, 8601,  8602, 8603, 8604, 8607, 8608, 8609, 8610, 8611, 8614, 8615, 8616,  8617, 8618,  8621, 8622, 8623,8624, 8625,8628, 8629, 8630, 8631, 8632, 8635, 8636, 8637,  8638, 8639, 8644, 8645, 8646, 8649, 8650, 8651, 8652, 8653, 8656, 8657, 8658, 8659, 8660, 8663,  8664, 8665, 8666, 8667, 8670, 8671, 8672, 8673, 8674,  8677, 8678, 8679, 8680, 8681, 8684, 8685, 8686, 8687, 8688, 8691, 8692, 8693, 8694,8695, 8698, 8699,  8700, 8701,8702, 8705, 8706, 8707, 8708, 8709, 8712, 8713, 8714, 8715, 8716, 8719, 8720, 8721, 8722, 8723, 8726, 8727, 8728, 8729, 8730, 8733,8734, 8735,  8736,  8737, 8740, 8741, 8742, 8743, 8744, 8747, 8748, 8749, 8750, 8751, 8754, 8755, 8756, 8757, 8758, 8761, 8762, 8763, 8764, 8765, 8768, 8769, 8770,  8771), class = &quot;Date&quot;), class = &quot;zoo&quot;)&#xA;&#xA;  df&amp;lt;-data.frame(ts)&#xA;  df&amp;lt;-data.frame(Date=as.Date(rownames(df)),Y=df$Close)&#xA;      df&amp;lt;-df[!is.na(df$Y),]&#xA;  library(minpack.lm)&#xA;  library(ggplot2)&#xA;  df$days&amp;lt;-as.numeric(df$Date-df[1,]$Date)&#xA;      f&amp;lt;-function(pars,xx){pars$a + (pars$tc - xx)^pars$m *(pars$b+ pars$c *        cos(pars$omega*log(pars$tc - xx) + pars$phi))}&#xA;      resids&amp;lt;-function(p,observed,xx){df$Y-f(p,xx)}&#xA;&#xA; nls.out &amp;lt;- nls.lm(par=list(a=6,b=-6,tc=3000, m=.4,omega=10,phi=-2,c=-1),fn = resids, observed = df$Y, xx = df$days, control= nls.lm.control (maxiter =1024, ftol=1e-6, maxfev=1e6))&#xA; Warning messages:&#xA;1: In log(pars$tc - xx) : NaNs produced&#xA;    2: In log(pars$tc - xx) : NaNs produced&#xA;3: In log(pars$tc - xx) : NaNs produced&#xA;    4: In log(pars$tc - xx) : NaNs produced&#xA;5: In log(pars$tc - xx) : NaNs produced&#xA;nls.out&#xA;Nonlinear regression via the Levenberg-Marquardt algorithm&#xA;parameter estimates: 1292.85251942153, -14.1403675964815, 871.068726297531,   0.682341485852459, 0.742986030555774, 88.600462385114, 8.15118775146334 &#xA;residual sum-of-squares: 247649&#xA;reason terminated: Relative error in the sum of squares is at most `ftol'.&#xA;&#xA;&#xA;nls.out &amp;lt;- nls.lm(par=list(a=6,b=-6,tc=3000, m=.4,omega=10,phi=-2,c=-1),fn = resids, observed = df$Y, xx = df$days, control= nls.lm.control (maxiter =1024, ftol=1e-9, maxfev=1e6))&#xA;Warning messages:&#xA;1: In log(pars$tc - xx) : NaNs produced&#xA;    2: In log(pars$tc - xx) : NaNs produced&#xA;3: In log(pars$tc - xx) : NaNs produced&#xA;    4: In log(pars$tc - xx) : NaNs produced&#xA;5: In log(pars$tc - xx) : NaNs produced&#xA;&#xA;&#xA;nls.out &amp;lt;- nls.lm(par=list(a=6,b=-6,tc=3000, m=.5,omega=10,phi=-2,c=-1),fn = resids, observed = df$Y, xx = df$days, control= nls.lm.control (maxiter =1024, ftol=1e-9, ma xfev=1e6))&#xA; Warning messages:&#xA; 1: In log(pars$tc - xx) : NaNs produced&#xA;     2: In log(pars$tc - xx) : NaNs produced&#xA; 3: In log(pars$tc - xx) : NaNs produced&#xA;     4: In log(pars$tc - xx) : NaNs produced&#xA; 5: In log(pars$tc - xx) : NaNs produced&#xA;     6: In log(pars$tc - xx) : NaNs produced&#xA;&#xA;&#xA;nls.out &amp;lt;- nls.lm(par=list(a=6,b=-6,tc=3000, m=.2,omega=10,phi=-2,c=-1),fn = resids, observed = df$Y, xx = df$days, control= nls.lm.control (maxiter =1024, ftol=1e-9, maxfev=1e6))&#xA;  Warning messages:&#xA; 1: In log(pars$tc - xx) : NaNs produced&#xA;     2: In log(pars$tc - xx) : NaNs produced&#xA; 3: In log(pars$tc - xx) : NaNs produced&#xA;     4: In log(pars$tc - xx) : NaNs produced&#xA; 5: In log(pars$tc - xx) : NaNs produced&#xA;     6: In log(pars$tc - xx) : NaNs produced&#xA; 7: In log(pars$tc - xx) : NaNs produced&#xA;     8: In log(pars$tc - xx) : NaNs produced&#xA; 9: In log(pars$tc - xx) : NaNs produced&#xA;     10: In log(pars$tc - xx) : NaNs produced&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried many difference initial values but i couldn't set anything. Your help will be highly appreciated. You may refer the model in the &lt;a href=&quot;http://www.er.ethz.ch/publications/PHD_YanWanfeng_Final_thesis_911.pdf&quot; rel=&quot;nofollow&quot;&gt;following paper&lt;/a&gt; screen 33 (eq.2.9). &lt;/p&gt;&#xA;" OwnerUserId="9341" LastEditorUserId="848" LastEditDate="2014-07-17T06:01:40.700" LastActivityDate="2014-07-17T06:01:40.700" Title="forecasting crash time of KLSE index (1991-1994)" Tags="&lt;curve-fitting&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14057" PostTypeId="2" ParentId="12994" CreationDate="2014-07-16T15:14:22.167" Score="1" Body="&lt;p&gt;You rewrite your XL functions as unique, massive function, which receives all the input your Excel needs and outputs the valu(es) you are interested in. Transform this unique function into an executable. You access this executable as a Java function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only java code you have to write will be a call of this function, representing the executable and in my opinion You may use any editor. The function itself, internally, continues to be VBA code.&#xA;I do hope that I have correctly understood your issue :(&lt;/p&gt;&#xA;" OwnerUserId="2872" LastEditorUserId="2872" LastEditDate="2014-07-30T23:25:57.020" LastActivityDate="2014-07-30T23:25:57.020" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14058" PostTypeId="2" ParentId="14050" CreationDate="2014-07-16T16:16:00.637" Score="1" Body="&lt;p&gt;Your last cash flow is not correctly expressed as you forgot the $(1+r)^{-5}$ when you reinjected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A $t= 5$ (in 5 years), your PV of the remaining cash flows is: $F_5 \sum_{k=1}^\infty (\frac{1+g}{1+r})^k$. That is the formula for receiving a cash-flow $F_5$ growing at $1+g$, discounted at $(1+r)$ each year, receiving the first cash-flow in year 6.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now discount that to the present, you need to multiply by $\frac{1}{(1+r)^5}$. If you think that $F_5 = (1+g) ^5 F_0$ and the same for the previous ones, you easily demonstrate that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ V_{1}:=F_{1}(1+r)^{-1}+\ldots+F_{5}(1+r)^{-5}+F_{5}\sum_{t=6}^{\infty}\frac{(1+g)^{t-5}}{(1+r)^{t}} = \sum_{t=1}^{5} F_0 (\frac{1+g}{1+r})^t + F_0 (\frac{1+g}{1+r})^5\frac{(1+g)}{(r-g)} = F_0 \frac{1+g}{r-g}$ &lt;/p&gt;&#xA;" OwnerUserId="11540" LastActivityDate="2014-07-16T16:16:00.637" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14059" PostTypeId="2" ParentId="14055" CreationDate="2014-07-16T16:21:20.520" Score="3" Body="&lt;p&gt;It depends on your ETF. Some have synthetic exposure to the index sold by a sponsor (ie someone give them &lt;strong&gt;exactly&lt;/strong&gt; the performance of the index) but this has a cost (a constant / deterministic drag on the NAV of your ETF which doesn't appear in your tracking error). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Futures on the other hand have basis, are sensitive to changes in implied dividends and short term rates, and rolling costs, so they only perfectly track your index if you look at them between 2 rolling dates.&lt;/p&gt;&#xA;" OwnerUserId="11540" LastActivityDate="2014-07-16T16:21:20.520" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14063" PostTypeId="2" ParentId="12827" CreationDate="2014-07-16T21:00:00.520" Score="1" Body="&lt;p&gt;I can't imagine it would be a good idea to use the dividend yield of an index as a proxy for individual stock yields.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at the Google Finance stock screener for NYSE-listed stocks, the bulk of the stocks are in a dividend range 0-9% and the distribution of yields is fairly flat.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, you don't know how the index's dividend yield is calculated exactly. I generally find that the people who construct indices are reluctant to divulge much information unless you are a paying customer. So, there is probably a timing difference between when a company declares or pays a dividend and when that new dividend is incorporated into the index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most importantly, however, stocks react to a change in the expectation of dividends not the current or trailing dividend.&lt;/p&gt;&#xA;" OwnerUserId="6234" LastEditorUserId="467" LastEditDate="2015-02-12T06:31:32.990" LastActivityDate="2015-02-12T06:31:32.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14064" PostTypeId="1" AcceptedAnswerId="14068" CreationDate="2014-07-16T21:49:24.153" Score="2" ViewCount="197" Body="&lt;p&gt;In Tomas Björk's &lt;a href=&quot;http://global.oup.com/academic/product/arbitrage-theory-in-continuous-time-9780199574742?cc=nl&amp;amp;lang=en&amp;amp;&quot; rel=&quot;nofollow noreferrer&quot;&gt;Arbitrage Theory in Continuous Time&lt;/a&gt; (or &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/019957474X&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;), $\exists$ this Pricing Principle.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/e5vp0.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the one in red supposed to be the proof of the Pricing Principle 1? Or merely an intuitive explanation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If proof, is this rigorous? Or does its proof not need to be rigorous since it is merely a Principle (In this case, I guess I am assuming Principle is synonymous with something like Rule of Thumb)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If explanation, how does one then prove Pricing Principle 1? Does it follow from Prop 2.9? If so, how does one say this exactly? The fact that other prices besides $\Pi(0;X) = V_0^h$ implies arbitrage possibility means that the fair/reasonable price of $X$ is $\Pi(0;X) = V_0^h$? It seems weird since most math textbooks usually prove statements using previous statements rather than latter ones.&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="848" LastEditDate="2014-07-20T21:21:16.630" LastActivityDate="2014-07-20T23:27:18.443" Title="Pricing Principle 1" Tags="&lt;option-pricing&gt;&lt;arbitrage&gt;&lt;hedging&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14065" PostTypeId="1" AcceptedAnswerId="14076" CreationDate="2014-07-16T21:54:04.993" Score="1" ViewCount="2106" Body="&lt;p&gt;In Tomas Björk's &lt;a href=&quot;http://global.oup.com/academic/product/arbitrage-theory-in-continuous-time-9780199574742?cc=nl&amp;amp;lang=en&amp;amp;&quot; rel=&quot;nofollow noreferrer&quot;&gt;Arbitrage Theory in Continuous Time&lt;/a&gt; (or &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/019957474X&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;), $\exists$ this proposition&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/8htwR.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that to show that the model is complete, we must show that the claims are reachable. That is, we must find replicating portfolios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which part of finding the replicating portfolio makes use of the assumption?&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="848" LastEditDate="2014-07-20T21:19:28.263" LastActivityDate="2014-07-20T22:35:57.083" Title="Arbitrage free implies complete market?" Tags="&lt;arbitrage&gt;&lt;binomial-tree&gt;&lt;no-arbitrage-theory&gt;&lt;binomial&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14066" PostTypeId="2" ParentId="226" CreationDate="2014-07-17T03:44:00.730" Score="14" Body="&lt;p&gt;Volatility = Variance^1/2 = Standard Deviation&lt;/p&gt;&#xA;" OwnerUserId="11576" LastActivityDate="2014-07-17T03:44:00.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14067" PostTypeId="1" CreationDate="2014-07-17T11:04:30.057" Score="3" ViewCount="3541" Body="&lt;p&gt;What is the best way to handle missing values when stocks did not exist for the entire historical period?. &lt;/p&gt;&#xA;" OwnerUserId="9321" LastActivityDate="2014-07-17T16:53:23.897" Title="Handling Missing values in stocks returns when estimating the co variance matrix" Tags="&lt;time-series&gt;&lt;portfolio-management&gt;&lt;backtesting&gt;&lt;covariance&gt;&lt;portfolio-selection&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14068" PostTypeId="2" ParentId="14064" CreationDate="2014-07-17T11:10:05.517" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Is the one in red supposed to be the proof of the Pricing Principle 1? Or merely an intuitive explanation?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It is not a proof. The explanation/reasoning in this paragraph lets the author state the pricing &lt;em&gt;principle&lt;/em&gt;. It has hints on how to prove Prop 2.9 (for instance, see the line &lt;code&gt;...no difference between holding the claim and the portfolio...&lt;/code&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If every word in the statement of the pricing principle is precise, one could potentially prove it (starting form some set of assumptions). In particular, the word &lt;em&gt;reasonable&lt;/em&gt; in the principle is given a specific meaning that leads to proposition 2.9, which can then be proved using the ideas from the discussion before it. This meaning is simply that the price of $X$ at $t=0$ or at $1$ being equal to the value of the corresponding replicating portfolio disallows the possibility of arbitrage and hence is &lt;em&gt;reasonable&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If explanation, how does one then prove Pricing Principle 1? Does it follow from Prop 2.9?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Prove it once you define every word in the priciple in a precise manner of your choosing similar to the proof of Proposition 2.9 (which is left to the reader).&lt;/p&gt;&#xA;" OwnerUserId="6185" LastActivityDate="2014-07-17T11:10:05.517" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14069" PostTypeId="2" ParentId="14067" CreationDate="2014-07-17T11:46:26.143" Score="1" Body="&lt;p&gt;A simpler question would be the following: suppose you want to find the covaraince between the returns of two stocks and each of their time series has missing values at different places. What is the &lt;em&gt;best&lt;/em&gt; way to compute covariance here? One very sensible way to approach this is to throw away the observations where ony one of the stocks has a return value. Of course, you are throwing away observations in this approach. But, using any other approach may introduce bias in the later steps of your workflow that may be undesirable (unless you introduce a knowledge based bias to specifically compensate for the lack of observations).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, check out some of the questions on &lt;a href=&quot;https://stats.stackexchange.com/search?q=missing+value&quot;&gt;Cross Validated&lt;/a&gt; related to imputation and missing values (for instance, the first answer for this &lt;a href=&quot;https://stats.stackexchange.com/questions/32220/correlation-plots-with-missing-values&quot;&gt;question&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="6185" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2014-07-17T11:46:26.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14070" PostTypeId="2" ParentId="12756" CreationDate="2014-07-17T12:32:14.467" Score="2" Body="&lt;p&gt;&quot;Success rate&quot;, in the sense of winning (W) vs. losing (L) percentage of trades, is almost completely meaningless if taken alone as a trading metric. With a trend-following (TF) trading strategy, where you quickly exit any trades that start to become losers (i.e. cut your losses fast) but let your profits run, a typical win-rate would be around 35% or so, and this is excellent if your average win amount is 3 times your average loss amount. In this case your expected return is 0.35x3 - 0.65x(1) = +0.40 times R, where R is the amount you RISKED per trade. Conversely, with a Counter-Trend (CT) / Mean-Reversion trading strategy, where your winning amount per trade might not be more than about 1.2 times R, so you will need a win rate of at least 65% to be about equally profitable, i.e. 0.65x1.2 - 0.35x1 =  +0.43 times R per trade. The above numbers are reasonable &quot;ball-park&quot; figures for good real-life trading systems. In fact if you average 0.4*R per trade with either type of system, you will make a LOT of money and you can certainly consider yourself very successful as a trader. As you can see from the example, &quot;Success&quot; does not necessarily equate to a high win rate at all. The win rate that you NEED for financial success in trading will depend entirely on what is your preferred trading style.     &lt;/p&gt;&#xA;" OwnerUserId="11579" LastActivityDate="2014-07-17T12:32:14.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14071" PostTypeId="2" ParentId="14067" CreationDate="2014-07-17T12:40:03.760" Score="3" Body="&lt;p&gt;One really nice &lt;strong&gt;book&lt;/strong&gt; that comes to my mind is&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Little, Rubin, &lt;em&gt;Statistical Analysis with Missing Data&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I read part of it but probably it is &lt;em&gt;too much information&lt;/em&gt; in your case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your application, i think you can categorize the problem into two possible subproblems:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, &lt;strong&gt;time series that have unequal starting points&lt;/strong&gt; (when some stocks' history is shorter):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Page, S., 2013, How to Combine Long and Short Return Histories Efficiently, &lt;em&gt;Financial Analysts Journal&lt;/em&gt; 69, 45-52&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Second, &lt;strong&gt;data that misses in between the time series&lt;/strong&gt; (for example on public holidays):&#xA;Well, there is the &lt;strong&gt;EM algorithm&lt;/strong&gt;. Take a look at it. The most cited paper here is &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Dempster, A. P., M. N. Laird, and D. B. Rubin, 1977, Maximum likelihood from incomplete data via the EM algorithm, &lt;em&gt;Journal of the Royal Statistical Society&lt;/em&gt; 39, 1-22&#xA;  It is an iterative, two-step algorithm.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can also find the concrete formulas in Meucci(2005) &quot;Risk and Asset Allocation&quot;. On his (Meucci's) webpage you can find the corresponding matlab code.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastEditorUserId="2727" LastEditDate="2014-07-17T13:34:08.810" LastActivityDate="2014-07-17T13:34:08.810" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14072" PostTypeId="1" CreationDate="2014-07-17T14:34:56.320" Score="5" ViewCount="41722" Body="&lt;p&gt;In Fixed Income, I know that bonds PnL are evaluated depending on where the price lies on price/yield curve at the end of the day, compared to where it started from at beginning of the day. The portfolio of bonds will have a specific DV01, which will be used to compute the PnL. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone tell me if this is right or is there something more? For equities it should be just a simple sum of stock prices at the end of day vs beginning of day? Is this right?&lt;/p&gt;&#xA;" OwnerUserId="9430" LastEditorUserId="9430" LastEditDate="2014-07-17T22:40:54.130" LastActivityDate="2019-04-15T01:16:21.210" Title="How is PnL calculated" Tags="&lt;fixed-income&gt;&lt;equity-curve&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="14073" PostTypeId="2" ParentId="14065" CreationDate="2014-07-17T16:35:11.503" Score="1" Body="&lt;p&gt;You can view the arbitrage-free statement as being about infinitely liquid trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If one has to trade $x$ by paying a half-spread $\nu$, and you have a trivial payoff $\Phi(\cdot) \equiv 1+R$ then there is no solution.  You would be trying to solve&#xA;$$&#xA;(1+R)x - \nu + suy = (1+R)x = (1+R)x - \nu + sdy&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2014-07-17T16:35:11.503" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14074" PostTypeId="2" ParentId="10917" CreationDate="2014-07-17T16:47:50.427" Score="2" Body="&lt;p&gt;Assuming that you have Internet and can use it OK (maybe not, in some countries it doesn't always work), if you look up ADR or American Depository Receipt you will find &quot;Listing of ADRs&quot;. This will take you to, for example, &lt;a href=&quot;http://adrs.net/directory.htm&quot; rel=&quot;nofollow&quot;&gt;http://adrs.net/directory.htm&lt;/a&gt;  There you will be able to see a list of all ADRs by their country of origin. With the names &amp;amp; symbols from this list, you can look up the latest values of individual market cap &amp;amp; volume on any of the financial sites, for example, Yahoo Finance, &lt;a href=&quot;http://finance.yahoo.com/&quot; rel=&quot;nofollow&quot;&gt;http://finance.yahoo.com/&lt;/a&gt;  For stock screeners, go to an Internet search engine and type in &quot;Stock Screener&quot;. You will find plenty of them. &lt;/p&gt;&#xA;" OwnerUserId="11579" LastActivityDate="2014-07-17T16:47:50.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14075" PostTypeId="2" ParentId="14067" CreationDate="2014-07-17T16:53:23.897" Score="2" Body="&lt;p&gt;@vanguard2k and @Theja provide useful information. In my experience, unequal starting points is most common, so I'll try to focus on that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The technique that @vanguard2k mentioned for unequal starting points can be thought of like a regression. You start with the longest available data and get the covariance matrix of that. For the next set of available data, you regress them against the data that is available longer and use the regression coefficients to expand the covariance matrix (and means). You then iterate through each unique group of data, steadily shrinking the amount of data used in each regression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above approach can be considered more general than simply just for estimating means and covariances. If every step is a regression, then you can make any assumptions you want so long as it fits within the context of a regression (for instance, you could estimate a garch model for S&amp;amp;P 500, then regress Facebook against S&amp;amp;P 500 with some garch process as well for the residual variance). You may not be able to get an analytic formula for the covariance, but you can simulate from the model and calculate the simulated covariance matrix from that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an alternative, multiple imputation would be like if after the regression you use that model to simulate some missing data points. In the next step, instead of using only the available data, you use the available &lt;strong&gt;and&lt;/strong&gt; the simulated missing. You then re-do the above steps many times (where the multiple comes from) until the parameters settle down. I find it can be helpful to learn about multiple imputation before trying to learn about Gibbs sampling. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The EM algorithm is also very similar to multiple imputation, with the exception that EM is filling in the missing data with the predicted value whereas multiple imputation is filling in with simulations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regardless, you may run into difficulties when the number of stocks you're looking at expands to more than the number of time periods (like any covariance estimation, really). One way to resolve this can be to apply PCA to each of the subsets of data, as appropriate. Alternately, you can limit the regression to something like the country/sector/industry indices. Either of these approaches is like making some assumption that certain correlations are zero. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Things become more complicated when you start dealing with data that easily be assumed to be I(0). For instance, suppose you want to estimate a VAR model for the S&amp;amp;P 500 (in log levels), S&amp;amp;P 500 E/P, 10 year U.S. Treasury yields, inflation, and VIX. You want a VAR model in this case because there might be some mean-reversion or cointegrating relationships. You will likely have data over the longest period for S&amp;amp;P 500, but less data for inflation, yields, E/P, and VIX. Since the data is not iid multivariate normal, you can no longer use the techniques mentioned by @vanguard2k. The difficulty is that when you simulate data, it needs to depend on both today's value and however many forward or backward lags are needed. There's a Gibbs sampling approach that can deal with this type of situation (Bayesian Mixed Frequency), but it's rather sophisticated.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2014-07-17T16:53:23.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14076" PostTypeId="2" ParentId="14065" CreationDate="2014-07-17T20:13:46.950" Score="0" Body="&lt;p&gt;The only reason we are able to solve the system is because of $d&amp;lt;u$ which follows from $d&amp;lt;1+R&amp;lt;u$, which follows from absence of arbitrage by Prop 2.3&lt;/p&gt;&#xA;" OwnerUserId="7788" LastActivityDate="2014-07-17T20:13:46.950" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14077" PostTypeId="2" ParentId="14072" CreationDate="2014-07-17T23:39:26.330" Score="7" Body="&lt;p&gt;You can use DV01 * (change in yields) to calculate the &lt;strong&gt;approximated&lt;/strong&gt; P&amp;amp;L, but you really shouldn't do it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The exact PnL calculation depends on the instruments you're trading. If it's exchange-traded (e.g., futures, futures options), then its price is readily available from the exchange, and the daily change in price should be used for marking to market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a bond in general, the daily PnL is (today's clean price + today's accrued interest + coupon payments received today if any) – (yesterday's clean price + yesterday's accrued interest). Oftentimes, government bond trades are financed by repo, so you need to subtract the financing cost from the quantity above, which is roughly the original dirty price (clean price + accrued interest) * repo rate * 1 / 360 (assuming holding period of 1 day and day count convention of Act/360).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For swaps, you'll need to calculate its new market value using the new swap curve. Swaptions are similar – you'll also need to reprice it using the new swap curve &amp;amp; vol cube. &lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2014-07-17T23:39:26.330" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14082" PostTypeId="2" ParentId="14072" CreationDate="2014-07-18T11:37:26.000" Score="4" Body="&lt;p&gt;The pnl calculation is done in 2 steps. By definition, you value your portfolio as of today, you value your portfolio as of yesterday, and the difference will be your pnl.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now that's an important number (that gets reported, etc.) but that doesn't give you a lot of information on what generated that pnl. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second step is to move every variable that could affect your pnl to measure the contribution that a change in this variable has on the total pnl.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a Zero coupon bond for instance, which has a TV of $\exp(-r(T-t)/365)$ (very generic, you need to account for repo etc.). You will report the pnl as follows:&#xA;PnL(1-0)=$(\exp(-r_0((T-t-1)/365)) - \exp(-r_0((T-t)/365))) + (\exp(-r_1((T-t)/365)) - \exp(-r_0((T-t)/365))) + \varepsilon$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first them is your carry, your $\theta$, ie the money you make because your bond is pulled to par (if there was a coupon it would be included in this). The second term is due to your change in interest rate. $\varepsilon$ is simply what you can't explain. If everything is neat, your $\varepsilon$ should not be too high. You can also see that this is very close to a Taylor expansion when everything is linear, which is why you can use your duration as an approximation for the 2nd term.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the equity side, if you sold an option for instance, it is the same process but with more variables (volatility, spot price).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this number is used for earnings (profit or loss) but also to monitor traders and their limits (a huge hit in one category would mean something is wrong).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="11540" LastActivityDate="2014-07-18T11:37:26.000" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14083" PostTypeId="1" CreationDate="2014-07-18T15:52:41.007" Score="0" ViewCount="534" Body="&lt;p&gt;How the price of a bond is actually determined? Is it the supply-demand that determines the price first and then the YTM is calculated on the back of this for that bond. Or is it that the changes to interest rate curve comes first and then the bond is priced using the typical discounting method and that becomes the price in stock market?&lt;/p&gt;&#xA;" OwnerUserId="9430" LastActivityDate="2014-08-21T04:46:59.720" Title="How is the price of a bond actually determined?" Tags="&lt;discount-factor-curve&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14084" PostTypeId="2" ParentId="14083" CreationDate="2014-07-18T16:56:55.883" Score="1" Body="&lt;p&gt;varies from market to market and from company to company... The methodology differs even for the US Treasury market (the most largest &amp;amp; most liquid govt bond market). Generally speaking, the benchmark bonds (2y, 3y, 5y, 7y, 10y, and 30y on-the-runs) are traded very very heavily and readily available. Their prices are driven by supply-demand. Non benchmark issues are priced using spreads to the benchmarks. Some firms (but not all) use a spline (smoothed curve) to price non-benchmark issues, but that's still just one input. Market microstructure information is paramount in eventual quoting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the end of the day, it's all supply-demand. As an example, this is the &lt;a href=&quot;http://www.pixiuum.com/media/files/2014/07/18/Screen_Shot_2014-07-18_at_1.02.08_PM.png&quot; rel=&quot;nofollow&quot;&gt;US Treasury yield curve&lt;/a&gt; from 2008... You can see having a discount curve model isn't really going to help you much...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Btw, price or yield first is strictly a convention. For example, US Treasuries are quoted on a price basis, but Australian bonds are quoted on a yield basis (if i remember correctly). &lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2014-07-18T17:15:23.690" LastActivityDate="2014-07-18T17:15:23.690" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14085" PostTypeId="1" CreationDate="2014-07-18T22:12:03.383" Score="1" ViewCount="6043" Body="&lt;p&gt;I want to run the newton method on a large dataset to calculate bond yield. Below is the code I created using a loop. I need to run it on ~50 million lines and the loop is quite unwieldy. Is there a more efficient way to run it using Pandas/Numpy/ect? &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;In:&#xA;from pandas import *&#xA;from pylab import *&#xA;import pandas as pd&#xA;import pylab as plt&#xA;import numpy as np&#xA;from scipy import *&#xA;import scipy&#xA;&#xA;df = DataFrame(list([100,2,34.1556,9,105,-100]))&#xA;df = DataFrame.transpose(df)&#xA;df = df.rename(columns={0:'Face',1:'Freq',2:'N',3:'C',4:'Mkt_Price',5:'Yield'})&#xA;df2= df&#xA;df = concat([df, df2])&#xA;df = df.reset_index(drop=True)&#xA;df&#xA;&#xA;Out:&#xA;    Face    Freq    N        C Mkt_Price  Yield&#xA;0    100     2   34.1556     9   105    -100&#xA;1    100     2   34.1556     9   105    -100&#xA;&#xA;In:&#xA;def Px(Rate):&#xA;    return Mkt_Price - (Face * ( 1 + Rate / Freq ) ** ( - N ) + ( C / Rate ) * ( 1 - (1 + ( Rate / Freq )) ** -N ) )&#xA;&#xA;for count, row in df.iterrows():&#xA;        Face = row['Face']&#xA;        Freq = row['Freq']&#xA;        N = row['N']&#xA;        C = row['C']&#xA;        Mkt_Price = row['Mkt_Price']&#xA;        row['Yield'] = scipy.optimize.newton(Px, .1, tol=.0001, maxiter=100)&#xA;df&#xA;&#xA;Out:&#xA;    Face    Freq   N         C  Mkt_Price   Yield&#xA;0    100     2   34.1556     9   105       0.084419&#xA;1    100     2   34.1556     9   105       0.084419&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11594" LastEditorUserId="848" LastEditDate="2014-07-19T08:42:21.313" LastActivityDate="2014-07-19T08:42:21.313" Title="Calculate bond yield in python" Tags="&lt;python&gt;&lt;bond-yields&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14086" PostTypeId="2" ParentId="4388" CreationDate="2014-07-18T22:43:17.520" Score="0" Body="&lt;p&gt;If you have CDS data, take ( cds spread changes * the dv01 of the cds / cds notional ) to get a percent change in cds. you can use that as a proxy for bond price volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that in bad times, cash tends to underperform cds so you need to increase the volatility of your bond relative to the cds. if your cds volatility is 3%, multiple that by say 1.5 to be conservative. additionally, you will need to adjust by the ratio of the cds dv01 to the bond dv01. &lt;/p&gt;&#xA;" OwnerUserId="11594" LastActivityDate="2014-07-18T22:43:17.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14089" PostTypeId="2" ParentId="14085" CreationDate="2014-07-19T08:42:02.367" Score="1" Body="&lt;p&gt;As far as I know the Newton method is the preferred method for yield calculation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Two ideas to optimize the loop spring to mind:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Run the loop in parallel.&lt;/li&gt;&#xA;&lt;li&gt;Use the last yield as starting value. If you have a good guess the number of iterations necessary per optimization is reduced significantly. How to get the most out of the previously calculated yield depends on the structure of your data. If comparable bonds are close in your data set this should work. If this is not the case you could do a stable sort on the attributes so similar bonds will be grouped together.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="848" LastActivityDate="2014-07-19T08:42:02.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14091" PostTypeId="2" ParentId="11359" CreationDate="2014-07-19T14:06:54.700" Score="0" Body="&lt;p&gt;First of all, the only one way to compute factor betas is to use the linear regression model, as suggested by John in the 1st comment. There is not other way to get them. You can get it by simply using excel through the &lt;em&gt;Data Analysis&lt;/em&gt; package or using the relative command/code in other statistical command; in Stata, for instance, the command &lt;em&gt;regress&lt;/em&gt; gives as output all statistics you need for(betas, st. dev., R^2,...).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly, the Fama-French model is portfolio-based. So, following their model you can compute beta factors on stock portfolios, built ranking stocks on their characteristics (the most used is the &lt;em&gt;size&lt;/em&gt; or mkt cap); it would have been no sense to compute betas for each stock in the market you're analyzing, since you did not conclude anything. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed, all regression-based model in financial economics, as the one you cited in the question, are portfolio-based and not stock-based.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, you can compute betas for each stock theoretically, but you'll not get economically explicable output.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2014-07-19T14:06:54.700" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14092" PostTypeId="1" AcceptedAnswerId="14103" CreationDate="2014-07-19T18:03:56.853" Score="2" ViewCount="988" Body="&lt;p&gt;&lt;strong&gt;Quick Summary on Historic VaR&lt;/strong&gt;&lt;br&gt;&#xA;Let $S_0,...,S_n$ be the daily values of some stock (where $S_0$ is the current value). Then for $i=1,\ldots,n$ we let &#xA;$$\hat r_i:=S_{i-1}/S_i \quad \text{and}\quad \hat S_i := S_0\cdot \hat r_i$$&#xA;Now we can estimate e.g. the 95% 1-day-VaR by looking at the $(0.95n)$-th smallest number amongst all the scenarios $\hat S_1,...,\hat S_n$ and then subtracting $S_0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above approach works fine when we look at stocks since $S_i&amp;gt;0$ for all $i$. But what if we consider an interest rate that is potentially close to zero, and even worse, may go negative (which is the case for the German short-term treasury bills at the moment), then we have that the $\hat r_i$ become very large and potentially negative, which renders the scenarios $\hat S_i$ completely useless.&lt;br&gt;&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Questions&lt;/strong&gt;&lt;br&gt;&#xA;One solution might be to look at the differences, i.e. $\overline r_i := S_{i-1}-S_i$ and $\overline S_i = S_0+\overline r_i$. But this completely ignores the order of magnitude of an asset. So my questions are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Does anybody have an idea as to what approach is usually used in practice&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Are differences a sensible approach at all?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Are there potentially other methods to avoid this problem?&lt;/p&gt;&#xA;" OwnerUserId="6621" LastEditorUserId="6621" LastEditDate="2014-07-19T19:14:35.287" LastActivityDate="2014-07-21T21:58:38.517" Title="Historic Value at Risk - Ratios vs. Differences" Tags="&lt;interest-rates&gt;&lt;simulations&gt;&lt;historical-data&gt;&lt;value-at-risk&gt;&lt;ratio&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14094" PostTypeId="1" AcceptedAnswerId="14098" CreationDate="2014-07-20T02:03:19.063" Score="7" ViewCount="3942" Body="&lt;p&gt;I came to the conclusion that in literature Markowitz' Portfolio Theory is believed to be compliant with the Efficient Market Hypothesis. The weakest form states that the current price fully incorporates information contained in the past history of prices only. That is, nobody can detect mispriced securities and “beat” the market by analyzing past prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand this means that future price movements are independent from what happened until now. In MPT though, to allocate funds between assets, we estimate the expected return and covariances from &lt;em&gt;past&lt;/em&gt; prices. If we want to be compliant with EMH, shouldn't we believe that those estimates make no sense? &lt;/p&gt;&#xA;" OwnerUserId="11600" LastEditorUserId="467" LastEditDate="2014-07-20T21:32:57.027" LastActivityDate="2014-07-21T08:47:54.997" Title="Does Modern Portfolio Theory align with EMH?" Tags="&lt;modern-portfolio-theory&gt;&lt;markowitz&gt;&lt;emh&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14095" PostTypeId="1" CreationDate="2014-07-20T04:15:58.220" Score="1" ViewCount="66" Body="&lt;p&gt;I am studying the European Sovereign Debt crisis and I have the following questions which I am struggling to find examples for:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) I have heard that during the sovereign debt crisis, European regulators and policymakers have often let small banks that are not systemically important fail (i.e., default). What are some examples of this? Which European small banks (in terms of asset size and liabilities) have been allowed to fail?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) I have also heard that organizations like the EU and IMF have worked hard to bail out systemically important &quot;large&quot; banks, i.e., banks that are 'too-big-to-fail'. This is because a failure of a large systemically important bank could cause contagion into the entire European banking system. Again, what are some examples of this? Which banks are &quot;too-big-to-fail&quot;? And which &quot;too-big-to-fail&quot; banks have been bailed out? And what organization bailed it out? One example I found is here, where Dexia SA (one of the largest banks in Belgium) was bailed out. What about other examples?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Lastly, I read that the main policy implementations for handling &quot;too-big&quot; banks was to shrink their size and/or break them up into smaller entities, e.g., here and here. What are examples of this? Which regulators/policymakers and which large banks were downsized and/or broken up?&lt;/p&gt;&#xA;" OwnerUserId="11601" LastActivityDate="2014-07-20T04:15:58.220" Title="Questions related to the banking crisis during the European sovereign debt crisis" Tags="&lt;economics&gt;&lt;banks&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14096" PostTypeId="2" ParentId="14094" CreationDate="2014-07-20T07:39:28.037" Score="5" Body="&lt;p&gt;The weak EMH states that it is impossible to earn an &lt;em&gt;excess&lt;/em&gt; return given publicly known information such as past prices. Clearly, different securities have different &lt;em&gt;expected&lt;/em&gt; returns. For example: the bond and the stock of one company or a security that generates twice the return of another one. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This difference in expected return is explained by a difference in the amount of risk taken which is compensated by a risk premium. The amount of risk is persistent over time (the nature of the securities in the previous examples doesn't suddenly change), thus future price fluctuations are related to past prices. The EMH merely states that we can't predict these fluctuations better than other market participants.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2014-07-20T07:39:28.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14097" PostTypeId="2" ParentId="14094" CreationDate="2014-07-20T10:01:07.703" Score="1" Body="&lt;p&gt;MPT uses &lt;em&gt;expected&lt;/em&gt; values for its parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How these expected (&lt;em&gt;future&lt;/em&gt;) parameters are &lt;em&gt;estimated&lt;/em&gt;, is another question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually one takes &lt;em&gt;historic&lt;/em&gt; averages when its the only information available, but one could for example also use &lt;em&gt;analysts forecasts&lt;/em&gt; or other advanced estimation methods.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-07-20T10:01:07.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14098" PostTypeId="2" ParentId="14094" CreationDate="2014-07-20T18:35:35.853" Score="2" Body="&lt;p&gt;EMH says that one can not earn &lt;em&gt;excess&lt;/em&gt; return using some information. This is known as joint-hypothesis problem: to test for market efficiency one have to determine first what is &quot;normal&quot; market return, i.e. what type of information is normally priced by the market. Usually to test for EMH they use CAPM or 3-factor Fama-French model (which is a kind of CAPM-on-crutches), or 4-factor Carhart, of Stambaugh, of 5-factor Fama-French. CAPM, in turn, is a model for asset price in the world where everyone is using Markowitz-style optimization. Other models are built on CAPM. Authors who created it tried to overcome CAPM inconsistencies with empirical evidence. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now back to Markowitz. Markowitz just recommends what you have to do, if you (1) want to be optimal, (2) have some expectations of return and risk. It EMH holds, your expectations wouldn't earn you excess return (but would earn you some normal). If not, then you'll earn &quot;normal&quot; + excess return. That's why Markowitz had won his Nobel prize: his theory is good both for efficient and non-efficient market, whatever you define &quot;efficiency&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now back to your question. &quot;If we want to be compliant with EMH, shouldn't we believe that those estimates make no sense?&quot; EMH doesn't stop you from having your own views. It just says that whatever your views would be, you can not use it and earn return in excess of return predicted by some market model (CAPM, FF3F, etc.) But if you have views, you have to organise portfolio according to Markowitz.&lt;/p&gt;&#xA;" OwnerUserId="6535" LastEditorUserId="6535" LastEditDate="2014-07-20T18:48:09.797" LastActivityDate="2014-07-20T18:48:09.797" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14099" PostTypeId="2" ParentId="14094" CreationDate="2014-07-20T21:32:31.723" Score="4" Body="&lt;p&gt;The &lt;a href=&quot;http://en.wikipedia.org/wiki/Efficient-market_hypothesis&quot; rel=&quot;nofollow&quot;&gt;Efficient Market Hypothesis&lt;/a&gt; (EMH) states that you cannot beat the market &lt;strong&gt;on a risk-adjusted basis&lt;/strong&gt; by looking at past prices. You can certainly earn higher returns than the market if you take on more risk (by leveraging, for example).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Modern_portfolio_theory&quot; rel=&quot;nofollow&quot;&gt;Modern Portfolio Theory&lt;/a&gt; allows you to construct portfolios that are efficient. According to this theory, you still cannot beat the market portfolio on a risk-adjusted basis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, using estimates with past prices with MPT does not contradict EMH.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2014-07-21T08:47:54.997" LastActivityDate="2014-07-21T08:47:54.997" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14100" PostTypeId="2" ParentId="14065" CreationDate="2014-07-20T21:54:35.607" Score="1" Body="&lt;p&gt;A market is &lt;em&gt;arbitrage-free&lt;/em&gt;, if riskneutral measure Q exists (under which the discounted stockprice becomes martingale).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A market is &lt;em&gt;complete&lt;/em&gt;, when the riskneutral measure Q is unique.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, any market with a riskneutral measure Q is arbitrage-free, and if Q is unique it is also complete.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The riskneutral probabilities $q$ are unique for the binomial model, so it is arbitrage-free and complete.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For any multinomial model with $m&amp;gt;2$ stockmoves, Q has infinite solutions hence market is incomplete, but it is still arbitrage-free because Q's exist.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;One can show how the existence and uniqueness of the riskneutral measure Q for a Call in the Binomial Model implies existence of a replicating portfolio as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At time $t=0$, the asset price is $S_0$ and the call option price is $C_0$, to be determined. At time $t=1$, there are two possible asset prices $S_{1u} = S_0(1+u)$ with probability $p$ and $S_{1d} = S_0(1+d)$ with probability $1-p$.  The payoff of the option at expiration is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C_1 = \max(S_1-K,0), $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the random variable $S_1$ is $S_{1u}$ or $S_{1d}$ depending on the future state of the market:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C_{1u} = \max(S_{1u}-K,0)\\\ C_{1d} = \max(S_{1d}-K,0)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value of the option at time $t=0$ is the discounted expected value of the payoff. However this expected value is not calculated with real probability $p$ -- but rather the risk-neutral probability $\hat{p}$ that preclude arbitrage opportunities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can determine the no-arbitrage risk-neutral probability $\hat{p}$ by showing it is possible to construct a hedged portfolio of the option and the asset that is risk free -- it has the same value in both future states. Hence the value of the portfolio grows in time at the risk-free rate of interest $i$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose the portfolio is long $1$ call option and short $\Delta$ shares of the asset.  The value at time $t=1$ is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V_t= C_t-\Delta S_t.$$  We can solve for the hedge ratio $\Delta$ so that the value of the portfolio at time $t=1$ is independent of the state of the market:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C_{1u}-\Delta S_{1u}=C_{1d}-\Delta S_{1d},$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C_1-\Delta S_1=C_{1u}-\Delta S_0(1+u)=C_{1d}-\Delta S_0(1+d).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This value of the hedge ratio is independent of the probabilities for the value of the asset at time $t=1$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta = \frac{C_{1u}-C_{1d}}{S_0(u-d)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consequently, in the absence of arbitrage, the portfolio grows at the risk-free rate:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C_1-\Delta S_1 = (C_0 - \Delta S_0)(1+i)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and we can solve for the value of the call option at time $t=0:$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C_0 -\Delta S_0= \frac{C_{1u}-\Delta S_0 (1+u)}{1+i},$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C_0 = \frac{\Delta S_0 (1+i) +C_{1u}-\Delta S_0 (1+u)}{1+i},$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C_0 = \frac{-\Delta S_0 (u-i) + C_{1u}}{1+i}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Substituting for $\Delta$, we obtain&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C_0 = \frac{\hat{p}C_{1u}+(1-\hat{p})C_{1d}}{1+i}=\frac{1}{1+i}\{\hat{p}\max[S_0(1+u)-K,0)]+(1-\hat{p})\max[S_0(1+d)-K,0)]\},$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\hat{p} = \frac{i-d}{u-d}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This has the form of an expected value with a different probability -- the risk-neutral probability. The fair value of the call option is the discounted expected value under the risk-neutral probability measure.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-07-20T22:35:57.083" LastActivityDate="2014-07-20T22:35:57.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14101" PostTypeId="2" ParentId="14064" CreationDate="2014-07-20T21:57:44.537" Score="1" Body="&lt;p&gt;In general, if one can create a portfolio with the same payoff as the derivative, their prices must be equal. This is also called &quot;Law of One Price&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here an excerpt from my script:&lt;img src=&quot;https://i.stack.imgur.com/AGj02.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here EMM = Equivalent Martingale Measure (Q), NA = No-Arbitrage.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-07-20T23:27:18.443" LastActivityDate="2014-07-20T23:27:18.443" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="14102" PostTypeId="1" AcceptedAnswerId="14104" CreationDate="2014-07-21T07:38:08.930" Score="24" ViewCount="35880" Body="&lt;p&gt;In most textbooks &lt;a href=&quot;http://en.wikipedia.org/wiki/Ito&amp;#39;s_lemma&quot;&gt;Ito's lemma&lt;/a&gt; is derived (on different levels of technicality depending on the intended audience) and then only the classic examples of &lt;a href=&quot;http://en.wikipedia.org/wiki/Ito&amp;#39;s_lemma#Geometric_Brownian_motion&quot;&gt;Geometric Brownian motion&lt;/a&gt; and the &lt;a href=&quot;http://en.wikipedia.org/wiki/Ito&amp;#39;s_lemma#Black.E2.80.93Scholes_formula&quot;&gt;Black-Scholes equation&lt;/a&gt; are given.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question&lt;/strong&gt;&lt;br&gt;&#xA;I am looking for references where &lt;em&gt;lots&lt;/em&gt; of worked examples of applying Ito's lemma are given in an easy to follow, step by step fashion. Also more advanced cases should be covered.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2017-02-13T17:02:30.443" Title="Worked examples of applying Ito's lemma" Tags="&lt;stochastic-calculus&gt;&lt;reference-request&gt;&lt;itos-lemma&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="34" ContentLicense="CC BY-SA 3.0" />
  <row Id="14103" PostTypeId="2" ParentId="14092" CreationDate="2014-07-21T07:55:42.527" Score="4" Body="&lt;p&gt;As a short summary and adaption of the question:&#xA;You better redefine $\hat{r}_i= \frac{S_{i-1}}{S_1}-1$ and $\hat{S}_i = (1+\hat{r}_i)S_0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above definition of $\hat{S}_i$ yields a sample of potential values for $S$ for the future day.&#xA;This approach is usually applied in historical simulation. The aim here is to use information of the past about the distribution of &lt;strong&gt;invariant&lt;/strong&gt; quantities. The stock price itself is not invariant but returns can be assumed to be invariant. It then makes sense to form a sample using these. The good thing is if we assume that $\hat{r}_i$ is e.g. normally distributed then $\hat{S}_i$ is so too. One could reformulate the set-up to a log-normal world.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For interest rates we rather think of an additive evolution. They change in bps and market participants add bps to the yield curve when they think about future developments. In my experience this is what is done in the historical simulation of interest rates. You form samples of the form&#xA;$$&#xA;\hat{r}_i = r_0 + (r_{i-1}-r_i).&#xA;$$&#xA;Doing this we again use invariant quantities of the past and apply it to the present situation. This is often done fo the whole interest rate curve and then used to price bonds or derivatives.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The term &lt;strong&gt;invariant&lt;/strong&gt; in this context is borrowed from &lt;a href=&quot;http://www.symmys.com/sites/default/files/15_Invariants.pdf&quot; rel=&quot;nofollow&quot;&gt;Attilio Meucci&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-07-21T07:55:42.527" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14104" PostTypeId="2" ParentId="14102" CreationDate="2014-07-21T08:49:04.057" Score="23" Body="&lt;p&gt;These are all examples on Ito Formula in its general form (with quadratic variations):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/i2WOF.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/WsfuN.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/HDeBI.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/LGIzW.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/N4X99.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/iWqKW.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/kTCfq.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Vbkzx.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-07-21T09:07:01.707" LastActivityDate="2014-07-21T09:07:01.707" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14106" PostTypeId="1" CreationDate="2014-07-21T10:04:41.103" Score="2" ViewCount="782" Body="&lt;p&gt;It seems that there are mayor softwares around offering a multicurve framework based on  bootstrap. I find this puzzling nowadays, given the distinct advantages of best-fit optimization methods and the hurdles in extending bootstrap techniques to the multicurve setting (e.g. cyclic interdependencies among curves, nontrivial products, usage of nonliquid instruments, overall coherence, dates mismatches, TOY effect, pre-first-tenor forwards, joint curves+term structure dynamics calibration etc). Therefore I must be missing some major drawback of full calibration or overestimating issues for bootstrap. The literature is outdated and mostly partisan, just like those I asked to dismiss either choice altogether. Could someone please shed some more light on these two possibilities and respective drawbacks?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Moreover, Henrard mantains that for best-fit calibration a Newton-Rhapson optimizer suffices, while in my opinion the landscape is not so well-behaved... any views on this?) &lt;/p&gt;&#xA;" OwnerUserId="3015" LastEditorUserId="3015" LastEditDate="2014-07-21T12:20:53.130" LastActivityDate="2014-08-01T14:43:13.953" Title="Comparison of multicurve calibration methods" Tags="&lt;yield-curve&gt;&lt;multicurve&gt;&lt;ois-discounting&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14108" PostTypeId="2" ParentId="3114" CreationDate="2014-07-21T12:02:07.633" Score="7" Body="&lt;p&gt;I am very happy with the following equivalent formulation for the risk budgeting problem (as presented in &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2009778&quot; rel=&quot;noreferrer&quot;&gt;Bruder, Roncalli, 2012, Managing Risk Exposures using the Risk Budgeting Apporach&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $b_i$, $\Sigma_{i=1}^n b_i =1$ be the risk budgets, $y_i$ the unscaled portfolio weights and $S$ the variance covariance matrix and $c$ arbitrary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ y^* = \text{arg min}_y \sqrt{y^T S y}, \quad \text{s.t.} \sum_{i=1}^n b_i \ln y_i \geq c, \quad \sum_{i=1}^ny_i=1, \quad y_i \geq 0 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the good thing about this formulation is: It is a quadratic program with convex constraints (assuming $b_i &amp;gt;0$) which is numerically nice. Further more, for numerical implementation one would like to drop the constraint $\sum_{i=1}^ny_i=1$ and manually rescale afterwards $x_i^* = \frac{y_i^*}{\sum_{i=1}^ny_i^*} $. It works better for me than the solution presented in the other answer.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastEditorUserId="467" LastEditDate="2014-07-21T14:05:19.560" LastActivityDate="2014-07-21T14:05:19.560" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14109" PostTypeId="1" AcceptedAnswerId="14113" CreationDate="2014-07-21T12:51:50.957" Score="3" ViewCount="2281" Body="&lt;p&gt;The Black Scholes model assumes the following dynamics for the underlying, well known as the Geometric Brownian Motion: $$dS_t=S_t(\mu dt+\sigma dW_t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the solution is given: $$S_t=S_0\,e^{\left(\mu-\frac{\sigma^2}{2}\right)t+\sigma W_t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can be shown by Ito Lemma on function $f(t,W_t)=\ln S_t$ that this solution is correct as it leads to above dynamics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;But how do we solve the above SDE originally to find this solution?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Guessing the above solution to apply Ito seems unlikely to me.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-07-21T21:01:18.850" LastActivityDate="2014-07-21T21:01:18.850" Title="How to get Geometric Brownian Motion's closed-form solution in Black-Scholes model?" Tags="&lt;black-scholes&gt;&lt;stochastic-calculus&gt;&lt;itos-lemma&gt;&lt;sde&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14110" PostTypeId="1" CreationDate="2014-07-21T13:37:59.520" Score="12" ViewCount="1752" Body="&lt;p&gt;I'm working in the commodity market and I've to price Swing Options with MATLAB, preferably with finite element.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone already priced these kind of derivatives?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm thinking about using the structure for the pricing of an American Option and then do it iteratively. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;More details about Swing Options are included in this &lt;a href=&quot;ftp://ftp.sam.math.ethz.ch/pub/sam-reports/reports/reports2006/2006-07.pdf&quot;&gt;paper&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that swing options are really useful in commodity markets because you can exercise them more than once (like American options); obviously there are some constraints that limit you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've already tried to price them with Least Squares Monte Carlo method (using the algorithm presented by &lt;a href=&quot;http://www.math.ethz.ch/~hjfurrer/teaching/LongstaffSchwartzAmericanOptionsLeastSquareMonteCarlo.pdf&quot;&gt;Longstaff and Schwartz&lt;/a&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I want to price them with finite element but I'm having some difficulties. In particular I'm pricing them without jumps, so I'm using an EDP discretized (and not a PIDE).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to know if anyone already implemented such a thing?&lt;/p&gt;&#xA;" OwnerUserId="11609" LastEditorUserId="848" LastEditDate="2014-07-21T17:21:31.037" LastActivityDate="2015-07-18T17:53:37.490" Title="How to price a Swing Option?" Tags="&lt;option-pricing&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14112" PostTypeId="2" ParentId="14072" CreationDate="2014-07-21T14:45:55.217" Score="5" Body="&lt;p&gt;Assuming that you are working for a bank, there are three different P&amp;amp;Ls depending on the function/ usage:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Actual P&amp;amp;L calculated by Finance/ Product Control and is based on the actual price of the instrument in the market (or the corresponding model if a market does not exist). This reflects the true P&amp;amp;L if the position is closed at market prices. In many cases (like bonds in your case) these prices are observed and unambiguous, this is 'marking to market'; in other cases (where you might hold an illiquid exotic, like a PRDC for example) this price is estimated by the Front Office pricer, this is 'marking to model'. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Clean P&amp;amp;L which is the Actual minus fees, commissions, bid-offer spreads, intraday trading, and other elements like reserve P&amp;amp;L applied to capture marking to model risk. This is also calculated by Finance/ Product Control. Note that this depends on the local regulation, therefore the same position can potentially have different Clean P&amp;amp;L if booked in books that are subject to different regulators. Clean P&amp;amp;L is used for backtesting VaR models for regulatory capital.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Hypothetical (hypo) P&amp;amp;L which is based on some model (risk or front office) that is perturbed by the actual movements of the factors involved. This might as simple as 'PV01 * shock', reading off a stylized yield curve as you describe, or it might be more involved. Typically this is calculated by some Risk function. The empirical relation between Hypo and Clean P&amp;amp;L is used to produce diagnostics under the forthcoming FRTB regulation. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2016-01-14T07:35:34.477" LastActivityDate="2016-01-14T07:35:34.477" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14113" PostTypeId="2" ParentId="14109" CreationDate="2014-07-21T14:59:24.293" Score="7" Body="&lt;p&gt;If by 'solve' you mean how do we know that $\ln S_t$ is the right change of variable, then you can go by the following (not rigorous) line of thought:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Ito's fomula suggests that given an SDE $$dX_t = \mu(X_t,t)dt+\sigma(X_t,t)dW_t$$ and a function $f(x,t)$: the SDE for the process $Y_t=f(X_t,t)$ will satisfy $$dY_t = [f_t(X_t,t) + f_x(X_t,t)\mu(X_t,t) + \frac{1}{2}f_{xx}(X_t,t)\sigma^2(X_t,t)]dt+f_x(X_t,t)\sigma(X_t,t)dW_t$$&lt;/li&gt;&#xA;&lt;li&gt;Now the SDE for the spot price is, as you wrote, given by $$dS_t = \mu S_tdt+\sigma S_t dW_t$$: hence a transformation $f$ applied to this SDE will have dynamics given by $$dY_t = [...]dt+f_x(S_t,t)\sigma S_t dW_t$$&lt;/li&gt;&#xA;&lt;li&gt;We want the transformation to kill the dependence of volatility on the spot, therefore we want to 'solve' something like '$f_x(S_t,t)\sigma S_t = const.$' which essentially means '$f_x(x,t) = \frac{1}{x}$'. This points towards the guess $$f(x,t)=\ln x$$. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="9336" LastEditDate="2014-07-21T17:24:08.080" LastActivityDate="2014-07-21T17:24:08.080" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14114" PostTypeId="2" ParentId="14049" CreationDate="2014-07-21T21:08:30.973" Score="3" Body="&lt;ol&gt;&#xA;&lt;li&gt;About the integration problem: Your integrand is highly oscillatory, and the adaptive quadrature of Matlab doesn't handle such integrands very well. In general, I would recommend Mathematica when Matlab's standard procedures don't perform well. In this case, a Levin-type method would perform much better. The reason that quadv produces NaN values is because of the singularity at 0. You would have to start the integration at a small, positive value.&lt;/li&gt;&#xA;&lt;li&gt;In any case, there are a few typos in your code. I have attempted to correct the code. The integration works well now, but I still do not get the value that you were expecting (I have used t=0, q=0, mu=0 for the unspecified parameters; mu is needed in the mus formula). I have added XXX as comments in the lines that I have changed. Also, I made all operations vector valued to speed up the integration.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function price = SVCJDuffie2000Test(S0, K, V0, r, mus, muv, lambda, kappav, ...&#xA;    thetav, sigmav, sigmas, rho, rhoj, q, t, T)&#xA;    % this function should in theory calculate the analytical solution for&#xA;    % the SVCJ model by Duffie et al&#xA;    %&#xA;    %&#xA;    %&#xA;    %&#xA;    % T=0.25&#xA;    % K = 100;&#xA;    % S0 = 85;&#xA;    % kappav=4;&#xA;    % lambda=4;&#xA;    % rhoj=-0.5;&#xA;    % rho=-0.5;&#xA;    % thetav=0.04;&#xA;    % r=0.05;&#xA;    % sigmas=0.06;&#xA;    % muv=0.02;&#xA;    % muJ = -0.04; &#xA;    % sigmav=0.1;&#xA;    % V0 = 0.25;&#xA;    %&#xA;    %&#xA;    % mus = log((1+mu)*(1-rhoj*muv))-0.5*(sigmas^2);&#xA;    % SVCJDuffie2000Test( S0, K, V0, r, mus, muv, lambda, kappav,  thetav, sigmav, sigmas, rho, rhoj, 0,0,T )&#xA;&#xA;     % S0, V0, r, mu, muv, lambda, kappav, &#xA;     % thetav, sigmav, sigmas, rho, rhoj, &#xA;     y          = log(S0);&#xA;     X0         = [y; V0]; % XXX two-dimensional process&#xA;     % nu, initial vola, nubar long run mean vola&#xA;     %nu         = V0; % XXX&#xA;     c          = K;&#xA;     nubar      = thetav;&#xA;     %sigmav     = sigmav;&#xA;     sigmacy    = sigmas;&#xA;     mucy       = mus;&#xA;     mucv       = muv;&#xA;     %rhoj       = rhoj;&#xA;     rhobar     = rho;&#xA;     %kappav     = kappav;&#xA;     zetabar    = q;&#xA;     lambdac    = lambda;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;     % not needed for SVJJ, ie SVCJ&#xA;     sigmay    = 0;&#xA;     lambday   = 0;&#xA;     lambdav   = 0;&#xA;     muv        = 0;&#xA;     muy        = 0;&#xA;&#xA;&#xA;&#xA;     % specific to SVCJ model&#xA;     lambdabar  = lambday + lambdav + lambdac;&#xA;     r          = r;&#xA;&#xA;     mubar = thetafunc(1,0) - 1;&#xA;&#xA;    function retval = alphabar(tau,u)&#xA;        thetainter = lambdabar^-1*(lambday*fy(u,tau)+lambdav*fv(u,tau)+lambdac*fc(u,tau));&#xA;        retval = alpha0(tau, u) - lambdabar*tau*(1+mubar*u)+lambdabar*thetainter;&#xA;    end&#xA;&#xA;&#xA;    function retval = betabar(tau,u)&#xA;        a = u.*(1-u);&#xA;        b = sigmav*rhobar*u-kappav;&#xA;        gamma = sqrt(b.^2+a*sigmav^2);&#xA;        retval = -a.*(1-exp(-gamma*tau)) ./ (2*gamma-(gamma+b).*(1-exp(-gamma*tau))); % XXX minus was missing&#xA;    end&#xA;&#xA;&#xA;    function retval = alpha0(tau, u)&#xA;       a = u.*(1-u);&#xA;       b = sigmav*rhobar*u-kappav;&#xA;       gamma = sqrt(b.^2+a*sigmav^2);&#xA;       retval = -r*tau+(r-zetabar)*u*tau-kappav*nubar*...&#xA;            (((gamma+b)/sigmav^2)*tau + ...&#xA;            (2/sigmav^2)*log(1-((gamma+b)./(2*gamma)).*(1-exp(-gamma*tau))));&#xA;    end&#xA;&#xA;&#xA;&#xA;    function retval = fy(u,tau)&#xA;        retval = tau*exp(muy*u+1/2*sigmay^2*u.^2);&#xA;    end&#xA;&#xA;    function retval = fv(u,tau)&#xA;        a = u.*(1-u);&#xA;        b = sigmav*rhobar*u-kappav;&#xA;        gamma = sqrt(b.^2+a*sigmav^2);&#xA;        retval =  (gamma-b)./((gamma-b)+muv*a)*tau-(2*muv*a)./(gamma.^2-(b-muv*a).^2)... &#xA;                .*log(1-((gamma+b)-muv*a)./(2*gamma).*(1-exp(-gamma*tau))); % XXX equation had a number of mistakes&#xA;        retval(a==0) = (gamma-b)./((gamma-b)+muv*a)*tau; % XXX take care of special case&#xA;    end&#xA;&#xA;    function retval = fc(u,tau)&#xA;        a = u.*(1-u);&#xA;        b = sigmav*rhobar*u-kappav;&#xA;        c_ = 1 - rhoj*mucv*u;&#xA;        gamma = sqrt(b.^2+a*sigmav^2);&#xA;        d_ = (gamma-b)./((gamma-b).*c_+mucv*a)*tau-(2*mucv*a)./((gamma.*c_).^2-(b.*c_-mucv*a).^2)...&#xA;            .*log(1-((gamma+b).*c_-mucv*a)/(2*gamma.*c_).*(1-exp(-gamma*tau)));&#xA;        retval = exp(mucy*u+sigmacy^2*u.^2/2).*d_;&#xA;        retval(a==0) = (gamma-b)./((gamma-b).*c_+mucv*a)*tau; % XXX take care of special case&#xA;    end&#xA;&#xA;    function retval = thetafunc(c1, c2)&#xA;        retval = lambdabar^-1*(lambday*thetayfunc(c1)+lambday*thetavfunc(c2)+lambdac*thetacfunc(c1,c2));&#xA;    end&#xA;&#xA;    function retval = thetayfunc(c)&#xA;        retval = exp(muy*c+1/2*sigmay^2*c^2);&#xA;    end&#xA;&#xA;    function retval = thetavfunc(c)&#xA;        retval = 1/(1-muv*c);&#xA;    end&#xA;&#xA;    function retval = thetacfunc(c1,c2)&#xA;        retval = exp(mucy*c1+1/2*sigmacy^2*c1^2) / ...&#xA;            (1-mucv*c2-rhoj*mucv*c1);&#xA;    end&#xA;&#xA;&#xA;    % equation 4.2, p. 21&#xA;    function retval = psi(u, y, v, t, T)&#xA;        retval =  exp(alphabar(T-t,u)+u*y+ betabar(T-t,u)*v);&#xA;    end&#xA;&#xA;    function retval = psichi(u, X0, t, T)&#xA;        y = X0(1);&#xA;        v = X0(2);&#xA;        retval = psi(u, y, v, t, T);&#xA;    end&#xA;&#xA;    function retval = Gab(a,b, y, X0_, T)&#xA;        integratefunc = @(nu_) imag(psichi(complex(a,nu_*b),X0_, 0, T) .* exp(complex(0,-nu_*y))) ./ nu_; % XXX&#xA;        retval = psichi(a,X0_,0,T)/2  - 1/pi*integral(integratefunc, 0, Inf, 'ArrayValued', true);&#xA;        %retval = 1;&#xA;    end&#xA;&#xA;    % depends on payoff function, see p. 6, 18&#xA;    aT = 0; % XXX values for European call option&#xA;    bT = 0;&#xA;    d = 1;&#xA;&#xA;&#xA;    % could also be:    &#xA;    %aT = 0;&#xA;    %bT = 1;&#xA;    %d = -r*T;&#xA;&#xA;&#xA;&#xA;    GbTplusdminusd = Gab(bT+d,-d,-log(c),X0,T)&#xA;    GbTminusd =Gab(bT,-d,-log(c),X0,T)&#xA;&#xA;    price = exp(aT)*GbTplusdminusd-c*exp(aT)*GbTminusd;&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7396" LastEditorUserId="848" LastEditDate="2014-07-22T05:38:25.737" LastActivityDate="2014-07-22T05:38:25.737" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14115" PostTypeId="2" ParentId="14049" CreationDate="2014-07-21T21:33:09.473" Score="2" Body="&lt;p&gt;I would suggest that you use a more 'modern' method to recover option prices from characteristic functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The approach of this papers (for practical calculations of option prices) is somewhat outdated. The backbone of affine models (such as SVJJ) is the characteristic function $\psi(u)$ of the log-price distribution, which is known in closed form.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Duffie/ Pan/ Singleton paper, in the footsteps of Heston and Bakshi/ Madan, expresses the option price as&#xA;$$C = S_0\ \Pi_1 - K \exp(-rT)\ \Pi_2$$&#xA;This is an intuitive form that resembles Black/ Scholes, with the difference that $\Pi_{1,2}$ are not cumulative Gaussians, but rather cumulative densities of 'bespoke' distributions. They can be expressed as integrals of the characteristic function, which is what the paper does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Expressing the option price a'la Black/ Scholes, with a decomposition in terms of Delta ($\Pi_1$) and the probability of ending up in-the-money ($\Pi_2$) is intutive and well suited for teaching or academic research. However, this approach is not numerically stable, as the integrand can be very oscillatory and decaying very slowly. This was illustrated in Carr/ Madan, where they propose to invert the characteristic function and recover the option price directly using FFT. Chourdakis (&lt;a href=&quot;http://faculty.baruch.cuny.edu/lwu/890/ChourdakisFRFT_JCF2005.pdf&quot; rel=&quot;nofollow&quot;&gt;pdf here&lt;/a&gt;) proposes a further refinement that improves robustness (fractional FFT).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am sure that there has been susequent research that might offer better procedures for the inversion of the characteristic function (some names to Google include Lewis, Lipton, Fang/ Oosterle, Levendorskii). But I don't have first hand experience of these methods. I have implemented FFT/ FRFT in similar settings very successfully, and can vouch for them.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2014-07-21T23:16:20.147" LastActivityDate="2014-07-21T23:16:20.147" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14116" PostTypeId="2" ParentId="14092" CreationDate="2014-07-21T21:58:38.517" Score="2" Body="&lt;p&gt;It might help to think of the two as special cases of&#xA;$$S_{i+1}-S_i = \sigma (c+S_i)^\beta \epsilon$$&#xA;which looks like a Constant Elasticity of Variance extension. Taking squares of both sides and then logs will (nearly) linearise it, allowing you to carry some basic estimation using OLS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The parameter $c$ will control the lower bound and can impose some volatility at zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\beta=0$ corresponds to absolute shocks, while $\beta=1$ corresponds to relative shocks. But there are other possibilities, for example 1/2 like CIR. Values bigger than one would indicate a very wild behaviour (similar to strictly local martingales).&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2014-07-21T21:58:38.517" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14117" PostTypeId="2" ParentId="14083" CreationDate="2014-07-22T00:45:54.777" Score="0" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;First of all bonds are not traded in the stock market. Bonds are traded in over-the-counter (OTC) markets (given they are already issued earlier) where buyers meet sellers and determine the price. This price is driven by the expectations of buyers and seller i.e. demand and supply. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;YTM is linked to the price. A simple way to look at YTM is as the internal rate of return (IRR) on the bond investment since there will be cash flows on coupons (for coupon bond) and principal payment at maturity. The price can be determined by discount function (see next point) + credit risk + liquidity risk etc linked to the bond in question. So supply-demand -&gt; Price and YTM&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Pricing a bond: To keep things simple say you have a default-free bond i.e. there is no credit risk in the investment and all promised coupons will be paid on time. To compute the price of this bond you need the discount function for each tenor of the coupon. Discount function is the price of on-the-run treasury zero-coupon bonds/strips which pay $1 at maturity. Treasury strips are basically zero coupon bonds engineered from coupon treasury bonds and are very liquid instruments. So price of this bond will be given by:&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;$$ Price = \sum{CF_i*D(0,i)} $$ where $CF_i$ is the cash flow from bond at time $i$ and $D(0,i)$ is the discount function i.e. present value of zero coupon treasury expiring at time $i$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since this &quot;should&quot; be the true price of the bond (we assumed default free bond) the no arbitrage principle will ensure market supply-demand keeps the price of the bond close to this value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yield curve: Yield curve is basically a function of the $D(0,i)$. In the instance above we are using the spot yield curve since we are valuing a simple vanilla bond. In case you don't have values of $D(0,i)$ for all $i$ then people use interpolation methods to get the complete curve, which can include regression, cubic splines etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for spot curve with yields quoted semi annually $$ y_i = 2*(D(0,i)^{\frac{-1}{i}} - 1)$$ here $i$ is the $i_{th}$ cash flow so at time $t=0.5 yrs, i = 1$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers!&lt;/p&gt;&#xA;" OwnerUserId="6675" LastEditorUserId="6675" LastEditDate="2014-07-22T04:39:56.467" LastActivityDate="2014-07-22T04:39:56.467" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="14118" PostTypeId="2" ParentId="12971" CreationDate="2014-07-22T05:09:55.310" Score="2" Body="&lt;p&gt;When we discuss CAPM it assumes a lot of things about the market and investor behaviour. There is enough literature on &quot;CAPM doesn't hold&quot;. In fact most low beta stocks plot above the security market line (SML). So it would be a mistake to take CAPM so seriously in practice and I would cross question if CAPM works as it is?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In theory, if there are negative interest rates then according to the CAPM equation you would have a negative intercept. Also the market premium would go up by the amount of risk free rate. But this is pure mathematics and one should ask the question, is there value in holding risk-free asset?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, it is wrong to assume CAPM holds even when risk-free rate is positive. Empirically the SML plots with a negative slope, i.e. low beta stocks (value) have higher expected return than high beta stocks (growth). One argument in favour for this is if investors believe in CAPM blindly then they overprice high beta stocks (everyone assume high beta = high return), depleting the &quot;expected return&quot; and under price the low beta stocks increasing the &quot;expected return&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This &lt;a href=&quot;http://www.hbs.edu/faculty/Publication%20Files/FINAL%20Decomposition%20of%20Low%20Risk_36c1e488-c814-496a-bd3b-113e54b3be1d.pdf&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; is a good reference to read about low beta anomaly.&lt;/p&gt;&#xA;" OwnerUserId="6675" LastActivityDate="2014-07-22T05:09:55.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14119" PostTypeId="2" ParentId="12925" CreationDate="2014-07-22T05:36:50.443" Score="5" Body="&lt;p&gt;The intuition behind Macaulay Duration is the average time it takes to get all the cash flows from a bond. Think of it as computing the centre of gravity for a see-saw.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find the image depicting the same &lt;a href=&quot;http://en.wikipedia.org/wiki/Bond_duration#mediaviewer/File:Macaulay_duration_example.jpeg&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZccAb.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This should immediately tell you that Macaulay Duration for Zero coupon bond is the maturity of the bond. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In continuous discounting Macaulay Duration equals Modified duration. The extra period discounting in discrete discounting is to get the math right for Modified Duration.&lt;/p&gt;&#xA;" OwnerUserId="6675" LastEditorUserId="467" LastEditDate="2014-07-22T07:17:19.593" LastActivityDate="2014-07-22T07:17:19.593" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14120" PostTypeId="2" ParentId="12748" CreationDate="2014-07-22T06:04:14.960" Score="1" Body="&lt;p&gt;You are probably computing autocorrelation in the prices. If you compute autocorrelation between the returns or log returns then you will not see the results you are getting. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is because:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Tomorrow's price will always be influenced by lagged prices and the series will not look weak stationary if you plot it. The direct differencing doesn't help either because you don't have a normalized value and weak stationarity doesn't hold.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Returns are normalized to last closing price so you get meaningful results. Also returns can exhibit weak stationarity which you can try to model using ARIMA.  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Cheers!  &lt;/p&gt;&#xA;" OwnerUserId="6675" LastActivityDate="2014-07-22T06:04:14.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14121" PostTypeId="2" ParentId="10584" CreationDate="2014-07-22T06:33:12.990" Score="0" Body="&lt;p&gt;You need the weights for each index to compute the portfolio return time series. The portfolio return would be the weighted average of the returns at each time step. Once you have a single time series of portfolio returns you can compute the the statistics. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Averaging the returns without any weights would be a purely mathematical exercise at this point. By computing geometric mean of three indices you are allocation capital to a exotic asset which needs to be structured by some BB structuring desk. Probably some banks have structured these products. &lt;/p&gt;&#xA;" OwnerUserId="6675" LastActivityDate="2014-07-22T06:33:12.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14122" PostTypeId="2" ParentId="10300" CreationDate="2014-07-22T06:58:44.700" Score="7" Body="&lt;p&gt;The model of choice depends on the purpose of the exercise. In general there are two types of models:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Equilibrium models:&#xA;These are general used use for &quot;fitting&quot; the spot curve to the discount function available in the market. So different models will give you different yield curves. One can use this information to see the relative value of implementing a strategy. Examples are Vasicek two factor model. Since the yield curve produced by these models will not be same as the actual yield curve hence they are usually not used for derivatives pricing (you won't get exact market prices of bonds using a calibrated model here). &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Risk - Neutral models: These are the second class of models. They fit the current yield curve exactly and are used to price derivative securities like caps/floors/swaptions etc. Libor Market Models would fall in this category. Example, Black-Derman-Toy, String model (Longstaff-Schwartz et al) etc. You can use BDT to construct binomial trees and get the price of the derivative security. String model can be used to simulate yield curves using Monte Carlo simulation and price securities in the process. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;On factors: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As per literature some researchers have used Principal Component Analysis on yield curve data and found that for yield curve, almost all of variation can be captured using 4 principal components:&#xA;1. Level (parallel shift)&#xA;2. Slope (tilt)&#xA;3. Curvature &#xA;4. Money Market Factor (short end)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some complex models use some/all of these factors to model the yield curves.&lt;/p&gt;&#xA;" OwnerUserId="6675" LastActivityDate="2014-07-22T06:58:44.700" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14124" PostTypeId="2" ParentId="8918" CreationDate="2014-07-22T07:40:46.853" Score="1" Body="&lt;p&gt;This answer depends on the $X^i$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before jumping on to the solution it should be answered that are $X^i$ traded in the market? i.e. are the returns on these available in the market (Size/Momentum portfolios, ETF returns) or are these economic variables like CPI, Inflation etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it is the former i.e. traded assets then we can do the time series regression to compute the factor loadings i.e. $\beta_i$. however we need to ensure other things while performing the regression, like multi-collinearity check etc. to avoid spurious results. People have used PCA and Clustering techniques to check for these things. Example, Fama-French model, Cahart 4 factor model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For using economic variables like CPI, inflation, unemployment data we will need to do the cross-sectional regression since we don't know what is the factor risk premium i.e. $$E[R^i - rf]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this will be a two step regression. You can use &lt;a href=&quot;http://en.wikipedia.org/wiki/Fama%E2%80%93MacBeth_regression&quot; rel=&quot;nofollow&quot;&gt;Fama-Macbeth&lt;/a&gt; or a similar procedure. Example, Chen-Ross-Roll model.&lt;/p&gt;&#xA;" OwnerUserId="6675" LastActivityDate="2014-07-22T07:40:46.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14125" PostTypeId="1" CreationDate="2014-07-22T08:18:08.853" Score="1" ViewCount="198" Body="&lt;p&gt;I'm working on a client memo explaining several approaches to equity hedging, and I'm looking for a not-too-technical term for a hedging strategy where I try to keep options near the money, as to have a quickly reacting hedge, expensive, but drastically reduced drawdown (hopefully).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, the opposite would simply be called tail-risk hedge, but what if I tighten the moneyness? I was thinking about core hedge, near-the-money hedge, continuously adjusted hedge, ...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously this is just a marketing buzzword, but is there some established word that will be understood by most? Also, clients are not too technical, so it may well be a fuzzy word, or not 100% accurate. &lt;/p&gt;&#xA;" OwnerUserId="1976" LastActivityDate="2014-07-24T17:35:08.863" Title="Opposite of Tail-Risk Hedge (Established Vocabulary)" Tags="&lt;hedging&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14126" PostTypeId="1" AcceptedAnswerId="14127" CreationDate="2014-07-22T15:35:34.203" Score="4" ViewCount="391" Body="&lt;p&gt;In order to generate normal random numbers, one usually generates random numbers following a uniform distribution $Z \sim \mathcal{U}(0,1)$ and then applies the reverse CDF function on them $X=\Phi^{-1}(Z) \sim \mathcal{N}(0,1)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I encountered a problematic case when one of the generated $Z$ turns out to give exactly 0. Then, you have $X=\Phi^{-1}(Z)=- \infty$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is pretty problematic when you generated random samples because it will usually break all your variance/covariance measure basically returning &lt;code&gt;nan&lt;/code&gt; or &lt;code&gt;inf&lt;/code&gt; when the samples contain infinite number.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do you usually handle this? Do you check after each generated random number whether the value is 0 or 1 and shift it slightly (or simply dicard it)?&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2014-07-22T15:41:26.780" LastActivityDate="2014-07-28T09:37:56.270" Title="How to deal with extreme cases in normal random numbers generation?" Tags="&lt;monte-carlo&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14127" PostTypeId="2" ParentId="14126" CreationDate="2014-07-22T15:57:45.843" Score="2" Body="&lt;p&gt;Indeed for computational purposes, best you can do is use a uniform distribution on another interval $[10^{-10},1-10^{-10}]$, or just discard all occurences of $Z=0,1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Discarding $Z=0,1$ is justified, since for continuous distributions $P(Z=0)=P(Z=1)=0$.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-07-22T15:57:45.843" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14128" PostTypeId="2" ParentId="12971" CreationDate="2014-07-22T16:20:36.170" Score="2" Body="&lt;p&gt;I would like to note one consequence of negative riskfree rate:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When the riskfree rate becomes more negative, the &lt;strong&gt;&lt;em&gt;Market Portfolio&lt;/em&gt;&lt;/strong&gt; (red) converges to the &lt;strong&gt;&lt;em&gt;Global Minimum Variance Portfolio&lt;/em&gt;&lt;/strong&gt; (blue).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Market Portfolio does never equal the GMV Portfolio though, since the slope is infinite.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/kaFyE.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-07-22T16:20:36.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14129" PostTypeId="2" ParentId="14125" CreationDate="2014-07-22T17:36:48.783" Score="1" Body="&lt;p&gt;If you are already long the stock, the way to hedge that risk is to go long a put and short a call, or what we call a option collar.  This is also know as a &quot;hedge wrapper&quot; if you are trying to go for the marketing buzzword.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Per Investopedia:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The purchase of an out-of-the money put option is what protects the underlying shares from a large downward move and locks in the profit. The price paid to buy the puts is lowered by amount of premium that is collect by selling the out of the money call. The ultimate goal of this position is that the underlying stock continues to rise until the written strike is reached.&lt;/p&gt;&#xA;" OwnerUserId="9374" LastActivityDate="2014-07-22T17:36:48.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14130" PostTypeId="2" ParentId="14126" CreationDate="2014-07-22T17:54:57.903" Score="2" Body="&lt;p&gt;I agree with @encor that it isn't an issue to include some logic to avoid errors. I imagine that most non-uniform random number generators already include that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't think I've used a pseudo-random number generator that's given a 0. I'm not an expert on the topic, but a common implementation (linear congruential generator) relies on modular arithmetic. For instance, the generator $X_{n+1}=f(X_{n})mod\: m$ might produce numbers between 0 and $m-1$ where $m$ is some big number. You could then divide by $m$ and ensure all the numbers are between 0 and 1. The only way that you should get a zero is if $f(X_{n})$ equals $m$. If $m$ is large enough (and most seem to be using $2^{31}$ or $2^{32}$), then that should be very rare.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only other thing I could think of was an issue with types. For instance, you might need an unsigned int or long to generate the random integers. The division to get between 0 and 1 suggests a float or double type. It might be rounding things down to 0 instead of 0.xxx1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're not happy with the above, there are other techniques for sampling distributions. For instance, you can represent the distribution as a grid as in Meucci's Fully Flexible Extreme Views (though without the Entropy Pooling part of it). You can then use linear interpolation as he describes to simulate from the grid distribution.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2014-07-22T17:54:57.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14131" PostTypeId="2" ParentId="14126" CreationDate="2014-07-22T18:01:10.517" Score="2" Body="&lt;p&gt;This depends on your method to generate the normal random numbers. The problem with normal cdf is that the direct inverse $\phi^{-1}(Z)$ is hard to solve for directly. There are some other methods to generate $N(\mu, \sigma^2)$ from $U(0,1)$. Two notable methods are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform&quot; rel=&quot;nofollow&quot;&gt;Box-Muller method&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Marsaglia_polar_method&quot; rel=&quot;nofollow&quot;&gt;Marsaglia polar method&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For most purposes you can use the above methods but you need to ensure the uniform random numbers are good. You will not get the problem of $-\inf$ or $\inf$. I prefer Box-Muller since I don't have to discard any generated numbers. &lt;/p&gt;&#xA;" OwnerUserId="6675" LastActivityDate="2014-07-22T18:01:10.517" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14132" PostTypeId="1" AcceptedAnswerId="14139" CreationDate="2014-07-22T19:13:17.957" Score="2" ViewCount="753" Body="&lt;p&gt;I know the &quot;classical&quot; modern portfolio theory. However I have quite a lot of different sources. It seems that there is not a book which cover this topic in a rigorous way:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;theory&lt;/li&gt;&#xA;&lt;li&gt;application&lt;/li&gt;&#xA;&lt;li&gt;examples in c++ / R / matlab / ...&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Are there any books, which cover these points? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recently, we discussed in class a dynamic portfolio optimization problem. Now I would like to know if there is any good literature about this topic? With dynamic portfolio optimization I mean changing constraints over time. Many thanks for sharing your experiences. &lt;/p&gt;&#xA;" OwnerUserId="17133" LastActivityDate="2014-07-23T07:42:27.390" Title="reference question about portfolio optimization" Tags="&lt;modern-portfolio-theory&gt;&lt;reference-request&gt;&lt;portfolio-optimization&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14135" PostTypeId="1" AcceptedAnswerId="15615" CreationDate="2014-07-22T23:02:08.917" Score="4" ViewCount="1493" Body="&lt;p&gt;Could somebody tell me whether suggestions in bold true or not?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q # 1:&lt;/strong&gt; &lt;a href=&quot;http://www.math.nyu.edu/faculty/avellane/AvellanedaLeeStatArb071108.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.math.nyu.edu/faculty/avellane/AvellanedaLeeStatArb071108.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Chapter 2.2 Interpretation of the eigenvectors/eigenportfolios&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This paper says that &lt;strong&gt;loadings in the maximal eigenvector need to be all positive&lt;/strong&gt; and should not change sign, what if i have negative ones, can i force them to be positive always by simply taking them by module, e.g. MathAbs(Vector) ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q # 2 :&lt;/strong&gt; The same paper also defines weights for eigenportfolio in this way :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Q[i] = EigVecCoef[i] / StdDev[i] // Page # 10 paragraph 2.2 in the doc above&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is also another paper that says that eigenvector is an angle (or direction) of the portfolio's spread which allows to map current portfolio's spread to initial axes (dimensions) :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://georgemdallas.wordpress.com/2013/10/30/principal-component-analysis-4-dummies-eigenvectors-eigenvalues-and-dimension-reduction/&quot; rel=&quot;nofollow&quot;&gt;http://georgemdallas.wordpress.com/2013/10/30/principal-component-analysis-4-dummies-eigenvectors-eigenvalues-and-dimension-reduction/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So i do not understand - &lt;strong&gt;why do i need to divide each value in eigenvector by standard deviation to calculate weights&lt;/strong&gt; if this portfolio is already mapped to initial axes?&lt;/p&gt;&#xA;" OwnerUserId="6855" LastEditorUserId="6855" LastEditDate="2014-11-24T14:38:37.397" LastActivityDate="2014-11-25T00:46:58.143" Title="Some clarifications on eigenvectors and eigenvalues from PCA" Tags="&lt;pca&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14136" PostTypeId="2" ParentId="4438" CreationDate="2014-07-23T05:15:45.477" Score="2" Body="&lt;p&gt;It is not uncommon to find significant differences in historical price data from different sources &amp;amp; data vendors. For example, if you look at ETF ticker symbol &quot;EEM&quot; for the period from 2001 until now using free Yahoo data and free Google data from the Internet, you will see that for some of this period they agree and for some of the time they are quite different. When using historical data, the problem is: How do you actually &quot;know&quot; that one series is &quot;accurate&quot;? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a practical trading perspective, some suggestions are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Be wary of free data. If you are a serious trader, it is probably in your best interests to buy data from a reliable data vendor who has checked it for errors and cleaned it up properly at the original time. This is especially important if you are looking at continuous futures contract data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Rather than trying to merge two different versions of the same data series when they disagree (and therefore AT LEAST one of them is probably wrong), you may be better off analyzing them separately and then see what are the resulting differences in your trading signals from the two sets.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) There is no point contaminating good data with bad data. If you really do know that one data set is good, then use it as it is. &quot;Less data but good data&quot; is better than &quot;More data including some bad data&quot;, especially if you are intending to use some form of predictive algorithm.  &lt;/p&gt;&#xA;" OwnerUserId="11579" LastActivityDate="2014-07-23T05:15:45.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14137" PostTypeId="2" ParentId="4438" CreationDate="2014-07-23T06:36:14.350" Score="0" Body="&lt;p&gt;To take into account lag-like discrepancies between two time series, DTW(Dynamic Time Warping) algorithm is generally used.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quoting from wiki - &#xA;&quot;In general, DTW is a method that calculates an optimal match between two given sequences (e.g. time series) with certain restrictions. The sequences are &quot;warped&quot; non-linearly in the time dimension to determine a measure of their similarity independent of certain non-linear variations in the time dimension.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The catch here is that the algorithm can become intractable for a large input, so it is generally run on a distributed system.&lt;/p&gt;&#xA;" OwnerUserId="11626" LastActivityDate="2014-07-23T06:36:14.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14138" PostTypeId="2" ParentId="11357" CreationDate="2014-07-23T06:49:39.470" Score="2" Body="&lt;p&gt;In addition to FX currency cross rates and interest rates, several other potentially useful inputs are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Economic data (GDP, inflation rates, employment figures) for the specific countries whose currencies you are interested in. While these data may be useful indicators, there are however two problems: Firstly the granularity of the data. If you are using EOD or intra-day FX data then ideally you would like the other inputs to your NN to be on a similar timescale and these are not. The second problem is that government statistics are often subject to &quot;adjustment&quot; some time after issue. Notwithstanding these caveats, such economic data may be useful with regard to long-term trends.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) FX rates are relative values of one fiat currency against another without any absolute scale of &quot;true&quot; value. It is useful to also include as input &quot;hard&quot; asset price series such as precious and base metals and energy. These help to provide at least some form of absolute reference. For example a rising price of gold (denominated in USD) can alternatively be viewed as a decline in the value of the USD vs. hard assets.          &lt;/p&gt;&#xA;" OwnerUserId="11579" LastActivityDate="2014-07-23T06:49:39.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14139" PostTypeId="2" ParentId="14132" CreationDate="2014-07-23T07:27:35.930" Score="5" Body="&lt;p&gt;There are plenty of books on portfolio issues built according to formula &quot;some theory + some R code (or Matlab, or S - which is very similar to R)&quot;. See for example &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Pfaff B. Financial Risk Modelling and Portfolio Optimization with R.// 2013. &lt;/li&gt;&#xA;&lt;li&gt;Best M.J. Portfolio Optimization. Chapman &amp;amp; Hall, 2010.&lt;/li&gt;&#xA;&lt;li&gt;Würtz D. et al. Portfolio Optimization with R/Rmetrics. // Rmetrics, 2009. &lt;/li&gt;&#xA;&lt;li&gt;Sherer B, Martin R.D. Introduction to Modern Portfolio Optimization With NUOPT and S-PLUS. // 2006. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;[1] is with examples from many R packages, and covers not only MPT but risk issues and MPT+ things like Black-Litterman and Meucci's approaches. [2] is based on Matlab examples, have very comprehensive optimization basics, and is more like quant-student-oriented book (unlike [1] which is more quant-PhD-advanced-portfolio-managers-oriented). [3] is entirely dedicated to Rmetrics R packages for optimizatioin, with some very basic theory. More like introductory thing, suitable for everyone from for bachelor student to somebody looking for a good coding-oriented start in the field. [4] is the oldest book, based on S, but all examples are easily translatable to R. Hence, no packages are introduced + the reader is supposed to be able to cope with some difficulties when translating from S to R. But still there are a few interesting advanced things in the book. &lt;/p&gt;&#xA;" OwnerUserId="6535" LastEditorUserId="6535" LastEditDate="2014-07-23T07:42:27.390" LastActivityDate="2014-07-23T07:42:27.390" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14140" PostTypeId="2" ParentId="14110" CreationDate="2014-07-23T10:06:55.050" Score="1" Body="&lt;p&gt;You have to use stochastic dynamic programming methods, and the &lt;a href=&quot;http://en.wikipedia.org/wiki/Bellman_equation&quot; rel=&quot;nofollow&quot;&gt;Bellman equation&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's not very different to price an American Option with Longstaff-Schwartz, except that your state variable is not just exercised/not exercised, but a continuous one in order to take into account the consumed volume.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Longstaff-Schwartz you have to do a regression in the asset price, but here you have to do it on a functional space of the prices and volumes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may find &lt;a href=&quot;https://docs.google.com/file/d/0B-UOcp6zYNpYaDRFMEw5VFNvMTg/edit&quot; rel=&quot;nofollow&quot;&gt;this document&lt;/a&gt; useful.&lt;/p&gt;&#xA;" OwnerUserId="6356" LastEditorUserId="467" LastEditDate="2014-07-23T10:53:56.370" LastActivityDate="2014-07-23T10:53:56.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14141" PostTypeId="2" ParentId="9730" CreationDate="2014-07-23T10:27:50.480" Score="2" Body="&lt;p&gt;You will find that the level of success you have using Neural Networks (NN) as a tool for financial market prediction is strongly dependent on what initially appear to be some quite subtle factors. In particular:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Input data: You mention using &quot;certain technical indicators&quot;. I assume that you mean the standard TA set of price-based indicators such as Moving Averages, MACD, RSI, CCI, Stochastic oscillator, Williams %R, etc, and probably also some indicators related to trading volume. You will find that your NN results will be sensitive to the look-back periods that you use for each of these indicators and you will need to do some extensive experimentation with this, as well as normalizations and transforms of the indicators that you choose.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Output / Training data: Your output(s) from the NN can be either continuous-valued or discrete, e.g. binary {0,1} or ternary {-1,0,+1}. It is up to you to choose what type of output you want and this depends entirely on the question that you are attempting to answer (i.e. exactly what you are trying to predict) with the aid of the NN. You will find that NNs can be very sensitive to this. For example, from the human trader's perspective, the following questions may not seem very different but from the NN's perspective they are quite different:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) How much will stock XYZ or the overall market rise (in points or in %) between today's close and tomorrow's close? (Continuous-valued output required).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) During the same period, will stock XYZ rise by more than 3.5%? YES=1 or NO=0 (binary output)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Will stock XYZ rise significantly (output = +1), fall significantly (output = -1) or, within some tolerance, stay about the same (output = 0)?   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) Is tomorrow's (or today's ?) price likely to be the highest / lowest for the next week? (binary output)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5) If I buy today, should I close my position on Friday or hold over the weekend? (binary output, based on your studies of profitability, drawdown, &amp;amp; other trading metrics).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have less success than you hoped for with your NN, then try asking a slightly different question. Also remember that sometimes even a small &quot;only-slightly-better-than-random&quot; result may still be enough to give you a useful edge in trading. &lt;/p&gt;&#xA;" OwnerUserId="11579" LastActivityDate="2014-07-23T10:27:50.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14143" PostTypeId="1" CreationDate="2014-07-23T15:38:32.730" Score="1" ViewCount="1355" Body="&lt;p&gt;I have a dataset of options &lt;strong&gt;(traded in European exchanges such as NYSE Euronext)&lt;/strong&gt; and I would like to find their price history. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where to find it? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see that &lt;code&gt;optionmetrics&lt;/code&gt; does it but I do not have access to it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have &lt;code&gt;bloomberg&lt;/code&gt; available.  Is it enough/reliable? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By enough I mean that Bloomberg covers the main Index and Stock options in Europe, and by reliable I mean that Bloomberg prices are based on real trades and/or bid asks from large market makers.&lt;/p&gt;&#xA;" OwnerUserId="6486" LastEditorUserId="743" LastEditDate="2014-07-23T15:46:30.677" LastActivityDate="2014-07-23T15:46:30.677" Title="where to find historical option prices?" Tags="&lt;options&gt;&lt;historical-data&gt;&lt;bloomberg&gt;&lt;optionmetrics&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14144" PostTypeId="1" CreationDate="2014-07-23T18:07:56.667" Score="5" ViewCount="3594" Body="&lt;p&gt;I am simulating various price path of bonds, and one issue that came up is the recovery rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When a bond defaults, the amount you get back recovery rate * principle. This creates a problem if the current bond price is less than the recovery rate.&#xA;For example,  a 1% coupon, 30 year bond with a yield of 7% should be priced at 0.18, assuming that face value is 1.&#xA;Usually corporate bond have a recovery rate around 40%.  This means that in the beginning the bond holder will actually want the bond to default, because then they can collect a large fraction of the principle much earlier than expected. This totally messes up pricing models as now default probability is actually a favored pricing factor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One solution is to assume that you actually loss recovery rate * current market value. This sort of takes care of the time value of money issue, but leads to even bigger problems:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a realistic model, bond rating changes according to the transition matrix, as a result, the yield on the bond also changes. Sometimes, a bond can fall into a really bad rating but not defaulting, like CCC or D. In these situations, the spread gets ridiculously high, like something around 50% - 200%. If you use this spread to calculate the price, you will see that the bond holder will be better off if the bond actually defaulted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So a natural solution to this problem is to capped all losses by the recovery rate. So if the price of bond is less than the recovery rate, then the price of the bond is the recovery rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But again this only solves part of the problem. After a bond falls to a very bad rating, it will almost certainly default within the next few years. Since earlier we defined  the loss given default as market value * (1 - recovery rate), the bond will suffer another loss. Essentially we have made the bond suffer through default twice. In other words, given two bonds, if one defaults directly, where as the other fought hard and stayed at CCC rating before defaulting, the second one will be actually worse off. This contradicts common sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In essence, I am trying to come up with a method that satisfy the following properties&#xA;1. Bond holder should not gain from defaults&#xA;2. Assuming all else equal, a bond that defaults later provides higher gain than a bond that defaults earlier.&lt;/p&gt;&#xA;" OwnerUserId="7467" LastActivityDate="2014-07-24T00:21:50.393" Title="What happens when bond price is less than the recovery rate" Tags="&lt;bond&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14145" PostTypeId="1" CreationDate="2014-07-23T20:45:05.673" Score="1" ViewCount="289" Body="&lt;p&gt;Let assume that we have one month of tick data which were traded at NYSE. We want to model the price changes as a function of the last p lags of price changes and the last q lags of the  time duration between trades ( this is similar to the GARMA(p,q) model). Each day we use the data from 9:30 until 16:00. My question is: in order to analyze the data should I analyze each day separately?&lt;/p&gt;&#xA;" OwnerUserId="11629" LastActivityDate="2014-08-28T18:18:51.243" Title="Should I analyze the tick data day by day?" Tags="&lt;time-series&gt;&lt;tick-data&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14146" PostTypeId="2" ParentId="14144" CreationDate="2014-07-23T21:05:25.833" Score="3" Body="&lt;p&gt;I think the problem here is that the recovery rate is not a fixed parameter, it is only estimated from past defaults. You never know what the actual recovery rate will be, so markets change their view all the time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your estimated recovery rate is higher than the bond price, you can either assume that the bond is underpriced, or your estimated recovery rate is overpriced and should hence be adjusted downwards.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-07-23T21:05:25.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14147" PostTypeId="2" ParentId="14144" CreationDate="2014-07-23T22:11:35.430" Score="5" Body="&lt;p&gt;To add to emcor's answer, if a bond defaults, you do not automatically get the &quot;recovery&quot; amount immediately, you get some unknown amount at some unknown time in the future, possibly years later, and greatly depending on your particular bond's covenants and seniority.  If you are trying to consistently price bonds, you might be better off implying the recovery rate(s) from the CDS term structure, other bonds and equity options or some such.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Certainly, one should do neither of your solutions, since they likely permit arbitrage into your model.&lt;/p&gt;&#xA;" OwnerUserId="3491" LastActivityDate="2014-07-23T22:11:35.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14148" PostTypeId="2" ParentId="14144" CreationDate="2014-07-23T22:16:19.993" Score="1" Body="&lt;p&gt;Emcor makes a good point. I would add that if a bond defaults, that recovery rate is only guaranteed at maturity to my knowledge. So assuming you are sure that it will be respected and paid in due time (Argentina is a good example of things happening otherwisw), you should discount that terminal value at the risk free rate or any appropriate discount factor, which most likely will decrease the number of paths with issues.&lt;/p&gt;&#xA;" OwnerUserId="11540" LastActivityDate="2014-07-23T22:16:19.993" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14149" PostTypeId="2" ParentId="14144" CreationDate="2014-07-24T00:21:50.393" Score="2" Body="&lt;p&gt;Your premises are wrong in the real world: 1. Bond holder should not gain from defaults 2. Assuming all else equal, a bond that defaults later provides higher gain than a bond that defaults earlier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) There are &quot;vulture investors&quot; who buy defaulted bonds at an ultra low price for the purpose of forcing a restructuring at a higher price. 2) While this is theoretically true, the same vulture investors will do their best to make sure that the higher gains occur earlier.&lt;/p&gt;&#xA;" OwnerUserId="2345" LastActivityDate="2014-07-24T00:21:50.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14150" PostTypeId="1" AcceptedAnswerId="14151" CreationDate="2014-07-24T07:49:29.413" Score="6" ViewCount="991" Body="&lt;p&gt;I'm in the process of building a quantitative trading model, I want to improve on the way in which I decide upon a look back length for the indicators. I understand the different pros/cons for very short and very long look backs, but rather I want to assess what the optimal length is between say 20-days, 30-days, or in between. I feel the choice of 20 or 30 is done without thinking to much and just because it is round, which seems lazy to me. Is there a better method?&lt;/p&gt;&#xA;" OwnerUserId="11632" LastActivityDate="2014-07-24T11:22:50.193" Title="How to find optimal look back in quant trading models" Tags="&lt;quant-trading-strategies&gt;&lt;backtesting&gt;&lt;models&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14151" PostTypeId="2" ParentId="14150" CreationDate="2014-07-24T09:26:18.860" Score="6" Body="&lt;p&gt;I think you are having it backwards: Optimising your lookback period is a sure recipe for disaster because it introduces &lt;a href=&quot;http://en.wikipedia.org/wiki/Data_dredging&quot;&gt;data snooping bias&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To develop a robust trading strategy you have to check whether it is sufficiently stable &lt;em&gt;with different lookback periods&lt;/em&gt; (e.g. in a certain range). If results differ significantly that is a good sign that your system won't work out-of-sample!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I agree with you that many people do these things without thinking and are indeed lazy... this is one of the reasons why so many trading systems fail under real-world conditions.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2014-07-24T09:26:18.860" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14153" PostTypeId="1" CreationDate="2014-07-24T11:49:14.567" Score="1" ViewCount="273" Body="&lt;p&gt;There are two points that concern me&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Loans&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;If someone takes a loan of let's say 1000\$, he has to pay back the money with 5% interest, i. e. 1050\$. But where do the 50\$ come from? They didn't exist before!&#xA;In my understanding someone else has to get a loan of at least 50\$ in order to increase the sum of money. That's a vicious circle.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Balance with paid interest&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;If you deposit money, you get interest. The amount of your balances increases exponentially. With - again - 5% interest the function describing the current amount is:&#xA;f(t) = f&lt;sub&gt;0&lt;/sub&gt;*1.05^&lt;sup&gt;t&lt;/sup&gt;. t being the time, f&lt;sub&gt;0&lt;/sub&gt; being the balance at time t = 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/9qdQl.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Starting with 5000\$ after 50 years you have about 50,000\$ (little more than 3 duplications), without doing something for it, besides sitting on your money.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;These two points above doesn't look like principles you would apply to anything sustainable.&#xA;I don't see any equilibrium. So, is an economy where money yields interest able to be sustainable and healthy? If yes, how?&lt;/p&gt;&#xA;" OwnerUserId="11633" LastEditorUserId="11633" LastEditDate="2014-07-25T01:37:21.387" LastActivityDate="2014-07-25T01:37:21.387" Title="Is an economy where money yields interest able to be sustainable and healthy? If yes, how?" Tags="&lt;economics&gt;&lt;interest&gt;" AnswerCount="3" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="14154" PostTypeId="2" ParentId="14153" CreationDate="2014-07-24T12:30:32.270" Score="1" Body="&lt;p&gt;The interest does not necessarily come from another loan. The ECB is paying interest to banks which is essentially to create (&quot;print&quot;) new money. It is a fact, that the money supply is constantly growing over time, which in a simple model would just equal the interest paid out on loans.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That does not necessarily have something to do with the economy being sustainable or not though, as the tapering of the money supply usually leads to inflation, so the interest income in your graph gets offset by higher prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my opinion, the interest level is just some overall equilibrium, which is but unrelated to the real economy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If more money/interest is issued, there can be two cases: a) Productivity increased, then there is more resources and money, so prices stay same, thats real growth. b) Productivity did not increase, then you have more money for same/less resources, so resource prices inflate. In this case, money grows, but prices grow with it, so having more money gives no additional real resources. Over time, you may have increasing money and productivity, but when productivity reaches its limit, the additional money then just causes more inflation on the same (nongrowing) resources.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So real growth and nominal interest are independent, as they get balanced by inflation.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-07-24T15:35:29.057" LastActivityDate="2014-07-24T15:35:29.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14155" PostTypeId="2" ParentId="14153" CreationDate="2014-07-24T13:13:30.137" Score="1" Body="&lt;p&gt;I think that you have to distinguish between a 'fiat' (modern) monetary system and a 'gold standard' one. But sustainability will always be ensured endogenously, one way or another.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fiat money is created whenever a loan is made, and the \$50 you describe will be created endogenously in the economy. Advocates would call it a virtous rather than a vicious circle, as you (or someone else) would use the \$1000 for a productive purpose that generates growth. In addition, inflation which is present in fiat systems, will erode part of the value over 50 years. Overall the system is sustainable as new 'money' enters the system directly or indirectly. But to understand the fiat system you should look at it in a more holistic way, rather than one transaction at a time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under fixed money supply like a 'gold standard' things are different. But, as far as I know, for the centuries that we were under gold standard interest rates followed the mining of gold and the relative debasement of coin by the monarchs. There is also no persistent long run inflation (there has been a comparison of the wages of a US Army Private/ Roman Legionary and US Army Captain/ Roman Centurion: measured in gold oz, their compensation was broadly the same). On the other hand, defaults and panics were more severe. Therefore sustainability is ensured --to the expense of high volatility, as episodes of inflation are followed by deflation.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2014-07-24T13:13:30.137" CommentCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="14156" PostTypeId="1" CreationDate="2014-07-24T14:34:39.737" Score="3" ViewCount="411" Body="&lt;p&gt;I want to calculate option prices based on a realistic distribution of the underlying.&#xA;The underlying is a liquid index such as Eurostoxx50. &#xA;I think of two aproaches, both of them incorporate assumption of Markov Chains/independet returns:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) calcualate option prices by monte carlo simulation with historical returns&#xA;2) get option prices by montecarlo simulation, simulating returns with a random number generator based on a stochastic variance distribution, such as generalized hyperbolic distribution, that is fitted to historical index returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For both approaches I see the problem of how to deal with the vola of the underlying. I assume that in reality vola realisiations are not totally independent from past values. That means that extreme vola changes will occur with both simulation methods more often than in reality. Using the overall historical vola as an estimator for &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is your opinion? Assuming vola being totally random and applying a distribution parameter fit made by using the whole avaiable index history or rather fitting time windows of the index?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fot the latter I see the problem of how to estimate the whole set of parameters (up to 4)&#xA;when using only a small dataset (I think of using something like the historical one month vola, but one month of data isn't enough at all to fit a hyperbolic model nor to apply the historical returns itself to simulation).&#xA;Therefore I would need to scale the simulated returns by local historical vola.&#xA;Since none of the distribution parameters are directly related to the vola/standard deviation, I would use the following scaling method for simmulated returns:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;return scaled = simulated return * (sigma local historic vola) / (sigma calculated from fitted distribution parameters)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would that be ok or a &quot;no go&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, I didn't find any ready programmed estimators in Python or Scilab, that can fit any of the hyperbolic distributions or Heston like models to emprical returns.&#xA;Aren't there any? &#xA;And, I coudln't find any function, that calculates random numbers from the generalized hyperbolic distribution. Isn't there any? If not, how can it be derived from the densitiy function, using Python?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a huge bulk of questions,&#xA;I just emerged myself into those things and need some &quot;hints&quot; into which direction to go.&#xA;THanks a lot in advance.&lt;/p&gt;&#xA;" OwnerUserId="11635" LastActivityDate="2014-07-25T16:44:22.017" Title="Fitting stochastic variance distributions to index return data" Tags="&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;stochastic-volatility&gt;&lt;distribution&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14157" PostTypeId="2" ParentId="4886" CreationDate="2014-07-24T14:39:44.370" Score="6" Body="&#xA;&#xA;&lt;p&gt;Hello people.&#xA;This is quite a complex problem if you want to solve this in a computationally efficient way for a rolling window.&#xA;I have gone ahead and written a solution to this in C#.&#xA;I want to share this as the effort required to replicate this work is quite high.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, here are the results:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;here we take a simple drawdown implementation and re-calculate for the full window each time&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;test1 - simple drawdown test with 30 period rolling window. run 100 times.&#xA;total seconds 0.8060461&#xA;test2 - simple drawdown test with 60 period rolling window. run 100 times.&#xA;total seconds 1.416081&#xA;test3 - simple drawdown test with 180 period rolling window. run 100 times.&#xA;total seconds 3.6602093&#xA;test4 - simple drawdown test with 360 period rolling window. run 100 times.&#xA;total seconds 6.696383&#xA;test5 - simple drawdown test with 500 period rolling window. run 100 times.&#xA;total seconds 8.9815137&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;here we compare to the results generated from my efficient rolling window algorithm where only the latest observation is added and then it does it's magic&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;test6 - running drawdown test with 30 period rolling window. run 100 times.&#xA;total seconds 0.2940168&#xA;test7 - running drawdown test with 60 period rolling window. run 100 times.&#xA;total seconds 0.3050175&#xA;test8 - running drawdown test with 180 period rolling window. run 100 times.&#xA;total seconds 0.3780216&#xA;test9 - running drawdown test with 360 period rolling window. run 100 times.&#xA;total seconds 0.4560261&#xA;test10 - running drawdown test with 500 period rolling window. run 100 times.&#xA;total seconds 0.5050288&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;At at 500 period window. We are achieving about a 20:1 improvement in calculation time.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Here is the code of the simple drawdown class used for the comparisons:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;public class SimpleDrawDown&#xA;{&#xA;    public double Peak { get; set; }&#xA;    public double Trough { get; set; }&#xA;    public double MaxDrawDown { get; set; }&#xA;&#xA;    public SimpleDrawDown()&#xA;    {&#xA;        Peak = double.NegativeInfinity;&#xA;        Trough = double.PositiveInfinity;&#xA;        MaxDrawDown = 0;&#xA;    }&#xA;&#xA;    public void Calculate(double newValue)&#xA;    {&#xA;        if (newValue &amp;gt; Peak)&#xA;        {&#xA;            Peak = newValue;&#xA;            Trough = Peak;&#xA;        }&#xA;        else if (newValue &amp;lt; Trough)&#xA;        {&#xA;            Trough = newValue;&#xA;            var tmpDrawDown = Peak - Trough;&#xA;            if (tmpDrawDown &amp;gt; MaxDrawDown)&#xA;                MaxDrawDown = tmpDrawDown;&#xA;        }&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And here is the code for the full efficient implementation. Hopefully the code comments make sense.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;internal class DrawDown&#xA;{&#xA;    int _n;&#xA;    int _startIndex, _endIndex, _troughIndex;&#xA;    public int Count { get; set; }&#xA;    LinkedList&amp;lt;double&amp;gt; _values;&#xA;    public double Peak { get; set; }&#xA;    public double Trough { get; set; }&#xA;    public bool SkipMoveBackDoubleCalc { get; set; }&#xA;&#xA;    public int PeakIndex&#xA;    {&#xA;        get&#xA;        {&#xA;            return _startIndex;&#xA;        }&#xA;    }&#xA;    public int TroughIndex&#xA;    {&#xA;        get&#xA;        {&#xA;            return _troughIndex;&#xA;        }&#xA;    }&#xA;&#xA;    //peak to trough return&#xA;    public double DrawDownAmount&#xA;    {&#xA;        get&#xA;        {&#xA;            return Peak - Trough;&#xA;        }&#xA;    }&#xA;&#xA;    /// &amp;lt;summary&amp;gt;&#xA;    /// &#xA;    /// &amp;lt;/summary&amp;gt;&#xA;    /// &amp;lt;param name=&quot;n&quot;&amp;gt;max window for drawdown period&amp;lt;/param&amp;gt;&#xA;    /// &amp;lt;param name=&quot;peak&quot;&amp;gt;drawdown peak i.e. start value&amp;lt;/param&amp;gt;&#xA;    public DrawDown(int n, double peak)&#xA;    {&#xA;        _n = n - 1;&#xA;        _startIndex = _n;&#xA;        _endIndex = _n;&#xA;        _troughIndex = _n;&#xA;        Count = 1;&#xA;        _values = new LinkedList&amp;lt;double&amp;gt;();&#xA;        _values.AddLast(peak);&#xA;        Peak = peak;&#xA;        Trough = peak;&#xA;    }&#xA;&#xA;    /// &amp;lt;summary&amp;gt;&#xA;    /// adds a new observation on the drawdown curve&#xA;    /// &amp;lt;/summary&amp;gt;&#xA;    /// &amp;lt;param name=&quot;newValue&quot;&amp;gt;&amp;lt;/param&amp;gt;&#xA;    public void Add(double newValue)&#xA;    {&#xA;        //push the start of this drawdown backwards&#xA;        //_startIndex--;&#xA;        //the end of the drawdown is the current period end&#xA;        _endIndex = _n;&#xA;        //the total periods increases with a new observation&#xA;        Count++;&#xA;        //track what all point values are in the drawdown curve&#xA;        _values.AddLast(newValue);&#xA;        //update if we have a new trough&#xA;        if (newValue &amp;lt; Trough)&#xA;        {&#xA;            Trough = newValue;&#xA;            _troughIndex = _endIndex;&#xA;        }&#xA;    }&#xA;&#xA;    /// &amp;lt;summary&amp;gt;&#xA;    /// Shift this Drawdown backwards in the observation window&#xA;    /// &amp;lt;/summary&amp;gt;&#xA;    /// &amp;lt;param name=&quot;trackingNewPeak&quot;&amp;gt;whether we are already tracking a new peak or not&amp;lt;/param&amp;gt;&#xA;    /// &amp;lt;returns&amp;gt;a new drawdown to track if a new peak becomes active&amp;lt;/returns&amp;gt;&#xA;    public DrawDown MoveBack(bool trackingNewPeak, bool recomputeWindow = true)&#xA;    {&#xA;        if (!SkipMoveBackDoubleCalc)&#xA;        {&#xA;            _startIndex--;&#xA;            _endIndex--;&#xA;            _troughIndex--;&#xA;            if (recomputeWindow)&#xA;                return RecomputeDrawdownToWindowSize(trackingNewPeak);&#xA;        }&#xA;        else&#xA;            SkipMoveBackDoubleCalc = false;&#xA;&#xA;        return null;&#xA;    }&#xA;&#xA;    private DrawDown RecomputeDrawdownToWindowSize(bool trackingNewPeak)&#xA;    {&#xA;        //the start of this drawdown has fallen out of the start of our observation window, so we have to recalculate the peak of the drawdown&#xA;        if (_startIndex &amp;lt; 0)&#xA;        {&#xA;            Peak = double.NegativeInfinity;&#xA;            _values.RemoveFirst();&#xA;            Count--;&#xA;&#xA;            //there is the possibility now that there is a higher peak, within the current drawdown curve, than our first observation&#xA;            //when we find it, remove all data points prior to this point&#xA;            //the new peak must be before the current known trough point&#xA;            int iObservation = 0, iNewPeak = 0, iNewTrough = _troughIndex, iTmpNewPeak = 0, iTempTrough = 0;&#xA;            double newDrawDown = 0, tmpPeak = 0, tmpTrough = double.NegativeInfinity;&#xA;            DrawDown newDrawDownObj = null;&#xA;            foreach (var pointOnDrawDown in _values)&#xA;            {&#xA;                if (iObservation &amp;lt; _troughIndex)&#xA;                {&#xA;                    if (pointOnDrawDown &amp;gt; Peak)&#xA;                    {&#xA;                        iNewPeak = iObservation;&#xA;                        Peak = pointOnDrawDown;&#xA;                    }&#xA;                }&#xA;                else if (iObservation == _troughIndex)&#xA;                {&#xA;                    newDrawDown = Peak - Trough;&#xA;                    tmpPeak = Peak;&#xA;                }&#xA;                else&#xA;                {&#xA;                    //now continue on through the remaining points, to determine if there is a nested-drawdown, that is now larger than the newDrawDown&#xA;                    //e.g. higher peak beyond _troughIndex, with higher trough than that at _troughIndex, but where new peak minus new trough is &amp;gt; newDrawDown&#xA;                    if (pointOnDrawDown &amp;gt; tmpPeak)&#xA;                    {&#xA;                        tmpPeak = pointOnDrawDown;&#xA;                        tmpTrough = tmpPeak;&#xA;                        iTmpNewPeak = iObservation;&#xA;                        //we need a new drawdown object, as we have a new higher peak&#xA;                        if (!trackingNewPeak) &#xA;                            newDrawDownObj = new DrawDown(_n + 1, tmpPeak);&#xA;                    }&#xA;                    else&#xA;                    {&#xA;                        if (!trackingNewPeak &amp;amp;&amp;amp; newDrawDownObj != null)&#xA;                        {&#xA;                            newDrawDownObj.MoveBack(true, false); //recomputeWindow is irrelevant for this as it will never fall before period 0 in this usage scenario&#xA;                            newDrawDownObj.Add(pointOnDrawDown);  //keep tracking this new drawdown peak&#xA;                        }&#xA;&#xA;                        if (pointOnDrawDown &amp;lt; tmpTrough)&#xA;                        {&#xA;                            tmpTrough = pointOnDrawDown;&#xA;                            iTempTrough = iObservation;&#xA;                            var tmpDrawDown = tmpPeak - tmpTrough;&#xA;&#xA;                            if (tmpDrawDown &amp;gt; newDrawDown)&#xA;                            {&#xA;                                newDrawDown = tmpDrawDown;&#xA;                                iNewPeak = iTmpNewPeak;&#xA;                                iNewTrough = iTempTrough;&#xA;                                Peak = tmpPeak;&#xA;                                Trough = tmpTrough;&#xA;                            }&#xA;                        }&#xA;                    }&#xA;                }&#xA;                iObservation++;&#xA;            }&#xA;&#xA;            _startIndex = iNewPeak; //our drawdown now starts from here in our observation window&#xA;            _troughIndex = iNewTrough;&#xA;            for (int i = 0; i &amp;lt; _startIndex; i++)&#xA;            {&#xA;                _values.RemoveFirst(); //get rid of the data points prior to this new drawdown peak&#xA;                Count--;&#xA;            }&#xA;            return newDrawDownObj;&#xA;        }&#xA;        return null;&#xA;    }&#xA;&#xA;}&#xA;&#xA;public class RunningDrawDown&#xA;{&#xA;&#xA;    int _n;&#xA;    List&amp;lt;DrawDown&amp;gt; _drawdownObjs;&#xA;    DrawDown _currentDrawDown;&#xA;    DrawDown _maxDrawDownObj;&#xA;&#xA;    /// &amp;lt;summary&amp;gt;&#xA;    /// The Peak of the MaxDrawDown&#xA;    /// &amp;lt;/summary&amp;gt;&#xA;    public double DrawDownPeak&#xA;    {&#xA;        get&#xA;        {&#xA;            if (_maxDrawDownObj == null) return double.NegativeInfinity;&#xA;            return _maxDrawDownObj.Peak;&#xA;        }&#xA;    }&#xA;    /// &amp;lt;summary&amp;gt;&#xA;    /// The Trough of the Max DrawDown&#xA;    /// &amp;lt;/summary&amp;gt;&#xA;    public double DrawDownTrough&#xA;    {&#xA;        get&#xA;        {&#xA;            if (_maxDrawDownObj == null) return double.PositiveInfinity;&#xA;            return _maxDrawDownObj.Trough;&#xA;        }&#xA;    }&#xA;    /// &amp;lt;summary&amp;gt;&#xA;    /// The Size of the DrawDown - Peak to Trough&#xA;    /// &amp;lt;/summary&amp;gt;&#xA;    public double DrawDown&#xA;    {&#xA;        get&#xA;        {&#xA;            if (_maxDrawDownObj == null) return 0;&#xA;            return _maxDrawDownObj.DrawDownAmount;&#xA;        }&#xA;    }&#xA;    /// &amp;lt;summary&amp;gt;&#xA;    /// The Index into the Window that the Peak of the DrawDown is seen&#xA;    /// &amp;lt;/summary&amp;gt;&#xA;    public int PeakIndex&#xA;    {&#xA;        get&#xA;        {&#xA;            if (_maxDrawDownObj == null) return 0;&#xA;            return _maxDrawDownObj.PeakIndex;&#xA;        }&#xA;    }&#xA;    /// &amp;lt;summary&amp;gt;&#xA;    /// The Index into the Window that the Trough of the DrawDown is seen&#xA;    /// &amp;lt;/summary&amp;gt;&#xA;    public int TroughIndex&#xA;    {&#xA;        get&#xA;        {&#xA;            if (_maxDrawDownObj == null) return 0;&#xA;            return _maxDrawDownObj.TroughIndex;&#xA;        }&#xA;    }&#xA;&#xA;    /// &amp;lt;summary&amp;gt;&#xA;    /// Creates a running window for the calculation of MaxDrawDown within the window&#xA;    /// &amp;lt;/summary&amp;gt;&#xA;    /// &amp;lt;param name=&quot;n&quot;&amp;gt;the number of periods within the window&amp;lt;/param&amp;gt;&#xA;    public RunningDrawDown(int n)&#xA;    {&#xA;        _n = n;&#xA;        _currentDrawDown = null;&#xA;        _drawdownObjs = new List&amp;lt;DrawDown&amp;gt;();&#xA;    }&#xA;&#xA;    /// &amp;lt;summary&amp;gt;&#xA;    /// The new value to add onto the end of the current window (the first value will drop off)&#xA;    /// &amp;lt;/summary&amp;gt;&#xA;    /// &amp;lt;param name=&quot;newValue&quot;&amp;gt;the new point on the curve&amp;lt;/param&amp;gt;&#xA;    public void Calculate(double newValue)&#xA;    {&#xA;        if (double.IsNaN(newValue)) return;&#xA;&#xA;        if (_currentDrawDown == null)&#xA;        {&#xA;            var drawDown = new DrawDown(_n, newValue);&#xA;            _currentDrawDown = drawDown;&#xA;            _maxDrawDownObj = drawDown;&#xA;        }&#xA;        else&#xA;        {&#xA;            //shift current drawdown back one. and if the first observation falling outside the window means we encounter a new peak after the current trough, we start tracking a new drawdown&#xA;            var drawDownFromNewPeak = _currentDrawDown.MoveBack(false);&#xA;&#xA;            //this is a special case, where a new lower peak (now the highest) is created due to the drop of of the pre-existing highest peak, and we are not yet tracking a new peak&#xA;            if (drawDownFromNewPeak != null)&#xA;            {&#xA;                _drawdownObjs.Add(_currentDrawDown); //record this drawdown into our running drawdowns list)&#xA;                _currentDrawDown.SkipMoveBackDoubleCalc = true; //MoveBack() is calculated again below in _drawdownObjs collection, so we make sure that is skipped this first time&#xA;                _currentDrawDown = drawDownFromNewPeak;&#xA;                _currentDrawDown.MoveBack(true);&#xA;            }&#xA;&#xA;            if (newValue &amp;gt; _currentDrawDown.Peak)&#xA;            {&#xA;                //we need a new drawdown object, as we have a new higher peak&#xA;                var drawDown = new DrawDown(_n, newValue);&#xA;                //do we have an existing drawdown object, and does it have more than 1 observation&#xA;                if (_currentDrawDown.Count &amp;gt; 1)&#xA;                {&#xA;                    _drawdownObjs.Add(_currentDrawDown); //record this drawdown into our running drawdowns list)&#xA;                    _currentDrawDown.SkipMoveBackDoubleCalc = true; //MoveBack() is calculated again below in _drawdownObjs collection, so we make sure that is skipped this first time&#xA;                }&#xA;                _currentDrawDown = drawDown;&#xA;            }&#xA;            else&#xA;            {&#xA;                //add the new observation to the current drawdown&#xA;                _currentDrawDown.Add(newValue);&#xA;            }&#xA;        }&#xA;&#xA;        //does our new drawdown surpass any of the previous drawdowns?&#xA;        //if so, we can drop the old drawdowns, as for the remainer of the old drawdowns lives in our lookup window, they will be smaller than the new one&#xA;        var newDrawDown = _currentDrawDown.DrawDownAmount;&#xA;        _maxDrawDownObj = _currentDrawDown;&#xA;        var maxDrawDown = newDrawDown;&#xA;        var keepDrawDownsList = new List&amp;lt;DrawDown&amp;gt;();&#xA;        foreach (var drawDownObj in _drawdownObjs)&#xA;        {&#xA;            drawDownObj.MoveBack(true);&#xA;            if (drawDownObj.DrawDownAmount &amp;gt; newDrawDown)&#xA;            {&#xA;                keepDrawDownsList.Add(drawDownObj);&#xA;            }&#xA;&#xA;            //also calculate our max drawdown here&#xA;            if (drawDownObj.DrawDownAmount &amp;gt; maxDrawDown)&#xA;            {&#xA;                maxDrawDown = drawDownObj.DrawDownAmount;&#xA;                _maxDrawDownObj = drawDownObj;&#xA;            }&#xA;&#xA;        }&#xA;        _drawdownObjs = keepDrawDownsList;&#xA;&#xA;    }&#xA;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Example usage:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;RunningDrawDown rd = new RunningDrawDown(500);&#xA;foreach (var input in data)&#xA;{&#xA;    rd.Calculate(input);&#xA;    Console.WriteLine(string.Format(&quot;max draw {0:0.00000}, peak {1:0.00000}, trough {2:0.00000}, drawstart {3:0.00000}, drawend {4:0.00000}&quot;,&#xA;        rd.DrawDown, rd.DrawDownPeak, rd.DrawDownTrough, rd.PeakIndex, rd.TroughIndex));&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11638" LastActivityDate="2014-07-24T14:39:44.370" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14158" PostTypeId="1" AcceptedAnswerId="14159" CreationDate="2014-07-24T16:04:51.280" Score="1" ViewCount="176" Body="&lt;p&gt;I'm looking at the list of companies in the &lt;a href=&quot;http://us.spindices.com/indices/equity/sp-500-pure-value&quot; rel=&quot;nofollow&quot;&gt;S&amp;amp;P 500 Pure Value Index&lt;/a&gt;. For each firm, I want to obtain the dividend yield industry percentile rank and the PEG ratio industry percentile rank.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried Google Finance and Morningstar. The process involves adding by hand specific industry stocks to a portfolio, exporting the data to excel, using percentrank.exc() and vlookup()... Doing this for 100+ stocks in 100+ industries is error prone and can take days.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a faster, more accurate way of obtaining industry rank based on financial data? Does Bloomberg have this functionality?&lt;/p&gt;&#xA;" OwnerUserId="11637" LastActivityDate="2014-07-24T16:45:55.237" Title="Company rank within an industry" Tags="&lt;equities&gt;&lt;data&gt;&lt;market-data&gt;&lt;finance&gt;&lt;historical-data&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14159" PostTypeId="2" ParentId="14158" CreationDate="2014-07-24T16:39:37.333" Score="1" Body="&lt;p&gt;You may get the S&amp;amp;P500 tickers and download the corresponding fields PEG, DivYield, Industry from Bloomberg into Excel.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you can just sort the values in excel once by industry and then by PEG to directly see the ranks. You may use two sheets for PEG and DivYield.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-07-24T16:45:55.237" LastActivityDate="2014-07-24T16:45:55.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14160" PostTypeId="2" ParentId="14153" CreationDate="2014-07-24T17:11:08.807" Score="0" Body="&lt;p&gt;The bank in which you deposit your capital doesn't create the money to pay your interest; it earns it by lending to someone who can make good use of the money. The textbook example is a farmer who borrows £1000 to spend on fertiliser, gains £1200 in extra crop, and repays the bank £1000 plus £100 in interest. The bank gives you £50 for the use of your money, and all three of you are happy. But notice it doesn't actually matter to you whether the bank lends the money to a farmer, a startup company, or somebody with a foolproof system for beating the Las Vegas casinos; the bank pays you an agreed sum for the use of your money, no different in principle from paying rent for an office. If the bank makes better use of the money than you would (as they should do, being professionals), they make a profit from helping someone else create real wealth. That's perfectly logical and sustainable, indeed at best it's self-reinforcing; next year the farmer borrows £5000 to buy and plant a new field once the bank works out that his gains will more than pay for the interest; hey presto, your money has helped produce food that would not otherwise exist, and made a small profit for you while doing so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It gets more complicated when the bank makes loans (directly or through a central bank) to the government. But though a government can just print more money when it has to repay the loan (indeed that's the only way it can work; how would you expect the US Treasury to redeem a dollar bill except by giving you another dollar?) they are not exempt from the laws of economics. Those governments that run a deficit are borrowing money; from bond purchasers, from foreign banks or in the last analysis from anyone who accepts a banknote in payment of a debt. Most governments have a lot of security to pledge, so are considered good credit risks. And the things they spend the money on are, in theory, large-scale versions of buying fertiliser to improve future crops; the British National Health Service was justified by the Treasury of the 1940s on the grounds that reducing the number of days that workers were off sick would more than pay for the hospitals, and the increased happiness would be a bonus.  (Whether that actually worked depends on what accounting you use).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So governments, just like anybody else, borrow money in the belief that the good they can do with it justifies the amount they will have to pay for the use of the money; they can continue to do this as long they invest wisely enough, and pay interest rates high enough, to maintain confidence in the currency. In the 19th century, banks that issued their own currency sometimes issued more than they could redeem, had speculators buy up the notes and present them for redemption all at once, and went bankrupt. Your government could in theory do the same, in which case the money you keep in that currency (as opposed to in usable property) would be worthless, unless it has the artistic value that Confederate or Czarist banknotes have now.  Most of us think the risk low enough that it's worth rising above a barter economy.&lt;/p&gt;&#xA;" OwnerUserId="11641" LastActivityDate="2014-07-24T17:11:08.807" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14161" PostTypeId="2" ParentId="14125" CreationDate="2014-07-24T17:35:08.863" Score="1" Body="&lt;p&gt;The &quot;not too techincal&quot; term is the protective put. It usually applies to buying 1 put per 100 shares of stock owned, but you can explain that you hedge less, if you don't put on the full protective put.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The technical term is delta hedging. I have used this term with less sophisticated clients after I explained what it meant.&lt;/p&gt;&#xA;" OwnerUserId="11642" LastActivityDate="2014-07-24T17:35:08.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14163" PostTypeId="1" AcceptedAnswerId="14166" CreationDate="2014-07-25T07:35:31.377" Score="2" ViewCount="162" Body="&lt;p&gt;How does trade deficit for a prolonged period(say 10-15 years) affect a country's economy? I have read that it should affect it adversely, but the US trade deficit has been negative since the mid 1960's and still the economy is going strong as compared to others. In the case regarding China US trade, how does this affect considering the fact that there is a huge trade deficit year on year, then shouldn't the Chinese Yuan value rise steadily as compared to the US dollar?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I correct in assuming that the net trade deficit of all the countries should sum up to zero?&lt;/p&gt;&#xA;" OwnerUserId="11648" LastActivityDate="2014-07-25T21:24:45.240" Title="How does trade deficit affect the economy of a country" Tags="&lt;fx&gt;&lt;economics&gt;&lt;macro-economics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14164" PostTypeId="1" AcceptedAnswerId="14165" CreationDate="2014-07-25T08:29:14.130" Score="2" ViewCount="764" Body="&lt;p&gt;I'm reading a book about interest rate modelling. It states the following formula &lt;/p&gt;&#xA;&#xA;&lt;p&gt;P(0,T) = exp(-sum of the forward rates)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I thought it's the average of the forward rates?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/1lqic.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="11649" LastEditDate="2014-07-25T16:45:13.937" LastActivityDate="2014-07-25T16:45:13.937" Title="Formula for the forward rates?" Tags="&lt;interest-rates&gt;&lt;forward-rate&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14165" PostTypeId="2" ParentId="14164" CreationDate="2014-07-25T09:26:41.323" Score="4" Body="&lt;p&gt;The price of the zero-coupon bond is the discount factor for this maturity.&#xA;In the world of exponential compounding formulas are of the form $\exp(\sum \cdots)$.&#xA;With a replication argument if we want to invest money for $n$ years what can we do.&#xA;We invest for one year $r_0 = F(0,1)$ then after this year we invest for another year, the rate for this today is $F(1,2)$, after another year we invest again for one year, the rate for this today is $F(2,3)$.&#xA;After all the discount factor is simply&#xA;$$&#xA;\exp(\sum_{i=1}^n F(0,n-1,n)),&#xA;$$&#xA;where the $0$ indicates that the forward rates are traded/observed at time $0$ and $n-1$,$n$ means that it is the forward rate for the respective year. So it is the sum, not the average.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-07-25T09:26:41.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14166" PostTypeId="2" ParentId="14163" CreationDate="2014-07-25T10:29:18.227" Score="2" Body="&lt;p&gt;&lt;a href=&quot;http://www.frbsf.org/education/publications/doctor-econ/2007/june/trade-deficit-exchange-rate&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; is a good explanation by the SF Fed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a nutshell, there is the current account (trade deficit/ surplus) financial account (asset bought/ sold overseas) and the capital account (intangible assets, usually negligible). The sum of the three for each country is zero by definition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore the trade deficit must be accompanied by a financial account surplus of the same magnitude (ignoring capital account). Essentially this puts in the national account tables the conventional wisdom that 'the US consumption is financed by borrowing money from abroad'. This was due to a global increasing 'savings glut' from the 70s onwards.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the second question, the Yuan is 'pegged' or 'managed' by the Bank of China, therefore its appreciation is perhaps slower than what it should have been. This also acted as a catalyst for the inreasing US trade deficit, as the automatic stabiliser (i.e. the FX rate) was impeded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding your third question, the answer is yes. All current accounts globally will add up to zero. Same for all financial accounts and capital accounts.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2014-07-25T10:29:18.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14167" PostTypeId="1" CreationDate="2014-07-25T11:56:44.267" Score="2" ViewCount="157" Body="&lt;p&gt;I was wondering how to find the solution of the following stochastic integral:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dY_{t}=a(W_{t},Y_{t})dW_{t}+b(W_{t},Y_{t})dZ_{t}$$&#xA;or in integral notation&#xA;$$Y_{t}=Y_{0}+\int_{0}^{t}a(W_{s},Y_{s})dW_{s}+\int_{0}^{t}b(W_{s},Y_{s})dZ_{s}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W_{t}$ and $Z_{t}$ are two independent Wiener processes.&#xA;Can I approximate this with the Euler scheme? If so, how do I know it will actually converge. If not, is there any way to find it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be much appreciated&lt;/p&gt;&#xA;" OwnerUserId="7649" LastActivityDate="2014-07-25T13:07:23.203" Title="Ito integral approximation by Euler?" Tags="&lt;stochastic-processes&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14168" PostTypeId="2" ParentId="14167" CreationDate="2014-07-25T12:08:11.680" Score="2" Body="&lt;p&gt;You can write it as&#xA;$$&#xA;\left(\begin{array}{c}dY_t\\ dX_t\end{array} \right) =&#xA;\left(\begin{array}{cc}\alpha(X_t, Y_t)&amp;amp; \beta(X_t,Y_t)\\ 1 &amp;amp; 0\end{array} \right)\cdot \left(\begin{array}{c}dW_t\\ dZ_t\end{array} \right)&#xA;$$&#xA;and check Platen's conditions (Lipschitz?) as Richard pointed out on the matrix perhaps?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it is &#xA;$$&#xA;\left(\begin{array}{c}dY_t\\ dX_t\end{array} \right) =&#xA;\left(\begin{array}{cc}X_t Y_t&amp;amp; 1-X_t Y_t\\ 1 &amp;amp; 0\end{array} \right)\cdot \left(\begin{array}{c}dW_t\\ dZ_t\end{array} \right)&#xA;$$&#xA;I think that it should be fine.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2014-07-25T13:07:23.203" LastActivityDate="2014-07-25T13:07:23.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14169" PostTypeId="2" ParentId="14156" CreationDate="2014-07-25T16:44:22.017" Score="2" Body="&lt;p&gt;Historical returns are not to be used 'untreated' for the calculation of option prices. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The expectation that you will be using in Monte Carlo will take the form&#xA;$$&#xA;C(K,T) = E^Q\{D(T)\ \max[0, S_T-K, 0]\}&#xA;$$&#xA;where $T$ is the maturity, $K$ is the strike price, $S$ is the stock price and $D$ is the discount factor. But the expectation is taken under the 'risk neutral' or, perhaps more accurately, the 'risk adjusted' probability measure (hence the $Q$ in $E^Q$). The historical returns are drawn from the 'real world' or 'physical' or 'objective' probability measure, say $E^P$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The difference between the two reflect a number of factors, including risk preferences and arbitrage (but that is not in the scope of this question). At a minimum, you would like discounted stock prices to be martingales, therefore the expected return of the stock price has to be 'overriden' to match the discount factor. More accurately you would like to apply the 'Radon-Nikodym derivative' or 'state price density' or 'marginal rate of substitution' or 'pricing kernel' to express the option price as an expectation under the 'real world' mesure from which you sample, namely&#xA;$$&#xA;C(K,T) = E^Q\{D(T)\ \max[0, S_T-K, 0]\} = E^P\{m(X_T)\ \max[0, S_T-K, 0]\}&#xA;$$&#xA;where $X$ is a state vector that includes $S$ and $D$ amongst other things (potentially).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But say you follow the minimal approach, then you have to override the mean of your distribution. Hence the number of free parameters goes down from 4 to 3. Then I cannot see why you cannot use the empirical distribution, which the caveat that you will be underpricing OTM puts and overpricing OTM calls with respect to the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now regarding the actual estimation, you mention Hyperbolic Distributions and Heston's model (a Stochastic Volatility model). Although they both are Gaussian models with randomized variance, they are completely different. Hyperbolic Distribution models are 'static' while Stochastic Volatility models are 'dynamic', in terms of the volatility. The former can be estimated using MLE, at least in principle, but they will need a large sample to identify the higher moment parameters. The latter are a real pain to estimate from historical spot prices alone, and also need a long sample to identify the latent volatility dynamics (but you can Goggle for the work of Jacquier, Polson and Rossi/  Eraker, Johannes and Polson/ Bates/ Doucet and Johansen). Or you can use a Garch-type filter instead for the time series, which can give you the spot volatility value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your scaling rule seems reasonable.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2014-07-25T16:44:22.017" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14173" PostTypeId="1" AcceptedAnswerId="14181" CreationDate="2014-07-26T12:39:15.400" Score="6" ViewCount="477" Body="&lt;p&gt;The &lt;a href=&quot;http://en.wikipedia.org/wiki/Equity_premium_puzzle&quot;&gt;Equity Risk Premium Puzzle&lt;/a&gt; concerns the observation that equity returns are generally greater than bond returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The puzzle is well known and widely studied, what is keeping investors from shorting bonds and buying equity? Why hold bonds at all when their expected rate of return is clearly lower. Are there other advantages to holding bonds?&lt;/p&gt;&#xA;" OwnerUserId="11655" LastEditorUserId="848" LastEditDate="2014-07-26T15:49:25.777" LastActivityDate="2014-07-30T14:23:06.313" Title="Why is the equity premium not arbitraged away?" Tags="&lt;equities&gt;&lt;fixed-income&gt;" AnswerCount="4" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14174" PostTypeId="1" AcceptedAnswerId="14175" CreationDate="2014-07-26T13:44:22.240" Score="3" ViewCount="605" Body="&lt;p&gt;Given an index, let's say S&amp;amp;P500, I am trying to find a list of maximum &lt;em&gt;n&lt;/em&gt; underlyings, which altogether track the index quite well. I am thinking of running a portfolio optimization algorithm, where I long the Index (weight = 1) and short the &lt;em&gt;n&lt;/em&gt; underlyings, with the aim of minimizing portfolio variance. The output would be the weights of the underlyings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, given there are 500 underlyings, there would be too many different combinations of underlyings, whose len(underlyings) &amp;lt;= n, and as a result the program would run very slowly. Is there a faster way / another way of selecting a basket of stocks that track the index well?&lt;/p&gt;&#xA;" OwnerUserId="5007" LastActivityDate="2014-07-27T11:32:48.727" Title="Finding a basket of stocks that tracks an index" Tags="&lt;portfolio-optimization&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14175" PostTypeId="2" ParentId="14174" CreationDate="2014-07-26T14:40:12.563" Score="3" Body="&lt;p&gt;The requirement that the number of stocks is less than a certain number is called a cardinality constraint. A mixed integer quadratic programming solver is the most natural approach to this type of problem. However, for 500 stocks, this can also be quite slow, for the same reason you mention above. Alternately, Matlab also has a Webinar where they use a genetic algorithm to solve an optimization problem with cardinality constraints.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If these approaches are still too slow and you don't mind relaxing the strict cardinality constraint to something more loose, then you can try norm constraints (you might also see papers referring to sparse portfolios or portfolio regularization). Basically the idea is to introduce an additional penalty term into the optimization, like what is done with ridge regression or LASSO. So in this sense, if you increase the penalty term, then that will make the portfolio more sparse (more 0s). You might have to play around with the term to get the number of stocks you want (and the relationship between number of stocks and the choice of the term may not necessarily be constant over time). &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2014-07-26T14:40:12.563" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14177" PostTypeId="2" ParentId="14173" CreationDate="2014-07-26T22:46:14.357" Score="2" Body="&lt;p&gt;The Equity Premium Puzzle is &lt;strong&gt;&lt;em&gt;not&lt;/em&gt;&lt;/strong&gt; that Equities have higher returns than Bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bonds always have lower required return than Equity, because they present promised cashflows with senior claims over equity shareholders.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://www.investopedia.com/terms/e/epp.asp&quot; rel=&quot;nofollow&quot;&gt;Equity Premium Puzzle&lt;/a&gt; is, that Equities have &lt;strong&gt;&lt;em&gt;abnormally&lt;/em&gt;&lt;/strong&gt; higher returns than Government Bonds, which means real investors require a higher return on equity relative to a riskneutral investor. This means, real investors are strongly &lt;strong&gt;&lt;em&gt;riskaverse&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Explanation on why real investors would be strongly riskaverse is part of ongoing research, where I do quote &lt;a href=&quot;http://en.wikipedia.org/wiki/Equity_premium_puzzle&quot; rel=&quot;nofollow&quot;&gt;Wikipedia&lt;/a&gt; &quot;no one solution is generally accepted by economists&quot;.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-07-28T12:28:09.710" LastActivityDate="2014-07-28T12:28:09.710" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14178" PostTypeId="2" ParentId="14173" CreationDate="2014-07-27T00:40:03.543" Score="0" Body="&lt;p&gt;Equity risk premium, in theory, should &lt;em&gt;not&lt;/em&gt; be zero, given the relative risk profiles of equities and bonds. The equity risk premium puzzle refers to how difficult it is to explain the &lt;strong&gt;magnitude&lt;/strong&gt; of historical equity risk premium using standard economic models. I recommend that you take a look at chapter 2 of &lt;a href=&quot;http://www.cfapubs.org/doi/pdf/10.2470/rf.v2012.n1.1&quot; rel=&quot;nofollow&quot;&gt;this document&lt;/a&gt; (written by Antii Ilmanen); it provides an excellent discussion on the theories and practice of equity risk premium.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2014-07-27T00:48:25.773" LastActivityDate="2014-07-27T00:48:25.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14179" PostTypeId="2" ParentId="14174" CreationDate="2014-07-27T11:32:48.727" Score="2" Body="&lt;p&gt;As a heuristic you can prioritize stocks with higher correlation to the index. If your starting weight vector is, for instance, normalized values of correlations, you can have a better start at optimization. You can also go with original weights in the index as a starting point (which would be roughly the market caps), and naturally I suspect the two starting points will be highly similar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then to reach your desired number of stocks you can eliminate alternatives by checking partial correlations. Higher partial correlation may indicate similar behavior therefore potential candidates to remove. Recently a friend recommended me &lt;a href=&quot;http://camdp.com/mediaFiles/PDFs/GlassoReport.pdf&quot; rel=&quot;nofollow&quot;&gt;Graphical Lasso Report&lt;/a&gt;, perhaps it may help to improve your model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I might also add, it would be a nice problem if you look at it as a bi-objective problem (i.e. for different values of n, what is the performance of index representation). &lt;/p&gt;&#xA;" OwnerUserId="8147" LastActivityDate="2014-07-27T11:32:48.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14180" PostTypeId="1" CreationDate="2014-07-27T12:20:41.037" Score="1" ViewCount="1426" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Returning to Futures contracts, &lt;strong&gt;basic risk&lt;/strong&gt; refers to the risk remaining after the hedge has been put in place and essentially represents the difference between the Futures price&#xA;  –  should  the  Futures  position  be  closed  prematurely  –  and  the  spot  price.  It  also includes other components such as:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;.   The price of cleaning the local grade of the commodity into a grade deliverable in a&#xA;  Futures contract (or the premium for a superior grade).&lt;br&gt;&#xA;  .   The price of transportation to or from the delivery point in the Futures contract.&lt;br&gt;&#xA;  .   The physical cost of storage, including insurance, between the time of the harvest&#xA;  and the delivery date of the Futures contract.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;-- &lt;strong&gt;Page 7&lt;/strong&gt;, Commodities and Commodity Derivatives: Modeling and Pricing for Agriculturals, Metals and Energy&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;While in the same book:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;1&lt;/strong&gt;. Understanding &lt;strong&gt;basis risk&lt;/strong&gt; is fundamental to hedging. Basis is defined as:&lt;br&gt;&#xA;  Basis&lt;SUB&gt;t,T&lt;/SUB&gt; = Spot price&lt;SUB&gt;t&lt;/SUB&gt; - F&lt;SUP&gt;T&lt;/SUP&gt;(t)&lt;br&gt;&#xA;  is usually quoted as a premium or discount: the cash price as a premium or discount to the Future price.&lt;br&gt;&#xA;  The basis is said to be one dollar &quot;over&quot; Futures if the spot price is one dollar&#xA;  higher than the Futures price.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;2&lt;/strong&gt;. There are several types of basis risk:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(a)  In the case of a trading desk which needs to cut at date &lt;em&gt;t&lt;/em&gt; (e.g., to avoid negative&#xA;  margin calls) – a position in Futures which was meant to hedge a position in the spot commodity – the basis risk is represented by the quantity defined above.&lt;br&gt;&#xA;  (b)  More generally, basis risk exists when Futures and spot prices do not change by&#xA;  the same amount over time and, possibly, will not converge at maturity &lt;em&gt;T&lt;/em&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;-- &lt;strong&gt;Page 14&lt;/strong&gt;, Commodities and Commodity Derivatives: Modeling and Pricing for Agriculturals, Metals and Energy&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I feel confused about the terminology used here. I have never run across &lt;strong&gt;basic risk&lt;/strong&gt; before. And I don't think it's a typo because the index of the book indeed also explicitly references &lt;strong&gt;basic risk&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are &lt;strong&gt;basic risk&lt;/strong&gt; and &lt;strong&gt;basis risk&lt;/strong&gt; the same?&lt;/p&gt;&#xA;" OwnerUserId="11649" LastEditorUserId="11649" LastEditDate="2014-07-27T12:29:22.167" LastActivityDate="2014-07-27T12:29:22.167" Title="Difference between &quot;basic risk&quot; and &quot;basis risk&quot;" Tags="&lt;risk&gt;&lt;futures&gt;&lt;hedge&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14181" PostTypeId="2" ParentId="14173" CreationDate="2014-07-27T12:52:29.553" Score="7" Body="&lt;h1&gt;Short answer&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;It's complicated. A satisfactory solution is not known.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Long answer&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;A satisfactory solution is not known and research is ongoing. That doesn't mean there is nothing interesting to say about it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The phrasing in the question is not entirely correct:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First off all, there's is no risk free arbitrage between bonds and stocks. Both are risky and it's impossible to construct a risk free long/short position in both. So it's not possible to arbitrage anything away. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, as @emcor notes: there seems to be an excess risk premium in the &lt;em&gt;risk adjusted&lt;/em&gt; returns. In order for the premium to disappear requires choosing parameters in the standard risk-return frameworks that are inconsistent with findings from behavioural finance and human behaviour. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to give quantitative answers, wee need a model for the relation between risk, return and behaviour. I'll be heavily borrowing from &lt;a href=&quot;http://faculty.chicagobooth.edu/john.cochrane/research/papers/talk_overheads.pdf&quot;&gt;prof. Cochrane notes&lt;/a&gt; (&lt;a href=&quot;https://www.coursera.org/course/assetpricing&quot;&gt;prof. Cochranes course on Coursera&lt;/a&gt; starts with this subject).&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Some facts&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Over the period 1927 to 2002 (note that this timespan includes the Great Depression) we have the following return statistics:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;                       Bond  |  Stock - Bond&#xA;Mean annual % return:   1.1  |           7.5&#xA;Standard Deviation:     4.4  |          20.8&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So approximately for every \$100 you borrowed you would have made \$7.5. However, this strategy is risky in the short run as the volatility is huge and not obvious for those living in 1927.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;What does an utility maximizing agent do?&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Maximize his utility, off course! This objective can be modelled as follows: Let $u(c)$ denote the utility of consuming \$$c$ and let us restrict ourselves to 2 time periods, $t$ and $t+1$, then in the optimum we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$u'(c_t) = \mathrm{E}\left[\beta u'(c_{t+1})R_{t+1}\right]$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\beta$ denotes the discount for consuming in the future and not now and $R_{t+1}$ the return from $t$ to $t+1$. This equation states that the marginal utility of spending one dollar now should be equal to spending one dollar in the future. For now we use &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$u(c_t) = c^{1-\gamma}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\gamma$ is the coefficient of risk aversion.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Putting these together&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;We can combine theory and fact to check whether the equity risk premium is justified. Cochrane derives that for the chosen utility function $\gamma = 53$ should hold. This implies that someone earning 30k/year would pay $\approx$ \$9.430 to avoid a 50/50 bet on \$10.000. This seems wrong... This also has some crazy implications for the interest rates, see the notes.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Conclusion&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Established economic and financial theory does not have the answers to this question. Possible explanations are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The utility function $u(c) = c^{1-\gamma}$ is wrong. &lt;/li&gt;&#xA;&lt;li&gt;A richer model of consumption is needed implying other consumption data over more periods. &lt;/li&gt;&#xA;&lt;li&gt;Risk seeking behaviour should be explained on the individual level, not as an economic average.&lt;/li&gt;&#xA;&lt;li&gt;People fear financial meltdowns more extreme than we have seen.&lt;/li&gt;&#xA;&lt;li&gt;The effect isn't really there. Stock returns will be lower in the future.&lt;/li&gt;&#xA;&lt;li&gt;Other markets didn't haven't had these returns. The American stock market is an anomaly.&lt;/li&gt;&#xA;&lt;li&gt;Regulations favour bonds.&lt;/li&gt;&#xA;&lt;li&gt;Holding bonds by banks is a favour to their clients.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The size of these effects is subject of ongoing research.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To conclude: whatever the reason is, people seem to really like bonds. This could be caused by an extreme preference to low volatility, a seemingly irrational utility curve or other advantages not captured in the mean and standard deviation.&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="848" LastEditDate="2014-07-27T12:57:38.707" LastActivityDate="2014-07-27T12:57:38.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14182" PostTypeId="1" AcceptedAnswerId="14183" CreationDate="2014-07-27T17:14:34.140" Score="1" ViewCount="467" Body="&lt;p&gt;I understand it is never optimal to &lt;strong&gt;exercise&lt;/strong&gt; an American call option early. &lt;a href=&quot;https://quant.stackexchange.com/questions/3486/exercising-an-american-call-option-early&quot; title=&quot;Exercising an American call option early&quot;&gt;[1]&lt;/a&gt; &lt;a href=&quot;https://quant.stackexchange.com/questions/4924/early-execise-of-american-call-on-non-dividend-paying-stock/4925#4925&quot; title=&quot;Early exercise of American Call on Non-Dividend paying stock&quot;&gt;[2]&lt;/a&gt; However, here are my two contradictory thoughts about &lt;strong&gt;selling&lt;/strong&gt; an American call option early. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assumptions&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I can only &lt;strong&gt;buy&lt;/strong&gt; or &lt;strong&gt;sell&lt;/strong&gt; a call option, never &lt;strong&gt;exercise&lt;/strong&gt; it.&lt;/li&gt;&#xA;&lt;li&gt;I am continuously bullish on the underlying stock.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Contradictory thoughts&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The probability of touching is twice the probability of expiring in the money. &lt;a href=&quot;https://www.youtube.com/watch?v=nSZS3Lo6e10&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;Option Trading - Probability of Touch vs. Probability of Expiring ITM&quot;&gt;[3]&lt;/a&gt; This implies that the call option is twice as likely to meet a profit target prior to expiration than at expiration. Thus, it is more profitable to sell early.&lt;/li&gt;&#xA;&lt;li&gt;On the other hand, because I am continuously bullish on the underlying stock, it would make sense to wait for the stock to appreciate. Thus, it is more profitable to sell the call at the last minute.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thus, is it ever optimal to &lt;strong&gt;sell&lt;/strong&gt; an American call option early?&lt;/p&gt;&#xA;" OwnerUserId="11637" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2014-07-27T17:58:24.337" Title="Selling an American call option early" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;equities&gt;&lt;black-scholes&gt;&lt;portfolio-management&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14183" PostTypeId="2" ParentId="14182" CreationDate="2014-07-27T17:58:24.337" Score="1" Body="&lt;p&gt;If the option is fairly priced, as under the Black-Scholes Model, one cannot gain by selling it early, because the money you get just reflects the fairly expected value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you think you have some inside-information to be bullish on the underlying, you would not sell it early, but this is then just your assumption, so as you may aswell assume to be bearish.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The notion that the probability of touching is twice the probability to expire in the money, does not take into account the actual (expected) payoff received: The call provides unlimited upside potential until maturity.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-07-27T17:58:24.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14184" PostTypeId="1" AcceptedAnswerId="14219" CreationDate="2014-07-27T18:00:20.210" Score="4" ViewCount="1290" Body="&lt;p&gt;Let's say we have a Brownian Bridge $Y_{b,T}(t)$ such that $Y_{b,T}(0)=0$, $Y_{b,T}(T)=b$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say we are interested in the first passage time of $Y_{b,T}(t)$ at level $b$: $\tau_b = \{\min \tau; Y_{b,T}(\tau)=b\}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could I calculate the distribution of $\tau_b$?&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2016-11-22T10:30:37.813" Title="Brownian Bridge's first passage time distribution" Tags="&lt;brownian-motion&gt;&lt;distribution&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14186" PostTypeId="1" CreationDate="2014-07-28T07:25:07.797" Score="1" ViewCount="287" Body="&lt;p&gt;Consider a stock which is trading at $S_0$ at time $t=0$ and is expected to be trading at price $uS_0$ or $dS_0$ at time t=1 where $u$ and $d$ are up-factor and down-factor. The theory says that to rule out the arbitrage, we must assume that : $0&amp;lt;d&amp;lt;1+r&amp;lt;u?$ Can someone explain how does this assumption takes care of no-arbitrage?&lt;/p&gt;&#xA;" OwnerUserId="11660" LastActivityDate="2014-07-28T12:41:29.303" Title="Non-Negativity of up-factor and down-factor in Binomial No-Arbitrage Pricing Model" Tags="&lt;options&gt;&lt;arbitrage&gt;&lt;pricing&gt;&lt;binomial&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14187" PostTypeId="1" CreationDate="2014-07-28T07:59:46.153" Score="0" ViewCount="226" Body="&lt;p&gt;What are different reasons, Finance Team will need CVA number for? Is there any specific regulatory reporting to be done?&lt;/p&gt;&#xA;" OwnerUserId="11661" LastActivityDate="2014-07-30T23:14:51.883" Title="CVA number used by Finance Team" Tags="&lt;finance&gt;&lt;cva&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14188" PostTypeId="2" ParentId="14186" CreationDate="2014-07-28T08:31:33.790" Score="3" Body="&lt;p&gt;This sounds like the first chapter of Björks book am I right? It treats a single-stage model. Simply put, if $1+r \leq d$ you buy the stock and have $V_1\geq 0$ with positive probability of making a profit. If $1+r \geq u$ you want to sell the stock short and buy the bond from the proceeds. The result is the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: To show that the condition is sufficient, we can follow Proposition 2.3 from &quot;Arbitrage Theory in Continuous Time&quot;. In a two-asset, one-period world one can characterize all possible arbitrage portfolios (because $V_0 = 0$) by $x+yS_0 = 0$ ($x$ is the amount of money invested in bonds, $y$ in stocks) and thus write the value at time $1$ explicitly:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V_1 = y S_0 (u- (1+r)), \text{if S goes up}$&#xA;and&#xA;$V_1  = y S_0 (d- (1+r)), \text{if S goes down}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, for an arbitrage portfolio with $y&amp;gt;0$ we need that $V_1 &amp;gt; 0$. That can only happen if $u&amp;gt;1+R$ and $d&amp;gt;1+r$. Similarly, for an arbitrage portfolio with $y&amp;lt;0$, whe get the other direction of the inequality.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastEditorUserId="2727" LastEditDate="2014-07-28T09:00:23.387" LastActivityDate="2014-07-28T09:00:23.387" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14189" PostTypeId="2" ParentId="7377" CreationDate="2014-07-28T09:13:03.947" Score="3" Body="&lt;p&gt;The &lt;a href=&quot;http://blog.zhaw.ch/idp/sefblog/uploads/eco2_script.pdf&quot; rel=&quot;nofollow&quot;&gt;direct filter approach&lt;/a&gt; (DFA) is a time series filter which is calculated in Fourier space. DFA minimizes the mean square error of a time series $y_t$ compared to a filter estimate $\hat{y_t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ E[(y_t - \hat{y_t})^2] = \frac{1}{2 \pi} \int_{-\pi}^{\pi} &#xA;|\Gamma(\omega)- \hat{\Gamma}(\omega)|^2 h(\omega) d\omega $ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The minimization is done in the frequency domain, where $h(\omega)$ is the periodogram and the $\Gamma, \hat{\Gamma}$ are the Fourier coefficients. A detailed discussion of DFA and related frequency-based approaches can be found in the blog link below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are applications of DFA to trading and high-frequency trading. I think that the method was originally proposed to forecast economic time series. See the &lt;a href=&quot;http://blog.zhaw.ch/sef/&quot; rel=&quot;nofollow&quot;&gt;SEF-blog&lt;/a&gt; maintained by Marc Wildi for more information.&lt;/p&gt;&#xA;" OwnerUserId="6721" LastEditorUserId="848" LastEditDate="2014-07-28T09:16:32.353" LastActivityDate="2014-07-28T09:16:32.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14190" PostTypeId="2" ParentId="14126" CreationDate="2014-07-28T09:26:30.933" Score="0" Body="&lt;p&gt;Most uniform RNGs initially output integers in [0,2^32). When such a value is then being converted to double, which have more than 32 bits of mantissa precision, and then scaled to [0,1), the best route is to just add 2^-33 at the end to center the outputs around 1/2. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This way no values are wasted, no checks are needed and the (0,1) interval is best covered reaching farther away in the tails. Furthermore on modern processors and compilers this can come completely for free.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Discarding/shifting 0 or 1, or scaling to other intervals are both costly and produce a suboptimal output.&lt;/p&gt;&#xA;" OwnerUserId="3015" LastEditorUserId="3015" LastEditDate="2014-07-28T09:37:56.270" LastActivityDate="2014-07-28T09:37:56.270" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14191" PostTypeId="2" ParentId="7377" CreationDate="2014-07-28T12:03:10.643" Score="2" Body="&lt;p&gt;In &lt;a href=&quot;http://press.princeton.edu/titles/5386.html&quot; rel=&quot;nofollow&quot;&gt;Hamilton's book&lt;/a&gt; there is a chapter on Spectral Analysis. It is equivalent to Fourier Analysis of deterministic functions, but now in a stochastic setting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuitively, it is similar to the 'construction' of a Brownian motion as the limit of a Fourier series with random (but carefully selected) coefficients. Extracting and studying these coefficients can shed light on the underlying dynamics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can be used as an alternative to Least Squares or Maximum Likelihood for the estimation of model parameters. I imagine that there might be cases where this is more robust, but I do not have first hand experience (have seen it being applied to fractional integration). For example, I can see these techniques yielding alternative co-integration estimators for HFT (i.e. co-integration in time-domain will translate into specific testable/tradeable conditions in frequency-domain).&lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2014-07-28T12:08:18.903" LastActivityDate="2014-07-28T12:08:18.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14192" PostTypeId="2" ParentId="14186" CreationDate="2014-07-28T12:41:29.303" Score="0" Body="&lt;p&gt;If the condition $$0&amp;lt;d&amp;lt;1+r&amp;lt;u$$ is not satisfied, the Binomial model (with $d&amp;lt;u$) would have immediate arbitrage opportunity:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) $1+r\geq u$: Then the riskfree asset would yield least as much return as the stock in any state for any probability, so you could short the stock to buy the riskfree asset and end up with some riskless profit with positive probability (arbitrage).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) $d\geq 1+r$: Then the stock would yield least as much return as the riskfree asset in any state for any probability, so you could short the riskfree assetto buy the stock and end up with some riskless profit with positive probability (arbitrage).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The condition $d,u&amp;gt;0$ is just to ensure positive stockprices in all states.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-07-28T12:41:29.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14194" PostTypeId="2" ParentId="8156" CreationDate="2014-07-28T18:50:41.273" Score="1" Body="&lt;p&gt;A different approach to the more usual algo approach here, Bollinger Bands are a measure of the volatility, differences between buyers and sellers. So as either buyers or sellers are bought/sold out the bollinger bands squeeze beyond the average as a precursor to a sharp trend movement. I use a Bollinger Band Squeeze to highlight an imminent price movement&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Forgive me, I work with charts more than algorithims and I am unable to suggest the calculations for this, perhaps it will start you on the way. All the best.&lt;/p&gt;&#xA;" OwnerUserId="9446" LastActivityDate="2014-07-28T18:50:41.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14195" PostTypeId="1" AcceptedAnswerId="14197" CreationDate="2014-07-28T21:12:53.550" Score="1" ViewCount="250" Body="&lt;p&gt;I'm looking for some academic research on modeling risk of hyperinflation. Specifically, I'm interested in modeling the probability of hyperinflation over some time interval (e.g., probability of hyperinflation in Argentina within the next year). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm familiar with numerous macroeconomic models which are related to inflation, but I'm looking for something a bit different. Clearly sovereign default hyperinflation are related, but I'd like to estimate some function to convert between the two. For example, we can infer probability of default from CDS rates. Then, I'd like to use that to determine probability of hyperinflation. Are there any problems with attempting to approach this problem using this method?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any references or guidance would be appreciated. FWIW, my technical background in mathematics, stats, finance is relatively advanced. i.e., don't be discouraged from sharing any references using stochastic calculus, vector autoregression, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="5407" LastActivityDate="2014-07-29T10:43:41.863" Title="Probability of Hyperinflation as a function of Probability of Soverign Default" Tags="&lt;inflation&gt;&lt;default-probability&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14196" PostTypeId="2" ParentId="7696" CreationDate="2014-07-28T21:26:19.340" Score="1" Body="&lt;p&gt;@Paul, I think you are correct. Your expression relates &lt;em&gt;Gamma&lt;/em&gt; and &lt;em&gt;Volatility Risk&lt;/em&gt;, as &lt;em&gt;volatility risk&lt;/em&gt; is the risk of mis-estimating the future realised volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My only comment relates to your last bullet point: I have always viewed this formula outside of hedging strategies that target Gamma, as we only have the replication strategy. If you are replicating a derivative with near zero Gamma, then you are dealing with a boring near-linear instrument in the first place. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I prefer to view the formula as 'volatility P&amp;amp;L generated for a given path'. If the path brings you far-away-from-the-money, then Gamma is zero and there is no P&amp;amp;L due to volatility. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2014-07-28T21:26:19.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14197" PostTypeId="2" ParentId="14195" CreationDate="2014-07-28T21:45:29.580" Score="2" Body="&lt;p&gt;I think the problem is that, for countries with a sizeable risk of hyperinflation, you will not have deep and mature markets to extract market expectations from. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Argentina is a good example. Hyperinflation is just 'very big inflation', but you don't have inflation swaps in ARS. The CDS that you mention will pay in USD, and are therefore immune to ARS inflation. There are no quanto CDS on Argentina, as far as I know. You might want to extract information synthetically using bonds, but all Argentinean bonds are in USD, nobody wants Peso-denominated bonds. Perhaps you can look at the FX forward curve, as hyperinflation would cause ARS to collapse, but the market is not free-floating. Unless you have access to black market forward rates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And even if you did, then you have to convert the risk neutral probabilities into actual ones. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: There is academic research on the monetary aspects of hyperinflation, for example &lt;a href=&quot;http://people.bu.edu/rking/SZGcourse/Cagan.pdf&quot; rel=&quot;nofollow&quot;&gt;Cagan's 1956 paper&lt;/a&gt; in Milton Friedman's book. More refernces on &lt;a href=&quot;http://en.wikipedia.org/wiki/Phillip_D._Cagan&quot; rel=&quot;nofollow&quot;&gt;Cagan's wiki page&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2014-07-29T10:43:41.863" LastActivityDate="2014-07-29T10:43:41.863" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14201" PostTypeId="2" ParentId="14195" CreationDate="2014-07-29T02:52:54.613" Score="1" Body="&lt;p&gt;I wrote a hyperinflation simulator.  With enough data and enough work I think it would be possible to tune the constants so that it did a reasonable job of matching real world hyperinflation evolution.  With that you could then predict which countries were most at risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://howfiatdies.blogspot.com/2013/03/simulating-hyperinflation.html&quot; rel=&quot;nofollow&quot;&gt;http://howfiatdies.blogspot.com/2013/03/simulating-hyperinflation.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11670" LastActivityDate="2014-07-29T02:52:54.613" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14202" PostTypeId="1" CreationDate="2014-07-29T05:49:48.580" Score="2" ViewCount="116" Body="&lt;p&gt;What are some valid techniques that can be used to simulate how changes in the underlying are most likely to impact implied volatility along with the skew of all strikes for options with the same expiration. I am interested in both equity index and commodities. &lt;/p&gt;&#xA;" OwnerUserId="11671" LastEditorUserId="848" LastEditDate="2014-07-29T06:23:36.113" LastActivityDate="2014-07-29T06:23:36.113" Title="Underlying changes impact on implied volatility" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;implied-volatility&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14204" PostTypeId="1" CreationDate="2014-07-29T09:08:21.063" Score="3" ViewCount="2727" Body="&lt;p&gt;I am trying to plot the asset swap spreads of government inflation-linked bonds (ILBs) versus the asset swap spread of government nominal (plain-vanilla) reference bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used the article in the link below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.risk.net/risk-magazine/feature/1515067/how-read-asset-swap-prices-inflation-linked-bonds&quot; rel=&quot;nofollow&quot;&gt;http://www.risk.net/risk-magazine/feature/1515067/how-read-asset-swap-prices-inflation-linked-bonds&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions/concerns:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a.)   I have conceptual concerns using the net-proceeds asset swap structure (let me qualify that that by saying, given my understandings). My understanding is that we are trying to solve for the asset swap spread (which is built into the floating leg of the asset swap) which sets:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;PV(Fixed)-PV(Floating)=0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where Fixed denotes the fixed leg of the swap and Floating the floating leg of the swap. I felt more comfortable with the par asset swap structure - solving for the asset swap spread which sets:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;AIP-PV(Fixed)-PV(Floating)=100&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where AIP is the current bond all-in-price. Why I liked this was because if a bond was issued with a high coupon rate (relative to current interest rate environment) but had an all-in-price less than par (100), one would conclude the bond had poorer credit quality (relatively speaking - and just assume there is no liquidity premium, etc.) This was then matched by a larger asset swap spread - ie. as holder of the bond I am compensated more for its inferior credit quality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I don't see this mechanism in the net-proceeds asset swap because the all-in-price is not built into the structure (in the par asset swap structure, at initiation you pay par for a bond whose current value is the all in price, while under the net-proceeds structure, you pay the all-in-price (so that (AIP-100) term is not present in the net-proceeds structure as it is in the par-asset swap structure)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b.)   Anyway having used the net-proceeds for the ILBs, the graph of the ILB asset swap spread is completely different to the Nominal asset swap spread - the ILB spreads are roughly around double the size of Nominal spreads and the shape of  the graph (vs. maturity of the bonds) is erratic and wholly different to the shape of the Nominal curve &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now this may be due to the different credit risk  profile of the ILB versus a plain vanilla nominal bond (explained in the article in the link above). But the article fails to cover how to account/compensate for this differing credit structure (so that we could compare the ILB spreads to its reference nominal bond's spread). How would one account for this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have an idea how one should go about this? or more generally to model the asset swap spread for ILBs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help is greatly appreciated&lt;/p&gt;&#xA;" OwnerUserId="11674" LastActivityDate="2016-03-16T20:13:22.717" Title="Inflation-Linked Bonds &amp; Asset Swap Spreads" Tags="&lt;swaps&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14205" PostTypeId="1" CreationDate="2014-07-29T09:10:46.503" Score="8" ViewCount="760" Body="&lt;p&gt;I have recently began work on some high frequency financial tick data. I have been told to 'normalize' the data as much as possible and run linear regressions through them. In fact, the data doesn't seem to be anymore linear after I did transformations on them (box-cox/log etc) I understand the linear regressions bit, but most financial data is non-normal anyway, so why bother normalizing?&lt;/p&gt;&#xA;" OwnerUserId="7161" LastEditorUserId="467" LastEditDate="2014-07-30T12:02:56.127" LastActivityDate="2017-05-31T00:36:40.067" Title="Why are we obsessed over normalizing financial data?" Tags="&lt;equities&gt;&lt;statistics&gt;&lt;high-frequency&gt;" AnswerCount="2" CommentCount="7" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14206" PostTypeId="1" CreationDate="2014-07-29T09:52:40.140" Score="6" ViewCount="444" Body="&lt;p&gt;I am working on a problem where I have successfully reduced a version of Black Scholes to the Heat Equation and then shown the solution to be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$u(x,t)=\frac{1}{2\sqrt{t\pi}}\int_{-\infty}^\infty{f(\xi)e^{-\frac{(x-\xi)^2}{4t}}}d\xi$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I now need to show that if $f(x)$ is continuous then $$\lim_{t\rightarrow 0+}u(x,t)=f(x)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Further, there is a tip that a change of variables of $p=\frac{(\xi-x)}{2\sqrt{t}}$ may help. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think that I need to do some integration by parts, show that some part of the integration go to zero as $t\rightarrow0+$ which will cancel out and then by linearity I can say that as u(x,t) is a solution and  then $f(x)$ must also be a solution. I am just missing the first step and hoped someone can give me a nudge!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any help!&lt;/p&gt;&#xA;" OwnerUserId="11653" LastEditorUserId="11653" LastEditDate="2014-08-10T20:02:49.090" LastActivityDate="2014-08-10T20:02:49.090" Title="Heat/Diffusion Equation" Tags="&lt;black-scholes-pde&gt;&lt;proof&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14207" PostTypeId="2" ParentId="8849" CreationDate="2014-07-29T11:37:22.033" Score="6" Body="&lt;p&gt;A free to use Excel wizard-based Add-In providing QuantLib-backed derivatives pricing analytics directly in Excel is available at &lt;a href=&quot;https://www.deriscope.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.deriscope.com&lt;/a&gt;&#xA;Since August 18, 2017 Deriscope has moved from beta to production.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Disclosure: answerer is author of the package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update as of 24 Oct 17:&#xA;Deriscope already covers the whole QuantLib&lt;/p&gt;&#xA;" OwnerUserId="11676" LastEditorUserId="11676" LastEditDate="2017-10-24T07:32:56.657" LastActivityDate="2017-10-24T07:32:56.657" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14208" PostTypeId="1" CreationDate="2014-07-29T15:13:12.583" Score="1" ViewCount="131" Body="&lt;p&gt;I want to know how rare are splits more extreme than, say, 7:1 (and reverse splits similarly). An &lt;a href=&quot;https://quant.stackexchange.com/a/12896/5693&quot;&gt;answer&lt;/a&gt; here points to announcements on Yahoo Finance, but apparently only monthly views.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is a better database of historical splits, or simply the conventional wisdom about common and uncommon splits?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(The universe of assets I am thinking of is anything that could get an ISIN, but I think it usually affects stocks only.)&lt;/p&gt;&#xA;" OwnerUserId="5693" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2014-07-30T00:17:57.247" Title="What is the distribution of stock splits?" Tags="&lt;equities&gt;&lt;data&gt;&lt;market-data&gt;&lt;historical-data&gt;&lt;split&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14210" PostTypeId="2" ParentId="8361" CreationDate="2014-07-29T15:19:20.710" Score="0" Body="&lt;p&gt;Intraday stock prices are delivered by Yahoo Finance with update interval as low as one second. The catch is a) most prices are not quite &quot;real time&quot; but delayed for up to 20 minutes and b) a few important quotes, such as ^DJI (Dow Jones Industrial) are not delivered any more. Also it seems that Yahoo has permanently discontinued the delivery of time series of historical data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recently has come into existence a new live feed provider called &lt;a href=&quot;https://www.alphavantage.co&quot; rel=&quot;nofollow noreferrer&quot;&gt;Alpha Vantage&lt;/a&gt; that delivers prices with only one minute delay plus tons of time series of intraday data and statistical indicators! I have just finished integrating my Excel Add-In (100% freeware) called &lt;a href=&quot;https://www.deriscope.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;Deriscope&lt;/a&gt; that fetches both live and historical data from both providers. Both synchronous and asynchronous data fetch is supported.&#xA;Video tutorial &lt;a href=&quot;https://www.youtube.com/watch?v=1GoLvT2lG8I&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Disclosure: answerer is author of the package.&lt;/p&gt;&#xA;" OwnerUserId="11676" LastEditorUserId="11676" LastEditDate="2017-10-24T07:44:23.610" LastActivityDate="2017-10-24T07:44:23.610" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14213" PostTypeId="2" ParentId="14145" CreationDate="2014-07-29T17:29:35.543" Score="2" Body="&lt;p&gt;Probably yes. There is a time gap between the two days.  During that time gap it's likely that there was a market being made (and trading going on) for that security outside of what your data captures.  If there was no market and no relevant news or market movement taking place in between days, then you could argue for keeping the data together.&lt;/p&gt;&#xA;" OwnerUserId="6234" LastActivityDate="2014-07-29T17:29:35.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14214" PostTypeId="1" CreationDate="2014-07-29T18:05:25.450" Score="1" ViewCount="74" Body="&lt;p&gt;Suppose I want to minimize certain risk sensitive cost. Is it a valid question to ask what is the proper (also in which sense) choice of risk aversion parameter in the risk-sensitive cost-criterion ? It has to be positive to be risk-aversive. But, the more it will be it will be better. Right? Is there any trade-off here ?&lt;/p&gt;&#xA;" OwnerUserId="11679" LastActivityDate="2014-07-29T18:05:25.450" Title="proper choice of risk aversion parameter in the risk-sensitive cost-criterion" Tags="&lt;risk&gt;&lt;risk-management&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14215" PostTypeId="2" ParentId="14206" CreationDate="2014-07-29T18:07:39.780" Score="5" Body="&lt;p&gt;What you need to do is to first make a variable change such as $u = \frac{x-\xi}{2\sqrt{t}}$. Then change the order of the limit and the integral.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2014-07-29T18:07:39.780" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14216" PostTypeId="2" ParentId="14205" CreationDate="2014-07-29T23:02:00.503" Score="3" Body="&lt;p&gt;&lt;strong&gt;Short answer:&lt;/strong&gt;&lt;br&gt;&#xA;It offers some degree -- and in many cases, a greater degree -- of comparability between two types of data (different assets, returns, etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Long answer:&lt;/strong&gt;&lt;br&gt;&#xA;You may already know this, but keep in mind that &quot;normalization&quot; can mean different things (see &lt;a href=&quot;https://quant.stackexchange.com/questions/9192/how-to-normalize-stock-data&quot;&gt;this question&lt;/a&gt;). There are various methods and purposes for normalizing data (financial or otherwise) but keep things in perspective. Normalize when doing so would be helpful for what you're trying to accomplish, and use a normalization technique that is appropriate. Linear regression has limitations, taking the logarithm has limitations, and so on. It's great to have a big toolbox of different data transformations, but part of that is knowing what to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an aside, you're right that empirically markets have not exhibited normal returns. In fact, Mandelbrot explains in &lt;a href=&quot;http://www.jstor.org/discover/10.2307/2350970?uid=3739560&amp;amp;uid=2&amp;amp;uid=4&amp;amp;uid=3739256&amp;amp;sid=21104416702347&quot; rel=&quot;nofollow noreferrer&quot;&gt;this article&lt;/a&gt; that the &lt;a href=&quot;http://en.wikipedia.org/wiki/Pareto_distribution&quot; rel=&quot;nofollow noreferrer&quot;&gt;Pareto distribution&lt;/a&gt; is more realistic. It was published in 1963, but more recently he talks in &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0465043577&quot; rel=&quot;nofollow noreferrer&quot;&gt;this book&lt;/a&gt; about how the data have continued to demonstrate this pattern. The point is that you may read or hear about normalization techniques that rest on assumptions like normality that may not always be suited to the problem at hand. At the risk of editorializing, the assumption of normality has been subtly embedded in a lot of financial research and it may sometimes be misleading, so make sure to check the assumptions underlying what you're being told.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That being said, just because such an assumption may fail to hold with generality (either theoretically or empirically) does not mean it isn't useful for effectively navigating some specific problem from a mathematical or computational perspective. For example, if you have a model that's super-expensive computationally, and you can speed it up a bunch by making some simplifying assumption without significantly altering the results, perhaps doing so is worthwhile. (As long as you rigorously check that the results do in fact remain within a reasonable degree of similarity.)&lt;/p&gt;&#xA;" OwnerUserId="7385" LastEditorUserId="7385" LastEditDate="2017-05-31T00:36:40.067" LastActivityDate="2017-05-31T00:36:40.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14217" PostTypeId="2" ParentId="14208" CreationDate="2014-07-30T00:04:20.977" Score="2" Body="&lt;p&gt;One possible route would be to get the historical price data from Yahoo and use disparities between the Close returns and the Adjusted Close returns, given a certain threshold value, and where the disparity passes that threshold is where the splits have occurred. Find the Close returns where that condition was met, maybe round the number to the nearest integer, and you have your stock split ratio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you choose a viable threshold value, then you could find a giant list of stocks, automate the process of importing the data and running the computation for all of them, storing the split ratios in a CSV or a database. Then you just open up that data, make a histogram, and there you have it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This isn't the most robust method in the world, but it gets the job done if you want to get a rough idea of the pattern.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Small example:&lt;/strong&gt;&lt;br&gt;&#xA;Say we want to find the splits in Apple's stock history. I don't know what language you program in, but right now I have R open so I'll just do it in R and comment my code so hopefully it's clear what I'm doing. Here I'm using a threshold of 1.5, so that if the Close returns 1.5 times greater than the Adjusted Close returns, it gets picked out of the data so we can zero in on it and find the split ratio.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Import the price data from Yahoo&#xA;&#xA;# (This is a custom function I wrote for myself that pulls the entire price &#xA;# history from Yahoo for a given ticker)&#xA;aapl = stock('aapl')&#xA;&#xA;# Isolate the Close and Adjusted Close prices (columns 5 and 7, respectively)&#xA;dates = as.Date(aapl[,1])&#xA;close = aapl[,5]&#xA;adjcl = aapl[,7]&#xA;N = length(close)  # number of rows of data&#xA;&#xA;# Compute the daily returns of each array&#xA;closeReturns = (close[2:N] / close[1:(N-1)])&#xA;adjclReturns = (adjcl[2:N] / adjcl[1:(N-1)])&#xA;&#xA;# Pick a threshold for how much they have to differ to be picked up&#xA;threshold = 1.5  # arbitrary guess, but it works for Apple&#xA;&#xA;# Find the array indices where the returns differ by at least the threshold&#xA;splitLocations = which(closeReturns &amp;gt; threshold * adjclReturns, arr.ind=T)&#xA;&#xA;# Find the close returns where the splits happened, and round to nearest integer&#xA;splitRatios = round(closeReturns[splitLocations])&#xA;&#xA;# Find the dates where the splits happened&#xA;splitDates = dates[splitLocations]&#xA;&#xA;# Put them next to each other so we can see the date and magnitude of each split&#xA;splits = cbind(data.frame(splitDates), splitRatios)&#xA;&#xA;# Print the results&#xA;&amp;gt; print(splits)&#xA;  splitDates splitRatios&#xA;1 2014-06-09           7&#xA;2 2005-02-28           2&#xA;3 2000-06-21           2&#xA;4 1987-06-16           2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To verify that this is right, looking at chart on Yahoo Finance, Apple's stock had the following splits:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;7:1 on Jun 09, 2014&lt;/li&gt;&#xA;&lt;li&gt;2:1 on Feb 28, 2005&lt;/li&gt;&#xA;&lt;li&gt;2:1 on Jun 21, 2000&lt;/li&gt;&#xA;&lt;li&gt;2:1 on Jun 16, 1987&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So it works for Apple. Definitely do some double-checking and such before you unleash it on aggregating all the split data, but this is one possible route you could take. The problem here is that it would miss things like 1.5:1 splits and reverse stock splits, hence why it isn't that &quot;robust.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the next step would be to compile all the tickers you want to look at, import the data, run the algo, store the ratios in a CSV, and then find the distribution of those ratios.&lt;/p&gt;&#xA;" OwnerUserId="7385" LastEditorUserId="7385" LastEditDate="2014-07-30T00:17:57.247" LastActivityDate="2014-07-30T00:17:57.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14218" PostTypeId="1" AcceptedAnswerId="14905" CreationDate="2014-07-30T09:26:54.767" Score="8" ViewCount="805" Body="&lt;p&gt;I came across a paper, not sure it originated from academia or a blog or such, that reported on applying principal components to build currency baskets from a set of individual currency pairs and to identify driving currencies. When I use the term basket then I mean a collection of individual cash fx pairs and to relate them linearly or non-linearly through different aggregator functions and weights. I am not talking about basket options here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone come across such literature/paper/treatise/blog? I have spent a considerable amount of time in this area and only skimmed through that particular article, thought I had it bookmarked but apparently lost it. I am very interested in other related literature as well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2014-07-30T09:45:28.853" LastActivityDate="2014-09-30T14:08:21.423" Title="Looking for Research Paper on Creation of Currency Baskets" Tags="&lt;fx&gt;&lt;pca&gt;&lt;currency&gt;&lt;basket&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14219" PostTypeId="2" ParentId="14184" CreationDate="2014-07-30T12:03:01.733" Score="3" Body="&lt;p&gt;What about this sketch of an answer: Let's put $T=1$ in your formula to simplify the notation. Then $Y_b(t)$ is a Brownian bridge where $Y_b(0)=0$ and $Y_b(1)=b$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be written as $Y_b(t) = b\ t + Y_0(t)$, that is to say the standard Brownian bridge (from zero to zero) with an added drift $b\ t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The standard Brownian bridge can be written in terms of a time changed Wiener process $W$, namely&#xA;$$ Y_0(t) = (1-t)\ W\left(\frac{t}{1-t}\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The hitting time $\tau$ that you are interested in can be expressed as &#xA;$$\tau_{Y_b}(b) = \inf \{t : Y_b(t) = b\} = \inf\{t : b\ t + (1-t)\ W\left(\frac{t}{1-t}\right) = b \} = \inf\{t : W\left(\frac{t}{1-t}\right) = b \} &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, the hitting time of the Brownian bridge is the hitting time of a time changed Wiener process. That is to say, if &#xA;$$\tau_W(b) = \inf\{s : W(s) = b \}$$&#xA;then&#xA;$$\frac{\tau_{Y_b}(b)}{1-\tau_{Y_b}(b)} = \tau_W(b) \Rightarrow  \tau_{Y_b}(b) = \frac{\tau_W(b)}{1+\tau_W(b)} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a standard Wiener process the hitting time $\tau_W(b)$ follows a Levy distribution with density&#xA;$$ f_W(\tau; b) = \frac{b}{\sqrt{2\pi\tau^3}} \exp \left\{- \frac{b^2}{2\tau} \right\}$$&#xA;hence the density of the hitting time of the Brownian bridge will be&#xA;$$&#xA;f_{Y_b}(\tau; b) = \frac{b}{\sqrt{2\pi\tau^3(1-\tau)}} \exp \left\{- \frac{b^2(1-\tau)}{2\tau} \right\}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this is right.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: The density (if correct) for $b=\{0.25, 0.5, 1, 2\}$ &lt;a href=&quot;http://fooplot.com/plot/13z0yroe91&quot; rel=&quot;nofollow&quot;&gt;looks quite funky actually&lt;/a&gt;!&lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2014-07-30T12:32:36.117" LastActivityDate="2014-07-30T12:32:36.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14220" PostTypeId="1" CreationDate="2014-07-30T12:34:28.513" Score="2" ViewCount="759" Body="&lt;p&gt;When evaluating an HFT strategy, transaction costs are clearly an important&#xA;question. When looking at commercial discount brokers for retail clients,&#xA;costs can be as low as 0.005 USD per share, but given the actual volumes traded back and forth, and the miniscule price movements HFTs try to exploit, it appears that HFT transaction costs have to be much lower than that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have data on how low these transaction costs can go?&lt;/p&gt;&#xA;" OwnerUserId="7878" LastActivityDate="2014-07-30T18:46:41.777" Title="How low can HFT transaction costs go?" Tags="&lt;high-frequency&gt;&lt;transaction-costs&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14221" PostTypeId="2" ParentId="14173" CreationDate="2014-07-30T14:23:06.313" Score="3" Body="&lt;p&gt;Actually, the historical returns, going back to the 1920s, took place in two different ways over two distinct time periods; 1980-present, and 1925-80. This is a more important premise than the fact that stocks have an average total return of 10 percent over the past 80-odd years, and bonds have an average total return of only 5 percent a year over that time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In 1980, bond yields started in the mid-teens, and average annual bond returns from 1980 to about 2010 were in the low double digits, closely matching that of stocks. So arbitrage strategies might not have worked during that time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It was in the period from 1925 to 1980, when bond returns averaged more like 3 percent and stock returns were in the low double digits, that your arbitrage strategy might have worked. But there were few arbitrage strategies employed before 1980.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More to the point, the stock and bond markets from about 2010 to the present appear to be more like those of the mid-20th century than those of 1980-2010. Now is as good a time as any to try arbitrage strategies and see what happens.&lt;/p&gt;&#xA;" OwnerUserId="2345" LastActivityDate="2014-07-30T14:23:06.313" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14222" PostTypeId="2" ParentId="11030" CreationDate="2014-07-30T14:43:14.710" Score="4" Body="&lt;p&gt;Note that $$P(X_i &amp;gt;s)= \exp\Big(-\int_0^s \lambda_i(u) du \Big),$$&#xA;for $i=1, 2$. Then, $$P(\min(X_1, X_2) &amp;gt;s) = P((X_1&amp;gt;s)\cap (X_2&amp;gt;s)) &#xA;= P(X_1&amp;gt;s)P(X_2&amp;gt;s) = \exp\Big(-\int_0^s (\lambda_1(u)+\lambda_2(u)) du \Big).$$ &#xA;That is, the hazard function for $\min(X_1, X_2)$ is $\lambda_1(s)+\lambda_2(s)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, note that&#xA;$$\lambda_i(s) = \lim_{\Delta s \rightarrow 0} \frac{P(X_i \leq s+\Delta s | X_i &amp;gt; s)}{\Delta s} \\&#xA;= \lim_{\Delta s \rightarrow 0} \frac{P(X_i &amp;gt; s) - P(X_i &amp;gt; s+\Delta s)}{\Delta s P( X_i &amp;gt; s)},$$&#xA;for $i=1, 2$. Then the hazard function of $\min(X_1, X_2)$ is given by&#xA;$$&#xA;\lambda_{\min(X_1, X_2)}(s) = \lim_{\Delta s \rightarrow 0} \frac{P(\min(X_1, X_2) \leq s+\Delta s | \min(X_1, X_2) &amp;gt; s)}{\Delta s} \\ &#xA;= \lim_{\Delta s \rightarrow 0} \frac{P(\min(X_1, X_2) &amp;gt; s) - P(\min(X_1, X_2) &amp;gt; s+\Delta s)}{\Delta s P( \min(X_1, X_2) &amp;gt; s)} \\ &#xA;= \lim_{\Delta s \rightarrow 0} \frac{P(X_1 &amp;gt; s)P(X_2&amp;gt; s) - P(X_1 &amp;gt; s+\Delta s)P(X_2 &amp;gt; s+\Delta s)}{\Delta s P(X_1 &amp;gt; s)P(X_2&amp;gt; s)} \\ &#xA;\small= \lim_{\Delta s \rightarrow 0} \frac{P(X_1 &amp;gt; s)P(X_2&amp;gt; s){\tiny-P(X_1 &amp;gt; s)P(X_2 &amp;gt; s+\Delta s) + P(X_1 &amp;gt; s)P(X_2 &amp;gt; s+\Delta s) }- P(X_1 &amp;gt; s+\Delta s)P(X_2 &amp;gt; s+\Delta s)}{\Delta s P(X_1 &amp;gt; s)P(X_2&amp;gt; s)} \\ &#xA;\small=\lim_{\Delta s \rightarrow 0}\bigg(\frac{P(X_2&amp;gt; s)-P(X_2 &amp;gt; s+\Delta s)}{\Delta s P(X_2&amp;gt; s)} +\frac{P(X_2 &amp;gt; s+\Delta s)}{P(X_2&amp;gt; s)} \frac{P(X_1 &amp;gt; s)-P(X_1 &amp;gt; s+\Delta s)}{\Delta s P(X_1 &amp;gt; s)}\bigg) \\ &#xA;= \lambda_1(s)+\lambda_2(s).&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2014-08-13T13:19:45.043" LastActivityDate="2014-08-13T13:19:45.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14223" PostTypeId="2" ParentId="14220" CreationDate="2014-07-30T17:29:50.613" Score="3" Body="&lt;p&gt;Well the answer depends on what are you considering a fee?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you included per trade regulatory fees or just exchange fees?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many exchanges will pay you for being the passive side of a trade, so technically the fees in that case are negative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the big exchanges, I'm not sure that you can negotiate the fee's.  I'll confess I've never tried and the fund I work at isn't big enough:)  But in dark pools there is a lot of negotiating that goes on for fees so you can imagine that the fees that some HFT firms pay approach zero very quickly, just so the dark pools can get a critical mass of liquidity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I should point out that for developing a strategy, the only real fee that matters is the fee schedule you have negotiated.  So in fact only you can answer this question:)&lt;/p&gt;&#xA;" OwnerUserId="743" LastEditorUserId="743" LastEditDate="2014-07-30T18:46:41.777" LastActivityDate="2014-07-30T18:46:41.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14224" PostTypeId="2" ParentId="10775" CreationDate="2014-07-30T17:55:41.770" Score="2" Body="&lt;p&gt;Note that, for a smooth function and constant a&#xA;$$f(S_t) = f(a) + f'(a) (S_t-a) + \int_a^{\infty}(S_t-x)^+f^{''}(x)dx + \int_{0}^a(x - S_t)^+f^{''}(x)dx.$$&#xA;Then, the payoff $1/S_t$ can be approximately hedged by call and put options:&#xA;$$\frac{1}{S_t} = \frac{1}{a} -\frac{1}{a^2}(S_t-a)+ 2\bigg[\int_a^{\infty}\frac{(S_t-x)^+}{x^3}dx + \int_{0}^a\frac{(x - S_t)^+}{x^3}dx \bigg], $$&#xA;where $a = E(S_t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for $S_T/S_t$, let $d$ be the dividend paid at $t_1$, where $t&amp;lt;t_1&amp;lt;T$. Note that&#xA;$$E(S_T \mid \mathcal{F}_t) =S_t \exp\Big(\int_t^T r_s ds \Big) - d\exp\Big(\int_{t_1}^T r_s ds \Big). $$ We replicate the payoff $1/S_t$ at time $t$. Then we replicate by forwards and bonds.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2014-07-30T17:55:41.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14225" PostTypeId="1" CreationDate="2014-07-30T19:51:53.213" Score="10" ViewCount="521" Body="&lt;p&gt;I need to de-seasonalize Nat Gas futures data for a project and am hoping to get good suggestions.&#xA;As we all know natural gas futures are priced higher for the winter months and to analyze/model the term structure we need to de-seasonalize the data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas how would one do it?&lt;/p&gt;&#xA;" OwnerUserId="11687" LastEditorUserId="11807" LastEditDate="2014-08-14T05:36:52.927" LastActivityDate="2019-02-03T16:47:44.700" Title="How to de-seasonalize natural gas term structure data?" Tags="&lt;commodities&gt;&lt;term-structure&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14226" PostTypeId="1" AcceptedAnswerId="14623" CreationDate="2014-07-30T21:17:05.387" Score="3" ViewCount="392" Body="&lt;p&gt;Volatility is usually defined as the standard deviation of returns, but sometimes it is calculated as the standard deviation of cross-sectional return divided by the square root of time, where other times it is simply  the standard deviation of returns for each time period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess for equities that follow Brownian motion, the two don't really matter, since its variance equals time. But this property does not usually hold. For example, if you simulate bond price paths using transition matrices, assuming a fixed spread for bonds with the same credit rating, then the resulting price paths are clearly not Markovian: A bond that has been downgraded will have even a higher chance of being downgraded, thus low price bonds have stronger tendency to drift downward, and the opposite is true since upgraded bonds have even a smaller chance of being downgraded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This creates an unusual situation. Suppose we simulate many price paths, there seems to be two ways to calculate the return volatility:&#xA;1. Find the standard deviation of the cumulative return at the end, the divide by the square root of time.&#xA;2. For each path, find the standard deviation of returns for all the time periods, and the take the average for all paths.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have ran some simulations and the two does not match very well. The cross-sectional volatility is usually 50% to 200% larger than the time-wise volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What would be a good way to illustrate volatility using these price paths?&lt;/p&gt;&#xA;" OwnerUserId="7467" LastActivityDate="2014-09-03T17:45:31.763" Title="Cross-sectional volatility vs temporal volatility" Tags="&lt;volatility&gt;&lt;fixed-income&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14227" PostTypeId="2" ParentId="14187" CreationDate="2014-07-30T23:14:51.883" Score="2" Body="&lt;p&gt;The CVA charge in Basel iii reporting increases the capital required for OTC derivatives trading.&#xA;Apart from CVA, there are DVA and FVA that are important. The adjustments might be unitary reffered to as XVA, as the principle is the same.&lt;/p&gt;&#xA;" OwnerUserId="2872" LastActivityDate="2014-07-30T23:14:51.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14229" PostTypeId="2" ParentId="14218" CreationDate="2014-07-31T08:48:58.120" Score="0" Body="&lt;p&gt;Try the BIS, they are the experts in this area. &lt;a href=&quot;http://www.bis.org/statistics/eer/&quot; rel=&quot;nofollow&quot;&gt;http://www.bis.org/statistics/eer/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two papers there which explain the methodology behind their currency indices.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2014-07-31T08:48:58.120" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14230" PostTypeId="2" ParentId="14205" CreationDate="2014-07-31T10:25:03.797" Score="0" Body="&lt;p&gt;got an answer from one of my pals, thought it might be interesting to share it here. The reason why we often use the normal distribution is because the distribution will be stable regardless of the number of samples (central limit theorem). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Imagine you had a normal distribution after transforming x amount of samples, and across time, u get more variables and we will want them to stay in the 'normal' distribution shape by exploiting the central limit theorem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if you have exponential/Pareto (or any other) distributions, the distribution will tend to a normal distribution once the sample size is large enough due to the central limit theorem. This way, we can have a consistent model regardless of the time/sample size. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps, and if anyone have different ideas about this, please do comment here!&lt;/p&gt;&#xA;" OwnerUserId="7161" LastActivityDate="2014-07-31T10:25:03.797" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14231" PostTypeId="2" ParentId="10775" CreationDate="2014-07-31T10:47:21.850" Score="1" Body="&lt;p&gt;We can explicitly value the Inverted Option under Black-Scholes Model as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/cmb7Q.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the delta-hedging ratio is given as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/T4O1E.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-07-31T10:47:21.850" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14232" PostTypeId="1" CreationDate="2014-07-31T10:53:20.743" Score="34" ViewCount="7244" Body="&lt;p&gt;A process &lt;span class=&quot;math-container&quot;&gt;$X_t$&lt;/span&gt; is a &lt;a href=&quot;https://www.math.cmu.edu/math/events/CMU_Talk_Sept_27_2013.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;local martingale&lt;/a&gt; if there exists an increasing sequence of stopping times &lt;span class=&quot;math-container&quot;&gt;$\{\tau_k,k=1,2,...\}$&lt;/span&gt;, with &lt;span class=&quot;math-container&quot;&gt;$\tau_k \to \infty$&lt;/span&gt; almost surely, such that each stopped process is a martingale. All true martingales are local martingales, but the inverse is not true. A strict local martingale is a local martingale which is not a true martigale. In fact, &lt;a href=&quot;https://almostsure.wordpress.com/2009/12/24/local-martingales/#scn_locmart_lem2&quot; rel=&quot;nofollow noreferrer&quot;&gt;a positive strict local martingale is a supermartingale&lt;/a&gt; -- i.e. the expectation decreases with horizon.&lt;/p&gt;&#xA;&lt;p&gt;In quant finance strictly local martingales have appeared as models which exhibit &lt;a href=&quot;https://www.princeton.edu/%7Ejoses/wp/short_term_int_rates.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;volatility induced stationarity&lt;/a&gt; or models that describe &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2115895&quot; rel=&quot;nofollow noreferrer&quot;&gt;financial bubbles&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;All Ito processes desrcibed by a 'driftless SDE' are in fact local martingales, but not martingales (which is surprising to many). For example the familiar Geometric Brownian motion&#xA;&lt;span class=&quot;math-container&quot;&gt;$$dX_t = X_t\ dW_t$$&lt;/span&gt;&#xA;is a local martingale and a true martingale, while the CEV model with exponent greater than one&#xA;&lt;span class=&quot;math-container&quot;&gt;$$dY_t = Y_t^\alpha\ dW_t \text{ (for given }\alpha &amp;gt; 1\text{)}$$&lt;/span&gt;&#xA;is a local martingale but not a true martingale. In fact, starting from &lt;span class=&quot;math-container&quot;&gt;$Y_0$&lt;/span&gt; the expectation&#xA;&lt;span class=&quot;math-container&quot;&gt;$$E[Y_t|\mathcal{F}_0] &amp;lt; Y_0 \text{ (for all }t&amp;gt;0\text{)}$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;My question is on the intution behind their dynamics and paths:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;What are the qualitative features that break the martingality for such a process as &lt;span class=&quot;math-container&quot;&gt;$\alpha$&lt;/span&gt; crosses 1?&lt;/li&gt;&#xA;&lt;li&gt;How do paths of strict local martingales look like (against true martingales)? They are not explosive, they are not hitting zero, and I cannot see anything particularly 'strange' or 'unusual' when I plot them.&lt;/li&gt;&#xA;&lt;li&gt;How come that even when I simulate this process (with Euler) I get a negative drift, even though I am adding up a finite number of Gaussians with zero mean (although strictly local martingales are only a continuous time phenomenon)?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://almostsure.wordpress.com/2010/08/16/failure-of-the-martingale-property/#more-816&quot; rel=&quot;nofollow noreferrer&quot;&gt;This blog post&lt;/a&gt; discusses these points, but I am looking for something more high level and (if possible) intuitive.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="42844" LastEditDate="2021-05-27T21:26:20.070" LastActivityDate="2021-05-27T21:26:20.070" Title="Strictly local martingales: what is the intuition behind them?" Tags="&lt;stochastic-processes&gt;&lt;simulations&gt;&lt;martingale&gt;&lt;sde&gt;&lt;intuition&gt;" AnswerCount="4" CommentCount="6" FavoriteCount="21" ContentLicense="CC BY-SA 4.0" />
  <row Id="14234" PostTypeId="2" ParentId="14232" CreationDate="2014-07-31T11:25:16.070" Score="1" Body="&lt;p&gt;You are asking an interesting question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Firstly, a Submartingale has increasing or equal expectation (not decreasing).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly, the process $dX_t=X_tdW_t$ is a true martingale (not strictly local), since its solution (by Ito):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X_t=X_0e^{W_t-\frac{t}{2}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;has $E(X_t)=X_0$ constant expectation ($e^{-\frac{t}{2}}E(e^{W_t})=1, W_t\sim N(0,t)$). The negative drift comes from $W_t$'s nonzero quadratic variation. Since $e^X$ is always positive, there needs to be a correcting factor $-t/2$ to ensure the martingale expectation property.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The dynamics are similar to the Black-Scholes Model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dS_t=S_t(\mu dt+\sigma dW_t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;has known solution&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S_t=S_0e^{(\mu-\frac{1}{2}\sigma^2) t +\sigma W_t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This process is not a martingale because of its drift, it becomes so after applying a change of measure to $Q$.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-08-03T21:12:06.553" LastActivityDate="2014-08-03T21:12:06.553" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14237" PostTypeId="1" CreationDate="2014-07-31T15:37:06.440" Score="4" ViewCount="1859" Body="&lt;p&gt;I am reading about mathematical finance, and I was tipsed to ask the quesiton on this site. It is about the &quot;law of one price&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just first I'll make precise the model my book uses:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a single period, so I only have time t=0 and t=1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$B_t$ is the bank account process, where $B_0=1$, and $B_1 \geq1$ is a stochastic variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The price process is $S=\{S_t: t=0,1\}$, where $S_0=(S_1(0),,.S_N(0))$ is the starting price for each security, and $S_1=(S_1(1),,...,S_n(1))$ are stochastic variables giving the end price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$H=(H_0,..H_n)$ gives the trading strategy($H_0$ is just the starting money in the bank, and each $H_i$ is just the number of shares). So the value(it is a stochastic variable when t=1) is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V_t=H_0*B_t+\Sigma H_i*S_n(t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the model the book uses. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now comes the definition of the &quot;law of one price&quot;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/3PLtz.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I struggle to see why this is intuitive. I know that if this law don't hold we have arbitrage or a dominant strategy, so I've seen explanations that says if the law of one price doesn't hold, then we have arbitrage, and hends it is an illogical market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, &lt;strong&gt;I am wondering if the point of the &quot;law of one price&quot; can be explained without using &quot;arbitrage&quot; or &quot;dominant trading strategies&quot;.&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance like this figure shows, we may have two markets where we have arbitrage or dominant trading strategy, but where in one we have the law of one price, and in the other we don't have the law. How would you in this case explain that the law of one price gives a more realistic market?(you can not explain it with arbitrage or dominant trading strategy in this case).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ds3m3.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;PS: I know very little about finance terms, so i would really appreciate it if you explained in terms of the model I wrote in the start.&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="11692" LastEditorUserId="743" LastEditDate="2014-07-31T18:59:31.693" LastActivityDate="2014-07-31T18:59:31.693" Title="law of one price, understanding" Tags="&lt;arbitrage&gt;&lt;models&gt;&lt;market&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14238" PostTypeId="2" ParentId="14237" CreationDate="2014-07-31T15:52:50.223" Score="0" Body="&lt;p&gt;Qian's  (2011) &lt;a href=&quot;http://jhqian.org/apt/apbook.pdf&quot; rel=&quot;nofollow&quot;&gt;book&lt;/a&gt; says: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The law of one price (LOP) states that portfolios with the same payoff must have&#xA;the same price:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X' h = X' h \Rightarrow p' h = p' \tilde h$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $p \in \mathbb{R}^J$ is the price vector.&lt;/p&gt;&#xA;" OwnerUserId="8215" LastEditorUserId="8215" LastEditDate="2014-07-31T16:08:00.807" LastActivityDate="2014-07-31T16:08:00.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14239" PostTypeId="2" ParentId="14237" CreationDate="2014-07-31T15:53:00.047" Score="1" Body="&lt;p&gt;From my knowledge, Law of One Price is defined as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;If two assets provide the same cashflows, they must have the same price.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the justification to price options by a replicating portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The model here seems to assume some European Claims 1-period model, which means $V_1$ represents a final payoff. At the (only) prior time $t=0$, the values of two claims with the same payoffs must by LOP have the same price, which means no $V_0&amp;gt;V_0'$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for option pricing, one can create a portfolio of bond and stock which end with the same value as the payoff of a European option. Hence by LOP, the option must be worth same as the replicating portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is not exactly the same as saying there was no arbitrage, because it might be the case that a replicating portfolio does not exist (incomplete market), while the market itself is still arbitrage-free (when a riskneutral measure Q exsists).&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-07-31T15:53:00.047" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="14240" PostTypeId="1" AcceptedAnswerId="14248" CreationDate="2014-07-31T16:05:39.260" Score="4" ViewCount="910" Body="&lt;p&gt;Is there a textbook that contains the basics for creating Factor Mimicking Portfolios? Although there is a lot of peer-reviewed literature on this, I cannot find textbooks on Asset Pricing that explain in &quot;plain words&quot; how to create Factor Mimicking Portfolios.&lt;/p&gt;&#xA;" OwnerUserId="8215" LastActivityDate="2014-08-01T11:29:46.113" Title="Recommended Literature for creating Factor Mimicking Portfolios" Tags="&lt;modern-portfolio-theory&gt;&lt;factor-models&gt;&lt;asset-pricing&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14242" PostTypeId="2" ParentId="2503" CreationDate="2014-07-31T18:29:18.453" Score="1" Body="&lt;p&gt;Selling 2 ATM calls against 100 underlying shares result in Delta neutral. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;Given the extra downside protection, and potential need for a stop order if the asset price rises too high, is the added risk of the naked leg justified?&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The risk is if the move is more than extrinsic premium collected. One thing to watch out this type of trade is skewness. There are better ways to manage if the price move more than extrinsic premium collected depending on your risk tolerance.&lt;/p&gt;&#xA;" OwnerUserId="1625" LastEditorUserId="1625" LastEditDate="2014-07-31T20:11:55.693" LastActivityDate="2014-07-31T20:11:55.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14243" PostTypeId="2" ParentId="9692" CreationDate="2014-07-31T19:15:53.337" Score="3" Body="&lt;p&gt;You can get EOD data free from &#xA;&lt;a href=&quot;http://www.cboe.com/micro/vix/historical.aspx&quot; rel=&quot;nofollow&quot;&gt;cboe&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you need tick, intraday and options data check out &lt;a href=&quot;http://www.marketdataexpress.com/overview.aspx?s=r11&quot; rel=&quot;nofollow&quot;&gt;market data&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1625" LastActivityDate="2014-07-31T19:15:53.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14244" PostTypeId="2" ParentId="11510" CreationDate="2014-07-31T19:41:16.530" Score="1" Body="&lt;p&gt;For your first question, your derivative is incorrect. It instead is $\frac{\partial C^2}{\partial x \partial y} = 1+\theta(1-2x-2y+4xy)$. Note also that $x+y-2xy \geq x^2 + y^2 -2xy = (x-y)^2 \geq 0$. That is, $1-2x-2y+4xy \leq 1$. On the other hand, $1-2x-2y+4xy = 2(1-x)(1-y)+2xy - 1 \geq -1$. Then, $\frac{\partial C^2}{\partial x \partial y} \geq 0$, for $\theta \in [-1, 1]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the second question, note that the copula function is invariant of any monotonic transformations, then the copula for $(X, Y^2)$ is also given by $C(x, y)$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2014-08-01T18:18:36.490" LastActivityDate="2014-08-01T18:18:36.490" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14246" PostTypeId="2" ParentId="4689" CreationDate="2014-08-01T06:18:58.457" Score="2" Body="&lt;p&gt;Let's try to summarize your question before answering it:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;on the one hand concentration risk comes from the fact your book is highly correlated to few factors, hence you cannot take profit of diversification, market moves will affect you a lot;&lt;/li&gt;&#xA;&lt;li&gt;on the other hand wrong way risk is about being exposed to a counterparty such a way that the more you have products from it in your book, the more risk you have in them. General risk of this kind stems from underlying market wide relationships, and not from a badly designed product specific to one counterpart (it would be &lt;em&gt;specific wrong way risk&lt;/em&gt;). Hence having this product from any counterpart will embed GWWR.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;All this seems to mean that GWWR increases when you &lt;strong&gt;concentrate&lt;/strong&gt; your book on products that are &lt;strong&gt;wrong way&lt;/strong&gt;, and concentration risk is about... well... &lt;strong&gt;concentrate&lt;/strong&gt; your book on few market factors. Then: what is the difference?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess the difference stems from where the exposure to the risk come from:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;for concentration risk, it is direct exposure to market factors it more or less increases the volatility of your book;&lt;/li&gt;&#xA;&lt;li&gt;for GWWR is about &lt;strong&gt;counterparty risk&lt;/strong&gt;, to cite an &lt;a href=&quot;http://www.isda.org/c_and_a/pdf/RGresserLetter-Sept701.pdf&quot; rel=&quot;nofollow&quot;&gt;ISDA doc&lt;/a&gt;:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;[...] the credit quality of the counterparty may for non-specific reasons be&#xA;  held to be correlated with a macroeconomic factor which also affects&#xA;  the value of derivatives transactions.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Counterparty risk affects your book another way that &lt;em&gt;increasing volatility&lt;/em&gt;: &#xA;for instance it propagates a non linear way via CVA (Credit Valuation Adjustment) in your book. According to this &lt;a href=&quot;http://www.occ.gov/static/news-issuances/ots/press-releases/ots-pr-2011-16a.pdf&quot; rel=&quot;nofollow&quot;&gt;US Interagency Supervisory Guidance on Counterparty Credit Risk Management document&lt;/a&gt; (p13 and beyond), counterparty risk management is not limited to CVA ; they list:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;counterparty limits&lt;/em&gt;, mainly via CVA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;margin policies and practices&lt;/em&gt;, via haircuts, collateral and margining management;&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;close-out&lt;/em&gt; policies and practices.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;My answer thus will be: if you do not value GWWR via counterparty channels (like CVA), but only by increasing the volatility of your book, you are right, there is not that much difference between concentration risk and GWWR in your procedures. But it is not the right way: &lt;strong&gt;these two risks should propagate in your book different ways&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2014-08-05T06:28:21.587" LastActivityDate="2014-08-05T06:28:21.587" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14248" PostTypeId="2" ParentId="14240" CreationDate="2014-08-01T11:17:28.353" Score="2" Body="&lt;p&gt;Pretty good explanation is in Schweser CFA Study Notes for CFA level III. Books 3 and 5, at least from 2009, if I remember right. See also Tsay R.S. Analysis of Financial Time Series (Wiley Series in Probability and Statistics). // 2010.  - good example with implementation in R.&lt;/p&gt;&#xA;" OwnerUserId="6535" LastEditorUserId="6535" LastEditDate="2014-08-01T11:29:46.113" LastActivityDate="2014-08-01T11:29:46.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14249" PostTypeId="2" ParentId="14204" CreationDate="2014-08-01T11:25:48.107" Score="2" Body="&lt;p&gt;a couple of ideas on the subject:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) This is how swap are priced (PV[fixed] - PF[float] = 0). It is the same idea for bond if you think about it, but with two fixed legs (one is selling the bond at today's price, the other is receiving the stream of interest and final repayments).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) In theory, the difference between Inflation linked and non inflation linked bonds is, well, inflation expectations. That gives you some idea of where the market participant see inflation realizing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, the inflation linked market is &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;much smaller (so liquidity is not always great and your time series will not be as responsive as the vanilla one)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;some organizations (think pension plans with defined benefits) absolutely need those, pushing the price higher. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Credit is not really an issue here as you would expect the bonds to have the same kind of risk if the issuer is the same.&lt;/p&gt;&#xA;" OwnerUserId="11540" LastActivityDate="2014-08-01T11:25:48.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14250" PostTypeId="2" ParentId="12677" CreationDate="2014-08-01T11:37:22.760" Score="1" Body="&lt;p&gt;Bloomberg functions PORT OPT and MARS provide internal factor models for many asset classes + ability to use your own models in optimization. &lt;/p&gt;&#xA;" OwnerUserId="6535" LastActivityDate="2014-08-01T11:37:22.760" CommentCount="0" CommunityOwnedDate="2014-08-01T11:37:22.760" ContentLicense="CC BY-SA 3.0" />
  <row Id="14251" PostTypeId="1" CreationDate="2014-08-01T11:58:10.097" Score="0" ViewCount="1203" Body="&lt;p&gt;I have market depth data visualization software, and I want to create a free version for introduction. As far as I know, exchanges allow to distribute their data for free for the end-users, but only if the data is delayed. I know about several such delayed data providers, but none of them provides market depth data. The data must be streaming data, of course (not a snapshot by request). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;update:&lt;/strong&gt; Since it's just for introduction purpose, I'm looking for data on just few instruments. For example FDAX at Eurex, and ES,NQ,GC,CL at CME&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;update #2:&lt;/strong&gt; To clarify my question. I am looking for a data vendor that provides &lt;strong&gt;streaming delayed market depth data&lt;/strong&gt;. Typically, the delay must be 15 min. to avoid exchange costs. Please do not offer just any data vendor or historical data provider, or direct connection to exchange (e.g. becoming market data vendor myself).&lt;/p&gt;&#xA;" OwnerUserId="1515" LastEditorUserId="1515" LastEditDate="2014-08-07T21:49:26.883" LastActivityDate="2015-04-08T03:19:54.343" Title="Are there providers of delayed market depth data (DOM, Level II, Order-by-Order, etc)?" Tags="&lt;market-data&gt;" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14252" PostTypeId="2" ParentId="14251" CreationDate="2014-08-01T13:26:00.617" Score="1" Body="&lt;p&gt;You'll have to go to the exchanges to ask.  There are several things you need to think about.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) When the exchange give you data, its clearly laid out hat it is for your firm only, ie you can not be a re transmitter of this information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The stock tickers you see scrolling across CNBC...There is an actual fee schedule for that.  Google finance showing quotes, there is a set fee schedule for that.  Data from a bloomberg terminal, you guessed it:), there is a set fee schedule for that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or put another way, the exchanges all consider their market data to be their property and if you want to use it, that right must be negotiated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your choices are limited to either:&#xA;1) Going to each exchange, signing the paper work and paying for the data.&#xA;2) Going to an aggregatorto provide you data.  Again, you'll need to negotiate for the right to display the exchanges data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get you started, here is a list of brokers that are licensed to disseminate the TSX market data...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.tmx.com/en/data/how_to_access_data/vendor_and_partner_list.html&quot; rel=&quot;nofollow&quot;&gt;http://www.tmx.com/en/data/how_to_access_data/vendor_and_partner_list.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="743" LastActivityDate="2014-08-01T13:26:00.617" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14253" PostTypeId="2" ParentId="14106" CreationDate="2014-08-01T13:41:29.200" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;Predictability - we all know what a bootstrapped curve will do when we shift a value. A minimisation, however, could jump to a new minimum at any moment. They also have unpredictable performance; sometimes a minimisation is fast, sometimes slow.&lt;/li&gt;&#xA;&lt;li&gt;Robustness - these codes have been around forever, and they work. New codes, not so much.&lt;/li&gt;&#xA;&lt;li&gt;Defendability - why is your X over the 17th so high? Because a cubic spline said so? It's much harder to defend something based on maths than something based on proven usefulness, even if it's more correct, and particularly when the boss has only known that type of construction.&lt;/li&gt;&#xA;&lt;li&gt;Speed - Bootstrapped codes, because they are predictable and because they are old, are fast. Optimisation methods can be 10-100x slower, (or more!) if you have a lot of complex criteria, or it happens to be a funny day for Futures vs Swaps. &lt;/li&gt;&#xA;&lt;li&gt;That's how other people do it - if you're trying to agree a stub rate with your counterparty, or the moneyness of a position for margining, anything where you have to justify the rates, it is much easier to go with something &quot;normal&quot;. I heard it took Goldman (Goldman!) years to convince everyone that OIS was the right rate for margin accrual and discounting.&lt;/li&gt;&#xA;&lt;li&gt;For compatability with mid-office systems - if your P&amp;amp;L tomorrow morning is calculated by a mid-office setup which uses bootstrapped curves, you're going to want to know at least what that is likely to say, even if you also use a sophisticated spreadsheet&lt;/li&gt;&#xA;&lt;li&gt;Systems lag spreadsheets - following the above, the systems that are available lag market practices, so unless the software house has major customers that require more sophisticated curves, they just won't have caught up yet.&lt;/li&gt;&#xA;&lt;li&gt;It's not a significant difference - if you know that the difference is small, or that it is overwhelmed by something else that is far more important but impossible with a newer curve, then for all it's sophistication it is still not a better solution.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1314" LastEditorUserId="1314" LastEditDate="2014-08-01T14:43:13.953" LastActivityDate="2014-08-01T14:43:13.953" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14255" PostTypeId="2" ParentId="14251" CreationDate="2014-08-01T14:45:35.950" Score="1" Body="&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; In that case, your question makes no sense and I am voting to close it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's fundamentally no difference between &quot;historical data&quot; and &gt;= 15 minute delay. You can write an application to stream historical data in 1:1 correspondence to the original durations to your application. I don't know any providers who queue precisely 15 minutes of market depth data to disseminate continuously at the end of every moving 15 minute interval because it makes more sense to sell that data as historical data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While in theory CME charges no fees on a per user basis for continuous data that is delayed at least 10 minutes and not accessed indirectly over LAN, someone at the top of the hierarchy has to be paying the data distribution fees and maintaining the colocated server(s) and multicast over TCP/IP/ through which you receive the data. This has real costs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, real-time CME market depth data is cheap (exchange fees are \$5 per month per user and a third party vendor like eSignal or IQFeed probably charges another \$50 to \$100 per month) in your case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, your question really just reduces to: &quot;I'm in the business of selling software. Which data providers give me free historical data? I don't want to pay \$5 to \$85 per month.&quot; This is outside the scope of this QE, which is for quant professionals.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For CME, here's a few sources that sell market depth historical data on an order-by-order basis:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.nanex.net/historical.html&quot; rel=&quot;nofollow&quot;&gt;CME DataMine&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.cmegroup.com/market-data/datamine-historical-data/&quot; rel=&quot;nofollow&quot;&gt;Reuters tick history&lt;/a&gt; - sells on an instrument-by-instrument basis.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://thomsonreuters.com/tick-history/&quot; rel=&quot;nofollow&quot;&gt;Nanex historical data&lt;/a&gt; - sells on an exchange-wide basis.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For Eurex, the exchange itself also stores that data but Nanex only provides BBO:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.eurexchange.com/exchange-en/market-data/hoistorical-data/&quot; rel=&quot;nofollow&quot;&gt;Eurex historical data&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.cmegroup.com/market-data/datamine-historical-data/&quot; rel=&quot;nofollow&quot;&gt;Reuters tick history&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You mentioned you're probably not willing to pay for your data... well, you can try your luck with Reuters or Nanex, they are more likely to cut you a special deal than the exchange itself.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="4660" LastEditDate="2014-08-01T18:53:16.107" LastActivityDate="2014-08-01T18:53:16.107" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14256" PostTypeId="1" AcceptedAnswerId="14286" CreationDate="2014-08-01T15:30:14.223" Score="7" ViewCount="2427" Body="&lt;p&gt;I start this question with a couple of C++ functions that will be useful to show some results. So start your &lt;strong&gt;Visual Studio C++ Express&lt;/strong&gt; or &lt;strong&gt;Ceemple&lt;/strong&gt; or whatever you want and copy &amp;amp; paste this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#include &amp;lt;ql/quantlib.hpp&amp;gt;&#xA;#include &amp;lt;boost/timer.hpp&amp;gt;&#xA;#include &amp;lt;iostream&amp;gt;&#xA;#include &amp;lt;iomanip&amp;gt;&#xA;&#xA;using namespace QuantLib;&#xA;&#xA;#if defined(QL_ENABLE_SESSIONS)&#xA;namespace QuantLib {&#xA;&#xA;    Integer sessionId() { return 0; }&#xA;&#xA;}&#xA;#endif&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After standard introduction, the first function acts like a small wrapper: taken a &lt;code&gt;shared_ptr&lt;/code&gt; of &lt;code&gt;BlackVolTermStructure&lt;/code&gt; template and some data, a zero-flat risk free rate curve is built and a &lt;code&gt;BlackProcess&lt;/code&gt; is built; hence the option NPV is returned.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;double EurVanillaSurfacePricerBlack(boost::shared_ptr&amp;lt;BlackVolTermStructure&amp;gt; forwardVolSurface, Option::Type type, Real underlying, Real strike, Date maturity)&#xA;{&#xA;  Rate riskFreeRate = 0.00;&#xA;  DayCounter dayCounter = Actual365Fixed();&#xA;  Calendar calendar = TARGET();&#xA;  Natural settlementDays = 3;&#xA;&#xA;  // exercise&#xA;  boost::shared_ptr&amp;lt;Exercise&amp;gt; europeanExercise(&#xA;      new EuropeanExercise(maturity));&#xA;&#xA;  // underlying&#xA;  Handle&amp;lt;Quote&amp;gt; underlyingH(boost::shared_ptr&amp;lt;Quote&amp;gt;(&#xA;      new SimpleQuote(underlying)));&#xA;&#xA;  // bootstrap the yield curve&#xA;  Handle&amp;lt;YieldTermStructure&amp;gt; flatTermStructure(&#xA;      boost::shared_ptr&amp;lt;YieldTermStructure&amp;gt;(&#xA;          new FlatForward(settlementDays, calendar, riskFreeRate, dayCounter)));&#xA;&#xA;  // payoff&#xA;  boost::shared_ptr&amp;lt;StrikedTypePayoff&amp;gt; payoff(&#xA;      new PlainVanillaPayoff(type, strike));&#xA;&#xA;  // process&#xA;  boost::shared_ptr&amp;lt;BlackProcess&amp;gt; blackProcess(&#xA;      new BlackProcess(underlyingH, flatTermStructure, Handle&amp;lt;BlackVolTermStructure&amp;gt;(forwardVolSurface)));&#xA;&#xA;  // options&#xA;  VanillaOption europeanOption(payoff, europeanExercise);&#xA;  europeanOption.setPricingEngine(boost::shared_ptr&amp;lt;PricingEngine&amp;gt;(&#xA;                                       new AnalyticEuropeanEngine(blackProcess)));&#xA;  double optionValue = europeanOption.NPV();&#xA;&#xA;  return(optionValue);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The same function can be written using &lt;code&gt;BlackScholesMertonProcess&lt;/code&gt; instead of  &lt;code&gt;BlackProcess&lt;/code&gt; and of course specifying a dividend yield term structure due to we're not using anymore underlying forward price... but here we set everything to zero, both risk free rate and dividend yield - thus giving the function flat and meaningless term structures:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;double EurVanillaSurfacePricerBSM(boost::shared_ptr&amp;lt;BlackVolTermStructure&amp;gt; forwardVolSurface, Option::Type type, Real underlying, Real strike, Date maturity)&#xA;{&#xA;  Spread dividendYield = 0.00;&#xA;  Rate riskFreeRate = 0.00;&#xA;  DayCounter dayCounter = Actual365Fixed();&#xA;  Calendar calendar = TARGET();&#xA;  Natural settlementDays = 3;&#xA;&#xA;  // exercise&#xA;  boost::shared_ptr&amp;lt;Exercise&amp;gt; europeanExercise(&#xA;      new EuropeanExercise(maturity));&#xA;&#xA;  // underlying&#xA;  Handle&amp;lt;Quote&amp;gt; underlyingH(boost::shared_ptr&amp;lt;Quote&amp;gt;(&#xA;      new SimpleQuote(underlying)));&#xA;&#xA;  // bootstrap the yield curve and the dividend curve&#xA;  Handle&amp;lt;YieldTermStructure&amp;gt; flatTermStructure(&#xA;      boost::shared_ptr&amp;lt;YieldTermStructure&amp;gt;(&#xA;          new FlatForward(settlementDays, calendar, riskFreeRate, dayCounter)));&#xA;  Handle&amp;lt;YieldTermStructure&amp;gt; flatDividendTS(&#xA;      boost::shared_ptr&amp;lt;YieldTermStructure&amp;gt;(&#xA;          new FlatForward(settlementDays, calendar, dividendYield, dayCounter)));&#xA;&#xA;&#xA;  // payoff&#xA;  boost::shared_ptr&amp;lt;StrikedTypePayoff&amp;gt; payoff(&#xA;      new PlainVanillaPayoff(type, strike));&#xA;&#xA;  // process&#xA;  boost::shared_ptr&amp;lt;BlackScholesMertonProcess&amp;gt; bsmProcess(&#xA;      new BlackScholesMertonProcess(underlyingH, flatDividendTS, flatTermStructure, Handle&amp;lt;BlackVolTermStructure&amp;gt;(forwardVolSurface)));&#xA;&#xA;  // options&#xA;  VanillaOption europeanOption(payoff, europeanExercise);&#xA;  europeanOption.setPricingEngine(boost::shared_ptr&amp;lt;PricingEngine&amp;gt;(&#xA;                                       new AnalyticEuropeanEngine(bsmProcess)));&#xA;  double optionValue = europeanOption.NPV();&#xA;&#xA;  return(optionValue);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;According to the little of option theory I know, there shouldn't be any difference between the two functions:&#xA;$$F(t)=S(0)e^{[r(t)-q(t)]t},$$&#xA;where $q$ and $r$ are zero for every maturity thus $F=S(0)$ for every maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The third function is a little variation on the same theme: instead of using standard constructors which require term structures, we plug a constant volatility value into a flat surface:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;double EurVanillaPricer(Volatility volatility, Option::Type type, Real underlying, Real strike, Date maturity)&#xA;{&#xA;  Spread dividendYield = 0.00;&#xA;  Rate riskFreeRate = 0.00;&#xA;  DayCounter dayCounter = Actual365Fixed();&#xA;  Calendar calendar = TARGET();&#xA;  // This was &quot;Natural settlementDays = 3;&quot; before Luigi Ballabio's correction&#xA;  Natural settlementDays = 0;&#xA;&#xA;  // exercise&#xA;  boost::shared_ptr&amp;lt;Exercise&amp;gt; europeanExercise(&#xA;      new EuropeanExercise(maturity));&#xA;&#xA;  // underlying&#xA;  Handle&amp;lt;Quote&amp;gt; underlyingH(boost::shared_ptr&amp;lt;Quote&amp;gt;(&#xA;      new SimpleQuote(underlying)));&#xA;&#xA;  // bootstrap the yield/dividend/vol curves&#xA;  Handle&amp;lt;YieldTermStructure&amp;gt; flatTermStructure(&#xA;      boost::shared_ptr&amp;lt;YieldTermStructure&amp;gt;(&#xA;          new FlatForward(settlementDays, calendar, riskFreeRate, dayCounter)));&#xA;  Handle&amp;lt;YieldTermStructure&amp;gt; flatDividendTS(&#xA;      boost::shared_ptr&amp;lt;YieldTermStructure&amp;gt;(&#xA;          new FlatForward(settlementDays, calendar, dividendYield, dayCounter)));&#xA;  Handle&amp;lt;BlackVolTermStructure&amp;gt; flatVolTS(&#xA;      boost::shared_ptr&amp;lt;BlackVolTermStructure&amp;gt;(&#xA;          new BlackConstantVol(settlementDays, calendar, volatility, dayCounter)));&#xA;&#xA;  // payoff&#xA;  boost::shared_ptr&amp;lt;StrikedTypePayoff&amp;gt; payoff(&#xA;      new PlainVanillaPayoff(type, strike));&#xA;&#xA;  // process&#xA;  boost::shared_ptr&amp;lt;BlackScholesMertonProcess&amp;gt; bsmProcess(&#xA;      new BlackScholesMertonProcess(underlyingH, flatDividendTS, flatTermStructure, flatVolTS));&#xA;&#xA;  // options&#xA;  VanillaOption europeanOption(payoff, europeanExercise);&#xA;  europeanOption.setPricingEngine(boost::shared_ptr&amp;lt;PricingEngine&amp;gt;(&#xA;                                       new AnalyticEuropeanEngine(bsmProcess)));&#xA;  double optionValue = europeanOption.NPV();&#xA;&#xA;  return(optionValue);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Last but not least, let me introduce a forward volatility surface wrapper:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;boost::shared_ptr&amp;lt;BlackVolTermStructure&amp;gt; ForwardImpliedVolSurface(Date todaysDate, Date forwardDate, Calendar calendar, std::vector&amp;lt;Date&amp;gt; maturityArray, std::vector&amp;lt;Real&amp;gt; strikeArray, Matrix volatilityMatrix)&#xA;{&#xA;  // Handle to boost::shared_ptr&#xA;  DayCounter dayCounter = Actual365Fixed();&#xA;  boost::shared_ptr&amp;lt;BlackVarianceSurface&amp;gt; volatilitySurface(new BlackVarianceSurface(todaysDate, calendar, maturityArray, strikeArray, volatilityMatrix, dayCounter));&#xA;  Handle&amp;lt;BlackVolTermStructure&amp;gt; volatilitySurfaceH(volatilitySurface);&#xA;&#xA;  // Volatility surface interpolation&#xA;  volatilitySurface-&amp;gt;enableExtrapolation(true);&#xA;&#xA;  // Change interpolator to bicubic splines&#xA;  volatilitySurface-&amp;gt;setInterpolation&amp;lt;Bicubic&amp;gt;(Bicubic());&#xA;&#xA;  // Forward implied volatility surface&#xA;  boost::shared_ptr&amp;lt;BlackVolTermStructure&amp;gt; forwardVolSurface(new ImpliedVolTermStructure(volatilitySurfaceH, forwardDate));&#xA;&#xA;  return(forwardVolSurface);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What are the output of such functions? Let'see:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;int main() {&#xA;&#xA;try {&#xA;&#xA;    boost::timer timer;&#xA;    std::cout &amp;lt;&amp;lt; std::endl;&#xA;&#xA;    /* +---------------------------------------------------------------------------------------------------&#xA;     * | Date and calendars parameters&#xA;     * +---------------------------------------------------------------------------------------------------&#xA;     * */&#xA;&#xA;    // set up dates&#xA;    Calendar calendar = TARGET();&#xA;    Date todaysDate(03, Jul, 2014);&#xA;    Date settlementDate = calendar.advance(todaysDate, 3, Days);&#xA;    Settings::instance().evaluationDate() = todaysDate;&#xA;&#xA;    // Maturity dates array&#xA;    Date expiry1(15, Aug, 2014);&#xA;    Date expiry2(19, Sep, 2014);&#xA;    Date expiry3(19, Dec, 2014);&#xA;    Date expiry4(20, Mar, 2015);&#xA;    Date expiry5(19, Jun, 2015);&#xA;&#xA;    std::vector&amp;lt;Date&amp;gt; maturityArray;&#xA;    maturityArray.push_back(expiry1);&#xA;    maturityArray.push_back(expiry2);&#xA;    maturityArray.push_back(expiry3);&#xA;    maturityArray.push_back(expiry4);&#xA;    maturityArray.push_back(expiry5);&#xA;&#xA;    // Strikes array&#xA;    std::vector&amp;lt;Real&amp;gt; strikeArray;&#xA;    for(int i = 2975; i &amp;lt; 2975 + (26 * 25); i = i + 25)&#xA;    {&#xA;      strikeArray.push_back(i);&#xA;    }&#xA;&#xA;    // Implied volatility matrix&#xA;        Matrix volatilityMatrix(26, 5);&#xA;&#xA;        volatilityMatrix[0][0]  = 0.198989  ; volatilityMatrix[0][1]  = 0.182889 ; volatilityMatrix[0][2]  = 0.182256 ; volatilityMatrix[0][3]  = 0.183319 ; volatilityMatrix[0][4]  = 0.202197 ;&#xA;        volatilityMatrix[1][0]  = 0.192338  ; volatilityMatrix[1][1]  = 0.178463 ; volatilityMatrix[1][2]  = 0.17982  ; volatilityMatrix[1][3]  = 0.181494 ; volatilityMatrix[1][4]  = 0.201261 ;&#xA;        volatilityMatrix[2][0]  = 0.185184  ; volatilityMatrix[2][1]  = 0.174239 ; volatilityMatrix[2][2]  = 0.177315 ; volatilityMatrix[2][3]  = 0.179669 ; volatilityMatrix[2][4]  = 0.200291 ;&#xA;        volatilityMatrix[3][0]  = 0.178718  ; volatilityMatrix[3][1]  = 0.170046 ; volatilityMatrix[3][2]  = 0.175143 ; volatilityMatrix[3][3]  = 0.177845 ; volatilityMatrix[3][4]  = 0.19928  ;&#xA;        volatilityMatrix[4][0]  = 0.172647  ; volatilityMatrix[4][1]  = 0.166123 ; volatilityMatrix[4][2]  = 0.172826 ; volatilityMatrix[4][3]  = 0.176046 ; volatilityMatrix[4][4]  = 0.198271 ;&#xA;        volatilityMatrix[5][0]  = 0.166556  ; volatilityMatrix[5][1]  = 0.162275 ; volatilityMatrix[5][2]  = 0.170328 ; volatilityMatrix[5][3]  = 0.174391 ; volatilityMatrix[5][4]  = 0.19764  ;&#xA;        volatilityMatrix[6][0]  = 0.160933  ; volatilityMatrix[6][1]  = 0.158344 ; volatilityMatrix[6][2]  = 0.16825  ; volatilityMatrix[6][3]  = 0.172892 ; volatilityMatrix[6][4]  = 0.197454 ;&#xA;        volatilityMatrix[7][0]  = 0.155747  ; volatilityMatrix[7][1]  = 0.154688 ; volatilityMatrix[7][2]  = 0.166199 ; volatilityMatrix[7][3]  = 0.17105  ; volatilityMatrix[7][4]  = 0.196211 ;&#xA;        volatilityMatrix[8][0]  = 0.150464  ; volatilityMatrix[8][1]  = 0.151097 ; volatilityMatrix[8][2]  = 0.164325 ; volatilityMatrix[8][3]  = 0.16875  ; volatilityMatrix[8][4]  = 0.193533 ;&#xA;        volatilityMatrix[9][0]  = 0.145234  ; volatilityMatrix[9][1]  = 0.147602 ; volatilityMatrix[9][2]  = 0.16217  ; volatilityMatrix[9][3]  = 0.16793  ; volatilityMatrix[9][4]  = 0.195104 ;&#xA;        volatilityMatrix[10][0] = 0.140751  ; volatilityMatrix[10][1] = 0.144357 ; volatilityMatrix[10][2] = 0.160261 ; volatilityMatrix[10][3] = 0.169107 ; volatilityMatrix[10][4] = 0.202441 ;&#xA;        volatilityMatrix[11][0] = 0.136502  ; volatilityMatrix[11][1] = 0.141208 ; volatilityMatrix[11][2] = 0.158546 ; volatilityMatrix[11][3] = 0.165058 ; volatilityMatrix[11][4] = 0.194346 ;&#xA;        volatilityMatrix[12][0] = 0.13342   ; volatilityMatrix[12][1] = 0.138357 ; volatilityMatrix[12][2] = 0.156949 ; volatilityMatrix[12][3] = 0.15057  ; volatilityMatrix[12][4] = 0.155503 ;&#xA;        volatilityMatrix[13][0] = 0.104896  ; volatilityMatrix[13][1] = 0.119273 ; volatilityMatrix[13][2] = 0.128517 ; volatilityMatrix[13][3] = 0.136208 ; volatilityMatrix[13][4] = 0.116855 ;&#xA;        volatilityMatrix[14][0] = 0.10099   ; volatilityMatrix[14][1] = 0.115047 ; volatilityMatrix[14][2] = 0.125638 ; volatilityMatrix[14][3] = 0.132476 ; volatilityMatrix[14][4] = 0.109273 ;&#xA;        volatilityMatrix[15][0] = 0.100313  ; volatilityMatrix[15][1] = 0.114395 ; volatilityMatrix[15][2] = 0.125642 ; volatilityMatrix[15][3] = 0.133834 ; volatilityMatrix[15][4] = 0.117099 ;&#xA;        volatilityMatrix[16][0] = 0.0981065 ; volatilityMatrix[16][1] = 0.112273 ; volatilityMatrix[16][2] = 0.124137 ; volatilityMatrix[16][3] = 0.132863 ; volatilityMatrix[16][4] = 0.118885 ;&#xA;        volatilityMatrix[17][0] = 0.0962976 ; volatilityMatrix[17][1] = 0.109955 ; volatilityMatrix[17][2] = 0.122498 ; volatilityMatrix[17][3] = 0.130647 ; volatilityMatrix[17][4] = 0.116549 ;&#xA;        volatilityMatrix[18][0] = 0.0950343 ; volatilityMatrix[18][1] = 0.107924 ; volatilityMatrix[18][2] = 0.121311 ; volatilityMatrix[18][3] = 0.129627 ; volatilityMatrix[18][4] = 0.116142 ;&#xA;        volatilityMatrix[19][0] = 0.094729  ; volatilityMatrix[19][1] = 0.106211 ; volatilityMatrix[19][2] = 0.119952 ; volatilityMatrix[19][3] = 0.12918  ; volatilityMatrix[19][4] = 0.116873 ;&#xA;        volatilityMatrix[20][0] = 0.0952533 ; volatilityMatrix[20][1] = 0.104712 ; volatilityMatrix[20][2] = 0.118585 ; volatilityMatrix[20][3] = 0.128231 ; volatilityMatrix[20][4] = 0.116804 ;&#xA;        volatilityMatrix[21][0] = 0.0977423 ; volatilityMatrix[21][1] = 0.103553 ; volatilityMatrix[21][2] = 0.117229 ; volatilityMatrix[21][3] = 0.126978 ; volatilityMatrix[21][4] = 0.116249 ;&#xA;        volatilityMatrix[22][0] = 0.0992171 ; volatilityMatrix[22][1] = 0.102743 ; volatilityMatrix[22][2] = 0.115987 ; volatilityMatrix[22][3] = 0.125834 ; volatilityMatrix[22][4] = 0.115905 ;&#xA;        volatilityMatrix[23][0] = 0.102137  ; volatilityMatrix[23][1] = 0.1025   ; volatilityMatrix[23][2] = 0.114716 ; volatilityMatrix[23][3] = 0.124794 ; volatilityMatrix[23][4] = 0.115759 ;&#xA;        volatilityMatrix[24][0] = 0.108426  ; volatilityMatrix[24][1] = 0.102351 ; volatilityMatrix[24][2] = 0.113496 ; volatilityMatrix[24][3] = 0.123768 ; volatilityMatrix[24][4] = 0.115648 ;&#xA;        volatilityMatrix[25][0] = 0.111779  ; volatilityMatrix[25][1] = 0.102869 ; volatilityMatrix[25][2] = 0.112514 ; volatilityMatrix[25][3] = 0.12274  ; volatilityMatrix[25][4] = 0.11554  ;&#xA;&#xA;/* +---------------------------------------------------------------------------------------------------&#xA; * | Forward volatility (ref. pag. 154-157 of &quot;Dynamic Hedging - Managing Vanilla and Exotic Options&quot;)&#xA; * +---------------------------------------------------------------------------------------------------&#xA; * */&#xA;&#xA;    // As instance, go 15 days forward&#xA;    Date forwardDate = calendar.advance(todaysDate, 15, Days);&#xA;&#xA;    boost::shared_ptr&amp;lt;BlackVolTermStructure&amp;gt; forwardVolSurface = ForwardImpliedVolSurface(todaysDate, forwardDate, calendar, maturityArray, strikeArray, volatilityMatrix);&#xA;    Option::Type typeCall(Option::Call);&#xA;    Option::Type typePut(Option::Put);&#xA;&#xA;    Real underlying = 3289.75;&#xA;&#xA;    double myOption4;&#xA;    myOption4 = EurVanillaSurfacePricerBlack(forwardVolSurface, typeCall, underlying, 3300, expiry3);&#xA;    //disp(myOption4);&#xA;    double myOption5;&#xA;    myOption5 = EurVanillaSurfacePricerBSM(forwardVolSurface, typeCall, underlying, 3300, expiry3);&#xA;    //disp(myOption5);&#xA;    double myOption6;&#xA;    myOption6 = EurVanillaPricer(forwardVolSurface-&amp;gt;blackVol(expiry3, 3300), typeCall, underlying, 3300, expiry3);&#xA;    //disp(myOption6);&#xA;&#xA;    // Amend evaluation date...&#xA;    Settings::instance().evaluationDate() = forwardDate;&#xA;&#xA;    double myOption1;&#xA;    myOption1 = EurVanillaSurfacePricerBlack(forwardVolSurface, typeCall, underlying, 3300, expiry3);&#xA;    //disp(myOption1);&#xA;    double myOption2;&#xA;    myOption2 = EurVanillaSurfacePricerBSM(forwardVolSurface, typeCall, underlying, 3300, expiry3);&#xA;    //disp(myOption2);&#xA;    double myOption3;&#xA;    myOption3 = EurVanillaPricer(forwardVolSurface-&amp;gt;blackVol(expiry3, 3300), typeCall, underlying, 3300, expiry3);&#xA;    //disp(myOption3);&#xA;&#xA;        return 0;&#xA;&#xA;    } catch (std::exception&amp;amp; e) {&#xA;        std::cerr &amp;lt;&amp;lt; e.what() &amp;lt;&amp;lt; std::endl;&#xA;        return 1;&#xA;    } catch (...) {&#xA;        std::cerr &amp;lt;&amp;lt; &quot;unknown error&quot; &amp;lt;&amp;lt; std::endl;&#xA;        return 1;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What are the output? Well, of course Black model and BSM model with flat and null term structures return the same values, that are $105.743$ for both the options. Despite of this, however, selecting &quot;manually&quot; the implied volatility to be used from the implied volatility surface via &lt;code&gt;forwardVolSurface-&amp;gt;blackVol(expiry3, 3300)&lt;/code&gt; returns a very different value, that is, $103.858$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would you explain this difference?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I am afraid of is... automatic shift of volatility surface when evaluation date is amended. I tried to write code to avoid such behavior retaining relinkable handles into functions, so that they're destroyed once function ends.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I am not sure it works as intended.&lt;/p&gt;&#xA;" OwnerUserId="3058" LastEditorUserId="3058" LastEditDate="2014-08-05T12:12:16.497" LastActivityDate="2017-06-27T20:52:07.590" Title="QuantLib: Black / BSM processes and pricing via volatility surface. Different results?" Tags="&lt;options&gt;&lt;programming&gt;&lt;quantlib&gt;&lt;term-structure&gt;&lt;volatility-smile&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14258" PostTypeId="2" ParentId="10455" CreationDate="2014-08-01T20:01:27.717" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://www.calculatedriskblog.com/2012/12/manufacturing-ism-pmi-vs-markit.html&quot; rel=&quot;nofollow&quot;&gt;http://www.calculatedriskblog.com/2012/12/manufacturing-ism-pmi-vs-markit.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Two similiar barometers with different weights&lt;/p&gt;&#xA;" OwnerUserId="11706" LastActivityDate="2014-08-01T20:01:27.717" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14259" PostTypeId="1" CreationDate="2014-08-01T20:40:25.150" Score="1" ViewCount="2525" Body="&lt;p&gt;I'd like to investigate the comovement of stock index returns with bond yields but I don't know which return's duration to use (1-year, 1-month or anything else) to get a better view of the relationship. &lt;br&gt;Other than that, I'm unsure which is the better rolling correlation's duration in order to have a clear understanding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've elaborated these 4 alternatives: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1-year rolling correlation with 1-month returns and 10y bond yield.&lt;br&gt;&#xA;3-years rolling correlation with 1-month returns and 10y bond yield.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1-year rolling correlation with 1-year returns and 10y bond yield.&lt;br&gt;&#xA;3-years rolling correlation with 1-year returns and 10y bond yield.&#xA;&lt;img src=&quot;https://i.stack.imgur.com/fCt6Z.jpg&quot; alt=&quot;Rolling correlation&quot;&gt;&#xA;&lt;br&gt;&#xA;If I use 1y returns then the correlation has a max of 1, otherwise with 1m returns the maximum correlation is 0.6.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance for all your thoughts.&lt;/p&gt;&#xA;" OwnerUserId="11707" LastActivityDate="2014-08-04T16:57:24.200" Title="Correlation between S&amp;P500 returns and 10y US Treasuries yields" Tags="&lt;equities&gt;&lt;correlation&gt;&lt;returns&gt;&lt;bond-yields&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14260" PostTypeId="1" CreationDate="2014-08-02T06:03:29.640" Score="1" ViewCount="390" Body="&lt;p&gt;I have read on several news articles and research papers, &quot;Contrary to popular belief, high frequency trading reduces volatility in stock markets rather than exacerbates it&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you know the models that are used by these studies for the volatility measurement, given now there is so much noise in tick data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some reference links I found online :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://public.econ.duke.edu/~get/browse/courses/201/spr11/DOWNLOADS/VolatilityMeasures/SpecificlPapers/hansen_lunde_forecasting_rv_11.pdf&quot; rel=&quot;nofollow&quot;&gt;http://public.econ.duke.edu/~get/browse/courses/201/spr11/DOWNLOADS/VolatilityMeasures/SpecificlPapers/hansen_lunde_forecasting_rv_11.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://mitsloan.mit.edu/groups/template/pdf/Zhang.pdf&quot; rel=&quot;nofollow&quot;&gt;http://mitsloan.mit.edu/groups/template/pdf/Zhang.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11710" LastActivityDate="2014-08-02T06:03:29.640" Title="Models for volatility estimation of high frequency data?" Tags="&lt;volatility&gt;&lt;quant-trading-strategies&gt;&lt;high-frequency&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14261" PostTypeId="2" ParentId="4740" CreationDate="2014-08-02T11:22:46.467" Score="1" Body="&lt;p&gt;For forward libor models, one can hedge interest rate options by using bonds. (Note that forward libor is a tradeable security under the forward measure).  See &lt;a href=&quot;http://www.columbia.edu/~mh2078/market_models.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.columbia.edu/~mh2078/market_models.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For affine yield models (like Vasicek or CIR models) the inverse problem is the most useful.  Given an interest rate process, I can compute a theoretical bond price.  From observable market prices of bonds I can then compute the parameters of my interest rate model (by minimizing the L2 norm, for example).  Given these (risk neutral!) parameters I can then price any instrument that depends on that interest rate. But, I cannot necessarily hedge these instruments.  &lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2014-08-02T11:22:46.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14263" PostTypeId="1" CreationDate="2014-08-02T15:15:08.527" Score="3" ViewCount="2440" Body="&lt;p&gt;The trading strategies that are going to backtest well are the ones that pick the winners from the past. For example, if a trading strategy simply bought apple stock it would backtest extremely well. The bias is easy to spot in this specific scenario, but for complex trading strategies there could be hidden bias of this type.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am wondering if it is possible to eliminate this bias by backtesting in a different manner. What if you used the historical data to build a statistical model of the market or part of it. Such a model could include the risk free rate, historic volatilities, and correlations between stocks, etc. You could then run a monte Carlo simulation where you backtest against multiple, statistically generated historical data. You could use this to develop statistics about how the strategy works in a broader sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any thoughts on this idea?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;--&#xA;Reference : &lt;a href=&quot;https://www.quantopian.com/posts/backtesting-thoughts&quot; rel=&quot;nofollow&quot;&gt;https://www.quantopian.com/posts/backtesting-thoughts&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11710" LastActivityDate="2015-12-30T22:29:19.433" Title="Backtesting with Simulated Historical Data?" Tags="&lt;quant-trading-strategies&gt;&lt;trading&gt;&lt;backtesting&gt;&lt;algorithmic-trading&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14266" PostTypeId="2" ParentId="14263" CreationDate="2014-08-02T18:56:54.093" Score="3" Body="&lt;p&gt;Have you checked White's &quot;reality test&quot; (White H. A reality check for data snooping. // Econometrica. 2000. № 68. С. 1097–1126.)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, when you use Monte-Carlo, you always have a variation of &quot;double hypothesis&quot; issue, noted by Fama: first hypothesis is that your model of the market is right, and the second - that trading rule you test (against your market model) actually adds value. Positive answer to the second question makes sense only when the answer to the first is strict 'yes'. And is the first question falsifiable? Perhaps, no. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, your results might be interesting to publish, but dangerous to trade, in my opinion.&lt;/p&gt;&#xA;" OwnerUserId="6535" LastEditorUserId="6535" LastEditDate="2014-08-02T19:04:09.187" LastActivityDate="2014-08-02T19:04:09.187" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14267" PostTypeId="1" AcceptedAnswerId="14269" CreationDate="2014-08-03T03:43:32.417" Score="1" ViewCount="226" Body="&lt;p&gt;The Variance-Gamma (VG) process, from my inexpert point-of-view, seems to nearly perfectly model equity distributions.&lt;/p&gt;&#xA;&lt;p&gt;For longer term options, there is little to no volatility, skewness, or kurtosis parameter skew.&lt;/p&gt;&#xA;&lt;p&gt;For shorter term options, it is true as the authors claim that the VG model provides no more resolution than Black-Scholes-Merton since the skewness and kurtosis parameters tend to 1, and the volatility skew reappears.&lt;/p&gt;&#xA;&lt;p&gt;What is the mathematical explanation for this phenomenon?&lt;/p&gt;&#xA;" OwnerDisplayName="user6500" LastEditorUserId="41390" LastEditDate="2020-07-08T10:28:09.643" LastActivityDate="2020-07-08T10:28:09.643" Title="Why doesn't Variance-Gamma process flatten volatility skew for short term options?" Tags="&lt;options&gt;&lt;equities&gt;&lt;implied-volatility&gt;&lt;skew&gt;&lt;variance-gamma&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="14268" PostTypeId="2" ParentId="14005" CreationDate="2014-08-03T08:28:35.413" Score="1" Body="&lt;p&gt;As in the vonjd's answer martingale property makes some sense only if considered with the risk premium and risk-free rate (&quot;stochastic discount factor&quot; they say). Discounted stock price process is assumed to be a martingale in many studies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The root of H02's &quot;evil&quot; is &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/j.1540-6261.1970.tb00518.x/abstract&quot; rel=&quot;nofollow&quot;&gt;Fama's Efficient Market Hypothesis Survey&lt;/a&gt;. It is the most clear and comprehensive survey about the efficient markets hypothesis in 1970s. Both in the paper that you referred to and Fama's paper H01 is not highly regarded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Concisely he divides the hypothesis into three: Weak form, semi strong form and strong form. Weak form deals only with the past price information, semi strong form adds market reaction to public information (i.e. earnings, dividends, etc.) and the strong form adds the information homogeneity (i.e. no part of the market has private information that can be used to obtain extra gains). To the impatient reader, he defends weak form and semi strong form but he admits deficiency to some extent in the strong form (though he still defends it is enough for him to deem the markets efficient).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most of what he did is to survey previous studies (including his and his colleagues) and draw conclusions by compare and contrast. Weak form is the most interesting since most of the modern mathematical models has at least a notion of it, including option pricing models. If the memory serves, first a term &quot;fair game&quot; is coined. Then skepticism towards random walk models are discussed and random walk theories are deemed not so solid and not even necessary for a market to be efficient. There are also discussions about the Gaussian assumption (in a negative way).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Semi strong form says that the market adjusts for publicly available information and the market is unbiased towards these information. For stock splits, dividends and earnings he cites studies that even if there is extra movement caused by these kind of information it is confined to a very small subset of assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fama says there is limited evidence against strong form, indicating specialists (aka market makers) have access to privileged information (i.e. order limits). But it was not much of an interest to me so I urge you to read from the source.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Final word. You should only take these as an idea and search for more. Well, it is a model and &quot;some&quot; representation of the market. Academics are usually lazy enough to take those for granted and have 'reasons' to do so (&quot;the guy and followers of the theory earned many Nobel prizes&quot;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;ps. I love Taleb's remarks (although with some reservation due to my far less than full grasp about the field) about Nobel prizes related to asset price theoreticians. See some &lt;a href=&quot;http://www.bloomberg.com/news/2010-10-08/taleb-says-crisis-makes-nobel-panel-liable-for-legitimizing-economists.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="8147" LastActivityDate="2014-08-03T08:28:35.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14269" PostTypeId="2" ParentId="14267" CreationDate="2014-08-03T08:54:56.257" Score="8" Body="&lt;p&gt;VG belongs in the family of &lt;a href=&quot;http://en.m.wikipedia.org/wiki/Normal_variance-mean_mixture&quot; rel=&quot;noreferrer&quot;&gt;variance-mean mixture models&lt;/a&gt;. Given a horizon $T$ the distribution of log-returns $f$ is a mixture of Gaussians $f_G$ with randomised mean and variance. The randomisation density is $g$ and its mean and variance increase with $T$. For the VG process this randomised factor &lt;a href=&quot;http://www.math.nyu.edu/research/carrp/papers/pdf/VGEFRpub.pdf&quot; rel=&quot;noreferrer&quot;&gt;is Gamma-distributed&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More concretely, denote with $f_G(x;\mu,\sigma^2)$ the Gaussian density, and with $g(s;\theta,T)$ the mixing density which has positive support. Then the log-return density is given by&#xA;$$&#xA;f(x;\mu,\sigma,\theta,T) = \int_0^\infty f_G(x;\mu s,\sigma^2 s)\ g(s;\theta,T)\ ds&#xA;$$&#xA;It follows that option prices can be written as a weighted average of Black-Scholes prices. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The higher moments (&lt;a href=&quot;http://www.math.nyu.edu/research/carrp/papers/pdf/VGEFRpub.pdf&quot; rel=&quot;noreferrer&quot;&gt;see p85&lt;/a&gt;) are of the form&#xA;$$\text{skewness}=c_1/\sqrt{T}\text{, and kurtosis}=3+c_2/T$$&#xA;Hence as $T\rightarrow 0$ they both go to infinity, while as $T\rightarrow\infty$ the distribution becomes Gaussian.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The presence of higher moments for small $T$ manifests itself as a skew of short-term options. However, how pronounced this skew is will depend on what you have on the x-axis, namely strike price, moneyness standardised with time, or Delta.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2014-08-03T12:48:12.177" LastActivityDate="2014-08-03T12:48:12.177" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14270" PostTypeId="1" AcceptedAnswerId="16879" CreationDate="2014-08-03T10:28:00.897" Score="2" ViewCount="5999" Body="&lt;p&gt;&lt;strong&gt;**Question is at the bottom**&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose you have a portfolio of bonds A, B, and C with the following characteristics:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(the &quot;Frequency&quot; column is the # of coupon pmts per year and also the # of compounding periods)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Bond | Coupon Rate | Frequency      | Years to Maturity | YTM (%) | FV ($)&#xA;A    |   5.00      | quarterly      |  2                | 5.16    | 1,000&#xA;B    |   5.50      | semi-annually  |  3                | 5.40    | 1,000&#xA;C    |   6.25      | annually       |  4                | 5.90    | 1,000&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From the information above I calculate each Bond's price and duration:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Bond A&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;CFt      = $1,000 × (5.00% ÷ 4) = $12.50&#xA;YTMt     = 0.0516 ÷ 4 = 0.0129 or 1.29%&#xA;Price    = $12.50 × [1 – ( 1.0129)^-8 ÷ 0.0129] + ($1,000 ÷ 1.0129)^-8&#xA;         = $94.44 + $902.54&#xA;         = $996.98&#xA;Duration = 7,638.9447 ÷ $996.98 ÷ 4 = 1.9155 years&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Bond B&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;CFt      = $1,000 × (5.50% ÷ 2) = $27.50&#xA;YTMt     = 0.0540 ÷ 2 = 0.0270 or 2.70%&#xA;Price    = $27.50 × [1 – ( 1.0270)^-6 ÷ 0.0270] + ($1,000 ÷ 1.0270)^-6&#xA;         = $150.47 + $852.27&#xA;         = $1,002.74&#xA;Duration = 5,628.5639 ÷ $1,002.74 ÷ 2 = 2.8066 years&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Bond C&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;CFt      = $1,000 × (6.25% ÷ 1) = $62.50&#xA;YTMt     = 0.0590 ÷ 1 = 0.0590 or 5.90%&#xA;Price    = $12.50 × [1 – ( 1.0590)^-4 ÷ 0.0590] + ($1,000 ÷ 1.0590)^-4&#xA;         = $217.07 + $795.09&#xA;         = $1,012.16&#xA;Duration = 3,707.4842 ÷ $1,012.16 ÷ 1 = 3.6630 years&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Portfolio Duration&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Bond    Duration(D)     Quantity (Q)    Bond Price (P)  V = Q × P        DP = D × V&#xA;A       1.9155              2            $	996.98      $   1,993.96    3,819.4304&#xA;B       2.8066              1            $	1,002.74    $   1,002.74    2,814.2901&#xA;C       3.6630              2            $	1,012.16    $   2,024.32    7,415.0842&#xA;                                                   Total    $ 5,021.02   14,048.8046&#xA;Portfolio Duration = 14,048.8046 ÷ $5,021.02 = 2.7980 or 2.80 years&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Portfolio Weighted Average Discount Rate&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Bond    YTM/YR  Periods/YR  YTM/Period  Quantity (Q)    Bond Price (P)  V = Q × P   YTM/Period × V&#xA;A        0.0516        4    0.0129     2          $	996.98	      $  1,993.96    25.7221 &#xA;B        0.0540        2    0.0270     1          $	1,002.74      $  1,002.74    27.0740 &#xA;C        0.0590        1    0.0590     2          $	1,012.16      $  2,024.32    19.4349 &#xA;                                                          Total       $	   5,021.02   172.2309&#xA;Weighted Average Discount Rate = 172.2309 ÷ $5,021.02 = 0.0343 or 3.43%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;QUESTION&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now suppose a fourth bond D, has a coupon rate of 5.25% paid semi-annually, a maturity of two years, a face value of $1,000, a yield of 6.25%, and a duration of 1.9238 years. How could one immunize the interest rate risk of the portfolio above with bond D? I think we need to find the proportion of bond D that will make the overall duration 0, by solving the equation for the augmented-portfolio duration.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;w × Dp + (1 – w ) × Dd = 0&#xA;&#xA;where&#xA;&#xA;Dp = duration of the portfolio of bonds A, B, and C&#xA;w = proportion of the portfolio in bonds A, B and C&#xA;1 – w = proportion of the portfolio in bond D&#xA;Dd = duration of bond D&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5233" LastActivityDate="2015-03-06T19:31:41.633" Title="Bond Portfolio Immunization - Duration Matching" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;duration&gt;&lt;portfolio-optimization&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14272" PostTypeId="1" CreationDate="2014-08-03T11:04:01.920" Score="0" ViewCount="119" Body="&lt;p&gt;I am looking at data for Unit Trusts and OEICs in the UK.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They are identified by SEDOL or ISIN codes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given an SEDOL, how can I find the ISIN associated with the same product?  And given an ISIN, how can I find the associated SEDOL?&lt;/p&gt;&#xA;" OwnerUserId="6392" LastActivityDate="2014-08-03T11:59:10.520" Title="How do I find the mappings between sedol and isin codes?" Tags="&lt;market-data&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14273" PostTypeId="2" ParentId="14272" CreationDate="2014-08-03T11:59:10.520" Score="2" Body="&lt;p&gt;Options:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;bloomberg terminal (if you have one or someone else at work does)&lt;/li&gt;&#xA;&lt;li&gt;Do you have the issuer names - could look around their websites where they typically list all reference names!&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="11717" LastActivityDate="2014-08-03T11:59:10.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14274" PostTypeId="1" AcceptedAnswerId="14309" CreationDate="2014-08-03T20:03:36.640" Score="5" ViewCount="1234" Body="&lt;p&gt;I am seeking to increase my knowledge in the quantitative finance field. I would be grateful if someone could point me to useful resource online, where I can find working examples of they types of applications built in Excel or Access, one can expect to find on a trading desk or in the middle office of a bank.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I already know how to program (C, C++, Python etc), but I want to familiarize myself with working applications - in preparation for interviews.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the event that no resources are forthcoming, I would be interested in hearing from practitioners, what types of applications (or tools), they construct using Excel, VBA, and/or access. It would be useful in terms of the required functionality of the tools, so that in the event that there are no suitable resources online, I can try to build the tools myself.&lt;/p&gt;&#xA;" OwnerUserId="1733" LastActivityDate="2017-09-02T07:57:18.360" Title="Resources for finding quantitative finance examples using excel, VBA and access" Tags="&lt;modeling&gt;&lt;finance&gt;&lt;excel&gt;&lt;vba&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14276" PostTypeId="1" AcceptedAnswerId="14278" CreationDate="2014-08-04T09:52:53.307" Score="0" ViewCount="1778" Body="&lt;p&gt;Even though dividends are discrete, literature often makes the assumption of continuous dividends (mostly in the case of indices but the individual stocks as well).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The dividend yield denoted by q is often considered as an adjustment to the risk free rate (i.e. r-q). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, what happens to American Call options if r-q &amp;lt; 0? Is it now possible to exercise before maturity so it can no longer be calculated as a European option? Logic says you can early exercise but I am not sure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some footnote: In discrete dividend case we know that we should only exercise American Calls before maturity if the excess value of the option is less than the dividend. Otherwise value of the American Option will always be greater than the exercise price. This is mainly due to r &gt; 0, and in the rare case of r &amp;lt; 0 American Puts become equivalent to European Puts.&lt;/p&gt;&#xA;" OwnerUserId="8147" LastActivityDate="2014-08-20T22:52:45.743" Title="What is the effect of dividend yield being greater than the risk-free rate to American options pricing?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;american-options&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14277" PostTypeId="2" ParentId="14274" CreationDate="2014-08-04T09:54:46.650" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://www.volopta.com&quot; rel=&quot;nofollow&quot;&gt;Volopta&lt;/a&gt; has some nice examples, but not always true. Their MATLAB GARCH code was not in line with Duan's specs.&lt;/p&gt;&#xA;" OwnerUserId="8147" LastActivityDate="2014-08-04T09:54:46.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14278" PostTypeId="2" ParentId="14276" CreationDate="2014-08-04T10:21:21.190" Score="4" Body="&lt;p&gt;I think that for any $q&amp;gt;0$ it becomes optimal to exercise an American call for a sufficiently high spot price $S$: if the spot increases enough, the dividend yield corresponds to sufficient cash dividend to render exercise optimal. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This would happen irrespective of the value of $r$ or the sign of $r-q$. What matters is that, for a given strike $K$, the price of a European call is of the order&#xA;$$&#xA;C \sim S\ e^{-qT}-K\ e^{-rT} \text{ for large }S&#xA;$$&#xA;as both cumulative Normals go to one. This can become negative for large enough $q$, even though $S&amp;gt;&amp;gt;K$. The holder of an American option would not allow for this intrinsic value to become negative, and therefore would exercise early.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2014-08-04T10:21:21.190" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14279" PostTypeId="2" ParentId="14226" CreationDate="2014-08-04T11:53:32.087" Score="0" Body="&lt;p&gt;Do you mean by cross sectional volatility that you take results from the returns of several assets?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course then volatility is different since you are averaging across returns.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For one asset, it is more useful to calculate volatility over time.  &lt;/p&gt;&#xA;" OwnerUserId="11721" LastActivityDate="2014-08-04T11:53:32.087" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14280" PostTypeId="1" CreationDate="2014-08-04T11:58:38.083" Score="3" ViewCount="367" Body="&lt;p&gt;I need to get some specific market data for my studies, and it seems like the most convenient way for me to do this is to use IQFeed data feed and MATLAB. But unfortunately, since I'm not a seasoned MATLAB user i can't put live data into an array in order to save them, while I'm listening to real time function.&lt;/p&gt;&#xA;" OwnerUserId="11720" LastEditorUserId="848" LastEditDate="2014-08-04T12:29:39.777" LastActivityDate="2018-12-27T16:39:47.230" Title="Handling IQFeed events in Matlab" Tags="&lt;matlab&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14281" PostTypeId="2" ParentId="9752" CreationDate="2014-08-04T12:22:19.150" Score="0" Body="&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/xE2o8.jpg&quot; alt=&quot;Time Series Returns Summary&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use the PerformanceAnalytics package , and get the following charts, Cumulative Returns, Daily Returns as well as Drawdown for understanding the time series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Code:&#xA;library(&quot;PerformanceAnalytics&quot;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;charts.PerformanceSummary(&#xA;    ROC(eq, n = 1, type = &quot;discrete&quot;),&#xA;    main = &quot;Returns (PerformanceAnalytice::charts.PerformanceSummary)&quot;&#xA;)&lt;/p&gt;&#xA;" OwnerUserId="11710" LastActivityDate="2014-08-04T12:22:19.150" CommentCount="0" CommunityOwnedDate="2014-08-04T12:22:19.150" ContentLicense="CC BY-SA 3.0" />
  <row Id="14282" PostTypeId="2" ParentId="14263" CreationDate="2014-08-04T12:31:37.123" Score="0" Body="&lt;p&gt;Backtesting, to me, necessarily involves testing against (realised) history of the securities under question. Wikipedia also seems to support this interpretation. &lt;a href=&quot;http://en.wikipedia.org/wiki/Backtesting&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Backtesting&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This history of the realised prices, of the securities under question, was generated by a certain pricing &quot;model&quot; or distribution.&#xA;If you test against a different hypothetical set of prices for the securities then its not backtesting. You are testing against a realisation of prices which might or might not occur in the future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my answer to your specific question is that pure backtesting (as opposed to in-sample, out-of-sample) methods might not ever completely guard against data snooping bias.&lt;/p&gt;&#xA;" OwnerUserId="11722" LastActivityDate="2014-08-04T12:31:37.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14283" PostTypeId="1" CreationDate="2014-08-04T12:57:01.573" Score="12" ViewCount="18860" Body="&lt;p&gt;Which R packages (in this list or not) do you use in quant finance, why not an alternative, do you use it in production and if so, how?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a list of most of the R packages related to Finance by Dirk Eddelbuettel: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://cran.r-project.org/web/views/Finance.html&quot;&gt;http://cran.r-project.org/web/views/Finance.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;FinancialInstrument&lt;/li&gt;&#xA;&lt;li&gt;RTAQ&lt;/li&gt;&#xA;&lt;li&gt;blotter&lt;/li&gt;&#xA;&lt;li&gt;quantstrat&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="11710" LastEditorUserId="4660" LastEditDate="2014-08-05T19:17:51.203" LastActivityDate="2014-08-06T21:04:13.430" Title="Popular R packages for Quantitative Finance" Tags="&lt;r&gt;&lt;quantitative&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="10" CommunityOwnedDate="2014-08-05T19:06:45.917" ContentLicense="CC BY-SA 3.0" />
  <row Id="14284" PostTypeId="1" AcceptedAnswerId="14290" CreationDate="2014-08-04T14:15:56.323" Score="3" ViewCount="312" Body="&lt;p&gt;What is the most concise way to learn about bond and interest rate models from the book Mathematical Models of Financial Derivatives by Yue-Kuen Kwok? I have studied Oksendals Stochastic Differential Equations and have read Option Theory with Stochastic Analysis by Benth, so am not starting completely from scratch. I also have the book Risk Neutral Valuation by Bingham and Kiesel if this could provide a more concise way.&lt;/p&gt;&#xA;" OwnerUserId="11723" LastEditorUserId="11723" LastEditDate="2014-08-04T18:28:53.517" LastActivityDate="2014-08-05T03:14:27.307" Title="Concise way of learning Bond &amp; IR models" Tags="&lt;interest-rates&gt;&lt;bond&gt;&lt;reference-request&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14285" PostTypeId="2" ParentId="14259" CreationDate="2014-08-04T14:30:09.603" Score="1" Body="&lt;p&gt;I don't think there is a correct answer to this question. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're trying to study short-term correlations (e.g., to construct short-term trading signals), then 1-month or 3-month rolling correlation of daily returns is a feasible option. These short-term stock/bond correlations are quite unstable though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, if you're studying long term secular trends, then you should use much longer windows. For example, Ilmanen showed charts of 5-year and 26-week stock-bond correlations when discussing the secular trends of bond risk premium. Here, the short story is that bond/stock correlation have been positive (positive in returns; negative if you use stock/yields) up until mid 1990s, and negative thereafter.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2014-08-04T14:30:09.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14286" PostTypeId="2" ParentId="14256" CreationDate="2014-08-04T15:35:23.533" Score="8" Body="&lt;p&gt;It's because of the settlement days you passed when you initialized the flat volatility curve. You're creating the spot, forward and flat volatilities as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;boost::shared_ptr&amp;lt;BlackVarianceSurface&amp;gt; volatilitySurface(&#xA;    new BlackVarianceSurface(todaysDate, calendar,&#xA;                             maturityArray, strikeArray,&#xA;                             volatilityMatrix, dayCounter));&#xA;&#xA;boost::shared_ptr&amp;lt;BlackVolTermStructure&amp;gt; forwardVolSurface(&#xA;    new ImpliedVolTermStructure(volatilitySurfaceH, forwardDate));&#xA;&#xA;boost::shared_ptr&amp;lt;BlackVolTermStructure&amp;gt; flatVolCurve(&#xA;      new BlackConstantVol(settlementDays, calendar,&#xA;                           forwardVolSurface-&amp;gt;blackVol(expiry3, 3300),&#xA;                           dayCounter)));&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(the first two are verbatim from your code; in the last one, I joined your call to retrieve the volatility in &lt;code&gt;main&lt;/code&gt; to the constructor call in &lt;code&gt;EurVanillaPricer&lt;/code&gt;). In the last one, you've set &lt;code&gt;settlementDays&lt;/code&gt; to 3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, the forward and flat curve have the same volatility for the exercise and strike you specified; if you execute&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;std::cout &amp;lt;&amp;lt; forwardVolSurface-&amp;gt;blackVol(expiry3, 3300) &amp;lt;&amp;lt; std::endl;&#xA;std::cout &amp;lt;&amp;lt; flatVolTS-&amp;gt;blackVol(expiry3, 3300) &amp;lt;&amp;lt; std::endl;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;you'll get back&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;0.132405&#xA;0.132405&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;that is, the same. But that's not the whole story, unfortunately. The pricing engine for the European option doesn't ask them for the volatility , but directly for the variance ($\sigma^2 T$). If you do that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;std::cout &amp;lt;&amp;lt; forwardVolSurface-&amp;gt;blackVariance(expiry3, 3300) &amp;lt;&amp;lt; std::endl;&#xA;std::cout &amp;lt;&amp;lt; flatVolTS-&amp;gt;blackVariance(expiry3, 3300) &amp;lt;&amp;lt; std::endl;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;you'll get back different figures:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;0.00710851&#xA;0.00686836&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why? Because the two curves have different reference dates:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;std::cout &amp;lt;&amp;lt; forwardVolSurface-&amp;gt;referenceDate() &amp;lt;&amp;lt; std::endl;&#xA;std::cout &amp;lt;&amp;lt; flatVolTS-&amp;gt;referenceDate() &amp;lt;&amp;lt; std::endl;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;gives&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;July 24th, 2014&#xA;July 29th, 2014&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the constructor of &lt;code&gt;forwardVolSurface&lt;/code&gt;, you're passing the reference date directly: it's &lt;code&gt;forwardDate&lt;/code&gt;, which you also set as the evaluation date. In the constructor of &lt;code&gt;flatVolTS&lt;/code&gt;, you're passing &lt;code&gt;settlementDays&lt;/code&gt; and &lt;code&gt;calendar&lt;/code&gt;, which equal &lt;code&gt;3&lt;/code&gt; and &lt;code&gt;TARGET()&lt;/code&gt;, respectively. This means that the reference date is three business days after the evaluation date, which turns out to be 5 days after when you factor in the weekend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, when the two curves calculate the variance $\sigma^2 T$, the volatility $\sigma$ is the same; but for the first curve, $T$ is the time between July 24th and the expiry, while for the second curve $T$ is the time between July 29th and the expiry and is 5 days shorter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To solve your problem, just pass &lt;code&gt;0&lt;/code&gt; as &lt;code&gt;settlementDays&lt;/code&gt; when you create the flat curve. It will have the same reference date as the forward curve, and the option prices will be the same. (This doesn't need to be the same as the settlement days you pass to the risk-free and dividend curves.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note 1: In general, it might not be a good idea to pass a non-null number of settlement days to a volatility term structure (I hope that's not too many negatives) (darn, I did it again). The possibility to have settlement days is there because it was inherited from the base &lt;code&gt;TermStructure&lt;/code&gt; class and we didn't think to restrict it, but it was added mostly for interest-rate curves where one might want to work spot (i.e., two days from today, which is the settlement date of most quoted interest-rate instruments). For equities, you probably want to start from the evaluation date anyway.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note 2: the various ways to initialize term structures and how they work are explained in more detail at &lt;a href=&quot;http://www.implementingquantlib.com/2013/09/chapter-3-part-1-of-n-term-structures.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.implementingquantlib.com/2013/09/chapter-3-part-1-of-n-term-structures.html&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="308" LastEditorUserId="11726" LastEditDate="2017-06-27T20:52:07.590" LastActivityDate="2017-06-27T20:52:07.590" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="14287" PostTypeId="2" ParentId="14259" CreationDate="2014-08-04T16:37:07.440" Score="1" Body="&lt;p&gt;My opinion is that using rolling correlations of returns which themselves are computed over rolling windows is not reliable. Taking rolling windows smothers information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, I would specify a simple EWMA filter for the variances and the covariance, which would give me a value for the spot correlation. For example something like&#xA;$$&#xA;\begin{align}&#xA;\sigma^2_{SPX;t+1} &amp;amp;= \lambda\ \sigma^2_{SPX;t} + (1-\lambda)\ r^2_{SPX;t}\\&#xA;\sigma^2_{TBILL;t+1} &amp;amp;= \lambda\ \sigma^2_{TBILL;t} + (1-\lambda)\ r^2_{TBILL;t}\\&#xA;\sigma_{SPX,TBILL;t+1} &amp;amp;= \lambda\ \sigma_{SPX,TBILL;t} + (1-\lambda)\ r_{SPX;t}\ r_{TBILL;t}\\&#xA;\rho_{SPX,TBILL;t} &amp;amp;= \frac{\sigma_{SPX,TBILL;t}}{\sqrt{\sigma2_{SPX;t}\ \sigma^2_{TBILL;t}}}&#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;RiskMetric apply $\lambda=0.94$ for daily data and $\lambda=0.97$ for monthly data. If you are feeling more adventurous, you can specify a multivariate Garch model and estimate it. For $\lambda=0.94$ I get the volatility and correlation paths below. This are 'spot' (that is to say 'instantaneous') values. If you want a longer term correlation then you can project using some exponential decay.&#xA;&lt;img src=&quot;https://i.stack.imgur.com/4Vpm4.png&quot; alt=&quot;EWMA Volatility and Correlation paths&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or for the interval you specified in your charts.&#xA;&lt;img src=&quot;https://i.stack.imgur.com/1Y7re.png&quot; alt=&quot;EWMA Volatility and Correlation paths&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2014-08-04T16:57:24.200" LastActivityDate="2014-08-04T16:57:24.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14288" PostTypeId="1" CreationDate="2014-08-04T17:40:58.470" Score="0" ViewCount="643" Body="&lt;p&gt;A constant range bar chart is like a candle chart, only the candles don't close after a certain amount of time (i.e. 30 min, 4 hours), but after a certain range (i.e. 5 ticks) has been crossed. So if you don't have a lot of up or down movement during a long period of time, no new candles are created. A bit like Kase bars or momentum bars:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/BpMXK.jpg&quot; alt=&quot;Ticks on the left, Constant Range Bars on the right&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have tick data, and you want to create a constant range bar chart from that, which criterion/method/formula will result in the range bar chart that is the most trending/persistent/smooth? By persistent I mean that up bars are generally followed by another up bar and down bars are generally followed by another down bar. It's probably related to some measure of volatility and some local price &quot;structure&quot; measurement.. Or comparing the range over 1 window to the range over a window of different length or something.. Thanks for your suggestion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally it should work in real time.&lt;/p&gt;&#xA;" OwnerUserId="659" LastEditorUserId="659" LastEditDate="2014-08-04T17:48:23.147" LastActivityDate="2014-08-04T17:48:23.147" Title="Which size of constant range bar gives the most persistent chart?" Tags="&lt;tick-data&gt;&lt;local-volatility&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14289" PostTypeId="1" AcceptedAnswerId="14321" CreationDate="2014-08-04T19:52:42.830" Score="9" ViewCount="638" Body="&lt;p&gt;I'm looking to learn about gas price modeling, in particular models of forward prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've studied &quot;classical&quot; mathematical finance, fixed income theory etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are good references for stylized facts about gas modeling, successful models and mathematical finance in gas pricing. I am also interested in the estimation part. In all cases particular, but not restricted to forward price modeling.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastEditorUserId="467" LastEditDate="2014-12-07T13:18:33.223" LastActivityDate="2014-12-07T13:18:33.223" Title="How to model natural gas forward price?" Tags="&lt;commodities&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14290" PostTypeId="2" ParentId="14284" CreationDate="2014-08-05T03:14:27.307" Score="4" Body="&lt;p&gt;I haven't read Yue-Kuen Kwok's book, so it's hard for me to comment on it. Based on my personal experience, I'd recommend the following literature, depending on what you're trying to accomplish:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're on the quant-path, I think a lot of practitioners would recommend&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/3540221492&quot; rel=&quot;nofollow&quot;&gt;Interest Rate Models – Theory and Prctice&lt;/a&gt; (Damiano Brigo &amp;amp; Fabio Mercurio): This is a very heavy book, but it covers a lot of material. Also if you only care about term structure modeling, you really just need to go over a few chapters. The book is extremely well written – easy to follow, concise, and full of examples.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Andersen &amp;amp; Piterbarg's &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0984422102&quot; rel=&quot;nofollow&quot;&gt;Interest Rate Modeling&lt;/a&gt;: These three volumes are better kept as references, but they're very detailed and discuss some of the latest developments in term structure modeling (e.g., multi curve construction techniques).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you're looking for a less rigorous treatment of the material, I'd recommend&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470109106&quot; rel=&quot;nofollow&quot;&gt;Fixed Income Securities: Valuation, Risk, and Risk Management&lt;/a&gt; (Pietro Veronesi): A few of my friends who did MFE programs used this book as their FI textbook; I read through it very quickly. It has a lot of typos..., but overall, it's still an excellent book. Much much easier to follow then the two above, but full of examples and real life applications.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Finally, I'd also recommend&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470891696&quot; rel=&quot;nofollow&quot;&gt;Fixed Income Securities: Tools for Today's Markets&lt;/a&gt; (Bruce Tuckman): There's a third edition now, but I much prefer the 2nd edition. The 2nd edition doesn't discuss models such as the Libor market model, but from a pedagogical perspective, it's much better written. The strength of the book is that it goes over a lot of market conventions that other books tend to ignore – and in real life trading, these details are exceptionally important. The trading examples are really well explained. If you're trying to gain perspectives on how practitioners (traders &amp;amp; strats) think about the market, this book is a must-read in my opinion. However, this is the least rigorous of the books I'm listing here, and doesn't go into the details of term structure modeling. It does provide lots of intuitions behind the models, so it makes a nice complement to other books.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2014-08-05T03:14:27.307" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14291" PostTypeId="1" CreationDate="2014-08-05T05:59:55.783" Score="0" ViewCount="335" Body="&lt;p&gt;I am interested to find historical news (if any) associated with intraday volatility burst in a particular ETFs like ishares IYF (Financials). So say that between 12:00 - 12:10pm, the ETF IYF's stock price is abnormally volatile. What would you suggest is the best database to search the news (if any) associated with this burst in volatility for this particular ETF?&lt;/p&gt;&#xA;" OwnerUserId="2570" LastActivityDate="2019-01-11T14:39:12.490" Title="News on ETF sector performance" Tags="&lt;data&gt;&lt;etf&gt;&lt;news&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14292" PostTypeId="2" ParentId="14270" CreationDate="2014-08-05T08:55:26.387" Score="0" Body="&lt;p&gt;&quot;I think we need to find the proportion of bond D that will make the overall duration 0&quot; ... by doing so, you will be matching the duration of bond D, because it has the shortest one. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to immunize portfolio, you should have some benchmark duration you want to match. If it is the one of bond D, than your suggestion is right.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I am wrong, please, correct me somebody.&lt;/p&gt;&#xA;" OwnerUserId="11730" LastActivityDate="2014-08-05T08:55:26.387" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14293" PostTypeId="2" ParentId="11225" CreationDate="2014-08-05T10:57:33.073" Score="2" Body="&lt;p&gt;I would say that you can use Johansens methods to test for rank of co-integration matrix. There are tests for that. If there is no co-integration vector present and both series are I(0) then there is no co-integration. Series still might have some short-run dynamics. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If series are I(1) and no con-integration vector is present then modeling these series by their levels and not differences can cause spurious regressions.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If series are I(1) and their co-integration matrix has reduced rank then they have one co-integration relation. &lt;/p&gt;&#xA;" OwnerUserId="11721" LastActivityDate="2014-08-05T10:57:33.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14294" PostTypeId="1" AcceptedAnswerId="14349" CreationDate="2014-08-05T12:49:38.813" Score="4" ViewCount="184" Body="&lt;p&gt;Say I issue insurance contracts covering fire damage in personal households. Fires occur with a probability of $x$% in a household (and they obviously occur independently from one another). If the potential repair after a fire costs $P$ \$, then the fair value of such an insurance contract would be $x\%\cdot P$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now with CDS we can't really apply this principle, because if the reference entity defaults, then everybody that holds a CDS on this entity will get paid out, i.e. the risk accumulates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I right in assuming that this is indeed a real issue? If not, what is wrong with my reasoning. But if so, how is this issue circumvented in practice?&lt;/p&gt;&#xA;" OwnerUserId="6621" LastActivityDate="2016-08-20T16:44:20.787" Title="CDS - Accumulated Default Risk?" Tags="&lt;credit&gt;&lt;credit-risk&gt;&lt;cds&gt;&lt;structured-credit&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14295" PostTypeId="2" ParentId="14291" CreationDate="2014-08-05T14:45:40.697" Score="1" Body="&lt;p&gt;Briefing.com has an api and ravenpack has data as well to find news for stocks that are members of indices.   &lt;/p&gt;&#xA;" OwnerUserId="1368" LastActivityDate="2014-08-05T14:45:40.697" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14296" PostTypeId="2" ParentId="10519" CreationDate="2014-08-05T18:05:29.177" Score="1" Body="&lt;p&gt;I want to highlight the “digital signal processing” (DSP) block with ALUs. Today’s FPGAs have hundreds of programmable DSP blocks – the very largest having thousands. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, suddenly, you have thousands of small processors at your disposal, all able to perform calculations in parallel. This is vastly in excess of parallelism provided by the Xeon Phi or GPUs. In fact, if you’re doing options price modelling or stochastic risk modelling on FPGA, you can get more than 100-fold increase in performance compared to the latest GPUs and even more compared to the latest CPUs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Along with the DSP blocks, the other major factor in this performance gain is the memory cache. FPGA has built-in distributed RAM that is extremely fast, allowing bandwidth of 100TB/s to be achieved at datapath level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using today’s FPGAs for algo strategies gives large and massively concurrent compute resource that is able to give 100 to 1000 fold increase in performance compared to GPUs or CPUs. The main caveat is that you would have to become proficient in writing in Verilog or VHDL :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sanjay Shah&#xA;CTO&#xA;Nanospeed&lt;/p&gt;&#xA;" OwnerUserId="11732" LastActivityDate="2014-08-05T18:05:29.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14297" PostTypeId="1" AcceptedAnswerId="14298" CreationDate="2014-08-05T18:06:32.460" Score="10" ViewCount="1616" Body="&lt;p&gt;What book should I start with in order to learn about the mathematics behind financial (derivatives I think!) trading that would be used in HF's &amp;amp; IB's (Not sure whether there would be a difference).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a strong background in mathematics particularly with regard to measure theory, probability theory and stochastic calculus having studied Rana, Kai-Lee Chung &amp;amp; Oksendals famous texts on these subjects. I also have a strong knowledge of partial differential equations. (Not sure what other areas of mathematics would be useful?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for the most concise and quickest way to teach myself about the core mathematics and ideas behind quantative finance.&lt;/p&gt;&#xA;" OwnerUserId="11723" LastActivityDate="2014-08-06T15:33:48.237" Title="Starting mathematics reading for quants" Tags="&lt;reference-request&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="4" CommunityOwnedDate="2014-08-06T08:16:19.737" ContentLicense="CC BY-SA 3.0" />
  <row Id="14298" PostTypeId="2" ParentId="14297" CreationDate="2014-08-05T18:35:45.860" Score="4" Body="&lt;p&gt;I would consider:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Wilmott, P., Paul Wilmott on Quantitative Finance 3 Volume Set&lt;/li&gt;&#xA;&lt;li&gt;Hull, J. C., Options, Futures and Other Derivatives&lt;/li&gt;&#xA;&lt;li&gt;Baxter, M. &amp;amp; Rennie, A., Financial Calculus: An Introduction to Derivative Pricing&lt;/li&gt;&#xA;&lt;li&gt;McNeil, A. et al, Quantitative Risk Management: Concepts, Techniques and Tools&lt;/li&gt;&#xA;&lt;li&gt;Brigo, D. &amp;amp; Mercurio, F., Interest Rate Models - Theory and Practice&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;for $\mathbb{Q}$-type introductory reading. On the $\mathbb{P}$-side, it depends what you're looking for - volatility trading, interest rates, $\Delta1$, cash products, risk management, market models, numerical techniques, data-driven techniques etc.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2014-08-05T18:35:45.860" CommentCount="10" CommunityOwnedDate="2014-08-06T08:16:19.737" ContentLicense="CC BY-SA 3.0" />
  <row Id="14299" PostTypeId="1" CreationDate="2014-08-05T19:43:01.547" Score="4" ViewCount="1063" Body="&lt;p&gt;I have been trying to wrap my head around Engel-Granger test and jcitest etc. I have failed thus far. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If possible can someone guide me about which books to start with and possibly reach to understanding these types of tests and modelling based on the same?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please one book (or sequence of books) to study per answer.&lt;/p&gt;&#xA;" OwnerUserId="7816" LastEditorUserId="848" LastEditDate="2014-08-06T09:22:58.057" LastActivityDate="2018-11-08T14:50:38.593" Title="Book recommendation for time series analysis" Tags="&lt;time-series&gt;&lt;statistics&gt;" AnswerCount="6" CommentCount="3" FavoriteCount="1" CommunityOwnedDate="2014-08-06T09:22:58.057" ContentLicense="CC BY-SA 3.0" />
  <row Id="14300" PostTypeId="1" CreationDate="2014-08-05T19:49:46.297" Score="2" ViewCount="2172" Body="&lt;p&gt;I just performed a Johansen Co-integration test on two stocks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The results I get are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ans = &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;      r0       r1   &#xA;t1    true     false&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am using Matlab. Can someone interpret these for me?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I have understood the test properly, they are a good correlated pair. With Mean reversion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are they mean reverting?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I have read about stationary pairs but the technical definition is a bit confusing. If possible can someone help point me in the direction to a simpler explanation? Or may be a book to start off?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Did the test again with the following result:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt; [h,pValue,stat,cValue,mles] = jcitest(Y)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Results Summary (Test 1)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Data: Y&#xA;Effective sample size: 229&#xA;Model: H1&#xA;Lags: 0&#xA;Statistic: trace&#xA;Significance level: 0.05&#xA;&#xA;r  h  stat      cValue   pValue   eigVal   &#xA;========================================&#xA;0  0  9.6981    15.4948  0.3467   0.0411  &#xA;1  0  0.0979    3.8415   0.7872   0.0004  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;h = &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;      r0       r1   &#xA;t1    false    false&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;pValue = &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;      r0         r1     &#xA;t1    0.34672    0.78721&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;stat = &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;      r0        r1      &#xA;t1    9.6981    0.097852&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;cValue = &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;      r0        r1    &#xA;t1    15.495    3.8415&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;mles = &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;      r0              r1          &#xA;t1    [1x1 struct]    [1x1 struct]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I am trying to understand whether h=0 implies no cointegration?&#xA;What exactly does the pValue tell us?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short still trying to understand how exactly to interpret the results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will get onto generating the eigenvalues. And trying to understand them after this part gets clear. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't have the advantage of attending school at the moment and understanding this is very difficult.&lt;/p&gt;&#xA;" OwnerUserId="7816" LastEditorDisplayName="user13444" LastEditDate="2015-04-04T07:52:05.807" LastActivityDate="2017-05-26T11:32:55.540" Title="Johansen Cointegration Test" Tags="&lt;cointegration&gt;&lt;matlab&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14301" PostTypeId="2" ParentId="14300" CreationDate="2014-08-05T21:04:10.293" Score="1" Body="&lt;p&gt;Assuming you're using &lt;a href=&quot;http://www.mathworks.com/help/econ/jcitest.html&quot; rel=&quot;nofollow&quot;&gt;http://www.mathworks.com/help/econ/jcitest.html&lt;/a&gt;, there is 1 cointegrating relationship. The function can also output p-values.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2014-08-05T21:04:10.293" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14302" PostTypeId="2" ParentId="10519" CreationDate="2014-08-06T00:42:37.917" Score="1" Body="&lt;p&gt;A variety of powerful, many-core processors are beginning to make their way into the the hardware acceleration space that was previously completely &quot;owned&quot; by FPGAs. Companies like Tilera, Adapteva, and Coherent Logix all provide these processors here in the US, with Enyx from France also making inroads.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The true measure of effectiveness of these massively parallel processors lies in the maturity of their software tools. That's where the prospective user should focus their attention. Nobody wants to program or debug tens or hundreds of cores using manual techniques. Of course, it goes without saying that I/O bandwidth is as important.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my personal experience in this space I'm seeing customer adoption of Coherent Logix processors as co-processors or hardware accelerators for C-language algo acceleration. By enjoying the rapid design cycle of a C based environment, algo programmers can tweak code to their hearts content and not worry about costly and time intensive HDL coding for FPGAs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The optimal partitioning is to have FPGAs do what they do best - fixed repetitive operations - and have many-core processors do what they do best: accelerate algo developers productivity and execution speed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;John Irza, Business Development Manager, Coherent Logix, Inc.&lt;/p&gt;&#xA;" OwnerUserId="11735" LastActivityDate="2014-08-06T00:42:37.917" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14303" PostTypeId="2" ParentId="3158" CreationDate="2014-08-06T04:20:41.713" Score="3" Body="&lt;p&gt;I would recommend performing visualization intensive tasks and UIs on a separate front-end, given R and Matlab are not optimized to efficiently render charts and other visualizations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are able to run WPF/Silverlight apps on your machine I can highly recommend SciChart (&lt;a href=&quot;http://www.scichart.com/&quot; rel=&quot;nofollow&quot;&gt;http://www.scichart.com/&lt;/a&gt;). It fulfills all your stated requirements. The library is targeting C#/WPF but I would imagine it to work well with Visual Basic or other .Net languages as well. Before proceeding I recommend to check out the Silverlight demo (no download or registration required) at &lt;a href=&quot;http://www.scichart.com/Abt.Controls.SciChart.SL.ExampleTestPage.html#/Abt.Controls.SciChart.Example;component/HomeControl.xaml&quot; rel=&quot;nofollow&quot;&gt;SciChart Demo&lt;/a&gt;. I have extensively tested the library and now use it for a project and it fulfills all my requirements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding your requirements:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Zoom and scroll -&gt; Is built in and works out of the box, you can either approach this issue through code-behind or set and customize properties and functionality within xaml (preferred). &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Add vertical/horizontal/... lines -&gt; can be easily done. I see annotation features added with each new release, however, the current library already offers extensive annotation capabilities. Take a look at the following (&lt;a href=&quot;http://www.scichart.com/annotations-are-easy/&quot; rel=&quot;nofollow&quot;&gt;http://www.scichart.com/annotations-are-easy/&lt;/a&gt;, and &lt;a href=&quot;http://www.scichart.com/questions/question/multiple-rollover-modifiers-mvvm&quot; rel=&quot;nofollow&quot;&gt;http://www.scichart.com/questions/question/multiple-rollover-modifiers-mvvm&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Compute performances between points -&gt; Not sure what you mean with that but if my assumption is correct then you can compute relative performance measures and generate a separate data series and render that because the axes are fully customizable. If you are referring to something different then please elaborate. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Add technical indicators -&gt; You can add any data or time series that you desire. Technical indicators are not provided out-of-the-box but I recommend to always compute such metric on your own and simply use as data source to build a data series and render it on a chart. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Possibility to export the graph to the clipboard -&gt; Not only that, but you can easily print or save charts in various formats as well. You can also easily store the specific template used for the chart as well as settings used so the next time you load the front-end your visualization settings will be restored. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I want to point out where this library shines in comparison to other libraries but also where I see room for improvement:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Maybe the strongest feature of SciChart is performance. Rendering millions of data points on a scatter plot, line chart, stock (OHLC) chart, and multiple other chart styles is not only high performant but also extremely simple to accomplish. I only know of one other library that plays in SciChart's performance league. I use this library to visualize tick-based bid/offer time-series data and I can render 5 million data points (I heard of guys who tried to render tens of millions of data points and accomplished such) and scroll, pan, and zoom at very satisfactory framerates. It lets me essentially zoom and magnify the time series to individual data points, the Date/Time axis can be customized to display millisecond or even higher resolution time stamps (something that could not be done with various other libraries when I tested them). &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The library does not come free but the cost to acquire a license is reasonable in comparison with other libraries. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Through xaml and the ability to derive from certain base classes and very well designed bindability the styling and customization of annotations, axis types and labels, chart types, renderable series types, panes, synchronization of multiple charts, mouse/keyboard interactivity, among others can be accomplished without much effort. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I found the response time as well as quality of response of the support staff to be exquisite. I poked a lot of questions at staff and raised a number of support tickets at the beginning and I was generally attended to within 24 hours. That was even when I test trialed the product. Several questions only came up because I had very specific requirements about an issue regarding multiple chart panes.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;While well tested, and apparently quite well received by developers at some financial institutions and apparently extensively used by scientists who require high performing visualization capabilities, the library is still a pretty recent venture. It may not offer the same quantity of content on its support forum as those who have been around for a decade or so longer, but again I found it pleasant to interact with support staff who was responsive and helped with certain details. So, immature is probably not the right term because it runs absolutely stable in production, but it is not the most mature library out there.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The library specializes in high performance charting for WPF/Silverlight and does its job excellently, however, it does not offer other controls such as diagrams, dashboard controls, list or textbox controls. I myself prefer to always work with the best that my budget can buy and use this library for charting, only. Other vendors shine in other categories and I can appreciate that. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In summary, I had very similar requirements as the ones you stated and this library did and still does a fantastic job at targeting my requirements. I use one chart implementation for high frequency data visualizations and another, which I styled very similarly to the Bloomberg chart library for overall low frequency price/volume time series visualization. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Disclosure: I at some point received non-monetary compensation in exchange for rendering a service to SciChart. But I believe this recommendation/review is biased only in that I truly believe in the quality of this library and the people supporting it because I myself extensively tested and now use it and found it to be meeting all my time series visualization requirements.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2014-08-06T04:30:49.643" LastActivityDate="2014-08-06T04:30:49.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14304" PostTypeId="2" ParentId="14297" CreationDate="2014-08-06T10:40:01.667" Score="5" Body="&lt;p&gt;Introductory:&#xA;&quot;Introduction to the Mathematics of Financial Derivatives&quot;; Salih Neftci&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More mathematical:&#xA;&quot;Stochastic Calculus for Finance I and II&quot;; Steven Shreve&lt;/p&gt;&#xA;" OwnerUserId="11722" LastActivityDate="2014-08-06T10:40:01.667" CommentCount="2" CommunityOwnedDate="2014-08-06T10:40:01.667" ContentLicense="CC BY-SA 3.0" />
  <row Id="14305" PostTypeId="1" CreationDate="2014-08-06T14:06:44.430" Score="2" ViewCount="49" Body="&lt;p&gt;Please correct me if I am wrong in understanding the Immunisation Technique behind bond interest rate risk management. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It says that any change in interest rate can be neutralised by reinvesting the coupons at increased interest rate or if there is a decrease then the price rise in bond will compensate for reinvestment loss. All this can happen till the duration of the bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this is true, is there a mathematical proof of this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="9430" LastActivityDate="2014-08-06T14:06:44.430" Title="Formal Proof of Immunization Techniqu" Tags="&lt;risk&gt;&lt;interest&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14306" PostTypeId="2" ParentId="14297" CreationDate="2014-08-06T14:36:44.820" Score="3" Body="&lt;p&gt;I would suggest to start with one of the coursera course, &lt;em&gt;Mathematical Methods for Quantitative Finance&lt;/em&gt;. It's an introductory course on mathematical concepts that can be applied in finance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Books:&lt;/strong&gt;&#xA;1) A Primer for Mathematics of Financial Engineering.&#xA;2) Paul Wilmott on Quantitative Finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, check out this article on Quantnet: &lt;a href=&quot;https://www.quantnet.com/threads/master-reading-list-for-quants-mfe-financial-engineering-students.535/&quot; rel=&quot;nofollow&quot;&gt;Master Reading list for Financial Engineering Students&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this helps you. &lt;/p&gt;&#xA;" OwnerUserId="11740" LastEditorUserId="11740" LastEditDate="2014-08-06T15:33:48.237" LastActivityDate="2014-08-06T15:33:48.237" CommentCount="0" CommunityOwnedDate="2014-08-06T14:36:44.820" ContentLicense="CC BY-SA 3.0" />
  <row Id="14307" PostTypeId="2" ParentId="14299" CreationDate="2014-08-06T14:47:22.370" Score="8" Body="&lt;p&gt;I would suggest &lt;em&gt;Time Series Analysis&lt;/em&gt; by James Douglas Hamilton&lt;/p&gt;&#xA;" OwnerUserId="11740" LastActivityDate="2014-08-06T14:47:22.370" CommentCount="0" CommunityOwnedDate="2014-08-06T14:47:22.370" ContentLicense="CC BY-SA 3.0" />
  <row Id="14308" PostTypeId="2" ParentId="8875" CreationDate="2014-08-06T17:34:57.220" Score="0" Body="&lt;p&gt;Non-Stationary process can be analyzed and there are various models available that can be used .  For example,  Autoregressive Integrated Moving Average model (ARIMA) models are used to explain homogeneous non-stationary models as well as random walk with drift can be used for explaining several such series. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;have a look at this link : &lt;a href=&quot;http://sfb649.wiwi.hu-berlin.de/fedc_homepage/xplore/tutorials/xegbohtmlnode37.html&quot; rel=&quot;nofollow&quot;&gt;http://sfb649.wiwi.hu-berlin.de/fedc_homepage/xplore/tutorials/xegbohtmlnode37.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11710" LastActivityDate="2014-08-06T17:34:57.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14309" PostTypeId="2" ParentId="14274" CreationDate="2014-08-06T19:58:56.357" Score="2" Body="&lt;p&gt;In terms of end-user applications, all trading desks and middle office places I know, use either their own proprietary or expensive third party sources.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand there exists a c++ library called QuantLib that is well known among real world practitioners, probably because it contains several routines that are well tested and robust. Often pieces of this library are &quot;copied and pasted&quot; into the otherwise &quot;proprietary&quot; company's software.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you are looking for free access to public domain software, I would therefore suggest you take a look at &lt;a href=&quot;http://quantlib.org/index.shtml&quot; rel=&quot;nofollow noreferrer&quot;&gt;quantlib&lt;/a&gt;.&#xA;If you are more interested towards end-user spreadsheet-based analysis for yield curve building and option pricing, you may find the freeware &lt;a href=&quot;https://www.deriscope.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;deriscope&lt;/a&gt; to be a user-friendly, wizard-based interface to the QuantLib's algorithms, but I guess my last advice is unavoidably skewed due to my personal involvement with  Deriscope's development. &lt;/p&gt;&#xA;" OwnerUserId="11676" LastEditorUserId="-1" LastEditDate="2017-09-02T07:57:18.360" LastActivityDate="2017-09-02T07:57:18.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14310" PostTypeId="1" CreationDate="2014-08-06T21:00:16.883" Score="3" ViewCount="537" Body="&lt;p&gt;If i have a portfolio of stocks from different currencies and i want to generate a correlation matrix from the stocks, how is the correct procedure ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Imagine a portfolio which the base currency is Brazilian Reais (BRL) and i have stocks quoted in BRL, EUR and USD. The correct way to generate a correlation matrix is :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) Use the returns on the stocks in each currency and generate the matrix&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) Adjust all returns to the portfolio base currency and then generate the matrix&lt;/p&gt;&#xA;&#xA;&lt;p&gt;c) Other Solution&lt;/p&gt;&#xA;" OwnerUserId="9257" LastEditorUserId="16160" LastEditDate="2018-04-11T15:02:03.837" LastActivityDate="2018-11-13T20:38:46.417" Title="Stock Correlation Matrix, Multiple Currencies" Tags="&lt;correlation&gt;&lt;fx&gt;&lt;correlation-matrix&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14311" PostTypeId="2" ParentId="14283" CreationDate="2014-08-06T21:04:13.430" Score="2" Body="&lt;p&gt;I like Quantlib &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://quantlib.org/index.shtml&quot; rel=&quot;nofollow&quot;&gt;http://quantlib.org/index.shtml&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://cran.r-project.org/web/packages/RQuantLib/index.html&quot; rel=&quot;nofollow&quot;&gt;http://cran.r-project.org/web/packages/RQuantLib/index.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The QuantLib project is aimed at providing a comprehensive software framework for quantitative finance. QuantLib is a free/open-source library for modeling, trading, and risk management in real-life.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;QuantLib is written in C++ with a clean object model, and is then exported to different languages such as C#, Objective Caml, Java, Perl, Python, GNU R, Ruby, and Scheme. The QuantLibAddin/QuantLibXL project uses ObjectHandler to export an object-oriented QuantLib interface to a variety of end-user platforms including Microsoft Excel and OpenOffice.org Calc. Bindings to other languages and porting to Gnumeric, Matlab/Octave, S-PLUS/R, Mathematica, COM/CORBA/SOAP architectures, FpML, are under consideration. &lt;/p&gt;&#xA;" OwnerUserId="9257" LastActivityDate="2014-08-06T21:04:13.430" CommentCount="0" CommunityOwnedDate="2014-08-06T21:04:13.430" ContentLicense="CC BY-SA 3.0" />
  <row Id="14312" PostTypeId="2" ParentId="14005" CreationDate="2014-08-06T21:10:48.440" Score="1" Body="&lt;p&gt;The fundamental theorem of mathematical finance states that under the assumption of no arbitrage (which is by the way an idealization and not possible in the real world), a probability measure exists under which all &quot;relative asset prices&quot; are martingales.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is meant by &quot;relative asset prices&quot; is the asset prices divided by the price of one particular selected asset being referred as &quot;numeraire&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So H01 is incorrect on two grounds:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) The &quot;stock price&quot; is universally defined as the number of currency units required to buy one unit of the referred stock. This is in no way a ratio of any two asset prices and therefore does not qualify as a &quot;relative asset price&quot;. Note here a &quot;currency&quot; itself is not considered an &quot;asset&quot; in mathematical finance&quot;. A bank account where such a currency is deposited is considered an &quot;asset&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Any statement of the form: &quot;A stochastic process X is a martingale&quot; is meaningless if the underlying probability measure is left unspecified. In the stated hypothesis H01, X stands for the stock price. The correct statement would instead be &quot;The stock price (divided by the numeraire) is a martingale with respect to a particular probability measure, called the &quot;risk neutral measure&quot;. In the quite different &quot;real world measure&quot; the relative stock price exhibits a positive drift, which compensates the risk averse investors for assuming increased risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similar comments apply to H02.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, I have just looked at the mentioned paper &lt;a href=&quot;http://www.principlesofforecasting.com/files/pdf/Granger-stockmarket.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.principlesofforecasting.com/files/pdf/Granger-stockmarket.pdf&lt;/a&gt; and I could not spot any reference to the measure being used. This indicates lack of mathematical maturity since it is a well known fact (see Girsanov theorem) that by changing the measure one may achieve any drift. In other words, the &quot;martingale property&quot; is measure-dependent. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make matters even worse, the paper's context seems to imply that all equations refer to the &quot;real world measure&quot;. If this is indeed the case, then it is ludicrous to state that stock prices are martingales, since almost nothing - save for dice and fair coin tosses - behaves as martingale in the real world!&lt;/p&gt;&#xA;" OwnerUserId="11676" LastEditorUserId="11676" LastEditDate="2014-08-07T12:11:39.237" LastActivityDate="2014-08-07T12:11:39.237" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14314" PostTypeId="1" AcceptedAnswerId="14361" CreationDate="2014-08-07T05:32:14.230" Score="4" ViewCount="490" Body="&lt;p&gt;I'm reading Leif Andersen's &quot;Interest Rate Modeling, vol 2 Term Structure Models&quot; and met a problem on Chapter 14 LM Dynamics and Measures, $\S$ 14.2.5 Stochastic Volatility, Lemma 14.2.6, on page 602.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Before the lemma&lt;/strong&gt; the stochastic volatility LMM model was defined in spot measure $Q^B$ (numeraire is the discrete banking account $B(t)=P(t,T_{q(t)}) \prod \limits _{n=0} ^{q(t)-1} \left(1+\tau_nL_n(T_n)\right)$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dz(t) = \theta (z_0-z(t)) dt + \eta \psi(z(t)) dZ(t), \quad z(0) = z_0 \tag{14.15}$$&#xA;$$dL_n(t) = \sqrt{z(t)} \varphi(L_n(t)) \lambda_n(t)^\top \left(\sqrt{z(t)} \mu_n(t) dt + dW^B(t) \right) \tag{14.16}$$&#xA;where $$\mu_n(t) = \sum_{j=q(t)}^n \frac{\tau_j \varphi(L_j(t)) \lambda_j(t)}{1+\tau_j L_j(t)}$$&#xA;, and Z(t) a Brownian motion under the spot measure $Q^B$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Now Lemma 14.2.6 says&lt;/strong&gt;, the SDE for $z(t)$ in measure $Q^{T_{n+1}}$, $n\geq q(t) -1$ is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align}&#xA;dz(t) &amp;amp;= \theta(z_0-z(t)) dt + \eta \psi(z(t)) \\&#xA;&amp;amp;\times \left( -\sqrt{z(t)} \mu_n(t)^\top \langle dZ(t), dW^B(t) \rangle + dZ^{n+1}(t) \right) \tag{14.17}&#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;, where $Z^{n+1}(t)$ is a Brownian motion in measure $Q^{T_{n+1}}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The proof on the book&lt;/strong&gt; is as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From earlier results, we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dW^{n+1}(t) = \sqrt{z(t)} \mu_n(t) dt + dW^B(t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us introduce the $m$-dimensional vector &#xA;$$a(t) = \langle dZ(t), dW^B(t) \rangle / dt \tag{1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so that we can write &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dZ(t) = a(t)^\top dW^B(t) + \sqrt{1-\|a(t)\|^2}d\widetilde W(t) \tag{2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\widetilde W(t)$ is a scalar Brownian motion independent of $W^B(t)$. In the measure $Q^{T_{n+1}}$, we then have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align}&#xA;dZ(t) &amp;amp;= a(t)^\top \left(dW^{n+1}(t) - \sqrt{z(t)}\mu_n(t) dt \right) + \sqrt{1-\|a(t)\|^2} d\widetilde W(t) \tag{3}\\&#xA;&amp;amp;=dZ^{n+1}(t) - a(t)^\top \sqrt{z(t)} \mu_n(t) dt \tag{4}&#xA;\end{align}&#xA;$$&#xA;and the result follows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My questions are&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q1.&lt;/strong&gt; Why with $(1)$ one can write $(2)$? is this a property for any 2 Brownian motions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q2.&lt;/strong&gt; After $(3)$ I can only get&#xA;$$dZ(t) = a(t)^\top dW^{n+1}(t) + \sqrt{1-\|a(t)\|^2}d\widetilde W(t) - a \sqrt{z(t)}\mu_n(t) dt$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get $(4)$ it means one can define Brownian motion $Z^{n+1}(t)$ in measure $Q^{T_{n+1}}$ as:&#xA;$$dZ^{n+1} (t) = a(t)^\top dW^{n+1}(t) + \sqrt{1-\|a(t)\|^2}d\widetilde W(t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could one do so? notice $\widetilde W(t)$ is a Brownian motion in measure $Q^B$, but $ W^{n+1}(t)$ is a Brownian motion in measure $Q^{T_{n+1}}$, isn't here a bit messy?&lt;/p&gt;&#xA;" OwnerUserId="2161" LastEditorUserId="2161" LastEditDate="2014-08-13T03:02:02.433" LastActivityDate="2014-08-13T03:02:02.433" Title="question on Leif Andersen's &quot;Interest Rate Modeling, vol 2 Term Structure Models&quot;" Tags="&lt;stochastic-calculus&gt;&lt;market-model&gt;&lt;lmm&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14315" PostTypeId="1" CreationDate="2014-08-07T07:14:00.087" Score="2" ViewCount="79" Body="&lt;p&gt;I am working with two correlated SDE's and I was wondering if I could use two different discretization schemes for them. Is there maybe a reference of this being done? And can something be said about the convergence order?&#xA;Is it better to use two Euler discretizations in stead of 1 Euler and 1 Milstein?&lt;/p&gt;&#xA;" OwnerUserId="7649" LastActivityDate="2014-08-07T07:14:00.087" Title="Discretization Schemes" Tags="&lt;option-pricing&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14316" PostTypeId="1" AcceptedAnswerId="14319" CreationDate="2014-08-07T09:11:19.260" Score="2" ViewCount="435" Body="&lt;p&gt;In exchange rate model explanation,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;...If under the domestic risk neutral measure $Q_d$, the process $X(t)$ satisfies&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\displaystyle \frac{dX(t)}{X(t)}=\sigma dZ_d(t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $Z_d(t)$ is $Q_d$-Brownian motion, so $X(t)$ is a $Q_d$-martingale.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does this last line work? I cannot see what theorem has been applied&lt;/p&gt;&#xA;" OwnerUserId="11723" LastActivityDate="2014-08-07T13:15:13.030" Title="Exchange rate model and Martingales" Tags="&lt;option-pricing&gt;&lt;fx&gt;&lt;risk-neutral-measure&gt;&lt;brownian-motion&gt;&lt;martingale&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14317" PostTypeId="2" ParentId="14316" CreationDate="2014-08-07T09:23:32.633" Score="4" Body="&lt;p&gt;Most of the time, when you have a simple SDE without a drift, it's a martingale because the Wiener process itself is a martingale. In your example, you have a constant with the Wiener process, therefore the whole process must also be a martingale because the expectation is clearly X(t).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, we can't conclude a driftless SDE is always a martingale. There're cases that a driftless SDE is a local-martingale or super-martingale. What we can conclude in your example that it's an obvious martingale.&lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="601" LastEditDate="2014-08-07T09:33:50.360" LastActivityDate="2014-08-07T09:33:50.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14319" PostTypeId="2" ParentId="14316" CreationDate="2014-08-07T10:42:10.403" Score="1" Body="&lt;p&gt;The solution of your SDE is known as the Stochastic Exponential:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X_t=X_0e^{\sigma Z_t-\sigma^2t^2/2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(You can check this solution by applying Ito to the function $f(t,Z_t)=\ln X_t$.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking the expectation of $X_t$ to check its martingale property, since $Z_t\sim N(0,t)$ then $E(e^{\sigma Z_t})=e^{\sigma^2t^2/2}$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E(X_t)=E(X_0e^{\sigma Z_t-\sigma^2t^2/2})=X_0e^{-\sigma^2t^2}E(e^{\sigma Z_t})=X_0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence $X_t$ is martingale for $Z_t$ Brownian Motion (and Brownian Motions are Martingales).&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-08-07T13:15:13.030" LastActivityDate="2014-08-07T13:15:13.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14321" PostTypeId="2" ParentId="14289" CreationDate="2014-08-07T12:22:25.550" Score="4" Body="&lt;p&gt;Though not exactly spelling out models for natural gas.  For natural gas trading I like the book as it explains a lot about how the industry works, and might help you develop models:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0878147098&quot; rel=&quot;nofollow&quot;&gt;Trading Natural Gas: Cash, Futures, Options and Swaps Hardcover – January 1, 1997&#xA;by Fletcher J. Sturm&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11748" LastActivityDate="2014-08-07T12:22:25.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14322" PostTypeId="1" AcceptedAnswerId="14346" CreationDate="2014-08-07T14:08:01.960" Score="1" ViewCount="472" Body="&lt;p&gt;Assume the stockprice as in the Black-Scholes model (Geometric Brownian Motion):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S_t=S_0e^{(\mu-\sigma^2/2)\cdot t+\sigma W_t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wouldn't there be an immediate arbitrage opportunity, to just buy the stock and wait until it reaches level above the riskfree asset (then sell stock to repay loan and gain remainder as profit)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As we know, the Black-Scholes model is assumed to be arbitrage-free with unlimited debt and time horizon.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-08-08T11:21:57.427" LastActivityDate="2014-08-10T08:26:16.087" Title="Is this arbitrage?" Tags="&lt;black-scholes&gt;&lt;arbitrage&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="3" CommentCount="6" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14323" PostTypeId="2" ParentId="14322" CreationDate="2014-08-07T14:18:18.863" Score="-2" Body="&lt;p&gt;This is not arbitrage. Your construction of the portfolio is zero but there is no guarantee that your stock will cover your loan. The GBM is a stochastic process, you have a probability that it'll not cover up your loan.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, the question is invalid because you misunderstood the BS model. Under BS, GBM is simply an assumption. The BS model is used to price and hedge options not the underlying asset.&lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="601" LastEditDate="2014-08-07T15:59:11.573" LastActivityDate="2014-08-07T15:59:11.573" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="14324" PostTypeId="1" AcceptedAnswerId="57508" CreationDate="2014-08-07T16:51:09.753" Score="11" ViewCount="615" Body="&lt;p&gt;What is the difference between a warrant and an option on a stock?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apparently both represent the same right to receive a share of stock at the strike.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="20194" LastEditDate="2020-08-25T01:45:11.733" LastActivityDate="2020-08-25T01:45:11.733" Title="Difference between a warrant and an option?" Tags="&lt;options&gt;&lt;warrant&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14326" PostTypeId="2" ParentId="10873" CreationDate="2014-08-07T19:17:23.203" Score="1" Body="&lt;p&gt;Stock markets? Not that I know of.  I would say ICE and NYMEX have OTC power contracts but I believe they have pretty big margins and account minimums for that kind of contract.  Just at looking at today's settlements I see very little traded on Clearport.&lt;/p&gt;&#xA;" OwnerUserId="11748" LastActivityDate="2014-08-07T19:17:23.203" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14327" PostTypeId="1" CreationDate="2014-08-07T21:53:07.977" Score="3" ViewCount="896" Body="&lt;p&gt;I tried to test stock pairs for pairs trading. There are two questions I am not sure.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;I am not using ADF to test the log difference between two stocks. But I also see people using Johansen test. What's the difference? Should they in general output same results? What are the disadvantages for each test?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;When using ADF test, I found that some pairs just don't make sense. Like the other post I saw on this site saying they found cointegration significant between hog futures and MSFT. For me, it's more like finding cointegration significant while the correlation is negative and so the hedging ratio is negative. For trading this kind of pairs, the shorted leg essentially don't provide any hedging for market risk at least in short term. So why do I get these results?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="11753" LastActivityDate="2018-12-09T12:56:59.593" Title="Need help on cointegration" Tags="&lt;cointegration&gt;&lt;pairs-trading&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14328" PostTypeId="2" ParentId="10884" CreationDate="2014-08-07T22:13:05.757" Score="0" Body="&lt;p&gt;My understanding is following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Spread = Log(P1) - lambda * Log(P2)&#xA;Lambda is the hedging ratio to eliminate market risk&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming the two securities are cointegrated, if Spread is positive, security P1 is relatively more expensive than P2. As a trader, you might want to consider short P1 and long P2. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If Spread is negative, security P1 is cheaper than P2 in relative term. So one might want to long P1 and short P2.&lt;/p&gt;&#xA;" OwnerUserId="11753" LastActivityDate="2014-08-07T22:13:05.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14329" PostTypeId="2" ParentId="14322" CreationDate="2014-08-07T22:53:48.423" Score="3" Body="&lt;p&gt;No this is not a risk free arbitrage. What you are talking about is modeling a stock price with GBM and it has nothing to do with Black-Scholes. Black-Scholes is an option pricing formula that assumes that stocks follow GBM (which is a bad assumption to begin with but we won't get into that). What you are talking about doing is taking on leverage. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ E[S_T]= S_0e^{ut} $ where $u$ is the growth rate of the stock. So if you take a loan out at time 0 for $S_0$ then at time T you will owe back $S_0e^{rt}$ where r is the risk free rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if $u &amp;gt; r$ it is true that you would EXPECT to make money. This is not arbitrage. Arbitrage is when you are guaranteed to make money with no risk. In the situation you are describing there will be times when you lose money and will not be able to pay back your loan.  &lt;/p&gt;&#xA;" OwnerUserId="5940" LastActivityDate="2014-08-07T22:53:48.423" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14330" PostTypeId="1" AcceptedAnswerId="14331" CreationDate="2014-08-08T02:57:06.850" Score="8" ViewCount="1579" Body="&lt;p&gt;There are a number of different matching algorithms at different exchanges. Time-based FIFO is most common, but there is also mixed FIFO/pro-rata, pure pro-rata, size priority, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why would an exchange choose one matching algorithm over another? What kind of customers benefit from the different algorithms?&lt;/p&gt;&#xA;" OwnerUserId="5251" LastEditorUserId="2299" LastEditDate="2014-08-08T06:00:58.550" LastActivityDate="2018-12-04T14:08:22.007" Title="Why would an exchange choose one matching algorithm over another?" Tags="&lt;trading&gt;&lt;market-microstructure&gt;&lt;exchange&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14331" PostTypeId="2" ParentId="14330" CreationDate="2014-08-08T06:23:51.290" Score="11" Body="&lt;p&gt;Among matching rule, do not forget &quot;auction calls&quot;, in most markets, you have one at the open and one at the close.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To give you the main reasons to use one matching engine rather than another:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Auction calls&lt;/strong&gt; (i.e. fixings) are good to digest a lot of orders in a very short amount of time. It is why after a trading suspension, the trading starts with an auction call. It is also why in London, you have a mid-day auction call on witching days. At my knowledge it is the oldest practice (used on the pits).&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Continuous trading&lt;/strong&gt; seems good to obtain a progressive &lt;em&gt;relative price valuation&lt;/em&gt; ; I mean that it allows market participants to monitor simultaneously different instruments and to buy/sell one relatively to the others.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Pro-rata matching&lt;/strong&gt; generates huge sizes at first limits, giving birth to less prices a day (it cannot really prevent the price to move, of course). It gives advantage to market makers and investment banks who can take the risk to buy or sell more than what they need.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Time priority&lt;/strong&gt; give advantage to low latency traders (especially when the tick is large with respect to the average bid-ask spread). &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Moreover, note the tick size influences the matching process a lot. Some markets implement:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Internal matching&lt;/strong&gt;: i.e. when you are a broker and you have an resting buy order on the best bid, but not first in the queue, if you send a sell order, it will match your buy order instead of others that are before you. It implements a &quot;shortcut&quot; of the time priority. It is a cheaper alternative to build a broker crossing network for the intermediaries.&lt;/li&gt;&#xA;&lt;li&gt;in some exchanges (like the Spanish exchange), the name of the member to whom orders in the queues belong is available. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you want more information, read &lt;a href=&quot;http://www.worldscientific.com/worldscibooks/10.1142/8967&quot; rel=&quot;nofollow noreferrer&quot;&gt;Market Microstructure in Practice&lt;/a&gt;. More specifically on pro-rata rules and market descriptions, you have &lt;a href=&quot;http://www.citeulike.org/user/lehalle/article/12045573&quot; rel=&quot;nofollow noreferrer&quot;&gt;Almgren, R. (2012, August). High-Frequency event analysis in eurex interest rate futures. Technical report&lt;/a&gt; and &lt;a href=&quot;http://www.citeulike.org/user/lehalle/article/12045567&quot; rel=&quot;nofollow noreferrer&quot;&gt;Field, J. and J. Large (2008). Pro-rata matching and one-tick futures markets. CFS working paper 2008,40, Frankfurt&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2018-12-04T14:08:22.007" LastActivityDate="2018-12-04T14:08:22.007" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="14332" PostTypeId="2" ParentId="10884" CreationDate="2014-08-08T09:10:53.450" Score="1" Body="&lt;p&gt;Solution is following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Calculate the spread: &lt;code&gt;spread = log(P1 / P2)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Find minimum value of spread: &lt;code&gt;minVal = Min(spread)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;If &lt;code&gt;minVal &amp;lt; 0&lt;/code&gt; then do transformation for spread: &lt;code&gt;spread = spread + Abs(minVal) + 0.01&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Now we have spread with positive values.&lt;/p&gt;&#xA;" OwnerUserId="5938" LastActivityDate="2014-08-08T09:10:53.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14333" PostTypeId="2" ParentId="14324" CreationDate="2014-08-08T10:09:23.213" Score="5" Body="&lt;p&gt;in addition to the answer above:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the option is settled on an exchange, the terms will be standardised and a secondary market will exist making it a liquid instrument (with dedicated counterparties offering to match each side of the trade). A warrant will be more thinly traded and will trade over the counter (OTC), and will have terms that are specific to that warrant when it was issued. Warrants are usually longer dated than options and have likely been issued as a sweetener on a low yielding bond or equity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A warrant is issued by the company whose equity is reflected in the warrant, whereas an option can be issued (written) by anyone even if they do not own the stock to sell (although this can be very risky). &lt;/p&gt;&#xA;" OwnerUserId="11653" LastActivityDate="2014-08-08T10:09:23.213" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14334" PostTypeId="1" AcceptedAnswerId="14379" CreationDate="2014-08-08T10:30:49.107" Score="5" ViewCount="384" Body="&lt;p&gt;I was working on the pricing of complex bermudean swaption when I noticed that the exercise is often (very) subobptimal. It seems that the clients are more sensitive to past growth or drop in rates than to their value at the moment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for a way to modelise the suboptimal behaviour and I tought about Machine learning. But I can't find any reference on suboptimal options exercice. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you have any broader exemple of Machine learning applied to the replication of human non optimal behaviour ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit: Well, I have a little background in ML (&lt;a href=&quot;https://www.coursera.org/course/ml&quot; rel=&quot;nofollow&quot;&gt;Finished Andrew Ng course&lt;/a&gt; on Coursera and currently going trough &lt;a href=&quot;http://statweb.stanford.edu/~tibs/ElemStatLearn/&quot; rel=&quot;nofollow&quot;&gt;ESLII&lt;/a&gt; at a great pace). I know there is a lot of applications (see &lt;a href=&quot;http://cs229.stanford.edu/projects2013.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; for tons of exemple).  I have played a bit with some basic algorithm and my data. I have some interesting results but also things to investigate. My question was more about quantitative finance.&lt;/p&gt;&#xA;" OwnerUserId="5052" LastEditorUserId="5052" LastEditDate="2014-08-12T22:08:02.600" LastActivityDate="2014-08-13T08:08:54.920" Title="Machine learning for non optimal behaviour" Tags="&lt;machine-learning&gt;&lt;american-options&gt;&lt;swaption&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14336" PostTypeId="2" ParentId="3156" CreationDate="2014-08-08T13:49:01.037" Score="2" Body="&lt;p&gt;One of the reasons q/kdb+ is attractive for tick data is that it can process data tick by tick as well as using the SQL-like query language. You'll read elsewhere that it is a columnar database that uses the vector processor on modern CPUs for noticeably faster throughput.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only system I've used that can process a tick-feed like q/kdb+ is&#xA;&lt;a href=&quot;http://www.espertech.com/esper/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Esper&lt;/a&gt;. It is very difficult to work with because it's an embedded language invoked by an Esper runtime environment within a JVM. There are extra tools available at a fee.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is possible now to use columnar datastores with Spark/Hadoop: Parquet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've used q/kdb+ extensively. The licence changes are really good, I can now use it as part of my toolkit at work and use it within business processes. If you persevere with it, you do appreciate it is an amazing system.&lt;/p&gt;&#xA;" OwnerUserId="11759" LastEditorUserId="11759" LastEditDate="2019-05-17T11:51:20.577" LastActivityDate="2019-05-17T11:51:20.577" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="14337" PostTypeId="2" ParentId="959" CreationDate="2014-08-08T14:10:18.953" Score="3" Body="&lt;p&gt;I have experience of C# as a strategy client at the end of a VB .Net ticker plant. The latency fluctuations caused by the garbage collection could be in the order of seconds! And occurred every four or five minutes with a stream of a 1000-ish ticks a second.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was the first engineer to test our trading system in this way, it was a shock to all concerned and explained a lot of the issues we had had.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A much simpler Java system did a lot better, but still injected 300 ms every 10 minutes or so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A set of managed C++ feed adapters replaced the single very busy ticker plant. The strategy client remained in C#: it manually garbage-collected whenever it had some slack time.&lt;/p&gt;&#xA;" OwnerUserId="11759" LastActivityDate="2014-08-08T14:10:18.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14338" PostTypeId="1" CreationDate="2014-08-08T16:32:54.283" Score="2" ViewCount="452" Body="&lt;p&gt;For example in the FT this month a 10 year US bond with redemption date 05/24, coupon 2.50 has a bid price of 99.52 and a bid yield of 2.56.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can one calculate the bid yield from the bid price, red date and coupon?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought that the bid yield should be the rate y at which if you discount the cash flows of (6 months, 1.25), (1 year, 1.25), ........., (10 years,101.25) at the rate of y and sum these up you should get the bid price. But I dont get this. If i take the quoted bid yield of 2.56 - I get a bond price of 99.33. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a shorter example - a 2 year US bond with red date of 06/16, coupon 0.50 has bid price 100.02 and bid yield of 0.49. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone help?&lt;/p&gt;&#xA;" OwnerUserId="11760" LastActivityDate="2014-08-08T23:35:49.410" Title="How are bond prices quoted in the financial press related to bond yields quoted?" Tags="&lt;bond&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14339" PostTypeId="1" AcceptedAnswerId="14345" CreationDate="2014-08-08T17:06:35.470" Score="1" ViewCount="873" Body="&lt;p&gt;how can I simulate/generate two non-stationary time series (with unit root) so that they can be also cointegrated (using R or Matlab).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="11761" LastActivityDate="2020-09-21T09:04:14.537" Title="Simulate non-stationary time series with cointegration" Tags="&lt;time-series&gt;&lt;stochastic-processes&gt;&lt;cointegration&gt;&lt;simulations&gt;&lt;stationarity&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14340" PostTypeId="1" AcceptedAnswerId="14364" CreationDate="2014-08-08T17:40:46.147" Score="1" ViewCount="1210" Body="&lt;p&gt;For a OU/AR(1) process is there anyway to analytically calculated most probable period of time the process is likely to diverge from the average, before turning to converge. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically I am looking to derive a proof that under an OU/auto-regressive process a profitable moving average crossover strategy exists.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sam &lt;/p&gt;&#xA;" OwnerUserId="11762" LastActivityDate="2014-08-12T05:26:52.053" Title="Trading over a Ornstein/AR process" Tags="&lt;quant-trading-strategies&gt;&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;proof&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14341" PostTypeId="2" ParentId="14338" CreationDate="2014-08-08T20:45:35.870" Score="1" Body="&lt;p&gt;A few things you'll need to check:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;What's your assumed settlement date? Typically, US Treasuries settle T+1, so you should discount cash flows back to the next good business day, not back to today. Furthermore, has the bond actually been issued? If the bond just got auctioned, it may not have settled. In this case, the settlement date should be the issue date (which could be 1-2 weeks away depending on the term).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is the settlement date a coupon date? If not, then the sum of discounted cash flows is equal to &quot;quoted price + accrued interest.&quot; The published quotes for USTs are always clean price (i.e., excluding accrued interest).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As an example, today (August 8, 2014), the on-the-run 2-year note is the 0.5s of 31-July-2016. The settlement date is August 11, 2014 (next Monday). The quoted price is 100.1406.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The accrued interest is 0.014946 ( =(8/11/2014 – 7/31/2014) / (1/31/2015 – 7/31/2014) * 0.5 / 2). Therefore, the dirty price is $100.1406 + 0.014946 = 100.1555457$. The yield to maturity is 0.4282479%, and can be solved from&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ 100.1406 + 0.014946 = \frac{0.25}{(1+y/2)^{0.940217}} + \frac{0.25}{(1+y/2)^{1.940217}} + \frac{0.25}{(1+y/2)^{2.940217}} + \frac{100.25}{(1+y/2)^{3.940217}}.$$&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2014-08-08T23:35:49.410" LastActivityDate="2014-08-08T23:35:49.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14342" PostTypeId="1" CreationDate="2014-08-09T08:41:21.530" Score="2" ViewCount="2217" Body="&lt;p&gt;calculating the volatility for a single stock is straightforward. However, I'm not sure whether my approach for calculating the volatility matrix for multiple stocks is correct:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume a log-normal distribution of the stock prices. Therefore I calculate the log returns, calculate the variance-covariance matrix of the log returns and perform the cholesky decomposition of the variance-covariance matrix. The result from the last step is, as far as I am aware of, the volatility matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let ln_sec be a m x n matrix with the log returns of n securities over a period of m months, then my matlab code is as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;vcm = cov(ln_sec) %var-cov matrix&#xA;vcm = vcm * 12 %annualize var-cov matrix&#xA;vm = chol(vcm) %volatility matrix&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Would you agree on my approach?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I forgot to mention the application in order to discuss a suitable solution. The volatility matrix is used to calculate a market price of risk vector as follows&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(drift - risk-free-rate*1)/vm&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where drift is a n x 1 vector with the mean drift rates of n assets and 1 is a n x 1 vector with 1's.&#xA;The market price of risk vector is then used to simulate a state-price density (pricing kernel).&lt;/p&gt;&#xA;" OwnerUserId="11764" LastEditorUserId="11764" LastEditDate="2014-08-09T09:50:52.493" LastActivityDate="2015-01-07T02:17:01.423" Title="How to calculate the volatility matrix with multiple stocks" Tags="&lt;volatility&gt;&lt;programming&gt;&lt;matlab&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14343" PostTypeId="2" ParentId="8896" CreationDate="2014-08-09T08:58:48.343" Score="3" Body="&lt;p&gt;I have also been searching for algo trading in Python.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to my findings:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;there are many such librairies available, open-source or proprietary,&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;they are all built quite specifically. as a result, when you know how to use one, it is the only one you are able to use.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;their stage of development is quite heterogeneous and future uncertain, eg what did happen to rapidquant.com cite above?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;no such library is well off and outperforming all other competing librairies.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;With all the above, I would rather build my own tools as suggested above by someone else.&lt;/p&gt;&#xA;" OwnerUserId="2220" LastActivityDate="2014-08-09T08:58:48.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14344" PostTypeId="2" ParentId="14342" CreationDate="2014-08-09T09:15:51.710" Score="1" Body="&lt;p&gt;You can just take the diagonal of the var-cov matrix. This should give you the variance of each stock and then take sqrt of that for std. deviation.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sd = sqrt(diag(vcm))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6675" LastActivityDate="2014-08-09T09:15:51.710" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14345" PostTypeId="2" ParentId="14339" CreationDate="2014-08-10T04:38:02.213" Score="1" Body="&lt;p&gt;Two cointegrated series contain a single unit root. Each series can be formulated as the sum of a common unit root plus a stationary component. Most textbooks covering cointegration will cover such formulations - see Hamilton's (1994) discussion of Phillips' &quot;triangular representation&quot; of a cointegrated vector, for example. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simulating is likely to be easy (depending on other features you may need, of course). For example, simulate one non-stationary series, and construct a second series as the sum of the first and a stationary variable. Viola! Cointegrated. &lt;/p&gt;&#xA;" OwnerUserId="11767" LastActivityDate="2014-08-10T04:38:02.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14346" PostTypeId="2" ParentId="14322" CreationDate="2014-08-10T08:26:16.087" Score="2" Body="&lt;p&gt;It does not seem you feel the question is answered so I will try to elaborate over what I think seems to bother you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $S_t = e^{(\mu  -\sigma^2/2) t + \sigma W_t}$ be the stock price process and $B_t=e^{rt}$ be the risk free. The arbitrage you describe is then choosing a nice $\varepsilon &amp;gt;0$ and  setting $\tilde{T}=\inf \{t&amp;gt;0 : (\mu -r -\sigma^2/2)t +\sigma W_t&amp;gt; \varepsilon\}$. Then one would have an &quot;arbitrage&quot; at $\tilde{T}$, as you say this will eventually happen which is true. In fact one even know the distribution of when your &quot;arbitrage&quot; will occur see &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Inverse_Gaussian_distribution&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Inverse_Gaussian_distribution&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is unfortunately also the problem. Since the inverse Gaussian distribution has mass over entire $\mathbb{R}^+$ you will not be able to choose $T\in \mathbb{R}$ such that $P(T \geq \tilde{T})=1$, ergo you can not in this way find an arbitrage. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is in fact very easy to find an equivalent martingale measure in this model formally implying that the model is arbitrage free. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is a different issue whether your &quot;mini arbitrage strategy&quot; is a attractive feature of a model. It is as you say simply a consequence of having a model where volatility accumulates without bound together with no possibility of default.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2014-08-10T08:26:16.087" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14347" PostTypeId="2" ParentId="3538" CreationDate="2014-08-10T12:32:59.620" Score="4" Body="&lt;p&gt;I have a different solution, which calculates the vol for a list of prices.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import math&#xA;&#xA;#workout volatility&#xA;def perc_change(price_list):&#xA; return [(v / price_list[abs(i-1)])-1 for i, v in enumerate(price_list)]&#xA;&#xA;def variance(price_list):&#xA; perc = perc_change(price_list)&#xA; avg = average(perc)&#xA; return [(x - avg)**2 for x in perc]&#xA;&#xA;def average(x):&#xA; return sum(x)/len(x)&#xA;&#xA;&#xA;var = variance(list_of_prices)&#xA;&#xA;volatility = math.sqrt(average(var))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11770" LastActivityDate="2014-08-10T12:32:59.620" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14348" PostTypeId="1" CreationDate="2014-08-10T17:23:53.033" Score="2" ViewCount="116" Body="&lt;p&gt;I am trying to understand why a stock experienced a very drastic drop in price. The only event linked to the drop seems to be payment of an unusually big dividend; however its effect on the price seems too strong to fully explain it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The company is in good shape and has a good quick ratio; the assets are much higher than the dividend.&lt;/p&gt;&#xA;" OwnerUserId="11655" LastEditorUserId="11655" LastEditDate="2014-08-10T18:15:13.370" LastActivityDate="2014-08-10T18:15:13.370" Title="Why would a 9% dividend payment halve the stock price?" Tags="&lt;equities&gt;&lt;dividends&gt;" AnswerCount="0" CommentCount="9" ClosedDate="2014-08-10T17:37:20.647" ContentLicense="CC BY-SA 3.0" />
  <row Id="14349" PostTypeId="2" ParentId="14294" CreationDate="2014-08-10T20:06:07.240" Score="4" Body="&lt;p&gt;Most, but far from all, companies maintain a relatively steady debt load.  When a bond matures, they fund its principal payout with a new bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes companies do take on more and more debt, meaning that CDS protection sold during earlier times of small debt loads becomes more valuable (and underpriced, from the point of view of the protection seller).  Each increase in debt load is effectively a change in &lt;a href=&quot;http://en.wikipedia.org/wiki/Capital_structure&quot; rel=&quot;nofollow&quot;&gt;capital structure&lt;/a&gt;, which is an important and under-modeled part of quantitative finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Homeowners insurance runs some similar risks.  A homeowner might significantly increase the value of his or her possessions while remaining under the same policy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I originally thought you were asking about a key difference between CDS and fire insurance.   Namely, there is not much risk of many homes burning all at once (modulo the occasional wildfire in the western USA).  Corporate bankruptcy, in contrast, tends to happen in bunches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The lack of independence is handled with copula models, where the event probabilities are translated to the probability of some quadrant of multidimensional space.  Typically this quadrant is evaluated under gaussian or student-t distributions, where correlation is easy to define and compute.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There has been much debate in recent years about whether these models are truly capable of dealing with small quadrants, which correspond to tail events.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more information, please see &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.139.2245&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow&quot;&gt;this paper by Hull et alia&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2014-08-12T19:34:11.843" LastActivityDate="2014-08-12T19:34:11.843" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14350" PostTypeId="2" ParentId="14314" CreationDate="2014-08-10T21:11:09.530" Score="3" Body="&lt;p&gt;&lt;strong&gt;Q1:&lt;/strong&gt; $$(1)\rightarrow(2)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1): $a(t)$ is the instantaneous correlation of $\rho(Z_t,W_t)$ because:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\rho(dZ_t,dW_t)=\dfrac{Cov(dZ_t,dW_t)}{\sigma_{dZ_t}\sigma_{dW_t}}=\dfrac{E(dZ_t\cdot dW_t)}{\sqrt{dt} \sqrt{dt}}=\dfrac{\langle dZ_t, dW_t\rangle}{t}=a(t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Rightarrow$ (2) holds as following, in the 1-dim case:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;$dZ_t\sim N(0,dt),$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$dW_t,\tilde{dW_t}\stackrel{iid}{\sim}\,N(0,dt),$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$$\Rightarrow a_tdW_t+\sqrt{1-a_t^2}d\tilde{W_t}\sim N\left(0\cdot a_t+\sqrt{1-a_t^2}\cdot 0,\,a^2dt+\sqrt{1-a_t^2}^2dt\right)=N(0,dt)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;because we know the sum of independent normal variates is again normal with $N(\mu=\mu_1+\mu_2,\sigma^2=a^2\sigma_1^2+b^2\sigma_2^2)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So: $$a_tdW_t+\sqrt{1-a_t^2}d\tilde{W_t} \stackrel{d}{\sim}dZ_t$$&#xA;&lt;strong&gt;q.e.d.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Hence this holds for &lt;strong&gt;Q2&lt;/strong&gt; aswell, and you can plug it in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;q.e.d.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-08-12T18:21:43.427" LastActivityDate="2014-08-12T18:21:43.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14351" PostTypeId="1" CreationDate="2014-08-10T21:28:22.247" Score="8" ViewCount="397" Body="&lt;p&gt;I have an empirical model for the dynamics of futures prices in a particular market that I have implemented using a long series of the front five contracts. (I account for the roll in my model.) I have never tried to forecast prices of options on these futures, but I have some ideas and I would like to experiment. Is there an analogous data construct used by practitioners to backtest options pricing models? I am thinking of something like a series of a vector containing the prices of the ATM put and two strikes above and below or something. Also, I am thinking of a format that might be constructed conveniently by a canned Bloomberg API, or similar thing. &lt;/p&gt;&#xA;" OwnerUserId="11767" LastActivityDate="2019-02-19T01:15:48.443" Title="What is the most convenient data structure for backtesting a model of futures options prices?" Tags="&lt;options&gt;&lt;data&gt;&lt;backtesting&gt;&lt;futures&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14352" PostTypeId="1" AcceptedAnswerId="14353" CreationDate="2014-08-11T06:33:02.490" Score="1" ViewCount="89" Body="&lt;p&gt;I am doing signal analysis for a time series and the assumption of signal is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;S = F + e&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where S is the original signal, F is the frequency component and e is white noise (auto-regressive time series with moving average = 0). I have a large number of samples, say, N samples; and I can do wavelet decomposition for all them to obtain N number of coefficients arrays.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now my question is what's the proper way to combine all those coefficients to achieve an &quot;average&quot; of the coefficients, so that e would have smallest standard deviation? I tried to do arithmetic average or average norm times average coefficients vector by cross product; but I couldn't prove either of them is a proper way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance for your help.&lt;/p&gt;&#xA;" OwnerUserId="11775" LastActivityDate="2014-08-11T06:42:51.997" Title="Proper way to combine wavelet coefficients from multiple rounds of analysis" Tags="&lt;digital-signal-processing&gt;&lt;wavelet&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14353" PostTypeId="2" ParentId="14352" CreationDate="2014-08-11T06:42:51.997" Score="1" Body="&lt;p&gt;It sounds like this is a numerical problem without analytic solution. So I would suggest to use a numerical optimizer to minimize the standard deviation, e.g. MATLABs &lt;a href=&quot;http://www.mathworks.ch/ch/help/optim/ug/fmincon.html&quot; rel=&quot;nofollow&quot;&gt;FMINCON()&lt;/a&gt; function can minimize virtually any expression that can be calculated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for your problem, I recommend to calculate:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Fmincon}(\sigma(x))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $x$ being your coefficient vector.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-08-11T06:42:51.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14355" PostTypeId="2" ParentId="10506" CreationDate="2014-08-11T10:31:37.910" Score="0" Body="&lt;p&gt;In a futures contract, the exchange clearing house itselfs acts as/is the counterparty to both parties in the contract (and this is why the credit risk is heavily reduced).&#xA;Futures are not issued (like other securities) but are created, whenever Open interest increases (and destroyed whenever Open interest decreases); the contracts are not between the original buyer and the original seller, but between the holders at expiry and the exchange house.&lt;/p&gt;&#xA;" OwnerUserId="2872" LastActivityDate="2014-08-11T10:31:37.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14356" PostTypeId="2" ParentId="9667" CreationDate="2014-08-11T11:43:25.423" Score="0" Body="&lt;p&gt;Islamic Banking (IB) has a different view on financial risk: The required minimum share holders equity must be lower than for counterparties in conventional banks because credit risk is also shouldered by unrestricted deposits owners, as the IB gives autorisation to use them in investments at its own discretion.&lt;/p&gt;&#xA;" OwnerUserId="2872" LastEditorUserId="2872" LastEditDate="2014-08-20T00:56:09.110" LastActivityDate="2014-08-20T00:56:09.110" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14358" PostTypeId="1" CreationDate="2014-08-11T12:47:36.693" Score="1" ViewCount="185" Body="&lt;p&gt;I'am in the midst of a paper on mutual fund product differentiation by &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1628406&quot; rel=&quot;nofollow&quot;&gt;Li and Qiu&lt;/a&gt;. Here, the authors model the utility an investor derives from investing in a mutual fund using a Discrete Choice Model approach. At the heart of their paper they argue that the expected price elasticity is lower if a fund differentiates herself from another fund in the market in terms of her factor loading on a random variable $f_{M2}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I do not understand is the proof of Proposition 2 and I hope someone can help me here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular, I cannot see why the second equation equals the third:&#xA;\begin{align}&#xA;|\eta_j^e|=|-b_0\frac{P_j}{S^e_j}\int s_{j2}(1-s_{j2})dF(f_{M2})|=|b_0 P_j(1-{S^e_j}-Var(S_{j2})/S_j^e)|&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $|\eta_j^e|=|\frac{\partial S_j^e/S_j^e}{\partial P_j/P_j}|$ is the expected price elasticity of demand; $s_{j2}=\frac{exp(A_j-\frac{1}{2} \phi_2(\beta_{jM}-\beta^*_{M2})^2\sigma^2_M)}{\sum_{l=1}^{2}exp(A_l-\frac{1}{2} \phi_2(\beta_{lM}-\beta^*_{M2})^2\sigma^2_M}$ with $A_j=\phi_0\alpha_j-b_0P_j-\frac{1}{2}\phi_2\sigma_{\epsilon_j}^2+\mathbf{X'_jB}+\xi_j$ and $\beta_{M2}^*=\frac{\phi_1 f_{M2}}{\phi_2 \sigma^2_M}$ is the fund's market share at time 2 and $S_j^e$ is the expected market share with respect to time 1 information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, I am looking for a nice explanation on how to solve for the integral stated in the equation. A literature reference may also do the job. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your time and help.&lt;/p&gt;&#xA;" OwnerUserId="7344" LastActivityDate="2014-08-11T12:47:36.693" Title="Understanding Price Elasticities in Discrete Choice Models (Derivative)" Tags="&lt;derivatives&gt;&lt;mathematics&gt;&lt;economics&gt;&lt;mutual-fund&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14360" PostTypeId="1" AcceptedAnswerId="14883" CreationDate="2014-08-11T14:39:47.120" Score="8" ViewCount="2097" Body="&lt;p&gt;I want to use the R package stochvol to fit a SV model to a DAX training set and use the output to estimate a rolling one-step-ahead forecast:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;DAX2log&amp;lt;- (logret(DAX, demean=TRUE))^2&#xA;trainset &amp;lt;- DAX2log[1:1912]&#xA;&#xA;SV &amp;lt;- svsample(trainset, priormu = c(-10, 1), priorphi = &#xA;         c(20, 1.1), priorsigma = .1, draws = 50000, burnin = 5000)&#xA;&#xA;SVroll &amp;lt;- function(svsampleOBJ, NumofForecast, Data)&#xA;{&#xA;  mu &amp;lt;- summary(svsampleOBJ)$para[1]&#xA;      phi &amp;lt;- summary(svsampleOBJ)$para[2]&#xA;  sigma &amp;lt;- summary(svsampleOBJ)$para[3]&#xA;  HSV &amp;lt;- vector(mode=c(&quot;double&quot;),length=NoF)&#xA;&#xA;  for(i in 1:NumofForecast)&#xA;  {&#xA;    H &amp;lt;- mu + phi*(Data[i] - mu) + sigma&#xA;    HSV[i] &amp;lt;- exp(H/2)&#xA;  }&#xA;  return(HSV)  &#xA; }&#xA;&#xA; HSV &amp;lt;- SVroll(svsampleOBJ = SV,NumofForecast = 2000,&#xA;             Data = DAX2log[1913:length(DAx2log)])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The main problem with this code is that the model becomes deterministic, but I did not manage to extract further draws from the predict function for the rolling forecast. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I get those draws from the posterior distribution and is my formula adequate? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, there seems to be some mix up in the units, since HSV is squared daily returns, while the input is in log.&lt;/p&gt;&#xA;" OwnerUserId="11782" LastActivityDate="2014-09-28T15:21:17.160" Title="Estimate rolling stochastic volatility forecast using stochvol in R" Tags="&lt;forecasting&gt;&lt;stochastic-volatility&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14361" PostTypeId="2" ParentId="14314" CreationDate="2014-08-11T18:06:26.420" Score="3" Body="&lt;p&gt;For Q1, the function $a(t)$ is the instantaneous correlation. The form given by (2) is basically the Cholesky decomposition. Of course, you may directly show, uisng Levy's characterization, that&#xA;$$&#xA;\widetilde{W}(t) = \int_0^t\bigg[\frac{1}{\sqrt{1-||a(t)||^2}} dZ(t) -\frac{a(t)^T}{\sqrt{1-||a(t)||^2}} dW^B(t) \bigg] &#xA;$$&#xA;is a standard scalar Brownian motion that is independent of $W^B(t)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Q2, note that as $\widetilde{W}(t)$ is a Brownian motion independent of $W^B(t)$, it is also a Brownian motion under the measure $Q^{T_{n+1}}$ -- the Radon-Nykodim derivative&#xA;$$ \frac{dQ^{T_{n+1}}}{dQ^B}|_{t} = \exp\bigg(-\int_0^t\sqrt{z(s)}\mu_n(s)dW^B_s - \frac{1}{2} \int_0^t z(s)\mu_n^2(s) ds\bigg),$$ employed in the Girsanov transformation,&#xA;is independent of $\widetilde{W}(t)$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2014-08-11T18:06:26.420" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14362" PostTypeId="2" ParentId="10775" CreationDate="2014-08-11T21:24:09.103" Score="0" Body="&lt;p&gt;For question 2): At time $T$, we need to pay $100\cdot\frac{S_T}{S_t}$ (in domestic currency, say \$). To do this, we need to buy 100\$ worth of shares at time $t$: that gives us $N=100\cdot \frac{1}{S_t}$ shares, with the desired final value of $$N\cdot S_T = 100\cdot\frac{S_T}{S_t}$$ at expiry.&#xA;Needless to say, today's PV of 100\$ at time $t$ is $100\,B(0,t)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, then at time $t_1$, we hold $N$ shares, so we get a dividend of $d$ per share, so we receive $d\,N = 100\cdot d/S_t$. Being the nice investment bankers that we are, we charge the client correspondingly less, namely the PV of that, which is $100\,d$ times the answer to question 1. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, final answer: $100\,(B(0,t) - d\cdot Q_1)$&lt;/p&gt;&#xA;" OwnerUserId="7715" LastEditorUserId="20913" LastEditDate="2016-10-29T14:44:21.860" LastActivityDate="2016-10-29T14:44:21.860" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14363" PostTypeId="2" ParentId="978" CreationDate="2014-08-11T21:47:35.423" Score="0" Body="&lt;p&gt;Essentially, if there is no arbitrage, then for any ratio of prices of assets $X_t/N_t =: M_t$, there must be a measure (depending on $N$ only) such that the ratio is a martingale (under that measure):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E_N[ X_T/N_T \,| F_t ] = X_t/N_t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;...which is of course what you wrote, I'm just highlighting that it holds for any two assets. An asset here is something denominated in domestic currency with no intermediate cash flows. Note that any asset can be chosen to be the numeraire $N$, as long as its price is always strictly greater zero (and it'll be different measures for different numeraires).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the market is complete (with respect to $X$), the measure is unique, thus there's a unique price (for $X$); otherwise, there might be a range of measures, and thus a range of prices. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As Brian said, if the equation didn't hold (i.e. you could not find a measure), you could construct an arbitrage. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is not obvious though :-) It is easiest &quot;seen&quot; in a two-period model with a finite state space (think about how many &quot;linearly independent&quot; assets there can be, and how we must be able to price them all by projecting them onto some line, the &quot;pricing kernel&quot;). &lt;/p&gt;&#xA;" OwnerUserId="7715" LastActivityDate="2014-08-11T21:47:35.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14364" PostTypeId="2" ParentId="14340" CreationDate="2014-08-12T03:20:06.840" Score="4" Body="&lt;p&gt;Consider an (arithmetic) Ornstein-Uhlenbeck process as a model of the asset price $X_t$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dX_t = \kappa(\mu-S_t)dt + \sigma dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\mu$ is the mean-reversion level, $\sigma$ is a volatility parameter, $W_t$ is Brownian motion, and $\kappa$ is the reversion speed.  An Ornstein-Uhlenbeck process will revert to the mean infinitely often if $\kappa &amp;gt; 0$ and the characteristic time scale for reversion is $\kappa^{-1}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The exact solution over an interval $[0,t]$ is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X_t = X_0 e^{-\kappa t} + \mu (1 - e^{-\kappa t}) +  \sigma\int_{0}^{t} e^{\kappa(s-t)} dW_s,$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with expected value&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E(X_t) = X_o e^{-\kappa t} + \mu (1 - e^{-\kappa t}).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To address your question, there are a number of metrics that characterize the time frame of reversion -- the most obvious being the expected first passage time.  For a mean reverting process the expected time to revert from level $A&amp;gt; \mu$ to level $B&amp;lt;A$ will, of course, be smaller than the expected time to migrate from level $B$ to $A$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The formulas are complicated, and in my view of limited practical value (as I discuss below).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a reference:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;L. M. Ricciardi and S. Sato, First-passage-time density and moments of the&#xA;Ornstein-Uhlenbeck process, J. Appl. Probab. 25 (1988) 43—57; MR0929503&#xA;(89b:60189).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In theory, a profitable trading strategy certainly exists for an asset that exhibits a stable mean-reverting behavior. There are many variations such as putting on a trade when the price deviates from the expected reversion level by a fixed amount in a binary fashion, or entering and taking profit in a continuous fashion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in real markets, assets seldom exhibit stationary mean-reversion with predictable reversion levels. Mean reversion may persist for a period of time and then suddenly break down.  The assumption of a stable reversion level is, generally, the weak link in the chain -- leading eventually to a large draw-down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, a more robust trading strategy allows the expected reversion level to adjust gradually as a moving-average.  Position size may also be adjusted based on historical volatility. The graph below shows trading profits (without transaction costs) for a simple mean-reversion strategy applied to the EURSEK currency pair.  In this case, position size is proportional to the deviation of the exchange rate from a 1-month or 3-month moving average (using daily NY market closing levels).  The position size (long or short) is not allowed to go above a cap based on the percentage deviation form the moving average. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The 3-month moving average adjusts more slowly than a 1-month average -- so the position sizes tend to be bigger -- yielding a  bigger mean return but with much bigger drawdown when the mean reversion breaks down (late 2008, for example). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Sn6BU.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="8153" LastEditorUserId="8153" LastEditDate="2014-08-12T05:26:52.053" LastActivityDate="2014-08-12T05:26:52.053" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14365" PostTypeId="1" CreationDate="2014-08-12T05:33:07.577" Score="1" ViewCount="660" Body="&lt;p&gt;Could anyone provide me the details of how to determine the lag order of the distributed lags for an ADL(p,q) model in Matlab or another statistical package (and very much preferably in combination with the autoregression lags)?? Full working examples with model selection criteria (AIC and BIC) seem to be available on the Matlab website for VAR models, ARMA models etc. but I can't find one for the ADL(p,q) model. I would not have a clue to rewrite those models to ADL(p,q) myself but I have a vague feeling that such a thing would be possibe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the end I want to automate this analysis by first checking the lag orders p,q and then using this numbers automatically to create the regressions out of this. So basically I'm looking for a fully working example. (I want to skip part of adding and deleting regressors by hand as much as possible to get a quick idea of the distributed lags of several assets).&lt;/p&gt;&#xA;" OwnerUserId="6075" LastActivityDate="2014-08-12T05:33:07.577" Title="Autoregressive distributed lag models ADL(p,q) howto in preferably matlab (stata/R/python/C# etc)" Tags="&lt;statistics&gt;&lt;models&gt;&lt;econometrics&gt;&lt;matlab&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14368" PostTypeId="1" AcceptedAnswerId="14369" CreationDate="2014-08-12T10:58:16.597" Score="2" ViewCount="1471" Body="&lt;p&gt;Someone in my organization claims that RIC codes are case-sensitive. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;SPXi201420000.U&lt;/code&gt; does not refer to the same instrument as &lt;code&gt;SPXI201420000.U&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this true? I've tried Googling but can't find an answer. A link to a specification document would be very helpful&lt;/p&gt;&#xA;" OwnerUserId="11789" LastEditorUserId="11789" LastEditDate="2014-08-13T13:12:23.643" LastActivityDate="2014-08-13T13:12:23.643" Title="Is Reuters Instrument Code (RIC) case-sensitive?" Tags="&lt;market-data&gt;&lt;reuters&gt;&lt;codes&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14369" PostTypeId="2" ParentId="14368" CreationDate="2014-08-12T12:06:00.367" Score="4" Body="&lt;p&gt;Yes, Thomson Reuters RIC codes are case-sensitive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe the confusion comes from the fact that some frontends will 'assist' you if you misspell and automatically convert. That's just a trick. This doesn't change the fact that at the API level it is case-sensitive. In other words: if you are doing your own application you should definitely think of RIC codes as being case-sensitive. Always.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Side track: If you take your data from a Thomson Reuters market data system you basically request data via a &lt;strong&gt;&lt;em&gt;data item name&lt;/em&gt;&lt;/strong&gt;, not a RIC per se. This is because such a system is data source agnostic. A data item name is just a case-sensitive identifier for a particular data item. RIC is a particular naming system for data item names. A feed will expose its data items via data item names (duh!). In case of a Thomson Reuters feed they will always use the RIC nomenclature but other feeds on a Thomson Reuters market data system may use any nomenclature they like as long as it 'fits' inside the definition of data item name. For example on a Thomson Reuters market data system you may have a Bloomberg feed and such feed is likely to use Bloomberg identifiers as their data item names. So RIC is really a naming scheme and nothing more. It is not a technical thing.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't think there's a document that will state that RICs are in fact case-sensitive. It's just implied because nowhere is it said that they are case-insensitive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="7780" LastActivityDate="2014-08-12T12:06:00.367" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14371" PostTypeId="2" ParentId="11568" CreationDate="2014-08-12T13:27:29.950" Score="3" Body="&lt;p&gt;Note that $$\frac{dQ_{T_p}}{dQ}|_{T_0} = \frac{P(T_0, T_p)}{P(0, T_p)}\frac{A(0, T_0, T_n)}{A(T_0, T_0, T_n)}$$.&#xA;Then&#xA;$$E^{Q_{T_p}}\big(S(T_0, T_n)\big) = E^Q\bigg(S(T_0, T_n) \frac{P(T_0, T_p)}{P(0, T_p)}\frac{A(0, T_0, T_n)}{A(T_0, T_0, T_n)}\bigg) \\&#xA;= \frac{A(0, T_0, T_n)}{P(0, T_p)} E^Q\bigg(S(T_0, T_n) \frac{P(T_0, T_p)}{A(T_0, T_0, T_n)}\bigg).$$&#xA;That is,&#xA;$$P(0, T_p)E^{Q_{T_p}}\big(S(T_0, T_n)\big) = A(0, T_0, T_n) E^Q\bigg(S(T_0, T_n) \frac{P(T_0, T_p)}{A(T_0, T_0, T_n)}\bigg). $$&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2014-08-12T13:27:29.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14372" PostTypeId="2" ParentId="14001" CreationDate="2014-08-12T13:35:16.227" Score="3" Body="&lt;p&gt;In Andersen &amp;amp; Piterbarg's book, LGM is referred to as &quot;The Hagan and Woodward Parameterization&quot; and treated separately in 11.3.2.6.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fact that this practice-oriented book devotes a couple of pages would imply LGM is of practical use in the real market. I know two large software providers adopt LGM.&lt;/p&gt;&#xA;" OwnerUserId="11790" LastActivityDate="2014-08-12T13:35:16.227" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14373" PostTypeId="2" ParentId="12788" CreationDate="2014-08-12T16:18:07.813" Score="2" Body="&lt;p&gt;very deep, elaborate question. &#xA;It seems to me, though, that you're somewhat missing the point:&#xA;The fundamental theorem of asset pricing is that in a no-arbitrage environment, asset prices divided by some numeraire are martingales (with respect to a measure dependent on the numeraire, with the measure being unique if the market is complete with respect to the asset). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, an asset (in this context) is something you can buy and sell at its price, denominated in domestic currency, &lt;strong&gt;with no intermediate cash flows.&lt;/strong&gt; The &quot;self-financing&quot; condition means just that: no intermediate cash flows. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As such, contrary to what some people here said, it does make sense to speak of an asset or product as &quot;self-financing&quot;: it's just a portfolio composed of (a quantity of one) of one asset, and with $V = 1 \cdot P(t)$ we have $dV = 1 \cdot dP(t)$, that is: the value of the portfolio is the price, and the change in value is the change in price. That sounds trivial, but it excludes dividends, interest, etc: Then the change in value would be the change in price &lt;strong&gt;plus&lt;/strong&gt; the cash flow. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, a good number of things are not assets under these criteria, for example a dividend paying stock, or a unit of cash (pays interest), or of course a unit of a foreign currency. &#xA;However, a stock with continuous dividends &lt;strong&gt;reinvested&lt;/strong&gt; in the stock $S(t) e^{qt}$, or a unit of the money market account $\beta(t)$, or a unit of the foreign money market account multiplied with the FX rate $\beta_f(t)\,X(t)$ - those are &quot;self financing&quot;, i.e. with no intermediate cash flow, thus the fundamental theorem of asset pricing holds for them, and they're martingales (properly discounted by the numeraire). This allows pricing of dividend paying stocks, composite options, quanto options, etc. &#xA;(Note that strictly speaking, you could hold a unit of cash as cash and not receive interest, but that of course is an arbitrage opportunity, because you could put it in the money market account instead receiving interest; thus cash, for better or for worse, is not an asset in the derivatives pricing world... :-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, an option is obviously self-financing, it has no intermediate cash flows. Thus, it's a martingale (discounted), thus we can price it with Black Scholes (in an arbitrage free market). We don't need to show that it's self-financing, it just is. Now, of course it's possible to conceive of some weird special options with intermediate cash flows, and those would not be self financing, and, lo and behold, they would have a different price. If you have an option that gives you some sort of dividend or interest occasionally, you'd rather have that, and it would command a higher price than the &quot;vanilla&quot; option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One more point: I did not understand the distinction you are trying to make between European and American options. Both are self-financing, with no intermediate cash flows, and both can be priced with the fundamental theorem of asset pricing under the appropriate boundary conditions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;tl;dr:&lt;/strong&gt; Self-financing just means &quot;no intermediate cash flow&quot;, and it is indeed a prerequisite for the fundamental theorem of asset pricing to hold, but it applies to options (both European and American), and is not sneakily/implicitly assumed, or something that ought to be &quot;proven&quot; from some prior axioms, but a defining characteristic of the product we're trying to price. Without that characteristic, the price changes and the Black Scholes formula doesn't hold.&lt;/p&gt;&#xA;" OwnerUserId="7715" LastActivityDate="2014-08-12T16:18:07.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14374" PostTypeId="2" ParentId="3894" CreationDate="2014-08-12T16:37:26.027" Score="0" Body="&lt;p&gt;nice point. One way of looking at it, I think, is that you have just two Brownian motions, so in a sense your space is just 2 dimensional. Thus, as long as $V$ and $V_1$ are not &quot;linearly dependent&quot;, you're spanning the space, and you're done, and it doesn't really matter what $V_1$ you're choosing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, this is of course a very hand-waving argument, in particular as Brownian motion is so &quot;weird&quot; (think about it: you could take the 1st, 3rd, 5th etc. digit of a Brownian motion, and the 2nd, 4th, 6th digit etc of that same Brownian motion, and you'd have two processes that are, well, complicated, and might well be independent (not sure how whether they'd be Brownian though?)). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your example, as @Brian B highlighted, it is conceivable that the price hedged with $V_1$ and the price hedged with $V_2$ are different, but then there's an arbitrage opportunity right there. If $V, V_1, V_2$ are driven by only two Brownian motions, you could then construct a portfolio that would have positive instantaneous excess return (try it). &lt;/p&gt;&#xA;" OwnerUserId="7715" LastActivityDate="2014-08-12T16:37:26.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14375" PostTypeId="1" CreationDate="2014-08-12T17:34:46.783" Score="7" ViewCount="1262" Body="&lt;p&gt;It seems to me that the optimality of the Kelly Criterion relies on the assumption that it is in an investor's best interest to maximize his portfolio's expected growth rate.  Why would he care what the expected growth rate is?  Shouldn't his objective be to maximize his expected terminal wealth, or rather the utility of his terminal wealth?&lt;/p&gt;&#xA;" OwnerUserId="2303" LastEditorUserId="2303" LastEditDate="2014-08-12T17:46:54.877" LastActivityDate="2014-08-13T00:22:57.183" Title="Why maximize expected growth rate?" Tags="&lt;portfolio-optimization&gt;&lt;kelly-criterion&gt;&lt;utility-theory&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14376" PostTypeId="1" AcceptedAnswerId="14381" CreationDate="2014-08-12T18:33:16.440" Score="0" ViewCount="293" Body="&lt;p&gt;I'm interested to know if there is a trustworthy ranking of master's degree in quantitative finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm specifically interested in some recruiter's perspective or experience, if available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ask because I would like to join next year the master's degree in quantitative finance in &lt;a href=&quot;https://www.ethz.ch/en.html&quot; rel=&quot;nofollow&quot;&gt;ETH Zurich&lt;/a&gt;, so if you have any opinion on that specific university it would be great!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you all in advance.&lt;/p&gt;&#xA;" OwnerUserId="11794" LastActivityDate="2014-08-13T01:15:43.030" Title="Is there a trustworthy ranking of quantitative finance degrees?" Tags="&lt;research&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14377" PostTypeId="2" ParentId="14375" CreationDate="2014-08-12T18:38:52.350" Score="8" Body="&lt;p&gt;The Kelly criterion is just one approach to portfolio construction (or bet sizing) that considers the risk-return tradeoff. There are many possible strategies (static or dynamic) that incorporate other criteria such as the maximum drawdown, probability of ruin, etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As pointed out by @John, Kelly is maximizing the log of wealth, which is equivalent to saying utility is the log of wealth.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the coin tossing analogy where you bet on a sequence of biased coin tosses.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the $k$th toss you bet $B_k$ dollars and win $B_k$ with probability $p &amp;gt; 1/2$ or lose $B_k$ with probability $1-p &amp;lt; 1/2$.  After $n$ trials your expected wealth is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E(W_n) = W_0 + \sum_{k=1}^{n} (2p-1)B_k$$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the game has a positive expectation you would maximize the expected value by betting all your available wealth on each trial.  However, the bold strategy has probability of ruin $1-p^n$ and  $\lim_{n \rightarrow \infty}(1-p^n)=1$. So maximizing expected terminal wealth has for most people an unacceptable downside risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The standard Kelly approach is to bet a fixed fraction $f$ of wealth at each trial.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After each trial, the total wealth assuming even odds payoffs is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$W_n= W_0\prod_{k=1}^n(1+fX_k),$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $X_1,X_2,\ldots$ are i.i.d. binary random variables with $P(X_k=1)=p$ and $P(X_k=-1)=1-p$.  Then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\log W_n= \log W_0+\sum_{k=1}^n\log (1+fX_k),\\\ E\left[\log \left(\frac{W_n}{W_0}\right)^{1/n}\right]= p\log (1+f)+(1-p)\log(1-f),$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the expected value is maximized in favorable games $(p &amp;gt; 1/2)$ when&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f =f^*= 2p-1.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, the Kelly criterion maximizes both the expected logarithm of terminal wealth and the expected &quot;growth-rate&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the original paper, Kelly addressed a problem in the transmission of information and used the gambling analogy without reference to portfolio construction or utility.  I would surmise that the strategy was proposed because of a number of desirable asymptotic properties.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The foundation of the strategy is the notion of fixed-fraction or proportional betting. If there is no positive lower bound on the bet size (i.e., infinitely divisible capital) then if $p &amp;gt; 1/2$ and $0 &amp;lt; f &amp;lt; 1$ there is zero probability that $W_n = 0$.  Defining the growth rate as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$G_f :=  E\left[\log \left(\frac{W_n}{W_0}\right)^{1/n}\right]= p\log (1+f)+(1-p)\log(1-f),$$ then if $G_f &amp;gt;0$ the Strong Law of Large Numbers implies that, almost surely,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\lim_{n \rightarrow \infty} \log \left(\frac{W_n}{W_0}\right)^{1/n}= G_f &amp;gt; 0,\\ \lim_{n \rightarrow \infty}W_n = \infty.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, the optimal-$f$ strategy which maximizes $G_f$ and $E[\log W_n]$ has an expected time to reach a specified goal that is asymptotically less than any other strategy (including non-proportional strategies).&lt;/p&gt;&#xA;" OwnerUserId="8153" LastEditorUserId="8153" LastEditDate="2014-08-13T00:22:57.183" LastActivityDate="2014-08-13T00:22:57.183" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14379" PostTypeId="2" ParentId="14334" CreationDate="2014-08-12T21:32:57.430" Score="1" Body="&lt;p&gt;Your question is too broad, but I there is plenty of examples of uses of machine learning to mimic human behaviour. For instance deep learning has been used 25 years ago to &lt;a href=&quot;http://yann.lecun.com/exdb/lenet/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;read checks in bank&lt;/a&gt;s, or &lt;a href=&quot;http://research.microsoft.com/pubs/67119/svmtutorial.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;support vector machines&lt;/a&gt; 15 years ago to implement artificial vision, or &lt;a href=&quot;http://www.aut.upt.ro/~curiac/10.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;bayesian networks to mimic expert diagnosis&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess it would not be that hard to use machine learning in your case if you can implement &lt;strong&gt;supervised learning&lt;/strong&gt;. It mean you should have a database of human decision $D$ associated with the product $P$ and the market context $C$.&#xA;Then your goal will be to emulate the function:&#xA;$$D=F(P,C)+\varepsilon.$$&#xA;Of course (as usual in machine learning), you will need to focus on pre-processing to be sure the characteristics of the product and the market context are mixed in $F$ a convenient way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you will have to choose a class of model ; it is difficult to help you at such an early stage since a description of the variables and the number of data are needed. Nevertheless I gave details on &lt;a href=&quot;https://quant.stackexchange.com/questions/3814/multilayer-perceptron-neural-network-for-time-series-prediction/3816#3816&quot;&gt;Artificial Neural Networks on quant.stackexchange&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;you should look after credit scoring. It models the way a consumer will be risky for a credit.&lt;/li&gt;&#xA;&lt;li&gt;Neural networks are usually good to estimate a probability. It comes from the fact that if you train them on a database with 0 or 1 as outputs (for you, will be the observation of an exercise or not), they end up with a real between 0 and 1, i.e. the probability of an exercice.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2014-08-12T22:50:37.790" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14380" PostTypeId="1" CreationDate="2014-08-12T23:00:49.557" Score="1" ViewCount="5359" Body="&lt;p&gt;In the past, I have used the package RBloomberg to directly pull bloomberg data into R. I've also seen it go by the names Rbbg or R[Name Redacted]. It seems to me, however, that this package no longer exists. Is it still out there somewhere? If not, is there a package that achieves the same purpose?&lt;/p&gt;&#xA;" OwnerUserId="11795" LastActivityDate="2016-08-30T19:45:37.673" Title="Integrating R with Bloomberg" Tags="&lt;r&gt;&lt;bloomberg&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14381" PostTypeId="2" ParentId="14376" CreationDate="2014-08-13T01:15:43.030" Score="1" Body="&lt;p&gt;Though I have not used them in regards to Master's Degree studies for myself. www.quantnet.com seems to have a pretty good site for such information.  They also have a forum that is pretty active where you can ask questions you may have about quantitative studies as well as school rankings.&lt;/p&gt;&#xA;" OwnerUserId="11748" LastActivityDate="2014-08-13T01:15:43.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14382" PostTypeId="2" ParentId="12872" CreationDate="2014-08-13T01:22:16.037" Score="1" Body="&lt;p&gt;I don't know a tutorial on the Internet but I have a book on the topic that I think you could be interested in:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1118316673&quot; rel=&quot;nofollow&quot;&gt;Counterparty Credit Risk and Credit Value Adjustment: A Continuing Challenge for Global Financial Markets&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The book is a non-mathematical introduction to counter-party credit risk. It introduces concepts such as wrong-way risk, netting, potential-future exposure etc. Please give a try.&lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="467" LastEditDate="2014-09-12T02:31:27.297" LastActivityDate="2014-09-12T02:31:27.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14383" PostTypeId="1" CreationDate="2014-08-13T02:29:24.487" Score="2" ViewCount="2092" Body="&lt;p&gt;For black box testing, I was hoping that I could replicate the ADX + DI+ and DI- indicators that are provided in trading platforms such as ThinkOrSwim, ScottradeElite etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I noticed that even after applying the formula I found on &lt;a href=&quot;http://en.wikipedia.org/wiki/Average_directional_movement_index&quot; rel=&quot;nofollow noreferrer&quot;&gt;WikiPedia&lt;/a&gt;, I noticed that initially calculated data tends to be off by a large margin when compared to ThinkOrSwim or ScottradeElite.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example spreadsheet is based on HIMX @ &lt;a href=&quot;https://docs.google.com/spreadsheets/d/1jBv1C-XxmhdxwqztsqyFVxSeNxWNkor_DDZ3JcjjJYo/edit?usp=sharing&quot; rel=&quot;nofollow noreferrer&quot;&gt;Google Drive&lt;/a&gt;.&#xA;In the spreadsheet, you will see the ADX + DI oscillators that I calculated. Here is the screenshot of my calculated ADX + DI&#xA;&lt;img src=&quot;https://i.stack.imgur.com/i6TIq.png&quot; alt=&quot;HIMX in self calculated spreadsheet&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is the screenshot based on ScottradeElite and ThinkOrSwim for HIMX&#xA;&lt;img src=&quot;https://i.stack.imgur.com/8NxJf.png&quot; alt=&quot;HIMX in ScottradeElite&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/8gDVM.png&quot; alt=&quot;HIMX in ThinkOrSwim&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The period for the ADX &amp;amp; DI are 14 periods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been spending countless hours, trying to figure out why my calculated results would deviate from the existing trading platforms. However, I have not been able to spot mistake. Can anyone help me out by pointing out what I am missing? Thanks a bunch!&lt;/p&gt;&#xA;" OwnerUserId="8106" LastEditorUserId="12" LastEditDate="2015-05-19T16:22:05.440" LastActivityDate="2015-08-03T16:57:48.077" Title="How to fully replicate ADX + DI Indicators in Excel?" Tags="&lt;backtesting&gt;&lt;indicator&gt;&lt;excel&gt;&lt;moving-average&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2015-08-03T19:12:15.460" ContentLicense="CC BY-SA 3.0" />
  <row Id="14384" PostTypeId="2" ParentId="14380" CreationDate="2014-08-13T03:52:38.313" Score="3" Body="&lt;p&gt;Are you aware of the &lt;a href=&quot;http://findata.org/r-name-redacted/&quot; rel=&quot;nofollow&quot; title=&quot;findata site&quot;&gt;findata.org site&lt;/a&gt; and its directory?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code is also in a bazaar repository as well as GitHub repo.&lt;/p&gt;&#xA;" OwnerUserId="69" LastActivityDate="2014-08-13T03:52:38.313" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14385" PostTypeId="2" ParentId="14334" CreationDate="2014-08-13T08:08:54.920" Score="1" Body="&lt;p&gt;I'm not sure that machine learning would lead to any practical solutions here. Do you really have enough data for that kind of techniques?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would suggest a different approach: assume that the exercise is optimal, but just based on a different cost function than the expected pay-off. If you can find a function that replicates well enough the past exercise decisions, maybe you can use it to predict the future ones.&lt;/p&gt;&#xA;" OwnerUserId="6356" LastActivityDate="2014-08-13T08:08:54.920" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14386" PostTypeId="1" CreationDate="2014-08-13T09:22:32.137" Score="3" ViewCount="3854" Body="&lt;p&gt;I was reading a report last week that &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;“the carry on a 2s5s gilt curve flattener is negative to the tune of&#xA;  10bp over 6 months”&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and I realised I have little understanding of this concept and how this cost is calculated since the only cost of carry I ever studied in was storage costs for commodities in futures formulae in college.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There was a surprising lack of literature I could find on curve flattener cost of carry but I did find this thread &#xA;&lt;a href=&quot;http://www.wilmott.com/messageview.cfm?catid=3&amp;amp;threadid=82512&quot; rel=&quot;nofollow noreferrer&quot;&gt;Roll down and Carry for 2/5&lt;/a&gt; on the Wilmott Forums which gave a ballpark formula as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$DV01*(2s5s slope-(5y1y-2y1y))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ballpark formula is fine for me since this is just an intuition exercise. &lt;strong&gt;Can someone explain this formula to me and make sure my interpretation is correct?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;DV01:&lt;/strong&gt; Portfolio sensitivity to yield changes&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;2s5s slope:&lt;/strong&gt; the return from selling the 2yr position and buying the 5 yr in the bear flattening position&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;5y1y/2y1y:&lt;/strong&gt; the costs of buying and selling the positions in one years time when I exit the trade&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Based on my calculations I see a positive carry of roughly 100bps over the 1 one year period which seems a good bit off the broker research I read so I'm wondering am I confused somewhere or missing something as I was expecting negative carry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My DV01 is the average of a short gilt benchmark over the last two years and I calculated the rates one year from now by simply strapping the curve&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$5y1y: (1+y_5 )^5 (1+f_1 )^1=(1+y_6 )^6$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$2y1y: (1+y_2 )^2 (1+f_1 )^1=(1+y_3 )^3$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/yoEyd.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="5786" LastEditorUserId="5786" LastEditDate="2014-08-13T10:52:29.840" LastActivityDate="2014-08-13T17:07:13.167" Title="Cost of Carry Bear Flattener" Tags="&lt;fixed-income&gt;&lt;yield-curve&gt;&lt;bond&gt;&lt;credit-risk&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="14387" PostTypeId="2" ParentId="14386" CreationDate="2014-08-13T16:40:46.713" Score="4" Body="&lt;p&gt;In this context, I believe carry refers to the sum of &quot;pure&quot; carry + roll down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Carry, in the most general sense, is the return of a position in a static world; i.e., assuming time is the only variable that is changing, what's your holding period return on a trade?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you buy a bond, the &quot;total carry&quot; is the sum of &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) &quot;Pure&quot; carry – you get interest accrual and coupon payments. Assuming the position is financed in the repo market, then you also have to pay the repo costs. So the &quot;pure carry&quot; can be calculated as &quot;$\text{coupon income} - \text{repo costs}$&quot;. This gives you the carry in dollar terms. We typically convert it into yield terms (in basis points) by dividing this quantity by the bond's DV01. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An alternative, in fact far more used way of computing pure carry, is &quot;$\text{forward yield} - \text{spot yield}$&quot;. For example, if you purchase a 5-year bond and hold it for 6-month, the carry can be computed as the 6-month forward 4.5y yield, minus the current spot yield. This method is slightly more accurate then the first method described above, since it also accounts for the &quot;pull-to-par&quot; effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Rolldown – the yield curve is typically not flat. If it's upward sloping, yield will decline as time passes by. This is an additional source of static return. Rolldown is typically computed as the difference between the current yield, and the yield x-month later, assuming an unchanged yield curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To summarize, the total 6-month carry (&quot;roll and carry&quot; or &quot;RD&amp;amp;C&quot;) for, say a 5-year bond is&#xA;= (6-month forward 4.5y yield - 5y yield) + (5y yield - 4.5y yield) = 6m forward 4.5y yield - 4.5y yield.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of a flattener, you simply compute the roll &amp;amp; carry for both legs, and then take the difference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your title, you mentioned &quot;BEAR&quot; flattener. Bear flatteners are typically structured using options. For example, you may buy a 6m2y payer, while selling a duration-weighted 6m5y payer. The carry of this trade would be much more complex - there will be carry from rolling down the yield curve, carry from time decay, and carry from changes in the vol surface.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2014-08-13T17:07:13.167" LastActivityDate="2014-08-13T17:07:13.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14388" PostTypeId="1" CreationDate="2014-08-13T17:07:55.147" Score="3" ViewCount="1707" Body="&lt;p&gt;The following is a summary of the derivation of the Black-Scholes equation as given on wikipedia (&lt;a href=&quot;http://en.wikipedia.org/wiki/Black-Scholes_equation#Derivation&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://en.wikipedia.org/wiki/Black-Scholes_equation#Derivation&lt;/a&gt;) - I have a question regarding the assumption that the specified portfolio is self-financing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have a two asset market:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dB_t = B_t r dt $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS_t = S_t (\mu dt + \sigma dW_t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We introduce a European option with price $v(t,S_t)$ at time $t$. We now consider a portfolio consisting of one option and -$\frac{\partial v}{ \partial S}$ stocks. Therefore if $X_t$ is our wealth at time $t$, we must have $X_t = v(t,S_t) - \frac{\partial v}{ \partial S} S_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is then claimed that we have $dX_t = dv(t,S_t) -  \frac{\partial v}{ \partial S} dS_t$, as the portfolio is self-financing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it seems to me that if we have a constant holding of 1 option in our portfolio, then the only way to make the overall portfolio self-financing is to have a constant holding of stock too (otherwise, if we increase/decrease our holding in stock, where do the extra funds for this come from?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typically, the way I have seen self-financing portfolios constructed is that the holding in 1 asset (for example, the risk-free asset) is not explicitly specified, and is determined by the self-financing condition (i.e. the condition that $X_t = \pi_t \cdot P_t$ and $dX_t = \pi_t \cdot dP_t$, where $\pi$ is the portfolio and $P_t$ is the price process - this gives a linear equation for the unspecified holding).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on the above, it seems that in order to have a self-financing portfolio where we hold a constant 1 option and $-  \frac{\partial v}{ \partial S}$ shares, we must also have a dynamic holding in the risk-free asset which allows us to ensure that we can always have $-  \frac{\partial v}{ \partial S}$ shares in our portfolio without injecting external funds (and thus breaking the self-financing condition). However, if we do have this holding of the risk-free asset in our portfolio as well, then our equation for the wealth process ($X_t = v(t,S_t) - \frac{\partial v}{ \partial S} S_t$) becomes incorrect, as we are not taking into account our holding in the risk-free asset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In summary, I don't believe that the portfolio of 1 option and $-\frac{\partial v}{ \partial S}$ shares specified in the wikipedia derivation of the Black-Scholes equation is self-financing, but the derivation makes use of the fact that it [i]is[/i] self-financing. Am I missing something?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the portfolio consisting of 1 option and $-\frac{\partial V}{\partial S}$ shares is self-financing, then we have the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_t = V(t,S_t) - \frac{\partial V}{\partial S}S_t$ (definition of wealth process)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dX_t = dV(t,S_t) - \frac{\partial V}{\partial S}dS_t$ (as portfolio is assumed to be self-financing)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dX_t = dV(t,S_t) - d(\frac{\partial V}{\partial S}S_t)$ (simply by definition of differentials)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equating the RHS of the second and third equations above gives:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dV(t,S_t) - \frac{\partial V}{\partial S}dS_t = dV(t,S_t) - d(\frac{\partial V}{\partial S}S_t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So $\frac{\partial V}{\partial S}dS_t = d(\frac{\partial V}{\partial S}S_t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using Ito's lemma on the RHS gives:&#xA;$\frac{\partial V}{\partial S}dS_t = d(\frac{\partial V}{\partial S})S_t + \frac{\partial V}{\partial S}dS_t + d&amp;lt;\frac{\partial V}{\partial S},S&amp;gt;_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And so $d(\frac{\partial V}{\partial S})S_t + d&amp;lt;\frac{\partial V}{\partial S},S&amp;gt;_t = 0$. (*)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, $d(\frac{\partial V}{\partial S}) = \frac{\partial^2 V}{\partial S \partial t} dt + \frac{\partial^2 V}{\partial S^2} dS_t + \frac{1}{2}\frac{\partial^3 V}{\partial S^3}d&amp;lt;S&amp;gt;_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore $d&amp;lt;\frac{\partial V}{\partial S},S&amp;gt;_t = \frac{\partial^2 V}{\partial S^2}S_t^2 \sigma^2 dt$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Plugging these into (*) gives:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{\partial^2 V}{\partial S \partial t} dt + \frac{\partial^2 V}{\partial S^2} dS_t + \frac{1}{2}\frac{\partial^3 V}{\partial S^3}d&amp;lt;S&amp;gt;_t + &#xA;\frac{\partial^2 V}{\partial S^2}S_t^2 \sigma^2 dt = 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore $\frac{\partial^2 V}{\partial S \partial t} dt + \frac{\partial^2 V}{\partial S^2} dS_t + \frac{1}{2}\frac{\partial^3 V}{\partial S^3}\sigma^2 S_t^2 dt + &#xA;\frac{\partial^2 V}{\partial S^2}S_t^2 \sigma^2 dt = 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The cofficient of $dS_t$ must be zero, so $\frac{\partial^2 V}{\partial S^2} = 0$, so $V(t, S) = f(t) + Sg(t)$. We could stop at this point, because we know that we can't satisfy the boundary condition $v(T,S) = \max(0,S-K)$, and therefore our assumption that we could hedge an option with a self-financing portfolio consisting of 1 option and $-\frac{\partial V}{\partial S}$ shares is wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, note that the coefficient of $dt$ must also be zero, and since we already have $\frac{\partial^2 V}{\partial S^2} = 0$, this gives $\frac{\partial^2 V}{\partial S \partial t} = 0$. Since $V(t, S) = f(t) + Sg(t)$, this implies that $g$ is constant. Therefore $\frac{\partial V}{\partial S}$ is constant, as I claimed in the comments below - i.e. in order for this to be a self-financing portfolio at all, the holding in the stock must be constant.&lt;/p&gt;&#xA;" OwnerDisplayName="user11800" LastEditorUserId="26242" LastEditDate="2018-05-14T08:24:49.280" LastActivityDate="2018-05-14T08:24:49.280" Title="Black-Scholes Equation - Riskless portfolio derivation" Tags="&lt;black-scholes&gt;&lt;replication&gt;&lt;black-scholes-pde&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="14389" PostTypeId="1" CreationDate="2014-08-13T17:21:01.097" Score="2" ViewCount="182" Body="&lt;p&gt;I am somewhat familiar with options but am wondering how to price calls/puts on this one:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;European exercise&lt;/li&gt;&#xA;&lt;li&gt;&quot;Jumps&quot; in underlying may occur&lt;/li&gt;&#xA;&lt;li&gt;Takes physical delivery upon exercise (is this even relevant?)&lt;/li&gt;&#xA;&lt;li&gt;Fractional contracts not allowed (technically, though it should be arbitrage-free in reality)&lt;/li&gt;&#xA;&lt;li&gt;Underlying's value fluctuates in short-term (i.e. supply/demand) but generally &lt;em&gt;decays&lt;/em&gt; over long-term&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I am thinking you would input underlying price, volatility, time, and discount rate (decay), accepting some form of GBM. Not really sure though. Can someone please share 'what' this option is and the pricing models available? It seems something like a commodity or futures option but my knowledge in this arena is limited. I would like some formulas (or guidance towards) on how to price this. I have Excel, Matlab, and Maple at my disposal. Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="11802" LastEditorUserId="11802" LastEditDate="2014-08-13T17:32:36.937" LastActivityDate="2014-08-13T19:34:42.773" Title="How would you price this kind of derivative?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;derivatives&gt;&lt;asset-pricing&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14390" PostTypeId="2" ParentId="557" CreationDate="2014-08-13T19:12:14.043" Score="4" Body="&lt;p&gt;You should take a look on &lt;a href=&quot;http://www.coralblocks.com/index.php/category/coralfix/&quot; rel=&quot;nofollow&quot;&gt;CoralFIX&lt;/a&gt; which is currently the fastest FIX engine in the market. The main problem with most Java FIX engines, commercial and open-source, is that they create a lot of garbage just by parsing bytes into a &lt;code&gt;FixMessage&lt;/code&gt; object. And that's not counting the amount of garbage the network I/O layer is creating itself. Garbage leads to latency and variance due to GC overhead, as you probably know.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whether you need a &lt;em&gt;low-latency trading platform&lt;/em&gt; or not, that's a question only you can answer, but one thing is certain: low-latency and low-variance are never bad.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To give you an idea of what low-latency is for FIX, in our latest benchmarks we were able to parse a complete FIX message (with timestamp and everything) in less than 650 nanoseconds. This parsing does not produce any garbage so no GC overhead ever happens.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course you must add on top of that the network i/o latencies. That's a different ball game unrelated to FIX. For some network i/o benchmarks in Java you can read &lt;a href=&quot;http://www.coralblocks.com/index.php/2014/04/coralreactor-vs-netty-performance-comparison/&quot; rel=&quot;nofollow&quot;&gt;this article&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The full details of CoralFIX benchmark can be found &lt;a href=&quot;http://www.coralblocks.com/index.php/2014/07/coralfix-performance-numbers/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt; I am one of the developers of CoralFIX.&lt;/p&gt;&#xA;" OwnerUserId="11804" LastEditorUserId="11804" LastEditDate="2015-09-02T22:19:23.133" LastActivityDate="2015-09-02T22:19:23.133" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14391" PostTypeId="1" CreationDate="2014-08-13T19:34:31.060" Score="3" ViewCount="941" Body="&lt;p&gt;I'm working on the following task:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Given quarterly data:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;a time series representing the 1-year realized (10 years of data)&#xA;rates of default on a portfolio of mortgages&lt;/li&gt;&#xA;&lt;li&gt;a slew of realized (10 years of data) macroeconomic time series. Each time series may or may not be relevant&lt;/li&gt;&#xA;&lt;li&gt;A stressed scenario of those same macroeconomic time series for 2 years&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Estimate the probability of default using the stressed data.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I don't actually know anything about underlying distributions. The only data I have for inference are these time series.&lt;/p&gt;&#xA;&lt;p&gt;My initial approach was something like this: I would first make every time series stationary. Then eliminate macroeconomic variables that were not significantly correlated with my dependent variable. Then use a stepwise method to determine the best variables to use in a linear regression. Then I would include those exogenous variables while fitting an ARIMA model. Along the way I would do several tests (e.g., autocorrelation, multicollinearity, stationarity, etc.). Then use that model for prediction.&lt;/p&gt;&#xA;&lt;p&gt;Note that I actually have several different &amp;quot;portfolios&amp;quot; which I am fitting. Using my above procedure, some of the stressed scenarios appear unreasonable. So, I began looking for totally different alternatives. Are there any suggestions?&lt;/p&gt;&#xA;&lt;p&gt;I realize this is an unreasonably broad question. To narrow the scope, I've done some brief research and believe some viable alternatives might include:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Calibrating some dynamic transition densities using Bayesian inference and MCMC&lt;/li&gt;&#xA;&lt;li&gt;Calibrating a conditional Vasicek model that allows of autocorrelation&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The problem is, I'm not too familiar with these methods and would want to make efficient use of my time.&lt;/p&gt;&#xA;&lt;p&gt;Would you suggest I attempt implementing these alternatives? Or some other alternative?&lt;/p&gt;&#xA;&lt;p&gt;Do you have any advice for implementation in R?&lt;/p&gt;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="5407" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2014-12-18T02:52:11.740" Title="Stress Testing Methods" Tags="&lt;time-series&gt;&lt;statistics&gt;&lt;r&gt;&lt;calibration&gt;&lt;stress-testing&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14392" PostTypeId="2" ParentId="14389" CreationDate="2014-08-13T19:34:42.773" Score="1" Body="&lt;p&gt;You can use the &quot;Merton Jump Diffusion Model&quot; to price European Options with jumps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other points of your question are rather of practical relevance only. The negative drift of the underlying is usually not important, because the pricing goes under the riskneutral measure $Q$.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-08-13T19:34:42.773" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14393" PostTypeId="2" ParentId="10971" CreationDate="2014-08-13T19:40:03.173" Score="1" Body="&lt;p&gt;Disk I/O has a big latency cost, so you &lt;strong&gt;must&lt;/strong&gt; use an &lt;em&gt;asynchronous&lt;/em&gt; logging framework and the fastest way to pass messages from thread A to thread B is to use the &lt;em&gt;disruptor pattern&lt;/em&gt;. For a good &lt;em&gt;event sourcing&lt;/em&gt; (i.e. logging to a file &lt;em&gt;without&lt;/em&gt; log levels like info, warn, error, etc.) framework you can take a look on &lt;a href=&quot;http://www.coralblocks.com/index.php/category/corallog/&quot; rel=&quot;nofollow&quot;&gt;CoralLog&lt;/a&gt;. It can log a 64-byte message in 87 nanoseconds on average. When it comes to throughput it can easily log 4 million 64-byte messages per second. That should be more than enough for most HFT strategies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt; I am one of the developers of CoralLog.&lt;/p&gt;&#xA;" OwnerUserId="11804" LastActivityDate="2014-08-13T19:40:03.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14394" PostTypeId="2" ParentId="14388" CreationDate="2014-08-13T19:46:06.533" Score="3" Body="&lt;p&gt;You are correct that showing the self-financing condition for the BS-portfolio is not as straightforward as one may think:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A portfolio $V_t(\alpha_t,\beta_t)$ (for stock $S_t$ and zerobond $B_t$) is self-financing iff:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V_t=\alpha_tS_t+\beta_t B_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It further implies&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dV_t=\alpha_tdS_t+\beta_tdB_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To replicate a derivative $C(S_t,t)$ by a self-financing portfolio of stock and bond, set: $$dV_t=dC_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The dynamics of $dC$ can be specified using Ito's Lemma on $C(S_t,t)$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dC=\partial_tCdt+\partial_sCdS+\frac{1}{2}\sigma^2S_t^2\partial_{SS}Cdt=\partial_SCdS_t+(\partial_tC+\frac{1}{2}\sigma^2S_t^2\partial_{SS}C)dt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next assume $C$ satisfies the BS-PDE:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\partial_tC+\frac{1}{2}\sigma^2S_t^2\partial_{SS}C=rC-rS_t\partial_S C$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Inserting this into $dC$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dC=\partial_SCdS_t+(C-S_t\partial_SC)rdt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we further have the bond-dynamics $dB_t=B_trdt$, so:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dC=\partial_SC\cdot dS_t+\left(\frac{C_t}{B_t}-\frac{S_t}{B_t}\partial_SC\right)\cdot dB_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, the coefficients before $dS_t$ and $dB_t$ are exactly the self-financing portfolio weights:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\left(\alpha_t=\partial_SC,\,\beta_t=\dfrac{C_t}{B_t}-\dfrac{S_t}{B_t}\partial_SC\right)$$&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-08-13T22:02:29.913" LastActivityDate="2014-08-13T22:02:29.913" CommentCount="22" ContentLicense="CC BY-SA 3.0" />
  <row Id="14395" PostTypeId="2" ParentId="8904" CreationDate="2014-08-13T19:56:08.757" Score="2" Body="&lt;p&gt;A pre-certified FIX engine won't spare you from doing the certification process yourself. This is a requirement for all serious exchanges. Moreover, CME is a good exchange with tons of features and many different order types from which you will probably just need a small subset. There is no such thing as a &lt;em&gt;plug-and-play&lt;/em&gt; FIX engine. You will have to do some work to integrate the FIX engine with your order flow system. I believe that more important than choosing a pre-certified FIX engine is to choose one that offers a very intuitive API so you have no headaches integrating it with your systems. Also, if you are concerned with latency, you should choose one that produces no garbage (for .NET and Java environments) and has a good throughput. For an example of an intuitive FIX engine take a look on &lt;a href=&quot;http://www.coralblocks.com/index.php/2014/07/getting-started-with-coralfix/&quot; rel=&quot;nofollow&quot;&gt;CoralFIX&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt; I am one of the developers of CoralFIX. &lt;/p&gt;&#xA;" OwnerUserId="11804" LastActivityDate="2014-08-13T19:56:08.757" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14396" PostTypeId="1" CreationDate="2014-08-13T20:16:45.810" Score="1" ViewCount="85" Body="&lt;p&gt;I'm looking for the best way to value a portfolio of consumer loans that have NOT reached maturity and for which I do observe the payment/default history to date?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm working with a large database of consumer (peer-to-peer) loan data. The majority of these loans have yet to reach maturity. Still, I observe the payment history as of, say, today. For each loan, I observe a vector of borrower characteristics (accurate to the time of loan origination) including credit score, city/state, occupation, monthly income, debt/income, homeowner indicator, loan purpose, previous loan outcomes, etc. All the loans mature after 36 months.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to compare the performance of various bundles of these loans. I'm not sure what's the approach. Ideally, I'd like to fit the data to some structural credit model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Until now, I've been using the following approach for computing ROI (found here &lt;a href=&quot;http://www.nickelsteamroller.com/#!/stats/roi&quot; rel=&quot;nofollow&quot;&gt;http://www.nickelsteamroller.com/#!/stats/roi&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ROI \triangleq \frac{\sum_{i} \left(I_i - S_{i} - \textsf{E}[L_{i}] \right)}{\sum_{i}  \left(\frac{I_{i}}{r_{i}}\right)}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$I_{i} \triangleq $ cumulative interest payments received by creditors on loan $i$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_{i} \triangleq $ interest rate on loan $i$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_{i} \triangleq $ cumulative loan servicing fees paid by creditors on loan $i$, and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\textsf{E}[L_{i}] \triangleq $ expected loss on remaining principle for loan $i$. To compute expected loss, I use the following loss estimates conditional on loan status:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 Month Late: 70.00%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2 Months Late: 80.00%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3+ Months Late: 95.00%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Charged Off: 100.00%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Current: 0.00%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Default: 96.00%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fully Paid: 0.00%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Grace Period: 30.00%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Late: 50.00%&lt;/p&gt;&#xA;" OwnerUserId="11805" LastEditorUserId="848" LastEditDate="2014-08-15T15:23:16.840" LastActivityDate="2014-08-15T15:23:16.840" Title="How to value a portfolio of non-mature consumer loans?" Tags="&lt;statistics&gt;&lt;portfolio-management&gt;&lt;econometrics&gt;&lt;asset-pricing&gt;&lt;debt&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14397" PostTypeId="1" CreationDate="2014-08-14T01:18:48.440" Score="5" ViewCount="6011" Body="&lt;p&gt;I've plotted 30-year moving averages across time for a couple of portfolios, and I was wondering how to calculate a 95% CI for the these moving average data (i.e., across all moving average data points, what is the CI?). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the points are clearly not independent of one another, I would think just using ±1.96 SD would be incorrect (as this nonindependence would be a violation of the central limit theorem), but I could be wrong and am not sure how this is done. Any links, book references, and recommended R packages/functions are also appreciated. Thank you!&lt;/p&gt;&#xA;" OwnerUserId="11809" LastActivityDate="2016-10-31T05:58:58.773" Title="How to Calculate Confidence Intervals for Moving Averages Given Nonindependence?" Tags="&lt;volatility&gt;&lt;time-series&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14399" PostTypeId="2" ParentId="14388" CreationDate="2014-08-14T20:08:28.933" Score="0" Body="&lt;p&gt;To show: $X:=(1,-\partial_SC)$ is a self-financing portfolio:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X\text{ self-financing}\leftrightarrow dX_t=adC_t+bdS_t\,\forall t\geq0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $C(S_t,t)\in C^2$, then by Ito formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dC=\partial_tCdt+\partial_sCdS+\frac{1}{2}\sigma^2S_t^2\partial_{SS}Cdt=\partial_SCdS_t+(\partial_tC+\frac{1}{2}\sigma^2S_t^2\partial_{SS}C)dt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $C(S_t,t)$ satisfy the BS-PDE in discounted form:&#xA;$$\partial_tC+\frac{1}{2}\partial_{SS}C\sigma^2S^2=0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Undiscounted form is $\partial_tC+\frac{1}{2}\sigma^2S^2\partial_{SS}C=rC-rS\partial_S C$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Plugged in:&#xA;$$dC=\partial_SCdS$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So we get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dX=adC+bdS=1dC-\partial_SCdS=\partial_SCdS-\partial_SCdS=0\,\,\forall t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So we have a riskless portfolio which satisfies the self-financing condition. (q.e.d.)&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-08-14T20:17:33.667" LastActivityDate="2014-08-14T20:17:33.667" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14400" PostTypeId="1" AcceptedAnswerId="14718" CreationDate="2014-08-14T22:23:58.657" Score="2" ViewCount="1692" Body="&lt;p&gt;I have trouble understanding what type of maturity to use when calculating &lt;code&gt;CAPM&lt;/code&gt;. My professor uses the &lt;code&gt;3-Month risk-free rate&lt;/code&gt; to backtest a portfolio strategy that uses a lookback period of 1 year daily returns. Another professor uses the &lt;code&gt;10-year risk-free rate&lt;/code&gt;? Shouldn't one use the maturity that corresponds to the holding period as it best describes the opportunity forfeited? Is the risk-free rate chosen out of preference? wouldn't this just under/overstate CAPM?&lt;/p&gt;&#xA;" OwnerUserId="11814" LastEditorUserId="11814" LastEditDate="2014-08-14T22:35:39.340" LastActivityDate="2014-09-12T20:35:31.877" Title="Risk-Free Rate determinant in CAPM" Tags="&lt;interest-rates&gt;&lt;capm&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14401" PostTypeId="1" AcceptedAnswerId="14717" CreationDate="2014-08-14T22:35:58.970" Score="1" ViewCount="261" Body="&lt;p&gt;According to this wikipedia: &lt;a href=&quot;http://en.wikipedia.org/wiki/Earnings_surprise&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Earnings_surprise&lt;/a&gt;, the SUE score is a &quot;standardized&quot; difference between reported earnings and expected earnings. Therefore, can the SUE score be interpreted as a Z-score assuming that the underlying earnings surprise data is normally distributed?&lt;/p&gt;&#xA;" OwnerUserId="11815" LastActivityDate="2014-09-12T19:14:32.240" Title="Can Standardized unexpected earnings be considered a Z-score" Tags="&lt;normal-distribution&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14403" PostTypeId="2" ParentId="12618" CreationDate="2014-08-15T22:37:49.220" Score="3" Body="&lt;p&gt;We use node.js at alta5. The event-driven, non-blocking I/O model performs well in data-intensive real-time applications like a trading platform.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://alta5.com/&quot; rel=&quot;nofollow&quot;&gt;http://alta5.com/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11822" LastActivityDate="2014-08-15T22:37:49.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14405" PostTypeId="1" AcceptedAnswerId="14743" CreationDate="2014-08-16T00:46:18.847" Score="4" ViewCount="2171" Body="&lt;p&gt;I've read some material related to pairs trading for equities and I understand the process of finding non-stationary pairs price series that can be cointegrated to form a stationary series. The basic idea being to trade on the oscillations about the equilibrium value of the spread. While i understand how this is accomplished with equities, i'm not sure how suitable implied volatility pairs on equity options are identified since both implied volatility series would already be stationary and so cointegration would not be required. Can someone please explain to how suitable implied volatility pairs are identified?&lt;/p&gt;&#xA;" OwnerUserId="914" LastActivityDate="2014-09-15T19:39:56.940" Title="How does Volatility Pairs Trading work?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;time-series&gt;&lt;implied-volatility&gt;&lt;pairs-trading&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14406" PostTypeId="2" ParentId="9380" CreationDate="2014-08-16T05:47:59.780" Score="1" Body="&lt;p&gt;When we say the stock price is fat-tailed (or Cauchy distributed) , we mean the &quot;return&quot; follows such distribution, which is essentially the ratio between stock price at time n+1 and time n. If you know a litter bit about Cauchy distribution, you know that it is the distribution of the ratio between two i.i.d. normal r.v.. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, the stock price of two consecutive days are probably not iid normal rv, so Cauchy is probably too aggressive. But the simple fact that we try to understand the stock price using the concept of &quot;ratio&quot; makes the fat-tail phenomena somewhat unavoidable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To determine which specific distribution fits better, something like a likelyhood ratio test may be a good choice.&lt;/p&gt;&#xA;" OwnerUserId="11823" LastActivityDate="2014-08-16T05:47:59.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14407" PostTypeId="1" CreationDate="2014-08-16T17:25:57.503" Score="2" ViewCount="129" Body="&lt;p&gt;I have a feed in real time that lists the ask and bid orders.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each order consists of a value and a quantity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to calculate the percentage of short orders from the total orders in terms of quantity.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far i have this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    Sum(askOrderQuantities)/( Sum(askOrderQuantities+ Sum(bidOrderQuantities))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As far as i know selling is not the same as short. most ask orders are way above market price. This means that they will not go through anytime soon. Does this mean they are long because the seller is betting the price will go up?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&#xA;      I am trying to find a percentage that represents people going short of the total market, weighing in the quantity they are using. This is for the forex market.&#xA;I have the following data in real time:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   Order sheet&#xA;   Ticker&#xA;   Market trade history&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11825" LastEditorUserId="11825" LastEditDate="2014-08-16T23:52:07.167" LastActivityDate="2015-05-14T17:25:14.757" Title="Calculating short/long order percentages?" Tags="&lt;algorithmic-trading&gt;&lt;quantitative&gt;&lt;longshort&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14408" PostTypeId="2" ParentId="7260" CreationDate="2014-08-16T21:36:21.923" Score="4" Body="&lt;p&gt;There is no guarantee that the optimization method always converges! In an introduction the author of the package recommends using the &quot;hybrid&quot; solver, which starts out with the &quot;solnp&quot; and goes through the other solvers, if it doesn't converge. According to him, this should at least guarantee convergence in 90 % of the cases. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://unstarched.net/r-examples/rugarch/a-short-introduction-to-the-rugarch-package/&quot; rel=&quot;nofollow&quot;&gt;http://unstarched.net/r-examples/rugarch/a-short-introduction-to-the-rugarch-package/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11782" LastActivityDate="2014-08-16T21:36:21.923" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14409" PostTypeId="2" ParentId="14407" CreationDate="2014-08-16T22:42:24.203" Score="1" Body="&lt;p&gt;Perhaps you might have to &quot;match&quot; Tick data to the best bid/offer to see which price(s) go through... If say the spread is 35.50/36.50 and the tick at that moment is 36.50 then we can consider this to be &quot;buyer initiated&quot; and of course if the tick is 35.50 then it becomes &quot;seller initiated&quot;. That is to say if the price is above the average of the current spread we can consider it to &quot;buyer initiated&quot; and &quot;seller initiated&quot; if the price is below the average best bid/offer.  &lt;/p&gt;&#xA;" OwnerUserId="11814" LastActivityDate="2014-08-16T22:42:24.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14411" PostTypeId="2" ParentId="11551" CreationDate="2014-08-17T02:02:26.630" Score="1" Body="&lt;p&gt;Yes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, XLF and FAZ do not track the same underlying benchmark.&lt;br&gt;&#xA;-&gt; XLF tracks the S&amp;amp;P Financials Select Sector Index&lt;br&gt;&#xA;-&gt; FAZ tracks the Russell 1000 Financial Services Index&lt;br&gt;&#xA;I'll ignore that for this sake, because their baskets are likely still very similar. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pretending their benchmarks were the same, you would theoretically have a dead on (3x) hedge intraday. However, at the close of each day, you would be out of hedge. As soon as the market closes you would need to sell a bit of FAZ if the market is up, and buy a bit of FAZ if the market is down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's important to understand the underlying process of leveraged ETF's, and their need to rehedge at the end of the day. There's many good articles on the subject, a quick look found one: &lt;a href=&quot;http://math.nyu.edu/faculty/avellane/LETFRISKPROF.pdf&quot; rel=&quot;nofollow&quot;&gt;http://math.nyu.edu/faculty/avellane/LETFRISKPROF.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11827" LastActivityDate="2014-08-17T02:02:26.630" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14414" PostTypeId="1" CreationDate="2014-08-17T19:18:18.100" Score="4" ViewCount="540" Body="&lt;p&gt;Referring &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cao, Hansch, and Wang (2004) &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=565324&quot; rel=&quot;nofollow&quot;&gt;&quot;The Informational Content of an Open Limit Order Book&quot;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\mbox{WP}^{n_1 - n_2} = \frac{\sum_{j=n_1}^{n_2} (Q_j^d P_j^d + Q_j^s P_j^s)}{(Q_j^d + Q_j^s)}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Did someone know maybe some variation of that equation that penalizing quotes that are more away from best quotes? I think result of that formula is easy to manipulate by placing limit orders in large amount at prices that have very low execution probability in some time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to modify that formula, with inputing additional touching probability for each ask and bid level calculated from book market orders inflow in some sampled time T to ability for penalize levels on what orders can be easy cancelled before execution.&lt;/p&gt;&#xA;" OwnerUserId="6175" LastEditorUserId="6175" LastEditDate="2014-08-17T19:26:13.287" LastActivityDate="2014-08-17T19:26:13.287" Title="Mid-Point calculation with execution probability" Tags="&lt;limit-order-book&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14415" PostTypeId="1" AcceptedAnswerId="14416" CreationDate="2014-08-17T20:58:17.690" Score="4" ViewCount="145" Body="&lt;p&gt;$S_t$ is the random variable representing the risky asset price at time $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;M_t is the riskless asset. They are governed by the equations&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{dS_t}{dt}=\mu dt + \sigma dZ_t$ and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dM_t = rM_t dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Z_t$ is Brownian motion. If we define the discounted risky asset by $S_t^{*}=S_t/M_t$. How does the process $S_t^{*}$ become governed by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{dS_t^{*}}{dt}=(\mu-r) dt + \sigma dZ_t$ ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I cannot see why you subtract $rdt$.&lt;/p&gt;&#xA;" OwnerUserId="11723" LastActivityDate="2014-08-17T22:50:07.580" Title="Discounted risky asset stochastic process problem" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;&lt;stochastic-discount&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14416" PostTypeId="2" ParentId="14415" CreationDate="2014-08-17T22:41:39.200" Score="5" Body="&lt;p&gt;$$&#xA;\textbf{Preface}&#xA;$$&#xA;I am assuming log normal asset but this is not clear from the question? Or rather I have misinterpreted the question! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well as I see it from a a purely mathematical exercise&#xA;$$&#xA;d\left(\dfrac{S_t}{M_t}\right) =\frac{1}{M_t}dS_t - \frac{S_t}{M_t^2}dM_t +O(dt^2) &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;using Ito's lemma.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then we can sub in the original processes yields&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;d\left(\dfrac{S_t}{M_t}\right)&amp;amp;=&amp;amp;\frac{1}{M_t}S_t\left(\mu dt + \sigma dZ_t\right) - \frac{S_t}{M_t}\frac{1}{M_t}\left(M_t r dt\right)\\&#xA; &amp;amp;=&amp;amp; S^{*}_t\left(\mu dt +\sigma dZ_t\right) - S^{*}_trdt \\&#xA;&amp;amp;=&amp;amp; S^*_t\left[(\mu-r)dt+\sigma dZ_t\right]&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or finally &#xA;$$&#xA;\frac{dS^*_t}{S^*_t} = (\mu-r)dt+\sigma dZ_t&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="11834" LastEditorUserId="11834" LastEditDate="2014-08-17T22:50:07.580" LastActivityDate="2014-08-17T22:50:07.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14417" PostTypeId="2" ParentId="14050" CreationDate="2014-08-18T06:26:54.623" Score="0" Body="&lt;p&gt;What you're missing in your interpretation is what the sixth payment actually is. It is not the fifth cash flow or even the value of the fifth cash flow. It is the value of an annuity at t5 whose first payment occurs in one years/time periods time and is F5*(1+g). Or the last known dividend grown by one years worth of the growth rate. It is important to remember that the value of a annuity is calculated based on the assumption that the first payment occurs at t+1 and not t.&lt;/p&gt;&#xA;" OwnerUserId="11653" LastActivityDate="2014-08-18T06:26:54.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14418" PostTypeId="1" AcceptedAnswerId="14419" CreationDate="2014-08-18T08:07:01.637" Score="5" ViewCount="895" Body="&lt;p&gt;I have been doing some reading on factor models. In the literature it mentions that when creating a portfolio that maximises particular attributes it may lead to unwanted bias to other factors. I understand this part.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So they create 'true' factor scores which clean a factor of the influences of all the other factors. It mentions the use of cross-sectional regressions to simultaneously remove these side effects. It is this part I am unsure of. I do not know how they are 'cleaning' their factors and if this is a standard practise?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;further information&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A variable is decomposed into the true variable and the parts that are shared with other common variables. This is done using the residual variable methodology. &lt;/p&gt;&#xA;" OwnerUserId="7530" LastEditorUserId="7530" LastEditDate="2014-08-18T09:20:31.547" LastActivityDate="2014-09-26T13:52:19.847" Title="factor models and using cross section regression" Tags="&lt;statistics&gt;&lt;portfolio-management&gt;&lt;factor-models&gt;&lt;portfolio-optimization&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14419" PostTypeId="2" ParentId="14418" CreationDate="2014-08-18T12:41:08.863" Score="3" Body="&lt;p&gt;Speaking from equity quant factor building experience, it is a common practice to build multi-factor models by regressing one component against other(s) and using the residual scores. This is done to avoid bias as you mentioned - these biases could be from the factor itself (in different regimes, Quality / Momentum influencing each other - or earnings, value bringing opposite extremes to the portfolio ranking etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Robeco have done a few papers on regressed residual factors (mostly momentum), such as &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1911449&quot; rel=&quot;nofollow&quot;&gt;&quot;Short-Term Residual Reversal&quot;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="932" LastEditorUserId="2393" LastEditDate="2014-09-26T13:52:19.847" LastActivityDate="2014-09-26T13:52:19.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14420" PostTypeId="1" CreationDate="2014-08-18T12:44:12.690" Score="3" ViewCount="47" Body="&lt;p&gt;A regular affine process is defined to have the generator&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Af(x) = \sum_{k,l=1}^d(a_{kl}+\langle a_{I,kl},y\rangle)\frac{\partial^2f(x)}{\partial x_k\partial x_l}+\langle b+\beta x,\nabla f(x)\rangle - ...$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;see the bottom of page 8 of this following file: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://web.stanford.edu/~duffie/affine.pdf&quot; rel=&quot;nofollow&quot;&gt;http://web.stanford.edu/~duffie/affine.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, how do we know the matrix $M$, defined by $M_{kl} = (a_{kl}+\langle a_{I,kl},y\rangle)$ is always positive semidefinite? (I assume this must the be the case, but how does one show this? is there a general theorem which tells you this must be the case for the generator of a stochastic process?)&lt;/p&gt;&#xA;" OwnerUserId="3334" LastActivityDate="2014-08-18T12:44:12.690" Title="For an affine process, how do we know the second order term is positive definite?" Tags="&lt;affine-processes&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14421" PostTypeId="1" CreationDate="2014-08-18T15:03:00.947" Score="4" ViewCount="1734" Body="&lt;p&gt;When working on calibration for LMM model, we need to have Initial Libor quotes and Swaptions Black vol quotes on the market data. We have data provided by Bloomberg. However, before performing the calibration, we wish to check the coherence of the market data, e.i if we use the right Libor/Discount Rate for the swaption volatility cube (VCUB). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problems is i can not have the coherence of these data. The ATM swaps has the strike which is the swap rate interest at the present moment. The swap rate is calculable directly from the Libor quotes (deduced from the Discount Rate). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;L(t,T_i,T_{i+1}) = \frac{1}{T_{i+1}-T_{i}}(\frac{P(t,T_{i})}{P(t,T_{i+1})} - 1)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the SWPM tab of bloomberg, they said they build swaption VCUB data from EUR 45, which have built data yield curve, zero rate, forward rate ... for calculating swap/swaptions values. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I firstly used these Interest rate curve and recompute swap rate by myselft, I can not reproduce the ATM strike quoted on ATM swap strike matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I secondly use the quoted zero rate curve to recompute the discount curve, &#xA;$$&#xA;P(t,T_i) = \frac{1}{1+r_i T_i}&#xA;$$&#xA;Same thing, i can not reproduce the same values as Bloomberg quotes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, these values computed and quoted are approximative equal (relative error around 1% max). So i thing that could be due to the difference of day count, or somethings else. Ideally, i hope check every data are perfectly coherent  with theoretical formulas, in the way that the calibration result is not biased due to any kind of these error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first question is so does somebody has the idea of why that happens like that, is this normal? How to fixed these data coherence. (Error might come from my computations)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My second question is : is this a big issu if we perform a volatility calibration with these incoherence exist in our data?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks&lt;/p&gt;&#xA;" OwnerUserId="3507" LastActivityDate="2014-09-07T21:06:49.443" Title="Incoherence in Bloomberg Data in Swap Curve Builder (ICSV)" Tags="&lt;swaps&gt;&lt;bloomberg&gt;&lt;discount-factor-curve&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14422" PostTypeId="1" CreationDate="2014-08-18T16:39:18.410" Score="1" ViewCount="919" Body="&lt;p&gt;Was taking a look at an NZD spot deal that was traded on a Friday for value the following Tuesday (t+2). Somehow this trade became classified as a forward by our back office systems (dealer says they see it as a spot as do we) with trade date of the following Monday for same value. The trade was done after the NZD roll forward time so this all makes sense to me except for the forward part.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, I started digging a bit more and saw some references to there being some sort of &quot;hidden markup&quot; in the dealer's favor when this occurred. I tried thinking through it but couldn't figure out where the cost might be. Could anyone help me think through this?&lt;/p&gt;&#xA;" OwnerUserId="11806" LastActivityDate="2014-08-19T13:08:09.523" Title="Impact of NZD mid-day EST Roll forward" Tags="&lt;fx&gt;&lt;forward&gt;&lt;exchange&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14424" PostTypeId="1" CreationDate="2014-08-18T18:31:50.393" Score="2" ViewCount="112" Body="&lt;p&gt;I am currently analyzing a statistic that I believe will have the effect of hedgers having a positive or negative gamma position in certain stocks. In the case where I believe hedgers have positive gamma, I expect mean-reversion to be exhibited, and pressure to be exhibited on realized volatility. In the case of negative gamma, I expect trends to be exacerbated -- and realized volatility to rise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To analyze this effect intraday, I'm calculating the sqrt( sum( 5-min log returns) ) ). I believe this represents the realized volatility, but I'm not sure what statistic I can use to analyze the trending effect throughout the day. Any suggestions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="11827" LastActivityDate="2014-08-18T18:31:50.393" Title="Testing for the presence of a positive or negative gamma effect" Tags="&lt;volatility&gt;&lt;gamma&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14427" PostTypeId="2" ParentId="8943" CreationDate="2014-08-18T22:21:10.027" Score="1" Body="&lt;p&gt;Whether or not it is flawed in practice depends on dynamic the risk exposures really are.  Many factors or indices used for style analysis actually require dynamic trading to maintain - so you could potentially have a fund that trades a lot while still generating a return series that can be be modeled out of sample with static exposures. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One relatively simple approach for what you are trying to do is to use the Lasso (discussed in the paper).  This will achieve your goal of reducing factors as they coefficients will be shrunk towards zero.  Another more complex option would be to use Bayesian regression with informative priors to estimate factor exposures.  For example, you might have different priors on the exposure to SPY of a long/short equity fund vs. a merger arb fund.  Kruschke, author of Doing Bayesian Data Analysis, also showed an example of &quot;robust&quot; regression where the errors are assumed to follow a t-distribution.  Both of these approaches are pretty straightforward in R.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, if you do you want to explore dynamic exposures you could use a state space model to estimate time-varying parameters.  This is a bit more complex to implement, but one of the R packages that is useful here is dlm.  The package's author has written a book: Dynamic Linear Models with R.  There are also various slides from Yollin floating around online demonstrating how to estimating time-varying beta exposures using dlm.  You might want to check out Understanding Hedge Fund Alpha Using Improved Replication Methodologies by Chen &amp;amp; Tindall, which I believe a number of these approaches.&lt;/p&gt;&#xA;" OwnerUserId="4981" LastActivityDate="2014-08-18T22:21:10.027" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14428" PostTypeId="2" ParentId="14422" CreationDate="2014-08-19T02:41:02.033" Score="1" Body="&lt;p&gt;Note NZD trade dates change at 7am Wellington which is 3pm Eastern at this time of year (not mid-day).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming your trade was on Friday after 3pm EDT then:&#xA;- Trade Date would be Monday. &#xA;- Value Date of Tomorrow would be Tuesday (a short dated forward)&#xA;- Value Date of Spot would be Wednesday.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You mention your value was Tuesday - I would therefore agree with your back office that it is a (short dated) forward:  Tomorrow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As regards a &quot;hidden mark-up&quot;: I cannot think of a legitimate practice.  All would be misunderstandings that should be discussed and hopefully reversed.  If a counterparty thinks Tomorrow is Spot then an NZD/USD pricemaker effectively receives an extra day's interest (the difference between NZD and USD interest rates calculated from Tom/Next swap points). Similarly, someone could incur cost of Tom/Next if they have a resting order on an ECN, where in many cases time of Taker action sets Trade Date, around 7am Wellington and they find they traded for the wrong day. Hopefully the counterparty will cooperate.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;James&lt;/p&gt;&#xA;" OwnerUserId="5161" LastEditorUserId="5161" LastEditDate="2014-08-19T11:09:34.847" LastActivityDate="2014-08-19T11:09:34.847" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14429" PostTypeId="1" AcceptedAnswerId="14477" CreationDate="2014-08-19T08:09:54.793" Score="1" ViewCount="248" Body="&lt;p&gt;&lt;strong&gt;Quick Note&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question was already posted under the userID user8170. Reason being I could not access my account. Now I am able to login to my account I am reposting the question here and will delete it from the profile user8170 (no comments or answers were posted anyway).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to run a simple back test on a M&amp;amp;A strategy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea is to buy the target company for the length of the deal and obviously hope to see a profit. The weight given to each deal is decided by the size of the deal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some of the deals are part cash, part equity in my study. I have a field in my data called 'Stock Exchange Ratio - Buyer Shares' (SER). This field is defined as the number of shares being issued by the acquirer to the target.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for example if the acquirer called ABC is buying the target company called TAR in a part cash, part stock deal and the SER is 0.8. Then investors holding TAR will receive 0.8 shares of ABC for every TAR share they hold.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So when I have deals that are not 100% cash I will get extra equity exposure (from the acquirer) that I need to hedge as I understand it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rather than short every acquiring company and partly for simplicity I am going to short the MSCI World Index. I do not know how to calculate how much I need to hedge my portfolio against the index though? I have all the beta's for the acquiring companies.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  Portfolio&#xA;&#xA;  Acquirer Target  Deal Size    Weight      Stock Exchange Ratio - Buyer Shares&#xA;  ABC      DEF     $1,000m      50%         0&#xA;  MNO      LMN     $600m        30%         0.6&#xA;  GHI      QRS     $400m        20%         2.5&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The beta's for the 3 companies above are,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ABC 0.93&#xA;MNO 1.11&#xA;GHI 1.14&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7530" LastEditorUserId="7530" LastEditDate="2014-08-21T11:53:33.283" LastActivityDate="2014-08-22T16:03:03.290" Title="M&amp;A hedging an equity portfolio against an index" Tags="&lt;equities&gt;&lt;portfolio-management&gt;&lt;arbitrage&gt;&lt;hedging&gt;" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14430" PostTypeId="1" AcceptedAnswerId="14435" CreationDate="2014-08-19T11:30:34.390" Score="2" ViewCount="183" Body="&lt;p&gt;Apparently:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under a constant interest rate, the futures price is given by a deterministic time function times the asset price (I think I understand this). This means that the volatility of the futures price should be the same as that of the underlying asset price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not really sure how this is true. Is there any more intuitive explanation as to why this would hold?&lt;/p&gt;&#xA;" OwnerUserId="11723" LastActivityDate="2014-08-21T01:40:03.677" Title="Volatility of Futures" Tags="&lt;volatility&gt;&lt;futures&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14431" PostTypeId="1" CreationDate="2014-08-19T11:34:33.437" Score="0" ViewCount="240" Body="&lt;p&gt;I'm struggling to prove the CVA  formula in this &lt;a href=&quot;http://www.r2-financial.com/wp-content/uploads/2012/04/RMFI-5-3_p252-272.pdf-Adobe-Acrobat-Standard.pdf&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equation (3) is the result of computing the expectation of formula (1). Could you please show me how to prove that?&lt;/p&gt;&#xA;" OwnerUserId="11848" LastEditorUserId="848" LastEditDate="2014-08-19T11:49:21.073" LastActivityDate="2014-08-19T11:49:21.073" Title="CVA formula proof" Tags="&lt;cva&gt;&lt;proof&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14432" PostTypeId="1" CreationDate="2014-08-19T11:34:43.583" Score="1" ViewCount="166" Body="&lt;p&gt;I have a time series for a security list with 2 parameters calculated for each time period. For example, for a stock XYZ, I have Param1 and Param2 calculated over various time periods stacked against each other. I calculate the correlation between the two parametric series for each time period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see sudden drop in correlation for a certain time period, which I am not able to explain. The correlation drops from 0.5 to 0.02 for the same securities over consecutive time periods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone help me analyze what is causing the drop in correlation at the parametric level ? What changes/ differences should I look at to explain this change ?&lt;/p&gt;&#xA;" OwnerUserId="11849" LastActivityDate="2014-09-18T15:27:36.967" Title="Explain drop in Correlation between two time series in consecutive periods" Tags="&lt;time-series&gt;&lt;correlation&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14433" PostTypeId="1" CreationDate="2014-08-19T12:25:47.440" Score="2" ViewCount="49" Body="&lt;p&gt;I am working on a model for stochastic volatility. In short, the model try to capture that the volatility goes up suddenly after a shock (war, policy, financial events, etc) and then goes down slowly, so-called a shot-noise form or a impulse response function form. Now, I want to find some support in empirical data. I have two questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;According to your experience, which period data correspond this shot-noise phenomena?&lt;/li&gt;&#xA;&lt;li&gt;What kind of test (auto-correlation, etc) can mathematically show the existence of this  feature?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="11850" LastEditorUserId="848" LastEditDate="2014-08-19T12:43:40.367" LastActivityDate="2014-08-19T12:43:40.367" Title="what kind of test for volatility and where find the data" Tags="&lt;data&gt;&lt;stochastic-volatility&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14434" PostTypeId="2" ParentId="14422" CreationDate="2014-08-19T12:56:38.130" Score="0" Body="&lt;p&gt;a hidden markup in a dealer's favour? Who was the client? What tier of pricing are they on?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the counter currency? If it's CAD or TRY then spot is T+1 not T+2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I think &quot;nonefaster&quot; has the answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What does the NZD roll forward time mean? Do you mean, say, that the forward desk changes its pricing source from London to New York? The forward trade date and value date are calculated in which timezone? And what relation does this bear to the spot desk?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tell me the exact trade date (when the client order was executed) and what value date was asked for? If the client specified a value date rather than a tenor then what &quot;nonefaster&quot; is saying kind of makes sense. But not 100% because your client either asked for a specific value date of Tuesday, or a SPOT tenor (T+2) and the counter currency is neither CAD nor TRY...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your client asked for a specific value date of Tuesday, or a SPOT tenor then how did your back office made the deal value date the following Monday... T+1 and a TOM tenor? And what is your back office doing adjusting prices?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There were no holidays involved in NZD, or in the counter currency. If the client asked for SPOT and the forward date rolled (which it couldn't for a SPOT tenor because no forward adjustment takes place) then the value date would be Wednesday :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it looks like the deal was thought to be a TOM by the front and back offices, and price was adjusted by the pre-spot forward pips and that's the difference you've seen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there was some kind of &quot;hidden markup&quot; it refers to a spot spread adjustment in the NZD (or the counter currency) that was applied to the forward deal, or a forward spread adjustment applied to the forward component. But that ought to depend on the client credit tier (as in first question above).&lt;/p&gt;&#xA;" OwnerUserId="7369" LastEditorUserId="7369" LastEditDate="2014-08-19T13:08:09.523" LastActivityDate="2014-08-19T13:08:09.523" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14435" PostTypeId="2" ParentId="14430" CreationDate="2014-08-19T13:51:16.673" Score="2" Body="&lt;p&gt;To avoid confusion (the term futures price could be a type for &quot;future price&quot; or &quot;future's price&quot;), it seems to me that you are talking about the forward price of an asset for which the cost of carry is equal to the interest rate. In that case, indeed, with a fixed interest rate r and an spot S, the forward price F for a time T is given by $F=Se^{r(T-t)}$. If $S$ is governed by the SDE: $\frac{dS}{S} = rdt+\sigma dW$ and by noting that $\frac{\partial F}{\partial t} =-re^{r(T-t)}S$, $\frac{\partial F}{\partial S} = e^{r(T-t)}$ and $\frac{\partial^2 F}{\partial S^2} = 0$, we can apply Ito's lemma. Doing so results after some simple algebra, in the following process for $F$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dF = e^{r(T-t)}S\sigma dW$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is equivalent to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{dF}{F} = \sigma dW$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is probably what you had in mind?&lt;/p&gt;&#xA;" OwnerUserId="11851" LastEditorUserId="11851" LastEditDate="2014-08-21T01:40:03.677" LastActivityDate="2014-08-21T01:40:03.677" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="14436" PostTypeId="2" ParentId="3185" CreationDate="2014-08-19T14:11:00.313" Score="1" Body="&lt;p&gt;In a nutshell, the client only manages their own position, with the client credit line provided by the broker, whereas the broker manages all their clients' positions, using the broker credit line with their provider banks. You can work it out from there. Interest is presumably to do with cash deposits and loans.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastEditorUserId="7369" LastEditDate="2014-08-19T14:16:52.177" LastActivityDate="2014-08-19T14:16:52.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14437" PostTypeId="2" ParentId="14432" CreationDate="2014-08-19T15:18:13.010" Score="1" Body="&lt;p&gt;Depends how you calculating correlation, but probably you have rolling window from what you get high and low for calculation, when you adding samples to window then some samples must exit the window, when sample that exiting are not equal to high and low then it's don't matter, but when high or low is exiting then suddenly everything changes in your calculation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can't say more without specifics/details of your algorithm. Long shot.&lt;/p&gt;&#xA;" OwnerUserId="6175" LastActivityDate="2014-08-19T15:18:13.010" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14438" PostTypeId="1" CreationDate="2014-08-18T21:57:05.893" Score="1" ViewCount="340" Body="&lt;p&gt;I'm trying to run an SV model against prices of Euro/USD. For those not familiar with SV, its a volatility model in which each point gets its own volatility parameter $h_t$ with 3 main parameters that are derived using a monte carlo simulation (MCMC),&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$\mu$ = average of the volatility across the entire sample set&lt;/li&gt;&#xA;&lt;li&gt;$\phi$ = the weighting that the volatility of the last point has on thenext (predicted)  volatility&lt;/li&gt;&#xA;&lt;li&gt;$h_t$ = the most recent  - {time interval}'s volatility.&lt;/li&gt;&#xA;&lt;li&gt;$\sigma$ = volatility of the volatility&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Once we have $\mu$, $\phi$, and $h_t$ we can predict $h_{t+1}$, that is, the predicted volatility of the next point, by $h_{t+1} \sim \text{Normal}(\mu+\phi(h_t-\mu), \sigma)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm wondering if I'm doing the next part correctly:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To put this into practice, we run a MCMC every 5 minutes, gathering those variables and predicting $h_{t+1}$. This results in a graph like this, for CME futures contract 6EU4 (September euro) with 5-period BBands also displayed. Ignore the shapes that appear on the graph.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/QrNaj.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It feels inaccurate, so I'm not sure if I'm doing something wrong. Did I understand the process correctly? &lt;code&gt;phi&lt;/code&gt; is around .55 for the first half of the day, then jumps to .95 and stays there, which seems wrong, but I guess it isn't too surprising given the data...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;R's package stochvol is taking care of the parameter estimation, so assume that the numbers themselves are accurate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should I paste the 5-minute Volume Weighted Average Prices here? its a pretty long data set. I'll edit it to do that if so.&lt;/p&gt;&#xA;" OwnerUserId="11854" OwnerDisplayName="hedgedandlevered" LastActivityDate="2014-08-19T16:29:55.910" Title="one-step-ahead Stochastic Volatility for 5-minute VWAP prices" Tags="&lt;r&gt;&lt;stochastic-processes&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14439" PostTypeId="1" CreationDate="2014-08-19T18:22:39.713" Score="5" ViewCount="1059" Body="&lt;p&gt;I'm interested in multistage optimization problems. Are there any good R packages around to solve such problems over time? I'm not at all an expert in it, so maybe someone knows a good paper / lecture notes to start with? I know classical optimization (linear optimization, convex optimiziation etc) but I've never had to deal with optimization over time. Any reference, theoretical and regarding the implementation are very welcome. I know that this is a very general question, but this is due to my (not yet) attained knowledge. If further clarification is needed I'm happy to share thix. Many thanks in advance&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's take for example the following &lt;a href=&quot;http://www.google.ch/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0CCEQFjAA&amp;amp;url=http%3A%2F%2Fwww2.isye.gatech.edu%2F~nemirovs%2Frob_portf.pdf&amp;amp;ei=OtX0U8OfI8jOOaqpgeAB&amp;amp;usg=AFQjCNHkJmuyt88kzk85A2cWTVYdH2vPxQ&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt;, there we have a optimization problem of the form:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\max \sum_{i=1}^{n+1}r^L_ix_i^L$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;such that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ x^l_i=r^{l-1}_i x_i^{l-1}-y_i^l+z^l_i,\hspace{2pt} i=1,\dots n,l=1,\dots,L$$&#xA;$$ x^l_i=r^{l-1}_{n+1} x_{n+1}^{l-1}+\sum_{i=1}^n(1-\mu^l_i)y_i^l-\sum_{i=1}^n(1+\nu_i^l)z^l_i$$&#xA;$$y^l_i\ge 0,\hspace{2pt} i=1,\dots n,l=1,\dots,L$$&#xA;$$x^l_i\ge 0,\hspace{2pt} i=1,\dots n,l=1,\dots,L$$&#xA;$$z^l_i\ge 0,\hspace{2pt} i=1,\dots n,l=1,\dots,L$$&#xA;where some $x_i^l$ is the value (in dollar) of an asset $i$ at time $l$, $r_i^l$ is the asset return, $y^l_i$ and $z^l_i$ are the amount of asset sold and bought. $\mu^l_i $ and $\nu_i^l$ have also economical interpretation, but are not that important for the question. Assuming everthing is deterministic, we can solve this problem using interior points / simplex method since it is an &quot;simple&quot; LP. However the theory I'm looking for should give me ideas if it is optimal to solve at every time $l$ the subproblem (maximize $\sum_{i=1}^{n+1}r^l_ix^l_i$ under the corresponding constraints or is this not a good idea. I have heard / read that one could solve such kind of problem using stochastic programming, but still I'm interested in knowing how to subdivide (if possible) such kind of problems. &lt;/p&gt;&#xA;" OwnerUserId="17133" LastEditorUserId="17133" LastEditDate="2014-08-20T17:18:13.703" LastActivityDate="2015-02-14T00:37:04.543" Title="multiperiod optimization using R" Tags="&lt;r&gt;&lt;optimization&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14440" PostTypeId="2" ParentId="14439" CreationDate="2014-08-19T21:14:40.640" Score="0" Body="&lt;p&gt;There is an approach called Model Predictive Control which optimizes the state trajectory of a system over time. There doesn't seem to be suitable R packages, but I can recommend the YALMIP package as probably being a good place to start: &lt;a href=&quot;http://users.isy.liu.se/johanl/yalmip/&quot; rel=&quot;nofollow&quot;&gt;http://users.isy.liu.se/johanl/yalmip/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9340" LastActivityDate="2014-08-19T21:14:40.640" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14441" PostTypeId="1" CreationDate="2014-08-19T23:18:58.837" Score="1" ViewCount="197" Body="&lt;p&gt;So I am sure you all know about the whole Argentina default that has been in the papers lately, no need to delve into it. This so called &quot;technical&quot; default has lead some interesting investment opportunities (&lt;a href=&quot;http://www.bloomberg.com/news/2014-08-14/soros-adds-to-ypf-trims-teva-exits-monster-in-quarter.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Soros Doubles YPF Stake&lt;/a&gt;) and a conundrum that I cannot answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Telecommuncation company,, Telecom Argentina, has ADR's listed on the NYSE. They are also locally traded on the Buenos Aires Stock Exchange. The ADR price, denominated in $USD, is currently ~19 USD. The locally traded stock is worth ~45 ARS (~5 USD) last I checked on Bloomberg at work today, creating a 14 USD discrepancy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There might some voting right differences but the share are pretty much at parity and certainly not enough to explain a 14 USD difference. Many of you might argue that spread is due to currency but that is not the case, the ARS is pegged to the USD at ~8.20 ARS for each USD. Country risk premium?? maybe so but wouldn't that be priced in mostly the currency/bonds which then would be reflected in the stock? To give you an idea, the stock trades at 12X Earnings on the B.A.S. Exchange but at 8X here on th NYSE, something is not adding up. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Aren't there quant shops that do cross country arbitrage between ADR's and their respective domiciled stock. And why aren't they arbitraging this spread? There is clearly something wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/md5mZ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="4729" LastEditorUserId="4729" LastEditDate="2014-08-19T23:25:03.117" LastActivityDate="2014-08-20T09:37:59.273" Title="ADR vs Foriegn Stock Price Arbitraguers" Tags="&lt;equities&gt;&lt;arbitrage&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14442" PostTypeId="2" ParentId="14391" CreationDate="2014-08-20T00:49:40.260" Score="3" Body="&lt;p&gt;I would suggest you to add spreads to the implied hazard rates, spreads that you regress on the macroeconomic factors. Then you stress by calculating the spreads corresponding to the stressed factors. &lt;/p&gt;&#xA;" OwnerUserId="2872" LastActivityDate="2014-08-20T00:49:40.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14443" PostTypeId="1" CreationDate="2014-08-20T02:52:53.383" Score="3" ViewCount="867" Body="&lt;p&gt;I am trying to evaluate the value of a Barrier option using Monte carlo method. The stock follows a jump diffusion model. I am using the method described in &lt;a href=&quot;http://alumnus.caltech.edu/~amir/barrier.pdf&quot; rel=&quot;nofollow&quot;&gt;Metwally and Atiya&lt;/a&gt;. The authors describe the steps so writing the algorithm in matlab say, should be easy. I have implemented the the first algorithm in matlab, described in this paper but my results are not the same as those of the authors. For example, my code below gives 5.1 but according to the authors results it should be 9.013.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other problem I have is that the probability $P_i$ is negative or more than 1 sometimes during simulation. Could the formula in the paper be wrong?. How can it be coded to avoid this. I have used it as it is in the paper.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;clc &#xA;clear all&#xA;t = cputime;&#xA;&#xA;%%%%%%%%%%%%%%%%%%% Parameters %%%%%%%%%%%%%%%%&#xA;S0 = 100.0;&#xA;X = 110.0;&#xA;H = 85.0;&#xA;R = 1.0;&#xA;r = 0.05;&#xA;sigma = 0.25;&#xA;T = 1.0;&#xA;&#xA;%%%%%%%%%%%%%%%% Jump Parameters %%%%%%%%%%%%%%&#xA;lam = 2.0;&#xA;muA = 0.0;&#xA; sigmaA = 0.1;&#xA;&#xA;%%%%%%%%%%%%%%% calculated parameters %%%%%%%%%%&#xA;k = exp(muA+0.5*sigmaA*sigmaA)-1;&#xA;c = r-0.5*sigma^2-lam*k;&#xA;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&#xA;N = 1e5; % Monte carlo runs&#xA;DP = zeros(N,1);&#xA;for n = 1:N&#xA;I = 1;&#xA;jumpTimes = 0:exprnd(lam):T; %interjump times Exp(lam)&#xA;K = size(jumpTimes,2)-1;&#xA;jumpTimes(end+1) = T;&#xA;x = log(S0);&#xA;for i = 1:K+1&#xA;    tau = jumpTimes(i+1)-jumpTimes(i);&#xA;    xbefore = x + c*tau + sigma*sqrt(tau)*randn();&#xA;&#xA;    p = 1.0-exp(-2.0*(log(H)-x)*(log(H)-xbefore)/(tau*sigma^2));&#xA;    p = p*(xbefore &amp;gt; log(H));&#xA;    b = (jumpTimes(i+1)-jumpTimes(i))/(1.0-p);&#xA;    s = jumpTimes(i)+b*rand();&#xA;&#xA;    if s &amp;lt;= jumpTimes(i+1) &amp;amp;&amp;amp; s &amp;gt;= jumpTimes(i)&#xA;    gamma = exp(-(x-xbefore+c*tau)^2/(2*sigma^2*tau))/(sigma*sqrt(2*pi*tau));&#xA;    g = (x-log(H))/(2*gamma*pi*sigma^2)*(s-jumpTimes(i))^(-1.5)*(jumpTimes(i+1)-s)^(-0.5)*...&#xA;        exp(-((xbefore-log(H)-c*(jumpTimes(i+1)-s))^2/(2*(jumpTimes(i+1)-s)*sigma^2)+...&#xA;        (x-log(H)+c*(s-jumpTimes(i)))^2/(2*(s-jumpTimes(i))*sigma^2)));&#xA;    DP(n)= R*b*g*exp(-r*s);&#xA;    I = 0;&#xA;    break&#xA;    end&#xA;    A = muA + sigmaA*randn();&#xA;    xafter = xbefore + A;&#xA;    if xafter &amp;lt;= log(H)&#xA;    DP(n) = R*exp(-r*jumpTimes(i+1));&#xA;    I = 0;&#xA;    break&#xA;    end&#xA;    x = xafter;&#xA;end&#xA;if I==1 % no crossing happened&#xA;    DP(n) = exp(-r*T)*max(exp(xbefore) - X, 0.0);&#xA;end&#xA;&#xA;end&#xA;&#xA;DOC = mean(DP)&#xA;e = (cputime-t)/60;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11855" LastEditorUserId="11855" LastEditDate="2014-09-03T17:11:29.423" LastActivityDate="2014-09-05T13:42:48.837" Title="Valuation of barrier options in Jump diffusion model" Tags="&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;barrier&gt;&lt;jump&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14445" PostTypeId="2" ParentId="14276" CreationDate="2014-08-20T07:27:08.010" Score="0" Body="&lt;p&gt;The excercise should happen if the present value of the dividend yield minus risk free interest exceeds the value of the related put. As noted before this is only true if a position is deep in the money and volatility is low.&lt;br&gt;&#xA;On single stocks this decision is usually done right before dividend ex-date.&lt;/p&gt;&#xA;" OwnerUserId="1221" LastActivityDate="2014-08-20T07:27:08.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14446" PostTypeId="1" CreationDate="2014-08-20T08:31:33.747" Score="6" ViewCount="4848" Body="&lt;p&gt;A stock has beta of 2.0 and stock specific daily volatility of 0.02. Suppose that yesterday's closing price was 100 and today the market goes up by 1%. What's the probability of today's closing price being at least 103?&lt;/p&gt;&#xA;" OwnerUserId="11858" LastEditorUserId="848" LastEditDate="2014-08-20T09:26:39.267" LastActivityDate="2019-07-16T07:19:10.387" Title="Probability of stock closing over a certain price" Tags="&lt;volatility&gt;&lt;price&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14447" PostTypeId="2" ParentId="14441" CreationDate="2014-08-20T09:37:59.273" Score="1" Body="&lt;p&gt;One depository receipt corresponds to &lt;strong&gt;5&lt;/strong&gt; shares (&lt;a href=&quot;https://www.adr.com/Home?cusip=879273209&quot; rel=&quot;nofollow&quot;&gt;see here&lt;/a&gt;), so you pay ~19USD for ~225ARS which corresponds to an implied exchange rate of ~12ARS/USD.&lt;/p&gt;&#xA;" OwnerUserId="1739" LastActivityDate="2014-08-20T09:37:59.273" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14448" PostTypeId="1" AcceptedAnswerId="14463" CreationDate="2014-08-20T10:19:20.200" Score="2" ViewCount="624" Body="&lt;p&gt;I think this is a bit odd question. Let us say I want to hedge my fx exposure every month but using 3 month forwards . How can I do that ? Is it not easy just to use 1 month forwards ? I recalculate my expsoure every month. In other words let us say I am us investor but I get my profits from a euro company. So every month I calcuate the expected return I might get the next month and do the hedge accordingly. This is straight forward with a one month forward but assuming there exists only 3 month forward contracts in the market(hypothetical) how can one do the hedging ? &lt;/p&gt;&#xA;" OwnerUserId="11628" LastActivityDate="2014-08-21T10:14:10.507" Title="hedging with a 3 month fx forward every month" Tags="&lt;fx&gt;&lt;forward&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14449" PostTypeId="2" ParentId="14446" CreationDate="2014-08-20T10:50:07.393" Score="8" Body="&lt;p&gt;Usually stock returns are assumed to be normally distributed:  &lt;span class=&quot;math-container&quot;&gt;$R\sim N(\mu,\sigma)$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If market goes up 1%, the expected stock return is &lt;span class=&quot;math-container&quot;&gt;$\mu = \beta\cdot 0.01 = 0.02$&lt;/span&gt; (since β is the senstivity to market).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Stock price going from 100 to over 103 requires a return &lt;span class=&quot;math-container&quot;&gt;$R$&lt;/span&gt; of at least 103/100 – 1 = 0.03.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As we have from the question σ = 0.02, we get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ P(R\geq 0.03) = 1 - P(R\leq 0.03) = 1 - N(0.03) = 1 - \Phi\left( \frac{0.03-\mu}{\sigma} \right) = 1 - \Phi(0.5) = 0.31 $$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;span class=&quot;math-container&quot;&gt;$\Phi$&lt;/span&gt; is the standard normal distribution.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="34518" LastEditDate="2019-02-08T08:34:21.333" LastActivityDate="2019-02-08T08:34:21.333" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="14451" PostTypeId="1" CreationDate="2014-08-19T18:23:11.943" Score="1" ViewCount="106" Body="&lt;p&gt;The AAPL Sep 95 put currently has a theta of -.21.  The put midpoint is .84.  84/21 = 4 days.  However, the put has nearly a month before expiration, at which time it will be zero.  Not 4 days from now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong or missing in the above calculation?&lt;/p&gt;&#xA;" OwnerUserId="2666" OwnerDisplayName="4thSpace" LastActivityDate="2014-08-20T12:06:19.800" Title="How can theta be so large on this option?" Tags="&lt;options&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14452" PostTypeId="2" ParentId="14451" CreationDate="2014-08-20T12:06:19.800" Score="1" Body="&lt;p&gt;I see a theta of -0.03ish. Delta is about the order of magnitude of your number, maybe you mixed them up?&lt;/p&gt;&#xA;" OwnerUserId="11851" LastActivityDate="2014-08-20T12:06:19.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14453" PostTypeId="1" CreationDate="2014-08-20T13:51:57.823" Score="1" ViewCount="39" Body="&lt;p&gt;I want to minimize some kind of risk sensitive cost. But, I am confused what cost criterion should I use. I am aware of only expected exponential utility. I want to know what are the other such measures in literature and which one among them will be good and in which sense it is better than the other.  &lt;/p&gt;&#xA;" OwnerUserId="11679" LastActivityDate="2014-08-21T08:17:08.733" Title="Doubt on risk cost criterion" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;optimization&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14454" PostTypeId="2" ParentId="839" CreationDate="2014-08-20T15:06:14.227" Score="1" Body="&lt;p&gt;I'll answer as if the backtester design goals were driven by specific system in development or planning. There's a lot of data to process in the market and atleast for my own system development I like to focus on data that I think may provide value in the system development. For that reason I chose to capture data from my broker - they offer so much data through the API that before even writing my own backtester I actually had to write tool to capture the data that I thought would be relevant to my testing:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way (to justify EOD backtest) is to keep your position sizes and amount of total positions such that if one stock goes into a state where you are forced to exit at really horrible price eg. 0, this happening won't be a huge blow. How many such cases could be expected to occur? Well if you limit your symbols to ones that have financial status such that this would be extremely unlikely, then not often enough to matter. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, if you use margin, factor in whether you can be auto-liquidated by your broker if you loaned money through them. Then, don't have your system ever exit on anything but on close (few last minutes of RTH), that's where symbols are most liquid as everyone else use this approach + you have intra-day traders liquidating. Except for pre-announced reasons, the stocks tend to trade &quot;thick&quot; for the reasons mentioned above during the close. This thickness is just another word for lots of quotes in the book and those quotes prevent high volume stocks from spiking, which ensures that using the daily close price and possibly volume around the last few minutes of the day will be sufficient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you allow for exiting at other times then the suggestion to limit your systems maximum volume traded at intra-day level other than close to eg.that 5% of the volume in your data makes sense. And unless you are risking too much or have instrument selection of random small caps (for unhedged long hold time trading), then I'd consider not to even factor in the worst cases of intra-day movement - atleast not until your strategy is showing the kind of profits that you'd hope to weather few disasters over time. Being too pessimistic initially might actually bias the system development to hitting stops during intra-day anomalies related to market structure (eg. low liquidity during most of the day -&gt; higher spread -&gt; more volatility due to wide real spreads) that you'd be selling at low that from intra-day perspective might look like the best time to buy but since you had ignored the intra-day data you couldn't make the determination.&lt;/p&gt;&#xA;" OwnerUserId="11863" LastEditorUserId="11863" LastEditDate="2014-08-20T15:16:41.760" LastActivityDate="2014-08-20T15:16:41.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14456" PostTypeId="1" AcceptedAnswerId="14826" CreationDate="2014-08-20T17:28:12.327" Score="3" ViewCount="190" Body="&lt;p&gt;Suppose I model the forward swap rate lognormal&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dS_t = \sigma_{ln}S_tdW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand we could model it simply by a normal assumption:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dS_t = \sigma_{n}dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to know if there is a relationship for the volatilities $\sigma_n,\sigma_{ln}$? A friend told me, that he saw the approximation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma_n\approx \sigma_{ln}S_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, neither my friend nor I was able to come up with a justification of this approximation. So is this a valid approximation? If so, why and if not, how else can I relate the two volatilities?&lt;/p&gt;&#xA;" OwnerUserId="17133" LastActivityDate="2014-09-22T13:37:23.230" Title="Approximation of different volatilities" Tags="&lt;volatility&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14457" PostTypeId="2" ParentId="14456" CreationDate="2014-08-20T22:22:28.293" Score="0" Body="&lt;p&gt;For any normal variable, you have $$aX\sim N(a\mu,a^2\sigma^2).$$ So a linear transformation preserves the distribution type (note that $dW_t\sim N(0,dt)$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you want to approximate $dS_t$ by setting $dS_t=dS_t$, canceling the $dW_t$ you get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma_{ln}S_t=\sigma_n$$&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-08-20T22:22:28.293" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14458" PostTypeId="2" ParentId="14276" CreationDate="2014-08-20T22:52:45.743" Score="0" Body="&lt;p&gt;With 0% interest rates r-q is almost always &amp;lt; 0. Dividends are pretty much never continuous, so for an American option if the dividend you collect and interest you forgo collecting (or paying) being short the stock is larger than the value of the put (since when you punch a call you sell that call and buy 100 shares, thus selling the put). It's also worth noting that r is &amp;lt; 0 in the pricing model for many stocks now. These stocks are known as &quot;Hard to Borrow&quot; because you have to pay to be short them. If you want to know more about how people trade in hard to borrow stocks it would require a much lengthier explanation. Just know that if you're going to be paying 20 cents to carry short stock over the life time of the call and the put is only worth 5 cents, it's probably a punch.&lt;/p&gt;&#xA;" OwnerUserId="5092" LastActivityDate="2014-08-20T22:52:45.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14459" PostTypeId="1" AcceptedAnswerId="14461" CreationDate="2014-08-21T00:28:58.157" Score="1" ViewCount="2198" Body="&lt;p&gt;I found a matlab example for modelling correlated asset paths: &lt;a href=&quot;http://www.goddardconsulting.ca/matlab-monte-carlo-assetpaths-corr.html&quot; rel=&quot;nofollow&quot;&gt;http://www.goddardconsulting.ca/matlab-monte-carlo-assetpaths-corr.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this model the author uses the matlab code chol() in order to calculate the cholesky decomposition on the correlation matrix. However, by default, chol(corr) returns the upper triangular matrix but in my understanding the lower triangular matrix is needed for generating correlated random numbers. This can be calculated by chol(corr,'lower'): &lt;a href=&quot;http://www.mathworks.de/de/help/matlab/ref/chol.html&quot; rel=&quot;nofollow&quot;&gt;http://www.mathworks.de/de/help/matlab/ref/chol.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, is this simply a small error in the code example or did I misunderstand some theoretic basics?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best&lt;/p&gt;&#xA;" OwnerUserId="11764" LastActivityDate="2014-08-21T06:11:57.823" Title="Cholesky Decomposition on Correlation Matrix for Correlated Asset Paths" Tags="&lt;brownian-motion&gt;&lt;matlab&gt;&lt;cholesky&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14461" PostTypeId="2" ParentId="14459" CreationDate="2014-08-21T06:11:57.823" Score="1" Body="&lt;p&gt;If you want to create one (column) vector X of correlated random variates, then you premultiply it with the lower triangular matrix L.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when you create paths, every return observation is one vector of random numbers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is then a matter of how you arrange your data: if these observations are columns in an matrix X, you compute LX.  But if you have the observations in the rows of a matrix, then you need transpose the product, and you postmultiply with L', which is an upper triangular matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps the tutorial &lt;a href=&quot;http://comisef.wikidot.com/tutorial:correlation&quot; rel=&quot;nofollow&quot;&gt;http://comisef.wikidot.com/tutorial:correlation&lt;/a&gt; helps.&lt;/p&gt;&#xA;" OwnerUserId="6857" LastActivityDate="2014-08-21T06:11:57.823" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14463" PostTypeId="2" ParentId="14448" CreationDate="2014-08-21T10:14:10.507" Score="1" Body="&lt;p&gt;A good question... clearly you've read &lt;a href=&quot;https://quant.stackexchange.com/questions/8234/why-using-3-months-forward-to-hedge-fx-risk-on-a-fund-of-funds-portfolio&quot;&gt;using 3 month forwards&lt;/a&gt; and see they are more liquid than other FX forward instruments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess that if there were only 3 month forward contracts in the market then by buying and selling the 3 months for different maturities, you could structure a set of 1 month forwards.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so from today 21st Aug to hedge a short position:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;buy 3 month for 21st Nov&lt;/li&gt;&#xA;&lt;li&gt;wait 1 month until 21st Sep&lt;/li&gt;&#xA;&lt;li&gt;On 21st Sep sell 3 month for 21st Dec&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You've covered 1 month from 21st Aug to 21st Sep.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But there's a tail position to cover from 21st Nov to 21st Dec. Maybe someone else can do better there.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2014-08-21T10:14:10.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14464" PostTypeId="2" ParentId="1129" CreationDate="2014-08-21T13:26:17.297" Score="0" Body="&lt;p&gt;This is a vector autoregression (VAR) model with restrictions. I would also use a shorter lag and add conventional factors to the VIX return. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simple bootstrapping destroys the serial correlation in your model, but you might consider block bootstrapping.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would also try the following test: use a subset to calibrate your model and then perform an out-of-sample step with the next data point of the regressor. Repeat this procedure by shifting the subset by one step (i.e. apply the regression to a rolling time window). This gives you an idea of the stability of the coefficients, and the forecasting ability of the model. &lt;/p&gt;&#xA;" OwnerUserId="6721" LastActivityDate="2014-08-21T13:26:17.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14466" PostTypeId="1" AcceptedAnswerId="14503" CreationDate="2014-08-21T17:12:46.180" Score="4" ViewCount="229" Body="&lt;p&gt;I am working with data for an exotic currency, that has been re-denominated a couple of times during the twenty years of data that I have.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the best way of 'normalising' the data, so that I can work with the data, although it contains two 'switch over' dates on which the currency was re-denominated?&lt;/p&gt;&#xA;" OwnerUserId="1733" LastActivityDate="2014-08-27T00:38:24.290" Title="Modelling currency exchange rates timeseries data across re-denomation dates" Tags="&lt;time-series&gt;&lt;fx&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14467" PostTypeId="1" CreationDate="2014-08-21T17:26:17.303" Score="3" ViewCount="516" Body="&lt;p&gt;It is common in commodities markets to hold many positions, both long and short, across a range of contract months beginning in the prompt month (today, September) to five or more years out. In general the prompt month exhibits the most volatility, and far out months exhibit the least (among the same exact products)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This makes total notional 'position' for a product quite misleading. For example if today I purchase 1 September 2014 contract, and sell 1 September 2019 contract, my net notional position is 0, suggesting the portfolio has no risk. In reality if the prompt month appreciates 10%, the 2019 contract will appreciate maybe 1%, and you have realized a significant gain.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Standard VAR calculation process captures and handles this well, but I want to be able to measure my &lt;em&gt;true&lt;/em&gt; spot price exposure for a product class for purposes of separating position limits from VAR limits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, the question,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the industry standard model for condensing a strip of forward contracts into a single exposure number &quot;FME&quot; such that it is reasonable to approximate PNL by taking FME*spot price. (presume you are given a corr/cov matrix)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most relevant article I can find is here. My calculations from that paper seem somewhat accurate and it covers the subject quite well subjectively, but it has no citations and I doubt my peers would accept it as a source for policy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://kiodex.com/our_library/FME_Whitepaper.pdf&quot; rel=&quot;nofollow&quot;&gt;http://kiodex.com/our_library/FME_Whitepaper.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7884" LastActivityDate="2014-08-21T20:45:34.750" Title="Methods for &quot;prompt month equivalent&quot; exposure in commodities forwards/futures markets" Tags="&lt;futures&gt;&lt;commodities&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14468" PostTypeId="1" AcceptedAnswerId="14473" CreationDate="2014-08-21T18:15:09.253" Score="2" ViewCount="518" Body="&lt;p&gt;I would like to hear other possible ways of classifying Stocks by the Volatility of their returns. Assuming that I want to characterize each stock as Low, Medium or High Volatility Stock and assuming that I know the Annualized Volatility for each of the stocks in my sample, what ways are there to do such classification? &#xA;I can think of two:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Below, say, 30th percentile (of the Annualized Volatilities) -&gt; Low Volatility; Between 30th and 70th Percentile -&gt; Medium Volatility; Top 30th percentile -&gt; High Volatility&lt;/li&gt;&#xA;&lt;li&gt;(-2)*Std.Dev (of the distribution of the Annualized Volatilities) -&gt; Low Volatility; Between (+-2)*Std.Dev -&gt; Medium Volatility; (+2)*Std.Dev -&gt; High Volatility&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Feel free to point out papers where I can find my answer.&lt;/p&gt;&#xA;" OwnerUserId="11874" LastEditorUserId="11874" LastEditDate="2014-08-21T18:30:44.847" LastActivityDate="2014-08-27T05:21:02.600" Title="How to classify stocks by their volatility?" Tags="&lt;volatility&gt;&lt;equities&gt;&lt;returns&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14470" PostTypeId="1" AcceptedAnswerId="14471" CreationDate="2014-08-21T19:47:53.377" Score="2" ViewCount="435" Body="&lt;p&gt;The model specifies that the instantaneous interest rate follows the stochastic differential equation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathrm{d}r_t = a(b-r_t)\: \mathrm{d}t + \sigma \: \mathrm{d}W_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W_{t}$ is a Wiener process under the risk neutral framework modelling the random market risk factor, in that it models the continuous inflow of randomness into the system. The standard deviation parameter, $\sigma$, determines the Volatility (finance) of the interest rate and in a way characterizes the amplitude of the instantaneous randomness inflow. The typical parameters b, a and  $\sigma$, together with the initial condition $r_0$, completely characterize the dynamics, and can be quickly characterized as follows, assuming a to be non-negative:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$b$: &quot;long term mean level&quot;. All future trajectories of $r$ will evolve around a mean level b in the long run;&lt;/li&gt;&#xA;&lt;li&gt;a: &quot;speed of reversion&quot;. a characterizes the velocity at which such trajectories will regroup around b in time;&lt;/li&gt;&#xA;&lt;li&gt;$\sigma$: &quot;instantaneous volatility&quot;, measures instant by instant the amplitude of randomness entering the system. Higher $\sigma$ implies more randomness&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;From the description of &lt;a href=&quot;http://en.wikipedia.org/wiki/Vasicek_model#Discussion&quot; rel=&quot;nofollow&quot;&gt;Wikipedia&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What is the mathematical reasoning behind this formula for the finance professional to introduce this?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="2744" LastEditorUserId="848" LastEditDate="2014-08-21T20:21:39.457" LastActivityDate="2014-08-31T03:48:22.163" Title="What is the reasoning to derive this financial model called the Vasicek Model?" Tags="&lt;market&gt;&lt;term-structure&gt;&lt;vasicek&gt;" AnswerCount="2" CommentCount="7" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14471" PostTypeId="2" ParentId="14470" CreationDate="2014-08-21T20:33:39.667" Score="5" Body="&lt;p&gt;The original Vasicek paper is &quot;An equilibrium model of the term structure&quot;. If you google for it, you'll find it and you can read in his own words his motivation for developing it. In particular, what now is called the Vasicek model basically comes from applying his results to an Ornstein-Uhlenbeck model for the spot process, which he claims was proposed by Merton in 1971, in &quot;Optimum Consumption and Portfolio Rules in a Continuous-time Mode&quot;, which is another reference you can track down on google. The clearest reference in there, says that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&quot;The first term in (120) implies a long-run, regressive adjustment of the expected rate of return toward a &quot;normal&quot; rate of return.... I will call the assumption of a price mechanism described by (119) and (120) the &quot;De Leeuw&quot; hypothesis for Frank De Leeuw who first introduced this type mechanism to explain interest rate behavior.&quot;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I couldn't track a specific reference down further back than that. I think a large part of the answer why people like the model is a combination of analytical tractability and obvious qualitative properties (i.e., mean reversion, meaning that interest rates levels &quot;can't keep running away&quot;) that are consistent with behavior expected from interest rates.&lt;/p&gt;&#xA;" OwnerUserId="11851" LastEditorUserId="11851" LastEditDate="2014-08-31T03:48:22.163" LastActivityDate="2014-08-31T03:48:22.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14472" PostTypeId="2" ParentId="14467" CreationDate="2014-08-21T20:45:34.750" Score="1" Body="&lt;p&gt;I wouldn't say that there is a single industry standard. Also, I'm not sure you should try expressing all risks in a single number, or at least be aware of it's deficiencies. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're interested in VaR, you could consider doing historical VaR for example (be sure to correct for seasonality effects and the curve rolling down with the passage of time).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One approach that I personally like, is a PCA based approach, similar to what people do with interest rates. On the basis of deseasoned, roll-corrected returns, you can perform a PCA analysis; depending on the commodity, you typically find 1-3 factors explaining 95+% of the variance. You could determine the exposure of each future/forward you have in position to those factors and sum those?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet another approach could be assuming explicit multi-factor dynamics for the curve, calibrate your model and based on that come to a risk number.&lt;/p&gt;&#xA;" OwnerUserId="11851" LastActivityDate="2014-08-21T20:45:34.750" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14473" PostTypeId="2" ParentId="14468" CreationDate="2014-08-21T21:00:02.597" Score="1" Body="&lt;p&gt;There are a lot of ways of doing this and what a good way of doing this will be driven by your needs as well. Criteria such as whether the method needs to be (in)sensitive to outliers and whether or not your groups need to be of the same size will influence this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way to do this would be sorting the volatilities and group them:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;in groups of equal size&lt;/li&gt;&#xA;&lt;li&gt;such that the mean differences between the two groups are equally large&lt;/li&gt;&#xA;&lt;li&gt;as a nearest neighbor algorithm with 3 groups dictates&lt;/li&gt;&#xA;&lt;li&gt;such that the sum of variance with groups is minimized (I think that's almost the same as nearest neighbors)&lt;/li&gt;&#xA;&lt;li&gt;...&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As long as you pick something and apply it consistently, it might not even matter that much which you pick.&lt;/p&gt;&#xA;" OwnerUserId="11851" LastActivityDate="2014-08-21T21:00:02.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14474" PostTypeId="1" AcceptedAnswerId="14491" CreationDate="2014-08-21T23:32:59.133" Score="1" ViewCount="214" Body="&lt;p&gt;How can you develop your own interest rate model? What must be take cautiously before making one? &#xA;Also what is the regulation that one mustfollow? Also what is some common properties that models would be satisfying?&lt;/p&gt;&#xA;" OwnerUserId="2744" LastEditorUserId="5445" LastEditDate="2014-08-22T07:26:27.823" LastActivityDate="2014-08-24T10:01:20.710" Title="How to develop your own interest rate model?" Tags="&lt;interest-rates&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14476" PostTypeId="2" ParentId="14429" CreationDate="2014-08-22T13:02:28.833" Score="1" Body="&lt;p&gt;I think u can hedge using the description given in JC hull.. here he uses index futures. A detailed explanation is given for one stock. I think u can extend it to  a portfolio. Also one can hedge by combining two or three stock indices. See page 33 in this link &lt;a href=&quot;http://www2.fiu.edu/~dupoyetb/Financial_Risk_Mgt/lectures/Ch03.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www2.fiu.edu/~dupoyetb/Financial_Risk_Mgt/lectures/Ch03.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11628" LastActivityDate="2014-08-22T13:02:28.833" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14477" PostTypeId="2" ParentId="14429" CreationDate="2014-08-22T16:03:03.290" Score="2" Body="&lt;p&gt;If you are investing an amount $M$, split over deals indexed by $i$ and with a weight $w_i$, then your dollar position in each share will be $w_i M$. The exposure to the index will be $\sum \beta_i w_i M$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should realize that this will not hedge idiosyncratic risks. In general, the more deals you have, the better this type of hedge should work (assuming the weights are in the same order of magnitude)&lt;/p&gt;&#xA;" OwnerUserId="11851" LastActivityDate="2014-08-22T16:03:03.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14478" PostTypeId="1" AcceptedAnswerId="14483" CreationDate="2014-08-23T03:08:32.397" Score="4" ViewCount="1111" Body="&lt;p&gt;I'm currently implementing a CAPM model in Excel:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;A portfolio of n risky assets when n=6 (in this case)&lt;/li&gt;&#xA;&lt;li&gt;A riskless borrowing rate of 8% and riskless lending rate of 3%&lt;/li&gt;&#xA;&lt;li&gt;I'm given the expected return and standard deviation for each risky asset.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The first task was to create a minimum variance portfolio. I did this using the following array formula: {=MMULT(MINVERSE(Cov),TRANSPOSE(I))/SUM(MMULT(MINVERSE(Cov),TRANSPOSE(I)))}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cov is my 6x6 covariance matrix and I is just a 1x6 array of ones. I could have created I as a 6x1 array and avoided the TRANSPOSE() altogether.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm currently stuck on the next task which is to incorporate the riskless asset into the mix and determine the optimal weights for each risky asset given a desired rate of return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My approach was as follows:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Calculate the excess returns by subtracting the 3% riskless lending rate from the expected return for each risky asset. Store these values in a 1x6 array called XsRtn&lt;/li&gt;&#xA;&lt;li&gt;Execute the array formula to determine the 6 weights: {=MMULT(MINVERSE(Cov),TRANSPOSE(XsRtn))/SUM(MMULT(MINVERSE(Cov),TRANSPOSE(XsRtn)))}&lt;/li&gt;&#xA;&lt;li&gt;Sum up the 6 weights to find the weight of the tangent portfolio. If this weight &gt; 1 then investor is net borrower so they will borrow at 8% to bring total weight to 1. Otherwise, the investor lends the excess cash at 3% riskless.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This method appeared to work fine until I realised that the individual weights of the risky assets comprising the tangent portfolio does not change when I change the relevant inputs (expected returns on each individual stock). This cannot be correct as the tangent portfolio mix should change as I move along the tangent curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS - I've already given thought to the idea of using LaGrange Multipliers but it wasn't practical. Matrices are much easier to implement. Also, we're not allowed to use Solver.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any advice? Thanks for reading.&lt;/p&gt;&#xA;" OwnerUserId="11878" LastEditorUserId="9336" LastEditDate="2014-08-23T18:19:09.897" LastActivityDate="2014-08-23T18:19:09.897" Title="Portfolio Optimization - n risky assets" Tags="&lt;portfolio-optimization&gt;&lt;covariance-matrix&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14479" PostTypeId="1" CreationDate="2014-08-23T06:53:31.070" Score="2" ViewCount="2283" Body="&lt;p&gt;I'm doing research on historical price movements on the New York Stock Exchange.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because the NYSE is closed on weekends, on holidays, and sometimes because of special events, special care needs to be taken. For my purpose, I wish to ignore these days and pretend as if the previous open day is the actual last day of business.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, in my statistical software STATA this can be achieved by specifying these special dates in a business calendar file, like so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    version 12&#xA;    purpose &quot;Market holidays and special closing days calendar&quot;&#xA;    dateformat dmy&#xA;&#xA;    range 03jan2011 31dec2013&#xA;    centerdate 03jan2011&#xA;&#xA;    omit dayofweek (Sa Su)&#xA;    omit date 01jan2011&#xA;    omit date 17jan2011&#xA;    omit date 21feb2011&#xA;    omit date 22apr2011&#xA;    omit date 30may2011&#xA;    omit date 04jul2011&#xA;    omit date 05sep2011&#xA;    omit date 24nov2011&#xA;    omit date 26dec2011&#xA;    omit date 02jan2012&#xA;    omit date 16jan2012&#xA;    omit date 20feb2012&#xA;    omit date 06apr2012&#xA;    omit date 28may2012&#xA;    omit date 04jul2012&#xA;    omit date 03sep2012&#xA;    omit date 22nov2012&#xA;    omit date 25dec2012&#xA;    omit date 01jan2013&#xA;    omit date 21jan2013&#xA;    omit date 18feb2013&#xA;    omit date 29mar2013&#xA;    omit date 27may2013&#xA;    omit date 04jul2013&#xA;    omit date 02sep2013&#xA;    omit date 28nov2013&#xA;    omit date 25dec2013&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Of course, this list is incomplete because I need the closed dates from 2005 until the present (2014). However, I have been unable to find this list. Does anyone know if this information is available?&lt;/p&gt;&#xA;" OwnerUserId="11879" LastActivityDate="2015-11-11T16:38:49.733" Title="List of dates at which the NYSE was closed from 2005 to 2014?" Tags="&lt;equities&gt;&lt;research&gt;&lt;analysis&gt;&lt;nyse&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14480" PostTypeId="1" CreationDate="2014-08-23T13:04:09.440" Score="3" ViewCount="141" Body="&lt;p&gt;Suppose that I have an option on a single stock expiring at time $T$ and I replicate the payoff of this derivative by investing in the stock market and the money market. So this condition reads&#xA;$$X(T) = V(T) \quad \text{almost surely}$$&#xA;where $X(T)$ is the value of my portfolio and $V(T)$ is the payoff of the derivative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This condition holding under the actual probability measure is equivalent to it holding under the risk neutral measure, which I assume to exist and to be unique.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We then price the option by saying&#xA;$$D(t)X(t) = \widetilde{E}[D(T)X(T)|F(t)] = \widetilde{E}[D(T)V(T)|F(t)]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a problem with the last equality. If the &quot;almost surely&quot; condition holds, then the last equality is implied. However, that equality does not necessarily imply the &quot;almost surely&quot; condition. Am I missing something here or is the fact that the price that comes of this method is unique and that it is a necessary condition for the almost surely condition to hold good enough for our purposes?&lt;/p&gt;&#xA;" OwnerUserId="11597" LastActivityDate="2014-08-27T15:06:04.897" Title="Risk Neutral Pricing Necessary Condition" Tags="&lt;risk-neutral-measure&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14482" PostTypeId="2" ParentId="14479" CreationDate="2014-08-23T14:15:31.897" Score="2" Body="&lt;p&gt;You can download the time series of e.g. S&amp;amp;P500 prices from NYSE, then their dates should well represent approximately the real NYSE trading days.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-08-23T18:20:53.933" LastActivityDate="2014-08-23T18:20:53.933" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14483" PostTypeId="2" ParentId="14478" CreationDate="2014-08-23T14:23:42.810" Score="3" Body="&lt;p&gt;You have to find the market portfolio, which is the portfolio with maximum Sharpe Ratio:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S^*(w)=\frac{R_p(w)-R_f}{\sigma_p(w)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So calculate this ratio and maximize it (I think there is also an exact analytic expression for the market portofolio weights).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then investors will mix this optimal &quot;best&quot; Market portfolio with the riskfree asset based on their desired return, so you get the investor portfolio weights $w$ for desired return $R^*$ by solving:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R^*=w\cdot R_m+(1-w)R_f$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $R_m$ being the market portfolio's return and $R_f$ the riskfree asset's return.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-08-23T14:31:34.820" LastActivityDate="2014-08-23T14:31:34.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14484" PostTypeId="2" ParentId="14480" CreationDate="2014-08-23T15:02:50.097" Score="1" Body="&lt;p&gt;The theorem which justifies the equality of the expectations is Radon-Nikodym theorem. It says:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E^P(DX)=E^Q(X)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $D=dQ/dP$ is a change of measure process with $E(D)=1$, $D&amp;gt;0$ and $Q\sim P$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that $Q$ is further specified as the special riskneutral measure under which $X$ becomes a martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see it easily by writing out the expectations:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E^P(DX)=\int DX \cdot dP=\int X \frac{dQ}{dP}\cdot dP=\int X dQ=E^Q(X)$$&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-08-23T15:11:10.927" LastActivityDate="2014-08-23T15:11:10.927" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14485" PostTypeId="1" CreationDate="2014-08-23T16:01:38.857" Score="0" ViewCount="440" Body="&lt;p&gt;I want to build a formula to produce a score for a potential trade based on 4 variables, time, return, liquidity of security, and probability of failure.  For a set of potential trades I first attempted ordering them by producing a score =  (1/time) * return * liquidity * (1/probability). So higher scores are better, i.e., ideal trades are short in duration, high in return and in liquidity of security, and low in probability of failure.  However,  I want the formula to take into account higher return trades and allow flexibility to a point in the probability of failure and liquidity..&#xA;So for example for these 2 trades:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Days,    Liquidity,               Return,         Probability&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2,  100,            0.4%,          0.6%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5,  300,            4%,        7.4%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ratios: (Days)=2.5, ,Liquidity=3, Return=10, Probability=12.3&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would want a formula to score the second trade higher, though I'd want to cap the probability based on the level of return as well as consider time, so I'd be willing to accept a 7% or 8% chance of failure for a 4% return in 5 days, but not in 40 days, and not for a .5% return in 5 days, etc..   Also, if the liquidity of the second trade was very little, say 10, then it should score trade 1 higher even though the return is higher and the probability is acceptable.    &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could I go about producing a formula to model this relationship?  I tried OLS, but the resulting error was high, so the formula was not usable.  Any advice? &lt;/p&gt;&#xA;" OwnerDisplayName="user11882" LastActivityDate="2015-04-24T07:01:05.180" Title="How to create a model or formula for evaluating trade opportunities" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;regression&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14486" PostTypeId="2" ParentId="14485" CreationDate="2014-08-23T16:15:42.140" Score="1" Body="&lt;p&gt;I think you are pretty much mixing apples with oranges in your formula :-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A slightly more meaningful, but yet very simple approach, could be first of all to &quot;normalize&quot; each score in the interval [0, 1]:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;                 Value - Min Value&#xA; Index01 =     ----------------------&#xA;                Max Value - Min Value&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(your quantities are all positive, so it's ok).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you might, for instance, put them together by making a weighted average, where the weight would express the importance you attribute to that component:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  Sum of (Index01 * Weight) / (Sum of Weights)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;PS. If that composite index is useful for trading or makes sense at all, is another matter&lt;/p&gt;&#xA;" OwnerUserId="5132" LastActivityDate="2014-08-23T16:15:42.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14487" PostTypeId="2" ParentId="10623" CreationDate="2014-08-23T19:02:13.180" Score="2" Body="&lt;p&gt;You can formulate the problem of finding the optimal hedging frequency under transaction costs to maximize the Sharpe ratio of the delta-hedging strategy. The risk is the P&amp;amp;L volatility and the reward is smaller transaction costs. Analytical solutions and similar analysis can also be applied to spot- and delta-based hedging strategies. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Details in &lt;a href=&quot;http://ssrn.com/abstract=1865998&quot; rel=&quot;nofollow&quot;&gt;http://ssrn.com/abstract=1865998&lt;/a&gt; &lt;a href=&quot;http://ssrn.com/abstract=1865998&quot; rel=&quot;nofollow&quot;&gt;When You Hedge Discretely: Optimization of Sharpe Ratio for Delta-Hedging Strategy under Discrete Hedging and Transaction Costs&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11884" LastEditorUserId="11884" LastEditDate="2014-08-24T18:24:19.020" LastActivityDate="2014-08-24T18:24:19.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14488" PostTypeId="2" ParentId="12694" CreationDate="2014-08-23T22:30:32.153" Score="0" Body="&lt;p&gt;I am not expert but china has U.S. Treasury Bonds, so both sides does know how much bond china has and how much bonds getting converted to USD. Its all build on trust, otherwise start to stack sandbags.&lt;/p&gt;&#xA;" OwnerUserId="11885" LastActivityDate="2014-08-23T22:30:32.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14489" PostTypeId="1" CreationDate="2014-08-24T05:09:33.590" Score="4" ViewCount="541" Body="&lt;p&gt;This is from Pliskas book in mathematical finance. I do not know what was best to write the question so I included the pages from the book. He has not written what form of the separating hyperplane theorem he uses, and why this follows. If someone understands it, could you please explain it? I have outlined in red the sentence I do not understand. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;They refer to 1.3 which is:  $V_t^*=V_t^*/B_t$, $t=0,1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and 1.16:  There are no arbitrage oppurtunities if and only if there exists a risk neutral probability measre on Q.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;He also uses a single period model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/rCxC6.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="11692" LastActivityDate="2014-08-24T12:09:24.067" Title="How does this follow from the separating hyperplane theorem?" Tags="&lt;arbitrage&gt;&lt;risk-neutral-measure&gt;&lt;no-arbitrage-theory&gt;&lt;convexity&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14490" PostTypeId="2" ParentId="14489" CreationDate="2014-08-24T09:31:29.890" Score="0" Body="&lt;p&gt;After applying the theorem you can take an $Y$ orthogonal to the separation plane, pointing in the right direction, you will easily have the property $X.Y&amp;gt;0$ for all $X$. &lt;/p&gt;&#xA;" OwnerUserId="5052" LastActivityDate="2014-08-24T09:31:29.890" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14491" PostTypeId="2" ParentId="14474" CreationDate="2014-08-24T10:01:20.710" Score="4" Body="&lt;p&gt;There is a lot of different kind of IR models. You can modelize short rates, forward rates or more complex rates like Swap rates. Once you chose a rate and a model that fit your needs (some are easier to use for a given application or asset class, some models are incompatible with some hypothesis or other models). The model will usually take the form of a Stochastic differential equation, wich give the dynamic of your rate(s). The SDE will contain some parameters. You then have to find the parameters that represent the real life (calibration process). This is probably the hardest part as it require both theoretical and practical computations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no regulation on that, just properties that your model should respect or not based on what you need. But this is not written in stone. For exemple some models were heavily criticised because they could become negative, people preferred positive models wich would be more reallistic because everybody know rates could not be negative. Some rates recently become negative...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a very broad answer as I can't sum up decades of works of thousands people in one post. You should really read a courses on IR models. Look for the slides of Brigo and/or Mercurio courses.  &lt;/p&gt;&#xA;" OwnerUserId="5052" LastActivityDate="2014-08-24T10:01:20.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14492" PostTypeId="2" ParentId="14489" CreationDate="2014-08-24T12:09:24.067" Score="1" Body="&lt;p&gt;In our lecture, we were told to omit the proof because it was too difficult. Maybe it will help you though if you can read it here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/cjOf8.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/0B7gg.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/hexei.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-08-24T12:09:24.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14493" PostTypeId="2" ParentId="11357" CreationDate="2014-08-24T16:29:01.453" Score="1" Body="&lt;p&gt;It's also necessary to look into technical indicators and filters.  Technically analysis are often widely employed by finance practitioners and can apply to any sort of timeframe whether that's intra-day or EODs.  Since ANNs are able to fit complex non-linear inputs, it would not hurt to add many of those indicators into the mix&lt;/p&gt;&#xA;" OwnerUserId="11888" LastActivityDate="2014-08-24T16:29:01.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14494" PostTypeId="1" AcceptedAnswerId="14496" CreationDate="2014-08-24T16:55:07.943" Score="3" ViewCount="287" Body="&lt;p&gt;In the book &lt;em&gt;Counterparty Credit Risk, Collateral and Funding&lt;/em&gt; by Brigo et al I found the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;credit quality of investor WORSENS $\Rightarrow$ books POSITIVE MARK TO MKT&lt;br&gt;&lt;/li&gt;&#xA;&lt;li&gt;credit quality of investor IMPROVES $\Rightarrow$ books NEGATIVE MARK TO MKT&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&quot;Citigroup in its press release on the first quarter revenues of 2009&#xA;reported a positive mark to market due to its worsened credit&#xA;quality: “Revenues also included [...] a net 2.5$ billion positive&#xA;CVA on derivative positions, excluding monolines, mainly due to&#xA;the widening of Citi’s CDS spreads&quot;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Now, when trying to price some cashflows $\Pi_B(t,T)$ from the view of a bank (B) to some counterparty (C) we have the following pricing formula (including the CVA and DVA adjustment):&#xA;$$E[\Pi_B^D(t,T)] = E[\Pi_B(t,T)] - CVA_B(t,T) + DVA_B(t,T)$$&#xA;where $$CVA_B(t,T) = \mathbb Q(t&amp;lt;\tau_C&amp;lt;T)\cdot E[LGD_C\cdot D(t,\tau_C )\cdot[-NPV_B (\tau_C )]^+]$$ and $$DVA_B(t,T) = \mathbb Q(t&amp;lt;\tau_B&amp;lt;T)\cdot E[LGD_B\cdot D(t,\tau_B )\cdot[NPV_B (\tau_B )]^+]$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Now I am wondering why exactly Citi group is having a positive MtM. If its credit spreads widen, then its default probability $\mathbb Q(t&amp;lt;\tau_B&amp;lt;T)$ increases. Hences the $DVA$ term increases and subsequently the price $E[\Pi_B^D(t,T)]$ which the bank would have to pay increases as well. So the bank is making a loss. I am sure there is a logical error somewhere, but where?&lt;/p&gt;&#xA;" OwnerUserId="6621" LastActivityDate="2014-08-25T15:05:48.117" Title="CVA/CDVA - Worsened Credit Quality implies profit?" Tags="&lt;credit&gt;&lt;credit-risk&gt;&lt;cva&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14496" PostTypeId="2" ParentId="14494" CreationDate="2014-08-24T20:07:20.817" Score="3" Body="&lt;p&gt;As I see it, the term $\Pi_B(t, T)$ is the value of the derivatives already owned by the bank. So, it's not some price they need to pay but an asset on the balance sheet. This increase in asset value leads to a profit. &lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Balance sheet Example&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Imagine the balance sheet of OTC Subsidiary with rating A:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Assets                    | Liabilities&#xA;----------------------------------------------------&#xA;OTC derivative + CVA   100| Total Liabilities    100&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now OTC Subsidiary gets downgraded to rating B increasing the CVA by 10:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Assets                    | Liabilities&#xA;----------------------------------------------------&#xA;OTC derivative + CVA   110| Total Liabilities    100&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A balance should balance and liabilities haven't changed (extra collateral wouldn't leave the balance sheet). Hence something should be added on the right side. I believe that how you want to name this quantitiy is mostly an accounting matter but one can choose to put this into the P/L. Putting it in the P/L might not be a really nice solution but it's what often used. Two discussions on this topic I found interesting can be found in &lt;a href=&quot;http://www.ft.com/intl/cms/s/0/6fc73758-1473-11e2-8ef2-00144feabdc0.html?siteedition=intl&quot; rel=&quot;nofollow&quot;&gt;Tracy Alloway in Banks face profits hit as fog&lt;/a&gt; and &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1137293853&quot; rel=&quot;nofollow&quot;&gt;OTC Derivatives, Bilateral Trading and Central Clearing by David Murphy&lt;/a&gt;, Chapter 3.&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="848" LastEditDate="2014-08-25T14:00:42.187" LastActivityDate="2014-08-25T14:00:42.187" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14497" PostTypeId="1" CreationDate="2014-08-24T23:40:01.470" Score="2" ViewCount="142" Body="&lt;p&gt;I am looking for some reference on the art market in light of quantitative finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am interested in some things:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The market in general&lt;/strong&gt;, how is it compared to financial market ? What about common hypothesis like arbitrage opportunities, rationality of agents, risk-free asset..., the presence of derivatives ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The formation of price&lt;/strong&gt;, a lot of price come from auction houses. So the process of price formation is a bit different than a bid/ask process. Does this lead to different results in price modelisation ? Does this lead to different strategy ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Prices dynamics&lt;/strong&gt;, given one or multiple assets, are there specifical models for art prices ? (I suspect some trend by artist/by current).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Last but not least: &lt;strong&gt;sources&lt;/strong&gt; do you know some sources for art prices ? theoretical papers about art prices ?&lt;/p&gt;&#xA;" OwnerUserId="5052" LastEditorUserId="5052" LastEditDate="2014-08-25T13:07:10.783" LastActivityDate="2014-08-25T13:07:10.783" Title="Art market specificities" Tags="&lt;market&gt;&lt;price&gt;&lt;market-model&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14498" PostTypeId="2" ParentId="14485" CreationDate="2014-08-25T02:03:44.653" Score="1" Body="&lt;p&gt;I &lt;em&gt;think&lt;/em&gt; the only thing throwing your desired results for these examples is the 12-fold advantage given by the probability. You could consider using a (natural) log of the probability, which would dampen the advantage (in this case) to two-fold (and take the negative, as I presume all your probabilities are &amp;lt;= 1).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, beware tailoring your algorithms to suit any specific data, as you are hopefully aware.&lt;/p&gt;&#xA;" OwnerUserId="7174" LastActivityDate="2014-08-25T02:03:44.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14499" PostTypeId="2" ParentId="14497" CreationDate="2014-08-25T08:56:27.657" Score="4" Body="&lt;p&gt;Art markets typically have huge transaction costs of the order of 10%, caused by buyers premium and auction fees. Therefore long holding periods are unavoidable, with long-term returns somewhere between those of bonds and equities. By its very nature, art is not easily replicated so arbitrage or derivatives are out. The rationality of agents (aka collectors) is probably open to debate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The art market was a topic at the Inquire (Institute of Quantitative Investment Research) Europe Conference in Oct 2012, under &quot;Investments of Passion&quot;. There was a presentation by Will Goetzmann titled &lt;em&gt;Art and Money&lt;/em&gt;, by Steve Satchell on &lt;em&gt;Stamps and Financial Investment&lt;/em&gt; and by Andrew Rudd on &lt;em&gt;Investing in Rare Books&lt;/em&gt;.&#xA;&lt;em&gt;Art and Money&lt;/em&gt; contains evidence of the co-movement of art prices and stock markets, top incomes and changes in income inequality. Satchell and Rudd discuss valuation / price formation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The slides of the presentations are available at &lt;a href=&quot;http://www.inquire-europe.org/&quot; rel=&quot;nofollow&quot;&gt;Inquire Europe&lt;/a&gt; under Seminars &gt; Istanbul 2012 &gt; Papers at the Seminar&lt;/p&gt;&#xA;" OwnerUserId="6721" LastActivityDate="2014-08-25T08:56:27.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14500" PostTypeId="2" ParentId="14497" CreationDate="2014-08-25T11:02:26.890" Score="3" Body="&lt;p&gt;I would say the financial- and the art market is very different, only the roots of the market / auctions is the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the art market is unique and very illiquid, alot of the strategies from the modern financial market simply does not apply.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been building (and still maintains) a toolbox of models, which mostly try to find trends based on multiple parameret sets eg.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Artist in combination with painting size and year/period.&lt;/li&gt;&#xA;&lt;li&gt;Artist in combination with geographic location (entry and exit auctionhouse).&lt;/li&gt;&#xA;&lt;li&gt;…and manny manny more…&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Another great way to spot winners is to create a tag cloud for the paintings, the scanning algorithms mark as ‘possible interesting’. If you have done the same, for the paintings getting a result well above your avarage mean bound, it is possible to spot the paintings with the winning scenes eg. girl writing/painting/making homework in dim light.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you (still) are almost sure the bids that are coming through the Internet and phone is by humans, it is possible to analyse the price hikes and bid delays, to detect a variety of auction tricks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have only been involved in public auction-only strategies, so I am not an expert in trading within the art dealer network.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this subject is something you are deeply interested in, I have made a data collector for ArtPrice, which I can submit to Github, it is not perfect but a good place to start.&lt;/p&gt;&#xA;" OwnerUserId="4769" LastActivityDate="2014-08-25T11:02:26.890" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14501" PostTypeId="2" ParentId="14494" CreationDate="2014-08-25T15:05:48.117" Score="1" Body="&lt;p&gt;The rules relating to mark-to-market accounting have always been, in my opinion, ridiculous.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Citigroup have to mark their liabilities to a fair value, and in this case, where it is their own debt, part of the pricing require that they consider the potential of their own default. The more likely it becomes, that the bank defaults the less the banks swaps is worth to the investors who hold them. The mark-to-market guidelines says Citigroup then should reduce the value of the liabilities on their books, they are allowed to book this difference as a gain/profit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is ridiculous because a bank spinning out of control and heading directly into bankruptcy are able to book huge paper profits while it at the same time is melting down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not think you are missing something, except knowing about this one specific mark-to-market accounting practice/guideline.&lt;/p&gt;&#xA;" OwnerUserId="4769" LastActivityDate="2014-08-25T15:05:48.117" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14502" PostTypeId="2" ParentId="14466" CreationDate="2014-08-25T16:33:20.443" Score="0" Body="&lt;p&gt;why not run the same time series 3 times, once for each data set?&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2014-08-25T16:33:20.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14503" PostTypeId="2" ParentId="14466" CreationDate="2014-08-25T21:01:07.487" Score="3" Body="&lt;p&gt;How is this different than a reverse stock split? If you just want the same scale for all the data, you'd just have to update the historic data using the reverse split ratio.&lt;/p&gt;&#xA;" OwnerUserId="5407" LastActivityDate="2014-08-25T21:01:07.487" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14504" PostTypeId="1" CreationDate="2014-08-25T22:12:50.607" Score="5" ViewCount="165" Body="&lt;p&gt;The introduction VIX options makes the concept of &quot;volatility of volatility&quot; a real life concept. The idea of &quot;nested volatility&quot; seems interesting, and I am wondering if there are any academic treatment on the subject. For example, we know that variances follow chi-square distributions, but what happens when you take the volatility n times?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To take a look at these things, I simulated a driftless Brownian motion time series $x(t+1) = x(t) + N(0,1)$ for 5000 days, then I calculated its 10 day volatility, and the 10 day volatility of the volatility, and so on. The process is repeated 8 times. A few interesting observations were made.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The average value of the time series decrease by about 65% - 73% each time you take the volatility. The scale of this decrease also decreases over time.&lt;/li&gt;&#xA;&lt;li&gt;The correlation the between time series and its volatility ranges from 0.4 to 0.6, and this correlation increases each time you take the volatility. This is very strange as CBOE claims that historically VIX has little correlation with its volatility index VVIX.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;It would be nice to find some theoretical explanations for these observations. I really hope there  are something out there something similar to power series expansions, where we can break down an object into infinite number of ever-decreasing smaller objects.&lt;/p&gt;&#xA;" OwnerUserId="7467" LastActivityDate="2014-08-26T07:36:42.763" Title="Nested volatility" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;vix&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14505" PostTypeId="1" AcceptedAnswerId="14507" CreationDate="2014-08-26T01:26:47.097" Score="0" ViewCount="280" Body="&lt;p&gt;I am currently a student and in the future would like to work as a software developer for a financial institution such as Bloomberg, Factset etc. I was looking to contribute  to some open source or develop a financial application that will not only build my profile but also help me learn. I am not sure where to start .I came across &lt;a href=&quot;http://www.bloomberglabs.com/api/about/&quot; rel=&quot;nofollow&quot;&gt;http://www.bloomberglabs.com/api/about/&lt;/a&gt; and was wondering if it can be used to develop applications not for commercial use but just for open source project. In addition i would love it if any senior or experienced developers is willing to mentor me i will work hard and dedicate myself but i really lack guidance.&lt;/p&gt;&#xA;" OwnerUserId="9275" LastActivityDate="2014-08-26T05:08:32.083" Title="Contribute to Finance related projects" Tags="&lt;programming&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2014-08-26T05:38:37.370" ContentLicense="CC BY-SA 3.0" />
  <row Id="14506" PostTypeId="2" ParentId="12859" CreationDate="2014-08-26T04:06:25.053" Score="0" Body="&lt;p&gt;Imagine this: you roll a fair die. If you roll a 5 or a 6, you get 3 dollars. If you roll a 1-4, you lose a dollar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Positive expectancy, less than 50% correct. The simplest trend followers have such a profile. &lt;/p&gt;&#xA;" OwnerUserId="11900" LastActivityDate="2014-08-26T04:06:25.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14507" PostTypeId="2" ParentId="14505" CreationDate="2014-08-26T05:08:32.083" Score="1" Body="&lt;p&gt;If you're a student, the first place I would suggest you seek guidance would be from your professors. They could at least steer you in a direction of developing something that could be meaningful and appropriate for someone with your background (whatever that may be, your professors probably would know).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're looking for something open source, then I would suggest creating some useful R package. ;)&lt;/p&gt;&#xA;" OwnerUserId="5407" LastActivityDate="2014-08-26T05:08:32.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14508" PostTypeId="2" ParentId="14504" CreationDate="2014-08-26T07:36:42.763" Score="2" Body="&lt;p&gt;It is a stylized feature that the correlation between SPX and VIX is negative (around -0.7) thus we have an interesting process here. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nothing as simple as driftless Brownian motion. The volatility process jumps up and then fades out which is often modelled as Hawkes process (see e.g. &lt;a href=&quot;http://users.iems.northwestern.edu/~armbruster/2007msande444/report1b.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;). Thus conclusions from the simple Gaussian model (with Chi-quared volatiltiy) to the real world are difficult.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-08-26T07:36:42.763" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14509" PostTypeId="1" CreationDate="2014-08-26T08:11:22.237" Score="3" ViewCount="294" Body="&lt;p&gt;Consider the two following optimization problem&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) $$ \min_{\theta} \ln E_{\theta}[ e^{X}]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) $$ \min_{\theta} E_{\theta}[ X]$$&#xA;     with the constraint $$ Var_{\theta}[X] &amp;lt;c$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it true that the first one is a better measure for risk-sensitivity cost as it takes other moments (which is visible from the Taylor series expansion) also into account ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, can we say anything about the usefulness of the first cost compared to any other risk-sensitive cost ? &lt;/p&gt;&#xA;" OwnerUserId="11679" LastActivityDate="2015-06-09T21:04:57.427" Title="Which is the better risk sensitive measure?" Tags="&lt;risk&gt;&lt;optimization&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14511" PostTypeId="1" CreationDate="2014-08-26T09:01:09.363" Score="5" ViewCount="253" Body="&lt;p&gt;I have the following SDE:&#xA;$$dY_{t}=A\left(\frac{W_{t}^{1}}{\sqrt{t}},\frac{Y_{t}}{\sqrt{t}}\right)dW_{t}^{1}+B\left(\frac{W_{t}^{1}}{\sqrt{t}},\frac{Y_{t}}{\sqrt{t}}\right)dW_{t}^{2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W_{t}^{1}$ and $W_{t}^{1}$ are two independent brownian motions and&#xA;$$A(x,y)=a\frac{\Phi(y)\Phi(-y)e^{0.5(y^2-x^2)}+\Phi(x)\Phi(-x)e^{0.5(x^2-y^2)}}{1+a(1-2\Phi(x))(1-2\Phi(y))}, \ \ \ \ \ \ \ \ B=\sqrt{1-A^2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems unlikely, but I was wondering if there may be an explicit solution to this stochastic differential equation in terms of $W_{t}^{1}$ and $W_{t}^{2}$? Perhaps it can be reduced to a linear SDE with a suitable function?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="7649" LastActivityDate="2014-08-31T02:24:06.477" Title="Explicit solution SDE" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;sde&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14512" PostTypeId="1" CreationDate="2014-08-26T17:22:24.273" Score="6" ViewCount="2830" Body="&lt;p&gt;Most of the exchanges provide aggressor side property of trades (e.g. &lt;a href=&quot;http://www.cmegroup.com/confluence/display/EPICSANDBOX/Market+Data+-+Incremental+Refresh&quot; rel=&quot;noreferrer&quot;&gt;Tag=5797 AggressorSide on CME&lt;/a&gt;) in their raw data. But many data providers do not provide this information via their datafeed API's. I need an algorithm to estimate with high precision the trade's aggressor side. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose, I receive depth data updates and trades updates. The simplest algorithm is (in Java code):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;public static int get_aggressor(int bid, int ask, int trade_price){&#xA;    int aggr = Tags.UNKNOWN_SIDE;&#xA;    if (bid &amp;lt; ask){ // i.e. no cross&#xA;        if (trade_price &amp;gt;= ask){&#xA;            aggr = Tags.BUY_SIDE;&#xA;        } else if (trade_price &amp;lt;= bid){&#xA;            aggr = Tags.SELL_SIDE;&#xA;        }&#xA;    }&#xA;    return aggr;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;bid&lt;/code&gt; and &lt;code&gt;ask&lt;/code&gt; are best bid/ask prices at a time when the trade was received. This algorithm may fail to detect the aggressor when the trade in the question affects the best bid/ask. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;: Suppose I have the history of recent price updates. How to improve the precision of the aggressor detection algorithm? Also, consider two types of data feed:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The trades always arrive before the resulted price updates&lt;/li&gt;&#xA;&lt;li&gt;The order of updates arrival in #1 is not guaranteed.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Please let me know if there are published researches on this topic. &lt;/p&gt;&#xA;" OwnerUserId="1515" LastEditorUserId="1515" LastEditDate="2014-08-26T20:37:03.327" LastActivityDate="2014-09-09T05:09:06.293" Title="Algorithm to detect the aggressor side of a trade" Tags="&lt;data&gt;&lt;market-data&gt;&lt;automated-trading&gt;&lt;market-microstructure&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14513" PostTypeId="1" CreationDate="2014-08-26T19:39:00.587" Score="3" ViewCount="182" Body="&lt;p&gt;My problem is that I have a state space model that I estimate using the Berndt–Hall–Hall–Hausman (BHHH) algorithm. The state space model is relatively simple in that the hidden part follows a pure AR(1) process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From tests on simulated data I know I need a time series of 500 observations to get good convergence. However my empirical data set is only 375 observations, worse I need to be able to test the model in and out of sample so I have more like 188 observations!! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just wondered what my best options are?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1.) Use a different optimization method and hope that it is more efficient (seems labor intensive to try and find the right optimizer)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2.) Use bootstrapping similar to what they have done in the question below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stats.stackexchange.com/questions/14213/calculating-confidence-intervals-via-bootstrap-on-dependent-observations/14217#14217&quot;&gt;https://stats.stackexchange.com/questions/14213/calculating-confidence-intervals-via-bootstrap-on-dependent-observations/14217#14217&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Will the bootstrapping allow me to get better convergence with smaller data sets? &#xA;If so how much shorter data set can I use? If 500 are required for good convergence will bootstrapping give me similar convergence with 350 observations or even 188 observations?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any other options I can try?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Baz&lt;/p&gt;&#xA;" OwnerUserId="7077" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2014-08-26T19:39:00.587" Title="State Space models with Short Time Series" Tags="&lt;time-series&gt;&lt;statistics&gt;&lt;optimization&gt;&lt;bootstrap&gt;" AnswerCount="0" CommentCount="7" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14514" PostTypeId="2" ParentId="14512" CreationDate="2014-08-26T20:43:35.693" Score="3" Body="&lt;p&gt;I think spread midpoint will be more safe reference, after that if transaction price is higher from midpoint its buy, otherwise sell, if equal then not specified.&lt;/p&gt;&#xA;" OwnerUserId="6175" LastEditorUserId="6175" LastEditDate="2014-08-26T20:49:38.060" LastActivityDate="2014-08-26T20:49:38.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14515" PostTypeId="2" ParentId="14512" CreationDate="2014-08-26T22:09:27.347" Score="7" Body="&lt;p&gt;The most commonly-known approach to this is described in &lt;em&gt;Inferring trade direction from intraday data&lt;/em&gt; (1991) by Lee and Ready. You will find that the non-trivial part has to do with classifying trades that are reported inside the spread. I believe you will find that the Lee-Ready algorithm will outperform the naive midpoint reference approach suggested by @Svisstack, but nevertheless you will not be able to fully mitigate misclassification.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A more modern exposition of the criticisms of the Lee-Ready algorithm is given by &lt;a href=&quot;https://www.hotelschool.cornell.edu/research/facultybios/research-papers/documents/ShortsLongsandLeeReady_JFMforthcoming.pdf&quot;&gt;Chakrabarty et al (2012)&lt;/a&gt;, which should give you a starting point for other readings.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2014-08-26T22:09:27.347" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14516" PostTypeId="2" ParentId="14466" CreationDate="2014-08-27T00:38:24.290" Score="0" Body="&lt;p&gt;You are working with a time series $x(t)$ which has been re-denominated at times $t_1$ and $t_2$. You want to rescale the time series for all times $t &amp;lt; t_2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, do you know what the rescaling factors ($k$) should be (e.g. did 1000 units turn into one unit)? If not, I would set $k_2:= t_2^+ / t_2^-$, where $t_2^-$ is the last currency rate before the last rescale, and $t_2^+$ is the first data point after the rescale. For all $t &amp;lt; t_2$, multiply all $x(t)$ by $k_2$.&#xA;Do the same thing around $t_1$: set $k_1:= t_1^+ / t_1^-$ (if you have no other information on $k_1$) and then for all $t &amp;lt; t_1$, multiply all $x(t)$ by $k_1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good luck!&lt;/p&gt;&#xA;" OwnerUserId="11791" LastActivityDate="2014-08-27T00:38:24.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14518" PostTypeId="2" ParentId="14485" CreationDate="2014-08-27T04:56:00.087" Score="1" Body="&lt;p&gt;&lt;strong&gt;Here are some quick fixes to your problems&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;em&gt;return&lt;/em&gt; should not be 0.4% or 4%, but 1.004 or 1.04, respectively.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;em&gt;probability of failure&lt;/em&gt; (by the way, what is that? losing everything?&#xA;Losing an amount equal to potential gain?) should be subtracted from&#xA;1, not reciprocal: $1-P$ rather than $1/P$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This is more rational and will already fulfill your wish of putting the second trade (58) ahead of the first (50).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally, however, my advice would be to &lt;strong&gt;stay away from &quot;scoring&quot; quantities that have [different] units&lt;/strong&gt;.&#xA;I don't know how you're measuring liquidity, but if it does not have units then your &quot;score&quot; actually has units of 1/time (if liquidity is in dollars, than your score is actually dollars/day). I am not sure how you would model the effect of liquidity on expected return [personally, I stay away from all but the the most liquid securities].&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are you really trying to measure? Best expected return per trade? Best expected return per annum? Probabilities? Something else?&#xA;Whatever it is, &lt;strong&gt;define how each variable affects your desired result&lt;/strong&gt; and frame it in appropriate units/dimensions. For example, let's say you want to achieve the highest possible return per day. Examine how each variable would affect this goal. I suspect you would need at least a few more inputs, e.g. transaction costs $T$, worst case (&quot;failure&quot;) loss, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Expected return $R$ is often defined as something like $gain × (1 - P) + loss × P - T$.&#xA;(note that what I called gain here is what you originally call return, I believe).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your &lt;em&gt;expected daily return&lt;/em&gt; might then be defined as $R^{1/t}$, where $t$ is the time in days.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for example, if your expected return comes out to be 5% but takes five days to realize, the &lt;em&gt;expected daily return&lt;/em&gt; would be $1.05^{1/5} = 1.0098 (0.98\%)$ - just under 1%, as expected (remember compounding).&lt;/p&gt;&#xA;" OwnerUserId="11791" LastActivityDate="2014-08-27T04:56:00.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14519" PostTypeId="2" ParentId="14468" CreationDate="2014-08-27T05:21:02.600" Score="0" Body="&lt;p&gt;It really depends what you're trying to achieve! &lt;strong&gt;What is the ultimate goal?&lt;/strong&gt; What are your constraints?&#xA;Which stocks are you looking at?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without the answers to the above, any partition is just arbitrary: why choose 30th and 70 percentile, vs 10th and 90th? Why choose  (-2)*Std.Dev and (+2)*Std.Dev vs just -1 and +1?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The selected (and perhaps only correct) way to classify volatilities is the one that satisfies (or at least optimizes) your ultimate goal.&lt;/p&gt;&#xA;" OwnerUserId="11791" LastActivityDate="2014-08-27T05:21:02.600" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14520" PostTypeId="2" ParentId="14310" CreationDate="2014-08-27T05:44:44.493" Score="-1" Body="&lt;p&gt;&lt;strong&gt;Both ways are equivalent&lt;/strong&gt; (assuming we are talking about net returns, and not forgetting any kind of transaction cost).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remember that returns are percentages: they are calculated as $$&#xA;\frac{P_1 - P_0}{P_0}\times 100$$&#xA;[where $P_0$ is the price at the beginning of the period and $P_1$ is the price at the end] so it does not matter what currency you quote the price in: the &quot;units&quot; [of currency] fall off.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you can stick with your a) to save some time and don't worry about doing b).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good luck!&lt;/p&gt;&#xA;" OwnerUserId="11791" LastActivityDate="2014-08-27T05:44:44.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14521" PostTypeId="2" ParentId="9621" CreationDate="2014-08-27T06:14:35.187" Score="0" Body="&lt;p&gt;Some retail forex brokers (e.g. Dukascopy and FXCM) provide this information. But note that the former seems to indicate number of transactions, and the latter only counts transactions involving its own customers. Since you were asking for estimates, perhaps these will do?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;HTH&lt;/p&gt;&#xA;" OwnerUserId="11791" LastActivityDate="2014-08-27T06:14:35.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14522" PostTypeId="2" ParentId="9440" CreationDate="2014-08-27T06:33:58.113" Score="1" Body="&lt;p&gt;If you are specifically looking to analyze the US dollar, you can use the US dollar index $USDX (or dollar spot index DXY). There are many additional &quot;baskets&quot; for this and other currencies, such as Markit iBoxxFX Trade-Weighted Indices, based on central banks’ basket exchange rates, which &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;track the performance of a currency against a defined basket of&#xA;  currencies. The following currency indices are calculated: AUD, CAD,&#xA;  CHF, EUR, GBP, JPY, NOK, NZD, SEK and USD. Each basket is limited to&#xA;  the five currencies with the largest weights in the relevant central&#xA;  bank’s official index. The indices enable market participants to&#xA;  express a view on one currency rather than taking bilateral views with&#xA;  single currency crosses.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I think the problem with gold would be that it presumably changes much more [i.e. is much more volatile] than the currencies you're pegging it to.&lt;/p&gt;&#xA;" OwnerUserId="11791" LastActivityDate="2014-08-27T06:33:58.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14523" PostTypeId="1" AcceptedAnswerId="14525" CreationDate="2014-08-27T09:58:44.857" Score="0" ViewCount="126" Body="&lt;p&gt;Can anyone explain why the OHLC data I'm getting from yahoo appears to reflect stock splits during times when no significant corporate actions have occurred?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I'm looking at ABT and yahoo shows a closing price jump between &lt;strong&gt;Dec 31 2012&lt;/strong&gt; and &lt;strong&gt;Jan 1 2013&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;2012-12-31T00:00:00.000-08:00 65.5&lt;br&gt;&#xA;  2013-01-02T00:00:00.000-08:00 32.05&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But between &lt;strong&gt;Oct 2012&lt;/strong&gt; and &lt;strong&gt;Mar 2013&lt;/strong&gt; (according to yahoo) these are the only corporate actions that occurred&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;DIVIDEND, 20130111,0.140000&lt;br&gt;&#xA;  DIVIDEND, 20121011,0.244700&lt;br&gt;&#xA;  STARTDATE, 20121001&lt;br&gt;&#xA;  ENDDATE, 20130301&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What caused this price jump?&lt;/p&gt;&#xA;" OwnerUserId="11904" LastActivityDate="2014-08-27T14:40:49.163" Title="Yahoo OHLC data reflects nonexistant stock split" Tags="&lt;yahoo&gt;&lt;split&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14525" PostTypeId="2" ParentId="14523" CreationDate="2014-08-27T14:40:49.163" Score="2" Body="&lt;p&gt;They split the company into two: ABT and ABBV. &lt;a href=&quot;http://www.forbes.com/sites/brucejapsen/2012/10/17/a-less-acquisitive-abbott-labs-will-split-in-two-come-january/&quot; rel=&quot;nofollow&quot;&gt;http://www.forbes.com/sites/brucejapsen/2012/10/17/a-less-acquisitive-abbott-labs-will-split-in-two-come-january/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2014-08-27T14:40:49.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14526" PostTypeId="2" ParentId="14480" CreationDate="2014-08-27T15:06:04.897" Score="-1" Body="&lt;p&gt;I guess that the unclarity comes from the fact that hedge pricing is an incomplete model, as it does not take the FVA into account. Not from flaws of the mathematics used in the model.&lt;/p&gt;&#xA;" OwnerUserId="2872" LastActivityDate="2014-08-27T15:06:04.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14527" PostTypeId="1" CreationDate="2014-08-27T16:14:17.960" Score="-2" ViewCount="1563" Body="&lt;p&gt;These are my requirements:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Speed of lookup &amp;amp; update&lt;/li&gt;&#xA;&lt;li&gt;Speed of crunching large numbers and combinations&lt;/li&gt;&#xA;&lt;li&gt;The exchanges I want to connect to will mostly provide json feeds to their orderbooks &amp;amp; fees.&lt;/li&gt;&#xA;&lt;li&gt;I don't need to use charts too much, so to increase speed, I'd rather use an app that doesn't rely on charts. If it's fast &lt;strong&gt;and&lt;/strong&gt; has charts, that's great.&lt;/li&gt;&#xA;&lt;li&gt;Ability to set up accounts for exchanges that support it, or ability to create custom accounts for unsupported exchanges&lt;/li&gt;&#xA;&lt;li&gt;ability to script my algorithm&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What are the software out there I can use for forex currency pairs arbitrage trading? Let me know if more information is needed thanks.&lt;/p&gt;&#xA;" OwnerUserId="11909" LastActivityDate="2014-08-28T07:47:45.907" Title="What software should I use for forex arbitrage?" Tags="&lt;fx&gt;&lt;arbitrage&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14528" PostTypeId="2" ParentId="14527" CreationDate="2014-08-27T16:35:48.807" Score="2" Body="&lt;blockquote&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The exchanges I want to connect to will mostly provide json feeds to their orderbooks &amp;amp; fees.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Not so sure if you'll find anything designed for JSON feeds, most markets use FIX or a native binary API.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Speed of lookup &amp;amp; update&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Speed of crunching large numbers and combinations&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I don't need to use charts too much, so to increase speed, I'd rather use an app that doesn't rely on charts. If it's fast and has charts, that's great.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;You're over-emphasizing the need for speed here, to be honest.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Ability to set up accounts for exchanges that support it, or ability to create custom accounts for unsupported exchanges&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;FX doesn't trade in centrally-cleared exchanges, what are the markets that you're planning to trade in? But to name a few platforms that are commonly used, SR Labs and Bloomberg RTS will fit your needs for the most part.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2014-08-27T16:35:48.807" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14529" PostTypeId="1" CreationDate="2014-08-27T17:33:48.960" Score="0" ViewCount="848" Body="&lt;p&gt;I have &lt;strong&gt;implied volatility&lt;/strong&gt; data for call and put options (expiring in 1 month from any given date) for a particular stock. In addition, I have the &lt;strong&gt;delta&lt;/strong&gt; for the options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I have no information about the spot price of the stock or the strike price of the options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I draw a &lt;strong&gt;volatility smile&lt;/strong&gt; from the given data?&lt;/p&gt;&#xA;" OwnerUserId="11910" LastEditorUserId="11910" LastEditDate="2014-08-27T17:51:37.117" LastActivityDate="2014-08-27T21:52:58.567" Title="Constructing Volatility Smile from Implied Volatility &amp; Delta" Tags="&lt;options&gt;&lt;volatility&gt;&lt;implied&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14530" PostTypeId="2" ParentId="14529" CreationDate="2014-08-27T21:29:29.663" Score="1" Body="&lt;p&gt;First off, volatility smiles are often drawn over a delta space. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you're asking, I'll assume you're trying to draw a volatility smile over strike prices, log moneyness, or some similar metric. If you have &lt;em&gt;neither&lt;/em&gt; the spot price &lt;em&gt;nor&lt;/em&gt; any strike prices associated with your data, I don't believe it's possible to back out both of those values. Not absolutely certain, but I assume there must be infinite possibilities. If you just had the spot price, you could back out all the strikes with ease.&lt;/p&gt;&#xA;" OwnerUserId="5407" LastEditorUserId="5407" LastEditDate="2014-08-27T21:52:58.567" LastActivityDate="2014-08-27T21:52:58.567" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14531" PostTypeId="2" ParentId="3284" CreationDate="2014-08-27T22:04:10.970" Score="3" Body="&lt;p&gt;I've found that the EODData website is difficult to understand.  That can be overcome with reasonable support.  I wrote to EODData with a support request one week ago.  I have yet to get &lt;em&gt;any&lt;/em&gt; response.  This site, absent decent support, is worthless.  I would advise that you avoid it like the plague until the owners start to pay attention to support requests.  As far as I can tell -- with zero response over the course of one week -- the owners don't give a damn about providing any support.&lt;/p&gt;&#xA;" OwnerUserId="11914" LastActivityDate="2014-08-27T22:04:10.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14532" PostTypeId="1" AcceptedAnswerId="14625" CreationDate="2014-08-27T22:37:47.283" Score="1" ViewCount="71" Body="&lt;p&gt;I've just started reading up on Portfolio Optimization models and have come across the use of &lt;strong&gt;exposure bounds&lt;/strong&gt; to mitigate the sensitivity of the optimized model solution, owing to parameter estimation errors. I'm just confused as to what exposure bounds are?&lt;/p&gt;&#xA;" OwnerUserId="11917" LastEditorUserId="467" LastEditDate="2014-09-04T05:01:10.457" LastActivityDate="2014-09-04T05:01:10.457" Title="What do &quot;Exposure Bounds&quot; mean in Portfolio Optimization?" Tags="&lt;optimization&gt;&lt;portfolio&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14534" PostTypeId="1" CreationDate="2014-08-28T01:19:49.467" Score="6" ViewCount="336" Body="&lt;p&gt;The price of an American option is given by $$V_n = \max\left(G_n,\frac{pV_{n +1}H^d + qV_{n + 1}H^u}{1 + r}\right)$$ where p, q are the risk neutral probabilities.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have two questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;How can one intuitively see that this must be the formula to avoid arbitrage? If possible cite a trivial example showing arbitrage if one does not take the maximum of these two values. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How to intuitively see that the ideal time to exercise the option is $\min\{n: V_n = G_n\}$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thanks.  &lt;/p&gt;&#xA;" OwnerUserId="11919" LastEditorUserId="9336" LastEditDate="2014-12-06T18:48:55.913" LastActivityDate="2014-12-06T18:48:55.913" Title="Intuition behind American Option pricing" Tags="&lt;binomial-tree&gt;&lt;american-options&gt;&lt;binomial&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14535" PostTypeId="2" ParentId="12694" CreationDate="2014-08-28T01:53:00.347" Score="2" Body="&lt;p&gt;The bank in china has to have an account at an intermediary bank, and order a transfer from that account to the account of the US bank. Therefore the chinese bank needs to have the dollars.&lt;/p&gt;&#xA;" OwnerUserId="11920" LastActivityDate="2014-08-28T01:53:00.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14536" PostTypeId="1" AcceptedAnswerId="14622" CreationDate="2014-08-28T07:14:09.620" Score="8" ViewCount="3172" Body="&lt;p&gt;I was wondering what kind of front end is used for trading applications. Coming from a quant background, I was always only concerned with research and back end of the application but am at a total loss when it comes to front end/ gui.&#xA;Most of my coding has been done in c++ and I am using just a config file to pass parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now it turns out due to regulatory reasons, this might not suffice. I need to have a front end which can start/ stop the strategy, change parameters and fetch order and trade history.&#xA;So question boils down to this, How can I create a simple ui which can sit on another machine, communicate with the colocated machine and do all this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Initially I thought of using web/javascript but not much is out there regarding this. Qt is another option but I suspect it will require substantial rewrite of the code and learning.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the preferred front end for medium to high frequency trading applications which have the core strategy running in c++?&lt;/p&gt;&#xA;" OwnerUserId="9349" LastActivityDate="2018-10-10T19:23:48.807" Title="What kind of front end/ gui is used with trading applications?" Tags="&lt;high-frequency&gt;&lt;automated-trading&gt;&lt;application&gt;" AnswerCount="5" CommentCount="1" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="14537" PostTypeId="2" ParentId="14527" CreationDate="2014-08-28T07:47:45.907" Score="1" Body="&lt;p&gt;You want something like the &lt;a href=&quot;http://www.gaingtx.com&quot; rel=&quot;nofollow&quot;&gt;Gain GTX&lt;/a&gt; FIX API&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2014-08-28T07:47:45.907" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14538" PostTypeId="2" ParentId="14536" CreationDate="2014-08-28T08:21:50.927" Score="2" Body="&lt;p&gt;Have you considered socket programming? if you need 'real time' control&#xA;&lt;a href=&quot;http://www.codeproject.com/Articles/586000/Networking-and-Socket-programming-tutorial-in-C&quot; rel=&quot;nofollow&quot;&gt;http://www.codeproject.com/Articles/586000/Networking-and-Socket-programming-tutorial-in-C&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you only want to reset the parameter periodically(like end of the day), you can setup a service and communicate via http/rest/soap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&quot;fetch order and trade history&quot;&lt;/em&gt; should be done in a separate app from your live trading component in my opinion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;also i think you will get more responses if you post this to stackoverflow.com&lt;/p&gt;&#xA;" OwnerUserId="3260" LastEditorUserId="3260" LastEditDate="2014-08-28T08:32:46.870" LastActivityDate="2014-08-28T08:32:46.870" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14540" PostTypeId="1" CreationDate="2014-08-28T14:09:07.357" Score="2" ViewCount="107" Body="&lt;p&gt;Let's say I have some Interest Rates (IR) pricing model which relies on Monte Carlo pricing and I'd like to benchmark its quality and find out &lt;em&gt;optimal&lt;/em&gt; settings (time steps &amp;amp; iterations) per asset class, which yield minimum computational effort yet providing acceptable error. Which metrics should/may be used for these purposes and which error is tolerated by practitioners? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To give an example, let's say we are pricing an European swaption:&#xA;$$NPV(ts,p) = \text{Net present Value for}~ts~\text{time steps and}~p~\text{paths.}$$&#xA;$$NPV_{ref} = \text{Reference NPV given by a Vanilla model.}$$&#xA;$$NPV_{conv} = NPV(ts^*,p^*):\forall ts &amp;gt; ts^* \&amp;amp; p &amp;gt; p^* ~|NPV(ts^*,p^*) - NPV(ts,p)| &amp;lt; \epsilon$$&#xA;$$Err(ts,p) = |NPV(ts,p) - NPV_{conv}|$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An obvious metric is Error relative to nominal: $Err_{Nom}(ts,p)=\frac{Err(ts,p)}{Nominal}$. But the problem is that it's not adjusted to current spot rate and volatility. Obviously, an ATM swaption with forward 3% costs much more than ATM swaption with 30bps fwd ceteris paribus, which changes magnitude of errors. Same with volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another metric one might think of could be Error to value: $Err_{val}(ts,p) = \frac{Err(ts,p)}{NPV_{conv}}$. But this metric fails for more exotic payoffs and contracts with low NPV.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also thought about some fwd or vol weighted estimators. For example, $Err_{Vega}(ts,p)=\frac{Err}(ts,p){\nu}$ or $Err_{Delta}(ts,p)=\frac{Err(ts,p)}{\Delta}$. But for some payoffs, delta or vega could be small; moreover, I have no idea what is tolerable error in this case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would be grateful for any ideas and recommendations. &lt;/p&gt;&#xA;" OwnerUserId="11924" LastEditorUserId="11924" LastEditDate="2014-08-29T08:15:57.770" LastActivityDate="2014-08-29T08:15:57.770" Title="Practitioner's criterion for MC pricing convergence" Tags="&lt;monte-carlo&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14541" PostTypeId="1" CreationDate="2014-08-28T14:29:28.113" Score="0" ViewCount="128" Body="&lt;p&gt;There are some regularly-occuring events that coincide with a rise in the implied volatility of an asset. For example, in advance of an firm's annual earnings report, it is typically expensive to buy a put option on the stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are some other examples of regularly occuring phenomena that tend to raise the implied vol. of an asset?&lt;/p&gt;&#xA;" OwnerUserId="11925" LastEditorUserId="743" LastEditDate="2014-08-28T19:20:11.410" LastActivityDate="2014-10-27T21:49:58.723" Title="What makes investors risk averse?" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14542" PostTypeId="2" ParentId="14541" CreationDate="2014-08-28T14:55:32.910" Score="1" Body="&lt;p&gt;What makes investors risk averse? Possibility of Loss.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are some other examples of regularly occuring phenomena that tend to raise the implied vol. of an asset? Everything that involves possibility of adverse-selection.&lt;/p&gt;&#xA;" OwnerUserId="6175" LastActivityDate="2014-08-28T14:55:32.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14544" PostTypeId="1" CreationDate="2014-08-28T16:47:56.000" Score="0" ViewCount="1007" Body="&lt;p&gt;In an empirical analysis I'm trying to predict stock returns using different firm characteristics. I would like to use price momentum as an explanatory variable, but I'm not quite sure how to calculate the price momentum with weekly prices for each stock. My questions are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;is there a standard for calulating price momentum when using weekly prices?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;what is the typical time frame, for instance is it sensible to calculate price momentum over the last 4 and 8 weeks? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7078" LastActivityDate="2014-08-29T01:35:16.257" Title="Calculation of price momentum using weekly price observations" Tags="&lt;equities&gt;&lt;prediction&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14545" PostTypeId="2" ParentId="14541" CreationDate="2014-08-28T16:49:04.523" Score="0" Body="&lt;p&gt;&quot;What makes an investor risk averse?&quot; and &quot;What phenomena tend to raise implied vols?&quot; are two different questions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typically a particular investor's level of risk aversion will vary at a much slower rate, based on their particular life circumstances. For example, their net worth, target net worth, living expenses, comfort with volatility, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Theoretically, at this instant, you have a particular level of risk aversion. So, that level of risk aversion could cause you to bid up or down the price of an option based on your perspective of the risk inherit in a particular underlying asset at that time. Probably most of the time, you would believe some price is near an equilibrium, or within some tolerable level of that price, such that you would not engage in trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Realistically, it would require a collection of investors bidding up/down the price of options to see significant price movements which affect the implied volatility you're talking about. And basically what kind of events will cause a collection of investors to change their perspective of an underlying asset simultaneously? News is the most likely candidate to reach a large number of people at the same time. Could be any variety of news, earnings (as you mention), macroeconomic news, press releases about a firm, etc.&lt;/p&gt;&#xA;" OwnerUserId="5407" LastEditorUserId="5407" LastEditDate="2014-08-28T16:54:52.253" LastActivityDate="2014-08-28T16:54:52.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14546" PostTypeId="2" ParentId="14512" CreationDate="2014-08-28T16:51:33.120" Score="4" Body="&lt;p&gt;Most of these classifications of aggressive trades are not so relevant anymore, due to smart order routers which execute aggressive parent orders using passive child orders, as Maureen O'Hara points out in &lt;a href=&quot;http://www2.warwick.ac.uk/fac/soc/wbs/subjects/finance/fof2014/programme/maureen_ohara.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www2.warwick.ac.uk/fac/soc/wbs/subjects/finance/fof2014/programme/maureen_ohara.pdf&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure what I would do if I wanted this information, but I suspect one will have to model the order book in order to get a real sense of whether liquidity is actually entering or leaving the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Also, be very careful if you are trying to do this for equities using SIP data, since very often the quote feed and the trade feed are lagged with respect to each other, which will throw off any of the above classifications.&lt;/p&gt;&#xA;" OwnerUserId="3491" LastActivityDate="2014-08-28T16:51:33.120" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14547" PostTypeId="2" ParentId="14544" CreationDate="2014-08-28T18:24:24.423" Score="0" Body="&lt;p&gt;To my knowledge do you just use the closing prices for the period you want to calculate the momentum for.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M = CP - CPn&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;M = Momentum&#xA;CP = Closing price in 'current' period.&#xA;CPn = Closing price n periods (weeks in this case) earlier.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The optimal time frame really depends on, your, or your algos, preferred time frame.&lt;/p&gt;&#xA;" OwnerUserId="4769" LastEditorUserId="11791" LastEditDate="2014-08-28T19:02:04.240" LastActivityDate="2014-08-28T19:02:04.240" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14548" PostTypeId="5" CreationDate="2014-08-28T19:23:57.443" Score="0" Body="&lt;p&gt;Stub: See &lt;a href=&quot;http://en.wikipedia.org/wiki/Credit_valuation_adjustment&quot; rel=&quot;nofollow&quot;&gt;Wikipedia&lt;/a&gt; for more.&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="848" LastEditDate="2014-08-28T19:23:57.443" LastActivityDate="2014-08-28T19:23:57.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14549" PostTypeId="4" CreationDate="2014-08-28T19:23:57.443" Score="0" Body="The Credit Value Adjustment, or CVA for short, is the difference between the risk free value and the value including counterparty risk of a contract or portfolio." OwnerUserId="848" LastEditorUserId="848" LastEditDate="2014-08-28T19:32:32.823" LastActivityDate="2014-08-28T19:32:32.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14550" PostTypeId="2" ParentId="14536" CreationDate="2014-08-28T19:38:45.103" Score="3" Body="&lt;p&gt;If your goal is to just send basic commands, and avoid rewriting you models, I suggest you to create a PID server in combination with a web/JavaScript site as GUI.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The PID server monitors the PID’s of the strategies running on the server and executes the commands as they come. The server could consist of a webserver listening on port 8888 with a simple JSON interface, to make it super flexible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Get a nice ‘Admin Panel’ on &lt;a href=&quot;http://themeforest.net&quot; rel=&quot;nofollow&quot;&gt;http://themeforest.net&lt;/a&gt;, and you are all set!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good practices regarding security:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Only allow JSON posts to the PID server from the webservers IP.&lt;/li&gt;&#xA;&lt;li&gt;Use validation of the incoming commands, so the PID server cannot be used to take over the strategy server.&lt;/li&gt;&#xA;&lt;li&gt;Encrypt the commands being send back and forth.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Getting up to speed&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's a really simple implementation, basically just a webserver that feeds your models the desired commands through the CMD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.diagnostics.process(v=vs.110).aspx&quot; rel=&quot;nofollow&quot;&gt;C# Process class&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.codehosting.net/blog/BlogEngine/post/Simple-C-Web-Server.aspx&quot; rel=&quot;nofollow&quot;&gt;C# webserver example&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Be aware!&lt;/strong&gt; I found the two links just now, and I do not guarantee the quality of code in the webserver.&lt;/p&gt;&#xA;" OwnerUserId="4769" LastEditorUserId="4769" LastEditDate="2014-08-28T22:05:56.240" LastActivityDate="2014-08-28T22:05:56.240" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="14551" PostTypeId="2" ParentId="14534" CreationDate="2014-08-28T20:34:33.140" Score="5" Body="&lt;p&gt;The model here is the binomial option pricing model, so the second term in the brackets represents the expected future value of the option (under riskneutral probabilities).&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The aim of the option holder is always to maximize the value of his option. He can at any point sell the option at the fair market price $E(V_{n+1})$ or exercise it to get $G_n$. So if he would not choose the maximum of the two, the option seller would have an implicit gain by not having the American option optimally exercised and hence arbitrage.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The optimal time to exercise the option is when the future value is not higher than the current payoff (so there is no value in waiting further), so you exercise soon as this is the case. Note that $V_n=G_n$ is when $E(V_{n+1})\leq G_n$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-12-06T10:18:03.650" LastActivityDate="2014-12-06T10:18:03.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14552" PostTypeId="2" ParentId="10779" CreationDate="2014-08-28T20:44:45.247" Score="1" Body="&lt;p&gt;Giuseppe Bruno, Bank of Italy, did some interesting work in R showing that the use of Quasi Random Numbers in Monte Carlo simulations was superior to Pseudo-Random.  Here is an abstract of what he presented at useR! 2014: &lt;a href=&quot;http://user2014.stat.ucla.edu/abstracts/talks/31_Bruno.pdf&quot; rel=&quot;nofollow&quot;&gt;Pricing Credit Risk Derivative with R&lt;/a&gt;  &lt;/p&gt;&#xA;" OwnerUserId="6234" LastActivityDate="2014-08-28T20:44:45.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14553" PostTypeId="1" CreationDate="2014-08-28T23:21:47.693" Score="4" ViewCount="17718" Body="&lt;p&gt;Hull defines the conversion factor for a bond as the &quot;quoted price the bond would have per dollar of principal on the first day of the delivery month on the assumption that the interest rate for all maturities equals 6% per annum.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My understanding is that the hypothetical bond underlying the futures contract has a 6% coupon, and that the (quoted) price of this bond varies with the zero curve. If this zero curve is flat and equal to 6% for all maturities, then the quoted price of the hypothetical bond should be 100 and the product of this hypothetical price and the conversion factor for a particular bond is exactly the quoted price of the bond in question. However, if the zero curve is flat and not equal to 6%, or more generally is not flat at all, then why should this conversion factor be considered a good approximation of the quoted price of the actual bond?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose for the moment that the zero curve is flat. Let P(N,y,c) be the present value of a bond with semiannual coupon c and time to maturity N when the zero rate is y (for all maturities). The present value of the hypothetical bond is P(N,y,0.06). What naturally seems to be the correct conversion factor to get the quoted price of a bond with coupon c and time to maturity M is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CF = P(M,y,c)/P(N,y,0.06).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When y=0.06, this conversion factor is the same one defined by Hull, but otherwise they need not be the same. Is there some reason why it is assumed that the conversion factor is constant? y need not be close to 0.06, and M can be different from N, so it doesn't seem clear that the (constant) conversion factor gives anything useful.&lt;/p&gt;&#xA;" OwnerUserId="11928" LastActivityDate="2014-08-29T20:52:57.800" Title="Conversion factor for bonds" Tags="&lt;bond&gt;&lt;bond-yields&gt;&lt;bond-futures&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="14554" PostTypeId="1" CreationDate="2014-08-28T23:33:26.633" Score="2" ViewCount="223" Body="&lt;p&gt;I don't need something super complicated, I would just like a quick and dirty way of estimating the correlation coefficients between the revenues of different companies. Information on companies in the world as a whole would be desirable but is not necessary.&lt;/p&gt;&#xA;" OwnerUserId="11929" LastActivityDate="2014-12-10T21:27:30.327" Title="Where can I find a correlation matrix between the revenues of different industries?" Tags="&lt;data&gt;&lt;market-data&gt;&lt;historical-data&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14555" PostTypeId="2" ParentId="14544" CreationDate="2014-08-29T01:35:16.257" Score="1" Body="&lt;p&gt;I will try to answer both of your questions together. First, regarding &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;a standard for calculating price momentum&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I would say no, there is no universal standard. In addition to what is simply called the momentum indicator (which @chjortlund described in his answer), there are dozens of additional momentum indicators, and each puts an emphasis on something else (at the end of this answer I've pasted a list of momentum indicators that one platform offers). Of course, each different indicator also has one or more parameters, most importantly the number of periods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no magic number of periods, because it really depends on many factors, such as the sector and market (e.g. retail or technology), season, and broad market sentiment. Momentum indicators work great in trending markets, but generally do not perform well when the market is going nowhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, Katz and McCormick [2000] report that&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Even though the momentum model performed more poorly on the entire&#xA;  portfolio, it performed better on a larger number of individual&#xA;  markets than did the crossover model. The momentum model, if traded on&#xA;  markets with appropriate seasonal behavior, can produce good results.&#xA;  [The Encyclopedia of Trading Strategies. p 171]&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Finally, no indicator (in and of itself) is a complete trading strategy. So the indicator you choose and its parameters will also depend on how you intend to use them. What might work well for retail stocks in the holidays might not work as well for energy stocks in summer. What seems to hit home runs when there's a bull market might be very disappointing during a recession. So again, I am sorry I could not provide the magic number: it is all about adaptability. Good luck!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ADX - Average Directional Movement Index&#xA;ADXR - Average Directional Movement Index Rating&#xA;APO - Absolute Price Oscillator&#xA;AROON - Aroon&#xA;AROONOSC - Aroon Oscillator&#xA;BEARP - Bear Power&#xA;BOP - Balance Of Power&#xA;BULLP - Bull Power&#xA;CCI - Commodity Channel Index&#xA;CMO - Chande Momentum Oscillator&#xA;DMI - Average Directional Movement Index&#xA;DX - Directional Movement Index&#xA;FORCEI - Force Index&#xA;KAIRI - Kairi&#xA;KDJ -  Random Index&#xA;LAGACS1 - Laguerre-ACS1&#xA;MACD - Moving Average Convergence/Divergence&#xA;MACDEXT - MACD with controllable MA type&#xA;MACDFIX - Moving Average Convergence/Divergence Fix 12/26&#xA;MFI - Money Flow Index&#xA;MINUS_DI - Minus Directional Indicator&#xA;MINUS_DM - Minus Directional Movement&#xA;MOM - Momentum&#xA;MURRCH - Murrey Channels&#xA;OSMA - Moving Average of Oscillator&#xA;PERSBBANDS - Percent Bollinger Bands&#xA;PLUS_DI - Plus Directional Indicator&#xA;PLUS_DM - Plus Directional Movement&#xA;PPO - Percentage Price Oscillator&#xA;RMI - Relative Momentum Index&#xA;ROC - Rate of change : ((price/prevPrice)-1)*100&#xA;ROCP - Rate of change Percentage: (price-prevPrice)/prevPrice&#xA;ROCR - Rate of change ratio: (price/prevPrice)&#xA;ROCR100 - Rate of change ratio 100 scale: (price/prevPrice)*100&#xA;RSI - Relative Strength Index&#xA;RVI - Relative Vigor Index&#xA;SMI - Stochastic Momentum Index&#xA;STOCH - Stochastic&#xA;STOCHF - Stochastic Fast&#xA;STOCHRSI - Stochastic Relative Strength Index&#xA;TD_I - Tom DeMark Indicator&#xA;TRIX - 1-day Rate-Of-Change (ROC) of a Triple Smooth EMA&#xA;ULTOSC - Ultimate Oscillator&#xA;WILLR - Williams' %R&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11791" LastActivityDate="2014-08-29T01:35:16.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14556" PostTypeId="2" ParentId="14553" CreationDate="2014-08-29T04:43:05.990" Score="4" Body="&lt;p&gt;First, the exact computation of conversion factor is actually quite tricky. The &quot;6% yield&quot; rule is really an approximation (although a very good one). CME provides a spreadsheet that you can use to compute the exact conversion factor for each bond and each contract (&lt;a href=&quot;http://www.cmegroup.com/trading/interest-rates/us-treasury-futures-conversion-factor-calculator.html&quot; rel=&quot;nofollow&quot;&gt;http://www.cmegroup.com/trading/interest-rates/us-treasury-futures-conversion-factor-calculator.html&lt;/a&gt;). The main reason for the discrepancy comes from rounding of term to maturity. For example, if we are looking at the classic bond (US) contract and a deliverable has 15 years 2 months to maturity on the first day of the delivery month, then you need to round it down to 15 years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, it's not a good idea to think of the underlying as a hypothetical 6% coupon bond. What makes bond futures so complex and so interesting is that a full basket of deliverables act as the underlying. For example, for TYZ4 (10-year Treasury note expiring in December of this year), the deliverable basket includes 21 Treasury notes (5 of which haven't even been auctioned!) Right now, TYZ4 behaves very similarly to 2.25% 31-July-2021 (the cheapest-to-deliver into TYZ4). You can see that 1) it behaves nothing like a 10-year bond -- in fact, over past few years, the 10-year Treasury contract has mostly behaved like a 7-year bond; and 2) it behaves nothing like a bond with a 6% coupon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The definitive guide to bond futures is &lt;strong&gt;The Treasury Bond Basis: An in-Depth Analysis for Hedgers, Speculators, and Arbitrageurs&lt;/strong&gt;. I read it cover to cover a few times and learned new things every time I read it... In addition, there are a few Salomon Brothers research notes that I found tremendously helpful:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Koenigsberg, Mark. &quot;Understanding Treasury Bond Futures: Questions and Answers.&quot; &lt;em&gt;Salomon Brothers Bond Portfolio Analysis Group&lt;/em&gt; (1990).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Koenigsberg, Mark. &quot;The Salomon Brothers Delivery Option Model: Understanding Treasury Bond Futures.&quot; &lt;em&gt;Salomon Brothers Bond Portfolio Analysis Group&lt;/em&gt; (1991).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Koenigsberg, Mark. &quot;Deciding Between Futures and Cash: A Closer Look at the Basis.&quot; &lt;em&gt;Salomon Brothers Bond Portfolio Analysis Group&lt;/em&gt; (1991).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2014-08-29T20:52:57.800" LastActivityDate="2014-08-29T20:52:57.800" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14557" PostTypeId="1" CreationDate="2014-08-29T07:29:18.260" Score="4" ViewCount="170" Body="&lt;p&gt;Let $X_{t}$ and $Y_{t}$ be two brownian motions and let their joint distribution be given by $F$. So in regularly correlated BM's where $dX_{t}dY_{t}=\rho dt$, we have a bivariate normal distribution for $X$ and $Y$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this mean that $\int_{0}^{t}g(s)dX_{s}$ and $\int_{0}^{t}g(s)dY_{s}$ have the same bivariate distribution? So again in the case of regularly correlated BM's, this would imply a bivariate normal distribution but with different mean, and covariance matrices?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this work for all distributions? Lets say $X_{t}$ and $Y_{t}$ are distributed with copula $C$, does this mean that $\int_{0}^{t}g(s)dX_{s}$ and $\int_{0}^{t}g(s)dY_{s}$ are also distributed with copula $C$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And if so, why?&lt;/p&gt;&#xA;" OwnerUserId="7649" LastActivityDate="2014-10-28T17:51:48.610" Title="Ito integrals and copulas" Tags="&lt;distribution&gt;&lt;copula&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14558" PostTypeId="2" ParentId="9692" CreationDate="2014-08-29T08:01:10.750" Score="2" Body="&lt;p&gt;You can find VIX intraday history back to 2003 at Pi Trading, &lt;a href=&quot;http://pitrading.com&quot; rel=&quot;nofollow&quot;&gt;http://pitrading.com&lt;/a&gt;. Look under the market data package.&lt;/p&gt;&#xA;" OwnerUserId="11932" LastActivityDate="2014-08-29T08:01:10.750" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14559" PostTypeId="2" ParentId="7246" CreationDate="2014-08-29T08:13:35.827" Score="4" Body="&lt;p&gt;An oldie but goodie from 2000. Bob Fulks, Back-Adjusting Futures Contracts, &lt;a href=&quot;http://www.nuclearphynance.com/User%20Files/7228/cntcontr.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.nuclearphynance.com/User%20Files/7228/cntcontr.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The article is a great summary of the most popular adjustment methods. I agree with and would like to stress the author's observation: &quot;There is no &quot;best&quot; method in an absolute sense. All the methods have advantages and disadvantages.&quot; Also, IMHO, some of the original writings on continuous adjustment by Jack D. Schwager are worth investigating.&lt;/p&gt;&#xA;" OwnerUserId="11932" LastEditorUserId="848" LastEditDate="2014-09-02T09:00:35.243" LastActivityDate="2014-09-02T09:00:35.243" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14560" PostTypeId="1" CreationDate="2014-08-29T12:48:41.850" Score="0" ViewCount="1046" Body="&lt;p&gt;In an empirical analysis I'm trying to predict log() weekly stock returns. I'm trying to model stock returns in a panel data model framework. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As explanatory variables I have 1) a measure of investor attention for each stock , 2) size, and 3) price momentum during the previous 4 and 8 weeks respectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have access to the WRDS database, i.e. CRSP, Compustat, IBES etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions as to other variables i can include in my empirical analysis? I would like suggested variables to have the same frequency, i.e. weekly observations.&lt;/p&gt;&#xA;" OwnerUserId="7078" LastActivityDate="2014-09-07T19:44:40.420" Title="Explanatory variables for regression predicting weekly stock returns" Tags="&lt;equities&gt;&lt;prediction&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14561" PostTypeId="2" ParentId="8325" CreationDate="2014-08-29T13:43:49.790" Score="3" Body="&lt;p&gt;The only special function needed for computing Black-Scholes option prices is the cumulative normal function (&quot;N&quot; or &quot;Phi&quot;) or equivalently the error function (&quot;erf&quot;).  These are very widely available with good standard library implementations.  The erf function in single and double precision is part of the c99 and c++11 math standard libraries.  For your favorite language, search for &quot;error function&quot; possibly in a &quot;special functions&quot; library.  Generally there is no need to trade speed vs. accuracy; the library functions here give full precision with timing in the 10s or 100s of processor cycles.  In almost any application the math expense is completely negligible. &lt;/p&gt;&#xA;" OwnerUserId="11935" LastActivityDate="2014-08-29T13:43:49.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14562" PostTypeId="1" AcceptedAnswerId="14565" CreationDate="2014-08-29T14:16:50.330" Score="2" ViewCount="538" Body="&lt;p&gt;Very often in quantitative analysis (e.g. calculating portfolio volatility) we have to analyze various time series - mostly returns - whose lenghts differ.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Risk systems usually apply a one-factor model in order to create a generic history for such time series.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;choose a market index with returns $r_{index}$ &lt;/li&gt;&#xA;&lt;li&gt;estimate the beta $\beta$ of the time series to this index&lt;/li&gt;&#xA;&lt;li&gt;insert $\beta * r_{index,t}$ for all missing dates $t$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;My attention was drawn to the paper&#xA;&lt;a href=&quot;http://ideas.repec.org/p/fth/pennfi/05-96.html&quot; rel=&quot;nofollow&quot;&gt;Analyzing investments whose histories differ in length&lt;/a&gt; by Robert F. Stambaugh. It seems to use a more sophisticated approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Does anyone here have access to a description of the approach taken by Stambaugh which is not behind a pay-wall?&lt;/li&gt;&#xA;&lt;li&gt;What other approaches were published that address this issue?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-08-29T14:33:05.357" Title="Estimate correlation of time series whose histories differ in length" Tags="&lt;time-series&gt;&lt;portfolio-management&gt;&lt;correlation&gt;&lt;risk-management&gt;&lt;risk-models&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14563" PostTypeId="1" CreationDate="2014-08-29T14:16:55.723" Score="1" ViewCount="40" Body="&lt;p&gt;Does anyone have any recommendations for how to track earnings quality for a large number of stocks (500+) on a quarterly basis? I am familiar with the M-Score for detecting earnings manipulation but am wondering if anyone has any additional ideas that might lend themselves to a larger set of constituents. I would like to build out a model using capIQ data for this purpose. Thanks for your thoughts.&lt;/p&gt;&#xA;" OwnerUserId="11926" LastActivityDate="2014-08-29T14:16:55.723" Title="Earnings Quality for a large group of stocks" Tags="&lt;earnings&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14564" PostTypeId="2" ParentId="14557" CreationDate="2014-08-29T14:32:50.863" Score="2" Body="&lt;p&gt;0/ Let's me use more common notations to avoid misunderstanding. We will consider $B_t^x$ and $B_t^y$ - two correlated Brownian motions, e.g. $&amp;lt;dB_t^x,dB_t^y&amp;gt;=\rho dt$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just to recall, Ito's process:&#xA;$$X_t = X_0 + \int_0^t \mu(s,\omega) ds + \int_0^t \sigma(s,\omega) dB_s^x\\&#xA;dX_t=\mu(t,\omega) dt + \sigma(t,\omega) dB_t^x$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1/ Single BMs: $$\mathbb{E}(B_t) = 0\\ \mathbb{E}((B_t)^2) = t \\\mathbb{Cov}(B_t^x,B_t^y) = \rho t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2/ Integrals: $$I(t) = \int_0^t g(s) dB_s $$&#xA;$I(t)$ is Ito process with zero drift =&gt; $\mathbb{E}(I(t)) = 0$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From your notation it seems like $g(t)$ is deterministic, hence&lt;br&gt;&#xA;$$\mathbb{E}(I(t)^2) = \int_0^t g^2(s)ds \\&#xA;\mathbb{Cov}(I_x(t),I_y(t)) = \rho \int_0^t g^2(s)ds.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So we may say that in both cases you have multivariate normal distribution with the same correlation matrix but different scaling factor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3/ Does this work for all distributions? =&gt; No, just consider lognormal distribution. The trick is that the sum of normal distributions is a normal distribution, which is not the case for any distribution. &lt;/p&gt;&#xA;" OwnerUserId="11924" LastEditorUserId="11924" LastEditDate="2014-08-29T17:19:32.193" LastActivityDate="2014-08-29T17:19:32.193" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14565" PostTypeId="2" ParentId="14562" CreationDate="2014-08-29T14:33:05.357" Score="2" Body="&lt;p&gt;The technique is sometimes referred to as full information maximum likelihood. It is more general than the technique you describe, but it is similar. Basically you start with the data with the longest horizon and get the covariance matrix, then for the data with the next longest horizon you regress them against the data with the longest horizon, finally you combine them together for a new combined covariance matrix.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Meucci has some code that does it in this package. &lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/9061-risk-and-asset-allocation&quot; rel=&quot;nofollow&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/9061-risk-and-asset-allocation&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes the technique is expanded so that you use PCA at each step. This is important when the number of stocks increases larger than the number of observations. There's also no reason that this can't be combined with a factor model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally, techniques like Fama-Macbeth can be used with uneven data sets.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2014-08-29T14:33:05.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14566" PostTypeId="2" ParentId="14554" CreationDate="2014-08-29T15:02:21.083" Score="4" Body="&lt;p&gt;I found US data &lt;a href=&quot;http://www.bea.gov/industry/gdpbyind_data.htm&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. While this data doesn't include correlations, these can be calculated relatively easily from this data.&lt;/p&gt;&#xA;" OwnerUserId="11929" LastEditorUserId="11929" LastEditDate="2014-11-27T23:29:59.323" LastActivityDate="2014-11-27T23:29:59.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14567" PostTypeId="1" AcceptedAnswerId="14576" CreationDate="2014-08-29T15:06:13.353" Score="26" ViewCount="55254" Body="&lt;p&gt;What is the so-called Swap Curve, and how does it relate to the Zero Curve (or spot yield curve)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does it only refer to a curve of swap rates versus maturities found in the market? Or is it a swap equivalent of a spot-yield curve constructed from bootstrapping a bond yield curve?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The context of this question is set against a backdrop of a plethora of terminology (that seems to be used interchangeably). I am looking into how the so-called Zero Curve (or spot yield curve) is constructed in order to discount various IR derivatives (including swaps) when pricing them.&lt;/p&gt;&#xA;" OwnerUserId="6782" LastActivityDate="2014-08-30T19:56:32.590" Title="What is the Swap Curve?" Tags="&lt;yield-curve&gt;&lt;swaps&gt;&lt;interest-rate-swap&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="37" ContentLicense="CC BY-SA 3.0" />
  <row Id="14568" PostTypeId="2" ParentId="14567" CreationDate="2014-08-29T15:28:38.867" Score="2" Body="&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Yield_curve&quot; rel=&quot;nofollow&quot;&gt;wiki&lt;/a&gt; about yield curve:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;... the &lt;strong&gt;yield curve&lt;/strong&gt; is a curve showing several yields or interest rates across different contract lengths (2 month, 2 year, 20 year, etc...). The curve shows the relation between the interest rate (or cost of borrowing) and the time to maturity. For example, the U.S. dollar interest rates paid on U.S. Treasury securities for various maturities are closely watched by many traders, and are commonly plotted on a graph such as the one on the right which is informally called &quot;the yield curve&quot;. More formal mathematical descriptions of this relation are often called the term structure of interest rates.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Basically, you have a graph tracing a rate $r(t)$ against time $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Interest_rate_swap&quot; rel=&quot;nofollow&quot;&gt;wiki&lt;/a&gt; about swap:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;An &lt;strong&gt;interest rate swap (IRS)&lt;/strong&gt; is a financial derivative instrument in which two parties agree to exchange interest rate cash flows, based on a specified notional amount from a fixed rate to a floating rate (or vice versa) or from one floating rate to another.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For example, party A pays fixed rate $r_A$ on specified notional, while counterparty B pays a floating rate (let's say LIBOR) $L_{3m}$ on the same notional. Duration of such contract is sometimes called &lt;strong&gt;Tenor&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;At the point of initiation of the swap, the fixed swap rate is chosen so that it has a net present value of zero. Such swap rate is called &lt;strong&gt;par swap rate&lt;/strong&gt; and denoted $S(t,T)$, where $t$ is a starting date of the swap and $T$ is the end date. $(T-t)$ is tenor.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Finally, the swap rate curve is a yield curve where reference rate is par swap rate, e.g. $r(t)=S(t,T)$. For example, if you are looking at 2Year tenor swap curve it would be a graph tracing $S(t,t+2Y)$ against $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope it's more clear now.&lt;/p&gt;&#xA;" OwnerUserId="11924" LastEditorUserId="11924" LastEditDate="2014-08-29T17:12:52.083" LastActivityDate="2014-08-29T17:12:52.083" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14569" PostTypeId="1" CreationDate="2014-08-29T15:41:19.137" Score="5" ViewCount="18337" Body="&lt;p&gt;I'm looking for a library to do some time series analysis in Java but I can't find anything suitable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've found plenty of libraries such as Math3 of JSAT but there's much I can you for my problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, I'd like to compute standard deviation over time, moving average etc for a specific time series. &lt;/p&gt;&#xA;" OwnerUserId="2466" LastEditorUserId="467" LastEditDate="2014-12-09T08:26:17.760" LastActivityDate="2017-08-16T16:28:58.683" Title="Which library shall I use for time series analysis in Java?" Tags="&lt;time-series&gt;&lt;programming&gt;&lt;library&gt;" AnswerCount="6" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14570" PostTypeId="2" ParentId="12901" CreationDate="2014-08-29T15:55:06.153" Score="5" Body="&lt;p&gt;(1) No, the stochastic differential equation for Heston model does not have an explicit solution.  What does exist is an explicit formula for the Fourier transform of a call option price.  See e.g. &lt;a href=&quot;http://www.zeliade.com/whitepapers/zwp-0004.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.zeliade.com/whitepapers/zwp-0004.pdf&lt;/a&gt; for a decent survey.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) Yes, implied vol always exists.  You can check that the Black-Scholes price of an option is monotonically increasing in sigma, with lower limit at intrinsic value [0 for out-of-money option] and upper limit at the super-replication value [price of the underlying, for a call option].  So by the inverse function theorem for every non-arbitrageable price there is an implied volatility.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When implied vol calculation fails, one of two things may be going wrong.  (i) The input option price may be outside of the no-arbitrage range, for example due to numerical error in the price calculation.  This is almost certainly the problem you are experiencing when using monte carlo. (ii) Your numerical root-finding algorithm may fail.  It is easy to check if (i) occurs, just by checking if the input value is in the range.  For (ii), just find an adequate solver.  For testing things, you can write your own bisection method if you like; that should be 100% robust.  For strikes far from spot, use the out-of-the-money option [calls for high strikes, puts for low strikes] to avoid loss of numerical accuracy in the floating point calculations.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2014-08-29T15:55:06.153" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14571" PostTypeId="2" ParentId="12694" CreationDate="2014-08-29T16:31:50.500" Score="1" Body="&lt;p&gt;For large currency transactions, the big banks go through an intermediary called CLS.  Both sides to a transaction transfer funds (in form of central bank deposits) to the CLS group.  Then simultaneously these are transferred to the respective parties.  Or if one side fails to deliver CLS returns the funds of the other party.  See &lt;a href=&quot;http://en.wikipedia.org/w/index.php?title=CLS_Group&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/w/index.php?title=CLS_Group&lt;/a&gt; .&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2014-08-29T16:31:50.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14572" PostTypeId="1" AcceptedAnswerId="14636" CreationDate="2014-08-29T17:59:09.007" Score="1" ViewCount="351" Body="&lt;p&gt;Is there a concise way of learning the core Monte Carlo Methods from resources available online?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This leads to my next question which is what are the core ideas to learn in Monte Carlo methods?&lt;/p&gt;&#xA;" OwnerUserId="11723" LastEditorUserId="467" LastEditDate="2014-09-05T03:54:42.387" LastActivityDate="2014-09-05T03:55:49.167" Title="What would be a concise method to learn Monte Carlo methods?" Tags="&lt;monte-carlo&gt;&lt;reference-request&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14573" PostTypeId="2" ParentId="14569" CreationDate="2014-08-29T20:26:58.263" Score="0" Body="&lt;p&gt;You might find &lt;a href=&quot;http://ta-lib.org/index.html&quot; rel=&quot;nofollow&quot;&gt;TA-Lib&lt;/a&gt; useful:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;TA-Lib is widely used by trading software developers requiring to perform technical analysis of financial market data.&#xA;&#xA;    Includes 200 indicators such as ADX, MACD, RSI, Stochastic, Bollinger Bands etc... (more info)&#xA;    Candlestick pattern recognition&#xA;    Open-source API for C/C++, Java, Perl, Python and 100% Managed .NET&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It is pretty useful and versatile: you can grow with it beyond just standard deviation and moving averages, and also to other programming languages, as mentioned above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good luck!&lt;/p&gt;&#xA;" OwnerUserId="11791" LastActivityDate="2014-08-29T20:26:58.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14574" PostTypeId="2" ParentId="3587" CreationDate="2014-08-29T20:53:51.433" Score="1" Body="&lt;p&gt;Yes, one can derive an analytic call pricing formula for this model.  It is a close analogue of the Merton jump-diffusion, and the same techniques apply.  The final distribution is the superposition of lognormal distributions, with a common variance but differing means depending on the final level of the resetting Poisson process. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets find the probability p that H(t) = 0.  I will assume H(0)=0; the other case is similar.  Note that p'(t) = -lambda p(t) + eta (1-p(t)), reflecting the lambda arrival rate of jumps out of the state H=0 and the eta arrival rate of jumps back to that state.  This is a first order seperable ODE with solution p(t) = eta/(eta+lambda) + lambda exp(-(eta+lambda)t)/(eta + lambda).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The probability q that H(t)=1 satisfies q'(t) = lambda p(t) - (lambda + eta) q(t).  Again this is first order seperable; integrating we get q(t)=lambda eta/(eta+lambda)^2 + exp(-(eta+lambda)t)(lambda^2(eta+1)t + lambda eta)/(eta+lambda)^2.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is getting messy but not intractible.  The form is constant + exponential * polynomial.  Generalizing, for each n the probability p_n(t) that H(t)=n satisfies p_n'(t) = lambda p_n(t) - (lambda + eta) p_{n-1}(t) and will have a solution of the form p_n(t) = lambda^n eta/(eta + lambda)^(n+1) + exp(-(eta+lambda)t)*f_n(t) where f_n(t) is a polynomial of degree n.  I don't see how to write coefficients of f_n explicitly, but we can calculate them recursively from coefficients of f_{n-1}; if anyone really wants to see the details ask. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally let BS(S,K,T,r,mu,sigma) be the Black-Scholes call pricing formula.  The price of a call under the resetting poisson jump-diffusion is sum_{n=0}^infinity p_n(T) BS(S,K,T,r,mu-rho lambda/eta + n rho/T,sigma).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practise the sum should converge quickly, so we can truncate after a few terms.  &lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2014-08-29T20:53:51.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14575" PostTypeId="1" AcceptedAnswerId="14595" CreationDate="2014-08-29T22:06:27.157" Score="2" ViewCount="1033" Body="&lt;p&gt;I don't have much experience with volatility modeling using intraday data but I'm in the process of collecting 5mins data. Currently I have ~6 months of data. Is it enough to use these models with such short history? &#xA;Which one should perform better out of sample having this small amount of data?&lt;/p&gt;&#xA;" OwnerUserId="7451" LastActivityDate="2014-11-30T13:26:29.790" Title="HAR-RV, realized GARCH and HEAVY model for realized volatility" Tags="&lt;volatility&gt;&lt;trading&gt;&lt;garch&gt;&lt;forecasting&gt;&lt;econometrics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14576" PostTypeId="2" ParentId="14567" CreationDate="2014-08-30T01:02:07.363" Score="39" Body="&lt;p&gt;Garabedian,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typically, the &quot;swap curve&quot; refers to an x-y chart of par swap rates plotted against their time to maturity. This is typically called the &quot;par swap curve.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your second question, &quot;how it relates to the zero curve,&quot; is very complex in the post-crisis world.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think it's helpful to start the discussion with a government bond yield curve to clarify some concepts and terminologies. Consider the US Treasury market, using the outstanding Treasury notes and bonds (nearly 300 of them...), we can either use bootstrapping or more sophisticated spline models to construct a &quot;fitted curve.&quot;  Since this yield curve represents bonds of identical credit risks (basically risk-free), the zero coupon curve, the discount curve, the forward curve, and the par yield curve are just different representations of the same thing and can be translated very easily from each other. For simplicity, I'll assume annual compounding:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If you know the zero coupon rate $r_t$ for time $t$, then the discount factor is $1 / (1 + r_t)^t$.&lt;/li&gt;&#xA;&lt;li&gt;If you know the 1-year zero coupon rate $r_1$ and 2-year zero coupon rate $r_2$, then you can compute the 1-year forward 1-year rate from $(1 + r_1)(1+f_{1,1})=(1+r_2)^2$.&lt;/li&gt;&#xA;&lt;li&gt;You can also compute the 2-year par rate, just solve for $c$ from &#xA;$$ \frac{c}{(1 + r_1)} + \frac{100 + c}{(1+r_2)^2} = 100. $$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Now let's return to the swap market. To be concrete, let's consider a 2-year USD par swap. This instrument has four fixed leg payment, and eight floating payment. The par swap rate is the fixed-leg interest rate that sets the present value of all the cash flows to 0. In other words, we'd solve for the $c$ in:&#xA;$$ \sum_{i=1}^4 c \Delta_i d(T_i) = \sum_{j=1}^8 l_j \delta_j d(t_j), $$&#xA;where $d(t)$ is the discount factor for time $t$, $\Delta_i$ and $\delta_i$ are year fractions, and $l_j$'s are the 3M Libor forward rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before the financial crisis, it is assumed that the discount curve and the forward curve are both based on Libor. This simplifies things a lot – just build a Libor forward curve so that it reproduces libors, futures rates, and par swap rates, and you're done. In this framework, all the translations (from zero curve to par curve to forward curve, etc.) above are still valid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, the idea that Libor was the appropriate funding rate was completely invalidated during the crisis. In recent years, a common practice is to use the &quot;OIS discounting&quot;-based &quot;multi-curve&quot; approach. In the equation above, the $l_i$'s are still based on the 3M Libor forward curve, but the $d(t)$'s should be discount factors fitted to overnight indexed swaps. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simply put, when you are building a swap curve, you now need to simultaneously calibrate both the OIS discount curve &lt;strong&gt;AND&lt;/strong&gt; and Libor discount curve... Under this new paradigm, the simple translation that we used for government bonds above no longer works, since multiple curves are involved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it gets worse... since 1M Libor and 3M Libor have different credit risks, you can't even do something like $(1 + \text{Libor}_{\rm 1M}/12)(1 + \text{Libor}_\text{1 month forward 2 month} / 2) = 1 + \text{Libor}_{\rm 3M} / 4$! Instead, you need to build separate 1M and 3M Libor forward curves to account for the tenor basis...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see, building a swap curve nowadays is a pretty involved task. What we now refer to as &quot;a&quot; swap curve is actually a collection of curves (OIS curve, 1m libor, 3m libor, 6m libor, etc.) bundled together...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are numerous literature you can find on this topic just by googling &quot;multi-curve&quot;. For example, &lt;a href=&quot;http://developers.opengamma.com/quantitative-research/Multiple-Curve-Construction-OpenGamma.pdf&quot;&gt;http://developers.opengamma.com/quantitative-research/Multiple-Curve-Construction-OpenGamma.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2014-08-30T19:56:32.590" LastActivityDate="2014-08-30T19:56:32.590" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14577" PostTypeId="1" CreationDate="2014-08-30T09:46:34.113" Score="2" ViewCount="109" Body="&lt;p&gt;I'm missing meaning of $w$ in typical SDE like $dX_t(w) = f_t(X_t(w)) + \sigma(X_t(w))dW_t$, in context of  $w \in F_{xxx}$. Does it mean that both&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$w$ is one of events that could happen before moment $xxx$ &lt;/li&gt;&#xA;&lt;li&gt;If we fix $w$ then this SDE becomes deterministic&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;?&lt;/p&gt;&#xA;" OwnerUserId="7486" LastEditorUserId="7486" LastEditDate="2014-08-30T09:52:16.500" LastActivityDate="2014-09-01T08:41:00.810" Title="Meaning of w in SDE" Tags="&lt;stochastic-processes&gt;&lt;brownian-motion&gt;&lt;sde&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14578" PostTypeId="1" CreationDate="2014-08-30T17:52:53.197" Score="2" ViewCount="324" Body="&lt;p&gt;There are many way to quantify the quality of an $\alpha$ (prediction of the future return of a security).&#xA;I heard/do many things, most of them are equivalent to correlation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typically $corr(\alpha,fr)$ (where $fr$ is the vector of returns that got realized) is a simple way to express adequation. Of course if you predict the next tick or the next close the numbers are totally different, similarly calculating a cross sectional correlation on 1000 instruments or 10 might change everything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, for a one-day horizon (say you predict the close of day D+1 just before the close of day D), on a universe of &gt;200 instruments... what correlation qualifies as &quot;good alpha&quot; ?&lt;/p&gt;&#xA;" OwnerUserId="5339" LastActivityDate="2014-08-30T20:43:32.383" Title="How much correlation between alpha and forward returns can be considered good" Tags="&lt;algorithmic-trading&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14580" PostTypeId="2" ParentId="14578" CreationDate="2014-08-30T20:12:50.230" Score="3" Body="&lt;h1&gt;Introduction&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;The answer below measures performance against a benchmark. Alternatively, one can ignore benchmarks and use the Sharp Ratio. I'm not aware of any generally accepted and published ranking for a 'good' SR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Level II CFA curriculum contains a number of chapters from the book &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0070248826&quot; rel=&quot;nofollow&quot;&gt;Active Portfolio Management: A Quantitative Approach for Providing Superior Returns and Controlling Risk by Richard C. Grinold and Ronald N. Kahn&lt;/a&gt; that suggest an approach to the problem of measuring portfolio manager performance. It is a formalized version of what you propose in your question. The focus of the book is portfolio management and performance is compared against a benchmark. I've summarized the discussion in the book below. &lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Definining $\alpha$&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;The first step is to calculate the residual or risk adjusted return, in the CAPM for a portfolio $p$ you would have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R_p(t) = \alpha_p + \beta_p \cdot r_\beta(t) + \varepsilon(t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $\varepsilon(t)$ a zero mean random variable. Of course, you can also use  a multi-factor model but lets keep it simple. The residual returns are defined as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\theta_p(t) = \alpha_p(t)  + \varepsilon(t).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly, $\mathrm{E}[\theta_p(t)] = \mathrm{E}[R_p(t) - R_B(t)] = \alpha_p(t)$ where $R_B(t)$ is the expected benchmark return. They convincingly argue that $\alpha_p(t)$ is insufficient to judge performance and risk also should be taken into account. &lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Defining risk&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;As said, performance is compared against a benchmark and so the risk is also measured against the benchmark. Risk is denoted by $\omega_p$ and is simply the standard deviation of the residual return &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\omega_p = \sqrt{\mathrm{Var}[R_p - R_B]}$$.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;The information ratio&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://en.wikipedia.org/wiki/Information_ratio&quot; rel=&quot;nofollow&quot;&gt;information ratio&lt;/a&gt; of a portfolio is &#xA;$$\mathrm{IR}_p = \frac{\alpha_p}{\omega_p}$$&#xA;and the information ratio of a portfolio manager is&#xA;$$\mathrm{IR} = \max\{IR_p|p\}.$$&#xA;The information ratio has one very convenient property:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The information ratio is &lt;em&gt;independent&lt;/em&gt; of the manager's level of aggressiveness (emphasis adjusted by me).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;h1&gt;What's good?&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;According to Grinold and Kahn an 'Exceptional' manager has IR = 1.00, a 'Very good' one has 0.75 and a 'Good' manager has IR = 0.50 (CFA Institute Level II 2014 Volume 6 Derivatives and Portfolio Management, Reading 58, Table 3).&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;The Fundamental Law&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;An alternative way of defining and obtaining(!) the IR is the following:&#xA;$$\mathrm{IR} = \mathrm{IC} \cdot \sqrt{\mathrm{BR}}$$&#xA;where $\mathrm{IC}$ is the Information Coefficient and $\mathrm{BR}$ is breadth. This tells you how to obtain a good information ratio. In very few words: $\mathrm{IC}$ is the correlation of your bets with the ex post realization and $\mathrm{BR}$ the number of independent bets you can make. For example, the breadth of a stock picker depends on the number of stocks he follows and the number of revisions he makes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, Grinold and Kahn also elaborate on the implementation of your strategy but that's a whole different chapter.&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="848" LastEditDate="2014-08-30T20:43:32.383" LastActivityDate="2014-08-30T20:43:32.383" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14581" PostTypeId="1" AcceptedAnswerId="14588" CreationDate="2014-08-31T01:06:26.553" Score="1" ViewCount="120" Body="&lt;p&gt;Wikipedia says &lt;code&gt;Burn rate is a synonymous term for negative cash flow&lt;/code&gt; but I neither agree nor believe that is formalized. A company could need turnaround from losses to gains and if the term is mentioned, can it be calculated? Can a time variable be 2 years, 5 years, more or less to calculate &quot;burnrate&quot;? Another definition was &lt;code&gt;Burn rate is usually quoted in terms of cash spent per month.&lt;/code&gt;. I'm not sure if it's defined unless we know time limits for a project or company. &lt;/p&gt;&#xA;" OwnerUserId="11944" LastEditorUserId="11944" LastEditDate="2014-08-31T01:12:11.460" LastActivityDate="2014-09-06T19:42:46.080" Title="How to calculate burnrate?" Tags="&lt;economics&gt;&lt;calculation&gt;&lt;time&gt;&lt;time-scale&gt;&lt;income&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14582" PostTypeId="2" ParentId="14577" CreationDate="2014-08-31T02:00:38.397" Score="3" Body="&lt;p&gt;In general SDE's are defined on a probability space which consists of a triplet $(\Omega, P, B)$: the space $\Omega$, a probability measure $P$, and a sigma algebra $B$. In short, the sigma algebra consist on the set of all events that we can assign probability to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For SDE's driven by Brownian Motion this probability space is the so called Wiener space, which consist of $\Omega = C([0,T])$, the space of continuous functions equipped with the uniform topology. The sigma algebra is the one generated by  the open sets under this topology, and $P$ is the so called Weiner measure, which essentially says that the projection $$\pi( \omega ) = \omega(t), \quad \omega \in \Omega,$$ is a Brownian Motion. So for example, under this measure,&#xA;$$&#xA;P \{  \omega \in \Omega: \omega \text{ is differentiable }  \} = 0.&#xA;$$  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the $\omega$ sometimes you see written in the math books.&lt;/p&gt;&#xA;" OwnerUserId="11945" LastEditorUserId="2587" LastEditDate="2014-09-01T08:41:00.810" LastActivityDate="2014-09-01T08:41:00.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14583" PostTypeId="2" ParentId="3587" CreationDate="2014-08-31T02:10:30.547" Score="2" Body="&lt;p&gt;I didn't work out the explicit details, but you can reproduce Black&amp;amp;Scholes methodology using the Ito's formula for Jump Diffusions. See for example, the sectio about Poisson jump processes in &lt;a href=&quot;http://en.wikipedia.org/wiki&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki&lt;/a&gt;/Itō's_lemma&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general every Markov process admits some kind of Ito's formula, known as Dynkin formula, which says that for a markov process $X$ with generator $\mathcal{L}$, and  every sufficiently smooth $f$,$$ M^f_t = f( X_t ) - f( X_0 ) - \int_0^t \mathcal{L}f(S_s)ds$$ is a martingale.   &lt;/p&gt;&#xA;" OwnerUserId="11945" LastActivityDate="2014-08-31T02:10:30.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14584" PostTypeId="2" ParentId="14511" CreationDate="2014-08-31T02:24:06.477" Score="1" Body="&lt;p&gt;When $W_1$ and $W_2$ are independent, $Y$ is equal in law to a Brownian Motion:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;It is obviously a local martingale under its natural filtration, and &lt;/li&gt;&#xA;&lt;li&gt;From Ito isometry,&#xA;$$\mathbf{E}Y_t^2 = \mathbf{E} \int_0^t A(...)^2 + B(...)^2 ds = t.$$&#xA;Then, from Levy's theorem (&lt;a href=&quot;http://almostsure.wordpress.com/2010/04/13/levys-characterization-of-brownian-motion/&quot; rel=&quot;nofollow&quot;&gt;http://almostsure.wordpress.com/2010/04/13/levys-characterization-of-brownian-motion/&lt;/a&gt;), these two conditions imply that $Y$ is a Brownian Motion.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="11945" LastActivityDate="2014-08-31T02:24:06.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14585" PostTypeId="2" ParentId="14470" CreationDate="2014-08-31T02:29:15.867" Score="1" Body="&lt;p&gt;I think the rationale behind it is that if $r$ is the short rate, the the price of the bond is $P(t,T) = \mathbf{E}e^{- \int_t^T r_s ds }.$ As is well known by know is easy to calculate expectations of random variables of the form $e^Z$, where $Z$ is Gaussian. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This model is the simplest example of a case in which the integral of the short rate as Gaussian distribution. Of course it has the gross disadvantage of allowing negative rates at any given time with positive probability, and eventually negative rates with probability 1.&lt;/p&gt;&#xA;" OwnerUserId="11945" LastActivityDate="2014-08-31T02:29:15.867" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14586" PostTypeId="1" CreationDate="2014-08-31T12:16:13.457" Score="1" ViewCount="762" Body="&lt;p&gt;Which brokers offer Python integration/API?&#xA;Which brokers offer R integration?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm  starting on trading, and I want to learn about algorithm trading. So I would like to know what brokers offers these languages apis.&lt;/p&gt;&#xA;" OwnerUserId="11947" LastActivityDate="2017-07-26T16:48:42.093" Title="Choosing broker to run with Zipline" Tags="&lt;programming&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14587" PostTypeId="2" ParentId="14569" CreationDate="2014-08-31T12:51:15.307" Score="7" Body="&lt;p&gt;I work with time series intensively, and I am experienced in Java and scripting languages such as MATLAB and R. &lt;strong&gt;I strongly suggest that you should cook up your own implementations in Java, and stop hunting for and relying on any off-the-shelf implementations.&lt;/strong&gt; They are not reliable. One should be able to write std, corr, cov, ma, etc., easily by hand. Coding them independently can really enhance your comprehension of the underlying problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;In short, Java is not a good tool for analysis. You may want to perform prototyping and research in MATLAB, R and Python, and implement the required features in Java after the preliminary research.&lt;/strong&gt; &lt;/p&gt;&#xA;" OwnerUserId="9381" LastActivityDate="2014-08-31T12:51:15.307" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14588" PostTypeId="2" ParentId="14581" CreationDate="2014-08-31T14:10:58.663" Score="2" Body="&lt;p&gt;In the dot.com era the Internet was considered a-winner-takes-it-all market, new tech start-ups (like Netscape, Amazon.com and the famous Pets.com) was measured by how much the capital they where able to chew through, the logic being that the more they spend the more aggressive they were (at least in the investors' eyes), conquering this new market known as the Internet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this day of age most professionals consider the term “burn rate” sick, and get reminded of the extensive headaches left from when the dot.com bubbles burst. While the music was playing and the party in full swing, everybody thought it was such a good idea, the day after people wished they hadn't been involved :-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;“Burn rate” is more like finance slang, and hence is not formalized.&#xA;I think what you are looking for is more something like a traditional cash flow analysis; in a turnaround situation, you might be mostly interested in the positive/negative momentum, to be able to work out a prediction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to dig deeper into the “cash flow analysis” subject, I think your questions will suit better for &lt;a href=&quot;http://money.stackexchange.com&quot;&gt;money.stackexchange.com&lt;/a&gt;, as this is very marginally related to quantitative finance, if at all.&lt;/p&gt;&#xA;" OwnerUserId="4769" LastEditorUserId="1217" LastEditDate="2014-09-06T19:42:46.080" LastActivityDate="2014-09-06T19:42:46.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14589" PostTypeId="1" CreationDate="2014-08-31T18:46:57.057" Score="2" ViewCount="89" Body="&lt;p&gt;I am trying to come up with a measure of relative importance of a number of valuation factors. I am wondering whether correlation coefficients can't be used for determining this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;More on the issue:&lt;/strong&gt;&#xA;My goal is to determine whether sectors are over or undervalued when comparing current valuation metrics with historical. For example, let's assume I have P/B and P/E metrics for the consumer discretionary sector and on a P/B basis, the sector is undervalued but on a P/E basis it is overvalued. I am trying to build a way to sort this out to come up with a over/undervalued determination when you have valuation metrics that are contradictory. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My thought is to use metrics in time t-1 and returns in time t. Using this data I am thinking I can find correlations and use the correlation coefficients as the relative weights when trying to build a mechanism to determine whether a sector is over or undervalued. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this a reasonable approach? Any recommendations you have would be helpful. Thanks!&lt;/p&gt;&#xA;" OwnerUserId="11926" LastActivityDate="2014-09-17T16:05:44.467" Title="Is this a reasonable approach to determine the relative importance of valuation factors?" Tags="&lt;statistics&gt;&lt;correlation&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14590" PostTypeId="1" AcceptedAnswerId="14591" CreationDate="2014-08-31T21:04:56.687" Score="8" ViewCount="333" Body="&lt;p&gt;I think: when Fed stops QE (Quantitative Easing), Treasury Futures prices will go down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question 1: Am I right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So... buying LEAP Puts (in Treasury Futures) would be a good idea.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question 2: Am I right?&lt;/p&gt;&#xA;" OwnerUserId="8101" LastEditorUserId="8101" LastEditDate="2014-09-01T14:25:48.213" LastActivityDate="2014-09-01T14:25:48.213" Title="When Fed stops QE, Treasury Futures will go down in price, so... LEAP Puts are a good idea?" Tags="&lt;interest-rates&gt;&lt;futures&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14591" PostTypeId="2" ParentId="14590" CreationDate="2014-08-31T21:47:26.657" Score="13" Body="&lt;p&gt;Not saying this trade won't work, but there's certainly no guarantee that it will...&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Given that QE will stop in October is well teleported at this point and has been expected since last year, you'd think this should be fully priced in.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Last year, when the &quot;tapering&quot; talk started, Treasuries did sell off quite a bit, but has since rallied all the way back. Clearly, QE is not a major factor driving interest rate markets nowadays. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;There's always the chance that stopping QE and other accommodative monetary policies would have negative impact on the economic growth, causing bonds to rally further.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Despite what some people might believe, it's not clear the Fed has that much power controlling longer maturity yields. In 2004-2005, when the Fed was hiking, 10y notes were busy rallying.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Shorting Treasuries is a terribly negative carry trade. As of Friday, 10-year yield was about 2.35%, while 1y forward 10y par yield was about 2.73%. So for the next year, 10y yields have to sell off by at least 38bp for you to make money (i.e., you can still lose money even if interest rates are higher!) It's even worse for 2s, a fully 100bp of rate increase has already been priced in.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Since you're using options, you'd also be bleeding time carry, etc.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2014-08-31T21:47:26.657" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14592" PostTypeId="1" AcceptedAnswerId="14784" CreationDate="2014-09-01T07:34:59.047" Score="3" ViewCount="830" Body="&lt;p&gt;I have a question about EMD updating new data points. For an entire time series, from beginning to the end, the EMD preforms quite good using the cubic spline function. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem happens when new data points feed in, then after recalculating EMD (including new data) the numbers of output IMFs been change (the IMF data series before and after updating all changed slightly). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suspect that the cubic spline functions do not have memory. What is the best way of avoid this problem, and calculating EMD and keep old results do not change. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best!&lt;/p&gt;&#xA;" OwnerUserId="7978" LastActivityDate="2017-05-16T03:06:03.993" Title="What is the best way of updating data while using Empirical Mode Decomposition to analyze" Tags="&lt;time-series&gt;&lt;digital-signal-processing&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14593" PostTypeId="2" ParentId="14536" CreationDate="2014-09-01T10:57:02.060" Score="3" Body="&lt;p&gt;I am currently developing a position keeping system and I am very satisfied with my choice of language/libraries:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Pure GUI in C#. C# is very pretty language, and Visual Studio Express is a very good free IDE, where you can spawn all the buttons, lists and inputs you need. .NET is otherwise very versatile library for other stuff (built-in data structures, web requests, unzip, app.config, etc.). You can link C++ libraries to C#.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) For fast grid-like data display I use &lt;a href=&quot;http://www.codeproject.com/Articles/20672/Real-Time-Data-Grid&quot; rel=&quot;nofollow&quot;&gt;http://www.codeproject.com/Articles/20672/Real-Time-Data-Grid&lt;/a&gt; . It works well and haven't notice any performance problems for hundreds of simultaneously displaying cells.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) As an alternative end-user interface, I use RTD feed to excel (see &lt;a href=&quot;http://weblogs.asp.net/kennykerr/Rtd3&quot; rel=&quot;nofollow&quot;&gt;http://weblogs.asp.net/kennykerr/Rtd3&lt;/a&gt;). This allows users to link the program realtime data to excel and do their own custom calculations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) For network communication (either client-server or within one machine between different processes), I use ZeroMQ (&lt;a href=&quot;http://zeromq.org&quot; rel=&quot;nofollow&quot;&gt;http://zeromq.org&lt;/a&gt;). It protects you from the nasty low-level socket stuff and is implemented on many platforms/languages, so you can tie many different programs together under common interface. Some tutorial for C# can be found here: &lt;a href=&quot;http://www.codeproject.com/Articles/488207/ZeroMQ-via-Csharp-Introduction&quot; rel=&quot;nofollow&quot;&gt;http://www.codeproject.com/Articles/488207/ZeroMQ-via-Csharp-Introduction&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far the only downside of this choice is, that the default Win32 buttons/components are not exactly too pretty, so if you need something good looking, you must pay for that.  But that is not my issue :) There is an option to develop GUI in WPF, but so far I am afraid to do so, since I only get negative references on that (it is supposedly too slow).&lt;/p&gt;&#xA;" OwnerUserId="3120" LastActivityDate="2014-09-01T10:57:02.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14594" PostTypeId="2" ParentId="8831" CreationDate="2014-09-01T10:57:23.257" Score="2" Body="&lt;p&gt;I don't think it is possible to do this without having a specific model or family of distributions which you assume that you are observing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For any finite sample, the greatest probability estimate for the population mean is the sample mean. If you had a sample, you would never be able to distinguish statistically between a distribution with infinite mean, and the truncation of the same distribution at some point higher than the maximum of your sample (or a discrete disribution, with all the probability distributed between the points you observed). For you to establish that the former is more likely than the latter, you would have to restrict yourself to some family of possible distributions for which this is the case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your sample doesn't fit a Levy distribution well, is there some larger family of distributions which it might fit better, and for which you can establish a theoretical link to hitting times for some general set of processes?&lt;/p&gt;&#xA;" OwnerUserId="4963" LastActivityDate="2014-09-01T10:57:23.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14595" PostTypeId="2" ParentId="14575" CreationDate="2014-09-01T11:04:17.447" Score="1" Body="&lt;p&gt;Concidering 22 days of trading per month you have approximatly 132 days of trading. I highly doubt that this will be sufficient for any forecasting. The sample might be too small.&#xA;Have a look here: &lt;a href=&quot;http://research.stlouisfed.org/wp/2012/2012-008.pdf&quot; rel=&quot;nofollow&quot;&gt;http://research.stlouisfed.org/wp/2012/2012-008.pdf&lt;/a&gt;&#xA;Erdemlioglu, Laurent and Neely used the data of ~10 years to conduct their survey.&lt;/p&gt;&#xA;" OwnerDisplayName="user11953" LastEditorDisplayName="user11953" LastEditDate="2014-09-01T11:33:35.433" LastActivityDate="2014-09-01T11:33:35.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14596" PostTypeId="2" ParentId="14589" CreationDate="2014-09-01T11:26:13.387" Score="1" Body="&lt;p&gt;Are you really interested in ranking different indicators, or do you just want to know how you should combine them to make the best predictor possible? Is there any reason you can't use several together?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Correlation coefficients would certianly be a reasonable starting point for this. You have two obvious problems that come up if you do it this way: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;A correlation coefficient doesn't tell you how economically significant the relationship is, just how statistically significant. In other words, a certain variable might correlate very closely with returns, but the difference in the returns might be very small for different values of the variable. However, if you are comparing different predictors for the same population, there is a total amount of variability, and something with a higher correlation coefficient will explain more of it. But it might not be possible for you to realise all the information you have as gains. For example, being able to identify big losers and big winners could be much more valuable than sorting out the mass of small winners and small losers from each other. &lt;/li&gt;&#xA;&lt;li&gt;You will find that your indicators are correlated with each other. How do you measure the contribution each makes to determining valuation? Typically if you have two variables, both together will predict better than either one on its own. You might want to do various linear regressions with different sets of parameters and use some way of deciding which is the best. Correlation coefficients are closely related to single-variable regression, so this approach is kind of a generalization of using corrlation coefficients. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Calibrating in time t-1 and using the results to predict time t is also a reasonable approach. You should be careful of overfitting. This is when you develop a model which doesn't have any real content, but just happens by coincidence to match exactly how well something has done in t-1 and so doesn't work in any other period. You can take further periods and look for something which works pretty well over all of them to try and get round this. Or you could use various techniques like log-likelihood to measure how complex your model should optimally be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you really want to compare different indicators taken in isolation, paper trading could be a good way, although it makes more financial sense than statistical sense. Formulate a similar strategy for each indicator, eg. buy the best 10% and short the worst 10%, and see which would have made the most money after a certain time. This will force you to decide what time scale you are going to look for returns over (or to develop some other way of choosing when to close out positions), which is critical for statistical strategies.&lt;/p&gt;&#xA;" OwnerUserId="4963" LastEditorUserId="4963" LastEditDate="2014-09-17T09:31:30.193" LastActivityDate="2014-09-17T09:31:30.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14598" PostTypeId="1" CreationDate="2014-09-01T15:19:25.863" Score="1" ViewCount="146" Body="&lt;p&gt;Something interesting that doesn't quite make sense to me.  When calculating compound interest using P(1+r)^t, I'm calculating in two ways - one using the day 1 principal balance, and the other using the balance as it grows month to month.  However, I'm getting different slightly different values during the middle of the term(months 13-23), but the same beginning and ending values.  I'm fairly certain the values at any given point should be equivalent, but I'm not quite sure why they're off.  I attached a link to a spreadsheet to help get the point across, Cells G31:G43 should be 0's if the calculation is equivalent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://drive.google.com/file/d/0BxZVRdEyIo6wSXVITUc2MnZHV0E/edit?usp=sharing&quot; rel=&quot;nofollow&quot;&gt;https://drive.google.com/file/d/0BxZVRdEyIo6wSXVITUc2MnZHV0E/edit?usp=sharing&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2732" LastActivityDate="2014-09-07T05:53:34.223" Title="Different interim balances when calculating annual compound interest different ways" Tags="&lt;interest-rates&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14599" PostTypeId="2" ParentId="7377" CreationDate="2014-09-02T02:40:31.637" Score="1" Body="&lt;p&gt;In general all the applications of filtering and time series analysis can be included; from the standard periodogram analysis to determine the order of a model to the more complex hidden markov model estimations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example of the later can be found in Alizera Javaheri's book. In there, he poses the problem of estimating a stochastic volatility problem as a filtering one, and hence all the filtering tools come into hand. How you use the results to generate profit (if that is what your looking for) depends more on you. I have seen people using these estimations combined with credit grades kind of model to try to calibrate the credit and equity markets jointly, and find mis-pricings among them. &lt;/p&gt;&#xA;" OwnerUserId="11945" LastActivityDate="2014-09-02T02:40:31.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14600" PostTypeId="1" AcceptedAnswerId="14603" CreationDate="2014-09-02T10:41:33.067" Score="7" ViewCount="2724" Body="&lt;p&gt;I am sligtly confused by this problem, although it should not be difficult. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us roll a sigle dice. If the dice shows $n$, I receive $n$ dollars. I can buy an option to roll the die again. What is the price for the option?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My idea is that the price should be the expected payoff of the game, conditioned over the result of the first game, but I am not sure as to how write this down precisely.&lt;/p&gt;&#xA;" OwnerUserId="11960" LastActivityDate="2017-11-01T14:35:41.980" Title="Option on a dice game" Tags="&lt;option-pricing&gt;" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14601" PostTypeId="2" ParentId="14600" CreationDate="2014-09-02T11:17:23.507" Score="1" Body="&lt;p&gt;The next throw is independent of the previous throws, so you only calculate the value of the future expected payoffs from the option to continue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How many &quot;$n$&quot;s does the dice have, and what is their probability?&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-09-02T11:17:23.507" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14603" PostTypeId="2" ParentId="14600" CreationDate="2014-09-02T14:43:02.770" Score="5" Body="&lt;p&gt;I would use the following arguments:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the option were on the first throw of the dice, then we would price it using the expectation, which is $3.5$ (= $(1+2+\cdots+6)/6$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we have a 2 stage game:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;First throw : if the player throws more than $3.5$ points, i.e. $4,5,6$, then there is no sense in throwing again. If he throws $1-3$ then it makes sense to throw again.&lt;/li&gt;&#xA;&lt;li&gt;Second throw: given that the first throw was $1-3$ we expect a payoff of $3.5$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So we can price the option as $1/2*3.5 = 1.75$ which is the probability that the option is worth anything after the first throw times the value of the option in the second throw. &lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-09-02T14:43:02.770" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14604" PostTypeId="1" CreationDate="2014-09-02T14:44:46.287" Score="3" ViewCount="177" Body="&lt;p&gt;I am working on the determinants of &lt;code&gt;sovereign credit rating&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for the historical rating data-set for &lt;code&gt;euro-zone&lt;/code&gt; countries. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know any source?&lt;/p&gt;&#xA;" OwnerUserId="11962" LastEditorUserId="743" LastEditDate="2016-01-07T15:58:41.153" LastActivityDate="2016-01-07T15:58:41.153" Title="Sovereign Credit Rating" Tags="&lt;data&gt;&lt;credit-ratings&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14605" PostTypeId="2" ParentId="7860" CreationDate="2014-09-02T15:22:57.517" Score="1" Body="&lt;p&gt;I've analysed numerous strategies, and have never encountered problem similar to yours. Your approach of volatility measurement may be a bit deviating from the conventional thinking. Essentially, why would you measure volatility of overlapping returns? It's not sensible. No matter what rolling or walk-forward schemes you are adopting, one can always derive the daily return, and measure their standard deviation as a proxy for volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If risk profile is what you are concerning with, then standard deviation is a good enough and pretty standard metric, although I admit that volatility does not equal risk. If stability of returns is your main concern, then you might want to measure the volatility, VaR and draw down, etc.,  in each &lt;strong&gt;non-overlapping&lt;/strong&gt; periods.  &lt;/p&gt;&#xA;" OwnerUserId="9381" LastActivityDate="2014-09-02T15:22:57.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14606" PostTypeId="2" ParentId="14604" CreationDate="2014-09-02T18:31:59.560" Score="1" Body="&lt;p&gt;Bloomberg terminal page: &lt;a href=&quot;http://www.survivrelondres.co.uk/Fonctions%20de%20Bloomberg.pdf&quot; rel=&quot;nofollow&quot;&gt;CSDR&lt;/a&gt; (=&quot;Sovereign Debt Ratings&quot;)&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-09-02T18:31:59.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14608" PostTypeId="2" ParentId="14443" CreationDate="2014-09-02T22:07:51.717" Score="3" Body="&lt;p&gt;The error is, you are not storing the random numbers for the same path at the end:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;xbefore = x + c*tau + sigma*sqrt(tau)*randn()&#xA;&#xA;A = muA + sigmaA*randn();&#xA;&#xA;xafter = xbefore + A;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But then at end you set a different path here by creating a new random number:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;xT = log(S0)+(c+muA*lambda)*T+sqrt((sigma^2+(muA^2+sigmaA^2)*lambda)*T)*randn();&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;randn()&lt;/strong&gt; generates a new random variable each time, so you need to store the specific path to make sure that it takes the same path at &lt;strong&gt;xT&lt;/strong&gt;, and not take a new path by using another &lt;strong&gt;*randn()&lt;/strong&gt; for &lt;strong&gt;xT&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g. use another dummy variables:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;rand = randn();&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to use the same number at each loop, and &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;path = path+randn();&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to store the total path for &lt;strong&gt;xT&lt;/strong&gt; at the end.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-09-02T22:07:51.717" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14609" PostTypeId="1" CreationDate="2014-09-02T22:39:20.883" Score="1" ViewCount="106" Body="&lt;p&gt;I'm fitting some financial data to a model based on a stochastic process and evaluating the fit of it by looking at the compensator. However, I cannot understand well what does it mean to take the integral of the intensity function associated to a stochastic process. My understanding is that if $\lambda(t)$ is the intensity function of a stochastic process, then $ \int_0^T\lambda(t)dt$ tells me the expected number of occurrences in the time interval $(0,T)$. For example, if I have a Poisson process with parameter $\lambda$ then in a time interval of 3 units of time we expect to have $3\lambda$ arrivals. Following this logic, the compensator $$\Lambda_{(t_i,t_{i+1})}=\int_{t_i}^{t_{i+1}}\lambda(t)dt$$ should simply tell me the expected number of occurences in the time interval $(t_i,t_{i+1})$. My problem starts now: if $t_{i}$ and $t_{i+1}$ are two consecutive arrival times and if $\Lambda_{(t_i,t_{i+1})}&amp;gt;1$ it should mean that the expected number of arrivals predicted by my process is higher than the one that actually occurs (hence, that the process over-estimates the nuber of occurences in the time interval).But, according to &quot;Modelling Irregularly Spaced Financial Data&quot; by Hautsch, when $\Lambda_{(t_i,t_{i+1})}&amp;gt;1$ it actually means that the intensity function under-estimates the number of arrivals in the time interval which &quot;fits&quot; with the idea that the compensator actually tells me the expected inter-arrival time. Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="11874" LastActivityDate="2014-09-02T22:39:20.883" Title="Intensity Function of Stochastic Processes" Tags="&lt;stochastic-processes&gt;&lt;finance&gt;&lt;stochastic-calculus&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14611" PostTypeId="1" AcceptedAnswerId="14613" CreationDate="2014-09-03T03:50:41.103" Score="3" ViewCount="205" Body="&lt;p&gt;I am estimating different copulas for bond factors that i also fit AR(1) models on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now i would like to test and compare durations and VaRs with my model vs empiric.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But how can i simulate AR(1) series with my copula properties? I can simulate both independently but i am unsure how to proceed to do both simulatneously&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope my question isn't too specific.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="7107" LastActivityDate="2014-09-03T14:04:07.253" Title="Copula- AR simulation" Tags="&lt;simulations&gt;&lt;copula&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14612" PostTypeId="1" CreationDate="2014-09-03T06:16:37.943" Score="4" ViewCount="1839" Body="&lt;p&gt;I have a question concerning pricing of a callable floating rate note (FRN). I have not found a lot of literature concerning callable FRNs (although a lot for callable bonds).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With my understanding, modelling the short rate is no longer relevant here (as would be the case for a callable bond) because interest rate movements do not dictate whether the bond will be called but actually the credit quality of the issuer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ie. if the bond was issued with an issue spread of 100bps (ie. the FRN pays LIBOR+100bps and that 100bps represents the issuer's inferior credit quality over members of the interbank market) but over the course of the life of the bond the issuer's credit quality increases which is revealed in a lower trading spread/par floater spread of say 80bps then, if the strike price of the call was set at par say (ie. 100bps) then the bond would be called.    &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How should one go about modelling the credit quality of the issuer then? Does anybody know of some resources they advise looking at or a better approach to pricing this in general?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All help very much appreciated&lt;/p&gt;&#xA;" OwnerUserId="11967" LastActivityDate="2015-01-08T14:20:56.390" Title="Pricing Callable Floating Rate Note" Tags="&lt;fixed-income&gt;&lt;floating-rate&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14613" PostTypeId="2" ParentId="14611" CreationDate="2014-09-03T10:26:47.637" Score="3" Body="&lt;p&gt;As you know, simulating AR(1) is to simulate the distributed error path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume the bivariate errors distributed $\sim F(x),\sim F(y)$ with copula $C(u,v)$ to model their dependence.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the bivariate joint error distribution is given by Sklar's theorem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$F(x,y)=C(F(x),F(y))$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;You can simulate from this distribution using &lt;strong&gt;Conditional Sampling&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To obtain a realization of a bivariate Copula $C(u,v)$, one draws the first variable $u$ as&#xA; random number $\sim U(0,1)$. The second variable $v$ is generated from another&#xA;independent random number $z$ plugged into the inverse Copula $C^{-1}(z\,|u=u)$ under the first generated&#xA; (conditional) random number $u$:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Draw $\bar{u},\bar{z}\sim U(0,1)$&lt;/li&gt;&#xA;&lt;li&gt;Set $\bar{v} = C_{\bar{u}}^{-1}(\bar{z})$ (quasi-inverse Copula under $\bar{u}$, or conditional $C^{-1}(t,u\,|u=\bar{u})$ )&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;From this you get $$(x=F(\bar{u})^{-1},y=F(\bar{v})^{-1})$$ as your two simulated errors for the AR(1) process.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-09-03T14:04:07.253" LastActivityDate="2014-09-03T14:04:07.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14614" PostTypeId="1" CreationDate="2014-09-03T12:51:15.253" Score="4" ViewCount="336" Body="&lt;p&gt;When I started combing through the literature I was astonished about how little the option pricing models are tested against market data and benchmarks are limited. The main barrier is of course finding affordable options market data is not easy. But it is essential to assess the performance of the proposed model with some other models accepted by the academia.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, while Duan's famous paper &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/j.1467-9965.1995.tb00099.x/abstract&quot; rel=&quot;nofollow&quot;&gt;paper on option pricing with GARCH&lt;/a&gt; has no empirical section, Heston and Nandi's own &lt;a href=&quot;http://rfs.oxfordjournals.org/content/13/3/585.short&quot; rel=&quot;nofollow&quot;&gt;GARCH paper&lt;/a&gt; has detailed info on the data used and benchmarks their model with other models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;I am looking for scientific papers with a data section on empirical option pricing.&lt;/strong&gt; They usually either propose a model and benchmark using market data or completely devote themselves to benchmark models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;p.s. I am more interested in exchange traded equity, etf and index options, so American and European option pricing models are priority (others are also welcome). No limit on the model type, the only requirement is it should spit out a price. Benchmark papers are also welcome.&lt;/p&gt;&#xA;" OwnerUserId="8147" LastActivityDate="2014-09-15T17:17:25.470" Title="Literature on Empirical Option Pricing" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;research&gt;&lt;american-options&gt;&lt;european&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14616" PostTypeId="1" CreationDate="2014-09-03T14:41:20.510" Score="1" ViewCount="111" Body="&lt;p&gt;I have a data set of 350 points, I want to estimate the lag 1 auto correlation for different sub-sets of the data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More precisely I want to take non overlapping windows of length 1,2,3....n and calculate the auto correlations of these sub-sets. So for n equal to 2 I take every second observation similarly for n=3 I take every third observation and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just wondered roughly what the maximum value of n I can realistically work with? Even with n=10 I'm down to 35 observations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kind Regards&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Baz&lt;/p&gt;&#xA;" OwnerUserId="7077" LastActivityDate="2014-09-03T14:41:20.510" Title="Rule of Thumb for minimum length of time series for AR(1) estimation" Tags="&lt;time-series&gt;&lt;auto-correlation&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14617" PostTypeId="1" AcceptedAnswerId="14618" CreationDate="2014-09-03T15:22:29.173" Score="3" ViewCount="220" Body="&lt;p&gt;I am trying to generate a few samples of &lt;a href=&quot;http://en.wikipedia.org/wiki/Geometric_Brownian_motion&quot; rel=&quot;nofollow&quot;&gt;GBM&lt;/a&gt; using the following very simple MATLAB code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function results=gbm(mean,vol,s0,T,shocks)&#xA;results = s0 * exp( (mean - vol^2/2) * T + vol^2 * sqrt(T) * shocks);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see, I am using directly the closed form solution of the wiki page.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The thing is, I know that techincally $\mathbb{E}(S_t) = S_0 \exp(\mu t)$, but when I do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; mean(gbm(0,.1,100,1,randn(1000,1)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get &lt;code&gt;99.54&lt;/code&gt; as a result. How can that be?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I mean in the code above, I use $\mu=0$, so I'm expecting $\mathbb{E}(S_t) = S_0 \exp(0 )=S_0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been looking at this too much and there might be something obvious I'm missing here.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2014-09-05T06:28:45.690" LastActivityDate="2014-09-05T06:28:45.690" Title="What is wrong in this GBM simulation?" Tags="&lt;programming&gt;&lt;stochastic-processes&gt;&lt;monte-carlo&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14618" PostTypeId="2" ParentId="14617" CreationDate="2014-09-03T15:53:57.983" Score="4" Body="&lt;p&gt;You have typo &quot;&lt;strong&gt;vol^2&lt;/strong&gt;&quot;, but it should be &quot;&lt;strong&gt;&lt;em&gt;vol&lt;/em&gt;&lt;/strong&gt;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Its $$\sqrt{\sigma^2T}=\sigma\sqrt{T}$$&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-09-03T15:53:57.983" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14619" PostTypeId="1" CreationDate="2014-09-03T16:00:01.920" Score="1" ViewCount="382" Body="&lt;p&gt;I need to implement a FAST engine from scratch without using any open source or commercial FAST implementations. The &lt;a href=&quot;http://www.fixtradingcommunity.org/mod/file/view.php?file_guid=43062&quot; rel=&quot;nofollow&quot;&gt;FAST spec&lt;/a&gt; does not help much so I am not sure from where to start. Have anyone done the same and would be able to point me in the right direction in order to successfully tackle this project?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I already have a FIX engine ready. Is FAST really just a compression scheme on top of regular fix messages?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="8241" LastActivityDate="2016-08-27T18:21:35.913" Title="Where can I find a guide to implement the FAST protocol from scratch having already a FIX implementation ready?" Tags="&lt;market-data&gt;&lt;fix&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14620" PostTypeId="2" ParentId="14586" CreationDate="2014-09-03T16:39:54.783" Score="2" Body="&lt;p&gt;You're confusing the language that you will use for your &lt;strong&gt;&lt;em&gt;analysis&lt;/em&gt;&lt;/strong&gt; with the language you will use to &lt;strong&gt;&lt;em&gt;execute&lt;/em&gt;&lt;/strong&gt; your results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The modern approach for APIs (for all industries/apps) is to use and HTTP based REST API that is exposed to the outside world, most likely with something like JSON. This approach works because it can be used by a large variety of languages. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, on the developer/analyst end you can use a variety of languages to handle your REST communications however you choose. How you make your analysis and generate results is of no consequence to the API provider (in this case, the broker). So you could do something like generate results with R and then transmit them with python. Generate all results with python and also transmit them with python. Really, you can do whatever you want on your end as long as you follow the REST specifications given to you by the broker.&lt;/p&gt;&#xA;" OwnerUserId="7514" LastActivityDate="2014-09-03T16:39:54.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14621" PostTypeId="2" ParentId="14572" CreationDate="2014-09-03T16:42:57.307" Score="3" Body="&lt;p&gt;Your question is too general because Monte Carlo methods differ quite a bit. It's driven more by the problem you are trying to solve, significant result sets, etc, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You would either have to &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;provide more details to what you're trying to solve or;&lt;/li&gt;&#xA;&lt;li&gt;try programming some Monte Carlo simulations yourself.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;My first experience with them was trying to solve a progressive jackpot game for a friend. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes, you just have to throw yourself into code in order to learn.&lt;/p&gt;&#xA;" OwnerUserId="7514" LastEditorUserId="467" LastEditDate="2014-09-05T03:55:49.167" LastActivityDate="2014-09-05T03:55:49.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14622" PostTypeId="2" ParentId="14536" CreationDate="2014-09-03T17:04:48.123" Score="7" Body="&lt;p&gt;If I was in your position I would start to research how I can create a web server is C++ and expose calls to create a REST service. In other words, can you make your code status output to HTTP?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From there, the rest should be easy. You would just need to create a GUI that can access REST services, which virtually all modern languages can. You could focus on something like AngularJS. It consumes services quite easily and also lets you display them quickly. If you combine Angular with a template from Themeforest (as someone else suggested) you could have a very nice GUI in no time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You sound like a busy person. If you can do the first part of creating the REST service, then a good developer should be able to help you with the secon &lt;/p&gt;&#xA;" OwnerUserId="7514" LastActivityDate="2014-09-03T17:04:48.123" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14623" PostTypeId="2" ParentId="14226" CreationDate="2014-09-03T17:45:31.763" Score="1" Body="&lt;p&gt;The cumulative return over the entire path is the sum of the returns on the individual periods: $$X = X_1 + X_2 + \ldots + X_N.$$&#xA;Two potential definitions of the volatility of this process would be $Std(X) / \sqrt{N}$ (which is exactly your &quot;cross-section&quot; volatility) or $Std(X_i)$ (assuming each $X_i$ has the same unconditional distribution). If the $X_i$ are independent, then these two are equal, whereas if the $X_i$ are positively correlated, then $Std(X) / \sqrt{N} &amp;gt; Std(X_i)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could also ask: what is the standard deviation of $X_i$ given the returns I've already seen for $X_1, X_2, \ldots X_{i - 1}$? This will generally depend on $i$, unless you have some special conditions, like a Markov process. Your &quot;time-wise&quot; volatility calculation is taking all of these standard deviations for different $i$'s and taking some kind of average, which doesn't seem to be that meaningful, since they have different distributions.&lt;/p&gt;&#xA;" OwnerUserId="11970" LastActivityDate="2014-09-03T17:45:31.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14624" PostTypeId="2" ParentId="14560" CreationDate="2014-09-03T19:41:52.747" Score="1" Body="&lt;p&gt;Very often a stock's return is determined primarily by what the broad market, or perhaps the stock's sector, is doing: to see this, take a random stock, and it will be very hard to justify most moves - until you consider the market [e.g. S&amp;amp;P500] or sector [e.g. transportation].&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, I would include &lt;strong&gt;the beta coefficient&lt;/strong&gt;, which measures the volatility in comparison to the market as a whole. In addition, I would consider including &lt;strong&gt;the returns (and perhaps also momentum) of the market or relevant sector&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11791" LastActivityDate="2014-09-03T19:41:52.747" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14625" PostTypeId="2" ParentId="14532" CreationDate="2014-09-03T20:23:59.153" Score="1" Body="&lt;p&gt;Before I answer your question, allow me to suggest that you clarify your question: let me propose that you edit your question to include the source, i.e. where exactly did you read this? I have found only very few resources mentioning &lt;strong&gt;exposure bounds&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your question seems to imply that bounding the possible exposure of each [type of] asset or security in your portfolio (e.g. equities 20-60%; bonds 20-40%; etc.) will keep the sensitivity lower. Of course, if the ranges are smaller (bounded), the sensitivity could also only go so far. I am not sure which &lt;em&gt;parameter estimation&lt;/em&gt; techniques you refer to - but again, if the ranges are smaller, parameter estimation could become easier (the search space is smaller) and less prone to errors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps. Again, feel free to provide more detail.&lt;/p&gt;&#xA;" OwnerUserId="11791" LastActivityDate="2014-09-03T20:23:59.153" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14626" PostTypeId="1" AcceptedAnswerId="14628" CreationDate="2014-09-04T04:11:00.410" Score="3" ViewCount="613" Body="&lt;p&gt;As a follow up of my previous &lt;a href=&quot;https://quant.stackexchange.com/questions/14617/what-is-wrong-in-this-gbm-simulation&quot;&gt;question&lt;/a&gt;, I am now simulating the &lt;a href=&quot;http://en.wikipedia.org/wiki/Geometric_Brownian_motion&quot; rel=&quot;nofollow noreferrer&quot;&gt;GBM&lt;/a&gt; step by step for $n$ steps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using the following implementation for the simulation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S_{t+1} = S_t \exp \left[ \left(\mu-\frac{\sigma^2}{2}\right) \Delta t + \sigma \sqrt{\Delta t} Z_t \right], ~ Z_t \sim \mathcal{N}(0,1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each step represents a unit of time so $\Delta t = 1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use the following MATLAB code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function paths = gbm_exp(mu,vol,s0,nbr_steps,nbr_paths)&#xA;&#xA;shocks = randn(nbr_steps,nbr_paths/2);&#xA;shocks_ant = [shocks, -shocks];&#xA;&#xA;paths = zeros(nbr_steps+1,nbr_paths);&#xA;&#xA;paths(1,:) = s0;&#xA;&#xA;for i=1:nbr_paths&#xA;    for j=1:nbr_steps&#xA;        paths( j + 1, i ) = paths( j, i ) * exp( (mu - vol^2/2) + vol * shocks_ant( j, i ) );&#xA;    end&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see, I use antithetic path to try to reduce the overall variance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The thing is, again, I should have $\mathbb{E}(S_t) = S_0 ~ \forall t$ if I set $\mu=0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I do the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt; test=gbm_exp(0,.3,100,300,2000);&#xA;&amp;gt;&amp;gt; mean(test(end,:))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This means that I simulate 300 steps, with $\sigma=0.3$, $\mu=0$ and $S_0 = 100$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The mean I get though, is something quite small, around 20 on average. So, not at all the excpected 100.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I tried increasing my number of paths to 200k and I get a mean of roughly 40 on average.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I'm suprised by this behavior, I would expect it to converge much more quickly, especially with antithetic paths.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Did I miss something obvious again?&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2014-09-05T07:26:06.143" Title="Convergence of GBM mean after simulation?" Tags="&lt;programming&gt;&lt;stochastic-processes&gt;&lt;monte-carlo&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14628" PostTypeId="2" ParentId="14626" CreationDate="2014-09-04T09:38:46.647" Score="2" Body="&lt;p&gt;You should look at confidence interval. Normally, your confidence interval size is proportional to the standard deviation, looking something like: with probability $p$ your value will be in the interval: &#xA;$$[\bar{S} - k*StdDev, \bar{S} + k*StdDev]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, getting back to your simulation, we can say that your time step is very big (1 year) and you simulate 300 points, meaning that you simulate outcome in 300 years. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}(S_t) = S_0e^{\mu t} \\ \mathbb{Var}(S_t) = S_0^2e^{2\mu t} (e^{\sigma^2t}-1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, e.g. $\{\mu = 0\}$ we obtain:&#xA;$$\mathbb{E}(S_t) = S_0 \\ \mathbb{Var}(S_t) = S_0^2(e^{\sigma^2t}-1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Plugging in $\{S_0 = 100, \sigma =.3, t = 300\}$ we obtain:&#xA;$$\mathbb{E}(S_t) = 100 \\ \mathbb{Var}(S_t) = 100^2(e^{27}-1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tested similar code with Mathematica (without antithetic) for 300 time steps with 1 year step and got {Paths, Mean, StdDev, {Min, Max}} = {10^6, &lt;strong&gt;60.2203&lt;/strong&gt;, &lt;strong&gt;16363.3&lt;/strong&gt;, {2.40216*10^-15, 1.2311*10^7}}. As you can see the standard deviation is very important, it means that your confidence interval will be also big. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just try to test for 1 year and you should get good average:&#xA;{Paths, Mean, StdDev, {Min, Max}} = {10^6, &lt;strong&gt;100.028&lt;/strong&gt;, &lt;strong&gt;30.6978&lt;/strong&gt;, {22.5584, 370.411}}&lt;/p&gt;&#xA;" OwnerUserId="11924" LastEditorUserId="11924" LastEditDate="2014-09-04T15:34:02.873" LastActivityDate="2014-09-04T15:34:02.873" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14629" PostTypeId="2" ParentId="14626" CreationDate="2014-09-04T09:58:50.363" Score="0" Body="&lt;p&gt;appearantly your sampling variance is too large. I reimplemented your example in R. What I first saw is, that the mean got worse if I took more time steps (you take $300$).&#xA;Your volatility is $0.3$ which is $30\%$ per year and you sample $300$ years. What you should do is the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;define a variable &lt;code&gt; nbr_steps_peryear&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;choose the number of  &lt;code&gt; years&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;then you take &lt;code&gt; nbr_steps = years*nbr_steps_peryear &lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;define a variable &lt;code&gt; dt = 1/nbr_steps_peryear &lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;dt&lt;/code&gt; will control your variance. I get nice results with the following set-up:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;nbr_steps_peryear = 20&#xA;years = 5&#xA;nbr_steps = years*nbr_steps_peryear&#xA;dt = 1/nbr_steps_peryear&#xA;nbr_paths = 10^3&#xA;S0 = 100&#xA;mu = 0.0&#xA;vol = 0.3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The dt term balances between the drift term $\mu-\sigma^2/2$ and the volatility term.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main source of the problem is the large number of years - as already mentioned above. With a reasonable number of years and intermediate time steps to balance th drift it should look fine.&#xA;    nbr_steps_peryear = 20&#xA;    years = 5&#xA;    nbr_steps = years*nbr_steps_peryear&#xA;    dt = 1/nbr_steps_peryear&#xA;    nbr_paths = 10^3&#xA;    S0 = 100&#xA;    mu = 0.0&#xA;    vol = 0.3&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;shocks &amp;lt;- replicate(nbr_paths/2,rnorm(nbr_steps))&#xA;shocks_ant = cbind(shocks,-shocks)&#xA;&#xA;paths = matrix(0,nrow=nbr_steps+1,ncol=nbr_paths)&#xA;paths[1,]  = S0&#xA;&#xA;for (j in 1:nbr_steps){&#xA;    paths[j+1,] = paths[j,]*exp((mu-vol^2/2)*dt + vol*sqrt(dt)*shocks_ant[j,])&#xA;}&#xA;&#xA;mean(paths[nbr_steps+1,])&#xA;summary(paths[nbr_steps+1,])&#xA;hist(paths[nbr_steps+1,])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2014-09-05T07:26:06.143" LastActivityDate="2014-09-05T07:26:06.143" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="14630" PostTypeId="1" CreationDate="2014-09-04T10:35:29.993" Score="3" ViewCount="234" Body="&lt;p&gt;I am trying to decompose the change in value of an inflation-linked bond into two constituent parts:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) That due to changing nominal rates on the issuer's non-linked bonds&#xA;2) That due to changing inflation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure how to go about this, but do have access to a Bloomberg terminal to obtain any necessary data.&lt;/p&gt;&#xA;" OwnerUserId="11973" LastActivityDate="2018-01-23T18:23:05.520" Title="How can I break down the change in value for an inflation-linked bond" Tags="&lt;fixed-income&gt;&lt;inflation&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14631" PostTypeId="2" ParentId="14626" CreationDate="2014-09-04T11:32:12.750" Score="1" Body="&lt;p&gt;The GBM is a continuous model, so using large integer time steps naturally leaves large discretization error (which vanishes when you increase the number of steps).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use small time step 0.001:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;paths(j + 1,i) = paths(j,i) * exp((mu - vol^2/2)*0.001 + vol * 0.001^0.5*shocks_ant(j,i));&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then the mean is almost exactly 100 as expected.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-09-04T11:32:12.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14632" PostTypeId="1" CreationDate="2014-09-04T12:17:00.653" Score="4" ViewCount="544" Body="&lt;p&gt;I am trying to find any references to cross-currency inflation-linked swaps. Have anyone encountered them and can describe how they work and how they differ from standard year on year inflation swaps?&lt;/p&gt;&#xA;" OwnerUserId="993" LastActivityDate="2019-08-04T00:19:53.947" Title="Cross-Currency Inflation-Linked Swap" Tags="&lt;swaps&gt;&lt;inflation&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14633" PostTypeId="1" AcceptedAnswerId="14635" CreationDate="2014-09-04T16:52:06.660" Score="0" ViewCount="250" Body="&lt;p&gt;It is usually taught in forex training courses that the risk:reward ratio should be 1:2.&#xA;My question is: why is it 1:2 but not other ratio?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I am new to forex trading. To what level of technical analysis (TA) should I know in order to be able to trade? My friend told me that: you just need basic TA (some basic indicators), it is more about understanding the psychology of the crowd (thus human) and how determined and discipline you are. Is he true?&lt;/p&gt;&#xA;" OwnerUserId="6461" LastEditorUserId="467" LastEditDate="2014-09-05T02:35:06.043" LastActivityDate="2014-09-05T02:35:06.043" Title="What is the required Risk/ Reward ratio in Forex?" Tags="&lt;fx&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2014-09-05T02:25:48.340" ContentLicense="CC BY-SA 3.0" />
  <row Id="14635" PostTypeId="2" ParentId="14633" CreationDate="2014-09-04T21:25:43.080" Score="0" Body="&lt;p&gt;Regarding risk reward ratio, there is no magic about the number 2. However, demanding a ratio of 2 does make practical sense. We may look at it in two-folds:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;From behavioural finance point of view&lt;/strong&gt;, investors generally demand more (2 dollars) profits for certain amount (one dollar) of loss. This skewed heuristic of decision making has been explained well in Daniel's &lt;a href=&quot;http://en.wikipedia.org/wiki/Prospect_theory&quot; rel=&quot;nofollow&quot;&gt;Prospect Theory&lt;/a&gt;, which is dictated as investor's common tendency of Loss Aversion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;From portfolio management point of view&lt;/strong&gt;, reward/risk of 2 loosely implies Sharpe ratio of two, which is a widely followed standard to determine the superiority of a tradable strategy. Sharpe ratio of less than that in simulation is hardly to achieve consistency and low draw down in live trading, given all the pitfalls of backtesting and trader's incapability to carry forward trading during stressful draw down period. Ernie Chan also once argued about this view in his article &lt;a href=&quot;http://epchan.blogspot.sg/2012/11/the-importance-of-2-as-sharpe-ratio.html&quot; rel=&quot;nofollow&quot;&gt;The importance of 2&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your next question of forex trading deserves a separate post by itself. My quick answer would be: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Technical analysis is worth learning. It gives a tool for market timing. However, it is not sufficient for you to achieve profitability on trading. &lt;/li&gt;&#xA;&lt;li&gt;News is almost useless. They are often already priced and never new. Believe me or not, professionals rarely make decisions based on news. However, processing of large amount of news quickly offers an edge, as information diffusion is not immediate. &lt;/li&gt;&#xA;&lt;li&gt;In trading, you need to have an edge. If you don't have one, then create one before starting. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Hope it helps. &lt;/p&gt;&#xA;" OwnerUserId="9381" LastEditorUserId="9381" LastEditDate="2014-09-05T00:22:40.450" LastActivityDate="2014-09-05T00:22:40.450" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14636" PostTypeId="2" ParentId="14572" CreationDate="2014-09-04T21:32:39.793" Score="5" Body="&lt;p&gt;There is Monte Carlo Simulation and there is Monte Carlo Simulation. If you are referring to a simple question like simulating dice or calculation of $\pi$ or even vanilla option price calculation, it is one thing and &quot;concisely&quot; available. I recommend get a gist of small examples from CS books and then get on with finance.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you are referring something more advanced applications using particle filtering, variance reduction, gibbs sampling, Metropolis-Hastings, MCMC, sequential MC, quasi-MC etc. I recommend you to look for CS books first and then use them on finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well luckily I got both courses at university here are some sources.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My Monte Carlo course's (I am not the instructor, just took the course) &lt;a href=&quot;http://www2.cmpe.boun.edu.tr/courses/cmpe58N/spring2012/&quot;&gt;home page&lt;/a&gt;, you can still download from the links.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hull's book &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0132777428&quot;&gt;Options, Futures and Other Derivatives&lt;/a&gt; is also a good reference. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.springer.com/mathematics/quantitative+finance/book/978-1-4471-2992-9&quot;&gt;Tools for Computational Finance&lt;/a&gt; is a bit advanced and finance-y.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are also online courses for it. MIT OCW has &lt;a href=&quot;http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00sc-introduction-to-computer-science-and-programming-spring-2011/unit-2/lecture-14-sampling-and-monte-carlo-simulation/&quot;&gt;one&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The core idea of MC is trial and error. As you venture on the MC way you see smarter ways of doing it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My advice of the path to learn is&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Learn the basics of MC (dice, area of a shape, coin tosses etc.)&lt;/li&gt;&#xA;&lt;li&gt;Have some insight on basic statistical principles (Law of Large Numbers, Central Limit Theorem, Maximum Likelihood, Bias etc.)&lt;/li&gt;&#xA;&lt;li&gt;Do a simple vanilla option price simulation and compare it with BS&lt;/li&gt;&#xA;&lt;li&gt;Go for variance reduction techniques (control variates, important sampling etc.)&lt;/li&gt;&#xA;&lt;li&gt;Try advanced topics (MH, Gibbs, Particle Filtering)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Caution&lt;/strong&gt;: Monte Carlo is both computationally and mathematically challenging. The 'basics' are really fun and basic but to significantly benefit from them you need to invest heavily on your learning.&lt;/p&gt;&#xA;" OwnerUserId="8147" LastActivityDate="2014-09-04T21:32:39.793" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14637" PostTypeId="2" ParentId="14598" CreationDate="2014-09-04T21:59:41.313" Score="1" Body="&lt;p&gt;The way you calculate &lt;em&gt;interest on interest&lt;/em&gt; (column H) is different from the way you treat the initial capital. In column E they are both calculated using the same method but column F or L accumulates interest from two different sources.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Technically $P*r*t$ is not equivalent to $P*(1+r)^t-P$.&lt;/p&gt;&#xA;" OwnerUserId="8147" LastActivityDate="2014-09-04T21:59:41.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14638" PostTypeId="1" CreationDate="2014-09-04T23:07:58.160" Score="4" ViewCount="4045" Body="&lt;p&gt;I am writing a paper and need to create a png or jpeg file for binomial option price tree. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the past I would have used the tikZ package in LaTeX, but that won't work in this case. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I want a different package than LaTeX/Tikz to draw this graph, possibly in R, python, ....&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you help?&lt;/p&gt;&#xA;" OwnerUserId="11977" LastEditorUserId="467" LastEditDate="2014-09-05T02:38:03.557" LastActivityDate="2014-09-05T19:47:41.057" Title="How to draw a binomial option tree graph?" Tags="&lt;binomial-tree&gt;&lt;graphs&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14639" PostTypeId="2" ParentId="9924" CreationDate="2014-09-05T08:41:43.527" Score="2" Body="&lt;p&gt;Recently I found a book on earnings trading but did not have time to read thoroughly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/B004GXB3DA&quot; rel=&quot;nofollow&quot;&gt;Trading on Corporate Earnings News - John Shon&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also had spent some time to see earnings surprise effects and it is a quite interesting but not easy to use topic. There is certainly a jump if the estimates and announced earnings have a large mismatch but the magnitude and direction are hard to quantify. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also recommmend &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/j.1540-6261.1970.tb00518.x/full&quot; rel=&quot;nofollow&quot;&gt;Fama's efficient markets survey&lt;/a&gt;. It is generally about market but it also makes a point about the market's quick reaction to news such as earnings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;p.s. I used Google's returns to make a point. It is totally crazy.&lt;/p&gt;&#xA;" OwnerUserId="8147" LastActivityDate="2014-09-05T08:41:43.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14640" PostTypeId="1" AcceptedAnswerId="14667" CreationDate="2014-09-05T13:39:46.897" Score="4" ViewCount="474" Body="&lt;p&gt;I'm currently taking a course in Financial Econometrics and there is a question in the lecture notes regarding back-testing of VaR which I'm have difficulty with.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all the procedure for back-testing of VaR using a rolling scheme is described as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;assume we have returns data $r_{t}, t=1,...,T$ for some large enough $T$. We take the first 60 observations and calculate their sample mean $\mu_{1-60}$ and variance $\sigma_{1-60}^{2}$ and then calculate:   $$\mbox{VaR}_{1-60}\left(\alpha\right)=-\mu_{1-60}+\Phi^{-1}\left(\alpha\right)\cdot\sigma_{1-60}$$&#xA;Where $\alpha$ is our confidence parameter (usually $\alpha=0.05$) and $\Phi^{-1}$ is the inverse standard normal CDF. If $r_{61}&amp;lt;-\mbox{VaR}_{1-60}\left(\alpha\right)$ we mark $1$ and otherwise $0$. We proceed doing the same thing for observations $2...62$ compared to $63$ and so on and in the end we count the number of times in which the result was $1$. while under the null hypothesis we expect that the proportion of times we got $1$ to be at most $\alpha$. In particular it's important to notice we had an assumption here that the returns are all normally distributed, $r_{t}\sim N\left(\mu_{t},\sigma_{t}^{2}\right)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now for the actual question, suppose $r_{t}, t=1,...,T$ are the returns using a WML investment strategy (momentum trading strategy). Is the procedure described above suitable for testing the VaR in such a case and if not why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually the phrasing of the question would hint towards there being some sort of problem with using the procedure in such a case but I don't see why that would be the case...&#xA;Help would very much be appreciated!&lt;/p&gt;&#xA;" OwnerUserId="11981" LastEditorUserId="6175" LastEditDate="2014-09-27T21:41:08.230" LastActivityDate="2014-09-27T21:41:08.230" Title="Back-testing Value at Risk with a WML investment strategy" Tags="&lt;backtesting&gt;&lt;econometrics&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14641" PostTypeId="2" ParentId="14443" CreationDate="2014-09-05T13:42:48.837" Score="0" Body="&lt;p&gt;Your code has a bug that it picks one random jump time by exprnd(lam), then makes a vector of jump times with jumps repeating at the same interval.  It should pick a new random time for each jump.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2014-09-05T13:42:48.837" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14642" PostTypeId="2" ParentId="14581" CreationDate="2014-09-05T15:05:48.197" Score="1" Body="&lt;p&gt;&quot;Burn rate&quot; is a measure of &quot;spend rate&quot; relative to cash on hand. So if you have $10  million dollars, and you spend  $1 million dollars a month, you will &quot;burn through&quot; your cash in ten months, at which time your company will either &quot;take off,&quot; get new financing, or go under.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Strategies that rely on &quot;burn rate&quot; are risky ones. Nevertheless, they are successful for a few (mainly tech) companies. This example is &quot;dated&quot; but Xerox around 1960 comes to mind.&lt;/p&gt;&#xA;" OwnerUserId="2345" LastActivityDate="2014-09-05T15:05:48.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14644" PostTypeId="1" CreationDate="2014-09-05T16:20:27.277" Score="4" ViewCount="1695" Body="&lt;p&gt;Find a diversified set of financial instruments by whatever method you like. Every day, buy each instrument at the open price. Historically, the open price is almost never the high. Sell immediately as soon as the price is at least one tick greater than the buy price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why doesn't this just print money?&lt;/p&gt;&#xA;" OwnerUserId="11983" LastActivityDate="2014-09-06T10:59:25.043" Title="Would this extremely simple strategy make money?" Tags="&lt;quant-trading-strategies&gt;" AnswerCount="5" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14645" PostTypeId="2" ParentId="14644" CreationDate="2014-09-05T16:57:48.950" Score="1" Body="&lt;p&gt;Because you have to take transaction costs into account.&lt;/p&gt;&#xA;" OwnerUserId="4709" LastActivityDate="2014-09-05T16:57:48.950" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14646" PostTypeId="1" CreationDate="2014-09-05T16:58:33.747" Score="1" ViewCount="87" Body="&lt;p&gt;While going through different methods of risk measure i came across AVaR/CVaR, while i was calculating AVaR/CVaR in credibilistic environment using VaR, i got stuck in the calculations&lt;/p&gt;&#xA;&#xA;&lt;p&gt;eg. For triangular fuzzy numbers $A =(a1,a2,a3)$&#xA;    $$VaR(\alpha)= 2*(a1-a2)*\alpha -a1;$$ $$\alpha \leq 0.5$$&#xA;               $$ = 2*(a2-a3)*\alpha +a3-2*a2; $$$$\alpha &amp;gt;0.5$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now,  $$ AVaR(\alpha)  = (1/\alpha) \int_0^\alpha Var(\beta)d\beta$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which somehow results in&#xA;    $$AVaR(\alpha)=  (a1-a2)*\alpha -a1;$$$$\alpha \leq 0.5$$&#xA;               $$=  (a2-a3)*\alpha +a3-2*a2-1/4*\alpha(a1-2*a2+a3)$$$$\alpha &amp;gt;0.5$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Plz help me wd d term $$-1/4*\alpha(a1-2*a2+a3).$$ How to get it?&lt;/p&gt;&#xA;" OwnerUserId="11984" LastEditorUserId="11984" LastEditDate="2014-09-06T05:11:35.720" LastActivityDate="2014-09-06T05:11:35.720" Title="how to find CVaR/AVaR for triangular fuzzy no" Tags="&lt;risk&gt;&lt;portfolio-management&gt;&lt;finance&gt;&lt;portfolio&gt;&lt;cvar&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14647" PostTypeId="2" ParentId="14644" CreationDate="2014-09-05T17:06:53.710" Score="4" Body="&lt;p&gt;Like Good Guy Mike says in his answer, you have to account for transaction costs. But change &quot;one tick&quot; to &quot;transaction costs + 1 tick&quot; and you still have a question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One issue is that while the open may not usually be the day's high, you'll have a few catastrophic losers that you hold all day, and they may be enough to wipe out your small steady gains.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, then why stop at the open? Any given price is probably not the stock's all-time high, so what about this: buy at the prevailing price, sell once the price reaches the price you bought at + transaction costs + 1 tick. Then buy again and repeat. Unless the occasional catastrophe wipes you out, this will make money. But this strategy is strictly worse than buy-and-hold because of transaction costs and the gaps in time between selling and the next buy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's easy to make positive profits; it's hard to beat the market.&lt;/p&gt;&#xA;" OwnerUserId="11970" LastActivityDate="2014-09-05T17:06:53.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14648" PostTypeId="2" ParentId="14644" CreationDate="2014-09-05T18:17:49.507" Score="0" Body="&lt;p&gt;The open is also almost never the low, so you could aswell short the asset. But in both cases, you have only marginal profit with potentially unbounded losses if it does not cross tick+spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. see this change in EUR/USD exchange rate: &lt;a href=&quot;http://www.ariva.de/euro-dollar-kurs/chart?layout=neu&amp;amp;boerse_id=36&amp;amp;t=week&quot; rel=&quot;nofollow&quot;&gt;http://www.ariva.de/euro-dollar-kurs/chart?layout=neu&amp;amp;boerse_id=36&amp;amp;t=week&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This event would have created a definitive extremely high loss, when going long before the ECB rate cut, which might easily counter all previous tick-gains.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-09-06T10:59:25.043" LastActivityDate="2014-09-06T10:59:25.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14649" PostTypeId="2" ParentId="14644" CreationDate="2014-09-05T19:18:05.980" Score="1" Body="&lt;p&gt;I just checked for S&amp;amp;P 500 from Yahoo Finance. From Jan 3rd, 2005 to April 14th, 2014 (2336 trading days), for 2014 days High is greater than Open and 322 days they are equal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume no friction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose you are an almighty person to catch Highs on your trade, then in one day you will make %0.00675 on average. That is your ceiling.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now add friction and be more realistic about your predictive power. Remember the 322 days where High is the Open (things get worse).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you had had invested in S&amp;amp;P 500 on Jan 3rd, 2005 from the Open price and sold on April 14th, 2014 High price your return would be %51.3458 (minus some friction). This is your benchmark.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is an interesting strategy. I came across &lt;a href=&quot;http://www.farmdoc.illinois.edu/marketing/agmas/reports/04_04/Tables.htm&quot; rel=&quot;nofollow&quot;&gt;a few more&lt;/a&gt;. It reminds me of &lt;a href=&quot;http://www.investopedia.com/terms/f/filterrule.asp&quot; rel=&quot;nofollow&quot;&gt;%y filter&lt;/a&gt; of Alexander although it is different.  &lt;/p&gt;&#xA;" OwnerUserId="8147" LastActivityDate="2014-09-05T19:18:05.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14650" PostTypeId="2" ParentId="14638" CreationDate="2014-09-05T19:47:41.057" Score="3" Body="&lt;p&gt;In R you can use fOptions package to draw Binomial Tree graphs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a simple code snippet&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#Install the package and load it&#xA;install.packages('fOptions')&#xA;library(fOptions)&#xA;&#xA;#Calculate the value of the option and plot&#xA;optionVals&amp;lt;-BinomialTreeOption(TypeFlag=&quot;ce&quot;,S=100,X=100,Time=3,r=0.05,b=0,sigma=0.2,n=3,title=&quot;example binomial tree&quot;)&#xA;BinomialTreePlot(optionVals)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The output is given below (I don't know maybe it can be done more beautifully, this is the default).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/04uVE.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="8147" LastActivityDate="2014-09-05T19:47:41.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14651" PostTypeId="2" ParentId="14640" CreationDate="2014-09-05T20:01:26.897" Score="1" Body="&lt;p&gt;If the returns are $N(\mu,\Sigma)$ distributed, then $WML\sim N(0,\sigma)$, because the equally-weighted $\mu$'s cancel while $\Sigma=\sqrt{w \Sigma w'}$ with $w=\{1/n...1/n\}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So your new VaR becomes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mbox{VaR}\left(\alpha\right)_{WML}=\Phi^{-1}\left(\alpha\right)\cdot\sigma$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your sampling formula from above remains still valid though, just with $(0,\sigma)$ parameters.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-09-08T23:47:03.720" LastActivityDate="2014-09-08T23:47:03.720" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14652" PostTypeId="2" ParentId="14644" CreationDate="2014-09-05T20:22:44.813" Score="5" Body="&lt;p&gt;There is a general principle that the answer to &quot;Would this extremely simple strategy make money?&quot; is &quot;No&quot;.  This is the &quot;no free lunch&quot; or &quot;no arbitrage&quot; rule.  It isn't exactly a physical law, but it is a pretty decent approximation of reality.  (A more nuanced version is, maybe it can make some money, but only in proportion to the difficulty, risk, and expense of executing the strategy.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your strategy as stated is incomplete.  You need to say what happens for a stock when the price goes down from the open.  Do you keep holding it to close?  Or set some stop-loss and sell then?  Keep holding it overnight so you don't have to repurchase at the next day's open?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets say you do that last version: keep holding.  Then consider the results.  Classify stocks as &quot;winners&quot; if they generally trend up during a day, &quot;mixed&quot; if they bounce up and down, and &quot;losers&quot; if they generally trend down during a day.  At the start of the day you have a portfolio of everything.  But you soon sell out of the winners and mixed stocks for a tiny profit on each.  By the end of the day you are only holding losers.  Do you expect this to outperform the buy-and-hold-everything strategy?  I would bet even without transaction costs it doesn't, and with transaction costs it throws away money like crazy.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2014-09-05T20:22:44.813" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14653" PostTypeId="1" AcceptedAnswerId="14670" CreationDate="2014-09-05T22:27:47.867" Score="8" ViewCount="777" Body="&lt;p&gt;Basically all Quant Finance theory is build on No-Arbitrage presumption and Efficient Markets Hypothesis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The known &lt;strong&gt;Grossman-Stiglitz Paradox&lt;/strong&gt; says: if one can't make money from trading, one wouldn't trade any asset in the first place.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did some private trading and watched markets over time, to see that markets are indeed becoming more and more efficient, so that prices already contain almost all available information on current and expected aspects, and only random unknown news changes the market. People may agree or disagree to that more or less, but overall there is convergence to strong Efficient Markets Hypothesis over last years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How do practitioners see this development, and why are still so many trading despite the theory?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-09-09T15:21:55.257" LastActivityDate="2014-09-09T15:23:30.370" Title="Efficient Markets Paradox" Tags="&lt;quant-trading-strategies&gt;&lt;trading&gt;&lt;market-data&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14656" PostTypeId="2" ParentId="14653" CreationDate="2014-09-06T07:22:00.053" Score="6" Body="&lt;p&gt;Making money is not the only reasonable objective to trading. Another common reason is to manage/reallocate risk. For example, this is exactly the objective of liability-driven-investors, such as pension funds. They're specifically trying to match durations of their liabilities. It doesn't matter if pension fund managers believe there are no inefficiencies to exploit. They're required to continue managing duration based on their fund mandate and evolving conditions of their pension obligations.&lt;/p&gt;&#xA;" OwnerUserId="5407" LastActivityDate="2014-09-06T07:22:00.053" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14657" PostTypeId="2" ParentId="14653" CreationDate="2014-09-06T09:48:32.947" Score="2" Body="&lt;p&gt;It's unclear what type of trading you are referring to (day trading sort of?). Also I'm not familiar with the aforementioned paradox. However, I think it's weird to say that you can't make money from trading, the semi-strong (strong) from of the EMH only states that the current share price incorporates all publicly (and non-publicly) available information. In other words; excess returns opportunities are unpredictable. Still, prices do change over time. This means that someone will always make money by trading, skill or no skill.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, there are other reasons for altering your portfolio, as mentioned by nsw.&lt;/p&gt;&#xA;" OwnerUserId="4709" LastActivityDate="2014-09-06T09:48:32.947" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14658" PostTypeId="2" ParentId="14598" CreationDate="2014-09-07T05:53:34.223" Score="1" Body="&lt;p&gt;No, they should not be equivalent. In a way actually, both values are somewhat meaningless. While the annual interest rate is 10%, you can compound it not only every year, but also every month, every day, or even continuously. However, the formula &lt;strong&gt;$P\times(1+r)^t$ implies yearly compounding&lt;/strong&gt; and does not have too much meaning for fractional values of $t$: it is going to give you an exactly right answer for integer $t$s, and intermediate values for fractional $t$s.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So as you might have already suspected, you have found a slightly different alternative to partition, if you will, [the correct] yearly interest into the year's months. To make things simpler, let's look at year 1, rather than year 2 which has the added complication of &lt;em&gt;Interest on Yr 1 interest&lt;/em&gt; etc.: note that an alternative to your Column M [Cumulative Capital Account] could have simply been again $P\times(1+r)^t$ - and you would have gotten the same \$0.37, \$0.64, \$0.88, etc. differences that you noticed for Year 2. Thus demonstrating on Year 1 would be valid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your calculations, &lt;strong&gt;you make an implicit assumption that January is equivalent to December&lt;/strong&gt;: both have 31 days and both yield \$8.49 in interest. This is not exactly wrong but this is not how this formula is supposed to be used. You are actually saying something like, &quot;the yearly interest is \$100 on \$1000, so a 31-day month should yield $\frac{31}{365}$ of that interest - whether it is in the beginning or at the end of the period. Hence the accrual is linear with time: depends on the &lt;em&gt;number&lt;/em&gt; of days, but not &lt;em&gt;where in the year&lt;/em&gt; these days are.&quot; Conversely, the power function &lt;strong&gt;$(1+r)^t$ increases faster with larger values of $t$&lt;/strong&gt;: so it might be trying to tell you that December should yield more interest (call it implicit compounding if you wish): in fact, this power function increases only \$8.13 in January, but \$8.87 in December.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's hard to see because the differences are so small. But let's imagine a more extreme example, with an annual interest rate of 100%:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/aQNxc.jpg&quot; alt=&quot;Two ways to partition yearly interest over the months&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the difference between the two partitions increases to more than $85 mid-year - but vanishes at year-end. Note the linearity of the &quot;Fraction of yearly interest&quot; approach in Year 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. You have misused the term &lt;em&gt;variance&lt;/em&gt; in the spreadsheet - should be &lt;em&gt;difference&lt;/em&gt;  (one has to be very careful with mathematical terminology).&lt;/p&gt;&#xA;" OwnerUserId="11791" LastActivityDate="2014-09-07T05:53:34.223" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14660" PostTypeId="1" CreationDate="2014-09-07T15:08:40.117" Score="3" ViewCount="730" Body="&lt;p&gt;I'm just starting a pricing class and am a little confused by a statement in a class reading (a fed report). It goes something like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;A bank borrowing at the 3-month LIBOR rate of 2.10&#xA;percent that enters into a swap to receive at the 3-month OIS&#xA;rate of 2 percent has a borrowing cost equal to the effective&#xA;federal funds rate plus 10 basis points.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure how does the fed funds rate come into the picture here. Is it assumed that the bank initially borrows the principal at fed funds rate and now has to pay a net 10 bps interest in this swap deal which adds up to a total effective borrowing cost of fed funds rate + 10 bps?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could someone please clarify? Any input would be appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="12000" LastActivityDate="2014-11-17T14:50:10.270" Title="Basic question on LIBOR-OIS swap" Tags="&lt;interest-rate-swap&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14661" PostTypeId="1" AcceptedAnswerId="14703" CreationDate="2014-09-07T17:46:50.257" Score="8" ViewCount="4181" Body="&lt;p&gt;I have a question about the function &lt;code&gt;Return.portfolio&lt;/code&gt;/&lt;code&gt;Return.rebalancing&lt;/code&gt; from the Performance Analytics package in R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I take the example described in the package:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; data(edhec)&#xA;&amp;gt; data(weights)&#xA;&amp;gt; Return.portfolio(edhec,weights = weights)&#xA;           portfolio.returns&#xA;2000-01-31      0.0115135339&#xA;2000-02-29      0.0218963077&#xA;2000-03-31      0.0093379014&#xA;2000-04-30      0.0037485690&#xA;2000-05-31      0.0056601357&#xA;2000-06-30      0.0140301727&#xA;2000-07-31      0.0043295816&#xA;2000-08-31      0.0190997787&#xA;2000-09-30      0.0014645727&#xA;2000-10-31      0.0014264155&#xA;2000-11-30      0.0061304707&#xA;2000-12-31      0.0201417025&#xA;2001-01-31      0.0150594011&#xA;2001-02-28      0.0066011872&#xA;2001-03-31      0.0131395159&#xA;2001-04-30      0.0007491561&#xA;2001-05-31      0.0091626407&#xA;2001-06-30     -0.0000527803&#xA;2001-07-31      0.0020738201&#xA;2001-08-31      0.0102713727&#xA;2001-09-30      0.0002531717&#xA;2001-10-31      0.0142380976&#xA;2001-11-30     -0.0048429083&#xA;2001-12-31      0.0061645640&#xA;2002-01-31      0.0093372403&#xA;2002-02-28     -0.0011217258&#xA;2002-03-31      0.0063415238&#xA;2002-04-30      0.0082130861&#xA;2002-05-31      0.0058782220&#xA;2002-06-30      0.0007565192&#xA;2002-07-31     -0.0059246865&#xA;2002-08-31      0.0072696705&#xA;2002-09-30      0.0026434591&#xA;2002-10-31      0.0014298494&#xA;2002-11-30      0.0105008400&#xA;2002-12-31      0.0127186414&#xA;2003-01-31      0.0159481947&#xA;2003-02-28      0.0092381495&#xA;2003-03-31      0.0001639493&#xA;2003-04-30      0.0113937775&#xA;2003-05-31      0.0199355028&#xA;2003-06-30      0.0020659339&#xA;2003-07-31     -0.0039260851&#xA;2003-08-31      0.0035691334&#xA;2003-09-30      0.0114224214&#xA;2003-10-31      0.0116788871&#xA;2003-11-30      0.0069773935&#xA;2003-12-31      0.0117366500&#xA;2004-01-31      0.0137408298&#xA;2004-02-29      0.0086731496&#xA;2004-03-31      0.0030241495&#xA;2004-04-30     -0.0031369461&#xA;2004-05-31     -0.0006375207&#xA;2004-06-30      0.0039463036&#xA;2004-07-31      0.0010463350&#xA;2004-08-31      0.0022005523&#xA;2004-09-30      0.0065116125&#xA;2004-10-31      0.0042086646&#xA;2004-11-30      0.0164591318&#xA;2004-12-31      0.0094498415&#xA;2005-01-31      0.0030113644&#xA;2005-02-28      0.0103238498&#xA;2005-03-31      0.0008083756&#xA;2005-04-30     -0.0052241413&#xA;2005-05-31      0.0020622011&#xA;2005-06-30      0.0081079582&#xA;2005-07-31      0.0118744372&#xA;2005-08-31      0.0073621313&#xA;2005-09-30      0.0101843734&#xA;2005-10-31     -0.0012149988&#xA;2005-11-30      0.0076005987&#xA;2005-12-31      0.0089111835&#xA;2006-01-31      0.0193600000&#xA;2006-02-28      0.0050290768&#xA;2006-03-31      0.0122895863&#xA;2006-04-30      0.0161541728&#xA;2006-05-31      0.0028728086&#xA;2006-06-30      0.0008591674&#xA;2006-07-31      0.0029350825&#xA;2006-08-31      0.0061800530&#xA;2006-09-30      0.0020263120&#xA;2006-10-31      0.0128266559&#xA;2006-11-30      0.0129600658&#xA;2006-12-31      0.0126486355&#xA;2007-01-31      0.0106456451&#xA;2007-02-28      0.0105816673&#xA;2007-03-31      0.0082080685&#xA;2007-04-30      0.0120657529&#xA;2007-05-31      0.0130340469&#xA;2007-06-30      0.0054403426&#xA;2007-07-31     -0.0001698053&#xA;2007-08-31     -0.0096513313&#xA;2007-09-30      0.0156251014&#xA;2007-10-31      0.0171940678&#xA;2007-11-30     -0.0113391902&#xA;2007-12-31      0.0030447149&#xA;2008-01-31     -0.0120408215&#xA;2008-02-29      0.0045617517&#xA;2008-03-31     -0.0188804492&#xA;2008-04-30      0.0121140702&#xA;2008-05-31      0.0127356881&#xA;2008-06-30     -0.0003266534&#xA;2008-07-31     -0.0118233426&#xA;2008-08-31     -0.0064733095&#xA;2008-09-30     -0.0478450597&#xA;2008-10-31     -0.0630740252&#xA;2008-11-30     -0.0354050961&#xA;2008-12-31     -0.0046962342&#xA;2009-01-31      0.0089404911&#xA;2009-02-28     -0.0027223978&#xA;2009-03-31      0.0050820481&#xA;2009-04-30      0.0229829814&#xA;2009-05-31      0.0374323984&#xA;2009-06-30      0.0111071893&#xA;2009-07-31      0.0255805068&#xA;2009-08-31      0.0179835194&#xA;Warning message:&#xA;In Return.portfolio(edhec, weights = weights) :&#xA;  number of assets in beginning_weights is less than number of columns in returns, so subsetting returns.&#xA;&amp;gt; sum(as.numeric(edhec[151,1:11])*as.numeric(weights[8,]))&#xA;[1] 0.02614121&#xA;&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How are these returns calculated using &lt;code&gt;Return.portfolio&lt;/code&gt;? In weights are two column missing compared with edhec. That's the reason why I took &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;edhec[151,1:11]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Moreover, we see that weights is a &lt;code&gt;xts&lt;/code&gt; object with just 8 rows. Does &lt;code&gt;Return.portfolio&lt;/code&gt; check the dates and take the right weights for that period? Moreover, what is the difference to &lt;code&gt;Return.rebalancing&lt;/code&gt;? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it correct, that if we would sum up the first 10 elements of&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Return.portfolio(edhec,weights = weights)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;we would get the total return at time $t=10$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reference: the software package in use is R programming language is used for data analysis and visualization including statistics and graphics.  R is an integrated suite of software facilities for data manipulation, calculation and graphical display.  The R project is Open Source, available at &lt;code&gt;http://www.r-project.org/&lt;/code&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, the R statistical program has a considerable repository of projects available to the whole community, available at &lt;code&gt;https://r-forge.r-project.org/&lt;/code&gt;  One of the projects is &lt;strong&gt;ReturnAnalytics&lt;/strong&gt; -- Performance and risk analysis of financial time series, including packages PerformanceAnalytics and PortfolioAnalytics.  That project is available via anonymous access: &lt;code&gt;svn checkout svn://svn.r-forge.r-project.org/svnroot/returnanalytics/&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="17133" LastEditorUserId="11995" LastEditDate="2014-09-08T13:46:38.483" LastActivityDate="2014-09-12T14:35:02.100" Title="How do Return.portfolio and Return.rebalancing work in Performance Analytics in R?" Tags="&lt;programming&gt;&lt;r&gt;&lt;returns&gt;&lt;portfolio&gt;" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14662" PostTypeId="2" ParentId="14560" CreationDate="2014-09-07T19:44:40.420" Score="1" Body="&lt;p&gt;A stock's returns are also correlated to the performance of the ETFs or Index Funds that include that stock; for example, if you look at returns for MSFT (Microsoft), you might want to look at the performance of QQQ as well.&lt;/p&gt;&#xA;" OwnerUserId="11874" LastActivityDate="2014-09-07T19:44:40.420" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14664" PostTypeId="2" ParentId="14421" CreationDate="2014-09-07T21:06:49.443" Score="1" Body="&lt;p&gt;It is not normal, for swaptions, your prices should be perfect or you open yourself up to arbitrage. Is Bloomberg calculating the swaptions with dual-curve stripping/bootstrapping? SWDF DFLT has a setting for that.  If you are assuming in your model that your discount curve is the same as your forward rates curve, but Bloomberg is doing proper post-2006 OIS discounting, that could explain the discrepancy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you cannot replicate the swaptions prices and you are using this model for any sort of real hedging, you are setting yourself up for trouble. &lt;/p&gt;&#xA;" OwnerUserId="3491" LastActivityDate="2014-09-07T21:06:49.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14667" PostTypeId="2" ParentId="14640" CreationDate="2014-09-08T07:09:17.590" Score="1" Body="&lt;p&gt;What you could do is to apply the methods of portfolio risk analysis.&#xA;If you buy $n$ stocks with percentages $w_i,i=1,\ldots,n$ then your portfolio return&#xA;is $r = \sum_{i=1}^n w_i r_i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dealing with investment strategies I would not include an expected profit in the VaR calculation and put $\mu=0$ for this reason. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To calculate the volatility of your portfolio you can do the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;calculate the covariance matrix of your assets on the past $N$ (e.g. 60) days, $\Sigma$&lt;/li&gt;&#xA;&lt;li&gt;caclulate portfolio ex-ante volatility by $\sigma = \sqrt{w \Sigma w^T}$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You ca plug this $\sigma$ into your formula and proceed. &#xA;This is the basis set-up, assumptions about the dependence of the assets or the distributions of asset returns can improve the risk analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IMPORTANT addon:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the formulae above are valid for negative weigths too. All you have to do is to determine a cash basis from which you calculate the weights. Say you have $50 000$ cash, buy a stock for $25 000$ and sell one for $25 000$ then you have $100\%$ cash and weights of $+50\%$ and $-50\%$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2014-09-08T08:30:59.487" LastActivityDate="2014-09-08T08:30:59.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14668" PostTypeId="1" CreationDate="2014-09-08T10:35:46.103" Score="1" ViewCount="29" Body="&lt;p&gt;I'm trying to estimate a logit model on pooled panel data set (unit of observation is firm-year). My dependant variable is default indicator and I have several macro variables as independant variables. These are going to be identical for all firms in a given year, so i need something to correct for this effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I saw that one can use Huber sandwich estimate or Fama MacBeth standard errors. I'm using Newton-Raphson to run MLE. If I go with Huber sandwich estimator, should I use it in stead of standard Hessian in the NR algorythm? On the other hand, since Fama MacBeth approach was developed for OLS, is it possible to use the same approach with MLE?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If anyone has hands-on experience with these issues, any thought would be much appreciated.&lt;/p&gt;&#xA;" OwnerUserId="12007" LastActivityDate="2014-09-08T10:35:46.103" Title="Standard errors clustered along the time dimension in pooled panel logit model" Tags="&lt;risk-management&gt;&lt;optimization&gt;&lt;regression&gt;&lt;econometrics&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14669" PostTypeId="2" ParentId="14653" CreationDate="2014-09-08T11:50:26.523" Score="4" Body="&lt;p&gt;The formation of asset price bubbles, such as the recent US housing market bubble, is perhaps the clearest indication that markets are not efficient. Hundreds of bubbles have been documented for all kinds of traded assets; see the &lt;a href=&quot;http://en.wikipedia.org/wiki/Tulip_mania&quot; rel=&quot;nofollow&quot;&gt;tulip mania&lt;/a&gt; for an extreme case. Many practitioners also routinely use trading strategies such as momentum or reversion to the mean, which are incompatible with the efficient market hypothesis in any form.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Grossman and Stiglitz argued that markets &lt;em&gt;cannot&lt;/em&gt; be informationally efficient because if they were, nobody would have any incentive to gather information and trade on it. The G&amp;amp;S paper was titled &quot;On the Impossibility of Informationally Efficient Markets&quot;.&#xA;There is also plenty of other academic work which challenges the EMH, for example Robert Shiller's for which he received the 2013 Nobel prize in economics. &lt;/p&gt;&#xA;" OwnerUserId="6721" LastActivityDate="2014-09-08T11:50:26.523" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14670" PostTypeId="2" ParentId="14653" CreationDate="2014-09-08T12:58:36.890" Score="1" Body="&lt;p&gt;this is just theory, don't take it as serious, theory it's just take on approximation of reality and in this case not good one, people trade to check that strategy is profitable or trade because they think it will profitable, besides that you have many other spaces on what people compete with each other in this game&lt;/p&gt;&#xA;" OwnerUserId="6175" LastActivityDate="2014-09-08T12:58:36.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14671" PostTypeId="1" CreationDate="2014-09-08T14:47:49.107" Score="-1" ViewCount="187" Body="&lt;p&gt;With the conservative approach, we choose the decision which maximises minimum payoff. I was wondering which decision is chosen if 2 decisions have equal minimum payoff (which is the maximum)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="12008" LastActivityDate="2015-01-07T17:19:08.123" Title="conservative approach payoff table" Tags="&lt;quant-trading-strategies&gt;&lt;risk-management&gt;&lt;payoff&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14672" PostTypeId="1" CreationDate="2014-09-08T19:28:54.777" Score="3" ViewCount="511" Body="&lt;p&gt;I came across some literature regarding &quot;Framing Theory&quot; or &quot;Prospect Theory&quot;, and the validity of CAPM. I was wondering if you could shed some light on a few questions I have in this regard:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to this theory, people place much more weight on the outcomes that are perceived more certain than that are considered more probable. Investors also prefer dollar gain over dollar loss, and are also affected by “framing effect”: the way a problem is posed to the decision maker.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I am assuming that under this theory, the utility curve would no longer be concave, but rather convex-concave (convex in losses and concave in gains). Therefore, is the CAPM still valid under this assumption? If not, how could we rewrite CAPM with these assumptions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help or brainstorming would be appreciated! Thanks!&lt;/p&gt;&#xA;" OwnerUserId="5896" LastActivityDate="2016-06-17T10:29:24.857" Title="Validity of CAPM" Tags="&lt;equities&gt;&lt;capm&gt;&lt;economics&gt;&lt;asset-pricing&gt;&lt;utility-theory&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14673" PostTypeId="2" ParentId="14672" CreationDate="2014-09-08T20:53:24.670" Score="1" Body="&lt;p&gt;The general problem of the investor is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \max_{w\in[0,1]^n} U(\mu_p(w),\sigma_p(w))\quad s.t. \sum_{i=1}^n w_i=1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $w$ being the portfolio weights, and $U$ utility function of portfolio risk $\sigma_p$ and return $\mu_p$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CAPM assumes investors with concave utility function $U=\mu_p-\frac{1}{2}\sigma_p^2$, from which then follows that all investors mix the market portfolio with the riskfree asset according to their desired minimum risk/maximum return level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe using a different nonconcave utility function would indeed change the model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a paper on the necessary conditions for the CAPM utility function &lt;a href=&quot;http://www.gsb.stanford.edu/sites/gsb/files/publication-pdf/Necessary%20Conditions%20for%20the%20CAPM.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; which states:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/i5Eeu.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-10-09T12:03:44.860" LastActivityDate="2014-10-09T12:03:44.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14674" PostTypeId="1" CreationDate="2014-09-08T22:55:30.083" Score="2" ViewCount="771" Body="&lt;p&gt;I'm working on an empirical analysis where I try to predict stock returns using weekly data. Ideally, I would like to use a panel data model like the following: &#xA;$$&#xA;Y_{it}=X_{it}'\beta+\varepsilon_{it}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(here presented in a very simple format - it will be more complex in the analysis)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here $Y_{it}$ is a vector of weekly returns and $X_{it}$ is a vector of explanatory variables with coefficients vector $\beta$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in much of the empirical literature this is not the standard approach. Standard approach involves the sorting of stocks into different portfolios and using portfolio formation strategies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Why is the portfolio approach the standard approach?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) What are the caveats from using a panel data model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Can explanatory variables typically found in the literature on the prediction of stock returns (e.g. size, P/E ratio, P/B ratio and momentum for each company) also be used in a panel data model?&lt;/p&gt;&#xA;" OwnerUserId="7078" LastActivityDate="2014-09-09T15:29:48.837" Title="Predicting stock returns - in a panel data specification or by using portfolio formation strategies?" Tags="&lt;equities&gt;&lt;returns&gt;&lt;portfolio&gt;&lt;estimation&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14677" PostTypeId="1" CreationDate="2014-09-09T09:59:19.080" Score="0" ViewCount="200" Body="&lt;p&gt;The P/E-ratio is defined as &#xA;$$&#xA;\frac{\text{Market value per share}}{\text{Earnings per share (EPS)}}&#xA;$$&#xA;I have weekly observations of stock prices, but what measure should I use for EPS? Should it for example be the EPS of the previous 12 months? What is the typical approach?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;References to journal papers computing weekly P/E-ratios are very welcome.&lt;/p&gt;&#xA;" OwnerUserId="7078" LastActivityDate="2014-09-11T09:29:34.297" Title="Calculation of weekly P/E ratio" Tags="&lt;equities&gt;&lt;calculation&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14678" PostTypeId="2" ParentId="14677" CreationDate="2014-09-09T11:44:25.943" Score="1" Body="&lt;p&gt;I strongly recommend reading an undergraduate finance textbook like Investments by Bodie, Kane, and Marcus. Your methodology may be limited by your data. For example, using forward P/E requires next fiscal year's EPS estimates. NTM (next twelve months) requires quarterly EPS estimates. If you do not have estimates, the best method is TTM (trailing twelve months). For longer time horizons, you may want to look at CAPE (cyclically adjusted P/E).&lt;/p&gt;&#xA;" OwnerUserId="232" LastActivityDate="2014-09-09T11:44:25.943" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14679" PostTypeId="1" CreationDate="2014-09-09T12:45:46.507" Score="2" ViewCount="534" Body="&lt;p&gt;I was wondering if anyone has come across a more straightforward derivation of the semi-closed form solution for the price of a european call under the Heston model than the one proposed by Heston (1993) ?&lt;/p&gt;&#xA;" OwnerUserId="8105" LastActivityDate="2015-01-29T09:04:14.130" Title="Option Prices under the Heston Stochastic Volatility Model" Tags="&lt;stochastic-volatility&gt;" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14681" PostTypeId="2" ParentId="14671" CreationDate="2014-09-09T15:15:44.857" Score="0" Body="&lt;p&gt;Problematic is already the use of the words &quot;conservative&quot; and &quot;minimum&quot;. There is no absolute minimum, worst case (in continuous models, i.e. reality), as things can always get worse than they have ever been before and than anybody anticipated. &#xA;Depending on where one defines the minimum, there can always be an even more conservative investor in the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given your tags, let me say that in quantitative areas like portfolio management, if we compare two strategies, e.g. portfolios, for which one risk measure gives equal minimum payoff, then we may apply another risk measure and choose the portfolio which scores better in this risk measure. For example, if a conservative investor considers the robust portfolios with maximized 10%-quantile of weekly returns, and two portfolios are equally good in this measure, he may turn to the one that offers better median returns. &lt;/p&gt;&#xA;" OwnerUserId="1817" LastActivityDate="2014-09-09T15:15:44.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14682" PostTypeId="2" ParentId="14674" CreationDate="2014-09-09T15:29:48.837" Score="2" Body="&lt;p&gt;Both approaches can be useful. For stocks, sorting into quantiles is popular because&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;it's easy to understand and explain&lt;/li&gt;&#xA;&lt;li&gt;it's a simple matter to build factor portfolios and track or backtest their performance, while the translation from expected returns to a portfolio is a bit more involved&lt;/li&gt;&#xA;&lt;li&gt;more robust than a single-stock regression, because it is less affected by stock-specific effects which make a predictive regression very noisy&lt;/li&gt;&#xA;&lt;li&gt;avoids the rigidity of a linear model, which is a good idea because there are sometimes interesting 'outlier effects' in the first and last quantiles&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Regarding your second and third question: there are  sector- and country-specific effects (e.g. the valuation of technology vs. finance stocks) which will be important. In a weekly model, the variables size, P/E and P/B will often only vary with 'P', which limits their use as independent variables.&lt;/p&gt;&#xA;" OwnerUserId="6721" LastActivityDate="2014-09-09T15:29:48.837" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14683" PostTypeId="1" CreationDate="2014-09-09T15:41:22.147" Score="0" ViewCount="1241" Body="&lt;p&gt;I am facing a problem where I suppose an expense in 6 months from now of 2,500USD. My home currency shall be EUR, and I am trying to hedge given the following information.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Spot exchange rate: (USD/EUR) 1.3195&#xA;6m forward rate: 1.3000&#xA;Euro 6m IR: 2.8%&#xA;U.S. 6m IR: 1.5%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;First, does the euro trade at a premium against the dollar? - I think it trades at a discount, as we have the arbitrage opportunity to borrow EUR, invest in Europe and swap back to USD in 6m from now. - but how exactly do I calculate and quantify the &quot;premium&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next, &quot;calculate the future cost of 2,500USD if you hedge now using the forward contract&quot;. My idea is: $\frac{2,500}{1.3}$ to get the EUR cost in 6m. But will I still have to divide by 2.8% to get the current cost?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, construct a synthetic forward hedge. Calculate the future EUR cost of hedging now with the synthetic forward, and give the theoretical forward rate. Unfortunately, I have no idea on this. The synthetic forward works close with the put-call-parity, but I see no way to construct put or call option from the above data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, calculate the expected euro cost in 6m if you do not hedge anything. - This means I have to calculate the expected future spot rate. Am I correct with using &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$x=1.3195 \cdot \frac{1+0.015}{1+0.028}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to keep the IRP up? (Can we assume IRP?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, would we refer to the uncertainty in the value of future cash flows due to exchange rate fluctuations, as above, as exchange (rate) risk, or broadly transaction risk? Is there a generally accepted definition of transaction risk?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best,&#xA;Marie.&lt;/p&gt;&#xA;" OwnerUserId="1817" LastEditorUserId="1817" LastEditDate="2014-09-09T15:47:29.800" LastActivityDate="2014-09-10T17:33:17.870" Title="Hedging future USD cost using different IR and forwards" Tags="&lt;interest-rates&gt;&lt;hedging&gt;&lt;forward&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14684" PostTypeId="1" CreationDate="2014-09-09T16:11:41.580" Score="1" ViewCount="286" Body="&lt;p&gt;I am in the first semester of a MS in mathematics. A requirement for the degree is to write a masters thesis. Here a thesis means writing on a current area of research in finance, but an original contribution is not expected (although encouraged when possible.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are no professors at my university who research in quantitative finance. I am allowed to write a thesis on quantitative finance, but I was told that I would have to find the &quot;problem&quot; on my own to research.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question is, how can one find an area of quantitative finance or problem to study that is appropriate at this level to write a thesis on? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, how does one know what has already been &quot;done&quot;? For instance, I was reading about Fast Fourier Transforms and their relation to finance. I was considering extending the NVIDIA CUDA Fast Fourier Transform Library for finance applications. But I imagine this and many other things have already been tackled already.&lt;/p&gt;&#xA;" OwnerUserId="5641" LastActivityDate="2014-09-10T06:39:43.943" Title="How can one find an area of research in quantitative finance appropriate to write a masters thesis on?" Tags="&lt;research&gt;" AnswerCount="2" CommentCount="0" ClosedDate="2014-09-10T10:20:59.783" ContentLicense="CC BY-SA 3.0" />
  <row Id="14685" PostTypeId="1" AcceptedAnswerId="14690" CreationDate="2014-09-09T18:20:40.513" Score="1" ViewCount="63" Body="&lt;p&gt;I have some question about MPT. Suppose we want to build a portfolio given $N$ assets: $A_1,\dots,A_N$. At time $t$ we build the portfolio using MPT, which yields some weight vector $w_t=(\lambda_1,\dots,\lambda_N)$, with $\sum_i\lambda_i = 1$. At time $t$, we have an initial capital $K_t$ and the asset prices are given by $S^1_t,\dots,S^N_t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, given the weights $w_t$ which fraction of asset $i$ do I have to buy such that the portfolio is correctly built due to the MPT? In a first step, and for simplicity, we assume one can buy any fraction of an asset. Therefore I would build the portfolio as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{S^1_t}{\lambda_1K}$ of asset $A_1$, $\frac{S^2_t}{\lambda_2K}$ of asset $A_2 \dots$ and $\frac{S^1_t}{\lambda_NK}$ of asset $A_N$. Is that correct?&#xA;How are these things usually done in reality?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, assuming we have the classical optimization problem&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\min\{w^T\Sigma w-qR^Tw\}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $R$ is the expected return of the assets and the $\Sigma$ the covariance matrix given the constraint&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sum w_i = 1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems to me that the initial capital does not matter? Or how can the initial capital be linked to into the constraints?&lt;/p&gt;&#xA;" OwnerUserId="17133" LastActivityDate="2014-09-10T04:59:35.473" Title="MPT and the connection to asset prices / initial capital" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14686" PostTypeId="2" ParentId="14684" CreationDate="2014-09-09T19:42:20.997" Score="4" Body="&lt;p&gt;I can tell you what I did for my undergraduate thesis (which was a required component on my degree in Mathematics.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I picked a paper on option pricing which gave, as a main result, the closed for solution for the price of an American and Asian Put Option. My contribution was to apply the Fourier Transform to the initial equation in order to simplify the problem and then use the Method of Characteristics to get a solution. This way I could compare my solution to theirs and figure out whether I was right or not. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In essence, I took an existing and already &quot;solved&quot; problem and decided to tackle it in a different way (by using the Fourier Transform) and using a different technique to solve it (the Method of Characteristics.) Maybe this kind of approach could work for you as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps and good luck!&lt;/p&gt;&#xA;" OwnerUserId="11874" LastActivityDate="2014-09-09T19:42:20.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14687" PostTypeId="1" CreationDate="2014-09-09T20:03:18.177" Score="0" ViewCount="327" Body="&lt;p&gt;Where can I find historical data for option prices on a given index ? Ideally I'd like to find for a period of several months&#xA;1) historical prices on options on a given index&#xA;2) historical prices on options on the components of this index&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Potential for an index that doesn't have too many components&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a website where this data is easily available ? Thanks!&lt;/p&gt;&#xA;" OwnerUserId="1242" LastActivityDate="2014-09-09T21:20:58.253" Title="Finding historical data for indices" Tags="&lt;data&gt;&lt;market-data&gt;&lt;index&gt;&lt;basket&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2014-09-09T23:29:14.550" ContentLicense="CC BY-SA 3.0" />
  <row Id="14688" PostTypeId="2" ParentId="14687" CreationDate="2014-09-09T21:20:58.253" Score="3" Body="&lt;p&gt;&lt;a href=&quot;https://www.cboe.com/DelayedQuote/QuoteTable.aspx&quot; rel=&quot;nofollow&quot;&gt;CBOE&lt;/a&gt; has something with limited capacity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://finance.yahoo.com/q/op?s=MSFT%20Options&quot; rel=&quot;nofollow&quot;&gt;Yahoo Finance&lt;/a&gt; also gives the current option chain.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But historical option data is not free. The most affordable I saw is &lt;a href=&quot;https://www.historicaloptiondata.com/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. I don't know about its validity but their structure seems good and almost clean. More importantly, data seems reliable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;p.s. I am not sure if providing the paid data link is within T&amp;amp;C of this site (if it is please immediately delete this post). But, as an academic studying on options, I am sharing the link mainly because finding affordable and quality data on options is almost impossible even for research purposes.&lt;/p&gt;&#xA;" OwnerUserId="8147" LastActivityDate="2014-09-09T21:20:58.253" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14689" PostTypeId="1" CreationDate="2014-09-10T02:12:46.387" Score="12" ViewCount="795" Body="&lt;p&gt;I asked this question in &lt;a href=&quot;https://math.stackexchange.com/questions/895985/filtration-and-measure-change&quot;&gt;math stackexchange&lt;/a&gt; but to no avail. So i'm trying the luck here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm reading Steven E. Shreve's &quot;Stochastic calculus for finance II&quot;, and find myself not really understand the concept of &quot;filtration&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yes, the definition of filtration is straight forward, it's set of $\sigma$-algebra. However, when it comes to the Martingale Representation and Girsanov Theorem below, I'm lost on the different of a filtration generated by the Brownian motion or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First it's &lt;strong&gt;Theorem 5.3.1 (Martingale representation, one dimension)&lt;/strong&gt;:&#xA;Let $W(t)$, $0 \leq t \leq T$, be a Brownian motion on a probability space $(\Omega,\mathscr F, \mathbb P)$, and let $\mathscr F(t)$, $0 \leq t \leq T$, be the filtration generated by this Brownian motion. Let $M(t)$, $0 \leq t \leq T$, be a martingale with respect to this filtration (i.e., for every $t$, $M(t)$ is $\mathscr F(t)$-measurable and for $0 \leq s \leq t \leq T$, $\mathbb E [M(t) | \mathscr F(s)] = M(s)$). &#xA;Then there is an adapted process $\Gamma(u)$, $0 \leq u \leq T$, such that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$M(t) = M(0) + \int_0^t \Gamma(u) d W(u), 0 \leq t \leq T \tag{5.3.1} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then Shreve says, &quot;&#xA;&lt;em&gt;The assumption that the filtration in Theorem 5.3.1 is the one generated &#xA;by the Brownian motion is more restrictive than the assumption of Girsanov's &#xA; Theorem, Theorem 5.2.3, in which the filtration can be larger than the one &#xA;generated by the Brownian motion&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;If we include this extra restriction in Girsanov's Theorem, then we obtain the following corollary. The first paragraph &#xA;of this corollary is just a repeat of Girsanov's Theorem; the second part contains the new assertion&lt;/em&gt;&quot; (the bold part &quot;the filtration generated by this Brownian motion&quot; I highlighted below, is the difference comparing to original Girsanov Theorem 5.2.3):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Corollary 5.3.2&lt;/strong&gt;. Let $W(t)$, $0 \leq t \leq T$, be a Brownian motion on a probability &#xA;space $(\Omega,\mathscr F, \mathbb P)$, and let $\mathscr F(t)$, $0 \leq t \leq T$, be &lt;strong&gt;the filtration generated by this &#xA;Brownian motion&lt;/strong&gt;. Let $\Theta(t)$, $0 \leq t \leq T$, be an adapted process, define &#xA;$Z(t) = \exp\left\{ - \int_0^t \Theta(u) d W(u) - \frac{1}{2} \int_0^t \Theta^2(u) d u \right\}$, &#xA;$\widetilde W(t) = W(t)+ \int_0^t \Theta(u) d u$, and assume that $\mathbb E \int_0^T \Theta^2(u) d u &amp;lt; \infty$. Set $Z = Z(T)$. Then $\mathbb E Z = 1$, and &#xA;under the probability measure $\widetilde P$ given by &#xA;$$\widetilde P(A) = \int_A Z(\omega) d P(\omega), \forall A \in \mathscr F \tag{5.2.1}$$&#xA;, the process $\widetilde W(t)$, $ 0 \leq t \leq T$, is a Brownian motion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let $\widetilde M(t)$, $0 \leq t \leq T$, be a martingale under $\widetilde{\mathbb P}$. Then there is an &#xA;adapted process $\widetilde \Gamma(u)$, $0 \leq u \leq T$, such that &#xA;$$\widetilde M(t) = \widetilde M(0) + \int_0^t \widetilde \Gamma(u) d \widetilde W(u), 0 \leq t \leq T. \tag{5.3.2}$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Shreve says: &quot;*Corollary 5.3.2 is not a trivial consequence of the Martingale Representation Theorem, Theorem 5.3.1, with $\widetilde W(t)$ replacing $W(t)$ because the filtration &#xA;$\mathscr F(t)$ in this corollary is generated by the process $W(t)$, not the $\widetilde P$-Brownian &#xA;motion $\widetilde W(t)$&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem is I could not visualize why the difference matters? I could not understand, if $\widetilde{\mathbb P}$ is defined based on $\mathbb P$, how different could they be?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any example that could explain why Shreve &quot;makes a big fuzz&quot; here?&lt;/p&gt;&#xA;" OwnerUserId="2161" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2014-09-13T03:21:18.037" Title="Filtration and measure change" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;" AnswerCount="2" CommentCount="7" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14690" PostTypeId="2" ParentId="14685" CreationDate="2014-09-10T04:27:47.380" Score="3" Body="&lt;p&gt;&lt;strong&gt;Initial capital is not a real constraint in theoretical analysis, but might be a practical constraint in reality.&lt;/strong&gt; &#xA;The objective function you gave defines the efficient frontier corresponding to a given risk tolerance $q \in [0, \infty]$:&#xA;$$\min\{w^T\Sigma w-qR^Tw\}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This criterion is among the other popular optimization criteria, such as minimum variance, maximum Sharpe ratio, etc. By solving these functions numerically, we can obtain the optimal weights, $ W$, subject to the unity constraint $\sum w_i =1 $. In a frictionless theoretical world, assuming total capital of $K$, one will thus allocate capital $K * w_i $ to asset i, which will translates to the $q_i$ shares to purchase in order to achieve MPT portfolio: &#xA;$$q_i =  \frac{K * w_i }{S_i} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in reality, this number is rarely round number. Since floating number of shares cannot be purchased from standard market, one must apply truncation or rounding operations to the optimization results.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;There are certain situations when initial capital does matter.&lt;/strong&gt; In these cases, one should then pull the capital constraints in to the optimization procedure:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) It matters when initial capital is too small, such that individual allocation is significantly impacted by rounding and truncation. For portfolio with infinite capital, these rounding effect can be neglected. However, for a small portfolio, truncation operations may lead to substantial impact. For example, for a futures contract, the minimum contract value is usually in the range of 100K dollars. In this case, a small portfolio with total capital of 200K may not be able to allocate capital efficiently without deviating from the  optimization results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) When initial capital is too large, such that individual allocation can substantially move the market and cause liquidity concerns. In this case, one should supply a maximum capital allocation constraints to selected assets.  &lt;/p&gt;&#xA;" OwnerUserId="9381" LastEditorUserId="9381" LastEditDate="2014-09-10T04:59:35.473" LastActivityDate="2014-09-10T04:59:35.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14691" PostTypeId="2" ParentId="14684" CreationDate="2014-09-10T06:39:43.943" Score="3" Body="&lt;p&gt;I am at the beginning of my graduate research in the area of finance, and have a Bachelor's degree in mathematics. A first approach would be to look for the right keywords in databases, such as Jstor or SSRN, but it may be a bit difficult to find quantitative topics in the latter at least.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is not necessary to first look for what has been done. If the paper needs not to be original (though encouraged), replicating other results with new datasets or different methods (as g_puffo suggested) is also a valid option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should first comb through current literature and see which topic or field of research interests you more than others, and a fitting topic suitable for a thesis will arrive by itself.&lt;/p&gt;&#xA;" OwnerUserId="1817" LastActivityDate="2014-09-10T06:39:43.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14692" PostTypeId="2" ParentId="14677" CreationDate="2014-09-10T10:56:27.057" Score="1" Body="&lt;p&gt;I think you are confusing the goal with the means. The calculation of the PE is not the goal, the true goal is assessing whether a particular stock is an interesting investment opportunity (cheap) under an investment thesis (set of hypotheses).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, there is an infinite number of ways to calculate PE ratios, as a results of a set of different assumptions as well as a result of an infinite adjustments deemed necessary by the analyst (removing the contribution of one-off items, for example). This also explains why the definition of PE ratio, as per textbooks, is not really &quot;precise&quot; as you may otherwise expect coming from a more technical background.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is hard to recommend a PE calculation methodology without knowing your investment thesis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe that even under a panel data model framework the choice of PE should be motivate and interpreted through a fundamental approach. Let me make a couple of examples:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Trailing 12M PE and Last FY: backward looking metrics tend to favor an &quot;as-it-is&quot; approach, ie assuming company bottom line might not change. Does the market &quot;revalues&quot; current bottom lines? What is the pattern there? &lt;/li&gt;&#xA;&lt;li&gt;Forward looking PE metrics: How far does the market look? 1-qr, 1-yr and 2-yr growth assumptions might offer different performances, although probably correlated as intuition suggests. @ProbablyPattern suggests the use of CAPE, it is a great hint.&lt;/li&gt;&#xA;&lt;li&gt;Sector rotation: different PE metrics might offer different performance in different industries and sectors. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Bottom Line:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Different PEs might try to capture different market dynamics. You might even try to combine a few metrics - For example backward looking PEs and EPS growth expectations&lt;/li&gt;&#xA;&lt;li&gt;I guess it is important to understand what the choice of PE implies    &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="6781" LastEditorUserId="6781" LastEditDate="2014-09-11T07:14:37.917" LastActivityDate="2014-09-11T07:14:37.917" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14694" PostTypeId="2" ParentId="14661" CreationDate="2014-09-10T14:36:58.833" Score="3" Body="&lt;p&gt;I found out that the upper time series is the result of a call&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    &amp;gt; tail(Return.rebalancing(edhec,weights))&#xA;           portfolio.returns&#xA;2009-03-31       0.005082048&#xA;2009-04-30       0.022982981&#xA;2009-05-31       0.037432398&#xA;2009-06-30       0.011107189&#xA;2009-07-31       0.025580507&#xA;2009-08-31       0.017983519&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(by optical comparison. ;-) )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A glance into the code reveals that the outpout is a result of successive calls (for loop) to &lt;code&gt;Return.portfolio()&lt;/code&gt;, each taking as input the return timeseries between two different dates and the &lt;code&gt;weight&lt;/code&gt; vector corresponding to the starting date of the time interval.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;In short:&lt;/em&gt; It creates a time series of a rebalanced portfolio where the rebalancing dates and weights are given by &lt;code&gt;weights&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thats how the returns are calculated by &lt;code&gt;Return.portfolio()&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, for the two additional columns issue I found out, that  &lt;code&gt;Return.portfolio()&lt;/code&gt; has a line where it selects the right columns, effectively doing something like &lt;code&gt;edhec[,colnames(weights[1,])]&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2014-09-10T14:36:58.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14695" PostTypeId="2" ParentId="9022" CreationDate="2014-09-10T17:06:40.907" Score="5" Body="&lt;p&gt;I used to work in OTC, many of the deals would be so individual I can't imagine an algorithm being able to cope. In addition there were some extra factors like how we feel towards a counterparty and sometimes the broker over whether we would step in or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I now work in exchange traded futures and options (listed options), and I can say the number one reason there is not more market-making by algos is Risk. By risk I mean risk of a error, risk of an event happening when you might have quotes in hundreds of instruments and liquidity risk. It's one thing to quote a couple of liquid markets, and the underlying's for the options might well be very liquid, but there's much more risk of an expensive mistake in exopts with the number of quotes one would have to have in the market. Whether we like it or not algos do go wrong, we fail to foresee all the possible outcomes, situations change. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally it's worth considering what we're risking for, you could quote all day in some illiquid strikes and not see any business. In fact by quoting, especially if the market is really illiquid, all you're really doing is giving pricing information away for free.&lt;/p&gt;&#xA;" OwnerUserId="12020" LastActivityDate="2014-09-10T17:06:40.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14696" PostTypeId="2" ParentId="14683" CreationDate="2014-09-10T17:33:17.870" Score="1" Body="&lt;p&gt;My 10 cents: Yes, the EUR is trading at a discount to USD. Think 100 - 2.8 = 97.2 for EUR, whereas 100 - 1.5 = 98.5 for USD so EUR is at a discount to USD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The calculation of premium and discount is in the forward pips. In your case it's&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;spot - pips = forward  &#xA;1.3195 - 0.0195 = 1.3000&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So yes, the EUR cost in 6 months is &lt;code&gt;$2500 / 1.3 = €1923.07&lt;/code&gt; you agree today to pay €1923.07 in exchange for the $2500 in 6 months time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, there is no data given by the interest rates on the expected future spot rate. All you know is those are the interest rates. The spot rate is independent of the interest rates so you can't predict it. It's random.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think this then clears up the definition of the risks facing you. You remove spot risk by taking on the forward deal. Instead you're exposed to interest rate risks (less volatile than spot). I think transaction risk is more about credit i.e. will the counterparty actually pay in 6 months time? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have some training on FX/MM &lt;a href=&quot;http://www.webstersystems.co.uk/fxmm.htm&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. The interest arbitrage example may interest you :)&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2014-09-10T17:33:17.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14697" PostTypeId="1" AcceptedAnswerId="14699" CreationDate="2014-09-10T20:07:37.957" Score="3" ViewCount="3805" Body="&lt;p&gt;What is the difference between Base Correlation and Implied Correlation for a CDO tranche?&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-09-10T20:31:50.000" LastActivityDate="2014-09-15T14:49:55.503" Title="What is Base- vs. Implied Correlation of a CDO tranche?" Tags="&lt;correlation&gt;&lt;cds&gt;&lt;cdo&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14698" PostTypeId="2" ParentId="14689" CreationDate="2014-09-10T20:28:54.160" Score="5" Body="&lt;p&gt;You have $$\widetilde{W}_t=W_t+\int\Theta(u)du$$ which is in general not a Brownian motion, because it has a drift component.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But 5.3.1 states&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$M_t=M_0+\int \Gamma(u)dW_u\tag{5.3.1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;, which holds only for a Brownian motion $W$ (and $M_t$ martingale).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So one cannot trivially replace $W_t$ and $W_t+\int\Theta(u)du=\widetilde{W}_t$ in 5.3.2 aswell by setting&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\widetilde M_t = \widetilde M_0 + \int_0^t \widetilde \Gamma(u) d \widetilde W_u\tag{5.3.2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(because $\widetilde W_t$ is not in general a Brownian motion).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5.3.2 holds only under the special change of measure defined as $$Z_t = \exp\left\{ - \int_0^t \Theta(u) d W(u) - \frac{1}{2} \int_0^t \Theta^2(u) d u \right\}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then $\widetilde M$ is a martingale, and $\widetilde W$ becomes a Brownian motion (proof is not trivial).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But still the filtration of $W_t$ and $\widetilde{W}_t=W_t+\int\Theta(u)du$ is obviously different.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-09-10T20:28:54.160" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14699" PostTypeId="2" ParentId="14697" CreationDate="2014-09-11T03:53:05.330" Score="4" Body="&lt;p&gt;An implied correlation $\rho_i(k_1,k_2)$ is a correlation that matches the $(k_1,k_2)$ tranche price $P_{k_1}^{k_2}$ (usually computed under a gaussian or student t copula)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;C(k_1,k_2,\rho_i(k_1,k_2)) = P_{k_1}^{k_2}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For mezzanine tranches, there can sometimes be two different implied correlations matching the tranche price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A base correlation $b_i(k_2)$ is a correlation that matches the price of the tranche, plus all higher-risk tranches &quot;beneath&quot; it, so we can write it as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;b_i(k_2) = \rho_i(0,k_2)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where we obtain $P_{0}^{k_2}$ as&#xA;$$&#xA;P_{0}^{k_2} = \sum_{k_i\leq{k_2}}P_{k_{i-1}}^{k_i}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The pricing function $C(0,k_2,\rho)$ is monotonic in $\rho$, hence the base correlation is unique.  This allows practitioners to think about correlations a bit more like they previously thought about implied volatility (and volatility skews) for options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The super-senior tranche has (trivially) a base correlation that matches the price of the entire underlying instrument, since it is $\rho_i(0,1)$.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2014-09-15T14:49:55.503" LastActivityDate="2014-09-15T14:49:55.503" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14700" PostTypeId="2" ParentId="14677" CreationDate="2014-09-11T09:29:34.297" Score="0" Body="&lt;p&gt;As your model is to predict stock returns via P/E, I suggest you try out all possible P/E's in a backtest and select the one with best forecast ability(lowest forecast error).&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-09-11T09:29:34.297" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14703" PostTypeId="2" ParentId="14661" CreationDate="2014-09-11T14:37:28.383" Score="3" Body="&lt;p&gt;I'm going to separate your question in two.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The key thing you're asking is that how does Return.rebalancing treat your different frequencied and number of asset return and weight objects.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Data munging:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;It subsets the first ncol(weight) columns of R (as ncol(edhec) &gt; ncol(weights)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ncol R is now 11. Checks if the first date in R is less than the first date date in W If true it subsets R from 2000-01-02/&quot; onwards nrow(R) is now 116 as you cannot have a return series before the initial weights.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Data processing:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;It then calls Return.portfolio.geometric, which just multiplies the returns by the weights for those two matrices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As weights are annual and edhec is monthly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It needs to calculate inbetween years&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it grabs the return series for the inbetween period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Loops through all of the return subseries calculating the weights * the previous amount in the return period (essentially floating it and rebalancing on the weight matrix).&#xA;It takes the total value of each period in the return series and divides it by the starting value in the period to calculate the periodic return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A simple demonstration is as follows.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Take initial equity value (1)&lt;/li&gt;&#xA;&lt;li&gt;Take rebalancing year initial weight&lt;/li&gt;&#xA;&lt;li&gt;Calculate end of period equity (initial equity * weight * return)&lt;/li&gt;&#xA;&lt;li&gt;Calculate return for period&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Repeat two on each rebalancing date as specified in the weight matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;eop_value[k, ] = (1 + coredata(returns[j, ])) * &#xA;  bop_value[k, ]&#xA;eop_value_total[k] = sum(eop_value[k, ])&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ret[k] = eop_value_total[k]/end_value - 1&#xA;    end_value = eop_value_total[k]&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The above code calculates the new total equity for each position and sums it up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it is akin to your weights floating and then resetting on each date in the weights matrix.&lt;/p&gt;&#xA;" OwnerUserId="2154" LastEditorUserId="2154" LastEditDate="2014-09-12T14:35:02.100" LastActivityDate="2014-09-12T14:35:02.100" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="14704" PostTypeId="1" CreationDate="2014-09-11T20:15:22.173" Score="2" ViewCount="178" Body="&lt;p&gt;Let's say I have a risk factor that is defined between [0,1], such as recovery rates. Assuming I have daily data, I can estimate the &quot;daily VaR&quot;, i.e. the tails over 1 day period, since the data is available every day. I would like to estimate the changes over a X-day period. Therefore, I am trying to see whether I can apply some sort of scaling (i.e. a version of square root of time) to the 1-day estimates? Is there a straightforward way to do it for Beta distributions? Thanks!&lt;/p&gt;&#xA;" OwnerUserId="11918" LastActivityDate="2014-09-12T12:42:37.617" Title="Beta distribution - Holding period" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;probability&gt;&lt;value-at-risk&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14706" PostTypeId="1" AcceptedAnswerId="14707" CreationDate="2014-09-12T02:45:50.220" Score="8" ViewCount="3348" Body="&lt;p&gt;While the solution for IV can certainly be reached using numerical search methods, I wonder if a high precision closed-form approximation exists.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, there is a very robust (precise within 10^-12) approximation for Bachelier IV (&lt;a href=&quot;http://dx.doi.org/10.1080/13504860802583436&quot; rel=&quot;nofollow noreferrer&quot;&gt;paper&lt;/a&gt; / &lt;a href=&quot;http://ssrn.com/abstract=990747&quot; rel=&quot;nofollow noreferrer&quot;&gt;SSRN&lt;/a&gt;), but is there anything similar for Black'76 and/or Black-Scholes?&lt;/p&gt;&#xA;" OwnerUserId="5086" LastEditorUserId="26559" LastEditDate="2018-10-14T09:03:34.363" LastActivityDate="2018-10-15T02:47:36.027" Title="Is there a good closed-form approximation for Black-Scholes implied volatility?" Tags="&lt;black-scholes&gt;&lt;implied-volatility&gt;&lt;numerical-methods&gt;" AnswerCount="5" CommentCount="2" FavoriteCount="8" ContentLicense="CC BY-SA 4.0" />
  <row Id="14707" PostTypeId="2" ParentId="14706" CreationDate="2014-09-12T06:07:46.520" Score="8" Body="&lt;p&gt;The method described in &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=567721&quot; rel=&quot;noreferrer&quot;&gt;Hallerbach (2004)&lt;/a&gt; always worked well for me.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We derive an estimator for Black-Scholes-Merton implied volatility that, when compared to the familiar Corrado &amp;amp; Miller [JBaF, 1996] estimator, has substantially higher approximation accuracy and extends over a wider region of moneyness.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="7213" LastActivityDate="2014-09-12T06:07:46.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14708" PostTypeId="1" CreationDate="2014-09-12T06:57:31.813" Score="13" ViewCount="1839" Body="&lt;p&gt;For which class of instruments the SABR/LIBOR Market Model does perform better than the classical LIBOR Market Model?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;The LIBOR Market Model&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The LIBOR Market Model — also known as Brace, Gatarek, Musiela model — is an interest rate model capable of reproducing the correlation structure of forward rates. One-factor models are unable to reproduce this structure and therefore cannot price accurately derivatives whose prices reflect these correlations.  A typical example of such derivatives are swaps paying a non-linear function of the difference two swap rates for two different maturities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The model is constructed by using a family of LIBOR rates: $L_0(t), \ldots, L_n(t)$, where $L_i(t)$ is LIBOR forward rate starting at $t_i$ and ending at $t_{i+1}$, following&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dL_i(t)=\sigma_i(t)L_i(t)dW^{i+1}(t).$$&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;The SABR LIBOR-Market Model&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;An important flaw of the LMM is known as &lt;em&gt;sticky volatilities:&lt;/em&gt; if the model is calibrated in a highly volatile market it assumes that this high volatility lasts forever, which leads to inaccurate results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The SABR LMM attempts to address this issue. In this model, each LIBOR rate is assumed to follow a log-normal dynamic having &lt;em&gt;stochastic&lt;/em&gt; volatility:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dL_i(t)=\sigma_i(t)L_i^{\beta_i}(t)dW^{i+1}(t) \\d\sigma_i(t) = \alpha_i \sigma_i(t)dZ(t)\\&#xA;&amp;lt;dW,dZ&amp;gt; = \rho dt$$&lt;/p&gt;&#xA;" OwnerUserId="12037" LastEditorUserId="13470" LastEditDate="2018-05-06T11:20:31.797" LastActivityDate="2018-05-06T11:20:31.797" Title="For which instruments performs SABR/LMM better than LMM?" Tags="&lt;pricing&gt;&lt;stochastic-volatility&gt;&lt;libor&gt;&lt;volatility-smile&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="14709" PostTypeId="1" AcceptedAnswerId="49193" CreationDate="2014-09-12T11:51:01.603" Score="3" ViewCount="12170" Body="&lt;p&gt;Where can I download intraday tick data for DAX and S&amp;amp;P500 index prices?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found only daily closing prices.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2020-02-05T06:28:02.020" Title="Where can I download intraday series for DAX and S&amp;P500 Index?" Tags="&lt;market-data&gt;&lt;tick-data&gt;&lt;intraday&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14710" PostTypeId="2" ParentId="14706" CreationDate="2014-09-12T12:32:16.843" Score="3" Body="&lt;p&gt;Jaeckel has a paper &quot;Let's be rational&quot; in which he &lt;em&gt;&quot;show how Black’s&#xA;volatility can be implied from option prices with as little as two iterations to maximum attainable precision on standard (64 bit floating point) hardware for all possible inputs.&quot;&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess it doesn't qualify as closed-form for you, though one might argue that having to apply a deterministic algorithm twice to get accurate answer with machine precision, sort of is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FWIW, I've not tried to implement what Jaeckal did in &quot;Let's be rational&quot; yet, but I have implemented his previous paper &quot;By implication&quot;, which always worked well for me (but relies on a root-search without any guarantees on how quickly it converges).&lt;/p&gt;&#xA;" OwnerUserId="11851" LastActivityDate="2014-09-12T12:32:16.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14712" PostTypeId="1" CreationDate="2014-09-12T13:55:41.620" Score="0" ViewCount="789" Body="&lt;p&gt;I have implemented the LIBOR market model (LMM) and I am quite satisfied with the results. I have now added a skew to the model as described in 10.1 of Brigo/Mercurio. That is, I have replaced the SDE&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dF_{k}(t) = \sigma_{k}(t) F_{k}(t) dW_{t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for the forward rate $F(t, T_{k-1}, T_{k})$ with&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dH_{k}(t) = v_{k}(t) (H_{k}(t) - \eta) dW_{t}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the actual path simulation I do not simulate the above equations but rather the SDEs under the spot measure. The volatilities $v_{k}$ for the skew case are calibrated as stated in 10.1 of Brigo/Mercurio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem is the following. When I use the simulated paths to price swaptions and back-out the implied swaption volatilities I indeed get an almost flat curve in the non-skew case and a skew curve in the skew case. However, the two implied volatility curves (implied volatility plotted against strike) do not intersect at the at-the-money strike. The skew curve is always above the non-skew curve. When I do the same for caplets I get two almost identical curves (as I would expect from the calibration procedure). I have included an example plot here. The green line is what I would expect and the red-brown line is what I get. The x-axis is moneyness with respect to the ATM forward rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/3RhUC.jpg&quot; alt=&quot;The Swaption Volatility Plot&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My suspicion is that I am missing something simple and that my calibrated volatilities for the skew case are too high. However, I calibrate exactly as suggested by Brigo/Mercurio in 10.1. I would appreciate any hint!&lt;/p&gt;&#xA;" OwnerUserId="8072" LastEditorUserId="8072" LastEditDate="2014-09-12T14:06:09.763" LastActivityDate="2014-09-12T14:06:09.763" Title="Calibration Problem in the LMM-Skew (Shifted Diffusion) Model" Tags="&lt;calibration&gt;&lt;skew&gt;&lt;swaption&gt;&lt;lmm&gt;" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="14713" PostTypeId="2" ParentId="14709" CreationDate="2014-09-12T14:04:08.583" Score="1" Body="&lt;p&gt;Here are four links:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.bloomberg.com/quote/SPX:IND&quot; rel=&quot;nofollow&quot;&gt;http://www.bloomberg.com/quote/SPX:IND&lt;/a&gt;&#xA;&lt;a href=&quot;http://www.bloomberg.com/quote/DAX:IND&quot; rel=&quot;nofollow&quot;&gt;http://www.bloomberg.com/quote/DAX:IND&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;eu.spindices.com/indices/equity/sp-500&#xA;www.boerse-frankfurt.de/en/equities/indices/dax+DE0008469008&lt;/p&gt;&#xA;" OwnerUserId="12043" LastActivityDate="2014-09-12T14:04:08.583" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14714" PostTypeId="1" AcceptedAnswerId="14732" CreationDate="2014-09-12T16:49:11.857" Score="4" ViewCount="3223" Body="&lt;p&gt;When giving a particular class in financial mathematics for a student I saw a problem in a list of exercises that says:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to calculate the price at 15 December 2010 of a bond paying a coupon of 11.04 % 2 times a year knowing that the coupon payment days are &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Coupon date &#xA;1   15 March 2011&#xA;2   15 September 2011&#xA;3   15 March 2012&#xA;4   15 September 2012&#xA;5   15 March 2013&#xA;6   15 September 2013&#xA;7   15 March 2014&#xA;8   15 September 2014&#xA;9   15 March 2015&#xA;10  15 September 2015&#xA;11  15 March 2016&#xA;12  15 September 2016&#xA;13  15 March 2017&#xA;14  15 September 2017&#xA;15  15 March 2018&#xA;16  15 September 2018&#xA;17  15 March 2019&#xA;18  15 September 2019&#xA;19  15 March 2020&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and having the following Yield curve:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Yield curve &#xA;Term (D)    Rate &#xA;1       0.0051505&#xA;9       0.0051179&#xA;16      0.005344728&#xA;23      0.005602964&#xA;33      0.00560621&#xA;64      0.006237435&#xA;92      0.006553657&#xA;124     0.006818637&#xA;153     0.00702155&#xA;184     0.00721352&#xA;215     0.007444632&#xA;245     0.007695142&#xA;278     0.007965138&#xA;306     0.0082047&#xA;337     0.008453748&#xA;369     0.008692272&#xA;460     0.009484277&#xA;551     0.010313827&#xA;642     0.011160763&#xA;733     0.01202446&#xA;1098    0.015414247&#xA;1463    0.018648449&#xA;1828    0.02158657&#xA;2196    0.02408674&#xA;2560    0.026161802&#xA;2924    0.027907447&#xA;3289    0.029391256&#xA;3655    0.030649823&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My background is more theoretical (probability and etc) and don't have to much knowledge of financial products as you can see by my question. Could you help me to understand how to compute it in a practical way simple to explain for a student. But first for me, because I lack of practical knowledge. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that if we have a interest rate process $(r_t)_{t\geq 0}$ then the Zero-Coupon bond price at date $t$ of maturity $T$ is given by $P_t = \mathbb E_t^{\mathbb Q}\left [exp(-\int^T_t r_s ds ) \right ]$ where $\mathbb Q $ is risk neutral measure. Then &#xA;the Coupon-bearing bond price is given by &#xA;$$ P_0 = \sum_{i=1} ^n cP_0(T_i) + F P_0(T) =\sum_{i=1} ^n \rho F P_0(T_i) + F P_0(T) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $F$ is the face value, $\rho $ is the pre-assigned interest and $T_1\leq \cdots \leq T_n \leq T$ are the dates where coupon are paied.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also I know that the Yelds is given by &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ R_t(T) = \frac{-ln P_t(T)} {T-t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;since $P_t(T) = \exp(-(T-t) R_t(T))$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So should I just comput $P_o$ by this relations or Am I mistaken about the Yield curve definition? (I think there are other kinds of Yields right ?&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Another question comes out. While searching for an answer to this&#xA;  question I reviewed some theoretical material about the models but&#xA;  also some piratical ones. In one of the practical materials I've seen&#xA;  a path simulation for a stock spot price using the forward rate&#xA;  instead of the short rate. In the context they had the same initial&#xA;  date them I have in my problem: an yield curve. Why should be the&#xA;  forward rate a better approximation for the short rate than the yield&#xA;  curve (supposing that you interpolate it if necessary in order to have&#xA;  a more refined and smooth approximation) ?&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;I know that the short rate $r_t$ is given by $r_t =\lim_{\tau \to t} &#xA; f_t(\tau) =\lim_{\tau \to t} \nabla_\tau [R_t(\tau)(\tau-t)]$&#xA;  (supposing that those limits exist!)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance for yours advices.&lt;/p&gt;&#xA;" OwnerUserId="3534" LastEditorUserId="3534" LastEditDate="2014-09-19T10:10:04.270" LastActivityDate="2014-09-19T10:10:04.270" Title="Pricing a bond contract from the yield curve" Tags="&lt;yield-curve&gt;&lt;bond&gt;&lt;bond-yields&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14715" PostTypeId="2" ParentId="14509" CreationDate="2014-09-12T18:22:34.133" Score="1" Body="&lt;p&gt;I wouldn't say 1) is better because it's very rigid. If you want to include some higher moments (most likely you won't need more than 4th order), it's better to do it explicitly rather than to stuff the moments of all orders into the criterion.&lt;/p&gt;&#xA;" OwnerUserId="12031" LastActivityDate="2014-09-12T18:22:34.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14717" PostTypeId="2" ParentId="14401" CreationDate="2014-09-12T19:14:32.240" Score="0" Body="&lt;p&gt;No, because the $\sigma$ is estimated, and therefore SUE may be a t-score, but certainly not a z-score. &lt;/p&gt;&#xA;" OwnerUserId="12031" LastActivityDate="2014-09-12T19:14:32.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14718" PostTypeId="2" ParentId="14400" CreationDate="2014-09-12T20:35:31.877" Score="1" Body="&lt;p&gt;I think the best strategy is to follow Ken French who posted all of the Fama-French factors on &lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html&quot; rel=&quot;nofollow&quot;&gt;his website&lt;/a&gt; a while ago, including the risk-free rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The latter is updated at the same frequency as the portolio returns, e.g. you can't use a 3-month - based rate if you work with monthly equity returns. &lt;/p&gt;&#xA;" OwnerUserId="12031" LastActivityDate="2014-09-12T20:35:31.877" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14719" PostTypeId="2" ParentId="14397" CreationDate="2014-09-12T20:46:41.447" Score="1" Body="&lt;p&gt;If you calculated MA by hand without actually fitting a MA(q) time series model, then you are out of luck. I suggest you use R, &lt;a href=&quot;http://a-little-book-of-r-for-time-series.readthedocs.org/en/latest/src/timeseries.html&quot; rel=&quot;nofollow&quot;&gt;like in this example&lt;/a&gt; that shows how to construct a prediction interval, among other things.&lt;/p&gt;&#xA;" OwnerUserId="12031" LastActivityDate="2014-09-12T20:46:41.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14720" PostTypeId="2" ParentId="14327" CreationDate="2014-09-12T20:57:34.503" Score="1" Body="&lt;p&gt;I can answer 2). It's either because you did something wrong with ADF test (it's impossible to say without knowing what exactly you did) or because you tested too many pairs w/o adjusting for multiplicity. &lt;a href=&quot;http://www.ssc.wisc.edu/~bhansen/718/White2000.pdf&quot; rel=&quot;nofollow&quot;&gt;The well-known paper of White&lt;/a&gt; is a good into into the issue.&lt;/p&gt;&#xA;" OwnerUserId="12031" LastActivityDate="2014-09-12T20:57:34.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14721" PostTypeId="2" ParentId="14689" CreationDate="2014-09-13T03:21:18.037" Score="5" Body="&lt;p&gt;First of all, a filtration $( \mathscr{F}_t )_{t \geq 0 }$ is a &quot;set&quot; of sigma algebras indexed usually by time t that are increasing. That is, for every $t&amp;gt;0$, $\mathscr{F}_t$ is a sigma algebra and $\mathscr{F}_t \subseteq \mathscr{F}_T$ for all $0\leq t \leq T$. The canonical example, is the filtration generated by a process, say Brownian Motion $W$: The filtration $( \mathscr{F}_t )_{t \geq 0 }$ is such that $\mathscr{F}_0$ is the minimum $\sigma$-algebra such that $W_0$ is measurable with respect to it (that is if $W_0$ is $\mathscr{G}$-measurable, then $\mathscr{F}_0 \subset \mathscr{G}$ ) and $\mathscr{F}_t$ is the minimum $\sigma$-algebra such that all increments of $W$ up to time $t$ are measurable with respect to it. Having said that, the interpretation of filtration is that of the flow of information: as time progresses you know at least as much information as before. In particular they are useful to define the concept of a martingale. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We say $(M_t)_{t\geq0}$ is a martingale if the conditional expectation at time $t$ given the information up to time $s$ is the process at time $s$; that is, the best we can say about the process at time $t$ with the information up tp time $s &amp;lt; t$ is the process itself at time $s$, but which information and how to define it formally, this is where the concept of filtration comes in play. On a filtered probability space (a probability space with a filtration ) $( \Omega, \mathscr{F}, \mathbb{P}, (\mathscr{F} )_{t \geq 0 } ) $, the process $( M_t )_{ t \geq 0 } $ adapted to the filtration $( \mathscr{F}_t )_{t\geq 0}$ is a martingale if $M_0$ is integrable ( $M_0 \in L^1(\mathbb{P})$ ), and $$ \mathbb{E} \left [  M_t \right \vert \left. \mathscr{F}_s \right] = M_s, \quad \text{ for every }s \leq t $$ &#xA;In particular, a process might be martingale with respect to one filtration and not with respect to another. Also, it is not necessarily the case in which, say the filtration generated by Brownian Motion $W$, and the filtration generated by $$X_t = W_t + \int_0^t \theta_s ds$$&#xA;are the same. I will give a famous example below. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the comment that Shreve wants to make is that the process $\widetilde M$ is a martingale in the filtered probability space $( \Omega, \mathscr{F},\widetilde{ \mathbb{P} }, (\mathscr{F} )_{t \geq 0 } ) $ (hence with respect to the filtration generated by $W$ ) still, it admits a stochastic representation representation like in Theorem 5.3.1 with $\widetilde W$. As you mentioned if the filtrations generated by $W$ and $\widetilde W$ were the same, then the result would be trivial, but they are in general not the same as I will give an example next.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a famous example due to Ito, and it can be found on the stochastic integration book by Protter, on the second section of the last chapter. Consider brownian motion $W$ with its respective filtration $(\mathscr{F}_t)_{t\geq 0}$. Now for every $t&amp;gt;0$, consider the filtration $\mathcal{G}_t$ that is the minimum filtration such that $\mathcal{F}_t \subseteq \mathcal{H}_t$ and $W_1$ is $\mathscr{H}_t$-measurable. It is easy to see that $(\mathscr{H}_t)_{t \geq 0 }$ is a filtration different from $( \mathscr{F}_t )_{ t \geq 0 }$ (since $W$ is not a martingale with respect to $\mathscr{H}$ ). What Ito showed was that the process $$ \beta_t = W_t - \int_0^t \frac{W_1 - W_s}{1-s}ds, t \in [0,1]$$ is a martingale with respect to the $\mathscr{H}$ filtration, and in fact (due to Levy's theorem) a Brownian Motion. So there you have two completely different filtrations for processes related by a simple drift addition.&lt;/p&gt;&#xA;" OwnerUserId="11945" LastActivityDate="2014-09-13T03:21:18.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14722" PostTypeId="1" AcceptedAnswerId="14725" CreationDate="2014-09-13T04:04:16.843" Score="2" ViewCount="219" Body="&lt;p&gt;So I was trading the option contracts on NLY (Annaly Capital Managment) today. The stock took a big dip today which piqued my interests in selling some OTM puts. Since the options market on this particular stock is not a very liquid you have very wide bid-ask spread making it tough if you want to get your order filled. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I put in my limit to sell the, quote on the October 11 strike weekly's with 28 DTE, were .06x.10, with both the bid and offer 350 contracts deep. I put my limit on .09 to make it more competitive, put me at a 19 vol. The market traded for a while without fill and as time passed, I started seeing more limits dribbling down towards my .09 price, albeit the biggest blocks were still at .10, so a penny above me. To play it a little more conservatively, I decided to move my limit a penny up in case the market dropped some more. I want to note, that the limit orders to sell were firm at 10 cents all day as I watched the time and sales.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ALL IN BEHOLE at the EXACT same instant I lifted my offer... all the limit orders to sell at my .09 price, were all pulled out and moved to .1 as well . It couldn't have been some human trader. Was there some algo shadowing my order? &lt;/p&gt;&#xA;" OwnerUserId="4729" LastActivityDate="2014-09-13T15:09:35.810" Title="Algo's Shadowing Limit Orders" Tags="&lt;automated-trading&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14723" PostTypeId="1" CreationDate="2014-09-13T07:03:42.823" Score="2" ViewCount="143" Body="&lt;p&gt;I would like to reproduce the results in the paper &lt;a href=&quot;http://arxiv.org/abs/0909.1690&quot; rel=&quot;nofollow&quot;&gt;&quot;The scale of market quakes&quot;&lt;/a&gt;, from T. Bisig, But I am getting stuck at the computation of the Fourier Coefficients in equation (4). They are defined as the magnitude of the Fourier frequency computed from the &lt;em&gt;discretized omega(t)&lt;/em&gt;. I know how to compute a Discrete Fourier Transform but which omega(t) should I use? It's also not clear why you need a DFT at all. Is it to filter the signal?&lt;/p&gt;&#xA;" OwnerUserId="12049" LastActivityDate="2014-09-18T07:28:33.910" Title="Scale of Market Quakes Computation" Tags="&lt;fx&gt;&lt;digital-signal-processing&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14724" PostTypeId="2" ParentId="14722" CreationDate="2014-09-13T14:03:21.067" Score="1" Body="&lt;p&gt;When market is illiquid and market maker want bid price X in book where first order, for example your best bid is at X-Y, then market maker quoting not X, because it not makes any sense, it quotes X-Y+tick and have same fill probability but makes p = X - (X-Y+tick) =  Y-tick more profit. You should trade by some order management layer what should play with him in book, when you are as equal fast then execution probability will by equal divided too.&lt;/p&gt;&#xA;" OwnerUserId="6175" LastEditorUserId="6175" LastEditDate="2014-09-13T14:12:45.413" LastActivityDate="2014-09-13T14:12:45.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14725" PostTypeId="2" ParentId="14722" CreationDate="2014-09-13T15:09:35.810" Score="3" Body="&lt;p&gt;There's nothing nefarious going on here, it's simply a market maker ensuring they get their fair share (Hah!). Pro-rata allocation at many options exchanges mean market makers simply have to match your price to get a piece of the action. This is a good demonstration as to why that is bad for market structure since the incentive for a market maker to improve price is reduced. &lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2014-09-13T15:09:35.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14726" PostTypeId="1" CreationDate="2014-09-13T15:48:22.457" Score="5" ViewCount="1668" Body="&lt;p&gt;A similar question to this was asked here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/10830/how-do-i-test-the-significance-of-sharpe-ratio-of-a-strategy-using-bootstrap&quot;&gt;How do i test the significance of Sharpe ratio of a strategy using bootstrap&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have bootstrapped the original time series (using block bootstrapping) and now have calculated the Sharpe Ratio for those bootstrapped series, giving me a bootstrap estimate of the Sharpe ratio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Only one out of 100 of the Sharpe Ratio's was less than zero, so can I say that the Sharpe Ratio is positive with 99% probability?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also is there any rule of thumb as to how many booststrap resamples to use?&#xA;Is 100 sufficient?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or is there something I have missed?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Baz&lt;/p&gt;&#xA;" OwnerUserId="7077" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2017-10-09T02:10:35.413" Title="Bootstrapping Sharpe Ratios" Tags="&lt;quant-trading-strategies&gt;&lt;sharpe-ratio&gt;&lt;bootstrapping&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14727" PostTypeId="2" ParentId="14327" CreationDate="2014-09-13T17:53:11.967" Score="4" Body="&lt;p&gt;&lt;strong&gt;1. There are a few differences between Cointegrated ADF test and Johansen test.&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all, the former is only suitable for a pair of &lt;strong&gt;&lt;em&gt;two&lt;/em&gt;&lt;/strong&gt; time series, while the latter is also applicable for cointegration test of &lt;strong&gt;&lt;em&gt;any number&lt;/em&gt;&lt;/strong&gt; of series. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly, ADF test will suggest different test results when we switch the sequence of the inputs, while Johansen test is &lt;strong&gt;&lt;em&gt;order independent&lt;/em&gt;&lt;/strong&gt; as the latter is based on the eigenvector decomposition. Specifically, When performing Cointegrated ADF test, it first determines the optimal hedge ratio by running a linear regression between the two price series, use&#xA;this hedge ratio to form a portfolio, and then finally run a stationarity test on&#xA;this portfolio of price series. Therefore, using asset A as independent variable and asset B as dependent variable will likely to yield different results as the opposite case. Usually, only one hedge ratio among the two test cases can lead to a stationary portfolio, and one may need to run ADF test for both cases in order to find all possible hedge ratios. For the case of Johansen test, all the hedge ratios that can potentially lead to stationary portfolio for the &lt;span class=&quot;math-container&quot;&gt;$n$&lt;/span&gt;  assets are found all at once, which are the eigenvectors of the coefficient matrix. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2. It's normal to find conintegration pairs that are demonstrating false statistical significance.&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Especially, if you pull out a big universe of assets, and then performing pair-wise conintegration tests. &lt;strong&gt;By testing too many hypothesis,  we also increase the likelihood of witnessing a rare event&lt;/strong&gt;, and therefore, the chance to reject the null hypotheses when it's actually true (type I error). &lt;a href=&quot;http://en.wikipedia.org/wiki/Bonferroni_correction&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bonferroni correction&lt;/a&gt; is an effective way to address this issue. &lt;/p&gt;&#xA;" OwnerUserId="9381" LastEditorUserId="36863" LastEditDate="2018-12-09T12:56:59.593" LastActivityDate="2018-12-09T12:56:59.593" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="14728" PostTypeId="1" AcceptedAnswerId="14735" CreationDate="2014-09-13T19:51:07.837" Score="1" ViewCount="219" Body="&lt;p&gt;I'd like to calculate returns for a given mutual fund (in this case, PRWCX from troweprice). When I look at their published performance, it says the Calendar Year Total Returns for 2013 is 22.43% but when I try to calculate that using with a formula (end.price + dividend - start.price)/start.price I get something different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The price on 12/31/13 is 25.66 (adjusted close is the same), there was a dividend of 1.54 on 12/13/13, the close price on 1/2/13 is 22.56 and the adjusted close is 21.25. If I calculate the return using the close price, I get 0.2056, and if I calculate based on adjusted close, it's 0.28. The fund has an expense ratio of 0.71% (as of 12/31/13) and even if I subtract 0.71% from my results, I don't get anywhere close to 22.43%. Does anyone know what I could be doing wrong?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I'm wondering if someone could tell me how Average Annual Total Return (for say 5 years or 10 years) is calculated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My goal is to compare returns of this mutual fund to returns based on the S&amp;amp;P500 or individual stocks.&lt;/p&gt;&#xA;" OwnerUserId="12051" LastEditorUserId="12051" LastEditDate="2014-09-14T14:27:50.570" LastActivityDate="2014-09-15T19:40:08.270" Title="Calculating returns for a mutual fund with dividends" Tags="&lt;asset-returns&gt;&lt;mutual-fund&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14730" PostTypeId="1" CreationDate="2014-09-14T05:57:58.260" Score="1" ViewCount="648" Body="&lt;p&gt;I use R to write a function which simulates price path and calculates the value of an arithmetic Asian option. I found sometimes the value of the option can be lower than its intrinsic value, i.e., negative time value. I am wondering if this is a feature of arithmetic Asian option, or is there anything wrong with my code. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;###############################################################################&#xA;OptionMC = function (style, type, S, X, r, q, tDays, volatility, nSims) {&#xA;#   drift term&#xA;    mu = r - q&#xA;#   underlying price, S can be a vector with previous prices&#xA;    S0 = tail(S, n=1)&#xA;#   every trading day increment &#xA;    dt = 1 / 252&#xA;#   time to maturity express in fraction of years&#xA;    tMaturity = tDays / 252 &#xA;#   standard normal distribution random number&#xA;    z = rnorm(tDays*nSims, mean=0, sd=1)    &#xA;&#xA;#   generate log-normal return matrix&#xA;    return_matrix = matrix(exp((mu - 0.5 * volatility ^ 2) * dt + volatility * sqrt(dt) * z), ncol=nSims)&#xA;#   return value: price path matrix     &#xA;    path = rbind(matrix(rep(S,nSims),ncol=nSims), S0*apply(return_matrix,2,cumprod))&#xA;#   calculate option delta, generate a new price path, with the same brownian motion term &quot;z&quot;&#xA;    path_delta = rbind(matrix(rep(S,nSims),ncol=nSims), S0*1.0001*apply(return_matrix,2,cumprod))   &#xA;    path_delta[length(S),] = path_delta[length(S),] * 1.0001    &#xA;&#xA;#   different option style&#xA;    if (style == &quot;vanilla&quot;) {&#xA;#       plain vanilla option, use the final price as settlement price&#xA;        ref = tail(path, n=1)&#xA;        ref_delta = tail(path_delta, n=1)&#xA;    } else if (style == &quot;arithmetic&quot;) {&#xA;#       arithmetic mean of the entire price path, fixed strike price&#xA;        ref = apply(path, 2, mean)&#xA;        ref_delta = apply(path_delta, 2, mean)&#xA;    } else if (style == &quot;geometric&quot;) {&#xA;#       geometric mean of the entire price path, fixed strike price&#xA;        ref = apply(path, 2, function(x){exp(mean(log(x)))})&#xA;        ref_delta = apply(path_delta, 2, function(x){exp(mean(log(x)))})        &#xA;    } else {        &#xA;    }&#xA;&#xA;#   option's value, average of difference between terminal value and strike price, then discount back to present value&#xA;    value = exp(- r * tMaturity) * sum(pmax(ifelse(type==&quot;call&quot;,1,-1) * (ref - X), 0)) / nSims  &#xA;&#xA;#   option's value with &quot;path_delta&quot;, i.e., values calculated for calculating delta&#xA;    value_delta = exp(- r * tMaturity) * sum(pmax(ifelse(type==&quot;call&quot;,1,-1) * (ref_delta - X), 0)) / nSims      &#xA;#   delta is defined as the change of option value w.r.t. change of underlying price (S0)&#xA;    delta = (value_delta - value) / (S0 * 0.0001)   &#xA;&#xA;#   return value:&#xA;    list(path=path, value=value, delta=delta)   &#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12054" LastActivityDate="2014-09-14T05:57:58.260" Title="Asian option numerical pricing method generates a negative time value" Tags="&lt;r&gt;&lt;asian-option&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14731" PostTypeId="2" ParentId="14726" CreationDate="2014-09-14T08:22:00.070" Score="2" Body="&lt;p&gt;Bootstrap is a very interesting method to obtain the &lt;strong&gt;variance&lt;/strong&gt; of any estimator. &#xA;This means you can rely on it to obtain de &lt;em&gt;variance&lt;/em&gt; of your Sharpe ratio (SR), but what you try to do is to deduce something (the probability to be positive) from the &lt;em&gt;distribution&lt;/em&gt; of it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a methodological viewpoint, if you boostrap your SR a &quot;&lt;em&gt;standard&lt;/em&gt;&quot; way (i.e. randomizing samples of your underlying data), you create virtual samples of data that have no sense: what means having a conclusion mixing SR of yesterday with SR of 2 years ago without taking into account the ones in between? You try to bootstrap a time series, it is far more subtle, some techniques have been set up to do it. More or less, you have to apply a sliding kernel to them (of course you can do more subtle things to have the best possible statistical properties of you bootstrapped statistic), i.e. &lt;em&gt;preserve causality&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The paper &lt;a href=&quot;http://www.citeulike.org/user/lehalle/article/1343488&quot; rel=&quot;nofollow&quot;&gt;Lectures on some aspects of the bootstrap&lt;/a&gt; gives most needed details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, a detail: if you focus on a statistic of your Sharpe ratio, no need to work on the Sharpe ratio itself, the sign of your its numerator is enough.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2014-09-14T08:22:00.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14732" PostTypeId="2" ParentId="14714" CreationDate="2014-09-14T15:10:29.087" Score="4" Body="&lt;p&gt;I think what you wrote is correct. I'll rephrase everything according to my way to give you another point of view.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The price of a coupon bond at time $t = 0$ is the sum of the discounted cashflows given by the coupons and the face value:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;P_0 = F \cdot D(0, T_n)  + \sum_{i=1}^{n} 11.04\% \cdot 0.5 \cdot F \cdot D(0, T_i)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $F$ is the face value, $T_n = T$ is the maturity of the bond, $D$ is the discount rate. I think this is the simplest definition.&#xA;Some notes about the formula:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;coupons are paid also at the maturity date, therefore you can assume that March, 15th 2020 is the maturity of the bond;&lt;/li&gt;&#xA;&lt;li&gt;usually, the coupon rate of a bond is expressed as annual rate, so the rate paid every 6 months is half of $11.04\%$ and the $0.5$ factor is there because of this.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Using the term structure of interest rates, discount factors becomes easy to express:&#xA;$$&#xA;P(0, T_n) = F \cdot \exp\left(- R_0(T_n) \cdot T_n\right) + \sum_{i=1}^{n} 11.04\% \cdot 0.5 \cdot F \cdot \exp\left(- R_0(T_i) \cdot T_i\right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The term structure of interest rates assigns a rate $R_0(T_i) = r_i$  to each maturity $T_i$; these rates are computed from the prices of zero-coupon bonds on a given day using the formula you already now (rate is -logarithm of price divided by the time period). Therefore discount factors and zero-coupon bond prices are the same in this case: $D(0, T_i) = P(0, T_i) = P_0(T_i)$ (the last one is your notation). Rates $r_i$'s are usually called zero rates or spot rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The yield curve is something different: it is built from the YTM, yield to maturity. The YTM is the rate such that $r_1 = r_2 = \dots = r_n = YTM$ and $P(0, T)$ is equal to the market price today. This means that all cashflows are discounted with the same rate (this is also unnatural in reality: different rates are applied for different maturities). Each bond has its own YTM and it is usually expressed as an annual rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yield curve and term structure give the same values only for zero-coupon bonds since there are no coupons to discount. For coupon bonds the meaning is quite different as you can see.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you call &quot;yields&quot; are in fact the spot rates of a term structure. Your problem is computing the bond price given the term structure on Dec, 15th 2010 (time $t=0$). Therefore, you just need to count the number of days between Dec, 15th 2010 and each payment date, put that number with the correct rate in the formula to get the discount factors and sum everything up to get the coupon bond price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-- edit to answer the comments:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The 0.5 factor is there for the following reason (see also second bullet point above). Usually, the coupon rate is expressed as an annual rate; therefore, if 11.04% is the coupon annual rate and the coupon is paid twice a year, the standard practice is paying $11.04\% / 2 = 5.52\%$ of the face value every six months. So you get $F \cdot 5.52\%$ money each time. If your coupon is already expressed as a 6 months rate, then you don't need to put the 0.5 factor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Market prices for bonds are usually expressed using face value of 100. I would opt for that to be coherent with the standard practice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, let's tackle rates and maturities. If you don't have a rate for your exact maturity, then you can only approximate it:&#xA;   * you can take the rate of the nearest maturity in the term structure (if the difference is &amp;lt; 7 days, I don't think you will notice big differences);&#xA;   * you can approximate with linear interpolation or spline or any other technique;&#xA;   * advanced mode: if you have the dynamics of the instantaneous spot rate (the interest rate process you nominated), you can compute the rate for any maturity; &lt;em&gt;it's still an approximation&lt;/em&gt;, since it's not present in the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually, in exercises the number of days coincide with the term structure, since the crucial part of bond pricing is not this approximation process but using the right formula with the right numbers.&lt;/p&gt;&#xA;" OwnerUserId="7405" LastEditorUserId="7405" LastEditDate="2014-09-15T14:12:51.003" LastActivityDate="2014-09-15T14:12:51.003" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="14734" PostTypeId="1" CreationDate="2014-09-14T22:09:50.920" Score="4" ViewCount="738" Body="&lt;p&gt;Is there a way to upgrade R PerformanceAnalytics function VaR with more risk sensitive approaches like EWMA or GARCH? Or is there another R package which can handle the issue? &lt;/p&gt;&#xA;" OwnerUserId="11826" LastActivityDate="2015-04-14T21:56:38.057" Title="Is there a way to adjust R PerformanceAnalytics function VaR with EWMA or GARCH method?" Tags="&lt;volatility&gt;&lt;r&gt;&lt;garch&gt;&lt;var&gt;&lt;performanceanalytics&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14735" PostTypeId="2" ParentId="14728" CreationDate="2014-09-15T01:55:32.947" Score="1" Body="&lt;p&gt;When we hear that the Dow is up for the day, it is not relative to the open, but rather to yesterday's close. Accordingly, I believe the &lt;em&gt;yearly&lt;/em&gt; returns for 2013 are calculated, using the yearly adjusted closing prices, as $(C_{2013} - C_{2012}) / C_{2012}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I looked up adjusted closing prices on &lt;a href=&quot;http://finance.yahoo.com&quot; rel=&quot;nofollow&quot; title=&quot;Yahoo! Finance&quot;&gt;finance.yahoo.com&lt;/a&gt;: substituting $C_{2012} = 20.96$ and $C_{2013} = 25.66$ I get 22.42%, which is very close to their published performance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding your second question, average annual return (as opposed to &lt;em&gt;annualized&lt;/em&gt; return) is probably calculated using a straightforward simple average of the annual returns of the last five or 10 years. If that does not seem to work, please refer us to where you have seen this terminology. Thanks!&lt;/p&gt;&#xA;" OwnerUserId="11791" LastEditorUserId="11791" LastEditDate="2014-09-15T19:40:08.270" LastActivityDate="2014-09-15T19:40:08.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14737" PostTypeId="1" AcceptedAnswerId="14739" CreationDate="2014-09-15T12:56:03.790" Score="-1" ViewCount="219" Body="&lt;p&gt;A portfolio manager maintains an active portfolio with beta of 0.2. &#xA;Risk-free rate is 5%&#xA;The market return for a particular year is -30%&#xA;The fund produced a result of -10%.&#xA;He claimed the return was good given the circumstances - discuss.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the expected return should be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5% +0.2x(-30%-5%)=-2%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the alpha is negative and this is bad performance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anything more that can be said about this apart from this naive calculation?&lt;/p&gt;&#xA;" OwnerUserId="3334" LastEditorUserId="2587" LastEditDate="2014-09-15T13:34:57.623" LastActivityDate="2014-09-15T18:49:07.200" Title="Question 1.18 from Hull's Financial Risk management CAPM" Tags="&lt;risk-management&gt;&lt;capm&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14739" PostTypeId="2" ParentId="14737" CreationDate="2014-09-15T13:34:31.187" Score="2" Body="&lt;p&gt;I think there is not too much to say. At first glance it looks good if the manager loses $10\%$ if the whole market loses $30\%$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But plugging the beta and the risk-free rate into the CAPM formula we see that we would have expected a loss of $2\%$ only. So the $10\%$ are much worse than expected. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note however that there are various reason's why CAPM just does not hold. But in the text book world, where CAPM holds perferctly. The manager simply did worse than expected.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-09-15T13:34:31.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14740" PostTypeId="2" ParentId="14439" CreationDate="2014-09-15T14:25:14.713" Score="2" Body="&lt;p&gt;PortfolioAnalytics, has the ability to optimize portfolios based on factors or whatever groups/characteristics you enter. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://r-forge.r-project.org/R/?group_id=579&quot; rel=&quot;nofollow&quot;&gt;https://r-forge.r-project.org/R/?group_id=579&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please refer to the vignette in the package in the package PortfolioAnalytics (&lt;a href=&quot;https://r-forge.r-project.org/scm/viewvc.php/pkg/PortfolioAnalytics/vignettes/?root=returnanalytics&quot; rel=&quot;nofollow&quot;&gt;https://r-forge.r-project.org/scm/viewvc.php/pkg/PortfolioAnalytics/vignettes/?root=returnanalytics&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use it on a regular basis to solve problems similar to the one you posted above.&lt;/p&gt;&#xA;" OwnerUserId="2154" LastEditorUserId="2154" LastEditDate="2014-09-16T18:48:21.603" LastActivityDate="2014-09-16T18:48:21.603" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14742" PostTypeId="1" CreationDate="2014-09-15T15:03:16.327" Score="2" ViewCount="853" Body="&lt;p&gt;Thanks. Can't seem to find it through google. Worst case, if you can provide me the code in Java or C++ I can convert it to C#. &lt;/p&gt;&#xA;" OwnerUserId="11818" LastActivityDate="2014-09-16T13:55:15.797" Title="Does anyone have a C# implementation of the Barone Adesi Whaley options pricing model?" Tags="&lt;options&gt;" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="14743" PostTypeId="2" ParentId="14405" CreationDate="2014-09-15T15:23:26.040" Score="5" Body="&lt;p&gt;If you believe the process $Y_t$ to be stationary, you can try to profit from it via a mean-reversion strategy or any other way that exploits the stationarity. It doesn't matter whether $Y_t$ is obtained as a cointegrational combination of a few non-stationary processes, or as a linear combination of some processes that are stationary themselves. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the early years of the so-called Statistical Arbitrage, they never even used the formal cointegration tests because they were not available at the time. The original simple idea was to pair &quot;similar&quot; equities and pick the pairs with the spread that was both &quot;stable&quot; and looked like it had some profit generating potential. I believe a similar approach is applied to the volatility pairs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A (very) simplistic approach is as follows: take a bunch of volatility instruments and compute the implied volatility, $v_t$ over some horizon. Then for each instrument $i$ compute the volatility increments $\Delta_t^i = v_t - v_{t-1}$. For each pair of instruments $(i,j)$, compute the &quot;distance&quot; between them as $[1 - correlation^2(\Delta^i, \Delta^j)]$. The pairs with the smallest distance are the ones used for trading. For each pair, when the volatility spread becomes too wide/narrow compared to the historical average, you take a bet that it will narrow/widen in the future. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you take a look at &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=141615&quot; rel=&quot;noreferrer&quot;&gt;this well known early paper on StatArb&lt;/a&gt; and replace the term &quot;stock price&quot; with &quot;implied volatility&quot;, you'll get a better idea.&lt;/p&gt;&#xA;" OwnerUserId="12031" LastEditorUserId="12031" LastEditDate="2014-09-15T19:39:56.940" LastActivityDate="2014-09-15T19:39:56.940" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14744" PostTypeId="2" ParentId="11229" CreationDate="2014-09-15T15:45:30.790" Score="2" Body="&lt;p&gt;I'll try to give you an answer.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;I think the term structure is built from those financial products because they are the most liquid for those maturities: &lt;em&gt;theoretically&lt;/em&gt;, a liquid instrument has a price coming from a large consensus which you can think of the market. This is an &quot;academical&quot; reason, probably there are other reasons also (I'm still learning).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Futures in the wiki page stands for Forward Rate Agreement (FRA), which is another derivative on interest rates (usually for short maturities). I recommend the &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0133456315&quot; rel=&quot;nofollow&quot;&gt;Hull's book&lt;/a&gt; to find what this derivatives is; if you know what an interest rate swap (IRS) is, then a FRA is an IRS where only 1 cash-flow is exchanged (only one payment).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The term structure does not contain FRA rates and interest rate swap (IRS) rates, but spot rates that are computed from those numbers (you find the numbers in the market). The rate of a FRA or of an IRS is a fixed rate that makes zero the fair value of the derivative at inception. To get the spot rate, for each maturity of the term structure you invert the formula used to compute the FRA or IRS rate. I recommend &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0133456315&quot; rel=&quot;nofollow&quot;&gt;Hull's book&lt;/a&gt; again to know more about it.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I don't have enough experience to answer it fully. As a hint, I'd say it depends on the term structure (there are many, not just one). I'll give you the example of the LIBOR rate:&lt;br&gt;&lt;br&gt;&#xA;&lt;em&gt;LIBOR is a trimmed average of reported funding rates for unsecured borrowing deals from a panel of large banks with &lt;strong&gt;the highest credit quality&lt;/strong&gt;.&lt;/em&gt;&#xA;&lt;br&gt;&lt;br&gt;&#xA;From this definition, LIBOR contains some information about credit risk (this was almost completely forgotten before the crisis), meaning that banks with lower credit quality should be charged higher rates when they ask for borrowing.&#xA;&lt;br&gt;&lt;br&gt;&#xA;As far as I know, the Overnight Indexed Swap (OIS) rate is today's standard choice as risk-free rate to in any pricing formula.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I would stick with the suggestion of @Matt Wolf. I don't know personally any library directly written in C#. I know that &lt;a href=&quot;http://quantlib.org/extensions.shtml&quot; rel=&quot;nofollow&quot;&gt;QuantLib is available in C# in some way,&lt;/a&gt; but I never used the library itself.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="7405" LastEditorUserId="7405" LastEditDate="2014-09-16T07:53:49.243" LastActivityDate="2014-09-16T07:53:49.243" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14745" PostTypeId="2" ParentId="11229" CreationDate="2014-09-15T16:41:30.227" Score="5" Body="&lt;p&gt;@Arrigo's answers are quite good; I'll try to beef up his points a bit more.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Yield curves should be constructed using instruments of similar credit risks. If you're building a US Treasury yield curve, then you should use Treasury bills, notes, and bonds (although lots of people actually exclude Treasury bills because of market segmentation concerns). On the wikipedia page, they're building a USD swap curve, which should reflect credit risks embedded in LIBOR. Of course, LIBOR cash rates, Eurodollar futures, and conventional interest rate swaps are all LIBOR-based and belong to the same term structure. The choice of what instruments to use is actually art. Some market participants include EVERYTHING that has active quotes. Others use only the most liquidly traded. There's really no consensus here. In the post financial crisis world, a swap curve is built with at least the following: 1) LIBOR cash rate, 2) Eurodollar futures, 3) par swap rates, 4) fed funds futures, 5) OIS rates, 6) Libor/FF basis swaps &amp;amp; 7) tenor basis swaps.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;These are eurodollar futures rates. They are essentially 3M Forward Rate Agreements, but not exactly the same. Eurodollar future contract is an exchange-traded product and require daily variation margins, while FRAs are OTC products. Because of this, eurodollar futures-implied rates are higher than FRA rates; this difference is known as the &quot;convexity bias.&quot; In practice, eurodollar futures rates are used, instead of FRA quotes, since the former is much more actively traded and provide better price discovery.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Eurodollar futures are quoted as &quot;100 – interest rate.&quot; So the first step would be do &quot;100 – price&quot; to get the &quot;futures&quot; rate. Then we make a convexity-adjustment to obtain the &quot;forward&quot; rate. Different shops have different models to compute the necessary adjustment. Swap rates can be used directly for curve construction.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Most of the standard swaps are actually centrally-cleared nowadays (as required by Dodd-Frank), so frankly there's not much default risk. Similarly, Eurodollar futures are traded on exchanges, and your counterparty is the exchange. Again, virtually no default risk here (unless the exchange goes under – very unlikely). Libor cash rates are not tradable.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I don't know much about C#. I'd only mention that to build a &quot;Treasury&quot; yield curve, you should use Treasury bills, notes, and bonds as inputs, NOT swap rates or eurodollar futures rates. The US Treasury Department builds their curves using only on-the-run issues, while the vast majority of dealer Treasury curves are built with a large number of off-the-run issues.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I also recommend that you read this post &lt;a href=&quot;https://quant.stackexchange.com/questions/14567/what-is-the-swap-curve/14576#14576&quot;&gt;What is the Swap Curve?&lt;/a&gt;, which provides some color on the transition to OIS discounting. The wikipedia page you referenced desperately needs updating. It's outright &lt;strong&gt;wrong&lt;/strong&gt; to use 1M and 3M libor rates in the same curve, since 3M libor is clearly riskier than 1M libor (there's a &quot;basis&quot; between them). Likewise, the correct discount rate for building a swap curve is NOT libor, but OIS.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2014-09-15T19:31:36.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14746" PostTypeId="2" ParentId="14614" CreationDate="2014-09-15T17:17:25.470" Score="2" Body="&lt;p&gt;I think you are right. Now when I check papers I've used for my thesis I don't see almost any with empirical data section.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe this one will be helpful:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Roswell E. Mathis, III, Gerald O., Bierwag Pricing Eurodollar Futures Options with Ho and Lee and Black, Derman, and Toy Models: An Empirical Comparison&lt;/p&gt;&#xA;" OwnerUserId="6599" LastActivityDate="2014-09-15T17:17:25.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14747" PostTypeId="2" ParentId="14742" CreationDate="2014-09-15T17:21:37.267" Score="1" Body="&lt;p&gt;The Quantlib.net C# port has a native C# version.  Get the &lt;a href=&quot;http://sourceforge.net/projects/qlnet/&quot; rel=&quot;nofollow&quot;&gt;code from here&lt;/a&gt;, unzip it and checkout:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;path\QuantLib\QLNet-sources-1.0.0.zip\QLNet\Pricingengines\vanilla\Baroneadesiwhaleyengine.cs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To be honest, its proably worth your time to learn the library than to extract the implementation.  its very common in the industry and there are a bunch of stubble interactions around date handling that makes it hard to just use a specific implementation without using the entire library.&lt;/p&gt;&#xA;" OwnerUserId="743" LastEditorUserId="743" LastEditDate="2014-09-16T13:55:15.797" LastActivityDate="2014-09-16T13:55:15.797" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14748" PostTypeId="1" CreationDate="2014-09-15T17:53:26.413" Score="2" ViewCount="70" Body="&lt;p&gt;Can someone provide me with some reliable source of information about CLOs? Especially some scientific articles etc. Google or wiki are good for starters and I would like to get some examples, comparisons, parties of contract, usage and more.&#xA;Any help would be nice.&lt;/p&gt;&#xA;" OwnerUserId="6599" LastActivityDate="2014-09-15T17:53:26.413" Title="Collateralized Loan Obligation - reliable source of information" Tags="&lt;leverage&gt;&lt;debt&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14749" PostTypeId="2" ParentId="14737" CreationDate="2014-09-15T18:49:07.200" Score="0" Body="&lt;p&gt;There would be a lot more to say if we could take into account that the -2% is the $expected$ return, but the confidence interval for an actual (observed) return can be of any width, e.g. (-22%; 20%). However, we can't compute it here because the problem doesn't supply us with the variance of beta and the error term from the fitted CAPM.&lt;/p&gt;&#xA;" OwnerUserId="12031" LastActivityDate="2014-09-15T18:49:07.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14750" PostTypeId="1" CreationDate="2014-09-15T19:16:30.213" Score="1" ViewCount="882" Body="&lt;p&gt;In one of his last books Jack D. Schwager suggested that selling equity puts can be a good business. The puts are like insurance policies against market downturns and there is a natural demand. Therefore, he who sells puts (w/o any directional bias) should expect to be compensated for bearing the risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a chance of getting wiped out, but that risk can be hedged easily. Do you think an individual investor could do it and earn so much that it beats keeping the money in a savings account.&lt;/p&gt;&#xA;" OwnerUserId="12031" LastActivityDate="2014-09-15T21:01:40.743" Title="Can selling put equity options be a good business?" Tags="&lt;options&gt;&lt;trading&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14751" PostTypeId="1" CreationDate="2014-09-15T19:23:43.030" Score="1" ViewCount="2679" Body="&lt;p&gt;I have a list of securities over a thousand entries long that I want to construct a time series of prices for over a specified historical period (e.g. 2/01/10-2/20/10).  Doing this manually would take a long time, and it would be nice to have an automated procedure for doing so now and in the future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The process I have been going through between Excel/Bloomberg is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Create a new worksheet with the title being the security's CUSIP&lt;/li&gt;&#xA;&lt;li&gt;ID &quot;CUSIP&quot;&lt;/li&gt;&#xA;&lt;li&gt;GP0&lt;/li&gt;&#xA;&lt;li&gt;Enter date range&lt;/li&gt;&#xA;&lt;li&gt;Page Down to time series data (the first page is a plot)&lt;/li&gt;&#xA;&lt;li&gt;Export closing price, bid price, and ask price (this involves exporting three times, changing the particular type of price each time) to an Excel workbook&lt;/li&gt;&#xA;&lt;li&gt;Repeat the previous steps with the next CUSIP in the list (the list is in the first worksheet)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The attached image is an example of the output from Bloomberg (with some formatting and the CUSIP's redacted).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/mwLiz.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to automate this procedure by executing the above steps with a macro.  Unfortunately, due to expensive licensing fees, it is not an option to utilize the Bloomberg API/Excel Add-in (which would allow for a relatively easy solution through utilization of the BDH function and a macro).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main issue of course is getting Excel to interface with the Bloomberg terminal in order to execute the relevant commands/data export.&lt;/p&gt;&#xA;" OwnerUserId="8230" LastEditorUserId="8230" LastEditDate="2014-09-15T19:38:19.167" LastActivityDate="2014-09-15T19:38:19.167" Title="Exporting Time Series Data For Securities Prices From Bloomberg to Excel" Tags="&lt;time-series&gt;&lt;pricing&gt;&lt;bloomberg&gt;&lt;excel&gt;&lt;vba&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14752" PostTypeId="2" ParentId="14750" CreationDate="2014-09-15T19:37:13.530" Score="4" Body="&lt;p&gt;If by &lt;em&gt;an individual investor&lt;/em&gt; you mean something like the &lt;em&gt;average&lt;/em&gt; investor, then the answer is an unequivocal no: first of all, the average investor probably cannot sell put options. In order to sell put options, you have to be very experienced and climb up the option trading approval levels.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second of all, there is no such thing as risk that &lt;em&gt;can be hedged easily&lt;/em&gt; - not if you want to keep the profits that you're going through all of this trouble to earn. And this brings me to my third point: what exactly would be this investor's strategy? How would she hedge the risk? Where exactly (i.e. at what price / time / conditions) would she write the options? And which options: on what security, at which strike price, at which expiration? When (again, under what conditions) would the trade be closed? Would the option be held till expiration, whether in or out of the money?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have no doubt that many option traders have good answers to these questions. However, with all due respect, I am not sure that the average investor even understands some of these questions. So no, for the average investor, selling put options without a game plan is not a good idea.&lt;/p&gt;&#xA;" OwnerUserId="11791" LastActivityDate="2014-09-15T19:37:13.530" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14753" PostTypeId="2" ParentId="14750" CreationDate="2014-09-15T21:01:40.743" Score="1" Body="&lt;p&gt;It is the opposite of &lt;a href=&quot;http://www.cnbc.com/id/31386309#.&quot; rel=&quot;nofollow&quot;&gt;Taleb's advice&lt;/a&gt;. There is no single answer on that, but one could say you are exposing yourself to potentially deadly risk. I bet you did not want to be in that position in October 1987, dot-com bubble, during the latest crisis or any &quot;Black&quot; day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can hedge that risk, but it also diminishes your return. You can hedge by either using the underlying or another option (bull/bear spread?). Given the volatility smile, the deeper out of money will have higher IV therefore comparatively be more expansive. Add the friction (transaction costs) and your strategy can be worthless.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But true, given today's &quot;risk-free rates&quot; it will probably beat savings account for some time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Last word. Past data shows that increases in the asset value is more likely to be gradual but decreases are sudden and drastic.&lt;/p&gt;&#xA;" OwnerUserId="8147" LastActivityDate="2014-09-15T21:01:40.743" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14754" PostTypeId="1" CreationDate="2014-09-15T21:57:05.787" Score="1" ViewCount="70" Body="&lt;p&gt;Consider I have two stocks $A$ and $B$, $A$ is trading at $\$40$ and $B$ at $\$30$. The standard deviation of its returns are $\sigma_A=25\%$ and $\sigma_B = 30\%$. Correlation between the returns is $\rho=0.95$. Suppose we have long position on one stock of $B$, how many stocks of $A$ should we short?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now it is easy to calculate the hedge ration which is $h^{*}=\rho\frac{\sigma_B}{\sigma_A}=1.14$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now it seems to be as if this is the answear, I should just short $1.14$ shares. However, I feel as if I should be scaling this with $\frac{\$30}{\$40}$ because the standard deviations are based on percentage changes and do not concern about the real value of the stocks. I feel as if the underlying assumption that when calculating percentage that we are always dividing by a constant when calulating the percentage between two time intervals when in fact the price is changing over time. Maybe the approximation that it is almost the same most of the time makes it almost right.&lt;/p&gt;&#xA;" OwnerUserId="12066" LastEditorUserId="12066" LastEditDate="2014-09-15T22:09:07.163" LastActivityDate="2014-09-16T12:11:26.917" Title="Hedging using relative values" Tags="&lt;risk&gt;&lt;correlation&gt;&lt;hedging&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14755" PostTypeId="1" CreationDate="2014-09-16T01:39:18.247" Score="17" ViewCount="13106" Body="&lt;p&gt;Disclaimer: I am a complete ignoramus about finance, so this may be an inappropriate forum for me to ask a question in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am a mathematician who knows nothing about finance.  I heard from a popular source that a something called the Black-Scholes equation is used to model the prices of options.  Out of curiosity, I turned to Wikipedia to learn about the model.  I was shocked to learn that it assumes that the log of the price of an asset follows a Brownian motion with drift (and then the asset price itself is said to follow a &quot;geometric&quot; Brownian motion).  Why, I wondered, should that be a good model?  I can understand that asset prices have to be unpredictable or else smart traders would be able to beat the market by predicting them, but there would seem to be many unpredictable alternatives to geometric Brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have found one source that addresses my question, the following book chapter: &lt;a href=&quot;http://www.probabilityandfinance.com/chapters/chap9.pdf&quot;&gt;http://www.probabilityandfinance.com/chapters/chap9.pdf&lt;/a&gt; and an argument it alludes to in chapter 11 of the same book.  The analysis here looks very interesting, and I am curious if it is generally accepted in the finance community.  I have not studied it enough to understand how realistic its assumptions are, however.  It apparently depends on a &quot;continuous time&quot; assumption that seems like it might not be very realistic given that real markets move in response to discrete news events such as earnings announcements.&lt;/p&gt;&#xA;" OwnerUserId="12068" LastActivityDate="2015-03-03T23:21:25.057" Title="Why should we expect geometric Brownian motion to model asset prices?" Tags="&lt;black-scholes&gt;&lt;stochastic-processes&gt;&lt;modeling&gt;&lt;brownian-motion&gt;" AnswerCount="8" CommentCount="0" FavoriteCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="14758" PostTypeId="2" ParentId="14755" CreationDate="2014-09-16T06:44:07.693" Score="1" Body="&lt;p&gt;The normal distribution is very powerful distribution:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;By the central limit theorem, the mean of any large sample always converges to the normal distribution&lt;/li&gt;&#xA;&lt;li&gt;Considering the most simplistic Binomial Tree model, where price goes only up or down each period, it can be shown that the distribution of returns of this tree converges to Normal for infinetesimal timesteps&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Therefore it is good choice to model Asset Prices.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-09-19T07:54:01.910" LastActivityDate="2014-09-19T07:54:01.910" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14759" PostTypeId="2" ParentId="14734" CreationDate="2014-09-16T07:24:32.137" Score="0" Body="&lt;p&gt;If you want to take the EWMA approach have a look at cov.wt() from the stats package. It will give you an EWMA volatility, which you can then, given the normal distribution assumption, easily transform into VaR.&lt;/p&gt;&#xA;" OwnerUserId="3382" LastActivityDate="2014-09-16T07:24:32.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14760" PostTypeId="2" ParentId="2129" CreationDate="2014-09-16T09:17:13.577" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;The formula looks deceptively simple. Does it actually work?&#xA;  The formula is a correct approximation if the asset in question is not too volatile.&#xA;  It works good if &#xA;  a) you exactly know the parameters mu and sigma&#xA;  b) if you can commit a lot of trade&#xA;  In practice the parameters are often very roughly estimated. The rule of thumb is to reduce mu and increase sigma to avoid overbetting.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I have developed a formula for multivariate portfolios with many assets:&#xA;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2259133&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2259133&lt;/a&gt;&#xA;In this paper I implicitly assume that the assets are sold or bought simultaneously.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may also have a look at my book &quot;Knowledge rather than Hope&quot;, in which I discuss a practical application of Kelly Criterion to a portfolio with non-simultaneous buys and sells.&#xA;The book is available on Amazon, the R-scripts can be downloaded from my webpage&#xA;&lt;a href=&quot;http://www.yetanotherquant.com&quot; rel=&quot;nofollow&quot;&gt;http://www.yetanotherquant.com&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards&#xA;Vasily  &lt;/p&gt;&#xA;" OwnerUserId="12074" LastActivityDate="2014-09-16T09:17:13.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14761" PostTypeId="2" ParentId="11153" CreationDate="2014-09-16T09:24:06.650" Score="1" Body="&lt;p&gt;Have a look at my paper&#xA;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2259133&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2259133&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I checked Kelly formula and found the answer from it is exactly as Markowitz's theory. &gt;Thus, most issues on mean-variance theory (e.g. noise of estimation for mean and &gt;variance) applies here.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Kelly is not exactly as Markowitz's theory but they are indeed closely related: as long as we [can] cut tails by assets' returns.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I also learned that the estimated return and covariance is very noisy in practice&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes, they are! &#xA;The rule of thumb is to decrease the estimation of expected return and increase the estimation of the volatility/correlation in order to avoid overbetting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to read more about practical application, have a look at my book:&#xA;&lt;a href=&quot;http://www.yetanotherquant.com&quot; rel=&quot;nofollow&quot;&gt;http://www.yetanotherquant.com&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope it helps&lt;/p&gt;&#xA;" OwnerUserId="12074" LastActivityDate="2014-09-16T09:24:06.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14762" PostTypeId="2" ParentId="14755" CreationDate="2014-09-16T09:35:57.087" Score="6" Body="&lt;p&gt;If at first you don't have a model at all, then geometric Brownian motion is not bad.&#xA;As others before me said: log-returns are normally distributed in this model. This is debatable and there are times and markets where this is not true. There is more than enough research about this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But why is a model based on Brownian motion not that bad?&#xA;The reason is that if you have a continuous process with independent increments then it simply is Brownian motion (it is some kind of application of the central limit theorem). This is the only process possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you assume independent increments and other distributions then the processes are so called Levy processes which have jumps. E.g. if you assume that returns are t-distributed then you are in the world of Levy processes and the trajectories are not continuous anymore. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the short answer: modelling jumps is difficult. If you model without jumps (and with independent increments) then you base your model on Brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;addon: geometric Brownian motion can be enriched: apply time-dependent or stochastic parameters (especially volatility) or apply a time-changed Brownian motion (which will lead to a Levy process) and so on.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-09-16T09:35:57.087" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14763" PostTypeId="2" ParentId="14754" CreationDate="2014-09-16T09:45:25.333" Score="1" Body="&lt;p&gt;There are two things:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First: You have one stock of $B$ (worth \$30) and the calculation tells you to short 1.14 stocks of $A$. Of course you can only short whole stocks. So you would have to decide wether to short 0,1 or 2 stocks. This is a question of contract size, or in this case just size.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second: Usually we speak about hedging in portfolio context. In this case you have houndreds of stocks $B$ that make e.g. $x\%$ of your portfolio. Then you could short $1.14* x\%$ of stock $A$. This will be an amount in USD and again you have to calculate how many pieces of stock $A$ you will sell. Say $x = 50\%$ and your total portfolio is worht $10 000$ USD. Then you would want to short $50\%*1.14*10 000 = 5 700$. But $5700/40=142.5$ and you either short $142$ or $143$ pieces of stock $A$.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2014-09-16T12:11:26.917" LastActivityDate="2014-09-16T12:11:26.917" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14764" PostTypeId="1" CreationDate="2014-09-16T12:15:22.097" Score="3" ViewCount="1005" Body="&lt;p&gt;I have written a model for predicting the winner of UFC fights.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My model calculates the probability of each fighter to win a given match.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have back tested the model and found it to be very accurate, it predicts the winner around 65% of the time. The model is trained on 3 years of data and then tested out of sample on the past 9 months worth of data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to use my model's output (out of sample) and historic book maker odds to come up with an optimal betting strategy. This is based on the Kelly Criterion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have 5 parameters that I think will affect the profitability of a betting strategy. They are based around fractions for kelly and handling uncertainty.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I did is write a program to create ~500k strategies with different weights for each parameter. I then run them through the past 9 months of data to determine their profitability.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From those ~500k I can narrow down the strategies I'm interested in by filtering them by maximum draw down (20%) and minimum ROI (25%), this will bring down the strategies to around 20k.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I further narrow down the strategies into an optimal one? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I take the best strategy (most profit over the 9 months of out of sample data) I worry that it is likely super over fit, and if I take the average of each parameter for each the 20k strategies I worry that this set of parameters may not work well together.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I narrow down the ~20k strategies into one that works well and is likely not to be over fit?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your help.&lt;/p&gt;&#xA;" OwnerUserId="12075" LastActivityDate="2014-09-24T15:19:32.227" Title="How to select optimal betting strategy from backtest?" Tags="&lt;quant-trading-strategies&gt;&lt;backtesting&gt;&lt;modeling&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14765" PostTypeId="2" ParentId="14764" CreationDate="2014-09-16T15:09:23.420" Score="1" Body="&lt;p&gt;Choose the most robust (or insensitive) strategy. You are right that the best strategy might be overfit. So look at your parameter space and focus on the area where profitability, for example, changes least when you change the parameter value. Here is a 1D example:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/SWYHC.jpg&quot; alt=&quot;simulated profitability&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most profitable strategy is that single point that unfortunately leaves no room for error - miss it and you fall from the abyss. However at the center of the graph, you will find the strategies that might be less profitable, but are much more robust: even if you missed a little bit, you would still be riding high.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be sure, this gets complicated in five dimensions - but if you look carefully into the data that you've created, you might find these robust areas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good luck!&lt;/p&gt;&#xA;" OwnerUserId="11791" LastActivityDate="2014-09-16T15:09:23.420" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14766" PostTypeId="1" AcceptedAnswerId="14767" CreationDate="2014-09-16T15:09:41.850" Score="4" ViewCount="673" Body="&lt;p&gt;I know what duration measures, but now in the age of computers why is it useful? If the yield changes, we could just simply plug the new yield into a program, or excel or something like that, and calculate the new price of the bond.&lt;/p&gt;&#xA;" OwnerUserId="12077" LastEditorUserId="9336" LastEditDate="2014-10-18T15:48:54.173" LastActivityDate="2016-09-25T09:40:55.280" Title="Why is the duration of a bond important?" Tags="&lt;bond&gt;&lt;duration&gt;&lt;bond-yields&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14767" PostTypeId="2" ParentId="14766" CreationDate="2014-09-16T15:33:11.610" Score="2" Body="&lt;p&gt;You are right that if we exactly want to know the price of a bond after a change in the yield curve, we have to calculate it - and we can.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What we can say about duration:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;it is a linear approximation of the price change if yield change, this works rather fine with plain vanilla bonds but things get more difficult e.g. with callable bonds.&lt;/li&gt;&#xA;&lt;li&gt;keeping the eye on plain-vanilla bonds. If I want to compare bonds e.g. government bonds of the same country then duration is of a certain value. It tells me more about risk/return than just time to maturity. If I want to quickly characterize the bond then I could say e.g. it is a German govi with a duration of 8 years and I have a rough picture about the risk - without having calculated a single price. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Summing up: Duration should not be the end of an analysis but it is a useful start.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-09-16T15:33:11.610" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14768" PostTypeId="1" CreationDate="2014-09-16T15:45:30.360" Score="7" ViewCount="1026" Body="&lt;p&gt;Given that which bond in the basket becomes CTD depends massively on idiosyncratic moves among different bonds, should we not be always using N factor model instead of 2 Factor model? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By using only 2 Factors we are only capturing Slope and Level changes but ignoring curvature and other higher order movements which should, in theory, be also very important for determining CTD, especially when we have lots of closely contending bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By 2 Factor model, I mean modeling yields using first two factors only.&lt;/p&gt;&#xA;" OwnerUserId="7117" LastEditorUserId="7117" LastEditDate="2015-08-04T19:53:55.817" LastActivityDate="2015-08-04T19:53:55.817" Title="Why is two-factor model so popular for bond futures?" Tags="&lt;interest-rates&gt;&lt;factor-models&gt;&lt;bond-futures&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14769" PostTypeId="2" ParentId="14755" CreationDate="2014-09-16T17:08:46.380" Score="5" Body="&lt;p&gt;Brownian motion - because it is simple, and results in intuitive closed form solutions, and it's not a &lt;em&gt;terrible&lt;/em&gt; description of asset prices, especially when employed in high-frequency event time.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Geometric - because the returns compound, and equities cannot go below zero due to the fact that they are limited liability corporations&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are many, many other models, but sometimes what you gain in power you lose in calibration stability of the parameters, which is important for cost-effective hedging.&lt;/p&gt;&#xA;" OwnerUserId="3491" LastActivityDate="2014-09-16T17:08:46.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14770" PostTypeId="2" ParentId="14768" CreationDate="2014-09-16T17:15:26.173" Score="5" Body="&lt;p&gt;There's always a balance between model complexity and interpretability. Of course, it'll be great if we can perfectly capture the comovement of all the bonds in the deliverable basket, but that would require the volatilities of all the bond's yields and the correlations amongst all these bonds as well -- it's not easy to come up with reliable assumptions for these...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Two-factor models typically depend on PCA to capture the co-movements of bond yields. My personal experience is that this works well enough -- in most environments, the first two principle components would capture 85-99% of the variances already. As to the residual, instead of thinking about &quot;changes in curvature,&quot; I'd rather focus on the relative richening/cheapening of individual bonds, either relative to a fitted bond curve or on asset swap basis. This can be easily incorporated into your model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the end of the day, these models are meant to help with trading decisions, and 2-factor models are very easy to &quot;think through.&quot; Personally, when looking at basis, I'd either take the duration/curve risks or hedge them out. This can be done very easily within a 2-factor framework.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, there are so many intricacies involved when modeling bond futures/basis:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Are you using the correct implied volatility?&lt;/li&gt;&#xA;&lt;li&gt;How do you model bonds that haven't even been auctioned yet? How rich should these issues be trading relative to current on-the-runs? &lt;/li&gt;&#xA;&lt;li&gt;Will the CTD and near-CTDs trade special in the repo market? &lt;/li&gt;&#xA;&lt;li&gt;Is the fed active and thus will repo rates increase/decrease substantially?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;All of these factors can easily dominate the 3rd or 4th PCA factors...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. I'm assuming you're &lt;em&gt;not&lt;/em&gt; using one of those 2-factor short-rate models, right? Those don't work very well..&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2014-09-16T23:16:15.007" LastActivityDate="2014-09-16T23:16:15.007" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14771" PostTypeId="1" CreationDate="2014-09-16T17:21:46.550" Score="0" ViewCount="1477" Body="&lt;p&gt;I ran regressions using historical valuation data and now want to backtest the models I came up with.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any issues with using the same historical data set for the backtest that I need to be aware of?&lt;/p&gt;&#xA;" OwnerUserId="11926" LastEditorUserId="467" LastEditDate="2014-09-18T05:48:17.470" LastActivityDate="2014-09-18T05:48:17.470" Title="What data should be used for regression-based model backtesting?" Tags="&lt;backtesting&gt;&lt;regression&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14772" PostTypeId="1" AcceptedAnswerId="14807" CreationDate="2014-09-16T17:24:17.700" Score="5" ViewCount="1338" Body="&lt;p&gt;I’m working in the area of Data Mining and have come up with the following idea for my Masters project.The text may not be the best structured but it’s a working draft to give you a quick idea.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basic Hypothesis,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Can a combination of (Weather Data + Agricultural Data + Social Media&#xA;(twitter, etc) data + other relevant data) be used to aid an investor&#xA;to buy futures of product / commodity ‘X’&lt;/li&gt;&#xA;&lt;li&gt;I plan to focus on testing the hypothesis on ‘Soy Bean Futures’. The&#xA;core idea is to test the approach, even if I fail, its fine. My&#xA;method / approach must be correct.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Target,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;potential target audience could be investor, govt agencies or&#xA;agricultural industries&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Method,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Focus on Soy Bean Futures in USA (Worlds largest Soy producer) to narrow down my problem scope &lt;/li&gt;&#xA;&lt;li&gt;more specifically on State of Illinois (leads Soy production in US) to zoom in even further&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Technique,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Understand how the model for pricing of Futures works &lt;/li&gt;&#xA;&lt;li&gt;Find Historical trading data on Soy Futures in Illinois [from Quandl?] I still don’t know how I will match Soy Future trading data to where it was produced so that’s an issue, I think&lt;/li&gt;&#xA;&lt;li&gt;Weather [temp, humidity, sea pressure, etc] &amp;amp; Agricultural [yields, farm sizes etc] data is easy to get &amp;amp; analyze&lt;/li&gt;&#xA;&lt;li&gt;Do some number crunching / data mining to test “IF Weather in&#xA;Illinois affects Soy yields/ production which is turn affects Soy&#xA;Futures prices” ; I still need to refine the technique but its a&#xA;rough idea&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Your Input,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;what do you think about the whole idea? totally nuts? not realistic?&#xA;I need to be Math God to figure this out?&lt;/li&gt;&#xA;&lt;li&gt;if you think, that this is even remotely feasible, what are my must&#xA;do’s, must NOT do’s?&lt;/li&gt;&#xA;&lt;li&gt;is my technique fully flawed? what am I missing? under-estimating?&#xA;How can I improve my technique?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="12078" LastActivityDate="2018-02-19T22:02:55.447" Title="Predict Futures Prices based on weather + agricultural data" Tags="&lt;statistics&gt;&lt;modeling&gt;&lt;futures&gt;&lt;finance&gt;&lt;prediction&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14773" PostTypeId="2" ParentId="14439" CreationDate="2014-09-16T22:19:48.467" Score="0" Body="&lt;p&gt;What you refer to multiperiod optimization can also be classified under &lt;a href=&quot;http://en.wikipedia.org/wiki/Dynamic_programming#Example:_Mathematical_optimization&quot; rel=&quot;nofollow&quot;&gt;dynamic programming&lt;/a&gt;. You need to write a recursion (which can be nauseating at first) and any optimization function in R would do a nice job, if your problem is not too big.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the second part, you may search for some sensitivity analysis literature but I am not totally sure about where to look at.&lt;/p&gt;&#xA;" OwnerUserId="8147" LastActivityDate="2014-09-16T22:19:48.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14774" PostTypeId="2" ParentId="14755" CreationDate="2014-09-16T22:46:19.120" Score="3" Body="&lt;p&gt;Basically, Black-Scholes is an &quot;industry standard&quot; formula. It is widely used by practitioners and usually augmented with extra specifications or intuition. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It has a closed form solution, which is rare in option pricing models. It is also relative to simple to understand. Otherwise, you usually need to rely on Monte Carlo simulation or some other way. And honestly the added level of sophistication is not that desirable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The parts of the formula are used for hedging. See &lt;a href=&quot;http://en.wikipedia.org/wiki/Greeks_%28finance%29&quot; rel=&quot;nofollow&quot;&gt;Greeks&lt;/a&gt;. Many traders use this kind of information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is BS wrong? Sure. Many of its assumptions can be damned for being unrealistic (constant volatility assumption for example). But these assumptions are required to get that simple formula with some approximation to reality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is GBM wrong? Sure. Many studies show that log-return behavior is leptokurtic (high tails, high head), asymmetric and prone to jumps. See &lt;a href=&quot;http://en.wikipedia.org/wiki/Volatility_smile&quot; rel=&quot;nofollow&quot;&gt;volatility smile&lt;/a&gt;. But it is adequate for most of the time. But the difference is made in extraordinary times (2008 crisis, 1987 crash, etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In academia, BS is a slapstick for new methods and benchmark studies. As in any pioneer in any field new methods are always eager to show they are &quot;better than the benchmark&quot;. Otherwise it means your method is so trash that it cannot beat one from almost 40 years ago.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no magic bullet in finance world and BS is something accepted that you can justify yourself in your moves in the market. &lt;/p&gt;&#xA;" OwnerUserId="8147" LastActivityDate="2014-09-16T22:46:19.120" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14775" PostTypeId="2" ParentId="11153" CreationDate="2014-09-17T06:17:11.913" Score="1" Body="&lt;p&gt;Bayesian Odds Ratios can be used to compare models and allocate wealth to various models based on the relative probability that each particular model is &quot;best.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could begin to look into it more on the &lt;a href=&quot;http://en.wikipedia.org/wiki/Bayes_factor&quot; rel=&quot;nofollow&quot;&gt;wiki site&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5407" LastActivityDate="2014-09-17T06:17:11.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14776" PostTypeId="1" CreationDate="2014-09-17T07:12:58.400" Score="1" ViewCount="1095" Body="&lt;p&gt;in the book &quot;Numerical Methods and Optimization in Finance&quot; I red the following: &#xA;&quot;Combining the Gaussian copula with Gaussian marginal gives a fancy way of expressing multivariate normals. However, the Gaussian copula can also be combined with other marginals, and Gaussian marginals can be linked via any copula”.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to combine the Gaussian copula with Gaussian marginals, to obtain multivariate normals for my 7 asset classes. In addition, I would like to combine t-marginals with t-copula, to obtain a multivariate t-distribution. Does anyone know how to do this in MatLab??&#xA;I kinda struggle with this for quite some time!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is how I approached the problem for the t marginals &amp;amp; t copula: &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;%% Define univariate process by t-distribution&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for i = 1:nAssets&lt;/p&gt;&#xA;&#xA;&lt;p&gt;marginal{i} = fitdist(returns(:,i),'tlocationscale');&lt;/p&gt;&#xA;&#xA;&lt;p&gt;end&lt;/p&gt;&#xA;&#xA;&lt;p&gt;%% Copula calibration&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for i = 1:nAssets&lt;/p&gt;&#xA;&#xA;&lt;p&gt;U(:,i) = marginal{i}.cdf(returns(:,i)); % transform margin to uniform&lt;/p&gt;&#xA;&#xA;&lt;p&gt;end&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[rhoT, DoF] = copulafit('t', U, 'Method', 'ApproximateML'); &lt;/p&gt;&#xA;&#xA;&lt;p&gt;%% Reverse transformation on each index&lt;/p&gt;&#xA;&#xA;&lt;p&gt;U = copularnd('t', rhoT, DoF, NumObs * NumSim);  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;for j = 1:nAssets&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ExpReturns(:,:,j) = reshape(marginal{j}.icdf(U(:,j), DoF), NumObs, NumSim); &lt;/p&gt;&#xA;&#xA;&lt;p&gt;end&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Does my approach make sense?? Any help is very much appreciated, especially on the MatLab code!!! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best regards&lt;/p&gt;&#xA;" OwnerUserId="12084" LastEditorUserId="12084" LastEditDate="2014-09-17T12:33:22.833" LastActivityDate="2016-08-29T14:26:12.077" Title="How to combine Gaussian marginals with Gaussian copula to obtain multivariate normals?" Tags="&lt;statistics&gt;&lt;optimization&gt;&lt;distribution&gt;&lt;matlab&gt;&lt;copula&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14777" PostTypeId="2" ParentId="14776" CreationDate="2014-09-17T07:29:45.133" Score="2" Body="&lt;p&gt;You can express the Normal distribution by &lt;a href=&quot;http://en.wikipedia.org/wiki/Copula_(probability_theory)#Sklar.27s_theorem&quot; rel=&quot;nofollow&quot;&gt;Sklar's Theorem&lt;/a&gt; in terms of Gaussian Marginals and Gaussian Copula as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$F(x_1,...,x_n)=C(F(x_1),...,F(x_n))=C^{Gau}(N(x_1),...,N(x_n))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the distribution equals the copula function with the respective inverse marginals as arguments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can aswell combine any types of Copula and (continuous) different Marginals to form new distributions by this formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$F(x_1,...,x_n)=C(F(x_1),...,F(x_n))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for Student-t-Copula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$F(x_1,...,x_n)=C_t(F_t(x_1),...,F_t(x_n))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remark: You can also combine different types of marginals and copula, e.g. Gauss Copula with t-Marginals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The MATLAB-function to generate Copula values can be found &lt;a href=&quot;http://www.mathworks.ch/ch/help/stats/copulacdf.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Y = copulacdf('Gaussian',U,rho)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Y = copulacdf('t',U,rho,NU)&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-09-17T14:02:30.523" LastActivityDate="2014-09-17T14:02:30.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14778" PostTypeId="2" ParentId="14776" CreationDate="2014-09-17T07:47:57.550" Score="0" Body="&lt;p&gt;Just keep in mind that Gaussian marginals with Gaussian copula is nothing more than the multivariate Gaussian distribution (&lt;a href=&quot;http://en.wikipedia.org/wiki/Multivariate_normal_distribution&quot; rel=&quot;nofollow&quot;&gt;details e.g. here&lt;/a&gt;). For t-marginals with t-copula (with the same degree of freedom) you get the &lt;a href=&quot;http://en.wikipedia.org/wiki/Multivariate_t-distribution&quot; rel=&quot;nofollow&quot;&gt;multivariate t-distribution&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both multivariate distributions are characterized by their covariance matrix. The t-distribution has the additional parameter degrees of freedom and will thus produce tail dependence.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All in all you don't need the copula concept in these cases. The only benefit would be to use different degrees of freedom for the marginals and the copula in the t-distribution case.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-09-17T07:47:57.550" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14779" PostTypeId="1" CreationDate="2014-09-17T09:50:49.737" Score="0" ViewCount="1186" Body="&lt;p&gt;Looking at convertible bond prices in a commercial pricing tool, which is based on a model of Black-Scholes volatility plus a Poisson process of jump to default, I noticed that increasing the spread for CDS on the issuer causes the fair price of the convertible bond to go up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since increased credit risk suggests that there is more chance that the bond will be defaulted on, why should it make the bond more valuable?&lt;/p&gt;&#xA;" OwnerUserId="4963" LastActivityDate="2016-03-05T17:41:10.587" Title="Why does the price of a convertible bond go up if the CDS spread goes up?" Tags="&lt;pricing&gt;&lt;cds&gt;&lt;convertible-bond&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14780" PostTypeId="2" ParentId="14779" CreationDate="2014-09-17T09:50:49.737" Score="3" Body="&lt;p&gt;A friend gave me the following reply in terms of dynamic hedging and portfolio management:&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Quantitative justification&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Pricing models for a CB are based on holding the CB hedged with a short equity position. The combined portfolio has zero delta. However, it has positive gamma. To see this, consider that delta increases when the probability of conversion increases. Of course, this means that it increases when spot of the underlying equity increases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, a dynamically delta-hedged portfolio should be gamma-neutral except in the case of jumps. In a CB pricing model based on diffusion and a jump to default, an increase in the probability of a jump (which would happen if the CDS spreads go up) means an increased chance of making profit from being long gamma. In the event of a jump, our short equity hedge will pay off much more than the CB will lose.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This explanation, while correct, is problematic for someone who isn't used to arguments based on dynamic hedging. Like the question about why we would want to hold a hedged vanilla (which has negative theta, and so steadily loses money even if nothing happens!), it seems that it should be possible for a different hedging strategy to justify a different valuation. Of course, any other portfolio will not be delta-neutral, and so will preserve some risks which are not present here. However, I tried to come up with a different way of answering this question which is accessible without understanding dynamic delta hedging.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Intuitive justification&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The price of a CB goes up if credit risk goes up &lt;em&gt;ceteris paribus&lt;/em&gt; - all other things being equal. In particular if the equity price remains the same but the CDS spread goes up, the CB will go up. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the credit risk of a companay has gone up, but the equity price is unchanged, then the potential upside of the equity must have increased by enough to compensate the increased downside risk (from the point of view of the holder of the equity). But the CB is exposed to most of the upside of an equity (because if the equity rises enough the CB will be converted), but only a fraction of the downside (because in a credit event, the equity is likely to drop to zero, before any of the recovery value of the CB is impaired).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if the increased upside and increased downside are balanced for the equity, the upside should more than compensate the downside for the convertible bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, if the credit risk of the issuer increases in isolation of any other changes to its outlook, the CDS spread should rise &lt;em&gt;and&lt;/em&gt; the equity price should fall. The combined effect on the price of the CB should be that it falls.&lt;/p&gt;&#xA;" OwnerUserId="4963" LastEditorUserId="4963" LastEditDate="2016-03-03T13:59:24.450" LastActivityDate="2016-03-03T13:59:24.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14781" PostTypeId="2" ParentId="11153" CreationDate="2014-09-17T13:10:07.130" Score="1" Body="&lt;p&gt;Others may have different views, but I've tried applying Kelly formula/fractional Kelly strategies to capital allocation, and find it rather unpractical and risky. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would honestly suggest a three-tier optimization framework that I am myself adopting: &#xA;Assuming you have $M$ number of models covering multiple instruments and strategies. Your goal is to pick a subset of them and assign a capital weighting to each selected model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;1) Universe Screening&lt;/strong&gt;: Optimize the entire multi-strategy portfolio based on your objective metrics. For instance, you may consider the classical mean-variance framework. By now you should have a rough weighting scheme based on purely theoretical optimization.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2) Universe Refinement&lt;/strong&gt;: based on stage one's weighting, pick the most favorable $N1 (N1&amp;lt;=M)$ models as your refined universe. Further refine the universe by &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Analyzing their correlation structures and risk-profiles. &lt;/li&gt;&#xA;&lt;li&gt;Analyzing which model is a diversification-contributor and which&#xA;is diversification-consumer. Performing this analysis on a instrument, sector, asset-class level.&lt;/li&gt;&#xA;&lt;li&gt;If you have fundamental views or bias based on a macro&#xA;model,integrate it into your analysis by penalizing those models&#xA;whose logic is not in line with the macros.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This step is rather conducive, as your logical analysis can complement the weakness of theoretical optimization. By then you have refined universe to $N2 (N2 &amp;lt;=N1)$ models. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;3) Iteration&lt;/strong&gt;: Perform 1) ans 2) iteratively. Step 1 is &lt;strong&gt;science driven&lt;/strong&gt; as numerical optimization is quite standard but rather noisy. Step 2 is &lt;strong&gt;experience and logic driven&lt;/strong&gt;, which is the more difficult part that is not well addressed by the modern portfolio theory. &lt;/p&gt;&#xA;" OwnerUserId="9381" LastActivityDate="2014-09-17T13:10:07.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14782" PostTypeId="2" ParentId="14589" CreationDate="2014-09-17T16:05:44.467" Score="0" Body="&lt;p&gt;The approach you describe of looking at the valuation metrics in one period versus the returns in the next is similar to cross-sectional factor models, like Barra, or the Fama-Macbeth procedure. In these methods, instead of looking at the correlation, you do a cross-sectional regression of the returns (or excess returns or alpha) against whatever factors, such as valuation metrics, you want. The coefficients of the regressions represent the returns to the various factors. The expected return and volatility of these factors would determine their relative importance.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2014-09-17T16:05:44.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14783" PostTypeId="2" ParentId="14771" CreationDate="2014-09-17T16:32:10.530" Score="3" Body="&lt;p&gt;Yes, this is an issue. There will be datamining bias.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best practice is to hold enough of your data out-of-sample to test your models. For example, if you have 10 years of data, use the first 5 years to come up with your models. You could then rank them from best to worst, based on whatever metric you prefer. Then use the second 5 years of data to test your models. If they have approximately the same ranking, then you should have increased confidence in using those models for future data.&lt;/p&gt;&#xA;" OwnerUserId="5407" LastActivityDate="2014-09-17T16:32:10.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14784" PostTypeId="2" ParentId="14592" CreationDate="2014-09-18T00:13:44.317" Score="2" Body="&lt;p&gt;Apologies if it's not a definite answer, but would like to share my experience on this topic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been researching EMD for the last 2 years now after reading multiple one-step ahead forecasting papers for financial time series. &#xA;I have been interested in using each IMF separately to regress them with Relevance Vector Machine and NNs. &#xA;I have used NI-EMD, EEMD, Statistical-EMD (R package), CEEMDAN, NLMS-EMD and some others.&#xA;I implemented different versions all with different ways to avoid mode mixing and extrapolating the end point issue. IMF are not only repainting (no memory). &#xA;Also because of the splines, all artefacts to extrapolate prevent any one-step ahead prediction as we are making assumptions as to which direction last few data are projecting .&#xA;I even had one researcher working on EMD coding for me this latest implementation Derivative-optimized-EMD, but it failed badly in one-step ahead forecasting. Below is the link to the paper:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;faculty.nps.edu/pcchu/web_paper/jcam/demd.pdf&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have had conversation with researchers like Flandrin and I have been told that the EMD is suitable to denoise but quite unstable for doing prediction on IMFs in the future as modes will repaint and end point is always improper. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this help. &lt;/p&gt;&#xA;" OwnerUserId="12062" LastActivityDate="2014-09-18T00:13:44.317" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14785" PostTypeId="1" CreationDate="2014-09-18T00:41:53.750" Score="-2" ViewCount="168" Body="&lt;p&gt;If I have two assets in a portfolio with the same standard deviation and mean and the correlation between the assets is 0, theoretically could there be a situation where it would be beneficial to having a portfolio like this?&lt;/p&gt;&#xA;" OwnerDisplayName="user12091" LastEditorUserId="848" LastEditorDisplayName="user12091" LastEditDate="2014-09-18T05:20:10.113" LastActivityDate="2014-09-19T00:34:04.767" Title="Two assets with the same mean and standard deviation - Would there be any benefit?" Tags="&lt;portfolio-management&gt;&lt;asset-allocation&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2014-09-18T05:20:29.297" ContentLicense="CC BY-SA 3.0" />
  <row Id="14786" PostTypeId="2" ParentId="14785" CreationDate="2014-09-18T01:57:34.107" Score="2" Body="&lt;p&gt;It will bring diversification benefits to your portfolio. &#xA;Mean and standard deviation alone only measures the first two moments of the individual asset returns, with no regards for their joint distribution and correlation structure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming the mean and volatility measurements are the same for $2$ assets with correlation $corr&amp;lt;1$, then combining them will improve your portfolio's Sharpe ratio. To extend it further, assuming you have $n$ assets with same mean and volatility, then combining them into a portfolio will generally be beneficial if their average correlation is less than one.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, if you run a numerical optimization for these portfolio using Sharpe maximum as the objective metric, the resultant weighting scheme will favor those assets with low or negative correlation automatically. &lt;/p&gt;&#xA;" OwnerUserId="9381" LastEditorUserId="9381" LastEditDate="2014-09-19T00:34:04.767" LastActivityDate="2014-09-19T00:34:04.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14787" PostTypeId="1" AcceptedAnswerId="14795" CreationDate="2014-09-18T04:38:56.923" Score="12" ViewCount="2503" Body="&lt;p&gt;Girsanov theorem seems to have many different forms. I've got a problem matching the form in wiki to the one in Shreve's book, due to the difficulty of quadratic variation calculation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Below is &lt;a href=&quot;http://en.wikipedia.org/wiki/Girsanov_theorem&quot;&gt;the Girsanov Theorem from wiki&lt;/a&gt;&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Let $\{W_t\}$ be a Wiener process on the Wiener probability space $\{\Omega,\mathcal{F},P\}$. Let $X_t$ be a measurable process adapted to the natural filtration of the Wiener process $\{\mathcal{F}^W_t\}$.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Given an adapted process $X_t$ with $X_0 = 0$, define $Z_t=\mathcal{E}(X)_t,\,$ where $\mathcal{E}(X)$ is the stochastic exponential (or Doléans exponential) of X with respect to W, i.e. $\mathcal{E}(X)_t=\exp \left ( X_t - \frac{1}{2} [X]_t \right )$, where  $[X]_t$  is a quadratic variation for $X_t$. Thus $Z_t$ is a strictly positive local martingale, and a probability measure $Q$ can be defined on $\{\Omega,\mathcal{F}\}$ such that we have Radon–Nikodym derivative $\frac{d Q}{d P} |_{\mathcal{F}_t} = Z_t = \mathcal{E} (X)_t$. Then for each $t$ the measure $Q$ restricted to the unaugmented sigma fields $\mathcal{F}^W_t$ is equivalent to $P$ restricted to $\mathcal{F}^W_t.\,$&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Furthermore if $Y$ is a local martingale under $P$ then the process&#xA;  $\tilde Y_t = Y_t - \left[ Y,X \right]_t$ is a $Q$ local martingale on&#xA;  the filtered probability space $\{\Omega,F,Q,\{F^W_t\}\}$.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Below is the Girsanov Theorem from Shreve's book &quot;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0387401016&quot;&gt;Stochastic calculus for finance II&lt;/a&gt;&quot;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;Theorem 5.2.3 (Girsanov, one dimension)&lt;/em&gt;. Let $W(t)$, $0 \leq t \leq T$, be a  Brownian motion on a probability space $(\Omega, \mathscr F, \mathbb P)$, and let $\mathscr F(t)$, $0 \leq t \leq T$,  be a filtration for this Brownian motion. Let $\Theta(t)$, $0 \leq t \leq T$, be an adapted  process. Define  $$Z(t) = \text{exp} \left\{ -\int_0^t \Theta(u)dW(u) - \frac{1}{2} \int_0^t \Theta^2(u) du \right \}, \tag{5.2.11}$$  $$\widetilde W(t) = W(t) + \int_0^t \Theta(u) du, \tag{5.2.12}$$ and assume that  $$\mathbb E \int_0^T \Theta^2(u) Z^2(u) du &amp;lt; \infty \tag{5.2.13}$$ &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Set $Z = Z(T)$. Then $\mathbb E Z = 1$ and under the probability measure $\widetilde P$ given by  (5.2.1), the process $\widetilde W(t)$, $0 \leq t \leq T$, is a Brownian motion.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Seems the Girsanov theorem form wiki is more general than the one on Shreve's book.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Now my questions is&lt;/strong&gt;: How to derive the latter from the former?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems only need to take $Y(t) = W(t)$ and $X(t) = \int_0^t \Theta(u) du$ in the wiki definition. This left to prove&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$[W(t), \int_0^t \Theta(u) du]_t = - \int_0^t \Theta(u) du$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;, but how to calculate the quadratic variation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quadratic variation definition is &#xA;$$[X,Y](T) := \lim_{\|\Pi\|\to 0} \sum_{j=0}^{n-1} \left[ X(t_{j+1}) - X(t_j) \right] \left[ Y(t_{j+1}) - Y(t_j) \right]$$&#xA;, where $\Pi := \{ t_0, t_1, \cdots, t_n \}$&#xA;. But I'm a bit stuck here. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you please kindly give me some hint how to proceed?&lt;/p&gt;&#xA;" OwnerUserId="2161" LastEditorUserId="467" LastEditDate="2014-09-18T05:46:28.020" LastActivityDate="2014-11-26T14:46:01.227" Title="Girsanov Theorem and Quadratic Variation" Tags="&lt;stochastic-calculus&gt;&lt;girsanov&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="14788" PostTypeId="1" AcceptedAnswerId="14790" CreationDate="2014-09-18T05:44:15.527" Score="7" ViewCount="1831" Body="&lt;p&gt;I'm trying to obtain the Laplace transform of Call option price with repect to time to maturity under the CEV process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The well known Black scholes PDE is given by&#xA;$$&#xA;\frac{1}{2}\sigma(x)^2x^2\frac{\partial^2}{\partial x^2}C(x,\tau)+\mu x\frac{\partial}{\partial x}C(x,\tau)-rC(x,\tau)-\frac{\partial}{\partial \tau}C(x,\tau)=0.&#xA;$$&#xA;where the initial condition $C(x,0)=max(x-K,0)$ and $\sigma(x)=\delta x^\beta$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking the Laplace transform with respect to $\tau$, we obtain the following ODE:&#xA;$$&#xA;\frac{1}{2}\delta x^{2\beta+2}\frac{\partial^2}{\partial x^2}\hat{C}(x,\lambda)+\mu x\frac{\partial}{\partial x}\hat{C}(x,\lambda)-(\lambda+r)\hat{C}(x,\lambda)=-max(x-K,0).&#xA;$$&#xA;where $\hat{C}(x,\lambda)=\int_0^\infty e^{-\lambda \tau}C(x,\tau)d\tau$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the initial condition is transformed to &#xA;$$&#xA;\hat{C}(x,\lambda)=\int_0^\infty e^{-\lambda \tau}C(x,0) d\tau=max(x-K,0)/\lambda&#xA;$$(is this right??? it seems wrong..)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, $\hat{C}(x,\lambda)$ can be analytically formulated by the case $x&amp;gt;K$ and $x\leq K$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to get explicit formula for $\hat{C}(x,\tau)$? I can't proceed from this stage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know one paper, &quot;(2001 Dmitry) Pricing and Hedging Path-Dependent Options under the CEV&quot;, related to this question. However, there's big jumps for me to understand readily. Could you explain it step by step?&lt;/p&gt;&#xA;" OwnerUserId="12093" LastEditorUserId="12093" LastEditDate="2014-09-18T11:11:31.927" LastActivityDate="2018-09-20T06:32:37.187" Title="Solving Black-Scholes PDE using Laplace transform" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;black-scholes-pde&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14789" PostTypeId="2" ParentId="14772" CreationDate="2014-09-18T06:07:23.647" Score="0" Body="&lt;p&gt;I think this is a good idea; instead of &lt;em&gt;if&lt;/em&gt; I'd ask: &lt;em&gt;to what degree&lt;/em&gt; though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Futures prices reflect a lot of factors, so naturally you will only see some correlation which will change over time and even over different expiries (e.g. due to different liquidity in the back months).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My advice therefore: Make sure you understand how the markets work because you will have to explain a lot of, say, oddities on the way.  Other than that I think the approach is sound.&lt;/p&gt;&#xA;" OwnerUserId="1040" LastActivityDate="2014-09-18T06:07:23.647" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14790" PostTypeId="2" ParentId="14788" CreationDate="2014-09-18T06:26:21.500" Score="8" Body="&lt;p&gt;The following paper gives you really all of the missing steps in a very detailed form:&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://whit-www-fac.ad.syr.edu/rkshukla/Research/BS.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;A Complete Solution to the Black-Scholes Option Pricing Formula&lt;/a&gt; by Ravi Shukla and Michael Tomas&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the paper:&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;This presentation is purely for pedagogical purposes. In the course of doing work on&#xA;option pricing, we found no complete solution for the Black-Scholes model. By complete, we mean from the assumptions of the stochastic process to the closed form of the&#xA;Black-Scholes model with significant algebraic steps for the reader to follow. Many&#xA;texts derive the partial differential equation from the stochastic process and then make&#xA;a leap to the closed form solution. [&lt;em&gt;One text presents&lt;/em&gt;] steps based on the method&#xA;of Laplace transform [...] Here we present the complete solution filling in all the necessary algebraic details.&quot;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2018-09-20T06:32:37.187" LastActivityDate="2018-09-20T06:32:37.187" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="14792" PostTypeId="2" ParentId="7174" CreationDate="2014-09-18T07:36:33.340" Score="1" Body="&lt;p&gt;what I usually do for my calculations is the following. &#xA;Lets say that we want a neutral EV/EBITDA. And we have our companie's EV/EBITDA: A,B,C. We want to invest 100% and our weights will be called x,y,z. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore we have a system formed with 2 equations and 3 unknown variables: &#xA;x+y+z=100%&#xA;A*x+B*y+C*z=0&#xA;and 3 constraints: &#xA;x&gt;0,y&gt;0,z&gt;0. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just set this on Excel, apply the solver and you will get an easy and fast solution :)&lt;/p&gt;&#xA;" OwnerUserId="12089" LastActivityDate="2014-09-18T07:36:33.340" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14793" PostTypeId="1" CreationDate="2014-09-18T08:47:43.977" Score="2" ViewCount="842" Body="&lt;p&gt;I'm building a pattern recognition model for my master thesis. The idea is to build a framework with some Macro variables (long/short term rates; rates differential; equity; fx; vix) in order to find wich asset class (or investment style or strategy) would perform better on the current period, based on similarities with historical data. For that purpose I am using the K-nearest neighbour algorithm. I would like to ask sugestions regarding not only the quantitative method (KNN) but also the most significant macro variables to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also would like to ask if you know any relevant literature regarding this or any similar theme?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="12094" LastActivityDate="2014-09-18T13:49:43.663" Title="Analog - Pattern Recognition model using KNN" Tags="&lt;quant-trading-strategies&gt;&lt;backtesting&gt;&lt;correlation&gt;&lt;historical-data&gt;&lt;machine-learning&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14795" PostTypeId="2" ParentId="14787" CreationDate="2014-09-18T09:28:46.570" Score="10" Body="&lt;p&gt;Shreve's theorem also called &quot;Girsanov II&quot; indeed represents a special case of the general &quot;Girsanov I&quot; from Wiki above, with $$Y_t:=W_t,$$$$X_t:=-\int_0^t\Theta_udW_u$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can show: $$[Y,X]=-\int_0^t\Theta_udu$$ by using general Stochastic Calculus rules (e.g. p.37, 6.6 &lt;a href=&quot;http://www.math.wisc.edu/~kurtz/735/main735.pdf&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$[Y,X]=[W_t,-\int_0^t\Theta_udW_u]=-\int_0^t\Theta_ud[W_u,W_u]=-\int_0^t\Theta_udu$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;as $[W,W]=[W]=t$.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-11-26T14:46:01.227" LastActivityDate="2014-11-26T14:46:01.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14796" PostTypeId="1" CreationDate="2014-09-18T09:46:58.267" Score="1" ViewCount="151" Body="&lt;p&gt;I have been told that Ito's lemma serves as the stochastic calculus counterpart of the chain rule. And yet again my tutor mentioned it is not used for all stochastic processes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this statement true? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so what are the conditions in which Ito's lemma is used?&lt;/p&gt;&#xA;" OwnerUserId="12095" LastActivityDate="2014-09-18T13:54:15.753" Title="In what kind of stochastic process Ito's lemma is adopted?" Tags="&lt;stochastic-processes&gt;&lt;itos-lemma&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14798" PostTypeId="2" ParentId="14793" CreationDate="2014-09-18T13:49:43.663" Score="1" Body="&lt;p&gt;Such an approach is done by the systemic investor blogger in his blog&#xA;&lt;a href=&quot;http://systematicinvestor.wordpress.com/2012/01/20/time-series-matching-with-dynamic-time-warping/&quot; rel=&quot;nofollow&quot;&gt;Time Series Matching with Dynamic Time Warping&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-09-18T13:49:43.663" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14799" PostTypeId="1" CreationDate="2014-09-18T13:50:21.223" Score="1" ViewCount="139" Body="&lt;p&gt;I'm using 8 different variables (with daily observations) with the purpose to compare different months across the historical data. For that purpose I calculate the correlation between each month and the historical months in the data and then calculate the Euclidean distance in order to find the closer month. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does it make sense? Is there any literature regarding such experiments?&lt;/p&gt;&#xA;" OwnerUserId="12094" LastEditorUserId="2587" LastEditDate="2014-11-18T07:50:13.850" LastActivityDate="2014-12-18T11:53:50.380" Title="Does the correlation of matrices have explanatory power when building a pattern recognition model?" Tags="&lt;correlation&gt;&lt;historical-data&gt;&lt;correlation-matrix&gt;&lt;trading-patterns&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14800" PostTypeId="2" ParentId="14799" CreationDate="2014-09-18T14:31:54.533" Score="0" Body="&lt;p&gt;Analyzing seasonal time series &quot;by hand&quot; is not a good idea because there is a lot of time series machinery developed just for that. A simple example in R can be found &lt;a href=&quot;https://onlinecourses.science.psu.edu/stat510/node/68&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can apply clustering if it feels more natural but the main question is whether your model works out of sample.&lt;/p&gt;&#xA;" OwnerUserId="12031" LastEditorUserId="12031" LastEditDate="2014-09-18T20:01:21.930" LastActivityDate="2014-09-18T20:01:21.930" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14801" PostTypeId="1" AcceptedAnswerId="14812" CreationDate="2014-09-18T22:34:21.960" Score="4" ViewCount="2771" Body="&lt;p&gt;Most financial models include a &lt;em&gt;risk-free rate&lt;/em&gt; or &lt;em&gt;risk-free asset&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why should there be such thing as a positive &lt;strong&gt;risk-free rate&lt;/strong&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I dont see why an asset would provide a positive (real) return if it hadn't any risk to it: If there was an asset with positive return without risk, everyone would buy it until its price reflects no return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or: Why would there be a positive riskfree rate if there is &lt;strong&gt;no free lunch&lt;/strong&gt;?&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-09-19T07:07:14.300" LastActivityDate="2017-04-16T12:21:57.757" Title="Why would there be a positive risk-free rate?" Tags="&lt;risk&gt;&lt;risk-models&gt;&lt;asset-allocation&gt;&lt;asset-pricing&gt;&lt;asset&gt;" AnswerCount="9" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14802" PostTypeId="1" AcceptedAnswerId="14815" CreationDate="2014-09-18T23:23:34.050" Score="2" ViewCount="918" Body="&lt;p&gt;What is some prerequisite book in mathematics or finance that can help me to read &quot;mathematical methods for financial markets&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found a lot of difficulties when try to start to read the PDF of this book.&lt;/p&gt;&#xA;" OwnerUserId="2744" LastEditorUserId="2744" LastEditDate="2014-09-18T23:38:31.760" LastActivityDate="2014-09-19T17:45:08.403" Title="What is some prerequisite book that can help me to read &quot;mathematical methods for financial markets&quot;" Tags="&lt;reference-request&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14803" PostTypeId="2" ParentId="14801" CreationDate="2014-09-19T00:09:42.920" Score="2" Body="&lt;p&gt;My non-rigorous answer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The future is uncertain.  Even if there is no financial risk to investing in the &quot;risk free&quot; asset there is personal risk.  For example, I could get hit by a car and die.  Even if I survive till the moment that I liquidate my investment I will have less time left in my life to enjoy it.  I need to be compensated for giving up this immediate compensation, which is what the risk free rate does.   &lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2014-09-19T00:09:42.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14804" PostTypeId="2" ParentId="14801" CreationDate="2014-09-19T02:50:32.347" Score="2" Body="&lt;p&gt;In my opinion, risk free rate is not necessarily positive and not so important to pricing theory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It happened to be positive in most cases, but imagine a planet using Uranium-235 instead of gold as the money and unknowingly suffers from a shrinking population, likely the risk free rate is negative. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below are what I regard as important in pricing theory, starting from &quot;risk free measure&quot;. &quot;Risk free rate&quot; is implied by the discount rate $D(0; t)$ but not required to be positive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Definition: &lt;strong&gt;risk-neutral measure&lt;/strong&gt; $P$ is equivalent to $P^0$ and under which, the discounted stock price $D(0; t)S_i(t)$ is a martingale, $\forall i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lemma: the discounted portfolio value $D(0; t)X(t)$ is a martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Definition: An &lt;strong&gt;arbitrage&lt;/strong&gt; is a portfolio value process $X(t)$ satisfying $X(0) = 0$ and&#xA;also satisfying for some time $t &amp;gt; 0$, $P[X(T)  0] = 1$, $P[X(T) &amp;gt; 0] &amp;gt; 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;First fundamental theorem of asset pricing&lt;/strong&gt;: If a market model has a risk-neutral&#xA;probability measure, then it does not admit arbitrage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Definition: A market model is &lt;strong&gt;complete&lt;/strong&gt; if every derivative security can be&#xA;hedged.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Second fundamental theorem of asset pricing&lt;/strong&gt;: Consider a market model that&#xA;has a risk-neutral probability measure. The model is complete if and only if the risk-neutral probability measure is unique.&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2014-09-19T02:50:32.347" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14805" PostTypeId="2" ParentId="14801" CreationDate="2014-09-19T04:54:29.497" Score="3" Body="&lt;p&gt;The risk free rate is important and the reason for the inclusion and consideration of the risk free rate is that investors do not get compensated for not taking on risk. Now, we can argue whether the risk free rate truly provides risk free returns (we all should know that it does not, but ...) but it is important in the context of pricing risky assets that the market does not compensate for not taking risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Couple other points:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Another reason why we essentially &quot;change measure&quot; and &quot;price, using risk neutral probabilities&quot; is because such apparatus makes pricing the hedge, and hence the risky asset itself much easier. The hardest part in pricing risky assets is that we do not know at which rate a risky asset's future cash flows should be discounted at. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I provided reasons why the notion of a risk free rate of return should be included in most asset pricing models. But that does not mean that such risk free rate of return cannot be negative. It seems illogical and counter intuitive at first, but investors are willing to pay a price even to lend money if the &quot;expected return&quot; on other competing investments is inferior. Unfortunately many academicians and academic research has not caught up with the fact of such investor behavior. Investors always choose the relatively most attractive investment not the absolutely best investment. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The reason why not everyone invests in a &quot;risk free asset&quot;? Simple. Because investors compare investments on the basis of risk-adjusted returns and because many investors are &lt;strong&gt;rational to their utility&lt;/strong&gt;. If an investor prefers to get rich quick then he/she will invest in an asset that provides a potential return of 50% even if the risk of ruin is elevated relative to a risk free asset that pays 2%-3% p.a., for example.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I would disagree in that any &quot;fundamental theorem of asset pricing&quot; plays a role in answering the question why we need to consider the risk free rate when pricing risky assets. The theorems help in answering the question whether we can price derivatives in a risk free context, hence, whether we are allowed to change measure without completely messing up the accuracy of pricing. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2014-09-19T06:58:28.730" LastActivityDate="2014-09-19T06:58:28.730" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14806" PostTypeId="2" ParentId="14755" CreationDate="2014-09-19T05:30:01.777" Score="9" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;To provide a straight forward answer: It is &lt;strong&gt;not&lt;/strong&gt; a good model. It never was, it never will be. Until we all do not come up with a better model that provides better modeling accuracy while it is equally intuitive and makes similarly simplifying assumptions the BS model with its geometric brownian motion component is here to stay.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It actually does not matter what model the market agrees on to use for the purpose of translating between an option price and its implied volatility. BS is merely a translation tool, nothing more, nothing less. What is really priced by the market is implied volatility. What is traded, however, is the option price. Hence, as long as the market agrees on one standardized model it does not matter what exact model we are talking about. Example: When a broker dealer and buy side trader agree on the particulars of a standard European or American option they obviously have to agree on price, however, if the price diverts by a significant amount between both desks then both traders interact which implied vols they are taking into account. Hence the model and underlying driving brownian motion plays a very insignificant role in this particular context.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Models and their underlying assumptions become much more important when forecasting asset prices as well as when pricing non-standard (aka non vanilla) derivatives products where the model is sufficiently complex and there are a number of input variables that the choice of models make a significant difference. Example: A more complex interest rate structured note, such as a PRDC. It is very easy to arrive at a 50bps-1% pricing differential when making slight adjustments to modeling assumptions, the way correlations are computed, or what have you. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Models are not created or chosen on the basis of whether &quot;smart traders&quot; are able to &quot;beat&quot; the market. The market imho is maybe the second most complex construct after the human brain, more complex than any concept in Physics, Mathematics, or other science. Nothing in the market is stable, we are exposed to ever changing complexities, correlations, and micro market dynamics. Models are chosen to somewhat approximate the statistical properties of market behavior but much for their simplicity and intuition. It might be shocking news to some academicians that most seasoned trading practitioners attach much more importance, time, and efforts to improving risk managing and risk limiting models as well as approaches than to pricing models in the full knowledge that pricing models will always be imperfect and never capture all the dynamics in the market. It might also be in complete disagreement with many pure quants when I say that it is utterly unimportant whether I price an option using a geometric brownian motion or an arithmetic one. Sure we will end up with a different option price, but so what? Which one is more accurate? It does not matter. Why? Example: If my model constantly overprices option prices then I pay each time above fair market when I buy and I am not able to sell to other market practitioners at the prices I believe are fair. What will I do? I will tweak my model until I get to where most other practitioners price. Result? Most traders align their models like ducks in a row. More or less all models on the street are identical. And if a new model pops up or someone makes slight improvements that are worthy of studying then you can trust me that such model makes it (legally or illegally) across most firms' desk in no time. The result is the same in that most practitioners price with very similar models, you can call it Black Scholes or anything else you want.  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;My sobering assessment of how to &quot;engineer&quot; statistically significant profits in the market is that there are very few who truly understand the relationships between the real economy and market dynamics. Very few consistently outperform the broad market. Guess what most of them have in common? An uncanny willingness and ability to buy risk off those whose risk limits are breached (emotionally or through hard-coded limits)and an incredible attention to detail when it comes to managing risk exposure. A small handful of such minority are applying quantitative or mathematical concepts to how they invest and trade. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2014-09-19T06:17:18.270" LastActivityDate="2014-09-19T06:17:18.270" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14807" PostTypeId="2" ParentId="14772" CreationDate="2014-09-19T08:24:20.137" Score="1" Body="&lt;p&gt;Rather than &quot;data mining&quot;, I'd try to have a more structured approach to the selection of variables / factors: the key drivers in ag prices are, as always in economics, supply and demand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Supply is, as you say, determined by planted acreage and yields, which in turn depend on weather and other factors (for example fertilization - can't run heavy on Nitrogen for many years on a row). I'd start from the USDA website.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From what I read in your question, demand and its drivers are missing. Luckily, demand is relatively stable when it comes to food consumption. However, corn ethanol in the past years was a big swing factor resulting in a corn madness.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A more structured approach would help you understand and interpret your results, imo.&#xA;I think it is a great project, but a big project. You could theoretically invest your entire career on this subject.&lt;/p&gt;&#xA;" OwnerUserId="6781" LastActivityDate="2014-09-19T08:24:20.137" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14810" PostTypeId="2" ParentId="14801" CreationDate="2014-09-19T10:27:17.307" Score="1" Body="&lt;p&gt;I suggest to distinguish three things: Why risk-free rate? What defines its magnitude and sign? And what is its role in specific economic models?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Why risk-free rate&quot; is very simple to answer: Because you want to compare cash at different points in time. One assumes that the difference between cash at time $t_1$ i.e. $C(t_1)$ and at time $t_2$ is $C(t_1) - D(t_1,t_2)C(t_2)$, where $D(t_1,t_2)$ is the/a discount factor and $r(t_1, t_2) = 1 / D(t_1, t_2)$ the according risk-free rate. This is pure convention and has nothing to do with risk, pricing models or the real world. Even if you believed this were utter nonsense and money at different times can be directly compared just by subtracting the amounts, you do not get around this, as you are just saying $D=1$ or -equivalently- that risk free rate is zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;What defines its magnitude and sign&quot;&#xA;Often theories or models assume positive risk free rates and user9403 gave good reasons why this may be a reasonable assumption. There are also situations possible where the risk-free rates might be negative. One example being storage cost for the risk-free asset, e.g. the cost of secure vaults to hoard your cash. A standard textbook on macroeconomics should give you more details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that contrary to your comment positive risk-free rate does not necessarily create arbitrage. To buy the risk-free asset you have to offer something in exchange unless you borrow what you offer. But your cost of borrowing will always be higher than the risk free rate.&lt;/p&gt;&#xA;" OwnerUserId="482" LastActivityDate="2014-09-19T10:27:17.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14811" PostTypeId="2" ParentId="1576" CreationDate="2014-09-19T13:04:04.947" Score="2" Body="&lt;p&gt;As a start. it is easy to prove that diversification always helps whenever the variances are all finite. To see this, consider two stocks A and B with variances var(A) and var(B). Then the variance of the portfolio where you mix them in equal parts is:&#xA;$$var((A+B)/2) = var(A)/4+var(B)/4+cov(A,B)/2 =\\ =var(A)/2 + cov(A,B)/2.$$&#xA;The largest that $cov(A,B)$ can be is $var(A)/2$. So the largest this expression can be is $var(A)$, but when $A$ and $B$ are less correlated, this expression will give less than $var(A)$, meaning that diversification helped.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Overall, we see that when all variances are not infinite then diversification doesn't hurt, and it always helps unless the stocks are perfectly correlated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what about the case where the variances are undefined, like in processes based on Cauchy distributions? Well, the math breaks down, but you see that the intuition and conceptual reasoning does not break down: mixing stocks reduces the influence of extreme movements in either individual stock. This is still true, so I'd expect that no matter how we choose to re-define our concepts, we'll still get a proof that diversification helps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, one might try to define volatility for wild processes (like Levy processes) not by measuring the standard deviation of the price change, but by measuring the chance that our loss after $T$ time units would be more than $L$. Then you get a two-parameter measures that is always correctly defined. You can then look at variables $A$ and $B$, assume the measure gives the same result for both, and try to compute this measure for their average. I'm pretty sure that you'll get that this measure comes out smaller for their average than it was for $A$ and $B$. Likewise, I expect any reasonable definition of volatility to exhibit the same behavior.&lt;/p&gt;&#xA;" OwnerUserId="12099" LastActivityDate="2014-09-19T13:04:04.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14812" PostTypeId="2" ParentId="14801" CreationDate="2014-09-19T14:27:44.333" Score="6" Body="&lt;p&gt;Risk-free rate is that you get for letting someone else use your money in a riskless manner. Suppose we live in a world where there is no risk whatsoever. In particular, if you lend someone \$100 there is 100% certainty that he will pay you back in a year. Before the pay date, he can do whatever he wants with your $100, while you have no access to it. Even though the risk is zero, you still have to be compensated for the inconvenience, and that's what the risk-free rate is for.&lt;/p&gt;&#xA;" OwnerUserId="12031" LastEditorUserId="12031" LastEditDate="2014-09-19T20:08:31.350" LastActivityDate="2014-09-19T20:08:31.350" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14814" PostTypeId="2" ParentId="14801" CreationDate="2014-09-19T17:32:43.480" Score="1" Body="&lt;p&gt;It is a decision problem, it is always a decision problem...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most basic decision problem is a lottery that gives you X (X &gt; 0) for a chance of %Y and nothing for %(100-Y). Someone comes and offers you to buy your ticket for Z (0 &amp;lt; Z &amp;lt; X, otherwise it is trivial). What would you do? If Z is close to X, you need to be more risk-willing (or seeking) to refuse the deal. If Z is close to 0 you need to be more risk-averse to accept the deal. Usually if Z is somewhere close to X*Y/100, you are called risk-neutral. The function that &quot;regulates&quot; your responses to such situations is called your utility function (curve). In the most basic terms it is between risky asset (i.e. a stock) and a risk-free asset (bond).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is then modeled as an equilibrium to find the &quot;fair price&quot;. There is usually an implicit assumption on your utility function (some diminishing returns curve, less and less marginal utility for marginal dollar gains). Fair price can be defined as &quot;a point where no party gets a better deal than the other or by making a deal with a 3rd party&quot;. Because if it would make me worse on a deal, I would not agree. And if I can make a better deal with a 3rd party I would take that deal. If the deals are not correctly priced, they can be constantly abused (it is not arbitrage, it is the law of large numbers). The fair price means you are indifferent to taking any side of the bet or investing in risk-free rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of positive risk-free rate, a third option arises; keep your money to yourself. Though, negative risk-free rate occurs in real life. So, there is more to life than trading (probably keeping large amounts of money safe might be more expensive than the risk-free rate provided).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a positive risk free rate because there exists bodies that are willing to take the risk and believe they will make more money than they offered to you. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question &quot;is there really a risk-free rate?&quot; notwithstanding, why would you choose to hand over your money for a fixed return if you can access to the same deal the person will make with your money? Suppose there are infinite deals and all probabilities and payoffs are well defined. Would utility curves matter? The only thing that would prevent utility curves to be obsolete is the absorbing state (losing all your money). You cannot return from that. Assuming not playing is not an option, eventually there will be a single winner with all the money and all others broke. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In real life, time is also a resource so the economy expands, rules are more complex and probabilities not clear. As a result, utility curves are various and changing. There is also consumption. So positive interest rate is a belief for the offering party they can do better performance with that money of yours and an incentive for you to avoid spending that money or investing in something else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No free lunch is something associated with infinite abuse of the contracts. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And a technical reason for options pricing, keeping risk free rate positive helps some models' properties to stay same. For example if your risk free rate is negative it might be justified to exercise a non-dividend paying stock's american option early and not justified to exercise the put.&lt;/p&gt;&#xA;" OwnerUserId="8147" LastActivityDate="2014-09-19T17:32:43.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14815" PostTypeId="2" ParentId="14802" CreationDate="2014-09-19T17:45:08.403" Score="2" Body="&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/144192311X&quot; rel=&quot;nofollow&quot;&gt;Shreve's book&lt;/a&gt; can really be thought as &quot;calculus of finance&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you say there should be pre-calculus or high school mathematics of finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0133456315&quot; rel=&quot;nofollow&quot;&gt;Options, Futures, and Other Derivatives&lt;/a&gt; - John C Hull&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0979757622&quot; rel=&quot;nofollow&quot;&gt;A Primer For The Mathematics Of Financial Engineering (Financial Engineering Advanced Background Series)&lt;/a&gt; - Dan Stefanica&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course this is from my perspective of derivatives product. Something more for asset pricing, enter &lt;a href=&quot;http://www.google.com.tr/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=2&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0CCoQFjAB&amp;amp;url=http%3A%2F%2Fwww.chicagobooth.edu%2Ffaculty%2Fdirectory%2Fc%2Fjohn-h-cochrane&amp;amp;ei=LGscVNC5IYTjaIKTgIAK&amp;amp;usg=AFQjCNGJhrxQfu-SJao_oMuAld1EUlG5Yw&amp;amp;sig2=RDyfYKlPY5qCmBzG0U4ttw&quot; rel=&quot;nofollow&quot;&gt;John Cochrane&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://press.princeton.edu/titles/7836.html&quot; rel=&quot;nofollow&quot;&gt;Book&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://faculty.chicagobooth.edu/john.cochrane/teaching/35904_Asset_Pricing/&quot; rel=&quot;nofollow&quot;&gt;Course page&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.coursera.org/course/assetpricing&quot; rel=&quot;nofollow&quot;&gt;Coursera class&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There can be better sources but these are also good enough to start with.&lt;/p&gt;&#xA;" OwnerUserId="8147" LastActivityDate="2014-09-19T17:45:08.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14816" PostTypeId="2" ParentId="14801" CreationDate="2014-09-19T20:54:05.157" Score="1" Body="&lt;p&gt;Ashwath Damodaran explains risk free rate in his 2008 paper, &lt;a href=&quot;http://www.stern.nyu.edu/~adamodar/pdfiles/papers/riskfreerate.pdf&quot; rel=&quot;nofollow&quot;&gt;&quot;What is risk free rate? A Search for the Basic Building Block&quot;&lt;/a&gt;. He has explained risk free rate from the perspective of investment. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we invest in an risk free asset then we expect guaranteed return. &quot;An investment that delivers the same return, no matter what the scenario, should be uncorrelated with risky investments with returns that vary across scenarios.&quot; The investment is termed as risk free because there is no variance around the expected return. And the actual return is always equal to the expected return. In the real world, we define risk free return as government bond rate (which is the closest we can get, assuming no default rate for the country). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why positive risk-free rate?&#xA;It happens to be positive in our case because we have positive expected return for a risk free asset. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;No free lunch&quot;: Yes you are right. We do not have any risk free asset in this world but in models and while solving problems we define least risky asset as risk free. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In models, US T-bill is termed as risk free but during mortgage crisis, was it really risk free? &lt;/p&gt;&#xA;" OwnerUserId="12097" LastEditorUserId="12097" LastEditDate="2014-09-20T05:35:33.983" LastActivityDate="2014-09-20T05:35:33.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14819" PostTypeId="1" AcceptedAnswerId="14820" CreationDate="2014-09-20T13:34:10.363" Score="3" ViewCount="544" Body="&lt;p&gt;There are different ways to optimize portfolios: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \max R^Tw\tag{1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \min w^T \Sigma w\tag{2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and finally using a risk tolerance $\lambda$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \min{(w^T\Sigma w-\lambda R^T w)}\tag{3}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose we have the constraint $\sum w_i = 1$, $w_i\ge 0$ for all the optimization problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, we can define further constraints for problems $(1)$ and $(2)$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For $(1)$: $w^T\Sigma w\le \sigma$, i.e. the risk should not exceed a certain level $\sigma$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same is possible for $(2)$ with return, adding the constraint: $R^T w\ge r$, for a minimal target return $r$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, in the optimization problem $(3)$, does it make sense to add a constraint like $w^T \Sigma w \le \sigma$ or $R^Tw \ge r$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I right to say that adding such a constraint we would discard the solution (a efficient frontier portfolio) which does not satisfy this constraint? &lt;/p&gt;&#xA;" OwnerUserId="17133" LastEditorUserId="467" LastEditDate="2014-11-20T01:11:59.960" LastActivityDate="2014-11-20T01:11:59.960" Title="Different ways of portfolio optimization" Tags="&lt;portfolio-optimization&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14820" PostTypeId="2" ParentId="14819" CreationDate="2014-09-20T16:24:12.893" Score="2" Body="&lt;p&gt;It doesn't make sense because (3) is a complete set up: it defines the (minus utility) function that you have to minimize wrt $w$. The parameter $\lambda$ allows one to assess the tradeoff between risk and return explicitly. On the other hand, in (1) and (2) such parameter is absent but the constraints on risk in (1) and on return in (2) perform a function similar to that of $\lambda$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is only one efficient frontier. Each point on the frontier is a portolio that has minimal variance for a given expected return. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are 3 equivalent ways to obtain the frontier, and &lt;a href=&quot;http://en.wikipedia.org/wiki/Modern_portfolio_theory#The_efficient_frontier_with_no_risk-free_asset&quot; rel=&quot;nofollow&quot;&gt;Wikipedia&lt;/a&gt; mentions two of them explicitly: I) Solve (3) for all positive values of $\lambda$ II) Solve (2) for all possible values of expected return. One can also solve (1) for all possible values of portfolio variance. In any case, the solution is the very same efficient frontier.&lt;/p&gt;&#xA;" OwnerUserId="12031" LastEditorUserId="12031" LastEditDate="2014-09-20T20:02:23.093" LastActivityDate="2014-09-20T20:02:23.093" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14822" PostTypeId="1" CreationDate="2014-09-21T10:44:08.940" Score="1" ViewCount="290" Body="&lt;p&gt;I've been playing with stock data and I've discovered a terrible truth : in 10 years apple stock price passed from roughly 3\$ to 100$. However this gain isn't due to intraday price variation &lt;code&gt;dayN_close - dayN_open&lt;/code&gt; but the overnight variation &lt;code&gt;dayN_open - dayN-1_close&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact when you sum up the &lt;code&gt;intraday variation&lt;/code&gt; since 10years you get roughly &lt;code&gt;-48$&lt;/code&gt; drop in price (starting at 3\$ in 2004) while when you sum up the &lt;code&gt;overnight variation&lt;/code&gt; you get &lt;code&gt;+148$&lt;/code&gt; augmentation in price (148-48=100$ nowadays).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This mean that the reason why apple stock price went from 3 to 100 in 10years is the overnight variation in price. This is quite unexpected, if there was no overnight variation the stock price would have died a long time ago... Why is that ? Why do they say that intraday traders close their position at then end of day while most gains can be done overnight (buy just before the market close and sell just after it opens). Is this observation true for other symbols too or is it specific to apple ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit :&lt;/strong&gt;  Well I performed some additional analysis and it turns out that the gain due to overnight variation is because over 10 years the frequency of the o/n variation being positive is by far superior to it being negative. As for the intraday variation the probability of it going downwards is slightly superior to it going upwards. However the variations that are high (&gt;3% let's say) are more frequent intradaily. o/n variation tends to be small but steadily positive basically. As for the data I took it from nasdaq.com so I hope it isn't glitchy.&lt;/p&gt;&#xA;" OwnerUserId="12113" LastEditorUserId="12113" LastEditDate="2014-09-21T16:28:12.207" LastActivityDate="2014-09-23T07:12:46.383" Title="Why most of apple stock price since 10years have been gained overnight?" Tags="&lt;equities&gt;&lt;price&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14823" PostTypeId="2" ParentId="14822" CreationDate="2014-09-21T11:37:19.727" Score="3" Body="&lt;p&gt;&lt;strong&gt;This mean that the reason why apple stock price went from 3 to 100 in 10years is the overnight variation in price. This is quite unexpected, if there was no overnight variation the stock price would have died a long time ago... Why is that ? Have we been lying to us ?&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is because many business and financial news are reported at market close, either pre-market or during after-hours. This includes quarterly and annual financial results. This allows financial operators to go through the material, analyze the data, digest the news and &quot;price in&quot; new information. Open prices &quot;jump&quot; wrt closing prices of the previous trading day on new, relevant, information released by the companies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As correctly suggested by @g_puffo, some trading venues offer extended hours trading (after-hours and pre-market). This is the case of the Nasdaq, where AAPL is listed: &lt;a href=&quot;http://www.nasdaq.com/extended-trading/&quot; rel=&quot;nofollow&quot;&gt;http://www.nasdaq.com/extended-trading/&lt;/a&gt;&#xA;Extended hours sessions give an opportunity to react on news, but there are several caveats: &lt;a href=&quot;http://www.sec.gov/investor/pubs/afterhours.htm&quot; rel=&quot;nofollow&quot;&gt;http://www.sec.gov/investor/pubs/afterhours.htm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Why do they say that intraday traders close their position at then end of day while most gains can be done overnight (buy just before the market close and sell just after it opens). Is this observation true for other symbols too or is it specific to apple ?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intraday traders do not carry overnight exposures because.. well, they trade intraday. Their strategies are designed to profit from intraday market moves, determined by the market activity of other stock operators. They do not &quot;invest&quot;, ie they do not aim at anticipate business developments and company financial news. This is why they liquidate their positions before/at market close.&lt;/p&gt;&#xA;" OwnerUserId="6781" LastEditorUserId="6781" LastEditDate="2014-09-23T07:12:46.383" LastActivityDate="2014-09-23T07:12:46.383" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14825" PostTypeId="2" ParentId="14801" CreationDate="2014-09-21T14:28:46.543" Score="1" Body="&lt;p&gt;A risk free rate is the return rate from investing in an asset that has the lowest risk found in the market. It is a naming convention. The least risky of all returns is labelled as 'risk free' for the purpose of various models and resulting discussions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another parallel answer is that you must understand what financial risk is in the first place. It is, most of the time (in investments), the risk of a return not exactly matching the expected value. Often represented by concepts of standard deviation of expected (or historical) returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you understand this concept of risk and the naming convention, you understand the meaning and use of 'risk free'.&lt;/p&gt;&#xA;" OwnerUserId="12114" LastActivityDate="2014-09-21T14:28:46.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14826" PostTypeId="2" ParentId="14456" CreationDate="2014-09-22T07:06:49.160" Score="2" Body="&lt;p&gt;It might help to look at the solutions of the SDEs that you have there.&#xA;In the first case&#xA;$$&#xA;S_t/S_0 = \exp(-\sigma^2/2 t + \sigma B_t) \quad \quad (1)&#xA;$$&#xA;Thus if you take the log then $\sigma$ is the volatility of the log-returns (assume that $t=1$ time step),.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the second case&#xA;$$&#xA;S_t = S_0 + \sigma B_t \rightarrow S_t - S_0 = \sigma B_t  \quad \quad(2)&#xA;$$&#xA;then $\sigma$ is the volatility of the absolute differences.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Coming back to your actual question, the solution should be a simple expansion of the exponential.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take the solution of the geometric Brownian motion above (1) and we look at the time step of $\Delta t$:&#xA;$$&#xA;S_{t + \Delta t} = S_t \exp(-\sigma_{ln}^2/2 \Delta t + \sigma_{ln} B_{t+\Delta t}) \approx S_t \exp( \sigma_{ln} B_{t+\Delta t})&#xA;$$&#xA;where we observe that $\sigma_{ln}^2/2$ is small. Furthermore note that &#xA;$$&#xA;\exp(x) = \sum_{n=0}^\infty x^n/n! \approx 1 + x&#xA;$$&#xA;where the last step is an approximation for $x$ small, thus &#xA;$$&#xA;S_{t + \Delta t} \approx S_t (1+ \sigma_{ln} B_{t+\Delta t})&#xA;$$&#xA;and finally (after multiplication and rearranging terms)&#xA;$$&#xA;S_{t + \Delta t} - S_t \approx S_t \sigma_{ln} B_{t+\Delta t}&#xA;$$&#xA;The last equation is of the form (2) with $\sigma = \sigma_{ln} S_t$.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2014-09-22T13:37:23.230" LastActivityDate="2014-09-22T13:37:23.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14827" PostTypeId="1" CreationDate="2014-09-22T11:44:29.010" Score="2" ViewCount="239" Body="&lt;p&gt;In one of the topic here, particularly in the comments, i saw a link to the page describing connection between Antagonistic Games and finances but i cannot find it now and would appreciate if somebody could remind me where it was ... seems that SE search does not search for a keyword in comments.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Also one of the suggestions in game theory claims that : &#xA;  if there are two losing games then there is mix of them that can be winning.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Questions :&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Could anyone suggest a possible combination of such games in trading&#xA;or at least give a tip about which side of trading can rely on&#xA;mentioned suggestion - prediction, money management, etc?&lt;/li&gt;&#xA;&lt;li&gt;Could i ask you to point me to some useful resources dedicated to&#xA;the application of Game Theory in real life?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="6855" LastActivityDate="2014-09-22T11:44:29.010" Title="Game theory and antagonistic games in trading" Tags="&lt;money-management&gt;&lt;game-theory&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14830" PostTypeId="1" CreationDate="2014-09-23T01:06:14.473" Score="2" ViewCount="2177" Body="&lt;p&gt;I know there are APIs from different brokers that allows you to trade and also obtain information about specific companies, but I wonder if there are equity/asset screeners that are API-based and can be triggered in real-time? For example, I'd love to have an API that would alert me of any equities that are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Near 52 week low&lt;/li&gt;&#xA;&lt;li&gt;Have P/E &amp;lt; 30&lt;/li&gt;&#xA;&lt;li&gt;5 year average earnings growth is &gt; 5%&lt;/li&gt;&#xA;&lt;li&gt;etc.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I could do it myself with brokerage screeners, but they are totally manual; I'd have to build and run them. If there are APIs that can be tied to automated scripts, that'd be amazing, as it would mean both speed and coverage in terms of trading opportunities.&lt;/p&gt;&#xA;" OwnerUserId="12124" LastActivityDate="2017-05-05T16:48:14.863" Title="API-based equity screeners?" Tags="&lt;data&gt;&lt;programming&gt;" AnswerCount="5" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14833" PostTypeId="1" AcceptedAnswerId="14854" CreationDate="2014-09-23T09:06:19.347" Score="2" ViewCount="8323" Body="&lt;p&gt;I am new to Value at Risk subject in fact everything related to quant. Can any body validate the Value at Risk  Model on the option price ? I am using a below explained approach .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;our portfolio contains an Out-the-money call on Corn sept delivery month with one month until expiry. Based on Historical VaR, and assuming we are interested in the 1-day 95% VaR, you might be tempted to gather the returns on the option over the past 100 days (or 200, or 500, …), sort them, and select the 5th worst return. This would be wrong. The problem is that we are trying to evaluate the risk of an out-the-money call with one month to expiry, but 100 days ago the option had one month plus 100 days to expiry and may have been far in-the-money or out-of-the-money.What we need to do in this case is to go back every day for the past 100 day and determine not what the returns of our option were, but what the returns of our option would have been. We do this by going back over the past 100 days, observing the change in the inputs to our option price (underlying &#xA;price, implied volatility, dividend yield, risk-free rate, and time to expiry), and then calculating what the price of our option would have been. For example, if the current price of Corn is 1,077.29 and the return on Corn 100 days ago was –0.76%, then we would use an underlying price of $1,069.10, $1,077.29 x (1 – 0.76%) = $1,069.10.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To price our option. We refer to this approach as back casting, and to the resulting prices as backcast prices.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The next step in backcasting with options is to take the backcast price of the option, and calculate a backcast return. For example, if the current price of our Corn option is 10 and the backcast  price calculated  ( &lt;em&gt;Using Black Scholes, Black 76 , Binomial Tree&lt;/em&gt;  )  in the previous step was $11, then our backcast return would be 10, (11 – 10)/10 = 10 percent. Notice that our starting price for calculating the backcast return is the current price of the option. If we are evaluating the risk of the option on 12/12/2013 and our 100 day backcast window runs from 7/23/2013 - 12/11/2013, then the first back cast return would use the 12/12/2013 and the backcast price on 7/23/2013. The second backcast return would use the 12/12/2013 and the backcast price on 7/24/2013.  We repeat this process for each day in our backcast window (100 days, 200 days, 500 days, …).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The final step in backcasting with options is the same as it would be for any security: we sort the backcast returns and then select the return corresponding to our VaR (e.g. the 5th worst of 100 for 95% VaR). &#xA;In summary, for Commodity options the historical method is a four step process: &#xA;1.  Calculate backcast values of the underline using Spot Price *( 1+ daily return). &#xA;2.  Calculate the backcast price of the option on each of the backcast dates(Using Binomial , Black Scholes, Black 76) . &#xA;3.  Calculate the backcast returns for the option. (Maket Observed Return - Calcualte option price for the back cast Date)/ Maket Observed Return&#xA;4.  Sort the backcast returns, and determine the VaR. &lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Assumption&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;While revaluing the option time to maturity in the option is constant from the simulation day to time to maturity .&#xA;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would really appreciate if any one can help to validate the model ? &lt;/p&gt;&#xA;" OwnerUserId="12126" LastEditorUserId="12126" LastEditDate="2014-09-23T10:53:12.600" LastActivityDate="2014-09-25T20:27:35.017" Title="Historical Value At Risk on option portfolio" Tags="&lt;options&gt;&lt;var&gt;&lt;historical-data&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14835" PostTypeId="2" ParentId="12751" CreationDate="2014-09-23T15:43:57.137" Score="1" Body="&lt;p&gt;I think a blanket haircut is a bad idea as it could mask actual excessive P&amp;amp;L that should be flagged.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would recommend a &lt;strong&gt;documented&lt;/strong&gt; process where P&amp;amp;L that exceeds a threshold is investigated and technology issues can be handled by hand.  In this situation, you can more safely apply a haircut to individual items where you can identify the technology issue and more precisely estimate the actual P&amp;amp;L.&lt;/p&gt;&#xA;" OwnerUserId="12050" LastActivityDate="2014-09-23T15:43:57.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14837" PostTypeId="1" AcceptedAnswerId="14839" CreationDate="2014-09-23T18:04:03.280" Score="1" ViewCount="864" Body="&lt;p&gt;I am confused about the following: I checked daily and weekly prices for Exxon (and also GE). But the values for Open, Low, High, Close, Vol., Adj. Close for both data streams seem to differ from each other. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Example (Exxon financial data via Finance Yahoo):&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;---Date ----------------- Close -------------- Close&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Jan.19.1970 ----- 60.25 (weekly) ----- 61.87 (daily)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;or&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Sep.18.2014 ----- 95.78 (weekly) ----- 97.77 (daily)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;On the eye it seems that the only value which is the same in both data streams is Open price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is this? Normally I would suggest that it should be possible to convert a daily dataset into a monthly dataset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope anyone can help to solve the confusion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers&#xA;Peter&lt;/p&gt;&#xA;" OwnerUserId="12131" LastActivityDate="2014-09-23T22:45:27.627" Title="Difference in weekly and monthly data" Tags="&lt;data&gt;&lt;price&gt;&lt;financial&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14838" PostTypeId="1" CreationDate="2014-09-23T20:27:01.220" Score="2" ViewCount="543" Body="&lt;p&gt;I don't understand why Rule 610 from Reg NMS was introduced: what was the problem with locked markets?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have read that one of the issues is that it forced a market maker (say, from Nasdaq) who needed to buy a stock (and who had the obligation to provide the best possible price for a client) to go and &quot;pick&quot; the locking Sell Limit Order from the locking venue (say, Instinet) and pay the taker's fee. However, this would have been true for &lt;strong&gt;every&lt;/strong&gt; time in which a competing ECN was posting an &lt;em&gt;ask quote&lt;/em&gt; that was lower than the one posted by the market maker and not only when the markets were locked... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I missing something?&lt;/p&gt;&#xA;" OwnerUserId="11874" LastEditorUserId="11874" LastEditDate="2014-09-24T03:13:00.160" LastActivityDate="2015-02-21T18:27:15.007" Title="Locked or Crossed Markets" Tags="&lt;equities&gt;&lt;market-microstructure&gt;&lt;limit-order-book&gt;&lt;order-execution&gt;&lt;order-handling&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14839" PostTypeId="2" ParentId="14837" CreationDate="2014-09-23T22:45:27.627" Score="0" Body="&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/5rvuS.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you look at the image above you will find data for Exonn mobile. The first 10 rows are daily data and below that is weekly data. I have calculated the weekly price for daily closing values. The red coloured cell is the average for the brownish cells, which is similar to the green cell (weekly price from yahoo finance). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So they have taken average price for the next next 4 days (after 6th) and assigned that value to the first date (6th). I do not thing it is the right way to do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would suggest you to download the daily price and make further changes in it, rather than using weekly data from Yahoo finance or let it be any source.&lt;/p&gt;&#xA;" OwnerUserId="12097" LastActivityDate="2014-09-23T22:45:27.627" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14841" PostTypeId="2" ParentId="9717" CreationDate="2014-09-24T07:20:48.217" Score="0" Body="&lt;p&gt;RDF would be more suitable to processing, consider using file from Eurostat directly: &lt;a href=&quot;http://ec.europa.eu/eurostat/ramon/rdfdata/nace_r2.rdf&quot; rel=&quot;nofollow&quot;&gt;http://ec.europa.eu/eurostat/ramon/rdfdata/nace_r2.rdf&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12139" LastActivityDate="2014-09-24T07:20:48.217" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14842" PostTypeId="2" ParentId="14838" CreationDate="2014-09-24T14:32:14.263" Score="2" Body="&lt;p&gt;The adopting release of Reg NMS &lt;a href=&quot;http://www.sec.gov/rules/final/34-51808.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.sec.gov/rules/final/34-51808.pdf&lt;/a&gt; discusses the problem(s) they were looking to solve. That will provide the SEC's thought process.&lt;/p&gt;&#xA;" OwnerUserId="12142" LastActivityDate="2014-09-24T14:32:14.263" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14843" PostTypeId="2" ParentId="14764" CreationDate="2014-09-24T15:19:32.227" Score="2" Body="&lt;p&gt;I agree with the previous statement that this is more stats related than anything else (it's not quant finance). But it's still a great question! This sounds awfully similar to linear regression testing with multiple predictor variables; you're basically doing it in a &quot;monte carlo&quot; fashion :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Depending on how your data is formatted, you could enter it into a program like Minitab and get the regression model from it within seconds. The model (or the resulting equation) would already give you the &quot;best fit&quot; that you are looking for. It would also give you a quantifiable number (like the resulting R-squared value) to give you a measurement of how accurate your strategy would be at any given time. &lt;/p&gt;&#xA;" OwnerUserId="7514" LastActivityDate="2014-09-24T15:19:32.227" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14845" PostTypeId="2" ParentId="11373" CreationDate="2014-09-24T17:02:35.373" Score="0" Body="&lt;p&gt;As @Louis said, from Finviz's stock screener you can filter by exchange and sort column by sector.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; import urllib2 &#xA;&amp;gt;&amp;gt;&amp;gt; url = &quot;http://www.finviz.com/export.ashx?v=111&amp;amp;f=exch_nyse&amp;amp;o=sector&quot;&#xA;&amp;gt;&amp;gt;&amp;gt; file = open(&quot;tickers.txt&quot;,'wb')&#xA;&amp;gt;&amp;gt;&amp;gt; data = urllib2.urlopen(url).readlines()&#xA;&amp;gt;&amp;gt;&amp;gt; for l in data:&#xA;... file.write(l)&#xA;&amp;gt;&amp;gt;&amp;gt; file.close()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1625" LastActivityDate="2014-09-24T17:02:35.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14846" PostTypeId="2" ParentId="14830" CreationDate="2014-09-24T22:56:52.337" Score="0" Body="&lt;p&gt;You won't find any real time screener anywhere, because of the comission you need to pay to the stock market. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you can manage to get the data flow, you can run a script in matlab or any other language every few time, so that it is almost real time. &lt;/p&gt;&#xA;" OwnerUserId="12089" LastActivityDate="2014-09-24T22:56:52.337" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14847" PostTypeId="2" ParentId="14801" CreationDate="2014-09-25T04:49:27.620" Score="1" Body="&lt;p&gt;Edited:&#xA;The risk free rate is positive because the factors of production, and the perception of time (from an individual's perspective) are limited.  Limited supply of desirable goods such as houses (or limited capacity to make them from land, labour and capital), gives them a positive value in society (versus say air, which is in almost unlimited supply, though that may change at some point).  The second part of the argument is that because of our human perception of time being something limited (either because see our own lives as ending at some point, or anyway can't recall the last one), we have an innate preference to consume now rather than later (not withstanding separate effects such as diminishing marginal utility such as what happens when one eats too many chocolates at once).  This 'time preference' means that we put a value on immediacy, such that more distant utility flows are worth less (= discount rate or risk free rate).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, what I think are, the necessary conditions to the above.  1) Limited supply, 2) Positive utility from consumption, and 3) Perception of limited time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, a positive risk free rate, probably wouldn't apply in the case of hydrogen (too abundant), nor to ebola (no one wants it), nor from the perspective of the Highlander (since he can afford to wait).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are some useful corollaries of the above argument that help explain some structural trends in the global modern world economy, in the way that demographics play out in the demand and supply of capital, and the way in which this impacts the risk free rate. &lt;/p&gt;&#xA;" OwnerUserId="3297" LastEditorUserId="3297" LastEditDate="2014-09-26T05:29:34.273" LastActivityDate="2014-09-26T05:29:34.273" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14848" PostTypeId="1" AcceptedAnswerId="14849" CreationDate="2014-09-25T11:04:05.523" Score="0" ViewCount="63" Body="&lt;p&gt;What is the unity/interpretation of the y-axis of a density distribution function? &#xA;The X-axis is the values of the random variable, the area is the probabilty what about the y-axis ?&lt;/p&gt;&#xA;" OwnerUserId="9505" LastActivityDate="2014-09-25T13:08:24.330" Title="y-axis unity of density probability function" Tags="&lt;probability&gt;&lt;density&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14849" PostTypeId="2" ParentId="14848" CreationDate="2014-09-25T13:08:24.330" Score="1" Body="&lt;p&gt;The y-value is meaning-less for interpretation. As f(x) is probability distribution function and probability being defined as: $P(x&amp;lt;X)=\int_{-\infty}^b\!f(x)dx$. Y-value just has mathematical usage but no physical interpretation. Can refer to the &lt;a href=&quot;https://math.stackexchange.com/questions/217176/normal-distribution-the-y-value&quot;&gt;link&lt;/a&gt; as well.&lt;/p&gt;&#xA;" OwnerUserId="12097" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2014-09-25T13:08:24.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14850" PostTypeId="1" AcceptedAnswerId="14852" CreationDate="2014-09-25T14:29:24.887" Score="5" ViewCount="1182" Body="&lt;p&gt;I was reading on Factor Models in the book Quantitative Risk Management by McNeil, et al. In section 3.4.1 they introduce a linear factor model &#xA;$$X = a + BF + \epsilon,$$&#xA;where $X \in R^d$, $F \in R^p$. They make the following assumptions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$\epsilon = (\epsilon_1, \ldots, \epsilon_d)'$ is a random vector of idiosyncratic terms, which are uncorrelated and have mean zero&lt;/li&gt;&#xA;&lt;li&gt;$\text{cov}(F, \epsilon) = 0$.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I understand that if there were an additional factor, say $B_{p+1} F_{p+1}$, then $\epsilon$ would no longer be uncorrelated. So perhaps the Assumption (1) makes sure that all the risk factors have been captured and the remaining randomness is truly idiosyncratic. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do we understand Assumption (2)?&lt;/p&gt;&#xA;" OwnerUserId="11969" LastActivityDate="2014-09-27T18:33:31.713" Title="Factor model assumptions" Tags="&lt;factor-models&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14851" PostTypeId="2" ParentId="14850" CreationDate="2014-09-25T14:54:13.563" Score="3" Body="&lt;p&gt;The assumptions from factor models tend to be similar to the assumptions that you see in regression. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first assumption is pretty straightforward, errors are uncorrelated with mean zero. I wouldn't say that it necessarily means that all risk factors have been captured. However, for the purposes of using the factor model, it is basically assuming that there are no more systemic factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second assumption means that the factors and the errors are uncorrelated. The main reason for this assumption is that it facilitates being able to split up the covariance so that there is a factor component and a residual component. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2014-09-25T14:54:13.563" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14852" PostTypeId="2" ParentId="14850" CreationDate="2014-09-25T15:39:47.880" Score="3" Body="&lt;p&gt;As a matter of fact, Assumption 2 is natural. It is Assumption 1 that needs justification. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Strictly speaking Assumption 2 is not an assumption. It is simply a corollary of the regression of $X$ against $F$.  In the language of linear algebra, it is the decomposition of vector space of all $X$ into the subspace spanned by $F$ and its orthogonally complementary subspace. This equation is exact.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, Assumption 1 is not necessarily satisfied except the part about mean zero which is simply the result and purpose of having constant $a$ absorbing all nonzero means. One can easily construct any number of vectors with their complementary component highly correlated with each other. However, presumably most of the variance is captured by $F$, and so whatever you may say about the residual vector is immaterial except perhaps their residual variance. Therefore you may as well treat them as if they are completely uncorrelated.&lt;/p&gt;&#xA;" OwnerUserId="6686" LastEditorUserId="6686" LastEditDate="2014-09-27T18:33:31.713" LastActivityDate="2014-09-27T18:33:31.713" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14853" PostTypeId="2" ParentId="14830" CreationDate="2014-09-25T16:40:30.680" Score="2" Body="&lt;p&gt;I'm not sure that you fully understand what is meant by the term &quot;API&quot;. You are describing items that you can create yourself with any basic API/data source, really. You'd have to have some programming knowledge, as would anyone that uses an API, but it doesn't sound like you want to get that deep into this.&lt;/p&gt;&#xA;" OwnerUserId="7514" LastActivityDate="2014-09-25T16:40:30.680" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14854" PostTypeId="2" ParentId="14833" CreationDate="2014-09-25T20:27:35.017" Score="1" Body="&lt;p&gt;Your method does make sense to me, I do the same. The historical simulation is known to be a full evaluation approach: you simulate changes in market conditions by applying the same changes happened in the past to your risk factors, then you compute your portfolio value under the new market conditions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since Value at Risk (VaR) is the maximum loss with a given confidence level over a specified time frame (like 1 day or 10 business days), the time to maturity of the option should be adjusted for this time period: if you compute the 1 day VaR, then the time to maturity of the option is 1 day less when you compute the under new market conditions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to me, you tend to focus too much on time: the idea of historical simulation is to &quot;borrow&quot; data about changes in market conditions from history and simulate them today to see how your portfolio value changes. So you take the data and forget about time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I give you a reference where I studied the method: &lt;a href=&quot;http://www.wiley.com//legacy/wileychi/rmsv/&quot; rel=&quot;nofollow&quot;&gt;Risk Management and Shareholders' Value in Banking, chapter 7&lt;/a&gt;. I think it is very clear and thorough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Two notes about the comments:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;the delta-normal approach refers usually to the variance-covariance method (there is a sensitivity coefficient in the VaR formula that links VaR to the risk factor change in value in a linear relationship). The same book will offer you some clarification about it (chapter 5).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;About implied volatility, I believe using it is a good thing in case you evaluate with the usual Black-Scholes formula: it allows you to consider the skew/smile. However, in case of a portfolio of options, you would have a very simplified scenario: each option has its own implied volatility, but you have the same historical change to apply to all of them. This is quite unrealistic, since each volatility would change differently in value (maybe same direction, but almost surely different percentage change).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7405" LastActivityDate="2014-09-25T20:27:35.017" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14855" PostTypeId="1" CreationDate="2014-09-26T08:39:04.673" Score="5" ViewCount="6498" Body="&lt;p&gt;I'm trying to apply Black &amp;amp; Scholes formula for a &lt;strong&gt;real&lt;/strong&gt; example to price a vanilla equity option but I'm strugling a little bit whith the dividend yield.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's assume I have a stock that trades at 50 dollar and the announced dividend in 100 days is 5 dollar, is the dividend yield = (100 / 252 days ) x 5 / 50 = 3.97% ? Am I right ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The day after would it be (Assuming the stock price didn't change) : (99 / 252 days ) x 5 / 50 = 3.93% ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Last question please, if the next divident is not announced yet, where do we get the dividend yield from ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't have any problem with applying Black-Scholes formula but I'm just trying to apply it for a real example. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers in advance.&lt;/p&gt;&#xA;" OwnerUserId="12153" LastActivityDate="2014-10-20T22:23:04.560" Title="Option pricing ? Where to get the dividend yield from?" Tags="&lt;black-scholes&gt;&lt;dividends&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14860" PostTypeId="1" CreationDate="2014-09-26T14:24:30.267" Score="0" ViewCount="171" Body="&lt;p&gt;I am trying to implement the bivariate tree approach for the Heston model by &lt;a href=&quot;ftp://140.131.110.38/lfchang/public/FE%20TOPICS/reference/10-2-Beliaeva-JD.pdf&quot; rel=&quot;nofollow&quot;&gt;Beliaeva and Nawalkha&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I currently have the problem that given the specifications in their examples, I always obtain negative probability for the stock change to the middle node.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone else experienced this or can give some pointers as to why this might be happening?&lt;/p&gt;&#xA;" OwnerDisplayName="user12157" LastEditorDisplayName="user16891" LastEditDate="2015-07-23T22:55:44.263" LastActivityDate="2015-07-23T22:55:44.263" Title="negative probabilities in the bivariate tree heston model" Tags="&lt;options&gt;&lt;heston&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14861" PostTypeId="2" ParentId="14855" CreationDate="2014-09-26T14:27:22.233" Score="0" Body="&lt;p&gt;If it is a real example, then it may be unnecessary to consider the dividend explicitly. After all, the Gordon formula states that the stock price is equal to the discounted future cash flow of dividends.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, if I have a call at strike K and the future dividend is announced when the market didn't expect it, then most likely the spot price will go up and my call will appreciate accordingly. That is, I would be making a mistake if I add the discounted dividend on top of that because the dividend has already been incorporated into the call price. &lt;/p&gt;&#xA;" OwnerUserId="12031" LastActivityDate="2014-09-26T14:27:22.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14863" PostTypeId="1" AcceptedAnswerId="14954" CreationDate="2014-09-26T23:17:25.663" Score="5" ViewCount="1061" Body="&lt;p&gt;I'm thinking about taking a course on Linear and Convex Programming, but I don't know how useful it is in the real world finance. Which areas in finance is mathematical programming used?&lt;/p&gt;&#xA;" OwnerUserId="12158" LastActivityDate="2019-06-06T04:34:49.943" Title="Is linear programming important for quant?" Tags="&lt;mathematics&gt;&lt;strategy&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14864" PostTypeId="1" CreationDate="2014-09-26T23:36:35.620" Score="0" ViewCount="224" Body="&lt;p&gt;I am trying to read up on &quot;Wholesale credit risk &quot;, but I can't find any useful references.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is the emphasis on wholesale?&lt;/p&gt;&#xA;" OwnerUserId="12159" LastEditorUserId="467" LastEditDate="2015-01-20T01:19:03.083" LastActivityDate="2015-08-18T05:08:13.037" Title="What are the canonical references on wholesale credit risk management?" Tags="&lt;reference-request&gt;&lt;credit-risk&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14865" PostTypeId="1" AcceptedAnswerId="14868" CreationDate="2014-09-27T00:21:20.113" Score="5" ViewCount="9393" Body="&lt;p&gt;Given two time series data. I remember there is one statistics that tells you one is the leading factor while the other is the lagging factor. However, i do not remember the exact details. correlation is part of its name. I wonder if any one here could help me out. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="12088" LastActivityDate="2014-09-27T06:14:45.663" Title="detecting and measuring lead lag effect" Tags="&lt;time-series&gt;&lt;statistics&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="14866" PostTypeId="2" ParentId="9239" CreationDate="2014-09-27T00:51:49.387" Score="1" Body="&lt;p&gt;All complex multi leg options strategies involve being both long and short options. In other words to enter into a multileg position one is both buys options and sells other options. Therefore it is confusing to think of spreads (2 legs), butterflies (3 legs) and condors(4 legs) as buying them or selling them. Step back and reason what you want to accomplish. All options strategies (not just multileg) can be divided into 3 categories by primary goals of the strategy:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Portfolio protection&lt;/li&gt;&#xA;&lt;li&gt;Income generation&lt;/li&gt;&#xA;&lt;li&gt;Leveraged speculation&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Now to your question about short vs long. Here is how I think about. With my goal in mind, I pick a few strategies that can accomplish what I want. Then I consider maximum loss, principal required (debit) and/or margin requirements (credit). I pick those that fit my risk tolerance and provide acceptable risk/reward ratio. Note, that at no point I agonize whether it is net long or short or if it is called a broken-wings-butterfly or iron-chicken. All i care is finding a simplest possible strategy fitting my goal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With my options trading related questions i use &lt;a href=&quot;http://optionsforum.net&quot; rel=&quot;nofollow&quot;&gt;http://optionsforum.net&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7973" LastActivityDate="2014-09-27T00:51:49.387" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14867" PostTypeId="2" ParentId="14855" CreationDate="2014-09-27T05:35:10.790" Score="2" Body="&lt;p&gt;In real life, you imply the unknown dividend yields from the forwards and the discount curve. &lt;/p&gt;&#xA;" OwnerUserId="3491" LastActivityDate="2014-09-27T05:35:10.790" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14868" PostTypeId="2" ParentId="14865" CreationDate="2014-09-27T06:14:45.663" Score="4" Body="&lt;p&gt;You may want to take a look at &lt;a href=&quot;http://www.ltrr.arizona.edu/~dmeko/notes_10.pdf&quot; rel=&quot;nofollow&quot;&gt;lagged correlation or cross correlation&lt;/a&gt;.  Lagged correlation refers to the correlation between two time series shifted in time relative to one another. This measure is useful for studying whether a lagged time series $x_{t-k}$ can be viewed as a good predictor for $y_t$. If you are familiar with R, then you may find the following two links on cross correlation, lagged regression useful: &lt;a href=&quot;https://onlinecourses.science.psu.edu/stat510/node/74&quot; rel=&quot;nofollow&quot;&gt;Cross Correlation Functions and Lagged Regressions&lt;/a&gt; and &lt;a href=&quot;http://www.colorado.edu/geography/class_homepages/geog_4023_s11/Lecture19_TS5.pdf&quot; rel=&quot;nofollow&quot;&gt;Cross-correlation as Leading indicator&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As suggested by Professor Eric Zivot, we can also generalize the approach as follows: one can   estimate a &lt;a href=&quot;http://en.wikipedia.org/wiki/Vector_autoregression&quot; rel=&quot;nofollow&quot;&gt;vector autoregression&lt;/a&gt; involving your variables of interest and then test for &lt;a href=&quot;http://en.wikipedia.org/wiki/Granger_causality&quot; rel=&quot;nofollow&quot;&gt;Granger non-causality&lt;/a&gt;. See the vars &#xA;package and in particular the causality() function. &lt;/p&gt;&#xA;" OwnerUserId="9381" LastActivityDate="2014-09-27T06:14:45.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14869" PostTypeId="1" CreationDate="2014-09-27T06:32:52.397" Score="2" ViewCount="3456" Body="&lt;p&gt;To give you a brief background, I'm valuing a fixed-for-float Interest Rate Swap (IRS) using Bloomberg. I put in a notional amount in (USD) and a assigned 6MO USD LIBOR as the reference index for the floating leg. I want to know how Bloomberg computed for the floating rates it used to compute for the floating cash flows and they told me that: 6MO USD LIBOR forward rate is computed using 3MO USD Swap curve then they did a &lt;strong&gt;basis adjustment&lt;/strong&gt; to come up with basis adjusted forward rate. I would like to know how to compute for this basis adjusted forward rate? Thank you.&lt;/p&gt;&#xA;" OwnerUserId="12160" LastActivityDate="2021-04-07T13:02:25.427" Title="How to compute for basis adjusted forward rate?" Tags="&lt;swaps&gt;&lt;bloomberg&gt;&lt;forward-rate&gt;&lt;irs&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14870" PostTypeId="2" ParentId="14863" CreationDate="2014-09-27T07:14:23.750" Score="5" Body="&lt;p&gt;Optimization is definitely important in Quantitative Finance, especially for portfolio optimization where we maximize utility of the return of a portfolio as linear weighted vector of asset returns subject to a desired risk level:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \max_{w\in[0,1]^n} U(\mu_p(w),\sigma_p(w))\quad s.t. \sum_{i=1}^n w_i=1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $w$ being the portfolio weights, and $U$ utility function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CAPM assumes investors with concave utility function $U=\mu_p-\frac{1}{2}\sigma_p^2$, from which then follows that all investors mix the market portfolio with the riskfree asset according to their desired minimum risk/maximum return level.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-10-04T12:05:17.250" LastActivityDate="2014-10-04T12:05:17.250" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14871" PostTypeId="1" CreationDate="2014-09-27T12:57:47.133" Score="0" ViewCount="356" Body="&lt;p&gt;I was wondering how the yield curve for US treasuries are constructed (ex. USGG10Y, USGG5Y, etc.). How to compute for it exactly (what deals/quotes are included in it, what financial institutions are involved, etc.)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="12160" LastActivityDate="2014-10-27T22:50:03.300" Title="How is USGG10Y (or any tenor) constructed?" Tags="&lt;bond&gt;&lt;yield&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14872" PostTypeId="1" CreationDate="2014-09-27T17:05:38.937" Score="2" ViewCount="329" Body="&lt;p&gt;I'm trying to determine which of my portfolio simulations/backtests if any are good enough to put some money into. I outline an approach below and I'm interested in knowing:&#xA;What problems are there with my approach if any? How big are these problems? Could you recommend a better approach, and explain it with sufficient detail so that I could implement it? - Thanks!!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ran several portfolio simulations with portfolio sizes ranging from 1 stock to 20 stocks and average holding periods ranging from 2 days to 3 months. The criteria involve various buy/sell/ranking rules and the sims account for all trading costs. Each simulation is run over the prior 10 years, so I have 10 years of the portfolio equity curve. I take the daily simple return (r) of the portfolio equity curve and convert it to the daily lognormal return [LN(1+r)] which I place in column C of a spreadhseet. I want to calculate with 80% confidence what the minimum CAGR of the sim will be 6 months from now. I believe this would be called the 80% VaR. I use the following formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;80% 6-mo VaR CAGR = [AVERAGE(C:C)-0.69*STDEV(C:C)/SQRT(125)+1]^251-1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm interpreting the result as follows: If 80% 6-mo VaR &gt; Benchmark's 10-yr CAGR, then the strategy has an 80% chance of producing alpha 6 months from now and it's worth putting some money into it. I choose 10-year CAGR for the benchmark to match up with the 10-years of data in the backtest. I chose 6-mo VAR because 6-mo is probably the most I'd be willing to wait for confirmation that the strategy is producing alpha. I chose 80% confidence level because I was trying not to be so conservative that I throw away strategies that will most probably produce alpha. After all, having an 80% chance of producing alpha is probably a lot better than the norm. If my purpose was risk measurement, I'm thinking that 99% VaR or 99.9% VaR would be more appropriate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I used a 0.69 z-score in the above formula, which is different from the normal distribution z-score. In order to account for stock returns having fat tails at the edges, I examined the last 7 years of SPY and IWM daily returns to create my own custom Z-score index that better matches historical LN(1+R) probability distributions. I also examined a highly volatile 1-stock price history as well to account for the fact that portfolios with &amp;lt;20 stocks could have fatter tails than the SPY and IWM. I summarize the custom z-scores I use below: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;VaR %-level / Normal Distribution Z-score / Custom Z-Score:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;99.9% / 3.09 / 6.25&lt;/p&gt;&#xA;&#xA;&lt;p&gt;99% / 2.33 / 3.12&lt;/p&gt;&#xA;&#xA;&lt;p&gt;95% / 1.64 / 1.70&lt;/p&gt;&#xA;&#xA;&lt;p&gt;80% / 0.84 / 0.69&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="12161" LastEditorUserId="12161" LastEditDate="2014-09-27T18:14:51.010" LastActivityDate="2014-09-27T18:14:51.010" Title="Testing Statistical Significance of Various Portfolio Simulations" Tags="&lt;var&gt;&lt;statistical-significance&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14873" PostTypeId="2" ParentId="14541" CreationDate="2014-09-27T20:53:06.393" Score="0" Body="&lt;p&gt;The fact that Implied Vol rises has absolutely nothing to do with riskaversion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If market expects volatility before an upcoming uncertain earnings report, put option prices rise naturally. This is due to the asymmetric payoff profile of options, which always gain from volatility because the downside losses are capped but upside potentially unlimited.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-09-27T20:53:06.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14874" PostTypeId="2" ParentId="7949" CreationDate="2014-09-27T21:38:19.663" Score="2" Body="&lt;p&gt;in RQuantLib you need to set the evaluation date using setEvaluationDate()&#xA;This is the date used by all QuantLib valuation functions in your case 10 May 2014.&lt;/p&gt;&#xA;" OwnerUserId="12163" LastActivityDate="2014-09-27T21:38:19.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14875" PostTypeId="2" ParentId="14871" CreationDate="2014-09-27T22:02:29.420" Score="1" Body="&lt;p&gt;USGG10Y is the rolling 10-year on-the-run series. On each day, it reflects the yield of the current 10-year on-the-run note. On an auction date, after a new 10-year Treasury is issued, it starts tracking the new 10-year bond yield. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The default USGG10Y series is a composite quote from a few dealers. But frankly, given the liquidity and depth of the Treasury market, the quotes of on-the-run issues are pretty much identical from dealer to dealer. Using the quotes from any dealer will allow you to replicate USGG*Y very closely.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2014-09-27T22:02:29.420" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14876" PostTypeId="1" CreationDate="2014-09-27T22:30:26.100" Score="1" ViewCount="98" Body="&lt;p&gt;Using the 3-mon &lt;a href=&quot;http://www.cmegroup.com/market-data/daily-bulletin.html&quot; rel=&quot;nofollow&quot;&gt;eurodollar interest rate futures&lt;/a&gt;, I construct a yield curve each year for 2015-2021 using sampling date from the end of the month.  If you graphed this out, you would see that the curve is shifted down each year.  What I guess that is saying is that as time goes on, the market expectation for the interest rates is declining.  That assessment is quite the contrary to the fed policy's tapering of asset purchase.  If the fed is reducing buying assets, the rate should go up, but why would the market expectation on interest rate go down?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;        1/2/14     1/31/14&#xA;2015    0.6274%    0.5574%&#xA;2016    1.5723%    1.4198%&#xA;2017    2.7359%    2.4620%&#xA;2018    3.6504%    3.2965%&#xA;2019    4.2711%    3.8773%&#xA;2020    4.6554%    4.2679%&#xA;2021    4.8879%    4.5192%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12164" LastActivityDate="2014-10-27T23:50:02.827" Title="Why interest rate future does not support fed policy on reducing assets buying?" Tags="&lt;interest-rates&gt;&lt;eurodollars&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14877" PostTypeId="2" ParentId="14876" CreationDate="2014-09-27T23:15:30.753" Score="2" Body="&lt;p&gt;There are quite a few reasons:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Fed funds futures rate and Eurodollar futures rate do not reflect market expectations alone. Technically speaking, a risk-free interest rate is the sum of 1) rate expectations, 2) term premium, and 3) convexity bias. Term premium is typically positive, since investors demand a higher yield for taking on more duration risk (i.e., because a 10-year bond is riskier than a 1-year bond, even if rate expectations are constant, you might expect the 10-year bond to have a higher yield). So when interest rate goes down, it could be rate expectations are coming down, or perhaps term premium is coming off, or both. The best writing on this subject (from a practitioner's perspective) is Antii Ilmanen's &quot;Understanding the Yield Curve.&quot; I myself have written a few articles on this topic. For example, you may look at &lt;a href=&quot;http://hungrydummy.com/blog/bond-risk-premium-part-ii-clash-of-two-theories/&quot; rel=&quot;nofollow&quot;&gt;Bond Risk Premium (Part II) – Clash of Two Theories&lt;/a&gt; and &lt;a href=&quot;http://hungrydummy.com/blog/bond-risk-premium-part-iv-decomposing-the-yield-curve/&quot; rel=&quot;nofollow&quot;&gt;Bond Risk Premium (Part IV) – Decomposing the Yield Curve&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Economy: At the beginning of the year, investors were generally very optimistic about the US economy and believed 2014 will be the year that the economy finally reaches the &quot;escape velocity.&quot; Well, we're in the ninth month; economic data has been pretty mixed... and a lot of market participants downgraded their economic outlook.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Flows: With eurozone bond yields collapsing, US yields suddenly look very attractive. So there's decent buying of US bonds, which also contributed to the rallying in rates.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The &quot;Neutral Rate&quot;: Even the Fed's projection of the neutral level of interest rate has declined. At the beginning of the year, the Fed's famous dot chart had a median neutral rate of 4%, but it has since come down to 3.75%. This has a lot of implications for pricing long-dated forwards.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2014-09-27T23:15:30.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14878" PostTypeId="1" CreationDate="2014-09-28T10:30:06.970" Score="3" ViewCount="489" Body="&lt;p&gt;Can someone give an overview or literature on Intraday Data Stylized Facts?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular for equity market returns or exchange rates.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-10-03T06:11:24.253" Title="Intraday Data - Stylized Facts?" Tags="&lt;time-series&gt;&lt;data&gt;&lt;market-data&gt;&lt;tick-data&gt;&lt;intraday&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14879" PostTypeId="1" CreationDate="2014-09-28T11:25:19.290" Score="3" ViewCount="338" Body="&lt;p&gt;Consider a American floating strike put option with maturity $T$, written on a non-dividend paying stock $S_t$. The strike of this option at time $t\leq T$ is $Ke^{-r (T-t )}$, where $r$ is the constant interest rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume the volatility of the underlying stock is constant. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the price of this option?&lt;/p&gt;&#xA;" OwnerUserId="6947" LastActivityDate="2014-09-28T13:15:57.660" Title="Pricing American with floating strike" Tags="&lt;option-pricing&gt;&lt;american-options&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14880" PostTypeId="1" CreationDate="2014-09-28T11:48:15.123" Score="4" ViewCount="263" Body="&lt;p&gt;I've been trying to implement a bivariate tree for pricing american options with the heston model in R using the paper of Beliaeva and Nawalkha (&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1107934&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1107934&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I am obtaining negative transition probabilities for the middle node change of the stock price. I am pretty sure my coding is correct, I also cross-checked with the book by Rouah (&lt;a href=&quot;http://eu.wiley.com/WileyCDA/WileyTitle/productCd-1118548256.html&quot; rel=&quot;nofollow&quot;&gt;http://eu.wiley.com/WileyCDA/WileyTitle/productCd-1118548256.html&lt;/a&gt;) and what I did resembles the code there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone else experienced this or can give some pointers?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&#xA;Here's my code for the stock probabilities. As a sample I used the numbers given in the Beliaeva paper: S_0 = 100, V_0 = 0.04, sigma = 0.1, kappa = 3, theta = 0.04, rho = -0.1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The results I got where: (0.4860517840, -0.0008249158, 0.5147731319)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;stockProb &amp;lt;- function(v0,vt,yt,sigma,kappa,rho,delT)&#xA;{&#xA;  muY &amp;lt;- (rho/sigma*kappa-0.5)*vt&#xA;  sigmayt &amp;lt;- sqrt(1-rho^2)*sqrt(vt)&#xA;  sigmay0 &amp;lt;- sqrt(1-rho^2)*sqrt(v0)&#xA;  if(vt &amp;gt; 0)&#xA;  {&#xA;    k &amp;lt;- ceiling(sqrt(vt/v0))&#xA;  }&#xA;  else&#xA;  {&#xA;    k &amp;lt;- 1&#xA;  }&#xA;&#xA;  I &amp;lt;- round(muY/k/sigmay0*sqrt(delT))&#xA;  yu &amp;lt;- yt + (I+1)*k*sigmay0*sqrt(delT)&#xA;  ym &amp;lt;- yt + I*k*sigmay0*sqrt(delT)&#xA;  yd &amp;lt;- yt + (I-1)*k*sigmay0*sqrt(delT)  &#xA;  eu &amp;lt;- yu - yt - muY*delT&#xA;  em &amp;lt;- ym - yt - muY*delT&#xA;  ed &amp;lt;- yd - yt - muY*delT&#xA;  pu &amp;lt;- 0.5*(sigmayt^2*delT + em*ed)/k^2/sigmay0^2/delT&#xA;  pm &amp;lt;- -(sigmayt^2*delT + eu*ed)/k^2/sigmay0^2/delT&#xA;  pd &amp;lt;- 0.5*(sigmayt^2*delT +eu*em)/k^2/sigmay0^2/delT  &#xA;  ps &amp;lt;- c(pu,pm,pd)&#xA;  ps&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12169" LastEditorUserId="848" LastEditDate="2014-09-28T22:14:23.640" LastActivityDate="2014-09-28T22:14:23.640" Title="negative transition probabilities in the heston model" Tags="&lt;option-pricing&gt;&lt;r&gt;&lt;probability&gt;&lt;american-options&gt;&lt;heston&gt;" AnswerCount="0" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="14881" PostTypeId="1" CreationDate="2014-09-28T13:09:59.193" Score="4" ViewCount="426" Body="&lt;p&gt;Factor models with factors that are &lt;em&gt;not&lt;/em&gt; returns are usually estimated and tested by cross-sectional regressions. However, there is a way to use time-series regression to estimate and test the model. The time-series regression is given by:&#xA;$$R_t^{ei} = a_i + \beta_i f_t + \varepsilon_t^i  \ \ ; \ \ t = 1, 2, \cdots, T \ \text{for each } i$$&#xA;where $R_t^{ei} = R_t^i - R_t^f$, i.e., the excess return of asset $i$, $f_t$ is a &lt;em&gt;single&lt;/em&gt; factor, and the error term $\varepsilon$ is i.i.d. over time, homoskedastic, and independent of the factors. Furthermore, the above asset pricing model does not leave $a_i$ free, instead they must satisfy $a_i = \beta_i(\lambda - E(f))$ where $\lambda$ is the factor risk premium.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; Using GMM, write down a set of moment conditions that you can use to estimate this model and test the restriction on the $a_i$. How would you estimate the parameters and what formula would you use to compute a test? [You can use the already known results of the famous GMM formulas].&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The hint is to start with the moments for unrestricted OLS time-series regressions, then impose the constraint between $a$ and $\lambda$, then estimate the restricted model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For anyone that's interested, this question comes from John Cochrane's Asset Pricing (2005 revised edition) book, chapter 12 question 5.&lt;/p&gt;&#xA;" OwnerUserId="12166" LastEditorUserId="12166" LastEditDate="2014-10-05T07:33:56.973" LastActivityDate="2014-10-05T07:33:56.973" Title="GMM time-series regression factor model with factors that are not returns" Tags="&lt;time-series&gt;&lt;regression&gt;&lt;asset-pricing&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14882" PostTypeId="2" ParentId="14879" CreationDate="2014-09-28T13:15:57.660" Score="5" Body="&lt;p&gt;These options can be priced by adding an early exercise premium value to the intrinsic value:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.statistics.nus.edu.sg/~stalimtw/PDF/lb-float.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.statistics.nus.edu.sg/~stalimtw/PDF/lb-float.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-09-28T13:15:57.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14883" PostTypeId="2" ParentId="14360" CreationDate="2014-09-28T15:21:17.160" Score="4" Body="&lt;p&gt;You might want to have a look at the stochvol vignette (&lt;a href=&quot;http://cran.r-project.org/web/packages/stochvol/vignettes/article.pdf&quot; rel=&quot;nofollow&quot;&gt;http://cran.r-project.org/web/packages/stochvol/vignettes/article.pdf&lt;/a&gt;), where this process is described in detail in Algorithm 1. In particular, if I understand you correctly, what you need is step 4b.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now to your code:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) It's not really a rolling forecast, because you estimate the model only once.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) When predicting, in the first three lines of your function, you only use the posterior mean of the parameters (as a point estimate). Why not use the entire distribution? That way you can also handle parameter uncertainty properly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) In an SV model (as opposed to GARCH-type models), volatility is assumed to be a latent &lt;em&gt;random&lt;/em&gt; variable, thus when predicting (line H &amp;lt;- ...), you might want to do so by drawing from the corresponding (normal) distribution instead of updating deterministically. That's exactly what predict.svdraws does. You could have a look at the code there and adapt it to your needs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best,&#xA;Gregor&lt;/p&gt;&#xA;" OwnerUserId="12172" LastActivityDate="2014-09-28T15:21:17.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14884" PostTypeId="1" CreationDate="2014-09-28T17:38:14.757" Score="7" ViewCount="1751" Body="&lt;p&gt;Are there any practical articles, blogs or books that describe common practices in market making and how to calculate and use common measures?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The majority of the information I found are research papers. For example, the links in the following question: &lt;a href=&quot;https://quant.stackexchange.com/questions/8897/academic-papers-about-market-making&quot;&gt;academic papers about market making&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any articles on how the research papers above are used in practice?&lt;/p&gt;&#xA;" OwnerUserId="12176" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2017-12-08T10:52:29.110" Title="Text book or distilled guide to market making?" Tags="&lt;market-making&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14888" PostTypeId="1" CreationDate="2014-09-29T10:08:04.707" Score="1" ViewCount="253" Body="&lt;p&gt;I would like to first know the precise definition of each one of those 3 ratios as well as there differences. On the web there is bit of a mess on the explanations. I could not find a simple and clear systematic presentation of those 3 without mixing the terms and others synonyms. That let me even more lost.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Besides that it would be great if someone could explain me in a nutshell the main issues, context in which each regulatory ratio is inserted in and so there reason to exist. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please be free to recommend me some reference lectures on the subject. Especially those for beginners on regulation subjects. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks&lt;/p&gt;&#xA;" OwnerUserId="3534" LastEditorUserId="3534" LastEditDate="2014-10-31T11:31:47.543" LastActivityDate="2014-11-01T09:15:06.257" Title="AT1 ratio, Core T1 ration and CET1 ratio" Tags="&lt;basel&gt;&lt;accounting&gt;&lt;banking-regulations&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14889" PostTypeId="1" AcceptedAnswerId="14891" CreationDate="2014-09-29T14:29:14.840" Score="1" ViewCount="120" Body="&lt;p&gt;I have an optimisation problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wish to maximise a function subject to a constraint. It is the constraint that is causing me problems. I am using an addin in Matlab which does the optimisation however the constraints that I have used before have been in the format of the line below.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; b_l &amp;lt;= Ax &amp;lt;= b_u&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The constraint is,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; Sum(x .* stock)*BetaBM - 0.1 &amp;lt;= Sum(x .* stock.*BetaSK) &amp;lt;= Sum(x .*stock)*BetaBM + 0.1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; x is 2000 by 1 vector&#xA; stock is 2000 by 1 vector&#xA; BetaBM is a scalar&#xA; BetaSK is 2000 by 1 vector&#xA;&#xA; x - is the weight of each stock in the fund. It cannot be more than 100% but can be less.&#xA; stock - I am looking at M&amp;amp;A deals. The stock variable is a number between 0 and 1 which represents how much of the deal is being paid for in the acquires stock. 0 would mean the deal is purely cash. If there is part of the deal being paid in stock I will hedge the beta exposure against the S&amp;amp;P Index.&#xA;&#xA; BetaBM - is the S&amp;amp;P beta.&#xA; BetaSK - contains all the individual beta for all the stocks in the fund&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I need to get the constraint in the format b_l &amp;lt;= Ax &amp;lt;= b_u if at all possible?&lt;/p&gt;&#xA;" OwnerUserId="7530" LastEditorUserId="7530" LastEditDate="2014-09-29T15:54:46.303" LastActivityDate="2014-09-29T16:43:38.057" Title="optimisation problem with linear constraint" Tags="&lt;quant-trading-strategies&gt;&lt;optimization&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14891" PostTypeId="2" ParentId="14889" CreationDate="2014-09-29T15:38:43.690" Score="2" Body="&lt;p&gt;If you have a vector of weights $w=(w_1,\ldots,w_n)^T$ then $(1,\ldots,1)* w = \sum_{i=1}^n w_i$&#xA;thus a sum condtion can be formulated by multiplication with a row of ones.&#xA;A $\le$ can be put into an $\ge$ by multiplying with $(-1)$ and if you have to put all your constraints into on $A$ then you usually stack all the row vectors together. In your case&#xA;the matrix $A$ will consist of rows of ones. As long as you don't explain your constraint I can not add more. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will try:&#xA;If you want to put a constraint on your porfolio beta then you should use a constraint:&#xA;$$(\beta_1,\ldots,\beta_n) * w \le \beta_{BM}+0.1$$ and $$(\beta_1,\ldots,\beta_n)*w \ge \beta_{BM}-0.1$$ which the same as &#xA;$$ -(\beta_1,\ldots,\beta_n)*w \le 0.1-\beta_{BM}$$. &#xA;So you could use a matrix $$A = (\beta_1,\ldots,\beta_n;-\beta_1,\ldots,-\beta_n)$$&#xA;and right hand side $b = (\beta_{BM}+0.1;0.1-\beta_{BM})$ then your condition is:&#xA;$$&#xA;A w \le b.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT after a remark by PO:&#xA;If you have&#xA;$$&#xA;(\sum_{i=1}^n w_i stock_i) \beta_{BM} -0.1 \le \sum_{i=1}^n w_i stock_i \beta_i&#xA;$$&#xA;then this is equivalent to&#xA;$$&#xA;\sum_{i=1}^n w_i stock_i (\beta_{BM} - \beta_i) \le 0.1&#xA;$$&#xA;then you define scalars $k_i = stock_i (\beta_{BM} - \beta_i)$ and the same as above holds for $\sum_{i=1}^n w_i k_i \le 0.1$. For the right hand side you get&#xA;$$&#xA;\sum_{i=1}^n w_i (-k_i) \le 0.1.&#xA;$$&#xA;Your matrix $A$ has two rows, one $(k_1,\ldots,k_n)$ and one $(-k_1,\ldots,-k_n)$ the rhs is $(0.1, 0.1)$.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2014-09-29T16:43:38.057" LastActivityDate="2014-09-29T16:43:38.057" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14892" PostTypeId="1" CreationDate="2014-09-29T16:52:25.967" Score="1" ViewCount="155" Body="&lt;p&gt;I'm not sure of the answer but I think it's possible. What I don't get is what characteristics this asset would need to have and why it would mean that an investor would accept a return less than the risk free rate when there is uncertainty about the asset's future payoffs.&lt;/p&gt;&#xA;" OwnerUserId="12181" LastActivityDate="2014-10-01T18:05:38.097" Title="Is it possible that a security with a positive variance can have a required return that is less than the risk free rate?" Tags="&lt;implied-volatility&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14893" PostTypeId="1" CreationDate="2014-09-29T17:54:56.630" Score="5" ViewCount="694" Body="&lt;p&gt;I'm trying to find/create a variable that measures liquidity in financial markets in order to assess, for instance whether credit conditions tightened? Does anyone know any relevant literature concerning this subject?&lt;/p&gt;&#xA;" OwnerUserId="12094" LastActivityDate="2014-09-29T21:45:35.520" Title="What are the most effective market variables to measure liquidity/illiquidity in the market?" Tags="&lt;market-data&gt;&lt;macro-economics&gt;&lt;macro&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14894" PostTypeId="2" ParentId="14893" CreationDate="2014-09-29T19:35:24.017" Score="0" Body="&lt;p&gt;Turnover ratio (TR) is one of the variables used. &#xA;$TR_t=\frac{Total_. shares_. traded_. at_. time_. t}{Market_. capitalisation}$. This variable indicates the number of shares traded in a day. Liquidity is a tricky area and you will find various measures in various papers according the authors preference. I do not recommend directly using volume or market cap. These variables does not give relative comparison. &lt;/p&gt;&#xA;" OwnerUserId="12097" LastActivityDate="2014-09-29T19:35:24.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14895" PostTypeId="2" ParentId="14893" CreationDate="2014-09-29T19:40:47.487" Score="0" Body="&lt;p&gt;Turnover ratio does not quite cut it because high liquidity is not the same as high trading activity. A nicer definition is how sensitive is the price to a given volume that is bid or offered. For that, check out &lt;a href=&quot;http://pages.stern.nyu.edu/~lpederse/papers/liquidity_risk.pdf&quot; rel=&quot;nofollow&quot;&gt;this paper.&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="12031" LastActivityDate="2014-09-29T19:40:47.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14896" PostTypeId="2" ParentId="14892" CreationDate="2014-09-29T19:46:51.593" Score="0" Body="&lt;p&gt;Theoretically, such an asset would not exists with standard deviation less than the risk free rate. You have rightly pointed out that if risk free rate is higher than any rational investor would not invest in the instrument, given lower return along with some amount of risk, when the investor can earn more amount without any risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the real world we do not appropriate measure of risk/conditional risk estimation, which may add to the confusion.&lt;/p&gt;&#xA;" OwnerUserId="12097" LastActivityDate="2014-09-29T19:46:51.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14897" PostTypeId="2" ParentId="14893" CreationDate="2014-09-29T21:45:35.520" Score="1" Body="&lt;p&gt;There are many different options. The Fed has a Senior Loan office survey of whether credit conditions have tightened or loosened. Macroeconomic forecasters often use this as part of U.S. GDP forecasting models. Other market-based variables, such as VIX and the spread between various bonds, to get a sense of financial conditions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are also some financial conditions indices out there. The Chicago Fed and Bloomberg both come to mind. Doesn't really make sense to re-invent the wheel, but if you need a longer history you can look at their methodology to get a sense of what they're doing.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2014-09-29T21:45:35.520" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14898" PostTypeId="2" ParentId="14878" CreationDate="2014-09-30T01:41:34.540" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Stationarity.&lt;/strong&gt; The distribution of returns is non-stationary. Moreover, standard deviation of returns is not constant over time.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Symmetry&lt;/strong&gt;. The distribution of returns is approximately symmetric with increasing leptokurtosis as sampling frequency increases. However, large drawdowns are not matched with equally large upward movements.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Gaussian behavior&lt;/strong&gt;. Returns become increasingly normal with decreasing frequency. Long horizon returns are approximately normal&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Serial correlation&lt;/strong&gt;. There exist anomalies in the serial correlation of returns, which are nevertheless impossibly difficult to forecast.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Scaling properties and asymmetry in time scale&lt;/strong&gt;. Time scaling is nontrivial as returns are not iid, but there is documented evidence for fairly stable, empirical scaling properties.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2014-09-30T01:41:34.540" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14899" PostTypeId="1" CreationDate="2014-09-30T01:48:46.563" Score="4" ViewCount="1170" Body="&lt;p&gt;Is there a data provider that has historical daily settlement prices for download?  I'm interested in a provider that spans multiple exchanges.&lt;/p&gt;&#xA;" OwnerUserId="12146" LastActivityDate="2016-01-30T01:07:33.153" Title="Data provider for daily futures settlement prices" Tags="&lt;futures&gt;&lt;historical-data&gt;" AnswerCount="6" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14900" PostTypeId="1" CreationDate="2014-09-30T02:18:55.923" Score="4" ViewCount="32037" Body="&lt;p&gt;I am having some difficulty grasping the concept of using DTS to measure credit risk. In the equity world, one typical measure of risk is beta, which is quite well-defined as the exposure to a common market factor, say S&amp;amp;P 500. But in credit market, it's not clear to me what the analogous common market factor would be. The original DTS paper says that DTS is the exposure to the relative spread change. However, the relative spread change can be calculated for each bond. Therefore, I have failed to see how DTS can be an exposure to some common factor. Can anyone explain exactly what DTS is measuring?&lt;/p&gt;&#xA;" OwnerDisplayName="user2163" LastActivityDate="2018-07-15T08:44:12.817" Title="What's the intuition behind DTS(duration times spread) in fixed income?" Tags="&lt;fixed-income&gt;&lt;spread&gt;&lt;duration&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14901" PostTypeId="2" ParentId="14884" CreationDate="2014-09-30T09:07:32.697" Score="3" Body="&lt;p&gt;I like the question. If you want a practical guide to market making then try the &lt;a href=&quot;http://aci-uk.com/aci-uk-dealing-simulation-course/&quot; rel=&quot;nofollow noreferrer&quot;&gt;ACI Dealing Simulation Course&lt;/a&gt;. That will sort you out... As for how research papers are used in practise, I think it's about tweaking the model, when a better solution to a common problem comes along.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, there is practical value in the paper &lt;a href=&quot;http://arxiv.org/pdf/1105.3115&quot; rel=&quot;nofollow noreferrer&quot;&gt;Dealing with the Inventory Risk. A solution to the market making problem&lt;/a&gt; and see all the linked academic papers.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastEditorUserId="7369" LastEditDate="2017-12-08T10:52:29.110" LastActivityDate="2017-12-08T10:52:29.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14903" PostTypeId="1" CreationDate="2014-09-30T10:17:56.277" Score="3" ViewCount="944" Body="&lt;p&gt;I posted this question before on &lt;a href=&quot;https://math.stackexchange.com/questions/946968/law-of-a-geometric-brownian-motion-first-hitting-time-proof-checking&quot;&gt;MSE&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I need to use it in a small step in the middle of a simulation and&#xA;  I think I'm not getting correct results to this probabilities and so&#xA;  for my all subsequent simulation.&#xA;       Could someone please check my results and my proof below?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I would like to obtain the law of the first hitting time of a geometric Brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More precisely, to compute $\mathbb P [\tau_B \leq T]$ where $$\tau_B := \inf\{0 \leq t \leq T: X_t \leq B \}$$  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and $X = (X_t)_{t \geq 0}$ is a geometric brownian motion of drift  $\mu$ and volatility $\sigma$ with initial condition $X_0&amp;gt; B$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's known that it can be obtained in terms of the law of the minimum/maximum of a drifted  Brownian motion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed,  since $X_t = X_0 \exp ((\mu -\frac{\sigma^2}{2})t + \sigma W_t  )$ and $\{\tau_B\leq T\}= \{X_T^*\leq B\}$ where $X^* = (X_t^*)_{t \geq 0}$ defined by $X^*_t =\min_{t \in [0,T]} X_t$, one can write &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;\mathbb P [\tau_B \leq T]&amp;amp;= \mathbb P [X_T^*\leq B]\\&#xA;               &amp;amp;= \mathbb P \left[\xi_T^{(\lambda)}\leq \ln \left(\frac{B}{X_0}\right)\right]&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\xi_t^{(\lambda)}=\min_{s \in [0,t] }\{\bar{\mu} t+\sigma W_t \}= \min_{s \in [0,t] }\{\lambda t + W_t \}$ (last equality comes by scaling) with $\bar{\mu}=(\mu -\frac{\sigma^2}{2}) $ and $\lambda=\frac{\bar{\mu}}{\sigma^2}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then one can just use the formula (see &lt;a href=&quot;http://famille-chazal.pagesperso-orange.fr/articles/maxbrownien.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; for reference, the proof is a straightforward application of Girsanov theorem)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb P \left[\Lambda_T^{(\eta)}\geq x\right]=e^{2\eta x}\mathcal N\left(\frac{-x-\eta t}{\sqrt t}\right)+\mathcal N\left(\frac{-x+\eta t}{\sqrt t}\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for the law of the maximum of the drifted Brownian motion $\Lambda_t^{(\eta)} := \max_{s \in [0,t] }\{\eta t+W_t \}$. &#xA;Therefore since by symmetry  $\Lambda_t^{(\eta)}\overset{\mathcal L} {=} -\xi_t^{(-\eta)}$ where $\xi_t^{(\eta)} :=\min_{s \in [0,t] }\{\eta t+ W_t \}$ is the minimum of the drifted brownian motion, one can can obtain the following formula &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;\mathbb P [\tau_B \leq T]&amp;amp;= \mathbb P [X_T^*\leq B]\\&#xA;               &amp;amp;= \mathbb P \left[\xi_T^{(\lambda)}\leq \ln \left(\frac{B}{X_0}\right)&#xA;\right]&#xA;\\&#xA;  &amp;amp;= \mathbb P \left[-\Lambda_T^{(-\lambda)}\leq \ln \left(\frac{B}{X_0}\right)&#xA;\right]&#xA;\\&#xA;&amp;amp;=e^{2\lambda \ln \left(\frac{B}{X_0}\right)}\mathcal N\left(\frac{ \ln \left(\frac{B}{X_0}\right)+\sigma^2 \lambda T}{\sigma \sqrt T}\right)+\mathcal N\left(\frac{ \ln \left(\frac{B}{X_0}\right)-\sigma^2 \lambda  T}{\sigma \sqrt T}\right)\\&#xA;&amp;amp;=\left(\frac{B}{X_0}\right)^{2\lambda}\mathcal N\left(\frac{ \ln \left(\frac{B}{X_0}\right)+\bar{\mu} T}{\sigma \sqrt T}\right)+\mathcal N\left(\frac{ \ln \left(\frac{B}{X_0}\right)-\bar{\mu}  T}{\sigma \sqrt T}\right)&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please let me know if you notice any mistake.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm having values bigger than one and an unexpected shape for the function $f(B) := \mathbb P [\tau_B \leq T]$ as you can see below in the graphic (Axes $y =f(B)$ and $x =B$; here X_0= 68).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I forced it to be 1 for barrier values equal or higher than the initial value. Nonetheless I think there is still a problem with the formula not only it should be automatically 1 for $B \leq X_0$. The probabilities I have calculating it by Monte Carlo are higher than the values obtained by this formula as you can see in the second graphic bellow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/YtfDi.png&quot; alt=&quot;enter image description here&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/MbJwc.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="3534" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2021-05-21T22:41:24.823" Title="Law of a geometric brownian motion first hitting time (formula dont match Monte Carlo Simulation)" Tags="&lt;stochastic-processes&gt;&lt;monte-carlo&gt;&lt;probability&gt;&lt;barrier&gt;&lt;stopping&gt;" AnswerCount="0" CommentCount="10" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14904" PostTypeId="2" ParentId="14900" CreationDate="2014-09-30T14:01:53.403" Score="1" Body="&lt;p&gt;Do you know the concept of duration? It is an approximation of how much the price of the bond changes if the interest rate (appropriate for the market in which the bond trades) changes. This is the interest rate is used to discount cash flows. It is common to all the bonds in the same market (e.g. German govis).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For various reasons (liquidity, credit risk, ...) bonds trade at a price that can not be explained by the curve of the market that it used for discounting. Then you need some extra discounting - this number, usually additive, is the spread. It is specific for the bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a zero coupon bond and exponential discounting as a toy exampke you can say that the price is given by&#xA;$$&#xA;P = \exp(- r T),&#xA;$$&#xA;where $T$ is the time to maturity and&#xA;$$&#xA;r = r_{common} + s_{specific}&#xA;$$&#xA;where $r_{common}$ is the rate for the market and $s_{specific}$ is the specific spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $r_{common}$ changes then you can approximate this by the usual duration if $s_{specific}$ changes then you can call this spreadduation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For vanilla fixed rate bonds interest rate duration and spread duration are the same. For floaters or bonds with optionalities it is different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that for fixed rate bonds it does not matter whether $r_{common}$ or $s_{specific}$ change. If one of these changes (by a parallel shift) by $x$ the price will by&#xA;$$&#xA;P = \exp(- (r+x) T)&#xA;$$&#xA;and the change in values is&#xA;$$&#xA;\exp(- (r+x) T)-\exp(- rT). &#xA;$$&#xA;In the case of plain vanilla bonds most of the concepts of duration analysis can be taken over to changes in spread. Essentially this is what they do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that on page 2 they write that the change in price is approx. the change in spread times the duration. This is clear if we know how duration works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we change the wording from absolute numbers (spread widens by 10 bps, say from 15 bps to 25bps) to relative numbers (spread widens from a level of 15 bps by $66\%$) then we simply pull out the spread level and look at relative changes and have&#xA;$$&#xA;R = -D*s*r_s&#xA;$$&#xA;where $R$ is the relative change of the bond price, D is the duration, s is the spread level and $r_s$ is the relative change of the spread level. Then we arrive at $D*s$ which is duration times spread.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-09-30T14:01:53.403" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14905" PostTypeId="2" ParentId="14218" CreationDate="2014-09-30T14:08:21.423" Score="3" Body="&lt;p&gt;Perhaps &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2400219&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt; by Hyun Woo Byun and coauthors is what you're looking for: &lt;em&gt;Using a Principal Component Analysis to develop Multi-Currency Trading algorithms in the FX market&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They apply principal component analysis to a currency basket of 9 pairs with a 2 month rolling window. In a second step, various techniques (logistic regression, decision trees, neural networks) are used to make a predictions of the first PCA component, using technical indicators as predictors.&lt;/p&gt;&#xA;" OwnerUserId="6721" LastActivityDate="2014-09-30T14:08:21.423" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14906" PostTypeId="1" CreationDate="2014-09-30T17:12:33.790" Score="2" ViewCount="1118" Body="&lt;p&gt;I just want to check that I am interpreting the ACF and PACF plots correctly:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/OYfo6.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/6vaY3.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The data corresponds to the errors generated between the actual data points and the estimates generated using an AR(1) model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've looked at the answer here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stats.stackexchange.com/questions/106038/estimate-arma-coefficients-through-acf-and-pacf-inspection/&quot;&gt;https://stats.stackexchange.com/questions/106038/estimate-arma-coefficients-through-acf-and-pacf-inspection/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After reading that it seems that the errors are not autocorrelated but I just want to be sure, my concerns are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1.) The first error is right on the boundary (when this is the case should I accept or reject that there is significant auto-correlation at lag 1)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2.) The lines represent the 95% confidence interval and given that there are 116 lags I would expect no more than (0.95*116=5.8 which I round up to 6) 6 lags to be exceed the boundary. For the ACF this is the case but for the PACF there are about 10 exceptions. If you include those on the border it's more like 14? Does this still indicate no auto-correlation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3.) Should I read anything into the fact that all the breaches of the 95% confidence interval occur to the downside?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Baz  &lt;/p&gt;&#xA;" OwnerUserId="7077" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2015-02-27T22:30:37.937" Title="How to interpret ACF and PACF plots" Tags="&lt;time-series&gt;&lt;auto-correlation&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14907" PostTypeId="1" CreationDate="2014-09-30T19:42:24.383" Score="2" ViewCount="946" Body="&lt;p&gt;I have discussion with my colleague on why a general assumption $$ud=1$$ in binomial tree option pricing model would be necessary?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I take it a simplification of the problem, otherwise, there will be more intermediate nodes in the tree, which will be hard to compute. While my colleague insists that since the underlying is often lognormal with 0 mean, $ud=1$ were a fair assumption.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think his explanation is acceptable. The question, is there any other reason to make $ud=1$ assumption?&lt;/p&gt;&#xA;" OwnerUserId="3030" LastEditorUserId="9336" LastEditDate="2014-09-30T21:45:11.650" LastActivityDate="2015-01-20T00:48:15.510" Title="Is it fair to assume $(ud=1)$ in the binomial tree option pricing model?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;binomial-tree&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14909" PostTypeId="2" ParentId="14907" CreationDate="2014-09-30T21:19:13.253" Score="4" Body="&lt;p&gt;The condition&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ud=1\text{, or equivalently }u=1/d$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is necessary to ensure convergence of the Binomial tree's mean $\mu$ and standard deviation $\sigma$ to nonfinite values when $n$ (number of steps) goes to infinity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cox-Rubinstein-Ross showed in their famous &lt;a href=&quot;http://www.dms.umontreal.ca/~morales/docs/cox_rubinstein_ross.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;paper&lt;/a&gt;, that to achieve this, we must have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$u=e^{\sigma\sqrt{t/n}}\text{, }d=e^{-\sigma\sqrt{t/n}}$$ respectively, which holds exactly: $$ud=1.$$ &lt;em&gt;We can aswell choose $\mu$ and $\sigma$ to fit $u$ and $d$ respectively, so $ud=1$ is the actual condition.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Paper excerpt:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/0tozb.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-09-30T21:19:13.253" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14910" PostTypeId="2" ParentId="14855" CreationDate="2014-09-30T21:30:05.090" Score="0" Body="&lt;p&gt;Dividend estimation and forecast is not an easy problem. &lt;a href=&quot;http://www.optionmetrics.com/pdf/DividendForecasting_WhitePaper.pdf&quot; rel=&quot;nofollow&quot;&gt;This paper&lt;/a&gt; describes and compares few approaches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the company pays dividend according to a certain scheme (quarterly, annually, etc.), it's easy to forecast a future dividend yield, using last known paid amount and the underlying price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In some cases (like European and Asian companies), the forecasting becomes more tricky, as dividends pay outs are unequal (interim and final).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The correct answer here depends on what kind of underlying instruments you are dealing with.&lt;/p&gt;&#xA;" OwnerUserId="2909" LastActivityDate="2014-09-30T21:30:05.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14911" PostTypeId="1" AcceptedAnswerId="14925" CreationDate="2014-09-30T23:58:59.697" Score="3" ViewCount="1192" Body="&lt;p&gt;I have a table of cumulative probabilities of default of industrial bonds, in time and credit rating. It is similar to &lt;a href=&quot;http://www.standardandpoors.com/ratings/articles/en/us/?articleType=HTML&amp;amp;assetID=1245331026864&quot; rel=&quot;nofollow noreferrer&quot;&gt;S&amp;amp;P whitepaper here&lt;/a&gt;. Basically, it looks like this (sample numbers):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Years | AAA   | AA    | A    | ... | C&#xA;  1   | 0.01% | 0.04% | 0.09 | ...&#xA;  ...&#xA;  30  | 1%    | 5%    | 8%   | ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This data has gaps both in time and in credit rating. Is there any standard methodology on how to do such interpolations/extrapolations or perhaps a paper/book I can read on the subject?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On a related note, what if the numbers in the table are interest rates for the corresponding bonds - is there a methodology for that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt; &lt;a href=&quot;https://quant.stackexchange.com/q/9304/3029&quot;&gt;Related Question&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3029" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2014-10-01T21:10:47.980" Title="Interpolating probabilities of default" Tags="&lt;interest-rates&gt;&lt;credit-ratings&gt;&lt;interpolation&gt;&lt;default-probability&gt;&lt;extrapolation&gt;" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14912" PostTypeId="1" CreationDate="2014-10-01T05:54:46.913" Score="2" ViewCount="667" Body="&lt;p&gt;In Robert Merton's derivation of the efficient frontier of a portfolio, he minimizes &#xA;$\frac{1}{2}\sigma^2 $ over the investment weights in each asset, where $\sigma^2$ represents portfolio variance. I am confused why the function he minimizes is half the variance, instead of just the variance. It doesn't make a difference in calculations, but I cannot figure out why he (and all other derivations) do this.&lt;/p&gt;&#xA;" OwnerUserId="12185" LastActivityDate="2014-10-01T06:45:30.170" Title="Efficient Frontier Derivation: why minimize half the portfolio variance instead of just the variance?" Tags="&lt;optimization&gt;&lt;modern-portfolio-theory&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14913" PostTypeId="2" ParentId="14912" CreationDate="2014-10-01T06:45:30.170" Score="2" Body="&lt;p&gt;I assume you're talking about this formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$U(w) = w'\mu - \frac{1}{2} \lambda w' \Sigma w = w'\mu - \frac{1}{2} \lambda \sigma_\omega^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\sigma_\omega^2$ denotes the portfolio variance for a portfolio with weights $\omega$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dividing by two is purely done for convenience, optimizing this formula requires taking the derivative with respect to $\omega$ and setting it to $0$. When the derivative is taken the factor $\frac{1}{2}$ is canceled by the square.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See this &lt;a href=&quot;https://quant.stackexchange.com/q/8405/848&quot;&gt;question&lt;/a&gt; on more information on setting $\lambda$.&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2014-10-01T06:45:30.170" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="14914" PostTypeId="2" ParentId="2205" CreationDate="2014-10-01T07:24:13.777" Score="1" Body="&lt;p&gt;For calculating systematic risk(beta) for a company which is registered on stock exchange&#xA;can be calculated in excel through following steps.&#xA;1. co variance of both will be multiplied &#xA;2. Divided by the variance of stock exchange index&#xA;A common expression for beta is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for further see link &lt;a href=&quot;http://en.wikipedia.org/wiki/Beta_(finance)&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Beta_(finance)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;by Akhtar rasheed&#xA; international islamic university islamabad&#xA; BBA 24(A)&lt;/p&gt;&#xA;" OwnerUserId="12186" LastActivityDate="2014-10-01T07:24:13.777" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14916" PostTypeId="1" AcceptedAnswerId="14917" CreationDate="2014-10-01T13:31:38.943" Score="1" ViewCount="810" Body="&lt;p&gt;I am using MATLAB to do an optimisation. The QP minimisation problem is set up in the standard form shown below. The optimisation is used to calculate the weights (x vector in the equation below) of a portfolio.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Min    0.5 (x'Fx) + c'x&#xA; x &#xA;&#xA;st&#xA;&#xA;x_low &amp;lt;= x &amp;lt;= x_up&#xA;b_low &amp;lt;= Ax &amp;lt;= b_up&#xA;&#xA;where &#xA;&#xA;c is a n x 1 vector in the objective function&#xA;x is a n x 1 vector (weights of the stocks in the portfolio)&#xA;F is a n x n matrix in the objective function&#xA;A is the linear constraint matrix&#xA;b_low &amp;amp; up  are the lower and upper bounds for the linear constraints&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Trying to follow an example but have two issues. Firstly say the portfolio has 500 stocks the x vector passed into the optimiser (x here is our initial guess) will have the dimension of 1000 x 1. The second 500 will have the opposite sign of the first 500, I do not understand why this is?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also the F matrix does something similar. Say I have a matrix R which contains some risk factors, which is 500 x 500. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then F is set to the following (sorry not sure how to show matrices on this site properly)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; F =  R   -R&#xA;     -R    R&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Again why would you do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solver is actually Tomlab (user guide of the solve is here &lt;a href=&quot;http://tomopt.com/docs/TOMLAB_KNITRO.pdf&quot; rel=&quot;nofollow&quot;&gt;link&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Further Info&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just stepping through the code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;x0 is passed as an intial guess vector 1000 x 1. The first 500 weights are the previous weights. The next 500 weights are all set to zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;x_up is obviously also a 1000 x 1 vector to. Looking further into the code. The first 500 weights are the upper bounds on the buys the next 500 are the upper bounds on the sells. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;x_low is the same but for the lower bounds. First 500 weights are the lower bounds on the buys the next 500 are the lower bounds for the sales.&lt;/p&gt;&#xA;" OwnerUserId="7530" LastEditorUserId="7530" LastEditDate="2014-10-01T16:07:37.140" LastActivityDate="2014-10-01T16:07:37.140" Title="quadratic programming portfolio optimisation" Tags="&lt;quant-trading-strategies&gt;&lt;optimization&gt;&lt;portfolio-optimization&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14917" PostTypeId="2" ParentId="14916" CreationDate="2014-10-01T14:15:29.683" Score="1" Body="&lt;p&gt;OK one thing that comes to my mind is the standard trick to reformulate constraints like $|x_i|&amp;lt;=c$ (limiting exposure of $x_i$ while still allowing negative weights).&#xA;Notice, that $|x_i| \leq c$ is not a linear constraint, so the solver wont work in this case. A little trick can help:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You split up the variables into positive and negative parts: $x_i=x_i^+ + x_i^-$&#xA;Now, by definition, $x_i^+ \geq 0$ and $x_i^-\leq 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;now, notice that $|x_i|= x_i^+ - x_i^-$ and the constraint becomes linear:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ x_i^+ - x_i^- \leq c, \quad x_i^+ \geq 0, \quad x_i^-\leq 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have other linear constraints for $x_i$, you simply plug in $x_i = x_i^+ + x_i^-$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This method will double the dimensions but magically &quot;linearises&quot; the constraints.&#xA;Of yourse, you need to reformulate the whole functional (for example $F = 1/2* (R,-R; -R,R)$ which almost corresponds to your observation)&lt;/p&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2014-10-01T14:15:29.683" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14918" PostTypeId="2" ParentId="14911" CreationDate="2014-10-01T14:56:15.187" Score="1" Body="&lt;p&gt;I worked for a company where we had a similar problem with a volatility surface. I tried applying LOESS to it, but it didn't work. The final result has to conform to some obvious monotonicity restrictions and if that is not built into the smoothing method there will always be some odd points in the end.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another problem is that smoothing typically allows the fitted surface to deviate from the observed values, which in some cases may be unacceptable. That is, it makes more sense to have a not very smooth, piecewise linear surface rather than a smooth one that deviates from some important observed values even a bit. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unless you really need to automate this, the best way is to put it into Excel and perform a few manual interpolations of rows and columns, until the 3-d plot starts making sense.&lt;/p&gt;&#xA;" OwnerUserId="12031" LastActivityDate="2014-10-01T14:56:15.187" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14919" PostTypeId="1" CreationDate="2014-10-01T17:26:15.117" Score="6" ViewCount="393" Body="&lt;p&gt;I'm a finance professor and I am looking for someone with actual trading and risk management knowledge within the energy sector who can tell me about pricing and hedging energy (especially electricity and natural gas) risk. I am writing a book and looking for real world examples. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is which tools actually get used? Are exchange traded futures and options used in practice? Are sophisticated pricing models and numerical techniques like Monte Carlo methods used?  Are sophisticated econometric models used to forecast load? etc?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What can you tell me about which tools from the academic world actually get used in the real world? What examples can you give me.  Thank you for your tutelage. &lt;/p&gt;&#xA;" OwnerUserId="12190" LastActivityDate="2017-09-05T00:32:15.777" Title="Which quantitative tools are actually used for hedging energy price and volume risk?" Tags="&lt;monte-carlo&gt;&lt;pricing&gt;&lt;hedging&gt;&lt;econometrics&gt;&lt;commodities&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14920" PostTypeId="1" CreationDate="2014-10-01T17:33:26.630" Score="0" ViewCount="331" Body="&lt;p&gt;I have been playing around with some equities historical market data and I understand that different exchanges have different definitions of what Level II (Limit Order Book) data means. What I'm interested in knowing is &lt;strong&gt;when/how often&lt;/strong&gt; is the data updated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, I see that some exchanges (like NYSE with their OpenBook data) aggregates and refreshes the data every second, while others don't specify at all when/how but appear to do so at irregular time intervals. The question is: is the data updated at every occurrence of an event (such as the submission of a Limit Order, execution of a Limit Order or cancellation of a Limit Order, etc...) or is there some other way?&lt;/p&gt;&#xA;" OwnerUserId="11874" LastActivityDate="2014-10-01T19:22:09.373" Title="Level II market data (equities)" Tags="&lt;equities&gt;&lt;market-data&gt;&lt;market-microstructure&gt;&lt;historical-data&gt;&lt;limit-order-book&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14921" PostTypeId="2" ParentId="14892" CreationDate="2014-10-01T18:05:38.097" Score="2" Body="&lt;p&gt;If the security has negative correlation with other assets that enjoy attractive risk-free rates, then it can be attractive at a return rate under the risk-free level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would, of course, never be attractive in a single-security portfolio.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2014-10-01T18:05:38.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14922" PostTypeId="2" ParentId="14911" CreationDate="2014-10-01T18:14:26.500" Score="1" Body="&lt;p&gt;The typical approach is to try to fit a &lt;a href=&quot;https://www.inkling.com/read/risk-management-financial-institutions-hull-3rd/chapter-18/18-1-ratings-transition-matrices&quot; rel=&quot;nofollow&quot;&gt;ratings migration matrix&lt;/a&gt; to available rating transition data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If default rates are all you have then that's going to be difficult.  Instead, I might try to fit a separate reduced form credit model on survival probability $P_\ell$ for each rating $\ell$ by fitting the function&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;P_\ell(T) = \exp\left( -\int_0^T h(t) dt\right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $h(t)$ constrained to be a useful 2-parameter function, such as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;h(t) = C_0 + C_1/t&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2014-10-01T18:14:26.500" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14923" PostTypeId="2" ParentId="14919" CreationDate="2014-10-01T18:48:17.977" Score="4" Body="&lt;p&gt;I am a professor too and I did work with Siemens Corporate Technology which provides the quantitative technology for their copper and electricity trading (Siemens being one of the biggest players in this area in Europe). They are mainly using sophisticated neural networks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We also published a paper together, see my answer here:&lt;br&gt;&#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/934/what-types-of-neural-networks-are-most-appropriate-for-trading/969#969&quot;&gt;What types of neural networks are most appropriate for trading?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you provide a link to your university page I will establish the contact between you.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2014-10-01T18:48:17.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14924" PostTypeId="2" ParentId="14920" CreationDate="2014-10-01T19:22:09.373" Score="3" Body="&lt;p&gt;As you've mentioned, it depends on the trading venue and the exact market data product that you're subscribed to. Unless otherwise stated, the data is usually updated at every occurrence of an event (explains the irregualr intervals), and often, the data is not &lt;strong&gt;disseminated&lt;/strong&gt; immediately and multiple events may be batched in a single message informing you of the update (explains why you often see events with the same timestamp on a third-party vendor's feed that abstracts away the messaging layer).&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2014-10-01T19:22:09.373" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14925" PostTypeId="2" ParentId="14911" CreationDate="2014-10-01T21:10:47.980" Score="2" Body="&lt;p&gt;I believe that your problem can be formulated as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Find PD matrix that is as close as possible to a given PD matrix (result of some previous calibration, or the matrix computed using average hazard rate, or any other &quot;target&quot;, or the penalty on non-smoothness) subject to the following constraints:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The values that are given must be matched exactly&lt;/li&gt;&#xA;&lt;li&gt;Monotonicity constraints (in both time and rating) must be satisfied, and so are 0 and 1 bounds.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This fits the definition of &lt;a href=&quot;http://en.wikipedia.org/wiki/Quadratic_programming&quot; rel=&quot;nofollow&quot;&gt;quadratic programming&lt;/a&gt;. Matlab has got it [implemented].&lt;a href=&quot;http://www.mathworks.co.uk/help/optim/ug/quadprog.html&quot; rel=&quot;nofollow&quot;&gt;2&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quadratic programming is a method that allows you to find the best possible answer. However, if there are not too many gaps, and being close to the &quot;target&quot; is not essential, you can interpolate/extrapolate them manually, subject to constraints&lt;/p&gt;&#xA;" OwnerUserId="8051" LastActivityDate="2014-10-01T21:10:47.980" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14926" PostTypeId="1" CreationDate="2014-10-02T07:05:40.953" Score="4" ViewCount="247" Body="&lt;p&gt;I need to calculate WACC for copany operating in the coutry with islamic finance system. I used build-up method to calculate cost of equity. But still searching for cost of debt in the economy. Has anybody faced the same problem? Any ideas how cost of debt can be determined for the economy with financial system based on islamic finance?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on my research, I found out that there are 2 types loans availlable in Islamic finance: transaction based and P&amp;amp;L sharing. Depending on the availlable bank products in the country that can be used by the country. the profit rates or transaction type prodcts only (if company is eligible to use these type of products) determined by the Central bank can be used as cost of debt. If company is not eligible using transaction type products,then cost of equity should be used as WACC. Moreover in case of if company is eligible for transaction type products, the debt to equity ratio should be constrainted by the amount of tangible assets of the company. As transaction type products can only be used for tangible asset purchase.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any comments are more than appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pasha&lt;/p&gt;&#xA;" OwnerUserId="1179" LastEditorUserId="1179" LastEditDate="2014-10-08T06:53:46.827" LastActivityDate="2014-10-08T06:53:46.827" Title="ISLAMIC FINANCE WACC" Tags="&lt;wacc&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14927" PostTypeId="1" AcceptedAnswerId="28129" CreationDate="2014-10-02T08:39:55.973" Score="3" ViewCount="135" Body="&lt;p&gt;I recalled reading a academic paper that studied how long a market exploitation took to get priced into the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to find that article. I remember it stating that the market priced in the exploitation on average around 30 days.&lt;/p&gt;&#xA;" OwnerUserId="7954" LastEditorUserId="848" LastEditDate="2014-10-02T14:44:07.373" LastActivityDate="2016-07-18T16:05:25.503" Title="Time Lag for Market Inefficiency" Tags="&lt;research&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14928" PostTypeId="2" ParentId="14899" CreationDate="2014-10-02T08:55:04.057" Score="3" Body="&lt;p&gt;FREE SOURCES --&gt;&#xA;&lt;a href=&quot;http://www.cmegroup.com/market-data/settlements/&quot; rel=&quot;nofollow&quot;&gt;http://www.cmegroup.com/market-data/settlements/&lt;/a&gt;&#xA;&lt;a href=&quot;http://www.cboe.com/data/Settlement.aspx&quot; rel=&quot;nofollow&quot;&gt;http://www.cboe.com/data/Settlement.aspx&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your best bet is going to each exchanges' website and downloading it directly from them. If not, you are going to have to find a data provider like a BBG or TR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I strongly recommend that you check out or get on a Bloomberg terminal, and type in function CTM, which will bring up every exchange contract listed. Either hit contract table or find the desired ticker and put this into the excel api. The field would be px_last and you would have to select the time stamp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another recommendation would be to try and access &quot;thomson reuters tick history&quot; and search for the RIC which is a pain.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have not had much luck, because their data has been spoty regarding tick data, but for daily settlement it should not be a problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best of luck!&lt;/p&gt;&#xA;" OwnerUserId="7954" LastActivityDate="2014-10-02T08:55:04.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14929" PostTypeId="2" ParentId="14899" CreationDate="2014-10-02T09:11:26.100" Score="2" Body="&lt;p&gt;Since I do not have enough rep to post more links, check these out as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;http:/online.wsj.com/mdc/public/page/2_3023-fut_metal-futures.html&#xA;https:/globalderivatives.nyx.com/nyse-liffe-us/end-of-day-files&#xA;&lt;a href=&quot;http://ww.eurexchange.com/exchange-en/market-data/clearing-data/settlement-prices/&quot; rel=&quot;nofollow&quot;&gt;http://ww.eurexchange.com/exchange-en/market-data/clearing-data/settlement-prices/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7954" LastActivityDate="2014-10-02T09:11:26.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14930" PostTypeId="2" ParentId="14855" CreationDate="2014-10-02T11:18:33.993" Score="2" Body="&lt;p&gt;For European options you can utilise put-call parity and reverse out the implied dividend yield.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;F(T,K) = C(T,K) - P(T,K)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and obviously&lt;/p&gt;&#xA;&#xA;&lt;p&gt;F(T) = S(t)*e^[(r-d)*(T-t)]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interestingly, you get mostly OK results for American ATM options also.  Cf. Avellaneda's comments on this in one of his lecture's, page 18, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://math.nyu.edu/faculty/avellane/DSLecture3.pdf&quot; rel=&quot;nofollow&quot;&gt;http://math.nyu.edu/faculty/avellane/DSLecture3.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The one gotcha is when there is heavy shorting of the stock. In this case what you are actually measuring becomes clear - convenience yield - as now the stock holders earn a nice stock lending fee as well the dividend yield. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I created a Python script which grabs the data does this calculation, &lt;a href=&quot;http://idivs.org&quot; rel=&quot;nofollow&quot;&gt;idivs.org&lt;/a&gt;.  There's also an API available which you can use in spreadsheets etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tested American ETF implied dividend yields against European Index dividend yields and they are pretty close.&lt;/p&gt;&#xA;" OwnerUserId="7682" LastActivityDate="2014-10-02T11:18:33.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14931" PostTypeId="1" AcceptedAnswerId="14932" CreationDate="2014-10-02T14:40:56.120" Score="2" ViewCount="2174" Body="&lt;p&gt;I have a few bonds and OAS and Duration for each. I had a Linear programming type of problem where I had to maximize OAS and keep duration &amp;lt;= constraint. There are few other constraints. I could easily model them using &lt;code&gt;linprog&lt;/code&gt; in MATLAB. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately the portfolio turnover is too high. I want to put a constraint on this turnover. Something like 10% of total portfolio. Since it is not a linear programming problem anymore I am a bit stuck. Any thoughts will be greatly helpful? &lt;/p&gt;&#xA;" OwnerUserId="1386" LastEditorUserId="848" LastEditDate="2014-10-02T15:16:47.417" LastActivityDate="2014-10-09T13:19:28.637" Title="Portfolio Turnover Constraint" Tags="&lt;portfolio-optimization&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14932" PostTypeId="2" ParentId="14931" CreationDate="2014-10-02T16:53:55.257" Score="3" Body="&lt;p&gt;At each rebalancing day, you were previously maximizing&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA; \vec{w}^* \vec{r} -\lambda \vec{w}^* \Sigma \vec{w}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, you need to combine this with a way of expressing your trading constraint mathematically.  Let's say your previous weights were $\vec{p}$.  Then your 10% constraint translates to specifying that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;0.1 \geq \sum |w_i-p_i|&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be handled by &lt;code&gt;fmincon&lt;/code&gt;, or perhaps even by some of Matlab's simpler optimizers.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2014-10-02T19:03:22.010" LastActivityDate="2014-10-02T19:03:22.010" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14934" PostTypeId="1" AcceptedAnswerId="14940" CreationDate="2014-10-03T01:01:40.977" Score="1" ViewCount="218" Body="&lt;p&gt;I am struggling trying to find out where they get the $8$% interest rate for the loan you make to purchase the Sterling Bond in the following strategy:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose that $A(0)$ = $100$ and $A(1)$ = $105$ dollars, the present price of&#xA;pound sterling is $S(0)$ = $1.6$ dollars, and the forward price is $F = 1.50$&#xA;dollars to a pound with delivery date $1$. How much should a sterling&#xA;bond cost today if it promises to pay $£100$ at time $1$? Hint: The forward&#xA;contract is based on an asset involving negative carrying costs (the&#xA;interest earned by investing in sterling bonds).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Strategy:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose that a sterling bond promising to pay $£100$ at time $1$ is selling for $x$&#xA;pounds at time $0$. To find $x$ consider the following strategy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;At time $0$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• Borrow $1.6x$ dollars and change the sum into $x$ pounds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• Purchase a sterling bond for $x$ pounds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• Take a short forward position to sell $£100$ for $\$1.50$ to a pound with&#xA;delivery date $1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, at time $1$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• Cash the bond, collecting $£100$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• Close the short forward position by selling $£100$ for $\$150$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• Repay the cash loan with interest, that is, $1.68x$ dollars in total.&lt;/p&gt;&#xA;" OwnerUserId="12198" LastEditorUserId="12198" LastEditDate="2014-10-03T01:06:44.063" LastActivityDate="2014-10-03T12:17:23.483" Title="Interest rate on loan for purchasing Sterling bond" Tags="&lt;bond&gt;&lt;forward&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14935" PostTypeId="2" ParentId="14927" CreationDate="2014-10-03T03:29:31.863" Score="1" Body="&lt;p&gt;By market exploitation ... not so sure if I understand what you are saying but I suggest this &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1787215&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt;. It is on the slow information diffusion where for some portfolio of stocks it can take up to 30 days if not more for the information to get impounded into the stock prices. &lt;/p&gt;&#xA;" OwnerUserId="2570" LastActivityDate="2014-10-03T03:29:31.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14936" PostTypeId="2" ParentId="14878" CreationDate="2014-10-03T06:11:24.253" Score="1" Body="&lt;p&gt;This reminds me of a paper by Rama Cont: &quot;Empirical properties of asset returns: stylized facts and statistical issues.&quot;. You can download here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cmap.polytechnique.fr/~rama/papers/empirical.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.cmap.polytechnique.fr/~rama/papers/empirical.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;He also has a paper on volatility clustering: &quot;Volatility clustering in financial markets: empirical facts and agent-based models.&quot;, which may be of your interest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cmap.polytechnique.fr/~rama/papers/clustering.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.cmap.polytechnique.fr/~rama/papers/clustering.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this help.&lt;/p&gt;&#xA;" OwnerUserId="6461" LastActivityDate="2014-10-03T06:11:24.253" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14938" PostTypeId="1" AcceptedAnswerId="14939" CreationDate="2014-10-03T06:30:19.877" Score="3" ViewCount="2470" Body="&lt;p&gt;I am trying a basic statistical arbitrage strategy as follows:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Perform PCA on a log return series of a basket of stocks&lt;/li&gt;&#xA;&lt;li&gt;Regress returns against top principal components identified&lt;/li&gt;&#xA;&lt;li&gt;Calculate the residuals of regression for each stock&lt;/li&gt;&#xA;&lt;li&gt;Fit a OU process on the residuals&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;To fit an OU process, calculated the sum of residuals for each stock and regressed them on the lagged sum of residuals. However sometimes the intercept and slope are negative. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I calibrate this to an OU process when intercept or slope is negative?&lt;/p&gt;&#xA;" OwnerUserId="12202" LastActivityDate="2014-10-03T08:14:17.683" Title="Calibrating an Ornstein Uhlenbeck process on residuals of regression" Tags="&lt;arbitrage&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14939" PostTypeId="2" ParentId="14938" CreationDate="2014-10-03T08:08:19.673" Score="4" Body="&lt;p&gt;You work in discrete time so you should not fit an OU-process but simply an AR(1) process which is its analogon in discrete time.&#xA;Look &lt;a href=&quot;https://math.stackexchange.com/questions/345773/how-the-ornstein-uhlenbeck-process-can-be-considered-as-the-continuous-time-anal&quot;&gt;here&lt;/a&gt; to see why this is true.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Calibrating the AR(1) boils down to do a regression on your residuals.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2014-10-03T08:14:17.683" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14940" PostTypeId="2" ParentId="14934" CreationDate="2014-10-03T12:17:23.483" Score="1" Body="&lt;p&gt;First, it's not a 8% loan. The .08 interest on 1.6 is 5%. It appears that it is coming from the $A (1) = 105$.&lt;/p&gt;&#xA;" OwnerUserId="12050" LastActivityDate="2014-10-03T12:17:23.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14941" PostTypeId="2" ParentId="14931" CreationDate="2014-10-03T15:45:20.507" Score="0" Body="&lt;p&gt;Thanks all for the adivse. I tried &lt;code&gt;fmincon&lt;/code&gt; . Unfortunately it was not converging to any solution and I was not getting an idea of which constraint is breaking it and which direction I should modify the constrain to reach a solution. &#xA;So this is what I finally did.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Continue using &lt;code&gt;linprog&lt;/code&gt; for optimization.&lt;/li&gt;&#xA;&lt;li&gt;Calculate $w_b$ and $w_s$ and calculate the portfolio churn as $w_c = w_b+w_s$&lt;/li&gt;&#xA;&lt;li&gt;if $w_c &amp;gt; 0.10*w_{total}$&lt;/li&gt;&#xA;&lt;li&gt;Create a vector of rates duration such that $\delta_r \in [\frac{\delta_{rTot}}{10},\delta_{rTot}] $&lt;/li&gt;&#xA;&lt;li&gt;Create a vector of spread duration such that $\delta_s \in [\frac{\delta_{sTot}}{10},\delta_{sTot}] $&lt;/li&gt;&#xA;&lt;li&gt;For each $\delta(i)_r$ I draw spreads from $\delta(1)_s...\delta(10)_s$ and re-run &lt;code&gt;linprog&lt;/code&gt; . I save each successful solutions $\delta(i)_s$,$\delta_r(j)$,OAS and $w_c$. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Hence in the end I have all the feasible solutions and corrosponding boundries of durations. Now I can suggest a few optimial portfolios with acceptable durations , OAS and transaction costs. (I have a function which models this for me based on Outstanding Amount , buy/sell Amounts etc)&#xA;It is brute force but works for me. This wasy I not just know the infeasibles but also all posible feasibles under an investment strategy be it &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Increade OAS and keep spread and duration under a boundry &lt;/li&gt;&#xA;&lt;li&gt;Keep OAS same but reduce durations&lt;/li&gt;&#xA;&lt;li&gt;A combination of the two with low transaction cost &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Just wanted to let other know in case it provide any help to anyone. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ended up coding up using &lt;em&gt;fmincon&lt;/em&gt; . I modelled the obective to increase the OAS and non linear constrain bit as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function [c,ceq]=NonLiniearConstraints(~,x,w_i)&#xA;    churn = 0.10;&#xA;   res = sum(abs(x-w_i));&#xA;   c(1) = res - 2*churn; % Buy + Sell = Total churn &#xA;   ceq = [];&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I verified that it produces same results as that of &lt;code&gt;isqlin&lt;/code&gt; which tries to minimize churn using least sqaures meathod. So I have marked Brian's answer as the correct one. &lt;/p&gt;&#xA;" OwnerUserId="1386" LastEditorUserId="1386" LastEditDate="2014-10-09T13:19:28.637" LastActivityDate="2014-10-09T13:19:28.637" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14942" PostTypeId="2" ParentId="10133" CreationDate="2014-10-03T19:58:55.580" Score="3" Body="&lt;p&gt;There is no such thing as a &quot;proper&quot; interpolation of CDS spreads. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only criterium your interpolation must obey is the absence of arbitrage. Note that, assuming that $spread(3M) &amp;lt; spread(6M)$, $spread(4M)$ can take any value between $spread(3M)$ and $spread(6M)$ without creating an arbitrage opportunity (actually it can be even slightly less than $spread(3M)$ or slightly higher than $spread(6M)$) without creating an arbitrage opportunity).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interpolation of hazard rate helps to create smoother curves - this is a desirable property. The other reason why the hazard rate interpolation is popular is because it is convenient to  use when pricing more complex instruments. Some instrument require single names modelling, and in this case one cam only use model hazard rate because otherwise it will be difficult to ensure the absence of arbitrage and it would be more computationally intense.&lt;/p&gt;&#xA;" OwnerUserId="8051" LastActivityDate="2014-10-03T19:58:55.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14943" PostTypeId="1" CreationDate="2014-10-03T23:25:49.677" Score="1" ViewCount="66" Body="&lt;p&gt;I am trying to map shocks from VAR to discount-rate and cash-flows news following the paper of &lt;a href=&quot;http://www.nber.org/papers/w9509.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Campbell and Vuolteenaho (2004)&lt;/a&gt;. It is said that news are a linear combination of shocks from VAR at (t+1) (see the formula on the picture). However, that means that both news will be perfectly correlated just by construction, or do I miss something?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/R7Gky.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe anybody did it before and can explain it?&#xA;Any help is very appreciated!&lt;/p&gt;&#xA;" OwnerUserId="12206" LastActivityDate="2014-10-03T23:25:49.677" Title="How to map shocks from VAR to news? (Academics)" Tags="&lt;research&gt;&lt;asset-pricing&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14944" PostTypeId="2" ParentId="9550" CreationDate="2014-10-04T02:13:32.533" Score="1" Body="&lt;p&gt;FIX has some known deficiencies. Repeating groups is one of them. It can be costly in terms of latency to parse repeating groups inside repeating groups, requiring recursive calls. I prefer protocols that send a first message signaling that N messages will follow with the group info.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FIX is also too verbose consuming too much bandwidth. For that they have come up with FAST which compresses FIX by a great amount but it is mainly used by the exchanges for market data, not order routing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When we developed our FIX and FAST engine (&lt;a href=&quot;http://www.coralblocks.com/index.php/category/coralfix/&quot; rel=&quot;nofollow&quot;&gt;CoralFIX&lt;/a&gt;), we focused on three things:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;It must have a very intuitive and easy-to-use API for fast turnaround when coding the connections to the exchanges.&lt;/li&gt;&#xA;&lt;li&gt;It must be low latency, designed from the ground up for speed.&lt;/li&gt;&#xA;&lt;li&gt;If it is a Java one it must leave zero garbage behind otherwise the GC will add unacceptable latencies and variance.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt; I am one of the developers of CoralFIX.&lt;/p&gt;&#xA;" OwnerUserId="11804" LastEditorUserId="11804" LastEditDate="2014-10-08T11:51:24.247" LastActivityDate="2014-10-08T11:51:24.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14945" PostTypeId="2" ParentId="14619" CreationDate="2014-10-04T02:31:02.507" Score="1" Body="&lt;p&gt;We have recently implemented a FAST decoder from scratch and let me tell you it is not easy. But if you want to go down that path this is the only reference material I found online: &lt;a href=&quot;http://jettekfix.com/fast_tutorial&quot; rel=&quot;nofollow&quot;&gt;http://jettekfix.com/fast_tutorial&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yes, FAST is just compression for FIX, used mainly for market data streaming.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you are done you should be able to read any FAST template in XML and spill out the parsing code. It becomes some sort of &lt;em&gt;metaprogramming&lt;/em&gt;. We offer a commercial FIX/FAST engine called &lt;a href=&quot;http://www.coralblocks.com/index.php/category/coralfix/&quot; rel=&quot;nofollow&quot;&gt;CoralFIX&lt;/a&gt; that does exactly that. Or you can also try this open source &lt;a href=&quot;http://www.openfast.org&quot; rel=&quot;nofollow&quot;&gt;alternative&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt; I am one of the developers of CoralFIX.&lt;/p&gt;&#xA;" OwnerUserId="11804" LastActivityDate="2014-10-04T02:31:02.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14947" PostTypeId="1" CreationDate="2014-10-04T13:49:04.920" Score="1" ViewCount="838" Body="&lt;p&gt;I got 1.3636 for beta for the problem below(165/121).&#xA;But I became so unsure about the answer when I solved (c) because then the market risk becomes larger than the variance of Stock A.&#xA;Beta^2*σ(M)^2=224.98&gt; σ(A)^2=220&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I making a mistake? Or if my solution is correct,how do I interpret this result?(all the variance of the Stock AS is all due to the Market?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance for your help!! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;*By 165%^2 and 220 %^2, I mean percent-squared. A variance of 165%^2 equals 165/10,000. Thanks.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Suppose that the riskless rate of return is 4% and the expected market&#xA;return is 12%. The standard deviation of the market return is 11%. Sup-&#xA;pose as well that the covariance of the return on Stock A with the market&#xA;return is 165%^2.&#xA;(a) What is the beta of Stock A?&#xA;(b) What is the expected return on Stock A?&#xA;(c) If the variance of the return on Stock A is 220%^2, what percentage of&#xA;this variance is due to market risk?&lt;/p&gt;&#xA;" OwnerUserId="12209" LastEditorUserId="12209" LastEditDate="2014-10-04T14:15:55.340" LastActivityDate="2014-10-04T14:48:19.380" Title="CAPM (SML) Problem" Tags="&lt;risk&gt;&lt;modern-portfolio-theory&gt;&lt;capm&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14948" PostTypeId="2" ParentId="14947" CreationDate="2014-10-04T14:04:48.483" Score="1" Body="&lt;p&gt;a) The formula for Beta is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\beta_i=\frac{\sigma_{i,M}^2}{\sigma_M^2}=\frac{0.165^2}{0.11^2}=2.25$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) So by the CAPM equation, the expected return for the asset is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E(R_i)=r_f+\beta(R_M-r_f)=0.04+2.25(0.12-0.04)=0.22=22\%$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;c) If the variance of the stock is $0.22^2$, since this variance was multiplied by $\beta=2.25$, we get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$1-(0.22^2/2.25)/(0.22^2)=55.55\%$$ of asset variance explained by market variance.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-10-04T14:48:19.380" LastActivityDate="2014-10-04T14:48:19.380" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="14950" PostTypeId="1" CreationDate="2014-10-04T18:59:19.637" Score="1" ViewCount="332" Body="&lt;p&gt;Would you please give me some information about application of &quot;Game theory&quot; and &quot;Optimisation&quot; in Finance and Mathematical Finance? which is more important to know and learn?&#xA;How about &quot;multi-criteria decision making&quot; and &quot;non-linear programming&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions and advice are welcome.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance.&#xA;Seer&lt;/p&gt;&#xA;" OwnerUserId="7985" LastActivityDate="2014-10-04T18:59:19.637" Title="What are the roles of &quot;Game theory&quot; and &quot;optimisation (linear, integer, conic)&quot; in Finance, Mathematical Finance?" Tags="&lt;optimization&gt;&lt;theory&gt;&lt;game&gt;" AnswerCount="0" CommentCount="4" ClosedDate="2014-10-04T21:40:12.967" ContentLicense="CC BY-SA 3.0" />
  <row Id="14951" PostTypeId="2" ParentId="12618" CreationDate="2014-10-05T09:13:17.200" Score="6" Body="&lt;p&gt;&lt;a href=&quot;https://www.cloud9trader.com&quot; rel=&quot;noreferrer&quot;&gt;Cloud9Trader&lt;/a&gt; uses Node.js on the back end and JavaScript across its technology stack, including for writing the trading algorithms themselves.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.cloud9trader.com&quot; rel=&quot;noreferrer&quot;&gt;https://www.cloud9trader.com&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12213" LastActivityDate="2014-10-05T09:13:17.200" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14952" PostTypeId="1" AcceptedAnswerId="14953" CreationDate="2014-10-05T23:20:33.500" Score="0" ViewCount="160" Body="&lt;p&gt;I have a list of French traded warrants identified by their ISINs. I do not know, however, to which stock they refer and what is their strike/maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which datasets allow me to retrieve this information?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks!&lt;/p&gt;&#xA;" OwnerUserId="6486" LastActivityDate="2014-10-06T07:41:33.783" Title="finding the strike / maturity of warrants given their ISINs" Tags="&lt;options&gt;&lt;equities&gt;&lt;bloomberg&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14953" PostTypeId="2" ParentId="14952" CreationDate="2014-10-06T07:41:33.783" Score="0" Body="&lt;p&gt;You used the Bloomberg tag so I will assume that you have access to a Bloomberg terminal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say your ISIN is &lt;code&gt;FR0011671296&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;In the terminal, you can type: &lt;code&gt;ID &amp;lt;Go&amp;gt;&lt;/code&gt; then type the ISIN and the security's page will open. You can then type &lt;code&gt;DES &amp;lt;Go&amp;gt;&lt;/code&gt; to see the details.&lt;/li&gt;&#xA;&lt;li&gt;If you are in Excel, you can use the API. For example to get the underlying you would use: &lt;code&gt;=BDP(&quot;FR0011671296 ISIN&quot;, &quot;OPT UNDL TICKER&quot;)&lt;/code&gt;. To find other fields, the best way is to go back to the terminal and type, for example, &lt;code&gt;FLDS MATURITY &amp;lt;Go&amp;gt;&lt;/code&gt; and you will see a list of related fields that you can use in Excel.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2393" LastActivityDate="2014-10-06T07:41:33.783" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14954" PostTypeId="2" ParentId="14863" CreationDate="2014-10-06T07:59:36.190" Score="6" Body="&lt;p&gt;To price financial instruments such as options, bonds and stocks must be priced so as to be &quot;arbitrage free&quot;. The concept of arbitrage can be made precise by one of the fundamental ideas of quantitative finance, the so called Arbitrage Theorem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put differently the Arbitrage Theorem provides a very elegant and general method for pricing  derivative instruments. The result from which the Arbitrage Theorem is normally derived is the Duality Theorem from linear programming. So in a way it could be argued that linear programming forms the theoretical basis of derivatives pricing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A very good introduction can be found here (from &lt;a href=&quot;http://www.worldscientific.com/worldscibooks/10.1142/8495&quot; rel=&quot;noreferrer&quot;&gt;An Undergraduate Introduction fo Financial Mathematics&lt;/a&gt; by J. Robert Buchanan):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.worldscientific.com/doi/suppl/10.1142/8495/suppl_file/8495_chap04.pdf&quot; rel=&quot;noreferrer&quot;&gt;The Arbitrage Theorem&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2014-10-06T07:59:36.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14955" PostTypeId="1" AcceptedAnswerId="14960" CreationDate="2014-10-06T10:22:16.427" Score="4" ViewCount="492" Body="&lt;p&gt;Given prob space $(\Omega, \mathscr{F}, P)$ and a Wiener process $(W_t)_{t \geq 0}$, define filtration $\mathscr{F}_t = \sigma(W_u : u \leq t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let 0 &amp;lt; p &amp;lt; q &amp;lt; r. Determine $E[W_p W_q W_r]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My attempt:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$0 = E[(W_r-W_q)(W_q-W_p)(W_p)]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\to E[W_p W_q W_r] = E[W_r W_p^2 + W_pW_q^2 + W_qW_p^2]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\to E[W_p W_q W_r] = E[(W_r+W_q) W_p^2 + W_pW_q^2]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\to E[W_p W_q W_r] = E[E[(W_r+W_q) W_p^2 + W_pW_q^2]|\mathscr{F_p}]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\to E[W_p W_q W_r] = E[W_p^2E[(W_r+W_q)|\mathscr{F_p}] + E[W_pE[(W_q^2)|\mathscr{F_p}]]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\to E[W_p W_q W_r] = ...0$ ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like the stuff are $\mathscr{F_p}$-measurable? $E[(W_r+W_q)]=0=E[W_p]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know. Help please? :(&lt;/p&gt;&#xA;" OwnerUserId="7788" LastActivityDate="2014-10-09T20:37:45.993" Title="Determine $E[W_p W_q W_r]$" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;wiener&gt;&lt;wienerprocess&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14956" PostTypeId="1" AcceptedAnswerId="14989" CreationDate="2014-10-06T10:41:57.437" Score="4" ViewCount="484" Body="&lt;p&gt;Given prob space $(\Omega, \mathscr{F}, P)$ and a Wiener process $(W_t)_{t \geq 0}$, define filtration $\mathscr{F}_t = \sigma(W_u : u \leq t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $(B_t)_{t \geq 0}$ where $B_t = W_t^3 - 3tW_t$. Show that $E[B_t|\mathscr{F}_s] = B_s$ whenever $s &amp;lt; t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think this all comes down to manipulation since there are martingales somewhere&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My attempt:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Splitting up into $E[W_t^3|\mathscr{F}_s] - 3E[tW_t|\mathscr{F}_s]$ doesn't do anything since those guys aren't martingales? So, I tried splitting it up into:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E[W_t(W_t^2 - 3t)|\mathscr{F}_s]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$= E[W_t(W_t^2 - t -2 t)|\mathscr{F}_s]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$= E[W_t(W_t^2 - t) -2 tW_t)|\mathscr{F}_s]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$= E[W_t(W_t^2 - t)|\mathscr{F}_s] -2E[ tW_t|\mathscr{F}_s]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$W_t$ is not $\mathscr{F}_s$-measurable, so we can't take that out...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$tW_{1/t}$ is Brownian and thus a martingale, but I don't know about $tW_t$...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$cW_{t/c^2}$ is Brownian and thus a martingale, but I don't think we can set c = t...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Help please?&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="26242" LastEditDate="2018-05-15T16:28:21.563" LastActivityDate="2018-05-15T16:28:21.563" Title="Show that $E[B_t|\mathscr{F}_s] = B_s$ for $B_t = W_t^3 - 3 t W_t$" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;&lt;wiener&gt;&lt;wienerprocess&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="14957" PostTypeId="2" ParentId="14956" CreationDate="2014-10-06T11:11:25.540" Score="1" Body="&lt;p&gt;You can use that $f(t,W_t)\in C^2$ is Martingale iff:$$\partial_t f+\frac{1}{2}\partial_{WW}f= 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We get:$$\partial_t f=-3W_t$$$$\partial_{WW}f=6W_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$-3W_t+3W_t= 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;q.e.d.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The proof of theorem follows by writing out $f(t,W_t)$ via Ito formula.&#xA;&lt;em&gt;Proof of theorem:&lt;/em&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/Jjek1.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-10-06T21:14:27.947" LastActivityDate="2014-10-06T21:14:27.947" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14960" PostTypeId="2" ParentId="14955" CreationDate="2014-10-06T15:28:29.633" Score="1" Body="&lt;p&gt;I think you are on the right track here. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You made a sign error in the first line, unfortunately:&#xA;$$E[W_p W_q W_r] = E[W_r W_p^2 + W_pW_q^2 - W_qW_p^2]=\\ E[(W_r-W_q)W_p^2]+E[W_pW_q^2]= E[W_pW_q^2] $$&#xA;The first term is $0$ by independence (as $p&amp;lt;\text{min}(r,q)$ and the square does not affect independence).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To take care of the second term we do the standard expansion trick:&#xA;$$E[W_pW_q^2] = E[W_p(W_q-W_p)^2]+2E[W_qW_p^2]-E[W_p^3]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, the first term is $0$ again, by independence. For the third term we use that the third central moment of a normal distibution is$ 0$.&#xA;The second term is also $0$, as a simple calculation shows:&#xA;$$ E[W_qW_p^2] = E[(W_q - W_p)W_p^2]+E[W_p^3] = 0$$&#xA;again, by independence of increments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it turns out that $$E[W_pW_qW_r]=0.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope I got everything right. I must admit, I expected a different result.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2014-10-06T15:28:29.633" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14961" PostTypeId="2" ParentId="14955" CreationDate="2014-10-06T18:46:24.693" Score="8" Body="&lt;p&gt;We know that $(\tilde{W}_t) := (-W_t)$ is also a Wiener process so &#xA;$$&#xA;  E[W_pW_qW_r] = E[\tilde{W}_p\tilde{W}_q\tilde{W}_r] = (-1)^3E[W_pW_qW_r] &#xA;$$&#xA;and that implies that $E[W_pW_qW_r] = 0$. &lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2014-10-06T18:46:24.693" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="14962" PostTypeId="2" ParentId="10844" CreationDate="2014-10-07T10:04:40.540" Score="2" Body="&lt;p&gt;I do not agree with nicolas. I think that spot volatility is represented by the front month expiry options while future volatility is represented by e.g. VIX and VSTOXX which are inherently based on a mix with options in further expiries. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please also see the interview in the The Trader Derivatives: &quot;...because they (Volatility futures like VIX) represent forward volatility while index or equity options are spot volatility&quot; &lt;a href=&quot;http://www.thetrade-derivatives-digital.com/thetradederivatives/issue_8_q3_2014#pg78&quot; rel=&quot;nofollow&quot;&gt;http://www.thetrade-derivatives-digital.com/thetradederivatives/issue_8_q3_2014#pg78&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12224" LastActivityDate="2014-10-07T10:04:40.540" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14963" PostTypeId="2" ParentId="10527" CreationDate="2014-10-07T12:57:25.577" Score="1" Body="&lt;p&gt;There is a new book about this new topic:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1137374659&quot; rel=&quot;nofollow&quot;&gt;http://www.amazon.com/Interest-Rate-Modelling-Multi-Curve-Framework/dp/1137374659&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The author is a leading developer in Opengamma. Opengamma does have support for multi-curve building.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2014-10-07T12:57:25.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14964" PostTypeId="1" CreationDate="2014-10-07T15:06:27.317" Score="2" ViewCount="148" Body="&lt;p&gt;I am reading a report which talks about seasonality. There is a chart showing the average returns for each month of the year. In the chart it appears the last 3 months of the year tend to be negative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then they say 'to check if this is due to the timing of various crises or bubbles we have fitted a generalized additive model (GAM) to the returns time series of each stock,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  Rij = Fi(t) + month(t) + Eit         &#xA;&#xA;  please note i, j &amp;amp; t (when not in brackets) are subscripts&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Fi(t) is an arbitrary but smooth function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The two charts show the same pattern.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have to be honest I have not come across GAM (or am unaware I have used it before). I do not understand the use of this GAM &amp;amp; how they have just picked some arbitrary function and this proves their point?&lt;/p&gt;&#xA;" OwnerUserId="7530" LastEditorUserId="7530" LastEditDate="2014-10-08T07:01:12.837" LastActivityDate="2014-10-08T07:01:12.837" Title="seasonality and generalized additive model" Tags="&lt;equities&gt;&lt;statistics&gt;&lt;portfolio-management&gt;&lt;quant-trading-strategies&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14967" PostTypeId="1" AcceptedAnswerId="14968" CreationDate="2014-10-07T17:43:36.083" Score="2" ViewCount="1043" Body="&lt;p&gt;Given a covariance matrix that was calculated from the returns of a number of risky assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to &quot;add&quot; a risk-free asset to the covariance matrix without calculating its covariance with all the other assets? I thought about simply adding a column and row filled with zeros that seems wrong as there should be some correlation between risky and riskless assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just wondering whether there are any shortcuts...&lt;/p&gt;&#xA;" OwnerUserId="12227" LastActivityDate="2014-10-07T18:04:39.027" Title="&quot;Adding&quot; risk-free asset to covariance matrix after the fact" Tags="&lt;covariance-matrix&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14968" PostTypeId="2" ParentId="14967" CreationDate="2014-10-07T18:04:39.027" Score="2" Body="&lt;p&gt;If you add a bunch of zeros, then your covariance matrix will be singular, which could lead to problems depending on what you're doing (anything that involves inverting a matrix will have problems). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have to have a covariance matrix that includes the risk-free rate, then you need to provide a variance for the risk-free rate (i.e. you're no longer strictly assuming it's risk-free) at a minimum. This is like assuming that you're investing in a short-term floating rate security (and you're implicitly making assumptions about the process of the rates). For instance, if you have a 6 month horizon, you could assume that there is no risk of default in any given month, but that the rate might re-set each month. You still aren't risking default, but you do have some interest rate risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are using a fixed term risk-free security, like a 1 month T-bill, and your fixed term matches your investment horizon, 1 month in this case, then it will have zero variance at the horizon. In this case, you probably shouldn't be using the risk-free rate in a covariance matrix. Separate out the decisions. This becomes a little bit trickier if you're trying to account for transactions (b/c you have to include both decisions in the optimization then).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have a longer horizon, then you can make assumptions about the dynamics of the risk-free rate, such as mean-reversion or its relationship to inflation.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2014-10-07T18:04:39.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14969" PostTypeId="2" ParentId="14956" CreationDate="2014-10-07T19:43:49.700" Score="7" Body="&lt;p&gt;The trick is to start with the highest power, rewrite it as something you know (a third order moment) and then work backwards on the remaining terms. By that I mean you can complete the cube as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E[W_t^3 - 3tW_t|\mathcal{F}_s] = E[(W_t-W_s)^3 - C -3tW_t|\mathcal{F}_s]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where you'll need to find $C$ such that the equality holds (i.e. $C=W_s^3 + 3W_s^2 W_t + ...$). Next, you can use that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ (W_t-W_s)$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;is normal w.r.t. $\mathcal{F}_s$ with mean zero ($E[(W_t-W_s) |\mathcal{F}_s] = 0$) and variance $E[(W_t-W_s)^2 |\mathcal{F}_s] = (t-s)$, so the third order moment is zero, i.e. $E[(W_t-W_s)^3|\mathcal{F}_s] = 0$. What we accomplished here is that we got rid of the highest order of $W_t$ in the expectation value (the cube term, $W_t^3$). The remaining terms are either independent, linear or quadratic in $W_t$. So we can apply the same trick to these terms, that is, &quot;completing the difference&quot;. I.e. if you encounter a term like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E[W_s W_t^2|\mathcal{F_s}]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then you again complete the square of $W_t$ such that you end up with an expression that involves the difference $W_t - W_s$. So find a $C'$ such that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E[W_s W_t^2|\mathcal{F_s}] = E[W_s (W_t - W_s)^2 - C'|\mathcal{F_s}]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;holds. You then recognise the variance of $W_t - W_s$ in the first term, and $C'$ will contain terms at most linear in $W_t$. You keep doing that for all the terms, and you should end up with the identity that you set out to prove.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been intentionally a bit vague, because its a good exercise to complete. But if things are not clear, then let me know.&lt;/p&gt;&#xA;" OwnerUserId="3371" LastEditorUserId="3371" LastEditDate="2014-10-09T19:43:15.597" LastActivityDate="2014-10-09T19:43:15.597" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="14970" PostTypeId="1" CreationDate="2014-10-08T01:24:25.617" Score="0" ViewCount="597" Body="&lt;p&gt;I have 19 currency pairs like USD.AUD, USD.CAD, etc. Also 82 cross currency pairs like AUD.CAD, EUR.AUD,EUR.CAD etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I look to their graphs, most look similar, so I want to reduce number of pair and choose a few that represents the whole group. I calculate returns and create time series. I applied PCA but I am not sure how to interpret the results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any guidance is appreciated, is PCA is the right tool or I should look for others like cluster analysis , factor analysis, etc... For example in 82 pairs  should I group them like EUR.* GBP.* ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is the output of my R program , how should I interpret it ? Can I eliminate KRW.USD USD.CNH USD.HKD as their loadings are not correlated to first let's say 10 components ?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; head(returns)&#xA;             AUD.USD      EUR.USD       GBP.USD      KRW.USD      NZD.USD&#xA;2013-06-24  0.0000000000  0.000000000  0.0000000000  0.000000000  0.000000000&#xA;2013-06-25  0.0011886753 -0.003149068 -0.0008264128  0.006944472 -0.003901280&#xA;....&#xA;&#xA;Importance of components:&#xA;                           Comp.1      Comp.2      Comp.3      Comp.4&#xA;Standard deviation     0.01292047 0.006641023 0.005763718 0.004634432&#xA;Proportion of Variance 0.44565430 0.117736544 0.088684302 0.057336913&#xA;Cumulative Proportion  0.44565430 0.563390849 0.652075151 0.709412064&#xA;                            Comp.5      Comp.6      Comp.7      Comp.8&#xA;Standard deviation     0.004188341 0.004066381 0.003522884 0.003427262&#xA;Proportion of Variance 0.046830128 0.044142561 0.033131261 0.031357105&#xA;Cumulative Proportion  0.756242192 0.800384752 0.833516014 0.864873118&#xA;                            Comp.9    Comp.10     Comp.11     Comp.12&#xA;Standard deviation     0.003154789 0.00295759 0.002855678 0.002798966&#xA;Proportion of Variance 0.026569419 0.02335164 0.021770068 0.020913976&#xA;Cumulative Proportion  0.891442537 0.91479418 0.936564247 0.957478223&#xA;                           Comp.13     Comp.14     Comp.15     Comp.16&#xA;Standard deviation     0.002608714 0.002233061 0.001436994 0.001043102&#xA;Proportion of Variance 0.018167468 0.013311980 0.005512535 0.002904659&#xA;Cumulative Proportion  0.975645691 0.988957670 0.994470205 0.997374864&#xA;                            Comp.17      Comp.18      Comp.19&#xA;Standard deviation     0.0009627563 1.915212e-04 1.406246e-04&#xA;Proportion of Variance 0.0024744240 9.792082e-05 5.279147e-05&#xA;Cumulative Proportion  0.9998492877 9.999472e-01 1.000000e+00&#xA;&amp;gt; V0$loading&#xA;&#xA;Loadings:&#xA;            Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Comp.6 Comp.7 Comp.8 Comp.9 Comp.10&#xA;AUD.USD  0.275  0.390 -0.378        -0.142        -0.402  0.514 -0.286&#xA;    EUR.USD  0.234 -0.238                      -0.109&#xA;GBP.USD  0.178                                           -0.370 -0.632  0.553&#xA;KRW.USD         0.111                0.126 -0.327 -0.593 -0.456  0.129 -0.450&#xA;NZD.USD  0.257  0.306 -0.515         0.139 -0.453  0.549 -0.142  0.117&#xA;USD.CAD  0.149  0.123 -0.175                0.189 -0.159         0.383  0.302&#xA;USD.CHF  0.256 -0.344        -0.150                      -0.141&#xA;USD.CNH&#xA;USD.CZK  0.288 -0.271               -0.155 -0.341         0.338  0.323  0.199&#xA;USD.DKK  0.234 -0.237                      -0.107&#xA;USD.HKD&#xA;USD.HUF  0.383         0.288 -0.243 -0.178                0.197        -0.236&#xA;USD.ILS  0.137         0.107               -0.209 -0.184 -0.201         0.205&#xA;USD.JPY  0.162 -0.281 -0.458 -0.408         0.524        -0.174        -0.147&#xA;USD.MXN  0.263  0.385  0.262  0.188 -0.579  0.272  0.203 -0.339&#xA;USD.NOK  0.324                0.607  0.329  0.289 -0.149         0.256  0.213&#xA;USD.RUB  0.224  0.382  0.404 -0.444  0.584  0.121&#xA;USD.SEK  0.325 -0.169         0.350  0.283         0.139        -0.381 -0.412&#xA;USD.SGD  0.145                      -0.102        -0.128&#xA;        Comp.11 Comp.12 Comp.13 Comp.14 Comp.15 Comp.16 Comp.17 Comp.18 Comp.19&#xA;AUD.USD                  0.194   0.149  -0.133&#xA;EUR.USD                  0.131   0.370                   0.458   0.699&#xA;GBP.USD          0.221  -0.186&#xA;KRW.USD -0.131   0.169  -0.120          -0.121&#xA;NZD.USD&#xA;USD.CAD  0.304  -0.219  -0.671   0.184&#xA;USD.CHF                  0.131   0.422           0.190  -0.721&#xA;USD.CNH                                  0.344  -0.905  -0.233&#xA;USD.CZK -0.510          -0.175  -0.368&#xA;USD.DKK                  0.130   0.369                   0.432  -0.715&#xA;USD.HKD                                                                  0.999&#xA;USD.HUF  0.562   0.442          -0.205  -0.106&#xA;USD.ILS  0.350  -0.602   0.385  -0.397&#xA;USD.JPY -0.131           0.114  -0.352                   0.123&#xA;USD.MXN -0.288                          -0.106&#xA;USD.NOK  0.102   0.325   0.275&#xA;USD.RUB -0.241&#xA;USD.SEK         -0.408  -0.362  -0.133&#xA;USD.SGD                                  0.899   0.338&#xA;&#xA;               Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Comp.6 Comp.7 Comp.8 Comp.9&#xA;SS loadings     1.000  1.000  1.000  1.000  1.000  1.000  1.000  1.000  1.000&#xA;Proportion Var  0.053  0.053  0.053  0.053  0.053  0.053  0.053  0.053  0.053&#xA;Cumulative Var  0.053  0.105  0.158  0.211  0.263  0.316  0.368  0.421  0.474&#xA;               Comp.10 Comp.11 Comp.12 Comp.13 Comp.14 Comp.15 Comp.16 Comp.17&#xA;SS loadings      1.000   1.000   1.000   1.000   1.000   1.000   1.000   1.000&#xA;Proportion Var   0.053   0.053   0.053   0.053   0.053   0.053   0.053   0.053&#xA;Cumulative Var   0.526   0.579   0.632   0.684   0.737   0.789   0.842   0.895&#xA;               Comp.18 Comp.19&#xA;SS loadings      1.000   1.000&#xA;Proportion Var   0.053   0.053&#xA;Cumulative Var   0.947   1.000&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12228" LastEditorUserId="848" LastEditDate="2014-10-08T05:44:18.187" LastActivityDate="2014-10-08T05:44:18.187" Title="How to reduce fx currency pairs ? PCA or other tools?" Tags="&lt;fx&gt;&lt;pca&gt;&lt;currency&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14971" PostTypeId="2" ParentId="7876" CreationDate="2014-10-08T05:19:44.770" Score="1" Body="&lt;p&gt;Unlevered Beta (Beta asset) = Levered Beta / 1+(1-tax) Debt/Equity&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly , Levered Beta (Beta equity) = Unlevered Beta * 1+ (1-tax) Debt /Equity&lt;/p&gt;&#xA;" OwnerUserId="12229" LastActivityDate="2014-10-08T05:19:44.770" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14972" PostTypeId="1" CreationDate="2014-10-08T05:29:07.800" Score="7" ViewCount="3809" Body="&lt;p&gt;If I've been looking at graphs correctly, there is a strong positive correlation between stock prices (or P/B values) and interest rates over time, i.e. P/B values tend to be high when interest rates are high.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is this? Does this not contradict the following two cornerstones:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Asset prices are formed by discounting future cash flows. When interest rates are high, the discount factor is high, and thus the price should be lower.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) When interest rates are low, people tend to invest more in stocks, driving their price up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess there's something wrong with my thinking here? If you can, please refer to relevant studies in this area. &lt;/p&gt;&#xA;" OwnerUserId="12230" LastActivityDate="2014-11-13T06:06:15.630" Title="Why are interest rates and stock prices positively correlated?" Tags="&lt;equities&gt;&lt;interest-rates&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14974" PostTypeId="2" ParentId="14972" CreationDate="2014-10-08T10:51:08.100" Score="1" Body="&lt;p&gt;This is a good question. There are various views to this. I will share some thoughts:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Higher interest rates mean lower bond prices for bonds already emmitted. Investors switchting between bonds and stocks could sell bonds and buy stocks in times of rising yields (fearing that his developement will last) which increases demand for stocks&lt;/li&gt;&#xA;&lt;li&gt;Why do interest rates increase? If the increase is related to an increase in expected inflation then investors could seek inflation protection. It is arguable but stocks can be seen as real assets meaning that their prices tend to rise with inflation. Another reason why stocks could be attractive.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Some thoughts about your points:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ad 1): the discounting model for stock prices is just a model. It certainly does not hold true at all times for all markets. I would not use it - however, some do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ad 2): When interest rates are low in order to provider liquity then this is true and this could be an explanation of the stock bull market that we have seen. Furthermore if yields on governent bonds are low: what is there to be gained? If interest rates can only have one direction to go (if this scenario is by far the most likely) then a bonds position is likely to lose. Stocks and credits are more attractive. We have seen this in the recent past.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-10-08T10:51:08.100" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14975" PostTypeId="1" CreationDate="2014-10-08T12:53:52.730" Score="1" ViewCount="1971" Body="&lt;p&gt;What kind of technology are people using these days for decoding FAST? Can FPGA be used in that area?&lt;/p&gt;&#xA;" OwnerUserId="12234" LastActivityDate="2015-04-17T14:19:22.237" Title="What is the fastest way to decode the FAST protocol for market data?" Tags="&lt;fix&gt;&lt;fpga&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14976" PostTypeId="1" CreationDate="2014-10-08T14:36:49.440" Score="2" ViewCount="123" Body="&lt;p&gt;how are we supposed to price an European option given the fact that the daily return of the underlying is limited within -X% to X%?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if X = 5, the price of the underlying cannot go up 8% on any given day.&lt;/p&gt;&#xA;" OwnerUserId="12088" LastActivityDate="2015-02-06T09:34:43.500" Title="option pricing with limitation on the change of underlying daily changes" Tags="&lt;option-pricing&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14977" PostTypeId="2" ParentId="14975" CreationDate="2014-10-08T18:08:57.043" Score="1" Body="&lt;p&gt;These guys (&lt;a href=&quot;http://www.ociweb.com/products/quickfast&quot; rel=&quot;nofollow&quot;&gt;OCIWEB&lt;/a&gt;) are the experts in the FAST world. They may have a definite answer for you (given your specifications: platforms, environments, requirements, compatibility with your trading systems, etc.)&lt;/p&gt;&#xA;" OwnerUserId="2909" LastActivityDate="2014-10-08T18:08:57.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14978" PostTypeId="2" ParentId="14975" CreationDate="2014-10-08T22:26:00.733" Score="0" Body="&lt;p&gt;We have developed a very fast FAST decoder in Java (&lt;a href=&quot;http://www.coralblocks.com/index.php/category/coralfix/&quot; rel=&quot;nofollow&quot;&gt;CoralFIX&lt;/a&gt;) that reads the XML templates from the exchanges and spills out Java code to parse the FAST bits. That way you do not need to use recursion to parse repeating groups, which kills performance. It also produces zero garbage and delivers a lightweight and ready-to-use &lt;code&gt;FixMessage&lt;/code&gt; with a super-intuitive API. A complete example can be seen in &lt;a href=&quot;http://www.coralblocks.com/index.php/2014/10/fast-support-with-coralfix/&quot; rel=&quot;nofollow&quot;&gt;this article&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have never seen anyone using FPGA successfully to decode FAST and I would also be interested in hearing about any success cases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt; I am one of the developers of CoralFIX.&lt;/p&gt;&#xA;" OwnerUserId="11804" LastEditorUserId="11804" LastEditDate="2015-04-17T14:19:22.237" LastActivityDate="2015-04-17T14:19:22.237" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14979" PostTypeId="1" CreationDate="2014-10-09T03:29:42.773" Score="4" ViewCount="349" Body="&lt;p&gt;I have a year long stock data sampled at 5 min frequency and would like to estimate monthly volatility using it. I am thinking using GARCH or TGARCH for volatility estimation. However, I am not sure if at frequency I should estimating volatility. After that should I scale volatility by square root of appropriate period?&lt;/p&gt;&#xA;" OwnerUserId="11969" LastActivityDate="2014-10-09T07:07:17.860" Title="Volatility estimation: sampling frequency and scaling" Tags="&lt;high-frequency&gt;&lt;garch&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14980" PostTypeId="1" CreationDate="2014-10-09T04:41:52.343" Score="2" ViewCount="88" Body="&lt;p&gt;this should not be here because it shouldn't be here forever and eve&lt;/p&gt;&#xA;" OwnerUserId="12236" LastEditorUserId="12236" LastEditDate="2014-10-09T17:39:29.180" LastActivityDate="2014-10-09T17:39:29.180" Title="Bond Interest Rate Swap Growth Rate" Tags="&lt;bond&gt;&lt;forward&gt;&lt;forward-rate&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2014-10-10T12:37:29.510" ContentLicense="CC BY-SA 3.0" />
  <row Id="14981" PostTypeId="2" ParentId="14979" CreationDate="2014-10-09T07:07:17.860" Score="-1" Body="&lt;p&gt;You can try out a range of frequencies and then pick the one with the lowest fitting error (e.g. Root Mean Squared Error).&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-10-09T07:07:17.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14982" PostTypeId="2" ParentId="14976" CreationDate="2014-10-09T07:21:12.860" Score="1" Body="&lt;p&gt;As Black Scholes model, you can assume a two-sided &lt;a href=&quot;http://en.wikipedia.org/wiki/Truncated_normal_distribution#Definition&quot; rel=&quot;nofollow&quot;&gt;Truncated Normal Distribution&lt;/a&gt; as riskneutral density $f(x)$ (with $\mu=0,\sigma=T-t$) for the returns and then price the option payoff $H$ as usual by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V_t^H=e^{-r(T-t)}E(H_T|F_t)=e^{-r(T-t)}\int_{-X}^{X}H(S_te^{r(T-t)+\sigma W_{T-t}})f(W_{T-t})dW_{T-t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The integral must likely be calculated numerically. The $\sigma$ parameter must be calibrated from market prices.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-10-09T07:36:43.727" LastActivityDate="2014-10-09T07:36:43.727" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14983" PostTypeId="2" ParentId="14980" CreationDate="2014-10-09T10:05:52.467" Score="2" Body="&lt;h1&gt;The FRA&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;A FRA is an agreement to exchange cash flows; the FRA in question is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Start 15/9/14&#xA;End   15/5/15&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is 242 days. USD Money Market quoting is Actual/360, so the accrual factor here is 242/360 = 0.6722.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The FRA cashflows, therefore, are: on 15/9/14, Fix pays $\$1m * (0.6722 * 0.05) = \$33,611.11$, and Float pays $\$1m * (0.6722 * L)$, where L is the 9m Libor which fixed 2 days before, on 13/9/14. As it goes, this is the table of Libors from ICE (the new Libor administrators) for USD on 13/9/14:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Overnight 0.09030&#xA;1 Week    0.12050&#xA;1 Month   0.15500&#xA;2 Month   0.19550&#xA;3 Month   0.23360&#xA;6 Month   0.33090&#xA;1 Year    0.55530&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, you may note there is no 8m. So you would have to look into the contract to determine how the fixing should be calculated in this circumstance. Suppose we do a common thing and interpolate between 6m and 1y. 6m is 15/9/14 to 16/3/15 (182d), and 1y is 17/9/15 (367d). So our value for 242 days linearly interpolated is 0.40368%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This gives a Float cash flow of $\$1m * 0.6722 * 0.0040368 = \$2,713.63$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value of the FRA, on 13/9/14, paying fixed ('borrow ... 5%') and receiving float, is $\$-30,897.48$. What you haven't said is &lt;em&gt;when&lt;/em&gt; you are valuing the FRA, but if we guess you mean to value it 1m before the fixing on 15/9/14, then the value would have been roughly -$31k depending on the market value of an 8m FRA at that time.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Some misunderstandings&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I suspect you have misunderstood the concept of a FRA; FRAs are not for borrowing, they are for hedging or creating exposure to a fixing risk. They are a Par instrument; that is, you don't enter a FRA and immediately pay or receive money - you enter the FRA believing the Fix rate to be at or near the fair expected rate on the fixing for that period. Back in textbook days you would use them to hedge against rates movement, and borrow cash when the day came.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To that end, the FRA also pays out the difference between the fixing and the FRA rate at the &lt;em&gt;start&lt;/em&gt; of the FRA period, not at the end. So not only are you not borrowing money, the cashflows have all finished on the start date of the FRA.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, FRAs fix on a fixing (Libor for USD), and that fixing no longer represents the true cost of funding. Libor is a mutually agreed number supposed to represent the rate at which a bank could borrow cash, &lt;em&gt;unsecured&lt;/em&gt;, in the interbank market. But the market no longer permits significant unsecured borrowing, and the cost of funding varies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus your 5% FRA, which has been out of the money since it was traded, will have been secured, probably in cash, accrued at the FedFund overnight rate, and will therefore have represented a loan &lt;em&gt;TO&lt;/em&gt; the counterparty followed by a 'payment' which involved letting them keep the balance of some \$31k. If you had 'sold' the FRA to the counterparty for a similar amount, they would have paid you \$30k or so, and then immediately demanded that amount was put into your margin account with them as collateral.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;But the textbook...&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;The pre-crisis textbook theory would be that if Libor represents the cost of funding, and you use the ZCBs at 1m, 3m and 6m and bond at 1y to bootstrap a discount factor curve using the 6m ZCB to discount the initial payment from the 1y bond, you could do $f_{9m}/f_{1m}$ and convert that factor into a rate. The difference between that rate and the FRA rate would determine the value of the position. &lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Really hedge it?&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Remember the 8m rate was interpolated from 6m and 1y Libors. So the best way to hedge it (and to determine the value) would have been a combination of a 6m FRA and a 1y FRA, and a cash deposit. Good luck finding 12m Libor instruments to bootstrap a 12m curve from, but you will find 6m FRAs and IRS basis for the 6m curve. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where are the bonds? Well, you can do something with a spread over the Treasuries to create a 3m Libor curve, and then apply some basis values to get to 6m, but you'll also need a funding curve. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But we're not in Kansas any more, Dorothy.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Ye Olde Bootestrappings&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;If you want the textbook answer, here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume 15/9/14 Spot. Thus &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Date   Factor&#xA;Spot   1.0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;ZCBs give&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1m     0.996672&#xA;3m     0.989555&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;1y Quarterlies: Payment schedules:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;      4%    16%&#xA;3m     10    40&#xA;6m     10    40&#xA;9m     10    40&#xA;1y   1010  1040&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So we know that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$10(a + b + c + d) + 1000d = 993.938, \;\;\text{(4%)} \\ &#xA;  40(a + b + c + d) + 1000d = 1110.628 \;\;\text{(16%)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solve for $d$ first:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$4.(993.938 - 1000d) = (1110.628 - 1000d) \\&#xA;  3000d = 4 \times 993.938 - 1110.628 \\&#xA;  d = 0.9550413$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1y 10% Semi at 1.051706, contains cashflows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;6m       50&#xA;1y     1050&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$50b + 1050d = 1051.706$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sub in $d=0.9550413$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$b = 0.9782527$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remember the 4% gave us:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$10(a + b + c + d) + 1000d = 993.938$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sub in $a=0.989555$, $b = 0.9782527$, $d = 0.9550413$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$c = 0.966821$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At last, a dfc:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Spot 1.0&#xA;1m   0.996672&#xA;3m   0.989555&#xA;6m   0.9782527&#xA;9m   0.966821&#xA;1y   0.9550413&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, we want 1m to 9m, so the factor for the period is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$f_{1,9} = f_9/f_1 = 0.966821/0.996672 = 0.9700493$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Converting to an Actual/360 rate:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r = (f^{-1} - 1) * 365/242 \\&#xA;    r = 4.657\%$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like that, anyway.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastEditorUserId="1314" LastEditDate="2014-10-09T14:23:25.243" LastActivityDate="2014-10-09T14:23:25.243" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="14985" PostTypeId="1" AcceptedAnswerId="14997" CreationDate="2014-10-09T13:04:49.413" Score="2" ViewCount="1314" Body="&lt;p&gt;I read that CVaR (Conditional Value-at-Risk, also Expected Shortfall), satisfies coherence, but not Elicitability.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, VaR satisfies Elicitability, but not coherence.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is Elicitability?&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-10-10T22:24:56.343" Title="Elicitability of risk measures" Tags="&lt;var&gt;&lt;coherent-risk-measure&gt;&lt;cvar&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14986" PostTypeId="1" AcceptedAnswerId="15070" CreationDate="2014-10-09T15:55:08.717" Score="1" ViewCount="173" Body="&lt;p&gt;Suppose you are only talking about a single currency pair, say EUR/USD. Throughout some period of time, you engage in trades with various other parties, sometimes buying, sometimes selling. The rates will be different for each trade, as the rates change in response to market conditions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example sequence of trades might look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Time | Amount |   Rate |&#xA;  t1      100   1.2636&#xA;  t2    -1000   1.2599&#xA;  t3      200   1.1612&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Later on, for a given current rate (say the market midpoint), you could transform all of these previous trades into a profit or loss as implied by that current rate. And you could summarize the whole sequence of trades with a &quot;PnL&quot; number by summing across the profit implied by each trade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what is usually meant by &quot;position&quot; after a sequence of such trades?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does that term just refer to the running sum of the Amount column in my example (so just the pure number of units of the currency pair you've net bought/sold)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason this puzzles me is that the position would lose information about what rate each amount was originally traded for. So, while the sum of the amounts would tell you your current total amount held (net long or net short), you wouldn't be able to work out profit from just snapshot of this total plus a snapshot of the rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, this number could be useful for other purposes, like comparing how much relative exposure you have to one currency pair compared with another, outside of the running profit/loss of the trades that got you there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this the correct way to think of &quot;position&quot; (e.g. it's just the running total amount you have net bought/sold, even if that summary number is useless in obtaining the profit at a point in time)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or is there something else that's customary for keeping track of position that also combines it with the rate at each trade?&lt;/p&gt;&#xA;" OwnerUserId="2215" LastEditorUserId="2215" LastEditDate="2014-10-09T16:29:32.080" LastActivityDate="2014-10-17T14:17:54.330" Title="What is meant by &quot;position at a given time&quot; in the context of a series of forex trades?" Tags="&lt;trading&gt;&lt;fx&gt;&lt;currency&gt;&lt;position-sizing&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14987" PostTypeId="1" CreationDate="2014-10-09T17:00:22.907" Score="2" ViewCount="3387" Body="&lt;p&gt;I would like to calculate implied forward volatility skew. I have stochastic volatility monte carlo. What kind of payoff do I need to price and how to use Black() formula to calculate the implied volatility.&lt;/p&gt;&#xA;" OwnerUserId="12243" LastActivityDate="2014-12-02T20:14:09.257" Title="forward implied volatility skew" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;implied-volatility&gt;&lt;implied&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14988" PostTypeId="1" CreationDate="2014-10-09T20:06:21.040" Score="0" ViewCount="98" Body="&lt;p&gt;Given that I have fundamental data such as GDP growth rate for G10 countries .Now I want to build a currency pairs portfolio of G10 currencies  vs USD .How can I translate country scores to currency pair allocations ?&lt;/p&gt;&#xA;" OwnerUserId="12244" LastActivityDate="2014-12-14T14:40:00.383" Title="Currency Portfolio G10 vs USD allocation" Tags="&lt;portfolio&gt;&lt;currency&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14989" PostTypeId="2" ParentId="14956" CreationDate="2014-10-09T20:23:07.900" Score="3" Body="&lt;p&gt;\begin{align*}&#xA;E\Big(W_t^3-3tW_t \mid \mathcal{F}_s\Big) &amp;amp;= E\Big((W_t-W_s+W_s)^3-3t(W_t-W_s+W_s) \mid \mathcal{F}_s\Big) \\&#xA;&amp;amp;=E\Big((W_t-W_s)^3+W_s^3+3(W_t-W_s)^2W_s + 3 (W_t-W_s)W_s^2\\&#xA;&amp;amp;\qquad \qquad -3t(W_t-W_s)-3tW_s  \mid \mathcal{F}_s\Big) \\&#xA;&amp;amp;=E\Big((W_t-W_s)^3\Big) + W_s^3+3W_sE\Big((W_t-W_s)^2\Big)\\&#xA;&amp;amp;\qquad \qquad + 3W_s^2 E(W_t-W_s)-3tE(W_t-W_s)-3tW_s\\&#xA;&amp;amp;=W_s^3+3W_s (t-s)-3tW_s\\&#xA;&amp;amp;=W_s^3 -3sW_s,&#xA;\end{align*}&#xA;by noting that&#xA;\begin{align*}&#xA;E\Big((W_t-W_s)^3\Big) = E(W_t-W_s) =0,&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;E\Big((W_t-W_s)^2\Big) = t-s.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2014-10-09T20:45:40.017" LastActivityDate="2014-10-09T20:45:40.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14990" PostTypeId="2" ParentId="14955" CreationDate="2014-10-09T20:37:45.993" Score="1" Body="&lt;p&gt;Note that $\{W_t \mid t \geq 0\}$ is a martingale. Then, for $0&amp;lt;p&amp;lt;q&amp;lt;r$,&#xA;\begin{align*}&#xA;E(W_pW_qW_r) &amp;amp;= E\Big( E(W_pW_qW_r \mid \mathcal{F}_q)\Big)\\&#xA;&amp;amp;=E\Big(W_pW_q E(W_r \mid \mathcal{F}_q)\Big)\\&#xA;&amp;amp;=E\Big(W_pW_q^2\Big)\\&#xA;&amp;amp;=E\Big(W_p(W_q-W_p+W_p)^2\Big)\\&#xA;&amp;amp;=E\Big(W_p(W_q-W_p)^2+W_p^3+2W_p^2(W_q-W_p) \Big)\\&#xA;&amp;amp;=E(W_p)E\Big((W_q-W_p)^2\Big)+E(W_p^3)+2E\big(W_p^2\big)E(W_q-W_p)\\&#xA;&amp;amp;=0,&#xA;\end{align*}&#xA;by noting that&#xA;\begin{align*}&#xA;E(W_p) = E(W_p^3) = E(W_q-W_p) = 0.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2014-10-09T20:37:45.993" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14991" PostTypeId="2" ParentId="14986" CreationDate="2014-10-09T21:20:10.117" Score="0" Body="&lt;p&gt;You aren't including how much of your base currency you have in your portfolio.  Once you do that your position can be written as $X$ USD and $Y$ EUR.  Beyond doing much of the work for your P&amp;amp;L computation, this is also useful for monitoring your risk to FX changes.&lt;/p&gt;&#xA;" OwnerUserId="12050" LastActivityDate="2014-10-09T21:20:10.117" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14992" PostTypeId="1" CreationDate="2014-10-10T00:26:12.947" Score="3" ViewCount="1309" Body="&lt;p&gt;You are considering an investment in the stock. In the stock market, there are two risky stocks (A and B) and a risk free claim, C (you can think of it as the t-bill). The covariances and returns of these three stocks are described in the following table:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/5l1j1.png&quot; alt=&quot;covmatrix&quot;&gt;&#xA;Assume that you have a mean-variance utility function with risk aversion A=5. That is, your utility function is&#xA;&lt;img src=&quot;https://i.stack.imgur.com/xyyy7.png&quot; alt=&quot;utilfunction&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let P be the risky portfolio that consists of stocks A and B. Let Wpa be the weight of stock A in portfolio P and let Wpb = 1-Wpa be the weight of stock B in the portfolio P. Write down the Sharpe ratio of portfolio P as a function of Wpa... &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I am having trouble with how to set this equation up to start, any guidance would be helpful to start this off&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="12246" LastActivityDate="2015-09-06T20:07:03.297" Title="Set up sharpe ratio with 2 risky portfolio" Tags="&lt;portfolio&gt;&lt;sharpe&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="14994" PostTypeId="1" CreationDate="2014-10-10T05:21:33.433" Score="4" ViewCount="6332" Body="&lt;p&gt;It is claimed that the credit default swap (CDS) spread should approximate the risky par bond yield or coupon rate spread from the riskless bond on the same entity. This comes about when we assume discount factor $B(t)=e^{-rt}$ with constant riskless interest rate $r$ together with infinitesimal coupon period. However, this is not true in general and it is dubious under what condition this holds even approximately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us examine this claim mathematically. In general, for par bond coupon rate $c$ and CDS spread $s$&#xA;$$c-s=\frac{\int_0^T P(t)\mathrm d(-B(t))}{\sum_{i=1}^n \delta_iB_iP_i} \ge 0,$$&#xA;where $P(t)$ is the survival probability and $B(t)$ the discount factor at time $t$, $t_i$ is the $i$'th coupon date and $P_i=P(t_i)$ and $B_i=B(t_i)$. It is true $B(t)\searrow 0 \Longrightarrow c-s\searrow 0$, for any given $P$. However, once can device decreasing $P$ and $B$ such that $c-s$ is unbounded from above in the set of admissible $P$ and $B$ (decreasing positive function on $[0,\infty)$ taking value $1$ at $t=0$) for any given $\{\delta_i&amp;gt;0\}_{i=1}^n$. Consider very small $P_i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The riskless par bond coupon rate of the same coupon schedule is&#xA;$$c_0=\frac{\int_0^T \mathrm d(-B(t))}{\sum_{i=1}^n \delta_iB_i}.$$&#xA;So&#xA;$$c-s-c_0=\frac{\int_0^T P(t)\mathrm d(-B(t))}{\sum_{i=1}^n \delta_iB_iP_i}-\frac{\int_0^T \mathrm d(-B(t))}{\sum_{i=1}^n \delta_iB_i}$$&#xA;We already know from the previous paragraph that the above expression is unbounded from above. To explore the range of the above expression, consider the following case.&#xA;$$&#xA;P(t) = &#xA;\begin{cases}&#xA;1, &amp;amp; t=0 \\&#xA;P_1, &amp;amp; t\in (0,t_1] \\&#xA;0,  &amp;amp; t\in (0,\infty)&#xA;\end{cases},&#xA;\quad&#xA;B(t) =  &#xA;\begin{cases}&#xA;1, &amp;amp; t=0 \\&#xA;B_1, &amp;amp; t\in (0,t_1] \\&#xA;0,  &amp;amp; t\in (0,\infty)&#xA;\end{cases}.&#xA;$$&#xA;then&#xA;$$c-s-c_0 = \frac{1}{\delta_1B_1}-1-\frac{1}{\delta_1B_1}=-1.$$&#xA;So $c-s-c_0$ ranges at least from $-1$ to positive infinity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, all we can say is that in the very low interest rate regime like recently, $c$ is not much higher than $s$. Then what additional conditions are imposed or specific models are assumed to justify the folklore statement that $c-s\approx c_0$? Can someone provide a mathematical derivation or supply some references to that effect? Many authors have cited Darrell Duffie's &lt;a href=&quot;http://web.stanford.edu/~duffie/dswap.pdf&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; as the source of the claim. However, I do not see a mathematical derivation or justification there --- the aforementioned link is a draft version not the published one and perhaps therein lies the rub.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the papers making such claim is &lt;a href=&quot;http://www-2.rotman.utoronto.ca/~hull/downloadablepublications/hpwpaperoncdsspreads.pdf&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt;. There Assumption 4. is the most pertinent, acknowledging the assumption of constant interest rate, presumably implying $B(t)=e^{-rt}$ with $r$ a positive constant, just as I have stated in the first paragraph. How good an approximation is this? &lt;a href=&quot;http://www.cfr-cologne.de/download/workingpaper/cfr-09-12.pdf&quot; rel=&quot;nofollow&quot;&gt;This&lt;/a&gt; and &lt;a href=&quot;http://www.ecb.europa.eu/pub/pdf/scpwps/ecbwp1085.pdf&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; are two other papers amongst many making the claim. None of these authours are &quot;dubious&quot; folks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone elucidate?&lt;/p&gt;&#xA;" OwnerUserId="6686" LastEditorUserId="6686" LastEditDate="2014-10-13T05:44:15.540" LastActivityDate="2014-11-15T18:18:32.360" Title="CDS Spread and Par Bond Yield Spread" Tags="&lt;cds&gt;&lt;bond-yields&gt;&lt;default-probability&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14995" PostTypeId="2" ParentId="14986" CreationDate="2014-10-10T09:15:28.190" Score="0" Body="&lt;p&gt;Position means inventory. See &lt;a href=&quot;https://quant.stackexchange.com/questions/8985/survey-of-market-making-strategies-and-research?lq=1&quot;&gt;Survey of market making strategies and research&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you're puzzling about is what would be the value of your inventory in some risk (PnL) currency other than the currency you actually have. That's why you'd have rates from one currency to another. But the current value of your inventory expressed in terms of some other currency is not what matters. If EUR is going down, you sell all the EUR you have, and probably go short. It doesn't matter where your inventory came from, or how much it cost, you have to manage your current inventory according to the market conditions.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2014-10-10T09:15:28.190" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="14996" PostTypeId="2" ParentId="14672" CreationDate="2014-10-10T21:38:48.700" Score="1" Body="&lt;p&gt;That is true. Utility would not be concave anymore under prospect theory (only for gains), but convex for losses, which is evidence against CAPM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CAPM is valid either :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-if the utility function is quadratic (which is nonsense in terms of economic interpretation, and in general, Von Neumann- Morgenstern utility describes poorly reality and should be rejected as a descriptive Theory)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-if the distribution of the returns is elliptic, that is a general class that includes the normal distribution (which is nonsense also because there is skewness in real life).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, CAPM is never verified, and fails miserably empirically.&#xA;But even Prospect Theory cannot fix the problem at an equilibrium/aggregate level, since it doesn't solve the Pricing Kernel Puzzle. That is because Prospect Theory doesn't aim to solve this problem, but rather describes individual behavior in certain circumstances (simple lotteries).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to really describe what happens, the utility has to alternate concavity and convexity, both in the domain of gains and losses (double alternation, with a more pronounced concavity for losses and convexity for gains, the exact opposite of Prospect Theory), while being globally concave and keeping the framing effect which is still very important.&lt;img src=&quot;https://i.stack.imgur.com/T7xlC.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, we can derive what I call Real Utility functions (that does not depend of preferences nor risk aversion but rather imply both of them), that arises from overconfidence, underestimation of extrema and non bayesian learning. But the approximation of real utility functions is what is called the CAPM^2 (for continuous asymetric polynomial models).That was my master thesis actually,so I know it well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to integrate that utility into a Beta model requires 3 pages of calculus, but it is doable and has been done. The beauty is that it works smoothly and beats off Fama&#xA;French factors plus momentum. &lt;/p&gt;&#xA;" OwnerUserId="12252" LastEditorUserId="12252" LastEditDate="2014-10-10T22:15:17.343" LastActivityDate="2014-10-10T22:15:17.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14997" PostTypeId="2" ParentId="14985" CreationDate="2014-10-10T22:24:56.343" Score="1" Body="&lt;p&gt;From Ziegel (2013) : The risk of a financial position is usually summarized by a risk measure. As this risk measure has to be estimated from historical data, it is important to be able to verify and compare competing estimation procedures. In statistical decision theory, risk measures for which such verification and comparison is possible, are called elicitable. It is known that quantile based risk measures such as value at risk are elicitable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Better use CoVaR in fact (Value at risk conditional to other value at risk, as a conditional co-movement of another institution's distress)&lt;/p&gt;&#xA;" OwnerUserId="12252" LastActivityDate="2014-10-10T22:24:56.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="14998" PostTypeId="1" AcceptedAnswerId="15050" CreationDate="2014-10-11T01:07:00.297" Score="2" ViewCount="919" Body="&lt;p&gt;I intend to calculate the daily return on my investment in forex.&#xA;Assume a trader invests $\$$40 at a leverage of 100:1, so in total he is trading $\$$4000 worth of currency, and assume the position is open from Dec 4 to Dec 6. Also the trader has enough money to cover potential drawdowns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to calculate the daily returns I would first need to virtually close and re-open the position using market prices (not shown here) and &quot;realise&quot; the daily profits/losses. Since in forex accounts a position can have a negative profit (as long as you have enough money in the account to cover the cost), this poses a problem when the trade balance is really close to zero and when the trader realises a big gain or loss the next day. To illustrate, I present a real life example below.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Date     PnL       BeginBalance   EndBalance    Return&#xA;Dec4     -30       40             10            -75%&#xA;Dec5     -10.01    10             -0.01         -100.1%&#xA;Dec6     -9        -0.01          -9.01         900,000% &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;PnL&lt;/code&gt; is the daily profit or loss calculated using market data (i.e. its the unrealised PnL the trader would see at the end of a trading day), &lt;code&gt;BeginBalance&lt;/code&gt; is initially set at 40 which is the amount initially invested, &lt;code&gt;EndBalance&lt;/code&gt; is &lt;code&gt;BeginBalance&lt;/code&gt; + &lt;code&gt;PnL&lt;/code&gt;, and &lt;code&gt;Return&lt;/code&gt; is &lt;code&gt;PnL&lt;/code&gt;/&lt;code&gt;BeginBalance&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice how on Dec 6, the return is 900,000%. While it is an arithmetically correct calculation, this greatly skews my data and is wrong because the balance has dropped from -0.01 to -9.01 which is not a positive return. What can I do to overcome this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="5190" LastEditorUserId="5190" LastEditDate="2014-10-11T12:08:46.337" LastActivityDate="2014-10-15T10:21:42.603" Title="Problem when calculating the daily return on a forex trade, what is the best way to do such a calculation?" Tags="&lt;trading&gt;&lt;returns&gt;&lt;numerical-methods&gt;&lt;trading-systems&gt;&lt;asset-returns&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="14999" PostTypeId="1" AcceptedAnswerId="15008" CreationDate="2014-10-11T02:32:47.750" Score="4" ViewCount="6294" Body="&lt;p&gt;I am wondering where I can pull daily (hourly, by-the-minute, etc. even better) option data for a particular underlying. I would prefer a database I could scrape through and API, but would not mind clicking multiple download links as well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, the ideal data would be all options (calls and puts) trading for the specified underlying, their strikes, expiries, volume of each for the day, OI for the day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, I'd like the output of getOptionChain() with the added parameters from and to as in getSymbols().&lt;/p&gt;&#xA;" OwnerUserId="12254" LastActivityDate="2015-12-22T12:45:04.347" Title="Daily option data" Tags="&lt;options&gt;&lt;r&gt;&lt;historical-data&gt;&lt;quantmod&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15000" PostTypeId="2" ParentId="14999" CreationDate="2014-10-11T04:18:22.637" Score="1" Body="&lt;p&gt;I do not know any free sources. One of the cheapest commercial is &lt;a href=&quot;http://eoddata.com/products/default.aspx&quot; rel=&quot;nofollow&quot;&gt;http://eoddata.com/products/default.aspx&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7973" LastActivityDate="2014-10-11T04:18:22.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15001" PostTypeId="1" CreationDate="2014-10-11T04:24:52.323" Score="8" ViewCount="1731" Body="&lt;p&gt;I was reading about the MPT (Use standard deviation as risk measure) on &quot;Mathematics for Finance by Marek Capinski&quot;. I was just wondering is there anyone actually applying this theory to their portfolio?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And if there's someone who using this theory. Why would they? Why don't they use another coherent risk measure?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS. I'm math/stat major who is interested in finance. &lt;/p&gt;&#xA;" OwnerUserId="6548" LastEditorUserId="2587" LastEditDate="2014-10-13T20:13:44.340" LastActivityDate="2014-10-13T20:13:44.340" Title="Is there anyone still using Markowitz modern portfolio theory?" Tags="&lt;risk&gt;&lt;portfolio-management&gt;&lt;risk-management&gt;&lt;modern-portfolio-theory&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15002" PostTypeId="2" ParentId="15001" CreationDate="2014-10-11T06:17:56.260" Score="3" Body="&lt;p&gt;MPT should be called Medieval Portfolio Theory, it is a theory from 50 years ago with huge theoretical flaws (mean-variance utility, use of Pearson's correlation that is not coherent, based on historical data). Come on, it is an error maximizer. The least one could do is Michoud resampling, but it is patented. Or a bayesian Black-Litterman would be more appropriate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So to answer the question: no, anyone reasonable in the world of asset management won't use MPT. Of course one should care about higher moment, asymmetries, using conditional measures and robust/coherent risk measures. It complicates hugely the formulas though, where a closed form formula or &quot;beautiful solution&quot; may not exist, and we should rely on quantitative modelisation that works.&lt;/p&gt;&#xA;" OwnerUserId="12252" LastActivityDate="2014-10-11T06:17:56.260" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15003" PostTypeId="2" ParentId="14987" CreationDate="2014-10-11T06:34:40.203" Score="0" Body="&lt;p&gt;There is no skew/smile for forward contracts, but there is for options based on it (caps, floors, swaptions, options on futures). Then it would be the simple Black Formula that should be used in theory (using futures price).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The mere existence of the smile is an indicator that the model is fundamentally flawed and it is important to apply a correction.&lt;/p&gt;&#xA;" OwnerUserId="12252" LastActivityDate="2014-10-11T06:34:40.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15004" PostTypeId="2" ParentId="15001" CreationDate="2014-10-11T13:41:27.973" Score="2" Body="&lt;p&gt;I am engineer studying Finance, therefore Im not an expert in Math/Stat, but not noob. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I disagree with the previous answer. In fact, I know portfolio managers and hedge fund assesors that usses MPT. It must be said that you need to know what that represents, and also not only focus your investment in MPT, but consider other methods. Like in every other thing in finance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will advice you to use it as a tool to decide your investment but not use it as the only tool. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope it helps. &lt;/p&gt;&#xA;" OwnerUserId="12089" LastActivityDate="2014-10-11T13:41:27.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15005" PostTypeId="2" ParentId="14992" CreationDate="2014-10-11T13:58:05.713" Score="0" Body="&lt;p&gt;Well, you need to calculate the expected return of your portfolio, and the volatility. Taking into account that your weights are 100% long in A, 100% short in B:&#xA;$$&#xA;E(r)_A-E(r)_B&#xA;$$&#xA;Same for the volatility of the portfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then just calculate the Sharpe ratio: &#xA;$$&#xA;\frac{E(r)_{portf}-E(r)_{rf}}{Volatility_{portf}}&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="12089" LastActivityDate="2014-10-11T13:58:05.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15006" PostTypeId="2" ParentId="15001" CreationDate="2014-10-11T14:38:25.660" Score="4" Body="&lt;p&gt;Lots of wealth management firms still use MPT; in my experience regulators like it because they understand it.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If asset returns are normally distributed, the standard deviation of the portfolio is a coherent risk measure (this can be seen by noting that the normal distribution's CVaR, which is a coherent risk measure,  can be written as $$\mu+c \sigma$$ for a constant c).  In the long run, asset returns become more and more normally distributed due to the CLT.  For a 30 year time horizon MPT is still useful, assuming a reasonable estimate for the vector of expected returns and the covariance matrix.  &lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2014-10-11T14:38:25.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15008" PostTypeId="2" ParentId="14999" CreationDate="2014-10-11T16:47:39.430" Score="3" Body="&lt;p&gt;There is no such thing as &quot;free&quot; option data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is free --&gt;&lt;a href=&quot;http://www.nasdaq.com/symbol/aapl/option-chain&quot; rel=&quot;nofollow&quot;&gt;http://www.nasdaq.com/symbol/aapl/option-chain&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could crawl that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But to get the actual ticks or intraday data, you will unfortunately have to pay. I strongly suggest you find a college business program that has option data ticks and reach out to them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best of luck,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;JL&lt;/p&gt;&#xA;" OwnerUserId="7954" LastActivityDate="2014-10-11T16:47:39.430" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15009" PostTypeId="1" CreationDate="2014-10-11T20:15:10.957" Score="4" ViewCount="6399" Body="&lt;p&gt;I heard that this kind of questions appear a lot in the interviews. Here is one I saw from Galssdoor: Price a bond with coupon rate 3%, yield 9% and maturity 10 years. What is the typical way to do the approximation?&lt;/p&gt;&#xA;" OwnerUserId="13257" LastActivityDate="2016-08-13T12:57:58.380" Title="How to price a bond without paper during interview?" Tags="&lt;fixed-income&gt;&lt;pricing&gt;" AnswerCount="4" CommentCount="4" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15010" PostTypeId="1" AcceptedAnswerId="15012" CreationDate="2014-10-11T21:54:48.170" Score="1" ViewCount="74" Body="&lt;p&gt;Suppose there are k different stocks in a stock market. All of their prices are independent from each other. One year from now the price of the i-th stock will be $X_i^2$, where $X_i \sim \mathcal{N}(0,1)  $&#xA;What is the distribution of the value of a portfolio after a year if I buy a $1 piece from each stock?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Will it be simple the Chi-squared distribution with parameter k?&lt;/p&gt;&#xA;" OwnerUserId="12077" LastEditorUserId="12077" LastEditDate="2014-10-12T08:25:51.783" LastActivityDate="2014-10-12T08:25:51.783" Title="Distribution of the value of a portfolio" Tags="&lt;portfolio&gt;&lt;distribution&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15011" PostTypeId="2" ParentId="15010" CreationDate="2014-10-11T23:30:52.820" Score="0" Body="&lt;p&gt;Yes. It is a simple transformation of the product of the Gaussians from the Cartesian to the hyper-spherical coordinate.&lt;/p&gt;&#xA;" OwnerUserId="6686" LastActivityDate="2014-10-11T23:30:52.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15012" PostTypeId="2" ParentId="15010" CreationDate="2014-10-11T23:34:36.963" Score="1" Body="&lt;p&gt;Its Chi-Square distribution ($k=$ number of portfolio assets): &lt;a href=&quot;http://en.wikipedia.org/wiki/Chi-squared_distribution#Definition&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Chi-squared_distribution#Definition&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-10-12T01:10:12.490" LastActivityDate="2014-10-12T01:10:12.490" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15013" PostTypeId="1" AcceptedAnswerId="15014" CreationDate="2014-10-12T02:30:45.597" Score="17" ViewCount="2671" Body="&lt;p&gt;For example, Stanford has a &lt;a href=&quot;http://scpd.stanford.edu/search/publicCourseSearchDetails.do?method=load&amp;amp;courseId=9833824&amp;amp;showInternal=true&quot; rel=&quot;nofollow noreferrer&quot;&gt;class&lt;/a&gt; (STATS242 - Algorithmic Trading and Quantitative Strategies) on quantitative trading. But i am not able to determine what are the textbook(s) used in this course. The same also applies for similar courses at Stony Brook, Carnegie Mellon, etc. I couldn't find the syllabus guide for their courses either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone know what are the textbook(s) being used in these courses?&lt;/p&gt;&#xA;" OwnerUserId="11659" LastEditorUserId="11659" LastEditDate="2019-06-26T15:51:55.543" LastActivityDate="2019-06-26T15:51:55.543" Title="What are the textbooks used to teach Quantitative Trading at universities?" Tags="&lt;quant-trading-strategies&gt;&lt;reference-request&gt;&lt;education&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="40" ContentLicense="CC BY-SA 4.0" />
  <row Id="15014" PostTypeId="2" ParentId="15013" CreationDate="2014-10-12T14:12:39.540" Score="27" Body="&lt;p&gt;A quick google search retrieves the syllabus for the Stanford STATS 242 class. You can find it &lt;a href=&quot;http://summer.stanford.edu/wp-content/uploads/2013/10/STATS_242_2013.pdf&quot;&gt;here&lt;/a&gt;. Just in case it's taken down at some point I'll copy-paste the source material. Keep in mind that I have no idea if this material is good or bad -- I didn't make this list. Also keep in mind that it contains treatments of what does and does not work. With that being said:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Course Description&lt;/strong&gt;:&#xA;  This course is an introduction to financial trading strategies based on methods of statistical arbitrage. Topics include methodologies related to high frequency data, momentum strategies, pairs trading, technical analysis, models of order book dynamics and multi-exchange order placement and routing and dynamic trade planning with feedback. Emphasis is on developing, automating and empirically evaluating the models that reflect the market and behavioral patterns. The course will be balanced between theory and practice with a sufficient theory to understand practical applications. Although the methodologies could be applied to various financial markets, the course will mostly focus on stock and equity markets&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The course treats the following topics on a weekly basis:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Tentative Schedule:&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;Course Overview - ABFLR, Ch. 1&lt;/li&gt;&#xA;  &lt;li&gt;Stylized Facts of Asset Returns - LX, Ch. 6 &lt;/li&gt;&#xA;  &lt;li&gt;CAPM, Cointegration Review -  LX, Ch. 3 &amp;amp; 9 &lt;/li&gt;&#xA;  &lt;li&gt;Trading Algorithms - LX, Ch. 11 &amp;amp; AS, Select Chapters&lt;/li&gt;&#xA;  &lt;li&gt;Trading Mechanics, Order Book Dynamics, Execution Algorithms - ABFLR Part III, Ch. 5  &lt;/li&gt;&#xA;  &lt;li&gt;Market Impact Models - ABFLR Part III, Ch. 5 &lt;/li&gt;&#xA;  &lt;li&gt;Portfolio Rebalancing, Multi-Asset Trading - ABFLR Part IV&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Each topic also refers to source material, which is this following list:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;(Main) Optional Texts:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Abergel, F., Bouchaud, J-P., Foucault, T., Lehalle, C-A., Rosenbaum, M. (2012); Edited: Market Microstructure: Confronting Many Viewpoints, Wiley (ABFLR)&lt;/li&gt;&#xA;&lt;li&gt;Lai, T.Z. and H. Xing (2008): Statistical Models and Methods for Financial Markets, Springer (LX).&lt;/li&gt;&#xA;&lt;li&gt;Harris, L. (2003): Trading and Exchanges, Oxford University Press (HA).&lt;/li&gt;&#xA;&lt;li&gt;Hasbrouck, J. (2007): Empirical Market Microstructure, Oxford University Press.&lt;/li&gt;&#xA;&lt;li&gt;Acar, E. and S. Satchell (Ed) (2002): Advanced Trading Rules, Butterworth-Heinemann, second edition (AS).&lt;/li&gt;&#xA;&lt;li&gt;Tsay, R.S. (2005): Analysis of Financial Time Series, Wiley, Second Edition.&lt;/li&gt;&#xA;&lt;li&gt;Campbell, J.Y., Lo, A.W. and A.C. MacKinlay (1997): The Econometrics of Financial Markets, Princeton University Press.&lt;/li&gt;&#xA;&lt;li&gt;Edwards, R.D., Magee, J. and W.H.C. Bassetti (2013): Technical Analysis of Stock Trends, 10th edition, CRC Press.&lt;/li&gt;&#xA;&lt;li&gt;Fabozzi, F.J., Focardi, S.M. and P.N. Kolm (2006): Financial Modeling of the Equity Market, Wiley.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Further reading material&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Tentative Reading List&lt;/em&gt;&lt;/strong&gt; Key papers are marked with (*)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;A. Stylized Facts: An Overview&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Lo, A.W and A. C MacKinlay (1988): Stock market prices do not follow Random Walks: Evidence from a simple specifcation test, Review of Financial Studies, Vol1, p 41-66.&lt;/li&gt;&#xA;&lt;li&gt;Conrad, J.S , Hameed, A, and Niden, C., 1994, Volume and autocovariances in short-horizon individual security returns, Journal of Finance, Vol. XLIX, p 1305-1329.&lt;/li&gt;&#xA;&lt;li&gt;(*) Cont. R (2001): Empirical properties of asset returns: stylized facts and statistical issues, Quantitative Finance, Vol 1, p223-226&lt;/li&gt;&#xA;&lt;li&gt;Lunde, A and Timmermann, A (2004): Duration dependence in stock prices, Journal of Business and Economic Statistics, Vol 22, p 253-273.&lt;/li&gt;&#xA;&lt;li&gt;Bollerslev, T, Tauchen, G and H. Zhou (2009): Expected stock returns and variance risk premia, RFS p4463-4491&lt;/li&gt;&#xA;&lt;li&gt;Pollet, J. M and M. Wilson (2010): Average correlation and stock market returns, Journal of Financial Economics, Vol 96, p 364-380.&lt;/li&gt;&#xA;&lt;li&gt;Anatolyev, S. and A. Gerko (2005): A trading approach to testing for predictability, Jr of Business and EconStat, Vol 23, No. 4, p 455-461.&lt;/li&gt;&#xA;&lt;li&gt;Anatolyev, S. and N. Gospodinov (2010): Modeling Financial Return Dynamics via Decomposition, Journal of Business &amp;amp; Economic Statistics, Vol 28, No 2, p 232-245.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;B. Market Micro Structure&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;(*) Madhavan, A. (2000): Market Microstructure: A Survey, Jounal of Financial Markets, Vol3, p 205-258.&lt;/li&gt;&#xA;&lt;li&gt;Rydberg, T. H. and N. Shephard (2003): Dynamics of Trade-by-Trade Price Movement: Decomposition and Models, Journal of Financial Econometrics, Vol 1, No 1, p 2-25.&lt;/li&gt;&#xA;&lt;li&gt;Rydberg, T. H. and N. Shephard (1999): BIN models for trade-by-trade data. Modeling the number of trades in a fixed interval of time.&lt;/li&gt;&#xA;&lt;li&gt;Engle, R. and A. Lunde (2003): Trades and Quotes: A Bivariate Point Process, J. Financial Econometrics, Vol 1, p 159-188.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;C. Algo Trading / Order Book Dynamics&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;(*) Hendershott, T. and R. Riordan (2009): Algorithmic trading and Information. (Unpublished)&lt;/li&gt;&#xA;&lt;li&gt;(*) Cont, R., S. Stoikov and R. Talreja (2010): A Stochastic Model for Order Book Dynamics, Operations Research, Vol 58, No 3, p 549-563.&lt;/li&gt;&#xA;&lt;li&gt;(*) Fama, E.F and M. Blume (1966): Filter rules and stock market trading, The Journal of Business, Vol. 39, p 226-241.&lt;/li&gt;&#xA;&lt;li&gt;Neftci, S.N (1991): Naive trading rules in financial markets and Wiener- Kolmogorov Prediction Theory: A study of Technical Analysis, Journal of Business, Vol.64, p 549-571.&lt;/li&gt;&#xA;&lt;li&gt;Lo, A, MacKinlay, A. C. and Zhang, J. (2002): Econometric Models of Limit-order Execution, Journal of Financial Economics, vol. 65(1), p 31-71.&lt;/li&gt;&#xA;&lt;li&gt;Hall, A. D. and N. Hautsch (2006): Order aggressiveness and order book dynamics, Empirical Economics, vol. 30(4), p 973-1005.&lt;/li&gt;&#xA;&lt;li&gt;Ellul, A., C. W. Holden, P. Jain and R. Jennings (2007): Order Dynamics: Recent Evidence from NYSE, Journal of Empirical Finance, vol 14, p 636-661.&lt;/li&gt;&#xA;&lt;li&gt;Goettler, R. L., Parlour, C. A. and Rajan, U. (2009): Informed Traders and Limit Order Markets, Journal of Financial Economics, vol 93, p 67-87.&lt;/li&gt;&#xA;&lt;li&gt;Kavajecz, K. A. (1999): A Specialist's Quoted Depth and the Limit Order Book, Journal of Finance, Vol. 54, No. 2, p 747-771.&lt;/li&gt;&#xA;&lt;li&gt;(*) Stoikov, S., Avallaneda, M. and Read, J. (2011): Forecasting prices from Level-I quotes in the presence of hidden liquidity, Algorithmic Finance, Vol 1, No. 1, p 35-43.&lt;/li&gt;&#xA;&lt;li&gt;Biais, B. Hillion, P., and Spatt, C. (1995): An empirical analysis of the limit order book and the order flow in the Paris Bourse, Jr of Finance, p 1655-1689&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;D. Trading Stategies&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;D.1.: Technical Analysis&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;(*) Brock, W, J. Lakonishok and B. LeBaron (1992): Simple technical trading rules and the stochastic properties of Stock Returns; Journal of Finance, Vol XLVII, p 1731-1763.&lt;/li&gt;&#xA;&lt;li&gt;Gencay, R (1998): Optimization of technical trading strategies and profitability in security markets, Vol 54, p 249-254&lt;/li&gt;&#xA;&lt;li&gt;Sullivan, R, Timmermann, A and H. White (1999): Data-snooping , technical trading rule performance and the Bootstrap, Journal of Finance, Vol LIV, p 1647-169.&lt;/li&gt;&#xA;&lt;li&gt;(*) Lo, A.W, H. Mamaysky and J. Wang (2000): Foundations of technical analysis; Computational algorithms, statistical inference and empirical implementation, Journal of Finance , Vol. LV, P1705- 1765. ( Discussion&#xA;by Jegadeesh: 1765-1775)&lt;/li&gt;&#xA;&lt;li&gt;Ready M. J (2002): Profits from technical trading rules, Financial Management, Autumn, p 43-61.&lt;/li&gt;&#xA;&lt;li&gt;Zhu, Y. and G. Zhou (2009): Technical Analysis: An asset Allocation Perspective on the Use of Moving Averages, Journal of Financial Economics, Vol 92 (3), P 519-544.&lt;/li&gt;&#xA;&lt;li&gt;(*) Han, Y., Yang, K. and Zhou, G. (2011): A New Anomaly: The Cross-Sectional Profitability of Technical Analysis (Unpublished)&lt;/li&gt;&#xA;&lt;li&gt;Osler, C. (2003): Currency Orders and Exchange Rate Dynamics: An Explanation for the Predictive Success of Technical Analysis, Journal of Finance, October p 1791-1805.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;D.2: Momentum&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;(*) Jegadeesh, N and S. Titman (1993): Returns to buying winners and selling loosers; Implications for stock market effciency, Journal of Finance, Vol 48, p 65-91&lt;/li&gt;&#xA;&lt;li&gt;(*) Jegadeesh, N and S. Titman (1993): Cross-sectional and time series determinant of momentum returns, Review of Financial Studies, Vol 15, p 143- 157&lt;/li&gt;&#xA;&lt;li&gt;(*) Chan, L.K.C, N. Jegadeesh and J. Lakonishok (1996), Momentum strategies, Journal of Finance, Vol. LI, p 1681- 1713.&lt;/li&gt;&#xA;&lt;li&gt;Rouwenhorst K. G, (1998), International Momentum Strategies, Journal of Finance, Vol LIII, P 267-283.&lt;/li&gt;&#xA;&lt;li&gt;Moskowitz, T. J and M. Grinblatt (1999): Do industries explain momentum, Journal of Finance, Vol LIV, p1249-1289.&lt;/li&gt;&#xA;&lt;li&gt;Lee, C.M.C and B Swaminathan (2000): Price Momentum and trading volume; Journal of Finance, Vol. LV, p2017- 2060.&lt;/li&gt;&#xA;&lt;li&gt;Jegadeesh, N and S. Titman (2001): Profitability of momentum strategies: An evaluation of alternative explanations, Journal of Finance, Vol LVI, p 699-720.&lt;/li&gt;&#xA;&lt;li&gt;Jegadeesh, N and S. Titman (2001): Momentum, Working Paper.&lt;/li&gt;&#xA;&lt;li&gt;(*) Lewellen, J (2002), Momentum and autocorrelation in stock returns, Review of Financial Studies, Vol 15, p 533- 563.&lt;/li&gt;&#xA;&lt;li&gt;Hvidkjaer, S ,(2006), A trade based analysis of momentum, Review of Financial Studies, p 457- 492&lt;/li&gt;&#xA;&lt;li&gt;Liu, L. X. and Zhang, L (2008), Momentum profits, factor pricing, and macroeconomic risks, Review of Financial Studies, Vol 21, p 2417- 2448.&lt;/li&gt;&#xA;&lt;li&gt;Moskowitz, T., Ooi, Y.H., and Pedersen, L.H. (2010): Time Series Momentum, To appear in JFE.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;D.3: Statistical Arbitrage&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Bondarenko , O (2003): Statistical arbitrage and securities prices, Review of Financial Studies, Vol 16, p875-919.&lt;/li&gt;&#xA;&lt;li&gt;Larsson, E , Larssin, l and J. Aberg (2003), A Market Neutral Statistical Arbitrage Trading Model, Unpublished&lt;/li&gt;&#xA;&lt;li&gt;Hogan, S, R. Jarrow, M. Teo and M. Warachka, (2004): Testing market effciency using statistical arbitrage with applications to momentum and value strategies, Journal of Financial Economics, Vol 73, p 525-565.&lt;/li&gt;&#xA;&lt;li&gt;(*) Jarrow, R.A, Teo, M, Tse, Y.K and Warachaka, M, (2005), Statistical arbitrage and market efficiency: Enhanced Theory, Robust Tests and Further Applications, unpublished.&lt;/li&gt;&#xA;&lt;li&gt;(*) Avellaneda, M. and J-H. Lee (2010): Statistical arbitrage in the US equities market, Quantitative Finance, vol. 10(7), p 761-782.&lt;/li&gt;&#xA;&lt;li&gt;Popova, I. and E. Popova (2010): Estimation of performance and execution time effect on high frequency statistical arbitrage strategies, Jr of Trading, Spring p 23-30.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;D.4: Pairs Trading&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Froot, K. A and E.M.Dabora (1999): How are stock prices affected by the location of trade; Journal of Financial Economics, Vol 53, p189-216.&lt;/li&gt;&#xA;&lt;li&gt;Elliot, R.J, Van Der Hoek, J and W.P Malcolm (2005): Pairs Trading; Quantitative Finance, Vol 5, P 271-276.&lt;/li&gt;&#xA;&lt;li&gt;(*) Gatev, E, Goetzmann, W.N and R.G. Rouwenhorst (2006): Pairs Trading: Performance of a Relative Value Arbitrage Rule; The Review of Financial Studies, Vol 19, p 797-827.&lt;/li&gt;&#xA;&lt;li&gt;(*) Scruggs, J.T (2007): Noise Trader Risk: Evidence from the Siamese Twins, Journal of Financial Markets, Vol 10, p 76-105.&lt;/li&gt;&#xA;&lt;li&gt;(*) Engelberg, J, Gao, P and R. Jaggannathan (2009): An anatomy of Pairs trading: the role of idiosyncratic news, common information and liquidity; unpublished.&lt;/li&gt;&#xA;&lt;li&gt;Clifton Green, T. and B-H Hwang (2009):Price-Based Return Comovement, Jr Financial Economics, Vol 93, p 37-50.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;D.5: Others&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Fung,W and D. A Hsieh (1997): Empirical characteristics of dynamic trading strategies: The case of hedge&#xA;funds, Review of Financial Studies, Vol 10, p 275-302.&lt;/li&gt;&#xA;&lt;li&gt;(*) Conrad, J and G. Kaul (1998): An anatomy of trading strategies, Review of Financial Studies, Vol 11, p&#xA;489-519.&lt;/li&gt;&#xA;&lt;li&gt;Alexander, G. J, (2000), On back- testing zero investing strategies, Journal of Business, Vol 73, p 255-278&lt;/li&gt;&#xA;&lt;li&gt;Fung,W and D. A Hsieh (2001): The risk in hedge fund strategies: Theory and evidence from trend followers,&#xA;Vol 14, p 313-341.&lt;/li&gt;&#xA;&lt;li&gt;(*) Creamer, G. and Y. Freund (2007): A Boosting Approach for Automated Trading, Jr of Trading, p 84-94.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;E. Execution Strategies&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Grinold, R. C. and R.N. Kahn (1995): Active Portfolio Management, Probus Publishing.&lt;/li&gt;&#xA;&lt;li&gt;(*) Almgren, R and N. Chriss (2000) : Optimal Execution of portfolio transactions, Journal of Risk, Vol 3, p5-39&lt;/li&gt;&#xA;&lt;li&gt;Almgren, R ( 2003): Optimal Execution with nonlinear inpact functions and trading-enhanced risk, Applied Mathematical Finance, Vol 10, p 1-18&lt;/li&gt;&#xA;&lt;li&gt;Almgren, R. and J. Lorenz (2007): Adaptive Arrival Price, Journal of Trading, Vol. 2007, No. 1, p 59-66.&lt;/li&gt;&#xA;&lt;li&gt;Almgren, R. and J. Lorenz (2006): Bayesian Adaptive Trading with a Daily Cycle, Journal of Trading, Vol. 1, No. 4, p 38-46.&lt;/li&gt;&#xA;&lt;li&gt;Garleanu, N. and L.H. Pedersen (2011): Dynamic Trading with Predictable Returns and Transaction Costs, To appear in JFE.&lt;/li&gt;&#xA;&lt;li&gt;Lorenz, J. and R. Almgren (2011): Mean-Variance optimal adaptive execution. (Unpublished)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;F. Market Impact Models&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;J. P. Bouchaud, J. D. Farmer and F. Lillo, &quot;How markets slowly digest changes in supply and demand,&quot; Handbook of Financial Markets: Dynamics and Evolution, 2008.&lt;/li&gt;&#xA;&lt;li&gt;J. P. Bouchaud, Y. Gefen, M. Potters and M. Wyart, &quot;Fluctuations and response in financial markets: the subtle nature of random price changes,&quot; Quantitative Finance, vol. 4, pp. 176-190, 2004.&lt;/li&gt;&#xA;&lt;li&gt;J. P. Bouchaud, J. Kockelkoren and M. Potters, &quot;Random walks, liquidity molasses and critical response in financial markets,&quot; Quantitative Finance, vol. 6, pp. 115-123, 2006.&lt;/li&gt;&#xA;&lt;li&gt;(*) J. D. Farmer, P. Patelli and I. I. Zovko, &quot;The predictive power of zero intelligence in financial markets,&quot; Proc. Natl. Acad. Sci. U. S. A., vol. 102, pp. 2254-2259, 2005.&lt;/li&gt;&#xA;&lt;li&gt;J. Gatheral, &quot;No-dynamic-arbitrage and market impact,&quot; Quantitative Finance, vol. 10, pp. 749-759, 2010.&lt;/li&gt;&#xA;&lt;li&gt;J. Gatheral, &quot;No Arbitrage and Market Impact,&quot; 2008.&lt;/li&gt;&#xA;&lt;li&gt;P. Hewlett, &quot;Clustering of order arrivals, price impact and trade path optimisation,&quot; in Workshop on Financial Modeling with Jump Processes, Ecole Polytechnique, 2006, pp. 68.&lt;/li&gt;&#xA;&lt;li&gt;F. Lillo and J. D. Farmer, &quot;The long memory of the efficient market,&quot; Studies in Nonlinear Dynamics &amp;amp;&#xA;Econometrics, vol. 8, pp. 1-33, 2004.&lt;/li&gt;&#xA;&lt;li&gt;V. Plerou, P. Gopikrishnan, X. Gabaix and H. E. Stanley, &quot;On the Origin of Power-Law Fluctuations in Stock&#xA;Prices,&quot; 2004.&lt;/li&gt;&#xA;&lt;li&gt;M. Potters and J. P. Bouchaud, &quot;More statistical properties of order books and price impact,&quot; Physica A:&#xA;Statistical Mechanics and its Applications, vol. 324, pp. 133-140, 2003.&lt;/li&gt;&#xA;&lt;li&gt;N. Westray and M. Sarkar, &quot;An Empirical Study into the Temporal Structure of Market Impact,&quot; Market&#xA;Microstructure - Confronting Many Viewpoints, 2010.&lt;/li&gt;&#xA;&lt;li&gt;W. X. Zhou, &quot;Universal price impact functions of individual trades in an order-driven market,&quot; 2007.&lt;/li&gt;&#xA;&lt;li&gt;(*) R. Almgren, &quot;Execution costs,&quot; Encyclopedia of Quantitative Finance, pp. 1-5, 2008.&lt;/li&gt;&#xA;&lt;li&gt;S. A. Berkowitz, D. E. Logue and E. A. Noser Jr, &quot;The total cost of transactions on the NYSE,&quot; Journal of&#xA;Finance, vol. 43, pp. 97-112, 1988.&lt;/li&gt;&#xA;&lt;li&gt;M. Borkovec and H. G. Heidle, &quot;Building and Evaluating a Transaction Cost Model: A Primer,&quot; The Journal&#xA;of Trading, vol. 5, pp. 57-77, 2010.&lt;/li&gt;&#xA;&lt;li&gt;D. Cushing and A. N. Madhavan, &quot;The Hidden Cost of Trading at the Close,&quot; Trading, vol. 2001, pp.12-19,&#xA;2001.&lt;/li&gt;&#xA;&lt;li&gt;L. R. Glosten and P. R. Milgrom, &quot;Bid, ask and transaction prices in a specialist market with hetero-geneously&#xA;informed traders,&quot; J. Financ. Econ., vol. 14, pp. 71-100, 1985.&lt;/li&gt;&#xA;&lt;li&gt;(*) G. Huberman and W. Stanzl, &quot;Price manipulation and quasi-arbitrage,&quot; Econometrica, vol. 72, pp.&#xA;1247-1275, 2004.&lt;/li&gt;&#xA;&lt;li&gt;(*) A. S. Kyle, &quot;Continuous auctions and insider trading,&quot; Econometrica: Journal of the Econometric Society,&#xA;vol. 53, pp. 1315-1335, 1985.&lt;/li&gt;&#xA;&lt;li&gt;(*) A. N. Madhavan, &quot;VWAP strategies,&quot; Trading, vol. 2002, pp. 32-39, 2002.&lt;/li&gt;&#xA;&lt;li&gt;A. F. Perold, &quot;The Implementation Shortfall: Paper versus Reality,&quot; Journal of Portfolio Management, vol.&#xA;14, pp. 4-9, 1988.&lt;/li&gt;&#xA;&lt;li&gt;T. S. Strother, J. W. Wansley and P. Daves, &quot;Electronic communication networks, market makers, and the&#xA;components of the bid-ask spread,&quot; International Journal of Managerial Finance, vol. 5, pp. 81-109, 2009.&lt;/li&gt;&#xA;&lt;li&gt;(*) J. L. Treynor, &quot;What does it take to win the trading game?&quot; Financial Analysts Journal, vol. 37, pp.55-60,&#xA;1981.&lt;/li&gt;&#xA;&lt;li&gt;I. M. Werner, &quot;Execution quality for institutional orders routed to Nasdaq dealers before and after decimals,&quot;&#xA;2003.&lt;/li&gt;&#xA;&lt;li&gt;(*) Almgren,R., C. Thum, E. Hauptmann and H. Li (2005): Equity Market Impack, Risk, July, p57-62.&lt;/li&gt;&#xA;&lt;li&gt;Lillo, J. D. Farmer and R. N. Mantegna (2003): Market Curve for price-impact function, Nature, p129-130.&lt;/li&gt;&#xA;&lt;li&gt;Kissell, R. and R. Malamut (2006): Algorithmic Decision Making Framework, Jr of Trading, Winter p 12-21.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;G. Portfolio Approach to Trading&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Ubukata, M. and Oya, K. (2009): Estimation and Testing for Dependence in Market Microstructure Noise,&#xA;Journal of Financial Econometrics, Vol 7, p 106-151.&lt;/li&gt;&#xA;&lt;li&gt;(*) Ait-Sahalia, Y., J. Fan, and D. Xiu (2010): High-Frequency Covariance Estimates With Noisy and Asyn-&#xA;chronous Financial Data, Journal of the American Statistical Association, Vol. 105, No. 492, p 1504-1517.&lt;/li&gt;&#xA;&lt;li&gt;(*) Fan, J., Li, Y., and Yu, K. (2012): Vast Volatility Matrix Estimation using High Frequency Data for&#xA;Portfolio Selection, Journal of American Statistical Association, Vol 107, p 412-428.&lt;/li&gt;&#xA;&lt;li&gt;Lo, A. W. and P. N. Patel (2008): 130/30: The New Long-Only, Jr of Portfolio Management, p 12-13.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;H. Others&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Barclay, M. J., T. Hendershott, and D. T. McCormick. 2003. Competition among trading venues: Information&#xA;and trading on electronic communications networks. The Journal of Finance 58 (6): 2637-66.&lt;/li&gt;&#xA;&lt;li&gt;(*) Foucault, T., O. Kadan, and E. Kandel. 2005. Limit order book as a market for liquidity. Review of&#xA;Financial Studies 18 (4): 1171-217.&lt;/li&gt;&#xA;&lt;li&gt;Foucault, T., and A. J. Menkveld. 2008. Competition for order ow and smart order routing systems. The&#xA;Journal of Finance 63 (1): 119-58.&lt;/li&gt;&#xA;&lt;li&gt;Foucault, T., S. Moinas, and E. Theissen. 2007. Does anonymity matter in electronic limit order markets?&#xA;Review of Financial Studies 20 (5): 1707-47.&lt;/li&gt;&#xA;&lt;li&gt;(*) Glosten, L. R. 1994. Is the electronic open limit order book inevitable? Journal of Finance: 1127-61.&lt;/li&gt;&#xA;&lt;li&gt;Hamilton, J. L. 1979. Marketplace fragmentation, competition, and the eciency of the stock exchange. The&#xA;Journal of Finance 34 (1): 171-87.&lt;/li&gt;&#xA;&lt;li&gt;Hendershott, T., and H. Mendelson. 2000. Crossing networks and dealer markets: Competition and perfor-&#xA;mance. The Journal of Finance 55 (5): 2071-115.&lt;/li&gt;&#xA;&lt;li&gt;(*) Kyle, A. S., and A. A. Obizhaeva. 2010. Market Microstructure Invariants. (Unpublished)&lt;/li&gt;&#xA;&lt;li&gt;Mendelson, H., and William E. Simon Graduate School of Business Administration. Managerial Economics&#xA;Research Center. 1987. Consolidation, fragmentation, and market performance. Cambridge Univ. Press.&lt;/li&gt;&#xA;&lt;li&gt;Stoll, H. R. 2006. Electronic trading in stock markets. The Journal of Economic Perspectives 20 (1): 153-74.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;I. New Papers&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Dumitru, A.M. and G. Urga. 2012. Identifying jumps in nancial assets { A comparison between nonpara-&#xA;metric jump tests. Journal of Business and Economic Statistics, Vol. 30, No. 2, p 242-255.&lt;/li&gt;&#xA;&lt;li&gt;Harchaoui, G. and C. Levy-Leduc. 2010. Multiple change-point estimators with a total variation penalty.&#xA;Journal of the American Statistical Association, Vol. 105, p 1480-1493.&lt;/li&gt;&#xA;&lt;li&gt;Hendershott, T., C. M. Jones, and A. J. Menkveld. 2011. Does algorithmic trading improve liquidity? The&#xA;Journal of Finance, 66 (1): 1-33.&lt;/li&gt;&#xA;&lt;li&gt;O'Hara, M., and M. Ye. 2011. Is market fragmentation harming market quality? Journal of Financial&#xA;Economics, Vol 100, p 459-474.&lt;/li&gt;&#xA;&lt;li&gt;Maglaras, C., C.C. Moallemi, and H. Zheng. 2012. Optimal order routing in a fragmented market. Working&#xA;paper (Unpublished).&lt;/li&gt;&#xA;&lt;li&gt;Han, Y., K. Yang, and G. Zhou. 2009. A new anomaly: The cross-sectional protability of technical analysis.&#xA;Working paper (Unpublished).&lt;/li&gt;&#xA;&lt;li&gt;Moskowitz, T.J., Y.H. Ooi, and L.H. Pedersen. 2012. Time series momentum. Journal of Financial Economics,&#xA;Vol. 104, p 228-250.&lt;/li&gt;&#xA;&lt;li&gt;Daniel, K.. 2011. Momentum Crashes. Unpublished.&lt;/li&gt;&#xA;&lt;li&gt;Daniel, K., R. Jagannathan, and S. Kim. 2012. Tail Risk in Momentum Strategy Returns. Working paper&#xA;(Unpublished).&lt;/li&gt;&#xA;&lt;li&gt;Garleanu, N. and L.H. Pedersen. Dynamic Trading with Predictable Returns and Transaction Costs. Working&#xA;paper (Unpublished).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3371" LastActivityDate="2014-10-12T14:12:39.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15015" PostTypeId="1" CreationDate="2014-10-12T15:31:26.273" Score="3" ViewCount="6129" Body="&lt;p&gt;I have to construct and evaluate portfolio of bonds and stocks, namely I need to get return on portfolio, standard deviation and sharpe ratios. I have weekly data that contains stock prices, and I could find only one source of weekly data for the bonds. It's from Federal Reserve Economic Data, weekly Yields on Moody's AAA bonds (long-term bonds, 20-30 years to maturity) in percentages. My problem is that I have no idea how to transform weekly yields into the form comparable to stocks' weekly returns. Can anyone give me some advise on it?&#xA;The data looks like this:&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;week1         7.44&lt;/li&gt;&#xA;&lt;li&gt;week2         7.43&lt;/li&gt;&#xA;&lt;li&gt;week3         7.40&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="13262" LastActivityDate="2019-11-28T18:49:27.650" Title="Calculate bond returns from yields" Tags="&lt;fixed-income&gt;&lt;portfolio-management&gt;&lt;returns&gt;&lt;historical-data&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15016" PostTypeId="2" ParentId="14994" CreationDate="2014-10-12T17:33:46.710" Score="1" Body="&lt;p&gt;In many years working in the credit markets, I never encountered anyone making an approximation of CDS spread being equal to risky par bond yield.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we approximate CDS coupon payments as a continuous stream $s$, default intensity as a constant $h$, and we assume that discount factors come from a constant risk-free rate $r$, then the CDS pricing formula becomes&#xA;$$&#xA;\begin{align}&#xA;S&amp;amp;=\int_0^T (1-\delta)e^{-(r+h)t} h dt - \int_0^T s e^{-(r+h)t} dt \\ &#xA; &amp;amp;= \frac{ \left( 1-e^{-(r+h)T}  \right)}{r+h} \left(h(1-\delta)-s \right)&#xA;\end{align}&#xA;$$&#xA;and the value of a risky bond paying coupons at continuous rate $c$ is&#xA;$$&#xA;\begin{align}&#xA;V&amp;amp;=e^{-(r+h)T} + \int_0^T c e^{-(r+h)t} dt + \int_0^T \delta e^{-(r+h)t} h dt \\&#xA;&amp;amp;=e^{-(r+h)T}+\frac{c}{r+h}\left(1-e^{-(r+h)T}\right) +\frac{h\delta}{r+h}\left(1-e^{-(r+h)T}\right).&#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we take the old-school approximation that $\delta=0$, $s=h$, and also &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$c=r+h$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then these formulae simplify to &#xA;$$&#xA;S = \left(h -s \right) \frac{ \left( 1-e^{-(r+h)T}  \right)}{r+h} = 0&#xA;$$&#xA;and&#xA;$$&#xA;V=1.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, the old-school approximations people apply are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The fair CDS coupon $s$ is the credit spread $h$ (not the risky par bond yield $r+h$), and&lt;/li&gt;&#xA;&lt;li&gt;The bond trades at par when the yield $y$ is the risk-free rate plus the credit spread, and this happens when the coupons are $c=y=r+h$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Note that professionals in CDS markets rarely use these $\delta=0$ approximations, but even in 2014 you do still run into some risky bond market people who use them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The constant interest rate assumption is commonly used by all sorts of participants, since even when interest rates are not constant it gives you the right answer for DV01 and CD01 sensitivities, to first order.  Software libraries (like &lt;a href=&quot;http://www.ubs.com/microsites/ubs-delta/en/products-services.html&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt;) handle the computations when full precision is desired.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2014-10-14T03:05:29.003" LastActivityDate="2014-10-14T03:05:29.003" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="15017" PostTypeId="1" CreationDate="2014-10-12T21:02:31.663" Score="2" ViewCount="920" Body="&lt;p&gt;I would like to test for herding behaviour using the herding measure developed by &lt;a href=&quot;http://scholar.harvard.edu/files/shleifer/files/impact_instit_trading.pdf&quot; rel=&quot;nofollow&quot;&gt;Lakonishok et. al (1992)&lt;/a&gt;  on a dataset containing trader transactions during 2013, however, i am having some trouble implementing it in Python and I am not sure I quite understand how to compute each of the components of the equation (especially the Adjustment Factor).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The herding measure is given by &lt;code&gt;H(i) = |B(i)/(B(i) + S(i)) - p(t)| - AF(i)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where AF(1) = |$\hat(B)$(1)/(B(1) + S(1)) - p(t)| ..... and ..... $\hat(B)$(i) $\sim$(p(t), B(i) + S(i)) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A sample of my dataset looks as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;PositionID  TraderID    AssetID OrderID   Leverage  Equity  TotalAmount InitialRate PnL    Long=1   EndRate OpenDate            CloseDate&#xA;103764400   39          8       4565523   50        20      1000        0.8349       7.03   0       0.8306  24/11/2013 22:05    29/11/2013 21:31&#xA;103764489   39          3       4565521   50        20      1000        0.8175       3.9    0       0.8136  24/11/2013 22:06    29/11/2013 21:31&#xA;103764661   39          10      4565524   50        20      1000        137.3        19.73  1       139.32  24/11/2013 22:07    29/11/2013 00:53&#xA;103764698   39          1       4565518   50        20      1000        1.3553       2.8    1       1.3581  24/11/2013 22:07    29/11/2013 21:31&#xA;43611297    57          1       4565519   10        23.02   230.2       1.3         -9.74   0       1.3423  12/12/2012 00:15    08/02/2013 10:56&#xA;79572882    57          1       4565520   50        20      1000        1.3101      -0.2    1       1.3099  23/06/2013 21:13    23/06/2013 21:13&#xA;79572945    57          1       4565521   50        20      1000        1.3098      -1.5    0       1.3113  23/06/2013 21:13    24/06/2013 10:20&#xA;79683082    57          5       4565522   50        20      1000        97.96       -0.2    1       97.94   24/06/2013 10:20    24/06/2013 10:20&#xA;83630718    57          16      4565523   100       10      1000        106.41      -0.7    0       106.48  19/07/2013 08:49    19/07/2013 08:49&#xA;41039724    59          11      4565524   25        24.23   69.5        129.31      -19.89  0       157.54  20/11/2012 09:26    15/10/2013 15:42&#xA;41054904    59          11      4565525   25        24.01   69.5        129.63      -19.67  0       157.54  20/11/2012 11:47    15/10/2013 15:42&#xA;41244158    59          11      4565526   25        22.66   68          130.84      -18.41  0       157.54  21/11/2012 09:19    15/10/2013 15:42&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Let's say I wanted to calculate the herding measure for AssetID=1, then:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;H(1) = |2/4 - (4/12)| - AF(1)&lt;/code&gt; but i'm not sure how to calculate AF(1).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE: &lt;a href=&quot;https://www.ebs.edu/fileadmin/redakteur/funkt.dept.finance/DGF/downloads/Paper/No-136.pdf&quot; rel=&quot;nofollow&quot;&gt;Frey et. al 2012&lt;/a&gt; discuss the AF, but I still don't know how to calculate it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, once I calculate the heading measure for all stocks, should I average them across all stocks and across all quarters?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, in the study, the authors apply this measure on subsets of the data (by size, past quarter performance, etc...). I am not sure how to do this exactly. Should I first filter the data (by size lets say) and take the largest quintile and calculate the average herding measure?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to implement this in python so I would really appreciate as much detail as possible and the best way to implement it in python. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="5190" LastEditorUserId="5190" LastEditDate="2014-10-12T23:22:47.893" LastActivityDate="2019-03-19T20:30:59.073" Title="How to implement the herding measure proposed by Lakonishok et. al (1992) in python" Tags="&lt;python&gt;&lt;behavioral-finance&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15018" PostTypeId="1" AcceptedAnswerId="15022" CreationDate="2014-10-12T22:32:30.880" Score="1" ViewCount="427" Body="&lt;p&gt;How does NASDAQ make money?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How much of it is from selling market data, and how much of it is from commissions from trades?&lt;/p&gt;&#xA;" OwnerUserId="13264" LastActivityDate="2014-10-15T15:03:26.690" Title="How do exchanges make money?" Tags="&lt;exchange&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15019" PostTypeId="1" CreationDate="2014-10-12T22:53:44.410" Score="2" ViewCount="208" Body="&lt;p&gt;I did a mistake just now and bought 2000+ pip difference USD/RUB. (I tought Its 2.0 but 2,0) I can't contact to forex office because its 2 AM here. now It shows 5k+ USD loss. I am in panic right now. &#xA;It shows I bought at 40.80 and now 38.67 I meant to buy at 38.67 but It was spread difference. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Will my money back when spread calms down?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit : spread seems getting calm down slowly, now 770pip and my loos down to 2k USD. I HOPE It will be normal and I will get my money back :/&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit2: I end up with 1200 USD loss and did close the position. I did contact with broker they told they will try their best but after some hours they called me with bad news. :(&lt;/p&gt;&#xA;" OwnerUserId="11885" LastEditorUserId="11885" LastEditDate="2014-10-13T15:38:55.543" LastActivityDate="2014-10-14T10:21:06.467" Title="Forex buying 2000+ pip difference" Tags="&lt;fx&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="1" ClosedDate="2014-10-13T19:26:15.133" ContentLicense="CC BY-SA 3.0" />
  <row Id="15020" PostTypeId="2" ParentId="15019" CreationDate="2014-10-12T23:26:30.867" Score="1" Body="&lt;p&gt;The trade cannot be made undone, you can at best sue your broker for not correctly informing you about the &quot;2,0/2.0&quot; notation.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-10-12T23:26:30.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15021" PostTypeId="2" ParentId="15015" CreationDate="2014-10-13T00:29:38.483" Score="2" Body="&lt;p&gt;Unfortunately I don't think it's possible to compute returns purely based on yields...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a few options:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;If you're on the buy side, you can easily get access to Barclay, Citi, or BofA's bond indices. These are very high quality datasets for studying historical bond returns.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you have Bloomberg, they've started providing bond indices as well. They come bundled with your Bloomberg subscription.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I built some bond return indices myself using the Fed's fitted yield curve. I've published the entire dataset on my &lt;a href=&quot;http://hungrydummy.com/datacenter/&quot; rel=&quot;nofollow&quot;&gt;blog&lt;/a&gt;. The advantage of this dataset is that the history is pretty long (starting in the 1960s). The disadvantage is that they outperform comparable benchmark issues in a few sub-periods. The reasons for the discrepancy are detailed on the download page.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2014-10-13T00:29:38.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15022" PostTypeId="2" ParentId="15018" CreationDate="2014-10-13T00:41:20.590" Score="5" Body="&lt;p&gt;Companies with more than $10M in assets and a share class with more than 500 equity owners are required by the SEC to file an annual Form 10-K report.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can reverse engineer how NASDAQ makes its revenues through their &lt;a href=&quot;http://www.nasdaqomx.com/digitalAssets/91/91314_10-k.pdf&quot; rel=&quot;nofollow&quot;&gt;latest Form 10-K&lt;/a&gt;. After deducting expenses from transaction rebates, brokerage, clearance and exchange fees, this is the breakdown:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Market services, 41.0%.&lt;/strong&gt; This includes:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Derivatives clearing (e.g. on OMX PHLX, BX options)&lt;/li&gt;&#xA;&lt;li&gt;Cash equity trading and platform fees (e.g. on NASDAQ, BX, PSX)&lt;/li&gt;&#xA;&lt;li&gt;Fixed income trading and platform fees (e.g. on eSpeed)&lt;/li&gt;&#xA;&lt;li&gt;Access/broker services (e.g. colocation services, TradeGuard)&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Listing services, 12.0%&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Information services, 23.3%.&lt;/strong&gt; This includes:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Market data (e.g. from distribution fees; from operating the SIP for the UTP plan, and from proprietary feeds)&lt;/li&gt;&#xA;&lt;li&gt;Index licensing (e.g. NASDAQ 100 index)&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Technology solutions: 23.7%&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Corporate solutions (e.g. Thomson Reuters Corporate Solutions business, risk compliance software etc.)&lt;/li&gt;&#xA;&lt;li&gt;Other trading and market data software (e.g. services for brokers, SMARTS; matching engine software, used on ASX, ICAP etc.; and enterprise compliance software, BWise)&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I want to emphasize a related point: HFT firms that use proprietary feeds and colocation services have been receiving a lot of media flak for untrue reasons. The Nanex and Flash Boys rhetoric is colorful, but poorly researched.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see for yourself, exchanges run a huge business and the proprietary feeds and colocation services are only a very small part of the pie. Moreover, even among the users of colocation services and proprietary feeds, the biggest clients are actually the software vendors (Interactive Data, Reuters, Bloomberg) and broker-dealers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And besides, HFT firms are middlemen by design. That's like complaining that Arrow Electronics and Ingram Micro can buy millions of Intel processors at the lowest prices, and that retail consumers like you and me can't compete with them. Well yes, but you and I can buy an Intel processor from Amazon for a very low price, with excellent warranty and replacement services at only several dollars more than Arrow/Ingram are paying per piece.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="4660" LastEditDate="2014-10-15T15:03:26.690" LastActivityDate="2014-10-15T15:03:26.690" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15023" PostTypeId="2" ParentId="15015" CreationDate="2014-10-13T02:52:04.723" Score="-2" Body="&lt;p&gt;You can calculate an approximation.  Yields are quoted on an annual basis.  Bond valuations are based on Discounted Cash Flow formulas.  Let’s take your sample data: weekly yields of 7.44, 7.43 and 7.40.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$100 invested for a year at a yield of 7.44% will be worth 107.44 at the end of a year.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is 100 x (1.0744 ^ ( 365 / 365 )) = 107.44.&#xA;The rate of return for the year is 7.44%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value at the end of a week would be 100 x (1.0744 ^ ( 7 / 365 )) = 100.1377.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This translates to a weekly rate of return of 0.1377%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the weekly yield of 7.43% we have 100 x (1.0743 ^ ( 7 / 365)) = 100.1375. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a weekly rate of return of 0.1375%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the weekly yield of 7.40% we have 100 x (1.0740 ^ ( 7 / 365)) = 100.137. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, that is a weekly rate of return of 0.137%&lt;/p&gt;&#xA;" OwnerUserId="13260" LastEditorUserId="13260" LastEditDate="2014-10-13T19:21:15.790" LastActivityDate="2014-10-13T19:21:15.790" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15025" PostTypeId="2" ParentId="15019" CreationDate="2014-10-13T08:56:19.747" Score="2" Body="&lt;p&gt;It can be undone if you negotiate with the broker. There may or may not be a cost depending on how the broker manages their RUB book. That depends on (a) if they make their own prices, or (b) if they have a price provider whether (i) they cover their client positions immediately, or (ii) they build small client positions and cover later. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well, in this case you made a mistake (right or wrong) in the spread. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The cost of unwind is nothing if it's (a) and they make their own prices, because they simply give up the profit they would have made from you. If its (b)(i) then they can reverse their position at a more favourable spread than the spread you're given, but there's a cost for them. If it's (b)(ii) then they may be able to simply cancel your position at no cost, again giving up a hedging profit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It depends if they want you as a repeat client. In the interests of the long term relationship with you they ought to undo the trade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT1: on further questions it depends on the broker relationship with their own providers, and whether they can persuade their providers to unwind orders, positions or trades that result from a client mistake...&lt;/p&gt;&#xA;" OwnerUserId="7369" LastEditorUserId="7369" LastEditDate="2014-10-14T10:21:06.467" LastActivityDate="2014-10-14T10:21:06.467" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="15026" PostTypeId="2" ParentId="15001" CreationDate="2014-10-13T09:52:44.737" Score="3" Body="&lt;p&gt;Sure a lot of traditional (mutual) buy side funds use MPT. They also mostly subscribe to the efficient market hypotheses. And they also do not hide the fact that they have no interest to lobby many retirement investment and savings schemes to allow for long/short investments but hold on to long-only. And finally, most of them &lt;strong&gt;underperform&lt;/strong&gt; simple benchmark indexes  (probably around 70-80% of money invested underperforms indexes). See any correlation between above facts and the generated returns? Changes have to be driven by investors, changes will not originate from the fund side because the status quo earns them fat fees and they would otherwise have to hire a lot smarter analysts and PMs if they were suddenly benchmarked alongside long-short funds and against more suitable benchmarks in order to stem otherwise massive AUM outflows. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2014-10-13T15:01:21.507" LastActivityDate="2014-10-13T15:01:21.507" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15027" PostTypeId="1" AcceptedAnswerId="15029" CreationDate="2014-10-13T15:12:13.827" Score="1" ViewCount="171" Body="&lt;p&gt;I'm currently taking &lt;a href=&quot;https://class.coursera.org/fe1-001&quot; rel=&quot;nofollow&quot;&gt;this Coursera course&lt;/a&gt; on financial engineering, which is fine but it's very focused on applications instead of proofs. They recommend &lt;a href=&quot;http://smile.amazon.com/Investment-Science-David-G-Luenberger/dp/0195108094/ref=sr_1_1?ie=UTF8&amp;amp;qid=1413159554&amp;amp;sr=8-1&amp;amp;keywords=Investment+Science&quot; rel=&quot;nofollow&quot;&gt;Investment Science&lt;/a&gt; as a companion text, but some of the comments on Amazon seemed to indicate that this book also isn't very proof oriented. I've also heard of &lt;a href=&quot;http://smile.amazon.com/dp/0131499084/?tag=stackoverfl08-20&quot; rel=&quot;nofollow&quot;&gt;Options, Futures and Other Derivatives&lt;/a&gt; as a recommended text, but again the Amazon comments indicate that this might not be very rigorous.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any texts which require a similar amount of knowledge about finance but are more math focused? If it's relevant, my background is in pure math so I'm decently skilled mathematically but I may have forgotten some particulars about calculus and probability.&lt;/p&gt;&#xA;" OwnerUserId="5361" LastActivityDate="2014-10-13T19:38:48.147" Title="Proof oriented introductory text?" Tags="&lt;reference-request&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15028" PostTypeId="2" ParentId="15015" CreationDate="2014-10-13T16:05:49.590" Score="1" Body="&lt;p&gt;It may not be possible to compute returns solely on yields.  However, @Oleg has information on maturity (long term bonds, 20-30 years to maturity), and the YTM gives us a coupon for an &quot;on the run&quot; bond.  As a proxy for this bond group, you could use a bond with 25 years left to maturity with an annual coupon of 7.44, where today was the coupon date, and the coupon was paid.  The bond is valued at par to yield 7.44 as the YTM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use whatever software you like.&#xA;Using the Kona language from &lt;a href=&quot;https://github.com/kevinlawler/kona&quot; rel=&quot;nofollow&quot;&gt;https://github.com/kevinlawler/kona&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The stream of 25 future Cash Flows (CF) is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CF : ( 24 # 7.44 ), 107.44&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The timings of the future Cash Flows (TM) is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;TM : 1 + !25&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value of the bond today is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;+/ CF % 1.0744 ^ TM&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is 100.0&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value of the bond a week from now (when the YTM has changed to 7.43) is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;+/ CF % 1.0743 ^ TM - 7. % 365.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is 100.2499&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value of the bond 2 weeks from now (when the YTM has changed to 7.40) is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;+/ CF % 1.0740 ^ TM - 14. % 365.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is 100.7253&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rate of return for week 1 is (100 * -1 + 100.2499 % 100.0)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is 0.2499 percent&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rate of return for week 2 is (100 * -1 + 100.7253 % 100.2499)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is 0.4742 percent&lt;/p&gt;&#xA;" OwnerUserId="13260" LastEditorUserId="13260" LastEditDate="2014-10-13T23:17:10.340" LastActivityDate="2014-10-13T23:17:10.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15029" PostTypeId="2" ParentId="15027" CreationDate="2014-10-13T17:01:04.560" Score="7" Body="&lt;p&gt;The first book that comes to mind that is written in the style of Definition - Proposition - Proof is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Bjork - Arbitrage Theory in Continuous Time&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;It's pretty well written and can get quite technical. Probably a more common reference is the two-volume set:&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;Shreve - Stochastic Calculus for Finance I &amp;amp; II&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The first part deals with the binomial model, which is the technique used in the Coursera course. Usually when people mention Shreve they refer to the second part, which is a lot bigger and goes into the world of continuous time. You'll find that many Master's in quantitative finance or financial mathematics will incorporate one of these two books in their curriculum. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still, in both these books you will encounter plenty of examples where they do not go into more technical details. For that you could look at:&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;Karatzas, Shreve - Brownian motion and Stochastic Calculus&lt;/li&gt;&#xA;&lt;li&gt;Williams - Probability with Martingales&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;which is pretty much written for a math audience already. In particular, pretty much all mathematical results proven and not proven in the first two books I mention, are rigorously examined in Williams. On the other hand you will not learn anything financial from this book. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some other books worth mentioning:&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;5&quot;&gt;&#xA;&lt;li&gt;Joshi - The concept and practice of mathematical finance&lt;/li&gt;&#xA;&lt;li&gt;Neftci - An introduction to the mathematics of financial derivatives&lt;/li&gt;&#xA;&lt;li&gt;Baxter, Rennie - Financial Calculus&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3371" LastEditorUserId="3371" LastEditDate="2014-10-13T19:38:48.147" LastActivityDate="2014-10-13T19:38:48.147" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15030" PostTypeId="2" ParentId="15009" CreationDate="2014-10-13T17:09:52.360" Score="2" Body="&lt;p&gt;It might be more impressive to demonstrate that you have the tools and can use them.  Go to the interview with a handheld calculator.  The answer is a few keystrokes away.&lt;/p&gt;&#xA;" OwnerUserId="13260" LastActivityDate="2014-10-13T17:09:52.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15031" PostTypeId="2" ParentId="15019" CreationDate="2014-10-13T17:19:12.350" Score="3" Body="&lt;p&gt;If you're asking if you'd get your money back when spreads subside, you are basically asking [or hoping] whether the position will move in your direction. The short answer is probably yes (this pair has been in an uptrend for years), I would bet on up rather than down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/f2bvS.jpg&quot; alt=&quot;enter image description here&quot;&gt;However, this might not occur quickly enough, i.e. before you have to liquidate or lose your nerve. Have you been demo-trading this platform and this pair enough, before committing live funds? I suspect the answer is no. While there are obviously important differences between live and demo accounts, the latter have a lot to offer: tuition-free trading education! Take advantage of this opportunity thorougly. While it might not be enough (and certainly demo success does not ensure live success), it has huge value. For example, it might have prevented this incident, saving you USD $1200 in the process!&lt;/p&gt;&#xA;" OwnerUserId="11791" LastActivityDate="2014-10-13T17:19:12.350" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15034" PostTypeId="1" AcceptedAnswerId="15722" CreationDate="2014-10-13T23:00:46.297" Score="1" ViewCount="3640" Body="&lt;p&gt;how would you calculate the fair value of an option on a fx'ed underlying, e.g. a put on a USD-stock which is changed into EUR? How should I get, in practice, the fx spot vol/correl?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Purpose is to have a starting point when dealing with otc structuring desks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="1976" LastActivityDate="2014-12-02T04:47:07.137" Title="Price of a composite option" Tags="&lt;option-pricing&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15035" PostTypeId="1" CreationDate="2014-10-14T00:40:43.477" Score="2" ViewCount="241" Body="&lt;p&gt;I'm backtesting about 1k different strategies / permutations of strategies and I want to identify which if any of the strategies are better than the benchmark. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on my readings, I feel like I've narrowed it down to White's Reality Check and the Benjamini-Hochberg-Yekutielie Procedure (with c(M) set to 1). What are the pros/cons of the two approaches? Is one decidedly superior?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a better approach besides these two?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thnx&lt;/p&gt;&#xA;" OwnerUserId="12161" LastActivityDate="2014-10-14T19:20:47.257" Title="White's Reality Check versus Benjamini-Hochberg-Yekutielie Procedure" Tags="&lt;data-mining&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15037" PostTypeId="1" AcceptedAnswerId="15446" CreationDate="2014-10-14T05:27:16.510" Score="2" ViewCount="2112" Body="&lt;p&gt;This has been bugging me for a while. I've consulted all sorts of &lt;a href=&quot;http://www.investinganswers.com/financial-dictionary/financial-statement-analysis/earnings-share-eps-1003&quot; rel=&quot;nofollow&quot;&gt;guides&lt;/a&gt;, but none gave me a satisfactory answer. My question is: &lt;strong&gt;why do Earnings Per Share (EPS) matter&lt;/strong&gt;? What is it about this metric that gives it any weight? Why do analysts care about EPS?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a sample explanation that I found unsatisfactory:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;EPS is a carefully scrutinized metric that is often used as a barometer to gauge a company's profitability per unit of shareholder ownership. As such, earnings per share is a key driver of share prices. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I think that EPS is basically meaningless because the number of outstanding shares is variable. The company chooses how many shares of stock to issue. For example, Microsoft has about 8.24 billion shares outstanding, whereas Amazon has about 462 million shares outstanding. If there's a difference of an order of magnitude in the number of shares, then that's going to be reflected in EPS -- making raw EPS not very useful. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Granted, it might be useful to track EPS of a company over time, but as the number of shares issued is usually constant over long periods of time, that's effectively the same as tracking raw earnings. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, why is EPS regarded as an important metric?&lt;/p&gt;&#xA;" OwnerUserId="7460" LastActivityDate="2020-06-13T14:01:43.973" Title="Why do Earnings Per Share matter?" Tags="&lt;earnings&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15038" PostTypeId="1" CreationDate="2014-10-14T09:00:39.953" Score="1" ViewCount="96" Body="&lt;p&gt;I am wondering whether these two terms identify the same thing:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;overnight inventory&lt;/li&gt;&#xA;&lt;li&gt;end-of-day holdings&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The way I would explain it intuitively, the inventory that is held overnight should be identical to the holdings at the end of the day, for an individual trading account. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that is correct, I wonder whether, by extension, end-of-day net holdings could be referred to as net overnight inventory. &lt;/p&gt;&#xA;" OwnerUserId="7350" LastEditorUserId="7350" LastEditDate="2014-10-14T09:30:54.233" LastActivityDate="2014-12-14T10:40:00.327" Title="End-of-day holdings vs overnight inventory" Tags="&lt;trading&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15039" PostTypeId="2" ParentId="4410" CreationDate="2014-10-14T15:19:37.743" Score="0" Body="&lt;p&gt;Free sources of machine-readable news abound in the form of RSS or Atom XML feeds.  These formats are so popular that many of your favorite programming languages already have libraries that makes parsing them a plug-n-play task.  Here are a couple of big time feeds to get you started:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://feeds.bbci.co.uk/news/rss.xml&quot; rel=&quot;nofollow&quot;&gt;http://feeds.bbci.co.uk/news/rss.xml&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rss.msnbc.msn.com/id/3032091/device/rss/rss.xml&quot; rel=&quot;nofollow&quot;&gt;http://rss.msnbc.msn.com/id/3032091/device/rss/rss.xml&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rss.cnn.com/rss/cnn_topstories.rss&quot; rel=&quot;nofollow&quot;&gt;http://rss.cnn.com/rss/cnn_topstories.rss&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Feeds contain handy information such as title, time posted and often some summary of the content (first paragraph, first &lt;em&gt;n&lt;/em&gt; characters, full content, etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Feel free to contact me if you need further help with parsing.  I recently put together an aggregator of over 200 feeds for data mining, quants, stats and open data, so this is still fresh on my mind:&#xA;&lt;a href=&quot;http://quandl.io&quot; rel=&quot;nofollow&quot;&gt;Quandl.io&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6411" LastActivityDate="2014-10-14T15:19:37.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15040" PostTypeId="2" ParentId="15037" CreationDate="2014-10-14T18:54:31.550" Score="0" Body="&lt;p&gt;Yes, if the capital structure of a company were trivial and constant over time, then technically it would be enough to track earnings. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The per share basis is probably necessary to make a few metrics comparable when they are used together to compare investments. Since the main one, stock price, is per one share then it becomes necessary to adjust the raw earnings in a similar way, on per share basis.&lt;/p&gt;&#xA;" OwnerUserId="12031" LastActivityDate="2014-10-14T18:54:31.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15041" PostTypeId="2" ParentId="15035" CreationDate="2014-10-14T19:20:47.257" Score="1" Body="&lt;p&gt;White's approach estimates the dependence structure (simply speaking, the variance-covariance matrix) of the test statistics (such as t-values or p-values) that are used for deciding what strategy is superior. The estimation of the dependence structure is not explicit, but that's what happens during bootstrap or simulation. Typically, the amount of data is not enough to estimate it (think of how much data is required to estimate 1000*1000 variance-covariance matrix reliably) but as far as I know that problem is swept under the carpet in all of the papers of White and his followers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BH (1995) assumes that the p-values are iid U(0, 1) under the null hypothesis, with a couple of technical caveats that are not going to be of help to you. Then, they also followed the idea of White, i.e. tried working with dependent p-values via resampling in this paper &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Yekutieli, D., Benjamini, Y., 1999. Resampling-based false discovery rate&#xA;  controlling multiple test procedures for correlated test statistics. Journal of&#xA;  Statistical planning and inference, 1999&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;but the limitations of this approach are exactly the same as those of White. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would suggest using Efron's Fdr/fdr because, in a certain sense, it provides a viable solution when the test statistics are dependent, among other things. You can start with &lt;a href=&quot;http://statweb.stanford.edu/~ckirby/brad/papers/2004Selection.pdf&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt;, and the corresponding book can be found on Amazon. The locfdr package is no longer available in R, but I just downloaded and installed it separately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All of that being said, the ultimate test is seeing how the &quot;best&quot; strategy works out of sample.&lt;/p&gt;&#xA;" OwnerUserId="12031" LastActivityDate="2014-10-14T19:20:47.257" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15042" PostTypeId="2" ParentId="14998" CreationDate="2014-10-14T19:57:53.373" Score="0" Body="&lt;p&gt;My suggestion would be to use the actual (leveraged) position value, rather than the cost you paid to open the position. Then if you want, you can multiply the return on the position by your leverage, so you might see something like this (if I understood your question correctly):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Date    PnL      Begin      End     Return&#xA;4-Dec   -30      4000       3970    -75%&#xA;5-Dec   -10.01   3970       3959.99 -25%&#xA;6-Dec   -9       3959.99    3950.99 -23%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Having said that, hopefully you won't need this too much: you normally don't want to let your positions lose more than you had put into them!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, I hope this works for you. Good luck!&lt;/p&gt;&#xA;" OwnerUserId="11791" LastActivityDate="2014-10-14T19:57:53.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15043" PostTypeId="2" ParentId="14994" CreationDate="2014-10-14T23:14:41.370" Score="0" Body="&lt;p&gt;I have the answer, thanks to none other than Prof. Darrel Duffie, who points out the claim is for floating rate coupon rather than fixed one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the formulation. The coupon of a floating rate bond is the LIBOR rate paid  plus a spread. Let $B_i^j$ be the discount factor between time $t_i$ and $t_j$. The LIBOR rate between coupon date $i-1$ and $i$ is $l_i = \frac{1}{\delta_i}\big(\frac{1}{B_{i-1}^i}-1\big)$. Assume the short interest rate process $r$ is independent of the reference entity default time $\tau$. Using all the same notations as in the question, the par risky floating rate bond satisfies&#xA;\begin{align}&#xA;1 &amp;amp;= \mathbb E\Big[ \sum_i\delta_i (l_i+c)e^{-\int_0^{t_i}r }\mathbf 1_{\tau&amp;gt;t_i} \Big]+B(T)P(T)+R\int_0^T B(t)\mathrm d(-P(t)) \\&#xA; &amp;amp;= \sum_i (B_{i-1}-B_i+c\delta_iB_i)P_i+B(T)P(T)+R\int_0^T B(t)\mathrm d(-P(t)) \\&#xA; &amp;amp;= c\sum_i \delta_iB_iP_i+\sum_i (B_{i-1}-B_i)P_i+1-\int_0^T P(t)\mathrm d(-B(t))-L\int_0^T B(t)\mathrm d(-P(t)),&#xA;\end{align}&#xA;where the last equality stems from integration by parts, and $R$ is the recovery rate and $L$ the loss rate of the reference entity, and of course $R+L=1$. The CDS rate is still&#xA;$$s = \frac{L\int_0^T B(t)\mathrm d(-P(t))}{\sum_i \delta_iB_iP_i}.$$&#xA;Therefore&#xA;$$c-s = \frac{\int_0^T P(t)\mathrm d(-B(t))-\sum_i (B_{i-1}-B_i)P_i}{\sum_i \delta_iB_iP_i}.$$&#xA;The numerator is just the corresponding Riemann-Stieltjes integral in the question minus its approximating sum. Since $P$ increases with respect to $B$,&#xA;$$0\le \int_0^T P(t)\mathrm d(-B(t))-\sum_i (B_{i-1}-B_i)P_i \le \sum_i (B_{i-1}-B_i)(P_{i-1}-P_i).$$&#xA;Therefore $\max\limits_i(B_{i-1}-B_i)\searrow 0 \bigwedge \max\limits_i(P_{i-1}-P_i)\searrow 0 \Longrightarrow c-s\searrow 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In generally, for $a_i\ge 0$ and $b_i\ge 0,\ \forall i$, we have&#xA;\begin{align}&#xA;\Big( \sum_i a_ib_i\Big)^2 &amp;amp;= \Big(\sum_i (a_ib_i)^\frac{1}{2}a_i^\frac{1}{2}b_i^\frac{1}{2}\Big)^2 \\&#xA;&amp;amp;\le \sup\limits_i (a_ib_i)\Big(\sum_i a_i^\frac{1}{2}b_i^\frac{1}{2}\Big)^2 \\&#xA;&amp;amp;\le \sup\limits_i (a_ib_i)\sum_i a_i\sum_ib_i.&#xA;\end{align}&#xA;Therefore, we have stronger result from a weaker premise $\max\limits_i(B_{i-1}-B_i)(P_{i-1}-P_i)\searrow 0 \Longrightarrow c-s\searrow 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The difference $c-s$ could be large when either default density is large in some period or the interest rate changes dramatically.&lt;/p&gt;&#xA;" OwnerUserId="6686" LastEditorUserId="6686" LastEditDate="2014-10-16T18:15:50.787" LastActivityDate="2014-10-16T18:15:50.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15044" PostTypeId="2" ParentId="15009" CreationDate="2014-10-14T23:55:58.620" Score="1" Body="&lt;p&gt;consider your bond initially was at par (cpn=3%~=yld_0) and now answer the question what is the price change given new yld_1=9%. for a very dirty estimate use relationship between price change vs yield change and duration (~=10).for a less dirty estimate you'll need some educated guess on the level of convexity. have a look at closed formula of convexity of par bond. hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="13279" LastActivityDate="2014-10-14T23:55:58.620" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15045" PostTypeId="1" CreationDate="2014-10-15T07:51:07.583" Score="7" ViewCount="406" Body="&lt;p&gt;I would like to know if there exists some computer algebra systems adapted to calculate pricing based on particular models, i.e. pricing YoY Inflation Swap under &lt;a href=&quot;http://www.fabiomercurio.it/Inflation.pdf&quot; rel=&quot;nofollow&quot;&gt;Jarrow Yildirim Model&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that the results are known and showed in books such as Brigo &amp;amp; Mercurio, but I would like to be able to reproduce the results using some code in order to avoid stupid typos in mathematical passages.&lt;/p&gt;&#xA;" OwnerUserId="4979" LastEditorUserId="467" LastEditDate="2014-10-16T00:52:21.903" LastActivityDate="2014-10-16T00:52:21.903" Title="What is a good Computer Algebra System for financial engineering?" Tags="&lt;programming&gt;&lt;stochastic-calculus&gt;&lt;pricing-formulae&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15046" PostTypeId="2" ParentId="15038" CreationDate="2014-10-15T08:21:26.877" Score="1" Body="&lt;p&gt;It appears that these are actually all the same thing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;overnight inventory, end-of-day holdings, end-of-day net position, it all identifies the same thing. The different terminology arises from how, technically, an account's inventory is reconstructed using order book message data. However, they all identify the inventory at market close, i.e. the overnight inventory.&lt;/p&gt;&#xA;" OwnerUserId="7350" LastEditorUserId="7350" LastEditDate="2014-10-15T10:12:58.100" LastActivityDate="2014-10-15T10:12:58.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15047" PostTypeId="2" ParentId="15045" CreationDate="2014-10-15T08:36:42.240" Score="2" Body="&lt;p&gt;I am rather a fan of mathematical/statistical software for doing numerical finance (R/Matlab).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But returning to your question:&#xA;The commercial software &lt;a href=&quot;http://www.unrisk.com/&quot; rel=&quot;nofollow&quot;&gt;UNRISK&lt;/a&gt; is based on &lt;a href=&quot;http://www.wolfram.com/mathematica/&quot; rel=&quot;nofollow&quot;&gt;mathematica&lt;/a&gt;, a computer algebra system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually you can use the Unrisk functions right in mathematica and price financial derivatives there. There also exists Jave interfaces if you want to use these functions outside of mathematica.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-10-15T08:36:42.240" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15050" PostTypeId="2" ParentId="14998" CreationDate="2014-10-15T10:21:42.603" Score="1" Body="&lt;p&gt;Use your total wealth allocated to the trades as denominator. Total wealth allocated would include all collateral. In this way you (or your broker) make sure that the denominator is always positive. Presumably this would also reflect what you really want to track. The only problem that remains is what amount of your wealth needs to be allocated. But this is something you probably have decided anyway before you started trading. &lt;/p&gt;&#xA;" OwnerUserId="482" LastActivityDate="2014-10-15T10:21:42.603" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15052" PostTypeId="1" CreationDate="2014-10-15T13:20:39.293" Score="2" ViewCount="172" Body="&lt;p&gt;Different asset classes have different important news announcements that move the markets intraday. For instance, oil volatility increases after the EIA Petroleum Status Report, but that announcement has little impact on other markets. Treasuries respond to auction result announcements. Almost everything increases volatility in response to unemployment news.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I'm having trouble finding what news announcements have the most impact on agricultural commodities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any place that shows a list of what numbers most affect which markets?&lt;/p&gt;&#xA;" OwnerUserId="5251" LastActivityDate="2019-01-10T14:18:49.617" Title="Where can I find a list of market-moving news announcements for different asset classes?" Tags="&lt;volatility&gt;&lt;futures&gt;&lt;intraday&gt;&lt;news&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15053" PostTypeId="2" ParentId="14988" CreationDate="2014-10-15T13:22:06.907" Score="1" Body="&lt;p&gt;It is not completely clear to me which question you are asking: is it &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I have fundamental data, now how do I translate that into&#xA;  risk-adjusted return?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;or is it &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I have a model that translates into risk adjusted returns, now how do&#xA;  I allocate funds to each currency pair?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you are asking the first question, you will need to provide more details (i.e. which fundamental data you have, other than GDP growth rates), in order to get any sort of answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are asking the second question, Modern portfolio theory (MPT) could probably give you good answers regarding how much to allocate to each pair, given expected return and variance.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If I may ask out of curiosity: is this a theoretical exercise or for practical application? &lt;/p&gt;&#xA;" OwnerUserId="11791" LastActivityDate="2014-10-15T13:22:06.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15054" PostTypeId="2" ParentId="15052" CreationDate="2014-10-15T20:15:35.323" Score="2" Body="&lt;p&gt;How about:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Barnhart, Scott W. &quot;The effects of macroeconomic announcements on commodity prices.&quot; American Journal of Agricultural Economics 71.2 (1989): 389-403.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This article analyzes the immediate reaction of a representative sample of commodity prices and two T-bill yields to the unanticipated components of thirteen macroeconomic announcements. Surprises in the monetary variables cause the majority of the significant commodity price responses; while these plus other cyclical surprises, such as the unemployment rate, cause significant lumber and T-bill reactions. The results provide strong support for the policy anticipations hypothesis and against the inflationary expectations hypothesis, i.e., that monetary surprises cause changes in real interest rates rather than in nominal rates only as the inflationary expectations hypothesis contends.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;SSRN: &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1482028&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1482028&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7350" LastActivityDate="2014-10-15T20:15:35.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15056" PostTypeId="1" CreationDate="2014-10-15T22:04:06.700" Score="3" ViewCount="117" Body="&lt;p&gt;i have seen Brent oil future singapore marker many times. however, i wonder what is the reason for introducing different markers in the future market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.prnewswire.com/news-releases/ice-futures-europe-announces-markers-for-singapore-oil-market-61840187.html&quot; rel=&quot;nofollow&quot;&gt;FYI - LINK&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12088" LastActivityDate="2017-12-08T18:23:51.247" Title="ICE oil Future Markers" Tags="&lt;futures&gt;&lt;commodities&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15060" PostTypeId="1" AcceptedAnswerId="15404" CreationDate="2014-10-16T14:13:26.287" Score="1" ViewCount="721" Body="&lt;p&gt;I would like to know some references regarding importance sampling algorithms for variance reduction of Monte Carlo barrier options pricing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please could someone help me leaving some references? If you wish to give an answer explaining/giving some hints on how to approach the variance reduction problem of barrier options Monte Carlo, it would be even better. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks&lt;/p&gt;&#xA;" OwnerUserId="3534" LastActivityDate="2014-11-10T21:27:11.050" Title="Importance sampling for barrier option like pricing by Monte carlo" Tags="&lt;monte-carlo&gt;&lt;reference-request&gt;&lt;algorithm&gt;&lt;barrier&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15061" PostTypeId="2" ParentId="15056" CreationDate="2014-10-16T16:28:16.253" Score="1" Body="&lt;p&gt;Because exchanges believe there is enough demand for market participants to generate meaningful profits for them.&lt;/p&gt;&#xA;" OwnerUserId="11851" LastActivityDate="2014-10-16T16:28:16.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15062" PostTypeId="1" CreationDate="2014-10-16T18:10:08.163" Score="1" ViewCount="122" Body="&lt;p&gt;I am trying to teach myself about MPT and optimization.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that MPT solutions can be found using three equivalent optimization problems:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Minimizing variance for given return limit&lt;/li&gt;&#xA;&lt;li&gt;Maximizing return for given variance limit&lt;/li&gt;&#xA;&lt;li&gt;Unconstrained minimization of linear combination of variance and return with a risk parameter.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;My question is, how do I show algebraically the equivalence of these optimization problems?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. given:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$max\, \,x^T\mu \\&#xA; s.t.\,\,x^T\Sigma x\le\sigma_*^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I get to this algebraically:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$min\,\,1/2 x^T\Sigma x-\gamma x^T\mu$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And how do I show that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\gamma = \sigma_* / (\mu^T\Sigma\mu)^{(-1/2)} $ &lt;/p&gt;&#xA;" OwnerUserId="12227" LastEditorUserId="12227" LastEditDate="2014-10-16T18:15:34.973" LastActivityDate="2014-10-16T18:15:34.973" Title="Transform MPT optimization problem" Tags="&lt;optimization&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;&lt;mean-variance&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15063" PostTypeId="2" ParentId="15060" CreationDate="2014-10-16T19:47:26.390" Score="2" Body="&lt;p&gt;I'd recommend M. Joshi and T. Leung &quot;&lt;a href=&quot;http://fbe.unimelb.edu.au/__data/assets/pdf_file/0003/806250/141.pdf&quot; rel=&quot;nofollow&quot;&gt;Using Monte Carlo simulation and importance sampling to rapidly obtain jump-diffusion prices of continuous barrier options&lt;/a&gt;&quot;.&#xA;Though it assumes jump-diffusion process for the returns it is straightforward to obtain the scheme for a diffusion process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also Paul Glasserman's [book][2] &lt;/p&gt;&#xA;&#xA;&lt;p&gt;[2]: &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0387004513&quot; rel=&quot;nofollow&quot;&gt;http://www.amazon.com/Financial-Engineering-Stochastic-Modelling-Probability/dp/0387004513&lt;/a&gt; contains a variance reduction example for barrier options.&lt;/p&gt;&#xA;" OwnerUserId="3582" LastActivityDate="2014-10-16T19:47:26.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15064" PostTypeId="2" ParentId="2870" CreationDate="2014-10-17T00:39:24.270" Score="2" Body="&lt;p&gt;Simple, if you're investing in Equities, you have a negative skew, decrease the variance and that will decrease the number of hits you take. Returns are on a log normal scale so, if you have two equal but opposite moves you will still be down money. E.g. If I have 100 dollars and I lose ten percent and then make ten percent, I will still be down one percent. &lt;/p&gt;&#xA;" OwnerUserId="13293" LastActivityDate="2014-10-17T00:39:24.270" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15065" PostTypeId="1" CreationDate="2014-10-17T01:03:16.137" Score="2" ViewCount="72" Body="&lt;p&gt;Suppose I have a single time series of losses $L$ that consists of two sub-parts $L_1$ and $L_2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a relationship that relates the expected shortfall of $L$ to the expected shortfall of $L_1, L_2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;{\rm{L = }}\left[ {\begin{array}{*{20}{c}}&#xA;{{L_{1,T_1}}}\\&#xA;{{L_{2,T}}}&#xA;\end{array}} \right]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know that $T_1&amp;lt;T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any reference is much appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Inequalities are fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets make it simpler. What if I assume that that $L_1, L_2\sim\mathcal{N}(\mu,\sigma^2)$ and $L\sim\mathcal{N}(\mu_1,\sigma_1,\mu_2,\sigma_2,w_1)$ (Bivariate Normal Mixture). Then based on Broda and Paolella (2011), I know that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{array}{c}&#xA;{w_1} + {w_2} = 1\\&#xA;{F_L}\left( x \right) = {w_1}\Phi \left( {\frac{{x - {\mu _1}}}{{{\sigma _1}}}} \right) + {w_2}\Phi \left( {\frac{{x - {\mu _2}}}{{{\sigma _2}}}} \right)\\&#xA;{F_L}\left( q \right) = 1 - \alpha \\&#xA;E{S_\alpha }\left( L \right) = {w_1}\frac{{\Phi \left( {\frac{{q - {\mu _1}}}{{{\sigma _1}}}} \right)}}{{1 - \alpha }}\left( {{\mu _1} - {\sigma _1}\frac{{\phi \left( {\frac{{q - {\mu _1}}}{{{\sigma _1}}}} \right)}}{{\Phi \left( {\frac{{q - {\mu _1}}}{{{\sigma _1}}}} \right)}}} \right) + {w_2}\frac{{\Phi \left( {\frac{{q - {\mu _2}}}{{{\sigma _2}}}} \right)}}{{1 - \alpha }}\left( {{\mu _2} - {\sigma _2}\frac{{\phi \left( {\frac{{q - {\mu _2}}}{{{\sigma _2}}}} \right)}}{{\Phi \left( {\frac{{q - {\mu _2}}}{{{\sigma _2}}}} \right)}}} \right)\\&#xA; = {w^*}_1E{S_\alpha }\left( {{L_1}} \right) + {w^*}_2E{S_\alpha }\left( {{L_2}} \right)&#xA;\end{array}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even with simplistic assumptions, it depends on the weights in which I combine the 2 distributions in the mixture&lt;/p&gt;&#xA;" OwnerUserId="2142" LastEditorUserId="2142" LastEditDate="2014-10-18T13:09:11.100" LastActivityDate="2014-10-18T13:09:11.100" Title="What are the properties of the Expected Shortall measure when split in multiple time periods?" Tags="&lt;time-series&gt;&lt;risk&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15066" PostTypeId="1" AcceptedAnswerId="15072" CreationDate="2014-10-17T01:31:22.967" Score="1" ViewCount="1749" Body="&lt;p&gt;I am wondering why most online brokers restrict multi-legged options spread trades to have a maximum of four legs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, is there a broker that allows you to trade say 6 or 8 legged option spreads.&lt;/p&gt;&#xA;" OwnerUserId="13294" LastEditorUserId="467" LastEditDate="2014-10-17T03:30:49.837" LastActivityDate="2018-09-06T12:52:31.363" Title="Can we trade option spreads with more than 4 option legs?" Tags="&lt;options&gt;&lt;spread-options&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15067" PostTypeId="2" ParentId="15065" CreationDate="2014-10-17T03:18:32.353" Score="1" Body="&lt;p&gt;I don't think you can say anything general on this type of setup, certainly not from an empirical point of view. Assume the market conditions change between the two periods, then $ES$ could be higher or lower.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you assume some distribution for you returns, then they should probably be the same if the two periods have the same length.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2014-10-17T03:18:32.353" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15068" PostTypeId="2" ParentId="15066" CreationDate="2014-10-17T12:26:12.083" Score="0" Body="&lt;p&gt;Multi-Leg options are just combinations of vanilla options. So you can combine two 4-leg spreads to an 8-leg spread and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think they offer at most 4 legs because it is the most bought option. I dont see a reasonable trading strategy involving 5 or more legs.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-10-17T12:26:12.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15069" PostTypeId="1" CreationDate="2014-10-17T13:51:04.463" Score="0" ViewCount="175" Body="&lt;p&gt;I'm attaching stock prices from CRSP to a dataset of option prices in order to compute the option moneyness.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm wondering whether I should adjust the underlying prices taking into account splits and dividend payments?&lt;/p&gt;&#xA;" OwnerUserId="13296" LastActivityDate="2014-12-27T17:05:16.057" Title="Moneyness and option prices" Tags="&lt;options&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15070" PostTypeId="2" ParentId="14986" CreationDate="2014-10-17T14:17:54.330" Score="4" Body="&lt;p&gt;Position here is the residual amount of one or other currency at the end:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You gave us:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Time | Amount |   Rate |&#xA;  t1      100   1.2636&#xA;  t2    -1000   1.2599&#xA;  t3      200   1.1612&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Assuming the Amount is amount paid in USD, and the rate is EUR/USD:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Time | Amount |  Rate  |  EUR balance | USD balance&#xA; t0                           0             0 &#xA; t1       100   1.2636       79.139      -100&#xA; t2     -1000   1.2599     -714.575       900 &#xA; t3       200   1.1612     -542.339       700&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So this book is now net long of USD, short of EUR, compared to t0. If we calculate our PnL using the current spot rate (1.2762), the EUR side is worth -\$692.13, leaving a &lt;strong&gt;net profit of \$7.87.&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2014-10-17T14:17:54.330" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15071" PostTypeId="1" AcceptedAnswerId="15105" CreationDate="2014-10-17T16:50:44.700" Score="7" ViewCount="2910" Body="&lt;p&gt;We see in the market that a implied volatility surface is not flat. Based on this observation different models were developed to capture the structure, e.g. CEV / SABR. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A measure often used for the skew is a risk reversal, i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma_{25,c}-\sigma_{25,p}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and butterfly&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\sigma_{25,c}+\sigma_{25,p}}{2}-\sigma_{ATM}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\sigma_{25,c}$ is the implied volatility of $25$ delta call. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at the skew, you are interested in the slope an curvature. The mathematical objects would be for the slope of a function $f$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{f(x+h)-f(x)}{h}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and for the curvature&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{f(x+h)-2f(x)+f(x-h)}{h^2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So why are the above measure (RR and BF) not constructed like this? Should they be seen as an approximation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, why is it common to just look at a specific RR / BF, 25 for example. Wouldn't it be more reasonable to calculate these measure for every strike (in delta measured) on the grid? Obviously the slope and curvature can change as for different deltas.&lt;/p&gt;&#xA;" OwnerUserId="17133" LastEditorUserId="17133" LastEditDate="2014-10-18T17:54:47.047" LastActivityDate="2015-06-22T22:08:18.150" Title="Volatility skew and how to capture it?" Tags="&lt;volatility-smile&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15072" PostTypeId="2" ParentId="15066" CreationDate="2014-10-17T18:04:24.277" Score="3" Body="&lt;p&gt;The issue is what exchanges recognize as acceptable complex option orders. This is governed by FINRA margin rules like &lt;a href=&quot;http://finra.complinet.com/en/display/display.html?rbid=2403&amp;amp;element_id=9383&quot; rel=&quot;nofollow&quot;&gt;rule 4210&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Brokers can only execute orders that are recognized by options exchanges. So what brokers can put on a single order ticket is limited. The most complex spreads defined by FINRA rules would be &lt;a href=&quot;http://optionsforum.net/topic/81/butterfly-options-strategy-in-depth&quot; rel=&quot;nofollow&quot;&gt;butterfly spreads&lt;/a&gt;, box spreads and possibly condors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly you can build as complex options positions as you wish but you would have to leg in/out of those.&lt;/p&gt;&#xA;" OwnerUserId="7973" LastActivityDate="2014-10-17T18:04:24.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15073" PostTypeId="2" ParentId="15071" CreationDate="2014-10-17T20:50:31.700" Score="0" Body="&lt;p&gt;RR and Bfly are market traded instruments in FX. They give pillar points which are then used to make the volatility skew/smile curve by interpolation. There are various methods of interpolation like, cubic spline, SVI,SABR.&lt;/p&gt;&#xA;" OwnerUserId="13291" LastActivityDate="2014-10-17T20:50:31.700" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15074" PostTypeId="1" CreationDate="2014-10-18T01:39:44.803" Score="3" ViewCount="4875" Body="&lt;p&gt;Would anyone happen to know where I can find historical forward exchange rate data between the yen and dollar? &lt;/p&gt;&#xA;" OwnerUserId="13298" LastActivityDate="2015-05-29T12:02:44.180" Title="Historical Data on $/yen forward exchange rates" Tags="&lt;data&gt;&lt;fx&gt;&lt;futures&gt;" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15075" PostTypeId="2" ParentId="8943" CreationDate="2014-10-18T05:57:02.820" Score="0" Body="&lt;p&gt;I've often thought about the same thing.  To try and figure out some concrete (in my opinion) information about a stock or mutual fund, I wrote something in Python to simulate:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;buying stock at some interval&lt;/li&gt;&#xA;&lt;li&gt;stock paying dividend at some interval&lt;/li&gt;&#xA;&lt;li&gt;adjusting returns for inflation&lt;/li&gt;&#xA;&lt;li&gt;subtracting out fees (if a mutual fund or something with an expense ratio)&lt;/li&gt;&#xA;&lt;li&gt;do this 100 or many more times for a given time period and see what you get &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I've found some gems (so far) using this method.  Long term reliably good returns over most any period in time (so far) seems to be a pretty legit way to look at things.  I usually will look at thousands of them and pick ones with good, 5, 10, 15 good return results.  Plotting these things on a scatter plot is very helpful to see how you'd have fared at any randomly selected time in the past if you make it for some stock you are interested in.  &lt;/p&gt;&#xA;" OwnerUserId="9494" LastActivityDate="2014-10-18T05:57:02.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15076" PostTypeId="1" CreationDate="2014-10-18T13:21:33.310" Score="1" ViewCount="215" Body="&lt;p&gt;I'm using an Excel DDE to connect to Interactive Brokers TWS via their API 9.72 sample, excel 2013. When I tried to create a combo order, the rum error code 424 said &quot;object required&quot;. It seems that something is wrong with the &quot;ComboLegForm&quot; Userform. The code is too long to paste here, and I don't find anywhere I can attach the file. The xls file is located in TWSAPI/samples/Excel/TwsDde.xls&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for helping.&lt;/p&gt;&#xA;" OwnerUserId="11873" LastActivityDate="2014-10-18T13:21:33.310" Title="run time error 424 in IB TWS Excel DDE API; failed to add combo orders" Tags="&lt;interactive-brokers&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15077" PostTypeId="2" ParentId="14766" CreationDate="2014-10-18T15:05:13.797" Score="5" Body="&lt;p&gt;It is useful in risk reports because it tells a trader the interest rate risk of each bond in his portfolio. A trader then only needs to multiply the duration by the expected yield change to calculate the price change. Scenario analysis is then easier. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hedging a bond portfolio with duration measures is common. But as these must rely on the assumption that the yield of the bond portfolio being hedged moves by the same amount as the yield of the hedging bond, it is important to choose a hedge bond with a maturity as close to that of the bond portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For standard bullet bonds (ones with fixed regular coupons) the duration can be calculated analytically by taking the derivative of the price yield formula. This makes it faster to calculate than doing two price calculations and calculating the numerical derivative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One widely used measure is the modified duration which is equal to &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Modified Duration -$\frac{1}{P} \frac{\partial P}{\partial y}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It calculates the percentage change in the bond price and so needs to be multiplied by the price to get the implied absolute price change sensitivity. This quantity is known as the dollar duration &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dollar Duration = $\frac{\partial P}{\partial y}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A similar measure called the DV01 is the change in the price of the bond for a 1 basis point increase in the bond yield. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;DV01 = $P(y+1bp)-P(y)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Traders use ratios of the DV01 to calculate hedging amounts. It assumes implicitly the typical moves over the typical period between re-hedges are around 1bp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More sophisticated bond traders avoid yield based risk measures and instead look at sensitivities to a zero rate which captures the term structure, i.e. measures that do not assume a constant reinvestment rate. The value of the zero rate changes depending on the payment time of each cash flow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For large interest rate movements it becomes important to consider the curvature of the price-yield relationship. This can be done by expanding the price yield relationship to second order, which means calculating the convexity term.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, some practitioners move beyond duration all together and use parametric models of the zero curve and hedge with respect to linear factors. The best known is the Nelson-Siegel model.&lt;/p&gt;&#xA;" OwnerUserId="12240" LastEditorUserId="12240" LastEditDate="2016-09-25T09:40:55.280" LastActivityDate="2016-09-25T09:40:55.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15078" PostTypeId="1" CreationDate="2014-10-18T19:44:51.003" Score="3" ViewCount="2028" Body="&lt;p&gt;I am not looking for your winning strategies. Just the basic stuff from where to start. Can anyone share their opinions about what should I read to hit the ground running?&lt;/p&gt;&#xA;" OwnerUserId="12234" LastEditorUserId="46762" LastEditDate="2020-05-03T08:02:56.283" LastActivityDate="2020-05-03T08:02:56.283" Title="What literature (books, articles, etc.) should someone hoping to learn basic HFT / arbitrage strategies read first?" Tags="&lt;high-frequency&gt;&lt;arbitrage&gt;&lt;books&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="5" ClosedDate="2014-10-20T07:33:34.347" ContentLicense="CC BY-SA 4.0" />
  <row Id="15079" PostTypeId="2" ParentId="15078" CreationDate="2014-10-18T21:02:21.933" Score="3" Body="&lt;p&gt;Many of the strategies are motivated by objective functions (contour integrals) in the complex plane and the elements of complex linear spaces, so I'd recommend at least for an applied understanding:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Saff, E. B., and Snider, A. D. Fundamentals of Complex Analysis with Applications to Engineering, Science and Mathematics.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In addition to Saff and Snider, I recommend you take a look at Stony Brook's &lt;a href=&quot;http://www.ams.sunysb.edu/graduate/grad/AMS523Webpage.html&quot; rel=&quot;nofollow&quot;&gt;AMS 523, Mathematics of High Frequency Finance course&lt;/a&gt; gives a good outline which includes Banach spaces, Cauchy theory, residue calculus, the Cauchy-Riemann equations, all of which are extremely important in the groundwork for a HFT strategy in the equities space. Note however that these classes of strategies are probably most perfected at SocGen/Latour (Tower Research) though, who have refined them thoroughly over the years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also central to HFT is the construction of abstract measures, Hilbert space and positive functionals, and the Lebesgue-Radon-Nikodym theorem is an important milestone. I like Terry Tao's excursion into measure theory, followed by Rudin's attack on the LRN theorem. Rudin's approach is particularly elegant if you pick up from the Riesz representation theorem from Riesz and Nagy's exposition directly:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Tao, T. An Introduction to Measure Theory.&lt;/li&gt;&#xA;&lt;li&gt;Riesz, F.,and  Sz.-Nagy, B. Functional Analysis.&lt;/li&gt;&#xA;&lt;li&gt;Rudin, W. Real and Complex Analysis.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;There's important analogs between statistics and algebraic topology, and it should also come as no surprise that the team that wrote Reflex at GETCO (before they merged with KCG) included several PhDs on algebraic topology, and several of them later left to expand that work at Citadel Securities:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;May, J. P. Differential Forms in Algebraic Topology&lt;/li&gt;&#xA;&lt;li&gt;Bott, R. A Concise Course in Algebraic Topology&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Complex manifold theory, schemes, algebraic affine and projective curves and varieties, and in general the solutions of discrete-time polynomial equations are a common issue if you're modeling high-frequency tick data. Renaissance Technologies and Two Sigma have locked in several of the leading researchers in this space at Harvard's physics department plus several of Zariski/Mumford's former students and have been refining this space of strategies for several years already. If that doesn't deter you from trying, these are the classical references in algebraic geometry:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Hartshorne, R. Algebraic Geometry.&lt;/li&gt;&#xA;&lt;li&gt;Griffiths, P., and Harris, J. Principles of Algebraic Geometry&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Gathmann's course at the University of Kaiserlautern had very &lt;a href=&quot;http://www.mathematik.uni-kl.de/~gathmann/class/alggeom-2002/main.pdf&quot; rel=&quot;nofollow&quot;&gt;well-written course notes&lt;/a&gt; that I found particularly useful when I had to learn algebraic geometry from scratch in my first 3-6 months at a HFT shop.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly, I cannot emphasize enough the importance of renormalization, conformal field theory and gauge theory. This is the primary reason why the HFT teams (DRW, SIG equities etc.) are staffed mostly by physics PhDs rather than applied math PhDs, because it's a natural development before coursework in quantum field theory. Deligne's book was my favorite:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Deligne, P. Quantum Fields and Strings&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Of particular importance is the range of topological field theories that relate to Chern-Simons theory (half-named after Jim Simons from Rentec) and the Dijkgraaf-Witten theory. Sati and Schreiber also have a wonderful collection of the &lt;a href=&quot;http://arxiv.org/pdf/1109.0955v2.pdf&quot; rel=&quot;nofollow&quot;&gt;latest developments and literature in this area&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2014-10-18T21:02:21.933" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15080" PostTypeId="2" ParentId="15074" CreationDate="2014-10-18T21:09:32.593" Score="1" Body="&lt;p&gt;Actually for the forward rates you would need to subscribe to a financial datafeed like Bloomberg, Thomson Reuters Datastream or Interactive Data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the current forward rates you could look it up at here &lt;a href=&quot;http://www.fxstreet.com/rates-charts/forward-rates/?id=usd%2fjpy&quot; rel=&quot;nofollow&quot;&gt;http://www.fxstreet.com/rates-charts/forward-rates/?id=usd%2fjpy&lt;/a&gt;, the data are provided by Interactive Data.&lt;/p&gt;&#xA;" OwnerUserId="7693" LastActivityDate="2014-10-18T21:09:32.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15081" PostTypeId="1" AcceptedAnswerId="15084" CreationDate="2014-10-18T23:22:20.650" Score="0" ViewCount="125" Body="&lt;p&gt;I'm aware of the the mathematical formula for the price of a European call option on a stock however I'd like to think about it in an intuitive way.&lt;/p&gt;&#xA;" OwnerUserId="13303" LastActivityDate="2014-10-19T22:05:24.317" Title="Briefly stated, why does the function N(x) appear in the European call option pricing model?" Tags="&lt;black-scholes&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15082" PostTypeId="1" AcceptedAnswerId="15087" CreationDate="2014-10-19T05:14:13.130" Score="-1" ViewCount="406" Body="&lt;p&gt;Let's assume I found the holy grail of low-latency trading (which I didn't). For educational purposes, what would be the first strategy I would direct my trading code?&lt;/p&gt;&#xA;" OwnerUserId="12234" LastActivityDate="2014-10-19T19:54:40.280" Title="If I am very fast (less than 10 microseconds latency) what would be the first strategy to execute?" Tags="&lt;arbitrage&gt;&lt;pairs-trading&gt;&lt;latency&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2014-10-22T01:55:10.153" ContentLicense="CC BY-SA 3.0" />
  <row Id="15084" PostTypeId="2" ParentId="15081" CreationDate="2014-10-19T13:59:10.300" Score="4" Body="&lt;p&gt;It is because Black and Scholes assume that the stock follows a geometric brownian motion, i.e. under the historical probability $\mathbb{P}$ the stock moves according to:&#xA;$$&#xA;\frac{dS(t)}{S(t)} = \mu dt + \sigma dW^{\mathbb{P}}(t)&#xA;$$&#xA;Solving this SDE we obtain that&#xA;$$&#xA;S(t)=S(0)e^{(\mu - \frac{1}{2}\sigma^2)t + \sigma W^{\mathbb{P}}(t)} = S(0)e^{(\mu - \frac{1}{2}\sigma^2)t + \sigma \sqrt{t} z}&#xA;$$&#xA;where $z \sim N(0,1)$.&#xA;Thanks to Girsanov's theorem we can show that under the risk neutral measure, the stock still follows a Brownian Motion, in particular it can be shown that under $\mathbb{Q}$ the stock price follows&#xA;$$&#xA;S(t)=S(0)e^{(r-\frac{1}{2}\sigma^2)t + \sigma W^{\mathbb{Q}}(t)} = S(0)e^{(r - \frac{1}{2}\sigma^2)t + \sigma \sqrt{t} z}&#xA;$$&#xA;It can be shown that the price of an option should be equal to the expected value under the risk neutral measure ($\mathbb{Q}$) of the discounted payoff at expiration, i.e.&#xA;$$&#xA;c(S,t) = \mathbb{E}_t^{\mathbb{Q}}[(S(T) - K)^+ e^{-r(T-t)}]&#xA;$$&#xA;Now, take the expected value:&#xA;$$&#xA;c(s,t)= \mathbb{E}_t^{\mathbb{Q}}[(S(T) - K)^+ e^{-r(T-t)}] = \int_{S(T)&amp;gt;K}(S(T)-K)e^{-r(T-t)}\frac{1}{\sqrt{2\pi}}e^{-\frac{z^2}{2}}dz =&#xA;$$&#xA;$$&#xA;= \int_{S(T)&amp;gt;K}(S(t)e^{(r - \frac{1}{2}\sigma^2)(T-t) + \sigma \sqrt{T-t} z}-K)e^{-r(T-t)}\frac{1}{\sqrt{2\pi}}e^{-\frac{z^2}{2}}dz =$$&#xA;$$= S(t)N(d_1) - Ke^{-r(T-t)}N(d_2)&#xA;$$&#xA;where&#xA;$$&#xA;d_1=\left[ln\frac{S(t)}{K} + (r-\frac{\sigma^2}{2}(T-t))\right]\frac{1}{\sigma\sqrt{T-t}}&#xA;$$&#xA;$$&#xA;d_2= d_1 - \sigma\sqrt{T-t}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice that $d_1$ just indicates the cutoff for z s.t. S(T) &gt; K, i.e. where the option closes in the money. &#xA;Summarizing, the normal cdf simply derives from the assumption of a stock diffusing like a geometric brownian motion both under the historical and the risk-neutral probability measure.&lt;/p&gt;&#xA;" OwnerUserId="8028" LastEditorUserId="8028" LastEditDate="2014-10-19T22:05:24.317" LastActivityDate="2014-10-19T22:05:24.317" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15085" PostTypeId="2" ParentId="14972" CreationDate="2014-10-19T15:01:05.510" Score="2" Body="&lt;p&gt;They are correlated because they share a common factor, namely expectations of future economic growth.  Using the framework of a discounted cash flow valuation approach; the higher cash flows resulting from higher expected growth, more than compensates for the increase in the discount rate, hence a positive correlation.  Periods of high inflation or deflation can break this however, as can QE.&lt;/p&gt;&#xA;" OwnerUserId="3297" LastActivityDate="2014-10-19T15:01:05.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15087" PostTypeId="2" ParentId="15082" CreationDate="2014-10-19T16:57:30.840" Score="3" Body="&lt;p&gt;Being very fast within a single datacenter is not as valuable as having the fastest line between two datacenters.  So being able to write a very fast program wouldn't be the holy grail of trading anyway (it would be to instantaneously transport information between e.g. NJ and Chicago using quantum entanglement or something.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, if you found an imaginary way to write a program that has &lt;em&gt;zero&lt;/em&gt; latency, I would point it toward capturing arbitrage opportunities available within a single datacenter. One example is that on exchanges that list both futures and options on those futures, pure arbitrage opportunities can be available to whoever is fastest to capture them (i.e. violations of put-call parity and variations on that).&lt;/p&gt;&#xA;" OwnerUserId="1712" LastActivityDate="2014-10-19T16:57:30.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15089" PostTypeId="1" CreationDate="2014-10-19T23:54:37.760" Score="1" ViewCount="204" Body="&lt;p&gt;VaR seems like such an obviously flawed metric, I am surprised that it seems to be used so much in the private sector. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, the way it is named and the way it is presented often imply it is the expected value of loss, when in fact it is the upper bound on loss. It seems risk measures should be conservative, and presenting the upper bound, is the opposite of conservative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More seriously, the fact that VaR is not coherent means that you can't use it to compare two portfolios, or even compare a changing portfolio over time. Doesn't this make value at risk completly useless?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am just starting out in quant finance, so this is a presumptious question, and I am probably missing something. Thanks for any hlep.&lt;/p&gt;&#xA;" OwnerUserId="13309" LastEditorUserId="4842" LastEditDate="2014-10-25T21:10:50.683" LastActivityDate="2014-10-25T22:55:56.560" Title="Do people actually use VaR in professional settings?" Tags="&lt;var&gt;" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15090" PostTypeId="1" CreationDate="2014-10-20T00:04:03.543" Score="0" ViewCount="62" Body="&lt;p&gt;Assuming constant volatility across all strikes, how to use known premium of options to determine premium of options with another strike? e.g. suppose we know premium of \$40 call and put, \$50 call and put, how to determine premium of \$30 and \$60 options?&lt;/p&gt;&#xA;" OwnerUserId="13310" LastEditorUserId="848" LastEditDate="2014-10-20T05:18:35.827" LastActivityDate="2014-10-20T05:18:35.827" Title="how to use known premium of options to determine premium of options with another strike?" Tags="&lt;options&gt;&lt;option-pricing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15092" PostTypeId="2" ParentId="15089" CreationDate="2014-10-20T02:44:18.000" Score="6" Body="&lt;p&gt;As discussed, banks do use VaR for risk management. They will have something modified for the specific use (i.e. probably not your VaR from a fitted normal distribution), it's likely more sophisticated but the underlying idea is the same. VaR is used for reporting/ceremonial business decisions as much as (or perhaps even more than) it is for trading decisions. I'm outdated on this, but I believe liquidity risk is also becoming an important priority in the Dodd-Frank/Basel III environment, and liquidity adjustments to VaR is probably one of the cool and exciting things to be doing in that space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the buy-side, the easiest example that comes to mind is when a trading entity (hedge fund, prop firm etc.) opens a brokerage account. In addition to typical due diligence questions and background about your expected overnight inventory, the brokerage firm will ask you to submit a 'sample portfolio'. That's really just a snapshot of the range of possible position sizes so that they can put that into their risk/compliance department's VaR model and figure out what kind of counterparty risk you'll pose to their overall firm and what kind of position limits to impose on you.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2014-10-20T02:44:18.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15093" PostTypeId="2" ParentId="15090" CreationDate="2014-10-20T03:15:18.743" Score="2" Body="&lt;p&gt;Under the Black-Scholes framework, you can calculate the implied volatility, given the option's price, underlying's price, time to maturity and the risk free rate. To calculate the implied volatility you have to use a &lt;a href=&quot;http://en.wikipedia.org/wiki/Root-finding_algorithm/&quot; rel=&quot;nofollow&quot; title=&quot;root finding method&quot;&gt;root finding method&lt;/a&gt;, since there is not a closed form of the inverse of the B-S option pricing equation for volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the real world implied volatility varies across maturities (volatility smile). However, if you want to assume constant volatility as stated in the question you can use it to calculate option prices for other strikes.&lt;/p&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2014-10-20T03:15:18.743" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15097" PostTypeId="1" CreationDate="2014-10-20T07:56:27.817" Score="2" ViewCount="344" Body="&lt;p&gt;I'm curious how the current negative Eonia (Euro OverNight Index Average) rates would impact  derivatives pricing. Does it mean that if I post cash collateral to you, I also need to pay you interest? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally, does it mean that the classical interest-rate modelling assumption that interest rates can't go negative is now invalid?&lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="999" LastEditDate="2014-10-22T00:11:51.640" LastActivityDate="2014-10-22T00:11:51.640" Title="Negative Eonia rates" Tags="&lt;interest-rates&gt;&lt;models&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15098" PostTypeId="1" AcceptedAnswerId="15100" CreationDate="2014-10-20T09:26:13.563" Score="1" ViewCount="140" Body="&lt;p&gt;I came across a Financial Times &lt;a href=&quot;http://www.ft.com/intl/cms/s/0/d4e4868a-5612-11e4-93b3-00144feab7de.html#axzz3GfvFG1SY&quot; rel=&quot;nofollow&quot;&gt;article&lt;/a&gt; today that said &quot;Peaks in margin trading have been a precursor to bear runs in the past, notably in March 2000 and July 2007.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm curious if anyone here would know if there is a common data source to get an aggregate sense of how much margin investors are taking on? Or is this just something that we might infer from interest rates in the economy? Historical data would be especially awesome of course.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would also be interesting to hear if anyone has ever backtested a strategy using something like this, and if so how it worked out.&lt;/p&gt;&#xA;" OwnerUserId="7385" LastActivityDate="2014-10-20T12:07:19.997" Title="Data on margin volumes?" Tags="&lt;data&gt;&lt;trading&gt;&lt;historical-data&gt;&lt;margin&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15099" PostTypeId="1" AcceptedAnswerId="36694" CreationDate="2014-10-20T10:13:52.430" Score="13" ViewCount="3182" Body="&lt;p&gt;Stephen Ross’ &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2199487&quot;&gt;new paper&lt;/a&gt; claims that it is possible to separate risk aversions and historical probabilities if the Stochastic Discount Factor is transition independent using Perron-Frobenius Theorem. &#xA;&lt;a href=&quot;http://faculty.baruch.cuny.edu/lwu/890/CarrYu2012.pdf&quot;&gt;Carr and Yu&lt;/a&gt; have extended the model to a preference free setting with bounded stochastic processes. &#xA;But a recent paper by &lt;a href=&quot;http://www.larspeterhansen.org/documents/WP_2014_Borovicka_Sheinkman_MisspecifiedRecovery.pdf&quot;&gt;Hansen, Borovicka and Scheinkman&lt;/a&gt; seems to show that the approach by Ross is misspecified. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you explain why Ross’ recovery is misspecified?&lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2017-11-01T16:20:41.427" Title="What are the main flaws behind Ross Recovery Theorem?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;risk-neutral-measure&gt;&lt;recovery&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="15100" PostTypeId="2" ParentId="15098" CreationDate="2014-10-20T12:07:19.997" Score="3" Body="&lt;p&gt;This is an interesting topic. I assumed that you are looking for a public data source.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.nyxdata.com/nysedata/asp/factbook/viewer_edition.asp?mode=table&amp;amp;key=3153&amp;amp;category=8&quot; rel=&quot;nofollow&quot;&gt;Here is&lt;/a&gt; the margin data as reported by NYSE organizations (nyxdata) that offers a downloadable file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the page of &lt;a href=&quot;http://www.finra.org/Investors/SmartInvesting/AdvancedInvesting/MarginInformation/p005923&quot; rel=&quot;nofollow&quot;&gt;FINRA for Margin Statistics&lt;/a&gt;. This is an HTML page, I did not find a link to download a data file. You can validate the two sources against each other. &lt;/p&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2014-10-20T12:07:19.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15101" PostTypeId="1" CreationDate="2014-10-20T13:05:12.520" Score="3" ViewCount="185" Body="&lt;p&gt;Could someone please help me with trying to get the Ox interface to work in R. I get the following errors as output:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This version may be used for academic research and teaching only&#xA;Link error: 'packages/Garch42/garch' please recompile .oxo file to match this version of Ox&#xA;Hata oluştu: file(file, &quot;r&quot;) : bağlantı açılamadı&#xA;Ek olarak: Uyarı mesajları:&#xA;1: 'C:\Ox\bin\oxl.exe C:\Ox\lib\GarchOxModelling.ox' komutunu çalıştırırken 1 durumu oluştu &#xA;2: In file(file, &quot;r&quot;) :&#xA;  dosya 'OxResiduals.csv' açılamadı: No such file or directory&lt;/p&gt;&#xA;" OwnerUserId="13314" LastEditorUserId="7008" LastEditDate="2015-11-24T14:59:51.337" LastActivityDate="2016-12-18T21:08:31.537" Title="garchOxFit in R-oxo file does not match" Tags="&lt;r&gt;&lt;garch&gt;&lt;ox&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15102" PostTypeId="2" ParentId="8943" CreationDate="2014-10-20T21:42:41.170" Score="1" Body="&lt;p&gt;Thanks for the answers and comments above.  In particular to Eric Brady, who had me reading a lot of Bayesian papers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the end, I think the answer to the question is that on the monthly time-frame robust factor algorithms aren't really necessary.  On daily and lower time frames, large spikes in returns due to events (earnings ect.) can really mess with factor loadings and robust methods like &lt;a href=&quot;http://arxiv.org/pdf/0912.3599.pdf&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Principal Component Pursuit&lt;/strong&gt;&lt;/a&gt; run on the whole universe and then applied to the factors and return streams will give much better results. &lt;strong&gt;Bayesian&lt;/strong&gt; methods are interesting as well but tough to apply.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, on the longer, lower-frequency time scale that I was interested in above the spikes in returns aren't important enough to mess with the variance-covarience matrix.  The real issue is just that the betas need to vary in time in a more robust manner than the standard rolling-window linear regressions from Sharpe. For this the &lt;a href=&quot;http://www.federalreserve.gov/pubs/ifdp/2014/1112/ifdp1112.pdf&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Kalman Filter&lt;/strong&gt;&lt;/a&gt; borrowed from signal analysis appears to be a very good solution.&lt;/p&gt;&#xA;" OwnerUserId="5689" LastActivityDate="2014-10-20T21:42:41.170" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15103" PostTypeId="1" CreationDate="2014-10-20T21:48:34.457" Score="2" ViewCount="753" Body="&lt;p&gt;Not sure I am understanding spectral risk measures correctly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is there an equal weighting scheme placed on the tail losses in expected shortfall.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Will that no bias the expected value of the loss towards the lower tail because the probability that the loss will occur is small compared to that which is closer to the p-value?&lt;/p&gt;&#xA;" OwnerUserId="13318" LastActivityDate="2015-03-21T08:09:22.827" Title="Expected Shortfall and Spectral Risk Measure" Tags="&lt;risk-models&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15104" PostTypeId="2" ParentId="14855" CreationDate="2014-10-20T22:23:04.560" Score="0" Body="&lt;p&gt;You could use the (time-scaled) trailing twelve month (TTM) dividend yield as it is a much easier number to get a hold of and can be a reasonable approximation.  Also, while the upcoming dividends are not always published recent dividends should be easy to obtain and you can calculate the TTM yield yourself if you need to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;experquisite and user3264325 both have answers that are forward-looking rather than backward-looking like TTM, however, those values can be much harder to obtain and process.  &lt;/p&gt;&#xA;" OwnerUserId="5689" LastActivityDate="2014-10-20T22:23:04.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15105" PostTypeId="2" ParentId="15071" CreationDate="2014-10-20T22:41:35.793" Score="7" Body="&lt;p&gt;You are absolutely correct that they should be seen as approximations.   While it would be nice to let h go to zero in a mathematical sense this is of course impossible in real life as the options are only traded in particular intervals.  While the smallest interval may be less than 25, for historical reasons traders have gotten used to using the 25 point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many more sophisticated models generally do use the full grid as you suggest.  However, there are many complications the most important of which is values far in/out of the money can be very tough to price so various methods creating smooth surfaces are generally the most accepted methods for pricing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still RR and BF are good approximations and will likely continue to be used as long as humans are still trading or at least spot checking the prices.&lt;/p&gt;&#xA;" OwnerUserId="5689" LastEditorUserId="5689" LastEditDate="2015-06-22T22:08:18.150" LastActivityDate="2015-06-22T22:08:18.150" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15106" PostTypeId="2" ParentId="8918" CreationDate="2014-10-20T23:09:20.317" Score="1" Body="&lt;p&gt;For calculating the AIC for factor models, I calculate the likelihood based on the multivariate distribution of the factor model. I try to make any assumptions as explicit as possible. Bayesians typically do not use the (so-called) BIC. WAIC (Watanabe-Akaike Information Criteria) is becoming more common among Bayesians.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When thinking about the AIC, you should try to clarify what you are using it for. More often than not it is optimization or risk management. I'm more familiar with optimization, so I'll try to keep my observations constrained to that area. For the sake of simplicity, I'll assume a multivariate normal here, but this can easily be relaxed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Either a time series or cross-sectional model can be thought of as a multivariate distribution. For instance, in the time series approach, you would just make some explicit assumption about the correlations between stocks. In a rolling cross-sectional approach, you can use the mean and covariance of the coefficient/factor returns and then get a conditional multivariate distribution (i.e. it changes each period depending on the factor exposures). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two clear ways to construct the multivariate distribution (regardless of time series or cross-sectional). Either using the mean and covariance of the factors to get the mean and covariance of the stocks in the universe. Alternately, you treat the factors as exogenous and don't bother with the mean and covariance of the factors (at the model evaluation stage).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will get different log likelihoods in each case. I prefer the first approach for a few reasons. The first is that it is more sensible to compare against a base case of a multivariate normal. Second, it is more consistent with what is important for portfolio optimization (the mean and covariance of each stock). Third, using market returns will necessarily make your error smaller and make your model look better (when it may not actually be). Fourth, factor returns are often not exogenous. We still have to forecast them for portfolio optimization. Finally, I get really confused about what is an isn't a parameter for AIC (market weighted returns are the mean of a cross-sectional distribution, what really makes them different than the regression coefficients from a cross-sectional regression). I'd rather abstract away from it and focus on the mean and covariance of the factors, which I can be pretty confident are parameters that matter for AIC.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not saying you can't take the other approach, nor can I recall any academic research that says not to do it one way versus the other.  I might be more inclined to use the other approach when I can't write down the likelihood function (i.e. for more sophisticated models).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While AIC can be useful in factor modelling, such as answering questions like should I use a market weighted factor or an equal weighted factor, I don't put a heavy emphasis on it personally. It's definitely not what I start with. My typical approach begins with some baseline model and proceeds by evaluating (quantitatively or qualitatively) whether there are some features of the data that the model is not capturing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bayesians call this a posterior predictive check. The goal of posterior predictive checks is to evaluate in what ways your model does not fit the data. What is the model not capturing. To perform this check, simulate returns from the model and see if they produce patterns that match actual returns. Do the simulated mean, standard deviation, and correlations match what you would expect? How does a subset look (just focusing on country or sector or large/small or value/growth differences)?&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2014-10-20T23:09:20.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15107" PostTypeId="1" AcceptedAnswerId="15114" CreationDate="2014-10-20T23:30:41.507" Score="3" ViewCount="1442" Body="&lt;p&gt;Say I buy a 10-year bond with a notional of 100k. To hedge my credit risk entirely I could buy a 10-year CDS, also on a notional of 100k.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if there are only 5-year CDS trading and no 10-year CDS, then I could still hedge the first 5 years of my bond, assuming that I do not &quot;care&quot; about the years 5 till 10 right now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the question is, on which notional should I buy the 5-year CDS. Intuitively I would say it should also be 100k. But I heard the following reasoning which I do not fully understand:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Making the simplying assumption that the risky annuities (RA) of the&#xA;two CDS contracts are 5 and 10 respectively one would need to buy a&#xA;5-year CDS with a notional of 200k. The reason being that (in its first&#xA;five years) a 5-year CDS with 2*100k notional and RA of 5 acts like a &#xA;10-year CDS with notional 100k and RA 2*5.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Could somebody explain this behaviour? Is the reasoning right or wrong? Basically, how would one try to cope with the fact that 10-year CDS are not currently traded, but 5-year CDS are?&lt;/p&gt;&#xA;" OwnerUserId="6621" LastActivityDate="2014-11-20T19:09:59.333" Title="Hedging bond with CDS of different maturity" Tags="&lt;hedging&gt;&lt;credit&gt;&lt;credit-risk&gt;&lt;cds&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15108" PostTypeId="2" ParentId="15071" CreationDate="2014-10-21T05:26:44.780" Score="2" Body="&lt;p&gt;A measure of vol skew which is used is dsigma/dk or dc/dk. You first need to build arbitrage free volatility curve for that. Rr and fly are just used to get the pillar points and only in fx. The IR market directly gives pillar points I.e sigma(k). I would suggest you read Gatheral book if you want to know in detail of volatility surface construction,&lt;/p&gt;&#xA;" OwnerUserId="13291" LastActivityDate="2014-10-21T05:26:44.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15109" PostTypeId="1" CreationDate="2014-10-21T07:38:26.663" Score="0" ViewCount="65" Body="&lt;p&gt;Does someone know free resources to estimate the leverage of the banking and financial sector at an aggregate level? In particular I would be interested in something like &lt;a href=&quot;http://www.federalreserve.gov/releases/z1/Current/z1.pdf&quot; rel=&quot;nofollow&quot;&gt;Federal Reserve’s Flow of Funds&lt;/a&gt; for the following regions: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Europe (Austria, Belgium, Denmark, Finland, France, Germany, Greece, Ireland, Italy, the Netherlands, Norway, Portugal, Spain, Sweden, Switzerland, and the United Kingdom)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Japan&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Asia Pacific (Australia, Hong Kong, New Zealand, and Singapore)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-North America (Canada, United States)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2014-10-21T11:38:34.070" Title="Data on banks’ leverage" Tags="&lt;data&gt;&lt;leverage&gt;&lt;banks&gt;&lt;asset&gt;&lt;capital-structure&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15110" PostTypeId="2" ParentId="15103" CreationDate="2014-10-21T09:28:27.397" Score="1" Body="&lt;p&gt;The ES definition is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ES_\alpha(X)=\frac{1}{\alpha}\int_{0}^{\alpha}VaR_\beta(X)d\beta$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is indeed an equal weighting over each VaR, but not on the $x$-Achsis, VaR is the inverse function such that adding all possible VaR's is equally weighted, but the VaR's themselves have different magnitude over the $\alpha$-Achsis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The formula can also be rewritten as expected value:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ES_\alpha(X)=E(X|X&amp;lt;-VaR_\alpha(X))=\frac{1}{\alpha}\int_{-\infty}^{-VaR_\alpha(X)}x \cdot f(x)\,dx$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore you can see that on the $x$-Achsis, it is a weighted average.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-10-21T09:42:27.210" LastActivityDate="2014-10-21T09:42:27.210" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="15111" PostTypeId="2" ParentId="8918" CreationDate="2014-10-21T11:23:29.330" Score="1" Body="&lt;p&gt;I would like to point out a recent paper by &lt;a href=&quot;http://www.bus.emory.edu/jshanken/published/LNS_A_skeptical_appraisal.pdf&quot; rel=&quot;nofollow&quot;&gt;Lewellen, Nagel and Shaken&lt;/a&gt; which has changed a little bit the way factor models are tested. The standard procedure was to run time series regression of a factor model on &lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/Data_Library/tw_5_ports.html&quot; rel=&quot;nofollow&quot;&gt;Fama&amp;amp;French 25 size and BE/ME sorted portfolios&lt;/a&gt; to obtain factor loadings, and then cross sectional regressions using $R^2$ as a good measure for the goodness of the model. What Lewellen, Nagel and Shanken showed is that - given the great explanatory power of Size and Value - whenever we test a factor which is a little bit correlated with &lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/Data_Library/f-f_factors.html&quot; rel=&quot;nofollow&quot;&gt;HML and SMB&lt;/a&gt; it’s very easy to get high $R^2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So they suggest a new procedure to test factor models, which is becoming the standard in Asset Pricing literature:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-test the model using a two steps procedure (e.g. Fama-Macbeth) for many portfolios other than 25 size and BE/ME sorted ones. Some examples could be industry, volatility, beta sorted portfolios and also bond portfolios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-compare the values for cross-sectional sloped with the ones predicted by theory&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-use GLS cross-sectional $R^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-whenever the factor is traded, include it in the regression and check whether it is correctly priced. Alternatively construct a “factor mimicking portfolio” and then test whether it is efficient&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-check confidence intervals both for $R^2$ and Total Sum of Squared Errors&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I know very few models pass the Lewellen, Nagel and Shanken test and I bet if you want to check whether your model is good you should go to this route and see what are the results.&lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2014-10-21T11:23:29.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15112" PostTypeId="2" ParentId="15109" CreationDate="2014-10-21T11:38:34.070" Score="2" Body="&lt;p&gt;High level &lt;a href=&quot;http://www.boj.or.jp/en/statistics/sj/sjhiq.pdf&quot; rel=&quot;nofollow&quot;&gt;Flow of funds&lt;/a&gt; comparative analysis for the U.S., Japan, and Euro Area by the bank of Japan.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://sdw.ecb.europa.eu/reports.do?node=1000004042&quot; rel=&quot;nofollow&quot;&gt;Country level report from the ECB&lt;/a&gt;. It is an 800+ page report so the link may take time to load (alternatively go to ECB data warehouse/reports/Euro Area accounts).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.statcan.gc.ca/pub/13-020-x/2012002/tab-eng.htm&quot; rel=&quot;nofollow&quot;&gt;Canadian financial flow accounts&lt;/a&gt; data.&lt;/p&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2014-10-21T11:38:34.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15114" PostTypeId="2" ParentId="15107" CreationDate="2014-10-21T18:41:48.520" Score="4" Body="&lt;p&gt;It depends on how one is thinking about the hedge.  One might be thinking of it as&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;A hedge against catastrophic risk (default of the issuer), or&lt;/li&gt;&#xA;&lt;li&gt;A hedge against changes in (market-implied) &lt;em&gt;default intensity&lt;/em&gt; or &lt;em&gt;hazard rate&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In the former case, which seems to be how you are considering it, the hedge is a static hedge, kept for up to 5 years, and insulates you against losses from default.  In the (likely) case that no default happens, you will accrue PL at roughly the bond rate minus the CDS rate, and you will be left unhedged after 5 years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the latter case, a practitioner would be hedging our the &lt;em&gt;CD01&lt;/em&gt; (credit sensitivity) of the bond, effectively stripping it to a risk-free interest rate product for a small amount of time and small default intensity changes.   The 2x multiplier is very approximate, and the actual hedge ratio would be taken as the quotient of the bond CD01 by the CDS CD01.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this latter case, one would expect to trade small amounts of bond and/or CDS periodically (probably 1-4 times per year) in order to keep the position matched to the target hedge ratio.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2014-10-21T18:41:48.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15115" PostTypeId="1" CreationDate="2014-10-21T19:52:45.460" Score="6" ViewCount="35624" Body="&lt;p&gt;I was doing some financial analysis on two firms in the coffee industry. After calculating Beta and Standard Deviation for both firms, I seem to have stumbled on some weird phenomenon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It appears that firm A has a higher standard deviation than firm B, while also possessing a lower beta coefficient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How is this possible? I had the impression that standard deviation and beta were both measures of risk / volatility, and a higher standard deviation would naturally lead to a higher beta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your help would be greatly appreciated. Thanks and have a nice day!&lt;/p&gt;&#xA;" OwnerUserId="13325" LastActivityDate="2018-03-12T16:38:59.580" Title="Relationship between Beta and Standard Deviation" Tags="&lt;volatility&gt;&lt;beta&gt;&lt;standard-deviation&gt;" AnswerCount="6" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15117" PostTypeId="2" ParentId="15115" CreationDate="2014-10-21T20:48:59.683" Score="2" Body="&lt;p&gt;Let me give you an example to show how this can happen. Suppose you invest 0.50 in a coin flip that will pay 1 on heads and 0 on tails a month later. The monthly variance will be .5*(1-.5)^2+.5*(0-.5)^2=.5 so the standard deviation will be .25. This is significantly higher standard deviation than a market index or almost all stocks. So by one measure this is a very risky bet. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, if you owned a portfolio of a ton of these things it actually would be a very boring investment. Moreover, the market does not compensate you with positive returns for risk that can be diversified away. The coinflip has no priced risk, but it has a lot of non-priced risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put another way, the apparent risk of individual securities is not the same as their contribution to overall risk when held in a portfolio. Diversified portfolios that add a small amount of security A will have lower standard deviation than diversified portfolios that add a small amount of security B, even though A is the higher standard deviation stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Higher standard deviation does naturally lead directly to higher beta, but for diversified portfolios only, not necessarily for individual securities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This concept is important when thinking about things like Venture Capital Investments where founders are forced to put almost all their wealth in one firm. If I had to choose to be the founder of firm B or firm A  I would choose firm B, but I'd put A in my retirement portfolio all else equal.&lt;/p&gt;&#xA;" OwnerUserId="13328" LastActivityDate="2014-10-21T20:48:59.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15118" PostTypeId="2" ParentId="15097" CreationDate="2014-10-21T21:04:01.650" Score="1" Body="&lt;p&gt;Eonia's negative implies parties posting collateral must also pay interest to their counterparties, which has led to calls for clarity from dealers.&lt;/p&gt;&#xA;" OwnerUserId="13329" LastActivityDate="2014-10-21T21:04:01.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15119" PostTypeId="2" ParentId="14864" CreationDate="2014-10-21T23:43:50.040" Score="1" Body="&lt;p&gt;The most obvious reason for emphasis on &lt;strong&gt;wholesale&lt;/strong&gt; credit risk is because the term &quot;wholesale&quot; is linked to the Basel model taxonomy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to Basel Accord type capital adequacy standards, a bank must group its exposures into four categories to calculate credit risk-weighted assets. The &lt;strong&gt;&lt;a href=&quot;http://www.federalreserve.gov/generalinfo/basel2/draftnpr/npr/section_5.htm&quot; rel=&quot;nofollow&quot;&gt;Federal Reserve lists those categories&lt;/a&gt;&lt;/strong&gt; as wholesale, retail, securitization and equity. &lt;/p&gt;&#xA;" OwnerUserId="999" LastActivityDate="2014-10-21T23:43:50.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15121" PostTypeId="2" ParentId="15115" CreationDate="2014-10-22T06:57:22.967" Score="6" Body="&lt;p&gt;beta_A = correlation_A_Index * (stdd_A / stdd_Index )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The difference you see is due to correlation.  The correlation between A and the index is lower than B and the index, and that's why you're seeing a lower beta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The moral of the story is that risk is subjective, and in fact you need to understand how your portfolio is correlated with these stocks in order to have an idea how buying the stock will impact your portfolio.&lt;/p&gt;&#xA;" OwnerUserId="7682" LastActivityDate="2014-10-22T06:57:22.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15122" PostTypeId="1" AcceptedAnswerId="15130" CreationDate="2014-10-22T08:54:06.983" Score="1" ViewCount="155" Body="&lt;p&gt;I have 40 shares in an index and I want to weight them based on their market value, define the known value as $x_i$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the traditional way, the weight of each share is calculated as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$w_i = x_i / \sum^M_{j=1} x_j $ for $M = 40$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, now I want to apply the following restrictions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$w^{k}_s &amp;lt;= 0.05$&lt;/li&gt;&#xA;&lt;li&gt;$\sum^{N_k}_{s=1} w^{k}_s &amp;lt;= 0.10$ for all  $k = 1...K$&lt;/li&gt;&#xA;&lt;li&gt;$\sum^{K}_{k=1} \sum^{N_k}_{s=1} w^{k}_s = 1$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Moreover, each share belongs to one sector $k$, the sum of the weights of the shares within each of these sectors should be less or equal to 0.10.&#xA;In addition, the weight of each individual share $i$ should be less or equal than 0.05.&#xA;Summing up all the weight $w^{k}_s$ should add up to 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How to solve this?&lt;/li&gt;&#xA;&lt;li&gt;What is the solution?&lt;/li&gt;&#xA;&lt;li&gt;Is there an objective function and what is it?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Many many thanks!&lt;/p&gt;&#xA;" OwnerUserId="13334" LastActivityDate="2015-03-21T23:13:42.353" Title="Weighting with restrictions, but no clear objective function?" Tags="&lt;portfolio-management&gt;&lt;optimization&gt;&lt;mathematics&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15123" PostTypeId="1" CreationDate="2014-10-22T10:24:27.080" Score="11" ViewCount="7102" Body="&lt;p&gt;Where can I find more VaR and CVaR formulas for continuous distributions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I collected a list here:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/mXFIN.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="467" LastEditDate="2014-10-23T04:06:40.003" LastActivityDate="2020-02-24T15:50:16.563" Title="Where can I find a list of VaR and CVaR formulas for continuous distributions?" Tags="&lt;risk&gt;&lt;var&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="15124" PostTypeId="1" CreationDate="2014-10-22T10:38:18.857" Score="3" ViewCount="547" Body="&lt;p&gt;I am writing my own FIX engine and I am in the process of running some benchmarks. I am not sure whether my results are good or bad. Can someone with experience in the area provide me with some benchmark throughput numbers? How many FIX messages should my client be able to process per second?&lt;/p&gt;&#xA;" OwnerUserId="12234" LastActivityDate="2014-11-26T19:46:16.867" Title="What would be considered a good/competitive throughput for a FIX engine?" Tags="&lt;fix&gt;&lt;latency&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15125" PostTypeId="1" CreationDate="2014-10-22T12:42:14.347" Score="1" ViewCount="252" Body="&lt;p&gt;Consider the payoff =$S_T1_{S_T&amp;gt;K}$ where $S_T$ is the asset price at maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is this type derivative called? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and is it a liquid option?&lt;/p&gt;&#xA;" OwnerUserId="12093" LastActivityDate="2014-11-11T10:05:08.070" Title="What is the name of this product?" Tags="&lt;options&gt;&lt;derivatives&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15126" PostTypeId="2" ParentId="15125" CreationDate="2014-10-22T13:10:25.870" Score="4" Body="&lt;p&gt;This looks like a binary option. Following this &lt;a href=&quot;http://en.wikipedia.org/wiki/Binary_option&quot; rel=&quot;nofollow&quot;&gt;wikipedia article&lt;/a&gt; it is called an &quot;asset or nothing call&quot;.&#xA;The pricing formula in the Black-Scholes world is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;S e^{-q T} \Phi(d_1),&#xA;$$&#xA;where $S$ is the current spot price, $q$ is the dividend yield, $\Phi$ the cdf of a standard normal and $d_1$ is as usual in BS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To my knowledge such options are much less liquid than there plain vanilla counterparts. &lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-10-22T13:10:25.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15127" PostTypeId="2" ParentId="15123" CreationDate="2014-10-22T14:35:39.023" Score="9" Body="&lt;p&gt;Values of &lt;code&gt;VaR&lt;/code&gt; are just the inverses of the cumulative distributions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;CVaR&lt;/code&gt; is not a very commonly used term, its more frequently used synonym is &lt;code&gt;Expected Shortfall&lt;/code&gt;. See &lt;a href=&quot;http://www.maths.manchester.ac.uk/~saralees/chap17.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.maths.manchester.ac.uk/~saralees/chap17.pdf&lt;/a&gt; for the list of Expected Shortfall values for more than 20 distributions.&lt;/p&gt;&#xA;" OwnerUserId="8051" LastActivityDate="2014-10-22T14:35:39.023" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="15129" PostTypeId="2" ParentId="15123" CreationDate="2014-10-22T17:27:14.627" Score="3" Body="&lt;p&gt;More often than not, I prefer to work with a scenario representation. That is, I will simulate from the distribution and calculate the VaR and CVaR as appropriate. This is especially the case for forward-looking analysis of portfolios' CVaR, rather than in evaluating the historical returns of some portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If for some reason I can't do the scenario approach, then I will use the Cornish-Fisher approximation. There is a &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1024151&quot; rel=&quot;nofollow noreferrer&quot;&gt;paper&lt;/a&gt; by Boudt, Peterson, and Croux that I think provides the formula for both VaR and CVaR, as well as a few others (perhaps refer to other references, and there's already a &lt;a href=&quot;https://quant.stackexchange.com/questions/3646/how-does-cornish-fisher-var-aka-modified-var-scale-with-time&quot;&gt;question&lt;/a&gt; on this site about it wrt VaR). If you're using Cornish-Fisher, then you can write the VaR and CVaR in terms of the moments of whatever distribution you're looking at. BPC provides the formula for portfolios as well, but in my experience this is a big pain.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2014-10-22T17:27:14.627" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15130" PostTypeId="2" ParentId="15122" CreationDate="2014-10-22T17:39:17.273" Score="1" Body="&lt;p&gt;There's more than one way to do this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One common approach among indices is to take an iterative approach. For instance, you might identify the stocks with weights about 5%, then re-weight so that everything adds up to 1. Then you might identify the sectors that break the 10% limit and re-scale them to be less than 10%. Then re-scale everything to add up to 100%. Then keep going through it again and again until you don't have any issues with constraint violations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have the covariance matrix of all the stocks, you can do a tracking error minimization. Basically minimize the tracking error between the new portfolio subject to those restrictions and the market cap weighting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, again if you have the covariance matrix, you can use (Black-Litterman) reverse optimization to get the expected returns implied from the market. Then you can do a mean variance optimization with the above constraints and the same risk aversion coefficient you used in the reverse optimization. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are probably other ways that I have not even thought of. I prefer the optimization approaches, but if you don't have the capability for that then you might have to rely on the first.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2014-10-22T17:39:17.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15131" PostTypeId="1" CreationDate="2014-10-22T20:07:09.290" Score="1" ViewCount="2452" Body="&lt;p&gt;I am trying to calculate the beta weighted delta and gamma for a portfolio of options of different underlying stocks, but I can't seem to find the correct formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone point me to it or a book that contains it?&lt;/p&gt;&#xA;" OwnerUserId="1001" LastEditorUserId="467" LastEditDate="2014-10-23T03:59:19.933" LastActivityDate="2019-02-26T16:15:21.133" Title="What is the formula for beta weighted delta and gamma?" Tags="&lt;options&gt;&lt;beta&gt;&lt;delta&gt;&lt;gamma&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15132" PostTypeId="2" ParentId="7047" CreationDate="2014-10-22T23:43:59.330" Score="2" Body="&lt;p&gt;There are by now a lot of papers on discretizations of Heston. One objective of them being to avoid negativity. As has already been said, the Heston SDE has no negative solutions, but a crude discretization does give negative variance with positive probability. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to do small steps, then using a log-normal approximation or the QE approximation solves the problem. If you want to do large steps, our method Chan--Joshi is effective. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://ssrn.com/abstract=1617187&quot; rel=&quot;nofollow&quot;&gt;http://ssrn.com/abstract=1617187&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code is downloadable from markjoshi.com&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2014-10-22T23:43:59.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15133" PostTypeId="2" ParentId="15124" CreationDate="2014-10-23T00:20:05.480" Score="1" Body="&lt;p&gt;Fix8 has some benchmark results on their &lt;a href=&quot;http://www.fix8.org/performance.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;website&lt;/a&gt;.  They provide the code, so you can run your own benchmarks with your FIX engine against either Quickfix or Fix8.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/0Pdo3.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="508" LastActivityDate="2014-10-23T00:20:05.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15135" PostTypeId="2" ParentId="15071" CreationDate="2014-10-23T03:27:50.263" Score="4" Body="&lt;p&gt;I wonder if the reasons these approximations are widely used - instead of a whole set of estimates for different deltas, as proposed - have to do with liquidity and market structure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Liquidity: A market participant willing to trade e.g. a 10 delta option for no economic reason other than skew will find, for many products, that the edge evident from a fitted IV curve no longer exists after transaction costs, or not in much size, anyway. To find enough liquidity to trade skew and skew alone in meaningful sizes, it may be necessary to trade closer to the money. But then a 25 delta rr or related estimates will be sufficient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Market structure: the kinds of participants that use these heuristics are not the sort that are looking for nickel arbitrage opportunities from the curve. Firms making markets in options in order to do this are assuredly looking at all the strikes.&lt;/p&gt;&#xA;" OwnerUserId="2378" LastActivityDate="2014-10-23T03:27:50.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15138" PostTypeId="2" ParentId="15124" CreationDate="2014-10-23T18:36:36.080" Score="4" Body="&lt;p&gt;We believe that the FIX parser (encoder/decoder) is the easiest part of a FIX engine to optimize. The bottleneck is usually the network I/O because you can't do any encoding/decoding before you receive/send the bytes from/to the network.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below are the &lt;a href=&quot;http://www.coralblocks.com/index.php/category/coralfix/&quot; rel=&quot;nofollow&quot;&gt;CoralFIX&lt;/a&gt; numbers we measured using an Intel Xeon 2.0GHz machine:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of encoding (from &lt;code&gt;FixMessage&lt;/code&gt; to &lt;code&gt;ByteBuffer&lt;/code&gt;), we can encode 5 million messages without producing any garbage in 1.408 micros on average per message.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of decoding (from &lt;code&gt;ByteBuffer&lt;/code&gt; to &lt;code&gt;FixMessage&lt;/code&gt;), we can decode 5 million messages without producing any garbage in 1.997 micros on average per message.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the same numbers using an Intel i7 3.5GHz machine overclocked to 4.5GHz:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &lt;code&gt;FixMessage&lt;/code&gt; to &lt;code&gt;ByteBuffer&lt;/code&gt; - 794 nanoseconds on average per message.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &lt;code&gt;ByteBuffer&lt;/code&gt; to &lt;code&gt;FixMessage&lt;/code&gt; - 1.1 micros on average per message.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want a &lt;strong&gt;rough&lt;/strong&gt; estimate for throughput you can do the math:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Throughput = 1 second in nanos / (time above in nanos) = 1,000,000,000 / (time&#xA;  above in nanos)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But that will give you unrealistic numbers (&gt; 1 million mps) because it is assuming that your network I/O time is zero. It does not help to save nanoseconds for parsing when you will be spending microseconds with network I/O.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore we like to measure the combined time of reading the bytes from the network plus parsing the bytes into a &lt;code&gt;FixMessage&lt;/code&gt;. We have done &lt;a href=&quot;http://www.coralblocks.com/index.php/2014/10/blazing-fast-throughput-with-coralfix-coralreactor/&quot; rel=&quot;nofollow&quot;&gt;this benchmark here&lt;/a&gt;, and the number was 250k fix messages per second read from the network and parsed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt; I am one of the developers of CoralFIX.&lt;/p&gt;&#xA;" OwnerUserId="11804" LastEditorUserId="11804" LastEditDate="2014-10-27T18:02:42.697" LastActivityDate="2014-10-27T18:02:42.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15141" PostTypeId="2" ParentId="15131" CreationDate="2014-10-23T22:08:23.260" Score="4" Body="&lt;p&gt;I've started thinking about this, too. My gedanken conclusion turned out to be too simple once I found what I was after: &lt;a href=&quot;http://www.investment-and-finance.net/derivatives/o/option-beta.html&quot; rel=&quot;nofollow&quot;&gt;http://www.investment-and-finance.net/derivatives/o/option-beta.html&lt;/a&gt;, which I've confirmed in &lt;a href=&quot;https://www.cs.princeton.edu/courses/archive/fall09/cos323/papers/black_scholes73.pdf&quot; rel=&quot;nofollow&quot;&gt;Black &amp;amp; Scholes (1973)&lt;/a&gt; p10 (eq 15).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short:&#xA;$$&#xA;\beta_{\text{option}} = \frac{S\cdot\Delta}{O}{\beta_S}&#xA;$$&#xA;where $S$ is the underlying price ($x$ in the B&amp;amp;S paper), $O$ is the option price ($w_1$ in B&amp;amp;S), $\Delta$ is the usual $\partial{O}/\partial{S}$, and $\beta_S$ is $\beta$ for the underlying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding your question, you'd just have to re-arrange this to use an empirically measured option $\beta$, and differentiate for Gamma. I'm not sure that gets you where you want to go, though.&lt;/p&gt;&#xA;" OwnerUserId="7174" LastEditorUserId="7174" LastEditDate="2014-10-31T10:17:41.890" LastActivityDate="2014-10-31T10:17:41.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15144" PostTypeId="1" CreationDate="2014-10-24T05:41:51.743" Score="7" ViewCount="687" Body="&lt;p&gt;I have time series data for various assets and which I transform to create various features. I have framed the problem as a classification task where I attempt to predict either a positive or negative move above some threshold. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example: If the next n day returns are above the threshold then label as a one. If below the threshold then a -1. If the threshold is not reached then a 0. (This is inline with much of what I see in the literature)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At this stage I have only investigated an SVM classifier but I am wondering if there are more appropriate models to use? If someone familiar with the literature could please point me to a few models that are common in forecasting financial time series, that would be great!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One idea I have had is the HM-SVM model architecture, am I getting warmer? Are there specific model tricks?&lt;/p&gt;&#xA;" OwnerUserId="13350" LastEditorUserId="19222" LastEditDate="2019-04-04T10:35:13.613" LastActivityDate="2019-04-04T15:06:23.100" Title="What machine learning method is more suitable for prediction of financial time series?" Tags="&lt;time-series&gt;&lt;statistics&gt;&lt;machine-learning&gt;&lt;prediction&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="15145" PostTypeId="2" ParentId="15125" CreationDate="2014-10-24T09:20:21.590" Score="1" Body="&lt;p&gt;I don't think that it has a name on its own, but you can write&#xA;$$&#xA;(S_T - K + K)\,1_{S_T&amp;gt;K} = (S_T-K)_+ + K\,1_{S_T&amp;gt;K}&#xA;$$&#xA;so it's a 1 call plus K binary calls.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Binary are hard to hedge, the payoff looks like _|‾, going sharply from out-of-the-money to in-the-money. The delta changes fast and it's difficult to hedge the position. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, you give yourself some cushion by approximating the binary by a &lt;strong&gt;call spread&lt;/strong&gt; with small spread (buy an amount of calls struck at a lower strike, sell the same amount of calls struck at a higher strike). The payoff looks like _/‾.&lt;/p&gt;&#xA;" OwnerUserId="13352" LastActivityDate="2014-10-24T09:20:21.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15146" PostTypeId="1" CreationDate="2014-10-24T09:24:01.253" Score="1" ViewCount="84" Body="&lt;p&gt;I have seen a charts that look's like&#xA;&lt;img src=&quot;https://i.stack.imgur.com/Hsvzf.png&quot; alt=&quot;Annual Charting&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to do something like this with PerformanceAnalytics or is there any other package for doing this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="13351" LastActivityDate="2014-10-24T09:24:01.253" Title="PerformanceAnalytics and Annual Charting" Tags="&lt;performanceanalytics&gt;&lt;annualized&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15147" PostTypeId="1" CreationDate="2014-10-24T09:32:56.610" Score="4" ViewCount="1857" Body="&lt;p&gt;I was trying to understand below paper &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.math.nyu.edu/faculty/avellane/AvellanedaLeeStatArb071108.pdf&quot; rel=&quot;nofollow&quot;&gt;https://www.math.nyu.edu/faculty/avellane/AvellanedaLeeStatArb071108.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Page 20 explains about &quot;Entering a trade&quot;. I wan't to know clearly what it means to place a long trade in case of arbitrage using eigen portfolios. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Greatly appreciate your inputs&lt;/p&gt;&#xA;" OwnerUserId="7422" OwnerDisplayName="surya kiran" LastActivityDate="2014-10-26T14:23:25.083" Title="Statistical arbitrage using eigen portfolios" Tags="&lt;pca&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15148" PostTypeId="1" CreationDate="2014-10-24T15:59:21.073" Score="4" ViewCount="147" Body="&lt;p&gt;I've been looking into a short piece of maths a colleague has written on pricing inflation with payment delays, and was hoping someone could confirm whether my understanding is correct, or if my colleague's calculation is invalid, then why. The setup: suppose, for example, suppose you have an inflation-linked cashflow that captures the level of inflation between 2014 - 2015, but this cashflow isn't &lt;em&gt;paid&lt;/em&gt; until a year later in 2016. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the value of this cashflow is not necessarily just the expected 2014 $\rightarrow$ 2015 inflation discounted back from 2016, because you may have some correlation between interest rates and inflation. In essence, $\mathbb{E}(\text{I}_{2015} \cdot \text{DF}_{2016} ) \ne \mathbb{E}(\text{I}_{2015}) \cdot \mathbb{E}(\text{DF}_{2016} )$ if your discount factor and inflation are correlated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is not surprising - if inflation and interest rates are +100% correlated, then an increase in inflation is partially &quot;hedged&quot; by rates rising and your discount factors shrinking, and conversely if they're -100% correlated then a rise in inflation will be further compounded by lower discount rates. In either case, the expected value of your cashflow is nonlinear vs inflation, and you would expect it to be some function of correlation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My aim therefore is to understand the magnitude of the &quot;convexity adjustment&quot; $\Delta$, where $\mathbb{E}(\text{I}_{2015} \cdot \text{DF}_{2016} ) = \Delta \cdot  (  \mathbb{E}(\text{I}_{2015}) \cdot \mathbb{E}(\text{DF}_{2016} ))$. The maths my colleague wrote to value this adjustment is below. I am aware it's relatively crude, it doesn't need to be perfect for my purposes - I just want something in the right ballpark and better than  making no adjustment at all. There are more sophisticated discussions of the maths such as &lt;a href=&quot;http://www.risk.net/data/asiarisk/pdf/2008/asiarisk_nov08_cuttingedge.pdf&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt; but I'd like to understand the simplified calculation first if possible.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Let $I_T$ = inflation fixing at time $T$, but paid on lagged date $T_L = T + D$. Write your discount factor from time $a$ to $b$, as seen at time $c$, as $\delta_c(a,b)$. Then a payment of $I_T$ at time $T_L$ is equivalent to $I_T \cdot \delta_{T}\,(T,T_L)$ at time $T$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Letting $r$ be the short-term interest rate observed at $T$, we can say $\delta_{T}\,(T,T_L) = e^{-r D}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose now that $I_T$ is lognormally distributed, variance $\sigma_I^2 T$, and $r$ is normally dist. with variance $\sigma_r^2 T$, and correlation is $\rho$. Then we have  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb{E}(I_T \cdot \delta_T(T,T_L)) = \exp{[-\rho \cdot \sigma_I \cdot \sigma_r \cdot D \cdot T]} \cdot \mathbb{E}(I_T) \cdot \delta_0(T,T_L) \,\,\,\, (*) $ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the first term is your convexity adjustment $\Delta$.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;My first question is: is that all maths valid? I'm a little suspicious of saying $\delta_{T}\,(T,T_L) = e^{-r D}$ for a &quot;short term rate&quot; $r$ if $D$ is a long delay. It seems like by simply multiplying by $D$, you're simultaneously treating $r$ as fixed and not fixed. Or is the key point that &lt;em&gt;once you reach time $T$&lt;/em&gt; $r$ is observed and can be treated as &quot;fixed&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming the maths is all ok, is $(*)$ just a consequence of the fact that for correlated normal R.V.s $X,\,Y$ we have $\mathbb{E}(e^X e^{-Y}) = \mathbb{E}(e^{X-Y})= $ and $X - Y \sim N(\mu_X - \mu_Y, \sigma_X^2  +\sigma_Y^2 - 2 \rho \sigma_X \sigma_Y)$?  If I understand correctly think you just use that relation and substitute in for $X$ and $Y$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly, in this context would $\sigma_I$ and $\sigma_r$ both be normal vols? That's how I read the maths, but the numerical example I have suggests that $\sigma_I$ should be more like a lognormal order of magnitude (e.g. nearer to 10% than 1%). Many thanks for your help.&lt;/p&gt;&#xA;" OwnerUserId="13355" LastActivityDate="2014-10-24T15:59:21.073" Title="Inflation/Rates Correlation" Tags="&lt;interest-rates&gt;&lt;correlation&gt;&lt;inflation&gt;&lt;convexity&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15149" PostTypeId="2" ParentId="15147" CreationDate="2014-10-24T20:40:47.330" Score="1" Body="&lt;p&gt;The paper alternatives between using eigenportfolios and sector/industry ETFs for statistical arbitrage. For instance, sections 2.1-2 vs. 2.3. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The trade in Section 4.1 is long some stock and short an appropriate amount of sector/industry ETFs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That being said Sections 5.3 and 5.4 discuss PCA strategies in a backtest, with relatively little additional information. It seems they are using the approach described at the beginning of Section 5 (basically they regress the stock against 15 or so eigenportfolios and go long the stock and short the eigenportfolios based on the beta, assuming I'm reading it correctly).&lt;/p&gt;&#xA;" OwnerUserId="2379" LastEditorUserId="2379" LastEditDate="2014-10-26T14:23:25.083" LastActivityDate="2014-10-26T14:23:25.083" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15150" PostTypeId="2" ParentId="8972" CreationDate="2014-10-24T23:06:43.537" Score="0" Body="&lt;p&gt;AFAIK Nasdaq OMX is one of the few (if not the only) exchange which provides buyer / seller ID on equity trades:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Trade information (latest paid price, trade volume, buyer/seller ID where available)&#xA;&lt;a href=&quot;http://www.nasdaqomx.com/digitalAssets/66/66627_nasdaq_omx_nordic_market_data_offering.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.nasdaqomx.com/digitalAssets/66/66627_nasdaq_omx_nordic_market_data_offering.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;More specifically:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;TRADE MESSAGE (NON-CROSS)&lt;/p&gt;&#xA;&lt;p&gt;Name                      Offset Length Value Notes&lt;/p&gt;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&lt;p&gt;Participant ID, buyer      45 4 Alphabetic&lt;/p&gt;&#xA;&lt;p&gt;Participant ID, seller   49 4 Alphabetic&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.nasdaqomx.com/digitalAssets/94/94202_nordic-equity-totalview-itch-1.90.4.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.nasdaqomx.com/digitalAssets/94/94202_nordic-equity-totalview-itch-1.90.4.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="4842" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2014-10-24T23:06:43.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15151" PostTypeId="1" AcceptedAnswerId="15152" CreationDate="2014-10-25T11:56:21.490" Score="3" ViewCount="2688" Body="&lt;p&gt;Consider the following PDE on interval [0,T]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\left(\frac{\partial F}{\partial t}(t,x)+\mu (t,x)\frac{\partial F}{\partial x}+\frac{1}{2}\sigma^2(t,x)\frac{\partial^2F}{\partial x^2}(t,x)=rF(t,x)\right)$&#xA;with condition that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$F(T,x)=\phi(x)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and let X(t) Solve the stochastic differential equation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dX(t)=\mu dt+ \sigma dW(t)$ with  initial condition&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X(t)=x$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to solve it i use It$\acute{o}$ on F(t,x) and get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dF=\left[\frac{\partial F}{\partial t}+\mu \frac{\partial F}{\partial x}+\frac{1}{2}\sigma^2 \frac{\partial^2 F}{\partial x^2}  \right]dt + \sigma \frac{\partial F}{\partial x}dW $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ans since the problem state the the equation in bracket is equal to $rF(t,x)$, we can re write it and get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dF=rFdt+\sigma \frac{\partial F}{\partial x}dW$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if we integrate this from t to T and then take the expectations value we end up with this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$F(t,x)=e^{-r(T-t)}E^Q[\phi(x)]$   which is the final answer&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and this is usually the general way to solve this kind of Partial differential equations. I really do not understand the Integration and expectation part and really appreciate any kind of hints or steps to do it&lt;/p&gt;&#xA;" OwnerUserId="13329" LastActivityDate="2018-11-25T12:38:48.647" Title="General way to solve Partial differential equation using Feynman kac representation" Tags="&lt;differential-equations&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="15152" PostTypeId="2" ParentId="15151" CreationDate="2014-10-25T13:19:45.570" Score="11" Body="&lt;p&gt;Let's skip to the stochastic differential equation (SDE):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dF=\left[\frac{\partial F}{\partial t}+\mu \frac{\partial F}{\partial x}+\frac{1}{2}\sigma^2 \frac{\partial^2 F}{\partial x^2}  \right]dt + \sigma \frac{\partial F}{\partial x}dW $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What does this equation &lt;em&gt;actually&lt;/em&gt; represent? It suggests that a change in $F$ (represented by $\Delta F$) equals a change in $t$ times some derivatives in $F$ (represented by $[\cdots]\Delta t$) plus the change in the Brownian motion $W$ times another derivative (the part $[\cdots]\Delta W$). This also suggests that we are looking at a differential equation, since we are equating small changes in $t$ and $W$ to changes in $F$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, technically speaking this does not make sense since the Brownian motion $W$ isn't differentiable! We cannot actually interpret this as a &quot;differential&quot; equation in the usual (deterministic) sense, because the derivative $\frac{dW}{dt}$ does not exist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead this differential equation is actually just a short hand notation. By &lt;em&gt;definition&lt;/em&gt; it is short for:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$F(T, X(T)) - F(0, X(0)) = \int_0^T \left[\frac{\partial F}{\partial t}+\mu \frac{\partial F}{\partial x}+\frac{1}{2}\sigma^2 \frac{\partial^2 F}{\partial x^2}  \right] dt + \int_0^T \sigma \frac{\partial F}{\partial x} dW_s$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The SDE is just an integral equation in disguise! It looks like this is obtained by integrating the SDE. But again, that's just because the SDE is actually defined to be this integral equation. The reason is that we can integrate Brownian motions, but we cannot differentiate them. Keep that in mind.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The integral $\int[\cdots]dW_s$ is a tricky object to interpret. For instance it is not defined in the usual Riemann sense. The integral &lt;em&gt;itself&lt;/em&gt; is actually a random variable. We can generate a path $W(t)$, then perform the integral and that way obtain a sample from the distribution of this integral. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, in general you cannot really manipulate or solve these types of integrals like you would with an ordinary integral. So determining their distribution is in general very difficult. They do have one very important property, which I'll come back to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the next step is obtained by making use of the original PDE. We are assuming that $F$ itself is defined to satisfy this equation. Now, first I'm going to assume $r=0$. I'll comment on this later on. This makes the argument a bit easier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\int_0^T \left[\frac{\partial F}{\partial t}+\mu \frac{\partial F}{\partial x}+\frac{1}{2}\sigma^2 \frac{\partial^2 F}{\partial x^2}  \right]dt = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and this gives:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ F(T, X(T)) = F(0, X(0)) + \int_0^T \sigma \frac{\partial F}{\partial x}dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We are almost done. Next step we take the expectation value w.r.t. the generated paths $W(t)$ (on the interval $[0,T]$). Here comes the important property of stochastic integrals I mentioned earlier:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ E\Big[\int_0^T \sigma \frac{\partial F}{\partial x}dW_t \Big] = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The expectation value is simply zero! The mean of these types of integrals vanish. Why? Well, heuristically the integral is just a sum over small &quot;changes&quot; in $\Delta W_t$ weighted by whatever we are integrating over. Since the $\Delta W_t$ are all normally distributed with mean zero, so it's like we are summing a whole bunch of normal distributions with mean zero. The mean of this sum is also zero. The formal proof is of course trickier, but you get the point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Back to our equation we get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ E[F(T, X(T))] = E[F(0, X(0))] + 0 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the $+0$ was the integral before. We assume that we are viewing from $t=0$, so we know the value of $F$ at this time. Therefore:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$F(0, X(0)) = E[F(T, X(T))]$$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And there we have our martingale property. Just as a side note, you would technically write this as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$F(0, X(0)) = E[F(T, X(T))|\mathcal{F}_{t=0}]$$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\mathcal{F}_{t=0}$ is called a filtration. It basically means that the path $X(t)$ is completely known / fixed for $t&amp;lt;= 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I set $r=0$ in the derivation above. This is not really necessary. We could also set $G=e^{-rt}F$ to &quot;absorb&quot; the $rF$ term in the original PDE (or turn it around: define $F=e^{rt} G$ and substitute it into the PDE. You get the same PDE, but written in terms of $G$ and no $rG$ term on the right hand side). My derivation then applies also to $G$. The final expression $G(0, X(0)) = E[G(T, X(T))]$ can be transformed back to $F$ by subbing $G(t)=e^{-rt}F(t)$ giving:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$F(0, X(0)) = e^{-rT}E[F(T, X(T))]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to know more, then I suggest looking at a book like Shreve to study the properties of stochastic calculus and stochastic integration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Same conclusion though.&lt;/p&gt;&#xA;" OwnerUserId="3371" LastEditorUserId="3371" LastEditDate="2014-10-25T19:41:16.953" LastActivityDate="2014-10-25T19:41:16.953" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15153" PostTypeId="1" CreationDate="2014-10-25T13:45:25.937" Score="1" ViewCount="165" Body="&lt;p&gt;I would like to assess the performance of currency traders so I was wondering if there is a broad currency index that can be used as a benchmark to assess the performance of these traders. The index would represent a passive investment strategy in currencies.&lt;/p&gt;&#xA;" OwnerUserId="5190" LastEditorUserId="467" LastEditDate="2014-11-27T01:03:30.623" LastActivityDate="2014-12-27T02:04:05.760" Title="Is there a broad currency index just like there is an equity market index?" Tags="&lt;index&gt;&lt;currency&gt;&lt;benchmark&gt;" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15154" PostTypeId="1" AcceptedAnswerId="15158" CreationDate="2014-10-25T14:54:17.827" Score="1" ViewCount="1927" Body="&lt;p&gt;What is the best source for historical EOD data for Indian stock market? The data from Yahoo finance for some companies is not up-to-date and Google finance doesn't provide adjusted close prices. What should I do ? I need the data for quantitative analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to calculate adjusted close from Google finance close price series ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I'm using the expression (close[n]-close[n-1])/close[n-1] for returns calculations. It will show erroneous data, because of the change in price due to stock split.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please help me out of this.&#xA;Thank you&lt;/p&gt;&#xA;" OwnerUserId="13364" LastActivityDate="2019-08-01T08:09:07.990" Title="Historical data resources for Indian market" Tags="&lt;trading&gt;&lt;market-data&gt;&lt;historical-data&gt;&lt;algorithmic-trading&gt;&lt;quantitative&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15155" PostTypeId="1" CreationDate="2014-10-25T15:39:58.337" Score="1" ViewCount="2045" Body="&lt;p&gt;I have come across two ways of calculating Tracking Error (TE) but i'm not sure if they are essentially the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first way is to calculate the standard deviation of the difference between a fund's returns and a benchmark as shown &lt;a href=&quot;http://live-s3-1.investecassetmanagement.boxuk.net.s3.amazonaws.com/Understanding_tracking_error.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second method is to run a regression and calculate the standard deviation of the error terms and shown &lt;a href=&quot;http://allaboutalpha.com/blog/wp-content/uploads/2008/12/measuring-alpha-based-performance-white-paper-by-gorman-weigand.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; in section 8.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many of the academic papers I have read use the latter. My question is, do these 2 methods yield the same answer?&lt;/p&gt;&#xA;" OwnerUserId="5190" LastActivityDate="2014-10-25T16:15:28.460" Title="Understanding how to calculate tracking error" Tags="&lt;regression&gt;&lt;tracking-error&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15156" PostTypeId="2" ParentId="15155" CreationDate="2014-10-25T16:15:28.460" Score="1" Body="&lt;p&gt;This appears to be the same thing, however, in the former case, the benchmark is the FF-Model. This means you assume the model stated in their eq. 9 is correct (as per your regression), and use the vol of the residuals as TE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They go on and explain:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The volatility of the residuals in equation [9] is a measure of idiosyncratic (non-systematic)&#xA;  risk.20 Since alpha measures the return earned for taking on idiosyncratic risk, the&#xA;  information ratio measures of the amount of idiosyncratic return earned per unit of&#xA;  idiosyncratic risk exposure. For this reason, the information ratio is often interpreted as a&#xA;  measure of investment efficiency.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And thats exactly right: If you assume the FF-model, all factors of your regression are systematic. The remainder will be captured by the residuals, and is thus the remaining idiosyncratic risk.&lt;/p&gt;&#xA;" OwnerUserId="1976" LastActivityDate="2014-10-25T16:15:28.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15157" PostTypeId="2" ParentId="15154" CreationDate="2014-10-25T16:21:36.147" Score="1" Body="&lt;p&gt;Per its &lt;a href=&quot;https://help.yahoo.com/kb/finance/historical-prices-sln2311.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;help-page&lt;/a&gt; yahoo provides adjusted closing prices on a weekly basis. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that is not sufficient, you can always calculate adjusted closing prices using &lt;a href=&quot;https://quant.stackexchange.com/questions/4165/why-does-the-adjusted-closing-price-take-into-account-dividends/4167#4167&quot;&gt;this formula&lt;/a&gt;, however, you would need to know the dividend history of each stock. Those are also available from yahoo finance.&lt;/p&gt;&#xA;" OwnerUserId="1976" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2014-10-25T16:21:36.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15158" PostTypeId="2" ParentId="15154" CreationDate="2014-10-25T17:39:53.143" Score="2" Body="&lt;p&gt;There's a couple of options other than Google or Yahoo that I am aware of. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The NSE provides EOD data, as well as 5,2 and 1 minute data. If you're willing to pay for high quality data for your application, this is an excellent choice. &lt;a href=&quot;http://www.nseindia.com/supra_global/content/dotex/data_products.htm&quot; rel=&quot;nofollow&quot;&gt;http://www.nseindia.com/supra_global/content/dotex/data_products.htm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quandl provides comparatively clean, free EOD data which might suit your requirements too.&#xA;Like, &lt;a href=&quot;https://www.quandl.com/NSE/BATAINDIA&quot; rel=&quot;nofollow&quot;&gt;https://www.quandl.com/NSE/BATAINDIA&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11923" LastActivityDate="2014-10-25T17:39:53.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15159" PostTypeId="1" AcceptedAnswerId="15167" CreationDate="2014-10-25T21:26:00.837" Score="5" ViewCount="1661" Body="&lt;p&gt;Let's consider standard Black-Scholes model with price process $S_t$ satisfying SDE $$dS_t = S_t(bdt + \sigma dB_t)$$, where $B_t$ is standard Brownian Motion for probability $\mathbb{P}$. I understand the proof of existence of martingal measure $\mathbb{Q}$ equivalent to $\mathbb{P}$ based on Girsanov theorem, but I can't see how to derive uniqueness of $\mathbb{Q}$. Can you help?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: In Jeanblanc, Yor, Chesney $\textit{Mathematical Methods for Financial Markets}$ I found the following proof:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If $\mathbb{Q}$ is equivalent to $\mathbb{P}$ then there exists strictly positive martingale $L_t$ such that $\mathbb{Q}|_{F_t} = L_t\mathbb{P}|_{F_t}$. From the predictable representation property under $\mathbb{P}$, there exists a predictable $\psi$ such that $$ dL_t = \psi_tdB_t = L_t\phi_tdB_t,$$ where $\psi_t = \phi_tL_t$. It follows that $$d(LRS)_t&#xA;\stackrel{mart}{=} (LRS)_t(b − r + \phi_t\sigma)dt$$&#xA;  (where $dX_t \stackrel{mart}{=} dY_t$ for semimartingales $X$ and $Y$ means that $X-Y$ is a local martingale, $R_t=e^{-rt}$ is a discount process). Hence, in order for $\mathbb{Q}$ to be an e.m.m., or equivalently for $LRS$ to be a $\mathbb{P}$-local martingale, there is one and only one process $\phi$ such that the bounded variation part of LRS is null, that is $$\phi_t = \frac{r − b}{\sigma}=−\theta.$$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now Girsanov theorem gives us the existence of such e.m.m. and fact that $\phi$ is unique gives us uniqueness of $\mathbb{Q}$. Unfortunately, I don't understand where $\stackrel{mart}{=}$ equality comes from and why for $LRS$ to be a $\mathbb{P}$-local martingale, there must be process $\phi$ such that the bounded variation part of LRS is null. Do you have any idea how to proceed with these steps?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am especially interested in the proof of $d(LRS)_t \stackrel{mart}{=} (LRS)_t(b − r + \phi_t\sigma)dt$.&lt;/p&gt;&#xA;" OwnerUserId="13366" LastEditorUserId="13366" LastEditDate="2014-10-26T13:14:40.980" LastActivityDate="2014-10-26T13:18:56.613" Title="Uniqueness of equivalent martingale measure in Black Scholes-Model" Tags="&lt;black-scholes&gt;&lt;stochastic-calculus&gt;&lt;martingale&gt;&lt;girsanov&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15160" PostTypeId="2" ParentId="15089" CreationDate="2014-10-25T22:55:56.560" Score="0" Body="&lt;p&gt;It is but one of the methods used by risk management to gauge the level of risk undertaken at desk/strategy/account/office/firm etc., levels. Others are risk sensitivities and stress scenarios. All are usually used together to get an overall picture of the risk position and used to make decisions. Even though the absolute VaR value might seem a bit obscure the relative VaR value can be more intuitive and useful to see how risk is changing by the levels given above.&lt;/p&gt;&#xA;" OwnerUserId="13303" LastActivityDate="2014-10-25T22:55:56.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15161" PostTypeId="1" AcceptedAnswerId="15162" CreationDate="2014-10-26T03:02:20.430" Score="3" ViewCount="7274" Body="&lt;p&gt;I am planning building fully customizable backtesting trading engine in python from scratch as a open source project, &#xA;the main features i am considering is, &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It should be fully customizable from top to bottom&lt;/li&gt;&#xA;&lt;li&gt;Customization is very easy and anyone can customize with a basic knowledge in python&lt;/li&gt;&#xA;&lt;li&gt;It have a in built template engine for reports which is also customizable&lt;/li&gt;&#xA;&lt;li&gt;Anyone can customize it as per their trading style&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So what are the basic things which i have to consider for building a trading engine? &#xA;Which are the python modules which is useful for this project&#xA;So anyone know any material regarding this sharing a link will be very helpful....&lt;/p&gt;&#xA;" OwnerUserId="13368" LastActivityDate="2014-10-26T16:09:36.190" Title="Build a customizable trading engine in python" Tags="&lt;algorithmic-trading&gt;&lt;python&gt;" AnswerCount="2" CommentCount="7" FavoriteCount="5" ClosedDate="2014-10-29T03:50:09.413" ContentLicense="CC BY-SA 3.0" />
  <row Id="15162" PostTypeId="2" ParentId="15161" CreationDate="2014-10-26T04:58:09.497" Score="10" Body="&lt;p&gt;Firstly, you'll probably be directed to consider &lt;a href=&quot;https://github.com/quantopian/zipline&quot;&gt;Zipline&lt;/a&gt;. It's worth a look but I don't think that it's a good starting point, since:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Quantopian's developers don't have a financial background and it shows through in the Zipline source code.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Zipline is dreadfully slow if you compare it to any commercial platform with backtesting functionality in a compiled application, even the low-end retail trading platforms (e.g. NinjaTrader, Sierra, TradeStation).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Zipline isn't very convenient for trading multiple products. I think the cheapest product that has that level of functionality is Deltix.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;A modern processor should be able to backtest a moving average crossover strategy across an entire day of the OPRA feed (all products) without scheduling it overnight. Any less functionality or slower and you have poor developers. (I remember Goldman had 12-14 servers dealing with realtime OPRA in 2007-2008 and 2 persons rewrote the entire thing from scratch to target 128-bit architecture over a weekend. No reason why years of development on Zipline doesn't match up to 2 developers on a weekend before Stack Exchange existed.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are some of the major considerations that you have to make before building your backtesting engine:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;How will you be storing/serializing your market data on disk and in memory?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;One poor man's approach is to wrap it around a &lt;code&gt;pandas&lt;/code&gt; dataframe, but this comes at the cost of abstraction and will slow down your backtesting engine. &lt;code&gt;pandas&lt;/code&gt; is nice for data exploration, but not for a task that you will repeat many times.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How will you handle a data source whose size exceeds available memory?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How will you deal with unstructured market data?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How will you be storing your outputs?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;An obvious, naive problem is that you don't want to restart a backtest that took you 1 night to run if the application crashed midway. Another naive example is that you should be able to access old results from 6 months ago without repeating the backtest loop.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What's your fill logic?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What should your API expose? (e.g. Market orders, limit orders, instrument/price/volume queries, changes to fill logic)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="4660" LastEditDate="2014-10-26T05:05:57.247" LastActivityDate="2014-10-26T05:05:57.247" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15163" PostTypeId="2" ParentId="15153" CreationDate="2014-10-26T06:18:16.903" Score="2" Body="&lt;p&gt;I think you're better off identifying the strategy they are using and try to find an index that matches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However the &lt;a href=&quot;http://en.wikipedia.org/wiki/U.S._Dollar_Index&quot; rel=&quot;nofollow&quot;&gt;Dollar Index&lt;/a&gt; shows dollar performance with respect to a basket of 6 currencies - perhaps of some use USD is your base currency.&lt;/p&gt;&#xA;" OwnerUserId="7682" LastEditorUserId="467" LastEditDate="2014-11-27T01:13:49.390" LastActivityDate="2014-11-27T01:13:49.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15165" PostTypeId="1" CreationDate="2014-10-26T09:21:10.997" Score="1" ViewCount="315" Body="&lt;p&gt;In his paper &lt;a href=&quot;http://www.damianobrigo.it/liborswapdistance.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;On the distributional distance between the Libor and the Swap market models&lt;/a&gt; (and also in his book about IR modeling) D.Brigo says:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/3a6v5.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;10, 11, 12 are defined in the end of message. Do I correctly understand that &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;He simply writes lognormal dynamics in LSM world.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;He takes dynamics of forward libors in LFM, translates it to LSM world, expresses Swap rate using these forward rates.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Compares both formulas and finds that it is impossible to derive one from another?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Here are 10,11,12:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/fhuj2.png&quot; alt=&quot;enter image description here&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/pgN63.png&quot; alt=&quot;enter image description here&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/3HQgv.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="7486" LastEditorUserId="7486" LastEditDate="2014-10-26T13:15:22.150" LastActivityDate="2014-10-26T13:15:22.150" Title="Incompatibility of Lognormal Forward Model (LMM\BGM) and Lognormal Swap Model" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;lmm&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15166" PostTypeId="2" ParentId="15159" CreationDate="2014-10-26T09:41:12.543" Score="1" Body="&lt;p&gt;I saw a quote from Brigo &amp;amp; Mercurio &quot;IR models&quot; (page 26, 2.1 No-Arbitrage in Continuous Time) . May be it will help you to find answer:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Harrison and Pliska (1983) proved the following fundamental result. A&#xA;  financial market is (arbitrage free and) complete if and only if there&#xA;  exists a unique equivalent martingale measure. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="7486" LastActivityDate="2014-10-26T09:41:12.543" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15167" PostTypeId="2" ParentId="15159" CreationDate="2014-10-26T13:08:26.077" Score="1" Body="&lt;p&gt;A martingale must have constant expectation, such that adding a deterministic finite variation process $(b-r)dt$ would break the martingale property (except for when its a constant, which it is not by multiplication with $dt$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence the finite variation process must be eliminated under $Q$ for LRS to be an (equivalent) martingale measure, and as shown the only unique choice in this case is $$\phi_t=-\theta.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The assertion $\stackrel{mart}{=}$ does not represent an equality per se, it is the postulated martingale requirement under $Q$. $Q$ is then chosen by Girsanov theorem with $\phi_t=-\theta$ such that $\stackrel{mart}{=}$ holds.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-10-26T13:18:56.613" LastActivityDate="2014-10-26T13:18:56.613" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="15168" PostTypeId="1" AcceptedAnswerId="15173" CreationDate="2014-10-26T14:41:47.517" Score="8" ViewCount="1410" Body="&lt;p&gt;I have a random walk that is generated as so using python, numpy, and matplotlib&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def random_process():&#xA;    a = 0&#xA;    b = 104         #replicate starting point of SPY shown later&#xA;    rho = 0.995     #empirically good number&#xA;    X, Y = [], []&#xA;&#xA;    aSamples = np.random.normal(size=sample_size)&#xA;    bSamples = np.random.normal(size=sample_size)&#xA;&#xA;    for i in range(0, sample_size):&#xA;        X.append(i)&#xA;        Y.append(a + b)&#xA;&#xA;        a = a * rho + aSamples[i]&#xA;        b = b + rho * bSamples[i]&#xA;&#xA;    plt.plot(X, Y)&#xA;    plt.show()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This generated the following plot&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/MwH9r.png&quot; alt=&quot;Random Walk&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The walk of the b variable means that it is not guaranteed to return to any value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also generated a plot for the SPY index based on daily data for the year 2010&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/whjd6.png&quot; alt=&quot;SPY index&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How are these plots objectively different? How would one be able to tell that the first plot is generated at random and that it is impossible to predict the direction of the next value?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is attempting to build a strategy that looks exclusively at in-sample stock data as futile as trying to predict the next value of the first plot?&lt;/p&gt;&#xA;" OwnerUserId="13373" LastActivityDate="2018-01-13T01:31:39.567" Title="How is stock data objectively different to this random walk?" Tags="&lt;time-series&gt;&lt;statistics&gt;&lt;mathematics&gt;&lt;random-walk&gt;&lt;stationarity&gt;" AnswerCount="4" CommentCount="4" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="15169" PostTypeId="2" ParentId="15168" CreationDate="2014-10-26T14:51:13.190" Score="0" Body="&lt;p&gt;You have just luckily created 1 path of the random walk by chance that fitted the S&amp;amp;P. You can create another random walk and it will look much different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The efficient markets hypothesis predicts that stock prices behave as random walks, so it is likely that S&amp;amp;P looks similar to that. However, one cannot predict the next step to make a profit, because the next step is always purely random up or down.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-10-26T14:51:13.190" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15170" PostTypeId="1" CreationDate="2014-10-26T15:35:01.253" Score="2" ViewCount="124" Body="&lt;p&gt;I am searching on real-option pricing deficiencies to encounter risk-neutrality.&#xA;As we know risk-neutrality assumption, is not hold in real situations.&#xA;The problem is that I could not classified literature solutions to this problem. &#xA;In financial market and real market. &#xA;I really appreciate each piece of information.&lt;/p&gt;&#xA;" OwnerUserId="13374" LastActivityDate="2014-10-26T22:27:26.560" Title="How literature come up with risk-neutrality problem, considering that market is not really risk-neutral?" Tags="&lt;options&gt;&lt;pricing&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15171" PostTypeId="2" ParentId="15161" CreationDate="2014-10-26T16:09:36.190" Score="0" Body="&lt;p&gt;There are some other opensource projects at github along with zipline which you can check for some additional inputs for your thoughts.&#xA;Pyalgotrade is one such project where one can do back testing on their trading strategies&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://gbeced.github.io/pyalgotrade/&quot; rel=&quot;nofollow&quot;&gt;http://gbeced.github.io/pyalgotrade/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7110" LastActivityDate="2014-10-26T16:09:36.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15173" PostTypeId="2" ParentId="15168" CreationDate="2014-10-26T16:51:38.693" Score="5" Body="&lt;p&gt;I think the main difference even in this little example is the gain-loss asymmetry which is a known stylized fact: When you look at the big bump both time series posses your artificial one is perfectly symmetric whereas the real one takes longer for going up and then crashes in a relatively shorter time frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a known phenomenon in real financial time series. You can find more here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://link.springer.com/chapter/10.1007%2F978-4-431-53853-0_13&quot; rel=&quot;nofollow&quot;&gt;What Can Be Learned from Inverse Statistics?&lt;/a&gt; by Peter Toke Heden Ahlgren, Henrik Dahl, Mogens Høgh Jensen, Ingve Simonsen&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately the article is not free but you can at least access the abstract (and some may be able to access it anyway).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More pages of the article can be found here (p. 247ff.): &lt;a href=&quot;http://books.google.de/books?id=8PHE9xB3I0cC&amp;amp;lpg=PA253&amp;amp;ots=e9wRLgBwOz&amp;amp;dq=%22What%20Can%20Be%20Learned%20from%20Inverse%20Statistics%3F%22&amp;amp;pg=PP1#v=onepage&amp;amp;q&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;Google books&lt;/a&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&lt;br&gt;&#xA;More similar papers can be found here:&lt;br&gt; &lt;a href=&quot;http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=327148&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=327148&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2015-07-30T07:55:08.833" LastActivityDate="2015-07-30T07:55:08.833" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15174" PostTypeId="1" CreationDate="2014-10-26T16:59:36.930" Score="0" ViewCount="103" Body="&lt;p&gt;Is it true, that a one-period market say $(0,t)$ is arbitrage-free if the logreturn for $S_t$ is continuously distributed on $\mathbb{R}$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e., for continuous distributions on $\mathbb{R}$, there always exists a martingale measure?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. for multinomial model the market is arbitrage free if $r_1&amp;lt;r_f&amp;lt;r_m$, such that on $\mathbb{R}$ for a continuous distribution we would have $-\infty&amp;lt;r_f&amp;lt;\infty$ (which is always true).&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-10-30T21:40:19.763" LastActivityDate="2014-12-29T22:40:00.557" Title="Arbitrage-free market for continuous logreturn distribution?" Tags="&lt;no-arbitrage-theory&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15175" PostTypeId="2" ParentId="14830" CreationDate="2014-10-26T18:42:43.087" Score="0" Body="&lt;p&gt;Problem is not the API, it is more the data. Most data you request is on a daily base. &#xA;When you would like calculate it every 5 seconds for example you need a realtime feed and the fundamentals for you ratios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next problem will be that the data providers needs some time to put the 10k into their systems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I know there are no public available feed for doing things like this. If you have Bloomberg you can try this in EQS, but i think it is not realtime. &lt;/p&gt;&#xA;" OwnerUserId="13351" LastActivityDate="2014-10-26T18:42:43.087" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15176" PostTypeId="2" ParentId="15168" CreationDate="2014-10-26T21:20:03.123" Score="2" Body="&lt;p&gt;For both time-series, just plot the log returns. You will see that one is not a Random-Walk .. the S&amp;amp;P500 since you will get values that far beyond the normal distribution. Just watch this &lt;a href=&quot;http://www.ted.com/talks/benoit_mandelbrot_fractals_the_art_of_roughness?language=en&quot; rel=&quot;nofollow&quot;&gt;video&lt;/a&gt; by Benoit Mandelbrot (starting at 11min:54sec). Looking at both graphs, your eyes can fool you making you believe that both are generated by Random Walks...&lt;/p&gt;&#xA;" OwnerUserId="2570" LastActivityDate="2014-10-26T21:20:03.123" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15177" PostTypeId="2" ParentId="15170" CreationDate="2014-10-26T22:12:21.203" Score="4" Body="&lt;p&gt;This goes back to the so-called &lt;a href=&quot;http://en.wikipedia.org/wiki/Fundamental_theorem_of_asset_pricing&quot; rel=&quot;nofollow&quot;&gt;First Fundamental Theorem of Asset Pricing&lt;/a&gt; saying that markets are arbitrage free if and only if there exists at least an equivalent risk neutral measure. So the reason why we are using risk neutral measures to price options is because it allows us to represent discounted stock diffusions as martingales and therefore express the price of any derivative, whose payoff is a deterministic function of the final price of the stock, as an expected value under the risk neutral measure, for instance for a call option:&#xA;$$C(S_t,t) = \mathbb{E}_t^{\mathbb{Q}}[(S_T - K)^+e^{-r(T-t)}]=S_tN(d_1) - Ke^{-r(T-t)}N(d_2) $$&#xA;$$d_1=\left[log\frac{S_t}{K} + (r+\frac{\sigma^2}{2})(T-t)\right]\frac{1}{\sigma\sqrt{T-t}}$$&#xA;$$d_2 = d_1 - \sigma\sqrt{T-t}$$&#xA;So risk neutral valuation is just a trick &lt;strong&gt;to use no arbitrage arguments&lt;/strong&gt; to price derivatives, but of course it’s well known markets participants are risk averse and it would be actually particularly interesting to know the physical measures they use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some references:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Harrison, Michael J. and Kreps, David M, &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/0022053179900437&quot; rel=&quot;nofollow&quot;&gt;Martingales and arbitrage in multiperiod securities markets&lt;/a&gt;, Journal of Economic Theory, Volume 20, Issue 3, June 1979, Pages 381–408&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Harrison, Michael J. and Pliska, Stanley R., &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/0304414981900260&quot; rel=&quot;nofollow&quot;&gt;Martingales and stochastic integrals in the theory of continuous trading&lt;/a&gt;, Stochastic Processes and their Applications, Volume 11, Issue 3, August 1981, Pages 215–260&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Ross, Steve , &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/jofi.12092/abstract&quot; rel=&quot;nofollow&quot;&gt;The Recovery Theorem&lt;/a&gt;, Journal of Finance, forthcoming&lt;/p&gt;&#xA;" OwnerUserId="8028" LastEditorUserId="8028" LastEditDate="2014-10-26T22:27:26.560" LastActivityDate="2014-10-26T22:27:26.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15178" PostTypeId="1" AcceptedAnswerId="41182" CreationDate="2014-10-27T04:34:54.053" Score="2" ViewCount="6212" Body="&lt;p&gt;I'm trying to calculate the efficient frontier (and the optimal portfolio at the Sharpe ratio) given two vectors for a portfolio: (1) expected returns and (2) historical standard deviations.  I would like to be able to calculate this in R.  Using the &lt;code&gt;portfolioFrontier()&lt;/code&gt; function of the &lt;code&gt;fPortfolio&lt;/code&gt; package in R, I have successfully calculated the efficient frontier and optimal portfolio allocation at the Sharpe ratio using a time series of historical returns.  However, the &lt;code&gt;fPortfolio&lt;/code&gt; package only appears to allow back-testing on a time series.  I would like to calculate the efficient frontier and optimal portfolio at the Sharpe ratio for future (i.e., expected) returns.  How can I do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally this would be implemented with a function in R.  The closest resource I could find was from &lt;a href=&quot;http://www.calculatinginvestor.com/2011/06/07/efficient-frontier-1/&quot; rel=&quot;nofollow&quot;&gt;this website&lt;/a&gt; using Octave code.  I successfully translated the code to R, but the efficient frontier doesn't appear to match (or be as accurate) as the one from the R package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's my attempt in R (translating Octave code from the above website):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;expectedReturns &amp;lt;- c(4, 2, 13, 10)&#xA;covarianceMatrix &amp;lt;- matrix(c(185, 86.5, 80, 20, 86.5, 196, 76, 13.5, 80, 76, 411, -19, 20, 13.5, -19, 25), nrow=4, ncol=4, byrow=TRUE)&#xA;&#xA;# Calculate Efficient Frontier&#xA;unity &amp;lt;- rep(1, length(expectedReturns))&#xA;A &amp;lt;- unity %*% solve(covarianceMatrix) %*% unity&#xA;B &amp;lt;- unity %*% solve(covarianceMatrix) %*% expectedReturns&#xA;C &amp;lt;- expectedReturns %*% solve(covarianceMatrix) %*% expectedReturns&#xA;D &amp;lt;- A*C-B^2&#xA;&#xA;mu = seq(0, 30, by=.1)&#xA;minVar = ((A*mu^2)-2*B*mu+C)/D&#xA;minSD = sqrt(minVar)&#xA;&#xA;plot(minSD, mu)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13380" LastEditorUserId="13380" LastEditDate="2014-10-28T17:54:20.533" LastActivityDate="2018-10-28T05:49:27.560" Title="Calculating the efficient frontier from expected returns and SD" Tags="&lt;r&gt;&lt;optimization&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;&lt;mean-variance&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15179" PostTypeId="1" AcceptedAnswerId="15274" CreationDate="2014-10-27T21:45:44.943" Score="3" ViewCount="485" Body="&lt;p&gt;Assuming a set portfolio optimization problem, if all optimization inputs are kept constant, what would you expect, in terms of results, if you run the same optimization using the S&amp;amp;P500 as opposed to the S&amp;amp;P 1500, as a universe?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuitivelty, would you expect the strategy based on the S&amp;amp;P500 or S&amp;amp;P1500 to outperform?&lt;/p&gt;&#xA;" OwnerUserId="5896" LastActivityDate="2014-11-06T17:53:35.397" Title="Portfolio Optimization using S&amp;P Universes" Tags="&lt;portfolio-management&gt;&lt;optimization&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15180" PostTypeId="1" CreationDate="2014-10-27T22:40:11.093" Score="2" ViewCount="99" Body="&lt;p&gt;Are there any results for calculating the variability in the Expected Shortfall measure. I am looking for Large sample confidence intervals under Normality for Expected Shortfall or calculation of standard error for the same.&lt;/p&gt;&#xA;" OwnerUserId="2142" LastActivityDate="2014-12-27T06:04:05.780" Title="Variability in the Expected Shortfall estimator" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;normal-distribution&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15181" PostTypeId="1" AcceptedAnswerId="15182" CreationDate="2014-10-28T00:47:02.047" Score="3" ViewCount="311" Body="&lt;p&gt;My instructor has mostly self contained notes, where our textbook is mostly a reference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;She has it written that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S_t = S_0e^{(\mu - \frac{\sigma^2}{2})t + \sigma W_t} \iff dS_t = S_t(\mu dt + \sigma dW_t)$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I feel that basic differentiation of the exponential implies that on the right hand side we should have &#xA;$$dS_t = S_t \left((\mu - \frac{\sigma^2}{2})dt + \sigma dW_t \right)$$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd appreciate understanding why the $\frac{\sigma^2}{2}$ disappears from the differentiation when this is a basic rule about differentiating the exponential.  &lt;/p&gt;&#xA;" OwnerUserId="11919" LastEditorUserId="467" LastEditDate="2014-10-28T05:38:46.557" LastActivityDate="2015-02-25T00:56:36.217" Title="How to get Black Scholes' Geometric Brownian Motion differential form form the closed form?" Tags="&lt;black-scholes&gt;&lt;stochastic-calculus&gt;&lt;differential-equations&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15182" PostTypeId="2" ParentId="15181" CreationDate="2014-10-28T02:10:03.157" Score="6" Body="&lt;p&gt;You derivation here is flawed because you are deriving with respect to two processes and you do not take into account that the variable $W_t$ is stochastic and hence $S_t$ is as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, to derive $S_t$ from  $dS_t$, you have to apply &lt;a href=&quot;http://en.wikipedia.org/wiki/It%C5%8D&amp;#39;s_lemma&quot; rel=&quot;nofollow noreferrer&quot;&gt;Ito's Lemma&lt;/a&gt;, see this &lt;a href=&quot;https://quant.stackexchange.com/questions/1330/what-is-itos-lemma-used-for-in-quantitative-finance/1345#1345&quot;&gt;question&lt;/a&gt; for details. This is the &quot;classic&quot; way you see it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to do it the other way round, setting $S_t = f(W_t,t) = S_0 \exp \left[ (\mu - \frac{\sigma^2}{2}) t + \sigma W_t \right]$ and applying Ito's Lemma gives you:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ df(W_t,t) = \frac{\partial f}{ \partial t } dt + \frac{\partial f}{ \partial W_t } dW_t + \frac{\partial^2 f}{ (\partial W_t)^2 } d \langle W\rangle_t$$&#xA;$$ df(W_t,t) = S_t \left(\mu - \frac{\sigma^2}{2} \right) dt + S_t \sigma dW_t + \frac{1}{2} S_t \sigma^2 dt$$&#xA;$$ df(W_t,t) = S_t \left[ \left(\mu - \frac{\sigma^2}{2} + \frac{\sigma^2}{2} \right) dt + \sigma dW_t \right]$$&#xA;$$ df(W_t,t) = S_t ( \mu dt + \sigma dW_t ) = dS_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, essentially Ito's Lemma adds a term for the &lt;a href=&quot;http://en.wikipedia.org/wiki/Quadratic_variation&quot; rel=&quot;nofollow noreferrer&quot;&gt;quadratic variation&lt;/a&gt; of a stochastic process, $d \langle W\rangle_t$, which is 0 for deterministic processes. This is where the $\frac{\sigma^2}{2}$ appears (or disappears depending how you see it).&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2015-02-25T00:56:36.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15183" PostTypeId="2" ParentId="15180" CreationDate="2014-10-28T02:30:03.637" Score="1" Body="&lt;p&gt;I wrote this &lt;a href=&quot;http://www.unigestion.com/DocsContainer/00314897.PDF&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; a couple of years ago where we discuss this kind of topic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On page 6, you see a formula that comes from a paper from Acerbi available in Szego's &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470861541&quot; rel=&quot;nofollow&quot;&gt;book&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma^2(ES^{(N)}_\alpha(X)) \overset{N&amp;gt;&amp;gt;1}{=} \frac{1}{N(1-\alpha)^2} \int_0^{F^{-1}(1-\alpha)} dx \int_0^{F^{-1}(1-\alpha)} dy \{ \min( F(x), F(y) ) - F(x)F(y) \}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This should be a good starting point and reference for you to derive the confidence interval.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2014-10-28T05:41:41.417" LastActivityDate="2014-10-28T05:41:41.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15184" PostTypeId="1" CreationDate="2014-10-28T10:45:23.827" Score="4" ViewCount="887" Body="&lt;p&gt;I am somewhat experienced in Forex trading, but I have a question which has bothered me for quite some time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we for instance go back in time four months, to before the beginning of value loss the RUB(&lt;strong&gt;RUBLE&lt;/strong&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say that I wanted to make money on the loss of value of the RUB, with my Forex account being based on &lt;strong&gt;SEK&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I am confused about is this, what is the difference in the amount of money I make, if, we assume that USD/RUB and SEK/RUB will both increase 10% over the next time period, which also means that the USD/SEK will increase/decrease 0% against one and other. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets also assume that all currency pairs have an initial 1:1 ratio. 100 SEK = 100 USD = 100 RUB.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Mechanism A)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If I buy 100 SEK in the USD/RUB currency pair, my prior understanding was that I am actually buying 100 USD. My 100 SEK are therefore&#xA;  first exchanged for 100 USD.  When the value of the USD/RUB over the&#xA;  next period goes up 10%. I sell my 100 USD. But what do I then sell it for? &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;1) Do I get RUB? Ok, my 100 USD now gets me 110 RUB. &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;2) Do I get SEK? Ok, my 100 USD now gets me 100 SEK, so that scenario&#xA;  is out.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Then now, we continue with 1). When my 110 RUB are exchanged back for&#xA;  SEK, I should get 110 RUB/(1.1SEK/1RUB) = 100 SEK. Therefore I did not&#xA;  make any money on the shorting of RUB through USD/RUB. Despite the&#xA;  RUB loosing value against the USD! But this can't be true. So how&#xA;  does the underlying mechanism work? My understanding is, and the above&#xA;  example shows, that it doesn't matter if you buy USD/RUB or USD/SEK&#xA;  currency pairs, since what you are buying is essentially USD in both&#xA;  cases.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;But I don't believe this scenario is correct.  What is then the correct&#xA;  underlying mechanisms to facilitate a transaction where you can make&#xA;  money on shorting the RUB, or as I have been thinking, the&#xA;  increase of value of USD versus the RUB. I used to think that I am&#xA;  buying USD, so it doesn't matter what currency pair, USD/RUB or&#xA;  USD/SEK. But as I write this question now, I am getting a different understanding.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My second possible scenario for how this might go is this:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Mechanism B)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When I &quot;buy&quot; 100 SEK worth of USD/RUB, I am actually lending 100 RUB&#xA;  from the market, selling it immediately for 100 USD, then when the&#xA;  price of USD/RUB goes up 10%, to 110 RUB I sell my 100 USD getting&#xA;  110 RUB. I then return the 100 RUB to the lender, keeping 10 RUB. I&#xA;  then sell the 10 RUB for SEK, keeping 10/(1.1SEK/RUB) = 9.09 SEK, for&#xA;  a total profit of 9.09%, despite the USD/RUB, SEK/RUB actually having&#xA;  increased 10%. It would also mean that it is better were you can to trade directly in the currency pair you have, SEK/RUB rather than USD/RUB if your account is in SEK. Then you would have made 10% rather than 9.09% without any additional costs  of transactions. ( I find this a bit puzzling though, need to think about this. ) &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This scenario is kind of strange because you are lending 100 RUB, then selling it for 100 USD, meaning that you could also just be lending 100 USD directly, or buying actual 100 USD, omitting the lender, but then we would end up in Mechanism A) again. The lender is needed, so you are never actually buying any currency. You are lending the other currency pair, and buying USD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note that I am kind answering the question as I formulate it, which is something I had difficulties doing for myself earlier. It pays to write questions and try to explain them :)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second scenario would allow for a profit to be made as we can see, and one that seems to be the way it must be done. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this also constitutes a difference in how some people normally seem to think of trading in Forex, and how the Forex platform buttons usually say, &quot;Buy&quot; and &quot;Sell&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My original idea is that when you &quot;buy&quot; USD/RUB, it is the same as buying USD currency so it won't matter if it is USD/SEK, or USD/EUR, because it is perceived as the net result is you buying USD. It shouldn't matter what currency pair. You might even save the last exchange cost doing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the way people normally seem to explain it, that you are buying USD. But you are obviously not buying USD when &quot;buying&quot; USD/RUB as if you were &quot;buying&quot; a stock. You are lending RUB, selling it for USD, selling the USD later and returning the original RUB. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you &lt;strong&gt;buy a stock&lt;/strong&gt;, you are indeed buying it. Possibly not even so in CFD' markets?&#xA;When you are &lt;strong&gt;shorting a stock&lt;/strong&gt;, you enter the lending mechanisms. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in Forex currency pair trading, it must be that you are always in the lending mechanism. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;It would also explain how despite your account being in SEK, you could&#xA;  make money on going long on the SEK/RUB or &quot;buying&quot; SEK with the same&#xA;  amount of SEK as in your account. You are not buying SEK, you are&#xA;  initially lending 100 RUB, selling it for 100 SEK, making it 200 SEK&#xA;  in your account, and then buying 100 RUB for 90.9 SEK later, returning&#xA;  them, keeping (200-90.9)SEK = 109.1 SEK.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Despite the direction, you are always kind of in the mechanisms of shorting/blanking. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is this the correct understanding?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sorry for this long post.&lt;/p&gt;&#xA;" OwnerUserId="9434" LastEditorUserId="9434" LastEditDate="2014-10-28T11:58:52.613" LastActivityDate="2015-05-29T11:49:03.040" Title="How trading in currency pair works, underlying techniques and mechanisms" Tags="&lt;trading&gt;&lt;fx&gt;&lt;currency&gt;&lt;money-management&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15186" PostTypeId="1" CreationDate="2014-10-28T11:18:46.450" Score="1" ViewCount="179" Body="&lt;p&gt;I've been looking into a short piece of maths I found on pricing inflation with payment delays, and was hoping someone could confirm whether my understanding was correct or if the maths isn't quite right to begin with. The setup: suppose, for example, you have an inflation-linked cash flow that captures the level of inflation between 2014-15, but this cash flow isn't &lt;em&gt;paid&lt;/em&gt; until a year later in 2016. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the value of this cashflow is not necessarily just the expected 2014 $\rightarrow$ 2015 inflation discounted back from 2016, because you may have some correlation between interest rates and inflation. In essence, $\mathbb{E}(\text{I}_{2015} \cdot \text{DF}_{2016}) \ne \mathbb{E}(\text{I}_{2015}) \cdot \mathbb{E} (\text{DF}_{2016})$ if your discount factor and inflation are correlated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is not surprising - if inflation and rates are +100% correlated then an increase in inflation is partially &quot;hedged&quot; by rates rising, and conversely given -100% correlation a rise in inflation will be further compounded by lower discount rates. In either case, the expected value of your cashflow is nonlinear vs inflation, and you would expect it to be some function of correlation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My aim is to understand the magnitude of the &quot;convexity adjustment&quot; $ \Delta $, where $\mathbb{E}(\text{I}_{2015}) \cdot \text{DF}_{2016} = \Delta \cdot (\mathbb{E}(\text{I}_{2015}) \cdot \mathbb{E} (\text{DF}_{2016}))$. The simplistic maths I found to estimate this adjustment is below (verbatim). I am aware it's relatively crude but it doesn't need to be perfect for my purposes - I just want something in the right ballpark, better than making no adjustment at all. There are more sophisticated discussions of the maths &lt;a href=&quot;http://www.risk.net/data/asiarisk/pdf/2008/asiarisk_nov08_cuttingedge.pdf&quot; rel=&quot;nofollow&quot;&gt;such as this paper&lt;/a&gt; but I'd like to understand the simplified calculation first if possible. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Let $I_T =$ inflation fixing at time $T$, but paid on lagged date $T_L = T + D$. Write your discount factor from time al$a$ to $b$, as seen at time $c$, as $\delta_c(a,b)$. Then a payment of $I_T$ at time $T_L$ is equivalent to $I_T \cdot \delta_T(T,T_L)$ at time $T$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Letting $r$ be the short-term interest rate observed at $T$, we can say $\delta_T (T,T_L) = e^{-r D}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose now $I_T$ is lognormally distributed, variance $\sigma_I^2 T$, and $r$ is normally distributed with variance $\sigma_r^2 T$, and correlation is $\rho$. Then we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb{E}(I_T \cdot \delta_T(T,T_L)) = \exp{[-\rho \cdot \sigma_I \cdot \sigma_r \cdot D \cdot T]} \cdot \mathbb{E}(I_T) \cdot \delta_0(T,T_L) \,\,\,\, (*)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the first term is your convexity adjustment $\Delta$. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;My first question is: is all of that maths valid, if oversimplified? I'm a little suspicious of saying $\delta_{T}\,(T,T_L) = e^{-r D}$ for a &quot;short term rate&quot; $r$ if $D$ is a long delay, e.g. 5 years. It seems like by simply using $r \times D$, you're inconsistently treating $r$ like a fixed number over the period $T \to T + D$. Or is the key point that &lt;em&gt;once you reach time $T$&lt;/em&gt;, $r$ is observed and can be treated as &quot;fixed&quot;? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming the maths is ok, is $(*)$ just a consequence of the fact that for correlated normal R.V.s $X,\, Y$ we have $\mathbb{E}(e^X e^{-Y}) = \mathbb{E}(e^{X-Y})$ and $X-Y \sim N(\mu_X - \mu_Y, \sigma_X^2 + \sigma_Y^2 -2\rho \sigma_X \sigma_Y)$? If I understand correctly you can just use that relation and substitute for $X$ and $Y$ in the above. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly, in this context would $\sigma_I$ and $\sigma_r$ both be normal vols? That's how I read the maths, but the numerical example I have suggests that $\sigma_I$ should be more like a lognormal order of magnitude (e.g. nearer to 10% than 1%). Thanks for your help. &lt;/p&gt;&#xA;" OwnerUserId="13388" LastEditorUserId="13388" LastEditDate="2014-10-28T11:44:38.163" LastActivityDate="2014-10-28T11:44:38.163" Title="Pricing inflation lags" Tags="&lt;interest-rates&gt;&lt;correlation&gt;&lt;inflation&gt;&lt;convexity&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15187" PostTypeId="1" AcceptedAnswerId="15188" CreationDate="2014-10-28T13:20:53.370" Score="7" ViewCount="4960" Body="&lt;p&gt;I would like to learn more about the SABR model and ho it is used in modeling smiles in equity, FX and rates markets. &#xA;How would you explain the process and its implementation in simple steps? Any web resource or book that deals with this topic with the perspective of a practitioner? Thanks. &lt;/p&gt;&#xA;" OwnerUserId="7451" LastActivityDate="2014-10-28T14:36:02.900" Title="SABR calibration: simple explanation and implementation" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;implied-volatility&gt;&lt;stochastic-volatility&gt;&lt;volatility-smile&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15188" PostTypeId="2" ParentId="15187" CreationDate="2014-10-28T14:29:58.973" Score="7" Body="&lt;p&gt;There are lots of papers online and here are a few I would suggest &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.math.umn.edu/finmath/modeling/Materials/Vinar_presentation_Jan2012.pdf&quot; rel=&quot;noreferrer&quot;&gt;math.umn&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.riskworx.com/insights/sabr/sabr.html&quot; rel=&quot;noreferrer&quot;&gt;riskworx&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.itwm.fraunhofer.de/fileadmin/ITWM-Media/Zentral/Pdf/Berichte_ITWM/2011/bericht_202.pdf&quot; rel=&quot;noreferrer&quot;&gt;G. Dimitroff, J. de Kock&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.fam.tuwien.ac.at/~sgerhold/pub_files/sem12/v_sibetz_nowak.pdf&quot; rel=&quot;noreferrer&quot;&gt;Nowak, Sibetz&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I you have matlab there is an step step &lt;a href=&quot;http://www.mathworks.co.uk/help/fininst/calibrating-the-sabr-model.html&quot; rel=&quot;noreferrer&quot;&gt;example&lt;/a&gt; to calibrate SABR model. Since it uses the financial toolbox of matlab for a few functions I dont think you can replicate it in any other language. There must be C++ code available but I did not look for it. &lt;/p&gt;&#xA;" OwnerUserId="1386" LastEditorUserId="1386" LastEditDate="2014-10-28T14:36:02.900" LastActivityDate="2014-10-28T14:36:02.900" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15189" PostTypeId="2" ParentId="15069" CreationDate="2014-10-28T16:10:15.943" Score="1" Body="&lt;p&gt;It depends whether the underlying prices you have are raw (unadjusted) or already adjusted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Splits and dividends are two different cases:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;When dividend is paid the stock price drops by the dividend amount, but strike prices are not changed.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;When there is a split (or any other corporate action like capital restructure, spin off), new option series are issued with adjusted strikes. In that case the strikes should correspond to the new (post-split) underlying price.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Shares of ABC were traded at 100 per share. Strikes were 80, 90, 100, 110, 120.&#xA;Split occurs with ration 1:2. The day after the split, a share of ABC is 50, and new adjusted strikes are issued: 40, 45, 50, 55 and 60.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's important to remember, that old strikes are being listed for a while after the strike, but these options become &quot;special&quot; and should not be included in the analysis.&lt;/p&gt;&#xA;" OwnerUserId="2909" LastActivityDate="2014-10-28T16:10:15.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15190" PostTypeId="1" CreationDate="2014-10-28T16:53:16.067" Score="-1" ViewCount="96" Body="&lt;p&gt;I am looking to build a web based Equity chart to display performance of FX trading strategies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to hear opinions and advice on a few areas that I am unsure about.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Granularity&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equity can - and typically does - change every tick. Should I therefore save equity every tick? If I do I am likely to be saving a lot of data! And then the display of this data will also be a challenge - as there would be a lot of noise. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I am to save a snapshot every moment in time, what would be a recommend timeframe? Every minute?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Optimizing for download&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the amount of data in the equity chart could be quite large, what are some recommend approaches to optimize for download?&#xA;Would it be advisable to somehow smooth the equity curve and download just a vector line rather than downloading a csv/json with many thousands of datapoints?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any feedback - its really appreciated.&lt;/p&gt;&#xA;" OwnerUserId="1411" LastActivityDate="2015-04-27T14:35:34.353" Title="Equity Chart - design and granularity" Tags="&lt;fx&gt;&lt;charts&gt;&lt;equity-curve&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15191" PostTypeId="1" CreationDate="2014-10-28T18:23:10.217" Score="2" ViewCount="1664" Body="&lt;p&gt;Lets say I have some strategy (long/short) backtested for certain period. Strategy has entries/exits only at the end of the day and may have overnight positions hold. Now I would like to compare returns of my strategy to the market (for instance SPY as benchmark) and find correlation coeff. between my returns and market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question is what's right/standard rule for calculating returns for strategy ?&#xA;I'm considering using Unrealized+Realized value&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following is simplified matlab code for single stock (&lt;em&gt;there is no transaction cost  accounted&lt;/em&gt;).&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;&quot;Backtester&quot;&lt;/h1&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% positions sizes for every day &#xA;positions = [2 1 -10 15 5 0];&#xA;&#xA;% execution prices (daily closes)&#xA;price=[50.0 51.0 49.0 51.0 53.0 52.0];&#xA;&#xA;% actual 'trades' &#xA;tradedQty = diff([0 positions]);&#xA;&#xA;% here cash for positions&#xA;cash = cumsum(-tradedQty.*price);&#xA;&#xA;% and here I calculate my mark-to-market potrtfolio value&#xA;markToMarketPnL = cash + (positions).*price;&#xA;&#xA;disp(markToMarketPnL)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It gives MTM (actually real+unreal) for every day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;0     2     0   -20    10     5&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I need to compare it to market return. For finding market returns I use SPY's prices and returns as $ r_m = \frac{SPY(i)}{SPY(i-1)} - 1 $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the question now - what is 'standard' way to calculting daily returns for my 'strategy' to be compared with $r_m$ in sense of finding correlation coefficient or $\beta$ etc ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First thought is to use following : &#xA;$$&#xA;r(i) = \frac{MTM(i)}{MTM(i-1)} - 1&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in this case sometimes I may get values near/equal to 0 in denominator and my ret. goes to infinity (see results of example).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Someone uses 'invested money' as denominator, but I'm unsure about this. What should be in this case there in denominator ? long+short exposure for previous day ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another idea I got is to use NAV (net asset value) for portfolio to derive returns. For single stock it'd be equal to used stock prices of course, &#xA;but for many stocks it has sense of price of some 'synthetical' portfolio&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;NAV(i) = \frac{\sum_{j \in long}{pos(j,i)\cdot mktPrice(j,i)} + \sum_{k \in short}{\lvert pos(k,i)\rvert \cdot mktPrice(k,i)}}{\sum_{j \in long}{pos(j,i)} + \sum_{k \in short}{\lvert pos(k,i)\rvert}}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $pos(i,j)$ - position size of i-th stock at j-th day, $mktPrice(i,j)$ - close/current price of i-th stock at j-th day&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pls advice or point me to good resource for these kind of things.&lt;/p&gt;&#xA;" OwnerUserId="13348" LastEditorUserId="467" LastEditDate="2014-10-29T07:56:59.780" LastActivityDate="2014-10-29T07:56:59.780" Title="How to calculate returns of backtested strategy?" Tags="&lt;quant-trading-strategies&gt;&lt;backtesting&gt;&lt;returns&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15194" PostTypeId="1" AcceptedAnswerId="15230" CreationDate="2014-10-29T01:29:12.420" Score="1" ViewCount="207" Body="&lt;p&gt;I'm looking into modeling the relationship between EPS announcement surprises with long-term returns (1 quarter to 3 years with intervals). I've based my current methodology off papers looking at the short term effect (&lt;a href=&quot;https://econ.duke.edu/uploads/assets/Undergraduate/Past%20Honors%20Theses/Sam%20Lim%20Final%20Formatted.pdf&quot; rel=&quot;nofollow&quot;&gt;example&lt;/a&gt;) but I think that the long time horizon will require a more comprehensive solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My ultimate goal is to be able to say with some degree of certainty whether or not beating or missing analysts' EPS estimates has a long term effect on the performance of a stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've set up a regression with variables as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've defined EPS announcement surprises as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\text{SUPRISE}_i=\dfrac{\text{EPS}_{actual,i}-\text{EPS}_{estimate,i}}{\text{EPS}_{actual,i}}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to create 2 variables for positive and negative surprises (POSSUPRISE and NEGSUPRISE)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Defined Returns as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\text{RETURN}_t=\ln(\text{price}_{i+t})-\ln(\text{price}_i)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $t$ is the final day of the time period I am analyzing&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so my current regression looks like this&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\text{RETURN}_t = \beta_0 + \beta_p \text{POSSUPRISE}_{i}+\beta_n \text{NEGSUPRISE}_{i}+\epsilon_t&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've also done a regression with indicator variables for beating and missing estimates&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've run this over a sample set of 30 large cap stocks with EPS data from 1999-2009 and the appropriate pricing data and so far have had mixed results, I found some correlation between 2 year returns and large earnings surprises, but before I explore this question further, I want to make sure I'm going about it the right way&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is a regression of individual instances the best way to analyze this problem? Should I use time series methods like VAR instead?&lt;/li&gt;&#xA;&lt;li&gt;What is the best way to incorporate broad market movement into the returns data? Should I just adjust the return variable to account for the return on an index over the time period as well or is there a better solution?&lt;/li&gt;&#xA;&lt;li&gt;Am I better off just considering the surprise variable or should I try to control for other variables in the model such as actual EPS, Market Cap, etc?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="13396" LastEditorUserId="467" LastEditDate="2014-10-29T03:29:21.233" LastActivityDate="2014-10-31T09:36:30.927" Title="How to model the effect of earnings surprises on long-term returns?" Tags="&lt;time-series&gt;&lt;returns&gt;&lt;modeling&gt;&lt;regression&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15195" PostTypeId="1" CreationDate="2014-10-29T03:27:30.183" Score="2" ViewCount="1702" Body="&lt;p&gt;The Black Derman &amp;amp; Toy (&lt;a href=&quot;http://en.wikipedia.org/wiki/Black%E2%80%93Derman%E2%80%93Toy_model&quot; rel=&quot;nofollow&quot;&gt;BDT&lt;/a&gt;) model is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d(\ln\,r)=\left(\theta(t)-\frac {d(\ln\sigma(t))}{dt}\ln r\right)\,dt+\sigma(t) \, dW.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can one rewrite the BDT model as $dr=A\,dt+B\, dW$, using Ito??&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I searched everywhere but no answer.&lt;/p&gt;&#xA;" OwnerUserId="13398" LastEditorUserId="467" LastEditDate="2014-10-29T03:32:58.280" LastActivityDate="2015-11-04T14:25:20.530" Title="How to express the Black Derman &amp; Toy Model in a $dr=A\,dt+B\, dW$ form?" Tags="&lt;interest-rates&gt;&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;itos-lemma&gt;&lt;bdt&gt;" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15198" PostTypeId="1" AcceptedAnswerId="15232" CreationDate="2014-10-29T12:09:52.347" Score="6" ViewCount="6475" Body="&lt;p&gt;I have a code that finds the implied volatility using the Newton-Raphson method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I set the number of trial to 1000 but sometimes it fails to converge and doesn't find the result. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a better method to find the result? Are there any technical conditions in which this numerical method is expected to fail to converge to the solution? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the C# code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    public double findIV(double S, double K, double r, double time, string type, double optionPrice)&#xA;    {&#xA;        int trial= 1000;&#xA;        double ACCURACY = 1.0e-5;&#xA;        double t_sqrt = Math.Sqrt(time);&#xA;&#xA;        double sigma = (optionPrice / S) / (0.398 * t_sqrt);    // find initial value  &#xA;        for (int i = 0; i &amp;lt; trial; i++)&#xA;        {&#xA;            Option myCurrentOpt = new Option(type, S, K, time, r, 0, sigma); // create an Option object&#xA;            double price = myCurrentOpt.BlackScholes();&#xA;            double diff = optionPrice - price;&#xA;            if (Math.Abs(diff) &amp;lt; ACCURACY)&#xA;                return sigma;&#xA;            double d1 = (Math.Log(S / K) + r * time) / (sigma * t_sqrt) + 0.5 * sigma * t_sqrt;&#xA;            double vega = S * t_sqrt * ND(d1);&#xA;            sigma = sigma + diff / vega;&#xA;        }         &#xA;        throw new Exception(&quot;Failed to converge.&quot;); &#xA;    }&#xA;&#xA;    public double ND(double X)&#xA;    {&#xA;        return (1.0 / Math.Sqrt(2.0 * Math.PI)) * Math.Exp(-0.5 * X * X);&#xA;    }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7451" LastEditorUserId="467" LastEditDate="2014-10-30T01:28:46.953" LastActivityDate="2014-10-31T10:27:05.567" Title="What is an efficient method to find implied volatility?" Tags="&lt;programming&gt;&lt;implied-volatility&gt;&lt;numerical-methods&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15199" PostTypeId="1" CreationDate="2014-10-29T13:09:07.113" Score="5" ViewCount="47287" Body="&lt;p&gt;What is the difference between this two concepts?&lt;/p&gt;&#xA;" OwnerUserId="13402" LastEditorUserId="467" LastEditDate="2014-10-30T04:31:33.443" LastActivityDate="2016-08-04T14:20:41.947" Title="What is the difference between asset management and wealth management?" Tags="&lt;risk-management&gt;&lt;asset&gt;" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15200" PostTypeId="2" ParentId="15199" CreationDate="2014-10-29T13:38:02.520" Score="4" Body="&lt;p&gt;The definitions will vary from organization to organization but generally:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Wealth Management is the management (either direct or through&#xA;distribution to other managers) of an individual investor’s money&#xA;with an emphasis on service and client relations&lt;/li&gt;&#xA;&lt;li&gt;Asset Management generally can describe both managing individual&#xA;assets (like Wealth Management) and managing collective investments&#xA;(such as a pension fund), so Wealth Management is more a subset of&#xA;Asset Management&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="13396" LastActivityDate="2014-10-29T13:38:02.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15201" PostTypeId="2" ParentId="15190" CreationDate="2014-10-29T13:53:50.800" Score="1" Body="&lt;p&gt;&lt;strong&gt;Granularity&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Display granularity&lt;/strong&gt;: You should choose granularity based on screen size constraint. Most screens support about 100 pixels per inch and can display 2000 discrete pixels in the horizontal axis. Let's say you store 2000 minutes of data. It will be impossible for a regular monitor screen to resolve the difference if you displayed them as points in 1 minute resolution or 0.5 minute resolution.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Storage granularity&lt;/strong&gt;: The general rule of the thumb is to &lt;strong&gt;store as much as you can&lt;/strong&gt;. It depends on your storage capability and data sources (and consequently, their average rate of data transfer). Firstly, what's a reasonable maximum amount of storage space you can buy and maintain? Plot that over a 5-10 year horizon. Then, experiment by storing 1 day (preferably, many days and take the average) of the highest resolution data. Determine how much storage space that takes, e.g. 20 MB per trading day, then you need about 5 GB of storage space for your first year. Assume 3x multiplying factor in storage needs as safety margin, so you need 5+15+45+135+405=605 GB of space in 5 years to be safe. If you think you'll only have 300 GB of space in 5 years, then you have to make the appropriate adjustments, i.e. instead of storing data every second, store it every 2 seconds.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Optimizing for download&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It depends on your users! Without any further information, my best guess is that most of your users are human users and not machines/programs, so CSV is probably the most reasonable.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2014-10-29T13:53:50.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15202" PostTypeId="1" AcceptedAnswerId="15206" CreationDate="2014-10-29T15:19:42.260" Score="4" ViewCount="1817" Body="&lt;p&gt;Suppose I am long one stock and short an index in a ratio effectively making market beta as zero and I close the position with some positive P&amp;amp;L.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How should I calculate the return for the portfolio above?&#xA;How do I effectively calculate the Sharpe ratio for above long-short and market neutral portfolios?&lt;/p&gt;&#xA;" OwnerUserId="7422" LastEditorUserId="467" LastEditDate="2014-10-30T04:34:24.947" LastActivityDate="2014-10-30T04:34:24.947" Title="How to calculate the Sharpe ratio for market neutral strategies?" Tags="&lt;sharpe-ratio&gt;&lt;performance-evaluation&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15203" PostTypeId="2" ParentId="15198" CreationDate="2014-10-29T16:18:56.417" Score="2" Body="&lt;p&gt;Bracketing methods such as Bisection and Regula Falsi are always known to converge but they are very slow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Newton Raphson and secant methods are fast (quadratic convergence) but has convergence problems. Google for Newton Raphson convergence pitfalls. Classical ones such as&quot;Trapped in local minima&quot;, &quot;Diverge instead of converge&quot; etc&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Algorithms such as Dekker and Brent combine bracketing and quadratic convergence features  and they are sure to converge and relatively faster as well.&lt;/p&gt;&#xA;" OwnerUserId="7422" LastActivityDate="2014-10-29T16:18:56.417" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15205" PostTypeId="1" CreationDate="2014-10-29T17:04:40.193" Score="2" ViewCount="136" Body="&lt;p&gt;It seems there are models that study the market timing ability of funds. Models such as the Treynor-Mazuy and Merton-Henriksson. One can also study the bull beta and compare it to a bear beta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem here is to analyze a series of trade I have made on a stock and be able to say whether or not I had market timing abilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason, I think, I can't use the models mentioned is because they don't seem to be &quot;trading-oriented&quot;. In my opinion, the act of buying and selling can only bias a comparison between the returns of my position and those of the underlying stock. Nor do I think that looking only at the bottom line is a good indication.&lt;/p&gt;&#xA;" OwnerUserId="5005" LastActivityDate="2014-11-28T21:06:22.233" Title="Market Timing Performance for a single stock" Tags="&lt;trading&gt;&lt;performance-evaluation&gt;&lt;performanceanalytics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15206" PostTypeId="2" ParentId="15202" CreationDate="2014-10-29T17:27:08.953" Score="3" Body="&lt;p&gt;There is no universally accepted answer for the main problem here which is the denominator for the return calculation is zero or near zero.  There are a few common  solutions to this issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most simple solution is to use the total portfolio notional as the divisor for the PnL. This can be considered the PnL contribution of that long/short sub-portfolio to the total portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another common but more complicated solution is based on capital locked up.  To get into long/short positions or portfolios of these positions you often have to post some margin or a margin on a portfolio of these positions.  The return is than calculated against the cash locked up to meet the margin.  Now the margin varies from day-to-day so you can use this daily number or in real life more commonly you use a constant number larger than the actual margin which is buffer you have set aside to meet this margin.  For portfolios of these positions this is similar to risk-budgeting which approximately proportions the cash locked up for each sub-portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The nice thing the Sharpe ratio will be very similar no matter which method is used.  As long as the returns and volatility are both be calculated using the same scale it doesn't matter if the scale is large or small for a ratio.&lt;/p&gt;&#xA;" OwnerUserId="5689" LastActivityDate="2014-10-29T17:27:08.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15207" PostTypeId="2" ParentId="15205" CreationDate="2014-10-29T17:53:24.863" Score="2" Body="&lt;p&gt;For analyzing a series of trades on a single stock over a period of time.  You can understand your market timing contribution by comparing your actual return to the return from consistently holding your average exposure to the stock over that whole period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To then get a feeling for how much you are contributing compared to how much you are messing with a pure (partial beta) buy-and-hold strategy you can calculate the &lt;a href=&quot;http://en.wikipedia.org/wiki/Information_ratio&quot; rel=&quot;nofollow&quot;&gt;information ratio&lt;/a&gt;.  Consistently high information ratios over multiple trades would signal to me that your trading is adding value over the risk I would have by holding your average exposure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the portfolio of many stocks quantifying how good you are at timing a particular stock might not be very meaningful unless you have a lot of data from various trades (high frequency trading). It might be easier and more meaningful to measure how good of an active manager you are.  In which case information ratio on the whole portfolio would be one of many good measures.&lt;/p&gt;&#xA;" OwnerUserId="5689" LastEditorUserId="5689" LastEditDate="2014-10-29T20:27:18.883" LastActivityDate="2014-10-29T20:27:18.883" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="15209" PostTypeId="2" ParentId="7929" CreationDate="2014-10-29T19:05:48.097" Score="1" Body="&lt;p&gt;For any data that is not strictly tabular and unchanging in schema, you should rule out SQL solutions. Option pricing fits that description in my experience, because high-liquidity stocks, currencies, or bonds, will have a far bigger set of strikes and maturities than lower liquidity instruments. Thus in a relational database you will have to have columns for strikes and maturities, with clunky joins everywhere, whereas in NoSQL such as Mongo, you can have an atomized &quot;document&quot; that has all the data associated with a timestamp, that is extremely rapid to query, and is also flexible for meta-data. Who hasn't found the need to for meta data, even in financial time series? You'll be able to go back and systematically add new structures and substructures to your data without messing up the whole schema. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My own experience with Mongo is very positive. Once you have familiarised yourself with its JSON-based query syntax, it's easy, and extremely fast on cheap commodity hardware. It's also massively easy to setup. That is definitely not the case for the relational databases on equivalent hardware. Another bonus is that you'll learn JSON - a very useful and widely use format for data that allows you to export &quot;flat&quot; data CSV-style, but can also do hierarchical nesting which can be really useful, without going to the overkill that is xml.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If extremes of consistency are what is necessary, then SQL is your bet. Stuff like: this salary &lt;em&gt;MUST&lt;/em&gt; be linked to an &lt;em&gt;EXISTING&lt;/em&gt; employee that is &lt;em&gt;NOT&lt;/em&gt; on sabbatical. This type of rule can be embedded in the database, which will &lt;em&gt;enforce&lt;/em&gt; consistency, unlike the more flexible (and consequently more dangerous) NoSQL products where these types of rule must be performed in the terminal. But when we're talking about atomised data with no dependencies such as a vol surface, this consistency enforcement is probably not even going to be used. The design &quot;fit&quot; of SQL is overkill and comes with heavy burdens. Recall that SQL was designed for business logic in the 70s. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't believe those who tell you Mongo or other NoSQL is not reliable when it comes to data safety. That is false. There are all the usual tools to guarantee writes, journaling, redundant servers, everything you might need for multiple layers of security, including incremental backup to cloud. Redis of course could be problematic in that respect. But the established NoSQL databases are safe and reliable, indeed possibly &lt;em&gt;more&lt;/em&gt; safe if you do not have a skilled DB administrator who knows how to get a complex SQL system up and running again on failure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally if your use case is only single-machine, then strongly consider HDF5. This will outperform and be better suited to a large financial data mining application than any of the database technologies. It has been designed exactly for what you require (massively fast, flexible queries and schemas) but of course it's not as strong for sharing.&lt;/p&gt;&#xA;" OwnerUserId="954" LastEditorUserId="954" LastEditDate="2014-10-31T22:16:48.587" LastActivityDate="2014-10-31T22:16:48.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15211" PostTypeId="1" CreationDate="2014-10-29T20:51:32.193" Score="4" ViewCount="85" Body="&lt;p&gt;For example, suppose we were trading a strategy which buys one &lt;a href=&quot;https://www.theice.com/products/219/Brent-Crude-Futures&quot; rel=&quot;nofollow&quot;&gt;Brent&lt;/a&gt; contract and sells one &lt;a href=&quot;https://www.theice.com/products/909/Gasoil-Futures&quot; rel=&quot;nofollow&quot;&gt;Gasoil&lt;/a&gt; contract. The minimum price fluctuation for a Brent contract is \$10, and the minimum price fluctuation for Gasoil is \$25, although the contract price for each is on the same order of magnitude. I have heard that the spread should be priced to take this discrepency into consideration, but I'm not sure I see how or why.&lt;/p&gt;&#xA;" OwnerUserId="13405" LastActivityDate="2014-10-29T20:51:32.193" Title="Is it important to equalize the minimum price fluctuation in pairs trading?" Tags="&lt;futures&gt;&lt;pairs-trading&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15214" PostTypeId="2" ParentId="15198" CreationDate="2014-10-30T03:21:52.010" Score="2" Body="&lt;p&gt;Below is the root search algorithm code I wrote in college. This is written in octave. It's simple to understand and re-write in C++.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Develop numerical methods algos as a separate module and integrate with your pricing and other code&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to WARN you to re-check for bugs. It always converges for my objective functions&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First function is Dekker method similar to Brent. Brent is more better. Second function is bracketing method. Either one can be used for root search&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;##&#xA;## Dekker root search.&#xA;##&#xA;## Eg call: dekker(@expMinusOne, -2, 3) &#xA;##&#xA;function c = dekker(f, lowerBound, upperBound)&#xA;&#xA;    MAX_ITER = 50;&#xA;    iterations = 0;&#xA;&#xA;    a = lowerBound;&#xA;    b = upperBound;&#xA;&#xA;    assert(validateBracket(f, a, b), &quot;Given bounds doesn't bracket the root&quot;);&#xA;    assert(!hasMultipleRoots(f, a, b), &quot;Given bounds has mutiple roots&quot;);&#xA;&#xA;    fa = f(a);&#xA;    fb = f(b);&#xA;&#xA;    #printf(&quot;fa = %f, fb = %f\n&quot;, fa, fb);&#xA;&#xA;    if(abs(fa) &amp;lt; abs(fb))&#xA;        c = a;&#xA;        d = b;&#xA;    else&#xA;        c = b;&#xA;        d = a;&#xA;    endif&#xA;&#xA;    linOps = 0;&#xA;&#xA;    do&#xA;        s = linearInterpolation(f, c, d);&#xA;        m = bisectionPoint(c, d);&#xA;&#xA;        a = c;&#xA;        b = d;&#xA;&#xA;        # LI/LE and BI points are on same side of root&#xA;        if(f(s) * f(m) &amp;gt;= 0)&#xA;            # New root and lower bound are on same side of the root&#xA;            # We can adjust one side of the bracket&#xA;            if(f(c) * f(s) &amp;gt; 0)&#xA;                if(abs(c - m) &amp;lt; abs(c - s) &amp;amp;&amp;amp; linOps &amp;lt; 4)&#xA;                    c = s;&#xA;                    linOps++;&#xA;                else&#xA;                    c = m;&#xA;                    linOps = 0;&#xA;                endif&#xA;            # New root and lower bound are on different sides of the root&#xA;            # We can adjust both sides of the bracket&#xA;            else&#xA;                # Reduce the bracket.&#xA;                if(abs(c - s) &amp;lt; abs(c - m))&#xA;                    c = s;&#xA;                else&#xA;                    c = m;&#xA;                endif&#xA;                d = a;&#xA;            endif&#xA;        # LI/LE and BI points are on different sides of root. &#xA;        # We can adjust both sides of the bracket&#xA;        else&#xA;            if(f(c) * f(s) &amp;gt; 0)&#xA;                c = s;&#xA;                d = m;&#xA;                linOps++;&#xA;            else&#xA;                c = m;&#xA;                d = s;&#xA;                linOps = 0;&#xA;            endif&#xA;        endif&#xA;&#xA;        #printf(&quot;c = %f, d = %f\n&quot;, c, d);&#xA;&#xA;        # Check for Convergence&#xA;        if(c == d)&#xA;            #printf(&quot;DEKKER ROOT = %f in %d iterations.\n&quot;, c, iterations);&#xA;            break;&#xA;        endif&#xA;&#xA;        iterations++;&#xA;    until (iterations == MAX_ITER)&#xA;&#xA;    if(iterations == MAX_ITER)&#xA;        #printf(&quot;DEKKER ROOT = %f for maximum iterations %d.\n&quot;, c, MAX_ITER);&#xA;    endif&#xA;&#xA;endfunction&#xA;&#xA;function s = linearInterpolation(f, a, b)&#xA;    s = a - (b - a) * f(a)/(f(b) - f(a));&#xA;endfunction&#xA;&#xA;function m = bisectionPoint(a, b)&#xA;    m = (a + b)/2;&#xA;endfunction&#xA;&#xA;function r = hasMultipleRoots(f, a, b)&#xA;    if(f(a) == f(b))&#xA;        r = true;&#xA;    else&#xA;        r = false;&#xA;    endif&#xA;endfunction&#xA;&#xA;function r = validateBracket(f, a, b)&#xA;    if(f(a) * f(b) &amp;lt; 0)&#xA;        r = true;&#xA;    else&#xA;        r = false;&#xA;    endif&#xA;endfunction&#xA;&#xA;&#xA;##&#xA;##  regulaFalsi( f, a, b, yAcc )&#xA;##&#xA;## rootsearching by regulaFalsi method &#xA;##&#xA;## f is a real numeric function s.t. f( a ) * f( b ) &amp;lt; 0.0&#xA;## xAcc convergence threshold &#xA;## nIter max number of iterations&#xA;function [c, x] = regulaFalsi( f, a, b, yAcc )&#xA;&#xA;    fb = f( b );  &#xA;    fa = f( a );&#xA;&#xA;    if ( fa * fb &amp;gt;= 0.0 ), &#xA;        error(&quot; f( a ) * f( b ) &amp;gt;= 0.0 &quot; ); &#xA;    endif&#xA;&#xA;    # init loop variables&#xA;    c = a;  &#xA;    iter = 1;  &#xA;    x = [];  &#xA;&#xA;    do&#xA;        cOld = c;     # save previous value of c. Guard for infinite loop&#xA;        c  = a - fa * ( b  - a ) / ( fb - fa );  # new point&#xA;        fc = f( c );&#xA;&#xA;        if ( fc * fb &amp;lt; 0.0 )  # update interval&#xA;           a  = c;&#xA;           fa = fc;&#xA;        else &#xA;           b  = c;&#xA;           fb = fc; &#xA;        endif&#xA;&#xA;        x(iter,:)=[iter, c]; iter++;  # unnecessary, just for display&#xA;&#xA;    until ( abs(fc) &amp;lt; yAcc || cOld == c ) # Exit criteria is on yAcc.&#xA;endfunction&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7422" LastEditorUserId="7422" LastEditDate="2014-10-30T03:44:02.213" LastActivityDate="2014-10-30T03:44:02.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15215" PostTypeId="1" AcceptedAnswerId="25803" CreationDate="2014-10-30T06:51:32.660" Score="10" ViewCount="7828" Body="&lt;p&gt;Say we are looking at European Call options in a toy environment with zero deterministic interest rates, a stock paying no dividends, no repo rates etc...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let &lt;span class=&quot;math-container&quot;&gt;$C(T,K)$&lt;/span&gt; be the price of a call with expiry &lt;span class=&quot;math-container&quot;&gt;$T$&lt;/span&gt; and strike &lt;span class=&quot;math-container&quot;&gt;$K$&lt;/span&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If for &lt;span class=&quot;math-container&quot;&gt;$T1 &amp;lt; T2$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$C(T1,K) &amp;gt; C(T2,K)$&lt;/span&gt; then this is calendar arbitrage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please explain how should one exploit this arbitrage opportunity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="8014" LastEditorUserId="26595" LastEditDate="2019-08-05T11:43:25.000" LastActivityDate="2019-08-05T11:43:25.000" Title="How to exploit calendar arbitrage?" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;arbitrage&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="7" ContentLicense="CC BY-SA 4.0" />
  <row Id="15216" PostTypeId="2" ParentId="14679" CreationDate="2014-10-30T09:20:37.753" Score="1" Body="&lt;p&gt;I try to give what I at any rate think is a clear explanation of the Fourier transform approach to option pricing for various models including Heston in More Mathematical Finance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could also try Lewis's book Option Valuation Under Stochastic Volatility. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2014-10-30T09:20:37.753" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15219" PostTypeId="1" AcceptedAnswerId="15222" CreationDate="2014-10-30T13:09:04.817" Score="5" ViewCount="2837" Body="&lt;p&gt;I have a time series of daily data that I want to calibrate GBM parameters $\mu$ and $\sigma$ to.  Using the discretized solution&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;S_{t_{i+1}} = S_{t_i}\exp\left(\left(\mu - \frac{\sigma^2}{2}\right)\Delta t + \sigma \sqrt{\Delta{}}Z_{i+1}\right),&#xA;$$&#xA;calibrating the parameters $\mu$ and $\sigma$ to a given time series with $n$ values turns out to be simply computing&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\sigma = \frac{std(R)}{\sqrt{\Delta t}}, \qquad \mu = \frac{\mathbb{E}[R]}{t} + \frac{\sigma^2}{2},&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $R$ is a vector of log returns with components $R_{i+1} = \log S_{t_{i+1}} / S_{t_i}$, $1 \leq i \leq n-1$.  The term $std(R)$ denotes the standard deviation of $R$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, the time step $\Delta t = t_{i+1} - t_i$ is supposed to be the length of time between values in the series.  Recall the closed-form solution to a GBM evaluated at &quot;final&quot; time $T$ is&#xA;$$&#xA;S_T = S_0\exp\left(\left(\mu - \frac{\sigma^2}{2}\right)T + \sigma W(T)\right).&#xA;$$&#xA;So, if I have a time series history of daily prices spanning exactly one year (say 28 Oct 2013 - 28 Oct 2014), what should $T$ and $\Delta t$ be?  In addition, $n=253$ in my series, even though the dates cover 365 days.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some results: using natural gas futures prices with dates given above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$T = 1$ and $\Delta t = 1/365$, I get $\sigma = 0.32$ and $\mu = 0.07$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$T = 1$ and $\Delta t = 1/253$, I get $\sigma = 0.27$ and $\mu = 0.05$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$T = 365$ and $\Delta t = 1$, I get $\sigma = 0.02$ and $\mu = 0.0002$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$T = 253$ and $\Delta t = 1$, I get $\sigma = 0.02$ and $\mu = 0.0002$ (same as before).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first two seem more reasonable for my time series.  Any thoughts?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2017-07-22T16:41:17.297" Title="Calibration of a GBM - what should dt be?" Tags="&lt;time-series&gt;&lt;simulations&gt;&lt;brownian-motion&gt;&lt;calibration&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15220" PostTypeId="1" CreationDate="2014-10-30T14:46:02.967" Score="1" ViewCount="586" Body="&lt;p&gt;I am searching for references on pricing callable bonds. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've not find any rigorous mathematical approach on the web. All I found was some soft approaches in a discrete framework.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&#xA;First of all I would like to stress that I am true beginner on bond market modeling. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So an answer containing just a high level language/terms (in a comparative the sense with programming languages not high register of English) helps (since gives a direction to search, teaches me more terms and gives me a better global visual of bond market) but still doesn't answer my first question directly and multiply my questions instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will be more precise about what I am asking. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;What I want to understand is: &lt;/p&gt;&#xA;  &#xA;  &lt;ol&gt;&#xA;  &lt;li&gt;how to right mathematically the payoff of a callable&lt;/li&gt;&#xA;  &lt;li&gt;how to derive from this payoff formula the relation that states that the price of a callable bond is equal to the price of straight&#xA;  bond plus a call option (an implicit question is to precise the&#xA;  underlying of this call)&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;$$P_{\text{Callable Bond}}=P_{\text{Option-Free Bond}}-P_{\text{Option-Free Bond}}$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Let $D(t,T)$ be the discount factor at the time $t$ of a $T$-claim, $ZC(t,T)$ the value of a zero-coupon at time $t$ and $B(t,T)$ the price of a bearing-coupon bond of maturity $T$ paying coupon $c$ at dates $(T_1,T_2, \cdots, T_N) $.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the payoff of a callable bond $\Pi_{CB}$ of maturity $T$ callable at $T^*$ (with $T_j&amp;lt;T^*\leq T_{j+1}$) at a fixed strike $K$ can be written as follows&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Pi_{CB}(0,T)= \sum_{i=1}^j c D(0,T_i) - D(0,T^*)\left(B(T^*,T)-k\right)_+ +\left[\sum_{k=j+1}^N c D(0,T_k) + D(0,T)\right]\mathbf 1_{\{B(T^*,T)&amp;gt; K\}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I write ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could someone help with that please? &lt;/p&gt;&#xA;" OwnerUserId="3534" LastEditorUserId="3534" LastEditDate="2014-11-19T14:07:46.683" LastActivityDate="2014-11-19T14:07:46.683" Title="(Beginer on bond market) References on callable bond's pricing" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;reference-request&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15221" PostTypeId="2" ParentId="15220" CreationDate="2014-10-30T15:59:29.280" Score="0" Body="&lt;p&gt;That's queer that you found nothing. Perhaps &lt;a href=&quot;http://ntuzov.com/Nik_Site/Site_pages/Software_skills/C_Ox.htm&quot; rel=&quot;nofollow&quot;&gt;this project&lt;/a&gt; will be helpful. Let me know if you have questions about it.&lt;/p&gt;&#xA;" OwnerUserId="12031" LastActivityDate="2014-10-30T15:59:29.280" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15222" PostTypeId="2" ParentId="15219" CreationDate="2014-10-30T16:36:32.117" Score="2" Body="&lt;p&gt;The second one will be the best estimate. Also, a smaller timestep usually corresponds to a smaller bias. But I agree, the answer is not obvious.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should be careful about increasing $T$ though, because for negative drifts there is a threshold value ($2\mu + \sigma^2 &amp;lt; 0$) beyond which the variance of the price process stops increasing. It's an interesting proof to go over.&lt;/p&gt;&#xA;" OwnerUserId="13415" LastActivityDate="2014-10-30T16:36:32.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15223" PostTypeId="2" ParentId="15219" CreationDate="2014-10-30T17:20:50.480" Score="2" Body="&lt;p&gt;Time is expressed in fractions of year in the GBM formula. Therefore, $T=1$ year and $\Delta t = 1/m$. Considered that you have $253$ observations, I would use $m = 253$, so the second option as Drew suggested.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, using 253 or 365 days in a year depends on how you consider reality: do you think that when markets are closed (i.e. weekends) the price evolves? In general, it does: there may be an event when markets are closed that may change the price $S$. In practice, using the number of business days ($253$ in your case) or $365$ does not change much in most of the applications. &lt;/p&gt;&#xA;" OwnerUserId="7405" LastActivityDate="2014-10-30T17:20:50.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15224" PostTypeId="2" ParentId="15174" CreationDate="2014-10-30T21:12:42.110" Score="1" Body="&lt;p&gt;Lets look at generic markets with a single market filtration, then if $\mathbb{E}[S_t]=S_0$ then the market should be arbitrage free (absence of interest rates.) Otherwise there would be a butterfly arbitrage. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But for more sophisticated markets, not at all. Consider a market where there are only is only one period and there are two agents, one who knows the final price $S_T$ and one who does not. There is a static equilibrium and one guy rips off the other (but a dynamic one might be very hard to establish.)&lt;/p&gt;&#xA;" OwnerUserId="13415" LastActivityDate="2014-10-30T21:12:42.110" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="15225" PostTypeId="2" ParentId="15220" CreationDate="2014-10-30T22:02:28.733" Score="1" Body="&lt;p&gt;There was a &lt;a href=&quot;http://www.wilmott.com/pdfs/140217_skovmand.pdf&quot; rel=&quot;nofollow&quot;&gt;pretty good article&lt;/a&gt; covering this in Wilmott Magazine a while back.   It covered the somewhat more general case of Callable Constant Maturity Swap Steepeners. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can ignore all the machinery around the CMS coupons if you are just treating standard callable bonds.   That is to say, in Equation 8, you just need to set the multiplier $m$ to zero.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2014-10-30T22:02:28.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15226" PostTypeId="1" AcceptedAnswerId="15277" CreationDate="2014-10-31T00:28:29.493" Score="0" ViewCount="370" Body="&lt;p&gt;This is a self study question. I'm calculating a forward rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, I have that in a country X, the Spot Rate is 5X/1US. I also have that the 1 year interest rate is 13% in country X and inflation is 12%.  The US interest rate is 4% with 3% inflation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm computing the forward rate as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$F= S(1+i_d)/(1+i_f) = 5 *(1+.04)/(1+.13) = 4.602.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I'm also told that X's market risk premium is 300 basis points above US treasuries. I'm unsure how to factor that in....&lt;/p&gt;&#xA;" OwnerUserId="13419" LastEditorUserId="1764" LastEditDate="2015-04-03T06:17:39.557" LastActivityDate="2015-08-01T07:38:28.963" Title="Factoring risk premium in to Forward Rate calculation" Tags="&lt;risk&gt;&lt;fx&gt;&lt;forward-rate&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15228" PostTypeId="1" CreationDate="2014-10-31T07:18:26.033" Score="0" ViewCount="128" Body="&lt;p&gt;apologies for the simplicity of the question, but I was wondering: what is the quoting convention for normal (bps) volatility?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say I have the following time series of data:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Date Close Abs Change&#xA;20-Oct 1000.00 &#xA;21-Oct 1003.53 3.53&#xA;22-Oct 1004.79 1.25&#xA;23-Oct 1009.88 5.09&#xA;24-Oct 1002.02 -7.86&#xA;25-Oct 1005.96 3.94&#xA;26-Oct 1004.96 -1.00&#xA;27-Oct 1008.30 3.33&#xA;28-Oct 1002.18 -6.12&#xA;29-Oct 1004.95 2.77&#xA;30-Oct 1000.95 -4.00&#xA;31-Oct 1008.19 7.24&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It follows that the 10day realized (normal) vol (calculated as stdev of the abs changes) is 6.34, and the annualized vol is 100.75 (using an annualization factor of 252). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: what units are these vol levels of 6.34 &amp;amp; 100.75 in? if the underlying was a stock index, would it be index pts (or in case of FX: pips/Big figures)?   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="13421" LastActivityDate="2014-10-31T18:38:16.157" Title="Normal vol - convention" Tags="&lt;options&gt;&lt;volatility&gt;&lt;finance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15229" PostTypeId="1" AcceptedAnswerId="15260" CreationDate="2014-10-31T09:02:29.347" Score="3" ViewCount="1112" Body="&lt;p&gt;I am attempting to gain a better understanding of the limitations of the Nelson-Siegel model as described in &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2054689&quot; rel=&quot;nofollow&quot;&gt;Estimating the Yield Curve Using the Nelson-Siegel Model&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I have been playing around with the data I started to wonder whether the inputs to the Nelson-Siegel model are correct. I am using &lt;a href=&quot;http://www.treasury.gov/resource-center/data-chart-center/interest-rates/Pages/TextView.aspx?data=yield&quot; rel=&quot;nofollow&quot;&gt;Daily Treasury YieldCurve Rates&lt;/a&gt; and estimating the model through the R &lt;a href=&quot;http://cran.r-project.org/web/packages/YieldCurve/YieldCurve.pdf&quot; rel=&quot;nofollow&quot;&gt;YieldCurve&lt;/a&gt; package.&#xA;It has been my understanding that spot rates need to be derived from observable par yields before applying any modelling. This understanding, I believe, has been confirmed at a &lt;a href=&quot;https://stat.ethz.ch/pipermail/r-sig-finance/2010q1/005824.html&quot; rel=&quot;nofollow&quot;&gt;separate discussion&lt;/a&gt;. But documentation of the relevant R packages fails to mention which rates should be supplied.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should the input to the Nelson-Siegel model, in general and with respect to the R package, be the &lt;a href=&quot;http://www.treasury.gov/resource-center/data-chart-center/interest-rates/Pages/TextView.aspx?data=yield&quot; rel=&quot;nofollow&quot;&gt;Daily Treasury YieldCurve Rates&lt;/a&gt; or should one bootstrap the spot rates before applying the model?&lt;/p&gt;&#xA;" OwnerUserId="7186" LastEditorUserId="3188" LastEditDate="2015-03-20T22:43:57.940" LastActivityDate="2015-03-20T22:43:57.940" Title="Does Nelson-Siegel require adjustments to yield curve input data?" Tags="&lt;data&gt;&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;r&gt;&lt;yield-curve&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15230" PostTypeId="2" ParentId="15194" CreationDate="2014-10-31T09:36:30.927" Score="1" Body="&lt;p&gt;Given that other corporate events are reasonably modelled through regression models (compare &lt;a href=&quot;http://www.cfapubs.org/doi/abs/10.2469/faj.v55.n5.2296&quot; rel=&quot;nofollow&quot;&gt;The Detection of Earnings Manipulation&lt;/a&gt; I would try for using an regression approach. I believe a more recent and related paper has been published but I don't seem to find it at this time. Edit: and now I did - &lt;a href=&quot;http://www.cfapubs.org/doi/abs/10.2469/faj.v69.n2.1?src=recsys&quot; rel=&quot;nofollow&quot;&gt;Earnings Manipulation and Expected Returns&lt;/a&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, you may have specific reasons for looking only at market data. If that is the case I would intuitively suggest to try to control for industry sector, firm size, market capitalisation or percent of floating shares. It is reasonable to assume that any of these attributes influence firms management disposition to try to (positively) surprise the market intentionally. Say, the firm is in a niche industry, small with low capitalisation and float; a surprise will not affect the managements personal wealth nearly as much as if firm belongs to the top 10 companies in each classification. &lt;/p&gt;&#xA;" OwnerUserId="7186" LastActivityDate="2014-10-31T09:36:30.927" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15231" PostTypeId="2" ParentId="15220" CreationDate="2014-10-31T10:19:59.123" Score="4" Body="&lt;p&gt;you can view a bond as a floating rate note plus a swap from floating to fixed. Floating rate notes are always at par after coupon payments (ignoring credit risk...) so the pricing of a bond is the same as that of a swap. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the pricing of a callable bond is the same as that of a cancellable swap. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A cancellable swap can be viewed as a swap minus the bermudan right to enter into the opposite swap. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it all comes down to pricing Bermudan swaptions. There is an infinity of papers and books on this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have written too many papers and books on this. The biggest standard reference is Andersen-Piterbarg.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2014-10-31T10:19:59.123" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15232" PostTypeId="2" ParentId="15198" CreationDate="2014-10-31T10:27:05.567" Score="3" Body="&lt;p&gt;Peter Jaeckel wrote a paper just on how to solve this problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By Implication (July 2006; Wilmott, pages 60-66, November 2006). Probably the most complicated trivial issue in financial mathematics: how to compute Black's implied volatility robustly, simply, efficiently, and fast&lt;/p&gt;&#xA;&#xA;&lt;p&gt;downloadable from jaeckel.org&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my experience the most important thing is to make sure that you are working with an option out of the money. If the option is in the money use put-call parity to transform to the other case.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2014-10-31T10:27:05.567" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15234" PostTypeId="2" ParentId="15228" CreationDate="2014-10-31T18:38:16.157" Score="1" Body="&lt;p&gt;The unit for volatility is the same unit as the random variable. In the case of the index, yes, it is the index points. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The units of the variance is the unit of the random variable squared. Standard deviation is the square root of variance and has the same units as the random variable. &lt;/p&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2014-10-31T18:38:16.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15235" PostTypeId="1" AcceptedAnswerId="15280" CreationDate="2014-10-31T22:43:36.353" Score="1" ViewCount="610" Body="&lt;p&gt;I am trying to calculate the Dual-Beta for Apple (AAPL) by running a regression against the Spyder's ETF (SPY) &amp;amp; using the 10-yr Risk Free rate. The formula for the dual beta is: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;($r_{AAPL}-r_f) = \alpha^+D + \beta^+( r^+_m - r_f )+\alpha^-(1-D) + \beta^-( r^-_m - r_f ) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and can be found here: &lt;a href=&quot;http://en.wikipedia.org/wiki/Dual-beta&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Dual-beta&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I downloaded AAPL &amp;amp; SPY data from Yahoo Finance and the 10-Year Rate from FRED and put them in Excel. The dates are from 2013-10-31 to 2014-10-31. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[AAPL-Rf]   [R+]    [R-]    [Dummy+]&#xA;-0.01%  -0.01%  0.00%   1&#xA;-0.52%  0.23%   0.00%   1&#xA;1.28%   0.35%   0.00%   1&#xA;-0.25%  0.00%   -0.32%  0&#xA;-0.29%  0.50%   0.00%   1&#xA;-1.65%  0.00%   -1.27%  0&#xA;1.56%   1.34%   0.00%   1&#xA;-0.30%  0.01%   0.00%   1&#xA;0.17%   0.00%   -0.21%  0&#xA;0.12%   0.80%   0.00%   1&#xA;1.43%   0.49%   0.00%   1&#xA;-0.62%  0.43%   0.00%   1&#xA;-1.22%  0.00%   -0.36%  0&#xA;0.17%   0.00%   -0.23%  0&#xA;-0.89%  0.00%   -0.32%  0&#xA;1.17%   0.80%   0.00%   1&#xA;-0.27%  0.49%   0.00%   1&#xA;0.76%   0.00%   -0.11%  0&#xA;1.81%   0.02%   0.00%   1&#xA;2.33%   0.24%   0.00%   1&#xA;1.83%   0.00%   -0.07%  0&#xA;-0.88%  0.00%   -0.27%  0&#xA;2.69%   0.00%   -0.44%  0&#xA;-0.25%  0.00%   -0.02%  0&#xA;0.51%   0.00%   -0.44%  0&#xA;-1.41%  1.11%   0.00%   1&#xA;1.13%   0.25%   0.00%   1&#xA;-0.16%  0.00%   -0.37%  0&#xA;-0.75%  0.00%   -1.13%  0&#xA;-0.15%  0.00%   -0.34%  0&#xA;-1.11%  0.00%   -0.02%  0&#xA;0.54%   0.62%   0.00%   1&#xA;-0.46%  0.00%   -0.33%  0&#xA;-0.78%  1.70%   0.00%   1&#xA;-1.15%  0.00%   -0.12%  0&#xA;0.83%   0.57%   0.00%   1&#xA;3.76%   0.53%   0.00%   1&#xA;-0.43%  0.21%   0.00%   1&#xA;-0.67%  0.50%   0.00%   1&#xA;-0.69%  0.00%   -0.01%  0&#xA;-1.00%  0.00%   -0.02%  0&#xA;1.15%   0.47%   0.00%   1&#xA;-1.41%  0.00%   -0.97%  0&#xA;-2.23%  0.00%   -0.02%  0&#xA;0.53%   0.00%   -0.30%  0&#xA;-0.72%  0.61%   0.00%   1&#xA;0.62%   0.01%   0.00%   1&#xA;-1.30%  0.05%   0.00%   1&#xA;-0.67%  0.27%   0.00%   1&#xA;0.51%   0.00%   -1.34%  0&#xA;1.97%   1.08%   0.00%   1&#xA;1.98%   0.53%   0.00%   1&#xA;-0.57%  0.00%   -0.14%  0&#xA;-2.49%  0.00%   -0.43%  0&#xA;1.53%   0.29%   0.00%   1&#xA;0.44%   0.06%   0.00%   1&#xA;0.83%   0.00%   -0.83%  0&#xA;-1.84%  0.00%   -2.14%  0&#xA;0.81%   0.00%   -0.50%  0&#xA;-8.35%  0.59%   0.00%   1&#xA;-1.14%  0.00%   -0.97%  0&#xA;-0.21%  1.06%   0.00%   1&#xA;0.15%   0.00%   -0.60%  0&#xA;0.18%   0.00%   -2.26%  0&#xA;1.43%   0.70%   0.00%   1&#xA;0.75%   0.00%   -0.13%  0&#xA;0.57%   1.31%   0.00%   1&#xA;1.38%   1.23%   0.00%   1&#xA;1.77%   0.17%   0.00%   1&#xA;1.29%   1.09%   0.00%   1&#xA;-0.01%  0.04%   0.00%   1&#xA;1.56%   0.50%   0.00%   1&#xA;-0.09%  0.55%   0.00%   1&#xA;0.36%   0.11%   0.00%   1&#xA;-1.60%  0.00%   -0.67%  0&#xA;-1.17%  0.59%   0.00%   1&#xA;-1.12%  0.00%   -0.12%  0&#xA;0.42%   0.55%   0.00%   1&#xA;-1.05%  0.00%   -0.05%  0&#xA;-0.92%  0.00%   0.00%   1&#xA;1.97%   0.51%   0.00%   1&#xA;-0.28%  0.25%   0.00%   1&#xA;0.27%   0.00%   -0.71%  0&#xA;0.66%   1.40%   0.00%   1&#xA;0.19%   0.08%   0.00%   1&#xA;-0.30%  0.22%   0.00%   1&#xA;-0.07%  0.04%   0.00%   1&#xA;0.09%   0.00%   -0.06%  0&#xA;0.96%   0.00%   -0.50%  0&#xA;0.10%   0.01%   0.00%   1&#xA;-1.13%  0.00%   -1.13%  0&#xA;-1.13%  0.00%   -0.29%  0&#xA;0.38%   0.90%   0.00%   1&#xA;0.88%   0.71%   0.00%   1&#xA;-0.03%  0.00%   -0.54%  0&#xA;-0.49%  0.58%   0.00%   1&#xA;0.78%   0.00%   -0.40%  0&#xA;1.17%   0.00%   -0.42%  0&#xA;1.06%   0.47%   0.00%   1&#xA;-0.97%  0.00%   -0.73%  0&#xA;-0.43%  0.00%   -0.21%  0&#xA;-0.13%  0.48%   0.00%   1&#xA;-0.03%  0.81%   0.00%   1&#xA;0.91%   0.66%   0.00%   1&#xA;0.16%   0.32%   0.00%   1&#xA;-0.71%  0.00%   -0.14%  0&#xA;-1.30%  0.00%   -1.19%  0&#xA;-1.59%  0.00%   -1.11%  0&#xA;-0.02%  0.40%   0.00%   1&#xA;1.31%   1.07%   0.00%   1&#xA;-1.31%  0.00%   -2.11%  0&#xA;-0.75%  0.00%   -0.91%  0&#xA;0.39%   0.78%   0.00%   1&#xA;-0.71%  0.68%   0.00%   1&#xA;0.20%   1.04%   0.00%   1&#xA;1.13%   0.13%   0.00%   1&#xA;1.17%   0.34%   0.00%   1&#xA;0.09%   0.45%   0.00%   1&#xA;-1.32%  0.00%   -0.24%  0&#xA;7.87%   0.19%   0.00%   1&#xA;0.73%   0.00%   -0.82%  0&#xA;3.79%   0.31%   0.00%   1&#xA;-0.31%  0.46%   0.00%   1&#xA;-0.38%  0.29%   0.00%   1&#xA;0.22%   0.00%   0.00%   1&#xA;0.18%   0.00%   -0.15%  0&#xA;1.39%   0.19%   0.00%   1&#xA;-1.10%  0.00%   -0.88%  0&#xA;-0.36%  0.58%   0.00%   1&#xA;-0.19%  0.00%   -0.11%  0&#xA;-0.43%  0.14%   0.00%   1&#xA;1.23%   0.97%   0.00%   1&#xA;0.15%   0.08%   0.00%   1&#xA;0.02%   0.00%   -0.48%  0&#xA;-0.86%  0.00%   -0.88%  0&#xA;1.46%   0.34%   0.00%   1&#xA;1.16%   0.36%   0.00%   1&#xA;0.02%   0.00%   -0.64%  0&#xA;0.26%   0.83%   0.00%   1&#xA;0.14%   0.24%   0.00%   1&#xA;1.12%   0.39%   0.00%   1&#xA;1.84%   0.61%   0.00%   1&#xA;-0.27%  0.00%   -0.08%  0&#xA;1.80%   0.51%   0.00%   1&#xA;-0.38%  0.16%   0.00%   1&#xA;-0.70%  0.11%   0.00%   1&#xA;1.40%   0.00%   -0.06%  0&#xA;1.12%   0.19%   0.00%   1&#xA;0.38%   0.65%   0.00%   1&#xA;-0.28%  0.47%   0.00%   1&#xA;1.58%   0.10%   0.00%   1&#xA;0.57%   0.00%   0.00%   1&#xA;-0.41%  0.00%   -0.35%  0&#xA;-1.70%  0.00%   -0.72%  0&#xA;-1.10%  0.30%   0.00%   1&#xA;0.99%   0.07%   0.00%   1&#xA;-0.14%  0.27%   0.00%   1&#xA;0.10%   0.73%   0.00%   1&#xA;-0.35%  0.10%   0.00%   1&#xA;-1.05%  0.20%   0.00%   1&#xA;-0.10%  0.00%   -0.04%  0&#xA;-0.62%  0.00%   -0.61%  0&#xA;0.08%   0.45%   0.00%   1&#xA;0.59%   0.00%   -0.08%  0&#xA;1.17%   0.19%   0.00%   1&#xA;1.03%   0.00%   -0.06%  0&#xA;0.63%   0.66%   0.00%   1&#xA;-0.05%  0.09%   0.00%   1&#xA;0.57%   0.49%   0.00%   1&#xA;2.05%   0.00%   -0.36%  0&#xA;-0.66%  0.00%   -0.65%  0&#xA;0.04%   0.44%   0.00%   1&#xA;-0.38%  0.00%   -0.40%  0&#xA;0.18%   0.13%   0.00%   1&#xA;1.27%   0.49%   0.00%   1&#xA;-1.18%  0.00%   -0.20%  0&#xA;-0.58%  0.36%   0.00%   1&#xA;-1.80%  0.00%   -1.14%  0&#xA;1.42%   1.01%   0.00%   1&#xA;-0.52%  0.00%   -0.19%  0&#xA;0.81%   0.43%   0.00%   1&#xA;2.57%   0.22%   0.00%   1&#xA;-0.17%  0.00%   0.00%   1&#xA;0.65%   0.00%   -0.48%  0&#xA;1.36%   0.03%   0.00%   1&#xA;-0.66%  0.00%   -0.44%  0&#xA;-0.24%  0.01%   0.00%   1&#xA;-2.63%  0.00%   -1.98%  0&#xA;0.54%   0.00%   -0.31%  0&#xA;-0.56%  0.72%   0.00%   1&#xA;-0.50%  0.00%   -0.98%  0&#xA;-0.18%  0.02%   0.00%   1&#xA;-0.02%  0.00%   -0.55%  0&#xA;0.27%   1.15%   0.00%   1&#xA;1.30%   0.28%   0.00%   1&#xA;-0.03%  0.00%   -0.15%  0&#xA;1.31%   0.67%   0.00%   1&#xA;0.26%   0.47%   0.00%   1&#xA;0.48%   0.00%   -0.03%  0&#xA;1.19%   0.83%   0.00%   1&#xA;1.37%   0.52%   0.00%   1 &#xA;0.03%   0.26%   0.00%   1&#xA;0.00%   0.29%   0.00%   1&#xA;0.73%   0.00%   -0.16%  0&#xA;0.21%   0.50%   0.00%   1&#xA;-0.65%  0.06%   0.00%   1&#xA;1.22%   0.00%   -0.05%  0&#xA;0.11%   0.00%   -0.06%  0&#xA;0.24%   0.28%   0.00%   1&#xA;0.77%   0.00%   -0.06%  0&#xA;-4.32%  0.00%   -0.06%  0&#xA;-0.84%  0.00%   -0.15%  0&#xA;0.86%   0.44%   0.00%   1&#xA;-0.63%  0.00%   -0.26%  0&#xA;-0.38%  0.00%   -0.64%  0&#xA;3.02%   0.37%   0.00%   1&#xA;0.42%   0.11%   0.00%   1&#xA;0.22%   0.00%   -0.59%  0&#xA;-0.04%  0.00%   -0.08%  0&#xA;-0.77%  0.75%   0.00%   1&#xA;0.70%   0.13%   0.00%   1&#xA;0.20%   0.52%   0.00%   1&#xA;-0.83%  0.00%   -0.10%  0&#xA;0.09%   0.00%   -0.78%  0&#xA;1.54%   0.00%   -0.58%  0&#xA;-0.88%  0.78%   0.00%   1&#xA;-3.89%  0.00%   -1.62%  0&#xA;2.89%   0.79%   0.00%   1&#xA;-0.64%  0.00%   -0.19%  0&#xA;0.63%   0.00%   -0.27%  0&#xA;-1.58%  0.00%   -1.36%  0&#xA;0.72%   0.01%   0.00%   1&#xA;-0.29%  1.09%   0.00%   1&#xA;-0.01%  0.00%   -0.12%  0&#xA;-0.88%  0.00%   -1.55%  0&#xA;2.05%   1.74%   0.00%   1&#xA;0.21%   0.00%   -1.99%  0&#xA;-0.29%  0.00%   -1.15%  0&#xA;-0.92%  0.00%   -1.65%  0&#xA;-1.07%  0.15%   0.00%   1&#xA;-1.24%  0.00%   -0.68%  0&#xA;-1.33%  0.00%   -0.09%  0&#xA;1.45%   1.17%   0.00%   1&#xA;2.11%   0.96%   0.00%   1&#xA;2.67%   1.97%   0.00%   1&#xA;0.50%   0.00%   -0.72%  0&#xA;1.76%   1.16%   0.00%   1&#xA;0.37%   0.76%   0.00%   1&#xA;-0.11%  0.00%   -0.14%  0&#xA;1.53%   1.14%   0.00%   1&#xA;0.55%   0.00%   -0.16%  0&#xA;-0.34%  0.63%   0.00%   1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For the regression &lt;code&gt;AAPL-Rf&lt;/code&gt; is the dependent variable and &lt;code&gt;R+&lt;/code&gt; is the &lt;code&gt;Up-Beta market risk premium&lt;/code&gt;, &lt;code&gt;R-&lt;/code&gt; is the &lt;code&gt;Down-Beta risk premium&lt;/code&gt; , and &lt;code&gt;Dummy+&lt;/code&gt; is &lt;code&gt;1&lt;/code&gt; when SPY was positive or unchanged, and &lt;code&gt;0&lt;/code&gt; otherwise (or negative). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The regression results came back as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;AAPL-Rf =- 0.0003 + 0.4059 * [R+] + 0.6111 * [R-] + 0.0036 * [Dummy+]&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am a bit confused on the &lt;code&gt;alpha's&lt;/code&gt;... The model describes that positive alpha is multiplied by the Dummy Variable which in this case its: &lt;code&gt;0.0036 * [Dummy+]&lt;/code&gt; but what about the downside alpha? would that be: &lt;code&gt;- 0.0003&lt;/code&gt; ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any input would be helpful....&lt;/p&gt;&#xA;" OwnerUserId="11814" LastEditorUserId="11814" LastEditDate="2014-11-01T00:16:28.067" LastActivityDate="2014-11-03T20:25:29.243" Title="Interpret alpha's on Dual-Beta Model regression Results" Tags="&lt;regression&gt;&lt;beta&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15236" PostTypeId="1" CreationDate="2014-11-01T02:43:18.827" Score="-1" ViewCount="156" Body="&lt;p&gt;I have a background in programming of about 6 years. Now I decided to learn finance and trading as well. How can I get my foot in the door in that area? &lt;/p&gt;&#xA;" OwnerUserId="6205" LastActivityDate="2014-11-01T06:06:13.050" Title="How to learn finance?" Tags="&lt;finance&gt;&lt;learning&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="0" ClosedDate="2014-11-01T07:41:26.217" ContentLicense="CC BY-SA 3.0" />
  <row Id="15238" PostTypeId="2" ParentId="15236" CreationDate="2014-11-01T06:06:13.050" Score="1" Body="&lt;p&gt;Asking a lot of questions... It really depends on what area of finance you are interested in (I.e. bonds, stocks, research, valuation, capital budgeting,etc.) but as they say &quot;experience is the best teacher&quot; , so there is nothing better than going out there and getting your hands dirty&lt;/p&gt;&#xA;" OwnerUserId="13428" LastActivityDate="2014-11-01T06:06:13.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15239" PostTypeId="2" ParentId="14888" CreationDate="2014-11-01T09:15:06.257" Score="3" Body="&lt;p&gt;Please look at the 16 December 2010 publication of the Basel III regulatory frameworks for capital and liquidity and the 13 January 2011 press release on the loss absorbency of capital at the point of non-viability and related FAQs &quot;Basel III definition of capital - Frequently asked questions&quot; like bcbs 211.&lt;/p&gt;&#xA;" OwnerUserId="12116" LastActivityDate="2014-11-01T09:15:06.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15241" PostTypeId="1" CreationDate="2014-11-01T15:00:59.243" Score="3" ViewCount="285" Body="&lt;p&gt;Consider Black Scholes problem $\frac{\partial V}{\partial t} + \frac{\sigma^2 S^2}{2}\frac{\partial^2V}{\partial S^2} + rS\frac{\partial V}{\partial S} -rV = 0$ with boundary condition $V(S,T)=f(S)$, where $V(S,t)$ is the solution to the PDE above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $ρ(S,t)=\frac{∂V}{∂r}(S,t)$, then it can be shown that $\rho$ satisfies the following PDE: $\frac{∂ρ}{∂t} + \frac{σ^2 S^2}{2}\frac{∂^2ρ}{∂S^2} + rS\frac{∂ρ}{∂S} −rρ=V−S\frac{∂V}{∂S}$ with boundary condition $\rho(S,T)=0$ . &lt;/p&gt;&#xA;&#xA;&lt;p&gt;${\it QUESTION}$: given that the PDE above uniquely determines $ρ$ , and assuming that both $V$  and $S\frac{∂V}{∂S}$   are of the order $o(1/(T−t))$  as $t→T^−$  , show that $ρ(S,t)=(T−t)\Big(S\frac{∂V}{∂S}(S,t) −V(s,t)\Big) $,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried to tackle the problem by following this: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under sufficient regularity/growth/etc. conditions, an equation $Lu=v$  with specified initial and boundary conditions has a unique solution. So to verify that two solutions $f$  and $g$  of the same equation $Lu=v$  with identical initial and boundary conditions are the same, it is sufficient to verify that their difference satisfies $L(f−g)=0 $ with zero initial and boundary conditions. So it's enough to verify regularity conditions and check that the l.h.s. satisfies exactly the same equation and conditions as the r.h.s.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I couldnt produce the required result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would be grateful if anyone could suggest how to approach this and similar problems.&lt;/p&gt;&#xA;" OwnerUserId="13430" LastActivityDate="2014-11-01T15:00:59.243" Title="PDE and Black Scholes problem" Tags="&lt;black-scholes&gt;&lt;stochastic-calculus&gt;&lt;differential-equations&gt;&lt;black-scholes-pde&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15242" PostTypeId="1" CreationDate="2014-11-01T20:48:48.023" Score="1" ViewCount="70" Body="&lt;p&gt;Given a magical oracle who can correctly predict the volume, but not the price, of a given security, does there exist a risk-free arbitrage to capitalize on this information?&lt;/p&gt;&#xA;" OwnerUserId="6653" LastActivityDate="2014-11-01T21:09:50.837" Title="Risk-free arbitrage given a volume oracle?" Tags="&lt;volatility&gt;&lt;arbitrage&gt;&lt;volume&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15243" PostTypeId="2" ParentId="15242" CreationDate="2014-11-01T21:09:50.837" Score="2" Body="&lt;p&gt;No, because the volume does not indicate the price change. E.g. the price change might net to zero over all times.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-11-01T21:09:50.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15244" PostTypeId="1" AcceptedAnswerId="15342" CreationDate="2014-11-01T21:53:06.847" Score="6" ViewCount="1366" Body="&lt;p&gt;Can someone check my proof? I think there is something not quite right. I have found limited resources online for this as well so I think it might benefit others to get this on the internet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume there are $K$ time-series factors with $T$ return observations each and $N$ stocks. Our model states that the return on each stock in the model is a linear combination of the return on the factors, e.g. in vector random variable form $R_i = \beta_i F + \epsilon_i$. The return variance of a portfolio with weights $w$ is given by $\text{Var}(w^\prime R) = w \beta \text{Var}(F) \beta^\prime w + w^\prime \text{Var}(\epsilon)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Definitions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$w$ ($N \times 1$) portfolio weights &lt;/li&gt;&#xA;&lt;li&gt;$\beta$ ($K \times N$) factor loading matrix&lt;/li&gt;&#xA;&lt;li&gt;$\Omega = \beta^\prime \text{Var}(F) \beta$ ($N\times N$) factor risk matrix&lt;/li&gt;&#xA;&lt;li&gt;$e = \text{Var}(\epsilon)$ ($N \times 1$) stock specific variance&lt;/li&gt;&#xA;&lt;li&gt;$\lambda$ ($1\times 1$) Lagrange multiplier &lt;/li&gt;&#xA;&lt;li&gt;$\vec 1$ ($N\times 1$) &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The optimization problem after adding the Lagrange multiplier for the weights sum to one constraint is: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ w^* = \text{argmin}_w \left[ w^\prime \Omega w + w^\prime e - \lambda(w^\prime \vec 1 - 1)\right] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first order conditions are &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ 2w^\prime \Omega + e^\prime - \lambda \vec 1^\prime = 0 $$&#xA;$$ w^\prime \vec 1 = 1 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solving the first equation for $w^\prime$ in terms of $\lambda$ yields&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$w^\prime = \frac{1}{2}\left( \lambda \vec 1^\prime - e^\prime \right) \Omega^{-1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Substituting this into the second FOC the result is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ 1 = \left( \frac{1}{2}\left( \lambda \vec 1^\prime - e^\prime \right) \Omega^{-1} \right) \vec 1\\&#xA;\implies 2 = \lambda \vec 1^\prime \Omega^{-1} \vec 1 - e^\prime \Omega^{-1} \vec 1 \\&#xA;\implies \lambda = \frac{2 + e^\prime \Omega^{-1} \vec 1}{\vec 1^\prime \Omega^{-1} \vec 1 }&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Substituting the Lagrangian back into the first FOC yields the result &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ w^{*\prime} = \frac{1}{2}\left[ \left(\frac{2 + e^\prime \Omega^{-1} \vec 1}{\vec 1^\prime \Omega^{-1} \vec 1 }\right)\vec 1^\prime - e^\prime \right] \Omega^{-1} &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure if it can be written any more simply than that but when I coded this into a PCA statistical factor model I was getting weights that do not sum to one as the constraint suggests.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Result&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ultimately, I do not think there was really an issue with any of the math that was done originally but a reformulation of the problem really did help thanks to @John. For completeness, the final proof is below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Definitions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$w$ ($N \times 1$) portfolio weights &lt;/li&gt;&#xA;&lt;li&gt;$\beta$ ($K \times N$) factor loading matrix&lt;/li&gt;&#xA;&lt;li&gt;$\Omega = \beta^\prime \text{Var}(F) \beta$ ($N\times N$) factor risk matrix&lt;/li&gt;&#xA;&lt;li&gt;$e = \text{Var}(\epsilon)$ ($N \times N$) diagonal matrix of stock specific variance&lt;/li&gt;&#xA;&lt;li&gt;$\lambda$ ($1\times 1$) Lagrange multiplier &lt;/li&gt;&#xA;&lt;li&gt;$\vec 1$ ($N\times 1$) &lt;/li&gt;&#xA;&lt;li&gt;$\Sigma \equiv \Omega + e$ &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Under this formulation, portfolio variance is given by &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Var}(w^\prime R) = w^\prime \beta \text{Var}(F) \beta^\prime w + w^\prime \text{Var}(\epsilon) w\\&#xA;= w^\prime \Omega w + w^\prime e w\\&#xA;= w^\prime \Sigma w$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The optimization problem after adding the Lagrange multiplier for the weights sum to one constraint is: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ w^* = \text{argmin}_w \left[ w^\prime \Sigma w - \lambda(w^\prime \vec 1 - 1)\right] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first order conditions are &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ 2w^\prime \Sigma - \lambda \vec 1^\prime = 0 $$&#xA;$$ w^\prime \vec 1 = 1 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solving the first equation for $w^\prime$ in terms of $\lambda$ yields&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$w^\prime = \frac{1}{2}\lambda \vec 1^\prime \Sigma^{-1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Substituting this into the second FOC the result is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ 1 = \frac{1}{2} \lambda \vec 1^\prime \Sigma^{-1} \vec 1^\prime&#xA;\implies \lambda = \frac{2}{\vec 1^\prime \Sigma^{-1} \vec 1}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Substituting the Lagrangian back into the first FOC yields the result &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ w^{*\prime} = \frac{1^\prime \Sigma^{-1}}{\vec 1^\prime \Sigma^{-1} \vec 1}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, the results that I have gotten from direct closed form estimation of $w^*$ are somewhat unstable for even small values of $N$ and yield results including very high leverage. It may be a coding issue and I am re-re-re checking code but I am fairly confident that there are not and severe coding errors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;If each factor is represented by a portfolio&lt;/em&gt;, it seems that it may be best to estimate the $K$ weights of the minimum variance portfolio &lt;em&gt;of the factors&lt;/em&gt; then multiply through to get final portfolio weights. &lt;/p&gt;&#xA;" OwnerUserId="4910" LastEditorUserId="4910" LastEditDate="2014-11-06T22:05:08.383" LastActivityDate="2014-11-06T22:05:08.383" Title="Factor Model - Minimum Variance Portfolio [Complete Proof]" Tags="&lt;factor-models&gt;&lt;pca&gt;&lt;portfolio-optimization&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15245" PostTypeId="2" ParentId="942" CreationDate="2014-11-01T23:27:34.953" Score="2" Body="&lt;p&gt;Errors in some data can cause the calculation to go awry.  For EPD, I have reported that they believe the stock had a 2:1 split on August 21, 2014 and on August 22, 2014.  Only one of these splits occurred, so all the split adjusted data is off by a factor of 2 before the split that did not happen.  I reported this error in August, but in November I noticed the error is still there.  This error really screws up my own software that depends on the data.&lt;/p&gt;&#xA;" OwnerUserId="13432" LastActivityDate="2014-11-01T23:27:34.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15246" PostTypeId="2" ParentId="15034" CreationDate="2014-11-02T00:30:18.657" Score="0" Body="&lt;p&gt;I guess the easiest would be to price a call option, and then use put-call parity. To price the call option you would have to do a change of numeraire. A good reference for this would probably be Brigo and Mercurio.&lt;/p&gt;&#xA;" OwnerUserId="8039" LastActivityDate="2014-11-02T00:30:18.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15247" PostTypeId="1" CreationDate="2014-11-02T04:52:41.883" Score="1" ViewCount="5654" Body="&lt;p&gt;I'm currently answering the exercises at the back of every chapter of the book &lt;strong&gt;&quot;Paul Wilmott Introduces Quantitative Finance&quot;&lt;/strong&gt; and would like to compare my answers to the correct ones.  Tried looking at the back of the book but there are no answers. Appreciate if someone can direct me to where I can find the correct answers.  Thanks in advance :D&lt;/p&gt;&#xA;" OwnerUserId="13433" LastActivityDate="2015-01-02T16:50:14.553" Title="Where can I find answers to questions in the book &quot;Paul Wilmott Introduces Quantitative Finance&quot;?" Tags="&lt;quantitative&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15248" PostTypeId="1" CreationDate="2014-11-02T05:14:12.660" Score="2" ViewCount="23420" Body="&lt;p&gt;This question has been bugging me for awhile now and I've been trying to find a definite answer, however, no avail...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question, in specific, relates to the USD/CNH CCS rate. From what I understand (which is barely the surface), you can add this USD/CNH CCS rate on top of a %YTM of a CNH denominated bond, and the summation will be the %YTM in USD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried to ask my colleagues/read internet sources but no one can produce a simple numerical example that can derive the USD/CNH CCS rate. I'm wondering if anyone here can provide for an example with a simple 2 year bond and derive the USD/CNH CCS rate for me?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you so much.&lt;/p&gt;&#xA;" OwnerUserId="13434" LastActivityDate="2015-05-04T02:08:08.760" Title="how to calculate a cross-currency swap in basis pt?" Tags="&lt;fixed-income&gt;&lt;fx&gt;&lt;interest-rate-swap&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15249" PostTypeId="1" CreationDate="2014-11-02T05:18:37.277" Score="2" ViewCount="158" Body="&lt;p&gt;I got this question from the last exercise of chapter 2 from &quot;paul wilmott introduces quantitative finance&quot; book.  Appreciate your help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/djZWX.jpg&quot; alt=&quot;Taken from chapter 2 of PWIQF&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="13433" LastEditorUserId="12" LastEditDate="2015-01-02T16:36:08.827" LastActivityDate="2015-01-02T17:03:01.713" Title="Anybody knows the answer to this exercise found in PWIQF?" Tags="&lt;options&gt;&lt;greeks&gt;&lt;books&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15250" PostTypeId="1" CreationDate="2014-11-02T10:38:41.630" Score="-2" ViewCount="233" Body="&lt;p&gt;There are plenty books and sites which offer automatic trading strategies (robots)&#xA;and claim they are very profitable. On the other hand many people do not believe in such things, saying that: if there would be &quot;graal&quot; that generates stable profit, then the details would be kept in secret, and many other reasonable doubts in such claims. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what is the truth ? Does most/average automatic trading system &#xA;lose money in say one year/ 3 years ? or may be they win 100% in a week :) ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;More seriously: I am interested to find some analysis that would take &#xA;several trading strategies and test it on various historic data and describe the results.&#xA;It is better that strategies would be simple/standard and invented by third party in order&#xA;to avoid conflict of interets.&lt;/p&gt;&#xA;" OwnerUserId="4652" LastActivityDate="2021-04-10T22:42:18.477" Title="Automatic trading strategies - what are benchmarks for PL on serious backtesting?" Tags="&lt;quant-trading-strategies&gt;" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="15251" PostTypeId="2" ParentId="15250" CreationDate="2014-11-02T13:02:46.777" Score="0" Body="&lt;p&gt;Markets are changing all the time and that's is why a specific &quot;edge&quot; is lasting some time and than you will need to restart your algo.&lt;/p&gt;&#xA;" OwnerUserId="13436" LastActivityDate="2014-11-02T13:02:46.777" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15252" PostTypeId="1" CreationDate="2014-11-02T13:50:36.570" Score="1" ViewCount="191" Body="&lt;p&gt;Hi I have generate equity of my strategies which invest in commodities and currencies at daily interval.&#xA;What the best method to combine together all strategies in one portfolio?&#xA;I want to make the highest Sharpe Ratio ass possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks&lt;/p&gt;&#xA;" OwnerUserId="13354" LastActivityDate="2015-03-02T20:07:07.670" Title="Combine together different strategies in one portfolio" Tags="&lt;portfolio&gt;&lt;equity-curve&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ClosedDate="2015-03-03T09:37:22.190" ContentLicense="CC BY-SA 3.0" />
  <row Id="15253" PostTypeId="1" CreationDate="2014-11-02T14:03:13.127" Score="2" ViewCount="278" Body="&lt;p&gt;I am trying to use GARCH model for my research. However, when I am running them, I see negative value for alpha and beta. How I can restrict them so that they do not provide me any negative value. Is there any specific code for this? I follow the code arch var2, arch(1) garch(1). I also like to know, how to generate dummy variable in stata (code please).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;" OwnerUserId="13438" LastActivityDate="2014-11-02T14:03:13.127" Title="Dummy variable and negative estimation in GARCH (1.1)" Tags="&lt;garch&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15254" PostTypeId="1" AcceptedAnswerId="15258" CreationDate="2014-11-02T14:15:56.963" Score="0" ViewCount="342" Body="&lt;p&gt;I'm new in here and I hope this is the right board to ask this question. I'm at second year of university and in the Informatics II course the lecturer made us solve the following mean variance analysis for two assets in R:  &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;we have create the following matrix $A$: $$A=\begin{bmatrix}&#xA; 2\sigma_{11}&amp;amp;2\sigma_{12}  &amp;amp;-\overline{r}_1  &amp;amp;-1 \\ &#xA; 2\sigma_{21}&amp;amp; 2\sigma_{22} &amp;amp; -\overline{r}_2 &amp;amp; -1\\ &#xA; \overline{r}_1&amp;amp;\overline{r}_2  &amp;amp;0  &amp;amp;0 \\ &#xA; 1&amp;amp; 1 &amp;amp; 0 &amp;amp; 0&#xA;\end{bmatrix}=\begin{bmatrix}&#xA;0.0002310968 &amp;amp; 0.0002230081 &amp;amp; -0.0003322979 &amp;amp;-1 \\ &#xA; 0.0002230081&amp;amp; 0.0003104519 &amp;amp; 0.0004241650 &amp;amp;-1 \\ &#xA; -0.0003322979&amp;amp; -0.0004241650 &amp;amp; 0 &amp;amp; 0\\ &#xA; 1&amp;amp;  1&amp;amp;  0&amp;amp; 0&#xA;\end{bmatrix}$$&#xA;where: $2\sigma_{ij}$ denotes the covariance the rates of return between assets $i$ and $j$, and $\overline{r}_i$ denotes the expected rate of return for assets $i$;&lt;/li&gt;&#xA;&lt;li&gt;we have created the following vector $b$: $$b=\begin{bmatrix}&#xA;0\\ &#xA;0\\ &#xA;\overline{r}\\ &#xA;1&#xA;\end{bmatrix}=\begin{bmatrix}&#xA;0\\ &#xA;0\\ &#xA;0.35\\ &#xA;1&#xA;\end{bmatrix}$$ where: $\overline{r}$ is the expected portfolio return;&lt;/li&gt;&#xA;&lt;li&gt;we solved $A^{-1}b$ to find vector $x$ defined as: $$x=\begin{bmatrix}&#xA;w_1\\ &#xA;w_2\\ &#xA;\lambda\\ &#xA;\mu&#xA;\end{bmatrix}$$&lt;/li&gt;&#xA;&lt;li&gt;we found that: $$x=\begin{bmatrix}&#xA;3814.468561\\ &#xA;-3813.468561\\ &#xA;-3965.712523\\ &#xA;1.348875&#xA;\end{bmatrix}$$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;What is the financial meaning of these numbers ($w_1$, $w_2$, $\lambda$, $\mu$)?&lt;br&gt;&#xA;Thanks for the answer.&lt;/p&gt;&#xA;" OwnerUserId="13439" LastEditorUserId="13439" LastEditDate="2014-11-02T15:03:35.877" LastActivityDate="2014-11-02T21:21:20.833" Title="Mean Variance Analysis: what does the solution of the following exercise tells me?" Tags="&lt;mean-variance&gt;&lt;analysis&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15255" PostTypeId="1" CreationDate="2014-11-02T15:27:13.187" Score="0" ViewCount="55" Body="&lt;p&gt;I know that For an &lt;strong&gt;American-style put option&lt;/strong&gt;, early exercise is a optimal for deep &lt;strong&gt;in-the-money options.&lt;/strong&gt; In this case, it may make sense to exercise the option early in order to obtain the profit earlier so that it can start to earn interest immediately.\&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but why it could be optimal to exercise prematurely an american put on Foreign currency?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;any tips are really appreciated&#xA;thanks&lt;/p&gt;&#xA;" OwnerUserId="13329" LastActivityDate="2014-11-04T20:14:17.493" Title="American put on a foreign currency" Tags="&lt;fx&gt;&lt;put&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15256" PostTypeId="2" ParentId="15252" CreationDate="2014-11-02T18:25:19.193" Score="0" Body="&lt;p&gt;Well, thats not an easy task. Because you can't predict the movement of the market. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you want to do it based in historical data, you only have to apply the Modern Portfolio Theory by applying a Markowitz Model, which maximices the Sharpe Ratio. I have done it with Excel, is not hard but you need to know the steps, there are many tutorials, just google it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this works. &lt;/p&gt;&#xA;" OwnerUserId="12089" LastActivityDate="2014-11-02T18:25:19.193" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15257" PostTypeId="1" CreationDate="2014-11-02T19:13:14.823" Score="1" ViewCount="1083" Body="&lt;p&gt;Grateful for any assistance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the process:&#xA;$dZ=r(t)Z\,dt$ ,  where $r(t)$ is stochastic interest rate and $Z=Z(r,t;T)$ is a zero coupon bond Price. Provide a bond pricing partial differential equation and invoke Feynman-Kac Theorem to show the solution requires the risk neutral measure $\mathbb{Q}$: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;Z(r,t;T)=\mathbb{E_t^Q}\left[\exp\left({-\int^T_tr(s)\,ds}  \right)\right].&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Everything I read suggests write the PDE associated with $Z(r,t;T)$, integrate it and then take the expected value. I am stuck however on the first step as $dZ$ does not look like the usual Brownian motion with drift and diffusion? Instead the process evolves like having money in the bank earning interest, i.e. the change in the value of the zero coupon bond ($dZ$) in a timestep ($dt$) is equivalent to earning interest at a rate $r(t)$ over time. Grateful for any guidance on how to approach this.&lt;/p&gt;&#xA;" OwnerUserId="4953" LastEditorDisplayName="user16891" LastEditDate="2015-07-22T11:34:13.047" LastActivityDate="2015-07-22T11:34:13.047" Title="Provide a bond pricing differential equation and invoke Feynman-Kac Theorem" Tags="&lt;interest-rates&gt;&lt;stochastic-processes&gt;&lt;bond&gt;&lt;risk-neutral-measure&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15258" PostTypeId="2" ParentId="15254" CreationDate="2014-11-02T21:05:21.733" Score="1" Body="&lt;p&gt;From how you outlined your solution, you are computing the mean variance portfolio with minimum risk and with target return $\overline{r}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd say that you are solving an optimization using &lt;a href=&quot;http://en.wikipedia.org/wiki/Lagrange_multiplier&quot; rel=&quot;nofollow&quot;&gt;Lagrange multiplier method&lt;/a&gt; given the values of matrix A.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\lambda$ and $\mu$ are the Lagrande multipliers: these parameters measure the sensitivity of the Lagrange function with respect to the constraints of the mean variance problem, which are&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;the return of the mean variance portfolio must be equal to $\overline{r}$:&#xA;$$w_1 \overline{r}_1 + w_2 \overline{r}_2 = \overline{r}$$&lt;/li&gt;&#xA;&lt;li&gt;the sum of the weights ($w_1$ and $w_2$) must be equal to $1$:&#xA;$$w_1 + w_2 = 1$$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;From the constraints, you can understand that $w_1$ and $w_2$ are the weights of the assets in the mean variance portfolio: you should buy $3814.468561$ units of asset 1 and you should short sell $3813.468561$ units of asset 2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\lambda = -3965.712523$ and $\mu = 1.348875$ shows that the Lagrange function has a strong negative sensitivity to constraint 1 and a positive low sensitivity to constraint 2. This means that constraint 1 was the real driver to the solution of the optimization (very high absolute value); the negative sign means that the Lagrangian function decreases when the $w_1 \overline{r}_1 + w_2 \overline{r}_2 - \overline{r}$ increases (this is just constraint 1 rewritten), i.e. a portfolio return higher than the target one, \overline{r}, is rewarded during the optimization.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Summarizing, $w_1$ and $w_2$ have a financial meaning (how many units of each asset you should buy), while $\lambda$ and $\mu$ give hints about the optimization process (how the constraints interact with the objective function).&lt;/p&gt;&#xA;" OwnerUserId="7405" LastActivityDate="2014-11-02T21:05:21.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15259" PostTypeId="2" ParentId="15254" CreationDate="2014-11-02T21:21:20.833" Score="0" Body="&lt;p&gt;The mean-variance portfolio is given by $\sigma_t^{-1} \theta_t$ where $\theta_t$ is the market price of risk $\frac{\mu_t - r_t}{\sigma_t}$. Here your taking $\Sigma^{-1} (\mu_t - r_t)$ and using block matrices to enforce the constraints as outlined by Arrigo.&lt;/p&gt;&#xA;" OwnerUserId="13415" LastActivityDate="2014-11-02T21:21:20.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15260" PostTypeId="2" ParentId="15229" CreationDate="2014-11-03T01:57:28.663" Score="6" Body="&lt;p&gt;The NS model should be fit directly to bond prices. If you have the prices of all the Treasuries, you should use those directly. See this paper for how the Fed does it &lt;a href=&quot;http://www.federalreserve.gov/pubs/feds/2006/200628/200628pap.pdf&quot;&gt;http://www.federalreserve.gov/pubs/feds/2006/200628/200628pap.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &quot;Daily Treasury Yield Curve Rates&quot; are already fitted par yields (they're fitted using a cubic spline model to on-the-run and select off-the-run Treasuries). Since these are par yields, you can assume that they represent the coupon rates of Treasuries with prices of 100, and feed them into the NS model.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2014-11-03T01:57:28.663" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15263" PostTypeId="1" CreationDate="2014-11-03T10:38:30.317" Score="5" ViewCount="1785" Body="&lt;p&gt;I'm interested in the term structure of CDS spread. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's known that the Market CDS rate (fair CDS spread or T-maturity spread) of a CDS contract initiated at $s$, maturity $T$ and recovery function $R$ is given by &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ S(s,T) =  \frac{-\int_s^T R(u) dG(u)}{\int_s^T G(u)du}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $G(t)=\mathbb P[\tau&amp;gt;t]$ is the survival probability associated to default  with default time $\tau$.&#xA;Also one has that $G(t)= \exp({-\int_0^t h_u du})$ where $h$ is the hazard rate (HR). &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;My first question is what is the easy and market practice to get the&#xA;  hazard ratio from CDS spread.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Assume that the CDS spread is given by a know stochastic process. Let's say we have even a analytical tractability for the stochastic CDS spread as in the &lt;a href=&quot;http://bodonoghue.org/publications/oplc.pdf&quot; rel=&quot;nofollow&quot;&gt;SRMR model&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;How to obtain the survival probability $G$  ?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Another doubt I have is concerning the SRMR model and the role of maturity. &#xA;Unless I missed something he gives us model to the dynamic of the market spread (for the log return so for the rate itself) for a fixed maturity $T$ which is not explicated anywhere in this model. &#xA;Assuming we how to solve the integral equation $  \int_s^T R(u) dG(u)+ S(t, T)\int_s^T G(u)du =0 $ I would be treating every T-maturity as they had the same dynamic. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That may be ok and the distinction between their behaviors must comes from the different parameter obtained by proper calibration for each different maturity.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I would like to have some opinions about that please.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now assume the HR to be stochastic modeled for instance by a exponential Ornstein-Uhlenbeck process as following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dH_t= -\mu_t H_t ~dt+\sigma_tdW_t$$&#xA;with $H_t := \ln(H_t)$.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;How describe the spread dynamics ?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Given that the spread seems to have a stochastic nature (as you see in &lt;a href=&quot;http://ssrn.com/abstract=1771862&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt; for instance), how would that be coherent with the first formula ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks for you thoughts.&lt;/p&gt;&#xA;" OwnerUserId="3534" LastEditorUserId="3534" LastEditDate="2014-11-18T01:35:54.630" LastActivityDate="2014-11-24T15:30:29.443" Title="A model to stochastic hazard rate and CDS spread term structure" Tags="&lt;credit&gt;&lt;spread&gt;&lt;cds&gt;&lt;default-probability&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15266" PostTypeId="1" CreationDate="2014-11-03T13:04:34.840" Score="5" ViewCount="1290" Body="&lt;p&gt;The mean and variance of Ornstein–Uhlenbeck (OU) process have time dependence (exponentially decay in time). So they are not constant in time. How can it to be stationary?&lt;/p&gt;&#xA;" OwnerUserId="12221" LastEditorUserId="2183" LastEditDate="2017-07-17T07:33:48.963" LastActivityDate="2017-07-17T07:33:48.963" Title="Why is OU process stationary?" Tags="&lt;stochastic-processes&gt;&lt;mean-reversion&gt;&lt;stationarity&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15267" PostTypeId="2" ParentId="15266" CreationDate="2014-11-03T13:48:19.607" Score="2" Body="&lt;p&gt;I think you misunderstood the definition. Be stationary does not mean not depend of the time as you can check &lt;a href=&quot;http://en.wikipedia.org/wiki/Stationary_process&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. (Sorry for putting an wikipedia link here as I suppose you may have read it)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way to think is that the law any increment of the process is given by a same function&#xA;of the difference of time. More precisely $\forall ~t_2\geq t_1,$ :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathcal L \left\{X_{t_2}-X_{t_1}\right\}= \Gamma(t_2-t_1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular in the case of a stationary Gaussian process whose law as you know is well determined by  its mean and variance, the above condition can be expressed by &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb E \left[X_{t_2}-X_{t_1}\right]= m(t_2-t_1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Var} \left[X_{t_2}-X_{t_1}\right]= v(t_2-t_1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is the case for OU.&lt;/p&gt;&#xA;" OwnerUserId="3534" LastEditorUserId="3534" LastEditDate="2014-11-03T14:57:53.660" LastActivityDate="2014-11-03T14:57:53.660" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15268" PostTypeId="1" CreationDate="2014-11-03T15:05:03.790" Score="2" ViewCount="355" Body="&lt;p&gt;I have been comparing the historical stock data I am getting from Google Finance and Yahoo Finance. I am only getting six datapoints per day (date, open, high, low, close, volume). I have downloaded data from the Swedish stock exchange (Large Cap stocks).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Somehow I always end up with a little bit fewer set of datapoints (i.e. less dates) from Google. Do you know what the reason for this is?&lt;/p&gt;&#xA;" OwnerUserId="13448" LastActivityDate="2015-02-01T19:46:21.333" Title="Data point discrepancy between Google Finance and Yahoo Finance" Tags="&lt;google&gt;&lt;yahoofinance&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15269" PostTypeId="2" ParentId="15249" CreationDate="2014-11-03T15:10:43.753" Score="2" Body="&lt;p&gt;Let's think about it like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V(E,T) = \int_E^{\infty} (x-E)^{+} \rho (x) dx$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then $\frac{\partial C}{\partial E} = \int^\infty_E \rho(x) dx$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and $\frac{\partial^2 C}{\partial K^2} = \rho(K)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ill leave you to interpret these quantities. Hint, what is the defintion of the value of a contingent claim?&lt;/p&gt;&#xA;" OwnerUserId="13415" LastActivityDate="2014-11-03T15:10:43.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15270" PostTypeId="2" ParentId="15179" CreationDate="2014-11-03T15:15:50.403" Score="1" Body="&lt;p&gt;On the same time period or different ones? It's difficult to say for a different time period. It's actually difficult to say for the same time period, because dynamics are non-stationary. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's think about it like this: say you perform mean-variance on the S&amp;amp;P1500, with a short time period: this implies that your estimate of the covariance matrix is probably terrible. But, the nonstationarity of the problem might mean this is a better estimate than the classical one. Hence the estimate on the S&amp;amp;P1500 performs better than the one for the S&amp;amp;P500, since in fact having a large sample with a process which is not ergodic doesn't really help.&lt;/p&gt;&#xA;" OwnerUserId="13415" LastActivityDate="2014-11-03T15:15:50.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15271" PostTypeId="1" AcceptedAnswerId="15350" CreationDate="2014-11-03T15:28:17.847" Score="3" ViewCount="609" Body="&lt;p&gt;I need to persist every single FIX message received or sent by my order gateway for auditing purposes, however it takes more than 1 millisecond to write the bytes to disk. I tried to write in chunks of 64k but that did not help either. Was wondering what is the best practice to audit their trading gateway without introducing latency into their strategies.&lt;/p&gt;&#xA;" OwnerUserId="13413" LastActivityDate="2015-02-05T00:31:19.763" Title="Logging FIX Messages" Tags="&lt;fix&gt;" AnswerCount="4" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15272" PostTypeId="2" ParentId="15266" CreationDate="2014-11-03T15:30:25.607" Score="0" Body="&lt;p&gt;Im not sure its very Paul clear. By your definition, a Brownian Motion is stationary. In fact, for a stochastic process, stationarity is defined as statistically invariant under translations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try calculating this for the Brownian Motion and OU Process:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\forall A \in \mathbb{R}^N$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Pr\{X_1, ..., X_n \in A\} = Pr\{X_{1+h}, ..., X_{n+h} \in A\}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If those are equal, then the process is stationary.&lt;/p&gt;&#xA;" OwnerUserId="13415" LastActivityDate="2014-11-03T15:30:25.607" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15273" PostTypeId="1" AcceptedAnswerId="15278" CreationDate="2014-11-03T16:30:46.973" Score="1" ViewCount="468" Body="&lt;p&gt;In the past at my school the subject of &quot;Mathematics of Derivative securities&quot; has been taught out of two books.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Quantitative Finance&quot; by T. Wake Epps and &quot;Options, Futures and Other Derivatives&quot; by Hull, John C.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have found great reviews on Hull's book but haven't found anything on Epps book. Anybody out there know anything?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="13450" LastEditorUserId="13450" LastEditDate="2014-11-03T16:52:14.613" LastActivityDate="2014-11-03T20:10:11.870" Title="Information on books about mathematical finance" Tags="&lt;books&gt;&lt;soft-question&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15274" PostTypeId="2" ParentId="15179" CreationDate="2014-11-03T16:42:50.357" Score="2" Body="&lt;p&gt;Well, you are asking something very subjective. In addition it should be mentioned that S&amp;amp;P500 are the companies with higher capitalization of S&amp;amp;P1500. Therefore a huge weight of S&amp;amp;P1500 is set by S&amp;amp;P500. In fact, as it can be seen in 2008 both went down a 37%, in the other hand S&amp;amp;P500 has 80% of the total of the US equity Market. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After taking into account you should ask yourself a couple questions: What do I expect to perform better big caps, mid caps or small caps? And more important, is the 20% represented by mid and small caps going to out perform big caps?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you buy a fund which tracks S&amp;amp;P1500 you can understand this investment as something similar to core-satellite investment, in which you invest 80% in the index and 20% in trying to outperform the index. If you consider that the risk of investing on this market is worth your expected growth, go for it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my opinion, regarding the actual economic situation, I won't take this option until,at least 2 years,until things change. I don't think that the economy will grow that much in 1-2 years time. &lt;/p&gt;&#xA;" OwnerUserId="12089" LastActivityDate="2014-11-03T16:42:50.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15275" PostTypeId="2" ParentId="15268" CreationDate="2014-11-03T16:45:03.283" Score="0" Body="&lt;p&gt;In my opinion, all this sites with free data may have problems,you need to compare them. But if it is the same amount, just check the Adjusted Price, maybe yahoo has not adjusted the closing price. &lt;/p&gt;&#xA;" OwnerUserId="12089" LastActivityDate="2014-11-03T16:45:03.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15276" PostTypeId="2" ParentId="15268" CreationDate="2014-11-03T18:36:20.143" Score="1" Body="&lt;p&gt;There is a &lt;a href=&quot;https://quant.stackexchange.com/questions/8280/difference-between-google-finance-and-yahoo-finance/8297#8297&quot;&gt;similar question&lt;/a&gt; (not fully duplicate), but still -- the answer may provide a sufficient information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short, the reasons for discrepancies is usually: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;initial data sources (historical parts)&lt;/li&gt;&#xA;&lt;li&gt;the way data are collected (pure end-of-day or tick data)&lt;/li&gt;&#xA;&lt;li&gt;the way adjustments and corporate actions are handled&lt;/li&gt;&#xA;&lt;li&gt;the way post-trade corrections are handled&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Since the data sources for both sites are mix of different feeds, all kind of errors may occur.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yahoo sources:&#xA;&lt;a href=&quot;https://help.yahoo.com/kb/finance/SLN2310.html?impressions=true&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://help.yahoo.com/kb/finance/SLN2310.html?impressions=true&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Google sources:&#xA;&lt;a href=&quot;http://www.google.com/intl/en/googlefinance/disclaimer/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.google.com/intl/en/googlefinance/disclaimer/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2909" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2014-11-03T18:36:20.143" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15277" PostTypeId="2" ParentId="15226" CreationDate="2014-11-03T19:53:58.133" Score="2" Body="&lt;p&gt;You do not need to factor in the risk premium or the inflation rates to get the Forward Rate.  The calculation you are making is from the idea of &lt;a href=&quot;http://en.wikipedia.org/wiki/Interest_rate_parity&quot; rel=&quot;nofollow&quot;&gt;Covered Interest Rate Parity&lt;/a&gt;.  To calculate the forward rate all you need are the two interest rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure if the question is trying to confuse by giving extra data.  Inflation rates and risk premia can be important for related calculations.&lt;/p&gt;&#xA;" OwnerUserId="5689" LastActivityDate="2014-11-03T19:53:58.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15278" PostTypeId="2" ParentId="15273" CreationDate="2014-11-03T20:10:11.870" Score="2" Body="&lt;p&gt;I have heard good things about Epps but haven't read it. Hull is aimed at less technical people and can get a bit turgid. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have my list of recommended books with discussion at &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.markjoshi.com/RecommendedBooks.html&quot; rel=&quot;nofollow&quot;&gt;http://www.markjoshi.com/RecommendedBooks.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2014-11-03T20:10:11.870" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15279" PostTypeId="2" ParentId="15255" CreationDate="2014-11-03T20:13:47.860" Score="2" Body="&lt;p&gt;FX options are essentially the same mathematically as options on stocks that pay a continuous dividend. So the same arguments apply. If you are deeply in the money, it may be time to exercise a put.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2014-11-03T20:13:47.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15280" PostTypeId="2" ParentId="15235" CreationDate="2014-11-03T20:25:29.243" Score="1" Body="&lt;p&gt;Yes, the downside alpha is -0.0003. You can confirm that result if you include (1-D) explicitly as one more covariate, but then you'll have to request a model with no intercept.&lt;/p&gt;&#xA;" OwnerUserId="12031" LastActivityDate="2014-11-03T20:25:29.243" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15281" PostTypeId="2" ParentId="15179" CreationDate="2014-11-03T20:47:08.363" Score="2" Body="&lt;p&gt;You are asking two different questions: what would be the model result, and what would be the actual performance of an actual portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The optimal model results with the S&amp;amp;P 1500 will be at least as good as the model results with the S&amp;amp;P 500. The S&amp;amp;P is a proper subset of the S&amp;amp;P 1500, so you can get the results of the S&amp;amp;P 500 model by solving the S&amp;amp;P 1500 model with the added constraints that all non-S&amp;amp;P 500 shares have zero exposure.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;More explicitly if you partition the exposure variables into $x_{500}$ and $x_{1500}$ (where $x_{1500}$ represent exposures to S&amp;amp;P 1500 \ S&amp;amp;P 500) and let $y$ be a vector of all other variables in your model, the two optimizations are&#xA;    $$\eqalign z_{1500} = {\rm maximize} f(x) \hspace{0.2in} \\&#xA;     \mbox{subject to:} {\hspace 1.5 in} \\&#xA;      g_j(x_{500}, x_{1500}, y) = b_j {\hspace 0.15in} \forall j$$&#xA;and,&#xA;    $$\eqalign z_{1500} = {\rm maximize} f(x) \hspace{0.2in} \\&#xA;     \mbox{subject to:} {\hspace 1.5 in} \\&#xA;      g_j(x_{500}, x_{1500}, y) = b_j {\hspace 0.15in} \forall j \\&#xA;      x_{1500} = 0 {\hspace 1.38in} $$&#xA;For optimal solutions to both problems $z_{500} \le z_{1500}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are using a heuristic to solve both models instead of using a MIP solver like &lt;a href=&quot;http://www.gurobi.com/&quot; rel=&quot;nofollow&quot;&gt;gurobi&lt;/a&gt; or &lt;a href=&quot;http://www-03.ibm.com/software/products/en/ibmilogcpleoptistud/&quot; rel=&quot;nofollow&quot;&gt;CPLEX&lt;/a&gt;, then it is theoretically possible that your S&amp;amp;P 500 model will produce better results.  In fact, that might happen if, for example, you solver is running with a restrictive time limit, you have cardinality and minimum investment constraints and most of the optimal exposures happen to be in the S&amp;amp;P 500.  Even with a MIP solver, you are solving to a &lt;a href=&quot;http://www.gurobi.com/documentation/5.6/reference-manual/mipgap2#parameter:MIPGap&quot; rel=&quot;nofollow&quot;&gt;tolerance&lt;/a&gt;.  So if you are using the default MIP tolerances&#xA;$z_{500} \le z_{1500} \cdot (1-{\rm MIPGap})$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as actual performance of the two portfolios, if your model has some validity to the real world (which is &lt;a href=&quot;https://www.youtube.com/watch?feature=player_detailpage&amp;amp;v=R-Km9qo5JyA#t=180&quot; rel=&quot;nofollow&quot;&gt;questionable&lt;/a&gt;), then you would expect the S&amp;amp;P 1500 portfolio to at least match either the return or variability of the S&amp;amp;P 500 portfolio.  I say expect because even portfolio optimization theory doesn't say that a given sub-optimal portfolio will under-perform an optimal portfolio over any single time period.&lt;/p&gt;&#xA;" OwnerUserId="1418" LastEditorUserId="1418" LastEditDate="2014-11-06T17:53:35.397" LastActivityDate="2014-11-06T17:53:35.397" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15282" PostTypeId="2" ParentId="15179" CreationDate="2014-11-03T22:08:59.843" Score="0" Body="&lt;p&gt;Intuitively, I would be thinking about how SP500 and SP1500 are different. A few points that come to my mind:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Different liquidity of constituents&lt;/li&gt;&#xA;&lt;li&gt;Number and frequency of rebalancing/constituents changes&lt;/li&gt;&#xA;&lt;li&gt;Different levels of diversification&lt;/li&gt;&#xA;&lt;li&gt;Different cost of matching the index&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Since, again intuitively (EDIT: and a little less so since I have added few links),  it seems that the liquidity premium, due to inclusion of lower-cap firms &lt;a href=&quot;http://home.business.utah.edu/hank.bessembinder/publications/issuesassessingtrade.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;(Bessembinder 2002)&lt;/a&gt;, on the SP1500 is unlikely to be entirely compensated by higher average returns and diversification (compare &lt;a href=&quot;http://us.spindices.com/indices/equity/sp-composite-1500&quot; rel=&quot;nofollow noreferrer&quot;&gt;S&amp;amp;P data&lt;/a&gt;, &lt;a href=&quot;https://www.wiso.uni-hamburg.de/fileadmin/sozialoekonomie/bwl/bassen/Lehre/International_Finance_I/Lectures/20080506_Number_of_stocks_in_a_diversified_portfolio.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Statman 1987&lt;/a&gt; and &lt;a href=&quot;http://rof.oxfordjournals.org/content/12/3/433.short&quot; rel=&quot;nofollow noreferrer&quot;&gt;Goetzmann &amp;amp; Kumar 2008&lt;/a&gt;). Therefore the operational cost will most likely account for the difference. Since the index is cap-weighted one would, on average, trade more often for a SP1500 setup and that would stand a good chance to pull down the after fee returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: To further illustrate that the larger index likely incurs higher costs a simple backtest of a 10 vs 100 constituents selection of the SP500 is shown below. &#xA;&lt;img src=&quot;https://i.stack.imgur.com/4GhZP.png&quot; alt=&quot;Portfolio weight changes of first 10 alphabetically sorted symbols in SP500, 12m horizon, 6m smoothing, 1m startup and monthly rebalancing for minimum risk mean variance optimization with a long-only constraint&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Figure 1: Portfolio weight changes of first 10 alphabetically sorted symbols in SP500&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/wEfRB.png&quot; alt=&quot;Portfolio weight changes of first 100 alphabetically sorted symbols in SP500, 12m horizon, 6m smoothing, 1m startup and monthly rebalancing for minimum risk mean variance optimization with a long-only constraint&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Figure 2: Portfolio weight changes of first 100 alphabetically sorted symbols in SP500&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is not, by any means, a proper study. It's just the first items of the index when symbols are alphabetically sorted and rebalancing for index changes is not even considered. However one can observe, keeping all optimization parameters constant, the number and magnitude of portfolio weight changes differ.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As has been pointed out by other answers different optimisation assumptions, especially with regard to the time horizon, the investment objectives and market expectations affect the outcome.&lt;/p&gt;&#xA;" OwnerUserId="7186" LastEditorUserId="7186" LastEditDate="2014-11-05T12:02:59.700" LastActivityDate="2014-11-05T12:02:59.700" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15283" PostTypeId="1" CreationDate="2014-11-03T22:41:00.570" Score="4" ViewCount="208" Body="&lt;p&gt;When deriving the Black Scholes equation, it is usually stated &quot;we assume the change in the stock price is&quot;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS=\mu S(t) dt + $random term&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is why is the change in the stock price always proportional to the stock price (ignoring the random term for now)? Is it simply because the stock pays dividends which are proprtional to the stock price (in which case $\mu$ must be related to dividends). How do you find what $\mu$ is for a given stock or option? Is $\mu$ always positive?&lt;/p&gt;&#xA;" OwnerUserId="13452" LastActivityDate="2014-11-06T16:27:40.187" Title="Why is the rate of change of a stock price proportional to the stock price?" Tags="&lt;black-scholes&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15284" PostTypeId="2" ParentId="15283" CreationDate="2014-11-03T23:10:11.700" Score="2" Body="&lt;p&gt;This is based on observations of historical data.  If you looked at a histogram of daily &lt;em&gt;changes&lt;/em&gt;, you would notice that the distribution is heavily skewed.  Whereas if you looked at a histogram of daily &lt;em&gt;returns&lt;/em&gt;, you would see that it is much closer to normally distributed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for how to find $\mu$, you don't.  The beauty of the Black-Scholes model is that when the option is delta hedged to remove the random term, the $\mu$'s all cancel out as well.&lt;/p&gt;&#xA;" OwnerUserId="12050" LastActivityDate="2014-11-03T23:10:11.700" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="15286" PostTypeId="1" AcceptedAnswerId="15306" CreationDate="2014-11-04T04:38:04.123" Score="1" ViewCount="163" Body="&lt;p&gt;In optimizing my automated trading system I find that certain combinations while increasing the &lt;em&gt;expectancy&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(AverageWin * ProfitableTradesRatio) - (AverageLoss * (1 - ProfitableTradesRatio))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Reduces the number of trades the strategy is making.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So although the expectancy increased dramatically, the number of trades went from 2,000 to just 40 over a 3 year backtest period which is not acceptable frequency of trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What performance metric can I optimize to balance this. I'd like to increase the expectancy without reducing the number of trades significantly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Further analysis shows that this is not only a problem with expectancy but other metrics like Max Drawdown that I'm measuring which also decreases as the numbers of trades decrease. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What method can I generically apply to adjust for this? This is not to be confused with SomeMetric &quot;Per Trade&quot;. Simply dividing a metric by the number of trades does not seem to allow me to optimize that metric such that I can identify performance gains that &lt;em&gt;have not&lt;/em&gt; decreased the frequency of trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this doesn't make much sense, here's some data to illustrate. This is an optimization for &quot;parameter&quot; column (each row is an optimization run). I'm not sure how to identity whether there is any meaningful increase in expectancy (or decrease in max drawdown) by increase said &quot;parameter&quot; since the number of trades depletes along with each metric. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; parameter  total trades    expectancy    expectancy per trade  max drawdown &#xA; 0          710             233.2957746   0.328585598           -1.389104131&#xA; 2          640             158.53125     0.247705078           -1.799492989&#xA; 4          559             129.9463327   0.232462134           -2.127999294&#xA; 6          478             106.6945607   0.223210378           -1.463252512&#xA; 8          402             134.6641791   0.33498552            -1.364193967&#xA; 10         349             176.0601719   0.504470407           -1.196254362&#xA; 12         303             134.4224422   0.443638423           -1.114376551&#xA; 16         225             193.6222222   0.86054321            -0.657900215&#xA; 20         181             242.3480663   1.338939593           -0.558306147&#xA; 25         135             514.6296296   3.812071331           -0.493760619&#xA; 30         106             47.16981132   0.44499822            -1.471772548&#xA; 35         85              206           2.423529412           -1.482912119&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can't tell if it's worth decreasing the trading frequency for these performance gains. Anything under 300 trades in 3 years is not even an acceptable frequency of trading.&lt;/p&gt;&#xA;" OwnerUserId="3038" LastEditorUserId="3038" LastEditDate="2014-11-04T05:12:19.710" LastActivityDate="2015-02-02T21:58:49.137" Title="Optimization metric that takes into account number of trades vs expectancy" Tags="&lt;optimization&gt;&lt;automated-trading&gt;&lt;portfolio-optimization&gt;&lt;trading-systems&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15287" PostTypeId="1" CreationDate="2014-11-04T05:46:40.063" Score="0" ViewCount="2931" Body="&lt;p&gt;Say that I have two bonds and one of them has positive convexity and the other negative. Which one is better (assuming that you only care about convexity)? I understand that high convexity is desirable because the bondholder can benefit more from a drop in the interest rate than an identical increase in the interest rate. Does that mean negative convexity is bad, because investors are more affected by a raise in the interest rate?&lt;/p&gt;&#xA;" OwnerUserId="13454" LastEditorUserId="7186" LastEditDate="2014-11-04T13:31:28.497" LastActivityDate="2014-11-04T23:09:37.577" Title="In bond pricing, is negative convexity better than positive convexity?" Tags="&lt;fixed-income&gt;&lt;bond&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15289" PostTypeId="1" CreationDate="2014-11-04T08:17:04.900" Score="2" ViewCount="521" Body="&lt;p&gt;I'm reading Brigo D., Mercurio F. Interest Rate Models - Theory and Practice (Springer, 2006)(ISBN 3540221492) and also a &lt;a href=&quot;http://outatpapers.ssrn.com/sol3/papers.cfm?abstract_id=552581&quot; rel=&quot;nofollow noreferrer&quot;&gt;source article on LMM cascade calibration to swaptions by Brigo and Morini&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I completely confused with notation. From what I understand it follows that they reference to volatility of swaptions that mature at time T=0. Either I miss something basic or there are no such swaptions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are more details. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the &lt;a href=&quot;http://outatpapers.ssrn.com/sol3/papers.cfm?abstract_id=552581&quot; rel=&quot;nofollow noreferrer&quot;&gt;article&lt;/a&gt; in section 3 they introduce notation for black's swaption volatility $V_{a,b}$ - this is vol of swaptions with maturity at $T_a$ and underlying swap length $T_b - T_a$. But in next section they write: &lt;img src=&quot;https://i.imgur.com/MxDnpGj.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where formula 8 is how to calculate swaption vol from cap vols: &lt;img src=&quot;https://i.stack.imgur.com/y3Gb1.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My main question is&lt;/strong&gt; - do $V_{0,1}$, $V_{0,2}$ have any meaning under these definitions (volatility of swaps that mature at T=0 with length 1 and 2 years)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also in their book on page 323 in section 7.4 they provide table that completely confuses me. &#xA;&lt;img src=&quot;https://i.stack.imgur.com/cFP1t.png&quot; alt=&quot;enter image description here&quot;&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do indices of $V$'s correlate with these maturities and lenthts? From my understanding table should look like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V_{1,2} V_{1,3} V_{1,4}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V_{2,3} V_{2,4}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V_{3,4}$ &lt;/p&gt;&#xA;" OwnerUserId="7486" LastEditorUserId="7486" LastEditDate="2014-11-05T13:47:27.500" LastActivityDate="2014-12-17T07:50:27.707" Title="LMM. Calibration to swaptions by Brigo and Morini. Volatility of swaption that matures at T=0" Tags="&lt;interest-rates&gt;&lt;calibration&gt;&lt;swaption&gt;&lt;lmm&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15290" PostTypeId="1" CreationDate="2014-11-04T08:18:12.617" Score="2" ViewCount="92" Body="&lt;p&gt;I would be interested in a list of all the banks and financial institutions that have been Primary Dealers in the European Union from the 1980s until today. For a current list you can check &lt;a href=&quot;http://www.afme.eu/WorkArea/DownloadAsset.aspx?id=9229&quot; rel=&quot;nofollow&quot;&gt;this pdf by AFME&lt;/a&gt;.If the full list of Primary Dealers isn’t available, then a list of Inter-Dealer banks would suffice. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="8028" LastEditorUserId="8028" LastEditDate="2014-11-04T08:28:15.377" LastActivityDate="2014-11-04T08:28:15.377" Title="Historical list of Primary Dealers in Europe" Tags="&lt;data&gt;&lt;market-making&gt;&lt;banks&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15291" PostTypeId="1" AcceptedAnswerId="15590" CreationDate="2014-11-04T10:25:39.867" Score="4" ViewCount="952" Body="&lt;p&gt;I am having trouble understanding the reasons that led Andersen to define his QE scheme to efficiently simulate Heston Stochastic volatility model (you may check the celebrated scheme &lt;a href=&quot;http://www.ressources-actuarielles.net/EXT/ISFA/1226.nsf/0/1826b88b152e65a7c12574b000347c74/$FILE/LeifAndersenHeston.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The gist of it is that for &quot;sufficiently large&quot; values of the process modelling the variance, the scheme adopts the form:&#xA;$$&#xA;V(t+dt) = a(b + Z)^2&#xA;$$&#xA;where $a,b$ are certain constants and $Z$ is a standard Gaussian random variable. For low values of $V$ he thinks that it is better to use:&#xA;$$&#xA;V(t+dt)  = \Psi^{-1}(U_V;p,\beta)&#xA;$$&#xA;where $U_V$ is drawn from a uniform distribution, and $$&#xA;\Psi^{-1}(u) = \Psi^{-1}(u;p,\beta) = \left\{ \begin{array}{rl}&#xA; 0 &amp;amp;\mbox{ if $0\leq u \leq p$} \\&#xA;  \beta^{-1}\ln\left(\frac{1-p}{1-u} \right) &amp;amp;\mbox{ if $p&amp;lt;u\leq1$}&#xA;       \end{array} \right.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Andersen deduces this scheme by saying: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;The first step is based on an observation that a non- central chi-square with moderate or high non-centrality parameter can be well-represented by a power-function applied to a Gaussian variable&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But then he gives little detail about why this observation is useful to develop his scheme, and why he thinks that when the variance his low the scheme needs to change its form. If somebody knows the mechanics behind his reasoning, I would be very glad if you could provide more insight into the subject.&lt;/p&gt;&#xA;" OwnerUserId="13457" LastEditorUserId="13457" LastEditDate="2014-11-04T10:58:25.153" LastActivityDate="2014-12-23T01:32:04.233" Title="Quadratic exponential method (by Andersen) in Heston model" Tags="&lt;stochastic-processes&gt;&lt;stochastic-volatility&gt;&lt;numerical-methods&gt;&lt;heston&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15292" PostTypeId="1" AcceptedAnswerId="15296" CreationDate="2014-11-04T10:30:05.173" Score="2" ViewCount="691" Body="&lt;p&gt;I am looking for an &lt;em&gt;easy&lt;/em&gt; and &lt;em&gt;well presented&lt;/em&gt; introduction to Black-Scholes theory and stochastic calculus aimed at undergraduate mathematics students. Please can you recommend a book?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How about Paul Wilmott on QF? &lt;/p&gt;&#xA;" OwnerUserId="6661" LastEditorUserId="12" LastEditDate="2014-11-04T13:55:17.220" LastActivityDate="2014-11-04T15:28:51.787" Title="Black scholes text book" Tags="&lt;black-scholes&gt;&lt;reference-request&gt;" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15293" PostTypeId="2" ParentId="15292" CreationDate="2014-11-04T10:47:13.903" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://www.iaqf.org/bookstore&quot; rel=&quot;nofollow&quot;&gt;http://www.iaqf.org/bookstore&lt;/a&gt;&#xA;Here you can find the list of books recommended by the professionals in quantitative finance. You can search the recommended books for each topic.&lt;/p&gt;&#xA;" OwnerUserId="12006" LastActivityDate="2014-11-04T10:47:13.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15294" PostTypeId="2" ParentId="15287" CreationDate="2014-11-04T11:20:04.790" Score="1" Body="&lt;p&gt;I am going to assume that the only thing you are interested in is convexity and the &lt;a href=&quot;http://blogs.cfainstitute.org/investor/2013/06/25/a-bond-convexity-primer/&quot; rel=&quot;nofollow&quot;&gt;many other aspects&lt;/a&gt; as well as the suitability of focusing on a single measure are not addressed. In such a general setting &lt;strong&gt;more positive&lt;/strong&gt; convexity provides, as you have already outlined, for the potential to &lt;strong&gt;increase prices&lt;/strong&gt; at a &lt;strong&gt;faster&lt;/strong&gt; rate as a response to interest &lt;strong&gt;rate declines&lt;/strong&gt;. In addition you want to consider where your bond sits on the convexity spectrum and your interest rate expectations. Quote from comments to the article above with regard to expectations of rising interest rates: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;It depends what side of the convexity curve your bond resides. For any&#xA;  given duration, you would want HIGH convexity if you are on the right&#xA;  hand (the flattening) part of the curve.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In summary: high, absolute, positive convexity is most likely desirable while high, absolute, negative convexity is most likely less desirable given stable or falling interest rates. The distinction between level and direction of convexity are important as well the expectations regarding interest level and volatility, among other things such as the position in the covexity spectrum.&lt;/p&gt;&#xA;" OwnerUserId="7186" LastActivityDate="2014-11-04T11:20:04.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15295" PostTypeId="2" ParentId="37" CreationDate="2014-11-04T12:48:39.167" Score="3" Body="&lt;p&gt;I subscribed recently to ActiveTick, primarily because of the Excel add-in they offer. The ability to feed real time data into Excel equations sounded really promising, but what I have found is a service that is incredibly unreliable. I’ve been sitting here for the last 5 hours watching the add-in try to connect with the server, but no luck. This is about the 5th time this has happened in the last 40 trading days, not a good track record IMHO. When it works, it works great. The problem is its reliability and they are not recommended.&lt;/p&gt;&#xA;" OwnerUserId="13461" LastActivityDate="2014-11-04T12:48:39.167" CommentCount="0" CommunityOwnedDate="2014-11-04T12:48:39.167" ContentLicense="CC BY-SA 3.0" />
  <row Id="15296" PostTypeId="2" ParentId="15292" CreationDate="2014-11-04T13:44:30.850" Score="2" Body="&lt;p&gt;I suggest you &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/019957474X&quot; rel=&quot;nofollow&quot;&gt;Arbitrage Theory in Continuous Time&lt;/a&gt; by Tomas Bjork. It is a standard reference introducing Stochastic Calculus, then Black-Scholes both from a hedging portfolio perspective and a martingale point of view. It has also some nice chapters on American Options, exotic options and Fixed income derivatives.&lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2014-11-04T13:44:30.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15297" PostTypeId="1" AcceptedAnswerId="15308" CreationDate="2014-11-04T13:48:20.140" Score="0" ViewCount="182" Body="&lt;p&gt;I am trying to compose one index out of several (three) indices with variable weights, 50%, 25% and 25%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After normalizing and calculating the log returns, what would be the best way to create the final benchmark index. We would also require to re-balance daily?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="13462" LastEditorUserId="13462" LastEditDate="2014-11-07T13:32:21.687" LastActivityDate="2014-11-08T08:05:59.697" Title="Index creation from multiple time-series and variable weights" Tags="&lt;risk-management&gt;&lt;returns&gt;&lt;index&gt;&lt;rebalancing&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15298" PostTypeId="2" ParentId="15292" CreationDate="2014-11-04T13:55:03.963" Score="1" Body="&lt;p&gt;Have a look at the following titles:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.worldscientific.com/worldscibooks/10.1142/3856&quot; rel=&quot;nofollow&quot;&gt;http://www.worldscientific.com/worldscibooks/10.1142/3856&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://books.google.de/books?id=z42E_VIaQbIC&amp;amp;lpg=PR2&amp;amp;pg=PR2#v=onepage&amp;amp;q&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;http://books.google.de/books?id=z42E_VIaQbIC&amp;amp;lpg=PR2&amp;amp;pg=PR2#v=onepage&amp;amp;q&amp;amp;f=false&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.markjoshi.com/concepts/&quot; rel=&quot;nofollow&quot;&gt;http://www.markjoshi.com/concepts/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.worldscientific.com/worldscibooks/10.1142/8495&quot; rel=&quot;nofollow&quot;&gt;http://www.worldscientific.com/worldscibooks/10.1142/8495&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="12" LastActivityDate="2014-11-04T13:55:03.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15299" PostTypeId="2" ParentId="15248" CreationDate="2014-11-04T14:05:10.457" Score="1" Body="&lt;p&gt;I am not sure what you are asking but the example below might be useful :&#xA;if you are talking about foreign denominated bonds then,&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Current USD/CHN exchange rate = 1.5&lt;/li&gt;&#xA;&lt;li&gt;%YTM in CHN = 14%&lt;/li&gt;&#xA;&lt;li&gt;%YTM in US =3%&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Then USD/CHN on maturity will be = 1.5*1.14/1.03 = 1.66&lt;/p&gt;&#xA;" OwnerUserId="12006" LastActivityDate="2014-11-04T14:05:10.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15301" PostTypeId="2" ParentId="15292" CreationDate="2014-11-04T15:28:51.787" Score="0" Body="&lt;p&gt;I like &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0521552893&quot; rel=&quot;nofollow&quot;&gt;Financial Calculus: An Introduction to Derivative Pricing&lt;/a&gt; by Baxter and Rennie. It's less technical than Shreve or Bjork, whether that's an advantage or disadvantage is up to you.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2014-11-04T15:28:51.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15302" PostTypeId="2" ParentId="15271" CreationDate="2014-11-04T15:51:55.680" Score="4" Body="&lt;p&gt;As suggested you could try a RAM disk or some other form of quick caching and then write to hard disk at intervals or even off-hours. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could also introduce some multi-threading into your application and create a dedicated thread (or service) to handle the logging side exclusively.&lt;/p&gt;&#xA;" OwnerUserId="7514" LastActivityDate="2014-11-04T15:51:55.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15303" PostTypeId="1" CreationDate="2014-11-04T15:58:47.733" Score="1" ViewCount="403" Body="&lt;p&gt;I’m interested in databases with quarterly balance sheet data of the financial sector.  I’m aware of the following datasets:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-&lt;a href=&quot;http://wrds-web.wharton.upenn.edu/wrds//ds/compm/nam.cfm?navGroupHeader=Compustat%20Monthly%20Updates&amp;amp;navGroup=North%20America&quot; rel=&quot;nofollow&quot;&gt;Compustat&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-&lt;a href=&quot;http://wrds-web.wharton.upenn.edu/wrds//ds/comp/globalm.cfm?navGroupHeader=Compustat%20Monthly%20Updates&amp;amp;navGroup=Global&quot; rel=&quot;nofollow&quot;&gt;Compustat Global&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-&lt;a href=&quot;https://bankscope.bvdinfo.com&quot; rel=&quot;nofollow&quot;&gt;Bankscope&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone point out other sources with, possibly, international quarterly data and time series that go at least back to 2000. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2014-11-04T16:16:44.740" Title="Best sources for worldwide balance sheet data?" Tags="&lt;data&gt;&lt;banks&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15304" PostTypeId="2" ParentId="15303" CreationDate="2014-11-04T16:16:44.740" Score="1" Body="&lt;p&gt;Worldscope is pretty standard for international fiscal data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.rimes.com/thomson-reuters-worldscope&quot; rel=&quot;nofollow&quot;&gt;http://www.rimes.com/thomson-reuters-worldscope&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8201" LastActivityDate="2014-11-04T16:16:44.740" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15305" PostTypeId="2" ParentId="15255" CreationDate="2014-11-04T20:14:17.493" Score="0" Body="&lt;p&gt;Hi After searching Google I found some good reasons and I think that it might be useful for others also, So I post it here too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The put’s payoff is bounded: at maturity, the maximal gain is K (less the premium) if the underlying is worth 0 (It is not the same with the call where the potential gain is unlimited). In the case of an American put, this fact limits the benefit of waiting to exercise: an early exercise is optimal if the underlying spot price gets low enough (interest rate). The possible risk-free arbitrage takes place when the put is deep in-the-money. An early exercise provides X. If the difference between X and the present value of X is larger than the corresponding call price, one invests PV(X), buys the call and makes the risk-free profit. (notice: the foreign risk-free rate on the foreign currency can be viewed as a dividend yield)&lt;/p&gt;&#xA;" OwnerUserId="13329" LastActivityDate="2014-11-04T20:14:17.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15306" PostTypeId="2" ParentId="15286" CreationDate="2014-11-04T20:29:49.563" Score="1" Body="&lt;p&gt;I think the problem is not that you optimize a wrong criterion, but the trading strategy itself. Compare this to testing a hypothesis: if you reject at p-value of 1% then the proportion of true discoveries among all discoveries is, say, 70% (high &quot;expectancy&quot;). If you reject at 10% then the true discovery proportion is 40% (lower &quot;expectancy&quot;), but you make a lot more rejections (&quot;trades&quot;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, one would prefer having a lot of rejections and a high &quot;expectancy&quot;, but for that you need to modify the testing procedure itself as opposed to changing the cutoff p-value.&lt;/p&gt;&#xA;" OwnerUserId="12031" LastActivityDate="2014-11-04T20:29:49.563" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15307" PostTypeId="1" CreationDate="2014-11-04T20:39:21.830" Score="4" ViewCount="435" Body="&lt;p&gt;I often run quick tests of trading strategies in my analytics suites by:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;multiplying a vector of signal (lagged, {-1,0,1}) with a time series&#xA;of daily percentage returns&lt;/li&gt;&#xA;&lt;li&gt;doing a cumulative product of the resulting time series after adding&#xA;1 to each return&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This is fairly standard but to be clear:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \text{NAV}_i = \prod_{ j = 1 }^i  (1 + r_j) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I have many assets, I do the first step on each return series, then element-wise sum, and then the second step.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having run such strategies with real money, I know that the implicit assumption that the portfolio will be rebalanced to constant exposure relative to each day's NAV is unrealistic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I would like to know is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Does anyone have any other issues with this approach for running backtests? Particularly for multi-underlying strategies?&lt;/li&gt;&#xA;&lt;li&gt;To &quot;make&quot; the strategy trade on a monthly basis, would it be sufficient to sum daily returns intra-month (so that there is one summed-up return for each month) and then do the cumulative product in step 2 on the series of these summed returns?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="13467" LastEditorUserId="467" LastEditDate="2014-11-05T03:30:40.620" LastActivityDate="2015-02-03T05:04:24.040" Title="How to compute daily compounded backtest returns closer to real-world results?" Tags="&lt;backtesting&gt;&lt;strategy&gt;&lt;performance&gt;&lt;asset-returns&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15308" PostTypeId="2" ParentId="15297" CreationDate="2014-11-04T20:53:57.523" Score="2" Body="&lt;p&gt;You can't really combine the assets' log returns. You should calculate percentage returns for the three assets. Then at each time step, the portfolio's total return is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r(i) = 0.5 \times \text{asset1_return}(i) + 0.25 \times \text{asset2_return}(i) + 0.25 \times \text{asset3_return}(i)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you've calculated the time series of the portfolio's returns, you create another time series by adding 1 to each return, $r(i)$ -- let's call this series &quot;$s$&quot;. It is the daily return of a portfolio with 50% in asset 1, 25% in asset 2 and 25% in asset 3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the portfolio index is created by multiplying each successive element of &quot;$s$&quot; with all the previous elements. This can be written recursively as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\text{Index}(i) = \text{Index}(i-1) \times s(i)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This index then represents what a daily rebalanced portfolio would perform as.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Importantly, the index weights are constant, so if you had \$100 invested the first day, the portfolio would consist of \$50 in the first asset and \$25 each in assets 2 and 3. If on the second day, the portfolio value was \$103, then the procedure above assumes that the portfolio is rebalanced to consist of \$51.50 in the first asset and \$25.75 in the second and third assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that I've just asked some questions about this procedure elsewhere on this site -- this is the classic way to backtest a strategy but in reality few portfolios rebalance daily like this.&lt;/p&gt;&#xA;" OwnerUserId="13467" LastEditorUserId="4910" LastEditDate="2014-11-08T08:05:59.697" LastActivityDate="2014-11-08T08:05:59.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15311" PostTypeId="2" ParentId="15248" CreationDate="2014-11-04T21:21:35.803" Score="4" Body="&lt;p&gt;You're thinking of a &quot;cross-currency basis swap&quot;, not a CCS. A CCS is a floating-for-floating swap that would, for example, let you switch 3m SHIBOR into 3m USD Libor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A cross-currency basis swap, on the other hand, is a swap of funding spreads (loosely speaking, LIBOR - OIS equivalent). It's essentially the liquid way of exchanging currency for long periods of time as the FX swap market only goes out to about 18 months.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the 5yr EURUSD x-ccy basis swap is quoted as &quot;-15bp&quot; right now. The standard is  to quote it vs 3m USD Libor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You are a USD-denominated investor and want to buy \$10m worth of a 5yr EUR-denominated bond.&lt;/li&gt;&#xA;&lt;li&gt;For convenience and without loss of generality, say 3m USD Libor is 25bp and 3m EUR Libor is also 25bp. Also assume the 5yr EURUSD x-ccy basis swap is -15bp as previously stated.&lt;/li&gt;&#xA;&lt;li&gt;You go to a bank and enter into a 5yr x-ccy basis swap: you hand over \$10m and get the equivalent in EUR (at the current rate) in return.&lt;/li&gt;&#xA;&lt;li&gt;Euros in hand, you then go and buy the EUR-denominated bond you wanted.&lt;/li&gt;&#xA;&lt;li&gt;Every 3 months, you pay 0.25 * (25bp - 15bp) = 2.5bp on the Euros you received and receive 0.25 * 25bp = 6.25bp on the USD you handed over.&lt;/li&gt;&#xA;&lt;li&gt;At the end of 5 years, you have a pile of Euros (because your bond matured or you sold it) which you hand back to the bank, and in exchange you are given back your USD. Note that since both parties are simply returning the notionals they exchanged at initiation, the effective exchange rate at termination is the same as the initial rate. Any interest rate differentials are resolved through the quarterly payments.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The key here is that during the lifetime of the trade, you are receiving both the yield on the bond and a &quot;discount&quot; of 15bp/year through the basis swap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The implicit assumption is that you're a &quot;spread investor&quot; rather than an &quot;all-in yield&quot; investor, and therefore the only thing you're interested in is the pick-up over your Libor funding rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fact that the x-ccy basis swap is negative in our example suggests that non-USD investors are willing to pay a premium (effectively 15bp/year in this case) to obtain USD funding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;During the crisis there was a significant shortage of dollar funding around the world, which led to most x-ccy basis swaps plummeting. If I remember right, AUD and EUR x-ccy basis went to -100bp.&lt;/p&gt;&#xA;" OwnerUserId="13467" LastActivityDate="2014-11-04T21:21:35.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15312" PostTypeId="2" ParentId="881" CreationDate="2014-11-04T22:57:53.120" Score="2" Body="&lt;p&gt;Who is a quant's favourite actor?&#xA;A) Heston&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2014-11-04T22:57:53.120" CommentCount="0" CommunityOwnedDate="2014-11-04T22:57:53.120" ContentLicense="CC BY-SA 3.0" />
  <row Id="15313" PostTypeId="2" ParentId="15287" CreationDate="2014-11-04T23:09:37.577" Score="0" Body="&lt;p&gt;negative convexity, most likely, will imply that bond has embedded option. i.e. bond holder sells call option to bond issuer. therefore you'll have negative gamma position = collect option premium and short volatility. &lt;/p&gt;&#xA;" OwnerUserId="13279" LastActivityDate="2014-11-04T23:09:37.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15315" PostTypeId="2" ParentId="15307" CreationDate="2014-11-05T03:44:39.947" Score="3" Body="&lt;p&gt;If you do step 1 and step 2 every day, then you indeed assume that you rebalance the strategy &lt;em&gt;every day&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to assume differently, for example monthly, you need to first compound the returns for each asset separately during the whole month and then do a weighted sum of the compounded returns using the weights of each asset at the beginning of the period to get the overall period return, without the rebalancing assumption.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2014-11-05T03:44:39.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15317" PostTypeId="2" ParentId="881" CreationDate="2014-11-05T07:40:26.817" Score="9" Body="&lt;p&gt;Q. Why do Quants have the best job in the world? &#xA;A. Because they spend their time looking at MODELS all day.&lt;/p&gt;&#xA;" OwnerUserId="11814" LastActivityDate="2014-11-05T07:40:26.817" CommentCount="0" CommunityOwnedDate="2014-11-05T07:40:26.817" ContentLicense="CC BY-SA 3.0" />
  <row Id="15318" PostTypeId="2" ParentId="881" CreationDate="2014-11-05T07:50:14.753" Score="8" Body="&lt;p&gt;Two Day-Traders went to go eat (after the market closed of course!). One of the traders orders a steak and has a hard time cutting it. He then asks for a sharper knife... when he unfolds his cutlery the knife hits his plate and falls out of the table and lands right by his foot which was slightly sticking out of the table. The other trader looks at him and says &quot;Why didn't you move your foot when the knife was falling?!&quot; to which he responded, &quot;I thought it was going back up!&quot;. &lt;/p&gt;&#xA;" OwnerUserId="11814" LastActivityDate="2014-11-05T07:50:14.753" CommentCount="0" CommunityOwnedDate="2014-11-05T07:50:14.753" ContentLicense="CC BY-SA 3.0" />
  <row Id="15319" PostTypeId="2" ParentId="15219" CreationDate="2014-11-05T09:14:57.423" Score="0" Body="&lt;p&gt;In my case (and I work mostly with natural gas) what I do in the calibration is to use the real value of $\Delta t$ from the historical data, and measure the time in days. In this way, $\Delta t=1$ in most cases, and $\Delta t=1$ in the weekends, so that you take into account the invisible changes in the markets during the weekends.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It also help after the calibration, because counting days when doing simulations get easier, because you can simulate for every day, even if the market is closed, using always $\Delta t=1$. Or, if for example, you need to calculate the time to maturity of an option, you can just subtract the present date from the maturity date.&lt;/p&gt;&#xA;" OwnerUserId="6356" LastActivityDate="2014-11-05T09:14:57.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15320" PostTypeId="1" AcceptedAnswerId="15336" CreationDate="2014-11-05T12:42:34.483" Score="0" ViewCount="98" Body="&lt;p&gt;In various financial models such as CAPM, Black Scholes, one assumes the returns are adjusted for dividends.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I understand it, the share price often (in a relative sense) increases a bit before the dividend is paid, and decreases a bit once the dividend has been paid. This intuitive so you cannot make a significant profit by buying and selling before and after the dividend is paid. Please correct me it I'm wrong however. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In light if this, what is the agreed upon way(s) for adjusting share prices for dividends? Yahoo finance report &quot;adjusted&quot; share prices for example -- how do they calculate them?&lt;/p&gt;&#xA;" OwnerUserId="6661" LastActivityDate="2014-11-06T09:00:43.283" Title="Returns adjusted for dividends" Tags="&lt;dividends&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15321" PostTypeId="1" CreationDate="2014-11-05T13:30:46.083" Score="1" ViewCount="52" Body="&lt;p&gt;I'm trying to get my head around how inflation really affects index trackers. I've been looking at this question, but somehow misses the point I want (&lt;a href=&quot;https://quant.stackexchange.com/questions/12871/how-to-account-for-inflation-over-historical-data&quot;&gt;How To Account For Inflation Over Historical Data&lt;/a&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets take FTSE ALL UK index tracker and UK inflation as an example: Would it make sense to adjust the FTSE ALL against the inflation measured during the same period to be able to visualise the real FTSE growth?&#xA;If it make sense, how would you do it exactly? Would it be as straight forward as divide the tracker value per inflation value?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just to make myself clear, the idea behind is to remove the growth component in the tracker due to inflation. &lt;/p&gt;&#xA;" OwnerUserId="13472" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2014-11-05T13:30:46.083" Title="Index tracker and inflation" Tags="&lt;index&gt;&lt;inflation&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15322" PostTypeId="1" AcceptedAnswerId="15327" CreationDate="2014-11-05T14:08:30.787" Score="5" ViewCount="176" Body="&lt;p&gt;Let $W_t$ be a Wiener process. It is clear to me that $dW_t$ is of size $\sqrt{dt}$. This can be seen because &#xA;$$&#xA;  \mathrm{Var}(W_{t+\Delta} - W_{t})=\Delta.&#xA;$$&#xA;But am I allowed to actually write $(dW_t)^2 = dt$? It looks a bit silly... you have the square of a &lt;strong&gt;random&lt;/strong&gt; variable on the left hand side, and a &lt;strong&gt;deterministic&lt;/strong&gt; variable on the right hand side.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please can you clarify whether this is right or wrong and perhaps give an explanation for this peculiar identity.&lt;/p&gt;&#xA;" OwnerUserId="6661" LastEditorUserId="848" LastEditDate="2014-11-07T09:05:12.920" LastActivityDate="2014-11-07T09:05:12.920" Title="Stochastic Differential" Tags="&lt;stochastic-processes&gt;&lt;probability&gt;&lt;stochastic-calculus&gt;&lt;wienerprocess&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15323" PostTypeId="2" ParentId="15184" CreationDate="2014-11-05T14:47:30.770" Score="1" Body="&lt;p&gt;Book with counterpart SwedishAlphaBank, with whom you margin in SEK:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;USD   RUB   SEK   SEKPnL&#xA; 0     0     0      0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Buy 100 SEK worth of USD/RUB, meaning buy USD and sell RUB.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;100   -100   0      0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With RUB interest rate at 0 (!), USD/RUB moves to 1.1, USD/SEK stays flat at 1&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;100   -100   0    9.09&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Square up back to SEK on USD and RUB:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; 0      0    9.09   0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You say this is worse than doing it via USD, but USD/SEK is 1:1 for the whole thing, it is &lt;em&gt;exactly the same&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;100 USD -(100 RUB/1.1 RUB per USD) = 9.09 USD&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding buy/sell: buy means to enter a long position on something. So if I enter a long position on USD/RUB, as USD/RUB goes up (1.0 to 1.1), I win. That can only be the case if I am net positive USD vs RUB. I am not convinced, though, that being 'long Rouble' is the same as having a position in USD over RUB, so there is some care to be had there - certainly 'holding Rouble' is a balance in RUB which would benefit from RUB strengthening (1.0 -&gt; 0.9) rather than weakening (1.0 -&gt; 1.1).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The buy/sell terms are used in other markets where a position is entered rather than an asset explicitly bought. If you buy futures, the same happens; as the future goes up in price, you win, even though the number is just a construct from the exchange. Similarly you can 'buy' an IRS; the buyer pays fixed and receives float. Vanilla IRS are par instruments, so nobody is theoretically paying any money at the outset, but again if the par fix rate goes up, the buyer gains here (the position will be in the money).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to dig deeper, money itself is an asset, which you exchange for a contract or a bill. So even buying a share is exchanging a promissory note from a central bank for a contractual note, certificate or numbers in a database. &lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2014-11-05T14:47:30.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15324" PostTypeId="2" ParentId="15247" CreationDate="2014-11-05T14:50:49.320" Score="2" Body="&lt;p&gt;As close to a definitive no as you can get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&#xA;From wcoetzee@wiley.com Wed Nov  5 07:44:32 2014&#xA;Date: Wed, 5 Nov 2014 14:44:17 +0000&#xA;From: &quot;Coetzee, Werner - London&quot; &#xA;To: &quot;paul@wilmott.com&quot; , Barry Carter &#xA;Subject: RE: Answer key to your books?&#xA;&#xA;    [ The following text is in the &quot;utf-8&quot; character set. ]&#xA;    [ Your display is set for the &quot;ISO-8859-1&quot; character set.  ]&#xA;    [ Some characters may be displayed incorrectly. ]&#xA;&#xA;Hi Barry,&#xA;&#xA;No, unfortunately there isn't a solutions manual (or answers to the end of chapter &#xA;exercises and questions) for 'Paul Wilmott Introduces Quantitative Finance 2e' (only a&#xA;CD which is packaged with the book that features additional spreadsheets/workbooks) nor &#xA;for 'Paul Wilmott on Quantitative Finance' box set. &#xA;&#xA;Kind Regards,&#xA;&#xA;Werner&#xA;&#xA;&#xA;-----Original Message-----&#xA;From: Paul Wilmott [mailto:paul@wilmott.com] &#xA;Sent: 05 November 2014 14:24&#xA;To: Barry Carter; Coetzee, Werner - London&#xA;Subject: Re: Answer key to your books?&#xA;&#xA;W,&#xA;&#xA;Can you help Barry? Is there a solutions manual?&#xA;&#xA;P&#xA;&#xA;&#xA;&gt; On 5 Nov 2014, at 13:38, Barry Carter  wrote:&#xA;&gt;&#xA;&gt; How do I show that I'm a lecturer? People tell me I lecture them all the time ;)&#xA;&gt;&#xA;&gt;&gt; On Mon, 3 Nov 2014, Paul Wilmott wrote:&#xA;&gt;&gt;&#xA;&gt;&gt; Date: Mon, 3 Nov 2014 20:34:30 +0000&#xA;&gt;&gt; From: Paul Wilmott &#xA;&gt;&gt; To: Barry Carter &#xA;&gt;&gt; Subject: Re: Answer key to your books?&#xA;&gt;&gt; Only for lecturers!&#xA;&gt;&gt;&#xA;&gt;&gt; P&#xA;&gt;&gt;&#xA;&gt;&gt;&#xA;&gt;&gt;&gt; On 3 Nov 2014, at 18:53, Barry Carter  wrote:&#xA;&gt;&gt;&gt;&#xA;&gt;&gt;&gt; Do you offer/have answer keys to the quesions asked in your textbooks?&#xA;&gt;&#xA;&#xA;&#xA;------------------------------------------------------------------------------------------------------------&#xA;John Wiley &amp; Sons Limited is a private limited company registered in England with registered number 641132.&#xA;Registered office address: The Atrium, Southern Gate, Chichester, West Sussex, United Kingdom. PO19 8SQ.&#xA;------------------------------------------------------------------------------------------------------------&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user59" LastEditorUserId="848" LastEditDate="2014-11-05T22:16:23.067" LastActivityDate="2014-11-05T22:16:23.067" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15325" PostTypeId="1" AcceptedAnswerId="15332" CreationDate="2014-11-05T17:30:31.853" Score="3" ViewCount="1023" Body="&lt;p&gt;First caveat:  I'm a programmer doing this for a client, and my knowledge of options probably has holes in it.  So be a little forgiving here.  =)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Issue:  When I run Black Scholes Newton against all options in a chain, I occasionally get NaN return values.  My comparison for accuracy is against ThinkorSwim's numbers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are screencaps of the issue:  &lt;a href=&quot;https://imgur.com/a/cItIj&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://imgur.com/a/cItIj&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;spot, strike, time, etc, are all there.  And most of the time the numbers are accurate.  But once I hit certain ranges with Calls and Puts, I get those NaN's, and I can't seem to figure out the pattern as to &lt;em&gt;why&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using garagebandhedgefund's code as a base, with adjustments for puts/calls.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the Newton Code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; public static double OptionPriceImpliedVolatilityCallBlackScholesNewton(double S, double K, double r, double time, double optionPrice,bool iscall, bool isput,out double price,out double diff)&#xA;    {&#xA;        price = 0;&#xA;        diff = 0;&#xA;        int MAX_ITERATIONS = 100;&#xA;        double ACCURACY = 1.0e-5;&#xA;        double t_sqrt = Math.Sqrt(time);&#xA;        double sigma = (optionPrice / S) / (0.398 * t_sqrt);    // find initial value  &#xA;         price = 0;&#xA;        for (int i = 0; i &amp;lt; MAX_ITERATIONS; i++)&#xA;        {&#xA;            if (iscall)&#xA;            {&#xA;                 price = OptionPriceCallBlackScholes(S, K, r, sigma, time);&#xA;            }&#xA;            if (isput)&#xA;            {&#xA;                 price = OptionPricePutBlackScholes(S, K, r, sigma, time);&#xA;            }&#xA;            diff = optionPrice - price;&#xA;            if (Math.Abs(diff) &amp;lt; ACCURACY)&#xA;                return sigma;&#xA;            double d1 = (Math.Log(S / K) + r * time) / (sigma * t_sqrt) + 0.5 * sigma * t_sqrt;&#xA;            double vega = (S * t_sqrt * NormDist(d1));&#xA;            sigma = sigma + diff / vega;&#xA;        }&#xA;        return sigma;  // something screwy happened, should throw exception  // &amp;lt;--- original code  &#xA;        //throw new Exception(&quot;An error occurred&quot;); // Comment this line if you uncomment the line above  &#xA;    }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My question:  Is it my code?  Is it certain ranges of values?  Are there cases where Newton fails to return valid values?  I'm kinda stumped here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the record, when I use this data against garageband's Bisection code, I get errors across the board.  I don't know if that's related.  I'm fairly certain of the accuracy of my input data, since I do get &lt;em&gt;some&lt;/em&gt; valid returns with Newton.&lt;/p&gt;&#xA;" OwnerUserId="6839" LastActivityDate="2019-03-19T12:44:23.000" Title="C# - Using Black Scholes Newton returns NaN occasionally" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;programming&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15326" PostTypeId="2" ParentId="15325" CreationDate="2014-11-05T19:08:41.307" Score="1" Body="&lt;p&gt;.NET doubles return &lt;code&gt;double.NaN&lt;/code&gt; when you do things like divide zero by zero. With doubles, anything less than &lt;code&gt;double.Epsilon&lt;/code&gt; is &quot;zero&quot; for the purpose of this result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suggest that your &lt;code&gt;vega&lt;/code&gt; is less than &lt;code&gt;double.Epsilon&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What happens if you run the same method using &lt;code&gt;decimal&lt;/code&gt; instead?&lt;/p&gt;&#xA;" OwnerUserId="2782" LastActivityDate="2014-11-05T19:08:41.307" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15327" PostTypeId="2" ParentId="15322" CreationDate="2014-11-05T21:00:38.450" Score="8" Body="&lt;p&gt;I can clarify 100% that $(dw)^2$= $dt$ and recommend you to accept it as a fact.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like any other differential, this differential is defined in terms of its integral:&#xA;$$&#xA;\int_{t_{0}}^{t_{1}}(dW)^{2}\equiv\lim_{n\rightarrow\infty}\sum_{k=0}^{n-1}[W(t_{k+1})-W(t_{k})]^{2}&#xA;$$&#xA;Where $t_{k}=t_{0}+k(t_{1}-t_{0})/n$. Since&#xA;$$&#xA;W(t_{k+1})-W(t_{k})=\sqrt{t_{k+1}-t_{k}}\xi_{k}=\sqrt{\frac{t_{1}-t_{0}}{n}}\xi_{k}&#xA;$$&#xA;We have&#xA;$$&#xA;\int_{t_{0}}^{t_{1}}(dW)^{2}\equiv\lim_{n\rightarrow\infty}\frac{t_{1}-t_{0}}{n}\sum_{k=0}^{n-1}\xi_{k}^{2}&#xA;$$&#xA;where $\xi_{0}, \xi_{1},$ . . $\xi_{n-1}$ are independent $N(0,1)$ variables. Clearly the mean ofthe sum is&#xA;$$&#xA;E[\frac{t_{1}-t_{0}}{n}\sum_{k=0}^{n-1}\xi_{k}^{2}]=\frac{t_{1}-t_{0}}{n}\sum_{k=0}^{n-1}E[\xi_{k}^{2}]=t_{1}-t_{0}&#xA;$$&#xA;Since the $\xi$'s are independent, the variance ofthe sum is&#xA;$$&#xA;Var[\frac{t_{1}-t_{0}}{n}\sum_{k=0}^{n-1}\xi_{k}^{2}]=\frac{(t_{1}-t_{0})^{2}}{n^{2}}\sum_{k=0}^{n-1}Var[\xi_{k}^{2}]=\frac{(t_{1}-t_{0})^{2}}{n^{2}}\sum_{k=0}^{n-1}E[(\xi_{k}^{2}-1)^{2}]&#xA;$$&#xA;For unit Gaussian variables, $E[(\xi_{k}^{2}-1)^{2}]=2$, so the variance ofthe sum works out to&#xA;$$&#xA;Var[\frac{t_{1}-t_{0}}{n}\sum_{k=0}^{n-1}\xi_{k}^{2}]=\frac{2}{n}(t_{1}-t_{0})^{2}&#xA;$$&#xA;Thus&#xA;$$&#xA;\int_{t_{0}}^{t_{1}}(dW)^{2}\equiv\lim_{n\rightarrow\infty}S_{n}&#xA;$$&#xA;where the sum $S_{n}$ has mean $t_{1}-t_{0}$ and variance $O(1/n)$ . We conclude that in the limit&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ n\rightarrow\infty$, this integral is $t_{1}-t_{0}$ with certainty. Thus&#xA;$$&#xA;\int_{t_{0}}^{t_{1}}(dW)^{2}=t_{1}-t_{0}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For any $t_0$ and $t_1$. Since differentials are defined only in terms of their integral, we can rewrite it as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(dw)^2 = dt$&lt;/p&gt;&#xA;" OwnerUserId="13329" LastActivityDate="2014-11-05T21:00:38.450" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15328" PostTypeId="1" AcceptedAnswerId="15330" CreationDate="2014-11-05T22:37:58.810" Score="1" ViewCount="13135" Body="&lt;p&gt;Does it make sense to look at par yield curve for German bonds in the current environment? Because low rates mean that a lot of bonds are trading above much above par (even around 150!). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would have thought a zero curve makes more sense, as it takes out the coupon effect. Use of the curve could be anything from pricing/hedging/calculating spreads (z/ASW).&lt;/p&gt;&#xA;" OwnerUserId="7117" LastActivityDate="2014-11-06T07:53:46.540" Title="Par Yield Curves vs Zero Curves" Tags="&lt;fixed-income&gt;&lt;yield-curve&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15330" PostTypeId="2" ParentId="15328" CreationDate="2014-11-06T00:49:21.953" Score="4" Body="&lt;p&gt;The important thing to know is that the par curve, the zero curve, the forward curve, and the discount curve are just transformations of each other; they contain exactly the same information (see &lt;a href=&quot;https://quant.stackexchange.com/questions/14567/what-is-the-swap-curve/14576#14576&quot;&gt;What is the Swap Curve?&lt;/a&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the confusion arises because many books tell you to connect the yields to maturity of benchmark bonds and call it the par yield curve. It's ok as an approximation (since most benchmark bonds trade close to par), but that doesn't give you the &quot;real&quot; par curve. If a bond is trading at 150, it's certainly not a par bond and its yield is not a par yield.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way a proper par curve is constructed is as follows: you start with actual bonds traded in the market, and then create a best-fit curve using a curve fitting technique. From this best fit curve, you can compute the theoretical par yield, which are yields of bonds trading at par. &lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2014-11-06T00:49:21.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15331" PostTypeId="1" CreationDate="2014-11-06T01:09:42.563" Score="4" ViewCount="121" Body="&lt;p&gt;What are the odds that a 10 delta option will become a 30 delta option in &quot;N&quot; number of days?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is that calculation possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, I want to know the probability with which my 56 day, 10 delta option will become a 30 delta option anytime over the next 16 days.&lt;/p&gt;&#xA;" OwnerUserId="13478" LastEditorUserId="467" LastEditDate="2014-11-06T05:17:02.500" LastActivityDate="2014-11-06T15:23:42.437" Title="What is the probability distribution of the changes in $\Delta$?" Tags="&lt;delta&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15332" PostTypeId="2" ParentId="15325" CreationDate="2014-11-06T06:28:58.787" Score="7" Body="&lt;p&gt;Some option prices can't be converted to volatility. E.g. A bid for an in-the-money call which is below its intrinsic value. So sometimes NaN is a valid answer.&#xA;Best way to handle it is to do precursory checks before going down to the search loop.&lt;/p&gt;&#xA;" OwnerUserId="7216" LastActivityDate="2014-11-06T06:28:58.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15333" PostTypeId="2" ParentId="15328" CreationDate="2014-11-06T07:53:46.540" Score="2" Body="&lt;p&gt;I would put it a bit differently.&#xA;You can do 2 things:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Either you apply an optimization/fitting procedure that has all the bond prices as inputs and zero rates for the chosen maturities as outputs. The objective function is the deviation between the discounted (by the to-be-found zero-rates) cashflows of each bond  and the traded bond prices. To find a stable set of parameters that don't fluctuate too much and give a good fit is a hard thing to do.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Another approach is to derive a yield curve first. It is a construction of time-to-maturity at the x-axis and yield-to-maturity on the y-axis. As explained for example &lt;a href=&quot;http://people.stern.nyu.edu/jcarpen0/courses/b403333/03yield.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; a bond that has (theoretical) coupons equal to its yield is priced at par (100). That's why a yield-curve constructed in this way is also called a coupon-curve.&#xA;In order to derive a zero-rates curve from this you can apply a bootstrapping procedure.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I also strongly recommend &lt;a href=&quot;http://www.nuclearphynance.com/User%20Files/389/SalomonBrothersFixedIncome1.pdf&quot; rel=&quot;nofollow&quot;&gt;Overview of Forward Rate Analysis&lt;/a&gt; by Antti Ilmanen.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-11-06T07:53:46.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15334" PostTypeId="1" AcceptedAnswerId="15348" CreationDate="2014-11-06T08:08:38.887" Score="2" ViewCount="88" Body="&lt;p&gt;While I prepared some quick and lazy charts picking just the first 10 symbols out of the SP500 for &lt;a href=&quot;https://quant.stackexchange.com/questions/15179/portfolio-optimization-using-sp-universes&quot;&gt;this other question&lt;/a&gt; I observed, that the first 10 symbols (figure 1) actually outperformed the larger selection (100 symbols in figure 2) by quite a bit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/yP8va.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Figure 1: Cumulated backtesting performance of first 10 alphabetically sorted symbols in SP500&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/1NZIZ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Figure 2: Cumulated backtesting performance of first 100 alphabetically sorted symbols in SP500&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At first I put the difference down to chance but later remembered that start-ups are advised to choose names early in the alphabet. A quick google search turned up some recent &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2390015&quot; rel=&quot;nofollow noreferrer&quot;&gt;research&lt;/a&gt; on this anomaly. And as discussed elsewhere on the site &lt;a href=&quot;https://quant.stackexchange.com/questions/1895/why-do-some-anomalies-persist-while-others-fade-away&quot;&gt;some anomalies persist&lt;/a&gt; quite some time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While my observation is most likely very biased (Apple is part of the first 10 symbols) I am wondering if anybody else has observed anything similar in other markets or instruments or whether there is more related research. It would be of particular interest to see if, and why, any such affect would be stable over time or periodic (e.g., occurring during certain phases in a business cycle).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: note, last 10 SP500 stocks would have performed even better then the first...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you share research or own observations regarding such an &quot;alphabet effect&quot;?&lt;/p&gt;&#xA;" OwnerUserId="7186" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2014-11-06T20:30:35.980" Title="An Alphabet Effect?" Tags="&lt;portfolio-management&gt;&lt;research&gt;&lt;reference-request&gt;&lt;anomalies&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15335" PostTypeId="2" ParentId="15244" CreationDate="2014-11-06T08:41:13.953" Score="2" Body="&lt;p&gt;The derivation is correct and given the formula you should get $w^{*'} \vec{1} = 1$. My guess is that the inversion of the $\Omega$ matrix is numerically badly conditioned. Instead of implementing the formula as it is, have you tried to calculate $\vec{1}^{'} \Omega^{-1}$ and $e^{'} \Omega^{-1}$ only once and rewrite:&#xA;$$ w^{*\prime} = \frac{1}{2}\left[ \frac{ \left(2 + e^\prime \Omega^{-1} \vec 1\right)\vec 1^\prime \Omega^{-1} - \left(\vec 1^\prime \Omega^{-1} \vec 1\right) e^\prime \Omega^{-1}}{\vec 1^\prime \Omega^{-1} \vec 1 }   \right]&#xA;$$&#xA;This formulation might be numerically more stable.&lt;/p&gt;&#xA;" OwnerUserId="7396" LastActivityDate="2014-11-06T08:41:13.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15336" PostTypeId="2" ParentId="15320" CreationDate="2014-11-06T09:00:43.283" Score="1" Body="&lt;p&gt;I am assuming that you are interested in how the returns behave around dividend payment dates, since the adjustment process for Yahoo is covered in their &lt;a href=&quot;https://help.yahoo.com/kb/finance/SLN2311.html?impressions=true&quot; rel=&quot;nofollow&quot;&gt;help&lt;/a&gt; section. The drop has been &lt;a href=&quot;https://www.minneapolisfed.org/research/wp/wp500.pdf&quot; rel=&quot;nofollow&quot;&gt;found&lt;/a&gt; to be aprox. the amount of the dividend yield. More recently it &lt;a href=&quot;http://www-bcf.usc.edu/~dhsolomo/divid.pdf&quot; rel=&quot;nofollow&quot;&gt;appears&lt;/a&gt;, that in the run-up to the dividend date some premium may be earned.&lt;/p&gt;&#xA;" OwnerUserId="7186" LastActivityDate="2014-11-06T09:00:43.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15337" PostTypeId="1" CreationDate="2014-11-06T09:47:35.563" Score="3" ViewCount="786" Body="&lt;p&gt;As far as I understood, implied volatility (IV) is a lucky parametrization of the vanilla option's price. That is, instead of deciding how much the call worth now, you can decide on its IV and put this in the Black-Scholes (BS) formula since all other inputs (underlying price, time to maturity etc.) are readily available. In that case, we use IV $\sigma$ as a free variable which we adjust to fit the market prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This parametrization and the choice of the free variable is by no means unique: for example, we can say that instead of BS price for call $V(S,\sigma,\dots)$ we invent $W(S,\sigma,\alpha,\dots) = \alpha\cdot V(S,\sigma,\dots)$. In that case, we may estimate $\sigma$ as a 30-days end-of-day volatility of underlying returns (so that it becomes a measurable from market data, fixed quantity) and let $\alpha$ be a new free variable. It will have a similar effect: raise $\alpha$ to raise call price, and we can talk in term of implied $\alpha$ surface rather that IV surface. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The popularity of the IV parametrization seems to be in the fact that it's simpler, we just use the BS framework and don't have to come up with new variables. Am I right, or am I missing some points here?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The IV is hence an inconsistent model: it's like we pick up a random formula (say BS formula) with one free variable, and just try to fit the output to the market prices by changing the value of this variable. Because of that, we can't do much against the market - in contrast, would the CRR binomial model predict statistics of underlying prices correctly, if we get a market price significantly different from the CRR price, we can trade it and make a risk-free profit by hedging. The IV approach does not even seem to have a potential here: you are relying on the market prices, and cannot say whether they are right or wrong. Am I right here as well?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the reasons above, I have the following question. Gatheral writes that more consistent stochastic volatility models are used to derive values for exotic options, parameters being fitted over the vanilla options prices. Does it mean that we can't do better with vanilla option prices just by using the IV approach?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please tell me if the question is not clear, I'd be happy to fix that.&lt;/p&gt;&#xA;" OwnerUserId="13480" LastActivityDate="2014-11-06T21:18:10.293" Title="Implied volatility and pricing of vanilla options" Tags="&lt;option-pricing&gt;&lt;implied-volatility&gt;&lt;stochastic-volatility&gt;" AnswerCount="1" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="15338" PostTypeId="1" CreationDate="2014-11-06T10:24:15.670" Score="1" ViewCount="139" Body="&lt;p&gt;For a problem where we need to optimize the portfolio based on the data, going for Markowitz MPT has the following advantage: we only have to estimate mean and covariance to find optimal weights. I'd call this approach model-free as it does not require constructing a model for the evolution of the constituents of the portfolio. I wonder if comparable techniques are available for dynamic portofilo rebalancing. There is a multitude of methods in case you've got a model: for example, you can apply stochastic optimal control via dynamic programming, however I am interested in model-free methods.&lt;/p&gt;&#xA;" OwnerUserId="13480" LastActivityDate="2014-11-06T10:24:15.670" Title="Model-independent dynamic portfolio optimization techniques" Tags="&lt;portfolio-management&gt;&lt;optimization&gt;&lt;modern-portfolio-theory&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15339" PostTypeId="2" ParentId="15271" CreationDate="2014-11-06T11:07:13.250" Score="3" Body="&lt;p&gt;RAM is super fast but not persistent. If you suffer an outage, such as a power loss, all your FIX records will be gone and your audit trail broken.  Solid state disks (SSD) in a RAID configuration give a great combination of throughput and reliability.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my day job I design database applications for a living.  When considering system failure and recovery we have two concepts to keep in mind - recovery time objective (RTO) and recovery point objective (RPO).  RTO is the estimated time to get a failed system up and running again.  RPO is how much data loss you can accept as a consequence of the outage.  From the wording of your question it sounds like your RPO is zero i.e. it is not acceptable for this system to loose any FIX records as a result of a system failure.  If this is the case you just &lt;em&gt;cannot&lt;/em&gt; use volatile storage (i.e. RAM) for this data.  It has to go to persistent media immediately.  The trick it to minimise the extra latency inherent in persistent storage.  If you can, in fact, accept some small data loss during system failure this, needs to be agreed with your users and management and the system costed and designed accordingly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are low latency products specifically for persisting high volume data. &lt;a href=&quot;http://basho.com/riak/&quot; rel=&quot;nofollow&quot;&gt;RIAK&lt;/a&gt; is one that springs to mind, though the search engine of your choice may suggest others.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another alternative would be to take this function out of the application and ask the network to log all traffic that looks likes a FIX message.  There are third part tools and appliances which can do this out of the box.&lt;/p&gt;&#xA;" OwnerUserId="13481" LastEditorUserId="13481" LastEditDate="2014-11-07T20:47:46.617" LastActivityDate="2014-11-07T20:47:46.617" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15340" PostTypeId="1" CreationDate="2014-11-06T14:37:03.253" Score="4" ViewCount="1512" Body="&lt;p&gt;Key Rate Durations (KRD) are essentially some fixed income instrument's price sensitivity to a non-parallel shift in interest rates (i.e., a shift at the &quot;Key&quot; Rate). For example, a 10-year bond's sensitivity to a 1% change in &lt;em&gt;only&lt;/em&gt; the 5-year interest rate would be that bond's 5yr KRD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me refer to any fixed-income instruments that are not straight bonds as exotics (e.g., MBSs, CMOs, ABSs, etc). Is it possible to get KRDs greater than the respective key rate tenor for exotic fixed-income instruments without leverage? I tend to see this behavior most often in MBSs. For example, I'm looking at the KRDs for some MBS (comprised of ARMs if I'm not mistaken) with CUSIP: 36225DA20. The KRDs from Bloomberg as of now are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Key Rate    KRD&#xA;6mo         0.92&#xA;1yr         -0.72&#xA;2yr         -0.81&#xA;3yr         0.49&#xA;5yr         0.56&#xA;7yr         0.63&#xA;10yr        0.43&#xA;20yr        -0.08&#xA;30yr        0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A couple things stick out. The 6mo KRD is 0.92, which I thought would be too high. However, there are also several negative KRDs, (which I don't find as unusual).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anyone please shed some light on these figures and how they tie out?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="5407" LastActivityDate="2018-11-22T23:01:45.313" Title="Key Rate Duration for MBSs greater than Key Rate Tenor" Tags="&lt;fixed-income&gt;&lt;duration&gt;&lt;exotics&gt;&lt;mbs&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15341" PostTypeId="2" ParentId="15331" CreationDate="2014-11-06T15:23:42.437" Score="2" Body="&lt;p&gt;I am assuming you are talking about probability of becoming &lt;em&gt;at least&lt;/em&gt; $\Delta = 30$, otherwise probability is zero. Hard to give a complete answer as quite some information is missing. As you are seeking for the probability, the outcome definitely depends on which model of underlying you are using. Moreover, even if you are using the BS model, some parameter values are important. For example, it is natural to conclude that for very high values of $\sigma$ such probability is relatively high, whereas for $\sigma \ll 1$ I would expect this probability to be almost zero. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nevertheless, let me tell how would I approach the problem in the BS framework. We have&#xA;$$&#xA;  \Delta = N(d), \quad d = \frac{\log(S/K) + (r+\frac12\sigma^2)t}{\sigma \sqrt t}&#xA;$$&#xA;and hence we can reformulate the problem in terms of $d$: the current value is $d_0 = -1.28$ and we would like to reach the level of $d^* = -0.525$. Thus, you can formulate the problem as follows: you want $S_t$ to reach the value of&#xA;$$&#xA;  S_t \geq K\cdot\exp\left(d^*\sigma\sqrt t -  (r+\frac12\sigma^2)t\right) \tag{1}&#xA;$$&#xA;at least once on the interval $[0,T]$. To find the probability of $(1)$ you need to solve the first hitting time problem:you know that &#xA;$$&#xA;  S_t = S_0\cdot\exp\left((r-\frac12\sigma^2)t+\sigma W_t\right),&#xA;$$&#xA;so in the end you get &#xA;$$&#xA;  W_t\geq d^*\sqrt t + \frac1\sigma\left(\log\frac K{S_0}-rt\right).&#xA;$$&#xA;In case of $r = 0$ this problem is a first hitting time of a square root curve by a Brownian motion, which is very likely to have been studied before, so there is a chance you get an analytical solution in that case.&lt;/p&gt;&#xA;" OwnerUserId="13480" LastActivityDate="2014-11-06T15:23:42.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15342" PostTypeId="2" ParentId="15244" CreationDate="2014-11-06T15:39:50.140" Score="4" Body="&lt;p&gt;Following @silencer's comment, your formula for variance is wrong. I would suggest that instead of trying to re-invent the wheel, you just use the formula that everyone else uses. So I'd replace your first indented line with &#xA;$$&#xA;w^{*}\equiv argmin\left\{ \frac{1}{2}w'\varSigma w-\lambda\left(w'\mathbf{1}-1\right)\right\} &#xA;$$&#xA;which will give you &#xA;$$&#xA;w^{*}=\frac{\Sigma^{-1}\mathbf{1}}{\mathbf{1}'\Sigma^{-1}\mathbf{1}}&#xA;$$&#xA;and then you can replace the $\Sigma$ with whatever your PCA or factor model tells you it should be.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2014-11-06T15:39:50.140" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15343" PostTypeId="2" ParentId="15283" CreationDate="2014-11-06T16:27:40.187" Score="3" Body="&lt;p&gt;As &lt;em&gt;Degustaf&lt;/em&gt; mentioned above, one of the keys to the exponential dynamics is just the fact that you first model (relative/log) returns and then describe the dynamics of the stock price itself. I am not sure whether the arbitrage argument of &lt;em&gt;experquisite&lt;/em&gt; is realistic, though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the estimation of the drift: if you know the drift, you can just trade based on it, or at least hedge options much more profitably. For sure, a lot of people would be interested in that knoweldge, and you can expect that people looked into that. You can start with &lt;a href=&quot;http://www.wilmott.com/messageview.cfm?catid=34&amp;amp;threadid=79577&quot; rel=&quot;nofollow&quot;&gt;this thread&lt;/a&gt;. My guess is that drift is much harder to estimate in a robust way, even harder than volatility, so that's why there is not many methods that would tell you have to compute a reliable estimate of the drift, not to say that the drift is likely to be time- and price-dependent, so you have to estimate a function rather than a single value.&lt;/p&gt;&#xA;" OwnerUserId="13480" LastActivityDate="2014-11-06T16:27:40.187" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15344" PostTypeId="1" CreationDate="2014-11-06T16:51:25.430" Score="4" ViewCount="1370" Body="&lt;p&gt;Consider two FRAs. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;3x6 , Effective 3 months from now, terminates in 6 months. The floating leg payer pays 3-month LIBOR. Fixing date for LIBOR &lt;em&gt;40 business days&lt;/em&gt;. To price this at par, the fixed leg payer will pay &lt;strong&gt;r40&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;3x6 , Effective 3 months from now, terminates in 6 months. The floating leg payer pays 3-month LIBOR. Fixing date for LIBOR &lt;em&gt;2 business days&lt;/em&gt;. To price this at par, the fixed leg payer will pay &lt;strong&gt;r2&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Will &lt;strong&gt;r2&lt;/strong&gt; and &lt;strong&gt;r40&lt;/strong&gt; be different? I would think so. These FRAs represent different risks. How will I determine &lt;strong&gt;r2&lt;/strong&gt; and &lt;strong&gt;r40&lt;/strong&gt; ? What is the exact relationship between &lt;strong&gt;r2&lt;/strong&gt; and &lt;strong&gt;r40&lt;/strong&gt; ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, suppose Instead of FRAs, I want to construct two 5 year fixed for floating swaps, both swaps have floating rate semi-annual payments of 6 month LIBOR but again have 2 business day and 40 business day fixings. Will I construct two different Yield Curves to price these guys? Will the fixing dates of my instruments used to bootstrap the curve have to match the fixing dates of my swap floating rate? How would I price these two floating legs?&lt;/p&gt;&#xA;" OwnerUserId="6909" LastActivityDate="2015-07-05T20:28:19.857" Title="IR Yield Curve and Fixing Dates" Tags="&lt;yield-curve&gt;&lt;interest-rate-swap&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15345" PostTypeId="1" AcceptedAnswerId="15819" CreationDate="2014-11-06T17:21:16.033" Score="9" ViewCount="12034" Body="&lt;p&gt;I fit an ARMA model in Matlab and before I calculate the predicted value with the prediction error I set the order $(p,q)$ to some random value.  But how can I determine the number of AR (p) and MA  lags (q)?&lt;/p&gt;&#xA;" OwnerUserId="13484" LastEditorUserId="2587" LastEditDate="2014-12-10T08:16:34.867" LastActivityDate="2014-12-10T10:39:25.207" Title="Find the order of an ARMA model (q &amp; p )" Tags="&lt;arma&gt;" AnswerCount="6" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15346" PostTypeId="2" ParentId="15345" CreationDate="2014-11-06T18:38:57.707" Score="4" Body="&lt;p&gt;You want to compute the BIC (Bayessian Information Criterion) or the AIC (Akaike information criterion) for different (p,q) pairs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Akaike_information_criterion#How_to_apply_AIC_in_practice&quot; rel=&quot;nofollow&quot;&gt;Here is a wikipedia article&lt;/a&gt; with information on how to interpret those criteria in practice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.mathworks.com/help/econ/choose-arma-lags.html&quot; rel=&quot;nofollow&quot;&gt;Here is a mathworks page&lt;/a&gt; with detailed instructions on how to perform this task within Matlab. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keep in mind that in practice and depending on your data you may want to choose low values for the (p,q) parameters to avoid overfitting.&lt;/p&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2014-11-06T18:38:57.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15347" PostTypeId="1" CreationDate="2014-11-06T19:12:13.620" Score="2" ViewCount="307" Body="&lt;p&gt;I have a project in mind that I am working on, but have little idea where to start.  I am a relative newcomer to python (about 1 years exp.) and limited knowledge of quant finance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I would like to do is simulate possible yield curves going out 1-3 years.  To do this, I planned on scraping the US Treasury website for historical data, and deriving historical daily changes in rates and correlations between terms.  Then use Monte Carlo simulation to forecast future curves.  - I have built a version of this in excel and crystal ball, but would like to code it in python.... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On top of this, I would also like to compute how different bond structures perform during those simulations... bullets, vs short term callable bonds, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am thinking i would need to use PyMC for the simulation... Any ideas on how to effectively price the various bond structures?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this whole thing a worthless idea?&lt;/p&gt;&#xA;" OwnerUserId="13485" LastActivityDate="2015-05-06T05:10:10.660" Title="UST Yield Curve Forecasting - Bond Structure Testing" Tags="&lt;fixed-income&gt;&lt;simulations&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15348" PostTypeId="2" ParentId="15334" CreationDate="2014-11-06T19:44:09.063" Score="2" Body="&lt;p&gt;There are a couple of nice papers about the dot-com effect by Michael Cooper: &lt;a href=&quot;http://home.business.utah.edu/finmc/papers.htm&quot; rel=&quot;nofollow&quot;&gt;full list,&lt;/a&gt; &lt;a href=&quot;http://home.business.utah.edu/finmc/FinalJFversion2371-2388.pdf&quot; rel=&quot;nofollow&quot;&gt;paper1&lt;/a&gt;, &lt;a href=&quot;http://home.business.utah.edu/finmc/Cooper%20Rau%20-%20Dotcom%20premium.pdf&quot; rel=&quot;nofollow&quot;&gt;paper2&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12031" LastActivityDate="2014-11-06T19:44:09.063" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15349" PostTypeId="2" ParentId="15337" CreationDate="2014-11-06T21:18:10.293" Score="5" Body="&lt;p&gt;CRR is just a numerical approximation to Black--Scholes. Its main use is in getting American option price. There is no real difference other than slight inaccuracy when using it for Europeans. So no it wouldn't do what you ask. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your questions are philosophical. What is the purpose of the model? if you estimate the volatility from a time series then you can use it to assess the prices of vanilla options. If you fit it to vanilla options then you can't but you can then use it to price exotics. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might find looking Rebonato's Volatility and Correlation helpful.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2014-11-06T21:18:10.293" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15350" PostTypeId="2" ParentId="15271" CreationDate="2014-11-07T00:55:39.327" Score="4" Body="&lt;p&gt;The correct way to do file I/O without introducing latency is to do it asynchronously, in other words, the logger thread just passes the message to another thread that is actually doing the disk I/O.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the past, it was assumed that it was impossible to do it without creating garbage and lock-contention, but with the emergence of lock-free queues it is now possible to do it using pipelining for inter-thread communication with ultra-low-latency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, &lt;a href=&quot;http://www.coralblocks.com/index.php/category/corallog/&quot; rel=&quot;nofollow&quot;&gt;CoralLog&lt;/a&gt; can easily log and persist messages in less than 100 nanoseconds, with throughput number above 4 million messages per second.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt; I am one of the developers of CoralLog.&lt;/p&gt;&#xA;" OwnerUserId="11804" LastActivityDate="2014-11-07T00:55:39.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15351" PostTypeId="2" ParentId="15347" CreationDate="2014-11-07T02:07:34.407" Score="1" Body="&lt;p&gt;You might be able to forecast interest rates using the yield curve itself. I am writing this on the fly so idk where interest rates are at right now but say if the one year US treasury is at 1% then the expected rate for the 2-yr should be 2% ( since you can gain 1% for one year and at maturity purchase another one year treasury and gain another 1%)... But as you may have notice this is not the case. The one year treasury can be at 1% and the 2-year may be at 2.50% , thus implying that the markets expect an increase in interest rates in the short term since the rate is higher than the &quot;expected&quot; rate of 2%... I hope it helps&lt;/p&gt;&#xA;" OwnerUserId="13428" LastActivityDate="2014-11-07T02:07:34.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15353" PostTypeId="2" ParentId="8247" CreationDate="2014-11-07T07:57:43.597" Score="3" Body="&lt;p&gt;&lt;strong&gt;Math&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Starting with two Differential Equations (one has stochastic term)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \frac{dS_t}{S_t}=μdt+σdW_t$&#xA;$ \frac{dD_t}{D_t}=-rdt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am assuming $\mu$, $\sigma$, and $r$ to be constant as is done in most introductory financial math courses and otherwise it would be more difficult to solve.&#xA;Notice: $D_t = e^{-rt}$ is the solution to the ODE above which is our continuous discounting factor.&#xA;$$-$$$$-$$&#xA;&lt;strong&gt;Remember this is theoretical and quite different from reality&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Intuition&lt;/strong&gt;&#xA;Why should $D_tS_t$ be a martingale? To think about this simply and with a business sort of mindset. One way to think about it is, is to say that the discounted stock price should not move because all the information is already priced into the stock. This is the efficient markets hypothesis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since we have given some possible idea (there is a more difficult arbitrage argument involving continuous hedging as well) about why $D_tS_t$ should be a martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Back to the &lt;strong&gt;Math&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We want $D_tS_t$ to be a martingale. Let's try to make it so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d(D_tS_t) = D_tdS_t + S_tdD_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$= D_tS_t(μdt+σdW_t) + S_t(-rD_t)dt = D_tS_t[(μ-r)dt + σdW_t]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well let's choose a $dW_t = d\tilde{W}_t - \theta dt$ such that the drift term is eliminated in $D_tS_t$ so that it becomes a martingale (all Ito processes w/ no drift are martingales).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\theta = \frac{μ-r}{σ}$ leads to &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d(D_tS_t) = D_tS_t[(μ-r)dt + σ(d\tilde{W}_t-\frac{μ-r}{σ}dt)] = σD_tS_tdW_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now it's a martingale !&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$-$$$$-$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{dS_t}{S_t} = μdt + σdW_t = rdt + σd\tilde{W}_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\therefore \frac{dS_t}{S_t}=rdt+σdW_t$ under risk neutral measure&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Much of the time we think in default by the risk neutral measure. So we may ignore Girsanov's change of measure from the physical measure to the risk-neutral measure. Not that anyone actually knows the physical measure anyway.&lt;/p&gt;&#xA;" OwnerUserId="13488" LastEditorUserId="13488" LastEditDate="2015-09-08T21:45:39.070" LastActivityDate="2015-09-08T21:45:39.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15354" PostTypeId="2" ParentId="9375" CreationDate="2014-11-07T08:42:59.597" Score="1" Body="&lt;p&gt;If I am not mistaken, the Feynman-Kac formula is related to the Kolmogorov's backward equation, so I would expect it to be available only for Markov processes. Diffusions are usually of Markovian type, in contrast to general Ito processes or more to say, general semimartinagales. Intuitively, the PDE/PIDE/... will describe the dynamics of distribution/expectation in time based on the current spatial structure:&#xA;$$&#xA;  \frac{\partial f}{\partial t} = Af \tag{1}&#xA;$$&#xA;where $A$ is a suitable linear operator (differential in case of diffusion, integro-differential for jump-diffusions). The dependence of the type $(1)$ certainly hints upon the Markovian structure, so I would not expect useful F-K formulas to be available for general semiartingales. I say &lt;em&gt;useful&lt;/em&gt;, since you can always include the whole history of the process as a state to try to express this as a Markov process, but over such an enlarged state space, I don't think F-K would be of any use even though it would be available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the stochastic differential, as with usual differential you are trying to decompose one function dynamics w.r.t. another. That is, $dH_t$ is a stochastic differential on its own, and it can be used as an integrator per theory of semimartingale stochastic integration. Another question is whether $df(H_t)$ can be expressed in terms of $H_t$. This is indeed true, see the general Ito formula in &lt;a href=&quot;http://www.andrew.cmu.edu/user/calmost/pdfs/21-882-int_lec.pdf&quot; rel=&quot;nofollow&quot;&gt;Theorem 2.7.1 here.&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13480" LastActivityDate="2014-11-07T08:42:59.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15355" PostTypeId="1" AcceptedAnswerId="19236" CreationDate="2014-11-07T08:50:57.307" Score="1" ViewCount="957" Body="&lt;p&gt;Consider a coupon bond, starting at $T_{0}$ , with face value $K$,&#xA;coupon payments at $T_1, . . . , T_n$ and a fixed coupon rate $r$. Determine the coupon&#xA;rate $r$, such that the price of the bond, at $T_0$, equals its face value.&lt;/p&gt;&#xA;" OwnerUserId="13370" LastActivityDate="2015-08-09T17:30:23.783" Title="I want to prove Determine the coupon rate $r$, such that the price of the bond, at $T_0$, equals its face value" Tags="&lt;finance&gt;&lt;bond&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15356" PostTypeId="1" AcceptedAnswerId="18886" CreationDate="2014-11-07T08:57:20.657" Score="4" ViewCount="564" Body="&lt;p&gt;Derive the pricing formula $$P(t)=P(t,T_{n})+\sum_{i=1}^{n}[P(t,T_{i-1})-P(t,T_{i})]$$directly, by constructing a&#xA;self-financing portfolio which replicates the cash flow of the floating rate bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P(t,T_{i-1}) $ means Buy, at time $t$, one $T_{i−1}$-bond. This will cost $P(t, T_{i−1})$&lt;br&gt;&#xA;$P(t)$ means price at $t$ time&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question is related to the Arbitrage Theory in&#xA;Continuous Time book by Tomas Bjork.&lt;/p&gt;&#xA;" OwnerUserId="13490" LastEditorUserId="467" LastEditDate="2015-07-16T02:54:23.460" LastActivityDate="2015-07-16T02:54:23.460" Title="How do I price $P(t)=P(t,T_{n})+\sum_{i=1}^{n}[P(t,T_{i-1})-P(t,T_{i})]$?" Tags="&lt;finance&gt;&lt;bond&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15357" PostTypeId="2" ParentId="15355" CreationDate="2014-11-07T12:48:27.040" Score="1" Body="&lt;p&gt;Are you familiar with the concept of yield-to-maturity (YTM)? &#xA;&lt;a href=&quot;http://people.stern.nyu.edu/jcarpen0/courses/b403333/03yield.pdf&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; you find all necessary steps.&#xA;You first calculate using the current price and the cashflows. Then as you can see in the paper provided a bond with coupon rate equal to its YTM is priced at par (100) and thus the price equals its face value.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-11-07T12:48:27.040" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15359" PostTypeId="1" CreationDate="2014-11-07T13:44:53.167" Score="0" ViewCount="106" Body="&lt;p&gt;Consider a consol bond, i.e. a bond which will forever pay one&#xA;unit of cash at $t = 1, 2, . . ..$ Suppose that the market yield $ y$ is constant for all&#xA;maturities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(a) Compute the price, at $t = 0$, of the consol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(b) Derive a formula (in terms of an infinite series) for the duration of the&#xA;consol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(c) Use (a) and Proposition 22.11 in order to compute an analytical formula&#xA;for the duration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(d) Compute the convexity of the consol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Proposition 22.11 we have $$\frac{dp}{dy}=\frac{d}{dy} \{\sum_{1}^n c_ie^{-yT_i}\}=-D.p.$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus we see that duration is essentially for bonds (w.r.t. yield) what delta &#xA; is for derivatives (w.r.t. the underlying price). The bond equivalent&#xA;of the gamma is convexity, which is defined as $$C=\frac{\partial^2p}{\partial u^2}$$&lt;/p&gt;&#xA;" OwnerUserId="13493" LastActivityDate="2014-11-07T13:44:53.167" Title="How to prove following order?" Tags="&lt;finance&gt;&lt;bond&gt;&lt;libor&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15360" PostTypeId="1" CreationDate="2014-11-07T14:29:26.867" Score="9" ViewCount="858" Body="&lt;p&gt;I've fitted my data to a generalized pareto distribution as to model the returns in the tails more accurately. The interior is fitted with kernel distributions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to now test whether the original returns conform to the hypothesized distribution (i.e. generalized pareto distribution). Can I do this with the Kolmogorov-Smirnov test? I've already QQ-plots. However, I would like to conduct a statistical significance test on top. Can some one help? Kind of struggling with implementing it in Matlab. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best &lt;/p&gt;&#xA;" OwnerUserId="12084" LastActivityDate="2016-05-01T16:35:10.530" Title="Kolmogorov-Smirnov test for Generalized Pareto Distribution" Tags="&lt;statistics&gt;&lt;distribution&gt;&lt;curve-fitting&gt;&lt;statistical-significance&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15361" PostTypeId="2" ParentId="15360" CreationDate="2014-11-07T17:04:52.980" Score="1" Body="&lt;p&gt;I don't know if there are any additional issues that arise with using goodness off fit with a piece-wise function. When I have fit generalized pareto distributions to series like financial market returns, I have noticed that it is common to differences between the estimated distribution and observed returns at the cutoff points. This is going to be the main difference between running the goodness of fit test on the entire GPD as opposed to the fits for the tails individually, since the kernel density fit will be good.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have an estimate of your hypothesized distribution, I would recommend using the Anderson-Darling test instead of the KS-test.  The KS-test checks for the maximum distance between the empirical distribution function and the hypothesized function, and thus is not that sensitive to the tails which is what you care about.  The Anderson-Darling test integrates over the squared difference between empirical distribution and the hypothesized, and places different weights on each part of the distribution.  The weighting function effectively places greater weight in the tails.&lt;/p&gt;&#xA;" OwnerUserId="4981" LastActivityDate="2014-11-07T17:04:52.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15362" PostTypeId="2" ParentId="15355" CreationDate="2014-11-07T17:09:11.670" Score="0" Body="&lt;p&gt;I always thought doing $y(t,T) = \frac{-ln(P(t,T))}{T-t}$ was a quick good approximation, it applies when the bond price is calculated in continuous time&lt;/p&gt;&#xA;" OwnerUserId="13415" LastActivityDate="2014-11-07T17:09:11.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15363" PostTypeId="2" ParentId="15345" CreationDate="2014-11-07T17:13:40.777" Score="2" Body="&lt;p&gt;Another possible solution is the EACF of Tsay and Tiao (1984) where the idea is that if the order of the AR process is known the MA can be inferred. The output is a table where the first left corner 0 is taken to be the order of the ARMA(p, q) model.&lt;/p&gt;&#xA;" OwnerUserId="13415" LastActivityDate="2014-11-07T17:13:40.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15365" PostTypeId="1" CreationDate="2014-11-07T23:02:33.380" Score="2" ViewCount="503" Body="&lt;p&gt;Suppose we have 2 time series of market data, one for each security and we want to correlate between these 2 securities. My question is&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;How do we handle gaps of missing data in the time series? Imagine the time series is one day tick data of a stock price and we have a 10 mins gap of missing data sometime during the day.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How do we correlate the tick-by-tick market data of these 2 securities that do not happen at the same time for each tick? If we correlate them in the same time intervals, what price do we use?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="13500" LastActivityDate="2016-06-11T06:35:04.423" Title="Normalization of Market Data in Time Series Correlation" Tags="&lt;time-series&gt;&lt;correlation&gt;&lt;market-data&gt;&lt;pricing&gt;&lt;forecasting&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15367" PostTypeId="2" ParentId="14342" CreationDate="2014-11-08T00:50:05.097" Score="0" Body="&lt;p&gt;I think your approach based perhaps on &lt;a href=&quot;https://www.quantnet.com/threads/computing-market-price-of-risk-for-more-than-one-risky-asset.17675/&quot; rel=&quot;nofollow&quot;&gt;The Complex Unit's forum post&lt;/a&gt; is correct.  However, you may be making this more confusing for yourself with the notation and vocabulary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The phrase volatility matrix is not really correct though I can see how someone might get there because the market price of risk formula looks like and is related to the &lt;a href=&quot;http://en.wikipedia.org/wiki/Sharpe_ratio&quot; rel=&quot;nofollow&quot;&gt;Sharpe Ratio&lt;/a&gt; formula.  A &lt;a href=&quot;http://en.wikipedia.org/wiki/Cholesky_decomposition&quot; rel=&quot;nofollow&quot;&gt;Cholesky Decomposition&lt;/a&gt; is mainly a tool for solving inverse matrix problems.  In this case the inverse problem is what would the market price need to be to justify holding this return stream as mean-variance optimized portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does that help clarify?&lt;/p&gt;&#xA;" OwnerUserId="5689" LastActivityDate="2014-11-08T00:50:05.097" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15368" PostTypeId="2" ParentId="2205" CreationDate="2014-11-08T05:41:43.957" Score="1" Body="&lt;p&gt;I guess one can figure out the unsystematic risk by using the following formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ Unsystematic Risk = [R_A - E(R_A)] - [R_M - E(R_M)] * \beta    $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$R_A$ is the actual return on the asset&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E(R_A)$ is the expected return on the asset&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$R_M$ is the actual return on the market&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E(R_M)$ is the expected return on the market&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can think of the ACTUAL - EXPECTED as how far the actual returns deviate from the expected returns i.e. the residuals&lt;/p&gt;&#xA;" OwnerUserId="13428" LastActivityDate="2014-11-08T05:41:43.957" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15370" PostTypeId="1" CreationDate="2014-11-08T14:18:31.103" Score="3" ViewCount="218" Body="&lt;p&gt;Given  r=0,  σ(K)=const&#xA;Binary=lim┬(ε→0)⁡〖((C(K,σ(K))-C(K+ε,σ(K+ε))))/ε〗&#xA;What is the analytical expression for the binary option value?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;σ(K)=const Therefore,&#xA;Binary=lim┬(ε→0)⁡〖((C(K)-C(K+ε)))/ε〗&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the next step? &#xA;Thank you&lt;/p&gt;&#xA;" OwnerUserId="13504" LastActivityDate="2014-11-08T19:57:35.400" Title="Binary option expression" Tags="&lt;options&gt;&lt;spread&gt;&lt;replication&gt;&lt;binary&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15371" PostTypeId="1" CreationDate="2014-11-08T15:58:03.580" Score="3" ViewCount="1390" Body="&lt;p&gt;Can someone suggest a resource with a clean cut explanation of pair trading?&lt;/p&gt;&#xA;" OwnerUserId="13494" LastEditorUserId="467" LastEditDate="2015-01-12T00:57:22.080" LastActivityDate="2021-01-07T15:57:46.930" Title="What is a canonical book or article to learn pair trading?" Tags="&lt;reference-request&gt;&lt;pairs-trading&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15373" PostTypeId="1" CreationDate="2014-11-08T18:29:00.120" Score="0" ViewCount="554" Body="&lt;p&gt;let's say that we have complete data on the sample of companies about their capital (K), labor (L) and materials used in the production (M) and the total output of each company.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's have Cobb-Douglas specification: $$Y_{it} = A_{it}K_{it}^{a}L_{it}^{b}M_{it}^{c}$$.&#xA;In the text that I am reading, that we can calculate A (Total Factor Productivity) as the residual of the Cobb-Douglas production function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I have no idea of how do we construct Cobb-Douglas production function? Can anyone help me on this?&lt;/p&gt;&#xA;" OwnerUserId="13506" LastActivityDate="2014-11-09T18:21:14.470" Title="Cobb - Douglas Production Function" Tags="&lt;econometrics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15374" PostTypeId="2" ParentId="15370" CreationDate="2014-11-08T19:57:35.400" Score="1" Body="&lt;p&gt;if you let the implied vol depend on K you get two terms the first is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$N(d_2) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but you get a correction term which is the slope times the vega&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{\partial C}{\partial \sigma} \frac{\partial \sigma}{\partial K}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(see eg my book)&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2014-11-08T19:57:35.400" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15376" PostTypeId="2" ParentId="15371" CreationDate="2014-11-08T21:24:56.173" Score="-2" Body="&lt;p&gt;Becky,&#xA;I have traded stat arb for years, this is the best book I have read on pairs trading-&#xA;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470138440&quot; rel=&quot;nofollow&quot;&gt;Andrew Pole - Stat Arb&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13397" LastActivityDate="2014-11-08T21:24:56.173" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15378" PostTypeId="1" CreationDate="2014-11-08T22:34:22.200" Score="3" ViewCount="2789" Body="&lt;p&gt;I am trying to calculate the delta of an option at different strike prices where the underlying has a pronounced implied volatility skew in order to correctly hedge an options strategy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Researching on the net and previous questions on this site imply that BS can be used, but input of the correct IV is the hard part. Tags like &quot;the wrong number in the wrong formula to get the right price&quot;, &quot;sticky delta vs sticky strike&quot;, &quot;skew adjusted delta&quot; and Derman's work are the solutions I have found so far.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone tell me if these are the latest or best methods, or is a stochastic vol model like SABR or Heston better? Is calculating one value for the position delta too optimistic - should the position delta actually be a range with associated confidence limits?&lt;/p&gt;&#xA;" OwnerUserId="13397" LastActivityDate="2015-11-23T23:26:48.600" Title="Black Scholes - how to calculate delta with a vol skew" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;stochastic-volatility&gt;&lt;skew&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15379" PostTypeId="1" CreationDate="2014-11-09T00:19:38.513" Score="1" ViewCount="55" Body="&lt;p&gt;Does the US government have a policy of printing money? If so what is this number called, who decides what it is, and where can I find it? If not what is the cause of our &lt;em&gt;long term&lt;/em&gt; inflation? (I'm aware of the impact that the Fed's open market operations have on short term inflation)&lt;/p&gt;&#xA;" OwnerUserId="12257" LastActivityDate="2014-11-09T06:05:34.940" Title="Cause of long term inflation in the United States" Tags="&lt;inflation&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2014-11-15T17:40:56.183" ContentLicense="CC BY-SA 3.0" />
  <row Id="15380" PostTypeId="1" CreationDate="2014-11-09T03:00:24.910" Score="4" ViewCount="314" Body="&lt;p&gt;I know that annualized historical volatility calculated with closing prices is a much rougher estimate than implied volatility for the correct &quot;volatility&quot; parameter in options pricing models.  However, implied volatility requires knowing the market price of the option in question, which is not feasible for my application.  Is there a widely used better estimate for the volatility parameter than annualized historical volatility?  Thanks.&lt;/p&gt;&#xA;" OwnerUserId="13511" LastActivityDate="2014-11-09T14:34:27.317" Title="Is there a better way to price options than with historical volatility?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;implied-volatility&gt;&lt;historical-data&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15381" PostTypeId="1" CreationDate="2014-11-09T03:27:09.067" Score="0" ViewCount="74" Body="&lt;p&gt;Is this true and how would you prove it&lt;/p&gt;&#xA;" OwnerUserId="13504" LastEditorUserId="13504" LastEditDate="2014-11-09T15:01:12.680" LastActivityDate="2014-11-09T21:04:13.220" Title="Is the price of a binary call not monotonous with vol for OTM" Tags="&lt;options&gt;&lt;volatility&gt;&lt;binary&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15382" PostTypeId="2" ParentId="15379" CreationDate="2014-11-09T06:05:34.940" Score="1" Body="&lt;p&gt;I do not know if there is a policy but I think one can view how much money is in circulation (I.e. Money being printed) by the Monetary Base. It can be found and downloaded using FRED. As for long term inflation one can use the CPI which is based from a basket of goods. I believe the #1 rising good in the CPI is housing/rent prices. &lt;/p&gt;&#xA;" OwnerUserId="13428" LastActivityDate="2014-11-09T06:05:34.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15385" PostTypeId="2" ParentId="15373" CreationDate="2014-11-09T07:52:47.493" Score="2" Body="&lt;p&gt;I am not sure to understand your question. But as far as I understand it.&#xA;If you have a dataset with $Y,K,L,M$ over a set of corporates over some years, you can estimate $A$ using a log-log regression, since the following model is compatible with your Coob-Douglas specification:&#xA;$$\log Y=a \log K + b \log L + c \log M + \log A.$$&#xA;It is clearly the specification of a linear regression where $\log A$ is the residual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be more accurate, using script letters for the log of capital ones:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$d\mu(y,k,l,m)$ is the joint repartition of the log of the activity of the firms in your database;&lt;/li&gt;&#xA;&lt;li&gt;minimize $\int_{(y,k,l,m)}|| a k + b l + c m - y|| d\mu(y,k,l,m)$ over $(a,b,c)$;&lt;/li&gt;&#xA;&lt;li&gt;observe the residuals of the upper regression $\epsilon$, compute its std $\sigma$,&lt;/li&gt;&#xA;&lt;li&gt;if you go back to exponentials, you obtain:&#xA;$$Y=K^a L^b M^c \mathbb{E}\exp(\epsilon).$$&lt;/li&gt;&#xA;&lt;li&gt;note $\mathbb{E}\exp(\epsilon)=\sigma^2/2$; it is your estimate for $A$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2014-11-09T18:21:14.470" LastActivityDate="2014-11-09T18:21:14.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15387" PostTypeId="2" ParentId="15380" CreationDate="2014-11-09T11:35:54.527" Score="3" Body="&lt;p&gt;If you want to estimate volatility from historical data, the only best linear unbiased estimator (BLUE) is&#xA;$$\sigma=\sqrt{\frac{1}{T-1}\sum_{i=1}^T (r_i-E(r_i))^2}$$&#xA;Any other estimator will hence either be biased or not consistent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another approach could be to estimate volatility via a GARCH model, which has shown good empirical results in the past.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is also possible to transform the sample data before estimation, i.e. filter for outliers and such.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-11-09T11:35:54.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15388" PostTypeId="1" CreationDate="2014-11-09T13:53:45.613" Score="3" ViewCount="363" Body="&lt;p&gt;I'm playing around with copulas and wanted to generate some sample based on copula techniques in R. For this purpose I applied the following algorithm:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Generate three sample vectors coming from different distributions&#xA;(normal, t, uniform), i.e. $X=(X_1,\dots,X_{100})$,$Y=(Y_1,\dots,Y_{100})$,$Z=(Z_1,\dots,Z_{100})$&lt;/li&gt;&#xA;&lt;li&gt;Apply empirical distribution function to each of the three assets. I&#xA;take the empirical distribution function, since in reality&#xA;    you may not know the actual marginal distribution. In math terms we estimate $F_X,F_Y,F_Z$ based on $X,Y,Z$ and apply it: $$U_1=F_X(X),U_2=F_Y(Y),U_3=F_Z(Z)$$&lt;/li&gt;&#xA;&lt;li&gt;Fit a t-copula to the resulting pseudo-unfiromly distributed samples, i.e. we fit a copula $c$ to $c(U_1,U_2,U_3)$&lt;/li&gt;&#xA;&lt;li&gt;generate $100$ sample matrices $A_i$, each of size $200$ per marginal sample, i.e. we generate $100$ matrices $A_i=[S_1^i,S_2^i,S_3^i]$ with $200$ rows and $3$ column vector $S_1^i,S^i_2,S^i_3$ containing generated samples coming from $c$.&lt;/li&gt;&#xA;&lt;li&gt;retransform back to obtain actual marginal distribution sample&#xA;coming from a t-copula model, i.e. for each of the $A_i$ we look at $$B_i=[F_X^{-1}(S^i_1),F_Y^{-1}(S^i_2),F_Z^{-1}(S^i_3)] $$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;here is a sample R code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a &amp;lt;- rnorm(1000,1,0.3)&#xA;b &amp;lt;- rt(1000,4)&#xA;c &amp;lt;- runif(1000)&#xA;&#xA;data &amp;lt;- cbind(a,b,c)&#xA;&#xA;#calculate emprical distribution&#xA;&#xA;for (i in 1:ncol(data)){&#xA;  emp &amp;lt;- apply(data,2,ecdf)&#xA;}&#xA;&#xA;hist(emp[[1]](data[,1]))&#xA;hist(emp[[2]](data[,2]))&#xA;hist(emp[[3]](data[,3]))&#xA;&#xA;data.unif &amp;lt;- cbind(emp[[1]](data[,1]),emp[[2]](data[,2]),emp[[3]](data[,3]))&#xA;&#xA;#fit copula&#xA;&#xA;fitCopulat &amp;lt;- fit.tcopula(Udata = data.unif,method = &quot;Kendall&quot;)&#xA;&#xA;l1 &amp;lt;- list()&#xA;&#xA;for(i in 1:100){&#xA;  l1[[i]] &amp;lt;- rcopula.t(200,df = fitCopulat$nu,Sigma = fitCopulat$P)&#xA;}&#xA;&#xA;#transform back to get right marginal distributions&#xA;&#xA;l2 &amp;lt;- l1&#xA;for(i in 1:100){&#xA;  for(j in 1:ncol(data)){&#xA;    l2[[i]][,j] &amp;lt;- quantile(data[,j],probs = l1[[i]][,j])&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have the following two questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Does the algorithm make sense?&lt;/li&gt;&#xA;&lt;li&gt;Is step 5. correctly implemented? I'm unsure if I used the function quantile correctly.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="17133" LastActivityDate="2014-11-09T13:53:45.613" Title="how to apply a simple copula model" Tags="&lt;r&gt;&lt;copula&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15389" PostTypeId="2" ParentId="15380" CreationDate="2014-11-09T14:34:27.317" Score="3" Body="&lt;p&gt;All option pricing formulas except &lt;a href=&quot;https://en.wikipedia.org/wiki/User:Optionpricing&quot; rel=&quot;nofollow&quot;&gt;this one&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/User:Stockequation/sandbox&quot; rel=&quot;nofollow&quot;&gt;this one&lt;/a&gt; use some sort of historical volatility . I can't see how you can use the Black Sholes framework and not use some sort of historical volatility&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;uses an order book&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;uses  geometric shapes and volume&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="13515" LastActivityDate="2014-11-09T14:34:27.317" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15390" PostTypeId="1" CreationDate="2014-11-09T16:29:02.653" Score="9" ViewCount="1034" Body="&lt;p&gt;Aaron Brown (in the book, &lt;em&gt;The Poker Face of Wall Street&lt;/em&gt;, p. 196), discusses four approaches to deriving the same Black-Scholes-Merton option-pricing formula:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Ed Thorp, Myron Scholes, Robert Merton, and Fischer Black all had almost the same formula [for option-pricing], but each had a different reason for believing it was true. Ed showed that it was a way to make money, Scholes that it was required for &lt;strong&gt;market efficiency&lt;/strong&gt;, Merton that it had to be true or there would be &lt;strong&gt;arbitrage&lt;/strong&gt;, and Black that it was required for &lt;strong&gt;market equilibrium&lt;/strong&gt;. Black's insight turned out to be the most important...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What is the difference between &quot;market efficiency&quot;, &quot;no arbitrage&quot;, and &quot;market equilibrium&quot;, and why would equilibrium be considered the most important insight?&lt;/p&gt;&#xA;" OwnerUserId="13516" LastActivityDate="2014-11-11T10:47:00.600" Title="What is the difference between market efficiency, market equilibrium, and no-arbitrage?" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;arbitrage&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15392" PostTypeId="1" CreationDate="2014-11-09T17:14:05.627" Score="1" ViewCount="107" Body="&lt;p&gt;I need to calculate a price of an autocap contract which is &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;An autocap is similar to a cap, but at most γ ≤ β caplets can be&#xA;  exercised, and they have to be automatically exercised when in the&#xA;  money&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Payoff is &lt;img src=&quot;https://i.stack.imgur.com/aoTTY.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This product heavily depends on correlation between libor rates. Therefore to incorporate this information into model, I decided to use cascade calibration approach described in Brigo and Mercurio book &quot;Interest rate modeling&quot; - I want to calibrate LMM to swaptions. The problem is that as I understand, only volatility of 1Y swappoints can be derived from Bloomberg. So I'm able to calibrate only 1Y forward rates dynamics. Then I'd like to use some interpolation approach to get from 1Y forward rates to 3m forward rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it a good idea?&lt;/p&gt;&#xA;" OwnerUserId="7486" LastActivityDate="2014-11-09T17:14:05.627" Title="Price 3m libor autocap with LMM calibrated on 1y swaption data" Tags="&lt;monte-carlo&gt;&lt;swaption&gt;&lt;lmm&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15393" PostTypeId="2" ParentId="15381" CreationDate="2014-11-09T21:04:13.220" Score="2" Body="&lt;p&gt;The OTM binary is not increasing with volatility. Simply plot the price as a function of implied volatility. eg take&lt;/p&gt;&#xA;&#xA;&lt;p&gt;S = 0.99&#xA;K = 1 &#xA;r=0&#xA;T =1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and $\sigma$ vary upwards in steps of 0.01 starting at 0. It peaks around 0.04. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Differentiating $d_2$ with respect to $\sigma$ makes this behaviour obvious. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2014-11-09T21:04:13.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15395" PostTypeId="1" CreationDate="2014-11-10T04:36:33.337" Score="-1" ViewCount="239" Body="&lt;p&gt;Given market(Mid):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1-  USD Swap market (fixed for float). Float leg pays 3MLibor quarterly, act360. Fixed Leg pays annually, act360. Market is trading mid at 1.125%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2-   TIIE market. Fixed for float Swap. Float leg pays TIIE4W every 4weeks, act360. Fixed leg pays annually, act360. Market is trading mid at 4.25&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3-  3MLibor vs 12MLibor USD basis swap. 3ML quarterly, act360 is exchanged for 12MLibor+S, annual, act360. The market for the spread is at mid -0.625%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4-  XC Basis swap. 4WTIIE, paid every 4weeks vs 12MLibor+S. The spread S market is 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5-  Spot FX, MXNUSD trading at 0.0505, Settlement T+0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q :You sell USDMXN 1Y fwd at mid:  lay out the transactions needed to hedge the 1Y USDMXN fwd showing direction, tenor&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming you can borrow/lend at 3MLibor &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to approach this problem?&lt;/p&gt;&#xA;" OwnerUserId="13504" LastActivityDate="2014-11-10T13:50:02.420" Title="Replicate by Arbitrage price of a forward" Tags="&lt;fx&gt;&lt;arbitrage&gt;&lt;forward&gt;&lt;hedge&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15396" PostTypeId="2" ParentId="15390" CreationDate="2014-11-10T06:51:51.490" Score="6" Body="&lt;p&gt;In three bullet points:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Efficiency&lt;/strong&gt;: the obtained prices maximize assumed utilities of different agents. In their paper &quot;&lt;em&gt;&lt;a href=&quot;http://www.citeulike.org/user/lehalle/article/10772897&quot; rel=&quot;nofollow&quot;&gt;The Valuation of Option Contracts and a Test of Market Efficiency&lt;/a&gt;&lt;/em&gt;&quot;, Cohen, Black and Scholes compare the theoretical value of options to their market price. The efficiency is in this sense: can agents obtain more or less in practice than in theory using options?&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;No arbitrage&lt;/strong&gt;: it is possible to synthesize different prices combining (linearly, in the case of Merton) existing instruments. In his paper &quot;&lt;em&gt;&lt;a href=&quot;http://www.citeulike.org/user/lehalle/article/13425744&quot; rel=&quot;nofollow&quot;&gt;On the pricing of contingent claims and the Modigliani-Miller theorem&lt;/a&gt;&lt;/em&gt;&quot;, Merton nevertheless seems to contradict Aaron Brown since he writes &quot;&lt;em&gt;Although the formula can be derived using the arbitrage technique of Black and Scholes, the alternative approach of continuous-time portfolio strategies is used instead.&lt;/em&gt;&quot; He writes later in the paper &quot;&lt;em&gt;Market prices need not be general equilibrium prices.&lt;/em&gt;&quot; Hence he does not use equilibrium argument for sure. But during the proof, he writes &quot;&lt;em&gt;[...] then to rule out arbitrage,[...]&lt;/em&gt;. He definitely need and uses a no arbitrage argument.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Equilibrium&lt;/strong&gt;: close to efficiency but every agent in the market has a utility function, and the obtained prices simultaneously solves all of them (it is typically a &lt;strong&gt;Nash equilibrium&lt;/strong&gt;). I did not found a paper by Black dealing simultaneously with derivatives and market equilibrium. Nevertheless Black published papers on equilibria, like &quot;&lt;em&gt;&lt;a href=&quot;http://www.citeulike.org/user/lehalle/article/13425760&quot; rel=&quot;nofollow&quot;&gt;International capital market equilibrium with investment barriers&lt;/a&gt;&lt;/em&gt;&quot;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;To compare the three concepts:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;an agent does not need to have a utility function to implement arbitrage, it is a very local and objective behaviour: observe prices, buy low and sell high...&lt;/li&gt;&#xA;&lt;li&gt;efficiency is to be optimal for one agent. That for he needs to objective and quantify his utility and maximize it. It means the considered agent is rational an advanced way.&lt;/li&gt;&#xA;&lt;li&gt;last but not least: market equilibrium. It is a global property: everyone is optimal simultaneously, and knows others are optimal (and know how they manage to be). &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2014-11-11T10:47:00.600" LastActivityDate="2014-11-11T10:47:00.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15397" PostTypeId="2" ParentId="15365" CreationDate="2014-11-10T10:34:07.157" Score="2" Body="&lt;p&gt;Looking for the same issue, I found an article by &lt;a href=&quot;http://www.math.ku.dk/~kdh/thesis/docs/highfrequencyanalysisofleadlagrelationshipsbetweenfinancialmarkets.pdf&quot; rel=&quot;nofollow&quot;&gt;de Jong(1997)&lt;/a&gt;. In section 2 you can find a method for estimation of covariances and correlations between irregularly spaced data. Also look at the article by &lt;a href=&quot;https://ideas.repec.org/p/hhs/nhhfms/2007_019.html&quot; rel=&quot;nofollow&quot;&gt;Jonas Andersson&lt;/a&gt; where some interpolation methods and method form de Jong are presented and compared together. Hope it helps.&lt;/p&gt;&#xA;" OwnerUserId="13269" LastActivityDate="2014-11-10T10:34:07.157" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15398" PostTypeId="2" ParentId="14592" CreationDate="2014-11-10T11:33:14.873" Score="0" Body="&lt;p&gt;Well that is a very good question. Once I realised of the issue with EMD I investigated all wavelets transforms I could access to in Matlab, all seemed to suffer either some end point distorsion or what is called Time phase distorsion for all one-step-ahead forecast where a lag of one sample appear in the forecast at some segments of the test data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did try an implementation of the Haar A Trou that appeared in dozen of papers, but even with that one I could not get decent one-step ahead prediction. It could be that my learning scheme had some limitation, but I still suspect the multiscale decomposition was the issue, not the machine learning algo (I use Relevance Vector Machine with cross-validation and non-linear kernels).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am yet to try SSA which I think could work, there is an R implementation with a forecasting scheme implemented. &#xA;I also recently discovered &quot;sparse coding&quot; which I think could be used for time series event though I have not seen implementations.&#xA;Hope this help and happy to collaborate on algo, just send me message.&lt;/p&gt;&#xA;" OwnerUserId="12062" LastActivityDate="2014-11-10T11:33:14.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15399" PostTypeId="2" ParentId="15395" CreationDate="2014-11-10T13:50:02.420" Score="0" Body="&lt;p&gt;You can make the use of 1 and 2 to calculate forward price&lt;/p&gt;&#xA;" OwnerUserId="13524" LastActivityDate="2014-11-10T13:50:02.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15400" PostTypeId="1" CreationDate="2014-11-10T14:00:41.107" Score="0" ViewCount="710" Body="&lt;p&gt;What is meant by the statement below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Stripping projection curve (e.g. 3M curve) given the OIS curve&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that while bootstrapping an OIS curve using OIS swap rates and OIS fixed rates, we can derive implied forward rate of all periods.&lt;/p&gt;&#xA;" OwnerUserId="13525" LastActivityDate="2014-12-11T17:12:12.373" Title="Stripping projection curve" Tags="&lt;bootstrapping&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15402" PostTypeId="1" CreationDate="2014-11-10T16:36:40.543" Score="2" ViewCount="462" Body="&lt;p&gt;Strict stationarity is the strongest form of stationarity. It means that the joint statistical distribution of any collection of the time series variates never depends on time. So, the mean, variance and any moment of any variate is the same whichever variate you choose. However, for day to day use strict stationarity is too strict. Hence, the following weaker definition is often used instead. Stationarity of order 2 which includes a constant mean, a constant variance and an autocovariance that does not depend on time. (second-order stationary or stationary of order 2). A weaker form of stationarity that is first-order stationary which means that the mean is a constant function of time, time-varying means to obtain one which is first-order stationary.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the following time series which I would like to make stationary of order 2. I do not use ARIMA but use multiple methods of regression but linear and non linear in parametric and non parametric. I have read that using traditional stationarity tests such us PP.test (Phillips-Perron Unit Root Test), kpss test or Augmented Dickey-Fuller Test are not adequate if you are to perform regression via other methods than ARIMA (due that in arima the orders are fixed and that no other factors that produce non stationarity are included) and that  stationarity tests in the frequency domain instead are more adequate. (Correct me if this is wrong) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For this purpose I use two tests in the frequency domain as to compare results: The Priestley-Subba Rao (PSR) test for nonstationarity (fractal package). Based upon examining how homogeneous a set of spectral density function (SDF) estimates are across time, across frequency, or both. On another hand a unit root test where the wavelet looks at a quantity called βj(t) which is closely related to a wavelet-based time-varying spectrum of the time series (it is a linear transform of the evolutionary wavelet spectrum of the locally stationary wavelet processes of Nason, von Sachs and Kroisandt, 2000). So we see if βj(t) function varies over time or is constant by looking at Haar wavelet coefficients of the estimate so is stationary if all haar coefficients are zero (locits package). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the following questions.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;If I attempt to make a series stationary by taking log price diferences, then remove MA by loess regression and remove AR parts with an AR model and at each step measure if the series has become stationary with the wavelet test and stop when it has. Is this procedure correct? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In this specific example the Priestley-Subba Rao (PSR) Test does not show stationarity. (In fact I would need to diferenciate the series over times 26 times as per this test to obtain stationary). I am wondering if this high order is correct or is due to the Priestley-Subba Rao (PSR) Gausian distribution assumption or that other long range dependences, fractional integration or definite noise yield this result. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How valid would a regression be in regards to potential spurious regression if we would perform point 1 and obtain stationarity at unit root 2. I have read that if higher order unit root or other non stationary producing factors such us long range dependence, fractional integration, pink noise are ignored, the system dynamics become systematic errors in regression equations and thus regression will have no meaning (e.g. changes in variance invalidating second-order stationarity)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The locits package works only with R 3.03 version&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x&amp;lt;-c(-0.0870,0.0028,0.1866,0.0481,-0.3433,0.4039,0.0309,0.0789,0.4941,-0.0610,0.0951,-0.0109,-0.0001,0.0789, -0.0737, -0.0061, -0.0979,  0.3175, 0.4067,  0.0541, -0.1053, -0.0521,  0.0749, -0.0792,  0.0354,  0.1119, -0.0666,  0.2364,  0.1321,  0.0964,  0.1444,  0.5995, -0.2096 -0.1268,  0.1104, -0.1110, -0.0618, -0.0561,  0.0893,  0.9499,  0.3015,  0.1437,  0.3108, -0.0902, -0.1477,  0.0507, -0.0204,  0.2277,  0.1205,  0.0038, -0.0328, -0.0273,  0.1126,  0.0530, 0.0461,  0.1380,  0.0368, -0.0082,  0.0086,  0.0318,  0.0106,  0.0647, 0.0157,  0.0225, -0.0934,  0.0527,  0.0725,  0.0285,  0.0042,  0.1048,  0.0117,  0.1097, -0.0013,  0.0032, -0.0589, -0.0226, -0.0728, -0.0139,  0.0335,  0.1481,  0.0340, -0.0522,  0.0309, -0.0775, -0.0341, -0.0009,  0.1237, -0.1738,  0.0141,  0.0857, 0.1048, -0.0120, 0.0745,  0.1385,  0.0722,  0.0314, -0.0292, -0.0712,  0.0045,  0.0351, -0.0230,  0.0707, -0.0283, -0.0227, -0.0152, -0.0057,  0.0058, -0.0259, 0.0329, -0.0607,  0.0037,  0.0132, -0.0058,  0.0407, -0.0485, -0.0048,  0.0166,  0.0046, -0.0041,  0.0301,  0.0060,  0.0220, -0.0239,  0.0022,  0.0399,  0.0550, 0.1607, -0.0451,  0.0050,  0.0128,  0.0510, -0.0361,  0.0502,  0.0304 -0.0405, -0.0264,  0.0188, -0.0244,  0.0327, -0.0271,  0.0202, -0.0128,  0.0099,  0.0238, 0.0016,  0.0103,  0.1093,  0.0507,  0.0026, 0.0084, -0.0005, -0.0088, -0.0371,  0.0233, -0.0171, -0.0041, -0.0058, -0.0219,  0.0126,  0.0188, -0.0403,  0.0054, 0.0034,  0.0022, -0.0050, -0.0277, -0.0567,  0.0233,  0.0081,  0.0322,  0.0013,  0.0908,  0.0187)&#xA;&#xA;# I log transform prices and take differences (so I obtain ratios having stabilized the variance a little) &#xA;&#xA;z2c &amp;lt;- cumprod(1+x)&#xA;z1log &amp;lt;- log(z2c)&#xA;z2log&amp;lt;-diff(z1log)&#xA;&#xA;# As the Wavelet stationarity test requires power of two series I create segments of data of the required length&#xA;&#xA;ñ1&amp;lt;-z2log[((length(z2log) -128)+1):length(z2log)]&#xA;ñ2&amp;lt;- z2log[((length(z2log) -256)+1):length(z2log)]&#xA;o&amp;lt;-if(z2log &amp;gt;128 || z2log &amp;gt;256) ñ2 else ñ1&#xA;&#xA;# Perform the two mentioned tests &#xA;&#xA;# Priestley-Subba Rao (PSR) Test &#xA;library(fractal)&#xA;SR &amp;lt;- attributes(stationarity(o, n.taper=5,n.block=max(c(2,floor(logb(length(o),base=2)))),significance=0.05,center=TRUE,recenter=FALSE))$stationarity[[1]]&#xA;&#xA;#Wavelet Spectrum Test&#xA; library(locits)&#xA;WS &amp;lt;- hwtos2(o)&#xA;&#xA;SR&#xA;WS&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Many thanks&lt;/p&gt;&#xA;" OwnerUserId="7616" LastEditorUserId="7616" LastEditDate="2014-11-10T19:49:38.330" LastActivityDate="2014-11-10T19:49:38.330" Title="Stationarity tests in the frequency domain for regression" Tags="&lt;r&gt;&lt;regression&gt;&lt;forecasting&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15403" PostTypeId="1" AcceptedAnswerId="15407" CreationDate="2014-11-10T20:22:51.027" Score="3" ViewCount="691" Body="&lt;p&gt;I am trying to formulate this simple MVO utility function with a linear  transaction cost penalty added using Quadprog in MATLAB&lt;/p&gt;&#xA;&#xA;&lt;p&gt;tcost = 0.001;&#xA;lambda = 4;&#xA;mu = vector of expected returns (say 4x1)&#xA;S = covariance matrix (4x4)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;max w'*mu - lambda *w'&lt;em&gt;S&lt;/em&gt;w - lambda_TC * tcost *sum(abs(w(i) - w0(i))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand in order to be linear we can replace w(i) - w0(i) with a variable y(i)&#xA;replacing the above equation to be&lt;/p&gt;&#xA;&#xA;&lt;p&gt;max w'*mu - lambda *w'&lt;em&gt;S&lt;/em&gt;w - lambda_TC * tcost *sum(y(i))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and we add the constraints y(i)&gt;= w(i) - w0(i) and y(i)&gt;= - (w(i) - w0(i))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I additionally have a long only constraint and the sum of the weights should sum to 1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am unsure how to formulate this in quadprog in MATLAB. Any help will be appreciate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks very much!&lt;/p&gt;&#xA;" OwnerUserId="13527" LastEditorUserId="5689" LastEditDate="2014-11-12T11:37:07.690" LastActivityDate="2014-11-12T11:37:07.690" Title="formulating MVO with costs" Tags="&lt;optimization&gt;&lt;matlab&gt;&lt;mean-variance&gt;&lt;transaction-costs&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15404" PostTypeId="2" ParentId="15060" CreationDate="2014-11-10T21:27:11.050" Score="3" Body="&lt;p&gt;Since there is a closed form in the BS case for continuous barrier options, you probably won't find a huge amount of work on this since it's not needed. In the discrete case, I did a paper with Tang:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://ssrn.com/abstract=1441142&quot; rel=&quot;nofollow&quot;&gt;http://ssrn.com/abstract=1441142&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pricing and Deltas of Discretely-Monitored Barrier Options Using Stratified Sampling on the Hitting-Times to the Barrier&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2014-11-10T21:27:11.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15405" PostTypeId="2" ParentId="9825" CreationDate="2014-11-10T22:01:05.793" Score="1" Body="&lt;p&gt;You can use the log-normal model directly: Affine Approximation for Moment Generating Function of Log-Normal Stochastic Volatility Model ( &lt;a href=&quot;http://ssrn.com/abstract=2522425&quot; rel=&quot;nofollow&quot;&gt;http://ssrn.com/abstract=2522425&lt;/a&gt; )&lt;/p&gt;&#xA;" OwnerUserId="11884" LastActivityDate="2014-11-10T22:01:05.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15406" PostTypeId="2" ParentId="5981" CreationDate="2014-11-10T22:09:28.087" Score="5" Body="&lt;p&gt;In terms of model delta, local and stochastic volatility models calibrated to the same vanilla surface produce the same (minimum-variance) delta. What makes the difference as how to compute model delta cosnsitent with empirical dynamics - see here&#xA;Log-Normal Stochastic Volatility Model: Empirical Calibration and Model Delta ( &lt;a href=&quot;http://ssrn.com/abstract=2387845&quot; rel=&quot;noreferrer&quot;&gt;http://ssrn.com/abstract=2387845&lt;/a&gt; )&lt;/p&gt;&#xA;" OwnerUserId="11884" LastActivityDate="2014-11-10T22:09:28.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15407" PostTypeId="2" ParentId="15403" CreationDate="2014-11-11T01:01:18.057" Score="2" Body="&lt;p&gt;I'm not that familiar with MATLAB.  However, in quadratic programming the main issue I've found is setting up the problem correctly and then the coding becomes much easier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you noted this problem can be expressed as a &lt;a href=&quot;http://www.mathworks.com/help/optim/ug/quadprog.html&quot; rel=&quot;nofollow&quot;&gt;quadratic cone problem&lt;/a&gt; and solved by quadprog but a good amount of more work needs to be done to get this in the correct form.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;You should convince yourself that under the change of variables y = w - w0 you suggested that the problem actually becomes the below with sum(y) = 0 (assuming sum(x0) = 1) and we no longer have to worry about w.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;max y'*mu - lambda * y'Sy - lambda_tc * tcost * sum(abs(y)) + constant&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You can calculate that constant if you want but because we are maximizing it doesn't matter.  The problem is this problem is still not in a quadradic programming form because it still has a absolute value function.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;&lt;p&gt;The next step is to get rid of the abs().  The trick here is to double the number of optimization variables as you allude to in the question.  We call y = (y_plus - y_minus)/2 where now we have two new constraints y_plus &gt;= w - w0 and y_minus &gt;= -(w - w0).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;This appears to make the problem more complicated, but note if we define z to be the vector of (y_plus, y_minus) for 8 variables we can rewrite the problem again as the below with sum(z) = 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;max z'*mu - lambda * z'Sz - lambda_tc * tcost * sum(z)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;where mu and S have extended to double their original size.  mu is just repeated twice with a sign flip (now has 2*4 members) and H now has two block diagonal S matrices and block zeros on the off diagonals (8 by 8 matrix in total).  However, now we have removed the absolute value from the problem!&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;4&quot;&gt;&#xA;&lt;li&gt;&lt;p&gt;To put this in standard form we just need to combine the linear terms in z.  So the equations for 'f' in quadprod would look like (Please double check my signs here)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(mu_i - lambda_tc * tcost) * yplus_i &lt;em&gt;and&lt;/em&gt; (mu_i + lambda_tc * tcost) * yminus_i&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Now this problem can be put in the quadprog with the above 'f' and extended (doubled-size) 'S' as 'H'.  Aeq,beq can constrain sum(z) = 0 and A,b constrain each yplus_i&gt;0 and yminus_i&amp;lt;0 as y_plus are changes to w that are positive and y_minus are changes that are negative.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5689" LastEditorUserId="5689" LastEditDate="2014-11-12T08:02:52.670" LastActivityDate="2014-11-12T08:02:52.670" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="15409" PostTypeId="1" CreationDate="2014-11-11T08:04:27.723" Score="3" ViewCount="716" Body="&lt;p&gt;I'm trying to estimate parameters of GARCH(p,q) model. I tried p=1, q=1 with t-distribution errors. Ljung-Box showed no correlation in residuals and squared residual. But the null hypothesis that ARCH-term's coefficient equals 0 was not rejected. So I tried p=0, q=1. Ljung-Box indicated serial correlation in residuals and squared residuals. Moreover, AIC and SC chose the former  model. Should I choose GARCH(1,1), though one coefficient is statistically insignificant ?&lt;/p&gt;&#xA;" OwnerUserId="13305" LastActivityDate="2016-05-26T02:56:24.430" Title="GARCH parameters" Tags="&lt;garch&gt;" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15410" PostTypeId="2" ParentId="15125" CreationDate="2014-11-11T10:05:08.070" Score="0" Body="&lt;p&gt;Its a payoff for asset or nothing call, this option is an OTC derivative (more specifically an exotic option) thus relatively illiquid compared to plain vanilla option. Its payoff, with exercise price ($K$), is $S_t$ if $S{t}&amp;gt;K$ and 0 otherwise and $1_{S_t&amp;gt;K}$ is an indicator function which takes value 1 if $S_t&amp;gt;K$ and 0 otherwise. And that's why it is known as binary option.&lt;/p&gt;&#xA;" OwnerUserId="11831" LastActivityDate="2014-11-11T10:05:08.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15411" PostTypeId="1" AcceptedAnswerId="15428" CreationDate="2014-11-11T13:13:01.073" Score="2" ViewCount="675" Body="&lt;p&gt;I am testing a &lt;strong&gt;local volatility pricer&lt;/strong&gt; by comparing its results under two settings: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Pricing a 5yr ATM call option with a flat volatility of $0.194$&lt;/li&gt;&#xA;&lt;li&gt;Pricing the call option with the typically shaped equity vol surface: in particular, the &lt;strong&gt;minimum implied vol&lt;/strong&gt; figure is $0.195$ (longest  maturity / ATM strike) and the &lt;strong&gt;maximum implied vol&lt;/strong&gt; is $0.245$ (shortest maturity / lowest strike) &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;By intuition, using a implied vol surface where all the individual volatility points are above $0.194$ should deliver a higher call price than using a flat volatility. However, the local vol pricer that I am testing (black-box) delivers lower option values when the input is the [$0.194$ to $0.245$] vol surface than when I use a single $0.194$ flat figure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is that enough evidence to conclude that the local vol implementation is flawed? Or should I distrust my intuition?&lt;/p&gt;&#xA;" OwnerUserId="5208" LastEditorUserId="5208" LastEditDate="2015-09-15T14:02:30.540" LastActivityDate="2015-09-15T14:02:30.540" Title="Local volatility pricer" Tags="&lt;option-pricing&gt;&lt;local-volatility&gt;&lt;testing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15414" PostTypeId="2" ParentId="15400" CreationDate="2014-11-11T16:04:32.333" Score="1" Body="&lt;p&gt;I think that's it, you just strip your OIS rates while boostrapping.&#xA;Most OIS Swap Rates are Bullet contract par swap rates, so you might want to obtaint the Zero Curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you were quoting Zero Swaps, you wouldn't need to.&lt;/p&gt;&#xA;" OwnerUserId="13533" LastEditorUserId="13533" LastEditDate="2014-11-11T16:52:25.867" LastActivityDate="2014-11-11T16:52:25.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15415" PostTypeId="1" CreationDate="2014-11-11T18:56:32.297" Score="1" ViewCount="177" Body="&lt;p&gt;Given  3MLibor vs 12MLibor USD basis swap the 3M Libor is exchanged at 12MLibor+1%.&#xA;How to calculate the cash flow&lt;/p&gt;&#xA;" OwnerUserId="13524" LastActivityDate="2015-09-08T00:28:27.180" Title="How to calculate cash flow for XC swap" Tags="&lt;swaps&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15416" PostTypeId="2" ParentId="15415" CreationDate="2014-11-11T19:07:26.917" Score="0" Body="&lt;p&gt;I assume, you have the same notional for both legs, so in both cases is just the (Index + Spread) * Notional. Note that in this case, you only have a spread in the 12M leg.&#xA;Until some notional payments are made, it's just interests cashflows.&lt;/p&gt;&#xA;" OwnerUserId="13533" LastActivityDate="2014-11-11T19:07:26.917" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15417" PostTypeId="1" AcceptedAnswerId="16167" CreationDate="2014-11-11T19:50:58.663" Score="0" ViewCount="331" Body="&lt;p&gt;I am doing a Quantitative Finance PhD and would like some insight on data collection. I'm looking for open market share repurchase data (UK) over the past 2-3 decades. Simultaneously, their bid-ask spread around the repurchase date. I understand that I can calculate liquidity using trading volume method(s) but would initially prefer bid-ask spreads. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I got in touch with a few data vendors and went low on luck. We don't have a bloomberg terminal at the university, and since they don't offer individual subscriptions, they've offered to sell data on an one-off sale. I would like to explore more options before paying for the data. Any suggestions would be helpful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alpha 13&lt;/p&gt;&#xA;" OwnerUserId="13534" LastActivityDate="2015-02-08T19:29:55.770" Title="Share Repurchase and Bid ask Spread data" Tags="&lt;equities&gt;&lt;historical-data&gt;&lt;liquidity&gt;" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15420" PostTypeId="2" ParentId="14987" CreationDate="2014-11-12T03:45:30.857" Score="2" Body="&lt;p&gt;There are two approaches. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Price call and put options with various strikes. Plot their BS implied volatilities. &#xA;Find the slope of the graph.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Price a call and digital call with the requisite strike. Compute the implied volatility of the call. Use the fact that&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;$ DC(model) = DC(BS) - skew \times callvega,$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to solve for the skew. (See eg Section 7.7 of my book &quot;concepts and practice of mathematical finance&quot;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This would give today's skew. To get the forward skew, you would need to do this conditional on future value of spot which basically means running MC and getting the implied future prices as a function of spot via bucketing. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastEditorUserId="1809" LastEditDate="2014-11-12T21:18:36.613" LastActivityDate="2014-11-12T21:18:36.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15423" PostTypeId="2" ParentId="15371" CreationDate="2014-11-12T13:28:43.450" Score="1" Body="&lt;p&gt;Becky, in order to get a good 'all around' grip of the concepts that you might encounter in statistical arbitrage, a good book would be the:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1441977864&quot; rel=&quot;nofollow&quot;&gt;Statistics and Data Analysis for Financial Engineering&lt;/a&gt; (Springer Texts in Statistics)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;, especially Chapter 9 onward. There you will find all the tools you need for your pairs-trading stat arb, like co-integration, necessary econometric tests etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately there is not a black box that you will plug it in and make money out of it, while the basic idea remains the same, a number of things change for different asset classes and trading frequencies.&lt;/p&gt;&#xA;" OwnerUserId="13462" LastEditorUserId="467" LastEditDate="2015-01-12T01:00:03.103" LastActivityDate="2015-01-12T01:00:03.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15424" PostTypeId="2" ParentId="15417" CreationDate="2014-11-12T13:30:37.700" Score="0" Body="&lt;p&gt;Yahoo Finance might be the best source, you have a lot of information available, Date   Open    High    Low close   Volume  Adj Close*.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://uk.finance.yahoo.com/q/hp?s=VOD.L&quot; rel=&quot;nofollow&quot;&gt;https://uk.finance.yahoo.com/q/hp?s=VOD.L&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13533" LastActivityDate="2014-11-12T13:30:37.700" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15425" PostTypeId="1" CreationDate="2014-11-12T13:30:42.453" Score="6" ViewCount="94" Body="&lt;p&gt;We know that some markets exhibit marginals well approximated by Student t distributions. &#xA;But what is the dependence structure? Is the multivariate density really elliptical (as we all wish for) or are the marginals i.i.d, or something inbetween? Or does one of the other multivariate t models better apply?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Leading to a non-elliptical t the &lt;em&gt;independence&lt;/em&gt; copula introduces directional &quot;dependence&quot;, that's one tricky issue. How bad is the resulting fit in practice?&lt;/p&gt;&#xA;" OwnerUserId="3015" LastEditorUserId="3015" LastEditDate="2014-11-13T10:10:26.077" LastActivityDate="2014-11-13T14:57:57.763" Title="Mutivariate t markets" Tags="&lt;multivariate&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15426" PostTypeId="2" ParentId="15425" CreationDate="2014-11-12T17:09:31.040" Score="4" Body="&lt;p&gt;A multivariate normal distribution can be thought of as normal margins with a normal copula. The multivariate t is the same way, but it has t margins with a t copula and they all have the same degrees of freedom. So it has t copula dependence. It is either a spherical or an elliptical distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't think of a good reason to use a multivariate t. The degrees of freedom parameter is the same for both univariate and multivariate. You give yourself more options by fitting univariate t distributions for each series (so they could potentially have different degrees of freedom, more important when you're looking at a variety of different assets or factors). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The dependence can be handled by a copula. The normal copula is easy to use, but if you're concerned about tail dependence, then there are a number of options, including the t copula. Again, as with the multivariate t, the t copula has one degree of freedom parameter, which means that the tail dependence is assumed to be the same for everything. So if you're looking at data where it makes sense for all to be the same, perhaps such as U.S. equity sectors, then this is fine, but in the majority of cases it may not. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an alternative, some people use grouped t copulas (where every series gets its own degree of freedom) and others use vine copulas (which allow an even greater potential for combinations to explain the dependence structure). One downside is that the more complicated the copula, then the more time-consuming it is to fit, especially if you want to fit a DCC copula. This also illustrates the importance of dimension reduction. I try to avoid just putting everything in a big multivariate distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I'm setting up a quantitative portfolio management model, more complicated tail dependence is pretty low on my list. I recall some benefit in backtests, but it was tiny compared to incorporating time-varying variance. You might be looking at different data, so do your own research and evaluate.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastEditorUserId="2379" LastEditDate="2014-11-13T14:57:57.763" LastActivityDate="2014-11-13T14:57:57.763" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15428" PostTypeId="2" ParentId="15411" CreationDate="2014-11-12T17:58:06.453" Score="5" Body="&lt;p&gt;You can view the price of an option as the cost to dynamically replicate it. The more volatility, the more costs you will have trading the underlying to keep your delta equal to 0 (I'm assuming you sold the option, hence a negative gamma position). So, if at any spot, any date your local vol is above 0.194, rebalancing the portfolio will be constantly more expensive than doing the same job with a constant vol equal to 0.194. So the option needs to be more expensive.&lt;/p&gt;&#xA;" OwnerUserId="13542" LastActivityDate="2014-11-12T17:58:06.453" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15429" PostTypeId="1" AcceptedAnswerId="15431" CreationDate="2014-11-12T20:12:05.723" Score="0" ViewCount="235" Body="&lt;p&gt;Let's say you want to find the fair price of a call option. One way is to use the black scholes formula. This assumes you can delta-hedge the underlying asset and the option to eliminate risk, and hence come up with a fair price such that there are theoretically no arbitrage opportunities. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, what if you were NOT allowed to delta hedge? For example, what if the call option was bought over the counter (off exchange). Does the rationale of the black scholes option price still hold? &lt;/p&gt;&#xA;" OwnerUserId="6661" LastActivityDate="2014-12-14T21:03:11.667" Title="Black scholes OTC" Tags="&lt;black-scholes&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15430" PostTypeId="2" ParentId="219" CreationDate="2014-11-12T20:27:06.240" Score="4" Body="&lt;p&gt;Let $u_t$ be the random walk&#xA;$$ u_t = u_{t-i} + \varepsilon_t $$ &#xA;where $\mathrm{E}[\varepsilon_t]=0$ and $\mathrm{var}[\varepsilon_t]=\sigma^2$ , i.e. $\varepsilon_t$ is stationary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let &#xA;$$X_t = \alpha u_t +\nu_t$$ &#xA;and&#xA;$$Y_t = \beta u_t + \eta_t$$&#xA;where $\nu_t$ and $\eta_t$ are stationary processes similar to $\varepsilon_t$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then both $X_t$ and $Y_t$ are non stationary because they are linear functions of the non-stationary (stochastic trend) variable $u_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However&#xA;$$\beta X_t - \alpha Y_t = \beta \nu_t - \alpha_t \eta_t $$ &#xA;is a linear combination of the stationary disturbances and is therefore stationary. When this happens $X_t$ and $Y_t$ are said to be cointegrated. $X_t$ and $Y_t$ are said to contain the same stochastic trend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea behind the Dickey-Fuller test is to estimate a regression which estimates the ratio of $\alpha$ and $\beta$ and test if the estimated residuals are stationary. These residuals do not follow a standard distribution. &lt;/p&gt;&#xA;" OwnerUserId="9458" LastEditorUserId="848" LastEditDate="2014-11-12T20:43:03.297" LastActivityDate="2014-11-12T20:43:03.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15431" PostTypeId="2" ParentId="15429" CreationDate="2014-11-12T21:19:41.040" Score="3" Body="&lt;p&gt;it's the liquidity of the underlying that matters not the market in which the option was bought. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2014-11-12T21:19:41.040" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15432" PostTypeId="1" CreationDate="2014-11-12T21:26:21.100" Score="7" ViewCount="411" Body="&lt;p&gt;I wonder if I first filter out AR(1) (autoregressive model with lag 1) effects from univariate time series and then fit stochastic volatility model does above procedure introduce any bias at first or second step (first step - fitting AR(1), second step - fitting SV model) ? I'm especially interested in potential bias in fitting AR(1) model. This question have came to my mind after using 'stochvol' R package, where I can't add autoregressive part to stochastic volatility model.&lt;/p&gt;&#xA;" OwnerUserId="2044" LastActivityDate="2015-10-14T07:44:11.070" Title="Filtering out AR(1) effects before using stochastic volatility model" Tags="&lt;time-series&gt;&lt;regression&gt;&lt;garch&gt;&lt;stochastic-volatility&gt;&lt;arma&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15433" PostTypeId="2" ParentId="14972" CreationDate="2014-11-12T22:15:34.807" Score="1" Body="&lt;p&gt;In the past, The Fed typically raised interest rates to help balance the money supply.  When the economy is good and unemployment is low, the Fed raises rates to prevent an over-tightening of the money supply. This is traditionally how inflation works and when this happens it is actually a sign of health.  Commodity prices tended to soar because there was increased demand of natural resources.  When the Fed raises rates so high that is not in the best interest of investors to borrow money, that causes flight from equities into other instruments such as fixed income because bond prices are low and yields are high.  This is where the Fed had to respond by lowering rates until borrowing money became attractive again and the cycle repeated.    &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What we have right now is a historic unprecedented downtrend in interest rates, which is partly due to the Fed's response to deflationary pressure, the credit crisis, and real unemployment.  aka &quot;quantitative easing.&quot;  Money is cheaper than ever.  But without real economic growth to drive rates higher, the only logical place to put excess liquid assets is the stock market.  This has caused the market to continue ever higher, causing a rift in the correlation.  Until the fed feels that it needs to tighten the money supply, this pattern will continue.  When money starts to exit the equity market, the generals (investment banks)  will re-evaluate.  If projected earnings (real economic growth) are moving  higher despite the tightening of credit, it doesn't matter.  They will continue to invest their capital in companies causing the market to correlate with interest rates.  This is the environment of a healthy market.  &lt;/p&gt;&#xA;" OwnerUserId="13544" LastEditorUserId="848" LastEditDate="2014-11-13T06:06:15.630" LastActivityDate="2014-11-13T06:06:15.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15434" PostTypeId="2" ParentId="10458" CreationDate="2014-11-12T22:52:44.320" Score="9" Body="&lt;p&gt;LSM is very fiddly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most important things in my view are &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) don't believe anyone who says that the choice of basis functions doesn't matter. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) implement an upper bounder, eg Andersen--Broadie (2003) or Joshi-Tang (2014) so you can tell if your prices are good&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) do two passes, one to build the strategy, one to price, if they give very different prices you have a problem&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) use an enhancement, eg LSA, policy iteration, multiple regression&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5) discount to the current time frame when doing IRD not the initial time, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;6) bugs tend to lead to downwards bias not huge errors so very careful testing is important&lt;/p&gt;&#xA;&#xA;&lt;p&gt;7) do it in a spreadsheet first&lt;/p&gt;&#xA;&#xA;&lt;p&gt;8) the numerical regressions tend to be unstable so guard against this&lt;/p&gt;&#xA;&#xA;&lt;p&gt;9) test on long-dated high dimensional examples. These are the hardest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;10) price cancellables not callables&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some papers&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Practical Policy Iteration: Generic Methods for Obtaining Rapid and Tight Bounds for Bermudan Exotic Derivatives Using Monte Carlo Simulation Beveridge Joshi Tang&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kooderive: Multi-Core Graphics Cards, the Libor Market Model, Least-Squares Monte Carlo and the Pricing of Cancellable Swaps, Joshi&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Effective Sub-Simulation-Free Upper Bounds for the Monte Carlo Pricing of Callable Derivatives and Various Improvements to Existing Methodologies Joshi Tang&lt;/p&gt;&#xA;&#xA;&lt;p&gt;see also Chapter 13 of More Mathematical Finance&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2014-11-12T22:52:44.320" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15436" PostTypeId="2" ParentId="3329" CreationDate="2014-11-13T00:21:40.537" Score="2" Body="&lt;p&gt;if the pay-off is continuous, the standard approach is to use the path-wise method also known as IPA. This essentially means that you differentiate along each path. It is the limit as the bump size goes to zero of finite differencing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main downside of this method is that the differentiation can be fiddly and slow. The Smoking adjoints paper you mention made the observation that using adjoint/automatic differentiation makes it fast and indeed there are packages that will do the differentiating automatically for you. There is a survey article by Homescu on this topic. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Adjoints and Automatic (Algorithmic) Differentiation in Computational Finance&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cristian Homescu &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have also written too many papers on this. See my SSRN page&#xA;&lt;a href=&quot;http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=550354&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=550354&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also devote a chapter of More Mathematical Finance to this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When the pay-off is discontinuous or you want Hessians life is more complicated. Likelihood ratio is one approach but can lead to large variances. This is particularly the case for vegas. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See Glasserman (2003) Monte Carlo Methods in Financial Engineering for general discussion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have done various papers on the discontinuous case and on Hessians. My current favourites are &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://ssrn.com/abstract=2431580&quot; rel=&quot;nofollow&quot;&gt;http://ssrn.com/abstract=2431580&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://ssrn.com/abstract=2011690&quot; rel=&quot;nofollow&quot;&gt;http://ssrn.com/abstract=2011690&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially, these work by doing change of variables that remove the discontinuities and so then the pathwise method can be applied. They are designed to yield the most pathwise mix of likelihood ratio and pathwise that avoids the discontinuity. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2014-11-13T00:21:40.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15437" PostTypeId="1" CreationDate="2014-11-13T04:08:21.817" Score="0" ViewCount="846" Body="&lt;p&gt;What value do you use for annual dividend yield? &#xA;It does not apply in case of FX.&lt;/p&gt;&#xA;" OwnerUserId="13504" LastActivityDate="2014-11-13T08:46:14.907" Title="Delta formula for FX vanilla option" Tags="&lt;options&gt;&lt;delta&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15438" PostTypeId="2" ParentId="15437" CreationDate="2014-11-13T08:46:14.907" Score="1" Body="&lt;p&gt;When pricing FX options, the underlying is the spot or forward exchange rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The foreign currency is analogous to a stock where the owner of the foreign currency receives a &quot;dividend yield&quot; equal to the risk-free rate in the foreign currency. &lt;/p&gt;&#xA;" OwnerUserId="7391" LastActivityDate="2014-11-13T08:46:14.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15439" PostTypeId="1" AcceptedAnswerId="15440" CreationDate="2014-11-13T11:19:49.263" Score="4" ViewCount="319" Body="&lt;p&gt;In modern portfolio theory, one famous problem is the &lt;strong&gt;Markowitz mean variance optimal portfolio&lt;/strong&gt;, defined by solving&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\underset{\mathbf{w}}{\mbox{min}\,\,}\mathbf{w}^{T}\boldsymbol{\Sigma}\mathbf{w}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;subject to $\mathbf{w}^{T}\mathbf{1}=1$ and $\mathbf{w}^{T}\boldsymbol{\mu}=\eta$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another example that I've seen in lectures is the &lt;strong&gt;Minimum Variance Portfolio&lt;/strong&gt; which is the same as above except the condition $\mathbf{w}^{T}\boldsymbol{\mu}=\eta$ is dropped.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering, there are surely lots of other similar sorts of optimisation problems similar to these. For example, &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;imposing each entry of $\mathbf{w}$ is &gt;0 -- to avoid short shelling&lt;/li&gt;&#xA;&lt;li&gt;imposing each entry of $\mathbf{w}$ is &amp;lt; $\alpha$ to avoid putting too much weight into one stock&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question is as follows: is there a convenient list of these sorts of optimisation problems, and their solutions?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="6661" LastActivityDate="2014-11-18T08:51:05.050" Title="Optimal Portfolios" Tags="&lt;modern-portfolio-theory&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15440" PostTypeId="2" ParentId="15439" CreationDate="2014-11-13T13:39:41.493" Score="7" Body="&lt;p&gt;As a practitioner, I have worked on the following&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Maximize Yield/OAS for a Fixed Income Portfolio keeping the Rates&#xA;Duration (Key Rate Durations) and Spread duration in a constrained&#xA;range . There are other constraints such as &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;No short selling  &lt;/li&gt;&#xA;&lt;li&gt;Max amount you can buy is X% of Max outstanding amount in market&lt;/li&gt;&#xA;&lt;li&gt;Maximum exposure to a perticular country , issuer, Sector , currency etc is constrained&lt;/li&gt;&#xA;&lt;li&gt;Maximum portfolio turnover is within a certain limit. &lt;/li&gt;&#xA;&lt;li&gt;Transaction Cost (Defined as function of DV01  Bid-Offer Spread) is within a range&lt;/li&gt;&#xA;&lt;/ol&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Instead of the objective function being Yeild/OAS or any other&#xA;measure of return we can also try minimize functions such as&#xA;RWA(Risk Weighted Assets) , Basel 3 Capital required etc. These&#xA;problems have similar set of constraints as the previous one.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I am attempting to solve a dynamic optimization exercise where we would have re-balancing based on a simulated environment of rates ,&#xA;inflation , fx etc.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Most of these are not purely Markowitch type and I end up using Linear / Quadratic programming based on the use case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps you in some small way.&lt;/p&gt;&#xA;" OwnerUserId="1386" LastActivityDate="2014-11-13T13:39:41.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15441" PostTypeId="1" CreationDate="2014-11-13T14:53:03.630" Score="5" ViewCount="8186" Body="&lt;p&gt;For Fama-French model we need &lt;code&gt;SMB&lt;/code&gt; (small[market cap] minus big) and &lt;code&gt;HML&lt;/code&gt; (high[book-to-market-ratio] minis low). I want to calculate daily alpha in real time, but the problem is how to get these values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there any benchmark for this values or I have to know entire market and calculate these values manually?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does Bloomberg or some other service provide this kind of data? &lt;/p&gt;&#xA;" OwnerUserId="13360" LastActivityDate="2021-04-06T12:25:33.503" Title="How to get real-time data for Fama-French model?" Tags="&lt;pricing&gt;&lt;factor-models&gt;&lt;index&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15443" PostTypeId="2" ParentId="15441" CreationDate="2014-11-13T16:13:40.877" Score="3" Body="&lt;p&gt;All the Fama-French data is downloadable here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html&quot; rel=&quot;nofollow&quot;&gt;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and in particular, daily RMRF, SMB and HML data can be downloaded here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/ftp/F-F_Research_Data_Factors_daily.zip&quot; rel=&quot;nofollow&quot;&gt;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/ftp/F-F_Research_Data_Factors_daily.zip&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6661" LastActivityDate="2014-11-13T16:13:40.877" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="15445" PostTypeId="2" ParentId="9465" CreationDate="2014-11-13T22:36:40.043" Score="0" Body="&lt;p&gt;It seems to me that JavaScript charting is becoming relatively poplar &lt;a href=&quot;http://www.google.com/trends/explore#q=d3js%2C%20ggplot%2C%20matplotlib&amp;amp;cmpt=q&quot; rel=&quot;nofollow&quot;&gt;see google trends&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main example is &lt;a href=&quot;http://d3js.org&quot; rel=&quot;nofollow&quot;&gt;d3js&lt;/a&gt; and things that run on top of it like &lt;a href=&quot;http://c3js.org&quot; rel=&quot;nofollow&quot;&gt;c3js&lt;/a&gt; and &lt;a href=&quot;http://nvd3.org/&quot; rel=&quot;nofollow&quot;&gt;nvd3&lt;/a&gt;. I recently wrote a simple python wrapper for c3 and called it &lt;a href=&quot;https://github.com/waynenilsen/python-c3&quot; rel=&quot;nofollow&quot;&gt;python-c3&lt;/a&gt; which demonstrates how simple it is to get something up and running which does javascript plots. The source code is very small.&lt;/p&gt;&#xA;" OwnerUserId="4910" LastActivityDate="2014-11-13T22:36:40.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15446" PostTypeId="2" ParentId="15037" CreationDate="2014-11-13T22:44:29.427" Score="2" Body="&lt;p&gt;What matters is not so much the EPS but the EPS growth, EPS growth stability and PE. Of course when looking at a historical series of EPS for a given stock you have to adjust the series for capital changes otherwise it is useless as you mentioned.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the end, when you buy a stock you buy a stream of future cash flows. The higher the net present value of those cash flows, the higher the value (but not necessarily the price) of the company.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Future EPS are a good approximation of that stream and there is a very high correlation between earnings growth and performance of a stock over the long term. So if you could predict the future earnings of a company you could also make money in the markets.&lt;/p&gt;&#xA;" OwnerUserId="2393" LastEditorUserId="2393" LastEditDate="2014-11-14T07:06:04.003" LastActivityDate="2014-11-14T07:06:04.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15447" PostTypeId="1" CreationDate="2014-11-13T23:14:18.513" Score="1" ViewCount="1429" Body="&lt;p&gt;I am going to be backtesting a Long/Short equity strategy and need some guidance on how best to deal with the short book. I was thinking that for each portfolio I would go long 50 equities and go short 50 equities. I plan on doing this test in excel by the way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to wrap my brain around how to appropriately handle this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My thought was:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Portfolio 1&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Longs&#xA;MSFT&#xA;CSCO&#xA;ORCL&#xA;AMZN&#xA;Portfolio Returns&#xA;Benchmark Returns&#xA;Out/Under-performance&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Shorts&#xA;HII&#xA;HP&#xA;BBBY&#xA;YHOO&#xA;Portfolio Returns&#xA;Benchmark Returns&#xA;Out/Under-performance&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first question is whether I would simply flip the sign on the short book in order to get performance for that piece of the portfolio. And secondly whether I would simply add short performance to long performance to get net performance. I would like to include some assumptions about margin but not sure how to appropriately do this -- If you have any suggestions I would appreciate it. &lt;/p&gt;&#xA;" OwnerUserId="11926" LastEditorUserId="7186" LastEditDate="2014-11-14T13:50:38.420" LastActivityDate="2014-11-14T14:32:30.673" Title="Long/Short Backtesting Set up" Tags="&lt;backtesting&gt;&lt;performance-evaluation&gt;&lt;longshort&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15452" PostTypeId="2" ParentId="15447" CreationDate="2014-11-14T10:51:45.810" Score="1" Body="&lt;p&gt;You should first determine whether you want to look at relative or absolute returns. You may want to use position weights relative to the benchmark rather than market value if interested in relative value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For absolute returns consider your three components (long, short and cash - where cash includes borrowing, other costs and in/out flows) P&amp;amp;L and compute simple returns for each period. A period would be created when a change occurs to any position within any of the three components. An alternative would be to compute simple returns after all costs for only long and short positions rather then managing costs through the cash components. This second approach would consider your margin in the divisor (compare this &lt;a href=&quot;http://www.abeweb.org/proceedings/proceedings06/walker.pdf&quot; rel=&quot;nofollow&quot;&gt;demonstration&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once all period returns are known you would typically chain-link the period returns to compute the &lt;a href=&quot;http://en.wikipedia.org/wiki/Time-weighted_return&quot; rel=&quot;nofollow&quot;&gt;time-weighted return&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="7186" LastActivityDate="2014-11-14T10:51:45.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15453" PostTypeId="1" AcceptedAnswerId="15478" CreationDate="2014-11-14T13:19:21.507" Score="2" ViewCount="1903" Body="&lt;p&gt;I'm setting up some &lt;strong&gt;Euribor 6M and Euribor 3M&lt;/strong&gt; curves.&#xA;So far i have all the data and quotes i need, but i'm having trouble defining the firsts points of the curve. I'm currently using 6M Euribor and 3M Euribor OIS as the first point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, how correct is it if i use &lt;strong&gt;O/N Euribor or 1M Euribor&lt;/strong&gt; on both curves, knowing that there's a basis between the indexes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, for the 6M Euribor these are my two options:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Euribor O/N, Euribor 1M, Euribor 6M, FRAs, Swap Rates.&lt;/li&gt;&#xA;&lt;li&gt;Euribor 6M, FRAs, Swap Rates.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Both options seem correct, but i don't know what is the market convention over this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for the help.&lt;/p&gt;&#xA;" OwnerUserId="13533" LastActivityDate="2014-11-19T12:59:38.350" Title="Curve Euribor - Euribor 3M" Tags="&lt;derivatives&gt;&lt;swaps&gt;&lt;interest-rate-swap&gt;&lt;discount-factor-curve&gt;&lt;ois-discounting&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15454" PostTypeId="1" AcceptedAnswerId="15455" CreationDate="2014-11-14T13:50:11.953" Score="3" ViewCount="197" Body="&lt;p&gt;Conditional Value at Risk (CVaR) is given as:&#xA;$$CVaR_\alpha(X)=\frac{1}{\alpha}\int_{0}^{\alpha}VaR_\beta(X)d\beta=-E(X|X\leq-VaR_\alpha(X))=-\frac{1}{\alpha}\int_{-\infty}^{-VaR_\alpha(X)}x \cdot f(x)\,dx$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure if the last term is correct regarding multiplication with $1/\alpha$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The average is already only up to $VaR_\alpha$.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-11-14T14:56:36.993" Title="CVaR reformulation correct?" Tags="&lt;value-at-risk&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15455" PostTypeId="2" ParentId="15454" CreationDate="2014-11-14T14:25:15.643" Score="2" Body="&lt;p&gt;It is correct!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also see it this way:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \text{CVaR}_\alpha(X)=\mathbb{E}(X|X\leq \text{VaR}_\alpha(X)) = \frac{\int_{\mathbb{R}} x\cdot 1_{X\leq \text{VaR}_\alpha(X)}dF(x)}{\int_\mathbb{R}1_{X\leq \text{VaR}_\alpha(X)}dF(x)} = \frac{1}{\alpha} \int_{-\infty}^{\text{VaR}_\alpha(X)}xdF(x) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The sign problem still remains (in both versions). If you define $\text{VaR}_\alpha (X) = - F_X^{-1}(\alpha)$ then you probably want to define $\text{CVaR}_\alpha(X) = - \mathbb{E}(X|X\leq -\text{VaR}_\alpha(X))$ you will get your result.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2014-11-14T14:25:15.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15456" PostTypeId="2" ParentId="15447" CreationDate="2014-11-14T14:32:30.673" Score="0" Body="&lt;p&gt;To add an important point to existing answers, the overall portfolio beta should be 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The usual motivation of a long short strategy is to invest in a portfolio that captures your view of individual equities, but is immune to overall market movements. For example you have reason to believe that MSFT is going to perform better than HP, but you do not want your portfolio to be affected by (for example) the release of macro-economic data would cause all stocks to drop (or go up) by some amount. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main risk factor for every stock is the market, usually approximated by the S&amp;amp;P 500 index. To create a long short strategy that is immune to the S&amp;amp;P 500, you have to estimate the beta's of each of the stocks. You can either calculate it or get it Google finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long equities will have positive beta and short equities negative beta. The portfolio value weighted beta should be close to zero. This strategy, can theoretically offer a great Treynor ratio, if there is value added by the stock picking!&lt;/p&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2014-11-14T14:32:30.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15457" PostTypeId="2" ParentId="15454" CreationDate="2014-11-14T14:56:36.993" Score="1" Body="&lt;p&gt;I also have been puzzled by the intuition of this formula in the past. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What made sense to me was converting the integral to a summation. You can then do the calculation quite simply in an excel document with some simulated data and see where everything is coming from. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;CVaR is really just calculating the average return given that it is less than a certain amount. The calculation is like a weighted average where every observation above VaR has a zero weight. You do the sum and then you divide by the weighted divisor. But since we know that the VaR is at a particular confidence, the divisor should equal that confidence every time. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2014-11-14T14:56:36.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15460" PostTypeId="1" AcceptedAnswerId="15461" CreationDate="2014-11-14T19:30:35.343" Score="-2" ViewCount="45" Body="&lt;p&gt;I was reading an article by David Stockman from (&lt;a href=&quot;http://davidstockmanscontracorner.com/take-cover-now-they-dont-ring-a-bell-at-the-top/&quot; rel=&quot;nofollow&quot;&gt;http://davidstockmanscontracorner.com/take-cover-now-they-dont-ring-a-bell-at-the-top/&lt;/a&gt;). He uses the word &quot;short&quot; in a way I'm unfamiliar with. If you read the paragraph below, he says &quot;there are no shorts left.&quot; What does that mean? I understood it that when you short the market you're betting that it's going to go down. What does it mean here?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;But that is the Achilles heel of the game. As the bubble takes on ever&#xA;  greater girth, it becomes increasingly susceptible to a negative shock&#xA;  to confidence. Part of the reason is technical.  When markets reach&#xA;  their current nose bleed levels there are no shorts left; and it is&#xA;  also likely that the day trading gamblers have become increasingly lax&#xA;  about absorbing the cost of even cheap “downside insurance” (i.e. puts&#xA;  on the S&amp;amp;P 500). That is, they are “long” and “unprotected”.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;/p&gt;&#xA;" OwnerUserId="13565" LastActivityDate="2014-11-14T19:35:48.857" Title="Question about &quot;short&quot; in this sentence" Tags="&lt;short-selling&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15461" PostTypeId="2" ParentId="15460" CreationDate="2014-11-14T19:35:48.857" Score="0" Body="&lt;p&gt;He refers to investors with a negative outlook who have short positions. &lt;/p&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2014-11-14T19:35:48.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15463" PostTypeId="1" AcceptedAnswerId="15465" CreationDate="2014-11-14T21:36:20.293" Score="2" ViewCount="200" Body="&lt;p&gt;I am very rusty on stochastic calculus, and I am having trouble integrating the following simple term from a yield curve model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$z(t)=\int_0^t\exp(-k(t-s))dW(s)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions appreciated.&lt;/p&gt;&#xA;" OwnerUserId="13552" LastActivityDate="2014-11-15T19:22:51.047" Title="Help with integrating stochastic calculus expression from yield curve model" Tags="&lt;fixed-income&gt;&lt;stochastic-processes&gt;&lt;bond&gt;&lt;stochastic-volatility&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15465" PostTypeId="2" ParentId="15463" CreationDate="2014-11-14T21:59:16.163" Score="2" Body="&lt;p&gt;It is a Wiener integral as your integrand is a deterministic function of time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is known that the Wiener integral is stationary gaussian process with independent increments. &#xA;So $z(t) \sim \mathcal N\left(0, \int_0^te^{-2k(t-s) }~ds\right)$ and $(z(t)-z(s)) \amalg z(u), \ \forall u,s,t \in \mathbb R_+ \text{ such that }u\leq s, s\leq t $ or alternatively you can just say that $(z(t)-z(s)) \amalg \mathcal F_s^z, \ \forall  s, t \in \mathbb R _+  \text{ with } t\geq s $ where $\mathcal F_u^z$ is the natural filtration of $z$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Formally you have that $z(t) \overset{\mathcal L}{=} \int_0^t e^{-2k(t-s)}~ds \frac{1}{\sqrt{t}} W_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suppose you need to use that in a simulation so you can just multiplie a normal random variable by the standard deviation $\sqrt {\int_0^te^{-2k(t-s) }~ds}$ and you know that $\int_0^te^{-2k(t-s) }~ds= \frac{1}{2}e^{-2kt}(1-e^{-2kt}) $ (if I made no mistakes).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually formal speaking you must ensure that you integrand $f$ (in your exemple $f(s) =e^{-k(t-s)}$ satisfies &quot;good&quot; integrability conditions. That means that  $f \in L^2 ( \mathbb R _+,dt)$ (with is the case for your example),where $dt$ is the Lebesgue measure  . &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general terms a process $I$ defined $I(t) := \int_0^t f(s) ~ds$ has the properties mentioned above and particularly $I(t)\sim \mathcal N\left(0, \int_0^tf^s(s)~ds\right)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope that helped you. &lt;/p&gt;&#xA;" OwnerUserId="3534" LastEditorUserId="3534" LastEditDate="2014-11-15T19:22:51.047" LastActivityDate="2014-11-15T19:22:51.047" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15468" PostTypeId="1" AcceptedAnswerId="15469" CreationDate="2014-11-15T04:20:08.480" Score="1" ViewCount="384" Body="&lt;p&gt;For the following exercise:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Give optimal upper and lower bounds on the price today for a product that pays a function of the spot price, $S$, of a non-dividend paying stock one year from now, there are no interest rates and the spot is $100$, when the pay-off is $0$ below $80$, increases linearly from $0$ at $80$ to $20$ at $120$ and then it is constant at $20$ above $120$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answer is supposed to be $0$ and $100/6$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I am not understanding how the upper bound is defined.&lt;/p&gt;&#xA;" OwnerUserId="12198" LastActivityDate="2014-11-15T04:45:25.293" Title="Optimal Upper and Lower Bounds" Tags="&lt;derivatives&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15469" PostTypeId="2" ParentId="15468" CreationDate="2014-11-15T04:45:25.293" Score="1" Body="&lt;p&gt;you have to find $\alpha$ and $\beta$ so that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\alpha S_1 + \beta&#xA;$$&#xA;is greater than or equal to the pay-off everywhere. Any such values gives an upper bound&#xA;of&#xA;$$&#xA;\alpha S_0 + \beta&#xA;$$&#xA;Now try to find the smallest value of that. I am guessing that the answer is $\alpha = 1/6$ and $\beta=0.$&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2014-11-15T04:45:25.293" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15472" PostTypeId="2" ParentId="15340" CreationDate="2014-11-15T08:47:25.170" Score="2" Body="&lt;p&gt;You have already said that the negative KRD is not unusual, given that your are looking at an MBS, I recall a very lengthy discussion on a related matter &lt;a href=&quot;http://www.analystforum.com/forums/cfa-forums/cfa-level-iii-forum/9664320&quot; rel=&quot;nofollow noreferrer&quot;&gt;elsewhere&lt;/a&gt; which I assume does not need to be repeated here. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know very little about MBS in general and cannot look at details on the particular issue. However, given that you are looking at KRD you are probably interested in the optionality. I can only assume that the particular structure is probably getting much of the cash flows early and that is why you would see higher KRD in the early maturity bucket. While looking around I found a &lt;a href=&quot;http://www.bondedge.com/us/b2b/bb_key_rate_dur0707.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;helpful article&lt;/a&gt; going into a little more detail on KRD than other (publicly available) sources. If available to you you may look at the original article introducing key rate duration (&lt;a href=&quot;http://www.iijournals.com/doi/abs/10.3905/jfi.1992.408049?journalCode=jfi&quot; rel=&quot;nofollow noreferrer&quot;&gt;Ho 1992&lt;/a&gt;). Thomas Ho has since been establishing his own company, including some &lt;a href=&quot;http://www.thomasho.com/space/viewBlog.asp?blog=33&quot; rel=&quot;nofollow noreferrer&quot;&gt;illustration&lt;/a&gt; of KRD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: More general reasons why duration (for the entire length of an issue) might by higher have been discussed &lt;a href=&quot;https://quant.stackexchange.com/questions/10451/can-the-duration-of-a-bond-be-greater-than-time-to-maturity?rq=1&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7186" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2014-11-15T09:07:03.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15475" PostTypeId="2" ParentId="15345" CreationDate="2014-11-15T15:39:17.650" Score="2" Body="&lt;p&gt;Use acf and pacf as to determine AR and MA parts. Use the position of last significant value for the two tests as the AR and MA terms respectively. or use autoarima if matlab has one with AIC or BIC coefficients. AIC returns a more general model (all possible values) while BIC results in a more constrained one (simpler). &lt;/p&gt;&#xA;" OwnerUserId="7616" LastActivityDate="2014-11-15T15:39:17.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15477" PostTypeId="1" AcceptedAnswerId="15487" CreationDate="2014-11-16T10:44:04.290" Score="6" ViewCount="200" Body="&lt;p&gt;I am currently using &lt;a href=&quot;http://quantlib.org/reference/class_quant_lib_1_1_black_process.html&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;&lt;code&gt;BlackProcess&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; to price options and I have a doubt related to the $x_{0}$ argument of the constructor: I've figured out it should be the forward price of the security, because Black's model uses that to take into account e.g. implied dividend yield and in the end it uses risk free term structure to discount options' prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my snippet of code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  // ...&#xA;  // Exercise&#xA;  boost::shared_ptr&amp;lt; Exercise &amp;gt; europeanExercise(&#xA;      new EuropeanExercise(maturity));&#xA;&#xA;  // Select underlying price according to maturity date&#xA;  boost::shared_ptr&amp;lt; Quote &amp;gt; underlyingQ;&#xA;  for(int i = 0; i &amp;lt; maturityArray_.size(); i++)&#xA;  {&#xA;      if(maturity == maturityArray_[i])&#xA;      {&#xA;          underlyingQ.reset(new SimpleQuote(forwardPrices[i]));&#xA;          break;&#xA;      }&#xA;  }&#xA;  if (!underlyingQ)&#xA;      return -1.0; // Error?&#xA;  Handle&amp;lt; Quote &amp;gt; underlyingH(underlyingQ);&#xA;&#xA;  // Bootstrap interest rates curve&#xA;  Handle&amp;lt; YieldTermStructure &amp;gt; riskFreeTSH(riskFreeTS);&#xA;&#xA;  // Payoff&#xA;  boost::shared_ptr&amp;lt; StrikedTypePayoff &amp;gt; payoff(&#xA;      new PlainVanillaPayoff(type, strike));&#xA;&#xA;  // Process&#xA;  boost::shared_ptr&amp;lt; BlackProcess &amp;gt; blackProcess(&#xA;      new BlackProcess(underlyingH, riskFreeTSH, Handle&amp;lt; BlackVolTermStructure &amp;gt;(forwardVolSurface_)));&#xA;&#xA;  // Options&#xA;  VanillaOption europeanOption(payoff, europeanExercise);&#xA;  europeanOption.setPricingEngine(boost::shared_ptr&amp;lt; PricingEngine &amp;gt;(&#xA;                                       new AnalyticEuropeanEngine(blackProcess)));&#xA;  //...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;maturityArray_&lt;/code&gt; and &lt;code&gt;forwardPrices&lt;/code&gt; are arrays of the same length that have forward dates and forward prices inside.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see, &lt;code&gt;underlyingQ&lt;/code&gt; is chosen from an array of forward prices by matching maturity date from &lt;code&gt;maturityArray_&lt;/code&gt; array, and then used in &lt;code&gt;BlackProcess&lt;/code&gt; constructor as $x_{0}$: is this correct? Or is $x_{0}$ supposed to be the underlying spot price? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ask this because pricing some hundreds of options using Bloomberg's inputs (mid implied volatility, implied forward prices and deposit rates curve) returns fair values that are slightly different than what I see on books. I am currently working on EURO STOXX 50® Index Options (OESX) and the kind of pricing error is something like a parallel shift: this suggests me an issue related to term structures, not implied volatilities or other inputs.&lt;/p&gt;&#xA;" OwnerUserId="3058" LastActivityDate="2014-11-17T09:42:18.223" Title="BlackProcess' constructor $x_{0}$ argument in QuantLib" Tags="&lt;forward&gt;&lt;quantlib&gt;&lt;black76&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15478" PostTypeId="2" ParentId="15453" CreationDate="2014-11-16T14:45:14.520" Score="6" Body="&lt;p&gt;It is incorrect to use 1m euribor or O/N euribor in a 6m Euribor forward curve. You should only use instruments based on 6M euribor, such as 1x7 FRA, 6x12 FRA or swaps v 6m Euribor, as you have done in your second example. The actual 6m euribor fixing itself can be thought of as a 0x6 FRA out of spot.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before the financial crisis basis between different euribor curves didn't really move and wasn't considered an important risk, so it was standard practice to use euribor instruments of any tenor in the same curve. Hence you can find many old textbooks where futures based on 3m Euribor and swaps v on 6m euribor are used in the same curve, which isn't done nowadays.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Incidentally I don't understand the term '3MEuribor OIS' An OIS curve is a separate thing from a euribor Curve. You would build an OIS discounting curve first, then use those discount factors when building your forward curve. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my experience the first point of a 3M euribor forward curve should be the 3m euribor fixing out of spot, and the first point in a 6m euribor forward curve should be the 6m euribor fixing out of spot.&lt;/p&gt;&#xA;" OwnerUserId="13580" LastActivityDate="2014-11-16T14:45:14.520" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15482" PostTypeId="1" AcceptedAnswerId="15979" CreationDate="2014-11-16T18:49:58.170" Score="2" ViewCount="154" Body="&lt;p&gt;Let x, y &gt; 0. Defint eh first passage time of a Brownian motion $W_t$ as $\tau_a$ = min{t $\ge$ 0: $W_t$ = a}. I need to show that E[$e^{-u\tau_x}$$1_{\tau_x &amp;lt; \tau_{-y}}$] = $\frac{sinh(y\sqrt{2u})}{sinh((x + y)\sqrt{2u}}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My method, and the only method that I will be able to understand, is to use the optional sampling theorem. I noted that $Z_t = e^{\theta W_t - \frac{1}{2}\theta^{2}t}$ is martingale and that the optional sampling theorem states that $E[Z_{\tau_{min\, {a, t}}}$] = 1. Applying this to the stopping time $ {\tau_x, \wedge \tau_{-y}}$ I have managed to show that as t --&gt; $\infty$ $Z_(\tau_x\wedge\tau_{-y})\wedge t$ = $e^{-\theta y - \frac{1}{2} \theta^2 \tau_{-y}}$$1_{\tau_{-y} \,  &amp;lt; \,   \tau_x}$ + $e^{\theta x - \frac{1}{2} \theta^2 \tau_{x}}$$1_{\tau_{x} \,  &amp;lt; \,   \tau_{-y}}$. I can't figure where to go from here. I had a similar problem, but there was only one level involved, where here we have two: x and y. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe we should now take the expectation of the expression I derived and set it equal to one by optional sampling theorem, but I don't know what follows. &#xA;Thanks. &lt;/p&gt;&#xA;" OwnerUserId="11919" LastEditorUserId="11919" LastEditDate="2014-11-16T18:58:17.393" LastActivityDate="2014-12-24T14:29:01.717" Title="Optional Sampling Theorem Application" Tags="&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15485" PostTypeId="2" ParentId="15289" CreationDate="2014-11-17T07:43:51.387" Score="2" Body="&lt;p&gt;Thanks to my research leader, I found what I missed. $V_{0,1}$ is vol of swaption that matures at $T_0$ which is not 0 (as I thought), rather it is maturity of the first libor. So $V_{0,1}$ is the closest available point on market. &#xA;And now this is all clear with table on page 323 in section 7.4. $V_{0,2}$ is realy vol of swaption that matures at $T_0$=1y and has length = 2y.&lt;/p&gt;&#xA;" OwnerUserId="7486" LastActivityDate="2014-11-17T07:43:51.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15486" PostTypeId="2" ParentId="12651" CreationDate="2014-11-17T09:08:56.307" Score="1" Body="&lt;p&gt;There is also &lt;a href=&quot;http://www.blacklitterman.org/&quot; rel=&quot;nofollow&quot;&gt;http://www.blacklitterman.org/&lt;/a&gt; Where you can find an implementation under Excel and Matlab of the Model.&lt;/p&gt;&#xA;" OwnerUserId="13591" LastActivityDate="2014-11-17T09:08:56.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15487" PostTypeId="2" ParentId="15477" CreationDate="2014-11-17T09:42:18.223" Score="4" Body="&lt;p&gt;The process must contain the spot price. The &lt;code&gt;AnalyticEuropeanEngine&lt;/code&gt; will take care of calculating the forward price from the data you're passing in the process (in this case spot and risk-free-rate) and the maturity of the option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As implemented in QuantLib, though, The &lt;code&gt;BlackProcess&lt;/code&gt; class assumes there's no dividend yield. If you want to model some kind of implied yield, you'll probably have to use a more generic class (such as &lt;code&gt;BlackScholesMertonProcess&lt;/code&gt;) and pass it the dividend yield you've estimated.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2014-11-17T09:42:18.223" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15488" PostTypeId="1" AcceptedAnswerId="15497" CreationDate="2014-11-17T11:41:20.400" Score="2" ViewCount="3205" Body="&lt;p&gt;I am looking to store equity price data in a hdf5 table. The use will be purely as a historical archive, not as day-to-day data source.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Options&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;One option would be to store base10 significand and exponent&#xA;separately as e.g. uint64 and uint8. The downside is that it is fairly awkward to handle especially as int do not come out of the box with NaN handling for missing values.&lt;/li&gt;&#xA;&lt;li&gt;The other option would be to use float64 which is easier to handle and has NaN support built-in.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;My question: Does float64 have sufficient precision to store price data? What is the experience of the number of significant digits required for a price archive?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: &lt;a href=&quot;http://en.wikipedia.org/wiki/Double-precision_floating-point_format&quot; rel=&quot;nofollow&quot;&gt;float64 seems to have&lt;/a&gt; 15-17 &quot;significant decimal digits&quot; precision. Not sure whether this means &quot;significant digits&quot; or whether this only refers to the decimal digits.&lt;/p&gt;&#xA;" OwnerUserId="12227" LastActivityDate="2016-08-11T16:42:05.463" Title="float64 to store price data: is precision sufficient?" Tags="&lt;equities&gt;&lt;data&gt;&lt;market-data&gt;&lt;historical-data&gt;&lt;database&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15489" PostTypeId="1" CreationDate="2014-11-17T12:09:07.273" Score="7" ViewCount="12814" Body="&lt;p&gt;The asset-or-nothing European option pays at t = T the value of the stock when&#xA;at time T that value exceeds or is equal to the exercise price E, and nothing if&#xA;the value of the stock is below E. So, in mathematical terms:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V(S,T) = \left\{&#xA;  \begin{array}{lr}&#xA;    S &amp;amp; \text{if}\quad S \ge E,\\&#xA;    0 &amp;amp; \text{if}\quad S &amp;lt; E.&#xA;  \end{array}&#xA;\right.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The cash-or-nothing European option pays at t = T a fixed value B when at&#xA;time T that value exceeds or is equal to the exercise price E, and nothing if the&#xA;value of the stock is below E. So, in mathematical terms:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V(S,T) = \left\{&#xA;  \begin{array}{lr}&#xA;    B &amp;amp; \text{if}\quad S \ge E,\\&#xA;    0 &amp;amp; \text{if}\quad S &amp;lt; E.&#xA;  \end{array}&#xA;\right.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know that the formulas for these options are the following:&#xA;\begin{align}&#xA;&amp;amp;\text{Cash-or-nothing call:}\quad c_{cn}=Be^{-rT}N(d_2),\\&#xA;&amp;amp;\text{Cash-or-nothing put:}\quad p_{cn}=Be^{-rT}N(-d_2),\\&#xA;&amp;amp;\text{Asset-or-nothing call:}\quad c_{an}=Se^{-qT}N(d_1),\\&#xA;&amp;amp;\text{Asset-or-nothing put:}\quad p_{an}=Se^{-qT}N(-d_1).\\&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&#xA;$$&#xA;d_1=\dfrac{\ln(S/E)+(r-q+\sigma^2/2)(T-t)}{\sigma\sqrt{T-t}}&#xA;$$&#xA;and&#xA;$$&#xA;d_2=d_1-\sigma\sqrt{T-t}.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We also know that we are supposed to follow the derivation of Black-Scholes in order to derive these formulas but we are having trouble understanding how it differs from the derivation of Black-Scholes itself. &lt;/p&gt;&#xA;" OwnerUserId="13592" LastEditorUserId="13592" LastEditDate="2014-11-17T12:16:45.870" LastActivityDate="2019-10-23T18:38:57.360" Title="Derivation of the formulas for the values of European asset-or-nothing and cash-or-nothing options" Tags="&lt;options&gt;&lt;exotics&gt;&lt;european&gt;&lt;binary-options&gt;&lt;cash-or-nothing&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15490" PostTypeId="1" CreationDate="2014-11-17T13:23:03.790" Score="1" ViewCount="305" Body="&lt;p&gt;Where can I get/buy the TAQ NYSE OpenBook for specific stocks on specific days?&#xA;I don't need a whole year of all stocks. I just want to enter a day and a stock, so I can download the order book data of that day.&lt;/p&gt;&#xA;" OwnerUserId="13593" LastActivityDate="2014-12-17T18:10:10.593" Title="TAQ NYSE OpenBook" Tags="&lt;orderbook&gt;&lt;nyse&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15491" PostTypeId="1" CreationDate="2014-11-17T14:13:03.670" Score="2" ViewCount="3460" Body="&lt;p&gt;I'm currently reading Iain Clark's book Foreign Exchange Option Pricing and I got stuck at one sentence in the beginning of Section 3.3 that I feel is important to understand. He writes:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;FX volatility smiles are characterized by providing volatilities, not&#xA;  as a function of strike, but as a function of delta. The choice of&#xA;  delta as the parameter describing the volatility smile is sensible, as&#xA;  otherwise a strike that might correspond to a considerably&#xA;  out-of-the-money option for small $T$ would be very close to&#xA;  at-the-money for large $T$.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;where by $T$ he refers to the time left until expiry of the option. My question is: how do you know (or argue) that just because there is an option with expiry in 1 week that is out-of-the-money a similar option (with bigger $T$) will be very close to at-the-money?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="2376" LastActivityDate="2015-06-06T13:10:50.470" Title="FX Delta Conventions" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;fx&gt;&lt;pricing&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15493" PostTypeId="2" ParentId="14660" CreationDate="2014-11-17T14:50:10.270" Score="5" Body="&lt;p&gt;Vol_smile. The sentence as you quote it doesn't make much sense, but my guess as to what they mean is this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OIS stands for Overnight Index Swap. In the US the overnight rate is called Fed Funds as 'experequite' mentioned (in the Euro-zone it is Eonia). The bank is borrowing at 3m Libor, which in this example is currently 2.10%. If 3m Fed Funds OIS is at 2%, then the bank is borrowing 10bps above 3m Fed Funds OIS (2.1% - 2%). If the bank then doesn't want to have any dependency on Libor they could enter a 3m swap in which they receive Libor and pay Fed Funds + X bps. since this swap will have 0 PV at the moment of execution (otherwise either they or the counterpart wouldn't do it) X = 10bps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope that helps. Must be quite an old report if 3m Libor is 2.1%. Wonder how long it'll be till we see those rates again.&lt;/p&gt;&#xA;" OwnerUserId="13580" LastActivityDate="2014-11-17T14:50:10.270" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15494" PostTypeId="2" ParentId="15490" CreationDate="2014-11-17T14:54:38.607" Score="0" Body="&lt;p&gt;For everything related to NYSE data you start at: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.nyxdata.com/Data-Products/Historical-Data&quot; rel=&quot;nofollow&quot;&gt;http://www.nyxdata.com/Data-Products/Historical-Data&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you just need end of day data, then you can get this from Google finance or yahoo finance for free.  If you want to individual prices, then you have a few options:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) get a Bloomberg terminal and pull the data you want.  They go back 205 days I believe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) go to another data vendor like RealTik, or ActivData.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) purchase from NYSE themselves at the above link.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure the price differs if you want specific stocks versus the entire market.  From what I remember, you just pay money and they let you query what ever stocks on which ever days you want.&lt;/p&gt;&#xA;" OwnerUserId="743" LastActivityDate="2014-11-17T14:54:38.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15495" PostTypeId="2" ParentId="4845" CreationDate="2014-11-17T15:04:54.783" Score="2" Body="&lt;p&gt;I guess you'll have found the answer to this question sometime in the last couple of years, Gabriel, but anyway: It is purely notional. This market is not made for producers to sell their product, it is simply for hedging. The money market is where actual short-term capital is lent between banks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In EuroDollar futures there is no exchange of principal. In fact, bank A does not deal with Bank B: instead if Bank A buys and Bank B sells, then actually Bank A buys from the exchange and Banks B sells to the exchange. Each bank pays or receives their mark-to-market value of the trade to the exchange each night. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a separate OTC derivative product called FRAs that are similar to Eurodollar futures in terms of risk and value. They are traded between banks, but nowadays even those contract will be cleared (to a central clearing house such as LCH) so that the banks aren't facing each other. &lt;/p&gt;&#xA;" OwnerUserId="13580" LastEditorUserId="13580" LastEditDate="2014-11-20T13:03:13.847" LastActivityDate="2014-11-20T13:03:13.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15497" PostTypeId="2" ParentId="15488" CreationDate="2014-11-17T18:36:04.657" Score="5" Body="&lt;p&gt;As background, &lt;a href=&quot;http://en.wikipedia.org/wiki/Floating_point&quot; rel=&quot;noreferrer&quot;&gt;Floating point precision&lt;/a&gt; is a way of storing numbers such that the precision is relative to the largest digit.  For instance, the number $0.00123$ stored in fixed precision needs 6 digits of precision (3 zeros and the 3 non-zero numbers).  However, this same number stored as floating point precision $1.23 \cdot 10^{-3}$ needs only 3 significant decimal digits to store.  Floating point is generally a more efficient way to store numbers that have many different &lt;a href=&quot;http://en.wikipedia.org/wiki/Order_of_magnitude&quot; rel=&quot;noreferrer&quot;&gt;orders of magnitude&lt;/a&gt; but more importantly they are stored in a form where the computer can do efficient basic calculations like multiplication and in your case is much easier to work with than option 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even the deepest markets (treasuries, currencies) need only 6-7 digits of floating precision to store price data.  There are some &lt;a href=&quot;https://docs.python.org/2/tutorial/floatingpoint.html&quot; rel=&quot;noreferrer&quot;&gt;important limitations&lt;/a&gt; meaning the prices stored won't always be exact but maybe approximated at the 16th or 17th digit.  If the prices are used in calculations later (we are on quant finance after all) it would be shocking if for numbers with 6-7 digits of precision rounding to the 16th/17th digit mattered at all.  On the corner case that this approximation matters you can look into option 3 which is &lt;a href=&quot;https://docs.python.org/2/library/decimal.html&quot; rel=&quot;noreferrer&quot;&gt;fixed point storage&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5689" LastActivityDate="2014-11-17T18:36:04.657" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15499" PostTypeId="2" ParentId="15488" CreationDate="2014-11-17T20:32:23.813" Score="0" Body="&lt;p&gt;In my case, it really depends if you are using any software at all.&#xA;I usually get my Discount Factors with a 15 decimals precision. So im always storing at least 15 digits for DF, and yields up to 7-8 as rhaskett said.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For equities, i guess it's pretty much the same as for yields, or even less. Nevertheless i store any return, price or ratio with a 7-8 digit precision.&lt;/p&gt;&#xA;" OwnerUserId="13533" LastActivityDate="2014-11-17T20:32:23.813" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15500" PostTypeId="1" CreationDate="2014-11-17T21:08:03.153" Score="-1" ViewCount="131" Body="&lt;p&gt;For a portfolio containing FX options, would the sum of P&amp;amp;L for each option be the portfolio value?&lt;/p&gt;&#xA;" OwnerUserId="13524" LastEditorUserId="467" LastEditDate="2015-03-18T01:49:42.843" LastActivityDate="2015-03-18T01:49:42.843" Title="In a FX options book, is the sum of P&amp;L equal to the portfolio value?" Tags="&lt;options&gt;&lt;fx&gt;&lt;portfolio&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15501" PostTypeId="2" ParentId="15500" CreationDate="2014-11-17T21:47:10.063" Score="0" Body="&lt;p&gt;Yes, and as the FX market is suposed to never close, it can fluctuate 24/7, which makes it dangerous if you are not really aware of your exposure. &lt;/p&gt;&#xA;" OwnerUserId="12089" LastActivityDate="2014-11-17T21:47:10.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15503" PostTypeId="1" CreationDate="2014-11-18T03:28:18.337" Score="2" ViewCount="1502" Body="&lt;p&gt;I'm given cap prices and swap rates, and i'm trying to calibrate the &lt;a href=&quot;http://en.wikipedia.org/wiki/Hull%E2%80%93White_model&quot; rel=&quot;nofollow&quot;&gt;Hull-White&lt;/a&gt; model to them. I then want to use the model in order to price a swaption.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that the model can be calibrated from implied volatilities but, how do you do so  with prices?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to find the volatilities from the cap prices?&lt;/p&gt;&#xA;" OwnerUserId="13601" LastEditorUserId="467" LastEditDate="2014-12-19T01:20:21.207" LastActivityDate="2015-03-19T02:01:15.273" Title="How to calibrate the Hull-White model using cap prices?" Tags="&lt;fixed-income&gt;&lt;calibration&gt;&lt;swaption&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15504" PostTypeId="2" ParentId="9270" CreationDate="2014-11-18T05:13:38.990" Score="0" Body="&lt;p&gt;Well if we take a call option the gamma is non-zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we take the replicating portfolio for a call option, it consists of stock and bonds. Both of these have zero gamma. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in the form asked, I think the result is false for second derivatives.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2014-11-18T05:13:38.990" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15505" PostTypeId="1" CreationDate="2014-11-18T06:01:41.407" Score="2" ViewCount="1140" Body="&lt;p&gt;What are the various ways to choose bonds for a butterfly strategy? For eg., I already know the most common one i.e., choosing short and long term for the wings (barbell) and the medium term for the body (Bullet). &lt;/p&gt;&#xA;" OwnerUserId="7519" LastActivityDate="2015-02-16T18:57:43.640" Title="Various ways to choose bonds for a butterfly strategy?" Tags="&lt;fixed-income&gt;&lt;quant-trading-strategies&gt;&lt;trading&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15506" PostTypeId="1" CreationDate="2014-11-18T08:05:34.473" Score="1" ViewCount="91" Body="&lt;p&gt;In the book &quot;Financial Modelling with jump processes&quot; by Cont and Tankov there is a chapter that explains martingale pricing principles. It is not extremely formal, but gives the idea underlying the method. There he shows that any linear positive pricing rule can be associated with a probability measure (or expectation operator defined on a linear subspace of random variables representing the contingent claims). That's perfectly clear, and argument is rather simple. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The next step is to show that under some non-arbitrage argument, the discounted prices of traded securities must be martingales w.r.t. to the latter measure. The argument is as follows:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Consider now an asset $S^i$ traded at price $S^i_t$. This asset can be held until $T$, generating a terminal payoff $S^i_T$, or be sold for $S^i_i$: the resulting sum invested at the interest rate $r$ will then generate a terminal wealth of $\mathrm e^{r(T-t)}S^i_t$. These two buy-and-hold strategies are self-financing &lt;strong&gt;and have the same terminal payoff&lt;/strong&gt; so they should have the same value at $t$.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The &lt;strong&gt;bold&lt;/strong&gt; part in the quote is unclear to me: how do we know that terminal payoffs are the same? I even think, that in the simplest case of BS model they won't be: if $S^i_t$ is a GBM with drift $\mu$ and volatility $\sigma$, then $S^i_T \neq \mathrm e^{r(T-t)}S^i_t$ under the physical measure, and since we are looking for the equivalent measures, neither payoffs will be same (a.s.) under such measures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can somebody clarify, whether this is indeed a mistake in the argument, or am I missing something here? &lt;/p&gt;&#xA;" OwnerUserId="13480" LastActivityDate="2014-11-18T21:20:21.163" Title="Pricing rule shall be a martingale measure" Tags="&lt;option-pricing&gt;&lt;arbitrage&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15508" PostTypeId="2" ParentId="9270" CreationDate="2014-11-18T08:37:48.540" Score="0" Body="&lt;p&gt;I think that the question in its current form is not really precise. The Greeks are quite easy to define for a given formula of a price: in that case they are simply partial derivatives, and of course linear (and in some case commute with integrals rather than just finite sums). However, they are crucially model-dependent - not only their expressions, but also their meanings. For example, Vega is sensitivity to the BS IV, which is rather strange to use in purely jump models, not to say that the definition of Vega through IV seems to be rather circular.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nevertheless, in some sense your question has a positive answer. To any strategy $\varphi$ we can assign its value $V_t(\varphi) = S_t\cdot \varphi_t$, so let's talk about sensitivities of $V_t$ w.r.t. some reasonable variables. Consider a case of BS model, $S_0  =\mathrm e^{rt}$, and let $\varphi$ replicate the price of a European call. In that case&#xA;$$&#xA;  \varphi^0_t = \mathrm e^{-rt}(c - \Delta S), \quad \varphi_t^1 = \Delta&#xA;$$&#xA;so $V_t(\varphi) = c$ and of course all the derivatives of $V$ are those of $c$. Yet again, you may see some circularity in this argument, but I do not know how to help here unless you clarify your question in more precise terms. By no means it's because of the way you have formulated it, more that it concerns the fact that Greeks mathematically are rather ambiguous as an object.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To summarize: as Mark pointed out in his answer, Gamma of $S$ and cash account is zero, hence in the dynamic portfolios it is crucial to check what are the Greeks of the coefficients $\varphi$ in your portfolio, not only those of the securities that enter it. With focus on Gamma, suppose you have a self-financing strategy which does not necessarily supposed to replicate anything, just the two stochastic processes $\varphi^0$ and $\varphi^1$ that represent the amount invested in cash account and stocks respectively. Let's say $\varphi^1$ is what you choose, so to satisfy the self-financing condition $\mathrm d\varphi^0_t = -\mathrm e^{-rt}S_t\mathrm d\varphi^1_t$. The way you choose &#xA;$\varphi^1$ depending say on $S$ determines your Greeks as well, for example in case of a European call replicating strategy, $\varphi^1$ is its $\Delta$, and hence determines its Gamma. Perhaps, that also holds in general.&lt;/p&gt;&#xA;" OwnerUserId="13480" LastEditorUserId="13480" LastEditDate="2014-11-19T07:48:55.827" LastActivityDate="2014-11-19T07:48:55.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15509" PostTypeId="1" CreationDate="2014-11-18T08:46:54.200" Score="1" ViewCount="78" Body="&lt;p&gt;The risk-free rate is 4%, and the expected return on the market portfolio is 12%. Using the Capital Asset Pricing Model: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;a. What is the risk premium on the market?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b. what is the required return on an investment with a beta of 1.5?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;c. if the expected return on stock X is 11.2%, what is its beta, according to the capital asset pricing model? &lt;/p&gt;&#xA;" OwnerUserId="13604" LastActivityDate="2014-11-18T10:59:44.883" Title="finance - using CAPM" Tags="&lt;finance&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2014-11-18T11:41:22.333" ContentLicense="CC BY-SA 3.0" />
  <row Id="15510" PostTypeId="2" ParentId="15439" CreationDate="2014-11-18T08:51:05.050" Score="1" Body="&lt;p&gt;One more kind of problem in your basket:&#xA;$$&#xA;  \max_w \left(w^T \mu -q \cdot w^T \Sigma w\right)&#xA;$$&#xA;where $q\geq 0$ is a risk-aversion parameter. In case $q\to\infty$ you are extremely risk-averse, and you minimize the variance without caring about the mean. If $q =0 $ you are risk-neutral, and you're only interested in maximizing the mean. You can put all possible linear constraints on top: $Aw \leq b$, $A'w = b'$ etc. and they will all fall into the class of quadratic optimization problems, that are very-well studied in math - in particular, most of them won't have nice analytic formulas for $w$, but can compute it numerically rather fast.&lt;/p&gt;&#xA;" OwnerUserId="13480" LastActivityDate="2014-11-18T08:51:05.050" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15512" PostTypeId="1" CreationDate="2014-11-18T09:23:37.763" Score="4" ViewCount="295" Body="&lt;p&gt;In option pricing, volatility naturally appeared through the Black-Scholes (BS) model where it was a coefficient for the linear diffusion term $\sigma S\,\mathrm dW_t$, and as such represented the time-scaled Standard Deviation (SD) of log-returns:&#xA;$$&#xA;\mathrm{Var}[\log S_t] = \mathrm{Var}[\sigma W_t] = (\sigma \sqrt t)^2.&#xA;$$&#xA;In particular, if $T$ is maturity, the SD of the log-return on the initial investment $S_0$ is given by $\sigma \sqrt T$. Due to imprecision of the BS model, one deals with the BS Implied Volatility (IV) which fits the market prices of vanilla options with BS formula. The IV surface can thus have a pretty general shape, and we can compute the implied distribution of $S_T$ given the market prices of the option. I thus wonder, whether the SD of $S_T$ given by implied distribution can  be computed in terms of IV surface, and whether it can happen that for some IV surfaces the SD is infinite.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; just to clarify my question. Let us assume that the expiry $T$, interest rate $r$ and current underlying level $S$ are fixed. Denote by $\sigma(K)$ the IV smile at time $T$. If $C(K,\sigma)$ denotes the price of a European call with a strike $K$, volatility $\sigma$ and other parameters given above, then the implied distribution of $S_T$ has density&#xA;$$&#xA;  f(K) = \frac{\mathrm d^2}{\mathrm d K^2}C(K,\sigma(K))&#xA;$$&#xA;and hence the SD of $\log S_T$ is finite iff&#xA;$$&#xA;  \int_0^\infty (\log x)^2f(x)\mathrm dx &amp;lt;\infty.&#xA;$$&#xA;My question is whether there is a choice of $\sigma(K)$ which turns the latter integral to be infinite, but yet satisfies all necessary non-arbitrage conditions (non-negative vertical spreads etc.) &lt;/p&gt;&#xA;" OwnerUserId="13480" LastEditorUserId="13480" LastEditDate="2014-11-18T13:47:57.950" LastActivityDate="2014-11-18T13:47:57.950" Title="Relation between IV and SD" Tags="&lt;implied-volatility&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15514" PostTypeId="2" ParentId="15512" CreationDate="2014-11-18T10:23:15.610" Score="-1" Body="&lt;p&gt;Well, the implied volatility surface is given by (the Dupire equation)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma^2(K, T) = 2 \frac{ \frac{\partial C}{\partial T} }{K \frac{\partial^2 C}{\partial K^2}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so at least theoretically if either $K$ or $\frac{\partial^2 C}{\partial K^2}$ becomes very small the implied volatility can tend towards infinity. Whether or not you can find quoted call options with these properties is another question :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope I did understand your question correctly.&lt;/p&gt;&#xA;" OwnerUserId="2376" LastActivityDate="2014-11-18T10:23:15.610" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15515" PostTypeId="2" ParentId="15512" CreationDate="2014-11-18T10:50:44.733" Score="3" Body="&lt;p&gt;In my mind volatility (SD) of a stock and implied volatility (IV) are two quite different things:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;volatility is usually measured backwards looking. The common methods (empirical, GARCH, ..) look into the past. Measuring the risk of owning the stock in the future is often based on these backwards looking observations. We try to measure risk in the real world here.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;(BS-) implied volatility is some number that matches traded option prices with the pair moneyness/time to maturity. It is basically forward looking. You have different numbers for different levels of moneyness and time to maturity. Here we try to find implied parameters that live in the risk-neutral world&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So to answer your question: In my mind the risk-neutral world and the &quot;real&quot; world can not be connected that easily. Concerning the implied distribution: there is research based on this. Basically you derive the risk-netrual distribution of the stock directly from traded option prices - not from implied vol. You can start your research &lt;a href=&quot;http://people.stern.nyu.edu/sfiglews/Docs/RND_draft7.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Concerning limit behaviour of geometric BM models:&#xA;If maturity tends to zero, the option price is positive and the option is out of the money, then $\sigma$ tends to infinity. This fact is one of the critical points of this modelling approach. This is overcome by using linear BM models (such as the Bachelier model) or models with jumps.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2014-11-18T12:56:53.360" LastActivityDate="2014-11-18T12:56:53.360" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="15516" PostTypeId="2" ParentId="15509" CreationDate="2014-11-18T10:59:44.883" Score="1" Body="&lt;p&gt;The CAPM states that &#xA;$$&#xA;E[r-r_f] = \beta E[r_M-r_f],&#xA;$$&#xA;thus&#xA;$$&#xA;E[r] = r_f + \beta E[r_M-r_f],&#xA;$$&#xA;where $r$ is the return of the asset and $r_M$ is the market return, $r_f$ is the risk free rate.&#xA;Thus you have to substract the risk free rate from the expectations as $E[r-r_f] =E[r]-r_f $.&#xA;The answers are&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$8\%$ as in the other answer&lt;/li&gt;&#xA;&lt;li&gt;$4\% + 1.5* 8\% = 16\%$&lt;/li&gt;&#xA;&lt;li&gt;$11.2\%-4\% =\beta*8\%$ thus $\beta=0.9$.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-11-18T10:59:44.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15517" PostTypeId="2" ParentId="14799" CreationDate="2014-11-18T11:03:50.703" Score="2" Body="&lt;p&gt;There is a vast literature on modelling time-series with periodcities. Rob Hyndman is one of the leading reseaerchers in this area. He has published the &lt;a href=&quot;http://robjhyndman.com/software/forecast/&quot; rel=&quot;nofollow&quot;&gt;R package&lt;/a&gt; &lt;code&gt;forecast&lt;/code&gt; and a free online text book on this subject (with another package and R code in the book). Your task is covered starting &lt;a href=&quot;https://www.otexts.org/fpp/6/1&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-11-18T11:03:50.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15518" PostTypeId="2" ParentId="15345" CreationDate="2014-11-18T11:47:00.463" Score="0" Body="&lt;p&gt;In addition to previous answer which suggest AIC/BIC and using properties of acf/pacf plots (and their hypothesis tests) -- I would like to add that one further (more advanced) method could be to use cross validation for a time series model.&lt;/p&gt;&#xA;" OwnerUserId="6661" LastActivityDate="2014-11-18T11:47:00.463" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15519" PostTypeId="1" CreationDate="2014-11-18T14:41:42.837" Score="2" ViewCount="513" Body="&lt;p&gt;Does delta neutral portfolio mean you add up deltas of all positions and the sum should be zero? Is this true?&#xA;Also, in a FX portfolio consisting of FX calls puts and Fwds, if FWD delta is given for each how do you make the portfolio delta neutral? &#xA;Do you just add up the fwd deltas for all and depending on the sum, buy or sell a FWD to bring the sum of delta to zero? Is this the right approach?&lt;/p&gt;&#xA;" OwnerUserId="13524" LastActivityDate="2015-01-17T18:30:45.333" Title="What is delta neutral" Tags="&lt;fx&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15520" PostTypeId="2" ParentId="15519" CreationDate="2014-11-18T15:04:38.470" Score="1" Body="&lt;p&gt;You are right in saying that to check whether your position is $\Delta$-neutral, you have to check the $\Delta$s of its constituents. That's a general statement that applies to positions that you are not rebalancing too fast, see e.g. &lt;a href=&quot;https://quant.stackexchange.com/questions/9270/greeks-of-self-financing-portfolio&quot;&gt;this recent question&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, each Greek measures a particular risk/exposure of your position to a market condition that may change. For example, $\Delta$ ($\Theta$, $\rho$) tells you how much your position will change if the underlying level (time, interest rate) changes given that all other things being equal. The latter condition makes it possible to express Greeks as partial derivatives of the portfolio's value with respect to relevant variables, e.g. $\Delta = \frac{\partial V}{\partial S}$. Since partial derivatives are linear, if you hold $m$ at the money calls calls and $n$ stocks&#xA;$$&#xA;  \frac\partial{\partial S}(mC + nS) = m\Delta_C + n \approx m/2 + n&#xA;$$&#xA;where $\Delta_C \approx 1/2$ is the $\Delta$ of one at the money call. In that case, to be $\Delta$-neutral, you would hold $n = -m/2$ stocks against your at the money call position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As such, to compute exposure of your entire position, it is enough to compute separately exposures of each leg in your position. For this reason, the approach you've described in the OP is correct. Just note that $\Delta$ changes as well, and hence to stay $\Delta$ neutral you will need to do additional trades while you proceed to hold the option position. This concept is called continuous hedging. The changes of $\Delta$ are described by higher-order Greeks such as Gamma, Charm, DdelV etc.&lt;/p&gt;&#xA;" OwnerUserId="13480" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2014-11-18T15:04:38.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15521" PostTypeId="2" ParentId="15505" CreationDate="2014-11-18T16:48:24.113" Score="1" Body="&lt;p&gt;It really depends on what you're trading on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Very often, butterfly trades are simply mean reverting trades. For example, you may look at 2s/5s/10s (typically on a regression or PCA-weighted basis) and see whether it's trading at &quot;extreme&quot; levels relative to history (i.e., are 5s trading rich or cheap relative to where 2s and 10s are trading). This can be done for any butterflies, as wide as 5s/10s/30s, or as narrow as Feb17s/Aug17s/Feb18s.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other times, butterfly trades are convexity trades. For example, 5s/10s/30s duration neutral barbell would be a long convexity trade (because 30s are far more convex than either 5s or 10s).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Butterfly trades could also be macro or Fed trades. For example, if you believe the fed will keep the front end of the curve anchored in the near term, but future growth outlook is improving very dramatically, causing the belly of the curve to underperform, then shorting a 2s/5s/10s butterfly would make a lot of sense (this kind of trades worked very well this year).&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2014-11-18T16:48:24.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15522" PostTypeId="2" ParentId="959" CreationDate="2014-11-18T19:19:18.150" Score="1" Body="&lt;p&gt;It is very possible to produce code in Java that:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Does not create any garbage so GC never kicks in.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It is JIT-friendly so the critical parts will be compiled by the hotspot.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If you do that, you can get code as fast as C++. Some of the most successful HFT hedge funds out there use Java.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, we have developed a FIX engine (&lt;a href=&quot;http://www.coralblocks.com/index.php/category/coralfix/&quot; rel=&quot;nofollow&quot;&gt;CoralFIX&lt;/a&gt;) that produces zero garbage. &lt;a href=&quot;http://www.coralblocks.com/index.php/2014/07/coralfix-performance-numbers/&quot; rel=&quot;nofollow&quot;&gt;Our benchmarks&lt;/a&gt; show that it is much faster than other FIX engines developed in C++.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt; I am one of the developers of CoralFIX&lt;/p&gt;&#xA;" OwnerUserId="11804" LastActivityDate="2014-11-18T19:19:18.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15523" PostTypeId="2" ParentId="15503" CreationDate="2014-11-18T20:52:07.060" Score="2" Body="&lt;p&gt;Given that you have swap rates and Cap prices (ATM, I assume), you can back out the IVs for the time periods using by bootstrapping. Strictly speaking, you would need Caplet prices for the given strikes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In such a case, &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You would look at the shortest dated cap and (assume) it is made up of only one caplet. &lt;/li&gt;&#xA;&lt;li&gt;You can then use black's formula and back out the IV for this price. &lt;/li&gt;&#xA;&lt;li&gt;Once this is fixed, we move on to the next cap. This cap is again broken down in to two caplets (say), where the IV for the first caplet is as calculated in step 2 and the caplet is re-priced for the new strike. &lt;/li&gt;&#xA;&lt;li&gt;Now that you have the Cap price, the first caplet price, you can back out the price of the remaining caplet and use that to back out the IV for the second period. &lt;/li&gt;&#xA;&lt;li&gt;This method is repeated till the longest dated cap.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;for in between terms, you can assume the IV to be constant (piece-wise constant volatility) or some form of interpolation.&lt;/p&gt;&#xA;" OwnerUserId="13610" LastActivityDate="2014-11-18T20:52:07.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15524" PostTypeId="2" ParentId="15506" CreationDate="2014-11-18T21:20:21.163" Score="1" Body="&lt;p&gt;I am guessing that the argument is as follows. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;They certainly have the same value at time t since they are both worth $S_t$ then.&#xA;If they have the same value at $t$ they should have the same value at time $0.$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if we are pricing by expectation our measure has to give the same discounted expectation price to both portfolios. So we must have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;e^{-rT} E( S_T) = e^{-rT} E(e^{r(T-t)}S_t)&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2014-11-18T21:20:21.163" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15525" PostTypeId="1" AcceptedAnswerId="15528" CreationDate="2014-11-18T21:57:47.253" Score="1" ViewCount="116" Body="&lt;p&gt;Why does implied volatility usually fall when underlying rises and rises when underlying falls?&#xA;Implied volatility is a length of one standard deviation. From this definition, is it possible without using BSM model to intuit why IV shares an inverse relationship with underlying&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2014-11-19T07:59:28.397" Title="Why IV shares an inverse relationship with underlying" Tags="&lt;implied-volatility&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15526" PostTypeId="2" ParentId="15525" CreationDate="2014-11-19T01:12:01.307" Score="0" Body="&lt;p&gt;think of option as an insurance and the cost of the insurance as IV. when the market goes down, investors would buy puts which drives IV up. When market goes up, ppl would exit the puts position, which is a declining demand. IV goes down.&lt;/p&gt;&#xA;" OwnerUserId="12088" LastActivityDate="2014-11-19T01:12:01.307" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15528" PostTypeId="2" ParentId="15525" CreationDate="2014-11-19T07:59:28.397" Score="0" Body="&lt;p&gt;In index, where the skew is more pronounced, with focus on moves of say 2-3%, when they are down it is more likely they are fast, whereas if they are up, it is more likely that they are slow. For that reason, when you move down you expect the uncertainty (measured by IV) to raise, whereas if you go up you expect it to decrease.&lt;/p&gt;&#xA;" OwnerUserId="13480" LastActivityDate="2014-11-19T07:59:28.397" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15529" PostTypeId="2" ParentId="15453" CreationDate="2014-11-19T12:59:38.350" Score="1" Body="&lt;p&gt;Once upon a time, there was the One Curve. It was made of various instruments (Depos, Fixings, Futures, Swaps) and represented the One True Discount Rate for any given term. With that curve, and an appropriate interpolation method, it made sense to talk about expensive days, the curve up to 3m, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But that world is long gone. When you create a 3m curve now, you are really trying to calculate expectations of the 3m fixing from your 3m-specific instruments (3m Fixing, FRAs or Futures with adjustment, 3m Swaps), given a known discount curve (built from the instruments specific to the measure, i.e. EONIA for vanilla contracts). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what does that portion of the curve you are constructing really mean? What is the 1w point on a 3m curve? It doesn't matter. It only matters what the 1w to 1w+3m ratio is, because that's what gives you the expectation of the fixing. Or better yet, dispense with factors and make a fixing expectations curve in rate terms, rather than factors.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2014-11-19T12:59:38.350" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15530" PostTypeId="1" CreationDate="2014-11-19T14:05:07.317" Score="3" ViewCount="924" Body="&lt;p&gt;I am trying to build a test for a long/short portfolio. I am aiming for market neutral and have put together a long portfolio as well as a short portfolio (see below). However, I am not sure if I am doing this correctly. The specific questions I have are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Will betas be negative for the short book?&lt;/li&gt;&#xA;&lt;li&gt;How would I calculate returns for the L/S portfolio&lt;/li&gt;&#xA;&lt;li&gt;How would you factor in margin/borrowing costs in a model like this?&lt;/li&gt;&#xA;&lt;li&gt;Is there a different way that I need to calculate sharpe ratio since this is a L/S portfolio&lt;/li&gt;&#xA;&lt;li&gt;How should I use the benchmark (I have read elsewhere that the benchmark should be long for the long portfolio, short the same benchmark for the short portfolio, and then long a cash investment)?&lt;/li&gt;&#xA;&lt;li&gt;Is there anything else that I should be considering here?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Nobp5.png&quot; alt=&quot;Longs&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/VFvBw.png&quot; alt=&quot;Shorts&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/d8ktC.png&quot; alt=&quot;Metrics&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="11926" LastActivityDate="2015-04-30T01:13:08.030" Title="Calculation of Returns and Risk Metrics for L/S Portfolio" Tags="&lt;backtesting&gt;&lt;longshort&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15531" PostTypeId="1" CreationDate="2014-11-19T14:39:16.830" Score="1" ViewCount="982" Body="&lt;p&gt;I would like to calculate a daily total return index for the EURIBOR 3M.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;•   Should I freeze at the beginning of each qurter die rate? (With this methology the developing of the index depends on the start point)&#xA;•   Or should I take the everyday the actual rate?&#xA;•   How would you partion the 3 month rate. Rate/365 or (1+rate)^(1/365)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards&#xA;Umit&lt;/p&gt;&#xA;" OwnerUserId="13614" LastActivityDate="2014-12-20T11:12:11.967" Title="Total return index for interest rates (EURIBOR 3M)" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;index&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15532" PostTypeId="2" ParentId="15099" CreationDate="2014-11-19T15:42:18.133" Score="10" Body="&lt;p&gt;Very simply, Ross' framework assumes a great deal to extract the true pricing kernel. Time homogeneity, additively separable state dependent utility, (discrete time Markovian structure - though these have been relaxed.) In particular, there are two schools of criticism, one is that time homogeneity makes little sense in the real market. In fact, the Recovery Theorem would interpret a declining term structure of volatility as a form of mean reversion - if you want to test this calibrate a time homogeneous process to one with time dependent and decreasing volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other school of criticism is that the utility function assumed by Ross is transition independent, namely if the preferences of the market were correctly aggregated (he assumes the existence of a representative agent) then they would only depend on the final state, the initial state and the path would not enter (except as trivial normalizations.) This is the key to HBS (2014)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, Ross' result is a direct consequence of a result by Hansen-Scheinkman which shows that under much more relaxed conditions (non additively separable utility, stochastic volatility) the stochastic discount factor has Ross' structure under a Long Run measure. Which means if Ross' assumptions dont hold (but time homogeneity does) then Ross' procedure actually extracts the long-run measure of HS (upto a multiplicative order).&lt;/p&gt;&#xA;" OwnerUserId="13415" LastActivityDate="2014-11-19T15:42:18.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15533" PostTypeId="1" CreationDate="2014-11-19T18:19:58.877" Score="1" ViewCount="1136" Body="&lt;p&gt;It is known that the price of an European call of maturity $T^*$ on zero-coupon of maturity $T$ is given by &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$p(0,T)= B(0,T^*)\mathbb E ^{\mathbb Q_{T^*}}\left[ (B(T^*,T)-K)^+\right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $B(0,T)$ is the zero-coupon value at time $0 $ of maturity $T$ and $\mathbb Q_{T^*}$ is forward risk neutral measure.&#xA;It's also known that $B(t_1,T_2)= e^{-(t_2-t_1)R_{t_2}(t_1)}$ what let me to the question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to calculate this price having the yield curve as the only input data ?&lt;/p&gt;&#xA;" OwnerUserId="3534" LastEditorUserId="2587" LastEditDate="2015-01-19T18:20:58.927" LastActivityDate="2015-02-18T19:17:31.393" Title="How to price an European call on zero-coupon from the yield curve?" Tags="&lt;option-pricing&gt;&lt;bond&gt;&lt;yield-curve&gt;&lt;call&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15535" PostTypeId="1" AcceptedAnswerId="15536" CreationDate="2014-11-19T18:53:04.257" Score="1" ViewCount="907" Body="&lt;p&gt;how do I calculate ZSpread for a govt. bond in a multiple curve framework? I have not come across the exact details anywhere so I want to verify if I'm right. Below is my understanding, please correct me if I'm wrong:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Specify a discounting curve and a forecasting curve.&lt;/li&gt;&#xA;&lt;li&gt;Using the above two curves, calculate the Zero Coupon Swap Rate for several maturities. &lt;/li&gt;&#xA;&lt;li&gt;Estimate the parallel shift required to the above Zero Coupon Swap Curve to match the bond price in the market. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This parallel shift is the bond's ZSpread with respect to the specified discounting and forecasting curves. Depending on the set of curves specified, each bond can have multiple ZSpreads.&lt;/p&gt;&#xA;" OwnerUserId="7117" LastActivityDate="2014-11-19T20:15:34.587" Title="ZSpread in multiple curve framework" Tags="&lt;bond&gt;&lt;spread&gt;&lt;multicurve&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15536" PostTypeId="2" ParentId="15535" CreationDate="2014-11-19T20:15:34.587" Score="1" Body="&lt;p&gt;The math is actually simpler than what you proposed. Z-Spread is always computed as the parallel shift in a zero curve required so as to reprice the cash flows to a bond's cash flows; i.e., you solve for the $s$ in&#xA;$$ P + AI = \sum_{i=1}^N c_i \cdot d(t_i) \cdot e^{-t_i \times s} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the multi-curve world, you simply compute both the LIBOR OAS and OIS OAS separately. To compute the LIBOR OAS, you plug the pseudo-LIBOR discount factors into the $d(t_i)$'s above; and to compete OIS OAS, you plug the OIS discount factors into $d(t_i)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since z-spreads are not tradable, they're used mostly as relative value metrics. The key is internal consistency.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2014-11-19T20:15:34.587" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15538" PostTypeId="1" AcceptedAnswerId="15539" CreationDate="2014-11-19T23:17:57.423" Score="1" ViewCount="208" Body="&lt;p&gt;I cant seem to find a straight answer anywhere on Google for this.  I would like to create a master list of all known mutual funds and their ticker symbol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to get this data from Edgar's FTP?  Is there a particular form that registered investment companies have to file that would have this information that I could crawl the Edgar index for?&lt;/p&gt;&#xA;" OwnerUserId="13619" LastEditorUserId="467" LastEditDate="2014-11-20T00:58:31.687" LastActivityDate="2014-11-20T01:11:01.917" Title="Where to get master list of mutual funds?" Tags="&lt;mutual-fund&gt;&lt;ftp&gt;&lt;edgar&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15539" PostTypeId="2" ParentId="15538" CreationDate="2014-11-20T01:07:04.550" Score="2" Body="&lt;p&gt;There is little chance that you find a single database that holds &lt;strong&gt;all&lt;/strong&gt; the mutual funds in the world, especially for free.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some companies made a business out of this, such as &lt;a href=&quot;http://www.morningstar.com/&quot; rel=&quot;nofollow&quot;&gt;Morningstar&lt;/a&gt;. They will also provide you with the prospectus, historical data when available, and other useful information. But obviously you'll have to pay for that.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2014-11-20T01:07:04.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15540" PostTypeId="2" ParentId="15538" CreationDate="2014-11-20T01:11:01.917" Score="0" Body="&lt;p&gt;If you are interested in using &lt;code&gt;Yahoo Finance&lt;/code&gt; then you can download this spreadsheet which currently contains approximately &lt;code&gt;4919 Mutual Funds&lt;/code&gt; &amp;amp; their &lt;code&gt;Tickers&lt;/code&gt;. hope it helps: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://investexcel.net/all-yahoo-finance-stock-tickers/&quot; rel=&quot;nofollow&quot;&gt;http://investexcel.net/all-yahoo-finance-stock-tickers/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11814" LastActivityDate="2014-11-20T01:11:01.917" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15541" PostTypeId="2" ParentId="15533" CreationDate="2014-11-20T01:20:59.020" Score="0" Body="&lt;p&gt;I think the yield curve is not what you need here. The idea is to have a model for the dynamics of the bond process $dB(t,T)$ (which you can compute by having dynamics for short-term interest rate $dr_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A common assumption is to use &lt;a href=&quot;http://en.wikipedia.org/wiki/Black_model&quot; rel=&quot;nofollow&quot;&gt;Black 76 model&lt;/a&gt; with $F = B(0,T)$ if I remember well. You will also need to know the volatility $\sigma$ of your bond prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Filipovic's &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/3540097260&quot; rel=&quot;nofollow&quot;&gt;book&lt;/a&gt; is an excellent reference for this (and much more).&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2014-11-20T01:20:59.020" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15542" PostTypeId="2" ParentId="7826" CreationDate="2014-11-20T02:46:21.407" Score="1" Body="&lt;p&gt;It does create a see-saw. This can be reduced by having it charge a slightly bigger spread, which gets contributed to &lt;em&gt;b&lt;/em&gt;. In this way, &lt;em&gt;b&lt;/em&gt; effectively becomes a market making fund, and volatility decreases as trade volume increases. This makes the LMSR market maker liquidity sensitive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This makes the market more efficient as spreads decrease over time as trading imparts price knowledge and subsidizes liquidity.&lt;/p&gt;&#xA;" OwnerUserId="13621" LastActivityDate="2014-11-20T02:46:21.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15543" PostTypeId="1" AcceptedAnswerId="15544" CreationDate="2014-11-20T03:59:03.430" Score="2" ViewCount="153" Body="&lt;p&gt;The exercise is to show $C(K_1) \geq C(K_2)$ where C(K) denotes the value of a call option on a stock price S with strike price K. We assume the expiry is the same for both.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have proved this by assuming the contrary ($C(K_2) &amp;gt; C(K_1)$) and then shown it creates an arbitrage opportunity. My argument is similar to the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/EBWXX.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What i don't understand is why the original statement includes the equality. In the case where $C(K_1) = C(K_2)$ we would still have the same cashflows at the expiry, while the cashflow would be zero at time 0. In other words there is possible to make money without losing any . The only thing I can think of is that this doesn't hold if there are trading costs but in that case, depending on the trading costs it wouldn't hold for the strict inequality where the cashflows were smaller than the trading costs either.&lt;/p&gt;&#xA;" OwnerUserId="13622" LastEditorUserId="13622" LastEditDate="2014-11-20T04:14:06.347" LastActivityDate="2014-11-20T04:57:39.713" Title="When $C(K_2) = C(K_1)$ for call options with the same expiration date" Tags="&lt;options&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15544" PostTypeId="2" ParentId="15543" CreationDate="2014-11-20T04:57:39.713" Score="5" Body="&lt;p&gt;If both options are out of the money and volatility is zero then both are worth zero. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there is a positive probability that the lower strike option pays off then the inequality is indeed strict.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2014-11-20T04:57:39.713" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15545" PostTypeId="1" AcceptedAnswerId="15546" CreationDate="2014-11-20T10:01:32.723" Score="0" ViewCount="1178" Body="&lt;p&gt;Interest rate time series seems to be non-stationary whenever test is performed&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But covariance or correlation matrix is derived from term structure time series which are non stationary and later PCA is performed on that covariance or correlation matrix. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it appropriate to derive Covariance or correlation matrix from non stationary series and use it for PCA?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Applying Kalman filter on term structure of interest rates is any better than PCA?&lt;/p&gt;&#xA;" OwnerUserId="7422" LastActivityDate="2014-11-20T10:06:49.103" Title="PCA on term structure of interest rates" Tags="&lt;pca&gt;&lt;correlation-matrix&gt;&lt;covariance-matrix&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15546" PostTypeId="2" ParentId="15545" CreationDate="2014-11-20T10:06:49.103" Score="2" Body="&lt;p&gt;If you look at changes of the points on the yield curve, then you probably find something stationary - right? Applying PCA on the covariance of these changes makes sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. you will find out that on PC describes a parallel shift (a change in the yield curve). Look at this question too: &lt;a href=&quot;https://quant.stackexchange.com/questions/7202/what-do-eigenvalues-eigenvectors-of-the-yield-forward-rates-covariance-matrices/7204#7204&quot;&gt;What do eigenvalues/eigenvectors of the yield/forward rates covariance matrices mean?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2014-11-20T10:06:49.103" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15547" PostTypeId="2" ParentId="15531" CreationDate="2014-11-20T10:48:16.683" Score="1" Body="&lt;p&gt;I don't do TRI, so I may be wide of the mark, but: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Euribor is not an instrument. It originated as a fixing to reflect the cost of borrowing for a term (here 3m) in the interbank market. But it is not an instrument, so there is no return to reinvest, nor an instrument to reinvest in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instruments that do depend on 3m Euribor are FRAs, Futures, IRS, and then some less liquid ones like swap-futures, CMS. But they are generally Par instruments, so they will generally net zero (adjusted for collateralisation), unlike a share or other yielding instrument. FRAs don't trade for Spot after the fix, and don't represent a thing that yields a later cashflow after the start date of the FRA. Futures are already a thing. I think the closest thing is a CMS, but that is already pretty much what you'd be making the TRI for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're less wedded to the Euribor fixings and more to the interest rate side, then look at the OIS market - an OIS is intended to reflect a deposit rolled overnight and accrued at the Overnight fixing over a given period; the OIS fixed rate is thus the fair fix based on market expectations of the Overnight fixing for a term.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could perhaps compound up the Overnight fixing every night and give the result as an index number, but it's fairly pointless since there is already (a) a very liquid market in OIS themselves, (b) a general assumption that the Overnight is the risk free rate, so the index is essentially just tracking the unit in which everything is already denominated and (c) no need to construct another index on something widely understood and modelled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are you trying to achieve? Have I missed something?&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2014-11-20T10:48:16.683" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15548" PostTypeId="1" AcceptedAnswerId="15954" CreationDate="2014-11-20T11:09:35.597" Score="5" ViewCount="1235" Body="&lt;p&gt;I am currently studying the Libor forward market model, and although I get the mechanics behind the main arguments, I still do not have an intuitive idea of what's exactly the objective behind changing the numeraire to obtain the desired dynamics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why do we need to do this so that the dynamics of the forward rate make sense? Or, if we put it from a different angle: if this numeraire change would not &quot;exist&quot;, what could we not achieve exactly in this model?&lt;/p&gt;&#xA;" OwnerUserId="13457" LastActivityDate="2014-12-23T10:34:13.083" Title="Libor Market Model: numeraire change" Tags="&lt;stochastic-calculus&gt;&lt;libor&gt;&lt;market-model&gt;&lt;numerairechange&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15549" PostTypeId="1" CreationDate="2014-11-20T11:17:29.863" Score="-2" ViewCount="5095" Body="&lt;p&gt;are there any existing python modules that can calculate Modified and/or Macauley Duration of a bond.&lt;/p&gt;&#xA;" OwnerUserId="7519" LastActivityDate="2021-02-07T22:53:05.843" Title="Modified or Macauley Duration in python" Tags="&lt;bond&gt;&lt;duration&gt;&lt;python&gt;" AnswerCount="5" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15551" PostTypeId="1" CreationDate="2014-11-20T13:06:06.857" Score="7" ViewCount="921" Body="&lt;p&gt;My understanding of VaR model back testing is thus:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;~~&lt;/p&gt;&#xA;&#xA;&lt;p&gt;t: Calculate daily VaR using look back data over n past days&lt;/p&gt;&#xA;&#xA;&lt;p&gt;t+1: Compare daily return against VaR, record breach if one occurred, repeat&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apply conditional and unconditional tests to back test the VaR model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;~~&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is the danger of VaR look back periods overlapping.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the above case adjacent VaRs use n-1 days of the same data; much reducing the independence of our back test sample.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have read a few papers on VaR and none point to this issue - is it just me or is there nothing to worry about here?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps the conditional tests control for this somewhat, as they should spot clustering of breaches - but surely this would be less of an issue if the data used in the back tests are mutually exclusive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I have read previous questions posted and none directly asked this question, thought it was worth a shot!)&lt;/p&gt;&#xA;" OwnerUserId="7682" LastEditorUserId="7682" LastEditDate="2014-11-20T13:13:17.313" LastActivityDate="2015-01-19T21:51:58.803" Title="Overlapping Value-at-Risk Backtest Data an Issue?" Tags="&lt;backtesting&gt;&lt;value-at-risk&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15552" PostTypeId="1" CreationDate="2014-11-20T13:50:57.083" Score="1" ViewCount="628" Body="&lt;p&gt;Assuming the dynamics of the exchange rate between two currencies at time $t$ is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dX_t=\Delta r X_t dt+ σ X_t dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the FX Reverse process $\frac{1}{X_t}$ a brownian motion?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can Ito's Lemma be applied to prove that?&lt;/p&gt;&#xA;" OwnerUserId="13524" LastEditorUserId="467" LastEditDate="2014-11-21T00:58:02.493" LastActivityDate="2015-04-01T18:29:04.410" Title="What are the dynamics of the reverse of this FX process?" Tags="&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15553" PostTypeId="2" ParentId="15552" CreationDate="2014-11-20T15:20:15.543" Score="3" Body="&lt;p&gt;Well, if you assume Fx is a Brownian Motion $W_t$ then $\frac{1}{X_t} = -\frac{1}{X^2_t} \bullet X_t + \frac{1}{X^3_t} \bullet \langle X\rangle_t = -\frac{1}{X^2_t} \bullet X_t + \frac{1}{X^3_t} \bullet \sigma^2 X^2_t t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So $d\bigl(\frac{1}{X_t}\bigr) = -\frac{1}{X_t} [(\Delta r + \sigma^2 ) dt + \sigma dW_t ]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Setting $\frac{1}{X_t} = M_t$, we see it is not a Brownian Motion, but a &lt;strong&gt;Geometric Brownian Motion&lt;/strong&gt;. I think thats the proof you were asked.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is Yor's notation where $H \bullet X = \int H dX_s$&lt;/p&gt;&#xA;" OwnerUserId="13415" LastEditorUserId="13415" LastEditDate="2015-04-01T18:29:04.410" LastActivityDate="2015-04-01T18:29:04.410" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15554" PostTypeId="2" ParentId="15551" CreationDate="2014-11-20T20:31:53.127" Score="2" Body="&lt;p&gt;When you backtest VaR, you are essentially backtesting your model. &#xA;You are essentially saying: &quot;If I had this model back in 2007, what would be its calculated VaR?&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The model is tested given all available information up to that time. A good model will adapt given new data and the VaR will change after an extreme event. Even one data point should make a difference. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, I do not see a problem with using overlapping historical periods. &lt;/p&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2014-11-20T20:31:53.127" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15555" PostTypeId="1" CreationDate="2014-11-20T22:43:14.077" Score="0" ViewCount="338" Body="&lt;p&gt;I would like to download (from Google) the most recent prices for a series of stocks. I have created a portfolio at Google and I can click on &quot;Download to Spreadsheet&quot;.  That works.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I would like to automate the process so that I can obtain the spreadsheet using R.  I did this previously from Yahoo with the code:&#xA;  read.csv(&quot;&lt;a href=&quot;http://finance.yahoo.com/quotes/DRRX,AAPL,AMZN&quot; rel=&quot;nofollow&quot;&gt;http://finance.yahoo.com/quotes/DRRX,AAPL,AMZN&lt;/a&gt;&quot;)&#xA;However, I can't figure out the comparable code to download from Google.&#xA;Any help would be appreciated.  &lt;/p&gt;&#xA;" OwnerUserId="13630" LastActivityDate="2014-12-21T20:16:48.170" Title="Downloading most recent stock prices" Tags="&lt;equities&gt;&lt;quote&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15556" PostTypeId="2" ParentId="15548" CreationDate="2014-11-20T22:52:34.990" Score="2" Body="&lt;p&gt;Different measures have different properties. Using a particular measure may make it easy to derive an analytic formula since a rate is driftless. When performing Monte Carlo, the sign of the drifts changes with measure which affects convergence. There is also the problem in the terminal measure that the numeraire can get very small and so some paths can lead to very large values. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially, it comes down to convenience. I have extensive discussion of these points in &quot;more mathematical finance.&quot;&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2014-11-20T22:52:34.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15557" PostTypeId="2" ParentId="15555" CreationDate="2014-11-20T23:15:37.910" Score="1" Body="&lt;p&gt;R is very useful for downloading data from &lt;code&gt;Yahoo/Google&lt;/code&gt; . Here is an example for downloading from &lt;code&gt;Google Finance&lt;/code&gt; :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quantmod)&#xA;&#xA;getSymbols(&quot;DRRX;AAPL;AMZN&quot;, from=&quot;2014-01-01&quot;, to=&quot;2014-11-20&quot;, src='google')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Just adjust the &lt;code&gt;from&lt;/code&gt; and &lt;code&gt;to&lt;/code&gt; dates as needed. This will download the &lt;code&gt;OHLCV&lt;/code&gt; data from google finance to your R global environment.&lt;/p&gt;&#xA;" OwnerUserId="11814" LastActivityDate="2014-11-20T23:15:37.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15559" PostTypeId="1" AcceptedAnswerId="15566" CreationDate="2014-11-21T01:43:32.977" Score="5" ViewCount="3776" Body="&lt;p&gt;Why is the gamma for an at the money option less when volatility increases.&#xA;Intuitively ,I thought that increasing volatility means more uncertainty,hence the option price will be more sensitive to the underlying price. Hence more volTility in my mind would mean a higher gamma for ATM option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the reverse is true. What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="218" LastEditorUserId="13462" LastEditDate="2014-11-21T13:44:52.570" LastActivityDate="2019-04-21T00:14:48.420" Title="Why gamma for ATM option decreases as volatility increases" Tags="&lt;option-pricing&gt;&lt;greeks&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15560" PostTypeId="1" AcceptedAnswerId="16391" CreationDate="2014-11-21T02:02:00.353" Score="0" ViewCount="256" Body="&lt;p&gt;CUSIP is a 9 character long identifier. The last digit is a check sum checking the first 8 previous characters. This seems to me that it is not possible for two securities to have the same 8 characters and different check sum. I know this is not exactly quantitative, but I haven't found a forum where I could ask.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;a href=&quot;https://www.cusip.com/cusip/index.htm&quot; rel=&quot;nofollow&quot;&gt;https://www.cusip.com/cusip/index.htm&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2685" LastActivityDate="2015-01-29T15:39:29.393" Title="Is it possible for two securities to have the same first 8 characters of a cusip, but differ in the check sum?" Tags="&lt;fixed-income&gt;&lt;finance&gt;&lt;banking-regulations&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15561" PostTypeId="1" AcceptedAnswerId="15562" CreationDate="2014-11-21T03:16:25.523" Score="0" ViewCount="123" Body="&lt;p&gt;What topics in statistics and mathematics do I need to understand thoroughly before I can start to dabble with stochastic volatility models and volatility arbitrage?&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2014-11-21T06:08:45.293" Title="What math concepts are used in designing volatility models" Tags="&lt;volatility&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15562" PostTypeId="2" ParentId="15561" CreationDate="2014-11-21T06:08:45.293" Score="2" Body="&lt;p&gt;Calculus, differential equations, linear algebra, and probability.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That will be enough to understand popular textbooks on the subject intended for upper-level undergraduates or first-year graduate students. To understand the research literature you will also need stochastic processes, stochastic calculus, real analysis, and potentially PDE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many other areas of applied math are relevant to more specific applications, for instance optimization and numerical methods.&lt;/p&gt;&#xA;" OwnerUserId="3398" LastActivityDate="2014-11-21T06:08:45.293" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15563" PostTypeId="2" ParentId="15115" CreationDate="2014-11-21T10:28:50.923" Score="3" Body="&lt;p&gt;Intuitively put you can say that volatility is the &lt;em&gt;within variation&lt;/em&gt; and beta is the &lt;em&gt;between variation&lt;/em&gt;. &lt;em&gt;Within&lt;/em&gt; means the variation that A has &lt;em&gt;within&lt;/em&gt; its own time-series, whereas &lt;em&gt;between&lt;/em&gt; means &lt;em&gt;between&lt;/em&gt; A and the index.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2014-11-21T10:28:50.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15564" PostTypeId="2" ParentId="15559" CreationDate="2014-11-21T13:38:13.117" Score="5" Body="&lt;p&gt;Victor123, let's start from $\Delta$. This is the expected change in the price of an option if the underlying asset moves by a currency unit, say 1 USD. For the case of a call option, the Delta varies between 0 and 1. Everything else been equal, the Delta of OTM calls will approach to 0 as the price moves out of the target barrier. Conversely for the case where ITM, Delta will approach to 1. It is thus safe to assume that the delta of an ATM option (i.e $S=K$) equals around 0.5. Relaxing any language formalisms, we can say that at the ATM point, the Stock has around 50% chance of going up or down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The $\Gamma$ of an option, shows the Delta's sensitivity to changes in the price of the underlying -or how volatile the option is relative to the underlying asset movements. Following the above, given that the expiration doesn't change, ATM options exhibit maximum Gamma value which washes out as we move away from $K$.&lt;/p&gt;&#xA;" OwnerUserId="13462" LastActivityDate="2014-11-21T13:38:13.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15565" PostTypeId="1" CreationDate="2014-11-21T16:31:41.833" Score="0" ViewCount="109" Body="&lt;p&gt;$$ (1) \ \ d\left(\frac{1}{S_t}\right) =\frac{1}{S_t}\left(\sigma^2-r\right)dt +\frac{1}{S_t}\sigma dW_t $$&#xA;and &#xA;$$ (2) \ \ dS_t = S_t rdt + \sigma S_t  dW_t $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can you prove that?&lt;/p&gt;&#xA;" OwnerUserId="13504" LastEditorUserId="13462" LastEditDate="2014-11-23T14:40:52.470" LastActivityDate="2014-11-24T08:20:46.417" Title="Is the volatility for these two SDEs the same" Tags="&lt;volatility&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15566" PostTypeId="2" ParentId="15559" CreationDate="2014-11-21T16:35:40.957" Score="11" Body="&lt;p&gt;Think of moving volatility in the other direction.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As volatility approaches zero, any call strike strictly smaller than the ATM strike, $K&amp;lt;K_{ATM}$, will have zero probability of ending in the money, and the corresponding option value will be zero.  An infinitesimally small change in stock price will not move $K$ past $K_{ATM}$, so the option value remains zero nearby.  Thus, the sensitivity is zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly for $K&amp;gt;K_{ATM}$, all options end up in the money, so the $\Gamma$ is also zero (though for the ITM options $\Delta=1$ rather than 0, ignoring interest and dividend rates).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Only strikes very close to $ATM$ have any likelihood of changing between $\Delta=0$ and $\Delta=1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, note that that $\Gamma = \frac{\partial}{\partial S}\Delta$ for any volatility.  Furthermore, for a call $\Delta(S) \rightarrow 1$ as $ S \rightarrow \infty$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\int_0^\infty \Gamma(S) dS = 1&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is to say, the area under the gamma curve is always 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In high-volatility cases, the $\Gamma$ is &quot;spread out&quot; over a wide range of $S$, so it never gets very big yet adds up to 1.  When volatility is low, the $\Gamma$ is all concentrated near $K_{ATM}$ so it has to get very big.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We conclude that as volatility increases, $\Gamma$ decreases near $K_{ATM}$ and increases for other strikes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(This is a more formal version of SolitonK's answer, which I have upvoted)&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2014-11-21T16:35:40.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15568" PostTypeId="2" ParentId="8227" CreationDate="2014-11-21T16:51:46.793" Score="0" Body="&lt;p&gt;If you want a really intuitive answer, I thought of two things to explain the key idea:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a Masters student point of view:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume $\xi \sim N(0, \sigma^2)$, prove that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb{E}[f(\xi)\xi] = \sigma^2 \mathbb{E}[f'(\xi)] = \mathbb{E}[\xi^2]\mathbb{E}[f'(\xi)]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A more intuitive financial explanation may go like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider you have a binary option, with payout as shown below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/JASRN.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially taking a finite difference (red) ends up creating massive problems at the discontinuity, which may make perturbing the underlying density of the stock price the correct idea. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Its simple but may provide basic intuition.&lt;/p&gt;&#xA;" OwnerUserId="13415" LastEditorUserId="13415" LastEditDate="2014-11-21T19:00:56.670" LastActivityDate="2014-11-21T19:00:56.670" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15569" PostTypeId="1" AcceptedAnswerId="15581" CreationDate="2014-11-21T18:04:03.333" Score="1" ViewCount="318" Body="&lt;p&gt;Let us say I want to pursue a pair trading strategy between stock A(long) and stock B(short).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I replace this stocks with their synthetic option equivalents and have the same risk reward profile as if I had bought and shorted the actual underlying?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i.e Is the synthetic equivalent exactly equal to the underlying position? &lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2014-11-22T09:25:05.577" Title="use synthetics for a pairs trading strategy" Tags="&lt;pairs-trading&gt;&lt;synthetic&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15571" PostTypeId="1" CreationDate="2014-11-21T18:52:40.747" Score="0" ViewCount="779" Body="&lt;p&gt;Let St = Fx and St(Inverse) = 1/Fx.&#xA;Do both of these have same volatility and if so how would you prove it?&lt;/p&gt;&#xA;" OwnerUserId="13504" LastActivityDate="2014-11-21T18:52:40.747" Title="Is the Volatility of the Fx Inverse process same as Fx" Tags="&lt;fx&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15573" PostTypeId="2" ParentId="15555" CreationDate="2014-11-21T19:52:25.130" Score="0" Body="&lt;p&gt;I explored this further and following that the following works:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;require(&quot;RCurl&quot;)&#xA;STOCKS &amp;lt;- paste(&quot;AAPL&quot;, &quot;BIDU&quot;, &quot;AMAZ&quot;, collapse=&quot;,&quot;)&#xA;STRING  &amp;lt;- paste0(&quot;&lt;a href=&quot;http://finance.google.com/finance/info?client=ig&amp;amp;q=INDU,IXIC,DRRX&quot; rel=&quot;nofollow&quot;&gt;http://finance.google.com/finance/info?client=ig&amp;amp;q=INDU,IXIC,DRRX&lt;/a&gt;,&quot;, paste0(STOCKS, collapse=&quot;,&quot;))&#xA;TEMP    &amp;lt;- getURL(STRING)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, one needs to do some editing (a combination of strsplit and gsub) on the output.&lt;/p&gt;&#xA;" OwnerUserId="13630" LastActivityDate="2014-11-21T19:52:25.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15574" PostTypeId="1" AcceptedAnswerId="15577" CreationDate="2014-11-21T20:49:33.340" Score="0" ViewCount="109" Body="&lt;p&gt;I'm working through Shreve II, and on question 4.6, you are asked to compute &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d(S_t^p)$ where $S_t$ = $S_0e^{\sigma W_t + (\alpha - \frac{1}{2}\sigma^2)t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get the answer $pS_t^p[\sigma dW_t + (\alpha + \frac{1}{2}\sigma^2p - \sigma^2)dt]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;whereas the online solutions manual gets $pS_t^p[\sigma dW_t + (\alpha + \frac{1}{2}\sigma^2(p - 1)dt]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clarifying that either I or the author of the solution has made an error. Going through their solution, I believe they drop an expression containing $\sigma$ where they should not drop it. &lt;/p&gt;&#xA;" OwnerUserId="11919" LastActivityDate="2014-11-21T21:30:32.797" Title="Shreve book II Question 4.6 Error?" Tags="&lt;itos-lemma&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15576" PostTypeId="2" ParentId="15574" CreationDate="2014-11-21T21:18:14.270" Score="1" Body="&lt;p&gt;Shreve's answer is the correct one:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The drift term of $\frac{dS^p}{S^p}$ has two parts:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$p \left(\alpha - \frac{1}{2} \sigma^2 \right)$ from regular differentiation&lt;/li&gt;&#xA;&lt;li&gt;$\frac{1}{2} p^2 \sigma^2 $ is the Ito term. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;When you sum them up you get $p \left(\alpha + \frac{1}{2} (p-1) \sigma^2 \right)$&lt;/p&gt;&#xA;" OwnerUserId="13634" LastActivityDate="2014-11-21T21:18:14.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15577" PostTypeId="2" ParentId="15574" CreationDate="2014-11-21T21:19:49.780" Score="1" Body="&lt;p&gt;$$d(S^p) = pS^p (\alpha +\sigma dW) + \frac{1}{2}p(p-1)S^p\sigma^2 dt $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ = pS^p \left[ \left(\alpha +\frac{1}{2}\sigma^2(p-1)\right)dt + \sigma dW \right]$$&lt;/p&gt;&#xA;" OwnerUserId="8028" LastEditorUserId="8028" LastEditDate="2014-11-21T21:30:32.797" LastActivityDate="2014-11-21T21:30:32.797" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15578" PostTypeId="1" CreationDate="2014-11-21T22:32:10.683" Score="2" ViewCount="562" Body="&lt;p&gt;I'm trying to calculate implied volatility for the FTSE 100 for the last few years. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have all the end of day data from LIFFE for the last few years. I have combined the data by weighting the implied volatilities for each strike by their volume traded and distance from the underlying close price. I then took the mean of the put and strike composite IVs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, The way I am currently calculating the data, I am always using the nearest expiry, and then moving on to the next expiry the next day, which is leading me to some fairly strange numbers. For example the day before the september expiry, IV was 40%, but the next day, when I start using the october expiry, volatility was down to 9%, which is clearly not true. I'm not sure if I should be using more than one expiry to calculate a days composite IV.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what I get:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/H68Xa.png&quot; alt=&quot;Ftse 100 IV&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I would expect something a bit more like this:&#xA;&lt;a href=&quot;https://www.google.com/finance?chdnp=1&amp;amp;chdd=1&amp;amp;chds=1&amp;amp;chdv=1&amp;amp;chvs=maximized&amp;amp;chdeh=0&amp;amp;chfdeh=0&amp;amp;chdet=1416609064419&amp;amp;chddm=113953&amp;amp;chls=IntervalBasedLine&amp;amp;q=INDEXEURO:VFTSE&amp;amp;&amp;amp;ei=Jb1vVOuPJ-SDwAPu24DoDQ&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.google.com/finance?chdnp=1&amp;amp;chdd=1&amp;amp;chds=1&amp;amp;chdv=1&amp;amp;chvs=maximized&amp;amp;chdeh=0&amp;amp;chfdeh=0&amp;amp;chdet=1416609064419&amp;amp;chddm=113953&amp;amp;chls=IntervalBasedLine&amp;amp;q=INDEXEURO:VFTSE&amp;amp;&amp;amp;ei=Jb1vVOuPJ-SDwAPu24DoDQ&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="13635" LastActivityDate="2018-04-27T18:06:57.367" Title="Historical Implied Volatility Calculation" Tags="&lt;options&gt;&lt;implied-volatility&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15579" PostTypeId="1" CreationDate="2014-11-21T23:03:03.103" Score="0" ViewCount="98" Body="&lt;p&gt;My book assumes many times that $log(1+R)$ is normally distributed, so R is log-normal. But does this also mean that the value process is log-normal? Since $V=V_0(1+R)\rightarrow V/V_0=1+R$, and since $1+R$ is log-normal, $V/V_0$ is log-normal, so $log(V/V_0)=log(V)-log(V_0)$ is normal, and hence V is also log-normally distributed?&lt;/p&gt;&#xA;" OwnerUserId="11692" LastEditorUserId="12" LastEditDate="2014-12-22T13:34:53.863" LastActivityDate="2014-12-22T13:34:53.863" Title="Is the value also log-normally distributed?" Tags="&lt;returns&gt;&lt;distribution&gt;&lt;normal-distribution&gt;&lt;lognormal&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15580" PostTypeId="2" ParentId="15579" CreationDate="2014-11-22T08:37:19.817" Score="2" Body="&lt;p&gt;There are many ways answering this, here is one:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We assume the asset price at $t=T$, $S_T = S_{T-1} \times (S_T / S_{T-1})$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming continuous compounding, we can write, $S_T = S_{T-1} \times \exp(R_{T-1})$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Working the same way for the previous period, we get $S_{T} = S_{T-2} \times \exp(R_{T-1}+R_T)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Working all the way back to the initial value of the asset price, $S_0$, we have that: $S_T = S_0 \times \exp(R_1 + R_2 + ... + R_T)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dividing by $S_0$ and taking $\log$s yields: $\ln(S_T/S_0) = R_1 + R_2 + ... + R_T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, $(S_T/S_0)$, which is the return of the asset over the entire period, is lognormally distributed if  $R_1 + R_2 + ... + R_T$ is normally distributed. To arrive to the appropriate format of the lognormal distribution,and since $R$ is normally distributed, by $\exp$ing: $(S_T/S_0) = \exp(R_1 + R_2 + ... + R_T)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, to pose on another way, if we assume that prices are lognormally distributed (which could not always be the case), then $\log(1+R_t)$ is lognormally distributed.&lt;/p&gt;&#xA;" OwnerUserId="13462" LastEditorUserId="13462" LastEditDate="2014-11-22T11:06:07.630" LastActivityDate="2014-11-22T11:06:07.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15581" PostTypeId="2" ParentId="15569" CreationDate="2014-11-22T09:25:05.577" Score="0" Body="&lt;p&gt;This is very interesting. You probably can create synthetics for a pairs trading strategy however I believe that you need to consider the pros and cons. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pros: &#xA;1. You can create a short position if the stock is hard to borrow.&#xA;2. You do not need to worry for dividend payments when shorting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cons;&#xA;1. It can be a bit expensive (transactions/commissions)&#xA;2. What expiration to use? What if you expect the pair to revert in 30-days but it doesn't actually do until 60?&lt;/p&gt;&#xA;" OwnerUserId="13428" LastActivityDate="2014-11-22T09:25:05.577" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15582" PostTypeId="1" CreationDate="2014-11-22T14:25:58.587" Score="1" ViewCount="453" Body="&lt;p&gt;what volatility do we calculate using GARCH model,&#xA;Historical vol or Implied vol or Future Vol or Actual vol.&lt;/p&gt;&#xA;" OwnerUserId="9401" LastEditorUserId="13462" LastEditDate="2014-11-23T14:40:41.610" LastActivityDate="2014-11-23T14:40:41.610" Title="what volatility do we calculate using GARCH model" Tags="&lt;volatility&gt;&lt;quant-trading-strategies&gt;&lt;garch&gt;&lt;econometrics&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15583" PostTypeId="2" ParentId="15582" CreationDate="2014-11-22T14:34:52.250" Score="0" Body="&lt;p&gt;From my understanding I believe you will calculate conditional variance with GARCH. You would then need to take the square root of the variance to calculate the standard deviation/ volatility. One key aspect in GARCH is that you can calculate the  &quot;persistence&quot; , I.e. How likely is the asset to &quot;persist&quot; to its long run variance &lt;/p&gt;&#xA;" OwnerUserId="13428" LastActivityDate="2014-11-22T14:34:52.250" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15584" PostTypeId="2" ParentId="15582" CreationDate="2014-11-22T17:57:49.853" Score="2" Body="&lt;p&gt;In the case of application in finance, usually, GARCH is used in estimating realized volatility of returns based on the weight we would like to give to each past observation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ultimately after estimating (calibrating) the parameters of the model to an existing time-series, GARCH is used for forecasting multi-step ahead return (future) volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Different variants of the GARCH model exist  and the application of each one depends on the properties of the time-series to be examined. Some of them can be found &lt;a href=&quot;http://en.wikipedia.org/wiki/Autoregressive_conditional_heteroskedasticity&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13462" LastEditorUserId="13462" LastEditDate="2014-11-22T18:15:53.423" LastActivityDate="2014-11-22T18:15:53.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15585" PostTypeId="2" ParentId="15578" CreationDate="2014-11-22T18:39:04.773" Score="2" Body="&lt;p&gt;I'm not an equities guy so I don't know anything about volume-weighting, but if I was set this problem the approach that I would take would be to work out the implied volatility of each strike for that day, so that I have a graph of implied volatilty against strike, then interpolate on that graph to get the implied volatility for the ATM strike. Do that for every day and you have a time series of ATM implied vols. I hope that helps.&lt;/p&gt;&#xA;" OwnerUserId="13580" LastActivityDate="2014-11-22T18:39:04.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15586" PostTypeId="1" AcceptedAnswerId="15600" CreationDate="2014-11-22T19:26:46.080" Score="4" ViewCount="829" Body="&lt;p&gt;Both Black-Scholes and binomial model assume that there's no risk-free arbitrage in the market. But that sounds like a very weak condition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If a trading scheme makes you gain 100 dollars with 99% probability and lose 5 dollars with 1% probability (starting from 0), this is not risk free but it will be surprising if such an arbitrage opportunity exists without being exploited.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, either a) Black-Scholes does not make accurate predictions about the prices of derivatives, or b) statistical arbitrage of the type mentioned above does actually exist in the Black-Scholes Model. Which one of the two is correct?&lt;/p&gt;&#xA;" OwnerUserId="6400" LastEditorUserId="35673" LastEditDate="2019-04-01T17:24:45.817" LastActivityDate="2019-04-01T17:24:45.817" Title="Why doesn't Black-Scholes assume the absence of statistical arbitrage?" Tags="&lt;arbitrage&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="15587" PostTypeId="1" CreationDate="2014-11-22T20:00:41.377" Score="0" ViewCount="118" Body="&lt;p&gt;What is the reason that the vertical volatility skew graph(decreasing IV as the strikes increase) is the same for the puts and calls? The loose explanation is because of put call parity, but I am not able to find any more details. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for an explanation that makes sense intuitively.&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2014-11-23T09:16:01.790" Title="Why vertical skew is same for puts and calls" Tags="&lt;skew&gt;&lt;volatility-smile&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15589" PostTypeId="1" AcceptedAnswerId="15603" CreationDate="2014-11-22T20:22:54.957" Score="6" ViewCount="390" Body="&lt;p&gt;Let the portfolio be given by:&#xA;$$X=X_1+X_2$$&#xA;$(X_1,X_2)$ are dependent through a Copula function $C(u_1,u_2)$, such that the joint distribution is given by:&#xA;$$F(x_1,x_2)=C(F(x_1),F(x_2))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the VaR of this portfolio?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually VaR is the inverse quantile: $VaR_\alpha=F^{-1}_X(\alpha)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure how to determine it in this multivariate case?&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-11-24T12:55:10.287" LastActivityDate="2018-02-25T18:02:44.580" Title="Portfolio VaR with Copula?" Tags="&lt;copula&gt;&lt;value-at-risk&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15590" PostTypeId="2" ParentId="15291" CreationDate="2014-11-23T00:45:45.800" Score="4" Body="&lt;p&gt;There is a qualitative shift in the shape of the density. When V is small it is monotone decaying. When V is large it looks more like a Gaussian. Another reason he uses two schemes is that he wants match two moments of the density. When V is small, the moment matching equations for the quadratic Gaussian are unsolvable. When V is large they are unsolvable for the exponential form. Fortunately, the domain where both are solvable is non-empty and so there is always at least one available. It is then simply a question of when to transit from one to other. QE is probably the best short-stepping weak approximation. It is not so good for Greeks, however. (see &lt;a href=&quot;http://ssrn.com/abstract=1718102&quot; rel=&quot;nofollow&quot;&gt;http://ssrn.com/abstract=1718102&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2014-11-23T00:45:45.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15591" PostTypeId="1" AcceptedAnswerId="15601" CreationDate="2014-11-23T02:18:42.380" Score="1" ViewCount="123" Body="&lt;p&gt;We have index for stock market, like S&amp;amp;P500, Nikkei 225, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder if we have any index for hedge funds, private equity or venture capital?&lt;/p&gt;&#xA;" OwnerUserId="6461" LastActivityDate="2014-11-27T21:09:33.910" Title="Index for Hedge fund, Private Equity, Venture Capital" Tags="&lt;index&gt;&lt;hedge-fund&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15592" PostTypeId="1" CreationDate="2014-11-23T03:05:06.167" Score="0" ViewCount="371" Body="&lt;p&gt;Consider jump diffusion model proposed by Merton and Kou. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as i know, most paper only dealt the valuation of option under the jump diffusion model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As i expected, because of the incompleteness of model, implication of the Greeks is somewhat different from that of continuous model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am i right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why does not the literature on jump diffusion model derive the Greek such as delta?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, we have formulas for some exotic option under the jump diffusion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;then we can obtain the delta by differentiating option price with respect to the asset &lt;/p&gt;&#xA;&#xA;&lt;p&gt;price. Is it possible to conduct risk analysis using this delta formula?&lt;/p&gt;&#xA;" OwnerUserId="12093" LastActivityDate="2014-11-23T14:05:38.433" Title="Implication of the Greeks under jump diffusion model" Tags="&lt;option-pricing&gt;&lt;pricing&gt;&lt;hedging&gt;&lt;greeks&gt;&lt;pricing-formulae&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15593" PostTypeId="2" ParentId="15587" CreationDate="2014-11-23T09:16:01.790" Score="2" Body="&lt;p&gt;put call parity guarantees that the implied volatility of a call and put with the same strike is the same. So the smile graph is the same as well and so are all quantities derived for it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In more detail,&#xA;$$&#xA;C(K) = P(K) + F(K)&#xA;$$&#xA;The value of $F(K)$ is model independent and does not depend on volatility. So knowing the implied of $C(K)$ gives you the price of $P(K)$. The same implied vol will work for $P(K)$ since put-call parity works for all models so it must hold for the BS model with that vol. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2014-11-23T09:16:01.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15595" PostTypeId="1" AcceptedAnswerId="15598" CreationDate="2014-11-23T09:55:49.033" Score="0" ViewCount="1469" Body="&lt;p&gt;Here is how I am interpreting results of a Johansen Cointegration Test and Engel-Granger Test for A and B.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The results:(Using matlab)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;jcitest(Y)&#xA;&#xA;ans = &#xA;&#xA;      r0       r1   &#xA;t1    false    false&#xA;&#xA;&#xA;[h,pValue,stat,cValue] = egcitest(Y,'test',{'t1','t2'})&#xA;Warning: Sample size of the data&#xA;is more than the maximum size 10000&#xA;in the table of critical values.&#xA;Using critical value -3.3368 at&#xA;maximum size for the test. Compare&#xA;asymptotic critical value -3.3362. &#xA;&amp;gt; In egcitest&amp;gt;runTest at 1119&#xA;In egcitest at 413 &#xA;Warning: Sample size of the data&#xA;is more than the maximum size 10000&#xA;in the table of critical values.&#xA;Using critical value -20.5948 at&#xA;maximum size for the test. Compare&#xA;asymptotic critical value -20.6074. &#xA;&amp;gt; In egcitest&amp;gt;runTest at 1119&#xA;In egcitest at 413 &#xA;&#xA;h =&#xA;&#xA; 0     0&#xA;&#xA;&#xA;pValue =&#xA;&#xA;0.9897    0.9901&#xA;&#xA;&#xA;stat =&#xA;&#xA;0.0817    0.2153&#xA;&#xA;&#xA;cValue =&#xA;&#xA;  -3.3368  -20.5948&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From all the above I have drawn some conclusions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1- Cointegration exists&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2- With a high pValue, the cointegration relation is significant and &quot;could&quot; be used with a high confidence for forecasting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would be great if someone here can validate or tell me I am wrong. Learning this on my own is a bit tricky.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="7816" LastEditorUserId="13462" LastEditDate="2014-11-23T20:15:47.500" LastActivityDate="2017-02-02T08:15:47.173" Title="Cointegration results interpretation validation?" Tags="&lt;econometrics&gt;&lt;cointegration&gt;&lt;matlab&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15596" PostTypeId="2" ParentId="15565" CreationDate="2014-11-23T12:48:51.470" Score="0" Body="&lt;p&gt;We need to start from $(2)$. We start from Ito's Lemma which stipulates for the single variable case that: $$ \\ df(S_t) = f'(S_t)dS_t + \frac{1}{2}df''(S_t)Var[dS_t] $$ Setting $f=1/S_t$ yields: $$ \\ d\bigg(\frac{1}{S_t}\bigg) = -\frac{1}{(S_t)^2}dS_t+\frac{1}{2}\frac{2}{(S_t)^3}\sigma^2(S_t)^2Var[dW_t] \Rightarrow $$  $$\\d\bigg(\frac{1}{S_t}\bigg) = -\frac{1}{(S_t)^2}(S_trdt+\sigma S_tsW_t)+\frac{1}{2}\frac{2}{(S_t)^3}\sigma^2(S_t)^2Var[dW_t] $$ As $Var[dW_t] = dt$, after some algebra and common factoring we end up with: $$ \\ d\bigg(\frac{1}{S_t}\bigg) = \frac{1}{S_t}(\sigma^2 - r)dt - \frac{1}{S_t}\sigma dW_t$$&lt;/p&gt;&#xA;" OwnerUserId="13462" LastEditorUserId="13462" LastEditDate="2014-11-23T13:56:52.077" LastActivityDate="2014-11-23T13:56:52.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15597" PostTypeId="2" ParentId="15592" CreationDate="2014-11-23T14:05:38.433" Score="2" Body="&lt;p&gt;In the Merton jump diffusion model, the stock price process consists of a continuous part and a discrete part (this one represents the jumps).&#xA;While deriving the PDE for the riskless portfolio and imposing the riskless evolution, the discrete part can't be instantaneously hedged. In fact, you can assume that the effects of jumps can be nullified on average, but still not instantaneously: this means that the whole PDE can be valid only under expectation. Therefore, also the Greeks will be valid only under expectation since they come from that same PDE, meaning that risk analysis is not instantaneous and is considered less effective.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I didn't study Kou's model, but reading the stock price process from &lt;a href=&quot;http://ntuzov.com/Nik_Site/Niks_files/Research/papers/jum_diff/Kou2002.pdf&quot; rel=&quot;nofollow&quot;&gt;his publication&lt;/a&gt;, I see the same feature and the same argument is valid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, I think you can find Greeks derivation in literature. If I remember well, &lt;a href=&quot;http://riskbooks.com/a-guide-to-quantitative-finance&quot; rel=&quot;nofollow&quot;&gt;A Guide to Quantitative Finance&lt;/a&gt; should have them: it derives call option prices and Greeks under many models using the PDE-Fourier method.&lt;/p&gt;&#xA;" OwnerUserId="7405" LastActivityDate="2014-11-23T14:05:38.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15598" PostTypeId="2" ParentId="15595" CreationDate="2014-11-23T15:36:50.337" Score="1" Body="&lt;p&gt;For Engle-Granger, I can see that you are returned a vector of 2 elements for each of the output arguments, hence you run two tests there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the sake of clarity and the education of people interested in the post, we can say that:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Since your $hValues$ are both zero, we can say that there is a failure to reject the Null Hypothesis, which in this case is (by definition) that there is no co-integration. Hence the results of the tests are that the pair is not co-integrated.&lt;/li&gt;&#xA;&lt;li&gt;Typically a low $pValue$ would indicate a good candidate pair. Here is not the case. With certainty then, the Null holds. Low p-Values indicate that the pair is cointegrated. A pValue of &amp;lt; 0.1 would be a good point to investigate further the properties of these time-series.&lt;/li&gt;&#xA;&lt;li&gt;t-stat values again very low for being significant.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For your Johansen test the same applies, the 'False' returned, means failure to reject the Null Hypothesis.&lt;/p&gt;&#xA;" OwnerUserId="13462" LastEditorUserId="13462" LastEditDate="2017-02-02T08:15:47.173" LastActivityDate="2017-02-02T08:15:47.173" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15599" PostTypeId="2" ParentId="14838" CreationDate="2014-11-23T16:56:55.403" Score="1" Body="&lt;p&gt;Having locked markets is bad in the sense&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;it freezes the price formation process. Ideally we would like to have a price on as much instruments as possible so that we know their value.&lt;/li&gt;&#xA;&lt;li&gt;it prevent investors to buy (or sell) it and thus adds frictions, transaction costs, etc. We would like to enable investors to buy or sell when they need/want, to let the offer and demand dynamic game to take place.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2014-11-23T16:56:55.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15600" PostTypeId="2" ParentId="15586" CreationDate="2014-11-23T23:19:59.713" Score="12" Body="&lt;p&gt;Neither.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Black--Scholes says nothing about the parameter values: $\mu$ and $\sigma.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A very large $\mu$ and very small $\sigma$ is very unlikely to actually occur in the market and if it did you could make money with high probability without using option contracts. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;BS simply says that if the market follows a certain process then a certain option price is enforcable by no arbitrage. It says nothing about the existence or non-existence of very good deals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, no one knows $\mu$ and so the great strength of BS is that you don't need it to price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially, it doesn't outlaw silly parameter values because it doesn't need to. However, that doesn't mean that such parameters will occur in a real market. In any case, no one believes that stock prices follows geometric BM. The question is whether the model is good enough to be useful and it is. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2014-11-23T23:19:59.713" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15601" PostTypeId="2" ParentId="15591" CreationDate="2014-11-24T02:08:07.090" Score="2" Body="&lt;p&gt;I am not familiar with indexes for private equity or venture capital.  For hedge funds, there are various indexes, with the best-regarded ones provided by &lt;a href=&quot;https://www.hedgefundresearch.com/index.php?fuse=indices-faq&quot; rel=&quot;nofollow&quot;&gt;HFR&lt;/a&gt;.  They include an &lt;a href=&quot;https://www.hedgefundresearch.com/hfrx_reg/index.php?fuse=login&amp;amp;loginflag=1&amp;amp;1416794631&quot; rel=&quot;nofollow&quot;&gt;investable index&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I happen to believe these indexes, even the investable one, are of &lt;em&gt;very&lt;/em&gt; limited use at best.  Many hedge funds are closed, meaning they are not taking in new money.  Others have exited the index through failure, meaning there is a strong &lt;a href=&quot;http://www.investopedia.com/terms/s/survivorshipbias.asp&quot; rel=&quot;nofollow&quot;&gt;survivorship bias&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2014-11-24T02:08:07.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15602" PostTypeId="2" ParentId="15565" CreationDate="2014-11-24T08:20:46.417" Score="1" Body="&lt;p&gt;Let's first rewrite the tow processes and let $X_t = 1/S_t$&#xA;Then we have &#xA;$$&#xA;dX_t/X_t = (\sigma^2-r)dt + \sigma dW_t,&#xA;$$&#xA;with the solution (apply Ito)&#xA;$$&#xA;X_t = X_0 \exp((\sigma^2/2-r) t + \sigma W_t),&#xA;$$&#xA;and &#xA;$$&#xA;dS_t/S_t = r dt + \sigma dW_t,&#xA;$$&#xA;with the solution (apply Ito)&#xA;$$&#xA;S_t = S_0 \exp((r-\sigma^2/2) t + \sigma W_t).&#xA;$$&#xA;If we look at the two processes at point $t$ then their volatilities defined as the coefficient of $dW_t$ in the SDEs is different. It is $X_t \sigma = \sigma/S_t$ for the first and $\sigma S_t$ for the second - these are very different numbers for any path of $S_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you look at the variance of the processes then we know from results about log-normal distributions (&lt;a href=&quot;http://en.wikipedia.org/wiki/Log-normal_distribution&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Log-normal_distribution&lt;/a&gt;) that&#xA;$$&#xA;Var[X_t] = X_0^2 \exp(-2rt+2\sigma^2t)(\exp(\sigma^2 t)-1),&#xA;$$&#xA;and&#xA;$$&#xA;Var[S_t] = S_0^2 \exp(2rt)(\exp(\sigma^2t)-1).&#xA;$$&#xA;Also very different: so the answer is no.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-11-24T08:20:46.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15603" PostTypeId="2" ParentId="15589" CreationDate="2014-11-24T08:59:28.757" Score="4" Body="&lt;p&gt;You don't really have a multivariate case: we can only define VaR (in its usual sense) for a one-dimensional output. Recall that &#xA;$$&#xA;  \operatorname{VaR}_\alpha(X) = \inf\{v:F_X(v)\geq \alpha\}&#xA;$$&#xA;and since in your case $X = X_1+X_2$ you just need to compute $F_X$ in terms of $X_1$ and $X_2$. For the notation of partial derivatives, I denote the generic variables of the copula function by $u_1$ and $u_2$.&#xA;$$&#xA;  F_X(v) = \mathbb P(X_1+X_2\leq v) = \int\limits_{-\infty}^\infty \frac{\partial C}{\partial u_1}\left(F_{X_1}(x_1),F_{X_2}(v-x_1)\right)\mathrm dF_{X_1}(x_1). \tag{1}&#xA;$$&#xA;As long as you can compute/estimate this function, you can get a value/estimate for VaR.&#xA;The formula $(1)$ can be obtained as follows:&#xA;$$&#xA;\begin{align}&#xA;  F_X(v) &amp;amp;= \mathbb P(X_1+X_2\leq v) = \int\limits_{-\infty}^\infty \mathrm dx_1 \int\limits_{-\infty}^{v-x_1}\frac{\partial^2 C}{\partial u_1\partial u_2}\left(F_{X_1}(x_1),F_{X_2}(x_2)\right)F'_{X_1}(x_1)F'_{X_2}(x_2)\mathrm dx_2&#xA;\\&#xA;&amp;amp;= \int\limits_{-\infty}^\infty \mathrm dx_1 \int\limits_{-\infty}^{v-x_1}\frac{\partial}{\partial x_2}\left(\frac{\partial C}{\partial u_1}\left(F_{X_1}(x_1),F_{X_2}(x_2)\right)F'_{X_1}(x_1)\right)\mathrm dx_2&#xA;\\&#xA;&amp;amp;= \int\limits_{-\infty}^\infty \left.\frac{\partial C}{\partial u_1}\left(F_{X_1}(x_1),F_{X_2}(x_2)\right)F'_{X_1}(x_1)\right|_{x_2=-\infty}^{x_2=v-x_1}\mathrm dx_1&#xA;\\&#xA;&amp;amp;= \int\limits_{-\infty}^\infty \frac{\partial C}{\partial u_1}\left(F_{X_1}(x_1),F_{X_2}(v-x_1)\right)F'_{X_1}(x_1)\mathrm dx_1 \\&#xA;&amp;amp;= \int\limits_{-\infty}^\infty \frac{\partial C}{\partial u_1}\left(F_{X_1}(x_1),F_{X_2}(v-x_1)\right)\mathrm dF_{X_1}(x_1).&#xA;\end{align}&#xA;$$&#xA;For the partial derivatives notation, consider the following example. If $g(u_1,u_2) = u_1 + u_2$ then&#xA;$$&#xA;  \frac{\partial }{\partial u_1}g(x_1^2,x_2^2) = 1,$$ &#xA;$$ \frac{\partial}{\partial x_1}g(x_1^2,x_2^2) = 2x_1.&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="13480" LastEditorUserId="20913" LastEditDate="2018-02-25T18:02:44.580" LastActivityDate="2018-02-25T18:02:44.580" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="15604" PostTypeId="2" ParentId="15586" CreationDate="2014-11-24T09:04:57.307" Score="0" Body="&lt;p&gt;Absence of statistical arbitrage is a stronger condition that usual NA condition&#xA;$$&#xA;  \nexists \varphi\in \Phi: V(\varphi)&amp;gt;0 \text{ and } \mathbb EV_T(\varphi)&amp;gt;0 \text{ for some } T\geq0 \tag{1}&#xA;$$&#xA;since as soon as there exists an admissible trading strategy $\varphi\in \Phi$ satisfying $(1)$, it readily provides statistic arbitrage. Now, in BS the weaker condition $(1)$ is already sufficient to show that option prices can be uniquely determined, so why then impose stronger assumptions on the model if they are not necessary.&lt;/p&gt;&#xA;" OwnerUserId="13480" LastActivityDate="2014-11-24T09:04:57.307" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15605" PostTypeId="1" AcceptedAnswerId="17495" CreationDate="2014-11-24T09:09:31.657" Score="2" ViewCount="1085" Body="&lt;p&gt;I have a list of all S&amp;amp;P500 tickers, e.g. AAPL, GOOG, JPM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to get their market cap on 1.7.2013 (I don't have Bloomberg, only free internet).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there an excel addin or other tool/page where I can obtain historic market cap?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The page &lt;a href=&quot;https://www.quandl.com/&quot; rel=&quot;nofollow&quot;&gt;https://www.quandl.com/&lt;/a&gt; seems to provide financial information, but I did not find how to retrieve the market cap by ticker.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2015-04-24T05:28:06.063" Title="Get market cap by ticker on 1.7.2013?" Tags="&lt;equities&gt;&lt;market-data&gt;&lt;index&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15606" PostTypeId="2" ParentId="15605" CreationDate="2014-11-24T09:30:08.333" Score="1" Body="&lt;p&gt;@emcor I would suggest downloading the Stock's daily Prices &amp;amp; then downloading Shares Outstanding or average shares outstanding. Then find the product of the two to arrive at market caps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know how reliable quandl's data is or if they have shares outstanding data, but if they do this can probably be done using R code since you will be downloading many ticker's data&lt;/p&gt;&#xA;" OwnerUserId="13428" LastActivityDate="2014-11-24T09:30:08.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15607" PostTypeId="2" ParentId="15549" CreationDate="2014-11-24T11:05:00.820" Score="1" Body="&lt;p&gt;Go talk to Fincad. Here is their page on integrating with scripting languages:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.fincad.com/news-events/assets/pdfs/mar07/using-fincad-developer-scripting-languages.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.fincad.com/news-events/assets/pdfs/mar07/using-fincad-developer-scripting-languages.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Their analytics libraries include bond analytics, and they have a spreadsheet product so you can test methods and results before implementing them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Disclaimer: I work for a company who is a customer of Fincad's analytics.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2014-11-24T11:05:00.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15609" PostTypeId="2" ParentId="14135" CreationDate="2014-11-24T14:10:28.263" Score="0" Body="&lt;p&gt;&lt;strong&gt;A # 1&lt;/strong&gt; : Several replies from the following topic answer my &lt;strong&gt;Q # 1&lt;/strong&gt; - yes, if I take only one dimension after PCA then I can simply make all vectors positive, hence take only absolute values by module. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I take several dimensions then entire vector needs to be reverted and each value inside particular vector can be multiplied by -1 because reversion of orthogonal vectors does not change their meaning, the only requirement in this case is if one value in vector was changed then all other need to be changed too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/3094/time-series-of-pca-sign-change-in-factor-loadings&quot;&gt;Time series of PCA - Sign change in factor loadings&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6855" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2014-11-25T00:46:58.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15611" PostTypeId="1" CreationDate="2014-11-24T15:33:56.270" Score="12" ViewCount="4484" Body="&lt;p&gt;I have some decent knowledge of probability, stochastic processes and option theory, however I do not have a proper background in statistics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I am working quite a lot with data, and trying methods from here and there such as linear/logistic regression, PCA etc. Yet, I would be comfortable if I had a couple of books that describe main idea, popular methods and their possible well-known and hidden drawbacks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally such a book would be written with financial applications in mind, preferrably with a good technical level. I've tried &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0495110817&quot; rel=&quot;noreferrer&quot;&gt;Mathematical Statistics with Applications&lt;/a&gt; by Wackerly et al. but that lacks focus on quantitative finance, and also seems to cover only very basic things.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm grateful for any advice on this topic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps worth clarifying that if the book contains other methods of working with data, e.g. particle filters, neural networks etc. I'm even more interested in it. &lt;/p&gt;&#xA;" OwnerUserId="13480" LastEditorUserId="467" LastEditDate="2014-11-25T01:59:50.603" LastActivityDate="2014-11-26T19:27:34.520" Title="What are the canonical books for statistics applied to finance?" Tags="&lt;statistics&gt;&lt;reference-request&gt;" AnswerCount="4" CommentCount="4" FavoriteCount="17" ContentLicense="CC BY-SA 3.0" />
  <row Id="15612" PostTypeId="2" ParentId="15611" CreationDate="2014-11-24T18:29:26.350" Score="1" Body="&lt;p&gt;I would highly recommend this books:&#xA;&lt;strong&gt;Mathematics and Statistics for Financial Risk Management&lt;/strong&gt;: &#xA;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1118750292&quot; rel=&quot;nofollow&quot;&gt;Book 1&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other one, is Chapter three from, &#xA;&lt;strong&gt;Practical Methods of Financial Engineering and Risk Management&lt;/strong&gt;: Tools for Modern Financial Professionals:&#xA;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1430261331&quot; rel=&quot;nofollow&quot;&gt;Book 2&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope it helps.&lt;/p&gt;&#xA;" OwnerUserId="13533" LastEditorUserId="13533" LastEditDate="2014-11-25T01:36:22.137" LastActivityDate="2014-11-25T01:36:22.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15613" PostTypeId="2" ParentId="15611" CreationDate="2014-11-24T18:34:42.470" Score="6" Body="&lt;p&gt;I think a good book to start in your case is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.symmys.com/attilio-meucci/book&quot; rel=&quot;noreferrer&quot;&gt;Attilio Meucci: Risk and Asset Allocation&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I once had a seminar held by Attilio that was based on the book and it blew my mind. The book is very intuitive yet rigorous. &lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2014-11-24T18:34:42.470" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15614" PostTypeId="1" CreationDate="2014-11-24T21:06:59.027" Score="8" ViewCount="2056" Body="&lt;p&gt;I am simulating the path of three indices to price a 1 year basket option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All the indices are domestic, so there is no currency component.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At each time step I am using the local volatility determined using Dupire model, the forward interest rate and the forward dividend yield. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For now, I am OK resimulating paths to calculate the greeks.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Delta&lt;/strong&gt; $\Delta$: I am shocking $S$ at $t=0$ up and down and generating two new sets of paths. &#xA;I am not sure how to calculate Vega and Rho. &lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Vega&lt;/strong&gt; $\nu$: Should I apply a parallel shock to the implied volatility surface and regnerate the local volatility surface or apply a parallel shock directly to the local volatility surface?&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Rho&lt;/strong&gt; $\rho$: Should I apply a parallel shock to the spot rate curve and determine the forward rates or apply a parallel shock directly to the forward curve?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="13648" LastEditorUserId="467" LastEditDate="2014-11-25T02:06:58.813" LastActivityDate="2014-11-30T05:03:42.963" Title="How to estimate the greeks with a Monte Carlo simulation?" Tags="&lt;monte-carlo&gt;&lt;greeks&gt;&lt;local-volatility&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15615" PostTypeId="2" ParentId="14135" CreationDate="2014-11-24T23:46:11.243" Score="1" Body="&lt;p&gt;Q #1: I'm not sure if you have the answer quite right.  The signs for the loadings are arbitrary, but you cannot take the absolute value.  You can multiply by -1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q #2: It might be helpful to think about what PCA is actually doing.  This paper might be helpful: &lt;a href=&quot;http://arxiv.org/pdf/1404.1100v1.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://arxiv.org/pdf/1404.1100v1.pdf&lt;/a&gt; (A Tutorial on Principal Component Analysis by Jonathon Shlens).  The key point is towards the end, where the author explains the relationship of SVD with PCA.  &quot;We can conclude that finding the principal components amounts to finding an orthonormal basis that spans the column space...&quot; of the data matrix.  But this quote is referring to finding the principal components using the covariance matrix. The authors of the paper you attached use the correlation matrix.  This is essentially finding a set of variables that spans the space of scaled returns.  Thus you need to scale the weights of your eigenvectors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may also find this piece helpful - it seems to discuss a similar application with a little more derivation:&#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/14135/some-clarifications-on-eigenvectors-and-eigenvalues-from-pca&quot;&gt;Some clarifications on eigenvectors and eigenvalues from PCA&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="4981" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2014-11-24T23:46:11.243" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15616" PostTypeId="2" ParentId="9980" CreationDate="2014-11-25T01:27:27.087" Score="1" Body="&lt;p&gt;There is something called a 'capped option' which does have a restricted domain. There are a couple versions of this, some of which use the method of images combined with automatic exercise at the barrier. It doesn't tell you how existing options behave under the introduction of a barrier in the context of put call parity&lt;/p&gt;&#xA;" OwnerUserId="13515" LastActivityDate="2014-11-25T01:27:27.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15617" PostTypeId="1" CreationDate="2014-11-25T02:22:08.780" Score="-1" ViewCount="2947" Body="&lt;p&gt;What is state price vector?.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please explain me in detail is difficult to understand for me.&lt;/p&gt;&#xA;" OwnerUserId="13649" LastEditorUserId="467" LastEditDate="2014-11-25T03:07:38.290" LastActivityDate="2018-12-29T10:47:42.250" Title="What's state price vector?" Tags="&lt;finance&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15618" PostTypeId="2" ParentId="15611" CreationDate="2014-11-25T08:42:38.033" Score="6" Body="&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0387848576&quot; rel=&quot;noreferrer&quot;&gt;Elements of Statistical Learning&lt;/a&gt; by Hastie, Tibshirani and Friedman is one of the most-cited books for your purpose. Although it does not have any direct applications to Finance, this is definitely a good book to have in your professional library and can be used as a reference for most topics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to use a book with more financial applications, I would say that &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1461427495&quot; rel=&quot;noreferrer&quot;&gt;Statistics and Data Analysis for Financial Engineering&lt;/a&gt; by Ruppert is one of the best for you. It contains the necessary basics as well as more advanced topics for time series, regression techniques, copulas, and general multivariate statistical methods. I would suggest that you look through the table of contents to get a good overview. The book also contains R code, which might be useful to you, since it is one of the most used languages in statistical analysis.&lt;/p&gt;&#xA;" OwnerUserId="5350" LastActivityDate="2014-11-25T08:42:38.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15619" PostTypeId="2" ParentId="15617" CreationDate="2014-11-25T10:49:26.767" Score="1" Body="&lt;p&gt;Based on what I know for a leacture on Arrow Debrue Security assume that we live in a world with only 2 states and a Security &lt;span class=&quot;math-container&quot;&gt;$S$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;State 1 - Inflation &gt; 1%  &lt;/li&gt;&#xA;&lt;li&gt;State 2 - Inflation &amp;lt; 1%&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;In State 1  security &lt;span class=&quot;math-container&quot;&gt;$ S $&lt;/span&gt; pays 1 i.e the payout fraction is 100%      &lt;/li&gt;&#xA;&lt;li&gt;In State 2  security &lt;span class=&quot;math-container&quot;&gt;$ S $&lt;/span&gt; pays 0 i.e the payout fraction is 0%&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This collection of states and Prices is called state price vector. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have more than one Security than you have a state price matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;States will such that sum of all payout fractions &lt;span class=&quot;math-container&quot;&gt;$ \Sigma_{i=1}^n P_i = 1$&lt;/span&gt;. You can treat them as probilities.  While pricing a security you can consider all state price vector for &lt;span class=&quot;math-container&quot;&gt;$S$&lt;/span&gt; and find the price as &lt;span class=&quot;math-container&quot;&gt;$PV(\Sigma_{i=1}^n P_i * S_i^{cf}) $&lt;/span&gt; where &lt;span class=&quot;math-container&quot;&gt;$S_i^{cf}$&lt;/span&gt; cashflow from security &lt;span class=&quot;math-container&quot;&gt;$S$&lt;/span&gt; in state &lt;span class=&quot;math-container&quot;&gt;$i$&lt;/span&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would recommend you read some papers on it &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://web.archive.org/web/20120714072539/https://www.math.hu-berlin.de/~becherer/ArrowDebreuPrices.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Arrow Debreu Prices&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/State_prices&quot; rel=&quot;nofollow noreferrer&quot;&gt;Wikipedia&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1386" LastEditorUserId="38135" LastEditDate="2018-12-29T10:47:42.250" LastActivityDate="2018-12-29T10:47:42.250" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="15621" PostTypeId="1" AcceptedAnswerId="15630" CreationDate="2014-11-25T15:15:58.807" Score="1" ViewCount="1292" Body="&lt;p&gt;In the context of Option pricing model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a difference between the Dupire Model and the Local volatility model ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&#xA;Achal&lt;/p&gt;&#xA;" OwnerUserId="13525" LastActivityDate="2014-11-25T22:50:02.100" Title="Dupire model and Local Volatility model" Tags="&lt;option-pricing&gt;&lt;local-volatility&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15622" PostTypeId="2" ParentId="15621" CreationDate="2014-11-25T15:23:27.560" Score="1" Body="&lt;p&gt;No, if you are referring to the famous Dupire Model (there are others), then they are the same. It is usually referred to as the Local Volatility Model and the Dupire Equation. I would disentagle those with the concept of Local Volatility, which is model independent and a fairly deep result.&lt;/p&gt;&#xA;" OwnerUserId="13415" LastActivityDate="2014-11-25T15:23:27.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15624" PostTypeId="2" ParentId="15614" CreationDate="2014-11-25T15:58:16.553" Score="3" Body="&lt;p&gt;First, please make sure that when you resimulate sample paths, you are keeping your underlying random samples constant, as &lt;a href=&quot;https://quant.stackexchange.com/a/3334/254&quot;&gt;in this answer&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your delta, vega and rho there is some ambiguity in the definition of the greeks.  Consider the simple case of delta in the presence of a skew $\sigma(K/S)$, and say that the underlying price right now is $S_0$.  We might use&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\Delta = \lim_{dS \rightarrow 0} \frac{V(S_0+dS, \sigma(K/S_0))-V(S_0, \sigma(K/S_0))}{dS}&#xA;$$&#xA; or we might use what is sometimes called the &quot;total delta&quot;&#xA;$$&#xA;\Delta^{\textrm{tot}} = \lim_{dS \rightarrow 0} \frac{V\left(S_0+dS, \sigma\left(\frac{K}{S_0+dS}\right)\right)-V\left(S_0, \sigma\left(\frac{K}{S_0}\right)\right)}{dS}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of rho and vega, as you note you have similar ambiguity about what model inputs should be changing infinitesimally as part of their definition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, in the presence of variations from the constant-parameter assumptions of the BSM model, the definition of the greeks is up to you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you want to think about is &lt;em&gt;why&lt;/em&gt; you are calculating these greeks.  The main use of greeks is to help us in hedging.  Knowing what the delta is, for example, tells us how much underlying to trade (at a given moment) to lay off some of the hedged position risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The role of the greeks in this case is to provide some numbers that can quickly translate to equivalent quantities of liquid securities: underlying for delta, straddles for vega and bonds for rho.  The main thing you need to be sure of is that your calculation of equivalents is consistent for the hedging instruments.  For example, you would want to calculate your straddle vega using the same definition you used for your basket option vega.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;em&gt;other&lt;/em&gt; role of greeks is to give a sense of portfolio risk to managers who are familiar with thinking of options portfolio risk in these terms.  In that case, you want to keep it close to the BSM model, which generally entails&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Not using total delta&lt;/li&gt;&#xA;&lt;li&gt;Define vega with a parallel shock to the input implied vol surface&lt;/li&gt;&#xA;&lt;li&gt;Define rho with a parallel spot curve shock&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="254" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2014-11-25T15:58:16.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15625" PostTypeId="2" ParentId="983" CreationDate="2014-11-25T19:53:12.700" Score="1" Body="&lt;p&gt;This is tough but the below reference found a small edge with 3% R2 - mean reversion is more likely to happen in upward market while momentum is strong in downward market. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.alphaarchitect.com/blog/2014/07/15/timing-the-market-with-mean-reversion-indicators/&quot; rel=&quot;nofollow&quot;&gt;http://www.alphaarchitect.com/blog/2014/07/15/timing-the-market-with-mean-reversion-indicators/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5861" LastActivityDate="2014-11-25T19:53:12.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15626" PostTypeId="1" AcceptedAnswerId="15633" CreationDate="2014-11-25T20:18:10.937" Score="3" ViewCount="183" Body="&lt;p&gt;Given:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a two-asset, continuous time model (B,S) where &#xA;$$dB_t = B_t r dt, \quad dS_t = S_t ( \mu dt + \sigma dW_t)$$&#xA;Clearly, the martingale deflator is:&#xA;$$Y_t = e^{(-r - \frac{\lambda^2}{2})t - \lambda W_t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a theorem that states the following:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;For a claim with payout $\xi_T$, $T&amp;gt;0$, if $\xi_T&amp;gt;0$, $\mathcal{F}_T$-measurable and such that $\xi_TY_T$ is integrable, then there exists an admissible strategy $(\pi_t)_{t \in [0,T]}$ that replicates the European claim with payout $\xi_T$.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Problem:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose that $\xi_T = g(X_T)$, where $g$ is a bounded smooth Borel function. (Then the hypothesis for $\xi_t$ in the above theorem are satisfied.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose further that $g$ has a bounded derivative and is an increasing function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Show that there exists an admissible replicating strategy $(\pi_t)_{t \in [0,T]}$ such that $\pi_t \geq 0$ a.s. for all $t \geq 0$.&lt;/p&gt;&#xA;" OwnerUserId="13654" LastEditorUserId="467" LastEditDate="2014-11-27T04:01:41.597" LastActivityDate="2014-11-27T04:01:41.597" Title="Black Scholes model: condition of payout function" Tags="&lt;black-scholes&gt;&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15627" PostTypeId="1" CreationDate="2014-11-25T20:24:31.890" Score="2" ViewCount="593" Body="&lt;p&gt;Given:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a two-asset, continuous time model (B,S) where &#xA;\begin{equation}&#xA;dB_t = B_t r dt, \quad dS_t =  \mu dt + \sigma dW_t.&#xA;\end{equation}&#xA;The question is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Show that there exists a trading strategy which replicates the payout of a European call with strike K and maturity T. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Show that the number of shares of stock in the replicating portfolio is always non-negative but never greater than one.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="13654" LastEditorUserId="13654" LastEditDate="2014-11-27T19:43:21.113" LastActivityDate="2014-11-29T13:53:50.550" Title="Bachelier model: number of stocks in replicating strategy" Tags="&lt;black-scholes&gt;&lt;stochastic-calculus&gt;" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15629" PostTypeId="1" CreationDate="2014-11-25T22:13:55.237" Score="1" ViewCount="64" Body="&lt;p&gt;How can I modify the formula in this &lt;a href=&quot;https://quant.stackexchange.com/a/11236/13655&quot;&gt;answer&lt;/a&gt; so that the frequency of payment growth is also a variable? For example, instead of payments growing by 2% each year I would like them to grow 2% every two years.&lt;/p&gt;&#xA;" OwnerUserId="13655" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2014-11-26T03:35:37.053" Title="What is the future value of a growing annuity with different periods for payment growth and monthly payments?" Tags="&lt;finance&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15630" PostTypeId="2" ParentId="15621" CreationDate="2014-11-25T22:50:02.100" Score="1" Body="&lt;p&gt;Dupire model is just one way of generating a local volatility surface from an implied volatility surface. There are many other ways to generate a local volatility surface. One critical aspect of Dupire model is that the input implied volatility (IV) surface should be arbitrage free. If not, you will negative instantaneous variance when generating the local volatility surface. Consequently your local volatility (square root of variance) would be invalid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are many ways of smoothing the implied volatility surface. Cubic spline is a good, but does not guarantee an aribtrage free IV surface. Fengler model does.&#xA;&lt;a href=&quot;http://www.econbiz.de/archiv1/2008/58072_arbitrage-free_smoothing.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.econbiz.de/archiv1/2008/58072_arbitrage-free_smoothing.pdf&lt;/a&gt;&#xA;Also remember to smooth the IV surface before generating a local volatility surface.&lt;/p&gt;&#xA;" OwnerUserId="13648" LastActivityDate="2014-11-25T22:50:02.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15631" PostTypeId="1" CreationDate="2014-11-25T23:17:03.697" Score="4" ViewCount="103" Body="&lt;p&gt;Looking at futures data I am trying to calculate/estimate the number of &quot;day trades&quot;, i.e. positions that were initiated and closed during the same day, as distinct from those positions that were initiated and held for one (overnight) or more days. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure this is possible but my instinct is that this can be done using some combination of volume and open interest with the addition of some external data (e.g. COT reports) to represent longer term positions. However, I feel like there must be an accepted model for figuring this out (or there's other data I don't know about somewhere).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be 100% clear I'm not looking to simply model intraday volume for a VWAP strategy or something along those lines. I'm just looking to see if I can drop out day trades (or an estimate) from the overall trading volume. &lt;/p&gt;&#xA;" OwnerUserId="13656" LastActivityDate="2014-12-30T14:28:33.007" Title="Estimating Number of &quot;Day Trades&quot; from Total Volume of Commodity Futures Contract" Tags="&lt;futures&gt;&lt;models&gt;&lt;commodities&gt;&lt;volume&gt;&lt;intraday&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15632" PostTypeId="1" CreationDate="2014-11-25T23:56:28.747" Score="1" ViewCount="61" Body="&lt;p&gt;A certain complicated option pricing formula results in products of  Black Scholes $N$ components like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$-p_1N(d_1)N(d_6)+p_sN(d_2)N(d_5)&amp;gt;?0$ where $p_s&amp;gt;p_1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Trying to find a simple way to prove if this identity is true or not without having to use differential geometry on a multi variable function. Taylor series don't work because the Ln's  and $a*t^{1/2}$ part can be very big. interest set to zero for simplicity &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\begin{align}&#xA;     d_1 &amp;amp;= \frac{1}{\alpha\sqrt{t}}\left[\ln\left(\frac{p_1}{p_s}\right) + \left(0 + \frac{\alpha^2}{2}\right)t\right] \\&#xA;     d_2 &amp;amp;= \frac{1}{\alpha\sqrt{t}}\left[\ln\left(\frac{p_1}{p_s}\right) + \left(0 - \frac{\alpha^2}{2}\right)t\right] \\&#xA;   d_5 &amp;amp;= \frac{1}{\alpha\sqrt{t}}\left[ \left(0 + \frac{\alpha^2}{2}\right)t\right] \\&#xA;     d_6 &amp;amp;= \frac{1}{\alpha\sqrt{t}}\left[\left(0 - \frac{\alpha^2}{2}\right)t\right] \\&#xA;\end{align}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Trying to prove this with differentials requires taking the derivative of a complicated function with respectto the time/vol variable and then the p_s an p_1 variables to determine if the manifold has a maximum above zero&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At  the endpoints $at \to 0$ and $at \to infinity $ it equals zero, so the function is a frown or a smile that has positive or negative curvature. This is an extremely hard problem because linear approximations don;t work&lt;/p&gt;&#xA;" OwnerUserId="13515" LastActivityDate="2014-11-25T23:56:28.747" Title="Any Simple Way to Prove Black Scholes Type Identies?" Tags="&lt;black-scholes&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15633" PostTypeId="2" ParentId="15626" CreationDate="2014-11-26T01:08:09.997" Score="3" Body="&lt;p&gt;A portfolio $V_t(\alpha_t,\beta_t)$ (for stock $S_t$ and zerobond $B_t$) is self-financing iff:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V_t=\alpha_tS_t+\beta_t B_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It further implies&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dV_t=\alpha_tdS_t+\beta_tdB_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To replicate a derivative $C(S_t,t)$ by a self-financing portfolio of stock and bond, set: $$dV_t=dC_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The dynamics of $dC$ can be specified using Ito's Lemma on $C(S_t,t)$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dC=\partial_tCdt+\partial_sCdS+\frac{1}{2}\sigma^2S_t^2\partial_{SS}Cdt=\partial_SCdS_t+(\partial_tC+\frac{1}{2}\sigma^2S_t^2\partial_{SS}C)dt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next assume $C$ satisfies the BS-PDE:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\partial_tC+\frac{1}{2}\sigma^2S_t^2\partial_{SS}C=rC-rS_t\partial_S C$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Inserting this into $dC$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dC=\partial_SCdS_t+(C-S_t\partial_SC)rdt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we further have the bond-dynamics $dB_t=B_trdt$, so:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dC=\partial_SC\cdot dS_t+\left(\frac{C_t}{B_t}-\frac{S_t}{B_t}\partial_SC\right)\cdot dB_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, the coefficients before $dS_t$ and $dB_t$ are exactly the self-financing portfolio weights:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\left(\alpha_t=\partial_SC,\,\beta_t=\dfrac{C_t}{B_t}-\dfrac{S_t}{B_t}\partial_SC\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the stockweight is $\pi_t=\partial_SC\geq 0$ since $C=g$ is an increasing function by OP.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-11-26T01:08:09.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15634" PostTypeId="1" CreationDate="2014-11-26T03:23:54.257" Score="4" ViewCount="161" Body="&lt;p&gt;I am wondering whether anyone can share experiences and longer term average probabilities of fills when quoting inside the spread at various fx ECNs. I need to make an assumption of the probability of getting filled as a function of fx ECN venue, how aggressive I bid and offer inside the spread (in terms of how far away from current best bid/offer and how frequent to modify), and as function of current micro market dynamics (momentum vs mean reversion). I am just looking for an approximate figure that averages out over a longer period (days, weeks,...) and ignoring micro market dynamics and how aggressively the quoting is performed. I intend to eventually quote concurrently on both sides at several ECNs I have access to (FxOne, Integral FxInside, FastMatch, LMAX, FxAll, Hotspot). Not all lend themselves to quoting inside the current spread (due to last look provisions and what have you). I can colocate/proximity locate in the same building as most of mentioned ECNs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I am not looking for a specific number but rather wonder how others model fill probabilities when testing market making algorithms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2014-11-28T06:19:30.397" LastActivityDate="2016-02-01T00:21:13.653" Title="Longer term average probabilities of fills at fx ECNs?" Tags="&lt;trading&gt;&lt;fx&gt;&lt;high-frequency&gt;&lt;market-making&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15635" PostTypeId="1" AcceptedAnswerId="15638" CreationDate="2014-11-26T05:53:47.063" Score="8" ViewCount="1113" Body="&lt;p&gt;Historically stocks have a higher likelihood to increase in price than to fall in price. As such would it make sense to split a stocks volatility measurement into upward and downward components?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example if the above strategy was to be used in options pricing one would need to re-work the Black-Scholes equation to accommodate the two volatility measurements which could possibly result in more accurate options pricing.&lt;/p&gt;&#xA;" OwnerUserId="13661" LastEditorUserId="467" LastEditDate="2014-11-26T09:26:10.313" LastActivityDate="2014-11-27T08:14:40.380" Title="Does it make sense to use upward and downward volatility in option pricing?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;black-scholes&gt;&lt;stochastic-volatility&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15636" PostTypeId="1" CreationDate="2014-11-26T08:04:47.103" Score="2" ViewCount="559" Body="&lt;p&gt;I have to find nominal and effective forward interest rate for 3M-9M term, knowing that current interest rates are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;3M - 2.05% &lt;/li&gt;&#xA;&lt;li&gt;6M - 2.04%&lt;/li&gt;&#xA;&lt;li&gt;9M - 2.03%&lt;/li&gt;&#xA;&lt;li&gt;12M - 2.02%&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For a nominal interest rate I just solve for $r$ the following equation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$(1+\frac{2.05\%}{4})(1+\frac{r}{2})=(1+2.03\%\cdot\frac{3}{4})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will have some $r$ (nominal i.r.) but how can I find an &lt;i&gt;effective&lt;/i&gt; interest rate? Won't it be the same as nominal?&lt;/p&gt;&#xA;" OwnerUserId="13662" LastEditorUserId="467" LastEditDate="2014-11-26T09:24:01.923" LastActivityDate="2014-11-26T09:24:01.923" Title="Hot do I calculate an effective forward rate?" Tags="&lt;interest-rates&gt;" AnswerCount="0" CommentCount="3" ClosedDate="2014-11-26T09:23:27.117" ContentLicense="CC BY-SA 3.0" />
  <row Id="15637" PostTypeId="1" CreationDate="2014-11-26T08:53:51.050" Score="5" ViewCount="1581" Body="&lt;p&gt;I'm trying to estimate CVA of one of my derivatives by valuing a credit default swap (CDS) of my counterparty. However, I don't know how to set up the CDS deal (notional amount, maturity, etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="12160" LastActivityDate="2016-01-22T20:48:42.050" Title="How to estimate CVA by valuing a CDS of the counterparty?" Tags="&lt;derivatives&gt;&lt;cds&gt;&lt;cva&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15638" PostTypeId="2" ParentId="15635" CreationDate="2014-11-26T09:32:04.770" Score="4" Body="&lt;p&gt;Well if you think that this model represents reality more accurately than the Black-Scholes assumptions. A lot of people do indeed think so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I wouldn't say you're &quot;tweaking&quot; Black-Scholes... you're just assuming another model altogether and you will use risk-neutral pricing to compute the fair value of the option at time $t$, just like BS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Frankly, I'm not sure you'll get very far trying to get a closed-form solution for asymmetric volatility, but you might have a look at variations of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Autoregressive_conditional_heteroskedasticity&quot; rel=&quot;nofollow&quot;&gt;GARCH&lt;/a&gt; model, which you can then simulate using a Monte-Carlo simulation for example.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2014-11-26T09:32:04.770" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15639" PostTypeId="2" ParentId="15637" CreationDate="2014-11-26T14:47:21.983" Score="1" Body="&lt;p&gt;Well, you should use the spread as the default probability.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, A CDS spread of 593 bp for five-year Brazilian debt means that default insurance for a notion al amount of USD 1 m costs USD 59,300 p.a.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a 1-year CDS contract and assume that the total premium is paid up front. Let &#xA;S: CDS spread (premium), p: default probability, R: recovery rate. &#xA;The protection buyer expects to pay: S. His expected pay-off is (1-R)p. When two parties enter a CDS trade, S is set so that the value of the swap transaction is zero, i.e. S=(1-R)p ↔ S/(1-R)=p.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If R=25%, a spread of 500 bptranslates into p =6.6%. If R=0, we have S=p=5%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found this wikipedia article very enlightening.&#xA;&lt;a href=&quot;http://en.wikipedia.org/wiki/Credit_default_swap#Pricing_and_valuation&quot; rel=&quot;nofollow&quot;&gt;Price and Valuation&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13533" LastEditorUserId="13533" LastEditDate="2014-11-28T13:36:32.497" LastActivityDate="2014-11-28T13:36:32.497" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15640" PostTypeId="2" ParentId="15635" CreationDate="2014-11-26T14:48:43.200" Score="3" Body="&lt;p&gt;Actually BS model is still applicable in the market where the upwards/downwards move is much more probable than move in the opposite direction. The Black-Scholes price process model has the form:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{dS}{S} = \mu dt + \sigma dW$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And with significantly non-zero $\mu$ (called drift) it will capture just what you are talking about. Quite surprisingly, the option value does not depend on the drift, as you can see explained in (Question: &lt;a href=&quot;https://quant.stackexchange.com/questions/8247/why-drifts-are-not-in-the-black-scholes-formula/8320#8320&quot;&gt;Why Drifts are not in the Black Scholes Formula&lt;/a&gt;). I prefer my explanation using the put/call parity (which I can probably elaborate further in the comments).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You would seek another pricing formula only if the price behavior would be significantly different than the formula above can capture. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Compute log-returns of your prices. The drift $\mu$ is estimated by their mean, and volatility $\sigma$ by their standard deviation. If the returns are predominantly positive, your $\mu$ would turn out positive and it is not a problem for a BS model and not a factor in the option price in case other BS assumptions are valid. The real concern here is the statistical distribution of these log-returns. The more it differs from a normal distribution, the less usable BS model is. &lt;/p&gt;&#xA;" OwnerUserId="3120" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2014-11-27T08:14:40.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15641" PostTypeId="2" ParentId="15611" CreationDate="2014-11-26T19:27:34.520" Score="3" Body="&lt;p&gt;1) Analysis of Financial Time Series by Ruey Tsay &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) An Introduction to Bayesian Inference in Econometrics by Arnold Zellner&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not finance specific, but this is the best multivariate stats book I know of:&#xA;3) Applied Multivariate Statistical Analysis by Johnson and Wichern&lt;/p&gt;&#xA;" OwnerUserId="5407" LastActivityDate="2014-11-26T19:27:34.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15642" PostTypeId="1" AcceptedAnswerId="15655" CreationDate="2014-11-26T20:04:24.420" Score="5" ViewCount="23607" Body="&lt;p&gt;For a research project, I would like to work with some intraday asset prices. I have already successfully exported the corresponding data at daily frequency, using the Excel API, but somehow this doesn't seem to be possible for intraday data. Again, the export works perfectly using the Excel API for any frequency except intraday. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have selected both 'intraday bars' and 'intraday ticks' without success. I did in the end find the data as a plot, but can only export it as an image file, which doesn't help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I doing something wrong or is this kind of data not available for download? Is intraday data perhaps only available for specific exchanges? If this is the case, what are possible alternative sources? Could the fact that I am using a university terminal be a problem? Does Bloomberg differentiate between different licenses?&lt;/p&gt;&#xA;" OwnerUserId="13665" LastEditorUserId="13665" LastEditDate="2014-11-26T23:06:17.193" LastActivityDate="2016-05-06T19:34:52.057" Title="How can I export intraday frequency data from Bloomberg and (how) is this procedure different than for lower frequencies?" Tags="&lt;data&gt;&lt;market-data&gt;&lt;historical-data&gt;&lt;bloomberg&gt;&lt;intraday&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15643" PostTypeId="2" ParentId="7912" CreationDate="2014-11-26T20:22:50.623" Score="1" Body="&lt;p&gt;Revenue data for non-public companies are available only at a very low frequency, based on financial reporting requirements. It would be impossible to have a long enough period to estimate the normal return in the first place, let alone detect the effect that an event on one single day will have on the &lt;strong&gt;annual&lt;/strong&gt; revenues. Also, it would be very difficult to obtain a stationary time series from this, given that for a large enough estimation period (100 years?) the business environment will be transformed completely and there is an infinite number of other factors which have influence the company's profitability.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would in theory be possible to use data from performance management systems (cost accounting rather than financial accounting) which may be available to a company at a much higher frequency, which could then be used for a normal return estimation and the determination of cumulative abnormal returns (CARs). However, the implementation of this will be very difficult or impossible because cost accounting information has virtually no standardisation, and is not disclosed by any companies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whether to use prices or returns is a completely different question.&lt;/p&gt;&#xA;" OwnerUserId="13665" LastActivityDate="2014-11-26T20:22:50.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15644" PostTypeId="1" CreationDate="2014-11-26T21:50:18.947" Score="8" ViewCount="6523" Body="&lt;p&gt;I have been trying to resolve this problem for some time but I cannot get the correct answer. The problem is the following one.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Compute the initial value of a forward-starting swap that begins at&#xA;  $t=1$, with maturity $T=10$ and a fixed rate of 4.5%.&#xA;  (The first payment then takes place at $t=2$ and the final payment takes place at&#xA;  $t=11$ as we are assuming, as usual, that payments take place in arrears.) You&#xA;  should assume a swap notional of 1 million and assume that you receive&#xA;  floating and pay fixed.)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;We also know that &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$r_{0,0}=5\%$&lt;/li&gt;&#xA;&lt;li&gt;$u=1.1$&lt;/li&gt;&#xA;&lt;li&gt;$d=0.9$&lt;/li&gt;&#xA;&lt;li&gt;$q=1−q=1/2$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Using forward equations from $t=1$ to $t=9$, I cannot resolve the problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what I have done in Excel with a final result of -31076 but it is not the correct answer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Ifows.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="13666" LastEditorUserId="467" LastEditDate="2014-11-27T01:38:17.330" LastActivityDate="2018-07-14T19:04:28.993" Title="How to calculate a forward-starting swap with forward equations?" Tags="&lt;swaps&gt;&lt;forward&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15645" PostTypeId="2" ParentId="15153" CreationDate="2014-11-26T23:23:03.457" Score="1" Body="&lt;p&gt;In general, no such index exists as where with stocks you are just holding most of the major players with currencies you are always making a long/short bet.  A common EUR futures  position, for instance, is really a long EUR/short USD bet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still if your managers are USD denominated holding (long-only) a basket of foreign currencies the already mentioned Dollar Index or perhaps better the &lt;a href=&quot;http://research.stlouisfed.org/fred2/series/DTWEXM&quot; rel=&quot;nofollow&quot;&gt;Fed's Broad Trade Weighted Dollar index&lt;/a&gt; might be better.  Be very careful, however, using these as you would the sp500 for a large-cap stock trader unless your managers are long foreign only and reasonably broad.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also compare your managers to an index of currency managers, but peer benchmarking often adds more problems than it solves.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The CFA Institute has a wonderful write-up on the &lt;a href=&quot;http://blogs.cfainstitute.org/insideinvesting/2013/02/15/investing-in-currencies-the-problem-with-benchmarks/&quot; rel=&quot;nofollow&quot;&gt;problems of currency benchmarks&lt;/a&gt;.  The simple and common solution I've seen is to just treat them as absolute return  managers and look at statistics such as the volatility, draw-down, Sharpe ratio ect..&lt;/p&gt;&#xA;" OwnerUserId="5689" LastActivityDate="2014-11-26T23:23:03.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15646" PostTypeId="2" ParentId="15153" CreationDate="2014-11-27T01:13:23.647" Score="1" Body="&lt;p&gt;Assessing traders performance in that context is I believe quite similar to assessing Hedge Fund's performances (especially market-neutral): there is no obvious direct index for this, and it will always be tougher than for long-only equity funds obviously.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I did use an index called &lt;a href=&quot;https://www.hedgefundresearch.com/index.php?fuse=hfrx_strats&quot; rel=&quot;nofollow&quot;&gt;HFRX Macro: Currency Index&lt;/a&gt;, which is basciallyl an aggregate of different HF performances using FX strategies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the official description (sorry the output is not great but I copied it from the official website and it's not better there):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Currency Index include both discretionary and systematic currency&#xA;  strategies. Systematic Currency strategies have investment processes&#xA;  typically as function of mathematical, algorithmic and technical&#xA;  models, with little or no influence of individuals over the portfolio&#xA;  positioning. Strategies which employ an investment process designed to&#xA;  identify opportunities in markets exhibiting trending or momentum&#xA;  characteristics across currency assets classes, frequently with&#xA;  related ancillary exposure in sovereign fixed income. Strategies&#xA;  typically employ quantitative process which focus on statistically&#xA;  robust or technical patterns in the return series of the asset, and&#xA;  typically focus on highly liquid instruments and maintain shorter&#xA;  holding periods than either discretionary or mean reverting&#xA;  strategies. Although some strategies seek to employ counter trend&#xA;  models, strategies benefit most from an environment characterized by&#xA;  persistent, discernible trending behavior. Systematic Currency&#xA;  strategies typically would expect to have greater than 35% of&#xA;  portfolio in dedicated currency exposure over a given market cycle.&#xA;  Discretionary Currency strategies are reliant on the fundamental&#xA;  evaluation of market data, relationships and influences as they&#xA;  pertain primarily to currency markets including positions in global&#xA;  foreign exchange markets, both listed and unlisted, and as interpreted&#xA;  by an individual or group of individuals who make decisions on&#xA;  portfolio positions; strategies employ an investment process most&#xA;  heavily influenced by top down analysis of macroeconomic variables.&#xA;  Portfolio positions typically are predicated on the evolution of&#xA;  investment themes the Manager expect to materialize over a relevant&#xA;  timeframe, which in many cases contain contrarian or volatility&#xA;  focused components. Investment Managers also may trade actively in&#xA;  developed and emerging markets, focusing on both absolute and relative&#xA;  levels on equity markets, interest rates/fixed income markets,&#xA;  currency; frequently employing spread trades to isolate a differential&#xA;  between instrument identified by the Investment Manager to be&#xA;  inconsistent with expected value. Discretionary Currency strategies&#xA;  typically would expect to have greater than 35% of portfolio in&#xA;  dedicated currency exposure over a given market cycle. &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Hedge Fund Research, Inc. (HFR) utilizes a UCITSIII compliant&#xA;  methodology to construct the HFRX Hedge Fund Indices. The methodology&#xA;  is based on defined and predetermined rules and objective criteria to&#xA;  select and rebalance components to maximize representation of the&#xA;  Hedge Fund Universe. HFRX Indices utilize state-of-the-art&#xA;  quantitative techniques and analysis; multi-level screening, cluster&#xA;  analysis, Monte-Carlo simulations and optimization techniques ensure&#xA;  that each Index is a pure representation of its corresponding&#xA;  investment focus. Full strategy and regional descriptions&#xA;  (multi-language), as well as the full &quot;HFRX Hedge Fund Indices Defined&#xA;  Formulaic Methodology&quot; may be downloaded here.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="467" LastActivityDate="2014-11-27T01:13:23.647" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15647" PostTypeId="2" ParentId="15642" CreationDate="2014-11-27T07:03:17.140" Score="2" Body="&lt;p&gt;The answer to your question probably depends on the type of the security you want to query the data from, their vendor (not Bloomberg, the original vendor) and your license with Bloomberg.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't remember having no access to intraday data, but I remember having limited history for sure (more data implied more fees as far as I can remember).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in general, @rhaskett's comment is really the best thing we can advise, just use Bloomberg's help. They will know (or they'll find out what's wrong) and if they can't help you then there is little chance we can.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2014-11-27T07:03:17.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15648" PostTypeId="1" CreationDate="2014-11-27T10:29:10.313" Score="1" ViewCount="35" Body="&lt;p&gt;The setting is simple, i.e. formula for demand of service/product is linear&lt;br&gt;&#xA;$$&#xA;  d = \alpha - \beta p&#xA;$$&#xA;where $ \alpha $ is maximum demand, $ \beta $ is some coefficient, and $ p $ is price. There are two firms, with different prices $p_1$ and $ p_2 $, and the prices are fixed, so there is no competition. The fraction of total demand is captured by the logit rule (price-oriented)&lt;br&gt;&#xA;$$&#xA;  f = \frac{e^{-\gamma p_1}}{e^{-\gamma p_1} + e^{-\gamma p_2}}&#xA;$$ &#xA;where $ \gamma $ is some sensitivity coefficient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;: how can I estimate total demand in this setting?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I found an answer by my own, but I'm not sure if it is OK. The answer is the solution of this, I belive, transcedent equation&#xA;$$&#xA;  d = \beta - \beta \ln q + \beta \ln (\alpha (e^{-p_1} + e^{-p_2}))&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="13668" LastEditorUserId="13668" LastEditDate="2014-11-27T13:13:28.150" LastActivityDate="2014-11-27T13:13:28.150" Title="Total demand under logit model" Tags="&lt;pricing&gt;&lt;market&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15651" PostTypeId="1" AcceptedAnswerId="15705" CreationDate="2014-11-27T16:16:22.713" Score="1" ViewCount="82" Body="&lt;p&gt;I am looking at the quantitative model our team is using for analyzing the performance of a portfolio of stocks. However I don't understand what the model is trying to achieve. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The model is supposed to do a simple job: evaluate the performance of a portfolio against the market history. The basic idea is, say, I have a portfolio in my mind consisting of 10 different stocks. I want to know that if I had created this portfolio in market one month ago, how well would it perform? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To evaluate how well the portfolio would do, i need to calculate the value of the portfolio for every single day in the past month (in order to further calculate daily return rate). Here is the model implemented in our code:&#xA;$$&#xA;V_{t}=V_{t-1}\sum\nolimits_i(\frac{P_{i,t}}{P_{i,t-1}}\cdot W_{i,t})&#xA;$$&#xA;where&#xA;$$&#xA;W_{i,t} = \frac{Q_{i,t}\cdot P_{i,t}}{\sum\nolimits_i(Q_{i,t}\cdot P_{i,t})}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V_t$ is the value of portfolio on date $t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P_{i,t}$ is the price of stock $i$ on date $t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Q_{i,t}$ is the quantity of stock $i$ on date $t$ (which is for most of time a constant with regard to %t%)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$W_{i,t}$ is the weight of stock $i$ in the portfolio on date $t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would imagine the value of the portfolio on a given date t is as simple as the sum of the value of all the constitute stocks on that given day. However looking at the model we are using at the moment, the value of a portfolio on day t is expressed relatively to the value of the portfolio on the previous day. Whoever implemented the model has left a comment there saying &quot;it is because we need consider IPO stocks&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anybody help me understand this model? what is the difference between this model and a simple sum of value? &lt;/p&gt;&#xA;" OwnerUserId="13671" LastEditorUserId="13671" LastEditDate="2014-12-02T09:14:48.043" LastActivityDate="2014-12-02T09:14:48.043" Title="In theory historical performance of a portfolio" Tags="&lt;portfolio-management&gt;&lt;portfolio&gt;&lt;analysis&gt;&lt;performanceanalytics&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15654" PostTypeId="1" CreationDate="2014-11-27T21:49:47.210" Score="3" ViewCount="144" Body="&lt;p&gt;I was asked this question in an interview and despite thinking about it for a while, I haven't been able to come up with a good answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose you have a strategy you are running where at certain points your orders are a significant percentage of the order book (e.g., perhaps because you are trading a very thin market). Now you have made a small change to the strategy and want to backtest your change. How can you compensate in your backtest for the fact that your (live) strategy has orders in the market around the same time that your backtest has orders in the market? Presumably your live orders impact the market and the market would be different if your live orders were not there.&lt;/p&gt;&#xA;" OwnerUserId="5251" LastActivityDate="2014-11-27T21:49:47.210" Title="Adjusting for your own orders in future backtests" Tags="&lt;backtesting&gt;&lt;high-frequency&gt;&lt;limit-order-book&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15655" PostTypeId="2" ParentId="15642" CreationDate="2014-11-27T22:17:35.007" Score="8" Body="&lt;p&gt;None of the previous answers have mentioned the fact that &lt;a href=&quot;http://www.bloomberglabs.com/api/libraries/&quot;&gt;Bloomberg supports an  API&lt;/a&gt; with support for &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;all the main languages (C, C++, Java, Python, Perl -- and even &lt;a href=&quot;https://github.com/bloomberg/blpapi-node&quot;&gt;Node&lt;/a&gt; and &lt;a href=&quot;https://github.com/bloomberg/blpapi-hs&quot;&gt;Haskell&lt;/a&gt; support on GitHub),&lt;/li&gt;&#xA;&lt;li&gt;on all the relevant operating systems: Windows, Linux, OS X, Solaris.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This includes support for tick data which is stored in a rolling window (ie from today backwards for a given number of days, IIRC this number is 140). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, the &lt;em&gt;usage terms&lt;/em&gt; are well known: You are generally not allowed to take the data retrieved this way off the machine on which you have the license. I.e. no further distribution even within your office.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But for the narrow question of &quot;can I programmatically access Tick Data from Bloomberg&quot;, the answer is a clear &quot;yes&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;  So now at work, here is a quick example from inside an &lt;a href=&quot;http://www.r-project.org&quot;&gt;R&lt;/a&gt; session:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;R&amp;gt; library(Rblpapi)&#xA;R&amp;gt; con &amp;lt;- blpConnect()&#xA;R&amp;gt; head( res &amp;lt;- getBars(con, &quot;CLA Comdty&quot;))&#xA;                     open  high   low close numEvents volume&#xA;2014-11-28 03:46:00 68.62 68.83 68.36 68.57      4960   6226&#xA;2014-11-28 04:46:00 68.56 69.33 68.49 69.05      8147  10356&#xA;2014-11-28 05:46:00 69.05 69.47 68.80 68.92      8757  11398&#xA;2014-11-28 06:46:00 68.90 69.31 68.80 68.98      6271   7642&#xA;2014-11-28 07:46:00 68.98 69.62 68.88 69.27     12022  14963&#xA;2014-11-28 08:46:00 69.27 69.59 69.01 69.33     23881  28821&#xA;R&amp;gt; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I set this up to use most default values:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;hourly bars, which could be changed to any multiple of minutes&lt;/li&gt;&#xA;&lt;li&gt;start and end time derived from current time (which was 8:33 when I ran that)&lt;/li&gt;&#xA;&lt;li&gt;a given contract (here using the Crude Oil front contract, which made some news overnight)&lt;/li&gt;&#xA;&lt;li&gt;default connection attributes&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;returning an &lt;a href=&quot;http://cran.r-project.org/package=xts&quot;&gt;xts&lt;/a&gt; container, and implemented as a simple wrapper around the C++ API.&lt;/p&gt;&#xA;" OwnerUserId="69" LastEditorUserId="69" LastEditDate="2014-11-28T14:48:48.150" LastActivityDate="2014-11-28T14:48:48.150" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15657" PostTypeId="2" ParentId="15634" CreationDate="2014-11-27T23:09:51.860" Score="2" Body="&lt;p&gt;I think it will also depend on the amount of the orders you will entering. In FXInside it will also depend if you are just aggregating or using a HUB, and even if you use the HUB it will depend if you are enable to &quot;make liquidity&quot; otherwise you will be only sending an agressive watch order waiting a market move. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't have any number to share with you, but by manually trading I could said hotspot has good fill rations for bids and offers inside the spread. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't know neither if Bloomberg Tradebook is available via fix, but I can remember a lot of small amount fills, if your are planing to send small orders, maybe it could help. Its easy to get filled if there is a &quot;fishing algo&quot; in the other side taking small amounts to see if there is real liquidity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other way around with FastMatch, because there you will gain priority based in the order size.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And the last but not less important, obviously it will depend in the currency pair, but for sure you are taking that in account already.&lt;/p&gt;&#xA;" OwnerUserId="13674" LastActivityDate="2014-11-27T23:09:51.860" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15659" PostTypeId="1" CreationDate="2014-11-27T23:21:31.933" Score="2" ViewCount="5228" Body="&lt;p&gt;The government par yield curve shows a marginally lower yield than the Government zero coupon curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the reason for this in general. &lt;/p&gt;&#xA;" OwnerUserId="13675" LastActivityDate="2015-01-27T05:12:03.483" Title="Par and Zero Coupon Yield Curves" Tags="&lt;yield-curve&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15660" PostTypeId="1" CreationDate="2014-11-27T23:31:09.543" Score="5" ViewCount="695" Body="&lt;p&gt;Really struggling in this question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a market with two assets $(B,S)$ whose price dynamics satisfy&#xA;\begin{equation}&#xA;dB_t =  B_t r dt&#xA;\end{equation}&#xA;\begin{equation}&#xA;\quad \quad \quad \quad \, \, \, \, \, \, \, dS_t  =  S_t ( r dt + \sqrt{v_t} dW_t)&#xA;\end{equation}&#xA;\begin{equation}&#xA;\quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \, \, \, \, \, \, dv_t  = (a -b v_t ) dt + c \sqrt {v_t} ( \rho dW_t + \sqrt{ 1- \rho^2} dZ_t),&#xA;\end{equation}&#xA;where $r, a, b, c \text{ and } \rho$ are constants, with $a,b&amp;gt;0$ and $-1 \leq \rho \leq 1$, and $W$ and $Z$ are independent Brownian motions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $F: [0,T] \times \mathbb{R}_{+} \times \mathbb{R}_{+} \rightarrow \mathbb{R}_{+} $ satisfy the PDE &#xA;\begin{equation}&#xA;\frac{\partial F}{\partial t} + Sr \frac{\partial F}{\partial S} + (a-b v_t) \frac{\partial F}{\partial v} + \frac{1}{2} S^2 v\frac{{\partial}^2 F}{\partial S^2} + c \rho Sv \frac{{\partial}^2 F}{\partial S \partial v} +  \frac{1}{2} c^2 v \frac{ {\partial}^2 F}{\partial v^2} = rF,&#xA;\end{equation}&#xA;with boundary conditions $F(T,S,v) = \sqrt{S}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Introduce a contingent claim with payout $\xi_T = \sqrt{S_T}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is to show that in the augmented market, &lt;strong&gt;&lt;em&gt;there is a strictly positive Ito process $(Y_t)_{t \geq 0}$ such that $(Y_t ( B_t, S_t, \xi_t))_{t \geq 0}$ is a local martingale, if the time-$t$ price of the contingent claim is given by $\xi_t = F(t, S_t, v_t)$.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What I have done so far (applying Ito's formula and using the PDE)&lt;/strong&gt;:&#xA;\begin{equation}&#xA;d \xi_t = r F(t, S_t, v_t) dt + \bigg( \frac{\partial F}{\partial S} (t, S_t, v_t) \sqrt{v_t} + \frac{\partial F}{\partial v} (t, S_t, v_t) c \sqrt{v_t} \rho \bigg) dW_t + \frac{\partial F}{\partial v} (t, S_t, v_t) c \sqrt{v_t} \sqrt{1-\rho^2} dZ_t.&#xA;\end{equation}&#xA;I try out $Y$ with $dY_t  = m_t dt + n_t dW_t + q_t dZ_t$, for processes $(m_t)$, $(n_t)$ and $(q_t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first condition that $(Y_t B_t)$ is a local martingale tells us that $m_t=0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second condition that $(Y_t B_t)$ is a local martingale seems to tell us that $n_t= Y_t ( \frac{-r}{1+\sqrt{v_t}})$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, the expression for $q_t$ is so complicated that I cannot conclude from there that $(Y_t)$ is strictly positive. Any ideas???&lt;/p&gt;&#xA;" OwnerUserId="13654" LastEditorUserId="13654" LastEditDate="2014-11-28T18:13:13.363" LastActivityDate="2014-11-28T18:13:13.363" Title="arbitrage in Heston model" Tags="&lt;arbitrage&gt;&lt;stochastic-volatility&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15661" PostTypeId="2" ParentId="15660" CreationDate="2014-11-27T23:51:39.510" Score="1" Body="&lt;p&gt;Show that the discounted expectation price of the new security is the same as the solution of the PDE. Once this is done all three assets have discounted price processes which are martingales so there can be no arbitrage.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2014-11-27T23:51:39.510" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15662" PostTypeId="1" CreationDate="2014-11-28T00:52:23.540" Score="0" ViewCount="39" Body="&lt;p&gt;&lt;a href=&quot;http://books.google.com/books?id=SWFkCIRMNtoC&amp;amp;pg=PA203&amp;amp;dq=%22dynamic%20programming%22%20%22expected%20utility%22&amp;amp;hl=en&amp;amp;sa=X&amp;amp;ei=bml3VJX-CsX8igKx4YCgBQ&amp;amp;ved=0CDQQ6AEwBA#v=onepage&amp;amp;q=%22dynamic%20programming%22%20%22expected%20utility%22&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;Book&lt;/a&gt; suggests that &quot;asset returns are assumed to be serially independent, so wealth is a single state connecting one period to the next&quot;. I understand path dependency is lost in case of serial independence but how do all states at a stage collapse to a single state?  &lt;/p&gt;&#xA;" OwnerUserId="2142" LastActivityDate="2014-11-28T00:52:23.540" Title="dynamic programming with serially independent returns" Tags="&lt;optimization&gt;&lt;returns&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15664" PostTypeId="2" ParentId="15659" CreationDate="2014-11-28T03:13:12.560" Score="4" Body="&lt;p&gt;This is actually only true when the yield curve is upward sloping. Intuitively, zero rates are average forward rates; e.g., the 10-year zero coupon yield is the geometric average of the 0y forward 1y rate, 1y forward 1y rate, 2y forward 1 year rate, ..., and 9y forward 1y rate:&#xA;$$ (1 + y_{10})^{10} = (1 + f_{0,1})(1 + f_{1,2})\ldots(1 + f_{9,10}). $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So whenever the forward curve is upward sloping, the zero curve will be a bit lower because of the averaging. Similarly, par yields are (somewhat complex) average of the zero coupon rates, so when the curve is upward sloping, they're even lower that the zero curve. (I wrote about this topic here &lt;a href=&quot;http://hungrydummy.com/blog/bond-risk-premium-part-i-a-review-of-different-yield-curves/&quot; rel=&quot;nofollow&quot;&gt;http://hungrydummy.com/blog/bond-risk-premium-part-i-a-review-of-different-yield-curves/&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When the yield curve is downward sloping, however, the par curve is actually the highest, zero curve in the middle, and the forward curve is the lowest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When the yield curve is flat, the three curves will be identical.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2014-11-28T04:26:14.873" LastActivityDate="2014-11-28T04:26:14.873" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15665" PostTypeId="1" AcceptedAnswerId="15666" CreationDate="2014-11-28T03:27:13.733" Score="3" ViewCount="685" Body="&lt;p&gt;Why people say that volatility is a coherent risk measure?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't see it clearly because what happen if the two assets are correlated positively? subadditivity would not be preserved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That affirmation is in some papers online or even in &lt;a href=&quot;https://quant.stackexchange.com/a/4015/13660&quot;&gt;this question&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13660" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2014-11-28T04:07:56.040" Title="Is volatility really a coherent risk measure?" Tags="&lt;coherent-risk-measure&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15666" PostTypeId="2" ParentId="15665" CreationDate="2014-11-28T04:06:56.423" Score="3" Body="&lt;p&gt;Well, if you assume $X$ has volatility $\sigma_X$ and $Y$ has volatility $\sigma_Y$, then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma_{X+Y} = \sqrt{ Var( X + Y) } = \sqrt{ \sigma_X^2+\sigma_Y^2 + 2 \sigma_X \sigma_Y \rho }$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, you want to show&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \sigma_{X+Y} = \sqrt{ \sigma_X^2+\sigma_Y^2 + 2 \sigma_X \sigma_Y \rho } \leq \sigma_X + \sigma_Y $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Squaring both sides:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma_X^2+\sigma_Y^2 + 2 \sigma_X \sigma_Y \rho \leq \sigma_X^2 + \sigma_Y^2 + 2 \sigma_X \sigma_Y $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the fact that, by definition, $\sigma_X \geq 0$, $\sigma_Y \geq 0$ and $\rho \in [ -1, 1]$, it looks to me that the property holds.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2014-11-28T04:06:56.423" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15667" PostTypeId="2" ParentId="15660" CreationDate="2014-11-28T05:04:03.423" Score="0" Body="&lt;p&gt;Mark Joshi has pretty much solved it. To add to it, you can see that from Feynamn Kac (see remarks in &lt;a href=&quot;http://en.wikipedia.org/wiki/Feynman&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Feynman&lt;/a&gt;–Kac_formula ) it follows that &#xA;$$&#xA;F(t,S,v) = B_t \mathbf{E}\left[  \frac{ \sqrt{ S_T } }{ B_T } \big \vert  S_t = S, v_t = v \right],&#xA;$$&#xA;where the expectation is taken with respect to a measure where $W$ and $Z$ are independent Brownian Motions. Note how this measure coincides with the risk neutral measure if the process $M_t = S_tB_t^{-1}$ is a martingale: risk neutral measure is the measure so that the underlying expressed in the savings account units is a martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So because of the equality above, if you show that $M_t$ is a martingale, then the price given as a solution to the pde is indeed arbitrage free. Now, this is easy, since &#xA;$$&#xA;dM_t = \sqrt{v_t} M_t dW_t,&#xA;$$ &#xA;which is a martingale in the Heston Model, by Novikov's condition (&lt;a href=&quot;http://en.wikipedia.org/wiki/Novikov&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Novikov&lt;/a&gt;'s_condition):&#xA;$$&#xA;\mathbf{E} \left[ e^{ \int_0^T v_r dr} \right] &amp;lt; \infty.&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="11945" LastActivityDate="2014-11-28T05:04:03.423" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15669" PostTypeId="1" AcceptedAnswerId="15670" CreationDate="2014-11-28T13:06:26.117" Score="3" ViewCount="365" Body="&lt;p&gt;Suppose that $W_{t}$ is a Wiener process. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume $W_{0}=0.$ Is it&#xA;true that $\int_{t=0}^{T}dW_{t}=W_{T}$? If so, why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is one preferred to the other?&lt;/p&gt;&#xA;" OwnerUserId="6661" LastActivityDate="2014-11-28T13:44:35.750" Title="Wiener process integral" Tags="&lt;wienerprocess&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15670" PostTypeId="2" ParentId="15669" CreationDate="2014-11-28T13:44:35.750" Score="6" Body="&lt;p&gt;yes, by definition. The integral is by definition the limit &#xA;$$&#xA;\int_0^T f_s dW_s = lim_{ n \to \infty } \sum_{ s_i \in \mathcal{P}_n } f_{s_i} ( W_{ s_{i+1} } - W_{s_i} ),&#xA;$$&#xA;where $\mathcal{P}_n$ is a partition of $n$ points of the interval $[0,T]$. In your case, for any partition, the sum above is telescopic and always evaluates to $W_T$. so the limit does too and the equality follows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once this idea is establish to use one or the other is a matter of taste and notation.&lt;/p&gt;&#xA;" OwnerUserId="11945" LastActivityDate="2014-11-28T13:44:35.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15671" PostTypeId="1" AcceptedAnswerId="15691" CreationDate="2014-11-28T17:35:46.760" Score="2" ViewCount="762" Body="&lt;p&gt;I am reading the Madoff case. One of the issue is BMIS Firm (Bernie Madoff Investment Securities) were acting as a Asset Management Firm, broker as well as Custodian. Why is it an issue? What sort of conflicts of interest did it create?&lt;/p&gt;&#xA;" OwnerUserId="13684" LastActivityDate="2014-12-01T15:00:17.933" Title="Why asset management firms shouldn't be custodian of its own funds?" Tags="&lt;trading&gt;&lt;asset&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15672" PostTypeId="1" AcceptedAnswerId="15676" CreationDate="2014-11-28T18:29:42.053" Score="4" ViewCount="2532" Body="&lt;p&gt;Given the limitation Bloomberg imposes in terms of the number of days you can go into the past when retrieving historical intraday data, what are similarly reliable alternative solutions? I require some data for a one-time research project, so I would ideally want to download or purchase the data just once, without a subscription.&lt;/p&gt;&#xA;" OwnerUserId="13665" LastActivityDate="2020-08-03T23:46:06.430" Title="Bloomberg-alternatives for intraday stock price data?" Tags="&lt;historical-data&gt;&lt;bloomberg&gt;&lt;intraday&gt;" AnswerCount="6" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15674" PostTypeId="1" CreationDate="2014-11-28T21:01:09.463" Score="4" ViewCount="461" Body="&lt;p&gt;I want to estimate an empirical pricing kernel for an index. Hence, I need to estimate a physical and risk neutral density. For estimating the physical density, only the index data in an observed time interval is needed. Moreover, I know for estimating the risk neutral density I can use option prices with different strike prices and time to maturity. However, I think the observation date for the option prices should somehow correspondent to the time interval used for estimating the physical density. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, my question is how the observation date for the option prices has to correspond to the used time interval. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The empirical pricing kernel equal is also referred to as the stochastic discount factor.&lt;/p&gt;&#xA;" OwnerUserId="13585" LastEditorUserId="13585" LastEditDate="2014-12-01T19:23:12.280" LastActivityDate="2015-01-10T21:22:44.453" Title="Data Selection for Empirical Pricing Kernel Estimation (Stochastic Discount Factor)" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;risk-neutral-measure&gt;&lt;kernel&gt;&lt;stochastic-discount&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15675" PostTypeId="2" ParentId="15627" CreationDate="2014-11-28T21:47:36.300" Score="1" Body="&lt;p&gt;Part 1:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Show that there exists a trading strategy which replicates a European Call.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Proof:  I am actually going to prove a stronger statement: that there exists an admissible trading strategy which replicates any payoff in this market.  By the First Fundamental Theorem of Asset Pricing, there is no arbitrage if there exists a change of measure such that, for all assets, the following holds:&#xA;$$X_t=\mathbb{\tilde{E}}[e^{-r(T-t)} X_T | \mathcal{F}_t]$$&#xA;By Girsonav's theorem, the following change of measure can be made: &#xA;$$d\tilde{W}_t=dW_t+\frac{\mu-rS}{\sigma}dt$$&#xA;Substituting this into the dynamics of $$dS_t=\mu dt+\sigma dW_t$$&#xA;yields&#xA;$$dS_t=rS_tdt+\sigma d\tilde{W}_t $$&#xA;The expected value of this process is&#xA;$$\mathbb{\tilde{E}}[S_T | \mathcal{F}_t]=S_t+\mathbb{\tilde{E}}\left[\int_t ^ T rS_u du |\mathcal{F}_t\right] $$&#xA;Taking the expectation inside the integral on the right hand side,&#xA;$$\mathbb{\tilde{E}}[S_T | \mathcal{F}_t]=S_t+\int_t ^ T r\mathbb{\tilde{E}}\left[S_u |\mathcal{F}_t\right] du  $$&#xA;Letting $$f(t, T)=\mathbb{\tilde{E}}[S_T | \mathcal{F}_t]$$&#xA;And taking the differential of both sides, &#xA;$$df=rfdt \implies \frac{df}{dt}=rf$$&#xA;This is an ODE with initial condition $$f(t, t)=S_t $$&#xA;This ODE has the unique solution $$S_t e^{r(T-t)} $$&#xA;Thus $$\mathbb{\tilde{E}} [S_T e^{-r(T-t)}]=S_t e^{r(T-t)} e^{-r(T-t)}=S_t $$&#xA;Hence this model does not admit arbitrage.  By the Second Fundamental Theorem of Asset Pricing, there exists a unique change of measure if and only if every payoff can be replicated.  In this model with a single Brownian motion, the change of measure is one such that &#xA;$$ dS=rS dt+\sigma(dW+\theta dt)=\mu dt+\sigma dW $$&#xA;Solving for theta, &#xA;$$  rS+\theta \sigma=  \mu $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly this has a single solution, namely&#xA;$$\theta=\frac{\mu-rS}{\sigma} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This proves 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Part 2:  Show that the Delta of the option is between zero and one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By Feynman-Kac and Ito's lemma,&#xA;$$e^{-rt} g(S_t, t, T)=e^{-rT}\mathbb{E}[h(S_T)|\mathcal{F}_t]$$ &#xA;implies that g has the following dynamics:&#xA;$$\frac{\partial g}{\partial t} dt+\frac{\partial g}{\partial S} dS_t+\frac{\partial^2 g}{2\partial S^2} \sigma^2 dt -rg dt $$&#xA;Comparing this with the dynamics of the self-financing replicating portfolio $$X_t=\Delta S_t+\Gamma B_t $$&#xA;$$dX_t=\Delta dS_t+\Gamma dB_t $$&#xA;By the First Fundamental Theorem of Asset pricing, $$X_t=g(S_t, t, T) $$&#xA;It is thus clear that $$\Delta=\frac{\partial g}{\partial S}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Writing the expectation of the payoff as an integral,&#xA;$$X_t=e^{-r(T-t)}\int_K ^ \infty (S_T-K) d\mathbb{\tilde{P}} $$&#xA;$$=e^{-r(T-t)}\int_{K-S} ^ \infty (S e^{r(T-t)} +y-K) p(y) dy $$&#xA;Taking the derivative with respect to S,&#xA;$$\frac{\partial g}{\partial S}= \int_{K-Se^{r(T-t)}} ^ \infty  p(y) dy -e^{-r(T-t)}(K-Se^{r(T-t)}+Se^{r(T-t)}-K)p(y)=\mathbb{\tilde{P}}(S_T&amp;gt;K) $$&#xA;Thus the delta of the option can be written as a probability, which is always between zero and one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This proves 2.&lt;/p&gt;&#xA;" OwnerUserId="9403" LastEditorUserId="9403" LastEditDate="2014-11-29T13:53:50.550" LastActivityDate="2014-11-29T13:53:50.550" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="15676" PostTypeId="2" ParentId="15672" CreationDate="2014-11-28T23:11:47.427" Score="4" Body="&lt;p&gt;Complete intraday data history can be obtained through the Thomson Reuters DataScope Tick History (TRDTH) archive: &lt;a href=&quot;http://thomsonreuters.com/tick-history&quot; rel=&quot;nofollow&quot;&gt;http://thomsonreuters.com/tick-history&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may ask them for a trial subscription.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-11-28T23:11:47.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15677" PostTypeId="2" ParentId="15627" CreationDate="2014-11-28T23:24:13.927" Score="0" Body="&lt;p&gt;The stock weight $\pi_t\geq0$ is nonnegative as $C_T=\max(S_T-K,0)$ is increasing in $S_T$ (always long).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\pi_t\leq 1$ cannot be greater than one, because one can receive at most 1 stock from the call at maturity, so you dont pay more than 1 stock price for it. Otherwise, one could buy the (cheaper) call and sell the replicating portfolio for riskfree profit at maturity.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-11-29T11:45:35.097" LastActivityDate="2014-11-29T11:45:35.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15678" PostTypeId="1" CreationDate="2014-11-29T05:24:58.137" Score="1" ViewCount="30" Body="&lt;p&gt;Futures have fixed lot sizes in my exchange, but cash do not. When I am spread trading the cash - future pair, what should I do if I am unable to get enough fill on the cash side. &lt;/p&gt;&#xA;" OwnerUserId="13689" LastActivityDate="2014-11-29T05:24:58.137" Title="What to do when I do not get enough fill in cash leg during cash - future arbitrage" Tags="&lt;spread&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15681" PostTypeId="1" CreationDate="2014-11-29T11:11:48.120" Score="1" ViewCount="85" Body="&lt;p&gt;The law of one price (i.e. for assets $S^{(i)}$ and  $S^{(j)}$,  $S^{(i)}_T = S^{(j)}_T $ almost surely implies that $S^{(i)}_t = S^{(j)}_t $ almost surely for all $ 0 \leq t \leq T$) is known to hold in discrete time when there is no arbitrage. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, my lecturer claims that this statement might not hold in continuous time. Can anyone give me an example for that?&lt;/p&gt;&#xA;" OwnerUserId="13654" LastActivityDate="2016-11-04T20:07:26.167" Title="Law of one price in continuous time" Tags="&lt;stochastic-processes&gt;&lt;arbitrage&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15682" PostTypeId="1" AcceptedAnswerId="15712" CreationDate="2014-11-29T16:39:01.177" Score="2" ViewCount="532" Body="&lt;p&gt;I went through &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1117574&quot; rel=&quot;nofollow&quot;&gt;The Black-Litterman Approach: Original Model and Extensions&lt;/a&gt; - see &lt;a href=&quot;http://www.palgrave-journals.com/jam/journal/v1/n2/abs/2240011a.html&quot; rel=&quot;nofollow&quot;&gt;also&lt;/a&gt;. The BL approeach starts with a prior on the expected returns vector derived from the hypothesis that the market is in equilibrium. Then we take a bunch of views and get a posterior model with a new mean vector and covariance matrix.&#xA;The step that is necessary to do so is mainly straigtht forward Bayes reasoning.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question: If my prior is some set of mean vectors (from some statistical methods e.g. based on Sharpe-ratios and historical volatilties) and then mixed with views - can I use just the same formulas? As far as I see it does not really matter where my prior is derived from.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2014-12-01T12:47:28.940" LastActivityDate="2014-12-02T10:25:31.183" Title="Is an arbitrary prior for Black-Litterman valid? Or do we need a market implied one?" Tags="&lt;portfolio-management&gt;&lt;black-litterman&gt;&lt;bayes-theory&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15684" PostTypeId="1" CreationDate="2014-11-29T18:02:58.077" Score="2" ViewCount="73" Body="&lt;p&gt;I know that Black Scholes and the Greeks are important in market risk. In what other areas are they used?&lt;/p&gt;&#xA;" OwnerUserId="13696" LastActivityDate="2014-11-29T18:02:58.077" Title="In which divisions of banking are the Greeks and Black Scholes equation applied?" Tags="&lt;black-scholes&gt;&lt;greeks&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ClosedDate="2014-12-04T04:10:12.827" ContentLicense="CC BY-SA 3.0" />
  <row Id="15685" PostTypeId="1" CreationDate="2014-11-29T19:56:47.933" Score="5" ViewCount="553" Body="&lt;p&gt;It is known that in an arbitrage-free continuous time market, the price of every asset is evaluated as the corresponding price in the replicating strategy using risk-neutral valuation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to know is the converse true? &#xA;There is actually a question that asks to show that for a Black-Scholes model with a bank account ($dB_t = B_t r dt$) and a stock satisfying $dS_t = r S_t dt + \sigma S_t dW_t$, then there is no arbitrage if the time-t price of a call with maturity $T$ and strike $K$ is &#xA;\begin{equation}&#xA;X_t= S_t \mathbb{E} \big\{ \big( e^{-\frac{(T-t)\sigma^2}{2} + \sqrt{T-t} \sigma Z}  - \frac{K e^{-r(T-t)}}{S_t} \big)^{+} \big\}.&#xA;\end{equation}&#xA;Any ideas of how to show this? I don't know how to evaluate this expectation, as it involves two random variables and I don't know the joint density of $S_t$ and $Z$.&lt;/p&gt;&#xA;" OwnerUserId="13654" LastEditorUserId="13654" LastEditDate="2014-11-29T22:07:43.403" LastActivityDate="2014-11-29T22:07:43.403" Title="risk-neutral valuation implies no arbitrage?" Tags="&lt;black-scholes&gt;&lt;arbitrage&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15686" PostTypeId="1" CreationDate="2014-11-29T20:08:27.583" Score="1" ViewCount="85" Body="&lt;p&gt;If market participants are certain a stock will suffer a huge decline, the shares will become hard to borrow and an interest fee will be applied to borrow the stock. This interest fee eliminates the arbitrage opportunity from having ATM puts being more expensive than calls. In The context of options pricing, what happens when you have an opposite situation when everyone expects the stock to rise? If calls become more expensive than puts then you have arbitrage,  and there is no such thing as 'hard to buy' . I imagine what happens is the stock would suddenly spike higher until the easy money is made. Like what would happen if a billionaire pledged to keep the stock above a certain price level or if the company underwent extremely aggressive buybacks?&lt;/p&gt;&#xA;" OwnerUserId="13515" LastActivityDate="2014-11-29T20:08:27.583" Title="Opposite of hard to borrow?" Tags="&lt;options&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15687" PostTypeId="2" ParentId="15685" CreationDate="2014-11-29T20:44:11.753" Score="0" Body="&lt;p&gt;The fact that one claim has an arbitrage-free price, does not imply that the entire market (for all claims) is arbitrage-free. E.g. $C_T=0$ is always arbitrage-free.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-11-29T21:11:28.487" LastActivityDate="2014-11-29T21:11:28.487" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15688" PostTypeId="2" ParentId="15685" CreationDate="2014-11-29T21:32:04.670" Score="-3" Body="&lt;p&gt;put call parity implies no arbitrage , along with a expected value of stock price of $pe^{rt}$ . working out the integrals yields this outcome &lt;/p&gt;&#xA;" OwnerUserId="13515" LastActivityDate="2014-11-29T21:32:04.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15689" PostTypeId="2" ParentId="15685" CreationDate="2014-11-29T21:38:55.223" Score="4" Body="&lt;p&gt;I do this question to death in Concepts and ...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If (discounted price of) everything is a martingale then every trading strategy is a martingale. Therefore any self-financing portfolio of initial value zero and has expectation zero. Therefore there are no arbitrages (since these have positive expectation and initial value zero).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So there is no arbitrage in the martingale measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the pricing measure and the real-world measure are equivalent so they have the same set of arbitrages. So there is no arbitrage in the real-world measure either. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if we set the price to be its expectation price, we get a martingale in the pricing measure and the price is arbitrage free. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2014-11-29T21:38:55.223" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15690" PostTypeId="2" ParentId="15685" CreationDate="2014-11-29T21:50:28.040" Score="0" Body="&lt;p&gt;You need to replace Z by Brownian motion at time t. Also, the expectation should be conditional expectation with respect to the sigma-algebra at time t.&#xA;See &lt;a href=&quot;http://kalx.net/fms/fms.html&quot; rel=&quot;nofollow&quot;&gt;http://kalx.net/fms/fms.html&lt;/a&gt; for a more complete explanation.&lt;/p&gt;&#xA;" OwnerUserId="2357" LastActivityDate="2014-11-29T21:50:28.040" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="15691" PostTypeId="2" ParentId="15671" CreationDate="2014-11-29T22:22:18.960" Score="1" Body="&lt;p&gt;Well I think the main issue is that the BMIS had no external party acting as an official holder of the books and records. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;Asset Manager&lt;/code&gt; utilizes &lt;code&gt;a broker&lt;/code&gt; to get access to the market, and the &lt;code&gt;Custodian&lt;/code&gt; (and the Administrator) to be the official keepers of the books and records of the trades, by validating and confirming the execution of each trade. Both are independent and their records should reconcile with the Asset Manager's portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some (I would say most of the) Funds have multiple brokers, but usually one custodian. Both the broker and the custodian are respectable institutions in the area like Banks, or others. It is something you check during your ODD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case it is like saying, I bought 100 shares of Google, I bought them myself at this amazing price, and please trust me because I hold the trade contract. The investor has no way of knowing  if this is true.&lt;/p&gt;&#xA;" OwnerUserId="13682" LastActivityDate="2014-11-29T22:22:18.960" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15692" PostTypeId="2" ParentId="3960" CreationDate="2014-11-29T22:24:29.690" Score="0" Body="&lt;p&gt;Their definition of arbitrage is not what a trader would call arbitrage.&#xA;See &lt;a href=&quot;http://kalx.net/ftapd.pdf&quot; rel=&quot;nofollow&quot;&gt;http://kalx.net/ftapd.pdf&lt;/a&gt; for the details.&lt;/p&gt;&#xA;" OwnerUserId="2357" LastActivityDate="2014-11-29T22:24:29.690" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15693" PostTypeId="2" ParentId="10777" CreationDate="2014-11-29T22:26:12.167" Score="1" Body="&lt;p&gt;See &lt;a href=&quot;http://kalx.net/ftapd.pdf&quot; rel=&quot;nofollow&quot;&gt;http://kalx.net/ftapd.pdf&lt;/a&gt; for a rigorous proof of the FTAP accessible at the masters level.&lt;/p&gt;&#xA;" OwnerUserId="2357" LastActivityDate="2014-11-29T22:26:12.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15694" PostTypeId="1" AcceptedAnswerId="15717" CreationDate="2014-11-29T22:46:13.630" Score="2" ViewCount="262" Body="&lt;p&gt;I am finance grad student, and working to create a financial statement database.  My objective is to download an income statement, balance sheet, and statement of cash flows for every publicly traded company that has filed with the SEC in the past 3-years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could this be done with a FTP connection to the SEC's directory, and would I be able to find what I am looking for there in the XBRL's?  &lt;a href=&quot;http://www.sec.gov/edgar/searchedgar/ftpusers.htm&quot; rel=&quot;nofollow&quot;&gt;http://www.sec.gov/edgar/searchedgar/ftpusers.htm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any insight, or alternative suggestions are welcomed.  Thank you in advance!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S.&#xA;I have considered using a bot and crawling a site that offers financial summaries, but am uncertain how viable this would be if they block my IP.  Has anybody else tried this?  Are some places more apt to block an IP than others?&lt;/p&gt;&#xA;" OwnerUserId="13699" LastActivityDate="2014-12-01T17:46:59.230" Title="Create 10-K Filing Database" Tags="&lt;historical-data&gt;&lt;database&gt;&lt;ftp&gt;&lt;macro&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15696" PostTypeId="1" CreationDate="2014-11-30T00:15:44.433" Score="3" ViewCount="832" Body="&lt;p&gt;I am so stuck on this question:&#xA;Consider a two-asset model where asset 0 is cash, so that the price of asset 0 is $B_t=1$ for all $t \geq0$. Asset 1 has prices given by $dS_t = a(S_t) dW_t$, where the given function $a$ is positive and smooth, and such $a$ and its derivative $a'$ is bounded. Let $\xi_t$ be the time-$t$ price of a European call option with maturity $T$ and strike $K$. Let $V:  [0,T] \times \mathbb{R} \rightarrow \mathbb{R}_{+}$ satisfy the PDE (with boundary condition)&#xA;\begin{equation}&#xA;\frac{\partial V}{\partial t} (t,S) + \frac{a(S)^2}{2} \frac{\partial^2}{\partial S^2} V(t,S) =0, \quad V(T,S)= (S-K)^{+}.&#xA;\end{equation}&#xA;We let $\xi_t = V(t,S_t)$ so that there is no arbitrage. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We want to show that the call option $\xi_t$ can be replicated by holding $\pi_t = U(t, S_t)$ units of stock, where $U: [0,T] \times \mathbb{R} \rightarrow \mathbb{R}$ satisfies the PDE (with boundary condition)&#xA;\begin{equation}&#xA;\frac{\partial U}{\partial t} (t,S) + a(S) a'(S) \frac{\partial}{\partial S} U(t,S) +\frac{a(S)^2}{2} \frac{\partial^2}{\partial S^2} U(t,S) =0, \quad U(T,S)= \mathbf{1}_{ \{S\geq K \}}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What I have done so far:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let the strategy be $\phi_t$ units of cash, $\pi_t = U(t,S_t)$ units of stock. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly, by definition, $\phi_t = \xi_t - U(t,S_t) S_t$. However, this does not seem to work, as it is not self-financing:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By Ito's Lemma, $d \xi_t = d V(t, S_t) = \frac{\partial V}{\partial S} a(S_t) dW_t$ (using the first set of PDE). Hence, claiming that it is self-financing amounts to saying that&#xA;\begin{equation}&#xA;\frac{\partial V}{\partial S} a(S_t) dW_t = U(t,S_t) a(S_t) dW_t + \phi_t dt,&#xA;\end{equation}&#xA;which is clearly not true. Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="13654" LastActivityDate="2015-01-04T10:17:20.053" Title="Replication of a call option by cash-or-nothing digital option" Tags="&lt;option-pricing&gt;&lt;stochastic-processes&gt;&lt;replication&gt;" AnswerCount="3" CommentCount="8" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15697" PostTypeId="1" CreationDate="2014-11-30T01:01:37.330" Score="0" ViewCount="317" Body="&lt;p&gt;Here is the full question, even though ive broken it down to the mini question above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose you have bought a July ITM call and sold an August ATM put. &#xA;What would be your delta in this position? Once you hedged out your delta what are the following Greeks: &#xA;-Gamma &#xA;-Vega &#xA;-Rho &#xA;-Theta &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I already solved for delta. Really struggling with gamma&lt;/p&gt;&#xA;" OwnerUserId="13700" LastActivityDate="2015-06-17T21:48:50.650" Title="Suppose you bought a July ITM call and sold an August ATM put, am I net long or short?" Tags="&lt;greeks&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15698" PostTypeId="2" ParentId="15697" CreationDate="2014-11-30T01:34:36.687" Score="1" Body="&lt;p&gt;net long. selling a put and owning a call are both bullish positions &lt;/p&gt;&#xA;" OwnerUserId="13515" LastActivityDate="2014-11-30T01:34:36.687" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15699" PostTypeId="1" CreationDate="2014-11-30T02:16:30.470" Score="3" ViewCount="3776" Body="&lt;p&gt;I am looking at the historical treasury interest rates and am uncertain which rates would be best to use for options pricing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should I use 1 month, 6 month, 2 year?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See: &#xA;&lt;a href=&quot;http://www.treasury.gov/resource-center/data-chart-center/interest-rates/Pages/Historic-LongTerm-Rate-Data-Visualization.aspx&quot; rel=&quot;nofollow&quot;&gt;http://www.treasury.gov/resource-center/data-chart-center/interest-rates/Pages/Historic-LongTerm-Rate-Data-Visualization.aspx&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13661" LastActivityDate="2015-03-02T05:59:35.017" Title="Which interest rates to use for options pricing?" Tags="&lt;options&gt;&lt;black-scholes&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15700" PostTypeId="2" ParentId="15699" CreationDate="2014-11-30T02:40:41.147" Score="0" Body="&lt;p&gt;the length of rate which closest corresponds to the maturity of the option. This will be true opportunity cost of having capital tied up in option positions with regard to the risk free rate. &lt;/p&gt;&#xA;" OwnerUserId="13700" LastActivityDate="2014-11-30T02:40:41.147" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15701" PostTypeId="2" ParentId="15696" CreationDate="2014-11-30T03:44:01.550" Score="0" Body="&lt;p&gt;Without getting into all the Math one thing should be clear that:&#xA;Call option is equivalent to:  long asset or nothing AND short cash or nothing options. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You cannot replicate a call option without asset or nothing since replicating portfolio for long call requires holding N(d1) quantity of the underlying. Asset or nothing gives you this exposure directly. Shorting cash or nothing which pays $K at maturity provides the remaining exposure required for replicating the long call option.&lt;/p&gt;&#xA;" OwnerUserId="6675" LastActivityDate="2014-11-30T03:44:01.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15702" PostTypeId="1" CreationDate="2014-11-30T05:02:45.543" Score="3" ViewCount="181" Body="&lt;p&gt;How can I use the Heston Model to calculate the probability of a stock being above or below a certain value on a given date in the future?&lt;/p&gt;&#xA;" OwnerUserId="13661" LastEditorUserId="13661" LastEditDate="2014-11-30T05:08:35.520" LastActivityDate="2015-08-05T17:41:21.623" Title="How do I calculate the probability of a stock being above or below a value using the Heston model?" Tags="&lt;options&gt;&lt;heston&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15703" PostTypeId="2" ParentId="15614" CreationDate="2014-11-30T05:03:42.963" Score="1" Body="&lt;p&gt;I suggest that you can use the Pathways - Euler Method to estimate vega, for sure with this method you can approximate the vega value.&lt;/p&gt;&#xA;" OwnerUserId="13702" LastActivityDate="2014-11-30T05:03:42.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15704" PostTypeId="1" AcceptedAnswerId="15716" CreationDate="2014-11-30T20:36:38.640" Score="5" ViewCount="1081" Body="&lt;p&gt;I am trying to prove that the Absence of arbitrage statement (AOA) does not necessarily imply the law of one price (LOP). For the definitions of these concepts I am using Cochrane's book &quot;Asset pricing&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By definition &lt;em&gt;a payoff space $X$ and a pricing function $p(x)$ leave no arbitrage opportunities if for any $x\geq0$ almost surely, and $x &amp;gt; 0$ with nonzero probability, $p(x) &amp;gt; 0$.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equivalently: &lt;em&gt;if $x$ dominates $y$ – i.e., $x\geq y$ almost surely, with $x &amp;gt; y$ with positive probability – then $p(x) &amp;gt; p(y)$.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The law of one price says that we can write $$p(ax_1+bx_2)=ap(x_1)+bp(x_2)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I don't know how to attack this problem. Should I try to prove that positivity of prices (AOA) does not necessarily imply a linear pricing function??? Can you help me to understand what would be a good attack strategy in this case?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for your help.&lt;/p&gt;&#xA;" OwnerUserId="13707" LastActivityDate="2014-12-01T15:51:08.253" Title="Proving that Absence of Arbitrage does not imply law of one price" Tags="&lt;asset-pricing&gt;&lt;no-arbitrage-theory&gt;&lt;proof&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15705" PostTypeId="2" ParentId="15651" CreationDate="2014-11-30T21:48:37.673" Score="0" Body="&lt;p&gt;I think the model you are presenting is trying to capture the pro-forma performance of a collection of stocks. However, it is not that 'flexible' and is accurate if:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You are fully invested throughout the time window you are considering&lt;/li&gt;&#xA;&lt;li&gt;You do not place new trades during this time window&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;A portfolio value is simply the sum of your assets, so at time $t$ you have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;V_{t}=C_{t}+A_{t}&#xA;$$&#xA;where &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V_{t}$ is the total value of your portfolio at time $t$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C_{t}$ is your cash level at that time, and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$A_{t}$ is the value of your investments at time ${t}$, which for $N$ investments is equal to $\sum_{j \in N}Q_{j,t} \cdot P_{j,t}$ (shares times price)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, if you cannot distinguish between your cash level and the rest of your assets, then you cannot really know how your portfolio evolved, because if you are studying the performance of your portfolio between $[0,t]$, and at $i\in(0,t)$ you make a new investment, at $i+1$ this investment would have a big impact on your portfolio whereas it really shouldn't as this initial investment should have been deducted from your cash. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, suppose you start with $N$ securities at $t=0$ and a cash level of $C_{0}$. Now consider that at time $i$ you make an investment, bying $Q_{N+1,i}$ shares of the security $N+1$ (so it will be your new investment) at price $P_{N+1,i}$. Your cash level would be reduced by that amount, and your investments would grow by the equivallent amount. Depending on how you study the performace this is not necessarily net zero as at end of day, the price may(will) change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;V_{i-1} = C_{i-1}+\sum_{j \in N}Q_{j,i-1} \cdot P_{j,i-1}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;V_{i}=(C_{i-1}-Q_{N+1,i} \cdot P_{N+1,i})+\sum_{j \in N+1}Q_{j,i} \cdot P_{j,i}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Q_{N+1,i} \cdot P_{N+1,i}$ is the investment you made at time $i$. Please check that there are now $N+1$ investments and not $N$ as before, and that the cash level is $C_{i-1}$ which is the level you had prior the investment, (in our example if there is only one trade until time $i$, then $C_{i-1}=C_{0}$). Of course you can complicate it further by considering multiple investments etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think your colleague could not model the cash level (I've experienced it multiple times in investment firms, as the portfolio manager and risk manager, who are really pushing for these numbers, are mostly interested in the stocks and not the cash) and just tried to do a quick pro-forma track. Not necessarily wrong, but not exactly the best way to do it. Having said that, I am not implying that my suggestion is ground-breaking or an optimal/complete one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me know if this makes things clearer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="13682" LastActivityDate="2014-11-30T21:48:37.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15706" PostTypeId="2" ParentId="15530" CreationDate="2014-11-30T22:30:00.423" Score="2" Body="&lt;p&gt;I will try and give some feedback on your questions.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Will betas be negative for the short book?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Not necessarily, no. The beta of a stock is not related to you having a long or a short position to it.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How would I calculate returns for the L/S portfolio&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Assuming your total portfolio including cash is $V_{0}$, and each line has made $PNL_{i}$, then your long book ($L$) would make $P_{L}=\sum_{i \in L} PNL_{i}$ and your short book ($S$) $P_{S}=\sum_{i \in S} PNL_{i}$. Your total return would be $\frac{V_{0}+P_{L}+P_{S}}{V_{0}}$. In your excel picture, I would devide the column GQ with the total portfolio value (I think it is 1M) and this would be each line's performance contribution. If you sum that, then you end up to your portfolio's return.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How would you factor in margin/borrowing costs in a model like this?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I do not really know about this.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Is there a different way that I need to calculate sharpe ratio since this is a L/S portfolio&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Well the sharpe ratio is a function of the portfolio returns and its standard deviation, $S=\frac{R_{p}-R}{\sigma}$, where $R_{p}$ is your return, $R$ is the risk free rate, and $\sigma$ is your portfolio's standard deviation. So I don't think you need to change the computation. Most of the L/S hedge funds report on both Sharpe and Sortino ratio.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How should I use the benchmark (I have read elsewhere that the benchmark should be long for the long portfolio, short the same benchmark for the short portfolio, and then long a cash investment)?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I am a little puzzled with your suggestion. The aim of the benchmark is to compare your portfolio in total with the benchmark. It doesn't really matter if your longs are doing fine, so you are overperforming the benchmark. If your shorts are very bad you might be net negative. But you can certainly consider this to test your longs vs your shorts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="13682" LastActivityDate="2014-11-30T22:30:00.423" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15707" PostTypeId="1" CreationDate="2014-12-01T01:25:30.480" Score="2" ViewCount="297" Body="&lt;p&gt;PEGY ratio is calculated as PE ratio/(Earnings Growth Rate + Dividend Yield). Putting aside the discussion of whether forward or trailing P/E ratio should be used, isn't adding dividend yield over estimating the growth rate. After all common stock dividends are paid from net income. &lt;/p&gt;&#xA;" OwnerUserId="13648" LastActivityDate="2015-05-02T03:30:34.157" Title="PEGY Ratio: Does it make sense?" Tags="&lt;finance&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15709" PostTypeId="2" ParentId="14709" CreationDate="2014-12-01T03:58:37.303" Score="3" Body="&lt;p&gt;Here's the &lt;strong&gt;SPX &amp;amp; DAX&lt;/strong&gt; data in &lt;strong&gt;CSV&lt;/strong&gt; format (you can open in &lt;strong&gt;Excel&lt;/strong&gt;):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;a href=&quot;http://real-chart.finance.yahoo.com/table.csv?s=%5EGDAXI&amp;amp;d=11&amp;amp;e=1&amp;amp;f=2014&amp;amp;g=d&amp;amp;a=10&amp;amp;b=26&amp;amp;c=1990&amp;amp;ignore=.csv&quot; rel=&quot;nofollow&quot;&gt;http://real-chart.finance.yahoo.com/table.csv?s=%5EGDAXI&amp;amp;d=11&amp;amp;e=1&amp;amp;f=2014&amp;amp;g=d&amp;amp;a=10&amp;amp;b=26&amp;amp;c=1990&amp;amp;ignore=.csv&lt;/a&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;a href=&quot;http://real-chart.finance.yahoo.com/table.csv?s=%5EGSPC&amp;amp;d=11&amp;amp;e=1&amp;amp;f=2014&amp;amp;g=d&amp;amp;a=0&amp;amp;b=3&amp;amp;c=1950&amp;amp;ignore=.csv&quot; rel=&quot;nofollow&quot;&gt;http://real-chart.finance.yahoo.com/table.csv?s=%5EGSPC&amp;amp;d=11&amp;amp;e=1&amp;amp;f=2014&amp;amp;g=d&amp;amp;a=0&amp;amp;b=3&amp;amp;c=1950&amp;amp;ignore=.csv&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and this is the &lt;strong&gt;Yahoo finance&lt;/strong&gt; SPX &amp;amp; DAX page to obtain that data:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;a href=&quot;http://finance.yahoo.com/q/hp?s=%5EGDAXI%20Historical%20Prices&quot; rel=&quot;nofollow&quot;&gt;http://finance.yahoo.com/q/hp?s=^GDAXI+Historical+Prices&lt;/a&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;a href=&quot;http://finance.yahoo.com/q/hp?s=%5EGSPC%20Historical%20Prices&quot; rel=&quot;nofollow&quot;&gt;http://finance.yahoo.com/q/hp?s=^GSPC+Historical+Prices&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="13496" LastActivityDate="2014-12-01T03:58:37.303" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15710" PostTypeId="1" CreationDate="2014-12-01T05:46:34.457" Score="3" ViewCount="492" Body="&lt;p&gt;How do I derive credit migration/transition matrices or spreads from default probability? May you please provide references, or do you know what type of articles or authors to find?&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="7788" LastEditDate="2014-12-03T11:53:56.207" LastActivityDate="2014-12-03T11:53:56.207" Title="Deriving credit spreads or migration matrices from prob of default" Tags="&lt;credit-ratings&gt;&lt;default-probability&gt;&lt;transition-matrix&gt;&lt;default-risk&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15711" PostTypeId="1" CreationDate="2014-12-01T13:36:27.107" Score="3" ViewCount="256" Body="&lt;p&gt;I have a algo which is trading a certain power contract. For calculating the Sharpe ration what would be a suitable benchmark to use?&lt;/p&gt;&#xA;" OwnerUserId="13713" LastActivityDate="2014-12-01T13:36:27.107" Title="suitable benchmark to use for Sharpe ratio of power trading strategy" Tags="&lt;sharpe-ratio&gt;&lt;commodities&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15712" PostTypeId="2" ParentId="15682" CreationDate="2014-12-01T14:07:52.270" Score="3" Body="&lt;p&gt;Of course you can choose the prior. As far as I understand the literature, the BL-model is characterized by using the equilibrium implied returns. Otherwise it would just be a Bayesian model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you estimate the returns in a different way (not taking implied returns from the market portfolio), you could lose the stabilizing inverse optimization step required in computing the implied returns. (multiplication by $\Sigma$. Optimization - loosely spoken - divides by $\Sigma$) Using a different return estimate as prior, it is my intuition that you will lose this effect and, as a result, some robustness.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One example of a BL-like portfoilio construction technique is found in &lt;a href=&quot;http://www.blacklitterman.org/Black-Litterman.pdf&quot; rel=&quot;nofollow&quot;&gt;The Black Litterman Model in Detail - section Active Management and the Black-Litterman Model&lt;/a&gt;. In this case of active management one just optimizes the active portfolio, the implied returns (the prior) are assumed to be $0$. Later in the text (Two-Factor Model Black Litterman), a different method for the calculation of implied returns is presented too, so there are definitely different methods to calculate the return prior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course one can also take the risk parity portfolio as a benchmark with this approach. The main reason for this is that the optimization step does not need any return estimates to calculate the ERC portfolio. Implicitly though, this corresponds to the tangency portfolio of an optimization problem: If all assets have equal sharpe ratio and the correlation is constant across all assets, &lt;a href=&quot;http://thierry-roncalli.com/download/erc.pdf&quot; rel=&quot;nofollow&quot;&gt;Maillard, Roncalli and Teiletche&lt;/a&gt; show, that the ERC portfolio corresponds to the tangency portfolio. Of course, the correlation assumption is strong, but it gives some intuition about the implicit assumptions and it somehow relates to your idea of using return estimates from sharpe ratios...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apart from the applications there is a small caveat: To arrive at the BL-Formula you calculate the posterior distribution explicitly and extract the parameters. To do this, one assumes a multivariate normal distribution of your assets (the calculation is rather lengthy and I think its in the appendix of your link). Thats where Meucci's entropy pooling idea plays its part - it is just a way to calculate the posterior distribution for the general case but everything comes at a price - it just exists in the machine, not on paper...&lt;/p&gt;&#xA;" OwnerUserId="2727" LastEditorUserId="2727" LastEditDate="2014-12-02T10:25:31.183" LastActivityDate="2014-12-02T10:25:31.183" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15713" PostTypeId="1" CreationDate="2014-12-01T14:14:41.507" Score="4" ViewCount="649" Body="&lt;p&gt;How do I artificially generate intraday ticks data from a given input (Open,High,Low,Close,Volume) using Brownian Bridge method?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Brownian_bridge&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Brownian_bridge&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S: Brownian Bridge can generate ticks only with 2 nodes. (with some modification to existing brownian bridge, I think it can be extended to 4 nodes and follow the number of Volume ticks).&lt;/p&gt;&#xA;" OwnerUserId="13496" LastEditorUserId="13496" LastEditDate="2014-12-01T21:03:16.843" LastActivityDate="2014-12-01T21:03:16.843" Title="How do I artificially generate intraday ticks data from a given input (Open,High,Low,Close,Volume) using Brownian Bridge method?" Tags="&lt;brownian-motion&gt;&lt;tick-data&gt;" AnswerCount="0" CommentCount="7" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15715" PostTypeId="2" ParentId="4701" CreationDate="2014-12-01T15:13:40.033" Score="5" Body="&lt;p&gt;The following paper gives you a step-by-step presentation of how to use the Kalman filter  in an application in a pricing model framework for a spot and futures market. Everything is explained using Excel:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=715301&quot; rel=&quot;noreferrer&quot;&gt;A Simplified Approach to Understanding the Kalman Filter Technique&lt;br&gt;&#xA;by T. Arnold, M. Bertus and J. M. Godbey&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2014-12-01T15:13:40.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15716" PostTypeId="2" ParentId="15704" CreationDate="2014-12-01T15:51:08.253" Score="2" Body="&lt;p&gt;Let $X$ be endowed with the following partial order: $y \geq x $ means that $\Bbb P(y\geq x) = 1$. The AOA condition in your case states that the pricing law $p$ is strictly inctreasing with respect to $\geq$, whereas LOP says that $p$ is a linear function. Neither if the two implies another one in general. For example, if $X = \Bbb R$ then $p(x) = x^3$ is a strictly monotone increasing function which is not linear.&lt;/p&gt;&#xA;" OwnerUserId="13480" LastActivityDate="2014-12-01T15:51:08.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15717" PostTypeId="2" ParentId="15694" CreationDate="2014-12-01T17:46:59.230" Score="2" Body="&lt;p&gt;Assuming you are at a decent university, you are better off seeing if you can get this data from Bloomberg or from a university subscription to Compustat.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2014-12-01T17:46:59.230" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15718" PostTypeId="2" ParentId="15674" CreationDate="2014-12-01T19:10:02.733" Score="5" Body="&lt;p&gt;I found and answer to my own question. So, I post it here for people who maybe have the same problem. The answer, however, is quite intuitive. The last observation used for the estimation of the physical density is also the time point where the investors know the most about the physical density because at this point the most possible historical observations are used. Hence, they evaluate the future rationally based on this pseudo-true measure. Therefore, the option prices at the last observed time point need to be used to estimate the risk neutral density.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, the estimation procedure for a empirical pricing kernel could be as follows: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Get the closing prices of the considered index in a reasonable time interval $[t,T]$&lt;/li&gt;&#xA;&lt;li&gt;Get the option prices for the index at time $T$ with equal time to expiration but different strike prices&lt;/li&gt;&#xA;&lt;li&gt;Estimate the physical density $\hat p$ with data obtained in the first step&lt;/li&gt;&#xA;&lt;li&gt;Estimate the risk neutral density $\hat q$ with date obtained in the second step&lt;/li&gt;&#xA;&lt;li&gt;Calculate the empirical pricing kernel as $\hat k = \frac{\hat q}{\hat p}$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The empirical pricing kernel equal is also referred to as the stochastic discount factor.&lt;/p&gt;&#xA;" OwnerUserId="13585" LastEditorUserId="13585" LastEditDate="2014-12-01T19:22:28.970" LastActivityDate="2014-12-01T19:22:28.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15719" PostTypeId="1" CreationDate="2014-12-01T21:10:49.460" Score="8" ViewCount="993" Body="&lt;p&gt;I have trouble understanding Girsanov's theorem. The Radon Nikodym process $Z$ is defined by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Z(t)=\exp\left(-\int_0^t\phi(u) \, \mathrm dW(u) - \int_0^t\frac{\phi^2(u)}{2} \, \mathrm du\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now $\hat P$ is a new probability measure. The trouble is I am not understanding how to go from old $P$ to the new one. The old $P$ is normally distributed with mean $0$ and variance $t$. Now say I want to know the new probability for an infinitesimally small interval around $0.2$. For that I need to know the value of $Z$ at this interval (event you may say). And then I can multiply (integrate) the value of $Z$ with old $P$, and get new $\hat P$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume $t$ is fixed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have no idea how to calculate the value of $Z$ for this interval/event. Help would be appreciated. &lt;/p&gt;&#xA;" OwnerUserId="13715" LastEditorUserId="13480" LastEditDate="2014-12-02T11:09:36.740" LastActivityDate="2014-12-02T15:09:34.030" Title="Girsanov's Theorem - Change of Measure" Tags="&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15720" PostTypeId="1" CreationDate="2014-12-01T22:11:51.693" Score="1" ViewCount="1099" Body="&lt;p&gt;Hi I am writing a program to Bootstrap a EURO zero swap-curve for tenor 3M and 6M with given bid and ask. When I run the program , I get a negative zero rate and discount factor from 5Y till 30Y for both Swap 3m and 6m. Is it normal or am I doing something wrong in calculation?&lt;img src=&quot;https://i.stack.imgur.com/hfVKj.png&quot; alt=&quot;not complete thought&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For swap part, I use this formula to calculate the discount:&#xA;$D_T=\frac{D_{T/N}-R_T^{par} \sum_{i=1}^{T-1}D_t}{1+R_T^{par}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and to calculate zero rate I use the following formula:&#xA;$Z_T=((\frac{1}{D_T})^{\frac{365}{days}}-1) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I really appreciate any tips or help.&#xA;Bests&lt;/p&gt;&#xA;" OwnerUserId="13329" LastActivityDate="2015-04-01T11:55:22.670" Title="negative discount and zero rate on swap bootstraping" Tags="&lt;swaps&gt;&lt;bootstrapping&gt;&lt;discount-factor-curve&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15722" PostTypeId="2" ParentId="15034" CreationDate="2014-12-02T04:47:07.137" Score="4" Body="&lt;p&gt;it depends on how it's converted. There are three different possibilities.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;the pay-off is $(K-S_T)_+$ with $K$ and $S_T$ in USD but the pay-off is converted to EUR as a predetermined rate. This called a quanto and is widely discussed in books. (eg my book Concepts...)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;the pay-off is $(K-S_T)_+$ with $K$ in EUR and $S_T$ in USD. Then you have to model the dynamics of the EUR value of the stock. Which comes down to knowing the FX volatility and the correlation. The first you could get from implied vols of FX options. The second is harder and probably from time series.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;the pay-off is $(K-S_T)_+$ with $K$ and $S_T$ in USD but you want to buy it with EUR. In this case, just price in USD and convert with today's exchange rate. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2014-12-02T04:47:07.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15723" PostTypeId="2" ParentId="15720" CreationDate="2014-12-02T09:37:25.577" Score="1" Body="&lt;p&gt;The formula seems to be correct. Negative interest rates are not impossible in these days.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.bloombergview.com/quicktake/negative-interest-rates&quot; rel=&quot;nofollow&quot;&gt;http://www.bloombergview.com/quicktake/negative-interest-rates&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have you checked the algorithm with values that produce positive rates? And in what area lie the negative ones?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of negative interest rates the discount factors should be greater than one, of course. Negative discount factors are (even in these days) not possible.&lt;/p&gt;&#xA;" OwnerUserId="13720" LastActivityDate="2014-12-02T09:37:25.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15724" PostTypeId="2" ParentId="15719" CreationDate="2014-12-02T10:05:01.593" Score="4" Body="&lt;p&gt;Let's distinguish: measure $P$ gives probability over the paths, hence you can't really say that it has certain mean and variance: that would apply to a measure $P_t$ which restricts $P$ to the time instance $t$. Now, if you know that $P_t$ has density $f$ (with respect to Lebesgue measure) and $\frac{\mathrm d\hat P_t}{\mathrm d P_t} = g$  then $\hat P_t$ has density&#xA;$$&#xA;  \frac{\mathrm d\hat P_t}{\mathrm d \lambda} = \frac{\mathrm d\hat P_t}{\mathrm d P_t}\cdot \frac{\mathrm d P_t}{\mathrm d \lambda} = g\cdot f.&#xA;$$&#xA;Unfortunately, I do not know whether you can get $g$ directly out of $Z$ - in fact, it does not seem to be that you can always do this in some nice analytical way since it involves computing rather peculiar conditional expectations. Another sanity check: if there would be an easy way to find $g$ out of $Z$, then just by knowing the density $f$ for the Geometric Brownian motion $\mathrm dX_t = \sigma X_t\,\mathrm dW_t$ would allow you to know densities for any process of the form $\mathrm dX_t = \mu_t\,\mathrm dt + \sigma X_t\,\mathrm dW_t$ for pretty much any adapted process $\mu_t$. I'm pretty sure that even if $\mu_t = \mu(X_t)$ there are a lot of cases where the densities are still not known.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; to support the intuition above, I've computed $g$ in terms of $Z$, and indeed it looks pretty simple $g(x) = \Bbb E[Z_t|X_t = x]$ but its computation would be rather hard in general.&lt;/p&gt;&#xA;" OwnerUserId="13480" LastEditorUserId="13480" LastEditDate="2014-12-02T15:09:34.030" LastActivityDate="2014-12-02T15:09:34.030" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15725" PostTypeId="2" ParentId="15710" CreationDate="2014-12-02T15:27:35.130" Score="5" Body="&lt;p&gt;You cannot do it.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is an under-determined problem.  That is to say, a whole multitude (subspace of $\mathbb{R}^{N\times N}$) of migration matrices will agree with any given table of default probabilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say you want to find a transition matrix for 2 states (IG, HY) plus default&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\left(\begin{matrix}&#xA; p_{11} &amp;amp; p_{12} &amp;amp; p_{1D}  \\&#xA; p_{21} &amp;amp; p_{22} &amp;amp; p_{2D} \\&#xA; 0  &amp;amp; 0 &amp;amp; 1&#xA;\end{matrix}\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and your default probabilities are $(p_{1D},\ p_{2D})$.  You have 6 quantities to find in your transition matrix and only two quantities to populate them from (and, by the way, those two quantities are actually entries in the matrix).  Topologically, there is no solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if you have a term structure of default probabilities, then you can work with a least-squares fit or something to ensure that powers of the transition matrix agree with particular tenors on that term structure.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2014-12-02T16:17:35.230" LastActivityDate="2014-12-02T16:17:35.230" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15726" PostTypeId="1" CreationDate="2014-12-02T17:57:50.623" Score="1" ViewCount="75" Body="&lt;p&gt;I've been looking at various accumulation algos and it appears that the greater majority are predicated on building a position largely relative to a time component or market volume for obvious reasons. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there also any well known methods for pacing the accumulation of a position relative to price? Like in the event that you have a desired position size you would like to build relative to the price movement from one point to another? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This somewhat falls under the general concept of pyramiding which is a fairly abstract term that can broadly cover many variations. I find that most concepts aren't necessarily novel ...it's more a matter of knowing the correct search term. Any recommendations would be much appreciated.&lt;/p&gt;&#xA;" OwnerUserId="6864" LastActivityDate="2014-12-02T17:57:50.623" Title="Correct term for position accumulation relative to price?" Tags="&lt;quant-trading-strategies&gt;&lt;automated-trading&gt;&lt;algorithmic-trading&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15727" PostTypeId="2" ParentId="15250" CreationDate="2014-12-02T18:25:05.653" Score="1" Body="&lt;p&gt;As mentioned above, your post is very broad and therefore difficult to answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I have had a lot of fun trying to reverse engineer some strategies, from back when RentASignal.com was in business. My general conclusion where that the strategies for rent where optimized for a great back test, the developers then set the strategy up for a forward test using an a demo account, and then crossed their fingers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If they were lucky, their (typically) high leveraged strategy made XXX% return over the next 1 – 2 months, and then started to get paying subscribers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a lucrative and easy business for fraudsters, so watch out, and never buy anything unless there is solid test and verification documentation available (there never is!)&lt;/p&gt;&#xA;" OwnerUserId="4769" LastActivityDate="2014-12-02T18:25:05.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15728" PostTypeId="2" ParentId="15710" CreationDate="2014-12-02T20:06:56.810" Score="4" Body="&lt;p&gt;Actually, there is a practical way to do it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use you PoD estimates to assign a credit rating to your securities and then use a published transition matrix for your purposes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or you can estimate transition probabilities by linear interpolation based on the PoD values that you have. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a &lt;a href=&quot;http://pages.stern.nyu.edu/~eelton/working_papers/corp%20bonds/all%20tables%20and%20figures%201.pdf&quot; rel=&quot;nofollow&quot;&gt;publication&lt;/a&gt; containing transition matrices from Moody's and S&amp;amp;P (go to page 3).&lt;/p&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2014-12-02T20:06:56.810" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15729" PostTypeId="2" ParentId="14987" CreationDate="2014-12-02T20:14:09.257" Score="2" Body="&lt;p&gt;Forward implied volatility smile is implied from forward start options. For example call options have payoff&#xA;$$&#xA;  g_{T+\theta} = \left( \frac{S_{T+\theta}}{S_T} -K\right)_+ &#xA;$$&#xA;If you are in a stochastic volatility model this can be rewritten&lt;br&gt;&#xA;$$&#xA;  g_{T+\theta} = \left( e^{ \int_T^{T+\theta} r - \frac{1}{2}\sigma_t^2 dt + \int_T^{T+\theta}\sigma_tdW^S_t } -K\right)_+ &#xA;$$&#xA;You can compute the price of the forward start call using MC:&#xA;$$&#xA;  C_t(T\to T+\theta,K) = \mathbb{E}^{\mathbb{Q}}_t[e^{-r(T+\theta - t)}\left( e^{ \int_T^{T+\theta} r - \frac{1}{2}\sigma_t^2 dt + \int_T^{T+\theta}\sigma_tdW^S_t } -K\right)_+ ]&#xA;$$&#xA;It is worth noting that conditionning wrt the fixing time $T$,&#xA;$$&#xA;  C_t(T\to T+\theta,K) = \mathbb{E}^{\mathbb{Q}}_t[e^{-r(T - t)} C_T(S_T = 1,T+\theta,K) ]&#xA;$$&#xA;So forward start calls are average over all scenarios of the future model prices of calls.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The forward implied volatility $\Sigma_t(T\to T+\theta,K)$ (this is $\theta$ years in $T$ years as seen from time $t$) is characterized by &#xA;$$&#xA;  C_t(T\to T+\theta,K) = C_{BS}(S=1,\theta,K,r,\Sigma_t(T\to T+\theta,K)) &#xA;$$&#xA;The formula is set so that, in the BS model with time dependant volatility, $\Sigma_t(T\to T+\theta,K)^2 = \frac{1}{\theta}\int_T^{T+\theta} \sigma(t)^2 \, dt$ which is what we expect as a forward volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This way you can get your prices by MC simulation, find the corresponding forward implied vol for different strikes and plot your forward smile. You can approximate the skew by finite difference if you have enough strikes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The method based on digitals suggested by Mark Joshi works similarly. &lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2014-12-02T20:14:09.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15731" PostTypeId="2" ParentId="15696" CreationDate="2014-12-02T22:56:56.927" Score="2" Body="&lt;p&gt;I think the title here is misleading. Let's go back to the BS world with $r=0$ to $a(S_t)=S_t \sigma.$ In that case, all you are saying is that you can replicate a call option by holding $N(d_1)$ units of stock at time $t.$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What does this have to do with the second equation? I am guessing that this is the price process of an asset of nothing option with the stock taken as numeraire so it evaluates to $N(d_1).$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my approach to this would be to repeat the BS replication argument when $\sigma$ is allowed to be a function of $S_t.$ Then work with the stock as numeraire to get the fact that the delta satisfies the second equation. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastEditorUserId="1809" LastEditDate="2014-12-03T00:15:23.750" LastActivityDate="2014-12-03T00:15:23.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15732" PostTypeId="2" ParentId="15707" CreationDate="2014-12-03T00:52:42.597" Score="1" Body="&lt;p&gt;This is all off the top of my head, but how about this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ PEGY = \frac{PE}{EG+DY} $$&#xA;$$ PE = \frac{P}{E_n} $$&#xA;$$ EG_{forward} = \frac{E_{n+1} - E_n}{E_n}$$&#xA;$$ DY = \frac{D}{E_n}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$PEGY = \frac{\frac{P}{E_n}}{\frac{E_{n+1} - E_n}{E_n} + \frac{D}{E_n}}&#xA;       = \frac{P}{E_n}  \frac{E_n}{E_{n+1} - E_n + D} $$&#xA;$$PEGY = \frac{P}{\Delta E + D}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And examining the bottom term, one can easily imagine that a company whose annual delta-earnings is 100 with no dividends is not preferable to a company whose annual delta-earnings is 100 but which additionally pays a dividend of 50 every year.  The dividends have been double-counted, but the second company didn't have access to that cash with which to compound growth.   But I am not 100% sure where I am going with this. &lt;/p&gt;&#xA;" OwnerUserId="3491" LastActivityDate="2014-12-03T00:52:42.597" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15733" PostTypeId="1" CreationDate="2014-12-03T03:52:29.170" Score="1" ViewCount="114" Body="&lt;p&gt;I am currently a senior in high school and I built a stock simulator using knowledge gained from a semester of AP Statistics. I was wondering if someone could tell me if my simulation is legit/reasonable! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the Download Link:&#xA;&lt;a href=&quot;https://www.dropbox.com/s/llebsb868k06nbz/Simple%20Stock%20Simulator%20Dropbox.xlsm?dl=0&quot; rel=&quot;nofollow&quot;&gt;https://www.dropbox.com/s/llebsb868k06nbz/Simple%20Stock%20Simulator%20Dropbox.xlsm?dl=0&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The green cells are for inputs and you can run the ScaleAxes macro (press Alt F8 and hit run) to auto format the stock price graph. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="13725" LastActivityDate="2014-12-03T03:52:29.170" Title="Review of Excel Stock Simulator" Tags="&lt;equities&gt;&lt;simulations&gt;&lt;excel&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15735" PostTypeId="2" ParentId="10521" CreationDate="2014-12-03T05:04:25.770" Score="4" Body="&lt;p&gt;Each listing exchange maintains lists of &lt;strong&gt;exchange-initiated&lt;/strong&gt; and &lt;strong&gt;issuer-initiated&lt;/strong&gt; delistings. Per the exchanges, an issue will appear on this list the first trading day after the issuer provides the venue with notification of its intent to voluntarily delist. An issue will also appear on this list if it has been suspended for failure to meet continued listing requirements or due to other events, such as expiration, redemption or acquisition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Issues will remain on these lists until the first business day after the issue is delisted. An issue is generally delisted 10 calendar days from the date the Form 25, Notification of Removal from Listing and/or Registration, is filed with the Securities and Exchange Commission. These forms can be viewed on the &lt;a href=&quot;https://searchwww.sec.gov/EDGARFSClient/jsp/EDGAR_MainAccess.jsp?search_text=*&amp;amp;sort=Date&amp;amp;formType=Form25&amp;amp;isAdv=true&amp;amp;stemming=true&amp;amp;numResults=100&amp;amp;numResults=100&quot; rel=&quot;nofollow noreferrer&quot;&gt;SEC site&lt;/a&gt;. This is an authoritative source for past delistings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The lists of current delistings can be found on each listing exchanges' websites:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://listingcenter.nasdaq.com/IssuersPendingSuspensionDelisting.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;Nasdaq&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.nyse.com/regulation/delistings&quot; rel=&quot;nofollow noreferrer&quot;&gt;NYSE (including NYSE American &amp;amp; NYSE ARCA)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://markets.cboe.com/us/equities/etfmarketplace/listed_products/suspensions_delistings/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Cboe BZX&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;It is also worth keeping an eye on the non-compliant company list maintained by listing exchanges as these are likely to become delisted in the future unless they correct the particular deficiencies:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://listingcenter.nasdaq.com/NonCompliantCompanyList.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;Nasdaq&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.nyse.com/regulation/noncompliant-issuers&quot; rel=&quot;nofollow noreferrer&quot;&gt;NYSE (including NYSE American &amp;amp; NYSE ARCA)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://markets.cboe.com/us/equities/etfmarketplace/listed_products/below_standard/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Cboe BZX&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7089" LastEditorUserId="7089" LastEditDate="2018-07-02T17:20:28.080" LastActivityDate="2018-07-02T17:20:28.080" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="15736" PostTypeId="2" ParentId="14479" CreationDate="2014-12-03T05:28:58.993" Score="4" Body="&lt;p&gt;Start with &lt;a href=&quot;http://www1.nyse.com/pdfs/closings.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www1.nyse.com/pdfs/closings.pdf&lt;/a&gt; which covers all closings through 2011 then use the following information from official exchange sources to get dates up to present day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2012/2013:&#xA;&lt;br&gt;&lt;a href=&quot;http://www1.nyse.com/press/1294398514465.html&quot; rel=&quot;nofollow&quot;&gt;http://www1.nyse.com/press/1294398514465.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Weather related closures happened on Monday, Oct. 29, 2012 and Tuesday, Oct. 30, 2012:&#xA;&lt;br&gt;&lt;a href=&quot;http://markets.nyx.com/nyse/trader-updates/view/11507&quot; rel=&quot;nofollow&quot;&gt;http://markets.nyx.com/nyse/trader-updates/view/11507&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2014/2015:&#xA;&lt;br&gt;&lt;a href=&quot;http://otp.investis.com/clients/us/intercontinental_exchange_group/usn/usnews-story.aspx?cid=953&amp;amp;newsid=21120&quot; rel=&quot;nofollow&quot;&gt;http://otp.investis.com/clients/us/intercontinental_exchange_group/usn/usnews-story.aspx?cid=953&amp;amp;newsid=21120&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2016:&#xA;&lt;br&gt;&lt;a href=&quot;http://otp.investis.com/clients/us/intercontinental_exchange_group/usn/usnews-story.aspx?cid=953&amp;amp;newsid=22278&quot; rel=&quot;nofollow&quot;&gt;http://otp.investis.com/clients/us/intercontinental_exchange_group/usn/usnews-story.aspx?cid=953&amp;amp;newsid=22278&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7089" LastEditorUserId="7089" LastEditDate="2015-10-13T04:28:16.970" LastActivityDate="2015-10-13T04:28:16.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15737" PostTypeId="1" CreationDate="2014-12-03T06:28:27.283" Score="3" ViewCount="204" Body="&lt;p&gt;SDE 1 is&#xA;S1 = S10 exp( (r1-sigma^2/2) * dt + sigma dW1 )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;S2 = S20 exp( (r2-sigma2^2/2) * dt + sigma2 dW2 )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E[dW1 dW2] = rho&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to price an option on S1 x S2&#xA;I know I need to use the SDE's to find the SDE for d(S1 S2) using Ito...but what if I use this&lt;/p&gt;&#xA;&#xA;&lt;p&gt;S = S1 x S2 using two analytical solutions of SDE? Why the drift term comes out incorrectly? Why can't I multiply two SDE solutions to get an equation for the third....?&lt;/p&gt;&#xA;" OwnerUserId="8163" LastEditorUserId="2587" LastEditDate="2015-01-05T14:16:04.163" LastActivityDate="2015-01-05T14:16:04.163" Title="Why can't I multiply two SDE Solutions?" Tags="&lt;correlation&gt;&lt;sde&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15738" PostTypeId="2" ParentId="15737" CreationDate="2014-12-03T07:02:17.117" Score="0" Body="&lt;p&gt;By all means, if $dS_i = \mu(S^i_t)\mathrm dt + \sigma(S^i_t)\mathrm dW^i_t$ for $i=1,2$ and you know explicit formulas for $S_i$ then their product satisfies the SDE you derive using the Ito lemma for a product. Could you elaborate, on what is the issue you have with the drift term?&lt;/p&gt;&#xA;" OwnerUserId="13480" LastActivityDate="2014-12-03T07:02:17.117" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15739" PostTypeId="2" ParentId="15696" CreationDate="2014-12-03T09:20:06.460" Score="1" Body="&lt;p&gt;The exercise is really not about replicating a call with asset or nothing. It is simply about the PDE of the delta of a call.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The usual derivation of the BS equation starts by considering a portfolio short the option&#xA;$$&#xA;  \Pi_t = \delta^0_t B_t + \delta_t S_t - V(t,S_t) &#xA;$$&#xA;Assuming the portfolio is selfinancing (and interest rate = 0), we get &#xA;$$&#xA;  d\Pi_t = \delta_t dS_t - dV(t,S_t) &#xA;= (\delta_t - \partial_SV)a(S_t)dW_t - (\partial_tV + \frac{1}{2}a(S_t)^2\partial^2_{SS}V)dt &#xA;$$&#xA;We make the portfolio riskless by choosing $\delta_t = \partial_S V(t,S_t)$. And as $\Pi$ is now riskless it must earn the risk free rate of 0 so that gives us the PDE for V.&#xA;$$&#xA;  \partial_tV + \frac{1}{2}a(S)^2\partial^2_{SS}V = 0&#xA;$$&#xA;Deriving the PDE for V wrt S gives the PDE for $\delta(t,S) = \partial_S V(t,S) = U(t,S)$: &#xA;$$&#xA;  \partial_tU + a(S)a'(S)\partial_{S}U + \frac{1}{2}a(S)^2\partial^2_{SS}U = 0&#xA;$$&#xA;Setting the initial value $\Pi_0 = 0$ ensures that $\Pi_t = 0$ $\forall t$ so we replicate $V$ perfectly by holding $\delta_t = U(t,S_t)$ units of $S_t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: I wrote $\delta^0_t$ and $\delta_t$ instead of $\phi_t,\pi_t$. The mistake in your self-financing equation is that it should write &#xA;$$&#xA;  dV(t,S_t) = \pi_tdS_t + \phi_t dB_t&#xA;$$&#xA;but $B_t = 1$ so $dB_t = 0$ and we are left with &#xA;$$&#xA;  \partial_S V(t,S_t) a(S_t)dW_t = U(t,S_t)a(S_t)dW_t  &#xA;$$&#xA;which is another way of finding $\pi_t = U(t,S_t) = \partial_S V(t,S_t)$. &lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2015-01-04T10:17:20.053" LastActivityDate="2015-01-04T10:17:20.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15740" PostTypeId="1" CreationDate="2014-12-03T09:43:00.960" Score="2" ViewCount="183" Body="&lt;p&gt;I am trying to calculate the sharpe ratio for a set of loans. These loans have already matured and I know if they were good or not: grades are the different grades of the loans.&#xA;interest rate is the floating point value:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;12.12   &#xA;13.11   &#xA;7.90    &#xA;8.90    &#xA;15.31   &#xA;14.33   &#xA;11.14   &#xA;16.29   &#xA;17.27   &#xA;10.99   &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;this is the python code that tries to compute the sharpe ratio for each grade.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for grade,name in enumerate(grades):&#xA;    print name, grade&#xA;    if pd.isnull(name):&#xA;        continue&#xA;    grade = float(grade)&#xA;    positive = (df_loans_completed.ix[s_grade_stats.groups[(grade, True)]]['interest_rate'] - R)&#xA;    negative = (df_loans_completed.ix[s_grade_stats.groups[(grade, False)]]['interest_rate'] - R)&#xA;    sigma = positive.append(negative).std()&#xA;    avg_return = positive.mean()&#xA;    print &quot;sharpe:&quot;, (avg_return -R) / sigma&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;should I consider the fact that I know which loans returned an interest positive and which did not ? &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="13728" LastActivityDate="2014-12-03T09:43:00.960" Title="Sharpe Ratio for loans" Tags="&lt;portfolio-management&gt;&lt;portfolio&gt;&lt;sharpe-ratio&gt;&lt;portfolio-optimization&gt;&lt;portfolio-selection&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15741" PostTypeId="1" CreationDate="2014-12-03T11:55:25.040" Score="2" ViewCount="498" Body="&lt;p&gt;When I issue the following query &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;select * from yahoo.finance.industry where id=&quot;133&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get the following results &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;{&#xA; &quot;query&quot;: {&#xA;  &quot;count&quot;: 1,&#xA;  &quot;created&quot;: &quot;2014-12-03T11:36:47Z&quot;,&#xA;  &quot;lang&quot;: &quot;it&quot;,&#xA;  &quot;results&quot;: {&#xA;   &quot;industry&quot;: {&#xA;    &quot;id&quot;: &quot;133&quot;,&#xA;    &quot;name&quot;: &quot;&quot;&#xA;   }&#xA;  }&#xA; }&#xA;}&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this a missing data from YQL?&lt;/p&gt;&#xA;" OwnerUserId="6499" LastActivityDate="2014-12-04T16:31:05.047" Title="Yahoo YQL missing industry &quot;Industrial Metals &amp; Minerals&quot;" Tags="&lt;historical-data&gt;&lt;yahoofinance&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15742" PostTypeId="1" CreationDate="2014-12-03T18:25:53.340" Score="2" ViewCount="135" Body="&lt;p&gt;After calibration the G2++ model for interest (with swaption volatilities), I want to statistically test the quality of the calibration by comparing market to model values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the best way to achieve this?&lt;/p&gt;&#xA;" OwnerUserId="2322" LastEditorUserId="467" LastEditDate="2014-12-04T04:05:32.863" LastActivityDate="2014-12-04T04:05:32.863" Title="How to compare market values with model values after calibration?" Tags="&lt;backtesting&gt;&lt;calibration&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15744" PostTypeId="1" AcceptedAnswerId="15749" CreationDate="2014-12-03T19:59:19.193" Score="2" ViewCount="376" Body="&lt;p&gt;I have a model predicting 1-day VaR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does 1-year VaR follow from it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Shall I just multiply by 365 or another method?&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-12-06T10:22:42.827" LastActivityDate="2014-12-07T10:47:22.667" Title="How to extrapolate VaR?" Tags="&lt;risk-management&gt;&lt;value-at-risk&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15745" PostTypeId="2" ParentId="15744" CreationDate="2014-12-03T21:26:41.847" Score="3" Body="&lt;p&gt;The standard approach is to multiply by the square root of the number of trading days in a year. If you assume there are 250 trading days in the year, you multiply by $\sqrt{250}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.investopedia.com/articles/04/101304.asp&quot; rel=&quot;nofollow&quot;&gt;Investopedia&lt;/a&gt; is one source explaining this approach.&lt;/p&gt;&#xA;" OwnerUserId="6107" LastEditorUserId="6107" LastEditDate="2014-12-03T21:32:34.147" LastActivityDate="2014-12-03T21:32:34.147" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15746" PostTypeId="2" ParentId="7040" CreationDate="2014-12-03T21:33:50.507" Score="1" Body="&lt;p&gt;The standard for the bond functions (like ACCRINT) is SIFMA (Securities Information and Financial Markets Association).  They put out a pair of books (Standard Securities Calculation Methods in 2 volumes--recently updated).  This is the source of the formulas that Microsoft documents in the help for bond functions in some versions of Excel.  The software recommended by SIFMA is put out by a company called TIPS (long time president is the author of the above books).  There is an on-line calculator for calculating nearly all the bond function (more than Microsoft supports)--search for &quot;TIPS calculator&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In most of the bond functions, Microsoft uses the 6 Coupon functions for days (they all begin with COUP...).  Unfortunately, the version used in the bond functions does not always match the stand-alone version--so building the function (using the SIFMA formula) in an Excel spreadsheet for PRICE or YIELD will not always match the Excel result for this function.  Further, ACCRINT does not use the same definition as the TIPS calculator (or the books)--TIPS calculates the accrued interest only within the coupon period that the settlement date is in--not the same as either of the values Microsoft gives.  Further, even when in the first coupon period, the answer differs between Excel and the calculator in many cases.  Part of this is that Excel does not follow the standard for determining coupon dates (see Vol II, p. 7, 2013 edition)--it requires the maturity date or last regular coupon date, which is not an argument to ACCRINT.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Early versions of Excel's bond functions (in late 1990's) had lots of errors.  Microsoft has generally been getting them out, so that there are a lot fewer, BUT ACCRINT and ODDFPRICE still have major problems.  These conclusions are based on over 100 million tests run on code in a MS clone using the TIPS calculator to test a sampling of the differences.&lt;/p&gt;&#xA;" OwnerUserId="13732" LastEditorUserId="13732" LastEditDate="2014-12-03T21:41:24.380" LastActivityDate="2014-12-03T21:41:24.380" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15747" PostTypeId="2" ParentId="15744" CreationDate="2014-12-04T07:58:26.243" Score="1" Body="&lt;p&gt;The most commonly used approach is multiplication by the square-root of T, 19.1 in this case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This assumes no autocorrelation, however (Markov process). Interest rates tend to show a mean reversion, so the number would be smaller than 19.1. Other cases could show the oppoite effect if there are positive feedbacks. In both of these cases, a simple time scaling is not possible and the model should be re-run for the new time horizon.&lt;/p&gt;&#xA;" OwnerUserId="13733" LastEditorUserId="2379" LastEditDate="2014-12-07T10:47:22.667" LastActivityDate="2014-12-07T10:47:22.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15748" PostTypeId="1" CreationDate="2014-12-04T08:19:32.433" Score="0" ViewCount="1206" Body="&lt;p&gt;I would like to calculate historical Value at Risk for a portfolio that includes both long and short positions in forward contracts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The part that confuses me is that I wonder whether the VaR of the different positions should better netted or summed up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I purchased a December contract and sold another contract for same delivery month. If VaR on the long position is 1000 usd and sales is  also 1000 usd,  can I net them?&lt;/p&gt;&#xA;" OwnerUserId="12126" LastEditorUserId="467" LastEditDate="2014-12-05T09:50:38.600" LastActivityDate="2020-07-20T11:05:26.237" Title="How to compute the historical VaR for a portfolio with long and short positions?" Tags="&lt;var&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15749" PostTypeId="2" ParentId="15744" CreationDate="2014-12-04T10:13:34.357" Score="4" Body="&lt;p&gt;It depends on the method by which you calculate VaR. Some models (t-distributuion, normal) lead to a form of VaR such that it is just scaled volatility:&#xA;$$&#xA;VaR = c \sigma&#xA;$$&#xA;with some proper $c$ (e.g. $q_{\alpha}$ in the case of normal, bit more complicated for the t-distribution). Then as $\sigma$ scales with square-root-of-time so does VaR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If VaR is modelled with some expectaion of the form&#xA;$$&#xA;VaR = -\mu+c \sigma&#xA;$$&#xA;then $\mu$, the expectation, scales with time and volatility as above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore: it depends on the setting but usually it is just nonsense to calculate an annual VaR from a daily one.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2014-12-04T12:01:19.467" LastActivityDate="2014-12-04T12:01:19.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15750" PostTypeId="2" ParentId="15741" CreationDate="2014-12-04T16:31:05.047" Score="2" Body="&lt;p&gt;Yes there is no data for 133. If you want to know which sectors have data try this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;select * from yahoo.finance.industry where id in (select industry.id from yahoo.finance.sectors)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For example sector 111 has data&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;industry id=&quot;111&quot; name=&quot;Synthetics&quot;&amp;gt;&#xA;        &amp;lt;company name=&quot;American Nano Silicon Technolo&quot; symbol=&quot;ANNO&quot;/&amp;gt;&#xA;        &amp;lt;company name=&quot;Axiall Corporation&quot; symbol=&quot;AXLL&quot;/&amp;gt;&#xA;        &amp;lt;company name=&quot;BioLargo, Inc.&quot; symbol=&quot;BLGO&quot;/&amp;gt;&#xA;        &amp;lt;company name=&quot;GelTech Solutions, Inc.&quot; symbol=&quot;GLTC&quot;/&amp;gt;&#xA;        &amp;lt;company name=&quot;Kraig Biocraft Laboratories, I&quot; symbol=&quot;KBLB&quot;/&amp;gt;&#xA;        &amp;lt;company name=&quot;Lightbridge Corp.&quot; symbol=&quot;LTBR&quot;/&amp;gt;&#xA;        &amp;lt;company name=&quot;Lizhan Environmental Corp.&quot; symbol=&quot;LZENF&quot;/&amp;gt;&#xA;        &amp;lt;company name=&quot;Sino Clean Energy Inc&quot; symbol=&quot;SCEI&quot;/&amp;gt;&#xA;        &amp;lt;company name=&quot;Trinseo SA&quot; symbol=&quot;TSE&quot;/&amp;gt;&#xA;    &amp;lt;/industry&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hope that helps&lt;/p&gt;&#xA;" OwnerUserId="1386" LastActivityDate="2014-12-04T16:31:05.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15751" PostTypeId="1" CreationDate="2014-12-04T18:00:55.813" Score="2" ViewCount="1799" Body="&lt;p&gt;Why is Yahoo Finance historical stock price data inaccurate? See examples:&#xA;&lt;code&gt;AAPL&lt;/code&gt; - actual closing prices in 2012 when AAPL previously closed &gt; $100/share adjusted for 7:1 split;&#xA;chart &amp;amp; data do not agree, esp when picking different time periods, e.g. &quot;Max&quot; vs &quot;5 year&quot; vs 'Custom&quot;. Historical data is also incorrect. These closing prices are wrong:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Sep 21, 2012 95.12 &#xA;Sep 20, 2012  94.93 &#xA;Sep 19, 2012 95.39 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;NASDAQ&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similar inaccuracies, look at charts &amp;amp; historical data for peak close in March, 2000 &gt; \$5000 when Yahoo data reflects correct closing prices but Yahoo charts never get above $3100.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apparently discrepancies are rampant..&lt;/p&gt;&#xA;" OwnerUserId="13738" LastEditorUserId="1386" LastEditDate="2014-12-04T18:40:30.867" LastActivityDate="2014-12-05T05:35:48.233" Title="Yahoo finance inaccurate stock data" Tags="&lt;yahoo&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15752" PostTypeId="2" ParentId="15737" CreationDate="2014-12-04T19:53:51.043" Score="1" Body="&lt;p&gt;You can use Ito's product rule $d(X \, Y) = dX \, Y + X \, dY + dX \, dY$.  In your case, you have&#xA;$$&#xA;dS_{1,t} = S_{1,t} \left( r_1 dt + \sigma_1 dW_{1,t} \right)&#xA;$$&#xA;and&#xA;$$&#xA;dS_{2,t} = S_{2,t} \left( r_2 dt + \sigma_1 dW_{2,t} \right)&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="3188" LastActivityDate="2014-12-04T19:53:51.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15754" PostTypeId="1" CreationDate="2014-12-04T20:52:35.030" Score="-1" ViewCount="243" Body="&lt;p&gt;So I placed an offer to sell a few liquid options on an already illiquid stock the other day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I put an offer to sell a deep OTM put, the market makers who had their offers in place had, lets say $1, I came in and offered it at 90 cents. I was the best offer in the market and in the level 2's, I was the only size on that offer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few minutes later as I was watching the screen, I trade flashed across on the options I put an offer to sell. Except the trade price was 50 cents. I was watching the level 2's as the trade came in. Some of the market makers that were selling 1 dollar, brought their offer down to hit the persons order in nanoseconds. I didn't get filled! The market makers did! Their offer was clearly noncompetitive and they front runned my offer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Isn't that illegal? Could it be because the bid order that came in to buy was a limit order vs market order? Or because they had chose the BEST exchange vs the specific exchange were I was offering my option. I want to know why I got front runned!&lt;/p&gt;&#xA;" OwnerUserId="4729" LastEditorUserId="467" LastEditDate="2014-12-05T01:27:21.577" LastActivityDate="2014-12-05T14:21:52.490" Title="Why didn't my order get filled?" Tags="&lt;high-frequency&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15755" PostTypeId="1" AcceptedAnswerId="15756" CreationDate="2014-12-04T21:17:56.553" Score="1" ViewCount="271" Body="&lt;p&gt;I would like to simulate from a t-copula with time-dependent correlation matrices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say I have a series of 2000 correlation matrices (obtained from a copula-DCC model for data consisting of 2000 observations) for a 4 risk-factor portfolio (hence I have a 4x4x2000 array), and I would like the copularnd function to use a different correlation matrix for each time-step.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to accomplish this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;many thanks!! Matthias&lt;/p&gt;&#xA;" OwnerUserId="13740" LastActivityDate="2014-12-04T22:35:41.910" Title="Simulate from time-dependent copula in MatLab using COPULARND" Tags="&lt;matlab&gt;&lt;copula&gt;&lt;dynamic&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15756" PostTypeId="2" ParentId="15755" CreationDate="2014-12-04T22:35:41.910" Score="1" Body="&lt;p&gt;You can use a for-loop on your correlation series.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;          for i=1:2000&#xA;          simulation=copularnd('t',rho(i),NU,N));&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-12-04T22:35:41.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15757" PostTypeId="2" ParentId="14554" CreationDate="2014-12-05T03:39:45.997" Score="0" Body="&lt;p&gt;&lt;a href=&quot;https://cfo.sageworks.com/&quot; rel=&quot;nofollow&quot;&gt;Sageworks&lt;/a&gt; has the data you'll need and will allow you run these correlations within their software. &lt;/p&gt;&#xA;" OwnerUserId="13741" LastActivityDate="2014-12-05T03:39:45.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15758" PostTypeId="2" ParentId="15751" CreationDate="2014-12-05T05:35:48.233" Score="3" Body="&lt;p&gt;I think this question has been answered here before (regarding yahoo finance &amp;amp; historical data).  Most free providers of historical data do not take the time to go back &amp;amp; $fix$ the data discrepancies such as the one you ran into. I believe they just collect/update data as it comes I.e. Stock splits, dividend payments. However, the Adjusted Close column should reflect the most &quot;accurate&quot; historical price such as the High that $AAPL$ had before the split ~ $700/share is now ~$100/share after the 7:1 split. &lt;/p&gt;&#xA;" OwnerUserId="13428" LastActivityDate="2014-12-05T05:35:48.233" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15760" PostTypeId="2" ParentId="15748" CreationDate="2014-12-05T09:55:46.780" Score="2" Body="&lt;p&gt;I must say that I'd advise you not to use this kind of concepts if you don't really understand what VaR is and how it should be used, which seems to be the case here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short, if you bought and sold the same amount of the same contract then obviously you are not exposed to market risk anymore. So intuitively you expect you risk (and hence your VaR) to be 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, this doesn't mean that you can net the VaR of different position in all cases. In fact you can't most of the time when you're not talking about the same asset. The reason is simply that correlation gets in the picture. What you need to do is to consider your global portfolio and estimate VaR from historical results.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2014-12-05T09:55:46.780" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15761" PostTypeId="1" AcceptedAnswerId="15769" CreationDate="2014-12-05T10:01:40.250" Score="4" ViewCount="2275" Body="&lt;p&gt;Yahoo finance and google finance do not provide such data. Where can one download Japanese stock data? &lt;/p&gt;&#xA;" OwnerUserId="6190" LastActivityDate="2016-03-10T08:44:20.237" Title="Where can end-of-day price volume data for Japanese stocks be downloaded or subscribed to?" Tags="&lt;historical-data&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15762" PostTypeId="2" ParentId="15754" CreationDate="2014-12-05T14:21:52.490" Score="1" Body="&lt;p&gt;The 50 cent bid was certainly a LMT order and the exchange will not match a 50 cent bid with a 90 cent offer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And the past tense of &quot;front run&quot; is &quot;frant ran&quot;.&lt;/p&gt;&#xA;" OwnerUserId="2982" LastActivityDate="2014-12-05T14:21:52.490" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15763" PostTypeId="1" CreationDate="2014-12-05T14:34:41.307" Score="2" ViewCount="232" Body="&lt;p&gt;I'm currently searching material about market risk and I learned about coherent risk measures, VaR, CVaR (or expected shortfall), volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All that because I have to make a Financial Risk Area for the  company in which I work.&#xA;My doubt is: Is it typical of my area to show the portfolio manager how to optimize his portfolio (mean variance approach and stochastic dominance) in terms of risk or is it just my job to show some tools that could be used?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand there is a difference between risk measures and risk management but I have to show them how to mitigate some risks? Or just tell them some tools?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sorry if my question is too broad but I read alot about risk measures but could not find a lot of what a risk analyst should do.&lt;/p&gt;&#xA;" OwnerUserId="13660" LastEditorUserId="9336" LastEditDate="2014-12-05T22:28:15.207" LastActivityDate="2014-12-05T22:28:15.207" Title="Risk measures, Risk Management and Financial Risk Area" Tags="&lt;risk&gt;&lt;portfolio-management&gt;&lt;risk-management&gt;&lt;market-risk&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15764" PostTypeId="1" CreationDate="2014-12-05T14:43:30.873" Score="1" ViewCount="346" Body="&lt;p&gt;What toolbox are more suitable for a risk analyst. I found this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Optimization toolbox &lt;/li&gt;&#xA;&lt;li&gt;Global optimization toolbox &lt;/li&gt;&#xA;&lt;li&gt;Econometrics toolbox &lt;/li&gt;&#xA;&lt;li&gt;Financial toolbox &lt;/li&gt;&#xA;&lt;li&gt;Statistics toolbox&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;And also I have as a useful tool box: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Database toolbox (I have some useful info in my database) &lt;/li&gt;&#xA;&lt;li&gt;Datafeed toolbox (I have a bloomberg)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Questions:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a. What of the first five toolboxes are actually useful for my purpose? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;b. Is any other useful for my purpose? I have all approved but I don't want to abuse.&lt;/p&gt;&#xA;" OwnerUserId="13660" LastEditorUserId="467" LastEditDate="2015-01-12T06:55:43.420" LastActivityDate="2015-04-13T21:54:36.780" Title="What Matlab packages to I need as a Risk Analyst?" Tags="&lt;risk&gt;&lt;programming&gt;&lt;risk-management&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15765" PostTypeId="2" ParentId="15761" CreationDate="2014-12-05T14:51:58.580" Score="1" Body="&lt;p&gt;SONY&#xA;&lt;a href=&quot;http://stocks.finance.yahoo.co.jp/stocks/detail/?code=6758.T&quot; rel=&quot;nofollow&quot;&gt;http://stocks.finance.yahoo.co.jp/stocks/detail/?code=6758.T&lt;/a&gt;&#xA;SONY's historical  data&#xA;&lt;a href=&quot;http://stocks.finance.yahoo.co.jp/stocks/history/?code=6758.T&quot; rel=&quot;nofollow&quot;&gt;http://stocks.finance.yahoo.co.jp/stocks/history/?code=6758.T&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13747" LastActivityDate="2014-12-05T14:51:58.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15766" PostTypeId="2" ParentId="15344" CreationDate="2014-12-05T17:12:40.283" Score="3" Body="&lt;p&gt;Instrument 2 looks to me like the standard regular definition of a 3x6 FRA. This is a relatively liquid instrument, so that forward rate r2 is just the price of the FRA and is available on Bloomberg, etc. If you have a yield curve model and associated suite of functions there will certainly be a function to return that forward rate, because it's vanilla.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The forward rate r40 will not have the same value as r2, as you correctly suggest. However, you would not calculate r40 starting from r2, because the only relevant thing those two instruments have in common is the payment date. Instead you would calculate rf, which is the forward rate for a vanilla FRA (ie fixing = 2 days) that fixes on the same date as Instrument 1. Then r40 equals rf multiplied by an exponent involving the volatility of the numeraire. Hull's book (Options, Futures and Other Derivatives) is where I read about this, and it gives the exact formula you want and explains the assumptions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No, you would not need two yield curves. You build your yield curve out of the vanilla liquid instruments you have available. You then query this curve to get your vanilla forward rates for the fixing dates you require, then if needed (if your payment date is non-standard) you multiply by the measure adjustment term as described above. It's the same logic as for pricing Libor-in-Arrears.&lt;/p&gt;&#xA;" OwnerUserId="13580" LastEditorUserId="13580" LastEditDate="2014-12-06T15:08:21.710" LastActivityDate="2014-12-06T15:08:21.710" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15767" PostTypeId="1" CreationDate="2014-12-05T19:39:05.287" Score="2" ViewCount="250" Body="&lt;p&gt;I am struggling with this question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $B$ be a standard Brownian motion. In a Black-Scholes model, at time $t$, the stock price is given by&#xA;\begin{equation}&#xA;S_t = \exp \{ \sigma B_t + ( r- \frac{1}{2} \sigma^2 ) t \}.&#xA;\end{equation}&#xA;where $\sigma &amp;gt;0$ and $r$ are constants. Let $a&amp;gt;0$. We want to calculate the time-0-price of an exotic option which will pay $1$ at the time $\tau = \inf \{ t \in [0,T]: S_t &amp;gt; e^{\sigma a} \}$ if the time happens before the expiry $T&amp;gt;0$, otherwise it pays nothing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following fact is given: For any $c \in \mathbb{R}$, $a&amp;gt;0$,&#xA;\begin{equation}&#xA;\mathbb{P}  \, ( \inf \{ t \in [0,T]: B_t + ct =a \} \leq T ) = 1- \Phi \bigg( \frac{a-cT}{\sqrt{T}} \bigg) + e^{2ac} \Phi \bigg( \frac{-a-cT}{\sqrt{T}} \bigg),&#xA;\end{equation}&#xA; where $\Phi$ denotes the cumulative distribution function of the $N(0,1)$ distribution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was only taught about the pricing of European options. What do we need to do in this case?&lt;/p&gt;&#xA;" OwnerUserId="13749" LastActivityDate="2014-12-08T15:46:18.800" Title="Pricing exotic option whose payout depends on the stopping time" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;exotics&gt;&lt;stopping&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15768" PostTypeId="1" AcceptedAnswerId="15794" CreationDate="2014-12-05T20:17:32.283" Score="4" ViewCount="918" Body="&lt;p&gt;I am using Bloomberg's BDP and BDH functions in excel to retrieve data for a set of options.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that (as underlying prices move and expiration dates come and go) option strikes are constantly being created.  Rather than setting up a list of all possible strikes and concatenating my option codes, I would like to be able to &quot;ask&quot; Bloomberg for all the valid option codes in a certain category. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By doing this I can be sure I did not miss any and possibly save some time when fetching data for many instruments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a simple way to populate a list of securities (stocks, futures, options, options on futures, etc.) from Bloomberg based on categories?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a crude example of what I mean:  '=BSECURITY(&quot;Commodity&quot;, &quot;Interest Rate&quot;, &quot;Treasuries&quot;, &quot;Future-Options&quot;, DATE)&lt;/p&gt;&#xA;" OwnerUserId="12104" LastEditorUserId="9336" LastEditDate="2014-12-05T23:38:39.503" LastActivityDate="2014-12-08T15:11:34.353" Title="Obtaining logical lists of Bloomberg security codes in Excel" Tags="&lt;derivatives&gt;&lt;bloomberg&gt;&lt;excel&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15769" PostTypeId="2" ParentId="15761" CreationDate="2014-12-05T20:39:31.827" Score="4" Body="&lt;p&gt;There is a way to download Japanese stock data report &lt;a href=&quot;http://www.tse.or.jp/english/market/data/daily/index.html&quot; rel=&quot;nofollow&quot;&gt;OHLC/Volume&lt;/a&gt; directly from the Tokyo Stock Exchange.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only thing is: The report is in PDF format and involves some parsing, if you are willing to do some quantitative analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A &lt;strong&gt;hack&lt;/strong&gt;, however, exists: Download the options/futures daily report. It's a nice CSV file, and it contains an underlying price for &lt;strong&gt;&lt;em&gt;all&lt;/em&gt;&lt;/strong&gt; optionable equities. The format and instructions are on the &lt;a href=&quot;http://www.ose.or.jp/e/market/trading_data/option_price&quot; rel=&quot;nofollow&quot;&gt;same page&lt;/a&gt; as the daily file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the end, you'll need to convert Japanese stock code into a name or ISIN. The reference information is located on &lt;a href=&quot;http://www2.tse.or.jp/tseHpFront/JJK020010Action.do?Show=Show&quot; rel=&quot;nofollow&quot;&gt;Tokyo Stock Exchange&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, a subscription is available on &lt;a href=&quot;https://www.xignite.com/product/XigniteGlobalHistorical/&quot; rel=&quot;nofollow&quot;&gt;xignite&lt;/a&gt; site.&lt;/p&gt;&#xA;" OwnerUserId="2909" LastActivityDate="2014-12-05T20:39:31.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15770" PostTypeId="2" ParentId="14899" CreationDate="2014-12-05T20:50:54.537" Score="2" Body="&lt;p&gt;Get in touch with &lt;a href=&quot;http://www.optionmetrics.com/&quot; rel=&quot;nofollow&quot;&gt;OptionMetrics&lt;/a&gt;, they have historical and daily updates for futures prices.&lt;/p&gt;&#xA;" OwnerUserId="2909" LastActivityDate="2014-12-05T20:50:54.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15771" PostTypeId="1" AcceptedAnswerId="15885" CreationDate="2014-12-05T21:07:42.017" Score="3" ViewCount="139" Body="&lt;p&gt;Let $\tilde{E}$ be the risk neutral expectation, and $X_t$ the wealth that time t and $R$ the return of a risk-free investment. Consider maximizing the function $EU(X_N)$ subject to $\tilde{E}\frac{X_n}{R^N}=X_0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution is discussed in Chapter 3 of Shreve volume 1, and question 3.8.i asks to show:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Fix $y$, and show that the function of $x$ given by $f(x)=U(x)-yx$ is maximized by $y=I(x)$. ($I(x)=\left[U'(x)\right]^{-1}$)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I might be misunderstanding what it means by &quot;fix y&quot;, but as it stands this seems false. E.g. say $U(x)=\ln x$; then $f'(x)=x^{-1}-x/x=x^{-1}-1\not=0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I not understanding?&lt;/p&gt;&#xA;" OwnerUserId="5361" LastActivityDate="2014-12-16T08:30:00.067" Title="Maximizing utility subject to a wealth constraint" Tags="&lt;optimization&gt;&lt;binomial&gt;" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="15772" PostTypeId="2" ParentId="15767" CreationDate="2014-12-05T23:34:00.207" Score="1" Body="&lt;p&gt;$S_t$ is already under $Q$ (riskfree drift), so you not need to change the measure here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that $c:=\left(\frac{r}{\sigma}-\frac{1}{2}\sigma\right)$ and $E\left(1_A\right)=P(A)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So one computes the European option price as the discounted payoff expectation:&#xA;$$C=e^{-rT}E\left(1_{\tau\leq T}\right)=e^{-rT}P(\tau\leq T).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The option price equals the discounted probability of the hitting time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the option is of American type, the discount factor becomes stochastic:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C=E\left(e^{-r\tau}1_{\tau\leq T}\right)=\int_0^T e^{-r\tau}\,f(\tau)\,d\tau$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The expression can also be calculated by Laplace transform.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-12-06T10:09:32.620" LastActivityDate="2014-12-06T10:09:32.620" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="15773" PostTypeId="1" AcceptedAnswerId="18507" CreationDate="2014-12-06T01:07:22.290" Score="2" ViewCount="1712" Body="&lt;p&gt;So there are two assets with return rates $r_1$ and $r_2$ which have identical variances and a correlation coefficient $p$. The risk free rate is $r_f$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need to find an expression for the optimal Markowitz weights for the two assets. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The books says that the answer is ($s_1 - p s_2$)/[($s_1-s_2$)*($1-p$)], but I'm not sure how this makes any sense as I don't know what the s's mean.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="13714" LastEditorUserId="2587" LastEditDate="2015-01-19T07:13:58.357" LastActivityDate="2015-06-25T13:13:10.647" Title="Finding Expression for Optimal Markowitz Weights" Tags="&lt;modern-portfolio-theory&gt;&lt;mean-variance&gt;&lt;markowitz&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15774" PostTypeId="1" AcceptedAnswerId="15777" CreationDate="2014-12-06T02:14:06.280" Score="2" ViewCount="455" Body="&lt;p&gt;I have a bachelors degree in economics and I took undergrad courses on mathematical optimization methods for economics and dynamic optimization in economics and econometrics. Now I'm taking an advanced course in finance next year and I've been told to study by myself robust optimization methods. So, given my background, do you have a book recommendation for this topic with applications to economics and finance?&lt;/p&gt;&#xA;" OwnerUserId="13751" LastEditorUserId="13751" LastEditDate="2014-12-06T02:37:00.333" LastActivityDate="2014-12-06T16:57:06.773" Title="Book recommendation on robust optimization" Tags="&lt;reference-request&gt;&lt;books&gt;&lt;robust-optimization&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15776" PostTypeId="1" CreationDate="2014-12-06T16:09:56.087" Score="0" ViewCount="58" Body="&lt;p&gt;This is a generic question about the quotations of assets but for the sake of reducing ambiguity, let's consider the EUR/USD exchange rate. If the answer varies for other asset classes, please note the differences.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While references to how the initial exchange rate is set will be appreciated, the question is specific to the constant fluctuations produced by any bank. &lt;a href=&quot;https://money.stackexchange.com/a/21359/22918&quot;&gt;The closest answer I have found, states&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The bank just facilitates transactions. If the last price (exchange rate) is 1.2 Dollars per Euro, and the bank gets more requests to buy USD for Euros than Euros for USD, it adjusts the rate downwards until the buying pressure is even. If the USD gets more expensive, at some point fewer people will want to buy it (or want to buy products from the US that cost USD). The bank maintains a spread (like buy for 1.19 and sell for 1.21) so it can take a profit.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What is the series of technical events that produce these fluctuations, in as much granularity as possible? An example for 2-3 ticks should suffice. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Further, how is it related to the &lt;a href=&quot;http://www.cftc.gov/MARKETREPORTS/COMMITMENTSOFTRADERS/INDEX.HTM&quot; rel=&quot;nofollow noreferrer&quot;&gt;COT data&lt;/a&gt;, if at all? How is COT data determined?&lt;/p&gt;&#xA;" OwnerUserId="13756" LastEditorUserId="-1" LastEditDate="2017-04-13T12:25:30.743" LastActivityDate="2014-12-11T14:02:23.413" Title="What are the technical events that fluctuate quoted asset (e.g. forex) prices? How does it relate to the purchase of currency contracts?" Tags="&lt;fx&gt;&lt;asset-pricing&gt;&lt;pricing-formulae&gt;&lt;quote&gt;&lt;tick&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15777" PostTypeId="2" ParentId="15774" CreationDate="2014-12-06T16:57:06.773" Score="0" Body="&lt;p&gt;A very nice book is the following&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www2.isye.gatech.edu/~nemirovs/FullBookDec11.pdf&quot; rel=&quot;nofollow&quot;&gt;Robust optimization&lt;/a&gt; by Ben Tal et al.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not sure if it is to technical, but I liked it a lot! Since it is online available I would give it a try.&lt;/p&gt;&#xA;" OwnerUserId="17133" LastActivityDate="2014-12-06T16:57:06.773" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15778" PostTypeId="1" AcceptedAnswerId="15780" CreationDate="2014-12-06T22:19:22.347" Score="2" ViewCount="4774" Body="&lt;p&gt;Is the mean variance optimization the same thing as the capital asset pricing model? Or is the mean variance only a part of CAPM?&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2016-05-22T21:33:55.260" Title="Difference between CAPM and mean variance optimization" Tags="&lt;capm&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15780" PostTypeId="2" ParentId="15778" CreationDate="2014-12-06T23:51:40.783" Score="3" Body="&lt;p&gt;Mean-Variance Optimization is a generic framework that creates optimal portfolios relative to two measures of risk - mean and standard deviation (covariation). It holds in general for elliptical distributions where the scale and location of the distribution are the only sources of risk and return. For a Normal Distribution this is $(\mu, \Sigma)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CAPM is a strict set of equilibrium assumptions made on the mean-variance framework to obtain certain results for the behaviour of the representative agent in the market. Namely, that is all agents were rational, with concave quadratic utility functions dependent on the first two moments, then the market portfolio would be the optimal portfolio and all other returns could be determined by their &quot;$\beta$&quot; to the market. The key idea behind this is that all risk and return originates from a single factor, the market. So risk can be decomposed into two components, the systematic and the idiosyncratic. But, diversification (ala Mean Variance) can remove the idiosyncratic risk, so no rational agent should price it. As a result, all expected returns are given by the beta (covariation, regression coefficient) to the market.&lt;/p&gt;&#xA;" OwnerUserId="13415" LastActivityDate="2014-12-06T23:51:40.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15781" PostTypeId="2" ParentId="14289" CreationDate="2014-12-06T23:52:19.253" Score="1" Body="&lt;p&gt;For Natgas prices the following factors have correlation: seasonality, weather, inventory draw, pipeline flow data if you can get it. Hope you find R2. &lt;/p&gt;&#xA;" OwnerUserId="5861" LastActivityDate="2014-12-06T23:52:19.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15782" PostTypeId="1" CreationDate="2014-12-07T02:14:20.113" Score="3" ViewCount="1315" Body="&lt;p&gt;I am doing a project for my class Financial Time Series in which I am trying to forecast my portfolio log returns using a GARCH fit. I am having a bit of trouble determining the best way to fit this model, and which order model is the best fit. I have tried everything from garchM to rugarch. So far, I have gathered that the best way to determine which order is adequate, is by comparing AICs for different ordered models. If someone could please get back to me that would be great!&#xA;Thanks,&#xA;Jeff W&lt;/p&gt;&#xA;" OwnerUserId="13759" LastActivityDate="2015-01-13T20:44:03.837" Title="How to find the best fitting GARCH model for a portfolio composed of 3 ETFs in R?" Tags="&lt;time-series&gt;&lt;r&gt;&lt;modeling&gt;&lt;garch&gt;&lt;quantitative&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15784" PostTypeId="1" AcceptedAnswerId="15897" CreationDate="2014-12-07T03:54:32.353" Score="3" ViewCount="126" Body="&lt;p&gt;When using asset pricing models such as the CAPM or the Fama-French four factor model to determine the risk-adjusted return of a portfolio, does this strictly require efficient diversification of the portfolio? How consequential is a violation of this assumption? Do the regression coefficients obtained from estimation of such a model, using the return time series of a portfolio as dependent variable have a meaningful interpretation when the portfolio is far from efficient diversification?&lt;/p&gt;&#xA;" OwnerUserId="13665" LastActivityDate="2014-12-16T17:18:27.340" Title="How consequential are violations of the efficient diversification assumption of asset pricing models?" Tags="&lt;returns&gt;&lt;modern-portfolio-theory&gt;&lt;capm&gt;&lt;asset-pricing&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15785" PostTypeId="2" ParentId="15767" CreationDate="2014-12-07T10:34:44.843" Score="0" Body="&lt;p&gt;If you assume the payoff is paid at time T, you just have to compute P(tau &amp;lt; T). In this case, you have everything you need to do it. If the payoff is paid at time tau, you need to compute the density of the stopping time.&lt;/p&gt;&#xA;" OwnerUserId="5819" LastActivityDate="2014-12-07T10:34:44.843" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15786" PostTypeId="2" ParentId="15744" CreationDate="2014-12-07T10:42:48.400" Score="0" Body="&lt;p&gt;The most common approach is to multiply by sqrt of 250. This is the standard. Although very basic. A much better solution is to make your monte carlo simulation on a 1 year time period using scaled parameters over 1 year.&lt;/p&gt;&#xA;" OwnerUserId="5819" LastActivityDate="2014-12-07T10:42:48.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15788" PostTypeId="1" AcceptedAnswerId="15790" CreationDate="2014-12-07T19:39:35.347" Score="7" ViewCount="2676" Body="&lt;p&gt;I have a series of monthly log-returns; let's assume the log-returns are normally distributed, but exhibit significant serial correlation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of normal, i.i.d. returns, I can annualize the the log-returns by multiplying by a factor 12, and annualise the volatility by a factor of sqrt(12).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the dependence in my returns, how do I correctly scale to annual results?&lt;/p&gt;&#xA;" OwnerUserId="13766" LastEditorUserId="2587" LastEditDate="2014-12-09T08:30:05.453" LastActivityDate="2014-12-17T23:13:27.320" Title="How to annualise the volatility of non-iid returns?" Tags="&lt;returns&gt;&lt;auto-correlation&gt;&lt;log-returns&gt;&lt;annualized&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15789" PostTypeId="2" ParentId="15767" CreationDate="2014-12-07T20:24:16.483" Score="2" Body="&lt;p&gt;Here is to continue the above answer of Emcor to make it more explicit. &#xA;Note that the fact given in the question should instead be&#xA;\begin{align*}&#xA;P(\inf \big\{t \in [0, T], B_t +ct = a \big\} \geq T) =  1- \Phi\Big(\frac{a-cT}{\sqrt{T}}\Big) + e^{2ac}\Phi\Big(\frac{-a-cT}{\sqrt{T}}\Big).&#xA;\end{align*}&#xA;Then, for $0&amp;lt;t_0\leq T$,&#xA;\begin{align*}&#xA;P(\tau \leq t_0) &amp;amp;= P\Big(\inf \big\{t \in [0, T], S_t &amp;gt;e^{a\sigma} \big\} \leq t_0 \Big)\\&#xA;&amp;amp;= P\Big(\inf \big\{t \in [0, T], B_t +ct&amp;gt;a \big\}\leq t_0 \Big)\\&#xA;&amp;amp;= P\Big(\inf \big\{t \in [0, t_0], B_t +ct&amp;gt;a \big\} \leq t_0 \Big)\\&#xA;&amp;amp;= P\Big(\inf \big\{t \in [0, t_0], B_t +ct = a \big\} \leq t_0 \Big)\\&#xA;&amp;amp;= \Phi\Big(\frac{a-ct_0}{\sqrt{t_0}}\Big) - e^{2ac}\Phi\Big(\frac{-a-ct_0}{\sqrt{t_0}}\Big).&#xA;\end{align*}&#xA;Let $\phi$ denote the density function of a standard normal random variable. Then the density of $\tau$ over the interval $[0, T]$ is given by (by differentiating the above function with respect to $t_0$)&#xA;\begin{align*} &#xA;\phi_{\tau}(t_0) &amp;amp;= \frac{a}{\sqrt{t_0^3}}\phi\Big(\frac{a-ct_0}{\sqrt{t_0}}\Big) \\&#xA;&amp;amp;=\frac{a}{\sqrt{2\pi t_0^3}}e^{-\frac{1}{2}\big(\frac{a^2}{t_0} - 2ac + c^2 t_0 \big)}.&#xA;\end{align*}&#xA;The option value is then&#xA;\begin{align*}&#xA;&amp;amp;\int_0^T e^{-r t_0} \frac{a}{\sqrt{2\pi t_0^3}}e^{-\frac{1}{2}\big(\frac{a^2}{t_0} - 2ac + c^2 t_0 \big)} dt_0\\&#xA;=&amp;amp;e^{a\big(c-\sqrt{c^2 + 2 r}\big)}\int_0^T \frac{a}{\sqrt{2\pi t_0^3}}e^{-\frac{1}{2}\big(\frac{a^2}{t_0} - 2a\sqrt{c^2 + 2 r} + (\sqrt{c^2 + 2 r})^2 t_0 \big)} dt_0\\&#xA;=&amp;amp; e^{a\big(c-\sqrt{c^2 + 2 r}\big)}\bigg[\Phi\bigg(\frac{a-\sqrt{c^2 + 2 r}\,t_0}{\sqrt{t_0}}\bigg) -e^{2a\sqrt{c^2 + 2 r}}\Phi\bigg(\frac{-a-\sqrt{c^2 + 2 r}\,t_0}{\sqrt{t_0}}\bigg)\bigg]_0^T\\&#xA;=&amp;amp; e^{a\big(c-\sqrt{c^2 + 2 r}\big)}\Phi\bigg(\frac{a-\sqrt{c^2 + 2 r}\,T}{\sqrt{T}}\bigg) + e^{a\big(c+\sqrt{c^2 + 2 r}\big)}\Phi\bigg(\frac{-a-\sqrt{c^2 + 2 r}\,T}{\sqrt{T}}\bigg).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2014-12-08T15:46:18.800" LastActivityDate="2014-12-08T15:46:18.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15790" PostTypeId="2" ParentId="15788" CreationDate="2014-12-07T20:41:06.423" Score="8" Body="&lt;p&gt;The correct answer has some intuition though it doesn't generalize to continuous time very easily:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Think about the paper below like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Var(X+Y) = Var(X) + Var(Y) + 2Cov(X,Y)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The generalization is slightly hard because the dynamics of $\mu$ and $\sigma^2$ could be dependent for arbitrary returns. You can use a GMM estimator to derive the asymptotic distribution for the required quantities and generalize: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The formula is given as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Q = \sqrt{T + 2\sum^{T-1}_{k=1} (T-k) \rho_k}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Q$ is the annualization factor, and $\rho_k$ is the autocorrelation at the $\text{k}^{\text{th}}$ lag.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Andrew Lo analyzed this idea in the paper &lt;em&gt;&lt;a href=&quot;http://edge-fund.com/Lo02.pdf&quot;&gt;Statistics of Sharpe Ratios&lt;/a&gt;&lt;/em&gt; (2002).&lt;/p&gt;&#xA;" OwnerUserId="13415" LastEditorUserId="467" LastEditDate="2014-12-08T01:02:45.667" LastActivityDate="2014-12-08T01:02:45.667" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15791" PostTypeId="2" ParentId="12618" CreationDate="2014-12-08T01:30:49.303" Score="3" Body="&lt;p&gt;I am using NodeJS for a similar project.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's not a ton of packages on NPM for finance and stocks, so I wrote my own, that might help you get started:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Fetching historical stock data, including intraday: &lt;a href=&quot;https://www.npmjs.org/package/node-activetick&quot; rel=&quot;nofollow&quot;&gt;https://www.npmjs.org/package/node-activetick&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Charting, analysing, forecasting the data: &lt;a href=&quot;https://www.npmjs.org/package/timeseries-analysis&quot; rel=&quot;nofollow&quot;&gt;https://www.npmjs.org/package/timeseries-analysis&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You can use timeseries-analysis to write your own indicators, and chart them with the stock data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am currently writing a new npm package to make using/creating indicators easier and more efficient. Mail me if you want to follow up or if you have any question.&lt;/p&gt;&#xA;" OwnerUserId="13769" LastActivityDate="2014-12-08T01:30:49.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15792" PostTypeId="1" AcceptedAnswerId="15805" CreationDate="2014-12-08T01:48:34.833" Score="5" ViewCount="422" Body="&lt;p&gt;I'm currently optimizing portfolio weights for an investment team with N stocks.  We buy stocks with a conviction it will generate a return and it is up to me to determine weighting.  However, with these N stocks, I will need the optimizer to include every stock even if it has bad potential reward to risk since the methods of estimating are still susceptible to estimation errors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm optimizing the Sharpe Ratio with constant correlation model and also modelling returns via a weighted average of analyst consensus and empirical mean return.  To temporarily solve the issue, I do a weighted combination of both the optimal sharpe ratio portfolio and the minimum variance portfolio with a subjective upperbound (ex: 8% max for a 20 stock portfolio).  Even then, I get one or two stocks with a zero weighting.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is that, are there any rule of thumbs/methods out there to help with this?  What would you guys recommend in terms of a more fruitful way to approach the issue of concentrated portfolio&lt;/p&gt;&#xA;" OwnerUserId="11888" LastActivityDate="2014-12-09T09:48:31.607" Title="Portfolio Optimization to include ALL Securities?" Tags="&lt;portfolio-management&gt;&lt;optimization&gt;&lt;portfolio&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15794" PostTypeId="2" ParentId="15768" CreationDate="2014-12-08T15:11:34.353" Score="1" Body="&lt;p&gt;Using BBPlus, and help desk, I found out this is possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From terminal XLTP XLOP.  Download the XLOP spreadsheet. From &quot;Single Options&quot; tab you can see a great example of how to use BBOPT() function to pull a list of feed codes.&lt;/p&gt;&#xA;" OwnerUserId="12104" LastActivityDate="2014-12-08T15:11:34.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15795" PostTypeId="1" AcceptedAnswerId="15796" CreationDate="2014-12-08T16:07:26.593" Score="13" ViewCount="11610" Body="&lt;p&gt;Suppose that:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$W^*_t$ is a Wiener process under probability measure&#xA;$\mathbb{P}^*$ and;&lt;/li&gt;&#xA;&lt;li&gt;$\tilde{S}_t=S_0+\sigma\int_{0}^{t}S(u)dW^*_s$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In my lecture notes, it says that $\tilde{S}_t$ is a martingale under&#xA;$\mathbb{P}^*$ &quot;&lt;strong&gt;due to the fact that the stochastic integral from 0 to&#xA;t with respect to Brownian motion is a martingale&lt;/strong&gt;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is this quotation (in bold) indeed correct?&lt;/p&gt;&#xA;" OwnerUserId="6661" LastEditorUserId="467" LastEditDate="2014-12-09T01:12:31.963" LastActivityDate="2020-01-02T15:56:26.150" Title="Why is this stochastic integral a martingale?" Tags="&lt;stochastic-calculus&gt;&lt;martingale&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="15796" PostTypeId="2" ParentId="15795" CreationDate="2014-12-08T16:35:17.220" Score="15" Body="&lt;p&gt;In the integral&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\int_0^t S_u dW^{*}_u \, ,$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$dW^{*}_u \equiv W^{*}_{u+du} - W^{*}_u$&lt;/span&gt; is independent from the integrand &lt;span class=&quot;math-container&quot;&gt;$S_u$&lt;/span&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So,&#xA;&lt;span class=&quot;math-container&quot;&gt;$\mathbb{E}\left[ \int_0^t S_u dW^{*}_u\middle\vert \mathcal{F}_0\right] =  \int_0^t \mathbb{E}\left[S_u \middle\vert \mathcal{F}_0\right]\mathbb{E}\left[dW^{*}_u\middle\vert \mathcal{F}_0\right] = 0$&lt;/span&gt;, since &lt;span class=&quot;math-container&quot;&gt;$\mathbb{E}\left[dW^{*}_u\middle\vert \mathcal{F}_0 \right] = 0$&lt;/span&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, &lt;span class=&quot;math-container&quot;&gt;$\mathbb{E}\left[ S_t\middle\vert \mathcal{F}_0\right] &#xA;= \mathbb{E}\left[ S_0\middle\vert \mathcal{F}_0\right] + &#xA;  \mathbb{E}\left[ \int_0^t S_u dW^{*}_u\middle\vert \mathcal{F}_0\right]&#xA;= \mathbb{E}\left[ S_0\middle\vert \mathcal{F}_0\right]$&lt;/span&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To address Gordon's comments that we need to prove that the integral is a martingale, recall that &lt;span class=&quot;math-container&quot;&gt;$g_t$&lt;/span&gt; is a martingale if, for &lt;span class=&quot;math-container&quot;&gt;$s &amp;lt; t$&lt;/span&gt;, &#xA;&lt;span class=&quot;math-container&quot;&gt;$$\mathbb{E}\left[ g_t \middle\vert \mathcal{F}_s \right] = g_s \, .$$&lt;/span&gt;&#xA;Now let &lt;span class=&quot;math-container&quot;&gt;$g_t = \int_0^t S_u dW^{*}_u$&lt;/span&gt;.&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\mathbb{E}\left[ g_t \middle\vert \mathcal{F}_s \right] = \mathbb{E}\left[ \int_0^s S_u dW^{*}_u\middle\vert \mathcal{F}_s\right] +&#xA; \mathbb{E}\left[ \int_s^t S_u dW^{*}_u\middle\vert \mathcal{F}_s\right]&#xA;= \int_0^s S_u dW^{*}_u + 0 = g_s \, . $$&lt;/span&gt;&lt;/p&gt;&#xA;" OwnerUserId="3188" LastEditorUserId="3188" LastEditDate="2020-01-02T15:56:26.150" LastActivityDate="2020-01-02T15:56:26.150" CommentCount="13" ContentLicense="CC BY-SA 4.0" />
  <row Id="15797" PostTypeId="1" CreationDate="2014-12-08T17:21:12.303" Score="5" ViewCount="53815" Body="&lt;p&gt;I am trying to replicate the beta value that yahoo calculates but I am getting different results. According to Yahoo, its beta is calculated using 5 year returns against the SP500: &lt;a href=&quot;http://finance.yahoo.com/education/stocks/article/101033/Beta&quot; rel=&quot;nofollow noreferrer&quot;&gt;yahoo beta&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume that daily values are used though it is not stated. I downloaded historical prices for MSFT from Dec 2009 to Dec 2014 and replicated this calculation, using:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\beta = cov(MSFT, SP500)/var(SP500)$$&lt;/span&gt;&#xA;I obtain a result of about 0.89 whereas Yahoo quotes a beta of 0.69.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using a 3 year horizon, I am getting 0.96 which is very close to the Beta quoted by Google (0.98). So, I think Google uses something like a 3 year horizon (though I don't know the exact dates) but Yahoo is completely off. Does anyone knows how it is calculated?&lt;/p&gt;&#xA;" OwnerUserId="13757" LastEditorUserId="26242" LastEditDate="2020-04-06T08:32:38.000" LastActivityDate="2020-04-06T08:32:38.000" Title="How does Yahoo finance calculate Beta?" Tags="&lt;beta&gt;&lt;yahoofinance&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="15798" PostTypeId="2" ParentId="2218" CreationDate="2014-12-08T20:34:16.510" Score="1" Body="&lt;p&gt;High Frequency: Seconds, Milliseconds, Nanoseconds &lt;br/&gt;&#xA;Medium Frequency: Minutes&lt;br/&gt;&#xA;Low frequency: Hours, Days, Months, Years&lt;/p&gt;&#xA;" OwnerUserId="13775" LastActivityDate="2014-12-08T20:34:16.510" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15799" PostTypeId="2" ParentId="15795" CreationDate="2014-12-08T22:08:30.663" Score="9" Body="&lt;p&gt;I aim to give a &lt;strong&gt;careful mathematical treatment&lt;/strong&gt; to this answer, whilst following the fantastic book &quot;Basic Stochastic Processes&quot; by Brzezniak and Zastawniak. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason I am putting this answer on is twofold: first, to compliment @ William S. Wong's answer by adding greater mathematical intricacy for other users of the website, and secondly to confirm that I understand the solution. To that end, I welcome any improvements / corrections.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason I &lt;strong&gt;asked&lt;/strong&gt; this question, is actually because I wanted to know if there was a more concise, yet still rigorous, way of approaching this problem.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Definitions&lt;/h1&gt;&#xA;&#xA;&lt;h3&gt;Random step process&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;We shall call $f(t), t\geq0$ a random step process if there is a finite sequence of numbers $0=t_0&amp;lt;t_1&amp;lt;\cdots&amp;lt;t_n$ and square integrable random variables $\eta_0,\eta_1,\cdots,\eta_{n-1}$ such that&#xA;$$f(t)=\sum_{j=0}^{n-1}\eta_j1_{[t_j,t_{j+1})}(t)$$&#xA;where $\eta_j$ is $\mathcal{F}_t$-measurable for $j=0,1,\cdots,n-1$. The set of random step processes will be denoted $M^2_{\mbox{step}}$. &lt;/p&gt;&#xA;&#xA;&lt;h3&gt;The Stochastic Integral (for step processes)&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The stochastic integral of a random step process $f \in M^2_{\mbox{step}}$ is defined by&#xA;$$I(f)=\sum_{j=0}^{n-1}\eta_j(W(t_{j+1})-W(t_j)).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The stochastic integral $I(f)$ has now been defined for $M^2_{\mbox{Step}}$. We now extend this definition to a larger class of processes by approximation.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;The &quot;approximative&quot; processes $M^2$ &lt;/h3&gt;&#xA;&#xA;&lt;p&gt;We denote by $M^2$ the class of stochastic processes $f(t), t\geq 0$ such that&#xA;$$E\left(\int_0^\infty|f(t)|^2dt\right) &amp;lt; \infty$$ and there is a sequence $f_1,f_2,\cdots,\in M^2_{\mbox{step}}$ of random step processes such that &#xA;$$\lim_{n\to\infty} E\left(\int_0^\infty|f(t)-f_n(t)|^2dt\right)=0.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, we shall say that the sequence of random step processes $f_1,f_2,\cdots$ &lt;strong&gt;approximates&lt;/strong&gt; $f$ in $M^2$.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt; The Ito Stochastic Integral (from $0$ to $\infty$) &lt;/h3&gt;&#xA;&#xA;&lt;p&gt;We call $I(f) \in L^2$ the Ito Stochastic Integral (from $0$ to $\infty$) of $f\in M^2$ if&#xA;$$\lim_{n\to\infty}E\left(|I(f)-I(f_n)|^2\right)=0$$&#xA;for any sequence $f_1,f_2,\cdots \in M^2_{\mbox{step}}$ that approximates $f$ in $M^2$. We shall also write&#xA;$$\int_0^\infty f(t) dW(t)$$ in place of $I(f)$.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt; The Ito Stochastic Integral (from $0$ to $T$) &lt;/h3&gt;&#xA;&#xA;&lt;p&gt;For any $T&amp;gt;0$ we shall denote by $M^2_{T}$ the space of all stochastic processes $f(t)$,$t \geq 0$ such that $1_{[0,T)}f \in M^2$. The Ito Stochastic Integral from $0$ to $T$ of $f \in M^2_T$ is defined by &#xA;$$I_T(f) \equiv \int_0^T f(t)dW(t) = I(1_{[0,T)}f).$$&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Definition of a martingale&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;A stochastic process $\xi(t)$ parameterized by $t \in T$ is called a Martingale with respect to filtration $\mathcal{F}_t$ if:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$\xi(t)$ is integrable for each $t \in T$&lt;/li&gt;&#xA;&lt;li&gt;$\xi(t)$ is $\mathcal{F}_t$-measurable for each $t \in T$&lt;/li&gt;&#xA;&lt;li&gt;$\xi(s) = E(\xi(t)|\mathcal{F}_s)$ for every $s, t \in T$ such that $s \leq t$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The third bullet point is called the Martingale condition.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Lemma 1&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;For each random step process $f\in M_{step}^{2}$, the stochastic integral $\int_{0}^{t}f(s)dW(s)$&#xA;is a martingale.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Proof of Lemma 1&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Let $0\leq s &amp;lt; t$ and suppose that $f \in M_{step}^{2}$ can be written of the form of our definition, whereby &#xA;$$0=t_0 &amp;lt; t_1 &amp;lt; \cdots &amp;lt; t_k =s &amp;lt; t_{k+1} &amp;lt; \cdots &amp;lt; t_m = t &amp;lt; t_{m+1} &amp;lt; \cdots &amp;lt; t_n.$$ We shall denote the increment $W(t_{j+1}) - W(t_j)$ by $\Delta_j W$. Then &#xA; $$1_{[0,t]}f = \sum_{j=0}^{m-1} \eta_j 1_{[t_j,t_{j+1}]}$$&#xA;and&#xA; $$I_t(f) = I(1_{[0,t]}f) = \sum_{j=0}^{m-1} \eta_j \Delta_j W,$$&#xA;which is adapted to $\mathcal{F}_t$ and square integrable, and so integrable. It remains to compute&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E(I_t(f) | \mathcal{F}_s) = E(\sum_{j=0}^{m-1} \eta_j \Delta_j W | \mathcal{F}_s) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $j&amp;lt;k$, then $\eta_j$ and $\Delta_j W$ are $\mathcal{F}_s$-measurable and&#xA;$$E(\eta_j \Delta_j W | \mathcal{F}_s) = \eta_j \Delta_j W. $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is getting to the heart of the question now. Note that:&#xA;If $j\geq k$ then $\mathcal{F}_s \subset \mathcal{F}_{t_j}$ and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray*} &#xA;E(\eta_{j}\Delta_{j}W|\mathcal{F}_{s}) &amp;amp; = &amp;amp; E(E(\eta_{j}\Delta_{j}W|\mathcal{F}_{t_{j}})|\mathcal{F}_{s})\mbox{ by the tower property}\\&#xA; &amp;amp; = &amp;amp; E(\eta_{j}E(\Delta_{j}W|\mathcal{F}_{t_{j}})|\mathcal{F}_{s})\mbox{ by taking out what's known}\\&#xA; &amp;amp; = &amp;amp; E(\eta_{j}|\mathcal{F}_{s})E(\Delta_{j}W)\mbox{ by independence}\\&#xA; &amp;amp; = &amp;amp; E(\eta_{j}|\mathcal{F}_{s})\times0\mbox{ by definition of Wiener process.}&#xA;\end{eqnarray*}&#xA;It follows that &#xA;\begin{eqnarray*}&#xA;E(I_{t}(f)|\mathcal{F}_{s}) &amp;amp; = &amp;amp; \sum_{j=0}^{k-1}\eta_{j}\Delta_{j}W\\&#xA; &amp;amp; = &amp;amp; I(1_{[0,s]}f)\\&#xA; &amp;amp; = &amp;amp; I_{s}(f).&#xA;\end{eqnarray*}&lt;/p&gt;&#xA;&#xA;&lt;h1&gt; Proof of the Martingale Property &lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Finally we show that for any $f\in M_{t}^{2}$ and for any $0\leq s&amp;lt;t$&#xA;that &#xA;$$&#xA;E\left(\int_{0}^{t}f(r)dW(r)|\mathcal{F}_{s}\right)=\int_{0}^{s}f(r)dW(r).&#xA;$$&#xA; We approach this by remembering that a process can be approximated&#xA;by a sequence of step processes. That is, if $f$ belongs to $M_{t}^{2}$&#xA;then $1_{[0,t)}f$ belongs to $M^{2}$. Let $f_{1},f_{2},\cdots$&#xA;be a sequence of processes in $M_{\mbox{step}}^{2}$ approximating&#xA;$1_{[0,t)}f$. By lemma 1, we know that&#xA;$$&#xA;E\left(I(1_{[0,t)}f_{n})|\mathcal{F}_{s}\right)=I\left(1_{[0,s)}f_{n}\right)&#xA;$$&#xA; for each $n$. By taking the $L^{2}$ limit of both sides of this&#xA;equality as $n\to\infty$ we shall show that&#xA;$$&#xA;E\left(I(1_{[0,t)}f)|\mathcal{F}_{s}\right)=I\left(1_{[0,s)}f\right)&#xA;$$&#xA;which is what we need to prove. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right hand side: observe that $1_{[0,s)}f_{1},1_{[0,s)}f_{2},\cdots$&#xA;is a sequence in $M_{\mbox{step}}^{2}$ approximating $1_{[0,s)}f$&#xA;so &#xA;$$&#xA;I\left(1_{[0,s)}f_{n}\right)\to I\left(1_{[0,s)}f\right)\mbox{ in }L^{2}\mbox{ as }n\to\infty.&#xA;$$&#xA;Left hand side: $1_{[0,t)}f_{1},1_{[0,t)}f_{2},\cdots$ is also a&#xA;sequence in $M_{\mbox{step}}^{2}$ approximating $I(1_{[0,t)}f)$,&#xA;which implies that&#xA;$$&#xA;I\left(1_{[0,t)}f_{n}\right)\to I\left(1_{[0,t)}f\right)\mbox{ in }L^{2}\mbox{ as }n\to\infty.&#xA;$$&#xA;It is now possible to show that, &#xA;$$&#xA;E\left(I\left(1_{[0,t)}f_{n}\right)|\mathcal{F}_{s}\right)\to E\left(I\left(1_{[0,t)}f\right)|\mathcal{F}_{s}\right)\mbox{ in }L^{2}\mbox{ as }n\to\infty&#xA;$$&#xA;which completes the proof. Why does this last equation hold? It's&#xA;subtle... not obvious... and the answer is given Lemma 2.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt; Lemma 2 &lt;/h3&gt;&#xA;&#xA;&lt;p&gt;If $\xi$ and $\xi_{1},\xi_{2},\cdots,$ are square integrable random&#xA;variables such that $\xi_{n}\to\xi$ in $L^{2}$ as $n\to\infty$&#xA;then&#xA;$$&#xA;E\left(\xi_{n}|\mathcal{G}\right)\to E\left(\xi|\mathcal{G}\right)\mbox{ in }L^{2}\mbox{ as }n\to\infty&#xA;$$&#xA;for any $\sigma-$field $\mathcal{G}$ on $\Omega$ contained in $\mathcal{F.}$ &lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Proof &lt;/h3&gt;&#xA;&#xA;&lt;p&gt;By Jensens inequality, &#xA;\begin{eqnarray*}&#xA;\left|E\left(\xi_{n}|\mathcal{G}\right)-E\left(\xi|\mathcal{G}\right)\right|^{2} &amp;amp; = &amp;amp; \left|E\left(\xi_{n}-\xi|\mathcal{G}\right)\right|^{2}\\&#xA; &amp;amp; \leq &amp;amp; E\left(\left|\xi_{n}-\xi\right|^{2}|\mathcal{G}\right),&#xA;\end{eqnarray*}&#xA;which implies that&#xA;\begin{eqnarray*}&#xA;E\left(\left|E\left(\xi_{n}|\mathcal{G}\right)-E\left(\xi|\mathcal{G}\right)\right|^{2}\right) &amp;amp; \leq &amp;amp; E\left(E\left(\left|\xi_{n}-\xi\right|^{2}|\mathcal{G}\right)\right)\\&#xA; &amp;amp; = &amp;amp; E\left(\left|\xi_{n}-\xi\right|^{2}\right)\to0&#xA;\end{eqnarray*}&#xA; as $n\to\infty.$ &lt;/p&gt;&#xA;" OwnerUserId="6661" LastEditorUserId="6661" LastEditDate="2014-12-09T10:43:54.713" LastActivityDate="2014-12-09T10:43:54.713" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15800" PostTypeId="1" CreationDate="2014-12-09T05:12:37.687" Score="2" ViewCount="164" Body="&lt;p&gt;I'm fitting a stock price time series data to ARIMA model and I have a question about the assumption.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it that ARIMA only applies to stationary data? The ACF and PACF of the data (and the logged return too)both show it's non-stationary. So can I still fit ARIMA to it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The residuals of the fitted model actually shows it works quite and well. But I worry about the assumption. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!! &lt;/p&gt;&#xA;" OwnerUserId="13776" LastEditorUserId="2587" LastEditDate="2014-12-09T08:15:29.953" LastActivityDate="2014-12-09T08:15:29.953" Title="What do I need to do with my data before fitting the ARIMA model?" Tags="&lt;time-series&gt;&lt;arima&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15801" PostTypeId="2" ParentId="14569" CreationDate="2014-12-09T05:49:58.173" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://www.jfree.org/jfreechart/&quot; rel=&quot;nofollow&quot;&gt;JFreeeChart&lt;/a&gt; provides a TimeSeries data structures with some basic functionality but not a lot of analytics. I have started writing my own and I may open source it if there is sufficient interest. Moving averages, deviations, correlations, returns and most of the easy stuff are already implemented, but I think it needs a few more interesting features before I can consider it truly useful. &lt;/p&gt;&#xA;" OwnerUserId="13757" LastActivityDate="2014-12-09T05:49:58.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15802" PostTypeId="1" AcceptedAnswerId="15887" CreationDate="2014-12-09T08:10:54.170" Score="4" ViewCount="1518" Body="&lt;p&gt;I've gone through all the steps to fit a good ARIMA model - I plotted the data, I looked at the ADF tests, I looked at the ACF plot with no AR and MA terms just a constants. I came up with an ARMA(0,1,1) model as the ACF cut off after two lags (the second was negative) and the PACF decayed exponentially from the first order being negative. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is I cannot get rid of a large positive spike at the first order lag in the ACF plot of the residuals once my model is fitted. I've tried increasing the number of MA terms, but the lag doesn't go away and the second term isn't significant. Given it is an MA model, I don't think further orders of differencing are need.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've coded my model in R&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any advice?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&#xA;I've included some of the graphs below. I tested my model with and without a constant, as the constant was not significant, however the AIC was lower with a constant. Theoretically thought, I think no constant makes more sense as I don't think there is a constant average trend. However, excluding the constant (with the argument include.mean=FALSE) doesn't change the ACF or PACF of ther residuals. The code I used to fit the models is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ArmaOhdifc01 = armaFit( ~arma(0, 1), data=OhDiff)&#xA;ArmaOhdif01 = armaFit( ~arma(0, 1), data=OhDiff, include.mean=FALSE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Below are the graphs - I didn't include the ACF and PACF of the first model becuase there is no difference to that of the second.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/HQ2CQ.jpg&quot; alt=&quot;The first graph is just a plot of the 1st differenced data&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/3tCCW.jpg&quot; alt=&quot;The second graph is a plot of the ACF of a model fitted with just a constant on the differenced data, and no AR or MA terms&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ITK6w.jpg&quot; alt=&quot;The third graph is the PACF on the same model with just a constant&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/flKQl.jpg&quot; alt=&quot;The 4th plot is the ACF on the residuals of an ARMA(0,1,1) with a constant&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/FzVWA.jpg&quot; alt=&quot;The 6th plot is the PACF on the residuals of an ARMA(0,1,1) with a constant&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="11632" LastEditorUserId="11632" LastEditDate="2014-12-15T22:30:17.973" LastActivityDate="2014-12-16T01:33:04.483" Title="ARIMA model, cannot get rid of low order ACF spike" Tags="&lt;time-series&gt;&lt;r&gt;&lt;models&gt;&lt;forecasting&gt;&lt;arma&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15803" PostTypeId="2" ParentId="15800" CreationDate="2014-12-09T08:14:54.960" Score="3" Body="&lt;p&gt;What you should do:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;read a general introduction to time series analysis before you apply these methods otherwise you will misinterpret the results. &lt;/li&gt;&#xA;&lt;li&gt;time series are assumed to be covariance stationary. This is in short that their mean is the same for all points in time and that the covariance between two observations only depends on the lag.&lt;/li&gt;&#xA;&lt;li&gt;the &quot;I&quot; in ARIMA means that time series could be integrated. This means that you have to difference them in order to get something stationary.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You can start to read in this &lt;a href=&quot;https://www.otexts.org/fpp/8/1&quot; rel=&quot;nofollow&quot;&gt;excellent online text book by Rob Hyndman and George Athana­sopou­los&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of stock prices you should look at log-returns, which can usually be assumed to be a stationary time series.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-12-09T08:14:54.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15804" PostTypeId="2" ParentId="15792" CreationDate="2014-12-09T08:43:34.473" Score="3" Body="&lt;p&gt;First the easy solution:&#xA;Define the continuous weights of each asset:&#xA;$w_i \in [0,1],i=1,\ldots,N$ and choose some meaningful lower bound for each weight.&#xA;Then you have the objective&#xA;$$&#xA;w\mu  - \lambda w^T \Sigma w \rightarrow Max,&#xA;$$&#xA;all your constraints that you already apply and the additional (linear/box) constraint&#xA;$$&#xA;w_i \ge l, i=1,\ldots,N.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively in order to control the number of non-zeros you can try the following if your optimizer can solve mixed-integer programs.&#xA;All you have to do is to define binary variables $b_i \in \{0,1\},i=1,\ldots,N$&#xA;and the constraint that couples the weights and binary variables:&#xA;$$&#xA;w_i \ge l b_i, i=1,\ldots,N,&#xA;$$&#xA;and&#xA;$$&#xA;w_i \le b_i, i=1,\ldots,N.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then $w_i = 0$ if $b_i =0$ and $w_i \ge l$ if $b_i = 1$. Then you can for example use the constraint $ \sum_{i=1}^N b_i \le K$ in order to have at most $K$ positions or $ \sum_{i=1}^N b_i \ge L$ in order to have at least $L$ positions.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2014-12-09T08:43:34.473" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15805" PostTypeId="2" ParentId="15792" CreationDate="2014-12-09T09:48:31.607" Score="3" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Black Litterman might be a good solution to your problem, since it suffers less from corner solutions (concentrated portfolios). You already have active views in the form of return expectations, and you can control the confidence in your views explicitly; see for example Meucci's &lt;em&gt;Risk and Asset Allocation&lt;/em&gt; chapter 9.2 for a description.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Since you have a ranking between the stocks (the expected returns) you may also use the Chris and Almgren 'Portfolio from Sorts' approach, which produces a smooth portfolio allocation. See &lt;a href=&quot;https://quant.stackexchange.com/questions/9673/portfolios-from-sorts&quot;&gt;this question&lt;/a&gt; for references.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;A third approach would be to use risk budgets to control the under-/overweights of the stocks on which you have a strong opinion. Or step away from mean-variance altogether and use risk parity for the active allocation in your portfolio.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="6721" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2014-12-09T09:48:31.607" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15806" PostTypeId="1" CreationDate="2014-12-09T10:07:35.840" Score="1" ViewCount="118" Body="&lt;p&gt;Suppose I have a very simple asset whose price takes only three possible values: $X_t\in \{-1,0,1\}$. I also got some &lt;em&gt;discrete&lt;/em&gt; time series $X = (X_t)_{t\geq 0}$ and I would like to come up with a trading rule based on these observations. Let's focus on the following naive approach: given the current level of the asset, I would like to estimate of what &lt;em&gt;the next change&lt;/em&gt; would be. Thus, I am fitting this time series into Markov Chain where I disregard transition that do not change the state. For example, based on the following sample from the time series:&#xA;$$&#xA;  \dots0,0,0,0,0,0,0,1,1,1,0,0,0,-1,-1\dots \tag{1}&#xA;$$&#xA;and suppose that there are no appearances of $0$ anymore. I can conclude that out of $10$ appearances of $0$, $7$ are followed by $1$ and $3$ are followed by $-1$, hence a naive algorithm would say that transition probabilities are $p(1|0) = 0.7$ and $p(-1|0) = 0.3$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I wanted to make it faster, so I preprocessed the data to get rid of repetitions since I thought that it shall not affect the end result. For example, the sample $(1)$ transforms into&#xA;$$&#xA;  \dots0,1,0,-1\dots \tag{2}&#xA;$$&#xA;but now $p(1|0) = 0.5$ and $p(-1|0) = 0.5$ which is quite different from the previous estimation. Of course, that's just a simple example, but it gives a general impression: the lumping procedure $(1)\to(2)$ changes the estimates of transition probabilities. It surprised me first, but now it seems very natural: in $(2)$ when sampling I give equal weight to each interval of consecutive $0$'s whereas in $(1)$ more weight goes to a longer interval of consecutive $0$'s.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is: given my purpose, what would be the correct method to estimate probabilities? Note that I am trying to predict the price move without taking into account for how long have I stayed at the current price of the asset, only the price level itself. From that perspective, I guess the second approach is more appropriate: if I observe new prices and I see the price is $0$, I'd say I'd rather rely on that the next price change happens with probabilities $(0.5,0.5)$ rather than $(0.7, 0.3)$. At the same time, here I do not feel confident since my background in statistics is rather weak, so any feedback on this topic is highly appreciated. Namely: what is formally more correct, to use probabilities from $(1)$ or from $(2)$, or if both are correct depending on how they are used, what is a proper way of using them. Practical comment on that approach is also welcome.&lt;/p&gt;&#xA;" OwnerUserId="13480" LastActivityDate="2015-03-09T17:31:24.467" Title="To lump or not to lump" Tags="&lt;time-series&gt;&lt;statistics&gt;&lt;probability&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15807" PostTypeId="1" CreationDate="2014-12-09T10:08:23.543" Score="2" ViewCount="444" Body="&lt;p&gt;We are modeling Foreign exchange rates using Black Scholes model given below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$F_{t}=F_{t−1} + (r_d−r_f)F_{t−1}dt + \sigma F_{t−1}dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$F_t$ and $F_{t−1}$ are FX rates at time $t$ and $t−1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_d$ domestic short rate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_f$ foreign short rate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dt$ is the change in time period&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma$ is the volatility obtained from ATM volatility surface&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dW_t$ is correlated random number (correlation is between $r_d$, $r_f$, and FX rate)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ran this model for $1000$ simulations and my percentile graphs show a skew on the positive side of distribution. Can someone please help me understand the skewness.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="13780" LastEditorUserId="13660" LastEditDate="2014-12-11T19:20:29.437" LastActivityDate="2014-12-13T02:24:56.320" Title="Skew in Black Scholes model" Tags="&lt;black-scholes&gt;&lt;skew&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15808" PostTypeId="1" CreationDate="2014-12-09T11:32:33.123" Score="1" ViewCount="90" Body="&lt;p&gt;I am trying to do pair trading on a pair of future contracts, e.g. CME gold and silver.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;During the training of my trading model, I do forward adjustment on the pair of future contracts. Let the forward adjustment of a future contract be delta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, when I test my trading model live, do I need to do forward adjustment of the live data? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think I need to, for example, let us assume I use 100 days of training data. Maybe on the 90th day, there is a forward adjustment of cme gold, which the raw price on the 90th day is 80, and the forward adjusted price on the 90th day is 100 (which means the delta is +20). Note that there is no forward adjustment of cme silver on 90th day. On the first day of the live testing, the raw price may be 70, so I need to add delta=20 to get the forward adjusted price of 90. &lt;/p&gt;&#xA;" OwnerUserId="2700" LastActivityDate="2014-12-09T11:32:33.123" Title="For futures contracts, do we need to do price adjustment during live testing?" Tags="&lt;futures&gt;&lt;price&gt;&lt;roll-adjustment&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15810" PostTypeId="2" ParentId="15806" CreationDate="2014-12-09T15:39:49.057" Score="1" Body="&lt;p&gt;It sounds to me like you have a Markov model that is not &quot;lumped&quot;, it's just that certain transitions don't provide you with any payout. I would model the true transition probabilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, let's ask what the probability of getting a one is, assuming that we won't stay at zero, i.e. $P(X_1=1 | X_0=0, X_1 \not = 0)$. We recall that $$P(A|B)=P(A,B) / P(B)$$ and therefore get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align*} &#xA;P(X_1=1 | X_0=0, X_1 \not = 0) &amp;amp;=\frac{P(X_1=1, X_1 \not = 0 | X_0=0)}{P(X_1 \not = 0| X_0=0)}\\ &#xA;&amp;amp; =\frac{P(X_1=1 | X_0=0)}{P(X_1 = 1| X_0=0) + P(X_1 = -1| X_0=0)} \\&#xA;&amp;amp; =\frac{P(1|0)}{P(1|0) + P(-1|0)} &#xA;\end{align*}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which is just your second definition where you found it to be $(.5,.5)$ as indeed half the times it transitioned away from zero it transitioned to one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Importantly, this is not $P(1|0)$! I think this is where you were getting confused before.&lt;/p&gt;&#xA;" OwnerUserId="5361" LastActivityDate="2014-12-09T15:39:49.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15811" PostTypeId="1" CreationDate="2014-12-09T16:24:14.147" Score="0" ViewCount="123" Body="&lt;p&gt;In attempts to establish an investment portfolio with a long term horizon, the method of relative dividend yield has caught my attention. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I require the Market Index Dividend Yield to proceed. The formula in Spare and Tengler's &quot;Relative Dividend Yield&quot; is presented as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathrm{Market\ Index\ Dividend\ Yield}=\frac{\mathrm{Indicated\ Index\ Annual\ Dividend\ Rate}}{\mathrm{Current\ Index\ Value}}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am having trouble calculating the numerator of this formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be greatly appreciated, especially in context to the Australian Stock Exchange (ASX).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you to all in advanced for you help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gustavo.&lt;/p&gt;&#xA;" OwnerUserId="13726" LastEditorUserId="13726" LastEditDate="2014-12-09T16:46:42.823" LastActivityDate="2014-12-12T00:59:59.600" Title="Calculating &quot;Market Index Dividend Yield&quot; of the ASX" Tags="&lt;market&gt;&lt;dividends&gt;&lt;yield&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15812" PostTypeId="1" CreationDate="2014-12-09T18:41:29.720" Score="1" ViewCount="3581" Body="&lt;p&gt;I've some intermediate knowledge in C++. However, the knowledge is more of a theoretical nature and not applied to quant finance problems. I'm looking for good sources, &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;code examples&lt;/li&gt;&#xA;&lt;li&gt;books&lt;/li&gt;&#xA;&lt;li&gt;blogs&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;to get a feeling how C++ is used in quantitative finance. I implemented some of the models by myself to get used to it. However, it would be nice to compare it with a more experienced source. &lt;/p&gt;&#xA;" OwnerUserId="17133" LastActivityDate="2014-12-09T20:12:17.167" Title="examples of c++ code with application to quant finance" Tags="&lt;programming&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ClosedDate="2014-12-09T20:33:02.317" ContentLicense="CC BY-SA 3.0" />
  <row Id="15813" PostTypeId="2" ParentId="15812" CreationDate="2014-12-09T20:12:17.167" Score="0" Body="&lt;p&gt;Look at &lt;a href=&quot;http://en.wikipedia.org/wiki/QuantLib&quot; rel=&quot;nofollow&quot;&gt; QuantLib &lt;/a&gt;.  Introductory slides are available at &lt;a href=&quot;http://quantlib.org/slides/dima-ql-intro-1.pdf&quot; rel=&quot;nofollow&quot;&gt;http://quantlib.org/slides/dima-ql-intro-1.pdf&lt;/a&gt; and &lt;a href=&quot;http://quantlib.org/slides/dima-ql-intro-2.pdf&quot; rel=&quot;nofollow&quot;&gt;http://quantlib.org/slides/dima-ql-intro-2.pdf&lt;/a&gt; .&lt;/p&gt;&#xA;" OwnerUserId="3188" LastActivityDate="2014-12-09T20:12:17.167" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15814" PostTypeId="2" ParentId="15345" CreationDate="2014-12-09T22:05:40.370" Score="0" Body="&lt;p&gt;I go through the following steps when determing the ARMA(p,q) order for my data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, you must determine whether any transformation is needed, such as a degree of differencing or taking the log. Remember the data must be stationary to fit an ARMA model. This can be done in a number of ways, but my preference is to run an augmented-dickey fuller test on the data to see if there is a unit root, if so the data needs to be differenced. Additionally, I run an ARMA model with no p/q terms and only a constant and different orders of differencing (start with 0 and 1), and then look at the ACF plot of these models. The model with lowest standard deviation is often the optimal level of differencing. Another concern is, if you want to capture a multiplicative pattern, try taking the log (and then potentially differencing as well). In any of these attempts, if there is a wave pattern in the residuals or another nonrandom pattern, you may want to increase your order of differencing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly, after selecting your data transformations, look at ACF and PACF plot for the series. The general rule is if the ACF cuts off sharply at lag k and the PACF decays more slowly you have an MA signature; and conversely if the ACF decays more slowly and PACF cuts off you have an AR signature. Remember, if you have 2 or more orders of differencing, the general practice is to not include a constant. If you have one order of differencing, the constant is your average trend, so it is up to you whether you think that is a justifiable assumption. If you still have spikes in either the ACF or PACF at a low-order lag, you need to add another AR or MA term. If your are deciding between two models, all else being equal, the model with the lower order of differencing is generally preferred.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another option, is to develop an algorithm which tests, on your stationarised series, the model with lowest AIC is considered the best. I don't like doing this in isolation from the the other steps, as it ignores other concerns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope that helps&lt;/p&gt;&#xA;" OwnerUserId="11632" LastActivityDate="2014-12-09T22:05:40.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15815" PostTypeId="1" CreationDate="2014-12-09T22:42:06.410" Score="0" ViewCount="244" Body="&lt;p&gt;I know &lt;a href=&quot;http://thomsonreuters.com/estimates/&quot; rel=&quot;nofollow&quot;&gt;thomsonreuters&lt;/a&gt; provide analysts' earnings estimates data. Is there any sources I could get it for free?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, &lt;a href=&quot;http://www.analystratings.net/stocks/NYSE/AEO/&quot; rel=&quot;nofollow&quot;&gt;this website&lt;/a&gt; has analysts' earnings data. What's the source of this and how to import to my own DB?&lt;/p&gt;&#xA;" OwnerUserId="1775" LastActivityDate="2014-12-10T01:17:36.883" Title="Where to get analysts' earnings estimates data?" Tags="&lt;estimation&gt;&lt;earnings&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2014-12-10T01:38:59.687" ContentLicense="CC BY-SA 3.0" />
  <row Id="15816" PostTypeId="2" ParentId="15815" CreationDate="2014-12-10T01:17:36.883" Score="0" Body="&lt;p&gt;If it helps, your local universities/college have bloomberg computers as part of their business section.  They are especially useful as the function &lt;em&gt;ANR&lt;/em&gt; provides all available/current and historical recommendations from each firm and it's available to be exported to excel.&lt;/p&gt;&#xA;" OwnerUserId="11888" LastActivityDate="2014-12-10T01:17:36.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15817" PostTypeId="2" ParentId="15797" CreationDate="2014-12-10T02:04:13.907" Score="3" Body="&lt;p&gt;Beta calculation varies quite a bit as you've already noted. Using monthly or weekly closing prices is fairly common though; I don't know of anyone who uses daily prices. Yahoo gets its data from CapitalIQ so you may want to look over there. Good luck!&lt;/p&gt;&#xA;" OwnerUserId="13785" LastActivityDate="2014-12-10T02:04:13.907" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15819" PostTypeId="2" ParentId="15345" CreationDate="2014-12-10T10:39:25.207" Score="3" Body="&lt;p&gt;The Autocorrelation Function (ACF) $\rho_k=Corr(y_t,y_{t-k})$ expresses the strength of linear dependency between the $k$-lagged realizations and hence represents an important tool for identification of the lag orders of ARMA and GARCH processes:&#xA;$$\rho_k:=Corr(y_t,y_{t-k})=\frac{\gamma_k}{\gamma_0},\,\,k\in\mathbb{Z}$$&#xA;where the Autocovariance $\gamma_k$ is defined as $\gamma_k:=Cov(y_t,y_{t-k})=E((y_t-\mu)(y_{t-k}-\mu))$ with $\gamma_0=Var(y_t)$ and $\mu=E(y_t)$. The estimated Sample Autocorrelation Function (SACF) for a sample $\hat{y}=(y_1,...,y_T)$ with mean $\hat{\mu}$ is given by:&#xA;$$\hat{\rho}_k:=\dfrac{\sum_{i=k+1}^T(y_i-\hat{\mu})(y_{i-k}-\hat{\mu})}{\sum_{i=1}^T (y_i-\hat{\mu})^2},\,\,k\in\mathbb{Z}$$&#xA;For weakly stationary processes, autocorrelation is symmetric as $\rho_k=\rho_{-k}$, $\gamma_k=\gamma_{-k}$. For an alternating series between positive and negative values, $\rho_k$ will alternate aswell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For AR(p), the autocorrelations follow a weighted mean aswell, described by the {Yule Walker equations}:&#xA;$$\gamma_k=a_1\gamma_{k-1}+a_2\gamma_{k-2}+...+a_p\gamma_{k-p},\,k\in\mathbb{Z}$$&#xA;$$\rho_k=a_1\rho_{k-1}+a_2\rho_{k-2}+...+a_p\rho_{k-p},\,k\in\mathbb{Z}$$&#xA;It can be shown that an AR(p) process has nonzero autocorrelation up to lag order $p$, and else decay to $0$ exponentially fast with increasing $k$, as the linear dependence of $y_t$ beyond lags $p$ is zero (only the incorporated past innovations for orders $k&amp;gt;p$ remain).  Yule Walker equations also allow estimation of the AR(p) coefficients $a_i,i=1,...,p$ from a given sample. However, for non-stationary processes the equations tend to become unstable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For an MA(q) process, one can show:&#xA;$$\gamma_k=\left\{\begin{array}{cl} \sigma_\epsilon^2\sum_{i=k}^qb_ib_{i-k}, &amp;amp;k=0,1,...,q\\ 0, &amp;amp; k&amp;gt;q \end{array}\right.$$&#xA;such that autocorrelation theoretically cuts off to $0$ directly at order $q$ (without exponential decay).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For ARMA(p,q) processes, one may apply Extended Yule Walker equations to show that ACF after $q$ and $p$ decays exponentially as $k$ increases. The GARCH process orders can be identified same way by ACF of the squared residuals $\epsilon_t^2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Empirical sample autocorrelations however often do not cut off or decline to $0$ exponentially, as they are only estimated from real samples. The significant order with $\hat{\rho}_k=0$ is hence determined by confidence intervals. SACF is normally distributed with mean zero such that the 95% confidence interval for $\hat{\rho}_k=0$ is given by $$[\pm1.96\sqrt{Var(\hat{\rho}_k})]$$ with $Var(\hat{\rho}_k)=\frac{1}{T}\left(1+2\sum_{i=1}^T \hat{\rho}_i^2\right),k&amp;gt;T$.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2014-12-10T10:39:25.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15820" PostTypeId="1" CreationDate="2014-12-10T13:19:27.570" Score="8" ViewCount="566" Body="&lt;p&gt;I am struggling in this question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $P(t,T)$ denote the price of a zero-coupon bond (with marturity at time $T$) at time $t \in [0,T]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As usual, at time $t$ for maturity $T$, the forward rate is defined by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f(t,T)= - \frac{\partial}{\partial T} \log P(t,T)$$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a short interest rate process $(r_t)$ satisfying the following dynamics:&#xA;\begin{equation}&#xA;dr_t = a(r_t) \,dt + b(r_t) \, dW_t&#xA;\end{equation}&#xA;for two smooth functions $a$ and $b$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let the function $G: [0,T] \times \mathbb{R} \rightarrow \mathbb{R}$ satisfy the following integral-differential equation:&#xA;\begin{equation}&#xA;\frac{\partial G}{\partial t} (t,r) = a(r) \frac{\partial G}{\partial r} (t,r) + \frac{ b(r)^2}{2} \frac{{\partial}^2 G}{\partial r^2} (t,r) - b(r)^2 \frac{\partial G}{\partial r} (t,r) \int_0^t \frac{\partial G}{\partial r} (s,r) \,ds,&#xA;\end{equation}&#xA;with initial condition $G(0,r)=r$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We want to show that there is no arbitrage if the forward rate function is defined by $f(t,T) = G(T-t, r_t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main problem I encounter is the fact that $ \frac{1}{G(t,r)} b(r)^2 \frac{\partial G}{\partial r} (t,r) \int_0^t \frac{\partial G}{\partial r} (s,r)\,ds $ isn't a function of $r$ only. Therefore, I don't know how to apply Feynman-Kac in this situation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions on how to transform this to Feynman-Kac?&lt;/p&gt;&#xA;" OwnerUserId="13654" LastEditorUserId="467" LastEditDate="2014-12-11T08:19:00.143" LastActivityDate="2016-11-04T20:37:37.677" Title="Integral-differential equation for forward rates" Tags="&lt;stochastic-calculus&gt;&lt;bond&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15821" PostTypeId="2" ParentId="14554" CreationDate="2014-12-10T21:27:30.327" Score="0" Body="&lt;p&gt;You can get individual company revenue and industry classification on Quantopian. You could then calculate the correlations. The data comes from Morningstar as described here: &lt;a href=&quot;https://www.quantopian.com/posts/fundamental-data-from-morningstar-now-available-for-backtesting&quot; rel=&quot;nofollow&quot;&gt;https://www.quantopian.com/posts/fundamental-data-from-morningstar-now-available-for-backtesting&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(disclosure: I'm the ceo of quantopian).&lt;/p&gt;&#xA;" OwnerUserId="799" LastActivityDate="2014-12-10T21:27:30.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15822" PostTypeId="2" ParentId="10691" CreationDate="2014-12-10T21:39:01.670" Score="5" Body="&lt;p&gt;Quantopian provides both the fundamental data (from Morningstar), as well as the backtest platform to reproduce results from the books you mentioned. Here's the introduction to our fundamentals offering: &lt;a href=&quot;https://www.quantopian.com/posts/fundamental-data-from-morningstar-now-available-for-backtesting&quot; rel=&quot;noreferrer&quot;&gt;https://www.quantopian.com/posts/fundamental-data-from-morningstar-now-available-for-backtesting&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(disclosure: I'm the ceo of quantopian)&lt;/p&gt;&#xA;" OwnerUserId="799" LastActivityDate="2014-12-10T21:39:01.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15823" PostTypeId="1" AcceptedAnswerId="22607" CreationDate="2014-12-11T09:17:25.460" Score="1" ViewCount="1752" Body="&lt;p&gt;Please validate my unrealized Fx P&amp;amp;L calculation on the commodity forward contract e.g. consider i have bought 1 MT of wheat at 300 EURO my financial currency for company is USD. I am using below formula to get attribution . &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Market Price - Commodity Price )*(Today FX Rate- Yesterday FX Rate)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above formula is used for daily fx loss and gain on the forward position . But above failed when the market price = commodity price .&lt;/p&gt;&#xA;" OwnerUserId="12126" LastEditorUserId="18275" LastEditDate="2016-01-06T01:24:31.657" LastActivityDate="2016-01-06T01:24:31.657" Title="Forex P&amp;l Attribution on Physical Forward position" Tags="&lt;fx&gt;&lt;performance-evaluation&gt;&lt;performance&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15824" PostTypeId="2" ParentId="15823" CreationDate="2014-12-11T13:38:21.047" Score="0" Body="&lt;p&gt;You might over think it :-)&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Your account is in USD&lt;/li&gt;&#xA;&lt;li&gt;You buy for 300 EUR wheat and the price now is 320 EUR&lt;/li&gt;&#xA;&lt;li&gt;the EURUSD is 1.24688 (2. december 2014) at the time you buy&lt;/li&gt;&#xA;&lt;li&gt;the EURUSD is 1.24347 (now - 11. december 2014)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;320 * 1.24347 - 300 * 1.24688 = 23.8464 USD profit&lt;/p&gt;&#xA;" OwnerUserId="4769" LastActivityDate="2014-12-11T13:38:21.047" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15825" PostTypeId="2" ParentId="15797" CreationDate="2014-12-11T13:51:05.123" Score="12" Body="&lt;p&gt;From Yahoo! Finance Help&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The Beta used is Beta of Equity. Beta is the monthly price change of a particular company relative to the monthly price change of the S&amp;amp;P500. The time period for Beta is 3 years (36 months) when available.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;a href=&quot;https://help.yahoo.com/kb/finance/SLN2347.html?impressions=true&quot;&gt;https://help.yahoo.com/kb/finance/SLN2347.html?impressions=true&lt;/a&gt; (+Stock Price History)&lt;/p&gt;&#xA;" OwnerUserId="4769" LastActivityDate="2014-12-11T13:51:05.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15826" PostTypeId="2" ParentId="15776" CreationDate="2014-12-11T14:02:23.413" Score="1" Body="&lt;p&gt;Supply and demand...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want an event that produce a change in the value of a currency, just look at the ruble. As Russia, gets more and more isolated and inflation spins out of control the ruble lose its value against other currencies.&lt;/p&gt;&#xA;" OwnerUserId="4769" LastActivityDate="2014-12-11T14:02:23.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15828" PostTypeId="1" CreationDate="2014-12-11T17:51:30.233" Score="0" ViewCount="71" Body="&lt;p&gt;I am working on importing some daily data from a public data source as csv format.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The csv convention of the file seems to be that if data is not available for a field, a single white space is used as NaN placeholder.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now however, I have encountered a single row where the volume field contains &lt;code&gt;-1&lt;/code&gt;. To me, the volume by definition has to be a positive number. - Or are there situation where a negative volume can occur?&lt;/p&gt;&#xA;" OwnerUserId="12227" LastActivityDate="2015-11-03T23:26:24.720" Title="Importing daily data: '-1' in volume column" Tags="&lt;data&gt;&lt;market-data&gt;&lt;historical-data&gt;&lt;volume&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15829" PostTypeId="2" ParentId="15828" CreationDate="2014-12-11T18:08:46.080" Score="1" Body="&lt;p&gt;Without knowing more about the data, the security was probably halted.  Is the pricing staled day over day?  More info would be good.&lt;/p&gt;&#xA;" OwnerUserId="8201" LastActivityDate="2014-12-11T18:08:46.080" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15830" PostTypeId="1" CreationDate="2014-12-11T19:03:15.643" Score="2" ViewCount="657" Body="&lt;p&gt;I was considering to develop a custom backtesting platform for myself. However, I see that it would require some significant time and effort, and the result might not be as initially expected. So I decided to buy a professional backtesting platform. I live outside of the United States and not interested in US stocks, so my top requirement is being able to enter custom price data as input. It could be as a csv file, data source like Google or Yahoo Finance, or some other way. Also, one should be able to use 3rd party libraries in the strategy code, such that machine learning libraries or ta-lib.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please suggest some backtesting software for these requirements. It could be both open-source and commercial.&lt;/p&gt;&#xA;" OwnerUserId="13796" LastActivityDate="2021-02-28T10:03:49.847" Title="Backtesting software with custom data input" Tags="&lt;backtesting&gt;&lt;software&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15831" PostTypeId="2" ParentId="15782" CreationDate="2014-12-11T19:15:59.633" Score="1" Body="&lt;p&gt;Did you try rmgarch package of R ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://cran.r-project.org/web/packages/rmgarch/index.html&quot; rel=&quot;nofollow&quot;&gt;http://cran.r-project.org/web/packages/rmgarch/index.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://unstarched.net/r-examples/rmgarch/mgarch-comparison-using-the-hong-li-misspecification-test/&quot; rel=&quot;nofollow&quot;&gt;http://unstarched.net/r-examples/rmgarch/mgarch-comparison-using-the-hong-li-misspecification-test/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12228" LastActivityDate="2014-12-11T19:15:59.633" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15832" PostTypeId="1" AcceptedAnswerId="15871" CreationDate="2014-12-11T23:46:57.610" Score="10" ViewCount="441" Body="&lt;p&gt;I am doing some reading on the (historical) emergence of the Black-Scholes implied volatility smile for index options (yes - post 87), and I stumbled across an economic paper attempting to explain the smile using ideas like &lt;em&gt;update of rational expectations&lt;/em&gt; and &lt;em&gt;state-dependent utility of representative investors&lt;/em&gt;...Unfortunately this was not the only paper I read, that sounded like that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Aside from the volatility smile, this exercise made me think of fat tails in general, correlation of volatility, bubbles, crashes, etc. - and left me wondering if classical economics can explain &lt;em&gt;any&lt;/em&gt; of them?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have read a couple of explanations for economic &lt;em&gt;rational bubbles&lt;/em&gt;, although the comparison of this theory, to empirical findings, appears to suggest it is inaccurate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am beginning to think classical economics is like religion: only useful if you actually believe in it. Are there any references that present a different view?&lt;/p&gt;&#xA;" OwnerUserId="13657" LastEditorUserId="13657" LastEditDate="2014-12-12T18:22:51.723" LastActivityDate="2014-12-16T18:57:53.897" Title="Can classical economics explain *any* of the so-called stylized facts of finance?" Tags="&lt;volatility&gt;&lt;economics&gt;&lt;statistical-finance&gt;" AnswerCount="5" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15833" PostTypeId="2" ParentId="15830" CreationDate="2014-12-12T00:41:49.557" Score="3" Body="&lt;p&gt;Have you thought about using &quot;Python for finance&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is multiple Python librarys to help you getting up to speed, e.g. take a look at &lt;a href=&quot;http://gbeced.github.io/pyalgotrade/&quot; rel=&quot;nofollow&quot;&gt;Python Algorithmic Trading Library&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="4769" LastActivityDate="2014-12-12T00:41:49.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15834" PostTypeId="2" ParentId="15811" CreationDate="2014-12-12T00:59:59.600" Score="2" Body="&lt;p&gt;If you are not able to find a data set, containing the dividend yield information for all the companies listed in ASX20/50/100/200/300, the only way is for you to make it by researching the companies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I found &lt;a href=&quot;http://www.marketindex.com.au/analysis/dividend-yield&quot; rel=&quot;nofollow&quot;&gt;this dividend yield scan&lt;/a&gt; to get you started.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you have the dividend yield rate for all the stocks in the given index, it is just a matter of taking the average of the list.&lt;/p&gt;&#xA;" OwnerUserId="4769" LastActivityDate="2014-12-12T00:59:59.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15835" PostTypeId="1" AcceptedAnswerId="15842" CreationDate="2014-12-12T07:02:37.127" Score="1" ViewCount="627" Body="&lt;p&gt;I was reading the old, but still interesting &lt;a href=&quot;http://www.cmat.edu.uy/~mordecki/hk/derman-kani.pdf&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; &quot;The volatility smile and its implied tree&quot; by Derman and Kani. I have a two questions about the derivation of the $2n+1$ equations, both of them regarding Arrow-Debreu price. On page 6, is shown in figure 4 how the model is set up. On the next page the authors writes down:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C(K,t_{n+1})=\exp{(-r\Delta t)}\sum_{j=1}^n\{\lambda_jp_j+\lambda_{j+1}(1-p_{j+1})\}\max{\{S_{j+1}-K,0\}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $C(K,t_{n+1}$ denotes the price of a call option with strike $K$ and expiry and expiry $t_{n+1}$. The first term in the sum are the probabilities. However, since $p_j$ is already the risk neutral probability why do the authors multiply them by $\lambda_j$? $\lambda_j$ is the known Arrow-Debreu price at node $(n,i)$. I've never heard of an Arrow-Debreu price. After checking the web it is still unclear to me, what the reason is for this equation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover using the above equation, there should be a $\lambda_{n+1}$, which is not the case! So is it just set to $0$?&lt;/p&gt;&#xA;" OwnerUserId="17133" LastEditorUserId="848" LastEditDate="2014-12-12T07:53:02.187" LastActivityDate="2014-12-13T00:07:27.740" Title="Arrow-Debreu Price in &quot;The Volatility Smile and its implied Tree&quot;" Tags="&lt;volatility&gt;&lt;mathematics&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15836" PostTypeId="2" ParentId="15832" CreationDate="2014-12-12T17:50:29.323" Score="0" Body="&lt;p&gt;If you call &quot;classical&quot; what is usually tagged as &quot;neoclassical mainstream&quot;, then perhaps the answer is no. From the other hand behavioral finance is long time ago became widely accepted and taught, together with cascades stories a-la Hirshleifer. So in wider sense, economics has long ago explained observed deviations from standard theory.&lt;/p&gt;&#xA;" OwnerUserId="6535" LastActivityDate="2014-12-12T17:50:29.323" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15837" PostTypeId="1" CreationDate="2014-12-12T19:00:35.867" Score="0" ViewCount="265" Body="&lt;p&gt;I have a portfolio data as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Account     Symbol      ComponentVaR&#xA;Acc1        MSFT        CV1&#xA;Acc2        GOOG        CV2&#xA;Acc1        FUT1        CV3&#xA;Acc2        FUT2        CV4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, are following calculations correct.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Account     ComponentVaR&#xA;Acc1        CV1+CV3&#xA;Acc2        CV2+CV4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And portfolio VaR can be CV1+CV2+CV3+CV4&lt;/p&gt;&#xA;" OwnerUserId="13809" LastActivityDate="2015-01-11T21:21:34.817" Title="Component VaR is additive but at what level" Tags="&lt;var&gt;&lt;statistical-finance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15838" PostTypeId="1" CreationDate="2014-12-12T19:46:03.157" Score="0" ViewCount="127" Body="&lt;p&gt;How could I calculate variance when I have a snapshot of a portfolio that shows the following for each stock:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Purchase Price, Close Price, Change in value, Change in percentage, Shares owned, Starting market values in dollars, Ending Market Values in dollars, and Beta for each security. I do not have a full time series for each stock. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance for your help. &lt;/p&gt;&#xA;" OwnerUserId="11926" LastActivityDate="2015-05-14T06:18:08.227" Title="Variance calculation" Tags="&lt;variance&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15839" PostTypeId="2" ParentId="15838" CreationDate="2014-12-12T20:10:16.623" Score="0" Body="&lt;p&gt;You can only find the variance for one column at a time e.g. use the close price instead of height in &lt;a href=&quot;http://www.mathsisfun.com/data/standard-deviation.html&quot; rel=&quot;nofollow&quot;&gt;this example&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="4769" LastActivityDate="2014-12-12T20:10:16.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15840" PostTypeId="2" ParentId="15837" CreationDate="2014-12-12T20:45:34.043" Score="1" Body="&lt;p&gt;Yes and no :-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Portfolio VaR = CV1 + CV2 + CV3 + CV4 is correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To safeguard my answer, I looked this up from &lt;a href=&quot;http://thinxlabs.com/blog/finance/incremental-var-component-var/&quot; rel=&quot;nofollow&quot;&gt;thinxlabs.com&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The individual component VaRs from the assets in the portfolio should add up tho the total portfolio VaR. The equation is as follows.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But you need to calculate another VaR for each account, if you want to use CV on those. The reason is that the asset weight, is not the same for a given asset when you look at a subset of the portfolio.&lt;/p&gt;&#xA;" OwnerUserId="4769" LastActivityDate="2014-12-12T20:45:34.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15841" PostTypeId="1" CreationDate="2014-12-12T22:40:06.040" Score="1" ViewCount="131" Body="&lt;p&gt;Why is Jensen’s Alpha not an appropriate measure of performance anymore, if the fund manager is a perfect market timer as stated for example in the Treynor-Mazuy-model or the Henriksson-Merton-model?&lt;/p&gt;&#xA;" OwnerUserId="13812" LastActivityDate="2014-12-12T22:40:06.040" Title="Jensen's alpha with timing activities" Tags="&lt;performance-evaluation&gt;&lt;funds&gt;&lt;mutual-fund&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15842" PostTypeId="2" ParentId="15835" CreationDate="2014-12-13T00:07:27.740" Score="3" Body="&lt;p&gt;We use Derman and Kani's notations.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Arrow-Debreu prices&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The Arrow-Debreu price $\lambda_i$ is the price of the security $\Lambda_i$ paying \$1 in node $(n, i)$, and \$0 in all other states $(n, j)$, for $j \neq i$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\mathbb{P}_{n,j}$ be the risk-neutral probability of getting to state $(n,j)$, from state $(1,1)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The price of $\Lambda_i$ is the risk-neutral expectation of its discounted payoff, which is simply $$\lambda_i = e^{-rt_n}\mathbb{P}_{n,i}$$&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Call price&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The call price is the risk-neutral expectation of its discounted payoff: &#xA;\begin{eqnarray}&#xA;\tag{1}&#xA;C(K, t_{n+1}) &amp;amp; =&amp;amp; e^{-rt_{n+1}}\mathbb{E}(S_{t_{n+1}} - K)^+ \\&#xA;&amp;amp;=&amp;amp; e^{-rt_{n+1}} \sum\limits_{j=1}^{n} \mathbb{P}_{n+1,j+1} (S_{j+1} - K)^+&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now in the binomial tree, there are two ways to get to state $(n+1, j+1)$: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;either you were in state $(n,j)$ (probability $\mathbb{P}_{n,j} $) and you went up (probability $p_{j}$), &lt;/li&gt;&#xA;&lt;li&gt;or you were in state $(n,j+1)$ (probability $\mathbb{P}_{n,j+1}$) and you went down (probability $1-p_{j+1}$)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Therefore: &#xA;\begin{eqnarray}&#xA;\mathbb{P_{n+1,j+1}} &amp;amp;=&amp;amp; p_j\mathbb{P_{n,j}} + (1-p_{j+1})\mathbb{P}_{n,j+1}&#xA;                                  \\&amp;amp;=&amp;amp; e^{rt_n}\left[p_j \lambda_j + (1-p_{j+1})\lambda_{j+1} \right]&#xA;\tag{2}&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only case where (2) doesn't hold is when you are in an extremal node, you can resolve this issue by setting $\lambda_{n+1}=0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You get Derman and Kani's formula by plugging (2) back into (1).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The intuition here is that the Arrow-Debreu prices capture all the information you need from $t_0$ to $t_n$, so that all you have to worry about is what happens between $t_n$ and $t_{n+1}$&lt;/p&gt;&#xA;" OwnerUserId="13634" LastActivityDate="2014-12-13T00:07:27.740" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15844" PostTypeId="2" ParentId="15807" CreationDate="2014-12-13T02:24:56.320" Score="5" Body="&lt;p&gt;Well the terminal FX rate is lognormally distributed and lognormals are skewed. So this is not surprising. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2014-12-13T02:24:56.320" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15845" PostTypeId="2" ParentId="10016" CreationDate="2014-12-13T03:50:01.207" Score="1" Body="&lt;p&gt;To close this question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Steps used, in short :&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;get matrix N x M where N - number of assets, M - number of history&#xA;samples&lt;/li&gt;&#xA;&lt;li&gt;normalize all samples using logarithms and mean to have returns instead of some asset specific values&lt;/li&gt;&#xA;&lt;li&gt;obtain covariance matrix, or correlation, if you want to avoid&#xA;influence of volatility&lt;/li&gt;&#xA;&lt;li&gt;solve eigenproblem using SVD and Jacobi's rotation on covariance&#xA;matrices&lt;/li&gt;&#xA;&lt;li&gt;Jacobi rotation returns two matrices - eigenvectors and eigenvalues&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Understanding results :&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;eigenvalue stands for variance of the portfolio's spread&lt;/li&gt;&#xA;&lt;li&gt;choosing max eigenvalue means selecting direction of entire portfolio&lt;/li&gt;&#xA;&lt;li&gt;choosing min eigenvalue means selecting periodic, noise or error component of portfolio with min variance&lt;/li&gt;&#xA;&lt;li&gt;each value in eigenvector is weighting coefficient for relevant asset&#xA;in portfolio which asset needs to be multiplied by to get back to initial course&lt;/li&gt;&#xA;&lt;li&gt;eigenvector is a column in rotation matrix taken by index of selected&#xA;eigenvalue&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Resources :&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The best step-by-step tutorial on PCA is&#xA;&lt;a href=&quot;http://www.cs.otago.ac.nz/cosc453/student_tutorials/principal_components.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.cs.otago.ac.nz/cosc453/student_tutorials/principal_components.pdf&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;The best theoretical explanation of PCA is&#xA;&lt;a href=&quot;https://georgemdallas.wordpress.com/2013/10/30/principal-component-analysis-4-dummies-eigenvectors-eigenvalues-and-dimension-reduction/&quot; rel=&quot;nofollow&quot;&gt;https://georgemdallas.wordpress.com/2013/10/30/principal-component-analysis-4-dummies-eigenvectors-eigenvalues-and-dimension-reduction/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Implementation in C#&#xA;&lt;a href=&quot;http://crsouza.blogspot.com/2009/09/principal-component-analysis-in-c.html&quot; rel=&quot;nofollow&quot;&gt;http://crsouza.blogspot.com/2009/09/principal-component-analysis-in-c.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Implementation in R &lt;a href=&quot;http://www.statmethods.net/advstats/factor.html&quot; rel=&quot;nofollow&quot;&gt;http://www.statmethods.net/advstats/factor.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="6855" LastEditorUserId="6855" LastEditDate="2014-12-13T12:26:31.570" LastActivityDate="2014-12-13T12:26:31.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15847" PostTypeId="1" CreationDate="2014-12-13T13:42:21.487" Score="3" ViewCount="670" Body="&lt;p&gt;If there is no arbitrage there is no dominant trading strategy, but there may be arbitrage opportunities even if there are no dominant trading strategies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you explain this statement and bring an example?&lt;/p&gt;&#xA;" OwnerUserId="13582" LastEditorUserId="13582" LastEditDate="2014-12-15T13:25:02.590" LastActivityDate="2014-12-22T03:21:10.063" Title="Arbitrage and dominant strategies" Tags="&lt;quant-trading-strategies&gt;&lt;stochastic-processes&gt;&lt;arbitrage&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15848" PostTypeId="1" CreationDate="2014-12-13T13:50:16.110" Score="2" ViewCount="211" Body="&lt;p&gt;Sorry if this may be a stupid question. I have not had that much mathematical finance, I've only learned about discrete time models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But lets for the argument say that you have a stochastic process of risky assets a bank process and a given probability measure for the market. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you calculate the risk neutral probability measure, and let's just assume that you get an unique measure that &lt;strong&gt;happen&lt;/strong&gt; to coincide with the probaiblity measure for the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this then some kind of special stock market? When the probability measure and the risk neutral probability measure happen to be the same? Will it behave differently than other markets? Are they unrealistic?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only difference I can think of is that the pricing will be done in a way a statistician would price it, since the pricing will follow the expected value under the normal probability measure also. But will something else happen? And if these markets are unrealistic, why are they that?, what would disrupt them?&lt;/p&gt;&#xA;" OwnerUserId="11692" LastEditorUserId="11692" LastEditDate="2014-12-13T17:19:10.903" LastActivityDate="2014-12-14T21:13:19.413" Title="If the risk neutral probability measure and the real probability measure should coincide" Tags="&lt;probability&gt;&lt;risk-neutral-measure&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15849" PostTypeId="1" CreationDate="2014-12-13T15:09:16.590" Score="0" ViewCount="563" Body="&lt;p&gt;I've had a currency widget made for me which is based on &lt;a href=&quot;http://query.yahooapis.com/v1/public/yql?q=select&quot; rel=&quot;nofollow&quot;&gt;http://query.yahooapis.com/v1/public/yql?q=select&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am wondering if I can use it on my site, which even though it not more than a hobby could be considered commercial inasmuch as it has affliate adverts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could I ask Yahoo to confirm if I can use it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="13817" LastActivityDate="2015-01-12T16:38:38.420" Title="Yahoo currency api" Tags="&lt;currency&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15850" PostTypeId="1" CreationDate="2014-12-13T15:40:46.753" Score="2" ViewCount="101" Body="&lt;p&gt;It is very hard to come up with legit and solid advantages and drawbacks of the various approaches wich are trying to counteract parameter uncertainty in portfolio optimization procedures. In my opinion all bayesian approaches, i.e. the use of diffuse priors, asset pricing based priors and economic objective priors are somewhat similar and may or may not lead to favorable results. How would you assess the advantages and disadvantages of each approach in practice?&lt;/p&gt;&#xA;" OwnerUserId="13820" LastActivityDate="2015-10-12T04:58:28.900" Title="Critical Appraisal of Approaches countering Parameter Uncertainty in Portfolio Optimization" Tags="&lt;portfolio-optimization&gt;&lt;mean-variance&gt;&lt;bayes-theory&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15851" PostTypeId="2" ParentId="15849" CreationDate="2014-12-13T16:21:18.213" Score="1" Body="&lt;p&gt;&lt;strong&gt;I think this is off topic&lt;/strong&gt;, considered this is a quant board.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if you earn money (even just a little) on the site, I'm pretty sure it will be considered a commercial site.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yahoo! encourage you to register your site, if they approve the site, then you are good to go.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taken from &lt;a href=&quot;http://info.yahoo.com/guidelines/us/yahoo/ydn/ydn-3955.html&quot; rel=&quot;nofollow&quot;&gt;&quot;Yahoo! Developer Network Guidelines&quot;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Please see our FAQ for more information about these non-commercial use only services. If you use these services in your application, we encourage you to register your application to confirm that your usage is acceptable. We typically do not grant additional queries for these non-commercial use only services.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Direct link to the &lt;a href=&quot;https://developer.yahoo.com/faq/&quot; rel=&quot;nofollow&quot;&gt;FAQ&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="4769" LastActivityDate="2014-12-13T16:21:18.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15852" PostTypeId="2" ParentId="9772" CreationDate="2014-12-13T16:52:22.123" Score="1" Body="&lt;p&gt;You need Reuters RFA or SFC API access, they both give access to historical data, that you are able to lookup with a ticker symbol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See: &lt;a href=&quot;https://customers.reuters.com/developer/apis_tech.aspx&quot; rel=&quot;nofollow&quot;&gt;https://customers.reuters.com/developer/apis_tech.aspx&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="4769" LastActivityDate="2014-12-13T16:52:22.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15853" PostTypeId="1" AcceptedAnswerId="16014" CreationDate="2014-12-13T19:03:10.817" Score="8" ViewCount="145" Body="&lt;p&gt;&lt;em&gt;Hi everyone, I'm programming in MATLAB and I have the following optimization problem in calibrating several nested specifications of pricing models.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;: I have two pricing models ($1$ and $2$, $1$ is nested in $2$, i.e. model $2$ reduces to model $1$ if a particular configuration of its parameters is considered) and two sets of derivatives ($A$ and $B$). I calibrate each model on the two sets of instruments AT THE SAME TIME, minimizing pricing errors. That's fine. The problem arises in the nesting request: I want model $2$ to produce lower pricing errors on BOTH instruments sets SEPARATELY and I'm wondering if can define a loss function that automatically achieves this task, i.e. I want that this consistency condition holds:&#xA;\begin{equation}&#xA;\left\{&#xA;\begin{aligned}&#xA;error_{A}[2] \leq error_{A}[1] \\&#xA;error_{B}[2] \leq error_{B}[1]&#xA;\end{aligned}&#xA;\right.&#xA;\end{equation}&#xA;and NOT ONLY&#xA;$$&#xA;error_{A}[2] + error_{B}[2] \leq error_{A}[1] + error_{B}[1]&#xA;$$&#xA;&lt;strong&gt;end of summary&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm considering two sets of derivatives I would like to price, say $A$ and $B$. In the class&#xA;$A$, there are $i=1,...,N$ instruments, with market prices denoted as $a^{i}_{MKT}$, and in the other one there are $j=1,...,M$ instruments, whose market prices are denoted with $b^{j}_{MKT}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I start with a model $1$, depending on a set $\{x\}$ of parameters. Under this model, model prices for instruments $A$ and $B$ are denoted as $a^{i}_{mdl}(x)$ and $b^{j}_{mdl}(x)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The simple idea is to calibrate model parameters $\{x\}$ minimizing the pricing error. For example minimizing the Sum-of-Squared-Errors loss:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\begin{aligned}&#xA;loss(x) &amp;amp;= loss_{A}(x) + loss_{B}(x) \\&#xA;&amp;amp;= \sum^{N}_{i=1}\left|a^{i}_{MKT} - a^{i}_{mdl}(x) \right|^2 + \sum^{M}_{j=1}\left|b^{j}_{MKT} - b^{j}_{mdl}(x) \right|^2&#xA;\end{aligned}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this way, the optimal parameters $\{x_{opt}\}$ will be those minimizing $loss(x)$. Let it be:&#xA;\begin{equation}&#xA;\begin{aligned}&#xA;loss(x_{opt}) &amp;amp;= loss_{A}(x_{opt}) + loss_{B}(x_{opt}) \\&#xA;&amp;amp;\stackrel{def}{=} error_{A}[1] + error_{B}[1]&#xA;\end{aligned}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now my problem: I'm considering a model $2$ which is a generalization of the model $1$, In the sense that model $2$ depends on the extended parameter set $\{x,y\}$.&#xA;Model $2$ produces model prices $\hat{a}^{i}_{mdl}(x,y)$ and $\hat{b}^{j}_{mdl}(x,y)$.&#xA;For the sake of exposition you may think that model $2$ reduces to model $1$ if $y=0$, i.e.&#xA;$\hat{a}^{i}_{mdl}(x,0) = a^{i}_{mdl}(x)$ and $\hat{b}^{i}_{mdl}(x,0) = b^{i}_{mdl}(x)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if I keep using the above SSE $loss$ to calibrate model $2$, I will minimize \begin{equation}&#xA;\begin{aligned}&#xA;loss(x,y) &amp;amp;= loss_{A}(x,y) + loss_{B}(x,y) \\&#xA;&amp;amp;= \sum^{N}_{i=1}\left|a^{i}_{MKT} - \hat{a}^{i}_{MDL}(x,y) \right|^2 + \sum^{M}_{j=1}\left|b^{j}_{MKT} - \hat{b}^{j}_{mdl}(x,y) \right|^2&#xA;\end{aligned}&#xA;\end{equation}&#xA;Optimized parameters for model $2$ will be $\{x_{opt},y_{opt}\}$ and correspondingly we define:&#xA;\begin{equation}&#xA;\begin{aligned}&#xA;loss(x_{opt},y_{opt}) &amp;amp;= loss_{A}(x_{opt},y_{opt}) + loss_{B}(x_{opt},y_{opt}) \\&#xA;&amp;amp;\stackrel{def}{=} error_{A}[2] + error_{B}[2]&#xA;\end{aligned}&#xA;\end{equation}&#xA;Now the above calibrations produce the following nesting relation for sure:&#xA;$$&#xA;error_{A}[2] + error_{B}[2] \leq error_{A}[1] + error_{B}[1]&#xA;$$&#xA;but NOT NECESSARY&#xA;\begin{equation}&#xA;\left\{&#xA;\begin{aligned}&#xA;error_{A}[2] \leq error_{A}[1] \\&#xA;error_{B}[2] \leq error_{B}[1]&#xA;\end{aligned}&#xA;\right.&#xA;\end{equation}&#xA;that is what I want. For example, model $2$ may highly improve pricing of $A$ derivatives, but slightly mis-pricing on the set $B$, w.r.t. model $1$.&#xA;What I want is that model $2$ improve pricing w.r.t. to model $1$ on BOTH $A$ and $B$ sets!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anybody suggest me a loss/calibrating procedure/whatever achieving this goal. Thank you in advance for your time and attention.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Technical note: my procedure is performed with &lt;a href=&quot;http://it.mathworks.com/help/optim/ug/lsqnonlin.html&quot; rel=&quot;noreferrer&quot;&gt;lsqnonlin&lt;/a&gt;, in the Matlab optimization toolbox.&lt;/p&gt;&#xA;" OwnerUserId="13528" LastEditorUserId="13528" LastEditDate="2014-12-14T10:08:35.787" LastActivityDate="2014-12-29T12:54:51.310" Title="Calibration of nested pricing models consistently on two different classes of derivatives" Tags="&lt;pricing&gt;&lt;derivatives&gt;&lt;matlab&gt;&lt;calibration&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15854" PostTypeId="2" ParentId="15848" CreationDate="2014-12-13T22:40:20.193" Score="2" Body="&lt;p&gt;Okay, this is a bit of an involved question, but the intuition is as follows: As Ross (1976) truly conceived it, being risk-neutral means being indifferent between any gamble and its mean payoff. This is equivalent to &lt;a href=&quot;http://en.wikipedia.org/wiki/Von_Neumann%E2%80%93Morgenstern_utility_theorem&quot; rel=&quot;nofollow&quot;&gt;linear Von-Neumann Morgenstern&lt;/a&gt; preferences over all wealth levels, not just positive ones. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A classic experiment to distinguish between risk-taking appetites involves an investor faced with a choice between receiving, say, either $\$$100 with 100% certainty, or a 50% chance of getting $\$$200. A risk-neutral agent is indifferent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, this market would be one where the representative agent, another complex concept, would show the above behavior. All stock prices, as you said, would have expected value (statistically, with MLE Estimation, not generic (since it's stochastic)) be the risk-free rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are even deeper issues, as recentely pointed out by &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2007112&quot; rel=&quot;nofollow&quot;&gt;Jarrow&lt;/a&gt;, with risk-neutral markets and efficiency. Basically, risk-neutral valuation would imply the existence of a corresponding efficient market where the stock price is the equilibrium price process. There maybe some restriction if the real-world measure is risk-neutral.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the realism, looking at the example above, do you think that's a realistic view of how people behave?&lt;/p&gt;&#xA;" OwnerUserId="13415" LastEditorUserId="13415" LastEditDate="2014-12-14T21:13:19.413" LastActivityDate="2014-12-14T21:13:19.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15856" PostTypeId="1" AcceptedAnswerId="15859" CreationDate="2014-12-14T09:46:49.800" Score="2" ViewCount="315" Body="&lt;p&gt;I have a Portfolio that is rebalanced every 3-months. The portfolio is made up of assets that have daily log-returns. I am a bit confused when charting the results using &lt;code&gt;R&lt;/code&gt;: more specifically &lt;code&gt;charts.PerformanceSummary()&lt;/code&gt; by &lt;code&gt;library(PerformanceAnalytics)&lt;/code&gt;. Take the following Portfolio called &lt;code&gt;EQUALwt&lt;/code&gt; which ranges from JAN-2013 to JUN-2014.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;EQUALwt &amp;lt;- structure(c(0.0178647409955362, -0.0723746508445446, -0.00458728466704914, &#xA;0.238164594011257, -0.211824465096801, 0, -0.0406297323744437, &#xA;0, 0.0447620578622464, 0.0158783514305815, -0.0742389273092776,  &#xA;-0.0275507850334035, 0, 0, 0, 0.00781313587602611, 0, 0.400176058116336, &#xA;0, 0, 0.0549071523016913, 0, -0.0102054986300638, 0.18349229377005, &#xA;0, 0.503725755135566, 0, 0, 0, 0.173286795139986, -0.134749125183172, &#xA;0, -0.144954623813235, 0.106416953856421, 0.117500907311434, &#xA;0, 0.00617315314759284, 0.0048310682066007, 0.00561821396301465, &#xA;-0.118614494898779, 0.061362327207127, -0.0312907857385016, 0.218867184338475, &#xA;-0.18032951438166, 0.0557858878285524, 0, 0, 0, 0, -0.199626924054443, &#xA;-0.0679834288709105, 0.173286795139986, 0.0294457589140959, 0, &#xA;-0.101366277027041, -0.134749125183172, 0.0982606470274018, -0.00909191104271873, &#xA;0.0161346302843927, 0.169349705897952, -0.119893270065472, -0.0950368250309686, &#xA;0.0957480630640265, 0.345862352246915, -0.290076464418362, 0.0455803891984886, &#xA;-0.29078770245142, 0, -0.101366277027041, 0, -0.00529714841430817, &#xA;-0.00392421399289589, 0, 0, 0, 0.00392421399289589, 0, 0, 0.101366277027041, &#xA;-0.101366277027041, 0.101366277027041, -0.101366277027041, 0, &#xA; 0, 0.101366277027041, -0.101366277027041, 0.101366277027041, &#xA; -0.101366277027041, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.00459018909397668, &#xA; 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0173932042470827, &#xA; 0.0195106767517173, -0.0206496308856826, -0.00114416675685292, &#xA; 0.0144806619331761, 0, 0, 0, 0, -0.0418056903486528, 0.402359478108525, &#xA; 0, -0.0217528442474074, 0, -0.00220265742053874, 0.0243967543311115, &#xA; 0.00108460039964958, -0.00217392674188849, -0.0228469378973572, &#xA;-0.00240386467486048, -0.0212213330373311, -0.0217528442474074, &#xA;-0.0719205181129453), class = c(&quot;xts&quot;, &quot;zoo&quot;), .indexCLASS = c(&quot;POSIXct&quot;, &#xA;&quot;POSIXt&quot;), .indexTZ = &quot;&quot;, tclass = c(&quot;POSIXct&quot;, &quot;POSIXt&quot;), tzone = &quot;&quot;, index =    &#xA;structure(c(1357084800, &#xA;1357171200, 1357257600, 1357516800, 1357603200, 1357689600, 1357776000, &#xA;1357862400, 1358121600, 1358208000, 1358294400, 1358380800, 1358467200, &#xA;1358726400, 1358812800, 1358899200, 1358985600, 1359072000, 1359331200, &#xA;1359417600, 1359504000, 1359590400, 1364774400, 1364860800, 1364947200, &#xA;1365033600, 1365120000, 1365379200, 1365465600, 1365552000, 1365638400, &#xA;1365724800, 1365984000, 1366070400, 1366156800, 1366243200, 1366329600, &#xA;1366588800, 1366675200, 1366761600, 1366848000, 1366934400, 1367193600, &#xA;1367280000, 1372636800, 1372723200, 1372809600, 1372896000, 1372982400, &#xA;1373241600, 1373328000, 1373414400, 1373500800, 1373587200, 1373846400, &#xA;1373932800, 1374019200, 1374105600, 1374192000, 1374451200, 1374537600, &#xA;1374624000, 1374710400, 1374796800, 1375056000, 1375142400, 1375228800, &#xA;1380585600, 1380672000, 1380758400, 1380844800, 1381104000, 1381190400, &#xA;1381276800, 1381363200, 1381449600, 1381708800, 1381795200, 1381881600, &#xA;1381968000, 1382054400, 1382313600, 1382400000, 1382486400, 1382572800, &#xA;1382659200, 1382918400, 1383004800, 1383091200, 1383177600, 1388534400, &#xA;1388620800, 1388707200, 1388966400, 1389052800, 1389139200, 1389225600, &#xA;1389312000, 1389571200, 1389657600, 1389744000, 1389830400, 1389916800, &#xA;1390176000, 1390262400, 1390348800, 1390435200, 1390521600, 1390780800, &#xA;1390867200, 1390953600, 1391040000, 1391126400, 1396310400, 1396396800, &#xA;1396483200, 1396569600, 1396828800, 1396915200, 1397001600, 1397088000, &#xA;1397174400, 1397433600, 1397520000, 1397606400, 1397692800, 1397779200, &#xA;1398038400, 1398124800, 1398211200, 1398297600, 1398384000, 1398643200, &#xA;1398729600, 1398816000, 1404172800), tzone = &quot;&quot;, tclass = c(&quot;POSIXct&quot;, &#xA;&quot;POSIXt&quot;)), .Dim = c(136L, 1L), .Dimnames = list(NULL, &quot;EQUALwtLoHi&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am a bit confused for the &lt;code&gt;geometric&lt;/code&gt; specification.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Geometric Return&#xA;charts.PerformanceSummary(EQUALwt, geometric=TRUE)&#xA;&#xA;# Non-Geometric Return&#xA;charts.PerformanceSummary(EQUALwt, geometric=FALSE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see they differ quite a bit! I understand that the geometric return takes daily componding into account but how would you explain the non-geometric returns? Is this the cumulative sum i.e. buy-and-hold (which is what I am doing with these assets)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would it be safe to say that in order for the non-compounded return to be true, the portfolio would have to start with the same amount of cash at every rebalancing period? &lt;/p&gt;&#xA;" OwnerUserId="11814" LastEditorUserId="11814" LastEditDate="2014-12-14T10:12:32.673" LastActivityDate="2014-12-14T14:34:02.560" Title="Geometric Return &amp; Performance Results for Quarterly Rebalancing" Tags="&lt;r&gt;&lt;portfolio&gt;&lt;log-returns&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15857" PostTypeId="1" AcceptedAnswerId="15879" CreationDate="2014-12-14T11:54:13.920" Score="1" ViewCount="780" Body="&lt;p&gt;I am trying to use technical analysis method (Kagi and Renko method in particular) to analyse my high frequency data. I applied those methods over 1 year, 2 years and 5 years high frequency data. I got the positive result (even very small value for my data), but the cumulate sum of return after each sub time interval does not show any trend (I expected it might be stable increase/decrease) which means those methods did not detrend very well and can not extract noises from market well (since the graph of cumulate sum that I got jump up and down like random process). I wonder if anyone has ever used this method in trading forex? Can someone please point me to any literature/material on this matter so I can deepen my understanding about those methods. The only material that I achieve so far is the book of Nison: Beyond candle stick: Japanese charting technique.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="13824" LastEditorUserId="848" LastEditDate="2014-12-14T17:40:46.587" LastActivityDate="2015-07-26T21:10:22.500" Title="Technical Analysis in FX: literature on effective methods" Tags="&lt;quant-trading-strategies&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15858" PostTypeId="2" ParentId="15832" CreationDate="2014-12-14T13:19:38.543" Score="2" Body="&lt;p&gt;Classical economics cannot &quot;explain&quot; volatility smiles, but neither does it preclude their existence.  Economics is far more abstract than financial &quot;quant&quot;modeling and answers very different questions.  In the more abstract framework of economics, volatility skew, mean reverting volatility, bubbles, and crashes are all conceivable scenarios.  Auto-correlated returns, on the other hand, would likely be un-explainable by classical economics (indeed, their existence &quot;in the long run&quot; is prohibited).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm somewhat surprised at your aversion to terms like &quot;state dependent utility of investors&quot;.  Of course utility is state and time dependent. The beauty of financial prices is that it's frequency and availability can give us more understanding of the nature of the state and time dependence of utility.  &lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2014-12-14T13:19:38.543" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15859" PostTypeId="2" ParentId="15856" CreationDate="2014-12-14T14:34:02.560" Score="4" Body="&lt;p&gt;Actually, neither of your two results are quite correct.  As explained in the Details for the Return.calculate function, most of the PerformanceAnalytics functions use discrete returns, not log returns.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get the correct results, you will have to convert your data from log returns to simple returns.&lt;br&gt;&#xA;Compare the charts from the following:   &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;charts.PerformanceSummary(exp(EQUALwt)-1, geometric=TRUE, wealth.index=TRUE)&#xA;charts.PerformanceSummary(EQUALwt, geometric=FALSE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first is correct.  Since the second uses log returns, the results for second CummulativeReturn chart are the log of the actual retults; i.e. if you used exp() on the CummulativeReturns of the second function, you would get the first set of results.  &lt;/p&gt;&#xA;" OwnerUserId="11889" LastActivityDate="2014-12-14T14:34:02.560" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15862" PostTypeId="2" ParentId="15782" CreationDate="2014-12-14T20:18:44.547" Score="0" Body="&lt;p&gt;I would suggest you to forecast the series using different models and to determine which one is the best accordingly loss functions such as RMSE, MAPE.. or using the Mincer-Zarnowitz regression . You could also compare one-step forecast versus dynamic forecast. &#xA;Another way is to compute VaR and observe the model having the lowest failure rate.&#xA;AIC/BIC criteria are useful only to select the appropriate number of AR/MA/ARCH/GARCH terms.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2014-12-14T20:18:44.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15863" PostTypeId="2" ParentId="15838" CreationDate="2014-12-14T20:23:53.103" Score="0" Body="&lt;p&gt;if you are interested in conditional variance you need to fit GARCH type model to the difference of the log closing price. Otherwise just compute variance of log(diff(close price)).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want the variance of the portfolio you need to assign weights, or  with conditional variance fit MGarch models. &lt;/p&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2014-12-14T20:23:53.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15864" PostTypeId="2" ParentId="15429" CreationDate="2014-12-14T20:29:56.147" Score="-2" Body="&lt;p&gt;I use the Black-Scholes formula here &lt;a href=&quot;http://www.seleno.us/options.php&quot; rel=&quot;nofollow&quot;&gt;http://www.seleno.us/options.php&lt;/a&gt; often when I buy and sell options. Sometimes the Black-Scholes price equals the price of the option on the exchange. A lot of times when companies grant stocks options they use the Black-Scholes to report the expense of the options or determine how much the stock price might be diluted by issuing new shares and it is useful in this regard. I think if you use Black-Scholes and the price of the option is really high in comparison to Black-Scholes you shouldn't buy the option. Maybe you should sell it. I've often noticed on exchanges where the price isn't the same. Probably goes the option is getting bid up. Maybe this is an arbitrate opportunity.&lt;/p&gt;&#xA;" OwnerUserId="13828" LastActivityDate="2014-12-14T20:29:56.147" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15865" PostTypeId="2" ParentId="15429" CreationDate="2014-12-14T21:03:11.667" Score="0" Body="&lt;p&gt;The Black Scholes formula still holds without any hedging (as long as the underlying follows a GBM) by the first fundamental theorem of asset pricing.  The original paper by Black and Scholes actually made an equilibrium argument as well as a no-arbitrage argument to show that the formula is valid.  &lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2014-12-14T21:03:11.667" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15866" PostTypeId="1" CreationDate="2014-12-14T23:00:33.480" Score="0" ViewCount="102" Body="&lt;p&gt;Consider a market model with two assets which are modeled as usual&#xA;by the stochastic process $S^0$ and $S^1$,  that is adapted to the filtration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone tell if this process is predictable or not:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/PyZHU.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I think is that it is not predictable as we know only $\xi_1$ and the other values of $\xi_t$ are given only when $S_{t-1}$ is greater than $S_{t-2}$, which contradicts predictability which says that we should be able to calculate the process when we are one period behind.&lt;/p&gt;&#xA;" OwnerUserId="13582" LastEditorUserId="467" LastEditDate="2014-12-15T03:41:03.387" LastActivityDate="2014-12-15T03:45:52.717" Title="Is this process predictable or not?" Tags="&lt;stochastic-processes&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15867" PostTypeId="2" ParentId="15866" CreationDate="2014-12-15T03:45:52.717" Score="1" Body="&lt;p&gt;First, I don't see $S^0$ appear anywhere, so I assume it is just used somewhere else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, there is probably a point (i) in your question, because you included the point (ii).  I'd expect that $\xi_0$ is actually defined there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that's the case, then $\xi_t$ is predictable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise, if $\xi_0$ is not defined anywhere then the process $\xi_t$ is simply not defined properly as there is no way to know $\xi_2$. I'd guess this is a mistake.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2014-12-15T03:45:52.717" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15868" PostTypeId="1" AcceptedAnswerId="15877" CreationDate="2014-12-15T14:03:11.470" Score="2" ViewCount="384" Body="&lt;p&gt;An airline expects to purchase 2 million gallons of jet fuel in 1 month and decides&#xA;to use heating oil futures for hedging.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The variance of the heating oil futures price is 1,5 times bigger then the variance of the price of the jet fuel.&#xA;The correlation between the spot jet fuel price and the 3 month heating oil futures price is 0.5.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question a) Does the airline take a long or a short position in the futures contract?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am in long or short position in oil heating futures? &#xA;The answer is long, in my book, but I don't understand why.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am in long in jet fuel, so why am I also long heat oil?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone explain, how this works? &#xA;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="13477" LastEditorUserId="13477" LastEditDate="2014-12-15T14:36:01.910" LastActivityDate="2014-12-15T19:07:07.957" Title="Am I in a long or short position in this case? (Cross hedging)" Tags="&lt;futures&gt;&lt;hedging&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15869" PostTypeId="2" ParentId="15847" CreationDate="2014-12-15T14:22:15.447" Score="1" Body="&lt;p&gt;Please clarify rigorously what you mean by each term. It is not true that no dominance is a consequence of no arbitrage. Think of the put-call parity:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C-P=S-K$, assuming $r=0$ since it's inconsequential. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there is no short selling then we can have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C-P \geq S-K$ without arbitrage but No Dominance would not hold. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you think very deeply about this, and I am assuming conventional meanings since no definition is given, then no arbitrage can be the consequence of a single trader taking huge positions and removing arb opportunities from the market. But ND is something that will occur only if the asset prices correspond to an equilibrium process in &lt;strong&gt;some&lt;/strong&gt; economy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Conventionally, $ND \implies NA$, but don't confuse this for risk-neutral valuation. For that to be the true value of an asset, we need $ND$ in some economy.&lt;/p&gt;&#xA;" OwnerUserId="13415" LastActivityDate="2014-12-15T14:22:15.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15871" PostTypeId="2" ParentId="15832" CreationDate="2014-12-15T15:37:32.887" Score="4" Body="&lt;p&gt;I would argue that indeed none of the so-called stylized facts you mentioned can be explained by classical economic theory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That there was a gross delta between the predictions of classical economic theory and empirical data was foremost found out by Benoit Mandelbrot as far back as 1963 in his seminal paper:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://web.williams.edu/Mathematics/sjmiller/public_html/341Fa09/econ/Mandelbroit_VariationCertainSpeculativePrices.pdf&quot; rel=&quot;nofollow&quot;&gt;The Variation of Certain Speculative Prices&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In that papers he argues that there are no easy remedies for the shortcomings of classical economic theory so that you have start from scratch - this is what he did. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an aside: I was fortunate enough to meet Benoit in person and have to say that he was a very impressive man - intellectually as well as personally.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="13657" LastEditDate="2014-12-16T18:57:53.897" LastActivityDate="2014-12-16T18:57:53.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15872" PostTypeId="2" ParentId="15832" CreationDate="2014-12-15T15:54:44.747" Score="3" Body="&lt;p&gt;I think there is a slight misconception into the purpose of an economic theory. The market is a complex entity to be modeled and yes, it is neither efficient nor arbitrage free but it is trading and there is a price process that corresponds to the market one. You could say that classical economic theory has failed, but I would argue the idea of a theory is not to pretend to know everything but to posit a possible structure and then see if it is relevant in future results, making it a valid theory or an invalid one. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, one could argue that merely observing empirical facts about the market (such as the skew,) do not mean anything really. Yes, you could use N-dimensional b-splines to model the volatility surface but tomorrow that surface might disappear and become constant. The idea is to be able to understand when and why it might become constant. Economic theory would try to explain that. It might not work well, but the idea is to come up with something that can construct a good understanding of the market. That seems to me, the purpose of the theory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The argument lies in whether it is the best approach to this, and in fact, it has had some significant achievements in that regard, no arbitrage and efficiency being a few. If you can think of a better approach, by all means, a Nobel awaits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, other economic models such as DSGE's might not work well, but it is well known that the FED and other central banks use them &lt;strong&gt;extensively&lt;/strong&gt;. So they inevitably have an impact on the market, making them somewhat valid.&lt;/p&gt;&#xA;" OwnerUserId="13415" LastActivityDate="2014-12-15T15:54:44.747" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="15874" PostTypeId="1" AcceptedAnswerId="15878" CreationDate="2014-12-15T18:39:28.947" Score="4" ViewCount="8036" Body="&lt;p&gt;I am looking for a Python code that scraps a website to download &lt;strong&gt;historical&lt;/strong&gt; firm data such as market capitalization, dividend-yield, and so on. I have a code that downloads the current firm data from Yahoo but I am looking for historical data. Any suggestions? &lt;/p&gt;&#xA;" OwnerUserId="2570" LastActivityDate="2019-08-08T09:42:32.600" Title="Python code to download historical firm data" Tags="&lt;data&gt;&lt;python&gt;&lt;codes&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15875" PostTypeId="2" ParentId="14734" CreationDate="2014-12-15T18:56:36.410" Score="1" Body="&lt;p&gt;You can pass in the  parameters are you estimating with  EWMA or GARCH using the  mu (mean), sigma (co/variance) m3 (co/skewness) and m4(co/kurtosis) arguments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g. blahblah = EWMA(my_time_series)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;VaR(my_time_series,mu=blahblah)&lt;/p&gt;&#xA;" OwnerUserId="2154" LastActivityDate="2014-12-15T18:56:36.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15876" PostTypeId="2" ParentId="15832" CreationDate="2014-12-15T19:00:50.037" Score="-1" Body="&lt;p&gt;As I don't really understand your question except for the volatility smile:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a presentation about how the volatility smile flattens as computational precision increases: &lt;a href=&quot;http://www.rinfinance.com/agenda/2013/talk/Chance+Hanson+etal.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.rinfinance.com/agenda/2013/talk/Chance+Hanson+etal.pdf&lt;/a&gt; the intuition &#xA;there is that the smile may be the result of computational error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would look at agent based approaches of modelling markets and tinker with risk aversion parameters, depending on your modelling approach you can replicate crashes/tails/volatility increases/decreases in the market clearing price.&lt;/p&gt;&#xA;" OwnerUserId="2154" LastActivityDate="2014-12-15T19:00:50.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15877" PostTypeId="2" ParentId="15868" CreationDate="2014-12-15T19:07:07.957" Score="1" Body="&lt;p&gt;This is a much simpler problem than stated, (assuming the correlation is positive).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In 1 month you need to BUY 2mn of jet fuel.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If Jet fuel prices go up, you lose money as it's more expensive.&#xA;If jet fuel prices go down, you make money as it's cheaper.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So to &quot;hedge&quot; your risk you will LONG the heating oil, as you are not in the business of speculating on oil prices, to lock in your margins. So regardless of where prices of jet fuel go, the margins are preserved.&lt;/p&gt;&#xA;" OwnerUserId="2154" LastActivityDate="2014-12-15T19:07:07.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15878" PostTypeId="2" ParentId="15874" CreationDate="2014-12-15T19:09:48.990" Score="6" Body="&lt;p&gt;Quandl has a python api:&#xA;&lt;a href=&quot;https://www.quandl.com/help/api&quot; rel=&quot;noreferrer&quot;&gt;https://www.quandl.com/help/api&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and free stock fundamentals (some)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.quandl.com/help/api-for-stock-data&quot; rel=&quot;noreferrer&quot;&gt;https://www.quandl.com/help/api-for-stock-data&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2154" LastActivityDate="2014-12-15T19:09:48.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15879" PostTypeId="2" ParentId="15857" CreationDate="2014-12-15T19:16:43.583" Score="2" Body="&lt;p&gt;See Evidence Based Technical Analysis by Aronson: &lt;a href=&quot;http://www.amazon.ca/Evidence-Based-Technical-Analysis-Scientific-Statistical/dp/0470008741&quot; rel=&quot;nofollow&quot;&gt;http://www.amazon.ca/Evidence-Based-Technical-Analysis-Scientific-Statistical/dp/0470008741&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Stochastic Oscillator backtest: &lt;a href=&quot;http://systematicinvestor.wordpress.com/2013/07/19/stochastic-oscillator/&quot; rel=&quot;nofollow&quot;&gt;http://systematicinvestor.wordpress.com/2013/07/19/stochastic-oscillator/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above blog has a lot of TA backtests with code, warning that the authors code masks base functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Asymmetrical Risk Metrics and returns: &lt;a href=&quot;http://algorithmicfinance.org/1-2/pp79-93/&quot; rel=&quot;nofollow&quot;&gt;http://algorithmicfinance.org/1-2/pp79-93/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2154" LastActivityDate="2014-12-15T19:16:43.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15880" PostTypeId="2" ParentId="15850" CreationDate="2014-12-15T21:54:46.407" Score="1" Body="&lt;p&gt;Use Mean Squared Forecast Error (or any other forecast evaluation metric).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your question appears to complicate the problem: If your goal is to forecast a given parameter you can test the rolling forecast against the actual observed values. This will also give you a metric of uncertainty as you can then create confidence intervals around your forecasts based on past error (as opposed of using distributional estimation and it's assumptions).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to test models you can check the forecast error of the model vs optimal with perfect information on a rolling standpoint.&lt;/p&gt;&#xA;" OwnerUserId="2154" LastEditorUserId="2154" LastEditDate="2014-12-15T22:01:21.273" LastActivityDate="2014-12-15T22:01:21.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15881" PostTypeId="2" ParentId="15195" CreationDate="2014-12-15T21:54:52.027" Score="3" Body="&lt;p&gt;If we are going to have the form &#xA;\begin{align*}&#xA;dr = A dt + BdW_t,&#xA;\end{align*}&#xA;Then both A and B are functions of $t$ and $r_t$, otherwise, $r_t$ is normal. However, note that &#xA;\begin{align*}&#xA;r_t = \exp\Bigg(\frac{1}{\sigma(t)}\bigg(\int_0^t \theta(s)\sigma(s) ds +\sigma(0)\ln r_0 + \int_0^t\sigma^2(s) dW_s\bigg)\Bigg).&#xA;\end{align*}&#xA;That is, $r_t$ is log-normal, assuming that both $\theta(t)$ and $\sigma(t)$ are determinsitic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &#xA;\begin{align*}&#xA;d(\ln\,r_t)=\Big(\theta(t)-\frac {d(\ln\sigma(t))}{dt}\ln r_t\Big)\,dt+\sigma(t) \, dW_t,&#xA;\end{align*}&#xA;we obtain that&#xA;\begin{align*}&#xA;dr_t &amp;amp;= d\big(e^{\ln r_t}\big)\\&#xA;&amp;amp;= r_t\Big( d \ln r_t + \frac{1}{2}\langle d\ln r_t, \, d\ln r_t\rangle\Big)\\&#xA;&amp;amp;= r_t \bigg[\Big(\theta(t)-\frac {d(\ln\sigma(t))}{dt}\ln r_t + \frac{1}{2} \sigma^2(t)\Big)\,dt+\sigma(t) \, dW_t \bigg].&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-11-04T14:25:20.530" LastActivityDate="2015-11-04T14:25:20.530" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="15883" PostTypeId="1" AcceptedAnswerId="15886" CreationDate="2014-12-15T23:06:26.283" Score="2" ViewCount="144" Body="&lt;p&gt;The Black Scholes model assumes the following form for the Wiener process describing the evolution of the stock price &lt;code&gt;S&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS=\mu S dt + \sigma S dX$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly $S$ and $dt$ have units of dollars (say) and days (say), respectively. That means $\mu$ has units of &quot;per day&quot;.&#xA;What are the units of the other variables: $\sigma$ and $dX$ ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At no point in my textbook or any other derivation I've seen is a normalisation performed, so I assume these variables retain some meaningful units. I can't find a textbook that mentions the units, and would like to set the record straight.&lt;/p&gt;&#xA;" OwnerUserId="13452" LastActivityDate="2014-12-16T16:26:04.803" Title="What are the units of the variables appearing in a standard stochastic differential equation for a Wiener process?" Tags="&lt;equities&gt;&lt;black-scholes&gt;&lt;stochastic-calculus&gt;&lt;wienerprocess&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15885" PostTypeId="2" ParentId="15771" CreationDate="2014-12-16T00:11:36.543" Score="1" Body="&lt;p&gt;From a different edition plus solutions manual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/AIA2P.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="467" LastEditDate="2014-12-16T08:30:00.067" LastActivityDate="2014-12-16T08:30:00.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15886" PostTypeId="2" ParentId="15883" CreationDate="2014-12-16T00:38:53.783" Score="2" Body="&lt;p&gt;$ \sigma S $ is in units of dollars per square root of a unit of time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \sigma $ is usually quoted as an annual or daily percentage. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ dX ^2 $ is in units of time, as $ E[(dX)^2] = dt $. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an &lt;a href=&quot;http://sfb649.wiwi.hu-berlin.de/fedc_homepage/xplore/tutorials/sfehtmlnode28.html#Sec:ItoLem&quot; rel=&quot;nofollow&quot;&gt;online tutorial&lt;/a&gt; which you may find helpful. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT by kotozna: $\sigma$ has dimensions 1/(square root of time) and $dX$ has dimensions square root of time. Note that $\sigma$ corresponds to but is not exactly the standard deviation.&lt;/p&gt;&#xA;" OwnerUserId="13311" LastEditorUserId="13311" LastEditDate="2014-12-16T16:26:04.803" LastActivityDate="2014-12-16T16:26:04.803" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15887" PostTypeId="2" ParentId="15802" CreationDate="2014-12-16T01:33:04.483" Score="2" Body="&lt;p&gt;It is a classical misunderstanding, your model is  right, you always have a acf equal to one at lag &lt;strong&gt;zero&lt;/strong&gt; (and not one) since if there is no lag acf = covariance(x , x_lag 0) / variance x = variance x / variance x  = 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you  need to pay attention to the x axis , some software displays ACF starting at lag  zero and some others from 1 (which make better sense) .  &lt;/p&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2014-12-16T01:33:04.483" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15888" PostTypeId="2" ParentId="15847" CreationDate="2014-12-16T06:00:59.903" Score="-1" Body="&lt;p&gt;If there are no arbitrage opportunities there is no dominant hedge or long position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why would there be an arbitrage opportunity if everything was priced correctly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There may be arbitrage opportunities even if there are no dominant hedges or long positions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put-call parity shows arbitrage opportunities of badly priced options regardless of long position mispricing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using put-call parity, only, to try and explain this is a bit limiting, and I would like to warn you about people who offer answers only relating to put-call parity.&lt;/p&gt;&#xA;" OwnerUserId="13828" LastEditorUserId="13828" LastEditDate="2014-12-22T03:21:10.063" LastActivityDate="2014-12-22T03:21:10.063" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="15890" PostTypeId="2" ParentId="10047" CreationDate="2014-12-16T06:43:41.570" Score="1" Body="&lt;p&gt;If it was on Nyse or NASDAQ, could be a special order type (only if on first limit: some participants can send orders that are activated only to prevent a &quot;trade through&quot;, i.e. if there is no other order at this price on other venues).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It may also be your broker did not succeeded into counting the orders on this limit (bug, datafeed, etc), especially if it is a consolidated orderbook.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2014-12-16T06:43:41.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15892" PostTypeId="1" AcceptedAnswerId="15893" CreationDate="2014-12-16T10:41:55.217" Score="2" ViewCount="1232" Body="&lt;p&gt;I'm wondering which curves should I use when passing from &#xA;the Implied volatility to prices. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I read an implied volatility (for instance 3Y Cap strike 0.5%) &#xA;the discounts and forward rate entering in the Black formula &#xA;have been taken from which curves? Calibrated on which instruments? &lt;/p&gt;&#xA;" OwnerUserId="6249" LastEditorUserId="2587" LastEditDate="2014-12-16T11:37:55.627" LastActivityDate="2014-12-16T12:12:06.020" Title="How does Reuters quote caps?" Tags="&lt;interest-rates&gt;&lt;reuters&gt;&lt;black&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15893" PostTypeId="2" ParentId="15892" CreationDate="2014-12-16T11:49:11.293" Score="2" Body="&lt;p&gt;I don't know exactly about Reuters but often implied volas in the Black 76 world are quoted (forward) ATM. Thus the forward equals the strike and they dissappear from the formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;C = E[(F-K)^+] = \exp(- r t) (F N(d_1) - K N(d_2))&#xA;$$&#xA;and $d_1 = (\log(F/K)+\sigma^2/2T)/(\sigma \sqrt{T})$ and $d_2 = d_1 - \sigma \sqrt{T}$,&#xA;see e.g. &lt;a href=&quot;http://en.wikipedia.org/wiki/Black_model&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the ATM case $F=K$ and in the term for $d_1$ we get $\log(F/K)=0$. Thus the formula depends as little as possible on curves. For $r$ I assume some appropriate money-market rate  depending on the time-to-expiry of the caplet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I have worked using swaption data. There in the surface you have 2 dimensions: time to expiry of the option and then the term of the swap. Concerning the rate $F$ it is the traded swap rate that fits to the term (and the starting date) and thus is is a forward swap rate. The strike is then clear.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Summarizing: for the underlyings one should take the corresponding traded objects. In your case I would take a forward money market rate. If it is not traded then I would calculate it using the usual forward rate formula and take a money-market/swap based curve as basis (use zero-rates which you get by bootstrapping). Doing this you don't need a stochastic interest model for this but derive the underlying rather directly from traded objects. I am sure Reuters is doing something similar.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2014-12-16T12:12:06.020" LastActivityDate="2014-12-16T12:12:06.020" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15895" PostTypeId="1" CreationDate="2014-12-16T16:55:03.287" Score="2" ViewCount="1887" Body="&lt;p&gt;Where can I obtain all official real-time and intraday data for exchanges — NASDAQ, NYSE, AMEX, OTC, CME, etc? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I feel like the raw data is out there to be consumed and parsed at no cost (except the labor to actually make sense of the data). I want this information because I'm building a few tools for fun and out of pure interest. &lt;/p&gt;&#xA;" OwnerUserId="13846" LastEditorUserId="13846" LastEditDate="2014-12-16T17:11:44.697" LastActivityDate="2014-12-16T23:23:50.300" Title="Free access to official real-time and intraday data for exchanges" Tags="&lt;market-data&gt;&lt;intraday&gt;&lt;quote&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ClosedDate="2014-12-17T01:22:17.483" ContentLicense="CC BY-SA 3.0" />
  <row Id="15896" PostTypeId="1" AcceptedAnswerId="15905" CreationDate="2014-12-16T17:01:36.823" Score="8" ViewCount="493" Body="&lt;p&gt;I have encountered a rather elegant argument about the limitations of empirically testing for market efficiency, involving the central point that &lt;strong&gt;we do not know whether a result is due to the &quot;true behaviour&quot; of the market or due to the model&lt;/strong&gt; used to simulate that behaviour.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately I have not been able to retrieve this argument online, nor any publications relating specifically to this, which may be due to the fact that I do not know how this argument is typically referred to in the literature.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular, I would like to understand how we can interpret any empirical results regarding market anomalies or market efficiency when taking into account the above important limitation. Say, for example, we use the Fama-French-Carhart model in order to examine whether a particular portfolio formation strategy leads to abnormal returns. If our $\alpha$ is positive and significant, how can we know this is due to an actual anomaly (on which we have based our portfolio formation), rather than a bias in our model, which has underestimated market returns (other than the fact that the model &lt;em&gt;usually&lt;/em&gt; has a decent predictive power)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I greatly appreciate any clarification or resources!&lt;/p&gt;&#xA;" OwnerUserId="13665" LastActivityDate="2014-12-16T23:58:57.643" Title="What are the empirical limitations to testing market efficiency?" Tags="&lt;models&gt;&lt;asset-pricing&gt;&lt;anomalies&gt;&lt;emh&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="15897" PostTypeId="2" ParentId="15784" CreationDate="2014-12-16T17:18:27.340" Score="2" Body="&lt;p&gt;The coefficients assuming they are statistically significant can be interpreted whether or not the underlying portfolio is efficient. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The CAPM  or FF4 simply tries to decompose a portfolio into a series of linear exposures + an intercept (alpha) which can be viewed as constant added value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In mathematical terms the regression is explaining how much of the performance &quot;coincides&quot; with the four factors (causality is difficult to establish).&lt;/p&gt;&#xA;" OwnerUserId="2154" LastActivityDate="2014-12-16T17:18:27.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15898" PostTypeId="2" ParentId="15895" CreationDate="2014-12-16T17:20:01.650" Score="0" Body="&lt;p&gt;You can try to scrape it from google finance for some US stocks in &quot;real time&quot;, however there may be seconds of delay.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally you need to pay exchanges an access fee for raw real time data, and they guard these feeds quite jealously.&lt;/p&gt;&#xA;" OwnerUserId="2154" LastActivityDate="2014-12-16T17:20:01.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15899" PostTypeId="2" ParentId="15895" CreationDate="2014-12-16T18:43:58.900" Score="3" Body="&lt;p&gt;+1 for &quot;feeling like the data is out there to be parsed for free&quot;. lol&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If data is just for toys, do:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.dxfeed.com/historical-tick-data/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.dxfeed.com/historical-tick-data/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;They offer (free) tick data for May 6 2010 (flash crash).&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;&lt;p&gt;Scrape google.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;This question: &lt;a href=&quot;https://quant.stackexchange.com/questions/450/free-intra-day-equity-data-source&quot;&gt;Free intra-day equity data source&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="13657" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2014-12-16T23:23:50.300" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15901" PostTypeId="2" ParentId="9161" CreationDate="2014-12-16T19:17:44.127" Score="7" Body="&lt;p&gt;Very interesting question. I am not an expert on the subject, however, I was able to find a collection of papers on the subject that should get you started.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a good and very informative paper that walks you through several tick by tick volatility estimators that seek to reduce the volatility imposed by market micro-structure:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.olseninvest.com/customer/pdf/paper/020221-efficientVolEstimator.pdf&quot;&gt;Efficient estimation of volatility using high frequency data&#xA;G Zumbach, F Corsi, A Trapletti &lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is one of the first papers on the subject:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://public.econ.duke.edu/~get/browse/courses/201/spr11/DOWNLOADS/MicroStructure/Zhou-JBES-1996.pdf&quot;&gt;High-frequency data and volatility in foreign-exchange rates&#xA;B Zhou - Journal of Business &amp;amp; Economic Statistics, 1996&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Analysis of market micro-structure noise here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://public.econ.duke.edu/~get/browse/courses/201/spr10/DOWNLOADS/MicroStructureNoise/Hansen-Lunde-JBES-2006+COMMENTS/s1.pdf&quot;&gt;Realized variance and market microstructure noise&#xA;PR Hansen, A Lunde - Journal of Business &amp;amp; Economic Statistics, 2006&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another article proposing sub-sampling techniques:&#xA;&lt;a href=&quot;http://repository.cmu.edu/cgi/viewcontent.cgi?article=1164&amp;amp;context=statistics&quot;&gt;A tale of two time scales&#xA;L Zhang, PA Mykland, 2005&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally, there is a wealth of papers on the subject of short term volatility estimation. You can take a &lt;a href=&quot;http://scholar.google.com/scholar?cites=5923881265989503428&amp;amp;as_sdt=20000005&amp;amp;sciodt=0,21&amp;amp;hl=en&quot;&gt;look at this list&lt;/a&gt; of papers citing Zhou's original paper to find relevant research. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Short term volatility forecasting is another very interesting subject. If you get good volatility estimates, you should be able to use standard techniques for forecasting. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is one paper:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://irps.ucsd.edu/assets/007/5581.pdf&quot;&gt;Forecasting volatility using tick by tick data, RF Engle, Z Sun - 2005&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2014-12-16T19:17:44.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15902" PostTypeId="1" AcceptedAnswerId="15911" CreationDate="2014-12-16T20:59:01.143" Score="3" ViewCount="643" Body="&lt;p&gt;It is fairly known that in affine processes, as &lt;a href=&quot;http://en.wikipedia.org/wiki/Heston_model&quot; rel=&quot;nofollow&quot;&gt;Heston model&lt;/a&gt;&#xA;\begin{equation}&#xA;\begin{aligned}&#xA;dS_t &amp;amp;= \mu S_t dt + \sqrt{v_t} S_t dW^{S}_{t} \\&#xA;dv_t &amp;amp;= k(\theta - v_t) dt + \xi \sqrt{v_t} dW^{v}_{t}&#xA;\end{aligned}&#xA;\end{equation}&#xA;the SV $v_t$ is a strictly positive process if the drift is stronger enough, i.e. if drift parameters ($k$, the speed of mean-reverting, and $\theta$, mean-reverting level) and the Vol-of-Vol $\xi$ satisfy:&#xA;\begin{equation}&#xA;k \theta &amp;gt; \frac{1}{2} \xi^2&#xA;\end{equation}&#xA;which is known as &lt;em&gt;Feller condition&lt;/em&gt;.&#xA;I know this condition can be generalized to multi-factor affine processes.&#xA;For example, if the volatility of the returns $\log S_t$ is made of several independent factors $v_{1,t},v_{2,t},...,v_{n,t}$, then the Feller condition applies to each factor separately (&lt;a href=&quot;https://web.stanford.edu/~piazzesi/s.pdf&quot; rel=&quot;nofollow&quot;&gt;check here&lt;/a&gt; at page 705, for example). &#xA;Moreover &lt;a href=&quot;http://web.stanford.edu/~duffie/YieldFactorModel.pdf&quot; rel=&quot;nofollow&quot;&gt;Duffie and Kan (1996)&lt;/a&gt; provide a multidimensional extension of the Feller condition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I still don't understand if we still need the (or a sort of) Feller condition in case of &lt;strong&gt;jump-diffusion&lt;/strong&gt;. You may consider for example the simple case of a volatility factor with exponentially distributed jumps:&#xA;\begin{equation}&#xA;dv_t = k(\theta - v_t) dt + \xi \sqrt{v_t} dW^{v}_{t} + dJ^{v}_{t}&#xA;\end{equation}&#xA;where $J^{v}_{t}$ is a compound Poisson process, independent of the Wiener $W^{v}_{t}$. The Poisson arrival intensity is a constant $\lambda$ with mean $\gamma$.&#xA;I observe that in this case, the long term mean reverting level is jump-adjusted:&#xA;\begin{equation}&#xA;\theta \Longrightarrow \theta ^{*}=\theta + \frac{\lambda}{k} \gamma&#xA;\end{equation}&#xA;so I suspect if a sort of Feller condition applies it must depends on jumps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nevertheless, from a purely intuitive perspective, even if the barrier at $v_t = 0$ is absorbent, jump would pull back from 0 again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your time and attention.&lt;/p&gt;&#xA;" OwnerUserId="13528" LastActivityDate="2016-05-27T05:58:08.453" Title="Do we need Feller condition if volatility process jumps?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-volatility&gt;&lt;heston&gt;&lt;jump&gt;&lt;affine-processes&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15903" PostTypeId="5" CreationDate="2014-12-16T22:18:14.223" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2014-12-16T22:18:14.223" LastActivityDate="2014-12-16T22:18:14.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15904" PostTypeId="4" CreationDate="2014-12-16T22:18:14.223" Score="0" Body="Questions about the exchanges in the CME Group, including the CME's trading engine, Globex" OwnerUserId="5251" LastEditorUserId="5251" LastEditDate="2014-12-17T01:21:09.970" LastActivityDate="2014-12-17T01:21:09.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15905" PostTypeId="2" ParentId="15896" CreationDate="2014-12-16T23:58:57.643" Score="9" Body="&lt;p&gt;This the &quot;Joint Hypothesis Problem&quot;. Basically, any test for abnormal returns is also implicitly a test of the model you use to define &quot;abnormal&quot;. If you see a significant and positive $\alpha$, that could either mean that you actually are generating excess risk-adjusted returns, or it could mean that your risk model is incomplete.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is basically what happened with Fama-French. If you assume that CAPM is true, then Fama and French showed that the market is inefficient, since certain portfolios have abnormal risk-adjusted returns. However, since &quot;everyone&quot; now knows about the Fama-French portfolios, and they still show excess returns over those predicted by CAPM, it's more reasonable to interpret their results as having discovered new risk factors.&lt;/p&gt;&#xA;" OwnerUserId="11970" LastActivityDate="2014-12-16T23:58:57.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15906" PostTypeId="1" CreationDate="2014-12-17T08:33:30.210" Score="2" ViewCount="1406" Body="&lt;p&gt;I try to model currency rates volatility using GARCH models through the RUGARCH package in R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Starting from the observed currency rate series, I compute the log-return through:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;data &amp;lt;- diff(log(series)) # Log-return&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then (after some statistical analysis) I decide to use a GARCH(1,1) model with a skew-student distribution, hence I use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;spec_final &amp;lt;- ugarchspec(mean.model=list(armaOrder=c(0,0),include.mean=FALSE),variance.model=list(model=&quot;sGARCH&quot;,garchOrder=c(1,1)),distribution.model=&quot;sstd&quot;)&#xA;fit_final &amp;lt;- ugarchfit(spec_final,data=data)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I then try to simulate future outcomes of this series with an horizon of 260 days with the code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;horizon &amp;lt;- 260&#xA;exp(diffinv(ugarchsim(fit_final,n.sim=horizon)@simulation$seriesSim))[horizon+1]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I perform this a great number of times (200,000) I can compute quantiles. More especially I see that the quantile at 0.5% is equal to 0.605 and the quantile at 99.5% is equal to 1.623. The distribution has a mean very close to 1 but is not symmetric.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to understand why there is a lack of symmetry in the simulated distribution, even if the GARCH model is known to be symmetric. It does not happen only for one currency but for all those I tried to model. This is really an issue to me as I do not have any particular reason to explain why the model predicts larger upward shocks than downward shocks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="8047" LastActivityDate="2015-01-12T22:23:04.477" Title="Log returns and GARCH models" Tags="&lt;returns&gt;&lt;garch&gt;&lt;currency&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15908" PostTypeId="2" ParentId="8091" CreationDate="2014-12-17T12:47:38.690" Score="2" Body="&lt;p&gt;Question 1 (how to set asset level risk budgets as well as portfolio level target volatility) is discussed in &lt;em&gt;Modern Portfolio Optimization&lt;/em&gt; by Bernd Scherer and Douglas Martin in section 3.1.1 on risk budgeting constraints. They set upper and lower bounds for their risk budget constraints in a mean variance optimization.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://www.inquire-europe.org/seminars/2013/papers%20Edinburgh/Sefton%20Jessop%20-%20Getting%20Performance%20out%20of%20Risk%20Parity.pdf&quot; rel=&quot;nofollow&quot;&gt;recent work&lt;/a&gt; by James Sefton, David Jessop and collegues at UBS might be revelant as well. They show that the optimization problem&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \max \sum_i \mu_i x_i ^{1/k} \\ { subject \ to \ \  } \sqrt{ x^T \Sigma x} \le \sigma_{target}, \ \ {\sum_i x_i = 1} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;converges to a risk parity optimization as $k \rightarrow \infty$. In that limit, the same risk budget, $x_i (\Sigma x)_i$, is allocated to each asset.  &lt;/p&gt;&#xA;" OwnerUserId="6721" LastActivityDate="2014-12-17T12:47:38.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15909" PostTypeId="2" ParentId="15490" CreationDate="2014-12-17T18:10:10.593" Score="1" Body="&lt;p&gt;If you don't want to deal with NYX, check out &lt;a href=&quot;http://www.tickdata.com&quot; rel=&quot;nofollow&quot;&gt;TickData&lt;/a&gt;. You can purchase a date range for symbols, but the minimum order is $999.&lt;/p&gt;&#xA;" OwnerUserId="13838" LastActivityDate="2014-12-17T18:10:10.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15910" PostTypeId="1" CreationDate="2014-12-17T20:34:42.677" Score="1" ViewCount="783" Body="&lt;p&gt;I'm trying to simulate stock prices using GBM. I am using the following formula, and MATLAB function, to determine the stock prices:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\nu = \mu - \frac{\sigma^{2}}{2}$;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S = S0*\text{[ones(1,nsims); ...&#xA;            cumprod(}\exp(\nu dt+\sigma \sqrt{dt}*\text{randn(steps,nsims))},1)];$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;using the following parameters:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S0 = 1,$&#xA;$\mu = 0,$&#xA;$\sigma = 0.2481,$&#xA;$dt = 1/365,$&#xA;$\text{steps} = 365,$&#xA;$\text{nsims} = 1000.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I use this to generate the stock prices the results look log-normal and the log of the returns from the first to last price is also normal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The issue I am having is that with no drift the median should be 1 according to &lt;a href=&quot;http://en.wikipedia.org/wiki/Log-normal_distribution#Mode_and_median&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Log-normal_distribution#Mode_and_median&lt;/a&gt;, but I am consistently getting values less than 1. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure what is going on or if I am simulating incorrectly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my first time posting so please let me know if I have done anything incorrectly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="13855" LastEditorUserId="13657" LastEditDate="2014-12-18T01:23:51.820" LastActivityDate="2014-12-18T01:23:51.820" Title="Median value for geometric brownian motion simulation" Tags="&lt;programming&gt;&lt;stochastic-processes&gt;&lt;monte-carlo&gt;&lt;quantitative&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15911" PostTypeId="2" ParentId="15902" CreationDate="2014-12-17T21:24:59.013" Score="3" Body="&lt;p&gt;The Feller condition applies without modification.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is under the assumption that $v$ is square-root process with poisson-arrival jumps (as you wrote), and assuming the jump distribution is strictly positive and initial level $v_0&amp;gt;0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason is, conditional on no jumps occuring, the process is just a square root process, for which the references you cite show that $v$ remains strictly positive iff $\kappa\theta&amp;gt;\frac{1}{2}\xi^2$.  But when a jump arrives, $v$ changes level and resumes following the same process.  If the Feller condition is satisfied, it can never diffuse to 0; if the jump distribution is positive it can never jump to 0.  For finite arrival rate jumps that covers it: it cannot reach 0.  If the Feller condition is not satisfied, since the diffusion is independent of the jump and the no jump probability is positive, even conditional on no jumps the process can reach 0.  So again the condition is if-and-only-if.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastEditorUserId="6686" LastEditDate="2016-05-27T05:58:08.453" LastActivityDate="2016-05-27T05:58:08.453" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15912" PostTypeId="2" ParentId="15910" CreationDate="2014-12-17T22:20:24.053" Score="1" Body="&lt;p&gt;You are generating a price series, in time steps $p_{dt},p_{2dt},p_{3dt},...$. I assume? So if you do $\text{Median}\{p_{dt},p_{2dt},p_{3dt},..\}$ then you will get a value biased towards $0$ (for the parameters you gave, and the sample size you have). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to look at the distributional characteristics of the price, then you have to do so per each $p_{i \times dt}$, for a single $i$. So you create your price series, then isolate a particular $p_{i \times dt}$ and look at the distribution of that, over many samples.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So $\text{Median}\{p_{i\times dt}\}$ is equal to 1 (for all $i$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If look at $\text{Median}\{p_{dt},p_{2dt},p_{3dt},..\}$ you are simply getting the median of a log-normal mixture distribution (with a really small sample size), which I guess is not what you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;p.s. you should use latex on this site.&lt;/p&gt;&#xA;" OwnerUserId="13657" LastActivityDate="2014-12-17T22:20:24.053" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15913" PostTypeId="2" ParentId="15788" CreationDate="2014-12-17T23:13:27.320" Score="6" Body="&lt;p&gt;The answer is that it depends.  In addition to the Lo paper above, there are a number of excellent references that go into depth about annualizing or time scaling non-i.i.d. returns, one of which is Roger Kauffman, &quot;Long-Term Risk Management&quot;, 2005 which can be found at &lt;a href=&quot;http://www.rogerkaufmann.ch/all-Budapest.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.rogerkaufmann.ch/all-Budapest.pdf&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are some well known cases where the variance of non-i.i.d. returns can still be time-scaled but here's one realistic example.  Let's assume that we have a portfolio whose daily changes are given by a random variable $P_t$ that is not i.i.d. but  are still identically distributed over time.  It may still be possible to define the dependency relationship and use its properties to scale the volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume that daily gain/losses on a portfolio $P_t$ follow a first-order autoregressive process with normal innovations, i.e. that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$&#xA;P_t \sim\phi_1 P_{t-1} + \epsilon_t \quad where \quad \epsilon_t \sim \mathcal{N}(0,\sigma_\epsilon^2)&#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, it can be shown that both the 1-day and the T-day P&amp;amp;L are normally distributed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$&#xA;P_t \sim \mathcal{N}\left(0, \frac{\sigma_\epsilon^2}{1-\phi_1^2}\right) \qquad and\quad \sum\limits_{t=1}^T P_t \sim \mathcal{N}\left(0,\frac{\sigma_\epsilon^2}{(1-\phi_1)^2} \left(T - 2\phi_1 \frac{1-\phi_1^T}{1-\phi_1^2}\right)\right)&#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then get an expression for the ratio of T-period volatility to 1-day volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$&#xA;\frac{Vol(P_t)|time T}{Vol(P_t)|time 1}=\sqrt{&#xA;\frac{1+\phi_1}{1-\phi_1} \left(T-2\phi_1 \left(\frac{1-\phi_1^T}{1-\phi_1^2}\right)\right)}&#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The right hand side is also the scaling factor you would apply to the 1-day volatility to get to the T period volatility&lt;/strong&gt;.  It is also clear that as $\phi_1 \to 0$ or in other words, no autocorrelation and so back to independently distributed, then as you would expect:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$&#xA;(Vol(P_t)|time=T) \to \sqrt{T}\times (Vol(P_t)|time=1) &#xA;$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To the extent that the innovations are non-normal, the AR(1) solution may be biased.  Also may go without saying, but even if there is no straightforward analytic means to scale daily returns, as long as the distribution is analytic and you can express returns at time t as a function of returns from prior periods $t-k$, then Monte Carlo simulation can be used to simulate an arbitrarily large number of paths $N$ over any arbitrary time period $T$.  This yields a distribution of return outcomes $x_i$ at time T.  The volatility (standard deviaiton really) could be computed in the conventional way, i.e. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$&#xA;s_N = \sqrt {\frac{1}{N}\sum\limits_{i = 1}^N {\left( {x_i - \bar x} \right)^2 } }&#xA;$&lt;/p&gt;&#xA;" OwnerUserId="13856" LastActivityDate="2014-12-17T23:13:27.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15916" PostTypeId="1" AcceptedAnswerId="15938" CreationDate="2014-12-18T11:23:28.487" Score="3" ViewCount="10750" Body="&lt;p&gt;I'm just started with finance, so maybe my question is dumb or answered elsewhere. Please guide me to relevant materials.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to put-call parity more time to expiration means more difference between Put and  Call prices &lt;code&gt;Call - Put = Spot - Strike*e^(-r*T)&lt;/code&gt; My understanding this is to avoid arbitrage between &lt;code&gt;Stock plus Put&lt;/code&gt; vs &lt;code&gt;Call plus Deposit&lt;/code&gt;. The arbitrage is avoided by embedding deposit returns into Call price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now looking at real prices I do not see large difference between Put and Call options prices even for options which have about a year till expiration which suggest near zero risk-free rate. For example, today data from google:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Stock | Expiration   | Spot   | Strike | Put Bid | Call Bid |&#xA;AAPL  | Jan 15, 2016 | 109.41 | 110    | 14.95   | 13.40    |&#xA;SBUX  | Jan 15, 2016 | 80.43  | 82.50  | 9.20    | 6.55     |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I calculate risk-free rate, assuming T ~ 1, as &lt;code&gt;r = -ln((Put + Spot - Call)/Strike)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In both cases (AAPL, SBUX) risk free rate is slightly less than 0. By looking at this two questions arise:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Does my calculations correct? &lt;/li&gt;&#xA;&lt;li&gt;If market assume zero risk free rate does this means call are underpriced? One can still get risk free rate by investing into bonds or saving account. In this case &lt;code&gt;Call plus Deposit&lt;/code&gt; will earn more than &lt;code&gt;Stock plus Put&lt;/code&gt; since Call price does not have risk-free rate embedded in it.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="13861" LastActivityDate="2021-01-11T10:23:42.060" Title="Which risk free rate is assumed by market when pricing american options?" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;risk-free&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15917" PostTypeId="1" CreationDate="2014-12-18T16:07:02.087" Score="2" ViewCount="247" Body="&lt;p&gt;I am trying to snap prices in R for the latest price for a list of stocks (around 150).  When I snap them for 2 stocks, it's almost instantaneous:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  tickers&amp;lt;- c(&quot;YHOO&quot;,&quot;AAPL&quot;)&#xA;  library(&quot;IBrokers&quot;)&#xA;      t_start&amp;lt;-Sys.time()&#xA;  tws &amp;lt;- twsConnect()&#xA;  test&amp;lt;-reqMktData(tws, lapply(tickers, twsSTK), tickGenerics=&quot;&quot;, snapshot=T)&#xA;  twsDisconnect(tws)&#xA;      t_end&amp;lt;-Sys.time()&#xA;      t_end-t_start&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I start adding more records into the tickers vector, it starts getting incredibly slow.  For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;tickers&amp;lt;-c(&quot;YHOO&quot;,&quot;AAPL&quot;,&quot;COP&quot;,&quot;PEP&quot;,&quot;XOM&quot;,&quot;ORCL&quot;,&quot;SPG&quot;,&quot;EQR&quot;,&quot;CVX&quot;,&quot;JPM&quot;,&quot;AFL&quot;,&quot;GIS&quot;,&quot;VZ&quot;,&quot;KMB&quot;,&quot;WFC&quot;,&quot;ROST&quot;,&quot;MMC&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This becomes excruciatingly slow.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I cannot figure out why it's so slow based on exchange, or size of company, as these are all large cap, highly liquid, blue chip stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is anyone familiar with why this is so slow?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much.&lt;/p&gt;&#xA;" OwnerUserId="13864" LastActivityDate="2014-12-18T16:07:02.087" Title="Ibrokers: reqMktData extremely slow when adding tickers" Tags="&lt;r&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15918" PostTypeId="2" ParentId="12868" CreationDate="2014-12-18T16:18:01.843" Score="1" Body="&lt;p&gt;As the paper suggests, the results that are shown in table 2 are taken from (if you read the caption)&#xA;&lt;img src=&quot;https://i.stack.imgur.com/kglIf.jpg&quot; alt=&quot;Snapshot&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Ziemba, William T., and Donald B. Hausch, Betting at the Racetrack (New York: Norris M. Strauss, 1986)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The citation is not included for some reason, hence your confusion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your code works fine by the way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="13682" LastActivityDate="2014-12-18T16:18:01.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15919" PostTypeId="2" ParentId="15773" CreationDate="2014-12-18T19:47:44.517" Score="1" Body="&lt;p&gt;I'm sorry for the late answer. I hope you passed the exam anyway!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;TO answer your question, $s_2 = r_2-r_f$, that is the excess return over the risk free rate/asset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, there seems to be a typo in your formula, I believe it should be&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$w_1 = \frac{s_1-ps_2}{(s_1+s_2)(1-p)}$, i.e. plus in the denominator. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$w_1$ is the weight for asset 1 and $w_2 = 1-w_1$ the weight for asset 2 that maximize the Sharpe ratio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ohh, and Hi Mark Joshi! :) (in the comments)&lt;/p&gt;&#xA;" OwnerUserId="13865" LastEditorUserId="13865" LastEditDate="2014-12-18T20:31:50.803" LastActivityDate="2014-12-18T20:31:50.803" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15920" PostTypeId="1" AcceptedAnswerId="15929" CreationDate="2014-12-18T20:27:25.690" Score="6" ViewCount="2587" Body="&lt;p&gt;I use R to estimate a seasonal ARIMA(8,0,0)(5,0,1)[7] model for the seasonal differences of logs of daily electricity prices:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;daily.fit &amp;lt;- arima(sd_l_daily_adj$Price,&#xA;                   order=c(8,0,0),&#xA;                   seasonal=list(order=c(5,0,1), period=7),&#xA;                   xreg = sd_l_daily_adj$Holiday,&#xA;                   include.mean=FALSE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Problem is that from all the packages I've tried, only the R's base &lt;em&gt;arima&lt;/em&gt; function allows for the seasonal specification. Packages with GARCH estimation functions such as &lt;em&gt;fGarch&lt;/em&gt; and &lt;em&gt;rugarch&lt;/em&gt; only allow for ordinary ARMA(p, q) specification for the mean equation.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions for any kind of software are welcome,  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="13866" LastEditorUserId="13866" LastEditDate="2014-12-20T17:19:10.747" LastActivityDate="2015-03-27T15:39:46.853" Title="Is there any way to easily estimate and forecast seasonal ARIMA-GARCH model in any software?" Tags="&lt;time-series&gt;&lt;r&gt;&lt;garch&gt;&lt;forecasting&gt;&lt;arima&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15922" PostTypeId="1" CreationDate="2014-12-19T04:49:37.317" Score="3" ViewCount="91" Body="&lt;p&gt;When modelling credit migration probabilities (e.g. AAA to AA), research has indicated the use of the Beta Distribution simply because it fits empirical data. My question is;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are some other pros and what are some cons of modelling using this distribution? Are there any other distributions that could possibly be used?&lt;/p&gt;&#xA;" OwnerUserId="13868" LastActivityDate="2014-12-19T16:46:02.577" Title="Why Beta Distribution for Credit Migration" Tags="&lt;credit-ratings&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15923" PostTypeId="1" CreationDate="2014-12-19T05:09:15.147" Score="4" ViewCount="1213" Body="&lt;p&gt;I would like to preface this by saying I am preparing for an upcoming internship this summer so I am extremely new to Quant Finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At my university we have access to Datastream by Thomson Reuters and Compustat. With either of those two software can I download historical financial statements going back 20+ years so I can backtest screens in R. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for historical financial statements so I can backtest ratios such as ROE, Inventory turnover, and etc. This is why the free Yahoo! API which only has price changes and volume doesn't help me out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="13869" LastActivityDate="2017-06-02T16:52:50.693" Title="Historical Financial Statement to Backtest in R" Tags="&lt;equities&gt;&lt;portfolio-management&gt;&lt;historical-data&gt;&lt;financial&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15927" PostTypeId="2" ParentId="15923" CreationDate="2014-12-19T13:57:00.643" Score="6" Body="&lt;p&gt;Both free and paid access to data sets conatianing company financial statement items is available from Quandl.&#xA;The free data sets are sourced from the SEC based on compnay electronic filings and go back about five years.&#xA;For example, you could obtain five years of MSFT's quarterly net income using the R call&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Quandl(&quot;RAYMOND/MSFT_NET_INCOME_Q&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Lists of available financial data and more detail on using Quandl is available at &lt;a href=&quot;https://www.quandl.com/help/api-for-stock-data&quot;&gt;https://www.quandl.com/help/api-for-stock-data&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="11889" LastActivityDate="2014-12-19T13:57:00.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15929" PostTypeId="2" ParentId="15920" CreationDate="2014-12-19T15:09:55.683" Score="4" Body="&lt;p&gt;You can use Matlab too, that, in my humble opinion, is simpler than R from a syntax point of view.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The model you need for is run by the Matlab function &lt;code&gt;arima&lt;/code&gt; that can be used with &lt;code&gt;seasonality&lt;/code&gt; option to do what you have to do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://it.mathworks.com/help/econ/airline-passenger-data-model.html#zmw57dd0e24909&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; you can find an example and a brief explanation of the model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Type ctrl + F and search for:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Specify a seasonal ARIMA model&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will find how to do that explained in the example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to combine ARIMA with GARCH you can also do that, as described in the &lt;a href=&quot;http://it.mathworks.com/help/econ/converting-from-garch-functions-to-models.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;MATLAB&lt;/code&gt; help&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="848" LastEditDate="2014-12-19T18:00:58.493" LastActivityDate="2014-12-19T18:00:58.493" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15930" PostTypeId="2" ParentId="15922" CreationDate="2014-12-19T16:40:06.957" Score="1" Body="&lt;p&gt;I would think it is because &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;it can be bound between 2 points  &lt;/li&gt;&#xA;&lt;li&gt;it can assume wide range shapes&lt;/li&gt;&#xA;&lt;li&gt;It fits the data empirically (as you said) &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;On a related note &#xA;Sometime back I read a &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=958150&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; which might give you more formal reason. It is for estimating and simulating recovery rates . I havnt used it to model credit migration probabilities . But I think one can extend the structural model mentioned in paper and explain why probabilities can me modelling similarly. &lt;/p&gt;&#xA;" OwnerUserId="1386" LastEditorUserId="1386" LastEditDate="2014-12-19T16:46:02.577" LastActivityDate="2014-12-19T16:46:02.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15931" PostTypeId="1" CreationDate="2014-12-19T19:09:44.040" Score="0" ViewCount="370" Body="&lt;p&gt;I'm a newbie with respects to volatility trading and options. I recently purchased a book on the topic called &quot;Trading Implied Volatility -An introduction&quot; by Simon Gleadall. It's been one of the most informative books on options that come across and i'm learning a lot about the subject but there are a few things that i'm having trouble understanding. In one of the sections on &quot;Trading the Curve&quot;, the author states:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;The trader will have a measure of the relative value. For example, he may track the ratio of (-)10 delta put implied volatility to 10 delta call implied volatility for 3 month options...he is likely to look at a long comparable series of such ratios in the product. His strategy is likely to have some kind of trigger at which point the difference between the current ratio and the historic ratio is significant enough for him to want to trade.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say that i want to track a series of the 10 delta put relative to the ATM put&#xA;How can it be done? how can i create this &quot;measure of the relative value&quot; and &quot;long comparable series of such ratios in the product&quot; practically?&lt;/p&gt;&#xA;" OwnerUserId="13877" LastActivityDate="2015-12-03T14:33:55.330" Title="How do I track implied volatility of specific delta?" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;skew&gt;&lt;delta&gt;&lt;volatility-smile&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15932" PostTypeId="1" AcceptedAnswerId="15941" CreationDate="2014-12-19T19:46:47.830" Score="-1" ViewCount="86" Body="&lt;p&gt;I'm studying hedge funds and I'm looking at two figures that I'm not sure how to interpret:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first is Max Drawdown, which I see scaling from 0 to -30ish.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is Fund A with a MDD of -15 more or less volatile than Fund B with a MDD of -30?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second is Annualized Standard Deviation, which I see scaling from 0 to 400ish.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is Fund A with a ASD of 40 more or less volatile than Fund B with a ASD of 350?&lt;/p&gt;&#xA;" OwnerUserId="13879" LastActivityDate="2014-12-20T07:15:28.940" Title="How should I interpret MDD and ASD?" Tags="&lt;hedge-fund&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2014-12-20T10:29:06.687" ContentLicense="CC BY-SA 3.0" />
  <row Id="15933" PostTypeId="1" CreationDate="2014-12-19T20:00:45.833" Score="2" ViewCount="963" Body="&lt;p&gt;What inferences can one draw when given a modified VaR at x% confidence and an ordinary VaR at x% confidence level. If the two are equal one inference can be that returns are gaussian but that also depends on the confidence level. At extremely high confidence levels mVaR can be equal to VaR even with skewness and kurtosis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how do risk managers look at these estimates? Is the uncertainty in the estimates a concern. What if VaR is lower than mVaR and also less uncertain than mVaR. What if VaR is higher than mVaR but less uncertain than mVaR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is mVaR always preferable? By eyeballing the loss distribution it is easy to see if there is skewness and excess kurtosis and so mVaR may be preferable but is there a case where using mVaR can be a bad idea compared to using VaR.&lt;/p&gt;&#xA;" OwnerUserId="2142" LastActivityDate="2015-04-19T04:27:16.797" Title="comparing modified VaR to ordinary VaR" Tags="&lt;risk-management&gt;&lt;var&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15934" PostTypeId="2" ParentId="15933" CreationDate="2014-12-19T22:36:29.057" Score="1" Body="&lt;p&gt;Using anything with &quot;VaR&quot; in the name, is basically a bad idea. But a modified VaR does not assume a normal distributed random variable. So maybe that makes people feel a little better. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;mVaR might look equal to VaR at &quot;high confidence levels&quot; but it is well-known that both measures are inaccurate at high confidence levels. mVaR may even be worse, given the non-normality assumptions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is homework, right?&lt;/p&gt;&#xA;" OwnerUserId="13657" LastActivityDate="2014-12-19T22:36:29.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15935" PostTypeId="2" ParentId="15933" CreationDate="2014-12-19T22:45:14.717" Score="1" Body="&lt;p&gt;As described on this &lt;a href=&quot;https://www.evestment.com/resources/investment-statistics-guide/modified-value-at-risk&quot; rel=&quot;nofollow&quot;&gt;link&lt;/a&gt;, mVaR represents an empirical expression adjusted for skewness and kurtosis of the empirical distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As we know, empirical returns are commonly skewed and peaked, such that assuming normal distribution is a bad fit to estimate VaR. Therefore, mVaR adjusts for skewness and kurtosis to better reflect the empirical VaR.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2014-12-19T22:57:26.573" LastActivityDate="2014-12-19T22:57:26.573" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15936" PostTypeId="2" ParentId="15773" CreationDate="2014-12-19T22:54:01.617" Score="1" Body="&lt;p&gt;This is the general solution (where $C$ is the covariance matrix of returns):&lt;img src=&quot;https://i.stack.imgur.com/hLytk.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2015-06-25T08:21:56.160" LastActivityDate="2015-06-25T08:21:56.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15938" PostTypeId="2" ParentId="15916" CreationDate="2014-12-20T01:40:26.087" Score="4" Body="&lt;p&gt;First of all, if you are new in quantitative finance, I suggest to read the &lt;a href=&quot;http://raudys.com/kursas/Options,%20Futures%20and%20Other%20Derivatives%207th%20John%20Hull.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Hull'book&lt;/a&gt;, that's the basic resource for someone who wants to get fundamentals of the topic.&lt;/p&gt;&#xA;&lt;p&gt;Your evaluation is correct if you assume that linear relationship, but on real prices anything is linear; so, it depends on what you're looking for: If you have to conclude a project work at your university, it is fine, otherwise it is not.&lt;/p&gt;&#xA;&lt;p&gt;As regards to what you need for about risk-free rate estimation, each option trader has different opinions about the question you raised. For instance, Hull himself suggests using a fixed risk-free rate equal to 3% in the examples you'll read on the &lt;code&gt;.pdf&lt;/code&gt; file.&lt;/p&gt;&#xA;&lt;p&gt;In my humble opinion, you should use the return of the less risky government bond of the area you're studying, as the US T-Bill for North America option market or the German Bund return for the Euro option market.&lt;/p&gt;&#xA;&lt;p&gt;Moreover, there're a lot of models that deal with this topic and that estimate the proper risk free-rate. If you need particularly something for like that, I suggest looking for papers on &lt;a href=&quot;http://www.ssrn.com/en/&quot; rel=&quot;nofollow noreferrer&quot;&gt;SSRN&lt;/a&gt; or Google Scholar&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="44214" LastEditDate="2021-01-11T10:23:42.060" LastActivityDate="2021-01-11T10:23:42.060" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="15939" PostTypeId="1" AcceptedAnswerId="15940" CreationDate="2014-12-20T02:19:42.140" Score="1" ViewCount="422" Body="&lt;p&gt;How to use a value of WACC? I have calculated WACC of company to be 7%. What if company had smaller or bigger WACC? Which one would attract investment?&lt;/p&gt;&#xA;" OwnerUserId="7850" LastActivityDate="2014-12-20T06:54:31.493" Title="How to use WACC for investment?" Tags="&lt;finance&gt;&lt;capm&gt;&lt;wacc&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15940" PostTypeId="2" ParentId="15939" CreationDate="2014-12-20T06:54:31.493" Score="2" Body="&lt;p&gt;WACC is the weighted average cost of capital therefore from the business's standpoint, they would want to have a lower WACC because it is an average of the % cost of capital. From an investor's standpoint: it can be mixed. For a bondholder, they would want WACC to be a bit high but not by too much. For example, a higher WACC may mean the company is paying a higher % on the bonds. A higher WACC may sometimes mean the company has too much debt &amp;amp; therefore require a higher return on the bonds since it is now a bit risky. As the bondholder, a shareholders view may be mixed. A higher WACC may mean leverage for the company to expand so it may be attractive but if it is too high the profits the company makes will be used to pay off debt hence the $k-g$ in Gordon's Growth Model. But remember that bondholders get paid prior to shareholders! &lt;/p&gt;&#xA;" OwnerUserId="13428" LastActivityDate="2014-12-20T06:54:31.493" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15941" PostTypeId="2" ParentId="15932" CreationDate="2014-12-20T07:15:28.940" Score="2" Body="&lt;p&gt;To answer the first question: Typically a higher drawdown = more volatile but not all the time. For example, Fund B can have a high watermark of 30% return but end the period at 0% return &amp;amp; therefore have a MDD of -30%. Fund A can have a high watermark of ; 30% return ,but end the period at 15% return therefore have a MDD of -15%. Over this period, Fund B is more volatile since it went from +30% to 0. To answer the second question: in finance standard deviation will most typically = risk. A higher SD is more risky as a return will fluctuate more from its average. Therefore Fund B is more volatile/risky.&lt;/p&gt;&#xA;" OwnerUserId="13428" LastActivityDate="2014-12-20T07:15:28.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15943" PostTypeId="1" AcceptedAnswerId="15949" CreationDate="2014-12-20T09:26:38.680" Score="2" ViewCount="1277" Body="&lt;p&gt;Does anybody know any implied volatility calculator for VIX Options, possibily in Matlab? For Vanilla Options, I'm currently employing &lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/41473-fast-matrixwise-black-scholes-implied-volatility&quot; rel=&quot;nofollow&quot;&gt;this function&lt;/a&gt; which is very fast and reliable (much more than &lt;a href=&quot;http://it.mathworks.com/help/finance/blsimpv.html&quot; rel=&quot;nofollow&quot;&gt;blsimpv&lt;/a&gt;), but I have no idea (for the time being) If there's an analogous for Options on VIX index. By the way I'm still thinking whether I can use one of the these functions above to do this. This question is only for future reference.&#xA;Thanks for your time and attention.&lt;/p&gt;&#xA;" OwnerUserId="13528" LastEditorUserId="13528" LastEditDate="2014-12-20T22:12:14.383" LastActivityDate="2015-02-20T14:17:26.543" Title="VIX-implied Volatility calculator" Tags="&lt;implied-volatility&gt;&lt;reference-request&gt;&lt;matlab&gt;&lt;vix&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15944" PostTypeId="2" ParentId="3284" CreationDate="2014-12-20T12:03:07.683" Score="4" Body="&lt;p&gt;Just for some info, maybe useful for someone. I detected spikes in EODData 20yr NASDAQ data (3005 symbols) and found 647 spikes.&#xA;Yahoo has many of them detected/removed, so obviously they share the same source of data, at least for something.&#xA;And EODData IS NOT doing even simplest automated spike detection. My algorithm is about 20 lines of C# code, very simple. I don't get why they don't do it. Leaving such bad data is much worse than just removing it.&#xA;Someone says you get what you pay for, but they say at their site the spikes are detected/corrected, which is obviously not true.&lt;/p&gt;&#xA;" OwnerUserId="13880" LastActivityDate="2014-12-20T12:03:07.683" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15945" PostTypeId="1" AcceptedAnswerId="15968" CreationDate="2014-12-20T15:49:19.720" Score="4" ViewCount="1899" Body="&lt;p&gt;I would assume that day to day movement in stock can be accurately compared with the &lt;strong&gt;Adjusted Close Price&lt;/strong&gt; and not simply the &lt;strong&gt;Close Price&lt;/strong&gt;, taking into account Stock Splits Dividends etc. &lt;a href=&quot;http://www.investopedia.com/ask/answers/06/adjustedclosingprice.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.investopedia.com/ask/answers/06/adjustedclosingprice.asp&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Eg: For INFOSYS (INFY, NSE) &lt;a href=&quot;https://in.finance.yahoo.com/q/hp?s=INFY.NS&amp;amp;a=11&amp;amp;b=12&amp;amp;c=2002&amp;amp;d=11&amp;amp;e=20&amp;amp;f=2014&amp;amp;g=d&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://in.finance.yahoo.com/q/hp?s=INFY.NS&amp;amp;a=11&amp;amp;b=12&amp;amp;c=2002&amp;amp;d=11&amp;amp;e=20&amp;amp;f=2014&amp;amp;g=d&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The 2 day &lt;strong&gt;SMA (Simple Moving Average)&lt;/strong&gt; on 19 Dec 2014 is (1998.65 + 1965.90) / 2 = 1982.275 Which is what Yahoo Finance is giving me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the 2 Day SMA on 2nd Dec 2014 Should be = &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Adj Closing on 1st Dec + Adj Closing on 2nd Dec ) / 2 = (1087.46 + 2126.60)/2 = &lt;strong&gt;1606.73&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it is infact (According to Y! Finance)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Closing on 1st Dec + Closing on 2nd Dec ) / 2 = (2174.93 + 2126.60)/2 = &lt;strong&gt;2150.765&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the 2:1 Split has no effect on the SMA?&#xA;I have taken the example of 2 Day SMA for easy calculation but my question is for general MACD, Bollinger Bands, EMA etc.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Many people seem to point to bugs with Yahoo's implementation. I thought given Yahoo's reputation, I thought this was too far fetched but this almost confirms it &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/942/any-known-bugs-with-yahoo-finance-adjusted-close-data?rq=1&quot;&gt;Any known bugs with Yahoo Finance adjusted close data ?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still one thing remains, should one adjust for these splits manually then for Technical Indicators? If not wouldn't it cause a skew in the results?&lt;/p&gt;&#xA;" OwnerUserId="13881" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-01-15T14:24:41.697" Title="Aren't Technical Indicators calculated on Adjusted Close Price?" Tags="&lt;historical-data&gt;&lt;technicals&gt;&lt;moving-average&gt;&lt;adjusted&gt;&lt;yahoofinance&gt;" AnswerCount="1" CommentCount="9" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15946" PostTypeId="2" ParentId="15920" CreationDate="2014-12-20T17:14:45.380" Score="2" Body="&lt;p&gt;The mean equation specification for ARIMAX(8,0,0)(5,0,1)[7] (as in the R code above):&lt;br&gt;&#xA;$$&#xA;(1 - \phi_1L^1 - \ldots - \phi_8L^8)(1-\Phi_1L^7 - \Phi_2L^{14} - \ldots - \Phi_5L^{35})y_t = \beta x_t + (1 + \Theta_1L^7)\varepsilon_t&#xA;$$&#xA;where $x_t$ is the holiday dummy variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equivalent ARIMA fit in Matlab (+ GARCH and forecasting):  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% specify seasonal ARIMA(8,0,0)(5,0,1)[7]-GARCH(1,1) model&#xA;Md2 = arima('Constant', 0, 'D', 0, 'ARLags', [1,2,3,4,5,6,8],'SARLags', [7,14,21,28,35], 'SMALags', 7, 'Variance', garch(1,1))&#xA;&#xA;% estimate (use Holiday as exogenous variable)&#xA;[fitT_garch,~,LogLT_garch] = estimate(Md2, Price(44:end), 'X', Holiday, 'Y0', Price(1:43))&#xA;&#xA;% forecast 30 periods ahead&#xA;V = forecast(fitT_garch, 30, 'Y0', Price, 'X0', Holiday, 'XF', zeros(30, 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Matlab will need the first 43 observations as a presample response data.&lt;/p&gt;&#xA;" OwnerUserId="13866" LastEditorUserId="13866" LastEditDate="2014-12-20T21:41:06.207" LastActivityDate="2014-12-20T21:41:06.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15948" PostTypeId="1" AcceptedAnswerId="15950" CreationDate="2014-12-20T19:17:05.760" Score="6" ViewCount="286" Body="&lt;p&gt;Say that there are two time series of highly correlated stocks one of which is the driver and the second one follows the first one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What mathematical measure or formula would you use to identify which one is the driver and the follower?&lt;/p&gt;&#xA;" OwnerUserId="7268" LastEditorUserId="2587" LastEditDate="2015-01-02T11:22:14.323" LastActivityDate="2015-01-02T11:22:14.323" Title="Two correlated time series - driver and follower" Tags="&lt;time-series&gt;&lt;correlation&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15949" PostTypeId="2" ParentId="15943" CreationDate="2014-12-20T22:08:42.230" Score="0" Body="&lt;p&gt;Sorry, I should have though more before posting this question. By the way, the payoff of a call option on VIX index, priced at time $t$, with maturity at time $T$, is&#xA;\begin{equation}&#xA;(VIX_{T} - K)^+&#xA;\end{equation}&#xA;and since the time $t$ strike of a VIX futures with same maturity $T$ is &#xA;\begin{equation}&#xA;F_{t,T} = E^{Q}[VIX_T \big| \mathcal{F}_t]&#xA;\end{equation}&#xA;we have that&#xA;\begin{equation}&#xA;VIX_{T} \equiv F_{T,T}&#xA;\end{equation}&#xA;i.e. the VIX quotation at the maturity $T$ of the option, which is the only relevant for pricing it, is the same as the strike $F_{T,T}$ of a futures on VIX at the same time.&#xA;Therefore Black model for pricing futures options applies and you may evaluate the implied volatility $\hat{\sigma}$ solving &#xA;\begin{equation}&#xA;C^{Black-76}\Big(F_{t,T},T-t,r,K,\hat{\sigma}\Big) = C^{MARKET}_{t}(K,T)&#xA;\end{equation}&#xA;In matlab you may use &lt;a href=&quot;http://it.mathworks.com/help/finance/blkimpv.html?refresh=true&quot; rel=&quot;nofollow&quot;&gt;blkimpv&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="13528" LastEditorUserId="13528" LastEditDate="2015-02-20T14:17:26.543" LastActivityDate="2015-02-20T14:17:26.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15950" PostTypeId="2" ParentId="15948" CreationDate="2014-12-20T23:52:25.507" Score="3" Body="&lt;p&gt;What techniques have you tried? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If none, you could start with looking into &lt;a href=&quot;http://en.wikipedia.org/wiki/Granger_causality&quot; rel=&quot;nofollow&quot;&gt;Granger Causality @wiki&lt;/a&gt; by, perhaps, using this &lt;a href=&quot;http://www.wessa.net/rwasp_grangercausality.wasp&quot; rel=&quot;nofollow&quot;&gt;Bivariate Granger Causality R tool&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have to be quite careful in how you interpret the results, as there are constraints on what the possible factors of influence can be (when testing for Granger Causality).&lt;/p&gt;&#xA;" OwnerUserId="13657" LastEditorUserId="13657" LastEditDate="2014-12-21T00:02:23.827" LastActivityDate="2014-12-21T00:02:23.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15951" PostTypeId="2" ParentId="8896" CreationDate="2014-12-21T00:04:54.397" Score="6" Body="&lt;p&gt;possible update:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://pmorissette.github.io/bt/&quot; rel=&quot;noreferrer&quot;&gt;http://pmorissette.github.io/bt/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;based on&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://pmorissette.github.io/ffn/&quot; rel=&quot;noreferrer&quot;&gt;http://pmorissette.github.io/ffn/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;both were easily installed and somewhat usable for a novice.  would love some examples other that github documentatiion&lt;/p&gt;&#xA;" OwnerUserId="13884" LastActivityDate="2014-12-21T00:04:54.397" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15952" PostTypeId="2" ParentId="10920" CreationDate="2014-12-21T07:51:08.267" Score="3" Body="&lt;p&gt;well generally only the discrete bonds associated to the ends of the forward rates are modelled. to make these be martingales the drifts of the rates are chosen to make them driftless. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;for an extension to all bonds, see &#xA;&lt;a href=&quot;http://ssrn.com/abstract=1461285&quot; rel=&quot;nofollow&quot;&gt;http://ssrn.com/abstract=1461285&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2014-12-21T07:51:08.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15953" PostTypeId="1" AcceptedAnswerId="16013" CreationDate="2014-12-21T10:10:33.073" Score="3" ViewCount="1286" Body="&lt;p&gt;Consider an americal Call option on an underlying paying dividends. Then it is often argued that it is only optimal to exercise right before the dividend is paid out, otherwise one will not exercise. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now what if the dividend is continuous -can one then always see exercise?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, is a reasonable assumption that the above strategy is possible? I have little experience with how things actually works, but is it, in practice, known beforehand when lump sum dividends are paid out?&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2015-07-12T03:44:13.113" Title="Exercise on American call option and dividends" Tags="&lt;options&gt;&lt;option-strategies&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15954" PostTypeId="2" ParentId="15548" CreationDate="2014-12-21T17:38:39.093" Score="4" Body="&lt;p&gt;EDIT: I changed the answer to have it more on topic.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Summary&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;It boils down to &lt;a href=&quot;https://quant.stackexchange.com/a/15556/7405&quot;&gt;Mark Joshi&lt;/a&gt;'s answer. I wanted to add something more.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Answer&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;A probability measure $Q1$ and a numeraire $N1(t)$ are associated if all prices expressed relative to $N1$ are martingales under $Q1$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{price(t)}{N1(t)} = \mathbb{E}^{Q1} \left[ \left. \frac{price(T)}{N1(T)} \, \right| \, F_t\right] \quad \Rightarrow \quad price(t) = \mathbb{E}^{Q1} \left[ \left. \frac{N1(t) \cdot price(T)}{N1(T)} \, \right| \, F_t \right] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having another probability measure $Q2$ with associated numeraire $N2(t)$, then you can change the numeraire:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{array}{ccl}&#xA;price(t) &amp;amp; = &amp;amp; \mathbb{E}^{Q1} \left[ \left. \frac{N1(t) \cdot price(T)}{N1(T)} \, \right| \, F_t \right] = N1(t) \cdot \mathbb{E}^{Q1} \left[ \left. \frac{price(T)}{N1(T)} \, \right| \, F_t \right] \\&#xA;         &amp;amp; = &amp;amp; \mathbb{E}^{Q2} \left[ \left. \frac{N2(t) \cdot price(T)}{N2(T)} \, \right| \, F_t \right] = N2(t) \cdot \mathbb{E}^{Q2} \left[ \left. \frac{price(T)}{N2(T)} \, \right| \, F_t \right]&#xA;\end{array}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given information at time $t$, you are able to take out both numeraires at the same time since they are known.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you set&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;$Q1$ equal to the risk-neutral probability measure $QRN$ and $N1(t)$ equal to the risk-free asset, i.e. $N1(t) = B(t) = e^{\int_0^t r(s) ds}$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$Q2$ equal to the T-forward probability measure $QT$ and $N2(t)$ equal to the zero-coupon bond price with maturity $T$ computed at $t$, i.e. $N2(t) = P(t,T)$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;then you have the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{array}{ccl}&#xA;price(t) &amp;amp; = &amp;amp; \mathbb{E}^{QRN} \left[ \left. \frac{B(t) \cdot price(T)}{B(T)} \, \right| \, F_t \right] =  B(t) \cdot \mathbb{E}^{QRN} \left[ \left. \frac{price(T)}{B(T)} \, \right| \, F_t \right] \\&#xA;         &amp;amp; = &amp;amp; \mathbb{E}^{QT} \left[ \left. \frac{P(t, T) \cdot price(T)}{P(T, T)} \, \right| \, F_t \right] = P(t, T) \cdot \mathbb{E}^{QT} \left[ \left. \frac{price(T)}{P(T, T)} \, \right| \, F_t \right] \\&#xA;\end{array}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem under the risk-neutral measure is that $B(T)$ and $price(T)$ are not independent, especially for interest rate derivatives. However, $P(T,T)$ is perfectly known: it's just $1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;price(t) = P(t, T) \cdot \mathbb{E}^{QT} \left[ \left. \frac{price(T)}{P(T, T)} \, \right| \, F_t \right] = P(t, T) \cdot \mathbb{E}^{QT} \left[ \left. price(T) \, \right| \, F_t \right]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So with the change of numeraire you simplified a lot the computation, this is what you achieved.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In general, the change of numeraire is useful mainly for two reasons ($X_t$ is a process and $N_t$ is the numeraire):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;$X_t = \frac{tradable asset}{N_t}$ is a martingale under the new measure, i.e. you were not able to prove directly $X_t$'s martingality but you are able under the new measure with the new numeraire.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$\frac{X_t}{N_t}$ becomes a very easy quantity to compute; this is the case of the T-forward measure in the LIBOR market model, since the expectation of the discounted payoff in the risk-neutral world becomes a deterministic discount factor times the the expectation today of the payoff.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I add that a theorem guarantees that all results are the equal: if there exists a probability measure associated to a numeraire and all assets expressed under this measure are martingales, then any other (traded) asset can be used as numeraire and any numeraire choice will lead to the same price.&lt;/p&gt;&#xA;" OwnerUserId="7405" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2014-12-23T10:34:13.083" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15955" PostTypeId="2" ParentId="15916" CreationDate="2014-12-21T18:45:06.267" Score="2" Body="&lt;p&gt;For American options there is no parity rule, as I stated in the comments. However, there is the following disequality:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S_0 - D - K \leq C - P \leq S_0 - K e^{-rT}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $C$ and $P$ are prices of American call and put respectively, $S_0$ is the spot price today, $K$ is the strike price, $D$ is present value of the cash dividend (not as percentage), $r$ risk-free rate and $T$ the maturity (this is covered in problem 10.19 of &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/B007V5ISCO&quot; rel=&quot;nofollow&quot;&gt;Hull's book&lt;/a&gt;). This helps you find a lower bound for $r$, nothing more unfortunately.&lt;/p&gt;&#xA;" OwnerUserId="7405" LastActivityDate="2014-12-21T18:45:06.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15956" PostTypeId="1" AcceptedAnswerId="15962" CreationDate="2014-12-21T19:32:14.650" Score="8" ViewCount="1160" Body="&lt;p&gt;A silly question that is bugging me. I am working my way through Baxter and Rennie (again) and I am getting my wires crossed on the short rate models in particular the straight forward Ho and Lee analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So given the SDE (under the $\mathbb{Q}$ measure)&#xA;$$&#xA;dr_t = \sigma dW_t +\theta_t dt&#xA;$$&#xA;where $\theta_t$ is both deterministic and bounded and $\sigma$ is constant.&#xA;This becomes&#xA;$$&#xA;r_t = f(0,t) + \sigma W_t +\int_0^t \theta_s ds&#xA;$$&#xA;(I hope).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I compute the integral&#xA;$$&#xA;\int_t^T r_sds&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically it comes down to computing&#xA;$$&#xA;\int_t^T W_sds&#xA;$$&#xA;and&#xA;$$&#xA;\int_t^T \int_0^s \theta_k dk.&#xA;$$&#xA;From first integral is just book work (though it be nice to see a derivation here other than by parts?)&#xA;It is the later which I am not sure about, as the result is apparently &#xA;$$&#xA;\int_t^T (T-s)\theta_s ds&#xA;$$&#xA;Which I am puzzled by? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\textbf{edit}$&#xA;Actually an important piece of information is that I am trying to compute &#xA;$$&#xA;-\log\mathbb{E}_{\mathbb{Q}}\left(\mathrm{e}^{-\int_t^T r_sds}\vert r_t = x\right)=x(T-t) -\frac{1}{6}\sigma^2 (T-t)^3 + \int_0^T (T-s)\theta_sds &#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="11834" LastEditorUserId="848" LastEditDate="2014-12-22T07:49:50.000" LastActivityDate="2014-12-22T15:50:44.127" Title="Ho and lee derivation for short rates model" Tags="&lt;stochastic-calculus&gt;&lt;short-rate&gt;&lt;heath-jarrow-morton&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15957" PostTypeId="1" AcceptedAnswerId="15959" CreationDate="2014-12-21T23:04:51.893" Score="9" ViewCount="1270" Body="&lt;p&gt;What are some of the general rules to decide whether a particular factor is a &quot;risk factor&quot; or &quot;anomaly?&quot; Naively speaking, can't you put any anomaly factor on the right-hand-side of the regression and call it a risk factor? For example, momentum has been considered an anomaly in the context of the Fama-French 3-factor model, so Carhart included it in the RHS to create a 4-factor model, yet the latest FF 5-factor model does not include momentum.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A related question is: What distinguishes the 3/4/5-factors in the Fama-French/Carhart models from the rest of the factors in the factor zoo?&lt;/p&gt;&#xA;" OwnerDisplayName="user2163" LastEditorUserId="12" LastEditDate="2014-12-22T08:09:39.200" LastActivityDate="2014-12-22T08:09:39.200" Title="Distinction between &quot;risk factor&quot; and &quot;market anomaly&quot;" Tags="&lt;factor-models&gt;&lt;anomalies&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15959" PostTypeId="2" ParentId="15957" CreationDate="2014-12-22T07:49:05.857" Score="5" Body="&lt;p&gt;I would say the main difference between &quot;risk factor&quot; and &quot;market anomaly&quot; is that people demand to be compensated for risk and because there are different kinds of risks these can be systematized into risk factors whereas anomalies are results of behavioral biases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another big difference would be that risk factors will stay because of the need for compensation whereas anomalies will be arbitraged away in the long run.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I agree that both concepts are not completely orthogonal but that could be because scientists had (and still have) to find systematizations that make sense of the data so that certain ways of organizing the financial world become obsolete in later and more sophisticated models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A good starting point for this way of thinking is Andrew Ang's new book about factor investing - you can find out more here (and there is even a short video which gives you a nice intuition by comparing factors to nutrients in food):&lt;br&gt;&#xA;&lt;a href=&quot;http://factorinvestingbook.com/&quot; rel=&quot;noreferrer&quot;&gt;http://factorinvestingbook.com/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2014-12-22T07:49:05.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15960" PostTypeId="2" ParentId="15957" CreationDate="2014-12-22T08:04:10.960" Score="3" Body="&lt;p&gt;Nice question! I don’t have a precise answer to it but I will try somehow to give you my thoughts. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think it depends a lot whether you have in mind an &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/0022053176900466&quot; rel=&quot;nofollow&quot;&gt;APT&lt;/a&gt; or an &lt;a href=&quot;http://www.people.hbs.edu/rmerton/Intertemporal%20Capital%20Asset%20Pricing%20Model.pdf&quot; rel=&quot;nofollow&quot;&gt;ICAPM&lt;/a&gt; as explained in &lt;a href=&quot;http://www.jstor.org/discover/2331355?sid=21104915501661&amp;amp;uid=2129&amp;amp;uid=2&amp;amp;uid=70&amp;amp;uid=4&quot; rel=&quot;nofollow&quot;&gt;this article by Eugene Fama&lt;/a&gt;. The APT is really agnostic regarding the risk premia and the factors, and basically the only prediction is that alphas are going to vanish thanks to arbitrage between a diversified portfolio and a risk free bond: what is crucial is that there is no theory behind the origins of the factors.&#xA;On the other hand, if you have in mind an ICAPM extra factors should hedge investors against some state variable governing the stochastic investment opportunity set they are going to face in the future. So, in this case, we should somehow justify why the factor is able to hedge you against some risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fama and French try to give some economic argument behind their factors but they are not convincing, that’s why you should probably see their model as just an APT. The same is true for Carhart’s model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the difference between factor and anomaly, there is clearly nothing that prevents you to put the extra return of an “anomaly” on the right hand side and check whether it is priced if you have in mind an APT. On the other hand, to do the same with an ICAPM you should show that your anomaly is somehow linked to predictability, that it hedges some systemic risk or, possibly, invoke the &lt;a href=&quot;http://www.ceistorvergata.it/conferenze&amp;amp;convegni/banking&amp;amp;finance/XIII_conference/2dicembre/Robottimimicking.pdf&quot; rel=&quot;nofollow&quot;&gt;factor mimicking theorem&lt;/a&gt; and convince people your factor is nothing more than the projection of the true SDF on the payoff space. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;All in all, there has been some movement recently regarding these topics. In my opinion, the most convincing ICAPM that has been recently proposed is the one by &lt;a href=&quot;http://www.newyorkfed.org/research/staff_reports/sr464.pdf&quot; rel=&quot;nofollow&quot;&gt;Adrian, Etula and Muir&lt;/a&gt;, published in the last issue of the Journal of Finance, where the pricing factor is the innovation in broker-dealers leverage, mimicking for the risk of fire sales due to the prociclicality of Broker-Dealers’ leverage.  &lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2014-12-22T08:04:10.960" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15961" PostTypeId="1" CreationDate="2014-12-22T11:09:13.247" Score="8" ViewCount="742" Body="&lt;p&gt;Let's say I have two futures contract $F_1(0,T)$ and $F_2(0,T)$ on two different correlated underlyings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I assume that both underlying follow a GBM with volatility $\sigma_1$ and $\sigma_2$ respectively, and their return are correlated by $\rho$, is there a closed-form formula I can use to price an European option on the spread $X_{1,2} = \max( F_1(S,T) - F_2(S,T), 0 )$ at some expiry date $S \leq T$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise, how do we usually proceedto price these things? Monte-Carlo using risk-neutral dynamics and discounting payoffs?&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2018-08-03T07:40:45.967" Title="How to price a futures spread option?" Tags="&lt;option-pricing&gt;&lt;futures&gt;&lt;spread-options&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15962" PostTypeId="2" ParentId="15956" CreationDate="2014-12-22T15:50:44.127" Score="10" Body="&lt;p&gt;For any $s \geq t$, note that&#xA;\begin{align*}&#xA;r_s = r_t + \sigma\int_t^s dW_u + \int_t^s \theta_u du.&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;\int_t^T r_s ds &amp;amp;= (T-t)r_t + \sigma\int_t^T\int_t^s dW_u ds + \int_t^T \int_t^s\theta_u du ds\\&#xA;&amp;amp;=(T-t)r_t + \sigma\int_t^T\int_u^T ds\, dW_u +\int_t^T\int_u^T\theta_u ds du\\&#xA;&amp;amp;=(T-t)r_t + \sigma\int_t^T (T-u)dW_u +\int_t^T (T-u) \theta_u du.&#xA;\end{align*}&#xA;Moreover,&#xA;\begin{align*}&#xA;E_Q\Big(e^{-\int_t^T r_s ds} \mid r_t \Big) &amp;amp;= e^{-(T-t)r_t - \int_t^T (T-u) \theta_u du}E_Q\Big(e^{-\sigma\int_t^T (T-u)dW_u} \mid r_t\Big)\\&#xA;&amp;amp;=e^{-(T-t)r_t - \int_t^T (T-u) \theta_u du}e^{\frac{\sigma^2}{2}\int_t^T(T-u)^2 du} \\&#xA;&amp;amp;=e^{-(T-t)r_t - \int_t^T (T-u)\theta_u du + \frac{\sigma^2}{6}(T-t)^3}.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;-\ln E_Q\Big(e^{-\int_t^T r_s ds} \mid r_t \Big) = (T-t)r_t + \int_t^T (T-u)\theta_u du - \frac{\sigma^2}{6}(T-t)^3.&#xA;\end{align*}&#xA;If you really need the integral $\int_t^T\int_0^s \theta_u du ds$, you can proceed as follows: &#xA;\begin{align*}&#xA;\int_t^T\int_0^s \theta_u du ds  &amp;amp;= \int_t^T\int_0^t \theta_u du ds + \int_t^T\int_t^s \theta_u du ds \\&#xA;&amp;amp;=(T-t)\int_0^t \theta_u ds + \int_t^T\int_u^T \theta_u ds du\\&#xA;&amp;amp;=(T-t)\int_0^t \theta_u ds + \int_t^T (T-u)\theta_u du.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2014-12-22T15:50:44.127" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15964" PostTypeId="1" CreationDate="2014-12-22T20:37:37.830" Score="2" ViewCount="1483" Body="&lt;p&gt;I need help about portfolio optimization in R. I have inverted matrix and I want to use it as an input in portfolio optimization. It was non-positive definite before I have handled it. In portfolio selection theory we need inverted matrix I have already have it. The problem for me that to impose a non-negativity constraint (short sale prohibited) on weights. In traditional optimization packages we have to put covariance matrix and it solves. I do not want cope with the covariance matrix by using different technique. I have already inverted matrix. The aim for me to solve portfolio selection codes with putting inverted covariance matrix(precision matrix) under non-negativity constraint (each element of weight vector must be positive)&#xA;Which method should I use I do not know. If you help me, I would be very happy..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my work so far:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to construct a portfolio weight vector to minimize the variance of the returns.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;       w ̂=argmin w'Σ w&#xA;s. t.  w'I = 1           #weights sum up to 1                                                 &#xA;       w'μ=ρ             #target expected return&#xA;       w≥0               #non-negativity(short-sale) constraint&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where w is the vector of weights, Σ covariance matrix.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;optimization&amp;lt;-function(returns) {&#xA;  p &amp;lt;- ncol(x)                    #number of assets&#xA;  n &amp;lt;- nrow(x)                    #number of observations&#xA;  x &amp;lt;- matrix(data$return,n,assets)&#xA;  mean &amp;lt;- colMeans(na.rm=FALSE,x)&#xA;  M &amp;lt;- as.integer(10)             #nuber of ports on the eff.front.&#xA;  S &amp;lt;- cov(x)                     #covariance matrix&#xA;  Rmax&amp;lt;- 0.01                     #max monthly return value&#xA;  Dmat   &amp;lt;- solve(S)              #inverse of covariance matrix&#xA;  u &amp;lt;- rep(1,p)                   #vector of ones&#xA;&#xA;  These codes are for the Lagrange solutions&#xA;&#xA;  a&amp;lt;- matrix(rep(0,4), nrow=2)    &#xA;  a[1,1] &amp;lt;- t(u)%*% Dmat %*%u &#xA;  a[1,2] &amp;lt;- t(mean)%*%Dmat%*%u&#xA;  a[2,1] &amp;lt;- a[1,2] &#xA;  a[2,2] &amp;lt;- t(mean)%*%Dmat%*%mean &#xA;  d &amp;lt;- a[1,1]*a[2,2]-a[1,2]*a[1,2] &#xA;  f &amp;lt;- (Dmat%*%(a[2,2]*u-a[1,2]*mean))/d &#xA;  g &amp;lt;- (Dmat%*%(-a[1,2]*u+a[1,1]*mean))/d&#xA;  r &amp;lt;- seq(0, Rmax, length=M)&#xA;  w &amp;lt;- matrix((rep(0, p*M)), nrow=p)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried to find non-negative weights using the codes below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for(i in 1:M) { w[,i] = f+r[i]*g                    #portfolio weights &#xA;      if (w[,i] &amp;lt;0) {w[,i]=0} else {w[,i]=w[,i]}&#xA;    } &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also, I tried to make a loop using 'while' function in R.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;while (w&amp;gt; 0) &#xA;  { for(i in 1:M) { w[,i] = f+r[i]*g }&#xA;  print(w)                     &#xA;  } &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, I could not get the positive weights. Is there another solution to get positive weights?&lt;/p&gt;&#xA;" OwnerUserId="13895" LastEditorUserId="848" LastEditDate="2014-12-23T07:45:06.687" LastActivityDate="2015-01-02T01:44:04.580" Title="short-sale constraint with nonpositive-definite matrix in portfolio optimization" Tags="&lt;r&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;&lt;covariance-matrix&gt;&lt;markowitz&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15965" PostTypeId="2" ParentId="15961" CreationDate="2014-12-22T21:04:11.777" Score="-1" Body="&lt;p&gt;You could take a look at this, if you have not already &lt;a href=&quot;http://ms.mcmaster.ca/tom/HurdZhouSpreadoptionsSIAM.pdf&quot; rel=&quot;nofollow&quot;&gt;Fast Fourier transform for pricing spread options&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The classic reference on this is a paper by Carr and Madan, reference number 4 in that document.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is not a closed form solution, per se, but the method is quick and easy to implement.&lt;/p&gt;&#xA;" OwnerUserId="13657" LastActivityDate="2014-12-22T21:04:11.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15968" PostTypeId="2" ParentId="15945" CreationDate="2014-12-23T08:28:45.073" Score="4" Body="&lt;p&gt;As can be seen from this example from Yahoo!Finance this should not happen (click on &quot;+ The adjusted close&quot;):&lt;br&gt;&#xA;&lt;a href=&quot;https://help.yahoo.com/kb/finance/SLN2311.html?impressions=true&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://help.yahoo.com/kb/finance/SLN2311.html?impressions=true&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another more complete example can be found here:&lt;br&gt;&#xA;&lt;a href=&quot;http://luminouslogic.com/how-to-normalize-historical-data-for-splits-dividends-etc.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://luminouslogic.com/how-to-normalize-historical-data-for-splits-dividends-etc.htm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my explanation is that this is a glitch in the data... remember: Yahoo!Finance is free and they sometimes don't have the highest quality!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An alternative would be Google Finance but they don't provide adjusted data at all. Yet from these data here it can be seen that it must be a glitch in the Yahoo adjusted data:&lt;br&gt;&#xA;&lt;a href=&quot;https://www.google.com/finance/historical?q=NSE%3AINFY&amp;amp;ei=FCmZVPH9OeeqwAPf_IGwBg&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.google.com/finance/historical?q=NSE%3AINFY&amp;amp;ei=FCmZVPH9OeeqwAPf_IGwBg&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another helpful discussion on this issue can be found here: &lt;a href=&quot;https://quant.stackexchange.com/questions/7216/daily-returns-using-adjusted-close&quot;&gt;Daily returns using adjusted close&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer the question whether a manual adjustment should be made: You should always make an apples to apples comparison. If that requires manual intervention: so be it.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2014-12-23T15:01:21.363" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15969" PostTypeId="1" CreationDate="2014-12-23T09:17:26.063" Score="3" ViewCount="1127" Body="&lt;p&gt;Would anyone have a code (pref. Matlab or R) for any type of estimation (QML, GMM) not using option prices of a stochastic volatility model driven by a CIR process described below?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;dS_t = \mu dt + \sqrt{v_t} dW_t^1&#xA;\end{equation} &#xA;\begin{equation}&#xA;dv_t = \kappa (\theta - v_t) dt + \sigma \sqrt{v_t} dW^2_t&#xA;\end{equation}&#xA;such that $dW_{t}^{1}\,dW_{t}^{2}=\rho dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just need to cross-check my results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="13898" LastEditorDisplayName="user16651" LastEditDate="2015-07-04T08:17:53.560" LastActivityDate="2015-11-07T10:42:55.093" Title="Stochastic Volatility CIR estimation" Tags="&lt;r&gt;&lt;stochastic-volatility&gt;&lt;estimation&gt;&lt;matlab&gt;" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="15970" PostTypeId="1" AcceptedAnswerId="15974" CreationDate="2014-12-23T11:46:31.637" Score="4" ViewCount="1243" Body="&lt;p&gt;Following Gather (the volatility surface, chapter 2) we assume the following process:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dS_t = S_t(\mu_t dt+\sqrt{\nu_t}dZ^1_t)$$&#xA;$$ d\nu_t= -\lambda(\nu_t-\bar{\nu})dt+\eta\sqrt{\nu_t}dZ^2_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Z^1,Z^2$ are two brownian mortion such that $d\langle Z^1,Z^2\rangle_t= \rho dt$. Using the general valuation pde for a stochastic volatility model we get for this process the following pde:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\partial V}{\partial t} +\frac{1}{2}\frac{\partial^2 V}{\partial S^2}\nu S^2+\rho\eta\nu S \frac{\partial^2 V}{\partial \nu \partial S} + \frac{1}{2}\eta^2\nu\frac{\partial^2 V}{\partial \nu^2} + rS \frac{\partial V}{\partial S}-rV=\lambda(\nu-\bar{\nu})\frac{V}{\partial \nu}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now by introducing $F_{t,T}$ the time $T$ forward of the stock index, $x:=\log{(\frac{F_{t,T}}{K})}$, where $K$ denotes the strike space, $\tau:=T-t$ and $C$ the future value to expiration of the European option prices (rather than its value today, $V$) the above pde should transform to &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$-\frac{\partial C}{\partial \tau}+\frac{1}{2}\nu C_{11}-\frac{1}{2}\nu C_1+\frac{1}{2}\eta^2\nu C_{22}+\rho\eta\nu C_{12} - \lambda(\nu-\bar{\nu})=0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the subscripts $1,2$ refer to differentiation w.r.t $x$ and $\nu$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have $V(S,\nu,t)=C(f(S),\nu,g(t))$, where $g(t):=\tau=T-t$. About the form of $f$ I'm unsure. Using this we get for the first term:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\partial V}{\partial t} = \frac{\partial C}{\partial \tau} \frac{\tau}{t}=-\frac{\partial C}{\partial \tau}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For $f$ we know $f(S)=\log{\frac{F_{t,T}(S)}{K}}$ ( I suppress the time subsctript on $t$). I've tried $F_{t,T}=S_t\exp{\int_t^T\mu_sds}$, with $\mu_s\equiv 0$. However I do not see how we can get this PDE in terms of $C$. It would be great if someone could explain the following two:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What is meant by future value to expiration?  &lt;/li&gt;&#xA;&lt;li&gt;how is $C$ related to $V$ in functional form?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="17133" LastEditorUserId="17133" LastEditDate="2014-12-23T15:54:08.590" LastActivityDate="2014-12-23T20:49:06.747" Title="derivation of heston pde in gatheral" Tags="&lt;mathematics&gt;&lt;stochastic-volatility&gt;&lt;heston&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15973" PostTypeId="1" CreationDate="2014-12-23T18:41:20.497" Score="1" ViewCount="226" Body="&lt;p&gt;I have a scenario in which a FIX server will send to multiple clients. I have found examples in which this is done by sending to each session round-robin fashion however, is there any facility in FIX that allows what might be called multicasting? I.e. all clients subscribe, for example, to a shared session.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks.&lt;/p&gt;&#xA;" OwnerUserId="13902" LastActivityDate="2015-01-02T20:50:52.087" Title="Multicasting with FIX" Tags="&lt;fix&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15974" PostTypeId="2" ParentId="15970" CreationDate="2014-12-23T20:49:06.747" Score="5" Body="&lt;p&gt;1) Gatheral expresses everything in forward terms: forward value of the spot and of the call. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider an asset $A$. You need to hold $A$ at time $T$ but since you don't need it now you don't want to buy it now. Instead you enter a forward contract with someone that says that at time $T$ you will pay the amount $K$ and get the asset in exchange. What should be the strike $K$ for the deal to be fair to both parties? By definition this is the $T$-forward price of $A$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a tradeable asset with no dividend or convenience yield, the price is&lt;br&gt;&#xA;$$&#xA;   F^T_t = S_te^{r(T-t)}&#xA;$$&#xA;Indeed the seller in the forward contract can borrow $S_t$ at the risk free rate, buy the asset and then at $T$, receive $K$, deliver the asset and payback what he borrowed + interest $S_te^{r(T-t)}$. So he started with 0 and ends up with $K - S_te^{r(T-t)}$. So by absence of arbitrage we must have $K = S_te^{r(T-t)}$. (In the case of dividend yield $q$, you just have to replace $r$ by $r-q$). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, for any $t\leq T$, &#xA;$$&#xA;  \textrm{present value}  = E^{\mathbb{Q}}_t[e^{-\int_t^Tr_s ds}g(S_T)] = P(t,T)E^{\mathbb{Q}_T}_t[g(S_T)] = P(t,T) \times \textrm{forward value}&#xA;$$&#xA;where $P(t,T) = E^{\mathbb{Q}}_t[e^{-\int_t^Tr_s ds}]$ is the price of the ZCB with maturity $T$. With deterministic interest rate this is just $P(t,T) = e^{-r(T-t)}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Since $C$ corresponds to the undiscounted price of the call: &#xA;$$&#xA;   V(t,S,\nu) = e^{-r(T-t)}C(T-t,\log(Se^{(r-q)(T-t)}/K),\nu)&#xA;$$&#xA;Reasonning in forward terms allows to separate interest rate considerations from the rest and often simplify PDE's by making discounting terms disappear. &lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2014-12-23T20:49:06.747" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15975" PostTypeId="2" ParentId="15920" CreationDate="2014-12-23T22:00:14.847" Score="0" Body="&lt;p&gt;Use the R package fgarch. Hope this is helpful to you. &lt;/p&gt;&#xA;" OwnerUserId="6661" LastActivityDate="2014-12-23T22:00:14.847" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15976" PostTypeId="1" AcceptedAnswerId="15978" CreationDate="2014-12-24T00:45:09.577" Score="4" ViewCount="2455" Body="&lt;p&gt;I'm looking at these data: &#xA;call and put &lt;a href=&quot;http://www.cboe.com/products/indexopts/vixoptions_spec.aspx&quot; rel=&quot;nofollow&quot;&gt;options on VIX&lt;/a&gt;. I'm interested in daily quotes (all strikes and maturities) for - at least - 2009/10. Could you list link of possible sources? and possibily esperience-based download instructons?. Most sources I've already checked let you download VIX options data only in addition to S&amp;amp;P500 options data, which I do not need. Thanks in Advance.&#xA;Any suggestion is more than welcome.&lt;/p&gt;&#xA;" OwnerUserId="13528" LastActivityDate="2018-12-05T08:30:22.503" Title="VIX options historical data" Tags="&lt;historical-data&gt;&lt;vix&gt;" AnswerCount="3" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="15978" PostTypeId="2" ParentId="15976" CreationDate="2014-12-24T13:52:11.570" Score="5" Body="&lt;p&gt;Unfortunately, there is no publicly available reliable source for historical VIX options data. Also, probably, in addition to VIX options you may need corresponding underlying futures data to do analysis (not only the corresponding VIX spot price).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can always go with an established commercial provider, of course.&lt;/p&gt;&#xA;" OwnerUserId="2909" LastActivityDate="2014-12-24T13:52:11.570" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15979" PostTypeId="2" ParentId="15482" CreationDate="2014-12-24T14:02:42.990" Score="2" Body="&lt;p&gt;As you have already shown above,&#xA;\begin{align*}&#xA;1 = E\Big(e^{-\theta y - \frac{1}{2}\theta^2 \tau_{-y} }1_{\tau_{-y}&amp;lt;\tau_x} \Big)+E\Big(e^{\theta x - \frac{1}{2}\theta^2 \tau_{x} }1_{\tau_x &amp;lt; \tau_{-y}} \Big).&#xA;\end{align*}&#xA;Set $\theta = \sqrt{2u}$, we obtain that&#xA;\begin{align*}&#xA;1 = E\Big(e^{-\sqrt{2u}y - u \tau_{-y} }1_{\tau_{-y}&amp;lt;\tau_x} \Big)+E\Big(e^{\sqrt{2u} x - u \tau_{x} }1_{\tau_x &amp;lt; \tau_{-y}} \Big),&#xA;\end{align*}&#xA;that is,&#xA;\begin{align*}&#xA;e^{\sqrt{2u}y} = E\Big(e^{- u \tau_{-y} }1_{\tau_{-y}&amp;lt;\tau_x} \Big)+e^{\sqrt{2u} (x+y)}E\Big(e^{ - u \tau_{x} }1_{\tau_x &amp;lt; \tau_{-y}} \Big).&#xA;\end{align*}&#xA;On the other hand, by setting $\theta = -\sqrt{2u}$, we obtain that&#xA;\begin{align*}&#xA;1 = E\Big(e^{\sqrt{2u}y - u \tau_{-y} }1_{\tau_{-y}&amp;lt;\tau_x} \Big)+E\Big(e^{-\sqrt{2u} x - u \tau_{x} }1_{\tau_x &amp;lt; \tau_{-y}} \Big),&#xA;\end{align*}&#xA;that is,&#xA;\begin{align*}&#xA;e^{-\sqrt{2u}y} = E\Big(e^{- u \tau_{-y} }1_{\tau_{-y}&amp;lt;\tau_x} \Big)+e^{-\sqrt{2u} (x+y)}E\Big(e^{ - u \tau_{x} }1_{\tau_x &amp;lt; \tau_{-y}} \Big).&#xA;\end{align*}&#xA;Consequently,&#xA;\begin{align*}&#xA;e^{\sqrt{2u}y} - e^{-\sqrt{2u}y} = \big[e^{\sqrt{2u} (x+y)} - e^{-\sqrt{2u} (x+y)} \big]E\Big(e^{ - u \tau_{x} }1_{\tau_x &amp;lt; \tau_{-y}} \Big).&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;E\Big(e^{ - u \tau_{x} }1_{\tau_x &amp;lt; \tau_{-y}} \Big) = \frac{\sinh (\sqrt{2u}y)}{\sinh \big(\sqrt{2u} (x+y) \big)}.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2014-12-24T14:29:01.717" LastActivityDate="2014-12-24T14:29:01.717" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="15980" PostTypeId="1" CreationDate="2014-12-24T20:43:23.673" Score="3" ViewCount="66" Body="&lt;p&gt;The question goes as follows:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Consider a life annuity contract that pays the holder a yearly fixed&#xA;  amount from a certain time until the death of the holder of the&#xA;  contract.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(a) Suppose the value today of the random cash flow $C_K$ in k years&#xA;  is $E[C_k]e^{-r_kk}$, where $r_k$ is the current $k$-year zero rate.&#xA;  All the zero rates are assumed to be known. Determine an expression&#xA;  for the current value of an annuity whose holder is x years old, the&#xA;  annuity pays the yearly amount $c$ starting from $y$ years from today&#xA;  and the current mortality rate is given by the Gompertz-Makeham&#xA;  formula:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$\mu_0(x)=A+R^{\alpha x}$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So if I've understood correctly $C_k$ can be seen as a random variable and it's value can be described as mentioned above. This is some what confusing because I feel that it would be more logical to describe $E[C_k]e^{-r_kk}$ as the liability, which could be described a random variable...anyways.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover the holder of age x gets paid a yearly amount $c$ thus the value of the liability can be described as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E[L]=\sum^{\infty}_{k=y}E[C_k]e^{-r_kk}=\sum^{\infty}_{k=y}ce^{-r_kk}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is obviously if you assume that the holder survives to infinity which makes no sense. Thus applying a probability that the holder dies after a certain payment time $k$ seems logical. Thus:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E[L]=\sum^{\infty}_{k=y}ce^{-r_kk}P(\tau&amp;gt;k)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or if one wants to be more correct and thorough one can reason in the following way:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume that the liability is the constant pay $c$ if the holder dies after a certain payment $k$ leading to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$L=\sum^{\infty}_{k=y}C_ke^{-r_kk}I(\tau&amp;gt;k)$, where I is the indicator function. The value of $L$ thus becomes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E[L]=\sum^{\infty}_{k=y}ce^{-r_kk}P(\tau&amp;gt;k)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is where I get stuck. In the solution they define the probability $P(\tau&amp;gt;k)$ as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P(\tau&amp;gt;k)=e^{-\int^{k}_0(A+Re^{\alpha(x+u)})du}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't really follow how they manage to define the probability. There is an example in the book but they jump over the explanation. It's probably something simple but I fail to see what how.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any form of help is appreciated.&lt;/p&gt;&#xA;" OwnerUserId="13770" LastActivityDate="2014-12-24T20:43:23.673" Title="Life annuity and the use of Gompertz-Makeham" Tags="&lt;insurance&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15981" PostTypeId="1" AcceptedAnswerId="15982" CreationDate="2014-12-25T01:56:20.313" Score="0" ViewCount="4059" Body="&lt;p&gt;I am reading the CFA L2 curriculum Bond Analysis section and it mentions that for a bond trading at par, the maturity-matched rate is the only rate that affects the bond's value and therefore the key rate duration for all the other rates except for the maturity-matched rate is zero. I am not getting the intuition behind this. How is it possible that shocks to any other rates won't matter?&lt;/p&gt;&#xA;" OwnerUserId="11815" LastActivityDate="2014-12-25T03:32:21.700" Title="Key rate duration - Bond trading at par" Tags="&lt;interest-rates&gt;&lt;duration&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15982" PostTypeId="2" ParentId="15981" CreationDate="2014-12-25T03:32:21.700" Score="0" Body="&lt;p&gt;Yeah, this is a very good question, and I was actually quite confused about it as well when I first started practicing fixed income.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The key thing to remember is that when we shift the par yield curve, the resulting yield curve is still ASSUMED to be a par curve!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say the current 10-year par yield is 5%, and we now apply a parallel shift of 100bp to the entire par curve. You may think that the yield of the current 10-year par bond (5% coupon) has increased from 5% to 6%. That's not right! In reality, we now have a BRAND NEW 10-year par bond, whose coupon rate and yield are 6%. In fact, we can show that the yield of the original 5% par bond increased by more than 100bp (if the curve is upward sloping).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once this has cleared up, we can address the key rate duration question. Let's say the key rates are 2y, 5y, 10y, and 30y, and we now apply a 5-year key rate shift. How much would the 10-year par bond price change? The answer is exactly 0. After applying the 5-year key rate shift, the 10-year par yield hasn't changed. And since the new curve is still a par curve (BY ASSUMPTION), it must be true that the price of the 10-year par bond is still par (i.e., unchanged).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're into the mathematics, you can actually show this – when the 5-year key rate shift is applied to the par curve, the 5-year zero coupon rate actually increases a bit MORE than the 5-year par yield, while the 10-year zero coupon rate actually DECLINES (even though the 10-year par yield is unchanged). So some of the cash flows of the 10-year par bond get a lower PV, but others get a higher PV. The net change is 0.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2014-12-25T03:32:21.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15983" PostTypeId="1" CreationDate="2014-12-25T04:12:23.053" Score="7" ViewCount="163" Body="&lt;p&gt;I am currently working on a project where I have analyzed a certain category of fixd income instruments, and I now have the gross aggregate yield as well as the theoretical gross-aggregate default-free yield. Taking the difference of these two yields leaves me with what some people call the &quot;loss rate&quot; of the investment. My question is that if I wanted to model these investments as volatile using that information, what is the best way to do it/best distribution? I realize that the probability of default already factors into the risky yield, but I want something a bit better than that. For example, if I could use the mean yield and the loss rate to construct some sort of simple distribution, I would ideally be able to calculate the variance and therefore be able to give some sort of risk-adjusted performance measure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It does not have to be fancy at all, and I can assume that all defaults are uncorrelated. What should I use? The exponential distribution? Or a gamma distribution? I think the gamma distribution or beta distribution might be best but I can't quite remember how to translate the mean return and loss rate to the parameters of those distributions. Any help would be greatly appreciated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, I have modeled that actual yield from my investments as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Y = Y_{df}-Y_L$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Y_{df}$ is the default-free yield, and $Y_L$ is the loss in yield due to defaults. So the question really amounts to modeling the distribution off losses, i.e. the distribution of $Y_L$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&#xA;For example, if I assume that the probability of default and the loss given default were independent, I could write the expected loss in yield as the (probability of default)*(loss in yield due to default). Then if I further assume defaults are uncorrelated (an assumtion which I hope to remove but will use until I can get the bare bones model in place), I think I could model the expected losses as some sort of decay process. In this case I think I could simply use an exponential distribution for the number of defaults, which I think I can calibrate if I know the probability of default and the expected loss rate. But I am not sure if this is the best model or which model would allow me to get around those simplifying assumptions, particularly the one where the loss given default is independent of the probability of default. &lt;/p&gt;&#xA;" OwnerUserId="12162" LastEditorUserId="12162" LastEditDate="2015-01-02T17:45:53.177" LastActivityDate="2016-02-26T23:40:15.220" Title="Best simplified way to model volatility in returns of an investment in a risky fixed income asset" Tags="&lt;credit&gt;&lt;default&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15984" PostTypeId="2" ParentId="15973" CreationDate="2014-12-25T06:44:11.513" Score="2" Body="&lt;p&gt;FIX is not a multicast protocol so if you're talking about genuine FIX sessions with heartbeats and resend requests then no, you can't multicast that.  If you just want to FIX encode some streaming data and multicast it, sure you can do that. &#xA;&lt;a href=&quot;http://www.dest-unreach.org/socat/doc/socat-multicast.html&quot; rel=&quot;nofollow&quot;&gt;socat&lt;/a&gt;  makes multicasting easy.&lt;/p&gt;&#xA;" OwnerUserId="13905" LastActivityDate="2014-12-25T06:44:11.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15985" PostTypeId="1" AcceptedAnswerId="16001" CreationDate="2014-12-25T09:03:39.840" Score="5" ViewCount="3731" Body="&lt;p&gt;Does anyone know of any papers about credit rating development or probability of default estimation done based on financial ratios that also include methodology and maybe good/bad criteria?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like they have some financial ratios and then they have some methodology that reduces it to a few financial ratios and then they make a regression model out of it or something.&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="7788" LastEditDate="2014-12-25T13:43:58.557" LastActivityDate="2015-01-02T01:15:58.893" Title="Credit Rating or Probability of Default from Financial Ratios" Tags="&lt;modeling&gt;&lt;reference-request&gt;&lt;credit-ratings&gt;&lt;credit-scoring&gt;&lt;ratio&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15986" PostTypeId="1" CreationDate="2014-12-25T18:52:59.280" Score="12" ViewCount="88455" Body="&lt;p&gt;I have two tasks:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Given country's CDS spread draw implied probability of default.&lt;/li&gt;&#xA;&lt;li&gt;Given probability of default calculate CDS spread.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If possible, refer to any papers.&lt;/p&gt;&#xA;" OwnerUserId="13305" LastEditorUserId="467" LastEditDate="2016-12-29T02:12:44.043" LastActivityDate="2017-08-17T12:51:59.297" Title="How to compute the implied probability of default from a CDS spread?" Tags="&lt;cds&gt;&lt;default-probability&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="15988" PostTypeId="1" CreationDate="2014-12-25T19:51:46.303" Score="1" ViewCount="1114" Body="&lt;p&gt;Hi I am trying to use financial technical Indicators for forecasting, using machine learning models. The usual approach in time series cross validation is to use a moving window or  growing window. The methodology I am using is described in the following steps&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Calculate technical indicators TA1, TA2, ....TAN for the whole historical data set, using lag 1&lt;/li&gt;&#xA;&lt;li&gt;Then use simple feature selection method like finding out the cross correlation between the independent variables, and remove variables with cross correlation above a certain threshold &lt;/li&gt;&#xA;&lt;li&gt;Lag the input variables by one &lt;/li&gt;&#xA;&lt;li&gt;Then train the the Machine learning model using a moving window, then reports its performance on the train set &lt;/li&gt;&#xA;&lt;li&gt;Test its performance on a test set which was not used in the training process&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The issue I am facing is that the results are highly optimistic. My question is should I calculate the technical indicators separately for the train and test and then use them, or should I calculate them for the whole data set in the beginning and then divide them into train and test set.&lt;/p&gt;&#xA;" OwnerUserId="13909" LastActivityDate="2014-12-28T10:58:14.310" Title="Using Technical Indicators for forecasting Financial time series using Machine learning models" Tags="&lt;time-series&gt;&lt;forecasting&gt;&lt;machine-learning&gt;&lt;indicator&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15989" PostTypeId="2" ParentId="15986" CreationDate="2014-12-25T23:25:19.860" Score="3" Body="&lt;p&gt;From this &lt;a href=&quot;http://www.dbresearch.com/PROD/DBR_INTERNET_EN-PROD/PROD0000000000183612.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;research&lt;/a&gt; from Deutsche Bank, :&#xA;$$p_{def}=\frac{CDS_{spread}}{1-Rec}$$&#xA;$$\Leftrightarrow CDS_{spread}=p_{def}(1-Rec)$$&#xA;where $Rec$ is the recovery rate in case of default.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="467" LastEditDate="2016-12-29T02:11:16.297" LastActivityDate="2016-12-29T02:11:16.297" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15991" PostTypeId="1" CreationDate="2014-12-26T07:45:31.017" Score="1" ViewCount="716" Body="&lt;p&gt;Lets say I make a trade that consists of buying one put and 2 calls of the same underlying but with different expiration dates and different strikes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example trade:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Long call - strike @ $100 -  exp 3/17/2015&#xA;    Long put - strike @ $110 - exp: 3/30/2015&#xA;cost of trade = $15&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;-&#xA;&lt;code&gt;Current price = $90, current date = 1/1/2015&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the trades expired on the same day the trade would net profit if the underlying price at expiration is greater than &lt;code&gt;$105&lt;/code&gt;. The probability of the trade being profitable would be equal to the probability of the underlying being above &lt;code&gt;$105&lt;/code&gt; on the expiration date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The trades unfortunately do not expire on the same day which complicates things. How do I calculate the probability of the trade being profitable when the options expire on different dates?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it&lt;br&gt;&#xA;&lt;code&gt;= (probability underlying &amp;gt; $105 @ 3/17/2015) * (probability underlying &amp;gt; $105 @ 3/30/2015)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I feel that the above is not correct as it does not account for the relationship between the two probabilities. Maybe a more correct equation would be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;= (probability underlying &amp;gt; $105 @ 3/17/2015) * (probability underlying &amp;gt; $105  starting from 3/17/2015 to 3/30/2015 with a starting price of $105)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even this equation seems to be incorrect because if the option expires on the earlier date above the &lt;code&gt;$105&lt;/code&gt;, then it can expire below &lt;code&gt;$105&lt;/code&gt; on the later expiration date. &lt;/p&gt;&#xA;" OwnerUserId="13661" LastEditorUserId="13661" LastEditDate="2014-12-26T07:51:42.753" LastActivityDate="2014-12-27T14:17:10.683" Title="How to calculate the probability of 2 options ending in money with different expiration dates?" Tags="&lt;options&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="15993" PostTypeId="2" ParentId="15986" CreationDate="2014-12-26T15:54:27.753" Score="6" Body="&lt;p&gt;The chapter in &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0133456315&quot; rel=&quot;noreferrer&quot;&gt;Hull&lt;/a&gt; on Credit Risk gives the same formula as emcor as a first approximation with a justification:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Consider first an approximate calculation. Suppose that a bond yields 200 basis points more than a similar risk-free bond and that the expected recovery rate in the event of a default is 40%. The holder of a corporate bond must be expecting to lose 200 basis points (or 2% per year) from defaults. Given the recovery rate of 40%, this leads to an estimate of the probability of a default per year conditional on no earlier default of $0.02/(1-04)$, or 3.33%. In general $$ \bar{\lambda} = \frac{s}{1-R}$$&#xA;  where $\bar{\lambda}$ is the average default intensity (hazard rate) per year, $s$ is the spread of the corporate bond yield over the risk-free rate, and $R$ is the expected recovery rate.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This formula can easily be rewritten as &#xA;$$s = \bar{\lambda} (1 -R)$$ &#xA;as pointed out by @emcor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;User @lakesh pointed in a deleted question to &lt;a href=&quot;http://www.kamakuraco.com/Blog/tabid/231/EntryId/700/Credit-Spreads-and-Default-Probabilities-A-Simple-Model-Validation-Example.aspx&quot; rel=&quot;noreferrer&quot;&gt;a blog by Donald van Deventer&lt;/a&gt; that analyses this formula and he rejects it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both Hull and van Deventer remark that this formula is an imperfect approximation. It makes sense but there are some caveats and a number of improvements can be made and Hull gives one you can readily do yourself. What is best probably depends on the goal of the study.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2014-12-26T15:54:27.753" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="15994" PostTypeId="1" AcceptedAnswerId="15996" CreationDate="2014-12-27T08:05:59.153" Score="2" ViewCount="79" Body="&lt;p&gt;How can I show that payment of $\frac{1}{p(T_{i-1},T_i)}(A-p(T_{i-1},T_i))^+$ at time $T_i$ is equivalent to a payment of $(A-p(T_{i-1},T_i))^+$ at time $T_{i-1}$ ? Where A is a deterministic constant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I appreciate any help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="13370" LastActivityDate="2014-12-27T14:55:28.543" Title="$\frac{1}{p(T_{i-1},T_i)}(A-p(T_{i-1},T_i))^+$ at time $T_i$ is equivalent to a payment of $(A-p(T_{i-1},T_i))^+$ at time $T_{i-1}$" Tags="&lt;finance&gt;&lt;bond&gt;&lt;mathematics&gt;&lt;financial&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="15995" PostTypeId="2" ParentId="15991" CreationDate="2014-12-27T14:17:10.683" Score="1" Body="&lt;p&gt;First some notation, let &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$S_1$ and $S_2$ and be the stock price at the expiration dates;&lt;/li&gt;&#xA;&lt;li&gt;$K_1$ and $K_2$ the strike prices;&lt;/li&gt;&#xA;&lt;li&gt;and $C$ be the cost.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;then the profit is given by &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\textrm{profit} = 2 \times (S_1 - K_1)^+ + (K_2 - S_2)^+ - C.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the first expiration date three mutually exclusive cases can be distinguished:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$S_1 &amp;gt; K_1 + \frac{C}{2}$, the entire trade is profitable, this happens with probability $P\left(S_1 &amp;gt; K_1 + \frac{C}{2}\right)$;&lt;/li&gt;&#xA;&lt;li&gt;$K_1 \leq S_1 \leq K_1 + \frac{C}{2}$, a part of the investment is earned back;&lt;/li&gt;&#xA;&lt;li&gt;$S_1 &amp;lt; K_1$, the call option expired worthless.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If the calls expire out of the money (the third case), the put has to make up for the investment and the probability of that happening is $P(S_2 &amp;lt; K_2 - C \:\lvert\: S_1 &amp;lt; K_1)$. The second case is the most complex:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P\left(K_2 - S_2 &amp;gt; C - 2(S_1 - K_1) \:\lvert\: K_1 \leq S_1 \leq K_1 + \frac{C}{2}\right).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can just at these as they are mutually exclusive so:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P(\textrm{profit &amp;gt; 0}) = P\left(S_1 &amp;gt; K_1 + \frac{C}{2}\right) + P\left(K_2 - S_2 &amp;gt; C - 2(S_1 - K_1) \:\lvert\: K_1 \leq S_1 \leq K_1 + \frac{C}{2}\right) + P(S_2 &amp;lt; K_2 - C \:\lvert\: S_1 &amp;lt; K_1).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see no way to simplify without more assumptions this but if you have a model, in which you can calculate conditional probabilities, calculating the result should be straightforward.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2014-12-27T14:17:10.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15996" PostTypeId="2" ParentId="15994" CreationDate="2014-12-27T14:55:28.543" Score="1" Body="&lt;p&gt;Both the quantity $\frac{1}{p(T_{i-1},T_i)}(A-p(T_{i-1},T_i))^+$ and the quantity $(A-p(T_{i-1},T_i))^+$ are known at time $T_{i-1}$. Then the payment $\frac{1}{p(T_{i-1},T_i)}(A-p(T_{i-1},T_i))^+$ at time $T_i$ discount back to time $T_{i-1}$ is the equivalent payment. That is&#xA;\begin{align*}&#xA;\bigg[\frac{1}{p(T_{i-1},T_i)}(A-p(T_{i-1},T_i))^+\bigg] \times p(T_{i-1},T_i) = (A-p(T_{i-1},T_i))^+,&#xA;\end{align*}&#xA;where $p(T_{i-1},T_i)$ is the discount factor.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2014-12-27T14:55:28.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="15997" PostTypeId="1" CreationDate="2014-12-27T19:51:20.623" Score="-1" ViewCount="1265" Body="&lt;p&gt;How can we use normal distribution for finding the probability of a stock price offer where current price offer depends upon the last price offer. The price offer on some day can go 10% above (at the maximum) or 10% below (at the minimum) from the last price offer. If NOT, which is the suitable distribution for the stated problem?&lt;/p&gt;&#xA;" OwnerUserId="13919" LastActivityDate="2014-12-28T02:35:50.367" Title="Probability distribution and Stock Price Movement" Tags="&lt;statistics&gt;&lt;stochastic-processes&gt;&lt;brownian-motion&gt;&lt;normal-distribution&gt;" AnswerCount="1" CommentCount="3" ClosedDate="2014-12-28T10:33:52.293" ContentLicense="CC BY-SA 3.0" />
  <row Id="15999" PostTypeId="2" ParentId="15997" CreationDate="2014-12-28T02:35:50.367" Score="1" Body="&lt;p&gt;Stock prices have been modeled using the Lognormal distribution, not the Normal distribution. See this paper &lt;a href=&quot;http://math.ucsd.edu/~msharpe/stockgrowth.pdf&quot; rel=&quot;nofollow&quot;&gt;http://math.ucsd.edu/~msharpe/stockgrowth.pdf&lt;/a&gt; for more detailed information. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This does not mean that the current price offer depends on the last price offer. &lt;/p&gt;&#xA;" OwnerUserId="8067" LastActivityDate="2014-12-28T02:35:50.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16000" PostTypeId="2" ParentId="15988" CreationDate="2014-12-28T10:19:30.030" Score="1" Body="&lt;p&gt;In terms of forecasting, it is VERY difficult to forecast financial time series especially using ML models. One of the  &quot;successful&quot; papers that I have seen use a classifier approach (e.g. forecasting extreme returns).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See: &lt;a href=&quot;http://algorithmicfinance.org/2-1/pp45-58/&quot; rel=&quot;nofollow&quot;&gt;http://algorithmicfinance.org/2-1/pp45-58/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above being said, your model structure would assume that the parameters are stable across time. Why not use a VARMA approach using the TA indicators see here: &lt;a href=&quot;http://users.monash.edu.au/~gathana/slides/isf07.pdf&quot; rel=&quot;nofollow&quot;&gt;http://users.monash.edu.au/~gathana/slides/isf07.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2154" LastActivityDate="2014-12-28T10:19:30.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16001" PostTypeId="2" ParentId="15985" CreationDate="2014-12-28T10:24:56.770" Score="3" Body="&lt;p&gt;Most of the papers concern CDS spreads which you will need to convert to a PD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Paper using country specific fundamentals: &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2517018&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2517018&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This paper uses leverage: &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2361872&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2361872&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another one that decomposes them against peer groups: &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2413011&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2413011&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Comparing spreads and ratings:&#xA;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1551406&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1551406&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2154" LastActivityDate="2014-12-28T10:24:56.770" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16002" PostTypeId="2" ParentId="15964" CreationDate="2014-12-28T10:37:53.817" Score="1" Body="&lt;p&gt;Why not just use PortfolioAnalytics, as if your matrix is non positive definite you will have problems using non optimization approaches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example taken from my blog:&#xA;retmat is a matrix of returns&lt;/p&gt;&#xA;&#xA;&lt;p&gt;library(PortfolioAnalytics)&lt;br&gt;&#xA;moms_portfolio = portfolio.spec(assets=colnames(retmat))&lt;br&gt;&#xA;moms_portfolio = add.constraint(portfolio=moms_portfolio,type=&quot;full_investment&quot;)&lt;br&gt;&#xA;moms_portfolio = add.constraint(portfolio=moms_portfolio,type=&quot;long_only&quot;)&lt;br&gt;&#xA;moms_portfolio = add.objective(portfolio=moms_portfolio,name=&quot;StdDev&quot;,type=&quot;risk&quot;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;/#Optimize (May want to switch to DEoptim or different optimizer if ROI fails)  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;optimal_portfolio = optimize.portfolio(retmat,moms_portfolio,optimize_method=&quot;ROI&quot;) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;optimal_portfolio = optimize.portfolio(retmat,moms_portfolio,optimize_method=&quot;DEoptim&quot;,&#xA;                                       search_size=5000, trace=TRUE, traceDE=0)  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit 1: Documentation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;see here for general optimization with Portfolio analytics: &lt;a href=&quot;https://r-forge.r-project.org/scm/viewvc.php/*checkout*/pkg/PortfolioAnalytics/vignettes/risk_budget_optimization.pdf?revision=2882&amp;amp;root=returnanalytics&quot; rel=&quot;nofollow&quot;&gt;Portfolio Optimization Vignette&lt;/a&gt;                             &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://r-forge.r-project.org/scm/viewvc.php/*checkout*/pkg/PortfolioAnalytics/vignettes/custom_moments_objectives.pdf?root=returnanalytics&quot; rel=&quot;nofollow&quot;&gt;Portfolio Optimization With custom moments and objectives&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2154" LastEditorUserId="2154" LastEditDate="2015-01-02T01:44:04.580" LastActivityDate="2015-01-02T01:44:04.580" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16003" PostTypeId="1" AcceptedAnswerId="16012" CreationDate="2014-12-28T10:49:11.793" Score="2" ViewCount="968" Body="&lt;p&gt;I have been thinking about this one for last couple of days. With options on share we hedge on cash and the underlying equity as per Black-Scholes formulation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I am confused on Index options. There is a basket of equities (often large number) to hedge. I don't find the cash and equities hedging technique to be convincing. The reasons:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Large number of equities&lt;br&gt;&#xA;2) Transaction costs&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone here who has some experience or can direct me to any relevant literature. I am curious how market makers deal with index options.&lt;/p&gt;&#xA;" OwnerUserId="13715" LastActivityDate="2014-12-29T15:12:20.500" Title="How market making in Index options is done?" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;hedging&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16004" PostTypeId="2" ParentId="15988" CreationDate="2014-12-28T10:58:14.310" Score="1" Body="&lt;p&gt;Careful when you use machine learning techniques in financial time series. You are implicitly assuming that the trend that you spot on the data you train your model on, the same trend will be there in future time series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition to what KKB suggested, there is another model called &quot;Echo State Network&quot; (a family of RNNs) you should look at. But then again you are advised to train on brief data. Reason being - what happened 2 years back may not be relevant now, but what's happening in past few months are relevant as they reflect recent events. It's a maze really. You have to use your intuition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also use the confidence interval to judge how meaningful your estimated value is. A probability distribution is quite helpful in gauging the effectiveness of the prediction.&lt;/p&gt;&#xA;" OwnerUserId="13715" LastActivityDate="2014-12-28T10:58:14.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16005" PostTypeId="1" CreationDate="2014-12-28T11:18:41.380" Score="2" ViewCount="446" Body="&lt;p&gt;It is well known that the theta of call option is always negative. Also, the theta of (at the money call option) goes to infinity as the time approaches to the maturity. On the other hands, (ITM and OTM) call option has zero theta at the maturity. This can be easily checked by BS formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/pSUZn.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, i am wondering that the above fact also holds for other models (eg. CEV or advanced models).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As i know, the theta of call option under CEV is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/fu6lg.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/98NaG.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;img src=&quot;https://i.stack.imgur.com/9STjR.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;X is a strike price and $Q(w; v, λ)$ is the complementary distribution function of a non-central chi-square law with v degrees of freedom and non-centrality parameter λ.&lt;/p&gt;&#xA;" OwnerUserId="12093" LastEditorUserId="-1" LastEditDate="2014-12-31T10:52:43.740" LastActivityDate="2014-12-31T10:52:43.740" Title="Asymptotic behavior of theta of vanilla call option" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;stochastic-volatility&gt;&lt;greeks&gt;&lt;analysis&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16006" PostTypeId="1" CreationDate="2014-12-28T13:37:24.560" Score="1" ViewCount="82" Body="&lt;p&gt;I took EU market rates here: &lt;a href=&quot;https://www.banque-france.fr/en/economics-statistics/rates/main-euro-area-interbank-market-rates.html&quot; rel=&quot;nofollow&quot;&gt;https://www.banque-france.fr/en/economics-statistics/rates/main-euro-area-interbank-market-rates.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see (Eonia 05/13/1999 for example) there is non defined and non available data. I know that for prices you can't easily interpolate data because you will modify volatility in doing so. You need to use more complex techniques (kalman filter ?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: how can I handle missing data for markets rates ?&#xA;Does it depends on what you want to do with your data ? (I want to predict clients comportement based on short terms rates).&lt;/p&gt;&#xA;" OwnerUserId="5052" LastActivityDate="2014-12-28T16:10:14.940" Title="interbank market rates - missing data" Tags="&lt;interbank-rates&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16007" PostTypeId="1" CreationDate="2014-12-28T14:18:09.730" Score="1" ViewCount="100" Body="&lt;p&gt;I have some historical EOD options data for 2013, and there are duplicates listed for same strikes/expirations.  I was told that by the provider that this is due to &quot;special one-time cash payout&quot; for the company as opposed to a normal dividend, and this is how it is accounted for.  My questions are &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Can anyone explain what &quot;special cash payout&quot; means?  &lt;/li&gt;&#xA;&lt;li&gt;How can I tell which is the real option price?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Example from 1/2/2013:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   Underlying UnderlyingPrice   Expiry Type Strike Last  Bid  Ask Volume OpenInterest  Mark   IV &#xA;1:        WNR           28.94 20130119    C     30 0.85 1.05 1.10      7         1206 1.075 0.58 &#xA;2:        WNR           28.94 20130119    P     30 1.70 0.65 0.75      0          134 0.700 0.43 &#xA;3:        WNR           28.94 20130119    C     30 0.30 0.35 0.45    370          166 0.400 0.31 &#xA;4:        WNR           28.94 20130119    P     30 1.05 1.45 1.85      0            0 1.650 0.80&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="1001" LastActivityDate="2015-03-13T16:57:09.667" Title="I have some historical options data, and there are duplicates of some options, how to filter them" Tags="&lt;options&gt;&lt;historical-data&gt;&lt;dividends&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16008" PostTypeId="2" ParentId="16006" CreationDate="2014-12-28T16:10:14.940" Score="1" Body="&lt;p&gt;Of cause, the best solution is to fill out the missing holes, in this case head over to the &lt;a href=&quot;http://sdw.ecb.europa.eu/quickview.do?SERIES_KEY=198.EON.D.EONIA_TO.RATE&amp;amp;start=12-05-1999&amp;amp;end=14-05-1999&amp;amp;submitOptions.x=44&amp;amp;submitOptions.y=11&amp;amp;trans=N&quot; rel=&quot;nofollow&quot;&gt;ECB Statistical Bank&lt;/a&gt;, and get a higher quality dataset or fill the holes, in your existing one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking your EONIA example, I would simply take the difference between the rate before and after the missing spot(s), and divide it by the missing spots and increment the before rate with the found coefficient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However it is important the you disclose that some of the data you/your model rely on have interpolated data points, and this should be incorporated into the model accuracy.&#xA;I would recommend to trigger a warning if the change between the missing points is larger than a fixed amount e.g. if &lt;a href=&quot;http://sdw.ecb.europa.eu/quickview.do?SERIES_KEY=198.EON.D.EONIA_TO.RATE&amp;amp;start=20-01-2009&amp;amp;end=22-01-2009&amp;amp;submitOptions.x=48&amp;amp;submitOptions.y=14&amp;amp;trans=N&quot; rel=&quot;nofollow&quot;&gt;2009-01-21 where to be missing&lt;/a&gt;, the difference between 2009-01-20 and 2009-01-22 would be 0.899 which is quite a drop, and might severely affect your model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW: Take look at the &lt;a href=&quot;http://se.mathworks.com/help/finance/fillts.html&quot; rel=&quot;nofollow&quot;&gt;one-size-fits-all interpolation methods&lt;/a&gt; of missing data from time series in Matlabs Financial Toolbox.&lt;/p&gt;&#xA;" OwnerUserId="4769" LastActivityDate="2014-12-28T16:10:14.940" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16009" PostTypeId="2" ParentId="16007" CreationDate="2014-12-28T20:02:27.107" Score="1" Body="&lt;p&gt;When the underlying asset is a stock making this special dividend to its shareholders, it will influence the option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Special dividends is not that common, but usually happens in companies with extraordinarily success or under liquidation / sale of a division / splitting up. Look at &lt;a href=&quot;https://en.wikipedia.org/wiki/Special_dividend&quot; rel=&quot;nofollow&quot;&gt;Special Dividend on Wikipedia.&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="4769" LastActivityDate="2014-12-28T20:02:27.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16010" PostTypeId="2" ParentId="16003" CreationDate="2014-12-28T20:28:20.250" Score="1" Body="&lt;p&gt;I am not sure I fully understand your question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Options it just derivative contracts (wager) between two parties, there is no ‘real’ assets bought to support the +/- value change the option might have during its duration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When the exercise date is upon the option, and you are the winner, you are paid according to the &lt;a href=&quot;http://www.investopedia.com/terms/w/wamc.asp&quot; rel=&quot;nofollow&quot;&gt;WAMC&lt;/a&gt; of the index – e.g. 3.4% of your winnings is an Exxon Mobile stock, 1.6% is Bank of America stock and so on…&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short: There is no problems with transaction cost or the number of equities, since the option is just a contract.&lt;/p&gt;&#xA;" OwnerUserId="4769" LastActivityDate="2014-12-28T20:28:20.250" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16012" PostTypeId="2" ParentId="16003" CreationDate="2014-12-29T11:31:15.570" Score="4" Body="&lt;p&gt;Most index options are options on futures, so to delta hedge a single option position, you trade the corresponding future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, say you sell 10 delta 50 calls on the CME Emini S&amp;amp;P. To delta hedge them, you'd buy 5 CME Emini S&amp;amp;P Futures with the same expiry date as the options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you say, you could hedge with the basket instead, but for practical purposes the futures are usually easier. If the futures go out of line with the basket you can always trade an index arb strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now market makers normally dont just trade one option - they build a portfolio of options by buying and selling both call and put options at different strikes. Once you start combining option positions for the same expiry, you can sum the delta for your portfolio and just hedge the remaining delta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Options have other risk sensitivities though, so to a certain degree you also need to hedge gamma, vega, etc. That's normally done by adjusting your prices so that if for example you are long vega (you've bought a lot of options), you adjust your prices down for both calls &amp;amp; puts to make it more likely that you'll sell options (and hence reduce your overall vega).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's obviously a bit more complex than that in practice, but you get the general idea.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Btw, you can check out some example index option/future contract specs here:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.cmegroup.com/trading/equity-index/us-index/e-mini-sandp500_contractSpecs_options.html#prodType=AME&quot; rel=&quot;nofollow&quot;&gt;http://www.cmegroup.com/trading/equity-index/us-index/e-mini-sandp500_contractSpecs_options.html#prodType=AME&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.cmegroup.com/trading/equity-index/us-index/e-mini-sandp500_contract_specifications.html&quot; rel=&quot;nofollow&quot;&gt;http://www.cmegroup.com/trading/equity-index/us-index/e-mini-sandp500_contract_specifications.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="13930" LastEditorUserId="13930" LastEditDate="2014-12-29T15:12:20.500" LastActivityDate="2014-12-29T15:12:20.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16013" PostTypeId="2" ParentId="15953" CreationDate="2014-12-29T12:02:42.993" Score="4" Body="&lt;p&gt;When dividends are continuous, they are essentially negative interest rates, so you should price options w.r.t. new interest rate $\hat r := r-d$ where $r$ is the original interest rate and $d$ is the continuous dividend yield. If $\hat r&amp;gt;0$ then the price of the call is still a submartingale, so early exercise is not (strongly) optimal, however in a more realistic setting $\hat r&amp;lt;0$ so that pricing of the call becomes as intricate as that of the put: at each moment of time some strikes are early exercise and some are not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, it is often known how often does the company pays/decides on the dividends. They always anounce the dividend amount and date in advance, before that you have to price the dividends using some model.&lt;/p&gt;&#xA;" OwnerUserId="13480" LastEditorUserId="13480" LastEditDate="2015-07-10T06:25:49.483" LastActivityDate="2015-07-10T06:25:49.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16014" PostTypeId="2" ParentId="15853" CreationDate="2014-12-29T12:54:51.310" Score="4" Body="&lt;p&gt;It seems that implicitly you have a multi-objective optimization in mind, hence of course it may happen that you are not able to achieve all the objectives simultaneously. Let's say that output of a more general model is $f(x,y)$ so that the output of the first model is $f(x,0) = f_0(x)$. Denoting market prices by $m_k$ which in your case means $m_1 = A$ and $m_2= B$ you perform the following optimization:&#xA;$$&#xA;  (x',y'):=\arg\min \sum_k d(f,m_k),\qquad x'':=\arg\min \sum_k d(f_0,m_k),&#xA;$$&#xA;where $d$ denotes an appropriate distance function ($L_2$ norm in your case). Now, if you want to satisfy additional constraints $d(f(x',y'),m_k) \leq d(f(x'',0),m_k) \;\forall k$, you shall just include them in your optimization. I would outline the steps as follows:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Compute $x''$ just by fitting the first model into the market data.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use constraints with $x''$ obtained in the previous step to find optimal $(x',y')$ for the second model.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The detailed implementation of the second step depends on the structure of the model, but essentially it only makes the procedure that you used more complex since now you have to take constraints into account, so that the optimal solution may lye on the boundary described by one of the constraints. For example, if you used gradient descent before, now you can also use it but disregarding the direction that leads you outside of constraints: in that case just move along the constraint in the desired direction.&lt;/p&gt;&#xA;" OwnerUserId="13480" LastActivityDate="2014-12-29T12:54:51.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16017" PostTypeId="1" AcceptedAnswerId="16054" CreationDate="2014-12-30T09:01:26.063" Score="1" ViewCount="507" Body="&lt;p&gt;How can I show that for the Dothan short rate model We have $E^Q[B(t)]=\infty$ ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where Dothan short rate model is &quot; $dr_t=ar_tdt+\sigma r_tdW_t$ &quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I appreciate any help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="13370" LastActivityDate="2015-01-02T11:47:34.943" Title="For the Dothan model $E^Q[B(t)]=\infty$?" Tags="&lt;interest-rates&gt;&lt;bond&gt;&lt;brownian-motion&gt;&lt;martingale&gt;&lt;short-rate&gt;" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16018" PostTypeId="2" ParentId="16017" CreationDate="2014-12-30T09:50:18.383" Score="2" Body="&lt;p&gt;First I must appreciate the @Richard's help that cause to solved this question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Dothan model with this dynamic &quot; $dr_t=ar_tdt+\sigma r_tdW_t$ &quot; is easily integrated &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r(t)=r(s)exp ( \mu (t-s)+\sigma (W_t-W_s))$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $\mu=a-\frac{\sigma^2}{2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so We have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E^Q[B_t]=E^Q[exp(\int_0^t r(u)du)]\approx E^Q[e^{e^y}]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $y$ is Gaussian distributed so the expectation equals to infinite.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please excuse my brevity.&lt;/p&gt;&#xA;" OwnerUserId="13370" LastEditorUserId="13370" LastEditDate="2014-12-30T10:16:30.097" LastActivityDate="2014-12-30T10:16:30.097" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16019" PostTypeId="1" AcceptedAnswerId="16021" CreationDate="2014-12-30T16:54:09.033" Score="1" ViewCount="103" Body="&lt;p&gt;This is the task I have been asked to do. I've read up on what central limit theorem (clt) is, but I feel like I'm missing something.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The data I have is a matrix of monthly stock returns from 50 different companies from 1/1/2000 to 1/8/2014.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've established I find the cross sectional average return before the recession (Rb), and the average return after the recession(Ra) and; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Rb - Ra) is my X-bar in the clt, z-score formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I apologise for any inaccuracies, my knowledge is very little and I'm thankful for your patience&lt;/p&gt;&#xA;" OwnerUserId="13938" LastActivityDate="2015-01-02T00:17:34.947" Title="Using central limit theorem to test whether population average return is the same, before and after the recession" Tags="&lt;returns&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16020" PostTypeId="2" ParentId="16005" CreationDate="2014-12-30T17:46:43.307" Score="2" Body="&lt;p&gt;I think you need to ask your question differently to get better answers than mine. &#xA;Your Black Scholes part has two problems.&#xA;First positive infinity should be negative infinity.&#xA;Second, you are assuming zero dividends in Black Scholes but you are assuming a possibly positive div yield q in the CEV part. If the div yield q is sufficiently positive in the Black Scholes model, it leads to theta switching sign.&#xA;My advice is to ask your question under zero rates and dividends.&#xA;If you get an answer, then follow up with positive int rate and or positive dividend yield.&lt;/p&gt;&#xA;" OwnerUserId="13939" LastActivityDate="2014-12-30T17:46:43.307" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16021" PostTypeId="2" ParentId="16019" CreationDate="2014-12-30T18:06:43.277" Score="6" Body="&lt;p&gt;You cannot use the clt to &lt;em&gt;test&lt;/em&gt; something, it is a theorem about convergence. You can only use a &lt;em&gt;statistical test&lt;/em&gt; to test something which basis is in many cases the clt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case you could e.g. use a so called &lt;a href=&quot;http://en.wikipedia.org/wiki/Student&amp;#39;s_t-test&quot;&gt;t-test&lt;/a&gt;. In R you would e.g. type:&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;t.test(data.Rb,data.Ra)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to test whether the difference in the means is significant.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2014-12-30T18:06:43.277" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16022" PostTypeId="2" ParentId="613" CreationDate="2014-12-30T20:45:36.397" Score="0" Body="&lt;p&gt;If your language is Java, &lt;a href=&quot;http://www.coralblocks.com/index.php/category/coralstore/&quot; rel=&quot;nofollow&quot;&gt;CoralStore&lt;/a&gt; can persist time series for a fraction of the price of KDB. It provides very fast write access (&lt;a href=&quot;http://www.coralblocks.com/index.php/2014/12/coralstore-performance-numbers/&quot; rel=&quot;nofollow&quot;&gt;~ 70 nanos / msg&lt;/a&gt;) so you can dump huge amounts of data to disk. When it comes to read access, you can fetch messages by sequence and it uses paging/swapping technology for very fast read access. It also allows simultaneous read/write access and comes with an asynchronous implementation for extra low variance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt; I am one of the developers of CoralStore.&lt;/p&gt;&#xA;" OwnerUserId="11804" LastActivityDate="2014-12-30T20:45:36.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16023" PostTypeId="1" AcceptedAnswerId="16025" CreationDate="2014-12-30T20:54:41.727" Score="4" ViewCount="4265" Body="&lt;p&gt;What are some good ressources (books, articles, ...) to learn backtesting of investment strategies using MATLAB ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can be strategies related to fixed-income, equities, derivatives, ... whatever. The process of backtesting is more important than the actual strategy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maxime. &lt;/p&gt;&#xA;" OwnerUserId="13942" LastActivityDate="2014-12-31T00:10:07.537" Title="Learn backtesting using MATLAB" Tags="&lt;quant-trading-strategies&gt;&lt;backtesting&gt;&lt;research&gt;&lt;matlab&gt;&lt;quantitative&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16024" PostTypeId="1" CreationDate="2014-12-30T21:02:38.073" Score="7" ViewCount="893" Body="&lt;p&gt;I am interested in Bayesian methods in the context of financial economics and quantitative finance and have been looking for research which uses Bayesian parameter estimation on asset pricing models, and in particular multi factor models such as the Fama-French model or its Carhart extension.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been searching quite a bit but not really found what I am looking for and would therefore greatly appreciate any recommendations of journal articles or textbooks demonstrating this particular application.&lt;/p&gt;&#xA;" OwnerUserId="13665" LastActivityDate="2015-07-19T11:44:29.450" Title="Bayesian estimation of asset pricing models" Tags="&lt;asset-pricing&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16025" PostTypeId="2" ParentId="16023" CreationDate="2014-12-30T22:20:45.533" Score="4" Body="&lt;h1&gt;The general idea&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;For equity securities, a simple backtest will typically consist of two steps:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Computation of the portfolio return resulting from your portfolio formation rule (or trading strategy)&lt;/li&gt;&#xA;&lt;li&gt;Risk-adjustment of portfolio returns using an asset pricing model&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Step 2 is simply a regression and computationally very simple in Matlab. What's trickier is the implementation of step 1, which will require you to be very comfortable in Matlab, and there are different ways to do this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you know how to do an OLS regression in Matlab, what you should focus on is all kinds of matrix manipulations.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Implementation in Matlab&lt;/h1&gt;&#xA;&#xA;&lt;h2&gt;Portfolio formation and returns computation&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;To give you an example of how a &lt;strong&gt;primitive&lt;/strong&gt; trading strategy could be implemented in Matlab, let's assume monthly return data and a uniform holding period of one month on $n$ assets over $k$ periods, where $i \in \{1,...,n\}$ and $k \in \{1,...,t\}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming no changes in the composition of your stock universe, your returns matrix $X$ is of dimensions $k \times n$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X = &#xA;\begin{matrix}&#xA;x_{11} &amp;amp; \dots &amp;amp; x_{1i} &amp;amp; \dots &amp;amp; x_{1n} \\ &#xA;\vdots &amp;amp; \ddots &amp;amp; \vdots &amp;amp; \ddots &amp;amp; \vdots \\&#xA;x_{t1} &amp;amp; \dots &amp;amp; x_{ti} &amp;amp; \dots &amp;amp; x_{tn} \\&#xA;\vdots &amp;amp; \ddots &amp;amp; \vdots &amp;amp; \ddots &amp;amp; \vdots\\&#xA;x_{k1} &amp;amp; \dots &amp;amp; x_{ki} &amp;amp; \dots &amp;amp; x_{kn} \\&#xA;\end{matrix}$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where returns are computed as $x_{it} = \frac{p_{t+1,i}}{p_{ti}} -1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming that your selection criterion is some kind of stock characteristic which is available at monthly frequency, you will also have a characteristics matrix $C$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You then could write an algorithm which identifies those entries in $C$ which fulfill your selection criterion (e.g. exceed a certain threshold) and replace the corresponding entries (where $i$ and $t$ are the same) of an indicator matrix $I$ (which has been initialized as a zero matrix using the &lt;a href=&quot;http://fr.mathworks.com/help/matlab/ref/zeros.html&quot; rel=&quot;nofollow&quot;&gt;zeros function&lt;/a&gt;) with ones.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then &lt;a href=&quot;http://fr.mathworks.com/help/fixedpoint/ref/times.html&quot; rel=&quot;nofollow&quot;&gt;multiply&lt;/a&gt; the entries of $I$ by those of the returns matrix $X$ to obtain a matrix $R$ which indicates the returns resulting from your holdings. You can then compute the mean of the non-zero entries for each row of $R$ to obtain your vector of portfolio returns.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Risk-adjustment and identification of abnormal returns&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;In step 2 you compare this vector to the normal returns obtained from regression estimation of an asset pricing model such as the &lt;a href=&quot;http://pages.nes.ru/agoriaev/Papers/Fama-French%205%20factors%20for%20stocks%20and%20vonds%20JFE93.pdf&quot; rel=&quot;nofollow&quot;&gt;Fama-French model&lt;/a&gt;. By subtracting the normal return vector from your portfolio returns vector, you determine whether your trading strategy has resulted in a positive abnormal return, which is what you're aiming for.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Recommendations&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;If you are new to Matlab, I personally suggest you familiarize yourself with it sufficiently to implement this simplistic strategy before relaxing some of the simplifying assumptions (such as uniform holding period and periodicity) and proceeding to more sophisticated implementations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Again, what I would like to stress is that this requires you to be very comfortable with Matlab and especially the different ways to manipulate matrices, which can take some time. If you are not required to use Matlab for your internship and would like to get results fast, you could do step 1 in Excel instead, which is tedious, but doesn't require the (worthwhile) initial investment you need to make for Matlab.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To become familiar with Matlab, I am sure you have already discovered the extremely good documentation that comes with it. That, to me, is the single most valuable resource and likely more useful than any more finance-specific resources (with which I would wait until you are familiar with Matlab itself). All that's required to determine the normal return is an OLS regression and a rudimentary understanding of asset pricing models. &lt;/p&gt;&#xA;" OwnerUserId="13665" LastEditorUserId="13665" LastEditDate="2014-12-31T00:10:07.537" LastActivityDate="2014-12-31T00:10:07.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16026" PostTypeId="2" ParentId="15985" CreationDate="2014-12-30T23:38:23.843" Score="2" Body="&lt;p&gt;I am also not aware of any papers in this area. But having developed many such models, I can list the important steps:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Decide on the target variable: usual choices are historical default data, agency ratings and expert rankings&lt;/li&gt;&#xA;&lt;li&gt;Create a sample containing the possible predictors&lt;/li&gt;&#xA;&lt;li&gt;Reduce the list with the help of some expert, e.g. exclude all the predictors deemed to be irrelevant&lt;/li&gt;&#xA;&lt;li&gt;Analyse the predictors standalone, e.g. with a rank correlation&lt;/li&gt;&#xA;&lt;li&gt;Discuss the poor predictors with the experts and possibly eliminate some. At this stage one usually has about 10 to 20 predictors&lt;/li&gt;&#xA;&lt;li&gt;Run regression analyses ((ordinal) logistic regression) after standardisation with all the possible combinations (e.g. consider combinations with at most 8 factors and more than 2 predictors). &lt;/li&gt;&#xA;&lt;li&gt;Check for each combination: the coefficients are intuitive (e.g. higher asset/debt better the rating etc.) and that they are high enough (e.g. more than 5% weight).&lt;/li&gt;&#xA;&lt;li&gt;List e.g. top 10 models using rank correlation and discuss them with the experts.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="13829" LastActivityDate="2014-12-30T23:38:23.843" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16027" PostTypeId="2" ParentId="4740" CreationDate="2014-12-31T00:55:59.470" Score="2" Body="&lt;p&gt;The concept of replication is indeed applied to IR products, after all they are also hedged in practice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in the equity world we start with the replicating portfolio and then arrive to the pricing formula. In contrast, for IR products we employ a convenient numeraire which helps us to arrive at the pricing formula directly (in a non-constructive and arguably less intuitive way). Furthermore, in the IR world the market instruments themselves are many and interlinked (cash rates, FRAs, swaps, basis swaps, etc.); in equities you have a single well defined underlying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To see the replicating portfolio one has to just look at the hedging ratios with respect to all relevant market observables. A swaption would be exposed to two points of the swap curve, and this exposure can be reconstructed by a collection of swaps and other instruments: i.e. the replicating portfolio.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2014-12-31T00:55:59.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16028" PostTypeId="1" CreationDate="2014-12-31T01:26:29.413" Score="1" ViewCount="627" Body="&lt;p&gt;My study was in a Mathematical modelling, we studied much about theory, equations, how to resolve equation, how to implement, but we don't understand well where these equations come from.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is not difficult, but not easy to be claire, I'll try to explain. It is about the famous Yield Curve built from a set of Treasury coupon Bonds. On most of book, I see that giving a convenable set of bond, determined by its maturities and coupon rate, one can calculate the yield curve from bond's prices, and reversely prices from yield curve. All of those are explained in mathematical formulas, not difficult to understand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Things that I don't understand, from this equivalence of yield curve and bond's prices, so what exist before, to determine other? Is yield curve quoted, and people calculate bond's prices from this, or reversely?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have in my mind 2 scenarios&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The government when issued bonds, they determine every things, bond's coupon rate, bond price, and also the yield curve built in these set (so they quote the bond price?). Each time new bonds are issued, new prices added, yield curve change, people update these new yield curve to use as interest rate risk-free for other calculation. In this scenario, is the government who fully determine the interest rate (yield curve). Also by this scenario, i understand why it is call risk-free since everything are controlled by government, so do its liability.&lt;/li&gt;&#xA;&lt;li&gt;The government issue bonds, but do not determine the price. It is then slapped into the market. Traders then buys and sells, these actions determine the bonds prices below the balance demand-offer. These prices so are determined and quoted by the market. So the yield curve equivalently has to change each time bond's prices change. This scenarios help me to see that the yield curve then mirror the economic condition of the market, since it is determined by the market. But also in this scenarios, i don't understand how it can still be called &quot;risk-free&quot; when it is completely random.       &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Can someone with experiences in the market explain me how that works, from issuer of the bond, what he does, how bonds pass to the market (which market?), how prices is determined, and in this case how use the corresponding yield curve?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there are a reference links, books (pdf) that also help me a lot. &lt;/p&gt;&#xA;" OwnerUserId="3507" LastActivityDate="2014-12-31T03:59:31.917" Title="Who determine Sport rate curve (Yield Curve)" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;yield-curve&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16029" PostTypeId="2" ParentId="16028" CreationDate="2014-12-31T01:47:26.870" Score="1" Body="&lt;p&gt;Your second version is correct. The market determines the price of these bonds, from which the curve is derived.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your first version has a tiny speck of truth, in the sense that the central bank (e.g. the Fed), which is a 'government organisation' has been recently interfering with the bond market in order to affect the yield curve (so called 'operation twist').&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They are called risk free because, although the price fluctuates, there is a promise of a fixed and deterministic cash-flows by the government to the holder. There are two residual risks here: that the sovereign will default and the cash-flows are not realised, or that future inflation will erode the real purchasing power of these distant cash-flows.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2014-12-31T01:47:26.870" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16030" PostTypeId="2" ParentId="16028" CreationDate="2014-12-31T03:46:13.850" Score="4" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;US Treasuries start trading BEFORE they're actually issued, in the so-called &quot;When-Issued&quot; market. This market allows investors to purchase the new issues for &quot;forward settlement.&quot; Because these bonds haven't been issued, they have no coupon rates and are traded on a yield basis. On a daily basis, market forces drive the yields, until the auction date. On the day these securities are auctioned, the US Treasury will set the coupon rate at a multiple of 1/8 so that the securities are priced just under par (a little under 100), and these new &quot;on-the-run&quot; issues then begin trading on a price basis.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The vast majority of US Treasuries are quoted on a clean price basis (although some int'l bonds are quoted on a yield basis). Market forces (supply/demand) drive the prices of these securities in real time.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;There is not one single Treasury spot curve. Currently, there are about 300 outstanding coupon Treasuries outstanding, some with overlapping maturities. Plus, the bonds can have local richness/cheapness. It's impossible to have a single spot (discount) curve that passes through all of them. Different dealers do build different curves, which can provide somewhat different spot rates and wildly different forward rates. I've also known traders who don't build a zero curve at all and trade government papers just fine.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It's also worth noting that out of these 300 outstanding Treasuries, only a subset is liquidly traded. How the other issues are &quot;priced&quot; may vary. Usually the on-the-runs (the most liquid) are accurately marked based on market traded prices, and other issues are simply marked as a spread to the on-the-runs. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The Fed is an active participant in the US Treasury market. But the Fed is not the issuer of US Treasuries. US Treasuries are issued by the Department of Treasury. In fact, the New York Fed has a trading desk that trades these papers. The Fed also maintains a SOMA portfolio, which is a huge portfolio of government securities and MBS. The transactions carried out by the New York Fed Trading Desk are part of the Fed's monetary policy implementations; e.g., the Fed purchased large quantities of securities during quantitative easing (QE) to push down yields.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2014-12-31T03:59:31.917" LastActivityDate="2014-12-31T03:59:31.917" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16031" PostTypeId="1" CreationDate="2014-12-31T04:31:47.013" Score="13" ViewCount="3082" Body="&lt;p&gt;I'm currently an undergrad at a Canadian university and our finance courses has been brought up through the frequentist approach (ols, hypothesis testing, sampling theory).  Only recently, through exploring methods in portfolio management do I realize a lot of the literature suggest using Bayesian methods (ex: Black-Litterman) to deal with estimation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, what are the benefits that both approaches contribute the most in finance?  What other areas in finance are Bayesian methods being used as industry standards?  Are there certain areas where one is favored than other?  Should someone interested in Finance be gearing towards bayesian or frequentist?&lt;/p&gt;&#xA;" OwnerUserId="11888" LastActivityDate="2017-09-03T14:55:11.260" Title="Bayesian or Frequentist in Finance?" Tags="&lt;portfolio-management&gt;&lt;statistics&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="16032" PostTypeId="2" ParentId="16024" CreationDate="2014-12-31T04:34:38.663" Score="6" Body="&lt;p&gt;Fitting Fama-French or Carhart is as simple as learning how to perform Bayesian regression. Pretty much every introductory book Bayesian estimation will cover this. There are analytic formulae under certain assumptions, but I would definitely try to learn the basics of MCMC and Gibbs sampling before trying this out in practice. Here are &lt;a href=&quot;http://faculty.chicagobooth.edu/nicholas.polson/research/papers/Bayes2.pdf&quot; rel=&quot;noreferrer&quot;&gt;two&lt;/a&gt; &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2451582&quot; rel=&quot;noreferrer&quot;&gt;papers&lt;/a&gt;. The book Bayesian Methods in Finance by Rachev et al covers quite a bit. Some googling reveals a book coming out next year (2015) titled Bayesian Inference in Factor Asset Pricing Models. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After having some basic understanding, you might find that implementing MCMC is a bit of a hassle if you're programming each on your own. Stan can implement a Hamiltonian Monte Carlo that requires quite a bit less work to set up. There are other programs (WinBugs), but I don't have much familiarity with them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to whether there is any benefit to fitting these with Bayesian or frequentist techniques, I'm of a split mind. I find Bayesian statistics far more intuitive, but that they are so ridiculously slow compared to frequentist techniques. It makes it harder to backtest things, unless you've got a some nice equipment and spend a lot of time thinking about parallelism. There are some problems, like fitting stochastic volatility models, that are much easier to do with Bayesian techniques. On the other hand, with daily data over 20+ years, the Bayesian methods will still be much slower than some alternative Garch model fit with MLE.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2014-12-31T04:34:38.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16033" PostTypeId="2" ParentId="16031" CreationDate="2014-12-31T05:12:36.847" Score="5" Body="&lt;p&gt;I would distinguish between Bayesian inference versus Bayesian portfolio management techniques. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Inference includes estimating parameters and credible intervals (the Bayesian version of confidence intervals, which are actually far more intuitive) and forecast. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to learn about Bayesian inference, get a solid foundation in frequentist methods first. A solid understanding of maximum likelihood estimation will help immensely when trying to make heads or tails of MCMC. It's too early in your thinking to be bounded to one camp or the other. Learn both (if you want) and use them as appropriate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bayesian portfolio management tends to be a broader term. If you knew nothing of the field and just followed the statistical literature, you would use Bayesian inference to get the posterior distribution for parameters, convert that to a posterior predictive distribution, and then select a portfolio based on this distribution. Black-Litterman (and further developed into Entropy Pooling) is a tool with two main purposes: 1) blending an investor's views with some other distribution, 2) an alternate approach to getting a prior on market returns (reverse optimization). The second step is optional, but I wouldn't consider either to be estimation, per se. A third technique that can get lumped in with Bayesian portfolio management is resampling (or Michaud resampling). This technique can be thought as similar to the first approach mentioned. However, when you have the posterior distribution, instead of getting the posterior predictive overall, you optimize a portfolio for each collection of paramters in the posterior, and then average the weights of each of the portfolios. However, you don't need to do Bayesian inference to do Michaud resampling, just some measure of the uncertainty of the parameters. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of what approaches are more popular, I think Black-Litterman and Michaud resampling are probably the most well-known. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2014-12-31T05:12:36.847" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16035" PostTypeId="2" ParentId="15985" CreationDate="2014-12-31T13:21:19.237" Score="0" Body="&lt;p&gt;Altman Z Score - &lt;a href=&quot;http://en.wikipedia.org/wiki/Altman_Z-score&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Altman_Z-score&lt;/a&gt; - From Wikipedia - &quot;The Z-score formula for predicting bankruptcy was published in 1968 by Edward I. Altman, who was, at the time, an Assistant Professor of Finance at New York University. The formula may be used to predict the probability that a firm will go into bankruptcy within two years. Z-scores are used to predict corporate defaults and an easy-to-calculate control measure for the financial distress status of companies in academic studies. The Z-score uses multiple corporate income and balance sheet values to measure the financial health of a company. &lt;/p&gt;&#xA;" OwnerUserId="12142" LastActivityDate="2014-12-31T13:21:19.237" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16036" PostTypeId="1" AcceptedAnswerId="16044" CreationDate="2014-12-31T15:04:18.367" Score="4" ViewCount="19802" Body="&lt;p&gt;I hear a lot about offshore and onshore currency, but I don't understand the difference between them. What is the difference between onshore and offshore currency in a country? Besides that, why is there a need for having two different currencies in the country??&lt;/p&gt;&#xA;" OwnerUserId="5839" LastEditorUserId="2587" LastEditDate="2015-01-02T13:25:09.120" LastActivityDate="2016-07-08T19:23:51.563" Title="Why is there onshore and offshore currency?" Tags="&lt;currency&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16037" PostTypeId="2" ParentId="15983" CreationDate="2014-12-31T15:43:05.340" Score="2" Body="&lt;p&gt;To Recap:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your &quot;Note&quot; is a pool a of loans of which are expected to pay Yield Ydf.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You want to estimate the mean and variance of the Loss in yield of non payment. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First and foremost you need to get a historical YL or at least a Data Generating Process for YL.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some approaches&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A) Historical Calculate historically implied loss in yield and then use that time series to extract mean and variance (This works if you have Ydf and Y)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;B) Simulation: Depending on what you know about the pool of loans you can simulate it's performance historically and in the future and use that to extract distributional moments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g. Loss in pool_t = Beta*Gdp_t + Beta2*Leverage_t + Beta3*HomeValue_t&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This generates a YL&lt;/p&gt;&#xA;&#xA;&lt;p&gt;C) MCMC: You assume some distribution + mean + moments and simulate accordingly, problem is you need an assumed variance (which will contaminate your simulation)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;D) Mix of A and B&#xA;You can build an ensemble using A (historical) and B (Fundamental) to ensure that your model reflects economic fundamentals and historical time series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would never assume loan defaults are uncorrelated unless you can very much justify this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please note:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some potential twists, if Ydf is dependent on interest rates (e.g. floating) defaults may increase or decrease with it, so model it appropriately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All in all, without much data your variance calculation will end up being a result of your distributional assumptions + simulation noise.&lt;/p&gt;&#xA;" OwnerUserId="2154" LastActivityDate="2014-12-31T15:43:05.340" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16038" PostTypeId="2" ParentId="15948" CreationDate="2014-12-31T16:33:23.637" Score="1" Body="&lt;p&gt;The anwser is clear cut, there isn't one. The high correlation between the 2 stocks is explained by a common underlying risk factor, for example both 2 gold mining companies.&#xA;This common factor explains the high correlation. The correlation doesn't mean that one 1 stock drives the other, meaning actual causation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best you can do is think about risk factors that could explain the high correlation and then use principle component analysis to select those which fit best. &lt;/p&gt;&#xA;" OwnerUserId="13950" LastActivityDate="2014-12-31T16:33:23.637" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16039" PostTypeId="1" CreationDate="2015-01-01T11:57:35.007" Score="2" ViewCount="90" Body="&lt;p&gt;I need to compare VaR before and after the recession. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a series of market returns for a period before, and a series of market returns for the period immediately after. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both have been bootstrapped 500+ times, allowing me to generate 500+ VaR's. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have put these VaRs in a histogram, and I was wondering if I could do a T-Test to find out if the difference is significant?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a feeling I cannot, as the distribution of VaR's is not normal, however this doesn't matter as the T-test takes means which are normally distributed?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone clarify what I could to do?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apologies for my lack of knowledge, I'm grateful for your patience.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="13938" LastEditorUserId="13938" LastEditDate="2015-01-01T14:21:34.900" LastActivityDate="2015-01-01T14:25:41.903" Title="Can you use a t-test on bootstrapped Value at Risk (VaR) figures?" Tags="&lt;returns&gt;&lt;var&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16040" PostTypeId="2" ParentId="16039" CreationDate="2015-01-01T14:25:41.903" Score="1" Body="&lt;p&gt;Using a t-test should be ok because even when the underlying distribution is not normal you have a large enough sample size which justifies the assumption that the distribution of the sample means should be approximately normal due to the &lt;a href=&quot;http://en.wikipedia.org/wiki/Central_limit_theorem&quot; rel=&quot;nofollow&quot;&gt;Central Limit Theorem&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2015-01-01T14:25:41.903" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16041" PostTypeId="1" AcceptedAnswerId="18571" CreationDate="2015-01-01T16:07:29.083" Score="3" ViewCount="372" Body="&lt;p&gt;If an interest rate model with the following $P$-dynamics for the short rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dr(t)=\mu(t,r(t))dt+\sigma(t,r(t))d\bar{W}(t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now consider a $T$-claim of the form $\chi = \Phi(r(T))$ with corresponding price process $Π(t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone help me to find stochastic differential of $Π(t)$ ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and show that the normalized price process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Z(t)=\frac{\Pi(t)}{B(t)}$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;is a $Q$-martingale.?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I appreciate any help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="13370" LastEditorUserId="13370" LastEditDate="2015-01-01T16:30:40.997" LastActivityDate="2015-06-29T20:46:56.400" Title="Normalized price process $Z(t)=\frac{\Pi(t)}{B(t)}$" Tags="&lt;option-pricing&gt;&lt;stochastic-processes&gt;&lt;martingale&gt;&lt;normalization&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16042" PostTypeId="1" CreationDate="2015-01-01T18:01:43.840" Score="3" ViewCount="299" Body="&lt;p&gt;I'm looking for a way to make my own Python backtester (like zipline or pyalgotrade) or improve one of these backtesters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One major lack of these backtesters is the lack of support of bracket orders (&quot;child&quot; stoploss and takeprofit orders linked to a &quot;parent&quot; order)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder how I should model bracket orders ?&lt;/p&gt;&#xA;" OwnerUserId="2838" LastActivityDate="2015-01-03T23:26:38.537" Title="How to model bracket orders?" Tags="&lt;python&gt;&lt;order&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16043" PostTypeId="2" ParentId="16036" CreationDate="2015-01-01T18:46:11.547" Score="4" Body="&lt;p&gt;It's because of onshore capital controls; units of currency cannot freely enter and leave the country and so currency held onshore (within the domain of the capital controls) is not fungible with currency held elsewhere.  Hence, due to the limitations of arbitrage, those two currencies are not tightly coupled.  They are related, since actual physical onshore exporters may be allowed to accept offshore currency (or vice versa for importers), but not perfectly.&lt;/p&gt;&#xA;" OwnerUserId="3491" LastActivityDate="2015-01-01T18:46:11.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16044" PostTypeId="2" ParentId="16036" CreationDate="2015-01-01T19:56:51.307" Score="5" Body="&lt;p&gt;Certain regulations in a country might inhibit the values of a unit of currency from being the same within the borders of the country and outside. There might be foreign exchange or banking regulations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the &lt;a href=&quot;https://en.wikipedia.org/wiki/Eurodollar&quot; rel=&quot;nofollow&quot;&gt;eurodollar&lt;/a&gt; rate is different from the dollar inside the US, since there are reserve requirements dictated by the Fed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, same underlying currency just different regulatory regimes give rise to different values.&lt;/p&gt;&#xA;" OwnerUserId="758" LastEditorUserId="758" LastEditDate="2015-01-08T17:43:05.677" LastActivityDate="2015-01-08T17:43:05.677" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16045" PostTypeId="2" ParentId="16019" CreationDate="2015-01-02T00:17:34.947" Score="0" Body="&lt;p&gt;As vonjd mentioned, you could do a t-test. However, as stated in your comments if you believe the standard deviation for each group is different (maybe you should do a Levene's test), you shouldn't use a t-test for two means. You should consider a non-parametric test such as Mann-Whitney.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2015-01-02T00:17:34.947" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16046" PostTypeId="2" ParentId="15985" CreationDate="2015-01-02T01:15:58.893" Score="1" Body="&lt;p&gt;Bloomberg has a Default Risk model, which is similar to what you are querying. You can see a screenshot &lt;a href=&quot;http://www.bloomberg.com/enterprise/content/uploads/sites/2/2014/07/APPROVED-57712374-ES-Credit-Devault-SFCT-1.pdf&quot; rel=&quot;nofollow&quot;&gt;in this PDF&lt;/a&gt;. There you can also see the kind of variables they use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can access it by typing DRSK at the CDS screen is Bloomberg. (If the screenshot in the PDF is not clear enough, let me know and I can post one with better resolution from Bbg)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This model uses fundamental data, and obviously they have calibrated and backtested it; however it is a proprietary model, therefore you might have a hard time finding the details. You can try googling for it, there might be a white paper on it.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2015-01-02T01:15:58.893" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16047" PostTypeId="1" AcceptedAnswerId="16575" CreationDate="2015-01-02T02:02:46.967" Score="1" ViewCount="193" Body="&lt;p&gt;I will write a test based on Excel and one of the topics is &quot;The Asset Liability related analysis: including the input assumptions generation, constraints, portfolio optimization analysis and results interpretation&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am a little confused by this description. My guess is they will provide some historical returns of a few asset classes and ask me to construct the minimum variance portfolio. But this is only the portfolio optimization part. I am not sure how they can test &quot;input assumptions generation, constraints, and results interpretation&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could someone share how they would interpret this topic?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot.&lt;/p&gt;&#xA;" OwnerUserId="13961" LastEditorUserId="7186" LastEditDate="2015-02-15T14:19:10.370" LastActivityDate="2015-08-14T19:26:06.313" Title="Asset Liability Management Test Topic Interpretation" Tags="&lt;optimization&gt;&lt;modern-portfolio-theory&gt;&lt;asset-allocation&gt;&lt;homework&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16048" PostTypeId="1" AcceptedAnswerId="16053" CreationDate="2015-01-02T02:26:58.087" Score="4" ViewCount="5583" Body="&lt;p&gt;I am taking &quot;Financial Engineering and Risk Management Part I&quot; from Columbia University on coursera and I got a seemingly simple question wrong on the first quiz. This is all based on the no-arbitrage arguments. Here is the question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/tGi3F.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;During the lesson we constructed a portfolio to try to get the value of a forward at an intermediate time. Here is what we got:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/dwFRI.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What was missing at this point was how to get F(t) and F(0). A few slides back we did:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/IZnPf.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ok so now I have all of the ingredients for this forward soup. I got the forward price at time zero with the stock price at time zero divided by the discount for the whole period (two 6 month periods so its squared). Then I got the forward price at 6 months by taking the price at 6 months and dividing it by the discount for one six month period. I took the difference between the two and multiplied it by the discount factor for six months (between t and T). I ended up rounding off to 27. What am I doing wrong? Below is a picture of my calculations (I did not round any intermediate calculations). I'm more of a pencil and paper guy but if you want I can type it all up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/0ajuA.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, Happy New Year to you all!&lt;/p&gt;&#xA;" OwnerUserId="13962" LastActivityDate="2016-10-23T17:32:57.380" Title="Simple value of a Forward contract at an intermediate time question" Tags="&lt;forward&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16049" PostTypeId="2" ParentId="16048" CreationDate="2015-01-02T09:38:46.597" Score="0" Body="&lt;p&gt;If we compound semi-annually and we have half year to go, then the current forward price is&#xA;$$F = S \left(1+\frac{r}{2}\right) = 125 \left(1+\frac{0.10}{2}\right)$$&#xA;Isn't it as simple as that?&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2015-01-02T09:38:46.597" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16050" PostTypeId="1" CreationDate="2015-01-02T09:50:59.443" Score="1" ViewCount="349" Body="&lt;p&gt;I have heard from several different sources, e.g. professors, books and traders, that daytraders and quants avoid holding positions overnight and during holidays and weekends. Instead, they sell their positions late in the day and buy it back in the morning. The reason is supposed to be that the trader wants to avoid the exposure to &quot;bad news&quot; during a time he can not act. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if that is so, someone must be ready to buy those stocks to hold them over night. Who does that? And for what purpose? Are there banks that hold postitions overnight only, as a strategy?&lt;/p&gt;&#xA;" OwnerUserId="8039" LastActivityDate="2015-01-02T17:13:45.887" Title="Who holds stock overnight?" Tags="&lt;equities&gt;&lt;quant-trading-strategies&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16052" PostTypeId="2" ParentId="16050" CreationDate="2015-01-02T11:18:33.657" Score="1" Body="&lt;p&gt;There are players in the market who do keep long term positions in stocks:&#xA;- banks in their bank book&#xA;- banks in their trading book&#xA;- mutual funds&#xA;- private persons on their accounts&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume that everybody who is not specialized in day trading only usually holds stocks overnight because with every buy/sell the trader goes through one bid and one offer which can be costly.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-01-02T11:18:33.657" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16053" PostTypeId="2" ParentId="16048" CreationDate="2015-01-02T11:43:43.850" Score="1" Body="&lt;p&gt;Always take care that you got the compounding frequency right. I recommend you take a deeper look at &#xA;&lt;a href=&quot;http://breakingdownfinance.com/finance-topics/derivative-valuation/forward-contract/&quot; rel=&quot;nofollow&quot;&gt;http://breakingdownfinance.com/finance-topics/derivative-valuation/forward-contract/&lt;/a&gt; .&#xA;You can download an excel file here and take a deeper look at the formula. You can also give  in the compounding frequency as input.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case of doubt, or as a standard procedure, you could first start transform it to continuous compounding and use this to discount to avoid mistakes.&lt;/p&gt;&#xA;" OwnerUserId="13950" LastEditorUserId="13950" LastEditDate="2015-01-02T11:49:13.413" LastActivityDate="2015-01-02T11:49:13.413" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16054" PostTypeId="2" ParentId="16017" CreationDate="2015-01-02T11:47:34.943" Score="1" Body="&lt;p&gt;I have to correct myself: Looking at the integral it is clear that $E[\exp(\exp(Y))]$ is infinite for Gaussian (and most other) $Y$. The approximative argument can be found &lt;a href=&quot;http://www.mathematik.uni-muenchen.de/~filipo/ZINSMODELLE/zinsmodelle3.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;:&#xA;$E[\exp(\int_0^{dt} r_u du)] \approx E[(r_0 + r_{dt})/2 dt]$ thus it is the expectation of the exponential of a log-normal (= exponential of a normal)..&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-01-02T11:47:34.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16056" PostTypeId="1" CreationDate="2015-01-02T13:30:13.920" Score="4" ViewCount="9917" Body="&lt;p&gt;I have 1 dependent variable and 3 independent variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I run multiple regression, and find that the p value for one of the independent variables is higher than 0.05 (95% is my confidence level).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I take that variable out and run it again. Both remaining independent variables have $p$-value  less than 0.05 so I conclude I have my model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I correct in thinking that initially, my null hypothesis is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$H_0=  β_1=β_2 = \dots =β_{k-1} = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and that the alternative hypothesis is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$H_1=\textrm{At least one } β \neq 0  \textrm{ whilst } p&amp;lt;0.05$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And that after the first regression, I do not reject, as one variable does not meet my confidence level needs...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I run it again, and then reject the null as all $p$-values are significant?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is what I have written accurate?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Thanks to Bob Jansen for improving this aesthetics of this post.&lt;/p&gt;&#xA;" OwnerUserId="13938" LastEditorUserId="13938" LastEditDate="2015-01-04T00:35:33.623" LastActivityDate="2017-06-16T18:16:17.700" Title="Null and Alternative hypothesis for multiple linear regression" Tags="&lt;modelling&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16057" PostTypeId="1" CreationDate="2015-01-02T14:44:04.563" Score="6" ViewCount="4994" Body="&lt;p&gt;Is there any software out there that currently would allow you to scan historical charts and look for a specific pattern and then show you that pattern for a list of stocks. Google finance and yahoo finance have all the charting data needed to visually detect certain patterns, but I was wondering if there was software out that I could define a particular pattern and then it would show me a bunch of real world examples of that pattern by scanning a dump of symbols. Does any such software exist or something to do something similar to this? I actually have a custom pattern I want to scan (that or I do not yet know the name of it) Not really sure how to word this but I am thinking of having it scan the recent behavior of a stock and then to scan a list of symbols for that pattern but historically back in time, not the present.&lt;/p&gt;&#xA;" OwnerUserId="13965" LastEditorUserId="13965" LastEditDate="2015-01-02T15:06:44.523" LastActivityDate="2018-01-16T11:50:09.267" Title="Scan for chart patterns software" Tags="&lt;charts&gt;&lt;trading-patterns&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16059" PostTypeId="2" ParentId="16057" CreationDate="2015-01-02T15:49:13.813" Score="7" Body="&lt;p&gt;I know of two sites that promise to do that but I haven't used either of them so I cannot tell you how reliable they are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://thepatternsite.com/chartpatterns.html&quot; rel=&quot;noreferrer&quot;&gt;http://thepatternsite.com/chartpatterns.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.priceactionlab.com/Manual/manual.html&quot; rel=&quot;noreferrer&quot;&gt;http://www.priceactionlab.com/Manual/manual.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The excellent blog systematic investor has some articles about how to do it in R:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://systematicinvestor.wordpress.com/2012/01/13/time-series-matching/&quot; rel=&quot;noreferrer&quot;&gt;http://systematicinvestor.wordpress.com/2012/01/13/time-series-matching/&lt;/a&gt; &lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://systematicinvestor.wordpress.com/2012/01/17/time-series-matching-strategy-backtest/&quot; rel=&quot;noreferrer&quot;&gt;http://systematicinvestor.wordpress.com/2012/01/17/time-series-matching-strategy-backtest/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://systematicinvestor.wordpress.com/2012/01/20/time-series-matching-with-dynamic-time-warping/&quot; rel=&quot;noreferrer&quot;&gt;http://systematicinvestor.wordpress.com/2012/01/20/time-series-matching-with-dynamic-time-warping/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://systematicinvestor.wordpress.com/2012/05/22/classical-technical-patterns/&quot; rel=&quot;noreferrer&quot;&gt;http://systematicinvestor.wordpress.com/2012/05/22/classical-technical-patterns/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In general this is not a trivial problem. If you are interesting in some theoretical background the following papers may be for you:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.cse.ust.hk/~leichen/courses/comp630p/collection/reference-4-6.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.cse.ust.hk/~leichen/courses/comp630p/collection/reference-4-6.pdf&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://cs.stanford.edu/people/saswat/research/one.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://cs.stanford.edu/people/saswat/research/one.pdf&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For a much broader approach you might want to check out the book &lt;a href=&quot;http://books.google.de/books?id=jbD47VkOHAEC&amp;amp;lpg=PP1&amp;amp;pg=PP1#v=onepage&amp;amp;q&amp;amp;f=false&quot; rel=&quot;noreferrer&quot;&gt;Evidence Based Technical Analysis&lt;/a&gt; by David Aronson.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In it he applies statistical techniques to determine whether certain time series patterns have any predictive power. It's an interesting read and should equip you with some ideas on how to differentiate between folklore and statistical rigor. It also gives you ample literature references.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find a good overview and summary of the book on &lt;a href=&quot;http://www.cxoadvisory.com/2526/technical-trading/evidence-based-technical-analysis-applying-the-scientific-method-and-statistical-inference-to-trading-signals-chapter-by-chapter-review/&quot; rel=&quot;noreferrer&quot;&gt;CXO Advisory&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also find further material on the &lt;a href=&quot;http://www.evidencebasedta.com&quot; rel=&quot;noreferrer&quot;&gt;webpage of the author&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Automated Trading System-blog has a few posts about the book with a helpful tool at the end:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.automated-trading-system.com/evidence-based-technical-analysis-aronson-book/&quot; rel=&quot;noreferrer&quot;&gt;http://www.automated-trading-system.com/evidence-based-technical-analysis-aronson-book/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.automated-trading-system.com/bootstrap-test/&quot; rel=&quot;noreferrer&quot;&gt;http://www.automated-trading-system.com/bootstrap-test/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;and here the conclusion with the free tool for the bootstrap-test:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.automated-trading-system.com/bootstrap-take-2-data-mining-bias-code-and-using-geometric-mean/&quot; rel=&quot;noreferrer&quot;&gt;http://www.automated-trading-system.com/bootstrap-take-2-data-mining-bias-code-and-using-geometric-mean/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="12" LastActivityDate="2015-01-02T15:49:13.813" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16060" PostTypeId="2" ParentId="3284" CreationDate="2015-01-02T15:54:02.747" Score="3" Body="&lt;p&gt;DO NOT USE EOD DATA!!! Their data is incomplete even for 2014... The September zip at 1/5/10/15/30/60 minute bars was generated and only goes up to Sept 28th... Where's the data for the 29th and 30th?&lt;/p&gt;&#xA;" OwnerUserId="13940" LastActivityDate="2015-01-02T15:54:02.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16061" PostTypeId="2" ParentId="15247" CreationDate="2015-01-02T16:50:14.553" Score="6" Body="&lt;p&gt;You can find the answers here:&lt;br&gt;&#xA;&lt;a href=&quot;http://www.wiley.com/legacy/wileychi/pwiqf2/degree.html&quot; rel=&quot;noreferrer&quot;&gt;http://www.wiley.com/legacy/wileychi/pwiqf2/degree.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2015-01-02T16:50:14.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16062" PostTypeId="2" ParentId="15249" CreationDate="2015-01-02T16:53:34.450" Score="2" Body="&lt;p&gt;You can find the solution here:&lt;br&gt;&#xA;&lt;a href=&quot;http://www.wiley.com/legacy/wileychi/pwiqf2/supp/c02.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.wiley.com/legacy/wileychi/pwiqf2/supp/c02.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For all solutions see my answer here: &lt;a href=&quot;https://quant.stackexchange.com/a/16061/12&quot;&gt;https://quant.stackexchange.com/a/16061/12&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2015-01-02T17:03:01.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16063" PostTypeId="2" ParentId="16050" CreationDate="2015-01-02T17:13:45.887" Score="0" Body="&lt;p&gt;You can decompose price/returns into an intraday and overnight effect and hold baskets that may be profitable (or expected) overnight.&lt;/p&gt;&#xA;" OwnerUserId="2154" LastActivityDate="2015-01-02T17:13:45.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16064" PostTypeId="1" AcceptedAnswerId="16069" CreationDate="2015-01-02T19:20:42.363" Score="4" ViewCount="4518" Body="&lt;p&gt;Let $C(K,T,S_0)$ denote  the price of an European call option with strike K and maturity T on underlying price $S_0$. Assume interest rate $r&amp;gt;0$.&#xA;Then of course $C(K,T,S_0) \geq 0$ and $C(K,T,S_0) \geq S_0 - K e^{-rT}$ both to avoid arbitrage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider now $C(K,T_1,S_0)$ and $C(K,T_2,S_0)$ with $T_2&amp;gt;T_1$ and assume &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;C(K,T_1,S_0) &amp;gt; C(K,T_2,S_0)&#xA;$$&#xA;Sell the expensive and buy the cheap, put money in the bank. At  $T_1$ we have &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;C(K,T_2,S_{T_1}) - \max\{S_{T_1}-K;0\} \geq 0&#xA;$$&#xA;with the money in the bank an arbitrage. We conclude the call price is increasing in maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can a similar argument be made for the put? To me the corresponding inequality is not good enough and using put call parity did not help either. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks :)&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2015-01-03T10:02:44.193" Title="Effect of time to maturity on european put option" Tags="&lt;options&gt;&lt;option-strategies&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16065" PostTypeId="2" ParentId="15973" CreationDate="2015-01-02T20:50:52.087" Score="0" Body="&lt;p&gt;This appears to be one approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.fixtradingcommunity.org/mod/file/view.php?file_guid=30528&quot; rel=&quot;nofollow&quot;&gt;http://www.fixtradingcommunity.org/mod/file/view.php?file_guid=30528&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13902" LastActivityDate="2015-01-02T20:50:52.087" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16066" PostTypeId="2" ParentId="16056" CreationDate="2015-01-02T20:55:10.560" Score="2" Body="&lt;p&gt;These are independent variables so the hypothesis applies to each parameter independently.&lt;/p&gt;&#xA;" OwnerUserId="13902" LastActivityDate="2015-01-02T20:55:10.560" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="16067" PostTypeId="1" AcceptedAnswerId="16070" CreationDate="2015-01-03T06:32:39.010" Score="2" ViewCount="647" Body="&lt;p&gt;Newbie question. I am reading about stationary series and understand that it has many forms:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;mean stationary&lt;/li&gt;&#xA;&lt;li&gt;variance stationary&lt;/li&gt;&#xA;&lt;li&gt;covariance stationary&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;My question is does unit root stationary imply all of the above? If I run an augmented dicky fuller test and find that the series is unit root stationarity is that sufficient to say that the series is stationary in all respects? &lt;/p&gt;&#xA;" OwnerUserId="12202" LastActivityDate="2015-01-07T22:29:25.707" Title="Does unit root stationary imply mean stationary and variance stationary?" Tags="&lt;time-series&gt;&lt;econometrics&gt;&lt;stationarity&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16068" PostTypeId="2" ParentId="212" CreationDate="2015-01-03T07:50:35.953" Score="0" Body="&lt;p&gt;I am not sure why you need to use ESKC relation to make an intermediary point appear since your payoff is on the final point. It renders the whole thing more complex than it needs to be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually path integrals representations are then implemented as a MC simulation, using that the path integral action term gives a representation of small time transition, or if you can solve the path integral on paper, well then you get a more-or-less closed form for your transition then you work from that point forward.&lt;/p&gt;&#xA;" OwnerUserId="5316" LastActivityDate="2015-01-03T07:50:35.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16069" PostTypeId="2" ParentId="16064" CreationDate="2015-01-03T10:02:44.193" Score="2" Body="&lt;p&gt;puts can be decreasing in time to maturity. This is why you sometimes early exercise an American put. This tends to happen deeply in the money with large r and zero dividend rate.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-01-03T10:02:44.193" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16070" PostTypeId="2" ParentId="16067" CreationDate="2015-01-03T16:50:00.310" Score="2" Body="&lt;p&gt;Consider the following AR(1) process with i.i.d. normal errors that have zero mean and finite variance $\sigma^2&amp;gt;0$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ x_t  = (1-\rho)\mu + \rho x_{t-1} + \epsilon _t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now suppose $ \rho = 1/2$ and $\mu = 1$. This process does not have a unit root, and it is not mean stationary. At any point in time, the process has finite variance, although as time diverges to infinity, the level of $x_t$ diverges to infinity as well.&lt;/p&gt;&#xA;" OwnerUserId="3478" LastActivityDate="2015-01-03T16:50:00.310" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16072" PostTypeId="1" AcceptedAnswerId="16076" CreationDate="2015-01-03T18:59:23.797" Score="4" ViewCount="998" Body="&lt;p&gt;I'm trying to learn Black-Litterman. I feel like I get the overall idea from books like Risk and Asset Allocation by Meucci as well as some of the early papers which develop the model. What I would really like to see is a simple example worked out in detail by hand. Say a portfolio with 2 or 3 assets. Can anyone provide such an example or perhaps a reference?&lt;/p&gt;&#xA;" OwnerUserId="13698" LastActivityDate="2015-01-03T23:14:34.057" Title="Black-Litterman example" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;reference-request&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16073" PostTypeId="1" AcceptedAnswerId="16075" CreationDate="2015-01-03T21:10:13.903" Score="2" ViewCount="3229" Body="&lt;p&gt;I have a European call option with current stock price $S_0$, strike $K$, risk-free rate $r$, volatility $\sigma$, and time to maturity $T$ years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume that the stock price at time $t$, which is given by $S_t$, follows a geometric brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need to use the &lt;a href=&quot;http://merage.uci.edu/~jorion/oc/case4.html&quot; rel=&quot;nofollow&quot;&gt;delta-normal valuation method&lt;/a&gt; to compute the 95% VaR over a horizon of 3 days for a long position on the call. How do I do this?&lt;/p&gt;&#xA;" OwnerUserId="13698" LastEditorUserId="467" LastEditDate="2015-03-02T02:41:54.777" LastActivityDate="2015-03-02T02:41:54.777" Title="How to compute the VaR for European Call, using the delta-normal method?" Tags="&lt;options&gt;&lt;var&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16074" PostTypeId="2" ParentId="16073" CreationDate="2015-01-03T21:54:43.043" Score="3" Body="&lt;p&gt;You could simulate many (100000) 3 day price paths for the stock using the geometric brownian motion. Then for each simulated path, calculate the option value and store them. Then calculate the return difference for each of the calls and order them from smallest to largest. The 5% cutoff is your 3 day 95% VaR.&lt;/p&gt;&#xA;" OwnerUserId="13950" LastEditorUserId="13950" LastEditDate="2015-01-04T09:35:05.010" LastActivityDate="2015-01-04T09:35:05.010" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16075" PostTypeId="2" ParentId="16073" CreationDate="2015-01-03T21:58:58.830" Score="-1" Body="&lt;p&gt;When the stockprice follows a GBM, the arbitrage-free value of an EU call is given by the Black Scholes model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;  C(S, t) &amp;amp;= N(d_1)S_0 - N(d_2) Ke^{-r(T - t)} \\&#xA;     d_1 &amp;amp;= \frac{1}{\sigma\sqrt{T - t}}\left[\ln\left(\frac{S_0}{K}\right) + \left(r + \frac{\sigma^2}{2}\right)(T - t)\right] \\&#xA;     d_2 &amp;amp;= d_1 - \sigma\sqrt{T - t}&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The stockprice is given by&#xA;$$S_t=S_0e^{(r-\sigma^2/2)t+tW_t},\quad W_t\sim N(0,t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_t$ is the only random term and &lt;a href=&quot;http://en.wikipedia.org/wiki/Log-normal_distribution&quot; rel=&quot;nofollow&quot;&gt;log-normally&lt;/a&gt; distributed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Its inverse function for the VaR quantile can only be calculated numerically as by MATLAB &lt;a href=&quot;http://ch.mathworks.com/help/stats/logninv.html&quot; rel=&quot;nofollow&quot;&gt;logninv&lt;/a&gt; function (assuming 250 trading days):&#xA;$$VaR_\alpha^S=\text{logninv}\left(\alpha,\mu_S=(r-\sigma^2)/2,\sigma_S=3/250\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As we know, the call option delta is positive, such that its value will always fall and increase with the stock price. Hence the Option VaR follows as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$VaR_\alpha^C=C(S_0,0)-C(VaR_\alpha^S, 3/250)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which corresponds to the loss at the $\alpha$ quantile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The option value also falls deterministically with decreasing time to maturity, as represented by the &lt;a href=&quot;http://en.wikipedia.org/wiki/Black%E2%80%93Scholes_model#The_Greeks&quot; rel=&quot;nofollow&quot;&gt;theta Greek&lt;/a&gt;:&#xA;$$Theta(t)=\frac{\partial C}{\partial t}=	-\frac{S_0 N'(d_1) \sigma}{2 \sqrt{T - t}} - rKe^{-r(T - t)}N(d_2)\,	-\frac{S_0 N'(d_1) \sigma}{2 \sqrt{T - t}} + rKe^{-r(T - t)}N(-d_2)$$&#xA;That loss is however already included in calculating the difference $C(S_0,0)-C(VaR_\alpha^S, 3/250)$.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2015-01-03T22:35:29.797" LastActivityDate="2015-01-03T22:35:29.797" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16076" PostTypeId="2" ParentId="16072" CreationDate="2015-01-03T23:14:34.057" Score="4" Body="&lt;p&gt;Here is a guide by morningstar: &quot; A step by step guide to the black litterman model&quot; &#xA;&lt;a href=&quot;https://corporate.morningstar.com/ib/documents/MethodologyDocuments/IBBAssociates/BlackLitterman.pdf&quot; rel=&quot;nofollow&quot;&gt;https://corporate.morningstar.com/ib/documents/MethodologyDocuments/IBBAssociates/BlackLitterman.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2154" LastActivityDate="2015-01-03T23:14:34.057" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16077" PostTypeId="2" ParentId="16042" CreationDate="2015-01-03T23:26:38.537" Score="3" Body="&lt;p&gt;You will need an entry and then a &quot;Grouped&quot; stop loss and take profit (one cancels other). An implementation of this exists in quantstrat in R called ordersets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Documentation and source code can be found here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://r-forge.r-project.org/scm/viewvc.php/pkg/quantstrat/R/orders.R?view=markup&amp;amp;root=blotter&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://r-forge.r-project.org/scm/viewvc.php/pkg/quantstrat/R/orders.R?view=markup&amp;amp;root=blotter&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will unfortunately need to port this and other infrastructure over to python.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my opinion the Blotter/Quantstrat backtesting framework has the most support for various order types it also reconciles with the brokerage statements of one of the contributors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example of a Q/A solving this in S/O. &lt;a href=&quot;https://stackoverflow.com/questions/10445936/r-quantstrat-orders-cancel-each-other&quot;&gt;https://stackoverflow.com/questions/10445936/r-quantstrat-orders-cancel-each-other&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2154" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2015-01-03T23:26:38.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16078" PostTypeId="1" AcceptedAnswerId="16079" CreationDate="2015-01-04T00:11:27.957" Score="3" ViewCount="766" Body="&lt;p&gt;Take a liquid market like US T-bills, notes and bonds... Who would want a long-term security that yielded less than the short?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even if someone is a long-term lender, why wouldn't they hold the short-term, higher-yielding securities then switch to the long-term securities if and only if they yielded more?  Why wouldn't such arbitrage prevent the possibility of an inverted yield curve?&lt;/p&gt;&#xA;" OwnerUserId="7709" LastActivityDate="2015-01-05T00:39:52.027" Title="How can an inverted yield curve in a liquid market exist?" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;yield-curve&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16079" PostTypeId="2" ParentId="16078" CreationDate="2015-01-04T00:29:35.743" Score="8" Body="&lt;p&gt;There are many reasons why a yield curve can be inverted. A default-free yield curve reflects a combination of -&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;market expectation of future short-term interest rates;&lt;/li&gt;&#xA;&lt;li&gt;bond risk premium: usually positive, longer duration bonds are more volatile and riskier, so investors demand a compensation in the form of higher yields;&lt;/li&gt;&#xA;&lt;li&gt;convexity.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Let's consider a case where market expectation is flat (people don't think interest rate will rise or fall in the next 10 years) and bond risk premium is zero. You may think the yield should be flat, but it actually would still be inverted. This is because longer term bonds have higher convexity, so investors are willing to accept a lower yield in order to gain this &quot;convexity advantage.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now consider a world where convexity isn't considered valuable and market expectation is still flat, but bond risk premium can be negative, causing the yield curve to invert. Throughout much of 2012 and 2013, US bond risk premium was indeed negative, partially because of QE, and partially because of flight-to-quality flows (Europe was blowing up!)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, the yield curve can be downward sloping because the market expects interest rate to decline in the future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure why you think there's an arbitrage when the curve is inverted. Consider a scenario where 1-year rate is 5% and 10-year rate is 4%. An investor then purchases the 1-year note purely because of yield considerations. But there's no reason why the yield curve can't flatten more. Let's say 1-year rate rises to 6% (maybe because the Fed keeps hiking short-term policy rates), and 10-year rate declines to 3.5% (perhaps because of Foreign central bank buying). In this case, the 1-year bond LOSES money, while the 10-year bond actually makes money.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2015-01-04T00:29:35.743" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16080" PostTypeId="2" ParentId="16057" CreationDate="2015-01-04T03:04:32.340" Score="2" Body="&lt;p&gt;You can try Macroaxis. Although it does not let you define your custom patterns but it can plot and recognize more than 300 technical indicator patterns on historical data. You can see example of pattern recognition for google at &lt;a href=&quot;http://www.macroaxis.com/invest/Pattern-Recognition/GOOG&quot; rel=&quot;nofollow&quot;&gt;http://www.macroaxis.com/invest/Pattern-Recognition/GOOG&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Disclaimer: I work for Macroaxis&lt;/p&gt;&#xA;" OwnerUserId="13973" LastActivityDate="2015-01-04T03:04:32.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16081" PostTypeId="1" AcceptedAnswerId="31387" CreationDate="2015-01-04T19:50:55.870" Score="4" ViewCount="2354" Body="&lt;p&gt;If I have &lt;strong&gt;three&lt;/strong&gt; asset classes and their historical weekly returns for five years, how can I construct a minimum variance portfolio and &lt;strong&gt;an efficient frontier plot&lt;/strong&gt; with Excel? To do that do I have to assume the return is normally distributed? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: there's a host of tutorials to plot the frontier for two assets as long as I have a table of say 10 possible weights of one asset. But with three assets or more plotting would be challenging as I have to come up with a much bigger table for the combination of the weights of these assets. As such I was wondering if there is some kind of simulation algorithm or any techniques to make it easier.&lt;/p&gt;&#xA;" OwnerUserId="13961" LastEditorUserId="13961" LastEditDate="2015-01-05T21:32:29.033" LastActivityDate="2016-12-08T11:25:43.487" Title="Portfolio Optimization with Monte Carlo Simulation - How to do it with Excel?" Tags="&lt;monte-carlo&gt;&lt;modern-portfolio-theory&gt;&lt;excel&gt;&lt;minimum-variance&gt;&lt;vba&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16083" PostTypeId="1" AcceptedAnswerId="16112" CreationDate="2015-01-04T23:27:08.287" Score="2" ViewCount="377" Body="&lt;p&gt;One of the required assumptions for multiple linear regression is that residuals are normally distributed, correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After running my regression, my normal probability plot is showing the typical 'heavy tail' S shape.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this inability to satisfy the assumption deem my whole model useless? Is there anyway I can get normal residuals?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My dependent variable is VaR, and my independent variables are Average Return, Log of Market value, dummy variable 1 and dummy variable 2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I've tried transforming the independent variable (VaR)(Square root, Log, reciprocal), but it doesn't seem to make sufficient difference&lt;/p&gt;&#xA;" OwnerUserId="13938" LastEditorUserId="13938" LastEditDate="2015-01-05T00:14:11.107" LastActivityDate="2015-01-07T21:20:27.937" Title="Ran multivariate linear regression, checked normal probability plot, residuals are not normal. What can I do?" Tags="&lt;regression&gt;&lt;var&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16084" PostTypeId="2" ParentId="16083" CreationDate="2015-01-05T00:18:41.793" Score="7" Body="&lt;p&gt;Regression analysis, as a minimization of the sum of squared errors, does not require normality of the error term. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The requirements are that errors are homoscedastic and uncorrelated. And these are the fundamental assumptions (together with exogeneity). Then estimators are unbiased, optimal (exhibit the minimum variance within the class of unbiased estimators) and consistent (the variance also goes to zero with sample size). Normality is not required.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If errors are normal, then we can also say something about the standard errors of these estimates and build confidence intervals. However, there are ways to build these confidence intervals even if the errors are not Gaussian, for example by bootstrapping them. Therefore I would focus on the other assumptions which are more material.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2015-01-05T00:24:33.743" LastActivityDate="2015-01-05T00:24:33.743" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16085" PostTypeId="2" ParentId="16078" CreationDate="2015-01-05T00:39:52.027" Score="4" Body="&lt;p&gt;Inverted curves (typically) appear when the economy is overheating. There is full employment but investment demand is still there and it is creating inflationary pressures. The central bank increases the short rate (which is their classical policy instrument) to take money off the table and cool down investment demand. However, the market knows that this is part of the cycle, and expects rates to go down in the medium term as the economy cools down. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this scenario, holding the short dated security might not be optimal as this requires purchasing another security when the first matures, at rates which will most probably be lower and might be highly uncertain. For example, the central bank can tip the economy into a recession and then cut the rates dramatically in response: then one would face very low yields when rolling the position over. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The market will price all these eventualities and produce an inverted curve. There is no issue of arbitrage or irrational behaviour.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another instance of inverted curves occurs when a sovereign is in trouble, but this is more related to credit risk rather than macro conditions.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2015-01-05T00:39:52.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16086" PostTypeId="1" CreationDate="2015-01-05T09:07:26.640" Score="2" ViewCount="166" Body="&lt;p&gt;I'm working out the examples in the paper &quot;Changes of Numeraire, Changes of Probability Measure and Option Pricing&quot;, corollary 3. &#xA;An option of exchanging asset 2 against asset 1 at time T, its time-0 value under r.n measure $Q$, taking constant rate and K=1, is $$C(0)=E^Q[e^{-rT}(S^1_T-KS^2_T)1_A]$$ where A is the event $S^1_T&amp;gt;KS^2_T$. Then (and I guess it may be the step that makes no sense : namely splitting the max function in 2 pieces...) $$C(0)=E^Q[e^{-rT}S^1_T1_A]-E^Q[e^{-rT}S^2_T1_A]$$ Define $\frac{dQ}{dQ^{S1}}=\frac{e^{rT}/1}{S^1_T/S^1_0}$ and $\frac{dQ}{dQ^{S2}}=\frac{e^{rT}/1}{S^2_T/S^2_0}$ $$C(0)=E^{Q^{S1}}[\frac{dQ}{dQ^{S1}}e^{-rT}S^1_T1_A]-E^{Q^{S2}}[\frac{dQ}{dQ^{S2}}e^{-rT}S^2_T1_A]=S^1_0Q^{S1}(A)-KS^2_0Q^{S2}(A)$$&#xA;However in the paper, the result is $S^1_0Q^{S2}(A)-KS^2_0Q^{S1}(A)$...&#xA;Also on the Wikipedia about the Margrabe formula it is said that the derivation is done using only $S^2_t$ as the numeraire. If I were to guess I'd say that my reckless splitting of the expectation is erroneous, but I'm not overly sure about it either... so any help is appreciated&lt;/p&gt;&#xA;&#xA;&lt;p&gt;*Edit: After actually deriving the result for the first term $Q^{S2}(A)$ (with 0 correlation and constant rate for simplicity) I get the same result as the Margrabe formula... so I would have to say, either those simplifications lead to artifacts that make my result agree with Margrabe, or there is just a typo in the original paper...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="5316" LastEditorUserId="36636" LastEditDate="2020-07-14T22:50:30.423" LastActivityDate="2020-07-14T22:50:30.423" Title="Value of an option to exchange an asset for another" Tags="&lt;option-pricing&gt;&lt;numeraire&gt;&lt;margrabes-formula&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16087" PostTypeId="1" CreationDate="2015-01-05T10:44:12.320" Score="2" ViewCount="10533" Body="&lt;p&gt;I load swap rates data from Bloomberg in excel using the command&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;=BDH(Ticker,&quot;Px Last&quot;,Start_Date,End_Date,&quot;Dts&quot;,FALSE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The tickers I use are &quot;USSW1 Curncy&quot;, &quot;EUSA1 Curncy&quot;, &quot;BPSW1 Curncy&quot;, etc...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all, I would like to know what this &quot;Curncy&quot; keyword stand for. Then as I am also interested in LIBOR rates, I would like to know if I have to add this &quot;Curncy&quot; keyword to &quot;US0001W&quot;, &quot;US0001M&quot; as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please note that I don't have a direct access to Bloomberg, so I need firstly to have a proper template. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="8047" LastEditorUserId="2154" LastEditDate="2015-01-06T22:28:39.757" LastActivityDate="2015-01-06T22:28:39.757" Title="Bloomberg Libor Rates" Tags="&lt;bloomberg&gt;&lt;excel&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16088" PostTypeId="1" CreationDate="2015-01-05T11:15:37.557" Score="1" ViewCount="212" Body="&lt;p&gt;My Null for the T-test is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;h0: -tcritical &amp;lt; Tstat &amp;lt; +tcritical&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I require confidence level of 95%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If my empirical result satisfies the null, but not my p-value requirements,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;does this mean that the test is inconclusive? Or that the null is not rejected/rejected?&lt;/p&gt;&#xA;" OwnerUserId="13938" LastActivityDate="2015-01-05T12:19:57.473" Title="Can a null be inconclusive?" Tags="&lt;theory&gt;" AnswerCount="1" CommentCount="3" ClosedDate="2015-01-05T15:31:29.673" ContentLicense="CC BY-SA 3.0" />
  <row Id="16090" PostTypeId="1" AcceptedAnswerId="16105" CreationDate="2015-01-05T11:41:03.720" Score="1" ViewCount="209" Body="&lt;p&gt;I was talking to a friend recently and he asked me the following question. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I have a device which perfectly (with 100% accuracy) predicts that both a bond (e.g. AAA rated government bond) and the shares of a listed company (e.g. Google) yield 5% over the next year. If I had US$1 million, which one should I invest in?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although it seems kind of vague, I'm assuming that I have to sell both instruments after a year to realise the 5% return. My answer was the bond because the a government bond rated at AAA would be very unlikely to go bankrupt (although the country not being bankrupt might be implied by the yield) and bonds are usually less volatile. Further, I at least have a bit of recourse upon default vs shares. Upon giving him the answer, I was told that my answer wasn't totally correct. Does anyone think I'm missing anything? Also is there a way to model this vague question to back up my point of view? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; Taking into account coupons and dividends, maybe the bond is preferred iff coupon rate &gt; dividend rate. Also, maybe I can forecast the bond YTM. Any ideas will eb appreciated.  &lt;/p&gt;&#xA;" OwnerUserId="13984" LastEditorUserId="13984" LastEditDate="2015-01-05T12:13:46.163" LastActivityDate="2015-01-06T14:11:47.713" Title="Investment: Bond vs Equity" Tags="&lt;equities&gt;&lt;portfolio-management&gt;&lt;bond&gt;&lt;yield-curve&gt;&lt;quantitative&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16091" PostTypeId="2" ParentId="16090" CreationDate="2015-01-05T11:51:34.723" Score="0" Body="&lt;p&gt;Maybe I'm missing the tricky part of this trick question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the device is 100% accurate it doesn't matter as both will yield 5% with certainty. This is the same unless you want to take into account coupons or dividends.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2015-01-05T11:51:34.723" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16092" PostTypeId="2" ParentId="16088" CreationDate="2015-01-05T12:12:54.163" Score="2" Body="&lt;p&gt;That means the null is not rejected and therefore test is inconclusive. With this type of testing you can only try to reject the null. Your non-rejection could have been due to lack of data, therefore you cannot conclude anything from it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to somehow support your null, compute the confidence interval for your parameters and show that its sufficiently narrow around your null. This will also give you a good overview about the quality of your data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example: Suppose you have null that the mean of your distribution is 0 (and the real distribution variance is for example ~1), and you compute the 95% confidence interval for mean as (-0.2,0.3). This means that with 95% probability the confidence interval covers the real mean, which sort of means, that the real mean is not far from the 0 in the sense of those numbers.&#xA;When you add more data and your confidence interval shrinks to (-0.005,0.01) you can immediately see how the data adjusted and possibly supported your conclusion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And more of a philosophical note : The real mean is most probably not zero, because the world is most probably not ideal. If you measure ton of data in the above example and get the confidence interval of (0.0001,0.0002), the null is rejected, but i assume that for all practical purposes the mean is effectively negligible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope you are aware of the equivalence: null is rejected on X% confidence level &amp;lt;=&gt; null value is outside of X% confidence interval.&lt;/p&gt;&#xA;" OwnerUserId="3120" LastEditorUserId="3120" LastEditDate="2015-01-05T12:19:57.473" LastActivityDate="2015-01-05T12:19:57.473" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16093" PostTypeId="2" ParentId="3156" CreationDate="2015-01-05T12:19:01.360" Score="3" Body="&lt;p&gt;Lots of people focus on data storage ability and compare KDB with other SQL/query-based databases. Such comparison is like considering &quot;Is a Ferrari good for running a bus route?&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;KDB+ is capable of manipulating and querying large data set. The performance is fast (in comparison to most RDBMS) due to its column based storage, but it's not her strongest suit. In fact, it could become a serious pain if the query is not well written or when the server just doesn't have enough memory. From my experience, lots of KDB applications do not even host Realtime/Historical databases. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With her simple messages publish/subscribe mechanism and flexible IPC calls, one could build complex event processing engines (and even a network of engines) to operate on these time series data easily. Its performance can easily outmatch other engines written in Java/C due to Q vector processing and loads of functions that tailored made for time series data. &lt;/p&gt;&#xA;" OwnerUserId="13985" LastActivityDate="2015-01-05T12:19:01.360" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16094" PostTypeId="1" AcceptedAnswerId="16095" CreationDate="2015-01-05T15:29:46.190" Score="2" ViewCount="1245" Body="&lt;p&gt;I recently met the claim that for standard put and calls the gamma of the options are always positive. Is this a general result? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am hoping not to assume any model, especially not Black-Scholes.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2015-01-05T20:42:24.547" Title="Gamma is always positive on both put and call" Tags="&lt;options&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16095" PostTypeId="2" ParentId="16094" CreationDate="2015-01-05T20:42:24.547" Score="2" Body="&lt;p&gt;I'll use a European call option as an example, I think you can easily generalize it for a put option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given underlying $S(t) = S_t$, maturity $T$, strike $K$ and risk-free rate $r$, the price of a call option as time $t$ under the rik-neutral measure $Q$ is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align}&#xA;C(t, S_t)&#xA;&amp;amp; = \mathbb{E}^Q \left[ e^{-r(T-t)} \max (S_T - K, 0) \right] \\&#xA;&amp;amp; = \mathbb{E}^Q \left[ e^{-r(T-t)} (S_T - K) \cdot \mathbb{1}_{S_T \geq K} \right] \\&#xA;&amp;amp; = \mathbb{E}^Q \left[ e^{-r(T-t)} S_T \cdot \mathbb{1}_{S_T \geq K} \right] - \mathbb{E}^Q \left[ K e^{-r(T-t)} \cdot \mathbb{1}_{S_T \geq K} \right] \\&#xA;&amp;amp; = e^{-r(T-t)} \mathbb{E}^Q \left[ S_T \cdot \mathbb{1}_{S_T \geq K} \right] - K e^{-r(T-t)} \mathbb{E}^Q \left[ \mathbb{1}_{S_T \geq K} \right] \\&#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\mathbb{1}_{S_T \geq K}$ is a function values $1$ when $S_T \geq K$ and $0$ otherwise. For the first expectation, we can change the probability measure to make it more manageable. Call $P$ the new measure; the Radon-Nikodym derivative between the $P$ and $Q$ is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dQ = \frac{S_t}{S_T} e^{r(T-t)} dP$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore you get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align}&#xA;C(t, S_t)&#xA;&amp;amp; = e^{-r(T-t)} \mathbb{E}^Q \left[ S_T \cdot \mathbb{1}_{S_T \geq K} \right] - K e^{-r(T-t)} \mathbb{E}^Q \left[ \mathbb{1}_{S_T \geq K} \right] \\&#xA;&amp;amp; = e^{-r(T-t)} \mathbb{E}^P \left[ S_T \cdot \mathbb{1}_{S_T \geq K} \cdot \frac{S_t}{S_T} e^{r(T-t)} \right] - K e^{-r(T-t)} \mathbb{E}^Q \left[ \mathbb{1}_{S_T \geq K} \right] \\&#xA;&amp;amp; = e^{-r(T-t)} \mathbb{E}^P \left[ \mathbb{1}_{S_T \geq K} S_t e^{r(T-t)} \right] - K e^{-r(T-t)} \mathbb{E}^Q \left[ \mathbb{1}_{S_T \geq K} \right] \\&#xA;&amp;amp; = S_t \mathbb{E}^P \left[ \mathbb{1}_{S_T \geq K} \right] - K e^{-r(T-t)} \mathbb{E}^Q \left[ \mathbb{1}_{S_T \geq K} \right] \\&#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Expanding the expectations as integrals you get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align}&#xA;C(t, S_t)&#xA;&amp;amp; = S_t \int_K^{\infty} f^P(S_T) dS_T - K e^{-r(T-t)} \int_K^{\infty} f^Q(S_T) dS_T \\&#xA;&amp;amp; = S_t P_1 - K e^{-r(T-t)} P_2&#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $P_1, P_2$ highlight that the integrals are probabilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the Greeks:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align}&#xA;\Delta &amp;amp; = \frac{\partial C}{\partial S_t} = \int_K^{\infty} f^P(S_T) dS_T = P_1 \\&#xA;\Gamma &amp;amp; = \frac{\partial^2 C}{\partial S_t} = \frac{\partial \Delta}{\partial S_t} = f^P(S_t) \frac{\partial f^P(S_t)}{\partial S_t} \\&#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The derivative in $\Gamma$ is the key. I don't think you can prove $\Gamma$ to be positive for any probability density (i.e. any model).&lt;/p&gt;&#xA;" OwnerUserId="7405" LastActivityDate="2015-01-05T20:42:24.547" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16097" PostTypeId="2" ParentId="16087" CreationDate="2015-01-05T21:31:27.027" Score="1" Body="&lt;p&gt;For Swaps it's correct to use the &quot;&lt;strong&gt;Curncy&lt;/strong&gt;&quot; keyword, as for Futures it's the &quot;&lt;strong&gt;Comdty&lt;/strong&gt;&quot; keyword.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example: &lt;strong&gt;USSW1 Curncy&lt;/strong&gt;   0,4455 - 0,4475 - 0,4495&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, for Money Market Rates such as Libor, you want to use &quot;&lt;strong&gt;Index&lt;/strong&gt;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;US00O/N Index&lt;/strong&gt;   PX_LAST - 0,1164&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;US0006M Index&lt;/strong&gt;   PX_LAST - 0,3623&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Hope this was helpfull.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="13533" LastEditorUserId="13533" LastEditDate="2015-01-06T14:58:51.353" LastActivityDate="2015-01-06T14:58:51.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16098" PostTypeId="1" CreationDate="2015-01-06T03:06:29.440" Score="0" ViewCount="1171" Body="&lt;p&gt;Suppose I want to calculate VaR for a known distribution with mean $\mu$, variance $\sigma^2$ and $\alpha$-quantile as, $VaR_{\alpha}$ = $\mu + \sigma q_{\alpha}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a Gaussian distribution it is clear that $q_{\alpha}=z_{\alpha}$ where $z_{\alpha}$ is the $\alpha$-quantile of a standard normal distribution with $\mu,\sigma$ being the moments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I have two questions&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;For returns with student-t distribution, there can be two ways to calculate VaR. First, use moment definition of student-t and standard t quantile. This gives an unbiased estimate for VaR. Second, use moment definition of student-t and quantile from standard normal distribution. This is a biased estimate for VaR. How does one understand which VaR is used most non-normal definitions of VaR are loosely defined in that sense.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;For parametric distributions which are defined using location and scale such as Azzalini's skew-t, where mean and standard deviation are different from location and scale there can be three definitions of VaR. First, use moment definition of skew-t and standard skew-t quantile. This gives an biased estimate for VaR. Second, use moment definition of skew-t and quantile from standard normal distribution. This is a biased estimate for VaR. Third, define VaR using location, scale and standard skew-t quantile. This gives an unbiased estimate. How does one name and distinguish the three cases to avoid any ambiguity.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In general the challenge in defining VaR is which moments to use and which quantile should be used. Are there any references that elaborate on using parametric VaR for non-normal distributions&lt;/p&gt;&#xA;" OwnerUserId="2142" LastActivityDate="2015-01-19T08:46:12.370" Title="Parametric/Analytical VaR" Tags="&lt;risk&gt;&lt;var&gt;&lt;estimation&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16099" PostTypeId="2" ParentId="15215" CreationDate="2015-01-06T03:52:44.393" Score="1" Body="&lt;p&gt;you need to check implied volatility... Calendars must be opened when IV is low, hopping that will increase, that way you will capture the volatility increase.&lt;/p&gt;&#xA;" OwnerUserId="13990" LastActivityDate="2015-01-06T03:52:44.393" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16100" PostTypeId="2" ParentId="16098" CreationDate="2015-01-06T04:26:08.367" Score="0" Body="&lt;p&gt;The quantile used is a choice of the user (e.g. 99%, 95%) the moments to be used would be dependent on the distribution as a distribution can be parametrized by it's moments. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer your first question: Value at Risk is always defined for any distribution as it's the probability returns will not exceed some threshold (e.g. 95% of the time losses will not exceed X).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your second one, simply state which distribution you are sampling from, and calculate quantiles based on those distributions (e.g. the qbeta/qnorm/qwhatever in R). See &lt;a href=&quot;http://www.inside-r.org/packages/cran/PerformanceAnalytics/docs/VaR&quot; rel=&quot;nofollow&quot;&gt;http://www.inside-r.org/packages/cran/PerformanceAnalytics/docs/VaR&lt;/a&gt; for some various ways to calculate VaR in R (it's very simple!).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your general problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wouldn't the simple solution to be to either:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) Choose a distribution of choice, estimate required moments and calculate the VaR&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) Computationally fit returns using a variety of distributions and choose the one with the best fit and then calculate VaR&lt;/p&gt;&#xA;&#xA;&lt;p&gt;c) Simulate a data generating process and run N trials and calculate VaR using that&lt;/p&gt;&#xA;" OwnerUserId="2154" LastActivityDate="2015-01-06T04:26:08.367" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16101" PostTypeId="1" CreationDate="2015-01-06T05:05:21.240" Score="1" ViewCount="1030" Body="&lt;p&gt;I am testing cointegration relationship on various pairs of stocks by this following these steps.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Test for I(1) on a pair of stocks, says X and Y, using Dickey-Fuller test. If both time series are non-stationary, I continue to step 2.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Run long-run (equilibrium) equation of stock Y on X, estimate parameters and collect residuals.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Test for unit root of that residual series using same method in step 1.&#xA;For many pairs I have tested, the tests reject null hypothesis that there is a unit root, implying valid cointegration relationship. (regression on  $\Delta \epsilon = \alpha*\epsilon_{t-1} + u_t$ then compare test statistic ($\alpha$/S.E. of estimated $\alpha$) with critical value (from Dickey Fuller's Table, I presume) )&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Now, here is my problem. After I finished all that stuffs I try plotting residual series and, clearly, it is not random. Residual looks correlated! &#xA;It looks like this.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/yz3F6.png&quot; alt=&quot;Residual Plot&quot;&gt;&#xA;...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is it safe to conclude that the pair is cointegrated just because the residual is stationary and dont care that the residual is not random?&lt;/li&gt;&#xA;&lt;li&gt;Can I continue with the result that the pairs are cointegrated and continue to do pair trading if I want to or I just have to continue to estimate the Error Correction Model in order to complete Engle-Granger 2 step procedure?**&lt;/li&gt;&#xA;&lt;li&gt;Which critical value table should I use in step 1 and step 3? I think I should use Dickey Fuller's Table for step 1 as the test is done over the residual term rather than raw data, it is not possible to use standard t-distribution table. For step 3, Im not sure because the test is done over the &lt;strong&gt;estimated&lt;/strong&gt; residual term.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Please bear with me..., there is more&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to this paper, on page 6, &lt;a href=&quot;http://www2.warwick.ac.uk/fac/soc/economics/staff/gboero/personal/hand2_cointeg.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www2.warwick.ac.uk/fac/soc/economics/staff/gboero/personal/hand2_cointeg.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;it says if I test residual for stationary on &#xA;$$&#xA;Y_t = \alpha + \beta_0*X_t + \beta_1*X_{t-1} + C*Y_{t-1} + \epsilon_t, &#xA;$$&#xA;&lt;strong&gt;this will prevent the bias due to serial correlation&lt;/strong&gt; on traditional regression ($y_t = \alpha + \beta_0*x_t + \epsilon_t$). I assume that I will use the same stationary test as in step 3 above. &lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;4&quot;&gt;&#xA;&lt;li&gt;Which critical value table should I use for stationary test written in the paper I have shown? Currently, I've got very high test statistic, over 14. I suspect I have done it wrong. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Any contribution will be appreciated! Thank you.&lt;/p&gt;&#xA;" OwnerUserId="13991" LastEditorUserId="2587" LastEditDate="2015-06-09T08:44:24.817" LastActivityDate="2015-06-09T08:44:24.817" Title="Cointegration Test: Residual is stationary but not random?" Tags="&lt;cointegration&gt;&lt;pairs-trading&gt;&lt;auto-correlation&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16102" PostTypeId="1" CreationDate="2015-01-06T08:53:07.303" Score="1" ViewCount="2317" Body="&lt;p&gt;I am reading the part of constructing B&amp;amp;S price for stock paying dividends. The simplest model used continuous yield dividend. But I can not see that rigorous in term of formulations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Firstly, in case of non-paying dividend. We start by &#xA;$$&#xA;\frac{dS_t}{S_t} = \mu dt + \sigma d\hat{W}_t \hspace{1cm} \frac{dB_t}{B_t}=rdt&#xA;$$ &#xA;Then by applying Girsanov, transforming $\hat{W}_t \rightarrow W_t $ with prime of risk $\frac{r-\mu}{\sigma}$, we have &#xA;$$&#xA;\frac{dS_t}{S_t} = r dt + \sigma dW_t \hspace{1cm} \frac{dS^*_t}{S^*_t}=\sigma dW_t&#xA;$$ &#xA;Under this martingale measure and associated Brownian, the self-financing porfolio is defined by &#xA;$$&#xA;V_t = H^1 S_t + H^2 B_t  \hspace{1cm} dV_t = H^1 dS_t + H^2 dB_t&#xA;$$&#xA;The important consequence is that the discounted self-financing and discounted Stock process,  $V^*_t$  and $S^*_t$ are martingale, thus one can build replicating portfolio for any continent claim at time $T$ by applying &quot;Martingale representation theorem&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now going into case with continuous dividend paying, after what I've seen in the Musiela's book[1], he supposed &#xA;$$&#xA;dQ_t = q S_t dt &#xA;$$ &#xA;Then define an auxiliary &quot;stock process&quot; $\tilde{S}_t = e^{qt} S_t$ and start the formulation by this process &#xA;$$&#xA;\frac{d\tilde{S}_t}{\tilde{S}_t} = (\mu+q) dt + \sigma d\hat{W}_t \hspace{1cm} \frac{dB_t}{B_t}=rdt&#xA;$$ &#xA;Then by applying Girsanov, transforming $\hat{W}_t \rightarrow \tilde{W}_t $ with prime of risk $\frac{r-\mu - q}{\sigma}$, we have &#xA;$$&#xA;\frac{d\tilde{S}_t}{\tilde{S}_t} = r dt + \sigma d\tilde{W}_t \hspace{1cm} \frac{d\tilde{S}^*_t}{\tilde{S}^*_t}=\sigma d\tilde{W}_t&#xA;$$ &#xA;The self-financing portfolio become&#xA;$$&#xA;V_t = H^1 e^{-qt} \tilde{S}_t + H^2 B_t  \hspace{1cm} dV^*_t = H^1 e^{-qt} d\tilde{S}^*_t&#xA;$$&#xA;Things sounds good until now, and after. But the point that I do not understand is that the discounted portfolio is neither a martingale (nor local martin gal ??). In this case, we can not apply the &quot;martingale representation theorem&quot;, and the build of replicating portfolio will fail. However in the book, he do not mention this point, and continue to apply the pricing formula, without proving $V^*_t$ is a marginal under the transformed measure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can any one help me this point ? Or this is not that simple and there need a more sophisticated formulation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[1] &quot;Martingale Methods in Financial Modelling&quot; _ Marek Musiela, Marek Rutkowski 2004, §3.2.1, p.148&lt;/p&gt;&#xA;" OwnerUserId="3507" LastEditorUserId="3507" LastEditDate="2015-01-06T17:25:16.370" LastActivityDate="2015-01-07T09:27:44.037" Title="Black Scholes formula with continuous dividend paying stock" Tags="&lt;black-scholes&gt;&lt;martingale&gt;&lt;dividends&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16103" PostTypeId="2" ParentId="15215" CreationDate="2015-01-06T09:24:31.937" Score="4" Body="&lt;p&gt;You should always think: I buy the one which is to cheap and sell the one that is too expensive and figure it out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The figuring out in this case is noting that: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$C\geq 0$ since it will never cost you money&lt;/li&gt;&#xA;&lt;li&gt;The option is strictly better than $S-K$ so has a higher price.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Now to your strategy: You buy $C(T_2)$ (the cheap) and sell $C(T_1)$ (the expensive), call the difference $x&amp;gt;0$. At $T_1$ your position is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C(T_2)  - \max\{S_{T_1}-K,0\} + x$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first term we have just argued is non-negative, the second is strictly positive. Arbitrage :)&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2015-01-06T09:24:31.937" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16104" PostTypeId="1" CreationDate="2015-01-06T13:45:40.170" Score="1" ViewCount="734" Body="&lt;p&gt;Can someone please share your research methodology of systematic trading strategies? I feel like I am always using the a same data driven procedures over different underlyings and would like to get some inspiration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my simple process 1) determine if there is any market regime pattern 2) Find suitable predictors using price/fundamental data 3) Combine weak predictors with some machine learning/ensembling techniques 4) Refine trading rules with accurate sizing and stop loss/profit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there is any existing forum or journals that are discussing topoics like this please also share.&lt;/p&gt;&#xA;" OwnerUserId="5861" LastActivityDate="2015-02-07T13:27:12.203" Title="Research methodology of systematic strategies" Tags="&lt;quant-trading-strategies&gt;&lt;research&gt;&lt;machine-learning&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16105" PostTypeId="2" ParentId="16090" CreationDate="2015-01-06T14:11:47.713" Score="3" Body="&lt;p&gt;I'll assume the rest of the world doesn't have access to a similar oracle. Indeed if it did future returns would converge to the risk free rate instantly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, I would prefer holding the AAA bond instead of the stock because the rest of the world would consider it to be much less risky.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a financial institution, reducing the risk of your portfolio as perceived by outsiders is a good idea for many reasons (e.g. to keep regulators happy or to increase investor confidence), but there exists an instantly monetizable advantage which would hold even as a simple individual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed, assets seen as high quality such as an AAA bond would command a much lower interest rate when used as collateral for borrowing money. In fact, repo-ing out the bond, and using the proceeds to reverse-repo the stock, an arbitrageur initially holding the bond could realize a risk-free profit of roughly $1m * (stock repo rate - bond repo rate) * 1yr. If the bond is a US treasury, its repo rate would be close to fed funds, while the stock's repo rate (if it exists at all) would be more like libor + hundreds of basis points, yielding a profit in the tens of thousands USD.&lt;/p&gt;&#xA;" OwnerUserId="13993" LastActivityDate="2015-01-06T14:11:47.713" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16106" PostTypeId="2" ParentId="15344" CreationDate="2015-01-06T16:30:07.753" Score="0" Body="&lt;ol&gt;&#xA;&lt;li&gt;I wouldn't contstruct two curves, i would just adjust my futures cupons.&#xA;Assumming that the par swap quotes are already in a 2 spot days convention for most markets.&#xA;That means that when calculating the FRA for a Libor Cupon you actually capture the value a -2 days fixing.&lt;/li&gt;&#xA;&lt;li&gt;If one of your swaps have a 40 business days, i assume the quote might not be 40 spot days. &#xA;So when you actually use the quotes for bootstrapping you wouldn't be capturing the 40 days buisness days lag in your curve.&lt;/li&gt;&#xA;&lt;li&gt;You just need to adjust the FRA calculation to the actual date you need to interpolate for each cupon, by adding or substracting the fixing days to the FRA dates. And then discount cashflows like a regular swap.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="13533" LastActivityDate="2015-01-06T16:30:07.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16107" PostTypeId="1" AcceptedAnswerId="16121" CreationDate="2015-01-06T16:39:16.587" Score="4" ViewCount="1402" Body="&lt;p&gt;Probably simple question. Consider the &lt;a href=&quot;http://www.jstor.org/stable/1911242?origin=crossref&amp;amp;seq=1#page_scan_tab_contents&quot; rel=&quot;nofollow&quot;&gt;CIR (1985)&lt;/a&gt; model for interest rates&#xA;$$&#xA;dr = k(\theta - r)dt + \sigma \sqrt{r}dz&#xA;$$&#xA;Then it is known in closed form the conditional pdf $f(r(s),s|r(t),t)$ ($s \geq t$) &#xA;$$&#xA;f(r(s),s|r(t),t) = ce^{-u-v}\left(\frac{v}{u}\right)^{q/2}I_{q}(2\sqrt{uv})&#xA;$$&#xA;where&#xA;\begin{equation}&#xA;\begin{aligned}&#xA;c &amp;amp;=\frac{2k}{\sigma^{2}\left(1-e^{-k(s-t)}\right)}\\&#xA;u &amp;amp;=cr(t)e^{-k(s-t)}\\&#xA;v &amp;amp;=cr(s)\\&#xA;q &amp;amp;=\frac{2k\theta}{\sigma^2}-1&#xA;\end{aligned}&#xA;\end{equation}&#xA;and $I_{q}(\cdot)$ is a modified Bessel function of the first kind of order $q$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then authors state: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&amp;lt;&amp;lt; The distribution function is the non central chi-square $\chi^2[2 c r(s); 2q + 2, 2u]$, with $2q+2$ degrees of freedom and parameter of non centrality $2u$ proportional to the current spot rate. &gt;&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Then my questions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Is it correct to say that what is (conditionally on $r(t)$) non-central $\chi^2$ distributed is the variable $2cr(s)$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can answer by my own to this question: Since the conditional expectation $E(r(s)|r(t))$ and variance $Var(r(s)|r(t))$ are provided in the paper (Eq. 19), it'easy to check the validity of 1) verifying that:&#xA;\begin{equation}&#xA;\begin{aligned}&#xA;(2q+2) + (2u) &amp;amp;= E(2cr(s)|r(t)) = 2c E(r(s)|r(t))\\ &#xA;2[(2q+2) + 2(2u)] &amp;amp;= Var(2cr(s)|r(t)) = 4c^2Var(r(s)|r(t))&#xA;\end{aligned}&#xA;\end{equation}&#xA;where l.h.s. of both equations are expressions for the first two moments of a non-central $\chi^2$ variable with $2q+2$ and parameter of non-centrality $2u$ (you may want to check &lt;a href=&quot;http://en.wikipedia.org/wiki/Noncentral_chi-squared_distribution&quot; rel=&quot;nofollow&quot;&gt;Wikipedia&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) If 1), which is the conditional distribution of $r(s)$ alone? Is it still non-central $\chi^2$? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to be crystal clear: we know that $2cr(s) \stackrel{|r(t)}{\sim} \chi^2(2q+2,2u)$. Moreover, we know in closed form the (conditional on $r(t)$) pdf of $r(s)$ (the $f(r(s),s|r(t),t)$ above)... but then, is $r(s)$ a &lt;em&gt;KNOWN&lt;/em&gt; random variable ($|r(t)$)? In particular, is it still non-cenral $\chi^2$ distributed? (*)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your attention&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(*) I'm afraid $r(s)$ cannot still be non-central $\chi^2$ since this would imply that the non-central $\chi^2$ would be close w.r.t. scaling of the variable, and - I'm not sure - this should not be the case.&lt;/p&gt;&#xA;" OwnerUserId="13528" LastEditorUserId="13528" LastEditDate="2015-01-07T11:21:18.707" LastActivityDate="2015-01-07T13:17:49.923" Title="CIR model: is the short rate really non-central $\chi^2$ distributed?" Tags="&lt;stochastic-processes&gt;&lt;short-rate&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16108" PostTypeId="2" ParentId="16087" CreationDate="2015-01-06T17:18:54.663" Score="1" Body="&lt;p&gt;I noticed the OP mentioned that he/she does not have direct access to the Bloomberg, so even though this doesn't directly answer the question I want to add that LIBOR is downloadable from the St. Louis Federal Reserve system called &quot;FRED&quot; at &lt;a href=&quot;http://research.stlouisfed.org/fred2/release?rid=253&quot; rel=&quot;nofollow&quot;&gt;http://research.stlouisfed.org/fred2/release?rid=253&lt;/a&gt; although it is delayed by a few  business days.  Since the LIBOR rigging scandal, oversight of the LIBOR has been turned over to the ICE exchange and they charge a considerable sum for &quot;real-time&quot; LIBOR. &lt;/p&gt;&#xA;" OwnerUserId="13995" LastActivityDate="2015-01-06T17:18:54.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16109" PostTypeId="1" AcceptedAnswerId="16110" CreationDate="2015-01-06T18:13:50.777" Score="2" ViewCount="3374" Body="&lt;p&gt;I've been tasked with researching trading strategies relating PCA to trading fixed income futures instruments. Apparently PCA is frequently used in this area. I'm just looking for some references for obtaining a basic idea of what a strategy might look like. I'm not looking for a winning strategy -- just an outline of how PCA might be useful in generating trading signals. I understand the mathematics behind PCA and have used it in other areas, but its applications to finance are new to me.&lt;/p&gt;&#xA;" OwnerUserId="13405" LastActivityDate="2015-01-06T19:39:32.273" Title="Principal Component Analysis and Yield Curves" Tags="&lt;fixed-income&gt;&lt;reference-request&gt;&lt;principal-components&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16110" PostTypeId="2" ParentId="16109" CreationDate="2015-01-06T19:39:32.273" Score="6" Body="&lt;p&gt;One of the best pieces ever written on this topic is Salomon's &quot;Principles of Principal Components,&quot; which is readily available on the Internet. I won't go into the details, since this paper is ridiculously comprehensive, but the fundamental idea is straightforward -- if you run a PCA based on yields, the first three components capture most of the variances, with the three factors roughly interpreted as the level, slope, and curvature of the curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most widely used application for PCA is butterfly trading (e.g., you may buy the TY contract against FV and WN; or you may buy EDZ6 against EDZ5 and EDZ4). PCA allows you t compute the &quot;risk weights&quot; needed so that the structures are neutral to the first two principal components. This allows you to focus on trading the curvature of the yield curve, without taking on level/slope risks.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2015-01-06T19:39:32.273" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16112" PostTypeId="2" ParentId="16083" CreationDate="2015-01-06T20:06:05.813" Score="0" Body="&lt;p&gt;This means that a linear regression is not the best model for your data. You may want to try a regularized regression (LASSO/Ridge) to see if penalizing the coefficients will help. &lt;/p&gt;&#xA;" OwnerUserId="11818" LastActivityDate="2015-01-06T20:06:05.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16113" PostTypeId="1" CreationDate="2015-01-06T21:35:27.533" Score="1" ViewCount="277" Body="&lt;p&gt;In [R] one can pass either a vector or scalar as the risk free rate.  What is better?  If I pass a vector to (for example) chart.riskreturnscatter then the sharpe ratio lines disappear.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;chart.RiskReturnScatter(managers[,c(1,2,3)],0.01)&#xA;chart.RiskReturnScatter(managers[,c(1,2,3)],managers[,10]) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So is this a feature?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&#xA;Raghu&lt;/p&gt;&#xA;" OwnerUserId="13998" LastActivityDate="2015-01-08T20:44:13.683" Title="Risk free rate for Performance Analytics" Tags="&lt;r&gt;&lt;performanceanalytics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16114" PostTypeId="1" AcceptedAnswerId="16115" CreationDate="2015-01-06T21:42:56.473" Score="1" ViewCount="1805" Body="&lt;p&gt;when I run chart.Correlation I get a series of warnings.  I get the identical warnings with&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;chart.Correlation(managers[,1:2],method=&amp;quot;pearson&amp;quot;)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Here is a short sample:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;1: In plot.window(...) : &amp;quot;method&amp;quot; is not a graphical parameter&#xA;2: In plot.xy(xy, type, ...) : &amp;quot;method&amp;quot; is not a graphical parameter&#xA;3: In title(...) : &amp;quot;method&amp;quot; is not a graphical parameter&#xA;4: In plot.window(...) : &amp;quot;method&amp;quot; is not a graphical parameter&#xA;5: In plot.xy(xy, type, ...) : &amp;quot;method&amp;quot; is not a graphical parameter&#xA;6: In title(...) : &amp;quot;method&amp;quot; is not a graphical parameter&#xA;7: In axis(side = side, at = at, labels = labels, ...) :&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;The charts are produced so I can keep going with the project, but&lt;/p&gt;&#xA;&lt;p&gt;a) what is going on?&#xA;b) Should I be worried of a ticking time bomb&#xA;c) can it be fixed?&lt;/p&gt;&#xA;&lt;p&gt;BTW, I'm running&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;R version 3.1.2 (2014-10-31)  x86_64-w64-mingw32&lt;/p&gt;&#xA;&lt;p&gt;PerformanceAnalytics_1.4.3541&lt;br /&gt;&#xA;xts_0.9-7&lt;br /&gt;&#xA;zoo_1.7-11&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Thanks,&#xA;Raghu&lt;/p&gt;&#xA;" OwnerUserId="13998" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2015-01-06T22:45:10.547" Title="Chart Correlation warnings" Tags="&lt;r&gt;&lt;performanceanalytics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16115" PostTypeId="2" ParentId="16114" CreationDate="2015-01-06T22:45:10.547" Score="1" Body="&lt;p&gt;Nothing to be worried about:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Method is the type of correlation which is not a graphical parameter.&lt;/li&gt;&#xA;&lt;li&gt;The method argument is being passed to the pairs function... &lt;/li&gt;&#xA;&lt;li&gt;The function is saying this not a graphical parameter &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;It can be fixed in the source code (or just ignore it!)&lt;/p&gt;&#xA;" OwnerUserId="2154" LastActivityDate="2015-01-06T22:45:10.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16116" PostTypeId="2" ParentId="11583" CreationDate="2015-01-07T00:45:29.983" Score="1" Body="&lt;p&gt;On BATS, your market order would be rejected back to you with an error &quot;No Liquidity&quot;.&lt;/p&gt;&#xA;" OwnerUserId="13995" LastActivityDate="2015-01-07T00:45:29.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16118" PostTypeId="2" ParentId="16102" CreationDate="2015-01-07T09:27:44.037" Score="1" Body="&lt;p&gt;my easy solution to this is to take a zero strike call option on the stock which I call a delivery contract for time $T.$. This is easy to price and is worth $e^{q(T-t)} S_t.$ &#xA;An option on the delivery contract with expiry $T$ has the same value as an option on $S_t$ since they agree at $T.$ The delivery contract is non-dividend paying and follows a GBM so the BS analysis applies to it. the stock price dynamics are then deducible from its dynamics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See my book Concepts etc for more details. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-01-07T09:27:44.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16119" PostTypeId="1" CreationDate="2015-01-07T10:10:21.463" Score="1" ViewCount="492" Body="&lt;p&gt;I am trying to build a machine learning system for financial price prediction.&#xA;I am using a 3 layer MLP (a deep network) with 3 outputs (buy,hold,sell).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using different features such as price and volume.&#xA;In order to take into account past behavior, I concatenate the price and volume data into one vector.&#xA;The first part of the vector is the last N return rate, the second part is the last N transaction volume.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This results in a large input vector (&gt;50).&#xA;I wonder if the bad results I get are related to the current selection of the input vector.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help on that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&#xA;Guy&lt;/p&gt;&#xA;" OwnerUserId="15006" LastEditorUserId="15006" LastEditDate="2015-01-24T21:41:22.073" LastActivityDate="2015-12-23T14:16:11.903" Title="Feature Selection Effect on Deep Multi-Layer-Perceptron for Financial Applications" Tags="&lt;machine-learning&gt;&lt;statistical-finance&gt;&lt;financial-engineering&gt;&lt;neural-networks&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16120" PostTypeId="1" CreationDate="2015-01-07T10:56:39.557" Score="1" ViewCount="1564" Body="&lt;p&gt;I would calculate Probability of Default from Survival Probability. I want to know how they are related.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is how I think they are related:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Survival Probability = 1-Default Probability.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Not sure whether the forumla is right. Tried searching in the net, but find the relationship. Need some guidance on how to calculate the probability of default from Survival Probability.&lt;/p&gt;&#xA;" OwnerUserId="5839" LastActivityDate="2015-01-07T10:56:39.557" Title="How to calculate Probability of Default from Survival Probability" Tags="&lt;cds&gt;&lt;default-probability&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16121" PostTypeId="2" ParentId="16107" CreationDate="2015-01-07T13:17:49.923" Score="3" Body="&lt;p&gt;To answer this I sum up a paragraph of &quot;Interest rate models - An Introduction&quot; by A.Cairns:&#xA;For $i=1,\ldots,d$ consider the OU-processes&#xA;$$&#xA;dX^i_t = -\frac 12 \alpha X^i_t dt + \sqrt{\alpha} dW^i_t.&#xA;$$&#xA;Looking at the squared radius $R_t = \sum_{i=1}^d (X^i_t)^2 $ (in $\mathbb{R}^d$) of this process we get by Ito:&#xA;$$&#xA;dR_t = \sum_{i=1}^d  (2 X^i_t dX^i_t) + d \alpha dt.&#xA;$$&#xA;Using the definition of $R_t$ introducing a new Brownian motion $B_t$ we get in distribution that that&#xA;$$&#xA;dR_t =  \alpha (d - R_t) dt + \sqrt{4 \alpha R_t} dB_t.&#xA;$$&#xA;Defining $r_t = R_t/\theta$ with $\theta = 4\alpha/\sigma^2$ this is the CIR model.&#xA;This gives a nice geometric interpretation.&#xA;I am aware that not all details are covered here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recall the definition of the non central chi-squared distribution. Let &#xA;$$&#xA;R = \sum_{i=1}^d (W_i + \delta_i)^2&#xA;$$&#xA;and $\lambda = \sum_{i=1}^d \delta_i^2$, then $R$ has a non-central chi-squared distribution with $d$ degrees of freedom and non-centrality parameter $\lambda$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the $X_i^t$ above are all normally distributed with variance $1- e^{-\alpha t}$ we see that $R_t/(1- e^{-\alpha t})$ has non-central chi-squared distribution. Finally we have that for $d = 4 \alpha \mu/\sigma^2$ that $4 \alpha r_t/(\sigma^2 (1- e^{-\alpha t}))$ has a non-central chi-squared distribution with $d$ degrees of freedom and non-centrality parameter $\lambda = 4 \alpha r_0/(\sigma^2 (1- e^{-\alpha t}))$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Conditionally on $r_t$ replace $r_0$ by $r_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answers then are:&#xA;i) Yes, the variable that has non-central chi-squared distribution is the complicated expression that you mention.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ii) Only this complicated expression is non-central chi-squared distributed - $r_s$ itself is not. As you see in the link the non-central chi-squared distribution relates to standardized Gaussians (variance equals 1). Maybe the &lt;a href=&quot;http://en.wikipedia.org/wiki/Generalized_chi-squared_distribution&quot; rel=&quot;nofollow&quot;&gt;Generalized chi-squared distribution&lt;/a&gt; could be of help. But I don't know this.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-01-07T13:17:49.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16122" PostTypeId="2" ParentId="14232" CreationDate="2015-01-07T18:38:12.747" Score="-2" Body="&lt;p&gt;@emcor this is interesting. A log normal martingale has most paths drift downwards. And so appears to behave like a supermartingale. If you would like to check, simulate a BS model with drift $\mu &amp;lt; \frac{1}{2}\sigma^2$ and check. Almost all paths drift downwards. You should try to think of why this has to be, though enough numerical simulations will explain why. The key is the martingality, which is an expectational feature. Dupire has this result in his slides.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any comments? FYI, any process without drift is essentially behaving like a Brownian I think.&lt;/p&gt;&#xA;" OwnerUserId="13415" LastActivityDate="2015-01-07T18:38:12.747" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16124" PostTypeId="2" ParentId="16083" CreationDate="2015-01-07T21:20:27.937" Score="1" Body="&lt;p&gt;If your errors are non-normal and your sample is large non-normality is not important. You can rely on the Central Limit Theorem which implies that the test statistics (t and F statistics) have approximately the same distribution as in the normal case. Standard errors, in your case will be larger because of the fat tails. For a good textbook treatment of this treatment see, for example, Wooldridge (2013), Introductory Econometrics, Fifth Edition, South Western.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could do your tests in Excel but you would have to do a lot of work and I would not recommend it. You should have a look at gretl &lt;a href=&quot;http://gretl.sourceforge.net/&quot; rel=&quot;nofollow&quot;&gt;http://gretl.sourceforge.net/&lt;/a&gt; which is an easy to use econometrics package and is free.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you wish to do some serious econometrics you need to obtain a better understanding of the underlying theory. You could start with Wooldridge or any of the other excellent test books available. Many introductory texts will give the normality requirement in an early section and then generalize this in a later section.   &lt;/p&gt;&#xA;" OwnerUserId="9458" LastActivityDate="2015-01-07T21:20:27.937" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16125" PostTypeId="1" AcceptedAnswerId="16131" CreationDate="2015-01-07T21:26:47.743" Score="3" ViewCount="305" Body="&lt;p&gt;How to proof B&amp;amp;S pricing formula is continuous in time $t$ (or it is not?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The general pricing formula is &#xA;$$&#xA;C_t = e^{-r(T-t)} \mathbb{E}^*[(S_T-K)^+ | \mathcal{F}_t] \hspace{1cm} 0\leq t\leq T&#xA;$$&#xA;Then for time at maturity $t=T$&#xA;$$ &#xA;C_T = \mathbb{E}^*[(S_T-K)^+ | \mathcal{F}_T] = (S_T-K)^+ &#xA;$$&#xA;which is logic. For other anterior time $t&amp;lt;T$, the integration calculation give&#xA;$$&#xA;C_t = S_t \mathcal{N}(d_+) - e^{-r(T-t)} K \mathcal{N}(d_-)&#xA;$$&#xA;with&#xA;$$&#xA;d\pm = \frac{\text{ln}\frac{S_t}{K} + (r\pm\frac{\sigma^2}{2})(T-t) }{\sigma\sqrt{T-t}}&#xA;$$&#xA;Since $S_t$ is modelled as geometric brownian motion, it has to be continuous in $t$. I see that everything in the B&amp;amp;S formula is continuous in $t$. But I can not proof the continuity&#xA;$$&#xA;C_t \rightarrow C_T \hspace{1cm} \text{when } t\rightarrow T&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="3507" LastActivityDate="2015-01-08T18:48:54.673" Title="Continuity of Black-Scholes formula" Tags="&lt;black-scholes&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16126" PostTypeId="1" AcceptedAnswerId="16143" CreationDate="2015-01-07T21:33:30.860" Score="2" ViewCount="764" Body="&lt;p&gt;Hello I'm looking for papers, aside from ones that use CDS spreads, about credit rating development or estimating default probability based on financial ratios that also include methodology and maybe good/bad criteria?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the methodology should be something that identifies which financial ratios are important given some financial statements and several computed financial ratios and then uses the important financial ratios to make a regression model.&lt;/p&gt;&#xA;" OwnerUserId="7788" LastActivityDate="2015-01-08T23:17:42.843" Title="Using Financial Ratios to get credit rating or PD" Tags="&lt;modeling&gt;&lt;regression&gt;&lt;reference-request&gt;&lt;default-probability&gt;&lt;credit-scoring&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16127" PostTypeId="2" ParentId="16056" CreationDate="2015-01-07T21:41:05.063" Score="3" Body="&lt;p&gt;The hypothesis $H_0: β_1=β_2=\dots =β_{k−1}=0$ is normally tested by the $F$-test for the regression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are carrying out 3 independent tests of your coefficients (Do you also have a constant in the regression or is the constant one of your three variables?) If you do three independent tests at a 5% level you have a probability of over 14% of finding one of the coefficients significant at the 5% level even if all coefficients are truly zero (the null hypothesis). This is often ignored but be careful. Even so, If the coefficient is close to significant I would think about the underlying theory before coming to a decision.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you add dummies you will have a beta for each dummy &lt;/p&gt;&#xA;" OwnerUserId="9458" LastEditorUserId="9458" LastEditDate="2015-01-21T21:24:37.953" LastActivityDate="2015-01-21T21:24:37.953" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16128" PostTypeId="2" ParentId="16067" CreationDate="2015-01-07T22:29:25.707" Score="1" Body="&lt;p&gt;Write the series in the answer as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(x_t - \mu) = \rho (x_{t-1} - \mu) + \varepsilon_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then if $\rho=.5$ and  $\varepsilon_t$ is $N(0,\sigma^2)$, $(x_t - \mu)$ is stationary with mean $0$ and variance $\frac{\sigma^2}{1-\rho}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A time series process can have a deterministic part and a pure random part. The definition of stationarity (strict or strong or second order or \dots) refers only to the pure random part. If the deterministic part is a trend and the random part is stationary the series is trend stationary.&lt;/p&gt;&#xA;" OwnerUserId="9458" LastActivityDate="2015-01-07T22:29:25.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16129" PostTypeId="1" CreationDate="2015-01-07T23:27:24.387" Score="10" ViewCount="4268" Body="&lt;p&gt;For deterministic discrete dividend, there are two approach&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Musiela approach, works when every dividend are paid at maturity of the option.&lt;/li&gt;&#xA;&lt;li&gt;Hull approach, works when every dividend are paid immediately after ex-dividend date.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I spend 1 day to understand the Musiela approach, but I can not understand his formula. In his book &quot;Martingal Method for Financial Modelling 2nd Edit&quot; $3.2.2, his first approach firstly define quantity :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Timeline $0 &amp;lt; T_1 &amp;lt;T_2 … &amp;lt; T_m &amp;lt;T$ and dividend cash flow $q_1, q_2, .. q_m$ &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Value of all posterior-t dividend compounded to Maturity time :&#xA;$$&#xA;I_t = \sum^m_{i=1} q_i e^{r(T-T_i)} \mathbf{1}_{[0,T_i]}(t)&#xA;$$&#xA;Note that $I_t$ decrease in time $t$ and piecewise constant. At each time $T_i$, $I_t$ drop down $q_i$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;Value of all anterior-t dividend compound to time $t$. &#xA;$$&#xA;D_t = \sum^m_{i=1} q_i e^{r(t-T_i)} \mathbf{1}_{[T_i,T]}(t)&#xA;$$&#xA;Here, $D_t$ increase in time $t$. At each time $T_i$, $D_t$ jump up $q_i$&lt;/li&gt;&#xA;&lt;li&gt;He define the capital gain process &#xA;$$&#xA;G_t = S_t + D_t&#xA;$$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Note that &#xA;$$&#xA;D_T=I_0 \hspace{1cm} G_0=S_0 \hspace{1cm} G_T=S_T+D_T=S_T+I_0&#xA;$$&lt;br&gt;&#xA;And all jump in price process $S_t$ are separated to $D_t$, he can model $G_t$ by the geometric brownian as usual, i.e under risk-neutral measure&#xA;$$&#xA;\frac{dG_t}{G_t} = rdt + \sigma dW_t&#xA;$$ &#xA;Now, he can give the B&amp;amp;S formula for European Call option at time zero &#xA;$$&#xA;C_0 = e^{-rT}\mathbb{E}[(S_T-K)^+] = e^{-rT}\mathbb{E}[(G_T-(K+I_0))^+]&#xA;$$&#xA;Since the modelled process is $G_t$, this price at time $0$ is easily found by Black-Scholes calculation routine. &#xA;$$&#xA;C_0 = S_0 \mathcal{N}(d_+) - e^{-rT}K \mathcal{N}(d_{-})&#xA;$$&#xA;with &#xA;$$&#xA;d\pm = \frac{ \text{ln}\frac{S_0}{K+I_0} + (r\pm\frac{\sigma^2}{2})T  }  {\sigma \sqrt{T}}&#xA;$$&#xA;For this price formula at time $0$, I can understand it. An then I tried to compute for an arbitrary time $t$&#xA;$$&#xA;C_t = e^{-r(T-t)}\mathbb{E}[(S_T-K)^+|\mathcal{F}_t] = e^{-r(T-t)}\mathbb{E}[(G_T-(K+I_0))^+|\mathcal{F}_t]&#xA;$$&#xA;Again, the calculation routine of Black-Scholes should give&#xA;$$&#xA;C_t = G_t \mathcal{N}(d_+) - e^{-r(T-t)} (K+I_0) \mathcal{N}(d_{-})&#xA;$$&#xA;with $d\pm$ should be&#xA;$$&#xA;d\pm = \frac{ \text{ln}\frac{G_t}{K+I_0} + (r\pm\frac{\sigma^2}{2})(T-t)  }  {\sigma \sqrt{T-t}}&#xA;$$&#xA;But in the Musiela's book, he give the different result without detail proof. His result is &#xA;$$&#xA;C_t = S_t \mathcal{N}(\hat{d}_+) - e^{-r(T-t)} (K+I_t) \mathcal{N}(\hat{d}_{-})&#xA;$$&#xA;with &#xA;$$&#xA;\hat{d}\pm = \frac{ \text{ln}\frac{S_t}{K+I_t} + (r\pm\frac{\sigma^2}{2})(T-t)  }  {\sigma \sqrt{T-t}}&#xA;$$&#xA;So the annoying differences are&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;He have strike term as $K+I_t$, I have $K+I_0$&lt;/li&gt;&#xA;&lt;li&gt;He have random process as $S_t$, I have $G_t$ &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Can anyone help please. I've spent to much time without success.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS : one more question. There are maybe something that I am missing. The fact that he use $D_t$ to model the dividend, but in the result, he use $I_t$, that seems strange.&lt;/p&gt;&#xA;" OwnerUserId="3507" LastEditorUserId="3507" LastEditDate="2015-01-08T00:07:35.543" LastActivityDate="2015-10-08T23:12:17.133" Title="Black-Scholes formula with deterministic discrete dividend (Musiela approach)" Tags="&lt;black-scholes&gt;&lt;discrete-dividends&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16130" PostTypeId="1" CreationDate="2015-01-08T00:21:29.040" Score="1" ViewCount="620" Body="&lt;p&gt;I am a master degree student on applied economics at Brazil and my thesis will be about smart beta strategies. I pretend to apply Equal Weigth, Mininum Variance, Most Diversified Portfolio and Equal Risk Contribution strategies on IBOV, the cap weighted index of Brazilian Financial Market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried to found some codes on matlab or R of these strategies but I didn't have success. So I would like to awnser where can I find something that would help me to estimate the weights of the stocks ? It's hard for me doing all the code, because of that I'm asking for help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another thing is about the covariance matrix. I want to test the results with the sample covariance matrix, risk metrics, shrinkage and maybe DCC GARCH. How about that? It's really necessary to use more than two methods?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope you help me!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I appreciate!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="15013" LastEditorUserId="848" LastEditDate="2015-01-08T14:48:46.297" LastActivityDate="2015-01-09T06:18:52.743" Title="Equall Risk Contribution and The Most Diversified Portfolio" Tags="&lt;portfolio-management&gt;&lt;research&gt;&lt;portfolio-optimization&gt;&lt;matlab&gt;" AnswerCount="1" CommentCount="2" ClosedDate="2015-01-08T07:41:27.860" ContentLicense="CC BY-SA 3.0" />
  <row Id="16131" PostTypeId="2" ParentId="16125" CreationDate="2015-01-08T00:41:15.120" Score="4" Body="&lt;p&gt;First, let's remember that by property of $\mathcal{N}$ being a cumulative distribution function, we have that $$\lim_{x \to -\infty}\mathcal{N}(x) = 0$$ and $$\lim_{x \to \infty}\mathcal{N}(x) = 1$$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, let's see how the Black-Scholes price behaves as times goes to maturity. First we have that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;d\pm = \left(\frac{\text{ln}\frac{S_t}{K}}{\sigma\sqrt{T-t}} + (r\pm\frac{\sigma^2}{2})\sqrt{T-t}\right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C_t = \left(S_t-e^{-r(T-t)}K\right)\cdot\mathcal{N}(d+) + e^{-r(T-t)}K\cdot\left(\mathcal{N}(d+)-\mathcal{N}(d-)\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which can be further rewritten as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C_t = \left(S_t-e^{-r(T-t)}K\right)\cdot\mathcal{N}(d+) + \frac{e^{-r(T-t)}K}{\sqrt{2\pi}}\int_{d-}^{(d-)+\sigma^2\sqrt{T-t}} e^{-\frac{z^2}{2}}\, dz$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, noticing that $z \mapsto e^{-\frac{z^2}{2}}$ is bounded over $\mathbb{R}$, we can deduce that the second term goes to $0$ as $t$ goes to $T$ because the integration interval becomes arbitrarily small.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the convergence of $C_t$ is determined by that of the first term which has different limits depending on $S_T/K$:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;if $S_T &amp;gt; K$, then $\ln\frac{S_T}{K} &amp;gt; 0$ and $\lim d+ = \infty$, so $\lim C_t = \left(S_T - K\right)\cdot\mathcal{N}(\infty) = S_T - K$&lt;/li&gt;&#xA;&lt;li&gt;if $S_T &amp;lt; K$, then $\ln\frac{S_T}{K} &amp;lt; 0$ and $\lim d+ = -\infty$, so $\lim C_t = \left(S_T - K\right)\cdot\mathcal{N}(-\infty) = 0$&lt;/li&gt;&#xA;&lt;li&gt;if $S_T = K$, then $S_t$ goes to $K$, and remembering that $\mathcal{N}$ is bounded by $0$ and $1$, we have $\lim C_t = 0$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="13993" LastEditorUserId="13993" LastEditDate="2015-01-08T18:48:54.673" LastActivityDate="2015-01-08T18:48:54.673" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16133" PostTypeId="2" ParentId="14232" CreationDate="2015-01-08T02:11:24.833" Score="16" Body="&lt;p&gt;I think to understand the martingale/local martingale distinction, it helps to bring in a third class of processes, the uniformly integrable martingale.  I would argue that the local martingale and the non-uniformly integrable (true) martingale are actually fairly similar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The key property that a uniformly integrable martingale has is the so-called closure property.  Let $M_t, 0 \leq t &amp;lt; \infty$ be a uniformly integrable (UI) martingale.  Then $M$ has a last element $M_\infty$, and the extended process $M_t, 0 \leq t \leq \infty$ is a martingale, and you can compute $E[M_\infty | \mathcal{F}_t ]$ to get all intermediate values of the martingale.  We know that if a martingale is not uniformly integrable, then this is not the case.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One nice example is actually geometric brownian motion, which I'll call $X_t$.  We know that almost surely as $t \rightarrow \infty, X_t \rightarrow 0$, although for all $t$ $E[X_t] = 1$.  In the limit, as $t \rightarrow \infty$, the martingale loses its mass.  This phenomenon is actually exactly the same thing that is happening with strict local martingales.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider some function that maps the unit interval to the positive reals, like $f(x) = \tan x$.  Consider the process $\widetilde{X}_t := X_{f(t)}, 0 \leq t \leq 1$.  You will now note that on the unit interval $[0,1]$, $\widetilde{X}$ is a strict local martingale.   The sequence of stopping times can just be taken to be deterministic numbers increasing to $1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this example shows how strict local martingales and non uniformly-integrable martingales are in effect the same thing.  The crucial property is that their martingality does not extend to &quot;the closure of the time interval&quot;.  This happens because, somewhere, you have a set of random variables which is not uniformly integrable, and so in passing to the limit, you don't have continuity in $L^1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer a couple other questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;What do paths look like&lt;/strong&gt; I think my discussion above shows that there is really no difference between the local path behavior of a strict local martingale, and the local path behavior of a true martingale.  The breakdown occurs in the limit.  In fact, this is where the name comes from: locally, a local martingale &lt;em&gt;does&lt;/em&gt; look like a martingale.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Simulation&lt;/strong&gt; When you simulate, you should get zero drift.  In the limit is where the mass will be lost.  It's hard to say, could there be any underflow when $Y$ is small?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3415" LastEditorUserId="3415" LastEditDate="2015-01-08T18:43:11.183" LastActivityDate="2015-01-08T18:43:11.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16134" PostTypeId="2" ParentId="16130" CreationDate="2015-01-08T02:23:39.960" Score="1" Body="&lt;p&gt;I have found the slides from Yollin very useful for portfolio optimization using R such as mean-variance, max-sharpe ratio portfolio etc. &lt;a href=&quot;http://www.rinfinance.com/RinFinance2009/presentations/yollin_slides.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.rinfinance.com/RinFinance2009/presentations/yollin_slides.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, there are some packages in R for this such as $PortfolioAnalytics$ I believe : &lt;a href=&quot;http://www.rinfinance.com/agenda/2014/workshop/RossBennett.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.rinfinance.com/agenda/2014/workshop/RossBennett.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PortfolioAnalytics Vignettes (PDF's with examples): &lt;a href=&quot;https://r-forge.r-project.org/scm/viewvc.php/pkg/PortfolioAnalytics/vignettes/?root=returnanalytics&quot; rel=&quot;nofollow&quot;&gt;https://r-forge.r-project.org/scm/viewvc.php/pkg/PortfolioAnalytics/vignettes/?root=returnanalytics&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13428" LastEditorUserId="2154" LastEditDate="2015-01-09T06:18:52.743" LastActivityDate="2015-01-09T06:18:52.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16136" PostTypeId="2" ParentId="14612" CreationDate="2015-01-08T14:20:56.390" Score="2" Body="&lt;p&gt;You can resort to a model for the &quot;hazard rate&quot;, $\lambda$, where the hazard rate is &quot;the instantaneous conditional default probability&quot;. Hull suggests modelling this in exactly the same way you would model the short rate of interest in the Hull-White short rate setup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recall, for short rates you assume an Affine structure for bond prices &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P(t,T)=A(t,T)exp(-r(t)B(t,T))$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The exact same logic applies for hazard rates where instead of a Bond Price $P(t,T)$ you rather have a &quot;Survival Probability&quot; $SP(t,T)$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$SP(t,T)=A(t,T)exp(-\lambda(t)B(t,T))$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In both cases, your job is to select the correct dynamics for $\lambda(t)$ and to calibrate the parameters some how.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this help!&lt;/p&gt;&#xA;" OwnerUserId="15019" LastActivityDate="2015-01-08T14:20:56.390" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16138" PostTypeId="1" CreationDate="2015-01-08T20:19:02.087" Score="6" ViewCount="1338" Body="&lt;p&gt;Reading Gatheral's &lt;em&gt;The volatility surface&lt;/em&gt;, page 7.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The model they are talking about is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align}dS_t&amp;amp;=\mu_tS_tdt+\sqrt{\nu_t}S_tdZ_1\\d\nu_t&amp;amp;=\alpha(S_t,\nu_t,t)dt+\eta\beta(S_t,\nu_t,t)\sqrt{v_t}dZ_2\\\left[Z_1,Z_2\right]&amp;amp;=\rho dt\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $S_t$ is a stock price, and $\nu_t$ stochastic volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is an option on $S$ with price $V(S_t,\nu,t)$, and another asset $V_1$ depending on the volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A portfolio $\Pi=V-\Delta V-\Delta_1 V_1$, with $\Delta$ and $\Delta_1$ chosen such that this evolves like the money market account&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dB_t=r_tB_tdt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $r_t$ assumed deterministic. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;[skipping the long equations]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They get a big differential operator applied to $V$ and applied to $V_1$ most both equal to some function which they write in the form $-(\alpha-\phi\beta\sqrt{\nu})$, for some function $\phi$. So far so good. And they call $\phi$ the market risk of volatility risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the choices of $\Delta$ and $\Delta_1$ made, they form a portfolio $\Pi_1=V-\Delta S$ from where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d\Pi_1-r\Pi_1=\beta\sqrt{\nu}\frac{\partial V}{\partial \nu}\left(\phi dt+dZ_2\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far so good, too. Now they say &quot;defining the risk neutral drift as&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\alpha'=\alpha-\beta\sqrt{\nu}\phi$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;the equation for $\nu$ becomes &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d\nu_t=\alpha'dt+\beta\sqrt{\nu}dZ_2$$.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Here is what I don't understand. Why are they free to define the risk neutral drift? Is the model is complete and arbitrage free the risk neutral drift is no something one chooses, isn't it? It comes out of the &lt;strong&gt;unique&lt;/strong&gt; risk free measure, isn't it? &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I am a beginner in this things. I could be very wrong.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Alternatively, why is the risk-free drift equal to $\alpha-\beta\sqrt{\nu}\phi$?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;My possible answer. But I am not sure. Probably my confusion is that I don't know well the definition of risk free. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it that risk free just means to get the portfolio, $\Pi_1$ in this case, to have drift $r$, as it happens with the stock in the Black-Scholes model? We see that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d\Pi_1=r\Pi_1dt+\beta\sqrt{\nu}\frac{\partial V}{\partial \nu}d Z_2'$$&#xA;with $Z_2':=\int_{0}^{t}\phi+Z_2$.&lt;/p&gt;&#xA;" OwnerUserId="6947" LastEditorDisplayName="user16891" LastEditDate="2015-08-03T22:04:11.677" LastActivityDate="2015-08-04T12:04:14.113" Title="Market price of volatility risk" Tags="&lt;stochastic-volatility&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16140" PostTypeId="2" ParentId="16113" CreationDate="2015-01-08T20:44:13.683" Score="1" Body="&lt;p&gt;This is a feature, when you pass a vector it's because the risk free rate has changed over time. E.g. you can assume a constant or changing risk free rate as each period of returns can have an associated risk free rate.&lt;/p&gt;&#xA;" OwnerUserId="2154" LastActivityDate="2015-01-08T20:44:13.683" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16141" PostTypeId="1" AcceptedAnswerId="16145" CreationDate="2015-01-08T21:01:43.240" Score="2" ViewCount="10006" Body="&lt;p&gt;I'm trying to get a basic understanding of this example delta ladder&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Price  Delta&#xA;80     43&#xA;90     31&#xA;100    25&#xA;110    11&#xA;120    -5&#xA;130    -20&#xA;140    -12&#xA;150    10&#xA;160    15&#xA;170    30&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with spot at 110&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it's long gamma on the upside above 130 but short initially, and short gamma downside. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to know in a easy to understand way, what is the delta and gamma P&amp;amp;L if the price were to end up at each of the above price points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My understanding for say 130 is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Delta = 11*(130-110) = 220&#xA;Gamma = ((-20-11) * (130-110)) /2  = -310&#xA;Total P&amp;amp;L = delta + gamma = -90&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thus if the price were to go from 110 to 170 then it's&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;P&amp;amp;L from 110-130 = -90&#xA;P&amp;amp;L from 130-170 =&#xA;   Delta = -20 * (170-130) = -800&#xA;   Gamma = ((30-20) * (170-130))/2 = 200&#xA;   Total = -600&#xA;Total P&amp;amp;L = -90-600 = -690&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If this is correct, then is it not the same as the area under the curve ? ie, I can just do a discrete integral?&lt;/p&gt;&#xA;" OwnerUserId="9517" LastActivityDate="2015-01-09T01:19:53.747" Title="Gamma and delta P&amp;L example question" Tags="&lt;trading&gt;&lt;delta&gt;&lt;gamma&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16142" PostTypeId="2" ParentId="16126" CreationDate="2015-01-08T22:16:20.983" Score="5" Body="&lt;p&gt;This is what Moody's does to calculate default probabilities, but I don't believe they give a whole lot of detail on their exact methodology because they sell their models as software. I quickly found this which gives a brief overview:  &lt;a href=&quot;http://www.moodysanalytics.com/~/media/Brochures/Enterprise-Risk-Solutions/RiskCalc/RiskCalcPlus-Fact-Sheet.ashx&quot; rel=&quot;noreferrer&quot;&gt;http://www.moodysanalytics.com/~/media/Brochures/Enterprise-Risk-Solutions/RiskCalc/RiskCalcPlus-Fact-Sheet.ashx&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit- Also found this, goes into somewhat more detail. They use financial ratios as well as industry and economic factors as regressors in a probit model for default probability.  &lt;a href=&quot;https://riskcalc.moodysrms.com/us/research/docs/Americas/RiskCalc_v3_1_US.pdf&quot; rel=&quot;noreferrer&quot;&gt;https://riskcalc.moodysrms.com/us/research/docs/Americas/RiskCalc_v3_1_US.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15024" LastEditorUserId="15024" LastEditDate="2015-01-08T22:22:38.570" LastActivityDate="2015-01-08T22:22:38.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16143" PostTypeId="2" ParentId="16126" CreationDate="2015-01-08T23:01:17.350" Score="2" Body="&lt;p&gt;I suggest you to start from the Altman's model, that is the basic model to implement the kind of econometric analysis you're looking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find the original paper at my &lt;a href=&quot;https://www.dropbox.com/s/8xfj7mxagdiuxup/Altman_Financial%20ratios%2C%20discriminant%20analysis%20and%20the%20prediction%20of%20corporate%20bankruptcy.pdf?dl=0&quot; rel=&quot;nofollow&quot;&gt;Dropbox public folder&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After that reading, you can find a number of paper about scoring models on &lt;a href=&quot;http://www.ssrn.com/en/&quot; rel=&quot;nofollow&quot;&gt;SSRN&lt;/a&gt; or Google Scholar. Moreover, I suggest you to look for all academic papers that provide a comparison/overview among all scoring models, in order to have a complete view about this topic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As regards, your idea about the methodology used in this kind of models, it is generally correct, even if the financial ratios usually do not have the same weight/ beta coefficient in forecasting the companies will go broke, because of the fact they change over time according to the state of the economy (recession/growth), companies industry, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway the methodology that is used is more or less always the same and similar to the one used in the Altman's paper and only changes the number and the type of the independent variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you need to estimate &lt;em&gt;directly&lt;/em&gt; the default probability you can use the LPM, Logit/Probit regression, and, &lt;a href=&quot;http://www.ntu.edu.sg/home/cslennox/JEB99.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; you can find a good reference about this topic. Since it is not the basic model about default probability estimation using Logit/Probit model, I suggest you to read the main papers in the references and after carry on. Anyway, It is a nice paper about the topic because of it is based on a lot of indipendent variables (not only financial ratios) that can help you to make an idea about &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;which variables can be relevant and which not;&lt;/li&gt;&#xA;&lt;li&gt;which variables have a linear effect, as assumed in hp and which ones, as, for instance, the leverage has a non-linear effect.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-01-08T23:17:42.843" LastActivityDate="2015-01-08T23:17:42.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16144" PostTypeId="2" ParentId="16104" CreationDate="2015-01-09T00:06:25.243" Score="1" Body="&lt;p&gt;It is difficult to find what you need for because if someone shares his knowledge about systematic trading, all the profit of that strategy vanishes in a while theoretically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, there are a lot of blogs about trading strategies that provide references and guides about that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my humble opinion, one of the best is &lt;a href=&quot;http://www.quantstart.com/&quot; rel=&quot;nofollow&quot;&gt;QuantStart&lt;/a&gt;, that provides a lot of useful codes in python and references about starting in algorithmic trading.&#xA;Moreover, there is also the &lt;a href=&quot;https://www.quantnet.com/&quot; rel=&quot;nofollow&quot;&gt;Andy Nguyen's website&lt;/a&gt; that provides useful guide about what you need for (guides, forum, tutorial, codes in C++,...). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is also the E. P. CHan's blog; take a look at &lt;a href=&quot;http://epchan.blogspot.it/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. He wrote two interesting books about systematic and algo trading:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.academia.edu/6636952/ALGORITHMIC_TRADING_Winning_Strategies_and_Their_Rationale&quot; rel=&quot;nofollow&quot;&gt;Algorithmic trading: winning strategies and their rational&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.google.it/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CCMQFjAA&amp;amp;url=http%3A%2F%2Fk-512.googlecode.com%2Ffiles%2FAlgoTra.pdf&amp;amp;ei=0BqvVLmuENfuaJXUgIgL&amp;amp;usg=AFQjCNG4Qztpu3Cf5qAn79WXID2xE1qHzA&amp;amp;sig2=zNnYgu6q1fjNqt6fr675dQ&amp;amp;bvm=bv.83339334,d.d2s&amp;amp;cad=rjt&quot; rel=&quot;nofollow&quot;&gt;Quantitative Trading: How to Build Your Own Algorithmic Trading Business&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I found those ones really interesting and could be useful to build a basic knowledge to create a trading system.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-01-09T00:06:25.243" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16145" PostTypeId="2" ParentId="16141" CreationDate="2015-01-09T01:19:53.747" Score="2" Body="&lt;p&gt;First, I think you made a mistake in your computations above. Where you wrote $(30-20)$, I think you really meant $(30-(-20))$ i.e. $30+20$, yielding a gamma P&amp;amp;L of $1000$ instead of $200$. Your total P&amp;amp;L over $[90,170]$ would then be $110$ instead of $-690$. It doesn't matter for my answer either way, just thought I'd point it out for confused readers.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;By definition, $\Delta = \frac{\partial V}{\partial S}$, where $V$ is the price of a financial derivative and $S$ is the price of its underlying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if $S$ experiences a move from $S_0$ to $S_1$, it follows logically that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta V = V(S=S_1) - V(S=S_0) = \int_{S_0}^{S_1}{\Delta \mathrm{d}S}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, your P&amp;amp;L is indeed the area under the curve.  Now, unfortunately, what you are computing here is &lt;strong&gt;not&lt;/strong&gt; that. Indeed, by writing your P&amp;amp;L as the sum of these simplistic delta and gamma terms, what you really are saying, mathematically, is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta V = \int_{S_0}^{S_1}{\Delta \mathrm{d}S} = \Delta(S=S_0)\cdot(S_1-S_0) + \frac{\Delta(S=S_1)-\Delta(S=S_0)}{2}\cdot(S_1-S_0)$$&#xA;i.e.&#xA;$$\Delta V = \frac{\Delta(S=S_0)+\Delta(S=S_1)}{2}\cdot(S_1-S_0)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This would hold if for example $\Delta$ is assumed linear over $[S_0,S_1]$, but unfortunately, isn't true in the general case. For example, over $[110, 130]$, your computed $\Delta$ is slightly concave (it would have to be equal to $4.5$ at $120$ to be linear), so your estimation of the P&amp;amp;L is slightly off. Over $[130,170]$, as the interval is larger and the shape more complex, the error is obviously worse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A better estimation when you know some values of $\Delta$ over a discrete interval would be to assume that it is piecewise linear in between observations. It would be equivalent to using your method, but over the smallest possible intervals, which is indeed as you suggest the same as doing a discrete integral. In this case&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\int_{S_i}^{S_j}{\Delta \mathrm{d}S} = \sum_{k=i}^{k=j-1}\left(\frac{\Delta(S=S_k)+\Delta(S=S_{k+1})}{2}\cdot(S_{k+1}-S_k)\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your specific case, the computation would yield&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta V = \left(\frac{11-5}{2}+\frac{-20-5}2+\frac{-12-20}2+\frac{-12+10}2+\frac{15+10}2+\frac{30+15}2\right)\cdot10=85$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So as you can see, it gives a quite different result ;-)&lt;/p&gt;&#xA;" OwnerUserId="13993" LastActivityDate="2015-01-09T01:19:53.747" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16146" PostTypeId="1" AcceptedAnswerId="16662" CreationDate="2015-01-09T03:47:54.677" Score="6" ViewCount="1876" Body="&lt;p&gt;I have 2 questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;What is the most commonly used equity option pricing model? I learned jump diffusion at school, read about Hensen and a few other models online.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I am actually only calibrating the surface for easy retrieval of historical data. Right now to answer questions like &quot;what is the implied vol of an option with strike = 105% of forward price and time = 3 month, for each day for the past 10 years&quot;, I literally have to interpolate on 3650 different option chains. Since each option chain is a 2000 * 4 grid, the process is slow. I am hoping that after calibrating, I only have to look at the parameters, instead of the entire surface.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;But since calibrating loses accuracy, my second question is, is it viable to increase accuracy by cutting the surface into a few segments, and then calibrating each segment separately? I am honestly only looking for a function that fits through the surface, and I have no problem making that function piece-wise since any fitting attempt is better than my current method of using the entire surface.&lt;/p&gt;&#xA;" OwnerUserId="7467" LastEditorUserId="7467" LastEditDate="2015-01-09T06:01:02.050" LastActivityDate="2015-04-23T02:56:09.667" Title="Commonly used vol surface calibration model in the industry" Tags="&lt;implied-volatility&gt;&lt;calibration&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16147" PostTypeId="1" AcceptedAnswerId="16149" CreationDate="2015-01-09T04:44:01.523" Score="3" ViewCount="166" Body="&lt;p&gt;Suppose it is known that the price of a certain security after one period will be one of the $m$ values $s_1,\ldots,s_m$. What should be the cost of an option to purchase the security at time $1$ for the price $K$ when $K &amp;lt; \min s_i$? (This problem is Exercise 5.3 in Sheldon M. Ross, &lt;em&gt;An Elementary Introduction to Mathematical Finance, 3/e&lt;/em&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that the value of the call option at time $1$ will be $s_i-K$ if the price of the security will be $s_i$ at time $1$. Then one unit of the security at time $1$ will be equal in value to one unit of the call plus a sure amount of $K$. Then if the interest rate is $r$ compounded continuously, the security price $S$ and the option price $C$ at time $0$ should satisfy $$S=C+Ke^{-r}.$$ However I am not sure how to calculate the exact cost of this option, given that neither the price of the security nor the interest rate is known. This chapter is mainly about arbitrage so I think this problem should be solved via arbitrage.&lt;/p&gt;&#xA;" OwnerUserId="7982" LastActivityDate="2018-08-21T21:30:26.727" Title="Price an option whose strike price is always lower than the future price of the security" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;asset-pricing&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16148" PostTypeId="2" ParentId="16104" CreationDate="2015-01-09T06:56:45.790" Score="3" Body="&lt;p&gt;If you like an R related blog with a lot of code that you can use then you shoud look here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://systematicinvestor.wordpress.com/&quot; rel=&quot;nofollow&quot;&gt;http://systematicinvestor.wordpress.com/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similar in a similar vein but with less code (and I think the authors know each other) is the Blog by David Varadi&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://cssanalytics.wordpress.com/&quot; rel=&quot;nofollow&quot;&gt;https://cssanalytics.wordpress.com/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think these two are an important extension of the ones already mentioned.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-01-09T06:56:45.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16149" PostTypeId="2" ParentId="16147" CreationDate="2015-01-09T09:36:02.557" Score="2" Body="&lt;p&gt;That is the answer, $S-e^{-r}K$. It depends on the values $S$ of the security at time $0$, on $K$ and on the interest rate $r$. All of these you can assume know at time $0$, i.e. now.&lt;/p&gt;&#xA;" OwnerUserId="6947" LastActivityDate="2015-01-09T09:36:02.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16150" PostTypeId="1" CreationDate="2015-01-09T10:53:11.263" Score="1" ViewCount="364" Body="&lt;p&gt;For a project, I have to quantitatively implement a strategy for value investing in EURO STOXX 50. I pulled the data from Datastream. When I was checking some data plots for dividend yields and total returns, I noticed there is two times Deutsche Boerse . One is named &quot;Deutsche Boerse&quot; and the other &quot;Deutsche Boerse NPV ASSENTED&quot;. &quot;Deutsche Boerse NPV ASSENTED&quot; has a dividend yield of 0 and I have only data for 2011 and 2012, but for &quot;Deusche Boerse&quot; I have data from 2001 to 2014. Also, the total returns differ in the years where I have data for both.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you click &lt;a href=&quot;http://deutsche-boerse.com/dbg/dispatch/en/kir/dbg_nav/investor_relations/20_The_Share/45_Share_Buy_Back&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;, you come to the website of Deutsche Boerse. It says there was an repurchase at this time. So, did they just repurchase it and did not pay dividend on the repurchased shares because they owned them? But how could this explain the difference in total returns?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I really need a clear answer because I am new to this. Thanks!&lt;/p&gt;&#xA;" OwnerUserId="13585" LastEditorUserId="13585" LastEditDate="2015-01-09T11:54:01.807" LastActivityDate="2015-03-10T18:32:23.887" Title="What does NPV ASSENTED after stock name mean?" Tags="&lt;equities&gt;&lt;quant-trading-strategies&gt;&lt;index&gt;&lt;european&gt;&lt;investing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16151" PostTypeId="1" AcceptedAnswerId="16156" CreationDate="2015-01-09T11:06:43.683" Score="2" ViewCount="765" Body="&lt;p&gt;I am building a little Excel file that take some option prices in input and plots the volatility smile/surface. &#xA;I have a script that reads market prices from the option chain for 3 different maturities and save the option prices in an Excel file. Each time I save option prices I also save the price of the underlying (in this case the DAX index). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have two problem. The first should be easy to solve, but I just ask you if I'm right. Basically when maturity approaches, the B&amp;amp;S IV that I get applying the Newton-Raphson algorithm is very very low. Roughly, for an ATM position I get something around 5%. Is it because I have to scale up this figure by square root of time to have an annualized value? &#xA;Or the IV is already annualized and i just have to see for some other error somewhere else? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second problem is more tricky to me. When I extract the prices from the chain I have noticed that when I then calculate the IV for some strike I always get error (the numerical algorithm fails to converge to the solution). As said, I always use the underlying price at the moment the chain has been extracted so that data should be fine. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible that is just because for some strikes the option prices weren't updated? Weirdly this happens also for some strike that are not deep OTM. &#xA;But, if this is the case, what would be the best way to proceed? My goal is plot an updated volatility smile for each maturity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should I calculate the price for those strike that I suspect weren't up to date at the moment of the download (I would identify these strikes by looking at those contract for which I'm not able to calculate the IV)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But to calculate the theoretical price I still need an IV to input in the B&amp;amp;S formula... So should I interpolate the volatilities that I already have and the use the interpolated IV to calculate the missing prices?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, this morning with EuroStoxx trading at 3100.94 I recorded for the Call striking at 2825 a bid price of 273.6 and an ask price of 276.8. &#xA;The time to maturity of the contract is 0.37534246575342467 and if I use r=0.01 I cannot find a solution for the IV. &#xA;I think it's just because the price wasn't updated to basically these bid/ask call prices are not in sync with the underlying. But it's just a guess.&lt;/p&gt;&#xA;" OwnerUserId="7451" LastEditorUserId="7451" LastEditDate="2015-01-09T20:24:44.127" LastActivityDate="2015-01-10T20:20:28.710" Title="Some questions about implied volatilities and how to generate theoretical prices when market prices are not available" Tags="&lt;options&gt;&lt;volatility&gt;&lt;option-pricing&gt;&lt;implied-volatility&gt;&lt;volatility-smile&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16152" PostTypeId="1" AcceptedAnswerId="31035" CreationDate="2015-01-09T13:32:33.393" Score="10" ViewCount="7708" Body="&lt;p&gt;Is there an API or APIs similar to the Yahoo! or Quandl APIs, that give the same access to pre and after market data? I know I can scrape the Nasdaq or Yahoo! Finance sites to get a pre/after market price and the yahoo api has a tag for &quot;After Hours Change (Real-time)&quot;, but I am hoping for a API with more detail. Note : I am mainly interested in securities such as stocks and ETFs but open to other pre/after market data sources.&lt;/p&gt;&#xA;" OwnerUserId="15031" LastActivityDate="2016-11-16T13:47:36.920" Title="API for after and pre market data" Tags="&lt;programming&gt;&lt;market-data&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16154" PostTypeId="2" ParentId="16150" CreationDate="2015-01-09T17:31:51.910" Score="-1" Body="&lt;p&gt;Google: NPV stock&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then google: assented stock&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They are separate qualifiers. Looking for both at the same time may result in no useful answer.&lt;/p&gt;&#xA;" OwnerUserId="13925" LastActivityDate="2015-01-09T17:31:51.910" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16155" PostTypeId="1" CreationDate="2015-01-09T20:15:59.233" Score="1" ViewCount="8214" Body="&lt;p&gt;In a case of a call option with strike $K=0$, then payoff at expiration time $T$ is equal to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$(S_T-0,0)^{+}=S_T$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In reality the price of the option on the date of maturity is never equal to the stock price itself regardless of the strike price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;More details following comments:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having the price of the call option equal to the stock price itself provided that the strike is zero implies that holding the call is equivalent to, i.e. generates the same value as, holding the stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, holding the stock has something that holding the call does not offer, e.g. the right to vote and claim on a share of firm’s property.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, holding the call option is not equivalent to holding the stock. Therefore, the price of the call will always be at least a little lower than the stock price itself.&lt;/p&gt;&#xA;" OwnerUserId="15035" LastEditorUserId="467" LastEditDate="2015-11-22T11:24:52.853" LastActivityDate="2018-12-13T23:57:36.533" Title="Why is the price of a call option with $K=0$ equal to the price of the stock $S_0$?" Tags="&lt;options&gt;" AnswerCount="3" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16156" PostTypeId="2" ParentId="16151" CreationDate="2015-01-09T21:15:25.637" Score="2" Body="&lt;p&gt;Based on the example you gave, it seems that indeed your inputs are inconsistent. The intrinsic call value is $S-e^{-rT}K = 286.52355\dots$, which is higher than the market value, implying that there exists an arbitrage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, one of your inputs is probably wrong. Even if the interest rate is set to $0$, the intrinsic call value is still above your bid, so I can probably safely assume that the problem is not with the interest rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it has to be with the spot price, or at least the consistency between the spot and call price as you've identified. One of the reasons could indeed be that you've sampled both values at different times.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can be quite hard to find consistent price feeds for both option and spot prices. One alternative when you have a good enough option feed, is to look at both call and put prices at a given strike, and imply the spot from put-call parity $S = C - P + e^{-rT}K$, where $C$ is the price of the call, and $P$ is the price of the put. The spot price obtained from this method is guaranteed to yield a valid implied vol for these option prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an aside, to improve the accuracy of your implied vol calculation a little bit further if there is a chance of inconsistency between your spot and option price (either when your read the spot directly or you obtain it from put-call parity), I would make sure to use the instrument whose implied vol is least sensitive to the spot. For an instrument with value $V$, it is easy to get &#xA;$$\frac{\partial\sigma(S)}{\partial S} = -\frac{\partial V}{\partial S}/\frac{\partial V}{\partial\sigma} = -\frac{\Delta}{\nu}$$ &#xA;So in order to minimize the error in implied volatility due to the error in spot price, you want to use a calibration instrument with the smallest absolute value for the above. When close to the money, straddles minimize this quantity with their delta being close to 0, whereas out-of-the-money instruments should be used when the spot is further above or below the strike.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't really comment on your first issue (is your implied vol annualised or not) because it depends on the specific computation you are using to obtain it. However, what you can do to make sure your computation is correct, is to plug the implied vol in the black scholes formula and check that you can back out the price you started with. If the value you used for $T$ in that formula is expressed in years, and you can accurately get back your starting value, then you can rest assured that the implied vol you obtained is indeed annualised.&lt;/p&gt;&#xA;" OwnerUserId="13993" LastEditorUserId="13993" LastEditDate="2015-01-10T20:20:28.710" LastActivityDate="2015-01-10T20:20:28.710" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="16157" PostTypeId="1" CreationDate="2015-01-09T22:09:32.620" Score="6" ViewCount="973" Body="&lt;p&gt;With the forthcoming new regulations, IFRS9, financial institutions will be required to model life time expected credit losses. Consequently, it is necessary to model the term structure of default probabilities for different products/counter-parties. How can one successfully implement such a model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In current literature one finds a variety of approaches to model the term structure of default probabilities. Most often, these approaches utilize market data to extract implied default probabilities over a certain horizon, for instance using bonds or credit default swaps. However, these methods are only applicable when such data is available. The term structure of default probabilities for non-listed enterprises (for instance) will be much more cumbersome to determine. Also, many models does not rigorously incorporate default correlations which is necessary for the application of a portfolio. Presumably one will only be able to use historical data of credit migrations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In accordance with &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.114.3942&quot;&gt;Bluhm and Overbeck (2007)&lt;/a&gt; one find the model credit migrations using Markov chains, and from there find each rating grades term structure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have anyone come across other interesting literature which allows one to model term structures of default probabilities only using historical credit migration data?&lt;/p&gt;&#xA;" OwnerUserId="4709" LastActivityDate="2015-02-25T02:57:01.447" Title="Term structure of default probabilities without market data" Tags="&lt;credit-ratings&gt;&lt;credit-risk&gt;&lt;default-probability&gt;&lt;default-risk&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16159" PostTypeId="2" ParentId="16129" CreationDate="2015-01-09T23:02:25.470" Score="0" Body="&lt;p&gt;I agree that your derivation makes sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To me, the only way to explain the book's price is if, as time goes by, the model is constantly modified, so that at time $\tau$, $\hat{G_t} = S_t + D_t - D_\tau$ is assumed to be a geometric brownian process with volatility $\sigma$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The book's price wouldn't be equal to the price of the option if the world really behaved under the diffusion that was assumed at time $0$, but I can see how it could still be somewhat justified: in practice, such a recalibration would be what one would do when risk managing this option (it doesn't really make sense to consider at time $\tau$ that the volatility of the stock's price depends on past dividends, which is what this model implies).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, for risk management purposes, the volatility would also be updated over time, so the true price as observed at time $\tau$ would use some $\sigma_\tau$ as its volatility, not necessarily equal to the original $\sigma$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I haven't read the book, so I can't comment on why the formula was written this way, but in the end I think both formulas could be argued for and against depending on the point of view (i.e. are you talking about the price at time $\tau$ as a pure random variable seen from time $0$, or as a known value observed on time $\tau$).&lt;/p&gt;&#xA;" OwnerUserId="13993" LastActivityDate="2015-01-09T23:02:25.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16160" PostTypeId="1" CreationDate="2015-01-10T11:24:08.840" Score="1" ViewCount="73" Body="&lt;p&gt;I have an assignment dealing with the stock market and I'm a little lost. My instructions are to come up a method to create a score for a stock then compare the score against what the stock actually earned in 3 time periods (1 day, 3 days, and 7 days). I'm new to coefficients so I have some questions below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my data that I returned using a regular correlation coefficient formula. I swapped out the stock pct return vs market pct return and used the stock price returns for each day as the stock returns and used the score as the market return. I did this because I can create a score with information that I can get from the stock but I obviously can't get the actual return of the stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Score, Return, Correlation Coefficient&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; 26.87, 5.44, .022&#xA; 21.34, 3.42, .034&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Since I'm plugging in the data that I know and trying to get a return, does that mean I should use a predictive regression formula like a multiple regression formula?&lt;/li&gt;&#xA;&lt;li&gt;Am I using them in the right place in the formula or should I swap the values around?&lt;/li&gt;&#xA;&lt;li&gt;Will this matter if I swap out the values in the formula?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="13906" LastActivityDate="2015-01-10T11:24:08.840" Title="Should I use a correlation coefficient formula or a multiple regression formula?" Tags="&lt;correlation&gt;&lt;regression&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16162" PostTypeId="1" AcceptedAnswerId="16188" CreationDate="2015-01-10T19:03:23.703" Score="3" ViewCount="784" Body="&lt;p&gt;I refer to MFM introduced by Hunt [2000]. These models can be seen a subset of interest rate market models. MFM allow us to describe the term structure elements using a set a &lt;strong&gt;functions&lt;/strong&gt; of a low-dimensional &lt;strong&gt;Markov&lt;/strong&gt; process (say 1 or 2). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This gives to the model the ability to calibrate fairly well and to capture the &lt;strong&gt;smile&lt;/strong&gt;. Of course, due to limited number of risk factors can fail to capture the &lt;em&gt;instantaneous correlation&lt;/em&gt; structures between rates. However, being low-dimensional, Markovian and relatively good with the smile it did not make it so popular yet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If indeed this is true. What do you see as the reason? Why do people still prefer short rate modelling (maybe with stochastic vol) or even the path-dependent BGM?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance.&lt;/p&gt;&#xA;" OwnerUserId="15039" LastEditorUserId="19645" LastEditDate="2021-05-05T08:44:48.513" LastActivityDate="2021-05-05T08:44:48.513" Title="Why Markov Functional Models (Hunt 2000) are not yet so popular?" Tags="&lt;interest-rates&gt;&lt;volatility-smile&gt;&lt;market-model&gt;&lt;markov&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16167" PostTypeId="2" ParentId="15417" CreationDate="2015-01-11T20:17:20.997" Score="0" Body="&lt;p&gt;I remember reading a paper a while ago about estimating bid/ask spreads through high/low.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www3.nd.edu/~scorwin/papers/high-low_spreads.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www3.nd.edu/~scorwin/papers/high-low_spreads.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That might help, because free NBBO data might be hard to come by.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For repurchase data, S&amp;amp;P 500 buybacks are online, but you have to hunt around for the releases and compile it yourself it seems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://us.spindices.com/indices/equity/sp-500&quot; rel=&quot;nofollow&quot;&gt;http://us.spindices.com/indices/equity/sp-500&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="758" LastActivityDate="2015-01-11T20:17:20.997" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16168" PostTypeId="2" ParentId="9368" CreationDate="2015-01-11T23:14:02.127" Score="1" Body="&lt;p&gt;There's ongoing debate about whether SPX and VIX options contain different valuable information (see &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2296826&quot; rel=&quot;nofollow&quot;&gt;Bardgett Gourier Leippold (2013) - Inferring Volatility Dynamics and Risk Premia from the S&amp;amp;P 500 and VIX Markets&lt;/a&gt; among recently contributions). I would say this is slightly counterintuitive (VIX index is calculated as a portfolio of SPX vanilla), but at the same time, is the fact that VIX derivatives provide a pure volatility exposure (and traders know it much better than me) that make them conveying a different information, at least concerning volatility dynamics. This said, I would use a consistent model calibrated on both markets. Moreover, in the context of VIX options, there's no Dupire equation (linking VIX option Prices to a VIX implied local volatiliy), but - in some sense parallel - there's an approach called the &lt;em&gt;standalone&lt;/em&gt; approach (see &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1524193&quot; rel=&quot;nofollow&quot;&gt;Mencìa Sentana (2012)&lt;/a&gt; for an update reference), in which one models directly the VIX (without care of the S&amp;amp;P500 market). I would use this If you need a pure pricing machine. But, a &lt;em&gt;structural&lt;/em&gt; model as the one I mentioned before is needed to have a perspective of the market as a whole (e.g. estimate risk premia).&#xA;To conclude, you could off course even simply interpolate the VIX implied surface as is common practice in SPX context. But I don't think this what you meant.&lt;/p&gt;&#xA;" OwnerUserId="13528" LastActivityDate="2015-01-11T23:14:02.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16169" PostTypeId="1" CreationDate="2015-01-12T01:19:42.607" Score="0" ViewCount="276" Body="&lt;p&gt;I've found some free sources for stock historical data but none that aren't broken links or give me quite what I need. I want...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For NASDAQ, S&amp;amp;P 500, DJIA:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Historical data for the past 5 years that includes a complete list of all stocks in the index, the year end closing price, and the year end shares outstanding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Seems like a simple request but I can't get this anywhere.&lt;/p&gt;&#xA;" OwnerUserId="15047" LastActivityDate="2015-02-11T04:23:55.343" Title="Historical Data - Free Sources in 2015?" Tags="&lt;historical-data&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2015-02-11T04:40:39.983" ContentLicense="CC BY-SA 3.0" />
  <row Id="16170" PostTypeId="1" CreationDate="2015-01-12T02:21:45.530" Score="3" ViewCount="635" Body="&lt;p&gt;I've read &lt;a href=&quot;https://quant.stackexchange.com/questions/8896/except-zipline-are-there-any-other-pythonic-algorithmic-trading-library-i-can-c&quot;&gt;question&lt;/a&gt;, however it doesn't appear as if any of those libraries work for FX data. A Google search for &lt;code&gt;python forex backtesting&lt;/code&gt; turns up &lt;a href=&quot;https://github.com/vighneshiyer/forex-backtester-python&quot; rel=&quot;nofollow noreferrer&quot;&gt;this project&lt;/a&gt;, however I think it needs quite a bit more development before it can be considered useful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I can tell the two most promising projects are &lt;a href=&quot;https://github.com/quantopian/zipline&quot; rel=&quot;nofollow noreferrer&quot;&gt;Zipline&lt;/a&gt; and &lt;a href=&quot;http://quantlib.org/index.shtml&quot; rel=&quot;nofollow noreferrer&quot;&gt;Quantlib&lt;/a&gt;, but again no FX support.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After a bit more searching it looks like my question is a duplicate of &lt;a href=&quot;https://quant.stackexchange.com/questions/10886/are-there-python-algorithmic-trading-libraries-supporting-forex&quot;&gt;this one&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="15046" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2019-10-15T14:00:50.110" Title="Are there any software libraries for backtesting FX algorithms against tick data?" Tags="&lt;backtesting&gt;&lt;fx&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16171" PostTypeId="2" ParentId="16169" CreationDate="2015-01-12T03:24:42.190" Score="0" Body="&lt;p&gt;Check out &lt;a href=&quot;https://www.quandl.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.quandl.com&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They have various feeds of historical stock data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: check out the post for more details.&#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/141/what-data-sources-are-available-online&quot;&gt;What data sources are available online?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15048" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2015-01-12T03:24:42.190" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16172" PostTypeId="2" ParentId="15764" CreationDate="2015-01-12T03:35:47.190" Score="0" Body="&lt;p&gt;Unfortunately you need all except econometrics toolbox. Look for a book called &quot;Financial Risk Forecasting &quot; by Jon Danielsson ,will be useful for what you need. &lt;/p&gt;&#xA;" OwnerUserId="15049" LastActivityDate="2015-01-12T03:35:47.190" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16173" PostTypeId="1" CreationDate="2015-01-12T03:49:07.320" Score="8" ViewCount="668" Body="&lt;p&gt;I'm  trying  to calibrate a &lt;a href=&quot;http://en.wikipedia.org/wiki/LIBOR_market_model&quot;&gt;Libor Market Model&lt;/a&gt; (LMM) in Matlab with my user-defined function, not their package. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I already fitted the market volatilities using &lt;a href=&quot;http://en.wikipedia.org/wiki/SABR_volatility_model&quot;&gt;SABR&lt;/a&gt; but failed to simulate the correct market prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are my questions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Has anyone a validation set of cap surfaces and cap prices?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What are the quoting market conventions for pricing  using  a Libor curve? I've  seen many different ways of applying  discount on the black formula. What about OIS? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is there any really good implementation guide available, with pseudo or real code to observe? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="13398" LastEditorUserId="467" LastEditDate="2015-01-12T08:15:24.350" LastActivityDate="2015-10-09T13:12:28.500" Title="Do you have a validation set for Libor Market Model implementation?" Tags="&lt;fixed-income&gt;&lt;programming&gt;&lt;monte-carlo&gt;&lt;libor&gt;&lt;market-model&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16174" PostTypeId="2" ParentId="16173" CreationDate="2015-01-12T10:14:54.210" Score="2" Body="&lt;p&gt;For LMM I thing the Rebonato's book 2002 is a good reference. He has explained the condition of vol quotation that allow existence of calibration solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;LMM parameters and inputs are quite complexe, calibrator not work maybe caused by your implementation's bugs but not  only data input. I think it is better if you calibrate virtually before true market data. I.e you create the data yourself so that you know the &quot;true parameters&quot;, you calibrate from a &quot;false parameters&quot; to find the true one. If this first step work, you can say your implementation do not have bug. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second step is then read article, improve the model by ensuring always the virtual test works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that always not work with market data, maybe it is caused by bad data. You can prove it by using the cascade calibrattion (Brigo Damien 2006 book). If effectively data is bad, you need to add a regulation into the calibration (penalty method). However be aware that adding penalty modify the solution (wich is allowable when exacte solution do not exist), you have to study how and &quot;how much&quot; penalty you add in order to have the reasonable accuracy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS : I had a litle experience in implementing LMM , we use swapfion vcub and standard discount curve as input for calibration.&lt;/p&gt;&#xA;" OwnerUserId="3507" LastActivityDate="2015-01-12T10:14:54.210" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16175" PostTypeId="1" AcceptedAnswerId="16196" CreationDate="2015-01-12T13:43:19.567" Score="3" ViewCount="775" Body="&lt;p&gt;I am interested in calculating the effect of the roll return using different roll strategies. In specific I want to mimic a long-only futures investments. I have historical data for several agricultural commodities. In order to compare the returns of the different roll strategies I created ratio back-adjusted time series using the following formula's.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ratio adjustment = (Price new contract - Price old contract)/(Price old contract)&#xA;Adjusted prices = (all old futures * ratio adjustment) + Prices new contract&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I use historical data ranging from the 80's to the end of 2014 there are multiple rolls. For every I make these adjustments (iterative process). So the latest contract is not adjusted while the first contract is adjusted tens of times (depending on the roll strategy). I want to know what the return of the various roll strategies are. Hence, I am not interested in the prices of the futures contracts itself (I realize that these get distorted by the ratio adjustment). Furthermore, since futures are traded on margin I will take a more academic approach and make the assumption that the futures are fully collateralized. Meaning that a 'x' dollar amount is invested in T-bills, where x is equal to the price of the futures contract. Hence I calculate the return of the roll strategies as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Return = (new adjustment price - old adjustment price)/(old adjustment price) - (t-bill interest earned on amount x) * 100&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I think I am making a mistake since the return on a soybean position is extraordinary. Somewhere in the 600% (when I do not consider the t-bill interest earned) over a time period from 1997 to 2014 when rolling on the last trading day. What am I missing? How should I calculate and compare the performance of the different roll strategies if this approach is wrong?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;** EDIT: Added code R **&#xA;This is the function which I use to calculate the roll return in R. Every roll date I iterate over this function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;backAdjTSFun &amp;lt;- function(ts, rollRow, pastRollRow, rollFromColumn,df,adjRatio = FALSE,nextRollRow = NULL, lastColumn = NULL) {&#xA;  #adjust the exisiting data by the ratio&#xA;  if (is.null(pastRollRow)) {&#xA;    currentContractPrices &amp;lt;- df[1:rollRow, rollFromColumn]&#xA;    #because you do not necessarily start at the beginning of the dataset&#xA;    #there might be some na's from the first row onwards&#xA;    #hence, delete these first.&#xA;    currentContractPrices &amp;lt;- na.omit(currentContractPrices)&#xA;    updatedTS &amp;lt;- as.numeric(currentContractPrices) * as.numeric(adjRatio)&#xA;  } else {&#xA;    tsRatioAdj &amp;lt;- as.numeric(ts) * as.numeric(adjRatio)&#xA;    #You roll at the end of the last trading day to the next contract. Hence, you only need to start counting from the NEXT day. The last trading day is included in the rollFromColumn vector.&#xA;    dayAfterPastRoll &amp;lt;- pastRollRow + 1&#xA;&#xA;    #For the deferred roll the last roll is not made. Due to data constraints.&#xA;    #Hence you need to make an adjustment and make sure that the data of the second last&#xA;    #roll is not adjusted.&#xA;    if(!is.null(lastColumn) &amp;amp;&amp;amp; lastColumn == TRUE) {&#xA;      currentContractPrices &amp;lt;- df[dayAfterPastRoll:rollRow, rollFromColumn]&#xA;      updatedTS &amp;lt;- c(tsRatioAdj, currentContractPrices)&#xA;    } &#xA;    #For the front month roll and last day roll you should add the contract prices of the&#xA;    #last roll unadjusted.&#xA;    else {  &#xA;      currentContractPrices &amp;lt;- df[dayAfterPastRoll:rollRow, rollFromColumn] * as.numeric(adjRatio)&#xA;      #combine the timeseries for the current contract and the already existing adjusted timeseries&#xA;      updatedTS &amp;lt;- c(tsRatioAdj, currentContractPrices)&#xA;      #if the column is the last column in the sample then&#xA;      #select the data in this column and append it to the price vector&#xA;      #without adjusting it.&#xA;      nextColumn &amp;lt;- rollFromColumn + 1&#xA;      if(nextColumn == length(df) &amp;amp;&amp;amp; !is.null(nextRollRow)) {&#xA;        if(!is.null(lastColumn) &amp;amp;&amp;amp; lastColumn == TRUE) {&#xA;          nextColumn &amp;lt;- lastColumn&#xA;        }&#xA;        currentContractPrices &amp;lt;- df[(rollRow+1):nextRollRow, nextColumn]&#xA;        updatedTS &amp;lt;- c(updatedTS, currentContractPrices)&#xA;      }&#xA;    }&#xA;  }&#xA;  return(updatedTS)&#xA;}&#xA;&#xA;&#xA;ldr &amp;lt;- function (df, settlement = FALSE, ret=&quot;roll&quot;, startAdj = F) {&#xA;  error &amp;lt;- NULL&#xA;  rollReturn &amp;lt;- NULL&#xA;  retMatrix &amp;lt;- matrix(,nrow=length(df),ncol=13)&#xA;  colnames(retMatrix) &amp;lt;- c(&quot;previousContract&quot;, &quot;newContract&quot;, &quot;difference&quot;, &quot;rollDate&quot;,&quot;startDate&quot;, &quot;endDate&quot;, &quot;Mean roll return&quot;, &quot;Std.&quot;, &quot;Number of rolls&quot;, &quot;Min&quot;, &quot;25% - 75%&quot;, &quot;Median&quot;, &quot;Max&quot;)  &#xA;  # Ok, there are two possibilities here...&#xA;  # Possibility number 1: determine the last trading date of a contract.&#xA;  # The last trading is the settlement date&#xA;  firstTradingDay &amp;lt;- sapply(df, function (x) min(which(!is.na(x))))&#xA;  if (settlement == FALSE) {&#xA;    lastTradingDay &amp;lt;- sapply(df, function (x) max(which(!is.na(x))))&#xA;  }&#xA;  else {&#xA;    lastTradingDay &amp;lt;- settlement&#xA;  }&#xA;  n &amp;lt;- 1&#xA;  z &amp;lt;- 1&#xA;  pastRollRow &amp;lt;- NULL&#xA;  for (i in lastTradingDay) {&#xA;    if (n &amp;lt; length(df)) {&#xA;      z &amp;lt;- z + 1&#xA;      rollFrom &amp;lt;- as.numeric(as.character(df[i,n]))&#xA;      rollTo &amp;lt;-  as.numeric(as.character(df[i,n+1]))&#xA;&#xA;&#xA;      #backadj&#xA;      adjRatio &amp;lt;- rollTo/rollFrom&#xA;      ts &amp;lt;- backAdjTSFun(ts,i,pastRollRow,n,df,adjRatio,lastTradingDay[z]);&#xA;      pastRollRow &amp;lt;- i&#xA;&#xA;&#xA;      retMatrix[n,1] &amp;lt;- rollFrom&#xA;      retMatrix[n,2] &amp;lt;- rollTo&#xA;      retMatrix[n,3] &amp;lt;- calcReturn(rollFrom,rollTo)&#xA;      retMatrix[n,4] &amp;lt;- as.character(date[i])&#xA;    }&#xA;    n &amp;lt;- n + 1&#xA;  }&#xA;  transFormed &amp;lt;- as.numeric(retMatrix[,3])&#xA;  quantiles &amp;lt;- quantile(transFormed, c(0.25,0.75), na.rm=T)&#xA;  retMatrix[1,5] &amp;lt;- as.character(date[firstTradingDay[1]])&#xA;  retMatrix[1,6] &amp;lt;- as.character(date[tail(lastTradingDay,1)])&#xA;  retMatrix[1,7] &amp;lt;- mean(transFormed, na.rm=T)   &#xA;  retMatrix[1,8] &amp;lt;- sd(transFormed, na.rm=T)   &#xA;  retMatrix[1,9] &amp;lt;- length(na.omit(retMatrix[,3]))&#xA;  retMatrix[1,10] &amp;lt;- min(transFormed, na.rm=T)&#xA;  retMatrix[1:2,11] &amp;lt;- quantiles&#xA;  retMatrix[1,12] &amp;lt;- median(transFormed, na.rm=T)&#xA;  retMatrix[1,13] &amp;lt;- max(transFormed, na.rm=T)&#xA;  #Let the dates overlap/correspond with eachother at every entry across strategies --&amp;gt; add NA's before&#xA;  if (startAdj == TRUE &amp;amp;&amp;amp; ret == 'ts' || ret == 'tsReturn') {&#xA;    ts &amp;lt;- c(rep('NA',firstTradingDay[1]-1),ts)&#xA;  }&#xA;  return(returnVal(ret, error, retMatrix, ts))  &#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where df is my dataframe which is Datastream output and data is a vector containing all the dates in the sample. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;** EDIT Results **&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[1] &lt;a href=&quot;https://imgur.com/NWXv6FL&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://imgur.com/NWXv6FL&lt;/a&gt; &quot;Results&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where the FMR1 rolls the contract rolls the position on the last day of the month prior to the last settlement day. FMR2 rolls the contract on the last day two months prior to the last settlement day and LDR rolls the contract on the last settlement day of a contract.&lt;/p&gt;&#xA;" OwnerDisplayName="user15050" LastEditorDisplayName="user15050" LastEditDate="2015-01-14T20:16:25.117" LastActivityDate="2015-01-14T20:16:25.117" Title="Comparing the return of different roll strategies" Tags="&lt;returns&gt;&lt;futures&gt;&lt;ratio&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16176" PostTypeId="1" CreationDate="2015-01-12T15:08:31.527" Score="3" ViewCount="111" Body="&lt;p&gt;I am taking liberty to ask the following question in quantLib forum though this question is about RQuantLib&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to use RQuantLib to calculate clean price of a fixed coupon bond using a Nelson-Siegel ZCYC. I need to use 30/360 European daycounter to calculate fraction of year between the settlement date and coupon payment schedule. I don't see any where what will be the enumerated value for the above dayCounter?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please help.&lt;/p&gt;&#xA;" OwnerUserId="15052" LastEditorUserId="308" LastEditDate="2015-01-14T12:29:40.723" LastActivityDate="2015-01-14T12:29:40.723" Title="How do I specify Thirty360::European day counter in RQuantLib" Tags="&lt;r&gt;&lt;quantlib&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16178" PostTypeId="1" CreationDate="2015-01-12T17:42:15.340" Score="2" ViewCount="76" Body="&lt;p&gt;In order to examine different approaches to event studies, I am looking for a market anomaly which is simple to replicate in an event study for demonstration purposes. For example, post-earnings-announcemet drift is made tricky by the different points in time over the year at which companies disclose their earnings. I am thus looking for an anomaly based on a stock characteristic that is available at a frequency common for price data (i.e. daily, monthly etc.).&lt;/p&gt;&#xA;" OwnerUserId="13665" LastActivityDate="2015-01-12T18:35:07.413" Title="Which anomalies are easy to replicate in an event study?" Tags="&lt;equities&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16179" PostTypeId="2" ParentId="16178" CreationDate="2015-01-12T18:35:07.413" Score="2" Body="&lt;p&gt;The January effect is easy to demonstrate. Always the same dates for multiple shares.&lt;/p&gt;&#xA;" OwnerUserId="13950" LastActivityDate="2015-01-12T18:35:07.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16180" PostTypeId="1" CreationDate="2015-01-12T19:12:09.997" Score="0" ViewCount="785" Body="&lt;p&gt;For the rest of my question I use the notation from &lt;a href=&quot;http://www.damianobrigo.it/book.html&quot; rel=&quot;nofollow&quot;&gt;Brigo&lt;/a&gt;. The discounted payoff of a receiver interest rate swap (RFS) at $t&amp;lt;T_{\alpha}$, where $T_{\alpha}$ is the first resetting date, is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$(RFS)=\sum^\beta_{i=\alpha +1 }D(t,T_i)N\tau_i(K-L(T_{i-1},T_i))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$D(t,T_i)$ the discount factor at $t$ of time $T_i$&lt;/li&gt;&#xA;&lt;li&gt;N some notional&lt;/li&gt;&#xA;&lt;li&gt;$\tau_i$, general daycount convention for between $T_{i-1}$&#xA;and $T_i$&lt;/li&gt;&#xA;&lt;li&gt;$L(T_{i-1},T_i)$ market rate between $T_{i-1}$ and $T_i$&lt;/li&gt;&#xA;&lt;li&gt;strike rate $K$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;My first question: Brigo says one can write the above value as a chain of foward rate agreements:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$(RFS)= \sum^\beta_{i=\alpha +1 }NP(t,T_i)\tau_i(K-F(t;T_{i-1},T_i))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I do not see how this is true by using &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P(t,T)(1+\tau(t,T)L(t,T))=1$$ &#xA;and&#xA;$$F(t;T,S):=\frac{1}{\tau(T,S}\left(\frac{P(t,T}{P(t,S)}-1\right)$$&lt;/p&gt;&#xA;" OwnerUserId="17133" LastActivityDate="2015-02-14T10:37:15.917" Title="How can we write swap as a chain of FRA's" Tags="&lt;mathematics&gt;&lt;swaps&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16181" PostTypeId="1" AcceptedAnswerId="16563" CreationDate="2015-01-12T19:38:24.633" Score="5" ViewCount="1294" Body="&lt;p&gt;I have another question about interest rates. In this case it is about swaption and how to come up with a pricing formula. For the rest of my question I use the notation from &lt;a href=&quot;http://www.damianobrigo.it/book.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Brigo&lt;/a&gt;. The payoff of a payer swaption discountad from the maturity &lt;span class=&quot;math-container&quot;&gt;$T_\alpha$&lt;/span&gt; to the current time &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt; is given by&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$D(t,T_\alpha)N\left(\sum^\beta_{i=\alpha +1 }P(T_\alpha,T_i)\tau_i(F(T_\alpha;T_{i-1},T_i)-K)\right)^+$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$D(t,T_i)$&lt;/span&gt; the discount factor at &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt; of time &lt;span class=&quot;math-container&quot;&gt;$T_i$&lt;/span&gt;&lt;/li&gt;&#xA;&lt;li&gt;N some notional&lt;/li&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$\tau_i$&lt;/span&gt;, general daycount convention for between &lt;span class=&quot;math-container&quot;&gt;$T_{i-1}$&lt;/span&gt;&#xA;and &lt;span class=&quot;math-container&quot;&gt;$T_i$&lt;/span&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$F(T_\alpha;T_{i-1},T_i)$&lt;/span&gt; forward rate at &lt;span class=&quot;math-container&quot;&gt;$T_\alpha$&lt;/span&gt; between &lt;span class=&quot;math-container&quot;&gt;$T_{i-1}$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$T_i$&lt;/span&gt;&lt;/li&gt;&#xA;&lt;li&gt;strike rate &lt;span class=&quot;math-container&quot;&gt;$K$&lt;/span&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$P(T_\alpha,T_i)$&lt;/span&gt; zero coupon bond at &lt;span class=&quot;math-container&quot;&gt;$T_\alpha$&lt;/span&gt; with maturity &lt;span class=&quot;math-container&quot;&gt;$T_i$&lt;/span&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;denoting with &lt;span class=&quot;math-container&quot;&gt;$S:=S_{\alpha,\beta}(0)$&lt;/span&gt; the forward swap rate, i.e. that &lt;span class=&quot;math-container&quot;&gt;$K$&lt;/span&gt; which&#xA;makes the contract fair &lt;span class=&quot;math-container&quot;&gt;$(=0)$&lt;/span&gt; we can come up with models for &lt;span class=&quot;math-container&quot;&gt;$S$&lt;/span&gt;. Assuming a log normal model we derive a Black like formula.&lt;/p&gt;&#xA;&lt;p&gt;However, I'm interested in the case where &lt;span class=&quot;math-container&quot;&gt;$dS=\sigma dW$&lt;/span&gt;, i.e. &lt;span class=&quot;math-container&quot;&gt;$S$&lt;/span&gt; is normally distributed (Bachelier model). How does a pricing forumla for a swaption look like? I just can find Black formula on the web. Many thanks for the reference / answer.&lt;/p&gt;&#xA;" OwnerUserId="17133" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2015-02-14T00:24:54.683" Title="swaption model for forward swap rate" Tags="&lt;reference-request&gt;&lt;swaption&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16182" PostTypeId="1" CreationDate="2015-01-12T21:50:20.950" Score="0" ViewCount="857" Body="&lt;p&gt;In an attempt to learn Black-Litterman I have come across this &quot;simple&quot; example. Suppose that you analyze market data using CAPM&#xA;$$r_i-r_f=\beta_i(r_m-r_f)+\epsilon_i$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose there are 2 assets in the market, $r_f=0.065$, and you find that&#xA;$$\hat{u}_M=1,\; \sigma_M=1,\; \beta_1=0.5,\; \beta_2=-0.1,\; r_1=0.3,\; r_2=0.4$$&#xA;where $r_1$ and $r_2$ are the standard deviation of the regression residuals.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Using the data analysis results compute the excess return $\hat{\mu}$ and the covariance matrix $V$ for the two assets.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Suppose that your private information suggests that in the next period, asset 1 will out perform asset 2 by 20% and underperform that market by 60%. Formulate the private information into the investors views as defined in the Black-Litterman model.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Given that the variance of your private information is 0.1 and your confidence parameter in the CAPM model is $\tau =0.01$, what is your best estimate on the expected excess return of the two assets in the next period?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Based on your new estimate on the excess return of the two assets, solve that following portfolio selection problem with 3 assets (assets 1, 2, and the risk free asset):&#xA;$$Max\; \mu_{bl}^Tx-\frac{\lambda}x^TVx$$&#xA;$$s.t. \;\; x^T\mathbb{1}=1$$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;1 is straight forward using CAPM and 4 is easily computed using Lagrange multipliers if you have the results from 2 and 3. It's 2 and 3 I'm lost on. Can someone provide a detailed solution to this. I think it would provide a great simple example of BL in action, which I can't seem to locate anywhere on or off line.&lt;/p&gt;&#xA;" OwnerUserId="13698" LastActivityDate="2015-01-18T07:46:15.363" Title="Black-Litterman with simple portfolio" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;&lt;black-litterman&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16183" PostTypeId="2" ParentId="15906" CreationDate="2015-01-12T22:23:04.477" Score="2" Body="&lt;p&gt;If log returns have a symmetric distribution, prices will have a positively skewed distribution, since exponentiating induces positive skew.&lt;/p&gt;&#xA;" OwnerUserId="8228" LastActivityDate="2015-01-12T22:23:04.477" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16184" PostTypeId="2" ParentId="8431" CreationDate="2015-01-12T22:54:32.907" Score="1" Body="&lt;p&gt;Why can't you just adjust your book prices by the variable price and then subtract the fixed price off the PNL when calculating that up? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For exchange, with a 2% variable fee, a book 98 bid 100, resting offer at $100 would go up too $102 and bid go down to $96.04.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note evaluate your arbs like you normally would and subtract off the fixed fees from the corresponding venues.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This assumes the fixed fee is per transaction.  If the fixed fee is per unit volume,  then you can augment the book like the variable fees instead.&lt;/p&gt;&#xA;" OwnerUserId="758" LastActivityDate="2015-01-12T22:54:32.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16185" PostTypeId="2" ParentId="16155" CreationDate="2015-01-13T02:07:05.307" Score="3" Body="&lt;p&gt;Buying a call at time $t=0$ with strike $K=0$ on a stock whose value is $S_0$ will produce the following cash flows ensure a cash flow at time $t=T$ of $S_T$, because as you mentioned $(S_T - 0, 0 )^{+}=S_T$ because $S_t \geq 0 ~ \forall t$ by definition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This cash flow is replicable by buying the stock for $S_0$ at $t=0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the law of one price, if there is no arbitrage then the price of the call has to be equal to the price of the replicating portfolio, which yields $c_t = S_t$ indeed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you're referring to about voting vote and credit risk is kind of different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The credit risk part can be adjusted by some kind of &lt;a href=&quot;http://en.wikipedia.org/wiki/Credit_valuation_adjustment&quot; rel=&quot;nofollow&quot;&gt;CVA&lt;/a&gt;, but frankly as a share holder you will come after all debt holders and you probably don't have much to recover in case of bankruptcy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The voting right part is actually very different. I don't really see why this would add value very much to the price of the stock, but if it was you could &quot;model&quot; it as some kind of dividend yield and you'll miss the opportunity of cashing in these dividends during the call's life. This would make the price of the call indeed lower than $S_0$.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2015-11-04T01:46:04.237" LastActivityDate="2015-11-04T01:46:04.237" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16188" PostTypeId="2" ParentId="16162" CreationDate="2015-01-13T10:06:17.097" Score="2" Body="&lt;p&gt;it's difficult to say that they are not popular. Some people definitely use them for live pricing. I'd say the real question is &quot;why are they not popular in the academic literature&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One answer would simply be that most the questions that arise in their use are ones of fiddliness which do not make good papers.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-01-13T10:06:17.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16189" PostTypeId="1" AcceptedAnswerId="16192" CreationDate="2015-01-13T10:13:12.513" Score="2" ViewCount="179" Body="&lt;p&gt;The question refers to the well-known &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2524547&quot; rel=&quot;nofollow&quot;&gt;Ross (1976)&lt;/a&gt; paper with the derivation of the Asset Pricing Theory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the APT, the return of asset $i$ is driven by a linear factor model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ R_i = \alpha_i + \sum_{j=1}^m \beta_i^j \mathcal{F}_j + \varepsilon_i $$&#xA;where $\alpha_i$ is the intercept, $\beta_i^j$ is the sensitivity of asset $i$ to factor $j$ (the factor loading) and $\mathcal{F}_j$ is the value of factor $j$. $\varepsilon_i$ is the idiosyncratic risk of asset $i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now what I want to derive is ($R_f$ is the risk free rate)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \pi_i := \mathbb{E} R_i - R_f = \sum_{j=1}^m\beta_i^j \pi(\mathcal{F}_j) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\pi(\mathcal{F}_j) = \mathbb{E}\mathcal{F}_j - R_f$. As the name suggests, this is done by a no arbitrage argument and the result means that the asset risk premia are determined by the factor risk premia via the factor loadings $\beta_i^j$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the paper the author assumes that for an arbitrage portfolio $x$ with asset weights $x_i$, $\sum_{i=1}^nx_i\varepsilon_i \approx 0$ by the law of large numbers if the $\varepsilon_i$ are &quot;sufficiently independent for the law of large numbers to hold&quot;. Translated, this basically means that the arbitrage portfolio does not show any substantial idiosyncratic risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, the author proceeds that the net factor exposure of an arbitrage portfolio should be $0$:&#xA;$ \sum_{i=1}^n x_i \beta_i^j = 0$ and that the arbitrage portfolio does not use any capital $ \sum_{i=1}^nx_i = 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then he continues with the derivation (which ends up in a linear algebra argument and finally the APT equations).&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Question&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;The question is why does the author need the law of large numbers? Doesn't this implicitly assume that the number of $n$ assets is large?  Wouldn't it be better to just assume that for an arbitrage portfolio $\sum_{i=1}^n x_i\varepsilon_i=0$? &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I think the answer is somehow tied to the question: If the linear relation between factor risk premia and asset risk premia does NOT hold, does this mean that there is an arbitrage portfolio? (in the sense that $\sum_{i=1}^nx_i\varepsilon_i=0$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(The question arose from Appendix A1 of this document &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2524547&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;, where the authors dont provide details about this.)&lt;/p&gt;&#xA;" OwnerUserId="2727" LastEditorUserId="2727" LastEditDate="2015-01-13T15:06:13.813" LastActivityDate="2015-01-15T07:26:59.857" Title="Law of large numbers necessary for APT derivation?" Tags="&lt;statistics&gt;&lt;factor-models&gt;&lt;asset-pricing&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16190" PostTypeId="1" AcceptedAnswerId="16191" CreationDate="2015-01-13T11:57:35.613" Score="0" ViewCount="48" Body="&lt;p&gt;I went through some presentations about LowVol strategies for some indices. In the presentations were tables with average returns, vola, Sharp ratio and ATOP. I have no clue what this ATOP is supposed to mean. They interpreted higher ATOP as higher transactions costs. So, what does it exactly stand for and how is it measuring transaction costs? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using google didn't give me anything.&lt;/p&gt;&#xA;" OwnerUserId="13585" LastActivityDate="2015-01-13T12:43:04.880" Title="Transaction Costs Measure ATOP: What does it mean and exactly measure?" Tags="&lt;volatility&gt;&lt;asset-allocation&gt;&lt;analysis&gt;&lt;transaction-costs&gt;&lt;tactical-asset-allocation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16191" PostTypeId="2" ParentId="16190" CreationDate="2015-01-13T12:35:17.647" Score="2" Body="&lt;p&gt;I would say it could be short for&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;a&lt;/strong&gt;nnual &lt;strong&gt;t&lt;/strong&gt;urn&lt;strong&gt;o&lt;/strong&gt;ver (&lt;strong&gt;p&lt;/strong&gt;recent/&lt;strong&gt;p&lt;/strong&gt;ortfolio)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Higher portfolio turnover often means higher transaction costs. &#xA;The definition is usually the lesser of all buys and sells in a year divided by the average monthly NAV of the strategy. (Morningstar)&#xA;Be aware that turnover numbers come in all colors and flavors and can in or exclude various trades. (As a small example: would you include an FX hedge into your turnover calculations?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you could link a presentation in question we could probably provide you with a better guess.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastEditorUserId="2727" LastEditDate="2015-01-13T12:43:04.880" LastActivityDate="2015-01-13T12:43:04.880" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16192" PostTypeId="2" ParentId="16189" CreationDate="2015-01-13T18:01:40.587" Score="1" Body="&lt;p&gt;In small sample, there is no reason why $x' \epsilon$ will be 0. In fact, there is no real reason why $\epsilon$ should be independent. The fact that you are assuming a linear specification for the returns means you are to some extent making assumptions of linear regression. Justifying the errors being uncorrelated with the independent variables is justified through asymptotically diversifying idiosyncratic risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: An interesting resource is also Jay Shankens &lt;a href=&quot;http://home.business.utah.edu/finmll/fin787/papers/shanken1982.pdf&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13415" LastEditorUserId="2727" LastEditDate="2015-01-15T07:26:59.857" LastActivityDate="2015-01-15T07:26:59.857" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16193" PostTypeId="1" CreationDate="2015-01-13T19:08:52.817" Score="7" ViewCount="373" Body="&lt;p&gt;Why is Weighted Least Squares necessary in fundamental factor model while it is not in a standard Macroeconomic factor model? I understand that $\mathbb{E}[\epsilon^2_{it}]=\sigma_i^2$ varies across observations $i$, but isn't this the same in a macroeconomic factor model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For reference: in the following model of returns, for a macroeconomic model the factors are known, whereas for a fundamental model the loadings are known and the factors are not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$R_{it}=\alpha_i + \beta_{i,1} f_{1,t}+ \beta_{i,2}f_{2,t}+ \dots + \beta_{i,k}f_{k,t} + \epsilon_{i,t} \quad \forall i = 1, \dots, N$&lt;/p&gt;&#xA;" OwnerUserId="5360" LastEditorUserId="5360" LastEditDate="2015-01-16T09:21:54.330" LastActivityDate="2019-09-02T14:36:27.647" Title="Why is Weighted Least Squares necessary in fundamental factor model?" Tags="&lt;factor-models&gt;&lt;factor-loading&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16194" PostTypeId="1" CreationDate="2015-01-13T19:39:25.820" Score="-2" ViewCount="140" Body="&lt;p&gt;Stock market has been model as a random walk with a drift.  Since it has a drift(bigger than zero) it is not a &quot;Brownian Motion&quot; but it still a Martingale?&#xA;Is Stock market a Brownian Motion?&#xA;Is it a Martingale?&lt;/p&gt;&#xA;" OwnerUserId="15061" LastActivityDate="2015-01-14T09:04:00.250" Title="Martiglale and Brownian Motion" Tags="&lt;brownian-motion&gt;" AnswerCount="2" CommentCount="3" ClosedDate="2015-01-14T13:01:26.097" ContentLicense="CC BY-SA 3.0" />
  <row Id="16195" PostTypeId="2" ParentId="16155" CreationDate="2015-01-13T21:06:19.573" Score="1" Body="&lt;p&gt;You need to make a distinction between reality and the model you are considering.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) In your model, the conclusion is valid: in your model holding the stock is equivalent to holding the zero strike call. This is because you make many implicit assumptions (basically &lt;a href=&quot;http://en.wikipedia.org/wiki/Black%E2%80%93Scholes_model#The_Black-Scholes_world&quot; rel=&quot;nofollow&quot;&gt;these&lt;/a&gt; with zero risk free rate). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Yes these assumptions i.e. your model are very simplistic. No it doesn't take into account voting right or counterparty risk so you cannot expect the predictions of this model to match reality on these subjects. In fact it doesn't even take into account two much more important factors&#xA;- interest rate&#xA;- dividends (much more important that voting rights)&lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2015-01-13T21:06:19.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16196" PostTypeId="2" ParentId="16175" CreationDate="2015-01-13T22:27:58.930" Score="0" Body="&lt;p&gt;Well. A naive quick adjustment method that I ran showed about a 230% increase over the same period excluding any interest so this result is not necessarily unreasonable by itself.   Adjusted returns can occasionally depend drastically on what your roll rules are especially as you go deep into history.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps take a quick scan over your prices/returns.  Some contracts (November for Soy plus others?) are very thinly traded and should be excluded from roll series.  A bad price on a roll date can mess up a series.&lt;/p&gt;&#xA;" OwnerUserId="5689" LastActivityDate="2015-01-13T22:27:58.930" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16197" PostTypeId="2" ParentId="16194" CreationDate="2015-01-14T00:35:41.083" Score="1" Body="&lt;p&gt;The stock market is modeled as a brownian motian,with a real world drift usually  larger than zero. This sort of model would be similiar to the CAPM or APT , VaR.&#xA;The martingale  is a mathematical  condition  that assure  no arbitrage used in derivatives  pricing, black scholes style. In that case the drift usually  is the risk free rate of such economy.&lt;/p&gt;&#xA;" OwnerUserId="13398" LastActivityDate="2015-01-14T00:35:41.083" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16198" PostTypeId="1" AcceptedAnswerId="16199" CreationDate="2015-01-14T03:40:58.890" Score="3" ViewCount="364" Body="&lt;p&gt;I try to understand US treasury in the bond markets provided by &lt;a href=&quot;http://www.bloomberg.com/markets/rates-bonds/government-bonds/us/&quot; rel=&quot;nofollow&quot;&gt;bloomberg&lt;/a&gt;:&#xA;In this webpage, I have a few questions, for instance taking 12month-Bill:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) What is the maturity date? I find that it stays always 12 month everyday. Does it mean US government issue 12-month-Bond everyday?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) What is the face value? The price was quoted 0.18 (now), and it's abnormal if the face value is 100 dollar (which is usual face value learned from book) for this price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="15066" LastActivityDate="2015-01-14T05:47:58.723" Title="How can I interpret US treasury?" Tags="&lt;bond&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16199" PostTypeId="2" ParentId="16198" CreationDate="2015-01-14T05:47:58.723" Score="7" Body="&lt;p&gt;1) 52-week T-bills are currently auctioned on a monthly basis. Bloomberg always shows the most recently auctioned T-bills for each tenor. For example, right now, the &quot;12-month&quot; T-bill was actually issued on Jan 8, 2015, and matures on Jan 7, 2016. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) T-bills are quoted on a discount basis, using the Actual/360 day count convention. Its price is&#xA;$$ \text{price} = 100 - r \frac{\text{days to maturity}}{360}. $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Continuing with the 52-week T-bill.  On January 14, 2015 for settlement on January 15, 2015 (T + 1), the days to maturity (Jan 7, 2016) is 357. Since the yield is 0.18%, its price is&#xA;$$ 100 - 0.18 \times \frac{357}{360} = 99.8215. $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This should be read as the % of face value. If you purchase a million of this paper, then you'd pay $1{,}000{,}000 \times 99.8215\%$ dollars.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2015-01-14T05:47:58.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16200" PostTypeId="1" AcceptedAnswerId="16230" CreationDate="2015-01-14T05:53:30.103" Score="2" ViewCount="2315" Body="&lt;p&gt;I am trying to implement machine learning to predict the movement of bid and ask price but is unable to find the proper feature for training set. I am using Support Vector Machine for binary classification.&lt;/p&gt;&#xA;" OwnerUserId="15067" LastActivityDate="2015-03-08T01:48:32.113" Title="Feature for Maching Learning(SVM) in High Frequecy Order Book?" Tags="&lt;high-frequency&gt;&lt;algorithmic-trading&gt;&lt;machine-learning&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16201" PostTypeId="1" AcceptedAnswerId="16202" CreationDate="2015-01-14T06:59:43.690" Score="1" ViewCount="199" Body="&lt;p&gt;in the following stochastic differential equation merton model we have $$\frac{ds}{s}=(\alpha-\lambda k)dt+\sigma dW+dq$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\alpha$ is the instantaneous expected return on the stock; $\sigma^2$is the instantaneous&#xA;variance of the return, conditional on no arrivals of important new information (i.e.,&#xA;the Poisson event does not occur); $dW$ is a standard Gauss-Wiener process; $q(t)$ is&#xA;the independent Poisson process ; $dq$ and $dW$ are assumed to be&#xA;independent; ¸ is the mean number of arrivals per unit time;$ k=E(Y-1)$ where&#xA;$(Y-1)$ is the random variable percentage change in the stock price if the Poisson&#xA;event occurs; and $E$ is the expectation operator over the random variable $Y$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;now my question is why we use $E(Y-1)$ and we dont use $E(Y)$ i.e I want to know What is the purpose of -1? &lt;/p&gt;&#xA;" OwnerUserId="13493" LastEditorUserId="2587" LastEditDate="2015-01-14T15:28:56.833" LastActivityDate="2015-01-14T15:28:56.833" Title="Question about the stochastic differential equation in the Merton model" Tags="&lt;stochastic-processes&gt;&lt;finance&gt;&lt;sde&gt;&lt;merton-model&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16202" PostTypeId="2" ParentId="16201" CreationDate="2015-01-14T07:43:11.977" Score="5" Body="&lt;p&gt;if $Y=1$ the stock price doesn't change since it's a percentage change not an absolute, so we have to subtract one when drift compensating. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See my book Concepts etc for my discussion. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-01-14T07:43:11.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16203" PostTypeId="2" ParentId="16181" CreationDate="2015-01-14T07:49:16.737" Score="3" Body="&lt;p&gt;well just take the Bachelier formula with $r=d=0$ $S_0 = S_{\alpha,\beta}$ and then multiply by the annuity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The annuity will be&#xA;$$&#xA;\sum \limits_i \tau_i P_{i+1}. &#xA;$$&#xA;where $P_{i+1}$ is the df for $t_{i+1}.$&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-01-14T07:49:16.737" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16204" PostTypeId="2" ParentId="16194" CreationDate="2015-01-14T09:04:00.250" Score="1" Body="&lt;p&gt;In real world probabilities it is not a martingale as the expected value of the stock in the future will be different than its actual value, because of its non-zero drift. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the risk-neutral probability world the stock price discounted by the risk-free rate can be considered as a martingale. &lt;/p&gt;&#xA;" OwnerUserId="13942" LastActivityDate="2015-01-14T09:04:00.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16207" PostTypeId="1" AcceptedAnswerId="30697" CreationDate="2015-01-14T15:51:29.390" Score="2" ViewCount="306" Body="&lt;p&gt;We use historical simulation for risk analysis. I.e. for each bond there is a repricing of the form&#xA;$$&#xA;P_j = PV(\text{yield curve in scenario } j),&#xA;$$&#xA;where the yield curve is the zero rates curve of the respective country (for a German bond I take the German curve, for an Italian bond the Italian, ...). The various scenarios of the yield curves are calculated from historical shifts along the curve applied to the present curve and for all markets simultaneously (thus modelling correlations among the bond markets).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then for each bond we calculate returns $r_j = P_j/P_0-1$, thus the return of the price in scenario $j$ based on the current market price $P_0$. Then the portfolio return in scenario $j$ is calculated by&#xA;$$&#xA;r_j^P = \sum_{i=1}^N w_i r_j^i,&#xA;$$&#xA;where $w_i$ is the current weight of bond $i$ in the portfolio and $r^i_j$ is its return in scenario $j$. Then portfolio volatility can be estimated as the standard deviation of $r_1^P,\ldots,r_j^K$,ie. $\sigma^P$, if we have $K$ scenarios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore I can calculate volatiltiy contributions $\sigma_i$ for each bond by&#xA;$$&#xA;\sigma_i = w_i covar(r^i,r^P)/\sigma^P, &#xA;$$&#xA;then $\sum_{i=1}^N \sigma_i = \sigma^P$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All this is quite standard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In an EMU portfolio (say: Germany, France, Italy) I have various effects: overall change in interest rate levels (more or less risk free, this is more or less the German yield curve) and changes in the market valuation of more risky countries (as additional yield w.r.t the German level) - a sort of credit risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What methods do you apply to separate interest rate risk from credit risk in a sovereign portfolio? What are your experiences? Are there any references?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All the data I have is the curves for each country. I would like to avoid using data from credit derivatives.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2017-01-22T02:29:57.853" Title="Fixed Income risk attribution in the historical simulation of a sovereign bond portfolio" Tags="&lt;risk-management&gt;&lt;bond-portfolio&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16208" PostTypeId="2" ParentId="14975" CreationDate="2015-01-14T17:41:29.180" Score="0" Body="&lt;p&gt;Yes, it's definitely possible to implement FAST decoding on an FPGA.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An FPGA will decode with lower latency than a software decode even though the CPU might be running 10x higher clock rate than the FPGA, with the added benefit of deterministic latency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you include the time for ingress from the wire to decoded output an FPGA will be significantly faster than anything else available (assuming nobody has fabbed an ASIC).&lt;/p&gt;&#xA;" OwnerUserId="15073" LastActivityDate="2015-01-14T17:41:29.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16209" PostTypeId="2" ParentId="16152" CreationDate="2015-01-14T18:37:52.843" Score="1" Body="&lt;p&gt;it's not free, but works well..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.xignite.com/product/XigniteSuperQuotes/api/GetQuote/&quot; rel=&quot;nofollow&quot;&gt;http://www.xignite.com/product/XigniteSuperQuotes/api/GetQuote/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15064" LastActivityDate="2015-01-14T18:37:52.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16210" PostTypeId="1" CreationDate="2015-01-14T19:58:07.743" Score="0" ViewCount="127" Body="&lt;p&gt;Thanks for opening this question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have constructed some rules for a portfolio with annual rebalancing and am backtesting it for the period 1990-2014. I want to compare the risk-adjusted return to the risk-adjusted return of the S&amp;amp;P 500 index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For every individual year I have calculated log returns of the constituents of the portfolio and calculate portfolio volatility for every year using the following formula in Excel: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First I compute the variance like this:&#xA;=MMULT(MMULT(array1;matrix1);array2)&#xA;&lt;br&gt;&#xA;array1: array of weights of constituents of the portfolio*annual volatility of the constituent for every constituent in that year&lt;br&gt;&#xA;array2: constituents return correlation matrix&lt;br&gt;&#xA;array3: transpose of weights of constituents&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And then I SQRT() the variance to get the annual portfolio volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I am wondering if I can use the annual portfolio volatilies to compute volatilities for certain subperiods, say for example January 2013 - September 2014.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could compute the portfolio volatily for the period Jan 2013 - Dec 2013, and for the period Jan 2014 - Sept 2014, but how do I then combine the result? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for helping me out.&lt;/p&gt;&#xA;" OwnerUserId="13681" LastEditorUserId="13681" LastEditDate="2015-01-14T20:07:11.607" LastActivityDate="2015-04-16T01:10:21.023" Title="I have portfolio volatility for individual years, can I use them to compute portfolio volatiltiy for subperiods?" Tags="&lt;volatility&gt;&lt;portfolio&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16211" PostTypeId="1" CreationDate="2015-01-14T20:51:29.510" Score="3" ViewCount="113" Body="&lt;p&gt;Thanks for looking into this question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Portfolio volatility in year 1 = 15%.&lt;br&gt;&#xA;Portfolio volatility in year 2 = 20%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the portfolio volatility over the timespan year 1 and 2 combined?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it SQRT(0.5)*15% + SQRT(0.5)*20%?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="13681" LastActivityDate="2015-02-14T19:58:51.573" Title="I have portfolio volatility for year 1 and for year 2. What is portfolio volatility for year 1 and 2 combined?" Tags="&lt;volatility&gt;&lt;portfolio&gt;&lt;time&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16212" PostTypeId="1" AcceptedAnswerId="16234" CreationDate="2015-01-14T21:02:33.977" Score="1" ViewCount="232" Body="&lt;p&gt;I'm trying to figure out some kind of immunization using a factor model I developed for interest rates. Here is the basic problem. Let's say that we have a bond portfolio containing $N$ bonds with weights $x_i$ and one liability. Call the present value of the liability $P_L$.  I'll suppose that the bond prices are given by&#xA;$$P_i=\Sigma_{t=1}^T F_{it}e^{-r_tt}$$&#xA;where $F_{it}$ is the future payoff of bond $i$ and $r_t$ is the interest rate at time $t$. Now the factor model for the term structure of the interest rates can be written&#xA;$$\Delta r_t=\Sigma_{j=1}^k \beta_{jt} \Delta f_j +\epsilon_t$$&#xA;for $k$ independent factors and standard normal error term $\epsilon_t$. I'm assuming I have small but not necessarily parallel-shifts in the term structure, I want a first order condition for factor immunization. Can someone help?&lt;/p&gt;&#xA;" OwnerUserId="13698" LastActivityDate="2015-04-16T15:12:26.170" Title="Factor immunization for bond portfolio" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;factor-models&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16213" PostTypeId="2" ParentId="16211" CreationDate="2015-01-14T22:42:08.567" Score="1" Body="&lt;p&gt;So you have the vol of the first half and second half of the return series.&#xA;Assume mean of returns are zero:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Vol of first year and second year:&#xA;$$&#xA; \sigma1^2 = sum(R_1i^2)/openDaysYear1;   &#xA;$$&#xA;$$&#xA; \sigma2^2 = sum(R_2i^2)/openDaysYear2;    &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Vol of the entire series:&#xA;$$&#xA;\sigma^2 = sum(R_i^2)/nbDaysInTwoYears &#xA;$$&#xA;$$&#xA;         = (\sigma1^2 *openDaysYear1 + \sigma2^2 * openDaysYear2)/(openDaysYear1 +openDaysYear2)&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="5861" LastActivityDate="2015-01-14T22:42:08.567" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16214" PostTypeId="2" ParentId="10905" CreationDate="2015-01-14T23:01:33.550" Score="26" Body="&lt;p&gt;Definitely check out &lt;a href=&quot;http://Quantopian.com&quot;&gt;Quantopian&lt;/a&gt; and &lt;a href=&quot;https://github.com/quantopian/zipline&quot;&gt;Zipline&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quantopian provides a free research environment, backtester, and live trading rig (algos can be hooked up to Interactive Brokers). The algorithm development environment includes really handy collaboration tools and an open source debugger. They provide tons of data (even Morningstar fundamentals!) free of charge. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quantopian's platform is built around Python and includes all the open source goodness that that the Python community has to offer (Pandas, NumPy, SciKitLearn, iPython Notebook, etc.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Successful live traders will be offered spots in the Quantopian Managers Program, a crowd-sourced hedge fund.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Zipline is the open source backtesting engine powering Quantopian. It provides a large Pythonic algorithmic trading library that closely approximates how live-trading systems operate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(full disclosure: I work at Quantopian) &lt;/p&gt;&#xA;" OwnerUserId="15075" LastActivityDate="2015-01-14T23:01:33.550" CommentCount="3" CommunityOwnedDate="2015-01-14T23:01:33.550" ContentLicense="CC BY-SA 3.0" />
  <row Id="16215" PostTypeId="1" AcceptedAnswerId="16216" CreationDate="2015-01-15T00:02:19.410" Score="0" ViewCount="246" Body="&lt;p&gt;thanks for looking into this question. See the picture below (better is right-mousebutton - open in new tab). I also have the price and return data of the Stocks if that's needed to calculate the total 2-year period volatility. &#xA;&lt;br&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/nRYSy.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="13681" LastActivityDate="2015-01-15T00:26:09.973" Title="I have volatility of a portfolio in year 1 and in year 2. How do I calculate the volatility over the total 2-year period?" Tags="&lt;volatility&gt;&lt;portfolio&gt;&lt;time&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16216" PostTypeId="2" ParentId="16215" CreationDate="2015-01-15T00:26:09.973" Score="0" Body="&lt;p&gt;It's  an additive  process so you will get the variance of year one and multiple  by number of trading  days divided  by 256, do the same for year  2 , sum the results  and the  take  it to the power of (512/total  number of trading  days)&lt;/p&gt;&#xA;" OwnerUserId="13398" LastActivityDate="2015-01-15T00:26:09.973" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16217" PostTypeId="2" ParentId="16212" CreationDate="2015-01-15T00:30:51.083" Score="0" Body="&lt;p&gt;Usually  the moviments in the yield  curve are  decomposed  by level, slope and curvature or parallel, steepness  and bends in the term structure. These 3 factors  can explain  over 95% 98% of the total variance.  Sometimes  a second  curvature  point is used and the explanation  reaches  99%. Instead  of approximate  it numerically  why won't  you fit the Svensson  or Nelson Siegel model and use it as your factors? &lt;/p&gt;&#xA;" OwnerUserId="13398" LastActivityDate="2015-01-15T00:30:51.083" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16218" PostTypeId="1" AcceptedAnswerId="16220" CreationDate="2015-01-15T04:51:00.607" Score="7" ViewCount="495" Body="&lt;p&gt;I have no problem with the mathematical definition of an Asian option. For example, assume the strike price is $K$, the expiration date is $T$, the underlying asset has price $S(t)$, and the payoff is&#xA;$$\left[\frac{1}{n}\sum_{i=1}^n S(t_i)- K\right]^+,$$ with the expiration date $T=t_n$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say, I bought an Asian option issued by a bank with $K=\$1$ 6 months ago and today is the expiration date. Suppose the average price in the past 6 months of the underlying asset is \$1.5. So the option is worth of \$0.5 now. My question is how the payoff is achieved, i.e. where I get this \$5 from? Does the bank give the \$0.5 directly? Or I need to do some trades on the market to get the \$0.5 as a profit. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it's the latter case, at what price can I buy the underlying asset? Presumably it's not the strike price \$1. Because if I could buy the asset at price \$1 and if the spot price is \$2, then I could achieve \$1 profit instead of \$0.5. &lt;/p&gt;&#xA;" OwnerUserId="15078" LastActivityDate="2015-01-16T15:36:02.517" Title="What is the mechanism of Asian option?" Tags="&lt;options&gt;&lt;asian-option&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16219" PostTypeId="2" ParentId="16180" CreationDate="2015-01-15T08:46:27.523" Score="1" Body="&lt;pre&gt;&lt;code&gt;t         τ----T&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A FRA from $\tau$ to $T$ pays the difference between the fixed rate and the actual fixing (Libor), discounted from $T$ back to $\tau$ &lt;em&gt;at the Libor rate&lt;/em&gt;. This is from when that was a good measure of the risk free rate, with the idea that you would receive this and invest at Libor from $\tau$ to $T$. Thus the cash flow at $\tau$ is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C(\tau) = f(\tau,T).[K-L(\tau)].D(L(\tau),\tau,T)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $f(\tau,T)$ is the year fraction of the FRA period, $K$ is the FRA fixed rate, $L(\tau)$ is the appropriate fixing for $\tau$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A swap's float leg involves some very similar payments, but the main difference is that they pay just the difference between the rates at the end of the roll rather than the beginning:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C'(T) = f(\tau,T).[K-L(\tau)]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apart from that detail, the exposure from a FRA is equivalent to the exposure from one roll of a floating note, i.e. to $L(\tau)$. So since your swap consists of a series of Libor fixed rolls, you can reconstruct the float leg value from the FRAs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In reality, this is a bit more fraught these days - FRAs are not commonly traded for terms longer than 2y, and in this part of the curve the dominant instrument is 3m IR Futures (for the major currencies). So usually you would use Futures rather than FRAs to hedge a swap. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But 2015! Clearing rules are fey: for USD, Futures clear on CME but most swaps clear on LCH.Clearnet, so hedging your swap with futures leaves you with a clearing spread equivalent to a float/float between the two venues. For EUR and GBP the fork is Eurex and LCH. I suspect most of the spread there is down to the differences in the curves rather than realistic expectations of either defaulting; there is a valuation risk which could leave the hedger forked between margin calls on both. Welcome to the money market. &lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2015-01-15T08:46:27.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16220" PostTypeId="2" ParentId="16218" CreationDate="2015-01-15T09:27:17.370" Score="5" Body="&lt;p&gt;The Asian option is cash settled, so the bank will transfer you $0.5. Delivering the shares and doing some trades is not possible. You can't buy the spot for the average price over a period, you just pay the spot price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you're into Asian options, I assume &lt;a href=&quot;http://breakingdownfinance.com/finance-topics/derivative-valuation/option-valuation/asian-option-valuation/&quot; rel=&quot;nofollow&quot;&gt;asian option valuation&lt;/a&gt; is useful for you to assess whether you're not paying too much. &lt;/p&gt;&#xA;" OwnerUserId="13950" LastEditorUserId="13950" LastEditDate="2015-01-16T15:36:02.517" LastActivityDate="2015-01-16T15:36:02.517" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16221" PostTypeId="1" CreationDate="2015-01-15T13:37:23.460" Score="3" ViewCount="520" Body="&lt;p&gt;It seems like the field has become stagnant in the decades following the enormously successful and influential Black Scholes model. (The original paper has been cited a staggering 25,000 times - more than ANY economics paper, by far.) There is also the CAPM and GARCH models, but those were decades ago. Now we have  Black Scholes type models for every type of option under every conceivable condition. We have multiple derivations of these formulas (forier series, closed form, etc) . So what is next? The only new idea is &lt;a href=&quot;http://en.wikipedia.org/wiki/User:Stockequation/sandbox&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/User:Stockequation/sandbox&lt;/a&gt; which makes the jump from the stock market being a statistical system to a mechanical/physical one, like general relativity. It's essentially a 1-d ADS/CFT applied to the stock market and it generates fat tail option prices and vol. smile&lt;/p&gt;&#xA;" OwnerUserId="15081" LastActivityDate="2015-01-18T20:02:51.437" Title="Any New Discoveries in Quantitative Finance?" Tags="&lt;options&gt;" AnswerCount="3" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16223" PostTypeId="1" AcceptedAnswerId="16225" CreationDate="2015-01-15T15:23:04.150" Score="0" ViewCount="695" Body="&lt;p&gt;thanks for looking into this question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am comparing an investment strategy against the S&amp;amp;P 500 for a financial article I'm writing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I compute volatility of the Portfolio in this way, as the square root from the variance computed like this:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/o6aIy.png&quot; alt=&quot;enter image description here&quot;&gt;&#xA;[This is for 4 stocks, but it can of course be extended to an amount of i stocks]&lt;br&gt;&#xA;So for that I take volatility of all individual stocks and correlation between these stocks, that constitute the portfolio, into account.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I calculate the volatility of the index, I just compute the standard deviation from the logreturns on the index. So no correlation of constituents is taken into account for the index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I am wondering: is comparison of the volatility of a portfolio against the volatility of an index valid? &#xA;Or should you also treat the portfolio as an index when you want to perform this comparison? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="13681" LastActivityDate="2015-01-15T16:54:09.557" Title="Comparing Portfolio Volatility with Index Volatility seems a wrong method?" Tags="&lt;volatility&gt;&lt;portfolio&gt;&lt;index&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16224" PostTypeId="2" ParentId="16221" CreationDate="2015-01-15T15:37:51.447" Score="6" Body="&lt;p&gt;Ross had an interesting paper thats making the rounds: The Recovery Theorem. He claims that the physical measure can be recovered from option prices under certain conditions. I think that's getting a lot of academic interest recently.&lt;/p&gt;&#xA;" OwnerUserId="13415" LastActivityDate="2015-01-15T15:37:51.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16225" PostTypeId="2" ParentId="16223" CreationDate="2015-01-15T15:50:51.137" Score="0" Body="&lt;p&gt;The volatility of the index already incorporates the correlation (diversification benefits), even if you calculate it directly as you stated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So yes, you can compare them. &lt;/p&gt;&#xA;" OwnerUserId="13950" LastActivityDate="2015-01-15T15:50:51.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16226" PostTypeId="2" ParentId="16223" CreationDate="2015-01-15T16:54:09.557" Score="0" Body="&lt;p&gt;There is no real difference between an index and a portfolio - at least an index usually can be seen as a portfolio. There are things to consider if index constituents change. One thing that has to be taken into account is that the weights of the constituants change over time due to chaging market prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But putting these details aside:&#xA;If the return $r_p$ is calculated by &#xA;$$&#xA;r_p = \sum_{i=1}^n w_i r_i = w r,&#xA;$$&#xA;with a vector of weights $w$ and a vector of returns $r$ and $n$ is the number of assets, then&#xA;$$&#xA;VAR(r_p) = VAR(w r) =  w^T \Sigma w.&#xA;$$&#xA;Thus the variance of the index (left hand side) without look-through equals the variance of the portfolio if you look through.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-01-15T16:54:09.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16227" PostTypeId="2" ParentId="9746" CreationDate="2015-01-15T17:07:44.593" Score="2" Body="&lt;p&gt;You can also check out the expected shortfall backtesting methodology proposed here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2514403&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2514403&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15083" LastActivityDate="2015-01-15T17:07:44.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16228" PostTypeId="1" AcceptedAnswerId="18391" CreationDate="2015-01-15T17:10:44.813" Score="7" ViewCount="1180" Body="&lt;p&gt;I am trying to implement a project about the BGM model, suggested in the book &quot;The Concepts and Practice of mathematical finance&quot; by Mark Joshi.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is related to the forward volatility structure, particularly about the covariance matrix. First of all, the book assumes that forward $f_j$ has volatility&#xA;$$&#xA;K_j \left(\left(a + b(t_j - t)\right)e^{-c(t_j-t)} + d\right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for $t &amp;lt; t_j$ and $0$ otherwise. Also, the instantaneous correlation between the forward rates $f_i$ and $f_j$ is defined as $e^{-\beta|t_i - t_j|}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I need to write a method that &lt;strong&gt;&quot;computes the covariance matrix for the time-step&quot;&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get confused with the fact that there are &quot;simultaneous&quot; forward rates at each time step that have to be simulated, which brings me to the following two questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Concerning the dimensions of the covariance matrix, I see that they depend on the number of time periods (and not on the time step size), but how long are the time periods? Is there a convention?&lt;/li&gt;&#xA;&lt;li&gt;How do the elements of the covariance matrix come into play? This might sound a bit stupid, but when pricing a swaption, we can have the following discretization of the logarithm of the forward rate:&#xA;$$&#xA;\ln F_k^{\Delta t}(t + \Delta t) = \ln F_k^{\Delta t}(t) + \sigma_k(t)\sum_{j = \alpha + 1}^k \frac{\rho_{k,j}\,\tau_j\,\sigma_j(t)\,F_j^{\Delta t}(t)}{1 + \tau_j F_j^{\Delta t}(t)}&#xA;\Delta t - \\ \frac{\sigma_k(t)^2}{2}\Delta t + \sigma_k(t)\left(Z_k(t + \Delta t) - Z_k(t)\right)$$&#xA;I do not see how the covariance matrix helps in a Monte Carlo simulation. I might be confusing concepts, so some help would be welcome.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="13457" LastEditorUserId="13457" LastEditDate="2015-01-17T12:59:59.433" LastActivityDate="2015-06-16T19:32:30.827" Title="Practical implementation of Libor Market Model" Tags="&lt;fixed-income&gt;&lt;monte-carlo&gt;&lt;covariance-matrix&gt;&lt;forward-rate&gt;&lt;lmm&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="16229" PostTypeId="1" AcceptedAnswerId="16435" CreationDate="2015-01-15T17:26:01.940" Score="12" ViewCount="504" Body="&lt;p&gt;When I first encountered the definition of integrals with respect to Ito processes (Shreve's Stochastic Calculus for Finance Vol II), I didn't think twice.  However, I wanted to see if the definition could be derived.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the rest of this post $\bar{f}$ is such that $\bar{f}'=f$ and $t_{j}^{f}$ is such that $t_{j}\leq t_{j}^{f}\leq t_{j+1}$ according to the mean-value theorem, for some process $f$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the process&#xA;$$X(t)=X(0)+\int_{0}^{t}\Delta(u)\;dW(u)+\int_{0}^{t}\Theta(u)\;du$$&#xA;where the processes $\Theta_{t}(\omega)$ and $\Delta_{t}(\omega)$ are adapted to the Brownian motion $W_{t}(\omega)$.  Then if $\Gamma_{t}(\omega)$ is adapted to $X_{t}(\omega)$, we define&#xA;$$\int_{0}^{t}\Gamma(u)\;dX(u)=\int_{0}^{t}\Gamma(u)\Delta(u)\;dW(u)+\int_{0}^{t}\Gamma(u)\Theta(u)\;du,$$&#xA;which is of course what we would expect by writing (formally)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\int_{0}^{t}\Gamma(u)(\Delta(u)\;dW(u)+\Theta(u)\;du)=\int_{0}^{t}\Gamma(u)\Delta(u)\;dW(u)+\int_{0}^{t}\Gamma(u)\Theta(u)\;du.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;It seems this should be derivable (rather easily) from the original definition of the Ito stochastic integral.&lt;/strong&gt;  However, when I tried to do this, I failed:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align*}&#xA;\int_{0}^{t}\Gamma(u)\;dX(u)&amp;amp;=\lim_{n\to\infty}\sum_{j\in\Pi_{n}}\Gamma(t_{j})\left(\int_{t_{j}}^{t_{j+1}}\Delta(u)\;dW(u)+\int_{t_{j}}^{t_{j+1}}\Theta(u)\;du\right)\\&#xA;&amp;amp;=\lim_{n\to\infty}\sum_{j\in\Pi_{n}}\Gamma(t_{j})\cdot\int_{t_{j}}^{t_{j+1}}\Delta(u)\;dW(u)+\lim_{n\to\infty}\sum_{j\in\Pi_{n}}\Gamma(t_{j})\cdot\int_{t_{j}}^{t_{j+1}}\Theta(u)\;du\\&#xA;&amp;amp;=\lim_{n\to\infty}\sum_{j\in\Pi_{n}}\Gamma(t_{j})\cdot\int_{t_{j}}^{t_{j+1}}\Delta(u)\;dW(u)+\lim_{n\to\infty}\sum_{j\in\Pi_{n}}\Gamma(t_{j})(\bar{\Theta}(t_{j+1})-\bar{\Theta}(t_{j}))\\&#xA;&amp;amp;=\lim_{n\to\infty}\sum_{j\in\Pi_{n}}\Gamma(t_{j})\cdot\int_{t_{j}}^{t_{j+1}}\Delta(u)\;dW(u)+\lim_{n\to\infty}\sum_{j\in\Pi_{n}}\Gamma(t_{j})\Theta(t_{j}^{\Theta})(t_{j+1}-t_{j})\\&#xA;&amp;amp;=\lim_{n\to\infty}\sum_{j\in\Pi_{n}}\Gamma(t_{j})\cdot\int_{t_{j}}^{t_{j+1}}\Delta(u)\;dW(u)+\int_{0}^{t}\Gamma(u)\Theta(u)\;du.&#xA;\end{align*}$$&#xA;where $t_{j}\leq t_{j}^{\Theta}\leq t_{j+1}$ and $\bar{\Theta}'=\Theta.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At this point it would appear nothing can be done with the first sum since we don't have a mean-value theorem for Ito stochastic integrals (as quantified by Ito's lemma); i.e. there does not in general exist a $t_{j}^{\Delta}\in[t_{j},t_{j+1}]$ such that&#xA;$$\int_{t_{j}}^{t_{j+1}}\Delta(u)\;dW(u)=\Delta(t_{j}^{\Delta})(W(t_{j+1}-W(t_{j})).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And in any event it doesn't really matter, since even if we had this result, it would not be known a priori whether the resulting sum converges (or whether it converges to the correct stochastic integral) due to the sensitivity of the limiting sums with respect to the sampling point used.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get a more concrete sense of the difficulty, consider the special case $\Delta(u)=f(W(u))$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then&#xA;$$\int_{t_{j}}^{t_{j+1}}\Delta(u)\;dW(u)=\bar{f}(W(t_{j+1}))-\bar{f}(W(t_{j}))-\frac{1}{2}\int_{t_{j}}^{t_{j+1}}f'(W(u))\;du,$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the first sum becomes&#xA;$$&#xA;\begin{array}{l}&#xA;\lim_{n\to\infty}\sum_{j\in\Pi_{n}}\Gamma(t_{j})\left(\bar{f}(W(t_{j+1}))-\bar{f}(W(t_{j}))-\frac{1}{2}\int_{t_{j}}^{t_{j+1}}f'(W(u))\;du\right)\\&#xA;\;\;\;\;=\lim_{n\to\infty}\sum_{j\in\Pi_{n}}\Gamma(t_{j})\left(\bar{f}(W(t_{j+1}))-\bar{f}(W(t_{j}))\right)-\lim_{n\to\infty}\frac{1}{2}\sum_{j\in\Pi_{n}}\Gamma(t_{j})\left(\int_{t_{j}}^{t_{j+1}}f'(W(u))\;du\right)\\&#xA;\;\;\;\;=\lim_{n\to\infty}\sum_{j\in\Pi_{n}}\Gamma(t_{j})f(W(t_{j}^{f}))(W(t_{j+1})-W(t_{j}))-\lim_{n\to\infty}\frac{1}{2}\sum_{j\in\Pi_{n}}\Gamma(t_{j})f'(W(t_{j}^{f'}))(t_{j+1}-t_{j})\\&#xA;\;\;\;\;=\lim_{n\to\infty}\sum_{j\in\Pi_{n}}\Gamma(t_{j})\Delta(t_{j}^{f})(W(t_{j+1})-W(t_{j}))-\frac{1}{2}\int_{0}^{t}\Gamma(u)f'(W(u))\;du.\end{array}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Putting this together yields&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\int_{0}^{t}\Gamma(u)\;dX(u)=\lim_{n\to\infty}\sum_{j\in\Pi_{n}}\Gamma(t_{j})\Delta(t_{j}^{f})(W(t_{j+1})-W(t_{j}))-\frac{1}{2}\int_{0}^{t}\Gamma(u)f'(W(u))\;du+\int_{0}^{t}\Gamma(u)\Theta(u)\;du,$$&#xA;and it's hard to see how this ends up being equal to the original definition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One would need to somehow show that the mean-value sampling $\Delta(t_{j}^{f})$ in the first sum results in&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\lim_{n\to\infty}\sum_{j\in\Pi_{n}}\Gamma(t_{j})\Delta(t_{j}^{f})(W(t_{j+1})-W(t_{j}))=\int_{0}^{t}\Gamma(u)\Delta(u)\;dW(u)+\frac{1}{2}\int_{0}^{t}\Gamma(u)f'(W(u))\;du.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And in any event, this is just a special case of the process $\Delta_{t}(\omega)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have no doubt the issue can be resolved analytically; however, while the difficulties remain unresolved, it tends to make (in my mind) the definition somewhat artificial.&lt;/p&gt;&#xA;" OwnerUserId="8230" LastEditorUserId="8230" LastEditDate="2015-01-15T17:58:57.683" LastActivityDate="2016-04-28T16:48:04.640" Title="Deriving the definition of stochastic integrals with respect to Ito processes from first principles" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="16230" PostTypeId="2" ParentId="16200" CreationDate="2015-01-15T19:12:08.330" Score="3" Body="&lt;p&gt;Features could include:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Bid-ask spread&lt;/li&gt;&#xA;&lt;li&gt;Bid-ask volume imbalance&lt;/li&gt;&#xA;&lt;li&gt;Signed transaction volume&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The sign in the Signed transaction volume is positive if the buyer has issued a market order and negative if the seller issued a market order. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A great introductory plain English paper on high frequency trading machine learning applications can be found &lt;a href=&quot;https://www.cis.upenn.edu/~mkearns/papers/KearnsNevmyvakaHFTRiskBooks.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A good blog post with information relevant to the subject can be found &lt;a href=&quot;http://epchan.blogspot.com/2013/10/how-useful-is-order-flow-and-vpin.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2015-01-15T19:12:08.330" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16231" PostTypeId="2" ParentId="16210" CreationDate="2015-01-15T19:26:06.513" Score="1" Body="&lt;p&gt;You can use the &lt;a href=&quot;http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Parallel_algorithm&quot; rel=&quot;nofollow&quot;&gt;Parallel Algorithm&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your sample $X$ is divided in two sets of obsrvations $X_{A}$ and $X_B$.&#xA;$$&#xA;\delta\! = \bar x_B - \bar x_A \\&#xA;\bar x_X = \bar x_A + \delta\cdot\frac{n_B}{n_X} \\&#xA;VAR_{X} = VAR_{A} + VAR_{B} + \delta^2\cdot\frac{n_A n_B}{n_X}&#xA;$$&#xA;Where $n$ the number of observations and $\bar x$ the mean. &lt;/p&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2015-01-15T19:26:06.513" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16232" PostTypeId="2" ParentId="9746" CreationDate="2015-01-15T19:59:08.177" Score="0" Body="&lt;p&gt;The Berkowitz tail test allows to test the density tail, and hence indirectly evaluate the CVaR risk measure:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.ims.nus.edu.sg/Programs/econometrics/files/kw_ref_2.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.ims.nus.edu.sg/Programs/econometrics/files/kw_ref_2.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2015-01-15T19:59:08.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16233" PostTypeId="2" ParentId="16210" CreationDate="2015-01-15T23:37:46.703" Score="0" Body="&lt;p&gt;Since you have the weights as well as the price series of your assets, the &lt;em&gt;cleanest&lt;/em&gt; way I can think of is to calculate the portfolio price series for your given time frame, and then estimate the variance from that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem you face is that volatility changes more often than yearly, and obviously the end of the year is not necessarily a 'clean cut' between two regimes. So while it's technically possible (See jaamor's answer), I don't think that will give you the desired result. In a backtest you want to understand how your trading strategy would have performed in the past, if you had implemented it, and one of the most important considerations will be how does a portfolio react to changes in market volatility. For example, if you want to use a low volatility strategy, the backtest will show you if the stocks you selected actually yielded you a portfolio with a lower volatility, or if correlations between the stocks actually reduced that effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I would recommend to use real data wherever possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you work in excel, it should be quite straightforward to do. You will probably have the daily price series of your constituents. Start with the portfolio's initial value and distribute it according to your weights by buying the constituents. Track the prices of the positions until the next rebalancing, the sum will always be equal to the current portfolio value. Before the next rebalancing, calculate what your portfolio is wrorth now. Then redistribute that money according to your strategy's weights. Repeat. Use the resulting time series to calculate variance. Use the stdev-function over the period you want, and then annualize (e.g. from daily vola to annual vola by *sqrt(252), where 252 is the trading days.)&lt;/p&gt;&#xA;" OwnerUserId="1976" LastActivityDate="2015-01-15T23:37:46.703" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16234" PostTypeId="2" ParentId="16212" CreationDate="2015-01-16T13:33:02.827" Score="1" Body="&lt;p&gt;The present value is&#xA;$$&#xA;P_i= \sum_{t=1}^T F_{i,t} \exp(-r_t t),&#xA;$$&#xA;what happens if rates change to $r_t + \Delta r_t$ then the new price is&#xA;$$&#xA;P_i^{new} = \sum_{t=1}^T F_{i,t} \exp(-(r_t+\Delta r_t) t).&#xA;$$&#xA;by the exponential series $\exp(x)\approx 1 + x$ we can write&#xA;$$&#xA;P_i^{new} - P_i =: \Delta P_i \approx -\sum_{t=1}^T F_{i,t} \Delta r_t t. &#xA;$$&#xA;Observing the shifts in these rates we have some kind of key-rate duration setting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you can decompose your liablity $P_L$ in the is way too (denote the cash flows by $F_t$, then you can try to find quantities $Q_i$ such that&#xA;$$&#xA;|\sum_{t=1}^T (Q_i  F_{i,t} - F_t) \Delta r_t t| -&amp;gt; Min&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-01-16T13:33:02.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16235" PostTypeId="1" CreationDate="2015-01-16T00:01:57.307" Score="3" ViewCount="208" Body="&lt;p&gt;I'm trying to program a volatility updating rule using iteration. I start with the well know Heston-Nandi model where the returns dynamics are :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/VvJmt.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with &lt;img src=&quot;https://i.stack.imgur.com/Z3tak.gif&quot; alt=&quot;enter image description here&quot;&gt; is iid standard normal randome variable, where &lt;img src=&quot;https://i.stack.imgur.com/k8UKN.gif&quot; alt=&quot;enter image description here&quot;&gt; is time-varying squared volatility, &lt;img src=&quot;https://i.stack.imgur.com/5jDhg.gif&quot; alt=&quot;enter image description here&quot;&gt;, &lt;img src=&quot;https://i.stack.imgur.com/wjW9G.gif&quot; alt=&quot;enter image description here&quot;&gt; and  &lt;img src=&quot;https://i.stack.imgur.com/3BKGf.gif&quot; alt=&quot;enter image description here&quot;&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to do is to write the code associate to the volatility updating rule, explain in this  algorithm :&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Define &lt;img src=&quot;https://i.stack.imgur.com/Mftfd.gif&quot; alt=&quot;enter image description here&quot;&gt; equals the given unconditional variance  which is constant,&lt;/li&gt;&#xA;&lt;li&gt;Iteration  for &lt;img src=&quot;https://i.stack.imgur.com/dU8lc.gif&quot; alt=&quot;enter image description here&quot;&gt; :&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/PYFke.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to obtain the returns based proxy for spot variances &lt;img src=&quot;https://i.stack.imgur.com/Rifs7.gif&quot; alt=&quot;enter image description here&quot;&gt;. Which yields an updating function that exclusively involves observation :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/gAnKR.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My program (r-code) is the following: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(fGarch)&#xA;&#xA;T=3000&#xA;    # For the example I simulate a GARCH&#xA;    #process parameters&#xA;    eta = 0.2 #eta = 0 is equivalent to Geometric Brownian Motion&#xA;    mu = 100 #the mean of the process&#xA;&#xA;    #GARCH volatility model&#xA;    specs = garchSpec(model = list(omega = 0.000001, alpha = 0.5, beta = 0.4)) &#xA;    sigma = garchSim(spec = specs, n = T)&#xA;&#xA;    P_0 = mu #starting price, known&#xA;    P = rep(P_0,T)&#xA;&#xA;    for(i in 2:T){&#xA;      P[i] = P[i-1] + eta * (mu - P[i-1]) + sigma[i] * P[i-1]&#xA;    }&#xA;&#xA;    # Set the parameters :&#xA;para&amp;lt;-c(0.1,0.2,0.3,0.4,0.5,0.7) # (beta_0,beta_1, beta_2, beta_3, r, gamma) &#xA;    # Iteration to obtain the volatility associate to the model :&#xA;&#xA;vol = c()&#xA;vol[1]=sd(P)&#xA;for (i in 2:length(P)){&#xA;      para_vol &amp;lt;- para[1:6]&#xA;      vol[i]=para_vol[1]+ (para_vol[2]*vol[i-1])+ (para_vol[3]/vol[i-1])*(P[i-1]-para_vol[5]-(para_vol[4]+para_vol[6])*vol[i-1])&#xA;      }&#xA;vol&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is an example where I simulate a GARCH (as data set), the I am trying to extract the volatility associate to the Heston-Nandi model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I known, I´m using a lot of bad things for r, but I could not figure out a better solution. So my question is it correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any correction and suggestion to improve this process! please feel free to share your extant code in R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Huge thanks!&lt;/p&gt;&#xA;" OwnerDisplayName="Laura Esly" LastActivityDate="2015-04-08T13:35:55.907" Title="Volatility updating rule using r" Tags="&lt;r&gt;&lt;time-series&gt;&lt;finance&gt;&lt;volatility&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16237" PostTypeId="1" CreationDate="2015-01-16T15:04:03.207" Score="1" ViewCount="1417" Body="&lt;p&gt;I am doing a thesis about firm survival in time of crisis (2008-2009) and I would like to know where can I find publicly available database about company bankruptcy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I have thousands of companies, it will be very crucial if the database is such that I can upload all of my indexes in one file rather than searching the companies one by one and writing down the bankruptcy date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!  &lt;/p&gt;&#xA;" OwnerUserId="15089" LastEditorUserId="7186" LastEditDate="2015-02-16T20:46:35.143" LastActivityDate="2015-05-17T21:53:28.463" Title="Where can I find US public company bankruptcy data" Tags="&lt;data&gt;&lt;historical-data&gt;&lt;database&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16238" PostTypeId="2" ParentId="16237" CreationDate="2015-01-16T15:13:56.803" Score="2" Body="&lt;p&gt;The Harvard Bankrupcy Data Project tries to do exactly that, they seem to have data for the specified time frame, but unfortunately I cannot vouch for its accuracy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://bdp.law.harvard.edu/filingsdb.cfm&quot; rel=&quot;nofollow&quot;&gt;http://bdp.law.harvard.edu/filingsdb.cfm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit: They don't seem to offer the full data any more, so that indeed won't work for you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could instead try this one, one of the sources for the Harvard data:&#xA;&lt;a href=&quot;http://lopucki.law.ucla.edu/sample_download.htm&quot; rel=&quot;nofollow&quot;&gt;http://lopucki.law.ucla.edu/sample_download.htm&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1976" LastEditorUserId="1976" LastEditDate="2015-01-17T17:44:33.977" LastActivityDate="2015-01-17T17:44:33.977" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16239" PostTypeId="1" CreationDate="2015-01-16T19:54:25.240" Score="-1" ViewCount="682" Body="&lt;p&gt;Good day&#xA;I would like to know how to download the intraday data regarding a particular stick exchange at one time, (I need to analyse all the equities listed on it) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second I need to verify that my understanding is correct regarding to what is displayed on the screening so (bear with me please)&lt;img src=&quot;https://i.stack.imgur.com/9Kn20.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1). the size 7838 *10,48k means that the we have 7838 shares available for bid and 10,48k are available for ask (the depth of that bid ask spread) right??&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks !!&lt;/p&gt;&#xA;" OwnerUserId="6195" LastActivityDate="2015-03-17T21:50:44.130" Title="How to download intraday data regarding a particular stock exchange from bloomberg at one time" Tags="&lt;bloomberg&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16240" PostTypeId="1" AcceptedAnswerId="16244" CreationDate="2015-01-16T20:04:35.823" Score="2" ViewCount="98" Body="&lt;p&gt;I am trying to find the geometric return for semi-annual log-returns in Excel. However, I do not know how to handle values less than -100%....&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Dates   RETURNS&#xA;6/29/00 17:00   -3.29%&#xA;12/28/00 16:00  26.05%&#xA;6/28/01 17:00   -13.26%&#xA;12/30/01 16:00  -3.42%&#xA;6/27/02 17:00   0.00%&#xA;12/30/02 16:00  -5.69%&#xA;6/29/03 17:00   5.75%&#xA;12/30/03 16:00  3.04%&#xA;6/29/04 17:00   -0.01%&#xA;12/30/04 16:00  -6.02%&#xA;6/29/05 17:00   -23.06%&#xA;12/29/05 16:00  -15.01%&#xA;6/29/06 17:00   9.18%&#xA;12/28/06 16:00  0.00%&#xA;6/28/07 17:00   0.44%&#xA;12/30/07 16:00  0.00%&#xA;6/29/08 17:00   11.34%&#xA;12/30/08 16:00  -2.21%&#xA;6/29/09 17:00   0.00%&#xA;12/30/09 16:00  0.00%&#xA;6/29/10 17:00   17.45%&#xA;12/30/10 16:00  -160.06%&#xA;6/29/11 17:00   0.90%&#xA;12/29/11 16:00  9.34%&#xA;6/28/12 17:00   6.74%&#xA;12/30/12 16:00  2.29%&#xA;6/27/13 17:00   6.05%&#xA;12/30/13 16:00  -2.50%&#xA;6/29/14 17:00   0.03%&#xA;12/8/14 16:00   1.05%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Assuming this code is pasted in Excel in &lt;code&gt;A1&lt;/code&gt;, then I calculate the Geometric Return in &lt;code&gt;B34&lt;/code&gt; by: &lt;code&gt;{=PRODUCT(1+B2:B31)^(1/COUNT(B2:B31))-1}&lt;/code&gt; &lt;/p&gt;&#xA;" OwnerUserId="11814" LastActivityDate="2015-01-17T07:45:27.980" Title="Geometric Returns values less than -100%" Tags="&lt;returns&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16242" PostTypeId="2" ParentId="16239" CreationDate="2015-01-16T20:21:47.540" Score="1" Body="&lt;p&gt;Hit the help key, bloomberg has a help service for subscribers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Someone will walk you through it free of additional charge (you (your firm) are paying for it in the monthly subscription fee).&lt;/p&gt;&#xA;" OwnerUserId="2154" LastActivityDate="2015-01-16T20:21:47.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16244" PostTypeId="2" ParentId="16240" CreationDate="2015-01-16T21:57:26.957" Score="5" Body="&lt;p&gt;You are calculating the geometric mean as if these are arithmetic returns. If you let &#xA;$$L_{t}\equiv \frac{P_{t}}{P_{t-1}}-1$$&#xA;and &#xA;$$C_{t}\equiv log(P_{t})-log(P_{t-1})$$&#xA;then &#xA;$$L_{t}=exp\left(C_{t}\right)-1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, to calculate the geometric return on log returns, you would recognize that $$\prod\left(1+L_{t}\right)=exp\left(\sum C_{t}\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The equivalent formula (correcting for the fact that you have semi-annual returns) for log returns would be&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;EXP(SUM(B2:B31))^(2/COUNT(B2:B31))-1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2379" LastEditorUserId="2379" LastEditDate="2015-01-17T07:45:27.980" LastActivityDate="2015-01-17T07:45:27.980" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16245" PostTypeId="2" ParentId="16221" CreationDate="2015-01-16T22:15:57.830" Score="-1" Body="&lt;p&gt;&lt;a href=&quot;http://www.algorithmicfinance.org/&quot; rel=&quot;nofollow&quot;&gt;http://www.algorithmicfinance.org/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's a free peer reviewed journal, depending on your definition of discovery you might find interesting tidbits there.&lt;/p&gt;&#xA;" OwnerUserId="2154" LastActivityDate="2015-01-16T22:15:57.830" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16249" PostTypeId="2" ParentId="16228" CreationDate="2015-01-17T14:37:23.190" Score="2" Body="&lt;p&gt;There are two things that might  be confusing you. The time step in Time dimensions and time steps along the forward  curve. The first  is given  a time t from today until a certain  day in the future, this dt usually  is the next reset  date.  The the other is tau representing  a tenor for the forward  curve maturing in tau days ahead. Dtau could vary depending  how did you build  your term-structure of interest rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding  the covariance hole, it's  a essential  feature of the model because  it's the drift  condition that makes the model arbitrage free . it's  not exclusively in swaption but a generic LIBOR  Market Model simulation.&lt;/p&gt;&#xA;" OwnerUserId="13398" LastActivityDate="2015-01-17T14:37:23.190" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16250" PostTypeId="1" CreationDate="2015-01-17T18:22:28.093" Score="2" ViewCount="2474" Body="&lt;p&gt;I am trying to solve a optimization portfolio in R in which I do the following constraints:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Set weight sum to within a boundary &lt;/li&gt;&#xA;&lt;li&gt;Set return to a certain value&lt;/li&gt;&#xA;&lt;li&gt;Set portfolio beta to 0&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The purpose is then to minimize risk subject to the constraints above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While I have no trouble in doing that my issue comes next. I want to make the weights such that the portfolio's total exposure to a factor is 0. Imagine asset a has a beta of 0.3, asset b has 0.7 and asset c -0.3. How can I set this constraint? My issue is that using quadprog I can only add an external parameter vector(mean returns in this case). Is there a way to go around this issue or am i seeing thing s the wrong way?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code I have so far is as follows :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;6 assets and six mean returns. Also, a 6*6 var-cov matrix. The upper weight bound is lev_ub and the lower bound is lev_lb. Returns_full is the vector with returns.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dvec = matrix(colMeans(returns_full),ncol = 1)&#xA;Dmat = cov(returns_full)&#xA;A.Constraint1 &amp;lt;- matrix(c(1,1,1,1,1,1), ncol=1)&#xA;A.Constraint2 = matrix(c(1,1,1,1,1,1), ncol=1)&#xA;Amat &amp;lt;- cbind(A.Equality1,A.Equality2, dvec)&#xA;bvec &amp;lt;- c(-lev_ub,lev_lb,target_return)&#xA;qp &amp;lt;- solve.QP(Dmat, dvec, Amat, bvec, meq=0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My issue comes now from the fact that assume I have another vector of length 6 with one beta for each asset. I want to make it such that the sum of the product of weights and betas is zero or,in other words, set the total portfolio beta to 0. How can I add this constraint ?&lt;/p&gt;&#xA;" OwnerUserId="8226" LastActivityDate="2018-07-21T21:31:10.793" Title="Portfolio Optimization - Zero beta portfolio" Tags="&lt;r&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;&lt;beta&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16251" PostTypeId="2" ParentId="16250" CreationDate="2015-01-17T20:28:25.737" Score="2" Body="&lt;p&gt;Use PortfolioAnalytics&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See my previous response here: &lt;a href=&quot;https://quant.stackexchange.com/a/16002/2154&quot;&gt;https://quant.stackexchange.com/a/16002/2154&lt;/a&gt; , you will find links to the documentation there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use the constraint function to add a factor exposure constraint of 0. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;use add.constraint(your_portfolio_name,type='factor_exposure',B = your_vector_of_betas,lower=0,upper=0)&lt;/p&gt;&#xA;" OwnerUserId="2154" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2015-01-17T20:28:25.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16252" PostTypeId="2" ParentId="16098" CreationDate="2015-01-17T23:00:29.603" Score="1" Body="&lt;p&gt;For any continuous distribution we can define &#xA;$$VaR_{\alpha}=-F^{-1}(1-\alpha)$$&#xA;where $F^{-1}$ is the inverse of the CDF. Now suppose that you have a distribution which comes from a location-scale family with location parameter $\mu$ and scale parameter $\sigma$ then&#xA;$$F^{-1}(1-\alpha)=\mu+\sigma \phi^{-1}(1-\alpha)$$&#xA;where $\phi^{-1}$ is the inverse CDF of the distribution with $\mu=0$ and $\sigma=1$. Thus we have&#xA;$$VaR_{\alpha}=-(\mu+\sigma \phi^{-1}(1-\alpha))$$&#xA;for any location-scale distribution. In particular for the student-t&#xA;$$VaR_{\alpha}=-(\mu+\sigma \;t_v^{-1}(1-\alpha))$$&#xA;where $t_v^{-1}$ is the inverse CDF of the standard student-t with $v$ degrees of freedom.&lt;/p&gt;&#xA;" OwnerUserId="13698" LastEditorUserId="2587" LastEditDate="2015-01-19T07:18:27.930" LastActivityDate="2015-01-19T07:18:27.930" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16253" PostTypeId="2" ParentId="16250" CreationDate="2015-01-17T23:13:16.010" Score="0" Body="&lt;p&gt;Say we have $n$ assets. Suppose that the covariance matrix is $\Sigma$. Now suppose that $x$ is the vector of weights of your assets, $\mu$ is the vector of mean returns on the assets, $\mathbb{1}$ is the vector of all ones, $B$ is the vector of betas on each asset, and $\tau$ your target return. You want to solve the following quadratic program&#xA;$$Min_x\;\; \frac{1}{2}x^T\Sigma x$$&#xA;Under the constraints&#xA;$$x^T \mathbb{1}=1$$&#xA;$$\mu^Tx \geq \tau$$&#xA;$$B^Tx=0$$&#xA;The constraint $B^Tx=0$ will ensure that the portfolios beta is zero. &lt;/p&gt;&#xA;" OwnerUserId="13698" LastActivityDate="2015-01-17T23:13:16.010" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16256" PostTypeId="1" AcceptedAnswerId="16265" CreationDate="2015-01-18T18:37:49.893" Score="3" ViewCount="110" Body="&lt;p&gt;What is Longevity risk, and how to model it under DC and DB pension plans?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;characters|characters|characters|characters|characters|&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2015-02-18T11:16:16.747" Title="Longevity risk modelling" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;risk-models&gt;&lt;insurance&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16257" PostTypeId="2" ParentId="16221" CreationDate="2015-01-18T20:02:51.437" Score="0" Body="&lt;p&gt;These years, The new frontier has been around &lt;strong&gt;optimal trading, market impact&lt;/strong&gt; and &lt;strong&gt;orderbook dynamics&lt;/strong&gt;. They are plenty of sources around, one of them being this bi-yearly conference. You have all the slides on the web site:&#xA;&lt;a href=&quot;http://market-microstructure.institutlouisbachelier.org&quot; rel=&quot;nofollow&quot;&gt;Market Microstructure: Confronting many Viewpoints&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The next challenge is to link previous quant and economic knowledge with micristructure.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2015-01-18T20:02:51.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16259" PostTypeId="2" ParentId="16250" CreationDate="2015-01-18T21:23:28.627" Score="0" Body="&lt;p&gt;You have the budget constaint on the sum of weights, the constraint that the portfolio return equal the target return, and the constraint on beta. With three equality constraints, you can set a row in Amat for each constraint, and then take the transpose to pass to solve.QP.  bvec is set to the right-hand side of the constraint equations and the parameter meq equals the number of equality constraints.  An example for you problem is shown below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;target_return &amp;lt;-  0.0002&#xA;num_assets &amp;lt;- 6&#xA;dvec &amp;lt;- rep(0,num_assets)                        #  dvec = 0 when minimizing only the variance&#xA;Dmat &amp;lt;- cov(return_full)&#xA;Amat &amp;lt;- matrix(rep(1, num_assets), ncol=num_assets)      #  budget constraint: sum of wts = 1&#xA;Amat &amp;lt;- rbind(Amat, c(.3, .7, -.3, 1, 1.1, 1.3) )        #  beta constraint: sum of wt*beta = 0&#xA;Amat &amp;lt;- rbind(Amat, colMeans(return_full) )              #  portfolio return = target_return&#xA;# Amat &amp;lt;- rbind(Amat, diag(1,nrow=num_assets, ncol=num_assets) )    #  would be used for long-only solutions: wts &amp;gt;= 0&#xA;Amat &amp;lt;- t(Amat)&#xA;bvec &amp;lt;- c(budget = 1, beta = 0, return = target_return )         # rhs of constraint eqns&#xA;# bvec &amp;lt;- c(bvec, rep(0,num_assets) )       # would be used with long-only constraint&#xA;qp &amp;lt;- solve.QP(Dmat, dvec, Amat, bvec, meq=3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11889" LastActivityDate="2015-01-18T21:23:28.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16260" PostTypeId="2" ParentId="3156" CreationDate="2015-01-19T00:16:32.247" Score="8" Body="&lt;p&gt;We've created a roundup of the top column-oriented database systems:&#xA;&lt;a href=&quot;http://www.timestored.com/time-series-data/column-oriented-databases&quot; rel=&quot;noreferrer&quot;&gt;http://www.timestored.com/time-series-data/column-oriented-databases&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This includes kdb+ and some open source alternatives. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Open: InfluxDB, Java Chronicles, OpenTSDB, KairosDB&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Closed: oneTick, McObject, Teradata Database, vectorwise, sybase, vertica&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have done some initial work at benchmarking common time-series queries and found open source monetDB to be particularly fast...we will hopefully be able to publish some of those results at a later date.&lt;/p&gt;&#xA;" OwnerUserId="15112" LastEditorUserId="15112" LastEditDate="2016-10-06T13:09:39.797" LastActivityDate="2016-10-06T13:09:39.797" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16261" PostTypeId="1" CreationDate="2015-01-19T00:24:39.393" Score="3" ViewCount="1435" Body="&lt;p&gt;I'm looking into this article about var swaps: &lt;a href=&quot;http://sbossu.com/docs/VarSwaps.pdf&quot; rel=&quot;nofollow&quot;&gt;http://sbossu.com/docs/VarSwaps.pdf&lt;/a&gt; and not sure how to correctly interpret Exhibit 2.1.1.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;In this example an option trader sold a 1-year call struck at 110% of&#xA;  the initial price on a notional of 10,000,000 for an implied&#xA;  volatility of 30%, and delta-heged his position daily. The realized&#xA;  volatility was 27.50%, yet his final trading P&amp;amp;L is down $150k.&#xA;  Furthermore, we can see (Figure a) .....&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Is the trading p&amp;amp;l meant to be the delta-hedging p&amp;amp;l? It looks like it, but&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;how come p&amp;amp;l is raising steadily even when stock price is rising? the trader should be losing money on the delta hedging because he is short gamma?&lt;/li&gt;&#xA;&lt;li&gt;why does it start from zero ? When trader has sold the option, he should have bought the stock and trading p&amp;amp;l at that point was negative?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="15111" LastEditorUserId="467" LastEditDate="2015-01-19T01:28:44.943" LastActivityDate="2015-08-24T22:37:57.393" Title="Why is this delta-hedging/P&amp;L example on a variance swap call correct?" Tags="&lt;options&gt;&lt;variance&gt;&lt;delta-hedging&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16262" PostTypeId="1" CreationDate="2015-01-19T06:54:27.077" Score="2" ViewCount="175" Body="&lt;p&gt;I'm looking to do a research paper on the impact of high frequency algo-trading on individual firms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to do that I need to be able to determine firms that have been high frequency traded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My plan is to find raw trade logs, and parse them looking for patterns which indicate that they are being algo-traded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have so far been unable to find these logs for any major US exchanges&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know where I can find these logs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;* Edit *&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will ultimately be doing an OLS regression to determine what affect being algo-traded had on these firms&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If anyone knows another way to determine if a security has been algo-traded that would also be greatly appreciated&lt;/p&gt;&#xA;" OwnerUserId="15108" LastEditorUserId="15108" LastEditDate="2015-01-20T10:12:09.120" LastActivityDate="2015-01-20T10:12:09.120" Title="How to obtain a log of all trades done on the Nasdaq or other major US exchange?" Tags="&lt;equities&gt;&lt;data&gt;&lt;algorithmic-trading&gt;&lt;exchange&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16263" PostTypeId="2" ParentId="16098" CreationDate="2015-01-19T08:07:16.620" Score="0" Body="&lt;p&gt;Let's start with one observation: Take a random variable of the form $X=\mu + \sigma Z$ for some  real $\mu$ and $\sigma&amp;gt;0$ then&#xA;$$&#xA;P[X \le x] = P[X-\mu \le x - \mu] = P[\frac{X-\mu}{\sigma} \le \frac{x-\mu}{\sigma}] = P[Z \le z],&#xA;$$&#xA;where $z = \frac{x-\mu}{\sigma}$.&#xA;In the case of location scale families the distribution of $Z$ is a special case of the distribution of $X$ and we can write quantiles as&#xA;$$&#xA;q^X_\alpha = \mu + \sigma q^Z_{\alpha}.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus the answer is: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Why should one use a biased VaR estimate? Or just a a wrong one? It is not biases it is just wrong to insert the quantile of the normal distribution. As you say you have to choose $\sigma$ right. if $\hat{\sigma}$ is the sd of your sample then due to the fact that the variance of a $t$ distribution is $\frac{n}{n-2}$ you set $\sigma := \hat{\sigma} \sqrt{\frac{n-2}{n}}$.&lt;/li&gt;&#xA;&lt;li&gt;Looking at &lt;a href=&quot;http://azzalini.stat.unipd.it/SN/Intro/intro.html&quot; rel=&quot;nofollow&quot;&gt;Azzalini's skew-t&lt;/a&gt; they define a distribution by &#xA;$$&#xA;Y = \xi + \omega X,&#xA;$$&#xA;then if you know the quantile of $X$ then you can calculate the quantile of $Y$ and it will be $\xi + \omega \sigma q^Z_{\alpha}$ for the reasons explained above. Everyhing else is biased or simply wrong.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-01-19T08:46:12.370" LastActivityDate="2015-01-19T08:46:12.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16265" PostTypeId="2" ParentId="16256" CreationDate="2015-01-19T11:09:22.840" Score="1" Body="&lt;p&gt;While it seems surprising how longevity can be a risk, it becomes obvious if you look at the financial implications. For an individual longevity risk is the chance of outliving your retirement savings. For pension plans or more generally any financial institution guaranteeing individuals lifelong income, it is the deviation, due to increased survival or decreased mortality, of initial projections of annuities from actual numbers. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a great variety of ways to model, measure and mitigate longevity risk. A good introduction is &quot;&lt;a href=&quot;http://sias.org.uk/resources/papers/?resource_id=356&amp;amp;type=papers&quot; rel=&quot;nofollow&quot;&gt;FINANCIAL ASPECTS OF LONGEVITY RISK&lt;/a&gt;&quot; published by the Staple Inn Actuarial Society.&lt;/p&gt;&#xA;" OwnerUserId="482" LastActivityDate="2015-01-19T11:09:22.840" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16266" PostTypeId="2" ParentId="15533" CreationDate="2015-01-19T18:26:14.500" Score="1" Body="&lt;p&gt;The yield curve gives you the tools to calculate everyhing that is derived from it.&#xA;Derivatives from the yield curve only are e.g. &#xA;- Fixed rate bonds&#xA;- Forward Rate agreements&#xA;- Floaters&#xA;- Swaps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All these are discounted cashflows or portfolios based on discounted cashflows and forward rates (which you can calculated from the yield curve).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you calculate options (swaptions, options on fixed-rate bonds) then you will need the volatiltiy from the market. You need additional data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is just as with a stock-index option. I need the stock price, risk-free rate, dividend-yield estimate and (!) the implied vol. Any other vol different than the implied vol with give me a different price (different than the traded market price).&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-01-19T18:26:14.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16267" PostTypeId="1" CreationDate="2015-01-19T21:51:20.933" Score="1" ViewCount="563" Body="&lt;p&gt;I am attempting to use the function &lt;code&gt;estim_nss&lt;/code&gt; from the &lt;code&gt;termstrc&lt;/code&gt; package in R. However, I am experiencing the following error:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Error in uniroot(pvcashflows, searchint, tol = tol, maxiter = 3000) : &#xA;  f() values at end points not of opposite sign&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I read the manual and I have checked that I have specified my data input correctly, I truely do not know what the problem is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The mannual says this error may arise due to wrongly specified start parameters or data issues, I have not specified any start parameters and i have checked my data a number of times, comparing it to the example, the format looks the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The line that i am runung is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ns_res &amp;lt;- estim_nss(mybonds, &quot;SA_GOV_BONDS1&quot;, method = &quot;ns&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can someone please shed some light on how I can solve this problem. &lt;/p&gt;&#xA;" OwnerUserId="15123" LastEditorUserId="-1" LastEditDate="2015-01-20T08:54:17.693" LastActivityDate="2016-04-12T15:21:40.663" Title="Using the R package &quot; termstrc &quot;" Tags="&lt;fixed-income&gt;&lt;r&gt;&lt;statistical-finance&gt;&lt;bond-yields&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16268" PostTypeId="1" CreationDate="2015-01-19T22:05:55.700" Score="2" ViewCount="49" Body="&lt;p&gt;Long case:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Assume I am Long 50 shares and there is a 2 for 3 reverse split.&lt;/li&gt;&#xA;&lt;li&gt;Let's denote the quantity of stock by x&lt;/li&gt;&#xA;&lt;li&gt;Prior to the split Portfolio is  $-cash_0$ $+50x$ &lt;/li&gt;&#xA;&lt;li&gt;I am then at $-cash_0 +33x +\frac{1}{3}x$  after the split&lt;/li&gt;&#xA;&lt;li&gt;The $\frac{1}{3}x$ is converted into cash with proceeds $P$ known as cash in lieu&lt;/li&gt;&#xA;&lt;li&gt;so $cash_1 = -cash_0 + P$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Now for the short case: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I sell 50 shares of x and receive proceeds $+cash_0$&lt;/li&gt;&#xA;&lt;li&gt;So my portfolio is $+cash_0$ $-50x$ &lt;/li&gt;&#xA;&lt;li&gt;Assume I am short 50 shares and there is a 2 for 3 reverse split, so I have my $+cash_0$, I Owe $-33x$ and the one third when I am long would have turned into cash in lieu&lt;/li&gt;&#xA;&lt;li&gt;My portfolio is $+cash_0 -33x -\frac{1}{3}x$ &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What is the treatment of the $-\frac{1}{3}x$ ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is $+cash_1 = cash_0-P$ ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When is it paid back? Is it treated similar to a dividend while short?&lt;/p&gt;&#xA;" OwnerUserId="2154" LastEditorUserId="2154" LastEditDate="2015-01-20T03:51:30.000" LastActivityDate="2015-01-20T03:51:30.000" Title="What is the the correct treatment while short for the cash in lieu of a reverse split?" Tags="&lt;corporate-actions&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16269" PostTypeId="2" ParentId="16262" CreationDate="2015-01-19T22:36:08.720" Score="0" Body="&lt;p&gt;I dont think any of the algo traders publish their logs, you should contact an algo trading company and inform them that you would like to write a paper and ask them if they can provide you some anonymized data.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="467" LastEditDate="2015-01-20T01:14:32.770" LastActivityDate="2015-01-20T01:14:32.770" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16270" PostTypeId="1" CreationDate="2015-01-20T00:41:45.630" Score="1" ViewCount="8553" Body="&lt;p&gt;This is actually an exercise from a course. But I don't completely understand the wording of the question.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;A stock is now trading at 100 dollars.&lt;/li&gt;&#xA;&lt;li&gt;Its price over the next 6 months evolves as a &lt;strong&gt;two step binomial process&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Over each 3 month period, the price can go up by a factor $u$, or down $d=\frac{1}{u}$. &lt;/li&gt;&#xA;&lt;li&gt;The annual risk free rate is 5% (cont.).&lt;/li&gt;&#xA;&lt;li&gt;We consider an European put with strike price $K=93$ dollars and expiring in 6 months.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Part a) and b) are about pricing the put using risk-neutral pricing approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But part c) states:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Now suppose that in 3 months, the stock pays a dividend of 10 dollars.&#xA;  On the payment date, the stock price immediately adjusts to its&#xA;  ex-dividend level and then either goes up by a factor $u=1.1$ or down&#xA;  $d=1/u$ over the subsequent 3 months. Construct a dynamic self-financing&#xA;  strategy that replicates the payoff of the put.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Alright, so my question is. I don't know what happens when people know the stock is going to pay out 10 dollars of dividend in 3 months.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it during the next period, there are 2 states:(100*1.1-10=100, 100/1.1-10=80.90)????&lt;/p&gt;&#xA;" OwnerUserId="15125" LastEditorUserId="2587" LastEditDate="2015-01-20T07:42:47.603" LastActivityDate="2015-04-21T19:50:59.743" Title="How to price an option on a dividend-paying stock using the binomial model?" Tags="&lt;binomial-tree&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16271" PostTypeId="2" ParentId="14907" CreationDate="2015-01-20T00:48:15.510" Score="5" Body="&lt;p&gt;you don't need $ud=1.$ In fact, there are now about 30 binomial trees which converge to Black--Scholes in the large step limit. Most of them do not have $ud=1.$ All you need is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;d &amp;lt; e^{r \Delta t} &amp;lt; u&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The tree recombines provided $u$ and $d$ don't change from step to step. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See my book More Mathematical Finance for a comprehensive review and classification of binomial trees.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-01-20T00:48:15.510" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16272" PostTypeId="2" ParentId="16262" CreationDate="2015-01-20T01:50:06.877" Score="3" Body="&lt;p&gt;If you're looking for all transactions against any or a given set of securities on whatever exchange, you can get that from a data provider like IQFeed or eSignal. Most of them will have tick level data going back for at least several weeks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some people have been collecting tick and market data for quite sometime against a variety of securities, and as such have pretty vast databases that are used for data mining, analytics, and the testing of new strategies.  Some of these databases go back several years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Those data sets are quite large, computationally intensive, and a big part of the profitability for that organization. I really can't imagine anyone parting with them, and we're talking about ~10GB a day depending on how much data you want (market depth, which exchanges, which securities, etc). So easily into the multiple TB of data range.&lt;/p&gt;&#xA;" OwnerUserId="13830" LastActivityDate="2015-01-20T01:50:06.877" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16273" PostTypeId="1" AcceptedAnswerId="16283" CreationDate="2015-01-20T09:26:44.350" Score="0" ViewCount="441" Body="&lt;p&gt;According to the &lt;a href=&quot;http://nl.mathworks.com/help/finance/portvar.html&quot; rel=&quot;nofollow&quot;&gt;Matlab help&lt;/a&gt;, Portvar will give the &quot;Variance for portfolio of assets&quot; by entering the returns of the Assets and the corresponding weight. However, it does not explain the &lt;strong&gt;parameters behind this formula&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, on which correlation matrix is &lt;code&gt;Portvar&lt;/code&gt; based? What are the hidden &quot;hypothesis&quot; made by the function?&lt;/p&gt;&#xA;" OwnerUserId="9481" LastEditorUserId="467" LastEditDate="2015-01-21T02:49:46.010" LastActivityDate="2015-01-21T02:49:46.010" Title="What are the parameters of the function PORTVAR in Matlab?" Tags="&lt;volatility&gt;&lt;matlab&gt;&lt;variance&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16274" PostTypeId="2" ParentId="16270" CreationDate="2015-01-20T09:52:35.790" Score="1" Body="&lt;p&gt;You could solve this by constructing a binomial tree with the stock price ex-dividend. Also keep in mind that you have to adjust your volatility by muliplying with S/(S-PV(D)).&lt;/p&gt;&#xA;" OwnerUserId="13950" LastActivityDate="2015-01-20T09:52:35.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16275" PostTypeId="1" CreationDate="2015-01-20T09:56:41.330" Score="2" ViewCount="555" Body="&lt;p&gt;I am trying to build Japanese Yen interest rate curves. When defining the curve instruments for the 'OIS' (discount) curve (aka TONAR), I am uncertain as to which rate to use for the overnight deposit at the short end. Should I be using the offshore jpy depo rate or the onshore BoJ depo rate; and why?&lt;/p&gt;&#xA;" OwnerUserId="6782" LastActivityDate="2015-05-24T04:05:58.347" Title="Building curves using onshore or offshore JPY overnight rates?" Tags="&lt;fixed-income&gt;&lt;yield-curve&gt;&lt;swaps&gt;&lt;multicurve&gt;&lt;ois-discounting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16276" PostTypeId="1" AcceptedAnswerId="16282" CreationDate="2015-01-20T10:19:03.407" Score="1" ViewCount="395" Body="&lt;p&gt;We receive daily end-of-day data from a data vendor (i.e. not direct from an exchange) and are comfortable with this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We are now wanting to receive live data, and after a few enquiries we are feeling tempted to go direct to the exchanges rather than to a vendor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously we expect the work of dealing with live feeds to be different from dealing with CSV files (which is typically what you do for end-of-day data), and we are carrying out our due diligence to see what is involved in receiving/parsing/storing real-time data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Questions&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Do you have any suggestions or know of any guides, tutorials, or advice pages on what is involved if you want to receive real-time data feeds? &lt;br&gt;For example, the CME Group pages (&lt;a href=&quot;http://www.cmegroup.com/confluence/display/EPICSANDBOX/CME+Market+Data&quot; rel=&quot;nofollow&quot;&gt;link&lt;/a&gt;) seem very thorough, but I am hoping to find something like a &lt;strong&gt;'Real Time Data Feeds for Dummies'&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Are there any significant reasons why you would recommend getting live data from a vendor rather than direct from the exchanges?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;FYI:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;we are focussed on fixed-income products futures &amp;amp; options, and need data from only 2 exchanges (CME Group and ICE),&lt;/li&gt;&#xA;&lt;li&gt;we work mostly with Python and R, and have experienced C/C++/C# coders in the team,&lt;/li&gt;&#xA;&lt;li&gt;we do not need any GUI front-end applications for browsing the data or for doing analysis, we just want to get the data into our database so that our in-house applications can use it.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&#xA;The reply from @chollida raises an important point about the connectivity: wherever you get your real-time streaming data from you are going to have to demonstrate, to some degree, that you have a properly secure connection and that you have a proper audit on the way you use that data. So let me add &lt;strong&gt;another couple of questions&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;For real-time data are the network security/connectivity and data-usage compliance/audit obligations something that we should worry about to the point that we should consider bringing a network expert into the team? &lt;/li&gt;&#xA;&lt;li&gt;Are the network security/connectivity and data-usage compliance/audit obligations easier to satisfy if you take your data from a vendor or from the exchange?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1920" LastEditorUserId="1920" LastEditDate="2015-01-21T13:08:43.953" LastActivityDate="2015-03-06T16:26:31.060" Title="Real-time market data from the exchanges: what should we be aware of?" Tags="&lt;fixed-income&gt;&lt;market-data&gt;&lt;cme&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16277" PostTypeId="1" AcceptedAnswerId="16286" CreationDate="2015-01-20T10:40:34.983" Score="0" ViewCount="311" Body="&lt;p&gt;I am doing a research paper on the effect of algo-trading on capital markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to do this, I plan to do an OLS comparison of Countries and Exchanges who ban algo-trading platforms and those who allow it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After some googling I have been unable to find such a list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefor, my question is this: What countries and/or exchanges have banned algo-trading platforms?&lt;/p&gt;&#xA;" OwnerUserId="15108" LastActivityDate="2015-01-20T18:19:20.200" Title="Countries and/or exchanges which don't allow algo-trading" Tags="&lt;equities&gt;&lt;algorithmic-trading&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16280" PostTypeId="1" AcceptedAnswerId="16281" CreationDate="2015-01-20T14:24:17.680" Score="5" ViewCount="2134" Body="&lt;p&gt;In Black-Litterman we get a new vector of expected returns of the form:&#xA;\begin{align}&#xA;\Pi_{BL} = \Pi + \underbrace{\tau \Sigma P^T[P\tau\Sigma P^T+\Omega]^{-1}}_{\text{correction}}[Q-P\Pi]&#xA;\end{align}&#xA;where $P$ is the pick matrix and we mix the prior $\Pi$ with the expected value of the views $Q$. $\Sigma$ is the historical covariance matrix and $\Omega$ is the covariance matrix of the views.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us assume that $P$ is just the identity matrix and look at the choice &#xA;$\Omega = \tau\Sigma$,&#xA;then we see that&#xA;$$&#xA;\Pi_{BL} = \frac12 \Pi + \frac12 Q,&#xA;$$&#xA;thus we have a 50:50 mix and the covariance of the matrix does not affect the posterior at all - it is just a trivial mixture. This is against my intuition. Furthermore optimal weights using this $\Pi_{BL}$ will differ relatively much from optimal weights of the prior (of course depending on $Q$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we assume $\Omega = \text{diag}(\tau \Sigma)$ then I can not find a closed form for $\Pi_{BL}$ but appearantly the posterior is more compatible with the prior and the optimal weights are more similar than in the other setting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question: how can I choose $\Omega$ best in order to get results that do not deviate too much from my prior? I know that in the literature there are theories (e.g. here &lt;a href=&quot;http://www.blacklitterman.org/Black-Litterman.pdf&quot; rel=&quot;noreferrer&quot;&gt;The Black-Litterman Model In Detail&lt;/a&gt;)&#xA;but I can't see through. What is used in practice? &lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2019-09-24T06:29:21.443" LastActivityDate="2019-09-24T06:29:21.443" Title="Black-Litterman, how to choose the uncertainty in the views $\Omega$ for smooth transitions from prior to posterior" Tags="&lt;modeling&gt;&lt;modern-portfolio-theory&gt;&lt;black-litterman&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="16281" PostTypeId="2" ParentId="16280" CreationDate="2015-01-20T15:46:53.297" Score="3" Body="&lt;p&gt;In practice, $\Omega$ (the covariance of the investor views) often 'inherits' the market covariance $\Sigma$. A convenient choice is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \Omega = \left( 1/c -1 \right) P \Sigma P^T$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $c$ is a confidence parameter: the case $c \rightarrow 1$ corresponds to a strongly peaked distribution of views (the investor views dominate the market), while $c \rightarrow 0$ gives an infinitely disperse distribution where investor views have no influence. Tuning $c$ allows you to deviate smoothly from the prior $\Pi$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This choice for $\Omega$ is proposed in Attilio Meucci's &lt;em&gt;Risk and Asset Allocation&lt;/em&gt;, chapter 9.2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&#xA;In the example you give ($P$ is the identity matrix and $\Omega = \tau \Sigma$), the investor provides views on each asset with the same uncertainty as the market. In that case, the posterior return $\Pi_{BL}$ is just the average of market prior $\Pi$ and investor expectation $Q$. This seems plausible by symmetry: if you switch market and investor, $\Pi_{BL}$ stays the same.&lt;/p&gt;&#xA;" OwnerUserId="6721" LastEditorUserId="6721" LastEditDate="2015-01-22T12:56:31.500" LastActivityDate="2015-01-22T12:56:31.500" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="16282" PostTypeId="2" ParentId="16276" CreationDate="2015-01-20T17:09:43.003" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Do you have any suggestions or know of any guides, tutorials, or advice pages on what is involved if you want to receive real-time data feeds? &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You won't find a how to for consuming data feeds direct from the exchanges for several reasons&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Each exchange is different, from format to api&lt;/li&gt;&#xA;&lt;li&gt;Its hard to write a tutorial as the data is owned by the exchanges and typically can't leave your firm, as spelled out in your market data agreement.&lt;/li&gt;&#xA;&lt;li&gt;Each fund typically writes their own code to parse the data feeds and like most funds keep it proprietary, so there isn't one unified library that you can use.&lt;/li&gt;&#xA;&lt;li&gt;One big issue is how you are going to  receive the data.  Typically you'd be collocated with each exchange you want data from.  &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;How are you planning on connecting to the exchange? colocate at each exchange?  software vpn to each exchange?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other big issue is that typically the exchanges want a guarantee that the data is only used for hte purpose you say it is.  What software are you using for tracking hte data and limiting it to only qualified computers or individuals?  The exchanges will want to know.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Are there any significant reasons why you would recommend getting live data from a vendor rather than direct from the exchanges?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes, the big one is that you can get dat from multiple exchanges this way, ie you want NYSE, NASDAQ and CBOE, a vendor can get data and merge them all together for you.  They also do the compliance for you,  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't need the fastest possible quotes then a vendor makes things 100 times easier on you.&lt;/p&gt;&#xA;" OwnerUserId="743" LastEditorUserId="743" LastEditDate="2015-01-20T17:16:26.660" LastActivityDate="2015-01-20T17:16:26.660" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16283" PostTypeId="2" ParentId="16273" CreationDate="2015-01-20T17:13:49.413" Score="2" Body="&lt;p&gt;The code is &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function v = portvar(asset,ws) &#xA;%PORTVAR Portfolio variance. &#xA;%   V = PORTVAR(ASSET,WS) returns the variance for a portfolio of assets&#xA;%   where ASSET is a matrix of asset data and WS are the corresponding&#xA;%   weights of each asset.  ASSET is an MxN matrix of N securities and  &#xA;%   WS is a 1xN vector where each column of ASSET is a time series of &#xA;%   historical data for a single security and each column of WS is a &#xA;%   corresponding weight for each security in ASSET.   If WS is a matrix  &#xA;%   of size RxN, the portfolio variance, V, is returned as an Rx1 vector &#xA;%   with each row representing a variance calculation for each row of WS.  &#xA;% &#xA;%   V = PORTVAR(ASSET) assigns each security an equal weight when &#xA;%   calculating the portfolio variance. &#xA;% &#xA;%   See also FRONTCON, PORTROR, PORTRAND. &#xA;% &#xA;%   Reference: Bodie, Kane, and Marcus, Investments, Chapter 7. &#xA;&#xA;%       Copyright 1995-2006 The MathWorks, Inc.&#xA;&#xA;[m,n] = size(asset); &#xA;if nargin &amp;lt; 2 &#xA;  ws = ones(1,n)/n; &#xA;end &#xA;if nargin &amp;lt; 1 &#xA;  error(message('finance:portvar:missingInputs')) &#xA;end &#xA;&#xA;[r,c] = size(ws); &#xA;if n ~= c &#xA;  error(message('finance:portvar:mismatchAssetsWeights')) &#xA;end &#xA;&#xA;covmat = cov(asset);    % Calculate covariance of assets &#xA;va = diag(covmat)';     % Get variance for each column  &#xA;ca = tril(covmat,-1);   % Get covariance values of columns &#xA;&#xA;v = zeros(r,1);         % Preallocate matrices &#xA;for n = 1:r             % Weights are not always square matrix, using for loop &#xA;  x = ws(n,:)'*ws(n,:);  &#xA;  v(n) = sum(ws(n,:).^2.*va)+2*sum(sum(x.*ca)); % Equation 7.11, pg. 217 &#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hope that answers your covariance question . &lt;/p&gt;&#xA;" OwnerUserId="1386" LastActivityDate="2015-01-20T17:13:49.413" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16284" PostTypeId="2" ParentId="16277" CreationDate="2015-01-20T17:23:19.980" Score="1" Body="&lt;p&gt;I am not aware of any which have, but even given that a country had banned algo-trading, if the exchanges in that country still offered electronic execution (which is pretty much essential in this day and age), then market participants can build their own software to make their trades, they just might have to alter their strategy in such a way that it is not obvious that the trades are being executed automatically. &lt;/p&gt;&#xA;" OwnerUserId="15044" LastActivityDate="2015-01-20T17:23:19.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16286" PostTypeId="2" ParentId="16277" CreationDate="2015-01-20T18:13:13.647" Score="3" Body="&lt;p&gt;The easy answer would be to look for exchanges that only have pit trading, ie people in a room that match up buyers and sellers.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I know no such exchange exists any more.  In my opinion the best you are going to be able to do is to compare the NYSE now with the NYSE in 1998, which is to say you wont be able to do much of a comparison at all as the NYSE, or NASDAQ of 20 years ago has very little in common with the exchanges of today.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know what an &quot;OLS comparison&quot; is but a shot in the dark.  Scott Patterson wrote a great book called &lt;a href=&quot;http://www.scottpattersonreports.com/&quot; rel=&quot;nofollow&quot;&gt;DarkPools&lt;/a&gt; that illustrates how the markets changed from pit trading driven to computer driven.  That might help you out.&lt;/p&gt;&#xA;" OwnerUserId="743" LastEditorUserId="743" LastEditDate="2015-01-20T18:19:20.200" LastActivityDate="2015-01-20T18:19:20.200" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16287" PostTypeId="1" CreationDate="2015-01-20T18:37:57.897" Score="1" ViewCount="356" Body="&lt;p&gt;The implementation of &lt;a href=&quot;http://www.inside-r.org/packages/cran/TTR/docs/RSI&quot; rel=&quot;nofollow&quot;&gt;TTR:RSI&lt;/a&gt; differs slightly from the RSI calculated in Bloomberg, see &lt;a href=&quot;http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:relative_strength_index_rsi&quot; rel=&quot;nofollow&quot;&gt;more details here&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use in TTR the SMA, which simply calculates the mean, that is a walking window of:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Sum of gains and losses over the 14 days (assuming it's the 14 days period)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In Bloomberg this is done only for first 14 days, subsequent days are calculated as:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;[(previous average gain) x 13 + last gain] / 14&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I suspect it should be enough to swap SMA with a custom moving average function. Was just wondering if such a function is already a part of TTR or is easy to implement?&lt;/p&gt;&#xA;" OwnerUserId="3308" LastEditorUserId="3308" LastEditDate="2015-01-21T16:49:55.663" LastActivityDate="2015-01-21T16:49:55.663" Title="R TTR/RSI does not behave like a Bloomberg RSI" Tags="&lt;r&gt;" AnswerCount="0" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="16288" PostTypeId="2" ParentId="15122" CreationDate="2015-01-20T21:09:00.523" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;How to solve this, you can generate random portfolios based on constraints see method=&quot;random&quot; in optimize.portfolio in  PortfolioAnalytics in R&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;See (1) as those would solve the above, however you do not have an objective function so ANY solution that meets your constraints would be accepted, see below for examples of objective functions as they would give you ordered preferences of each candidate portfolio that meets your constraints.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You have no objective function, some suggestions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Minimum Variance&lt;/li&gt;&#xA;&lt;li&gt;Minimum tracking error (as John also said)&lt;/li&gt;&#xA;&lt;li&gt;Maximum Sharpe ratio&lt;/li&gt;&#xA;&lt;li&gt;Minimum expected shortfall (tail risk)&lt;/li&gt;&#xA;&lt;li&gt;Maximum Diversification (you can pick a diversification measure e.g. HHI)&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2154" LastEditorUserId="2154" LastEditDate="2015-01-20T21:43:05.893" LastActivityDate="2015-01-20T21:43:05.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16289" PostTypeId="1" CreationDate="2015-01-21T06:29:58.973" Score="2" ViewCount="472" Body="&lt;p&gt;I am trying to make a Limit Order book from an ITCH file using r. what is the basic difference between orderbook and limit orderbook? R has a package for orderbook I think&lt;/p&gt;&#xA;" OwnerUserId="15139" LastActivityDate="2015-03-02T14:05:43.140" Title="Order book Limit Order book" Tags="&lt;limit-order-book&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16292" PostTypeId="1" CreationDate="2015-01-21T09:56:41.050" Score="3" ViewCount="91" Body="&lt;p&gt;Suppose I have a general SDE&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dx_{t} = \mu dt + \sigma dz_{t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I can put $E[]$ on both sides to get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E[dx_{t}] = E[\mu dt] + E[\sigma dz_{t}]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now comes the question: I've seen some formulas where &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E[dx_{t}]$ becomes $dE[x_{t}]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it ok to swap $E[.]$ with $d[.]$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="15142" LastActivityDate="2015-01-21T12:28:50.967" Title="Swapping expectation operator with differential operator" Tags="&lt;sde&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16293" PostTypeId="2" ParentId="16292" CreationDate="2015-01-21T12:28:50.967" Score="1" Body="&lt;p&gt;Remember that $dx_t = \mu_t dt + \sigma_t dz_t$ is just a shorter notation for&#xA;$$&#xA;  x_t = x_0 + \int_0^t \mu_s ds + \int_0^t \sigma_s dz_s&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, under mild hyopthesis on $\sigma$ the stochastic integral is a martingale so $E[\int_0^t \sigma_s dz_s] = E[\int_0^0 \sigma_s dz_s] = 0$. We are left with &#xA;$$&#xA;  E[x_t] = x_0 + E[\int_0^t \mu_s ds] = x_0 + \int_0^t E[\mu_s] ds&#xA;$$&#xA;by Fubini's theorem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So $dE[x_t] = E[\mu_t] dt$. This justifies writing $dE[x_t] = E[dx_t]$.&lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2015-01-21T12:28:50.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16294" PostTypeId="1" AcceptedAnswerId="16302" CreationDate="2015-01-21T15:19:15.987" Score="1" ViewCount="1401" Body="&lt;p&gt;I have two implementations for finding the implied volatility under Black-Scholes formula. One is bisection and the other is brent's method. (I know Newton-Raphson is popular due to speed and will support this as well later...).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question seems to be related to this question: &lt;a href=&quot;https://quant.stackexchange.com/questions/10210/lower-bound-of-itm-calls-when-computing-implied-volatility&quot;&gt;Lower bound of ITM Calls when computing Implied Volatility&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, I notice that the implied volatility calculation breaks down for deep in the money call options and probably deep in the money put options (same for deep out of the money options of both types?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example arguments:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;double r = 0.05;&#xA;double T = 0.00274;    &#xA;double S = 50.0;    &#xA;double K = 1.0;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For these arguments, it seems any volatility value will do as the option premium from BS is always ~49.00015... and so a unique implied volatility cannot be found?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to provide some method that can provide a fast check on the input that would ideally check analytical bounds for when bisection/brent will give back sound answers and when the input arguments belong to a &quot;degenerate&quot; case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are such bounds well-known? Any link to an article available would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="5888" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2015-01-22T09:36:23.673" Title="Implied Volatility Calculation for Deep In The Money Calls, Numerical Issues" Tags="&lt;black-scholes&gt;&lt;implied-volatility&gt;&lt;numerical-methods&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16296" PostTypeId="1" CreationDate="2015-01-21T17:10:50.877" Score="9" ViewCount="18408" Body="&lt;p&gt;I've heard a question regarding pricing of european calls. The question is: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Is the call long or short in volatility when it is (deep) OTM? What is&#xA;  the profile of the implied volatility?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I know that in that case the answer is &quot;long&quot;. Conversely the call would be short in vol if it was ITM. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see a relation between long and the wish that volatility is high in order to go ITM if you hold the call. Also if you are ITM, I can see that your interest is to continue ATM. Therefore you want the volatility to be low.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't understand what exactly this term means neither where it comes from. I guess it is related to volatility trading/arbitrage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could someone please help me out and give me a precise definition for the term &quot;long/short in volatility&quot;?&lt;/p&gt;&#xA;" OwnerUserId="15146" LastEditorUserId="467" LastEditDate="2015-01-22T01:26:51.200" LastActivityDate="2021-05-28T12:11:45.647" Title="What does it mean to be &quot;long or short in volatility&quot;?" Tags="&lt;volatility&gt;&lt;european&gt;&lt;call&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16297" PostTypeId="2" ParentId="16296" CreationDate="2015-01-21T23:08:16.873" Score="7" Body="&lt;p&gt;the vega of a call is always positive. The holder of a call option is therefore long volatility whatever the spot price.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-01-21T23:08:16.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16298" PostTypeId="2" ParentId="16296" CreationDate="2015-01-22T01:36:50.153" Score="4" Body="&lt;p&gt;Mark Joshi's answer is absolutely right, but just to elaborate a bit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;strong&gt;Vega&lt;/strong&gt; of an option is the sensitivity of its value with respect to volatility $\nu = \frac{\partial V}{\partial \sigma}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For calls, it makes sense that the &lt;strong&gt;Vega&lt;/strong&gt; is always positive, not matter the level of the underlying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you take the Black-Sholes model, you can find the theoretical value of &lt;strong&gt;Vega&lt;/strong&gt; &lt;a href=&quot;http://en.wikipedia.org/wiki/Greeks_%28finance%29&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="9336" LastEditDate="2015-01-26T20:58:34.773" LastActivityDate="2015-01-26T20:58:34.773" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16300" PostTypeId="1" AcceptedAnswerId="33620" CreationDate="2015-01-22T06:14:53.410" Score="9" ViewCount="548" Body="&lt;p&gt;Least Median Squares is often argued to give more stable results than does OLS.  Whereas in OLS one minimises the mean of squared residuals, in LMS, one instead minimises the median of squared residuals.  Intuitively, should give estimators that are largely (completely?) invariant to outliers.  As such, i would have thought this approach would find a natural home in finance applications, however, I haven't come across it being used (a search on this site, for example gives zero citations).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does any one recommend or discourage a LMS approach - say, for a simple case of estimating a beta coefficient between two securities?&lt;/p&gt;&#xA;" OwnerUserId="3297" LastEditorUserId="467" LastEditDate="2015-01-23T09:47:57.943" LastActivityDate="2017-04-11T13:07:16.647" Title="Is Least Median Squares (LMS) regression commonly used in Finance?" Tags="&lt;regression&gt;&lt;beta&gt;&lt;nonlinear&gt;&lt;outliers&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16302" PostTypeId="2" ParentId="16294" CreationDate="2015-01-22T09:36:23.673" Score="2" Body="&lt;p&gt;As pointed out in the comment, the answer here: &lt;a href=&quot;https://quant.stackexchange.com/questions/15198/what-is-an-efficient-method-to-find-implied-volatility&quot;&gt;What is an efficient method to find implied volatility?&lt;/a&gt; provides:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Link to &lt;a href=&quot;http://www.jaeckel.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.jaeckel.org/&lt;/a&gt; and in particular the &quot;By Implication&quot; paper: &lt;a href=&quot;http://www.pjaeckel.webspace.virginmedia.com/ByImplication.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.pjaeckel.webspace.virginmedia.com/ByImplication.pdf&lt;/a&gt; .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An explanation of the problem with in-the-money options and implied volatility is provided in that paper.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Working with out-of-the-money options seems to be the easiest, most reasonable approach and will work for my purposes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course if anyone has additional insights, please share them.&lt;/p&gt;&#xA;" OwnerUserId="5888" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-01-22T09:36:23.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16303" PostTypeId="1" CreationDate="2015-01-22T09:40:21.837" Score="2" ViewCount="38" Body="&lt;p&gt;In the artcicle &lt;a href=&quot;http://link.springer.com/chapter/10.1007%2F978-3-642-32909-8_43&quot; rel=&quot;nofollow&quot;&gt;Forecasting and Trading the High-Low Range of Stocks and ETFs with Neural Networks&lt;/a&gt; HCNN is used for forecasting of nine time-series, namely:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;returns of the lows&lt;/li&gt;&#xA;&lt;li&gt;returns of the highs&lt;/li&gt;&#xA;&lt;li&gt;five-period exponential moving average of the lows &lt;/li&gt;&#xA;&lt;li&gt;five-period exponential moving average of the highs &lt;/li&gt;&#xA;&lt;li&gt;five-period lower bollinger band of the closes &lt;/li&gt;&#xA;&lt;li&gt;five-period upper bollinger band of the closes &lt;/li&gt;&#xA;&lt;li&gt;returns of the open &lt;/li&gt;&#xA;&lt;li&gt;same-day return open to low&lt;/li&gt;&#xA;&lt;li&gt;same-day return open to high&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The proposed state transition function is: $$ s_{t+1}=\tanh(W \cdot s_t) $$ The outputs (predictions) of HCNN are the first nine elements of state vector $s_{t+1}$ so the outputs are within the range $[-1,1]$.  The questions are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Would it be correct to assume that &quot;returns on ...&quot; are represented as negative and positive deltas, i.e. 10% increase in price is 0.1 while 5% loss is -0.05?&lt;/li&gt;&#xA;&lt;li&gt;Five-period exponential moving average of lows will be in general well beyound $[-1,1]$ range of $\tanh$. Shouldn't these values be scaled into the $[-1,1]$  range? How?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="15154" LastActivityDate="2015-01-22T09:40:21.837" Title="Non-overlapping ranges of HCNN' observables and of state transition function" Tags="&lt;equities&gt;&lt;forecasting&gt;&lt;neural-networks&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16305" PostTypeId="2" ParentId="16119" CreationDate="2015-01-22T13:16:36.190" Score="1" Body="&lt;p&gt;50 elements input vector is actually a small one. For example, in &lt;a href=&quot;http://nbviewer.ipython.org/github/lisa-lab/pylearn2/blob/master/pylearn2/scripts/tutorials/multilayer_perceptron/multilayer_perceptron.ipynb&quot; rel=&quot;nofollow&quot;&gt;this tutorial&lt;/a&gt; the size of the input vector is 784 (parameter 'nvis'). So your problem lies somewhere else. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would recommend to start from taking these two courses on &lt;a href=&quot;https://www.coursera.org/&quot; rel=&quot;nofollow&quot;&gt;Coursera&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Neural Networks for Machine Learning&lt;/li&gt;&#xA;&lt;li&gt;Machine Learning&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;They will provide you with some practical guidance regarding how to deal with your issue.&lt;/p&gt;&#xA;" OwnerUserId="15154" LastActivityDate="2015-01-22T13:16:36.190" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16306" PostTypeId="1" CreationDate="2015-01-22T14:57:57.213" Score="3" ViewCount="101" Body="&lt;p&gt;I would like to understand better the $n^{th}$ to default pair spreads   of a basket default swap containing $m&amp;gt;n$ entities. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, consider 2 single name CDS's with same spread and same tenor (let's say 2 years). What can we say about the first-to-defalt and the second to default pair spreads ?&lt;/p&gt;&#xA;" OwnerUserId="3534" LastActivityDate="2016-01-24T14:23:38.357" Title="Basket Default Swap (BDS)" Tags="&lt;credit&gt;&lt;cds&gt;&lt;basket&gt;&lt;multivariate&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16307" PostTypeId="2" ParentId="16296" CreationDate="2015-01-22T20:05:43.257" Score="10" Body="&lt;p&gt;I'll expand on Mark's and SRKX's answers which are both correct but brief.  To be clear the words long and short have been generalized in finance.  They used to mean that you owned a stock or had sold a stock short.  Now they are often used to say you make money when a value goes up (long) or make money when some value goes down (short).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case whenever you own a call or a put you are &quot;long&quot; volatility.  Meaning that as volatility increases the value of your position increases (holding everything else the same). How much added value that you get for a certain increase in volatility (called vega) &lt;a href=&quot;http://totaloptions.com.au/818/introduction-to-options-trading-option-vega/&quot; rel=&quot;noreferrer&quot;&gt;depends on how in/out of the money the option is at currently&lt;/a&gt; among other things, but if you own the call/put it is always positive as more volatility means more possible upside.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you sell calls or puts, then volatility decreases are good for your position so you are called &quot;short&quot; vol.&lt;/p&gt;&#xA;" OwnerUserId="5689" LastEditorUserId="9336" LastEditDate="2015-01-26T20:57:27.703" LastActivityDate="2015-01-26T20:57:27.703" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="16309" PostTypeId="1" CreationDate="2015-01-23T09:29:11.807" Score="1" ViewCount="101" Body="&lt;p&gt;I have a question that seems basic but has given me fits. If I have the following known variables, how do I solve for the growth rate?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Known variables:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;initial payment&lt;/li&gt;&#xA;&lt;li&gt;outstanding balance&lt;/li&gt;&#xA;&lt;li&gt;number of periods&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I need to solve for growth rate of payment where the cumulative value equals the outstanding balance...  assume a zero discount rate (i.e. interest free)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I have a goal to save 20k in cash, and my initial saving per period is 1k, what is the growth rate per period required to reach 20k if I only make 17 deposits?  &lt;/p&gt;&#xA;" OwnerUserId="15159" LastEditorUserId="467" LastEditDate="2015-01-23T09:37:43.627" LastActivityDate="2015-01-23T09:37:43.627" Title="How to calculate the growth rate of a growing annuity?" Tags="&lt;finance&gt;" AnswerCount="0" CommentCount="2" ClosedDate="2015-01-23T09:37:24.557" ContentLicense="CC BY-SA 3.0" />
  <row Id="16310" PostTypeId="1" CreationDate="2015-01-23T09:33:29.913" Score="6" ViewCount="596" Body="&lt;p&gt;Suppose somebody provides us with a surface of European call prices $C(\tau,K)$ where $\tau$ stands for time-to-maturity and $K$ for the strike. By Dupire's results, there is a unique local volatility function $\sigma(\tau,K)$ that generates these prices, and it can be expressed from them as&#xA;$$&#xA;  \sigma(\tau,K) = \frac{2C_\tau}{K^2C_{KK}},&#xA;$$ &#xA;here for simplicity I am assuming that interest rate is zero. Now, if we just have $C(T,K)$ for a single maturity $\tau = T$, is that true that there exists a unique time-independent local volatility $\sigma(K)$ that generates this price at that maturity? In case it does, is there an analytic formula for that function?&lt;/p&gt;&#xA;" OwnerUserId="13480" LastActivityDate="2015-04-25T23:09:48.647" Title="Time-independent local volatility" Tags="&lt;options&gt;&lt;volatility&gt;&lt;option-pricing&gt;&lt;local-volatility&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16311" PostTypeId="1" CreationDate="2015-01-23T13:22:26.463" Score="3" ViewCount="1112" Body="&lt;p&gt;I have a question about the definition and understanding of libor rates. We have the time to maturity tenor, $T$, which is the time over which i borrow or lend money. For libor we also have the reset date, i.e. in Bloomberg we find USD 3 Month LIBOR 25 Year. What does this exactly mean? Here the 3 Month is the reset tenor and 25 Year is the time to maturity. So for sure this is the interest rate over the next 25 Year. But what does the reset tenor mean? I observe daily changes in the market for this rate, so it cant be the interest I borrow or lend over the next 3 Month. One possible ticker in Bloomberg is for example S0023Z 25Y BLC2 Curncy.&lt;/p&gt;&#xA;" OwnerUserId="17133" LastActivityDate="2015-01-25T15:46:27.397" Title="what is the definition of resetting tenor and time to maturity tenor in libor rates" Tags="&lt;bloomberg&gt;&lt;libor&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16313" PostTypeId="2" ParentId="14899" CreationDate="2015-01-23T17:00:37.817" Score="1" Body="&lt;p&gt;If you're looking for settlement prices, the best (free) site out there is www.Quandl.com&lt;/p&gt;&#xA;" OwnerUserId="15161" LastActivityDate="2015-01-23T17:00:37.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16315" PostTypeId="2" ParentId="1656" CreationDate="2015-01-23T18:59:09.143" Score="6" Body="&lt;p&gt;SEC tends to keep CUSIPS handy:&#xA;&lt;a href=&quot;http://www.sec.gov/divisions/investment/13flists.htm&quot; rel=&quot;noreferrer&quot;&gt;http://www.sec.gov/divisions/investment/13flists.htm&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15163" LastActivityDate="2015-01-23T18:59:09.143" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16316" PostTypeId="1" CreationDate="2015-01-23T20:34:18.483" Score="0" ViewCount="301" Body="&lt;p&gt;In a Black&amp;amp;Scholes framework how can I compute the following sensitivities: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;to 1% move in the underlying price&lt;/li&gt;&#xA;&lt;li&gt;to 1% move in implied volatility&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I would like the greeks to tell me how many dollars I lose/gain if the underlying/implied volatility moves by 1%. &#xA;In particular, I would like to calculate the delta and gamma (to 1% move in underlying price) and vega and volga (to 1% move in implied volatility). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the vanna I would like to consider a 1% move in both underlying and implied volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you please suggest how to modify Black&amp;amp;Sholes greeks and also how to compute the sensitivities numerically? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A reference would also be very welcome. Thank you. &lt;/p&gt;&#xA;" OwnerUserId="15038" LastActivityDate="2015-01-24T18:59:54.450" Title="Option greeks: sensitivity to 1% move" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;greeks&gt;&lt;numerical-methods&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16317" PostTypeId="2" ParentId="16316" CreationDate="2015-01-24T01:08:04.700" Score="1" Body="&lt;p&gt;Try Finite Differences to calculate your Greeks, it will  give all the greeks for that specific underlying moviment.  In order to back out the dollar change in your pnl just multiply each greek by the amount held in that position.&lt;/p&gt;&#xA;" OwnerUserId="13398" LastActivityDate="2015-01-24T01:08:04.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16318" PostTypeId="1" CreationDate="2015-01-24T01:22:30.137" Score="2" ViewCount="113" Body="&lt;p&gt;I have the following treasuries: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;T 0 1/4 01/31/15 at 100.1236&lt;/li&gt;&#xA;&lt;li&gt;T 2 1/4 01/31/15 at 101.1257&lt;/li&gt;&#xA;&lt;li&gt;T 0 1/4 02/15/15 at 100.1251&lt;/li&gt;&#xA;&lt;li&gt;T 4 02/15/15 at 101.9994&lt;/li&gt;&#xA;&lt;li&gt;T 11 1/4 02/15/15 at 105.6269&lt;/li&gt;&#xA;&lt;li&gt;T 0 1/4 02/28/15 at 100.1237&lt;/li&gt;&#xA;&lt;li&gt;T 2 3/8 02/28/15 at 101.1878&lt;/li&gt;&#xA;&lt;li&gt;T 0 3/8 03/15/15 at 100.1866&lt;/li&gt;&#xA;&lt;li&gt;T 0 1/4 03/31/15 at 100.1182&lt;/li&gt;&#xA;&lt;li&gt;T 2 1/2 03/31/15 at 101.2421&lt;/li&gt;&#xA;&lt;li&gt;T 0 3/8 04/15/15 at 100.1784&lt;/li&gt;&#xA;&lt;li&gt;T 0 1/8 04/30/15 at 100.0554&lt;/li&gt;&#xA;&lt;li&gt;T 2 1/2 04/30/15 at 101.2375&lt;/li&gt;&#xA;&lt;li&gt;T 0 1/4 05/15/15 at 100.1103&lt;/li&gt;&#xA;&lt;li&gt;T 4 1/8 05/15/15 at 102.0451&lt;/li&gt;&#xA;&lt;li&gt;T 2 1/8 05/31/15 at 101.0417&lt;/li&gt;&#xA;&lt;li&gt;T 0 1/4 05/31/15 at 100.1095&lt;/li&gt;&#xA;&lt;li&gt;T 0 3/8 06/15/15 at 100.1644&lt;/li&gt;&#xA;&lt;li&gt;T 0 3/8 06/30/15 at 100.1617&lt;/li&gt;&#xA;&lt;li&gt;T 1 7/8 06/30/15 at 100.9101&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;And I want to calculate the 6 month spot rate curve from today date. When I do this I get negative returns for the spot rate. I followed the BEY convention and used this &lt;a href=&quot;https://quant.stackexchange.com/questions/3302/deriving-spot-rates-from-treasury-yield-curve&quot;&gt;question&lt;/a&gt; as reference. I got negative spot rates for the first part of the curve. Is this correct? Another point to consider is that I have multiple securities for the same expiration date (i.e. 1 and 2, 6 and 7) so when I build the spot rate I get two of them for one maturity. Which method should I use to ponder this.&lt;/p&gt;&#xA;" OwnerUserId="13751" LastActivityDate="2015-05-24T22:20:10.690" Title="Build spot rate curve with multiple treasuries for each maturity" Tags="&lt;discount-factor-curve&gt;&lt;spot-rate&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16319" PostTypeId="1" CreationDate="2015-01-24T02:50:32.647" Score="2" ViewCount="226" Body="&lt;p&gt;I have 2 related questions about increasing money supply: (I know high school level economics.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) In an economy which has low growth and deflation, is it at all a bad thing to print money? In fact, wouldn't printing money mean that the government could pay for extra public services that another government cannot afford, which seems like a very good thing in these days of austerity measures?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Quantitative Easing is sometimes called &quot;printing money&quot;. As I understand it, the central bank buys government bonds, but as I read goverments get back a lot of central bank profits (i.e. the interest on those bonds), and also governments occasionally grab a lump sum from the central bank (e.g. UK 2012). Therefore the debt from QE doesn't sound like real debt, and instead it seems to amount to the government printing money. So why is QE reported in the press as a bad thing in the EU and Japan? (I.e. is it not a golden opportunity to boost public services and bring people into work, while inflation is not a concern?)&lt;/p&gt;&#xA;" OwnerUserId="15164" LastActivityDate="2015-03-25T08:54:00.077" Title="Is printing money really a bad thing?" Tags="&lt;inflation&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16320" PostTypeId="1" CreationDate="2015-01-24T03:07:06.857" Score="5" ViewCount="1244" Body="&lt;p&gt;What is the relationship between a CDS credit spread (as set by the CDS issuer) and the instantaneous default probability (as estimated by the CDS issuer)? I hear they are similar but not the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How are CDS's usually agreed: do they have a fixed coupon or does the coupon vary with credit spread? (If it varies, then how?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks.&lt;/p&gt;&#xA;" OwnerUserId="15164" LastActivityDate="2019-02-19T16:03:10.683" Title="CDS credit spreads vs default probability" Tags="&lt;cds&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16321" PostTypeId="1" CreationDate="2015-01-24T03:52:26.120" Score="1" ViewCount="5219" Body="&lt;p&gt;I am fetching some historical data from Interactive Brokers with their API. But I got a bit of annoying their HongKong history data server ('hkhdm' in the connection status window) get disconnected almost every Saturday. Even the TWS app cannot let me login last Saturday (I wonder I won't be able login hours later today). So my question is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there someway to tell InteractiveBrokers TWS/Gateway app to use America or Europe server?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried to set location to America or Europe in the login window, no luck. I also used a New York VPN, and that didn't work. BTW, I live in Sydney now, and my account was setup with a Chinese residential address. Thanks for any help or hint.&lt;/p&gt;&#xA;" OwnerUserId="13945" LastActivityDate="2015-01-25T19:14:27.723" Title="InteractiveBrokers server outage every Saturday" Tags="&lt;interactive-brokers&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16322" PostTypeId="2" ParentId="16318" CreationDate="2015-01-24T05:46:16.737" Score="1" Body="&lt;p&gt;If you're bootstrapping and if there are bonds maturing on the same date, you should use only one. A good rule is to discard the older issue and keep the more recently issued securities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're building a spline, then it really doesn't matter since you're building a best fit curve that best approximates the prices of all bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming the quotes you provided are correct, then some of the yields are indeed negative. But your prices might just be off. For example, the first bond 0.25s of Jan15, has a clean price of 100.00390625 today (2015-01-23), significantly lower than the 100.1236 you have. (It's possible you're listing dirty prices, in which case your yield calculation might be off...)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Either way, shorted dated Treasuries are almost never used for building curves, since they're not liquid enough to provide useful information.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2015-01-24T05:46:16.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16323" PostTypeId="1" AcceptedAnswerId="16327" CreationDate="2015-01-24T06:47:10.027" Score="2" ViewCount="197" Body="&lt;p&gt;If I create a diversified portfolio of 2*beta stocks, can I expect to get twice the return of S&amp;amp;P 500. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example: Out of the universe of stocks available to me I randomly choose 10 stocks whose betas are 2. For a year if S&amp;amp;P 500 got 10 %, does that mean I will make 20 % in my portfolio. Reverse is true as well, if S&amp;amp;P made -10 %, I will make -20%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do these statements make sense ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&#xA;Coder&lt;/p&gt;&#xA;" OwnerUserId="15165" LastActivityDate="2015-01-24T16:44:21.223" Title="How to get twice the expected return of S&amp;P 500" Tags="&lt;beta&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16324" PostTypeId="2" ParentId="16323" CreationDate="2015-01-24T07:13:43.497" Score="2" Body="&lt;p&gt;In theory, if you create a fully diversified portfolio with $\beta=2$ you should get 2 times the risk premium on the market. In practice the SML of the CAPM is too flat, meaning that you would be better off buying low beta stocks and shorting high beta stocks. If you don’t trust me read &lt;a href=&quot;http://www.econ.yale.edu/~af227/pdf/Betting%20Against%20Beta%20-%20Frazzini%20and%20Pedersen.pdf&quot; rel=&quot;nofollow&quot;&gt;Betting Against Beta&lt;/a&gt; by Andrea Frazzini and Lasse Haje Pedersen.They say in the abstract:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We present a model with leverage and margin constraints that vary across investors and time. We find evidence consistent with each of the model's five central predictions: (1) Because constrained investors bid up high-beta assets, high beta is associated with low alpha, as we find empirically for US equities, 20 international equity markets, Treasury bonds, corporate bonds, and futures. (2) A betting against beta (BAB) factor, which is long leveraged low-beta assets and short high-beta assets, produces significant positive risk- adjusted returns. (3) When funding constraints tighten, the return of the BAB factor is low. (4) Increased funding liquidity risk compresses betas toward one. (5) More constrained investors hold riskier assets.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2015-01-24T07:13:43.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16325" PostTypeId="2" ParentId="16319" CreationDate="2015-01-24T07:38:37.493" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;1) In an economy which has low growth and deflation, is it at all a bad thing to print money? In fact, wouldn't printing money mean that the government could pay for extra public services that another government cannot afford, which seems like a very good thing in these days of austerity measures?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The Central Bank can’t finance Government expenditure in almost all the developed western Countries, so this doesn’t seem to be the main channel through which Monetary policy works. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;So why is QE reported in the press as a bad thing in the EU and Japan?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It depends on which kind of press do you read...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.ecb.europa.eu/mopo/intro/transmission/html/index.en.html&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; the ECB tries to explain how they think Monetary Policy works. There are four main channels trough which Monetary Policy works:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Interest rates&lt;/strong&gt;: in the traditional Keynesian IS-LM tradition lower interest rates boost Investments and then output. The more recent New Keynesian view is that they change the trade-off consumers face between consumption today and consumption tomorrow (basically, it’s another more convoluted way to say they have an incentive to invest…)&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Asset Prices&lt;/strong&gt;: the price of assets, being a discounted expected value, mechanically increase when interest rates decrease (i.e. the discount factor gets closer to one). This means aggregate wealth increase and people have an incentive to consume/invest. A similar channel involves &lt;a href=&quot;http://en.wikipedia.org/wiki/Tobin&amp;#39;s_q&quot; rel=&quot;nofollow&quot;&gt;Tobin’s q&lt;/a&gt; (i.e. the ratio between the market value of capital and its replacement value): when Tobin’s q is higher firms can invest a lot with very little equity.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Credit&lt;/strong&gt;: it mainly works through bank lending and the balance sheet of firms. One way or another, monetary policy increases banks’ deposits or banks’ debt which should be reflected on the asset side of the bank: hence more loans. Moreover, expansionary monetary policy increases the net worth of firms making easier for them to obtain loans (in the end firms net worth works as “collateral” for banks’ loans (see &lt;a href=&quot;http://www.econ.nyu.edu/user/gertlerm/BernankeGertlerAER.pdf&quot; rel=&quot;nofollow&quot;&gt;Bernanke&amp;amp;Gertler (1989)&lt;/a&gt;).&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Exchange Rates&lt;/strong&gt;: see the Euro in these days. QE lower exchange rates and should boost exports. Of course, while everybody can use the previous channels contemporaneously, not all the Central Banks of the World can contemporaneously work on the exchange rate.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.nber.org/papers/w5464.pdf&quot; rel=&quot;nofollow&quot;&gt;This paper by Mishkin&lt;/a&gt; may be a useful review.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All in all, does monetary policy work? I don’t know, but if you look at Europe and at the United States you have a “natural experiment” to answer your question...&lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2015-01-24T07:38:37.493" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16326" PostTypeId="1" CreationDate="2015-01-24T16:01:24.877" Score="0" ViewCount="3729" Body="&lt;p&gt;I'm working through Options, Futures and Other Derivatives (beginner trying to understand investment banking). I've more or less followed the discussion of interest rates, forward rates and forward rate agreements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I'm struggling to understand why the forward rate ends up where it is. I've read that one way to think about it is to do with arbitrage opportunities, and indeed one of the questions at the end of that chapter sets up the following question:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A bank can borrow or lend at LIBOR. Suppose that the six-month rate is&#xA;  5% and the nine-month rate is 6%. The rate that can be locked in for&#xA;  the period between six months and nine months using an FRA is 7%. What&#xA;  arbitrage opportunities are open to the bank? All rates are&#xA;  continuously compounded&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I've figured out that the 9-month forward rate is 8%. But now I'm stuck. What actions could the bank take to arbitrage in this situation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I know the answer is something like borrow money for 9 months at 6%, and lend it out for 6 months, and then invest it and buy an FRA at 7 or something, but I just can't figure out the steps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: @Student T - thanks for your answers. I'm trying to figure out the math to see how it would work&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Borrow let's say $100 for 9 months at 6% fixed:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cost to me is FV = PV * e^Rcn = 100*e^(0.06 *.75) = 104.60 ie I pay 4.60&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lend out $100 for 6 months at 5% fixed:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;100*e^(0.05 * .5) = 102.53&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then invest that 102.53 at LIBOR floating rate, I think?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I have sold the FRA at the start too, for a fixed rate on 102.53, then at the end I stand to get&#xA;102.53*e^(0.07 * 0.25) = 104.34, so I gain 4.34&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if these figures are right, that means that I paid 4.60 borrowing costs and only made 4.34 on my investments. Did I go wrong somewhere? Or is the correct answer that there are no arbitrage opportunities for the bank? Would it have helped if I bought the FRA rather than sold it?&lt;/p&gt;&#xA;" OwnerUserId="15167" LastEditorUserId="15167" LastEditDate="2015-01-24T21:12:01.500" LastActivityDate="2015-01-27T18:45:07.747" Title="How can an FRA create arbitrage opportunities?" Tags="&lt;forward&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16327" PostTypeId="2" ParentId="16323" CreationDate="2015-01-24T16:44:21.223" Score="1" Body="&lt;p&gt;If you want to obtain 2 times the S&amp;amp;P 500 return, it's safer just buying a leveraged etf tracking the index.&#xA;Randomly chosing 10 stocks obtaining a 2 beta position can lead to different results. You will have a tracking error due to the leftover idiosyncratic risk&lt;/p&gt;&#xA;" OwnerUserId="13950" LastActivityDate="2015-01-24T16:44:21.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16328" PostTypeId="2" ParentId="16316" CreationDate="2015-01-24T18:59:54.450" Score="0" Body="&lt;p&gt;In the BS model, everything is explicit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your spot increases by $h\%$, the price will increase by $\Delta_{rel,h}\%$ where &#xA;$$&#xA;  \Delta_{rel,h} = \frac{C_{BS}(S(1+h),T,K,\sigma)}{C_{BS}(S,T,K,\sigma)} - 1 &#xA;$$&#xA;That's high school math.&lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2015-01-24T18:59:54.450" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16329" PostTypeId="2" ParentId="16326" CreationDate="2015-01-24T20:53:59.010" Score="-1" Body="&lt;p&gt;Well, I think I have the answer to my own question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;T0: I lend $100 for 9mo, I get the 6% rate, which makes me 100*e^(.06*.75) = 4.60&lt;/p&gt;&#xA;&#xA;&lt;p&gt;T0: I borrow $100 for 6 months at 5%, which costs me 100*e^(.05*.5) = (2.53)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;T0: I buy a 6mo/9mo FRA at 7%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;T6: Borrow $100 for 3 months at whatever the floating LIBOR rate is (I don't care what it is because I'm guaranteed to pay 7% on it because of my FRA). Interest I need to pay on the loan is 100*e^(0.07*.25) = (1.76)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I get \$4.60 from lending out $100, and I only have costs of 2.53+1.76 = 4.29&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore I make a guaranteed $0.31 whatever the market does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I got it slightly wrong. You don't borrow $100 for 3 months, you borrow $102.53 to pay off the 6 month loan AND interest. Then you're left with $0.26&lt;/p&gt;&#xA;" OwnerUserId="15167" LastEditorUserId="15167" LastEditDate="2015-01-27T18:45:07.747" LastActivityDate="2015-01-27T18:45:07.747" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16331" PostTypeId="2" ParentId="16280" CreationDate="2015-01-24T21:08:02.617" Score="2" Body="&lt;p&gt;When I implemented a BL model, I chose to do the omega optimization using the technique Idzorek proposed here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://corporate.morningstar.com/ib/documents/MethodologyDocuments/IBBAssociates/BlackLitterman.pdf&quot; rel=&quot;nofollow&quot;&gt;https://corporate.morningstar.com/ib/documents/MethodologyDocuments/IBBAssociates/BlackLitterman.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's a numerical procedure though.&lt;/p&gt;&#xA;" OwnerUserId="3491" LastActivityDate="2015-01-24T21:08:02.617" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16332" PostTypeId="1" AcceptedAnswerId="16346" CreationDate="2015-01-25T00:27:12.540" Score="1" ViewCount="72" Body="&lt;p&gt;Financial systems can certainly be modeled using the same tools physicists use to model dynamic physical systems. The validity of such is evidenced by models such as that developed by Black and Scholes to predict market outcomes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And I have first hand knowledge that engineers and physicists are hired by Wall Street to develop and apply such models to gain an edge on investment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question, from a physicist's or mathematician's point of view, who may have worked with financial systems - are there any financial models that can lead to any type of resonance - such as for example the flow of cash behaving like a standing wave?&lt;/p&gt;&#xA;" OwnerUserId="15156" LastActivityDate="2015-01-26T10:35:22.937" Title="Is it possible that some types of financial systems can resonate?" Tags="&lt;models&gt;&lt;mathematics&gt;&lt;economics&gt;&lt;market-model&gt;&lt;behavioral-finance&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16333" PostTypeId="1" CreationDate="2015-01-25T10:18:52.223" Score="1" ViewCount="87" Body="&lt;p&gt;I am looking for qualified examples of &lt;a href=&quot;http://en.wikipedia.org/wiki/Multi-objective_optimization&quot; rel=&quot;nofollow&quot;&gt;multi-objective optimization&lt;/a&gt; applied to a  portfolio management situation in non-normal markets. Where can I find one or more examples of such a multi-objective optimization, preferable using some kind of R code (e.g., using &lt;a href=&quot;http://cran.r-project.org/web/packages/mco/mco.pdf&quot; rel=&quot;nofollow&quot;&gt;MCO&lt;/a&gt; or other packages) but pen and paper examples are equally welcome, including a discussion of required assumptions, limitations and conditions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If a full example of the above is not known partial references such as examples assuming normal markets or just a discussion on assumptions or limitations would be helpful.&lt;/p&gt;&#xA;" OwnerUserId="7186" LastActivityDate="2015-01-25T10:18:52.223" Title="Multi-objective optimization: Where to find qualified examples for portfolio management?" Tags="&lt;portfolio-management&gt;&lt;optimization&gt;&lt;algorithm&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16335" PostTypeId="2" ParentId="16321" CreationDate="2015-01-25T19:14:27.723" Score="2" Body="&lt;h2&gt;Answer to question of IB Gateway using other server&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;IB Gateway reads a &quot;jts.ini&quot; file to determine which server it should connect to. There is a &quot;[communication]&quot; section under which a &quot;peer=&quot; value is set. When I download IB Gateway from the IB US website the provided default jts.ini file contains:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[communication]&#xA;peer=gw1.ibllc.com:4000&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Depending on whether you are installing on Windows or Mac a &quot;jts.ini&quot; file can be found in the wherever IB Gateway gets installed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are potentially other settings in your jts.ini file in use which might point to other servers. You can try also changing those addition setting if present or you can try and replace your existing jts.ini file with a completely new one contain only the above example (for the US server).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These instructions should also apply to TWS (however I'm using and testing with IB Gateway).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm guessing that if you download IB Gateway from the Europe IB website the provided default jts.ini file will point to the Europe server.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;However, you can't avoid the weekly reset&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;However, in the end, I don't think changing the server will work around your issue. IB says &quot;During the Friday evening reset period, all services will be unavailable in all regions for the duration of the reset.&quot; on the &lt;a href=&quot;https://www.interactivebrokers.com/en/index.php?f=en/software/systemStatus.php&quot; rel=&quot;nofollow&quot;&gt;IB System Status Page&lt;/a&gt;. My guess is you are observing this New York Friday evening reset which is Saturday in your timezone and is going to happen at the same time in all regions.&lt;/p&gt;&#xA;" OwnerUserId="4716" LastActivityDate="2015-01-25T19:14:27.723" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16336" PostTypeId="1" CreationDate="2015-01-25T19:19:28.030" Score="3" ViewCount="699" Body="&lt;p&gt;I have a portfolio of 4 assets. I also have returns for 3 indices. I want to get the multivariate betas for these 4 assets-based on these assets. I only have the 7 x 7 covariance matrix estimated by a Exponential Weighted Moving Average Model (EWMA). How would I get these multivariate betas? I know from a univariate percpective I would use the covarience(Asset1Return,Index1Return)/Var(Index1) but this only gives the uni-variate beta. &lt;/p&gt;&#xA;" OwnerUserId="15173" LastActivityDate="2015-04-29T00:04:25.707" Title="How to get Multivariate Betas from an Estimated EWMA co variance Matrix?" Tags="&lt;risk-models&gt;&lt;beta&gt;&lt;covariance&gt;&lt;covariance-matrix&gt;&lt;covariance-estimation&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16339" PostTypeId="1" AcceptedAnswerId="17023" CreationDate="2015-01-26T02:36:45.170" Score="7" ViewCount="934" Body="&lt;p&gt;I understand how to derive the black scholes solution if $dS_t$ = $\mu S_tdt$ + $\sigma S_tdW_t$ and r is constant. The solution is c(t, x) = $xN(d_{+}(T - t), x))$ - K$e^{-r(T - t)}N(d\_(T - t), x))$ where $d_{+}(\tau, x)$ = $\frac{1}{\sigma\sqrt{\tau}}$ * $[log\frac{x}{K} + (r + \frac{1}{2}\sigma^2)\tau]$, $d\_(\tau, x) = d_{+}(\tau, x) - \sigma \sqrt{\tau}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I need to find the solution when, $dS_t = \mu_{t}S_tdt + \sigma_{t}S_tdW_t$  and $r_t$ are deterministic functions of t. I was asked to guess the solution, so it must be a very close analogue to the solution above. I thought about integrating over time, but I haven't been able to verify that this works, and I do need to verify the solution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help in figuring out what the form and how to go about verifying that it is a solution would be appreciated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: Someone asked to see some extra work, here is my guess of what the solution should be: c(t, x) = $xN(d_{+}(T - t), x))$ - $Ke^{-\int_0^{T - t}r_udu}$N(d_(T - t), x)) where $d_{+}(\tau, x) = \frac{1}{\int_0^\tau \sigma_udu}$ * $[log\frac{x}{K} + \int_0^\tau (r + \frac{1}{2}\sigma^2)]$, $d\_(\tau, x) = d_{+}(\tau, x) - \int_0^\sqrt{\tau} \sigma_udu$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know if this guess is even correct, and if it is I need to verify that it is a solution the Black-Scholes PDE. &lt;/p&gt;&#xA;" OwnerUserId="11919" LastEditorUserId="11919" LastEditDate="2015-01-26T05:22:16.600" LastActivityDate="2015-03-19T19:47:21.540" Title="generalized black scholes" Tags="&lt;black-scholes&gt;&lt;stochastic-calculus&gt;&lt;black-scholes-pde&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16340" PostTypeId="2" ParentId="16157" CreationDate="2015-01-26T02:37:49.280" Score="4" Body="&lt;p&gt;Firstly it's good to straighten out our goal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You correctly say, that IFRS9 requires analysis of expected losses.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two components of expected losses.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Expected probability of a default event&#xA;2) Expected recovery rate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, not only do we need the probability but also the recovery rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Luckily, both are approximated by the credit spread, which as you say is readily available from CDS or Bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for market data, note that CDS are available for many more names than you would usually find in the listed equity markets. A function of the the fixed income market being magnitudes larger.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the event that you cannot find the data the industry practice is to proxy with a spread from a related CDX or company. Some funds also use several proxy schemes, to flesh out different scenarios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Correlations are not necessary. You see this when you price a CDX for example. You do need correlations when you price CDX tranches - because the interplay between names then becomes important, but no for vanilla CDX (which are a portfolio of names essentially).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll happily look around for some literature, if you want something specific - suspect you can Google around easy enough for extra information though.&lt;/p&gt;&#xA;" OwnerUserId="7682" LastActivityDate="2015-01-26T02:37:49.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16343" PostTypeId="1" CreationDate="2015-01-26T07:04:26.850" Score="9" ViewCount="870" Body="&lt;p&gt;I'm new to local volatility model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From Dupire's paper and most of the textbooks, they derived the local volatility $\sigma(K, T)$ in the $(K, T)$ (i.e., strike and maturity) space, from call prices or the implied volatility surface.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, by definition, local volatility is a function in terms of $(S_t, t)$, i.e., instantaneous underlying price and time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to relate these two?&lt;/p&gt;&#xA;" OwnerUserId="15180" LastEditorUserId="467" LastEditDate="2015-03-24T01:55:05.120" LastActivityDate="2018-05-23T11:22:41.777" Title="In Dupire's paper, why is $(S_t, t)$ in the $(K, T)$ space?" Tags="&lt;volatility-smile&gt;&lt;local-volatility&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16344" PostTypeId="1" CreationDate="2015-01-26T08:10:47.690" Score="1" ViewCount="213" Body="&lt;p&gt;If I assume that stock returns follow normal distribution with drift = 0% and S.D. = 10%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the long, if I keep investing in this stock for a year with the same capital every year for a consecutive 100 years, my expected return would be 0% per year (equal to the zero drift). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put this another way, If I invest in a sea of stocks that have identical return distribution (drift = 0% and S.D. = 10%) for a year, my average return would be 0% (equal to the zero drift).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I get it right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case that I got it right, what if I change from investing in stock to option on that stock. What expected return should I see?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried to elaborate my problem in an excel file. The example in the file illustrates return distribution of a stock and an option of the stock which are based on normal distribution. I calculate expected price of stock and option by sumproducting probability and price. As you will see, the option price calculated from BS formula (Cell C8) is not equal to expected value got from the table (Cell C9). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I expect that BS price should be equal to my expected price, why is it not the case?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have included the link of my Excel file here&#xA;&lt;a href=&quot;https://drive.google.com/file/d/0BwkonR6lvt3DbUJna0hEMUtNckk/view?usp=sharing&quot; rel=&quot;nofollow&quot;&gt;Expected Price of Option&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any contribution will be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="13991" LastEditorUserId="13991" LastEditDate="2015-01-26T08:44:21.270" LastActivityDate="2019-09-08T22:25:14.063" Title="Why does expected price of OTM option not equal to BS price?" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;risk-neutral-measure&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16345" PostTypeId="1" CreationDate="2015-01-26T10:25:33.147" Score="3" ViewCount="228" Body="&lt;p&gt;Suppose $T$ the maturity of a risky bond which defaults with probability $p$ over its lifetime. If it defaults it pays zero. Thus to price this bond in risk neutral terms would give&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P=\mathbb{E}^{\mathbb{Q}}\left[e^{-r(T-t)}(1-p)\right].$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If such bond and its price would be observable in the market we could estimate $p$, that is, the implied probability of default. It is however known from literature that this $p$ is usually an overestimation of the real probability of default, see for example Hull, White and Predescu (&lt;a href=&quot;http://www-2.rotman.utoronto.ca/~hull/DownloadablePublications/CreditSpreads.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www-2.rotman.utoronto.ca/~hull/DownloadablePublications/CreditSpreads.pdf&lt;/a&gt;). This difference can be understood as the additional risk premium for for example default risk and systematic risk. But in this same paper it is furthermore stated that without risk premiums the implied default probability would coincide with the real default probability. This sounds plausible, but how would I go ahead and show that statement to be true? I was thinking about something like, using for example the above bond price in the real world measure:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P=\mathbb{E}^{\mathbb{P}}\left[e^{-\mu(T-t)}(1-p^*)-s_{premiums}\right],$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $s_{premiums}$ the additional price of risk premiums and $\mathbb{P}$ the real world measure, $p^*$ the real world probability of default and $\mu$ the correct discount rate. However if $s_{premiums}=0$ then $p^*=p$ only if $r=\mu$. Am i missing something or is this the wrong approach, what would you suggest?&lt;/p&gt;&#xA;" OwnerUserId="15181" LastEditorUserId="15181" LastEditDate="2015-01-26T12:25:12.607" LastActivityDate="2015-01-26T13:04:03.420" Title="When are implied and real world parameters the same?" Tags="&lt;risk-neutral-measure&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16346" PostTypeId="2" ParentId="16332" CreationDate="2015-01-26T10:35:22.937" Score="3" Body="&lt;p&gt;The general effect of quantitative analysis of the markets is to enforce randomness.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose a strategic quant finds a predictable pattern where a stock always rises on Tuesdays. His institution will commence buying the stock every Monday, and selling on Tuesday. The trading itself pushes the stock price up on Monday and down on Tuesday (in general), so if enough volume is traded the pattern will disappear.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The occasions where this is not true are when there are unavoidable demands due to regulation or when the market is not efficient; at the end of the year there is generally a strong demand for USD to satisfy regulatory or accounting requirements for capital, which push exchange rates and interest rates one way for a short period. It is largely predictable, but only those who are not short of USD can benefit; the pool is too small to correct the imbalance. Similarly, when a whale trades (e.g. the London Whale), the market is not efficient and other factors like liquidity and trade volume come into play.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the short answer is that any pattern like a resonance pattern should be eliminated in a fast, efficient market, and that there are enormous resources devoted to locating patterns in the numbers in order to exploit and effectively eliminate them. In a physical system, the particles are blind and dumb, and the mechanisms are predictable and consistent. In finance, every participant has complex behaviour, and many of the mechanisms are neither predictable nor consistent, except to consistently act to eliminate predictability.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The history books are full of clever quants who had a sure thing until they didn't. For example, LTCM, the whole MBS setup, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The exception is Goldman. &lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2015-01-26T10:35:22.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16348" PostTypeId="2" ParentId="16345" CreationDate="2015-01-26T13:04:03.420" Score="1" Body="&lt;p&gt;Suppose the above bond and let $\tau$ be the default time, then by definition of the Q-measure&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;P&amp;amp;=\mathbb{E}^{\mathbb{Q}}\left[e^{-r(T-t)}1_{\tau&amp;gt;T}\right]\\&#xA;&amp;amp;=e^{-r(T-t)}\mathbb{E}^{\mathbb{Q}}\left[1_{\tau&amp;gt;T}\right]\\&#xA;&amp;amp;=e^{-r(T-t)}\mathbb{Q}(\tau&amp;gt;T).&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To evaluate a fair price in the real-world measure we first have to note that receiving this bond is not risk free. Thus, to compensate the investor with several risk factors he requires an additional premium of $s_{premiums}$. Note these not te be related to risk-aversion if we assume the market to be liquid, as then prices converge to a fair price. However, hedging away risks will cost money. Furthermore, there are transaction costs and even systemic risk for which we cannot hedge, all of these components require an additional premium. Suppose this premium is received at maturity $T$, then the terminal payoff is risk free in the real world, such that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;P&amp;amp;=\mathbb{E}^{\mathbb{P}}\left[e^{-r(T-t)}\left(1_{\tau&amp;gt;T}+s_{premiums}\right)\right]\\&#xA;&amp;amp;=e^{-r(T-t)}\mathbb{E}^{\mathbb{P}}\left[1_{\tau&amp;gt;T}+e^{-r(T-t)}s_{premiums}\right]\\&#xA;&amp;amp;=e^{-r(T-t)}\mathbb{P}(\tau&amp;gt;T)+e^{-r(T-t)}\mathbb{E}^{\mathbb{P}}\left[s_{premiums}\right].&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The result now follows from &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbb{Q}(\tau&amp;gt;T)=\mathbb{P}(\tau&amp;gt;T)+\mathbb{E}^{\mathbb{P}}\left[s_{premiums}\right], $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;such that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbb{Q}(\tau&amp;gt;T)&amp;gt;\mathbb{P}(\tau&amp;gt;T).$$&lt;/p&gt;&#xA;" OwnerUserId="15181" LastActivityDate="2015-01-26T13:04:03.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16349" PostTypeId="1" AcceptedAnswerId="16367" CreationDate="2015-01-26T14:06:08.613" Score="-2" ViewCount="135" Body="&lt;p&gt;I need to calculate the price of exchange option between 2 assets $S_1$ and $S_2$&#xA;The formula is given here &lt;a href=&quot;http://en.wikipedia.org/wiki/Margrabe&amp;#39;s_formula&quot; rel=&quot;nofollow noreferrer&quot;&gt;Wiki: Magrabe formula&lt;/a&gt; or here &lt;a href=&quot;https://quant.stackexchange.com/questions/8881/risk-neutral-evaluation-exchange-spread-options&quot;&gt;Quant Stack Exchange&lt;/a&gt;.&#xA;In the derivation of the formula it is assumed, that price is the discounted expecation of future claim under risk-neutral measure $Q$:&#xA;$$p=e^{-r_{f}}\mathbb{E}_{Q}(S_1-S_2)^{+}$$.&#xA;and under risk-neutral measure it is assumed, that:&#xA;$$dS_{i,t}=\mu_{i}dt+\sigma_{i}dW^{i}_{t}$$&#xA;$$\mu_{i}=r_{f}\text{, for }i=1,2$$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why do we calculate expectation under risk-neutral measure $Q$ and not real-world measure $P$ ?&#xA;In real world return on each asset can be different, i.e. $\mu_1\neq\mu_2\neq r_f$. Then it would make sence to use real-world measure, under which this condition is fullfilled.&lt;/p&gt;&#xA;" OwnerUserId="15184" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2015-01-28T00:51:12.653" Title="Magrabe Exchange Option: not equal drifts" Tags="&lt;option-pricing&gt;&lt;risk-neutral-measure&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16351" PostTypeId="1" CreationDate="2015-01-26T20:11:13.227" Score="1" ViewCount="2702" Body="&lt;p&gt;The $\beta_i$ of an asset or portfolio is defined as its covariance with the market (which itself therefore has a beta of $\beta_m = 1$). The CAPM looks a lot like a simple linear regression model. Is its $\beta$ equivalent to the coefficient estimate obtained from an ordinary least squares regression on the CAPM equation?&lt;/p&gt;&#xA;" OwnerUserId="13665" LastActivityDate="2015-05-04T12:13:52.383" Title="Is the CAPM beta equivalent to the coefficient estimate of an OLS regression?" Tags="&lt;asset-pricing&gt;&lt;capm&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16352" PostTypeId="2" ParentId="16351" CreationDate="2015-01-26T20:55:21.283" Score="0" Body="&lt;p&gt;I'm not sure I'd use the word &quot;equivalent&quot; but you have the right idea.  Instead, I would say OLS regression is a very common way of estimating CAPM beta.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;CAPM is a linear model to calculate the an &lt;a href=&quot;https://en.wikipedia.org/wiki/Capital_asset_pricing_model&quot; rel=&quot;nofollow&quot;&gt;appropriate return of an asset given its non-diversifiable risk&lt;/a&gt;.  OLS is really a method for solving certain types of linear models.  So OLS can be used on the CAPM model but it is used on many, many other models as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, there are other methods used for estimating CAPM betas other than OLS.  Some may even have better predictive power, but OLS is by far the most common.&lt;/p&gt;&#xA;" OwnerUserId="5689" LastActivityDate="2015-01-26T20:55:21.283" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16353" PostTypeId="1" CreationDate="2015-01-26T22:36:52.617" Score="0" ViewCount="2043" Body="&lt;p&gt;This is important in price discovery and pricing of bonds based on trades. &quot;Odd&quot; lots are traded at lower prices than &quot;round&quot; lots. However I wasn't able to find a definition of &quot;odd&quot; lot anywhere. For equity shares it's lots of multiples other than 100. I found one by fidelity odd lot = number of bonds different from 100 and one by capital IQ, trades below $1 million.&lt;/p&gt;&#xA;" OwnerUserId="2685" LastEditorUserId="2685" LastEditDate="2015-01-26T22:47:49.040" LastActivityDate="2015-01-29T02:26:00.903" Title="What constitutes an &quot;odd lot&quot; in corporate bonds trades?" Tags="&lt;pricing&gt;&lt;bond&gt;&lt;asset-pricing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16355" PostTypeId="2" ParentId="16351" CreationDate="2015-01-27T04:21:09.237" Score="3" Body="&lt;p&gt;They are actually exactly the same thing. CAPM say that expected risk premia are “explained&quot; by the risk premium on the mean variance efficient (MVE) portfolio&#xA;$$&#xA;R^i_{t+1} - R^f = \delta (R^{MVE}_{t+1}-R^f) + \varepsilon_{t+1}&#xA;$$&#xA;De facto, you are saying that the systematic risk is just the projection of risk premia on MVE risk premium, and OLS are exactly the same thing as a linear projection. Indeed it must be the case that $$\delta= \frac{Cov(R^{MVE}_{t+1},R^i_{t+1})}{Var(R^{MVE}_{t+1})}=\beta^{OLS}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And by the way, when investors price by means of discounted expected payoffs, i.e.when &#xA;$$&#xA;p_t^i=\mathbb{E}_t \frac{d_{t+1}}{1+R^i_{t+1}}&#xA;$$&#xA;expected returns always admit a beta representation, i.e. we can always rewrite&#xA;$$&#xA;\mathbb{E}_t R^i_{t+1} =\alpha_0 + \beta\lambda&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2015-01-27T04:21:09.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16356" PostTypeId="1" AcceptedAnswerId="16458" CreationDate="2015-01-27T10:42:08.137" Score="5" ViewCount="910" Body="&lt;p&gt;This question relates to &lt;a href=&quot;https://quant.stackexchange.com/questions/16280/black-litterman-how-to-choose-the-uncertainty-in-the-views-omega-for-smooth&quot;&gt;this question&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the Black-Litterman framework views of inverstors on the market are modelled. &#xA;These views have a covariance-matrix $\Omega$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I always found it quite natural to model $\Omega$ proportional to the market covaraince $\Sigma$. But in the literature by Litterman himself I find that $\Omega$ should be diagonal. Why should this be useful?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I take this from &lt;a href=&quot;http://faculty.som.yale.edu/zhiwuchen/Investments/GS-ModelIntuition.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Appendix B of The Intuition Behind Black-Litterman&#xA;Model Portfolios&lt;/a&gt; and &lt;a href=&quot;https://faculty.fuqua.duke.edu/~charvey/Teaching/BA453_2006/Black_Litterman_GAA_1991.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Global Asset Allocation With Equities, Bonds, and Currencies p.38&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no proof in the papers mentioned. I don't think that $\Omega$ has to be diagonal for the framework to work, but why do they assume it? Mabye the proof is in Black, Fischer, and Robert Litterman, Asset Allocation: Combining Investor Views With Market Equilibrium, Goldman, Sachs &amp;amp; Co.,September 1990. But I can't find it on the web.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-02-05T10:09:53.180" Title="Black-Litterman: Why should the views be independent of each other?" Tags="&lt;modern-portfolio-theory&gt;&lt;covariance-matrix&gt;&lt;black-litterman&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16357" PostTypeId="2" ParentId="16356" CreationDate="2015-01-27T11:18:31.627" Score="3" Body="&lt;p&gt;In &lt;a href=&quot;http://www.blacklitterman.org/Black-Litterman.pdf&quot; rel=&quot;nofollow&quot;&gt;The Black-Litterman Model In Detail&lt;/a&gt; Jay Walters says the following on p. 13 (top paragraph):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;First, by construction we will require each view to be unique and uncorrelated with the other views. This will give the conditional distribution the property that the covariance matrix will be diagonal, with all offdiagonal entries equal to 0. We constrain the problem this way in order to improve the stability of the results and to simplify the problem. Estimating the covariances between views would be even more complicated and error prone than estimating the view variances.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;On p. 14 there is a whole section on how to specify $\Omega$. There he also says that &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=872577&quot; rel=&quot;nofollow&quot;&gt;Meucci (2006)&lt;/a&gt; uses a non-diagonal matrix $\Omega$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe this is helpful. &lt;/p&gt;&#xA;" OwnerUserId="6980" LastActivityDate="2015-01-27T11:18:31.627" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16358" PostTypeId="1" AcceptedAnswerId="16361" CreationDate="2015-01-27T13:52:13.477" Score="6" ViewCount="2230" Body="&lt;p&gt;I am required by my course to write a small paper on the Bayesian approach to portfolio optimization, I am following &lt;em&gt;Applied statistical decision theory&lt;/em&gt; [by] Raiffa, Howard. Which can be consulted online &lt;a href=&quot;http://babel.hathitrust.org/cgi/pt?id=mdp.39015022416351;view=1up;seq=256&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I begun following this text because I tried to read the paper by Zellner, Arnold, and V. Karuppan Chetty, 1965, &lt;em&gt;Prediction and decision problems in regression models from the Bayesian point of view&lt;/em&gt;, and realized I was not following most of the math present in the paper.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions are: What is the recommended literature for understanding the Bayesian approach to portfolio management? any suggestions on the approach to the subject?&lt;/p&gt;&#xA;" OwnerUserId="15188" LastActivityDate="2017-04-05T11:25:16.047" Title="On learning the bayesian approach to portfolio optimization" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="16359" PostTypeId="1" CreationDate="2015-01-27T14:27:58.347" Score="0" ViewCount="212" Body="&lt;p&gt;I am constructing discount curve for tenor 1 month. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First Instrument - PLN_1M_WIBOR has &lt;strong&gt;Effective Date on 2015-01-29&lt;/strong&gt; (spot). I was wondering what Maturity Date should be? 2015-02-27 or 2015-03-02? I am using &lt;strong&gt;modified following&lt;/strong&gt; convention. According to to this convention I suppose it should be 2015-02-27, but I am not sure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second instrument is FRA_0102 dated on today (2015-01-27), so it`s Effective Date should be 2015-02-27? &lt;/p&gt;&#xA;" OwnerUserId="13778" LastEditorUserId="13778" LastEditDate="2015-01-27T15:21:04.067" LastActivityDate="2015-04-27T21:38:38.827" Title="Effective &amp; Maturity Date Modified Following" Tags="&lt;fixed-income&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16361" PostTypeId="2" ParentId="16358" CreationDate="2015-01-27T16:43:20.723" Score="6" Body="&lt;p&gt;An introductory presentation by Michael Brandt from a seminar of Inquire Europe is &lt;a href=&quot;http://www.inquire-europe.org/seminars/2012/papers%20Budapest/Bayesian%20Portfolio%20Construction.pdf&quot; rel=&quot;noreferrer&quot;&gt;Bayesian Portfolio Construction&lt;/a&gt;. His review &lt;a href=&quot;https://faculty.fuqua.duke.edu/~mbrandt/papers/published/portreview.pdf&quot; rel=&quot;noreferrer&quot;&gt;Portfolio Choice Problems&lt;/a&gt; has a section on decision theory which could also be useful to you. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another good choice is Attilio Meucci's &lt;em&gt;Risk and Asset Allocation&lt;/em&gt; book which contains a whole chapter (ch 9) on Bayesian techniques in asset allocation. You might also want to look at his paper &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1117574&quot; rel=&quot;noreferrer&quot;&gt;The Black Litterman Approach: Original Model and Extensions&lt;/a&gt;, which reviews Black Litterman, the most widely used Bayesian approach in asset allocation.&lt;/p&gt;&#xA;" OwnerUserId="6721" LastEditorUserId="6721" LastEditDate="2015-01-27T16:50:31.170" LastActivityDate="2015-01-27T16:50:31.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16363" PostTypeId="2" ParentId="16359" CreationDate="2015-01-27T20:40:20.633" Score="1" Body="&lt;p&gt;Using modified following, the date should never fall into the next month. If the target date is in the next month, you should move it back to the end of the current month. So Feb 27, 2015 is the correct answer.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2015-01-27T20:40:20.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16364" PostTypeId="2" ParentId="16344" CreationDate="2015-01-27T20:51:05.350" Score="2" Body="&lt;p&gt;Black--Scholes takes log-normal stock price movements whereas your model gives normal price movements. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-01-27T20:51:05.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16365" PostTypeId="1" AcceptedAnswerId="16379" CreationDate="2015-01-27T21:14:30.900" Score="7" ViewCount="709" Body="&lt;p&gt;I have some questions regarding pricing futures options and I just want to be sure that my thoughts are correct. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to price options on futures for american &amp;amp; european style.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the latest case, I am using the &lt;a href=&quot;http://en.wikipedia.org/wiki/Black_model&quot; rel=&quot;noreferrer&quot;&gt;Black Model&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When looking at the volatility of the contract Ito's lemma gives that the volatility of the future contract is the same as the volatility of the underlying (in the future contract). Is it correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then if I want to use Black Model, I just need to compute the volatility of the futures' underlying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Options on future are generally american. Then I am using a binomial tree to price my future contracts. Here again the volatility is then determined by the future underlying. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is that correct?&lt;/p&gt;&#xA;" OwnerUserId="15191" LastEditorUserId="467" LastEditDate="2015-01-28T02:32:43.753" LastActivityDate="2017-02-26T15:38:24.247" Title="Which volatility to use to price options on futures contract?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;futures&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16367" PostTypeId="2" ParentId="16349" CreationDate="2015-01-28T00:51:12.653" Score="1" Body="&lt;p&gt;You can essentially get your answer from any quantitative finance book. I recommend Shreve's book. Note that this has nothing to do with pricing an exchange option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could price in the real-world measure, but that's very difficult if impossible because you'd need to know the risk premium for an instrument. By changing the probability measure to risk-neutral, you can assume all investors demand only the risk-free rate and thus you could discount your expected price with the risk-free rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please read risk neutral measure on &lt;a href=&quot;https://en.wikipedia.org/wiki/Risk-neutral_measure&quot; rel=&quot;nofollow&quot;&gt;Wikipedia&lt;/a&gt;. In particular, focus on &quot;&lt;em&gt;Unfortunately, the discount rates would vary between investors and an individual's risk preference is difficult to quantify.&lt;/em&gt;&quot;&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2015-01-28T00:51:12.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16368" PostTypeId="1" CreationDate="2015-01-28T08:44:13.480" Score="3" ViewCount="2752" Body="&lt;p&gt;I've been trying to understand why at the money options have very little vomma. I was reading and came across a graph that showed vega as volatility changes and I couldn't grasp how the relationships work. Why is the vega of an ATM option just constant with respect to volatility?&lt;/p&gt;&#xA;" OwnerUserId="15197" LastActivityDate="2015-01-31T05:07:16.997" Title="Why is the vega of an at the money option so insensitive to movements in volatility? I.e, why do ATM options have such little Vomma?" Tags="&lt;options&gt;&lt;volatility&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16369" PostTypeId="2" ParentId="16368" CreationDate="2015-01-28T09:36:29.723" Score="2" Body="&lt;p&gt;well you are really asking why is the ATM value so linear in $\sigma. $ If you take a Taylor about $\sigma =0$ when ATM you get the well-known expression &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{1}{\sqrt{2\pi}} \sigma \sqrt{T} S_t +{\cal O}(\sigma^3 T^{3/2})&#xA;$$&#xA;which gives the approximate linearity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For details of the derivation see for example my book Concepts etc. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-01-28T09:36:29.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16370" PostTypeId="1" AcceptedAnswerId="22084" CreationDate="2015-01-28T09:49:08.903" Score="4" ViewCount="808" Body="&lt;p&gt;Recently I have been working a lot with implied volatility and volatility surfaces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The basic idea is easy to follow:&#xA;1) Gather market prices of options at different (Strike,Expiry)&#xA;2) Calculate implied volatilities&#xA;3) Interpolate/Extrapolate as needed to emulate a continuum of option market prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question concerns point 1), namely the selection of prices and what options to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say I use European option prices:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Would it be OK to mix put/call prices such that I only ever calculate implied volatility for in-the-money options?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;If so, I assume this surface can then immediately be used to calculate a fair value for an in-the-money call option (even though the implied volatility is calculated from the put option at the same (Strike,Expiry)?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Does it make sense to price American options using this volatility surface constructed from European options?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say I use American option prices:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Does this give additional value as opposed to using a surface constructed from European option prices?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Is it again possible to mix put/call prices into the same surface? Or does that not make sense?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Is it at all possible to mix american option prices with european option prices?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you may guess, I have had a hard time finding articles or papers that discuss how volatility surfaces should be used in actual practice. Do I need one surface for puts, one for calls, and one each for european and americans? Or do I just need a single surface consisting of a mix of european put and calls?&lt;/p&gt;&#xA;" OwnerUserId="5888" LastActivityDate="2015-12-03T14:22:34.503" Title="Volatility Surface Constituents, do's and dont's" Tags="&lt;options&gt;&lt;volatility&gt;&lt;implied-volatility&gt;&lt;volatility-smile&gt;&lt;best-practices&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16371" PostTypeId="1" CreationDate="2015-01-28T10:51:45.123" Score="3" ViewCount="116" Body="&lt;p&gt;Starting with the Bellman equation for the optimal stopping problem:&#xA;$$F(x,t)=max\{\Omega(x,t), \pi(x,t)+(1+\rho dt)^{-1} E[F(x+dx, t+dt)|x]\}$$&#xA;In the continuation region where the second term is the greatest they get the following equation after expanding by Ito's Lemma:&#xA;$$\frac{1}{2}b^2(x,t)F_{xx}(x,t)+a(x,t)F_x(x,t)+F_t(x,t)-\rho F(x,t)+\pi(x,t)=0 $$&#xA;(13)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$F(x,t)$ is the value of an investment. $\pi(x,t)$ is the profit flow, $\rho$ is the discount rate and $\Omega(x,t)$ is the value achieved if stopping. $x$ is assumed to follow an Ito process: &#xA;$$dx=a(x,t)dt+b(x,t)dz$$&#xA;I dont understand how (13) is reached. The closest i get is:&#xA;$$F(x,t)=\pi(x,t)+(1+\rho dt)^{-1}E[F(x+dx, t+dt)|x]$$&#xA;Multiplying with $(1+\rho dt)$&#xA;$$F(x,t)+\rho F(x,t)dt=\pi(x,t)(1+\rho dt)+E[F(x+dx, t+dt)|x]$$&#xA;$$\rho F(x,t)dt=\pi(x,t)(1+\rho dt)+E[F(x+dx, t+dt)|x]-F(x,t)$$&#xA;$$\rho F(x,t)dt=\pi(x,t)(1+\rho dt)+E[F(x+dx, t+dt)-F(x,t)|x]$$&#xA;$$\rho F(x,t)dt=\pi(x,t)(1+\rho dt)+E[dF|x]$$&#xA;Expanding dF with Itos lemma:&#xA;$$dF=[F_t(x,t)+a(x,t)F_x(x,t)+\frac{1}{2}b(x,t)^2F_{xx}(x,t)]dt+b(x,t)F_x(x,t)dz$$&#xA;Now I can continue.&#xA;$$\rho F(x,t)dt=\pi(x,t)(1+\rho dt)+[F_t(x,t)+a(x,t)F_x(x,t)+\frac{1}{2}b(x,t)^2F_{xx}(x,t)]dt$$&#xA;Divide by $dt$&#xA;$$\rho F(x,t)=\pi(x,t)\frac{1+\rho dt}{dt}+F_t(x,t)+a(x,t)F_x(x,t)+\frac{1}{2}b(x,t)^2F_{xx}(x,t)$$&#xA;Then rearranging I may have.&#xA;$$\frac{1}{2}b(x,t)^2F_{xx}(x,t)+a(x,t)F_x(x,t)+F_t(x,t)-\rho F(x,t)+\pi(x,t)\frac{1+\rho dt}{dt}=0$$&#xA;To have the same equation as in the book i can think of two adjustment/assumptions.&#xA;$\rho dt = 0$ and $\pi(x,t)$ needs to be replaced with $\pi(x,t)dt$ in the first Bellman equation. Is this how equation (13) is achieved or am I missing something?&lt;/p&gt;&#xA;" OwnerUserId="5489" LastActivityDate="2015-01-28T10:51:45.123" Title="Dixit &amp; Pindyck (1993) Chapter 4, equation 13" Tags="&lt;itos-lemma&gt;&lt;differential-equations&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16373" PostTypeId="2" ParentId="16336" CreationDate="2015-01-28T12:58:33.460" Score="1" Body="&lt;p&gt;With this solution you have to split your covariance matrix somewhat, but it should give you a vector with betas based on you conditional covariances. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example with two indexes, $x1$ and $x2$, and one asset $y$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$[\sigma_{y,x1}, \sigma_{y, x2}]\begin{bmatrix} \sigma_{x1}^2 &amp;amp; \sigma_{x1,x2} \\ \sigma_{x1,x2} &amp;amp; \sigma_{x2}^2 \end{bmatrix}^{-1}$$&lt;/p&gt;&#xA;" OwnerUserId="5489" LastActivityDate="2015-01-28T12:58:33.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16374" PostTypeId="1" CreationDate="2015-01-28T12:58:43.863" Score="2" ViewCount="392" Body="&lt;p&gt;I am trying to estimate the parameters of the GARCH(1,1) model with MCMC method, firstly, I read the paper:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://mpra.ub.uni-muenchen.de/12985/1/MPRA_paper_12985.pdf&quot; rel=&quot;nofollow&quot;&gt;http://mpra.ub.uni-muenchen.de/12985/1/MPRA_paper_12985.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Metropolis Hasting method is used in the article, but the sampler of parameters, I mean the constant, arch parameter and garch parameter for the conditional variance, are sampled from distribution built by an auxiliary distribution. My question is that, as we could build the likelihood function, then why we need to sample from the auxiliary distribution but not sample from a normal distribution and implement the random walk Metropolis Hasting algorithm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually, I have tried the random walk algorithm but all parameters can not convergent, i do not know the reason. But if I fixed two parameters, supposed we know them, then the unknown parameter can be estimated by random walk Metropolis Hasting algorithm well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;New in this field, thanks.&lt;/p&gt;&#xA;" OwnerUserId="15201" LastActivityDate="2015-01-28T12:58:43.863" Title="Why random walk Metropolis Hasting algorithm works bad on GARCH(1,1) parameters estimation" Tags="&lt;garch&gt;" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16376" PostTypeId="1" CreationDate="2015-01-28T18:27:49.750" Score="0" ViewCount="72" Body="&lt;p&gt;Is there something similar to the VIX but related to the convertibles bonds market in the U.S. ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&#xA;Max.&lt;/p&gt;&#xA;" OwnerUserId="13942" LastActivityDate="2015-01-28T18:27:49.750" Title="VIX For Convertible Bonds" Tags="&lt;convertible-bond&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16379" PostTypeId="2" ParentId="16365" CreationDate="2015-01-28T23:33:26.733" Score="4" Body="&lt;p&gt;it depends on asset class. In some classes, the future is more liquid than the underlying eg oil so it makes more sense to work with its volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, the forward price and the spot price only have the same volatility if we assume deterministic interest rates. For short-dated equity type products, this is reasonable. For long-dated products and interest rate products, this is not a good modelling assumption.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-01-28T23:33:26.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16380" PostTypeId="1" CreationDate="2015-01-29T00:24:36.767" Score="4" ViewCount="168" Body="&lt;p&gt;Let's say we have option strike price equal to current stock price. And we have zero risk-free rate. In this case I assume that probability of exercise is 0.5 because chances that price will go up or down are equal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I understand $N(D_2)$ is exactly the probability of exercise and it should be 0.5 . It means that $D_2$ should be 0 in this case. But if we put equal current and strike price and zero rate in its formula it will not be zero:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$D_2=(Ln(S/K) + (r - 0.5*Vol^2)*t)/(Vol*Sqrt(t))$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here $Ln(S/K)$ and $r$ become zero, but we still have $-0.5*Vol^2*t/(Vol*Sqrt(t))$ that is not zero. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where is the mistake?&lt;/p&gt;&#xA;" OwnerUserId="15205" LastActivityDate="2015-01-29T00:33:35.980" Title="Black-Scholes: If exercise probability is 0.5, should $D_2$=0?" Tags="&lt;black-scholes&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16381" PostTypeId="2" ParentId="16380" CreationDate="2015-01-29T00:33:35.980" Score="4" Body="&lt;p&gt;expectations and medians are different things. If the strike is at the median, you get 0.5. However, the median of the log is lower and is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\log S_0 - 0.5 \sigma^2 T&#xA;$$&#xA;The median of $S_T$ is the exp of this. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-01-29T00:33:35.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16382" PostTypeId="2" ParentId="16353" CreationDate="2015-01-29T02:26:00.903" Score="1" Body="&lt;p&gt;The answer depends somewhat on the type of bond.  An odd lot of corporate bonds may be different than municipal bonds or US Government Agencies.  Generally speaking, an odd lot would be any trade under $100,000 in face value.  &lt;/p&gt;&#xA;" OwnerUserId="15206" LastActivityDate="2015-01-29T02:26:00.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16383" PostTypeId="1" AcceptedAnswerId="16386" CreationDate="2015-01-29T06:06:48.290" Score="3" ViewCount="1056" Body="&lt;p&gt;I am looking at trading bets on tennis, football and horse racing in particular as these appear to have the most liquidity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How much background research and how much trial and error is generally needed to trade confidently with some knowledge of how the prices will move? Also how big of a bankroll do you suggest starting with?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The exchanges I am looking into currently are www.Betfair.com and www.WBX.com, however I have read that Betfair has a 60% premium charge for long term winning accounts, does this generally affect traders if dealing with multiple trades daily? I am hoping to get it to a level where I make a consistent ~£100-200/daily profit to supplement my income and continue to work my way up from there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any advice is truly appreciated, thank you in advance!&lt;/p&gt;&#xA;" OwnerUserId="15207" LastEditorUserId="20795" LastEditDate="2019-09-22T20:25:44.470" LastActivityDate="2019-09-22T20:25:44.470" Title="Which sports are generally the best for trading on betting exchanges for a profit?" Tags="&lt;risk&gt;&lt;exchange&gt;&lt;betting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16385" PostTypeId="1" AcceptedAnswerId="16390" CreationDate="2015-01-29T07:46:53.040" Score="1" ViewCount="5295" Body="&lt;p&gt;Using the Bloomberg open API, I am trying to program a C++ script that is able to download option volatility data from Bloomberg. I currently do not have access to Bloomberg, but in the coming week I will be able to access a Bloomberg terminal to try out my script.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In which field are the individual option volatilities saved? I know that the last price field would be PX_LAST or LAST_PRICE, but have no idea in which field / format the option volatility would be accessible.&lt;/p&gt;&#xA;" OwnerUserId="5350" LastActivityDate="2015-01-29T13:01:46.440" Title="Bloomberg equity option volatility data" Tags="&lt;volatility&gt;&lt;programming&gt;&lt;bloomberg&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16386" PostTypeId="2" ParentId="16383" CreationDate="2015-01-29T08:19:06.723" Score="2" Body="&lt;p&gt;Have a read of the paper posted here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://prescientmuse.blogspot.co.uk/2015/01/mixed-martial-arts-fight-outcome.html&quot; rel=&quot;nofollow&quot;&gt;http://prescientmuse.blogspot.co.uk/2015/01/mixed-martial-arts-fight-outcome.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It pertains to MMA but expounds on research method and what a profitable strategy may look like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wouldn't suggest liquid sports at all. Liquidity will imply often imply prices which correct quickly to represent the best guess at the underlying probability. Also have a look here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://prescientmuse.blogspot.co.uk/2015/01/assumptions-to-avoid-when-predicting-mma.html&quot; rel=&quot;nofollow&quot;&gt;http://prescientmuse.blogspot.co.uk/2015/01/assumptions-to-avoid-when-predicting-mma.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Again, it pertains to MMA but most of the advice is generally applicable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're predicting price movements then you need only so much capital as to cover some multiple of the variance of your strategy. I you're intending to be a market maker on illiquid sports then you need a lot more capital.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as exchanges go, also have a look at smarkets.com which do not have a premium fee and charge 2% commission.&lt;/p&gt;&#xA;" OwnerUserId="15208" LastActivityDate="2015-01-29T08:19:06.723" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16387" PostTypeId="2" ParentId="14679" CreationDate="2015-01-29T09:04:14.130" Score="2" Body="&lt;p&gt;I cannot guarantee that it is error-free, but this &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2527818&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; (appendix A) has a relatively straightforward derivation of the Heston price for a european call.&lt;/p&gt;&#xA;" OwnerUserId="5208" LastActivityDate="2015-01-29T09:04:14.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16389" PostTypeId="1" CreationDate="2015-01-29T11:30:59.580" Score="1" ViewCount="212" Body="&lt;p&gt;What are some possible sources to obtain Eurex level 2 historical order book data from?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately I have only been able to find 1 source - namely Eurex itself, which charges 2000 Euro/month for the last 3 months and 1500 Euro/month for older months.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That, however, gives you the entire exchange. I was hoping the cherry pick the instruments I needed, e.g. maybe only the 10y bund future and thus get to a more reasonable quote of a few hundred per month?&lt;/p&gt;&#xA;" OwnerUserId="2410" LastActivityDate="2015-02-28T00:25:32.457" Title="Where to obtain Eurex level 2 historical order book data from?" Tags="&lt;market-data&gt;&lt;futures&gt;&lt;eurex&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16390" PostTypeId="2" ParentId="16385" CreationDate="2015-01-29T13:01:46.440" Score="2" Body="&lt;p&gt;For real time you could use &lt;code&gt;IVOL_MID_RT&lt;/code&gt; (or ASK or BID) and for historical data &lt;code&gt;IVOL_MID&lt;/code&gt; (or ASK or BID).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the vol is derived from the mid price using a B&amp;amp;S model (PDE for american options).&lt;/p&gt;&#xA;" OwnerUserId="2393" LastActivityDate="2015-01-29T13:01:46.440" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16391" PostTypeId="2" ParentId="15560" CreationDate="2015-01-29T15:39:29.393" Score="2" Body="&lt;p&gt;No, 9th character is computed using deterministic algorithm described here: &lt;a href=&quot;http://en.wikipedia.org/wiki/CUSIP#Check_digit_pseudocode&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/CUSIP#Check_digit_pseudocode&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="15210" LastActivityDate="2015-01-29T15:39:29.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16392" PostTypeId="1" AcceptedAnswerId="16539" CreationDate="2015-01-29T15:54:53.793" Score="5" ViewCount="1075" Body="&lt;p&gt;I'm building database of 13F sec.gov forms with 13F security lists (&lt;a href=&quot;http://www.sec.gov/divisions/investment/13flists.htm&quot; rel=&quot;noreferrer&quot;&gt;http://www.sec.gov/divisions/investment/13flists.htm&lt;/a&gt;). Along with integrity checks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I implemented CUSIP digit check algorithm to check if I'm getting correct CUSIP numbers and don't mess anything while parsing PDFs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found that half of CUSIP numbers on 13F Security Lists are incorrect - checksum digit is different than computed by algorithm checksum (algorithm described here: &lt;a href=&quot;http://en.wikipedia.org/wiki/CUSIP#Check_digit_pseudocode&quot; rel=&quot;noreferrer&quot;&gt;http://en.wikipedia.org/wiki/CUSIP#Check_digit_pseudocode&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, take 3rd page of &lt;a href=&quot;http://www.sec.gov/divisions/investment/13f/13flist2014q3.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.sec.gov/divisions/investment/13f/13flist2014q3.pdf&lt;/a&gt; where you can find line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;D18190 90 8 DEUTSCHE BANK AG CALL&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We read CUSIP from line as D18190908. Now, check this against available on-line CUSIP validator (i.e.: &lt;a href=&quot;http://www.topyields.nl/validate-cusip.php&quot; rel=&quot;noreferrer&quot;&gt;http://www.topyields.nl/validate-cusip.php&lt;/a&gt;) and you'll get that this CUSIP is INVALID!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From algorithm I'm getting checksum digit equals to 6 so CUSIP should got as D1819090&lt;strong&gt;6&lt;/strong&gt;. Check this modified CUSIP against on-line validator and you'll see replacing 8 with 6 makes CUSIP valid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've done some more research to check if it's not some one time error and found that 50% of CUSIPS in 10 most recent 13F Security Lists are invalid the same way as described in example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have you faced this issue? Whats wrong with 13F Security Lists?&lt;/p&gt;&#xA;" OwnerUserId="15210" LastEditorUserId="15210" LastEditDate="2015-01-29T18:53:09.173" LastActivityDate="2015-02-11T20:12:42.300" Title="SEC 13F Security List has incorrect CUSIP numbers?" Tags="&lt;data&gt;&lt;database&gt;&lt;sec&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16393" PostTypeId="1" CreationDate="2015-01-29T18:13:52.317" Score="1" ViewCount="488" Body="&lt;p&gt;What indicator (or combination of those) could be used to roughly estimate the cheapness of a convertible bonds ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like the price/earning ratio for equities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&#xA;Max.&lt;/p&gt;&#xA;" OwnerUserId="13942" LastActivityDate="2015-01-30T14:22:18.707" Title="Cheapness indicator for Convertibles Bonds" Tags="&lt;fixed-income&gt;&lt;indicator&gt;&lt;convertible-bond&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16394" PostTypeId="2" ParentId="16393" CreationDate="2015-01-29T18:22:13.680" Score="0" Body="&lt;p&gt;For a rough estimate you can compare the value against a straight bond (one without options). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\textrm{Premium over straight value} = \frac{\textrm{Convertible bond price}}{\textrm{Straight value}} - 1.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taken from the CFA Level II curriculum Volume 5.&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="848" LastEditDate="2015-01-30T14:22:18.707" LastActivityDate="2015-01-30T14:22:18.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16395" PostTypeId="1" CreationDate="2015-01-30T00:30:38.937" Score="10" ViewCount="1392" Body="&lt;p&gt;My question is about best practices for reconstructing volatility smiles for a fixed tenor from American option data. For simplicity/liquidity, I am currently considering options on SPY. I am currently having difficulty merging together information from calls and puts to construct the entire smile in a unified way. The resources I have found first recommend to construct the surface from the out-of-the-money options of both types, so I am selecting an ATM strike, solving for the implied repo rate at that strike, and then constructing the vol surface by calculating implied volatilities from end of day mid prices on those out of the money options using that repo rate. The problem with this is that the skews from the call and put sections do not line up creating a kink at the strike at which I join the surface. This kink causes a load of arbitrage violations, see the image below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am wondering what is the standard way to correct for this? One thing I can think of that may help would be to calculate an implied repo for each shared strike, but then we are digging into some in-the-money-options for which put-call parity has less reason to hold. On the same note is it even ok to back out implied repos from ATM American option prices given that put-call parity technically doesn't hold for them? Is there an alternative procedure for getting the appropriate rate?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, that I am currently using European BS to derive the implied volatilities but for OTM options I would hope the early exercise premium would be small and not be affecting the skew this much. Note: I have implemented the BAW American option approximation formula separately and the skews appear to match worse (but this may be a bug!).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is somewhat related to &lt;a href=&quot;https://quant.stackexchange.com/questions/2906/what-causes-the-call-and-put-volatility-surface-to-differ&quot;&gt;this question&lt;/a&gt; although it is more of an extension.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is an example of the difference in skew for SPY options at the March 2015 regular expiry (puts are blue, calls are green). Note the kink at strike ~205.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://imgur.com/EgbiDIR.png&quot; alt=&quot;vol smile example&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="15212" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2019-08-19T13:36:15.247" Title="Constructing Volatility Smile from American Options" Tags="&lt;volatility&gt;&lt;american-options&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="16399" PostTypeId="1" CreationDate="2015-01-30T12:35:05.967" Score="3" ViewCount="183" Body="&lt;p&gt;I have a little problem evaluating an european call. I Suppose the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in $$t=0      : S_0 = 10$$&#xA;$$t = 1      : S_1 = \{10,11\}~with ~p=0.5$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;riskless rate : $(1+r)=\beta=1.049$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Strike price: $K=10$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the author of my paper states that the value of the call must be $V_0 &amp;lt; 1/\beta (11 - 10) * 0.5 = 0.477$ in order to avoid arbitrage. Can anyone see how this is the case? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am aware that the stock is not valued with respect to the fair valuation after cox rubinstein which would be $S_0=10.5$. If then $K=10.5$ and for example $V_0=0.5$ i could construct arbitrage by: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;in $t=0$: Sell 2 calls and buy a zerobond. If $P$ denotes the portfolio value I have $P_0=2*0.5-1=0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in $t=1$ when $S_1=10~P_1=1.049-2*0&amp;gt;0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in $t=1$ when $S_1=11~P_1=1.049-2*(11-10.5)&amp;gt;0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;=&gt; arbitrage&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For $S_0=10$: for $V_0 &amp;gt; 1/\beta$ i see that one can short the call and buy a zerobond instead which lets me pay my liability in period 1 in any case just as above.&lt;/p&gt;&#xA;" OwnerUserId="15218" LastEditorUserId="15218" LastEditDate="2015-02-02T10:06:14.287" LastActivityDate="2015-02-02T10:18:26.293" Title="arbitrage opportunity in a two period model" Tags="&lt;arbitrage&gt;&lt;probability&gt;&lt;call&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16400" PostTypeId="1" CreationDate="2015-01-30T13:28:50.547" Score="1" ViewCount="148" Body="&lt;p&gt;What does it mean to implement a delta-neutral strategy for straddle ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A straddle consists in buying a call and a put simultaneously, at the same date, on same underlying, with same maturity and strike. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is possible to gain from a move up or down of underlying price, when move compensates for the primes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What about a gain in a straddle strategy from delta-neutral management ? &lt;/p&gt;&#xA;" OwnerUserId="6369" LastActivityDate="2015-01-30T13:28:50.547" Title="Straddle neutral strategy" Tags="&lt;options&gt;&lt;quant-trading-strategies&gt;&lt;greeks&gt;&lt;delta-hedging&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16402" PostTypeId="2" ParentId="16393" CreationDate="2015-01-30T13:57:21.650" Score="1" Body="&lt;p&gt;The above gives you the value of the option in the convertible bond. Next step, look at the price of an exchange-traded option to see what the embedded convertible bond option is worth. That can tell you if the convertible bond is over or under priced - compare the market value of the option to the implied price of the option (scaling prices to the same number of shares).&lt;/p&gt;&#xA;" OwnerUserId="12142" LastActivityDate="2015-01-30T13:57:21.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16404" PostTypeId="1" CreationDate="2015-01-30T21:13:02.170" Score="1" ViewCount="233" Body="&lt;p&gt;according to the BS formula, $\gamma = \frac{N'(d_1)}{S_0\sigma\sqrt{T}}$, gamma will decrease when volatility increase.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does it intuitively make sense? rather than from the formula.&lt;/p&gt;&#xA;" OwnerUserId="15180" LastActivityDate="2015-01-31T04:50:31.153" Title="European vanilla call/put option, when volatility increases, how will gamma changes?" Tags="&lt;volatility&gt;&lt;gamma&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16405" PostTypeId="2" ParentId="16404" CreationDate="2015-01-31T04:50:31.153" Score="2" Body="&lt;p&gt;For ATMish options, as vol goes higher, the option looks even more ATM. That is, at higher vol, the difference between a 99% strike option and a 100% strike option is less pronounced than if vol were low; hence your deltas won't change as fast as spot moves and thus, less gamma. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For far OTM options, its the opposite. They would have very little delta at low vol, and remain dead even as you start to move a little closer to them, so have little gamma. However as vol picks up, its like the options are less OTM, so start to have some more gamma.&lt;/p&gt;&#xA;" OwnerUserId="15229" LastActivityDate="2015-01-31T04:50:31.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16406" PostTypeId="2" ParentId="16368" CreationDate="2015-01-31T05:07:16.997" Score="0" Body="&lt;p&gt;Perhaps the better question is why is it that OTM options do have volga? ATM options have the most vega. As volatility rises, OTM options look more like ATM options, so you would expect them to increase in vega as well. (And really really far OTM options are still gonna look like really really far OTM options, giving rise to the bimodal shape of a volga by strike graph).&lt;/p&gt;&#xA;" OwnerUserId="15229" LastActivityDate="2015-01-31T05:07:16.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16407" PostTypeId="2" ParentId="15699" CreationDate="2015-01-31T05:20:46.187" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;This is why the rate used is the risk-free rate.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Except its not. Cost of capital is used for the forward (price of total return swap), cost of collateral (OIS for OTC, box rates for listed) is used for the discounting. &lt;/p&gt;&#xA;" OwnerUserId="15229" LastActivityDate="2015-01-31T05:20:46.187" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16408" PostTypeId="1" CreationDate="2015-01-31T16:49:02.457" Score="0" ViewCount="983" Body="&lt;p&gt;I am actually trying to solve some exercise problem using Monte-Carlo and C++ for exotic options. Namely, the exotic options are geometric Asian options and discrete barrier option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is claimed that using log values would enable to get accurate pricing using &quot;fewer approximations” and though results in a gain of time required for computing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried to look all over the place to see where I could get some hint but failed to do so.&lt;/p&gt;&#xA;" OwnerUserId="15234" LastEditorUserId="467" LastEditDate="2015-03-06T09:26:28.593" LastActivityDate="2015-03-08T11:07:27.830" Title="How to price exotic options using Monte-Carlo?" Tags="&lt;options&gt;&lt;monte-carlo&gt;&lt;exotics&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16411" PostTypeId="1" AcceptedAnswerId="16412" CreationDate="2015-01-31T19:59:49.883" Score="2" ViewCount="347" Body="&lt;p&gt;Suppose $S_t$ is the stock price and follows the dynamics $$dS_t=\mu S_tdt+\sigma S_tdW_t$$.  According to Girsanov, we can apply change of measure and obtain $dS_t=r S_tdt+\sigma S_tdW_t^Q$, this implies $\ln S_T = \ln S_0+rT+\sigma W_T^Q$, and therefore $$\mathbb{E}^Q[S_T]=S_0 e^{rT+\frac{1}{2}\sigma^2T}$$, however $\mathbb{E}^Q[S_T]=S_0e^{rT}$ by Fundamental Theorem of Asset Pricing, which is contradicted.  Please correct me.&lt;/p&gt;&#xA;" OwnerUserId="15235" LastActivityDate="2015-10-20T04:19:12.500" Title="Why do we need $dS_t=r S_tdt+\sigma S_tdW_t^Q$?" Tags="&lt;option-pricing&gt;&lt;girsanov&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16412" PostTypeId="2" ParentId="16411" CreationDate="2015-01-31T21:10:12.877" Score="4" Body="&lt;p&gt;It doesn't imply&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \ln S_T=\ln S_0+rT+σW^Q_T,$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;it implies&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \ln S_T=\ln S_0+(r-0.5\sigma^2)T+σW^Q_T.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Look up Ito's lemma.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is covered in just about any book on financial maths including my own Concepts etc.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastEditorUserId="1809" LastEditDate="2015-10-20T04:19:12.500" LastActivityDate="2015-10-20T04:19:12.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16413" PostTypeId="2" ParentId="16411" CreationDate="2015-01-31T21:10:27.357" Score="1" Body="&lt;p&gt;If $dS_t = r S_t \, dt + \sigma S_t \, dW_t^Q$, &#xA;$$S_T = S_0 \, e^{\sigma W_T^Q + \left( r - \frac{1}{2} \sigma^2\right) T}\, .$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence $\mathbb{E}\left[ S_T \right] = S_0 \, e^{rT} \,.$&lt;/p&gt;&#xA;" OwnerUserId="3188" LastActivityDate="2015-01-31T21:10:27.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16414" PostTypeId="1" CreationDate="2015-02-01T01:59:15.860" Score="1" ViewCount="245" Body="&lt;p&gt;I am trying to understand how the first passage time density of Brownian motion with drift is modified by the presence of waiting times that are distributed as a power law&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, what is the density function for first passage time of a Brownian motion with drift when the movement &quot;pauses&quot; for time intervals that follow a power law distribution&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe the density function would be the convolution of inverse Gaussian and power law distributions. Is there an expression for this? Any help would be much appreciated&lt;/p&gt;&#xA;" OwnerUserId="4888" LastActivityDate="2015-02-01T01:59:15.860" Title="Convolution of inverse gaussian and power law distributions" Tags="&lt;brownian-motion&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16415" PostTypeId="1" CreationDate="2015-02-01T03:15:55.050" Score="1" ViewCount="122" Body="&lt;p&gt;I have past data which is in vector form. The information shows the probabilities of a AAA rated company to migrate to another credit rating. So for example, (x1, x2, x3) has the probabilities of moving from AAA to AAA, AA or A.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I take the correlation matrix between all these vectors, and so I end up with a 3x3 matrix, what is the interpretation of the resulting matrix?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, what does it mean to take a correlation matrix associated with an initial rating state&lt;/p&gt;&#xA;" OwnerUserId="15239" LastEditorUserId="15239" LastEditDate="2015-02-01T13:14:54.220" LastActivityDate="2015-02-01T13:14:54.220" Title="Interpretation of Correlation Matrix" Tags="&lt;correlation-matrix&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16416" PostTypeId="1" CreationDate="2015-02-01T17:45:16.203" Score="2" ViewCount="749" Body="&lt;p&gt;I am following &lt;em&gt;Risk and asset allocation&lt;/em&gt; (Attilio Meucci,2007). I must say I am enjoying this reading quite a lot so I hope nobody takes my question as a critique on the text.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When we are introduced to the Bayesian approach in asset-allocation we realise we need to specify a joint distribution for the mean and variance of the data (respectively $\mu, \Sigma$) to obtain a prior we can plug in the Bayes formula.&#xA;We recall that $ f(\mu, \Sigma) = f(\mu | \Sigma)f(\Sigma) $.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So For the conditional mean $\mu|\Sigma$ the text chooses a normal:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mu|\Sigma \sim N\Bigg(\mu_0 , \frac{\Sigma}{T_0}\Bigg)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seem like a good choice that is also pretty intuitive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead the text models the variance ,$\Sigma$, as an inverse Wishart distribution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$  \Omega = \Sigma^{-1} \sim W\Bigg( v_0, \frac{\Sigma^{-1}}{v_0}  \Bigg)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The text then goes on to give some explanations but I was wondering: are there any intuitive reasons why this is a good way to model variance?&lt;/p&gt;&#xA;" OwnerUserId="15188" LastActivityDate="2015-02-01T18:23:34.450" Title="Why model the variance-covariance matrix as an inverse-Wishart distribution in bayesian portfolio analysis?" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;bayes-theory&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16417" PostTypeId="2" ParentId="16416" CreationDate="2015-02-01T18:23:34.450" Score="4" Body="&lt;p&gt;If you give a covariance matrix an inverse Wishart prior, then it simplifies a lot of math in the calculations. This is called a conjugate prior. If you don't understand conjugate priors, you might want to work through the math on the univariate normal case with an inverse gamma or chi square prior for the variance. The Wishart distribution is just a generalization of chi square or gamma to multivariate. Since you use inverse gamma or chi square for variance, you do the inverse of the covariance matrix when generalizing to multivariate. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2015-02-01T18:23:34.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16421" PostTypeId="1" CreationDate="2015-02-02T08:17:14.827" Score="1" ViewCount="34" Body="&lt;p&gt;I have a question concerning the idea of consumption in multi period. The following is given&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C_1=W_0-xS_1+B$$&#xA;$$C_2=xS_2-BR$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$W_0$ is initial wealth&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$x$ is the weight on an asset with price / value $S_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$B$ is a zerobond at some riskless rate $1&amp;lt;R&amp;lt;2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the question: how can it be justified (or can it at all be?) that the agent's only chance to transfer money into the second period is via buying the risky asset $S_1$ and not by buying zerobonds? would it not be much more realistic if one had&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C_1=W_0-xS_1\pm B$$&#xA;$$C_2=xS_2\pm BR$$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance for any suggestions.&lt;/p&gt;&#xA;" OwnerUserId="15218" LastActivityDate="2015-05-08T01:24:02.940" Title="convention in borrowing money in a multiperiod model" Tags="&lt;bond&gt;&lt;utility-theory&gt;&lt;bond-portfolio&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16423" PostTypeId="1" CreationDate="2015-02-02T09:19:55.377" Score="6" ViewCount="333" Body="&lt;p&gt;When observing bid/offer in the market I came across a question. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How much trading a bond would impact its spread for subsequent trades ie. what is the impact on bid/offer due to volume/size of recently palced trades.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The size of trades placed in market with impact the liquidity , demand supply , market sentiment etc. I know it is hard to predict how much the spreads will move after a trade /trades of specific size are placed in market. But is there is reasonble assumption that practitioners make ? Any pointers on existing research will be great too .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT :&lt;/strong&gt; &#xA;This is indeed a very hard thing to compute. This is not an extensive list of explanatory variables but one can say that –&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Spreads will be inversely related to the market maker's ability to hedge his positions&lt;/li&gt;&#xA;&lt;li&gt;Spreads will be directly related to volatility of the security&lt;/li&gt;&#xA;&lt;li&gt;Spreads will be directly related size and frequency of quotes from Market makers. Some aggregation using ALL QUOTES of Bloomberg should help us estimate this.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I believe that we can model such a behaviour by &lt;/p&gt;&#xA;&#xA;&lt;p&gt;a.  Either perturbation based approach such as  &lt;a href=&quot;http://www.maths.univ-evry.fr/prepubli/342.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.maths.univ-evry.fr/prepubli/342.pdf&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;b.  Compound Autoregressive possion’s process.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I have something worked out , I will share the results. In the meantime if you have methodology that you use as a practitioner please do share . &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="1386" LastEditorUserId="1386" LastEditDate="2015-02-02T18:46:35.647" LastActivityDate="2015-06-03T13:48:21.357" Title="Impact on bid/offer due to volume/size of trades placed" Tags="&lt;risk&gt;&lt;trading&gt;&lt;spread&gt;&lt;liquidity&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16425" PostTypeId="1" CreationDate="2015-02-02T09:37:37.337" Score="1" ViewCount="174" Body="&lt;p&gt;Let us propose bivariate Black-Sholes Model.&#xA;Assume, we have an arbitrage-free complete market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_{f}$ is risk-free rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under real-world measure $P$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS_{1} (t)=S_{1} (t) [\mu_{1}dt+\sigma_{1}dW_{1,t}^{P}]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS_{2} (t)=S_{2} (t) [\mu_{2}dt+\sigma_{2}dW_{2,t}^{P}]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$corr(W_{1,t},W_{2,t})=\rho$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W_{i,t}^{P}$ is standard Brownian Motion under $P$.&#xA;I have found out that in this model it holds:&#xA;$\mu_{2}-r_{f}=\sigma_{2}(\rho+\sqrt{1-\rho^{2}})\frac{\mu_{1}-r_{f}}{\sigma_{1}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I am not sure, whether the deirvation is right.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does it hold?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The derivation is presented here: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the fact of correlation between two Brownian motions,it holds:&#xA;$W_{2,t}^{P}=\rho W_{1,t}^{P}+\sqrt{1-\rho^{2}}W_{0,t}^{P}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W_{0,t}^{P}$ is Standard Brownian Motion under $P$, indepndent of $W_{1,t}^{P}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, one can rewrite:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS_{1} (t)=S_{1} (t) [\mu_{1}dt+\sigma_{1}dW_{1,t}^{P}]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS_{2} (t)=S_{2} (t) [\mu_{2}dt+\sigma_{2}\rho dW_{1,t}^{P}+\sigma_{2}\sqrt{1-\rho^{2}}W_{0,t}^{P}]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We propose the new measure $Q$, defined by:&#xA;$\frac{dQ}{dP}=exp\{\frac{r_{f}-\mu_{1}}{\sigma_{1}}W_{1,t}-\frac{1}{2}(\frac{r_{f}-\mu_{1}}{\sigma_{1}})^{2}t\}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under this measure&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$W_{1,t}^{Q}=W_{1,t}^{P}+\frac{\mu_{1}-r_{f}}{\sigma_{1}}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$W_{0,t}^{Q}=W_{0,t}^{P}+\frac{\mu_{1}-r_{f}}{\sigma_{1}}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;are Standard Brownian Motions under $Q$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us define &#xA;$W_{2,t}^{Q}=\rho W_{1,t}^{Q}+\sqrt{1-\rho^{2}}W_{0,t}^{Q}$, which is also Standard Browniam Motion under $Q$ correlated with $W_{1,t}^{Q}$ with coefficient $\rho$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence for assets it holds:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS_{1} (t)=S_{1} (t) [r_{f}dt+\sigma_{1}\frac{\mu_{1}-r_{f}}{\sigma_{1}}+\sigma_{1}dW_{1,t}^{P}]=S_{1} (t) [r_{f}dt+\sigma_{1}dW_{1,t}^{Q}]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS_{2} (t)=S_{2} (t) [r_{f}dt+\mu_{2}dt-r_{f}dt+\sigma_{2}\rho (dW_{1,t}^{P}+\frac{\mu_{1}-r_{f}}{\sigma_{1}})-\sigma_{2}\rho\frac{\mu_{1}-r_{f}}{\sigma_{1}} +\sigma_{2}\sqrt{1-\rho^{2}}(W_{0,t}^{P}+\frac{\mu_{1}-r_{f}}{\sigma_{1}})-\sigma_{2}\sqrt{1-\rho^{2}}\frac{\mu_{1}-r_{f}}{\sigma_{1}}]=S_{2} (t) [r_{f}dt+\sigma_{2}\rho dW_{1,t}^{Q}+\sigma_{2}\sqrt{1-\rho^{2}}dW_{0,t}^{Q}+{(\mu_{2}-r_{f})-\sigma_{2}(\rho+\sqrt{1-\rho^{2}})\frac{\mu_{1}-r_{f}}{\sigma_{1}}}dt]=S_{2} (t) [r_{f}dt+\sigma_{2}dW_{2,t}^{Q}+{(\mu_{2}-r_{f})-\sigma_{2}(\rho+\sqrt{1-\rho^{2}})\frac{\mu_{1}-r_{f}}{\sigma_{1}}}dt]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One can see that discounted process of $S_{1}(t)$ is Martingale, hence measure $Q$ is Eqivalent Martingale Measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Accodring to Second Theorem of Asset Pricing it is unique.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, $e^{-r_{f}t} S_{2}(t)$ should be as well martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(\mu_{2}-r_{f})-\sigma_{2}(\rho+\sqrt{1-\rho^{2}})\frac{\mu_{1}-r_{f}}{\sigma_{1}}=0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mu_{2}-r_{f}=\frac{\sigma_{2}}{\sigma_{1}}(\rho+\sqrt{1-\rho^{2}})(\mu_{1}-r_{f})$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance!&lt;/p&gt;&#xA;" OwnerUserId="15184" LastEditorUserId="15184" LastEditDate="2015-02-02T14:18:34.663" LastActivityDate="2015-03-04T16:22:55.740" Title="Bivariate Black-Sholes Model" Tags="&lt;black-scholes&gt;&lt;brownian-motion&gt;&lt;risk-neutral-measure&gt;&lt;girsanov&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16426" PostTypeId="1" CreationDate="2015-02-02T09:41:42.023" Score="3" ViewCount="699" Body="&lt;p&gt;I want to calibrate jointly the drift mu and volatility sigma of a &lt;a href=&quot;https://en.wikipedia.org/wiki/Geometric_Brownian_motion&quot; rel=&quot;nofollow&quot;&gt;geometric brownian motion&lt;/a&gt;,  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\log(S_t) = \log(S_{t-1}) + (\mu - 0.5*\sigma^2) \Delta t + \sigma*\sqrt{\Delta t}*Z_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Z_t$ is a standard normally distributed random variable, and am testing this by generating data $x = \log(S_t)$ via&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x(1) = 0;&#xA;for i = 2:N&#xA;  x(i) = x(i-1) + (mu-0.5*sigma^2)*Deltat + sigma*sqrt(Deltat)*randn;&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and my (log-)likelihood function&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function LL = LL(x, pars)&#xA;  mu    = pars(1);&#xA;  sigma = pars(2);&#xA;  Nt = size(x,2);&#xA;  LL = 0;&#xA;  for j = 2:Nt&#xA;    LH_j = normpdf(x(j), x(j-1)+(mu-0.5*sigma^2)*Deltat, sigma*sqrt(Deltat));&#xA;    LL = LL + log(LH_j);&#xA;  end  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which I maximize using &lt;code&gt;fmincon&lt;/code&gt; (because sigma is constrained to be positive), with starting values 0.15 and 0.3, true values 0.1 and 0.2, and &lt;code&gt;N = Nt = 1000&lt;/code&gt; or 100000 generated points over one year (i.e. $\Delta t$ = 0.0001 or 0.000001).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Calibrating the volatility alone yields a nice likelihood function with a maximum around the true parameter, but for small Deltat (less than say 0.1) calibrating both mu and sigma persistently shows a (log-)likelihood surface being very flat in mu (at least around the true parameter); I would expect also a maximum there; for a reason I think it should be possible to calibrate a GBM model to a data series of 100 stock prices in a year, making the average of Deltat = 0.01.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any sharing of experience or help is greatly appreciated (thoughts passing through my mind: the likelihood function is not right / this is a normal behaviour / too few data points / data generation is not correct / ...?). &lt;/p&gt;&#xA;" OwnerUserId="15097" LastEditorUserId="467" LastEditDate="2015-09-01T06:31:52.240" LastActivityDate="2015-10-01T18:33:12.970" Title="How to get around flat likelihood function when calibrating GBM parameters?" Tags="&lt;volatility&gt;&lt;matlab&gt;&lt;calibration&gt;&lt;log-returns&gt;&lt;parameter-estimation&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16427" PostTypeId="2" ParentId="16399" CreationDate="2015-02-02T09:46:18.213" Score="1" Body="&lt;p&gt;it's a complete market so the price of the call option is determinable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are multiple ways to do it. If the strike is 10 it is particularly easy since the pay-off is $S_1 - 10$ so the value is $S_0 - 10/\beta$ as we can replicate precisely with one unit of $S$ and cash that will be worth $-10$ at time $1$ which $-10/\beta$ units of the cash account today.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value is therefore&#xA;$$10 - 10/1.049 = 0.46722.$$&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-02-02T09:46:18.213" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16428" PostTypeId="2" ParentId="16399" CreationDate="2015-02-02T10:18:26.293" Score="0" Body="&lt;p&gt;finally:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in $t=0$: sell 19  Bonds, sell 2 calls for $V_0=0.5$, buy 2 shares for 10 =&gt; $$P_0=19+2*0.5-20=0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in $t=1,S_1=10$&#xA;$$P_1 = 2*10-19.9481-2*0=0.069&amp;gt;0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in $t=1,S_1=11$&#xA;$$P_1=2*11-19.9481-2*1=0.069&amp;gt;0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;gosh, that took ages.. Thanks anyway!&lt;/p&gt;&#xA;" OwnerUserId="15218" LastActivityDate="2015-02-02T10:18:26.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16429" PostTypeId="2" ParentId="16425" CreationDate="2015-02-02T15:24:59.880" Score="1" Body="&lt;p&gt;The error is in the application of Girsanov theorem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have multivariate Black-Sholes market, however I apply one-dimensional Girsanov theorem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I should apply multi-dimensional Girsanov theorem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then there would be now such equations, except the case for $\rho=1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The alike task is formulated here&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://wwwf.imperial.ac.uk/~mdavis/course_material/SDEIRM/IRM08_PROBLEMS3.PDF&quot; rel=&quot;nofollow&quot;&gt;http://wwwf.imperial.ac.uk/~mdavis/course_material/SDEIRM/IRM08_PROBLEMS3.PDF&lt;/a&gt; [Task 2]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution is here&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://wwwf.imperial.ac.uk/~mdavis/course_material/SDEIRM/IRM08_SOLUTIONS3.PDF&quot; rel=&quot;nofollow&quot;&gt;http://wwwf.imperial.ac.uk/~mdavis/course_material/SDEIRM/IRM08_SOLUTIONS3.PDF&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you guys and sorry for disturbing!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mikhail.&lt;/p&gt;&#xA;" OwnerUserId="15184" LastActivityDate="2015-02-02T15:24:59.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16430" PostTypeId="1" CreationDate="2015-02-02T16:39:33.610" Score="2" ViewCount="320" Body="&lt;p&gt;I am brand new to this forum. I asked this question on the main StackOverflow site and it was suggested that I ask here.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My task is to find a method to quickly calculate the monthly cash flow on nearly 500,000 loans. However, this problem cannot be solved with simple amortization schedules. The loans have a variety of attributes like periodic reset dates, caps, floors and balloon dates. Some are variable, some fixed rate and nearly all of them are aged to some degree (months or years). After running the amortization schedules, I need to input different sets of prepayment speed assumptions, then run it all again… 20 more times!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am currently using Excel on a smaller data-set, but Excel doesn't have the capacity to perform these tasks quickly. A recent test of only 10,000 loans took nearly 5 minutes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For starters, I’d like to know: &#xA;Is anyone aware of any existing companies that already do this? &#xA;Alternatively, If I decide to build something from scratch, what programming language would be most appropriate given the size.  My best estimate is between 5 and 10 billion calculations, maybe more.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance for any and all replies. &lt;/p&gt;&#xA;" OwnerUserId="15246" LastActivityDate="2015-08-02T01:39:44.733" Title="Q regarding amortization of 500,000 loans" Tags="&lt;programming&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16431" PostTypeId="2" ParentId="16423" CreationDate="2015-02-02T18:16:05.530" Score="2" Body="&lt;p&gt;You should turn to market microstructure research. Large and frequent trades can temporarily increase the spread and observed transaction price. Additionaly, trades done near the release of new information ( macro news, firms news,...) most likely need to overcome larger spreads. &lt;/p&gt;&#xA;" OwnerUserId="13950" LastActivityDate="2015-02-02T18:16:05.530" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16432" PostTypeId="2" ParentId="16426" CreationDate="2015-02-02T18:55:33.907" Score="1" Body="&lt;p&gt;This is what often happens in optimization problems, i.e. some direction is almost flat. Google 'preconditioning'. Basically the idea is to rescale the variables, so that the Hessian has approx. same order of magnitude values on the diagonals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, that's not a stationary process, so estimation of mu can be difficult.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW not sure if it's a very good idea to use the 'normpdf' function here. Instead you should probably just write out the complete loglikelihood expression (not sure if that will help though). It seems about right to me though.&lt;/p&gt;&#xA;" OwnerUserId="5636" LastActivityDate="2015-02-02T18:55:33.907" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16434" PostTypeId="2" ParentId="16430" CreationDate="2015-02-02T19:45:05.980" Score="0" Body="&lt;p&gt;I can't comment, so I'll post here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you need the monthly cash flows at the account-level? Or can you group similar mortgages (age, vintage, rates, etc..) and then apply the amortization schedules?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My suggestion is to use a programming language that you're most comfortable with. If you don't need to apply the calculations at the account-level, most languages should be able to handle the size; it's more a question of your computing power.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most banks (over $50 billion in assets) perform similar calculations as part of their stress testing programs. They do so for the same reason you are, to test the sensitivity of the mortgage portfolio with respect to changes in prepayment rates.&lt;/p&gt;&#xA;" OwnerUserId="6437" LastActivityDate="2015-02-02T19:45:05.980" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16435" PostTypeId="2" ParentId="16229" CreationDate="2015-02-02T19:47:56.733" Score="1" Body="&lt;p&gt;Let me first start with your very last equation. There, you just stumbled into an application of the Wong-Zakai decomposition:&#xA;&lt;a href=&quot;http://projecteuclid.org/euclid.aoms/1177699916&quot; rel=&quot;nofollow&quot;&gt;http://projecteuclid.org/euclid.aoms/1177699916&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It essentially says that if a sequence of processes $( M_n )$ converges weakly to a martingale $M$, then the sequence of processes,  $ t \mapsto \int_0^t \Gamma(s)dM_n(s) $ converges weakly to the process $ t \mapsto \int_0^t \Gamma(s)\circ dM_n(s)$, where $\circ$ is the Stratonovich integral (which is Ito integral plus a quadratic variation correction). &#xA;In your case the approximating process con be made to be $M_n(t) = \Delta(t_j^f) W(t)$, $t \in [(t_j, t_{j+1})$, where $( t_j ) $ is a uniform partition on $n$ disjoint intervals of $[0,t]$ and $t_j^f$ is as you defined (which dependens on $n$ ).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having said that the construction of the stochastic integral from first principles starts by noticing that no path wise approach can be applied and hence studying the convergence in the $L^2$ sense. This is standerd and it can be found for exempla in the Karatzas &amp;amp; Shreve stochastic integration and Brownian Motion book, or a different approach can be found in the Stochastic Integration book by Philip Protter.&lt;/p&gt;&#xA;" OwnerUserId="11945" LastActivityDate="2015-02-02T19:47:56.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16437" PostTypeId="1" CreationDate="2015-02-02T20:09:29.823" Score="0" ViewCount="794" Body="&lt;p&gt;I need to make a grid [0,1] with points that are concentrated close to the edges (close to 0 and 1) while the remaining points in the middle can be equally spaced. The reason for doing this is that I know the solution is very sensitive at the edges. Any ideas on how I can do this? &lt;/p&gt;&#xA;" OwnerUserId="6605" LastActivityDate="2015-02-02T23:10:34.333" Title="how to make a nonlinear gird where grid points are not equally spaced?" Tags="&lt;numerical-methods&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16438" PostTypeId="2" ParentId="16437" CreationDate="2015-02-02T23:10:34.333" Score="2" Body="&lt;p&gt;Presumably you are trying to use a finite difference method to solve a differential equation.  The non-uniformity of the grid has an impact on accuracy. Hence, it is useful to include a parameter in the grid-generation algorithm that controls the rate at which the spacing increases away from the boundary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are many approaches for generating non-uniform grids (eg., exponential stretching, etc.) Searching on &quot;numerical grid generation&quot; should provide you with more information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a simple approach where the grid spacing increases geometrically.  For the interval $[0,1/2]$ generate grid points using $x_0 = 0$ and for $k = 1,2,\ldots,n$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$x_k = \frac{\alpha\sum_{j=1}^k(1 + \alpha)^{j-1}}{2[(1 + \alpha)^n-1]}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simply reflect the points across $x = 1/2$ to generate the grid over $[1/2,1].$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Control the spacing and the difference $x_1-x_0$ by choosing appropriate values for the parameters $\alpha &amp;gt;0$ and $n$.  Larger values for $\alpha$ will produce finer grids near the boundary.&lt;/p&gt;&#xA;" OwnerUserId="8153" LastActivityDate="2015-02-02T23:10:34.333" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16439" PostTypeId="2" ParentId="1687" CreationDate="2015-02-03T01:49:06.350" Score="3" Body="&lt;p&gt;A Heat Rate Option is a standard contract traded bi-laterally or on an exchange where the ratio between Electricity at an agreed location and Natural Gas at an agreed location is the strike price for an agreed quantity at an agreed expiration date. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This allows holder the ability to manage the the cost of the Market Implied Heat Rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example if May Henry Hub is \$2.50 mmBtu and ERCOT South Power is \$25.00 MWh, then the Market Implied Heat Rate is 10. An option holder may want to buy a call with a strike price of 12, so they are capped from the risk of higher Market Implied Heat Rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above whitepapers address the operational heat rate performance of a generating plant, which is difficult to replicate in the secondary physical or derivative markets.&lt;/p&gt;&#xA;" OwnerUserId="15256" LastEditorUserId="467" LastEditDate="2015-02-03T10:02:16.140" LastActivityDate="2015-02-03T10:02:16.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16440" PostTypeId="1" CreationDate="2015-02-03T12:18:11.960" Score="1" ViewCount="158" Body="&lt;p&gt;In the context of a mean_variance framework consider an optimizing investor who chooses at time $T$ portfolio weights $w$ so as to maximize the quadratic objective function:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$U(w) = E[R_p] - \frac{\gamma}{2}Var[R_p]= w'\mu -  \frac{\gamma}{2}w'Vw$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $E$ and $Var$ denote the mean and variance of the uncertain portfolio rate of return $R_p = w'R_{T+1}$ to be realized in time $T + 1$ and $\gamma$ is the relative risk aversion coefficient.&#xA;The optimal portfolio weights will be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$w^* = \frac{1}{\gamma}V^{-1}\mu $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could I have a reference that proves this result? preferably a textbook that builds up to it.&lt;/p&gt;&#xA;" OwnerUserId="15188" LastActivityDate="2015-06-25T15:55:25.677" Title="On a source for a mean-variance portfolio optimization result" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16442" PostTypeId="1" CreationDate="2015-02-03T19:22:46.077" Score="4" ViewCount="6469" Body="&lt;p&gt;What is the best way to begin calculations for pairs trading?  I have seen two ways:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Start from the price ratio &lt;code&gt;StockAPrice/StockBPrice&lt;/code&gt; and calculate mean, standard deviation and z-score from  a times series of that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Start with the spread calculated as &lt;code&gt;StockAPrice-StockBPrice*Hedge ratio&lt;/code&gt; (where hedge ratio is just the beta of the regression).  You then  purchase &lt;code&gt;x&lt;/code&gt; shares of stockA an short &lt;code&gt;x*hedge ratio&lt;/code&gt; of stock B, for example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the right way to do it?  If #1 is acceptable, how do you incorporate hedge ratio in that?&lt;/p&gt;&#xA;" OwnerUserId="15258" LastEditorUserId="13635" LastEditDate="2016-08-12T04:52:51.300" LastActivityDate="2019-05-28T12:37:09.403" Title="Calculate spread for pairs trading" Tags="&lt;pairs-trading&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16444" PostTypeId="1" CreationDate="2015-02-04T03:09:17.950" Score="1" ViewCount="139" Body="&lt;p&gt;Is it true that in foreign exchange markets, dealer spreads are lower for smaller order and increases for larger orders? This seems counter-intuitive when compared to other markets where dealer spreads would decrease for larger orders due to efficiencies of scale.&lt;/p&gt;&#xA;" OwnerUserId="11815" LastActivityDate="2015-05-05T11:19:08.240" Title="Foreign exchange - Dealer spreads and order size" Tags="&lt;spread&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16445" PostTypeId="1" AcceptedAnswerId="16447" CreationDate="2015-02-04T03:50:59.983" Score="3" ViewCount="615" Body="&lt;p&gt;The question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a person with constant relative risk aversion p.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(a) Suppose the person has wealth of 100,000 and faces a gamble in which he wins or loses x with equal probabilities. Calculate the amount he would pay to avoid the gamble, for various values of p (say, between 0.5 and 40), and for x=100, x=1000, x=10,000 and x= 25000. For large gambles, do large values of p seem reasonable? What about small gambles?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(b) Suppose p &gt; 1 and the person has wealth w. Suppose he is offered a gamble in which he loses x or wins y with equal probabilities. Show that he will reject the gamble no matter how large y is if  p &gt;= (log(0.5)+log(1-x/w))/log(1-x/w).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure where to start with this. Am I solving for the risk premium and multiplying by w?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that for someone with CRRA utility u(w)= (1/(1-p))w^(1-p) and that an individual will pay pi(w) to avoid the gamble if u((1-pi)w)=E[u(1+epsilon tilda)w)]. But I'm not sure how to apply this information to solve the question. Any help is appreciated.&lt;/p&gt;&#xA;" OwnerUserId="15262" LastActivityDate="2017-09-29T10:56:15.833" Title="Constant Relative Risk Aversion" Tags="&lt;risk&gt;&lt;optimization&gt;&lt;portfolio-optimization&gt;&lt;asset-pricing&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16446" PostTypeId="2" ParentId="16444" CreationDate="2015-02-04T08:30:59.923" Score="1" Body="&lt;p&gt;Yes, and no. First large orders often get smaller spreads than small orders, because of efficiency gains for the market-maker. However, large orders also tend to have larger spreads. The reason for this is that large orders may contain additional information about the future price which is at the expense of the market-maker in the interdealer market. But some dealers like to attract such kind of orders and information, thus offering lower spreads (to some of their clients).&lt;/p&gt;&#xA;" OwnerUserId="13950" LastActivityDate="2015-02-04T08:30:59.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16447" PostTypeId="2" ParentId="16445" CreationDate="2015-02-04T08:38:22.683" Score="2" Body="&lt;p&gt;if you have $p=0.5$ For example: $U(w)=ln(2w)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;why is that? relative risk aversion is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$RRA=\frac{-wU''(w)}{U('w)}=\frac{-w*(-1/4w^2)}{1/2w}=0.5$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you can apply your formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;take for example: $x= 10000$ and $\pi=0.5=1-\pi.$&#xA;then expected utility is equal to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$EU(x,w)=0.5*ln(2*(w+x))+0.5*ln(2*(w-x))=0.5ln(220000)+0.5ln(180000)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you want to know $RP:Risk~premium$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so you need to solve $U(w-RP)=EU(x,w)=0.5ln(220000)+0.5ln(180000)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or $ln(200000-2RP)=12.20$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;from which follows that $$RP=\frac{200000 -e^{12,2}}2=501.25$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is the amount the investor is ready to pay in order to avoid the gamble.&lt;/p&gt;&#xA;" OwnerUserId="15218" LastEditorUserId="15218" LastEditDate="2015-02-05T10:04:28.363" LastActivityDate="2015-02-05T10:04:28.363" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16448" PostTypeId="2" ParentId="16408" CreationDate="2015-02-04T08:49:35.610" Score="2" Body="&lt;p&gt;You can use:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Antithetic_variates&quot; rel=&quot;nofollow&quot;&gt;Antithetic variates&lt;/a&gt; and;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Control_variates&quot; rel=&quot;nofollow&quot;&gt;Control variates&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Both are variance reduction techniques which will allow you to use fewer paths/simulations. Usually antithetic variates are very efficient on their own. Combining both can be a bit tricky.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could start by simulating the value of a plain vanilla call. Then include antithetic variates and/or control variates. The &quot;right value&quot; can be obtained via BS's closed form solution. You'll see which model converges faster towards the BS-value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Same could be done if you have a closed form solution for your more complex derivative. Rubinstein/Reiner i think offer closed form for barrier options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using log-values is (i think) more common in finite-difference-methods where you try to find the value of a derivative by approximating the Black Scholes PDE.&lt;/p&gt;&#xA;" OwnerUserId="6748" LastEditorUserId="467" LastEditDate="2015-03-06T09:30:23.077" LastActivityDate="2015-03-06T09:30:23.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16449" PostTypeId="1" AcceptedAnswerId="16450" CreationDate="2015-02-04T11:30:26.983" Score="3" ViewCount="2569" Body="&lt;p&gt;I am simulating a spread option with stochastic volatility using Monte Carlo simulation. I have the positive-definite covariance matrix &#xA;$$&#xA;\rho = \left( \begin{array}{cccc}&#xA;1 &amp;amp; \rho_{1,2} &amp;amp; \rho_{1,3} &amp;amp; \rho_{1,4} \\&#xA;\rho_{2,1} &amp;amp; 1 &amp;amp; \rho_{2,3} &amp;amp; \rho_{2,4} \\&#xA;\rho_{3,1} &amp;amp; \rho_{3,2} &amp;amp; 1 &amp;amp; \rho_{3,4}\\&#xA;\rho_{4,1} &amp;amp; \rho_{4,2} &amp;amp;  \rho_{4,3} &amp;amp; 1 \end{array} \right) &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which by definition can be decomposed into the product of two matrixes through Cholesky decomposition in the following way:&#xA;$$&#xA;\rho = L L^T&#xA;$$&#xA;where $T$ indicates the transposed matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the literature, this factorization renders a system of equations of the form:&#xA;$$&#xA;x_1 = z_1 \\&#xA;x_2 = \rho_{1,2} z_1 + \sqrt{1 - \rho_{1,2}^2z_2} \\&#xA;x_3 = ...&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is the following. Why do we ignore the matrix $L^T$ when writing the final equations for the random deviates? Why isn't this approach leading to wrong equations, given that we are 'ignoring' part of the system? It seems like we are forgetting half of the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know this is the correct way to compute random deviates, but I would like to know the reason why this approach works.&lt;/p&gt;&#xA;" OwnerUserId="15099" LastEditorUserId="15099" LastEditDate="2015-02-04T15:35:55.007" LastActivityDate="2015-02-04T15:35:55.007" Title="Covariance matrix and Cholesky decomposition" Tags="&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;&lt;stochastic-volatility&gt;&lt;covariance&gt;&lt;numerical-methods&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16450" PostTypeId="2" ParentId="16449" CreationDate="2015-02-04T13:10:00.447" Score="6" Body="&lt;p&gt;I am not sure if I understood your question correctly but I will try to answer it anyway.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have a standard normal random vector $z \sim N(\mathbb{0},I_n)$ (where $z,0 \in \mathbb{R}^{n\times1}$ and $I_n \in \mathbb{R}^{n\times n}$ is the identity matrix) and you want to transform it into a multivariate normal  $x \sim N(\mu,\Sigma)$ you do it the following way:&#xA;If $L$ is the Cholesky factorization of $\Sigma$, $\Sigma = LL^T$, then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ x  = \mu + Lz.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why? Because when you want to see if you really end up with a covariance matrix $\Sigma$ in this construction, it works:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}[(x-\mathbb{E}(x))^T(x-\mathbb{E}(x))] = \mathbb{E}[(Lz)^T(Lz)]=L^T\mathbb{E}[z^Tz]L=L^TI_nL = \Sigma.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or lets think the other way around: If you want to see what matrix you have to multiply $z$ with to create a distribution with covariance matrix $\Sigma$, it turns out to be $L$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe one more thing: Some textbooks even define the multivariate normal like this: Suppose you have a vector $z$ of independent standard normals and a matrix $L$ such that $LL^T$ is SPD then the distribution of $x=\mu + Lz$ is called multivariate normal with $\mu$ and $LL^T=\Sigma$.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2015-02-04T13:10:00.447" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16451" PostTypeId="1" CreationDate="2015-02-04T13:42:23.900" Score="1" ViewCount="51" Body="&lt;p&gt;I have distribution for cost of two alternative through Monte Carlo simulation. The distributions are not normal. Given the benefit of the two alternatives is the same but ungiven, I want to choose the alternative with less cost for a risk aversive stakeholder. (I can't simply choose the one with smaller E(c)-a*var(c) since the distribution is not normal)&lt;/p&gt;&#xA;" OwnerUserId="15162" LastActivityDate="2015-02-04T13:42:23.900" Title="Comparing cost of two alternative given their distribution" Tags="&lt;risk&gt;&lt;utility-theory&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16452" PostTypeId="1" CreationDate="2015-02-04T20:46:59.510" Score="5" ViewCount="742" Body="&lt;p&gt;Ok, I am working on a problem that consists of the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking to solve the portfolio choice optimization problem (maximizing utility with a known utility function) in the case where all of the underlying random variables are multivariate normal.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;define $\phi$ as the amount invested in each of $n$ risky assets, such that the budget constraint is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Sigma_{i=1}^{n}\phi_i=w_0$ for some initial wealth, $w_0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Show that the optimal portfolio is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\phi=\frac{1}{\alpha}\Sigma^{-1}\mu+[\frac{\alpha w_0-1'\Sigma^{-1}\mu}{\alpha 1'\Sigma^{-1}1}]\Sigma^{-1}1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where each of the 1's is an $n$-dimensional column vector of 1's.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Work/Attempt&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ok, these are the things I know:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am dealing with CARA utility, which gives me a utility function of the form:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$u(w)=-e^{-\alpha w}$ where $w$ is my random end-of-period wealth which I believe to be distributed as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$w$~$N(\mu,\sigma^2)$ with $\mu=\phi'\mu$ (a vector of expected returns scaled by the amount invested in each), and $\sigma^2=\phi'\Sigma\phi$ where $\Sigma$ is the covariance matrix of the $n$ risky assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, to find the expected utility of this function, I use the fact that the expectation of an exponential of normals is the exponential of the mean plus half the variance, to arrive at:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E(u(w))=-e^{-\alpha\phi'\mu+\frac{\alpha^2\phi'\Sigma\phi}{2}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Factoring out a negative alpha, and equating the remaining part of the exponential as the certainty equivalent of a random wealth (I might not be explaining that well, but I am almost certain this is the correct path), I can maximize utility by maximizing the utility of the certainty equivalent, which is done by maximizing the certainty equivalent itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All that to say, I need:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{\partial}{\partial\theta}\phi'\mu+\frac{\alpha\phi'\Sigma\phi}{2}=0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From there I can't seem to get anything even remotely close to the result I am supposed to show. I have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$1'\mu+\alpha\Sigma\phi=0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which seems to mirror the first term in the result, but I am lost as to where the rest comes from.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be appreciated. I'm not sure if my mistake is in the multi-dimensional partial derivative, or if it is in obtaining the function that needs to be maximized. The book I am using has a similar problem for a single risky asset which I can work through just fine, but the exclusion of a risk-free asset (which would seem to simplify the wealth constraint) makes it more confusing to me.&lt;/p&gt;&#xA;" OwnerUserId="15267" LastActivityDate="2015-03-19T19:46:33.297" Title="Portfolio choice problem of a CARA investor with n risky assets" Tags="&lt;risk&gt;&lt;optimization&gt;&lt;portfolio-optimization&gt;&lt;asset-allocation&gt;&lt;normal-distribution&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16453" PostTypeId="1" AcceptedAnswerId="16462" CreationDate="2015-02-04T23:48:45.603" Score="2" ViewCount="137" Body="&lt;p&gt;Considering less liquid instruments can have a higher degree of volatility especially on lower time frames (1-tick or 1-second), is it possible to effectively use wavelets to reduce the issue of noise and better approximate where the real current market value is?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking the above concept a step further could data from the higher time frames(1-min &amp;amp; 5-min) also be taken into account to add further context to the wavelet calculation taking place on the lower time frame?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I apologize if my description is somewhat vague. I am still developing my understanding of  wavelets and wanted to make sure I didn't begin down a path that was obviously futile to the more informed. From everything I have gathered so far wavelets are not necessarily considered useful for forecasting, but can have value where historical data is concerned.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any additional insight would be much appreciated.&lt;/p&gt;&#xA;" OwnerUserId="6864" LastActivityDate="2020-05-05T23:53:04.527" Title="Can wavelets be effectively used to approximate the market value of an illiquid instrument?" Tags="&lt;wavelet&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16454" PostTypeId="2" ParentId="15271" CreationDate="2015-02-05T00:31:19.763" Score="3" Body="&lt;p&gt;Don't write a log file.  It's a very old fashioned way to achieve the result you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Look into packet capture using a span port on the switch to which your FIX engine is connected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By running packet capture you grab all of the FIX messages sent and received with zero impact on your application - the packet capture just grabs the messages off the wire.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You then need to decode the captured packets.  Depending on your FIX engine vendor this may be something that can be done trivially or it may require some work.&lt;/p&gt;&#xA;" OwnerUserId="15268" LastActivityDate="2015-02-05T00:31:19.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16455" PostTypeId="2" ParentId="9465" CreationDate="2015-02-05T02:10:04.537" Score="0" Body="&lt;p&gt;R is finally getting interactive charts, zooming and panning included. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take a look:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://timelyportfolio.blogspot.hk/2015/02/financial-charts-pan-and-zoom.html&quot; rel=&quot;nofollow&quot;&gt;http://timelyportfolio.blogspot.hk/2015/02/financial-charts-pan-and-zoom.html&lt;/a&gt;&#xA;&lt;a href=&quot;http://www.buildingwidgets.com/blog&quot; rel=&quot;nofollow&quot;&gt;http://www.buildingwidgets.com/blog&lt;/a&gt;&#xA;&lt;a href=&quot;http://www.htmlwidgets.org/showcase_threejs.html&quot; rel=&quot;nofollow&quot;&gt;http://www.htmlwidgets.org/showcase_threejs.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2015-02-05T02:10:04.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16457" PostTypeId="1" CreationDate="2015-02-05T06:23:23.480" Score="2" ViewCount="70" Body="&lt;p&gt;Here is a portfolio optimisation for equity dividend and yield designed to diversify holdings and produce regular monthly returns using only ETFs complete with R code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://prescientmuse.blogspot.co.uk/2015/02/bond-yield-and-equity-dividend-income.html&quot; rel=&quot;nofollow&quot;&gt;http://prescientmuse.blogspot.co.uk/2015/02/bond-yield-and-equity-dividend-income.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The resultant allocation invests in emerging market debt, UK and European corporate debt, and UK property ETFs. Since the objective of the portfolio is return on yield and dividend, I would love some suggestions about how the beta  might be hedged cost effectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for your time.&lt;/p&gt;&#xA;" OwnerUserId="15208" LastActivityDate="2015-02-05T06:23:23.480" Title="Portfolio optimised for diversification and regular yield. How to hedge?" Tags="&lt;hedging&gt;&lt;portfolio&gt;&lt;investment&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16458" PostTypeId="2" ParentId="16356" CreationDate="2015-02-05T10:09:53.180" Score="4" Body="&lt;p&gt;It depends on your investment process: more specifically, on how you generate views. Here are three practical cases which lead to different choices for $\Omega$:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Let's assume you are an investor who acts on (more or less) arbitrary bits of opinion: e.g. you like Italian equities because you like Italy, and German equities because you find Angela Merkel's economic policies convincing. Then your views are uncorrelated and the off-diagonal elements of $\Omega$ are zero.&lt;/li&gt;&#xA;&lt;li&gt;Your views come from a systematic approach, say a regression model based on European credit spreads. Then you can estimate $\Omega$ directly from the residuals of your forecast. The off-diagonal elements will not be zero because they are based on a common factor.&lt;/li&gt;&#xA;&lt;li&gt;You talk to two different brokers. Both are bullish on equities, and broker A recommends Italian, broker B German equities. In this case you probably want to use the covariance structure of the market in equilibrium,  $\Omega \propto P \Sigma P^T$. Again, the off-diagonal elements will be non-zero.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="6721" LastActivityDate="2015-02-05T10:09:53.180" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16460" PostTypeId="1" CreationDate="2015-02-05T18:39:37.850" Score="6" ViewCount="126" Body="&lt;p&gt;As far as I know estimates of parameters of ARMA(1,1) are asymptotically optimal when fitted to data from ARMA(1,1)-GARCH(1,1) process, and only their variance increase, so when we assume large dataset, what kind of other issues could arise with estimators of ARMA(1,1) parameters ? If estimators are asymptotically optimal then does fitting first ARMA(1,1) and then GARCH(1,1) to obtained residuals of ARMA(1,1) is valid procedure ? What about variance of this whole procedure ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ask this question because, I often meet examples, when models are stacked one onto another and first one is called &quot;filter&quot; like the real estimation is conducted only in second step, but for me stacking models seems to increase overall variance, and is used because its more flexible (like, we don't have implemented procedure for estimation of SARIMAX-GARCH so first first we estimate SARIMAX then GARCH). For convenience we could assume AR(1) instead of ARMA(1,1).&lt;/p&gt;&#xA;" OwnerUserId="2044" LastEditorUserId="2044" LastEditDate="2015-02-05T19:46:36.583" LastActivityDate="2015-02-05T19:46:36.583" Title="What kind of errors arise when I fit ARMA(1,1) to data generated from ARMA(1,1)-GARCH(1,1) process?" Tags="&lt;stochastic-processes&gt;&lt;garch&gt;&lt;estimation&gt;&lt;arma&gt;&lt;parameter-estimation&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16461" PostTypeId="1" AcceptedAnswerId="16463" CreationDate="2015-02-05T22:04:27.753" Score="1" ViewCount="74" Body="&lt;p&gt;I need some clarifications regarding spread options. I have always found them characterized as paying, at maturity, the difference between the &lt;em&gt;prices&lt;/em&gt; of two underlying assets:&#xA;$$ (S_1(T)-S_2(T)-K)^+ $$&#xA;I have been presented with the task of pricing a spread option paying, at maturity, the difference between the &lt;em&gt;performance&lt;/em&gt; of two underlying assets, as in:&#xA;$$  \left(\frac{S_1(T)}{S_1(0)} - \frac{S_2(T)}{S_2(0)} - K)^+\right) $$&#xA;Since I have not found explicit references to the form above, I am wondering what are the differences in terms of tractability. How does the level of the spot price impact the problem? Does this form belong to the family of models for spread options that is analytically tractable?&lt;/p&gt;&#xA;" OwnerUserId="15272" LastActivityDate="2015-02-06T04:36:37.523" Title="Spread options on prices or returns?" Tags="&lt;option-pricing&gt;&lt;multivariate&gt;&lt;spread-options&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16462" PostTypeId="2" ParentId="16453" CreationDate="2015-02-06T01:33:54.313" Score="1" Body="&lt;p&gt;Wavelets are filters decomposing in a specific number of frequencies a signal across time, they are unique in that they can analyze non-stationary signals (most time series are). They decompose the signal in scaling and detail coefficients (high frequency and low frequency parts). You can attempt to find the true price, meaning the signal, having extracted all the existing noise types, however is very hard. In volatile instruments knowing the noise component is important as most of the price at any given time is provided by the noise component. However, my guess is that for highly illiquid securities the price will be that of the true signal without noise. Also the more illiquid a security is the more data you need to be able to run statistically significant results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having said that, it is very difficult to find and correctly identify the true signal when there is a large component of noise embedded in the signal and the frequencies of noise are not known. So statistical probabilistic methods for determining where the signal resides in the frequency structure are important when the component of noise is not known before hand. Having determined statistically where the signal/s reside then you can extract and classify the different noise components that go along with the signal and model them using stochastic methods for white noise. (White noise is completely unpredictable but what is predictable is the volatility of white noise) so you model the volatility of white noise. For different noise types you have different functions describing them. Rising, falling, logarithmic and power slopes across the frequency spectrum.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using both discrete and continuous wavelets the following considerations are important:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;One signal maybe spread across different frequencies.&lt;/li&gt;&#xA;&lt;li&gt;Sometimes there are many signals at once acting at different frequencies with different energy levels. &lt;/li&gt;&#xA;&lt;li&gt;Signals raise and decay in energy across time (equivalent of volatility for a given signal increasing or falling).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I hope this helps &lt;/p&gt;&#xA;" OwnerUserId="7616" LastEditorUserId="185" LastEditDate="2020-05-05T23:53:04.527" LastActivityDate="2020-05-05T23:53:04.527" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="16463" PostTypeId="2" ParentId="16461" CreationDate="2015-02-06T04:36:37.523" Score="0" Body="&lt;p&gt;If you are using a model such as BS where the distribution of $S_{j}(T)/S_{j}(0)$ does not depend on $S_{j}(0)$ it really makes very little difference. Just take the initial stock prices to be $1$ and away you go.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-02-06T04:36:37.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16464" PostTypeId="1" AcceptedAnswerId="16465" CreationDate="2015-02-06T07:21:19.607" Score="2" ViewCount="847" Body="&lt;p&gt;I am given two data sets containing dates and losses (in some currency).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given a distribution for the amount of losses and an (a,b,0) distribution for frequency of losses, how can I use Monte Carlo simulations to get a distribution for aggregate losses?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The papers and books I see online seem to state how to simulate aggregate losses (by simulating # of losses and losses given such #), but how do I come up with a distribution given all that data?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's this book I found &quot;Operational Risk with Excel and VBA&quot;. It  describes the procedure and ends with the mean, standard deviation and other moment stuff. Is that sufficient to describe the distribution of aggregate losses?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/VhFDr.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cross-posted: &lt;a href=&quot;https://stats.stackexchange.com/questions/136541/get-distribution-for-aggregate-loss-using-monte-carlo&quot;&gt;https://stats.stackexchange.com/questions/136541/get-distribution-for-aggregate-loss-using-monte-carlo&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2015-02-08T20:20:18.853" Title="Get distribution for aggregate loss using Monte Carlo" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;monte-carlo&gt;&lt;risk-models&gt;&lt;simulations&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16465" PostTypeId="2" ParentId="16464" CreationDate="2015-02-06T08:56:41.527" Score="1" Body="&lt;p&gt;You can do the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;For each $i$ in $1$ to number of Mont-Carlo runs $K$&lt;/li&gt;&#xA;&lt;li&gt;simulate the number of losses $N_i$&lt;/li&gt;&#xA;&lt;li&gt;simulate $N_i$ many loss-sizes $X_{i,1},\ldots,X_{i,N_i}$&lt;/li&gt;&#xA;&lt;li&gt;calculate $L_i = \sum_{j=1}^{N_i} X_{i,j}$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Doing this you get a sample of losses $L_1,\ldots,L_K$ and you can do all sorts of hisograms, density fits, VaR, ES calculations on it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: on this sample you could try to fit a loss distribution (e.g. Gamma or translated Gamma see &lt;a href=&quot;http://sfb649.wiwi.hu-berlin.de/fedc_homepage/xplore/tutorials/stfhtmlnode116.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;) by maximum likelihood or method of moments. But you can apply the method of moments even without MC becauase if you assume that the number of losses and the loss sizes are independent then&#xA;$$&#xA;E[L] = E[N]E[X] \text{ and }&#xA;V[L] = E[N]V[X] +E[X]^2 V[N]&#xA;$$&#xA;for these fromulas and fitting distributions see e.g. &lt;a href=&quot;http://sfb649.wiwi.hu-berlin.de/fedc_homepage/xplore/tutorials/stfhtmlnode116.html&quot; rel=&quot;nofollow&quot;&gt;again here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-02-06T09:15:02.967" LastActivityDate="2015-02-06T09:15:02.967" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="16467" PostTypeId="2" ParentId="3173" CreationDate="2015-02-06T10:30:39.193" Score="5" Body="&lt;p&gt;7 years ago I had to solve the problem of a efficiency frontier under linear constraints on the asset weights and also stumbled upon Markowitz Critial Line Algorithm. I still have a directory with some resources in it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since Bryce already gave a practical implementation with &lt;a href=&quot;http://faculty.washington.edu/ezivot/econ424/portfolio.r&quot; rel=&quot;noreferrer&quot;&gt;R code by Eric Zivot&lt;/a&gt;, I will concentrate on some papers which might help. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think one of the best papers is &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=894842&quot; rel=&quot;noreferrer&quot;&gt;Applying Markowitz's Critical Line Algorithm by Andras and Daniel Niedermayer&lt;/a&gt;. There you have some nice matrix algebra. The corner portfolios are called &lt;em&gt;turning points&lt;/em&gt;. &#xA;There is also the german paper &lt;a href=&quot;http://www.ibrarian.net/navon/paper/Einige_Bemerkungen_zum_Critical_Line_Algorithmus_.pdf?paperid=1446358&quot; rel=&quot;noreferrer&quot;&gt;Einige Bemerkungen zum Critical Line Algorithmus von Markowitz by Detlef Mertens&lt;/a&gt; that is comparable to the paper of Niedermayer but has very much on corner portfolios. &#xA;Also helpful might be the paper &lt;a href=&quot;http://www.norstad.org/finance/portopt2.pdf&quot; rel=&quot;noreferrer&quot;&gt;Portfolio Optimization: Part 2 - Constrained Portfolios by John Norstad&lt;/a&gt; and maybe this dissertation on &lt;a href=&quot;http://ccom.ucsd.edu/~elwong/p/elw-thesis.pdf&quot; rel=&quot;noreferrer&quot;&gt;Active-Set Methods for Quadratic Programming by Elizabeth Wong&lt;/a&gt;, too. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally, the Critical Line Algorithm is an instance of the &lt;a href=&quot;https://en.wikipedia.org/wiki/Active_set_method&quot; rel=&quot;noreferrer&quot;&gt;active set method&lt;/a&gt; in quadratic programming. You can search in this direction to find much more. For example in &lt;a href=&quot;https://www.tu-ilmenau.de/fileadmin/media/simulation/Lehre/Vorlesungsskripte/Lecture_materials_Abebe/QPs_with_IPM_and_ASM.pdf#page=16&quot; rel=&quot;noreferrer&quot;&gt;this slides from page 16 onwards&lt;/a&gt; there is a nice explanation. &lt;/p&gt;&#xA;" OwnerUserId="6980" LastEditorUserId="6980" LastEditDate="2015-02-06T10:35:47.837" LastActivityDate="2015-02-06T10:35:47.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16468" PostTypeId="1" CreationDate="2015-02-06T14:33:41.813" Score="1" ViewCount="1409" Body="&lt;p&gt;I have 3,000 tickers that I would like to turn into a weighted index, viewable by the general public by going to Yahoo and typing in ^PSNDX (for example) or go to E-Trade and enter something similar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I need to work with an exchange to &quot;host&quot; the ticker?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would I send that &quot;host&quot; a feed of the index's activity which would then be linked to the ticker?&lt;/p&gt;&#xA;" OwnerUserId="15280" LastActivityDate="2015-04-09T18:07:35.143" Title="How can I create a public viewable stock market index?" Tags="&lt;equities&gt;&lt;index&gt;&lt;market&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16470" PostTypeId="1" AcceptedAnswerId="16473" CreationDate="2015-02-06T18:27:10.093" Score="3" ViewCount="4574" Body="&lt;p&gt;In modelling loss given default,(LGD), we often encounter the term Margin of Conservatism.&#xA;What is it in layman's terms? I am not able to find a wikipedia page on this.&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2015-02-07T00:08:04.810" Title="What is Margin of Conservatism" Tags="&lt;credit-risk&gt;&lt;default-probability&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16471" PostTypeId="1" CreationDate="2015-02-06T20:20:58.163" Score="2" ViewCount="568" Body="&lt;p&gt;I'm currently working to solve the Black-Scholes model partial differential equation (it's a model for a.o. stock option prices). The Black-Scholes equation for a calloption C(S,t) is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$  \frac{∂C}{∂t}+\frac{1}{2} σ^2 S^2  \frac{∂^2 C}{∂S^2}+rS \frac{∂C}{∂S}-rC=0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;S is the stock price and t is time to expiration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am solving the equation by transforming it to the heat equation. I am having a little trouble with the first few transformation. The transformations are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$x=\ln⁡(\frac{S}{K})$ which gives   $S=Ke^x$&lt;/li&gt;&#xA;&lt;li&gt;$τ=\frac{σ^2}{2} (T-t)$   which gives  $t=T-\frac{2τ}{σ^2}$ &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The function becomes:&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;$U(x,τ)= \frac{1}{K} C(S,t)=\frac{1}{K} C(Ke^x,T-  \frac{2τ}{σ^2})$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;These transformation applied to the partial differential equation above gives the following outcomes for the different terms. I found the following solution on the internet, my problem is that I don't really understand what they do here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{∂C}{∂t}=K \frac{∂U}{∂τ}  \frac{∂τ}{∂t}=\frac{-Kσ^2}{2} \frac{∂U}{∂τ},$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{∂C}{∂S}=K \frac{∂U}{∂x} \frac{∂x}{∂S}=\frac{K}{S}  \frac{∂U}{∂x}=e^{-x}  \frac{∂U}{∂x},$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{∂^2 C}{∂S^2}=\frac{-K}{S^2}   \frac{∂U}{\partial x}+\frac{K}{S} \frac{∂}{∂S} (\frac{∂U}{∂x})$&#xA;$=\frac{-K}{S^2}  \frac{∂U}{∂x}+\frac{K}{S} \frac{∂}{∂x} (\frac{∂U}{∂x}) \frac{∂x}{∂S}$&#xA;$=\frac{-K}{S^2}   \frac{∂U}{∂x}+\frac{K}{S^2} \frac{∂^2 U}{∂x^2}$&#xA;$=\frac{e^{-2x}}{K} (\frac{∂^2 U}{∂x^2} \frac{-∂U}{∂x}$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone help me out? I would really appreciate it!!!!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="15283" LastEditorUserId="11678" LastEditDate="2016-12-13T20:18:51.497" LastActivityDate="2016-12-14T15:03:57.447" Title="How to apply the chain rule for partial derivatives to transformations?" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;differential-equations&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16472" PostTypeId="2" ParentId="16421" CreationDate="2015-02-06T23:50:30.523" Score="1" Body="&lt;p&gt;Your question depends on the discount factor you wish to use for pricing. If u use the risk-free rate (from the bond), it wouldn't be in line with the no-abitrage condition to assume an risk neutral agent can't/wouldn't invest in bonds to carry money into next period. To understand this: just assume a 1 period model with two outcomes for S, where both outcomes are more beneficial than investing in the bond. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe, if you really want to force the desired behaviour into your economical framework with resonable parameters for your assets, you have to model agents with an really high amount of risk searching attitude. (CRRA/EZ Utility with risk aversion parameters way below 1, most likley even negative (I don't know if EZ is even defined or can be interpreted for s.th. like that)). This, however, wouldn't be a realistic setting. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best way to check wether your idea is reasonable or not is to ask yourself: Would I do it? My answer is a clear no. &lt;/p&gt;&#xA;" OwnerUserId="6640" LastActivityDate="2015-02-06T23:50:30.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16473" PostTypeId="2" ParentId="16470" CreationDate="2015-02-07T00:08:04.810" Score="1" Body="&lt;p&gt;If you are looking for a rigorous mathematical definition, there isn't one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A &lt;em&gt;margin of conservatism&lt;/em&gt; is broadly defined here to be the additional amount in model estimates relative to actual outcomes. This definition will differ depending on the model in question; where for some it may be interpreted as low threshold above some metric of accuracy, while others may require a much higher threshold. Certainly, conservatism may be considered as a back-testing objective, whose definition may be moulded to the purpose of the model being tested. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, when calculating LGD for economic capital, estimates might be low enough to be an accurate representation of the portfolio, yet on the side of conservatism to ensure underestimation is kept to a minimum . However, stressed LGD estimates should be inherently inflated to provide a cushion during economic downturn periods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Institutions incorporate margins of conservatism in their risk parameter estimates to capture certain modelling deficiencies, uncertainties, or risks. The quantification of such ranges vastly among institutions and models. &lt;/p&gt;&#xA;" OwnerUserId="6437" LastActivityDate="2015-02-07T00:08:04.810" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16475" PostTypeId="1" AcceptedAnswerId="16511" CreationDate="2015-02-07T01:53:17.343" Score="1" ViewCount="230" Body="&lt;p&gt;I am currently studying about financial mathematics for my Exam FM to become an actuary.  There is one thing that really bothers me so I would like to have some answers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whenever I solve a problem regarding Sinking Fund Method, usually what I see is that the sinking fund has a higher interest rate than the person being charged.  And my understanding is that the person keeps paying the interest to the lender, while gathering money on the sinking fund to repay the principal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why would anyone do that?  If there is a bank that can offer higher interest rate than the interest charged to a loan, then I would simply borrow money, invest the entire thing to the bank and earn money as an arbitrage.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am probably not seeing how sinking fund works in reality, so I would like to know the reasoning behind this.&lt;/p&gt;&#xA;" OwnerUserId="15287" LastActivityDate="2015-02-09T22:59:16.777" Title="Question regarding sinking fund" Tags="&lt;finance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16476" PostTypeId="1" CreationDate="2015-02-07T03:26:09.870" Score="1" ViewCount="27" Body="&lt;p&gt;I am analyzing an annuity with a stub. I calculate the effective duration as &#xA;(P(-10bps) - P(+10bps))/(2*Principal * (.001)) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then take the derivative of the standard annuity formula discounted by a stub period divided by the initial price and evaluate it and find that it is half of the effective duration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is known that effective duration is a pretty damn good approximation so I know it's in a tight ballpark; what I dont understand is why the derivative is coming up as exactly half. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I checked my work in symbolic maths programs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideas?&lt;/p&gt;&#xA;" OwnerUserId="15288" LastActivityDate="2015-02-07T03:26:09.870" Title="Annuity Duration Based on Closed Derivative is half of Effective Duration?" Tags="&lt;bond&gt;&lt;duration&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16477" PostTypeId="1" CreationDate="2015-02-07T07:53:23.193" Score="3" ViewCount="704" Body="&lt;p&gt;I am testing a model in which I need to simulate closing, high and low prices (i.e. 3 dimensions of prices) of any given stock. Using the simple Geometric Brownion Motion equation I can easily simulate the closing stock price (i.e single dimension) at each step. However I am totally confused how to simulate the other 2 dimensions i.e high and low in such a manner that they dipict the possible price movement of the stock?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!! &lt;/p&gt;&#xA;" OwnerUserId="15290" LastActivityDate="2015-02-09T09:38:04.843" Title="Simulating Stock's close, high and low prices" Tags="&lt;stochastic-processes&gt;&lt;backtesting&gt;&lt;brownian-motion&gt;&lt;simulations&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16479" PostTypeId="2" ParentId="16104" CreationDate="2015-02-07T13:27:12.203" Score="1" Body="&lt;p&gt;Something I do to find new ideas is read papers in Google Academic related to the topic. Find papers under &quot;quantitative strategy&quot;, &quot;trading strategy&quot;, etc and you will find interesting things.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My experience is that they don't tend to work, but they provide with ideas that you can mix and maybe find something by yourself.&lt;/p&gt;&#xA;" OwnerUserId="15285" LastActivityDate="2015-02-07T13:27:12.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16480" PostTypeId="1" CreationDate="2015-02-07T14:53:00.913" Score="2" ViewCount="303" Body="&lt;p&gt;Could anyone suggest me how to begin with Time-varying Copulas or Stochastic Copulas? I'm looking for the GAUSS code, however it seems there are only MATLAB code available over the internet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to apply it to Time-varying correlation via state-space representation and Kalman filter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="15294" LastActivityDate="2015-02-08T20:25:56.440" Title="Time-Varying Copulas (GAUSS)" Tags="&lt;correlation&gt;&lt;copula&gt;&lt;kalman&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16481" PostTypeId="1" AcceptedAnswerId="16484" CreationDate="2015-02-07T15:49:31.647" Score="14" ViewCount="13370" Body="&lt;p&gt;I think this is a quite similar question for most of you, however it is not completely understandable for me at the moment:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why do we usually use &lt;strong&gt;returns&lt;/strong&gt; and not &lt;strong&gt;prices&lt;/strong&gt; to model financial data in time series analysis,...?&lt;/p&gt;&#xA;" OwnerUserId="13812" LastActivityDate="2015-02-12T10:35:45.880" Title="Why do we usually model returns and not prices?" Tags="&lt;time-series&gt;&lt;stochastic-processes&gt;&lt;returns&gt;&lt;log-returns&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="16482" PostTypeId="1" CreationDate="2015-02-07T16:43:09.060" Score="1" ViewCount="1753" Body="&lt;p&gt;Good day&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to get weekly returns data from daily data , I want to use the Wednesday-to-Wednesday approach – the returns (rt) are computed from the Wednesday closing prices Pt&#xA;, i.e., rt = ln(Pt/Pt-1). In the cases in which Wednesdays were not active trading days, the closing values from the next date with valid prices from the sequence of the nearest days is used:&#xA;I'm Stata user as well as an excel user&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any hint will be highly appreciated!! &#xA;thaks!!&lt;/p&gt;&#xA;" OwnerUserId="6195" LastActivityDate="2016-08-09T18:10:15.947" Title="How to get get weekly returns from daily data" Tags="&lt;programming&gt;&lt;asset-returns&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16484" PostTypeId="2" ParentId="16481" CreationDate="2015-02-07T16:59:15.050" Score="16" Body="&lt;p&gt;Basically, prices usually have a unit root, while returns can be assumed to be stationary. This is also called order of integration, a unit root means integrated of order 1, I(1), while stationary is order 0, I(0). Time series that are stationary have a lot of convenient properties for analysis. When a time series is non-stationary, then that means the moments will change over time. For instance, for prices, the mean and variance would both depend on the previous period's price. Taking the percent change (or log difference), more often than not, removes this effect. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One easy way to visualize the difference between the two is to calculate the correlation with lagged values of a time series with itself (also called the autocorrelation function). Plot this for a number of lags. Returns should have correlations near zero, while prices should start out very high and exponentially decay. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastEditorUserId="9458" LastEditDate="2015-02-12T10:35:45.880" LastActivityDate="2015-02-12T10:35:45.880" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16485" PostTypeId="1" AcceptedAnswerId="16622" CreationDate="2015-02-07T17:39:21.057" Score="1" ViewCount="2752" Body="&lt;p&gt;This question pertains to two types of loans. Pay-in-kind (PIK) and bullet loans with quarterly payments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;1. PIK Loans&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A PIK loan is a loan where periodic interest is NOT paid, but added to the principal instead and interest for the next period is calculated based on the new principal. I.e. a PIK loan compounds interest on interest. At the end of any period $t$ the principal $P_t$ can be calculated as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{aligned} P_t &amp;amp;= P_{t-1} + I_t \\&#xA;I_t &amp;amp;= P_{t-1} × rd/365 \end{aligned}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Where:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$I_t$ = is the interest for period $t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r$ = annual coupon rate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d_t$ = number of days in period $t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see, there are no cash-flows until maturity where $t = M$. I want to calculate the present value (fair value of this loan). My question is, which is the appropriate formula for discounting? Assuming a yield $y$ the present value $PV$ can be generalized as follows:&#xA;$$ PV =P_M/(1+y/m)^{mn} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $P_M$ is the final cash-flow of principal and all interest, $m$ is the number of compounding periods per year and $n$ is the number years until maturity. The question is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Should m = 1 or m = 4?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e. should we compound quarterly or annually? Remember there are NO cash-flows until the maturity M. But the interest IS compounded quarterly. Please provide reason why and if possibly any reference to the appropriate literature if you have one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; The yield $y$ is market yield for similar loans / bonds. I'm not sure if this qualifies is as the Effective Annual Rate, in which case $m$ should probably equal 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2. Bullet Loans&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A bullet loan is a loan where all principal is paid at maturity and interest is paid periodically, typically semi-annually or quarterly. The interest does not compound and is paid on constant principal. The question is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;If loan has quarterly payments, should the $m = 4$ or $m = 1$?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$PV =∑_{i=1}^n{CF_i/(1+r⁄m)^{n_i m}}$$ &lt;/p&gt;&#xA;" OwnerUserId="2685" LastEditorUserId="2685" LastEditDate="2015-02-07T17:52:09.160" LastActivityDate="2015-02-18T13:43:38.233" Title="What is the proper discounting of PIK and non-compounding bullet loans?" Tags="&lt;asset-pricing&gt;&lt;discounting&gt;&lt;present-value&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16486" PostTypeId="1" CreationDate="2015-02-07T19:57:12.650" Score="1" ViewCount="625" Body="&lt;p&gt;I am working through this paper, &lt;a href=&quot;http://www.nber.org/papers/w8922.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.nber.org/papers/w8922.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to implement the portfolio weight constraints see page 6-7.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the brief overview of my problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let &lt;code&gt;w&lt;/code&gt; be the set of weights representing a portfolio. Then, mean-variance problem is to find the portfolio weights that minimizes portfolio variance, &lt;code&gt;argmin w'Sw&lt;/code&gt; &#xA;subject to &lt;code&gt;w'I = 1&lt;/code&gt; which represents weights sum up to 1 and S is the estimated covariance matrix. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this framework, portfolio weights are constrained by lower and upper bounds such as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/tsrax.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/paNqF.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, the authors show that the following proposition is for the symmetric and positive semi-definite covariance matrix for the minimum global variance portfolios:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/u4KYu.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here new covariance matrix is the shrunk version of S. I am trying to implement this in Matlab. My question is therefore, is there a method to implement a constrained optimization such as this or any suggestions as to how I could go about doing this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for suggestions. &lt;/p&gt;&#xA;" OwnerUserId="13895" LastActivityDate="2015-02-13T20:00:38.853" Title="constrained portfolio optimization in matlab" Tags="&lt;optimization&gt;&lt;portfolio-optimization&gt;&lt;matlab&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16487" PostTypeId="2" ParentId="16486" CreationDate="2015-02-07T21:33:28.900" Score="2" Body="&lt;p&gt;Try fmincon for solving (1)-(4). &lt;/p&gt;&#xA;" OwnerUserId="6640" LastActivityDate="2015-02-07T21:33:28.900" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16488" PostTypeId="2" ParentId="16468" CreationDate="2015-02-07T22:18:53.537" Score="2" Body="&lt;p&gt;The indexing business is very big, and is not cheap and easy for a small participant to enter it. Disseminating an index requires to pay the subscription to different data providers like Bloomberg, Reuters, Yahoo, etc plus having the right infrastructure in terms of systems, calculation of the index, your own company setup, etc&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are interested in doing that, I recommend you to speak to them.&lt;/p&gt;&#xA;" OwnerUserId="15285" LastActivityDate="2015-02-07T22:18:53.537" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16489" PostTypeId="1" CreationDate="2015-02-08T04:17:07.277" Score="4" ViewCount="595" Body="&lt;p&gt;I have some Level III (message level) data for equities and I have found several cases in which I register the execution of a Limit Order at a price &quot;worse&quot; than the best bid or ask. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, let's say that the Best Bid on that exchange is &lt;code&gt;$&lt;/code&gt;20.48 and that there is considerable depth at that price (say, 20,000 shares.) I have several cases in which I have a &quot;full execution&quot; message for a Buy Limit Order (on that same exchange) at price &lt;code&gt;$&lt;/code&gt;20.47 without anything happening to all the Buy orders at $20.48... How is that even possible?&lt;/p&gt;&#xA;" OwnerUserId="11874" LastEditorUserId="11874" LastEditDate="2015-02-08T04:36:02.097" LastActivityDate="2017-04-14T21:44:53.347" Title="Executions deep in the Limit Order Book?" Tags="&lt;equities&gt;&lt;market-data&gt;&lt;market-microstructure&gt;&lt;limit-order-book&gt;&lt;order-execution&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16490" PostTypeId="2" ParentId="7377" CreationDate="2015-02-08T06:45:37.080" Score="6" Body="&lt;p&gt;I have created some Fourier Analysis of stocks here: &lt;a href=&quot;http://www.gregthatcher.com/Stocks/Default.aspx&quot; rel=&quot;noreferrer&quot;&gt;http://www.gregthatcher.com/Stocks/Default.aspx&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I turn the raw data into a series of sines and cosines, show the Fourier approximation as a graph, and then allow you to &quot;turn off&quot; the various sines and cosines, so that you can see how the various &quot;frequencies&quot; contribute to the graph of the stocks values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm currently working on creating some predictions from the Fourier Series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not a trader (just a programmer interested in data analysis), so I'd be very interested in any feedback any of you real traders have on what more you'd like to see with Fourier Analysis.&lt;/p&gt;&#xA;" OwnerUserId="15302" LastActivityDate="2015-02-08T06:45:37.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16492" PostTypeId="1" CreationDate="2015-02-08T16:58:56.043" Score="4" ViewCount="1315" Body="&lt;p&gt;Looking for recommendations on places to get market data for options. I'm looking at NYSE and NASDAQ only.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current solution is my broker, Tradeking. I can request realtime data for 700 option symbols every second, in discrete requests. I have something like 70,000 options to sort through - all strikes, but only the nearest expiration. It's been taking me about 6 minutes each cycle to download and process this data, in chunks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also have an Interactive Brokers account. Their data is (I suspect) higher quality, and more powerful. Their data is streaming, and I can monitor up to 100 symbols, (stocks or options) at a time. By paying IB, I can increase this to up to 1000. If I can cycle the streams, or take  fast snapshots, this might be better than my current solution. Still not really what I'm looking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've looked at xIgnite, which is stupid expensive (i was quoted around $30,000 a year) for data that's even more limited than Tradeking's. I got a trial with Barchart's service. They're much cheaper than xignite, and have a similarly-streamlined API. There's no symbol limit, but the more symbols you request, the longer the pull takes. Overall speed is comparable to TradeKing's. (incidentally, TK takes about the same time to pull data for 1 symbol as 700).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Iqfeed seems to be what I'm looking for, but they don't have a public API; it seems intended to use with third party-software, not for custom app development.&#xA;[/quote]&lt;/p&gt;&#xA;" OwnerUserId="15253" LastActivityDate="2020-12-09T12:26:41.347" Title="Market data for options" Tags="&lt;options&gt;&lt;data&gt;&lt;market-data&gt;&lt;derivatives&gt;&lt;interactive-brokers&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16493" PostTypeId="1" CreationDate="2015-02-08T18:48:13.480" Score="1" ViewCount="28" Body="&lt;p&gt;Due the growth of the American economy the Fed have published that interest rates are likely to increase. Why is that the response of the Fed?&lt;/p&gt;&#xA;" OwnerUserId="15307" LastActivityDate="2015-02-08T18:48:13.480" Title="Why the growth of the American Economy is going to cause the Fed to raise interest rates?" Tags="&lt;interest-rates&gt;&lt;general&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16494" PostTypeId="2" ParentId="15417" CreationDate="2015-02-08T19:29:55.770" Score="0" Body="&lt;p&gt;FYI, @Alpha13, if you are still following this, Quantopian, a retail algo platform just added share buy-back data to their data catalog. I'm not affiliated with the company, but thought it might help you:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.quantopian.com/posts/sneak-peek-using-a-quantopian-research-notebook-to-analyze-share-buyback-data&quot; rel=&quot;nofollow&quot;&gt;https://www.quantopian.com/posts/sneak-peek-using-a-quantopian-research-notebook-to-analyze-share-buyback-data&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="758" LastActivityDate="2015-02-08T19:29:55.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16495" PostTypeId="2" ParentId="16489" CreationDate="2015-02-08T19:45:49.910" Score="1" Body="&lt;p&gt;It can be a couple things depending on what you are looking at:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are looking at a single exchange's feed, it can be a Trade Message that isn't linked to any individual order ID. These can be things like block orders or off exchange orders that get reported to them. I usually ignore Trade messages when looking at intraday data. These are different from Execution reports which have an order id an you can linked them back to an entry in the limit book.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are looking at some form of aggregated feed, the are probably executions on another exchange that (probably) qualify for bypassing the NBBO (such as being flagged Intramarket Sweep) or a couple other exceptions.&lt;/p&gt;&#xA;" OwnerUserId="758" LastActivityDate="2015-02-08T19:45:49.910" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="16496" PostTypeId="1" AcceptedAnswerId="16503" CreationDate="2015-02-08T20:20:04.317" Score="1" ViewCount="83" Body="&lt;p&gt;Spin-off from &lt;a href=&quot;https://quant.stackexchange.com/questions/16464/get-distribution-for-aggregate-loss-using-monte-carlo&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Richard referred to me an article that tells me how to get parameters of a translated gamma distribution to which I should consider fitting simulated aggregated loss values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The parameters depend on moments of S (or. in Richard's terms, L):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/1h3Ih.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I compute the $E(S), E(S^2) and E(S^3)$ given simulations of S?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I estimate them with mean(S), mean(S^2) and mean(S^3), or do I use the formulas given in the article?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/d1YcQ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wouldn't know how to compute the $E(S^3)$ ...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cross-posted: &lt;a href=&quot;https://stats.stackexchange.com/questions/136830/compute-moments-of-aggregate-loss-using-monte-carlo&quot;&gt;https://stats.stackexchange.com/questions/136830/compute-moments-of-aggregate-loss-using-monte-carlo&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2015-02-09T08:17:39.000" Title="Compute moments of aggregate loss using Monte Carlo" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;monte-carlo&gt;&lt;risk-models&gt;&lt;simulations&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16497" PostTypeId="2" ParentId="16477" CreationDate="2015-02-08T20:23:12.523" Score="1" Body="&lt;p&gt;I use straightforward approach: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Generate &quot;returns&quot;;&lt;/li&gt;&#xA;&lt;li&gt;Make cumulative sum of returns from Step 1;&lt;/li&gt;&#xA;&lt;li&gt;Take any Nth (N should be &quot;big enough&quot;) point for series obtained on Step 2. That would be &quot;closes&quot;; &lt;/li&gt;&#xA;&lt;li&gt;Then take max and min between &quot;closes&quot; = highs and lows.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In R:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;n &amp;lt;- 10000 # quantity of &quot;ticks&quot; inside 1 day&#xA;m &amp;lt;- 200 # number of days&#xA;rets &amp;lt;- rnorm(n*m)&#xA;price &amp;lt;- cumsum(rets) + 1000 # start from &quot;big&quot; figure, so that &quot;price&quot; stays positive&#xA;price.daily &amp;lt;- matrix(price, byrow = T, nrow = m, ncol = n)&#xA;&#xA;ohlc &amp;lt;- data.frame(open = price.daily[,1], &#xA;                   high = apply(price.daily, 1, max), &#xA;                   low = apply(price.daily, 1, min), &#xA;                   close = price.daily[,n])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Frankly, I'm not sure if I'am right from the methodological point of view. So, would be interesting to have some feedback.&lt;/p&gt;&#xA;" OwnerUserId="6535" LastEditorUserId="6535" LastEditDate="2015-02-09T09:38:04.843" LastActivityDate="2015-02-09T09:38:04.843" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16498" PostTypeId="1" AcceptedAnswerId="16504" CreationDate="2015-02-08T20:24:21.807" Score="1" ViewCount="769" Body="&lt;p&gt;Spin-off from &lt;a href=&quot;https://quant.stackexchange.com/questions/16464/get-distribution-for-aggregate-loss-using-monte-carlo&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Edit) Main question: What do I do about a parameter whose suggested values range quite vastly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Edit) Backstory: I am given data of loss values and the dates that correspond to when each loss was incurred. I am to fit a distribution for the aggregate losses: I must first simulate using poisson or negative binomial the frequency of loss (some positive integer, usually less than 15) and then simulate losses given the frequency (e.g. simulate 15 loss values) that follow some distribution e.g. loglogistic, mixture, lognormal. I have to them sum up those losses and that counts as the first aggregate loss. I have to do this 2000 times and then fit those 2000 values into a distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Richard referred to me an article that tells me how to get parameters of a translated gamma distribution to which I should consider fitting simulated aggregated loss values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The parameters depend on moments of S (or. in Richard's terms, L):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/1h3Ih.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I simulate the parameters, as we would expect I get different values each time. The values for $\alpha$ and $\beta$ don't vary much and seem to be close to zero, but $x_0$ seems to vary each time. Iirc, I got values ranging from -100,000 to -600,000. How should I know what $x_0$ to use? Do I get an average of 1000 x_0's?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This would seems impractical even if it were 100 x_0's since each x_0 is obtained from 2000 simulations (the requirement of the project).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Btw, I am assuming the $E(S^n)$'s can be approximated with mean($S^n$)'s. &lt;a href=&quot;https://quant.stackexchange.com/questions/16496/compute-moments-of-aggregate-loss-using-monte-carlo&quot;&gt;Is that right?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cross-posted: &lt;a href=&quot;https://stats.stackexchange.com/questions/136829/getting-parameter-of-translated-gamma-distribution-from-monte-carlo&quot;&gt;https://stats.stackexchange.com/questions/136829/getting-parameter-of-translated-gamma-distribution-from-monte-carlo&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-02-09T12:44:55.853" Title="Getting Parameter of Translated Gamma Distribution from Monte Carlo" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;monte-carlo&gt;&lt;risk-models&gt;&lt;simulations&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16500" PostTypeId="1" CreationDate="2015-02-08T23:54:24.777" Score="1" ViewCount="621" Body="&lt;p&gt;I'm having trouble understanding DV01 convention. From what I understand it stands for &quot;Dollar value of 1 basis point.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, if I have a bond with DV01 = 0.05, does a portfolio composed of 1,000 of this bond also have DV01 of 0.05? Or would it be proportionally larger, since a 1 basis point increase in this bond would result in a $50 loss for the portfolio?&lt;/p&gt;&#xA;" OwnerUserId="12185" LastEditorUserId="12185" LastEditDate="2015-02-09T01:43:27.480" LastActivityDate="2015-02-09T01:43:27.480" Title="Does DV01 grow proportionally to portfolio?" Tags="&lt;fixed-income&gt;&lt;risk&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16501" PostTypeId="2" ParentId="16500" CreationDate="2015-02-09T01:10:35.350" Score="2" Body="&lt;p&gt;If the bond's DV01 is 0.05, then the DV01 of 1000 of this bond will be $0.05\times 1000 = 50$.&#xA;By contrast, if the modified or effective duration of the bond is 0.05, then the modified duration of 1000 of this bond is still 0.05.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2015-02-09T01:10:35.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16502" PostTypeId="1" CreationDate="2015-02-09T01:13:27.630" Score="1" ViewCount="348" Body="&lt;p&gt;I have a econ midterm coming up soon and stumbled upon this question. My approach is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2C=800/(1.12^2)+1200/(1.12^6)=125.71 or C=1245.71/2=622.85&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I have a gut feeling this is wrong. I believe the answer is somewhere around $781.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the following cash flow diagram. What value of C makes the inflow series equivalent to the outflow series at an interest rate of 12% compounded annually? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/3arAA.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="15308" LastActivityDate="2015-05-19T14:21:09.967" Title="Cash flow diagram, interest rate inflow series" Tags="&lt;interest-rates&gt;&lt;finance&gt;&lt;economics&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16503" PostTypeId="2" ParentId="16496" CreationDate="2015-02-09T08:17:39.000" Score="1" Body="&lt;p&gt;as you post 3 questions on this topic and after reading them: this is homerwork/study material- right?&#xA;So for comparing Fast Fourier, MC and Panjer there are tons of publications out there.&#xA;For the formulas for the momemts of $S$ look &lt;a href=&quot;http://www.casact.org/pubs/forum/11spforum/Halliwell.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; or google &quot;moments in the collective risk model&quot;.&#xA;You should notice that:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If you know the distribution of $N$ and $X$ then you know the moments and using those formulas you can calculate the moments of $S$ without MC. Just plug in.&lt;/li&gt;&#xA;&lt;li&gt;If you do MC then you can work on the sample directly and calculate quantiles (e.g. VaR) or an empirial estimate of expected shortfall. Apply statistics (method of moments) to the sample.&lt;/li&gt;&#xA;&lt;li&gt;If you fit a distribution and you know its density then use &lt;a href=&quot;http://en.wikipedia.org/wiki/Maximum_likelihood&quot; rel=&quot;nofollow&quot;&gt;maximum-likelihood&lt;/a&gt; - it does not need the moments to exist.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-02-09T08:17:39.000" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16504" PostTypeId="2" ParentId="16498" CreationDate="2015-02-09T09:15:04.797" Score="1" Body="&lt;p&gt;I though about this one more time:&#xA;&lt;a href=&quot;http://en.wikipedia.org/wiki/Method_of_moments_%28statistics%29&quot; rel=&quot;nofollow&quot;&gt;method of moments&lt;/a&gt; means that you do the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;calculate some statistics (i.e. the moments) on the sample &lt;/li&gt;&#xA;&lt;li&gt;express the moments of the distribution that you want to fit in terms of the parameters of this distribution&lt;/li&gt;&#xA;&lt;li&gt;solve the resulting system of equations. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you estimate $E[S^n]$ by averaging the $S_k,k=1,\ldots,K$ of the sample that you have generated by MC simply means that you apply the empirical distribution function in order to &#xA;calculate this quantity. &#xA;I.e.&#xA;$$&#xA;E[S^n] \approx \sum_{k=1}^K p_k S^n_k = \frac1K \sum_{k=1}^K S^n_k&#xA;$$&#xA;and $p_k = 1/K$ for all $k$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that while E[S^n] maybe does not exist the rhs always will. Large variations of the rhs indicate that either convergence is very slow (in the case of heavy tails) or&#xA;that the expression does not exist.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-02-09T12:44:55.853" LastActivityDate="2015-02-09T12:44:55.853" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16506" PostTypeId="1" CreationDate="2015-02-09T18:06:32.013" Score="0" ViewCount="189" Body="&lt;p&gt;How can I extract expectations about future rates from prices of floating-rate bonds? Please, give reference to any articles, if possible. Thank you in advance.&lt;/p&gt;&#xA;" OwnerUserId="13305" LastActivityDate="2015-02-10T06:16:00.713" Title="Floating-rate bond" Tags="&lt;bond-yields&gt;&lt;floating-rate&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16507" PostTypeId="1" CreationDate="2015-02-09T18:37:45.350" Score="5" ViewCount="1643" Body="&lt;p&gt;Suppose I have a stock selection universe of 100 stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have estimated the covariance matrix of this 100 stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to create an equaly-weighted basket of 5 stocks which has the lowest volatility possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could I modify knapsack algorithms to solve this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't just use the standard algorithm, as the total volatility is not the sum of the constituent volatilities, but involves considering the correlations as well.&lt;/p&gt;&#xA;" OwnerUserId="6392" LastEditorUserId="20795" LastEditDate="2019-09-08T03:54:20.713" LastActivityDate="2019-09-08T03:54:20.713" Title="How to apply the &quot;Knapsack Problem&quot; to minimise a portfolio's volatility?" Tags="&lt;volatility&gt;&lt;portfolio-optimization&gt;&lt;modern-portfolio-theory&gt;&lt;optimization&gt;&lt;algorithm&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16508" PostTypeId="2" ParentId="115" CreationDate="2015-02-09T18:47:57.323" Score="3" Body="&lt;p&gt;For starters, one can argue they provide a better fit to the distribution of asset returns than a Normal distribution simply because stable distributions allow for more degrees of freedom. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had a discussion with a very well-known financial mathematician on the subject of using stable distributions as the return process for derivatives pricing, and his first comment regarded indeterminacy. The moments exist only in special cases. Interpreting or manipulating any point estimates or moments of the distribution that don't exist may yield results from a computational perspective, but theoretically, you may encounter problems. For example, how can you empirically estimate and interpret the volatility of a stable distribution when you know it has infinite variance?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm surprised John Nolan's &lt;a href=&quot;http://academic2.american.edu/~jpnolan/&quot; rel=&quot;nofollow&quot;&gt;work&lt;/a&gt; is not referenced here yet. I found his books and papers to be quite enlightening with respect to the applicability of stable distributions in finance. &lt;/p&gt;&#xA;" OwnerUserId="6437" LastActivityDate="2015-02-09T18:47:57.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16509" PostTypeId="1" AcceptedAnswerId="16510" CreationDate="2015-02-09T18:50:24.717" Score="1" ViewCount="318" Body="&lt;p&gt;There are some standard models for forecasting volatility (e.g., GARCH) and for forecasting returns (e.g., factor models). What kind of standard models exist for forecasting future correlation between securities?&lt;/p&gt;&#xA;" OwnerUserId="5251" LastActivityDate="2015-02-09T20:57:08.933" Title="How can I forecast future correlation?" Tags="&lt;correlation&gt;&lt;forecasting&gt;&lt;covariance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16510" PostTypeId="2" ParentId="16509" CreationDate="2015-02-09T20:57:08.933" Score="2" Body="&lt;p&gt;One common &quot;model&quot; is to assume the correlation to be constant, such as in a CCC-MVGARCH model. If you want a review of different multivariate GARCH models, you could look at:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Silvennoinen and Täräsvirta 2009, Multivariate Garch models, in Handbook of financial time series. &lt;/p&gt;&#xA;" OwnerUserId="8039" LastActivityDate="2015-02-09T20:57:08.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16511" PostTypeId="2" ParentId="16475" CreationDate="2015-02-09T22:59:16.777" Score="0" Body="&lt;p&gt;It seems like it is related to a situation where someone can retrieve their principal payment for an object that brings in some income, such as buying a new machine that is highly productive.  This income, and initial payment can be considered as an annuity, therefore it can be treated like a sinking fund problem.  Although this is just one example, I hope this answers my question a bit.&lt;/p&gt;&#xA;" OwnerUserId="15287" LastActivityDate="2015-02-09T22:59:16.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16512" PostTypeId="2" ParentId="16481" CreationDate="2015-02-10T03:24:49.417" Score="8" Body="&lt;p&gt;Perhaps overly simplistic and repeating the pt above, but when doing statistics, ideally we want to compare like with like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Returns can be comparable with each other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Prices on the other hand always depend on the previous price.&lt;/p&gt;&#xA;" OwnerUserId="7682" LastActivityDate="2015-02-10T03:24:49.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16513" PostTypeId="2" ParentId="8896" CreationDate="2015-02-10T04:01:41.723" Score="-2" Body="&lt;p&gt;Trying to start framework which allows lots of flexibility. &lt;a href=&quot;https://github.com/bpsmith/tia&quot; rel=&quot;nofollow&quot;&gt;https://github.com/bpsmith/tia&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15314" LastActivityDate="2015-02-10T04:01:41.723" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16515" PostTypeId="2" ParentId="16506" CreationDate="2015-02-10T06:10:42.620" Score="4" Body="&lt;p&gt;While you may be able to arrive at some answer to this question empirically with a bit of research, theoretically I don't know if there is a formulaic/mathematical way to extract expectations of future rates from floaters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason is that, &lt;em&gt;theoretically&lt;/em&gt;, a floating rate note's price is determined only from the interest rate corresponding to the next payment/reset date, that is, ${t_{i + 1}}&#xA;% MathType!MTEF!2!1!+-&#xA;% feaagKart1ev2aqatCvAUfKttLearuqr1ngBPrgarmqr1ngBPrgitL&#xA;% xBI9gBamXvP5wqSXMqHnxAJn0BKvguHDwzZbqegm0B1jxALjhiov2D&#xA;% aeHbuLwBLnhiov2DGi1BTfMBaebbfv3ySLgzGueE0jxyaibaieYdh9&#xA;% qrpeeu0dXdh9vqqj-hEeeu0xXdbba9arpi0-irpK0dbba91qpK0-vr&#xA;% 0RYxir-dbbc9q8aq0-yqpe0xbba9suk9fr-xfr-xfrpiWZqaaeaabi&#xA;% GaciaacaqabeaadaabauaaaOqaaiabdsha0naaBaaaleaacqWGPbqA&#xA;% cqGHRaWkcqaIXaqmaeqaaaaa!4575!&#xA;$. On a floater's reset date, it is priced at par using $r\left( {{t_i},{t_{i + 1}}} \right)&#xA;% MathType!MTEF!2!1!+-&#xA;% feaagKart1ev2aqatCvAUfKttLearuqr1ngBPrgarmqr1ngBPrgitL&#xA;% xBI9gBamXvP5wqSXMqHnxAJn0BKvguHDwzZbqegm0B1jxALjhiov2D&#xA;% aeHbuLwBLnhiov2DGi1BTfMBaebbfv3ySLgzGueE0jxyaibaieYdh9&#xA;% qrpeeu0dXdh9vqqj-hEeeu0xXdbba9arpi0-irpK0dbba91qpK0-vr&#xA;% 0RYxir-dbbc9q8aq0-yqpe0xbba9suk9fr-xfr-xfrpiWZqaaeaabi&#xA;% GaciaacaqabeaadaabauaaaOqaaiabdkhaYnaabmaabaGaemiDaq3a&#xA;% aSbaaSqaaiabdMgaPbqabaGccqGGSaalcqWG0baDdaWgaaWcbaGaem&#xA;% yAaKMaey4kaSIaeGymaedabeaaaOGaayjkaiaawMcaaaaa!4C57!&#xA;$. In between reset dates, it may not be priced at par, but its price is still determined using that same rate. So a floater's price should only be reflective of the rate attached to the next reset date. This is what the theory says anyway, market supply/demand may change some things.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, you might be able to make an argument that market forces will tend to change the floater's price in anticipation of what the price will be after the next payment. For example, if you have quarterly payments and you're getting close to a reset date, the price might depart from what it should theoretically be if investors look at the yield curve and see that the 0.25 year rate changed a lot from where it was when the last payment was made.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for rates further out than ${t_{i + 1}}&#xA;% MathType!MTEF!2!1!+-&#xA;% feaagKart1ev2aqatCvAUfKttLearuqr1ngBPrgarmqr1ngBPrgitL&#xA;% xBI9gBamXvP5wqSXMqHnxAJn0BKvguHDwzZbqegm0B1jxALjhiov2D&#xA;% aeHbuLwBLnhiov2DGi1BTfMBaebbfv3ySLgzGueE0jxyaibaieYdh9&#xA;% qrpeeu0dXdh9vqqj-hEeeu0xXdbba9arpi0-irpK0dbba91qpK0-vr&#xA;% 0RYxir-dbbc9q8aq0-yqpe0xbba9suk9fr-xfr-xfrpiWZqaaeaabi&#xA;% GaciaacaqabeaadaabauaaaOqaaiabdsha0naaBaaaleaacqWGPbqA&#xA;% cqGHRaWkcqaIXaqmaeqaaaaa!4575!&#xA;$, I don't know how you'd extract those expectations, simply because the price will reset to par when the next payment is made. Maybe if the market moves the price away from par on a payment date or sufficiently far from its theoretical value in between payments you could glean an idea of where the market thinks rates are going. But you'd have to do some research to see if that's true.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Sorry no articles/citations. These are just thoughts derived from floating rate bond pricing basics, which you can find pretty easily with Google.)&lt;/p&gt;&#xA;" OwnerUserId="7385" LastEditorUserId="7385" LastEditDate="2015-02-10T06:16:00.713" LastActivityDate="2015-02-10T06:16:00.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16516" PostTypeId="2" ParentId="16481" CreationDate="2015-02-10T07:47:04.780" Score="4" Body="&lt;p&gt;Just a bit of illustration added to @John's answer.&#xA;Look at log prices $\log(P_t)$, assume that you know $P_0$ then&#xA;$$&#xA;\log(P_t) = \log(P_0) + r_1 + \cdots r_t&#xA;$$&#xA;where $r_i = \log(P_i)-\log(P_{i-1})$ are the log returns.&#xA;By modelling the log-returns (which as already said take values on the whole real line which is a nice property for modelling) we model the 'atoms' of the prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There things as changing volatility (of returns) and volatility clustering but as a starting point we can assume the volatility of $r$ as constant even then the volatility&#xA;of $\log(P_t)$ would be increasing as more and more summands enter. Imagine what happens if we look at reality where the volatility of $r$ is stochastic or at least changing (hetero-skedasticity).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Meucci in his work looks at &lt;a href=&quot;http://symmys.com/node/85&quot; rel=&quot;nofollow noreferrer&quot;&gt;invariant quantities in financial markets&lt;/a&gt;. Following his illustrations you can convince yourself that returns can more easily be assumed to be invariant than prices. @John has already answered a &lt;a href=&quot;https://quant.stackexchange.com/questions/4160/discrete-returns-versus-log-returns-of-assets&quot;&gt;similar question&lt;/a&gt; quite exactly 2 years ago.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-02-10T15:02:07.053" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16517" PostTypeId="1" AcceptedAnswerId="16521" CreationDate="2015-02-10T12:11:06.790" Score="3" ViewCount="424" Body="&lt;p&gt;I've read in some places that mean reversion parameters for a rates model, eg Hull White, can be estimated directly from the current yield curve. However I've not been able to find anything more on this. Any pointers on where to look?&lt;/p&gt;&#xA;" OwnerUserId="7166" LastActivityDate="2015-02-10T16:03:23.943" Title="Estimating mean reversion" Tags="&lt;mean-reversion&gt;&lt;hullwhite&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16518" PostTypeId="1" CreationDate="2015-02-10T14:32:59.630" Score="2" ViewCount="126" Body="&lt;p&gt;Suppose I want to estimate the following VAR(1) model:&#xA;$$&#xA;Y_t = \mu + \Phi Y_{t-1} + \varepsilon_t&#xA;$$&#xA;where $Y_t=(y_{1t}, y_{2t},…,y_{kt})'$, $\mu=(\mu_1,…,\mu_{k})’$ and $\Phi$ a matrix of coefficients. I’m interested in obtaining the coefficients in $\Phi$ such that the resulting vector of predicted values $\hat{Y}_t = (\hat{y}_{1t}, \hat{y}_{2t},…,\hat{y}_{kt})’$ obeys some constraints. Just to give an unrealistic example I want to estimate the $\Phi$ matrix via least squares such that $3\hat{y}_{1t} + 2\hat{y}_{2t}\geq 0$ and $\hat{y}_{3t}+\hat{y}_{4t}+\hat{y}_{5t}\geq0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I do it? In particular how can I implement it in MATLAB?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT : so far my approach has been to minimise the sum of squared errors obtained by every equation of the VAR(1). Suppose I have a bivariate VAR(1), my problem has been :&#xA;$$&#xA;\min_{\mu,\Phi} e_1’e_1 + e_2’e_2&#xA;$$&#xA;$$&#xA;\text{s.t. constraint 1,2,3...} &#xA;$$&#xA;which I tried to solve with the fseminf function in MATLAB. Is there some better way? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT 2: Notice that the constrain is on the fitted values, not on the estimated coefficients&lt;/p&gt;&#xA;" OwnerUserId="8028" LastEditorUserId="8028" LastEditDate="2015-02-10T14:54:48.593" LastActivityDate="2015-02-10T14:54:48.593" Title="How to estimate constrained a constrained VAR(1) with MATLAB?" Tags="&lt;time-series&gt;&lt;matlab&gt;&lt;multivariate&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16519" PostTypeId="2" ParentId="10899" CreationDate="2015-02-10T14:53:38.543" Score="1" Body="&lt;p&gt;A risk measure $\rho$ applied to time series $X \in \mathbb{R^n}$ yields $Y \in \mathbb{R} $. i.e. $\rho: \mathbb{R^n} \rightarrow \mathbb{R}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for implementation (using R), see &lt;a href=&quot;http://manuge.ca/vars-in-r-var-tvar-and-rvar/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A look at the formulas for VAR and ES (which is exactly the same as CVAR) should clear up any confusion.&lt;/p&gt;&#xA;" OwnerUserId="6437" LastActivityDate="2015-02-10T14:53:38.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16521" PostTypeId="2" ParentId="16517" CreationDate="2015-02-10T16:03:23.943" Score="2" Body="&lt;p&gt;Have you tried:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1514192&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1514192&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It should cover it, anyway Hull White fits the HJM framework so you should be able to calibrate it to swaptions or something if not the yield curve&lt;/p&gt;&#xA;" OwnerUserId="13415" LastActivityDate="2015-02-10T16:03:23.943" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16522" PostTypeId="2" ParentId="16492" CreationDate="2015-02-10T16:31:19.397" Score="4" Body="&lt;p&gt;Here is a list of vendors connected to OPRA directly who can supply such data. &lt;a href=&quot;http://www.opradata.com/related_info/vendor_list.jsp&quot; rel=&quot;nofollow&quot;&gt;http://www.opradata.com/related_info/vendor_list.jsp&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like yourself I looked at Xignite. They have a nice REST API, though not streaming. But pricing is such that it is clear they only want to cater to institutions. Btw, with a $30K budget you can probably become a Tier1 quote data provider yourself. But you will be a good one, charging the rest of us reasonable prices ;)&lt;/p&gt;&#xA;" OwnerUserId="7973" LastActivityDate="2015-02-10T16:31:19.397" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16524" PostTypeId="1" CreationDate="2015-02-10T20:48:35.823" Score="1" ViewCount="449" Body="&lt;p&gt;I work as a Quant for an Asset Management and Insurance company and have recently enrolled for Masters degree in Computer Science. I am thinking about investigating how important having a &quot;good&quot; optimizer is for portfolio optimization / asset allocation problems in the presence of,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Multiple asset classes + multiple risk factors&lt;/li&gt;&#xA;&lt;li&gt;Different risk-adjusted-return objective functions,&lt;/li&gt;&#xA;&lt;li&gt;Linear constraints as well as VaR or CVaR constraints, and&lt;/li&gt;&#xA;&lt;li&gt;Noise resulting from Monte Carlo Methods and Stochastic Processes&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;My hypothesis is that as you add more 'complexity' to the optimization problem, more traditional local optimization algorithms will struggle to optimize the problem and that it may make more sense to use a global optimization algorithm. It's really just a hypothesis at this point, so I may be totally wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is really two fold, firstly, do you think that this is a worthwhile topic to research, and secondly, can anybody recommend any papers which relates to the above topic(s)? Thanks in advance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. I have read looked over the following questions and answers:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/3934/portfolio-optimisation-with-var-or-cvar-constraints&quot;&gt;portfolio optimisation with VaR (or CVaR)  constraints&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/10977/portfolio-optimization-with-portfolio-cvar-constraint&quot;&gt;Portfolio optimization with Portfolio CVaR Constraint&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="15158" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2015-02-10T23:04:27.023" Title="The importance of good optimizers in Portfolio Optimization" Tags="&lt;portfolio-optimization&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16525" PostTypeId="1" CreationDate="2015-02-10T20:50:28.703" Score="5" ViewCount="3377" Body="&lt;p&gt;I saw some textbooks use B-S equation to explain why gamma and theta have opposite signs in most of the cases. For example, John Hull's classic book.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The explanation is, first write B-S equation in terms of greeks:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{\partial V}{\partial t}+rS\frac{\partial V}{\partial S}+\frac{1}{2}\sigma^2S^2\frac{\partial^2 V}{\partial S^2}=rV$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Theta+rS\Delta+\frac{1}{2}\sigma^2S^2\Gamma=rV$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Theta+\frac{1}{2}\sigma^2S^2\Gamma=r(V-S\Delta)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do we need to assume r=0, in order to draw the conclusion that gamma and theta have opposite signs?&lt;/p&gt;&#xA;" OwnerUserId="15180" LastActivityDate="2020-08-06T01:57:39.030" Title="Why gamma and theta have opposite signs?" Tags="&lt;black-scholes&gt;&lt;greeks&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16526" PostTypeId="2" ParentId="16524" CreationDate="2015-02-10T23:04:27.023" Score="1" Body="&lt;p&gt;Let me try to give you an overview over the different approaches to optimization, and the specific challenges. You'll see that the problem is more a trade-off continuum than a binary choice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All an optimizer does is finding a minimum to a specified problem. If you have an analytically tactable problem, that could be as easy as a lagrangian, usually your problem is much more complex, so you'll need to resort to numerical approaches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With numerical approaches, you have to trade speed against accuracy. The most accurate option is to simply calulate all possible input-output combinations and find the minimum. Then you can start to increase speed by using a clever way to leave out points you don't really need to calculate. For example, pick a point, go to the left by a very short increment, see if the result is better, and either move to that new point, or turn the other way. That's a gradient descent. Obviously this way you'll easily get trapped inside local minimae, often you'd like to avoid that. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next, you can add random jumps to periodically get out of these traps, that's called simmulated annealing. That's a little better, but will not give you stable results if your problem is not sufficiently convex in its parameters. Then you'd need to work on your problem formulation to add convexity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you could use genetic algorithms, starting with sets of inital parameters, compare them, and use some kind of mutation to generate new candidates. By subsequently comparing them, you can often get a pretty accurate location of your global minimum.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see, it's pretty hard to make this tradeoff decision. A common solution is to use multi-step approaches, first find some point in the region of the global minimum, and later refine using gradient descent.&lt;/p&gt;&#xA;" OwnerUserId="1976" LastActivityDate="2015-02-10T23:04:27.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16527" PostTypeId="1" CreationDate="2015-02-10T23:17:49.550" Score="5" ViewCount="1657" Body="&lt;p&gt;There are two subparts to Fundamental Asset Pricing theorem.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The Law Of One Price (LOOP thereafter) holds if and only if there exists a state price vector.&lt;/li&gt;&#xA;&lt;li&gt;In a market in which the LOOP holds, the state price vector is unique if and only if the market is complete.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;How can we prove (1) and (2) mathematically?&lt;/p&gt;&#xA;" OwnerUserId="15319" LastEditorUserId="467" LastEditDate="2015-02-11T04:34:12.687" LastActivityDate="2015-03-14T21:21:14.343" Title="How to prove the &quot;Law of one price&quot; theorem?" Tags="&lt;asset-pricing&gt;&lt;proof&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16528" PostTypeId="2" ParentId="16507" CreationDate="2015-02-11T02:58:46.110" Score="3" Body="&lt;p&gt;This problem is not interesting enough, because putting your money in the bank guarantees you zero volatility (and a zero return on investment). In practice, whatever set of assets you chose you would get a very extreme solution (e.g. 100% weight on one asset with very low volatility.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With a minor tweak, you can get a very interesting problem. You can constraint your portfolio to have at least an expected return of $R$. Now you get a mean-variance optimization problem, with cardinality constraints:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ min \,\,\, w^TCw $$&#xA;subject to $$ r^Tw = R $$&#xA;$$ w \ge 0 $$&#xA;$$ \Sigma w_i = 1 $$&#xA;and subject to &quot;no more than 5 weights are non-zero (positive)&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $C$ is the covariance matrix and $w$ your weights vector. There is a way to formally define the last constraint using indicator integer variables, but I am not doing this here for the sake of simplicity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, to the second part of the question:&#xA;Here is why the knapsack problem is not a fitting approach to this problem. The knapsack problem is really hard because it does not allow fractional solutions. In portfolio optimization you usually assume that you can have a fractional amount of an asset. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mean-variance optimization is a convex &lt;a href=&quot;http://en.wikipedia.org/wiki/Quadratic_programming&quot; rel=&quot;nofollow&quot;&gt;quadratic programming&lt;/a&gt; (QP) optimization problem, which can be solved extremely fast with many widely available solvers. Mean-variance optimization with cardinality constraints (e.g. you have to have exactly 5 assets in the portfolio) is a problem that is harder, a Mixed Integer Real optimization problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use heuristics to obtain a very satisfactory solutions. Here is a strategy: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Solve the mean-variance problem without the cardinality constraints. The solution is usually extreme in that there is a small number of non-zero assets anyway.&lt;/li&gt;&#xA;&lt;li&gt;Then you can brute-force your way through the cardinality constraint or use heuristics (that could be for example based on a ranking of the sharpe ratio - which also is the value of the dual variables I believe) to obtain a satisfactory solution. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If you want to take a look into papers on mean-variance optimization with cardinality constraints, here is one of the most cited papers:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.unet.univie.ac.at/~a0827651/HW2/portfolio/portfolio.pdf&quot; rel=&quot;nofollow&quot;&gt;Heuristics for cardinality constrained portfolio optimisation&lt;/a&gt; (T.-J. Chang, N. Meade, Beasley)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Be mindful that metaheuristics, such as Genetic Algorithms are largely black box, and you would not get much educational value about the underlying securities by implementing them.&lt;/p&gt;&#xA;" OwnerUserId="13311" LastEditorUserId="13311" LastEditDate="2015-02-11T12:59:46.020" LastActivityDate="2015-02-11T12:59:46.020" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16530" PostTypeId="1" CreationDate="2015-02-11T03:35:57.667" Score="3" ViewCount="494" Body="&lt;p&gt;I was thinking of using Geometric Brownian Motion to forecast future prices of timber (say one variable, the stumpage price of sawtimber).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tested the time series with Augmented Dickey-Fuller test and found the data series as non-stationary which means the series follows a random walk. Then, I went on to use it for price forecast.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, my professor comes and says we cannot use GBM to forecast future prices that has long horizon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my case, I wanted to use quarterly price into 10 years or 15 years into the future. I know GBM is a good model for stock prices for short periods, but is 10 or 15 years too far considering the confidence limits and probable volatility? &lt;/p&gt;&#xA;" OwnerUserId="15320" LastEditorUserId="467" LastEditDate="2015-02-11T06:01:41.520" LastActivityDate="2015-02-11T06:01:41.520" Title="Is Geometric Brownian Model suitable for long term price forecast?" Tags="&lt;brownian-motion&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16532" PostTypeId="1" CreationDate="2015-02-11T04:09:44.437" Score="4" ViewCount="211" Body="&lt;p&gt;Is there a way to calculate the price of a binary option (i.e., an option that pays out 1 dollar when the stock price hits $x$ amount) using market call/put option prices, forward prices, etc. for a stock?  Assume no interest rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Provided that the company never goes bankrupt, shouldn't the value of this option be 1 dollar?  If the stock price follows a random walk, it will hit $x$ in finite time with probability 1. &lt;/p&gt;&#xA;" OwnerUserId="15322" LastEditorUserId="467" LastEditDate="2015-02-11T08:05:39.940" LastActivityDate="2015-08-25T17:19:40.160" Title="How to value a Binary Option using market data?" Tags="&lt;option-pricing&gt;&lt;binary-options&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16533" PostTypeId="2" ParentId="16525" CreationDate="2015-02-11T13:49:42.123" Score="4" Body="&lt;p&gt;I think you are answering your own question. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hull states: &quot;When $\Theta$ is large and positive, $\Gamma$ &lt;strong&gt;&lt;em&gt;tends to&lt;/em&gt;&lt;/strong&gt; be large and negative and vice versa.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, you can expect $r(V-S \Delta)$ to be quite small. &lt;/p&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2015-02-11T13:49:42.123" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16534" PostTypeId="1" AcceptedAnswerId="16541" CreationDate="2015-02-11T14:03:16.230" Score="4" ViewCount="734" Body="&lt;p&gt;Have you ever tackled a finance problem with Approximate Dynamic Programming?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have only used dynamic programming for simple examples like a optimal extraction in mining.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Do you have canonical reading material that you recommend?&lt;/li&gt;&#xA;&lt;li&gt;Do you have any code implementation example (in any language or pseudo code)?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="15327" LastEditorUserId="467" LastEditDate="2015-02-12T06:39:33.850" LastActivityDate="2015-02-12T06:39:33.850" Title="Do you have a good application example of Approximate Dynamic Programming?" Tags="&lt;programming&gt;&lt;dynamic&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16535" PostTypeId="1" AcceptedAnswerId="16544" CreationDate="2015-02-11T15:36:46.560" Score="4" ViewCount="825" Body="&lt;p&gt;I use Performance Analytics package in R to compare annualized and cumulative return of a portfolio. My expectation is that both should be equal over a period of 1-year but results tell me I'm wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is not clear for me how annualized return could be 122.55 from 2014-01-01 to 2014-12-31 while the cumulative return is 205.71 over the same period. Geometric is set to its default value (&lt;code&gt;TRUE&lt;/code&gt;) and I think number of period in a year is set by default to 252 (daily scale).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;statistic &amp;lt;- rbind(Return.annualized(bench)*100, Return.cumulative(bench)*100)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To know better what is the return I can expect from this portfolio could somebody please explain to me why both returns are not equal ?&lt;/p&gt;&#xA;" OwnerUserId="15328" LastEditorUserId="7186" LastEditDate="2015-02-12T15:31:54.403" LastActivityDate="2015-02-12T15:31:54.403" Title="Why annualized return and cumultive return aren't equal over 1-year period with Performance Analytics package in R?" Tags="&lt;programming&gt;&lt;r&gt;&lt;performanceanalytics&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16536" PostTypeId="1" AcceptedAnswerId="16542" CreationDate="2015-02-11T15:36:48.040" Score="1" ViewCount="454" Body="&lt;p&gt;In financial research papers, I have seen several times that the lag length in an ARMA model has been determined using BIC.  Do the researchers estimate the lag length before considering other variables?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would you compare the BIC values of the just the dependent variable and its lags or would you compare the BIC of the full model with the other exogenous variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should I use method 1)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BIC1   Y(t) = c + Y(t-1) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;BIC2   Y(t) = c + Y(t-1) +  Y(t-2) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or should I use method 2) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;BIC1  Y(t) = c + Y(t-1) + x1 + x2 + x3&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BIC2  Y(t) = c + Y(t-1) + Y(t-2) + x1 + x2 + x3&lt;/p&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;" OwnerUserId="15329" LastEditorUserId="15329" LastEditDate="2015-02-12T15:49:50.723" LastActivityDate="2015-02-17T13:12:29.210" Title="How do I use BIC (Bayesian Information Criterion) to estimated model AR (auto regressive) lag?" Tags="&lt;research&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16537" PostTypeId="1" AcceptedAnswerId="16587" CreationDate="2015-02-11T15:49:18.537" Score="4" ViewCount="479" Body="&lt;p&gt;In CDS markets we can sometimes observe inverted CDS curves or unusually steep curves. I am just wondering at what level certain curves become non-realistic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. if we have 500bp for the 1-Year tenor and 100bp for the 2-Year tenor we could buy a 2-Year CDS and sell a 1-Year CDS both on the same notional. If there is a default between Year 0 and Year 1 the two CDS cancel out. If the default is between Year 1 and Year 2, then we receive (1-Recovery)*Notional. Regardless of when/if default happens, the P&amp;amp;L of our fees (only pay 100bp over two years, receive 500bp over one year) will always be positive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems like an arbitrage scenario for when curves are too strongly inverted. But are there any actual mathematical conditions for when given curves are not realistic anymore?&lt;/p&gt;&#xA;" OwnerUserId="6621" LastActivityDate="2015-04-17T08:16:02.840" Title="When do CDS curves yield arbitrage opportunities?" Tags="&lt;credit&gt;&lt;cds&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16538" PostTypeId="1" CreationDate="2015-02-11T17:46:49.333" Score="7" ViewCount="1451" Body="&lt;p&gt;I have downloaded some daily historical option data for a timespan of 10 years and want to perform trading backtests with them. Data are European index options, on ODAX. My question is about realistic assumptions on backtest fillings:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) valid bid/asks: I would assume the mean of bid and ask as filling price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) bid and ask=zero: This happens mostly for some of the ITM options, the underlying beeing more than&#xA;300 points away from ATM-strike. Not sure what to do: my idea - market maker has to take counterparty,&#xA;so I assume realistic quotes and realistic bid ask spread and again mean of bid and ask.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;c) bid and ask unrealisticly high/unrealisticly low: happens both ITM and OTM, same procedure as in b)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are those realistic filling rules? If not, how should the rules be?&lt;/p&gt;&#xA;" OwnerUserId="11635" LastActivityDate="2019-02-19T20:04:12.630" Title="Backtesting on historical option data" Tags="&lt;options&gt;&lt;backtesting&gt;&lt;historical-data&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16539" PostTypeId="2" ParentId="16392" CreationDate="2015-02-11T20:12:42.300" Score="5" Body="&lt;p&gt;I've run into this issue as well. I can't find any official documentation, but the issue arises because the SEC makes up CUSIPs for all of the options on the list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It does this by taking the first 6 digits of the underlying equity (which makes sense, as this represents the issuer, which should be the same for the stock and the option), and then for the 7th and 8th digit, it uses 90 for calls and 95 for puts. It then uses the 9th digit from the underlying stock as the 9th digit for the option, which is why the checksum doesn't work.&lt;/p&gt;&#xA;" OwnerUserId="15330" LastActivityDate="2015-02-11T20:12:42.300" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16540" PostTypeId="1" AcceptedAnswerId="16543" CreationDate="2015-02-11T21:05:21.963" Score="6" ViewCount="1480" Body="&lt;p&gt;I understand that the delta of an option portfolio is just the sum of the deltas of the individual option positions.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What about the other Greeks like gamma and vega? Do the vega and gamma of a portfolio also equal the sum of the individual vegas and gammas of the option positions?&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2018-05-16T17:06:33.623" Title="Can I add the greeks of individual postions to obtain greeks for the portfolio" Tags="&lt;portfolio-management&gt;&lt;greeks&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16541" PostTypeId="2" ParentId="16534" CreationDate="2015-02-11T22:17:34.403" Score="3" Body="&lt;p&gt;I totally missed the coining of the term &quot;Approximate Dynamic Programming&quot; as did some others. Also, in my thesis I focused on specific issues (return predictability and mean variance optimality) so this might be far from complete. That's enough disclaiming.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's start with an old overview: &lt;a href=&quot;http://www.worldscientific.com/worldscibooks/10.1142/3548&quot; rel=&quot;nofollow&quot;&gt;Ralf Korn - Optimal Portfolios&lt;/a&gt;. &lt;a href=&quot;http://mitpress.mit.edu/books/numerical-methods-economics&quot; rel=&quot;nofollow&quot;&gt;Kenneth Judd - Numerical Methods in Economics&lt;/a&gt; gave me some good background on approximation of functions. You may not need it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Brandt, M.W. et al. - &quot;A Simulation Approach to Dynamic Portfolio Choice with an Application to Learning About Return Predictability&quot; does what it says and uses value function approximation to do it. Van Binsbergen, J.H. and Brandt, M.W. - &quot;Solving dynamic portfolio choice problems by recursing on optimized portfolio weights or on the value function?&quot; improve upon this idea. Garlappi, L. and Skoulakis, G. - &quot;Solving Consumption and Portfolio Choice Problems: The State Variable Decompostion Method&quot; provide important numerical improvements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The literature of &lt;a href=&quot;http://www.athenasc.com/dpbook.html&quot; rel=&quot;nofollow&quot;&gt;Bertsekas&lt;/a&gt; should be of interest as his papers are often cited. However I haven't looked at them yet.&#xA;I hope this interests you, if this is not what you meant, do tell.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2015-02-11T22:17:34.403" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16542" PostTypeId="2" ParentId="16536" CreationDate="2015-02-11T23:42:40.537" Score="0" Body="&lt;p&gt;Generally it depends on the model you need to compare; anyway, if I understood your question, you have to estimate the model (2) and in this case it is convenient to compare the Bayesian Information Criterion only for the model (2), since it is exactly what you want to run in the end.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Said that, I suggest you to look at the different criteria that exists in literature (AIC, BIC, DIC, FIC, R2,...) in order to be able to choose the one that is more suitable for your needs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, in my humble opinion, it is not convenient to use the BIC because of the fact it is neither a good estimator of the Kullback-Leibler's divergence (on which it is based) and asymptotically efficient, as suggested by &lt;a href=&quot;http://www.springer.com/statistics/statistical+theory+and+methods/book/978-0-387-95364-9&quot; rel=&quot;nofollow&quot;&gt;Burnham &amp;amp; Anderson (2002)&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suggest you to use the AIC in the place of the BIC, that, at least, it is more precise from a theoretical point of view.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, choose the model with the lowest statistic score (in both the case).&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-02-11T23:42:40.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16543" PostTypeId="2" ParentId="16540" CreationDate="2015-02-12T01:05:11.057" Score="5" Body="&lt;p&gt;most models in financial maths are linear so prices and Greeks just add. This is in particular true of Black--Scholes so Yes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, once one starts taking into account value adjustments non-linearities appear and it is a lot more complicated.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-02-12T01:05:11.057" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16544" PostTypeId="2" ParentId="16535" CreationDate="2015-02-12T10:52:29.250" Score="2" Body="&lt;p&gt;The documentation of the R package &lt;a href=&quot;http://cran.r-project.org/web/packages/PerformanceAnalytics/PerformanceAnalytics.pdf&quot; rel=&quot;nofollow&quot;&gt;PerformanceAnalytics&lt;/a&gt; provides examples for both the &lt;code&gt;Return.annualized()&lt;/code&gt; and &lt;code&gt;Return.cumulative()&lt;/code&gt; functions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The annualized return scales up sub-annual returns to an annual return. You may observe the difference by typing &lt;code&gt;Return.annualized&lt;/code&gt; (without any parameters) in your R console to see the functions implementation. Look for how the return is calculated if geometric linkage is applied:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; if (geometric) {&#xA;            result = prod(1 + R)^(scale/n) - 1&#xA;        }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The cumulative returns are actual returns that are calculated over an annual period. The formula for the calculation is similar, but lacks the scaling piece:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;else {&#xA;            return(prod(1 + R) - 1)&#xA;        }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If the period being analyzed is exactly one year annualized and cumulative returns are the same:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;data(managers)&#xA;Return.annualized(managers[121:132])&#xA;Return.cumulative(managers[121:132,])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But if the period is not equal to one year they are expected to be different:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;data(managers)&#xA;Return.annualized(managers[115:132])&#xA;Return.cumulative(managers[115:132,])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7186" LastActivityDate="2015-02-12T10:52:29.250" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16545" PostTypeId="1" CreationDate="2015-02-12T12:13:05.463" Score="3" ViewCount="277" Body="&lt;p&gt;At this moment, i need to do the analysis of rouble/us dollars exchange rate and the stock market index in Russia, I prefer to do that in a multivariate GARCH model. However, I have a question about the data. Currently, I have both data sets but they are not parallel, in other words, I have the stock market index in 30th Dec, 2014, 5th Jan, 2015, .... which is different from the exchange rate 31th Dec, 2014, 1th Jan, 13th, Jan, ..... I am not sure whether i downloaded the wrong data, otherwise, how should I deal with such case, to delete some days from both datasets?&lt;/p&gt;&#xA;" OwnerUserId="15201" LastActivityDate="2021-04-06T00:02:40.227" Title="When the two time series with different length, how could we analysis them with a bivariate GARCH model?" Tags="&lt;garch&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16546" PostTypeId="1" CreationDate="2015-02-12T15:45:49.750" Score="2" ViewCount="42" Body="&lt;p&gt;According to Spanos 2014 &lt;a href=&quot;https://secure.hosting.vt.edu/www.econ.vt.edu/directory/spanos/spanos9.pdf&quot; rel=&quot;nofollow&quot;&gt;Revisiting Haavelmo's Structural econometrics: Bridging the gap between theory and data&lt;/a&gt; Dynamic Stochastic General Equilibrium models are statistically inadequate, in such an order of magnitude as to render them useless.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The most serious problem with DSGE models is that they are often&#xA;  statistically inadequate. Advocates of DSGE modeling, however, have&#xA;  put forward a number of arguments to explain away the unreliability of&#xA;  their evidence, such as ‘the price one has to pay for rigorous and&#xA;  policy-relevant theoretical models’ (Lucas, 1980, p. 696), or simply&#xA;  inevitable: “The models constructed within this theoretical&#xA;  framework are necessarily highly abstract. Consequently, they are&#xA;  necessarily false, and statistical hypothesis testing will reject&#xA;  them. This does not imply, however, that nothing can be learned from&#xA;  such quantitative theoretical exercises.” (Prescott, 1986, p. 10)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Part of my research involves using a partial equilibrium models to simulate a particular segment of an economy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Considering the above, I would like to illustrate failure of a partial equilibrium model. What methods would you use to show that a given equilibrium model is statistically unreliable? &lt;/p&gt;&#xA;" OwnerUserId="15339" LastActivityDate="2015-02-12T15:45:49.750" Title="What methods - inspired by Haavelmo’s Structural Econometrics - can show that a partial equilibrium model is unreliable?" Tags="&lt;statistics&gt;&lt;modeling&gt;&lt;econometrics&gt;&lt;macro&gt;" AnswerCount="0" CommentCount="5" ClosedDate="2015-02-13T12:40:28.270" ContentLicense="CC BY-SA 3.0" />
  <row Id="16547" PostTypeId="2" ParentId="4239" CreationDate="2015-02-12T16:44:38.790" Score="2" Body="&lt;p&gt;More measurable effects to add to your list:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&quot;window dressing&quot; - returns of the fourth quarter or 12th month (i.e. year-end) are higher on average than oher returns; the same to returns of 4th months (qtr-end) vs. others;&lt;/li&gt;&#xA;&lt;li&gt;&quot;herding&quot;: changes in asset-classes shares of &quot;big&quot; funds (whatever you define &quot;big&quot;) granger-cause changes in asset-classes shares of &quot;small&quot; ones; or, broadly, there is some consistent group of portfolios, which changes systematically granger-causes changes in all other portfolios;&lt;/li&gt;&#xA;&lt;li&gt;&quot;home bias&quot; - share of local assets is higher even if mandate allows to diversify more broadly.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Overall, it's very hard to find settings for &quot;classic&quot; - laboratory - biases in real life situations. Usually when you try to do it, i.e. check whether some observed behavior is &lt;em&gt;bias&lt;/em&gt;, you have to state the center - i.e. what you assume as &lt;em&gt;rational&lt;/em&gt; behavior. Which means that you have to answer very hard and requiring question first: what behavior is &quot;right&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say, herding could be both rational and irrational. In CAPM-rationality only beta matters for expected return of the asset (ergo - for the share of the asset in your portfolio) because (1) particular type of rationality is assumed (only risk and return matter, risk-aversiness due to DMU of wealth, etc.etc.), (2) everyone shares this type of rationality, (3) if he doesn't - then he eventually would be out of the market. Then if CAPM holds, only exposure of the stock to some economy-wide risk factor should be priced; no systematic herding should be observed; if it is - it is declared irrational and those who exhibit herding would be finally wiped out by those who does not exhibit herding (i.e. by those for whom only risk-return matter etc etc). But in fact, if you are the only one who cares for risk/return and all CAPM stuff in the world, filled with herders, than you will be the prey, not them. If everyone herds - it's irrational not to herd. Etc etc. &lt;/p&gt;&#xA;" OwnerUserId="6535" LastEditorUserId="6535" LastEditDate="2015-02-12T18:37:30.830" LastActivityDate="2015-02-12T18:37:30.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16548" PostTypeId="1" AcceptedAnswerId="16589" CreationDate="2015-02-12T16:54:15.530" Score="13" ViewCount="20759" Body="&lt;p&gt;I try to understand the basic idea of copulas, however I am still struggling and hope that someone can help me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understood that in general a copula is a function which links several marginal distributions to a multivariate distribution. Turning this idea around: if the joint probability function H() is known, I can extract the copula. However, what I do not understand is the intuition behind the step marked by the red arrow. What is the logic behind that? My problem is also to understand the inverse cumulative density function in this context. Perhaps someone has an illustrative example to make this step more clear to me as a non-mathematician. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/6Jeym.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="13812" LastActivityDate="2021-01-29T04:29:57.117" Title="Copulas simply explained" Tags="&lt;distribution&gt;&lt;copula&gt;&lt;multivariate&gt;&lt;dependence&gt;&lt;density&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="16549" PostTypeId="2" ParentId="16548" CreationDate="2015-02-12T18:03:06.847" Score="7" Body="&lt;p&gt;The best introduction to copulas I know, i.e. with rigour and intuition, is the following.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.garp.org/media/691726/quant_classroom_oct2011.pdf&quot; rel=&quot;noreferrer&quot;&gt;THE QUANT CLASSROOM BY ATTILIO MEUCCI&lt;br&gt;&#xA;A Short, Comprehensive, Practical Guide to Copulas&lt;br&gt;&#xA;Visually introducing a powerful risk management tool to generalize and stress-test correlations&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2015-02-12T18:13:50.433" LastActivityDate="2015-02-12T18:13:50.433" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16550" PostTypeId="2" ParentId="9216" CreationDate="2015-02-12T20:27:08.877" Score="3" Body="&lt;p&gt;In my experience HFT has to balance the reward of any strategy with risk. In the case of a news-based trading strategy, the risk can be enormous, which means the algo will need a very high expected profit in order to trade the news. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After important news events, volatility skyrockets and persists for some time (sometimes even days). If the market were able to agree on the right price shortly after an event, that volatility wouldn't exist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Normal&quot; HFT strategies rely on the law of large numbers to have returns with acceptable risk; a good benchmark would be 10,000 events per day. News that moves the market in a semi-predictable way is rare by HFT standards. My understanding is that news-based strategies are most common on events that are particularly machine-readable (lower risk) and move markets with heavy volume (higher reward). Some examples would be FOMC releases, treasury auction results, employment reports, or oil inventory reports - which move highly liquid markets in somewhat predictable ways. Particularly daring HFTs may be comfortable getting into massive positions if they have good confidence on the market direction, but they need enough volume to make the strategy worthwhile. Often even in these markets you see liquidity clear out ahead of the release of such reports, which makes it even harder to trade the news. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to general market efficiency, even in low-risk situations you often see fairly intuitive inefficiencies stick around. For example &lt;a href=&quot;https://mechanicalmarkets.wordpress.com/2015/01/20/identifying-trader-type-pt-2/&quot; rel=&quot;nofollow&quot;&gt;https://mechanicalmarkets.wordpress.com/2015/01/20/identifying-trader-type-pt-2/&lt;/a&gt; discusses the relationship between an order's age and its alpha and details a corresponding HFT strategy. (Disclosure: I'm the author)&lt;/p&gt;&#xA;" OwnerUserId="15340" LastActivityDate="2015-02-12T20:27:08.877" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16551" PostTypeId="1" CreationDate="2015-02-12T20:48:36.230" Score="0" ViewCount="4083" Body="&lt;p&gt;I understand that BBSW is the reference rate for financial instruments while AUD LIBOR is the interbank rate benchmark.&#xA;However, since AUD LIBOR has been discontinued due to the rigging scandal, can BBSW be considered as an interbank benchmark rate in Australia? &lt;/p&gt;&#xA;" OwnerUserId="15341" LastActivityDate="2015-02-13T03:57:54.100" Title="What is the difference between BBSW and AUD LIBOR?" Tags="&lt;interest-rates&gt;&lt;libor&gt;&lt;benchmark&gt;&lt;interbank-rates&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16552" PostTypeId="1" CreationDate="2015-02-12T20:49:07.613" Score="1" ViewCount="317" Body="&lt;p&gt;Let us say I want to establish a market neutral position. So if I buy 50 shares of stock (SPY) and I want to delta hedge, I sell an ATM covered call. So that brings the position delta to 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I could have also hedged by buying the corresponding volatility ETF VIXY. Since when SPY goes up, VIXY goes down. And vice versa.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how can I figure out how many shares of VIXY to buy to hedge approximately 50 shares of SPY.&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2015-02-12T20:49:07.613" Title="How to hedge a long stock with the corresponding volatility ETF" Tags="&lt;volatility&gt;&lt;vix&gt;&lt;etf&gt;&lt;delta-hedging&gt;&lt;spx&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16553" PostTypeId="1" CreationDate="2015-02-12T20:59:06.250" Score="3" ViewCount="2573" Body="&lt;p&gt;I noticed that Bloomberg and SuperDerivatives both use &quot;Deposit Rates&quot; for the calculation of forward points for currencies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I couldn't find anything online that describes precisely where these rates come from.  Are they just the LIBOR rates in the respective currencies?  Since the deposit rates are quoted out past 1 year terms, this can't be entirely correct.&lt;/p&gt;&#xA;" OwnerUserId="8230" LastActivityDate="2021-05-21T10:24:21.723" Title="Deposit vs. LIBOR rates? (Bloomberg/SuperDerivatives)" Tags="&lt;interest-rates&gt;&lt;bloomberg&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16554" PostTypeId="2" ParentId="16527" CreationDate="2015-02-12T21:12:18.457" Score="1" Body="&lt;p&gt;I just comment your second point, because in the definition i now of the LOP the state price vector (martingale measure) is involved. &lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;assuming the  LOP holds then: &#xA;state price vector is unique &amp;lt;=&gt; the market is complete.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;to proof &quot;=&gt;&quot; look at the trinomial model, show that the model is not complete by trying to find a hedge for a call, afterwards calculate the set of risk-neutral measures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;&amp;lt;=&quot; market complete =&gt; for each derivate $D$ (including indicator variables for each measurable subset) a hedge $H$ exists such that $$D_t = \mathbb{E}_t^Q[D_T e^{r_{T-t}}] ~~~~~~~~~~~~~~(1)$$ for any risk-neutral measure $Q$ and an $t\geq0$ where $r$ is the discount-rate. Now observe $D_0$ is deterministic (not random) and the &lt;em&gt;same&lt;/em&gt; whatever $Q$ we use for pricing. Now assume there a two different risk neutral measure $Q_1,Q_2$ such that $Q_1(A)\neq Q_2(A)$ for some measurable subset. If we &quot;hedge&quot; the indicator variable $1_A$ we get $$\mathbb{E}_0^{Q_1}[1_A e^{r_{T-t}}]=Q_1(A)$$ and $$\mathbb{E}_0^{Q_2}[1_A e^{r_{T-t}}]=Q_2(A).$$ But, this conflicts $(1)$ since the above would induce $\mathbb{E}_0^{Q_1}[1_A e^{r_{T-t}}]\neq\mathbb{E}_0^{Q_2}[1_A e^{r_{T-t}}]$ , hence there exists only one risk neutral measure $Q$ and therefore only one state price vector. &lt;/p&gt;&#xA;" OwnerUserId="6640" LastActivityDate="2015-02-12T21:12:18.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16555" PostTypeId="2" ParentId="16545" CreationDate="2015-02-13T03:00:06.190" Score="0" Body="&lt;p&gt;Usually I do one of the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I change granularity of data: download weekly returns instead of daily;&lt;/li&gt;&#xA;&lt;li&gt;I create &quot;super-laborious days index&quot;: I.e. (1) produce dates index consisting of all possible dates except for Sunday's and Saturday's; (2)  on ALL series in dataset interpolate linearly dates, missing vs. super-index (say, on index A I have returns on A1, A2 and A7 dates, A3 were a national holiday; on B I have B1, B3 and B7: B2 were a holiday; 5 and 6 in both series are Sunday and Saturday; I create superindex C, with dates C1, C2, C3, C4 and then interpolate A3 between A2 and A4 and B2 between B1 and B3). I did that when wrote a paper about daily volatility spillovers in 12 countries across the world - many points where dates were unparalleled, as every nation has its own set of holidays.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="6535" LastEditorUserId="6535" LastEditDate="2015-02-13T03:07:10.707" LastActivityDate="2015-02-13T03:07:10.707" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16556" PostTypeId="2" ParentId="16551" CreationDate="2015-02-13T03:57:54.100" Score="1" Body="&lt;p&gt;AUD LIBOR is no longer quoted. See list of fixes: &lt;a href=&quot;https://www.theice.com/iba/libor&quot; rel=&quot;nofollow&quot;&gt;https://www.theice.com/iba/libor&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;AUD BBSW is quoted by &lt;a href=&quot;http://www.afma.com.au/standards/market-conventions/Bank%20Bill%20Swap%20(BBSW)%20Benchmark%20Rate%20Conventions.pdf&quot; rel=&quot;nofollow&quot;&gt;prime AU banks&lt;/a&gt; and is based on the price of a discounted security while what was formerly the BBA AUD LIBOR was based on quotes by a different (but overlapping) set of rate contributors on a theoretical loan/depo.&lt;/p&gt;&#xA;" OwnerUserId="7459" LastActivityDate="2015-02-13T03:57:54.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16557" PostTypeId="2" ParentId="15838" CreationDate="2015-02-13T04:29:03.387" Score="2" Body="&lt;p&gt;You could use &lt;a href=&quot;http://en.wikipedia.org/wiki/Beta_%28finance%29&quot; rel=&quot;nofollow&quot;&gt;beta ($\beta$)&lt;/a&gt; to get a very crude approximation of the standard deviation ($\sigma$) of the stock. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \beta_s = \rho_{s,m} \frac{\sigma_s}{\sigma_m} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where the subscript $s$ stands for a stock and the subscript $m$ for the market. $\sigma_s$ is known.  You could assume an industry wide correlation ($\rho$) value for stocks in a specific industry (e.g. energy). I do not know how much these correlations vary across different equities.&lt;/p&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2015-02-13T04:29:03.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16558" PostTypeId="2" ParentId="9216" CreationDate="2015-02-13T06:42:55.883" Score="0" Body="&lt;p&gt;You should read &lt;a href=&quot;http://www.worldscientific.com/worldscibooks/10.1142/8967&quot; rel=&quot;nofollow&quot;&gt;Market Microstructure in Practice&lt;/a&gt;, and have a look at the slides of the &lt;a href=&quot;http://market-microstructure.institutlouisbachelier.org&quot; rel=&quot;nofollow&quot;&gt;Market Microstructure: Confronting Many Viewpoints&lt;/a&gt; conference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To go back on your HFT question, you have to pay attention to the difference between &lt;strong&gt;low latency&lt;/strong&gt; and &lt;strong&gt;high frequency&lt;/strong&gt; trading.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;low latency is news trading: can be few times a week, but you have to be the first to take profit of the price change. Some traders use micro-waves connections instead of cables.&lt;/li&gt;&#xA;&lt;li&gt;high frequency is about making the market, and/or using very short term price predictors. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Market makers&lt;/strong&gt; are contributing to the diffusion of information in the price since they synchronize investors having access to information. Typically when they face low latency traders they are adversely selected and loose money (partically compensated by the rebate they have by exchanges), otherwise they earn the bid ask spread. We know how they work, &lt;a href=&quot;http://arxiv.org/abs/1105.3115&quot; rel=&quot;nofollow&quot;&gt;at least theoretically&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should have a look at the &lt;a href=&quot;https://www.aeaweb.org/aer/top20/70.3.393-408.pdf&quot; rel=&quot;nofollow&quot;&gt;Grossman-Stiglitz paradox&lt;/a&gt; if you want to think more about information diffusion in prices. The paper deals with the fact that people need to be paid to investigate on how information influence prices, hence arbitrages should exist, otherwise no one would pay attention to inefficiencies and they will thus never be corrected....&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2015-02-13T06:42:55.883" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16559" PostTypeId="1" AcceptedAnswerId="16564" CreationDate="2015-02-13T18:09:51.407" Score="1" ViewCount="340" Body="&lt;p&gt;I am trying to test a strategy but do not know if I should use daily or weekly data? I have tried researching this &amp;amp; have found that daily data will bring &quot; too much &quot; noise compared to lower frequencies. Specifically, I am trying to &quot;backtest&quot; using a 6-month look back period. If I use daily data I will have approximately 125 observations versus 26 if I use weekly. Will I suffer from &quot;too much&quot; noise or lack thereof if I use weekly?&lt;/p&gt;&#xA;" OwnerUserId="13428" LastActivityDate="2015-02-14T00:27:53.757" Title="Daily or weekly data?" Tags="&lt;backtesting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16560" PostTypeId="2" ParentId="9216" CreationDate="2015-02-13T18:40:32.087" Score="1" Body="&lt;p&gt;This is a very good observation that I wrote about in my undergrad studies. I also believed that markets were efficient but not precise. I used the example a few years back regarding a tweet (roughly after the Boston bombings). The tweet was regarding terrorist attacks in which markets fell sharply and then recouping all the gains as news later indicated that someone hacked into the Twitter account. The markets were efficient at pricing the new information but were not precise at verifying authenticity of the news.&lt;/p&gt;&#xA;" OwnerUserId="13428" LastActivityDate="2015-02-13T18:40:32.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16563" PostTypeId="2" ParentId="16181" CreationDate="2015-02-14T00:24:54.683" Score="3" Body="&lt;p&gt;One can write for the payoff of an swaption $$\sum_i\tau_i P_{i+1}(S_{\alpha,\beta}(T_\alpha)-K)^+ $$ and therefore the pricing equation follows Joshi's explainations. To derive the above equation use that the swap rate is given by $$S_{\alpha,\beta} = \sum_i \frac{\tau_iP_{i+1}}{\sum_i\tau_iP_{i+1}}F^i, $$ where $F^i$ are the corresponding forward rates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find this derivation in any book on option pricing, since it is model free. Look for example in Brigo D. and Mercurio F. Interest Rate Models - Theory and Practice.&lt;/p&gt;&#xA;" OwnerUserId="6640" LastActivityDate="2015-02-14T00:24:54.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16564" PostTypeId="2" ParentId="16559" CreationDate="2015-02-14T00:27:53.757" Score="1" Body="&lt;p&gt;If you need for backtesting a trading strategy for a 6-month look back period you will have to use intraday data, in order to be able to get more significative estimates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;26 observations are not enough to implement a backetesting model and, generally, larger and larger number of observations leads to increase the accuracy and precision of your estimates. Look &lt;a href=&quot;http://en.wikipedia.org/wiki/Sample_size_determination&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; for a simple explanation of that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly, increasing the number of observations reduces the sample noise and not increases that ones because of the same reasons explained in that link I posted above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A solution could be use intraday data to increase the sample or setting your trading strategy on more long term.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-02-14T00:27:53.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16565" PostTypeId="1" AcceptedAnswerId="16577" CreationDate="2015-02-14T00:49:00.507" Score="1" ViewCount="438" Body="&lt;p&gt;In &lt;a href=&quot;http://queue.acm.org/detail.cfm?id=2534976&quot; rel=&quot;nofollow&quot;&gt;Online Algorithms in High-frequency Trading&lt;/A&gt; the authors demonstrate online, exponentially-weighted algorithms for mean, variance, and linear regression. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The authors estimate their smoothing parameter $\alpha$ in-sample, but state &quot;Another approach would be to estimate the optimal alpha online as well.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What would be an example of how to estimate the smoothing parameter online?&lt;/p&gt;&#xA;" OwnerUserId="5251" LastEditorUserId="2299" LastEditDate="2015-02-15T11:28:10.510" LastActivityDate="2015-02-15T11:28:10.510" Title="Online algorithm for selecting smoothing parameter?" Tags="&lt;high-frequency&gt;&lt;automated-trading&gt;&lt;moving-average&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16566" PostTypeId="1" CreationDate="2015-02-14T01:38:12.883" Score="1" ViewCount="34" Body="&lt;p&gt;My question is about forming market data which is received from the LPs.&#xA;Some tools work with these parameters: min spread, max spread, bid spread, ask spread.&lt;br&gt;&#xA;If current spread &amp;lt; min spread or current spread &gt; max spread then it changes the bid/ask values. Bid and Ask spread parameters work similar also.&lt;br&gt;&#xA;Is there another way to form the market data?&lt;/p&gt;&#xA;" OwnerUserId="15349" LastActivityDate="2015-02-14T01:38:12.883" Title="price engine configuration" Tags="&lt;price&gt;" AnswerCount="0" CommentCount="0" ClosedDate="2015-02-14T17:08:25.713" ContentLicense="CC BY-SA 3.0" />
  <row Id="16567" PostTypeId="1" CreationDate="2015-02-14T10:29:54.250" Score="6" ViewCount="1610" Body="&lt;p&gt;CAPM says that in order to generate high returns I need to take more systemic risk. But the ex-post results do not seem to validate this theory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a ETF SPHB - PowerShares S&amp;amp;P 500 High Beta ETF (SPHB). If I compare this to plain SPY, I believed that at least on average if not every day I should be rewarded for taking extra risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Results since 2011-06-01:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;                     SPHB    SPY&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Annual average return    12.6%  14.64%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cumulative return        47.6%  68.08%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Annual Volatility        21.06% 11.78%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see apart from volatility line where SPHB proves true to its promise of more risk, I do not see that I got awarded by more return. In fact I got completely clobbered by putting my money in SPHB.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what am I missing. Is CAPM and all this efficient frontier thing a complete hogwash ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Coder.&lt;/p&gt;&#xA;" OwnerUserId="15165" LastEditorUserId="15165" LastEditDate="2015-02-14T10:37:49.573" LastActivityDate="2019-03-01T15:56:59.873" Title="Is CAPM a failure?" Tags="&lt;capm&gt;" AnswerCount="5" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16568" PostTypeId="2" ParentId="16567" CreationDate="2015-02-14T10:55:16.013" Score="7" Body="&lt;p&gt;I would not necessarily call it a failure. CAPM explained ~70% of returns (on average) so this may quite be one of the 30% that could not be explained (see link). However, an improved approach or extension of the CAPM would be the the Famma-French factor model which explains roughly 90% of returns (see link). Again, the Famma-French is an extension of CAPM so you see that it is not a complete failure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Link:&#xA;&lt;a href=&quot;http://en.m.wikipedia.org/wiki/Fama%E2%80%93French_three-factor_model&quot;&gt;Famma-French&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13428" LastActivityDate="2015-02-14T10:55:16.013" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16569" PostTypeId="1" AcceptedAnswerId="16570" CreationDate="2015-02-14T11:25:55.087" Score="6" ViewCount="1265" Body="&lt;p&gt;I would like to implement a Regime Switching for Dynamic Correlations in an out-of-sample analysis using MATLAB.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After looking at the literature on the subject, they all refer to an article by Denis Pelletier to implement the method. &lt;a href=&quot;http://www4.ncsu.edu/~dpellet/papers/dynamic_correlations.pdf&quot; rel=&quot;noreferrer&quot;&gt;Here&lt;/a&gt; is the article.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the estimation of the parameters is beyond my knowledge. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to implement this technique in MATLAB ? I found a &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1714016.&quot; rel=&quot;noreferrer&quot;&gt;package&lt;/a&gt; online regarding Markov Switching Models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be highly appreciated :-) &lt;/p&gt;&#xA;" OwnerUserId="13942" LastActivityDate="2015-02-14T12:18:37.703" Title="Regime Switching for Dynamic Correlations" Tags="&lt;portfolio-management&gt;&lt;correlation&gt;&lt;covariance&gt;&lt;matlab&gt;&lt;markov&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16570" PostTypeId="2" ParentId="16569" CreationDate="2015-02-14T12:18:37.703" Score="4" Body="&lt;p&gt;The clearest and most intuitive article I have seen so far is &lt;br&gt;&#xA;&lt;a href=&quot;http://www.cfapubs.org/doi/abs/10.2469/faj.v68.n3.3&quot; rel=&quot;nofollow&quot;&gt;Kritzman et al., Regime Shifts: Implications for Dynamic Strategies in FAJ (May / June 2012)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It not only shows how you can use HMM for financial modelling but it also goes through the actual estimation algorithm (Baum-Welch) step-by-step and even gives full Matlab-code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the abstract:&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Regime shifts present significant challenges for investors because&#xA;  they cause performance to depart significantly from the ranges implied&#xA;  by long-term averages of means and covariances. But regime shifts also&#xA;  present opportunities for gain. The authors show how to apply&#xA;  Markov-switching models to forecast regimes in market turbulence,&#xA;  inflation, and economic growth. They found that a dynamic process&#xA;  outperformed static asset allocation in backtests, especially for&#xA;  investors who seek to avoid large losses.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;(I am not aware of a freely accessible copy of the paper - if you find one, please include it in a comment - I will change the answer accordingly.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I said in the comments I am not using Matlab: For your own experiments with HMM in R you can use the &lt;a href=&quot;http://cran.r-project.org/web/packages/depmixS4/index.html&quot; rel=&quot;nofollow&quot;&gt;depmixS4 package&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alpha Hive uses this package to replicate large portions of Kritzman's paper(s) in a four part series and explains everything step by step - highly recommended:&lt;br&gt; &lt;a href=&quot;https://alphahive.wordpress.com/2014/09/23/asset-pricing-9a-regime-switching/&quot; rel=&quot;nofollow&quot;&gt;https://alphahive.wordpress.com/2014/09/23/asset-pricing-9a-regime-switching/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2015-02-14T12:18:37.703" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16571" PostTypeId="2" ParentId="16567" CreationDate="2015-02-14T12:56:26.053" Score="8" Body="&lt;p&gt;I think the answer to this question must be yes, it is flawed indeed. The CAPM says that the expected return of a security or a portfolio equals the rate on a risk-free security plus a risk premium. Yet empirically measures of risk like volatility and beta do not generate a positive correlation with average returns in most asset classes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best exposition I have seen so far is this exhaustive survey (150 pages) of 20 different asset classes:&lt;br&gt;&#xA;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1420356&quot;&gt;Risk and Return in General: Theory and Evidence by Eric G. Falkenstein&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The abstract:&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Empirically, standard, intuitive measures of risk like volatility and&#xA;  beta do not generate a positive correlation with average returns in&#xA;  most asset classes. It is possible that risk, however defined, is not&#xA;  positively related to return as an equilibrium in asset markets. This&#xA;  paper presents a survey of data across 20 different asset classes, and&#xA;  presents a model highlighting the assumptions consistent with no risk&#xA;  premium. The key is that when agents are concerned about relative&#xA;  wealth, risk taking is then deviating from the consensus or market&#xA;  portfolio. In this environment, all risk becomes like idiosyncratic&#xA;  risk in the standard model, avoidable so unpriced.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="12" LastActivityDate="2015-02-14T12:56:26.053" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16572" PostTypeId="2" ParentId="16211" CreationDate="2015-02-14T13:33:01.643" Score="2" Body="&lt;p&gt;Assuming that we are talking about &lt;a href=&quot;http://en.wikipedia.org/wiki/Volatility_(finance)#Mathematical_definition&quot; rel=&quot;nofollow&quot;&gt;volatility as the standard deviation&lt;/a&gt; of uncorrelated random variables (in this case this would mean no autocorrelation) the &lt;a href=&quot;http://en.wikipedia.org/wiki/Variance#Sum_of_uncorrelated_variables_.28Bienaym.C3.A9_formula.29&quot; rel=&quot;nofollow&quot;&gt;variance is additive&lt;/a&gt;, which means that we get $\sqrt{.15^2+.2^2}=.25=25\%$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can illustrate this result by simulation in R:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; sd(rnorm(1e7,sd=.15)+rnorm(1e7,sd=.2))&#xA;[1] 0.2500001&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you want to annualize this number again you'd have to divide by $\sqrt{2}$ (because of the two one-year periods) which gives about $17.68\%$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So putting it all together what you do is to calculate the square root of the average of the squared volatilities: $$\sqrt{\frac{.15^2+.2^2}{2}}\approx.1768=17.68\%$$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can again be illustrated by a simulation in R:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; sd(c(rnorm(1e7,sd=.15),rnorm(1e7,sd=.2)))&#xA;[1] 0.1767796&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2015-02-14T19:58:51.573" LastActivityDate="2015-02-14T19:58:51.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16573" PostTypeId="1" CreationDate="2015-02-14T16:42:46.520" Score="8" ViewCount="3044" Body="&lt;p&gt;Noob here. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been trying to gain a better understanding of variance swaps and what better way than to replicate it with a portfolio of better understood instruments. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have read the GS 1999 paper and JPM 2005 paper and think I get how the replication works. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the assumption of no jumps and full continuous strikes, the replication using options is exact, so the variance swap and the ideal replication portfolio should be indistinguishable. Now we know that the variance swap's variance Vega (d price/d variance) at any given time is simply the variance notional regardless of spot and vol level. So it follows that if I sum (do an integral across strikes) of the options' variance vegas, I should get a constant as well. However, in BS, Vega, gamma, variance Vega are all functions of vol. And vol is NOT a constant function of strike. Does this not mean that a different vol curve would generate a different Vega variance curve? Something is obviously wrong with my argument, but where is it wrong? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks! &lt;/p&gt;&#xA;" OwnerUserId="2668" LastEditorUserId="2668" LastEditDate="2015-02-15T00:51:59.157" LastActivityDate="2015-06-17T14:58:04.277" Title="Variance swap replication and variance vega" Tags="&lt;volatility&gt;&lt;greeks&gt;&lt;variance&gt;&lt;replication&gt;&lt;volatility-smile&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16575" PostTypeId="2" ParentId="16047" CreationDate="2015-02-15T10:44:17.677" Score="3" Body="&lt;p&gt;Portfolios for some kind of investors effectively balance asset investments with liabilities incurred. Think about a pension account, where the future liability of the pension payment represents the liability and the currently invested monies are the assets. I am sure you can think of other similar situations but I will illustrate regarding pensions below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Input assumption for the liabilities resolve around how to estimate amount and timing of pension payments as well as death rates, future inflation and if you venture further out about political stability. Assumptions about assets may include credit risk and future return potential.The technical assumptions about return and event distributions may need to be considered.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly constraints are usually applied to asset classes or industry sectors. But since pension plan sponsors may change these constraints they are basically assumptions. One may even assume at the outset, that the plan sponsors actually reduce, say, equity allocations as the plan matures. Such an assumption would affect the time commitment one would be ready to make for equity investments and possibly avoid some classes such a private equity all together.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Result interpretation in such a setting may not be trivial. Some results may be conflicting or assumptions may not be quantifiable. Therefore aspects such as comparing to similar situations, judgment and how to incorporate judgment transparently into an actual investment decision are some aspects for consideration. Interpreting the investment returns achieved is the second area that provides for a good deal of work. Think about situations where some part of the portfolio has no mark to market value such as with private equity. The plan sponsor may want to interprete time-weighted returns and the private equity portion likely only shows IRR returns. Questions on how to reconcile this would need to be addressed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the above cannot be exhaustive, for further illustration you may look at investment policy statements of pension plans (see this &lt;a href=&quot;http://www.cppib.com/content/dam/cppib/Who%20We%20Are/Governance/Policies/2014/2014%20ENG/Investment%20Statement%20Investment%20Portfolio.pdf&quot; rel=&quot;nofollow&quot;&gt;example&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="7186" LastActivityDate="2015-02-15T10:44:17.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16577" PostTypeId="2" ParentId="16565" CreationDate="2015-02-15T11:16:11.307" Score="2" Body="&lt;p&gt;First of all, I do not believe the &quot;optimal smoothing&quot; of an estimator (like the mean or the variance) and the &quot;regression case&quot; are the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;strong&gt;smoothing of an existing estimator&lt;/strong&gt; (like mean or variance in the blog post), is an univariate problem, where the &lt;strong&gt;regression&lt;/strong&gt; is a multivariate one. In the regression case, you should be able to change the coefficients of the whole formula when you adjust the smoothing, but in the &quot;&lt;em&gt;simple&lt;/em&gt;&quot; smoothing one you are not expected to change the formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will answer to the first case here. For the regression case, you should have a look at &lt;a href=&quot;http://mme2012.opf.slu.cz/proceedings/pdf/024_Durka.pdf&quot; rel=&quot;nofollow&quot;&gt;ARIMAX models&lt;/a&gt; and &lt;a href=&quot;http://home.hit.no/~hansha/documents/control/theory/stateestimation_with_kalmanfilter.pdf&quot; rel=&quot;nofollow&quot;&gt;Kalman filters&lt;/a&gt;, it is (according to me) difficult here to split in two the process of (1) obtaining the good model, (2) apply a smoothing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obtaining an adequate filtering window size once you have a formula (say the formula of the mean), is already difficult.&#xA;Say you observe $X_1,X_2,\ldots,X_k,\ldots$ at time $\tau_1,\tau_2,\ldots,\tau_k,\ldots$. You have to go back to the formula of the mean, where does it come from?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is easy to see that the usual mean is the solution to the following minimization problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\min_m \mathbb{E}(m-X)^2.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It minimizes the expected variance between the observed random variable and the &lt;em&gt;&quot;mean&quot;&lt;/em&gt;. Under simple assumptions ($X$ is i.i.d.) $m$ is the empirical mean, using &lt;em&gt;as much data as possible&lt;/em&gt;. In terms of smoothing it would mean you take all the points since the start of the day (I uses your intraday example), and averages more data with time:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$m_\infty(X_k,k\leq K)=\frac{1}{K} \sum_{k\leq K} X_k.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And the variance of this estimator is proportional to $\sqrt{\mathbb{V}(X)/K}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why would you need something different?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to take &lt;strong&gt;less points&lt;/strong&gt;, for instance a sliding window of size $W$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$m_W(X_k,k\leq K)=\frac{1}{W} \sum_{k= K-W+1}^K X_k,$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you will obtain again an unbiased estimator, but with a largest variance, since you replace $\sqrt{\mathbb{V}(X)/K}$, where $K$ goes to infinity with time, by $\sqrt{\mathbb{V}(X)/W}$, that is constant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do that it is because you believe $X$ is not i.i.d. (independent and identically distributed). In such a case you can have $X$ being in fact drawn from a random variable until time $T$, and then it switches to another distribution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It means that you need to detects this change, or at least to be not too much sensitive to it. If you take an exponential average you are in the second case: you do not try to know anything about the switches, you just implement a formula such that after a while you do not take the past into account at all, and you weight more the recent past that an older one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But you can do better than that. And there is a large literature on the kind of problem, called **change detection*. Here is a good review: &lt;a href=&quot;http://arxiv.org/pdf/1109.2938.pdf&quot; rel=&quot;nofollow&quot;&gt;State-of-the-Art in Sequential Change-Point Detection&lt;/a&gt;. &lt;a href=&quot;https://scholar.google.fr/citations?user=zH1qBSoAAAAJ&quot; rel=&quot;nofollow&quot;&gt;Shiryaev&lt;/a&gt; wrote a lot of good papers on this topic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The generic methodology&lt;/strong&gt; is to choose a &lt;em&gt;contrast&lt;/em&gt; (i.e. a criterion that will be low when the state remains the same, and high during the change), and to threshold it to detect a change of regime. Then it is enough to reinit your smoothing. And practically to be confortable you can use an exponential moving average between two switches if you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the mean, a typical and simple contrast is the recent empirical mean vs. an old one normalized by a standard deviation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C(K):=\left|\frac{{\rm mean}(X_{K}:X_{K-h})-{\rm mean}(X_{K-2h}:X_{K-h})}{{\rm std}(X_{K-2h}:X_{K-h})}\right|,$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with the notation $X_{a}:X_{b}$ the time series from $b$ to $a$.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2015-02-15T11:27:33.293" LastActivityDate="2015-02-15T11:27:33.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16578" PostTypeId="1" CreationDate="2015-02-15T14:07:19.220" Score="-1" ViewCount="66" Body="&lt;p&gt;Does discounting factor only depends on issuer, or it also depends on structure of payments ( i.e. fixed or float)?&#xA;Thank you in advance.&lt;/p&gt;&#xA;" OwnerUserId="13305" LastActivityDate="2015-02-16T07:22:24.400" Title="Discounting factor depends on" Tags="&lt;bond&gt;&lt;discounting&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2015-02-16T20:44:36.633" ContentLicense="CC BY-SA 3.0" />
  <row Id="16579" PostTypeId="2" ParentId="16573" CreationDate="2015-02-15T15:15:41.747" Score="2" Body="&lt;p&gt;The variance swap's Vega that is equal to the variance notional refers to the &lt;em&gt;realized&lt;/em&gt; variance. The Black-Scholes vega refers to the market &lt;em&gt;implied&lt;/em&gt; volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if you &lt;em&gt;want&lt;/em&gt;, you can estimate the realized variance at expiry from the volatility of the options (for instance taking the atm variance arbitrarily), and that's often what people do. But that's really up to the modeler to do that. If you decide to do that, then in that model, your estimated realized variance is a function of the atm implied vol...  &lt;/p&gt;&#xA;" OwnerUserId="13640" LastActivityDate="2015-02-15T15:15:41.747" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16581" PostTypeId="2" ParentId="16553" CreationDate="2015-02-15T19:14:33.580" Score="2" Body="&lt;p&gt;Unless there is something specific happening in those systems, Depo rates should be exactly that. So if you can deposit cash for some rate b or borrow for some rate a, then those rates can be used to calculate the implied forward foreign exchange.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The details of when that is appropriate and at what terms is particular to the currencies involved, so until we know that it is hard to be specific.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2015-02-15T19:14:33.580" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16584" PostTypeId="1" CreationDate="2015-02-16T05:45:48.353" Score="1" ViewCount="1253" Body="&lt;p&gt;I am trying to gather historical data for experimental reasons (intellectual curiosity) and am having trouble understanding how that data is calculated. First some data gathering on AAPL from Feb. 10th, 2015 at opening. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;dataA = &lt;a href=&quot;http://hopey.netfonds.no/tradedump.php?date=20150210&amp;amp;paper=AAPL.O&amp;amp;csv_format=txt&quot; rel=&quot;nofollow&quot;&gt;http://hopey.netfonds.no/tradedump.php?date=20150210&amp;amp;paper=AAPL.O&amp;amp;csv_format=txt&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;dataB = &lt;a href=&quot;http://hopey.netfonds.no/posdump.php?date=20150210&amp;amp;paper=AAPL.O&amp;amp;csv_format=txt&quot; rel=&quot;nofollow&quot;&gt;http://hopey.netfonds.no/posdump.php?date=20150210&amp;amp;paper=AAPL.O&amp;amp;csv_format=txt&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;dataC = &lt;a href=&quot;http://www.google.com/finance/getprices?i=60&amp;amp;p=4d&amp;amp;f=d,o,l,h,c,v&amp;amp;df=cpct&amp;amp;q=AAPL&quot; rel=&quot;nofollow&quot;&gt;http://www.google.com/finance/getprices?i=60&amp;amp;p=4d&amp;amp;f=d,o,l,h,c,v&amp;amp;df=cpct&amp;amp;q=AAPL&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;dataD = &lt;a href=&quot;http://chartapi.finance.yahoo.com/instrument/1.0/AAPL/chartdata;type=quote;range=4d/csv&quot; rel=&quot;nofollow&quot;&gt;http://chartapi.finance.yahoo.com/instrument/1.0/AAPL/chartdata;type=quote;range=4d/csv&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;DataA seems to provide every transaction that took place during the prescribed day; Is that correct or am I reading the data wrong? If I take the first line of dataC (close,high,low,open,volume)=(120.3,120.31,120.16,120.17,646886), then it corresponds to the first few introductory transactions in dataA. Likewise, dataD also corresponds to the transactions of dataA, but over several minutes. In other words, dataC and dataD seem like estimations (using close,high,low,open,volume) of dataA. Is this correct? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this is true, then dataA is &quot;raw data&quot; and awesome for analytical reasons. However, I am confused by dataB. I suppose dataB is the bid/ask spread, but if I go to the following line: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;20150210T150001 120.54  300 300 120.55  4600    4600&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then the bid/ask seems to be 120.54/120.55 which seems entirely inaccurate compared to dataA (the raw data of actual transactions)? Even google indicates that the (c,h,l,o,v) is (120.39,120.58,120.25,120.3,576584) during the first minute of opening, which doesn't seem close to the 120.54/120.55 spread? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I misunderstanding/misreading? &lt;/p&gt;&#xA;" OwnerUserId="15373" LastActivityDate="2016-04-20T01:56:39.980" Title="Bid/Ask vs Low/High" Tags="&lt;historical-data&gt;&lt;bid&gt;&lt;ask&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16587" PostTypeId="2" ParentId="16537" CreationDate="2015-02-16T07:11:38.257" Score="7" Body="&lt;p&gt;well you can use CDS spreads to strip out implied default probabilities for default before time $T.$ These had better be increasing as a function of $T$ or you have an arbitrage opportunity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, there is an assumption here that there is no default risk on the CDS swap itself once you take that into account there may be a good chance of profit but no real arbitrage.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-02-16T07:11:38.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16588" PostTypeId="2" ParentId="16578" CreationDate="2015-02-16T07:22:24.400" Score="1" Body="&lt;p&gt;The central theme of Asset Pricing is in detecting what drives the evolution of the (stochastic) discount factor. Academic finance assume as a methodological starting point that expectations are rational, i.e. unbiased, hence when prices ( $p_t$ ) are determined as the expected value of the discounted (by the discount factor $M_{t+1}$) payoff of the security ( $X_{t+1}$ ), i.e. $p_t = E_t [M_{t+1}X_{t+1}]$, then what really drives prices is the functional form of the (stochastic) discount factor, i.e. $M_{t+1}= f(t, Z)$ .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are asking what $Z$ is, but if I knew it exactly I could write a paper and win the Nobel Prize!&lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2015-02-16T07:22:24.400" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16589" PostTypeId="2" ParentId="16548" CreationDate="2015-02-16T11:20:51.230" Score="9" Body="&lt;p&gt;I found &lt;a href=&quot;http://archiv.stochastik.uni-freiburg.de/homepages/schmidt/publications/TSchmidt_Copulas.pdf&quot; rel=&quot;noreferrer&quot;&gt;Coping With Copulas by Thorsten Schmidt&lt;/a&gt; really helped me to get a more basic understanding of copulas. As well as looking at some simple examples in R and thinking about different directions the transformations can happen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer your actual question I'll attempt to describe the steps involved as simply as I can.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Let's say you use the copula function in R to generate two columns&#xA;of correlated variables, X and Y.&lt;/li&gt;&#xA;&lt;li&gt;These are output as individual observations of random variables between [0,1].&lt;/li&gt;&#xA;&lt;li&gt;To get back to the &quot;real&quot; values of X and Y, which aren't distributed on [0,1], you make some assumptions about what distribution they do follow. For example say they both follow a standard normal distribution with mean = 0 and standard deviation = 1.&lt;/li&gt;&#xA;&lt;li&gt;Go back to R and use the quantile (inverse) cummulative distribution function, qnorm(), on each column X and Y. This will convert the value from [0,1] to it's corresponding normally distributed value, somewhere in the region of [-infinity,+infinity].&lt;/li&gt;&#xA;&lt;li&gt;Now you have two normally distributed random variables X and Y with a specified dependence structure thanks to your copula in the initial step.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The red arrow step ensures each variable follows the appropriate marginal distribution without actually changing the joint probability distribution.&lt;/p&gt;&#xA;" OwnerUserId="15381" LastEditorUserId="15381" LastEditDate="2016-01-23T18:00:17.903" LastActivityDate="2016-01-23T18:00:17.903" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16590" PostTypeId="1" CreationDate="2015-02-16T11:21:13.307" Score="2" ViewCount="1749" Body="&lt;p&gt;I am comparing the mark-to-market (MtM) valuations of two risk systems, with respect to FX Options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is can I quantify the difference in MtM given the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;System1&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;AUD/JPY, MTM = USD 461,000, Implied Vol. = 11.88%, Vega = USD 82,000, Forward Rate = 97.29 and USD Delta = -15,300,000&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;System2&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;AUD/JPY, MTM = USD 406,000, Implied Vol. = 12.14%, Vega = USD 77,000, Forward Rate = 97.81 and USD Delta = -13,600,000&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming both systems use Black Scholes, how can I quantify the difference in MtM (in USD) which is USD 55,000 by attributing it to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Difference in Implied Volatility and;&lt;/li&gt;&#xA;&lt;li&gt;Difference in Forward Rates?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I tried doing this and am still left with a small difference - is it possible to quantify that too?&lt;/p&gt;&#xA;" OwnerUserId="15380" LastEditorUserId="2587" LastEditDate="2015-06-19T06:42:52.490" LastActivityDate="2015-06-19T06:42:52.490" Title="How to break down an FX option P&amp;L?" Tags="&lt;options&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16591" PostTypeId="2" ParentId="16548" CreationDate="2015-02-16T12:31:09.813" Score="2" Body="&lt;p&gt;There is a brief and not overly technical introduction here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://prescientmuse.blogspot.co.uk/2015/01/a-brief-introduction-to-copula.html&quot; rel=&quot;nofollow&quot;&gt;http://prescientmuse.blogspot.co.uk/2015/01/a-brief-introduction-to-copula.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And an application of use in a trading system with full R code here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://prescientmuse.blogspot.co.uk/2015/02/vanilla-trading-algorithm.html&quot; rel=&quot;nofollow&quot;&gt;http://prescientmuse.blogspot.co.uk/2015/02/vanilla-trading-algorithm.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope that helps!&lt;/p&gt;&#xA;" OwnerUserId="15208" LastActivityDate="2015-02-16T12:31:09.813" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16592" PostTypeId="2" ParentId="16584" CreationDate="2015-02-16T15:09:55.950" Score="1" Body="&lt;p&gt;Data set A does look like transactions, but I would hesitate to say that it is &lt;em&gt;every&lt;/em&gt; transaction. You would need to investigate the data source and how transactions are defined. Data set B looks like BBO (best bid and offer).  Data sets C and D are &lt;em&gt;not&lt;/em&gt; estimations; they're aggregations to a higher periodicity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to investigate the data sources for data sets A and B.  The US stock market is a distributed system. There are many trading venues. A and B could be from a specific venue, or a specific aggregation of venues, while the data on Google and Yahoo is likely from the NBBO (national BBO).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short, stock market data is complex.&lt;/p&gt;&#xA;" OwnerUserId="56" LastActivityDate="2015-02-16T15:09:55.950" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16594" PostTypeId="1" CreationDate="2015-02-16T15:44:39.220" Score="5" ViewCount="3352" Body="&lt;p&gt;I am working through this paper, &lt;a href=&quot;http://www.nber.org/papers/w8922.pdf&quot;&gt;http://www.nber.org/papers/w8922.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to implement the portfolio weight constraints see page 6-7.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the brief overview of my problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let &lt;code&gt;w&lt;/code&gt; be the set of weights representing a portfolio. Then, mean-variance problem is to find the portfolio weights that minimizes portfolio variance, argmin &lt;code&gt;w'Sw&lt;/code&gt; subject to &lt;code&gt;w'I = 1&lt;/code&gt; which represents weights sum up to 1 and &lt;code&gt;S&lt;/code&gt; is the estimated covariance matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this framework, portfolio weights are constrained by lower and upper bounds such as:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/pfM6N.png&quot; alt=&quot;enter image description here&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/tiwQ4.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, the authors show that the following proposition is for the symmetric and positive semi-definite covariance matrix for the minimum global variance portfolios:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/rrnZO.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here new covariance matrix is the shrunk version of &lt;code&gt;S&lt;/code&gt;. I am trying to implement this in Matlab by &lt;code&gt;fmincon&lt;/code&gt; function. I also add an target return constraint such as &lt;code&gt;w'mean = rho&lt;/code&gt; where &lt;code&gt;mean&lt;/code&gt; is column vector expected return of the assets and &lt;code&gt;rho&lt;/code&gt; is the targetted return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I create portrisk.m file for objective function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function f = portrisk(w, covmat)&#xA;f = w'* covmat * w;&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And nonlinear constraints are organized in constraint.m file file in matlab.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function [c,ceq] =  constraint (w)&#xA; c=[-w];                                % nonlinear inequality constraints&#xA; ceq = [];                              % nonlinear equality constraints&#xA; end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is the codes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% initialization&#xA;x0=[ones(p,1)/p];                              % initialiazed to 1/p&#xA;&#xA;% linear equality constraints (w'I=1, sum of the weights has to be 1 and target return) &#xA;Aeq = [meanx; repmat(1, 1, p)];                % matrix for linear equality constraints &#xA;rho = 0.0012&#xA;beq = [rho; 1];                                % vector for linear equality constraint&#xA;&#xA;% upper and lower bound constraints&#xA;lb = zeros(p,1);&#xA;ub = ones(p,1);&#xA;&#xA;% constraints as both less or higher than a constant&#xA;A = [repmat(1, 1, p); repmat(-1, 1, p) ];      &#xA;b = [1; 0];&#xA;&#xA;% options&#xA; options = optimoptions('fmincon','Algorithm','interior-point','Display','iter');&#xA;&#xA;% run optimization function, lambda is the langrange multipliers&#xA;[w, fval, exitflag, output, lambda, grad, hessian]  = fmincon(@portrisk, x0 , A, b,    &#xA;Aeq, beq, lb, ub,@constraint,options);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I could not get a solution. Could you help me where I am wrong? Thank you for any help.&lt;/p&gt;&#xA;" OwnerUserId="15306" LastActivityDate="2015-06-17T16:31:29.470" Title="constrained portfolio optimization by fmincon" Tags="&lt;optimization&gt;&lt;portfolio-optimization&gt;&lt;matlab&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16595" PostTypeId="1" CreationDate="2015-02-16T17:18:51.510" Score="2" ViewCount="368" Body="&lt;p&gt;I want to value the following contract for times $0&amp;lt;t&amp;lt;T$, i.e. determine $V(t,\cdot)$ where $\cdot$ refers to all other dependences (strike, spot, volatility, etc.).  The contract is long and has a lot of non-standard features.  Any suggestions would be helpful (feel free to exclude some of the features of the contract if you aren't able to offer up a solution that includes them; hopefully we will eventually get to a point where we can value the entire contract).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have two parties, A and B, that have entered into the following premium-offsetting option contract on an underlying equity whose price is $S$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Option 1&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Type: Put&lt;/li&gt;&#xA;&lt;li&gt;Exercise: European&lt;/li&gt;&#xA;&lt;li&gt;Strike: $K$&lt;/li&gt;&#xA;&lt;li&gt;Expiry: $T$&lt;/li&gt;&#xA;&lt;li&gt;Buyer: Party A&lt;/li&gt;&#xA;&lt;li&gt;Seller: Party B&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Option 2&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Type: Call&lt;/li&gt;&#xA;&lt;li&gt;Exercise: American&lt;/li&gt;&#xA;&lt;li&gt;Strike: $K$&lt;/li&gt;&#xA;&lt;li&gt;Expiry: $T$&lt;/li&gt;&#xA;&lt;li&gt;Buyer: Party B&lt;/li&gt;&#xA;&lt;li&gt;Seller: Party A&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Both options are written on a quantity $N$ of the underlying, and there is no up-front premium due from either party (the option premiums are designed to be 0 on a net basis).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, there are a number of additional features written into the contract.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Simultaneous Exercise&lt;/strong&gt;&#xA;If Party B exercises $N'\leq N$ options prior to expiration, then $N'$ puts held by Party A will be deemed exercised.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Payoff Determined by Post-Exercise Averaging Period&lt;/strong&gt;  Upon exercise by Party B (or automatic exercise at maturity), Party A will determine a $k$-consecutive day averaging period, acting in good faith based on the number and value of the shares to be paid/delivered, as exercised by Party B.  For this purpose, $k\leq15$, unless Party A is advised by counsel that $k&amp;gt;15$ is reasonably necessary or advisable in order to effect its hedging, hedge-unwind, or other settlement obligations to Party B.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;em&gt;relevant price&lt;/em&gt; recorded on each averaging date is the dollar volume-weighted average price per share (Bloomberg &quot;VWAP Price&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The final payoff is determined on the final averaging date as the volume weighted average of the recorded relevant prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Strike Price Reduction&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the equity pays an &lt;em&gt;extraordinary dividend&lt;/em&gt; $D$, then the $K\mapsto K-D$ for each call and put option that remains unexercised (i.e. the strikes of both options are reduced by the amount of the extraordinary dividend).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Extraordinary dividend is defined as the aggregate amounts of (as determined by Party A) (a) any dividend declared on shares at a time $t'$ when the issuer had not previously paid dividends for $t\in[t'-1,t']$ (i.e., the past 4 quarters); (b) dividend amounts paid in excess of the &lt;em&gt;regular dividend&lt;/em&gt;; (c) dividends expressly paid outside the normal course of operations or dividend schedule.  In all cases, the ex-dividend date $\tilde{t}$ must satisfy $0&amp;lt;\tilde{t}&amp;lt;t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For (b), the regular dividend is specified as $0$ in the contract.  Essentially this implies &lt;strong&gt;all&lt;/strong&gt; dividends are extraordinary.  I might as well state now that the contract was written on LAZ in 3/22/2012, and looking at the &lt;a href=&quot;http://www.nasdaq.com/symbol/laz/dividend-history&quot; rel=&quot;nofollow&quot;&gt;http://www.nasdaq.com/symbol/laz/dividend-history&lt;/a&gt; it seems they have had a pretty consistent dividend payout since 2005.  Although, it seems they skipped their usual February dividend that year, so perhaps this is why the regular dividend is zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Additional Premium Due to Party A on Settlement Dates&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For each exercise date (including the automatic exercise at maturity), there is a corresponding compounding period, the resulting value of which is due to Party A from Party B upon Party B's exercise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For each day in the compounding period, commencing anew either from the beginning of the contract $t=0$ or from the most recent exercise date and up-to the next exercise date or final maturity date, Party B will pay Party A upon exercise the sum of the daily adjustments during the compounding period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For each day $t_{j}$ in the $k$th compounding period, the daily adjustments are defined as&#xA;$$D^{k}_{j}=N^{k}\cdot r_{j}\cdot(K^{k}-D^{k}_{j})$$&#xA;where $N^{k}$ are the number of call options remaining during the $k$th compounding period; $r_{j}$ is the &lt;em&gt;daily rate&lt;/em&gt; as defined below; $K^{k}$ is the dividend adjusted strike price (as defined above) as of the beginning of the compounding period; $D^{k}_{j}$ is the aggregate dividend adjustment starting from the beginning of the $k$th compounding period and upto time $t_{j}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P^{k}=\sum_{j}D^{k}_{j}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The daily rate is defined as a &lt;em&gt;per annum&lt;/em&gt; rate given by&#xA;$$r_{j}=L(1)+\frac{\alpha}{360}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $L(1)$ is the US 1 Month LIBOR rate and $s=35$ bps for $0\leq t\leq T/2$ and $s=50$ bps for $T/2\leq t\leq T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The contract seems to emphasize that $r_{j}$ should be expressed as a per annum rate, as opposed to a per diem rate as suggested by its purpose for computing the daily adjustment.  This seems strange to me.  Also, it is not clear from the contract whether the 1M LIBOR is adjusted for each day or per month.  The contract states &quot;...determined as if the first day of such compounding period were the reset date.&quot;  To me, this suggests the rate is adjusted per month beginning with the compounding period (I also assume the actual rate is fixed 2 business days before the reset date as is standard for USD denominated swaps).&lt;/p&gt;&#xA;" OwnerUserId="8230" LastActivityDate="2017-11-27T02:07:00.457" Title="Complicated American style option contract with numerous non-standard features (simultanous exercise, additional premium, etc.)" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;valuation&gt;&lt;american-options&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16596" PostTypeId="1" AcceptedAnswerId="16598" CreationDate="2015-02-16T18:16:20.667" Score="0" ViewCount="1307" Body="&lt;p&gt;I have a pay fixed / receive floating interest-rate-swap on the AUD BBSY that I'd like to price for the purposes of accounting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand the general process to be as follows (assuming single-curve theory):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Use the swap rates to bootstrap zero/spot rates.&lt;/li&gt;&#xA;&lt;li&gt;Use the zero/spot rates to construct a yield curve (e.g.using cubic splines).&lt;/li&gt;&#xA;&lt;li&gt;Use the yield curve to discount the future cash flows of the swap.&lt;/li&gt;&#xA;&lt;li&gt;Adjust for the credit risk of the counterparties.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Regarding the step 1 bootstrapping: the rates quoted in the market are 1, 2, 3, 4, 5, or 6 month &quot;AFMA Bank Bill Swap Rates&quot; and 1, 2, 3, 4, 5, 7, 10, and 15 year &quot;AFMA Interest Rate Swaps&quot;. Two questions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) How can I tell what the coupon structure is for either reported rate (Bank Bill Swap Rates or Interest Swap Rates) so that I can construct the bootstrapping formula?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Do I need to do anything when I switch from the short-term to long-term rates other than recognize that in my coupon model in the bootstrapping?&lt;/p&gt;&#xA;" OwnerUserId="2119" LastActivityDate="2015-02-16T22:27:30.073" Title="Bootstrapping zero-rates from AUD swap rates" Tags="&lt;interest-rates&gt;&lt;interest-rate-swap&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16597" PostTypeId="2" ParentId="14046" CreationDate="2015-02-16T21:51:18.250" Score="1" Body="&lt;p&gt;I've been testing trading systems with lowess for a long time and have yet to find something that works.  Lowess is a adaptive, so it will change with the addition of future bars ( it is the best fit taking into account past and future data points).  If you plot a lowess on a chart, it is a perfect fit...not so much in real time.&lt;/p&gt;&#xA;" OwnerUserId="15258" LastActivityDate="2015-02-16T21:51:18.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16598" PostTypeId="2" ParentId="16596" CreationDate="2015-02-16T22:27:30.073" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;Refer &lt;a href=&quot;http://www.afma.com.au/standards/market-conventions/Interest%20Rate%20Derivative%20Conventions.pdf&quot; rel=&quot;nofollow&quot;&gt;AFMA Interest Rates Conventions&lt;/a&gt;, paragraph 3.7&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Swaps are quoted on a quarterly basis for maturities out to 3 years and on a semi‐annual basis for maturities 4 years and greater. Swaps falling between the 3 and 4 year maturity will be negotiated between the two counterparties.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;No. As long as your curve prices the input instruments correctly, you're good.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Note: there's no need to use anything as complicated as splines for a simple bootstrap. I suggest sticking to raw interpolation (i.e. piecewise linear log-discount factor). This is simple to implement and robust. In fact, your interpolation and bootstrap method should be the same - refer &lt;a href=&quot;http://www.math.ku.dk/~rolf/HaganWest.pdf&quot; rel=&quot;nofollow&quot;&gt;Hagan &amp;amp; West&lt;/a&gt;, so you if you insist on using splines to interpolate, you should also use splines to bootstrap.&lt;/p&gt;&#xA;" OwnerUserId="7166" LastActivityDate="2015-02-16T22:27:30.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16599" PostTypeId="2" ParentId="16584" CreationDate="2015-02-17T02:18:51.567" Score="1" Body="&lt;p&gt;The data from hopey.netfonds is only data from the exchange. In this case all transactions you see there are NASDAQ quotations , hence the &quot;O&quot; after AAPL. It fails to provide transactions from other venues such as BATS etc. which is what free data providers usually use as Google finance&lt;/p&gt;&#xA;" OwnerUserId="13428" LastActivityDate="2015-02-17T02:18:51.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16600" PostTypeId="1" AcceptedAnswerId="16602" CreationDate="2015-02-17T04:15:59.097" Score="0" ViewCount="64" Body="&lt;p&gt;Where can I find data for biggest rally(price rally) in a day? If this sort of information is not readily available, how could I produce/transform such data?&lt;/p&gt;&#xA;" OwnerUserId="4713" LastActivityDate="2015-02-17T06:11:40.393" Title="biggest rally data collection" Tags="&lt;data&gt;&lt;market-data&gt;&lt;historical-data&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16602" PostTypeId="2" ParentId="16600" CreationDate="2015-02-17T06:11:40.393" Score="1" Body="&lt;p&gt;Good old Wikipedia:&#xA;Here is a list of largest one day gains on the Dow Jones. I also think they have a list for the S&amp;amp;P 500&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.m.wikipedia.org/wiki/List_of_largest_daily_changes_in_the_Dow_Jones_Industrial_Average&quot; rel=&quot;nofollow&quot;&gt;largest one day gains&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13428" LastActivityDate="2015-02-17T06:11:40.393" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16603" PostTypeId="2" ParentId="16573" CreationDate="2015-02-17T07:18:41.737" Score="2" Body="&lt;p&gt;I &lt;em&gt;think&lt;/em&gt; I have figured this out. The key to the understanding is to think of the options' vegas as &quot;key-strike vegas&quot; compared to the var swap/replication portfolio's vega, which is analogous to &quot;key rate durations of a bond portfolio&quot; to the total effective duration of the portfolio.&lt;/p&gt;&#xA;" OwnerUserId="2668" LastActivityDate="2015-02-17T07:18:41.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16604" PostTypeId="1" CreationDate="2015-02-17T07:39:11.910" Score="0" ViewCount="2678" Body="&lt;p&gt;When i read financial news, sometimes, there is cX% (where X is a number).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below are few examples:&#xA;1. &quot;improving to c4% on a proforma basis&quot;&#xA;2. &quot;market share is now c6% of the ...&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What does that c represent for? Does it mean &quot;Compound Annual Growth Rate&quot;? or &quot;closed to&quot;?&lt;/p&gt;&#xA;" OwnerUserId="15387" LastActivityDate="2015-04-18T14:26:44.693" Title="at c(x)% &quot;where x is a numerical figure&quot;, what does that c mean?" Tags="&lt;c&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16605" PostTypeId="1" AcceptedAnswerId="16609" CreationDate="2015-02-17T10:57:07.750" Score="11" ViewCount="4405" Body="&lt;p&gt;I need help with my understanding of changing probability measure. Im not a mathematician so I hope for answers that are not too technical. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As shown in this Wikipedia article &lt;a href=&quot;http://en.wikipedia.org/wiki/Risk-neutral_measure&quot;&gt;http://en.wikipedia.org/wiki/Risk-neutral_measure&lt;/a&gt; you can change the drift of a GBM with the following procedure:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dS_t = \mu S_t dt + \sigma S_t dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Introducing a new process:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d\tilde{W_t} = dW_t - \frac{\mu - r}{\sigma}dt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that now the discounted value of the following process:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dS_t = r S_t dt + \sigma S_t d \tilde{W_t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is a martingale if $\tilde{W_t}$ is a standard Brownian motion. OK, so we change to a new probability measure Q and now $\tilde{W_t}$ is a standard Brownian motion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first question is, $W_t$ can no longer be a standard Brownian motion under Q, because it now has non-zero expectation, is this true?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the probability of an event, $dW_t=x$ under the physical measure, P, is $dP(x)$, then the probability for that same event under Q is $dQ(x)=dP(x) \Phi(x)$, where $\Phi(x)$ is what i think is called the Radon-Nikodym derivative. For $d\tilde{W_t}$ to have zero expectation, then under Q $E_Q[dW_t]=\frac{\mu-r}{\sigma}t$, am I right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this is true, can we then find $\Phi(x)=\frac{dQ(x)}{dP(x)}$ by dividing the density function of a Brownian motion with expectation $\frac{\mu-r}{\sigma}t$ with the density function for a for a standard Brownian motion?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{e^{\frac{-(x-\frac{\mu-r}{\sigma}t)^2}{2t}}}{e^{\frac{-x^2}{2t}}}$$&#xA;$$e^{\frac{x^2}{2t}\frac{-(x-\frac{\mu-r}{\sigma}t)^2}{2t}}$$&#xA;$$e^{\frac{x^2-(x-\frac{\mu-r}{\sigma}t)^2}{2t}}$$&#xA;$$e^{\frac{x^2-x^2+2x\frac{\mu-r}{\sigma}t-\frac{\mu^2-2\mu r+r^2}{\sigma^2}t^2}{2t}}$$&#xA;$$e^{x\frac{\mu-r}{\sigma}-\frac{\mu^2-2\mu r+r^2}{2 \sigma^2}t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Denoting $\frac{\mu-r}{\sigma}$, the market price of risk, as $\lambda$ and substituting we get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Phi(x)=e^{x\lambda-\frac{1}{2}\lambda^2 t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that most references I have looked at states that the Radon-Nikodym derivative as something like: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Phi(t)=e^{-\int^t_0 \lambda dW(u)-\frac{1}{2}\int^t_0 \lambda^2 du}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I cannot seem to see the link between this expressions. Is the last expression even possible to solve?&lt;/p&gt;&#xA;" OwnerUserId="5489" LastActivityDate="2020-02-25T22:14:24.143" Title="Radon-Nikodym derivative and risk natural measure" Tags="&lt;girsanov&gt;&lt;risk-neutral&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16606" PostTypeId="2" ParentId="16604" CreationDate="2015-02-17T13:09:13.300" Score="2" Body="&lt;p&gt;It stand for &quot;Circa&quot;, from Latin. It means &quot;approximately&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Circa&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Circa&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7166" LastActivityDate="2015-02-17T13:09:13.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16607" PostTypeId="2" ParentId="16536" CreationDate="2015-02-17T13:12:29.210" Score="0" Body="&lt;p&gt;To identify the best lags , try to fit models with different lag choices.Plotting of ACF and PACF could give a sense of different lags choices. Further to this BIC could be used to determine for which AR and MA lag BIC is getting minimised.&lt;/p&gt;&#xA;" OwnerUserId="15391" LastActivityDate="2015-02-17T13:12:29.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16608" PostTypeId="2" ParentId="16594" CreationDate="2015-02-17T13:23:20.863" Score="3" Body="&lt;p&gt;It is difficult to say what is not working with your code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try Matlab's &lt;strong&gt;quadratic programming function&lt;/strong&gt; &lt;a href=&quot;http://www.mathworks.com/help/optim/ug/quadprog.html&quot; rel=&quot;nofollow&quot;&gt;quadprog()&lt;/a&gt; instead. This function specializes in solving this optimization problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The syntax is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ x = quadprog(H,f,A,b,Aeq,beq,lb,ub)  $$&lt;/p&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2015-02-17T13:23:20.863" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16609" PostTypeId="2" ParentId="16605" CreationDate="2015-02-17T14:38:54.760" Score="6" Body="&lt;p&gt;Your mistake is actually made at the beginning:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Introducing a new process: $d\tilde{W}_t = dW_t +\frac{\mu-r}{\sigma} dt $&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is incorrect.  Rather, $d\tilde{W}_t = dW_t -\frac{\mu-r}{\sigma} dt $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise, your derivation is correct.  After correcting for the sign error, your final equation becomes $\Phi(x)=e^{-\lambda x-\frac{1}{2}\lambda^2 t}$.  Notice that when $\lambda$ is a constant, $\int_0 ^t \lambda dW_t =\lambda x$ where $x$ is a normally distributed random variable.  Hence your derivation agrees with your references.  However, the references are more general since they do not require $\lambda$ to be a constant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Is the last expression even possible to solve?&quot;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, there is no reason to &quot;solve&quot; the Radon-Nikodym derivative.  Simply knowing it exists allows us to price contingent claims as expected values of functions of the underlying, which can be often be efficiently computed.  Indeed, if the goal is to price assets $\lambda$ can be safely ignored.&lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2015-02-17T14:38:54.760" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16611" PostTypeId="1" CreationDate="2015-02-17T15:22:55.777" Score="13" ViewCount="327" Body="&lt;p&gt;I came up with an approach for measuring data snooping, or overfitting. My question is whether this approach was published and expanded-on already, or is it new?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My approach relies on the observation that if we generate strategies over and over until one does well, then the distribution of PnLs of the postconditioned strategy has some extra kurtosis. This extra kurtosis arises from the sheer fact that we conditioned on the PnL being large. If we don't do any such conditioning (i.e. if our strategy was not created using snooping) then the kurtosis is as it should be, so there is no extra kurtosis. My approach has the advantage that it does not require any knowledge of the particular structure of the strategy space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are the details of my approach:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose our friend Alice gives us a supposedly-great strategy for investing in the stock market. Suppose we backtest this strategy (for simplicity I'll assume we have a perfect backtester) for 252 days, and the PnLs of this strategy are $P_1,\ldots,P_{252}$. We discover that the total PnL, $P = \sum_i P_i$, is very large, so this strategy looks great.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we want to figure out if this strategy is really great, so that it will continue being great in the future, or if this strategy is a result of data snooping (or overfitting), meaning Alice tried a bunch of mediocre strategies until she found one whose backtesting results are great.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We make a simplifying assumption, that for any particular strategy, its series of PnLs over the 252 trading days is normally distributed and independent. (So, in particular, for now we assume no kurtosis is present in the raw PnLs.) Now, suppose that Alice did not engage in data snooping. Then by this simplifying assumption, $P_1,\ldots,P_{252}$ should be independent and normally distributed. On the other hand, if Alice did indeed engage in data snooping, then $P_1,\ldots,P_{252}$ are i.i.d normally distributed (say with mean $0$), but then conditioned on the event that $\sum_i P_i \ge M$. (Here, $M$ is some large constant.) In this case, The random variables $P_1,\ldots,P_{252}$ are dependent, and perhaps we can test that. But, even better: they are not normally distributed anymore: they have some measurable kurtosis. This kurtosis is dependent on the value of $M$ and on the number of samples (in our case, $252$) but, presumably, it can be detected by just drawing a histogram of the $252$ samples.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course I made some simplifying assumptions that should be removed, such as the PnLs being normally distributed to start with, and our backtesting procedure being perfect. Furthermore, I assumed that Alice is snooping in a very particular prescribed way: that she tosses away a strategy if it doesn't make at least $M$ dollars, and that she gives us the first strategy she finds that makes $M$ dollars. If she tried to fool us by, say, measuring the kurtosis herself and waiting until she finds a strategy with low empirical kurtosis, then our strategy needs to be more sophisticated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, this approach has the advantage that it does not require any knowledge of the particular structure of the strategy space that Alice explored when she tried to find her strategy. So we don't need access to Alice's search space, only to the particular strategy she found. Better yet, we don't even need access to Alice's strategy itself: Alice can keep her strategy secret, and just truthfully report the results of backtesting her strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has this approach been explored in the literature? Also, does this approach work, or is one of the simplifying assumptions too simplistic, and is this approach bound to fail? &lt;/p&gt;&#xA;" OwnerUserId="12099" LastEditorUserId="12099" LastEditDate="2015-06-25T18:09:09.773" LastActivityDate="2015-06-25T18:09:09.773" Title="Here is an approach for measuring Data Snooping; is it new?" Tags="&lt;backtesting&gt;&lt;theory&gt;&lt;testing&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="16612" PostTypeId="1" AcceptedAnswerId="16669" CreationDate="2015-02-17T15:42:04.743" Score="2" ViewCount="2290" Body="&lt;p&gt;Does anyone know any events where using logistic regression to estimate probability of default has led to a bank, financial institution, government or anything really to &lt;strong&gt;benefit in practice&lt;/strong&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see a lot of journals, papers and theses on logistic regression used to estimate PD. Some develop models, and some validate. But how many actually prove &lt;strong&gt;beneficial in practice&lt;/strong&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Motivation&lt;/strong&gt;: For a mathematical finance project, I have to convince a bank, financial institution or government to even entertain the idea of using probabilities of default coming from logistic regression. &lt;strong&gt;Theoretical justifications or predictions won't do. It has to be good effects that actually come from using the PDs.&lt;/strong&gt; Like, model was implemented then it turned out great (Never mind The Black Swan for now).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The project is already complete but utterly pointless outside a bookshelf for future research if the bank/FI/govt doesn't choose to implement it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for not necessarily a journal, paper or thesis. It could be a news or magazine article or something, anything really.&lt;/p&gt;&#xA;" OwnerUserId="7788" LastActivityDate="2015-02-22T10:58:30.690" Title="Actually benefiting from logistic regression to estimate probability of default" Tags="&lt;regression&gt;&lt;risk-models&gt;&lt;credit-risk&gt;&lt;default-probability&gt;&lt;default-risk&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16614" PostTypeId="2" ParentId="16590" CreationDate="2015-02-17T16:28:28.403" Score="0" Body="&lt;p&gt;Did you check that you use the same interest rate for AUD and JPY in both systems? The difference is quite large. The used model should be Garman–Kohlhagen which is Black Scholes with two interest rates. In which currency is the vega?&lt;/p&gt;&#xA;" OwnerUserId="1221" LastActivityDate="2015-02-17T16:28:28.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16616" PostTypeId="2" ParentId="11261" CreationDate="2015-02-17T17:46:31.607" Score="0" Body="&lt;p&gt;Looking at the post - it seems it is the definition of delta itself, not the details of the formulae, that is different&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought the delta was the ratio of change in value of the derivative to the change in the &lt;em&gt;same&lt;/em&gt; (unit) amount of underlier&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The post appears to be saying that the delta is the ratio of change of the derivative to the change in the &lt;em&gt;equivalent&lt;/em&gt; amount of the underlier&lt;/p&gt;&#xA;" OwnerUserId="15393" LastActivityDate="2015-02-17T17:46:31.607" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16617" PostTypeId="1" CreationDate="2015-02-17T19:41:04.377" Score="2" ViewCount="5166" Body="&lt;p&gt;I need to extract an exhaustive list of securities with CUSIPs and ISINs on bloomberg. This data needs to be on a global level. Can someone help with the formulae on bloomberg please?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers,&#xA;G&lt;/p&gt;&#xA;" OwnerUserId="15394" LastActivityDate="2016-04-03T04:52:47.450" Title="How to pull an exhaustive list of securities traded globally, on bloomberg?" Tags="&lt;data&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16618" PostTypeId="2" ParentId="11261" CreationDate="2015-02-17T20:14:25.320" Score="6" Body="&lt;p&gt;I think there is confusion around the forward price and the value of a forward contract.  A forward contract obligates an exchange of an asset at some future time $T$.  By convention, this forward contract has initial value zero (at time $0$).  The forward contract, being an exchange of an asset for a set dollar amount in the future, has at some $t \in [0, T]$ a value of $f(t, T)=S_t-Ke^{-r(T-t)}$.  This contract clearly has delta equal to one.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now consider the problem of the &quot;correct&quot; price $K$ at time zero.  By convention, $f(0, T)=0$.  Using the equation $S_t-Ke^{-r(T-t)}$ and solving for K at $t=0$ yields $K=S_0e^{rT}$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$K$ is not time dependent: it is fixed at time zero.  However, at time $t$ another forward contract may be initiated with maturity $T$.  The same argument as above yields the price of $K$ at time $t$ of $S_t e^{r(T-t)}$.  To explicitly show this dependence of $K$ on $t$ I will now let $F(t, T)$ denote the value of $K$ for a forward contract with expiration $T$ initiated at time $t$.  Since $F(t, T)=S_t e^{r(T-t)}$ the &quot;delta&quot; of $F(t, T)$ is $e^{r(T-t)}$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is important to note that $F(t, T)$ is not an asset: after all, the discounted value of $F(t, T)$ is clearly not a martingale under the risk-neutral measure.  It is more natural to take the delta of the forward contract, which is an asset.  &lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2015-02-17T20:14:25.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16619" PostTypeId="2" ParentId="16617" CreationDate="2015-02-17T20:17:02.927" Score="0" Body="&lt;p&gt;You should press the green &quot;help&quot; key on the Bloomberg terminal twice to communicate with their helpdesk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in general you can simply use the &quot;BDP(CUSIP, PRICE)&quot; or &quot;BDH(CUSIP, PRICE; STARTDATE, ENDDATE)&quot; function with Bloomberg's Excel Addin (e.g. &lt;a href=&quot;https://stackoverflow.com/questions/20080470/bloomberg-bhd-function-with-isin&quot;&gt;https://stackoverflow.com/questions/20080470/bloomberg-bhd-function-with-isin&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2015-02-17T20:22:41.500" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16620" PostTypeId="2" ParentId="16617" CreationDate="2015-02-17T21:02:03.700" Score="2" Body="&lt;p&gt;Just use the EQS function and grab all active securities (primary listing only unless you want the same one per each exchange)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specify in the resultscreen for isin and cusips in the add columns field&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Click results in EQS&#xA;Enter ISIN in the Add column entry and hit enter (repeat that for cusip too)&lt;/p&gt;&#xA;" OwnerUserId="2154" LastEditorUserId="2154" LastEditDate="2015-02-18T15:01:23.237" LastActivityDate="2015-02-18T15:01:23.237" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16622" PostTypeId="2" ParentId="16485" CreationDate="2015-02-18T07:22:26.307" Score="2" Body="&lt;p&gt;The direct answer to your question on the choice of m is, &quot;It depends.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your choice of m is dependent on the convention used by the source of your discount rate. Either may be appropriate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are actually looking to estimate a &quot;fair&quot; value, then the following will be relevant:&#xA;A market yield(-to-maturity) approach assumes coupon reinvestment at that yield-to-maturity.[1] Using a single discount rate for multiple payments assumes a flat yield curve, which is almost never the case in reality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With any valuation, you can always start off by forgetting any short-cut formula and focusing on the cash flows: determine what the cash flows are for every relevant period and then discount each cash flow back individually.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the PIK case, you have only one cash flow. With the loan (similar to most bonds), you have a series of coupons and a terminal payment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This leaves you with the question of what discount rate to use. If you are looking to generate a fair value estimate, then you would probably want to generate (or use a pre-generated) a zero-coupon &quot;risk free&quot;[2] curve and add a credit spread extracted from a credit-similar bond that is actively traded, plus possibly a liquidity adjustment for less liquid instruments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've managed to find some notes from CFA Level 1 material dealing with bond valuation and specifically the issue around using multiple discount rates for multiple cash flows through time: &lt;a href=&quot;http://www.investopedia.com/exam-guide/cfa-level-1/fixed-income-investments/arbitrage-free-valuation-approach.asp&quot; rel=&quot;nofollow&quot;&gt;http://www.investopedia.com/exam-guide/cfa-level-1/fixed-income-investments/arbitrage-free-valuation-approach.asp&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;--&lt;br&gt;&#xA;[1] See e.g. &lt;a href=&quot;http://www.investopedia.com/exam-guide/cfa-level-1/fixed-income-investments/traditional-yield-curve-measures-assumptions.asp&quot; rel=&quot;nofollow&quot;&gt;http://www.investopedia.com/exam-guide/cfa-level-1/fixed-income-investments/traditional-yield-curve-measures-assumptions.asp&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[2] Derived from some proxy. There's been some debate about relevant choices over the last years. See for e.g.  &lt;a href=&quot;http://www.prmia.org/sites/default/files/references/HullPresentation.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.prmia.org/sites/default/files/references/HullPresentation.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="787" LastEditorUserId="787" LastEditDate="2015-02-18T13:43:38.233" LastActivityDate="2015-02-18T13:43:38.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16627" PostTypeId="2" ParentId="16502" CreationDate="2015-02-18T12:43:01.367" Score="1" Body="&lt;p&gt;Interest rate is 12%, we'll assume some kind of simple day count scheme like 30/360.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cash flows and discount factors for C payer&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;t   disc.fact.   rcv.cf  pay.cf  rcv.pv&#xA;0   1            0       -2C     0&#xA;1   .88          800     0       704&#xA;2   .7744        800     -C      619.52&#xA;3   .681472      800     -C      545.18&#xA;4   .59969536    800     -C      479.76&#xA;5   .527731916   1200    -C      633.28&#xA;6   .464404086   1200    -C      557.28&#xA;7   .408675596   1200    -C      490.41&#xA;8   .359634524   1200    -C      431.56&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Receive total PV = 4,501.58&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pay total PV:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \text{PayPV} = -2C -C.(1-0.12)^2 - C.(1-0.12)^3 .. \\&#xA;    = -C  \left(2 + \sum_{n=2}^{8} f^n \right) \\&#xA;    = -C (5.816013485)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $f=(1-0.12)$. Equate for Par:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \text{RcvPV} + \text{PayPV} = 0\\&#xA;4501.58 - 5.816013485 C = 0 \\&#xA;C = 774.00$$&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2015-02-18T12:43:01.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16628" PostTypeId="2" ParentId="16567" CreationDate="2015-02-18T12:51:04.227" Score="5" Body="&lt;p&gt;In academics, Roll's critique of the CAPM is discussed a lot, for a start see &#xA;&lt;a href=&quot;http://en.wikipedia.org/wiki/Roll%27s_critique&quot; rel=&quot;noreferrer&quot;&gt;Wikipedia page of Roll's critique&lt;/a&gt;. It is more of a principled &quot;theoretical&quot; critique of the CAPM than an empirical one. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It says basically that the CAPM cannot be tested because&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;every mean-variance efficient portfolio satisfies the CAPM&lt;/li&gt;&#xA;&lt;li&gt;the market portfolio is unobservable&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="560" LastActivityDate="2015-02-18T12:51:04.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16631" PostTypeId="1" CreationDate="2015-02-18T17:26:25.180" Score="2" ViewCount="426" Body="&lt;p&gt;Can someone please tell me what this is?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The RIC for the straight eurodollar options is 0#GE+, I need RICs for the 1,2,3,4 mid curve options which the IMM/IOM calls GE0, GE2, GE3, GE4.&lt;/p&gt;&#xA;" OwnerUserId="15397" LastEditorUserId="15397" LastEditDate="2015-02-19T12:18:06.400" LastActivityDate="2016-10-12T03:22:04.657" Title="Reuters RIC chain for Eurodollar midcurve options" Tags="&lt;options&gt;&lt;exchange&gt;" AnswerCount="1" CommentCount="2" ClosedDate="2016-10-14T17:07:13.453" ContentLicense="CC BY-SA 3.0" />
  <row Id="16632" PostTypeId="2" ParentId="16590" CreationDate="2015-02-18T18:20:00.457" Score="1" Body="&lt;p&gt;Some residual difference is expected due to gamma and other higher order greeks, and to rate assumptions as mentioned above.  Also you should make sure about the meaning of delta expressed in USD for an AUD/JPY option; I am not sure that is standard across systems.  It could be the dollar value of the JPY to hold as hedge taking AUD as the riskless currency, or dollar value of AUD to hold as hedge taking JPY as riskless currency, or either the value of AUD or JPY to hold for a combined hedge of both currencies' moves against USD.  It could also be premium-included or forward versions of these.  &lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2015-02-18T18:20:00.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16633" PostTypeId="2" ParentId="16631" CreationDate="2015-02-18T19:50:22.787" Score="0" Body="&lt;p&gt;Here is a definition and explanation.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.sirca.org.au/2011/01/what-is-a-ric-chain/&quot; rel=&quot;nofollow&quot;&gt;http://www.sirca.org.au/2011/01/what-is-a-ric-chain/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13902" LastEditorUserId="743" LastEditDate="2015-12-16T21:29:24.523" LastActivityDate="2015-12-16T21:29:24.523" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16634" PostTypeId="1" AcceptedAnswerId="16638" CreationDate="2015-02-18T23:00:08.517" Score="1" ViewCount="3141" Body="&lt;p&gt;Under what circumstances would one want to delta hedge a straddle option? This &lt;a href=&quot;http://thefinancialengineer.org/options-futures-other-derivatives/vanilla-options-futures/straddle-strangle/&quot; rel=&quot;nofollow&quot;&gt;link&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;explains:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; Both straddles and strangles can be used with delta hedging &#xA;when an investor expects high volatility around the strike price&#xA;(where gamma and returns from delta-hedging  will be greatest).&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How am I gaining by hedging the delta, it is not clear from this explanation. &lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2015-02-19T20:44:03.337" Title="Under what circumstances would one want to delta hedge a straddle" Tags="&lt;option-strategies&gt;&lt;delta-hedging&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16635" PostTypeId="1" CreationDate="2015-02-19T05:15:03.020" Score="1" ViewCount="524" Body="&lt;p&gt;Sorry, that's probably quite a bunch of silly questions, but I just got lost a bit and need to dot all the i's and cross some t's :).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;br&gt;&#xA;Let's say we have a series of returns (like this one we may get in R):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quantmod)&#xA;getSymbols(&quot;AAPL&quot;)&#xA;A &amp;lt;- AAPL[,6][&quot;2007&quot;]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, if I want to know how much could I lose with the probability 95%, I need to calculate VaR for this 5% quantile, OK? Again, in R first I need to calculate the quantile: &lt;code&gt;quantile(A, 0.05)&lt;/code&gt;, am I right? The result in this particular series would be 11.485. Which means that with the 95% probability I won't go lower than 11.485, is that right? Thus, my VaR would be then mean(A) - 11.485 = 5.8 or 33.56%, wouldn't it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, calculating a quantile for a given probability in this particular case gives us a lower boundary corresponding to a series in question, doesn't it? And that's how quantiles are measured, it's not a percentage, but boundaries which with a certain probability limit values of a series?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;br&gt;&#xA;Now, to the second part :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While reading the &lt;a href=&quot;http://www.businessinsider.com/how-to-use-wolfram-alpha-for-finance-2013-7?op=1&amp;amp;IR=T&quot; rel=&quot;nofollow noreferrer&quot;&gt;article on Wolfram Alpha&lt;/a&gt;, I've noticed that among other things, when asked on a certain stock, WA among other information, also tries to give &lt;a href=&quot;https://i.imgur.com/TZUXTjE.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;some predictions&lt;/a&gt;. Which are actually quantiles, aren't they? E.g., with the 95% probability they say that the stock in question in one month time won't go lower than 92.67 - and this price, 92.67 would be the 5% quantile for that particular stock during that particular period, right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;br&gt;&#xA;If so, now to the most interesting bit: as you may see, they also draw some hypothetical colored graphs there, using log normal random walks, as they say below. But with log normal random walks values one will get may be very different, is that so? Thus, they probably calculate quite a lot of such walks, like hundreds or thousands, and then bootstrap them? If so, then how is that done with R? What is the usual algorithm? Needful libraries? Where should I look to learn more? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not that I'm interested in predicting stocks, of course :), but I just very much like the idea of trying to predict a distribution...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="15402" LastActivityDate="2015-02-21T01:54:16.100" Title="Quantiles, Value-at-Risk and log normal random walks…" Tags="&lt;r&gt;&lt;value-at-risk&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16636" PostTypeId="2" ParentId="15943" CreationDate="2015-02-19T07:20:53.403" Score="1" Body="&lt;p&gt;So in short: in place of the input where you have cost of carry in usual Black Scholes you need the traded VIX-Futures price instead (which is not (!) the result of an application of the cost of carry formula) from the market and apply Black 76 -right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Just like Gabriele wrote in the comment. The futures price is not (!) just the spot with interest compounding. And the reason is that the spot can not be traded.&#xA;If you look at the formula for &lt;a href=&quot;http://www.cboe.com/framed/pdfframed.aspx?content=/micro/vix/vixwhite.pdf&amp;amp;section=SECT_MINI_SITE&amp;amp;title=VIX+White+Paper&quot; rel=&quot;nofollow&quot;&gt;VIX&lt;/a&gt; then you see that $VIX^2$ is indeed a portfolio of traded options (weighted inversely to the square of the strike). But $VIX$ itself would be the square-root of this portfolio which is a non-linear transformation. I think this gives some intuition.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-02-19T09:01:18.703" LastActivityDate="2015-02-19T09:01:18.703" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16637" PostTypeId="1" AcceptedAnswerId="16639" CreationDate="2015-02-19T18:19:37.330" Score="2" ViewCount="447" Body="&lt;p&gt;Given two risky assets and their corresponding covariance matrix, how do I compute the global minimum variance portfolio, its standard deviation and its expected return? &lt;/p&gt;&#xA;" OwnerUserId="15267" LastEditorUserId="41390" LastEditDate="2020-12-11T19:15:07.000" LastActivityDate="2020-12-11T19:15:07.000" Title="Computing the minimum variance portfolio for only two risky assets" Tags="&lt;portfolio-management&gt;&lt;portfolio-optimization&gt;&lt;expected-return&gt;&lt;standard-deviation&gt;&lt;minimum-variance&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="16638" PostTypeId="2" ParentId="16634" CreationDate="2015-02-19T20:44:03.337" Score="1" Body="&lt;p&gt;You delta hedge if don't have an opinion of whether the stock will go up or down but think that realized volatility will be substantially different from implied volatility. If you don't delta hedge without having a view on the direction of the stock you are taking unnecessary risk.&lt;/p&gt;&#xA;" OwnerUserId="8228" LastActivityDate="2015-02-19T20:44:03.337" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16639" PostTypeId="2" ParentId="16637" CreationDate="2015-02-19T21:49:25.077" Score="4" Body="&lt;p&gt;Assume the weights of the two assets are $w$,$1-w$ respectively;the expected returns and standard deviations are denoted by $\mu$,$\sigma$ with subscripts 1,2,p(for portfolio),i.e,we have $\mu_1$,$\mu_2$,$\mu_p$,$\sigma_1$,$\sigma_2$,$\sigma_p$.The correlation coefficent is $\rho$&#xA;Then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma_p^2=w^2\sigma_1^2+(1-w)^2\sigma_2^2+2w(1-w)\sigma_1\sigma_2\rho  \,\,\,\,...(1)$$ &#xA;$$\mu_p=w\mu_1+(1-w)\mu_2 \,\,\,\,\,\,\,\,\,\,\,\,...(2)$$&#xA;$$\frac{d_{\sigma_p}}{dw}=0$$&#xA;$$w=\frac{\sigma_2^2-\rho\sigma_1\sigma_2}{\sigma_2^2+\sigma_1^2-2\rho\sigma_1\sigma_2}\,\,\,\,\,\,...(3)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Substituting(3) into (1) and (2) and simplify them will lead to the answer.&lt;/p&gt;&#xA;" OwnerUserId="13819" LastEditorUserId="13311" LastEditDate="2015-02-20T16:20:13.200" LastActivityDate="2015-02-20T16:20:13.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16640" PostTypeId="1" CreationDate="2015-02-20T07:10:14.103" Score="3" ViewCount="193" Body="&lt;p&gt;In an example I was working through it was shown that $W_{t}^{2} - t$ was a martingale with respect to the Brownian motion filtration $\mathcal{F}_{s}^{W}$ with $t&amp;gt;s$. Everything was fine except a part in the proof where the author used the fact&#xA;\begin{equation}&#xA;E(t|\mathcal{F}_{s}^{W}) = s&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't quite see the rationale for this. For example if we take a process $X(t,\omega) = t$, then it seems that $X$ is not stochastic, and in fact is independent of $\omega$ for all $\omega$ in the sample space -- so why does the conditional expectation in the equation above make sense?&lt;/p&gt;&#xA;" OwnerUserId="7772" LastEditorUserId="4910" LastEditDate="2015-02-20T22:10:19.213" LastActivityDate="2015-02-20T22:10:19.213" Title="Conditional expectation of a non stochastic process" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;&lt;mathematics&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16641" PostTypeId="2" ParentId="16640" CreationDate="2015-02-20T07:22:00.903" Score="2" Body="&lt;p&gt;The above question was a typo due to the author -- the expression should be evaluated as&#xA;\begin{equation}&#xA;E(t|\mathcal{F}_{s}^{W}) = t&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;due to the reasoning in the question.&#xA;Sorry for the noise. &lt;/p&gt;&#xA;" OwnerUserId="7772" LastActivityDate="2015-02-20T07:22:00.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16642" PostTypeId="2" ParentId="16640" CreationDate="2015-02-20T08:59:08.237" Score="1" Body="&lt;p&gt;You might want to give us the exact statement of the author. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let the Wiener process $W_{s}$ be a r.v. from $\left(\mathcal{F}_{s},\Omega\right)\to\left(\mathcal{B}\left(\mathbb{R}\right),\mathbb{R}\right)$. The Borel-$\sigma$-algebra $\mathcal{B}\left(\mathbb{R}\right)$ contains all intervals of the form $\left[x,y\right]$ for $x\neq y\in\mathbb{R}$, because you have to be able to tell at time $s\geq 0$ if the Wiener process $W_{s}$ has its value in this interval or not. In order for $W_{s}$ to be measurable all the pre-images of this intervals have to be in the $\sigma$-algebra $\mathcal{F}_{s}^{W}$. So the (deterministic) random variable $X\left(t,\omega\right)=t$ is also measurable at time $s\geq 0$ because we can say in which interval its value is. But the deterministic r.v. $X\left(t,\omega\right)=t$ does not depend on $\omega$, so the pre-image of every obtainable resp. not obtainable interval is $\Omega$ resp. $\emptyset$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Every deterministic r.v. is measurable to the trivial $\sigma$-algebra $\mathcal{F}_{0}:=\left\{\emptyset,\Omega\right\}$, which is contained in every other $\sigma$-algebra $\mathcal{F}_{s}^{W}$. So even if we condition on the coarser (smaller) $\sigma$-algebra $\mathcal{F}_{s}^{W}$ a deterministic r.v. is measurable and we only need the trivial $\sigma$-algebra $\mathcal{F}_{0}$. But that is&#xA;\begin{equation}&#xA;\mathbb{E}\left[t\mid\mathcal{F}_{0}\right] = \mathbb{E}\left[t\right] = t&#xA;\mathrm{.}&#xA;\end{equation}&lt;/p&gt;&#xA;" OwnerUserId="6980" LastActivityDate="2015-02-20T08:59:08.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16644" PostTypeId="1" AcceptedAnswerId="16645" CreationDate="2015-02-20T15:25:39.330" Score="0" ViewCount="4528" Body="&lt;p&gt;The Minimum Variance Hedge ratio is defined as: $h = \rho * \frac{\sigma_S}{\sigma_F}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For correlation $\rho$ and $\sigma_S , \sigma_F$ for S.D. of changes in asset and future prices accordingly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can this value h be greater than 1?&lt;/p&gt;&#xA;" OwnerUserId="15412" LastActivityDate="2015-02-20T20:01:29.607" Title="Can the Minimum Variance Hedge ratio be greater than 1?" Tags="&lt;correlation&gt;&lt;covariance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16645" PostTypeId="2" ParentId="16644" CreationDate="2015-02-20T20:01:29.607" Score="1" Body="&lt;p&gt;Yes.  Correlations max out at 1.  However if the correlation is near 1 and the volatility of the spot is significantly larger than the volatility of the future the hedge ratio will be greater than 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The intuition is if that vol of the future is much smaller than the vol of the spot you might need a lot more futures to minimize the high spot variance.&lt;/p&gt;&#xA;" OwnerUserId="5689" LastActivityDate="2015-02-20T20:01:29.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16646" PostTypeId="1" CreationDate="2015-02-20T22:21:33.613" Score="2" ViewCount="136" Body="&lt;p&gt;How do you estimate the mean in a Non-Negative Matrix Factorization framework?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is obvious and well known how to estimate the covariance matrix, how ever I also need the estimated mean. I'm assuming there is a way to estimate the mean via regression as there is with similar algorithm's such as PCA and this should already be derived for Non-Negative Matrix Factorization. I just can't find it in the literature and common frameworks do not provide this and only return the matrix factorization (MatLab, R ,Python exc...).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the terminology from &lt;a href=&quot;http://www.mathworks.com/help/stats/nnmf.html&quot; rel=&quot;nofollow&quot;&gt;MatLab&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;A&lt;/code&gt; represents an &lt;code&gt;NxM&lt;/code&gt; Matrix (Could be 1 + Returns or Volumes or generally any positive matrix). One can compute &lt;code&gt;nnmf(A)&lt;/code&gt; to get &lt;code&gt;[W, H, D]&lt;/code&gt; where &lt;code&gt;W*H&lt;/code&gt; is a lower-rank approximation to &lt;code&gt;A&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this as simple as computing the direct mean and covariance of &lt;code&gt;W*H&lt;/code&gt; or am I missing something?&lt;/p&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="1764" LastEditDate="2015-02-24T18:51:17.470" LastActivityDate="2015-02-24T18:51:17.470" Title="Non-Negative Matrix Factorization - Estimating the Mean" Tags="&lt;equities&gt;&lt;factor-models&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16647" PostTypeId="1" CreationDate="2015-02-20T23:06:52.533" Score="0" ViewCount="3196" Body="&lt;p&gt;How to pull stock exchange names for a list of stocks with tickers, on bloomberg? Please advise the steps so as to paste the list of tickers without having to type tickers one by one.&lt;/p&gt;&#xA;" OwnerUserId="15394" LastActivityDate="2015-05-23T05:53:14.233" Title="How to pull stock exchange names for a list of tickers, bloomberg?" Tags="&lt;data&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16648" PostTypeId="2" ParentId="1369" CreationDate="2015-02-20T23:11:17.923" Score="1" Body="&lt;p&gt;I don't think any of the current answers, answer the question, there is one metric that dominates all of them and that is simply the t-stat of the factor. This is well shown across academic literature as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rule of the thumb here is to use a t-stat greater than 2.&lt;/p&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="1764" LastEditDate="2015-02-21T06:06:31.707" LastActivityDate="2015-02-21T06:06:31.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16649" PostTypeId="2" ParentId="16635" CreationDate="2015-02-21T01:54:16.100" Score="1" Body="&lt;p&gt;Not too sure about the second part of your questions but as far as &lt;code&gt;VaR&lt;/code&gt;, R has some pretty neat functions. First I took you subset &lt;code&gt;A&lt;/code&gt; and converted it to discrete returns since using actual prices for VaR may be a bit harder to interpret. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Load PerformanceAnalytics for VaR &amp;amp; Calculating Returns&#xA;library(&quot;PerformanceAnalytics&quot;)&#xA;&#xA;# Calculate Returns&#xA;a &amp;lt;- CalculateReturns(A, method=c(&quot;discrete&quot;))&#xA;&#xA;# Calculate VaR at 95% confidence&#xA;VaR(a, p=0.95)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This results in a &lt;code&gt;VaR: -0.03399548&lt;/code&gt;. Put simply, One can expected to lose approximately 3.40% on any given day. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a subset of the the function's description. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;VaR is an industry standard for measuring downside risk. For a return series, VaR is defined as the high quantile (e.g. ~a 95 quantile) of the negative value of the returns. This quantile needs to be estimated...&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take a look at the daily returns and the &lt;code&gt;VaR&lt;/code&gt; level:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;plot(a)&#xA;abline(h=VaR(a,p=0.95), col='red')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You see that not many returns fall below the red line which satisfies the 95% confidence &lt;/p&gt;&#xA;" OwnerUserId="13428" LastActivityDate="2015-02-21T01:54:16.100" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16650" PostTypeId="1" CreationDate="2015-02-21T02:55:11.790" Score="4" ViewCount="297" Body="&lt;p&gt;I recently saw a VaR calculation, and I was wondering whether that calculation made sense. Here the details:&#xA;1. Construction of a total return bond portfolio index. By total return I mean that the index takes on account capital gains/losses from bond price movements; and that accrued interests are also taken on account as part of the return.&#xA;2. Calculation of this TRI over a certain period of time gave only positive returns.&#xA;3. In conclusion, the Historical VaR is &quot;positive&quot;, meaning that you never lose money when taking on account accrued interest.&#xA;Guys, will that make sense to you? Basel 3 and Solvency 2 propose internal models based on price movements; do you think it makes sense making the VaR calculations over TRI portfolios (equities o bonds)?&lt;/p&gt;&#xA;" OwnerUserId="15420" LastActivityDate="2015-06-13T05:06:26.477" Title="Positive VaR when calculation on Total Return Indexes?" Tags="&lt;equities&gt;&lt;bond&gt;&lt;var&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16651" PostTypeId="2" ParentId="8914" CreationDate="2015-02-21T06:33:22.250" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://mechanicalmarkets.wordpress.com/2015/02/16/protecting-client-interests-anonymity-in-us-equities/&quot; rel=&quot;nofollow&quot;&gt;https://mechanicalmarkets.wordpress.com/2015/02/16/protecting-client-interests-anonymity-in-us-equities/&lt;/a&gt; does analysis similar to the question here. It examines the post-trade performance of orders grouped by their MPID (only UBSS and anonymous orders had enough data points to report). It also looks at market impact upon the addition of a new order.&#xA;(Disclosure: I'm the author)&lt;/p&gt;&#xA;" OwnerUserId="15340" LastEditorUserId="15340" LastEditDate="2015-02-21T07:04:41.427" LastActivityDate="2015-02-21T07:04:41.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16652" PostTypeId="2" ParentId="10010" CreationDate="2015-02-21T06:41:14.983" Score="2" Body="&lt;p&gt;My blog discusses this at length: &lt;a href=&quot;https://mechanicalmarkets.wordpress.com/2015/02/16/protecting-client-interests-anonymity-in-us-equities/&quot; rel=&quot;nofollow&quot;&gt;https://mechanicalmarkets.wordpress.com/2015/02/16/protecting-client-interests-anonymity-in-us-equities/&lt;/a&gt; . To quickly summarize, as Louis Marascio said, DirectEdge pays brokers to disclose their MPID. Another possible incentive is the broker trying to maximize their order's chance of execution; if by disclosing their MPID the market is alerted to an order having particularly low-alpha, then that order will be more likely to execute. &lt;/p&gt;&#xA;" OwnerUserId="15340" LastActivityDate="2015-02-21T06:41:14.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16653" PostTypeId="2" ParentId="12830" CreationDate="2015-02-21T10:22:21.140" Score="2" Body="&lt;p&gt;&quot;One of the attractive features of the logistic&#xA;function is the fact that it is bounded between 0 and&#xA;1, making it suitable to represent probabilities. &quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;The Poisson intensity model introduced in this&#xA;article still has serious shortcomings despite the major&#xA;advancement offered by its dynamic features. First, it&#xA;is known to be unable to properly capture the clustered&#xA;default phenomenon such as is documented in Das et al.&#xA;(2007). Another limitation is that the time aggregation&#xA;to different horizons is easy in principle but difficult&#xA;in reality. The Poisson intensity is a known function&#xA;of common risk factors and individual firm attributes.&#xA;For time aggregation to get to a longer horizon of&#xA;interest, one must prescribe the dynamic processes for&#xA;all these variables whose future values are unknown.&#xA;The dimension of the dyna&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;etc&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rmi.nus.edu.sg/gcr/files/04%20GCR%20vol%201.pdf&quot; rel=&quot;nofollow&quot;&gt;http://rmi.nus.edu.sg/gcr/files/04%20GCR%20vol%201.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7788" LastActivityDate="2015-02-21T10:22:21.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16654" PostTypeId="2" ParentId="16650" CreationDate="2015-02-21T13:22:38.967" Score="0" Body="&lt;p&gt;You need to take in to account the variation in return ( i.e. standard deviation) of the returns to get the VaR. Alternatively,you can simulate the total return using Excel as well  and find the VaR accordingly.  &lt;/p&gt;&#xA;" OwnerUserId="15425" LastActivityDate="2015-02-21T13:22:38.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16655" PostTypeId="1" CreationDate="2015-02-21T16:37:14.193" Score="1" ViewCount="824" Body="&lt;p&gt;I'm trying to calculate the delta for bond Call options. I'm using the vasicek model which gives the following solution for a Zero-coupon bond call option:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Z = N P(t,S) \Phi(d_1) - K P(t,T) \Phi(d_2).$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Differentiating the above equation with respect to the underlying $P(t,S)$ gives the classical delta&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Delta = N \Phi(d_1).$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d_1 = \frac{ln \left(\frac{NP(t,S)}{KP(t,T)}\right) + \frac{\sigma_p^2}{2}}{\sigma_p}$&#xA;,  $d_2 = d_1 - \sigma_p$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Comparing the analytical delta with the numerical first derivative (with the call formula as input) using a central difference scheme&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$&#xA;Z' = \frac{Z(r_{i+1})-Z(r_{i-1})}{P(t,S)(r_{i+1})-P(t,S)(r_{i-1})}&#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or any other higher-order stencil &#xA;gives a very different result. For example, while the former approaches 1 as the price of P(t,S) increases the latter doesn't reach 0.7. See the figure below. The X-axis is the price of the bond $P(t,S)$. Here $t&amp;lt;T&amp;lt;S$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These discrepancies increase whith the Option maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any trick to find numerical deltas for IR derivatives? I faced the same problem with Swaptions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think my confusion lies in the underlying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/p5l1U.jpg&quot; alt=&quot;Bond Call option Delta&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&#xA;Allan &lt;/p&gt;&#xA;" OwnerUserId="15426" LastEditorUserId="15426" LastEditDate="2015-02-21T16:46:18.910" LastActivityDate="2015-03-25T03:15:18.227" Title="Numerical delta of Bond Options" Tags="&lt;option-pricing&gt;&lt;fixed-income&gt;&lt;derivatives&gt;&lt;numerical-methods&gt;&lt;delta-hedging&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16656" PostTypeId="1" AcceptedAnswerId="16684" CreationDate="2015-02-21T17:00:23.563" Score="1" ViewCount="115" Body="&lt;p&gt;Given forward rate f(t,T) and bond price P(t,T) where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$f(t,T) = - \frac{\partial}{\partial T} \ln P(t,T)$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P(T,T) = 1 = P(t,t)$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;T&gt;0 and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$t \in [0,T]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does it follow that $P(t,T) = exp(-\int_{t}^{T} f(t,u) du)$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My professor gives an argument that suggests it is so, but a different way I tried suggested the instead  we have $P(t,T) = \pm exp(-\int_{t}^{T} f(t,u) du)$. Who is right? What is the flaw in the wrong one's reasoning?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My professor's:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$f(t,u) = - \frac{\partial}{\partial u} \ln P(t,u)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\int_{t}^{T} f(t,u) du = \int_{t}^{T} - \frac{\partial}{\partial u} \ln P(t,u) du$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\int_{t}^{T} f(t,u) du = \int_{t}^{T} - \frac{\partial}{\partial u} \ln P(t,u) du$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$- \int_{t}^{T} f(t,u) du = \ln P(t,T) - \ln P(t,t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$- \int_{t}^{T} f(t,u) du = \ln P(t,T)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$e^{- \int_{t}^{T} f(t,u) du} = P(t,T)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;QED&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mine:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$f(t,u) = - \frac{\partial}{\partial u} \ln P(t,u)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\int_{t}^{T} f(t,u) du = \int_{t}^{T} - \frac{\partial}{\partial u} \ln P(t,u) du$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$- \int_{t}^{T} f(t,u) du = - \int_{t}^{T} - \frac{\partial}{\partial u} \ln P(t,u) du$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$- \int_{t}^{T} f(t,u) du = \int_{t}^{T} \frac{\partial}{\partial u} \ln P(t,u) du$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$- \int_{t}^{T} f(t,u) du = \int_{t}^{T} \frac{\partial}{\partial u} P(t,u) / P(t,u) du$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$v = P(t,u)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dv = \frac{\partial}{\partial u} P(t,u)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$- \int_{t}^{T} f(t,u) du = \ln |P(t,u)/ P(t,t)|$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$- \int_{t}^{T} f(t,u) du = \ln |P(t,u)|$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$e^{- \int_{t}^{T} f(t,u) du} = |P(t,u)|$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\pm e^{- \int_{t}^{T} f(t,u) du} = P(t,u)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;QED&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. it is assumed we can swap integral and derivative (if even relevant).&lt;/p&gt;&#xA;" OwnerUserId="7788" LastActivityDate="2015-02-23T04:39:57.603" Title="Differential equation involving bond price and forward rate" Tags="&lt;bond&gt;&lt;pricing&gt;&lt;forward&gt;&lt;price&gt;&lt;forward-rate&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16657" PostTypeId="1" CreationDate="2015-02-21T20:10:32.457" Score="1" ViewCount="1458" Body="&lt;p&gt;Heston model can be used to find prices of options under stochastic volatility. How do I include jumps in the model, so that I end up with a different stochastic volatility curve? References to literature would be helpful.&lt;/p&gt;&#xA;" OwnerUserId="15428" LastEditorDisplayName="user13444" LastEditDate="2016-12-15T19:26:38.207" LastActivityDate="2016-12-16T06:22:46.847" Title="Heston model with Jumps" Tags="&lt;stochastic-volatility&gt;&lt;heston&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16658" PostTypeId="2" ParentId="16657" CreationDate="2015-02-21T20:21:01.157" Score="1" Body="&lt;p&gt;Yes!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try &lt;a href=&quot;http://elis.sigmath.es.osaka-u.ac.jp/research/Heston-original.pdf&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; and &lt;a href=&quot;https://phps.portals.mbs.ac.uk/Portals/49/docs/20110627_SV_Heston.pdf&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you don't know the black-scholes basics well consider to read the book &quot;Paul Wilmott in Quantitative Finance&quot; before to go to Stochastic Volatility models and models with jumps.&lt;/p&gt;&#xA;" OwnerUserId="15426" LastActivityDate="2015-02-21T20:21:01.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16659" PostTypeId="1" CreationDate="2015-02-21T20:22:41.367" Score="1" ViewCount="42" Body="&lt;p&gt;One can rather easily show that E[$\sum_{i = 0}^{i = n - 1}W_{t_i}(W_{t_{i + 1}} - W_{t_i})]$ = -T + $W_T^2$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I'm confused about is why we can't simply say that for each i, $W_{t_{i}}$ is independent of $(W_{t_{i + 1}} - W_{t_i})$, so that upon interchanging sums and expectations, and using independence we have E[$\sum_{i = 0}^{i = n - 1}W_{t_i}(W_{t_{i + 1}} - W_{t_i})]$ = $\sum_{i = 0}^{i = n - 1}E[W_{t_{i}}]E[W_{t_{i + 1}} - W_{t_i}]$ = 0? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this problem, we have naturally partitioned an interval as $0 = t_{0} &amp;lt; t_{1} &amp;lt; ... &amp;lt; t_{n} = T$, and $W_{t}$ is a Brownian motion.  &lt;/p&gt;&#xA;" OwnerUserId="11919" LastActivityDate="2015-04-23T03:56:07.380" Title="computation involving independent increments" Tags="&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="4" ClosedDate="2015-04-23T07:13:06.837" ContentLicense="CC BY-SA 3.0" />
  <row Id="16660" PostTypeId="1" CreationDate="2015-02-21T21:22:59.907" Score="2" ViewCount="576" Body="&lt;p&gt;There are a few thread with the question of methods to combine different trading signals/strategies. But is there any method that can ensure that by combining two signals, we can achieve a better Sharpe ratio?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I have two simple signals one with a Sharpe of 1 and the other with a Sharpe of 0.5. I would like to generate a new one using these two signals to get better Sharpe. I've tried boosting or simple linear combinations of the two but didn't get better results. Any suggestions will be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="5861" LastActivityDate="2018-01-19T19:54:25.810" Title="Method to combine trading signals to achieve higher sharpe" Tags="&lt;quant-trading-strategies&gt;&lt;quantitative&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16662" PostTypeId="2" ParentId="16146" CreationDate="2015-02-22T00:38:48.453" Score="6" Body="&lt;p&gt;The most used equity volatility models in the industry are the Black-Scholes model (including its time dependent version) and the local volatility model. It always come along with stochastic rates, discrete dividends and quanto effects (a must-have when pricing even simple payoffs) so the calibration/pricing process is much more involved than what you might expect. Of course stochastic volatility are used but it all boils down to the payoffs you are selling to clients and the subsequent risks you are managing. Jumps are less common to my knowledge but might be used in some specific cases  (exotic variance products).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for your question if you are just computing implied volatilities for the sake of storing data then you are not using any model (pricing any other payoff) so I assume this is not related to your first question. What you might want to do is however to fit a parametrical implied volatility surface to your data set. Have a look at Gatheral's SVI/SSVI for example. This is basically a parametrical function that can fit many market shapes (so you only have to store some parameters per maturity) but most importantly can lead to arbitrage free surfaces.&lt;/p&gt;&#xA;" OwnerUserId="2411" LastActivityDate="2015-02-22T00:38:48.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16663" PostTypeId="2" ParentId="16343" CreationDate="2015-02-22T00:58:54.683" Score="3" Body="&lt;p&gt;The local volatility is just a $\mathbb{R}_+\times[0,T]\mapsto \mathbb{R}_+$ function where $T$ is some time horizon. It is the solution of a simple equation so it expression is written as $\sigma(K,t)$ but here $K$ is essentially a notation to denote a strike value as the Dupire equation relates the function $\sigma$ to vanilla market prices at a given strike. Once computed (calibrated) the local volatility function is used during the diffusion of the underlying asset so we evaluate it at pair $(S_t,t)$&lt;/p&gt;&#xA;" OwnerUserId="2411" LastActivityDate="2015-02-22T00:58:54.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16664" PostTypeId="2" ParentId="16657" CreationDate="2015-02-22T01:09:11.597" Score="1" Body="&lt;p&gt;don't know If I understand well your question, but If you want to have a rather complete perspective about the affine class of models (to which Heston's model belongs), you better study &lt;a href=&quot;http://darrellduffie-com.gowest1.gowesthosting.com/uploads/pubs/DuffiePanSingleton2000.pdf&quot; rel=&quot;nofollow&quot;&gt;Duffie et al. (2000)&lt;/a&gt;. In this very important contribution you'll find many examples of jump specifications &lt;/p&gt;&#xA;" OwnerUserId="13528" LastActivityDate="2015-02-22T01:09:11.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16665" PostTypeId="1" CreationDate="2015-02-22T01:36:23.383" Score="1" ViewCount="63" Body="&lt;p&gt;Where can I find the share price of Precision Imaging Corporation of America, Inc. on March 13, 1991?&lt;br&gt;&#xA;I realize the company no longer exists and the shares are now worthless but I would like to know how much was spent to acquire 2000 shares in March of 1991.&lt;/p&gt;&#xA;" OwnerUserId="15431" LastActivityDate="2015-02-22T18:42:15.173" Title="Share price of Precision Imaging Corporation of America on March 13, 1991" Tags="&lt;equities&gt;&lt;price&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16666" PostTypeId="2" ParentId="16659" CreationDate="2015-02-22T01:36:36.510" Score="0" Body="&lt;p&gt;$W_{t_i}$ and $W_{t_i}$ are not independent (in fact $W_{t_i}=W_{t_i}$), e.g.&#xA;$$E[W_t^2]=t^2\neq E[W_t]\cdot E[W_t]=0$$&#xA;So you cant separate the expectation in your equation.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2015-02-22T01:58:22.427" LastActivityDate="2015-02-22T01:58:22.427" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16667" PostTypeId="2" ParentId="16647" CreationDate="2015-02-22T02:43:20.273" Score="1" Body="&lt;p&gt;Use the Bloomberg Excel Add-In:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;=BDP(TICKER,&quot;EQY_PRIM_SECURITY_PRIM_EXCH&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2015-02-22T02:43:20.273" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16669" PostTypeId="2" ParentId="16612" CreationDate="2015-02-22T10:53:26.257" Score="5" Body="&lt;p&gt;&lt;strong&gt;Firstly&lt;/strong&gt;, the use of the logit models to estimate the PDs is particularly appreciated in some credit industries, as, for instance, the credit retail one. The logit model predicts pretty well the PD on loans, consumer credit, credit cards, ... and all concerns the retail consumer world.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mainly, those listed are the principal sub-industries in the credit business where the logit model works fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the others, the logit model does not work. The most famous case is the PD estimate of low-default-portfolios, in which there are so fews defaults that's impossible to estimate the probability of default by using a logit model; the government bond portfolios are an example of those ones. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Secondly&lt;/strong&gt;, I suggest to look at the benefits of those kinds of model in terms of money saved by the bank; as you probably know, generally a bank has to estimate the probability of default about own credit exposures in order to be able to set aside the right quantity of money to satisfy capital requirements according to the Basel III treaty.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As more the PD estimates about the bank credit exposures are accurate, as more the bank saves money (required capital).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the main reason the bank wants to estimate properly PD, EAD, LGD,... because, in this way, by showing to the Supervisor it can develop a model correctly and in a better way than the model suggested by the regulators, the bank can set aside less money in terms of capital requirements and, so, to invest money in the business.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, in order to show to the bank why it should use those kind of model, you should estimate the different models suggested by the literature:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Logistic model;&lt;/li&gt;&#xA;&lt;li&gt;Probit model;&lt;/li&gt;&#xA;&lt;li&gt;Neural networks;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;and compare them to see which model allows you, at the same time, to save money in terms of capital requirements and make money in terms of business. In fact, the money you set aside for the capital requirements cannot be used by the banks for business (the bank cannot use that money to issue, for example, a loan).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Thirdly&lt;/strong&gt;, there is no articles, papers or something like this on which you can base your answer for the project work, because this topic is relatively new and the academic literature is still debatable about that. I suggest to provide your own (reasonable) considerations about the issue.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-02-22T10:58:30.690" LastActivityDate="2015-02-22T10:58:30.690" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16670" PostTypeId="1" AcceptedAnswerId="16714" CreationDate="2015-02-22T11:38:47.720" Score="12" ViewCount="2538" Body="&lt;p&gt;First, I can't find a purely &quot;financial&quot; explanation for this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also the only mathematical explanation I've found so far was using the large deviations theory, which is quite complex.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a rather simple mathematical explanation ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks !&lt;/p&gt;&#xA;" OwnerUserId="15435" LastEditorUserId="15435" LastEditDate="2015-02-22T11:54:03.420" LastActivityDate="2020-04-11T18:07:48.510" Title="Why does the volatility smile flatten as maturities increase?" Tags="&lt;implied-volatility&gt;&lt;volatility-smile&gt;" AnswerCount="6" CommentCount="4" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="16671" PostTypeId="2" ParentId="1489" CreationDate="2015-02-22T13:10:00.107" Score="0" Body="&lt;p&gt;To me this aims at computing a daily implied volatility surface. For some stocks/indices you may have either vanillas options or american options quoted in the market. If your implied volatility is computed from hybrid vanilla/american call/put options then your implied volatility computation methodology should be as close as possible. You should not directly consider approximating here as we would like to stay close to, for instance, a Monte-Carlo local volatility pricing framework where the dividends are detached accurately and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may want to consider PDE solving in a production environment (with update rule for discrete dividends handling). If well implemented it is fast and well-behaved. You should use &lt;a href=&quot;http://www.wikiwand.com/en/Newton%27s_method&quot; rel=&quot;nofollow&quot;&gt;Newton-Raphson&lt;/a&gt; for high vega zones (close to ATM and more and more widespread for long maturities) and &lt;a href=&quot;http://www.wikiwand.com/en/Brent%27s_method&quot; rel=&quot;nofollow&quot;&gt;Brent&lt;/a&gt; for the rest. Good first guess will speed up the process.&lt;/p&gt;&#xA;" OwnerUserId="2411" LastActivityDate="2015-02-22T13:10:00.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16672" PostTypeId="2" ParentId="8247" CreationDate="2015-02-22T13:37:30.193" Score="3" Body="&lt;p&gt;If someone wants simple intuition, here is what happened to the drift.  It did go into the formula, believe it or not, but it came into the B-S math sort of in two ways so it cancelled out in the end.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It disappears because Black-Scholes assumes people may have different preferences for risk, but at least everyone is consistent on their own preference.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There &lt;em&gt;is&lt;/em&gt; a drift in Black-Scholes.  There needs to be some way to say how much return (or drift) you personally must get to take a certain amount of risk.  More accurately, we must know &lt;em&gt;how much return above the risk-free rate&lt;/em&gt; (or risk premium) you must get to accept one $\sigma$ of return risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, imagine we had a formula that required us to somehow calibrate it for your personal tastes.  How do we calibrate you, then?  If you want to buy an option on stock A, we need to know how much excess return you need to suffer the risk of a stock just like stock A.  If we could find another stock, B, that had identical return and risk prospects, then somehow we could &quot;plug in&quot; that stock's numbers to the formula for you.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But wait - why look for an identical stock?  Stock A is out there and we could calibrate you with it.  Stock A is the very stock to use then! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sounds a bit fishy?  Not really.  Presumably, you are neither buying nor selling stock A today because you don't believe it is either overvalued or undervalued.  Thus, whatever you believe in your head about the risk and return to price an option on A can use stock A as the calibration.  Imagine doing just the drift term: if you think stock A is going up 15%, well, then, 15% is the right drift to use for stock A options for you.  As long as you are consistent it all falls out and we don't need the drift.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This makes more sense (and this is the one of the hedges that keeps getting talked about) if you imagine that you think you have secret information that a company's stock will jump 10% later today.  If you really though that you would think the stock is really, really undervalued right now, true?  But, you could also buy a call and sell a put that expires tomorrow with identical strikes.  That would also go up 10% later today if you are right!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you try the example I just gave in your head, you can see that, if you are right, the call options are woefully undervalued and puts overvalued) by 10%.  So, the accumulation of everyone else's preferences and beliefs - which go into both the stock and the options prices - are very different from yours.  You, in fact, think that stock A has a lot more return at very low risk to occur compared to everyone else...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It doesn't spit out by giving you your own price for the option (we all share one price), but it gives a price based on a collective estimate of drift - though, oddly, we don't know what that estimate is.  However, option prices would seem too low if you estimate a higher drift or lower volatility, so you would load up on options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It definitely can fall out of the math a couple of ways, via risk-neutral pricing and Girasnov's theorem, or via a Taylor series expansion that can't ignore one of the second order terms due to quadratic variation, etc.  It can also be thought of via a hedge, but that is also hard to understand.  None of these is intuitive. &lt;/p&gt;&#xA;" OwnerUserId="15436" LastActivityDate="2015-02-22T13:37:30.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16673" PostTypeId="2" ParentId="16310" CreationDate="2015-02-22T13:43:33.483" Score="0" Body="&lt;p&gt;No.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice the local volatility model has a finite number of slices, so a single slice works as well. Now the problem is : how to compute the time derivative ? Well without adding any information you know that &#xA;$$ C(0,K) = (S_0-K)_+ $$&#xA;so you could try&#xA;$$ C_\tau = \frac{C(\tau,K)-C(0,K)}{\tau} $$&#xA;but it is a &lt;strong&gt;very crude&lt;/strong&gt; approximation. What you may want to do instead is first to use the Dupire formula w.r.t. implied volatilities and consider the whole surface flat and equal to you slice, thus taking $\Sigma_\tau=0$. It is equivalent to use the formula w.r.t. total implied variances $w(\tau,K):=\Sigma^2(\tau,K)\tau$ and compute the derivative as above :&#xA;$$ \lim_{\tau \rightarrow 0_+} w(\tau,K) = 0$$&#xA;$$ w_\tau(\tau,K) \eqsim \frac{w(\tau,K)-w(0_+,K)}{\tau} = \Sigma^2(\tau,K)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the formula w.r.t. total variances (a good reference is Gatheral's &lt;em&gt;The Volatility Surface: A Practitioner's Guide&lt;/em&gt;) :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \sigma^2(\tau,K) = \frac{w_\tau(K)}{\displaystyle1-\frac{y}{w(\tau,K)}w_y(\tau,K)+\frac{1}{4}\left(-\frac{1}{4}-\frac{1}{w(\tau,K)}+\frac{y^2}{w^2(\tau,K)}\right)(w_y(\tau,K))^2+\frac{1}{2}w_{yy}(\tau,K)} $$&#xA;where $y=\ln(K/S_O)$ and $w_\tau(K)=\Sigma(K)^2$. You see here that the denominator still depends on $\tau$ through $w$. There is no way around this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The vanilla price approach will yield the same conclusion since the equivalent time-derivative has to be computed using the Black-Scholes $\theta$ greek (derivative w.r.t. to time to maturity) with the implied volatility at the considered strike. The Black-Scholes theta depends on the time to maturity even without drift.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also the local volatility generated by an implied volatility surface is unique obviously (satisfies Dupire equation).&lt;/p&gt;&#xA;" OwnerUserId="2411" LastEditorUserId="2411" LastEditDate="2015-02-24T20:54:09.227" LastActivityDate="2015-02-24T20:54:09.227" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16674" PostTypeId="1" AcceptedAnswerId="16675" CreationDate="2015-02-22T14:18:20.653" Score="3" ViewCount="82" Body="&lt;p&gt;We look at a standard no dividends Black-Scholes model and here we have a process Z, which is defined by:&#xA;Z(t)=(S(t)/H)^p , where H is a positive constant and p=1-2r/sigma^2&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am now asked to show that Z(t)/Z(0) is a positive mean-1 martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first intuition tells me to use Ito's formula to get dZ(t) and that shouldn't include a dt term, but I somehow keep seeing the dt term when I use Ito. I am getting increasingly frustrated. Can someone help me with this?&#xA;From there on I would take the expectation and se that E(Z(t))=1.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Mads&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="13510" LastActivityDate="2015-02-22T15:39:22.817" Title="Show that Z(t)/Z(0) is a positive mean-1 martingale" Tags="&lt;martingale&gt;&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16675" PostTypeId="2" ParentId="16674" CreationDate="2015-02-22T15:39:22.817" Score="1" Body="&lt;p&gt;$$ Z_t = f(S_t) := \left( \frac{S_t}{H} \right)^p $$&#xA;$$ dZ_t = \partial_x f(S_t) dS_t + \frac{1}{2} \partial^2_{xx} f(S_t) d\langle S \rangle_t = p\frac{S_t^{p-1}}{H^p} dS_t + \frac{1}{2} p(p-1) \frac{S_t^{p-2}}{H^p} S_t^2 \sigma^2 dt $$&#xA;Thus&#xA;$$ dZ_t = Z_t \left( p r + \frac{1}{2} p(p-1) \sigma^2 \right)dt + p Z_t \sigma dW_t $$&#xA;so that&#xA;$$ \frac{dZ_t}{Z_t} = \mu dt + p\sigma dW_t $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$  \mu = p r + (p\sigma^2 )\left( \frac{1}{2} (p-1)\right) = r - 2 \frac{r^2}{\sigma^2} - (\sigma^2-2r) \frac{r}{\sigma^2} = 0$$&#xA;which proves that $Z$ is a martingale&lt;/p&gt;&#xA;" OwnerUserId="2411" LastActivityDate="2015-02-22T15:39:22.817" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16676" PostTypeId="2" ParentId="16617" CreationDate="2015-02-22T16:36:36.327" Score="2" Body="&lt;p&gt;Maybe try &lt;a href=&quot;http://bsym.bloomberg.com/sym/&quot; rel=&quot;nofollow&quot;&gt;http://bsym.bloomberg.com/sym/&lt;/a&gt; see left bottom part &quot;predefined files&quot;.&lt;/p&gt;&#xA;" OwnerUserId="15437" LastActivityDate="2015-02-22T16:36:36.327" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16677" PostTypeId="2" ParentId="16665" CreationDate="2015-02-22T18:42:15.173" Score="1" Body="&lt;p&gt;Apparently this company was traded OTC/Pink sheet (and was already dubious in 1988 see &quot;Precision Imaging Corp&quot;&#xA;&lt;a href=&quot;http://babel.hathitrust.org/cgi/pt?id=uiug.30112058759736;view=1up;seq=175&quot; rel=&quot;nofollow&quot;&gt;http://babel.hathitrust.org/cgi/pt?id=uiug.30112058759736;view=1up;seq=175&lt;/a&gt;).&#xA;To my knowledge Compustat database doesn't have it neither.&#xA;My next best guess is to try at your library in some old books like &quot;Walker's Manual&quot; or Moody's. &#xA;And my last chance is to go directly to the SEC archives microfilm !&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ps: Working for Ameriprise Financial (&quot;PRECISION IMAGING   CORP AMER&quot; 2000)? ;)&#xA;&lt;a href=&quot;http://www.sec.gov/Archives/edgar/data/820027/0000950137-07-012368.txt&quot; rel=&quot;nofollow&quot;&gt;http://www.sec.gov/Archives/edgar/data/820027/0000950137-07-012368.txt&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15437" LastActivityDate="2015-02-22T18:42:15.173" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16678" PostTypeId="1" AcceptedAnswerId="16680" CreationDate="2015-02-22T19:00:58.187" Score="6" ViewCount="493" Body="&lt;p&gt;Below is are some option quotes taken directly from the CBOE website. I am wondering what the &#xA;&lt;code&gt;-E, -4, -8, -A, -B, -I, -J etc..&lt;/code&gt;that are at the end of the options symbol mean?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example: &lt;code&gt;AAPL1513C109-E&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More examples:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;5 Mar 109.00 (AAPL1513C109),13.48,0.0,20.45,20.65,0,51,15 Mar 109.00 (AAPL1513O109),0.08,0.0,0.07,0.10,0,426,&#xA;15 Mar 109.00 (AAPL1513C109-4),0.0,0.0,20.45,20.65,0,51,15 Mar 109.00 (AAPL1513O109-4),0.82,0.0,0.07,0.10,0,426,&#xA;15 Mar 109.00 (AAPL1513C109-8),9.72,0.0, , ,0,51,15 Mar 109.00 (AAPL1513O109-8),0.83,0.0, , ,0,426,&#xA;15 Mar 109.00 (AAPL1513C109-A),10.70,0.0,20.45,20.65,0,51,15 Mar 109.00 (AAPL1513O109-A),1.62,0.0,0.07,0.10,0,426,&#xA;15 Mar 109.00 (AAPL1513C109-B),0.0,0.0,20.45,20.65,0,51,15 Mar 109.00 (AAPL1513O109-B),0.66,0.0,0.07,0.10,0,426,&#xA;15 Mar 109.00 (AAPL1513C109-E),13.48,0.0,20.40,20.70,0,51,15 Mar 109.00 (AAPL1513O109-E),0.08,0.0,0.07,0.10,0,426,&#xA;15 Mar 109.00 (AAPL1513C109-I),0.0,0.0,20.45,20.65,0,51,15 Mar 109.00 (AAPL1513O109-I),0.12,0.0,0.07,0.10,0,426,&#xA;15 Mar 109.00 (AAPL1513C109-J),0.0,0.0,18.70,22.20,0,51,15 Mar 109.00 (AAPL1513O109-J),0.0,0.0,0.07,0.10,0,426,&#xA;15 Mar 109.00 (AAPL1513C109-O),11.30,0.0,20.45,20.65,0,51,15 Mar 109.00 (AAPL1513O109-O),0.09,0.0,0.07,0.10,0,426,&#xA;15 Mar 109.00 (AAPL1513C109-P),0.0,0.0,20.45,20.65,0,51,15 Mar 109.00 (AAPL1513O109-P),0.12,0.0,0.07,0.10,0,426,&#xA;15 Mar 109.00 (AAPL1513C109-S),0.0,0.0, , ,0,51,15 Mar 109.00 (AAPL1513O109-S),0.0,0.0, , ,0,426,&#xA;15 Mar 109.00 (AAPL1513C109-X),10.45,0.0,20.45,20.65,0,51,15 Mar 109.00 (AAPL1513O109-X),0.13,0.0,0.07,0.10,0,426,&#xA;15 Mar 109.00 (AAPL1513C109-Y),0.0,0.0,20.45,20.65,0,51,15 Mar 109.00 (AAPL1513O109-Y),0.0,0.0,0.0,5.00,0,426,=&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="13661" LastEditorUserId="13661" LastEditDate="2015-02-22T19:21:18.350" LastActivityDate="2015-02-22T19:44:17.070" Title="What does the &quot;-E&quot; mean at the end of a CBOE options symbol?" Tags="&lt;options&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16679" PostTypeId="1" CreationDate="2015-02-22T19:18:24.577" Score="1" ViewCount="129" Body="&lt;p&gt;I am stuck with a revision question at home on Black-Scholes pricing model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is on a fund manager selling one unit of the fund to a customer for $S(0)$ at time $0$ and then guaranteeing at time T to pay customer maximum of $S(0)$ or $e^{-aT}  S(T)$ for $a&amp;gt;0$ being the fund fee. The model I read about talks about maximum of $S(T)-K$ or $0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can one value the customer pay-off at time $0$ or time t? &lt;/p&gt;&#xA;" OwnerUserId="15439" LastEditorUserId="11678" LastEditDate="2015-11-06T14:17:25.590" LastActivityDate="2015-11-06T14:17:25.590" Title="Use of Black-Scholes Model on Guaranteed Fund Investment" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16680" PostTypeId="2" ParentId="16678" CreationDate="2015-02-22T19:44:17.070" Score="6" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;This letter (if present) indicates which exchange(s) the option trades at, whereby:&lt;br&gt;&#xA;      No hyphen or letter present = Composite&lt;br&gt;&#xA;      A = AMEX American Stock Exchange&lt;br&gt;&#xA;      B = BOX Boston Stock Exchange - Options&lt;br&gt;&#xA;      E = CBOE Chicago Board Options Exchange&lt;br&gt;&#xA;      I = BATS&lt;br&gt;&#xA;      J = NASDAQ OMX BX&lt;br&gt;&#xA;      O = NASDAQ OMX&lt;br&gt;&#xA;      P = NYSE Arca&lt;br&gt;&#xA;      X = PHLX Philadelphia Stock Exchange&lt;br&gt;&#xA;      Y = C2 Exchange&lt;br&gt;&#xA;      4 = Miami Options Exchange&lt;br&gt;&#xA;      8 = ISE International Securities Exchange&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;a href=&quot;http://www.cboe.com/delayedquote/quotehelp.aspx#chaindata&quot; rel=&quot;noreferrer&quot;&gt;http://www.cboe.com/delayedquote/quotehelp.aspx#chaindata&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2015-02-22T19:44:17.070" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16681" PostTypeId="2" ParentId="16655" CreationDate="2015-02-22T19:53:24.950" Score="0" Body="&lt;p&gt;I tried to use the BPV/delta relashionship &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Delta = \frac{ \frac{\partial Z}{\partial r}-\frac{\partial P(t,T)}{\partial r}\frac{Z}{P(t,T)}  } {\frac{\partial P(t,S)}{\partial r}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but it doesn't work as well.&lt;/p&gt;&#xA;" OwnerUserId="15426" LastActivityDate="2015-02-22T19:53:24.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16683" PostTypeId="2" ParentId="1369" CreationDate="2015-02-23T03:45:35.130" Score="0" Body="&lt;p&gt;There are a few other techniques to consider in addition to what has already been suggested. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Principal components regression (PCR). This would consist of doing a PCA on the independent variables and then regress the dependent variable on the factors. You can always translate the coefficients back into the original basis. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Partial Least Squares (PLS). Very similar to PCR, but while the PCR PCA is about choosing coefficients to maximize the explaned variance of the independent variables, in PLS you choose coefficients so that the independent variables explain the most variance of the dependent variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Information Criterion. If you can express the choice as between a simpler model versus a more complex model, the optimal choice under this approach is to choose the one with the most favorable information criterion. Most common is AIC, which increases in log likelihood of the model and decreases in number of paramters. Of course, this requires making some assumptions about the errors of the model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Posterior predictive checks. Simulate data from the model. Evaluate if it makes sense. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2015-02-23T03:45:35.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16684" PostTypeId="2" ParentId="16656" CreationDate="2015-02-23T04:39:57.603" Score="0" Body="&lt;p&gt;The negative solution does not satisfy $P(T,T)=P(t,t)=1$&lt;/p&gt;&#xA;" OwnerUserId="7788" LastActivityDate="2015-02-23T04:39:57.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16685" PostTypeId="1" AcceptedAnswerId="16812" CreationDate="2015-02-23T05:13:16.100" Score="2" ViewCount="343" Body="&lt;p&gt;What is the filtration $(\mathfrak{F}_t)$ encircled below?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it $(\mathfrak{F}_t) = (\sigma(W_t)) = (\sigma(\tilde{W_t})), t \in [0,T]$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or is it $(\mathfrak{F}_t) = (\sigma(\hat{W_t})), t \in [0,T]$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/oHAjQ.png&quot; alt=&quot;Image 1&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/5oLQs.png&quot; alt=&quot;Image 2&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/EwyJ1.png&quot; alt=&quot;Image 3&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://www.ntu.edu.sg/home/nprivault/MA5182/stochastic_finance.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;reference&lt;/a&gt; (p. 271, 275, 336) and suggests that it is in fact the $(\sigma(W_t)) = (\sigma(\tilde{W_t}))$, but I am not really sure I am reading this right.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so, does that mean there are 2 probability measures being considered in the martingale? Risk neutral measure for filtration and Forward measure for probability measure&gt;?&lt;/p&gt;&#xA;" OwnerUserId="7788" LastActivityDate="2016-11-06T11:19:38.920" Title="What is the filtration described?" Tags="&lt;stochastic-calculus&gt;&lt;pricing&gt;&lt;derivatives&gt;&lt;risk-neutral-measure&gt;&lt;forward&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16686" PostTypeId="1" AcceptedAnswerId="16721" CreationDate="2015-02-23T05:26:05.570" Score="1" ViewCount="69" Body="&lt;p&gt;Is the t in the red boxed $R(t,T)$ supposed to be the same as the S in the green boxed $R(S,T)$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/7F4vd.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="7788" LastActivityDate="2015-02-24T19:22:54.990" Title="Incorrect characterization of spot rate?" Tags="&lt;interest-rates&gt;&lt;bond&gt;&lt;term-structure&gt;&lt;spot-rate&gt;&lt;affine-processes&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16688" PostTypeId="1" AcceptedAnswerId="22300" CreationDate="2015-02-23T06:34:59.977" Score="1" ViewCount="247" Body="&lt;p&gt;&lt;strong&gt;Question 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does one come up with the equation in the red box below?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like some kind product rule, but I'm not sure how to apply Ito's lemma here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/v6GBm.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bjork doesn't seem to explain it fully, and I can't find the Heath book. My prof gave another proof which I got.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/cexST.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should the encircled s's be u instead?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/IYneB.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cross-posted: &lt;a href=&quot;https://math.stackexchange.com/questions/1161276/differential-of-stochastic-term&quot;&gt;https://math.stackexchange.com/questions/1161276/differential-of-stochastic-term&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2018-05-31T10:23:57.767" Title="Differential of stochastic term" Tags="&lt;interest-rates&gt;&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;bond&gt;&lt;forward-rate&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16689" PostTypeId="1" CreationDate="2015-02-23T07:39:49.727" Score="2" ViewCount="1519" Body="&lt;p&gt;How can I calculate/budget/find a expectation for the 3 month LIBOR for the next 3monts-4 years?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am calculating a CF scenario on USD 3month Libor + margin. With swaps and fixed rate this is easy, but I also need to compare this to the expected cashflow with a floating 3 month LIBOR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What input is normally used to budget with 3m LIBOR? I would really appreciate a quick and good answer.&lt;/p&gt;&#xA;" OwnerUserId="15446" LastActivityDate="2015-03-25T11:53:59.607" Title="Forecast 3m LIBOR USD. Budget purpose" Tags="&lt;yield-curve&gt;&lt;libor&gt;&lt;forecast&gt;&lt;irs&gt;&lt;budgeting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16691" PostTypeId="1" AcceptedAnswerId="18154" CreationDate="2015-02-23T09:32:37.070" Score="2" ViewCount="127" Body="&lt;p&gt;From &lt;a href=&quot;http://bfi.cl/papers/Jorion%201986%20-%20Bayes-Stein%20estimation%20for%20portfolio%20analysis.pdf&quot; rel=&quot;nofollow&quot;&gt;this paper from Jorion&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone implemented this? How is the Covariance matrix estimated? It needs to estimate also the conditional distribution of the returns?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best&lt;/p&gt;&#xA;" OwnerUserId="15327" LastActivityDate="2015-06-04T08:06:57.533" Title="Bayes Stein Porfolio Implementation" Tags="&lt;covariance-matrix&gt;&lt;covariance-estimation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16692" PostTypeId="2" ParentId="16689" CreationDate="2015-02-23T11:36:15.920" Score="1" Body="&lt;p&gt;Obviously a perfect forecast for interest rates is a bit hard to come by, such a thing would make the inventor quite a tidy sum. Broadly, the task you're seeking to accomplish falls under the banner of yield curve modeling, and there is a very substantial body of research in this area, including several &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1403947260&quot; rel=&quot;nofollow&quot;&gt;good books&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are some canonical examples of interest rate models, which mostly leverage the apparently mean reverting behavior of interest rate markets to construct a yield curve. One such model is the Diebold-Li model, an implementation of which is described at &lt;a href=&quot;http://www.mathworks.com.au/help/fininst/examples/fitting-the-diebold-li-model.html&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; link. This model is a four parameter forecasting tool for various interest rate regimes which takes into account the mean reverting behavior inherent in interest rates (they are generally believed to follow a ornstein uhlenbeck mean reverting stochastic process).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another alternative is to calculate expectations implied by various maturity bonds. This can be done using various &lt;a href=&quot;http://people.math.aau.dk/~esben/teaching/13-fs/tanggaardRQFA.pdf&quot; rel=&quot;nofollow&quot;&gt;semi/non parametric smoothing methods&lt;/a&gt;. For this, you can use all of the estimators involved in non-linear regression. To my knowledge, no one technique has been proven superior. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ultimately, this is an estimation problem. It isn't like option pricing where there is a single correct answer given a baseline set of regularity conditions. &lt;/p&gt;&#xA;" OwnerUserId="3171" LastActivityDate="2015-02-23T11:36:15.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16693" PostTypeId="1" AcceptedAnswerId="16697" CreationDate="2015-02-23T11:53:05.380" Score="15" ViewCount="4462" Body="&lt;p&gt;Why is Brownian motion required to be merely almost surely continuous instead of continuous?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, this is stated as condition 2 &lt;a href=&quot;http://en.wikipedia.org/wiki/Wiener_process&quot;&gt;in this article&lt;/a&gt; in section 1, Characterizations of the Wiener process, where it says &quot;The function $t \rightarrow W_t$ is almost surely everywhere continuous.&quot; What is an example of a Brownian motion where there is a point at which the motion is not continuous?&lt;/p&gt;&#xA;" OwnerUserId="15448" LastActivityDate="2015-05-07T06:33:45.377" Title="Why is Brownian motion merely 'almost surely' continuous?" Tags="&lt;stochastic-processes&gt;&lt;brownian-motion&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="16695" PostTypeId="2" ParentId="16693" CreationDate="2015-02-23T13:12:14.450" Score="2" Body="&lt;p&gt;If you say that in probability theory an event happens &lt;em&gt;almost surely&lt;/em&gt; it happens with probability one. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &lt;a href=&quot;http://en.wikipedia.org/wiki/Almost_surely#.22Almost_sure.22_versus_.22sure.22&quot; rel=&quot;nofollow&quot;&gt;Wikipedia&lt;/a&gt;:&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The difference between an event being almost sure and sure is the same&#xA;  as the subtle difference between something happening with probability&#xA;  1 and happening always.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If an event is sure, then it will always happen, and no outcome not in&#xA;  this event can possibly occur. If an event is almost sure, then&#xA;  outcomes not in this event are theoretically possible; however, the&#xA;  probability of such an outcome occurring is smaller than any fixed&#xA;  positive probability, and therefore must be 0. Thus, one cannot&#xA;  definitively say that these outcomes will never occur, but can for&#xA;  most purposes assume this to be true.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Intuitively the idea is a little bit like that of a limit in calculus: Oversimplified it says that you will only get there after &quot;infinitely many&quot; steps, if you stop after a finite number of steps you will not reach the limit. While we got used to this idea in calculus, although &lt;em&gt;almost surely&lt;/em&gt; is similar, it is still even less intuitive because we are additionally dealing with randomness here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another example: When you think of spinning a smooth Wheel of Fortune (so without clicks and with an &quot;infinitely small&quot; hand) every single position where it could stop has probability zero, which means that it will stop at any given point &lt;em&gt;almost never&lt;/em&gt; or it will not stop at any given point &lt;em&gt;almost surely&lt;/em&gt;! Yet it has to stop somewhere...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer your question: For all intents and purposes the path of a Brownian motion (as obtained from the limit of scaled random walks) is indeed &lt;em&gt;continuous everywhere&lt;/em&gt;. Think of &lt;em&gt;almost surely&lt;/em&gt; as the technical way of saying &lt;em&gt;surely&lt;/em&gt;, so there is no example of a Brownian motion where there is a point at which the path is not continuous.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2015-02-23T17:59:39.910" LastActivityDate="2015-02-23T17:59:39.910" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16696" PostTypeId="2" ParentId="16686" CreationDate="2015-02-23T16:50:43.497" Score="1" Body="&lt;p&gt;I am note $100\%$ sure that I understand the question. But yes. &#xA;More formally one could write $R(t,S,T)$ for the rate from $S$ to $T$ observed at $t$ and &#xA;$R(t,t,T)$ for the spot.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-02-23T16:50:43.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16697" PostTypeId="2" ParentId="16693" CreationDate="2015-02-23T16:57:23.550" Score="5" Body="&lt;p&gt;Exhibiting a counter-example is straight-forward enough.  For example, let $B_{t}(\omega)$ be a Brownian motion and $\mathcal{T}(\omega)$ a stopping time on $(\Omega,\mathbb{P})$ with a continuous distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then with&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$B'_{t}(\omega)=\left\{\begin{array}{ll}B_{t}(\omega),&amp;amp;t\neq\mathcal{T}(\omega)\\B_{t}(\omega)+1,&amp;amp;t=\mathcal{T}(\omega),\end{array}\right.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$B'_{t}(\omega)$ satisfies (1) and (2) below, but is discontinuous precisely when $t=T(\omega)$.  Therefore, $B_{t}(\omega)$ is a particular realization of Brownian motion that is not everywhere continuous.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are lots of other ways to obtain a &quot;bad&quot; Brownian motion.  Another example is&#xA;$$B'_{t}(\omega)=B_{t}(\omega)\mathbb{1}_{\{B_{t}(\omega)\;\text{irrational}\}},$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but this is less straight-forward to prove.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The reason for stipulating almost sure continuity has to do with the way one constructs Brownian motion, and the issue can be completely dispensed with dependent on one's approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The usual presentation in finance texts is the abstract one, namely given a probably space $(\Omega,\mathbb{P})$, one has a Brownian motion $B_{t}(\omega)$ on this space if &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;For every set of times $0\leq t_{1}&amp;lt;t_{2}&amp;lt;\ldots&amp;lt;t_{n}$ the increments $B_{t_{1}},B_{t_{2}}-B_{t_{1}},\ldots,B_{t_{k}}-B_{t_{k-1}}$ form a mutually independent set of random variables on $(\Omega,\mathbb{P}).$&lt;/li&gt;&#xA;&lt;li&gt;The increments above are normally distributed with mean $0$ and variance $\Delta t$.&lt;/li&gt;&#xA;&lt;li&gt;For almost every $\omega\in\Omega$ the path $t\mapsto B_{t}(\omega)$ is continuous.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Most texts also include a section that sketches a concrete realization of Brownian motion as the limit of scaled random walks.  If one does this rigorously, one sees that (3) upgrades to &lt;em&gt;for every $\omega\in\Omega$&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed, if we start with $(\Omega,\mathbb{P})$ satisfying the above and let $\mathcal{P}$ denote the collection of continuous functions $[0,\infty)\to\mathbb{R}$ with $p(0)=0$, then we get from (3) the inclusion map&#xA;$$\mathcal{i}:\Omega\to\mathcal{P},$$&#xA;defined on a set $\Omega'\subset\Omega$ of full measure, and the push-forward measure of $\mathbb{P}$ onto $\mathcal{P}$ under this inclusion map turns out to be equal to the Wiener measure $\mathbb{W}$ on $\mathcal{P}$, which is unique.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Conversely, one can construct $(\mathcal{P},\mathbb{W})$ directly by starting with the set $\mathcal{P}$ (where every element of this set is continuous a priori) and demonstrating that the measures $\mu_{N}$ on $\mathbb{Z}^{\infty}_{2}$ arising from the appropriately scaled random walks $S_{t}^{N}(\omega)$ ($\omega\in\mathbb{Z}^{\infty}_{2})$ induce a collection of tight measures on $\mathcal{P}$ which converge weakly to $\mathbb{W}$:&#xA;$$\mu_{N}\Longrightarrow\mathbb{W}\;\text{(weakly)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One then defines&#xA;$$\tilde{B}_{t}(\omega):=p(t)\in\mathcal{P}$$&#xA;and readily shows that under $\mathbb{W}$, $\tilde{B}_{t}$ satisfies (1)-(3) and that therefore&#xA;$$\tilde{B}_{t}(\omega)=B_{t}(\omega),$$&#xA;but that now &lt;em&gt;every&lt;/em&gt; Brownian motion is continuous.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The equivalence of the implications above show the existence of Brownian motion is essentially tantamount to the existence of a Wiener measure on $\mathbb{W}$ arising from the sequence of measures arising naturally from the scaled random walks.  If one starts from the goal of obtaining this measure, one gets continuity for &lt;em&gt;every&lt;/em&gt; Brownian motion $p(t)=B_{t}(\omega)$.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Other constructions of Brownian motion require us stipulate almost sure continuity due to technicalities arising from measure theory on product spaces.  The quickest construction of Brownian motion in this direction is by applying Kolmogorov's extension theorem on a suitable class of processes; details can be found in Durrett.&lt;/p&gt;&#xA;" OwnerUserId="8230" LastEditorUserId="8230" LastEditDate="2015-02-23T17:55:10.990" LastActivityDate="2015-02-23T17:55:10.990" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16698" PostTypeId="1" AcceptedAnswerId="16702" CreationDate="2015-02-23T19:14:59.960" Score="3" ViewCount="317" Body="&lt;p&gt;Recapitulating the history of Black-Scholes:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Nobody knows the fair price of options.&lt;/li&gt;&#xA;&lt;li&gt;Revolution: BS! You put in all the parameters and get a price -&gt; A Nobel Prize for that one!&lt;/li&gt;&#xA;&lt;li&gt;Wait: Nobody knows the true value of future volatility, so we cannot calculate the fair price after all and are back to square one.&lt;/li&gt;&#xA;&lt;li&gt;But ok: Assuming Mr. Market is always right we now have it backwards: putting in real market prices of options and calculating their implied volatility via BS.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So what we are basically doing is exchanging the uncertainty about the fair price of an option for the uncertainty about future volatility - or just a mathematically sophisticated transformation of uncertainty per se. We could have had the &quot;Mr. Market is always right&quot;-thing without the complex mathematical machinery, couldn't we?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know, one of the accomplishments of BS is that the option price is independent of any drift of the underlying but still my question is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is my short characterisation above correct and if yes, how does it really help to transform one form of uncertainty into another and still not be able to calculate a fair price (why you started the whole endeavour in the first place)? &lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2015-02-23T21:38:40.313" Title="Black Scholes: How does it help to transform uncertainty and still not be able to calculate a fair price?" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16700" PostTypeId="2" ParentId="16698" CreationDate="2015-02-23T20:43:56.223" Score="3" Body="&lt;p&gt;Might not be the answer you're looking for, but just some thoughts that immediately come to mind...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you've alluded to, the BS model is much more than just a tool to price options.  But there's no need to get into this here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Prior to publication of the BS model, option prices already traded at more-or-less the price implied by B.S. (part of the justification for B.S. was that its predicted prices matched closely with those of the market at the time).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Supply and demand forces of the market will always dictate the prices of assets, in spite of what any theory says; as such, Black Scholes can be regarded (and is used in practice) as a guiding tool to this price discovery process and a useful interpolation method between option prices quoted in the market.  Furthermore, option trading is a constantly evolving market; for instance, prior to the late 1980's there were no volatility smiles/skews observed, and these came about due to events unrelated to any theoretical advances in option price modeling (by that time the BS model was already in active use).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keep in mind that just because the BS model is used to back-out volatilities from market prices, these implied volatilities aren't really a measures of the asset's volatility in the BS model; they are reflections of supply, demand, and expectations about future price movements.  This can be seen from the existence of volatility smiles/skews and the divergence of implied volatility of put and call options (when they should be the same!)  And when other volatility models are used (stochastic volatility models, historical volatility, etc.), we actually do need a pricing model that can explicitly provide prices.&lt;/p&gt;&#xA;" OwnerUserId="8230" LastActivityDate="2015-02-23T20:43:56.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16702" PostTypeId="2" ParentId="16698" CreationDate="2015-02-23T21:38:40.313" Score="5" Body="&lt;p&gt;Your characterisation is correct but incomplete.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) The most important part of Black-Scholes is not the model but the more general framework of dynamic hedging: you can replicate your payoff by continuously trading the underlying and the amount (delta) you should hold is the derivative of the current premium with respect to the current spot. This is a much more general fact than the actual BS model $dS_t = rS_tdt + SdW_t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Now how does it help to transform prices in volatilities using the BS formula? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Prices are hard to compare. Fix the underlying and the maturity and try to compare premiums for calls and puts with different strikes. It is not obvious to see which is &quot;cheap&quot; because they do not have the same scale. If you plot them, it will be hard to say anything based on the curve. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By looking at the BS implied volatility instead, you only have one parameter with uniform scale (the standard deviation of the log-returns divided by the square-root of maturity). This makes data much more tractable. Calls and puts correspond to a unique value of volatility and if you plot the smile you get a better representation of the market data. You can list stylized facts and interpret them e.g. on equity markets, vol is higher for low strikes (negative skew), one reason is that lots of risk averse investors buy out of the money puts as insurance against a crach, so the implied distibution for the spot has a fatter left tail than a lognormal one etc...     &lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2015-02-23T21:38:40.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16703" PostTypeId="1" AcceptedAnswerId="16709" CreationDate="2015-02-23T23:32:11.377" Score="2" ViewCount="1145" Body="&lt;p&gt;apologies if this is not the correct place for this type of question, but I just want to confirm if the following de-annualization is correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if a manager states that he will earn 200 bps of target excess returns over a year. How much daily target excess returns would be expected?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i believe that the de-annualization should be 200 ^ (1/252), but a colleague said that it should be 200 * 1/252. Which method is the most correct approach?&lt;/p&gt;&#xA;" OwnerUserId="15458" LastActivityDate="2015-02-24T08:36:26.550" Title="De-annualizing a target alpha return" Tags="&lt;returns&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16704" PostTypeId="2" ParentId="14830" CreationDate="2015-02-24T01:13:28.397" Score="0" Body="&lt;p&gt;I believe what you are looking for is available through the Tradier brokerage. Just review their documentation at &lt;a href=&quot;https://developer.tradier.com/documentation&quot; rel=&quot;nofollow&quot;&gt;https://developer.tradier.com/documentation&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope that helps.&lt;/p&gt;&#xA;" OwnerUserId="3185" LastActivityDate="2015-02-24T01:13:28.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16705" PostTypeId="1" AcceptedAnswerId="16708" CreationDate="2015-02-24T03:46:27.417" Score="4" ViewCount="6837" Body="&lt;p&gt;Sometimes, in an option chain, the implied volatility of an option is greater than 100% .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How is this possible? I mean, it is possible for 100$ stock to increase more than 100%, but not decrease more than 100%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, how to interpret this number when it is greater than 100%?&lt;/p&gt;&#xA;" OwnerUserId="218" LastEditorUserId="467" LastEditDate="2015-02-24T08:15:27.337" LastActivityDate="2015-02-24T16:33:29.790" Title="Why an option has sometimes and implied volatility greater than 100%?" Tags="&lt;options&gt;&lt;implied-volatility&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16707" PostTypeId="1" CreationDate="2015-02-24T06:56:12.550" Score="3" ViewCount="111" Body="&lt;p&gt;0 down vote favorite&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to understand the following problem.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A 2yr zero-coupon bond has an annual yield rate of 11% per year. A 4yr&#xA;  zero-coupon bond has an annual yield rate of 19% per year. Find the&#xA;  difference between the book value and the market value of a par value&#xA;  100 4yr zero-coupon bond in two years.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Which one represents the present (at time 2) value of the bond that can be calculated as 400(1.19)−2 ?&lt;/p&gt;&#xA;" OwnerUserId="15287" LastEditorUserId="1314" LastEditDate="2015-02-24T15:24:36.150" LastActivityDate="2015-05-25T16:34:43.840" Title="What is the difference between a book value and a market value?" Tags="&lt;finance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16708" PostTypeId="2" ParentId="16705" CreationDate="2015-02-24T07:07:44.513" Score="13" Body="&lt;p&gt;It seems that you are thinking of the volatility as some sort of standard deviation of your stock price. It is not. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the BS model, $\sigma\sqrt{T}$ is the standard deviation of the &lt;em&gt;log-return&lt;/em&gt; $\log(\frac{S_T}{S_0})$. There is no mathematical upper bound to its standard deviation. There is also no mathematical problem with returns being negative either. Quoting volatility as a percentage is common practice but does not necessarily make sense (in stochastic volatility models, vol of vol parameters can often be calibrated to $\sim 300\%$). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that even a positive random variable's standard deviation can be much larger than its mean if its right tail is fat enough. Consider the family of lognormal distributions for example, the standard deviation can be arbitrary large for a given mean.   &lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2015-02-24T07:07:44.513" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16709" PostTypeId="2" ParentId="16703" CreationDate="2015-02-24T08:29:13.640" Score="1" Body="&lt;p&gt;It is neither: Because returns are growth rates that have to be &lt;a href=&quot;http://en.wikipedia.org/wiki/Compound_interest&quot; rel=&quot;nofollow&quot;&gt;compounded&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/Basis_point&quot; rel=&quot;nofollow&quot;&gt;basis points&lt;/a&gt; are percentage points divided by $100$ you do the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$10000\ (\sqrt[252]{\frac{200}{10000}+1}-1)\approx 0.7858\ bp$$&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2015-02-24T08:36:26.550" LastActivityDate="2015-02-24T08:36:26.550" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16710" PostTypeId="1" CreationDate="2015-02-24T08:48:59.643" Score="1" ViewCount="170" Body="&lt;p&gt;I'm currently trying to get the implied volatility of a vanilla Euro floor with maturity 1Y with data from bloom.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the price ( which is not supposed to take into account the first floorlet which has already fixed, but takes into account only the three remaining optional floorlet.) of the floor and all the convetions which are supposed to be correct ( Act/360, floor starting 2 open days after fixing, etc...). I manage to get this implied volatility for somes strikes and even for all strikes some day, but quite often I have floors with strike ( say 4%) that I cannot get the implied vol from.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It turns out actually that my forward rates are too low and so I get a floor too high for the quoted price. Even a zero volatility get me a price above the market quote. I also price the same floorlet in Bloom and get a price above the market quote even for zero vol. So the problem I think lies in my EUR3M forward curve.The worst thing is that I was not even using EONIA curve for discounting my floorlet coupon so actually I should be even further from the quoted price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I construct my forward curve, with cash ( euribor 3M), futures with 3M maturity ( that I turn into FRA) up to maturity 2 years and then swaps. This is the way Bloom is doing. A priori OIS should not impact in this case my curve for maturity below 2 years. So I'm wondering wha'ts wrong with my forward curve? Should I remove the futures and keep only swaps? Is it the interpolation of rates? Should I smoothe my curve? Should I use in some ways EONIA below 2y for boostrapping? &#xA;Thank you for your help&lt;/p&gt;&#xA;" OwnerUserId="15460" LastActivityDate="2015-02-24T08:48:59.643" Title="forward curve and cap/floors in nowadays environment" Tags="&lt;forward&gt;&lt;multicurve&gt;&lt;ois-discounting&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16711" PostTypeId="1" CreationDate="2015-02-24T10:25:05.060" Score="1" ViewCount="330" Body="&lt;p&gt;Let $C$ be an option on an underlying $S$. I want to construct a portfolio $V$ using another asset $C_0$ such that the delta and the gamma of $V$ is the same as the delta/gamma of $C$, in order to hedge the option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let : $\gamma = \frac{\frac{\partial^{2}C}{\partial S^{2}}}{\frac{\partial^{2}C_0} {\partial S^{2}}} = \frac{\Gamma_C}{\Gamma_{C_0}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\delta = \frac{\partial C}{\partial S} - \frac{\partial C_0}{\partial S}\gamma$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apparently, if $V = \gamma C_0 + \delta S$, then $\Delta_V = \Delta_C$ and $\Gamma_V = \Gamma_C$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I try to derive the delta of $V$, I get :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Delta_V = \frac{\partial V}{\partial S} = \Delta_C + \frac{\partial \gamma}{\partial S} (C_0 - S\frac{\partial C_0}{\partial S})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the second term in the sum must be equal to 0, but I don't see why ?&#xA;Maybe it isn't and we just choose $C_0$ such that $\frac{\partial \gamma}{\partial S}$ is small ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your help.&lt;/p&gt;&#xA;" OwnerUserId="15435" LastActivityDate="2015-02-24T14:44:03.883" Title="Delta-Gamma Neutral portfolio, derivation issue" Tags="&lt;delta-hedging&gt;&lt;gamma&gt;&lt;delta-neutral&gt;&lt;derivation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16712" PostTypeId="2" ParentId="16670" CreationDate="2015-02-24T10:32:30.793" Score="2" Body="&lt;p&gt;The volatility smile is seen when Black Scholes' model assumptions are broken.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you see a flattening, the assumption breakage eases up a little (if the assumptions held you would se a pretty flat line!).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually smiles are are due to the possibility of price change momentum.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e. a price move in one period causes subsequent period moves in the same direction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Think of a market crash. A large drop precedes a surge to the exit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BS assumes returns are IID, however.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;During short periods you might see such momentum, which lessens over longer horizons.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There may be a horizon where you could see mean reversion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. a large drop would be the precursor to 'corrections' back in the other direction to a longer term mean.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To sum up, what you are see is a change in autocorrelation over differing time periods.&lt;/p&gt;&#xA;" OwnerUserId="7682" LastActivityDate="2015-02-24T10:32:30.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16713" PostTypeId="2" ParentId="16670" CreationDate="2015-02-24T11:01:55.347" Score="1" Body="&lt;p&gt;Basically what we are talking about here is the volatility of implied volatility. This decreases with expiration - why? Because not only volatility but also the volatility of volatility is mean reverting. Meaning: Short-term implied volatilities are more volatile and the further you look into the future the flatter the smile becomes as mean reversion wins&#xA;out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have also a look at this excellent presentation by quant legend Emanuel Derman:&lt;br&gt;&#xA;&lt;a href=&quot;http://finmath.stanford.edu/seminars/documents/Stanford.Smile.Derman.pdf&quot; rel=&quot;nofollow&quot;&gt;http://finmath.stanford.edu/seminars/documents/Stanford.Smile.Derman.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2015-02-24T11:01:55.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16714" PostTypeId="2" ParentId="16670" CreationDate="2015-02-24T12:12:58.460" Score="8" Body="&lt;p&gt;The central limit theorem guarantees, under fairly general assumptions, that the sum of returns becomes more normally distributed as the number of returns grows (technically, defining a return as $\mathrm{log}(S_{t+\Delta t}/S_t)$, $\sum_i ^n \mathrm{log}(S_{t+\Delta t i}/S_{t+\Delta t (i-1)} \to \mathcal{N}(\cdot,\cdot)$ as $ n \to \infty $).  Thus, as $T$ gets larger, the Black Scholes assumption of normally distributed log returns becomes more and more valid.  This is exemplified by the flattening implied volatility smile.  &lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2015-02-24T12:12:58.460" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="16715" PostTypeId="2" ParentId="16707" CreationDate="2015-02-24T13:33:11.373" Score="1" Body="&lt;p&gt;I am only taking a stab at this so please do not consider what I have to say as authoritative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we buy a two year zero coupon bond at time zero (at the above mentioned rates assumed to be annual effective rates), we would pay $\frac{100}{1.11^2}=81.16224$ and $\frac{100}{1.19^4}=49.86688$ respectively. The book value of an instrument in this context, I suspect is cost price plus amortization/accretion. In other words, when is “profit” from the instrument recognised? If profit is allocated to each year linearly, we can say that $\frac{100-81.16224}{2}$ is realised in each year for the 2-year-zero. And that $\frac{100-49.86688}{4}$ Is realised each year on the 4-year-zero. So after two years (at maturity) the two year zero would have market value and book value of $100$. The 4-year-zero would have a book value of $49.86688+2\times12.53328=74.93344$. So the difference would be approximately $25$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this would depend on how profit/growth on the instrument is recognised. Is it seen as capital gains or income? If it is seen as income, what proportion of it is recognised in each period? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If all return are seen as capital gains and only realized at maturity. Then the book value of the two-year-zero would be $100$ at time $2$. and the book value of the four-year-zero would $49.86688$ (Purchase Price) at every date before maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would be great if other members could help me out on this one as well... As I am not particularly sure of myself on this one.&lt;/p&gt;&#xA;" OwnerUserId="15457" LastActivityDate="2015-02-24T13:33:11.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16716" PostTypeId="2" ParentId="16711" CreationDate="2015-02-24T14:44:03.883" Score="1" Body="&lt;p&gt;let $\frac{\partial C}{\partial S}=\delta_c$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;let $\frac{\partial^2 C}{\partial S^2}=\Gamma_c$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;let $\frac{\partial C_0}{\partial S}=\delta_0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;let $\frac{\partial^2 C_0}{\partial S^2}=\Gamma_0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;we want&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{\partial V}{\partial S}=\frac{\partial C}{\partial S}=\delta_c$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{\partial^2 V}{\partial S^2}=\frac{\partial^2 C}{\partial S^2}=\Gamma_c$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;let&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V=aS+bC_0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\delta_c=\frac{\partial}{\partial S}\left( aS+bC_0 \right)=a+b \delta_0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Gamma_c = \frac{\partial}{\partial S}\left( a+b \delta_0 \right)=b\frac{\partial}{\partial S} \left( \delta_0 \right) = b \Gamma_0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;therefore&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$b=\frac{\Gamma_c}{\Gamma_0} \quad (=\gamma)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\delta_c=a+ \frac{\Gamma_c}{\Gamma_0} \delta_0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;showing that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$a= \delta_c- \frac{\Gamma_c}{\Gamma_0} \delta_0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$a= \frac{\partial C}{\partial S}- \frac{\Gamma_c}{\Gamma_0} \frac{\partial C_0}{\partial S} \quad (=\delta)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps&lt;/p&gt;&#xA;" OwnerUserId="15457" LastActivityDate="2015-02-24T14:44:03.883" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16717" PostTypeId="1" CreationDate="2015-02-24T15:40:14.407" Score="1" ViewCount="41" Body="&lt;p&gt;How would you measure the reputational harm incurred on an individual by an organization. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How is Market Pricing in the expected payout resulting from the law suit by an individual ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The news breaks out and the stock price drops. How would you go about measuring the same ? &lt;/p&gt;&#xA;" OwnerUserId="15462" LastActivityDate="2015-02-24T15:40:14.407" Title="Reputational Harm" Tags="&lt;volatility&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16718" PostTypeId="2" ParentId="16705" CreationDate="2015-02-24T16:33:29.790" Score="3" Body="&lt;p&gt;The answer of AFK is very good and accurate in a BS setting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thinking of jumps I would add the following:&#xA;If we assume that stocks sometimes move in jumps (usually downwards) then it is clear that ATM or OTM options shortly before expiration with a price that accounts for the possibility of a jump - which is therfore quite high - only fit in the BS framework with large implied volatilities.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-02-24T16:33:29.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16719" PostTypeId="2" ParentId="16548" CreationDate="2015-02-24T16:43:45.563" Score="6" Body="&lt;p&gt;In the theory of copulas you want to model a multivariate (often bivariate) distribution and keep the marginals fixed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus you have random variables $X$ and $Y$ with cdf $F_X(x) = P[X \le x]$ and $F_Y(y) = P[Y\le y]$ and you want to find some $F_{X,Y}(x,y) = P[X \le x, Y\le y]$ such that when you look at marginals you get $F_{X,Y}(x,\infty) = F_X(x)$ and the same for $Y$. Due to this whole theory this can be done by coupling the 2 distributions using another function, the copula (function).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before we proceede note that $F_X(x)$ is just a function of $x$. We can look at the random variable $F_X(X)$. Then if $F_X$ is invertible it holds that&#xA;$$&#xA;P[F(X) \le x] = P[X \le F^{-1}(x)] = F(F^{-1}(x)) = x&#xA;$$&#xA;for $x \in (0,1)$ and this is the definition of a uniform distribution.&#xA;So for a continuous cdf $F$ we have that $F(X)$ is uniform.&#xA;On the other hand if $U$ is uniform and $F$ is a continuous cdf then $F^{-1}(U)$ has distribution $F$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if we want to couple the distributions $F_X$ and $F_Y$ we look at how we can describe the mutlivariate distribution of uniforms and then simply transforming them back by $F_X ^{-1}$ and $F_Y ^{-1}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These quite basic facts about uniforms and cdfs helps me to understand the copula approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the cdf is not continuous then things get more complicated.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-02-24T16:43:45.563" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16720" PostTypeId="1" CreationDate="2015-02-24T16:46:29.547" Score="2" ViewCount="1092" Body="&lt;p&gt;If two instruments have a significant negative correlation but the percent change in the price of the instrument moving in positive direction is always more by a fraction than the one moving in negative direction, in what ways can we leverage such correlations to minimize our risk? How would a hedging strategy look like in such situations? Simply buying both the instruments but a little more quantity of the instrument which you think will move in positive direction should work if I am using my common sense. But need some pro advise and/or tips to pointing me in the right direction to master the art of hedging in such situations. &lt;/p&gt;&#xA;" OwnerUserId="4713" LastActivityDate="2015-02-25T10:54:01.837" Title="hedging correlated instruments" Tags="&lt;correlation&gt;&lt;hedging&gt;&lt;optimal-hedge-ratio&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16721" PostTypeId="2" ParentId="16686" CreationDate="2015-02-24T19:04:10.457" Score="1" Body="&lt;p&gt;Yes.  The map $R(\cdot;S,T):\mathbb{R}^{2}\to\mathbb{R}$ completely describes the forward rate/spot rate term interest rate structure for each $t\geq0$.  (You can think of it as the market interest rate surface for the rate $R$ at time $t$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The notation $R(t;S,T)$ is meant to remind you that $R$ is a stochastic process for $t&amp;gt;0$, the periods of time where full information is unavailable (it is assumed $t=0$ is today, the point at which we have full information).  More explicitly, $R$ depends on $\omega(t)$, where $\omega(t)\in(\Omega,\mathbb{P},\mathcal{F}_{t})$, a filtered probability space on which the stochastic model is supported.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, the value of $R$ for a fixed $t\geq0$ further depends on the period of time one is measuring the interest rates, and this is captured by the arguments $(S,T)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When the first argument $t$ is omitted, the time is implied (usually $t=0$ since this is when it makes most sense to discuss the term structure of interest rates, as we have full information at this point - any other times would be random model based).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the use of $(t;S,T)$ as labels for the variables does not commit anyone to using these precise letters/notations when using the function - in fact, it would make the presentation considerably more complicated if forced to do so, as it is more convenient to use the letters which are most natural for whatever the context is.  However, the author is committed to maintaining the &lt;em&gt;order&lt;/em&gt; of arguments, else there would be ambiguity on the meaning of the variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is helpful to think of some special cases, or maps, when other variables are fixed.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If $S=t$ and both are fixed, then $T\mapsto R(t;S,T)$ is the spot rate at time $t$ (modeled or observed today depending on whether $t=0$ or $t&amp;gt;0$) for maturities of length $T-t$.&lt;/li&gt;&#xA;&lt;li&gt;If $S&amp;gt;t$ and both are fixed, then $T\mapsto R(t;S,T)$ is the forward&#xA;rate calculated at time $t$, beginning at time $S$, and lasting to&#xA;time $T$ for a tenor of length $T-S$.&lt;/li&gt;&#xA;&lt;li&gt;If $S$ and $T$ are fixed, then $t\mapsto R(t;S+t,T+t)$ is the random&#xA;interest rate model of the spot ($S=0$) or forward ($S&amp;gt;0$) rate $R$&#xA;beginning at time $S+t$ and ending at time $T+t$ for a tenor of&#xA;length $T-S$.&lt;/li&gt;&#xA;&lt;li&gt;If $t$, $S$, and $T$ are all fixed, then the auxiliary map&#xA;$\alpha\mapsto R(t;S+\alpha,T+\alpha)$ corresponds to $T-S$ tenured&#xA;forward rate at the future time $\alpha$, as calculated at the&#xA;present time $t$ (note that &quot;present&quot; may not actually be today if&#xA;$t&amp;gt;0$, but $S$ is always a &quot;future&quot; time with respect to $t$, that is&#xA;$S\geq t$).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You can experiment with this more if you wish.  Note the obvious domain restrictions  (unless you want to consider past history of the process, but for most circumstances setting $t=0$ to be today is what most people have in mind)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$0\leq t\leq S&amp;lt;T.$$&#xA;The domanin can be somewhat extended by using the convention $R(t;S,T)\equiv0$ wherever $S=T.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; Some authors may not explicit modify the arguments $S$ and $T$ according to $t\geq0$.  For example, they may write $R(0;0,T)$ and $R(1;0,T)$, but mean that the former is the spot rate with maturity $T$ at time $t=0$ and the latter the spot rate with maturity $T$ but at time $t=1$.  In our notation, this would be a domain violation and we would write $R(0;0,T)$ and $R(1;1,T+1)$.  This is just a stylistic preference.  I believe the former style is more prevalent, but the latter style we've adopted here is nicer mathematically.  But then again, most authors adapt their notation to emphasize what is being studied (forward rates, spot rates, randomly modeled future term structure, etc.) when discussing interest rates anyway, so such issues rarely arise anyway.&lt;/p&gt;&#xA;" OwnerUserId="8230" LastEditorUserId="8230" LastEditDate="2015-02-24T19:22:54.990" LastActivityDate="2015-02-24T19:22:54.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16722" PostTypeId="2" ParentId="16720" CreationDate="2015-02-24T20:17:42.033" Score="0" Body="&lt;p&gt;One way to do this is to weight the assets in the portfolio to make it beta neutral against some benchmark. This would minimize risk in terms of the benchmark.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$W_i = \left | \frac { \beta_i } { \sum_{}{} \left | \beta \right | } \right | = \left | \frac{ Cov(R_i, R_m) / Var(R_m) }  { \sum_{i}^{n} \left | Cov(R_i, R_m) / Var(R_m) \right | }  \right |$&lt;/p&gt;&#xA;" OwnerUserId="993" LastEditorUserId="993" LastEditDate="2015-02-24T20:42:26.673" LastActivityDate="2015-02-24T20:42:26.673" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16723" PostTypeId="1" AcceptedAnswerId="16748" CreationDate="2015-02-24T20:26:10.933" Score="1" ViewCount="1057" Body="&lt;p&gt;Why is the implied volatility of this option at the ATM strike (18$) greater in the front month (March) than in a further month (Oct).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Oct month has 43%, but the front month has 54%.&#xA;Should not the volatility be more in the back month since it is further, hence more uncertain, hence there is greater possibility of a large move.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And if the back month has a lesser IV, how come the back month option has a more expensive premium(2.52) as opposed to March (1.05)? Higher premium should be due to higher IV, correct?&#xA;&lt;img src=&quot;https://i.stack.imgur.com/eTWHV.jpg&quot; alt=&quot;March&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/QgwEE.jpg&quot; alt=&quot;October&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2015-02-25T19:38:02.630" Title="Why implied volatility is less for the back month option even though the back month option is more expensive" Tags="&lt;option-pricing&gt;&lt;implied-volatility&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16724" PostTypeId="1" AcceptedAnswerId="16732" CreationDate="2015-02-24T20:31:49.693" Score="4" ViewCount="842" Body="&lt;p&gt;What is the closed form solution for the following &lt;em&gt;inverse&lt;/em&gt; Markowitz problem?   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given a mean-variance optimized fully invested portfolio $X$, a risk aversion parameter $\lambda$ and a var-covar matrix $C$.  What is the formula for the (implied) returns $\mu_{impl}$ that must have been used to build the portfolio $X$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a working paper (&lt;a href=&quot;http://74.115.228.67/wp-content/uploads/2014/01/Page-Optimal_Rebalancing.pdf&quot; rel=&quot;nofollow&quot;&gt;Kritzman et. al. 2008&lt;/a&gt;) claiming a closed form solution $\mu_{impl}$ that depends on the &quot;expected returns&quot;  $\mu$ which seems a bit circular and is perhaps a typo.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\mu_{impl} = \lambda C X^T + \frac{-\lambda + 1 C^{-1} \mu^{T}}{1 C^{-1} 1^T} 1^T&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="5689" LastEditorUserId="5689" LastEditDate="2015-02-24T20:42:19.377" LastActivityDate="2015-02-25T13:01:24.090" Title="Markowitz Mean-Variance Implied Returns" Tags="&lt;optimization&gt;&lt;covariance&gt;&lt;mean-variance&gt;&lt;markowitz&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16725" PostTypeId="2" ParentId="16310" CreationDate="2015-02-24T22:17:03.253" Score="4" Body="&lt;p&gt;Yes, there is a unique time homogeneous local vol model.  This is proven in &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S0304414912002487&quot; rel=&quot;nofollow&quot;&gt;http://www.sciencedirect.com/science/article/pii/S0304414912002487&lt;/a&gt;.  There is a slight generalization required that if the option-implied density is zero somewhere, the corresponding local vol is infinite in that region, giving a &quot;gap diffusion&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No, there is no nice formula for the local vol in this case.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2015-02-24T22:17:03.253" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16727" PostTypeId="1" AcceptedAnswerId="16731" CreationDate="2015-02-25T03:09:35.570" Score="4" ViewCount="5159" Body="&lt;p&gt;What is it about a calendar spreads opposed to other spreads (e.g vertical spread) that makes it such a popular strategy for a period of low implied volatility? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it that when low volatility turns around and increases, somehow the long leg is supposed to increase in value while the short leg is supposed to remain unaffected or (even better) decrease in value?&lt;/p&gt;&#xA;" OwnerUserId="218" LastEditorUserId="467" LastEditDate="2016-11-25T05:48:50.973" LastActivityDate="2016-11-25T05:48:50.973" Title="Why a calendar spread is a preferred strategy in a low volatility period" Tags="&lt;implied-volatility&gt;&lt;option-strategies&gt;&lt;spread-options&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16728" PostTypeId="1" CreationDate="2015-02-25T03:43:02.333" Score="1" ViewCount="553" Body="&lt;p&gt;Assume there are 3 states of the world: w1, w2, and w3. Assume there are two assets: a risk-free asset returning Rf in each state, and a risky asset with Return R1 in state w1, R2 in state w2, and R3 in state W3. Assume the probabilities are 1/4 for state w1, 1/2 for state w2, and 1/4 for state w3. Assume Rf=1.0 and R1= 1.1, R2=1.0 and R3= 0.9.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(a) Prove that there are no arbitrage opportunities.&#xA;(b) Describe the one-dimensional family of state price vectors (q1,q2,q3)&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For (a), I believe this is equivalent to showing there exists a state price vector.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know p=Xq, but since we are only given two assets X doesn't have an inverse so I don't know how to compute q. Further, we are not given p. How do I show a state price vector exists?&lt;/p&gt;&#xA;" OwnerUserId="15267" LastActivityDate="2015-04-26T12:19:32.553" Title="Proving there exists no arbitrage opportunities given 3 states and 2 assets" Tags="&lt;asset-pricing&gt;&lt;replication&gt;&lt;price&gt;&lt;stochastic-discount&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16729" PostTypeId="2" ParentId="11140" CreationDate="2015-02-25T04:16:31.327" Score="3" Body="&lt;p&gt;Here's C++&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://ewavetrade.cvs.sourceforge.net/viewvc/ewavetrade/ElliotEngine/ewave_lib.cpp?revision=1.13&amp;amp;view=markup3&quot; rel=&quot;nofollow&quot;&gt;http://ewavetrade.cvs.sourceforge.net/viewvc/ewavetrade/ElliotEngine/ewave_lib.cpp?revision=1.13&amp;amp;view=markup3&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's MQL5&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.mql5.com/en/articles/260&quot; rel=&quot;nofollow&quot;&gt;https://www.mql5.com/en/articles/260&lt;/a&gt; or &lt;a href=&quot;https://www.mql5.com/en/code/10582&quot; rel=&quot;nofollow&quot;&gt;https://www.mql5.com/en/code/10582&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm very interested in python implementation as well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, &lt;a href=&quot;https://www.tradingview.com/&quot; rel=&quot;nofollow&quot;&gt;TradingView&lt;/a&gt; automatically marks up Elliot waves on their charts.   The source pinescript is black box though. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The markup is certainly not: &quot;Elliot wave principle seems pretty informal to me&quot;&lt;/p&gt;&#xA;" OwnerUserId="15468" LastEditorUserId="467" LastEditDate="2015-03-02T03:20:41.577" LastActivityDate="2015-03-02T03:20:41.577" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16730" PostTypeId="1" AcceptedAnswerId="17599" CreationDate="2015-02-25T06:24:59.173" Score="30" ViewCount="24830" Body="&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; Correct usage of GARCH(1,1)&lt;br&gt;&#xA;&lt;strong&gt;Aim of research:&lt;/strong&gt; Forecasting volatility/variance.&lt;br&gt;&#xA;&lt;strong&gt;Tools used:&lt;/strong&gt; Python&lt;br&gt;&#xA;&lt;strong&gt;Instrument:&lt;/strong&gt; SPX (specifically adjusted close prices)&lt;br&gt;&#xA;&lt;strong&gt;Reference material:&lt;/strong&gt; On Estimation of GARCH Models with an Application to Nordea Stock Prices (Chao Li, 2007)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; I have checked almost all the Quant.SE posts discussing GARCH, but I have not seen any of them with the approximate nature of what I'm asking.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am doing a personal research of the historical volatility of stock prices when I came upon the concept of volatility forecasting. Naturally, this piqued my interest. I landed on the abovementioned reference material. After a couple of reads, I decided to see if my understanding of the application of GARCH(1,1) is correct and if I can get any insight into using it when investigating historical volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For this, I'll be using SPX prices, and the &lt;code&gt;bt&lt;/code&gt;, &lt;code&gt;pandas&lt;/code&gt;, and &lt;code&gt;arch&lt;/code&gt; libraries in Python.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My initial programming steps are as follows.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;In [1]: import pandas as pd&#xA;   ...: import bt&#xA;   ...: import arch&#xA;   ...: &#xA;&#xA;In [2]: df = bt.get('SPX', start='1990-01-01')&#xA;&#xA;In [3]: df.head()&#xA;Out[3]: &#xA;               spx&#xA;Date              &#xA;1990-01-02  359.69&#xA;1990-01-03  358.76&#xA;1990-01-04  355.67&#xA;1990-01-05  352.20&#xA;1990-01-08  353.79&#xA;&#xA;In [4]: df['pct_change'] = df['spx'].pct_change().dropna()&#xA;   ...: df['stdev21'] = pd.rolling_std(df['pct_change'], 21)&#xA;   ...: df['hvol21'] = df['stdev21']*(252**0.5) # Annualize.&#xA;   ...: df['variance'] = df['hvol21']**2&#xA;   ...: df = df.dropna() # Remove rows with blank cells.&#xA;   ...: df.head()&#xA;&#xA;Out[4]: &#xA;               spx  pct_change   stdev21    hvol21  variance&#xA;Date                                                        &#xA;1990-03-02  335.54    0.008415  0.007304  0.115946  0.013443&#xA;1990-03-05  333.74   -0.005364  0.007425  0.117863  0.013892&#xA;1990-03-06  337.93    0.012555  0.007770  0.123344  0.015214&#xA;1990-03-07  336.95   -0.002900  0.007804  0.123889  0.015348&#xA;1990-03-08  340.27    0.009853  0.007855  0.124689  0.015547&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above is pretty simple. Now, I'll use the &lt;code&gt;GARCH&lt;/code&gt; function provided by the &lt;code&gt;arch&lt;/code&gt; Python module to get &lt;code&gt;omega&lt;/code&gt;, &lt;code&gt;beta&lt;/code&gt;, and &lt;code&gt;alpha&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;In [5]: returns = df['pct_change'] * 100&#xA;   ...: am = arch.arch_model(returns)&#xA;   ...: res = am.fit(iter=5)&#xA;   ...: res.params&#xA;Iteration:      5,   Func. Count:     39,   Neg. LLF: 8447.41751792&#xA;Iteration:     10,   Func. Count:     74,   Neg. LLF: 8443.32521758&#xA;Optimization terminated successfully.    (Exit mode 0)&#xA;            Current function value: 8443.31731767&#xA;            Iterations: 12&#xA;            Function evaluations: 86&#xA;            Gradient evaluations: 12&#xA;Out[5]: &#xA;mu          0.058224&#xA;omega       0.011511&#xA;alpha[1]    0.079411&#xA;beta[1]     0.911240&#xA;Name: params, dtype: float64&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Following the formula $\sigma_t^2 = \omega + \alpha_1{a^2}_{t-1} + \beta_1{\sigma^2}_{t-1}$, I execute the following code.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;In [6]: df['C'] = res.params['omega']&#xA;   ...: df['B'] = df['variance'] * res.params['beta[1]']&#xA;   ...: df['A'] = (df['pct_change']**2) * res.params['alpha[1]']&#xA;   ...: df['forecast_var'] = df.loc[:,'C':'A'].sum(axis=1)&#xA;   ...: df['forecast_vol'] = df['forecast_var']**0.5&#xA;   ...: df.head()&#xA;   ...: &#xA;Out[6]: &#xA;               spx  pct_change   stdev21    hvol21  variance         C  \&#xA;Date                                                                     &#xA;1990-03-02  335.54    0.008415  0.007304  0.115946  0.013443  0.011511   &#xA;1990-03-05  333.74   -0.005364  0.007425  0.117863  0.013892  0.011511   &#xA;1990-03-06  337.93    0.012555  0.007770  0.123344  0.015214  0.011511   &#xA;1990-03-07  336.95   -0.002900  0.007804  0.123889  0.015348  0.011511   &#xA;1990-03-08  340.27    0.009853  0.007855  0.124689  0.015547  0.011511   &#xA;&#xA;                   B         A  forecast_var  forecast_vol  &#xA;Date                                                        &#xA;1990-03-02  0.012250  0.000006      0.023767      0.154165  &#xA;1990-03-05  0.012659  0.000002      0.024172      0.155474  &#xA;1990-03-06  0.013863  0.000013      0.025387      0.159333  &#xA;1990-03-07  0.013986  0.000001      0.025498      0.159681  &#xA;1990-03-08  0.014167  0.000008      0.025686      0.160269&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I arrive at a forecasted volatility value. My questions are as follows:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;In codeblock &lt;code&gt;[5]&lt;/code&gt;, this was used: &lt;code&gt;returns = df['pct_change'] * 100&lt;/code&gt;. I arbitrarily took this on face value as it's the way I've seen returns used in GARCH calculations. However, in the initial calculations of &lt;code&gt;variance&lt;/code&gt;, I never did need to multiply the &lt;code&gt;pct_change&lt;/code&gt; column by 100. &lt;strong&gt;&lt;em&gt;Do I keep it or should I feed the &lt;code&gt;pct_change&lt;/code&gt; column as is to the function?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If I feed &lt;code&gt;pct_change&lt;/code&gt; column to the function as is, the values of &lt;code&gt;omega&lt;/code&gt;, &lt;code&gt;beta&lt;/code&gt;, and &lt;code&gt;alpha&lt;/code&gt; become considerably smaller, which brings down the &lt;code&gt;forecast_var&lt;/code&gt; and &lt;code&gt;forecast_vol&lt;/code&gt; values down by one order of magnitude. Obviously the shift in precision causes problematic comparison between my historical volatility values and my forecasted volatility values. &lt;strong&gt;&lt;em&gt;How can I resolve this?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Should I be using a different approach altogether?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Kindly point out as well any glaring errors I might have missed or any missing logic&lt;/p&gt;&#xA;" OwnerUserId="15275" LastEditorUserId="12" LastEditDate="2015-02-25T08:26:52.030" LastActivityDate="2020-07-02T10:46:51.597" Title="Correctly applying GARCH in Python" Tags="&lt;volatility&gt;&lt;garch&gt;&lt;python&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="25" ContentLicense="CC BY-SA 3.0" />
  <row Id="16731" PostTypeId="2" ParentId="16727" CreationDate="2015-02-25T07:09:54.143" Score="7" Body="&lt;p&gt;The main thing to keep in mind with all these different option combination strategies is that you are really trading &lt;a href=&quot;http://en.wikipedia.org/wiki/Greeks_(finance)&quot; rel=&quot;noreferrer&quot;&gt;option greeks&lt;/a&gt;! I think the answer to why the calender spread is so popular lies in the special combination of gamma and vega risk:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Calendar spreads are the one type of trade where gamma can be negative while vega is positive (and vice versa of course). That means that while it is a an implied vol play you are still getting compensated for holding gamma risk (see &lt;a href=&quot;http://en.wikipedia.org/wiki/Variance_risk_premium&quot; rel=&quot;noreferrer&quot;&gt;variance risk premium&lt;/a&gt;). So while you are hoping for higher implied volatility you certainly want low realized volatility!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So putting it all together what you are hoping for is that while complacency should fade away (implied vol increase) there should still happen nothing really exceptional (low realized vol). This might be the way a lot of traders view many low vol environments (if they really understand what they are trading there which might not always be the case ;-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I may I would recommend a very good book on the subject:&lt;br&gt;&#xA;&lt;a href=&quot;http://tradingoptiongreeks.com/&quot; rel=&quot;noreferrer&quot;&gt;Trading option greeks by Dan Passarelli&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In that book you find everything about calender spreads on pages 201 ff.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2015-02-25T08:22:12.560" LastActivityDate="2015-02-25T08:22:12.560" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16732" PostTypeId="2" ParentId="16724" CreationDate="2015-02-25T07:32:27.000" Score="4" Body="&lt;p&gt;The formula is &#xA;$$&#xA;\mu = \lambda  CX&#xA;$$&#xA;in your notation. You find it in many places, e.g. &lt;a href=&quot;https://corporate.morningstar.com/ib/documents/MethodologyDocuments/IBBAssociates/BlackLitterman.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The assumption is that you know $\lambda$ which is a strong assumption. Furthermore it only holds if investors are unconstrained (long/short not long only).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is intuitive as it says that given the weighting the return expectation increases with risk aversion and risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The case with the full allocation constraint (sum of weights is one) is covered by &lt;a href=&quot;http://www.nuclearphynance.com/User%20Files/6260/Computing%20Implied%20Returns%20in%20a%20Meaningful%20Way%20-%20Herold%20-%20Jan%202005.pdf&quot; rel=&quot;nofollow&quot;&gt;Herold&lt;/a&gt; but I also think that this is a bit circular ...&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2727" LastEditDate="2015-02-25T13:01:24.090" LastActivityDate="2015-02-25T13:01:24.090" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16733" PostTypeId="1" CreationDate="2015-02-25T07:44:35.813" Score="1" ViewCount="480" Body="&lt;p&gt;Why do people use OIS and LIBOR swap spread to compare/value bonds/derivatives?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why not just use US treasury?&lt;/p&gt;&#xA;" OwnerUserId="13434" LastActivityDate="2015-08-26T13:55:41.493" Title="OIS &amp; LIBOR swap" Tags="&lt;swaps&gt;&lt;ois-discounting&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16734" PostTypeId="2" ParentId="16720" CreationDate="2015-02-25T08:39:57.333" Score="2" Body="&lt;p&gt;This sounds like quadratic hedging. If you have the return of the assets $r_X$ and $r_Y$ with negative correlation $\rho$ between the two (we could think of bonds and stocks) and more variance in one of them then the problem of weighting the two by $w$ is (assume zero expected returns for ease of presentation)&#xA;$$&#xA;\text{risk} = E[(w r_X + (1-w) r_Y)^2] \rightarrow \text{Min}&#xA;$$&#xA;Expanding the square we get&#xA;$$&#xA;\text{risk} = w^2 E[r_X^2] + 2 w(1-w)E[r_X r_Y]+ (1-w)^2 E[r_y^2] =\\ w^2 \sigma_X^2 + 2w(1-w)\rho \sigma_X \sigma_Y + (1-w)^2 \sigma_Y^2.&#xA;$$&#xA;Then we take the derivative w.r.t. $w$ and get&#xA;$$&#xA;\frac{d}{dw} \text{risk} =  2 w\sigma_X^2 + (1-2w)\rho \sigma_X \sigma_y + 2 (-1+w) \sigma_Y^2.&#xA;$$&#xA;Setting this (linear equation in $w$) to zero we get&#xA;$$&#xA;w = \frac{\sigma_Y^2 - \sigma_X\sigma_Y \rho}{\sigma_X^2 + \sigma_Y^2 - 2\sigma_X\sigma_Y \rho}.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is this intuitive? First note that the numerator in $W$, the weight of $X$ increases if the risk of $Y$ increases and increases even more with negative $\rho$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The approach above focuses on risk and will weight assets with less risk higher, if you want to introduce expected return also, then things get slightly more complicated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just looking at expexted return is easy.&#xA;$$&#xA;\text{target} = E[w r_X + (1-w) r_Y] \rightarrow  \text{Max}&#xA;$$&#xA;has a trivial solution buy the asset with the bigger expeted return with $100\%$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you can do is combine the two by&#xA;$$&#xA;\text{target} = E[w r_X + (1-w) r_Y] \rightarrow  \text{Max}&#xA;$$&#xA;constraint to $\text{risk} \le l^2 \%$ with some maximum level of risk $l$ (I put the square because above we were looking at variance).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you start from $100\%$ in the asset with the highest expected return and decrease the weight until you get below the desired level of risk.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-02-25T10:54:01.837" LastActivityDate="2015-02-25T10:54:01.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16735" PostTypeId="1" CreationDate="2015-02-25T10:58:43.967" Score="3" ViewCount="780" Body="&lt;p&gt;I am trying to simulate a CIR process using Matlab and my GPU for effeciency. At the moment i run into some implementation problems due to the recursive nature of the discretization. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The sheme I currently use is the simple Euler&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V_t \approx \max \{V_{t-1} + \kappa_V(\bar{V}-V_{t-1})\Delta h + \sigma_V\sqrt{V_{t-1}}\sqrt{\Delta h}\mathcal{N}(0,1),0\}. $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To proper simulate on the GPU I need some help function, like discribed in this &lt;a href=&quot;http://de.mathworks.com/help/distcomp/examples/using-gpu-arrayfun-for-monte-carlo-simulations.html&quot; rel=&quot;nofollow&quot;&gt;Matlab guide&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function [ V ] = simulation_fun( V, W, N, h, kappa_V, V_bar, sigma_V)        &#xA;t=1;&#xA;while t &amp;lt; N    % a path has N steps &#xA;     V(:,t+1)=max(V(:,t)+kappa_V*(V_bar-V(:,t))*h + sigma_V*sqrt(V(:,t))*sqrt(h)*W(:,t),0);&#xA;     t=t+1;    &#xA;end     &#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Than I define the model parameters &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;N=1000; &#xA;M=1000;  % Number of MC simulations&#xA;h=0.01;&#xA;kappa_V=1;&#xA;V_bar=1;&#xA;sigma_V=0.2;&#xA;V=gpuArray(ones(M,N));&#xA;W=gpuArray.randn(M,N);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After that I call the simulation via&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;V = arrayfun(@simulation_fun,V, W, N, h, kappa_V, V_bar, sigma_V);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and get the follwing error&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error using gpuArray/arrayfun&#xA;Indexing is not supported. error at line: 3  .&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, if I use &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;V = simulation_fun(V, W, N, h, kappa_V, V_bar, sigma_V);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it works, but the simulation is roughly 2.5 times slower than only using the CPU.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know how to correctly implement the simulation?&lt;/p&gt;&#xA;" OwnerUserId="6640" LastActivityDate="2015-04-27T23:46:53.517" Title="How to simulate a CIR process using GPU and Matlab" Tags="&lt;monte-carlo&gt;&lt;matlab&gt;&lt;gpgpu&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16736" PostTypeId="2" ParentId="16728" CreationDate="2015-02-25T12:05:25.497" Score="1" Body="&lt;p&gt;A unique state price vector does not have to exist for there to be no arbitrage.  It sounds like the state price vector in question has infinitely many solutions.  Try to reduce the price matrix to row echelon form and show that at least one state price vector exists.&lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2015-02-25T12:05:25.497" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16737" PostTypeId="2" ParentId="14830" CreationDate="2015-02-25T12:08:57.017" Score="0" Body="&lt;p&gt;You can certainly use the Tradier API to do this.  For delayed data you can use the Developer Sandbox for request/response.  To access realtime data you’ll need a Tradier Brokerage account but you’ll have access to a realtime stream.  You can find the streaming documentation here: &lt;a href=&quot;https://developer.tradier.com/documentation/streaming/get-markets-events&quot; rel=&quot;nofollow&quot;&gt;https://developer.tradier.com/documentation/streaming/get-markets-events&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15471" LastEditorUserId="15471" LastEditDate="2015-02-25T12:14:14.770" LastActivityDate="2015-02-25T12:14:14.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16738" PostTypeId="1" AcceptedAnswerId="16747" CreationDate="2015-02-25T16:03:46.240" Score="8" ViewCount="1663" Body="&lt;p&gt;Given an option and its implied volatility, and also the mean value of the implied volatility over the last 30 days, if we find that the current IV is significantly (&gt; 1 std dev.) away from the mean, then:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to approximate the time for the IV to mean revert?&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2015-02-26T06:17:56.313" Title="How to approximate the time to mean reversion for implied volatility" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;mean-reversion&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16739" PostTypeId="2" ParentId="16693" CreationDate="2015-02-25T16:05:52.630" Score="2" Body="&lt;p&gt;I think, that the answer by Taylor Martin contains the explanation, but should be much shorter, so I'll put it here separately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially, Brownian motion is a measure on the space of continuos functions (trajectories), say on an interval on the real line . How does one describe this measure in probabilistic terms?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One sets the probability space $(\Omega, \mathbb{P})$ and a measurable function from it to the target space: $$F: \Omega\to\mathcal{C}[0,1]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so that the measure of a subset of trajectories $A\subset\mathcal{C}[0,1]$ is $\mathbb{P}(\omega\in\Omega | F(\omega)\in A).$ Now if you change values of $F$ on a subset of of $\Omega$ of $\mathbb{P}$-measure zero, this would have no effect on the measure on target space $\mathcal{C}[0,1].$ So $F$ is actually defined up to measure zero, and pointwise statements, like &quot;for every $\omega$&quot; simply do not make sense. &lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2015-02-25T16:05:52.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16741" PostTypeId="1" AcceptedAnswerId="16744" CreationDate="2015-02-25T17:01:54.857" Score="3" ViewCount="4194" Body="&lt;p&gt;I am a bit confused on how you calculate vega for Interest Rate Swap. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One argument is that IR Swap is a combination of fixed rate bond and floating rate bond. Since a bond has no vega component, IR Swap has no vega component.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another argument is that IR Swap can be synthetically reproduced using a cap and floor. For pay fixed and receive floating side, it is a long a cap and short a floor. Since both cap and floors are options on IR, there is a vega component.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since these two arguments contradict themselves, which is right and why is the other wrong?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Need some guidance on this.&lt;/p&gt;&#xA;" OwnerUserId="5839" LastActivityDate="2017-09-03T15:58:41.437" Title="Does an Interest Rate Swap has a Vega component?" Tags="&lt;swaps&gt;&lt;interest-rate-swap&gt;&lt;irs&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16744" PostTypeId="2" ParentId="16741" CreationDate="2015-02-25T18:26:06.027" Score="6" Body="&lt;p&gt;There is no contradiction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the strike of the floor and cap are both equal to the swap rate, and all accrual/payment frequencies, etc. are the same, then put-call partiy implies&#xA;$$C_{t}-F_{t}=S_{t},$$&#xA;where $C_{t},F_{t},S_{t}$ are the values of the cap, floor and swap instruments at time $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the (theoretical Black-Scholes) volatility is independent of the option-type, the Vegas on the LHS cancel so that the swap Vega is $0$.&lt;/p&gt;&#xA;" OwnerUserId="8230" LastActivityDate="2015-02-25T18:26:06.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16747" PostTypeId="2" ParentId="16738" CreationDate="2015-02-25T18:42:07.097" Score="9" Body="&lt;p&gt;A very popular choice for mean reversion is the &lt;a href=&quot;http://en.wikipedia.org/wiki/Ornstein%E2%80%93Uhlenbeck_process&quot; rel=&quot;noreferrer&quot;&gt;Ornstein–Uhlenbeck process&lt;/a&gt; (here in discretized form): $$L_{t+1}-L_t=\alpha(L^*-L_t)+\sigma\epsilon_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here you see that the level change is governed by some parameter $\alpha$, the mean reversion rate (or speed), and the distance between the long run mean $L^*$ and the actual level $L_t$ plus some noise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A very crude, yet intuitive way is to estimate the parameters of this process via a linear regression. Have a look at the following paper: &lt;a href=&quot;http://www.fea.com/resources/a_meanrevert.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.fea.com/resources/a_meanrevert.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There you see a toy example on page 71: The idea is that you do a regression where the level change of the time series is the dependent and the actual level of the time series is the independent variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I coded the following example in R which contains this toy example as a comment and the actual calculation for the VIX from January 2014 till today:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quantmod)&#xA;getSymbols(&quot;^VIX&quot;, from='2014-01-01')&#xA;level_t &amp;lt;- VIX$VIX.Adjusted&#xA;#level_t &amp;lt;- c(15,18,15.5,12,14.5,13,15,17,15.5,14)&#xA;change &amp;lt;- na.omit(diff(level_t))&#xA;level_t_1 &amp;lt;- level_t[-length(level_t)]&#xA;para &amp;lt;- lm(change ~ level_t_1)&#xA;summary(para)&#xA;(long_run_mean &amp;lt;- -para$coefficients[[1]]/para$coefficients[[2]])&#xA;(mean_reversion_speed &amp;lt;- -para$coefficients[[2]]*100)&#xA;(halflife &amp;lt;- -log(2)/para$coefficients[[2]])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Running the code gives:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; (long_run_mean &amp;lt;- -para$coefficients[[1]]/para$coefficients[[2]])&#xA;[1] 14.61876&#xA;&amp;gt; (mean_reversion_speed &amp;lt;- -para$coefficients[[2]]*100)&#xA;[1] 9.083576&#xA;&amp;gt; (halflife &amp;lt;- -log(2)/para$coefficients[[2]])&#xA;[1] 7.630774&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The interpretation is that the long run mean of the VIX (estimated from the respective timeframe) is $14.6$, it mean reverts by about $9\%$ per VIX percentage point and needs about $7.5$ days to mean revert by $50\%$.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2015-02-26T06:17:56.313" LastActivityDate="2015-02-26T06:17:56.313" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16748" PostTypeId="2" ParentId="16723" CreationDate="2015-02-25T19:38:02.630" Score="0" Body="&lt;p&gt;Your question concerns the term structure of volatilty.  In this case, USO's vol term structure is inverted (downward sloping) since far-dated IV is less than current.  Please keep in mind that the market determines the shape of the term structure and it can and will change over time.  Currently, USO has seen a steep correction and there is some geopolitical 'sabre rattling' leading to high &lt;em&gt;realized&lt;/em&gt; vol and also high &lt;em&gt;implied&lt;/em&gt; vol; but the market thinks this volatility will subdue over time.  Hence the inverted term structure of vol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for your comment &quot;Should not the volatility be more in the back month since it is further, hence more uncertain, hence there is greater possibility of a large move?&quot; don't think of it this way.  Your intuition is that it's easier to &quot;predict&quot; March 20 price than the Oct 16 price, so therefor the Oct 16 contract is more uncertain and should have higher IV.  This is not the correct way to think of this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rather, think of the IV in the Oct 16 contract as an average IV over the next six months.  So infact the 43% Oct IV &lt;em&gt;includes&lt;/em&gt; the 54% March IV, implying that market participants think USO will be very volatile in the near-term but will subdue substantially in the subsequent five months.&lt;/p&gt;&#xA;" OwnerUserId="15474" LastActivityDate="2015-02-25T19:38:02.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16749" PostTypeId="1" CreationDate="2015-02-25T19:52:26.240" Score="4" ViewCount="239" Body="&lt;p&gt;For any given day, CME security IDs are unique - a number will always refer to a single product.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are they unique over time as well? That is, might a new security have a security id that used to be used by an expired one?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And are they constant? That is, does a given security keep the same security id over its lifetime?&lt;/p&gt;&#xA;" OwnerUserId="2410" LastActivityDate="2015-04-27T15:35:34.400" Title="Are CME security id's unique and constant over time?" Tags="&lt;cme&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16750" PostTypeId="2" ParentId="9982" CreationDate="2015-02-25T20:56:35.260" Score="2" Body="&lt;p&gt;We set out a general scheme for doing this sort of thing in our paper &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://ssrn.com/abstract=1401094&quot; rel=&quot;nofollow&quot;&gt;http://ssrn.com/abstract=1401094&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and its sequel &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://ssrn.com/abstract=1437847&quot; rel=&quot;nofollow&quot;&gt;http://ssrn.com/abstract=1437847&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whilst the case studied is different, the techniques are the same. I also discuss in detail the whole process in a chapter of More Mathematical Finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The adjoint method when it applies is generally better than alternatives such as likelihood ratio and Malliavin calculus.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-02-25T20:56:35.260" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16751" PostTypeId="1" CreationDate="2015-02-25T21:04:50.357" Score="3" ViewCount="776" Body="&lt;p&gt;There is a &lt;a href=&quot;http://arxiv.org/pdf/cond-mat/0203046.pdf&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; by Dragulescu and Yakovenko (DY) in 2002 proposing a pdf for the stock returns in the Heston model.  However, in a &lt;a href=&quot;http://arxiv.org/pdf/cs/0305055.pdf&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; by Daniel, Bree and Joseph, they actually perform statistical tests on DY's pdf and show it is not really any better than a log normal pdf.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is anyone aware of more recent attempts at a closed-form solution for the distribution of returns under the Heston model?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2015-04-28T01:46:53.540" Title="Stock Returns Distribution in Heston Model" Tags="&lt;option-pricing&gt;&lt;distribution&gt;&lt;heston&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16752" PostTypeId="1" AcceptedAnswerId="16757" CreationDate="2015-02-25T22:12:08.150" Score="1" ViewCount="54" Body="&lt;p&gt;If I am long a stock $X$ which I purchased at $\$100$ and sold a covered call in the front month with strike $\$105$ for $\$2$ then is it true that the covered call is equivalent to a naked put at strike $\$100 - \$2 = \$98$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I missing something here? &lt;/p&gt;&#xA;" OwnerUserId="218" LastEditorUserId="12" LastEditDate="2015-02-26T06:50:50.583" LastActivityDate="2015-02-26T06:50:50.583" Title="What is the strike of a short put that mimics a covered call" Tags="&lt;option-strategies&gt;&lt;call&gt;&lt;put&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16753" PostTypeId="1" CreationDate="2015-02-25T22:45:05.740" Score="0" ViewCount="126" Body="&lt;p&gt;You are given a $5\%$ call option worth $\$2.66$. The strike price $k$ is $\$41.00$. $S(0)=40$, $Sd=35$ (i.e the lower price of the stock at $t=1$) find $Su$ (i.e the high price of the stock at $t=1$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would this be done? I know $Cu=Su-\$41$, $C(0)=\$2.66$ and I have something written in my notes that $c(0)= B/(1+r) +ΔS(0)$, but I'm not sure what $B$ is here. I assume to find $Su$ I need to first find $Cu$, but I'm not sure how to do this from the given information. Any help is appreciated.&lt;/p&gt;&#xA;" OwnerUserId="15267" LastEditorUserId="12" LastEditDate="2015-02-26T06:41:15.953" LastActivityDate="2015-02-26T15:11:03.987" Title="Pricing of a call option in one period binomial model" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;binomial&gt;&lt;call&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16754" PostTypeId="1" CreationDate="2015-02-26T01:20:06.773" Score="1" ViewCount="112" Body="&lt;p&gt;I couldn't find a book that explains in details how to use Monte Carlo Simulation to generate a number of interest rate scenarios. And then based on the interest rate scenarios, how to calculate the OAS to account for embedded options in the bond. I understand the basic idea but I expect to master every detail in this approach.  Thanks so much for your recommendations!&lt;/p&gt;&#xA;" OwnerUserId="13922" LastEditorUserId="12" LastEditDate="2015-02-26T06:35:20.283" LastActivityDate="2015-02-26T06:35:20.283" Title="Please recommend a book regarding Monte Carlo simulation in OAS" Tags="&lt;bond&gt;&lt;reference-request&gt;&lt;valuation&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16755" PostTypeId="2" ParentId="16751" CreationDate="2015-02-26T01:32:20.170" Score="1" Body="&lt;p&gt;Gatheral &lt;a href=&quot;http://www.amazon.de/Volatility-Surface-Practitioners-Guide-Finance/dp/0471792519/ref=sr_1_1?ie=UTF8&amp;amp;qid=1424913934&amp;amp;sr=8-1&amp;amp;keywords=gatheral&quot; rel=&quot;nofollow&quot;&gt;(Amazon)&lt;/a&gt; has a quite extensive discussion on that, and dives into calibration issues. In summary, what you describe appears to be less of a modeling issue, and more of a calibration problem. This is primarily because the model functions (such as the Heston model) are not by nature convex in their input parameters. This is simply result of the fact that they are designed with intuitive understanding of parameters in mind, and not functional properties. You can intuitively understand what variance of variance implies, but there's simply not technical reason it should be convex. This results in highly unstable optimizations, and thus ambiguous interpretations, such as described in the sources you give.&lt;/p&gt;&#xA;" OwnerUserId="1976" LastActivityDate="2015-02-26T01:32:20.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16756" PostTypeId="2" ParentId="16727" CreationDate="2015-02-26T02:38:54.897" Score="1" Body="&lt;p&gt;Calendar spread is popular because it is versatile. A long calendar benefits from theta decay no matter what. Meanwhile, an investor enters into a calendar spread when a skew in volatility between front month (expensive) and farther dated months (cheaper) is favorable. In other words the terms structure of options is good for the long calendar owner. So an investor has two ways to profit either from quick volatility return to to normal or more paced theta decay. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another attractive property of a calendar is it is hard to lose 100% of your investment. The underlying must make a very substantial move to wipe out a long calendar spread completely.This has nothing to do with theory or option pricing but it is an important practical consideration, which I am sure does make the spread more popular.&lt;/p&gt;&#xA;" OwnerUserId="7973" LastActivityDate="2015-02-26T02:38:54.897" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16757" PostTypeId="2" ParentId="16752" CreationDate="2015-02-26T03:29:42.333" Score="2" Body="&lt;p&gt;This is not quite right. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The covered call you are describing is equal to selling a Put with the &lt;strong&gt;same&lt;/strong&gt; strike price (\$105) and holding ( \$105 / (1+r) ) in the bank. If you draw the Payoff diagram this will become apparent. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put call relationships are summarized as the &lt;a href=&quot;http://en.wikipedia.org/wiki/Put%E2%80%93call_parity&quot; rel=&quot;nofollow&quot;&gt;Put-Call parity&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$  S - C = D \cdot K - P $$&#xA;Where $S$ the underlying, $D$ is the discount factor and $K$ the strike price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The left side is the covered call you are describing and the right side the Put plus cash. As a bonus, using this relationship you can calculate the no arbitrage price of the put!&lt;/p&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2015-02-26T03:29:42.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16758" PostTypeId="1" AcceptedAnswerId="16759" CreationDate="2015-02-26T03:31:00.787" Score="1" ViewCount="64" Body="&lt;p&gt;Can someone help explain how differentiating the following with respect to $x$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{1}{2} \alpha \mathbf{x}^T \Sigma \mathbf{x} + (\mathbf{\mu} - R\mathbf{1})\mathbf{x} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yields the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \alpha \Sigma \mathbf{x} + (\mathbf{\mu} - R\mathbf{1}) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $\Sigma$ is a correlation matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm rusty with my linear algebra so the derivate of these transpose matrices isn't making any sense to me. A detailed explanation would be very much appreciated. What happens to the 1/2, and that whole first term in general? &lt;/p&gt;&#xA;" OwnerUserId="15267" LastEditorUserId="13311" LastEditDate="2015-02-26T04:06:53.610" LastActivityDate="2015-02-26T04:06:53.610" Title="Desperate for help with simple derivative" Tags="&lt;derivatives&gt;&lt;portfolio&gt;&lt;mathematics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16759" PostTypeId="2" ParentId="16758" CreationDate="2015-02-26T03:50:01.517" Score="1" Body="&lt;p&gt;Could you please be more specific with your question and post the text here? This will be more helpful for other people visiting the site. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now as far as to where the 1/2 went, usually people put 1/2 in front of the second order term because this will simplify to 1 after the derivation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{\partial x^2}{\partial x} = 2x $$ vs&#xA;$$ \frac{1}{2} \cdot \frac{\partial x^2}{\partial x} = x $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To understand what are the mechanics behind the derivation in your question, I suggest creating your own 2x2 matrices and going through the calculations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case $\Sigma$ is symmetric, in which case:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{\partial \mathbf{x}^T \mathbf{A} \mathbf{x}}{\partial x} = 2\mathbf{A}\mathbf{x} $$ vs&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To learn more, go &lt;a href=&quot;http://en.wikipedia.org/wiki/Matrix_calculus&quot; rel=&quot;nofollow&quot;&gt;HERE&lt;/a&gt; and take a look at the scalar-by-vector identities.&lt;/p&gt;&#xA;" OwnerUserId="13311" LastEditorUserId="13311" LastEditDate="2015-02-26T03:59:00.880" LastActivityDate="2015-02-26T03:59:00.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16760" PostTypeId="1" CreationDate="2015-02-26T04:47:34.090" Score="1" ViewCount="553" Body="&lt;p&gt;I'm recently reading a research paper on the yield curve by Salomon brothers and in it it states that when the forward curve is above the par yield curve, it is seen as cheaper. If for example, the years 9-12 of the forward rate curve lie above the par yield curve with the forward 12 year rate above the 9 year rate as well, it is recommended to buy the 12 year bond while selling the 9 year bond. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, I am unable to accurately grasp the concept behind this in relation to the par yield curve. Please help! Thank you!&lt;/p&gt;&#xA;" OwnerUserId="15480" LastActivityDate="2015-06-26T22:05:58.033" Title="Forward Curves and Par Yield Curves" Tags="&lt;arbitrage&gt;&lt;yield-curve&gt;&lt;forward&gt;&lt;forward-rate&gt;&lt;yield&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16761" PostTypeId="2" ParentId="16760" CreationDate="2015-02-26T05:13:06.507" Score="1" Body="&lt;p&gt;First, it's not true that a market sector is cheap whenever the forward curve lies above the par curve. In fact, whenever the yield curve is upward sloping, the forward curve will always lie above the par curve. Conversely, when the yield curve is downward sloping, forwards will always lie beneath the par curve. In the example you quoted, Ilmanen chose a day on which the par curve is virtually flat to make a very specific point: forwards can amplify small misplacing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To understand the rich/cheap signals, let's think through the shape of the yield curve first: the forward curve Ilmanen provided (we'll call it &quot;Curve A&quot;) is not particularly smooth. But it can be argued that a sensible forward curve SHOULD be very smooth; after all, market participants can't possible have very differing views regarding short-term interest rate 10-years from today vs 11-years from today. So imagine that there is a &quot;fair value&quot; version of the forward curve that's super smooth (we'll call it &quot;Curve B&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let's price bonds with the two curves. Because the forward rates on curve A (the wavy one) in the 12-year sector are particularly high, bond cash flows, when discounted with these high forward rates, will result in lower prices. By contrast, the forward rates on the fair value curve B will be much lower – because of the smoothness constraint, the curve can't swing up like that. Accordingly, the fair value of 12-year bonds, when priced using these lower forward interest rates, will be higher. This is why the 12-year sector can be perceived as cheaper than fair value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, it's probably easier to build a smooth forward curve and calculate spreads relative to this smooth curve, instead of depending on a wavy forward curve to detect rich/cheap signals. &lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2015-02-26T20:09:07.607" LastActivityDate="2015-02-26T20:09:07.607" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="16762" PostTypeId="1" AcceptedAnswerId="16763" CreationDate="2015-02-26T07:36:15.200" Score="4" ViewCount="2634" Body="&lt;p&gt;I have a portfolio of stocks and all I want to do is to make sure that I'm not trading one big position, so I would like to monitor some type of metric that gives me a rough idea of what the overall correlation in the portfolio is and how it is changing day to day thru movement in prices. I want to get it down to one number a day, but I'm not sure how to do it. let's say I have three stocks &lt;code&gt;a,b,c&lt;/code&gt;. Do I just take the correlation between &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt;, &lt;code&gt;b&lt;/code&gt; and &lt;code&gt;c&lt;/code&gt;, &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;c&lt;/code&gt;, then average it? What is the correct way to do it? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would it be possible to give a simple example? Let's say a,b,c stocks and the weights are 20%,30%,50% respectively. The 3 day daily returns are &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;day  a  b  c&#xA; 1   0% 2% 2%&#xA; 2   1% -1% 0%&#xA; 3   2% 1% 0%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I apply your formula? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And also just curious is there a package in python that does these calculation for you? I imagine I'm asking a pretty standard question, one would think it is a pre-package solution in a library somewhere. Would &lt;code&gt;pandas&lt;/code&gt; have something? &lt;/p&gt;&#xA;" OwnerUserId="15482" LastEditorUserId="15482" LastEditDate="2015-02-26T08:12:36.613" LastActivityDate="2015-02-26T22:25:47.967" Title="correlation for portfolio of stocks" Tags="&lt;portfolio-management&gt;&lt;correlation&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16763" PostTypeId="2" ParentId="16762" CreationDate="2015-02-26T07:56:13.840" Score="3" Body="&lt;p&gt;I think you might be looking for the &lt;a href=&quot;http://en.wikipedia.org/wiki/Modern_portfolio_theory#Risk_and_expected_return&quot; rel=&quot;nofollow noreferrer&quot;&gt;portfolio return variance&lt;/a&gt;:&#xA;$$\sigma_p^2 = \sum_i \sum_j w_i w_j \sigma_i \sigma_j \rho_{ij},$$&#xA;where $\rho_{ij}$ is the Pearson product-moment correlation coefficient between the returns on assets $i$ and $j$ and $\rho_{ij} = 1$ for $i=j$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case you could either weigh the assets equally or according to the real weights in your portfolio and recalculate that metric daily.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally, the lower the correlation between securities in your portfolio, the lower the portfolio variance - which is what you intend to measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&lt;br&gt;&#xA;Since I do not work with python I did a quick google-search and found the following relevant question/answer how to actually do the calculation in python: &lt;a href=&quot;https://stackoverflow.com/questions/7409108/portfolio-variance-of-a-portfolio-of-n-assets-in-python&quot;&gt;https://stackoverflow.com/questions/7409108/portfolio-variance-of-a-portfolio-of-n-assets-in-python&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2015-02-26T08:22:51.437" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16764" PostTypeId="1" CreationDate="2015-02-26T08:25:06.590" Score="3" ViewCount="336" Body="&lt;p&gt;I guess the price of a Zero-Coupon Bond with infinite maturity should go to zero, what about its yield? &#xA;I am asking this because I was dealing with the yield curve and its asymptotic properties when $t\to\infty$&lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2015-04-10T22:55:50.487" Title="What is the yield on an infinitely lived ZCB?" Tags="&lt;fixed-income&gt;&lt;yield-curve&gt;&lt;bond-yields&gt;&lt;yield&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16765" PostTypeId="2" ParentId="16764" CreationDate="2015-02-26T10:04:57.353" Score="2" Body="&lt;p&gt;This is something that banks don't do very well (in my opinion), but we can look to the insurance industry for help.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Insurance liabilities often span decades, and the regulation has come up with something called the Ultimate Forward Rate (or UFR). It's currently a hotly debated topic with the advent of Solvency II (insurance regulation) coming into effect on 01/01/2016. This is because the UFR is not always set with an eye to long term interest rates, but more by looking at an appropriate liability discount rate. &lt;/li&gt;&#xA;&lt;li&gt;The insurance industry preferred curve fitting approach is the Smith-Wilson model, which has the UFR as an input.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Hopefully this is a useful starting point for your research.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the end, the actual value of the yield of an infinitely lived bond is irrelavant. As long as your infinite-year forward rate is reasonable (i.e. not $ \infty $), then $\lim_{t \rightarrow \infty} e^{-rt} = 0$ anyway.&lt;/p&gt;&#xA;" OwnerUserId="7166" LastActivityDate="2015-02-26T10:04:57.353" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16766" PostTypeId="2" ParentId="16764" CreationDate="2015-02-26T13:21:11.707" Score="2" Body="&lt;p&gt;while it is true that $$\lim_{T\to\infty} Z(t, T) = \lim_{T\to\infty} e^{-r(T-t)} = 0$$ this is when $r$ is independent of time to maturity, a flat and constant yield curve. In practice, we use yield curves which vary depending on what day they are estimated and what maturity the ZCB is. If in fact $r(t, T)$ depends on today and the maturity then the properties of that function are going to determine what the limit is. Of course, any model that allows for a non-zero price for an infinite maturity ZCB is admitting arbitrage. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Commonly, the &lt;a href=&quot;http://en.wikipedia.org/wiki/Fixed-income_attribution#Modeling_the_yield_curve&quot; rel=&quot;nofollow&quot;&gt;Nelson Siegel and Nelson Siegel Svensson&lt;/a&gt; &lt;a href=&quot;http://www.math.ku.dk/~rolf/teaching/NelsonSiegel.pdf&quot; rel=&quot;nofollow&quot;&gt;(original paper)&lt;/a&gt; models are used, in that case $$ r(t, T) = \beta_0 + \beta_1{1-\exp(-(T-t)/\tau)\over(T-t)/\tau} + \beta_2\left({1-\exp(-(T-t)/\tau)\over(T-t)/\tau}-\exp(-(T-t)/\tau)\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of this model $\lim_{T\to\infty}r(t, T) = \beta_0$ whenever $\tau &amp;gt; 0$ and so $$\lim_{T\to\infty}Z(t, T) = \lim_{T\to\infty} e^{-r(t, T)(T-t)}=0$$ whenever $\beta_0 &amp;gt; 0$&lt;/p&gt;&#xA;" OwnerUserId="4910" LastActivityDate="2015-02-26T13:21:11.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16767" PostTypeId="2" ParentId="16749" CreationDate="2015-02-26T14:09:43.810" Score="3" Body="&lt;p&gt;Speaking to CME, apparently they are neither unique nor constant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The obvious case when a security would change id is if it is a user defined strategy, which got created a second time - identical security, but different id.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But CME does not even commit to not changing security ids of regular instruments, such as futures, although in practice they are unlikely to change (this was my understanding of the answer).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once a security expires, its id might be reused as well.&lt;/p&gt;&#xA;" OwnerUserId="2410" LastActivityDate="2015-02-26T14:09:43.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16769" PostTypeId="2" ParentId="16753" CreationDate="2015-02-26T15:11:03.987" Score="1" Body="&lt;p&gt;By no arbitrage, $S(0)=(Su q+Sd (1-q))/(1+r)$ and $C(0)=((Su-k)^+ q+(Sd-k)^+(1-q))/(1+r)$.&#xA;Simplifying and rearranging (and assuming $Su&amp;gt;k$),&#xA;$$\left[\begin{array}{c} &#xA;S(0) \\&#xA;C(0)&#xA;\end{array} \right]=\frac{1}{1+r}\left[\begin{array}{cc} &#xA;Su &amp;amp; Sd \\&#xA;(Su-k) &amp;amp; 0 &#xA;\end{array} \right]\left[\begin{array}{c} &#xA;q\\&#xA;1-q&#xA;\end{array} \right] $$&#xA;Clearly, $q=C(0)(1+r)/(Su-k) $.  Substituting this back into the first equation,&#xA; $$S(0)=\left(\frac{Su C(0)(1+r)}{Su-k}+Sd (1-\frac{C(0)(1+r)}{Su-k})\right)/(1+r)$$&#xA;After simplifying and solving for Su,&#xA; $$Su=\frac{kS(0)(1+r)-kSd-C(0)Sd(1+r)}{S(0)(1+r)-C(0)(1+r)-Sd}$$&lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2015-02-26T15:11:03.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16770" PostTypeId="1" AcceptedAnswerId="16771" CreationDate="2015-02-26T15:21:13.163" Score="3" ViewCount="189" Body="&lt;p&gt;Let us say that there was a stock trading at 100 and the 105 call was trading at 3 $. with 1 month to go&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now stock went up to 104 after 15 days, and the call dropped to 2.80 $, to the call buyer's dismay.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I understand that this 20 cent drop is partly due to theta decay and partly due to fall in IV that corresponds to a rise in the stock price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a thumb rule to approximate what is the effect of theta and what is the effect of IV? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this time period, let us assume that theta went from 5 cents/day to 8 cents/day. IV went from 50% to 30%. Vega stayed constant at .01.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please excuse me if these numbers are not realistic. Feel free to put in more realistic numbers for the greeks and IV, given the option price.&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2015-02-26T16:49:15.773" Title="If an option went down in value, how much is due to theta decay and how much due to fall in IV" Tags="&lt;option-pricing&gt;&lt;implied-volatility&gt;&lt;greeks&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16771" PostTypeId="2" ParentId="16770" CreationDate="2015-02-26T16:33:39.837" Score="3" Body="&lt;p&gt;Because there are several non-linearities involved this depends very much on where you are concerning the level of volatility and time to expiry. But I think what you really want is to get some feel for the sensitivities involved, right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the following &lt;a href=&quot;http://demonstrations.wolfram.com/ExploringTheBlackScholesFormula/&quot; rel=&quot;nofollow noreferrer&quot;&gt;demonstration&lt;/a&gt; you can play with all kinds of combinations of all parameters to get some intuition for the greeks (I preselected volatility and time to expiry to give you the idea):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/QcqFC.png&quot; alt=&quot;Black-Scholes Explorer&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find it here: &lt;a href=&quot;http://demonstrations.wolfram.com/ExploringTheBlackScholesFormula/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://demonstrations.wolfram.com/ExploringTheBlackScholesFormula/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are an Mathematica user you can also download the full code for this here: &lt;a href=&quot;http://demonstrations.wolfram.com/downloadauthornb.cgi?name=ExploringTheBlackScholesFormula&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://demonstrations.wolfram.com/downloadauthornb.cgi?name=ExploringTheBlackScholesFormula&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2015-02-26T16:49:15.773" LastActivityDate="2015-02-26T16:49:15.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16772" PostTypeId="1" AcceptedAnswerId="16774" CreationDate="2015-02-26T17:11:04.550" Score="5" ViewCount="507" Body="&lt;p&gt;If an option A has higher vega than option B, does that also mean that A has a higher IV than B?&lt;br&gt;&#xA;I understand that by definition, a higher vega means that A's price is more sensitive to its IV than B.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But can we conclude that A has higher IV than B also?&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2015-02-26T17:30:53.097" Title="Does higher vega imply higher IV and vice versa" Tags="&lt;option-pricing&gt;&lt;implied-volatility&gt;&lt;greeks&gt;&lt;vega&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16773" PostTypeId="2" ParentId="16772" CreationDate="2015-02-26T17:23:56.600" Score="4" Body="&lt;p&gt;IV is one of the inputs for your option pricing model, vega measures the actual impact (e.g. in Dollars, Euros...) of any change in IV.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuitively IV &lt;em&gt;is&lt;/em&gt; the price of the option while vega is the &lt;em&gt;sensitivity&lt;/em&gt; to IV.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bottom line: There is a clear distinction!&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2015-02-26T17:23:56.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16774" PostTypeId="2" ParentId="16772" CreationDate="2015-02-26T17:30:53.097" Score="6" Body="&lt;p&gt;Simply put, no. Vega depends on a variety of factors (including the level/price of the underlying asset). However, vomma/volga/&lt;strong&gt;vega convexity (whatever you want to call dVega/dIV) is always positive&lt;/strong&gt;. So as IV increases, the vega of an option increases - I think this might have been what you were getting at.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's important to understand that IV is an input to a pricing model while the greeks are the sensitivity of options prices to various input factors (as @vonjd correctly states).&lt;/p&gt;&#xA;" OwnerUserId="5054" LastActivityDate="2015-02-26T17:30:53.097" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16775" PostTypeId="1" CreationDate="2015-02-26T18:34:45.973" Score="4" ViewCount="203" Body="&lt;p&gt;I have seen this strategy example, which uses garch in a regime switching context:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://systematicinvestor.wordpress.com/2012/01/06/trading-using-garch-volatility-forecast/&quot; rel=&quot;nofollow&quot;&gt;https://systematicinvestor.wordpress.com/2012/01/06/trading-using-garch-volatility-forecast/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The author classifies volatility by percentile using a 252 day look back period. Volatility is defined as the standard deviation of the past 21 log returns. So far, so good.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the way the author ranks volatility is strange to me. Instead of simply taking the percentile rank of the current day counting the past 252, he does this, in R:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;vol.rank = percent.rank(SMA(percent.rank(hist.vol, 252), 21), 250)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, assuming hist.vol is a vector of historical volatilities, he first assigns to each day its percentile rank according to the past 252 days. That should be enough to me, but then he proceeds to take the simple moving average of the percentile ranks, and then again classify each of these SMAs of percentile ranks into their own percentile ranks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the rationale in doing that? &lt;/p&gt;&#xA;" OwnerUserId="15487" LastActivityDate="2015-04-27T22:46:53.407" Title="Question about historical volatility ranking" Tags="&lt;volatility&gt;&lt;backtesting&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16776" PostTypeId="2" ParentId="16735" CreationDate="2015-02-26T21:11:48.237" Score="1" Body="&lt;p&gt;There are some restrictions to using arrayfun. &#xA;&lt;a href=&quot;http://www.mathworks.com/help/distcomp/run-element-wise-matlab-code-on-a-gpu.html#bsp51uy&quot; rel=&quot;nofollow&quot;&gt;You can read the restrictions here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Judging from the error, you cannot use indexes the way you are. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You probably have to create separate GPU arrays for $ V_{t+1} $ and $V_t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suggest that you find similar examples in Matlab's website and try to replicate its functionality. Here is an &lt;a href=&quot;http://www.mathworks.com/company/newsletters/articles/gpu-programming-in-matlab.html&quot; rel=&quot;nofollow&quot;&gt;article&lt;/a&gt; with information on how to program the second order wave equation on a GPU with Matlab.&lt;/p&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2015-02-26T21:11:48.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16777" PostTypeId="2" ParentId="16775" CreationDate="2015-02-26T21:29:28.857" Score="2" Body="&lt;p&gt;Using a simple moving average is a trick to take the noise out of the estimated quantity. He calculates a measure of volatility that is the SMA of the estimates of historical volatilities for the past 21 days. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a crude way to estimate volatility. If you read further you will see that the author uses a GARCH(1,1) model to estimate volatility. &lt;/p&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2015-02-26T21:29:28.857" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16778" PostTypeId="1" AcceptedAnswerId="21916" CreationDate="2015-02-26T21:29:51.510" Score="7" ViewCount="1825" Body="&lt;p&gt;I am trying to fit an ARMA/GARCH model to a time series. I found that the best candidate is an ARMA(1,0) + GARCH(1,1) with gaussian white noise &lt;img src=&quot;https://i.stack.imgur.com/cabnB.png&quot; alt=&quot;model data&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It has coefficients with p-values near cero and the residuals are white noise. The problem is that the Jarque Bera Test says the residuals are not normal. The QQ normal plot &lt;img src=&quot;https://i.stack.imgur.com/KMrBR.png&quot; alt=&quot;graph&quot;&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;confirm that. And when I try with several ARMA/GARCH models with t-student white noise, for example: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/RtwmB.png&quot; alt=&quot;model data&quot;&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;the QQ t-student plot &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/yES5N.png&quot; alt=&quot;graph&quot;&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;fits very well (except for some outliers), but the rest don't (I mean not as good as the first one).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which one is better?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been stuck in this problem for a while.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rodrigo&lt;/p&gt;&#xA;" OwnerUserId="15490" LastActivityDate="2015-11-24T18:09:05.863" Title="Is it too important that my residuals be normal? I am Using an ARMA/GARCH model" Tags="&lt;time-series&gt;&lt;r&gt;&lt;garch&gt;&lt;arma&gt;&lt;modelling&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16779" PostTypeId="2" ParentId="16762" CreationDate="2015-02-26T22:25:47.967" Score="2" Body="&lt;p&gt;In their paper on their &lt;a href=&quot;http://www.cboe.com/micro/impliedcorrelation/impliedcorrelationindicator.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;S&amp;amp;P 500 Implied Correlation Index &lt;/a&gt; the CBOE has defined a measure for the market-capitalization weighted average correlation of the S&amp;amp;P 500 index which could be applied to portfolios in general.  The equation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$       &#xA;\rho_{av} = \frac{\sigma^2 - \sum_{i=1}^N w_i^2\sigma_i^2}{2 \sum_{i=1}^N \sum_{j&amp;gt;i}^N w_i w_j \sigma_i \sigma_j}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;has also been discussed in this &lt;a href=&quot;https://quant.stackexchange.com/questions/8689/average-correlation-of-index-portfolio&quot;&gt;post&lt;/a&gt; on this forum. Like the correlation between two-assets, this correlation approaches one when all assets become correlated (e.g. market crashes) and decreases and can even become negative as assets become less correlated.  I've found computing it on a weekly basis using the past month's daily data can be useful for monitoring relatively short-term changes in long-only portfolio correlation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know of a published implementation of this equation but it's straightforward to code it in R.&lt;/p&gt;&#xA;" OwnerUserId="11889" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2015-02-26T22:25:47.967" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16780" PostTypeId="2" ParentId="16735" CreationDate="2015-02-26T22:26:25.930" Score="2" Body="&lt;p&gt;You should write some kernel functions in CUDA (Nvidia language) for your matlab code. Arrayfun is quite restrictive and not appropriate. &#xA;Look at this link &lt;a href=&quot;http://fr.mathworks.com/help/distcomp/run-cuda-or-ptx-code-on-gpu.html&quot; rel=&quot;nofollow&quot;&gt;http://fr.mathworks.com/help/distcomp/run-cuda-or-ptx-code-on-gpu.html&lt;/a&gt; for more details about matlab and parallel computing.&lt;/p&gt;&#xA;" OwnerUserId="15191" LastActivityDate="2015-02-26T22:26:25.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16781" PostTypeId="2" ParentId="14102" CreationDate="2015-02-27T12:49:28.200" Score="6" Body="&lt;p&gt;I thought this was an interesting example to add. It concerns a &quot;ratio model&quot; of habit (as opposed to a &quot;difference&quot; model of habit). See, for example, Abel (1990, American Economic Review). Let&#xA;$$&#xA;x_t = \lambda \int_{-\infty}^t e^{-\lambda(t-s)} c_s ds.&#xA;$$&#xA;(For context, $x_t$ is a log habit index that is given by a geometric average of past consumption, where $c_t$ is log consumption.)&#xA;Then by Ito's formula,&#xA;\begin{align}&#xA;d x_t &amp;amp;= \lambda \int_{-\infty}^t -\lambda e^{-\lambda(t-s)} c_s ds \, dt + \lambda c_t dt \\&#xA;  &amp;amp;= \lambda (c_t - x_t) dt.&#xA;\end{align}&#xA;The part that is interesting to me is the that it easy to err in thinking that the answer is $dx_t = \lambda c_t dt$ or $d x_t = -\lambda x_t dt$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Here, $c_s$ is some well-behaved stochastic process. This is essentially the same as 9-1 (a) above when $dc_t = dW_t$, where $W$ is a Brownian motion. This kind of calculation seems to show up somewhat frequently (Hull-White interest rate model), but doesn't seem to directly use Ito's lemma.&lt;/p&gt;&#xA;" OwnerUserId="7399" LastEditorUserId="7399" LastEditDate="2017-02-13T17:02:30.443" LastActivityDate="2017-02-13T17:02:30.443" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16782" PostTypeId="1" CreationDate="2015-02-27T14:54:46.737" Score="2" ViewCount="2152" Body="&lt;p&gt;Does anyone know where to find an example of implementing Engle-Granger 2-step cointegration?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Python's ideal, but any language will do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've skimmed and read many articles, but understand little about the abstract terms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Seeing an implementation would not only solve my practical problem, but help me understand what the papers are talking about.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been trying for weeks, but have found no code examples.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit: Looks like Matt Clegg has a robust R module for egcm &lt;a href=&quot;https://github.com/matthewclegg/egcm&quot; rel=&quot;nofollow&quot;&gt;here.&lt;/a&gt; I'm working on a Python port, and will post it when I'm ready. Anyone who would like my working copy, ask.&lt;/p&gt;&#xA;" OwnerUserId="15253" LastEditorUserId="15253" LastEditDate="2015-03-12T22:07:09.680" LastActivityDate="2015-03-12T22:07:09.680" Title="Dou you have an example of implementing Engle-Granger 2-step cointegration?" Tags="&lt;programming&gt;&lt;statistics&gt;&lt;cointegration&gt;&lt;pairs-trading&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16785" PostTypeId="1" CreationDate="2015-02-27T15:59:20.400" Score="1" ViewCount="64" Body="&lt;p&gt;Can I value the equity leg of an equity swap using the projected forward equity returns?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, for a sequence of times $t_{0}&amp;lt;t_{1}&amp;lt;\ldots&amp;lt;t_{n}$, where $t_{0}$ begins a brand new calculation period and $t_{n}$ is the maturity of the contract, do we have (assuming the payment frequency is the same as the calculation period frequency)&#xA;$$V_{t}=\sum_{j=1}^{n}\frac{F_{j}-F_{j-1}}{F_{j-1}}\cdot D(0,t_{j})?$$&#xA;Here $F_{j}$ is the forward equity price at time $t_{j}$ calculated at time $t_{0}$ and $D(0,t_{j})$ is the discount factor for the period $[t_{0},t_{j}]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that the traditional way to value the equity leg is to think of it as a floating rate bond that resets to par at the end of each payment date.  Personally, I find this approach somewhat unintuitive and prefer the projected forward rates viewpoint.  Since the two interpretations are equivalent for floating LIBOR legs, I suspect the same is true for the equity legs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My presumption is that once the value of the equity leg is determined, then a spread $S$ can be added so that&#xA;$$V_{EquityLeg}=V_{OtherLeg},$$&#xA;at inception of the contract.&lt;/p&gt;&#xA;" OwnerUserId="15498" LastActivityDate="2015-02-27T15:59:20.400" Title="Using Forward Equity Returns to Value Stream of Equity Return Cash Flows" Tags="&lt;swaps&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16786" PostTypeId="1" AcceptedAnswerId="16787" CreationDate="2015-02-27T11:37:12.010" Score="3" ViewCount="386" Body="&lt;p&gt;I have been looking for a good reference where I can find how technical indicators of stock market analysis are calculated. I have a dataset (time series) which I want to extract these indicators to apply into another program but I can't find a good reference of who they are calculated. For sample, I would like to see formulas for: Moving Averages, MACD, Exponential Moving Averages, Williams %R, Momentum, RSI, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anybody that can indicate a good reference of how it is calculated?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="5870" OwnerDisplayName="Felipe Oriani" LastEditorUserId="5870" LastEditDate="2015-02-27T16:08:00.180" LastActivityDate="2021-01-08T00:15:50.887" Title="Technical Indicators reference" Tags="&lt;equities&gt;&lt;time-series&gt;&lt;regression&gt;&lt;prediction&gt;&lt;moving-average&gt;" AnswerCount="5" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16787" PostTypeId="2" ParentId="16786" CreationDate="2015-02-27T12:21:27.667" Score="3" Body="&lt;p&gt;The TA_lib Technical Analysis library &lt;a href=&quot;http://www.ta-lib.org/index.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; has open source code for numerous indicators.&lt;/p&gt;&#xA;" OwnerUserId="252" OwnerDisplayName="babelproofreader" LastActivityDate="2015-02-27T12:21:27.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16788" PostTypeId="2" ParentId="16786" CreationDate="2015-02-27T16:23:27.123" Score="2" Body="&lt;p&gt;A very good reference can be found here:&lt;br&gt; &lt;a href=&quot;http://www.asiapacfinance.com/trading-strategies/technicalindicators&quot; rel=&quot;nofollow&quot;&gt;http://www.asiapacfinance.com/trading-strategies/technicalindicators&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2015-03-19T16:51:52.723" LastActivityDate="2015-03-19T16:51:52.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16790" PostTypeId="1" CreationDate="2015-02-27T16:31:40.933" Score="0" ViewCount="204" Body="&lt;p&gt;Sometimes, I find an option where the total time value of the option may be 5 cents(rest is intrinsic value) and there are about 15 days to expiry and theta is .08 (8 cents).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How is this possible. If it is decaying 8 cents a day, then in 15 days, it will lose 120 cents of time premium( and that is assuming a linear time decay, which is not true), but time premium is only 5 cents to start with. So total time decay can only be 5 cents. So how can it keep decaying at 8 cents/day for 15 days?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please look at AAPL 102 call with underlying ~130, and the call is asking 28.05. So time value of this call is ~ 28.05 - (130-102) = 0.05&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Theta is 0.0882. There are ~ 15 days to expiry. Today is feb 27&#xA;&lt;img src=&quot;https://i.stack.imgur.com/KIRTw.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2015-03-05T03:10:39.273" Title="Why theta multipled by days to expiry exceeds the total time premium of the option" Tags="&lt;option-pricing&gt;&lt;greeks&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16791" PostTypeId="1" AcceptedAnswerId="16807" CreationDate="2015-02-27T18:18:52.983" Score="1" ViewCount="105" Body="&lt;p&gt;Let us say I bough a call calendar spread. Now, at expiry of the short option, the underlying has decreased significantly, and I am approaching my max loss(i.e both the options are close to 0).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this situation, what should I do to mitigate risk/hedge my position? Except for closing it for a loss and except for rolling it into the future?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The position is still delta neutral, so this confuses me. Because most position adjustments are geared towards making the position delta neutral. But this position is already delta neutral.&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2015-02-28T21:53:48.833" Title="How to manage risk on a call calendar when underlying is falling" Tags="&lt;options&gt;&lt;risk-management&gt;&lt;greeks&gt;&lt;delta-hedging&gt;&lt;delta-neutral&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16792" PostTypeId="1" CreationDate="2015-02-27T18:25:52.837" Score="8" ViewCount="13177" Body="&lt;p&gt;Im just about to begin the programming aspect of my education towards being a Quant. I know what languages are currently being used and how popular they are. However, I have several good friends getting their masters in computer science and related engineering degrees who tell me that C++ and similar languages are surely outdated for what Quants do. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now despite that the work builds on itself and thus a need for C++ and similar languages are currently needed, do you see a change in the languages being used over the next 10 years? If so, what expected languages do you anticipate will be used?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.s. I know this is a bit more discussion based than Stackexchange normally deals with. However, I am polling from multiple sites with the hope of being able to write on this topic to provide help to those in the future (as there is almost nothing on the web on this topic). Further, as the number of active quant sites is limited,  to acquire a large enough data set to be useful, Stackexchange was a great resource to use. - Sorry for any inconvenience. &lt;/p&gt;&#xA;" OwnerUserId="15499" LastEditorUserId="15499" LastEditDate="2015-02-27T18:34:26.247" LastActivityDate="2015-04-20T13:00:05.787" Title="The future language of quant programming?" Tags="&lt;programming&gt;&lt;quants&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="7" ClosedDate="2015-04-21T07:20:01.127" ContentLicense="CC BY-SA 3.0" />
  <row Id="16793" PostTypeId="1" CreationDate="2015-02-27T19:47:27.327" Score="3" ViewCount="1196" Body="&lt;p&gt;Does anyone how banks determine the spread over LIBOR on a Equity Swap?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Party A pays the return on SPTR to Party B&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Party B pays 1M LIBOR + 40 bps to Party A&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know how the 40 bps spread would be determined?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="15500" LastEditorUserId="25504" LastEditDate="2017-02-10T18:24:21.117" LastActivityDate="2017-02-10T19:44:06.943" Title="Spread over LIBOR on a Equity Swap" Tags="&lt;equities&gt;&lt;swaps&gt;&lt;pricing&gt;&lt;spread&gt;&lt;libor&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16794" PostTypeId="2" ParentId="8896" CreationDate="2015-02-27T22:16:55.010" Score="4" Body="&lt;p&gt;There is a module called &lt;a href=&quot;https://github.com/benjaminmgross/visualize-wealth&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;visualize-wealth&lt;/code&gt;&lt;/a&gt; that provides:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Documentation auto-generation capability with sphinx&lt;/li&gt;&#xA;&lt;li&gt;Portfolio construction methodologies in 3 ways (trade blotter, weight allocation frame, and static allocation series)&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;All basic statistical measures, including many sophisticated ones such as CVaR, Mean Absolute Tracking Error, Cornish Fisher Approximation (to incorporate skew and kurtosis), correlation structure preserving algorithms, Appraisal &amp;amp; Information Ratios, and M^2 (to name a few)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; The sphinx documentation renders into MathJax equations with clickable links and papers around more academic concepts&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;Excel file with manual calculation to &lt;em&gt;most&lt;/em&gt; of the analytical calcs, allowing the user to dig into the manual calculations if they should like (the results of this file are actually used as the data to test the module calcs)&lt;/li&gt;&#xA;&lt;li&gt;Utilities to work with Yahoo!'s API as well as HDFStores, to construct portfolios from&lt;/li&gt;&#xA;&lt;li&gt;Classification algorithms to determine the &quot;likely asset class&quot; of a time series, to enable asset selection and tactical allocation attribution functionality.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;FULL DISCLOSURE:&lt;/strong&gt; I am the developer of the &lt;code&gt;visualize-wealth&lt;/code&gt; module and have been building it entirely on my own for the past 14 months.&lt;/p&gt;&#xA;" OwnerUserId="2153" LastEditorUserId="2153" LastEditDate="2015-08-18T00:55:07.650" LastActivityDate="2015-08-18T00:55:07.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16795" PostTypeId="2" ParentId="14906" CreationDate="2015-02-27T22:30:37.937" Score="2" Body="&lt;p&gt;I can offer my opinion in response to your first two questions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1.) Unfortunately, this is one of the problems with numbers; the answer is that if the observation is outside of the confidence interval by even a millionth of a percent, it is significant. If it is below by even the smallest amount, it is not significant. Changing your significance level or increasing your sample size might help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2.) Remember first that, unless you specified otherwise, the confidence interval refers to a standard normal Gaussian distribution (no skew and normal kurtosis and so on); this may or may not be a valid approach if the distribution is perceptibly different from normal in some respect (your information suggests a slightly negative skew...?). Secondly, you only have 116 observations - one moderately-sized sample out of an indefinite set of samples in the observable population: this means that, even if the population is standard normal, there is a definite possibility that any given sample can deviate perceptibly from the population's distribution (such as having 14 points outside of your confidence interval when there should only be 6).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope that helps at least a little!&lt;/p&gt;&#xA;" OwnerUserId="15501" LastActivityDate="2015-02-27T22:30:37.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16796" PostTypeId="2" ParentId="16389" CreationDate="2015-02-28T00:25:32.457" Score="1" Body="&lt;p&gt;You can get netted level 2 Eurex data from InteractiveData (derived from CEF Core).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For un-netted data the only place I know of is the Eurex datashop. I've been looking for un-netted data for Bund/Bobl/Schatz without success for a while.&lt;/p&gt;&#xA;" OwnerUserId="15250" LastActivityDate="2015-02-28T00:25:32.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16797" PostTypeId="2" ParentId="16793" CreationDate="2015-02-28T00:32:57.133" Score="0" Body="&lt;p&gt;Unless the counterparty specifically bought the swap, then at inception the swap had a 0 value, i.e. the spread is that value which equates the two legs. Of course, it's usually bumped up (bank receiving) or down (bank paying) as the trader's profit.&lt;/p&gt;&#xA;" OwnerUserId="7166" LastActivityDate="2015-02-28T00:32:57.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16798" PostTypeId="1" CreationDate="2015-02-28T02:41:00.287" Score="2" ViewCount="396" Body="&lt;p&gt;I am a newbie. Please help me understand how to resolve the exercise 2.2 from the book &quot;&lt;a href=&quot;https://books.google.com/books/about/The_Concepts_and_Practice_of_Mathematica.html?id=hAT9wO3bzt0C&quot; rel=&quot;nofollow noreferrer&quot;&gt;The concept and practice of Mathematical Finance&lt;/a&gt;&quot;. The solution from the book says that our super-replicating portfolio will be $\alpha$ shares and $\beta$ bonds. It must dominate at zero. This implies that $\beta$ &gt;= 0. &#xA;First of all, what does it mean &quot;it must dominate at zero&quot;. Secondly, why if it dominates at zero, then $\beta$ &gt;= 0? Thanks so much for your help!&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Problem&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/JQPP2.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/JQPP2.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Solution&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/D4zHp.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/D4zHp.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/rryry.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/rryry.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13922" LastEditorDisplayName="user16891" LastEditDate="2015-08-03T09:43:02.167" LastActivityDate="2015-10-05T12:21:43.763" Title="Exercise 2.2 from the book &quot;The concept and practice of Mathematical Finance&quot;" Tags="&lt;option-pricing&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16799" PostTypeId="1" AcceptedAnswerId="16802" CreationDate="2015-02-28T05:15:04.963" Score="0" ViewCount="143" Body="&lt;p&gt;Why do back months options have a higher vega than front month options?&#xA;If possible , kindly explain on an intuitive level without a lot of math.&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2015-02-28T15:31:05.283" Title="Why vega increases further out in time" Tags="&lt;options&gt;&lt;vega&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16800" PostTypeId="2" ParentId="16786" CreationDate="2015-02-28T10:42:54.980" Score="2" Body="&lt;p&gt;The &lt;a href=&quot;http://cdn.preterhuman.net/texts/unsorted2/Stock%20books%20029/John%20J%20Murphy%20-%20Technical%20Analysis%20Of%20The%20Financial%20Markets.pdf&quot; rel=&quot;nofollow&quot;&gt;Technical Analysis of Financial markets&lt;/a&gt; is considered as a milestone of the matter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suggest to read that before starting to test your strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It explains well the use of each indicator, providing the economic reason behind that and when it is useful to use that; moreover, the book deals the stock market with mainly, as you need for. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my humble opinion, it is highly recommended if you want to start studying technical analysis and you are a beginner in that field.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-02-28T10:51:24.640" LastActivityDate="2015-02-28T10:51:24.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16801" PostTypeId="2" ParentId="16782" CreationDate="2015-02-28T11:03:23.820" Score="1" Body="&lt;p&gt;In the E.P. Chan's &lt;a href=&quot;https://www.google.it/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CCQQFjAA&amp;amp;url=http%3A%2F%2Fk-512.googlecode.com%2Ffiles%2FAlgoTra.pdf&amp;amp;ei=Mp7xVJXlGMLzUqChgcAJ&amp;amp;usg=AFQjCNG4Qztpu3Cf5qAn79WXID2xE1qHzA&amp;amp;sig2=_Tekhg2Kki-Ct8_rwOnpPA&amp;amp;bvm=bv.87269000,d.d24&amp;amp;cad=rjt&quot; rel=&quot;nofollow&quot;&gt;Book&lt;/a&gt;, the author provided an example in which he tests a pair trading strategy on GLD (gold spot price) and GDX (gold industry stock index).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All code examples are written in Matlab down in the book, but all of them are explained pretty well; each practical example is equipped with a full theoretical explanation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The example you need for is at p. 57.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-02-28T11:03:23.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16802" PostTypeId="2" ParentId="16799" CreationDate="2015-02-28T15:31:05.283" Score="3" Body="&lt;h2&gt;Intuitive, no math explanation:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Imagine two call options, option A expiring tomorrow and option B expiring in two months. Both of the options are way out of the money and have the same strike price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Due to some event the implied volatility of the stock spikes. Let's assume stock price stays the same. Does the chances of option A expiring in the money change much? NO, there is not enough time for the volatility to be realized. However, option B is now more valuable as there is &quot;realistic&quot; chances that it will expire in the money. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Check out &lt;a href=&quot;http://people.math.gatech.edu/~shenk/OptionsClub/vegaTalk.pdf&quot; rel=&quot;nofollow&quot;&gt;this link&lt;/a&gt; for more information.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Math explanation for other users:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;$$ \nu = S \sqrt{T} \phi (d_1) $$&lt;/p&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2015-02-28T15:31:05.283" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16805" PostTypeId="2" ParentId="10681" CreationDate="2015-02-28T20:43:45.117" Score="0" Body="&lt;p&gt;Were we doing physics and we said there was an arithmetic Brownian motion we could indeed have a drift rate other than $\mu=r$ and it would make sense.  Suppose, for example, that a fluid is moving at velocity $v$ and we have a random walk of particle in it.  This would be reality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The whole point of using SDEs in finance is to identify what ought to be true &lt;em&gt;in equilibrium&lt;/em&gt;.  Where people go wrong in a lot of interpretation is saying something like this: &quot;if the risk free rate is 5% for no risk, and I demand 10% return to take a risk of $\sigma$, then my drift, $\mu$ ought to be 10%...&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put another way, we often say that such a person demands a 10% return for a particular risk ($\sigma$).  Nature may demand a drift in a moving fluid, but saying an investor &lt;em&gt;demands&lt;/em&gt; something of a stock is a bit twisted. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The whole idea of the solution to the SDE for asset pricing is to separate a proposed price process into a drift that is there with certainty and a random element.  The first is the drift, $\mu$, and the only drift that is certain is the risk-free rate, $r$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A better way to say what an investor thinks is to say that, in equilibrium, a stock is priced such that investors have found a price at which there is no selling or buying moving the price, and at which they (collectively) feel the stock is priced such that the expected return is appropriate for the expected risk.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Deep down this is what the risk-neutral measure really means.  Under the risk-neutral measure, investors must believe that there is a 50% chance the stock will, in reality, deliver a return that adequately compensates for the actual risk, and a 50% chance of the opposite. More accurately, they are indifferent between holding the bond and the stock at equilibrium pricing taking into account their own estimates of the distribution payoff and their personal risk appetite.   In reality this means collectively that the expected return is greater than $r$, though we don't know by how much or what the expected $\sigma$ is either.  Due to risk aversion the actual expected return must be above $r$, but we work in risk-neutral space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet one more vector on this is to say that, at equilibrium, an investor with 105 dollars arriving in one year who thinks the stock is fairly priced can either borrow 100 (at 5%) and buy the stock now with the debt paid off in one year, or enter into a forward contract to buy the stock at 105 in one year.  These have identical risk and return outcomes.  Such an investor believes there will be a return of over 5% this year (or else he would not do the trade) and in fact expects enough return to compensate for the risk.  In other words, at the current price, he is risk-neutral (or perhaps a better term is risk-indifferent).  Now, if he 'demands' a 20% return of the stock to feel this way he will be sorely disappointed if the stock only delivers a 2% return (or an 11% return or whatever).  But, deep in his brain, he expects the stock to go up to (perhaps) 120.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that if he is happy with the discount that compensates for risk then he is risk-neutral at that point.  Then, of course, it makes perfect sense that the drift is only the risk-free rate since this is the cost of funding.  Our investor wants to take on the expected risk for the expected return premium, and the drift, as it were, has nothing to do with risk - only the cost of financing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many people find it easier to think of the bond as having a future (riskless) target price of 105, and then the stock to also have a 'target price' of 105 but to be priced, today, at a 'discount' to the bond at 80 (or so).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, if a bond has a price trajectory of $e^rt$, then a stock must have a price trajectory, in the risk-neutral way, that has a future value well below 105 - something like 85 - so that, when we discount back to today using $r$, its spot price is something like the 80 it must be.  And that is where the $-\sigma^2/2$ comes in...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are some subtleties around what $E[e^{\mu X}]$ is but the real meat of the matter is the above.  If we stay in risk-neutral space, which assumes there is adequate expected compensation for anticipated risk, then risk-neutral investors - who would hold the stock at a current price $S_0$ - need a (risk-neutral) price process that delivers a future value of about $S_0e^{rt}$.  To get enough 'discount' so that the current price is around 80, in my example, we need to subtract something from $r$ and that something is $-\sigma^2/2$.  Try it out on a spreadsheet.&lt;/p&gt;&#xA;" OwnerUserId="15509" LastActivityDate="2015-02-28T20:43:45.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16807" PostTypeId="2" ParentId="16791" CreationDate="2015-02-28T21:48:26.680" Score="0" Body="&lt;p&gt;Maybe you need to make your position gamma neutral in the first place.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once the underlying has decreased significantly, if you weren't delta and gamma neutral in the first place, you can't prevent a loss.&lt;/p&gt;&#xA;" OwnerUserId="15435" LastEditorUserId="15435" LastEditDate="2015-02-28T21:53:48.833" LastActivityDate="2015-02-28T21:53:48.833" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16808" PostTypeId="2" ParentId="4589" CreationDate="2015-02-28T23:11:17.227" Score="1" Body="&lt;p&gt;They won't be the same.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you run a discrete simulation you will get the actual (or an instance of an actual path) price process for the future value of the stock using the real probability measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do the same thing using the closed form solution, the path will look very similar but will drift downwards.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why are they different?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To see it easily, build a spreadsheet model with a graph that shows both the real and the modeled path (the latter being the one with $e^{r-\sigma^2/2)}$.  Then plug in maybe 5% for $r$ (or $\mu$, they are the same).  Then run it using $\sigma=0$ and perhaps $\sigma=40\%$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It will be clear that with no risk ($\sigma=0$) the path is just $S_t=B_0e^{rt}$, where $B_0$ is the price of the bond at time $t=0$.  It drifts up in value to return the risk free rate over a single period (a year).  This makes sense.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, with $\sigma=40\%$ the modeled price process for a stock that starts at price $B_0$ drifts &lt;em&gt;downwards&lt;/em&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The whole point of a risk-neutral measure and model is that you discount future amounts by the risk-neutral, or risk-free, rate.  It doesn't make that real, or make the stock's expected return the same as a bond.  It just makes it consistent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So imagine a stock with an initial price of $S_0$.  If the stock has a higher risk than the bond (which it must) and investors in equilibrium have bid the price to a point so it is expected to have a return greater than the bond to compensate for the risk, it must be that the stock is priced a discount to the bond if investors expect the future value to be equal.  Thus, if investors expect $B_{t=1}=S_{t=1}$then $S_0&amp;lt;B_0$.  In essence, the stock is priced today at a discount to the bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The closed-form solution does everything in risk-neutral space.  So if we start with $S_0=B_0$ the bond trajectory of price $B_t$ must discount back to $B_0$ when the risk-free rate is used.  As a result the future value of the stock at the same time must be below $B_t$ so that it discounts back to a lower value at $t=0$ using $r$ as the discount rate to earn a return that compensates for the risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simply, if you 'roll forward' a simulation the stock will outperform the bond on average, but if you see a price model under risk-neutrality the path must be such that when you discount future values to today they must give you a fair value today for the stock.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a bit of mathematical sleight of hand but it all works out the same. So, for example, if $B_0=100$ and $r=5%$ the future value of the bond in one year is 105, and its present value is 100.  But the future value of the stock must look like a smaller number (say, perhaps, 94) so that the price today, $S_0$, is maybe 89 or some such.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The closed form solution does not give you the &lt;em&gt;actual&lt;/em&gt; price model.  It gives you a future price model that allows you to price a stock &lt;em&gt;as if&lt;/em&gt; the risk-free rate can be used to discount the future value to get the right present value.  They are really the same model just expressed differently.  &lt;/p&gt;&#xA;" OwnerUserId="15509" LastActivityDate="2015-02-28T23:11:17.227" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16809" PostTypeId="2" ParentId="14755" CreationDate="2015-02-28T23:24:59.733" Score="1" Body="&lt;p&gt;Number one, the central limit theorem means a lot of things that may not be normal end up looking normal when lots of little 'experiments' or impacts are added up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Number 2, when dealing with finance you need a model that seems plausible.  An arithmetic Brownian motion could go negative, but stock prices can't.  On the other hand, it seems quite plausible that &lt;em&gt;returns&lt;/em&gt;, in percent, could be normally distributed - and, indeed, they do within the ability to test that hypothesis with data.  This is the same as geometric Brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Number three, there aren't obvious and plausible alternatives.  There could be, but like solutions to an engineering ODE about voltages and currents in a circuit with solely capacitors and resistors, even when there are actual ODE solutions that make sense mathematically they don't make physical sense unless the solutions are decaying exponentials or sinusoids.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Number four, geometric Brownian motion corresponds with logical discrete models that are internally consistent mathematically from a financial perspective.  For example, if a security has a return of 21% in two years it is consistent to have a return of 10% for each of the one-year sub-intervals.  There are other ways this could happen, but all that make sense, when taken to a continuous model via a limiting approach, hold together if the continuous model is geometric Brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, this is true of stocks.  If you want to do currency or interest rates there are other solutions that better fit those situations - just as the engineering solution would give you different answers if there were energy being put into the circuit.  In the end it comes down to PDEs that make sense and boundary conditions.  The same is true in engineering and physics: why do you believe the wave equation makes sense?&lt;/p&gt;&#xA;" OwnerUserId="15509" LastActivityDate="2015-02-28T23:24:59.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16811" PostTypeId="1" AcceptedAnswerId="16911" CreationDate="2015-03-01T05:41:57.690" Score="0" ViewCount="283" Body="&lt;p&gt;Is there evidence that automated trading is profitable on the latency-enforced portion of the exchange?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the one hand, if automated trading was profitable when these limits existed naturally, it should be profitable, but on the other hand, if modern hardware is too expensive and older hardware too obsolete, costs may exceed revenues.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe the IEX is a self-inflicted wound, but if a global exchange could execute with equal amounts of time consumed, would it be profitable for automated traders to trade it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;  &quot;Global exchange&quot; in this context is a global trading network that can clear &amp;amp; settle within IEX time consumptions not a location specific trading hub.&lt;/p&gt;&#xA;" OwnerUserId="15512" LastEditorUserId="15512" LastEditDate="2015-03-09T08:34:14.157" LastActivityDate="2015-03-09T13:03:19.960" Title="Has automated trading produced profits at IEX?" Tags="&lt;automated-trading&gt;&lt;economics&gt;&lt;expected-return&gt;&lt;exchange&gt;&lt;latency&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16812" PostTypeId="2" ParentId="16685" CreationDate="2015-03-01T16:35:37.453" Score="0" Body="&lt;p&gt;It is the former. Martingales are defined by filtration and probability space*. The probability space* for the filtration need not be the same as the probability space* for the martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Martingale_%28probability_theory%29#General_definition&quot; rel=&quot;nofollow noreferrer&quot;&gt;I think&lt;/a&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's what my prof said (iirc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;*specifically the probability measure&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="7788" LastEditDate="2016-11-06T11:19:38.920" LastActivityDate="2016-11-06T11:19:38.920" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16813" PostTypeId="2" ParentId="11264" CreationDate="2015-03-01T16:37:06.163" Score="11" Body="&lt;pre&gt;&lt;code&gt;def bbands(price, length=30, numsd=2):&#xA;    &quot;&quot;&quot; returns average, upper band, and lower band&quot;&quot;&quot;&#xA;    ave = pd.stats.moments.rolling_mean(price,length)&#xA;    sd = pd.stats.moments.rolling_std(price,length)&#xA;    upband = ave + (sd*numsd)&#xA;    dnband = ave - (sd*numsd)&#xA;    return np.round(ave,3), np.round(upband,3), np.round(dnband,3)&#xA;&#xA;sp['ave'], sp['upper'], sp['lower'] = bbands(sp.Close, length=30, numsd=1)&#xA;sp= sp[-200:]&#xA;sp.plot()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/sxunb.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="13884" LastActivityDate="2015-03-01T16:37:06.163" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16815" PostTypeId="1" AcceptedAnswerId="16826" CreationDate="2015-03-01T17:54:45.593" Score="0" ViewCount="1422" Body="&lt;p&gt;I do not have a source for this (apologies), but sometimes, I hear about option traders initiating a vertical spread(short) and then converting that call spread to a butterfly spread to mitigate risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand the different legs of a butterfly, but it is not obvious to me how morphing a vertical call spread to a butterfly call spread helps reduce the risk ?&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2015-03-02T18:29:25.943" Title="Convert a call spread to a butterfly to mitigate risk" Tags="&lt;options&gt;&lt;risk&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16816" PostTypeId="2" ParentId="9767" CreationDate="2015-03-01T20:50:55.573" Score="2" Body="&lt;p&gt;Singer and Terhaar original paper can be found at this &lt;a href=&quot;http://www.cfapubs.org/doi/pdf/10.2470/rf.v1997.n5.4462&quot; rel=&quot;nofollow&quot;&gt;link&lt;/a&gt;. They do not provide an explanation about how to estimate this factor and just mention that both values provide a boundary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The CFA curriculum mentions that &quot; For example, it has been observed that developed market bonds &amp;amp; equities are approx 80% integrated and 20% segmented.&quot;, however the source was not cited.&lt;/p&gt;&#xA;" OwnerUserId="2908" LastActivityDate="2015-03-01T20:50:55.573" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16817" PostTypeId="1" AcceptedAnswerId="16830" CreationDate="2015-03-01T21:16:18.450" Score="1" ViewCount="68" Body="&lt;p&gt;If I buy a call calendar spread, and the underlying increases, both options are in the money by the expiry of the short call.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So both options increase in value, but the short one increases less because it has more time decay.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, if I bought the calendar at the money, and the underlying increases 10$, do I lose my entire initial premium that I  paid to enter the spread? Or can I salvage some?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Underlying at 40&lt;/li&gt;&#xA;&lt;li&gt;Sell the March 40 call for 1 usd&lt;/li&gt;&#xA;&lt;li&gt;Buy the April 40 call at 1.50 usd.&lt;/li&gt;&#xA;&lt;li&gt;Results: pay 0.50 usd.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;By Mar expiry, assume underlying goes to 45.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, if both the March and April calls both increased to 5 usd, then I lose the entire initial 0.50 usd.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;Is this the most probable outcome?&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;Or Will March increase to 5, and April increase to 5.20 because April still has some time value?&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In that case, I can roll out of the spread for a .20 (by buying back March at 5 and sell April at 5.20): the loss would be 0.50 - 0.20 = 0.30 USD instead of the whole 0.50.&lt;/p&gt;&#xA;" OwnerUserId="218" LastEditorUserId="467" LastEditDate="2015-03-03T01:04:28.160" LastActivityDate="2015-03-03T02:31:18.603" Title="Does a call calendar lose its entire value if underlying increases well past the strike?" Tags="&lt;options&gt;&lt;option-pricing&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16818" PostTypeId="1" CreationDate="2015-03-01T21:45:38.560" Score="7" ViewCount="285" Body="&lt;p&gt;Given a wealth process that evolves as&#xA;$$d w_t = r w_t dt + \theta_t ( \sigma dW_t + (\mu-r) dt) - c_t dt.$$&#xA;where $\theta_t$ is the worth of holding at time $t$ and $c_t$ is the consumption stream. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, we define smooth functions $u,F: [0, +\infty) \rightarrow \mathbb{R}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can we optimise the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V(w) = \sup_{c \geq 0, \, \theta, \, \tau} \mathbb{E} \bigg[ \int_0^{\tau} e^{- \rho t} u (c_t) dt + e^{-\rho \tau} F(w_{\tau}) \bigg| w_0 =w \bigg],$$&#xA;where $\tau$ is a stopping time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The traditional method of using the HJB and martingale principle of optimal control does not seem to work in this case, when stopping time is involved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions on how to optimise this?&lt;/p&gt;&#xA;" OwnerUserId="13654" LastActivityDate="2016-07-03T15:06:52.473" Title="Stochastic control (HJB) for wealth process involving stopping times" Tags="&lt;optimization&gt;&lt;stochastic-calculus&gt;&lt;portfolio-optimization&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16821" PostTypeId="1" CreationDate="2015-03-02T08:56:58.357" Score="1" ViewCount="200" Body="&lt;p&gt;I'm wondering if there is some standard in the industry about the version of the linux kernel of a computer to run a market data engine on it. (market data engine = connect to brokers, subscribe to assets and forward the data to black box.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it preferable to have: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a soft real time kernel&lt;/li&gt;&#xA;&lt;li&gt;a hard real time kernel&lt;/li&gt;&#xA;&lt;li&gt;a generic one&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The arbitrage is reactivity against througput.&lt;/p&gt;&#xA;" OwnerUserId="9505" LastEditorUserId="467" LastEditDate="2015-03-02T09:21:11.957" LastActivityDate="2015-03-02T16:50:05.217" Title="Are there industry standards form market data server and real time linux kernel?" Tags="&lt;market-data&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16822" PostTypeId="1" AcceptedAnswerId="16828" CreationDate="2015-03-02T12:00:39.630" Score="3" ViewCount="275" Body="&lt;p&gt;This question is about something observed hands on data that makes me a little confused.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the term structure of futures on VIX of Monday, December 27, 2010. You can find it at the &lt;a href=&quot;http://cfe.cboe.com/data/CFEMktStat.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;CFE market statistics&lt;/a&gt; webpage.&lt;img src=&quot;https://i.stack.imgur.com/P14t4.png&quot; alt=&quot;enter image description here&quot;&gt;&#xA;This day is the first day in which the recently issued contract Q (Aug 11) - introduced on Tuesday, December 07, 2010 - began being priced, with settle price: 26.4 US$; but at the same time, closing day Volumes and Open Interests still are null...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This makes me a bit confused. Is it completely normal? I guess so, but don't know why.&#xA;Thanks to anybody that may clarify me on this point. &lt;/p&gt;&#xA;" OwnerUserId="13528" LastActivityDate="2015-03-04T20:31:28.547" Title="VIX Futures data: why happen to have settle price &gt; 0 and Volume = O.I. = 0" Tags="&lt;futures&gt;&lt;vix&gt;&lt;volume&gt;&lt;open-interest&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16823" PostTypeId="2" ParentId="16289" CreationDate="2015-03-02T14:05:43.140" Score="1" Body="&lt;p&gt;If memory serves correctly, the cran package &quot;orderbook&quot; was for NYSE's TAQ (Transactions and Quotes) database. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;the limit order book is the aggregation of latent demand in the market. For you to construct the limit order book you face a few (!) challenges. 1) Parsing itch raw messages (casting in the case of version 5.0) and 2) constructing the actual book. This is a substantial challenge if you seek a performant system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To my knowledge, if you seek to analyze the nasdaq book in a cost effective manner from R, check out Lobster (&lt;a href=&quot;https://lobster.wiwi.hu-berlin.de/&quot; rel=&quot;nofollow&quot;&gt;https://lobster.wiwi.hu-berlin.de/&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have a blast!&lt;/p&gt;&#xA;" OwnerUserId="15515" LastActivityDate="2015-03-02T14:05:43.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16824" PostTypeId="2" ParentId="16821" CreationDate="2015-03-02T16:50:05.217" Score="1" Body="&lt;p&gt;No, there isn't any recommended hardware or OS from the markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having said that, if you mention inifiband or solarflare hardware and Arista switches you'll probably be using hte gear that 90% of algorithmic trading firms use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not qualified to talk about asic or FPGA gear but I don't think there is anything clsoe to a standard there:)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've always found this article to be interesting: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.forbes.com/sites/quora/2014/01/07/what-is-the-technology-stack-like-behind-a-high-frequency-trading-platform/&quot; rel=&quot;nofollow&quot;&gt;http://www.forbes.com/sites/quora/2014/01/07/what-is-the-technology-stack-like-behind-a-high-frequency-trading-platform/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="743" LastActivityDate="2015-03-02T16:50:05.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16826" PostTypeId="2" ParentId="16815" CreationDate="2015-03-02T18:29:25.943" Score="1" Body="&lt;p&gt;Conversion to a butterfly can mitigate or even eliminate all risk taken by opening a initial debit spread or long option position. This is possible only if the underlying moved in your favor after your initial position is open. To convert to a butterfly you simply sell and buy enough options (for a credit) that together with your initial position forms a butterfly. The credit taken in offsets all or most of your debit to open the initial position. Thus your risk is eliminated. This technique is a staple used by all Market Makers.&#xA;For a specific example of a trade which ends up converted to a butterfly with charts see &lt;a href=&quot;http://optionsforum.net/topic/161/mgm-a-classic-pullback-trade&quot; rel=&quot;nofollow&quot;&gt;converting options spread to butterfly&lt;/a&gt;. (disclosure: I am affiliated with the site)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: Quant is not place for trading related questions. This is mostly a place for people to geek out about options.&lt;/p&gt;&#xA;" OwnerUserId="7973" LastActivityDate="2015-03-02T18:29:25.943" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="16827" PostTypeId="1" AcceptedAnswerId="16834" CreationDate="2015-03-02T20:26:07.293" Score="8" ViewCount="9582" Body="&lt;p&gt;Suppose that we have a portfolio of $n$ assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A perfectly diversified portfolio is one in which each asset has equal weights, i.e. each asset has weight $\frac{1}{n}$. Of course this is usually not the case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are some of the ways we can measure how well diversified our portfolio is?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We could measure how far our portfolio is from the equally-weighted portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This of course will depend on the geometry of the space which is not euclidean since the sum of the weights must be one.&lt;/p&gt;&#xA;" OwnerUserId="13698" LastEditorUserId="467" LastEditDate="2015-03-03T07:20:49.813" LastActivityDate="2021-04-18T14:34:44.153" Title="What to use as portfolio diversification measure?" Tags="&lt;portfolio-management&gt;&lt;risk-management&gt;" AnswerCount="5" CommentCount="4" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16828" PostTypeId="2" ParentId="16822" CreationDate="2015-03-02T21:28:42.470" Score="3" Body="&lt;p&gt;The settlement price is provided by the exchange, it doesn't contradict with the fact that the contract wasn't traded. It's a theoretical price calculated by the appropriate models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In many cases, especially outside of US where there is no continuous market making, the exchange will provide a settlement price for a futures or options contracts in the end of the day.&lt;/p&gt;&#xA;" OwnerUserId="2909" LastActivityDate="2015-03-02T21:28:42.470" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16829" PostTypeId="1" CreationDate="2015-03-02T21:32:22.073" Score="1" ViewCount="128" Body="&lt;p&gt;What is the usual method of dealing with many uncertain mean returns in portfolio optimization?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example say you have a 3 asset portfolio with assets A, B and C. All the correlations and variances are the same. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can't reject the null that the assets have the same mean return for (A and B) and (B and C), but you can reject the null for (A and C).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems there is no nonbiased way to choose the means?&lt;/p&gt;&#xA;" OwnerUserId="13309" LastEditorUserId="13309" LastEditDate="2015-03-02T21:37:41.520" LastActivityDate="2020-06-04T05:09:25.493" Title="portfolio optimization with uncertain returns" Tags="&lt;portfolio-management&gt;&lt;portfolio-optimization&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16830" PostTypeId="2" ParentId="16817" CreationDate="2015-03-03T02:31:18.603" Score="2" Body="&lt;p&gt;The price of the April option will be more than $5.00, correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How much more depends on the implied volatility ($\sigma$) of the option and the interest rates ($r$). The higher $\sigma$ and $r$ are, the higher the time value of money and the value of the April option. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I highly recommend playing around with &lt;a href=&quot;http://www.fintools.com/resources/online-calculators/options-calcs/options-calculator/&quot; rel=&quot;nofollow&quot;&gt;this calculator&lt;/a&gt; to gain an intuitive understanding of BS options pricing. Another good idea is to create your own pricing scenarios in &lt;a href=&quot;http://www.macroption.com/black-scholes-excel/&quot; rel=&quot;nofollow&quot;&gt;Excel&lt;/a&gt; and graph the results of each strategy.&lt;/p&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2015-03-03T02:31:18.603" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16831" PostTypeId="2" ParentId="16829" CreationDate="2015-03-03T02:43:02.553" Score="2" Body="&lt;p&gt;Your question accurately addresses of the practical problems of applying Modern Portfolio Theory (i.e. mean-variance optimization) in practice. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally the correlations are considered much more difficult to accurately estimate in this context. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure I understand the question. Isn't $E(r)$ is an unbiased estimator of $r$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may want to look at the &lt;a href=&quot;http://en.wikipedia.org/wiki/Black%E2%80%93Litterman_model&quot; rel=&quot;nofollow&quot;&gt;Black-Litterman model&lt;/a&gt;. It is an optimization model developed to address the practical problems in applying portfolio optimization.&lt;/p&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2015-03-03T02:43:02.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16832" PostTypeId="2" ParentId="16827" CreationDate="2015-03-03T02:58:01.380" Score="4" Body="&lt;p&gt;&lt;a href=&quot;ftp://economia.unica.it/mattana/Modelli_Mercati_Finanziari/Slides/Lecture_2/CRAA.pdf&quot; rel=&quot;nofollow&quot;&gt;This paper&lt;/a&gt;, Equity Portfolio Diversification by W. Goetzmann and A. Kumar, uses the following diversification measures to measure the diversification of retail investors:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Normalized portfolio variance&lt;/strong&gt;:&#xA;$$ NV = \frac{\sigma_p ^2}{\bar{\sigma} ^2} $$&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Sum of Squared Portfolio Weights (SSPW).&lt;/strong&gt; Since the weight in the market portfolio is very small diversification could be approximated by the sum of squared portfolio weights:&#xA;$$ SSPW = \sum w_i ^2 $$&lt;/li&gt;&#xA;&lt;li&gt;A very crude diversification measure would be the number of assets $N$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="13311" LastEditorUserId="13311" LastEditDate="2015-03-04T04:15:32.520" LastActivityDate="2015-03-04T04:15:32.520" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16833" PostTypeId="1" CreationDate="2015-03-03T07:01:33.447" Score="5" ViewCount="2524" Body="&lt;p&gt;For a basket, the realized volatility can be calculated using:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sqrt{\sigma_1^2 + \sigma_2^2 + 2 \sigma_1 \sigma_2 \rho}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I have the volatility surface of two underlyings S1,S2 (strike space).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And for each point I calculate the vols using above formula, how accurate is the approximation? I can extend this to multiple assets using simple cholesky transformation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Correlation used is historical correlation, and not implied correlation. &lt;/p&gt;&#xA;" OwnerUserId="8163" LastEditorUserId="467" LastEditDate="2015-03-03T07:14:00.700" LastActivityDate="2016-02-28T01:05:36.630" Title="How to calculate implied volatility smile of basket using correlations?" Tags="&lt;volatility&gt;&lt;correlation&gt;&lt;basket&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16834" PostTypeId="2" ParentId="16827" CreationDate="2015-03-03T08:50:16.697" Score="9" Body="&lt;p&gt;If you measure risk by the standard deviation of the portfolio return&#xA;$$&#xA;\sigma = \sqrt{w^T \Sigma w},&#xA;$$&#xA;then it is usual to define risk contributions for each asset by&#xA;$$&#xA;\sigma_i = w_i (\Sigma w)_i/\sigma,&#xA;$$&#xA;then diversified could mean that these $\sigma_i$ are evenly spread over the assets in the portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You find this approach and more in this paper by &lt;a href=&quot;http://www.top1000funds.com/wp-content/uploads/2014/05/Managing-diversification.pdf&quot; rel=&quot;noreferrer&quot;&gt;Meucci&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There you also find the variance concentration curve that uses principle components (PCs) of the asset universe and the weighting of the assets to analyze how much the PCs contribute. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ad good place to read about the application of PCA to portfolio analysis is &lt;a href=&quot;http://www.lyxor.com/publications/white-papers/wp/82/&quot; rel=&quot;noreferrer&quot;&gt;Regularization of Portfolio Allocation&lt;/a&gt; by B. Bruder, N. Gaussel, J-C. Richard and T. Roncalli. &lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-03-04T07:11:04.947" LastActivityDate="2015-03-04T07:11:04.947" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="16838" PostTypeId="1" AcceptedAnswerId="16851" CreationDate="2015-03-03T14:29:32.843" Score="1" ViewCount="148" Body="&lt;p&gt;Suppose I have an amount $T$ to invest and $N$ available assets. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The stochastic return per invested unit of asset $i$ is $R_i$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The variance and the expectation of $R_i$ are $\sigma^2_i$ and $\mu_i$ for $i=1,...,N$ (different across $i$). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The returns are independent across $i$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the assets with $\mu_i&amp;gt;s$. Let $\mathcal{N}:=\{i \text{ s.t. } \mu_i&amp;gt;s\}$ with cardinality $n\leq N$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you give me an analytical justification (with proof) for deciding to invest in ALL assets in $\mathcal{N}$ and the associated economic intuition?  In addition, I need an analytical argument that explains why I do not invest just in the asset that gives the highest expected return. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think that what would work here is a measure of portfolio's risk that is minimised when I invest in all assets in $\mathcal{N}$. Or, in alternative, an utility function which is maximized when I invest in all assets in $\mathcal{N}$.&lt;/p&gt;&#xA;" OwnerUserId="15526" LastEditorUserId="15526" LastEditDate="2015-03-03T15:55:39.127" LastActivityDate="2015-03-05T00:48:25.847" Title="Risk minimization by investing in all assets with positive expected return" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio&gt;&lt;diversification&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16839" PostTypeId="2" ParentId="14755" CreationDate="2015-03-03T19:35:34.097" Score="1" Body="&lt;p&gt;I think Matt Wolf had the best answer by far, but the only point I would add is that the normal distribution can actually be a bit of a dangerous assumption at times, I actually believe this is the reason that more emphasis has been placed on risk management (especially recently) as opposed to pricing models.  The main reason for GBM is that it creates effective and simple closed form solutions, modelling asset prices with jumps creates tremendous mathematical difficulties that some have frankly calculated to be more trouble then they're worth.  Truly successful market practitioners are rarely simply mathematicians, they are some combination of a mathematician, economist and philosopher.  While it is important to understand and be able to handle elements of quant finance (especially if you work in a more exotic area), you need a feel for market dynamics before you can really succeed.  I think people continue to use more simplistic models because there has been a bit of a psychological risk/benefit analysis.  The benefit to using an extremely complex model, that may or may not represent the market a bit more efficiently, is limited at best and impossible to quantify at worst.  Instead, moving forward with an understanding that the model is flawed, while simultaneously creating strong risk management to counter these failures, appears to be the most popular route.     &lt;/p&gt;&#xA;" OwnerUserId="15528" LastActivityDate="2015-03-03T19:35:34.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16840" PostTypeId="1" AcceptedAnswerId="18679" CreationDate="2015-03-03T20:30:04.887" Score="4" ViewCount="3390" Body="&lt;p&gt;I'm wondering if some of you known how to resolve this requirement:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have to define the architecture of an algorithmic trading system (but I'm not an architect, so I'm trying to do my best). I have defined an initial architecture, but just now I'm stuck at the data feed handler component.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I mean, the system will receive market data from different sources (bloomberg, FIX4.4, etc) and must normalize that data to &lt;em&gt;produce an usable data&lt;/em&gt; feed which it's supposed to be consumed by algorithms to make some calculations an create some orders, something like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;mk data providers &lt;strong&gt;=&gt;&lt;/strong&gt; data component &lt;strong&gt;=&gt;&lt;/strong&gt; normalize data &lt;strong&gt;=&gt;&lt;/strong&gt; usable data &lt;strong&gt;=&gt;&lt;/strong&gt; algorithms (consume normalized data)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I'm wondering if you know a good way to make this or maybe you know a good opensource market data feed handler that can receive data from different providers and produce one clean and normalized stream of market data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will appreciate very much your answer. Thanks in advance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PD: I have been doing some research and I found this:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.openmama.org/&quot; rel=&quot;nofollow&quot;&gt;http://www.openmama.org/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.stuartreid.co.za/algorithmic-trading-system-architecture-post/&quot; rel=&quot;nofollow&quot;&gt;http://www.stuartreid.co.za/algorithmic-trading-system-architecture-post/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And for now I'm just reviewing those sites...&lt;/p&gt;&#xA;" OwnerUserId="15530" LastActivityDate="2015-07-04T20:03:10.573" Title="How to filter and normalize market data obtained from distinct sources (FIX 4.4, bloomberg, etc) in an algorithmic trading system?" Tags="&lt;market-data&gt;&lt;algorithmic-trading&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16841" PostTypeId="2" ParentId="14755" CreationDate="2015-03-03T23:21:25.057" Score="0" Body="&lt;p&gt;Every practitioner knows there are serious flaws with relying on the basic Black-Scholes model. If you look at the distribution as a part of the solution then you have to throw the baby out with the bath water and all of that Black-Scholes stuff is worthless. If you look at the distribution of asset prices as one of the assumptions then you have a lot of mathematical literature that can help you put the pieces together for your pricing model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider how wide some of the spreads are in options with relatively liquid underlying assets. If you don't know then I'll tell you that the difference in option bids and asks can get theoretically very wide on some relatively liquid underlyings. Even with liquidity (lots of money changing hands) in the underlying asset, the option spreads tend to stay wide until you also have a very liquid options market. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If practitioners had more confidence in their models that used underlying asset price distribution as inputs then there would be a gold rush to make tighter markets and take more of the order flow in the options. That competition happens to an extent, but the people using theoretical models require a wide disparity from the theoretical prices to set spreads. And those models may use numerical methods like the Black-Scholes framework, but they're never priced assuming normal distributions of asset prices.&lt;/p&gt;&#xA;" OwnerUserId="15529" LastActivityDate="2015-03-03T23:21:25.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16842" PostTypeId="1" CreationDate="2015-03-04T00:47:21.513" Score="0" ViewCount="64" Body="&lt;p&gt;Intuitively one would think that investing equal amounts in an ETF such as TLT and an short ETF such as TBF (with some factor for the interest rate payout of the long fund) should result in a interest rate neutral strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, this does not work out in a back test. What am I missing out?&lt;/p&gt;&#xA;" OwnerUserId="9378" LastEditorUserId="467" LastEditDate="2015-03-04T02:06:22.610" LastActivityDate="2015-03-04T02:06:22.610" Title="How to implement an Interest rate neutral strategy using options?" Tags="&lt;interest-rates&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16845" PostTypeId="2" ParentId="16833" CreationDate="2015-03-04T15:21:42.147" Score="3" Body="&lt;p&gt;The formula works for total variance, not &quot;strike specific&quot; variance that you need to construct basket vol surface from components, because single historical correlation (or correlation matrix) just does not provide enough information to uniquely reconstruct expected distribution of basket returns (unless for a trivial case where all components are gaussian, which is not what you're asking). The best you can do is to approximate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the information you provided ( components surface + historical correlation/correlation matrix ) I would suggest using gaussian copula. Copula is a way to &quot;combine&quot; distributions of components into distribution of basket. Check out &quot;Pricing Basket Options With Skew&quot; &lt;a href=&quot;http://wilmott.com/pdfs/100826qu.pdf&quot; rel=&quot;nofollow&quot;&gt;http://wilmott.com/pdfs/100826qu.pdf&lt;/a&gt; Section 4.1 for a detailed description of such algorithm.&lt;/p&gt;&#xA;" OwnerUserId="185" LastEditorUserId="185" LastEditDate="2015-03-04T20:14:20.600" LastActivityDate="2015-03-04T20:14:20.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16846" PostTypeId="2" ParentId="7147" CreationDate="2015-03-04T16:53:14.517" Score="4" Body="&lt;p&gt;The logic from Bob Jansen is correct.   The problem is abuse of ideas and notation the integral symbol from the deterministic world gets sloppily applied to random variables.  Unlike normal $dt$, which is always positive, $dW_t$ can go 'backwards'.  Thus increments of terms like $W_t dW_t$ have a first element that goes up and down with the second element (which can go up and down) and the product is always positive.  Mathematically it really comes down to the fact that, if you take a function of 2 variables in the normal (deterministic world) and do a Taylor expansion, &lt;em&gt;all&lt;/em&gt; of the second order terms can be neglected when you try to integrate the expansion.  But not if there is a Brownian motion...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the problem that gets everyone is the loose use of the $&quot;\int&quot;$ symbol.  When I explain it I purloin the symbol $\oint$ for stochastic integrals (there is no connection to a deterministic line integral).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quite simply, if $X_t(t,W(t))$ is a function of two variables (which it is), and $X_0=X(0)$, we can solve for $X_t$ by integrating: $X_t=X_0+\int_0^tX_t(t,W(t))$.  Now, I myself am being sloppy, as we have no &quot;$d?.$&quot; in the integral.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What everyone does is substitute the relevant Taylor expansion terms so it starts to look like (and now I will use the other symbol):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_t-X_0=\oint_0^t[\frac{\partial X_t}{\partial t}dt+\frac{\partial X_t}{\partial Wt}dW_t+\frac{1}{2}\frac{\partial^2X_t}{\partial Wt^2}(dW_t)^2]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recall that the t on the limit of integration is the &quot;real&quot; t, and the ones inside the integration are all dummies (maybe using $\tau$ would help here). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is where it gets cute.  Mathemeticians and finance people love the abstraction of things like $\frac{\partial^2X_t}{\partial Wt^2}(dW_t)^2$, whereas physicists often look at things like that and say &quot;I don't know what is going on there but somehow it needs to turn into an integral with respect to time since the whole point of this is to model time evolution.&quot;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first term is, indeed, done w.r.t. time, so we can use &quot;$\int$&quot; in place of &quot;$\oint$&quot; safely.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's jump to the third term.  This term is in the stochastic case, and not the deterministic, because of the dynamics of what we call $dW_t$.  We would have had $dt^2$ as well, but it got dropped.  While a Taylor series is trivially correct at its 'anchor' point, we need potentially lots of terms to fit closely farther away.  However, if we want to integrate a Taylor series at a neighborhood very close to its anchor point we need only $f(a)$ and the first derivative $f'(a)$ in the limit. Intuitively we need only the slope in our approximation for tiny $\Delta 's$.  Imagine a $\Delta=10^{-30}$: if we add up (integrate) $10^{30}$ items on the order of this size they matter.  But, even if we add up $10^{30}$ units on the order of the square of that, and thus of size on the order of $10^{-60}$ they accumulate so slowly that they are completely negligible.  This is simply the usual order concept, and $o((dt)^2)&amp;lt;o(dt)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The sleight-of-hand that seems mysterious is this oddity $dW_t$.  Imagine $X_t=3t+2W_t$.  Now, plugging in above, we get &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_t-X_0=\int_0^t\frac{\partial X_t}{\partial t}dt+\oint \frac{\partial X_t}{\partial Wt}dW_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_t-X_0=\int_0^t 3 dt+\oint 2 dW_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first term can be seen, correctly, to be $3t$.  The second by symbolic reasoning is $2W_t$.  More structurally, $dW_t$ is a random variable that is the differential limit of an RV distributed as $N(0,1/k)$ as $k\rightarrow \infty$.  It is, in a sense, a tiny increment of variance alone that accumulates at twice the rate of time in this instance of $X_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The real oddball is $dW_t^2$.  Even though it comes from something that has 'only variance' it is squared.  When an RV distributed as $X\sim N(0,1)$, $X^2$ is a new RV distributed as a chi-squared distribution: $X^2\sim \chi_1^2$.  Now, as we break up this one-period distribution into k sub-periods we get &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sum _k \frac{1}{k} X^2 = \frac{1}{k}\sum _k  X^2$ and $\sum_k X^2 \sim \chi_k^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but&#xA;    $E[\chi_k^2]=k \Rightarrow E[\frac{1}{k}X^2]=1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And here is the rub.  Breaking down the 'variance only' RV into smaller fragments and squaring it and summing over the pieces gives you something which doesn't shrink away any faster than $dt$ despite it seemingly (notationally) looking like $dt^2$  Thus, everyone says, $&quot;dW_t^2=dt&quot;$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Deep down the problem is pretty simple, but the use of the integral sign with $DW_t$ differentials makes it mighty confusing.  All that is really going on is that we have the repeated problem that a term like $W_tdW_t$ co-varies: a positive delta-tick in $W_t$, $dW_t$, means both of the items go up together in such an increment.  And, if there is a negative $dW_t$ tick $W_t$ goes down so that product is also always positive.  In contrast, when we write $\int t dt$ time is always going up and $dt$ is always positive as t increases; $\int -t dt$ still has $dt$ going up.  $dW_t$, however, is allowed to go either way (hence a more Lebesgue-like integral varying over the range not the domain).   You need to think about what $\int dW_t$ really means, which is why I like $\oint$: to minimize errant false conculsions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My math is a little sloppy (why did I use $E[\chi^2]$? both the quadratic variation of a path and its expected value are the same for a random walk; see Shreve's book).  But if you want to see it play out in front of your eyes try using $X_t=3t+2W_t^2$ instead of the above formula. Then the second derivative has a value that matters&lt;/p&gt;&#xA;" OwnerUserId="15535" LastActivityDate="2015-03-04T16:53:14.517" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16848" PostTypeId="2" ParentId="16822" CreationDate="2015-03-04T20:31:28.547" Score="4" Body="&lt;p&gt;CFE calculates settlement price from quotes whether there was trading or not. &quot;The daily settlement price for each VIX futures contract will be the average of the final bid and final offer for the VIX futures contract at the close of trading.&quot; CFE rule 1202(p) &lt;a href=&quot;http://cfe.cboe.com/publish/cferulebook/cferulebook.pdf&quot; rel=&quot;nofollow&quot;&gt;http://cfe.cboe.com/publish/cferulebook/cferulebook.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2015-03-04T20:31:28.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16849" PostTypeId="1" AcceptedAnswerId="16856" CreationDate="2015-03-04T20:36:17.407" Score="0" ViewCount="217" Body="&lt;p&gt;Assume that:&#xA;- The underlying is at 100&#xA;- The implied volatility of ATM call/put is 30%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, is it correct that expected &lt;em&gt;1-standard-deviation move&lt;/em&gt; over the next month is calculated as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$100 * 30\% \cdot \sqrt\frac{30}{252} = 10.35 ~ \text{points}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am confused as to whether I should be taking the square root or not.&lt;/p&gt;&#xA;" OwnerUserId="218" LastEditorUserId="467" LastEditDate="2015-03-05T07:14:47.940" LastActivityDate="2015-03-05T12:29:18.407" Title="How to assess stock price movement from implied volatility?" Tags="&lt;implied-volatility&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16850" PostTypeId="1" CreationDate="2015-03-05T00:13:24.163" Score="1" ViewCount="666" Body="&lt;p&gt;I've been reading into how &lt;a href=&quot;https://www.betterment.com/resources/research/tax-loss-harvesting-white-paper/&quot; rel=&quot;nofollow&quot;&gt;Betterment&lt;/a&gt; and &lt;a href=&quot;https://research.wealthfront.com/whitepapers/tax-loss-harvesting/&quot; rel=&quot;nofollow&quot;&gt;Wealthfront&lt;/a&gt; have architected their tax loss harvesting algorithms, but they stop short of providing any real examples.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially, they both reduce to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Benefit – Cost ≥ Threshold&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;They differ in how they define each term, however. &lt;em&gt;Threshold&lt;/em&gt; is proprietary and the result of Monte Carlo research, so let's leave it aside for now. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Benefit&lt;/em&gt; looks like it is best measured as a percentage of the asset class in the portfolio. For example, if cost basis of the emerging markets fund makes up 10,000 of a portfolio and the loss is $400, does it make sense to say the benefit is &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;($60 ÷ $10,000) = .6%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then &lt;em&gt;cost&lt;/em&gt;, for example, would equal the management fee difference. Let's say .09% and .18%, plus any commissions or bid/ask spread losses expressed as a percent.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(.09% - .18%) - 0 - 0 = .09%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Making the difference&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;.6% - .09% ≥ Threshold&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Have I thought about this correctly or am I missing IRR and time horizons?&lt;/p&gt;&#xA;" OwnerUserId="6086" LastActivityDate="2015-03-06T14:35:24.277" Title="What is an appropriate algorithm to use for tax loss harvesting?" Tags="&lt;volatility&gt;&lt;programming&gt;&lt;statistics&gt;&lt;expected-return&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16851" PostTypeId="2" ParentId="16838" CreationDate="2015-03-05T00:48:25.847" Score="2" Body="&lt;p&gt;since you've assumed that all returns are independent, the covariance matrix, $C,$ is diagonal. In the comments, you are assuming that the investor is a mean-variance investor. It's a general result that every portfolio that maximizes return for a given variance is a tangent portfolio for some risk-free rate, $R.$  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $e=(1,1,...,1).$ and let $\mu$ be the vector of expected returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So we have the weights $x$ satisfy&#xA;$$&#xA;x_i = y_i / \sum y_j&#xA;$$&#xA;and &#xA;$$&#xA;y = C^{-1}(\mu - Re)&#xA;$$&#xA;Now $C^{-1}$ is diagonal with positive entries. So you will only get negative weights if $R$ is greater than $\mu_i$ for some $i.$ However, that won't actually happen for economic reasons. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(See my book &quot;introduction to mathematical portfolio&quot; for more details.)&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-03-05T00:48:25.847" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16852" PostTypeId="1" CreationDate="2015-03-05T01:18:23.823" Score="2" ViewCount="2188" Body="&lt;p&gt;Does anyone know how to estimate $A$, $\sigma_1$,$\sigma_2$ from the following system?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dx = \mu_t x dt + \sigma_1 x dB_x$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d\mu = A(\bar\mu - \mu) dt + \sigma_2 dB_\mu$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Variation in $x$ could be either attributed to variation in $\mu$, or variation in $dB_x$, right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose I know $\bar \mu$, but need to estimate all the rest of the parameters. &lt;/p&gt;&#xA;" OwnerUserId="15537" LastEditorUserId="467" LastEditDate="2015-03-12T07:02:17.560" LastActivityDate="2015-05-11T07:58:50.387" Title="How to estimate parameters of geometric brownian motion with time-varying mean?" Tags="&lt;stochastic-processes&gt;&lt;modeling&gt;&lt;calibration&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16853" PostTypeId="2" ParentId="16849" CreationDate="2015-03-05T02:57:50.070" Score="1" Body="&lt;p&gt;Yes, the answer is correct. Volatility scales with the square root of time, so always take square root. &#xA;A simple trick to remember this, is to calculate the scaling factor as if volatility were linear (30/252) and then take the square root.&lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2015-03-05T02:57:50.070" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16854" PostTypeId="2" ParentId="16790" CreationDate="2015-03-05T03:10:39.273" Score="1" Body="&lt;p&gt;It is because theta is not premium / days to expiration. Theta is a &quot;local&quot; decay, measure of current rate of option decay, which is not assumed to stay constant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the example you provided, theta will be closer to zero (decay rate will slow down) as you approach expiration.&lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2015-03-05T03:10:39.273" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16855" PostTypeId="1" CreationDate="2015-03-05T12:12:42.803" Score="9" ViewCount="6414" Body="&lt;p&gt;I would like to conduct a study testing the 5 factor CAPM, using UK stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have any suggestions of how I can do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could this task be as simple as regressing average returns for a stock with its different factors?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd be grateful for any specific pointers/articles or books I can read!&lt;/p&gt;&#xA;" OwnerUserId="13938" LastEditorUserId="1764" LastEditDate="2015-03-10T10:07:46.633" LastActivityDate="2015-03-10T10:07:46.633" Title="How to test the 5 Factor CAPM of Fama &amp; French (2014)?" Tags="&lt;factor-models&gt;&lt;capm&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="16856" PostTypeId="2" ParentId="16849" CreationDate="2015-03-05T12:29:18.407" Score="1" Body="&lt;p&gt;I think you're doing some self study and it looks like you're on a good path. You have this right. It's the square root of time. I would just note as far as your example goes that there are not 30 days in the month of a 252 (trading day approximation) day year. It's closer to 20.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And vanguard2k points out in a comment that you need to consider implied vol from multiple expiries as much as scaling with the square root of time. In other words, the IV (that's implied vol) for the one month expiry and the 3 month expiry need not by related by the square root of 3. Those expiries' prices are independent market phenomena. The square root of time is more like how you can interpolate for points that don't have market prices or get some more information to substitute for reliance on prices that may be stale.&lt;/p&gt;&#xA;" OwnerUserId="15529" LastActivityDate="2015-03-05T12:29:18.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16857" PostTypeId="1" CreationDate="2015-03-05T13:23:02.117" Score="5" ViewCount="1104" Body="&lt;p&gt;Please note: I have already checked your standard &quot;Historical data sources&quot; link, but it does not have the data I need:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for 5 years of libor/swap data for major currencies. Daily, or even better hourly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this available anywhere?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example of what I would like is: Bloomberg  ADSW2 CMPL Curncy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a free equivalent?&lt;/p&gt;&#xA;" OwnerUserId="4603" LastActivityDate="2019-05-19T15:15:26.233" Title="Where can I get equivalent of 3 months libor or swap historical data?" Tags="&lt;interest-rates&gt;&lt;historical-data&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16858" PostTypeId="2" ParentId="16852" CreationDate="2015-03-05T14:05:42.410" Score="1" Body="&lt;p&gt;It depends on the use of your model as pointed out in the comments.&#xA;If a discretized version is sufficient then state space models could be a solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can check out the free online &lt;a href=&quot;https://www.otexts.org/fpp/7/6&quot; rel=&quot;nofollow&quot;&gt;textbook&lt;/a&gt; by Athana­sopou­los and Hyndman. State space model describe time series in terms of level/trend (and seasonality) on an additive or multiplicative way. There are nice procedure and packages to estimate and forecast such models.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-03-05T14:05:42.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16859" PostTypeId="1" CreationDate="2015-03-05T14:52:41.753" Score="1" ViewCount="742" Body="&lt;p&gt;How would you calculate global exposure for FX swaps using the commitment approach? In particular, would you take into account both legs? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;CESR guidelines (CESR/10-788) defines that the exposure for currency swaps is calculated based on the &quot;Notional value of currency leg(s)&quot;. Is your understanding that both legs (spot and forward) should be taken into account? If this is true, does this mean that a currency swap generated twice the leverage compared to a FX forward of identical notionals?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&#xA;Ryko&lt;/p&gt;&#xA;" OwnerUserId="15542" LastActivityDate="2015-03-05T14:52:41.753" Title="How to calculate global exposure via commitment approach for FX swaps?" Tags="&lt;risk-management&gt;&lt;mutual-fund&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16862" PostTypeId="1" CreationDate="2015-03-05T19:36:45.230" Score="0" ViewCount="7490" Body="&lt;p&gt;I have 2 questions that probably are related. &#xA;Suppose there is an IRS that pays a 2% fixed rate every 6 months and receives the Libor 3 months (but paid every 6 months).&#xA;The swap starts today (March 5th) so the first payment is on Sept 5th (in 6 months). &#xA;But the Libor is a 3 months rate in this case so the fixing should be every 3 months, I guess. &#xA;If that's the case, there are 2 important dates from now and the first payment: the first fixing date (in 3 months time... i.e. June 5th) and the second fixing date which is also payment date on Sept 5th.&#xA;But I have read that it is convention to have the float rate to be fixed in advance (2 days before the period) and then paid in arrears at the end of the period. &#xA;But how does it work in my example? &#xA;The swap starts on March 5th and pays the Libor 3 months in 6 months time. So in 6 months I should have 2 different fixings for the Libor 3 months. &#xA;But when? One is happening in 3 months time on June 5th but what about the other? &#xA;Is it done today? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a simple explanation how the stub rate works? How is ot calculated? Is it related to my first doubt about the very first fixing for the Libor 3 months? &lt;/p&gt;&#xA;" OwnerUserId="15038" LastActivityDate="2015-05-14T16:58:52.300" Title="Stub rate and first fixing in IRS" Tags="&lt;yield-curve&gt;&lt;swaps&gt;&lt;libor&gt;&lt;interest-rate-swap&gt;&lt;irs&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16865" PostTypeId="1" CreationDate="2015-03-05T22:56:01.430" Score="5" ViewCount="4230" Body="&lt;p&gt;I see a lot of theorems related to tradable assets in quantitative finance text books. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is a tradable asset? What does 'tradable' mean exactly? Does it simply mean the asset can be bought and sold in the market? Any example of non-tradable asset?&lt;/p&gt;&#xA;" OwnerUserId="15180" LastActivityDate="2015-03-10T12:50:46.827" Title="What does tradable asset mean?" Tags="&lt;market&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16866" PostTypeId="2" ParentId="16852" CreationDate="2015-03-05T23:47:29.363" Score="3" Body="&lt;p&gt;I would say &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Take log of first equation to get rid of dependence on $x_t$&lt;/li&gt;&#xA;&lt;li&gt;Apply Kalman filter equations to estimate parameters&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I believe &lt;a href=&quot;http://ww.e-m-h.org/ConradKaul1988.pdf&quot; rel=&quot;nofollow&quot;&gt;Conrad and Kaul (1988) J of Business&lt;/a&gt; do exactly what you describe.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="467" LastEditDate="2015-03-06T06:03:36.800" LastActivityDate="2015-03-06T06:03:36.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16867" PostTypeId="1" AcceptedAnswerId="16902" CreationDate="2015-03-06T03:23:14.417" Score="3" ViewCount="112" Body="&lt;p&gt;I am interested in strategy simulation at different frequencies (high frequency and daily frequency) and I want to compute the optimal frequency of execution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To do this, I need to obtain realistic historical transaction costs from 1987 onward.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know where one might obtain such a database?&lt;/p&gt;&#xA;" OwnerUserId="15552" LastEditorUserId="467" LastEditDate="2015-03-06T03:36:01.663" LastActivityDate="2015-03-08T20:06:58.393" Title="Where can one find realistic historical transaction costs?" Tags="&lt;arbitrage&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16869" PostTypeId="2" ParentId="16865" CreationDate="2015-03-06T08:14:09.780" Score="6" Body="&lt;p&gt;The concept of a tradable asset is closely related to the principle of (no-)arbitrage. Much of quant finance is about the connection between the price of a derivative and the price of its underlying. The fundamental reason that there is a connection at all, is the possibility to set up self-financing trading strategies in the underlying(s) which replicate the pay-out of certain derivatives. If you look at the definition of self-financing strategies you will notice that you need to be able to buy and sell the underlying at any time, instantaneously in unlimited quantity, without any transaction costs. So this is a tradable asset within the mathematical theory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course this is mathematical fiction and imposes an important restriction on the applicability of mathematical finance to the real world. But from my (limited) experience more realistic assumptions quickly become messy and really difficult. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my opinion being tradable in the real world is not black and white but a gradual thing. So some examples in descending order of tradability: Bank deposits, S&amp;amp;P futures, derivatives on the &lt;a href=&quot;https://www.markit.com/product/abx&quot;&gt;ABX index &lt;/a&gt;, your house(or car or bicycle), the &lt;a href=&quot;http://en.wikipedia.org/wiki/Sistine_Chapel&quot;&gt;Sistine Chapel&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="482" LastEditorUserId="482" LastEditDate="2015-03-06T09:01:20.827" LastActivityDate="2015-03-06T09:01:20.827" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16870" PostTypeId="1" CreationDate="2015-03-06T08:24:35.057" Score="1" ViewCount="1719" Body="&lt;p&gt;When I download historical data from yahoo finance, only the closing price is adjusted for dividends/splits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way of figuring out the factor by which lets say the highs/lows have to be multiplied in order to adjust them for splits/dividends?&lt;/p&gt;&#xA;" OwnerUserId="15554" LastEditorUserId="467" LastEditDate="2015-03-06T08:31:53.513" LastActivityDate="2015-03-07T13:02:08.473" Title="How to adjust historical data highs/lows for splits and dividends?" Tags="&lt;market-data&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16871" PostTypeId="1" CreationDate="2015-03-06T13:04:54.970" Score="2" ViewCount="225" Body="&lt;p&gt;I am analyzing portfolio protection by replication of a put.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having my portfolio with value $V$ I could buy put giving me the payoff $P$ resulting in a call like pay-off scenario $C=V+P$.&#xA;Say, I don't want to buy the put but replicate it by taking positions according to the Delta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know there are problems involved:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Black-Scholes is wrong, we have jumps, changing volatility and other things&lt;/li&gt;&#xA;&lt;li&gt;however if we do it nevertheless then we have to trade frequently (reestimate volatility, take positions with the new Delta, ...)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If I do this often and correctly. What about the Gamma of the put. I am a bit confused. Do I have to address Gamma? Gamma punishes me if I do not trade frequent enough - I know. &#xA;But how does Gamma influence the success of my procedure. Say vol is constant and the stock price follows GBM and the only decision is how often I trade. How does Gamma harm me? Can I do something else besides buying other options to hedge Gamma risk or can I do something using the underlying (I assume not)?&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-03-09T03:52:21.853" Title="The role of Gamma in replicating a put" Tags="&lt;black-scholes&gt;&lt;portfolio-management&gt;&lt;delta-hedging&gt;&lt;put&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16872" PostTypeId="2" ParentId="16870" CreationDate="2015-03-06T14:17:47.210" Score="0" Body="&lt;p&gt;Yes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;factor = adjusted closing price / (unadjusted) closing price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Adjusted high = high * factor &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Adjusted low = low * factor &lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2015-03-06T14:17:47.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16873" PostTypeId="2" ParentId="16850" CreationDate="2015-03-06T14:30:05.780" Score="3" Body="&lt;p&gt;The answer is that you may use an approach that includes IRR, but that's not a necessary component of what I would consider a good model. I have seen commercial tools that include them and those that don't. I have also seen practitioners set the variables in packages that include this approach, so that they were not a relevant component of the resulting model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You're going to want both a view of historical results and consider Monte Carlo to get a better feeling for the probability surface of your strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This section of the Wealthfront documentation might help you. They show that they have considered approaches incorporating IRR. &lt;a href=&quot;https://research.wealthfront.com/whitepapers/tax-loss-harvesting/#15a-quantifying_the_value_of_tax_deferral_differential_IRR&quot; rel=&quot;nofollow&quot;&gt;https://research.wealthfront.com/whitepapers/tax-loss-harvesting/#15a-quantifying_the_value_of_tax_deferral_differential_IRR&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know who works on Wealthfront's algorithms, but I would like to. I cannot speak to the quality of their services in any way, but I can say that the research in the whitepaper above is not naive. And that is saying something special in the world of tax efficient portfolio management for retail investors.&lt;/p&gt;&#xA;" OwnerUserId="15529" LastEditorUserId="15529" LastEditDate="2015-03-06T14:35:24.277" LastActivityDate="2015-03-06T14:35:24.277" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16874" PostTypeId="2" ParentId="16855" CreationDate="2015-03-06T15:25:24.280" Score="9" Body="&lt;p&gt;Don't just run simple time-series regression to see if you get statistically significant betas. This procedure will not tell you if the factors are actually priced. You run a high risk of finding spurious correlations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a fairly well established standard program to test factor models, called the Fama-MacBeth method. It is based on two sets of regressions. A factor model essentially gives you two (linear) equations that you can estimate using regression analysis:&#xA;$$ r_i = a_i + \beta_{i1} f_1 + … + \beta_{iK} f_K + \epsilon_i \ (1)$$&#xA;$$\mu = \lambda_0 + \beta_{i1} \lambda_1 + … + \beta_{iK} \lambda_K  \ (2)$$&#xA;where $r_i$ is the (realized) return of security $i$, $a_i$ is the intercept of security I (often taken to be the risk-free rate), $\beta_{ij}$ are the factor sensitivities of security $i$ to factor $j$, and $f_j$ are the factor realizations of the relevant factors.&#xA;Given this structure, the APT implies that given absence of arbitrage, the expected return of asset i, $\mu_i$, is given by the second equation where the $\lambda_j$ are the factor risk premia and $\lambda_0$ is the model’s zero beta parameter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The standard way to test the factors is to first run time-series regression of equation (1) using rolling windows to obtain the beta parameters. With monthly data, for example, one would usually estimate the regression using 5 years of data and take the estimated betas of that regression as the beta observation for the last date of those 5 years. Then you repeat the same setup by moving the estimation window one month further, and so on. This will give you a time series of beta estimates for each stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the next step, you run cross-sectional regressions for each time $t$ using the returns on the securities at time $t$ as the dependent variable and the beta estimates as the independent variables. This will give you estimates of the factor risk premia for each time. Finally, you take the average of the factor risk premia over time to see whether they are statistically different from zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will have to adjust your standard errors appropriately because of the fact that the betas in the cross sectional regressions are estimated. You can read up on the technical details of the method in Cochrane’s book on asset pricing. More details on some other methods are given in Campbell, Lo, MacKinley’s book on econometrics. You should also check out the paper by Peterson which contains a detailed discussion of the statistical issues with this method. He also published STATA and R codes for this paper on his website.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Campbell, J., Lo, A., MacKinley, A. (1997) The Econometrics of Financial Markets. Princeton University Press&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cochrane, J. (2001) Asset Pricing (Revised Edition). Princeton University Press&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fama, Eugene F.; MacBeth, James D. (1973). &quot;Risk, Return, and Equilibrium: Empirical Tests&quot;. Journal of Political Economy 81 (3): 607–636.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Petersen, Mitchell (2009). &quot;Estimating Standard Errors in Finance Panel Data Sets: Comparing Approaches&quot;. Review of Financial Studies 22 (1): 435–480.&lt;/p&gt;&#xA;" OwnerUserId="7396" LastActivityDate="2015-03-06T15:25:24.280" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16875" PostTypeId="2" ParentId="3783" CreationDate="2015-03-06T16:13:23.213" Score="2" Body="&lt;p&gt;If you assume that most updates will happen near the top of the book (a fair assumption) a linked-list ordered by price levels will be very efficient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can check &lt;a href=&quot;http://www.coralblocks.com/index.php/category/coralmarketdata/&quot; rel=&quot;nofollow&quot;&gt;CoralMD&lt;/a&gt; for an example of a very fast, garbage-free market data book implementation that provides not just the &lt;em&gt;global&lt;/em&gt; view of the market (all exchanges) but also a &lt;em&gt;per-exchange&lt;/em&gt; book view. It also provides the infra-structure to &lt;a href=&quot;http://www.coralblocks.com/index.php/2015/02/using-coralmd-to-write-market-data-feeds/&quot; rel=&quot;nofollow&quot;&gt;write exchange feeds&lt;/a&gt; and to &lt;a href=&quot;http://www.coralblocks.com/index.php/2015/02/market-data-architecture/&quot; rel=&quot;nofollow&quot;&gt;distribute market data&lt;/a&gt; internally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt; I am one of the developers of CoralMD&lt;/p&gt;&#xA;" OwnerUserId="11804" LastActivityDate="2015-03-06T16:13:23.213" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16877" PostTypeId="2" ParentId="16276" CreationDate="2015-03-06T16:26:31.060" Score="0" Body="&lt;p&gt;I believe the important issue is not how you are going to receive the market data from N different exchanges but how you are going to &lt;em&gt;normalize and generalize&lt;/em&gt; them into a single protocol that can be consumed internally by your applications.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take a look on &lt;a href=&quot;http://www.coralblocks.com/index.php/category/coralmarketdata/&quot; rel=&quot;nofollow&quot;&gt;CoralMD&lt;/a&gt; that has an article about how to build a &lt;a href=&quot;http://www.coralblocks.com/index.php/2015/02/market-data-architecture/&quot; rel=&quot;nofollow&quot;&gt;market data infrastructure&lt;/a&gt; internally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt; I am one of the developers of CoralMD.&lt;/p&gt;&#xA;" OwnerUserId="11804" LastActivityDate="2015-03-06T16:26:31.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16878" PostTypeId="2" ParentId="16840" CreationDate="2015-03-06T17:11:35.413" Score="0" Body="&lt;p&gt;You should check &lt;a href=&quot;http://www.coralblocks.com/index.php/category/coralmarketdata/&quot; rel=&quot;nofollow noreferrer&quot;&gt;CoralMD&lt;/a&gt; which does exactly what you need:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;It provides a fast &lt;a href=&quot;http://www.coralblocks.com/index.php/2015/02/getting-started-with-coralmd-market-data-book/&quot; rel=&quot;nofollow noreferrer&quot;&gt;market data book implementation&lt;/a&gt; that can aggregate quotes from multiple exchanges together, giving you a &lt;em&gt;global view&lt;/em&gt; of the market.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The market data book can also provide a &lt;em&gt;per-exchange&lt;/em&gt; view.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It provides a &lt;a href=&quot;http://www.coralblocks.com/index.php/2015/02/using-coralmd-to-write-market-data-feeds/&quot; rel=&quot;nofollow noreferrer&quot;&gt;simple framework&lt;/a&gt; to build &lt;em&gt;market data feeds&lt;/em&gt; for each exchange.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;And most important, it provides the &lt;a href=&quot;http://www.coralblocks.com/index.php/2015/02/market-data-architecture/&quot; rel=&quot;nofollow noreferrer&quot;&gt;infra-structure&lt;/a&gt; to distribute normalized market data internally for all parts of your trading system, from GUIs to low-latency strategies, as the diagram below illustrates:&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/gRj5Y.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt; I am one of the developers of CoralMD&lt;/p&gt;&#xA;" OwnerUserId="11804" LastActivityDate="2015-03-06T17:11:35.413" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16879" PostTypeId="2" ParentId="14270" CreationDate="2015-03-06T19:31:41.633" Score="3" Body="&lt;p&gt;If I understand correctly the question, you wish to completely hedge the interest rate risk (defined as a parallel shift in the yield curve). If that is the case, you should use modified duration, which is the price sensitivity, rather than the MacAulay duration. They are usually close in value, but not quite the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fortunately, you can easily transform your durations to modified durations: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$D_{mod} = \frac{D_{MA}}{1 + \frac{yield}{frequency}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This yields a vector of modified durations: $D_m = [1.8911; 2.7328; 3.4589; 1.8655]$ for bonds A, B, C and D.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since we want to immunize against parallel shifts: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Delta P \approx -P * D_{mod} * \Delta y = 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where P is the portolio value, $\Delta P$ the change in value, $D_{mod}$ the modified duration of the portolio and $\Delta y$ the change in yield. To immunize, we want $P * D_{mod} = 0$, or, taking $P$ as a given, $D_{mod} = 0$, where $D_{mod} = w^T * D_m$ (weighted sum of the modified durations).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given our weights (value of the bonds) $w = [1993.96; 1002.74; 2024.32; w_4]$, we only have 1 unknown, so this is easy to solve; we obtain $w_4 = -7243.81$. In other words, you would have to short 7243.81\$ worth of bond D to immunize your bond portfolio. This might be problematic, given their 1000\$ value, though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way to see it is that you need to match the modified duration of your assets (your initial portfolio) and liabilities (using bond D), hence the need to short bond D (which becomes a liability). Keep in mind, this only (and only approximately) protects against parallel shifts in the curve.&lt;/p&gt;&#xA;" OwnerUserId="15336" LastActivityDate="2015-03-06T19:31:41.633" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16881" PostTypeId="1" CreationDate="2015-03-07T03:27:25.427" Score="1" ViewCount="613" Body="&lt;p&gt;I am trying to find references (books, papers, etc.) for calculating $\mathbb E f(X_T)$, where $X_T$ is a diffusion and  $f$ is a real function that is not continuous, by means of solving a PDE or Feynman-Kac equation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit adressing the comments:&lt;/em&gt; Even if the PDE has a solution it can only be shown to equal the expectation under certain conditions. That is why I am asking for a reference for the caclulation of the expectation as solution to a PDE and not about the PDE  and its solutions in itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any such &quot;verification theorem&quot; basically uses the Ito formula for the value function and thus requires twice differentiability. This can only be ensured for the PDE solotion if the end data is continuous. So I am not interested in &quot;it should just work&quot; arguments but rather in answers or references to the &quot;when&quot; and &quot;why.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="15562" LastEditorUserId="15562" LastEditDate="2015-03-12T12:37:22.747" LastActivityDate="2015-03-13T09:51:06.723" Title="Pricing of Binary or Digital Options or more generally options with discontinuous payoffs using PDEs" Tags="&lt;option-pricing&gt;&lt;stochastic-processes&gt;&lt;black-scholes-pde&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16883" PostTypeId="1" CreationDate="2015-03-07T12:54:51.140" Score="1" ViewCount="338" Body="&lt;p&gt;As an amateur trader, I have reasonable success with my current end-of-day trading systems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All my systems are based on at least ONE year of &quot;in-sample&quot; data for backtesting, followed by 6-months of &quot;out-of-sample&quot; data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question is:  Could I take TWO years of &quot;in-sample&quot; data, but ignore any data for periods in which I would not have traded due to the market conditions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I used the &quot;data&quot; tag, and searched back to November 2011. I searched all posts for &quot;Historical data&quot;.I could not find any related posts.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:  Assume I want to trade a &quot;long-only&quot; system, in an &quot;upward-trending&quot; market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume the chart for the previous two years looked like a &quot;W&quot;. The first 6 months trends down, then 6 months up, then down, then up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I simply ignore the first and third 6-month periods, and use only the second and fourth 6-month periods?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reason: If the market was trending down, I would not trade. So, why should my system be based on any previous market data that was trending downwards?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Method:  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;In the &quot;W&quot; example above, copy and paste the second 6-month data into Excel. &lt;/li&gt;&#xA;&lt;li&gt;Ignore the third 6-month data.&lt;/li&gt;&#xA;&lt;li&gt;Copy and paste the fourth 6-month data into Excel. &lt;/li&gt;&#xA;&lt;li&gt;But adjust the entire second batch of data upwards so that it joins seamlessly to the end of the first batch. (Possibly by making the first price of the second batch equal to the last price of the first batch.)&lt;/li&gt;&#xA;&lt;li&gt;So, the result would be a 1-year data series that only trended upwards.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I would be most grateful for any comments.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;(Added after Nathan S's answer below. My addition is too long to be added as a comment to Nathan S's answer.)&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;blockquote&gt;&#xA;    &lt;p&gt;It all depends to me on whether your system can categorize a price series as &quot;upward trending.&quot;&lt;/p&gt;&#xA;  &lt;/blockquote&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My first impression was that this is a valid point. So I was about to defend my trend indicator (TE). But, on reflection, I now think it's a distraction. It occurred to me that people such as engineers, IT troubleshooters, and people who conduct human trials always attempt to isolate the &quot;common factor(s)&quot; between two sets of experiments. After that, any differences between the results of the experiments will depend only on differences between the components.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my case, I think the TE (good or bad) is a common factor. It has already been optimized on a watchlist using 3 years of &quot;undoctored&quot; market data. I use that TE for any system based on that watchlist. (For other watchlists, I have different TEs.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the TE will be common to both sets of experiments (doctored data versus undoctored data). For the doctored data, obviously I need to extend the starting point further back in time in order to capture the required number of bars (days) of doctored data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are some statements that I have seen regarding the &quot;selection&quot; or &quot;cherrypicking&quot;  of data for backtesting. Unfortunately, I have no links, because I tended to agree with all these statements. (I'm more likely to keep links for statements that I disagree with, for later research.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't assume that a system that works with one of the following will work with the other:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;US stocks versus Australian stocks.&lt;/li&gt;&#xA;&lt;li&gt;A portfolio of Financials versus a portfolio of Utilities.&lt;/li&gt;&#xA;&lt;li&gt;A bull market versus a bear market.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I think it was the final statement that made me &quot;invent&quot; my own statement:  Don't optimize an &quot;uptrend&quot; system using down-trending data.&lt;/p&gt;&#xA;" OwnerUserId="15565" LastEditorUserId="15565" LastEditDate="2015-03-09T09:08:48.183" LastActivityDate="2015-05-09T02:43:31.687" Title="Is it statistically valid to ignore &quot;irrelevant&quot; stock prices during backtesting?" Tags="&lt;data&gt;&lt;historical-data&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16884" PostTypeId="2" ParentId="16870" CreationDate="2015-03-07T13:02:08.473" Score="1" Body="&lt;p&gt;Yahoo finance describes their method at &lt;a href=&quot;https://help.yahoo.com/kb/finance/SLN2311.html?impressions=true&quot; rel=&quot;nofollow&quot;&gt;https://help.yahoo.com/kb/finance/SLN2311.html?impressions=true&lt;/a&gt;  and indicate that this follows the CRSP method for adjusting prices, dividends, and volumes.  The CRSP calculations are described in detail at &lt;a href=&quot;http://www.crsp.com/products/documentation/crsp-calculations&quot; rel=&quot;nofollow&quot;&gt;http://www.crsp.com/products/documentation/crsp-calculations&lt;/a&gt; .&lt;/p&gt;&#xA;" OwnerUserId="11889" LastActivityDate="2015-03-07T13:02:08.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16885" PostTypeId="1" AcceptedAnswerId="16887" CreationDate="2015-03-07T14:56:58.713" Score="0" ViewCount="179" Body="&lt;p&gt;Is there such a thing as an American butterfly spread?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a European butterfly spread simply buying 1 put with strike price X+a, 1 put with strike price X-a and shorting 2 calls with strike price X, all with the same expiration date, would give you a butterfly spread.&#xA;However if we now do the same with american options, then we could exercise various parts of the strategy before others.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are &quot;fully&quot; American option strategies commonly traded?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Sorry if this isn't the blog I'm supposed to ask this in, it is not exactly Quantitative finance, but personal finance seemed even less relevant)&lt;/p&gt;&#xA;" OwnerUserId="15566" LastActivityDate="2015-03-07T20:14:24.580" Title="Are &quot;American&quot; option strategies traded OTC?" Tags="&lt;option-strategies&gt;&lt;american-options&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16887" PostTypeId="2" ParentId="16885" CreationDate="2015-03-07T20:14:24.580" Score="0" Body="&lt;p&gt;When you say OTC options, I think you're talking about contracts that aren't exchange traded (non-standard), so no one knows the wide range of term sheets that have been executed. I do know that American style (early) payoffs exist in OTC term sheets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most OTC deals are not about speculation. They're usually about reducing risk, so initiating the exposures of all legs of a butterfly in one contract would be unusual. Deals are often initiated by a party who already has a delta-one exposure (two ATM calls would be a delta of 1.0 or two ATM puts would be a delta -1.0). And they want to put some limits on their exposure for which they're willing to pay in terms of the other greeks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, if two parties agreed on pricing for a term sheet that included it then the whole butterfly exposure could be there. It's just that they would mostly likely composite it into a single agreement and term. And you will probably never see the word &quot;butterfly&quot; in the terms. It's just not very precise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would not be uncommon for you to look at the combination of risks after an OTC deal and find that one party's books now included something with the same risks as a butterfly.&lt;/p&gt;&#xA;" OwnerUserId="15529" LastActivityDate="2015-03-07T20:14:24.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16891" PostTypeId="2" ParentId="16883" CreationDate="2015-03-08T05:02:09.637" Score="1" Body="&lt;p&gt;It all depends to me on whether your system can categorize a price series as &quot;upward trending.&quot; I want objective, programmed rules. If my system includes a market condition filter then not only can I ignore cases that would not pass it, but I must ignore them to measure the system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I invent the rule to optimize performance that ran cold in some tested periods, (Not saying that's how your market conditions filter was concocted, but I have done this) then I'm very wary and even more skeptical with out of sample.&lt;/p&gt;&#xA;" OwnerUserId="15529" LastActivityDate="2015-03-08T05:02:09.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16892" PostTypeId="2" ParentId="16408" CreationDate="2015-03-08T11:07:27.830" Score="0" Body="&lt;p&gt;First of all, thank for your answer and your time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having looked all over the place, I come to realize that stock price cannot be rewritten using log return. That is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;St = S0 * r1,0 * r2,1 * ..., with rt+1,t = log(St+1/St)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the 1st case, that is the Asian geometric option. If you use the fact that the definition of geometric mean can be rewritten such as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;x_geo_mean = exp(1/n*sum(log(xi)) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and do the maths, you can come up with a much leaner expression that would require fewer exponentiations to compute under a monte carlo framework.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The price for the geometric option can then be used as control variate to compute the price of an arithmetic option for example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similar fashion goes for the discrete barrier option.&lt;/p&gt;&#xA;" OwnerUserId="15234" LastActivityDate="2015-03-08T11:07:27.830" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16893" PostTypeId="2" ParentId="9673" CreationDate="2015-03-08T13:42:03.000" Score="1" Body="&lt;p&gt;A friend constructed an equal weight portfolio for a client that was constrained to a certain number of holdings. I don't mean less than 20 (less than or equal constraints are more common) but =20 holdings. He chose an ordinality based (sort) approach and he liked a paper, but I don't remember which one. Until then I hadn't thought about using the approach nor had I thought a client's policy would stipulate an equal weight portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There you have one case I know where the approach was used in practice. I don't know of any other cases, but that means almost nothing.&lt;/p&gt;&#xA;" OwnerUserId="15529" LastActivityDate="2015-03-08T13:42:03.000" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16894" PostTypeId="1" CreationDate="2015-03-08T14:17:16.160" Score="-2" ViewCount="160" Body="&lt;p&gt;I am newbie in fix protocol. I would like to know how I can work with bars (candles) in the fix protocol? I mean subscription to bars from client-side and what type of message I can use to send bars from server to the client? I tried to find a suitable message on &lt;a href=&quot;http://fixwiki.org/fixwiki/Category:Message&quot; rel=&quot;nofollow&quot;&gt;http://fixwiki.org/fixwiki/Category:Message&lt;/a&gt;&#xA;but unfortunately I found nothing.&lt;/p&gt;&#xA;" OwnerUserId="15574" LastActivityDate="2015-03-08T23:41:01.970" Title="Fix protocol and Bars" Tags="&lt;fix&gt;&lt;quickfix&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16897" PostTypeId="1" AcceptedAnswerId="16918" CreationDate="2015-03-08T16:59:18.847" Score="0" ViewCount="213" Body="&lt;p&gt;I am looking for a procedure to compute an exponential weighting of returns given a half life parameter. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ran accross a &lt;a href=&quot;http://en.wikipedia.org/wiki/Exponential_decay#Half-life&quot; rel=&quot;nofollow&quot;&gt;wikipedia article&lt;/a&gt;, can I take it unchanged an assume N(t) is the return at time t ?&lt;/p&gt;&#xA;" OwnerUserId="13942" LastEditorUserId="467" LastEditDate="2015-03-10T07:54:04.293" LastActivityDate="2015-03-10T07:54:04.293" Title="Exponential weighting of returns" Tags="&lt;returns&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16898" PostTypeId="1" CreationDate="2015-03-08T17:05:37.140" Score="8" ViewCount="10419" Body="&lt;p&gt;In Derman/Kani/Zou paper about local vol they rebuilt a local vol surface from an implied vol surface.&#xA;Each implied volatility depicted in the surface of the &quot;implied Vol&quot; is the&#xA;Black-Scholes implied volatility. Bascially the volatility you have to enter&#xA;into the Black-Scholes formula to have its theoretical option value&#xA;match the option’s market price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://bfi.cl/papers/Derman%20Kani%20Zou%201995%20-%20Local%20volatility%20surface%20Unlocking%20the%20information%20in%20index%20option%20prices.pdf&quot; rel=&quot;noreferrer&quot;&gt;Derman Paper&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, in the local vol model, they extract the market’s consensus for future local volatilities&#xA;σ(S,t), as a function of future index level S and time t, from the spectrum of available options prices as quoted by their implied Black-Scholes volatilities. The model fits a consistent implied tree to these quoted option prices, and then allows the calculation of the fair values and exposures of all (standard and exotic) options, consistent with all&#xA;the initial liquid options prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question: If I compare the graphs in the paper of the implied vol surface and the local vol surface why is it so different? The local vol should be consistent with the liquid option prices. i.e. Term 1.0, 550 level: implied surface 13.5% vol, local vol surface 18% vol.&#xA;If there is a liquid strike in the market they should have the same vol, am i right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks&lt;/p&gt;&#xA;" OwnerUserId="15567" LastActivityDate="2021-03-20T16:34:54.353" Title="Local volatility surface corresponding to the implied volatility surface" Tags="&lt;local-volatility&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="16901" PostTypeId="2" ParentId="16811" CreationDate="2015-03-08T19:05:45.073" Score="2" Body="&lt;p&gt;IEX is an ATS. The ECN/ATS business is dominated by rampant and well known conflicts of interest. A part of the IEX value proposition from the beginning was to offer an alternative to traders who were disenfranchised by this market structure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If maker-taker rebates are part of your trading business model or if you engage in any strategy that could be deemed latency arbitrage then their value proposition is deliberately adversarial to your goals, because they're competing to take flow that feeds your strategy. They are specifically for the trader who wants to route through a different market structure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If IEX routes deliver on the value proposition then they could potentially be more profitable for automated strategies around threshold level-one book liquidity levels who want to avoid having portions of their order slipped to worse pricing through latency arbitrage. As IEX increases their flow, their ability to deliver in this department should also increase. But they can also do this to the extent their algorithms are good at matching against external flow without allowing latency arb bots time to react.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your analysis of the value has to focus on pricing of fills versus the costs you pay for the routes. There are many automated traders for whom latency arbitrage induced slippage could handily exceed the price difference on routes which are cheaper than IEX. Of course, this is all subject to how well they deliver in terms of order fill. And it's hard to get good analysis in a world of vendors who will only find statistics that support you giving them flow. If you haven't caught some of these guys lying then you haven't been paying attention. Once again, IEX is aiming for something different by unique transparency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're saying that other ECNs/ATSs inflicted the competition from someone like IEX upon themselves, I think that's a fairly reasonable analysis of how competitive forces work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sorry if this answer uses too much jargon. I expect a lot of stackexchange users. But do feel free to ask in comments if I could provide more clarity.&lt;/p&gt;&#xA;" OwnerUserId="15529" LastActivityDate="2015-03-08T19:05:45.073" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16902" PostTypeId="2" ParentId="16867" CreationDate="2015-03-08T20:06:58.393" Score="5" Body="&lt;p&gt;You need to read papers about market impact. You will find a lot of information about transaction costs. Two recent ones:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://arxiv.org/abs/1412.0217&quot; rel=&quot;noreferrer&quot;&gt;Market impacts and the life cycle of investors orders&lt;/a&gt;, by Emmanuel Bacry, Adrian Iuga, Matthieu Lasnier, CAL&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://arxiv.org/abs/1412.2152&quot; rel=&quot;noreferrer&quot;&gt;Beyond the square root: Evidence for logarithmic dependence of market impact on size and participation rate&lt;/a&gt;, by Elia Zarinelli, Michele Treccani, J. Doyne Farmer, Fabrizio Lillo&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The first one use the database of a broker, and the second one the &lt;a href=&quot;http://www.ancerno.com/AboutUs/OurData.aspx&quot; rel=&quot;noreferrer&quot;&gt;Abel Noser database&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you selected the market impact model you want, you can convoluate it with your trading profile to obtain your expected trading costs.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2015-03-08T20:06:58.393" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16903" PostTypeId="2" ParentId="16898" CreationDate="2015-03-08T20:26:45.083" Score="6" Body="&lt;p&gt;You should not expect the local vol to be equal to the implied vol except in the trivial case where both are constant (Black-Scholes model). I haven't read the Derman articles but it is quite clear using Dupire's formula (see Gatheral's book for example). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Local volatility can be computed in terms of call prices using Dupire's formula&#xA;$$&#xA;  \sigma^2(T,K) = \frac{\frac{\partial C}{\partial T} + (r - q)K \frac{\partial C}{\partial K} + qC}{ \frac{1}{2} K^2 \frac{\partial^2C}{\partial K^2}}&#xA;$$&#xA;To get the relationship with implied volatility, it is better to think in terms of the log-moneyness forward $y = \ln(K/F_0^T)$ rather than strike. Writing $w(T,y) = T\Sigma^2(T,y)$ for the total implied variance, the Black-Scholes formula reads&#xA;$$&#xA;  C(T,K) = C_{BS}(T,K,\Sigma(T,\ln(K/F)),r,q) =  S_0 \left( N(-\frac{y}{\sqrt{w}} + \frac{1}{2}\sqrt{w}) - e^y N(-\frac{y}{\sqrt{w}} - \frac{1}{2}\sqrt{w}) \right)&#xA;$$&#xA;Plugging it into the Dupire formula, one gets&lt;br&gt;&#xA;$$&#xA;	\sigma_{\mathrm{Dup}}(T,K)^2 = \frac{ \frac{\partial w}{\partial T} }{1 - \frac{y}{w} \frac{\partial w}{\partial y}+  \frac{1}{4}\left( -  \frac{1}{4} +  \frac{1}{w} +  \frac{y^2}{w^2} \right) \left(\frac{\partial w}{\partial y}\right)^2 + \frac{1}{2}\frac{\partial^2 w}{\partial y^2} }&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This general formula can be simplified in limit cases:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;No skew&lt;/strong&gt;: in this case, $\sigma_{\mathrm{Dup}}(T)^2 =  \frac{\partial w}{\partial T} = \Sigma(T)^2 + 2T\Sigma\frac{\partial \Sigma}{\partial T}$. Local vol is already different from implied vol unless they are both constant (Black-Scholes model). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Short maturities&lt;/strong&gt;: When $T\to 0$, and the derivatives of the implied vol stay bounded, one can check that&lt;br&gt;&#xA;$$&#xA;  \Sigma(0,y) = \frac{1}{\int_0^1 \frac{dt}{\sigma(0,ty)}}&#xA;$$&#xA;so that&lt;br&gt;&#xA;$$&#xA;  \frac{\partial \Sigma}{\partial y} (0,0) = \frac{1}{2}\frac{\partial \sigma_{Dup}}{\partial y} (0,0)&#xA;$$&#xA;in other words, at the money, for very short maturities, the implied volatility skew  is half the local volatility skew.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note that if you start with a twice differentiable implied vol surface, the local vol will only be continuous. &lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2015-03-08T20:26:45.083" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16904" PostTypeId="2" ParentId="16538" CreationDate="2015-03-08T21:40:45.217" Score="2" Body="&lt;p&gt;The mean of bid and ask for a fill is not realistic and this will impact your analysis a lot in options. The market maker is quoting the spread because that's how they intend to get paid for the risk if you bring them one leg. Use the worst pricing assumption on this, even though you should probably still rest orders in practice for anything that has a spread of significance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;b&gt;Option Spread Trades&lt;/b&gt;&lt;br /&gt;&#xA;If you bring a spread trade with lower risk then market maker is more likely to do business inside of the bid/ask spread. If the market maker sees you resting an order and has an opportunity to spread (risk management options position type spread - not bid/ask) your trade against somebody else resting in the book then they're also more inclined to do business inside of the bid/ask spread. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;b&gt;Market Impact&lt;/b&gt;&lt;br /&gt;&#xA;If you go with size (what size is depends on liquidity of the products you trade, but it can be surprisingly low in some 'popular' products) in one trade or a number of trades then market makers in the product will adjust implied volatility in response to order flow. This means that good prices for establishing your position will be getting away from you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;b&gt;More Data is Always Better&lt;/b&gt;&lt;br /&gt;&#xA;Try to get trade and quote data or at least get trade data where quotes are included at trade time. This is a lot of data and it's never cheap. But options are complicated and the liquid markets are very well arbitraged.&lt;/p&gt;&#xA;" OwnerUserId="15529" LastActivityDate="2015-03-08T21:40:45.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16906" PostTypeId="2" ParentId="16894" CreationDate="2015-03-08T23:41:01.970" Score="1" Body="&lt;p&gt;FIX is a lower level thing. It's more like message by message, quote by quote,  and trade by trade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the closest message to what you want would be a MarketDataRequest. If your high and low are values for the trading session then they're in there. Otherwise, you're starting with price by trade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe that for what you're describing you need to cache time stamped values and do calculations on intervals to make bars. It might make economic sense for a vendor to use their best guess at a FIX like spec for messaging bar data. You have a lot of fun architecture decisions ahead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm going to add a large grain of salt for you to take this with. FIX is a dynamic protocol (what I thought I knew today might have been ancient history yesterday) and I have always used someone else's FIX solutions in production though I tinkered with my own in testing a couple of years ago.&lt;/p&gt;&#xA;" OwnerUserId="15529" LastActivityDate="2015-03-08T23:41:01.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16908" PostTypeId="2" ParentId="16871" CreationDate="2015-03-09T03:52:21.853" Score="5" Body="&lt;p&gt;If you could hedge continuously with zero transaction costs, the gamma would be irrelevant: you would perfectly replicate with delta hedging and be done. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, hedging is discrete and there is a certain amount of slippage giving a random outcome with mean zero. The larger the gamma, the bigger the variance of slippage.  Trading more frequently reduces the variance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need a non-linear pay-off to get a non-zero gamma so the underlying will not help with hedging gamma risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(see eg my book &quot;more mathematical finance&quot; for further discussion.)&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-03-09T03:52:21.853" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16909" PostTypeId="1" AcceptedAnswerId="16920" CreationDate="2015-03-09T09:59:46.890" Score="6" ViewCount="3394" Body="&lt;p&gt;In &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2033323&quot; rel=&quot;noreferrer&quot;&gt;this&lt;/a&gt; paper Gatheral presents the following parametrization of the implied total variance $w(k,T) = \sigma_{BS}(k,T)^2T$ for each slice $k \mapsto w(k,T)$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ w(k) = a + b\{\rho (k-m) + \sqrt{(k-m)^2 + \sigma^2} \}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I understand it, for each expiry $T$ one will have to calibrate a set of five parameters $\{a,b,m,\rho,\sigma\}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand I found the &lt;a href=&quot;http://www.it.uu.se/research/project/compfin/benchop/benchop.pdf&quot; rel=&quot;noreferrer&quot;&gt;following&lt;/a&gt; article where in appendix A, a calibrated volatility surface is presented. But in their example there is an explicit dependence on $T$, so then they will have a &quot;simple&quot; specific expression for the whole volatility surface. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another thing I've noticed when reading articles about various parametrizations that there seems to be some inconsistencies regarding &lt;em&gt;implied total variance&lt;/em&gt;. Gatheral defines it as $\sigma_{BS}(k,T)^2T$ but I've seen in other articles people parametrizing on $\sigma_{BS}(k,T)^2$ or $\sigma_{BS}(k,T)$ instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Summarizing&lt;/strong&gt;: My question is primarily if one has to calibrate SVI for each expiry slice or if it is possible to parametrizing the whole surface in a way such that the total number of parameter does not increase if more expiries are added.&lt;/p&gt;&#xA;" OwnerUserId="15582" LastActivityDate="2016-03-12T14:56:31.410" Title="Local volatility SVI parametrization" Tags="&lt;calibration&gt;&lt;local-volatility&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="16911" PostTypeId="2" ParentId="16811" CreationDate="2015-03-09T13:03:19.960" Score="0" Body="&lt;p&gt;The systematic traders (aka &quot;quants&quot;, &quot;HFTs&quot; or whatever you want) tend to be expertly efficient in evaluating trading strategies and market micro-structure. Therefore, reformulating your question &quot;does IEX have &quot;systematic traders that have been using the IEX platform consistently?&quot;. Only IEX can answer that one, but their CEO, Brad Katsuyama did say in a televised interview a few months ago that they had a few &quot;HFT&quot; (his words) subscribers.  I don't know if that is still the case, but if it is, there is your answer.  &lt;/p&gt;&#xA;" OwnerUserId="12142" LastActivityDate="2015-03-09T13:03:19.960" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16912" PostTypeId="2" ParentId="8945" CreationDate="2015-03-09T16:40:37.793" Score="1" Body="&lt;p&gt;This is rather a long comment to your post. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think YEARFRAC version Act/Act has nothing to do with finance at all, probably it is a big bug. Also, I checked the link &quot;Implementation of the YEARFRAC&quot;, the author of that page is not fully right either - &quot;&lt;strong&gt;Property 1: Additivity&lt;/strong&gt;&quot;  - day conventions need not be additive.&lt;br&gt;&#xA;Act/365L (and Act/Act-AFB) we sometimes divide by 365 other times we divide by 366 - stepping over a leap day can not be additive.&lt;br&gt;&#xA;30A/360 avoid the 31 rule if the start date is not &quot;the end of a month date&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Test 1&lt;/strong&gt;&lt;br&gt;&#xA;Start Date:   2015-01-01&lt;br&gt;&#xA;End Date:       2016-01-01&lt;br&gt;&#xA;YEARFRAC(X;Y;1) =  365/365 &#xA;Fine..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Test 2&lt;/strong&gt;&lt;br&gt;&#xA;Start Date:   2015-01-01&lt;br&gt;&#xA;End Date:       2016-01-02&lt;br&gt;&#xA;YEARFRAC(X;Y;1) =  1.001367989056 = 366 / 365,5  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Test 3&lt;/strong&gt;&lt;br&gt;&#xA;Start Date:   2016-02-27&#xA;End Date:     2016-02-29&#xA;YEARFRAC(X;Y;1) = 0.005464481 = 2 / 366&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I myself believe that daycount conventions, might be the dumbest invention made in economy. If I could recommend any day convention it would be Act/365F -- that is Actual days divided by 365. However, it is hard to have any impact on large institutions that gain money on things like this. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2492" LastActivityDate="2015-03-09T16:40:37.793" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16913" PostTypeId="1" AcceptedAnswerId="17492" CreationDate="2015-03-09T19:06:56.633" Score="3" ViewCount="197" Body="&lt;p&gt;I'm interested in papers which consider mathematical models of risks of different portfolios of retail credit. This is not my area of research, so I may be misusing some terms. The idea is simple: I have different sets of credit portfolios with aggregate information known (no personal level detail of each borrower) and want to decide which portfolios to keep and which to sell.&lt;/p&gt;&#xA;" OwnerUserId="15587" LastActivityDate="2015-04-23T10:20:28.117" Title="What are recent important papers on credit portfolio risk modeling?" Tags="&lt;time-series&gt;&lt;risk&gt;&lt;portfolio-management&gt;&lt;risk-management&gt;&lt;credit&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16914" PostTypeId="2" ParentId="1051" CreationDate="2015-03-09T21:59:52.357" Score="0" Body="&lt;p&gt;To find the delta of a convertible you can apply the basic definition foe the derivative number : lim h-&gt;0, P(So+h)-P(So-h)/h, &#xA;However because a lot of convertible are callable and putable you have to use this formula:&#xA;P(So+h) - P(So-h) / 2h , with h=0.0001 for instance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I a not a quant but, the BlackScholes PDE does not work for convertible because the delta hedged portfolio as defined in BS demonstration does not hold for a convertible bond…&lt;/p&gt;&#xA;" OwnerUserId="15588" LastActivityDate="2015-03-09T21:59:52.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16915" PostTypeId="1" AcceptedAnswerId="16917" CreationDate="2015-03-09T23:01:26.450" Score="1" ViewCount="8613" Body="&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/31T0x.png&quot; alt=&quot;Definition&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am having trouble understanding the transition from the third line to the fourth line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see how it works through cases, but is there a general property that allows this?&lt;/p&gt;&#xA;" OwnerUserId="15589" LastEditorUserId="467" LastEditDate="2015-03-10T02:32:51.063" LastActivityDate="2015-03-10T17:39:29.940" Title="What are the properties of Max and Min functions?" Tags="&lt;finance&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16916" PostTypeId="2" ParentId="16883" CreationDate="2015-03-10T01:48:33.933" Score="1" Body="&lt;p&gt;You have to be careful when saying &quot;I would have done this&quot;.  It's too easy in backtesting to make this mistake.  From your description of the data, you have no way of knowing it was in a downtrend, until the downtrend was over or ,at least already in full swing.  Nathan S's answer and radpin's comments are exactly what you have to do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I didn't answer just to tell you to listen to other answers but to give an example of things I do.  I know that if a market closes at noon one day, I wouldn't have traded and I would know that in advance.  I can also make a volume cutoff so I don't trade over the xmas holidays for example.  The system only knows this after the fact but I can safely assume I know when the holidays are, so I ignore discard those results after the fact.&lt;/p&gt;&#xA;" OwnerUserId="5872" LastActivityDate="2015-03-10T01:48:33.933" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16917" PostTypeId="2" ParentId="16915" CreationDate="2015-03-10T07:40:53.913" Score="1" Body="&lt;p&gt;Is it true in general - a property of Max and Min: no, it is just true under the assumption stated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are just cases - going through the cases is the proof.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What if you write down all possible cases and the fact that $K_1 &amp;lt; K_2$? In fact it is enough to consider:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;$S_T &amp;lt; K_1 &amp;lt; K_2$ then $max(K_1,S_T) - max(S_T,K_1,K_2) + K_2 = K_1$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$K_1 &amp;lt; S_T &amp;lt; K_2$ then $max(K_1,S_T) - max(S_T,K_1,K_2) + K_2 = S_T$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$K_1 &amp;lt; K_2 &amp;lt; S_T$ then $max(K_1,S_T) - max(S_T,K_1,K_2) + K_2 = K_2$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;which can be summarized as $min(max(K_1,S_T),K_2)$ under the assumption that $K_1 &amp;lt; K_2$.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="467" LastEditDate="2015-03-10T07:52:43.147" LastActivityDate="2015-03-10T07:52:43.147" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16918" PostTypeId="2" ParentId="16897" CreationDate="2015-03-10T07:49:38.793" Score="0" Body="&lt;p&gt;What you want to do sounds like exponential smoothing of returns.&#xA;So you want to forecast a return by exponentially weighting recent returns.&#xA;For exponential smoothing you can look at Hyndman's papers and the e-book or &lt;a href=&quot;http://robjhyndman.com/uwafiles/fpp-notes.pdf&quot; rel=&quot;nofollow&quot;&gt;this course&lt;/a&gt; on page 34.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I personally don't think that this will give a good forecast! It would be much too easy by the way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The link that you provide points to exponential decay. We had this in school when radio-active material got less and less. I would not just replace $N(t)$ in the wikipedia article but rather read about statistics e.g. using Hyndman's ressources (I know I cite him a lot ...).&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-03-10T07:49:38.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16919" PostTypeId="2" ParentId="14999" CreationDate="2015-03-10T08:12:25.807" Score="5" Body="&lt;p&gt;Your prayers were heard ;-) The following article gives you all you need, especially the  function &lt;code&gt;getOptionQuote()&lt;/code&gt; which lets you download option chains for any ticker symbol with one line of code!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You find the article here (with full R code):&lt;br&gt;&#xA;&lt;a href=&quot;https://mktstk.wordpress.com/2014/12/29/start-trading-like-a-quant-download-option-chains-from-google-finance-in-r/&quot; rel=&quot;noreferrer&quot;&gt;https://mktstk.wordpress.com/2014/12/29/start-trading-like-a-quant-download-option-chains-from-google-finance-in-r/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example the following code plots the open interest by strike for the 4/17/2015 puts:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;aapl_opt = getOptionQuote(&quot;AAPL&quot;)&#xA;plot(aapl_opt$&quot;2015_4_17_puts&quot;$strike, aapl_opt$&quot;2015_4_17_puts&quot;$oi, type = &quot;s&quot;, main = &quot;Open Interest by Strike&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/7mWjs.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2015-03-10T08:12:25.807" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16920" PostTypeId="2" ParentId="16909" CreationDate="2015-03-10T08:43:05.050" Score="5" Body="&lt;p&gt;Gatheral and Jacquier discuss this issue in section 4 of the paper. Instead of using the raw parameterization of the SVI, they use the natural parameterization of the total implied variance:&#xA;$$ w(k) = \Delta + \frac{\omega}{2} \left\{ 1 + \zeta \rho (k - \mu) + \sqrt{(\zeta (k-\mu) + \rho)^2 + (1-\rho^2)} \right\} (\text{p. 61 of the published paper}) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to fit the entire surface of the total implied variance, they propose the following generalization. To ensure that the fit is free of arbitrage, they define the surface in terms of the log-moneyness and the at-the-money implied total variance $\theta_t := \sigma_{BS}^2(0,t)t$. The Surface SVI then has the form:&#xA;$$ w(k,\theta_t) = \frac{\theta_t}{2} \left\{ 1 + \rho \phi(\theta_t) k + \sqrt{(\phi(\theta_t) k + \rho)^2 + (1-\rho^2)} \right\} (\text{p. 63 of the published paper}) $$&#xA;Where $\phi$ is a smooth function from $\mathbb{R}_{+}$ to $\mathbb{R}_{+}$ such that the limit $\lim_{t\rightarrow 0} \theta_t \phi(\theta_t)$ exists in $\mathbb{R}$. The parameters that you need to fit for the entire surface are therefore $\rho$ and whatever is needed to fit $\phi$. In practice, you need some interpolation to get $\theta_t$ because you almost never observe a log moneyness of exactly 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function $\phi$ and the parameters have to satisfy certain restrictions for the parameterization to be free of arbitrage. The paper discusses these at length.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Heston and Jacquier propose two possible $\phi$ functions:&#xA;$$\phi(\theta) = \frac{1}{\lambda \theta} \left( 1 - \frac{1-e^{-\lambda\theta}}{\lambda \theta} \right)$$&#xA;Which they call a Heston-like parameterization and the power law&#xA;$$ \phi(\theta) = \eta \theta^{-\gamma}$$&#xA;A while back, I implemented the paper in MATLAB. In the end, I didn’t use the codes so they are not extensively tested. I have uploaded them to the file exchange. Maybe they are helpful to you:&#xA;&lt;a href=&quot;http://ch.mathworks.com/matlabcentral/fileexchange/49962-gatherals-and-jacquier-s-arbitrage-free-svi-volatility-surfaces&quot; rel=&quot;noreferrer&quot;&gt;http://ch.mathworks.com/matlabcentral/fileexchange/49962-gatherals-and-jacquier-s-arbitrage-free-svi-volatility-surfaces&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7396" LastActivityDate="2015-03-10T08:43:05.050" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16921" PostTypeId="1" CreationDate="2015-03-10T09:14:49.107" Score="1" ViewCount="1247" Body="&lt;p&gt;Konno proposed a LP method for portfolio optimization using the Mean Absolute Deviation (MAD)&lt;/p&gt;&#xA;" OwnerUserId="2911" LastEditorUserId="2911" LastEditDate="2015-03-10T09:23:31.390" LastActivityDate="2016-01-05T07:47:02.640" Title="How to implement Konno's Mean-Absolute Deviation Portfolio Optimization Model using LP methods in Excel" Tags="&lt;portfolio-management&gt;&lt;optimization&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;&lt;mean-variance&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16922" PostTypeId="2" ParentId="16921" CreationDate="2015-03-10T09:14:49.107" Score="1" Body="&lt;p&gt;This &lt;a href=&quot;https://www.academia.edu/11074736/Mean_Absolute_Deviation_MAD_Portfolio_Optimization_in_Excel_and_VBA&quot; rel=&quot;nofollow&quot;&gt;spreadsheet&lt;/a&gt; shows how to implement Konno's Mean Absolute Deviation (MAD) Portfolio Optimization in Excel using LP Simplex methods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For strictly multivariate normal underlyings, the method can be shown to be equivalent to the standard Mean Variance Optimization method of Markowitz et al.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The method is based on the paper &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2508777&quot; rel=&quot;nofollow&quot;&gt;Further Reduction of the Konno-Yamazaki Mean-Absolute Deviation Portfolio Optimization Model&lt;/a&gt; by Mike Fox.&lt;/p&gt;&#xA;" OwnerUserId="2911" LastEditorUserId="467" LastEditDate="2015-03-11T01:41:49.330" LastActivityDate="2015-03-11T01:41:49.330" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16923" PostTypeId="1" CreationDate="2015-03-10T12:34:07.627" Score="2" ViewCount="2125" Body="&lt;p&gt;In this &lt;a href=&quot;https://quant.stackexchange.com/questions/16921/how-to-implement-konnos-mean-absolute-deviation-portfolio-optimization-model-us&quot;&gt;question&lt;/a&gt; a paper about mean absolute deviation portfolio optimization is mentioned and in the answer a spreadsheet with an implementation is attached.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the use of this procedure? Does it produce sparse portfolios (it says something about the number of zeros)? Does it give better results than mean-variance optimization? Can we see a back-test? Reference to a back test? &lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-03-11T06:29:12.797" Title="What are pros and cons of mean absolute deviation portfolio optimization?" Tags="&lt;portfolio-management&gt;&lt;portfolio-optimization&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16924" PostTypeId="2" ParentId="16865" CreationDate="2015-03-10T12:50:46.827" Score="2" Body="&lt;p&gt;An example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Non-tradable asset: VIX index;&#xA;Tradable assets: VIX Futures, VIX Options&lt;/p&gt;&#xA;" OwnerUserId="13528" LastActivityDate="2015-03-10T12:50:46.827" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16925" PostTypeId="2" ParentId="16923" CreationDate="2015-03-10T14:41:40.500" Score="0" Body="&lt;p&gt;Think of mean-variance as using a quadratic risk function. MAD uses a linear one. &lt;/p&gt;&#xA;" OwnerUserId="13902" LastActivityDate="2015-03-10T14:41:40.500" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16926" PostTypeId="2" ParentId="16915" CreationDate="2015-03-10T17:39:29.940" Score="4" Body="&lt;p&gt;Note that,&#xA;\begin{align*}&#xA;\max(a, b) \pm c &amp;amp;= \max(a\pm c, b\pm c),\\&#xA;\min(a, b) \pm c &amp;amp;= \min(a\pm c, b\pm c),&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;-\max(a, b) = \min(-a, -b).&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;&amp;amp; \ \max(K_1, S_T)-\max(S_T, K_1, K_2)+K_2 \\&#xA;=&amp;amp; \ \max(K_1, S_T)-\max(\max(K_1, S_T), K_2)+K_2\\&#xA;=&amp;amp; \ \max(K_1, S_T)+\min\big(-\max(K_1, S_T), -K_2\big)+K_2\\&#xA;=&amp;amp; \ \min\big(0, \max(K_1, S_T)-K_2\big) + K_2\\&#xA;=&amp;amp; \ \min\big(K_2, \max(K_1, S_T)\big).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-03-10T17:39:29.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16927" PostTypeId="1" AcceptedAnswerId="16985" CreationDate="2015-03-10T17:43:20.643" Score="1" ViewCount="515" Body="&lt;p&gt;I'm trying to understand how important the limit order today for NYSE, NASDAQ, Euronext and LSE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, when we talk about the volume traded during the day, what share of that volume has been traded through the limit order book in those exchanges?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I googled some papers, but the situation seems to change and be different across exchanges. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current understanding is that for the Euronext, the trading through the limit order book is central.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How big is the share of limit order book trades and what are the different options to trade?&lt;/p&gt;&#xA;" OwnerUserId="15596" LastEditorUserId="467" LastEditDate="2015-03-11T06:27:46.827" LastActivityDate="2016-05-04T03:59:04.930" Title="How important is the limit order book?" Tags="&lt;equities&gt;&lt;trading&gt;&lt;reference-request&gt;&lt;limit-order-book&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16928" PostTypeId="2" ParentId="16923" CreationDate="2015-03-10T23:08:48.877" Score="1" Body="&lt;p&gt;Reviewing the available literature and doing my own initial tests seems to confirm that the results of the MAD method versus those of the classical MVO are a statistical dead heat with MVO perhaps having a slight return edge - possibly due to MAD, which is more sensitive to fat tails, producing slightly more conservative portfolios*. However for moderate to large size portfolios of 300 or more assets the difference in cacluation time is markedly in favour of MAD and other LP methods. ( Mean Gini and Mean CVaR can be similarly formulated with the common link being through the Absolute Lorenz curve and SSD ). There is also some evidence of MAD methods producing better (lower) out-of-sample tracking errors making it well suited for index tracking and replication purposes&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Mean Absolute Deviation (MAD) is related to the Standard Deviation by the formula MAD:SD=SQRT (2/Pi) or 0.7979 for the strictly normal or Gaussian case. The closer the ratio of your MAD to Std Deviation is to 0.7979 the more 'normal' the data is. This means that in the case where your underlying data is actually normal the optimal weights generated by the LP MAD portfolio optimization model will be the same as those generated using the Quadratic Mean Variance model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The method does tend to produce more concentrated or sparse portfolios due to the upper bound on nonzero assets being T + 2 see Feinstein and Thapa (1993).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some R code (not mine) for backtesting and comparison available here &lt;a href=&quot;https://systematicinvestor.wordpress.com/2011/11/01/minimizing-downside-risk/&quot; rel=&quot;nofollow&quot;&gt;https://systematicinvestor.wordpress.com/2011/11/01/minimizing-downside-risk/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2911" LastEditorUserId="2911" LastEditDate="2015-03-10T23:20:54.963" LastActivityDate="2015-03-10T23:20:54.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16929" PostTypeId="2" ParentId="16782" CreationDate="2015-03-11T06:16:16.747" Score="1" Body="&lt;p&gt;One of the simplest and most intuitive books covering cointegration is &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470505397&quot; rel=&quot;nofollow&quot;&gt;Applied Econometric Time Series&lt;/a&gt; by Enders.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would cover both Engle-Granger and Johansen (although not in so much detail). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another tried and true way of learning it is to go to the Eviews Help Manual. It has grown over the years and now is over 1000 pages. I used it when it was maybe 300 and learned alll the basics of pretty much all the econometrics I use today in that manual. It has a very recipe-book style, of course using eviews. Examples will involve the author testing for unit root in individual series, combining to test for cointegration and testing the numbers of cointegratin vectors. I'm not 100% sure they cover Engle-Granger (or instead just go for the easier to use one-step Johansen method) but it is a great book nonetheless.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Engle Granger boils down to:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Test each series to check I(1)--brownian motion, or I(0)- white&#xA;noise using Augmented Dickey Fuller (ADF) test. Must be I(1). &lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Do regression. Check residuals, run ADF test. They must be I(0) -&#xA;stationary/white noise....i.e., they gotta cross zero lots of times.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you pass both, you have cointegration.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;To fit the Error correction framework, you take you cointegrated residuals $\epsilon(t)$ and lag them and do a regression, i.e.,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta x(t) = a \cdot \epsilon(t-1) + b \cdot \Delta x(t-1) + c \cdot \Delta y(t-1) + .... +  \text{resid}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and do the same for the other series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since ADF has arbitrary lags, sometimes people automate this using a AIC or BIC in steps 1 and 2. &lt;/p&gt;&#xA;" OwnerUserId="15602" LastEditorUserId="467" LastEditDate="2015-03-11T06:24:12.587" LastActivityDate="2015-03-11T06:24:12.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16930" PostTypeId="2" ParentId="16923" CreationDate="2015-03-11T06:29:12.797" Score="1" Body="&lt;p&gt;It's supposedly more robust.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But they all fail as do any plugin estimator version of things. The estimators are typically optimized and unbiased, but the optimized portfolio weights are absolutely biased.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bayesian methods have gone much further. It's better to smear out your estimators before you optimize.&lt;/p&gt;&#xA;" OwnerUserId="15602" LastActivityDate="2015-03-11T06:29:12.797" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="16931" PostTypeId="2" ParentId="3783" CreationDate="2015-03-11T06:38:03.210" Score="6" Body="&lt;p&gt;I do not know in which context you want to implement a matching engine (ME). But according to me the two nice challenges in this context are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;implement one in an FPGA&lt;/li&gt;&#xA;&lt;li&gt;for simulation / fast replay purpose, design the most efficient in/out bus to put synthetic traders in front of the ME.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The last point is about simulating one day in few seconds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer more directly your question, the reference is &lt;a href=&quot;http://www.josh.com/notes/island-ecn-10th-birthday/&quot; rel=&quot;noreferrer&quot;&gt;Josh Levine's code of Island in foxpro&lt;/a&gt;. Levin's has been one of the pioneer in the raise of electronic trading. It is not only an executable spec, but a piece of history.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2015-03-11T06:38:03.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16932" PostTypeId="2" ParentId="16782" CreationDate="2015-03-11T10:43:14.860" Score="1" Body="&lt;p&gt;Another book is Bernhard Pfaff's &lt;em&gt;Analysis of Integrated and Cointegrated Time Series with R&lt;/em&gt; (&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0387759662&quot; rel=&quot;nofollow&quot;&gt;amazon.com&lt;/a&gt;). He emphasizes the Johansen method and error correction models, but also gives an empirical example of the Engle-Granger procedure, Code 4.2.&lt;/p&gt;&#xA;" OwnerUserId="6721" LastActivityDate="2015-03-11T10:43:14.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16934" PostTypeId="1" AcceptedAnswerId="16940" CreationDate="2015-03-11T17:57:58.683" Score="1" ViewCount="202" Body="&lt;p&gt;I was reading some slides on high frequency data and i came across these statements:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;data discreetness induces high degree of kurtosis&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Non synchronous trading and risk premium are sources (spurious) of serial correlation&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Does anyone have any comments that can enlighten my understanding ?&lt;/p&gt;&#xA;" OwnerUserId="15606" LastEditorUserId="467" LastEditDate="2015-03-12T05:44:41.240" LastActivityDate="2015-03-16T03:52:05.917" Title="Can you explain me these comments on high frequency data?" Tags="&lt;trading&gt;&lt;high-frequency&gt;&lt;econometrics&gt;&lt;high-frequency-estimators&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16935" PostTypeId="1" CreationDate="2015-03-11T19:02:19.553" Score="3" ViewCount="1554" Body="&lt;p&gt;I'm working on a project that will fetch data from Google Finance and Reuters.&#xA;In order to avoid keeping two separate lists of stock symbols, I'm looking for some kind of conversion or database or API or anything already built. Something similar to &lt;a href=&quot;https://quant.stackexchange.com/questions/7568/mapping-symbols-between-tickers-reuters-rics-and-bloomberg-tickers&quot;&gt;this question&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, for company &quot;REN - Rede Electrica Nacional&quot;, the tickers are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Google Finance: ELI:RENE&lt;/li&gt;&#xA;&lt;li&gt;Reuters: RENE.LS&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Does anyone know if there's already something like this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance for any help!&lt;/p&gt;&#xA;" OwnerUserId="15607" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-07-12T16:15:43.707" Title="Conversion stock symbols Google Finance vs. Reuters" Tags="&lt;equities&gt;&lt;reuters&gt;&lt;google&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16937" PostTypeId="1" AcceptedAnswerId="16938" CreationDate="2015-03-11T22:56:06.800" Score="1" ViewCount="238" Body="&lt;p&gt;I have come across different ways expected shortfall is defined. e.g.&#xA;$$ES_a(X)=\frac{1}{1-a}\int_a^1VaR_b(X)db$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&#xA;$$ES_a(X)=\frac{1}{a}\int_0^aVaR_b(X)db$$&#xA;e.g. on &lt;a href=&quot;http://en.wikipedia.org/wiki/Expected_shortfall&quot; rel=&quot;nofollow&quot;&gt;Wikipedia's article&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are these different?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$VaR$ itself is somewhere defined as simply the quantile and somewhere as negative of quantile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you shed some light on whether it is simply inconsistency of some authors, or is there some deeper reasons?&lt;/p&gt;&#xA;" OwnerUserId="15608" LastEditorUserId="467" LastEditDate="2015-03-12T01:58:23.063" LastActivityDate="2015-03-12T02:06:01.680" Title="What is the difference between these two Expected Shortfall definitions?" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;value-at-risk&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16938" PostTypeId="2" ParentId="16937" CreationDate="2015-03-11T23:28:50.523" Score="3" Body="&lt;p&gt;These are identical definitions of ES.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's just a matter of expressing losses as negatives or positives.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;First definition&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice the integral bounds are $a$ and $1$: losses are positive; this is so-called Loss(+)/Profit(-).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here alpha might be 95%, as in 95% confidence VaR or ES.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Second definition&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Losses are negative, and the corresponding quantile is 5%; the integral bounds are $0$ and $a$. &lt;/p&gt;&#xA;" OwnerUserId="640" LastEditorUserId="467" LastEditDate="2015-03-12T02:06:01.680" LastActivityDate="2015-03-12T02:06:01.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16940" PostTypeId="2" ParentId="16934" CreationDate="2015-03-12T03:44:15.000" Score="3" Body="&lt;p&gt;1)&#xA;Spurious autocorrelation of non-synchronous trading data was analyzed in this article: &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1245789457&quot; rel=&quot;nofollow&quot;&gt;http://www.amazon.com/An-econometric-analysis-nonsynchronous-trading/dp/1245789457&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;During some time intervals a lot of trades occur and during some nothing happens(so prices are stale). So serial correlation of traded prices may be present but this may be due to stale prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See this paper for an example when prices are generated by a stochastic drift and measured with non-synchronous traded prices: &lt;a href=&quot;http://eml.berkeley.edu/~anderson/Sources-042212.pdf&quot; rel=&quot;nofollow&quot;&gt;http://eml.berkeley.edu/~anderson/Sources-042212.pdf&lt;/a&gt;&#xA;They also proposed a way to compute autocorrelation without this bias: eliminate NT by computing returns over disjoint return subperiods, separated by a trade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2)&#xA;Discreteness introduces large kurtosis since most of the price moves are one tick up/down for liquid securities. If the &quot;fair&quot; price has to move 1.6 ticks away, due to discreteness it has to move 2 ticks.&lt;/p&gt;&#xA;" OwnerUserId="5861" LastEditorUserId="5861" LastEditDate="2015-03-16T03:52:05.917" LastActivityDate="2015-03-16T03:52:05.917" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16941" PostTypeId="2" ParentId="16852" CreationDate="2015-03-12T06:21:36.957" Score="1" Body="&lt;p&gt;Thank you guys. Sorry for the late reply, I just solved it in matlab using maximum likelihood estimation. Turns out that all we need to do is to specify a state space model, then estimate the coefficient using MLE. The linearity and normality here makes things pretty simple. &lt;/p&gt;&#xA;" OwnerUserId="15537" LastActivityDate="2015-03-12T06:21:36.957" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16942" PostTypeId="1" CreationDate="2015-03-12T10:31:49.590" Score="8" ViewCount="12979" Body="&lt;p&gt;In my project, we have two version of systems. One version is for derivative trades and other version is for bond trades.For derivatives we get the market data from Reuters and for Bonds we are getting the data from Bloomberg.&#xA;Currently we are planning to upgrade both version systems and migrate to a single version. &#xA;I am analyzing the difference between Bloomberg and Reuters market data. To start with,i am just trying to find out whether there is any difference between these 2 sources in terms of market feed.Can we have just one real time feed, or should we have both the feeds. If only one real time feed, which one we should go with. Does both provide ISIN download information?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of cost reduction, is it possible to have the market data from one source (either Bloomberg or Reuter) for all types of trades.Please share your thoughts on this.&lt;/p&gt;&#xA;" OwnerUserId="15610" LastActivityDate="2015-03-14T11:24:12.173" Title="Market Data Sources Bloomberg Vs Reuter" Tags="&lt;market-data&gt;&lt;finance&gt;&lt;bloomberg&gt;&lt;reuters&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16943" PostTypeId="2" ParentId="16881" CreationDate="2015-03-12T12:12:52.810" Score="0" Body="&lt;p&gt;$E\{f(X_T)\}$ can still exist even if $f$ is not continuous.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example,&#xA;$$&#xA;\begin{equation}&#xA;f: x \mapsto&#xA;\begin{cases}&#xA;1, \, x &amp;gt;= 3 \\&#xA;0, \text{ otherwise}&#xA;\end{cases}&#xA;\end{equation}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then&#xA;$$&#xA;\begin{equation}&#xA;E\{f(X_T)\} = P(\{X_T &amp;gt;= 3\})&#xA;\end{equation}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, if you're example is a binary option which pays 1 if $X_T &amp;gt;= B$ and zero otherwise, and $\{X_t\}$ follows a standard diffusion,&#xA;$$&#xA;\begin{equation}&#xA;dX_t = X_t(r dt + \sigma dW_t)&#xA;\end{equation}&#xA;$$&#xA;you'll get&#xA;$$&#xA;\begin{eqnarray}&#xA;V_t &amp;amp;=&amp;amp; e^{-r\tau}\mathbb{E}\{1_{\{X_T &amp;gt;= B\}}|\mathcal{F_t}\} \\&#xA;&amp;amp;=&amp;amp; e^{-r\tau}P(\{X_T &amp;gt;= B\}) \\&#xA;&amp;amp;=&amp;amp; e^{-r\tau}\Phi\left(\frac{\log\left(\frac{X_t}{B}\right) + (r - \frac{\sigma^{2}}{2})\tau}{\sqrt{\tau}\sigma}\right)&#xA;\end{eqnarray}&#xA;$$,&#xA;where $\tau := T - t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To calculate $\mathbb{E}\{f(X_T) | \mathcal{F_t}\}$ you would find the stochastic differential of&#xA;$$\begin{equation}&#xA;e^{-rT}\mathbb{E}\{f(X_T) | \mathcal{F_t}\} = e^{-rt}V_t.&#xA;\end{equation}&#xA;$$&#xA;Set the &quot;dt-term&quot; to zero (which gives the Black-Scholes PDE) and set appropriate boundary conditions. The temporal end boundary condition is your payoff function. For upper and lower bounds in the spatial dimension you would need to set &quot;suitably large&quot; values. Actual numerical schemes for solving PDEs can be found in standard textbooks on PDEs.&lt;/p&gt;&#xA;" OwnerUserId="6578" LastEditorUserId="6578" LastEditDate="2015-03-12T12:43:06.820" LastActivityDate="2015-03-12T12:43:06.820" CommentCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="16945" PostTypeId="1" CreationDate="2015-03-12T13:46:24.177" Score="2" ViewCount="193" Body="&lt;p&gt;I am wondering if there is any website that provides &lt;strong&gt;relative price strength&lt;/strong&gt; as is defined in CAN SLIM stock picking methodology.&#xA;For the CAN SLIM difinition I am looking at this article:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.investopedia.com/university/stockpicking/stockpicking7.asp&quot; rel=&quot;nofollow&quot;&gt;http://www.investopedia.com/university/stockpicking/stockpicking7.asp&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I searched the Internet and found a suggestion to use &lt;em&gt;barchart&lt;/em&gt; website: &lt;a href=&quot;http://www.barchart.com/technicals/stocks/AMD&quot; rel=&quot;nofollow&quot;&gt;http://www.barchart.com/technicals/stocks/AMD&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It has a &lt;em&gt;Relative Strength&lt;/em&gt; column, but its definition is something different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I appreciate any help on this.&lt;/p&gt;&#xA;" OwnerUserId="15612" LastActivityDate="2015-03-12T13:46:24.177" Title="Finding relative price strength as defined in CANSLIM stock picking methodology" Tags="&lt;equities&gt;&lt;market-data&gt;&lt;price&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16946" PostTypeId="2" ParentId="16942" CreationDate="2015-03-12T14:30:49.243" Score="1" Body="&lt;p&gt;Well for bond prcing, since there isn't a real market you'll need multiple data feeds anyway to create your bid/ask price.  The question then becomes can either bloomberg or reuters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both will allow you to pull in data from multiple sources.  On bloomberg its PCS to setup what pricing sources to use.  The pricing sources available depend on what you pay for.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default bloomberg has its own pricing source, which isn't very accurate.  They do allow you to scrap BB IM chats to pull in pricing data, which is very common, I&quot;m assuming if you are bond traders then you probably already do this as I haven't yet seen a bond trading firm the at doesn't:)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reuters has similar functionality but I don't have my Eikon terminal open right now, yes I'm one of hte 50 people that has a Reuters Eikon terminal:)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In terms of cost reduction, is it possible to have the market data from one source (either Bloomberg or Reuter) for all types of trades.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes you can use either one, but the accuracy of both differs based on the products you are pricing and the sources available to you.  In other words if you choose one over the other you are likely to have some upset traders and some happy traders:)&lt;/p&gt;&#xA;" OwnerUserId="743" LastActivityDate="2015-03-12T14:30:49.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16948" PostTypeId="1" CreationDate="2015-03-12T15:28:36.003" Score="1" ViewCount="148" Body="&lt;p&gt;Probably a naive question. I am quoting this from Greene's econometrics book:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;The occasional statement that the properties of the MLE are only optimal in large samples is not true, however. It can be shown that when sampling is from an exponential family of distributions, there will exist sufficient statistics. If so, MLEs will be functions of them, which means that when minimum variance unbiased estimators exist, they will be MLEs. [See Stuart and Ord (1989).] Most applications in econometrics do not involve exponential families, so the appeal of the MLE remains primarily its asymptotic properties.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So why the variance estimate is downward biased in MLE for a normal distribution?&lt;/p&gt;&#xA;" OwnerUserId="3245" LastActivityDate="2015-03-12T15:28:36.003" Title="MLE estimate of normal distribution" Tags="&lt;econometrics&gt;&lt;covariance-estimation&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="16949" PostTypeId="1" CreationDate="2015-03-12T18:16:55.587" Score="3" ViewCount="1456" Body="&lt;p&gt;Does anyone know where to get historical, daily net asset values for closed end funds from the date of inception to the present?  Yahoo finance has daily opening, high, low, closing values, but no NAV that I'm aware of through their YQL service (querying yahoo.finance.historicaldata).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At a minimum, I would like to know the NAV of a fund on the date the dividend is paid.&lt;/p&gt;&#xA;" OwnerUserId="15063" LastEditorUserId="8228" LastEditDate="2016-11-30T22:28:34.783" LastActivityDate="2017-02-20T23:10:21.203" Title="Historical Daily NAV for Closed End Funds" Tags="&lt;yahoofinance&gt;&lt;funds&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16950" PostTypeId="2" ParentId="8452" CreationDate="2015-03-12T20:29:43.277" Score="6" Body="&lt;p&gt;My favorite tool is Sornette's own Finanical Crisis Observatory: &lt;a href=&quot;http://tasmania.ethz.ch/pubfco/fco.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://tasmania.ethz.ch/pubfco/fco.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are interested, I have developed my own tool in Java and JavaCL which can be found here: &lt;a href=&quot;https://thebubbleindex.codeplex.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://thebubbleindex.codeplex.com/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: Code moved to github: &lt;a href=&quot;https://github.com/thebubbleindex/thebubbleindex&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/thebubbleindex/thebubbleindex&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15615" LastEditorUserId="15615" LastEditDate="2019-02-20T22:17:28.480" LastActivityDate="2019-02-20T22:17:28.480" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="16951" PostTypeId="1" AcceptedAnswerId="16965" CreationDate="2015-03-12T20:40:33.413" Score="11" ViewCount="2209" Body="&lt;p&gt;I know that the difference between the GARCH and the Heston model is volatility vs variance in the stochastic part of the volatility sde. However,from my solutions, there is only ever a 2 - 10 cent difference at most in most evaluations of the different models. Therefore why is heston more commonly used than GARCH and what makes one model better than the other? &lt;/p&gt;&#xA;" OwnerUserId="15499" LastActivityDate="2021-01-21T10:51:43.383" Title="Difference between GARCH and Heston Volatility model" Tags="&lt;garch&gt;&lt;heston&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="16952" PostTypeId="2" ParentId="16881" CreationDate="2015-03-13T09:51:06.723" Score="1" Body="&lt;p&gt;if we take a digital option and price under BS then you can do the whole thing by direct verification. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;i.e. $N(d_2)$ solves the PDE and converges to the final pay-off pointwise. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if the final pay-off has a finite number of jump discontinuities then subtract a linear combination of digitals to reduce to the continuous case.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-03-13T09:51:06.723" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="16953" PostTypeId="2" ParentId="16857" CreationDate="2015-03-13T16:43:14.313" Score="1" Body="&lt;p&gt;This &lt;a href=&quot;http://www.global-rates.com/interest-rates/libor/libor.aspx&quot; rel=&quot;nofollow&quot;&gt;site&lt;/a&gt; used to be a good free source. I'd be surprised if you find a good source with daily LIBOR rates for major currencies with easy automatic download.&lt;/p&gt;&#xA;" OwnerUserId="2909" LastActivityDate="2015-03-13T16:43:14.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16954" PostTypeId="1" CreationDate="2015-03-13T16:48:45.350" Score="3" ViewCount="1546" Body="&lt;p&gt;Im an undergrad student trying to become more familiar with how HFT works. In specific, I was wondering what kind of hardware they use and how each piece contributes to the system. I've been led to believe FPGAs play a big role in the architecture and was wondering what exactly they are used for in the system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="15370" LastActivityDate="2015-05-12T20:19:55.813" Title="HFT Architecture" Tags="&lt;high-frequency&gt;&lt;trading-systems&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16955" PostTypeId="2" ParentId="16007" CreationDate="2015-03-13T16:57:09.667" Score="0" Body="&lt;p&gt;When a company distributes a special dividend or there is other corporate action, it affects the deliverable of the option contracts. Thus, the option is adjusted and becomes special. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, a standard option contract is on 100 shares of ABC. The company goes through a corporate action (including special dividends), and the deliverable now is 90 shares of the adjusted underlying share.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typically, new options with standard properties are issued around the corporate action date. They may trade for a certain period together with old (non-standard) options with the same strike, expiration, callput.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Eventually, the non-standard options will be delisted and standard contracts will continue trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A provider should give you some sort of identifier to distinguish between the old (non-standard) option and newly listed option.&lt;/p&gt;&#xA;" OwnerUserId="2909" LastActivityDate="2015-03-13T16:57:09.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16956" PostTypeId="1" AcceptedAnswerId="16966" CreationDate="2015-03-13T17:10:20.233" Score="2" ViewCount="102" Body="&lt;p&gt;I'd like to build a portfolio based upon modern portfolio theory and I'd like to find a tool I can use to calculate the proper mix of asset classes. Can anyone help with this? I think a good chart/graph showing stocks, bonds, oil, etc. along the efficient frontier would suffice as well. &lt;/p&gt;&#xA;" OwnerUserId="15622" LastActivityDate="2016-01-07T21:16:21.307" Title="Does anyone know where I can find a free efficient frontier tool, or an informative and legitamate/academic graph of the efficient frontier?" Tags="&lt;risk-management&gt;&lt;modern-portfolio-theory&gt;&lt;capm&gt;&lt;standard-deviation&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16957" PostTypeId="1" AcceptedAnswerId="16981" CreationDate="2015-03-13T17:20:13.970" Score="1" ViewCount="160" Body="&lt;p&gt;Consider the following theorem from p. 31 of Steven Roman's &quot;Introduction to the Mathematics of Finance Arbitrage and Option Pricing&quot; (Undergraduate Texts in Mathematics, 2012), giving the forward price of a forward contract.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/GYcwT.png&quot; alt=&quot;The forward price of a forward contract&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The theorem is a conditional: IF the market is perfect and has no arbitrage AND IF $F$ is a forward contract in this market, THEN the forward price of $F$ is $F_{0, T} = S_0e^{rT}$. However, the theorem says nothing about the existence of such a market. Which brings me to the following questions.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Does a perfect market with no arbitrage exists (mathematically), in which a forward contract is defined?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is it possible to define a forward contract in any given perfect market with no arbitrage without changing the market's properties of being perfect and free of arbitrage, regardless of what other financial instruments are already defined in it? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="15619" LastActivityDate="2015-03-15T11:15:05.463" Title="On the existence of a perfect market with no arbitrage that contains a forward contract" Tags="&lt;no-arbitrage-theory&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16958" PostTypeId="1" CreationDate="2015-03-13T18:38:14.013" Score="2" ViewCount="535" Body="&lt;p&gt;What is the common criteria used to count a quote or trade in reference to the quote/trade ratio?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Criteria:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;If it beats the best bid or offer.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If it adds size to the best bid or offer.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What if the best bid or offer is removed?  Does this count or not?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;There may be some other criteria I am missing - please do include them if you find one.&lt;/p&gt;&#xA;" OwnerUserId="7256" LastEditorUserId="2299" LastEditDate="2015-03-16T22:02:24.003" LastActivityDate="2015-06-14T23:13:55.650" Title="Determination of Quote / Trade Ratio" Tags="&lt;market-data&gt;&lt;high-frequency&gt;&lt;market-microstructure&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16959" PostTypeId="2" ParentId="16954" CreationDate="2015-03-13T18:52:37.880" Score="1" Body="&lt;p&gt;FPGA's are used to run the latency sensitive HFT strategies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They can also be used solely for parsing whatever protocol is in use (FIX, ITCH, etc..) and routing the decoded objects to a CPU for number crunching.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They can of course be used for anything else but these two uses are what is most common now.&lt;/p&gt;&#xA;" OwnerUserId="7256" LastActivityDate="2015-03-13T18:52:37.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16960" PostTypeId="1" CreationDate="2015-03-13T18:54:46.137" Score="1" ViewCount="1113" Body="&lt;p&gt;When evaluating the performance of an algorithm, what should hold more importance? Sharpe Ratio , Net profit or max drawdown?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, I have two algorithms one performs very good on Stocks with high rate of return like AAPL, FB but the second one that predominantly gives low profit but slightly higher sharpe ratio in general seems to outperform the first one on stocks like INTC , AAMC , IBM. What should I infer from this?&lt;/p&gt;&#xA;" OwnerUserId="15624" LastActivityDate="2015-03-17T03:22:18.270" Title="Sharpe Ratio vs Net Profit vs max drawdown" Tags="&lt;algorithmic-trading&gt;&lt;sharpe-ratio&gt;&lt;maximum-drawdown&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16961" PostTypeId="1" AcceptedAnswerId="16980" CreationDate="2015-03-13T19:36:01.497" Score="1" ViewCount="789" Body="&lt;p&gt;Suppose you have a lease agreement where the functional/domestic currency is RUB and the currency on which the lease is written USD.  Let $S$ be the USD/RUB exchange rate (# of rubles per 1 dollar).  The lessee pays $NS_{t}$ RUB at each time $t$ the lease payment is due, where $N$ is some fixed amounts in USD.  This exposure to $S_{t}$ creates an embedded derivative which must be &quot;bifurcated&quot; and valued separately on the lessee's balance sheet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The derivative can be viewed as a short position on a USD/RUB forward contract (sell USD, buy RUB), where the strike is determined by the forward rate curve at inception of the lease agreement.  This is straight-forward to value periodically on future dates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now suppose this agreement also has a floor $\underline{S}$ and a cap $\overline{S}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The cap is an asset to the lessee, since it limits the downside associated with a weakening RUB, while the floor is a liability since it limits the upside gain associated with a strengthening RUB.  In other words, in terms of embedded derivatives, the cap is a long position in a USD/RUB call option struck at $\overline{S}$ and the floor is a short position in a USD/RUB put option struck at $\underline{S}.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question is this:&lt;/strong&gt;  Should we value this embedded derivative as the sum of the values of the cap + floor + FX forward?  This seems logical, and what you would do if this arrangement was an actual OTC derivative contract.  However, being that this is an embedded derivative, is it appropriate to value the optionality features like they were options?  Something keeps nagging at me as if including the time-value of the optionality features is inappropriate - that only the intrinsic value is what is important in this case.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $L$ be the lease agreement, $D$ the embedded derivative, and $B$ the bifurcated lease payoffs at time $t$, $K$ the strike for the time $t$ cash flow as determined from the forward curve at time $t=0$ (inception).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then $L=D+B$ and we assume the USD notional is $N=1$ for convenience.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The terms of the lease agreement imply&#xA;$$L=\left\{\begin{array}{ll}-\overline{S},&amp;amp;S_{t}&amp;gt;\overline{S}\\-S_{t},&amp;amp;\underline{S}\leq S_{t}\leq\overline{S}\\-\underline{S},&amp;amp;S_{t}&amp;lt;\underline{S}.\end{array}\right.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make $B$ riskless, we simply put&#xA;$$B:=-K.$$&#xA;Then,&#xA;$$D=L-B=\left\{\begin{array}{ll}K-\overline{S},&amp;amp;S_{t}&amp;gt;\overline{S}\\K-S_{t},&amp;amp;\underline{S}\leq S_{t}\leq\overline{S}\\K-\underline{S},&amp;amp;S_{t}&amp;lt;\underline{S}.\end{array}\right.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But one verifies that then&#xA;$$D=\max(S_{t}-\overline{S},0)-\max(\underline{S}-S_{t},0)-(S_{t}-K)=C-P-F$$&#xA;where $C$ is an $\overline{S}$ struck USD/RUB call, $P$ is an $\underline{S}$ struck USD/RUB put, and $F$ is a $K$ struck USD/RUB.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think this analysis answers my question in the affirmative.&lt;/p&gt;&#xA;" OwnerUserId="8230" LastEditorUserId="8230" LastEditDate="2015-03-16T02:11:10.777" LastActivityDate="2015-03-16T02:11:10.777" Title="Lease Accounting / FX Embedded Derivatives: How to Value Floor / Cap Optionality Features" Tags="&lt;fx&gt;&lt;derivatives&gt;&lt;valuation&gt;&lt;embedded-options&gt;&lt;accounting&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16962" PostTypeId="1" CreationDate="2015-03-13T19:44:53.800" Score="5" ViewCount="762" Body="&lt;p&gt;I am looking for a book which teaches mathematical topics which are relevant to master quantitative finance and statistics. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please note, I do not mean a book which would explain how math is applied to solve problems in quantitative finance and statistics but rather a book which would teach mathematical toolkit (linear algebra, set theory, probability, stochastic calculus, measure theory, etc.) needed to further understand math applications in the above mentioned fields. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One example is this &lt;a href=&quot;http://mitpress.mit.edu/books/introduction-quantitative-finance&quot; rel=&quot;nofollow&quot;&gt;book&lt;/a&gt;, but I need more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The book should:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;cover only those topics in math which are relevant for quant finance ans statistics;&lt;/li&gt;&#xA;&lt;li&gt;be self-contained or make clear what previous knowledge of math it relies upon;&lt;/li&gt;&#xA;&lt;li&gt;rigorous (no &quot;just believe that it is true&quot; or &quot;we present an intuition instead of a proof&quot;);&lt;/li&gt;&#xA;&lt;li&gt;provide exercises with available solutions;&lt;/li&gt;&#xA;&lt;li&gt;be a series mathematical book (proofs are must).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thanks! &lt;/p&gt;&#xA;" OwnerUserId="15126" LastEditorUserId="12" LastEditDate="2015-03-15T16:27:14.137" LastActivityDate="2015-03-15T17:43:35.560" Title="Book recommendation: math toolkit for quantitative finance and statistics" Tags="&lt;mathematics&gt;&lt;reference-request&gt;&lt;books&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16964" PostTypeId="2" ParentId="16956" CreationDate="2015-03-14T00:31:47.800" Score="0" Body="&lt;p&gt;There are two good tools in R project: Systematic Investor Toolbox and fPortfolio package. &lt;/p&gt;&#xA;" OwnerUserId="6535" LastActivityDate="2015-03-14T00:31:47.800" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16965" PostTypeId="2" ParentId="16951" CreationDate="2015-03-14T01:53:29.883" Score="14" Body="&lt;p&gt;Heston gives an expression for the characteristic function, from which option prices can be computed. Therefore it can be calibrated (statically) on a set of vanilla option prices with different strikes and maturities. Hence this produces risk neutral parameters that can be used to price other more exotic products. However, it is a pain to estimate the physical measure parameters using time series of the underlying. Hence not popular for econometric applications, used e.g. for risk analytics. This is because volatility is latent (not directly observable) and has to be filtered out. Also it is set in continuous time.&lt;/p&gt;&#xA;&lt;p&gt;GARCH is roughly the opposite. It gives a nice variance recursion that facilitates maximum likelihood estimation, based on historical time series. It captures historical volatility fluctuations nicely. Hence estimates are under the actual (physical) probability measure, and this makes it popular for risk applications. Not useful option pricing formulas, as it is set in discrete time therefore no-arbitrage arguments not applicable. Therefore not really used for calibration to options in a static way, like Heston.&lt;/p&gt;&#xA;&lt;p&gt;This is a high level view that covers the industry practice. For every sentence above, one can raise her hand and shout &amp;quot;there is this and that paper that do it&amp;quot;.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="19645" LastEditDate="2021-01-21T10:51:43.383" LastActivityDate="2021-01-21T10:51:43.383" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="16966" PostTypeId="2" ParentId="16956" CreationDate="2015-03-14T01:56:20.480" Score="2" Body="&lt;p&gt;PerformanceAnalytics in R and PortfolioAnalytics in R&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a tutorial from UW &lt;a href=&quot;http://faculty.washington.edu/ezivot/econ424/portfolioFunctionsPowerPoint.pdf&quot; rel=&quot;nofollow&quot;&gt;http://faculty.washington.edu/ezivot/econ424/portfolioFunctionsPowerPoint.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2154" LastActivityDate="2015-03-14T01:56:20.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16967" PostTypeId="2" ParentId="16898" CreationDate="2015-03-14T01:59:42.407" Score="3" Body="&lt;p&gt;Loosely speaking:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Local volatility is the instantaneous volatility after time T if the spot is S at that time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Implied volatility is the expected integrated volatility from today up to time T if the spot ends up at S at that time.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2015-03-14T01:59:42.407" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16968" PostTypeId="2" ParentId="16650" CreationDate="2015-03-14T06:32:55.100" Score="0" Body="&lt;p&gt;Statistics is about comparing like with like to come up with a conclusion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First thing in any analysis is to demean the data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After demeaning, absolute VaR may still be less than the mean return, but if the mean is a fat risk premium which you might not achieve - that can be serious also.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly, VaR figures are only as good as their backtest. If they don't come with a pvalue, they're worthleworthless. Whether positive or negative.&lt;/p&gt;&#xA;" OwnerUserId="7682" LastActivityDate="2015-03-14T06:32:55.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16969" PostTypeId="2" ParentId="16960" CreationDate="2015-03-14T11:02:19.320" Score="1" Body="&lt;p&gt;Sharpe ratio alone is not, IMHO, a great measure. It measures the slope of a line to the Riskfree rate in a mean-stdev plot. If leverage were free and unlimited, then Sharpes would count more. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many traders look at Sortino ratios (looking specifically at downside stdev), or Calmar ratios (excess return/max drawdown), as more reasonable measures of an algorithm's performance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since leverage is limited, none of these ratios replaces looking at actual returns. If the Sharpe is 3 but the returns are 0.01bp per day, it is likely to remain a completely theoretical excercise. &lt;/p&gt;&#xA;" OwnerUserId="15602" LastActivityDate="2015-03-14T11:02:19.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16970" PostTypeId="2" ParentId="16942" CreationDate="2015-03-14T11:24:12.173" Score="9" Body="&lt;p&gt;There are a few things to consider:&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Price&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;On average Thomson Reuters is known to be less costly than Bloomberg. One thing to consider when looking to save money is that most vendors will use some kind of ladder pricing. So if you cannot get rid of either Bloomberg or Thomson Reuters completely then you may not save as much as you expected.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Technology&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Thomson Reuters is really big on feeds while Bloomberg is not. Bloomberg's main business is selling terminals with very little footprint in the feeds business, afaik. If you are happy that your-terminal-app-is-your-feed then this will not matter to you. To be fair Bloomberg does sell something called BPipe which is the competitor to the Thomson Reuters consolidated feed, known as Elektron Real Time, previously known as RDF. Most banks I know will have a Thomson Reuters feed, very few banks will have a BPipe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are building something for yourself or you are not too concerned with latency and not worried about not receiving every tick then all of this may be irrelevant to you. If- on the other hand - you are building something that will be used by several users in your organization and you do not want a solution that requires each user to be a subscriber to the vendor's terminal application, then you'll need a true feed solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From my experience most small shops will be happy with the infra that the vendor's terminal application gives them. There are lots of in-house solutions out there that's been build around the vendor's terminal application as opposed to around a true feed. As long as you realize what that means I don't think this is a problem per se.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Quality and accuracy of prices&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;As far as stuff that's traded on a market place (i.e. an ECN or an exchange) then there's no difference between what you get from Bloomberg and Reuters except that they may have conflated the stream for you so that your are essentially not guaranteed to receive every tick. Again a true feed solution is better than a solution where you take the price off a terminal infrastructure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For stuff that's essentially OTC you should act with more caution. Bloomberg is really big on fixed income instruments which means that sometimes they sit on pricing data that's just not available from anyone else simply because the data is 'born' in the Bloomberg network. I think this is getting less so over time as fixed income liquidity these days does tend to get more concentrated on ECNs rather than on one-to-one closed environments (i.e. old style OTC). It all depends on which types of bonds we are talking about.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;ISIN download information&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;By this I suppose you mean information that will allow you to map from an ISIN code to the vendor's instrument naming scheme (known as BSyms/BBGIDs for Bloomberg and RICs for Reuters) ?  Firstly I hope you realize that this is a one-to-many mapping, not a one-to-one mapping. ISINs represent a unique identification of a financial (securitized) instrument while BSyms and RICs represent a financial instrument on a given 'market'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both Bloomberg and Thomson Reuters provide services that will allow you get hold of such mapping information. Of course such a feature is available in their respective terminal applications (i.e. BB Terminal and TR Eikon) but I'm assuming you are asking for such a service &lt;em&gt;outside&lt;/em&gt; of the terminal realm ? Both vendors provide such service independent of their terminal apps but they will make you pay for it, afaik.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Other alternatives&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;There are a few other vendors out there of what is known as &lt;em&gt;consolidated feeds&lt;/em&gt;. Probably fair to say that of those vendors with a global reach &lt;a href=&quot;http://www.interactivedata.com/products-services/real-time-market-data/index&quot; rel=&quot;noreferrer&quot;&gt;Interactive&lt;/a&gt; is #3 in this space. There are regional vendors as well, e.g. vendors specializing in the North American market only, etc. These alternative vendors very much so compete on price with the &quot;the big two&quot;, i.e. Bloomberg and TR, so you can get a good deal with them. From my experience the cost reductions are however minimal because many organizations will not be able to get totally rid of &quot;the big two&quot; and then you suddenly end up with 3 solutions in your org, rather than one or two.  &lt;a href=&quot;http://en.wiktionary.org/wiki/your_mileage_may_vary&quot; rel=&quot;noreferrer&quot;&gt;YMMV&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="15628" LastActivityDate="2015-03-14T11:24:12.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16971" PostTypeId="2" ParentId="10838" CreationDate="2015-03-14T11:37:07.843" Score="0" Body="&lt;p&gt;I would think the reason is you are comparing apples and oranges.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With your described Bloomberg solution your are just ripping prices off a terminal application. Bloomberg's Terminal application is - AFAIK - receiving a &lt;em&gt;conflated&lt;/em&gt; stream of prices. To most users this is actually a good solution as their workstation would otherwise get overloaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You then compare this with something you got off an RDF. The RDF is a true feed and it will give you every tick in the market*.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a one-to-one comparison you would need to compare prices from a RDF (Thomson Reuters) with prices from a BPipe (which is the name for Bloomberg's full tick feed).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;*) There's an exception around OPRA but we are talking LSE here, right?&lt;/p&gt;&#xA;" OwnerUserId="15628" LastActivityDate="2015-03-14T11:37:07.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16972" PostTypeId="1" AcceptedAnswerId="16984" CreationDate="2015-03-14T12:16:11.613" Score="2" ViewCount="278" Body="&lt;p&gt;I recently appeared in an interview for a quant research post in a trading company. As part of the interview, I was given a home-task to solve in a week. The inerviewer gave me a dataset consisting of high-frequency price, volume data for five stocks over a duration of four months and asked me to forecast volatilities of these stocks for the next month. I used a Bayesian multivariate stochastic volatility model for this purpose. My application was rejected one day after I submitted the results. The method that I used is an extension of the Philipov's Wishart autoregressive model and currently I am preparing a manuscript based on this method for publishing in a quantitative finance journal. I think it was the way I presented the method and the results that led to my rejection. Is there a format for writing these type of reports? Does anyone have an example of such report? Any help in this matter will be much appreciated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(P.S. I am an experienced statistician with a PhD in statistical machine learning and 5 years work experience, but I am completely new to quantitative finance, so please forgive me if I sound too stupid in this post)&lt;/p&gt;&#xA;" OwnerUserId="15629" LastActivityDate="2015-03-16T09:36:20.267" Title="How to write a home task report which is part of the interview process for a quant position in a trading firm" Tags="&lt;volatility&gt;&lt;forecasting&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16973" PostTypeId="1" AcceptedAnswerId="16983" CreationDate="2015-03-14T18:55:26.903" Score="2" ViewCount="477" Body="&lt;p&gt;Can someone provide me with a robust way of calculating the future time value of an option or point in the direction? I have been reading a lot about the factors that affect it and about betas and deltas but i am yet to come upon a reliable way of calculating the future time value of an option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: not asking for a prediction model, but something that could hint towards or give a range  under certain constrains.&lt;/p&gt;&#xA;" OwnerUserId="15630" LastActivityDate="2015-03-15T14:03:56.413" Title="Calculating time value of an option" Tags="&lt;options&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="16974" PostTypeId="2" ParentId="15764" CreationDate="2015-03-14T21:46:10.680" Score="2" Body="&lt;p&gt;This is my experience (I am heading the Risk Analytics team for an investment bank in the City):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We only ever bought the Optimization and Statistics toolboxes. You are better off writing any extra functionality yourself. Most of the stuff is simple, and writing it yourself improves your understanding and highlights potential pitfalls.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having said that, we recently abandonded Matlab and we have moved to Python. Not only free, but also makes it easy for us to share working code and prototypes with FO Quants and FO/Risk IT. But the points stand: using numpy, scipy and pandas you can build high quality libraries yourself. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is something you might want to keep in mind. My understanding is that there is a general drive to integrate systems, and establishing a common language that IT understand is a strategic decision.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2015-03-14T21:46:10.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16975" PostTypeId="1" AcceptedAnswerId="17009" CreationDate="2015-03-15T00:53:09.817" Score="6" ViewCount="387" Body="&lt;p&gt;Is there a closed form solution of the following price formula? Assuming $dS_t=rSdt+\sigma S_t dW_t$ under the Q dynamics&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$e^{-r(T-t)}\mathbb{E}_t^\mathcal{Q}[(\frac{(\int_0^T S_u du)}{T})^2]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that the integral of a geometric brownian motion has no nice distribution, but is it the same with the square of the integral?&lt;/p&gt;&#xA;" OwnerUserId="15631" LastEditorUserId="15631" LastEditDate="2015-03-17T23:03:19.050" LastActivityDate="2015-03-17T23:03:19.050" Title="Price of an asian option with squared of average payoff" Tags="&lt;option-pricing&gt;&lt;derivatives&gt;&lt;asian-option&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16976" PostTypeId="1" CreationDate="2015-03-15T03:21:19.853" Score="0" ViewCount="254" Body="&lt;p&gt;When people say &quot;yield curve&quot;, do they mean yield/time curve, or yield/price curve?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that most of the time, people refer to yield/time curve, as &lt;a href=&quot;http://en.wikipedia.org/wiki/Yield_curve&quot; rel=&quot;nofollow&quot;&gt;wikipedia suggests&lt;/a&gt;. Though sometimes, people seem to use this term referring to yield/price curve, often when talking about the convexity, like here in &lt;a href=&quot;http://www.investopedia.com/terms/n/negative_convexity.asp&quot; rel=&quot;nofollow&quot;&gt;investopedia&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the right definition?&lt;/p&gt;&#xA;" OwnerUserId="2576" LastActivityDate="2015-04-14T10:54:44.843" Title="Basic questions on the yield curve" Tags="&lt;yield-curve&gt;&lt;bond-yields&gt;&lt;yield&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16977" PostTypeId="1" CreationDate="2015-03-15T03:33:39.987" Score="1" ViewCount="90" Body="&lt;p&gt;I am looking for a (free) list of hedgefunds with their strategies. I have found Barron's top 100 online but am having trouble finding a longer list. Any ideas of where to look?&lt;/p&gt;&#xA;" OwnerUserId="15634" LastActivityDate="2015-03-16T14:57:20.947" Title="Anyone know where I could find a free list of hedgefunds and their strategies...?" Tags="&lt;research&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16978" PostTypeId="2" ParentId="16976" CreationDate="2015-03-15T10:37:06.403" Score="1" Body="&lt;p&gt;Usually yield/time is the standard context for definition of a yield curve, with yields being derived from prices (of interest rate instruments) for certain maturities (times). &#xA;The investopedia article you are referencing is all about the yield/price connection (since duration  and convexity represent first and second order &quot;price&quot; sensitivity measures to &quot;rate&quot; changes) - so that is why you shouldn't view that article as the default context for yield curve lingo.     &lt;/p&gt;&#xA;" OwnerUserId="2683" LastActivityDate="2015-03-15T10:37:06.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16979" PostTypeId="2" ParentId="16962" CreationDate="2015-03-15T10:50:03.977" Score="4" Body="&lt;p&gt;I would recommend the books from Steven Shreve. &#xA;Here is a link to some one of his older online pdf's (1997 but nevertheless true) so you can check if that fits the bill. &#xA;&lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.137.6951&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow&quot;&gt;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.137.6951&amp;amp;rep=rep1&amp;amp;type=pdf&lt;/a&gt;  &lt;/p&gt;&#xA;" OwnerUserId="2683" LastActivityDate="2015-03-15T10:50:03.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16980" PostTypeId="2" ParentId="16961" CreationDate="2015-03-15T11:05:27.100" Score="1" Body="&lt;p&gt;Don't look at the structure as consisting of 3 parts (i.e. a forward plus a cap plus a floor) look at it as 2 options one bought with the Floor as Strike1 and one sold with the Cap as Strike2. That way the time value changes of bought and sold option should offset - which by the way they will already do right now even wit the forward since that does not have time value. &#xA;Additionally structuring the valuation the way you describe above would expose you to a flaw because as long as you move between the two strikes the bought option and the forward position would double up. &#xA;So coming to your question: you should model the transactions like a bull spread (&lt;a href=&quot;http://en.wikipedia.org/wiki/Bull_spread#/media/File:BullSpreadCalls.jpg&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Bull_spread#/media/File:BullSpreadCalls.jpg&lt;/a&gt;) and not as a bull spread in combination with a forward.    &lt;/p&gt;&#xA;" OwnerUserId="2683" LastActivityDate="2015-03-15T11:05:27.100" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="16981" PostTypeId="2" ParentId="16957" CreationDate="2015-03-15T11:15:05.463" Score="1" Body="&lt;p&gt;You should dive into: &#xA;Fundamental Theorem of Asset Pricing: If there is a risk-neutral measure, then there is no arbitrage. This then drives the existence of arbitrage, market perfection and replication by which one instrument (here S) is the basis for the price of another (here F).    &lt;/p&gt;&#xA;" OwnerUserId="2683" LastActivityDate="2015-03-15T11:15:05.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16982" PostTypeId="2" ParentId="16973" CreationDate="2015-03-15T11:58:20.937" Score="0" Body="&lt;p&gt;Whatever pricing model you use you will almost always have the time to maturity as an input somewhere, agree? &#xA;So if you have an option with a current time to maturity of e.g. 1 year, in order to get the time value in e.g. 6 months from now; you pretty much just run the pricing with time to maturity of 6 months as an input. No rocket science necessary there. &#xA;A more elegant way to calculate any of the greeks would always be to fix all the other parameters and move the one parameter of interest by e.g. +1 and -1 (be it price, be it time, be it vola), run the full pricing again and then take the average of these (two) pricing results =&gt; voila - discrete greeks. Basically the only method to get there if you are using simulations.   &lt;/p&gt;&#xA;" OwnerUserId="2683" LastActivityDate="2015-03-15T11:58:20.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16983" PostTypeId="2" ParentId="16973" CreationDate="2015-03-15T14:03:56.413" Score="0" Body="&lt;p&gt;There are a few careers dedicated to identifying better ways to compute the value of various sets of option contract terms under different assumptions. If beta is a Greek letter that comes to mind when, you could probably still get something out of the Wikipedia article on Black-Scholes. Branch from there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to move toward applications I would recommend the general treatments Espen Haugs - The Complete Guide to Option Price Formulas - if you want some calculators. It covers enough variations of numerical methods and terms that you could really use that material as inspiration for valuing many types of uncertain payoff. Paul Wilmott Introduces Quantitative Finance can help you build up some more mathematical intuition about option valuation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's not one good way. It's more of a field where designing a way for the particular situation is a liberal art and takes a lot of practice.&lt;/p&gt;&#xA;" OwnerUserId="15529" LastActivityDate="2015-03-15T14:03:56.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16984" PostTypeId="2" ParentId="16972" CreationDate="2015-03-15T14:24:00.983" Score="2" Body="&lt;p&gt;You sound like a good candidate for many roles in finance who probably has experience with some reasonable approaches to presentation. If your intuition is that you made some sub-optimal choices in the case of this assignment then you probably did, so try to get more specific about that and identify precisely where you believe you went wrong. On the other hand, you don't have to assume that your submission was really the deciding factor. What if they were also discussing the position with someone who had similar credentials, plus some big Bridge tournament wins, and the decision maker happens to believe that Bridge teaches everything about good decision making?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's no agreement about appropriate presentation format. Always make it as clear and accessible as possible. You get more latitude on that point if you know your submission will be reviewed by someone who has academic credentials in your field. If it comes up again then you might ask the interviewer some questions about format and assess what would be ideal in the situation.&lt;/p&gt;&#xA;" OwnerUserId="15529" LastEditorUserId="15529" LastEditDate="2015-03-15T15:13:57.123" LastActivityDate="2015-03-15T15:13:57.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16985" PostTypeId="2" ParentId="16927" CreationDate="2015-03-15T15:11:38.257" Score="1" Body="&lt;p&gt;Every match that hits the tape from the perspective of displayed ECNs is a market order matched with a limit order. You can think of this in terms of makers and takers. If I want to buy MSFT at 51.00 and post a limit for that price 3 microseconds before you post your limit to sell at 51.00 then I am the maker and you are the taker. And your sell order will be treated as a market order unless you used some instruction that would only allow it to execute on the passive side. In that case you would wait until my order fills and someone else comes to buy at 51.00.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not accounting for all of the routes and order options selected in user (or user's robot) land, because the piece that becomes visible to the ECN matching engine and gets the fill is either a limit or market order and will match against the other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This alone would make limit orders half of the equation and that's an important level. But if I know that when I route to a particular venue there are more likely to be orders at the prices I want (they have more liquidity) then I will choose to route there more often. This is a self-reinforcing effect for liquidity, where limits want to rest there because more takers will come there and more makers come to match with more takers, etcetera. Market orders (takers) are the benefit. They're not the anchor orders of this virtuous cycle. That's why the earlier models and more popular models of maker-taker ECNs pay rebates to resting liquidity / makers (limit orders) and charge fees to takers (market orders, including marketable limits).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Matching regulations (Reg NMS - 611) are intended to change some of the analysis in the last paragraph, because the matching engines have to look at multiple venues for resting liquidity (limit orders) and match against the best prices. I think it would go to the edges of question scope to consider how business models change when shop owners have to route customers to competitors with better prices, but I could justify a place for it in a comprehensive answer. I'm leaving it alone mostly, because it's an evolving area of research where I presently only have glimmers of insight.&lt;/p&gt;&#xA;" OwnerUserId="15529" LastActivityDate="2015-03-15T15:11:38.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16986" PostTypeId="1" CreationDate="2015-03-15T17:40:10.180" Score="14" ViewCount="554" Body="&lt;p&gt;I have been thinking very hard about properly pricing volatility. Outside of naive AR,ARCH,GARCH forecasting model which employs past data to forecast future vol, how does one &quot;fundamentally&quot; value volatility??? The key word here is &lt;strong&gt;&quot;fundamentally&quot;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other worlds of insurance (health insurance, car insurance,  etc.) a competent underwriter can look historically at one's driving record, health record, (past data in other words) to determine one's P(claim) &amp;amp; loss given claim and the entire pool's P(claim) and expected losses to determine a &quot;fair&quot; value to tack on for taking that risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So here is my question, how does one determine fundamental &quot;fair value&quot; for volatility of volatile securities (such as equity indicies, crude oil, gold, bonds, etc) in order to assess whether vol is rich or cheap? You might say, one starting point is to look at the past and use historical vol, however I have found this to be extremely unhelpful. The past needs to be discounted heavily in financial insurance unlike other insurance products and is a poor measure of the future. The only times I have found the imp vol to historical vol useful is in the rare occasions when historical vol exceed peoples volatility expectations which then underwriters adjusted volatility expectations upward. But this is rare and ~80% of the time implied vol is higher than historical. Black swans are as rare as they come -- you can sit there patiently waiting for one and by the time you give up on one coming is when it finally happens. Hence it's not a feasible strategy. So if we can't use historical vol what can we use to get a general idea of whether vol is rich or cheap?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I painfully ask this question because I recently learned the hard way, high implied volatility doesn't mean rich volatility. I sold vol on oil over the last several months only to get burned bad. Rising volatility &lt;strong&gt;DOESN'T&lt;/strong&gt; mean rich volatility!! WTI with a vol at 20 two years ago can fundamentally have had a richer vol when it was at at a significantly lower level than than when its vol shot to 60 in the last couple of weeks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would appreciate any good words of help, guidance on the issue. Any past published research work on the topic you have either worked on or seen would be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="15641" LastEditorUserId="15641" LastEditDate="2015-03-15T21:31:13.503" LastActivityDate="2015-04-23T05:56:08.727" Title="Rich Volatility, Poor Volatility" Tags="&lt;implied-volatility&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="16987" PostTypeId="2" ParentId="16962" CreationDate="2015-03-15T17:43:35.560" Score="6" Body="&lt;p&gt;All the topics you've mentioned are wonderful and shouldn't be eschewed by reading some finance-oriented review book. I recommend these instead.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Linear algebra: &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0135367972&quot; rel=&quot;noreferrer&quot;&gt;Hoffman and Kunze&lt;/a&gt; and &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1258812584&quot; rel=&quot;noreferrer&quot;&gt;Halmos&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Set theory: &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1614271313&quot; rel=&quot;noreferrer&quot;&gt;Halmos&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Measure theory: &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/007054235X&quot; rel=&quot;noreferrer&quot;&gt;Rudin&lt;/a&gt; and &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0821869191&quot; rel=&quot;noreferrer&quot;&gt;Tao&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2015-03-15T17:43:35.560" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16988" PostTypeId="2" ParentId="16960" CreationDate="2015-03-15T23:54:29.370" Score="0" Body="&lt;p&gt;RE: Sharpe Ratio , Net profit or max drawdown?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Definitely not Net profit. It is primitive and suspected to luck or spurious results. To make a choice from the rest of two we need additional information about the risk management - position sizing. Assuming we do not have that info - i would choose Max drawdown, loosing all money is not an option.&lt;/p&gt;&#xA;" OwnerUserId="2297" LastActivityDate="2015-03-15T23:54:29.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16989" PostTypeId="2" ParentId="16972" CreationDate="2015-03-16T09:30:43.947" Score="1" Body="&lt;p&gt;I've been heavily in the decision process of rejecting interview candidates at my firm. We have certainly come across PhD candidates who failed sheerly based on the poor quality of their presentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The application process is an art. It's a crapshoot. Even to your recruiters. Sometimes we already have a hypothesis against the candidate's favor by the time we offer him/her a chance to work on a 1 week take-home project. For example, a candidate sounds wonderful on paper (statistics PhD, list of programming proficiencies), but spams us with a list of 30 'papers' on his resume which are really just a mix of reports, undergraduate theses, technical white papers, meta-surveys of the field and conference summaries.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At this stage we already suspect he/she is the type to take credit for anything and don't really want to work with such a person, but nevertheless choose to administer a take-home test. Why? Because the marginal cost of administering a take-home test is nearly zero, but it gives us a chance to confirm the flaw we're rejecting him/her for. Perhaps his/her paper ends up with a working model for the problem, but say the tone of the conclusion suggests a much more important result than he/she has proven, it's already enough reason to reject the candidate because we have a vague confirmation of our earlier hypothesis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Don't hold it against your recruiters. False positives are much more costly to the firm than false negatives and most firms that have spent &gt;2 years' time at this would have come to the same conclusion that they would much rather hire a less skilled candidate who is less likely to give them interpersonal drama in the office.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's the classic noise and signal problem. Basically, so much can happen behind the scenes (noise) that it's not possible for us to speculate based on your post. Your recruiters don't want to give any reasons for rejection that may be misconstrued or misrepresented as an unlawful, discriminatory action in court, so there's plenty of ambiguity (weak signal). The best you can do is to ask their HR rep nicely for some feedback.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for examples of acceptable presentation skill, I imagine a &lt;a href=&quot;http://www.math.ucla.edu/~lvese/MCM_ICM/&quot; rel=&quot;nofollow&quot;&gt;MCM quality solution&lt;/a&gt; would have been sufficient for a 1 week take-home. (This is also why firms such as Jane Street and Two Sigma particularly respect candidates who have performed well at the MCM.)&lt;/p&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="4660" LastEditDate="2015-03-16T09:36:20.267" LastActivityDate="2015-03-16T09:36:20.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16990" PostTypeId="1" CreationDate="2015-03-16T11:49:33.883" Score="2" ViewCount="303" Body="&lt;p&gt;I am graduating with a BS in math and obviously love math but everything changed when a buddy of mine invited me to an investment society in our school  and I love every single experience. The part I love the most is when when we are researching companies to add to our groups portfolio. So what I am saying is, I found finance a lot more interesting ever since. I took the Canadian Security and I passed it on first try. I started the Investment Management Technique course(failed on my first attempt, but I'll redo it before it expires this year). I had the opportunity of interviewing for a quantitative investment position at a pension, nailed the interview overall but I was not called for a round 2. The experience(interview) was really good and I sent an email to to the interviewee as to how to improve my candidacy and she encouraged me to look into taking the CFA.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have already bought the schweser study note and I have the CFA curriculum from a year ago. I will register to take it in December because I want to get reimburse by my employer(a back-office firm) when I pass it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question is can anyone tell me how they found time to study given the fact they work so much hours. Also, I want to dedicate 20hrs a week to studying(done university in April), So I would like if people could direct me to website where they make study timetable or even better if you could share your timetable( bear in mind I have no finance background). Also, my plan is to study from schweser directly and use the CFA curriculum to complement and brush over some topics that schweser may not explain into details as well as do the practice questions the whole of November.&lt;/p&gt;&#xA;" OwnerUserId="15644" LastActivityDate="2015-03-16T11:49:33.883" Title="CFA (Level 1) schedule after school and working a 9-5 job" Tags="&lt;fixed-income&gt;&lt;finance&gt;" AnswerCount="0" CommentCount="2" ClosedDate="2015-03-16T12:50:38.893" ContentLicense="CC BY-SA 3.0" />
  <row Id="16991" PostTypeId="2" ParentId="549" CreationDate="2015-03-16T13:25:08.703" Score="2" Body="&lt;p&gt;Great question, I love to visualize data! A visualization is really the most efficient way to display a large amount of information to be processed by the human brain IMO. Depending on what exactly you are trying to plot and visualize, I would suggest trying the javascript API for WebGL called Three.js. Examples of Three.js are here: &lt;a href=&quot;http://threejs.org/examples/&quot; rel=&quot;nofollow&quot;&gt;http://threejs.org/examples/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I have created the following 3D Contour graphs with Three.js displaying a specific indicator (LPPL) for a time series here: &lt;a href=&quot;https://lpplmarketwatch.com/3d-contour-examples/&quot; rel=&quot;nofollow&quot;&gt;https://lpplmarketwatch.com/3d-contour-examples/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have brainstormed ways, unsuccessfully, to visualize the millions of traders interacting in a network - buying and selling, shorting, etc... It would be cool if anyone had any ideas on how to visualize a network with millions of nodes interacting in a trading exchange with Three.js -- perhaps with Bitcoin for a practical example, since I imagine most trade information is confidential or expensive.&lt;/p&gt;&#xA;" OwnerUserId="15615" LastEditorUserId="15615" LastEditDate="2015-03-16T13:32:22.177" LastActivityDate="2015-03-16T13:32:22.177" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16993" PostTypeId="2" ParentId="16977" CreationDate="2015-03-16T14:57:20.947" Score="1" Body="&lt;p&gt;BarclayHedge. Various levels of detail.&lt;/p&gt;&#xA;" OwnerUserId="13902" LastActivityDate="2015-03-16T14:57:20.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16994" PostTypeId="2" ParentId="16986" CreationDate="2015-03-16T15:43:26.190" Score="4" Body="&lt;p&gt;I think this extremely hard to do (to the point where I think that every hedge fund that trades vol should be avoided like the plague).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fundamental value of volatility would be a quantity that's related to the speed at which new news comes available to the market, the significance of news, the extent to which this news can be traded, general market sentiment and a host of other reasons. It is possible to do statistical analysis to the impact of certain types of news to moves in the underlying of course, but because vol is so opaque, even then it is very easy for out-of-sample performance to be horrible because some factor that was constant during your backtest, isn't anymore. Of course mileage various from market to market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Practical advice:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;if you can't spell out exactly why you have an edge trading vol, you shouldn't be doing it (for the money; if your goal is to learn about options b/c you want to land a job as a trader, that of course is different). If the best reason you can come up with &quot;it's been moving up so much in the past few weeks/months&quot;, think hard whether that's a reason to trade or to avoid trading.&lt;/li&gt;&#xA;&lt;li&gt;Know exactly what you're trading. If you are a retail investor and were trading something like options on USO, you're not exactly trading crude vol. Not saying you weren't trading crude vol, but based on the question I'm guessing you're likely to be a retail investor/trader.&lt;/li&gt;&#xA;&lt;li&gt;Have a long memory; I don't want to get too hung up on the crude vol example in your question (which is tempting since I actually do trade crude vol professionally), but looking back at 10 years of realized vol should have provided some indication that vol could go a lot higher (and if you think that &quot;this time it's different than in 2008&quot;, you again need to be able to spell out the exact why of that mentioned under #1).&lt;/li&gt;&#xA;&lt;li&gt;I'm very quantitatively oriented. However, whenever I evaluate a vol trade that looks good just based on the numbers, I always try to think through what is going on in the market in general now as well, in order to get a feel of whether the numbers fit in with the general backdrop of the market in question.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="11851" LastActivityDate="2015-03-16T15:43:26.190" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="16995" PostTypeId="1" CreationDate="2015-03-16T15:54:40.930" Score="3" ViewCount="466" Body="&lt;p&gt;I want to ask a question with reference to a paper from below link &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cmpr.co.kr/asset/research_material/implementing_interest_rate_models.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.cmpr.co.kr/asset/research_material/implementing_interest_rate_models.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Minimization specified in Page 14: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mean reversion rate and diffusion comes out same for all tenors?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, can I state calibration is done to derive one &quot;mean reversion rate&quot; and diffusion for entire term structure ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="7422" LastEditorUserId="7422" LastEditDate="2015-03-16T16:45:37.590" LastActivityDate="2017-01-30T16:16:35.700" Title="Calibration of Hull White One factor model in F.C.Park paper" Tags="&lt;calibration&gt;&lt;hullwhite&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16996" PostTypeId="1" CreationDate="2015-03-16T18:24:11.737" Score="1" ViewCount="523" Body="&lt;p&gt;Consider a mean-variance investor in a world with a risk-free asset. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $R_f&amp;gt;0$ be the return of the risk-free asset, $\mathbb{E}(R_i)&amp;gt;R_f$ the expected return of the risky asset $i$ and $SD(R_i)$ the standard deviation of the return of the risky asset $i$ for $i=1,...,N$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $V$ be the variance-covariance matrix of the returns of all risky assets and $\bar{R}$ be their expectation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Returns of risky assets can be positively correlated but not perfectly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The weight of risky asset $i$ in the tangent portfolio is $x_i^\star=\frac{y_i}{\sum_{k=1}^N x_k}$ with $y_i=\{V^{-1}(\bar{R}-R_f)\}_{ii}$ if we allow for short sales. Hence, $x^\star_i$ can be &lt;strong&gt;strictly positive&lt;/strong&gt; or &lt;strong&gt;strictly negative&lt;/strong&gt; or &lt;strong&gt;zero&lt;/strong&gt; (right?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question: which are the weights of risky assets in the tangent portfolio if we do not allow for short sales? Are they all &lt;strong&gt;strictly&lt;/strong&gt; positive? If not, under which additional restrictions are they all &lt;strong&gt;strictly&lt;/strong&gt; positive?&lt;/p&gt;&#xA;" OwnerUserId="15575" LastEditorUserId="15575" LastEditDate="2015-03-17T16:24:13.143" LastActivityDate="2015-03-17T16:24:13.143" Title="Tangent portfolio weights without short sales?" Tags="&lt;modern-portfolio-theory&gt;&lt;portfolio&gt;&lt;markowitz&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16997" PostTypeId="2" ParentId="16975" CreationDate="2015-03-16T20:44:04.970" Score="2" Body="&lt;p&gt;A few tips. First note that $e^{-rt}S_t$ is a martingale. So make it appear and then integrate by part to rewrite $\int S_u du$ as a stochastic integral. Finally use the Ito isometry property.&lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2015-03-16T20:44:04.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="16998" PostTypeId="2" ParentId="16958" CreationDate="2015-03-16T22:01:42.093" Score="1" Body="&lt;p&gt;First define a &lt;strong&gt;quote&lt;/strong&gt;: this is the bid and ask (price and volume). when any of them 4 change, it is said the quote changed. We all know what a trade is (nevertheless note if you send a liquidity consuming order of 100 on a queue made of 50+20+30, it generates 3 trades).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can play with statistics (like order-to-trade ratio, not quote-to-trade), on te &lt;a href=&quot;http://www.sec.gov/marketstructure/datavis/ma_overview.html#.VQdQmRCG-YU&quot; rel=&quot;nofollow noreferrer&quot;&gt;SEC's MIDAS web site&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/lXbqD.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example of QoT ratio over one day from the &lt;a href=&quot;http://www.nanex.net/research/MsgRates/EquityMessageRates.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;NANEX web site&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/jNRQW.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more on all these indicators and their meaning, have a look at &lt;a href=&quot;http://www.worldscientific.com/worldscibooks/10.1142/8967&quot; rel=&quot;nofollow noreferrer&quot;&gt;Market Microstructure in Practice&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2015-03-16T22:01:42.093" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="16999" PostTypeId="1" AcceptedAnswerId="17003" CreationDate="2015-03-16T22:59:12.327" Score="0" ViewCount="1264" Body="&lt;p&gt;I have a trading strategy that uses the Fama and French 3 Factor data. It's provided on &lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;French's website&lt;/a&gt; up until the previous month or so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And indeed, this is a great source of data. The only problem is: it is not real time (&lt;a href=&quot;https://quant.stackexchange.com/questions/15441/how-to-get-real-time-data-for-fama-french-model&quot;&gt;as previous posts have discussed&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously the market factor is easy to get a &lt;strong&gt;real time&lt;/strong&gt; proxy for (FTSE100 or the S&amp;amp;P500). &lt;strong&gt;What about the SMB and HML fators though?&lt;/strong&gt; Can someone tell me how I can get daily data for &lt;strong&gt;yesterday's&lt;/strong&gt; SMB and HML factors?&lt;/p&gt;&#xA;" OwnerUserId="6661" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2015-03-17T08:38:45.953" Title="Fama French 3 Factor Data" Tags="&lt;factor-models&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17000" PostTypeId="2" ParentId="16960" CreationDate="2015-03-17T03:22:18.270" Score="0" Body="&lt;p&gt;How does it perform on stocks according to the characteristics you would know at trade entry? For example, you're not really gaining insight if you recognize a momentum strategy worked well on stocks that had momentum characteristics during the trade. &#xA;But you might mean high beta or high volatility stocks. Without more detail I will say that some strategies are suited to particular instruments and it helps to recognize that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In some sense you need ALL of those measures, but you can go about measuring any way you like. I think something like Sortino works well if you had to pick just one. Just keep in mind that before it was the Sortino it was just a metric some guys used to supplement their intuition about strategy perdormance. I personally like to look at a histogram of daily returns more than anything else.&lt;/p&gt;&#xA;" OwnerUserId="15529" LastActivityDate="2015-03-17T03:22:18.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17002" PostTypeId="1" AcceptedAnswerId="17838" CreationDate="2015-03-17T08:28:43.057" Score="2" ViewCount="3271" Body="&lt;p&gt;I am trying to grasp QLNet (C# version of Quantlib, all the functions of Quantlib have the same name and work the same way, so if you just know Quantlib, you can still help me), especially for pricing bonds. So I dug into the official examples, downloaded in the same time than the QLNet dll. The example called &quot;Bonds&quot; prices three bond types : zero coupon, fixed coupon rate, and floating coupon rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the two last types, this example use two different yield curve : &#xA;- The first one called discountingTermStructure for the fixed rate bond, made up of zero coupon bonds for the short end and of bonds (I'm not sure here what these simple bonds are) for the long end&#xA;- The second one called forecastingTermStructure for the floating rate bond, made up of deposit for the short end and of swaps for the long end&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first question is why do they use different yield curve?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am also trying to return a yield from a bootstrapped yield curve. For example, if I build the yield curve with 3 ZC bonds of 3 months, 6 months and 1 year maturities, I want to get the interpolated yield at 9 months. How could I do that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks for your help&lt;/p&gt;&#xA;" OwnerUserId="15650" LastEditorUserId="15650" LastEditDate="2015-03-17T08:36:38.710" LastActivityDate="2015-05-17T16:29:44.773" Title="Bootstrap yield curve with QLNet / Quantlib" Tags="&lt;bond&gt;&lt;yield-curve&gt;&lt;quantlib&gt;&lt;bootstrapping&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17003" PostTypeId="2" ParentId="16999" CreationDate="2015-03-17T08:38:45.953" Score="3" Body="&lt;p&gt;Fama and French calculate the factors based on CRSP data. The fastest that CRSP data is updated is monthly which is why Ken French updates the data on his website at monthly intervals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you need daily updates, you would have to construct the 2x3 sort by ME and BE/ME yourself. French's website publishes the breakpoints (based on all NYSE stocks) for the portfolios. But as far as I know, he does not publish what the portfolio constituents are. For the SMB and HML factors, the portfolio sorts are formed at the end of June each year and held constant throughout the year. You can use CRSP and Compustat data (or any other source that gives you the market cap and book equity) to figure out which stock is member of which portfolio. &#xA;If you have access to the returns of all stocks listed on NYSE, AMEX, and NASDAQ at the end of each day, you can then construct the factor returns.&#xA;P.S.: There may be data vendors that sell the factor returns at a daily frequency, but I am unaware of them.&lt;/p&gt;&#xA;" OwnerUserId="7396" LastActivityDate="2015-03-17T08:38:45.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17004" PostTypeId="1" CreationDate="2015-03-17T16:30:28.863" Score="1" ViewCount="58" Body="&lt;p&gt;How does the answer to this question &lt;a href=&quot;https://quant.stackexchange.com/questions/16838/risk-minimization-by-investing-in-all-assets-with-positive-expected-return&quot;&gt;Risk minimization by investing in all assets with positive expected return&lt;/a&gt; change if assets can be positively correlated (but not perfectly) and short sales are not allowed?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What if instead short sales are allowed and assets are positively correlated?&lt;/p&gt;&#xA;" OwnerUserId="15575" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-03-19T16:40:36.157" Title="Investing in all assets with positive expected return and allowing for positive correlation" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio&gt;&lt;portfolio-optimization&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17005" PostTypeId="2" ParentId="16975" CreationDate="2015-03-17T17:23:08.933" Score="4" Body="&lt;p&gt;Yes it is known in closed form.  See &lt;a href=&quot;https://www.rocq.inria.fr/mathfi/Premia/free-version/doc/premia-doc/pdf_html/asian_doc/asian_doc.html&quot; rel=&quot;nofollow&quot;&gt;https://www.rocq.inria.fr/mathfi/Premia/free-version/doc/premia-doc/pdf_html/asian_doc/asian_doc.html&lt;/a&gt; section 5.1 which references an older Geman-Yor paper.  &lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2015-03-17T17:23:08.933" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17007" PostTypeId="1" CreationDate="2015-03-17T20:21:51.593" Score="4" ViewCount="221" Body="&lt;p&gt;I'm using various matrices to impute a fitted transition matrix for credit ratings by solving for a variable [S]. Essentially the idea is to determine a base matrix and stress matrix to compare to a single point of time [t1] to create a fitted transition matrix [t1 fitted]. With the data below, [t1 fitted] and [t1 variance] is derived from the following formula:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[t1 fitted] = (1-S)*[Base Matrix] + S*[Stress Matrix]&#xA;[t1 variance] = ([t1] - [t1 fitted])^2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to know how or a direction I can take to solve for this [S] variable where the sum of [t1 variance] is the lowest value. I'd appreciate any direction or solution (functions to use or sample code) as I am not too familiar with R functions/packages and simply recreating the approach as a challenge of the results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your time.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Solution from the sample data below where I derived it using Excel's Solver function by using the GRG Nonlinear method solving for the min value of [S]. (Excel document can be provided if necessary)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; [S]=41.8962055525792%&#xA; sum[t1 variance]=2.56220853052315%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;****************************** Base Matrix (t1-t4) ******************************&#xA;From/To:      AAA       AA        A      BBB       BB        B      CCC  Default&#xA;     AAA   91.90%    7.39%    0.72%    0.00%    0.00%    0.00%    0.00%    0.00%&#xA;      AA    1.13%   91.26%    7.09%    0.31%    0.21%    0.00%    0.00%    0.00%&#xA;       A    0.10%    2.56%   91.19%    5.33%    0.62%    0.21%    0.00%    0.00%&#xA;     BBB    0.00%    0.21%    5.36%   87.94%    5.46%    0.83%    0.10%    0.10%&#xA;      BB    0.00%    0.11%    0.43%    5.00%   85.12%    7.33%    0.43%    1.59%&#xA;       B    0.00%    0.11%    0.11%    0.54%    5.97%   82.19%    2.17%    8.90%&#xA;     CCC    0.00%    0.44%    0.44%    0.87%    2.51%    5.90%   67.80%   22.05%&#xA; Default    0.00%    0.00%    0.00%    0.00%    0.00%    0.00%    0.00%  100.00%&#xA;&#xA;******************************* Stress Matrix (t2) ******************************&#xA;From/To:      AAA       AA        A      BBB       BB        B      CCC  Default&#xA;     AAA   90.79%    8.29%    0.72%    0.10%    0.10%    0.00%    0.00%    0.00%&#xA;      AA    0.10%   91.22%    7.85%    0.62%    0.10%    0.10%    0.00%    0.00%&#xA;       A    0.92%    2.36%   90.04%    5.44%    0.72%    0.31%    0.10%    0.10%&#xA;     BBB    0.00%    0.32%    5.94%   86.95%    5.30%    1.17%    0.12%    0.21%&#xA;      BB    0.00%    0.11%    0.66%    7.69%   80.55%    8.79%    0.99%    1.21%&#xA;       B    0.00%    0.11%    0.23%    0.45%    6.47%   82.75%    4.09%    5.90%&#xA;     CCC    0.23%    0.00%    0.23%    1.25%    2.28%   12.86%   60.64%   22.53%&#xA; Default    0.00%    0.00%    0.00%    0.00%    0.00%    0.00%    0.00%  100.00%&#xA;&#xA;*********************************** t1 Matrix ***********************************&#xA;From/To:      AAA       AA        A      BBB       BB        B      CCC  Default&#xA;     AAA   94.16%    5.84%    0.00%    0.00%    0.00%    0.00%    0.00%    0.00%&#xA;      AA    4.56%   90.89%    4.34%    0.11%    0.00%    0.11%    0.00%    0.00%&#xA;       A    0.00%   10.10%   87.04%    2.67%    0.06%    0.00%    0.13%    0.00%&#xA;     BBB    0.00%    0.19%    7.42%   88.44%    3.67%    0.28%    0.00%    0.00%&#xA;      BB    0.00%    0.00%    0.19%    8.25%   83.49%    7.32%    0.75%    0.00%&#xA;       B    0.10%    0.00%    0.00%    0.20%    6.54%   83.71%    9.46%    0.00%&#xA;     CCC    0.00%    0.00%    0.00%    0.00%    0.00%    8.13%   68.62%   23.25%&#xA; Default    0.00%    0.00%    0.00%    0.00%    0.00%    0.00%    0.00%  100.00%&#xA;&#xA;******************************** t1 Fitted Matrix *******************************&#xA;From/To:      AAA       AA        A      BBB       BB        B      CCC  Default&#xA;     AAA   91.43%    7.76%    0.72%    0.04%    0.04%    0.00%    0.00%    0.00%&#xA;      AA    0.70%   91.25%    7.41%    0.44%    0.16%    0.04%    0.00%    0.00%&#xA;       A    0.45%    2.48%   90.71%    5.38%    0.66%    0.25%    0.04%    0.04%&#xA;     BBB    0.00%    0.25%    5.60%   87.52%    5.40%    0.97%    0.11%    0.15%&#xA;      BB    0.00%    0.11%    0.52%    6.12%   83.21%    7.94%    0.66%    1.43%&#xA;       B    0.00%    0.11%    0.16%    0.51%    6.18%   82.43%    2.97%    7.65%&#xA;     CCC    0.10%    0.25%    0.35%    1.03%    2.41%    8.81%   64.80%   22.25%&#xA; Default    0.00%    0.00%    0.00%    0.00%    0.00%    0.00%    0.00%  100.00%&#xA;&#xA;******************************* t1 Variance Matrix ******************************&#xA;From/To:      AAA       AA        A      BBB       BB        B      CCC  Default&#xA;     AAA    0.07%    0.04%    0.01%    0.00%    0.00%    0.00%    0.00%    0.00%&#xA;      AA    0.15%    0.00%    0.09%    0.00%    0.00%    0.00%    0.00%    0.00%&#xA;       A    0.00%    0.58%    0.13%    0.07%    0.00%    0.00%    0.00%    0.00%&#xA;     BBB    0.00%    0.00%    0.03%    0.01%    0.03%    0.00%    0.00%    0.00%&#xA;      BB    0.00%    0.00%    0.00%    0.05%    0.00%    0.00%    0.00%    0.02%&#xA;       B    0.00%    0.00%    0.00%    0.00%    0.00%    0.02%    0.42%    0.58%&#xA;     CCC    0.00%    0.00%    0.00%    0.01%    0.06%    0.00%    0.15%    0.01%&#xA; Default    0.00%    0.00%    0.00%    0.00%    0.00%    0.00%    0.00%    0.00%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="15654" LastActivityDate="2015-05-24T17:16:47.833" Title="Fitting transition matrices in R by solving for coefficient" Tags="&lt;statistics&gt;&lt;r&gt;&lt;credit-ratings&gt;&lt;transition-matrix&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17009" PostTypeId="2" ParentId="16975" CreationDate="2015-03-17T22:57:59.033" Score="2" Body="&lt;p&gt;The $P$ dynamics of the underlying asset are:&#xA;\begin{align*}&#xA;dS=S(\mu dt+\sigma dB_t)&#xA;\end{align*}&#xA;That has the following solution under the $\mathcal{Q}$ dynamics:&#xA;\begin{align*}&#xA;S_t=S_0 e^{(r-\frac{\sigma^2}{2})t+\sigma W_t}&#xA;\end{align*}&#xA;Where $W_t$ is the equivalent martingale with respect to the original geometric brownian motion. Define $Y_t=\int_0^t S_u du$, then according to Feynman-Kac the value of the replicating portfolio is given by&#xA;\begin{align*}&#xA;V_t&amp;amp;=e^{-r(T-t)}\frac{1}{T^2}\mathbb{E}_t^\mathcal{Q}[(Y_t+\int_t^T S_udu)^2)\\&#xA;&amp;amp;=\frac{e^{-r(T-t)}}{T^2} \mathbb{E}_t^\mathcal{Q}[Y_t^2 + 2Y_t \int_t^T S_u du + (\int_t^T S_u du)^2]\\&#xA;\end{align*}&#xA;So:&#xA;\begin{align*}&#xA;\mathbb{E}_t^\mathcal{Q}[\int_t^T S_u du]&amp;amp;=S_t \mathbb{E}_t^\mathcal{Q}[\int_t^T \frac{S_u}{S_t} du]\\&#xA;&amp;amp;=S_t \int_t^T e^{(r-\frac{\sigma^2}{2})(u-t)}\mathbb{E}^\mathcal{Q}[e^{\sigma (W_u-W_t)}] du\\&#xA;\end{align*}&#xA;Since $W_u-W_t$ follows $\mathcal{N}(0, u-t)$ under $Q$. According to the m.g.f. &#xA;\begin{align*}&#xA;&amp;amp;=S_t \int_t^T e^{r(u-t)}du\\&#xA;&amp;amp;=\frac{S_t}{r}(e^{r(T-t)}-1)\\&#xA;&amp;amp;=\frac{x}{r}(e^{r(T-t)}-1)&#xA;\end{align*}&#xA;Lets compute now the expectation of the square of the integral:&#xA;\begin{align*}&#xA;\mathbb{E}_t^\mathcal{Q}[(\int_t^T S_u du)^2]&amp;amp;=S_t^2 \mathbb{E}_t^\mathcal{Q}[\int_t^T \frac{S_u}{S_t}du \int_t^T \frac{S_v}{S_t}dv ]\\&#xA;&amp;amp;= S_t^2 \int_t^T \int_t^T \mathbb{E}^\mathcal{Q}[\frac{S_u}{S_t} \frac{S_v}{S_t}]dv du\\&#xA;\end{align*}&#xA;Lets focus on: $\mathbb{E}^\mathcal{Q}[\frac{S_u}{S_t} \frac{S_v}{S_t}]$, lets assum $t \leq v \leq u$&#xA;\begin{align*}&#xA;\mathbb{E}^\mathcal{Q}[\frac{S_u}{S_t} \frac{S_v}{S_t}&amp;amp;=\mathbb{E}^\mathcal{Q}[e^{(r-\frac{\sigma^2}{2})(u-t)+\sigma(W_u-W_t))}e^{(r-\frac{\sigma^2}{2})(v-t)+\sigma(W_v-W_t))}]\\&#xA;&amp;amp;=e^{(r-\frac{\sigma^2}{2})(u-t)+(r-\frac{\sigma^2}{2})(v-t)}\mathbb{E}^\mathcal{Q}[e^{\sigma(W_u-W_v)+2\sigma (W_v-W_t)}]\\&#xA;&amp;amp;=e^{(r-\frac{\sigma^2}{2})(u-t)+(r-\frac{\sigma^2}{2})(v-t)}\mathbb{E}^\mathcal{Q}[e^{\sigma(W_u-W_v)}]\mathbb{E}^\mathcal{Q}[e^{2\sigma(W_u-W_t)}]\\&#xA;&amp;amp;=e^{(r-\frac{\sigma^2}{2})(u-t)+(r-\frac{\sigma^2}{2})(v-t)}e^{\frac{\sigma^2}{2}(u-v)}e^{2\sigma^2(v-t)}\\&#xA;&amp;amp;= e^{ur}e^{u(r+\sigma^2)}e^{-t(2r+\sigma^2)}&#xA;\end{align*}&#xA;So:&#xA;\begin{align*}&#xA;\mathbb{E}_t^\mathcal{Q}[(\int_t^T S_u du)^2]&amp;amp;=2S_t^2 \int_t^T \int_t^u e^{ur}e^{u(r+\sigma^2)}e^{-t(2r+\sigma^2)}dv du\\&#xA;&amp;amp;= \frac{2x^2}{r+\sigma^2}(\frac{1}{2r+\sigma^2}e^{(2r+\sigma^2)(T-t)}-\frac{1}{r}e^{r(T-t)}+\frac{r+\sigma^2}{(2r+\sigma^2)r})&#xA;\end{align*}&#xA;Mixing everything together we get:&#xA;\begin{align*}&#xA;V(t,x,y)&amp;amp;=\frac{y^2}{T^2}e^{rt-rT}+\frac{1}{T^2}\frac{2xy}{r}(1-e^{rt-rT})\\&#xA;&amp;amp;+ \frac{1}{T^2}\frac{2x^2}{r+\sigma^2}(\frac{1}{2r+\sigma^2}e^{(r+\sigma^2)(T-t)}-\frac{1}{r}+\frac{r+\sigma^2}{(2r+\sigma^2)r}e^{-r(T-t)})&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="15631" LastActivityDate="2015-03-17T22:57:59.033" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17011" PostTypeId="2" ParentId="8119" CreationDate="2015-03-18T02:18:00.083" Score="0" Body="&lt;p&gt;Very few websites give Total Returns...Morningstar and mutual fund companies give performance numbers which include dividends... the ReturnFinder app and CorrectCharts app give this information in tabular and graphical form with the plots showing both price and total returns.&lt;/p&gt;&#xA;" OwnerUserId="15660" LastActivityDate="2015-03-18T02:18:00.083" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17013" PostTypeId="2" ParentId="15074" CreationDate="2015-03-18T07:19:46.580" Score="0" Body="&lt;p&gt;You can export it here from &lt;a href=&quot;https://www.quandl.com/c/futures/cme-japanese-yen-futures&quot; rel=&quot;nofollow&quot;&gt;QUANDL&lt;/a&gt; which also has an &lt;a href=&quot;https://www.quandl.com/help/r&quot; rel=&quot;nofollow&quot;&gt;R package&lt;/a&gt;. I don't have too much experience with it but I guess you have to open a (free) account.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-03-18T07:19:46.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17014" PostTypeId="1" AcceptedAnswerId="17016" CreationDate="2015-03-18T08:55:42.000" Score="3" ViewCount="666" Body="&lt;p&gt;I'm working on a project, and I have to use the cumulative and conditional expected value of the variations of a stock following a Geometric Brownian Motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that the cumulative is as follows :&#xA;$$ \mathbb{E}\left[ \mathbb{1}_{ \frac{S_{i+1}}{S_{i}} &amp;lt; z}\right] = \mathbb{P} \left[ \frac{S_{i+1}}{S_{i}} &amp;lt; z \right] = \Phi\left(\frac{\log(z) - (r- \frac{\sigma^2}{2})(t_{i+1}-t_i)}{\sigma \sqrt{t_{i+1}-t_i}}\right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Phi$ being the standard normal distribution cumulative function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I couldn't find the expression of the conditional expected value : &#xA;$$ \mathbb{E}\left[\frac{S_{i+1}}{S_i} 1_{\frac{S_{i+1}}{S_i}&amp;lt;z}\right] $$&lt;/p&gt;&#xA;" OwnerUserId="15561" LastEditorUserId="15561" LastEditDate="2015-03-18T09:43:45.563" LastActivityDate="2015-03-19T19:55:45.977" Title="How to compute the conditional expected value of a geometric brownian motion?" Tags="&lt;modeling&gt;&lt;brownian-motion&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17015" PostTypeId="2" ParentId="17014" CreationDate="2015-03-18T12:34:16.500" Score="1" Body="&lt;p&gt;What you are looking for is the partial expectation of $\frac{S_{i+1}}{S_i}$. Since $\frac{S_{i+1}}{S_i}$ is lognormally distributed, you can use the following result:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a lognormal random variable $X \sim LND(m,v^2)$,&#xA;$$ E(X | X &amp;lt; z) = E[X] \Phi\left( \frac{\log(z)-m-v^2}{v} \right) $$&#xA;In your case, $m = (r-\frac{1}{2}\sigma^2) (t_{i+1}-t_{i})$, $v^2 = \sigma^2 (t_{i+1}-t_{i})$, and $E[X] = S_i e{(r+\frac{1}{2}\sigma^2) (t_{i+1}-t_{i})}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then use the fact that $\mathbb{E}[X|X&amp;lt;z] = \frac{\mathbb{E}[\mathbb{I}_{X&amp;lt;z} X]}{\mathbb{P}(X&amp;lt;z)}$ to get the desired expression.&lt;/p&gt;&#xA;" OwnerUserId="7396" LastEditorUserId="7396" LastEditDate="2015-03-19T11:18:46.253" LastActivityDate="2015-03-19T11:18:46.253" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17016" PostTypeId="2" ParentId="17014" CreationDate="2015-03-18T13:59:12.360" Score="2" Body="&lt;p&gt;Note that&#xA;\begin{align*}&#xA;E\bigg(\frac{S_{i+1}}{S_i}\mathbb{I}_{\frac{S_{i+1}}{S_i} &amp;lt; z}\bigg) &amp;amp;=zE\bigg(\mathbb{I}_{\frac{S_{i+1}}{S_i} &amp;lt; z}\bigg)-E\bigg(\Big(z-\frac{S_{i+1}}{S_i}\Big)\mathbb{I}_{\frac{S_{i+1}}{S_i} &amp;lt; z}\bigg) \\&#xA;&amp;amp;=zP\bigg(\frac{S_{i+1}}{S_i}&amp;lt;z\bigg)-E\bigg(\Big(z-\frac{S_{i+1}}{S_i}\Big)^+\bigg).&#xA;\end{align*}&#xA;Then you can compute the expectation using the put option pricing formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, note that&#xA;\begin{align*}&#xA;\frac{S_{i+1}}{S_i} &amp;amp;= e^{(r-\frac{\sigma^2}{2})(t_{i+1}-t_i) + \sigma (W_{t_{i+1}}-W_{t_i})}\\&#xA;&amp;amp;=e^{(r-\frac{\sigma^2}{2})(t_{i+1}-t_i) + \sigma \sqrt{t_{i+1}-t_i} \xi},&#xA;\end{align*}&#xA;where $\xi$ is a standard normal random variable. Then $\frac{S_{i+1}}{S_i}&amp;lt;z$ is equivalent to&#xA;\begin{align*}&#xA;\xi &amp;lt;\frac{\ln z-(r-\frac{\sigma^2}{2})(t_{i+1}-t_i)}{\sigma \sqrt{t_{i+1}-t_i}}.&#xA;\end{align*}&#xA;Let &#xA;\begin{align*}&#xA;d_2 = -\frac{\ln z-(r-\frac{\sigma^2}{2})(t_{i+1}-t_i)}{\sigma \sqrt{t_{i+1}-t_i}}.&#xA;\end{align*}&#xA;We then have that&#xA;\begin{align*}&#xA;E\bigg(\frac{S_{i+1}}{S_i}\mathbb{I}_{\frac{S_{i+1}}{S_i} &amp;lt; z}\bigg) &amp;amp;=&#xA;\int_{-\infty}^{-d_2}e^{(r-\frac{\sigma^2}{2})(t_{i+1}-t_i) + \sigma \sqrt{t_{i+1}-t_i} x}\frac{1}{\sqrt{2\pi}}e^{-\frac{x^2}{2}}dx\\&#xA;&amp;amp;=\int_{-\infty}^{-d_2}e^{r(t_{i+1}-t_i) }\frac{1}{\sqrt{2\pi}}e^{-\frac{\big(x - \sigma \sqrt{t_{i+1}-t_i}\big)^2}{2}}dx\\&#xA;&amp;amp;=\int_{-\infty}^{-d_2- \sigma \sqrt{t_{i+1}-t_i}}e^{r(t_{i+1}-t_i) }\frac{1}{\sqrt{2\pi}}e^{-\frac{x^2}{2}}dx\\&#xA;&amp;amp;=e^{r(t_{i+1}-t_i) }\Phi(-d_1),&#xA;\end{align*}&#xA;where&#xA;\begin{align*}&#xA;d_1 = d_2+ \sigma \sqrt{t_{i+1}-t_i}.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-03-19T19:55:45.977" LastActivityDate="2015-03-19T19:55:45.977" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17017" PostTypeId="1" CreationDate="2015-03-18T14:08:43.617" Score="1" ViewCount="282" Body="&lt;p&gt;there is any calibration method to calculate FX forward rate? How Bloomberg define FX forward rate&lt;/p&gt;&#xA;" OwnerUserId="15666" LastActivityDate="2017-04-20T21:11:31.210" Title="is there any calibration method to calculate FX forward rate? How Bloomberg define FX forward rate" Tags="&lt;fx&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17018" PostTypeId="1" AcceptedAnswerId="17019" CreationDate="2015-03-18T14:10:58.393" Score="2" ViewCount="806" Body="&lt;p&gt;I have learnt how to compute par yields in class, but I am not certain when knowing this would be of use and by Professor himself said it's a somewhat useless concept. What is the use of computing the par yield? Where does the concept come from and where is it applied?&lt;/p&gt;&#xA;" OwnerUserId="13665" LastActivityDate="2015-03-19T01:17:30.540" Title="What is the use of computing the par yield?" Tags="&lt;interest-rates&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17019" PostTypeId="2" ParentId="17018" CreationDate="2015-03-18T14:26:53.570" Score="6" Body="&lt;p&gt;Quite surprised at your professor's comment, since the par yield curve is one of the most important yield curve representations!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can of course just plot the yields of coupon bonds against their time to maturity and call it the yield curve, but the curve won't be smooth because of coupon effect (e.g., when the yield curve is upward sloping, high coupon bonds have lower yield) and because of idiosyncratic behaviors of individual bonds. The par yield curve completely removes coupon effect, making different points of the curve more comparable. Further, many par curve models are constructed to reflect fair value of the market, making them immune to local rich/cheap of individual bonds as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, traders frequently analyze curve trades (e.g., 5s/10s steepener or flattener) or butterfly trades (e.g., 5s/10s/30s) using par yields. Effective duration is mostly commonly calculated by shocking the par yield curve. The par curve is also used as a reference for pricing new issues.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Academics prefer zero coupon rates because they're simpler. But they're much less tracked by practitioners.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2015-03-19T01:17:30.540" LastActivityDate="2015-03-19T01:17:30.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17020" PostTypeId="1" CreationDate="2015-03-18T15:09:26.940" Score="1" ViewCount="63" Body="&lt;p&gt;The CDS market seems to be drying up, funding&amp;amp;liquidity issues are now prevalent over credit, so other sources for default probabilities are needed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What else is commonly used to obtain a default term structure? ASW spreads/credit OAS? ASW + early termination + repo?&lt;/p&gt;&#xA;" OwnerUserId="3015" LastEditorUserId="3015" LastEditDate="2015-03-20T14:47:00.797" LastActivityDate="2015-03-20T14:47:00.797" Title="Alternatives to CDSs for default term structure?" Tags="&lt;cds&gt;&lt;default&gt;&lt;default-probability&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17021" PostTypeId="1" CreationDate="2015-03-18T16:19:24.917" Score="0" ViewCount="1234" Body="&lt;p&gt;Going by intuition, a forward price should already take into account the drift in the underlying price process.  Further, assuming interest rates are deterministic, the stochasticity in the forward price process comes solely from the underlying price process.  That much I can intuitively accept.  But what about the drift component of the forward price process?  Is it non-zero and does the choice of measure (risk-neutral, forward, real-world) influence its presence and magnitude?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another issue I cannot reconcile is that I've read that all tradable securities under the risk-neutral measure must have a drift component the same as the risk-free interest rate.  A forward contract is surely a tradable security?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please excuse my confusion and possible bludgeoning of different concepts.&lt;/p&gt;&#xA;" OwnerUserId="3510" LastActivityDate="2015-04-28T09:52:48.620" Title="Does a forward price have a drift component in any measure?" Tags="&lt;black-scholes&gt;&lt;risk-neutral-measure&gt;&lt;forward&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17022" PostTypeId="1" CreationDate="2015-03-18T17:09:46.153" Score="0" ViewCount="141" Body="&lt;p&gt;I want to algorithmically add a new investment to an existing portfolio. The decision should be based on a low correlation to the existing assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E. g. the following situation&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The portfolio already contains 5 stocks: A1 ... A5&lt;/li&gt;&#xA;&lt;li&gt;My trading system generates 3 buy signals for new investments that aren’t in the portfolio yet: B1 ... B3&lt;/li&gt;&#xA;&lt;li&gt;I want to pick one out of three investments to add to the portfolio&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So I will calculate for each investment the correlation coefficient: correlation(Bx, Ay) which gives me a matrix with 3 rows (B1 ... B3) and 5 columns (A1 ... A5). What will then be the right decision criteria to pick the row with the least correlation?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The row with the lowest correlation average? &lt;/li&gt;&#xA;&lt;li&gt;Or the lowest correlation average weighted by invest volume?&lt;/li&gt;&#xA;&lt;li&gt;Or the row with the lowest maximum correlation?&lt;/li&gt;&#xA;&lt;li&gt;Other variants?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Other topic: Am I right that I just have to take take the negative value of the correlation coefficient in case my system also creates short-signals?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alen&lt;/p&gt;&#xA;" OwnerUserId="12059" LastEditorUserId="12059" LastEditDate="2015-03-18T17:46:06.957" LastActivityDate="2015-05-18T02:58:55.290" Title="Right metric to manage a portfolio based on correlation?" Tags="&lt;correlation&gt;&lt;portfolio&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17023" PostTypeId="2" ParentId="16339" CreationDate="2015-03-18T17:34:35.657" Score="6" Body="&lt;p&gt;What you need is to identify the distribution of the asset price $S_T$, conditional on the information set $\mathcal{F}_{t}$ at time $t$, for $0\leq t &amp;lt; T$. Note that &#xA;\begin{align*}&#xA;S_T &amp;amp;= S_t \exp\bigg(\int_{t}^T \Big(r_s-\frac{\sigma_s^2}{2}\Big)ds + \int_t^T\sigma_s dW_s \bigg).&#xA;\end{align*}&#xA;Let &#xA;\begin{align*}&#xA;P(t, T) = \exp\bigg(-\int_t^T r_s ds \bigg),&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;\hat{\sigma} = \sqrt{\frac{1}{T-t}\int_t^T\sigma_s^2 ds}.&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;S_T &amp;amp;= F(t, T)e^{-\frac{\hat{\sigma}^2}{2}(T-t) + \hat{\sigma}\sqrt{T-t} Z},&#xA;\end{align*}&#xA;where $F(t, T)=S_t/P(t, T)$ is the forward price, and $Z$ is a standard normal random variable independent of $\mathcal{F}_t$.&#xA;Consequently, the value at time $t$ of the option payoff $[\psi(S_T-K)]^+$, where $\psi = \pm 1$, is given by&#xA;\begin{align*}&#xA;P(t, T) E\Big([\psi(S_T-K)]^+ \mid \mathcal{F}_t \Big) &amp;amp;= P(t, T)\psi\big[F(t, T) N(\psi d_1) - KN(\psi d_2) \big],&#xA;\end{align*}&#xA;where &#xA;\begin{align*}&#xA;d_{1} = \frac{\ln F(t, T)/K + \frac{\hat{\sigma}^2}{2}(T-t)}{\hat{\sigma}\sqrt{T-t}},&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;d_2 = d_1 - \hat{\sigma}\sqrt{T-t}.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-03-19T19:47:21.540" LastActivityDate="2015-03-19T19:47:21.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17024" PostTypeId="1" AcceptedAnswerId="17030" CreationDate="2015-03-18T17:41:55.080" Score="0" ViewCount="4217" Body="&lt;p&gt;I'm confused on modeling the second pass regression given the beta's from the first pass.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First-pass regression : &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_{it} - r_{ft} = a_{i}+b_{i}(r_{Mt}-r_{ft})+e_{it}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For estimating this model (9 diff models), I regressed  the annual returns for different stocks on the index variable and obtained 9 different betas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second-pass regression : &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\overline{r_{i}-r_{f}} = \gamma_{0}+\gamma_{1}b_{i} + \gamma_{2}\sigma^{2}(e_{i})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now that I have the betas, I need to regression the average return on the reported betas, but I'm not sure what the dependent variable is in this regression?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the dependent variable in this case and how would you run this regression?&lt;/p&gt;&#xA;" OwnerUserId="15669" LastActivityDate="2015-03-19T20:14:38.540" Title="Linear Model setup for Second-pass Regression" Tags="&lt;regression&gt;&lt;capm&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17025" PostTypeId="1" CreationDate="2015-03-18T18:09:34.383" Score="0" ViewCount="135" Body="&lt;p&gt;From my reading, passive portfoliomanagement means to replicate an index, active portfoliomanagement means to deviate from an index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does that mean that e.g. rules-based investing is actually an active investment approach?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wrote on an exam, that passive means to follow a certain rule, while active trading means to dynamically decide individually by a portfolio manager.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2015-03-18T18:09:34.383" Title="Active or Passive strategy?" Tags="&lt;portfolio-management&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17026" PostTypeId="2" ParentId="17022" CreationDate="2015-03-18T20:54:33.417" Score="1" Body="&lt;p&gt;If you want the lowest correlation then just short your portfolio. Correlation -1, now you have zero exposure. But I don't think that's really your objective function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a two asset portfolio ...&#xA;$$&#xA;\sigma =\sqrt{w_1^2\sigma_1^2 + w_2^2\sigma_2^2+2w_1w_2Cov_1,_2}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And your real objective function incorporates your return expectation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bear with me now, because we're just stating the obvious so far. And I haven't been thinking through the generalization to more assets lately nearly as much as calling library functions to do this and as sunny as it is outside, I'm in no mood to do matrixes in markdown or stare at the equation until I'm sure I generalize right. I'm going to suggest you go have a look at &lt;a href=&quot;https://www.riskprep.com/all-tutorials/36-exam-22/58-modeling-portfolio-variance&quot; rel=&quot;nofollow&quot;&gt;this explanation with a spreadsheet&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;On to some of the assumptions about where to look for your non-correlated positive return expectation.&lt;/strong&gt;&lt;br&gt;&#xA;You can't assume that inverting your signal generation will give you a set of low correlation signals in the form of shorts. It might look that way on daily returns, but my experience with long/short systems of this nature is that the long and short can be highly correlated on time frames longer than one day. Furthermore, you have different market structure issues with shorts. I see some feasibility issues in terms of share availability, costs issues (there's a highly profitable sub-industry thriving off of lending shares to folks like you and me), and stocks just behave differently going down than going up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have to diversify in terms of signal generation methods entirely. This might apply more to some strategies and less to others. You should certainly test for it in your strategies. Even hope you will find it if you must. But run the numbers and don't assume.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keep diversifying. And I certainly don't mean to suggest you shouldn't trade some inverted signals, because most people I know do that. Just don't expect them to be negative correlations or even the best diversification for your longs. Uncorrelated alpha is the holy grail. Happy questing!&lt;/p&gt;&#xA;" OwnerUserId="15529" LastActivityDate="2015-03-18T20:54:33.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17027" PostTypeId="2" ParentId="17021" CreationDate="2015-03-19T00:24:36.710" Score="1" Body="&lt;p&gt;I will formalize my answer later. But one thing you will have to know is that the price of a forward contract will be a martingale under t forward measure, meaning the drift term is 0. This is not true under other measures. So the drift of the process depends on the measure you use to price the contract.&lt;/p&gt;&#xA;" OwnerUserId="6804" LastActivityDate="2015-03-19T00:24:36.710" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17028" PostTypeId="2" ParentId="17022" CreationDate="2015-03-19T01:40:55.333" Score="1" Body="&lt;p&gt;Personally I would look to increase the asset which has the highest positive co-skewness with your existing portfolio as this should both enhance your return and in general reduce your correlation. For example see the following spreadsheet &lt;a href=&quot;http://www.academia.edu/attachments/31382573/download_file?st=MTQyNjcyODcyNywyMDIuMTc0LjE3MC4xNjIsMTIyMTAxMg%3D%3D&amp;amp;s=work_strip&quot; rel=&quot;nofollow&quot;&gt;http://www.academia.edu/attachments/31382573/download_file?st=MTQyNjcyODcyNywyMDIuMTc0LjE3MC4xNjIsMTIyMTAxMg%3D%3D&amp;amp;s=work_strip&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2911" LastActivityDate="2015-03-19T01:40:55.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17029" PostTypeId="1" CreationDate="2015-03-19T03:26:33.460" Score="1" ViewCount="248" Body="&lt;p&gt;I'm working on high frequency trading in the Chinese Futures market and I've been having a bit of trouble with getting orders to go through due to the lack of liquidity and large fluctuations. To tackle this problem, I was thinking about working out a model to somewhat predict the next price tick so that I can send my orders accordingly and achieve a higher percentage of successful trades. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that Chinese futures markets are different from other markets because data is only released every half a second. Rather than a continuous stream of information, quotes and other information is updated every half second so the time in between is a sort of black box which makes some models hard to apply. I was wondering if anyone has some suggestions for either how to predict the next tick (which models or variables to try) or a better way to place my orders to increase the number of successful trades.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Things I've tried so far are logistic regression (decomposed to guess 1. if there will be a price change 2. given there is, is it up or down 3. if its up or down, how much will it move using geometric distribution), arithmetic brownian motion, geometric brownian and mean reversion with another future option for a later date (most hopeful).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="15671" LastEditorUserId="15671" LastEditDate="2015-03-19T03:33:50.657" LastActivityDate="2015-03-19T03:33:50.657" Title="Estimating the next tick movement in Chinese markets" Tags="&lt;high-frequency&gt;&lt;futures&gt;&lt;prediction&gt;&lt;china&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17030" PostTypeId="2" ParentId="17024" CreationDate="2015-03-19T07:28:11.913" Score="1" Body="&lt;p&gt;In the second pass, the independent variables are the first pass estimated betas. That is, you estimate $\hat{\beta_i}$ in time series for every stock i&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_{i,t} - r_{f,t} = \alpha_i + \beta_i(r_{M,t}-r_{f,t}) + \epsilon_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and then you estimate risk premia $\hat{\lambda}$ according to the following regression:&#xA;$$\overline{r_{i,t} - r_{f,t}} = a_0 + \lambda \hat{\beta_i} + u_i$$&#xA;Do not forget to adjust second pass standard errors according to &lt;a href=&quot;http://home.business.utah.edu/finmll/fin787/papers/famamacbeth1973.pdf&quot; rel=&quot;nofollow&quot;&gt;Fama&amp;amp;MacBeth&lt;/a&gt; or &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.132.9267&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow&quot;&gt;Shanken&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This type of (linear beta pricing) models have two implications:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Expected returns are linear in the market factor &lt;/li&gt;&#xA;&lt;li&gt;First pass alphas  are jointly equal to zero&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;To check the first you can add nonlinear terms to the second pass and check if they are significant, to check the second use the &lt;a href=&quot;http://home.business.utah.edu/finmll/fin787/papers/gibbonsrossshanken1989.pdf&quot; rel=&quot;nofollow&quot;&gt;GRS statistic&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8028" LastEditorUserId="8028" LastEditDate="2015-03-19T20:14:38.540" LastActivityDate="2015-03-19T20:14:38.540" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17031" PostTypeId="1" CreationDate="2015-03-19T09:18:33.077" Score="2" ViewCount="204" Body="&lt;p&gt;I'm reading about &lt;em&gt;Markov pricing kernels&lt;/em&gt; in the lecture notes of a course I'm following, but I have a big doubt on an application of Ito's lemma.&#xA;The setting is the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We define the pricing kernel as&#xA;$$ \xi_t = \xi(D_t,y_t,t) = e^{\int_0^t \delta(D_s,y_s)ds} T(D_t,y_t), \qquad \xi_0=1 $$&#xA;where $D$ and $y$ are Ito processes following the dynamics&#xA;$$ dD_t = m(D_t,y_t)dt + \sigma(D_t,y_t) dW_{1t} $$&#xA;and&#xA;$$ dy_t = \varphi(y_t)dt + v_1(y_t) dW_{1t} + v_2(y_t) dW_{2t} $$&#xA;Moreover, we assume the pricing kernel follows the dynamics&#xA;$$ \frac{d\xi_t}{\xi_t} = -R_t dt -\lambda_{1t} dW_{1t}-\lambda_{2t} dW_{2t} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, the claim in the lecture notes is that by applying the Ito's lemma to $\xi_t$, one finds&#xA;$$ R(D,y) = \delta(D,y) - \frac{\mathscr{L} T(D,y)}{T(D,y)}, $$&#xA;where $\mathscr{L}$ is the infinitesimal generator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I can see that this result can be obtained - rather trivially - in the case where the function $\delta$ in the integral is &lt;strong&gt;not&lt;/strong&gt; dependent on $D$ and $y$. But in the case the dependence is there (as stated in the lecture notes), the drift obtained with Ito takes a much more complex form, and I really don't see any cancelling of the terms.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you agree with me - and thus there's a typo in my lecture notes - or am I applying Ito in the wrong way?&lt;/p&gt;&#xA;" OwnerUserId="13556" LastEditorUserId="13556" LastEditDate="2015-03-21T10:38:30.363" LastActivityDate="2015-03-21T10:44:23.803" Title="Markov Pricing kernel" Tags="&lt;stochastic-processes&gt;&lt;itos-lemma&gt;&lt;continuous-time&gt;&lt;kernel&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17032" PostTypeId="1" AcceptedAnswerId="17034" CreationDate="2015-03-19T12:08:16.060" Score="3" ViewCount="2398" Body="&lt;p&gt;Assume that the evolution of a stock price is geometric Brownian Motion&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;dS=\mu Sdt+\sigma SdW(t)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $S$ is the stock price at time $t$ (current time). It says&#xA;in my book that &quot;under the risk-neutral probability measure, the&#xA;drift of stock price $\mu$ becomes the risk-free interest rate $r$&quot;&#xA;and it writes&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;dS=rSdt+\sigma SdW^{*}(t).&#xA;$$&#xA;where $W^{*}$ is a B.M. under RNP $Q$ (risk neutral probability).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the above equation definitely correct? Is there a&#xA;justification for this?&lt;/p&gt;&#xA;" OwnerUserId="6661" LastEditorUserId="6661" LastEditDate="2015-03-19T12:26:33.730" LastActivityDate="2021-01-20T07:48:04.740" Title="&quot;The drift of stock price becomes the risk-free interest rate&quot; under RNP" Tags="&lt;risk-neutral-measure&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17033" PostTypeId="1" AcceptedAnswerId="17091" CreationDate="2015-03-19T13:14:25.423" Score="3" ViewCount="3654" Body="&lt;p&gt;I am trying to download data from Interactive Broker using the code below and I am able to create the connection with the Trader Work Station (I get a &quot;True&quot; after &lt;code&gt;con.connect()&lt;/code&gt;) but there is no output, i.e. the &lt;code&gt;dataDownload&lt;/code&gt; variable becomes empty.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone know why this can be?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Adapted from: http://godelsmarket.blogspot.co.uk/2012/07/non-gui-ib-historical-data-downloader.html&#xA;&#xA;from time import sleep, strftime, localtime&#xA;from ib.ext.Contract import Contract&#xA;from ib.opt import ibConnection, message&#xA;&#xA;new_symbolinput = ['EUR.USD']&#xA;newDataList = []&#xA;dataDownload = []&#xA;&#xA;def historical_data_handler(msg):&#xA;  global newDataList&#xA;  #print msg.reqId, msg.date, msg.open, msg.high, msg.low, msg.close, msg.volume&#xA;  if ('finished' in str(msg.date)) == False:&#xA;    new_symbol = new_symbolinput[msg.reqId]&#xA;    dataStr = '%s, %s, %s, %s, %s, %s, %s' % (new_symbol, strftime(&quot;%Y-%m-%d %H:%M:%S&quot;, localtime(int(msg.date))), msg.open, msg.high, msg.low, msg.close, msg.volume)&#xA;    newDataList = newDataList + [dataStr]&#xA;  else:&#xA;    new_symbol = new_symbolinput[msg.reqId]&#xA;    filename = 'minutetrades' + new_symbol + '.csv'&#xA;    csvfile = open('csv_day_test/' + filename,'wb')&#xA;    for item in newDataList:&#xA;      csvfile.write('%s \n' % item)&#xA;    csvfile.close()&#xA;    newDataList = []&#xA;    global dataDownload&#xA;    dataDownload.append(new_symbol)&#xA;&#xA;con = ibConnection()&#xA;con.register(historical_data_handler, message.historicalData)&#xA;con.connect()&#xA;&#xA;symbol_id = 0&#xA;for i in new_symbolinput:&#xA;  print i&#xA;  qqq = Contract()&#xA;  qqq.m_symbol = i&#xA;  qqq.m_secType = 'STK'&#xA;  qqq.m_exchange = 'SMART'&#xA;  qqq.m_currency = 'USD'&#xA;  con.reqHistoricalData(symbol_id, qqq, '', '1 D', '1 min', 'TRADES', 1, 2)&#xA;  symbol_id = symbol_id + 1&#xA;  sleep(0.5)&#xA;&#xA;print dataDownload&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="15285" LastEditorUserId="8164" LastEditDate="2020-05-03T20:56:58.543" LastActivityDate="2020-05-03T20:56:58.543" Title="Downloading Data from Interactive Brokers using IbPy" Tags="&lt;programming&gt;&lt;interactive-brokers&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="17034" PostTypeId="2" ParentId="17032" CreationDate="2015-03-19T15:04:27.633" Score="8" Body="&lt;p&gt;Yes, you may as well take this as the &lt;em&gt;definition&lt;/em&gt; of the risk-neutral probability $Q$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will now try to give you some intuition for that kind of construction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume the risk-free interest rate $r$ is constant and that the world ends at time $T$. Suppose you have a security $B=B_t$ which is riskless, i.e. which follows the dynamics&#xA;$$ dB/B = r \, dt $$&#xA;so that, since $ dB/B = d \ln B $, you can easily see that $B_t = B_0 e^{rt}$. In other words, the process $B_t$ grows at the same speed of the risk-free rate. For this security, the price at time zero is $B_0$, which coincides with the discounted value of its expected payoff:&#xA;$$ e^{-rT} E[B_T] = e^{-rT} E[B_0 e^{rT}] = e^{-rT} B_0 e^{rT} = B_0 \,.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now consider a stock which is risky, as it follows the dynamics&#xA;$$ dS/S = \mu \, dt + \sigma\,dW $$&#xA;with $\mu &amp;gt; r$ and $\sigma$ constant and $dW$, a standard Brownian Motion, being the source of risk. This time the process $S$ grows in expectation with speed $\mu$, and its discounted expected payoff&#xA;$$ e^{-rT}E[S_T] = e^{-rT} S_0 e^{\mu T} = S_0 e^{(\mu-r) T} &amp;gt; S_0 $$&#xA;is bigger that its current value $S_0$. Why is it so?&#xA;Well, because there's some risk involved in holding $S$, so that its price should be lower w.r.t. a riskless security! This way the investor who buys the stock at time $0$ will be compensated for bearing this risk, i.e. he will pocket a &lt;strong&gt;risk premium&lt;/strong&gt;. The risk-neutral probability $Q$ is the one which gives the right price when you look at the discounted expected payoff, i.e.&#xA;$$ S_0 = e^{-rT}E^Q[S_T]\,. $$&#xA;If you followed my reasoning so far, it should now be clear that $Q$ is that probability for which&#xA;$$ dS/S = r\, dt + \sigma\, dW^Q $$&#xA;with $dW^Q$ being a Brownian Motion under $Q$.&lt;/p&gt;&#xA;" OwnerUserId="13556" LastEditorUserId="13556" LastEditDate="2015-03-19T21:41:48.153" LastActivityDate="2015-03-19T21:41:48.153" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17035" PostTypeId="1" AcceptedAnswerId="17219" CreationDate="2015-03-19T15:11:34.293" Score="6" ViewCount="12894" Body="&lt;p&gt;I have seen this post : &lt;a href=&quot;https://quant.stackexchange.com/questions/8099/central-index-key-cik-of-all-traded-stocks&quot;&gt;Central Index Key (CIK) of all traded stocks&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I would like to download the CIKs only for NASDAQ stocks, NYSE stocks etc. I searched online but only managed to find CIKs for Dow Jones and S&amp;amp;P 500.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas where to get these CIKs ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="15676" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2019-01-09T09:28:46.423" Title="List of central index keys (CIK) for NASDAQ and NYSE" Tags="&lt;nasdaq&gt;&lt;nyse&gt;" AnswerCount="7" CommentCount="1" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="17036" PostTypeId="1" CreationDate="2015-03-19T18:51:38.913" Score="0" ViewCount="102" Body="&lt;p&gt;Suppose I'm given two assets, &lt;span class=&quot;math-container&quot;&gt;$x_0$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$x_1$&lt;/span&gt; and the stochastic discount factor m. How do I find &lt;span class=&quot;math-container&quot;&gt;$m_p$&lt;/span&gt;, then use it to compute Sharpe(&lt;span class=&quot;math-container&quot;&gt;$R_p$&lt;/span&gt;)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help is greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="15267" LastEditorUserId="35273" LastEditDate="2019-06-26T15:18:10.913" LastActivityDate="2019-06-26T15:18:10.913" Title="How do I find the Sharpe Ratio?" Tags="&lt;sharpe-ratio&gt;&lt;stochastic-discount&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="17037" PostTypeId="1" AcceptedAnswerId="17040" CreationDate="2015-03-19T19:05:59.087" Score="0" ViewCount="110" Body="&lt;p&gt;I'm building a low frequency US equity stat arb system. On any given day the system is long ~100 stocks and short ~100 stocks. It trades once a day at the open, and on average 4/5 of the portfolio gets replaced each day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using the formula on page 21 of &lt;a href=&quot;http://www.courant.nyu.edu/~almgren/papers/costestim.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.courant.nyu.edu/~almgren/papers/costestim.pdf&lt;/a&gt; as my slippage cost model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a liquidity filter, I'm only trading stocks with minimum price of 5 dollars and minimum daily dollar volume of 30 million dollars.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it safe to assume that these fairly liquid stocks are all possible to borrow for shorting? If not, when you backtest a system, is there a way to estimate if a stock could have been shorted, or is there a place to buy that information?&lt;/p&gt;&#xA;" OwnerUserId="7769" LastActivityDate="2015-03-19T20:10:47.353" Title="possible to estimate if hard-to-borrow?" Tags="&lt;arbitrage&gt;&lt;short-selling&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17038" PostTypeId="2" ParentId="17035" CreationDate="2015-03-19T19:11:12.233" Score="5" Body="&lt;p&gt;NASDAQ provides a list of traded stocks.  It is available on their FTP server: ftp.nasdaqtrader.com.  There you will find two files of interest: nasdaqlisted.txt and otherlisted.txt.  nasdaqlisted.txt lists the NASDAQ stocks.  otherlisted.txt contains a field that identifies the exchange, which includes NYSE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;None of these will give you the CIK, but the data on the NASDAQ site will give you the stock symbol and the exchange.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you can go to the SEC's site and download either quarterly 10-Q filings, or annual 10-K filings.  There are multiple ways of getting this data.  The simplest way is to download flat, tab delimited SEC filings from the quarterly prepared zip archives maintained by the SEC.  These are located here:  &lt;a href=&quot;http://www.sec.gov/dera/data/financial-statement-data-sets.html&quot; rel=&quot;noreferrer&quot;&gt;http://www.sec.gov/dera/data/financial-statement-data-sets.html&lt;/a&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The file names are YYYYqX.zip where YYYY is the year and X is a single digit indicating the quarter.  Unzip the latest one and look for the file named sub.txt.  This file contains all of the information relating to the filing of financial statements with the SEC except for the actual line items that make up the balance sheet and the income statements (those are in num.txt, but you don't need them to address the question you asked).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The data in sub.txt contains a field, &lt;code&gt;CIK&lt;/code&gt;, which is the one you want.  You need to match this against the stock symbol.  This isn't as straight forward as one would hope.  Within sub.txt is a field named &lt;code&gt;instance&lt;/code&gt; that identifies the name of a file that the submitter uploaded to the SEC containing all the line items (it's an XML file, but again you don't need it).  The file name is constructed by appending the stock symbol name with the date of submission (formatted as YYYYMMDD), separated by a dash (most of the time).  Here's a sample file name for Apple, Inc.: &lt;code&gt;aapl-20091226.xml&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Matching the previously acquired symbol against sub.txt gives you the &lt;code&gt;CIK&lt;/code&gt;.  You should probably do a case insensitive match.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that occasionally, instead of a dash, there may be an underscore character.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note the the relationship between stock symbol and &lt;code&gt;CIK&lt;/code&gt; is &lt;em&gt;not&lt;/em&gt; 1:1.  There are often multiple &lt;code&gt;CIKs&lt;/code&gt; for a given stock symbol.&lt;/p&gt;&#xA;" OwnerUserId="15063" LastEditorUserId="15063" LastEditDate="2015-03-21T09:10:02.743" LastActivityDate="2015-03-21T09:10:02.743" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17039" PostTypeId="2" ParentId="16452" CreationDate="2015-03-19T19:46:33.297" Score="4" Body="&lt;p&gt;This problem is from the exercise for Chapter 2 of Kerry Back's Asset Pricing Book. The setup of the problem is rather simple. You want to &#xA;\begin{equation*}&#xA;\begin{aligned}&#xA;&amp;amp; \underset{\phi}{\text{maximize}}&#xA;&amp;amp; &amp;amp; \phi'\mu + \frac{1}{2} \alpha \phi' \Sigma \phi\\&#xA;&amp;amp; \text{subject to}&#xA;&amp;amp; &amp;amp; 1'\phi = w_0&#xA;\end{aligned}&#xA;\end{equation*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The general method to solve this is to setup Lagrangian, and take derivative w.r.t $\phi$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation*}&#xA;\begin{aligned}&#xA;&amp;amp; L = \phi'\mu + \frac{1}{2} \alpha \phi' \Sigma \phi + \lambda(1'\phi - w_0)&#xA;\end{aligned}&#xA;\end{equation*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation*}&#xA;\begin{aligned}&#xA;&amp;amp; \frac{\partial L}{\partial \phi} = \mu + \alpha \Sigma \phi + \lambda 1 = 0&#xA;\end{aligned}&#xA;\end{equation*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solve this for $\phi$ in terms of $\lambda$, you will have&#xA;$$&#xA; \phi = \frac{1}{\alpha} \Sigma^{-1} \mu - \lambda \Sigma^{-1} 1&#xA;$$&#xA;Now substitute this $\phi$ back into the constraint, and solve for $\lambda$, you will have:&#xA;$$&#xA;\lambda = (1'\Sigma^{-1}\mu - \alpha w_0)(1'\Sigma^{-1}1)^{-1}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally substitute this $\lambda$ into the expression for $\phi$, you will have what you are looking for.&lt;/p&gt;&#xA;" OwnerUserId="6804" LastActivityDate="2015-03-19T19:46:33.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17040" PostTypeId="2" ParentId="17037" CreationDate="2015-03-19T20:10:47.353" Score="0" Body="&lt;p&gt;The list will differ depending on your brokerage relationship. Not every broker's hard-to-borrow list will be the same. And you may be able to use 3rd party relationships purely for locates (finding hard-to-borrows). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your liquidity requirements look reasonable. I'm just going to pull a number out of the air (although I see it, this isn't something I track) and say that more than 90% of this universe will not be hard-to-borrow. You might also add recent IPOs, because they're usually unavailable or expensive to get locates for a while regardless of volume.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have the right relationships then there will be quite a few hard-to-borrow cases, but for a price you can still get most shares.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know where you would get historical data on this to test, because I think you would just cache it off some status feed from your brokers.&lt;/p&gt;&#xA;" OwnerUserId="15529" LastActivityDate="2015-03-19T20:10:47.353" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17041" PostTypeId="1" CreationDate="2015-03-19T21:49:33.953" Score="2" ViewCount="324" Body="&lt;p&gt;i'm writing an python application that uses fxcm's xml feed. here is the link&#xA;&lt;a href=&quot;http://rates.fxcm.com/RatesXML&quot; rel=&quot;nofollow&quot;&gt;http://rates.fxcm.com/RatesXML&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;does anyone know if there are limits on how many times you can access this data? right now i update the application every 5 seconds. however i am anticipating about 50 or so users will be using it when its ready. i guess my fear is that it will look like DDOS attack from our company's ip.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;eventually we are planning on using a fx datafeed but for now we need something quick that works. any ideas?&lt;/p&gt;&#xA;" OwnerUserId="15680" LastActivityDate="2015-03-19T21:49:33.953" Title="is there a limit on how many times i can access fxcm xml feed" Tags="&lt;market-data&gt;&lt;fx&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17042" PostTypeId="1" CreationDate="2015-03-20T00:28:46.717" Score="2" ViewCount="207" Body="&lt;p&gt;Sometimes I see obvious errors in the 10-K or 10-Q filings that appear to go uncorrected in subsequent filings for the same period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, on June 9, 2014 Apple, Inc. did a 7-to-1 stock split.  If you look at all of the &lt;code&gt;CommonStockSharesOutstanding&lt;/code&gt; tag field values in all of the 10-K or 10-Q filings leading up to (but not including) the split, you'll see numbers around 940,000,000.  But then things get strange.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On April 24, 2014 (before the split) there are two 10-Q filings (with different DDATEs and the same ADSH, 0001193125-14-157311) that report &lt;code&gt;CommonStockSharesOutstanding&lt;/code&gt; of 889,213 (wrong by a factor of about 1,000).  There is no subsequent filing to correct this for 3 months until two July 23, 2014 filings (with different DDATEs and the same ADSH, 0001193125-14-277160) which reports &lt;code&gt;CommonStockSharesOutstanding&lt;/code&gt; of 6,294,494,000 and 5,989,171,000, respectively, reflecting the June 9 7-to-1 split.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, for three months (April 24, 2014 to July 23, 2014) the value of &lt;code&gt;CommonStockSharesOutstanding&lt;/code&gt; was around 900,000 instead of the approximately correct value of 6,300,000,000 up to the split date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/iAk7o.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How should these errors, and specifically this type of error, be handled?  This data comes straight from the SEC so I don't think there's a more accurate source.  Is there?  What to do...?&lt;/p&gt;&#xA;" OwnerUserId="15063" LastEditorUserId="15063" LastEditDate="2015-03-20T01:44:05.413" LastActivityDate="2015-03-20T01:44:05.413" Title="How to Handle Error in SEC Filings" Tags="&lt;equities&gt;&lt;historical-data&gt;&lt;sec&gt;&lt;error&gt;&lt;edgar&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17043" PostTypeId="1" AcceptedAnswerId="17044" CreationDate="2015-03-20T00:39:42.323" Score="-1" ViewCount="56" Body="&lt;p&gt;I like know how much money dividend cash I get. For example I own two shares of the stock dividend cash will be &lt;strong&gt;4.54$&lt;/strong&gt; ?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Prev Close: 52.01&#xA;Open:   51.85&#xA;Bid:    48.28 x 200&#xA;Ask:    52.75 x 100&#xA;1y Target Est:  49.44&#xA;Beta:   0.41&#xA;Next Earnings Date: 29-Apr-15O Earnings announcement&#xA;Day's Range:    51.54 - 52.64&#xA;52wk Range: 39.62 - 55.54&#xA;Volume: 1,579,416&#xA;Avg Vol (3m):   2,294,020&#xA;Market Cap: 11.76B&#xA;P/E (ttm):  50.13&#xA;EPS (ttm):  1.04&#xA;Div &amp;amp; Yield:    2.27 (4.50%)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7958" LastActivityDate="2015-03-20T01:44:31.387" Title="dividend cash in month" Tags="&lt;dividends&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2015-03-20T01:45:17.043" ContentLicense="CC BY-SA 3.0" />
  <row Id="17044" PostTypeId="2" ParentId="17043" CreationDate="2015-03-20T01:44:31.387" Score="1" Body="&lt;p&gt;You are assuming that the Dividend stated in your figures represents how much dividend you will be receiving in a month.  However, you need to know exactly what that field represents.  It could be one of the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Annualised dividend (most recent dividend multiplied by frequency... eg. quarterly dividend multipled by 4)&lt;/li&gt;&#xA;&lt;li&gt;Annualised declared dividend (most recent declared by not yet entitled/paid dividend multiplied by frequency)&lt;/li&gt;&#xA;&lt;li&gt;Trailing twelve month dividend (all dividends received in the last 12 months)&lt;/li&gt;&#xA;&lt;li&gt;Annual dividend - all dividends allocated to the most recent complete fiscal year&lt;/li&gt;&#xA;&lt;li&gt;Some other derivation (perhaps based the sum of dividends included in quarterly reports)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Every dividend declared by the company has one important date - the ex-date.  If you have bought on or before the close of the previous trading date then you are entitled to that dividend.  If you purchase after the close of the previous trading date (e.g. after-hours trading) or any time on or after the ex-date then you are NOT entitled to that dividend.  Note that the date you get paid the dividend is typically a few weeks after the ex-date but this can vary.  Note also that you can sell the stock on the ex-date and still receive the dividend.  You should be learn which different taxation rules applicable to stock holding periods on dividends.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With a bit of sleuthing, I found a stock that matches your data.  I assume you are referring to the stock NYSE:O (Realty Income REIT).  This company historically pays out dividends on a monthly basis.  The most recent dividend declared is 0.1895 with an ex-date of Monday 30 Mar 2015.  You need to be holding the stock by the close of Friday 27 Mar 2015.  The payment date for the dividend is 15 Apr 2015.  In answer to your question, you will receive a dividend for 2 shares * 0.1895 = 0.379&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The dividend value 2.27 in your figures appears to represent the annualised dividend of the most recently declared dividend of 0.1895 * 12 and therefore assumes the dividends will remain constant for the next 12 months.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A sample of prior dividends for NYSE:O, by ex-date, are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;20150226 0.1890&#xA;20150129 0.1890&#xA;20141230 0.183417&#xA;20141126 0.183104&#xA;20141030 0.183104&#xA;20140929 0.183104&#xA;20140828 0.182792&#xA;20140730 0.182792&#xA;20140627 0.182792&#xA;20140529 0.182479&#xA;20140429 0.182479&#xA;20140328 0.182479&#xA;20140227 0.182167&#xA;20140130 0.182167&#xA;20141230 0.182167&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Data for this exercise came from Premium Data.  Disclosure: I am a co-owner of Premium Data.&lt;/p&gt;&#xA;" OwnerUserId="13859" LastActivityDate="2015-03-20T01:44:31.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17045" PostTypeId="2" ParentId="15933" CreationDate="2015-03-20T04:19:02.363" Score="1" Body="&lt;p&gt;In this presentation &lt;a href=&quot;https://www.academia.edu/attachments/37039957/download_file?st=MTQyNjgyNTAxNCwyMDIuMTc0LjE3MC4xNjIsMTIyMTAxMg%3D%3D&amp;amp;s=work_strip&quot; rel=&quot;nofollow&quot;&gt;https://www.academia.edu/attachments/37039957/download_file?st=MTQyNjgyNTAxNCwyMDIuMTc0LjE3MC4xNjIsMTIyMTAxMg%3D%3D&amp;amp;s=work_strip&lt;/a&gt; I show the feasible bounds for the modified VaR calculation and provide a small test to show when it is outside those bounds. &lt;/p&gt;&#xA;" OwnerUserId="2911" LastActivityDate="2015-03-20T04:19:02.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17046" PostTypeId="1" CreationDate="2015-03-20T15:43:11.477" Score="2" ViewCount="2810" Body="&lt;p&gt;can I ask you where am I doing something wrong when downloading high-frequency (5-min) S&amp;amp;P 500 data (&quot;USA500.IDX&quot;) from &lt;a href=&quot;https://www.dukascopy.com/swiss/english/marketwatch/historical/&quot; rel=&quot;nofollow&quot;&gt;https://www.dukascopy.com/swiss/english/marketwatch/historical/&lt;/a&gt; and when looking into the downloaded .csv the prices seems to be ten times higher than in reality?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot for your reply! :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit1: as mentioned below in the comment, an example can be my last download: in downloaded file: &quot;USA500.IDX_Candlestick_5_m_BID_19.03.2015-21.03.2015.csv&quot;, the close price on 20.03.2015 23:55 is 21068.00 USD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit2: it seems that the data are really incorrect; Do you know about any other source of 5-min data covering period of e.g. 4 years for any index? (I will also check other frequencies on dukascopy.com and if they will be OK I will try to convert that into 5-min data, but just asking before doing that)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit3: Can I ask you what does this mean: &#xA;Point value* 0.01 USD &#xA;*-For CFD the point is the second decimal digit in a price quote&#xA;( &lt;a href=&quot;https://www.dukascopy.com/swiss/english/cfd/range-of-markets/&quot; rel=&quot;nofollow&quot;&gt;https://www.dukascopy.com/swiss/english/cfd/range-of-markets/&lt;/a&gt; )&#xA;Can this explain my question?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="15683" LastEditorUserId="15683" LastEditDate="2015-03-30T00:24:49.177" LastActivityDate="2015-03-30T00:24:49.177" Title="Downloading high-frequency data: S&amp;P 500" Tags="&lt;historical-data&gt;&lt;index&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17047" PostTypeId="1" CreationDate="2015-03-20T16:58:09.017" Score="2" ViewCount="1822" Body="&lt;p&gt;I am using a GARCH(1, 1) model to try model volatility for a certain stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a GARCH function in matlab that returns the three parameters, omega, alpha &amp;amp; beta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then use this parameters in the formula below to see the forecast volatility. The numbers seems reasonable however the parameters do not.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Sigma t = omega + alpha * Return Squared t-1 + beta * Sigma t-1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The omega is very high half the time above 0.8. My alpha + beta are tend to be very low suggesting low persistance. What would cause this low persistance? I have read that you would expect alpha + beta typically to be close to 1.&lt;/p&gt;&#xA;" OwnerUserId="7530" LastActivityDate="2015-03-21T16:58:55.153" Title="using garch to forecast volatility but getting low persistence model" Tags="&lt;volatility&gt;&lt;time-series&gt;&lt;statistics&gt;&lt;garch&gt;&lt;stochastic-volatility&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17048" PostTypeId="2" ParentId="17031" CreationDate="2015-03-20T19:05:40.240" Score="0" Body="&lt;p&gt;I think you are having trouble differentiating the integral of $\delta$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should remember the differential notation is just notation for an integral:&#xA;$A_td B_t = A'_t dB'_t$ just means $\int_0^T A_td B_t = \int_0^T A'_t dB'_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular, $d\int_0^t A'_s dB'_s = A'_t dB'_t$ is a tautology. So&#xA;$$&#xA;d ( e^{\int_0^t \delta(s,X_s) ds} )= e^{\int_0^t \delta(s,X_s) ds} d (\int_0^t \delta(s,X_s) ds ) = e^{\int_0^t \delta(s,X_s) ds}\delta(t,X_t)dt&#xA;$$  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Applying Ito formula to the product with $T$ gives the result.&lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2015-03-20T19:05:40.240" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17049" PostTypeId="1" AcceptedAnswerId="17054" CreationDate="2015-03-20T20:26:17.190" Score="1" ViewCount="243" Body="&lt;p&gt;In an article, it is mentioned that a parameter is &quot;the variance swap volatility at time t&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know what a variance swap is but I don't know what they could mean by &quot;variance swap volatility&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="15435" LastEditorUserId="15435" LastEditDate="2015-03-20T20:32:51.667" LastActivityDate="2015-03-21T08:09:47.200" Title="Variance Swap volatility" Tags="&lt;volatility&gt;&lt;swaps&gt;&lt;variance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17050" PostTypeId="1" CreationDate="2015-03-20T22:29:30.880" Score="1" ViewCount="247" Body="&lt;p&gt;I am trying to estimate covariance in multiple time series. However, I want to do this using a regime-switching framework. So, I start with fitting a GARCH(1,1) model and then de-volatalize the series. Using this series I try to fit an HMM. Suppose I have only 3 regimes ie: high, medium and low. Now I can assume that correlation is constant across a regime in which case I can use all sample data from a particular regime and fit 3 separate correlation matrices to multiple time series. Also, entire data series was used to fit the GARCH model which implies both correlation and convariance remain constant across a regime for the entire period in consideration. I have a few questions&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Is it a problem to have a constant correlation and convariance matrix for a particular regime for the entire time series?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In the above procedure if I want the correlation in a time period for a regime to not be constant, then I will can fit a dynamic correlation model. What regime data should be used to fit the dynamic model? Should it be all data for the regime or just data for this regime since the last switch? What if the dynamic model fails to fit?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How does correlation one time period affect the correlation in another regime in the next period? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How does correlation one time period affect the correlation in the same regime in the next period, ie after a switch?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2142" LastActivityDate="2015-03-20T22:29:30.880" Title="modeling regime switching for Correlation matrix" Tags="&lt;time-series&gt;&lt;covariance&gt;&lt;correlation-matrix&gt;&lt;hidden-markov-model&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17051" PostTypeId="1" CreationDate="2015-03-21T00:28:52.203" Score="7" ViewCount="6109" Body="&lt;p&gt;The BS formula is deduced using the risk neutral measure. Why can it be used in the real world?&lt;/p&gt;&#xA;" OwnerUserId="13627" LastEditorUserId="1809" LastEditDate="2015-03-22T23:19:26.100" LastActivityDate="2015-03-25T10:09:49.670" Title="Why the Black-Scholes formula can be used in the real world?" Tags="&lt;black-scholes&gt;&lt;risk-neutral-measure&gt;" AnswerCount="5" CommentCount="5" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17052" PostTypeId="2" ParentId="17051" CreationDate="2015-03-21T00:39:37.160" Score="1" Body="&lt;p&gt;Risk-neutral probabilities and physical probabilities agree on what is possible and what is impossible. Also, a hedge under Risk-neutral probability works almost surely and so does the hedge under physical probability.&lt;/p&gt;&#xA;" OwnerUserId="2142" LastActivityDate="2015-03-21T00:39:37.160" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17053" PostTypeId="1" CreationDate="2015-03-21T01:19:27.083" Score="5" ViewCount="820" Body="&lt;p&gt;The command in STATA to estimate the DCC model of two variables is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;mgarch dcc (  x1 x2=, noconstant) , arch(1) garch(1) distribution(t)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{bmatrix} &#xA;  h_1{t}     \\ &#xA;  h_2{t}  &#xA;\end{bmatrix}  = \begin{bmatrix} &#xA;  w_{10}        \\ &#xA;  w_{20}  &#xA;\end{bmatrix}  + \begin{bmatrix} &#xA;  a_{11} &amp;amp; a_{12}   \\ &#xA;  a_{21} &amp;amp; a_{22}  &#xA;\end{bmatrix}  \begin{bmatrix} &#xA;  \epsilon_{1t-1}    \\ &#xA;  \epsilon_{2t-1}   &#xA;\end{bmatrix} + \begin{bmatrix} &#xA;  g_{11} &amp;amp; g_{12}   \\ &#xA;  g_{21} &amp;amp; g_{22}  &#xA;\end{bmatrix} \begin{bmatrix} &#xA;  h_{1t-1}     \\ &#xA;  h_{2t-1}  &#xA;\end{bmatrix}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I give this command, STATA understands that the ARCH and GARCH matrices are diagonal, i.e. $a_{21}=a_{12}=g_{21}=g_{12}=0$. How can I change this to implement a FULL ARCH and GARCH parameter matrices, to capture the spillover effects?&lt;/p&gt;&#xA;" OwnerUserId="15685" LastEditorUserId="19645" LastEditDate="2016-08-14T14:38:52.057" LastActivityDate="2017-04-29T15:06:24.660" Title="DCC GARCH: specifying ARCH and GARCH parameter matrices in STATA" Tags="&lt;volatility&gt;&lt;time-series&gt;&lt;garch&gt;&lt;multivariate&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17054" PostTypeId="2" ParentId="17049" CreationDate="2015-03-21T08:09:47.200" Score="2" Body="&lt;p&gt;i would guess the value of volatility that makes the variance swap with strike equal to it have zero value. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-03-21T08:09:47.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17055" PostTypeId="2" ParentId="17031" CreationDate="2015-03-21T10:37:14.030" Score="1" Body="&lt;p&gt;To shorten the notation, let's write $T_t = T(D_t,y_t)$ and $\delta_t = \delta(D_t,y_t)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two ways to show that, in fact, the dynamics of&#xA;$$ \xi_t = \xi(D_t, y_t,t) = e^{-\int_0^t \delta_s ds}\, T_t $$&#xA;is given by&#xA;$$ \frac{d\xi_t}{\xi_t} = \left( -\delta_t + \frac{\mathscr{L} T_t}{T_t} \right)dt \quad+\quad \text{diffusion terms}. $$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;First way (more formal)&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Write $\xi_t = g_t T_t$, where $g_t = e^{-\int_0^t \delta_s ds}$. It is easy to show that the dynamics of $g_t$ is given by&#xA;$$ \frac{dg_t}{g_t} = -\delta_t \, dt $$&#xA;therefore, by applying Ito's product rule we have&#xA;$$ d\xi_t = d(g_t T_t) = T_t dg_t + g_t dT + dg_t  dT_t = -\delta_t \xi_t dt + g_t dT_t $$&#xA;because the product term vanishes since $dg_t$ has no diffusion. Hence it follows&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{d\xi_t}{\xi_t} = \frac{d\xi_t}{g_tT_t} = -\delta_t dt + \frac{dT_t}{T_t} = &#xA;\left( -\delta_t + \frac{\mathscr{L} T_t}{T_t} \right)dt \quad+\quad \text{diffusion terms}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Second way (less formal)&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The function $g_t = -\int_0^t \delta(D_s,y_s) ds$ is constant w.r.t. both $D_t$ and $y_t$, in the sense that the contribution of the very last realisation at time $t$ of the processes to the integral over $[0,t]$ is almost surely equal to $0$. In other words,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{\partial g_t}{\partial D_t} = \frac{\partial g_t}{\partial y_t} = 0 \, .$$&#xA;Therefore the result follows by noticing that&#xA;$$ \mathscr{L} \xi_t = g_t \mathscr{L} T_t &#xA;\implies&#xA;\frac{\mathscr{L} \xi_t}{\xi_t} = \frac{\mathscr{L} T_t}{T_t}&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="13556" LastEditorUserId="13556" LastEditDate="2015-03-21T10:44:23.803" LastActivityDate="2015-03-21T10:44:23.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17056" PostTypeId="1" CreationDate="2015-03-21T13:56:01.853" Score="-2" ViewCount="129" Body="&lt;p&gt;I want to differentiate w.r.t. &lt;span class=&quot;math-container&quot;&gt;$\sigma^2$&lt;/span&gt; the following equation&lt;br&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$u'(Y)\mu$&lt;/span&gt; + &lt;span class=&quot;math-container&quot;&gt;$\frac{u''(Y)}{2}$$(\sigma^2 + \mu^2) = 0$&lt;/span&gt;&lt;br&gt;&#xA;where we can consider &lt;span class=&quot;math-container&quot;&gt;$\mu$&lt;/span&gt;(reward) as an implicit function of &lt;span class=&quot;math-container&quot;&gt;$\sigma^2$&lt;/span&gt;(risk) of small bets&lt;br&gt;&#xA;u'(Y)&lt;span class=&quot;math-container&quot;&gt;$\frac{du}{d\sigma^2} +\frac{u''(Y)}{2} + \mu u''(Y) \frac{du}{d\sigma^2}=0$&lt;/span&gt;&lt;br&gt;&#xA;Hence,&lt;br&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$u'(\sigma^2)=\frac{u''(Y)}{2(u'(Y) + \mu u''(Y)} $&lt;/span&gt;&lt;br&gt;&#xA;But answer given in the PDF downloaded from the internet is&lt;br&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$u'(\sigma^2)=\frac{u''(Y)}{2(u'(Y) + \mu(\sigma^2) u''(Y)}$&lt;/span&gt;&lt;br&gt;&#xA;Which answer is correct?&lt;br&gt;&#xA;My another question is what does 1st derivative and 2nd derivative of Utility function imply?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My second question is as follows:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a financial market with one single period, with interest&#xA;rate r and one stock S. Suppose that &lt;span class=&quot;math-container&quot;&gt;$S_0 =1$&lt;/span&gt; and, for n=1, &lt;span class=&quot;math-container&quot;&gt;$S_1$&lt;/span&gt; can take&#xA;two different values: 2, 1/2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For which values of r the market is viable? viable means&#xA;(free of arbitrage opportunities).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What if &lt;span class=&quot;math-container&quot;&gt;$S_1$&lt;/span&gt; can also take the value 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt; provided.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We want to calculate the values of r such that there is an arbitrage&#xA;opportunity. We take a portfolio with zero initial value &lt;span class=&quot;math-container&quot;&gt;$V_0=0$&lt;/span&gt; Then we&#xA;invest the amount q in the stock without risk, we have to invest −q in the risky&#xA;stock (q can be negative or positive). We calculate the value of this portfolio in time 2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$V_1(\omega_1)=q(r-1)$&lt;/span&gt;.......(1)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$V_1(\omega_2)=q(r+1/2)$&lt;/span&gt;........(2)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, if r &gt; 1 there is an arbitrage oppportunity taking q positive (money in the&#xA;bank account and short position in the risky stock) and if r &amp;lt; −1/2 we have&#xA;an arbitrage opportunity with q positive (borrowing money and investing in the&#xA;risky stock). The situation does not change if &lt;span class=&quot;math-container&quot;&gt;$S_1$&lt;/span&gt; take the value 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to know,Now if r&amp;lt;-1/2 how there is an arbitrage opportunity?Would any member explain me in his reply?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That means to have a viable market, &lt;span class=&quot;math-container&quot;&gt;$r$&lt;/span&gt; must be between &lt;strong&gt;-0.5 To 1&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="15605" LastEditorUserId="15605" LastEditDate="2019-03-08T12:00:33.100" LastActivityDate="2019-03-08T12:00:33.100" Title="Implicit relation between risk and reward" Tags="&lt;risk&gt;&lt;arbitrage&gt;&lt;no-arbitrage-theory&gt;&lt;self-study&gt;&lt;utility-theory&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="17057" PostTypeId="2" ParentId="17047" CreationDate="2015-03-21T16:58:55.153" Score="1" Body="&lt;p&gt;alpha + beta &amp;lt; 1 is the stationary condition for GARCH. If alpha and beta are low that means volatility of the stock does not have clustering behaviors. I think you can have a look at ADF and PACF of Return^2 time series first. If the first order autocorrelation is very significant but alpha is not, then perhaps you can check on the parameter calibration.&lt;/p&gt;&#xA;" OwnerUserId="5861" LastActivityDate="2015-03-21T16:58:55.153" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17059" PostTypeId="2" ParentId="17051" CreationDate="2015-03-21T19:46:54.397" Score="2" Body="&lt;p&gt;If we are talking about BS world, one plausible explanation is every move in the risk-free world is &quot;perfectly hedgeable&quot;. In other terms if you consider the drift term $\mu = r + \lambda\sigma$ BS formula allows you to reduce $\lambda$ to zero by constantly hedging with the underlying. That is why you can get a correct price with $r$ under BS world.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However &quot;real&quot; real world is different and even in theoretical incomplete markets there are more than one risk-free measure. With some models, there is no perfect hedge. Good luck with that.&lt;/p&gt;&#xA;" OwnerUserId="8147" LastActivityDate="2015-03-21T19:46:54.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17060" PostTypeId="2" ParentId="17056" CreationDate="2015-03-22T05:49:51.477" Score="-1" Body="&lt;p&gt;$$&#xA;\mu = u(\sigma^2)&#xA;$$&#xA;diffentiating&#xA;$$&#xA; diff(u(\sigma^2)^2) = 2u(\sigma^2)u'(\sigma^2)&#xA;=2\mu(\sigma^2)u'(\sigma^2)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;both answer are right &lt;/p&gt;&#xA;" OwnerUserId="15697" LastActivityDate="2015-03-22T05:49:51.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17061" PostTypeId="2" ParentId="17051" CreationDate="2015-03-22T08:54:21.797" Score="1" Body="&lt;p&gt;Because BS is about derivatives and not about the underlying. In a way if you priced derivatives with real world measures (all else being equal) you would double count risk preferences because these are already included in the underlying - think about it this way (beware, oversimplification ahead):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You want to price a derivative on gold, a gold certificate. The product just pays the current price of an ounce in $. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, how would you price it? Would you think about your risk preferences? No, you won't, you would just take the current gold price and perhaps add some spread. Therefore the risk preferences did not matter (=risk neutrality) because this product is derived (= derivative) from an underlying product (=underlying). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is because all of the different risk preferences of the market participants are already included in the price of the underlying and the derivative can be hedged with the underlying continuously (at least this is what is taken for granted in a BS world). As soon as the price of the gold certificate diverges from the original price traders would just buy/sell the underlying and sell/buy the certificate to pocket a risk free profit - and the price will soon come back again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, you see, the basic concept of risk neutrality is quite natural and easy to grasp.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2015-03-25T10:09:49.670" LastActivityDate="2015-03-25T10:09:49.670" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="17062" PostTypeId="2" ParentId="10920" CreationDate="2015-03-22T18:04:47.930" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0387004513&quot; rel=&quot;nofollow&quot;&gt;Glasserman&lt;/a&gt; on pg 166 has a very accessible introduction to LMM under spot and forward measures&lt;/p&gt;&#xA;" OwnerUserId="2142" LastActivityDate="2015-03-22T18:04:47.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17063" PostTypeId="1" AcceptedAnswerId="17086" CreationDate="2015-03-22T18:58:23.807" Score="7" ViewCount="621" Body="&lt;p&gt;I have a conceptual question that I haven't managed to grasp yet and is most likely a econometrics 101 question by here it goes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we estimate a GARCH model for a time series, how do we then use this in my model for the returns? For example; I have the return data of an index. I know that I have volatility clustering in this data. I find a suitable GARCH model for the volatility (variance). Now, if I model the returns an a suitable model, i.e. a regression model, and look at the coefficients and the p-values that it spits out, these values are still based on the regular OLS assumptions right? How do I make use of the GARCH in this model so that I can get coefficients and p-values that have accounted for the conditional heteroscedastic variances in the time series?&lt;/p&gt;&#xA;" OwnerUserId="15700" LastActivityDate="2015-05-31T16:08:16.097" Title="The use of GARCH" Tags="&lt;garch&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17064" PostTypeId="1" CreationDate="2015-03-22T20:30:25.450" Score="1" ViewCount="536" Body="&lt;p&gt;Below is an implementation of the numerical solution of the Heston SDE using Euler discretization. It takes under a second to run on Mathematica.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The calibration parameters give a good fit to the volatility surface using the characteristic function/Fourier transform technique.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to use the below code to price an exotic derivative by MC simulation but I am unable to match the volatility surface as a first step. I suspect the code is simply taking too long to converge. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any quick fixes that can speed this code up significantly?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\[Rho] = -0.4042;&#xA;v0 = 0.2577^2;&#xA;\[Kappa] = 0.2656;&#xA;vbar = .1851;&#xA;\[Sigma]v = 0.2992;&#xA;n = 100;&#xA;NPaths = 100;&#xA;Tmax = 574/365;&#xA;dt = Tmax/n;&#xA;dw = RandomVariate[&#xA;BinormalDistribution[{Sqrt[dt], Sqrt[dt]}, \[Rho]], {NPaths, n}];&#xA;&#xA;HestonPaths[G0_] :=&#xA; Module[{XPaths, X, v},&#xA;  XPaths = {};&#xA;  Do[&#xA;   X = {Log[G0]};&#xA;   v = {v0};&#xA;   Do[&#xA;    v = Append[v, &#xA;      Abs[Last[v] + \[Kappa] (vbar - Last[v]) dt + &#xA;        Sqrt[Last[v]] \[Sigma]v dw[[idx, i]][[1]]]];&#xA;    X = Append[X, &#xA;      Last[X] - 1/2 Last[v] dt + Sqrt[Last[v]] dw[[idx, i]][[2]]];&#xA;    , {i, 1, n}];&#xA;   XPaths = Append[XPaths, X];&#xA;   , {idx, 1, NPaths}];&#xA;  Exp[XPaths]&#xA;  ]&#xA;&#xA;ListLinePlot[HestonPaths[500]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="15702" LastActivityDate="2015-04-06T16:25:47.397" Title="Euler discretization of Heston SDE in Mathematica" Tags="&lt;heston&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17065" PostTypeId="2" ParentId="17064" CreationDate="2015-03-22T21:25:37.687" Score="1" Body="&lt;p&gt;change the discretization and use the QE-M approach: &lt;a href=&quot;http://www.ressources-actuarielles.net/EXT/ISFA/1226.nsf/0/1826b88b152e65a7c12574b000347c74/$FILE/LeifAndersenHeston.pdf&quot; rel=&quot;nofollow&quot;&gt;Andersen (2006)&lt;/a&gt;&#xA;the bias is way smaller than the one of the simple Euler. further u can try to use control variates/anthitetic numbers to reduce the sample variance. &lt;/p&gt;&#xA;" OwnerUserId="6640" LastActivityDate="2015-03-22T21:25:37.687" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17066" PostTypeId="2" ParentId="17051" CreationDate="2015-03-22T23:11:00.920" Score="7" Body="&lt;p&gt;The risk-neutral probability is used as a convenient mathematical tool but, strictly speaking, it is not a necessary ingredient for the BS formula. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, the formula can be derived by computing the expectation (under the physical probability) of the option payoff, properly discounted with the right stochastic discount factor:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ p_t = E_t[\;m_{t,T}\; f(S_T)\,] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $f$ is the payoff function of the derivative, a function of the realisation at maturity time $T$ of the underlying, i.e. $S_T$. The BS formula for a call option is obtained by choosing the corresponding payoff function (exercise: what is it?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The stochastic discount factor (SDF) $m_{t, T}$ is a positive random variable which discounts for both time and risk. In every possible state of the world encompassed by the expectation operator, the value of the $SDF$ in that state gives a weight to the payoff. For instance, a good payoff in a very bad state is highly valuable: the SDF will give a very strong weight to that state, which ultimately leads to an higher price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The effect of the SDF may as well be described by means of the risk-neutral probability: after all, it all boils down to give the right weights (probabilities) to each state. Hence we can write&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ p_t = E_t[\;m_{t,T}\; f(S_T)\,] = E^Q[\, e^{-r(T-t)} f(S_T) \,] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Q$ is the risk-neutral probability, which accounts for the risk discounting.&lt;/p&gt;&#xA;" OwnerUserId="13556" LastActivityDate="2015-03-22T23:11:00.920" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17076" PostTypeId="2" ParentId="115" CreationDate="2015-03-24T00:59:46.807" Score="1" Body="&lt;p&gt;FinAnalytica Inc www.finanalytica.com has a multi-asset class commercial implementation including fitted classical tempered stable distributions and fitted skewed t-distributions (for lower frequency data) in its software named Cognity. You should talk to those guys. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Their backtests do all the talking...risk forecasts from left tail all the way through to the right tail are way better than Gaussian, Cauchy, more rudimentary Levy aplha-stable and of course the classical historical approaches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They also offer GARCH models (big improvement over the ubiquitous EWMA model) to capture vol clustering and a fat tailed copula to model dependence and most importantly the joint tail dependencies which no linear model can handle.     &lt;/p&gt;&#xA;" OwnerUserId="15716" LastActivityDate="2015-03-24T00:59:46.807" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17077" PostTypeId="2" ParentId="16733" CreationDate="2015-03-24T02:04:54.557" Score="1" Body="&lt;p&gt;Risk-free rate is used to discount future values to today; but we use this rate to denote cost of capital (loosely speaking) i.e., you can borrow/lend at this rate. US Treasuries would be used if the entity whose securities were being valued enjoyed the same credit as the government. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since most banks can &lt;strong&gt;&lt;em&gt;at best&lt;/em&gt;&lt;/strong&gt; borrow at OIS/LIBOR; this becomes the rate of choice when valuing securities. As a side, if you wanted to value securities issued by a known bad credit, you would discount the future values more heavily using a rate higher than LIBOR/OIS.&lt;/p&gt;&#xA;" OwnerUserId="13610" LastActivityDate="2015-03-24T02:04:54.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17078" PostTypeId="2" ParentId="17051" CreationDate="2015-03-24T04:44:42.780" Score="10" Body="&lt;p&gt;&lt;strong&gt;The short answer is:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;As long as a derivative can be perfectly replicated via hedging in the underlying asset then the price of the derivative should be independent of investors' risk aversion and hence the application of risk-neutral probabilities and discounting of the future expected payoff under risk neutral probability leads to the same price of the derivative as an application of real-world probabilities would.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Longer answer:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;The above has been proven and shown by Black and Scholes' seminal work (along with Robert Merton). Note that several conditions have to be met in order to assure one can move into a risk-neutral pricing framework:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Derivative can be replicated by trading in the underlying asset(s) and trading in the money market.&lt;/li&gt;&#xA;&lt;li&gt;No arbitrage requirement&lt;/li&gt;&#xA;&lt;li&gt;Complete Market&lt;/li&gt;&#xA;&lt;li&gt;Law of one price, among others&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Please note that contrary to the statement of another user one can perfectly price derivatives via real-world probabilities. But the problem is that one would have to have knowledge of how to discount each expected future payoff, meaning, one would have to know investors' risk preferences. That is virtually impossible or at least very difficult, hence, the whole application of risk-neutral pricing is in order to simplify the work of pricing derivative securities.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Note of caution&lt;/strong&gt;: One cannot use risk-neutral pricing to assess the future value of a derivative. The reason for that is that the underlying assets do not grow at a risk-free rate, generally a risk-premium has to be applied.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2015-03-24T04:44:42.780" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17079" PostTypeId="2" ParentId="11357" CreationDate="2015-03-24T08:40:03.900" Score="0" Body="&lt;p&gt;Interest rate differentials is the most justifiable fundamental input, also the most explanatory second order input you should use. Another is the slope of the yield curve and the difference in slope between pairs.  You can also look at the relative difference in speed of interest rate changes.  Another fundamental input is the real IR spread.  Good luck.&lt;/p&gt;&#xA;" OwnerUserId="15720" LastActivityDate="2015-03-24T08:40:03.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17081" PostTypeId="2" ParentId="3607" CreationDate="2015-03-24T09:47:47.777" Score="1" Body="&lt;p&gt;As a practical example, I have generated a sequence of returns where mean log returns are -12%, while the arithmetic mean is +1.1%. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can happen with very heavy tailed distributions and, e.g. in evaluating hedge fund performance, the arithmetic return will mask this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A glance at an equity curve would also highlight the issue so in reality no-one is likely to be fooled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For unleveraged investing in stocks and indices it will make very little difference, but the arithmetic version is clearly wrong in some cases as it will give a positive sharpe for a series of returns resulting in a large loss of capital.&lt;/p&gt;&#xA;" OwnerUserId="15721" LastActivityDate="2015-03-24T09:47:47.777" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17082" PostTypeId="2" ParentId="11357" CreationDate="2015-03-24T12:13:49.147" Score="1" Body="&lt;p&gt;Actually you can find a papers talking about some relationship between almost any two types of indicators. But based on my work this what I suggest you add:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Commodities futures (continues) (Many paper on the relationship between oil prices and USD, gold/silver and USD)&lt;/li&gt;&#xA;&lt;li&gt;Market indices (DJI, S&amp;amp;P500, DAX, SET, NZ40, ...)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I would also suggest that you inverse the patterns of these indices and futures and add both original and inversed pattern.&lt;/p&gt;&#xA;" OwnerUserId="15722" LastActivityDate="2015-03-24T12:13:49.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17083" PostTypeId="1" AcceptedAnswerId="17088" CreationDate="2015-03-24T12:52:47.383" Score="12" ViewCount="3517" Body="&lt;p&gt;Without having to use Black-Scholes, how do I price this option using a basic no-arbitrage argument?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Question&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Assume zero interest rate and a stock with current price at \$$1$ that pays no dividend. When the price hits level \$$H$ ($H&amp;gt;1$) for the first time you can exercise the option and receive \$$1$. What is the fair price $C$ of the option today?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;My thoughts so far&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;According to my book, the answer is $\frac{1}{H}$. I'm stuck on the reasoning.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly I'm not going to pay more than \$$\frac{1}{H}$ for this option. If $C &amp;gt; \frac{1}{H}$ then I would simply sell an option and buy $C$ shares with $0$ initial investment. Then:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If the stock reaches $H$ I pay off the option which costs \$$1$ but I have $\$CH &amp;gt; 1$ worth of shares.&lt;/li&gt;&#xA;&lt;li&gt;If the stock does not reach $H$ I don't owe the option owner anything but I still have $CH&amp;gt;0$ shares.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What if $C&amp;lt;\frac{1}{H}$? Then $CH&amp;lt;1$ and I could buy $1$ option at \$$C$ by borrowing $C$ shares at \$$1$ each. Then:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If the stock reaches $H$ then I receive $1-CH &amp;gt; 0$ once I pay back the $C$ shares at $\$H$ each.&lt;/li&gt;&#xA;&lt;li&gt;But if the stock &lt;em&gt;does not&lt;/em&gt; reach $H$, then I do not get to exercise my option and I still owe $C  S_t $ where $S_t$ is the current price of the stock. This is where I am stuck.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="15723" LastEditorUserId="6101" LastEditDate="2015-07-24T19:36:22.270" LastActivityDate="2015-07-24T19:36:22.270" Title="What is the fair price of this option?" Tags="&lt;options&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="7" CommentCount="3" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17084" PostTypeId="2" ParentId="17083" CreationDate="2015-03-24T14:28:01.107" Score="3" Body="&lt;p&gt;Consider a portfolio where I sell $\frac{1}{H}$ in stock and use that to buy an option. This is a 0 cost portfolio. When I hit the barrier the price of this portfolio is also 0. Law of one price would suggest that this portfolio should be zero cost at all times. So the price of the option at any time must be &#xA;$$ &#xA;C_t = \frac{1}{H}*S_t &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, the option should eventually get exercised.&lt;/p&gt;&#xA;" OwnerUserId="2142" LastEditorUserId="2142" LastEditDate="2015-03-24T18:54:45.030" LastActivityDate="2015-03-24T18:54:45.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17085" PostTypeId="2" ParentId="12830" CreationDate="2015-03-24T15:08:00.727" Score="0" Body="&lt;p&gt;In the credit modelling industry is more popular the use of the logistic regression with respect to the Poisson one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is for several reasons. Here I listed the main ones:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) The Logistic regression is empirically shown to be better in describing that kind of phaenomenona in terms of forecasting performances and predictive capacity (try to compare the performance ratio for both of them: Accuracy ratio, ROC,...).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) The Logistic regression suffers less the overdispersion problem that is a features of the Poisson regression models and only sometimes can be solved by using a Bivariate regression model, as, for instance, in the health care industry analysis case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) The Logistic regression is simpler to be implemented with respect to both the programming point of view and a theoretical point of view.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is as regards the estimation of the probability of default. In other cases, this could be not completely true.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suggest you to read &lt;a href=&quot;https://mathdept.iut.ac.ir/sites/mathdept.iut.ac.ir/files/AGRESTI.PDF&quot; rel=&quot;nofollow&quot;&gt;Categorical Data Analysis&lt;/a&gt; by Agresti, to have a more deepen knowledge of this topic (from an econometric point of view) and, moreover, to try to test which model is better; generally, it is as above, but it depends on the economic cycle, data sample,... etc.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-03-24T15:08:00.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17086" PostTypeId="2" ParentId="17063" CreationDate="2015-03-24T19:02:26.047" Score="1" Body="&lt;p&gt;You first fit a ARIMA model to the returns data and then a GARCH model to the residuals.&lt;/p&gt;&#xA;" OwnerUserId="2142" LastActivityDate="2015-03-24T19:02:26.047" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17088" PostTypeId="2" ParentId="17083" CreationDate="2015-03-24T21:28:01.523" Score="9" Body="&lt;p&gt;This option is a perpetual one touch option.  Its price depends on the model used; additional assumptions are required to get a model-independent price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us first consider 3 important example models for stock price $S$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Constant:&lt;/strong&gt; $S(t) \equiv 1.$  There is $0$ probability that the perpetual one touch pays off, so its price is $0.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Black-Scholes:&lt;/strong&gt; $S$ follows geometric Brownian motion with volatility $\sigma &amp;gt; 0.$  Option price $C(S,t)$ satisfies a PDE $C_t + 1/2 \sigma^2 S^2 C_{ss} = 0.$  Since it is perpetual, $C(S,t)$ cannot depend on $t$ and so $C_t = 0.$  Then the PDE reduces to an ODE $C_{ss}=0.$  With boundary values $C(0)=0$ and $C(H)=1$ the solution is $C(S)=S/H.$  With $S(0)=1$ option value is $1/H.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Bachelier:&lt;/strong&gt; $S$ follows arithmetic Brownian motion with volatility $\sigma &amp;gt; 0$ and no drift.  Since Brownian motion is recurrent, with probability one $S$ will reach the level $H$.  Thus the perpetual one touch has value $1.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt;  Geometric Brownian motion is not guaranteed to reach the level $H.$  When we take log of GBM, it is an arithmetic Brownian motion with drift $-1/2 \sigma^2 dt.$  This negative drift is enough to allow some paths of log-spot to stay below the barrier level at $log(H).$  The probability of hitting the barrier is the option price $C(S,t)$ we calculated by PDE above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now lets return to the original question about making a model-independent no arbitrage price.  Clearly from the examples it is impossible; different models give different prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can get a little farther by assuming that $S(t) \ge 0.$  In this case the original poster correctly argues the fair value has $C \le 1/H.$  But we still get a range of prices.  The Black-Scholes model with zero rates and positive volatility gives $C = 1/H.$  But for the constant model the fair value is 0.  Any value $0 \le C \le 1/H$ is possible: consider the model where at time $0$ with risk-neutral probability $HC$ the stock follows a GBM with volatility $\sigma &amp;gt; 0$ and with probability $1-HC$ it remains fixed at 1 forever.  The expected value under the risk neutral measure is $HC \cdot 1/H + (1-HC) \cdot 0 = C.$  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no obvious choice for a hidden assumption to rule out these other models.  So there is not a model-free fair value of this option.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastEditorUserId="11936" LastEditDate="2015-03-25T10:34:21.207" LastActivityDate="2015-03-25T10:34:21.207" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="17089" PostTypeId="1" AcceptedAnswerId="17094" CreationDate="2015-03-24T22:17:32.310" Score="1" ViewCount="487" Body="&lt;p&gt;I have a mathematics background and I am currently doing a Masters in Financial Mathematics. I am required to write an essay in a financial mathematics area but I have little knowledge about it since I have just started the course. Could any one suggest me a good essay topic or thesis topic, if possible one in the area of risk management? I want to write an essay that is 60% mathematics concepts.&lt;/p&gt;&#xA;" OwnerUserId="15726" LastActivityDate="2020-11-10T11:16:07.847" Title="Financial Mathematics essay topic" Tags="&lt;statistical-finance&gt;&lt;financial-engineering&gt;&lt;financial&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17090" PostTypeId="2" ParentId="17064" CreationDate="2015-03-24T22:31:29.313" Score="1" Body="&lt;p&gt;Some simple improvements: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Replace the Euler discretization approximation of the volatility to a Milstein discretization approximation. See e.g. &lt;a href=&quot;http://www.frouah.com/finance%20notes/Euler%20and%20Milstein%20Discretization.pdf&quot; rel=&quot;nofollow&quot;&gt;these notes&lt;/a&gt; by Rouah. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) 100 Paths is a very low number of paths, and leads to a big standard error in your estimate. So this should be increased by a factor of ~100.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) You should use some form of variance reduction. Antithetic variables are easy to implement and give a great improvement on your standard error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As Phun mentioned, there are a number of more complicated approaches that you could use to construct your paths. These reduce your bias, since these can approaches can typically avoid the variance from becoming negative. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I would suggest trying the above simplifications first, because the bias should not be extremely big. With this scheme you should be able to get pretty close to the implied volatilities as determined by the Fourier pricing method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And finally, some sanity checks: did you calibrate the Heston model using a zero rate as well? Do you exponentiate the final HestonPaths to get the &quot;actual&quot; Heston Paths? (since you are approximating $d\log[S]$).&lt;/p&gt;&#xA;" OwnerUserId="3371" LastActivityDate="2015-03-24T22:31:29.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17091" PostTypeId="2" ParentId="17033" CreationDate="2015-03-24T23:38:40.317" Score="2" Body="&lt;p&gt;You'll want to adjust the contract inputs you're sending to IB&lt;/p&gt;&#xA;&#xA;&lt;p&gt;secType should be CASH,&#xA;exchange should be IDEALPRO,&#xA;and add in whatToShow = &quot;MIDPOINT&quot; or &quot;BID&quot; or &quot;ASK&quot;&lt;/p&gt;&#xA;" OwnerUserId="15727" LastActivityDate="2015-03-24T23:38:40.317" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17092" PostTypeId="2" ParentId="9773" CreationDate="2015-03-24T23:41:58.967" Score="2" Body="&lt;p&gt;You'll want the ibrokers package, its very good and built on the c++ api.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also check out quantmod, performanceanalytics, and highfrequency package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And a comprehensive list,  &lt;a href=&quot;http://cran.r-project.org/web/views/Finance.html&quot; rel=&quot;nofollow&quot;&gt;http://cran.r-project.org/web/views/Finance.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15727" LastEditorUserId="15727" LastEditDate="2015-04-01T17:13:31.300" LastActivityDate="2015-04-01T17:13:31.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17093" PostTypeId="2" ParentId="17083" CreationDate="2015-03-25T00:00:58.593" Score="1" Body="&lt;p&gt;Is the option perpetual? If so, the $C=1/H$ answer looks suspicious and $C=1$ is more plausible for the reasons detailed below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $C&amp;lt;1$, you borrow \$$C$, buy the option, wait until the underlying hits the barrier, receive \$1 payout, repay the \$$C$ debt (we have assumed 0 interest) and pocket the difference. Similarly, if $C&amp;gt;1$ then one can arbitrage it by selling the option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, the fair value of the option is the risk-neutral expected value of the discounted payout. If we model the underlying as a geometric Brownian motion, then it will hit $H$ almost surely, so the payout will be $1 with probability 1. We need to discount this amount to today, and we don't know when the payout will happen (&lt;a href=&quot;http://en.wikipedia.org/wiki/Hitting_time&quot; rel=&quot;nofollow&quot;&gt;the hitting time would have a Lévy distribution&lt;/a&gt;), but it's not an obstacle, because with zero interest rate, discount factor will always equal to 1 no matter the time. So again we arrive at fair value of \$1.&lt;/p&gt;&#xA;" OwnerUserId="15728" LastActivityDate="2015-03-25T00:00:58.593" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17094" PostTypeId="2" ParentId="17089" CreationDate="2015-03-25T00:40:33.293" Score="1" Body="&lt;p&gt;According to me, you should be consider the use of the fractal distribuion/law power distribution in risk management. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently, those topics are up-to-date in the risk management area and, more generally, in finance since those probability distribution should predict financial risks better than actually the Normal distribution do (see, e.g., the fat-tails issue).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Browse on the internet, for instance, typing on google some key words (Mandelbrot, Taleb, Sornette,...)about some authors  (Mandelbrot, Taleb, Sornette, Derman...) that deal with those topics (fractal distribution, law power distribution, black swans, dragon kings) and choose some you are interested for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Those topic are 70% mathematics / 30% finance and I think they should fit your needings pretty well.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-03-25T00:40:33.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17095" PostTypeId="1" CreationDate="2015-03-25T02:08:58.413" Score="2" ViewCount="450" Body="&lt;p&gt;Question: Suppose that the risk-free return is equal to the expected return of the global minimum variance portfolio. Show that there is no tangency portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A hint for the question states:&#xA;Show there is no $\delta$ and $\lambda$ satisfying&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\delta\Sigma^{-1}(\mu-R_f\iota)= \lambda\pi_\mu + (1-\lambda)\pi\iota$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but I'm not sure what to make of it. Any help is appreciated.&lt;/p&gt;&#xA;" OwnerUserId="15267" LastEditorUserId="16249" LastEditDate="2015-06-05T06:58:24.360" LastActivityDate="2015-10-03T14:52:40.467" Title="How do I show that there is no tangency portfolio?" Tags="&lt;portfolio&gt;&lt;mean-variance&gt;&lt;minimum-variance&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17096" PostTypeId="2" ParentId="16655" CreationDate="2015-03-25T03:15:18.227" Score="1" Body="&lt;p&gt;It appears that you are plotting your analytical delta as a % of the delta of the underlying.  This is why the delta converges to 100%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the numerical delta, it could be that you are not adjusting for the DV01 of the underlying.  This would explain why the numerical delta still increases as the option gets more in the money and why the distortion is larger for longer maturities (larger DV01).&lt;/p&gt;&#xA;" OwnerUserId="15338" LastActivityDate="2015-03-25T03:15:18.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17097" PostTypeId="2" ParentId="16275" CreationDate="2015-03-25T03:35:29.923" Score="1" Body="&lt;p&gt;Generally it is best to use the rates that best capture how the collateral of the instruments are priced.  If the overnight collateral on the instruments is managed using offshore JPY depo, then this would be a good choice.&lt;/p&gt;&#xA;" OwnerUserId="15338" LastActivityDate="2015-03-25T03:35:29.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17099" PostTypeId="1" CreationDate="2015-03-25T05:15:21.850" Score="2" ViewCount="203" Body="&lt;p&gt;There are n strategies which are going to be combined linearly. Using a pre-exisiting model I get a set of n weights which will be used to combine the strategies. But the model does not take correlation between strategies into account. How do we account for correlation between strategies when they are added linearly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mathematically,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;w_1, w_2 ... w_n&lt;/code&gt; are the weights assigned to n strategies. I have the correlation matrix &lt;code&gt;C&lt;/code&gt; of the returns from these n strategies. How will these weights be adjusted then to account for correlation between the strategies?&lt;/p&gt;&#xA;" OwnerUserId="15583" LastActivityDate="2015-03-25T08:41:01.977" Title="How to account for correlation between strategies when they are added linearly?" Tags="&lt;statistics&gt;&lt;quant-trading-strategies&gt;&lt;correlation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17101" PostTypeId="2" ParentId="17099" CreationDate="2015-03-25T07:38:02.597" Score="3" Body="&lt;p&gt;You are not forced to apply a certain way to account for correlations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recommend you think about the big picture first: Why do you want to account for correlations? Do you want to have a diversified book, return wise? Then you should look at which strategy returns correlate highly and weigh those strategies relatively lesser than other strategies, possibly in a way to have the sum of weights of highly correlating strategies equal the weights of lowly correlating strategies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may specifically want to look at a Bayesian approach, such as the Black-Litterman or a Blend Covariance approach before delving into more complex models.  The latter allows you to blend chosen weights with factors derived from a covariance matrix implied from a factor model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively you could treat the strategies as traded assets (which they essentially are) and build a mean-variance optimized portfolio.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2015-03-25T08:41:01.977" LastActivityDate="2015-03-25T08:41:01.977" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17102" PostTypeId="1" AcceptedAnswerId="17104" CreationDate="2015-03-25T10:59:21.020" Score="7" ViewCount="400" Body="&lt;p&gt;Suppose that $S$ follows a geometric brownian motion&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dS=S(\mu dt+\sigma dB).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is well understood that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S_{T}=S_{0}exp((\mu-\dfrac{\sigma^{2}}{2})T+\sigma B_{T}).$$&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Method 1 (I have no problem with this)&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Letting $f(S)=log(S)$ and doing a 2nd order Taylor expansion and&#xA;noting that $(dB)^{2}=dt$. For example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d(log(S)) = f'(S)dS+\dfrac{1}{2}f''(S)S^{2}\sigma^{2}dt=\dfrac{1}{S}(\mu dt+\sigma SdB)-\dfrac{1}{2}\sigma^{2}dt=(\mu-\dfrac{\sigma^{2}}{2})dt+\sigma dB.\quad (*)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It follows that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$log(S_{T})=log(S_{0})+(\mu-\dfrac{\sigma^{2}}{2})T+\sigma B_{T}$$&#xA;and hence &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S_{T}=S_{0}exp((\mu-\dfrac{\sigma^{2}}{2})T+\sigma B_{T}).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above derivation is perfectly fine and can be found on Wikipedia&#xA;for example.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Method 2 (is this allowed?)&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Let's use Ito's lemma&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dF(t,X(t))=(F_{t}'+a(t)F_{x}'+\dfrac{1}{2}b(t)^{2}F''_{xx})dt+(b(t)F'_{x})dB&#xA;$$&#xA;for a process &#xA;$dX(t)=a(t)dt+b(t)dB(t)$ and for a function $F(t,X(t))$. Let $F(t,X(t))=log(X(t)).$ Let $dS=S\mu dt+S\sigma dB$, and let $a(t)=S\mu$ and $b(t)=S\sigma$. &lt;strong&gt;This is my question: $a(\cdot)$ is a function of $t$ and not $S$, so is this still OK to do?&lt;/strong&gt;. Then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dF=(0+\mu+\dfrac{1}{2}\sigma^{2}S^{2}\times(\dfrac{-1}{S^{2}}))dt+\sigma\dfrac{S}{S}dB=(\mu-\dfrac{1}{2}\sigma^{2})dt+\sigma dB.$$&#xA;Here we arrive at (*) from Method 1 and hence the result follows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is this derivation technically correct? Just because it gives the right answer, it does not imply the method is sound.&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="15723" LastActivityDate="2015-03-25T19:18:58.750" Title="Is this application of Ito's lemma correct?" Tags="&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17104" PostTypeId="2" ParentId="17102" CreationDate="2015-03-25T15:21:08.133" Score="4" Body="&lt;p&gt;The second method you use is correct and, actually, is completely equivalent to the first one. The reason is that the proof of Ito's lemma relies on a Taylor expansion of the second order.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice that Wikipedia's formulation of Ito's lemma is a bit misleading, as they write &#xA;$$ dX_t = \mu_t dt + \sigma_t dB_t $$&#xA;but, actually, the functions $\mu$ and $\sigma$ are allowed to depend on $X$, that is&#xA;$$ \mu_t = \mu(t,X_t) \qquad \text{and}\qquad \sigma_t = \sigma(t,X_t). $$&#xA;Hence your application of Ito's lemma is formally correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: See for instance &lt;a href=&quot;http://www.sjsu.edu/faculty/watkins/ito.htm&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; for a derivation of the lemma, where the fact that $\mu$ and $\sigma$ can depend on $X_t$ is made explicit after equation (1).&lt;/p&gt;&#xA;" OwnerUserId="13556" LastEditorUserId="13556" LastEditDate="2015-03-25T19:18:58.750" LastActivityDate="2015-03-25T19:18:58.750" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17105" PostTypeId="2" ParentId="17007" CreationDate="2015-03-25T16:32:52.137" Score="2" Body="&lt;p&gt;You can do this using the &lt;code&gt;optim&lt;/code&gt; function in R. One possible solution is as follows:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;base &amp;lt;- c(0.9190, 0.0739, 0.0072, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, &#xA;          0.0113, 0.9126, 0.0709, 0.0031, 0.0021, 0.0000, 0.0000, 0.0000, &#xA;          0.0010, 0.0256, 0.9119, 0.0533, 0.0062, 0.0021, 0.0000, 0.0000, &#xA;          0.0000, 0.0021, 0.0536, 0.8794, 0.0546, 0.0083, 0.0010, 0.0010, &#xA;          0.0000, 0.0011, 0.0043, 0.0500, 0.8512, 0.0733, 0.0043, 0.0159, &#xA;          0.0000, 0.0011, 0.0011, 0.0054, 0.0597, 0.8219, 0.0217, 0.0890, &#xA;          0.0000, 0.0044, 0.0044, 0.0087, 0.0251, 0.0590, 0.6780, 0.2205, &#xA;          0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 1.0000)&#xA;&#xA;stress &amp;lt;- c(0.9079, 0.0829, 0.0072, 0.0010, 0.0010, 0.0000, 0.0000, 0.0000, &#xA;            0.0010, 0.9122, 0.0785, 0.0062, 0.0010, 0.0010, 0.0000, 0.0000, &#xA;            0.0092, 0.0236, 0.9004, 0.0544, 0.0072, 0.0031, 0.0010, 0.0010, &#xA;            0.0000, 0.0032, 0.0594, 0.8695, 0.0530, 0.0117, 0.0012, 0.0021, &#xA;            0.0000, 0.0011, 0.0066, 0.0769, 0.8055, 0.0879, 0.0099, 0.0121, &#xA;            0.0000, 0.0011, 0.0023, 0.0045, 0.0647, 0.8275, 0.0409, 0.0590, &#xA;            0.0023, 0.0000, 0.0023, 0.0125, 0.0228, 0.1286, 0.6064, 0.2253, &#xA;            0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 1.0000)&#xA;&#xA;t1 &amp;lt;- c(0.9416, 0.0584, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, &#xA;        0.0456, 0.9089, 0.0434, 0.0011, 0.0000, 0.0011, 0.0000, 0.0000, &#xA;        0.0000, 0.1010, 0.8704, 0.0267, 0.0006, 0.0000, 0.0013, 0.0000, &#xA;        0.0000, 0.0019, 0.0742, 0.8844, 0.0367, 0.0028, 0.0000, 0.0000, &#xA;        0.0000, 0.0000, 0.0019, 0.0825, 0.8349, 0.0732, 0.0075, 0.0000, &#xA;        0.0010, 0.0000, 0.0000, 0.0020, 0.0654, 0.8371, 0.0946, 0.0000, &#xA;        0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0813, 0.6862, 0.2325, &#xA;        0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 1.0000)&#xA;&#xA;&#xA;base &amp;lt;- matrix(base, nrow=8, ncol=8, byrow=TRUE)&#xA;stress &amp;lt;- matrix(stress, nrow=8, ncol=8, byrow=TRUE)&#xA;t1 &amp;lt;- matrix(t1, nrow=8, ncol=8, byrow=TRUE)&#xA;&#xA;sum.variance &amp;lt;- function(s, base, stress, t1) {&#xA;  t1.fitted &amp;lt;- (1-s)*base + s*stress&#xA;  t1.variance &amp;lt;- (t1 - t1.fitted)^2&#xA;  sum(t1.variance)&#xA;}&#xA;&#xA;res &amp;lt;- optim(par=0.5, fn=sum.variance, method=&quot;BFGS&quot;, base=base, stress=stress, t1=t1)&#xA;&#xA;sprintf(&quot;[S]=%f%%&quot;, res$par*100)&#xA;&#xA;sprintf(&quot;sum[t1 variance]=%f%%&quot;, res$value*100)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[1] &quot;[S]=41.872702%&quot;&#xA;[1] &quot;sum[t1 variance]=2.561079%&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="15736" LastActivityDate="2015-03-25T16:32:52.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17106" PostTypeId="1" CreationDate="2015-03-25T17:50:01.587" Score="2" ViewCount="89" Body="&lt;p&gt;I do a lot of analysis on order flow, tape reading, as it gives insight into what market participants want, or may be willing to do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In comparison, price charts show what happened, and technical indicators are based on that. Order flow and market depth show what COULD happen, as there may be a large order and participant on the order book that never got filled but could be the liquidity you are looking for, or everyone was jumping in front of this order so they could get filled faster - or a whole host of other things. Many times abnormal order sizes are indicators of interest, or completely fake, but influence the behavior of other orders.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anything that puts the tape, market depth and others into a time series or data visualization?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any insight&lt;/p&gt;&#xA;" OwnerUserId="1453" LastActivityDate="2015-03-25T17:50:01.587" Title="Charting order depth over time periods" Tags="&lt;market-data&gt;&lt;liquidity&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17108" PostTypeId="1" AcceptedAnswerId="17118" CreationDate="2015-03-25T20:31:36.220" Score="2" ViewCount="327" Body="&lt;p&gt;I have a little problem: &#xA;in the binomial option pricing model, the price of a european derivative security $V_{n}$ satisfies:&#xA;$V_{n}=[1/(1+r)]*[\tilde{p}*optionUp +\tilde{q}*optionDown]$&#xA;where:&#xA;$\tilde{p}=\frac{e^{r*\Delta T} -d}{u-d}$&#xA;But when I read the article &quot;option pricing model&quot; on Wikipedia(&lt;a href=&quot;http://en.wikipedia.org/wiki/Binomial_options_pricing_model&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Binomial_options_pricing_model&lt;/a&gt;), the $\tilde{p}$ of Wikipedia's $\textbf{algorithm}$ is slightly different: &#xA;$\tilde{p}=\frac{(ue^{-r*\Delta T} -1)*u}{u^2-1}$ (I take q=0)&#xA;I try to compare these 2 forms but they are not equal... why ???&#xA;Thanks !&#xA;:)&lt;/p&gt;&#xA;" OwnerUserId="15738" LastActivityDate="2015-03-26T19:21:58.680" Title="binomial option pricing model - problem with risk-neutral probability" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;binomial&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17111" PostTypeId="1" AcceptedAnswerId="17120" CreationDate="2015-03-25T21:47:31.730" Score="2" ViewCount="364" Body="&lt;p&gt;I was asked in an interview about how the vol smile affect the price of a binary option, which is essentially the Prob(ITM) under risk neutral measure.  My thought is that the implied vol at spot which makes the option OTM is high, that means the prob(ITM) at that region is higher and so the price of binary option.  Please correct me or give a more rigorous extension to my thoughts.&lt;/p&gt;&#xA;" OwnerUserId="15235" LastActivityDate="2015-03-26T23:07:35.287" Title="Effect of vol smile on risk neutral probability of ITM" Tags="&lt;option-pricing&gt;&lt;implied-volatility&gt;&lt;volatility-smile&gt;&lt;binary-options&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17114" PostTypeId="1" AcceptedAnswerId="17123" CreationDate="2015-03-26T08:57:50.023" Score="4" ViewCount="5125" Body="&lt;p&gt;I am trying to understand why these curves are important, and what they are used for in the industry today (if not at all).&lt;/p&gt;&#xA;" OwnerUserId="15088" LastActivityDate="2015-03-27T05:06:53.740" Title="What is the difference between a benchmark yield curve, funding curve and a basis spread curve?" Tags="&lt;interest-rates&gt;&lt;market-data&gt;&lt;multicurve&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17116" PostTypeId="1" AcceptedAnswerId="17117" CreationDate="2015-03-26T14:56:20.813" Score="3" ViewCount="8393" Body="&lt;p&gt;I use Yahoo finance to get financial data. How do I get a list of all the ticker symbols in NYSE, NYSEMKT and NASDAQ stock exchanges. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Or even just one of the exchanges)&lt;/p&gt;&#xA;" OwnerUserId="6661" LastActivityDate="2017-10-28T21:52:54.457" Title="How do I get a list of yahoo tickers for NYSE" Tags="&lt;yahoofinance&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17117" PostTypeId="2" ParentId="17116" CreationDate="2015-03-26T15:09:44.420" Score="6" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/Benny-/Yahoo-ticker-symbol-downloader&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/Benny-/Yahoo-ticker-symbol-downloader&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It gets its data from &lt;a href=&quot;https://finance.yahoo.com/lookup/&quot; rel=&quot;noreferrer&quot;&gt;https://finance.yahoo.com/lookup/&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please note: it is not possible to get all the symbols due to limitations set by Yahoo. About 75%-90% of all symbols are gathered using this script depending on type&lt;/p&gt;&#xA;" OwnerUserId="15727" LastActivityDate="2015-03-26T15:09:44.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17118" PostTypeId="2" ParentId="17108" CreationDate="2015-03-26T18:47:48.947" Score="1" Body="&lt;p&gt;In the link you provided, by noting the construction of array p[], p0 and p1 are respectively the discounted $\texttt{down}$ and $\texttt{up}$ probabilities. Since $d=\frac{1}{u}$, then&#xA;\begin{align*}&#xA;p0 &amp;amp;= e^{-r \Delta T}\, \frac{u-e^{(r-q)\Delta T}}{u-d}\\&#xA;&amp;amp;= \frac{\big(u\,e^{-r \Delta T} -e^{-q\Delta T}\big)u }{u^2-1},&#xA;\end{align*}&#xA;and &#xA;\begin{align*}&#xA;p1 &amp;amp;= e^{-r \Delta T}\,\big(1-p0\, e^{r \Delta T}\big)\\&#xA;&amp;amp;=e^{-r \Delta T} - p0.&#xA;\end{align*}&#xA;Note that $p1\, e^{r \Delta T}$ and $p0\, e^{r \Delta T}$ are respectively the $\texttt{up}$ and $\texttt{down}$ probabilities.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-03-26T19:21:58.680" LastActivityDate="2015-03-26T19:21:58.680" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17120" PostTypeId="2" ParentId="17111" CreationDate="2015-03-26T20:33:27.030" Score="3" Body="&lt;p&gt;First note that the price of binary call is related to the price of an ordinary call in any model by &#xA;$$&#xA;  BinC(T,K) = e^{-rT}\mathbb{E}^{\mathbb{Q}}[1_{S_T&amp;gt;K}] = - \frac{\partial}{\partial K}e^{-rT}\mathbb{E}^{\mathbb{Q}}[(S_T-K)_+] = - \frac{\partial}{\partial K}C(T,K)&#xA;$$&#xA;Now the volatility smile is implicitly defined by &#xA;$$&#xA;  C(T,K) = C_{BS}(T,K,\Sigma(T,K))&#xA;$$&#xA;So, by taking minus the derivative wrt $K$, we get&lt;br&gt;&#xA;$$&#xA;  BinC(T,K) = BinC_{BS}(T,K,\Sigma) - \partial_\sigma C_{BS}(T,K,\Sigma )\partial_K\Sigma(T,K)&#xA;$$&#xA;In other words, the volatility smile leads to a corrective term to the price of a binary call which is the BS vega times the skew.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Conversely this formula can be used to calculate the skew based on the price of digitals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get a less formal intuition, replace your digital call by a small call spread $\frac{1}{\Delta K}(C(T,K)-C(T,K+\Delta K))$. In BS the vol at $K+\Delta K$ is the same than at $K$. If the volatility decreases with the strike (negative skew) then the volatility at $K+\Delta K$ is lower than the volatility at $K$. So the second call loses value and the call spread's value increases. Since a digital is nothing but the limit of the call spread when $\Delta K \to 0$, you see that its price increases when the skew becomes more negative. &lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2015-03-26T23:07:35.287" LastActivityDate="2015-03-26T23:07:35.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17121" PostTypeId="1" CreationDate="2015-03-26T20:37:04.653" Score="1" ViewCount="959" Body="&lt;p&gt;CreditMetrics, RiskMetrics(Algorithims), etc. are all different risk methodologies used by many banks. However, what are their advantages/disadvantages?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would appreciate your replies!&lt;/p&gt;&#xA;" OwnerUserId="5414" LastActivityDate="2015-04-01T19:56:27.377" Title="What are the different Credit Portfolio Management models and what are their advantages?" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;risk-models&gt;&lt;credit-risk&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17122" PostTypeId="1" AcceptedAnswerId="17127" CreationDate="2015-03-26T20:42:11.833" Score="0" ViewCount="143" Body="&lt;p&gt;I am aware that this question is not the typical quant.SE question, BUT I couldn`t find any site/forum/wiki, where credit portfolio managers hang out to share their experience and their methods. Therefore, I am kindly ask you in advance not to downvote or close this question, because I am sure that there is a lot of interest in such a &quot;soft&quot; question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the good online resources for credit portfolio managers?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I appreciate your replies! &lt;/p&gt;&#xA;" OwnerUserId="5414" LastEditorUserId="2553" LastEditDate="2015-04-24T03:29:52.013" LastActivityDate="2017-06-18T11:42:39.560" Title="What are good online resources for credit portfolio managers?" Tags="&lt;risk&gt;&lt;portfolio-management&gt;&lt;risk-management&gt;&lt;credit-risk&gt;&lt;soft-question&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17123" PostTypeId="2" ParentId="17114" CreationDate="2015-03-27T05:06:53.740" Score="1" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Benchmark yield curves: Make it easier for market participants to efficiently price interest rate products off such benchmark yield curves because there is a consensus and agreement on what serves as benchmark. Those could include government security yield curves, inflation adjusted/reflecting yield curves, among others. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Funding curve: Is a set of rates more specific to an operation rather than the whole market in aggregate. As every operation poses different risks, each operation hence also exhibits different rates, charged, to fund its operations. This can be the funding done by the treasury/finance department of a multinational corporation or it can be the funding costs of a trading desk pertaining to the funds extended to it by the bank internally. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Basis Spread curve: Is closely related to basis swaps in that 2 parties exchange 2 different floating rates and the basis, the spread between those two, can be visualized over all terms via a basis spread curve. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2015-03-27T05:06:53.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17124" PostTypeId="1" CreationDate="2015-03-27T07:28:37.063" Score="1" ViewCount="71" Body="&lt;p&gt;I have a lease agreement where the functional currency is USD, domestic currency is UAH. Lease agreement is written in EUR (rent rate) and payments are to be done in UAH in the amount of rent rate (EUR) * UAH/EUR exchange rate. Should I account it as an embedded derivative and value separately?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same question applies to the following situation&#xA;I have a lease agreement where the functional currency is USD, domestic currency is UAH. Lease agreement is written in USD (rent rate) and payments are to be done in UAH in the amount of rent rate (EUR) * UAH/USD exchange rate. Should I account it as an embedded derivative and value separately?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance&lt;/p&gt;&#xA;" OwnerUserId="15750" LastActivityDate="2015-09-23T16:39:16.360" Title="Lease Accounting / FX Embedded Derivatives" Tags="&lt;fx&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2015-09-25T00:39:23.827" ContentLicense="CC BY-SA 3.0" />
  <row Id="17125" PostTypeId="1" AcceptedAnswerId="17201" CreationDate="2015-03-27T07:51:33.937" Score="40" ViewCount="28203" Body="&lt;p&gt;Factor models such as &lt;a href=&quot;http://en.wikipedia.org/wiki/Fama%E2%80%93French_three-factor_model&quot;&gt;Fama-French&lt;/a&gt; or the other ones that are partially summarized &lt;a href=&quot;http://www.thierry-roncalli.com/download/Factor-Investing-Slides.pdf&quot;&gt;here&lt;/a&gt; work on the cross-section of asset returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How are the factors built, how are sensitivities/coefficients estimated? In this context &lt;a href=&quot;http://en.wikipedia.org/wiki/Fama%E2%80%93MacBeth_regression&quot;&gt;Fama-MacBeth regressions&lt;/a&gt; are usually mentioned. &#xA;How does this method work intuitively? Could anyone give a step-by-step manual?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Links to papers and manuals have been posted in the two answers - this is great. But can someone provide more intuition in the answer? Say we have a universe of stocks (say MSCI Europe) and we group them by value and size. How can we proceed? How do we construct the factors and how do we construct the sensitivities? Could someone please give a more direct explanation, without a link? thanks!&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="467" LastEditDate="2016-12-07T01:19:13.647" LastActivityDate="2018-03-14T05:44:46.340" Title="How to build a factor model?" Tags="&lt;regression&gt;&lt;factor-models&gt;&lt;fama-french&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="61" ContentLicense="CC BY-SA 3.0" />
  <row Id="17127" PostTypeId="2" ParentId="17122" CreationDate="2015-03-27T09:36:19.567" Score="2" Body="&lt;p&gt;As regards the &lt;em&gt;free&lt;/em&gt; sources, the best place where you can find &lt;strong&gt;material&lt;/strong&gt; about credit risk management is &lt;a href=&quot;http://defaultrisk.com/&quot; rel=&quot;nofollow&quot;&gt;defaultrisk.com&lt;/a&gt;; it is a website where are collected (almost) all academic (and not) articles and working paper, references and researchers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, as regards the &lt;strong&gt;forums&lt;/strong&gt;, I think you should try visiting &lt;a href=&quot;https://www.linkedin.com/groups?gid=59483&amp;amp;trk=vsrp_groups_res_name&amp;amp;trkInfo=VSRPsearchId%3A1595433551427447970817%2CVSRPtargetId%3A59483%2CVSRPcmpt%3Aprimary&quot; rel=&quot;nofollow&quot;&gt;Credit Risk Group&lt;/a&gt; at Linkedin; it is a very active group (about 80 conversation per month) where you can post your question/answer with your opinion about credit risk &amp;amp; portfolio management. Again, you can find support here on the quant.stackexchange site too; a lot of people ask for question about credit risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;No database is free. You can find a lot of data on the internet, but for paying. A great database is &lt;a href=&quot;https://bankscope.bvdinfo.com/version-2015325/home.serv?product=scope2006&quot; rel=&quot;nofollow&quot;&gt;Bankscope&lt;/a&gt;, that is a credit bureau powered by Fitch ratings. You should try that as well as Bloomberg, Datastream Reuters, etc.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="848" LastEditDate="2015-03-28T09:37:04.857" LastActivityDate="2015-03-28T09:37:04.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17128" PostTypeId="1" AcceptedAnswerId="17130" CreationDate="2015-03-27T10:07:39.623" Score="0" ViewCount="805" Body="&lt;p&gt;I read this paper &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://research.aston.ac.uk/portal/files/240393/AURA_2_unmarked_Energy_demand_and_price_forecasting_using_wavelet_transform_and_adaptive_forecasting_models.pdf&quot; rel=&quot;nofollow&quot;&gt;https://research.aston.ac.uk/portal/files/240393/AURA_2_unmarked_Energy_demand_and_price_forecasting_using_wavelet_transform_and_adaptive_forecasting_models.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the two authors forecasts one day ahead gas price using, between the others, a GARCH model.&#xA;How does this model works? Isn't a GARCH model useful just to forecast volatility?&#xA;thank you!&lt;/p&gt;&#xA;" OwnerUserId="15752" LastActivityDate="2015-03-27T10:45:46.553" Title="Can I do a GARCH model to forecast a time series?" Tags="&lt;time-series&gt;&lt;garch&gt;&lt;forecast&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17129" PostTypeId="1" CreationDate="2015-03-27T10:26:23.807" Score="2" ViewCount="4349" Body="&lt;p&gt;I'd like to fit a non stationary time series using a SARIMA + GARCH model. I have not found any package that allow me to fit this model. &#xA;I'm using rugarch:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;model=ugarchspec(&#xA;  variance.model = list(model = &quot;sGARCH&quot;, garchOrder = c(1, 1)),&#xA;  mean.model = list(armaOrder = c(2, 2), include.mean = T),&#xA;  distribution.model = &quot;sstd&quot;)&#xA;modelfit=ugarchfit(spec=model,data=y)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but it allow me only to fit an ARMA + GARCH model. &#xA;Can you help me?&#xA;Thank you&lt;/p&gt;&#xA;" OwnerUserId="15752" LastActivityDate="2020-12-05T11:04:59.300" Title="How to fit a SARIMA + GARCH in R?" Tags="&lt;garch&gt;&lt;forecasting&gt;&lt;arima&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17130" PostTypeId="2" ParentId="17128" CreationDate="2015-03-27T10:45:46.553" Score="1" Body="&lt;p&gt;You are right -  GARCH model models volatility. They write:&#xA;&quot; The GARCH&#xA;[27] can be used to model changes in the variance of the errors as a function of&#xA;time.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What people often do is to fit an ARIMA model (that can be used to forecast a time series) and apply a GARCH model to the errors (which gives you a feeling for the forecast error). See &lt;a href=&quot;https://www.otexts.org/fpp&quot; rel=&quot;nofollow&quot;&gt;Hyndman and Athana­sopou­los&lt;/a&gt; for a good, free online book on forecasting.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-03-27T10:45:46.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17131" PostTypeId="1" AcceptedAnswerId="17152" CreationDate="2015-03-27T12:07:06.653" Score="2" ViewCount="97" Body="&lt;p&gt;I am experimenting with very high volatility on the standard Black-Scholes formula. I set risk free to zero, time to expiry to 1, volatility to 1 (=100%), and underlying to 1. Then I simulate the profit and loss on (i) the delta hedge account and (2) the option account between t=1 and t=0 and compute compare the expected return on both. There is a persistent bias in the result – the expected return on the option account is consistently higher.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I’m wondering if this is caused by the difference between volatility of the log returns and actual returns. There is little difference at low volatility, but it is huge at such massive vols. It could be calculation error of course, but I don’t think so because everything works fine at typical volatilities.&lt;/p&gt;&#xA;" OwnerUserId="7220" LastActivityDate="2015-03-29T09:43:03.507" Title="Effect of massive volatility on BS formula" Tags="&lt;black-scholes&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17132" PostTypeId="2" ParentId="17129" CreationDate="2015-03-27T13:28:01.743" Score="2" Body="&lt;p&gt;You find R code for seasonal ARIMA models again in the &lt;a href=&quot;https://www.otexts.org/fpp/8/9&quot; rel=&quot;nofollow&quot;&gt;book mentioned (this chapter)&lt;/a&gt;. Do you really need the GARCH errors?&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-03-27T13:28:01.743" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17133" PostTypeId="2" ParentId="17124" CreationDate="2015-03-27T13:38:00.530" Score="0" Body="&lt;p&gt;Relevant FASB rules are here:&lt;a href=&quot;http://www.fasb.org/derivatives/issueb21.shtml&quot; rel=&quot;nofollow&quot;&gt;http://www.fasb.org/derivatives/issueb21.shtml&lt;/a&gt;.&#xA;I think you are asking an accoubting question (what are the rules?) not a quant one (how can I model the value of some contract feature?) so this may not be the best forum to ask.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2015-03-27T13:38:00.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17134" PostTypeId="2" ParentId="15920" CreationDate="2015-03-27T15:39:46.853" Score="0" Body="&lt;p&gt;You can try:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;daily.fit=ugarchspec(variance.model = list(model = &quot;sGARCH&quot;, garchOrder = c(1, 1)),&#xA;mean.model = list(armaOrder = c(35, 7), include.mean = T, arfima=F),&#xA;fixed.pars=list(ar9=0,ar10=0,...,ar13=0,ar15=0,...,ar20=0,ar22=0,...,ar27=0,ar29=0,...,ar34=0,ma1=0,...,ma6=0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;from rugarch package.&lt;/p&gt;&#xA;" OwnerUserId="15752" LastActivityDate="2015-03-27T15:39:46.853" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17135" PostTypeId="1" CreationDate="2015-03-27T16:51:28.017" Score="3" ViewCount="676" Body="&lt;p&gt;Today I was reading an &lt;a href=&quot;https://research.aston.ac.uk/portal/files/240393/AURA_2_unmarked_Energy_demand_and_price_forecasting_using_wavelet_transform_and_adaptive_forecasting_models.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;article&lt;/a&gt; quoted &lt;a href=&quot;https://quant.stackexchange.com/questions/17128/can-i-do-a-garch-model-to-forecast-a-time-series&quot;&gt;here&lt;/a&gt;, in this article is proposed an adaptive (dynamic) Garch model. How can I do it in R? The use of extended Kalman filter or particle filter is indifferent. I usually use &lt;code&gt;rugarch&lt;/code&gt; or &lt;code&gt;rmgarch&lt;/code&gt; for Garch models. Can I do it with this packages or I need some others? &#xA;Thanks &lt;/p&gt;&#xA;" OwnerUserId="15756" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2018-02-12T14:59:13.820" Title="How can I do a dynamic GARCH model using extended Kalman filter in R?" Tags="&lt;r&gt;&lt;modeling&gt;&lt;garch&gt;&lt;dynamic&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17136" PostTypeId="1" AcceptedAnswerId="17143" CreationDate="2015-03-27T20:05:13.040" Score="3" ViewCount="3023" Body="&lt;p&gt;Consider the Black-Scholes model, in which the log stock return over a time period $\Delta t$ is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\log(S_{i+1}/S_i) = (\mu - \sigma^2/2)\Delta t + \sigma \sqrt{\Delta t} Z_i, \qquad Z_i \sim \mathcal{N}(0,1).&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The price of a call at time $T$ under this model (when we replace $\mu$ with $r$) is given by (emphasizing the dependence on $\sigma$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;C(\sigma) = SN(d_1) - Ke^{-rT}N(d_2),&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;d_1 = \frac{1}{\sigma{\sqrt{T}}}\left(\log(S/K) + (r + \sigma^2/2)T\right) = d_2 + \sigma \sqrt{T}.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, assuming $r$ is known, we have (at least) two methods of estimating $\sigma$, namely using a least-sqaures regression on the log returns, or calculating the implied vol.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Regression on log returns:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Note the log returns is a linear regression equation of the form&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;Y_i = \beta_0 + \beta_1X_i + \sigma\sqrt{\Delta t} \epsilon_i&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $\beta_0 = (\mu - \sigma^2/2)\Delta t$, $\beta_1 = 0$ and $\epsilon_i \sim \mathcal{N}(0,1)$, independent.  So, assuming we have a sample of $N$ log returns (denoted $Y_i$) and since $\beta_1 = 0$, we estimate $\beta_0$ in the usual regression way by &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\hat{\beta_0} = \frac{1}{N}\sum_{i=1}^N Y_i,&#xA;$$&#xA;and then estimate $\sigma$ using the standard deviation of the residuals,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\hat{\sigma} = \frac{std(Y_i - \hat{Y_i})}{\sqrt{\Delta t}},&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the $\hat{Y_i}$ are the regression model-predicted log returns.  This is one method to estimate $\sigma$ used in the pricing equation, and is in the least-sqaures sense our &quot;best guess&quot; at $\sigma$.  This $\hat{\sigma}$ could then be used to compute &lt;em&gt;all European call options&lt;/em&gt; for $S$ across &lt;em&gt;all strikes and expirations&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Implied vol:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Given a market call price $C_{\text{observed}}$ for some strike and expiration, we can compute the $\sigma_{\text{implied}}$ such that $C(\sigma_{\text{implied}}) = C_{\text{observed}}$.  We can compute such a $\sigma_{\text{implied}}$ for all call options we have prices for (again assuming $r$ is known).  Then, when we would like to price a call using our pricing equation for some strike/expiration that is not observed, we can &lt;em&gt;choose&lt;/em&gt; (or interpolate between a few) the $\sigma_{\text{implied}}$ that is closest to the strike/expiration we would like to price at and use this $\sigma_{\text{implied}}$ in our pricing equation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, we have two methods of deriving a suitable $\sigma$ to use in our pricing equation.  It seems that much of the literature is devoted to implied vol, so I assume this is the preferred technique.  My question is, is there any relation between the two, and when would you use one over the other?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2015-04-29T11:10:53.983" Title="Implied Vol vs. Calibrated Vol" Tags="&lt;black-scholes&gt;&lt;implied-volatility&gt;&lt;calibration&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17137" PostTypeId="1" AcceptedAnswerId="17141" CreationDate="2015-03-27T23:32:52.900" Score="0" ViewCount="999" Body="&lt;p&gt;I have the goal of being able to develop a model that can forecast the future prices of european government bond (or other private bonds), particularly from the historical prices and returns of the bonds. However I do not know really how to start. In fact I have just graduated in quantitative finance course, but I never deepened so the thing to be able to develop a model. Someone has advices to know how to start? Maybe simply pointing some papers dealing with the subject. I would use something to not only theoretical, but that explains step by step how to build the model. I conclude by saying that I know well enough &lt;code&gt;R&lt;/code&gt; and &lt;code&gt;C&lt;/code&gt; language, so I might even consider a model based on monte carlo simulation for example.&lt;/p&gt;&#xA;" OwnerUserId="15560" LastActivityDate="2015-03-28T13:55:52.027" Title="How to forecast bond price with time series" Tags="&lt;time-series&gt;&lt;modeling&gt;&lt;bond&gt;&lt;forecasting&gt;&lt;price&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17138" PostTypeId="1" CreationDate="2015-03-28T00:48:30.433" Score="2" ViewCount="1995" Body="&lt;p&gt;I have seen plenty of literature about GARCH on estimation volatility. how about covariance? There are plenty of risk models depending on the covariance matrix. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess we can assume the correlation is constant and volatility changes. But in reality in super volatile moment correlation between stocks increases. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or there is a separate model for estimating correlation? &lt;/p&gt;&#xA;" OwnerUserId="2576" LastActivityDate="2015-03-28T18:33:25.107" Title="Garch for covariance matrix?" Tags="&lt;volatility&gt;&lt;correlation&gt;&lt;stochastic-volatility&gt;&lt;covariance&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17139" PostTypeId="1" AcceptedAnswerId="17159" CreationDate="2015-03-28T03:02:43.250" Score="1" ViewCount="169" Body="&lt;p&gt;Apologies in advance if this seems like a straight forward question but I'm really unsure how to go about it.  Say I have the payoff for a structured note benchmarked against an index and I have a figured out a combination of two different options will essentially provide the same payoff.  When I use the Black-Scholes-Merton model to value the options, the value that I get is significantly lower than the par value of the note.  e.g. par value is 1000 and the options are at 200 in total.  Is that possible?  What is the general approach when it comes to calculating the value of a structure note?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also given: volatility &amp;amp; risk free rate.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks! &lt;/p&gt;&#xA;" OwnerUserId="15759" LastEditorUserId="15759" LastEditDate="2015-03-30T23:38:35.713" LastActivityDate="2015-04-01T07:54:21.197" Title="Value a structured note with Black-Scholes" Tags="&lt;option-pricing&gt;&lt;black-scholes-merton&gt;" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="17140" PostTypeId="2" ParentId="17138" CreationDate="2015-03-28T09:10:14.873" Score="4" Body="&lt;p&gt;I think you're looking for multivariate GARCH models of which this is an &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1002/jae.842/pdf&quot; rel=&quot;nofollow&quot;&gt;overview paper&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Multivariate GARCH models have one big drawback: they are pretty hard to estimate due to the number of correlations. This &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/j.1467-6419.2011.00683.x/full&quot; rel=&quot;nofollow&quot;&gt;paper by Caporin and McAleer&lt;/a&gt; might be of interest in that regard.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2015-03-28T09:10:14.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17141" PostTypeId="2" ParentId="17137" CreationDate="2015-03-28T09:27:51.267" Score="2" Body="&lt;p&gt;This is a very broad question and a large number of issues have been discussed in the literature. As such, it's hard to give specific advice except that it is better to model returns instead of prices directly. What I would do if I were you:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Read some of the available literature to get a good overview. This is &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S0304407605000795&quot; rel=&quot;nofollow&quot;&gt;an interesting paper&lt;/a&gt; but many more exist.&lt;/li&gt;&#xA;&lt;li&gt;Theorize on what influences bond returns&lt;/li&gt;&#xA;&lt;li&gt;Gather data&lt;/li&gt;&#xA;&lt;li&gt;Build/Improve an econometric model&lt;/li&gt;&#xA;&lt;li&gt;Test this model&lt;/li&gt;&#xA;&lt;li&gt;Go back to step 1, 2, 3 or 4.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="848" LastEditorUserId="848" LastEditDate="2015-03-28T13:55:52.027" LastActivityDate="2015-03-28T13:55:52.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17142" PostTypeId="1" CreationDate="2015-03-28T14:20:51.433" Score="1" ViewCount="86" Body="&lt;p&gt;We have Cobb-Douglas function like this $Y=AK^\alpha L^{1-\alpha}$, in one of the book, it deduce like this:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/CoboZ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can we get this formula?&#xA;$$\frac{\Delta Y}Y = \frac{\Delta A}A+\alpha\frac{\Delta K}K+(1-\alpha)\frac{\Delta L}L$$&lt;/p&gt;&#xA;" OwnerUserId="13627" LastActivityDate="2015-04-27T18:38:46.643" Title="What is the gross accounting relation of Cobb-Douglas function?" Tags="&lt;economics&gt;&lt;macro-economics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17143" PostTypeId="2" ParentId="17136" CreationDate="2015-03-28T15:17:45.567" Score="4" Body="&lt;p&gt;The main difference is that one approach assumes that a certain dynamical structure properly describes the underlying instrument, while the other approach is really only a re-writing of the price in terms of an implied volatility.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Implied volatility&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Implied volatility really only needs two things: the underlying stock price and the call option price (apart from the risk free rate and your choice of strike). Therefore all inputs are set by the market. At no point do you have any uncertainty about the different parameters that determine the implied volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the implied volatility approach you can therefore never detect miss-pricing of options, since the price is already set by the market. Why would that be useful? Well, maybe you hold some options on your book and you want to know what their fair value is. You are therefore interested in the markets view of the options price. But traders like to work with volatilities instead of prices, so you need not just the market-implied price of the option but rather the corresponding implied volatility. Again, this comes down to the fact that implied volatility is nothing more but a re-writing of the option price as set by the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the BS model is not consistent with the implied volatility as set by the market. Why? Because the implied volatility is strike-dependent. If you extract the implied volatility you will find that typically at-the-money options have a lower implied volatility than options that are away from at-the-money. The implied volatility is said to form a smile, which refers to the shape of the graph formed by plotting implied volatility vs strike. This is not consistent with the BS model, since it can only work with one volatility. &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Calibrated volatility&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The regression approach calibrates everything to the underlying stock. Here you really try to infer what the fair value of the option price should be, given your model and the historical data. If you end up with an option price different from the market (which is pretty much guaranteed to happen), and you have a lot of faith in your calibration, then you would either go long or short an option and potentially make a profit. You would consider yourself &quot;better informed&quot; then the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This approach is therefore model-dependent. You made a choice in what model you use to describe the stock market. You assumed that a certain distribution describes your log-returns and it is completely fixed by only a handful statistical parameters. You could call this a type of model bias.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, you are dealing with statistical inference, and therefore statistical errors will creep in. Why is the error function you used the way to go? Why not the absolute norm or some other error function? Most likely your choice is made because you assumed your errors are distributed in a particular way, but this is then again an example of model bias. How much data will you use to calibrate your parameters? How sure are you of your statistical estimates? The implied volatility is just a price, so we will always agree on this. But for the calibrated volatility that is not the case and there will be some statistical error associated with it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, your model is fully calibrated to historical data. But options are all about future events. The historical volatility might not agree with the implied volatility because the market is &lt;em&gt;expecting&lt;/em&gt; a more volatile future. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, your calibration approach might be too simplistic, but you could potentially improve on this. And this is indeed what some funds try to do. The calibration approach is therefore really about &quot;trying to beat the markets view on option prices&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So is historical data never used as input in these pricing models? Not necessarily. For some markets there are no implied volatilities available (e.g. energy markets are very illiquid, or some institutes provide special options for their clients). In that case the historical data might be the only decent way of estimating your option prices. &lt;/p&gt;&#xA;" OwnerUserId="3371" LastActivityDate="2015-03-28T15:17:45.567" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17144" PostTypeId="2" ParentId="17136" CreationDate="2015-03-28T16:19:56.863" Score="2" Body="&lt;p&gt;It depends what you want volatility for. Theory will tell you that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;&lt;em&gt;Implied variance of short maturity ATM options is approximately equal to the expectation of the realised integrated variance of the underlying over the life of the option and under the risk neutral measure&lt;/em&gt;&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In math:&#xA;$\sigma^2_{ATM}\approx E^Q\left(\frac{1}{T}\int_0^T\sigma^2_t dt\right)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now there are some interesting details here. For example, the relationship is model-free, but it holds for small horizons and for strikes around the current spot. Also, the expectation is under Q, not under the physical probability measure: even for short maturity ATM options there is a basis between implied and actual volatility. This is well documented in the literature and reflects the risk premium for trading volatility (see for example &lt;a href=&quot;http://cosweb1.fau.edu/~jmirelesjames/MatLabCode/Lecture_notes_2008d.pdf&quot; rel=&quot;nofollow&quot;&gt;figure 6.5 in these notes&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, as I said, it depends what the purpose of the estimation is. If you want to price, stick to implied as they are under Q. For riskmanagement start with historical. There are valid reasons for using both, but one has to be careful and acknowledge the different measures.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2015-03-28T16:31:27.370" LastActivityDate="2015-03-28T16:31:27.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17145" PostTypeId="1" AcceptedAnswerId="17154" CreationDate="2015-03-28T17:13:39.883" Score="1" ViewCount="284" Body="&lt;p&gt;Now I'm reading a paper:&quot;alternative characterizations of american put options&quot; , the authors are  Carr,Jarrow,Myneni&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.math.nyu.edu/research/carrp/papers/pdf/amerput7.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.math.nyu.edu/research/carrp/papers/pdf/amerput7.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After theorem 1 (in page 4),the author said :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/fBcGT.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't quite understand why the &quot;investor&quot; should hedge the put option when the stock price is below the boundary. I think only the &quot;writer&quot; of the option should hedge,but not the &quot;investor&quot;.What's the meaning of this paragraph?&lt;/p&gt;&#xA;" OwnerUserId="15232" LastEditorUserId="15232" LastEditDate="2015-03-29T01:32:42.547" LastActivityDate="2015-03-29T20:06:28.420" Title="Hedging behind the decomposition of american put options" Tags="&lt;option-pricing&gt;&lt;hedging&gt;&lt;american-options&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17146" PostTypeId="2" ParentId="17142" CreationDate="2015-03-28T17:45:02.693" Score="2" Body="&lt;p&gt;Take logs of both sides, i.e.&#xA;$$\log Y=\log A+ a \log K +(1-a)\log L$$&#xA;This gives:&#xA;$$\Delta\log Y = \Delta\log A + a \Delta\log K +(1-a) \Delta\log L$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then use that $\frac{d}{dx}\log x= 1/x$, which yields $\Delta\log x=\Delta x/x$. Apply that to each log-diff above.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2015-03-28T17:45:02.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17147" PostTypeId="2" ParentId="17138" CreationDate="2015-03-28T18:33:25.107" Score="3" Body="&lt;p&gt;Not sure your question is about having a process for covariance or to have multivariate GARCH. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The standard viewpoint on a stochastic volatility for covariance is to use a &lt;strong&gt;Whishart&lt;/strong&gt; process. See for instance&#xA;Philipov, A. and M. E. Glickman (2006, July) &lt;a href=&quot;http://www.hedgefund-index.com/philipov-multivariate.pdf&quot; rel=&quot;nofollow&quot;&gt;Multivariate stochastic volatility via wishart processes.&lt;/a&gt; Journal of Business &amp;amp; Economic Statistics 24 (3), 313-328.&#xA;You will find all the formulas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just note in dimension one, it is like using a &lt;a href=&quot;http://en.wikipedia.org/wiki/Gamma_distribution&quot; rel=&quot;nofollow&quot;&gt;Gamma distribution&lt;/a&gt; for your volatility, using a &quot;&lt;em&gt;time serie&lt;/em&gt;&quot; (a stochastic process) on the parameter $\beta$. I.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X_t|\sigma^2_t \sim {\cal N}(0, \sigma_t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma_t^{-2}|\alpha,\beta_t\sim \Gamma(\alpha,\beta_t).$$&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2015-03-28T18:33:25.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17149" PostTypeId="1" AcceptedAnswerId="17164" CreationDate="2015-03-28T21:55:02.313" Score="1" ViewCount="1664" Body="&lt;p&gt;I am currently trying to write a little script in R to determine the optimal weights given a fixed risk aversion parameter.&#xA;The problem I have is that by increasing the risk aversion parameter I think that parabola should become wider. However, in my case it yields the same parabola with minor differences.&#xA;The problem I am encountering is that I am not sure if the way I formulated the solve.qp is correct or not&#xA;My idea was to minimize -w^t&lt;em&gt;mu+aversion/2 w^t&lt;/em&gt;Sigma*w; where w = weights, mu = mean of returns, Sigma= covariance of returns. &#xA;I did try using portfolio.optim from the tseries package, but it does not allow me to fix the risk aversion parameter or does it ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may find my code below.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    efficientPortfolio &amp;lt;- function(er,cov.mat,aversion=3,target.return){&#xA;&#xA;    Dmat&amp;lt;- cov.mat*aversion&#xA;    dvec&amp;lt;- as.vector(er)&#xA;    ones&amp;lt;- rep(1,length(er))&#xA;    zeros &amp;lt;-rep(0,length(er))&#xA;    Identity &amp;lt;- matrix(0,length(er),length(er))&#xA;    diag(Identity)&amp;lt;-1&#xA;    Amat&amp;lt;- (cbind((ones),colMeans(data),Identity)) #no short sell&#xA;&#xA;    bvec&amp;lt;- c(1,target.return,zeros) #no short sell&#xA;&#xA;    sol&amp;lt;-solve.QP(Dmat,dvec,Amat,bvec=bvec,meq=1)&#xA;    weights&amp;lt;-sol$solution&#xA;&#xA;&#xA;    exp.ret &amp;lt;- crossprod(dvec,weights)&#xA;    std.dev &amp;lt;- sqrt(weights %*% cov.mat %*% weights)&#xA;&#xA;    ret &amp;lt;- list(&quot;call&quot; = call,&#xA;                &quot;er&quot; = as.vector(exp.ret),&#xA;                &quot;sd&quot; = as.vector(std.dev),&#xA;                &quot;weights&quot; = weights) &#xA;    ret&#xA;    }&#xA;&#xA;&#xA;&#xA;    efficientFrontier &amp;lt;- function(er,cov.mat, nport = 20,aversion=3) {&#xA;    ef &amp;lt;- matrix(0, nport, 2 + length(er))&#xA;&#xA;    pm &amp;lt;- seq((min(er)), (max(er)), &#xA;              length.out = nport)&#xA;&#xA;    for (i in 1:nport) {&#xA;&#xA;            port &amp;lt;-         efficientPortfolio(er,cov.mat,aversion=aversion,target.ret=pm[i])&#xA;&#xA;            ef[i, 1] &amp;lt;- port$sd&#xA;                ef[i, 2] &amp;lt;- port$er&#xA;            ef[i, 3:ncol(ef)] &amp;lt;- port$weights&#xA;&#xA;     }&#xA;    list(ef = ef[, 1:2], weights = ef[, -1:-2])&#xA;     }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;also&lt;br&gt;&#xA;er and cov.mat in my case are :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   er&amp;lt;-c(2.626568e-05, 6.542483e-06, 2.169358e-05, 1.510713e-04 ,7.113906e-05 )&#xA;   cov.mat&amp;lt;-matrix(c(4.408143e-04 ,   1.487359e-05, 1.680034e-05,   3.066478e-04,   2.069675e-04,&#xA;1.487359e-05,   7.270984e-03,   9.134981e-06,   -1.699836e-05,  7.956140e-06,&#xA;1.680034e-05,   9.134981e-06,   6.528898e-04,   5.397248e-06,   9.887768e-06,&#xA;3.066478e-04,   -1.699836e-05,  5.397248e-06,   1.473456e-03,   6.657914e-04,&#xA;2.069675e-04,   7.956140e-06,   9.887768e-06,   6.657914e-04,   5.090455e-04),5,5)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and the package I am using is &#xA;           quadprog&#xA;Thanks in advance.&#xA;Jc&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT : During some tests I noticed that when I apply sove.qp for different Dmat=cov.mat*aversion, where aversion = 3 or 4, yields the same weights. How is this possible ?&lt;/p&gt;&#xA;" OwnerUserId="15767" LastEditorUserId="15767" LastEditDate="2015-03-28T23:40:02.340" LastActivityDate="2019-10-22T21:49:57.373" Title="Portfolio optimzation : efficient frontier with respect to risk aversion parameter with R" Tags="&lt;risk&gt;&lt;r&gt;&lt;optimization&gt;&lt;portfolio&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17150" PostTypeId="2" ParentId="16751" CreationDate="2015-03-29T01:01:57.980" Score="2" Body="&lt;p&gt;The issue I have with these approaches is that they use the unconditional distribution to eliminate the latent volatility. However, when the volatility process has very weak mean reversion one would need a very long and clean sample to make robust parameter identification from the unconditional density. They just throw away all the information from the transition dynamics. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My preference is a filtering approach. There have been some older papers that did that, google for Heston together with Ghysels, Gallant, Renault, Chernov, Tauchen, Pan, Bates, Shephard, MCMC, unscented Kalman filter and you will get some references. It is still ugly, since volatility is unobserved, but at least you are looking at conditional transitions rather than the stationary distribution. Even better, you can implied vols and perform joint estimation. Some of the references above do that too.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2015-03-29T01:01:57.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17151" PostTypeId="2" ParentId="17021" CreationDate="2015-03-29T09:23:30.680" Score="1" Body="&lt;p&gt;It the value of the forward contract and not the forward price that has drift r under the risk-neutral measure. In fact, in the simplest case where the risk-free interest rate is a constant r, then the forward price process f(t,T) has zero drift under the risk-neutral measure: &#xA;If the spot price process satisfies dS(t)=S(t)(rdt+bdW(t)), then&#xA;dF(t,T)=bF(t,T)dW(t). &lt;/p&gt;&#xA;" OwnerUserId="15769" LastActivityDate="2015-03-29T09:23:30.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17152" PostTypeId="2" ParentId="17131" CreationDate="2015-03-29T09:43:03.507" Score="1" Body="&lt;p&gt;i would guess it is the difference between&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\exp(-0.5\sigma^2 T + \sqrt{T}\sigma Z)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\exp(\sqrt{T}\sigma Z)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first is correct, the second is wrong.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-03-29T09:43:03.507" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17153" PostTypeId="1" AcceptedAnswerId="17257" CreationDate="2015-03-29T14:17:08.537" Score="3" ViewCount="1049" Body="&lt;p&gt;The forward price of a forward contract maturing at time T on an asset with price St at time t is, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;F=S_te^{(r-q)(T-t)}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $r$ is the risk free rate and $q$ is the continuous dividend rate for $S_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Black Scholes equation for an option contingent on F is, &#xA;$$&#xA;\frac{\partial V}{\partial t} + \frac{1}{2}\sigma^2F^2\frac{\partial ^2V}{\partial F^2} -rV = 0&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do i show that the prices of European call, C, and put options, P, on the forward F, with the same strike K and expiry date $T_1$, where $T_1 &amp;lt; T$ (ie, the options expire before the forward matures), are related by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;C(F,t)=\frac{F}{K}P(\frac{K^2}{F},t)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="15771" LastEditorUserId="15771" LastEditDate="2015-04-03T07:38:02.037" LastActivityDate="2015-04-06T17:33:26.060" Title="Put-Call relationship for Option on Forward" Tags="&lt;option-pricing&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17154" PostTypeId="2" ParentId="17145" CreationDate="2015-03-29T20:06:28.420" Score="1" Body="&lt;p&gt;That seems to be a nice paper but I haven't worked through it completely yet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I understand it, the goal is to replicate the holding (by an investor) of an European option using an American option, stock and bonds in a &lt;em&gt;self-financing&lt;/em&gt; manner. As the value of the underlying changes this requires rebalancing of the option and the bond, i.e. hedging. Since the portfolio is self-financing the value has to be equal. Thus, once you have such a portfolio the value of the American option is the only unknown and it can be derived from the known prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Surely, an investor in the traditional sense will just buy the European or American put and not set up a dynamic hedge. Nowadays the authors might have written arbitrageur instead.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2015-03-29T20:06:28.420" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17155" PostTypeId="2" ParentId="16336" CreationDate="2015-03-29T23:36:56.097" Score="1" Body="&lt;p&gt;Say that you did the calculations in the classic regression way. If you stick the returns of your 4 asset returns in a $(T\times 4)$ matrix $Y$, and your 3 factor returns in a $(T\times 3)$ matrix $X$, then your betas would solve the multiple regressions, collected in a $(3\times 4)$ matrix&#xA;$$Y = X\cdot \beta + \epsilon$$&#xA;You could also add a column of ones in $X$ if you want to also have a constant, but this does not matter. The OLS solution would be&#xA;$$\beta = (X'X)^{-1}(X'Y)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see the analogy to the univariate cov/var formula that you describe. The $X'Y$ part corresponds to the $(3\times 4)$ asset-factor covariances, while the $X'X$ parts corresponds to the $(3\times 3)$ factor-factor covariances.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore I would say that your large $(7\times 7)$ EWMA covariance matrix can be partitioned as&#xA;$$\left(&#xA;\begin{array}{cc}&#xA;X'X &amp;amp; X'Y \\&#xA;Y'X &amp;amp; Y'Y&#xA;\end{array}&#xA;\right)&#xA;$$&#xA;From which you can pick the right elements to calculate the betas.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2015-03-29T23:36:56.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17156" PostTypeId="1" CreationDate="2015-03-30T05:44:57.893" Score="6" ViewCount="9279" Body="&lt;p&gt;I have mean reverting data (Difference of 2 stock prices, that I want to do pairs trading on). I want to simulate my own mean reverting data as similar as possible to the real data that I have.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The approach that I want to take is Least Squares Regression. Maximum Likelihood is too complicated.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you all.&lt;/p&gt;&#xA;" OwnerUserId="15776" LastActivityDate="2015-04-01T15:32:07.390" Title="How can I estimate the Ornstein-Uhlenbeck paramters of some mean reverting data that I have on R?" Tags="&lt;r&gt;&lt;pairs-trading&gt;&lt;mean-reversion&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="17157" PostTypeId="1" AcceptedAnswerId="17160" CreationDate="2015-03-30T09:27:45.787" Score="18" ViewCount="29545" Body="&lt;p&gt;Bloomberg always have two codes for the same instruments. For example, for Apple, Bloomberg has &lt;strong&gt;AAPL US&lt;/strong&gt; and &lt;strong&gt;AAPL UW&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am wondering what is the difference between these two codes? As far as I can tell, if the stock is a US one, there will always be a code of the form &quot;xxxx US&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Update]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So after working on the equity tech team for a year, now I have a much better understanding of it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bloomberg has two types of identifiers, one called Bloomberg Exchange Ticker, one called Bloomberg Composite Ticker. The Exchange vs. Composite is the pricing source concept mentioned by others.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Bloomberg Exchange Ticker is relatively simpler to understand - it just stands for a security on a particular exchange. So if you go to Bloomberg terminal and ask it to give prices (last, bid, ask) for a Bloomberg Exchange Ticker (IBM UN for example), Bloomberg will give you the price &lt;strong&gt;only for that particular exchange&lt;/strong&gt; (NYSE).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Bloomberg Composite Ticker will combine prices from all possible exchanges and gives you an aggregated feed. For example, the last/bid/ask retrieved for IBM US will be: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;most recent last price happened on any exchange&lt;/li&gt;&#xA;&lt;li&gt;current highest bid on all exchanges&lt;/li&gt;&#xA;&lt;li&gt;current lowest ask on all exchanges&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Usually the composite ticker will end with country code: IBM US, AAPL US, 1 HK etc. The Bloomberg exchange ticker will end with Bloomberg allocated exchange code: IBM UN (NYSE), AAPL UW (NASDAQ) etc.&lt;/p&gt;&#xA;" OwnerUserId="13671" LastEditorUserId="13671" LastEditDate="2017-03-29T13:33:33.750" LastActivityDate="2017-03-29T13:33:33.750" Title="Difference between the two Bloomberg codes" Tags="&lt;market-data&gt;&lt;bloomberg&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17158" PostTypeId="2" ParentId="17139" CreationDate="2015-03-30T09:49:55.883" Score="0" Body="&lt;p&gt;I think the problem lies in the principal. Normalize $S_0=1000.$&#xA;Essentially you get&#xA;$$&#xA;S_T \text{ if } S_{T} &amp;lt; 1000,&#xA;$$&#xA;$$&#xA;1000 \text{ if } 1000 &amp;lt; S_T &amp;lt; 1100,&#xA;$$&#xA;$$&#xA;2.5 (S_T - 1100) \text{ if } 1100 &amp;lt; S_T &#xA;$$&#xA;I'd write this as &#xA;$$&#xA;S_T - \max(S_T-1000,0) + 2.5 \max(S_T-1100,0).$$&#xA;Since $S_0=1000$ you'll get something close to $1000.$&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-03-30T09:49:55.883" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="17159" PostTypeId="2" ParentId="17139" CreationDate="2015-03-30T10:15:38.830" Score="0" Body="&lt;p&gt;You said:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;if the index's return is negative then the note's total payoff will be 1000 x (1 - R)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;When the return is positive, then the payoff is 1000 + 1000 * 2.5 * max{R - 0.1, 0}. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Hence, your payout function should be as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;v(T)= Indicator {Index(T) &amp;lt; 1000, Index(T); 1000 &amp;lt; Index(T) &amp;lt; 1100, 1000; Index(T) &gt; 1100, 1000 + 2.5*(Index(T)-1100) } and indeed you can re-write as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;V(T) = Index(T) - max(Index(T)-1000,0) + 2.5*max(Index(T)-1100,0)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A) If the underlying process that drives the Index price does not correspond with the assumed process by Black Scholes then you cannot value this note via Black Scholes. But you can run a monte carlo simulation based approach to value such note. Here are couple steps to get you started&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;You essentially need to to decide on the type of model you need to apply. For that you need to know which model best describes the price dynamics of the underlying index. Be mindful in case there are any correlating brownian motions or correlating processes which would make it a little more exciting to deal with.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Next, you would need to simulate different index price paths to evolve the index price.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Then, you derive the final payoff, using the index value at each price path at the time that coincides with the expiration of your note.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You then properly discount each payoff.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;At the end you average the discounted payoffs to get to your expected discounted future value of the note which is the price anyone would want to trade at if he/she believed that your model and variable inputs properly described the evolution of the index. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;B) If the underlying processes correspond then you can simply value the first portion of this note via &quot;no-arbitrage argument&quot; and treat the other payoff components as separate call options. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2015-04-01T07:54:21.197" LastActivityDate="2015-04-01T07:54:21.197" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="17160" PostTypeId="2" ParentId="17157" CreationDate="2015-03-30T10:20:25.227" Score="9" Body="&lt;p&gt;UW = NASDAQ Global Select Market&#xA;US = US Composite&#xA;source : &lt;a href=&quot;http://bsym.bloomberg.com/sym/pages/pricing_source.xls&quot;&gt;http://bsym.bloomberg.com/sym/pages/pricing_source.xls&lt;/a&gt;&#xA;see also : &lt;a href=&quot;http://bsym.bloomberg.com/sym/&quot;&gt;http://bsym.bloomberg.com/sym/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15437" LastActivityDate="2015-03-30T10:20:25.227" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17161" PostTypeId="2" ParentId="17136" CreationDate="2015-03-30T10:28:11.487" Score="2" Body="&lt;p&gt;This is pretty straight forward:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The market prices vanilla options via implied volatility. You can like it or not like it but that is the way it is. So, the fair price of the option is the equivalent of the implied vol via BS. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Now, if you believe the true price of an option should be different from the traded market price and you figure out that you have a better way of modeling future volatility then you should by all means do so and capitalize on such insight. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;It is really that simple.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2015-03-30T10:28:11.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17162" PostTypeId="1" CreationDate="2015-03-30T11:18:47.193" Score="0" ViewCount="51" Body="&lt;p&gt;I am doing something seemingly quite easy: Prinipal calcuation of a loan.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need to calculate daily principal payments and accumulate it on a yearly basis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my current implementation look like that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Vseib.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, implementing it in excel is not that easy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below you can find the logic:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ulOy6.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the moment I am calculating the first year, if the date is not the beginning or the end of the year, daily and the other years with a yearly formula, which gives me differences an accumulated difference in my solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any recommendations, how to implement &quot;daily principal payments and accumulate it on a yearly basis&quot; in excel?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I appreciate your replies!&lt;/p&gt;&#xA;" OwnerUserId="5414" LastActivityDate="2015-09-23T17:30:51.730" Title="Daily principal payments, accumulated on yearly basis in excel" Tags="&lt;fixed-income&gt;&lt;excel&gt;&lt;principal-components&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17163" PostTypeId="1" CreationDate="2015-03-30T13:09:22.577" Score="16" ViewCount="2146" Body="&lt;p&gt;I have some writing experience, but I want to take my writing skills to the next level. I am particularly interested in writing quantitative finance papers for journals like Journal of Portfolio management, Journal of Asset Management, Quantitative Finance etc. A common tip you find in books on writing, like the Elements of Style by Strunk or Economical writing by McCloskey, is find someone in your field that writes well and find out how he did it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have papers that he or she can recommend?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or, does anyone know a writer that in this field that really writes well.&lt;/p&gt;&#xA;" OwnerUserId="15779" LastEditorUserId="15779" LastEditDate="2015-04-02T08:16:32.040" LastActivityDate="2015-04-08T21:00:46.820" Title="Best written quantitative finance papers" Tags="&lt;research&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="17164" PostTypeId="2" ParentId="17149" CreationDate="2015-03-30T14:02:56.597" Score="2" Body="&lt;p&gt;Looking at your code, you seem to be mixing the &lt;em&gt;risk minimization&lt;/em&gt; formulation of the mean-variance problem with the &lt;em&gt;risk aversion&lt;/em&gt; formulation.  Both formulations include the &quot;budget&quot; constraint, that the sum of the weights equal 1, and can require that each of the weights be greater than zero, the &quot;long-only&quot; inequality constraints.  In the risk minimization problem, weights are found which minimize the portfolio variance subject to the constraint that the portfolio return equal a target return.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;   \underset{w}{\arg \min} \quad w' Q w \quad \text{s.t} \quad rw = r_p,\quad    \sum_i w_i=1, \quad w_i \geq 0\quad $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Q$ is the covariance matrix and $r_p$ is the target portfolio return. In the &lt;em&gt;risk aversion&lt;/em&gt; form,  weights are found which maximize return less a risk aversion coefficient times the portfolio variance as you state in your post. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$    \underset{w}{\arg \max} \quad w'r - \lambda w' Q w \quad \text{s.t}  \sum_i w_i=1, \quad w_i \geq 0\quad &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\lambda$ is the risk aversion coefficient. Notice that there is  no constraint on portfolio return in the risk aversion formulation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your code, the second constraint is an inequality constraint on returns which requires the portfolio return be $\geq r_p$ .  With this constraint, you solution switches from a risk aversion model to a risk minimization model when the return falls below the target return.  This is a possible model but doesn't seem to be what you intended. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;While there are many variations of portfolio optimization using different methods for calculating risk and return, once you've chosen a method, there is only one efficient frontier.  The code below is a modification of your code which shows how risk and return vary for decreasing the value of $\lambda$ and that this is just an alternate way of mapping the efficient frontier given this set of risks and returns.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quadprog)&#xA;efficientPortfolio &amp;lt;- function(er,cov.mat,aversion=3, target_return=NULL, method= c(&quot;risk_min&quot;,&quot;risk_aver&quot;,&quot;mixed&quot;,&quot;min_var&quot;) ){&#xA;  n_asset &amp;lt;- length(er)&#xA;# quad problem&#xA;  if(method %in%  c(&quot;risk_min&quot;, &quot;min_var&quot;)){&#xA;    aversion  = 1&#xA;    Dmat &amp;lt;- cov.mat&#xA;    dvec &amp;lt;- rep(0, n_asset)&#xA;    meq &amp;lt;- ifelse(method == &quot;min_var&quot;, 1, 2)}  &#xA;  else {&#xA;    Dmat &amp;lt;- aversion*cov.mat&#xA;    dvec &amp;lt;- er&#xA;    meq &amp;lt;-  1}&#xA;# constraint eqns&#xA;  if(method %in% c(&quot;risk_aver&quot;,&quot;min_var&quot;)) {&#xA;    bvec &amp;lt;- c(1, rep(0,n_asset))&#xA;    Amat &amp;lt;- matrix( c(rep(1,n_asset), diag(nrow=n_asset)), nrow=n_asset)  }&#xA;  else {&#xA;    bvec &amp;lt;- c(1, target_return, rep(0,n_asset))&#xA;    Amat &amp;lt;- matrix( c(rep(1,n_asset), er, diag(nrow=n_asset)), nrow=n_asset)  }&#xA;  sol&amp;lt;-solve.QP(Dmat, dvec,Amat, bvec=bvec, meq=meq)&#xA;  weights&amp;lt;-sol$solution&#xA;      exp.ret &amp;lt;- t(er)%*%weights&#xA;      std.dev &amp;lt;- sqrt(weights %*% cov.mat %*% weights)&#xA;      ret &amp;lt;- list(er = as.vector(exp.ret),&#xA;                  sd = as.vector(std.dev),&#xA;                  weights = weights,&#xA;                  lagrange_mults=sol$Lagrangian )  &#xA;}&#xA;&#xA;efficientFrontier &amp;lt;- function(er,cov.mat, nport=20, lambda_min = .1, lambda_max=2, lambda = 1,&#xA;                              target_return = NULL,  method = c(&quot;risk_min&quot;,&quot;risk_aver&quot;,&quot;mixed&quot;) ) {&#xA; # if method = risk_min, input sequence of target_returns or use defaults; input target_returns &amp;lt; min_var return are not used&#xA; #           = risk_aver, input upper and lower bounds of risk aversion coefficients lambda or use defaults&#xA; #           = mixed, input single value of risk aversion coefficient lambda and seq of target_returns or use default&#xA;  n_asset &amp;lt;- length(er)&#xA;  method &amp;lt;- method[1]&#xA;  lambda &amp;lt;- if(method == &quot;risk_min&quot;){&#xA;                 nport &amp;lt;- ifelse(is.null(target_return), nport, length(target_return)) &#xA;                 rep(NA_real_,nport) }&#xA;            else if(method == &quot;mixed&quot;) rep(lambda, nport)&#xA;                  else seq(lambda_max, lambda_min, (lambda_min-lambda_max)/(nport-1)) &#xA;  ef &amp;lt;- list(Efficient_Frontier_method = method, sol=matrix(0, nrow=nport, ncol=3, dimnames=list(NULL, c(&quot;lambda&quot;, &quot;sd&quot;, &quot;return&quot;)) ),&#xA;             weights= matrix(0, nrow=nport, ncol=n_asset),&#xA;             lagrange_mults=matrix(0, nrow=nport, ncol=ifelse(method==&quot;risk_aver&quot;, 1, 2) +n_asset) )&#xA;  colnames(ef$lagrange_mults) &amp;lt;- if(method == &quot;risk_aver&quot;) c(&quot;budget&quot;,rep(&quot;&quot;,n_asset)) else c(&quot;budget&quot;,&quot;target_return&quot;,rep(&quot;&quot;, n_asset))&#xA;    # calculate minimum variance portfolio&#xA;      port_min_var &amp;lt;- efficientPortfolio(er,cov.mat,target_return=NULL, aversion=NULL, method=&quot;min_var&quot;)&#xA;      cat(&quot;Mininum Variance Portfolio\n      sd          return\n&quot;)&#xA;      cat(sd=port_min_var$sd, return=port_min_var$er,&quot;\n\n&quot;)&#xA;      target_return &amp;lt;- if(is.null(target_return)) seq(port_min_var$er, max(er), length.out=nport)&#xA;                   else {&#xA;                     target_return[target_return &amp;lt; port_min_var$er] &amp;lt;- port_min_var$er&#xA;                     target_return&#xA;                   }&#xA;  for (i in 1:nport) {&#xA;    port &amp;lt;- efficientPortfolio(er,cov.mat,aversion=lambda[i], target_return=target_return[i], method=method)&#xA;    ef$sol[i,&quot;lambda&quot;] &amp;lt;- lambda[i]&#xA;        ef$sol[i,&quot;sd&quot;] &amp;lt;- port$sd&#xA;        ef$sol[i,&quot;return&quot;] &amp;lt;- port$er&#xA;        ef$weights[i,] &amp;lt;- port$weights&#xA;        ef$lagrange_mults[i,] &amp;lt;- port$lagrange_mults&#xA;  }&#xA;  return(ef)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;EDIT&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;The short answer to your question in the comment is yes.  As the relation between the different risk formulations may be of interest, I've updated the code above to calculate efficient frontiers using both risk minimization (method = &quot;risk_min&quot;) and risk aversion (method=&quot;risk_aver&quot;) methods.  It will also treat your case where the two cases are mixed (method=&quot;mixed&quot;).  The code now also reports the lagrange multipliers for the points on the efficient frontier.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular, for your mixed case, which uses an inequality constraint on the portfolio return, you can see the switch from the risk adverse solution to the risk minimization solution. For smaller values of the target return where the return inequality constraint is not active, the portfolio solution is the same for different value of the target return since nothing has changed and the Lagrange multiplier for the return inequality is zero. As the target return increases, the portfolio return constraint becomes active and determines the solution, and the associated Lagrange multiplier takes on nonzero values. The solution has switched to the risk minimization case. It can be shown that the inverse of portfolio return Lagrange multiplier when it is nonzero is equal to the risk aversion coefficient.  A thorough discussion of portfolio optimization using risk averse methods is given in an MSCI paper  &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1601412&quot; rel=&quot;nofollow&quot;&gt;The Effects of Risk Aversion on Optimization &lt;/a&gt;  especially in their Section B.6 where the relation between the Lagrange multipliers ( their dual variables $\pi_3$ and $\pi_4$ )  and the risk aversion coefficient is demonstrated.&lt;/p&gt;&#xA;" OwnerUserId="11889" LastEditorUserId="11889" LastEditDate="2015-03-31T17:28:15.150" LastActivityDate="2015-03-31T17:28:15.150" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17166" PostTypeId="1" AcceptedAnswerId="17168" CreationDate="2015-03-30T15:28:49.017" Score="3" ViewCount="731" Body="&lt;p&gt;I want to calculate the efficient frontier for a set of 140 assets using returns from the past 10 years. However, some of these assets came into existence only more recently, so for some assets I have the returns for the full 10 years, but for others I have returns only e.g. the last 3 years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can calculate the efficient frontier (as described in &lt;a href=&quot;http://www.finance-r.com/s/efficient_frontier_fPortfolio/complete/&quot; rel=&quot;nofollow&quot;&gt;http://www.finance-r.com/s/efficient_frontier_fPortfolio/complete/&lt;/a&gt; ) if I use the tail of the returns for which all returns are available. But I'd like to use the the full set of returns, where available. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently fPortfolio throws an exception when I input a dataset with NAs. How would I reach my goal? I suspect I'd have to tinker with the fPortfolio source.&lt;/p&gt;&#xA;" OwnerUserId="7930" LastActivityDate="2015-04-01T13:48:14.187" Title="Calculate efficient frontier using fPortfolio with incomplete set of returns" Tags="&lt;r&gt;&lt;modern-portfolio-theory&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17167" PostTypeId="1" CreationDate="2015-03-30T16:07:20.970" Score="3" ViewCount="589" Body="&lt;p&gt;I am trying to improve my understanding of jump processes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a first step, I want to simulate sample paths for the process $$dX(t) = dw(t) + dJ(t)$$ where $dw(t)$ is a Brownian motion and $dJ(t)$ is a compound Poisson process with intensity $\lambda = 5$ and $\mathcal{D} = \mathcal{N}(0,1)$. Can anyone verify that the reasoning of my Mathematica code is sound?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;T = 10;&#xA;n = 1000;&#xA;dt = T/n;&#xA;lambda = 5;&#xA;dw = RandomVariate[NormalDistribution[0, Sqrt[dt]], n];&#xA;dJ = Table[&#xA;   If[RandomVariate[BernoulliDistribution[lambda dt]] == 0, 0, &#xA;RandomVariate[NormalDistribution[]]], {i, 1, n}];&#xA;dX = dw + dJ;&#xA;BrownianJumpPath = Accumulate[Prepend[dX, 0]];&#xA;ListLinePlot[BrownianJumpPath, Frame -&amp;gt; True]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="15782" LastActivityDate="2015-05-01T15:30:24.783" Title="Simulating Brownian motion with jumps" Tags="&lt;simulations&gt;&lt;jump&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17168" PostTypeId="2" ParentId="17166" CreationDate="2015-03-30T16:22:31.060" Score="0" Body="&lt;p&gt;I am not a particularly big fan of fPortfolio. My first thought was to estimate a mean and covariance matrix accounting for the missing data (should be discussed several times on this site or other places) and pass that. However, looking at the manual, it looks like the relevant functions only take time series data. Based on that limitation, you have a few options&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Get the fPortfolio source and re-write the relevant functions to take a mean and covariance&lt;/li&gt;&#xA;&lt;li&gt;Write your own portfolio optimization function doing the same thing as #1. Not really that hard.&lt;/li&gt;&#xA;&lt;li&gt;A more sophisticated approach might be to use multiple imputation. In this case, you'd simulate missing data for your time series and then pass the complete dataset to the fPortfolio function. Repeat this many times and take an average of the weights (following some burn-in). &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2015-03-30T16:22:31.060" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17169" PostTypeId="1" CreationDate="2015-03-30T22:00:53.050" Score="2" ViewCount="1920" Body="&lt;p&gt;I just bumped into a rather interesting article from wikipedia :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Downside_risk&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Downside_risk&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where they define the semi-variance also called Downside risk, which bascially only considers the &quot;negative&quot; variation with respect to some set level e.g. mean.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is : Is is possible to extend this also for the covariance, in order to obtain something like the covariance matrix ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="15767" LastActivityDate="2018-01-19T12:26:09.047" Title="Semi-variance/Downside Risk, what about the rest of the covariance matrix?" Tags="&lt;risk&gt;&lt;covariance&gt;&lt;covariance-matrix&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17170" PostTypeId="2" ParentId="17163" CreationDate="2015-03-31T00:14:42.980" Score="4" Body="&lt;p&gt;Journals that have a wider audience tend to have better written papers, such as Journal of Finance, Review of Financial Studies, or Journal of Financial Economics. Editors there try to ensure that papers are accessible to the wider less technical community.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of quant authors, my vote goes to Dilip Madan, especially his papers in these journals. I also enjoy papers by Darrel Duffie. If you relax the requirements to less-quant Financial Economists, then I would include some classics by Shiller, Bates, Andy Lo, Ait Sahalia, Fama, Campbell, Longstaff.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2015-03-31T00:24:05.797" LastActivityDate="2015-03-31T00:24:05.797" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17171" PostTypeId="1" AcceptedAnswerId="17172" CreationDate="2015-03-31T08:17:23.823" Score="4" ViewCount="624" Body="&lt;p&gt;While wandering through some QuantLib experimental classes for FX trading, I've found this &lt;a href=&quot;http://github.com/lballabio/quantlib/blob/master/QuantLib/ql/experimental/fx/blackdeltacalculator.hpp&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Black Delta Calculator&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By reading its &lt;code&gt;.cpp&lt;/code&gt;, it seems that no use of options time to expiry is made at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usual Black, Scholes &amp;amp; Merton $d_{1}$ argument of cumulative Normal distribution has time to expiry as argument: on the contrary, &lt;a href=&quot;https://github.com/lballabio/quantlib/blob/master/QuantLib/ql/experimental/fx/blackdeltacalculator.cpp&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Black Delta Calculator&lt;/strong&gt;&lt;/a&gt; makes a weird use of $d_{1}$ and $d_{2}$, expressing them like at line 222 or 250:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;d1_ = std::log(forward_/strike)/stdDev_ + 0.5*stdDev_; // .cpp line # 222&#xA;d2_ = std::log(forward_/strike)/stdDev_ - 0.5*stdDev_; // .cpp line # 250&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is quite different than what usual Itö correction produces over classic GBM process (squared variance and of course time adjustment for annual basis).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By reading that code it seems that going from Delta to strike and back can be made regardless of expiry date, while common sense says that there are a lot of options whose Delta can match any strike if you can search all over implied volatility surface without an expiry boundary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Questions&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It must be I am missing some important relations which allow for such&#xA;a simplification: could you show me which one?&lt;/li&gt;&#xA;&lt;li&gt;Is this possible relation viable just for FX options or can it be extended to any use of Black model (e.g. interest rates)?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="3058" LastEditorUserId="3058" LastEditDate="2015-03-31T08:43:17.933" LastActivityDate="2015-03-31T09:45:06.690" Title="Black model: Delta - strike relationship regardless of expiry?" Tags="&lt;fx&gt;&lt;quantlib&gt;&lt;delta&gt;&lt;black&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17172" PostTypeId="2" ParentId="17171" CreationDate="2015-03-31T09:45:06.690" Score="6" Body="&lt;p&gt;The time to expiry is required, but it's included in the inputs: the two discounts $e^{-rT}$ and $e^{-qT}$ and the standard deviation $\sigma\sqrt{T}$.  You might argue it could be documented more clearly, and I might agree with you.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2015-03-31T09:45:06.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17174" PostTypeId="1" CreationDate="2015-03-31T11:18:02.383" Score="3" ViewCount="652" Body="&lt;p&gt;I was wondering why future volatility smile is important to path dependent option and American type option such as Bermudan swaption. It would be best if someone could provide a reference article as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="6910" LastActivityDate="2015-05-01T16:30:24.603" Title="Why future (forward) volatility smile is important to path dependent option?" Tags="&lt;interest-rates&gt;&lt;implied-volatility&gt;&lt;american-options&gt;&lt;volatility-smile&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17175" PostTypeId="2" ParentId="17125" CreationDate="2015-03-31T15:26:03.820" Score="10" Body="&lt;p&gt;The following paper (and the references given within) focuses on the practical aspects of implementation of factor-based investing and gives an overarching framework for the more technical answers here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2457228&quot; rel=&quot;noreferrer&quot;&gt;Practical Considerations for Factor-Based Asset Allocation&lt;/a&gt;&lt;br&gt;&#xA;by Kang, X. (Standard &amp;amp; Poor's), Ung, D. (Chartered Alternative Investment Analyst Association (CAIA); Global Association of Risk Professionals; CFA Institute), 2014&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Abstract&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Much has been written about the shortcomings of the traditional&#xA;  approach to asset allocation. Traditional asset allocation policies&#xA;  can typically be characterized by relatively static asset allocation&#xA;  and by diversification across asset class building blocks. As asset&#xA;  class returns are largely driven by common risk factors such as growth&#xA;  and inflation, traditional balanced portfolios can be poorly&#xA;  diversified, with a pro-cyclical growth bias that may lead to&#xA;  significant drawdowns and losses in the event of market turmoil.&#xA;  Against this backdrop, there has been an emerging shift, especially&#xA;  among institutional investors, toward more dynamic asset allocation,&#xA;  hinged on diversification across risk factors.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Exactly how risk factors should be included in the portfolio&#xA;  construction process is still a nascent area of research and is&#xA;  fiercely debated among practitioners. While there are numerous&#xA;  research papers that explore this topic, they tend to be theoretical,&#xA;  and it is for this reason that this paper has a stronger focus on the&#xA;  practical aspects of implementation. Rather than provide definitive&#xA;  answers here, we aim to share our reflections on this topic, following&#xA;  feedback from practitioners and discussions that took place in client&#xA;  roundtable events S&amp;amp;P Dow Jones Indices organized to promote dialogue&#xA;  with industry experts.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Especially helpful with regard to your question is the section &quot;Implementation Issues to consider&quot; p. 6 ff.:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ERJnw.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some important points for each step:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Investment objective and beliefs&lt;/strong&gt; &lt;br&gt; You have to embed your factor model into the general investment philosophy of your organization. Since general investment philosophies can be quite different (think &quot;Yale model&quot; vs. &quot;Norwegian model&quot; the objectives of implementing a factor strategy can be very different too.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Selection of factors&lt;/strong&gt; &lt;br&gt; This is the part which is addressed in pbr142's answer. Apart from the technicalities &quot;factors should be chosen on the basis of how they can help achieve investment objectives while remaining within the confines of constraints, such as risk appetite, ESG policies and so on.&quot; And: &quot;Investors may also benefit from examining the economic and investment rationale underpinning each of the candidate factor premia and ascertain whether their returns are derived from market inefficiencies, investor behavioral biases or from a rebalancing premium that is generated from the systematic selling of winners and purchasing losers. Depending on the source of the risk premia, investors may come to a different conclusion as to whether these risk premia are likely to persist in the future.&quot;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Selection of strategies and managers&lt;/strong&gt; &lt;br&gt; There are several trade-offs here. One is passive implementation (i.e. rule-based) vs. semiactive implementation. Another is investability vs. exposure. One key point here is that investors have to understand &quot;factor/industry tilts their portfolios have, the return of the factors/industries over time and the macroeconomic factor to which they are most exposed.&quot; This is no trivial task and these exposures might not be what investors had expected at the outset of the strategy.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Portfolio construction&lt;/strong&gt; &lt;br&gt; This is dependent on size and execution of the strategy. The key word here is implementation costs. The more you move away from market-cap-weighted indices the more expensive it gets. These implementation costs are extremely difficult to predict!&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Performance measurement and monitoring&lt;/strong&gt; &lt;br&gt; &quot;Ongoing performance monitoring is indispensable in ensuring that the alternate beta strategies chosen meet investor expectations and objectives and, as noted previously, this would involve examining the portfolio’s overall factor exposure, sector biases and whether it has any secondary exposures to macroeconomic factors.&quot;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2015-04-06T11:38:36.087" LastActivityDate="2015-04-06T11:38:36.087" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="17176" PostTypeId="1" AcceptedAnswerId="17183" CreationDate="2015-03-31T15:53:01.290" Score="1" ViewCount="714" Body="&lt;p&gt;I would like to build a couple of custom indices.  I would like to be able to enter ticker(s) into an input and have ohlc, volume, qualitative ...data downloaded from yahoofinance, google finance, finviz etc over x period.  From this I would like to build a geometric average indices for high momentum stocks and value stocks.  I would then like to conduct analysis of these indices as they relate to each other.  What stocks have highest/lowest correlation over x period, volume/range analysis, momentum over x period, sma for pairs trade....Is this a job for python or R?  Do you have any suggestions on what packages/resources I would need to do this kind of analysis?  I appreciate your help.   &lt;/p&gt;&#xA;" OwnerUserId="15794" LastActivityDate="2015-03-31T22:32:50.493" Title="Building custom indices; getting data from web; stats analysis; Python or R?" Tags="&lt;equities&gt;&lt;r&gt;&lt;index&gt;&lt;python&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17177" PostTypeId="2" ParentId="17176" CreationDate="2015-03-31T16:10:29.820" Score="0" Body="&lt;p&gt;It is essentially a statistical exercise, so I would choose R.&lt;/p&gt;&#xA;" OwnerUserId="13902" LastActivityDate="2015-03-31T16:10:29.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17178" PostTypeId="2" ParentId="17176" CreationDate="2015-03-31T16:16:09.203" Score="2" Body="&lt;p&gt;Both R and Python can do this very nicely.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Python you would need the &lt;code&gt;pandas&lt;/code&gt; package and its dependencies.  &lt;code&gt;pandas&lt;/code&gt; has a lot of basic statistics, but for more advanced statistics like it looks like you want to do, you can use the &lt;code&gt;statsmodels&lt;/code&gt; package, which can work directly with &lt;code&gt;pandas&lt;/code&gt; data types.  It can also download the &lt;code&gt;csv&lt;/code&gt; files directly off the website if given a url, even from &lt;code&gt;https&lt;/code&gt; sites.  Further, it can download the sort of stock data you want for you, just by giving it a stock ticker and a date range.  You can download a python distribution like anaconda or python(X,Y) which will have &lt;code&gt;pandas&lt;/code&gt; and &lt;code&gt;statsmodels&lt;/code&gt; built-in, so no additional installation is necessary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;R doesn't need any additional packages.  It can do roughly the same things as &lt;code&gt;pandas&lt;/code&gt; and &lt;code&gt;statsmodels&lt;/code&gt; for your purposes.  It can also download &lt;code&gt;csv&lt;/code&gt; files off the web if given a url, but apparently chokes on https files (which &lt;code&gt;pandas&lt;/code&gt; doesn't), although you may not even be downloading any files through these programs.  You can use another tool to do this in R, though, and it will likely only add an additional line or two of code.  With additional packages, such as &lt;code&gt;quantmod&lt;/code&gt; or &lt;code&gt;Quandl&lt;/code&gt;, it can also download stock data using a ticker and date range.&lt;/p&gt;&#xA;" OwnerUserId="15795" LastEditorUserId="15795" LastEditDate="2015-03-31T17:51:21.737" LastActivityDate="2015-03-31T17:51:21.737" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17179" PostTypeId="1" AcceptedAnswerId="17180" CreationDate="2015-03-31T16:54:50.257" Score="2" ViewCount="206" Body="&lt;p&gt;I'm viewing the following derivation of a Call Option price using the CRR model. There is one piece of the derivation which I cannot understand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;C_0 &amp;amp;= e^{-rT} \sum_{i=0}^{N} (S_{0}\,u^{N-i}\,d^{i} - K)^{+} \binom {N}{i} q^{N-i}(1-q)^{i}\\&#xA;&amp;amp;= e^{-rN \Delta t} \sum_{i=a}^{N} (S_{0}\,u^{N-i}\,d^{i} - K) \binom {N}{i} q^{N-i}(1-q)^{i}\\&#xA;&amp;amp;= S_0 \sum_{i=a}^{N} \binom {N}{i} (u\,q\,e^{-r \Delta t})^{N-i}\, (d\,e^{-r \Delta t}\,(1- q))^{i} - Ke^{-rT} \sum_{i=a}^{N} \binom {N}{i} q^{N-i} (1-q)^{i}\\&#xA;&amp;amp;= S_0 \sum_{i=a}^{N} \binom {N}{i} \overline{q}^{N-i}\, (1 - \overline{q})^{i} - Ke^{-rT} \sum_{i=a}^{N} \binom {N}{i} q^{N-i} (1-q)^{i}\\&#xA;&amp;amp;= S_0 \mathcal{Q}_1 - K e^{-rT} \mathcal{Q}_2&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\overline{q} = uqe^{-r\Delta t}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\textbf{Question}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $\overline{q} = uqe^{-r\Delta t}$, then I'm assuming $(1-\overline{q}) = d\,e^{-r \Delta t}\,(1- q)$, however I cannot seem to derive this equality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Appreciate any help understanding why.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;John&lt;/p&gt;&#xA;" OwnerUserId="15796" LastActivityDate="2015-03-31T17:17:17.270" Title="Call option pricing using CCR model - derivation problem" Tags="&lt;option-pricing&gt;&lt;binomial&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17180" PostTypeId="2" ParentId="17179" CreationDate="2015-03-31T17:17:17.270" Score="1" Body="&lt;p&gt;Note that &#xA;\begin{align*}&#xA;q= \frac{e^{r\Delta t} -d}{u-d}.&#xA;\end{align*}&#xA;Then, &#xA;\begin{align*}&#xA;u = \frac{e^{r\Delta t} -d}{q} + d.&#xA;\end{align*}&#xA;Therefore,&#xA;\begin{align*}&#xA;1-\bar{q} &amp;amp;= 1-uqe^{-r\Delta t}\\&#xA;&amp;amp;=1- \big(e^{r\Delta t} -d\big)e^{-r\Delta t}-dqe^{-r\Delta t}\\&#xA;&amp;amp;=de^{-r\Delta t} -dqe^{-r\Delta t}\\&#xA;&amp;amp;=de^{-r\Delta t}(1-q).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-03-31T17:17:17.270" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17181" PostTypeId="1" CreationDate="2015-03-31T17:35:18.687" Score="3" ViewCount="813" Body="&lt;p&gt;I would like to understand how exchange traded funds (ETFs) can be classified in legal terms.&#xA;According to &lt;a href=&quot;https://advisors.vanguard.com/VGApp/iip/site/advisor/etfcenter/article/ETF_FiveStructures&quot; rel=&quot;nofollow&quot;&gt;Vanguard&lt;/a&gt;, there are five ETF structures&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Open-End Funds&lt;/li&gt;&#xA;&lt;li&gt;Unit Investments Trusts&lt;/li&gt;&#xA;&lt;li&gt;Grantor Trusts&lt;/li&gt;&#xA;&lt;li&gt;Exchange Traded Notes (ETNs)&lt;/li&gt;&#xA;&lt;li&gt;Partnerships&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The wording suggests that all 5 structures are considered ETFs. A document by &lt;a href=&quot;https://d2e18nuhnog8lh.cloudfront.net/statestreet-app_etf-ed/content/content_520a9285e4b095121eff302f/SPDRU-legal-structures-of-spdr-etfs.pdf?Expires=1427820238&amp;amp;Signature=VGVQpzf6yX9Fg6x29GsowhH~-VYp7oRllMIgCp~6rogDkNxyuUOHytvBkkw9hLJemc8m50tYclUae18HC3LA1gIEgo3ZVQJ5pzkaxctfxB6dBmzNHoFU0mJgmPKkIHiawg~GTX9j4S6zhXMiytiPFcAdDUtdA14Ao7krv4MbV~Y_&amp;amp;Key-Pair-Id=APKAIPZNY4IQX6YFQ6ZA&quot; rel=&quot;nofollow&quot;&gt;SPDR&lt;/a&gt; also classifies the SPDR ETFs using structures 1-3, with most of their ETFs being Open-End Funds, a few of them Unit Investment Trusts, and only &lt;a href=&quot;http://finance.yahoo.com/q?s=gld&quot; rel=&quot;nofollow&quot;&gt;GLD&lt;/a&gt; being a Grantor Trust. Hence, exchange traded commodities (ETCs) seem to fall under structure 3, Grantor Trust. It is also interesting that the term &lt;a href=&quot;https://www.barclaysstockbrokers.co.uk/investments/etc/pages/at-a-glance.aspx&quot; rel=&quot;nofollow&quot;&gt;ETC&lt;/a&gt; is more frequently used in the German speaking parts of Europe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A nice summary that matches the definitions of Vanguard and SPDR can be found at &lt;a href=&quot;http://www.etf.com/etf-education-center/21041-legal-structures-regulation-and-taxes.html&quot; rel=&quot;nofollow&quot;&gt;etf.com&lt;/a&gt;. However, this document focuses mostly on tax related differences.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions are&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Is it correct to speak of ETFs, ETNs and ETCs as different entities in a&#xA;legal document? My guess is no since &quot;ETF&quot; seems to be an umbrella term under which ETNs and ETCs are to be subsumed. An example: My impression is that the sentence &quot;The fund invests in ETFs, ETNs and ETCs&quot; would be sloppy as ETNs and ETCs are a kind of ETF.&lt;/li&gt;&#xA;&lt;li&gt;In which context (if at all) is it correct to use the term &quot;ETC&quot;? For instance: Is it equivalent to a Grantor Trust that holds commodities? Or is it also ok to use ETC for an ETN that replicates the price of a commodity?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I know that these are not really quantitative questions. Nonetheless, I assume quite a few people who work in portfolio and/or risk management have to cope with this legal mumbo-jumbo from time to time and may be willing to help. Also, this forum seems to be the best within the stackexchange universe for posting such questions.&lt;/p&gt;&#xA;" OwnerUserId="3303" LastActivityDate="2015-04-07T23:53:50.933" Title="What is the legal difference between ETFs, ETNs and ETCs" Tags="&lt;etf&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17182" PostTypeId="1" AcceptedAnswerId="17194" CreationDate="2015-03-31T19:57:49.617" Score="3" ViewCount="291" Body="&lt;p&gt;I know that the geometric mean is used in order to make percentage returns across time comparable. Similarly, I know that log prices make percentage returns comparable for example when prices are charted. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the mathematical basis for this relationship? Put differently, in what way do log returns &quot;correspond&quot; to geometric means and in what way to simple returns &quot;correspond&quot; to arithmetic means?&lt;/p&gt;&#xA;" OwnerUserId="13665" LastActivityDate="2015-05-01T14:30:24.907" Title="What is the relationship between arithmetic versus geometric averages and simple versus logarithmic prices?" Tags="&lt;returns&gt;&lt;log-returns&gt;&lt;mean&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17183" PostTypeId="2" ParentId="17176" CreationDate="2015-03-31T22:32:50.493" Score="1" Body="&lt;p&gt;In addition to the above answers - You should be very careful that you do not introduce survivorship bias in your creation of indices and choose your data source carefully to remove such bias.  For example, Yahoo Finance only contains currently-listed securities.&lt;/p&gt;&#xA;" OwnerUserId="13859" LastActivityDate="2015-03-31T22:32:50.493" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17184" PostTypeId="2" ParentId="17125" CreationDate="2015-04-01T01:14:07.893" Score="6" Body="&lt;p&gt;&lt;a href=&quot;https://r-forge.r-project.org/scm/viewvc.php/*checkout*/pkg/FactorAnalytics/vignettes/fitTsfm_vignette.pdf?root=returnanalytics&quot; rel=&quot;noreferrer&quot;&gt;Time Series Factor modelling&lt;/a&gt; is a very good and practical manual to building time series factor models. FactorAnalytics is a very good R package that allows you to fit timeseries, fundamental and statistical factor models. A good reference to factor models would be &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0387279652&quot; rel=&quot;noreferrer&quot;&gt;Chapter 15&lt;/a&gt; of this book.&lt;/p&gt;&#xA;" OwnerUserId="2142" LastActivityDate="2015-04-01T01:14:07.893" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17187" PostTypeId="1" CreationDate="2015-04-01T05:47:21.460" Score="2" ViewCount="292" Body="&lt;p&gt;For tax reasons, I switched a position I had in the HSBC London GBP listing into the USD ADR. The ADR represents 5 shares of the GBP listing.&#xA;My understanding was that since at all times 1 ADR = 5 UK stock, when holding the ADR, your underlying currency risk is still GBP which is what I wanted.&#xA;So I sold my UK position to by 1/5 in the ADR, hoping that I could revert the position at some stage in the future at no cost since at all times I retained the same exposure.&#xA;For some reason I don't understand, 1 year down the road, if I simulate a converstion of my position back in the UK stock, I love about 25 % when the original stock has lost only 9 %. As if had been exposed to USD/GBP risk.&#xA;I understand that the price of the ADR is a function of the price of the UK stock and the UK/USD exchange rate, but if the ADR drops in price due to UK/USD, I should be able to compensate that as I will need less USD to buy back the GBP, so this factor should be offset. &#xA;Can anyone understand where is the problem ? For me if at all times 1 ADR in USD = 5 UK stock, I could at all times switch from one to the other retaining the same exposure, but in practice does not seem to be the case !&lt;/p&gt;&#xA;" OwnerUserId="15804" LastActivityDate="2015-05-01T11:15:09.317" Title="Relationship between ADR in USD and original stock in GBP - Drift in price" Tags="&lt;fx&gt;&lt;arbitrage&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17188" PostTypeId="1" CreationDate="2015-04-01T08:29:17.053" Score="2" ViewCount="1681" Body="&lt;p&gt;I want to calculate the implied volatility from the option data that I took from Bloomberg (call Option written on S&amp;amp;P500 index with the maturity of 19-Dec-2009 and strike of 1300), but volatility comes out to be zero. Do you have any ideas how I can calculate the volatility or correct the data?&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;As the risk free rate I normally use the 3 month TBill rate.&lt;/li&gt;&#xA;&lt;li&gt;As the Last price of the option I use the average of the Bid and Ask Prices (Bloomberg last price is not available for the most of the data points).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Date      Bid Price Underlying Interest Rate    Time to Maturity    Ask Price   Last Price&#xA;22/12/2006  272.5   1411.73999  0.055555        2.989041096          276.5       274.5  &#xA;26/12/2006  278.5   1417.869995 0.055463        2.978082192          282.5       280.5  &#xA;27/12/2006  285.8   1427.709961 0.055666        2.975342466          289.8       287.8  &#xA;28/12/2006  285.1   1425.089966 0.05538         2.97260274           289.1       287.1  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="15805" LastEditorUserId="13585" LastEditDate="2015-04-02T13:26:39.207" LastActivityDate="2015-07-11T18:48:30.440" Title="Implied Volatility Calculation" Tags="&lt;black-scholes&gt;&lt;implied-volatility&gt;" AnswerCount="2" CommentCount="7" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17189" PostTypeId="1" AcceptedAnswerId="17297" CreationDate="2015-04-01T10:09:07.107" Score="4" ViewCount="127" Body="&lt;p&gt;I've just read the article in the link below and would like to know if someone can elaborate on a statement. I have added the whole paragraph, but highlighted the part about the use of ETNs as cheap funding. How does banks use ETNs as funding?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I live in Denmark where the only ETF-like offerings are ETNs and I'm trying to figure out why none of the banks are creating ETFs.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The investment banks take advantage of their superior sophistication. From the get-go, the ETN is a fantastic deal for banks. It's in the DNA of the product; once held, an ETN almost can't help but be fabulously profitable to its issuer. Why? They're dirt-cheap to run because the fixed costs are already borne by infrastructure set up for structured products desks. &lt;strong&gt;They're an extremely cheap source of funding&lt;/strong&gt;, the life blood of the modern bank. More important, this funding becomes more valuable the bleaker an investment bank's health. As a cherry on top, investors pay hefty fees for the privilege of offering this benefit. This isn't enough for some issuers. They've inserted egregious features in the terms of many ETNs. The worst we've identified so far is a fee calculation that secretly shifts even more risk to the investor, earning banks fatter margins when their ETNs suddenly drop in value.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The article is from Morningstar:&#xA;&lt;a href=&quot;http://www.morningstar.com/advisor/t/53658975/exchange-traded-notes-are-worse-than-you-think.htm&quot; rel=&quot;nofollow&quot;&gt;Exchange-Traded notes are worse than you think&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15808" LastEditorUserId="743" LastEditDate="2015-04-01T21:44:27.177" LastActivityDate="2015-05-25T04:45:31.427" Title="ETNs as bank funding" Tags="&lt;etf&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17191" PostTypeId="2" ParentId="17156" CreationDate="2015-04-01T11:07:10.013" Score="6" Body="&lt;p&gt;For a Ornstein-Uhlenbeck process, the maximum likelihood parameters are the ones from least squares regression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your process is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;dX=\kappa (\theta-X)dt+\sigma dW&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you can do a linear regression in the form&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{dX}{dt}=a+bX+\epsilon&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So your parameters will be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\kappa=-b&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\theta=-\frac{a}{b}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\sigma=std(\epsilon dt)&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="6356" LastEditorUserId="6356" LastEditDate="2015-04-01T15:32:07.390" LastActivityDate="2015-04-01T15:32:07.390" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17192" PostTypeId="2" ParentId="17169" CreationDate="2015-04-01T13:11:59.680" Score="3" Body="&lt;p&gt;There are 2 issues that come to mind &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What is the correct definition of semi-covariance &#xA;$$&#xA;\frac{1}{n}\sum\limits_{i = 1}^n {\sum\limits_{j = 1}^n {\min \left( {{r_i},0} \right)} } \min \left( {{r_j},0} \right)&#xA;$$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{1}{n}\sum\limits_{i = 1}^n {\sum\limits_{j = 1}^n {\min \left( {{r_i}{r_j},0} \right)} } &#xA;$$&#xA; 2. Can you get a positive semi-definite covariance matrix with this definition?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These questions are tricky and there is no consensus.&lt;/p&gt;&#xA;" OwnerUserId="2142" LastActivityDate="2015-04-01T13:11:59.680" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17193" PostTypeId="2" ParentId="17156" CreationDate="2015-04-01T13:13:02.960" Score="8" Body="&lt;p&gt;Similar to Juan Gil's answer but a bit differently I would say the following based on &lt;a href=&quot;https://math.stackexchange.com/questions/345773/how-the-ornstein-uhlenbeck-process-can-be-considered-as-the-continuous-time-anal/345795#345795&quot;&gt;this&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The OU process $$dX_t = \kappa(\theta-X_t)dt + \sigma dW_t$$ can be (Euler-Maryuama discretization) discretized at times $n \Delta t,n=1,\ldots,\infty $ which gives with $t = k \Delta t$&#xA;$$&#xA;X_{k+1} - X_k = \kappa \theta \Delta t -\kappa X_k \Delta t + \sigma (W_{k+1} - W_k),&#xA;$$&#xA;rearranging and setting $\sigma (W_{k+1} - W_k) = \sigma \sqrt{\Delta t} \epsilon_k  $ we get:&#xA;$$&#xA;X_{k+1} = \kappa \theta \Delta t - (\kappa \Delta t - 1) X_k  + \sigma \sqrt{\Delta t} \epsilon_k.&#xA;$$&#xA;So you can model an AR(1) process and then identify the parameters using the equation above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thinking about it again one can probably leave&#xA;$X_{k+1} - X_k$ on the lhs and then one simply does a regression but I don't know exactly about the error terms in this case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have found &lt;a href=&quot;http://r.789695.n4.nabble.com/Ornstein-Uhlenbeck-td2991060.html&quot; rel=&quot;noreferrer&quot;&gt;this with&lt;/a&gt; R code, there an MLE approach is used. You find various solutions in this Stack Overflow &lt;a href=&quot;https://stackoverflow.com/questions/4000018/r-code-for-using-ornstein-uhlenbeck-to-estimate-time-for-mean-reversion&quot;&gt;question&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2015-04-01T15:16:45.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17194" PostTypeId="2" ParentId="17182" CreationDate="2015-04-01T13:34:14.933" Score="4" Body="&lt;p&gt;If you wanted to see the following (price $S_t$, log return $r$, simple return $R$) then&#xA;$$&#xA;r = \log(S_{t+1}) - \log(S_t) = \log(S_{t+1}/S_{t}),&#xA;$$&#xA;and &#xA;$$&#xA;R = S_{t+1}/S_{t}-1, &#xA;$$&#xA;thus&#xA;$$&#xA;R = \exp(r)-1&#xA;$$&#xA;and $$r = \log(1+R).$$ Was this the question?&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-04-01T13:34:14.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17195" PostTypeId="2" ParentId="17166" CreationDate="2015-04-01T13:48:14.187" Score="0" Body="&lt;p&gt;You might take a look at the &lt;code&gt;PortfolioAnalytics&lt;/code&gt; package.  It's &lt;code&gt;optimize.portfolio&lt;/code&gt; function does require asset returns but the momentFUN argument allows you to provide your own function for using these returns to calculate the moments used in the optimization. Overall it provides a great deal of flexibility for specifying constraints and optimization methods.   It's not on CRAN but is available from &lt;a href=&quot;https://r-forge.r-project.org/R/?group_id=579&quot; rel=&quot;nofollow&quot;&gt;Return Analytics Development Page&lt;/a&gt; .&lt;/p&gt;&#xA;" OwnerUserId="11889" LastActivityDate="2015-04-01T13:48:14.187" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17196" PostTypeId="1" AcceptedAnswerId="17319" CreationDate="2015-04-01T13:50:39.923" Score="2" ViewCount="838" Body="&lt;p&gt;Confused about the unconditional covariance matrix in a DCC GARCH model. Could anyone help me understand it? My understanding is that we get the unconditional covariance before based on the data sets. For example, two data sets, A and B, then the unconditional covariance matrix is built by the variance of A and B respectively and covariance of them, is that true? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="15201" LastActivityDate="2015-05-10T05:50:39.267" Title="Explain the unconditional covariance in Dynamic Conditional correlation( DCC ) GARCH model" Tags="&lt;garch&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17197" PostTypeId="2" ParentId="17167" CreationDate="2015-04-01T14:48:21.907" Score="1" Body="&lt;p&gt;What you do is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You simulate a Brownian path - with the correct standard deviation.&lt;/li&gt;&#xA;&lt;li&gt;Then you simulate the Compound Poisson process. In each time step you sample a jump or no jump and the jump size if there was one. In each time step you draw from a Bernoulli distribution - which is to my knowledge just an approximation.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For the compound Poisson process I would follow the Algorithm 6.2 in the book by Tankov and Cont. The steps are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;simulate $N$ with intensity $\lambda T$ ... the number of jumps during the interval from $[0,T]$.&lt;/li&gt;&#xA;&lt;li&gt;Simulate $N$ uniformly distributed uniforms (independent of $N$) uniformly distributed on $[0,T]$- the jump times.&lt;/li&gt;&#xA;&lt;li&gt;Then simulate the jump sizes at each jump time and add them up at the jump time.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-04-01T14:48:21.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17198" PostTypeId="1" AcceptedAnswerId="17199" CreationDate="2015-04-01T15:21:53.397" Score="0" ViewCount="383" Body="&lt;p&gt;I want to correctly simulate a $\mathcal{Q}$ - martingale $S$, which is a geometric Brownian motion and an exponential of a process $X$,&#xA;\begin{equation}&#xA;X_t = X_0 + \mu t + \sigma B_t = X_{t-\Delta t} + \mu \Delta t + \sigma B_{\Delta t},&#xA;\end{equation}&#xA;where $X_0 = 0$ and $B$ is a Brownian motion under $\mathcal{Q}$, such that &#xA;\begin{equation}&#xA;    S_t =  S_0 \exp(X_t) = S_0 \exp(\mu t + \sigma B_t) = S_{t-\Delta t} \exp(\mu \Delta t + \sigma B_{\Delta t}),&#xA;\end{equation}&lt;br&gt;&#xA;with $\mu = -\sigma^2/2$ from the martingale condition (no interest rates, or $r=0$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I run many (eg. N=1000) simulations of $(X_t)_{t=\Delta t}^T$ over a one-year time horizon ($T=1$, using the first equation above for simulation) with $\Delta t = 1/250$, the average of $X_T$ is significantly lower than $X_0 = 0$, which implies that also $S_T$ is on average significantly lower than $S_0$.&lt;br&gt;&#xA;This seems understandable to me since I learnt that the above equation for $S_t$ is the solution of the dynamics $dS/S = \mu dt + \sigma dB_t$, and that, from Ito's lemma applied to the latter, in order for $S$ to be a martingale, the drift $\mu$ of the process $X$ needs to equal $-\sigma^2/2$; thus $X$ should go down on average.&lt;br&gt;&#xA;However, from the martingale property of $S$, I would expect $S_T$ to be on average on the level of $S_0$. What is wrong? Can anybody write a concise illustration of the concept?&lt;/p&gt;&#xA;" OwnerUserId="15097" LastActivityDate="2015-04-01T15:55:14.320" Title="Simulating a GBM with martingale condition - Ito process moving downwards" Tags="&lt;stochastic-processes&gt;&lt;brownian-motion&gt;&lt;simulations&gt;&lt;martingale&gt;&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17199" PostTypeId="2" ParentId="17198" CreationDate="2015-04-01T15:43:37.893" Score="1" Body="&lt;p&gt;The average of the exponentials is not the exponential of the average. It is always higher due to convexity (Jensen inequality). So there is no contradiction between the average of $X_T$ being negative and the average of $S_T$ being $S_0$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the question is: are your results really significantly different from what you would expect? Have you tried increasing your simulation number? Do you know how to compute a confidence interval as a function of N? &lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2015-04-01T15:55:14.320" LastActivityDate="2015-04-01T15:55:14.320" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17200" PostTypeId="2" ParentId="9624" CreationDate="2015-04-01T15:59:58.477" Score="0" Body="&lt;p&gt;The answer can be found on page 10 of &lt;a href=&quot;https://eiopa.europa.eu/Publications/Consultations/EIOPA_EIOPA-CP-14-052_ITS_Reg_Supervisory_reporting.pdf&quot; rel=&quot;nofollow&quot;&gt;CP-14-052&lt;/a&gt; (released 27 November 2014):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Unless otherwise stated, each asset shall be reported separately in as&#xA;  many lines as needed in order to properly fill in all variables&#xA;  requested.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="5883" LastActivityDate="2015-04-01T15:59:58.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17201" PostTypeId="2" ParentId="17125" CreationDate="2015-04-01T16:06:19.803" Score="47" Body="&lt;p&gt;&lt;strong&gt;1. Determine Factors&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Economically, the use of factor models can be either motivated using the &lt;a href=&quot;http://www.jstor.org/discover/10.2307/1913811?sid=21105911753781&amp;amp;uid=4&amp;amp;uid=3737864&amp;amp;uid=2&quot;&gt;ICAPM&lt;/a&gt; or the &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/0022053176900466&quot;&gt;APT&lt;/a&gt;. Although there are some theoretical differences between the model, for empirical and practical work these differences are irrelevant. In the end, both models stipulate that returns and expected returns are linear functions of the factors:&#xA;$$ r_{i,t} = \alpha_i + \sum_j \beta_{i,j} F_{j,t} + \epsilon_{i,t} \quad (1)$$&#xA;$$ \mathbb{E}[ r_{i,t}] = \lambda_o + \sum_j \beta_{i,j} \lambda_j \quad\quad\quad(2)$$&#xA;where $F_{j,t}$ is the factor surprise of factor $j$ at time $t$ and $\lambda_j $ is the factor risk premium of factor $j$.&#xA;What the factors are is fundamentally undetermined. Following the ICAPM, the factors should be proxies for future marginal consumption growth (=state variables). Whatever factor you use, there should be an economic reason why returns should be related to the factor.&#xA;For some of the steps later, it makes a difference whether the factors are traded returns or some other factor (such as macroeconomic variables). Factors based on returns are usually derived as the return on a particular portfolio or the difference between two portfolios. Best known examples for the first group are the macro factors used by Chen, Roll, and Ross (&lt;a href=&quot;http://www.jstor.org/discover/10.2307/2352710?sid=21105911753781&amp;amp;uid=2&amp;amp;uid=4&amp;amp;uid=3737864&quot;&gt;1986&lt;/a&gt;) and for the later group the Fama and French factors (&lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/j.1540-6261.1992.tb04398.x/full&quot;&gt;1992&lt;/a&gt;,&lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/0304405X93900235&quot;&gt;1993&lt;/a&gt;, &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/j.1540-6261.1996.tb05202.x/full&quot;&gt;1996&lt;/a&gt;, &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2287202&quot;&gt;2014&lt;/a&gt;). It makes the statistical estimation somewhat easier when the factors are returns (I’ll explain this point later)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2. Collect Data&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The next step is always the data collection, both for the factors and the test assets. Sometimes, when the factors are macroeconomic time series (or something similar) their predictable component is removed so that the factors are only the factor surprises. In principle, only the unexpected component should explain the cross-sectional differences in returns.&#xA;When factors are constructed as portfolio returns, a key question is the rebalancing frequency. Most papers that I am aware of follow the example of Fama and French and form the portfolios in the middle of the year (1st of July) and then keep the portfolio constituents the same for a year (a well-known counterexample is the momentum factor of Carhart (&lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/j.1540-6261.1997.tb03808.x/full&quot;&gt;1997&lt;/a&gt;) who uses monthly rebalancing).&#xA;When factors are constructed as the difference in returns between top and bottom portfolios according to some ranking the question arises at which quantiles to split the assets. Common are splits at the median, 30/70 quantiles, or 10/90 quantiles.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;3. Estimate regressions&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The final step is to estimate the regressions to see if the factors are able to explain the cross-section of returns. There are two principle approaches to this, sometimes called time-series regression and cross-sectional regressions (I have also heard people refer to the first procedure as the Fama-French method and the second one as the Fama-MacBeth method).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;a) Time-Series Regression&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When all factors are returns, you can use time-series regressions for each test asset to estimate the regression slopes $\beta_{i,j}$. In this case, you estimate model (1). You will obtain a beta for each factor and test asset. The reason you can use time-series regressions in this case is that the factor premia $\lambda_j$ can simply be estimated as the time-series mean of the factor returns.&#xA;If you use excess returns as dependent variables in the regression, the factor model has one implications: all $\alpha_i$ should be zero. Testing this depends a bit on your assumptions about the temporal and cross-sectional correlation in the error terms. In any case, you will have to resort to some form of F-Test (adjusted for autocorrelation, heteroscedasticity, general errors etc.) as you are testing multiple hypotheses. The book by Cochrane (&lt;a href=&quot;http://press.princeton.edu/titles/7836.html&quot;&gt;2001&lt;/a&gt;) derives these in detail using a GMM approach (chapters 12 and 13).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;b) Cross-Sectional Regressions&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For general factors, you will need to run cross-sectional regressions by estimating equation (2). A key problem here is that both the $\beta$ coefficients and the prices of risk $\lambda$ are not directly observable. The usual way around is to follow the procedure laid out by Fama and MacBeth (&lt;a href=&quot;http://www.jstor.org/discover/10.2307/1831028?sid=21105911753781&amp;amp;uid=4&amp;amp;uid=3737864&amp;amp;uid=2&quot;&gt;1973&lt;/a&gt;): You first run time-series regressions separately for each test asset. This will give you estimates for each $\beta$ for each asset. These estimates are then used in the cross-sectional regression as independent variables using the average returns for each asset as dependent variable. The coefficients being estimated in this regression are the factor risk premia $\lambda$. Again, the prediction of a factor model is that the pricing errors $\lambda_0$ are zero for each asset. In the case of cross-sectional regressions this is a single parameter for which the nullhypothesis that it is zero in the population can be tested. This procedure is usually repeated using a rolling window; with monthly data usually 5 years of data.&#xA;The real “meat” of the Fama-MacBeth method is the statistical theory of how to account in the standard errors of the cross-sectional regressions for the fact that the $\beta$’s are estimated coefficients from a time series regression and cross-sectional correlation. Again, I would refer to Cochrane’s (&lt;a href=&quot;http://press.princeton.edu/titles/7836.html&quot;&gt;2001&lt;/a&gt;) book in Chapter 12 for details on the test statistics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;4. Evaluate results&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After evaluating whether the pricing errors are small (test that $\alpha_i=0$ for all i), the next question is to test whether the factors chosen in step 1 are “good factors”. This means that they should exhibit a strong relationship to expected returns. The cross-sectional and time-series approaches give slightly different methods to test if a factor is priced.&#xA;For both methods (time-series and cross-sectional regressions) one should test if the factors are actually priced in the cross-section. For time-series regressions, the factor risk premia are estimated as the time-series average of the factor returns. Standard statistical tests can be used to test if these are positive. For cross-sectional regressions, the factor risk premia are the coefficients of the regressions which can also be tested. In both cases, one should be careful about the standard errors used (autocorrelation in the time series approach, cross-sectional dependencies).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A question that often comes up is which approach is “better”. First, time-series regressions can only be used when the factors are returns. In case the factors are returns, the two approaches are not necessarily equivalent. The time-series regression estimates the factor premium as the average return. Therefore, any factor receives a zero pricing error in the sample. This is equivalent to forcing the intercept in the cross-sectional to zero. In order to make the two methods equivalent, you will have to include the factor as a test asset as well. If you do this, then using the correct standard errors will produce the same estimates for the prices of risk.&lt;/p&gt;&#xA;" OwnerUserId="7396" LastEditorUserId="7396" LastEditDate="2015-04-07T09:43:13.187" LastActivityDate="2015-04-07T09:43:13.187" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17202" PostTypeId="2" ParentId="17174" CreationDate="2015-04-01T16:16:09.787" Score="3" Body="&lt;p&gt;First of all, a Bermudan Swaption does not have to be of American type. Consider a &quot;9NC2 Bermudan&quot; (9 non call 2), basically a Bermudan swaption with final maturity in 9 years which is not exercisable for the first 2 years. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have not worked at an exotic rates desk in a while (many years to be more precise) but from what I remember you need to use a lattice tree model to describe the evolution of interest rates. One can evolve such rates via a number different models such as HW, Gaussian 2-factor, Libor Market Model (possibly with SABR style stochastic volatility model), Black's model, among others. Some are short-rate models, others evolve discrete forward rates (such as LMM). I am not knowledgeable of newer approaches if they exist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you calibrate your model to match the prices of other swaptions (those that are co-terminal with your Bermudan) the choice of model will basically determine which parameters you calibrate for. In the example of the Libor Market Model you need to also choose how to model volatility (volatility of forward rates) and correlations between the driving Brownian Motions. This is where your volatility surface comes into play. The volatility surface you derive during your calibration exercise describes the volatility of different forward rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once the calibration step is complete you can then iterate the lattice to price your Bermudan option. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2015-04-01T16:16:09.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17203" PostTypeId="2" ParentId="17121" CreationDate="2015-04-01T19:56:27.377" Score="1" Body="&lt;p&gt;There exist 3 kind of &lt;strong&gt;models for credit portfolio management&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Structural models (as, for instance, the KMV's based-models or credit-metrics models);&lt;/li&gt;&#xA;&lt;li&gt;Actuarial (or intensity) models;&lt;/li&gt;&#xA;&lt;li&gt;Macro-Factors (or econometrics) models;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I suggest you to read &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2547663&quot; rel=&quot;nofollow&quot;&gt;Derbali (2012)&lt;/a&gt;, that's a simple paper that explains the main features and the differences among those kinds of models. Anyway, the main difference consists on the approach used to compute the probability of default, with the relative consequences; in fact, each of them has both advantages, limits and drawbacks and you have to choose which one is more convenient in your case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, generally, the &lt;a href=&quot;http://iacpm.org/&quot; rel=&quot;nofollow&quot;&gt;IACPM&lt;/a&gt; is a really great source for who wants to keep updating his knowledge about this topic; for instance, &lt;em&gt;&lt;a href=&quot;http://web.iacpm.org/library/public_documents/IACPMSoundPractices.pdf&quot; rel=&quot;nofollow&quot;&gt;&quot;Sounds Practices in Credit Portfolio Management&quot;&lt;/a&gt;&lt;/em&gt; is a great paper that could be helpful to clarify your doubts about the &lt;strong&gt;credit portfolio managegement&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-04-01T19:56:27.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17204" PostTypeId="1" AcceptedAnswerId="17218" CreationDate="2015-04-01T20:01:39.210" Score="6" ViewCount="13116" Body="&lt;p&gt;I have read about convergence in terms of MC simulation for derivative pricing, but I am not clear on what it exactly means.&#xA;Let us suppose I price an option 100,000 paths twice and both result in the same option price. Does that mean 100,000 paths has resulted in convergence?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, in determining the number of paths to use for pricing, is getting the same option price with 2 different runs a factor? (Assumption is I am not reseeding the Random Number. So the sequence of Random Numbers between the two runs is different).&lt;/p&gt;&#xA;" OwnerUserId="13648" LastActivityDate="2016-09-02T16:12:52.513" Title="What does &quot;convergence&quot; in Monte Carlo simulation mean?" Tags="&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;numerical-methods&gt;" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17205" PostTypeId="2" ParentId="17188" CreationDate="2015-04-01T20:37:56.703" Score="3" Body="&lt;p&gt;First, as far as I can tell, you are not taking into account dividends. &#xA;Second, If you simply take the forward price of the SPX @ $5.5\%$ which is what you are using, you get $1411 \cdot \text{exp}(0.055 \cdot 2.99) = 1663$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given a strike of $1300$, the call should have an intrinsic value of $1663-1300= 363$. You have a price of $272$. The price is less than the intrinsic value of the option, therefore no matter what methodology you use, $IV = 0$.&lt;/p&gt;&#xA;" OwnerUserId="15814" LastEditorUserId="13585" LastEditDate="2015-04-02T11:13:47.280" LastActivityDate="2015-04-02T11:13:47.280" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17206" PostTypeId="2" ParentId="17204" CreationDate="2015-04-01T21:48:39.207" Score="4" Body="&lt;p&gt;the output of an MC simulation depends on the random numbers used and if the distribution used is not too weird, after 10,000 runs you will get an answer that is distributed&#xA;$$&#xA;\mu + \frac{\sigma}{\sqrt{n}} Z,&#xA;$$&#xA;with $Z$ a standard normal. Here $n=10,000.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With $\mu$ the quantity you want and $\sigma$ the standard deviation. &#xA;So you won't get precisely the same answer as you will get different values of $Z$ but  if they are close together it is a good sign. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The usual approach is to estimate $\sigma$ as well as $\mu$ and then take your error magnitude to be $\sigma/\sqrt{n}.$&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-04-01T21:48:39.207" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17207" PostTypeId="1" CreationDate="2015-04-01T22:58:25.597" Score="0" ViewCount="653" Body="&lt;p&gt;We are a borrower with a construction loan that is pay floating. At the inception of the loan, we entered into a pay-fixed/receive-floating interest rate swap with a growing notional profile that aligned to the original forecast of construction draws. The total cost of the contract is capped at 100MM (i.e. I know the total notional will never grow to more than 100MM). Our loan requires us to stay within 90% and 100% notional hedging.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The project (managed by a third party) is now accelerating, requiring faster drawdowns than originally contemplated. It may accelerate further.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I think about how to enter into a second layer of swaps to deal with this adjusted drawdown profile, I've started to wonder what the &quot;optimal&quot; notional profile is for this second swap, given a distribution of possible notional amounts/timings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is my &quot;optimization model&quot; concerning the management of my interest rate swap &quot;portfolio&quot; in the context of uncertain notional amounts (i.e. the timing of the construction loan drawdowns)?&lt;/p&gt;&#xA;" OwnerUserId="2119" LastActivityDate="2015-04-01T22:58:25.597" Title="How to optimally hedge construction loans with interest rate swaps?" Tags="&lt;hedging&gt;&lt;interest-rate-swap&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17209" PostTypeId="1" AcceptedAnswerId="17333" CreationDate="2015-04-02T01:56:07.547" Score="-3" ViewCount="590" Body="&lt;p&gt;I have an option chain for a specific expiry date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then calculate dP/dK numerically for each pair of strikes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My hunch is that this calculation is not risk neutral in the strictest sense of the word (i.e. in relation to the risk free rate of return) because I am comparing options with forward price strikes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It does assume no arbitrage between options obviously.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This upshot is, can I say that the probability of ending up in the money is the 'actual' probability rather than 'just' a risk neutral probability? Or is there some implicit assumption which I am missing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="7682" LastActivityDate="2015-04-10T19:28:39.550" Title="Risk Neutrality Necessary for Dual Delta Calculation?" Tags="&lt;options&gt;&lt;risk-neutral&gt;" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="17211" PostTypeId="1" CreationDate="2015-04-02T05:42:20.440" Score="1" ViewCount="140" Body="&lt;p&gt;I am trying to replicate a Bubble Indicator described  &lt;a href=&quot;http://www.riskelia.com/blog/2014/08/the-predictable-high-yield-debt-meltdown%E2%80%A6/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The indicator is strictly based on calculating the regularity of price behavior to determine herding in multiple time frames. I tried the Hurst exponent on series returns but could not replicate the results. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Data for the second chart EU High Yield can be found &lt;a href=&quot;https://research.stlouisfed.org/fred2/series/BAMLHE00EHYITRIV/downloaddata&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any potential ideas to replicate this?&lt;/p&gt;&#xA;" OwnerUserId="15818" LastEditorUserId="2553" LastEditDate="2015-04-02T11:14:11.093" LastActivityDate="2015-04-02T11:14:11.093" Title="Create Markets Bubble Indicator" Tags="&lt;statistics&gt;&lt;risk-management&gt;&lt;risk-models&gt;&lt;credit-risk&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17212" PostTypeId="1" CreationDate="2015-04-02T07:05:34.223" Score="12" ViewCount="822" Body="&lt;p&gt;Suppose given implied volatility quotations &lt;span class=&quot;math-container&quot;&gt;$\widehat{\sigma}(T_i,K_j)$&lt;/span&gt; of call options on an underlying &lt;span class=&quot;math-container&quot;&gt;$S$&lt;/span&gt; for various expiries &lt;span class=&quot;math-container&quot;&gt;$T_i$&lt;/span&gt;'s and strikes &lt;span class=&quot;math-container&quot;&gt;$K_j$&lt;/span&gt;'s. I am interested in the following problem : what is the &amp;quot;optimal&amp;quot; method to calculate numerically the familly of densities &lt;span class=&quot;math-container&quot;&gt;$(\varphi_{T})_T$&lt;/span&gt; where &lt;span class=&quot;math-container&quot;&gt;$\varphi_{T}$&lt;/span&gt; is the density of &lt;span class=&quot;math-container&quot;&gt;$S_T$&lt;/span&gt;, knowing that I will mainly be interested in computing numerically sums of the form &lt;span class=&quot;math-container&quot;&gt;$\int_{0}^{+\infty} f(x)\varphi_T(x)dx$&lt;/span&gt;, and that I will, for this calculation, have to restrict myself to compact intervals and calculate sums of the form &lt;span class=&quot;math-container&quot;&gt;$\int_{K_1}^{K_2} f(x)\varphi_T(x)dx$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I already have a tool calculating (by various interpolations), for each expiry &lt;span class=&quot;math-container&quot;&gt;$T_i$&lt;/span&gt; a function &lt;span class=&quot;math-container&quot;&gt;$K\mapsto\widehat{\sigma}(T_i ,K)$&lt;/span&gt; for all positive &lt;span class=&quot;math-container&quot;&gt;$K$&lt;/span&gt;. Assuming for now that I fix an expiry &lt;span class=&quot;math-container&quot;&gt;$T$&lt;/span&gt; equal to one of the &lt;span class=&quot;math-container&quot;&gt;$T_i$&lt;/span&gt;'s. I could do this : first write the market call price as a risk-neutral expectation (assuming for now constant spot rate) &lt;span class=&quot;math-container&quot;&gt;$$\textrm{Call}_0^{\textrm{Mkt.}} (T,K) = e^{-rT}\mathbf{E}^{\mathbf{P}}[(S_T-K)_{+}]$$&lt;/span&gt; and differentiate this twice with respect to &lt;span class=&quot;math-container&quot;&gt;$K$&lt;/span&gt; to get &lt;span class=&quot;math-container&quot;&gt;$$\frac{\partial^2}{\partial K^2}\textrm{Call}_0^{\textrm{Mkt.}} (T,K) = e^{-rT} \varphi_T (K).$$&lt;/span&gt; (This the Breeden-Litzenberger formula.) Now write the market call price in function of the implied volatility and the Black-Scholes call price as &lt;span class=&quot;math-container&quot;&gt;$$\textrm{Call}^{\textrm{Mkt.}} (T,K) = \textrm{BS}^{\textrm{Mkt.}} (T,K,\widehat{\sigma}(T_i ,K))$$&lt;/span&gt; and differentiate twice: you will obtain an expression that is combination of Black-Scholes greeks evaluated at first and second derivatives (with respect to &lt;span class=&quot;math-container&quot;&gt;$K$&lt;/span&gt;) of &lt;span class=&quot;math-container&quot;&gt;$K\mapsto\widehat{\sigma}(T_i ,K)$&lt;/span&gt;. We could use this to calculate &lt;span class=&quot;math-container&quot;&gt;$\varphi_T (K)$&lt;/span&gt; for various &lt;span class=&quot;math-container&quot;&gt;$K'$&lt;/span&gt;, and then use these values to numerically calculate &lt;span class=&quot;math-container&quot;&gt;$\int_{K_1}^{K_2} f(x)\varphi_T(x)dx$&lt;/span&gt;, after having &amp;quot;somehow&amp;quot; selected the correct bounds &lt;span class=&quot;math-container&quot;&gt;$K_1$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$K_2$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;This method does not really convince me, especially as it leaves &amp;quot;out&amp;quot; the problem of choosing &lt;span class=&quot;math-container&quot;&gt;$K_1$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$K_2$&lt;/span&gt;, which is highly 1) non-trivial and 2) speculative as it relies on interpolations and wings extrapolations used to get &lt;span class=&quot;math-container&quot;&gt;$K\mapsto\widehat{\sigma}(T_i ,K)$&lt;/span&gt;, and can lead to severe underestimation of &lt;span class=&quot;math-container&quot;&gt;$S_T$&lt;/span&gt;'s distribution's tail &lt;em&gt;etc&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I am really not sure that this method is even the one practicioners are using when they need to extract densities from implied volatilities (and to integrate functions against these densities.) I guess that parametric methods are more suited for this, which leads to my question : what kind of other methods are available (parametric or not) and which one is the &amp;quot;standard&amp;quot; one, that is, used by the practioners ?&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Precision&lt;/em&gt; : I am using this in the following context : I have for instance MXNUSD and CADUSD implied volatilities quotations for let's say same expiries, then I use interpolation to produce smile functions for each expiry and each currency pair, from which I extract two densities, and using a copula function, I get a density for cross-currency pair MXNCAD, that I use to price calls on MXNCAD and then to produce an MXNCAD implied volatility surface. (it's the classic problem consisting in getting prices of options on an illiquid currency pair knowing options markets of two related &amp;quot;marginal&amp;quot; liquid currency pairs.)&lt;/p&gt;&#xA;" OwnerUserId="13470" LastEditorUserId="13470" LastEditDate="2021-03-19T14:56:02.300" LastActivityDate="2021-03-19T14:56:02.300" Title="&quot;Extract&quot; the density of the underlying, given the implied volatility &quot;surface&quot;" Tags="&lt;implied-volatility&gt;&lt;density&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="17213" PostTypeId="1" AcceptedAnswerId="17227" CreationDate="2015-04-02T07:14:23.007" Score="1" ViewCount="279" Body="&lt;p&gt;This last quarter of college for senior project, I will be doing research on the application of jump-diffusion processes to pricing derivatives. I was wondering if anyone could recommend any resources that deals with this topic. Also any advice on going about understanding this topic at all would be greatly appreciated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also if you know maybe some other interesting topics/question for topics similar I would love to hear.&lt;/p&gt;&#xA;" OwnerUserId="11756" LastEditorUserId="7788" LastEditDate="2015-07-29T08:48:24.947" LastActivityDate="2015-07-29T08:48:24.947" Title="Jump-Diffusion Processes" Tags="&lt;stochastic-processes&gt;&lt;derivatives&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17214" PostTypeId="1" AcceptedAnswerId="17216" CreationDate="2015-04-02T08:44:50.980" Score="1" ViewCount="99" Body="&lt;p&gt;The ETF SHV has not moved much in the last five years. &lt;img src=&quot;https://i.stack.imgur.com/VIiud.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How is it that its volume is as high as 583609?&lt;/p&gt;&#xA;" OwnerUserId="15583" LastActivityDate="2015-04-02T09:26:51.143" Title="Why is the volume of a product like SHV so high?" Tags="&lt;etf&gt;&lt;volume&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17215" PostTypeId="1" CreationDate="2015-04-02T08:53:12.153" Score="3" ViewCount="854" Body="&lt;p&gt;I would be pleased if any of You can give me the real example of an &lt;em&gt;asian option&lt;/em&gt; (or other &lt;em&gt;exotic option&lt;/em&gt;) that is being traded or that is offered by some institution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been searching the whole internet, but only what I can find is how to price asian options, and I want to compare those methods with a real situation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best regards,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pablo&lt;/p&gt;&#xA;" OwnerUserId="15819" LastActivityDate="2018-12-19T16:10:24.647" Title="asian option – exotic option – real data, authentic examples?" Tags="&lt;options&gt;&lt;market-data&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17216" PostTypeId="2" ParentId="17214" CreationDate="2015-04-02T09:19:36.130" Score="3" Body="&lt;p&gt;Firstly, Volume doesn't equal movement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best thing is to look at what it represents.&#xA;SHV is the iShares Short Treasury Bond ETF.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means it tracks short-term treasury bonds.  Many forms of balanced portfolios require some portion of funds in bonds.  This ETV is an easy vehicle to get fractional exposure to bonds.  As far as &quot;has not moved much&quot; is concerned - this is because bond returns are minimal.  You should also consider dividends received into your calculations..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On a simulated total return basis, including dividends re-invested on the ex-date, it has moved from 101.7187577 (since inception on 11 Jan 2007) to 110.27 on 1 Apr 2015 (3002 days) representing a CAGR of 0.99%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source: ETF Data from &lt;a href=&quot;http://www.premiumdata.net/&quot; rel=&quot;nofollow&quot;&gt;http://www.premiumdata.net/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Disclosure:  I am a part-owner of Norgate/Premium Data.&lt;/p&gt;&#xA;" OwnerUserId="13859" LastEditorUserId="13859" LastEditDate="2015-04-02T09:26:51.143" LastActivityDate="2015-04-02T09:26:51.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17217" PostTypeId="2" ParentId="17215" CreationDate="2015-04-02T09:24:27.720" Score="0" Body="&lt;p&gt;I don't think you will find any data on that. Asian option are OTC traded, and embedded in contracts between 2 parties.&lt;/p&gt;&#xA;" OwnerUserId="13950" LastActivityDate="2015-04-02T09:24:27.720" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17218" PostTypeId="2" ParentId="17204" CreationDate="2015-04-02T10:59:31.147" Score="6" Body="&lt;p&gt;To keep things simple let's assume you have a perfect random number generator (i.e. I will discuss only the statistics not the numerics of the problem). I will also focus on the practical matter and gloss over some mathematical details. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a practical perspective &quot;convergence&quot; means that you will never get an exact answer from Monte-Carlo but increasingly good approximations. Try out your 100'000 paths example. The two values for the price of your option will be slightly different everytime you use a fresh, i.e. independent, sample.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Two mathematical theorems are relevant to describe convergence: First, the &lt;a href=&quot;http://en.wikipedia.org/wiki/Law_of_large_numbers&quot; rel=&quot;noreferrer&quot;&gt;law of large numbers,&lt;/a&gt; which says that the average of independent samples converges to the expected value (i.e. price) and the &lt;a href=&quot;http://en.wikipedia.org/wiki/Central_limit_theorem&quot; rel=&quot;noreferrer&quot;&gt;central limit theorem&lt;/a&gt;, which tells you that the distribution of the error converges to a properly scaled normal distribution. This justifies what Mark Joshi is alluding to in his post.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You mention a typical and very relevant question: What size samples do I need to achieve a certain prescribed accuracy? If you assume normal distribution of errors you can calculate a &lt;a href=&quot;http://en.wikipedia.org/wiki/Confidence_interval&quot; rel=&quot;noreferrer&quot;&gt;confidence interval&lt;/a&gt; and solve this expression for the sample size. You will often hear people say that Monte-Carlo &quot;converges very slowly&quot; or &quot;converges with $\sqrt{n}$&quot;. This is because to achieve a tenfold increase in accuracy you need a hundredfold increase in number of paths. For a serious study of this important topic I recommend the book by &lt;a href=&quot;http://www.amazon.de/Financial-Engineering-Stochastic-Modelling-Probability/dp/0387004513/ref=la_B001KHD64E_1_1?s=books&amp;amp;ie=UTF8&amp;amp;qid=1427972303&amp;amp;sr=1-1&quot; rel=&quot;noreferrer&quot;&gt;Paul Glasserman&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="482" LastActivityDate="2015-04-02T10:59:31.147" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17219" PostTypeId="2" ParentId="17035" CreationDate="2015-04-02T14:08:18.800" Score="7" Body="&lt;p&gt;The solution to my question can be found at the following webpage :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rankandfiled.com/#/data/tickers&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://rankandfiled.com/#/data/tickers&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For every stock you have on which stock exchange it is being traded, and the CIK (Central index key) which is exactly what I was searching for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I post it here since it will probably be very useful to many people.&lt;/p&gt;&#xA;" OwnerUserId="15676" LastEditorUserId="-1" LastEditDate="2019-01-09T09:28:46.423" LastActivityDate="2019-01-09T09:28:46.423" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="17221" PostTypeId="1" CreationDate="2015-04-02T16:42:12.080" Score="3" ViewCount="863" Body="&lt;p&gt;I am looking for a free source of historical daily data of the number of outstanding units of ETFs and ETNs.  On a Bloomberg, this would be &quot;VXX.SO Index HP&quot; or something like that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know of any?&lt;/p&gt;&#xA;" OwnerUserId="3491" LastActivityDate="2015-04-02T19:02:18.920" Title="Free source of historical ETF units outstanding data?" Tags="&lt;market-data&gt;&lt;historical-data&gt;&lt;etf&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17222" PostTypeId="2" ParentId="17221" CreationDate="2015-04-02T19:02:18.920" Score="2" Body="&lt;p&gt;Many funds, that manage ETFs provide this on their webpages. E.g. SDPR (SPY, XL* family) has is in &quot;NAV history&quot; xls file on &lt;a href=&quot;https://www.spdrs.com/product/fund.seam?ticker=SPY&quot; rel=&quot;nofollow&quot;&gt;https://www.spdrs.com/product/fund.seam?ticker=SPY&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2015-04-02T19:02:18.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17223" PostTypeId="2" ParentId="17064" CreationDate="2015-04-02T19:04:40.650" Score="0" Body="&lt;p&gt;Thanks for the responses. I'm still puzzling over this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an implementation which uses both Milstein discretization as well as antithetic variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code constructs the volatility skew for a T = 574 day call with initial forward price G0 = 570.856 and rate of interest r = 0.05327. The volatility skew is clearly crazy: it is concave with a positive skew whereas the Heston model should give a convex smile and a negative skew.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've set the number of increments to be n = 100 and NPaths = 100 just to demonstrate the code. Increasing to n = 1000 increments with NPaths = 10000 takes about an hour to execute and does not seem to improve the result.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;\[Rho] = -0.4042;&#xA;v0 = 0.2577^2;&#xA;\[Kappa] = 0.2656;&#xA;vbar = .1851;&#xA;\[Sigma]v = 0.2992;&#xA;n = 100;&#xA;NPaths = 100;&#xA;&#xA;HestonPaths[G0_, T_] :=&#xA; Module[{XPaths, X1, v1, X2, v2, dt, dw},&#xA;  dt = T/n;&#xA;  dw = RandomVariate[&#xA;    BinormalDistribution[{Sqrt[dt], Sqrt[dt]}, \[Rho]], {NPaths, n}];&#xA;  XPaths = {};&#xA;  Do[&#xA;   X1 = {Log[G0]};&#xA;   v1 = {v0};&#xA;   X2 = {Log[G0]};&#xA;   v2 = {v0};&#xA;   Do[&#xA;    v1 = Append[v1, &#xA;      Abs[\[Kappa] (vbar - Last[v1]) dt - &#xA;        1/4 \[Sigma]v^2 dt + (Sqrt[Last[v1]] + &#xA;          1/2 \[Sigma]v dw[[idx, i]][[1]])^2]];&#xA;    X1 = Append[X1, &#xA;      Last[X1] - 1/2 Last[v1] dt + Sqrt[Last[v1]] dw[[idx, i]][[2]]];&#xA;    v2 = Append[v2, &#xA;      Abs[\[Kappa] (vbar - Last[v2]) dt - &#xA;        1/4 \[Sigma]v^2 dt + (Sqrt[Last[v1]] - &#xA;          1/2 \[Sigma]v dw[[idx, i]][[1]])^2]];&#xA;    X2 = Append[X2, &#xA;      Last[X2] - 1/2 Last[v2] dt - Sqrt[Last[v2]] dw[[idx, i]][[2]]];&#xA;    , {i, 1, n}];&#xA;   XPaths = Append[XPaths, X1];&#xA;   XPaths = Append[XPaths, X2];&#xA;   , {idx, 1, NPaths}];&#xA;  Exp[XPaths]&#xA;  ]&#xA;&#xA;T = 574/365;&#xA;G0 = 570.856;&#xA;r = 0.05327;&#xA;&#xA;Paths = HestonPaths[G0, T];&#xA;&#xA;CallPrice[K_] :=&#xA; Block[{CF, \[CurlyPhi]VanillaCall, G},&#xA;  G = Table[Part[Paths, i, n], {i, 1, NPaths}];&#xA;  \[CurlyPhi]VanillaCall[S_] := Max[0, S - K];&#xA;  CF = Map[\[CurlyPhi]VanillaCall, G];&#xA;  Exp[-r T] Mean[CF]&#xA;  ]&#xA;&#xA;BCallIV[G_, K_, r_, T_, value_] :=  &#xA;  FinancialDerivative[{&quot;European&quot;, &quot;Call&quot;}, {&quot;StrikePrice&quot; -&amp;gt; K, &#xA;    &quot;Expiration&quot; -&amp;gt; T, &quot;Value&quot; -&amp;gt; value}, {&quot;InterestRate&quot; -&amp;gt; r, &#xA;    &quot;CurrentPrice&quot; -&amp;gt; G, &quot;Dividend&quot; -&amp;gt; r}, &quot;ImpliedVolatility&quot;&#xA;   ];&#xA;&#xA;&#xA;ListPlot[Table[{k, BCallIV[G0, k, r, T, CallPrice[k]]}, {k, 300, 700, &#xA;   10}]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="15782" LastActivityDate="2015-04-02T19:04:40.650" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17224" PostTypeId="1" CreationDate="2015-04-02T19:56:57.680" Score="1" ViewCount="105" Body="&lt;p&gt;My particular options positions are typically a long delta, and long vega. Decreases in implied volatility, or specifically the VIX, can drastically alter the profitability of my position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to hedge this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My possibilities seem to be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An additional calendar spread on the two front most series of the asset that I want to have my core long delta and long vega position in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Being short the VIX in some capacity such as puts on VXX ETF, shorting VXX ETF, long inverse VIX ETF (SVXY), long equity+options position on inverse VIX ETF&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem is that even on VIX ETFs, and on the VIX itself, ALL associated options contracts are effected strangely by decreasing volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can also sell VIX futures.&#xA;The next tricky part for me is balancing the portfolio based on differing margin requirements amongst asset classes. So is there any research paper or article or 'common knowledge' about how to construct this kind of hedge? I could only so far find things about going long volatility.&lt;/p&gt;&#xA;" OwnerUserId="1453" LastActivityDate="2015-04-02T19:56:57.680" Title="Hedge volatility decreases" Tags="&lt;options&gt;&lt;volatility&gt;&lt;implied-volatility&gt;&lt;hedging&gt;&lt;vega&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17226" PostTypeId="1" AcceptedAnswerId="17240" CreationDate="2015-04-03T00:57:04.317" Score="7" ViewCount="4054" Body="&lt;p&gt;Learning about change of numeraire, and came across this statement:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The price of any asset divided by a reference asset (called numeraire) is a martingale (no drift) under the measure associated with that numeraire.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This sounds intuitive, especially when we consider the reference asset as bank account then this would result the risk neutral measure.  However, more rigorously, how to prove this, or which theorem (Fundamental theorem of Asset Pricing?) implies this ?&lt;/p&gt;&#xA;" OwnerUserId="15235" LastEditorUserId="20454" LastEditDate="2020-06-11T10:39:58.820" LastActivityDate="2020-06-11T10:39:58.820" Title="Change of numeraire and reference asset" Tags="&lt;numerairechange&gt;&lt;numeraire&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17227" PostTypeId="2" ParentId="17213" CreationDate="2015-04-03T04:53:14.613" Score="2" Body="&lt;p&gt;I am not absolutely sure what you mean by diffusion-jump but if you mean jump-diffusion. Here are some references:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Chapter 15, Concepts and Practice of Mathematical Finance, Joshi&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cont and Tankov, Financial Modelling with Jump Processes &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using Monte Carlo Simulation and Importance Sampling to Rapidly Obtain Jump-Diffusion Prices of Continuous Barrier Options, Mark S. Joshi, Terence Leung &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-04-03T04:53:14.613" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17229" PostTypeId="2" ParentId="3607" CreationDate="2015-04-03T12:25:59.690" Score="2" Body="&lt;p&gt;The only correct way is using log returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To keep everything consistent, take a arithmetic mean of log returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then calculate it net of the risk free (how do you subtract properly using geometric returns?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then divide (how do you do this properly using geometric returns?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;by the standard deviation (how would you calculate this properly with geometric returns?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A geometric mean is just the tip of the iceberg. Geometric returns implies a bunch of new calculations which are far from standard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Log returns are the only way to go with time series analysis.&lt;/p&gt;&#xA;" OwnerUserId="7682" LastActivityDate="2015-04-03T12:25:59.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17232" PostTypeId="1" CreationDate="2015-04-03T16:01:41.753" Score="1" ViewCount="157" Body="&lt;p&gt;I am qualified in Mathematics and Physics but would like to have a career in Finance. I will be starting an M.Sc. In Financial Mathematics next October but am already reading about certain topics to prepare for a particular job interview with a national financial regulator that might consider me if I am lucky enough. I will need to show an understanding in Solvency II (the EU directive) for Insurance companies. The &quot;Standard Formula&quot; and &quot;Stress Testing&quot; were mentioned specifically. Reading about them, I encountered the following: &lt;a href=&quot;https://hal.archives-ouvertes.fr/hal-00403662v2/document&quot; rel=&quot;nofollow&quot;&gt;https://hal.archives-ouvertes.fr/hal-00403662v2/document&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It contains the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Denote&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(F_t)_{t\geq0}$ - the filtration that permits to characterise the available information for each date;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\delta_u$ - the discount factor that is expressed with the instantaneous risk free interest rate $r_u=\delta_u=e^{-\int_0^ur_h\,dh}$;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P_t$-the cash-flows of the liabilities (claims, commissions, expenses) for the period t;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$R_t$ - the profit of the company for period t.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equity $E_0$ and the fair value of the liabilities at the start date, $L_0$, are calculated in the following manner:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;L_0=E_Q\left[\sum_{u\geq1}\delta_u\cdot P_t\vert F_0\right]&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;E_0=E_Q\left[\sum_{u\geq1}\delta_u\cdot R_t\vert F_0\right]&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need some guidance, perhaps a book or website to better understand these terms which are new to me. Any help would be greatly appreciated - even some real-life experiences to prepare me for what I should expect. Is there software that calculates these? Thanks a lot.&lt;/p&gt;&#xA;" OwnerUserId="15833" LastActivityDate="2015-06-13T12:36:09.037" Title="Standard Formula for Solvency II" Tags="&lt;insurance&gt;&lt;stress-testing&gt;&lt;solvency-ii&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17233" PostTypeId="2" ParentId="17035" CreationDate="2015-04-03T16:24:44.580" Score="0" Body="&lt;p&gt;The site adrCoder cited is a great source of this consolidated &quot;relationship&quot; information.  Alternatively, SEC Form 4 (Statement in Changes of Beneficial Ownership) has the issuer name, the CIK and ticker symbol, all in one document.  To avail yourself of this, you must use doc4.xml, not doc4.html.  The HTML file lacks information present in the XML file (like the CIK).  Other SEC forms may also have this information.  I think it's important to always look at the XML file and not the HTML file, as the XML file appears to be contain more information.&lt;/p&gt;&#xA;" OwnerUserId="15063" LastActivityDate="2015-04-03T16:24:44.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17236" PostTypeId="1" AcceptedAnswerId="17283" CreationDate="2015-04-04T01:25:29.817" Score="0" ViewCount="1096" Body="&lt;p&gt;If the arithmetic mean is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \frac { \Sigma (x_i) }{n}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the geometric mean is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ (\prod (1+x_i) ) ^{1/n}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The arithmetic variance is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \frac { \Sigma(x_i-\mu)^2 } {n} $ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;then what is the geometric variance?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[I actually have an answer, while it gets a decent result I have to think about a way to check it, and it looks funny]&lt;/p&gt;&#xA;" OwnerUserId="7682" LastActivityDate="2015-04-10T20:15:57.430" Title="Geometric Variance" Tags="&lt;returns&gt;&lt;variance&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17237" PostTypeId="2" ParentId="17153" CreationDate="2015-04-04T12:23:35.710" Score="1" Body="&lt;p&gt;I think one way about it is maybe like below...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider value of a call option on the forward at time $t$ and forward price $F$, and the value of a put at time $t$ and forward price $(K^2/F)$. Assume they have the same strike price $K$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then at time $T_1$ ( option expiry ), we have&#xA;$$&#xA;C( F,T_1 ) = ( F - K )^+ \\&#xA;P( \frac{K^2}{F}, T_1 ) = (K-\frac{K^2}{F})^+&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dividing C by P,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{C( F,T_1 )}{P( \frac{K^2}{F}, T_1 ) }=\frac{ ( F - K )^+}{(K-\frac{K^2}{F})^+}=\frac{ (F - K )^+}{K(\frac{F-K}{F})}=\frac{F}{K}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The condition should hold for all previous times $t&amp;lt;T_1$. Therefore,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;C( F,t)=\frac{F}{K}P( \frac{K^2}{F}, t )&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="15771" LastActivityDate="2015-04-04T12:23:35.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17239" PostTypeId="1" CreationDate="2015-04-04T17:45:04.497" Score="6" ViewCount="395" Body="&lt;p&gt;Assume the observed call option prices $C(K_i,T_i)$ for $i = 1,\dots,N$ are disturbed by some unknown measurement noise $\epsilon$. What would an appropriate covariance structure be for $\epsilon$? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In literature I often see authors making the simplified assumption that $\epsilon_i$ are independent and identically distributed Gaussian with some scaling variance that could depend on for example the bid-ask spread. This seems very unreasonable since if one considers two options $C(K,T)$ and $C(K + \delta,T)$ then in the limit $\delta \to 0$ they should be perfectly correlated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone read any literature that discusses these types of modelling choices in more detail?&lt;/p&gt;&#xA;" OwnerUserId="15582" LastActivityDate="2015-10-01T23:13:35.233" Title="Covariance structure of call option surface" Tags="&lt;options&gt;&lt;statistics&gt;&lt;modeling&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17240" PostTypeId="2" ParentId="17226" CreationDate="2015-04-04T18:15:06.043" Score="6" Body="&lt;p&gt;Proving the existence of a risk neutral measure is the difficult part. Once its existence is established, a simple calculation of conditional expectations allows to go from a numeraire to any other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Write $\beta$ for the cash numeraire and $Q_\beta$ the corresponding risk neutral measure. Let $N$ be a numeraire (so $N$ is a positive process and  $N/\beta$ is $Q_\beta$ martingale). Define a new measure by &#xA;$$&#xA;  \frac{dQ_N}{dQ_\beta}|_{\mathcal{F}_T} = \frac{N_T/\beta_T}{N_0/\beta_0} &#xA;$$&#xA;Then, for any $P$ s.t. $P/\beta$ is a $Q_\beta$ martingale&lt;br&gt;&#xA;\begin{eqnarray}&#xA;  \mathbb{E}^{Q_N}[ \frac{P_T}{N_T} | {\mathcal{F}_t} ] &amp;amp;=&amp;amp;   \frac{\mathbb{E}^{Q_\beta}[ \frac{P_T}{N_T} \frac{N_T/\beta_T}{N_0/\beta_0}  | {\mathcal{F}_t} ]}{\mathbb{E}^{Q_\beta}[ \frac{N_T/\beta_T}{N_0/\beta_0} | {\mathcal{F}_t} ]} &#xA;=  \frac{\mathbb{E}^{Q_\beta}[ \frac{P_T}{\beta_T} | {\mathcal{F}_t} ]}{\mathbb{E}^{Q_\beta}[ \frac{N_T}{\beta_T} | {\mathcal{F}_t} ]} =  \frac{\frac{P_t}{\beta_t} }{\frac{N_t}{\beta_t} } = \frac{P_t}{N_t} &#xA;\end{eqnarray}&#xA;So $P/N$ is a $Q_N$ martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you assume that you have a Brownian market:&lt;br&gt;&#xA;$$&#xA;  \frac{dN_t}{N_t} = r_t dt + \sigma^N_t dW_t^\beta&#xA;$$&#xA;$$&#xA;  \frac{dP_t}{P_t} = r_t dt + \sigma^P_t dW_t^\beta &#xA;$$&#xA;$$&#xA;  \frac{dQ_N}{dQ_\beta}|_{\mathcal{F}_T} = \frac{N_T/\beta_T}{N_0/\beta_0} = \exp\left(\int_0^T \sigma^N_t dW^\beta_t - \frac{1}{2} \int_0^T |\sigma^N_t|^2 dt \right)&#xA;$$&#xA;By Girsanov, under $Q_N$, &#xA;$$&#xA;  dW^N_t = dW^\beta_t - \sigma^N_t dt &#xA;$$&#xA;is a Brownian motion and using Ito's lemma you can check that &#xA;$$&#xA;  \frac{d(P_t/N_t)}{P_t/N_t} = (\sigma^P_t - \sigma^N_t)dW^N_t&#xA;$$&#xA;which also shows that it is a Brownian martingale under $Q_N$.&lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2015-04-04T19:33:57.947" LastActivityDate="2015-04-04T19:33:57.947" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17241" PostTypeId="2" ParentId="17239" CreationDate="2015-04-04T20:35:31.693" Score="2" Body="&lt;p&gt;You need to see the deals on these options and/or have deep knowledge of how these prices are marked to be able to have a better model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First thing first, I believe that the prices that you see are usually either &quot;marked&quot; (set) by one or several treaders, or they are the prices on last transaction before the close of the market/first transaction of the day etc. (and if there was no transaction during the day, either some interpolation or the price observed the day/week before etc.) In the former case, the person(s) who mark the prices may introduce subjective bias. In the latter case, if the trades did not happen at the same moment, you will have asynchronisity bias. There is also some error introduced by rounding of the prices. All these errors ideally should be modeled in a different way, but I guess it is pretty hard to get data/information to do so, thus independent Gaussian variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some strikes are more liquid than the others, and the error on those should be smaller. I guess this one is easier to model.&lt;/p&gt;&#xA;" OwnerUserId="8051" LastActivityDate="2015-04-04T20:35:31.693" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17242" PostTypeId="1" CreationDate="2015-04-04T23:48:21.063" Score="0" ViewCount="199" Body="&lt;p&gt;I am editing this question because it was originally unclear, and I didn't get the answers I was hoping for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my finance book I have the following question&lt;/p&gt;&#xA;&#xA;&lt;p&gt;T-bills currently yield 5.5 percent. Stock in Maria's Manufacturing is currently selling for $70 per share.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no possibility that the stock will be worth less than $65/share in one year.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the value of a call option with a $60 exercise price? The answer book is: C0=70–[60/1.055] = 13.13. I don't understand how the option price was found like this. We don't know the volatility for the stock, so how is it possible to calculate the option price. Does it have something to do with the fact that the option will definitely be exercised?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot for your help.&lt;/p&gt;&#xA;" OwnerUserId="15840" LastEditorUserId="15847" LastEditDate="2015-04-06T18:40:08.647" LastActivityDate="2015-05-18T01:50:24.257" Title="Pricing a call when minimum stock price above strike with certainty" Tags="&lt;options&gt;&lt;valuation&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17243" PostTypeId="1" CreationDate="2015-04-04T23:55:43.560" Score="3" ViewCount="457" Body="&lt;p&gt;I am looking to find the list of math/statistics papers of Nassim Taleb. However the google scholar page only seems to show popular articles. I know that he's famous for his theory of randomness and antifragility and so on. I'm looking for a mathematically rigorous discussion of his ideas. Where can I can get his core academic papers. Or has he even done such work??&lt;/p&gt;&#xA;" OwnerUserId="15465" LastActivityDate="2019-12-01T00:51:56.313" Title="Works of Nassim Taleb" Tags="&lt;risk-management&gt;&lt;soft-question&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17244" PostTypeId="2" ParentId="17243" CreationDate="2015-04-05T01:17:05.950" Score="4" Body="&lt;p&gt;Go check out &lt;a href=&quot;http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=475810&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=475810&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For social science literature, ssrn is almost always the best source.&lt;/p&gt;&#xA;" OwnerUserId="6804" LastActivityDate="2015-04-05T01:17:05.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17245" PostTypeId="1" CreationDate="2015-04-05T03:22:24.130" Score="12" ViewCount="658" Body="&lt;p&gt;I have received a reviewer's comment on a paper which applies PCA to reduce the size of a problem and the application is in the robust optimization field. The reviewer implies that &quot;In robust optimization, approximating the problem using PCA could be fatal because PCA creates uncontrollable distortions.&quot;. However no reference has been mentioned to address this point and my search for an answer didn't result in any reason for this comment. Would anyone please help me with a reason for this comment or introduce a book or paper that addresses this issue. &#xA;Your help is greatly appreciated! &lt;/p&gt;&#xA;" OwnerUserId="15841" LastActivityDate="2016-02-01T22:51:58.753" Title="The danger of using Principal Component Analysis (PCA) in Robust Optimization problems" Tags="&lt;optimization&gt;&lt;pca&gt;&lt;robust-optimization&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17246" PostTypeId="1" AcceptedAnswerId="17252" CreationDate="2015-04-05T03:34:24.663" Score="3" ViewCount="7833" Body="&lt;p&gt;Hamada's formula is presented as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\beta_{U}=\left[\frac{1}{1+\frac{D}{E}(1-\tau)}\right]\beta_{L},$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\beta_{U}$ and $\beta_{L}$ are the unlevered and levered betas of a firm respectively. $D$ is the market value of debt. $E$ is the market value of equity and $\tau$ is the tax rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;May anyone please provide a proof for this formula? I have found some sources on the internet, though they are not convincing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks to all in advanced.&lt;/p&gt;&#xA;" OwnerUserId="13726" LastEditorUserId="13726" LastEditDate="2017-04-16T02:49:01.827" LastActivityDate="2019-11-04T21:55:15.590" Title="Proof of Hamada's Formula (Relationship between levered and unlevered beta)" Tags="&lt;beta&gt;&lt;fundamentals&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17248" PostTypeId="1" CreationDate="2015-04-05T09:41:46.717" Score="0" ViewCount="251" Body="&lt;p&gt;I am taking Exam FM in a week and I was wondering if I could get any advice from people who have recently passed this exam.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How much of the derivatives markets question did show up?  I am using the online sample exam from SOA candidate support, would that be a pretty accurate source?&lt;/p&gt;&#xA;" OwnerUserId="15287" LastActivityDate="2015-04-05T09:41:46.717" Title="Seeking Advice for Exam FM regarding Derivatives Markets" Tags="&lt;finance&gt;" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="17249" PostTypeId="1" CreationDate="2015-04-05T09:51:44.487" Score="3" ViewCount="5210" Body="&lt;p&gt;I have been trying to calculate the PPP-adjusted EURUSD exchange rate. I am not sure if it is the same as relative PPP, for which I have used this formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Spot rate at time t = Current spot rate * ((1+inflation of country A)/(1+inflation of country B))^t&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With this formula though, my values for PPP don't at all look like Hussman's.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.hussmanfunds.com/images/euro.jpg&quot; rel=&quot;nofollow&quot;&gt;Euro PPP exchange rate&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15772" LastActivityDate="2015-07-09T14:01:32.537" Title="How do I calculate the PPP adjusted exchange rate between two countries?" Tags="&lt;currency&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17250" PostTypeId="2" ParentId="17242" CreationDate="2015-04-05T11:17:27.193" Score="1" Body="&lt;p&gt;The intrinsic value is $70 - $60.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, we don't know exactly what the stock price will end up in a one-year time. But we know that it it is the best estimate for the future price in one-year.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Profit in one-year = ($70 * 1/D - $60) where D is the discount factor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This profit needs to be discounted: $70 - $60 * D.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should be able to relate the discount factor to your example yourself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I don't think Black-Scholes is an appropriate model for this case. The stock is not a GBM.&lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="601" LastEditDate="2015-05-18T01:50:24.257" LastActivityDate="2015-05-18T01:50:24.257" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17252" PostTypeId="2" ParentId="17246" CreationDate="2015-04-05T12:46:13.617" Score="9" Body="&lt;p&gt;Proof:&#xA;Recall that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\beta_{i} = \frac{\mathrm{Cov}(r_{i},r_{m})}{\mathrm{Var}(r_{m})}.$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, the returns on unlevered and levered equity are given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$r_{U} = \frac{\mathrm{EBIT}(1-\tau) - \mathrm{CAPEX} + \mathrm{Depreciation}}{E_{U}}$$&lt;/span&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$$r_{L} = \frac{\mathrm{EBIT}(1-\tau) - \mathrm{CAPEX} + \mathrm{Depreciation} + \mathrm{Net\ Debt} - \mathrm{Interest}}{E_{L}},$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;respectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\beta_{U} = \frac{\mathrm{Cov}\left(\frac{\mathrm{EBIT}(1-\tau) - \mathrm{CAPEX} + \mathrm{Depreciation}}{E_{U}},r_{m}\right)}{\mathrm{Var}(r_{m})}$$&lt;/span&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\beta_{L} = \frac{\mathrm{Cov}\left(\frac{\mathrm{EBIT}(1-\tau) - \mathrm{CAPEX} + \mathrm{Depreciation + \mathrm{Net\ Debt} - \mathrm{Interest}}}{E_{L}},r_{m}\right)}{\mathrm{Var}(r_{m})}.$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Working with the &lt;span class=&quot;math-container&quot;&gt;$\beta_{U}$&lt;/span&gt; equation,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;						\begin{align}&#xA;							\beta_{U} &amp;amp;= \frac{\mathrm{Cov}\left(\frac{\mathrm{EBIT}(1-\tau) - \mathrm{CAPEX} + \mathrm{Depreciation}}{E_{U}},r_{m}\right)}{\mathrm{Var}(r_{m})} \\&#xA;							&amp;amp;= \frac{\mathrm{Cov}\left(\frac{\mathrm{EBIT}(1-\tau)}{E_{U}} - \frac{\mathrm{CAPEX}}{E_{U}} + \frac{\mathrm{Depreciation}}{E_{U}},r_{m}\right)}{\mathrm{Var}(r_{m})} \\&#xA;							&amp;amp;= \frac{\mathrm{Cov}\left(\frac{\mathrm{EBIT}(1-\tau)}{E_{U}}, r_{m}\right) + \mathrm{Cov}\left(\frac{-\mathrm{CAPEX}}{E_{U}}, r_{m}\right) + \mathrm{Cov}\left(\frac{\mathrm{Depreciation}}{E_{U}},r_{m}\right)}{\mathrm{Var}(r_{m})} \\&#xA;							&amp;amp;= \frac{\mathrm{Cov}\left(\frac{\mathrm{EBIT}(1-\tau)}{E_{U}}, r_{m}\right)}{\mathrm{Var}(r_{m})} + \frac{\mathrm{Cov}\left(\frac{-\mathrm{CAPEX}}{E_{U}}, r_{m}\right)}{\mathrm{Var}(r_{m})} + \frac{\mathrm{Cov}\left(\frac{\mathrm{Depreciation}}{E_{U}},r_{m}\right)}{\mathrm{Var}(r_{m})}.\\&#xA;						\end{align}&#xA;						$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since &lt;span class=&quot;math-container&quot;&gt;$E_{U}$&lt;/span&gt; is the value of unlevered equity from the last financial year, it is constant. Hence,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;\begin{align}&#xA;							\beta_{U} &amp;amp;= \frac{\mathrm{Cov}\left(\frac{\mathrm{EBIT}(1-\tau)}{E_{U}}, r_{m}\right)}{\mathrm{Var}(r_{m})} + \frac{\mathrm{Cov}\left(\frac{-\mathrm{CAPEX}}{E_{U}}, r_{m}\right)}{\mathrm{Var}(r_{m})} + \frac{\mathrm{Cov}\left(\frac{\mathrm{Depreciation}}{E_{U}},r_{m}\right)}{\mathrm{Var}(r_{m})} \\&#xA;							&amp;amp;= \frac{1}{E_{U}} \left[ \frac{\mathrm{Cov}\left(\mathrm{EBIT}(1-\tau), r_{m}\right)}{\mathrm{Var}(r_{m})} - \frac{\mathrm{Cov}\left(\mathrm{CAPEX}, r_{m}\right)}{\mathrm{Var}(r_{m})} + \frac{\mathrm{Cov}\left(\mathrm{Depreciation}, r_{m}\right)}{{\mathrm{Var}(r_{m})}} \right] \\	&#xA;							&amp;amp;= \frac{1}{E_{U}} \left[\beta_{\mathrm{EBIT}(1-\tau)} - \beta_{\mathrm{CAPEX}} + \beta_{\mathrm{Depreciation}}\right].&#xA;						\end{align}&#xA;						$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We next assume that that the correlation between the market, CAPEX, depreciation, net debt and interest is &lt;span class=&quot;math-container&quot;&gt;$0$&lt;/span&gt;. That is, we assume that &lt;span class=&quot;math-container&quot;&gt;$\beta_{\mathrm{CAPEX}} = \beta_{\mathrm{Depreciation}} = \beta_{\mathrm{Net\ Borrowing}} = \beta_{\mathrm{Interest}} = 0.$&lt;/span&gt; Thus the equation for unlevered, and by similar computation, levered beta are given by the following formulas:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;						\begin{align}&#xA;							\beta_{U} &amp;amp;= \frac{1}{E_{U}} \left[\beta_{\mathrm{EBIT}(1-\tau)}\right] \implies E_{U}\beta_{U} = \left[\beta_{\mathrm{EBIT}(1-\tau)}\right] \\&#xA;							\beta_{L} &amp;amp;= \frac{1}{E_{L}} \left[\beta_{\mathrm{EBIT}(1-\tau)}\right] \implies E_{L}\beta_{L} = \left[\beta_{\mathrm{EBIT}(1-\tau)}\right] \\&#xA;						\end{align}&#xA;						$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equating the equations yields&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;						\begin{align}&#xA;							E_{U}\beta_{U} &amp;amp;= E_{L}\beta_{L} \\&#xA;							\implies \beta_{U} &amp;amp;= \frac{E_{L}}{E_{U}} \beta_{L}.\\&#xA;						\end{align}&#xA;						$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, for an unlevered firm it is known that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;						A_{U} = L_{U} + E_{U} \implies E_{U} = A_{U} - L_{U}.&#xA;						$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say that the assets and liabilities of this firm are fixed with the exception of new debt capital issued. That is, the firm is levered and therefore,&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;						\begin{align}&#xA;						E_{L} &amp;amp;= \left(A_{U} + \mathrm{Tax\ Shield}\right) - \left(L_{U} + D\right) \\&#xA;						&amp;amp;= \left(A_{U} - L_{U}\right) - D + \mathrm{Tax\ Shield} \\&#xA;						\implies E_{L} &amp;amp;= E_{U} - D + \mathrm{Tax\ Shield}.\\&#xA;						\end{align}&#xA;						$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus we are left to calculate the tax shield. Assume that the pre tax cost of debt is &lt;span class=&quot;math-container&quot;&gt;$k_{d}$&lt;/span&gt;. Therefore,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;						\begin{align}&#xA;						\mathrm{Tax\ Shield} &amp;amp;= \sum_{i = 1}^{\infty} \frac{k_{d}D\tau}{(1+k_{d})^{i}} \\&#xA;						&amp;amp;= k_{d}D\tau \sum_{i=1}^{\infty} \frac{1}{(1+k_{d})^{i}} \\&#xA;						&amp;amp;= k_{d}D\tau \cdot \frac{1}{k_{d}} \\&#xA;						\implies \mathrm{Tax\ Shield} &amp;amp;= D\tau.\\&#xA;						\end{align}&#xA;						$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;						\begin{align}&#xA;						E_{L} &amp;amp;= E_{U} - D + D\tau \\&#xA;						\implies E_{L} &amp;amp;= E_{U} - D(1-\tau) \\&#xA;						\implies E_{U} &amp;amp;= E_{L} + D(1-\tau).\\&#xA;						\end{align}&#xA;						$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recalling that &lt;span class=&quot;math-container&quot;&gt;$\beta_{U} = \frac{E_{L}}{E_{U}} \beta_{L}$&lt;/span&gt; and substituting our newly created equation for &lt;span class=&quot;math-container&quot;&gt;$E_{U}$&lt;/span&gt; yields&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;						\begin{align}&#xA;						\beta_{U} &amp;amp;= \frac{E_{L}}{E_{U}} \beta_{L} \\&#xA;						&amp;amp;= \frac{E_{L}}{E_{L} + D(1-\tau)}\beta_{L} \\&#xA;						\implies \beta_{U} &amp;amp;= \left[\frac{1}{1 + \frac{D}{E}(1-\tau)}\right]\beta_{L}, \\						&#xA;						\end{align}&#xA;						$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;as required. Thanks. &lt;/p&gt;&#xA;" OwnerUserId="13726" LastEditorUserId="-1" LastEditDate="2019-11-04T21:55:15.590" LastActivityDate="2019-11-04T21:55:15.590" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="17253" PostTypeId="1" CreationDate="2015-04-05T12:51:38.450" Score="1" ViewCount="677" Body="&lt;p&gt;Very new to fixed income signals. I am a little confused about which data to use to compare interest rate among different currencies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I am interested in compare interest rate in the following currencies (countries): USD, EUR, GBP, JPY,CHF,CAD, DKK,NZD,AUD,SEK and NOK. Before 2013, We can get LIBOR for almost all of them (except NOK I believe), but now only first 5 currencies have LIBOR rates updated and I have no idea where to get the interest rate for some currencies such as AUD, NZD. some currencies have their own interbank rate, such as STIBOR for SEK and CIBOR for DKK, are they the right interest rate to use? Also there are more than one IBOR available for some currencies, for example EUR have both LIBOR and EURIBOR, which one should I choose?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What about swap rates? since swap are closely rated to the interbank rate, would swap rate be a better data to use to measure monetary policy of each country? if so, what kind a swap data should I use? Thank you very much! &lt;/p&gt;&#xA;" OwnerUserId="6396" LastEditorUserId="6396" LastEditDate="2015-04-05T19:02:33.917" LastActivityDate="2016-01-06T06:30:29.200" Title="what data to use to compare the interest rate among different currencies?" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;fx&gt;&lt;currency&gt;&lt;interest-rate-swap&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17254" PostTypeId="1" AcceptedAnswerId="17256" CreationDate="2015-04-05T14:41:55.467" Score="1" ViewCount="1152" Body="&lt;p&gt;I need some help understanding the results of Johansen Cointegration test run on MATLAB. I am quite new to econometrics and do not fully comprehend what MATLAB has come up with. I would be really in debt if someone could explain the following in layman terms. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The test was run on two series. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Data: Y&#xA;Effective sample size: 1871&#xA;Model: H1&#xA;Lags: 0&#xA;Statistic: trace&#xA;Significance level: 0.05&#xA;&#xA;&#xA;r  h  stat      cValue   pValue   eigVal   &#xA;========================================&#xA;0  0  11.0750   15.4948  0.2115   0.0037  &#xA;1  1  4.2114    3.8415   0.0402   0.0022  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;h = &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;      r0       r1   &#xA;t1    false    true &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;pValue = &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;      r0         r1      &#xA;t1    0.21149    0.040163&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="15843" LastActivityDate="2015-04-20T10:28:23.467" Title="matlab interpretation of johansen cointegration test" Tags="&lt;cointegration&gt;&lt;matlab&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17255" PostTypeId="1" AcceptedAnswerId="17316" CreationDate="2015-04-05T16:36:52.053" Score="1" ViewCount="338" Body="&lt;p&gt;I am new to BSYM and would like to do an entity-level search (&lt;a href=&quot;http://bsym.bloomberg.com/sym/pages/bbgid-allocation-rules.pdf&quot; rel=&quot;nofollow&quot;&gt;as described here (towards bottom of document)&lt;/a&gt;. For instance, &lt;a href=&quot;http://bsym.bloomberg.com/sym/&quot; rel=&quot;nofollow&quot;&gt;a search for &quot;APPLE INC&quot;&lt;/a&gt; brings up 266 pages. Which one is for the entity?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've also tried searching for BBGID &quot;BBG001FDZ799&quot; (the example given for Altria Group) but nothing comes up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;br&gt;&#xA;To clarify: The entity would be the issuer of the equity, debt, preferred, etc. (For cusips, the entity is the first 6 characters of the cusip identifier...just looking for something similar for BSYM).&lt;/p&gt;&#xA;" OwnerUserId="4695" LastEditorUserId="4695" LastEditDate="2015-04-06T19:40:06.800" LastActivityDate="2015-04-13T13:40:11.737" Title="How do I find the entity identifier using BSYM?" Tags="&lt;data&gt;&lt;market-data&gt;&lt;bloomberg&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17256" PostTypeId="2" ParentId="17254" CreationDate="2015-04-05T20:05:09.653" Score="1" Body="&lt;p&gt;The test fails to reject the null hypothesis of no cointegration since the p-value for &lt;code&gt;r0&lt;/code&gt; is greater than 0.10, and, instead, it rejects the null hypothesis of 1° rank cointegration &lt;code&gt;r1&lt;/code&gt; at 5.0 % level of significance (since the p-value is 4.01 %).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, looking at the test results, the series are not cointegrated, although I suggest to check for higher ranks and level of cointegration (&lt;code&gt;r2&lt;/code&gt;, &lt;code&gt;r3&lt;/code&gt;,...).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find more references about the test on &lt;a href=&quot;http://it.mathworks.com/help/econ/identify-cointegration.html#bsxb_kf&quot; rel=&quot;nofollow noreferrer&quot;&gt;mathworks&lt;/a&gt; and on the quant.stackexchange &lt;a href=&quot;https://quant.stackexchange.com/questions/3526/how-to-interpret-results-of-johansen-test?rq=1&quot;&gt;site&lt;/a&gt; about the Johansen interpretation test in R.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-04-20T10:28:23.467" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17257" PostTypeId="2" ParentId="17153" CreationDate="2015-04-06T01:25:10.580" Score="3" Body="&lt;p&gt;Let $\{F(t, T), 0 \leq t \leq T\}$ be the forward process that satisfies an SDE of the form&#xA;\begin{align*}&#xA;dF(t, T) = \sigma F(t, T) dW_t,&#xA;\end{align*}&#xA;where $\sigma$ is the constant volatility, $\{W_t, t&amp;gt;0\}$ is a standard Brownian motion. The payoff at time $T_1$, where $0 &amp;lt; T_1 \leq T$, of a vanilla European forward option is of the form&#xA;\begin{align*}&#xA;\max(\psi (F(T_1, T)-K), \, 0),&#xA;\end{align*}&#xA;where $\psi = 1$, for a call option, and $-1$, for a put option. Note that, for any $0\leq t \leq T_1$,&#xA;\begin{align*}&#xA;F(T_1, T) = F(t, T) \exp\Big(-\frac{\sigma^2}{2} (T_1 -t) + \sigma \sqrt{T_1 -t} \xi \Big),&#xA;\end{align*}&#xA;where $\xi$ is a standard normal random variable. Then the value at time $t$ of the option payoff above is given by&#xA;\begin{align*}&#xA;d(t, T_1)\psi\Big[F(t, T) \Phi\big(\psi d_1(F)\big) -K \Phi\big(\psi d_2(F)\big) \Big],&#xA;\end{align*}&#xA;where $d(t, T_1)$ is the discount factor, &#xA;\begin{align*}&#xA;d_1 (F) = \frac{\ln \frac{F(t, T)}{K} + \frac{\sigma^2}{2} (T_1 -t)}{\sqrt{T_1-t}\,\sigma},&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;d_2 (F) = \frac{\ln \frac{F(t, T)}{K} - \frac{\sigma^2}{2} (T_1 -t)}{\sqrt{T_1-t}\,\sigma}.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;C(F, t) = d(t, T_1)\Big[F(t, T) \Phi\big(d_1(F)\big) -K \Phi\big(d_2(F)\big) \Big],&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;P(F, t) = d(t, T_1)\Big[K \Phi\big(-d_2(F)\big) -F(t, T) \Phi\big(-d_1(F)\big)\Big],&#xA;\end{align*}&#xA;Note that, by replacing $F$ in $d_1$ with $K^2/F(t, T)$,&#xA;\begin{align*}&#xA;d_1 \Big(\frac{K^2}{F}\Big) &amp;amp;= \frac{\ln \frac{K^2/F(t, T)}{K} +\frac{\sigma^2}{2} (T_1 -t)}{\sqrt{T_1-t}\,\sigma}\\&#xA;&amp;amp;= \frac{-\ln \frac{F(t, T)}{K} + \frac{\sigma^2}{2} (T_1 -t)}{\sqrt{T_1-t}\,\sigma}\\&#xA;&amp;amp;= -d_2(F).&#xA;\end{align*}&#xA;Similarly,&#xA;\begin{align*}&#xA;d_2 \Big(\frac{K^2}{F}\Big) &amp;amp;= \frac{\ln \frac{K^2/F(t, T)}{K} -\frac{\sigma^2}{2} (T_1 -t)}{\sqrt{T_1-t}\,\sigma}\\&#xA;&amp;amp;= \frac{-\ln \frac{F(t, T)}{K} - \frac{\sigma^2}{2} (T_1 -t)}{\sqrt{T_1-t}\,\sigma}\\&#xA;&amp;amp;= -d_1(F).&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;\frac{F}{K}P\bigg(\frac{K^2}{F}, t \bigg) &amp;amp;= d(t, T_1)\frac{F}{K}\Bigg[K \Phi\bigg(-d_2\bigg(\frac{K^2}{F}\bigg)\bigg) -\frac{K^2}{F} \Phi\bigg(-d_1\bigg(\frac{K^2}{F}\bigg)\bigg)\Bigg]\\&#xA;&amp;amp;= d(t, T_1)\bigg[F \Phi\Bigg(-d_2\bigg(\frac{K^2}{F}\bigg)\bigg) -K \Phi\bigg(-d_1\bigg(\frac{K^2}{F}\bigg)\bigg)\Bigg]\\&#xA;&amp;amp;= d(t, T_1)\Big[F(t, T) \Phi\big(d_1(F)\big) -K \Phi\big(d_2(F)\big) \Big]\\&#xA;&amp;amp;= C(F, t).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-04-06T17:33:26.060" LastActivityDate="2015-04-06T17:33:26.060" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17258" PostTypeId="1" CreationDate="2015-04-06T01:30:44.523" Score="1" ViewCount="72" Body="&lt;p&gt;I have been looking for a good intuitive reasoning for introduction of the risk neutral measure and its uses in quantitative finance, but I have yet to find one. I was wondering if any one could answer this question or possibly provide resources to do so. &lt;/p&gt;&#xA;" OwnerUserId="11756" LastActivityDate="2015-04-06T01:30:44.523" Title="Risk Neutral Measure" Tags="&lt;risk-neutral-measure&gt;" AnswerCount="0" CommentCount="2" ClosedDate="2015-04-07T16:33:13.020" ContentLicense="CC BY-SA 3.0" />
  <row Id="17259" PostTypeId="1" CreationDate="2015-04-06T03:25:57.543" Score="1" ViewCount="95" Body="&lt;p&gt;I am looking for a feed for country wide economic announcements.  For example CPI announcements etc. I currently use &lt;a href=&quot;http://www.fxstreet.com/economic-calendar/&quot; rel=&quot;nofollow&quot;&gt;http://www.fxstreet.com/economic-calendar/&lt;/a&gt; but I have to manually go there and &quot;Export as CSV&quot; then add to my application every week. Is there an API I can use instead? I don't mind paying.&lt;/p&gt;&#xA;" OwnerUserId="2777" LastActivityDate="2015-04-09T21:57:33.450" Title="Where can i get a feed for country specific economic announcements?" Tags="&lt;fx&gt;&lt;calender&gt;&lt;economic-calender&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17261" PostTypeId="2" ParentId="7880" CreationDate="2015-04-06T07:35:58.173" Score="0" Body="&lt;p&gt;Quick answer, doing it with 5th grade math &lt;strong&gt;^^&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming Forward = Spot = 50 for a 10% move = 5: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Call: 55 / (1 + x) = 50 -&gt; x = &lt;strong&gt;10%&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put: 45 * (1 + x) = 50 -&gt; x = &lt;strong&gt;11.11...%&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the &lt;strong&gt;Call/Put ratio&lt;/strong&gt; equaling (10% / 11.11...%) = &lt;strong&gt;.9&lt;/strong&gt; -&gt; &lt;strong&gt;Premium&lt;/strong&gt; -&gt; &lt;strong&gt;10%&lt;/strong&gt; (1 - .9)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;... I am only 13 years old so don't hate if I'm wrong :D &lt;/p&gt;&#xA;" OwnerUserId="15849" LastActivityDate="2015-04-06T07:35:58.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17263" PostTypeId="2" ParentId="17255" CreationDate="2015-04-06T12:14:11.130" Score="0" Body="&lt;p&gt;I think you are confusing you self.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I where to search for Apple Inc. I would:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;look up Apple Inc. on eg. Google Finance, and find the ticker symbol (AAPL).&lt;/li&gt;&#xA;&lt;li&gt;Put AAPL into the &quot;symbol Search&quot;, click &quot;Advanced Search Options&quot;.&lt;/li&gt;&#xA;&lt;li&gt;In &quot;Market Sector&quot; choose &quot;Equity&quot;.&lt;/li&gt;&#xA;&lt;li&gt;In &quot;Security Type&quot; select &quot;Common Stock&quot;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;That will filter out most of noise in this case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I you want to find the different Bloomberg ID's for an instrument on a specific exchange or in a specific country/region you can ofcause, just choose something in the &quot;Exchange&quot; and &quot;Country&quot; box.&lt;/p&gt;&#xA;" OwnerUserId="4769" LastActivityDate="2015-04-06T12:14:11.130" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17265" PostTypeId="2" ParentId="17064" CreationDate="2015-04-06T16:25:47.397" Score="0" Body="&lt;p&gt;I seem to get much better results if I replace&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;BinormalDistribution[{Sqrt[dt], Sqrt[dt]}, \[Rho]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;BinormalDistribution[{Sqrt[dt], Sqrt[dt]}, \[Rho] dt]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is very strange because the Mathematica documentation clearly states that BinormalDistribution takes the correlation $\rho$ as input, whereas the covariance is given by $\rho \, dt$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will try running this modified code with $10^4$ sample paths and $10^4$ time increments. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this overkill for getting decent statistics?&lt;/p&gt;&#xA;" OwnerUserId="15782" LastActivityDate="2015-04-06T16:25:47.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17266" PostTypeId="1" AcceptedAnswerId="17270" CreationDate="2015-04-06T16:39:29.173" Score="3" ViewCount="227" Body="&lt;p&gt;Assume that instantaneous returns are generated by the continuous time martingale:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dp_t = \sigma_t dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W_t$ denotes a standard Weiner process and One day returns are denoted by $r_{t+1} = p_{t+1} - p_t$. Then By Ito's lemma  we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E_t (r_{t+1}^2) = E_t \Bigg( \int_0^1 r_{t + \tau}^2 d \tau \Bigg) = E_t \Bigg( \int_0^1 \sigma_{t + \tau}^2 d \tau \Bigg) =  \int_0^1 E_{t} \Bigg( \sigma_{t + \tau}^2  \Bigg) d \tau  $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $E_t$ denotes conditional expectation at time t.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am very rusty with Ito's lemma applications and do not seem to recall where the $d \tau$ comes up from. Would anybody mind explaining these 3 equalities?&lt;/p&gt;&#xA;" OwnerUserId="15188" LastEditorUserId="2587" LastEditDate="2015-04-07T07:01:11.450" LastActivityDate="2015-04-07T07:01:11.450" Title="On an application of Ito's lemma" Tags="&lt;volatility&gt;&lt;returns&gt;&lt;martingale&gt;&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17268" PostTypeId="1" AcceptedAnswerId="18717" CreationDate="2015-04-06T17:18:40.423" Score="5" ViewCount="352" Body="&lt;p&gt;This is a question from a problem sheet which I have handed in and have solutions for. The only examples of this in class I have seen are examples where the interest rate is 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Consider a Cox-Ross-Rubinstein model with $T = 3$ periods, $S_0 = 100$, $u = 1.6$ and $d = 0.6$. The interest rate is $r = 0.1$. What is the time 0 price of an American put that has exercise price $e = 90$?&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, we have a claim, $X_t = (e - S_t)_+$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solutions go as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At time 3 the claim has values $(0,0,32.4,68.4)$ in the different states.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At time 2 values of the claim when immediately exercising are $(0,0,54)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The time 2 Snell envelope gives values $(0, \frac{32.4 \times \frac{1}{2}} {1 + r},\frac{(32.4 + 68.4) \times \frac{1}{2} } {1 + r})$ in the different states.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, why is there a denominator of $1 + r$ included? I'm thinking we're perhaps calculating the Snell envelope for the discounted process, but surely then the Snell envelope at time 2 would be $\max\{\frac{X_2}{(1 + r)^2},\mathbb{E}(Z_3 | \mathcal{F}_2)\}$, and $Z_3 = \frac{X_3}{(1 + r)^3}$.&lt;/p&gt;&#xA;" OwnerUserId="15851" LastActivityDate="2015-07-06T13:08:01.427" Title="Time 0 value of an American Put in Cox-Ross-Rubinstein model" Tags="&lt;option-pricing&gt;&lt;binomial-tree&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17270" PostTypeId="2" ParentId="17266" CreationDate="2015-04-06T19:29:59.007" Score="4" Body="&lt;p&gt;Based on Ito's isometry,&#xA;\begin{align*}&#xA;E_t (r^2_{t+1}) &amp;amp;= E_t \bigg(\int_t^{t+1} \sigma_s dW_s \int_t^{t+1} \sigma_s dW_s\bigg)\\&#xA;&amp;amp;= E_t \bigg(\int_t^{t+1} \sigma_{\tau}^2 \,d\tau\bigg) \\&#xA;&amp;amp;= E_t\bigg(\int_0^1 \sigma_{\tau+t}^2 \,d\tau\bigg) \\&#xA;&amp;amp;=\int_0^1 E_t\big(\sigma_{\tau+t}^2\big) \,d\tau.&#xA;\end{align*}&#xA;The identity&#xA;\begin{align*}&#xA;E_t (r^2_{t+1}) &amp;amp;= E_t\bigg(\int_0^1 r_{\tau+t}^2 \,d\tau\bigg)&#xA;\end{align*}&#xA;is sloppy. It is better to write as&#xA;\begin{align*}&#xA;E_t (r^2_{t+1}) &amp;amp;= E_t\bigg(\int_0^1 d\langle r_{\tau+t}, r_{\tau+t}\rangle\bigg),&#xA;\end{align*}&#xA;where $\langle r_{\tau+t}, r_{\tau+t}\rangle$ is the quadratic variation.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-04-06T19:29:59.007" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17272" PostTypeId="2" ParentId="17268" CreationDate="2015-04-06T22:41:31.157" Score="0" Body="&lt;p&gt;Generally when doing trees, people discount one step at a time. So this is the value discounted from the end to that node in the tree. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-04-06T22:41:31.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17273" PostTypeId="1" CreationDate="2015-04-07T01:04:54.757" Score="9" ViewCount="257" Body="&lt;p&gt;My understanding was that as you increase the time to expiry of an option, the value of the option increases. However, I have run a bunch of scenarios and have realized that if you assume a dividend yield &gt; 0%, the value of the option starts decreasing after x number of years. In other words, in the first z years, the value of the option increases, and after x years, it starts to decrease.  This is even the case if the risk free rate &gt; dividend yield. Can someone please explain to me intuitively why the dividend yield causes the value of the option to decrease after a certain number of years and why the time value of the option doesn't outweigh the effects of the dividend?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks very much.&lt;/p&gt;&#xA;" OwnerUserId="15856" LastActivityDate="2015-10-05T18:21:48.217" Title="Time value of option not always leading to an increased option value" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17275" PostTypeId="1" AcceptedAnswerId="17276" CreationDate="2015-04-07T06:48:58.477" Score="1" ViewCount="157" Body="&lt;p&gt;I have been reading and trying out stuff until I am totally confused and back to square one. Could someone please explain the difference between the two methods suggested below?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose I have 10 stock price series that are I(1). I can use Johansen's method to test for co-integration and find appropriate weights for each stock to create a stationary basket from these 10 stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second approach, I use available VAR (vector auto regression) methods to fit a VAR model on these 10 stocks and find a model that is stable (stationary).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the difference between these two approaches? Are they the same because both result in a basket of stocks that is stationary?&lt;/p&gt;&#xA;" OwnerUserId="12202" LastActivityDate="2015-04-07T07:08:23.983" Title="Different ways to identify a co-integrated series?" Tags="&lt;cointegration&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17276" PostTypeId="2" ParentId="17275" CreationDate="2015-04-07T07:08:23.983" Score="2" Body="&lt;p&gt;VAR can be applied only if the input series are stationary otherwise VAR may result in spurious correlation. So just evade it. Now the solution to treat the non stationary series to go for cointegrated series (ca.jo test) and if cointegration is viable then build VECM (Vector Error Correction Mechanism). This incorporate the short and long run relationship between series.&lt;/p&gt;&#xA;" OwnerUserId="15861" LastActivityDate="2015-04-07T07:08:23.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17277" PostTypeId="2" ParentId="17243" CreationDate="2015-04-07T08:05:19.047" Score="5" Body="&lt;p&gt;On the N. N. Taleb's &lt;a href=&quot;http://www.fooledbyrandomness.com/CV.htm&quot; rel=&quot;noreferrer&quot;&gt;website&lt;/a&gt;, you can find all his papers collected in the bibliography he updates on his own site.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this will help.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-04-07T08:05:19.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17280" PostTypeId="2" ParentId="15491" CreationDate="2015-04-07T10:04:07.847" Score="0" Body="&lt;p&gt;It depends on how close your strike is to the forward (at expiry). Lets say you have an option which is expiring in a week, the forward will be close to the spot. Hence an out of the money strike for such as option will be closer to the at the money for an option expiring in 6 months (where the forward is pretty far from the spot).&lt;/p&gt;&#xA;" OwnerUserId="15864" LastActivityDate="2015-04-07T10:04:07.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17281" PostTypeId="1" AcceptedAnswerId="17303" CreationDate="2015-04-07T10:53:40.967" Score="1" ViewCount="490" Body="&lt;p&gt;I have data of index closing values. I later will use to run some regressions on the percent changes. When examining the data, I find heteroscedastic residuals and that the distribution is non-normal. In fact, it more looks like a t-distribution. Number of observations is &gt; 6000. My question is how I properly make inferences from this data if I would choose to not consider normality and instead go with t-distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I determine the critical values in such a distribution?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After running the regressions and checking for autocorrelation in the residuals, say I find autocorrelation, do I need to tweak the Newey-West SE in any way for it to work?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anything else I need to consider?&lt;/p&gt;&#xA;" OwnerUserId="15700" LastEditorUserId="2379" LastEditDate="2015-04-08T17:00:13.950" LastActivityDate="2015-04-08T17:00:13.950" Title="Inferences with non-normal data" Tags="&lt;distribution&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17282" PostTypeId="1" CreationDate="2015-04-07T13:12:38.480" Score="0" ViewCount="38" Body="&lt;p&gt;Does anyone know of a source for a data feed containing ETF Holdings for most ETF firms such as Ishares, Proshares, State Street?  I know Bloomberg has this info, but I'm looking for a vendor that can deliver this info without all of the constraints that BB puts on their data.&lt;/p&gt;&#xA;" OwnerUserId="13995" LastActivityDate="2015-04-07T13:12:38.480" Title="Source for Normalized File of ETF Holdings" Tags="&lt;market-data&gt;&lt;etf&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="1" ClosedDate="2015-04-10T05:06:06.890" ContentLicense="CC BY-SA 3.0" />
  <row Id="17283" PostTypeId="2" ParentId="17236" CreationDate="2015-04-07T14:07:31.623" Score="1" Body="&lt;p&gt;For a random variable $\xi$, the variance is defined by&#xA;$$mean\Big(\big(\xi -mean (\xi)\big)^2\Big).$$&#xA;Then the geometric variance should be defined by&#xA;$$\prod_{i=1}^n\Bigg(1+ \bigg[x_i-\prod_{j=1}^n(1+x_j)^{1/n}\,\bigg]^2\, \Bigg)^{1/n}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Addendum ----&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The definition given in the link below is only a way of thinking. However, it does not provide a consistent definition. For example, for the variance var, it would be defined by something like&#xA;$$\ln var = \frac{\sum_{i=1}^n (\ln A_i - \ln u_g)^2}{n}.$$&#xA;If the standard deviation is defined by&#xA;$$\ln \sigma_g = \sqrt{\frac{\sum_{i=1}^n (\ln A_i - \ln u_g)^2}{n}},$$&#xA;Then what is the relationship between $var$ and $\sigma_g$?&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-04-10T20:15:57.430" LastActivityDate="2015-04-10T20:15:57.430" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17284" PostTypeId="2" ParentId="17181" CreationDate="2015-04-07T14:17:13.487" Score="1" Body="&lt;p&gt;The umbrella term is Exchange Traded Product or ETP, so your sentence would become &quot;The fund invests in ETPs&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the second question a simple way of looking at it is, a ETN would have credit risk with the issuer, where an ETC would not.&lt;/p&gt;&#xA;" OwnerUserId="1764" LastActivityDate="2015-04-07T14:17:13.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17285" PostTypeId="1" CreationDate="2015-04-07T14:32:02.443" Score="9" ViewCount="331" Body="&lt;p&gt;Knowing the Characteristic function $\Phi_{T,t} = \mathbb{E} [ e^{i u S_T} | S_t, V_t]$ (or equivalently, the Laplace transform) of an affine process, it's possible to know the distribution of the process $S$ at time $t$, i.e.:&#xA;$$&#xA;\mathbb{P}(S_T &amp;gt; x) = \frac{1}{2} + \frac{1}{\pi}\int_{0}^{\infty} Re\bigg(\frac{e^{-i u log(x)} \Phi_{T,0}(u)}{i u }\bigg) du&#xA; $$&#xA;(can be found in Carr Madan FFT approach to option pricing).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, once we know the characteristic function of the process, we have all the information on the distribution and on the density of the process at a given time $t$, since we need only the information of the initial price $S_0$, and the initial volatility $V_0$ (here I am using an easy possible example, the Heston model).&#xA;$$&#xA;\frac{dS_t}{S_t} = r dt + \sqrt{V_t} dW_t$$$$&#xA;dV_t = \kappa ( \theta - V_t) + \sqrt{V_t} dB_t$$&#xA;$$d&amp;lt;W,B&amp;gt;_t = \rho&#xA;$$&#xA;Is it possible, using the characteristic function, to compute the following transition probability?&#xA;$$&#xA;\mathbb{P}(S_T \leq x | S_t = y)&#xA;$$&#xA;Of course, in the condition where I know $S_t$ and $V_t$ it's easy using the characteristic function, but I know only $S_t$ and I don't have any information on $V_t$&lt;/p&gt;&#xA;" OwnerUserId="15866" LastEditorUserId="13470" LastEditDate="2016-11-06T12:29:14.857" LastActivityDate="2016-11-06T12:29:14.857" Title="Transition densities in the Heston model" Tags="&lt;stochastic-processes&gt;&lt;probability&gt;&lt;stochastic-volatility&gt;&lt;joint-probability&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17287" PostTypeId="1" CreationDate="2015-04-07T14:57:20.733" Score="2" ViewCount="973" Body="&lt;p&gt;Let us assume the geometric Brownian motion, and we have &#xA;$$dS_t= uS_tdt+\sigma S_tdz,$$ and $S_t$ follows a log-normal distribution, but why is $r_t$, the  continuously compounded rate of return, normally distributed?&lt;/p&gt;&#xA;" OwnerUserId="13627" LastEditorUserId="13627" LastEditDate="2015-04-07T15:07:55.890" LastActivityDate="2015-04-08T07:07:30.407" Title="Why is rate of return on the stock normally distributed under GBM?" Tags="&lt;brownian-motion&gt;&lt;black-scholes-merton&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17288" PostTypeId="2" ParentId="17287" CreationDate="2015-04-07T15:01:24.027" Score="6" Body="&lt;p&gt;The solution to the above SDE is (this is will known and can be seen by applying Ito's lemma)&#xA;$$&#xA;S_t = S_0 \exp\left( (u-\sigma^2/2) t + \sigma B_t \right),&#xA;$$&#xA;Thus the log-return is given by&#xA;$$&#xA;\log(S_t/S_0) = (u-\sigma^2/2) t + \sigma B_t&#xA;$$&#xA;and is normally distributed as $B_t$, Brownian motion at time $t$, is normally distributed. In fact the distribution of the expression above is $N( (u-\sigma^2/2) t, t \sigma^2)$. If we assume that $t=1$ (one day or one year) then we get $N( (u-\sigma^2/2),\sigma^2)$ and have the interpretation of the parameters in this frequency.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-04-08T07:07:30.407" LastActivityDate="2015-04-08T07:07:30.407" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17290" PostTypeId="1" AcceptedAnswerId="17304" CreationDate="2015-04-07T17:34:30.483" Score="2" ViewCount="235" Body="&lt;p&gt;If $f$ is some function of BV on $\mathbb{R}$ and $dZ_t = f(W_t)dW_t + \mu_t dt$   ($W_t$ is a $1$-dimensional standard Brownian Motion), then what choice of real valued function $F$ makes:&#xA;\begin{equation}&#xA;M_t:= Z_t e^{\int_0^tF(Z_t)dt}&#xA;\end{equation}&#xA;into a martingale?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I feel that I sould use Ito's product rule to solve this and the fact that the term $e^{\int_0^tF(Z_t)dt}$ must be of B.V. (since it is a Riemman integral), however I'm fuzzy on the details (as I'm completetly new to this type of problem).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your help all.  &lt;/p&gt;&#xA;" OwnerUserId="11582" LastEditorUserId="11582" LastEditDate="2015-04-07T18:57:49.247" LastActivityDate="2015-04-08T19:01:32.427" Title="Transformation into Martingale" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;martingale&gt;&lt;differential-equations&gt;&lt;sde&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17291" PostTypeId="2" ParentId="17290" CreationDate="2015-04-07T18:56:43.923" Score="0" Body="&lt;p&gt;$F=0$ seems like a good choice.&lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2015-04-07T18:56:43.923" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17292" PostTypeId="2" ParentId="17181" CreationDate="2015-04-07T23:53:50.933" Score="2" Body="&lt;p&gt;I am not too knowledgeable with ETCs but here are some differences between ETFs &amp;amp; ETNs.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;ETFs emerged from the concept of buying &quot;baskets&quot; of stocks (similar to mutual funds) &amp;amp; became popular because they were cheaper than mutual funds. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;ETNs just as their name implies are Notes. They are similar to ETFs in the form of representing baskets of stocks but the exception is they are bought on &quot;credit&quot; and their returns might be affected by the credit rating of the issuers other than what they are meant to &quot;track&quot;. I think many leveraged ETNs are formed with debt instruments &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="13428" LastActivityDate="2015-04-07T23:53:50.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17293" PostTypeId="1" AcceptedAnswerId="17782" CreationDate="2015-04-08T08:30:15.493" Score="9" ViewCount="2377" Body="&lt;p&gt;This is a two-part question relating to the change of measure density used in Girsanov and secondly to the Stochastic Exponential.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whilst reading notes relating to Girsanov it is stated that the change of measure density martingale may be written:&#xA;\begin{align}&#xA;\rho_t = \exp \left[- \int_{0}^{t} \lambda_s \, dW_s - \tfrac{1}{2}\int_{0}^{t} \lambda_{s}^{2} \, ds \right]&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is stated that using Ito's Lemma it is straightforward to verify that the stochastic differential of $\rho_t$ is given by&#xA;\begin{align}&#xA;d\rho_t = -\rho_t \, \lambda_t \, dW_t&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think I've solved this and applied ito as follows:&#xA;\begin{align}&#xA;\rho_t &amp;amp;= exp\left[-\lambda_t W_t - \tfrac{1}{2} \, \lambda_{t}^{2} \, t \right]\\&#xA;d\rho_t &amp;amp;= \frac{\partial\rho_t}{\partial t} dt + \frac{\partial \rho_t}{\partial W} dW_t + \tfrac{1}{2} \frac{\partial^2 \rho_t}{\partial W^{2}} (dW_{t})^2\\&#xA;&amp;amp;= -\tfrac{1}{2} \lambda_{t}^{2}\exp\left[\dots\right] - \lambda_t\exp\left[\dots\right] dW_{t} + \tfrac{1}{2} \lambda_{t}^2 \exp\left[\dots\right] (dW_{t})^{2}\\&#xA;&amp;amp;= -\tfrac{1}{2}\,\lambda_{t}^{2}\,\rho_{t}\,dt - \lambda_{t}\,\rho_{t}dW_{t} + \tfrac{1}{2}\,\lambda_{t}^{2}\,\rho_{t} dt\\&#xA;&amp;amp;= -\lambda_{t}\rho_{t}\,dW_{t}&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\textbf{Question 1}$ - Is this correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Stochastic Exponential is stated as:&#xA;\begin{align}&#xA;\mathcal{E}_t(X) = \exp\left[ X_t - \tfrac{1}{2} \langle X,X \rangle_{t} \right]&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\textbf{Question 2}$ - I believe $\langle X,X \rangle_t$ is the quadratic variation, should I interpret this the same way I do the $\int_{0}^{t} \lambda_{t}^{2}\,ds$ term in the change of measure density above?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is stated (Filipovic - Term-Structure Models) that if $X_t$ is a continuous local martingale with $X_0 = 0$, then using Ito one can see $d\mathcal{E}_t(X) = \mathcal{E}_t(X)dX_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution I have is as follows:&#xA;\begin{align}&#xA;d\mathcal{E}_t(X) &amp;amp;= \exp\left[X_t - \tfrac{1}{2}\langle X \rangle_t \right]\left(dX_t - \tfrac{1}{2}d\langle X \rangle_t \right) + \tfrac{1}{2}\exp\left[X_t - \tfrac{1}{2}\langle X \rangle_t \right]d\langle X \rangle_t\\&#xA;&amp;amp;= \exp\left[X_t - \tfrac{1}{2}\langle X \rangle_t \right] dX_t\\&#xA;&amp;amp;= \mathcal{E}_{t}dM_t\\&#xA;\text{obviously $\mathcal{E}_0(X) = 1.$}&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\textbf{Question 3}$ - I have difficulty understanding the notation here and cannot see how Ito has been applied in this case (as I cannot see the $dt$ and $dW$ terms). I'd appreciate any help showing me how ito has been applied in this case (and why it is obvious that $\mathcal{E}_{0}(X) = 1$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;John&lt;/p&gt;&#xA;" OwnerUserId="15796" LastActivityDate="2015-07-12T20:29:15.473" Title="Ito, Stochastic Exponential and Girsanov" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;girsanov&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17295" PostTypeId="1" CreationDate="2015-04-08T08:36:07.653" Score="3" ViewCount="298" Body="&lt;p&gt;When back testing an algorithm that relies upon short selling certain stocks, how to limit the short selling so that the back-test results still remain reliable? What kind of controls are generally put on such algorithms during actual trading and how to simulate such controls while backtesting?&lt;/p&gt;&#xA;" OwnerUserId="15624" LastActivityDate="2016-01-19T15:59:00.457" Title="Limits on Short selling" Tags="&lt;backtesting&gt;&lt;market-model&gt;&lt;short-selling&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17297" PostTypeId="2" ParentId="17189" CreationDate="2015-04-08T11:12:16.870" Score="1" Body="&lt;p&gt;ETNs are senior, unsecured and unsubordinated debt securities issued by an underwriter. When you buy an ETN you are essentially lending money to the issuer in exchange for exposure to an index minus some basis points(management fees). As with most debt instruments, if the issuer defaults, you already assumed the credit risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the question of why ETNs are a source of cheap funding (I'm skeptical on the life blood part), take into consideration that the largest ETN (&lt;a href=&quot;https://jpmorganetns.com/etn/detail/JPMorgan-Alerian-MLP-Index-ETN.html&quot; rel=&quot;nofollow&quot;&gt;AMJ&lt;/a&gt;) currently has 5.6 Billion in AUM and charges 0.85%. &#xA;Some ETNs also accrue the expense ratio on a daily basis, &lt;a href=&quot;http://etracs.ubs.com/product/detail/index/ussymbol/CEFL&quot; rel=&quot;nofollow&quot;&gt;UBS&lt;/a&gt; is known to do that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the following example: UBS currently has 37 ETNs with a total AUM of 5.76 Billion. Assuming an average fee of 1.00% AUM, accrued on a daily basis, that would provide UBS with roughly $200k per trading day assuming a 252 day trading calendar.&lt;/p&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="1764" LastEditDate="2015-05-25T04:45:31.427" LastActivityDate="2015-05-25T04:45:31.427" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17298" PostTypeId="2" ParentId="16235" CreationDate="2015-04-08T13:35:55.907" Score="2" Body="&lt;p&gt;There are two answers to your question&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;If you want to use the Neston-Nandi model, you can use it directly with the parameters that you already show above:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;model = list(omega = 0.000001, alpha = 0.5, beta = 0.4)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In r, the fOptions package has an HN model that can use them:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;HNGOption(TypeFlag, model, S, X, Time.inDays, r.daily)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;If you want to calculate your own option price using garch params, you need to simulate the spot (or stock) price process as well as the volatility process. Your first set of equations show how the Return (the change in the spot price) is updated for each period.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The best book or reference I have seen that explains the implementation of the HN model is 'Option Pricing Models and Volatility' by Rouah and Vainberg. The code is VBA, but the explanation is very good..&lt;/p&gt;&#xA;" OwnerUserId="6881" LastActivityDate="2015-04-08T13:35:55.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17302" PostTypeId="2" ParentId="17295" CreationDate="2015-04-08T15:36:08.620" Score="3" Body="&lt;p&gt;You should make your borrow cost sufficient to dissuade unlimited short selling.  In practice, each short would require you to borrow shares from your broker.  This is usually handled when computing transaction cost.  You should account for this in your trading algorithm or in the factor model itself.  A simple method would make shorts some N% more expensive than longs.  In practice, this could kill your projected returns.  You could probably estimate this factor by looking at historical short interest on the stock.  If everyone is trying to short it, the cost to borrow is going to be high.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.investopedia.com/terms/s/stock-loan-fee.asp&quot; rel=&quot;nofollow&quot;&gt;http://www.investopedia.com/terms/s/stock-loan-fee.asp&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8201" LastActivityDate="2015-04-08T15:36:08.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17303" PostTypeId="2" ParentId="17281" CreationDate="2015-04-08T16:59:38.803" Score="1" Body="&lt;p&gt;You are concerned about non-normality, heteroskedasticity, and autocorrelation in your data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The normality of errors is not an assumption of OLS (it is for MLE regression). That is, you can conclude that OLS is the best linear unbiased estimator (BLUE) without assuming normality. Nevertheless, there are a number of techniques within the context of robust regression to handle outliers and t distributed data, such as a Bayesian regression assuming t distributed errors. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lack of heteroskedasticity and autocorrelation are required for OLS to be BLUE. However, with some adjustments, you can still use OLS coefficients in hypothesis testing (though they will no longer be BLUE). All you have to do is adjust the standard errors (or more generally the covariance matrix of the OLS parameters). With new standard errors, you can make new t statistics and run any hypothesis tests you want. Huber-White is common in regression packages. It can correct for heteroskedasticity in the errors. Newey-West errors are a subsequent development. They can correct for autocorrelation and heteroskedasticity. This is particularly important for some time series data that is common in finance. If you're already using Newey-West errors, then you can construct the t statistics and run whatever hypothesis tests you need to. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another approach to autocorrelation is fit an ARMA model to the data. Similarly, with heteroskedasticity, you can fit a GARCH or SV model to the data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before I end, you also ask about the critical values of the distribution of errors. People are sometimes confused in frequentist statistics that the distribution of the parameters is not the same thing as the distribution of the errors. For instance, assume the errors are normal. The distribution that you use for hypothesis testing is the t distribution. What distribution is this? It is the distribution of the OLS coefficients.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That being said, there are a number of cases where the hypothesis testing requires different critical values. For instance, in the Augmented Dickey Fuller test you have to make adjustments because the coefficient being sufficiently different could mean that the underlying data will explode to infinity. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2015-04-08T16:59:38.803" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17304" PostTypeId="2" ParentId="17290" CreationDate="2015-04-08T19:01:32.427" Score="1" Body="&lt;p&gt;As you have guessed correctly, these type of questions can be answered using Ito's Lemma.We have:&#xA;\begin{equation}&#xA;d(M_t)= d(Z_t e^{\int_0^tF(Z_u)du})=d(Z_t) e^{\int_0^tF(Z_u)du}+Z_t d(e^{\int_0^tF(Z_u)du})+d(Z_t)d(e^{\int_0^tF(Z_u)du})&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the first two terms on R.H.S, we have:&#xA;\begin{equation}&#xA;d(Z_t) e^{\int_0^tF(Z_u)du} = (f(W_t)dW_t + \mu_t dt) e^{\int_0^tF(Z_u)du}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &#xA;\begin{equation}&#xA;Z_t d(e^{\int_0^tF(Z_u)du}) = Z_t e^{\int_0^tF(Z_u)du}F(Z_t)dt&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the third term does not contribute anything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now,  for martingale condition to hold, equate the coefficient of time dependent term to zero and we get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;F(Z_t) = -\mu_t/Z_t &#xA;\end{equation}&lt;/p&gt;&#xA;" OwnerUserId="15877" LastActivityDate="2015-04-08T19:01:32.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17305" PostTypeId="2" ParentId="17249" CreationDate="2015-04-08T19:34:28.433" Score="0" Body="&lt;p&gt;Eurostat has a manual on the calculation and use of PPP. This is available &lt;a href=&quot;http://ec.europa.eu/eurostat/documents/3859598/5923225/KS-RA-12-023EN.PDF/e2755b1b-68a5-4dad-86f5-6327c76da14d?version=1.0&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9458" LastEditorUserId="2587" LastEditDate="2015-06-09T08:29:19.707" LastActivityDate="2015-06-09T08:29:19.707" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17306" PostTypeId="2" ParentId="17163" CreationDate="2015-04-08T21:00:46.820" Score="1" Body="&lt;p&gt;Try to check academic papers at www.quantpedia.com. Guys there are reviewing a lot of papers. Those papers which are selected and inserted must be usable by practitioners in real world. This assure that you will read academic papers of higher quality.&lt;/p&gt;&#xA;" OwnerUserId="15878" LastActivityDate="2015-04-08T21:00:46.820" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17307" PostTypeId="1" AcceptedAnswerId="17321" CreationDate="2015-04-09T01:45:30.223" Score="0" ViewCount="63" Body="&lt;p&gt;When a company goes into an IPO wouldn't they try to make as much money as they can? Then how come the Greenshoe option says that some would try to not issue additional shares just so their share price doesn't raise more money than planned? I mean what kind of situations wouldn't you want to raise more money than keep the share price to the planned price?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Greenshoe&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Greenshoe&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15880" LastActivityDate="2015-04-09T22:20:52.257" Title="Raising money in IPOs" Tags="&lt;equities&gt;&lt;finance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17308" PostTypeId="1" CreationDate="2015-04-09T08:38:25.003" Score="2" ViewCount="227" Body="&lt;p&gt;There is a clear theory about generating correlated random numbers using Cholesky decomposition or PCA.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suppose if we apply above methods to random numbers generated using Uniform random numbers generators like Sobol then the uniformity is gone.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any well known methods to generate correlated random numbers from uniform random number generators and still uniformity stays in tact?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe generators need to take correlation matrix before generation itself rather apply correlations after generation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="7422" LastActivityDate="2015-04-09T09:19:24.830" Title="Correlated Random Number Generation using Sobol?" Tags="&lt;random-walk&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17309" PostTypeId="2" ParentId="17308" CreationDate="2015-04-09T09:19:24.830" Score="1" Body="&lt;p&gt;If you have a vector $X = (X_1,\ldots,X_n)$ of a multivariate normal distribution with covariance matrix $\Sigma$ and $F_i$ is the marginal cumulative distribution function of $X_i$ then $F_i(X_i)$ is uniformly distributed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what you can do:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;generate uniforms (e.g. Sobol or Halton)&lt;/li&gt;&#xA;&lt;li&gt;transform to uncorrelated Gaussians&lt;/li&gt;&#xA;&lt;li&gt;transform these Gaussians to correlated Gaussians (using Cholesky e.g.)&lt;/li&gt;&#xA;&lt;li&gt;Apply the marginal cdf to each correlated Gaussian to get correlated uniforms.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This approach is connected to the theory of copulas.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-04-09T09:19:24.830" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17311" PostTypeId="2" ParentId="17236" CreationDate="2015-04-09T13:21:14.483" Score="3" Body="&lt;p&gt;Perhaps this works :&#xA;  &lt;a href=&quot;http://en.wikipedia.org/wiki/Geometric_standard_deviation&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Geometric_standard_deviation&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular, see under &quot;Derivation&quot;&lt;/p&gt;&#xA;" OwnerUserId="15886" LastActivityDate="2015-04-09T13:21:14.483" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17313" PostTypeId="1" CreationDate="2015-04-09T17:36:20.453" Score="2" ViewCount="1199" Body="&lt;p&gt;In order to compare various trading strategies, I am trying to calculate the &lt;strong&gt;success rate&lt;/strong&gt; (the ratio of winning and losing trades).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While it is clear to me that this indicator is far from being an accurate reflection of the strategy's strengths, leaving out the time horizon and relative size of the trades from the picture, I am particularly concerned by the following problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a strategy that makes simple trades buying a stock at once, then selling it later at once, it is straightforward to identify the winning and losing trades and calculate the ratio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if a strategy chooses to accumulate a stock gradually over multiple transactions, and/or sells them gradually, the notion of a trade becomes somewhat flaky. In particular, it becomes hard to compare strategies like &lt;strong&gt;A&lt;/strong&gt; and &lt;strong&gt;B&lt;/strong&gt; where &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;A&lt;/strong&gt; buys 10x  @ \$100 and sells 10x @ \$150 (1 winning trade with 50% profit)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;B&lt;/strong&gt; buys 5x @ \$90 and later 5x @ \$110, then sells 5x @ \$140 and later 5x @ \$160&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuitively, if time gap between the individual buy and sell trades in the example &lt;strong&gt;B&lt;/strong&gt; is small, the strategy made the same decision (to buy 10 pieces of the stock) and ended up with the same outcome (total profit of 50%). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The more granular the single transactions are, the more difficult it seems to support this intuition with some kind of a rule that would group the individual transactions into trades based on their proximity, so that a single trade corresponds to a single &lt;strong&gt;&lt;em&gt;decision&lt;/em&gt;&lt;/strong&gt; made by the strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a standard way to solve this problem or can you point me to any references that are at least in some way related ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: A couple of clarifications to address the comments below:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;I'm treating a strategy as a black-box here and only want to evaluate its historical performance. I have no way of back testing the strategy in a different environment, which is also not my intention - the only thing I'm looking for is calculating the success rate to get an (admittedly, somewhat biased) picture&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The example of a worst-case scenario is a strategy that is buying and selling a single stock X, thereby just changing weights in the portfolio composed of X and cash. It would generate lots of transactions (selling and buying according to the price fluctuations of the stock X), but I'm not sure how to group these into &quot;trades&quot; or &quot;decisions&quot;, so that I can calculate a ratio between wins and losses. If I simply define a trade as happening between the first purchase and the last sell of a particular stock, this strategy would only have made a single trade. I know this is a somewhat contrived example but I have the same problem in less extreme cases when the strategy is rebalancing or repeatedly trading non-unique stocks and I'm trying to compare it to strategies that trade a large number of unique stocks.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="15890" LastEditorUserId="15890" LastEditDate="2015-04-13T18:39:39.900" LastActivityDate="2015-07-12T21:29:14.950" Title="How to evaluate a success rate of a trading strategy" Tags="&lt;algorithmic-trading&gt;&lt;trading-systems&gt;&lt;strategy&gt;&lt;performance-evaluation&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17314" PostTypeId="2" ParentId="16468" CreationDate="2015-04-09T18:07:35.143" Score="1" Body="&lt;p&gt;Maybe a &lt;a href=&quot;http://en.wikipedia.org/wiki/Social_trading&quot; rel=&quot;nofollow&quot;&gt;Social Trading platform&lt;/a&gt; would be what you're looking for? They allow you to put together a portfolio for the world to view. Some even make it tradeable, usually as ETF (which carries the usual fees for investors, which are then split between you and the provider).&lt;/p&gt;&#xA;" OwnerUserId="15892" LastActivityDate="2015-04-09T18:07:35.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17315" PostTypeId="1" CreationDate="2015-04-09T19:11:26.627" Score="19" ViewCount="46915" Body="&lt;h1&gt;Summary&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I seek an explicit reference to a source that gives me&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;a fixed URL, e.g. &lt;code&gt;http://example.com/?isin=US1912161007&lt;/code&gt; or &lt;code&gt;http://example.com/?index=Dow_Jones&lt;/code&gt;, which provides&lt;/li&gt;&#xA;&lt;li&gt;an easily parsed format (e.g. CSV, not HTML),&lt;/li&gt;&#xA;&lt;li&gt;the fundamental data I need (or at least sufficient data that I can calculate it),&lt;/li&gt;&#xA;&lt;li&gt;several years in the same file,&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;search functionality by ISIN&lt;/strong&gt; (or all stocks of an index in a single file).&lt;/li&gt;&#xA;&lt;li&gt;The service should &lt;strong&gt;not be limited to US stocks&lt;/strong&gt; but should include at least the stocks of major indices worldwide.&lt;/li&gt;&#xA;&lt;li&gt;Paying for it is not the issue, but I need to know beforehand if I that data actually does what I need.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h1&gt;Original Post&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I'm looking for a service that provides historical fundamental data in CSV format, which might look kind of like this (note how more than one company appears in the same file - alternatively I'd like an usable request interface, e.g. &lt;code&gt;http://example.com/?isin=US1912161007&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;stock , ISIN        , year, price       earnings   cash flow  equity     debt     , ...&#xA;                            per share , per share, per share, per share, per share, ...&#xA;Apple , US0378331005, 2014, 125.32    , 6.49     , 29.78    , 22.3     , 25.1     , ...&#xA;Apple , US0378331005, 2013, 125.32    , 5.72     , 26.20    , 24.6     , 32.6     , ...&#xA;Boeing, US0970231058, 2014, 152.42    , 7.47     , 123.20   , 12.6     , 120.3    , ...&#xA;Boeing, US0970231058, 2013, 152.42    , 6.03     , 112.85   , 21.4     , 101.2    , ...&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That's the barest minimum of data - more fundamentals are better (and getting it per quarter instead of per year would just be a plus). Some values can also be calculated (e.g. &lt;code&gt;total equity / #shares = equity per share&lt;/code&gt;, &lt;code&gt;earnings per share / price per share = PER&lt;/code&gt;, &lt;code&gt;equity / debt = leverage&lt;/code&gt; etc.), hence having different columns in the file is fine as long as all fundamental data can be calculated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not mind having to pay for long-term historical data - but I want to see a sample of several years and several stocks first so I can decide whether the data actually fits my purpose.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is important that each CSV file contains multiple stocks (at least all of an index). Because I am very much fed up with having to collect the data for every single stock by hand - or rather by a script that has to crawl three different web pages for every single stock to get all of the fundamentals, regularly throwing up at the weird formatting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I could see, the sources in &quot;&lt;a href=&quot;https://quant.stackexchange.com/questions/141/what-data-sources-are-available-online&quot;&gt;What data sources are available online?&lt;/a&gt;&quot; are no better than the scraping script I already have. The main problem being that even though some of them provide CSV they still provide one per stock. One file per index I could work with, but one per stock makes far too many files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, they usually are US stocks only. While having information on US stocks is nice, being restricted to them is not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, a source with a CSV giving a list of the stocks with their current price (or yesterday's - I'm not picky) would be nice, too (and, again, not one file per stock) - though utterly useless without a CSV that gives me the fundamental data.&lt;/p&gt;&#xA;" OwnerUserId="15892" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2021-03-23T19:15:49.723" Title="Where can I get historical fundamental data for multiple companies in a single CSV file?" Tags="&lt;historical-data&gt;" AnswerCount="9" CommentCount="4" FavoriteCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="17316" PostTypeId="2" ParentId="17255" CreationDate="2015-04-09T19:51:17.930" Score="1" Body="&lt;p&gt;Apparently the entity level identifiers aren't part of the open symbology. The entity level identifiers are available via a data license. A so called &quot;open&quot; identifier list is not so open after all ;(&lt;/p&gt;&#xA;" OwnerUserId="4695" LastEditorUserId="4695" LastEditDate="2015-04-13T13:40:11.737" LastActivityDate="2015-04-13T13:40:11.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17317" PostTypeId="2" ParentId="17313" CreationDate="2015-04-09T19:55:21.200" Score="1" Body="&lt;p&gt;I don't know if there is a standard way of solving the problem, but I solve it thus:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Strategy A bought for $C_a$ dollars and sold for $S_a$ dollars for a result of $R_a = S_a - C_a$ over $T_a$ days.&lt;/li&gt;&#xA;&lt;li&gt;Strategy B bought for $C_b$ dollars and sold for $S_b$ dollars for a result of $R_b = S_b - C_b$ over $T_b$ days.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Where&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$C_a$ and $C_b$ is the total sum of investments, independently of whether you bought once or several times. Same goes for $S_a$ and $S_b$ with respect to sales. Reinvesting increases both terms and thus is neutral with respect to $R_a$ and $R_b$.&lt;/li&gt;&#xA;&lt;li&gt;$T_a$ and $T_b$ is the duration from first purchase to last sell - if you keep an investment beyond the end of that duration calculate as if you would sell it at the end of the duration. (Sales of investments that were already held before the start of period may not be considered in the calculation.)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;To make the strategies comparable we need to normalize investment and period. Hence we set&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$C_b' = C_a$&lt;/li&gt;&#xA;&lt;li&gt;$T_b' = T_a$&lt;/li&gt;&#xA;&lt;li&gt;$R_b' = R_b\cdot \frac{C_a}{C_b} \cdot \frac{T_a}{T_b}$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Now you can compare $\frac{R_a}{T_a}$ and $\frac{R_b'}{T_b'}$: whichever is greater is the better strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So given your example (assuming $T_a = T_b$):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$C_a = 10\cdot100\$ = 1,000\$$ and $S_a = 10\cdot150\$ = 1,500\$$, hence $R_a = 500\$$.&lt;/li&gt;&#xA;&lt;li&gt;$C_b = 5\cdot( 90 + 110)\$ = 1,000\$$ and $S_b = 5\cdot(150 + 160)\$ = 1,500\$$, hence $R_b = 500\$$.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Hence in your case both strategies would be equal (assuming $T_a = T_b$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Oh, and it's also important to vary only one parameter out of (in this case)&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;strategy&lt;/li&gt;&#xA;&lt;li&gt;starting date&lt;/li&gt;&#xA;&lt;li&gt;market place&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For example, if you want to compare two strategies A and B then you better don't test A in the US and B in Europe or run A during January 1st 2008 - January 1st 2012 and B during January 1st 2009 - January 1st 2013.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly you need to check the same strategy in the same marketplace at different times or at different marketplaces at the same time to find out whether the success of this strategy was just luck or whether there might be something to it.&lt;/p&gt;&#xA;" OwnerUserId="15892" LastEditorUserId="15892" LastEditDate="2015-04-09T20:07:09.950" LastActivityDate="2015-04-09T20:07:09.950" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17318" PostTypeId="2" ParentId="17315" CreationDate="2015-04-09T20:12:13.550" Score="7" Body="&lt;p&gt;You can find dataset you need on &lt;a href=&quot;https://www.quandl.com/&quot; rel=&quot;noreferrer&quot;&gt;QUANDL&lt;/a&gt; (although some data service is for paying, it is a good data source and not expensive); there are a lot of fundamentals data, surely all you need and you download them in CSV format too. I also know that they provide different frequencies and so even the quarterly frequency. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only problem is that you have to download data separately in csv files and after put them together since I think they do not provide a full and complete dataset. If you need that kind of service the only sources available are Bloomberg/ Reuters.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-04-09T20:12:13.550" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17319" PostTypeId="2" ParentId="17196" CreationDate="2015-04-09T21:18:01.543" Score="0" Body="&lt;p&gt;Your question is about the $\overline{Q}$, right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so, it is the covariance between the error terms $E_{i,t}$ and $E_{j,t}$.(The sub term $i$ comes from asset $i$, and $j$ for asset $j$)&lt;/p&gt;&#xA;" OwnerUserId="15893" LastEditorUserId="467" LastEditDate="2015-04-10T05:01:34.383" LastActivityDate="2015-04-10T05:01:34.383" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17320" PostTypeId="2" ParentId="17259" CreationDate="2015-04-09T21:57:33.450" Score="1" Body="&lt;p&gt;Check:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;www.tradingeconomics.com,&#xA;www.knoema.com,&#xA;www.quandl.com,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think some of them have API you are looking for ...&lt;/p&gt;&#xA;" OwnerUserId="15878" LastActivityDate="2015-04-09T21:57:33.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17321" PostTypeId="2" ParentId="17307" CreationDate="2015-04-09T22:20:52.257" Score="0" Body="&lt;p&gt;You could compare a Greenshoe option to overbooking a plane: airlines tend to sell more tickets than there are seats in the plane in the expectation that some people will not show up. If they do not oversell then the plane will take off partially empty, which makes it more expensive. But if they oversell too much, then there will be many angry passengers because they can't travel.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The underwriters (=airline) oversell the company (=plane), i.e. make short sells such that if investors sell their shares in the aftermarket (=no-show passengers) the price won't drop because the underwriters can close their short sells at a profit. The Greenshoe option serves to protect the underwriters if the prices rise instead they can request additional shares rather than having to close their short sell at a loss at the market. But all this only serves to cover the initial volatility of the price right after the public offering.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now when a company goes public it usually has plans for that money, e.g. expanding in other markets. Consider the case of a company that wants to get rid of a loan costing them 5% interest a year. Now if the IPO made them exactly the amount needed to pay off the debt they could show 5% extra earnings per share the next year. However, if they raised twice the needed amount from the IPO then they would have only 2.5% extra earnings per share. So raising more money than needed dilutes the shareholder value, because the extra earnings gets spread across more shares - and diluted shareholders are unhappy shareholders.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore most companies reserve the right to issue additional shares at a later time in case they need the money. Hence there is no need to make as much money as possible on an IPO (unless you're trying to con the investors) - the point is to make as much money as you need.&lt;/p&gt;&#xA;" OwnerUserId="15892" LastActivityDate="2015-04-09T22:20:52.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17322" PostTypeId="1" CreationDate="2015-04-09T23:32:53.763" Score="0" ViewCount="69" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Bond X has a coupon&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Bond Y is a zero-coupon bond (Maturity 2 years)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Bond Z is a zero-coupon bond (Maturity 10 years)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The following graph is given:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ktTJ5.jpg&quot; alt=&quot;bondXYZ&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;X-axis: yield curve, Y-axis: price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;: &lt;em&gt;Which bond corresponds to which curve?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the way to solve a question like this? A little help is appreciated.&lt;/p&gt;&#xA;" OwnerUserId="15894" LastActivityDate="2015-04-11T07:07:48.793" Title="Which bond corresponds to which curve?" Tags="&lt;bond&gt;&lt;yield-curve&gt;" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="17328" PostTypeId="1" AcceptedAnswerId="18387" CreationDate="2015-04-10T12:48:49.527" Score="7" ViewCount="140" Body="&lt;p&gt;I would like to validate this sentence, coming from a &lt;a href=&quot;http://www.wsj.com/articles/blackrock-makes-etf-gains-as-futures-costs-rise-1415289327&quot; rel=&quot;noreferrer&quot;&gt;WSJ article&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The cost of holding a Eurostoxx 50 future, for example, has climbed&#xA;from an average of 0.07% of the contract value since 1998, to an&#xA;average of 0.45% over the last year, according to BlackRock&#xA;calculations based on broker estimates.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;While my gut feeling tells me that that this indeed could be true I want to understand the exact reasons.&lt;/p&gt;&#xA;&lt;p&gt;Lets take an equitizing strategy that rolls an EuroStoxx 50 future quarterly into the next liquid contract. What are the main factors that drive the costs of this replication strategy and how did they change in the last years to support the statement above?&lt;/p&gt;&#xA;" OwnerUserId="2727" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2015-06-16T21:06:48.273" Title="How to properly assess the costs of replicating an index via futures contracts?" Tags="&lt;futures&gt;&lt;etf&gt;&lt;replication&gt;&lt;transaction-costs&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17330" PostTypeId="1" CreationDate="2015-04-10T14:01:23.213" Score="7" ViewCount="4738" Body="&lt;p&gt;I regressed ten portfolios on the Fama French factors and get significant loadings on the SMB factor. However, if I look at the actual average market cap of these portfolios, the portfolios with the highest factor loading are not the one with the smallest market cap. What could be the reason for that? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My portfolios are equal-weighted, so they all load at least slightly positive on the SMB factor.&lt;/p&gt;&#xA;" OwnerUserId="15902" LastEditorUserId="2553" LastEditDate="2015-04-10T19:06:20.890" LastActivityDate="2017-02-20T22:15:18.207" Title="How to interpret the French-Fama SMB factor?" Tags="&lt;regression&gt;&lt;factor-models&gt;&lt;factor-loading&gt;&lt;benchmark&gt;&lt;fama-french&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17332" PostTypeId="2" ParentId="17330" CreationDate="2015-04-10T16:51:57.447" Score="1" Body="&lt;p&gt;By assuming the procedure you followed in replicate the model is correct and there are not errors in data mining or quality, your findings could be affected and influenced by several reasons.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I report as follows those that, according to me, could be the main ones:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Data sample&lt;/strong&gt;: the dataset you used to replicate the Fama-French model could be too little in terms of observations and time-period; keep in mind that in almost all their papers, Fama &amp;amp; French used a data sample that allows to analyze several years (about at least 20 years). &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So, try to increase the time period and the number of observations of the dataset to get better results;&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;&lt;strong&gt;Portfolio coarseness&lt;/strong&gt;: some of your portfolios could be composed by too little stocks and the results could be biased; the factor loadings should be &lt;em&gt;monotonically decreasing&lt;/em&gt; in the market capitalization.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Be sure that each portfolio is composed by the same number of stocks (more or less), constructing them by using the distribution percentiles.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Populated class&lt;/strong&gt;: each portfolio has to be populated enough with a minimum number of stocks that have more or less similar economic features and eliminate the others.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Econometrics issues&lt;/strong&gt;: check that all hypothesis about the linear regression model are fulfilled (Normality, Homoskedasticity, autocorrelation,...) in order that your results ac&#xA;quire more reliability.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Time period&lt;/strong&gt;: may be that their results are influenced by the time period they used in their analysis and that the phenomenon disappeared during the last years; the SMB variable is based on the &lt;em&gt;Small Size effect&lt;/em&gt; and, it is proven that this kind of phenomena disappear after someone makes them of public domain, e.g. publishing papers. Think about the January effect: there are a lot of papers that documented it disappeared!&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Those are some of the main issues could influence your results. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Check them and after, if they are all satisfied, read the later Fama &amp;amp; French's papers to check if their way to analyze the sample is &lt;em&gt;equal&lt;/em&gt; to the yours.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-04-10T17:17:00.857" LastActivityDate="2015-04-10T17:17:00.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17333" PostTypeId="2" ParentId="17209" CreationDate="2015-04-10T19:14:54.283" Score="2" Body="&lt;p&gt;After a lot of guess work, I think can try and answer what I think might be your question.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, note that at maturity the forward equals the spot: $F_T^T = S_T$ so I am not sure what you mean by &quot;forward price strike&quot;. I think you mean that your have forward prices of calls and puts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you chose a model for your index $S$ and the rates, then the present value of a call is &#xA;$$&#xA;  C(T,K) = E^{\mathbb{Q}}[e^{-\int_0^Tr_s ds}(S_T-K)_+] = P(0,T)E^{\mathbb{Q}_T}[(F^T_T-K)_+]&#xA;$$&#xA;where $\mathbb{Q}_T$ is the forward measure. This means that &#xA;$$&#xA;  \mathbb{Q}_T[S_T&amp;gt;K] = -P(0,T)^{-1}\partial_KC(T,K) &#xA;$$&#xA;The forward price of the call is simply the undiscounted value &#xA;$$&#xA;  \widehat{C}(T,K) = E^{\mathbb{Q}_T}[(F^T_T-K)_+]&#xA;$$ &#xA;so&#xA;$$&#xA;  \mathbb{Q}_T[S_T&amp;gt;K] = -\partial_K\widehat{C}(T,K) &#xA;$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you only computed $-\partial_KC(T,K)$ and yet your probabilities sum to $1$, I will guess that your quotes are for forward prices of your options. This is confirmed by using put call parity, $\widehat{C}(T,K)-\widehat{P}(T,K) = F_T-K$, the forward $F_T = K + \widehat{C}(T,K)-\widehat{P}(T,K)$ is independent of the strike (in your case equal to $\approx 2060.7$). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now to answer your question. The probabilities you implied from market prices are $T$-forward probabilities. If you chose to model rates as deterministic, the $T$-forward measure is the same as the standard risk-neutral measure, else they are different. But whatever you chose, you are not computing distribution of the S&amp;amp;P under the actual = real = historical probability $\mathbb{P}$. Derivatives can be priced easily because it requires the risk free rate and the vol without knowing the drift i.e. the actual noise free trend of the underlying. Conversly you cannot imply this drift from option prices so you cannot imply the real world probabilities of the S&amp;amp;P going up or down.        &lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2015-04-10T19:28:39.550" LastActivityDate="2015-04-10T19:28:39.550" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17341" PostTypeId="1" AcceptedAnswerId="17368" CreationDate="2015-04-11T09:53:26.260" Score="6" ViewCount="2224" Body="&lt;p&gt;I'm looking for historical data of the CAC40 components.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I looked at these previously asked questions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/141/what-data-sources-are-available-online&quot;&gt;What data sources are available online?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/14687/finding-historical-data-for-indices&quot;&gt;Finding historical data for indices&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;as well as Yahoo Finance and the official CAC40 site (on Euronext).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The issue is that it's easy with Yahoo finance to find:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the historical data for a CAC40 company&lt;/li&gt;&#xA;&lt;li&gt;a list of &lt;strong&gt;current&lt;/strong&gt; CAC40 components&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;but &lt;strong&gt;not&lt;/strong&gt; the list of CAC40 components at the time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any sources from which I could download this information from ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: If this kind of data is available for the SP500, I would be very interested as well!&lt;/p&gt;&#xA;" OwnerUserId="15910" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2015-04-18T00:09:42.903" Title="CAC40 components historical data" Tags="&lt;data&gt;&lt;market-data&gt;&lt;finance&gt;&lt;historical-data&gt;&lt;index&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17342" PostTypeId="1" CreationDate="2015-04-11T10:52:35.033" Score="0" ViewCount="1293" Body="&lt;p&gt;I inherited a excel spreadsheet that has the following code to price a bond given coupon and current yield&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    'n - Number of future coupon payments till maturity&#xA;    'mtm - months to maturity&#xA;    'FREQ = 12&#xA;    n = Int((mtm - 1) / (FREQ / 2)) + 1&#xA;    f = 2&#xA;    X = 1 - (mtm Mod (FREQ / 2)) / (FREQ / 2) ' length of accrual period since last coupon date,  0 &amp;lt;=X&amp;lt;1&#xA;    If X = 1 Then&#xA;        X = 0&#xA;    End If&#xA;    'Last term is subtraction of accrued interest. The PV includes accrued interst, if need to exclude, uncomment&#xA;    pv = (cpn * (1 + yld / f) + (yld - cpn) / ((1 + yld / f) ^ n)) / (yld * ((1 + yld / f) ^ (1 - X))) '- X * cpn / f&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Has anyone seen this formula that can point me to a reference.  There are even more complicated formulas for duration and convexity.  It seems to work but I  can't make heads or tails out of it.  Alas the documentation doesn't get any better&lt;/p&gt;&#xA;" OwnerUserId="13998" LastActivityDate="2015-04-11T10:52:35.033" Title="bond price formula in excel" Tags="&lt;fixed-income&gt;&lt;bond&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17344" PostTypeId="1" CreationDate="2015-04-11T14:45:53.373" Score="4" ViewCount="310" Body="&lt;p&gt;Consider the process,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;dX_t=(-aX_t+b(1-X_t))dt + \sqrt{X_t(1-X_t)}dW_t&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I show that the stationary distribution for the transition density is a beta distribution?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried expanding the corresponding Kolmogorov Forward Equation but it seems too difficult to solve the equation.&lt;/p&gt;&#xA;" OwnerUserId="15771" LastEditorUserId="15771" LastEditDate="2015-04-11T22:09:47.397" LastActivityDate="2015-05-13T16:34:48.540" Title="Stationary distribution for square root process" Tags="&lt;stochastic-processes&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17346" PostTypeId="1" AcceptedAnswerId="17347" CreationDate="2015-04-11T15:17:08.680" Score="2" ViewCount="35" Body="&lt;p&gt;in &lt;a href=&quot;https://www.quantnet.com/attachments/stochastic_calculus_for_finance__vol__i_and_ii__solution-pdf.1802/&quot; rel=&quot;nofollow&quot;&gt;a solution&lt;/a&gt; to a question about random walks (5.3 i), Part of the answer includes the identity:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\ln \frac{1+\sqrt{1-4 pq}}{2p}=\ln\frac{1-p}{p}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;note that $p+q=1$ and $0&amp;lt;p&amp;lt;1/2&amp;lt;q&amp;lt;1$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;this does not seem true to me, even when I restrict the values of $p,q$ appropriately. What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="5361" LastActivityDate="2015-04-11T16:07:05.620" Title="Identity given in Shreve volume 1" Tags="&lt;random-walk&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17347" PostTypeId="2" ParentId="17346" CreationDate="2015-04-11T16:07:05.620" Score="3" Body="&lt;p&gt;Using $q = 1-p$ we can work out the root as:&#xA;$$\sqrt{1-4pq} = \sqrt{1-4p(1-p)} = \sqrt{1-4p+4p^2} = \sqrt{(1-2p)^2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking the positive root reduces this to $(1-2p)$. This gives for the fraction:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{1 + \sqrt{1-4pq}}{2p} = \frac{1 + (1-2p)}{2p} = \frac{1-p}{p}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This also holds inside the logarithm.&lt;/p&gt;&#xA;" OwnerUserId="3371" LastActivityDate="2015-04-11T16:07:05.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17348" PostTypeId="1" CreationDate="2015-04-11T17:16:31.240" Score="2" ViewCount="195" Body="&lt;p&gt;There exist multiple techniques to determine call option prices that make use of the characteristic function. These techniques boil down to some integral expression of the option price in terms of the characteristic function. A popular approach uses the Fast Fourier Transform, see &lt;a href=&quot;http://www.math.nyu.edu/research/carrp/papers/pdf/jcfpub.pdf&quot; rel=&quot;nofollow&quot;&gt;Carr and Madan, 1999&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most literature out there revolves around applying these techniques to equity models, such as the Heston model. I'm interested in applying it to the interest-rate models, such as Hull-White.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, the results obtained by Carr and Madan are not as relevant in the the IR world, since here the most liquid options are Swaptions. These are like Call Options on the Swap Rate. But most IR models do not model the Swap Rate directly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suppose therefore that what we need is an expression for the characteristic function with respect to the Swap Rate. But I haven't found any literature on this; the few papers I found focus on the characteristic function of the (integrated) short rate (i.e. Zero Coupons Bonds). I suppose you can apply these to Interest Rate Caps, but not simply to Swaptions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any good references that apply the characteristic-function approach to the interest rate world? Does there exist an expression for the price of a Swaption in terms of a characteristic function?&lt;/p&gt;&#xA;" OwnerUserId="3371" LastEditorUserId="3371" LastEditDate="2015-04-11T18:53:41.007" LastActivityDate="2015-04-11T20:12:37.860" Title="Determining swaption prices using the characteristic function" Tags="&lt;option-pricing&gt;&lt;interest-rates&gt;&lt;swaption&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17349" PostTypeId="1" AcceptedAnswerId="33208" CreationDate="2015-04-11T18:19:43.883" Score="2" ViewCount="847" Body="&lt;p&gt;On page 21 of &lt;a href=&quot;http://www.cims.nyu.edu/~almgren/papers/costestim.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.cims.nyu.edu/~almgren/papers/costestim.pdf&lt;/a&gt; Almgren has the formula&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\displaystyle{\text{Slippage} = \frac{1}{2}\gamma\sigma\frac{X}{V}\left(\frac{\Theta}{V}\right)^{\frac{1}{4}} + \text{sign}(X)\eta\sigma\left|\frac{X}{VT}\right|^{\frac{3}{5}}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\gamma = 0.314$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma \text{ is volatility}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X \text{ is the trade size}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V \text{ is the 10-day average volume}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Theta \text{ is the shares outstanding}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\eta = 0.142$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$T = \text{fraction of day in which trade is placed}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the paper [page 11], Almgren says $\sigma$ is an &quot;an intraday estimator&#xA;that makes use of every transaction in the day.&quot; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have an idea of how this estimator works?&#xA;I'm using a 40 day moving standard deviation of daily returns in my simulations, since I don't have intraday data. Do you think this provides an overestimate or underestimate of the appropriate volatility in the slippage formula?&lt;/p&gt;&#xA;" OwnerUserId="7769" LastEditorUserId="7769" LastEditDate="2015-04-11T19:26:22.693" LastActivityDate="2017-03-27T20:41:02.673" Title="Intraday versus daily volatility in slippage estimation" Tags="&lt;liquidity&gt;&lt;transaction-costs&gt;&lt;slippage&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17350" PostTypeId="1" CreationDate="2015-04-11T18:34:58.177" Score="1" ViewCount="64" Body="&lt;p&gt;I'm trying to find the fee and rebate structure of these 4 exchanges during year 2011, in the specific, I'm interested in the cost of posting a hidden Limit Order, in the cost of removing a visible Limit Order and in the rebate from posting a visible Limit Order. I have found some of these in some old SEC filings but I cannot find much: any advice?&lt;/p&gt;&#xA;" OwnerUserId="11874" LastActivityDate="2015-04-11T18:34:58.177" Title="EDGX, EDGA, Nasdaq and Bats-Z Pricing in 2011" Tags="&lt;equities&gt;&lt;exchange&gt;&lt;fees&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17351" PostTypeId="2" ParentId="17348" CreationDate="2015-04-11T20:12:37.860" Score="2" Body="&lt;p&gt;Pricing via characteristic functions arises naturally in models that involve Levy processes. Therefore I can see how Black's formula for swaptions can be generalized for Levy dynamics:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;As in Black's model take the annuity as numeraire, and define the relevant measure $Q$&lt;/li&gt;&#xA;&lt;li&gt;Black assumes that under this measure the swap rate is martingale GBM, that is to say&#xA;$$dS = \sigma S dW \text{, or that }d\log S= -\sigma^2/2+\sigma dW$$ &#xA;You can assume instead that log-swap is a Levy process with the appropriate compensator&lt;/li&gt;&#xA;&lt;li&gt;This should lead to swaption pricing via characteristic function&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;(As a matter of fact, you could calculate Black's formula via cf if you really wanted to.)&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2015-04-11T20:12:37.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17352" PostTypeId="1" CreationDate="2015-04-11T21:12:40.643" Score="1" ViewCount="129" Body="&lt;p&gt;How would one calculate the minimum implied volatility increase necessary to offset theta decay?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IV is typically a percentage, while theta is a dollar value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In theory I think I could look at what the theta is, add (instead of subtract) that value to the current theoretical option price and find out what the IV of that new option value would be&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but I was wondering if others had a way to get this same information&lt;/p&gt;&#xA;" OwnerUserId="1453" LastActivityDate="2015-04-11T21:12:40.643" Title="Calculate minimum IV increase to offset theta" Tags="&lt;options&gt;&lt;implied-volatility&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17353" PostTypeId="1" AcceptedAnswerId="17354" CreationDate="2015-04-11T23:02:10.050" Score="0" ViewCount="140" Body="&lt;p&gt;Let's have a project where we invest 1000 at the beginning of year 1 and 1000 at the beginning of year 2. At the end of year 2 the income is 2200 and the project is closed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Person A discounted with 5%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Person B discounted with 10%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I want to calculate the present value and net present value for both of them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Person A: $PV = \frac{2200}{1.05^2} = 1995.46$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Person A: $NPV =$ Present value of the income - investments $= 1995,46 - (1000 + 1000) = -4.54$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Person B: $PV = \frac{2200}{1.10^2} = 1818.18$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Person B: $NPV = 1818.18 - (1000 + 1000) = -181.82$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this correct? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a part of a multiple choice question where is no option that the (N)PV of both is positive or negative at the same time. So I guess something is wrong.&lt;/p&gt;&#xA;" OwnerUserId="15894" LastActivityDate="2020-11-08T18:02:02.567" Title="Compute the (Net) Present Value" Tags="&lt;finance&gt;&lt;investment&gt;&lt;present-value&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17354" PostTypeId="2" ParentId="17353" CreationDate="2015-04-11T23:42:44.893" Score="2" Body="&lt;p&gt;No, it's not correct. The 1000 you invest at the beginning of the second year should also be discounted, That 1000 also has a present value. This gives:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$NPV = \frac{2200}{(1+R)^2} - \frac{1000}{(1+R)} - 1000$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $R$ the annual rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remember, you cannot simply add incoming or outgoing cash flows that occur at different times. &lt;/p&gt;&#xA;" OwnerUserId="3371" LastActivityDate="2015-04-11T23:42:44.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17355" PostTypeId="2" ParentId="17344" CreationDate="2015-04-12T08:41:06.340" Score="0" Body="&lt;p&gt;try to calculate the moment generating function and show that it correspond to the one of a beta distributed random variable&lt;/p&gt;&#xA;" OwnerUserId="6640" LastActivityDate="2015-04-12T08:41:06.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17356" PostTypeId="1" AcceptedAnswerId="17357" CreationDate="2015-04-12T09:21:46.300" Score="2" ViewCount="138" Body="&lt;p&gt;Let's say I know the price of a call for two different values of strike. Is there a quick way to guess the price for another value of strike ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually, I know that C(100)=15 and C(90)=20 and I have to guess the value of C(80).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that C(K) is a convex function of K. Hence we deduce that C(80) $\geq$ 25.&#xA;Is it possible to find an upper bound for C(80) ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="15435" LastActivityDate="2015-04-12T15:35:19.720" Title="Quick way to extrapolate call price as function of strike" Tags="&lt;price&gt;&lt;call&gt;&lt;convexity&gt;&lt;extrapolation&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17357" PostTypeId="2" ParentId="17356" CreationDate="2015-04-12T15:35:19.720" Score="2" Body="&lt;p&gt;The upper bound for the 80 call is C(90) + 10, or 30. At least assuming no arbitrage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's start by assuming the risk-free rate is 0 (this isn't a problem, but the math is clearer without it), so we don't have to discount the price. Then, the call price is given by $C(K) = E_t[(S_T - K)^+]$, which gives:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{array}&#xA;$C(K - 10) &amp;amp;= E_t[max(S_T - (K - 10), 0)] \\&#xA;&amp;amp;= E_t[max(S_T - K + 10, 0)] \\&#xA;&amp;amp;\leq E_t[max(S_T - K, 0) + 10] = E_t[max(S_T - K, 0)] + 10 \\&#xA;\end{array}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Replacing K with 90, we get: &#xA;\begin{array}&#xA;$C(90 - 10) &amp;amp;\leq E_t[max(S_T - 90, 0)] + 10 \\&#xA;C(80) &amp;amp;\leq C(90) + 10 = 30 \\&#xA;\end{array}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously, given a positive risk-free rate, the upper bound would be smaller, by discounting the 10\$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way to see this is that the most one can earn over and above the 90\$ call with an 80\$ call is 10\$, with probability at most 1 (only the case if the 90\$ call has probability 1 of finishing ITM).&lt;/p&gt;&#xA;" OwnerUserId="15336" LastActivityDate="2015-04-12T15:35:19.720" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17362" PostTypeId="1" CreationDate="2015-04-13T09:59:40.603" Score="1" ViewCount="99" Body="&lt;p&gt;The question pertains to a simple phenomenon. &#xA;There is gold futures listed on Exchange A and Exchange B. &#xA;Exchange A and Exchange B overlap times with A and B starting 8 hours later  and A and B closing together.&lt;br&gt;&#xA;On Exchange A, it trades for 8 hours. &#xA;On Exchange B, it trades for 16 hours. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I calculate hourly returns for both exchanges. &#xA;Since this is Gold Futures, they are highly correlated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus Sum of hourly returns on B is greater than Sum of hourly returns on A. &#xA;However Daily returns of Close-Close of both A and B are same. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If i extrapolate Daily returns to Annually, then sqrt(252)* Daily Returns shall give us the Annualized Returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do i resolve the hourly and daily returns dilemma?&lt;/p&gt;&#xA;" OwnerUserId="3053" LastEditorUserId="3053" LastEditDate="2015-04-14T16:30:29.740" LastActivityDate="2015-04-14T16:30:29.740" Title="Calculating Asset Returns" Tags="&lt;quant-trading-strategies&gt;&lt;market-data&gt;&lt;returns&gt;&lt;price&gt;&lt;log-returns&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17363" PostTypeId="1" AcceptedAnswerId="17391" CreationDate="2015-04-13T10:06:14.703" Score="3" ViewCount="226" Body="&lt;p&gt;I'm writing a PhD thesis and I am using terminology such as &lt;strong&gt;maximum drawdown&lt;/strong&gt;, &lt;strong&gt;maximum drawdown duration&lt;/strong&gt;, &lt;strong&gt;lookahead bias&lt;/strong&gt;, and &lt;strong&gt;survivorship bias&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although I understand what these are, and they are documented well (on Investopedia, Wikipedia, and StackExcange for example) -- is there someone who I should cite and give credit to for these ideas?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Failing that, is there a respected finance book that I can cite for which I could point an interested reader to find out more about these concepts?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks&lt;/p&gt;&#xA;" OwnerUserId="6661" LastEditorUserId="6661" LastEditDate="2015-04-15T08:56:46.340" LastActivityDate="2015-04-16T08:20:12.893" Title="Reference for drawdown, look ahead bias and survivorship bias" Tags="&lt;research&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17364" PostTypeId="1" CreationDate="2015-04-13T13:35:50.343" Score="4" ViewCount="2706" Body="&lt;p&gt;I am currently trying to construct volatility surface from american option prices (using Cox-Ross-Rubinstein tree) in Python 2.7. Below you can find the code I came up with. Any corrections would be welcome, however my biggest issue is performance. Single implied vol takes around 0.03 seconds to calculate. I guess that is because of the loops I use for moving backwards on the tree. Does anybody have an idea how to redesign the code to avoid looping for every step on the tree?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import numpy as np&#xA;from scipy.optimize import newton&#xA;&#xA;# test parameters&#xA;&#xA;n_steps=200    #number of steps&#xA;time=2.0    #time to maturity&#xA;strike=100.0    # strike price&#xA;price=102.0     # current stock price&#xA;time_step=float(time/n_steps) #length of a time step&#xA;&#xA;R=0.05    #interest rate&#xA;D=0.02    #dividend yield&#xA;df_base=[1.0]    #discount factor for Today e.g. DF(TOday,Today)&#xA;df_base.extend([np.exp(-R*time_step)]*n_steps)&#xA;DFs=np.cumprod(df_base)    #vector of discount factors for all the steps&#xA;&#xA;&#xA;forwards=price*np.cumprod([np.exp((R-D)*time_step)]*n_steps)    # final version will make it possible to enter a vector of forward prices&#xA;&#xA;call_price=17.3285914343&#xA;put_price=10.5343901817  &#xA;&#xA;# end of test parameters&#xA;&#xA;def AmerImpliedVol(opt_price, price, forwards, strike, time,DFs,callPutInd=1.,n_steps=200,scale=1.):&#xA;    time_step=float(time/n_steps)&#xA;    time_sqrt=np.sqrt(time_step)&#xA;&#xA;    horizontal=np.array(xrange(0,n_steps+1),dtype='float64')&#xA;    horizontal.shape=(1,n_steps+1)&#xA;&#xA;    vertical=np.array(xrange(0,-2*n_steps-2,-2),dtype='float64')&#xA;    vertical.shape=(n_steps+1,1)&#xA;&#xA;    forwards_previous=[price]&#xA;    forwards_previous.extend(forwards[:-1])&#xA;    exp_drift=np.array(forwards)/np.array(forwards_previous)&#xA;&#xA;    step_DFs=np.array(DFs[1:])/np.array(DFs[:-1])&#xA;&#xA;    tree_template=vertical+horizontal&#xA;&#xA;    #vol=0.25&#xA;    def step_price(vol):&#xA;        power_vol=np.exp(vol*time_sqrt)&#xA;        down=1/power_vol&#xA;        p_up=(exp_drift-down)/(power_vol-down)&#xA;        p_down=1.-p_up&#xA;&#xA;        tree=np.power(power_vol,tree_template)*price&#xA;&#xA;        cp=callPutInd&#xA;        def payoff(values):&#xA;            return np.maximum(cp*(values-strike),0.)&#xA;&#xA;        payoffs=payoff(tree[:,n_steps])&#xA;        current=payoffs&#xA;&#xA;        for i in xrange(n_steps,0,-1):&#xA;            after_step=step_DFs[i-1]*(p_up[i-1]*current[:n_steps]+p_down[i-1]*current[1:])&#xA;            payoffs=payoff(tree[:,i-1])&#xA;            current[:-1]=np.maximum(after_step,payoffs[:-1])&#xA;            #current[:-1]=after_step&#xA;&#xA;        return scale*current[0]-opt_price&#xA;&#xA;    #return brentq(step_price,0.01,10.0,rtol=1.0e-8, maxiter=50)&#xA;    return newton(step_price,0.3)&#xA;&#xA;print AmerImpliedVol(put_price,price,forwards,strike,time,DFs,-1.)&#xA;print AmerImpliedVol(call_price,price,forwards,strike,time,DFs,1.)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For European options simple implied volatility procedure (almost no optimization) takes around 0.0014 s per option. I understand that implying vols from american option prices is slower but a factor of 20 seems large.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I fine-tuned code a little bit:&lt;br&gt;&#xA;- I removed computationally intensive power function and replaced it with numpy cumprod&lt;br&gt;&#xA;- I took payoff calculations outside of the loop&lt;br&gt;&#xA;- I decreased accuracy to 0.5e-04, as higher accuracy could be considered noise&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now it takes around 0.015s per option.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def AmerImpliedVol2(opt_price, price, forwards, strike, time,DFs,callPutInd=1.,n_steps=200,scale=1.):&#xA;    time_step=float(time/n_steps)&#xA;    time_sqrt=np.sqrt(time_step)&#xA;&#xA;    forwards_previous=[price]&#xA;    forwards_previous.extend(forwards[:-1])&#xA;    exp_drift=np.array(forwards)/np.array(forwards_previous)&#xA;&#xA;    step_DFs=np.array(DFs[1:])/np.array(DFs[:-1])&#xA;&#xA;    tree_template=vertical+horizontal&#xA;&#xA;    #vol=0.25&#xA;    def step_price(vol):&#xA;        power_vol=np.exp(vol*time_sqrt)&#xA;        down=1/power_vol&#xA;        p_up=(exp_drift-down)/(power_vol-down)&#xA;        p_down=1.-p_up&#xA;&#xA;        horizontal=np.ones(shape=(1,n_steps+1))*power_vol&#xA;        horizontal[0,0]=1.&#xA;        horizontal=np.cumprod(horizontal,axis=1)&#xA;&#xA;        vertical=np.ones(shape=(n_steps+1,1))/(power_vol*power_vol)&#xA;        vertical[0,0]=1.&#xA;        vertical=np.cumprod(vertical,axis=0)&#xA;&#xA;        tree=price*(vertical*horizontal)&#xA;&#xA;        cp=callPutInd&#xA;        def payoff(values):&#xA;            return np.maximum(cp*(values-strike),0.)&#xA;&#xA;        payoffs=payoff(tree)&#xA;        del tree&#xA;        current=payoffs[:,n_steps]&#xA;&#xA;        for i in xrange(n_steps,0,-1):&#xA;            after_step=step_DFs[i-1]*(p_up[i-1]*current[:i]+p_down[i-1]*current[1:])&#xA;            current=np.maximum(after_step,payoffs[:i,i-1])&#xA;            #print current&#xA;            #current[:-1]=after_step&#xA;&#xA;        return scale*current[0]-opt_price&#xA;&#xA;    seed=0.3&#xA;&#xA;    return newton(step_price,seed,tol=0.5e-04)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="15916" LastEditorUserId="15916" LastEditDate="2015-04-15T11:33:13.063" LastActivityDate="2017-06-10T01:15:51.410" Title="Implied volatility from American options using python" Tags="&lt;implied-volatility&gt;&lt;american-options&gt;&lt;python&gt;&lt;lattice&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17365" PostTypeId="1" AcceptedAnswerId="17407" CreationDate="2015-04-13T15:12:48.620" Score="2" ViewCount="879" Body="&lt;p&gt;The solution of the Black-scholes equation is the price of a European call. And the option price assumes the underlying stock is a geometric Brownian motion with volatility $\sigma_{1}&amp;gt;0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose, however, the underlying asset is really a geometric Brownian motion with volatility $\sigma_{2} &amp;gt; \sigma_{1}$, i.e.&#xA;\begin{equation}&#xA;dS(t) = \alpha S(t)dt + \sigma_{2}S(t)dW(t).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consequently, the market price of the call is incorrect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can we set up a portfolio which has an arbitrage opportunity in the market? Furthermore, if there any methods to generate a portfolio arbitrage opportunity (how to consider this problem)?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Inspired by AFK, I try to answer this question by myself in mathematical way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Firstly, the main idea of generating the portfolio with arbitrage opportunity is to buy a call option and at $\sigma_{1}$, and sell a call priced at $\sigma_{2}$. i.e.&#xA;\begin{equation}&#xA;X(t) = c(t,S(t)) - c^{\sigma_{2}}(t,S(t))&#xA;\end{equation}&#xA;where $X(t)$ denote the value of portfolio, $c(t,S(t))$ is the value of the option at time $t$, and $c^{\sigma_{2}}$ is the value of the option priced in $\sigma_{2}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually, $c^{\sigma_{2}}$ was not exit in the market, but it doesn't matter since you can replicate it by hedging, which means,&#xA;\begin{equation}&#xA;X(t) = c(t,S(t)) - c_{x}(t,S(t))S(t) - \Gamma(t)M(t)&#xA;\end{equation}&#xA;Now, we want to show that X(t) has arbitrage opportunity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is trivial to see that X(0) = 0, then we want to show that dX(t) &gt; 0 (Actually, we finally prove that de^{-rt}X(t) &gt; 0). &#xA;By Ito formula, we find that&#xA;$$&#xA;dc(t,S(t)) = c_{t}dt + c_{x}dS(t) + 1/2c_{xx}d[S,S](t)&#xA;$$&#xA;and&#xA;$$&#xA;dX(t) = dc(t,S(t)) - c_{x}dS(t) - r(c - X(t) -c_{x}S(t))dt.&#xA;$$&#xA;Then, substitute dc into this equation, we get&#xA;$$&#xA;dX(t) = (c_{t}+1/2c_{xx}\sigma_{2}^{2}S(t)^{2}-rc+rc_{x}S(t))dt + rX(t)&#xA;$$ &#xA;Note that c(t,S(t)) follows the Black-scholes equation with $\sigma_{1}$, so we have&#xA;$$&#xA;dX(t) - rX(t) = (c_{t}+1/2c_{xx}\sigma_{1}^{2}S(t)^{2}-rc+rc_{x}S(t))dt + 1/2c_{xx}(\sigma_{2}^{2} - \sigma_{1}^{2})S(t)^{2}dt &#xA;$$&#xA;i.e.&#xA;$$&#xA;de^{-rt}X(t) = 1/2c_{xx}(\sigma_{2}^{2} - \sigma_{1}^{2})S(t)^{2}dt &#xA;$$&#xA;It is always positive ($\sigma_{2}&amp;gt;\sigma{1}$, and $c_{xx}&amp;gt;0$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In summary, X(t) is a portfolio with X(0) = 0, and de^{-rt}X(t) is always positive, s.t. it has arbitrage opportunity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If any problem in my idea and my proof, please let me know.&lt;/p&gt;&#xA;" OwnerUserId="15919" LastEditorUserId="15919" LastEditDate="2015-04-24T04:56:27.560" LastActivityDate="2015-04-24T04:56:27.560" Title="Method for finding a arbitrage opportunity when market price of call is incorrect" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;arbitrage&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17366" PostTypeId="1" CreationDate="2015-04-13T22:42:39.487" Score="2" ViewCount="323" Body="&lt;p&gt;Why are both of these formulas returning 1?  One of them should be 3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;=YEARFRAC(DATE(2015,2,27),DATE(2015,2,28),0)*360&#xA;=YEARFRAC(DATE(2015,2,28),DATE(2015,3,1),0)*360&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on every description of 30U/360 that I can find, the first formula should return 3.  But even if it were the second one, I could deal with that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using Excel 2010 14.0.7128.5000 fwiw&lt;/p&gt;&#xA;" OwnerUserId="15923" LastActivityDate="2015-10-26T05:28:13.350" Title="excel yearfrac 30u/360 across feb month end" Tags="&lt;excel&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17367" PostTypeId="1" CreationDate="2015-04-14T08:38:13.323" Score="12" ViewCount="9125" Body="&lt;p&gt;Intuitively, a stationary stochastic process needs to be mean-reverting. This should follow immediately from the definition of stationarity: the mean of the process needs to be constant over time, so when the process deviates from the mean, it should go back to it sooner or later.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this reasoning correct? How can one prove it formally?&lt;/p&gt;&#xA;" OwnerUserId="13556" LastActivityDate="2015-05-06T14:54:16.410" Title="Is a stationary process necessarily mean-reverting?" Tags="&lt;time-series&gt;&lt;stochastic-processes&gt;&lt;stationarity&gt;&lt;mean-reversion&gt;" AnswerCount="4" CommentCount="4" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="17368" PostTypeId="2" ParentId="17341" CreationDate="2015-04-14T08:44:15.527" Score="4" Body="&lt;p&gt;I'm not sure if you are looking for the components only or if you want more data, like the weights in the index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, unlike most other data on the web, it's hard to get any good financial data for free. The only easy way is to pay for accessing it through a financial data provider such as Bloomberg (with MEMB function when you select an index).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the S&amp;amp;P500, I found this website, where it's a lot cheaper than Bloomberg (USD3 vs USD24000) :&#xA;&lt;a href=&quot;http://www.daytradingbias.com/?page_id=105159&quot; rel=&quot;nofollow&quot;&gt;http://www.daytradingbias.com/?page_id=105159&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the CAC40 you are lucky, I found this website where it's free (I hope you have some knowledge of French), but there is no more data than the dates and names of components :&#xA;&lt;a href=&quot;http://www.bnains.org/archives/histocac/histocac.htm&quot; rel=&quot;nofollow&quot;&gt;http://www.bnains.org/archives/histocac/histocac.htm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But free (or cheap) data actually come at a price: I do not guarantee data correctness (actually I'm pretty sure there are some errors, by looking at their building methods).&lt;/p&gt;&#xA;" OwnerUserId="15650" LastEditorUserId="15650" LastEditDate="2015-04-14T13:00:05.713" LastActivityDate="2015-04-14T13:00:05.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17369" PostTypeId="2" ParentId="17232" CreationDate="2015-04-14T12:15:49.757" Score="2" Body="&lt;p&gt;Your link refers to a paper that compares the Standard Formula (prescribed approach to SII calculations) and Internal Models (where companies apply to use their own approach for deriving capital requirements).  It is an old paper (2009).  My suggestion would be to start by taking a look at the latest &lt;a href=&quot;https://eiopa.europa.eu/Publications/Standards/A_-_Technical_Specification_for_the_Preparatory_Phase__Part_I_disclaimer.pdf&quot; rel=&quot;nofollow&quot;&gt;Technical Specs&lt;/a&gt; (30th April 2014) and navigate any additional papers of interest as per this &lt;a href=&quot;http://www.solvencyiiwire.com/solvency-ii-news-guide-eiopa-website/1582591&quot; rel=&quot;nofollow&quot;&gt;guide&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5883" LastActivityDate="2015-04-14T12:15:49.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17370" PostTypeId="2" ParentId="17341" CreationDate="2015-04-14T14:05:36.367" Score="0" Body="&lt;p&gt;You can try Quandl. They have a nice API to R and Python which you can use to do the data-wrangling.&lt;/p&gt;&#xA;" OwnerUserId="13415" LastActivityDate="2015-04-14T14:05:36.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17371" PostTypeId="1" AcceptedAnswerId="17379" CreationDate="2015-04-14T16:25:20.080" Score="3" ViewCount="4860" Body="&lt;p&gt;I am using IBPy to get the positions of my portfolio. I understand that I can do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;from ib.opt import ibConnection&#xA;tws = ibConnection( host = 'localhost',port= 7496, clientId = 123)&#xA;tws.reqAccountUpdates(True,'accountnumber')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then I am supposed to use &lt;code&gt;updatePortfolio()&lt;/code&gt; in some way, but I don't know how.&lt;/p&gt;&#xA;" OwnerUserId="15285" LastEditorUserId="8164" LastEditDate="2020-05-03T20:57:07.853" LastActivityDate="2020-05-03T20:57:07.853" Title="How to get positions of your portfolio from Interactive Brokers with python IBPy?" Tags="&lt;programming&gt;&lt;interactive-brokers&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="17372" PostTypeId="1" CreationDate="2015-04-14T16:31:11.083" Score="2" ViewCount="420" Body="&lt;p&gt;I was wondering it is possible to get into a quant role without a masters or a PhD. And if so, what are the steps to do so? The only resources I've really been able to find speaking to this on quantstart.com. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just a little bit about me I am a Quantitative Economics major with a minor in Math, Stats, and Actuarial Science. I have passed two actuary exams and my senior project is on application of jump diffusion processes to  derivative pricing &lt;/p&gt;&#xA;" OwnerUserId="11756" LastActivityDate="2015-04-14T16:31:11.083" Title="Getting Into Quant Field without Phd or Masters" Tags="&lt;quants&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ClosedDate="2015-04-14T18:35:31.700" ContentLicense="CC BY-SA 3.0" />
  <row Id="17373" PostTypeId="1" CreationDate="2015-04-14T18:20:31.113" Score="1" ViewCount="140" Body="&lt;p&gt;I'm reading a &lt;a href=&quot;https://doc.research-and-analytics.csfb.com/docView?language=ENG&amp;amp;format=PDF&amp;amp;document_id=1001969281&amp;amp;source_id=emcmt&amp;amp;serialid=Coz8ZUCgL92gmMydSBULHAsCBlmogDBprg0kSAhRLCk%3D&quot; rel=&quot;nofollow&quot; title=&quot;Credit Suisse Research Report&quot;&gt;Credit Suisse Research Report&lt;/a&gt; on PCA. &#xA;The report says that to preprocess the data, you should &quot;Centre data (and normalize when considering CDS data).&quot; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why would you only normalize data for CDS, and not for other products?&lt;/p&gt;&#xA;" OwnerUserId="5251" LastActivityDate="2015-04-15T13:00:07.073" Title="Why normalize only data for CDSs for PCA?" Tags="&lt;risk&gt;&lt;var&gt;&lt;pca&gt;&lt;cds&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17374" PostTypeId="1" AcceptedAnswerId="17383" CreationDate="2015-04-14T20:27:55.843" Score="0" ViewCount="378" Body="&lt;p&gt;I have a historical data set containing only options on gold futures. If I print out a unique list of option symbols I get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;GC, L01, L02, L03, L04, L05, L06, L07, L08, L09, L10, L11, L12, L13, L14, L15, L16, L17, L18, L19, L20, L21, L22, L23, L24, L25, L26, L27, L28, L29, L30, L31, OG1, OG2, OG3, OG4, OG5.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the CME contract spec they only list two option types, &lt;a href=&quot;http://www.cmegroup.com/trading/metals/precious/gold_contractSpecs_options.html?optionProductId=7488#optionProductId=192&quot; rel=&quot;nofollow&quot;&gt;American Options&lt;/a&gt; with symbol GC, and &lt;a href=&quot;http://www.cmegroup.com/trading/metals/precious/gold_contractSpecs_options.html?optionProductId=7488#optionProductId=7488&quot; rel=&quot;nofollow&quot;&gt;weekly options&lt;/a&gt; with symbols OG1 thru OG5.&#xA;My question is what are the other symbols L01 thru L31?&lt;/p&gt;&#xA;" OwnerUserId="1764" LastActivityDate="2015-04-15T15:26:22.443" Title="Symbols for options on gold futures" Tags="&lt;options&gt;&lt;cme&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17378" PostTypeId="2" ParentId="17341" CreationDate="2015-04-15T09:07:03.003" Score="1" Body="&lt;p&gt;As you said yourself, Yahoo finance provides the historical stock data. The only thing left is to know the historical composition of the CAC40. This information can be extracted from the french &lt;a href=&quot;http://fr.wikipedia.org/wiki/CAC_40#Historique_de_la_composition&quot; rel=&quot;nofollow&quot;&gt;wikipedia site about the CAC40&lt;/a&gt;, or from the source @jean-paul-sartre mentioned. In my answer I will concentrate on how to scrap the information. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some time ago I wrote a &lt;code&gt;R&lt;/code&gt;function to scrap information from wikipedia tables. Using the &lt;code&gt;R-package RCurl&lt;/code&gt; one has to specify the URL of the wikipedia website and a number $n$ which table to scrap. I download the sourcecode by&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x &amp;lt;- getURL(url=&quot;http://fr.wikipedia.org/wiki/CAC_40&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and with the help of &lt;code&gt;gregexpr&lt;/code&gt; I search for &lt;code&gt;&amp;lt;table&lt;/code&gt; and &lt;code&gt;&amp;lt;/table&amp;gt;&lt;/code&gt;, take the $n$-th table. Then I iterate over &lt;code&gt;&amp;lt;tr&amp;gt;&lt;/code&gt; cells, get the heading from &lt;code&gt;&amp;lt;th&amp;gt;&lt;/code&gt; and the actual content from &lt;code&gt;&amp;lt;td&amp;gt;&lt;/code&gt; cells. Sometimes one has to tidy up a bit. Scraping the two tables from wikipedia, combining them and extracting the historical development of the CAC40 constituents is now straightforward. &lt;/p&gt;&#xA;" OwnerUserId="6980" LastEditorUserId="6980" LastEditDate="2015-04-15T09:18:53.323" LastActivityDate="2015-04-15T09:18:53.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17379" PostTypeId="2" ParentId="17371" CreationDate="2015-04-15T10:59:33.147" Score="3" Body="&lt;p&gt;The IB API calls your code asynchronously when there are account updates after you have called reqAccountUpdates. But you have to provide a callback function (handler) for the IB API to call.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looks like from the [ibPy documentation example]&#xA;(&lt;a href=&quot;https://code.google.com/p/ibpy/wiki/IbPyOptional&quot; rel=&quot;nofollow&quot;&gt;https://code.google.com/p/ibpy/wiki/IbPyOptional&lt;/a&gt;)&#xA;and how the &lt;a href=&quot;https://www.interactivebrokers.com/en/software/api/api.htm&quot; rel=&quot;nofollow&quot;&gt;Java IB API&lt;/a&gt;&#xA;is defined, you want to call &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;tws.register(your_update_portfolio_handler,message.updatePortfolio)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where your_update_handler is a function you define to handle account updates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You probably need to look through the ibPy code to confirm 'updatePortfolio' is indeed what should be passed to tws.register.&lt;/p&gt;&#xA;" OwnerUserId="4716" LastEditorUserId="15285" LastEditDate="2015-04-16T10:09:49.600" LastActivityDate="2015-04-16T10:09:49.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17380" PostTypeId="2" ParentId="17373" CreationDate="2015-04-15T13:00:07.073" Score="1" Body="&lt;p&gt;The choice of normalization depends on your data set: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without normalization : variable with high variance will have more impact on the PCA. You will have size effects. For exemple if you have one variable in meters and the other one in kilometers the one in meters will have way more impact. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To avoid that you can normalize but now every variable will have the same power of explnanation. Noise may have a lot of power explanation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Normalising some variable but not the others could be interpreted as a way to reduce the impact of a high variance variable without changing the order of power of explanation of the others. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By doing this, the explanation power of the normalized variable will be arbitrary changed with respect to the order of power explanation of the others variable. Plus that this hybrid pre-process is shady to non-statistician people. I think this should be concidered bad practice. &lt;/p&gt;&#xA;" OwnerUserId="5052" LastActivityDate="2015-04-15T13:00:07.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17381" PostTypeId="1" AcceptedAnswerId="17387" CreationDate="2015-04-15T14:51:20.543" Score="1" ViewCount="61" Body="&lt;p&gt;If I have a 5-year bond, which pays every six months a coupon of 2.5% with a yield of 1.5%, should I split up the yield to compute the bond price?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or is below the way to compute it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\displaystyle PV = \frac{2.5}{1.015} + \frac{2.5}{1.015^2} + ... + \frac{100 + 2.5}{1.015^{10}}$&lt;/p&gt;&#xA;" OwnerUserId="15894" LastActivityDate="2015-04-15T16:33:24.233" Title="Compute bond price with more coupon payments in a year" Tags="&lt;bond&gt;&lt;yield&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17383" PostTypeId="2" ParentId="17374" CreationDate="2015-04-15T15:26:22.443" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://www.cmegroup.com/tools-information/lookups/advisories/clearing/Chadv14-394.html?source=rss&quot; rel=&quot;nofollow&quot;&gt;http://www.cmegroup.com/tools-information/lookups/advisories/clearing/Chadv14-394.html?source=rss&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;looks like they are short term gold options that were delisted...&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2015-04-15T15:26:22.443" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17384" PostTypeId="2" ParentId="17367" CreationDate="2015-04-15T15:40:49.383" Score="5" Body="&lt;p&gt;The concept of 'mean reversion' is tricky in continuous time. Most people would call 'mean reverting' a process where the drift pulls back towards a long run mean, and I assume that this is what you also mean. Something like the drift of an OU process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in continuous time the 'pull' can be generated by the volatility. For example the process&#xA;$$&#xA;dX_t = dt+X_t^2 dW_t&#xA;$$&#xA;is stationary although the drift seems to be pushing the paths towards infinity. The first place I saw that behaviour was &lt;a href=&quot;https://www.princeton.edu/~joses/wp/short_term_int_rates.pdf&quot; rel=&quot;nofollow&quot; title=&quot;the Conley et al paper&quot;&gt;the Conley et al 1997 paper&lt;/a&gt; (bottom of pg 12).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In these processes the 'pull' is caused by the volatility, and in this example it is sufficient to overcome the drift. For general processes $X_t = \mu(X_t)+\sigma(X_t)dW_t$ this 'pull' is quantified by the scale density $$s(x)=\exp\left(-\int^x \frac{\mu(u)}{\sigma^2(u)}du\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not think that these things happen for discrete time processes.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2015-04-29T06:33:18.760" LastActivityDate="2015-04-29T06:33:18.760" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="17385" PostTypeId="1" CreationDate="2015-04-15T16:18:10.157" Score="0" ViewCount="91" Body="&lt;p&gt;Lets assume I want to normalize some stock data ( prices or log prices) to compare for different types of correlation for example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And here is the question how should I normalize:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) by subtracting common mean of prices of interest and divide it by common sd?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) or should I use individual means and sd's in this procedure?&lt;/p&gt;&#xA;" OwnerUserId="11826" LastActivityDate="2015-04-15T19:56:28.420" Title="Small question about normalization" Tags="&lt;correlation&gt;&lt;normalization&gt;" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17386" PostTypeId="1" CreationDate="2015-04-15T16:33:01.510" Score="0" ViewCount="143" Body="&lt;p&gt;I am doing my Bachelor's thesis at the moment and I ran into a problem I was hoping you could help me out with.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While running my data (in Eviews) I had relevant variables. However, when turning to a unit root test, it turned out I had a unit root problem (non stationarity, random walks). So I corrected for this using first differences and it worked to solve the unit root problem. But: now that I have these first differences, my variables stopped showing relevance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my questions are the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Is it a problem when variables to stop showing relevance to the model when applying first differences, because without these they are relevant?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If so, is there a way to solve for this?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;When applying first differences, are you supposed to do this with all variables or only with the ones who show the problem of nonstationarity? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="15937" LastActivityDate="2015-04-16T00:31:18.387" Title="Problem - stationarity and relevance" Tags="&lt;stationarity&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17387" PostTypeId="2" ParentId="17381" CreationDate="2015-04-15T16:33:24.233" Score="1" Body="&lt;p&gt;The general bond pricing formula for fixed-coupon bonds, assuming settlement on a coupon date, is as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ P = \sum_{i=1}^N \frac{c/f}{(1 + y/n)^{nt}}, $$&#xA;where $c$ is the size of the cash flow, $f$ is the coupon frequency per year, $y$ is the annualized yield, and $n$ is the compounding frequency per year.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, $c$ should be $2.5/2=1.25$. Assuming yield is also semi-annually compounded, then it should be&#xA;$$ PV = \frac{1.25}{(1 + 0.75\%)} + \frac{1.25}{(1 + 0.75\%)^2} + \cdots $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If yield is annually compounded, however, this would become&#xA;$$ PV = \frac{1.25}{(1 + 1.5\%)^{0.5}} + \frac{1.25}{(1 + 1.5\%)^1} + \cdots $$&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2015-04-15T16:33:24.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17388" PostTypeId="2" ParentId="17385" CreationDate="2015-04-15T17:17:50.480" Score="0" Body="&lt;p&gt;I would prefer choice a), however, I'd work with returns, not prices.&lt;/p&gt;&#xA;" OwnerUserId="7769" LastActivityDate="2015-04-15T17:17:50.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17389" PostTypeId="1" AcceptedAnswerId="18331" CreationDate="2015-04-15T17:27:28.433" Score="5" ViewCount="130" Body="&lt;p&gt;Given that an American option can be exercised at any time, how does one handle algorithmically shorting an American option in a back test? I am not sure what the best practice is to simulate the early exercise for selling American Options in a backtest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two approaches I can think of:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Assume that the option gets exercised if it crosses an arbitrary percent in the money.&lt;/li&gt;&#xA;&lt;li&gt;Treat the option the same way you would handle a European option.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="1764" LastEditDate="2015-06-12T16:14:11.603" LastActivityDate="2015-06-12T23:12:01.620" Title="Methodology for handling short american options in a back test" Tags="&lt;backtesting&gt;&lt;american-options&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17390" PostTypeId="2" ParentId="17385" CreationDate="2015-04-15T17:59:43.007" Score="1" Body="&lt;p&gt;The point of normalization is to put everything on the same level (i dont mean price level.) Prices are usually nonstationary, so CLT doesnt apply, while returns arent. So @siegel 's answer is correct in saying use a) with return data.&lt;/p&gt;&#xA;" OwnerUserId="13415" LastActivityDate="2015-04-15T17:59:43.007" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17391" PostTypeId="2" ParentId="17363" CreationDate="2015-04-15T18:05:27.410" Score="2" Body="&lt;p&gt;So two things a) they are commonly known. b) they are definitions. So if you define it yourself, theres no need to cite anyone. But if you lift the definition from somewhere verbatim, then you should cite that paper.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wouldnt look the wikipedia for the formal definitions, I'd try to find them in academic literature, think about the definition, see if you agree and cite the person. Failing that, I would write them myself and then theres no need for a cite.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For ex, define survivorship bias as they do:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.afajof.org/SpringboardWebApp/userfiles/afa/file/Presentation%20Slides/2013/9260.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.afajof.org/SpringboardWebApp/userfiles/afa/file/Presentation%20Slides/2013/9260.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and cite them, or define it in a way thats related to what your doing.&lt;/p&gt;&#xA;" OwnerUserId="13415" LastActivityDate="2015-04-15T18:05:27.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17392" PostTypeId="1" AcceptedAnswerId="17394" CreationDate="2015-04-15T18:13:49.567" Score="2" ViewCount="255" Body="&lt;p&gt;If I have only strike, call and put prices for European options, how do I work towards computing the continuous dividend yield?&lt;/p&gt;&#xA;" OwnerUserId="15938" LastActivityDate="2015-04-16T15:20:40.520" Title="Annual dividend yield using option prices" Tags="&lt;option-pricing&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17393" PostTypeId="2" ParentId="17367" CreationDate="2015-04-15T18:44:45.300" Score="0" Body="&lt;p&gt;Suppose we estimate the regression model&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\triangle y_{t}=\alpha + \beta y_{t-1}+\varepsilon_{t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is actually quite similar to the Dickey-Fuller test. If $\beta=0$, then the process has a unit root. Let's proceed assuming that $\beta&amp;lt;0$, i.e. that the process is stationary. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first equation is also similar to the continuous time Ornstein-Uhlenbeck process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dy_{t}=k\left(m-y_{t}\right)+\sigma dW_{t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the mean-reverting level is $m$ and the speed by which it mean-reverts is $k$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the first equation, it can be shown that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$m=-\frac{\alpha}{\beta}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So long as $\beta\neq 0$, which we already assumed, we know that it has a mean-reverting level that corresponds to the Ornstein-Uhlenbeck process.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2015-04-15T18:44:45.300" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17394" PostTypeId="2" ParentId="17392" CreationDate="2015-04-15T18:50:33.027" Score="1" Body="&lt;p&gt;Suppose you have a call/put pair with the same strike $K.$  Then a position long the call and short the put has the payoff of a forward struck at $K:$&#xA;$$C(K) - P(K) = e^{-rT} \mathbb{E}[ S(T) - K ],$$&#xA;Where $C(K)$ and $P(K)$ are the call and put price, $r$ is the interest rate, and $T$ is the time to expiry.  Then by linearity of expectation and the martingale property &#xA;$$ \mathbb{E}[ S(T) ] = e^{(r-q)T}S(0),$$&#xA;we can solve for dividend rate $q.$&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2015-04-15T18:50:33.027" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17395" PostTypeId="1" CreationDate="2015-04-15T19:15:24.867" Score="0" ViewCount="45" Body="&lt;p&gt;I need to compare two garch models, I try to do that by Value at Risk. In general, if I have an initial conditional variance, for example, h1, then I can predict the next N days conditional variance by a known garch model, whereafter, I calculate the VaR based on these conditional variance and make the comparison between two garch models, simply saying, to see how many times the daily return exceeds the VaR. My question is that: do I need to make a one day ahead predict based on the standard deviation from real data (get it by high frequency method) each time? or just make N days prediction based on the initial h1. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="15201" LastActivityDate="2015-04-15T19:15:24.867" Title="Do I need to update the standard deviation into GARCH for the next step conditional variance predict?" Tags="&lt;var&gt;" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="17396" PostTypeId="1" AcceptedAnswerId="17430" CreationDate="2015-04-15T19:33:52.563" Score="0" ViewCount="138" Body="&lt;p&gt;I am not familiar with the technicalities of order routing so my main sources of information as of now is the &lt;a href=&quot;http://www.sec.gov/investor/pubs/tradexec.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;sec gov trade execution info&lt;/strong&gt;&lt;/a&gt; and an explanation of how &lt;a href=&quot;http://www.kotaksecurities.com/faqs/smartorder.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;SOR&lt;/strong&gt;&lt;/a&gt; works.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Question 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Let's say I &lt;em&gt;buy&lt;/em&gt; shares of a stock through my broker account with a &lt;em&gt;limit&lt;/em&gt; order. The broker will then automatically fill my order upon the stock price hitting my limit. For this fill, the broker uses exchange A.&lt;/p&gt;&#xA;&lt;p&gt;Two hours later I decide to &lt;em&gt;sell&lt;/em&gt; my shares. Again, I use a limit order.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Now what is the chance that my order will be filled at exchange A again?&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Or in other words: is there any correlation between where a certain broker fills its shares. Are there any geographical biases or noticeable partnerships involved in order routing?&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;Relating to this are the &lt;code&gt;MPID&lt;/code&gt; fields that can be found on Level II depth-of-book views:&lt;/p&gt;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/ywjap.jpg&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;Here the various limit orders have a corresponding &lt;code&gt;Market Participant ID&lt;/code&gt;. These represent the names of market makers.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Question 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;If I place an order at my broker A, will this order show up under a fixed MPID on Level II?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Or in other words: can quoted limit orders on the book be tracked to their respective brokers?&lt;/p&gt;&#xA;" OwnerUserId="5447" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2015-04-19T09:44:20.960" Title="Order routing: correlation of having same exchange for buy and sell" Tags="&lt;order-execution&gt;&lt;order-handling&gt;&lt;broker&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17397" PostTypeId="2" ParentId="17386" CreationDate="2015-04-15T19:34:42.917" Score="2" Body="&lt;p&gt;Any data transformation to assure stationarity eliminates part of the signal in many cases the signal is not completely eliminated so you can still perform the required analyses but in some others as may the your case the signal is erased and the results seem to indicate your variables have lost predictible power although its predictive power may have been erroneously asserted if potential errors due to common regression effects of spurious regression serial correlation lack of linearity or additivity (for linear) or normality of the data were overlooked. therefore your problem is data dependant one. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are also requirements as to have a valid result in regression. Weak sense stationarity (WSS) is necesary to avoid spourious regression and other regression non valid results. For this you need that the 1st moment ( -a) Stationarity of variance -b) stationarity of mean and -c) and also stationarity of the autocovariance. Depending on the number of times you diferenciate the resulting data will be equivalent to (one) removing the trend, (2,3) times equal to aplying a 2 or 3 degree polynomial to the signal. Diferenciation however is only one way of solving the issue of non stationarity and it effects on regression as mentioned by the equivalent procedures. Thus you can remove the trend, apply a low degree polynomial loess regression (in accordance with the influence that you evaluate prior data have on later data). This should take care in most cases of the MA part). Then you are left with the AR and other portions of the signal. You can identify or remove AR terms by determining the AR effect on the data. (for example to remove certain colored noises)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is important is to determine what is the part of the signal you are interested in. It is important to diferenciate between deterministic and stockastic parts of the data. The deterministic part (moving average and trend) and stokastic part which includes non AR noise, AR, AR noise and other ((e.g) fractional integration).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several aspects to stationarity and there are several tests for stationarity (none of them is perfect - google &quot;R stationarity tests&quot;). Unit root tests are used to ascertain stationarity of a signal for this specific issue, however there are non staionarity issues that could affect your data such us long term memory processes which may not be asserted by the tests. In this regard higher order unit root or other non stationary producing factors such us long range dependence, fractional integration, pink noise if ignored, the system dynamics become systematic errors in regression equations and thus regression will have no meaning (e.g. changes in variance invalidating second-order stationarity)&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;All variables should be stationary both response and independant variables.  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Also to consider is to segment the data as per when changes in the variance ocurr by using change point analysis and a similar variance then  is stable across some time, this will take care of the stationarity of the variance without removing any information). Also make sure the segment is sufficient as per to have valid regression results statistically (training sample is sufficient to provide a test with valid results).  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;When the results of the regression are obtained do not forget to reverse them into the original terms (remember the regression was done on differences so your results will also be in those terms)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Check for homocedasticity, serial correlation, normality, &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Take a look at this link &lt;a href=&quot;http://www.econ.ku.dk/metrics/Econometrics2_05_II/Slides/08_unitroottests_2pp.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.econ.ku.dk/metrics/Econometrics2_05_II/Slides/08_unitroottests_2pp.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps&lt;/p&gt;&#xA;" OwnerUserId="7616" LastEditorUserId="7616" LastEditDate="2015-04-16T00:31:18.387" LastActivityDate="2015-04-16T00:31:18.387" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17398" PostTypeId="2" ParentId="17385" CreationDate="2015-04-15T19:56:28.420" Score="0" Body="&lt;p&gt;You normalize for example by having a mean of 0 and a standard deviation of 1 for the data Use in R the scale function. &lt;/p&gt;&#xA;" OwnerUserId="7616" LastActivityDate="2015-04-15T19:56:28.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17399" PostTypeId="1" AcceptedAnswerId="17456" CreationDate="2015-04-15T20:10:33.647" Score="4" ViewCount="374" Body="&lt;p&gt;When analysing T&amp;amp;S for stocks such as AAPL, I sometimes see huge trades.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These trades are in the order of 10.000 shares or more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To my knowledge, large trades are (supposed to be) executed by algorithms which subdivide the large batches into smallers trades, as to not influence (/shake) the market too much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So then why do I still see large trades appear on my feed? Do some institional investors simply try to execute if the large order sufficiently crosses the book to cause a fill? (implied by &lt;a href=&quot;https://quant.stackexchange.com/questions/1334/how-does-order-fulfillment-proceed-with-larger-orders&quot;&gt;this answer&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why wouldn't they subdivide their trades?&lt;/p&gt;&#xA;" OwnerUserId="5447" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-10-03T10:11:47.540" Title="Why do I still see large orders?" Tags="&lt;order-execution&gt;&lt;order-handling&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17401" PostTypeId="1" CreationDate="2015-04-15T20:39:38.443" Score="2" ViewCount="86" Body="&lt;p&gt;UWTI: 3x leveraged exposure to WTI&lt;/p&gt;&#xA;&#xA;&lt;p&gt;DWTI: 3x leveraged inverse exposure to WTI&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The inverse relationship between these two symbols seems to trend toward the origin on a log-log plot (using log base 2).  I'm plotting only intervals of large movement, so not all days are shown.  Green intervals are ones where UWTI goes up.  Red intervals are ones where DWTI goes down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; Why do green and red intervals have consistently different slopes that make the overall trend toward the origin (see blue arrow)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/GzUlH.png&quot; alt=&quot;Relationship between UWTI and DWTI on log-log scale&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: Large movement was determined visually, from the bottom to the top (or vice versa) of intervals of significant price change.  The days that are not represented at all in this graph had no visually significant movement. Graph is based on daily close prices.&lt;/p&gt;&#xA;" OwnerUserId="15939" LastEditorUserId="15939" LastEditDate="2015-04-15T22:20:39.283" LastActivityDate="2015-04-15T22:20:39.283" Title="Why do leveraged and inverse leveraged WTI ETNs have this price relationship?" Tags="&lt;etf&gt;&lt;price&gt;&lt;commodities&gt;&lt;leverage&gt;&lt;trends&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17404" PostTypeId="2" ParentId="17363" CreationDate="2015-04-16T08:20:12.893" Score="-2" Body="&lt;p&gt;All terminologies are common knowledge. I do not think it is good idea to cite someone. It is like using word &quot;equity&quot; and looking for someone to cite. It doesn't make sense.&lt;/p&gt;&#xA;" OwnerUserId="15878" LastActivityDate="2015-04-16T08:20:12.893" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17406" PostTypeId="1" AcceptedAnswerId="18038" CreationDate="2015-04-16T09:46:33.220" Score="5" ViewCount="5265" Body="&lt;p&gt;I am trying to get an overview of the impact on negative interest rates on financial products (in general). For the time being I distinguished the following products&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Vanilla options&lt;/li&gt;&#xA;&lt;li&gt;Exotic options&lt;/li&gt;&#xA;&lt;li&gt;Forwards&lt;/li&gt;&#xA;&lt;li&gt;Interst rate swaps&lt;/li&gt;&#xA;&lt;li&gt;Currency swaps&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For each of these I would like to pinpoint the general issues. If someone has one of these products I would immediately like to tell them, &quot;hey, have you looked at these possible issues?&quot;. For now I have seperated the issues into three categories: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Modeling issues&#xA;2) Legal issues (think of CSA contracts that are still fairly ambiguous)&#xA;3) System issues (e.g. banking systems that are not capable of implementing negative rates).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This being a forum on quantative finance, I am here to ask you about the modeling issues. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The modelling issues of which I am aware are: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;For vanilla options on the interest rate (e.g. swaptions), one frequently uses Black's formula or the SABR model. Both of these assume lognormal distributions, such that negative rates would nog be accepted. &lt;/li&gt;&#xA;&lt;li&gt;For exotic options it is common to apply numerical methods for pricing. To this end a proper interest rate model should be applied (e.g. lognormal models are no longer accepted).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I am sure that there are many more issues, would you like to help me make a more complete list? Thank you for your help!&lt;/p&gt;&#xA;" OwnerUserId="15947" LastActivityDate="2015-05-29T04:12:57.680" Title="The effect of negative interest rates on derivative pricing" Tags="&lt;interest-rates&gt;&lt;pricing&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17407" PostTypeId="2" ParentId="17365" CreationDate="2015-04-16T11:51:17.903" Score="0" Body="&lt;p&gt;I think the delta-replicating of $\sigma_2$ call is just a fancy way of saying &quot;hedging the call option bought at $\sigma_1$ volatility, with deltas based on $\sigma_2$ volatility&quot;. This is full arbitrage in case the hedging/replicating is optimal, and just a statistical arbitrage in real life. You probably do not need such sophisticated proof of why this is an arbitrage, because in case of perfect replication, you replication portfolio will earn just the fair value of the option (based on $\sigma_2$ volatility). And whenever you buy the option at lower price, you have an arbitrage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question is probably a duplicate of:&#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/11052/volatility-arbitrage-how-is-the-profit-extracted/11054#11054&quot;&gt;Volatility arbitrage - how is the profit extracted?&lt;/a&gt;&#xA;(link is to my answer, see also valuable info in comments).&lt;/p&gt;&#xA;" OwnerUserId="3120" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-04-16T11:51:17.903" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17408" PostTypeId="1" CreationDate="2015-04-16T12:03:52.230" Score="2" ViewCount="43" Body="&lt;p&gt;On reuters I charted the spread between the 10yr US bond and the 10yr UK bond. It gives the me the option of choosing the currency. For just the standard spread(ie: yield(US)-yield(UK)) you select none for currency option. You can also choose to display the spread in terms of pound. This changes the way the spread looks slightly and gives completely different values. I asked reuters support and they said that when you change the currency it performs a cross currency basis swap to the selected currency. Can anyone give any insight into what is going on here?&lt;/p&gt;&#xA;" OwnerUserId="15948" LastActivityDate="2015-04-16T12:03:52.230" Title="What does it mean to change the currency of a spread between bonds from 2 different countries?" Tags="&lt;bond&gt;&lt;spread&gt;&lt;currency&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17410" PostTypeId="2" ParentId="17392" CreationDate="2015-04-16T15:20:40.520" Score="0" Body="&lt;p&gt;Consider two different strikes $K_1$ and $K_2$. Then, for $i=1$ and $2$,&#xA;\begin{align*}&#xA;C(K_i)-P(K_i) &amp;amp;= e^{-r T}E(S_T-K)\\&#xA;&amp;amp;=e^{-qT}S_0 - e^{-rT}K_i.&#xA;\end{align*}&#xA;Now, the two unknown parameters $r$ and $q$ can be solved from the two equations. &lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-04-16T15:20:40.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17413" PostTypeId="1" CreationDate="2015-04-16T20:01:59.777" Score="0" ViewCount="54" Body="&lt;p&gt;The following represents a model for an economy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At time $t=0$, four assets have the value $X_1= £5$, $X_2=£5$, $X_3=£10$ and $X_4=£4$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Three possible states of the world exist ($\alpha_1$, $\alpha_2$ and $\alpha_3$) at time $t=1$, with this being viewed at $t=0$, and these states can occur with probabilities $p_1=0.25$, $p_2=0.5$ and $p_3=0.25$ (respectively).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In state $\alpha_1$, the values of asset at $t=1$ are $X_1=£6$, $X_2=£3$, $X_3=£12$ and $X_4=£9$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In state $\alpha_2$, the values of asset at $t=1$ are $X_1=£9$, $X_2=£6$, $X_3=£12$ and $X_4=£3$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In state $\alpha_3$, the values of asset at $t=1$ are $X_1=£12$, $X_2=£6$, $X_3=£9$ and $X_4=£3$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume it is possible to own a part of an asset but it is not possible sell an asset which you do not own.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Show that it is possible to set up a portfolio of assets at $t=0$ which will definitely have a value of $£30$ at $t=1$, no matter which state of the world occurs at time $t=1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the guaranteed profit/loss of this portfolio?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll be honest, I'm at a total lose with this topic. A point in the right direction would be great. Maybe published text or a similar solution on this website? (If one exists?). Thank you.&lt;/p&gt;&#xA;" OwnerUserId="15954" LastEditorUserId="848" LastEditDate="2015-04-20T13:34:14.727" LastActivityDate="2015-04-20T13:34:14.727" Title="Portfolio of Assets" Tags="&lt;portfolio&gt;&lt;portfolio-optimization&gt;&lt;asset-allocation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17414" PostTypeId="1" AcceptedAnswerId="17415" CreationDate="2015-04-16T21:01:37.293" Score="4" ViewCount="2430" Body="&lt;p&gt;I've been using an Excel template to calculate the Sortino ratio for my automated trading strategies. &lt;a href=&quot;http://investexcel.net/calculate-the-sortino-ratio-with-excel&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://investexcel.net/calculate-the-sortino-ratio-with-excel&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically I input my monthly returns in the return column. That's 12 months of returns for each year from 2006 to 2014.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, for one of the strategies, let's call it strat A, it had one exceptional year, which had no negative monthly returns.&#xA;So when the template tries to calculate the Sortino ratio by dividing the returns by the downside risk etc it can't do the calculation because there was no downside risk. So it's dividing by 0 which messes up the calculation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I'm wondering what to do in such a scenario?&lt;/p&gt;&#xA;" OwnerUserId="15955" LastEditorDisplayName="user13444" LastEditDate="2016-12-14T07:12:58.253" LastActivityDate="2016-12-14T07:12:58.253" Title="Sortino Ratio calculation" Tags="&lt;automated-trading&gt;&lt;sharpe-ratio&gt;&lt;trading-systems&gt;&lt;performance-evaluation&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17415" PostTypeId="2" ParentId="17414" CreationDate="2015-04-16T21:48:06.413" Score="2" Body="&lt;p&gt;Firstly, I suggest you to use more recognized source to study and compute quantitative finance model or indicators; in such case, for instance, you could take as example the following &lt;a href=&quot;http://www.sunrisecapital.com/wp-content/uploads/2014/06/Futures_Mag_Sortino_0213.pdf&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; as reference. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Precisely there, the authors describe some common errors that one can do in computing the Sortino ratio; although surely you did not do any of them, anyway it could be a good source.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As regards your question, the fact that you rightly get an error is mainly due to the way you set the target return; I suggest you to replace that value with average (median, mode, ...) return in the data sample or the benchmark index return and try to solve the issue in this way; of course, you should replace the target return with for all years.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-04-17T10:00:14.970" LastActivityDate="2015-04-17T10:00:14.970" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17416" PostTypeId="2" ParentId="9976" CreationDate="2015-04-17T00:42:12.280" Score="1" Body="&lt;p&gt;Your signal on the edges after denoising will be always altered by the boundary effect of the extension of the data which is incorporated in the reconstruction of the filter as per how wavelets are constructed (take pass and future data) the effect will be greater the longer the filter length you select as it implies more coeficients. Causal wavelets as mentioned by user2763361 will be sucesful on this however a significant amount of information will be lost as it will only account for pass history of the data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another point I wanted to make is that non stationary Wavelet denosing thresholding and similar and their mixed procedures are not very good at eliminating noise (they are brute force mechanisms). So the frequency location of your signal which will yield your signal will still be blurried.    &lt;/p&gt;&#xA;" OwnerUserId="7616" LastEditorUserId="7616" LastEditDate="2015-05-02T00:46:56.383" LastActivityDate="2015-05-02T00:46:56.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17417" PostTypeId="2" ParentId="17413" CreationDate="2015-04-17T01:59:01.627" Score="1" Body="&lt;p&gt;Usually you would solve a system of equations to get the answer to textbook problems like this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here you have 4 assets and 3 states of the world, so your system will have infinite solutions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want your asset to have exactly $ 30 of value at time 1, then just set one of the weights (3 or 4) as zero and solve the system. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise, to solve a more realistic problem, you can solve an optimization problem to maximize your expected payoff, given a $30 budget.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $ w_a, w_b, w_c, w_d$ be the amount of dollars of each asset purchased at $t_0 $ and $P_i$ the value of your portfolio in the state of the world $i\in \{1,2,3\}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ max \,\,\,  0.25 * P_{1} + 0.5 * P_{2} + 0.25 * P_{3} $$&#xA;$$ s.t. \,\,\,  5w_a+5w_b+10w_c+4w_d=30 $$&#xA;Where &#xA;$$ P_1 = 6 w_a + 3 w_b + 12 w_c + 9 w_d $$ &#xA;$$ P_2 = 9 w_a + 3 w_b + 12 w_c + 3 w_d $$ &#xA;$$ P_3 = 12 w_a + 6 w_b + 9 w_c + 3 w_d $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My guess is that the best portfolio consists entirely of $w_a$.&lt;/p&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2015-04-17T01:59:01.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17418" PostTypeId="1" CreationDate="2015-04-17T10:56:13.103" Score="2" ViewCount="564" Body="&lt;p&gt;I am currently working on the comparison of the constructed portfolios using out-of-sample variance criteria. I am going to use rolling window procedure for the comparison. First, I choose a window over which to perform estimation. Length of estimation window let say &lt;code&gt;t&lt;/code&gt; is smaller than &lt;code&gt;N&lt;/code&gt;, where &lt;code&gt;N&lt;/code&gt; is the total number of returns. I use estimation window of &lt;code&gt;t=60&lt;/code&gt; data points which correspond to 5 years for monthly data. Second, using the return data over the estimation window, &lt;code&gt;t&lt;/code&gt;, I compute various portfolios. I repeat this rolling window procedure for the next month and dropping the data for the earliest month. I continue this until the end of the dataset is reached. At the end of the this process, I will have generated &lt;code&gt;T-t&lt;/code&gt; portfolio weight vectors for each strategy. Does anyone know which package I can use for rolling window algorithm in R or matlab? Thank you for any help.&lt;/p&gt;&#xA;" OwnerUserId="15306" LastEditorUserId="2299" LastEditDate="2015-06-17T06:17:54.853" LastActivityDate="2015-06-17T06:17:54.853" Title="out-of-sample variance using rolling window" Tags="&lt;r&gt;&lt;portfolio&gt;&lt;variance&gt;&lt;bootstrap&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17419" PostTypeId="2" ParentId="17418" CreationDate="2015-04-17T11:31:59.187" Score="2" Body="&lt;p&gt;R package &lt;a href=&quot;http://cran.r-project.org/web/packages/TTR/index.html&quot; rel=&quot;nofollow&quot;&gt;TTR&lt;/a&gt; has rolling window algorithms and understands day counting etc. It stands on the shoulders of xts (which extends zoo) and quantmod&lt;/p&gt;&#xA;" OwnerUserId="4910" LastActivityDate="2015-04-17T11:31:59.187" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17420" PostTypeId="1" CreationDate="2015-04-17T14:45:15.443" Score="1" ViewCount="384" Body="&lt;p&gt;I'm optimizing a portfolio of n assets and my optimization variable is of the form&#xA;$$x = [t,w,w_L,w_S]$$&#xA;where&#xA;$$t:= \text{slack variable for turning my QP objective into SOCP constraint}$$ &#xA;$$w:=\text{n-length vector of net weights}$$&#xA;$$w_L:=\text{n-length vector of gross long positions}$$&#xA;$$w_L:=\text{n-length vector of gross short positions}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have constraints which ensure that $w = w_L - w_S$, and am controlling for maximum leverage by $w_L + w_S \le M$.  This all works perfectly well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to implement some form of fully-invested constraint.  So, I (naively) inserted a minimum leverage constraint that $w_L + w_S \ge m.$ I soon realized that my optimization is generating boxed positions such that $\|w\|_1 \ne w_L + w_s$ and that the results with and without minimum leverage are the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then tried to formulate the constraint as $x^TAx \le 0$ where $x^TAx = w_L^Tw_S$, but $A$ wouldn't be positive semi-definite in this case, so I can't turn this into a cone constraint.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then thought briefly about setting minimum risk, but this resolves into the complement of a second-order cone which is non-convex: $\|\Sigma^{1/2}w\| \ge \sigma.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to implement this minimum leverage constraint and/or minimum risk constraint, or something very similar?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using python with $\verb |cvxopt.solvers.socp|$ as my solver, in case this further informs any comments.  If you need any other info to provide a meaningful response, please let me know. &lt;/p&gt;&#xA;" OwnerUserId="15965" LastActivityDate="2015-04-17T14:45:15.443" Title="Implementing Minimum Leverage in an SOCP Portfolio Optimization" Tags="&lt;optimization&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17421" PostTypeId="1" AcceptedAnswerId="17529" CreationDate="2015-04-17T14:55:12.507" Score="4" ViewCount="514" Body="&lt;p&gt;I'm trying to build a class to create Aroon series. But it seems I don't understand the steps well. I'm not sure about what purpose I have to use the  period parameter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my first attempt:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/// &amp;lt;summary&amp;gt;&#xA;/// Aroon&#xA;/// &amp;lt;/summary&amp;gt;&#xA;public class Aroon : IndicatorCalculatorBase&#xA;{&#xA;    public override List&amp;lt;Ohlc&amp;gt; OhlcList { get; set; }&#xA;    public int Period { get; set; }&#xA;&#xA;    public Aroon(int period) &#xA;    {&#xA;        this.Period = period;&#xA;    }&#xA;&#xA;    /// &amp;lt;summary&amp;gt;&#xA;    /// Aroon up: {((number of periods) - (number of periods since highest high)) / (number of periods)} x 100&#xA;    /// Aroon down: {((number of periods) - (number of periods since lowest low)) / (number of periods)} x 100&#xA;    /// &amp;lt;/summary&amp;gt;&#xA;    /// &amp;lt;see cref=&quot;http://www.investopedia.com/ask/answers/112814/what-aroon-indicator-formula-and-how-indicator-calculated.asp&quot;/&amp;gt;&#xA;    /// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&#xA;    public override IIndicatorSerie Calculate()&#xA;    {&#xA;        AroonSerie aroonSerie = new AroonSerie();&#xA;&#xA;        int indexToProcess = 0;&#xA;&#xA;        while (indexToProcess &amp;lt; this.OhlcList.Count)&#xA;        {&#xA;            List&amp;lt;Ohlc&amp;gt; tempOhlc = this.OhlcList.Skip(indexToProcess).Take(Period).ToList();&#xA;            indexToProcess += tempOhlc.Count;&#xA;&#xA;            for (int i = 0; i &amp;lt; tempOhlc.Count; i++)&#xA;            {   &#xA;                int highestHighIndex = 0, lowestLowIndex = 0;&#xA;                double highestHigh = tempOhlc.Min(x =&amp;gt; x.High), lowestLow = tempOhlc.Max(x =&amp;gt; x.Low);&#xA;                for (int j = 0; j &amp;lt; i; j++)&#xA;                {&#xA;                    if (tempOhlc[j].High &amp;gt; highestHigh)&#xA;                    {&#xA;                        highestHighIndex = j;&#xA;                        highestHigh = tempOhlc[j].High;&#xA;                    }&#xA;&#xA;                    if (tempOhlc[j].Low &amp;lt; lowestLow)&#xA;                    {&#xA;                        lowestLowIndex = j;&#xA;                        lowestLow = tempOhlc[j].Low;&#xA;                    }&#xA;                }&#xA;&#xA;                int up = ((this.Period - (i - highestHighIndex)) / this.Period) * 100;&#xA;                aroonSerie.Up.Add(up);&#xA;&#xA;                int down = ((this.Period - (i - lowestLowIndex)) / this.Period) * 100;&#xA;                aroonSerie.Down.Add(down);&#xA;            }&#xA;        }&#xA;&#xA;        return aroonSerie;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there anyone else tried to do that before? &#xA;Here is a few reference points about the indicator:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.investopedia.com/ask/answers/112814/what-aroon-indicator-formula-and-how-indicator-calculated.asp&quot; rel=&quot;nofollow&quot;&gt;http://www.investopedia.com/ask/answers/112814/what-aroon-indicator-formula-and-how-indicator-calculated.asp&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.investopedia.com/articles/trading/06/aroon.asp&quot; rel=&quot;nofollow&quot;&gt;http://www.investopedia.com/articles/trading/06/aroon.asp&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:aroon&quot; rel=&quot;nofollow&quot;&gt;http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:aroon&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="15949" LastEditorUserId="848" LastEditDate="2015-04-22T12:34:19.367" LastActivityDate="2015-04-26T09:09:19.000" Title="Technical analysis - Calculating Aroon Indicator Serie" Tags="&lt;programming&gt;&lt;trading&gt;&lt;indicator&gt;&lt;charts&gt;&lt;technical-analysis&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17422" PostTypeId="1" CreationDate="2015-04-17T16:25:04.737" Score="1" ViewCount="2533" Body="&lt;p&gt;I know what a Swap Curve is. But I don't understand what a Basis Swap Curve is and how it is constructed?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Need some guidance on this.&lt;/p&gt;&#xA;" OwnerUserId="5839" LastActivityDate="2015-04-27T00:07:50.750" Title="What is a Basis Swap Curve?" Tags="&lt;yield-curve&gt;&lt;swaps&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17423" PostTypeId="1" AcceptedAnswerId="17504" CreationDate="2015-04-17T16:51:12.137" Score="4" ViewCount="612" Body="&lt;p&gt;The fair value, $F$, for a futures contract is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ F = S(1+rt) - D,$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $S$ is the underlying spot price, $r$ is the interest rate, $t$ is the time to maturity, and $D$ is the dividends. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the corresponding fair value if the futures contract pays in currency $c_1$ and the spot price and dividends are in currency $c_2$?&lt;/p&gt;&#xA;" OwnerUserId="5107" LastActivityDate="2015-04-23T19:41:37.030" Title="Futures fair value with spot in different currency" Tags="&lt;futures&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17424" PostTypeId="2" ParentId="17423" CreationDate="2015-04-17T16:53:45.683" Score="2" Body="&lt;p&gt;You need to express everything in the same currency, by converting it appropriately. You cant be risk neutral with respect to two numeraires at the same time, so the price you get will be in the numeraire with which you are risk-neutral to. This is called Seigel's Paradox.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So either convert the S, D or convert the F. It will likely be the S and D.&lt;/p&gt;&#xA;" OwnerUserId="13415" LastActivityDate="2015-04-17T16:53:45.683" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17426" PostTypeId="2" ParentId="1865" CreationDate="2015-04-17T19:15:34.310" Score="2" Body="&lt;p&gt;BookMap seems cool, indeed.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Jigsaw trading has something good, similar, less expensive&#xA;&lt;a href=&quot;http://www.jigsawtrading.com/order-flow-software/&quot; rel=&quot;nofollow&quot;&gt;http://www.jigsawtrading.com/order-flow-software/&lt;/a&gt;&#xA;The owner is a trader&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This tool is used by profitable traders: &lt;a href=&quot;http://www.nobsdaytrading.com/free-info/for-inexperienced-traders/&quot; rel=&quot;nofollow&quot;&gt;http://www.nobsdaytrading.com/free-info/for-inexperienced-traders/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;DB Vaello from OrderFlow Analytics offers another great tool&#xA;&lt;a href=&quot;http://www.orderflowanalytics.com/get-ofa&quot; rel=&quot;nofollow&quot;&gt;http://www.orderflowanalytics.com/get-ofa&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8247" LastActivityDate="2015-04-17T19:15:34.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17428" PostTypeId="2" ParentId="17341" CreationDate="2015-04-17T20:43:47.573" Score="1" Body="&lt;p&gt;This data isn't free obviously, but Euronext (the index provider) might be inclined to give you this information if it's for academic purposes. It's advertised on their website here: &lt;a href=&quot;https://www.euronext.com/fr/market-data/products/end-day-index-data&quot; rel=&quot;nofollow&quot;&gt;https://www.euronext.com/fr/market-data/products/end-day-index-data&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5120" LastActivityDate="2015-04-17T20:43:47.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17429" PostTypeId="1" CreationDate="2015-04-17T20:57:38.620" Score="1" ViewCount="612" Body="&lt;p&gt;I am generating 100,000 paths of SPX out to 1 year using Euler discretization. I look at how S is distributed for 100,000 paths at the 1 year point and I find it is lognormally distributed. I look at the distribution of the return of S for 100,000 paths between the two points S(0) and S(t), where t is 1 year, I find that the return is not normally distributed. The return is significantly left skewed. Shouldn't the return be normally distributed?&lt;/p&gt;&#xA;" OwnerUserId="13648" LastActivityDate="2015-04-17T20:57:38.620" Title="Monte Carlo simulation returns not normal distributed" Tags="&lt;monte-carlo&gt;&lt;normal-distribution&gt;&lt;log-returns&gt;&lt;lognormal&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17430" PostTypeId="2" ParentId="17396" CreationDate="2015-04-17T22:28:23.677" Score="1" Body="&lt;p&gt;It depends on the smart order router that you've chosen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally no. However in your example it appears that you are referring to passive execution on both ends, and there are smart order routers that preference the highest rebate, in which case you might find high correlation - &lt;em&gt;note&lt;/em&gt; this doesn't mean that the venue where the entry leg is executed &lt;em&gt;causes&lt;/em&gt; the exit leg to be more likely to execute at the same venue, but rather that there is such co-occurring explanatory variable.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For the second part of your question, it depends on the SOR again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is generally &lt;strong&gt;optional&lt;/strong&gt; for a firm to attribute an order to its MPID (say, on NASDAQ). Moreover, your order may routed to and executed &quot;over-the-counter&quot; within a FINRA TRF reporting participant, e.g. an ATS (commonly referred to as a 'dark pool'), in which case the ATS MPID would be submitted, which still somewhat anonymizes your order.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, Direct Edge does offer an &lt;a href=&quot;http://www.bats.com/us/equities/membership/fee_schedule/edgx/&quot; rel=&quot;nofollow&quot;&gt;incentive for attributed orders&lt;/a&gt;. For whatever reason, your SOR may preference this incentive. I would ask your broker for complete due diligence.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="4660" LastEditDate="2015-04-19T09:44:20.960" LastActivityDate="2015-04-19T09:44:20.960" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17432" PostTypeId="2" ParentId="17341" CreationDate="2015-04-18T00:09:42.903" Score="0" Body="&lt;p&gt;Bloomberg or datastream are the only possible sources.&lt;/p&gt;&#xA;" OwnerUserId="6486" LastActivityDate="2015-04-18T00:09:42.903" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17433" PostTypeId="2" ParentId="1004" CreationDate="2015-04-18T02:22:15.493" Score="5" Body="&lt;p&gt;Speech recognition signal processing is complex and possibly similar to the complexity of financial markets. They are similar as per characterictics the non stationarity, noise types and other aspects such us the existence of a cepstrum etc conceptual frequency and the grammar to construct and articulate concepts is not evenly and randomly distributed; so pattern discovery can occur and therefore signal procesing methods may be similar. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In language procesing evolution of speech incorporates new words and old words are eliminated. In this respect financial markets are the same where signals of certain characteritics appear and have limited life spands. Once a person at Reinnasance mentioned to me that since the early start of the models today only 25% of the original signals are being used while 75% of the pass signals used have lost all predicting power. This is the same as saying that 75% of the parterns encountered in the pass which had statistical significance in relation to returns have since vanished. So any model if fixed as per the paterms to encounter is deemed to fail after a few years of using it. Maybe Language processing as per financial prediction is related to the discovery of new patterns which are formed or derived from previous existing patterns.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Criptology may be in the techniques employed as to pint point the true signal from noise types and in this respect a decription algorithm will be the equivalent of having the mechanism to automatically transform an encripted signal into a decripted one. Therefore is related to denoising. &lt;/p&gt;&#xA;" OwnerUserId="7616" LastEditorUserId="7616" LastEditDate="2015-04-19T12:49:08.007" LastActivityDate="2015-04-19T12:49:08.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17434" PostTypeId="1" CreationDate="2015-04-18T14:00:11.527" Score="4" ViewCount="725" Body="&lt;p&gt;I am trying to fit an arima model on a rolling window using rollapply.My aim is to plot a graph of the evolution of the coefficient, plot the error and the standard deviation.&#xA;well i encountered the following problems:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) each window in the roll apply have different set of coeffcients: basically when i plot auto.arima()$coef[1] over time it could be ar1 or ma1 or anything.The reason i am doing this is that plotting the coefficient stability permits to judge the stability of coefficient and assess the accuracy of the model.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;getSymbols(&quot;ICICIBANK.NS&quot;)&#xA;ICICIBANK.NS&amp;lt;-as.data.frame(ICICIBANK.NS)&#xA;ICICIBANK.NSreturns&amp;lt;-c(NA,diff(log(ICICIBANK.NS$ICICIBANK.NS.Adjusted)))&#xA;z&amp;lt;-ICICIBANK.NS$returns&#xA;z&amp;lt;-na.omit(z)&#xA;y&amp;lt;-rollapply(as.zoo(z),width=100,FUN=function(x) auto.arima(x)$coef[1])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;basically i am trying here to have a look at the evolution of the first coefficient.but the model changes from one window to another.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have an idea how solve this? or maybe some lead i can work on ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) when i do auto.arima to log returns i get an ARIMA(0,0,0) and when i dot it for raw raw prices i get ARIMA(3,1,3):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;getSymbols(&quot;ICICIBANK.NS&quot;);&#xA;ICICIBANK.NS&amp;lt;-as.data.frame(ICICIBANK.NS)&#xA;ICICIBANK.NSreturns&amp;lt;-c(NA,diff(log(ICICIBANK.NS$ICICIBANK.NS.Adjusted)))&#xA;auto.arima(ICICIBANK.NS$returns)&#xA;&#xA;Series: ICICIBANK.NS$returns &#xA;ARIMA(0,0,0) with zero mean     &#xA;&#xA;sigma^2 estimated as 0.003309:  log likelihood=3042.76&#xA;AIC=-6083.51   AICc=-6083.51   BIC=-6077.86&#xA;&#xA;auto.arima(ICICIBANK.NS$ICICIBANK.NS.Adjusted)&#xA;&#xA;Series: ICICIBANK.NS$ICICIBANK.NS.Adjusted &#xA;ARIMA(3,1,3) with drift         &#xA;&#xA;Coefficients:&#xA;         ar1      ar2     ar3      ma1     ma2      ma3   drift&#xA;      0.0741  -0.0998  0.5626  -0.0572  0.0662  -0.8633  0.1087&#xA;s.e.  0.0306   0.0323  0.0279   0.0192  0.0200   0.0159  0.0606&#xA;&#xA;sigma^2 estimated as 77.62:  log likelihood=-7610.48&#xA;AIC=15236.96   AICc=15237.02   BIC=15282.22&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;why would auto.arima() work with prices and not log returns ?&lt;/p&gt;&#xA;" OwnerUserId="15606" LastEditorUserId="1355" LastEditDate="2015-04-22T13:41:38.853" LastActivityDate="2015-04-22T13:41:38.853" Title="rollapply with Arima model: testing for stability of coefficients" Tags="&lt;time-series&gt;&lt;statistics&gt;&lt;r&gt;&lt;econometrics&gt;&lt;arima&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17435" PostTypeId="1" CreationDate="2015-04-18T21:13:20.283" Score="5" ViewCount="277" Body="&lt;p&gt;Can someone point out where to find up to date market/microstruture research in the options market?&lt;/p&gt;&#xA;" OwnerUserId="15973" LastEditorUserId="2553" LastEditDate="2015-04-28T09:02:37.583" LastActivityDate="2015-07-27T10:47:22.843" Title="US options market/microstruture research" Tags="&lt;options&gt;&lt;research&gt;&lt;market-microstructure&gt;&lt;reference-request&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17436" PostTypeId="1" CreationDate="2015-04-18T22:46:48.027" Score="1" ViewCount="95" Body="&lt;p&gt;I would be grateful if anyone would comment how to construct this: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume $S_{i}^k$ is a stock price at time level $i$ and at price level $k$. Assume option is written on $S$ with a a payoff $f_{T}^{k}$ at maturity. Let $f_{i}^{k}$ be the value of the  payoff at time level $i$. $B_{i} = B_{0}e^{rt_{i}}$ is the bond price at $t=t_{i}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Construct a portfolio of a stocks and b bonds at $t=0$ according to $\Pi_{0} = aS_{0}^{0} + bB_{0}$. Evaluate a and b such that the value of the portfolio replicates the payoff of the option.&lt;/p&gt;&#xA;" OwnerUserId="15975" LastActivityDate="2015-04-20T22:33:10.970" Title="Replication of the portfolio in single step binomial model" Tags="&lt;portfolio&gt;&lt;binomial-tree&gt;&lt;replication&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17439" PostTypeId="2" ParentId="16792" CreationDate="2015-04-20T04:38:16.957" Score="8" Body="&lt;p&gt;You're going to get a pretty broad range of answers with this kind of question, but I'll throw in my two cents. I'm not going to answer your question about the &quot;next big thing&quot; in programming languages, because that's just an opinion survey. Instead, I'm going to describe to you the characteristics of a few popular (and mature and well-supported/documented) languages, so you can pick one for your needs. All of these languages have been around for at least 10 years, so it shows that they have stood the test of time. Let's break down a quant's programming needs into different segments: research, and production. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When conducting research (eg, backtesting a strategy) many people (myself included) prefer to use a high-level interpreted language in order to reduce the number of lines of code between an idea and test results. This is because, although these languages are often much slower than their compiled counterparts, programmer time is much more valuable than execution time at this stage of the game. It is worth bearing in mind, however, that a lot of research is going into making these languages faster, because they're so easy to use! These languages allow you to make small changes, fix bugs, and visualize results in far fewer lines of code than languages like C/C++/Java. They are almost always supported by (and bundled with) a wide variety of domain-specific libraries that extend the functionality of the language.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some of the most popular research languages are Matlab, Python (with numpy), and R. Someone who has never programmed in their lives can pick up the basics of these languages and write some simple code in less than a day. A free alternative to Matlab is Octave, if you don't want to shell out for the commercial package. If you choose Octave, though, you should be aware that it is just about the slowest scientific computing language available. One language to keep an eye on in the future is a language called &lt;strong&gt;Julia&lt;/strong&gt;. This is an interpreted (ish) language that is designed in such a way as to achieve C-like performance on a wide variety of numerical computing tasks. (There are lots of good papers out there if you're curious about how they do it.) It's a very young language that is rapidly changing (and breaking backward-compatibility), so it might be best to wait for it to mature a bit more before investing time/resources learning it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For production code, you choose a language based on the demands of your application. If you're trying to do HFT and run it from an interpreted language, &lt;em&gt;you're gonna have a bad time&lt;/em&gt;. Interpreted languages are simply not fast enough (yet!) to compete with compiled languages. If you're looking for pure performance, you're not going to beat C or C++ (Fortran excluded from this discussion because I'm &lt;em&gt;really&lt;/em&gt; not a fan, and would never encourage anyone to use it). These languages afford the programmer very fine-grained control over every aspect of the program execution, but if you don't &lt;em&gt;want&lt;/em&gt; the control, you have to deal with it anyway. If you're not writing assembly, C is about as &quot;close to the metal&quot; as you can get.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first step backward from the C/C++ family will bring you to Java and C#. The big feature that you'll notice here is &quot;Garbage Collection.&quot; If you don't know what this is, don't worry about the details, but it saves you from having to manage your program's memory consumption manually. Since the no-free-lunch idea should be familiar to readers of this site, you might guess that this incurs a performance cost, which can be crippling if you rely on a real-time system. The garbage collector feels a bit like a hiccup in the middle of an otherwise smooth execution. In most applications, you aren't going to notice it. There's a reason that fighter-jet avionics aren't written in Java, and this is it. If you feel that your system needs the same level of real-time control as an airplane, don't pick Garbage Collected languages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From here, you start getting away from languages that people currently seem to use for quantitative programming. I will make a case for one last one that is very important, if not for model execution. Bash/shell scripts. If you're on a *nix system, you absolutely need to be familiar with these to automate system maintenance tasks.&lt;/p&gt;&#xA;" OwnerUserId="8097" LastActivityDate="2015-04-20T04:38:16.957" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17441" PostTypeId="1" AcceptedAnswerId="36270" CreationDate="2015-04-20T07:04:29.003" Score="9" ViewCount="926" Body="&lt;p&gt;If we model asset return volatility for periods of more than one (say more than one day) there is the square-root rule which holds true under some assumptions. The situation is more tricky if we look at the empirical distribution function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To tackle this problem practitioners sometimes use rolling, overlapping data. Treating them as if they were non-overlapping seems wrong to me (it is wrong) - but how wrong and how can the approach be fixed?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With wrong I mean that the distribution of $\sum_{i=1}^{180} r_i$ with $r_i$ sampled uncorrelated will be different from the distribution of this sample of overlapping data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I heard about he following modelling approach:&#xA;They take a sample of $1000$ daily observations (daily returns/percentage changes) and then they build rolling $180$ day returns. Finally they look at the empirical distribution function (edf) and empirical quantiles of these rolling/overlapping returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mathematically they have $(r_i)_{i=1}^{1000}$ and then they look at $$y_1 = \sum_{i=1}^{180} r_i, \quad y_2 = \sum_{i=2}^{181} r_i, \quad  y_3 = \sum_{i=3}^{182} r_i, \cdots $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The sample of the $(y_i)_{i=1}^{820}$ is a set of strongly dependent random variables. What are the properties of its edf? How does it relate to the edf of the sample of $(r_i)_{i=1}^{1000}$? How can we relate volatility estimates?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As we speak about asset returns we can assume the $(r_i)_{i=1}^{1000}$ to be serially uncorrelated but not independent. This makes a rigorous treatment difficult.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a &lt;a href=&quot;https://stats.stackexchange.com/questions/146150/empirical-distribution-function-of-overlapping-time-series-data&quot;&gt;cross post&lt;/a&gt; as the question did not receive enough attention (after several days and a bounty).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What can be said about e.g. variance of yearly data based on overlapping data (e.g. Jan 1st 2015 to Jan 1st 2016, Jan 2nd 2015 to Jan 2nd 2016, Jan 3rd 2015 to Jan 3rd 2016, ... and so forth). The emperical distribution function is maybe too hard. But what about the variance?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Summing up the aim is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Estimate a quantile of the distribution of the return/loss of the following year (using the overlapping yearly data of the past).&lt;/li&gt;&#xA;&lt;li&gt;Estimate the variance of the return/loss of the following year (using the overlapping yearly data of the past).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The result could be a set of properties of the estimators of the above quantities when we only have the overlapping data. There could be bias which has to be corrected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: As some users point out one way to see that is as bootstrap statistics. I started reading this: &lt;a href=&quot;http://www.seminar.hec.ulg.ac.be/docs/Sem21.10.10_Cogneau.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bootstrap Methods for Finance: Review and&#xA;Analysis&lt;/a&gt; and the references therein. The boostrap point of view looks most promising. I have not yet arrived at a full answer.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2017-10-03T13:45:00.473" LastActivityDate="2017-10-13T07:44:00.143" Title="Empirical distribution function of overlapping time series data" Tags="&lt;risk-management&gt;&lt;value-at-risk&gt;&lt;asset-returns&gt;" AnswerCount="2" CommentCount="9" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17443" PostTypeId="2" ParentId="17436" CreationDate="2015-04-20T09:43:33.043" Score="2" Body="&lt;p&gt;I read the question as follows: You have one stock $S_0$ and after one period it either goes up to $S^+$ where the option takes the value $f^+$ or it goes down to $S^-$ where the option takes the value $f^-$. The bond grows from $B_0$ to $B_1 = B_0 \exp(r)$. Then you need to solve&#xA;$$&#xA;a S^+ + b B_1 = f^+ \\&#xA;a S^- + b B_1 = f^-&#xA;$$&#xA;for $a,b$ which are $2$ equation in $2$ unknowns which has a solution - $a$ the number of shares to buy and $b$ the investment in the bond.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-04-20T09:43:33.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17444" PostTypeId="1" CreationDate="2015-04-20T10:34:42.583" Score="1" ViewCount="2336" Body="&lt;p&gt;I was hoping some could explain the two terms namely, risk avoidance and risk transfer. Also, can a risk be avoided by transferring it?&lt;/p&gt;&#xA;" OwnerUserId="15985" LastActivityDate="2015-12-23T03:02:45.887" Title="Difference between Risk avoidance and Risk transfer" Tags="&lt;risk&gt;&lt;risk-management&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17445" PostTypeId="2" ParentId="16792" CreationDate="2015-04-20T12:46:14.330" Score="12" Body="&lt;p&gt;People get this problem wrong because they always end up discussing the theoretical advantages of these languages rather than the practical uses of these languages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Theoretically speaking:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Haskell&lt;/strong&gt; is elegant and has many of the theoretical advantages (language conciseness, orthogonality, parametric polymorphism, ADTs, higher-order functions, smart compiler), has been around for 25 years, but still isn't mainstream in finance.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Python&lt;/strong&gt; is an &lt;em&gt;ugly&lt;/em&gt; language. The syntax is adored for its expressiveness, but design decisions such as the &lt;a href=&quot;http://www.dabeaz.com/python/UnderstandingGIL.pdf&quot; rel=&quot;noreferrer&quot;&gt;GIL&lt;/a&gt;, dynamic typing, object-oriented paradigm etc. are inherently anti-parallel and decades down the road when we have hundreds of cores on each processor, our children are going to laugh at the obscurity and obsoleteness of such languages (among other things such as floppy disks).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Yet today almost everyone would encourage you to pick up Python. Why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;A language's (or any technology's, for that matter) future is decided by its community, the richness of its libraries and development tools and the self-perpetuating nature of legacy code in that language&lt;/strong&gt;, and never its theoretical advantages. We can write essays about how we hate &lt;strong&gt;Java&lt;/strong&gt;; the &lt;strong&gt;ROOT&lt;/strong&gt; and &lt;strong&gt;Boost&lt;/strong&gt; libraries; the verbosity of &lt;strong&gt;XML&lt;/strong&gt;, but these things are here to stay because they've achieved a &lt;em&gt;critical mass&lt;/em&gt; of users who are willing to build production strength tools or libraries around them. Dozens of functional languages such as &lt;strong&gt;F#&lt;/strong&gt; will come and go, but C++ will almost certainly remain because of the sheer amount of legacy code in C++. Besides, C++ '11 is a huge milestone in sorting out the theoretical mishaps along its development path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few choices I'd approach cautiously:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Languages built around concurrent and functional paradigms: &lt;strong&gt;Scala, F#&lt;/strong&gt;. I'd say to approach it cautiously because it's used in production at Dropbox, Lime, Tower Research, Credit Suisse etc. but these languages have taken a much longer time to rise to mainstream use than you'd expect them to given the current trends in processor architecture. It's hard for me to tell you whether or not investing your time now in these languages will pay off exactly 5 years from now, but we all seem to agree that these languages eventually will.&lt;/li&gt;&#xA;&lt;li&gt;Domain-specific languages: &lt;strong&gt;Julia&lt;/strong&gt;. Unfortunately, Julia markets itself with &quot;C-speed numerical inner loops&quot;. It attracts the same subset of the Python crowd who would argue with these Julia users that this is irrelevant since they can always drop to Cython. Both crowds espouse a doomed paradigm and attract low quality developers. (I say &lt;em&gt;unfortunately&lt;/em&gt;, because Julia has a great number of things that people don't realize: type-parametric multimethods, symmetric coroutines, clean interfaces with foreign languages, Lisp influences and metaprogramming support etc.)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;With that, I'd encourage a few choices:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Languages with big brother support: &lt;strong&gt;Go, Swift, C#&lt;/strong&gt;. Aside from Google's support, Go has become very popular in China; Microsoft had made a huge move forward by open-sourcing C#; and plenty of high quality UI development tools always spawn around Apple's core languages.&lt;/li&gt;&#xA;&lt;li&gt;Languages intended to supplant C/C++ as a systems-level programming language: &lt;strong&gt;D, Nimrod&lt;/strong&gt;. D already has Facebook's backing, and Nimrod retains the expressiveness of Python's syntax while achieving impressive benchmarks and being used for certain systems-level programming projects. Beware however that both still rely on the GC approach to memory management.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Have any of the above achieved a critical mass of good developers? I don't think so. The real solution for you is that a programming language really isn't difficult to pick up! What's more important is that you pick up how to &lt;strong&gt;design&lt;/strong&gt; a program rather than a specific language. Spend time with the 6 major language paradigms:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Imperative programming (C) and class abstractions (C++, C#, Java)&lt;/li&gt;&#xA;&lt;li&gt;Functional abstraction (Lisp, ML, F#)&lt;/li&gt;&#xA;&lt;li&gt;Declarative specifications (C++ templates, Haskell, Prolog)&lt;/li&gt;&#xA;&lt;li&gt;Syntactic abstraction (Lisp)&lt;/li&gt;&#xA;&lt;li&gt;Parallelism (Cilk, SISAL, Clojure, Erlang)&lt;/li&gt;&#xA;&lt;li&gt;Coroutines (C#, F#, Haskell, Scheme, Icon)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Quantitative trading often invokes concepts from these three core fields:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Algorithms, design patterns and data structures: B-trees, skip lists, memoization, DP etc.&lt;/li&gt;&#xA;&lt;li&gt;Systems programming: Memory addressing, assembly, linking, heap/stack, cache etc.&lt;/li&gt;&#xA;&lt;li&gt;Databases: Normalization, two phase commit, replication, mirroring, schema design etc.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And if you move closer to the quant developer end of the spectrum:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Distributed systems&lt;/li&gt;&#xA;&lt;li&gt;Operating systems&lt;/li&gt;&#xA;&lt;li&gt;Networks&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="4660" LastEditDate="2015-04-20T13:00:05.787" LastActivityDate="2015-04-20T13:00:05.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17446" PostTypeId="2" ParentId="17434" CreationDate="2015-04-20T14:47:37.600" Score="4" Body="&lt;p&gt;There are a couple of issues with your example.  First, for this ticker, there is a problem with the Yahoo price data for the period 2014-11-26 through 2014-12-03 in which the prices drop about 80% and then return to their trend line.  This appears to be related to a stock split which Yahoo isn't handling properly  and isn't real. Its causing part of your problem with the arima calculations.  Also to get the arima results for prices and returns to agree, you need to compare the results with either both log or both not log but not mixed. For the log data, the prices model is (2,1,2) and the returns model is (2,0,2) with the same coefficients which is what you should expect. Finally, you might look at the acf plots for the returns and notice that these don't show any significant autocorrelation so you might not expect too much from the arima results for prediction purposes.  If you're looking for changes in the behavior of the stock, you might start with plotting the changes in the mean over a rolling window.  Code related to these comments follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quantmod)&#xA;library(forecast)&#xA;&#xA;ICICIBANK.NS &amp;lt;- getSymbols(&quot;ICICIBANK.NS&quot;, auto.assign=FALSE)[,6]&#xA;ICICIBANK.NSreturns &amp;lt;- diff(ICICIBANK.NS, log=TRUE, na.pad=FALSE) &#xA;big_ret &amp;lt;- which(abs(ICICIBANK.NSreturns)&amp;gt;.5)   # finds erroneously large returns at start and end of period with bad data&#xA;bad_rows &amp;lt;- (big_ret[1]+1):(big_ret[2])&#xA;bad_data &amp;lt;- ICICIBANK.NS[bad_rows]&#xA;ICICIBANK.NS  &amp;lt;-  ICICIBANK.NS[-bad_rows,]&#xA;ICICIBANK.NSreturns &amp;lt;- diff(ICICIBANK.NS, log=TRUE, na.pad=FALSE) &#xA;ar_prices &amp;lt;- auto.arima(log(ICICIBANK.NS))&#xA;ar_returns &amp;lt;- auto.arima(ICICIBANK.NSreturns)&#xA;acf(ICICIBANK.NSreturns)&#xA;mean_returns &amp;lt;- rollmean(ICICIBANK.NSreturns, k=100)&#xA;plot(mean_returns)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11889" LastEditorUserId="11889" LastEditDate="2015-04-20T15:22:45.180" LastActivityDate="2015-04-20T15:22:45.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17449" PostTypeId="1" CreationDate="2015-04-20T16:41:11.053" Score="3" ViewCount="137" Body="&lt;p&gt;Sorry if this question is duplicate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Analyzing the scenario to hedge bond credit risk with CDS. but if Bond price changes CDS notional will not change. is there any way i can hedge this ? &lt;/p&gt;&#xA;" OwnerUserId="15990" LastActivityDate="2015-04-20T16:41:11.053" Title="Dynamic Hedging for a Bond" Tags="&lt;bond&gt;&lt;cds&gt;&lt;hedge&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17450" PostTypeId="1" CreationDate="2015-04-20T19:32:12.613" Score="6" ViewCount="593" Body="&lt;p&gt;Sorry if this is the wrong exchange for this question.  It seems to be the most relevant, anyway.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to learn and understand the Black-Scholes framework, with a focus on the stochastic differential equation approach (the exam I will be taking focuses on it).  So I set out a challenge for myself.  I'd like to price a special geometric average price call, where the average is taken on $S_0$ and $S_1$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My intuition is that what I'm &quot;really&quot; trying to price is a European call, where the underlying is the geometric average of the stock price.  I defined a process $G(t)$ by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation*}&#xA;  G(t) = \left(S_0 S_t\right)^{\frac{1}{2}}.&#xA;\end{equation*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The intention is to apply Ito's lemma, so I took derivatives:&#xA;\begin{align*}&#xA;  G_t &amp;amp;= 0 &amp;amp; G_S &amp;amp;= \frac{1}{2}S_0S_t^{-\frac{1}{2}} &amp;amp; G_{SS} = -\frac{1}{4}S_0^{-\frac{3}{2}}.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After applying Ito's lemma, I end up with the stochastic differential equation&#xA;\begin{equation*}&#xA;  \frac{\mathrm{d}G(t)}{G(t)} = \frac{1}{2}\left[\left(\alpha - \delta - \frac{1}{4}\sigma^2\right) \mathrm{d}t + \sigma \mathrm{d} Z_t \right],&#xA;\end{equation*}&#xA;where $\alpha$ is the stock's expected rate of return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I see that $G(t)$ is a geometric Brownian motion.  But this is where I become deeply confused, since it is a derivative of the stock $S_t$.  So when I do risk-neutral pricing, do I have to assume that $S$ earns the risk-free rate (which amounts to setting $\alpha = r$, in the stochastic differential equation above), or do I assume that G earns the risk-free rate?  Or something else?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My intuition is telling me that once I figure out which rates to use and where, I can just use the Black-Scholes formula for a call to get this claim price done.  Am I on the right track?&lt;/p&gt;&#xA;" OwnerUserId="8229" LastActivityDate="2017-07-31T23:13:20.597" Title="Using Black-Scholes to price a geometric average price call" Tags="&lt;black-scholes&gt;&lt;stochastic-calculus&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17451" PostTypeId="2" ParentId="16270" CreationDate="2015-04-20T21:50:34.733" Score="0" Body="&lt;p&gt;So, the deal is that since the dividend is known in advance, the stock price change it causes should not count as volatility.  So, instead of starting a binomial tree with $S$, you want to start with the prepaid forward price of $S$, scale up and down with $u$ and $d$, and add the then-present value of the dividend to the stock price to the nodes where the dividend hasn't yet been distributed.  So your tree will look something like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{array}[ccc]&#xA;                          &amp;amp;            &amp;amp; &amp;amp; F_{0,T}^Pu^2 \\ &#xA;                          &amp;amp; F_{0,T}^Pu   &amp;amp;            \\&#xA;  S = F_{0,T}^P + De^{-rt}  &amp;amp;            &amp;amp; F_{0,T}^Pud  \\&#xA;                          &amp;amp; F_{0,T}^Pd   &amp;amp;            \\&#xA;                          &amp;amp;            &amp;amp; F_{0,T}^Pd^2 \\&#xA;\end{array}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice that we &quot;removed&quot; (i.e., did not include) the dividend in the second or third columns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As QuantK said, you need to adjust the volatility.  The idea is the same as above: the dividend is known, so stock price volatility is &quot;due&quot; to the changes in the forward price.&lt;/p&gt;&#xA;" OwnerUserId="8229" LastEditorUserId="8229" LastEditDate="2015-04-21T19:50:59.743" LastActivityDate="2015-04-21T19:50:59.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17452" PostTypeId="2" ParentId="17450" CreationDate="2015-04-20T22:01:59.493" Score="6" Body="&lt;p&gt;this is not the way to do it. The Black-_Scholes argument requires the underlying to be tradable. $S_{t}^{0.5}$ is not tradable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, recognize that the underlying is still $S_t$ but the pay-off has changed to &#xA;$$&#xA;(\alpha S_{t}^{1/2} - \beta)_+&#xA;$$&#xA;for appropriate constants $\alpha,\beta.$ So the derivation of the BS equation still holds and the boundary condition is different. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To solve the easiest route is risk-neutral expectation. &#xA;$$&#xA;e^{-rT}E((\alpha S_{T}^{1/2} - \beta)_+&#xA;).&#xA;$$&#xA;To get the distribution of $S_{T}^{1/2}$ get that of $S_T$ which is lognormal and so has lognormal square root. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastEditorUserId="1809" LastEditDate="2015-04-21T00:47:56.470" LastActivityDate="2015-04-21T00:47:56.470" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17453" PostTypeId="2" ParentId="17450" CreationDate="2015-04-20T22:10:34.980" Score="3" Body="&lt;p&gt;if we forget about $S_0$, you are just trying to price a power option, i.e. an option on $S^\alpha$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By Ito &#xA;$$&#xA;d \log S^\alpha = \alpha d\log S = \alpha (r- q - \frac{1}{2}\sigma^2 ) dt + \alpha\sigma dW_t  &#xA;$$&#xA;This can be rewritten &#xA;$$&#xA;d \log S^\alpha = (r-q'-\frac{1}{2}\sigma'^2 ) dt + \sigma' dW_t&#xA;$$&#xA;If you set &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma' = \alpha \sigma$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$q' = r  -\frac{1}{2}(\alpha\sigma)^2 - \alpha (r- q - \frac{1}{2}\sigma^2 ) =  (1-\alpha)r - \frac{1}{2}\alpha(\alpha - 1)\sigma^2 + \alpha q$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then $e^{-rt}S^\alpha_te^{q't}$ is also a martingale and the BS formula applies with the new parameters (the interest rate stays the same but the vol and div yield change).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;  E^Q_t[e^{-rT}(S^\alpha_T - K)_+] = C_{BS}(S_t^\alpha,T-t,K,r,q',\sigma') &#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2017-07-31T23:13:20.597" LastActivityDate="2017-07-31T23:13:20.597" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17455" PostTypeId="2" ParentId="17399" CreationDate="2015-04-20T23:58:53.527" Score="1" Body="&lt;p&gt;Three possible explanations,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) From a recent PhD thesis, this could be part of an aggressive HFT strategy that tests how the market reacts to such large orders. See Adam Clark-Joseph's &lt;a href=&quot;http://www.nanex.net/aqck2/4136/exploratorytrading.pdf&quot; rel=&quot;nofollow&quot;&gt;exploratory trading paper&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) If the order is in a Large Cap Stock or liquid ETFs, it could be a large fund filling a block trade. Think about it if your a fund manager, if you see the order book has a bid for 1,000,000m shares at your target price why not send an order? It's cheaper then going through your alternatives (convergex, liquidnet, dark-pools, broker-dealers exc.. exc..) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Albeit rare, there is still an occasional &lt;a href=&quot;http://en.wikipedia.org/wiki/Fat-finger_error&quot; rel=&quot;nofollow&quot;&gt;fat finger mistake here and there.&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="1764" LastEditDate="2015-04-21T01:20:43.527" LastActivityDate="2015-04-21T01:20:43.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17456" PostTypeId="2" ParentId="17399" CreationDate="2015-04-21T02:11:12.433" Score="3" Body="&lt;p&gt;Time and sales shows trades, not orders. You are most likely seeing off exchange block trades being matched in dark pools and other block crossing venues and reported to FINRAs TRF.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2015-04-21T02:11:12.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17457" PostTypeId="1" AcceptedAnswerId="17548" CreationDate="2015-04-21T10:32:08.537" Score="1" ViewCount="493" Body="&lt;p&gt;I have just finished implementing the Bates model for pricing European call options.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To check results, I have been looking for a validation set where I could see the Bates parameter values and their associated call prices. However, I have not been able to obtain this information online.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anyone point me to any paper or reference where parameter values and call prices for the Bates model are given? &lt;/p&gt;&#xA;" OwnerUserId="5208" LastActivityDate="2015-04-27T13:47:49.880" Title="Validation of Bates SVJ model" Tags="&lt;stochastic-volatility&gt;&lt;jump&gt;&lt;validation&gt;&lt;bates&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17458" PostTypeId="1" AcceptedAnswerId="17459" CreationDate="2015-04-21T12:59:57.140" Score="1" ViewCount="88" Body="&lt;p&gt;I have the following deifnition of a Complete multiperiod binomial model:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A multi period binomial model can be called complete if every&#xA;  &lt;strong&gt;derivative security can be replicated by trading in the underlying&#xA;  stock and the money market&lt;/strong&gt;. In the complete market every derivative has a unique price that precludes arbitrage. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What does it mean that the derivative security can be replicated ? &lt;/p&gt;&#xA;" OwnerUserId="15997" LastActivityDate="2015-04-21T13:42:39.070" Title="Complete Multiperiod Binomial model" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;binomial&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17459" PostTypeId="2" ParentId="17458" CreationDate="2015-04-21T13:42:39.070" Score="0" Body="&lt;p&gt;In a one period model replication means that no matter which state of the model it holds that&#xA;$$&#xA;a S_1+ b B_1 = D_1&#xA;$$&#xA;where $a,b$ are the quanties of stock and bond held and $S_1,B_1$ and $F_1$ are the prices of the stock, the bond and the derivative at $t=1$. In such a case the fair price of the derivative at time $0$ is $a S_0 + b B_0$ (not thinking about correct discounting). Fair here means that it can be replicated by other assets in the market (in the given model).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For multi-period settings usually one defines the notion of a strategy to be self-financing. Thus you shift between the stock and the bond but all money is either borrowed from/put on the money market account or financed by sales of the stock. Self-financing means that there is no money coming from outside.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-04-21T13:42:39.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17461" PostTypeId="1" CreationDate="2015-04-21T17:04:44.837" Score="1" ViewCount="108" Body="&lt;p&gt;I've been searching for quite some time and would appreciate any guidance!  What I'm looking for is the distribution of running maximums for a log-normal process.  If anyone is familiar with any relevant material, please point me in the right direction.  Thanks.&lt;/p&gt;&#xA;" OwnerUserId="16000" LastActivityDate="2015-04-21T17:04:44.837" Title="Distribution of running maximums of a log normal process" Tags="&lt;lognormal&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17462" PostTypeId="1" CreationDate="2015-04-21T21:04:52.497" Score="2" ViewCount="1257" Body="&lt;p&gt;I have the following Question :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Prove that under the risk-neutral probability p the stock and the banjaccount have the same average rate of growth. In other words, if $ S_0 , S_N $ are the initial and final stock prices and  $B_0 , B_N $ the initial and final bank prices , show that : &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ E[S_N / S_0 ] = E[B_N / B_0 ] = c $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hint : The discounted stock price is a martingale under P. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you explain to me what is the discounted  stock price ? &lt;/p&gt;&#xA;" OwnerUserId="15997" LastActivityDate="2015-07-22T14:48:18.610" Title="Discounted Stock Price" Tags="&lt;equities&gt;&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;martingale&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17463" PostTypeId="2" ParentId="17462" CreationDate="2015-04-21T21:32:42.713" Score="1" Body="&lt;p&gt;Hope you will not mind if I place myself in continuous time. The discounted stock price at $T$ is $e^{-rT}S_T$. As you know that it is a martingale, you have that $\mathbf{E}^{\mathbf{P}}[e^{-rT}S_T | \mathscr{F}_t] = e^{-rt} S_t$ when $t\leq T$ which you can rewrite as $\mathbf{E}^{\mathbf{P}}\left[\frac{e^{-rT}S_T}{e^{-rt} S_t} | \mathscr{F}_t\right] = 1$ or $\mathbf{E}^{\mathbf{P}}\left[\frac{S_T}{S_t} | \mathscr{F}_t\right] = e^{r(T-t)}$ and $e^{r(T-t)}$ is but $\mathbf{E}^{\mathbf{P}}\left[\frac{B_T}{B_t} | \mathscr{F}_t\right]$. Finally, taking $t=0$ gives you the equality you are looking for.&lt;/p&gt;&#xA;" OwnerUserId="13470" LastActivityDate="2015-04-21T21:32:42.713" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17465" PostTypeId="1" CreationDate="2015-04-22T00:32:06.037" Score="3" ViewCount="187" Body="&lt;p&gt;This may seem like a dumb question, but if the EMH is generally true, wouldn't options already be correctly priced? Why do we need all these intricate formulas, unless we think the prices are wrong or that the prices can be improved? Lets say I develop an option pricing formula for pricing option under the event of   natural disasters. How is this useful?&lt;/p&gt;&#xA;" OwnerUserId="15081" LastActivityDate="2015-04-22T13:53:28.560" Title="What is the use of options pricing formulas" Tags="&lt;options&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17466" PostTypeId="1" CreationDate="2015-04-22T01:43:10.320" Score="1" ViewCount="237" Body="&lt;p&gt;This is a question posed to us by my professor in my finance class. I was under the impression that the Gordon Growth Model was used to find the intrinsic value of a stock, but I am unsure how to plug in these values and use it to find the value of this corporation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way I learned it was P=D/k-g, where P is the value of the stock, D is the expected dividend per share 1 year from now, k is the required rate of return on equity, and G is the dividend growth rate. What I don't understand is where I would use the values given in the problem in this model, since it's the value of the corporation and not a dividend. Any help would be much appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose Microsoft Corporation’s projected free cash flow for next year is FCF = $8.75 billion, and due to expected lower revenues from personal computers and slower growth of surface sales FCF is expected to grow at a constant rate of only 4.5% into the infinite future. The company’s weighted average cost of capital is 11.5%. Use the Gordon Growth Model to estimate the value of the corporation&lt;/p&gt;&#xA;" OwnerUserId="16002" LastActivityDate="2015-05-23T15:00:58.103" Title="Using Gordon's Growth Model to find value of corporation" Tags="&lt;dcf&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17468" PostTypeId="2" ParentId="17465" CreationDate="2015-04-22T06:49:08.623" Score="1" Body="&lt;p&gt;A first usage that you already probably thought of is that the markets are not perfectly efficient, so the options are slightly mispriced. Then you need to know in which side you should invest. And that is true, most option contracts are not liquid enough to be perfectly priced by the markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other use is when you issue a new option (for example if there is no option at this strike or at this maturity).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And last but not least, they can be useful to calculate other things than the price. If you consider the price (market price) as an input, you can get a parameter as an output. This is done for finding the implied volatility with the Black Scholes pricing formula.&lt;/p&gt;&#xA;" OwnerUserId="15650" LastEditorUserId="15650" LastEditDate="2015-04-22T09:23:04.760" LastActivityDate="2015-04-22T09:23:04.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17471" PostTypeId="1" CreationDate="2015-04-22T09:56:45.187" Score="3" ViewCount="3094" Body="&lt;p&gt;Where can I find a comparison of the contents, a list of everything that changed or the differences among the different editions of the book &lt;code&gt;Security Analysis&lt;/code&gt; by Benjamin Graham &amp;amp; David Dodd?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are six editions of the book: 1934, 1940, 1951, 1962, 1988, and 2008.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I have to read all of them and compare myself or did someone already do that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&#xA;I already read The Intelligent Investor and the sixth edition of Security Analysis. This question is about the differences between the different editions. The sixth edition if I understand it correctly, is based on the 1940-edition.&lt;/p&gt;&#xA;" OwnerUserId="2394" LastEditorUserId="2394" LastEditDate="2015-04-22T16:06:56.400" LastActivityDate="2016-12-28T16:55:30.733" Title="Differences between editions of Security Analysis by Graham and Dodd?" Tags="&lt;reference-request&gt;&lt;investing&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17472" PostTypeId="1" CreationDate="2015-04-22T11:00:05.040" Score="1" ViewCount="135" Body="&lt;p&gt;there are three Business units in a firm, each has operational VaR value which are independent from eachother. the quantile for each opVaR is different from the others. can I simply add the VaRs to get the total firm opVaR?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="16010" LastActivityDate="2015-04-22T13:57:07.460" Title="Value-at-Risk of the sum of three independent lognormal random variables with different confidence level" Tags="&lt;value-at-risk&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17473" PostTypeId="2" ParentId="17465" CreationDate="2015-04-22T13:15:46.067" Score="1" Body="&lt;p&gt;My 10 cents is the formulas aren't super intricate: they attempt to reflect certain realities. At the simplest level, simply intrinsic value + time value. You could make up your price just from that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you did just intrinsic value + a time value and put your price out there then you face the EMH risks, and if your price is off market you'd get instantly put into a losing position. So you have to manage that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore EMH means every provider has to follow the same price range... Like there's a picture where the practical reality of EMH means all options everywhere can become underpriced or overpriced. Then providers and clients alike can take advantage of a theoretical price edge.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the models simply try and break down the valuations. Intrinsic value is always basically fixed, right? Between price of underlying and strike price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whereas time value means a time decay, a volatility component, and an interest rate risk, and then there's the delta of the current position against the assumption of a random walk of underlying prices, and the expected speed of change of those prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then to further manage risk there's a whole load of second derivative colours and charms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is the use of option pricing formulae. Each aspect of option risk can be categorised and even traded separately. Also think about pricing 100's of strikes, maturity dates, and 1000's of underlying instruments...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the use of pricing an option in the event of natural disasters is what, like, laying off the cost of writing insurance policies. Like running the spread between insurance policies and option premiums?&lt;/p&gt;&#xA;" OwnerUserId="7369" LastEditorUserId="7369" LastEditDate="2015-04-22T13:53:28.560" LastActivityDate="2015-04-22T13:53:28.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17474" PostTypeId="1" CreationDate="2015-04-22T13:38:18.537" Score="2" ViewCount="768" Body="&lt;p&gt;I'd like to calibrate a variant of Heston model for interest rates which is describe by this couple of SDE&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{aligned}dr_t&amp;amp;=a(b-r_t)+\sqrt{r_t}\sigma_t dW_t^1 \\ d\sigma_t&amp;amp;=k(\theta-\sigma_t)+\sqrt{\sigma_t}\zeta dW_t^2 \end{aligned}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with real markets data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all I discretize the equations getting&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{aligned}r_t-r_{t-1}&amp;amp;=a(b-r_t)+\sqrt{r_{t-1}}\sigma_t \varepsilon_t \\ \sigma_t-\sigma_{t-1}&amp;amp;=k(\theta-\sigma_t)+\sqrt{\sigma_{t-1}}\zeta \epsilon_t \end{aligned}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And now I don't exactly how to proceed. I have some ideas:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Try to apply a VAR (Vector AutoRegressive) model: rearraing the discretized equations I should get&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;\begin{aligned} \frac{r_t}{\sqrt{r_{t-1}}}&amp;amp;=ab+(a-1)\sqrt{r_{t-1}}+\sigma_t \varepsilon_t \\ \frac{\sigma_t}{\sqrt{\sigma_{t-1}}}&amp;amp;=k\theta+(k-1)\sqrt{\sigma_{t-1}}+\zeta \epsilon_t \end{aligned}&#xA;or &#xA;\begin{aligned} \frac{r_t-r_{t-1}}{\sqrt{r_{t-1}}}&amp;amp;=\frac{a(b-r_t)}{\sqrt{r_{t-1}}}+\sigma_t \varepsilon_t \\ \frac{\sigma_t-\sigma_{t-1}}{\sqrt{\sigma_{t-1}}}&amp;amp;=\frac{k(\theta-\sigma_t)}{\sqrt{\sigma_{t-1}}}+\zeta\epsilon_t  \end{aligned}&#xA;but I don't know whether this choice is suitable and which of these two proposals is the best one because of the square root and because the left sides of the equations are a trasformation of the right ones&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Apply OLS to the $\sigma_t$ equation, plug the results into the $r_t$ equation and the run again OLS or ML.&#xA;The first part should not be a problem as the volatility is constant, $\zeta$, and OLS should be good rearraning in this way&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\sigma_t-\sigma_{t-1}}{\sqrt{\sigma_t}}=\frac{k(\theta-\sigma_t)}{\sqrt{\sigma_t}}+\zeta\varepsilon_t $$&#xA;In the second equation ($r_t$ with $\sigma_t$ plugged in) I don't think OLS are a good choice because the model is heteroskedastic and $\varepsilon_t$ and $\epsilon_t$ may be correlated &lt;em&gt;a priori&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you have any suggestion for the choice of the calibration technique? Moreover, how can I practical implement this calibration? I can use MatLab, Stata and Python (which would be my optimal choice if possible).&lt;/p&gt;&#xA;" OwnerUserId="16014" LastEditorUserId="16014" LastEditDate="2015-04-22T16:12:52.480" LastActivityDate="2018-03-06T00:12:31.327" Title="Calibration of Heston version of CIR" Tags="&lt;interest-rates&gt;&lt;programming&gt;&lt;calibration&gt;&lt;heston&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17475" PostTypeId="2" ParentId="17472" CreationDate="2015-04-22T13:57:07.460" Score="1" Body="&lt;p&gt;After your remarks:&#xA;So you have 3 lines of business and calculate VaR's for them:&#xA;$$&#xA;VaR_{99.9\%}(L_1) ,VaR_{99.5\%}(L_2) \text{ and } VaR_{99\%}(L_3),&#xA;$$&#xA;so if we speak in terms of events you model at different events - once an event of $0.1\%$ probability and so on. Thus mathematically in my mind it does not make sense to add these VaRs up and see it as the VaR of the sum of the losses of the business lines. If you would want to model this then you would put&#xA;$$&#xA;L = L_1 + L_2 + L_3&#xA;$$&#xA;and then calculate $VaR_{\alpha}(L)$ for in $\alpha$ (either $99\%$ or $99.9\%$ or $99.5\%$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But: if each of the above mentioned Vars simply represents the money that you reserve for such losses, then you can sum them up (it is only money). Just the interpretation is not rigorous.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-04-22T13:57:07.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17476" PostTypeId="5" CreationDate="2015-04-22T14:05:37.243" Score="0" Body="&lt;p&gt;The credit risk includes 3 kind of risks:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the &lt;strong&gt;default risk&lt;/strong&gt;: the risk of loss arising from a debtor being unlikely to pay its loan obligations in full or the debtor is more than 90 days past due (according to Basel agreements on any material credit obligation; default risk may impact all credit-sensitive transactions, including loans, securities and derivatives.&lt;/li&gt;&#xA;&lt;li&gt;the &lt;strong&gt;Concentration Risk&lt;/strong&gt;: The risk associated with any single exposure or group of exposures with the potential to produce large enough losses to threaten a bank's core operations. It may arise in the form of single name concentration or industry concentration and particularly concerns the retail banking industry.&lt;/li&gt;&#xA;&lt;li&gt;The &lt;strong&gt;Country Risk&lt;/strong&gt;: the risk of loss arising from a sovereign state freezing foreign currency payments (&lt;em&gt;transfer/conversion risk&lt;/em&gt;) or when it defaults on its obligations (&lt;em&gt;sovereign risk&lt;/em&gt;); this type of risk is prominently associated with the country's macroeconomic performance and its political stability.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-04-22T14:39:58.080" LastActivityDate="2015-04-22T14:39:58.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17477" PostTypeId="4" CreationDate="2015-04-22T14:05:37.243" Score="0" Body="The risk that a borrower will default on any type of debt by failing to make required payments and that the corresponding lender suffers a loss." OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-04-22T14:39:52.040" LastActivityDate="2015-04-22T14:39:52.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17478" PostTypeId="1" AcceptedAnswerId="17889" CreationDate="2015-04-22T14:28:26.803" Score="3" ViewCount="1082" Body="&lt;p&gt;Here is a few references about OBV calculations:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ta.mql4.com/indicators/volumes/on_balance_volume&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://ta.mql4.com/indicators/volumes/on_balance_volume&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:on_balance_volume_obv&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:on_balance_volume_obv&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/On-balance_volume&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://en.wikipedia.org/wiki/On-balance_volume&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;When I navigate to the source code of OBV function in TTR package, I see this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;OBV&quot; &amp;lt;-&#xA;function(price, volume) {&#xA;    # On Balance Volume&#xA;    price &amp;lt;- try.xts(price, error=as.matrix)&#xA;    volume &amp;lt;- try.xts(volume, error=as.matrix)&#xA;&#xA;    if(!(is.xts(price) &amp;amp;&amp;amp; is.xts(volume))) {&#xA;        price &amp;lt;- as.vector(price)&#xA;        volume &amp;lt;- as.vector(volume)&#xA;    }&#xA;    obv &amp;lt;- c( volume[1], ifelse( ROC(price) &amp;gt; 0, volume, -volume )[-1] )&#xA;    obv &amp;lt;- cumsum( obv )&#xA;    if(is.xts(obv)) {&#xA;        obv &amp;lt;- xts(obv,index(price))&#xA;        colnames(obv) &amp;lt;- 'obv'&#xA;    }&#xA;    reclass( obv, price )&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I see that the equality case (I mean the case occurs when today’s close is equal to yesterday’s close) in the reference web pages does not exist in OBV function implementation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it a bug or an acceptance of the package? If it is a bug, where can I report the issue?&lt;/p&gt;&#xA;" OwnerUserId="15949" LastEditorUserId="70" LastEditDate="2016-12-10T10:36:15.800" LastActivityDate="2016-12-10T10:36:15.800" Title="OBV indicator calculation in R" Tags="&lt;programming&gt;&lt;automated-trading&gt;&lt;indicator&gt;&lt;technical-analysis&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17479" PostTypeId="5" CreationDate="2015-04-22T14:30:33.637" Score="0" Body="&lt;p&gt;Matlab is a 4th-generation programming language, developed by Mathworks, used for numerical and symbolic computing and user interfaces creation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It interfaces with external programming languages as C, C++, Java, Fortran, Python.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Created by Cleve Moler in the late of '70s, it found a strong audience within the applied mathematics field.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="848" LastEditDate="2015-04-22T14:39:46.213" LastActivityDate="2015-04-22T14:39:46.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17480" PostTypeId="4" CreationDate="2015-04-22T14:30:33.637" Score="0" Body="Numerical computing environment developed to allow matrix manipulations, plotting of functions and data and implementation of algorithms." OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-04-22T14:34:33.760" LastActivityDate="2015-04-22T14:34:33.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17481" PostTypeId="2" ParentId="17471" CreationDate="2015-04-22T15:34:07.153" Score="0" Body="&lt;p&gt;This question is pretty dealt on the internet with; browsing on the web I found a lot of people preferred the 1940 revised edition, but without evident reasons. On the &lt;a href=&quot;https://money.stackexchange.com/questions/21286/which-benjamin-graham-book-should-i-read-first-security-analysis-or-intelligent&quot;&gt;personal finance&lt;/a&gt; site suggested to read Graham's &lt;code&gt;Intelligent Investor&lt;/code&gt;, considered better than &lt;code&gt;Security Analysis&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally, I had a look to the last version and I suggest you to do the same; this because of the fact that financial markets evolve in time and it is better to adequate own knowledge on &lt;em&gt;current literature&lt;/em&gt; about a topic. &lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="-1" LastEditDate="2017-04-13T12:25:30.743" LastActivityDate="2015-04-22T16:44:49.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17482" PostTypeId="2" ParentId="4105" CreationDate="2015-04-22T18:17:26.160" Score="1" Body="&lt;p&gt;As you suggest, in the case of non-stationary time series, the &lt;em&gt;Hurst exponent&lt;/em&gt; is not suitable to measure the time seires persistence for the reasons you cited in the question. Particularly, when $H(q)$ is a non-linear function of q, as in the non-stationary time-series case, the time-series   has to be analysed as it is a &lt;em&gt;multi-fractal system&lt;/em&gt; (to deal this topic with, look at the 2nd reference below).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As regards the measure of the time series persistence for non-linear dynamics, I suggest to implement a &lt;em&gt;detrended fluctuation analysis&lt;/em&gt;, that produce an indicator, highly correlated with the Hurst exponent, that is more appropriate to model non stationary, changing with time, data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more references about the topic, look at the Peng's seminal paper:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Peng, C.K. et al. (1994). &quot;Mosaic organization of DNA nucleotides&quot;.&#xA;  Phys. Rev. E 49: 1685–1689.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;an to the Mandelbrot's book about using fractal distributions in the financial markets:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Mandelbrot, Benoît B., The (Mis)Behavior of Markets, A Fractal View of&#xA;  Risk, Ruin and Reward (Basic Books, 2004), pp. 186-195&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-04-22T23:33:04.410" LastActivityDate="2015-04-22T23:33:04.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17483" PostTypeId="1" AcceptedAnswerId="17484" CreationDate="2015-04-22T19:23:52.163" Score="3" ViewCount="5067" Body="&lt;p&gt;In his book 'Dynamic Hedging' Nassim Taleb says that the volatility of an OTM put should be exactly equal to that of a corresponding in the money call of same strike.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in option chains, the calls always have a slightly higher IV than the corresponding put.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this because I am looking at American option chains and not European?&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2015-04-22T20:14:27.353" Title="Why is IV different between put and call of same strike" Tags="&lt;option-pricing&gt;&lt;implied-volatility&gt;&lt;put-call-parity&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17484" PostTypeId="2" ParentId="17483" CreationDate="2015-04-22T20:14:27.353" Score="4" Body="&lt;p&gt;Since American style options allow early exercise, put-call parity will not hold for American options (unless they are held to expiration).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, there is also a difference between calls and puts for European options as well. The full description is here:&#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/2906/what-causes-the-call-and-put-volatility-surface-to-differ&quot;&gt;What causes the call and put volatility surface to differ?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2909" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2015-04-22T20:14:27.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17485" PostTypeId="1" AcceptedAnswerId="17486" CreationDate="2015-04-22T20:59:25.270" Score="0" ViewCount="534" Body="&lt;p&gt;I'm basically running some code as follows. Basically I'm just retrieving pairs of stocks (laid out as Row 1-Stock 1,2, Row 2-Stock 1,2 and so on, where Stock 1 and 2 are different in each row) from a CSV File. I then take in data from Yahoo associated with these &quot;Pairs&quot; of Stocks. I calculate the returns of the stocks and basically check if the distance (difference in returns) between a pair of stocks breaches some threshold and if so I return 1. However, I am running into the error below and Im unable to figure out why, as I know that the key ADP_PAYX which is associated with the first &quot;stock pair&quot; in the CSV File does infact exist.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Distancefunc(self, tickers, begdate, enddate)&#xA;    111             data = Returns(ticker,begdate,enddate)&#xA;    112             key = ticker[0]+'_'+ticker[1]&#xA;--&amp;gt; 113             R1 = data[key]['Returns'][0]&#xA;    114             R2 = data[key]['Returns'][1]&#xA;    115             distance = sum[(R1-R2)^2]&#xA;&#xA;KeyError: 'ADP_PAYX' &#xA;&#xA;&#xA;&#xA;&#xA;from datetime import datetime&#xA;import pytz&#xA;#import zipline as zp&#xA;import csv&#xA;import pandas as pd&#xA;import pandas.io.data as web&#xA;import numpy as np&#xA;from matplotlib.pyplot import *&#xA;from matplotlib.finance import quotes_historical_yahoo&#xA;&#xA;&#xA;def Dataretriever():&#xA;        Pairs = []&#xA;        f1=open('C:\Users\Pairs_0420.csv') #Enter the location of the file&#xA;        csvdata= csv.reader(f1)&#xA;        for row in csvdata:          #reading tickers from the csv file&#xA;            Pairs.append(row)&#xA;        return Pairs&#xA;&#xA;tickers = Dataretriever()&#xA;tickersasstrings = map(str, tickers)&#xA;&#xA;def PricePort(tickers,begdate,enddate):&#xA;    &quot;&quot;&quot;&#xA;        Returns historical adjusted prices of a portfolio of stocks.&#xA;        tickers=pairsd   &quot;&quot;&quot;&#xA;    final=pd.read_csv('http://chart.yahoo.com/table.csv?s=^GSPC',usecols=[0,6],index_col=0)&#xA;    final.columns=['^GSPC']&#xA;    data = {}&#xA;    for ticker in tickers:&#xA;        #print ticker        &#xA;        key = ticker[0]+'_'+ticker[1]&#xA;        data1 = quotes_historical_yahoo(ticker[0], begdate, enddate,asobject=True, adjusted=True)&#xA;        data2 = quotes_historical_yahoo(ticker[1], begdate, enddate,asobject=True, adjusted=True)&#xA;        #url1 = 'http://chart.yahoo.com/table.csv?s=ttt'.replace('ttt',ticker[0])&#xA;        data[key] = {'Data': (data1,data2)}&#xA;    return data    &#xA;&#xA;def Returns(tickers,begdate,enddate):&#xA;    begdate=(2014,1,1)&#xA;    enddate=(2014,6,1)    &#xA;    p = PricePort(tickers,begdate,enddate)&#xA;    for ticker in tickers:&#xA;        key = ticker[0]+'_'+ticker[1]&#xA;        data1 = p[key]['Data'][0]&#xA;        data2 = p[key]['Data'][1]&#xA;        ret1 = (data1.close[1:] - data1.close[:-1])/data1.close[1:]&#xA;        ret2 = (data2.close[1:] - data2.close[:-1])/data2.close[1:]&#xA;        p[key]['Returns'] = (ret1,ret2)&#xA;&#xA;    return p&#xA;&#xA;class ThresholdClass():    &#xA;    #constructor&#xA;    def __init__(self, Pairs,begdatae,enddate):&#xA;        self.Pairs = Pairs&#xA;        self.begdate = begdate&#xA;        self.enddate = enddate&#xA;&#xA;    def Distancefunc(self, tickers, begdate, enddate):&#xA;        for ticker in tickers:&#xA;            data = Returns(ticker,begdate,enddate)&#xA;            key = ticker[0]+'_'+ticker[1]&#xA;            R1 = data[key]['Returns'][0]&#xA;            R2 = data[key]['Returns'][1]&#xA;            distance = sum[(R1-R2)^2]&#xA;            return distance&#xA;&#xA;    def MeanofPairs(self, tickers, begdate, enddate):&#xA;        sum = self.Distancefunc(tickers, begdate, enddate)&#xA;        mean = np.mean(sum)&#xA;        return mean&#xA;&#xA;    def StandardDeviation(self, tickers, begdate, enddate):&#xA;        sum = self.Distancefunc(tickers, begdate, enddate)&#xA;        standard_dev = np.std(sum)&#xA;        return standard_dev &#xA;&#xA;    def ThresholdandnewsChecker(self, tickers, begdate, enddate):&#xA;        threshold = self.MeanofPairs(tickers, begdate, enddate) + 2*self.StandardDeviation(tickers, begdate, enddate)&#xA;        if (self.Distancefunc(tickers, begdate, enddate) &amp;gt; threshold):&#xA;            news = self.newsfunc(binaryfromnews)&#xA;            return 1       &#xA;&#xA;begdate=(2013,1,1)&#xA;enddate=(2013,12,31)      &#xA;Threshold_Class  = ThresholdClass(tickers[:1],begdate,enddate)   &#xA;Threshold_Class.ThresholdandnewsChecker(tickers[:1], begdate, enddate)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Edit: Adding a print p before &lt;code&gt;data1 = p[key]['Data'][0]&lt;/code&gt; showed that the keys are &lt;code&gt;A_D&lt;/code&gt; and &lt;code&gt;P_A&lt;/code&gt; instead of the required 'ADP_PAYX'. So, this is what I am looking to resolve at this point. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="11917" LastEditorUserId="11917" LastEditDate="2015-04-22T21:39:22.640" LastActivityDate="2015-04-22T22:12:57.507" Title="KeyError in Python code used to determine a trade signal for Pair Trading" Tags="&lt;python&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17486" PostTypeId="2" ParentId="17485" CreationDate="2015-04-22T22:12:57.507" Score="0" Body="&lt;p&gt;In the method &lt;code&gt;Distancefunc&lt;/code&gt; change this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    for ticker in tickers:&#xA;        data = Returns(ticker,begdate,enddate)&#xA;        ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    data = Returns(tickers,begdate,enddate)&#xA;    for ticker in tickers:&#xA;        ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note the change from &lt;code&gt;ticker&lt;/code&gt; to &lt;code&gt;tickers&lt;/code&gt; in the argument of &lt;code&gt;Returns&lt;/code&gt;. The reason is that &lt;code&gt;Returns&lt;/code&gt; is designed to loop over all tickers, but currently you are passing it a string instead of a list of tickers. That's why the key is set to &lt;code&gt;A_D&lt;/code&gt; and the data dictionary: it's the first and second letter of the tickername ADP_PAYX.&lt;/p&gt;&#xA;" OwnerUserId="3371" LastActivityDate="2015-04-22T22:12:57.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17489" PostTypeId="1" AcceptedAnswerId="17491" CreationDate="2015-04-23T05:56:51.020" Score="2" ViewCount="2890" Body="&lt;p&gt;For a particular currency, let's say for USD, I'd like to know how to construct a discount curve?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've an impression that one professor told me that for USD, less than 3 months, it's using Libor curve; more than 3 months, up to 3 years, it's using ED future rate; then afterwards it's using IRS rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I come to this paper from John Hull talking about using OIS rates if the portfolio is collateralized, while LIBOR rate shall be used if not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the end I'm a bit lost.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If a few mores could be said on how (e.g. which Bloomberg command) to retrieve the discount curve of USD, that's even better.&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2020-05-19T16:02:27.320" Title="Discount Curve built-up" Tags="&lt;bloomberg&gt;&lt;discount-factor-curve&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17491" PostTypeId="2" ParentId="17489" CreationDate="2015-04-23T08:30:41.077" Score="1" Body="&lt;p&gt;Before the financial crisis, we used to &lt;em&gt;assume&lt;/em&gt; that LIBOR is a risk-free rate and built swap curves in pretty much the same way your professor taught.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nowadays, OIS discounting is the norm (actually depends on the exact collaterialization mechanism, but let's not go there...). Simply put, you need to have a 3-month LIBOR curve to project 3-month LIBOR forwards and the corresponding floating cash flows. However, the cash flows are not discounted using LIBOR discount factors to produce the present values. Instead a separate discount curve based on OIS should be used. So the swap curve is really a package of curves (&quot;multi-curve&quot;). OpenGamma has published a good documentation &lt;a href=&quot;https://quant.opengamma.io/Multiple-Curve-Construction-OpenGamma.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Multiple Curve Construction&lt;/a&gt; that describes the methodology.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="18748" LastEditDate="2020-05-19T16:02:27.320" LastActivityDate="2020-05-19T16:02:27.320" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="17492" PostTypeId="2" ParentId="16913" CreationDate="2015-04-23T10:20:28.117" Score="1" Body="&lt;p&gt;The retail credit risk management is generally based on models that try to discriminate between good (people that probably will be able to pay back the debt) and bad customers (people that probably will not).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Particularly, as the question explicitly asks for, you want to some references to allow to decide which customers, already acquired, to keep and which not keep in portfolio; this field in retail risk management refers to LGD (loss given default) models and you should focus your studies in this kind of model to deepen the field (try to google &quot;LGD model&quot;, to look something for).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As regards you questions particularly, I suggest you to read:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Anolli, M., Beccalli, E., Giordani, T., 2013, &lt;em&gt;Credit Risk&#xA;  Management&lt;/em&gt;, Palgrave Macmillan (Studies in Banking and Financial&#xA;  Institutions)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It is a good recent book about retail credit risk management and examine pretty in depth the models you need for.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-04-23T10:20:28.117" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17493" PostTypeId="5" CreationDate="2015-04-23T10:47:06.597" Score="0" Body="&lt;p&gt;The factor models are econometric-based models that aims to measures the effect of different risk measures on portfolio asset returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Such models are of three kinds:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Macroeconomic factor models&lt;/strong&gt;: models that attempt to measure the effect of macroeconomic variables on asset returns using macroeconomic variables as the change in the interest rates, unemployment rate, inflation rate,...;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Statistical factor models&lt;/strong&gt;: models that attempt to explain the risks particular to an investment;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Fundamental factor models&lt;/strong&gt;: models that attempt to measure the risks relative to a particular industry or market that might influence the asset portfolio returns;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-04-23T12:13:27.637" LastActivityDate="2015-04-23T12:13:27.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17494" PostTypeId="4" CreationDate="2015-04-23T10:47:06.597" Score="0" Body="Econometric model that have the purpose to measure the effect of different risk measures on portfolio asset returns." OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-04-23T12:13:05.593" LastActivityDate="2015-04-23T12:13:05.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17495" PostTypeId="2" ParentId="15605" CreationDate="2015-04-23T11:09:39.457" Score="2" Body="&lt;p&gt;I faced the same issue some years ago and I solved by implementing the &lt;em&gt;R&lt;/em&gt; script reported &lt;a href=&quot;http://allthingsr.blogspot.it/2012/10/pull-yahoo-finance-key-statistics.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;; now, with new Yahoo disclaimer rules, it seems to be broken, but, anyway you should be able to replicate the data mining process using that script together with &lt;a href=&quot;https://grollchristian.wordpress.com/2013/08/07/sp500-stock-price-data/&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're pretty confident with R, you should be able to do that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can visit &lt;a href=&quot;http://www.wolframalpha.com/input/?i=GOOGL%20historical%20market%20capitalization%201.7.2013&quot; rel=&quot;nofollow&quot;&gt;wolframalpha.com&lt;/a&gt; and download the data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also do the same by using &lt;em&gt;python&lt;/em&gt; and QUANDL API, but it should more complicated. The only one problem is about the data reliability in both cases, but, as usual, if database is for free, it is normal to get low-quality data. &lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-04-23T21:44:01.403" LastActivityDate="2015-04-23T21:44:01.403" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17496" PostTypeId="1" CreationDate="2015-04-23T11:47:17.050" Score="2" ViewCount="425" Body="&lt;p&gt;I'm using Black model to do interest rate Cap &amp;amp; Floor pricing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The volatility is determined by using the bootstrapping methodology.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, afterwards, how should I do the calibration, or surface smoothing?&#xA;Please can you kindly recommend papers and books about the topic?&lt;/p&gt;&#xA;" OwnerUserId="2161" LastEditorUserId="2553" LastEditDate="2015-04-23T12:13:20.423" LastActivityDate="2015-04-23T12:13:20.423" Title="How to calibrate volatility surface for Interest Rate Cap&amp;Floor pricing" Tags="&lt;volatility&gt;&lt;pricing&gt;&lt;calibration&gt;&lt;black&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17497" PostTypeId="1" CreationDate="2015-04-23T12:02:47.050" Score="2" ViewCount="1365" Body="&lt;p&gt;Was going through how Implied Volatility is used by option traders and in delta hedging. Correct me if I am wrong, doesn't IV consider a standard deviation of the stock price over say the past 1 year? Now as far as I remember, we do not consider standard deviation for non stationery time series. If this is so, isn't IV flawed? Or there is a more elegant method out there?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks and Cheers!!&#xA;Cryptex&lt;/p&gt;&#xA;" OwnerUserId="16022" LastActivityDate="2016-08-09T23:10:52.547" Title="Is implied volatility flawed?" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;standard-deviation&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17498" PostTypeId="2" ParentId="17497" CreationDate="2015-04-23T13:57:16.800" Score="6" Body="&lt;p&gt;No.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Implied volatility isn't a historical measure of standard deviation. Implied volatility is used to relate a market price to some model, be that Black-Scholes or something more sophisticated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way to phrase it, implied vol is that single vol input into a model, such that the model reproduces the market prices. Different models will have different implied vols. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And even in the Black-Scholes model, the volatility isn't a measure of the standard deviation of the stock price. It's a measure of the standard deviation of the log-return of price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider Geometric Brownian Motion for a stock price: $dS_t = \mu S_t dt + \sigma S_t dW_t $. The distribution of $\ln \frac{S_t}{S_0}$ is $N(\mu-\frac{\sigma^2}{2}, \sigma^2 t)$, where $N(.)$ is the Normal distribution. In other words, over $t=1$ year, the standard deviation of the log-return of the stock is $\sigma$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In contrast, the standard deviation of the stock price over 1 year is given by $S_0 e^\mu \sqrt{e^{\sigma^2} -1 }$. This quantity looks nothing like the implied vol you are deriving from market option prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A final comment: nothing about implied vol calculation is dependent on &quot;the past 1 year&quot;. It's strictly a forward-looking concept. Look up &lt;a href=&quot;https://en.wikipedia.org/wiki/Markov_property&quot;&gt;Markov property&lt;/a&gt; on Wikipedia.&lt;/p&gt;&#xA;" OwnerUserId="7166" LastActivityDate="2015-04-23T13:57:16.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17499" PostTypeId="2" ParentId="17466" CreationDate="2015-04-23T14:08:13.660" Score="1" Body="&lt;p&gt;Under GGM dividends are used, under the assumption of constant growth. You're given FCF under the assumption of constant growth. So you could use FCFF or FCFE models. Since the question is asking for the value of the corporation, you will want to use the FCFF model&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Firm Value = \frac{FCFF_1}{(WACC-g)}=\frac{FCFF_0(1+g)}{(WACC-g)}$&lt;/p&gt;&#xA;" OwnerUserId="16024" LastActivityDate="2015-04-23T14:08:13.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17502" PostTypeId="2" ParentId="17497" CreationDate="2015-04-23T16:48:22.850" Score="2" Body="&lt;p&gt;A pithy way to put it is &lt;b&gt;&quot;implied volatility is the wrong number to put in the wrong formula to get the right price.&quot;&lt;/b&gt;  That is, implied volatility is by definition the parameter $\sigma$ to plug into the Black-Scholes option pricing formula to get the market price of a vanilla option.  This is called &quot;volatility,&quot; but in reality it isn't the same as the result of any historical volatility calculation; hence its the &quot;wrong number.&quot;  The Black-Scholes model is a vastly simplified model that does not reflect the true complexities of the market; hence &quot;wrong formula.&quot;  But everyone knows the conventions, so implied volatility gives a correct way to quote option prices.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2015-04-23T16:48:22.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17504" PostTypeId="2" ParentId="17423" CreationDate="2015-04-23T19:30:48.690" Score="2" Body="&lt;p&gt;You can either&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;borrow cash now convert it and enter a forward contract for the stock in ccy2 and repay your loan at maturity &lt;/li&gt;&#xA;&lt;li&gt;invest your cash at the domestic risk free rate and buy the stock at maturity. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If there is no arbitrage between domestic and foreign markets, the two strategy lead to you receiving the stock 100% of the time so their cost should be the same. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the first strategy, if $D$ is the total value at time $T$ of the dividends received by a stock holder between $t$ and $T$ then you need to pay &#xA;$$&#xA;  \frac{S_t}{P_2(t,T)} - D \qquad P_2(t,T) = (1+r_2)^{-1}&#xA;$$&#xA;at time $T$ in ccy2 so you need to invest&lt;br&gt;&#xA;$$&#xA;  P_2(t,T)(\frac{S_t}{P_2(t,T)} - D)&#xA;$$&#xA;at the risk free rate $r_2$ to get this amount at time $T$. So you need to convert &#xA;$$&#xA;  X_t (S_t - P_2(t,T)D)&#xA;$$ &#xA;at time $t$ in domestic ccy 1 to fund the strategy. So at time $T$ you have to repay &#xA;$$&#xA;  \frac{X_t}{P_1(t,T)} (S_t - P_2(t,T)D) = X_t\frac{P_2(t,T)}{P_1(t,T)} (\frac{S_t}{P_2(t,T)} - D) &#xA;$$ &#xA;in domestic ccy 1. $X(t,T)$ is the forward FX rate. So the price of your quanto forward contract at time $t$ for maturity $T$ in ccy 1 is the price of the foreign contract times the forward FX rate $X(t,T) = X_t\frac{P_2(t,T)}{P_1(t,T)}$. &lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2015-04-23T19:41:37.030" LastActivityDate="2015-04-23T19:41:37.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17505" PostTypeId="2" ParentId="15605" CreationDate="2015-04-24T05:28:06.063" Score="3" Body="&lt;p&gt;Some of the issues with this sort of request is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) Today's S&amp;amp;P 500 components are not the same from 1 Jul 2013.  By using today's components you are introducing pre-inclusion/survivorship bias.  Are you going to be able to find data on the delisted stocks?  eg. Since 1 Jul 2013, Sprint Corporation, BMC Software, NYSE Euronext, Molex, Life Technologies, Beam Suntory, International Game Technology, Forest Laboratories, Safeway, Covidien, Allergan have all delisted (due to takeover/merger).  There's also a lot more that have been removed as part of the quarterly rebalancing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) Today's shares outstanding are not the same as 1 Jul 2013.  There may have been mergers/takeovers (where shares are issued as part of the takeover), demergers, buybacks, employee share issues, private placements etc. since that time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;c) Shares outstanding * share price does NOT equal market cap in all cases.  Some companies (e.g. Berkshire Hathway, Google etc.) have multiple types of share classes, sometimes with different ownership levels, others with unlisted shares.  Others have securities that convert to normal securities (Convertible Preference, Warrants etc.) - so these also need to be considered.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Due to these complexities, this sort of data is just not freely available.  Given you only need a date a coupe of years back then the difference may not be crucial for your exercise, but if you need absolute accuracy then you need to look at more professional sources.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With any source you use, you must determine exactly what methodology is used to produce the metrics.&lt;/p&gt;&#xA;" OwnerUserId="13859" LastActivityDate="2015-04-24T05:28:06.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17506" PostTypeId="2" ParentId="17421" CreationDate="2015-04-24T06:42:02.817" Score="0" Body="&lt;pre&gt;&lt;code&gt; public class Aroon&#xA;    {&#xA;        public bool AroonDown&#xA;        {&#xA;            get;&#xA;            set;&#xA;        }&#xA;        public double Period&#xA;        {&#xA;            get;&#xA;            set;&#xA;        }&#xA;        public Aroon()&#xA;        {&#xA;        }&#xA;        public Aroon(double period)&#xA;        {&#xA;            Period = period;&#xA;        }&#xA;        public IList&amp;lt;double&amp;gt; Execute(IList&amp;lt;double&amp;gt; src)&#xA;        {&#xA;            if (!this.AroonDown)&#xA;            {&#xA;                return this.ExecuteUp(src);&#xA;            }&#xA;            return this.ExecuteDown(src);&#xA;        }&#xA;        public IList&amp;lt;double&amp;gt; ExecuteDown(IList&amp;lt;double&amp;gt; src)&#xA;        {&#xA;            double[] period = new double[src.Count];&#xA;            for (int i = 0; i &amp;lt; src.Count; i++)&#xA;            {&#xA;                double num = IndUtil.LowestBarNum(src, i, Period);&#xA;                period[i] = 100 * (Period - num) / Period;&#xA;            }&#xA;            return period;&#xA;        }&#xA;        public IList&amp;lt;double&amp;gt; ExecuteUp(IList&amp;lt;double&amp;gt; src)&#xA;    {&#xA;        double[] period = new double[src.Count];&#xA;        for (int i = 0; i &amp;lt; src.Count; i++)&#xA;        {&#xA;            double num = IndUtil.HighestBarNum(src, i, Period);&#xA;            period[i] = 100 * ((Period - num) / Period);&#xA;        }&#xA;        return period;&#xA;    }&#xA;    }&#xA;&#xA;    public class IndUtil&#xA;    {&#xA;      public static double  HighestBarNum(IList&amp;lt;double&amp;gt; src, int i, double Period)&#xA;        {&#xA;             int maxIndex = -1;&#xA;         double maxValue = Double.MinValue; // Immediately overwritten anyway&#xA;&#xA;            int index = 0;&#xA;&#xA;            int srccount = src.Count();&#xA;            var mincount = Math.Min(i + Period, srccount);&#xA;&#xA;            for (int k = i; k &amp;lt; mincount; k++)&#xA;            {&#xA;                double value = src[k];&#xA;                if (value.CompareTo(maxValue) &amp;gt; 0 || maxIndex == -1)&#xA;                {&#xA;                    maxIndex = index;&#xA;                    maxValue = value;&#xA;                }&#xA;                index++;&#xA;            }&#xA;            return maxIndex;&#xA;        }&#xA;      public static double LowestBarNum(IList&amp;lt;double&amp;gt; src, int i, double Period)&#xA;      {&#xA;          int minIndex = -1;&#xA;          double minValue = Double.MaxValue; // Immediately overwritten anyway&#xA;&#xA;          int index = 0;&#xA;&#xA;&#xA;           int srccount=src.Count();&#xA;           var mincount = Math.Min(i + Period, srccount);&#xA;          for (int k = i; k &amp;lt; mincount; k++)&#xA;          {&#xA;&#xA;              double value = src[k];&#xA;              if (value.CompareTo(minValue) &amp;lt; 0 || minIndex == -1)&#xA;              {&#xA;                  minIndex = index;&#xA;                  minValue = value;&#xA;              }&#xA;              index++;&#xA;          }&#xA;          return minIndex;&#xA;      }&#xA;    }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="3392" LastEditorUserId="3392" LastEditDate="2015-04-24T08:34:53.837" LastActivityDate="2015-04-24T08:34:53.837" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17507" PostTypeId="1" CreationDate="2015-04-24T08:49:27.873" Score="-2" ViewCount="161" Body="&lt;p&gt;Where can I find historical data for WTI Price, gold price, CRB index for my research work?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any website from where I can download these data?&lt;/p&gt;&#xA;" OwnerUserId="16029" LastActivityDate="2015-04-24T09:22:49.597" Title="Finding historical data monthly data" Tags="&lt;data&gt;&lt;finance&gt;&lt;history&gt;" AnswerCount="1" CommentCount="2" ClosedDate="2015-04-24T14:13:07.543" ContentLicense="CC BY-SA 3.0" />
  <row Id="17508" PostTypeId="2" ParentId="17507" CreationDate="2015-04-24T09:22:49.597" Score="1" Body="&lt;p&gt;Although I think your question will be flagged for &quot;basic knowledge&quot; you can find free sources for this data including Yahoo Finance, Quandl.  Commercial data vendors also provide this information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, you really need to define what sort of data you are trying to find.  Spot prices (for physical delivery), spot prices (for cash settled) or futures data (for future physical delivery) or something else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, &quot;gold price&quot; could be the cash-settled FX contract, LBMA &quot;ring&quot; settlements, Gold futures traded on CME/NYMEX, physical gold traded through venues like Perth Mint etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Full disclosure: Norgate/Premium Data offers commodities and futures data.&lt;/p&gt;&#xA;" OwnerUserId="13859" LastActivityDate="2015-04-24T09:22:49.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17509" PostTypeId="2" ParentId="17435" CreationDate="2015-04-24T14:45:25.327" Score="2" Body="&lt;p&gt;This answer could be flagged and progressively closed, because of the fact it probably belongs to the &lt;em&gt;basic financial question&lt;/em&gt; (please, read the &lt;a href=&quot;https://quant.stackexchange.com/help/on-topic&quot;&gt;help center&lt;/a&gt;, before asking something new).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most common online research sites are the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.ssrn.com/en/&quot; rel=&quot;nofollow noreferrer&quot;&gt;SSRN&lt;/a&gt;, particularly, visit the Market Microstructure &lt;a href=&quot;http://papers.ssrn.com/sol3/JELJOUR_Results.cfm?form_name=journalbrowse&amp;amp;journal_id=1504404&quot; rel=&quot;nofollow noreferrer&quot;&gt;eJournal&lt;/a&gt; on SSRN.com;&lt;/li&gt;&#xA;&lt;li&gt;Google &lt;a href=&quot;https://scholar.google.it/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Scholar&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;They are really good websites, since they allow to customize the research by sorting for relevance, &lt;em&gt;date&lt;/em&gt; (that's practically what you need for), ...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suggest you to visit some academic journals as, for instance, the Journal of quantitave finance or others like that (you can find the list just googling on the internet &quot;&lt;em&gt;finance academic journal list&lt;/em&gt;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As regards this quant.SE, look at this &lt;a href=&quot;https://quant.stackexchange.com/questions/9911/book-on-market-microstructure&quot;&gt;question&lt;/a&gt;; different users provided a list of books in which you could find something of interest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly, I suggest you to visit &lt;a href=&quot;http://arxiv.org/multi?group=grp_q-fin&amp;amp;%2Ffind=Search&quot; rel=&quot;nofollow noreferrer&quot;&gt;arXiv.org&lt;/a&gt; that, IMHO, is one of the best sources for quantitative finance &amp;amp; market microstructure.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2015-04-28T09:16:51.527" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17511" PostTypeId="2" ParentId="17421" CreationDate="2015-04-25T06:34:57.777" Score="0" Body="&lt;p&gt;AROON Indicator is a built-in function in &lt;a href=&quot;http://ta-lib.org/function.html&quot; rel=&quot;nofollow&quot;&gt;TA-lib&lt;/a&gt;, you should try it first rather than implement it yourself.&lt;/p&gt;&#xA;" OwnerUserId="5427" LastActivityDate="2015-04-25T06:34:57.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17514" PostTypeId="1" AcceptedAnswerId="17521" CreationDate="2015-04-25T14:32:53.580" Score="0" ViewCount="53" Body="&lt;p&gt;Problem 5.4i in Shreve examines a symmetric random walk. Let $\tau_2 $ be the first time that the random walk reaches 2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For $\alpha\in (0, 1) $, we are given that &#xA;$$E [\alpha ^ {\tau_2}] =\sum_{k = 1} ^\infty (\alpha/2) ^ {2k}\frac{(2k)!}{(k+1)!k!}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's clear that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E [\alpha ^ {\tau_2}] =\sum_{k = 1} ^\infty (\alpha) ^ {2k} P (\tau_2 = 2k) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's therefore tempting to conclude that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P (\tau_2 = 2k)=\frac{(2k)!}{(k+1)!k!}2^{-2k}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And indeed that is the answer given. But in general $\sum_i f_i g_i =\sum_i f_i h_i$ does not imply that $g_i = h_i$ and so I'm not sure how we can reach this conclusion. (Asked about specific circumstances where this conclusion is true &lt;a href=&quot;https://math.stackexchange.com/questions/1238930/when-can-we-assume-this-identity-about-series&quot;&gt;here&lt;/a&gt;.) What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="5361" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2015-04-25T22:23:55.737" Title="A problem involving random walks from Shreve" Tags="&lt;random-walk&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17516" PostTypeId="1" AcceptedAnswerId="17575" CreationDate="2015-04-25T14:52:39.680" Score="2" ViewCount="6518" Body="&lt;p&gt;How can i download historical price data from interactive brokers using IbPy and python? &lt;/p&gt;&#xA;" OwnerUserId="13647" LastActivityDate="2015-04-28T18:00:05.043" Title="IbPy download historical price data" Tags="&lt;python&gt;&lt;interactive-brokers&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17520" PostTypeId="1" AcceptedAnswerId="17536" CreationDate="2015-04-25T19:14:32.460" Score="2" ViewCount="312" Body="&lt;p&gt;I have a very simple problem that hopefully someone could help me with or at least point me in the right direction. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am testing to see which factors affect index returns the most and would like to find the correct way to transform variables used in the multiple regression model. The data sample covers the time period 1990 - 2013 with a quarterly frequency (96 observations).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For my &lt;em&gt;dependent variable&lt;/em&gt;, I have calculated quarterly index returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the &lt;em&gt;independent variables&lt;/em&gt; set, I have collected quarterly data for: &#xA;CPI%, 3 year rate, 10 year rate, unemployment rate, and a couple of exchange rates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should I calculate quarterly % changes for all of my variables(since I used quarterly returns for my dependent), leave them unchanged(and use index values instead of returns), or change them in a different way?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a screenshot of my current data set:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/XvvxK.png&quot; alt=&quot;Current Data Set&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="16040" LastEditorUserId="2553" LastEditDate="2015-04-28T11:04:50.367" LastActivityDate="2015-05-15T20:14:43.290" Title="Transforming Variables in Regression" Tags="&lt;data&gt;&lt;regression&gt;&lt;factor-models&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17521" PostTypeId="2" ParentId="17514" CreationDate="2015-04-25T20:34:50.423" Score="1" Body="&lt;p&gt;It's true that in general if $\sum_i f_i g_i = \sum_i f_i h_i$, we do not automatically have $g_i = h_i$. But this sum is special, because all $f_i$ are monomials (i.e. of the form $\alpha^n$). This makes the sum a power series (of the form $\sum_{n=0}^\infty \alpha^n C_n$), and these series have a lot of nice properties such as continuity and differentiability (with respect to $\alpha$). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now suppose we have two series representation of the same function:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$F(\alpha) = \sum_{n=0}^\infty\alpha^n C_n$$&#xA;$$F(\alpha) = \sum_{n=0}^\infty\alpha^n D_n$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this imply $C_n = D_n$? Yes. Yes it does. Precisely because we are dealing with a power series. One way to see this is to think of the series representation as a Taylor series in $\alpha$. The Taylor series is unique, so we automatically have $C_n = D_n = \frac{1}{n!}\frac{\partial^n}{\partial\alpha^n}F\Big|_{\alpha=0}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where does this equality come from? A non-formal proof goes likes this:&#xA;Take the limit of $\alpha\downarrow 0$. In that case we recover $F(0) = C_0 = D_0$. That proves $C_0 = D_0$. Next, differentiate the series with respect to $\alpha$, and again take the limit of $\alpha$ to zero. This can be done because power series are differentiable. You will then recover that $C_1=D_1$. You now get the trick: to prove that $C_n = D_n$ you differentiate $n$ times and take the limit of $\alpha$ to zero. This proves the equality.&lt;/p&gt;&#xA;" OwnerUserId="3371" LastEditorUserId="3371" LastEditDate="2015-04-25T22:23:55.737" LastActivityDate="2015-04-25T22:23:55.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17522" PostTypeId="1" AcceptedAnswerId="17523" CreationDate="2015-04-26T02:05:56.550" Score="4" ViewCount="3263" Body="&lt;p&gt;Very new to pricing models. Is there a general guideline when to use binomial tree and when trinomial tree is preferred? As far as I know, unlike binomial tree, trinomial tree only gives a range instead of  a unique value. Thank you.&lt;/p&gt;&#xA;" OwnerUserId="6396" LastActivityDate="2015-04-26T02:19:32.133" Title="Binomial tree vs trinomial tree in pricing options" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;quant-trading-strategies&gt;&lt;binomial-tree&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17523" PostTypeId="2" ParentId="17522" CreationDate="2015-04-26T02:19:32.133" Score="5" Body="&lt;p&gt;you have to be careful to distinguish between trinomial trees in a theoretical sense which do not give unique prices, and trinomial trees chosen as an approximation to the risk-neutral measure of the BS model. In the second case, they are an effective numerical method as are binomial trees. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Trinomial trees are more useful when you want to ensure nodes lie on a given level such as a barrier since this gives better convergence. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I discuss the theoretical point you are making at length in More Mathematical Finance. I have done paper on numerical comparisons as well, see my ssrn author page. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=550354&quot; rel=&quot;noreferrer&quot;&gt;http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=550354&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-04-26T02:19:32.133" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17524" PostTypeId="2" ParentId="17520" CreationDate="2015-04-26T04:15:58.103" Score="2" Body="&lt;p&gt;Basic rules for what you want to follow to have a meaningfull result&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1 All your variables should be in the same terms &#xA;2.All your regression variables should be stationary (weak sense stationary) - check if there are long term dependencies &#xA;3.Test for multi-collinearity / Serial correlation / Homocedasticity each variable against the predictor. &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7616" LastEditorUserId="7616" LastEditDate="2015-05-15T20:14:43.290" LastActivityDate="2015-05-15T20:14:43.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17525" PostTypeId="1" AcceptedAnswerId="17533" CreationDate="2015-04-26T04:23:15.853" Score="1" ViewCount="118" Body="&lt;p&gt;I came across a question as such: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Suppose company IBC is trading at \$75 per share. What does it cost to construct a derivative security that pays exactly one dollar when IBC hits $100 for the first time? Ignore dividends, assume a riskless interest rate of zero, assume all assets are infinitely divisible, ignore any short sale restriction.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;There is a solution using the no-arbitrage argument. But my intuition is to use the martingale. Since the interest rate is zero, if the stock follows geometric Brownian motion, then the drift term become zero, so the stock price becomes a martingale. If we use the martingale property $E[S_{0}] = E[S_{T}]$, and assume the upper bound of stock price is 100, lower bound is 0, then we can calculate the probability $\alpha$ of hitting \$100 at time T&#xA;$$ E[S_{T}] = \alpha\times\$100 + (1-\alpha)\times\$0 = E[S_{0}] = 75 $$&#xA;we get $\alpha = 0.75$, so the expected pay off of the derivative is &#xA;$$ \$0.75=0.75\times\$1 + (1-0.75)\times\$0$$&#xA;hense the price of the derivative should be \$0.75.&#xA;I don't have much background in Probability or martingale theory, so is this a valid argument to solve this problem?&lt;/p&gt;&#xA;" OwnerUserId="12003" LastActivityDate="2015-04-26T15:10:37.570" Title="Stock price is a martingale if the riskless interest rate is zero?" Tags="&lt;derivatives&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17526" PostTypeId="1" AcceptedAnswerId="17546" CreationDate="2015-04-26T05:07:45.970" Score="3" ViewCount="6866" Body="&lt;p&gt;By definition a wiener process cannot be differentiated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when we use Ito's lemma on $F = X^2$, where X is wiener process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;we have total change in &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dF = 2XdX + dt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can we calculate $\frac{dF}{dX}$ when by definition it cannot be differentiated? Isin't this contradiction by definition?&lt;/p&gt;&#xA;" OwnerUserId="8163" LastEditorUserId="26242" LastEditDate="2018-05-15T16:28:29.777" LastActivityDate="2018-05-15T16:28:29.777" Title="How to differentiate a brownian motion?" Tags="&lt;stochastic&gt;&lt;wiener&gt;" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="17527" PostTypeId="1" CreationDate="2015-04-26T05:15:44.617" Score="1" ViewCount="133" Body="&lt;p&gt;I ran a regression on two stocks.  I don't have the data in front of me, but it is a more conceptual question.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say SP500 returned a total 23% return over this time period and MSFT returned 9%.  I ran the regression in R: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; summary(lm(MSFT~SP500,data=mydata))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The coefficients show an intercept of around .003 and coefficient of around 1.5 for the SP500.  The beta is statistically significant at around the 99.9% confidence and the intercept is NOT - only around 38% interval.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now my understanding of 'alpha' or the intercept - is that it is the 'excess return' that could be gained by investing in a strategy.  I am confused how alpha could ever be positive if the Y value that you are comparing (MSFT) is less than the X (SP500).     Here each 1% change in the Sp500 returned a 1.5% in microsoft, but to actually have a positive alpha - even a minuscule amount and even though its not statistically significant - is hurting my head.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If anyone could just explain the relationship of the intercept in a basic regression like this and practical relationship of the betas I would appreciate it. Would I ever get a positive alpha when MSFT's return is LESS than the SP500 and MSFT=Y, SP500=X?&lt;/p&gt;&#xA;" OwnerUserId="16042" LastActivityDate="2015-04-26T05:15:44.617" Title="Confused on interpretation of betas/alphas in regression in finance" Tags="&lt;returns&gt;&lt;finance&gt;&lt;regression&gt;&lt;beta&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17528" PostTypeId="1" AcceptedAnswerId="17531" CreationDate="2015-04-26T08:40:14.847" Score="2" ViewCount="205" Body="&lt;p&gt;One of the standard tenets of quantitative finance is that options should have an intrinsic value because optionality as such (in the sense of having more choices) should bring about value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems to make sense intuitively - yet intuition can sometimes be misleading as we all know: &lt;a href=&quot;http://en.wikipedia.org/wiki/Braess&amp;#39;s_paradox&quot; rel=&quot;nofollow&quot;&gt;Braess's paradox&lt;/a&gt; is called a paradox because here additional choices (i.e. options) can lead to worse overall performance, i.e. reducing the value for all participants. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question&lt;/strong&gt;&lt;br&gt;&#xA;Are you aware of (theoretic or special) situations where additional optionality in instruments of quantitative finance (e.g. some exotic options or in some pricing models) could lead to &lt;em&gt;lower&lt;/em&gt; value? &lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2015-04-26T09:08:17.937" LastActivityDate="2015-04-26T11:32:39.940" Title="Braess's paradox in quantitative finance: When optionality leads to lower value...?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;derivatives&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17529" PostTypeId="2" ParentId="17421" CreationDate="2015-04-26T09:09:19.000" Score="2" Body="&lt;p&gt;I answered @Anilca's question in &lt;a href=&quot;https://stackoverflow.com/questions/29747848/calculating-aroon-indicator-series/29851836#29851836&quot;&gt;SO&lt;/a&gt; (and the answer was accepted)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I summarize my answer with the working solution:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;public class Aroon : IndicatorCalculatorBase&#xA;{&#xA;&#xA;    public override List&amp;lt;OhlcSample&amp;gt; OhlcList { get; set; }&#xA;    private readonly int _period;&#xA;&#xA;    public int Period&#xA;    {&#xA;        get { return _period; }&#xA;    }&#xA;&#xA;    public Aroon(int period)&#xA;    {&#xA;        _period = period;&#xA;    }&#xA;&#xA;    public override IIndicatorSerie Calculate()&#xA;    {&#xA;        var aroonSerie = new AroonSerie();&#xA;        for (var i = _period; i &amp;lt; OhlcList.Count; i++)&#xA;        {&#xA;&#xA;            var aroonUp = CalculateAroonUp(i);&#xA;            var aroonDown = CalculateAroonDown(i);&#xA;&#xA;            aroonSerie.Down.Add(aroonDown);&#xA;            aroonSerie.Up.Add(aroonUp);&#xA;        }&#xA;&#xA;        return aroonSerie;&#xA;    }&#xA;&#xA;    private double CalculateAroonUp(int i)&#xA;    {&#xA;        var maxIndex = FindMax(i - _period, i);&#xA;&#xA;        var up = CalcAroon(i - maxIndex);&#xA;&#xA;        return up;&#xA;    }&#xA;&#xA;    private double CalculateAroonDown(int i)&#xA;    {&#xA;        var minIndex = FindMin(i - _period, i);&#xA;&#xA;        var down = CalcAroon(i - minIndex);&#xA;&#xA;        return down;&#xA;    }&#xA;&#xA;    private double CalcAroon(int numOfDays)&#xA;    {&#xA;        var result = ((_period - numOfDays)) * ((double)100 / _period);&#xA;        return result;&#xA;    }&#xA;&#xA;    private int FindMin(int startIndex, int endIndex)&#xA;    {&#xA;        var min = double.MaxValue;&#xA;        var index = startIndex;&#xA;        for (var i = startIndex; i &amp;lt;= endIndex; i++)&#xA;        {&#xA;            if (min &amp;lt; OhlcList[i].Low)&#xA;                continue;&#xA;&#xA;            min = OhlcList[i].Low;&#xA;            index = i;&#xA;        }&#xA;        return index;&#xA;    }&#xA;&#xA;    private int FindMax(int startIndex, int endIndex)&#xA;    {&#xA;        var max = double.MinValue;&#xA;        var index = startIndex;&#xA;        for (var i = startIndex; i &amp;lt;= endIndex; i++)&#xA;        {&#xA;            if (max &amp;gt; OhlcList[i].High)&#xA;                continue;&#xA;&#xA;            max = OhlcList[i].High;&#xA;            index = i;&#xA;        }&#xA;        return index;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;P.S&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Guys, i usually active at SO... if anyone need clarifications, please ask in the &lt;a href=&quot;https://stackoverflow.com/questions/29747848/calculating-aroon-indicator-series/29851836#29851836&quot;&gt;source question&lt;/a&gt; (and feel free to do this)&lt;/p&gt;&#xA;" OwnerUserId="16034" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2015-04-26T09:09:19.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17530" PostTypeId="2" ParentId="17528" CreationDate="2015-04-26T11:09:54.587" Score="0" Body="&lt;p&gt;Maybe something like the option to lend money at negative interest would bring about a lower optionality value...&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2015-04-26T11:09:54.587" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17531" PostTypeId="2" ParentId="17528" CreationDate="2015-04-26T11:32:39.940" Score="2" Body="&lt;p&gt;if only one person can make a choice, it strikes me as unlikely that it can reduce value. Ultimately, a choice means that the holder can choose between one of a number of portfolios on a given date. They will choose the one of maximal value. As long as the without choice portfolio was one of the ones they could have chosen, value can only go up.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-04-26T11:32:39.940" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17532" PostTypeId="2" ParentId="17526" CreationDate="2015-04-26T15:06:04.870" Score="1" Body="&lt;p&gt;You are right that a Wiener process can not be differenciated in the conventional way since the derivative in respect to time does not exist. For this reason Ito lemma should be used to integrate and differenciate Brownian or Wiener processes as these are considered ito processes. &lt;/p&gt;&#xA;" OwnerUserId="7616" LastActivityDate="2015-04-26T15:06:04.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17533" PostTypeId="2" ParentId="17525" CreationDate="2015-04-26T15:10:37.570" Score="0" Body="&lt;p&gt;Your derivation is incorrect because the option does not have a fixed maturity $T$. Instead it ends whenever the stock reaches 100. Mathematically this means that we have a stopping time which is a random variable $\tau(\omega) = \inf \{t \ge 0 | S_t(\omega) = 100\}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is usually assumed that the stock price eventually reaches 100 i.e. that $\tau$ is almost surely finite. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under this assumption this case $S_\tau$ is well defined and is always equal to $1$. Note that $E[S_\tau] \neq E[S_0]$ even though $S$ is a martingale. This is because the stopping time $\tau$ is not bounded so the optional stopping theorem does not apply.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution to the exercise is to think in terms of delta-hedging. How much of the stock do you need to hold to hedge your risk? At time $\tau$, the stock is worth $S_\tau = \$100$. So you can replicate your payoff by buying $1\%$ of the stock at time 0 and holding it until it reaches $\$100$ to pay the $\$1$. So the price of the derivative is $S_0/S_{\tau} = \$0.75$.&lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2015-04-26T15:10:37.570" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17534" PostTypeId="2" ParentId="17526" CreationDate="2015-04-26T15:40:08.187" Score="2" Body="&lt;p&gt;We write the differential form of Ito formula for simplification. Actually, the differential form for Ito formula&#xA;$$&#xA;dF(W(t)) = 2W(t)dW(t) + dt&#xA;$$&#xA;means the integral form for Ito formula,&#xA;$$&#xA;\int{dF} = \int{2W(t)dW(t)} + \int{dt}&#xA;$$&#xA;which make sense in mathemaitcs.&lt;/p&gt;&#xA;" OwnerUserId="15919" LastActivityDate="2015-04-26T15:40:08.187" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17535" PostTypeId="1" AcceptedAnswerId="17541" CreationDate="2015-04-26T17:26:06.677" Score="1" ViewCount="2642" Body="&lt;p&gt;I would like to calculate the Conditional Value at Risk for a portfolio. To be honest, I'm trying for a few days to find an example to calculate for an entire portfolio, not just for one security and I really have a hard time understanding. All the examples are for a single security. I need to add that I'm at the beginning of learning econometrics/statistics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say that I have a portfolio composed from 3 investments.&#xA;If I want to calculate CVaR using Monte Carlo prices from the 3 investments, here is what I'm thinking:&#xA;1. create a simulated portfolio of 3 investments and take into the account the nominal value of every security and the direction (long/short).&#xA;2. run the above portfolio through Monte Carlo for n times and generate a distribution of P/L by calculating the difference between start and end of NAV for every MC iteration.&#xA;3. let's say I want to calculate at 99% confidence ratio. Then I get the mean of 1% of the worst losses resulted from the Monte Carlo distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to emphasize that I don't want to use a normal distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are the steps above correct for finding the CVaR of a portfolio? Also, does respect the coherent risk measure? Thank you.&lt;/p&gt;&#xA;" OwnerUserId="16043" LastActivityDate="2015-04-26T21:23:02.420" Title="Calculate CVaR for a portfolio" Tags="&lt;monte-carlo&gt;&lt;portfolio&gt;&lt;cvar&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17536" PostTypeId="2" ParentId="17520" CreationDate="2015-04-26T17:49:04.530" Score="1" Body="&lt;p&gt;I suggest you to implement all the analysis you cited above and analyze the results choosing the best model on model performance measures, as, for instance, the model $R^2$ value, the AIC (BIC) value, etc.; this should be the proper way to develop a model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As regards your question particularly, the literature about the topic suggest to develop the model on the basis of the change in percentages of all variables you consider developing the factor model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the matter of the transformation of the dependent variable, you should consider the possibility of transforming that in returns to fulfill the assumptions of the linear regression model; indeed, the logarithmic returns are distributed according to the Normal distribution if they are in the range [-0.04; +0.04] according to the Taylor approximation, and it is more likely to produce normally distributed residuals; the values outside this range should be considered as outliers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same for independent variable; you should transform those in change in percentage variable, if they're not yet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly, it is easier to analyze log-log regression model results than level-log or log-level model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As last hint, I firstly suggest you to develop a model taking into account the linear regression model assumption and testing for the reliability of those hypothesis after running the model (test for homoschedasticity, autocorrelation, multicollinearity,...). Moreover, try to build a reliable dataset; using quarterly data you can have less observation and get biased results. So, if possible, use higher frequency data than yours, as, for instance, monthly, weekly, daily data.&#xA; &lt;strong&gt;EDIT&lt;/strong&gt;: since your dataset is pretty small (~96 observations), you should try to get more data to improve your analysis by collecting data previous to the 1990 or later of 2013.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-04-28T07:50:55.633" LastActivityDate="2015-04-28T07:50:55.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17537" PostTypeId="1" CreationDate="2015-04-26T18:14:13.220" Score="3" ViewCount="48" Body="&lt;p&gt;I have worked my way through this &lt;a href=&quot;http://www.engr.wisc.edu/ece/faculty/barmish_ross/FILE_07.pdf&quot; rel=&quot;nofollow&quot;&gt;article&lt;/a&gt;, waiting to get into school I have been self-learning a bit. I have a good grasp on most of the article, but the component strategy of Saturation and Reset are a little confusing to me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When the control parameter exceeds it's defined maximum, the article stipulates Saturation events occur.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$I(k^* + j + 1) = \min\{I(k^*+j) + K\Delta g(k^*+j), I_\textrm{max}\}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this formula found on page 3 mean when the value of the position exceeds the maximum position allowed by the control parameter, excess is liquidated until the position is under the maximum? If not, what is going on here? Is the position simply treated as the maximum, if so, why? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any helps.&lt;/p&gt;&#xA;" OwnerUserId="16044" LastEditorUserId="848" LastEditDate="2015-04-26T19:24:36.060" LastActivityDate="2015-04-26T19:24:36.060" Title="Clarification of Saturation-Reset Regimes" Tags="&lt;portfolio-management&gt;&lt;automated-trading&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17538" PostTypeId="1" CreationDate="2015-04-26T19:08:08.430" Score="1" ViewCount="148" Body="&lt;p&gt;I want to know if anybody can suggest me a good textbook which explains in detail and in an understandable way how to create replicating portfolios of financial instruments like options &quot;cash or nothing&quot;, &quot;asset or nothing&quot;. Moreover I want to know if there's any good book which explains the change of measure between objective probability and risk neutral probability... Sorry for the newbie question, but I'm attending a course about this stuff and the professor provides lecture notes badly written that don't tell the whole story...&lt;/p&gt;&#xA;" OwnerUserId="16045" LastActivityDate="2015-04-26T19:17:44.663" Title="Good book about replicating portfolios" Tags="&lt;options&gt;&lt;risk-neutral-measure&gt;&lt;replication&gt;&lt;coherent-risk-measure&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17539" PostTypeId="2" ParentId="17538" CreationDate="2015-04-26T19:17:44.663" Score="2" Body="&lt;p&gt;As always I recommend reading &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0521552893&quot; rel=&quot;nofollow&quot;&gt;Rennie and Baxter&lt;/a&gt; for an introduction to option pricing that's not too technical and gives intuition about how it all works.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2015-04-26T19:17:44.663" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17540" PostTypeId="2" ParentId="10480" CreationDate="2015-04-26T21:00:51.940" Score="1" Body="&lt;p&gt;The relation between volume and the price dynamics (via volatility and jumps), has been explored by various academic papers. Just cite this one and its contained references:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.295.8024&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow&quot;&gt;Wang, T., &amp;amp; Huang, Z. (2012). The relationship between volatility and trading Volume in the Chinese Stock Market: A volatility decomposition perspective. Annals of Economics and Finance, 13(1), 211-236.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have a look at it you will read&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;volatility and volumes are positively correlated at any time scale,&lt;/li&gt;&#xA;&lt;li&gt;and if you zoom enough to see &quot;jumps&quot; in the price you will note a negative correlation between them.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;It is usually explained by the &quot;common&quot; trading activity generating the continuous component of volatility, but information generates jumps and do not need a lot of volume. Moreover jumps are followed by low volumes.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2015-04-28T12:20:04.300" LastActivityDate="2015-04-28T12:20:04.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17541" PostTypeId="2" ParentId="17535" CreationDate="2015-04-26T21:23:02.420" Score="2" Body="&lt;p&gt;This sounds correct, however step 2 is a little vague, so I will try to restate the steps here for you. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The assets in your portfolio must be priced with respect to a set of risk factors (e.g. interest rate curve).&lt;/li&gt;&#xA;&lt;li&gt;Each scenario consists of a value for each of your risk factors. Given the value of your risk factors you can price your portfolio. &lt;/li&gt;&#xA;&lt;li&gt;You want to generate a number of scenarios ($S_i$). Your choice on the number of scenarios chosen depends on the number of your assets, the way you choose to model your risk-factors, what your confidence interval is and time/computational constraints. The way you generate these scenarios is important. For example take a look at &lt;a href=&quot;https://en.wikipedia.org/wiki/Short-rate_model&quot; rel=&quot;nofollow&quot;&gt;short-rate models&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;You price your portfolio for each $S_i$. &lt;/li&gt;&#xA;&lt;li&gt;Sort the portfolio values $V_i$ for each $S_i$.&lt;/li&gt;&#xA;&lt;li&gt;For CVaR, as you say, you can average the $V-i$'s that correspond to a loss higher than the $a^{th}$ percentile. For more information. This is the most helpful introductory paper I have found on the topic: &lt;a href=&quot;http://www.ise.ufl.edu/uryasev/files/2011/11/cvar2_jbf.pdf&quot; rel=&quot;nofollow&quot;&gt;paper by Rockafellar and Uryasev&lt;/a&gt;. It has details on how to calculate CVaR. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And, yes, CVaR is a coherent risk measure. &lt;/p&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2015-04-26T21:23:02.420" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17542" PostTypeId="2" ParentId="17422" CreationDate="2015-04-27T00:07:50.750" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://thinxlabs.com/blog/finance/basis-swap-curves-pricing/&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; you can find what you need for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It explains how to build &amp;amp; price a basis swap curve in a step-by-step procedure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The link leads on the 2nd page to the guide (relative to the question), but, I suggest you to start from the 1st post.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-04-27T00:07:50.750" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17543" PostTypeId="1" AcceptedAnswerId="17544" CreationDate="2015-04-27T00:59:24.067" Score="0" ViewCount="88" Body="&lt;p&gt;The biggest companies have multiple owners which dilute the authority and finances of the company. They are either publicly traded companies via selling shares through stock markets, or privatly owned with multiple percentage of shares held by stake holders or board members. Why aren't there any billion dollar single owned companies (e.g. one founder who never sold his shares or gave up equity)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just curious because often times the founder(s) of a successful company, especially in tech startups have to bring their own idea to fruition from the early startup phase, often times carrying the company on their back for the first 6 months or so.&lt;/p&gt;&#xA;" OwnerUserId="16049" LastActivityDate="2015-04-27T03:07:05.153" Title="Why aren't there any single owner companies over a billion dollars?" Tags="&lt;equities&gt;&lt;corporate-actions&gt;" AnswerCount="2" CommentCount="0" ClosedDate="2015-04-27T05:08:43.587" ContentLicense="CC BY-SA 3.0" />
  <row Id="17544" PostTypeId="2" ParentId="17543" CreationDate="2015-04-27T02:56:27.500" Score="1" Body="&lt;p&gt;This isn't a question related to quantitative finance. I'm voting to close but I will answer your question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume by &quot;giving up equity&quot;, you exclude &quot;giving up equity&quot; to family or charitable trusts endowed by family. In that case, your premise is incorrect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bosch is one of the largest companies in the world by employee count. 100% of it is owned by the Bosch family and their foundation and I don't think they've ever had to sell their shares or give up equity. There are several other large companies in Europe and Asia that have been family-owned for their entire history. &lt;a href=&quot;https://en.wikipedia.org/wiki/Weyerhaeuser&quot; rel=&quot;nofollow&quot;&gt;Weyerhaeuser&lt;/a&gt; is family-owned and never had to give up equity as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's rarer in the United States than in other countries. As naive as this sounds, it probably has to do with capitalism and corporate culture in the United States. The ecosystem for public funding in United States still completely dominates that in every other part of the world. From the day you start a company, you are led to believe (and I think it's both a justified and true belief) that it's better to own a small part of a large pie than a large part of a small pie. I think it's a good thing.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2015-04-27T02:56:27.500" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17545" PostTypeId="2" ParentId="17543" CreationDate="2015-04-27T03:07:05.153" Score="0" Body="&lt;p&gt;I don't think you're looking hard enough.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Several in here:&#xA;&lt;a href=&quot;http://www.bloomberg.com/billionaires/&quot; rel=&quot;nofollow&quot;&gt;http://www.bloomberg.com/billionaires/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13859" LastActivityDate="2015-04-27T03:07:05.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17546" PostTypeId="2" ParentId="17526" CreationDate="2015-04-27T12:02:20.223" Score="6" Body="&lt;p&gt;In order to apply Ito's lemma, your function needs to be a twice-differentiable function. There is no issue with the non-differentiability of the Wiener process. $\frac{dF}{dX}$ involves differentiating F, not the Wiener process X.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using a simple analogy: instantaneous velocity ($\frac{dD}{dt}$) is the derivative of position (D) over time; what is differentiated is not time, but distance. I believe this is where your confusion stems from.&lt;/p&gt;&#xA;" OwnerUserId="15336" LastActivityDate="2015-04-27T12:02:20.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17547" PostTypeId="1" AcceptedAnswerId="17563" CreationDate="2015-04-27T12:59:54.757" Score="6" ViewCount="343" Body="&lt;p&gt;I have a very simple model (CIR) with a very simple discretisation scheme (Euler) and I use it to do Monte-Carlo Simulations. It is working. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Someone insisted that renormalization of my random variables would give better results. I.e. after drawing my normally distributed random variables I should translate them to obtain exactly mean 0 and multiply it to obtain variance 1. I have never heard of this simple technique before. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On a theoretical point of view I am unsure that my new random variables have the normal distribution I wanted. On a practical point of view the change in the result is ridiculous.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this technique really working ? Do you have an exemple where this is usefull ? Or a counter exemple where this is very wrong ?&lt;/p&gt;&#xA;" OwnerUserId="5052" LastActivityDate="2015-04-28T17:51:48.167" Title="(Re) normalisation of random variable in Monte-Carlo simulations" Tags="&lt;monte-carlo&gt;&lt;random-variables&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17548" PostTypeId="2" ParentId="17457" CreationDate="2015-04-27T13:47:49.880" Score="1" Body="&lt;p&gt;Look at &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1566975&quot; rel=&quot;nofollow&quot;&gt;Gilli &amp;amp; Schumann&lt;/a&gt;'s paper.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They provide a Bates' model &lt;em&gt;estimates set&lt;/em&gt;, the way to improve such estimates calibrating those ones using an Heuristic model and, lastly, the relative codes in matlab, in order to be able to replicate the model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, there are not available the relative call prices estimated time series; I think that noone will post it for free. Anyway, although I did not try personally, I think you can compute those by using their codes too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same methodology is used for the Heston's model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the end, by commenting the result they got, they compared all three models analyzed and provided a conclusion about the analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this may help you.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-04-27T13:47:49.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17550" PostTypeId="1" CreationDate="2015-04-27T14:29:06.890" Score="4" ViewCount="220" Body="&lt;p&gt;I am trying to create a model that forecasts trading costs (using end of day data, so no intra day data). My trading cost (also called Implemented Shortfall (IS) is defined as such for a single stock,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;IS = (vwap - open) / open&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;for the market as a whole,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;IS = abs(IS_single_stock - IS_market_median)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Variables that I am looking at include a companies market cap, the daily spread, vwap, volume &amp;amp; a liquidity measure called liq_m.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Doing a simple linear regression of each variable against IS produced very low r-squares, below 0.1. Combining the variables did very little to to improve the results. The residual plots appear to have some pattern, the one below is similar for most of the variables, this is mcap vs IS residuals. &lt;img src=&quot;https://i.stack.imgur.com/uSx1c.png&quot; alt=&quot;residual plot, mcap vs IS&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The normal probability plot also highlights that the residuals are not linear &amp;amp; have a left skew.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/FZ0wf.png&quot; alt=&quot;normal probability plot of residuals&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the literal I have read on implemented shortfall all the models are non linear models so this is not unexpected. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am unsure though of how to proceed next i.e. how to select an appropriate non linear model for testing? The end goal is to have a model that allows me to forecast the cost of trading a certain company.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below are two more plots. One is the daily plot of mcaps over time - a mean is used to calculate the mcap of the 100 companies used in the sample. Beneath that is the Implemented Shortfall again a mean is used in the plot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/8k44V.png&quot; alt=&quot;mcap over time&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/TT2Bm.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="7530" LastEditorUserId="2299" LastEditDate="2018-06-24T12:34:24.947" LastActivityDate="2018-07-24T22:00:55.913" Title="forecasting trading costs with end of day data" Tags="&lt;equities&gt;&lt;quant-trading-strategies&gt;&lt;trading&gt;&lt;market-microstructure&gt;&lt;automated-trading&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17551" PostTypeId="5" CreationDate="2015-04-27T14:35:41.807" Score="0" Body="&lt;p&gt;It is a particular trade methodology that allow investors to make profits by exploiting price differences of identical or similar financial instruments, on different markets or in different forms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The existence of the possibility to make an arbitrage in finance is a proof of the existence of market inefficiencies, as suggested by the academic literature.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It also provides a mechanism to ensure prices do not deviate substantially from fair value for long periods of time.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-04-27T15:18:40.633" LastActivityDate="2015-04-27T15:18:40.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17552" PostTypeId="4" CreationDate="2015-04-27T14:35:41.807" Score="0" Body="The simultaneous purchase and sale of a financial security in order to profit from the difference in the security price during the trading activity.&#xD;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-04-27T15:18:46.820" LastActivityDate="2015-04-27T15:18:46.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17553" PostTypeId="1" AcceptedAnswerId="17562" CreationDate="2015-04-27T14:53:56.120" Score="1" ViewCount="453" Body="&lt;p&gt;The following question assumes familiarity with the discrete model described in chapter 5 of Steven Roman's &quot;Introduction to the Mathematics of Finance&quot;, 2nd edition, Springer 2012. I will not describe the model or the associated notation in this post.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The Law of One Price (p. 132) states that, in the absence of arbitrage opportunity in the market,&#xA;$$&#xA;\mathcal{V}_T(\Phi_1) = \mathcal{V}_T(\Phi_2) \implies \mathcal{V}_k(\Phi_1) = \mathcal{V}_k(\Phi_2)&#xA;$$&#xA;for all times $0 \leq k \leq T$ and for all self-financing trading strategies $\Phi_1$ and $\Phi_2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, no proof is provided in the text (in fact, this law is stated as a definition rather than a theorem). Why does this law hold?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Additionally, it is implied by the text following the statement of the Law of One Price, that, if the market has no arbitrage opportunity, then, given an attainable alternative $X$, if a new asset $a^*$ is introduced into the market and is priced in such a way that its payoff at time $t_T$ is $X$ and its pricing is consistent with the Law of One Price, i.e. for every $k \in \{0, 1, \dots, T\}$, $S_{a^*, k} := \mathcal{V}_k(\Phi)$, where $\Phi$ is any self-financing trading strategy such that $\mathcal{V}_T(\Phi) = X$, then the resulting, extended market will still have no arbitrage opportunity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is this so?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="15619" LastEditorUserId="15619" LastEditDate="2015-04-27T18:35:31.237" LastActivityDate="2015-04-28T22:01:15.057" Title="The Law of One Price in a discrete model" Tags="&lt;asset-pricing&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17554" PostTypeId="5" CreationDate="2015-04-27T16:17:02.860" Score="0" Body="&lt;p&gt;Security analysis methodology used to forecast the prices direction based on the past market data study, mainly the asset price and the relative volume.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is mainly based on several techniques that allow to analyze charts by seeking to identify market trends in financial markets and to exploit those price patterns.&#xA;Some of the most famous patterns are the head &amp;amp; shoulders pattern and the top/bottom patterns; another famous technique implies the use of market indicators, as, for instance, moving averages, support and resistance level, channels etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The forecast accuracy of both technical and fundamental analysis is disputed by the efficient market hypothesis, according to which the entirely unpredictable and cannot be forecasted.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-04-27T17:37:22.543" LastActivityDate="2015-04-27T17:37:22.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17555" PostTypeId="4" CreationDate="2015-04-27T16:17:02.860" Score="0" Body="Security analysis methodology used to forecast the prices direction based on the past market data study." OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-04-27T17:37:17.430" LastActivityDate="2015-04-27T17:37:17.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17556" PostTypeId="1" CreationDate="2015-04-27T16:48:11.007" Score="14" ViewCount="8080" Body="&lt;p&gt;OK, I admit that this is a frequently asked question. But I couldn't find a satisfying answer after I read the explanations of books, went through the derivations of B-S formula, and searched answers online. My question is that, &#xA;I can understand the derivation of the B-S formula, but what is the intuition that the expected return rate of a stock has nothing to do with its option price?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose I have two stocks A and B, the price is the same today, both worth 20 dollars. Stock A has a expected return of 0.5 dollars/week, a volatility of 50%; stock B has a expected return of 10 dollars/week, a volatility of 1%. For call options with strike price 40 dollars expiring in 1 month(4 weeks), how can the option price for stock A is greater than that for B, since stock A is expected to worth only 22 dollars while B is worth 60 dollars? Any intuitive explanations?&lt;br&gt;&#xA;I can also make examples where stock A has vanishingly expected return and B has infinitely large expected return.&lt;/p&gt;&#xA;" OwnerUserId="16005" LastEditorUserId="16005" LastEditDate="2015-04-28T04:27:18.877" LastActivityDate="2018-04-08T18:41:43.750" Title="Why the expected return rate of a stock has nothing to do with its option price?" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;expected-return&gt;" AnswerCount="9" CommentCount="2" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="17557" PostTypeId="2" ParentId="8931" CreationDate="2015-04-27T16:57:31.643" Score="3" Body="&lt;p&gt;Although I sincerely do not know the correct answer to your question because I never read about this kind of topic in particular and I agree for the most with @MattWolf, I found your question very interesting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suggest you to start by reading the literature on the market illiquidity proxies and the relative effect of market illiquidity on the stock market returns; some of my favourite authors about this topic are Amihud &amp;amp; Mendelson, that developed this research field with their seminal paper in 1986:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Amihud, Yakov, and Haim Mendelson. &quot;Asset pricing and the bid-ask&#xA;  spread.&quot; Journal of financial Economics 17.2 (1986): 223-249.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Browsing on google scholar who cited this paper, you can find other interesting papers about the topic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As regards your question, particularly, you could examine how the illiquidity of a security B influences the illiquidity of security C, or vice versa (since the relative markets are on different continents, they pretty surely trade on different hours), since, if they are comparable, they should move in the same way and be correlated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Said that, since it is proven that empirically this relationship holds:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$R_{t+1}$ = $\alpha$ + $\beta$*$ILLIQ_t$ + $\epsilon$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$R_{t+1}$: stock return at time $t+1$;&lt;/li&gt;&#xA;&lt;li&gt;$ILLIQ_t$: market illiquidity proxy;&lt;/li&gt;&#xA;&lt;li&gt;$\alpha$ and $\beta$: linear regression coefficients;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;particularly when you measure the portfolio returns on the portfolio illiquidity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could be able to find a trading opportunity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you could test a pair trading strategy based on security illiquidity; look, for instance, if there exist a granger causality between these two stocks.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-04-27T16:57:31.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17558" PostTypeId="1" CreationDate="2015-04-27T17:54:33.083" Score="3" ViewCount="742" Body="&lt;p&gt;I found &lt;a href=&quot;http://www.wrds.us/index.php/tutorial/view/26&quot; rel=&quot;nofollow&quot;&gt;this website&lt;/a&gt; which uses a perl script to download all the filings. It states: &quot;There are 200K+ 10-K (and equivalent) filings, which will take considerable harddisk space and time to download. The SEC prefers that bulk-download is done during 'quiet time', i.e., outside the regular trading hours.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a better way than deluging the SEC's servers with requests to get this information?&lt;/p&gt;&#xA;" OwnerUserId="16057" LastActivityDate="2020-06-29T22:33:01.903" Title="What is the most efficient way to periodically download all new 10-K filings from SEC's EDGAR?" Tags="&lt;sec&gt;&lt;edgar&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17559" PostTypeId="2" ParentId="17556" CreationDate="2015-04-27T18:51:08.567" Score="3" Body="&lt;p&gt;Practically, it is very difficult to get a measurement of a stock's true drift while there are very well-documented processes to estimate volatility. It is therefore very convenient mathematically to select the risk neutral pricing measure that eliminates idiosyncratic drift.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At its heart, Black Scholes constructs a dynamic, replicating portfolio for an option on a stock. Consider an option with strike K = 0. How would you replicate that call? Just buy the stock! Drift in no way factored into your replication strategy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By constructing a replicating portfolio out of the security which has drift, we are implicitly taking that drift into account in order to properly replicate the next future instantaneous states.&lt;/p&gt;&#xA;" OwnerUserId="16058" LastEditorUserId="16058" LastEditDate="2015-04-27T21:04:22.367" LastActivityDate="2015-04-27T21:04:22.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17560" PostTypeId="2" ParentId="17553" CreationDate="2015-04-27T19:43:22.737" Score="2" Body="&lt;p&gt;Unfortunately, I do not know the model you talk about. However, the law of one price is a direct implication of the no-arbitrage assumption, which is assumed in many models (if not all).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do agree that the law of one price should be stated as a theorem rather than a definition. Anyway. Consider the case in which two portfolios A and B have the same value at time $T$, $V^{(A)}_T = V^{(B)}_T$, and assume that their values are different at some time $0\leq t&amp;lt;T$. Assume without loss of generality that $V_t^{(A)} &amp;lt; V_t^{(B)}$. Then buy portfolio A and short portfolio B, which will give you a profit at time $t$ of $V_t^{(B)} - V_t^{(A)} &amp;gt; 0$ and no risk of losing money in the future. Thus we found an arbitrage, which is a contradiction.&lt;/p&gt;&#xA;" OwnerUserId="15244" LastActivityDate="2015-04-27T19:43:22.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17561" PostTypeId="2" ParentId="17553" CreationDate="2015-04-27T19:47:50.320" Score="2" Body="&lt;p&gt;Regarding (1).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume for some time $k$,  $\mathcal{V}_k(\Phi_1) &amp;gt; \mathcal{V}_k(\Phi_2)$ (w.l.o.g.) with full knowledge that these strategies have equal value at $T$     ,($\mathcal{V}_T(\Phi_1)=\mathcal{V}_T(\Phi_2)$). I claim that this situation admits arbitrage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can sell $\mathcal{V}_k(\Phi_1)$ and buy $\mathcal{V}_k(\Phi_2)$ and pocket the difference as profit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At time T deliver $\mathcal{V}_T(\Phi_2)$ (since it was self financing) to settle my short position in $\mathcal{V}_T(\Phi_1)$. The positions offset and I made a riskless profit.&lt;/p&gt;&#xA;" OwnerUserId="16058" LastActivityDate="2015-04-27T19:47:50.320" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17562" PostTypeId="2" ParentId="17553" CreationDate="2015-04-27T19:51:06.157" Score="2" Body="&lt;p&gt;(1) To get an arbitrage, buy low and sell high.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the following strategy: at $k$, in the event $V_k(\Phi_1) &amp;lt; V_k(\Phi_2)$, buy $\Phi_1$ and sell $\Phi_2$ invest the difference at the risk free rate. At maturity, your portfolio is worth what the you put in the bank plus interest. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Formally, if $V_t(\Phi_\alpha) = \sum_{i=0}^d \Phi^i_{\alpha,t} S^i_t$ where $S^0_t = (1+r)^t$ is the risk free asset, then the strategy corresponds to&#xA;$$&#xA;  V_t = \sum \delta^i_t S^i_t&#xA;$$&#xA;where $\delta^i_t = 0$ for all i and all $t&amp;lt;k$, then for $t\geq k$, and $i\neq 0$,&lt;br&gt;&#xA;$$&#xA;  \delta^i_t = 1_{V_k(\Phi_1)&amp;lt;V_k(\Phi_1)}(\Phi^i_{1,t} - \Phi^i_{2,t})   &#xA;$$&#xA;The amount invested in the risk free asset is exactly what is left so that the strategy is self-financing. You can check that &#xA;$$&#xA;  \delta^0_t = 1_{V_k(\Phi_1)&amp;lt;V_k(\Phi_2)}\Big( (V_k(\Phi_2)-V_k(\Phi_1))\frac{S^0_t}{S^0_k} + (\Phi^0_{1,t} - \Phi^0_{2,t}) \Big)  &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that following this strategy, your portfolio satisfies  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$V_0 = 0$, &lt;/li&gt;&#xA;&lt;li&gt;$P(V_T \geq 0) = 1$ &lt;/li&gt;&#xA;&lt;li&gt;$P(V_T &amp;gt; 0) \ge P(V_k(\Phi_1) &amp;lt; V_k(\Phi_2))$ since every time the portfolio $1$ is worth strictly less than portfolio $2$ you end up with cash in the bank.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Since there is no arbitrage, this last probability has to be zero: $V_k(\Phi_1) \ge V_k(\Phi_2)$ almost surely. By symmetry the reverse inequality is also true so $V_k(\Phi_1) = V_k(\Phi_2)$ almost surely.           &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) The market is still without arbitrage because the asset you added it a linear combination of the previous ones. If you have a portfolio &#xA;$$&#xA;  V_t = \sum_i \delta^i_t S^i_t + \delta_{a^*,t}S_{a^*,t}&#xA;$$ &#xA;creating an arbitrage in the extended market, you can decompose $S_{a^*,t}$ into the other assets, rewriting &#xA;$$&#xA;  V_t = \sum_i (\delta^i_t + \delta_{a^*,t}\Phi^i_t) S^i_t &#xA;$$&#xA;and this would give you an arbitrage in the original market.&lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2015-04-28T22:01:15.057" LastActivityDate="2015-04-28T22:01:15.057" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="17563" PostTypeId="2" ParentId="17547" CreationDate="2015-04-27T20:41:52.440" Score="5" Body="&lt;p&gt;Yes, this technique is called &lt;em&gt;moment matching variance reduction&lt;/em&gt; and it may indeed lead to a form of variance reduction. The first and second order moments correspond to the mean and the variance of the distribution. You can extend to higher order moments, which is of course more difficult to implement and creates some extra overhead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The mean can be adjust by either a linear correction:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\tilde{X}_i=X_i -\bar{X} + \mu_X$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or a multiplicative one:&#xA;$$\tilde{X}_i=X_i \frac{\mu_X}{\bar{X}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\bar{X}$ is the sample mean, $\mu_X$ the exact mean. It depends on the application at hand to decide which of these is more suitable. If the process $X_i$ has mean zero, you of course would not use the multiplicative version. Similarly, if the process is strictly non-negative, then the linear method might cause some of the $X_i$ to become negative, which is again not desirable. So keep this in mind when performing moment matching.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The combined mean and variance moment matching may look like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\tilde{X}_i = (X_i - \bar{X})\frac{\sigma_X}{s_X} + \mu_X$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $s_X$ and $\sigma_X$ are the sample and distribution standard deviation respectively. This transformation actually introduces some bias, which leads to biased estimators of whatever option you are trying to price. But these are, according to the experts, usually very small so it's should be ok. Besides, the bias vanishes with increasing sample size.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can think of this technique as a special type of Control Variate. A control variate works by using another process $Y_i$ to replace the samples $X_i$ by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\tilde{X}_i=X_i - b (Y_i - \mu_Y)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $b$ is optimal by setting it to $Cov[X,Y]/Var[X]$. The similarity should be clear. Note that by adjusting both the mean and the variance you are essentially using two control variates, so this is definitely something worth considering.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, the downside is that you still need to know what the actual mean and variance of the process are; potentially also covariances if you are dealing with multiple processes. This might require some heavy math crunching (but hopefully someone has done this for you). Higher order moments become even more difficult to obtain.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another problem is that these transformation typically introduce dependency among the samples. As a result, you can no longer use the usual rules for confidence interval construction, since this is based on independent samples. This is a problem for things like confidence levels of your estimates. You can partially get around this by creating different batches of samples, and apply moment matching to the individual batches. This is again more overhead for perhaps negligible gain.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, Boyle, Broadie and Glasserman proved that it if you have a moment available, then you are usually better off using it as a control variate instead of using it as moment matching (i.e. you can gain more variance reduction this way). The reason is that moment matching is essentially a form of using a control variate, but with a sub-optimal coefficient $b$. Their proof is in the appendix of &lt;a href=&quot;http://bfi.cl/papers/Boyle%20Broadie%20Glasserman%201997%20-%20Monte%20Carlo%20methods%20for%20security%20pricing.pdf&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="3371" LastEditorUserId="6901" LastEditDate="2015-04-28T17:51:48.167" LastActivityDate="2015-04-28T17:51:48.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17565" PostTypeId="2" ParentId="17556" CreationDate="2015-04-28T04:54:59.903" Score="12" Body="&lt;p&gt;Because you can hedge. Once you have delta hedged, the pay-off is symmetric about up and down moves so drift doesn't matter. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also the delta-hedged call and the delta hedged put have to have the same value since they have the same pay-off. (Put-call parity) Yet any argument that the call should be worth more because of drift says that the put should be worth less. Since they are worth the same, the drift must not matter. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The whole thing takes a lot of getting used to. A large part of my motivation for writing my first book (concepts and practice of mathematical finance) was to get my head around this issue and then to explain how I did. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-04-28T04:54:59.903" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17566" PostTypeId="1" CreationDate="2015-04-28T08:29:27.967" Score="3" ViewCount="464" Body="&lt;p&gt;Is it possible to the extract the latent factor &lt;strong&gt;f&lt;/strong&gt; from the following equations using kalman smoothing? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;f&lt;/strong&gt; is the unobserved state value while z is observed series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the literature i could read on web mostly the variable in state equation is a function of its previous one lag however here its a function of the last three lags. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please, can you suggest some literature to understand the computation part and also would like to know which packages in R can be useful to implement this problem in particular&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.frbatlanta.org/-/media/Documents/research/publications/wp/2014/wp1407.pdf?la=en&quot; rel=&quot;nofollow noreferrer&quot;&gt;Link to original paper, refer to page 6&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/1iaSR.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="16068" LastEditorUserId="16068" LastEditDate="2015-04-28T09:31:26.947" LastActivityDate="2015-04-29T02:11:10.770" Title="Kalman filtering" Tags="&lt;r&gt;&lt;kalman&gt;&lt;hidden-markov-model&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17567" PostTypeId="1" CreationDate="2015-04-28T09:34:05.743" Score="4" ViewCount="244" Body="&lt;p&gt;I recently read a paper by Terje Lensberg (2014) &quot;Costs and benefits of financial regulation: Short-selling bans and transaction taxes&quot; where he analyzed the effects of financial regulation (short selling bans, transaction taxes, ban of all leveraged products) on trading activity. In all cases you will find that good liquidity comes at the cost of high short-term volatility and therefore is best under the current regulatory regime. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question refers to an idea from the Austrian economist Stephan Schulmeister. He once mentioned that implementing trading in two-hour cycles (no high-frequency trading anymore) would lead to better analysis of companies because traders would focus more on fundamental data than on trends and speculative material. He was also one of the first who supported transaction taxes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I personally do not see how his idea would help to improve financial markets, do you have any idea?&lt;/p&gt;&#xA;" OwnerUserId="7098" LastEditorUserId="2299" LastEditDate="2018-06-24T12:52:11.243" LastActivityDate="2018-06-24T12:52:11.243" Title="Discrete Trading to reduce speculation" Tags="&lt;trading&gt;&lt;market-microstructure&gt;&lt;banking-regulations&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17568" PostTypeId="5" CreationDate="2015-04-28T10:43:30.367" Score="0" Body="&lt;p&gt;The CAPM or capital asset pricing model was been mainly introduced by Sharpe (1964) and Lintner (1965) independently on the base of the Markowitz's (1956) research.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is a model that allows to price an individual financial asset or portfolio that states the expected financial asset returns $E(R_i)$ is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E(R_i)$ = $R_f$ + $\beta_i*{(E(R_m)-R_f)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$R_f$ is the risk-free rate of interest such as interest arising from government bonds;&lt;/li&gt;&#xA;&lt;li&gt;$(E(R_m)-R_f)$ is the defined as the market premium;&lt;/li&gt;&#xA;&lt;li&gt;$\beta_i$ is the sensitivity of the expected excess asset returns to the expected excess market returns, and, it is given by $\beta_i$ = ${COV(R_i;R_m)}\over VAR(R_m)$;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-04-28T11:04:55.433" LastActivityDate="2015-04-28T11:04:55.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17569" PostTypeId="4" CreationDate="2015-04-28T10:43:30.367" Score="0" Body="The capital asset pricing model is a model that allows to determine the theoretical rate of asset returns required by an investor, given the asset systematic risk or market risk." OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-04-28T13:07:58.963" LastActivityDate="2015-04-28T13:07:58.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17570" PostTypeId="2" ParentId="17566" CreationDate="2015-04-28T12:23:53.387" Score="2" Body="&lt;p&gt;In the paper you cited in the question, the equation (1) is not the equation of state in kalman filter model, but an $AR(3)$ estimated via OLS as shown in Stock &amp;amp; Watson (2002).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What the authors estimated in the paper using the Kalman filter is the latent variables $f_t,_h$ and the relative lags through which they estimated both the equation (1) and (2).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The number of lags is chosen on the basis of the value of Akaike Information Criterion and, in this case, they choose 3 lags. Keep in mind there are other way to estimate the correct number of lags and it depends on several factors as, for instance, the kind of data, the frequency, the underlying model, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, they suggested that such equations can be estimated via PC analysis too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, as regards the R package you need for implementing and replicating this model, there exist 2 main packages available in R:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://cran.r-project.org/web/packages/FKF/FKF.pdf&quot; rel=&quot;nofollow&quot;&gt;FKF&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://cran.r-project.org/web/packages/KFAS/index.html&quot; rel=&quot;nofollow&quot;&gt;KFAS&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Moreover, for general references look at:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Tusell, Fernando. &quot;Kalman filtering in R.&quot; Journal of Statistical&#xA;  Software 39.2 (2011): 1-27.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-04-28T12:23:53.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17571" PostTypeId="1" CreationDate="2015-04-28T12:53:07.657" Score="2" ViewCount="55" Body="&lt;p&gt;I have a CRSP stock dataset that goes up to december 2013. I'm trying to append yahoo finance data to it in order to bring it up to the current day. However, there are ticker symbols that once belonged to a different company than they do today. For example, until 20121015 AAC was the ticker symbol for Australia Acquisition Corp, but now it's the ticker symbol for AAC holdings, a pharmaceuticals company. I don't have a source of permnos for the yahoo finance stocks, so that's not an option for me to keep track of which stock is which. Is there a minimum interval of time between when a stock symbol is no longer used by one company and begins to be used by another? &lt;/p&gt;&#xA;" OwnerUserId="7769" LastActivityDate="2015-04-28T12:53:07.657" Title="Time between end of use of ticker symbol by one company and beginning of use by another?" Tags="&lt;data&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17572" PostTypeId="2" ParentId="17367" CreationDate="2015-04-28T15:03:14.873" Score="-1" Body="&lt;p&gt;The answer is no, because although a mean-reverting process has necessarily to be stationary, it is not true the opposite, that is a stationary process has to be mean-reverting, as you stated in the question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Look at this &lt;a href=&quot;http://elib.suub.uni-bremen.de/publications/dissertations/E-Diss549_diss02.pdf&quot; rel=&quot;nofollow&quot;&gt;article&lt;/a&gt; for a &lt;strong&gt;formal definition of a mean-reverting process&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, think about one of the most famous mean-reverting process: the &lt;strong&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ornstein%E2%80%93Uhlenbeck_process&quot; rel=&quot;nofollow&quot;&gt;Ornstein–Uhlenbeck&lt;/a&gt;&lt;/strong&gt;; the assumption underlying such process are the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Stationarity&lt;/strong&gt;;&lt;/li&gt;&#xA;&lt;li&gt;Normality;&lt;/li&gt;&#xA;&lt;li&gt;Markovianity;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The stationarity is a necessary assumption in order that such process is mean-reverting, but it is not true the opposite. The mean reverting process assumption is not a necessary condition such that a process is stationary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For reference, look at the books I cited to have an idea of the application of such concepts in finance; you can find them online for free in pdf format. Since this is a quantitative finance site, I suppose the question indirectly refers to a pair-trading strategy, so, I think it is important to suggest you to read:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Chan, Ernest P. &quot;Quantitative Trading.&quot; New Jersey (2008).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Particularly, read the paragraph about stationarity condition and cointegration (chp. 7). There, the author suggests:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;[]. You can find a pair of stocks such that if you long one and short&#xA;  the other, the market value of the pair is stationary. If this is the&#xA;  case, then the two individual time series are said to be cointegrated.&#xA;  They are so described because a linear combination of them is&#xA;  integrated of order zero. []&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Again, it is not true that a stationary process implies necessarily that the time series composing the process are cointegrated, but it is true the opposite ones; that is, if 2 time series are cointegrated, necessarily their linear combination (in the right proportions) is a stationary process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Said that, in quantitative finance terms, it is not necessary that the 2 processes you are considering have to be stationary, but that it necessary their market value is stationary; in such case, the process resulting from the linear combination of those two time series is a good candidate for a pair-trading strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, for a formal proof, look at:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Alexander, Carol. Market models: a guide to financial data analysis.&#xA;  John Wiley &amp;amp; Sons, 2001.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;He provides a formal proof of what I wrote down above and answers exactly to your question.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-04-28T21:21:02.933" LastActivityDate="2015-04-28T21:21:02.933" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17573" PostTypeId="1" CreationDate="2015-04-28T16:19:27.943" Score="1" ViewCount="158" Body="&lt;p&gt;I've Googled for the paper and found &lt;a href=&quot;http://citeseer.uark.edu:8080/citeseerx/showciting;jsessionid=07D3B5EBCF02C0639A76CFC02D937474?cid=8287542&amp;amp;sort=date&quot; rel=&quot;nofollow&quot;&gt;this site&lt;/a&gt; but it's down (at the moment).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, this is not a quest for a free copy (or we wouldn't allow it :), the paper is also nowhere to find &lt;em&gt;for&lt;/em&gt; a fee. A guy on &lt;a href=&quot;http://www.pauldominic.com/messageview.cfm?catid=4&amp;amp;threadid=91287&quot; rel=&quot;nofollow&quot;&gt;Wilmott&lt;/a&gt; was also looking for it but it seems without success. It is cited in Paul Glasserman's book &quot;Monte Carlo simulation methods in financial engineering&quot;.&lt;/p&gt;&#xA;" OwnerUserId="15232" LastEditorUserId="848" LastEditDate="2015-04-28T18:06:39.477" LastActivityDate="2015-05-28T19:06:46.713" Title="Looking for paper: &quot;Simulation and calibration of the HJM model&quot; by Andersen" Tags="&lt;reference-request&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17575" PostTypeId="2" ParentId="17516" CreationDate="2015-04-28T18:00:05.043" Score="2" Body="&lt;p&gt;Just checked in my python script for daily futures data from Interactive Brokers. Maybe it will be useful for you:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/busygin/ib_data_loader&quot; rel=&quot;nofollow&quot;&gt;https://github.com/busygin/ib_data_loader&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16070" LastActivityDate="2015-04-28T18:00:05.043" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17576" PostTypeId="2" ParentId="17573" CreationDate="2015-04-28T18:13:35.110" Score="2" Body="&lt;p&gt;I haven't found the working paper, the &lt;a href=&quot;http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=111031#reg&quot; rel=&quot;nofollow&quot;&gt;SSRN page&lt;/a&gt; doesn't give any papers from before 1998 which happens to be the year of the Glasserman publication(?). However, &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=946405&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt; I found could be based on the working paper. &lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2015-04-28T18:13:35.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17577" PostTypeId="1" AcceptedAnswerId="17578" CreationDate="2015-04-28T18:32:39.813" Score="8" ViewCount="230" Body="&lt;p&gt;It's alleged that Navinder Singh Sarao contributed to the flash crash by placing huge, fake, order for S&amp;amp;P Minis.  Mr. Singh Sarao then cancelled the huge orders before they were filled.  The spoofed orders created false impressions in the market which Mr. Singh then profited from.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's what I don't get...why weren't the fake orders filled, leaving him with a real position?  Order execution is typically very fast so how was he able to show the fake order to the market then cancel it before it was executed?  It seems like he was putting himself in a very risky position that the huge fake order might get executed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I realize spoofing is illegal and very risky in that sense.  I'm trying to understand the positional financial risk aspect (not counting fines, legal fees, jail, etc.).&lt;/p&gt;&#xA;" OwnerUserId="7709" LastEditorUserId="7709" LastEditDate="2015-10-04T13:00:24.853" LastActivityDate="2015-10-07T01:26:20.797" Title="Is spoofing financially risky?" Tags="&lt;futures&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17578" PostTypeId="2" ParentId="17577" CreationDate="2015-04-28T18:41:35.130" Score="4" Body="&lt;p&gt;&lt;a href=&quot;http://ftalphaville.ft.com/2015/04/28/2127728/a-regulatory-spoof/&quot; rel=&quot;nofollow&quot;&gt;This FT Alphaville article&lt;/a&gt; confirms and has some discussion about your idea that Sarao was indeed taking a risk every time he created spoofing orders. But in short, yes: if you place a limit order and a large enough order hits the market your limit order can be filled without a possibility to cancel (unless the exchange is dodgy) and you will end up with a position.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2015-04-28T18:41:35.130" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17581" PostTypeId="2" ParentId="17556" CreationDate="2015-04-29T01:52:37.510" Score="3" Body="&lt;p&gt;Yes and No. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the absence of arbitragers, the price of the option will be different for each speculator based on their drift expectations (and each speculator has a risk in his position and will limit his ability to trade large sizes to avoid bankruptcy) and the option price will converge to priced off a supply-and-demand driven drift expectation.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if there are arbitragers who can delta-hedge an option to create a risk-free position, then if the drift of the combined delta-hedged option position is different from risk-free rate, the arbitrage can become infinitely rich in no time. In real world, we don't see arbitrage becoming infinitely rich, and the only way to avoid such a situation (at least in academic settings) that an arbitrager can make money is to assume that the option is priced using a drift of risk-free rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short, the options are priced so that arbitragers don't make money. It doesn't mean that the actual drift expectations are the risk-free rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Subtle difference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, however, volatility is not constant. It boils down to choosing between two parameters - the volatility and the drift rate. Practitioners, prefer to assume that the drift rate is static and create a volatility surface (volatility varies with moneyness and maturity), but in an alternative world, one can assume that the volatility is constant and there is a risk-free rate surface (i.e. the risk-free rate to borrow for hedging an option varies with the moneyness and maturity). &lt;/p&gt;&#xA;" OwnerUserId="5948" LastActivityDate="2015-04-29T01:52:37.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17582" PostTypeId="2" ParentId="17566" CreationDate="2015-04-29T02:11:10.770" Score="1" Body="&lt;p&gt;It is not about estimating those equations via PC. There are various methods to estimate the latent factor fth, one of which is principal components. They have asked us to use that. Series(z) in those equations is observed data so we use the estimated fth and observed z to perform the OLS as suggested&lt;/p&gt;&#xA;&#xA;&lt;p&gt;AR(3) or ARMA(1,0,3) would make the residual series independent (not auto correlated). So i guess its been used for that reason&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the given equations are not the state space equations why have they asked us to estimate the residual covariance matrix for innovations in both equations via OLS and suggested to use the same for kalman filtering/smoothing&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It doesn't make sense to estimate residual covariance matrix on a AR(3) process and then use the same the AR(1) state equation while performing Kalman smoothing&lt;/p&gt;&#xA;" OwnerUserId="16074" LastActivityDate="2015-04-29T02:11:10.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17583" PostTypeId="2" ParentId="17556" CreationDate="2015-04-29T06:55:01.497" Score="7" Body="&lt;p&gt;I think to gain intution you have to understand that the same agents that value the stocks will value the options. And agents compensate for volatility by demanding higher expected returns. Therefore you should ask: Why are stocks priced as they are in the first place? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your example, the stock with higher volatility has much lower expected return. This can only happen systematically if agents are 'risk loving' or temporarily if expected returns or volatility change suddenly (e.g. due to significant news).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the first case the higher option price is intuitive because for 'risk lovers' volatility is a good thing. In the second case the imbalance will be restored by spot price moves (e.g. the second spot will drop until its expected return offers sufficient compensation for the risk). Then balance in option markets will also be restored by different spots in the pricing formula.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2015-04-29T06:55:01.497" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17584" PostTypeId="1" CreationDate="2015-04-29T12:36:43.967" Score="1" ViewCount="90" Body="&lt;p&gt;I have read that in speech signal processing analysis when voice is segmented in brief temporary segments the series segments transitions from being non stationary to stationary. My question is if this is also the case for financial data when this data can be segmented in smaller and smaller time spand windows (stock market).    &lt;/p&gt;&#xA;" OwnerUserId="7616" LastActivityDate="2015-04-29T12:36:43.967" Title="comparison of speech signal processing and financial data" Tags="&lt;r&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17585" PostTypeId="1" AcceptedAnswerId="17596" CreationDate="2015-04-29T13:19:21.797" Score="8" ViewCount="284" Body="&lt;p&gt;One of the scapegoats of the financial crisis was &lt;a href=&quot;http://en.wikipedia.org/wiki/Value_at_risk&quot;&gt;value at risk&lt;/a&gt;. Still communicating risks effectively to clients is a big challenge and hugely important (also to keep your job as a quant!) In this question I am talking mainly about potential losses and drawdowns of trading strategies and derivatives.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question&lt;/strong&gt;&lt;br&gt;&#xA;Do you know &lt;em&gt;innovative (or experimental) ways of communicating risk&lt;/em&gt;? These can be new ratios or visualizations or animations or ....  Also unconventional ideas are welcome! The more intuitive these new ways are the better! If possible please give examples and/or references.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2015-06-04T14:45:59.787" Title="New ways of communicating risk" Tags="&lt;risk&gt;&lt;quant-trading-strategies&gt;&lt;risk-management&gt;&lt;derivatives&gt;&lt;visualization&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="17588" PostTypeId="1" AcceptedAnswerId="17595" CreationDate="2015-04-29T15:09:28.873" Score="3" ViewCount="1541" Body="&lt;p&gt;What is a good beginner book on the topic of Credit Risk management for banking? I am a credit risk systems developer and most of my knowledge is in IT systems and programs that support the credit risk management department.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We use the SAS CRMB package for our work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for a 'beginner' book that explains the concepts and calculations (not too mathy would be ideal) behind EAD,PD,LGD,RWA. Some explanation of USFinal and BASEL rules would be awesome too.&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2015-05-02T12:11:37.437" Title="Book recommendation for credit risk management for banking" Tags="&lt;credit-risk&gt;&lt;books&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17589" PostTypeId="1" AcceptedAnswerId="17598" CreationDate="2015-04-29T15:28:05.187" Score="8" ViewCount="1168" Body="&lt;p&gt;Let &#xA;$$&#xA;X_t = \mu t + \sigma B_t&#xA;$$&#xA;be a linear Brownian motion with drift. &#xA;Let &#xA;$$&#xA;S_t = \max(X_u, u \le t)&#xA;$$&#xA;denote the process of the running max, then the draw down is given by&#xA;$$&#xA;DD_t = S_t - X_t,&#xA;$$&#xA;and the maximum draw down over a period  $[0,T]$ is $$max_{u \in [0,T]} DD_u.$$&#xA;What can we say about $$E[ max_{u \in [0,T]} DD_u ] ?$$ &#xA;How can we calculate the expected maximum draw down? Are there analytical formulas, approximations, available (R) packages?&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-04-30T05:48:13.727" LastActivityDate="2015-04-30T09:06:12.750" Title="Expectation of maximum draw down in the Brownian motion case" Tags="&lt;brownian-motion&gt;&lt;drawdown&gt;&lt;maximum-drawdown&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17590" PostTypeId="1" CreationDate="2015-04-29T16:23:17.547" Score="4" ViewCount="1999" Body="&lt;p&gt;I am trying to understand theOrnstein-Uhlenbeck process &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dX_t = \kappa(\theta-X_t)dt + \sigma dW_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;my question is what is the meaning of the parameters? &#xA;and assuming that we know those parameters in advance what is the best way to exploit it?&lt;/p&gt;&#xA;" OwnerUserId="16081" LastActivityDate="2015-04-29T17:25:50.477" Title="The meaning of Ornstein-Uhlenbeck parameters" Tags="&lt;options&gt;&lt;pairs-trading&gt;&lt;mean-reversion&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17591" PostTypeId="2" ParentId="17590" CreationDate="2015-04-29T17:25:50.477" Score="10" Body="&lt;p&gt;$\theta$ is the &quot;mean&quot; for this process. If $X_t &amp;gt; \theta \implies (\theta - X_t) &amp;lt; 0 $, which means that the drift for the process is negative and tends towards $\theta$. The opposite case can be made for $X_t &amp;lt; \theta$ ; the process will have positive drift when $X_t$ is below $\theta$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore we can consider $\kappa$ to be the &quot;speed&quot; of mean reversion, scaling the distance between $X_t$ and $\theta$ appropriately to match whatever is being modeled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma dW_t $ is your standard Wiener process scaled by volatility $\sigma$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In plain English you can interpret the differentials as a process that reverts to a mean, $\theta$, with speed, $\kappa$, and volatility, $\sigma$.&lt;/p&gt;&#xA;" OwnerUserId="16058" LastActivityDate="2015-04-29T17:25:50.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17593" PostTypeId="1" CreationDate="2015-04-29T19:46:34.517" Score="1" ViewCount="72" Body="&lt;p&gt;I need to analyse a bunch of weekly time series that reflect the turnovers of various companies. I already read that return rates or share prices show stochastic patterns that can be modelled by a random walk. However, such time series usually correspond to continuous functions (curves), whereas turnover values can go up and down dramatically between two successive weeks. For example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Week t: 1 mio Euros&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Week t+1: 0 Euros&lt;/p&gt;&#xA;&#xA;&lt;p&gt;QUESTION: So my question is whether the choice of a random walk model would still be justified or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My plan is to model the timely courses of turnover figures by a random walk model that allows for a drift because analyzing the distribution of drifts is my final goal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My apologies for weaknesses in the explanation - I am not from finance originally.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In the meantime, I figured out that the core of my question refers to the distinction between so-called &lt;a href=&quot;https://en.m.wikipedia.org/wiki/Stock_and_flow&quot; rel=&quot;nofollow&quot;&gt;stock and flow variables&lt;/a&gt;. The revenue per week is a flow variable, whereas a share price at a specific point in time is a stock variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it remains unclear to me whether both types of variables can be treated with the same stochastic models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The random walk with drift model is described in 'Introductory Time Series with R (Use R!)' by Paul S. P. Cowpertwait. In the book it is applied to a time series of stock variables (share prices). It allows to analyse whether there exists a positive drift (i.e. a mean increase of prices) in a time series of prices, which is mainly determined by unknown and unpredictable (i.e. stochastic) effects. But the question remains, whether this model can also be used for flow variables.&lt;/p&gt;&#xA;" OwnerUserId="16083" LastEditorUserId="848" LastEditDate="2015-04-30T19:52:08.520" LastActivityDate="2015-04-30T19:52:08.520" Title="Modelling turnovers with a random walk. Is it right?" Tags="&lt;time-series&gt;&lt;random-walk&gt;&lt;statistical-finance&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17594" PostTypeId="2" ParentId="17556" CreationDate="2015-04-29T22:22:08.370" Score="2" Body="&lt;p&gt;&quot;Why the expected return rate of a stock has nothing to do with its option price?&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It has everything to do with the option price!  The option price is a function of the stock price.  If the expected rate of return on the stock price declines, the stock price will decline as will the option price.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Suppose I have two stocks A and B, the price is the same today, both worth 20 dollars. Stock A has a expected return of 0.5 dollars/week, a volatility of 50%; stock B has a expected return of 10 dollars/week, a volatility of 1%.&quot;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why on earth would these two stocks have the same price? Stock A should clearly be worth far less!&lt;/p&gt;&#xA;" OwnerUserId="9403" LastEditorUserId="20375" LastEditDate="2016-04-22T11:40:39.473" LastActivityDate="2016-04-22T11:40:39.473" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17595" PostTypeId="2" ParentId="17588" CreationDate="2015-04-30T00:21:10.190" Score="2" Body="&lt;p&gt;IMHO, I suggest you to read:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Sironi, Andrea, and Andrea Resti. Risk management and shareholders'&#xA;  value in banking: from risk measurement models to capital allocation&#xA;  policies. Vol. 417. John Wiley &amp;amp; Sons, 2007.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I studied that during the university for my risk management classes and I still find it enlightening and informative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The mathematics behind it is not complex and it covers all (credit) risk management models till  2007 (I own that edition, but I do not know if there exist a further one). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will suggest other books if you need for, but more complex than that; I'm a pretty active user on quant.SE, so, you need some help or advice more, comment below the answer.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-04-30T00:21:10.190" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17596" PostTypeId="2" ParentId="17585" CreationDate="2015-04-30T04:34:13.410" Score="5" Body="&lt;p&gt;Try to give David Spiegelhalter a read/listen to David Spiegelhalter's work and research. He is a statistician and a Professor of the Public Understanding of Risk at Cambridge England. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rather than new ways of calculating risk, he looks at ways of communicating risk to a general public that doesn't have any knowledge of stats. I Linked an interesting video-lecture right below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Professor David Spiegelhalter: &lt;a href=&quot;https://www.youtube.com/watch?v=JhfMkmzaNdU&quot; rel=&quot;nofollow&quot;&gt;Communicating risk and uncertainty&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11632" LastEditorUserId="2553" LastEditDate="2015-04-30T10:32:54.590" LastActivityDate="2015-04-30T10:32:54.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17598" PostTypeId="2" ParentId="17589" CreationDate="2015-04-30T09:06:12.750" Score="3" Body="&lt;p&gt;as I mentioned &lt;a href=&quot;https://quant.stackexchange.com/questions/6997/comparison-of-brownian-motion-expected-drawdown-and-simulated-results?rq=1&quot;&gt;here&lt;/a&gt;, &lt;a href=&quot;http://alumnus.caltech.edu/~amir/drawdown-jrnl.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; paper provides some theoretical insight (and a way to approximate the true value). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The authors end up with an approximative series for the density. It is implemented in the function maxdd of the R-package &lt;strong&gt;fBasics&lt;/strong&gt;. There are convenient functions &lt;em&gt;dmaxdd&lt;/em&gt;, &lt;em&gt;pmaxdd&lt;/em&gt; and &lt;em&gt;rmaxdd&lt;/em&gt;. Calculating the Expected Drawdown should be easy. (to be honest, I found the paper as a reference provided on the help page of the functions mentioned above)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function you are asking for would be &lt;strong&gt;maxddStats&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;require(fBasics)&#xA;maxddStats(mu,sigma,t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2727" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2015-04-30T09:06:12.750" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17599" PostTypeId="2" ParentId="16730" CreationDate="2015-04-30T14:01:52.050" Score="14" Body="&lt;p&gt;It doesn't matter if you use *100 or just pct_change, as long as you are consistent. However, in practice, due to underlying floating point numerical instabilities in the underlying optimization algorithms/default tolerances used in scipy/arch, having the returns expressed in %, i.e. multiplied by 100, will have a better chance of converging during the fitting of the model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The mistakes start at In[6]. Once the model is fitted, you can obtain the forecast conditional volatilities at res.conditional_volatility, which you need to annualize, i.e. multiply by sqrt(252).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that in the GARCH formula a(t-1) is the model residual, which you can find in res.residual. It is not the pct_change**2. To arrive at the residual from pct_change, you have to work backwards in the equations. But this has already been done for you in res.resid&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, the correct formula in In[6] for forecast_vol should be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;0.01 * np.sqrt(res.params['omega'] + res.params['alpha[1]'] * res.resid**2 + res.conditional_volatility**2 * res.params['beta[1]'])&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;^^ Here you are forecasting the instantaneous volatility for the NEXT day. Multiplying with 0.01 to take care of the earlier multiplication of daily return (pct_change) by 100&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this clarifies things a bit.&lt;/p&gt;&#xA;" OwnerUserId="16090" LastEditorUserId="30626" LastEditDate="2017-11-26T20:11:59.283" LastActivityDate="2017-11-26T20:11:59.283" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17600" PostTypeId="1" AcceptedAnswerId="17601" CreationDate="2015-04-30T15:51:11.200" Score="1" ViewCount="1018" Body="&lt;p&gt;I am writing my Thesis about hedge funds performance measurement and I want to use the seven factor model proposed by &lt;a href=&quot;http://74.115.228.67/wp-content/uploads/2014/01/HF-RF.pdf&quot; rel=&quot;nofollow&quot;&gt;Fung &amp;amp; Hsieh (2004)&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I am struggling to find out how to calculate the factor loadings (beta) used in the regression model: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;${R_i,_t}$ - ${R_f,_t}$ = $\alpha$ + $\beta_1$*$equity$ + $\beta_2$*$size$ + ... +$\beta_7$*$commoditytrend$ + $\epsilon$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and which results are shown in Table 1 in the end of the paper. My Software Preference would be &quot;R&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="16091" LastEditorUserId="16091" LastEditDate="2015-04-30T18:39:27.417" LastActivityDate="2015-04-30T18:57:58.750" Title="how can I calculate the factor loading (beta)?" Tags="&lt;regression&gt;&lt;factor-models&gt;&lt;econometrics&gt;&lt;factor-loading&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17601" PostTypeId="2" ParentId="17600" CreationDate="2015-04-30T18:57:58.750" Score="1" Body="&lt;p&gt;The R function you have to use is the &lt;code&gt;lm()&lt;/code&gt; function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On &lt;a href=&quot;http://www.statmethods.net/stats/regression.html&quot; rel=&quot;nofollow&quot;&gt;QuickR&lt;/a&gt; you can find a simple and clear tutorial on how to estimate a linear (multiple) regression model generally using the &lt;code&gt;lm()&lt;/code&gt;. As further reference, I suggest you to read the &lt;a href=&quot;http://data.princeton.edu/R/linearModels.html&quot; rel=&quot;nofollow&quot;&gt;Introducing R&lt;/a&gt; tutorial about linear model by G. Rodriguez.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did not read the paper you cited, but, anyway, you should estimate the model simply by running on the R shell the following command:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;results = lm(dependent_variable_name ~ independent_var1_name + ... + independent_var7_name)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and run that by clicking on &lt;code&gt;CTRL + ENTER&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, replace &lt;code&gt;dependent_variable_name&lt;/code&gt; with the name of the variable you gave previously; the same for the independent variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This command does not take into account the problems you should check in order to get reliable estimates, as, for instance, heteroskedasticity, autocorrelation, not normal residuals,... but it would be a too broad topic to deal with here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find a lot of reference and tutorial on the links I posted above, but, you can find help on quant.SE too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this help.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-04-30T18:57:58.750" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17603" PostTypeId="1" CreationDate="2015-05-01T00:38:58.967" Score="1" ViewCount="271" Body="&lt;p&gt;I have a time series of closing prices for a given stock. I would like to formulate possible future scenarios for the price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My intention is not to use these &quot;likely&quot; scenarios to take any position. I just want to have 3 possible scenarios that are somehow likely to happen if history repeat itself. My goal is to use these scenarios in a sort of battleplan to prepare myself in terms of trade adjustments if these (or similar) scenarios are actually going to occur.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to try an historical based approach: given the recent price dynamics I want to find the most likely future patterns based on what happened in the past. &#xA;For example, suppose that most of the time in the past after 3 days of down moves the price has then moved up. If we are now on the third day of down move, I could consider that an upmove tomorrow is the most likely scenario. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have seen that machine learning should do something like this but I have very limited knowledge in this field. &#xA;Is there any library/toolbox I can use to easily do what I want to do? I am familiar with R, MATLAB and C#/VB so I would prefer to work with these languages if possible. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just to add clarity: as said, I want to formulate future scenarios so what I really need is not only the most likely future pattern but also other patterns in decreasing level of likelihood. &#xA;In other words, I would like to have for example the 3 most likely price trajectories that could happen in the following n days. &#xA;So the machine should extract these forecasts by learning from past price dynamics. &#xA;Is it something doable? Thank you. &lt;/p&gt;&#xA;" OwnerUserId="15038" LastActivityDate="2015-05-14T08:43:39.623" Title="Machine learning to build top 3 price scenarios over n days" Tags="&lt;time-series&gt;&lt;risk-management&gt;&lt;forecasting&gt;&lt;econometrics&gt;&lt;machine-learning&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17604" PostTypeId="1" CreationDate="2015-04-25T22:18:03.397" Score="13" ViewCount="1216" Body="&lt;p&gt;I was reading this paper: &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2002698&quot; rel=&quot;noreferrer&quot;&gt;Financial Turbulence, Business Cycles and Intrinsic Time in an Artificial Economy&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The author has the model presented here: &lt;a href=&quot;http://modelingcommons.org/browse/one_model/3443#model_tabs_browse_info&quot; rel=&quot;noreferrer&quot;&gt;Quantum Evolutionary Financial Economics&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;But I am confused. There's all this build up of using quantum mechanics and quantum probability in the model, but the only thing he adds in the code is a normally distributed stochastic variable he calls the &amp;quot;business cycle quantum game term.&amp;quot; What is quantum about this? Why bother with all the quantum formalism if the end result is effectively just Gaussian white noise? I'm not formally trained in QM, so am I missing something? Example of relevant portion of code (from second link):&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Business Cycle Quantum Game Term:&lt;/p&gt;&#xA;&lt;p&gt;to business-fitness-dynamics&lt;/p&gt;&#xA;&lt;p&gt;ask patches [ set z random-normal 0 1.000 ];&lt;/p&gt;&#xA;&lt;p&gt;Gaussian wave packet&#xA;reduction around the standardized fitness operator&lt;/p&gt;&#xA;&lt;p&gt;ask patches [ set &lt;span class=&quot;math-container&quot;&gt;$M_b = (1 - m) (b \cdot x_{t-1} - (b + 1) \cdot x_{t-1} ^ 3) +  m\cdot r_{t-1}$&lt;/span&gt; ] ;&lt;/p&gt;&#xA;&lt;p&gt;cubic map update (equation (18) with &lt;span class=&quot;math-container&quot;&gt;$M_b := f{_b,m}$&lt;/span&gt;)&lt;/p&gt;&#xA;&lt;p&gt;ask patches [ set &lt;span class=&quot;math-container&quot;&gt;$x_t (1 - \epsilon - \gamma) \cdot M_b + \epsilon \cdot \text{mean} [&#xA; M_{b}]\,\text{of patches}$&lt;/span&gt;   + &lt;span class=&quot;math-container&quot;&gt;$\gamma \cdot z$&lt;/span&gt; ];&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$F$&lt;/span&gt; update and result of the quantum&#xA;wave packet reduction in terms of the fitness field operator eigenvalue&lt;/p&gt;&#xA;&lt;p&gt;end&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I also don't get this (from the second link):&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;There are three main advantages of the quantum approach to&#xA;Evolutionary Financial Economics:&lt;/p&gt;&#xA;&lt;p&gt;The explanatory effectiveness is expanded by the fact that one does&#xA;not need any prior probability assumption, instead, one models the&#xA;system's inter-relations and dynamics and from that result dynamical&#xA;probabilities.&lt;/p&gt;&#xA;&lt;p&gt;Probabilities can have evolutionary and game theoretical&#xA;interpretations.&lt;/p&gt;&#xA;&lt;p&gt;The adaptation process of a Complex Adaptive System (CAS) can be fully&#xA;integrated with the probability formation and quantum game equilibrium&#xA;assumptions.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Can classical methods not do any of these things?&lt;/p&gt;&#xA;" OwnerUserId="24983" OwnerDisplayName="Darragh" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2020-03-25T08:42:46.180" Title="Quantum Mechanics and Economics... What" Tags="&lt;probability&gt;&lt;quantitative&gt;&lt;quantum-finance&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="17605" PostTypeId="1" CreationDate="2015-05-01T11:07:16.073" Score="11" ViewCount="2740" Body="&lt;p&gt;I'm going to test for the effect of the change in market efficiency on the stock market portfolio, and, I want to know what are the main measures known in the academic literature in order to compare them and to choose the &quot;best&quot; one for a given market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Till now, I found the following measures to test for market efficiency in the &lt;strong&gt;broad market-specific&lt;/strong&gt; case:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Variance Ratio (Lo &amp;amp; MacKinlay, 1988)&lt;/li&gt;&#xA;&lt;li&gt;Approximate Entropy (Pincus, 1991)&lt;/li&gt;&#xA;&lt;li&gt;The Hurst exponent (Peters, 1994)&lt;/li&gt;&#xA;&lt;li&gt;Mkt Delay (Pagano &amp;amp; Schwartz, 2002)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For the &lt;strong&gt;firm-specific&lt;/strong&gt; case, I found that the event-study procedure is the most common to test the market efficiency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you suggest other measures or other procedures to test for market efficiency in the &lt;em&gt;stock market&lt;/em&gt;, in addition to the ones I cited above, or, alternatively, suggest which is the best one by providing a reference?&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-06-25T14:09:19.090" LastActivityDate="2015-07-08T18:56:30.673" Title="What are the main market efficiency measures in the stock market?" Tags="&lt;equities&gt;&lt;market-microstructure&gt;&lt;testing&gt;&lt;behavioral-finance&gt;&lt;market-efficiency&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="17606" PostTypeId="2" ParentId="17187" CreationDate="2015-05-01T11:15:09.317" Score="1" Body="&lt;p&gt;I went through historical data, and computed the daily P&amp;amp;L of the strategy, and correlation with GBPUSD is perfect, so the strategy is indeed affected by currency risk, even if at all times, 5 UK stock = 1 ADR&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://dl.dropboxusercontent.com/u/26828210/Rplot.jpeg&quot; rel=&quot;nofollow&quot;&gt;see graph&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I still need to understand why, because my expectation was to remain at all time with a position equivalent to the one I had with the UK stock...&lt;/p&gt;&#xA;" OwnerUserId="15804" LastActivityDate="2015-05-01T11:15:09.317" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17607" PostTypeId="1" AcceptedAnswerId="17609" CreationDate="2015-05-01T11:47:26.990" Score="6" ViewCount="293" Body="&lt;p&gt;I'm not sure if this is the correct place to post this - but here goes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been working on a project for the last few years, during which I have come up with a set of components with the following affordances:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;A simplified (easy to remember) instrument naming 'symbology'&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A framework for mapping various data providers feed into the framework - meaning that the same simplified naming can be used to fetch instrument data across various feed providers&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A simple schema for storing instrument data&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The end user will be responsible for sourcing the actual market data, what I am aiming to provide, is an infrastructure (libraries, databases etc), to store the reference data relating to the marketdata.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea of this is twofold:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i. To provide a framework for retail clients who want to build their own marketdata repositories&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ii. To tap into crowdsourcing, to help maintain database(s) that contains the latest company reports, company news releases, SEC filings etc, that everyone can benefit from.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to know:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is there any interest in such a project?&lt;/li&gt;&#xA;&lt;li&gt;Are there any features that are a must, for the proposed system to be useful to as many people as possible?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;It goes without saying, that the proposed system will only cover exchange traded products (but this restriction has to be relaxed to include Forex markets in the asset classes covered).&lt;/p&gt;&#xA;" OwnerUserId="1733" LastEditorUserId="2553" LastEditDate="2015-05-01T13:33:17.543" LastActivityDate="2015-05-01T13:33:17.543" Title="Opensource marketdata reference data for retail market" Tags="&lt;data&gt;&lt;market-data&gt;&lt;opensource&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17608" PostTypeId="2" ParentId="10048" CreationDate="2015-05-01T11:56:47.617" Score="2" Body="&lt;p&gt;The  factor models are based on the following linear regression model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(R_t - R_f)$ = $\alpha$ + $\beta_{mkt}$*$(R_{mkt} - R_f)$ + $\sum\limits_{i=1}^n {x_{k,t}}$ + $\epsilon_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\alpha$ is the regression model intercept and indicates the portfolio performance &#xA;in excess to the market excess return and the other factor; It has to be strictly positive and significant, in order to be able to measure properly the portfolio performance and the risk-adjusted portfolio returns; look at this [answer] for the joint hypothesis problem&lt;a href=&quot;https://quant.stackexchange.com/questions/15896/what-are-the-empirical-limitations-to-testing-market-efficiency&quot;&gt;1&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$x_{k,t}$ represents the set of variables that can be (or that were been added over time) added following other kind of factor models (see, for instance,  the Carhart's 4-factor model (1997)).&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2015-05-06T07:11:59.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17609" PostTypeId="2" ParentId="17607" CreationDate="2015-05-01T13:20:17.413" Score="4" Body="&lt;p&gt;I think this project could be interesting!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is because, although already exist market data sources (see QUANDL) for free or cheap, I think it would be nice build your own database.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, I find the fact you want to build an updated dataset about companies news, report &amp;amp; releases extremely interesting, since a serious source about historical financial crisis, for instance, or bank fails too is lacking.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think that a must could be what does not exist again, as what  cited above!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, IMHO, this project could be a great idea!  &lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-05-01T13:20:17.413" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17610" PostTypeId="1" CreationDate="2015-05-01T13:30:31.703" Score="13" ViewCount="1451" Body="&lt;p&gt;Given that the negative interest rates on a lot of sovereign bonds with maturity under 10 years are trading in the negative (nominal) interest rate territory (recently also the short term EURIBOR has dropped below zero), which are the most striking applications for the models in financial economics/quant finance field? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By that I mean which of the so called &quot;stylized facts&quot; and standard models of modern finance are becoming highly controversial or just plain useless?&#xA;As a couple of examples which spring to mind are the following (do not necessarily have to do with sovereign bond yields, but the concept of negative (nominal) interest rates as such):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The CIR interest rates model completely breaks down due to the square root term&lt;/li&gt;&#xA;&lt;li&gt;The proof that an American call option written on a non-dividend paying underlying will not be exercised before the maturity is false&lt;/li&gt;&#xA;&lt;li&gt;Markowitz selection obviously encounters difficulties incorporating negative yields&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What are the other consequences, on let us say, CAPM, APT, M&amp;amp;M or any other model in finance? Which long held beliefs are hurt the most by negative yields?&lt;/p&gt;&#xA;" OwnerUserId="16096" LastEditorUserId="743" LastEditDate="2015-12-28T17:52:20.830" LastActivityDate="2016-09-25T20:00:51.907" Title="Models crumbling down due to negative (nominal) interest rates" Tags="&lt;interest-rates&gt;&lt;finance&gt;&lt;modeling&gt;&lt;modern-portfolio-theory&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17612" PostTypeId="5" CreationDate="2015-05-01T19:46:59.870" Score="0" Body="&lt;p&gt;An efficient market is one where the market price is an unbiased estimate of the true value of the investment. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alhough this is the broadly accepted definition, it is not required this happens at every point in time; instead, it is required that market price errors are unbiased, as, for instance, that the price can be greater than or less than the true value, as long as such deviations are random.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to the market efficiency definition as given by Fama (1970), the market efficiency can be of 3 kinds:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Weak form&lt;/strong&gt;: the current price reflects the information contained in all past prices, suggesting that charts and technical analyses that use past prices alone would not be useful in finding under valued stocks;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Semi-strong form&lt;/strong&gt;:  the current price reflects the information contained not only in past prices but all public information (including financial statements and news reports) and no approach that was predicated on using and massaging this information would be useful in finding under valued stocks;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Strong form&lt;/strong&gt;: the current price reflects all information, public as well as private, and no investors will be able to consistently find under valued stocks;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;About market efficiency &lt;strong&gt;on the site&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://quant.stackexchange.com/questions/17605/what-are-the-main-market-efficiency-measures-in-the-stock-market&quot;&gt;What are the main market efficiency measures in the stock market?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-07-08T20:17:39.303" LastActivityDate="2015-07-08T20:17:39.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17613" PostTypeId="4" CreationDate="2015-05-01T19:46:59.870" Score="0" Body="An efficient market is one where the market price is an unbiased estimate of the true value of the investment. " OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-05-01T20:54:41.813" LastActivityDate="2015-05-01T20:54:41.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17614" PostTypeId="2" ParentId="17610" CreationDate="2015-05-02T09:10:28.520" Score="0" Body="&lt;p&gt;Here is a related previous StackExchange question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/4019/modelling-with-negative-interest-rates&quot;&gt;Modelling with negative interest rates &lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, it seems that Black-Scholes option pricing breaks down.&lt;/p&gt;&#xA;" OwnerUserId="16102" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-05-02T09:10:28.520" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17615" PostTypeId="1" AcceptedAnswerId="17654" CreationDate="2015-05-02T11:44:25.963" Score="3" ViewCount="237" Body="&lt;p&gt;I'm currently reading the research paper, &lt;a href=&quot;http://www.jstor.org/discover/10.2307/1969318?uid=2&amp;amp;uid=4&amp;amp;sid=21106239145251&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;Two Singular Diffusion Problems&lt;/em&gt;&lt;/a&gt;, by William Feller (1950). However, I don't understand how Feller derived the solution $(3.5)$ given equation $(3.4)$ in his research paper. More specifically, I don't understand how Feller solved $$dt=\frac{d\omega}{f(t)-cs\omega} \implies \frac{d\omega}{dt}=f(t)-cs\omega,$$ where $$\text{This is equation (3.4)}\,\,\,\,\,\,\,\,\,\,\,\,\,\, e^{-bt}\frac{as-b}{s}=C_1 \implies s=\frac{be^{-bt}}{ae^{-bt}-C_1},$$ and $a, b, C_1$ are constants with $b\neq0$ to get the solution$$\text{This is equation (3.5)}\,\,\,\,\,\,\,\,\,\,\,\, \omega = \left|C_1 - ae^{-bt}\right|^{c/a}\left\{C_2 + \int_{0}^{t}{\frac{f(\tau)d\tau}{\left|C_1 - ae^{-b\tau}\right|^{c/a}}}\right\},$$ where $C_2$ is a constant as well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please note that I have already verified this is true by differentiating it (and using the &lt;em&gt;Fundamental Theorem of Calculus&lt;/em&gt;) but I don't understand &lt;em&gt;how&lt;/em&gt; Feller derived it originally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone please explain to me in details or give me some hints regarding this? Any help will be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="7960" LastEditorUserId="7960" LastEditDate="2015-05-03T06:40:48.403" LastActivityDate="2015-05-04T18:10:33.270" Title="Regarding &quot;Two Singular Diffusion Problems&quot; by William Feller" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;statistical-finance&gt;&lt;differential-equations&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17616" PostTypeId="2" ParentId="17588" CreationDate="2015-05-02T12:11:37.437" Score="2" Body="&lt;p&gt;Crouhy, Mark and Galai's book &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0071357319&quot; rel=&quot;nofollow&quot;&gt;Risk Management&lt;/a&gt; is about all aspects of risk management for investment banks, including credit risk of course.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you need to focus on one book, it is this one.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2015-05-02T12:11:37.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17617" PostTypeId="1" CreationDate="2015-05-02T14:41:29.167" Score="3" ViewCount="572" Body="&lt;p&gt;Any recommendations or reading sources for estimating individual PDs and LGDs for a set of low-default assets (souvereigns, investment grade corporates)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since observing no defaults at all, regular probability regressions (linear, logit, probit,...) are not feasible.&lt;/p&gt;&#xA;" OwnerUserId="13950" LastEditorUserId="2553" LastEditDate="2015-05-06T11:34:34.497" LastActivityDate="2015-05-06T11:34:34.497" Title="References for PD / LGD estimates of low-default portfolios" Tags="&lt;risk-management&gt;&lt;reference-request&gt;&lt;credit-risk&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17618" PostTypeId="1" CreationDate="2015-05-02T15:06:33.513" Score="1" ViewCount="543" Body="&lt;p&gt;I have come across a somewhat strange formula (atleast to me) for Value at Risk calculation for a Bond position. This typical formula looks like below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PnL = Beta * &quot;Some industry Credit spread&quot; * CV01 * CreditSpreadDelta&lt;/p&gt;&#xA;&#xA;&lt;p&gt;it looks like in the historical data base is maintained for the 2nd item in the RHS of above formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can Quants here through me some light to understand above formula. Your help will be highly appreciated. Thank you.&lt;/p&gt;&#xA;" OwnerUserId="16105" LastActivityDate="2015-05-02T15:06:33.513" Title="Market risk calculation for Fixed income position" Tags="&lt;risk-models&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17619" PostTypeId="1" CreationDate="2015-05-02T15:13:48.050" Score="1" ViewCount="937" Body="&lt;p&gt;A financial institution currently has a portfolio with delta of 450 and gamma of&#xA;6,000. A traded option is available with a delta of 0.6 and a gamma of 1.5. How &#xA;could the portfolio be made both delta neutral and gamma neutral? &#xA;Sorry for this easy question, however I want to know how to make the portfolio delta and gamma neutral. Thanks a lot. &lt;/p&gt;&#xA;" OwnerUserId="16106" LastActivityDate="2015-06-03T20:12:01.050" Title="Delta and gamma neutral" Tags="&lt;option-pricing&gt;&lt;delta-hedging&gt;&lt;gamma&gt;&lt;delta-neutral&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17620" PostTypeId="1" AcceptedAnswerId="17624" CreationDate="2015-05-02T16:04:34.213" Score="1" ViewCount="2717" Body="&lt;p&gt;I have two machines over a 10Gb network that need to communicate with each other through a TCP connection. In terms of technology, what is the current lowest latency possible for this to happen? What are the top players in the market using to bring their TCP latency down to the bare minimum?&lt;/p&gt;&#xA;" OwnerUserId="15964" LastActivityDate="2015-05-02T18:36:24.830" Title="What is the current lowest possible latency for TCP communication?" Tags="&lt;programming&gt;&lt;latency&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17622" PostTypeId="1" CreationDate="2015-05-02T16:46:00.063" Score="2" ViewCount="141" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;we will assume that for any random variable $X:\Omega\rightarrow\mathbb{R}$, some investor will be willing to buy and some investor will be willing to sell a 'financial instrument' whose final payoff is $X$. (Actually, this is one of the few assumptions about the market that we have made that is actually plausible.)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This quote is taken from Steven Roman's &quot;Introduction to the Mathematics of Finance Arbitrage and Option Pricing&quot;, 2nd edition, Springer 2012.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is this a plausible assumption? (The market model under discussion in this part of Roman's book is a finite model (finite time, finite probability space, finite number of assets) with no arbitrage opportunity.)&lt;/p&gt;&#xA;" OwnerUserId="15619" LastActivityDate="2016-11-04T14:10:02.713" Title="&quot;For any random variable $X$, someone will be willing to buy and someone to sell a financial instrument, whose final payoff is $X$.&quot;" Tags="&lt;no-arbitrage-theory&gt;&lt;payoff&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17623" PostTypeId="2" ParentId="17620" CreationDate="2015-05-02T18:00:41.310" Score="1" Body="&lt;p&gt;You probably want more than a low &quot;TCP latency&quot;. Anyway, what latency is it? The TCP layer to connect to your 10Go (i.e. The implementation of the TCP protocol only)? The implementation of a protocol to read the market data (direct native feed? FIX?)? Or to &quot;move&quot; the content of the feed to a zone of memory shared with your application? And what about the messages you want to send to the market? Don't you want them to go fast too?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are generic answers in &lt;a href=&quot;http://www.worldscientific.com/worldscibooks/10.1142/8967&quot; rel=&quot;nofollow&quot;&gt;Market Microstructure in Practice&lt;/a&gt; (Laruelle, Lasnier, Pelin, Burgot and L).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rule of thumb is if you are under the millisecond for all the layers I listed, you should be happy. There is not one provider for all of them, you have to investigate on your own. My advice is (from the book): if you really want to go fast, use an FPGA with a physical TCP/IP block, and put on it all the protocols. For simplicity you can &lt;strong&gt;keep the state machine of your trading logic outside of the hardware, but keep all the analytics inside it&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the FPGA for datafeed side, you have firms like &lt;a href=&quot;http://www.novasparks.com&quot; rel=&quot;nofollow&quot;&gt;novasparks&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2015-05-02T18:00:41.310" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17624" PostTypeId="2" ParentId="17620" CreationDate="2015-05-02T18:36:24.830" Score="2" Body="&lt;p&gt;For ultra-low-latency network applications it is mandatory to use a single-threaded, asynchronous, non-blocking network library. You can and should handle multiple TCP connections inside the same reactor thread which will be pinned to a dedicated and isolated cpu core.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To give you an idea of TCP latencies you can take a look on &lt;a href=&quot;http://www.coralblocks.com/index.php/2014/04/coralreactor-performance-numbers/&quot; rel=&quot;nofollow&quot;&gt;our benchmarks&lt;/a&gt; using &lt;a href=&quot;http://www.coralblocks.com/index.php/category/coralreactor/&quot; rel=&quot;nofollow&quot;&gt;CoralReactor&lt;/a&gt;, which is an ultra-low-latency, garbage-free, non-blocking, asynchronous network library implemented in Java.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Messages: 1,000,000 (size 256 bytes)&#xA;Avg Time: 2.15 micros&#xA;Min Time: 1.976 micros&#xA;Max Time: 64.432 micros&#xA;75% = [avg: 2.12 micros, max: 2.17 micros]&#xA;90% = [avg: 2.131 micros, max: 2.204 micros]&#xA;99% = [avg: 2.142 micros, max: 2.679 micros]&#xA;99.9% = [avg: 2.147 micros, max: 3.022 micros]&#xA;99.99% = [avg: 2.149 micros, max: 5.604 micros]&#xA;99.999% = [avg: 2.149 micros, max: 7.072 micros]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We are not aware of any software-based network library, even in C/C++, that can go below that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keep in mind that 2.15 micros is over loopback, so I am not considering network and os/kernel latencies. For a 10Gb network, the over-the-wire latency for a 256-byte size message will be at least 382 nanoseconds from NIC to NIC. If you are using a network card that supports kernel-bypass (Open OnLoad) then the os/kernel latency should be very low.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt; I am one of the developers of CoralReactor.&lt;/p&gt;&#xA;" OwnerUserId="11804" LastActivityDate="2015-05-02T18:36:24.830" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17625" PostTypeId="2" ParentId="17619" CreationDate="2015-05-02T19:14:14.893" Score="0" Body="&lt;p&gt;I assume that stock is also available. Consider then&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What is the delta of stock? What is the gamma of stock?&lt;/li&gt;&#xA;&lt;li&gt;What position should the financial institution take in the traded option and the stock so that the gamma and delta of the portfolio are both 0?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="15244" LastActivityDate="2015-05-02T19:14:14.893" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17626" PostTypeId="1" CreationDate="2015-05-02T19:38:44.323" Score="0" ViewCount="83" Body="&lt;p&gt;Algotrading is growing, while banks don't currently have the HR to continually develop sophisticated algorithms on their own.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it likely that banks (and governments) would become clients of algotrading companies, or instead open their own algo dev departments to compete agains everyone else?&lt;/p&gt;&#xA;" OwnerUserId="15413" LastActivityDate="2015-05-04T20:13:25.260" Title="Is it likely that banks would become clients of algotrading companies?" Tags="&lt;algorithmic-trading&gt;&lt;banks&gt;&lt;forecast&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2015-05-05T18:40:14.323" ContentLicense="CC BY-SA 3.0" />
  <row Id="17627" PostTypeId="2" ParentId="14899" CreationDate="2015-05-02T19:46:20.757" Score="1" Body="&lt;p&gt;You will pay a lot for these guys but that's what large financial institutions use to price their futures. Pricing plans, timing and regional coverage depends on the vendor. They all pull prices from various exchanges.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Reuters&lt;/li&gt;&#xA;&lt;li&gt;IDC&lt;/li&gt;&#xA;&lt;li&gt;Bloomberg&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Unfortunately it happens that these guys would pull the wrong settlement price from the various exchanges they feed from. It doesn't happen all the time but it does happen and in my line of business we can't let these discrepancies slip through the crack. We found out that the best way to confirm discrepant prices is to check against the exchange itself.  &lt;/p&gt;&#xA;" OwnerUserId="16108" LastActivityDate="2015-05-02T19:46:20.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17628" PostTypeId="1" AcceptedAnswerId="17629" CreationDate="2015-05-02T23:00:02.100" Score="0" ViewCount="315" Body="&lt;p&gt;Consider exercise 5.5 from Shreve volume 1:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/XGIdJ.jpg&quot; alt=&quot;Shreve&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For part (I), I understand how you can use reflection to show that $P(M_n^*\geq m, M_n=b)=P(M_n=2m-b)$. However, it seems to me that this latter probability is just a binomial, and hence:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P(M_n=2m-b)={n\choose 2m-b}(1/2)^n$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is not equal to the equation given; for example $n=6,m=2,b=0$ is a counterexample. What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="5361" LastEditorUserId="3188" LastEditDate="2015-05-03T17:56:31.660" LastActivityDate="2015-05-03T20:34:22.967" Title="Random walks and using the reflection principle" Tags="&lt;random-walk&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17629" PostTypeId="2" ParentId="17628" CreationDate="2015-05-02T23:21:44.617" Score="1" Body="&lt;p&gt;If you go up $u$ times and down $d$ times, your random walk ends up at $u-d$ at time $u+d$. Since there are ${u+d \choose u}$ ways to distribute the $u$ up moves among the $u+d$ moves &#xA;$$&#xA;P(M_{u+d} = u-d) = {u+d \choose u} \frac{1}{2^{u+d}}&#xA;$$ &#xA;Setting $n = u+d$, $x = u-d = 2u-n$, so $u = n+x/2$, this is equivalent to $$&#xA;P(M_n = x) = {n \choose (n+x)/2} \frac{1}{2^n}.&#xA;$$ &#xA;So &#xA;$$&#xA;  P(M_n = 2m-b) = {n \choose (n-b)/2+m} \frac{1}{2^n} &#xA;$$&#xA;as announced.&lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2015-05-03T20:34:22.967" LastActivityDate="2015-05-03T20:34:22.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17630" PostTypeId="1" CreationDate="2015-05-03T02:06:51.163" Score="1" ViewCount="44" Body="&lt;p&gt;First problem is like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;loan amount: 20,000,000.00&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First six months: There is no payment but there are interest (grace period)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next six months: payment of 600,000.00&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since 13 month: payment of R&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Term: 3 years&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interest rate:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First year: 1% effective monthly&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second year:1.5% effective monthly&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Third year: 2% effective monthly&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Find R value&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Answer from textbook 954,066.98&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My attempt: I put focal date on month six, then i move 20M to focal date and late i tried to move all payments to my focal date&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.wolframalpha.com/input/?i=solve+21020201%3D600000%281-%281%2B0.01%29&quot; rel=&quot;nofollow&quot;&gt;https://www.wolframalpha.com/input/?i=solve+21020201%3D600000%281-%281%2B0.01%29&lt;/a&gt;^-6%29%2F0.01%2Bx%28%281-%281%2B0.015%29^-6%29%2F0.015%29*%281%2B0.015%29^-6%2Bx*%28%281-%281%2B0.02%29^-12%29%2F0.02%29*%281%2B0.02%29^-18&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But i guess that was, 'cause wolfram answer is really far from textbook&lt;/p&gt;&#xA;" OwnerUserId="16112" LastEditorUserId="16112" LastEditDate="2015-05-03T20:44:52.210" LastActivityDate="2015-05-03T20:44:52.210" Title="Annuities problem" Tags="&lt;finance&gt;&lt;financial-engineering&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17631" PostTypeId="1" CreationDate="2015-05-03T10:55:15.640" Score="1" ViewCount="971" Body="&lt;p&gt;I am a beginner in R and my econometrics background is not very sound either. I want to build a constant conditional correlation GARCH (1,1) model in R and I found the function, the description of which I have copy-pasted below. This functions requires that you calculate the individual matrices and vectors individually and then you plug them into the function. The problem is that I do not know how to do it individually. Is there any package that calculates the GARCH coefficients automatically?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simulating an (E)CCC-GARCH(1,1) process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Description&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This function simulates data either from the original CCC-GARCH by Bollerslev (1990) or from the Extended CCC-GARCH that has non-zero off-diagonal entries in the parameter matrices in the GARCH equation. The innovations (the standardised residuals) can be either a normal or student's $t$ distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The dimension (N) is determined by the number of elements in the \mathbf{a} vector.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usage&lt;/p&gt;&#xA;&#xA;&lt;p&gt;eccc.sim(nobs, a, A, B, R, d.f=Inf, cut=1000, model)&#xA;Arguments&lt;/p&gt;&#xA;&#xA;&lt;p&gt;nobs&lt;br&gt;&#xA;a number of observations to be simulated (T)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a&lt;br&gt;&#xA;a vector of constants in the GARCH equation (N \times 1)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A&lt;br&gt;&#xA;an ARCH parameter matrix in the GARCH equation. \mathbf{A} can be a diagonal matrix for the original CCC-GARCH model or a full matrix for the extended model (N \times N)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;B&lt;br&gt;&#xA;a GARCH parameter matrix in the GARCH equation. \mathbf{B} can be a diagonal matrix for the original CCC-GARCH model or a full matrix for the extended model (N \times N)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;R&lt;br&gt;&#xA;a constant conditional correlation matrix (N \times N)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;d.f &#xA;the degrees of freedom parameter for the t-distribution&lt;/p&gt;&#xA;&#xA;&lt;p&gt;cut &#xA;the number of observations to be thrown away for removing initial effects of simulation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;model&lt;br&gt;&#xA;a character string describing the model. &quot;diagonal&quot; for the diagonal model and &quot;extended&quot; for the extended (full ARCH and GARCH parameter matrices) model&lt;/p&gt;&#xA;" OwnerUserId="16117" LastActivityDate="2015-05-03T10:55:15.640" Title="Constant Conditional Correlation GARCH (1,1)" Tags="&lt;garch&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17632" PostTypeId="1" AcceptedAnswerId="40460" CreationDate="2015-05-03T13:51:49.017" Score="4" ViewCount="158" Body="&lt;p&gt;Do you know any good papers on methods of Stochastic Optimal Control and Hamilton-Jacobi-Bellman(HJB) for optimization of different ratios(Sharpe, M2, Sortino, Sterling, etc.)? &#xA;Meaning that using known stochastic dynamics of asset, we want to find optimal trading strategy for maximization of these ratios.&#xA;I've found only &lt;a href=&quot;http://www.wilmott.com/messageview.cfm?catid=4&amp;amp;threadid=83811&quot; rel=&quot;nofollow&quot;&gt;this thread&lt;/a&gt; on Wilmott.&lt;/p&gt;&#xA;" OwnerUserId="15935" LastActivityDate="2018-06-24T12:45:56.283" Title="Stochastic Optimal Control for ratios" Tags="&lt;trading&gt;&lt;stochastic-calculus&gt;&lt;sharpe-ratio&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17633" PostTypeId="2" ParentId="17626" CreationDate="2015-05-03T14:05:11.107" Score="1" Body="&lt;p&gt;I dont think neither of both ideas are to be very fertile in the present structures of banks or asset management firms. There are several factors that have influenced the birth of algo trading. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) The development of computer processing capacity behyond human capabilities which provided the hability to process more information than any team would. This will eliminate or substitute all present personnel as per it requires mostly different knowledge than present. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Lack of knowledge at the management level required in banks to formulate and perform and implement team building as per the complexity and knowledge required to have real quantitative prediction and modeling. Deriving from good quant houses where their offices are stuffed by physicists, mathematicians and comp science phds.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Banks and most fund management companies internal investing today is driven by/sell side fundamental and technical driven ideas rooted in the investing ideas from prior and up to the 80s. These have short to long terms horizons with holing periods that range from weeks to years. In contrast algo trading and its development is usually focused on short to very short term holding periods of securities. There are some factors that may influence this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) Low frequency trading and high frequency trading statistical properties of the time series may differ as per the properties of non stationarity and noise types afecting the time series. Due to this reason some of the analytical methods developed for higher frequency may not be aplicable to low frequency. The complexity of good trading algo companies is beyond the comprehension of most personnel departments from funds and banks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;5) Fundamentally banks and asset management firms have been driven to focus on not diverging much from index returns and competitors and not providing alpha. This has been provided via tactical asset allocation which in general is marginal while structural asset allocation provided the backbone of the weight. In contrast algo companies are not index competing and their allocations and security selection is not index but alpha generation driven.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a culprit on all this and you can see what happens as per the example in high freq trading. In this segment the game is &quot;the winner takes it all&quot; and this depends on who has the fastest machines, fastests algorithms at any given time. so it depends on processing and routing speed as well as but to  a lesser degree in the degree of algo sofistication (most firms use the similar algos with very few firms having the knowledge to formulate breakthroughs and get significantly ahead of competition). So if a segment such us low freq trading will implement such an approach it may have a similar effect.  &lt;/p&gt;&#xA;" OwnerUserId="7616" LastEditorUserId="7616" LastEditDate="2015-05-04T20:13:25.260" LastActivityDate="2015-05-04T20:13:25.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17635" PostTypeId="1" AcceptedAnswerId="17650" CreationDate="2015-05-03T19:38:03.560" Score="1" ViewCount="205" Body="&lt;p&gt;How can I prove that under the risk-neutral probability:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb{P}[S_{t}&amp;lt;K]=-\frac{\partial{C}}{\partial{K}}(K,T)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_{t}$ is the stock price, K is the strike price, C is the call option price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you !&lt;/p&gt;&#xA;" OwnerUserId="15738" LastActivityDate="2015-05-04T15:36:25.630" Title="probability that the stock price is below the strike price" Tags="&lt;probability&gt;&lt;risk-neutral-measure&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17636" PostTypeId="1" AcceptedAnswerId="17637" CreationDate="2015-05-03T20:42:18.347" Score="7" ViewCount="948" Body="&lt;p&gt;I was reading about MPT &lt;a href=&quot;http://en.wikipedia.org/wiki/Modern_portfolio_theory&quot;&gt;http://en.wikipedia.org/wiki/Modern_portfolio_theory&lt;/a&gt; and notices that the total variance of a portfolio is $x' \Sigma x$,  where x is the weighting of the assets and $\Sigma$ the covariance of returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to gain some intuition on why this is a quadratic for and not simply the sum of the individual assets risks multiplied by their weighting.&lt;/p&gt;&#xA;" OwnerUserId="16120" LastEditorUserId="2587" LastEditDate="2015-05-04T12:09:50.210" LastActivityDate="2015-06-01T07:18:21.067" Title="Why is the variance of a portfolio a quadratic form?" Tags="&lt;risk-management&gt;&lt;modern-portfolio-theory&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17637" PostTypeId="2" ParentId="17636" CreationDate="2015-05-03T23:59:57.920" Score="7" Body="&lt;p&gt;if you take the variance of a single asset it scales as a quadratic,&#xA;$$&#xA;var(\lambda X) = \lambda^2 var(X)&#xA;$$&#xA;so it's not surprising that the general case gives a quadratic form.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-05-03T23:59:57.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17638" PostTypeId="2" ParentId="16567" CreationDate="2015-05-04T07:40:27.217" Score="3" Body="&lt;p&gt;The CAPM is by no means a failure.  While not a normative theory like MPT, but a positive one describing a capital market equilibrium under conditions of risk, the CAPM, if applied carefully, still provides a reasonable basis for methods to value uncertain cash flows, e.g. in capital budgeting.  Further, it is at the core of models for  derivatives pricing - in particular in cases where perfect continuous replication is not possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The failure consists rather in &quot;testing&quot; the CAPM with realized returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The CAPM is not meant to forecast that a high beta fund will perform better than a low-beta fund on average in the long term.  Neither is it supposed to explain the past performance of these funds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The CAPM describes relationships between expectations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is amazing that still so much effort has been spent on trying to test it with data about returns in the past.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Imagine you want to test what people are &lt;em&gt;expecting today&lt;/em&gt; about the performance of GE vs. the Dow over the &lt;em&gt;coming&lt;/em&gt; twelve months.  So do you call PMs and ask?  Do an online survey?  Go through all pulished research you can find to try to see a consensus view? Do you analyze current mutual fund and portfolio holdings?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;All these seem justifiable methods to assess expectations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But instead your &quot;test design&quot; is to go on a holiday, come back in a year, and check what the Dow and GE have &lt;em&gt;actually&lt;/em&gt; done...???&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In principle, and simple terms, the famous Fama-French study tested if historical betas measured with &lt;em&gt;realized&lt;/em&gt; returns in the past can explain differences between &lt;em&gt;realized&lt;/em&gt; returns in the more recent past...  While this was a thorough and valid test of historical relationships between realized returns, this test and all that followed, had and have &lt;em&gt;nothing&lt;/em&gt; to do with &lt;em&gt;expectations&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Again, the CAPM describes relationships between expectations.  There is no link to realized returns.  On the contrary.  The CAPM describes a market in equilibrium, at a &lt;em&gt;point&lt;/em&gt; in time.  In equilibrium, there is no trading. At equilibrium prices, supply and demand are balanced.  The CAPM is the Capital Asset PRICING Model.  Not the Capital Asset Return Generation Model. There is no explanation at all in the CAPM for anything having any kind of realized return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sharpe seems to be a very diplomatic guy.  He was relatively outspoken, though, about the distinction between the CAPM and models for the &quot;return-generating process&quot; in his speech when he got the Rijksbank prize for economics in memory of Alfred Nobel, which is downloadable at the Rijksbank web site (the speech, not the prize...).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few years ago, Markowitz wrote a text called &quot;The &quot;Great Confusion&quot; concerning MPT&quot; - arguing against the common view that mean variance portfolio selection would require normally-distributed returns.  One may or may not find arguments to disagree with Markowitz, but if that misunderstanding is as great as the title suggests - it still is dwarfed by the CAPM confusion.&lt;/p&gt;&#xA;" OwnerUserId="16123" LastEditorUserId="16123" LastEditDate="2015-05-04T10:44:38.497" LastActivityDate="2015-05-04T10:44:38.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17640" PostTypeId="1" AcceptedAnswerId="17664" CreationDate="2015-05-04T09:18:05.727" Score="4" ViewCount="146" Body="&lt;p&gt;Let's say a have a correlation matrix $\Omega$ for 25 assets which I use to generate a Monte-Carlo simulation. Let's assume that $\Omega$ is valid (i.e positive-semi-definite, etc...) and estimated empirically with market data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now assume that I want to add a risk factor $r$, but I only know the correlation $\rho$ of that risk factor to a given asset $m$. As $r$ is not easily observable, I can't include it in the empirical estimation. Plus, traders can't mark the correlation with the remaining 24 asset without making the correlation matrix invalid (i.e not positive-definite anymore).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was actually thinking about:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;generating $N$ correlated standard normal numbers for the 25 assets for which correlation is known&#xA;&lt;ul&gt;&#xA;&lt;li&gt;yielding a set $Z$ of size $N \times 25$.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Taking from $Z$ the random numbers corresponding to asset $m$, let's denote them $Z_m$, which is a vector of $N$ standard normal random numbers&lt;/li&gt;&#xA;&lt;li&gt;Correlating a new set of indepentand standard normal numbers $X$ with $Z_m$&#xA;&lt;ul&gt;&#xA;&lt;li&gt;yielding $Y$, a vector of size $N$&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&quot;Appending&quot; $Y$ to $Z$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Somebody suggested me to do something different:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Extend $\Omega$ adding $r$&lt;/li&gt;&#xA;&lt;li&gt;Setting $\Omega_{r,m}=\rho$&lt;/li&gt;&#xA;&lt;li&gt;For each asset $i$ in $\Omega$ such that $i \neq r,m$:&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Set $\Omega_{r,i}=\Omega_{m,i} \cdot \Omega_{r,m}$&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Correlate $Z$ as mentioned in the first point above.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Theoretically, is one of these methods &quot;more right than the other&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there another common approach to solving this kind of problem?&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2015-05-05T02:45:00.957" LastActivityDate="2015-05-05T06:47:17.650" Title="How to infer correlation?" Tags="&lt;correlation-matrix&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17642" PostTypeId="1" AcceptedAnswerId="17647" CreationDate="2015-05-04T11:35:20.603" Score="4" ViewCount="1053" Body="&lt;p&gt;Assume $W_{t}$ is a standard Brownian Motion, calculate the the probability that $W_{t}*W_{2t}$ is negative, i.e., $P(W_{t}*W_{2t}&amp;lt;0)$. I find it tricky to calculate the probability.Thank you.&lt;/p&gt;&#xA;" OwnerUserId="16126" LastActivityDate="2019-10-30T13:55:59.057" Title="probability question about brownian motion" Tags="&lt;probability&gt;&lt;brownian-motion&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17644" PostTypeId="2" ParentId="16351" CreationDate="2015-05-04T12:13:52.383" Score="1" Body="&lt;p&gt;No.  The CAPM is an equilibrium model.  It describes relationships between &lt;em&gt;expectations&lt;/em&gt;.  With OLS you typically estimate a &lt;em&gt;distribution for realized returns&lt;/em&gt; in the future (or sometimes even only in the past...).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$R^i_{t+1} - R^f = \delta (R^{MVE}_{t+1}-R^f) + \varepsilon_{t+1}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is not an equation from the CAPM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The CAPM SML is: $r+E(r_i - r) = r+\beta_i E(r_M-r)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no index $t$, and no random term, as the CAPM describes only expectations, and only for one period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;an equation like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb{E}_t R^i_{t+1} =\alpha_0 + \beta\lambda$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;can always be estimated for any pair of dependent and independent variable and any data set, no matter how investors price anything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's sad that so many use historical data only to estimate betas - as it reads on any retail mutual fund fact sheet, that past performance is no guarantee for future performance...  the same holds for distributions...  of course.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But then, let's say you're a publicly traded corporation, how you estimate beta to get a discount rate for a future risky cash flow, should depend on how you believe the market estimates beta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In principle, though, any approach you find convincing, could be justified, as Sharpe pointed out:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;“Much confusion has arisen concerning the relationship between the equilibrium results of the CAPM and the underlying relationships among security returns. As can be seen, the CAPM makes no assumptions about the “return generating process”. Hence, its results are completely consistent with any such process.” William F. Sharpe, Capital Asset Prices with and without Negative Holdings, Nobel lecture, Dec. 7th 1990, Economic Sciences 1990, p. 320&lt;/p&gt;&#xA;" OwnerUserId="16123" LastActivityDate="2015-05-04T12:13:52.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17645" PostTypeId="2" ParentId="17636" CreationDate="2015-05-04T12:19:02.960" Score="2" Body="&lt;p&gt;If you take the a sample of historical asset returns as model for the risk then you can do two things:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You calculate $r_j = \sum_{i=1}^n w_i r_i^j$ thus for each scenario $j$ you aggregate the individual asset returns to get a scenario for the portfolio. Then you can calculate $Var(r_j)$ the variance of the sample of portfolio returns. This is the same as&lt;/li&gt;&#xA;&lt;li&gt;you calculate the covariance matrix $\Sigma$ on the individual asset returns and then perform $x' \Sigma x$.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The result will be the same. In procedure 1) you will see that assets with positive correlation tend to increase or decrease the aggregate portfolio return in scenarios $j$ (positive covariance) - others will offset each other (negative covariance). This is how how covariance influences the variance of the portfolio return. In 1) you can see it plainly in each scenario (on average) and in 2) you have it translated into $\Sigma$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This should answer why covariance enter the expression for the variance. For why it is a quadratic form: as Mark Joshi puts it: it is a straight forward generalization of the univariate situation.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-06-01T07:18:21.067" LastActivityDate="2015-06-01T07:18:21.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17646" PostTypeId="2" ParentId="2993" CreationDate="2015-05-04T13:05:16.910" Score="2" Body="&lt;p&gt;In the CAPM, $E(r_i) = r_f$, if $\beta_i=0$ holds ALWAYS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BUT: recall the calculation of $\beta$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\beta_i=\cfrac{\sigma_{iM}}{\sigma_M^2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;${\sigma_{iM}}=\Sigma_jw_j\sigma_{ij}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if your asset is uncorrelated with all other assets in the market, the last expression simplifies to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;${\sigma_{iM}}=\Sigma_jw_j\sigma_{ij}=w_i\sigma_i^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so for $\beta_i$ to be 0, you need the weight $w_i$ to be 0, which implies the asset is not in the market portfolio, i.e. it does not exist...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But obviously, the smaller the weight of the asset, the closer $\beta_i$ comes to zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in the case mentioned in the book, it's like you divide a million $ into an ever increasing number of positions, yes, you get close to that.  There would be other cases, e.g. 2 uncorrelated stocks in the market portfolio, one with 99.9% weight, and the other will have a beta close to zero...  actually, the rest of the market portfolio does not matter at all for an asset that is not correlated with anything - it's only its weight in the market portfolio and its variance that determines its beta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S.:&#xA;Of course with positive correlation with other assets, beta would be larger.  With negative correlation with other assets, beta might approach zero faster when reducing the weight, but as long as there is no asset or subportfolio perfectly negatively correlated with $i$, the variance will not disappear completely for a non-zero weight.&#xA;And finally, if there is a perfect hedge for the asset, then we have a case where it makes sense to remind oneself that any point on the efficient frontier could potentially be representing more than one portfolio...(recall short sales allowed)&lt;/p&gt;&#xA;" OwnerUserId="16123" LastEditorUserId="16123" LastEditDate="2015-05-04T13:12:11.497" LastActivityDate="2015-05-04T13:12:11.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17647" PostTypeId="2" ParentId="17642" CreationDate="2015-05-04T14:07:48.893" Score="4" Body="&lt;p&gt;Your decomposition is correct. I will show here the computation  for one term:&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}&#xA;P(W_t &amp;lt; 0, W_{2t} &amp;gt;0) &amp;amp;= P(W_t &amp;lt; 0, W_{2t}-W_t &amp;gt; -W_t)\\&#xA;&amp;amp;= E\Big(E\big(\mathbb{1}_{\{W_t &amp;lt; 0\}}\mathbb{1}_{\{W_{2t}-W_t &amp;gt; -W_t\}}\mid W_t\big)\Big)\\&#xA;&amp;amp;= E\Big(\mathbb{1}_{\{W_t &amp;lt; 0\}} \Phi\big(W_t/\sqrt{t}\big)\Big) \\&#xA;&amp;amp;=E\Big(\mathbb{1}_{\{W_t/\sqrt{t} &amp;lt; 0\}} \Phi\big(W_t/\sqrt{t}\big)\Big) \\&#xA;&amp;amp;=\int_{-\infty}^0 \phi(x) \Phi(x) dx\\&#xA;&amp;amp;=\frac{1}{2}\Phi(x)^2\mid_{-\infty}^0\\&#xA;&amp;amp;=\frac{1}{8},&#xA;\end{align*}&lt;/span&gt;&#xA;where &#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}&#xA;\phi(x)=\frac{1}{\sqrt{2\pi}} e^{-\frac{x^2}{2}}&#xA;\end{align*}&lt;/span&gt;&#xA;is the density of a standard normal random variable, and &lt;span class=&quot;math-container&quot;&gt;$\Phi(x)$&lt;/span&gt; is the cumulative distribution function.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2019-10-30T13:55:59.057" LastActivityDate="2019-10-30T13:55:59.057" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="17648" PostTypeId="2" ParentId="9496" CreationDate="2015-05-04T14:54:35.387" Score="0" Body="&lt;p&gt;The standard deviation of an asset is less relevant if you hold a portfolio and not a single asset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the CAPM, every investor holds the same portfolio of risky assets - the market portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The CAPM implies further that the market portfolio has the highest expected portfolio return per unit of portfolio standard deviation of all possible portfolios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This property leads mathematically to a positive linear relationship between expected return and beta, with expected returns for stocks with negative beta being negative as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Beta is negative if the correlation of the stock with the market portfolio is negative.  So with your suggestion 2. you are probably not too far off.&lt;/p&gt;&#xA;" OwnerUserId="16123" LastEditorUserId="16123" LastEditDate="2015-05-04T15:10:07.577" LastActivityDate="2015-05-04T15:10:07.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17650" PostTypeId="2" ParentId="17635" CreationDate="2015-05-04T15:24:29.620" Score="4" Body="&lt;p&gt;Your posting has an error, that is, the identity should be&#xA;\begin{align*}&#xA;-P(0, T) \mathbb{P}(S_T &amp;gt; K) = \frac{\partial C}{\partial K}.&#xA;\end{align*}&#xA;The derivation below is based on this assumption.&#xA;We denote by $f(x)$ the density function for $S_T$. Then&#xA;\begin{align*}&#xA;\mathbb{P}(S_T &amp;gt; K) = \int_K^{\infty} f(x) dx,&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;C(K, T) &amp;amp;= P(0, T) \mathbb{E}\big((S_T-K)^+ \big)\\&#xA;&amp;amp;=P(0, T) \int_K^{\infty}(x-K) f(x) dx\\&#xA;&amp;amp;= P(0, T)\bigg[\int_K^{\infty} x f(x) dx - K \int_K^{\infty}f(x) dx \bigg].&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;\frac{\partial C}{\partial K} = -P(0, T)\int_K^{\infty} f(x) dx.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;-P(0, T) \mathbb{P}(S_T &amp;gt; K) = \frac{\partial C}{\partial K}.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can additionally obtain that&#xA;\begin{align*}&#xA;P(0, T) f(K) = \frac{\partial^2 C}{\partial K^2}.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-05-04T15:36:25.630" LastActivityDate="2015-05-04T15:36:25.630" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17651" PostTypeId="2" ParentId="17642" CreationDate="2015-05-04T15:32:20.107" Score="6" Body="&lt;p&gt;Since $W_{2t}-W_{t}$ is independent of $W_t$ and has the same law as $W_{2t-t}=W_t$ we only have to compute&#xA;$$P(X(X+Y)&amp;lt;0)$$&#xA;where $(X,Y)$ follows a bivariate normal distribution (with zero correlation). From there you can split the probability in two cases : either $X&amp;lt;0$ and $X+Y&amp;gt;0$ or the opposite. The two events have the same probability since $(-X,-Y)\sim (X,Y)$. You are left with the computation of&#xA;$$ P(X&amp;lt;0,X+Y&amp;gt;0)$$&#xA;since the distribution of $(X,Y)$ is invariant by rotation around the z-axis) this probability can be computed geometrically (think cutting a cake, the cake being the bivariate density) : it is equal to $1/8$. The final result is thus $1/4$.&lt;/p&gt;&#xA;" OwnerUserId="2411" LastEditorUserId="2411" LastEditDate="2015-05-07T10:44:42.003" LastActivityDate="2015-05-07T10:44:42.003" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17654" PostTypeId="2" ParentId="17615" CreationDate="2015-05-04T18:10:33.270" Score="1" Body="&lt;p&gt;For simplicity, we assume the necessary positivity, and then we can ignore the absolute signs. Note that&#xA;\begin{align*}&#xA;\big(C_1 - a e^{-bt} \big) d\omega = \big(C_1 - a e^{-bt} \big) f(t) dt + cbe^{-bt} \omega dt.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;\big(C_1 - a e^{-bt} \big)\,d\omega - cbe^{-bt} \omega \, dt= \big(C_1 - a e^{-bt} \big) f(t)dt.&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;d\Big(\big(C_1-ae^{-bt} \big)^{-\frac{c}{a}} \, \omega\Big) &amp;amp;= -\frac{c}{a}\,\omega \big(C_1-ae^{-bt} \big)^{-\frac{c}{a}-1}\big(abe^{-bt}\big) dt + \big(C_1-ae^{-bt} \big)^{-\frac{c}{a}} d\omega\\&#xA;&amp;amp;=\big(C_1-ae^{-bt} \big)^{-\frac{c}{a}-1}\Big[\big(C_1-ae^{-bt} \big) d\omega- cbe^{-bt} \omega \, dt \Big]\\&#xA;&amp;amp;=\big(C_1-ae^{-bt} \big)^{-\frac{c}{a}}f(t)dt.&#xA;\end{align*}&#xA;The remaining is now obvious.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-05-04T18:10:33.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17655" PostTypeId="1" CreationDate="2015-05-04T19:06:36.710" Score="2" ViewCount="191" Body="&lt;p&gt;Does anyone know a reference where I can find the pricing formulas for vanilla calls in the affine stochastic volatility jump diffusion class of models such as SVJ and SVJJ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for something analogous to the following formulas which apply to the Heston (square root) affine stochastic volatility model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;	c(t)&#xA;		&amp;amp; = \frac{e^{-\alpha\log K}}{\pi}\int_0^\infty dv e^{-i v \log K}\rho(v) \\&#xA;	\rho(v)&#xA;		&amp;amp; = \frac{e^{-r(T-t)}\phi(v-i(\alpha+1);T)}{\alpha^2+\alpha-v^2 + i(2\alpha+1)v} \\&#xA;	\phi(u;T)&#xA;		&amp;amp; = \mathbb{E}^{Q_B}_t[e^{i u \log S(T)}], \\&#xA;	\phi(u;T)&#xA;		&amp;amp; = e^{i u[\log S(t)+(r-\delta)(T-t)]-\frac{1}{\sigma_v^2}\left[\bar{v}\kappa\left(a(T-t) + 2\log\beta\right)+v_0 \gamma \right]} \\&#xA;	\beta&#xA;		&amp;amp; = \frac{1-ge^{-d (T-t)}}{1-g} \\ &#xA;	\gamma&#xA;		&amp;amp; = \frac{a(1-e^{-d (T-t)})}{1-g e^{-d (T-t)}} \\&#xA;	d&#xA;		&amp;amp; = \sqrt{(i\rho \sigma_v u - \kappa)^2 + \sigma_v^2(iu + u^2)} \\&#xA;	g&#xA;		&amp;amp; = a/b \\&#xA;	a&#xA;		&amp;amp; = i\rho\sigma_v u-\kappa + d \\&#xA;	b&#xA;		&amp;amp; = i\rho \sigma_v u-\kappa - d&#xA;\end{align}&lt;/p&gt;&#xA;" OwnerUserId="15782" LastEditorUserId="467" LastEditDate="2015-10-08T07:51:47.783" LastActivityDate="2016-01-06T14:15:28.243" Title="Where to find pricing formulas for affine stochastic volatility jump-diffusion models?" Tags="&lt;stochastic-volatility&gt;&lt;pricing-formulae&gt;&lt;jump&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17656" PostTypeId="2" ParentId="3486" CreationDate="2015-05-04T19:10:07.803" Score="4" Body="&lt;p&gt;The theoretical answer is:&#xA;If you feel you should exercise at $t&amp;lt;T$ then you can get $S_t-K$ (obviously $S_t&amp;gt;K$). But price of the option at any$t&amp;lt;T$ is $C_t&amp;gt;S_t-K$ always. So rather than exercising just sell the option and let someone else hold it.&#xA;But then practically there are transaction costs etc.&lt;/p&gt;&#xA;" OwnerUserId="16129" LastActivityDate="2015-05-04T19:10:07.803" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17657" PostTypeId="1" AcceptedAnswerId="18900" CreationDate="2015-05-04T19:40:21.567" Score="2" ViewCount="4624" Body="&lt;p&gt;I'm trying to understand bond pricing with the Vasicek interest rate model.  I'm using McDonald's book for this purpose (not homework).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recall that Vasicek dynamics are&#xA;\begin{equation*}&#xA;  \mathrm{d}r_t = a(b - r_t) \mathrm{d}t + \sigma \mathrm{d}Z_t.&#xA;\end{equation*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, Macdonald introduces the exponential affine formulas to price a unit zero:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;  P(r,t,T) &amp;amp;= A(t,T)\exp\left(rB(t,T)\right) \\&#xA;  A(t,T)   &amp;amp;= \exp\left(\bar{r} (B(t,T) - T + t) + \frac{B(t,T)^2\sigma^2}{4a}\right)\\&#xA;  B(t,T)   &amp;amp;= \frac{1 - e^{-a(T-t)}}{a}\\&#xA;  \bar{r}  &amp;amp;= b + \frac{\sigma\phi}{a} - \frac{\sigma^2}{a^2}&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the course of deriving these expressions, Macdonald asks us to assume that $\phi$, which is the Sharpe ratio for the motion, is constant.  But we can see that it is only constant when $a = 0$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Later, Macdonald talks about the Sharpe ratio for the &quot;interest rate risk&quot;, a phrasing I find very obscure.  Is that the bond price process?  The Vasicek process?  In either case, they're driven by the same Brownian motion and should have the same (non-constant) Sharpe ratio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can somebody explain how to apply these formulas?  Just a sketch would do -- but I'm stymied by the presentation.&lt;/p&gt;&#xA;" OwnerUserId="8229" LastActivityDate="2015-07-16T17:20:33.150" Title="Pricing a zero with Vasicek model" Tags="&lt;interest-rates&gt;&lt;bond&gt;&lt;vasicek&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17658" PostTypeId="2" ParentId="3486" CreationDate="2015-05-04T20:57:06.563" Score="8" Body="&lt;p&gt;At the time of exercise, you don't know what the final expiry stock value is. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the portfolio consisting of the option and $K$ zero coupon bonds worth $B_t \leq 1.$ At expiry its value is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\max(S,K) \geq S&#xA;$$&#xA;since can you exercise and get the stock if $S&amp;gt;K$ and have $K$ otherwise.&#xA;So at all times previously, &#xA;$$&#xA;C_t + K B_t &amp;gt; S_t&#xA;$$&#xA;since it dominates at expiry. So&#xA;$$&#xA;C_t &amp;gt; S_t - KB_t &amp;gt; S_t - K.  &#xA;$$&#xA;So the European option is always worth more than its intrinsic before expiry. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And the American is worth at least as much as the intrinsic so it's never sensible to early exercise. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this does not require dynamic hedging.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I discuss this question at length in my book  Concepts etc.)&lt;/p&gt;&#xA;" OwnerUserId="1809" LastEditorUserId="27059" LastEditDate="2017-12-31T03:26:40.877" LastActivityDate="2017-12-31T03:26:40.877" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17661" PostTypeId="1" AcceptedAnswerId="17803" CreationDate="2015-05-04T12:42:35.890" Score="4" ViewCount="3720" Body="&lt;p&gt;The following problem arises in the context of private equity, which typically report &quot;smoothed&quot; returns (think of it as a moving average). As you can imagine, &quot;smoothed&quot; returns would have a much lower volatility compared to the volatility of &quot;unsmoothed&quot; returns. For risk calculation we are interested in volatility of &quot;unsmoothed&quot; returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mathematically, suppose I observe a process $\bar{r}_t$ which is a moving average of process $r_t$, i.e., $\bar{r}_t = \sum_{k=0}^p w_k r_{t-k}$. I also know that $r_t = \alpha + \beta r_{I, t} + \epsilon_t$, where $r_{I, t}$ are returns of a public index and $\epsilon_t = N(0, \sigma^2)$. I would like to estimate &quot;unsmoothed&quot; returns $r_t, t = 0, \ldots, T$  from the data: $\bar{r}_t, r_{I,t}, t=0, 1, \ldots, T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can somebody suggest how should I go about this estimation? If there is a reference to a similar problem, that should be fine too. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="11969" OwnerDisplayName="vdesai" LastActivityDate="2015-08-04T13:59:08.650" Title="Unsmoothing of returns" Tags="&lt;time-series&gt;&lt;estimation&gt;&lt;moving-average&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17662" PostTypeId="2" ParentId="17661" CreationDate="2015-05-04T13:15:38.553" Score="4" Body="&lt;p&gt;Did you try solving for $w_k$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\bar{r}_t = \sum_{k=0}^p w_k r_{t-k}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\bar R = W R$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you probably have $t&amp;gt;&amp;gt;k$, you can solve for $W$ using OLS &#xA;$$\bar R = W R +\varepsilon$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-- UPDATE&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can try applying &lt;a href=&quot;http://en.wikipedia.org/wiki/Kalman_filter&quot; rel=&quot;nofollow&quot;&gt;Kalman filter&lt;/a&gt;. Here, your state evolution is $$r_t=\mu+\varepsilon_t$$. You introduce new vector $x_t=(r_t, r_{t-1}, \dots, r_{t-p+1})$ and $\mu_x=(\mu,\mu,\dots,\mu)$ re-write this as:&#xA;$$x_t = \mu_x+x_{t-1}+e_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming the returns are independent and variance is constant AND that weights add up to 1, i.e. $\varepsilon\sim\mathcal{N}(0,\sigma)$ you can see that $\mu_{\bar r}=\mu_r$ and $\sigma_{\bar r}^2=\sigma_r^2\sum_{k=0}^{p-1}w_k^2$. Hence, $e_t$ is a multivariate normal with a diagonal covaraince matrix $diag(\Sigma)=\frac{1}{\sum_{k=0}^{p-1}w_k^2}(\sigma_{\bar r}^2,\sigma_{\bar r}^2,\dots,\sigma_{\bar r}^2)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next, your measurement equation is $$\bar x_t=x_t \cdot(w_0,w_1,\dots,w_{p-1})'$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This should be very easy to estimate using Kalman filter packages.&lt;/p&gt;&#xA;" OwnerUserId="7365" OwnerDisplayName="Aksakal" LastActivityDate="2015-05-04T18:08:12.553" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17663" PostTypeId="1" CreationDate="2015-05-05T05:00:07.213" Score="2" ViewCount="117" Body="&lt;p&gt;I have the following non-linear PDE and I have no idea how to go about solving it using a finite difference scheme in Python. Can someone get me started and/or point me to an algorithm for doing this? It represents the price of a derivative in the Uncertain Volatility Model (where $\sigma \in [\sigma_{low}, \sigma_{high}]$). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\partial_t u(t,x) + H(x, D_x^2u(t,x)) = 0$$ $(t,x) \in [0,T) \times\mathbb{R}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$H(x,\Gamma) = \frac{1}{2}x^2\Sigma(\Gamma)^2\Gamma$$&#xA;$$\Sigma(\Gamma) = \sigma_{low}1_{\Gamma &amp;lt; 0} + \sigma_{high}1_{\Gamma \ge 0}$$ &lt;/p&gt;&#xA;" OwnerUserId="16133" LastActivityDate="2015-05-06T01:32:37.313" Title="Solving a Non-Linear PDE using a Finite Difference Scheme" Tags="&lt;options&gt;&lt;volatility&gt;&lt;option-pricing&gt;&lt;finite-difference-method&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17664" PostTypeId="2" ParentId="17640" CreationDate="2015-05-05T06:47:17.650" Score="2" Body="&lt;p&gt;You have the risk factor $F$ and the asset that it is correlated to $r_m$. You can calculate the variances of each of these, say $\sigma^2_F$ and $\sigma^2_m$. If you do not care about the distribution but just work with variances and correlations then can look at an OLS setting:&#xA;$$&#xA;F = \beta r_m + \epsilon&#xA;$$&#xA;with $\beta = \rho \frac{\sigma_F}{\sigma_m}$ and $\epsilon$ uncorrelated.&#xA;Then the covariane is preserved:&#xA;$$&#xA;Cov(F,r_m) = Cov(\beta r_m + \epsilon, r_m) = Cov(\beta r_m,r_m) = \beta \sigma^2_m = \rho \sigma_m \sigma_F.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we assume that $\epsilon$ is uncorrelated with all other $r_i$ then for any other asset $r_i$ you have&#xA;$$&#xA;Cov(F,r_i) =  Cov(\beta r_m + \epsilon, r_i) = \beta Cov(r_m,r_i),&#xA;$$&#xA;and you get a full covariance matrix.&#xA;In the case $\epsilon$ is correlated to $r_i$ you add $Cov(\epsilon,r_i)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This could be a way to go if you are just interested in co/variances.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-05-05T06:47:17.650" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="17665" PostTypeId="1" AcceptedAnswerId="17673" CreationDate="2015-05-05T07:01:14.790" Score="3" ViewCount="483" Body="&lt;p&gt;Suppose I have a portfolio of stocks $(S)$ and savings account ($\beta_t$)&#xA;then, the value is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V = a_t S_t + b_t \beta_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and for this portfolio to be self replicating, we need by Ito's lemma&#xA;$$dV = a_t dS_t + b d \beta_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let $$a_t = 2B_t, b_t = -t - B_t^2 - 20B_t, S_t = 10 + B_t, \beta_t = 1$$&#xA;With $$B_t = \text{Brownian Motion at time t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I show if this portfolio is self-financing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can write&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V = a_t S_t + b_t \beta_t = 2B_t(10+B_t) - (t + B_t^2)$$ &#xA;$$= 20B_t + 2B_t^2 - t - B_t^2 = 20B_t + B_t^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $$S_t = 10 + B_t \to dS_t = dB_t ?$$ &#xA;And $$\beta_t = 1 \to d \beta_t = 0 ?$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I am having difficulty in evaluating $dV$ in these terms. Can someone help?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dV = \{....?\}$$ &lt;/p&gt;&#xA;" OwnerUserId="16134" LastActivityDate="2015-05-06T12:48:34.843" Title="Stochastic Differentials - Ito's formula for a self-financing portfolio" Tags="&lt;stochastic-processes&gt;&lt;finance&gt;&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17666" PostTypeId="1" AcceptedAnswerId="17671" CreationDate="2015-05-05T08:08:40.293" Score="2" ViewCount="82" Body="&lt;p&gt;Let $G_{t}$ be a filtration and $M_{t}$ a $G_{t}$-martingale. Why do we have this decomposition:&#xA;$H_{t}=\mathbb{E}[H|G_t]=\int_{0}^{t}h_{s}dM_{s}+R_{t}$ where $R_{t}$ is a martingale orthogonal with M &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="15738" LastEditorUserId="2587" LastEditDate="2015-05-05T09:30:11.917" LastActivityDate="2015-05-05T17:37:33.623" Title="martingale decomposition problem" Tags="&lt;stochastic-processes&gt;&lt;martingale&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17669" PostTypeId="1" AcceptedAnswerId="17678" CreationDate="2015-05-05T15:02:42.037" Score="10" ViewCount="682" Body="&lt;p&gt;It is a rather well-spread fact that in Black-Scholes (BS) model for a stock with no dividends that follows Geometric Brownian Motion (GBM), the price of American call coincides with that of its European counterpart. Regarding that I have some questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;When I wanted to check the proof of that, even though I have quite a library of FinMath books, I have only found the proof in Shreve's &quot;Stochastic Calculus for Finance Vol II&quot;. The proof there is probabilistic, and just based on the fact that the price of the call is submartingale, hence by optional sampling theorem it's not optimal to early exercise it. However, I was not able to find a proof which is more in the spirit of the PDE approach to pricing. For example, I did not see it in any books of Wilmott, which surprised me a lot. So the first question: what are other sources with the proof, and are there proofs different from that in Shreve?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Based on the proof by Shreve, it does not seem that the underlying must follow GBM, the only important part seems to be that we shall be able to take discounting outside of expectation, so in particular for deterministic interest rates. I guess that implies that many other models: local volatility, stochastic volatility etc. also imply the price of American call being equal to the European call price. Next thought was about the models with jumps - but wait... stock paying dividends is a particular case of the jump model, and we know for sure that in such case American call worth strictly more than European one. Is it due to the fact that there does not exist probability measure under which the (discounted) price of such stock is a martingale?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In general: what are sufficient (and perhaps necessary) conditions for American call price being equal to European call price. This question is purely theoretical: namely, for which models does that hold. Does that also hold for futures on stocks, Fixed Income and FX products being the underlying? From the first glance, at least in case of futures it seems that as long as its price can be modeled by GBM, same theory shall apply (that's nothing more than yet another underliyng, we don't care whether it's a stock or futures on stock), however I've heard somewhere that it may be strictly suboptimal to hold American calls on futures till expiry.&lt;/p&gt;&#xA;" OwnerUserId="13480" LastActivityDate="2016-05-17T02:22:33.277" Title="American Call: when it's European?" Tags="&lt;american-options&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17670" PostTypeId="1" CreationDate="2015-05-05T15:10:21.827" Score="4" ViewCount="1656" Body="&lt;p&gt;I am looking to create some code that will out-of-sample forecast the HAR-RV model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The model itself is formulated as the following, and the betas are estimated through HAC-OLS or Newey-West. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/uUDsJ.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where weekly and monthly are 5 and 22 daily averages of the daily RV, but if you're interested read more about it &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=626064&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I have all the data and parameters ready in pandas dataframes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I now wish to forecast on moving windows so that I can obtain a time series that will show me how the entire period would have been predicted on a weekly basis. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my problem is now that I dont really know how to write something like that. I dont really know how I should interpret the forecasting of this model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have seen very intuitive models for forecasting GARCH, but I am having a hard time coming up with the proper equation for forecasting HARRV, and so forth trouble programming it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what I have accomplished.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Model = smf.ols(formula='RVFCAST ~ RV1 + RV5 + RV22', data = df).fit(use_correction=True)&#xA;mdl = Model.get_robustcov_results(cov_type='HAC', maxlags=1, use_correction=True)&#xA;#print(mdl.summary());&#xA;#print(pd.stats.ols.OLS(y=df['RVFCAST'], x=df[['RV1', 'RV5', 'RV22']], nw_lags=1))&#xA;&#xA;actual = pd.DataFrame(0.0005 + 0.272 * df.RV1 + -0.0486 * df.RV5 + 0.7061 * df.RV22)&#xA;&#xA;pred = pd.DataFrame(mdl.predict())&#xA;&#xA;rw = pd.rolling_window(pred, window = 5, win_type = 'blackman')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you see I used the &lt;code&gt;rolling_window&lt;/code&gt; function which I believe applies a rolling window analysis, and the data/function applied is the &quot;pred&quot; which, as you can see, is a OLS prediction from my previous HAC-OLS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But all in all, I have no idea if what I have done is correct at all, if the rolling_window function does what I want it to do, so my question is whether or not this is correct or just gobbledygook. &lt;/p&gt;&#xA;" OwnerUserId="16137" LastEditorUserId="16137" LastEditDate="2015-05-08T07:52:41.867" LastActivityDate="2015-09-06T17:59:10.293" Title="Moving window forecasting in Python" Tags="&lt;volatility&gt;&lt;regression&gt;&lt;forecasting&gt;&lt;python&gt;&lt;kalman&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17671" PostTypeId="2" ParentId="17666" CreationDate="2015-05-05T17:37:33.623" Score="1" Body="&lt;p&gt;As per your comments, this is the Kunita Watanabe decomposition. See the post at &lt;a href=&quot;https://math.stackexchange.com/questions/413103/kunita-watanabe-decomposition&quot;&gt;https://math.stackexchange.com/questions/413103/kunita-watanabe-decomposition&lt;/a&gt; and the presentation &lt;a href=&quot;http://www.eurandom.nl/events/workshops/2011/ISI_MRM/Presentation/Vanmaele.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.eurandom.nl/events/workshops/2011/ISI_MRM/Presentation/Vanmaele.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2015-05-05T17:37:33.623" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17673" PostTypeId="2" ParentId="17665" CreationDate="2015-05-06T00:12:05.070" Score="2" Body="&lt;p&gt;The portfolio is self-financing. You simply forgot a term in $b$ and a $-t$ term in $V$: &#xA;\begin{eqnarray}&#xA; V_t &amp;amp;=&amp;amp; a_t S_t + b_t \beta_t = (2B_t ) (10+ B_t) + (- t - B_t^2 - 20B_t)1 \\&#xA;&amp;amp;=&amp;amp; 20B_t + 2B_t^2 - t - B_t^2 - 20B_t \\&#xA;&amp;amp;=&amp;amp; B_t^2 - t &#xA;\end{eqnarray}&#xA;Applying Ito's lemma&#xA;\begin{eqnarray}&#xA; dV_t &amp;amp;=&amp;amp; (2B_t dB_t + \frac{1}{2}2d\langle B,B\rangle_t) - dt \\&#xA;&amp;amp;=&amp;amp; 2B_t dB_t  \\&#xA;&amp;amp;=&amp;amp; a_t dS_t + b_t d\beta_t&#xA;\end{eqnarray}&#xA;Since $dS_t = dB_t$ and $d\beta_t = 0$, we have&#xA;\begin{eqnarray}&#xA;dV_t &amp;amp;=&amp;amp; a_t dS_t + b_t d\beta_t&#xA;\end{eqnarray}&#xA;which is a characterization of a self-financing portfolio.&lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2015-05-06T00:12:05.070" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17675" PostTypeId="2" ParentId="17663" CreationDate="2015-05-06T01:32:37.313" Score="1" Body="&lt;p&gt;I don't know of any libraries for this.  There is a pretty good literature on the problem you mention though.  I suggest &lt;a href=&quot;https://cs.uwaterloo.ca/~paforsyt/numuncert.pdf&quot; rel=&quot;nofollow&quot;&gt;https://cs.uwaterloo.ca/~paforsyt/numuncert.pdf&lt;/a&gt; as a good paper to follow; they study numerical techniques, document pitfalls, and even prove something about convergence of their preferred approach.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2015-05-06T01:32:37.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17676" PostTypeId="1" CreationDate="2015-05-06T02:45:03.383" Score="4" ViewCount="663" Body="&lt;p&gt;Is there any basic materials (books, papers) to read on Statistical Arbitrage? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I certainly understand much of the useful information is in the industry. I just want to get some understanding on the basic mathematical tools and their applications in finance. &lt;/p&gt;&#xA;" OwnerUserId="2576" LastEditorUserId="11678" LastEditDate="2015-05-06T18:21:33.630" LastActivityDate="2015-05-11T16:23:58.560" Title="References on Statistical Arbitrages" Tags="&lt;statistics&gt;&lt;arbitrage&gt;&lt;pairs-trading&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17677" PostTypeId="1" CreationDate="2015-05-06T06:39:50.963" Score="3" ViewCount="752" Body="&lt;p&gt;I was thinking about how to figure aut duration for portfolio of bonds denominated in different currencies… I would like to compare sensitivity of portfolio to shift of yield with competitive portfolios, which have only EUR denominated bonds and the only indicator I know is modified duration of portfolios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The duration of bond portfolio is equal to the weighted average of bond durations. Modified duration does measure the sensitivity of changes in bond price to changes in yield. But, if I counted modified duration (MD) of the portfolio as a weighted average of bond MD aside from denominated currency of bonds, I'd get measure for sensitivity of portfolio to parallel shift of all yield curves (in all currencies) at the same time, by &lt;strong&gt;assuming that curves are perfectly correlated&lt;/strong&gt;. &lt;strong&gt;But they are not&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, &lt;strong&gt;&lt;em&gt;I would like to measure sensitivity of multi-currency bond portfolio to changes in EUR yield&lt;/em&gt;&lt;/strong&gt;. &#xA;I have modified duration of bond in denominated currency (for example USD), let’s name it Modified duration (USD). &#xA;We can say, that Bond Price Change (in %) is approximately –Modified Duration x Yield Change&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, for that bond (bond in USD):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bond Price Change (in %) is approximately –Modified Duration(USD) x Yield Change(USD)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First idea was that if I had correlation, or Beta from regression, where dependent variable would be yield (USD) and independent variable would be yield (EUR), I could write:&#xA;Bond Price Change (in %) is approximately –Modified Duration(USD) x Beta x Yield Change(EUR) *&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;But can I? Or is there any other way how to do it correctly?&lt;/strong&gt; Thank you very much for your comments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note*: &#xA;If Modified duration (USD) of USD bond was 5.2, I would seek dependence of 5-year USD swap rate from 5-year euro swap rate ...&lt;/p&gt;&#xA;" OwnerUserId="16144" LastEditorUserId="16144" LastEditDate="2015-05-07T07:57:51.593" LastActivityDate="2015-05-07T07:57:51.593" Title="Modified duration in multi-currency portfolio" Tags="&lt;fixed-income&gt;&lt;risk-management&gt;&lt;duration&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17678" PostTypeId="2" ParentId="17669" CreationDate="2015-05-06T09:31:39.247" Score="9" Body="&lt;p&gt;it's a model-free result. The conditions are $d\leq 0, r\geq 0.$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The proof is that for a european&#xA;$$&#xA;C_t &amp;gt; S_t - Ke^{-r(T-t)} \geq S_T - K&#xA;$$&#xA;and the American is worth at least as much so you never early exercise. &#xA;So it's worth the same as European.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To prove the inequality, observe if $B_T =1,$ take $K$ units of $B_t$ and one of $C_t$ to get something worth&#xA;$$&#xA;\max(S_T,K) \geq S_T&#xA;$$&#xA;at time $T$. So you must have &#xA;$$&#xA;C_t + K B_t &amp;gt; S_t&#xA;$$&#xA;before.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(you need to get my book &quot;Concepts&quot; in your library!)&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-05-06T09:31:39.247" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17679" PostTypeId="2" ParentId="17669" CreationDate="2015-05-06T10:22:57.620" Score="7" Body="&lt;p&gt;It can also be proved by Jenson's inequality.  It can only be optimal to exercise the American option if the option is below its intrinsic value; but since the &quot;max&quot; function is convex, the European price satisfies the following inequality: $$c(S_t, t)=e^{-rT}\mathbb{E}[(S_T-K)^+]&amp;gt;=e^{-rT}\left(\mathbb{E}[S_T]-\mathbb{E}[K]\right)^+=S_t-Ke^{-rT} $$&#xA;The expectations are taken with respect to the filtration generated by $S_t$ and are in the risk-neutral measure. The rest of the proof follows Joshi's answer.  &lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2015-05-06T10:22:57.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17680" PostTypeId="2" ParentId="17617" CreationDate="2015-05-06T10:41:01.203" Score="5" Body="&lt;p&gt;I cannot suggest some reference particularly, since the field is going to develop day by day, but, generally, you could take a look to:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Engelmann, Bernd, and Robert Rauhmeier, eds. The Basel II risk&#xA;  parameters: estimation, validation, and stress testing. Springer&#xA;  Science &amp;amp; Business Media, 2006.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Particularly, look at the chapter 4 and 5; the chapter 4 shows how to compute the PD using the &lt;em&gt;shadow rating&lt;/em&gt; approach, while, the 5 one shows you how to apply the PD estimation models to the LD portfolios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you probably noted looking at the book, it is not updated to Basel III regulation; this is due to the fact it is not so recent (2006 edition), but the credit risk models described are explained really well and the same to ones used currently. If you're interested in the Basel regulations updates I suggest you to read:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Sironi, Andrea, and Andrea Resti. Risk management and shareholders'&#xA;  value in banking: from risk measurement models to capital allocation&#xA;  policies. Vol. 417. John Wiley &amp;amp; Sons, 2007.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Again, it is not updated to the current regulation, but it is better (and more updated) than the other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, I can suggest you some approaches used by practitioners other than those books. Those are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Shadow Rating Approach&lt;/strong&gt;: it is typically employed when default events have to be considered rare events and the external ratings (provided by the main rating agencies) data are available for the most of the portfolio; using this approach, the external rating grades have to be calibrated such that, for instance, the PD is attached to them and the external grades can be mapped to the model scale.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Market-based approach&lt;/strong&gt;: it is based on CDS securities, bonds or stock quotes relative to the sovereign or corporate issuer and is more documented than the first approach (look at google scholar results), but, less used too, because of 2 main drawbacks: larger volatility in the PD measurement and few information about corporate issuer (you can compute a PD only for the public company).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The particular references about this field depends on what you have to do, for what kind of issuer, on the data suitability and availability.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As regards the LGD estimation model, there does not exist a complete reference to suggest you; the only one model I know is the &lt;strong&gt;Balance Sheet Valuation&lt;/strong&gt; (similar to the &lt;em&gt;Fitch Ratings&lt;/em&gt; one), but is proprietary. Anyway, in the first reference you could find some information about LGD models in chapters 8 and 9.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-05-06T10:41:01.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17681" PostTypeId="1" CreationDate="2015-05-06T12:25:16.217" Score="1" ViewCount="123" Body="&lt;p&gt;By looking at the following &lt;a href=&quot;https://quant.stackexchange.com/questions/14259/correlation-between-sp500-returns-and-10y-us-treasuries-yields&quot;&gt;charts &lt;/a&gt;, i wondered about how to plot a fixed income security against a risk free bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the bond price time series but I am not sure what US T-Bill rate I should use as a benchmark for my plot. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My horizon would be 2-3 days so I don't want to hold the bond forever.&lt;/p&gt;&#xA;" OwnerUserId="16145" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2018-01-20T00:34:16.353" Title="Bond in relation to US T-Bill/Risk-Free rate" Tags="&lt;fixed-income&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17682" PostTypeId="2" ParentId="17681" CreationDate="2015-05-06T12:50:35.937" Score="1" Body="&lt;p&gt;There does not exist a rule to choose properly the risk-free rate, but, usually, one chooses the 1-month T-Bill or the 3-month T-Bill in the academic literature; often, it used the overnight interest rate too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suggest you to choose the 1st one, because, according to me, it  mirrors better the concept of risk-free, since it is more liquid and with less perceived risk than the 3-mont one. Moreover, a fixed- income security is perceived as riskier as longer is the maturity, so, reasonably, you should use the 1-Month T-Bill rate as risk free rate.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-07-05T22:44:36.017" LastActivityDate="2015-07-05T22:44:36.017" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17683" PostTypeId="1" AcceptedAnswerId="17684" CreationDate="2015-05-06T13:13:02.387" Score="2" ViewCount="107" Body="&lt;p&gt;I encounter a problem to understand this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The price of a forward option is :&#xA;$C(K,t,T)=\mathbb{E}[((S_{T}/S_{t})-K)+]$ &lt;strong&gt;OK&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The option should only depend on $T-t$ because the yield randomness (for a week) in 2 years should be the same as the yield randomness (for a week) in 3 years and that will be the same as the yield randomness (for a week) today if no known events are expected &lt;strong&gt;WHY ?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then taking $X_{t}=ln(S_{t}/S_{0})$ we should have:&#xA;for all $u$ and for all $a$, $X_{u+a}-X_{u}=X_{a}$ (equality in distribution) &lt;strong&gt;WHY ?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="15738" LastActivityDate="2015-05-06T14:03:10.133" Title="forward option, stochastic calculus" Tags="&lt;stochastic-calculus&gt;&lt;forward&gt;&lt;stochastic&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17684" PostTypeId="2" ParentId="17683" CreationDate="2015-05-06T13:34:59.367" Score="3" Body="&lt;p&gt;For the last question. We assume that &#xA;\begin{align*}&#xA;S_t = S_0 e^{(r-q-\frac{1}{2}\sigma^2)t + \sigma W_t},&#xA;\end{align*}&#xA;where $W$ is a standard Brownian motion, $r$ is the interest rate, $q$ is the dividend yield, and $\sigma$ is the volatility.&#xA;Then,&#xA;\begin{align*}&#xA;X_{u+a}-X_a &amp;amp;= (r-q-\frac{1}{2}\sigma^2)a + \sigma(W_{u+a}-W_u)\\&#xA;&amp;amp;\sim (r-q-\frac{1}{2}\sigma^2)a + \sigma W_a\\&#xA;&amp;amp;= X_a.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the forward start option, note that&#xA;\begin{align*}&#xA;S_T/S_t &amp;amp;= e^{(r-q-\frac{1}{2}\sigma^2)(T-t) + \sigma (W_T- W_t)}\\&#xA;&amp;amp;= e^{(r-q-\frac{1}{2}\sigma^2)(T-t) + \sigma \sqrt{T-t}\xi},&#xA;\end{align*}&#xA;where $\xi$ is a standard normal random variable. Then&#xA;\begin{align*}&#xA;C(K, t, T) &amp;amp;= e^{-rT} \mathbb{E}\big(S_T/S_t -K)^+ \big)\\&#xA;&amp;amp;= e^{-rT}\big[N(d_1) - KN(d_2) \big],&#xA;\end{align*}&#xA;where  $N$ is the cumulative distribution function of a standard normal random variable, &#xA;\begin{align*}&#xA;d_{1} = \frac{\ln (1/K) + (r-q+ \frac{1}{2}\sigma^2 )(T-t)}{\sigma \sqrt{T-t}},&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;d_{2} = \frac{\ln (1/K) + (r-q- \frac{1}{2}\sigma^2 )(T-t)}{\sigma \sqrt{T-t}}.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-05-06T14:03:10.133" LastActivityDate="2015-05-06T14:03:10.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17685" PostTypeId="2" ParentId="17367" CreationDate="2015-05-06T14:54:16.410" Score="3" Body="&lt;p&gt;Let's consider the following example: the process is initialized randomly with $\pm1$ and then stays there forever. Seems stationary to me, but it would never cross its mean.&lt;/p&gt;&#xA;" OwnerUserId="464" LastActivityDate="2015-05-06T14:54:16.410" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17686" PostTypeId="1" AcceptedAnswerId="17688" CreationDate="2015-05-06T15:05:58.330" Score="2" ViewCount="140" Body="&lt;p&gt;Central banks publish official figures for domestic interest rates, as well as spot currency rates for a few select countries (largest trading partners).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To prevent arbitrage, I &quot;expect&quot; that in the absence of any intraday shocks to the system, the central banks figures will (and the possibility of arbitrage), should keep intraday prices &quot;in check&quot; - that is within reason.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not trade forex actively myself, so I do not know if this inference from the fundamentals (pun unintended), is borne out in practise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question therefore is this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;In lieu of actual EOD data for forex market data, is it practical (i.e. sensible), to use bank official rates as a proxy for actual EOD spot currency rates?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This would obviously be flawed for intraday trading, but for lower frequency trading, I imagine that the series (official rates and market spot values), will be highly cointegrated - and therefore, the former can act as a proxy for the latter - am I correct?&lt;/p&gt;&#xA;" OwnerUserId="1733" LastActivityDate="2015-05-06T15:27:36.140" Title="Relationshiop between central bank official currency rates and spot forex" Tags="&lt;quant-trading-strategies&gt;&lt;market-data&gt;&lt;fx&gt;&lt;currency&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17687" PostTypeId="1" CreationDate="2015-05-06T15:23:37.263" Score="5" ViewCount="297" Body="&lt;p&gt;I am looking for a comprehensive list of regime switching/change point models/techniques which can be used to model different regimes / change points in financial time series. What I found so far are:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Regime Switching:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Hidden Markovian Regime Switching (HMRS)&lt;/li&gt;&#xA;&lt;li&gt;Interactive Hidden Markovian Regime Switching (IHMRS)&lt;/li&gt;&#xA;&lt;li&gt;Self Exciting Threshold Autoregressive (SETAR)&lt;/li&gt;&#xA;&lt;li&gt;....&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Change Point Analysis:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Bayesian Change Point Detection&lt;/li&gt;&#xA;&lt;li&gt;Extreme Change Point Detection&lt;/li&gt;&#xA;&lt;li&gt;...&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;What other techniques are out there?&lt;/p&gt;&#xA;&lt;p&gt;PS: I will try to keep the question updated so that it turns into a wiki entry.&lt;/p&gt;&#xA;" OwnerUserId="15823" LastEditorUserId="41390" LastEditDate="2020-11-12T00:30:57.727" LastActivityDate="2020-11-12T13:03:47.730" Title="Comprehensive List of Regime Switching/Change-Point Detection Models" Tags="&lt;statistics&gt;&lt;reference-request&gt;&lt;econometrics&gt;&lt;market-regimes&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="17688" PostTypeId="2" ParentId="17686" CreationDate="2015-05-06T15:27:36.140" Score="3" Body="&lt;p&gt;Yes, you can use e.g. the ECB daily official foreign exchange rate data as a reliable and consistent daily timeseries.  ECB does a fixing at 14:15 CET, by some methodology they call a &quot;daily concertation procedure&quot;.  I don't easily find a description of the details (are they considering only traded prices, or bids and offers?  How long of a time window around 14:15 may used?  etc.)  But for purposes of daily vol, correlation, etc. such details won't matter.  It is a consistent dataset with a consistent methodology giving daily market exchange rates.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2015-05-06T15:27:36.140" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17689" PostTypeId="1" CreationDate="2015-05-06T16:34:19.683" Score="4" ViewCount="451" Body="&lt;p&gt;Are there any empirically-proven methods/formulas for weighting IV surfaces, pricing a discount/premium in an option, and/or adjusting any of the 1st- or 2nd-order Greeks for the magnitude (volume or dollar-volume basis traded) of activity in each option contract for a market?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The various debates that can be found amongst traders, quants and others regarding how to model volatility surfaces and price an option appear undecided...at the very least, the several methods for pricing an option not only assume some modest-to-minimal skew in the returns of an underlying market price, and each option seems to be priced 'in a bubble' i.e. not accounting for the activity in other strikes/expirations. These may be consistent with an oversimplified volatility smile, and the No-arbitrage Theory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;I'm approaching this line of inquiry and discussion from a hobbyist, amateur perspective&lt;/em&gt;, so my apology in advance if the basis explained below for the question is out of sorts...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for a sound method to account for implied sentiment due to the quantity/distribution/moneyness/etc of option contracts traded across the strike range for the nearest several expirations along the forward curve, and model the aggregate impact of this activity for its underlying instrument (e.g. weekly and monthly options on AAPL, monthly options on natural gas futures, etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few papers are available online which discuss the notions of accounting for option open interest distributions for equities as an implied leading indicator as expiration approaches:&#xA;&lt;a href=&quot;http://www.mcgill.ca/files/desautels/OpIntOct04.pdf&quot; rel=&quot;nofollow&quot;&gt;Trading on the Information Content of Open Interest - McGill University&lt;/a&gt;&#xA;and also &quot;The Dynamic Relationship between Volatility, Volume and Open Interest in CSI 300 Futures Market&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, a more direct pricing approach which focuses less on the comprehensive distribution on the activity, and moreso on the specific contract at hand by a discrete method is discussed in this paper:&#xA;&lt;a href=&quot;http://www.haas.berkeley.edu/groups/finance/DBOP.pdf&quot; rel=&quot;nofollow&quot;&gt;Demand-Based Option Pricing&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that a closed-form solution cannot be found, and defining some method as 'correct' is partially a matter of probability and confidence intervals for such conclusions...appropriateness of a solution/model is largely a function of what market 'type' is declared. Like Emanuel Derman wrote:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;“Years ago, when I first became aware of the smile, we hoped to find the 'right' model, and when I met people from other trading firms I used to ask them which model they thought was correct. But now there is such a profusion of models that I have begun to ask more practical questions...&lt;em&gt;There isn’t a uniformly good model&lt;/em&gt;. Since Black-Scholes is the market’s language for quoting options prices, local volatility is a natural way to quote forward volatility in terms of the values of portfolios of options spreads, just as forward rates are a natural way to think about the future interest rates. &lt;em&gt;Which model is right depends on your market&lt;/em&gt;.”&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any commentary on first steps to approach these aspects of modeling market more precisely, as a whole?&lt;/p&gt;&#xA;" OwnerUserId="16147" LastActivityDate="2015-05-06T16:34:19.683" Title="Modeling market sentiment and pricing options by volume, open interest" Tags="&lt;options&gt;&lt;market-model&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17690" PostTypeId="1" CreationDate="2015-05-06T17:03:54.150" Score="3" ViewCount="417" Body="&lt;p&gt;I'm trying to understand the following transformation leading to Delta&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{dC}{dx} = e^{-r\tau} \mathbb{E}[ \frac{\partial}{\partial x}\text{max}(xY-K,0)] = e^{-r\tau} \mathbb{E}[Y \textbf{1}(xY&amp;gt;K)] = e^{-\frac{\sigma^2}{2}\tau}\mathbb{E}[e^{-\sigma\sqrt{\tau}Z} \textbf{1}(Z&amp;gt;-d_2)] = \Phi(d_1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get the first part, but I don't understand the last transformation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Y = e^{(r-\frac{\sigma^2}{2})\tau + \sigma \sqrt{\tau}Z}$, Z is Normal(0,1)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;x - current stock price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taken from: &lt;a href=&quot;http://www.gold-saucer.org/math/diff-int/diff-int.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.gold-saucer.org/math/diff-int/diff-int.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16107" LastEditorUserId="11678" LastEditDate="2015-05-06T18:09:16.437" LastActivityDate="2015-05-07T13:14:03.663" Title="Delta derivation from the expectation" Tags="&lt;black-scholes&gt;&lt;derivatives&gt;&lt;expected-return&gt;&lt;derivation&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17691" PostTypeId="2" ParentId="17690" CreationDate="2015-05-06T17:34:34.213" Score="4" Body="&lt;p&gt;Since $Y=e^{(r-\frac{\sigma^2}{2})\tau + \sigma \sqrt{\tau}Z}$, then &#xA;\begin{align*}&#xA;xY &amp;gt; K \Leftrightarrow Z &amp;gt; -d_2,&#xA;\end{align*}&#xA;where&#xA;\begin{align*}&#xA;d_2 = \frac{\ln \frac{x}{K} + (r-\frac{\sigma^2}{2})\tau}{\sigma\sqrt{\tau}}.&#xA;\end{align*}&#xA;Consequently,&#xA;\begin{align*}&#xA;e^{-r\tau}\mathbb{E}\big(Y \mathbb{1}_{\{xY &amp;gt;K\}} \big) &amp;amp;=&#xA;e^{-\frac{\sigma^2}{2}\tau}\mathbb{E}\big[e^{-\sigma\sqrt{\tau}Z}\mathbb{1}_{\{Z &amp;gt; -d_2\}} \big] \\&#xA;&amp;amp;= e^{-\frac{\sigma^2}{2}\tau}\mathbb{E}\big[e^{\sigma\sqrt{\tau}Z}\mathbb{1}_{\{Z &amp;lt; d_2\}} \big]\\&#xA;&amp;amp;= \int_{-\infty}^{d_2} e^{-\frac{\sigma^2}{2}\tau + \sigma\sqrt{\tau} x} \frac{1}{\sqrt{2\pi}}e^{-\frac{x^2}{2}}dx\\&#xA;&amp;amp;=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{d_2} e^{-\frac{\sigma^2}{2}\tau + \sigma\sqrt{\tau} x -\frac{x^2}{2}}dx\\&#xA;&amp;amp;= \frac{1}{\sqrt{2\pi}}\int_{-\infty}^{d_2 + \sigma\sqrt{\tau}}e^{-\frac{x^2}{2}}dx\\&#xA;&amp;amp;= \Phi(d_1),&#xA;\end{align*}&#xA;where $d_1 = d_2 + \sigma\sqrt{\tau}$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-05-07T13:14:03.663" LastActivityDate="2015-05-07T13:14:03.663" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17692" PostTypeId="2" ParentId="17676" CreationDate="2015-05-06T19:59:19.127" Score="1" Body="&lt;p&gt;Start with &lt;a href=&quot;http://en.wikipedia.org/wiki/Statistical_arbitrage&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Statistical_arbitrage&lt;/a&gt; and the references therein. Especially Avellaneda (technical) and Bookstaber (historical, how Bamberger and Thorp got the whole thing started).&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2015-05-06T20:05:53.387" LastActivityDate="2015-05-06T20:05:53.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17693" PostTypeId="1" CreationDate="2015-05-06T22:01:46.967" Score="1" ViewCount="283" Body="&lt;p&gt;I am trying to derive Gamma from the expectation principle (differentiating under expectation sign). I understand these steps&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{d^2 C}{d x^2} = e^{-r\tau} \mathbb{E} [ \frac{\partial}{\partial x}Y 1_{[xY&amp;gt;K]}] = e^{-r\tau} \mathbb{E} [ Y \delta(x-K/Y)] = e^{-r\tau} \mathbb{E} [ K/U \delta(x-U)]$= $Ke^{-r\tau} \mathbb{E} [\frac{\delta(x-U)}{U}]$, where $U=K/Y$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but the last transformations to $Ke^{-r\tau} \int^{\infty}_0 \frac{\delta(x-u)}{u}\frac{\text{exp}(-\frac{1}{2} d_2(u)^2)}{u\sqrt{2\pi}\sigma \sqrt{\tau}}du=\frac{Ke^{-r\tau}}{x^2}\Phi'(d_2(x))=\frac{\Phi(d_1)}{x\sigma \sqrt{\tau}}$ are very confusing for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is illustrated in &lt;a href=&quot;http://www.gold-saucer.org/math/diff-int/diff-int.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.gold-saucer.org/math/diff-int/diff-int.pdf&lt;/a&gt; at page 11.&lt;/p&gt;&#xA;" OwnerUserId="16107" LastActivityDate="2015-08-05T21:33:46.713" Title="Gamma derivation from the expectation" Tags="&lt;black-scholes&gt;&lt;derivatives&gt;&lt;greeks&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17694" PostTypeId="2" ParentId="17242" CreationDate="2015-05-07T04:01:50.683" Score="1" Body="&lt;p&gt;If you know the stock will finish above the strike, then the call option becomes a forward contract since it will always be exercised. We therefore price it as a forward. Its value at maturity is &#xA;$$S_T - 60.$$&#xA;We can synthesize $S_T$ with one unit of stock costing $70.$ We can synthesize $60$ with $60$ ZC bonds which costs $60/1.055$ since the yield is $5.5\%.$&#xA;So the value is &#xA;$$&#xA;70 - 60/1.055.&#xA;$$ &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-05-07T04:01:50.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17695" PostTypeId="2" ParentId="16693" CreationDate="2015-05-07T06:33:45.377" Score="2" Body="&lt;p&gt;You shall distinguish between the random variables and their distributions. That is, when we talk about Brownian motion, we often define it in terms of finite-dimensional distributions (that is, conditional distribution is normal with the current value as the mean and the variance of $1$). By Kolmogorov's Extension Theorem (KET), there exists a unique distribution with such finite-dimensional distributions. Now, this distribution by itself does not tell you whether the resulting process is continuous or not, because you need to specify on which space this distribution is constructed. KET only guarantees that you can construct this distribution on a boring space $\Bbb R^{[0,\infty)}$, boring due to the fact that its $\sigma$-algebra does not contain &quot;continuous-time&quot; events. However, by Kolmogorov's Continuity Theorem, this distribution can also be constructed on a more interesting space $\mathcal C([0,\infty))$ - and this is the classical construction of Brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what does the latter fact mean. It means that a Brownian motion or classical Wiener process is a random variable $B:\Omega\to\mathcal C([0,\infty))$, which trivially implies that $B(\omega)\in\mathcal C([0,\infty))$ for &lt;em&gt;every&lt;/em&gt; $\omega$, that is &lt;em&gt;every&lt;/em&gt; realization of classically constructed Brownian motion is continuous.&lt;/p&gt;&#xA;" OwnerUserId="464" LastActivityDate="2015-05-07T06:33:45.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17698" PostTypeId="2" ParentId="15491" CreationDate="2015-05-07T12:15:32.490" Score="3" Body="&lt;p&gt;To a FX trader, &quot;considerably out-of-the-money&quot; &lt;strong&gt;means&lt;/strong&gt; &quot;low delta&quot; and &quot;close to at-the-money&quot; &lt;strong&gt;means&lt;/strong&gt; &quot;close to 50% delta.&quot;  That is, moneyness is measured in terms of delta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A useful way to understand this is that delta measures the probability of finishing in the money[1].  A 10% delta option has 10% chance of finishing in the money; a 50% delta option has 50% chance of finishing in the money.  But over larger maturities, larger spot moves are likely so a 10% delta option at long maturity has strike much farther from the forward than a 10% delta option at short maturity.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;[1]Mathematically, the simple delta is a discount factor times the foreign-numeraire risk-neutral probability of finishing in the money.  Psychologically, just think of it as probability.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2015-05-07T12:15:32.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17699" PostTypeId="1" AcceptedAnswerId="17700" CreationDate="2015-05-07T13:47:38.200" Score="2" ViewCount="61" Body="&lt;p&gt;I encounter the following problem :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the equality in distribution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for all $\lambda &amp;gt;0, ((1/\lambda)*\int_{0}^{\lambda t}\sigma_{u}^{2}du,t\geq0)=(\int_{0}^{t}\sigma_{u}^{2}du,t\geq0)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $(\sigma_{t})$ is a predictable process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I don't understand that when $\lambda-&amp;gt;0$ and when we use the continuity of $(|\sigma_{u}|,u\geq0)$ at 0 then we get:&#xA;$(\int_{0}^{t}\sigma_{u}^{2}du,t\geq0)=(c^{2}t,t\geq0)$ (in distribution)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I try to recognize a derivative  but I don't get it...&#xA;Thank you &#xA;&lt;img src=&quot;https://i.stack.imgur.com/wj2ax.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="15738" LastEditorUserId="15738" LastEditDate="2015-05-07T14:36:44.727" LastActivityDate="2015-05-07T15:10:49.850" Title="equality in distribution" Tags="&lt;stochastic-calculus&gt;&lt;stochastic&gt;" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="17700" PostTypeId="2" ParentId="17699" CreationDate="2015-05-07T15:10:49.850" Score="2" Body="&lt;p&gt;It appears that we need only to observe the following:&#xA;\begin{align*}&#xA;\lim_{\lambda\rightarrow 0}\frac{1}{\lambda}\int_0^{\lambda t}\sigma^2_u du &amp;amp;= \lim_{\lambda\rightarrow 0}\int_0^{ t}\sigma^2_{\lambda u} du\\&#xA;&amp;amp;= \int_0^{ t}\sigma^2_{0} du \\&#xA;&amp;amp;=\sigma^2_{0} t.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-05-07T15:10:49.850" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17701" PostTypeId="2" ParentId="17693" CreationDate="2015-05-07T20:21:47.960" Score="2" Body="&lt;p&gt;The clue was to establish that there are typos in the script. Hence, I should have aimed to prove $\frac{Ke^{-r\tau}}{S^2\sigma\sqrt{\tau}}\Phi'(d_2)=\frac{\Phi'(d_1)}{S\sigma \sqrt{\tau}}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation*}&#xA;\frac{\partial^2 C}{\partial S^2}=Ke^{-r\tau}\mathbb{E}[\frac{\delta(S-U)}{U}] = Ke^{-r\tau} \int^{\infty}_0 \frac{\delta(S-u)}{u}&#xA;\overbrace{\frac{\text{exp}(-\frac{(d_2(u))^2}{2})}{u\sqrt{2\pi}\sigma \sqrt{\tau}}}^{\text{log-normal pdf for U}} du&#xA;\end{equation*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the properties of Dirac delta, we know that&#xA;$$\int^{\infty}_0 \delta(x-u)h(u)du=h(x)$$&#xA;Hence,&#xA;\begin{equation}&#xA;\frac{\partial^2 C}{\partial S^2}= \frac{Ke^{-r\tau}}{S^2\sigma \sqrt{\tau}}\frac{1}{\sqrt{2\pi}}e^{-\frac{(d_2(S))^2}{2}} = \frac{Ke^{-r\tau}}{S^2\sigma \sqrt{\tau}} \Phi'(d_2)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be shown that $\frac{Ke^{-r\tau}}{S^2\sigma\sqrt{\tau}}\Phi'(d_2)=\frac{\Phi'(d_1)}{S\sigma \sqrt{\tau}}$ holds, as&#xA;\begin{align*}&#xA;\Phi'(d_1)=\frac{1}{\sqrt{2\pi}}e^{-\frac{\left(d_1\right)^2}{2}}&amp;amp; =\frac{1}{\sqrt{2\pi}}e^{-\frac{\left(d_2+\sigma\sqrt{\tau}\right)^2}{2}} \\&#xA;&amp;amp;= \text{exp}(-d_2\sigma\sqrt{\tau}-\frac{\sigma^2\tau}{2})\frac{1}{\sqrt{2\pi}}e^{-\frac{\left(d_2 \right)^2}{2}} \\&#xA;&amp;amp;= \frac{K}{S}e^{-r\tau}\Phi'(d_2)&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="16107" LastActivityDate="2015-05-07T20:21:47.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17703" PostTypeId="2" ParentId="17676" CreationDate="2015-05-08T10:12:41.050" Score="0" Body="&lt;p&gt;I suggest you to start reading E. P. Chan's books; here below you can find the references:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Chan, Ernest P. &amp;quot;Quantitative Trading.&amp;quot; New Jersey (2008).&lt;/p&gt;&#xA;&lt;p&gt;Chan, Ernest P. &amp;quot;Algorithmic Trading: Winning Strategies and Their Rationale&amp;quot; New Jersey (2013).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;His books are written down in a readable and simple way, so that a newbie can understand too, and, he provides a lot of practical examples of strategies implementation in Matlab. I think it could be a good beginning for who wants to start studying in this field. Those books contain also an introduction to other forms of investment, as the factor models, other than about statistical arbitrage-based strategies (mean-reversion, momentum,...). IMHO, it is worth to follow his &lt;a href=&quot;http://epchan.blogspot.it/&quot; rel=&quot;nofollow noreferrer&quot;&gt;blog&lt;/a&gt; too, where he discusses his strategies with the blog users'.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2015-05-08T10:12:41.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17704" PostTypeId="1" CreationDate="2015-05-08T13:04:00.580" Score="5" ViewCount="86" Body="&lt;p&gt;I would like to price a floating strike american lookback with a particular feature: I don't want to charge upfront the client, rather I would like to insert a &quot;running fee&quot;, some sort of a dividend. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a European case it is simple: the integral over the life of the running fee must equal the price.&#xA;How to extend it in an American case? References are welcome, even if they don't refer to the lookback. &lt;/p&gt;&#xA;" OwnerUserId="4979" LastActivityDate="2015-05-08T13:04:00.580" Title="How to price lookback american option when its payment is distributed during its life" Tags="&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;american-options&gt;&lt;dividends&gt;&lt;fees&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17705" PostTypeId="1" AcceptedAnswerId="18187" CreationDate="2015-05-08T13:55:14.237" Score="9" ViewCount="1394" Body="&lt;p&gt;I wondered about the existence of a complete list of the anomalies detected in quantitative finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally, a &lt;strong&gt;market anomaly&lt;/strong&gt; or inefficiency is a asset price and/or rate of return distortion on a financial market that actually contradicts the efficient-market hypothesis, as conceived by Fama's (1970) seminal paper.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you provide a list of them by posting the references of the relative books or papers?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Possibly, it would be greatly appreciated that you post the seminal paper reference, as, for instance, Basu (1977) in the case of the &lt;em&gt;size effect&lt;/em&gt; or Thaler (1987) for the &lt;em&gt;January effect&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not care about if they disappeared or not, but, instead, I'm interested to construct a full complete list of them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help or suggestion will be appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: I will update a list every time I find something new or a user post an answer with a new anomaly, in order to maintain the list updated.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-05-08T15:12:23.667" LastActivityDate="2019-04-13T20:00:31.253" Title="What are the main market anomalies/inefficiencies detected in quantitative finance?" Tags="&lt;market-microstructure&gt;&lt;factor-models&gt;&lt;quantitative&gt;&lt;anomalies&gt;&lt;behavioral-finance&gt;" AnswerCount="2" CommentCount="9" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="17706" PostTypeId="5" CreationDate="2015-05-08T15:07:01.553" Score="0" Body="&lt;p&gt;A market anomaly (or market inefficiency) is a price and/or rate of return distortion/bias on a financial market that seems to contradict the efficient-market hypothesis, as conceived by Fama (1970) in his seminal paper.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a lot of market inefficiencies in the financial markets, and particularly, they are of three kinds:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Calendar effects;&lt;/li&gt;&#xA;&lt;li&gt;Structural biases;&lt;/li&gt;&#xA;&lt;li&gt;Behavioural biases;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-05-08T15:16:49.563" LastActivityDate="2015-05-08T15:16:49.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17707" PostTypeId="4" CreationDate="2015-05-08T15:07:01.553" Score="0" Body="A market anomaly (or market inefficiency) is a price and/or rate of return distortion on a financial market that seems to contradict the efficient-market hypothesis, as conceived by Fama (1970) in his seminal paper." OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-05-08T15:16:45.920" LastActivityDate="2015-05-08T15:16:45.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17708" PostTypeId="1" AcceptedAnswerId="17753" CreationDate="2015-05-08T15:10:36.850" Score="1" ViewCount="278" Body="&lt;p&gt;I encounter a problem in the proof below:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;I don't know how to proove the first line in yellow (cf below): it makes me think about the Itô formula a lot&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I don't undertand the deduction (ok $\gamma^{\chi}$ has the constant law of a brownian motion but what does it tell us ?)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/RFDwf.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="15738" LastActivityDate="2015-05-11T19:03:08.977" Title="stochastic calculus - Itô formula?" Tags="&lt;itos-lemma&gt;&lt;stochastic&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17709" PostTypeId="1" CreationDate="2015-05-08T15:27:18.177" Score="2" ViewCount="287" Body="&lt;p&gt;recently I am doing cross sectional regressions, and getting confused about missing returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose we have 100 stocks, then we want to construct a value weighted return (or equal weighted return). But the point is that the weights should be created in t-1 since we shouldn't use information which are not revealed to investors. But firm &quot;A Corp&quot; may have missing return for period t, then it has return record afterwards. Do we simply drop the return of &quot;A Corp&quot; for period t then rebalance our weights for the rest 99 firms? If we do rebalance the weights, it simply implies that investors are using the fact &quot;A Corp&quot; will have missing returns, which should not be revealed to the investors in t-1. If we do not rebalance the weights, then it is equivalent to impose that we have zero return for &quot;A Corp&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do guys you deal with missing returns in this case? Many thanks!!&lt;/p&gt;&#xA;" OwnerUserId="16168" LastActivityDate="2015-07-07T21:44:24.813" Title="How to deal with missing returns when creating value (equal) weighted returns" Tags="&lt;returns&gt;&lt;regression&gt;&lt;portfolio&gt;&lt;fama-french&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17711" PostTypeId="2" ParentId="10746" CreationDate="2015-05-08T17:51:44.987" Score="6" Body="&lt;p&gt;Actuarial science traditionally focuses on &lt;strong&gt;estimation of joint probabilities&lt;/strong&gt; using real data where math finance is on valuation of contracts under an arbitrary distribution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It means the first one deals with methods of &lt;strong&gt;estimation of future distributions&lt;/strong&gt; (the number of accidents of a given kind, the probability of someone with a given profile to have a specific disease, etc) using real data. &#xA;The second one usually tries to answer to the &lt;strong&gt;valuation&lt;/strong&gt; of a given payoff assuming the distribution is known. In the math finance vocabulary, the future of distributions is embedded into a &lt;em&gt;filtration&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note this is a narrow view of math finance, since it can be viewed as far more generic, but keep it simple here. If you read reference books like &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/9810236050&quot; rel=&quot;noreferrer&quot;&gt;Essentials of Stochastic Finance: Facts, Models, Theory by Shiryaev&lt;/a&gt;, you can see it goes further than that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually in insurance the contracts are not that sophisticated, and the difficult task is to &lt;strong&gt;obtain accurate estimations&lt;/strong&gt;. Actuarial science is a collection of methods to build estimations on populations that are commonly useful for insurance contracts. It can be viewed as an applicative field of statistics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When contracts are more sophisticated, of course the usual tools of the subset of math finance we are talking about are needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Math finance does not focus that much on distribution estimation for few reasons: the main one is for financial products signed by investment banks, the risk neutral measure is used (and it is perfectly known). Another is that math finance is about understanding the risk borne by the owner of a position (i.e. a &lt;em&gt;contract&lt;/em&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course a good math finance quant can be useful for an insurance, especially now that &lt;em&gt;capital requirements and solvency rules&lt;/em&gt; push pressure on such firms to understand a risk which components are &lt;strong&gt;market prices&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2015-05-08T17:51:44.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17712" PostTypeId="2" ParentId="17709" CreationDate="2015-05-08T21:36:00.733" Score="2" Body="&lt;p&gt;The simple answer is that when you calculate the value weighted return at time $t$ all you really need is the return during time $t$ and the market-capitalization weight as of $t-1$. You can filter the securities to remove the missing ones (and others that you may remove for other reasons, e.g. too small or price too low), calculate weights based on the filtered data, and then take the weighted average to get the value-weighted return. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It becomes a little more complicated though depending on the reasons why the stocks are missing. If the stock return is missing because the company went bankrupt, then you need to make sure you are properly accounting for that. Another circumstance is when your universe is changing over time. You might need to throw in an additional filter to ensure that you're only considering stocks in the universe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, you might need to make some corrections depending on which value weighted return it is that you're trying to calculate. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2015-05-08T21:36:00.733" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17713" PostTypeId="2" ParentId="10746" CreationDate="2015-05-08T23:58:25.543" Score="3" Body="&lt;p&gt;The classical connection is the &lt;a href=&quot;http://en.m.wikipedia.org/wiki/Esscher_transform&quot; rel=&quot;nofollow&quot;&gt;http://en.m.wikipedia.org/wiki/Esscher_transform&lt;/a&gt; developed for actuaries in 1932 which essentially transforms the objective probability measure into the risk neutral one used in quant finance. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2015-05-08T23:58:25.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17714" PostTypeId="2" ParentId="15195" CreationDate="2015-05-09T10:39:04.997" Score="0" Body="&lt;p&gt;So I have a &quot;+&quot; sign for the second term (not negative)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;dr =r[(θ(t)+ d(lnσ)/dt * lnr + 1/2*σ^2)&lt;em&gt;dt + σ&lt;/em&gt;dW]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I left out the subscript t's.....&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can let V = log r then Apply Ito and solve for A and B... where B = r*σ&lt;/p&gt;&#xA;" OwnerUserId="16176" LastEditorUserId="16176" LastEditDate="2015-05-09T15:50:43.477" LastActivityDate="2015-05-09T15:50:43.477" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17715" PostTypeId="2" ParentId="7430" CreationDate="2015-05-09T11:29:52.267" Score="2" Body="&lt;p&gt;I really like Philip P's work, but frankly I do not believe this paper is his best one. It is understandable you do not catch how to use it: there is no dataset in the paper, and the orders of magnitude of $\sigma dW$ and $\delta_t x$ are so different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My suggestions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;some components are missing, $x$ should be a point process, for instance an Hawkes process. Have a look at &lt;a href=&quot;http://arxiv.org/abs/1412.0217&quot; rel=&quot;nofollow&quot;&gt;Market impacts and the life cycle of investors orders (Bacry, Iuga, Lasnier, L)&lt;/a&gt; if you want to see how to capture market impact on an &lt;strong&gt;informed database&lt;/strong&gt; (i.e. you have 100% of the information on trades: their side, the metaorder they belong to, etc).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;There is a recent paper by Réné Carmona (and Webster): &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2365122&quot; rel=&quot;nofollow&quot;&gt;The Self-Financing Equation in High Frequency Markets&lt;/a&gt;. It is shown how to use raw market data to &lt;strong&gt;write properly the self financing equation&lt;/strong&gt; needed in math finance. It contains Jarrow and Protter viewpoint.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2015-05-09T11:29:52.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17716" PostTypeId="2" ParentId="17670" CreationDate="2015-05-09T16:23:00.923" Score="-1" Body="&lt;p&gt;I can't directly answer your question about coding for HAR-RV models, but before you do anything with rolling windows I suggest you look at the paper &lt;a href=&quot;http://www.cs.ucr.edu/~eamonn/meaningless.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. Essentially the paper claims that &lt;em&gt;clustering&lt;/em&gt; on time series sequences ( i.e. rolling windows ) is useless, so if your HAR-RV model involves clustering in anyway you'll need to think very carefully about how you apply it. &lt;/p&gt;&#xA;" OwnerUserId="252" LastActivityDate="2015-05-09T16:23:00.923" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17717" PostTypeId="1" AcceptedAnswerId="17718" CreationDate="2015-05-09T17:23:13.783" Score="4" ViewCount="2439" Body="&lt;p&gt;Consider the Heston model given by the following set of stochastic differential equations:&#xA;$$\frac{dS_{t}}{S_{t}}=\mu_{t}dt+\sqrt{V_{t}}dW_{t}, S_{0}&amp;gt;0,$$&#xA;$$dV_{t}=\kappa(\theta-V_{t})dt+\xi\sqrt{V_{t}}dZ_{t}, V_{0}=v_{0}&amp;gt;0,$$&#xA;$$d&amp;lt;W,Z&amp;gt;_{t}=\rho dt$$&#xA;where $W_{t}$ and $Z_{t}$ are two brownian motion, $\kappa,\theta,\xi&amp;gt;0, \rho\in(-1,1).$&#xA;I don't understand what impact would $\rho$ have on the shape of volatility smile when it's negative or positive. In addition, How the volatility smile would change if $\xi$ increases? Thank you. &lt;/p&gt;&#xA;" OwnerUserId="16126" LastActivityDate="2015-05-10T08:20:31.020" Title="parameters in Heston model and their impact on volatility smile" Tags="&lt;heston&gt;&lt;volatility-smile&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17718" PostTypeId="2" ParentId="17717" CreationDate="2015-05-09T18:00:28.950" Score="5" Body="&lt;p&gt;Intuition: You can think of the vol smile as a reflection of the risk neutral distribution (compared to the Black Scholes Gaussian density). A fat tailed distribution creates the smile: fat tail -&gt; higher prob of exercise than Gaussian with constant stdev -&gt; higher option price than BS with ATM vol -&gt; higher implied vol for given strike. Skewed distributions cause skewed smile: neg skew -&gt; left tail thicker than right -&gt; OTM put impl vol higher than OTM call impl vol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also you can think of a stoch vol model as mixture of Gaussians, each with different volatility. The way that this mix is produced generates fat tailed and skewed distributions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Non-zero Rho will produce asymmetric volatility smiles (that look more like skews). Negative correlation means that a negative spot shock is more likely accompanied by a positive vol shock -&gt; as spot goes down we mix with higher vols -&gt; will produce a fatter left tail than right -&gt; negatively skewed risk neutral density -&gt; downward sloping skew.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Large Xi produces a steeper, more pronounced smile/skew, as we increase the vol-of-vol potentially mixing with higher volatilities which generate more leptokurtic risk neutral distributions. Zero Xi would correspond to the Black Scholes case where the smile becomes flat. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be more rigorous you can take the Heston char function, take derivatives to compute moments and show the relation of Rho/Xi with Skewness/Kurtosis.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2015-05-10T08:20:31.020" LastActivityDate="2015-05-10T08:20:31.020" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17719" PostTypeId="1" CreationDate="2015-05-10T07:36:04.133" Score="1" ViewCount="378" Body="&lt;p&gt;What is to stop someone from first buying a bunch of OTM puts and then selling short enough stock to make the puts go up high enough to make a profit? Or conversely, buying OTM calls and then buying a bunch of stock?  &lt;/p&gt;&#xA;" OwnerUserId="15081" LastActivityDate="2015-06-09T20:38:13.833" Title="Buying OTM puts and then selling stock" Tags="&lt;options&gt;" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17720" PostTypeId="2" ParentId="17719" CreationDate="2015-05-10T08:51:52.503" Score="0" Body="&lt;p&gt;Is the stock so easy to manipulate? How much does she need to spend to drive the price against her, far enough to pass the strike and make a profit? For a stock that is that thinly traded to be manipulated, is there sufficient liquidity in the options market? What about the hedging positions of the guys that sold options to her?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is also most probably illegal. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2015-05-10T08:51:52.503" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17722" PostTypeId="1" CreationDate="2015-05-10T09:51:15.463" Score="1" ViewCount="52" Body="&lt;p&gt;the cash prices of six months and one year treasury bills are \$120 and \$115 respectively. A 1.5 years bond that will pay coupons of \$5 every six months currently sells for \$121. A 2 years bond that will pay coupons of \$5  every six months currently sells for  \$ 125. Calculate the six months, 1 year,1.5 years and 2 years spot rates.&lt;/p&gt;&#xA;" OwnerUserId="16181" LastEditorUserId="2299" LastEditDate="2015-05-10T10:12:36.577" LastActivityDate="2015-05-10T10:12:36.577" Title="Calculation of bond spot rates" Tags="&lt;interest-rates&gt;" AnswerCount="0" CommentCount="0" ClosedDate="2015-05-10T12:11:24.810" ContentLicense="CC BY-SA 3.0" />
  <row Id="17723" PostTypeId="1" AcceptedAnswerId="17744" CreationDate="2015-05-10T10:03:03.677" Score="3" ViewCount="173" Body="&lt;p&gt;I don't know how to prove this : &lt;/p&gt;&#xA;&#xA;&lt;p&gt;let be $X_t = \int_{0}^{t}\sigma_{u}dW_{u}$ where $\sigma_{t}$ is a predictable process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $|\sigma_{t}| = c$ a.s. how can I prove that $X_{t}=c*\beta_{t}$ (equality in distribution) ? (obvious if there wouldn't be absolute value..)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you &lt;/p&gt;&#xA;" OwnerUserId="15738" LastActivityDate="2015-05-11T12:49:17.337" Title="stochastic calculus - brownian motion" Tags="&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;&lt;stochastic&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17724" PostTypeId="2" ParentId="10731" CreationDate="2015-05-10T11:26:31.220" Score="1" Body="&lt;p&gt;You said that the PX_BID and PX_ASK values are dependent upon when you pulled the data. But if I pull historical data (e.g. for the last month) only the value of today would be changing but not the past ones...&#xA;So there should be a point of time when the final PX_BID and PX_ASK values for a day are calculated. Or am I wrong?&lt;/p&gt;&#xA;" OwnerUserId="16183" LastActivityDate="2015-05-10T11:26:31.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17725" PostTypeId="1" CreationDate="2015-05-10T12:46:15.917" Score="1" ViewCount="117" Body="&lt;p&gt;If I have a term structure/yield curve given by:&#xA;$$f(t, T) = f(0, T) + σ^2t(T − \frac{t}{2}) + σB_t $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and want to find the short/spot rate $r_t$, is this simply:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f(t,t) = f(0,t) + \sigma^2t(t-\frac{t}{2}) + \sigma B_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anything further be done?&lt;/p&gt;&#xA;" OwnerUserId="16184" LastEditorUserId="16184" LastEditDate="2015-05-10T12:56:18.140" LastActivityDate="2015-05-10T12:56:18.140" Title="Term Structure and short rates" Tags="&lt;stochastic-calculus&gt;&lt;yield-curve&gt;&lt;term-structure&gt;&lt;short-rate&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17727" PostTypeId="1" CreationDate="2015-05-10T15:08:16.457" Score="2" ViewCount="157" Body="&lt;p&gt;I have a strategy based only on option instruments and I am trying to measure its performance to optimize some parameters. But how does one measure the performance of such strategies? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Sharpe ratio calculation how do we calculate the return rates? For example, on one day the strategy is to buy and sell some options and its zero cost up front, the strategy made some PnL. What should be the return rate for this period?&lt;/p&gt;&#xA;" OwnerUserId="5861" LastActivityDate="2015-05-13T09:33:10.173" Title="How to measure the performance of an systematic option strategy" Tags="&lt;option-strategies&gt;&lt;performance-evaluation&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17728" PostTypeId="1" AcceptedAnswerId="17759" CreationDate="2015-05-10T16:48:28.780" Score="3" ViewCount="625" Body="&lt;p&gt;Although we thoroughly covered risk-neutral pricing in university I never fully understood it in the context of continuous-time processes.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;But first of all, lets consider a discrete time example:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/wySOc.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here we want to evaluate the call option price $C_0$ with strike $K=100$. If the interest rate (until the option expiry) is $r=2\%$, then we need to solve&#xA;$$\Delta\cdot S_u + \phi\cdot(1+r)=C_u$$&#xA;$$\Delta\cdot S_d + \phi\cdot(1+r)=C_d$$&#xA;for $\Delta,\phi$, which then gives $C_0 = \Delta\cdot S_0 + \phi \approx 10.6952$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here I can see how the real-world probaility $p$ $-$ and ultimately the real-world drift $-$ do not matter per se as we exactly replicate the option with the stock itself and some cash account.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;But on the continuous side, things are not that simple. And I am just not sure why we would always use the risk-free $r$ as drift instead of the real drift $\mu$. For example, say we have 2 stocks that are exactly the same (same current price &amp;amp; volatility) but differ only in terms of their drift parameters $\mu_1,\mu_2$. Then a call option on stock 1 will have exactly the same price as a call option on stock 2 (given that strike and maturity are the same), because both would use $r$ as the &quot;drift&quot; for pricing. But if $\mu_1&amp;gt;\mu_2$ then everybody would want buy the call option on stock 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any advice would be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="6621" LastActivityDate="2015-05-11T22:34:46.870" Title="Intuitive Reasoning for Using Risk-Neutral Measure" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;risk-neutral-measure&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17729" PostTypeId="1" AcceptedAnswerId="17730" CreationDate="2015-05-10T17:57:01.320" Score="2" ViewCount="299" Body="&lt;p&gt;I am stuck in this exercise from my textbook:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Consider a one-period market model with $N+1$ assets: a bond, a stock and $N-1$ call options. The prices of the bond are $B_0=1$ and $B_1 = 1+r$, where $r$ is a constant. The prices of the stock are given by a constant $S_0$ and a random variable $S_1$ taking values in $\{0, 1, \ldots, N-1, N \}$ for a given integer $N \geq 4$. Finally, let the time-0 price of the call option with strike $K \in \{ 1, \ldots, N-1 \}$ be denoted by $C(K)$. Now we introduce a contingent claim with time-1 payout $\xi_1 = g(S_1)$, where $g$ is the function&#xA;  $$g(M) = \mathbf{1}_{ \{M = K_0 \} }, \quad 0 \leq K_0 \leq N.&#xA;$$&#xA;  Assuming that the market has no arbitrage, we want to find the time-0 price $\xi_0$ in the following cases:&#xA;  $$ 2 \leq K_0 \leq N-2 \, ; \quad K_0 = N-1 \, ; \quad K_0 = 0 .$$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Let $Y$ be the state price density of the market such that $Y_0 =1$. We know that &#xA;$$ \mathbb{E} [ YS_1 ] = S_0, \quad \mathbb{E} [ Y ( S_1 - K)^{+} ] = C(K), \text{ for } K \in \{1, \ldots, N-1 \}. $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But how can we compute &#xA;$$\xi_0 = \mathbb{E}[ Y \mathbf{1}_{ \{ S_1 = K_0 \} }] \quad ?$$&lt;/p&gt;&#xA;" OwnerUserId="13654" LastActivityDate="2015-05-10T18:45:23.857" Title="Pricing digital options in discrete time" Tags="&lt;options&gt;&lt;arbitrage&gt;&lt;mathematics&gt;&lt;no-arbitrage-theory&gt;&lt;exotics&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17730" PostTypeId="2" ParentId="17729" CreationDate="2015-05-10T18:31:59.333" Score="2" Body="&lt;p&gt;The claim payoff you describe, $g(M)$, looks to me like a tight butterfly spread that pays off only in one state of the world. Can't you just replicate that by short two calls with strike $K_0$ and long two calls, with strikes one either side at $K_0\pm 1$? Then the price of your option would be $C(K_0+1)+C(K_0-1)-2\cdot C(K_0)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is effectively the Breeden-Litzenberger formula that expresses the risk neutral distribution (here for discrete states). You can see that the price of the butterfly is the finite difference estimate of the second derivative of the call price with respect to the price. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2015-05-10T18:45:23.857" LastActivityDate="2015-05-10T18:45:23.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17732" PostTypeId="1" CreationDate="2015-05-10T19:44:23.617" Score="1" ViewCount="191" Body="&lt;p&gt;A share is currently priced at 640p. A writer of 100,000 units of a one year European&#xA;put option with an exercise price of 630p has delta-hedged the option with a portfolio&#xA;which holds cash and is short 24,830 shares. The continuously compounded risk-free&#xA;rate of interest is 3% p.a. and no dividends are payable during the life of the option.&#xA;The assumptions of the Black-Scholes model apply.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Write down an expression for the delta of the option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Calculate its value in this case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please help me out in this question I am unable to solve it. So far I tried differentiating option pricing formulae of black schole with S, price of share that will give me formulae for delta, right but how can we solve this equation without knowing volatility.This is where i am stuck.&lt;/p&gt;&#xA;" OwnerUserId="16188" LastActivityDate="2015-05-11T09:58:48.460" Title="Black Scholes Model Replicating Strategy Delta Hedged Exam Question" Tags="&lt;options&gt;&lt;pricing&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17733" PostTypeId="1" AcceptedAnswerId="17743" CreationDate="2015-05-10T21:51:57.373" Score="0" ViewCount="151" Body="&lt;p&gt;If I have a forex account with a broker and a balance of 100 USD, and I'd like to &lt;strong&gt;short&lt;/strong&gt; EUR/JPY, how many units can I short?  How is this calculated?  Which currency pair do I use to translate between my account balance in USD and the currencies involved in the EUR/JPY instrument?  Which price (bid or ask) do I use in each part of the calculation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Please assume I'd like to use my entire USD balance and I'm not using leverage.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Through trial and error I can see that I need to enter 89 in the Units field to get a Trade value of (approximately) $100, but I'd like to know how to calculate this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/WrL9K.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="13643" LastEditorUserId="13643" LastEditDate="2015-05-11T00:45:42.390" LastActivityDate="2015-05-11T12:39:39.363" Title="Calculating units in a cross currency short trade" Tags="&lt;fx&gt;&lt;currency&gt;&lt;short-selling&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17734" PostTypeId="2" ParentId="17733" CreationDate="2015-05-10T22:59:24.210" Score="0" Body="&lt;p&gt;The size of your bet should be expressed in dollars as well. Most brokers allow to trade lots of at least $1000 at time, independently of which pair you're trading.&#xA;Anyway I think that you should read your broker guideline in order to understand better what's happening.&lt;/p&gt;&#xA;" OwnerUserId="16045" LastActivityDate="2015-05-10T22:59:24.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17736" PostTypeId="1" CreationDate="2015-05-11T01:20:49.893" Score="4" ViewCount="170" Body="&lt;p&gt;We just learned about cash-matching through dedicated portfolios (using risk free bonds) in my class that concerned mathematical programming. However, in an aside one of the notes said: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It should be noted, however, that dedicated portfolios cost typically from 3% to 7% more in dollars terms than do “immunized” portfolios that are constructed based on matching present value, duration, and convexity of the assets and liabilities. &quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When would dedicated portfolios be better than 'immunized' portfolios, where you would have to manage accordingly? Immunized portfolios are dependent on duration, convexity, and present value of cash flows. The book says, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Portfolios that are constructed by matching these three factors are immunized against parallel shifts in the yield curve, but there may still be a great deal of exposure and vulnerability to other types of shifts, and they need to be actively managed, which can be costly. By contrast, dedicated portfolios do not need to be managed after they are constructed.&quot; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are these other variables? Also, you might have access to more instruments (possibly)? But other than that, I'm not sure when to use dedicated portfolios or just calculate how to immunize the portfolio. Anyone have insight on this?&lt;/p&gt;&#xA;" OwnerUserId="16190" LastActivityDate="2016-01-07T07:27:49.180" Title="When would dedicated portfolios do better than 'immunized' portfolios?" Tags="&lt;optimization&gt;&lt;portfolio&gt;&lt;duration&gt;&lt;convexity&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17737" PostTypeId="2" ParentId="17728" CreationDate="2015-05-11T03:17:20.283" Score="1" Body="&lt;p&gt;You may bet on stock 1 by buying a call option on stock 1, and drive up the option price. But some arbitrageurs will immediately short the option and hedge with stock 1, pocketing the profit. These arbitrages will force the call option back to normal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Discrete or continuous-time, the logic is the same.&lt;/p&gt;&#xA;" OwnerUserId="16192" LastActivityDate="2015-05-11T03:17:20.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17738" PostTypeId="1" CreationDate="2015-05-11T03:20:02.803" Score="4" ViewCount="212" Body="&lt;p&gt;very new to commodities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have raw agriculture future data, and I need to remove the seasonality (de-seasonalize) from the data, what is the general approach ? Thanks for the help!&lt;/p&gt;&#xA;" OwnerUserId="6396" LastActivityDate="2019-02-03T17:33:24.867" Title="remove seasonality in future contracts" Tags="&lt;time-series&gt;&lt;futures&gt;&lt;derivatives&gt;&lt;commodities&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17740" PostTypeId="1" AcceptedAnswerId="17752" CreationDate="2015-05-11T09:39:15.563" Score="1" ViewCount="328" Body="&lt;p&gt;I am not sure to understand exactly the direct use of implied volatility. Let's take an example: if an instrument has a daily volatility of $\sigma$, there is a 68% probability that its value will be between +/- $1+\sigma * \sqrt{\frac{1}{365}} $ of today's price. Is that correct, or am I confusing with the value at risk?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for your help&lt;/p&gt;&#xA;" OwnerUserId="15650" LastActivityDate="2015-05-11T18:45:17.873" Title="Direct use of implied volatility" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;probability&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17742" PostTypeId="2" ParentId="10746" CreationDate="2015-05-11T11:29:53.220" Score="1" Body="&lt;p&gt;Option pricing theory and interest rate theory are used within life insurance mathematics. See for example the articles of Thomas Møller:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Local risk-minimization with survivor bonds (with L. Henriksen).&#xA;To appear in Applied Stochastic Models in Business and Industry, 2014.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On systematic mortality risk and risk-minimization with survivor swaps (with M. Dahl and M. Melchior). &#xA;Scandinavian Actuarial Journal 2008(2-3), 2008, 114-146.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hedging equity-linked life insurance contracts. &#xA;North American Actuarial Journal 5(2), 2001, 79-95.&lt;/p&gt;&#xA;" OwnerUserId="16067" LastActivityDate="2015-05-11T11:29:53.220" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17743" PostTypeId="2" ParentId="17733" CreationDate="2015-05-11T12:39:39.363" Score="1" Body="&lt;p&gt;For spot EURJPY with a USD risk currency, the EUR is expressed in USD using the EURUSD spot rate, say 1.1145 so your 100 USD means you can short 100 / 1.1145 = 89.7 EUR&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you wanted to express the risk currency then you use the equivalent rate usually through the USD. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case you would be buying EUR with your USD to then short EURJPY. So if you're buying EUR (from the buy side) you use the offered rate.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2015-05-11T12:39:39.363" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17744" PostTypeId="2" ParentId="17723" CreationDate="2015-05-11T12:49:17.337" Score="2" Body="&lt;p&gt;Note that $X$ is a continuous martingale. Moreover, the quadratic variation is given by&#xA;\begin{align*}&#xA;\langle X_t, \, X_t\rangle = \int_0^t |\sigma_u|^2 du = c^2 t.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;\langle X_t/c, \, X_t/c\rangle = t.&#xA;\end{align*}&#xA;From Levy's characterization, $X/c$ is by law a Brownian motion, which we denote by $\beta$. Then, by law,&#xA;\begin{align*}&#xA;X_t = c\, \beta_t.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-05-11T12:49:17.337" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17747" PostTypeId="2" ParentId="17740" CreationDate="2015-05-11T14:40:58.833" Score="2" Body="&lt;p&gt;The most common use for implied volatility in valuation is for asseing options or option like postions. A volatile instrument is likley to activate or put an option postion in the money just on the basis of its volatility rather than any fundamental change in the intrinsic or fair market value of the underlying. This needs to be taken into account when pricing an auction contract. Therefore, for many options or option like postions, implied vol. is used as a short hand for the price of the contract. It is useful as it serves as a bit of a standardized price. So if the contract is measured in dollars, pigs, widgets etc. implied vol. can be understood universally&lt;/p&gt;&#xA;" OwnerUserId="16138" LastActivityDate="2015-05-11T14:40:58.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17748" PostTypeId="1" CreationDate="2015-05-11T15:00:36.013" Score="3" ViewCount="702" Body="&lt;p&gt;One thing I can't understand clearly is why there is so much focus on the volatility smile. Given my knowledge of the Black and Scholes model, this is what I get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;People use the volatility smile as a forecast of future volatility. They assume that the market is 100% efficient and everyone would engage in dynamic hedging if they could or that everyone agree that the Black and Scholes model gives the 'fair' price for the option, whatever it means to them. Therefore any difference between the market price and the BS price shouldn't be interpreted as an opportunity for arbitrage or a presence of model risk, but what 'the market' is saying the BS parameters should be, in special the volatility the market is predicting for the future time until the maturity of the European option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there many issues with this interpretation? If not, why not to estimate the volatility directly by using a stochastic model like Heston instead of working with so many layers of complexity and assumptions? Could you indicate good papers trying to assess the accuracy of the implied volatility as a predictor of future volatility?&lt;/p&gt;&#xA;" OwnerUserId="16199" LastActivityDate="2015-05-11T17:14:35.660" Title="Why is the volatility smile important" Tags="&lt;black-scholes&gt;&lt;implied-volatility&gt;&lt;no-arbitrage-theory&gt;&lt;heston&gt;&lt;volatility-smile&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17749" PostTypeId="2" ParentId="17740" CreationDate="2015-05-11T15:39:13.813" Score="1" Body="&lt;p&gt;One reason is that implied volatility measures the relative value of the option as the price of an option depends on various parameters. As everyone has its own pricing model, it's insane to quote all parameters. This little simple IV tells you everything you'd need to know for valuation.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2015-05-11T15:39:13.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17750" PostTypeId="2" ParentId="17676" CreationDate="2015-05-11T16:23:58.560" Score="1" Body="&lt;p&gt;Try the &lt;a href=&quot;https://www.math.nyu.edu/faculty/avellane/AvellanedaLeeStatArb071108.pdf&quot; rel=&quot;nofollow&quot;&gt;Avellaneda (2009)&lt;/a&gt; paper. The strategy involves some mean-reverting models and some PCAs. Easy to read without getting too technical.&lt;/p&gt;&#xA;" OwnerUserId="16192" LastActivityDate="2015-05-11T16:23:58.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17751" PostTypeId="2" ParentId="17748" CreationDate="2015-05-11T17:14:35.660" Score="1" Body="&lt;p&gt;Look at the B-S parameters for the dynamics of the stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{dS}{S} = \mu dt + \sigma dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma$ is independent of strike in the B-S model, which means all derivatives priced assuming these dynamics should have the same volatility. This clearly is not the case given the existence of smile and skew. You can't assume the BS model produces the &quot;fair&quot; price when its assumptions are violated right at the start.&lt;/p&gt;&#xA;" OwnerUserId="16058" LastActivityDate="2015-05-11T17:14:35.660" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17752" PostTypeId="2" ParentId="17740" CreationDate="2015-05-11T18:05:09.360" Score="1" Body="&lt;p&gt;This has been asked many times already. Volatility always refers to a model. And unless stated otherwise this model is the Black-Scholes model. In this model the volatility is the standard deviation of the log-returns divided by the square-root of time:&#xA;$$&#xA;  \log(\frac{S_{t}}{S_0}) =  (r - \frac{1}{2}\sigma^2)t + \sigma W_t \sim \mathcal{N}\left( (r - \frac{1}{2}\sigma^2)t , \sigma^2t \right)&#xA;$$ &#xA;The standard deviation of the log-return is NOT the standard deviation of the spot. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the model is true (it is not) the confidence interval for the log-returns would be &#xA;$$&#xA;  I_\alpha = \left[ (r - \frac{1}{2}\sigma^2)t - q_{1-\alpha/2}\sigma\sqrt{t} ; (r - \frac{1}{2}\sigma^2)t + q_{1-\alpha/2}\sigma\sqrt{t}  \right]&#xA;$$ &#xA;with $q_{1 - 0.68/2} \approx 1$ and $q_{1 - 0.95/2} \approx 2$. So that would imply a confidence interval for the spot $S_t$&#xA;$$&#xA;  J_\alpha = \left[ S_0 e^{(r - \frac{1}{2}\sigma^2)t - q_{1-\alpha/2}\sigma\sqrt{t}} ; S_0e^{(r - \frac{1}{2}\sigma^2)t + q_{1-\alpha/2}\sigma\sqrt{t}}  \right]&#xA;$$ &#xA;In reality, the distribution of returns is not normal: it exhibits skewness and fat tails so your confidence interval would not be symetric and also larger. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a very short period of 1 day, the approximation you gave is probably not too bad if you make sure that $\sigma$ is the annualized volatility not the daily volatility as you said (they differ by a factor $\sqrt{365}$ or $\sqrt{252}$ depending on your daycount convention).&lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2015-05-11T18:45:17.873" LastActivityDate="2015-05-11T18:45:17.873" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17753" PostTypeId="2" ParentId="17708" CreationDate="2015-05-11T18:27:01.670" Score="3" Body="&lt;p&gt;For the first question, since by definition,&#xA;\begin{align*}&#xA;\varepsilon_t^{if} = e^{i \int_0^{t}f\big(\frac{1}{\xi}\langle M\rangle_s\big)\frac{dM_s}{\sqrt{\xi}} + \frac{1}{2}\int_0^t f\big(\frac{1}{\xi}\langle M\rangle_s\big)\frac{d\langle M\rangle_s}{\xi}},&#xA;\end{align*}&#xA;then,&#xA;\begin{align*}&#xA;d\varepsilon_t^{if} = i \varepsilon_t^{if} f\Big(\frac{1}{\xi}\langle M\rangle_t\Big)\frac{dM_t}{\sqrt{\xi}}.&#xA;\end{align*}&#xA;Moreover, &#xA;\begin{align*}&#xA;\langle \varepsilon_t^{if}, H_t \rangle = \int_0^t i \varepsilon_s^{if} f\Big(\frac{1}{\xi}\langle M\rangle_s\Big) h_s \frac{d\langle M\rangle_s}{\sqrt{\xi}},&#xA;\end{align*}&#xA;as $\langle M_t, R_t \rangle = 0$. Consequently,&#xA;\begin{align*}&#xA;d\big(\varepsilon_t^{if} H_t\big) &amp;amp;= H_t d\varepsilon_t^{if} + \varepsilon_t^{if} dH_t + d \langle \varepsilon_t^{if}, H_t \rangle\\&#xA;&amp;amp;= H_t d\varepsilon_t^{if} + \varepsilon_t^{if} dH_t +  i \varepsilon_t^{if} f\Big(\frac{1}{\xi}\langle M\rangle_t\Big) h_t \frac{d\langle M\rangle_t}{\sqrt{\xi}}.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;\mathbb{E}\big(\varepsilon_{\infty}^{if} H_{\infty}\big) -\mathbb{E}(H_0) &amp;amp;=&#xA;\mathbb{E}\bigg(\int_0^{\infty}\!\!\!\! H_t d\varepsilon_t^{if} + \int_0^{\infty} \!\!\!\!\varepsilon_t^{if} dH_t + i\int_0^{\infty}\!\!\!\!\varepsilon_t^{if} f\Big(\frac{1}{\xi}\langle M\rangle_t\Big) h_t \frac{d\langle M\rangle_t}{\sqrt{\xi}} \bigg) \\&#xA;&amp;amp;=i \mathbb{E}\bigg(\int_0^{\infty}\!\!\!\!\varepsilon_t^{if} f\Big(\frac{1}{\xi}\langle M\rangle_t\Big) h_t \frac{d\langle M\rangle_t}{\sqrt{\xi}} \bigg),&#xA;\end{align*}&#xA;or&#xA;\begin{align*}&#xA;\mathbb{E}\big(\varepsilon_{\infty}^{if} H\big) = \mathbb{E}(H)+i \mathbb{E}\bigg(\int_0^{\infty}\!\!\!\!\varepsilon_t^{if} f\Big(\frac{1}{\xi}\langle M\rangle_t\Big) h_t \frac{d\langle M\rangle_t}{\sqrt{\xi}} \bigg).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-05-11T19:03:08.977" LastActivityDate="2015-05-11T19:03:08.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17754" PostTypeId="2" ParentId="17736" CreationDate="2015-05-11T19:52:29.363" Score="0" Body="&lt;p&gt;Take a step back and consider the purpose of immunization: your firm is planning future expenditures, and these are firm commitments.  You need to make sure to have cash on hand when these expenditures occur.  So you buy bonds, which you plan to sell right before your bills are due.  Now you're exposed to interest rate risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have two basic options:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You immunize/fully immunize.  Now you don't have to worry about small/any interest rate changes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You don't immunize.  Now you have to estimate the probability distribution of interest rate changes, and figure out how much to allocate (and in which bonds) to have a portfolio that will meet its goals with some specified probability.  The higher the probability you want, the more you will have to allocate today.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, the other variables are the fund's goals and the probability distribution of interest rate changes.&lt;/p&gt;&#xA;" OwnerUserId="8229" LastActivityDate="2015-05-11T19:52:29.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17755" PostTypeId="1" AcceptedAnswerId="17756" CreationDate="2015-05-11T19:53:00.883" Score="1" ViewCount="56" Body="&lt;p&gt;I was just wondering why in &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1601412&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1601412&lt;/a&gt;&#xA;on page 22, the constraint (48) is a strict equality for the minimum variance formulation. Whereas in a different formulation (but equivalent as proven in the paper) (45) is an inequality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any intuition behind this ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best,&#xA;Jcl&lt;/p&gt;&#xA;" OwnerUserId="15767" LastActivityDate="2015-05-11T22:45:21.687" Title="Portfolio Selection formulation" Tags="&lt;portfolio&gt;&lt;minimum-variance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17756" PostTypeId="2" ParentId="17755" CreationDate="2015-05-11T21:14:30.163" Score="1" Body="&lt;p&gt;That part of the paper is showing why the efficient frontier is the same regardless of whether you are maximizing utility, maximizing returns given variance, or minimizing variance given returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Inequality constraints tend to be a bit more work to deal with analytically, so that might be a reason why they use the equality constraint on one of them. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually you get the same portfolio regardless of whether you use the inequality constraint or the equality constraint. I don't think this paper is really trying to evaluate equality vs. inequality or anything. They're focused more on the general point. The inequality constraint is just telling you that the variance must be less than some amount. The equivalent when minimizing variance given returns would be an inequality constraint such that the return of the portfolio is greater than or equal to some amount. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastEditorUserId="2379" LastEditDate="2015-05-11T22:45:21.687" LastActivityDate="2015-05-11T22:45:21.687" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17758" PostTypeId="2" ParentId="17738" CreationDate="2015-05-11T22:26:53.547" Score="1" Body="&lt;p&gt;My guess is that you may have different seasonalities in the data as per each agricultural commodity characteristics. My guess is that there may be seasonality within the year as per the specific commodity depending if one or more harvestings occur a year. Also due to the specific unceirtanty due to planting, growth season and harvesting times. In addition also longer than a year seasonalities may occur due to long term atmosferic cycles (el niño for example) which may cause spread of plagues, watter shortages or abundances.     &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would take a look into &lt;a href=&quot;http://cran.r-project.org/web/packages/deseasonalize/deseasonalize.pdf&quot; rel=&quot;nofollow&quot;&gt;http://cran.r-project.org/web/packages/deseasonalize/deseasonalize.pdf&lt;/a&gt; for R. &lt;/p&gt;&#xA;" OwnerUserId="7616" LastActivityDate="2015-05-11T22:26:53.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17759" PostTypeId="2" ParentId="17728" CreationDate="2015-05-11T22:34:46.870" Score="10" Body="&lt;p&gt;this is probably the most asked question in quantitative finance... There are many answers. One nice example to consider is what if the calls were struck at zero. &#xA;The call then pays the stock price at time $T$ and so it's value today must the stock price today since we can replicate by holding one unit of stock. This will be true regardless of the drift of the stock. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another point is that put-call parity forces puts and calls to have the same value at the money (actually at the forward.) Drift arguments that send call prices up, send put prices down, but they have to be equal to each other. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(A large part of my book Concepts etc is devoted to this question.)&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-05-11T22:34:46.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17761" PostTypeId="1" CreationDate="2015-05-12T13:43:35.817" Score="0" ViewCount="191" Body="&lt;p&gt;Being net short options is an obvious case of being short volatility. But what other investments are &quot;functionally&quot; short volatility? Is long equities long or short volatility? Is short Apple long or short volatility? Does a yield curve trade have a volatility component? If you are in the carry trade, short one currency to be long another currency to capture interest rate differentials, do you have a defined volatility position?&lt;/p&gt;&#xA;" OwnerUserId="16204" LastActivityDate="2015-05-13T06:05:58.123" Title="Short Volatility" Tags="&lt;volatility&gt;" AnswerCount="2" CommentCount="0" ClosedDate="2015-05-13T09:52:25.320" ContentLicense="CC BY-SA 3.0" />
  <row Id="17762" PostTypeId="2" ParentId="16954" CreationDate="2015-05-12T20:19:55.813" Score="2" Body="&lt;p&gt;In trading you need to make a lot of simple computation of a very large flow of data. FPGA are perfect that for. It is typically FPGA that will host &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;marketfeed handler (see &lt;a href=&quot;http://www.novasparks.com/&quot; rel=&quot;nofollow&quot;&gt;NOVASPARKS&lt;/a&gt; website, or &lt;a href=&quot;http://www.accelize.com/solutions/fpga-solutions-in-finance/market-feed-handlers.html&quot; rel=&quot;nofollow&quot;&gt;ACCELLIZE&lt;/a&gt;) ;&lt;/li&gt;&#xA;&lt;li&gt;analytics computations ;&lt;/li&gt;&#xA;&lt;li&gt;risk computation (see &lt;a href=&quot;http://marketsmedia.com/ullink-achieves-2-%CE%BCs-latency-in-new-version-of-fpga-risk-solution-in-nasdaqs-ouch-production-environment/&quot; rel=&quot;nofollow&quot;&gt;ULLINK&lt;/a&gt; solution for instance).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For more, this generic article is not that bad: &lt;a href=&quot;http://www.eetimes.com/author.asp?section_id=36&amp;amp;doc_id=1323278&amp;amp;print=yes&quot; rel=&quot;nofollow&quot;&gt;Introducing FPGA-Based Acceleration for High-Frequency Trading&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the best is to read &lt;a href=&quot;http://www.worldscientific.com/worldscibooks/10.1142/8967&quot; rel=&quot;nofollow&quot;&gt;Market Microstructure in Practice&lt;/a&gt; ;{)}&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2015-05-12T20:19:55.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17765" PostTypeId="1" AcceptedAnswerId="17766" CreationDate="2015-05-12T21:53:49.827" Score="5" ViewCount="4676" Body="&lt;p&gt;I'm looking for monthly data of the S&amp;amp;P 500 total return since 1956. I have looked into Bloomberg and Datastream, but it looks like there are data only from 1988. &lt;/p&gt;&#xA;" OwnerUserId="12214" LastActivityDate="2021-02-12T22:31:29.277" Title="S&amp;P 500 total return since 1956" Tags="&lt;historical-data&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17766" PostTypeId="2" ParentId="17765" CreationDate="2015-05-13T00:28:17.580" Score="4" Body="&lt;p&gt;My understanding is that there are multiple S&amp;amp;P500 total return indexes. Each has a different base year, 1936, 1970, 1988 and year to date. If you can't find the ticker for the different indexes on bloomberg or by asking support, you could try s&amp;amp;p themselves.&lt;/p&gt;&#xA;&lt;p&gt;I was also able to find &lt;a href=&quot;https://web.archive.org/web/20160216164815/http://centraltendencies.com/2011/03/sp-500-total-returns/&quot; rel=&quot;nofollow noreferrer&quot;&gt;1970 to present here&lt;/a&gt;(I'm not sure about the quality of the data, though a &lt;a href=&quot;http://www.cftech.com/index.php/the-brainbank-archive/finance/138-standard-poor-s-500-index-calculation&quot; rel=&quot;nofollow noreferrer&quot;&gt;source&lt;/a&gt; confirms my understanding.)&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;There are four different total-return indices for the Standard &amp;amp; Poor's 500 Index: 1936, 1970, 1988, and year-to-date. Each one uses a different base period. The 1936 and 1970 total return indices were developed for historical use. Dividends are reinvested quarterly from 1936 through 1988 in the 1936 total-return index, and dividends are reinvested monthly from 1970 through 1988 in the 1970 total-return index. The 1988 total-return index is calculated based on daily reinvestment of dividends and uses January 1, 1988, as the base period. The year-to-date total-return index is also calculated assuming daily reinvestment of dividends; however, the base period is the last day of the prior year.&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="7109" LastEditDate="2021-02-12T19:03:39.227" LastActivityDate="2021-02-12T19:03:39.227" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="17767" PostTypeId="2" ParentId="9772" CreationDate="2015-05-13T01:47:21.250" Score="0" Body="&lt;p&gt;Reuters has historical financial news that goes back pretty far. I was doing some similar stuff with historical news and you can go back before 1950's, for certain companies. You can scrape from them using a scraper built by yourself (very easy to implement in python) or using a service like Kimono, which you can set to run every so often. Kimono also lets you form an API with the scraped data, which is nice. Reuters is by far the best source that I have come across.  &lt;/p&gt;&#xA;" OwnerUserId="16210" LastActivityDate="2015-05-13T01:47:21.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17768" PostTypeId="2" ParentId="17761" CreationDate="2015-05-13T01:50:19.020" Score="3" Body="&lt;p&gt;The currency carry trade is generally said to be short volatility. The reason is that when [currency] volatility rises, the carry trade suffers, and when volatility falls, the carry trade does well.  You can do a regression of carry trade profits vs volatility [either currency volatility, or even just the VIX as a proxy for all volatility]; or just anecdotally it seems that the big losses are in months when there is a lot of turmoil, like in late 2007 if I remember well. &lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-05-13T01:50:19.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17769" PostTypeId="2" ParentId="9166" CreationDate="2015-05-13T01:55:04.280" Score="4" Body="&lt;p&gt;QSTK is nice and open source , it is the QuantSciTookKit and it has some good functionality if you are interested in python programming. Here is the &lt;a href=&quot;https://github.com/QuantSoftware/QuantSoftwareToolkit&quot; rel=&quot;nofollow noreferrer&quot;&gt;GitHub repo&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="16210" LastEditorUserId="848" LastEditDate="2020-01-17T16:21:06.857" LastActivityDate="2020-01-17T16:21:06.857" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="17770" PostTypeId="1" CreationDate="2015-05-13T02:50:13.690" Score="2" ViewCount="457" Body="&lt;p&gt;I'm trying to build an automated forex trading system and I'm trying to understand how to calculate the number of units I should specify for each trade in different scenarios.  Say for example I have an account with a broker in USD and I've deposited $1000. Ignoring leverage, I'd like to allocate my entire balance in each of the following scenarios.  In each scenario I've tried to explain how I think the calculation should be performed..&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Going Long&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Long USD/JPY&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Buy USD, sell JPY&lt;br&gt;&#xA;  USD is the base currency so units (USD) = 1000&lt;br&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Long EUR/USD&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Buy EUR, sell USD&lt;br&gt;&#xA;  units (EUR) = 1000 / [EUR/USD].Ask&lt;br&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Long EUR/JPY&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Buy euros, sell yen&lt;br&gt;&#xA;  How many yen can we get with 1000 dollars?&lt;br&gt;&#xA;  Buy yen with dollars&lt;br&gt;&#xA;  Instrument = USD/JPY&lt;br&gt;&#xA;  USD (selling) is the base currency so multiply by the bid&lt;br&gt;&#xA;  So yen = 1000 * [USD/JPY].Bid&lt;br&gt;&#xA;  &lt;strike&gt;units (EUR) = yen * [EUR/JPY].Ask&lt;/strike&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Update:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;units (EUR) = yen / [EUR/JPY].Ask&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Long GBP/NZD&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Buy GBP, sell NZD&lt;br&gt;&#xA;  How many NZD can we get with 1000 USD&lt;br&gt;&#xA;  Instrument = NZD/USD&lt;br&gt;&#xA;  USD (selling) is the quote currency so divide by the ask&lt;br&gt;&#xA;  So NZD = 1000 / [NZD/USD].Ask&lt;br&gt;&#xA;  units (GBP) = NZD / [GBP/NZD].Ask&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;h1&gt;Going Short&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Short USD/JPY&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Sell dollars for yen&lt;br&gt;&#xA;  units (USD) = 1000&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Short EUR/USD&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Sell euros, buy dollars&lt;br&gt;&#xA;  &lt;strike&gt;units (EUR) = 1000 * [EUR/USD].Ask&lt;/strike&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Update:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;units (EUR) = 1000 / [EUR/USD].Bid&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Short EUR/JPY&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Sell euros, buy yen&lt;br&gt;&#xA;  How many euros can I buy with 1000 dollars?&lt;br&gt;&#xA;  Instrument EUR/USD&lt;br&gt;&#xA;  USD (selling) is the quote currency so divide by the ask&lt;br&gt;&#xA;  units (EUR) = 1000 / [EUR/USD].Ask&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Short CHF/JPY&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Sell CHF and hold JPY&lt;br&gt;&#xA;  How much CHF can we buy with 1000 USD?&lt;br&gt;&#xA;  Instrument = USD/CHF&lt;br&gt;&#xA;  USD (selling) is the base currency to multiply by the bid&lt;br&gt;&#xA;  units (CHF) = 1000 * [USD/CHF].Bid&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So the question is - have I got the logic right in each scenario?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[ This is a follow up question to my previous question - &lt;a href=&quot;https://quant.stackexchange.com/questions/17733/calculating-units-in-a-cross-currency-short-trade&quot;&gt;Calculating units in a cross currency short trade&lt;/a&gt; ]&lt;/p&gt;&#xA;" OwnerUserId="13643" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2015-05-29T11:12:37.357" Title="Forex trading scenarios - calculating units" Tags="&lt;fx&gt;&lt;algorithmic-trading&gt;&lt;currency&gt;&lt;short-selling&gt;&lt;longshort&gt;" AnswerCount="2" CommentCount="7" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17771" PostTypeId="1" CreationDate="2015-05-13T04:08:45.113" Score="3" ViewCount="290" Body="&lt;p&gt;Are there any literature on selecting systematic views for Black-Litterman along with methods to specify the uncertainty parameter?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, rather than specifying a portfolio manager's subective belief, we perhaps scale a belief based on a historical residual return of a stock based on the market model. e.g if $\epsilon_i = r_i - (\hat{\alpha} + \hat{\beta}R_m)$ then one view can be that stock one is expected to outperform stock two by $1/K *(\frac{\bar{\epsilon_1}}{\sigma_{\epsilon_1}} - \frac{\bar{\epsilon_2}}{\sigma_{\epsilon_2}})$ where $K$ is some scaling constant to ensure that views are accounted for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just a crazy thought.&lt;/p&gt;&#xA;" OwnerUserId="11888" LastActivityDate="2015-05-15T07:56:11.747" Title="Systematic Views in Black-Litterman?" Tags="&lt;portfolio-management&gt;&lt;black-litterman&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17772" PostTypeId="2" ParentId="17761" CreationDate="2015-05-13T06:05:58.123" Score="1" Body="&lt;p&gt;Some thoughts about this very interesting question:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;A long position in a diversified stock index (I would not bet that this is true for all single stocks) quite surely results in a short position in volatility. The correlation here is something like $-0.7$ (as books tell, this is of course just an indication. &lt;/li&gt;&#xA;&lt;li&gt;Therefore I have observed the phenomenon that a call is less of a long position in volatility than a put. If the stock price rises the call appreciates in value but as vol tends to decrease the move is dampened. For puts a decrease in price tends to be accompanied by rising vola and the price rises even more.&lt;/li&gt;&#xA;&lt;li&gt;In times where duration is negatively correlated to risky assets (especially stocks) - usually a risk-on/risk-off period it tends to be positively correlated with (stock) volatility. Thus something like Bund or Treasury futures long correlates with stock vola long (with a beta very different from 1).&lt;/li&gt;&#xA;&lt;li&gt;Carry trades work if &quot;everything&quot; (yield curve shapes, differentials, ...) stay the same. In times of high volatility (as Alex C writes) such trades can suffer.&lt;/li&gt;&#xA;&lt;li&gt;For a Euro investor a short in USD is like long stocks resp. short volatility. In times of (stock) volatility the USD tends to rise against the EUR. Then being long USD helps.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-05-13T06:05:58.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17773" PostTypeId="2" ParentId="17770" CreationDate="2015-05-13T06:08:59.660" Score="1" Body="&lt;p&gt;A currency quote (EURUSD 1.1, for example) put into an equation with units is &lt;code&gt;1 EUR / 1 USD = 1.1&lt;/code&gt; or &lt;code&gt;1 EUR = 1.1 USD&lt;/code&gt;. Units or volume of a currency pair is expressed in terms of the base currency (EUR in the example), which means bids are buying and asks are selling the base currency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I glanced a few examples and it looks like you're right, but here's one in equation form:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Buy GBP, sell NZD&#xA;We need NZD to sell. Must buy some using NZD/USD.&#xA;We are buying NZD/USD from people selling it, so we get the &quot;asking&quot; price&#xA;NZD/USD = x (the ask price)&#xA;1 NZD / x = 1 USD (re-arrange)&#xA;1000/x NZD = 1000 USD (multiply by 1000)&#xA;GBP/NZD = y (also buying GBP, so use ask)&#xA;(1000/x)/y GBP = (1000/x) NZD (multiply both sides by amount of NZD we can sell)&#xA;thus you can long (1000/x)/y units of GBP/NZD with 1000 USD.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="15695" LastActivityDate="2015-05-13T06:08:59.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17774" PostTypeId="2" ParentId="17771" CreationDate="2015-05-13T08:20:42.207" Score="2" Body="&lt;p&gt;Yes, you can formulate such a view. A lot of ways to formulate views are described in the literature (one can start &lt;a href=&quot;http://www.blacklitterman.org/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;). However, your view is based on the assumption that CAPM works precisely for single stocks. This assumption will be wrong in most cases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT after a comment by the OP:&#xA;I think now I understand. You want to replace expert's views (discretionary) by some systematic trading view. I would say: yes why not. But what is your prior? The market equilibrium? How do you choose the confidence in the view? The prior and the view are mixed proportional to the confidence. All in all if you have a systematic approach that works, why use Black-Litterman and mix the system with some prior? Furthermore market equilibrium (a possible prior) is something that works (if at all) on the long run. &lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-05-15T07:56:11.747" LastActivityDate="2015-05-15T07:56:11.747" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17775" PostTypeId="2" ParentId="17727" CreationDate="2015-05-13T09:33:10.173" Score="1" Body="&lt;p&gt;It's not a zero cost as you need to pay the initial margin and should have some extra cash in case you go below maintenance margin.  You need some cash to trade, pick a sensible amount for an initial figure and measure against that.&lt;/p&gt;&#xA;" OwnerUserId="3013" LastActivityDate="2015-05-13T09:33:10.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17776" PostTypeId="1" CreationDate="2015-05-13T10:56:47.853" Score="1" ViewCount="102" Body="&lt;p&gt;Given that $X_t , Y_t$ are two cointegrated random processes,&#xA;what can we say about the relationship between variance of the two increments&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$var(X_{t+h}-X_t)$ , $var(Y_{t+h}-Y_t)$ for a given $h&amp;gt;0$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="16081" LastActivityDate="2015-05-13T10:56:47.853" Title="Cointegration and variance of time series" Tags="&lt;options&gt;&lt;volatility&gt;&lt;time-series&gt;&lt;cointegration&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17779" PostTypeId="1" CreationDate="2015-05-13T13:35:50.653" Score="1" ViewCount="163" Body="&lt;p&gt;I have been working on an old problem in one of my finance classes and, since no solution has been provided and I won't be able to contact my teacher anytime soon, I was hoping I could ask you guys to give me some feedback on my solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a measure Q under which the dynamics of St are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{dS_{t}}{S_{t}}=rdt+\sigma dW_{t}^{Q}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W_{t}^{Q}$ is a Brownian motion under Q.Solve the boundary value problem you found above via an equivalent martingale method under the measure Q, i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P(t,S_{t})=e^{-r(T-t)}E{_{t}}^{Q}[P(T,S_{t})]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my attempt at a solution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E{_{t}}^{Q}[P(T,S_{t})]=E{_{t}}^{Q}[K\times 1_{S_{t}\leq K}]-E{_{t}}^{Q}[S_{T}\times 1_{S_{t}\leq K}]$ where 1 is an indicator function&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E{_{t}}^{Q}[P(T,S_{t})]=K\times Prob^{Q}(S_{T}\leq K)-E{_{t}}^{Q}[S_{t}e^{(r-\frac{\sigma ^{2}}{2})(T-t)+\sigma (W_{T}^{Q}-W_{t}^{Q}))}\times  1_{S_{t}\leq K}]$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E{_{t}}^{Q}[P(T,S_{t})]=K\times Prob^{Q}(S_{T}\leq K)-S_{t}e^{r(T-t))}E{_{t}}^{Q}[e^{(-\frac{\sigma ^{2}}{2})(T-t)+\sigma (W_{T}^{Q}-W_{t}^{Q}))}\times  1_{S_{t}\leq K}] $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, here comes the part where I am not sure whether how I proceeded is correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fact: &#xA;$E[e^{yZ-0.5y^2}\times 1_{Z\geq -a}]=\Phi (y+a)$, for  $Z\sim N(0,1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Proof (provided to us):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E[e^{yZ-0.5y^2}\times 1_{Z\geq -a}]=\int_{-\infty }^{\infty }e^{yZ-0.5y^2}\times 1_{Z\geq -a}[\frac{1}{\sqrt{2\pi }}e^{-0.5Z^2}]dZ$&#xA;$=\frac{1}{\sqrt{2\pi }}\int_{-a}^{\infty }e^{-0.5(Z-y)^2}dZ=\Phi (y+a)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From this I went on to rewrite $1_{S_{t}\leq K}$ :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_{t}\leq K$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_{t}e^{(r-\frac{\sigma ^{2}}{2})(T-t)+\sigma (W_{T}^{Q}-W_{t}^{Q}))}\leq K$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$lnS_{t}+(r-\frac{\sigma ^2}{2})(T-t)+\sigma (W_{T}^{Q}-W_{t}^{Q})\leq lnK$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma (W_{T}^{Q}-W_{t}^{Q})\leq lnK -lnS_{t}-(r-\frac{\sigma ^2}{2})(T-t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma \sqrt{T-t}Z\leq ln\frac{K}{S_{t}}-(r-\frac{\sigma ^2}{2})(T-t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Z \geq\frac{ln\frac{S_{t}}{K}+(r-\frac{\sigma ^2}{2})(T-t)}{\sigma \sqrt{T-t}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;${ \frac{ln\frac{S_{t}}{K}+(r-\frac{\sigma ^2}{2})(T-t)}{\sigma \sqrt{T-t}}}\equiv a$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and so&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$1_{Z\geq a}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E[e^{-\frac{\sigma ^{2}}{2}(T-t)+\sigma\sqrt{T-t}Z}\times 1_{Z\geq a}]=\Phi (y-a)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is it correct here to subtract a, instead of adding it as given in the proof?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Further:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Phi (y-a)=\sigma \sqrt{T-t}-\frac{ln\frac{S_{t}}{K}+(r-\frac{\sigma ^2}{2})(T-t)}{\sigma \sqrt{T-t}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Phi (y-a)=\frac{\sigma^2 (T-t)}{\sigma\sqrt{T-t}}\ - \frac{ln\frac{S_{t}}{K}+(r-\frac{\sigma ^2}{2})(T-t)}{\sigma \sqrt{T-t}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;giving:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Phi (y-a)= -\frac{ln\frac{S_{t}}{K}+(r+\frac{\sigma ^2}{2})(T-t)}{\sigma \sqrt{T-t}}=\Phi (-d_{1})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P(t,S_{t})=e^{-r(T-t)}[K \times Prob^{Q}(S_{T}\leq K)-S_{t}e^{r(T-t)}\Phi (-d_{1})]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$=e^{-r(T-t)}K\Phi (-d2)-S_{t}\Phi (-d_{1})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which is the B-S put option formula, if I'm not mistaken. Again, as mentioned above, I am not sure if everything I did was correct, especially the application of the fact I've given above. I'd be grateful, if someone more knowledgable than could quickly go over my solution and let me know if I went wrong anywhere :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any help!&lt;/p&gt;&#xA;" OwnerUserId="16215" LastActivityDate="2015-05-13T13:35:50.653" Title="B-S Put Option Formula: Derivation using expected value under Q" Tags="&lt;black-scholes&gt;&lt;martingale&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17780" PostTypeId="2" ParentId="17770" CreationDate="2015-05-13T15:14:09.953" Score="2" Body="&lt;p&gt;What you're trying to do is express all your positions in terms of a risk currency. Then you can track your PnL in only one currency. You need to express all this in an Excel spread sheet and include some rates, a bit like the screenshot here. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/uM778.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2015-05-13T15:14:09.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17781" PostTypeId="2" ParentId="17344" CreationDate="2015-05-13T16:34:48.540" Score="4" Body="&lt;p&gt;There is a shortcut around the Forward Equation when you are looking for the stationary distribution. Let me write &#xA;$$&#xA;dX = \mu(X)dt +\sigma(X)dW&#xA;$$ &#xA;for &#xA;$$&#xA;\mu(x)=b(1-x)-ax\ \text{ and }\ \sigma^2(x)=x(1-x)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Forward Equation indeed states that the stationary distribution $p(x)$ will be satisfied for $\partial p/\partial t = 0$, therefore&#xA;$$&#xA;\frac{1}{2}\frac{d^2}{dx^2}\left[\sigma^2(x)p(x)\right] - \frac{d}{dx}\left[\mu(x)p(x)\right] = 0&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The trick is to take one differential as a common factor and write&#xA;$$&#xA;\frac{d}{dx} \left\{ \frac{1}{2}\frac{d}{dx}\left[\sigma^2(x)p(x)\right] - \mu(x)p(x) \right\}= 0&#xA;$$&#xA;Then, the term in the braces will be a constant (it's derivative is zero), and we can take it to be zero. Then we are facing the first order ODE&#xA;$$&#xA;\frac{1}{2}\frac{d}{dx}\left[\sigma^2(x)p(x)\right] = \mu(x)p(x)&#xA;$$&#xA;Solving this yields the stationary distribution up to the normalization constant. The solution is actually given by&#xA;$$&#xA;p(x) \propto \sigma^{-2}(x) \exp\left( \int^x \frac{2\mu(u)}{\sigma^2(u)} du \right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above holds for any process. In your particular case, the integral becomes&#xA;$$&#xA;\int^x \frac{2b(1-u)-2au}{u(1-u)} du = 2b \int^x \frac{du}{u}&#xA;-2a\int^x \frac{du}{1-u} = \log \left( x^{2b} (1-x)^{2a} \right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, overall the stationary distribution is Beta with parameters $(\alpha,\beta)=(2b,2a)$&#xA;$$&#xA;p(x) \propto x^{2b-1} (1-x)^{2a-1}&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2015-05-13T16:34:48.540" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17782" PostTypeId="2" ParentId="17293" CreationDate="2015-05-13T18:05:50.873" Score="2" Body="&lt;p&gt;For question I, the identity&#xA;\begin{align*}&#xA;\rho_t = \exp\big(-\lambda_t W_t - \frac{1}{2} \lambda_t^2t\big)&#xA;\end{align*}&#xA;does not appear correct, unless $\lambda_t$ is a constant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For question II, yes. If $X_t = -\int_0^t \lambda_s dW_s$, then $\langle X \rangle_t = \int_0^t \lambda_s^2 ds$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For question III, you need to note that&#xA;\begin{align*}&#xA;\langle X \rangle_t = \int_0^t \frac{\partial\langle X \rangle_s}{\partial s}ds.&#xA;\end{align*}&#xA;Then $d\langle X, \langle X \rangle \rangle_t = 0$ and $d\langle \langle X \rangle, \langle X \rangle \rangle_t = 0$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-05-13T18:14:10.407" LastActivityDate="2015-05-13T18:14:10.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17783" PostTypeId="2" ParentId="17293" CreationDate="2015-05-13T18:44:11.097" Score="2" Body="&lt;p&gt;It might be easier to go the other way: start with &#xA;$$&#xA;  d\mathcal{E}_t = \mathcal{E}_t dX_t&#xA;$$&#xA;apply Ito to the $\log$ function&#xA;$$&#xA;  d\log(\mathcal{E})_t = \frac{1}{\mathcal{E}_t}d\mathcal{E}_t - \frac{1}{2} \frac{1}{\mathcal{E}_t^2}d\langle\mathcal{E},\mathcal{E}\rangle_t &#xA;= \frac{1}{\mathcal{E}_t}\mathcal{E}_tdX_t - \frac{1}{2} \frac{1}{\mathcal{E}_t^2}\mathcal{E}_t^2d\langle X,X\rangle_t &#xA;$$&#xA;in other words&#xA;$$&#xA;  d\log(\mathcal{E})_t = dX_t - \frac{1}{2} d\langle X,X\rangle_t &#xA;$$&#xA;$$&#xA;  \log(\mathcal{E})_T = \log(\mathcal{E}_0) + X_T - \frac{1}{2} \langle X,X\rangle_T &#xA;$$&#xA;$$&#xA;  \mathcal{E}_T = \mathcal{E}_0\exp(X_T - \frac{1}{2} \langle X,X\rangle_T) &#xA;$$&#xA;In case $X_t = \int_0^t \lambda_s dW_s$, you get $dX_t = \lambda_t dW_t$ and $\langle X,X\rangle_T =\int_0^T d\langle X,X\rangle_t =\int_0^T \lambda_t^2 d\langle W,W\rangle_t = \int_0^T \lambda_t^2 dt$.   &lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2015-05-13T18:44:11.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17784" PostTypeId="1" CreationDate="2015-05-13T20:33:48.407" Score="1" ViewCount="69" Body="&lt;p&gt;A couple of my brokers are not sending tag 60(TransactTime) on Canceled messages.  What is the rule of thumb for determining cancel time when tag 60 is absent from a Canceled message?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Canceled message as in 35=8 150=4.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is tag 60(TransactTime) not a required field on Order Canceled messages?&lt;/p&gt;&#xA;" OwnerUserId="16220" LastEditorUserId="16220" LastEditDate="2015-05-14T17:28:12.430" LastActivityDate="2015-05-14T17:28:12.430" Title="Why is TransactTime not required on ExecutionReports?" Tags="&lt;fix&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="0" ClosedDate="2015-05-14T08:24:39.010" ContentLicense="CC BY-SA 3.0" />
  <row Id="17785" PostTypeId="1" AcceptedAnswerId="17788" CreationDate="2015-05-14T07:56:07.517" Score="0" ViewCount="138" Body="&lt;p&gt;I've recently been given a project which came with some documentation. In this documentation is a bullet point that reads:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Liquidity Risk in Equity, Credit and Vol&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'm unsure as to whether vol is referring to volume or volatility and the only clues I have are database queries and table names:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Query LiquidityVolDelete &amp;amp; Query MakeLiquidityVolRisk affect the LiquidityVolRisk table.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't access the query to see the variables (it's poorly designed and I'm refused access on these grounds), However the columns in the table are as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Strategy,&#xA;ProductType,&#xA;Vega($),&#xA;Maturity,&#xA;RegionFinal,&#xA;Ticker,&#xA;EquityRiskName,&#xA;BandOK,&#xA;TypeLiquidity,&#xA;MinMaturity(in Years),&#xA;PctVol&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, not knowing much about about finance at all, I'm still none the wiser.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If anyone could help me with this, it would be most appreciated!&lt;/p&gt;&#xA;" OwnerUserId="16222" LastEditorUserId="16222" LastEditDate="2015-05-14T10:41:38.450" LastActivityDate="2015-05-14T11:44:07.050" Title="Volume or Volatility?" Tags="&lt;volatility&gt;&lt;volume&gt;&lt;liquidity-risk&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17786" PostTypeId="2" ParentId="17603" CreationDate="2015-05-14T08:43:39.623" Score="1" Body="&lt;p&gt;Machine learning is a very wide field. Most often it is used for classification or regression tasks when you have labelled data to train the model. For example you show thousands of labeled pictures with an apple and computer &quot;learns&quot; what set of features gives high probability that picture contains an apple (for example, round, red etc). Now in your case next day scenarios are your labels. First of all you need to label all your historical data with possible scenarios (break out day, failed breakout day, range day, volatile day, reversal day, boring day etc, whatever you use). Once you have labels you can choose whatever model you prefer (probably decision trees or random forest are best for this) and give it some features (last open/close, moving average, last day type etc) and train it (just look for some tutorial how to do that with for example R shouldn't be very hard). Sounds easy? Not so fast. &quot;give it some features&quot; is actually most crucial part. You must have some insights on how to predict next day and which features matters. If you just give closing price model will not learn anything because no one can do that. Features you provide MUST have some predictive power for that. That's why &quot;no free lunch&quot; theorem exists - you must know your domain if you want to train a machine. So from your own question &quot;given the recent price dynamics&quot; is crucial - you must be able to predict next day yourself so you can find some features for the model that have real predictive power so model can learn. Once you have labelled data and select features you should train model not on full historical data but only on part of it and use other part to validate how your model works. If model overfits or underfits - back to feature selection. Do that until you are satisfied with the results. &#xA;Another approach could be market simulation. Trying to guess market microstructure and simulate possible outcomes. Something like this: &lt;a href=&quot;https://intelligentjava.wordpress.com/2014/09/16/stock-market-simulation-with-cellular-automaton/&quot; rel=&quot;nofollow&quot;&gt;https://intelligentjava.wordpress.com/2014/09/16/stock-market-simulation-with-cellular-automaton/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16223" LastActivityDate="2015-05-14T08:43:39.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17787" PostTypeId="1" CreationDate="2015-05-14T10:23:32.757" Score="1" ViewCount="142" Body="&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;: The price of a stock is 100. With equal probabilities, it either goes up to 130 or down to 70. What is the price of a 1 year call option with exercise price 100. Risk free rate is 5%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Attempt&lt;/strong&gt;: I use black scholes. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Given: $Su=130.  Sd=70.rf=5% S_0=100$&lt;/li&gt;&#xA;&lt;li&gt;$Cu=max(0,130-100)=30.  Cd=max(0,70-100)=30$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Now,&#xA;$$HedgeRatio = (30-0)/(130-70)=1/2$$&#xA;$$B=(Cd-Sd \cdot HedgeRatio)/(1+rf)=(0-70/2)/(1.05)=-(33+1/3)$$&#xA;So the price of the call option is $$C_0=S_0*Hedgeratio+B= 100/2   -(33+1/3)=16+2/3$$ but it is wrong.&lt;/p&gt;&#xA;" OwnerUserId="12002" LastActivityDate="2015-05-14T14:18:31.703" Title="Pricing call option" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17788" PostTypeId="2" ParentId="17785" CreationDate="2015-05-14T11:44:07.050" Score="0" Body="&lt;p&gt;The variable surely should be the percentage volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, it should not be the asset volume, because the volume can be interpreted as liquidity risk proxy measure too, and, so, it should be participated in the &lt;em&gt;TypeLiquidity&lt;/em&gt; variable (or variables set).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See, for instance, at:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Fong, Kingsley YL, Craig W. Holden, and Charles Trzcinka. &quot;What are&#xA;  the best liquidity proxies for global research?.&quot; Available at SSRN&#xA;  1558447 (2014).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;We can give you more information if you post the variables label too.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-05-14T11:44:07.050" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17789" PostTypeId="1" AcceptedAnswerId="17792" CreationDate="2015-05-14T13:49:32.253" Score="2" ViewCount="922" Body="&lt;p&gt;Typically, markets guarantee a FIFO order of priority of execution for various orders at the same price. I want to know does this hold true for Iceberg orders?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for eg Order1 = Buy 100 Quantities @ 2 dollar each and  disclosed quantity=10. &#xA;After this Order 2 is placed : Buy 100 Quantities @$2 each with disclosed quantity 100. Is it gauranteed that Order2 would not trade before order 1 is traded completely?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="16225" LastActivityDate="2018-09-08T15:53:43.573" Title="How is the Order priority of an Iceberg order decided?" Tags="&lt;algorithmic-trading&gt;&lt;limit-order-book&gt;&lt;order-execution&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17790" PostTypeId="1" CreationDate="2015-05-14T14:01:33.597" Score="2" ViewCount="322" Body="&lt;p&gt;First, under Black-Scholes we have the usual method to transform the discounted asset price into a martingle:   Let the asset price $S_t$ be goverend by&#xA;$$&#xA;dS_t = \mu S_t dt + \sigma S_t dW_t,&#xA;$$&#xA;so&#xA;\begin{align*}&#xA;d(e^{-rt}S_t) &amp;amp; = -re^{-rt}S_tdt + e^{-rt}\left(\mu S_t dt + \sigma S_t dW_t\right) \\&#xA;&amp;amp; = \sigma e^{-rt}S_t\left( \frac{\mu - r}{\sigma}dt + dW_t \right).&#xA;\end{align*}&#xA;Set $\gamma = \frac{\mu - r}{\sigma}$ and let $\tilde{W}_t = W_t + \gamma t$, a $\mathbb{Q}$-BM.  We then get that our discounted asset price process is a $\mathbb{Q}$-martingale, and we can begin pricing options:&#xA;$$&#xA;d(e^{-rt}S_t) = \sigma e^{-rt}S_t d\tilde{W}_t.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, what if the asset price is goverened by some other SDE, e.g. a mean-reverting process given by the SDE&#xA;$$&#xA;dS_t = \kappa(\theta - S_t)dt + \sigma dW_t.&#xA;$$&#xA;Following the same method as above, I get&#xA;\begin{align*}&#xA;d(e^{-rt}S_t) &amp;amp; = -re^{-rt}S_tdt + e^{-rt}\left(\kappa(\theta - S_t)dt + \sigma dW_t\right) \\&#xA;&amp;amp; = e^{-rt}\left[(\kappa(\theta - S_t) - rS_t)dt + \sigma dW_t \right].&#xA;\end{align*}&#xA;The problem here is this SDE for the discounted asset price is not in terms of the disounted price itself, i.e., there is no explicit $e^{-rt}S_t$ multiplying the RHS.  Hence, even using the closed-form solution for $S_t$ and letting $\gamma = \frac{\kappa(\theta - S_t) - rS_t}{\sigma}$ (again $\tilde{W}_t = W_t + \gamma t$), we get&#xA;$$&#xA;d(e^{-rt}S_t) = \sigma e^{-rt}\tilde{W}_t,&#xA;$$&#xA;which is not a martingale in the variable $e^{-rt}S_t$ as needed.  Is there a framework for these sort of mean-reverting processes?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastEditorUserId="6866" LastEditDate="2015-05-14T16:09:15.723" LastActivityDate="2015-06-13T22:56:39.573" Title="Martingale Measure for Vasicek process" Tags="&lt;stochastic-processes&gt;&lt;martingale&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17791" PostTypeId="2" ParentId="17787" CreationDate="2015-05-14T14:18:31.703" Score="3" Body="&lt;p&gt;I don't know the BS formula you are trying to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The price is the expected value of the discounted payoff under the risk neutral probability measure (I.e. Under which S is a martingale) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the you need to compute the risk neutral probabilities for S to go up or down. The probabilities given in the problem have no impact. They are just there to trick the candidate.&lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2015-05-14T14:18:31.703" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17792" PostTypeId="2" ParentId="17789" CreationDate="2015-05-14T14:35:09.207" Score="3" Body="&lt;p&gt;No. 10 shares from Order1 have time priority. The 100 shares of Order2 will trader after 10 from Order1. The 90 hidden shares of Order1 are hidden, and therefore at the back of the queue. When they light, they get in line at the back.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastActivityDate="2015-05-14T14:35:09.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17793" PostTypeId="2" ParentId="17002" CreationDate="2015-05-14T15:21:42.690" Score="2" Body="&lt;p&gt;I do not yet know QuantLib but one question is general and easy to answer:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;My first question is why do they use different yield curve?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;These two curves differ by risk levels inherent in them - the credit spreads over the risk-free yield curve (e.g., the OIS curve).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The discounting curve, discountingTermStructure, embeds the risk that this particular bond will not pay on time.  Alternatively, it can be the risk-free curve if the default risk of the bond is taken care of otherwise and is not embedded in its price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The forecast curve, forecastingTermStructure, embeds the risk of the underlying floating rate.  Suppose the payments of your floating rate bond are linked to USD Libor; it is the rate at which large banks in London exchange USD deposits/loans.  This rate includes the premium for the risk that borrowing bank will not pay on time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have also found the answer to the second question:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I want to get the interpolated yield at 9 months. How could I do that?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;According to &lt;a href=&quot;http://cogitolearning.co.uk/?p=705&quot; rel=&quot;nofollow&quot;&gt;Cogito Learning QuantLib: Yield Curves&lt;/a&gt;, the method YieldTermStructure::zeroRate returns the zero-coupon rate for any given moment.&lt;/p&gt;&#xA;" OwnerUserId="16212" LastActivityDate="2015-05-14T15:21:42.690" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17795" PostTypeId="2" ParentId="16862" CreationDate="2015-05-14T16:58:52.300" Score="3" Body="&lt;p&gt;Libor is indeed usually fixed in advance (and paid in arrears). Thus, in your example the first fixing date will be 2 business days before March 5th, and the second fixing date will be 2 business days before June 5th. Usually, therefore, the first fixing is already known when the swap is traded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You say that the Libor leg is paid semi-annually - that's not the most common convention, but certainly exists. Usually, even if the fixed leg pays semi-annually, the Libor leg will be paid at the natural frequency of the Libor index (i.e. quarterly in your example). In your semi-annual example I would expect the two Libor fixings would be compounded to form the final payment amount made on September 5th.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, market practitioners would not describe this as a &quot;stub&quot; period. That term is reserved for the case when the first period is not the usual length. For example if the swap generally has semi-annual payments, but the first period is only four months long, that would be described as a front stub period.&lt;/p&gt;&#xA;" OwnerUserId="7533" LastActivityDate="2015-05-14T16:58:52.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17796" PostTypeId="1" CreationDate="2015-05-14T17:15:31.953" Score="2" ViewCount="79" Body="&lt;p&gt;While we know that leveraged ETFs do decline in value to zero given infinity, can we also say the same with our portfolio value if we use leverage in our trading activity and seeing our portfolio value fluctuating in close correlation to the underlying asset price times leverage, with a net decline in value over time, while the underlying asset price remain unchanged by the end of the same time period, even though we commit to just 1 trade (buy-n-hold) within this time period?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edition:&#xA;It's okay. I've found the answer. This question is considered resolved but with no relevant answer given I would want to delete the question but don't know how.&lt;/p&gt;&#xA;" OwnerUserId="16229" LastEditorUserId="16229" LastEditDate="2015-06-21T01:30:22.017" LastActivityDate="2015-07-21T01:33:24.597" Title="Leverage on ETF the same effect as on portfolio?" Tags="&lt;portfolio&gt;&lt;etf&gt;&lt;leverage&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17798" PostTypeId="2" ParentId="948" CreationDate="2015-05-14T18:29:02.003" Score="0" Body="&lt;p&gt;Try use WiredTiger (&lt;a href=&quot;http://www.wiredtiger.com/&quot; rel=&quot;nofollow&quot;&gt;http://www.wiredtiger.com/&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;WT is embedded no-sql solution and can be confugured as column-oriented or row-orinted on table level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Time series data may implemented by using time-sequenced primary key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;MongoDB and Amazon using this database for their solutions. Also some of HFT trading systems using this database.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Michael Cahill and Keith Bostic lead developers of this solution, they have more than 20 years experience of DBMS development in &quot;Sleepycat Software&quot; then Oracle&lt;/p&gt;&#xA;" OwnerUserId="16231" LastEditorUserId="16231" LastEditDate="2015-05-14T18:39:02.267" LastActivityDate="2015-05-14T18:39:02.267" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17800" PostTypeId="2" ParentId="17790" CreationDate="2015-05-14T21:29:35.267" Score="2" Body="&lt;p&gt;I think that you are a bit confused: the support of the Black-Scholes model is $(0,+\infty)$, that is to say the underlying asset price is non-negative, like a stock. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Vasicek model has an OU process whose support is $(-\infty,+\infty)$, that is to say the underlying can be negative. Therefore all equivalent measures (of which the martingale is one) must have the whole line as support.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore the Vasicek equivalent martingale cannot not have the same form as the BS exponential martingale, which is what you seem to be after. However, your last expression looks like a martingale to me, why do you say that it is not?&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2015-05-14T21:29:35.267" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17801" PostTypeId="2" ParentId="7069" CreationDate="2015-05-14T21:29:57.293" Score="0" Body="&lt;p&gt;There are different methods to get parametric copulas that have tail negative dependence. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might be interested in the following paper: &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S0167668715000025&quot; rel=&quot;nofollow&quot;&gt;Tail negative dependence and its applications for aggregate loss modeling&lt;/a&gt; and the reference therein.&lt;/p&gt;&#xA;" OwnerUserId="16233" LastEditorUserId="2553" LastEditDate="2015-05-15T10:37:56.370" LastActivityDate="2015-05-15T10:37:56.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17802" PostTypeId="1" CreationDate="2015-05-15T00:18:39.687" Score="3" ViewCount="2532" Body="&lt;p&gt;I have a list of all Yahoo Ticker Symbols and I want to convert them into ISIN Codes. I have been researching and found out that &lt;code&gt;finance.yahoo&lt;/code&gt; in the US does not offer ISIN Codes, however, in Germany and UK the website does offer ISIN codes so basically I have half of the list with ISIN and the other half without. Most of the ones I am missing are from US Markets, and looking at the Ticker it is not really the Symbol but a code that uniquely identifies the Security/Stock in &lt;strong&gt;Yahoo&lt;/strong&gt;, but not always other financial websites. This means:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;I may enter the Ticker in another financial website which contains the ISIN as well. In some cases, the Ticker may be the same as the Symbol of that specific site and I get the correct ISIN, however, in other cases it is not the same and it provides other ISIN which is not the one that matches the Yahoo Ticker. If I scrape other financial websites, there is a 50/50 chance of getting the correct ISIN for the Yahoo Ticker.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;On the other hand, if I go through all the Yahoo Ticker Symbols manually I would have to go over more than 10 000 which is highly inefficient and would take too much time, and eventually this would as well give small errors given to perhaps wrong copying/pasting of the Ticker, etc.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Is there a way to get the exact ISIN for Yahoo Ticker Symbols using perhaps some sort of programming language? Maybe Yahoo Developer Network?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have found this &lt;a href=&quot;https://developer.yahoo.com/forum/YQL/Is-it-possible-to-map-a/1350645667194-a804b619-912b-4cd0-a38d-d2f286edef91/&quot; rel=&quot;nofollow&quot;&gt;forum&lt;/a&gt; which posted a similar question to mine and uses YQL, but somehow the method applied is deprecated or simply does not work for me, with any of the Symbols I enter. The question was posted almost 3 years ago and &lt;code&gt;yahoo.finance&lt;/code&gt; may have change until now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;King Regards!!&lt;/p&gt;&#xA;" OwnerUserId="16235" LastActivityDate="2015-05-15T00:18:39.687" Title="How can I convert Yahoo Ticker Symbols into ISIN Codes?" Tags="&lt;market-data&gt;&lt;finance&gt;&lt;yahoo&gt;&lt;yahoofinance&gt;&lt;codes&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17803" PostTypeId="2" ParentId="17661" CreationDate="2015-05-15T01:10:51.317" Score="4" Body="&lt;p&gt;Thanks @Aksakal for suggesting Kalman Filter. Here I provide more details. We will view it as a state-space model:&#xA;$$&#xA;\begin{split}&#xA;z_t&#xA;&amp;amp;=&#xA;A_t z_{t-1} + B_t u_t + \epsilon_t,&#xA;\\&#xA;y_t &#xA;&amp;amp;=&#xA;C_t z_t + D_t u_t + \delta_t,&#xA;\\&#xA;\epsilon_t &amp;amp;\sim \mathcal{N}(0, Q_t),\ \delta_t \sim \mathcal{N}(0, R_t),&#xA;\end{split}&#xA;$$&#xA;where $z_t$ is the latent variable, $y_t$ is the observation, $u_t$ is an&#xA;optional input or control signal, $\epsilon_t$ is the system noise and $\delta_t$&#xA;is the observation noise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mapping our problem to state-space form, we get &#xA;$$&#xA;z_t &#xA;= &#xA;\begin{bmatrix}&#xA;r_t\\ r_{t-1} \\ \vdots \\ r_{t-p} &#xA;\end{bmatrix}_{(p+1)\times 1},&#xA;A_t&#xA;=&#xA;\begin{bmatrix}&#xA;0, 0, \ldots, 0 \\&#xA;1, 0, \ldots, 0 \\&#xA;\vdots \ldots \vdots \\&#xA;0, \ldots, 1, 0&#xA;\end{bmatrix}_{(p+1)\times(p+1)},&#xA;B_t &#xA;=&#xA;\begin{bmatrix}&#xA;\alpha,\ \beta \\&#xA;0,\ 0  \\&#xA;\vdots\  \vdots \\&#xA;0,\ 0&#xA;\end{bmatrix},&#xA;u_t&#xA;=&#xA;\begin{bmatrix}&#xA;1\\&#xA;r_{I, t}&#xA;\end{bmatrix},\&#xA;Q_t&#xA;=&#xA;\begin{bmatrix}&#xA;\sigma^2\quad &amp;amp;\mathbf 0^\top_{1\times p} \\&#xA;\mathbf{0}_{p \times 1}\ &amp;amp;\mathbf{0}_{p\times p}&#xA;\end{bmatrix}&#xA;$$&#xA;$$&#xA;y_t &#xA;= &#xA;\bar{r}_t,\quad&#xA;\\&#xA;C_t &#xA;=&#xA;\begin{bmatrix}&#xA;w_0\ w_1 \ldots w_p&#xA;\end{bmatrix},\&#xA;D_t &#xA;=&#xA;\mathbf{0}_{1\times 2},\&#xA;R_t&#xA;=&#xA;\mathbf{0}_{1\times 1}.&#xA;$$&#xA;We also assume $y_t \sim N(0, \sigma_0^2)$, where $\sigma_0^2$ is large enough so that it will be &#xA;a diffuse prior. Our model has the parameter $\theta = (B_t, C_t, \sigma^2, \sigma_0^2)$.&#xA;We are mainly interested in $p(z_t|y_{0\colon t}, u_{0\colon t}, \theta)$.&lt;/p&gt;&#xA;" OwnerUserId="11969" LastActivityDate="2015-05-15T01:10:51.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17805" PostTypeId="1" CreationDate="2015-05-15T05:26:21.430" Score="3" ViewCount="1156" Body="&lt;p&gt;How do you price zero coupon bond in extended Hull &amp;amp; White model by solving the Bond Pricing Equation??&lt;/p&gt;&#xA;" OwnerUserId="16237" LastActivityDate="2015-11-18T01:55:04.583" Title="Zero coupon bond pricing under Extended Hull &amp; White" Tags="&lt;hullwhite&gt;&lt;zero-coupon&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17806" PostTypeId="2" ParentId="9677" CreationDate="2015-05-15T06:27:48.947" Score="3" Body="&lt;p&gt;A methodology for estimating rating/ region/ sector proxies for ACVA calculations can be found here: &lt;a href=&quot;http://www.nomura.com/resources/europe/pdfs/cva-cross-section.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.nomura.com/resources/europe/pdfs/cva-cross-section.pdf&lt;/a&gt;&#xA;Please let me know if you need anything to be clarified (caveat: I am one of the authors). The methodology assigns a CDS mark to counterparties that either have no CDS marks, or their marks are unreliable due to poor liquidity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This sounds similar to what they call 'macro method', although I have never heard the term before. They could refer to a more direct approach where they map a name to a traded market-wide index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the CDS curve, the Survival Probability Curve is derived by bootstrapping and under an assumption for recovery.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2015-05-15T06:27:48.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17807" PostTypeId="1" CreationDate="2015-05-15T11:57:33.003" Score="4" ViewCount="1983" Body="&lt;p&gt;Let $B_t$ be a Brownian Motion. What's the probability that $B_1&amp;gt;0$ and $B_2&amp;lt;0$?&lt;/p&gt;&#xA;" OwnerUserId="15723" LastEditorUserId="2587" LastEditDate="2015-05-18T10:25:57.407" LastActivityDate="2015-05-18T10:25:57.407" Title="For $B_t$ a Brownian motion what is the probability that $B_1&gt;0$ and $B_2&lt;0$?" Tags="&lt;stochastic-calculus&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17808" PostTypeId="2" ParentId="17807" CreationDate="2015-05-15T12:10:06.743" Score="4" Body="&lt;p&gt;B1~N(0,1) and B2=B1+Z, for Z~N(0,1). From that E(B1*B1)=E(B1*B2)=1, E(B2*B2)=2. Therefore they are bivariate Gaussian with covariance matrix (1,1;1,2) therefore probability is around 12%, which is the volume over the bottom-right quadrant. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2015-05-15T12:29:12.527" LastActivityDate="2015-05-15T12:29:12.527" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17812" PostTypeId="1" AcceptedAnswerId="17849" CreationDate="2015-05-15T14:34:37.903" Score="1" ViewCount="6058" Body="&lt;p&gt;Currently, I am confused about the calculation of realised daily volatility. Assume I have daily returns, for example, FTSE, then I need to estimate the daily realised volatility. I read some materials and I get the idea:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$v = 100 * \sqrt{\frac{252}{n}\sum_{i = 1}^n R_t^2}$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;however, some other materials explain it should be $\frac{252}{n-1}$ in the equation, which one is right? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then it comes to why $v$ in the equation could be treated as the realised volatility. Here is my understanding, if we want to estimate the realised volatility on day $N$, we use the standard deviation of returns $R_{N - n}, R_{N - n + 1}, \dots, R_N $ multiply $\sqrt{252}$ as an approximation, if that true?  If it is true, then how to decide the size of $n$, $n= 10, 20 \dots$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Besides this method, any other method possible? Of course, except the estimation from GARCH family model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="15201" LastActivityDate="2015-05-18T05:46:55.793" Title="A good way to calculate the realised daily volatility" Tags="&lt;volatility&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17813" PostTypeId="2" ParentId="17807" CreationDate="2015-05-15T16:44:58.487" Score="2" Body="&lt;p&gt;&lt;strong&gt;Let&lt;/strong&gt; $Z_1,Z_2\sim N(0,1), B_1=Z_1,B_2=Z_1+Z_2.$&#xA;Construct a random variable $Y$ as following:&#xA;$$\left\{&#xA;\begin{array}{cc}&#xA;Y=1 &amp;amp; B_1&amp;lt;0, B_2&amp;gt;0\\&#xA;Y=0 &amp;amp; otherwise&#xA;\end{array}&#xA;\right.&#xA;$$&#xA;Note that $\mathbb{P}(Z_1+Z_2&amp;gt;0\mid Z_1&amp;lt;0)=\mathbb{P}(Z_2&amp;gt;-Z_1\mid Z_1&amp;lt;0)=\mathbb{E}Y$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Use&lt;/strong&gt; that to construct the integral. Everything that is not relevant adds up to zero as we obtain&#xA;$$\mathbb{P}(Z_2&amp;gt;-Z_1\mid Z_1&amp;lt;0)=\int_0^\infty f(-x)\cdot (1-F(x))dx,$$&#xA;where $f(x)=\dfrac{1}{\sigma\sqrt{2\pi}}e^{-\frac{(x-\mu)^2}{2\sigma^2}}$, a probability distribution function of a normal distribution. As in our case it is standard normal distribution, we have $f(x)=f(-x)$, so&#xA;$$&#xA;\int_0^\infty f(-x)\cdot (1-F(x))dx=\int_0^\infty f(x)\cdot (1-F(x))dx=\int_0^\infty f(x)dx-\int_0^\infty F(x)\cdot f(x)dx&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;First&lt;/strong&gt; part obviously is equal to $F(0)=\dfrac{1}{2}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now consider the &lt;strong&gt;second&lt;/strong&gt; part. As $F(x)=\int_{-\infty}^x f(y)dy$, and $f(x)$ is continuous, so we have $F'(x)=f(x)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then $f(x)dx=dF(x)$, giving us&#xA;$$&#xA;\int_0^\infty F(x)\cdot f(x)dx=\int_0^\infty F(x)dF(x)=\dfrac{1}{2}\int_0^\infty dF^2(x)=\dfrac{1}{2}\left(F(\infty)-F(0)\right)=\dfrac{1}{2}(1-0.25)=\dfrac{3}{8}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After all, we get an &lt;strong&gt;answer&lt;/strong&gt;&#xA;$$&#xA;\mathbb{P}(Z_1+Z_2&amp;gt;0\mid Z_1&amp;lt;0)=\int_0^\infty f(x)\cdot (1-F(x))dx=\dfrac{1}{2}-\dfrac{3}{8}=\dfrac{1}{8}=0.125&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="16244" LastActivityDate="2015-05-15T16:44:58.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17815" PostTypeId="2" ParentId="17812" CreationDate="2015-05-15T17:51:05.663" Score="2" Body="&lt;p&gt;The factor $\frac{n}{n-1}$ (Bessel's correction) is used when estimating sample variance. This is because using $n$ in the denominator yields a biased estimator of the variance. That being said, if one assumes that the mean is $0$ (not an unusual assumption), then one doesn't lose a degree of freedom in estimating sample mean, so Bessel's correction isn't necessary. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, while the correction yields an unbiased estimator of variance, it does not yield an unbiased estimator of standard deviation (volatility), so the point is a bit moot; the difference is small anyway.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the second question, the realized volatility is estimated over a period of time. So, if $n = 10$, you're estimating RV over a ten day period. This is not the same as estimating the RV on a single day. Multiplying it by $\sqrt{252}$ is simply to transform the estimated RV to an annualized RV.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I know, your first equation is the most common way of estimating RV. Though I do remember Tauchen was working on using Laplace transforms on high-frequency data, but I'm not sure that's what you're looking for.&lt;/p&gt;&#xA;" OwnerUserId="15336" LastActivityDate="2015-05-15T17:51:05.663" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17818" PostTypeId="2" ParentId="17807" CreationDate="2015-05-15T20:53:16.957" Score="6" Body="&lt;p&gt;The problem is equivalent to given to 2 independent standard normals $W$ and $Z$ the probability of &#xA;$$&#xA;W &amp;gt; 0, \text{ and } W+Z&amp;lt;0.&#xA;$$ &#xA;or&#xA;$$&#xA;W &amp;gt; 0, \text{ and } Z&amp;lt;-W.&#xA;$$ &#xA;Plotting this set we see it is the bottom half of the lower right quadrant. The probability of being in the lower right quadrant is clearly $0.25$ by symmetry. &#xA;The probability of being in the bottom half is half again by symmetry so the answer is $0.125.$&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-05-15T20:53:16.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17819" PostTypeId="1" CreationDate="2015-05-15T21:17:45.060" Score="1" ViewCount="551" Body="&lt;p&gt;I'm trying to find a good source for global equities for EOD data (historical and forward basis), currently using Bloomberg's back office data, but it is very hard to normalize it for corporate actions (ticker changes are painful, specially when same tickers are re-used by different companies) - I'm applying all the corporate actions but still it is not the best dataset. There has to be a better source and better way to do it. I know there are lot of sources, but what I'm really looking for is a robust solution that has a very good way to apply corp actions etc.&lt;/p&gt;&#xA;" OwnerUserId="6564" LastActivityDate="2015-07-21T15:17:58.383" Title="Clean EOD global Equities data provider for backtesting investment strategies" Tags="&lt;market-data&gt;&lt;historical-data&gt;&lt;pricing&gt;" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17820" PostTypeId="1" CreationDate="2015-05-15T23:10:56.373" Score="-1" ViewCount="247" Body="&lt;p&gt;I've been trading forex and programming (I'm in college), but want to get into automated trading and analyzing data real-time to make decisions (and learning more about stats and math as a hobby). I only have a laptop with a small SSD, so I'm planning to build a computer for this. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;For storing data, would something like &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/B00FJRS6FU&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;WD Black 4TB Performance Desktop Hard Drive: 3.5-inch, SATA 6 Gb/s, 7200 RPM, 64MB Cache&quot;&gt;this 4tb hdd&lt;/a&gt; work? I'm not sure if the seek time will matter (vs getting a SSD) because most of the data reading will be sequential anyways, right? Will a regular HDD work or will it bottleneck the performance? Will getting a HDD with size as large as 4TB bottleneck the performance?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Should there be a minimum amount of memory/cpu/gpu I should aim for? (grabbing and analyzing real-time data especially)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;My broker (IB) offers platforms for both windows and unix. Does it matter which OS I use? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="16250" LastEditorUserId="467" LastEditDate="2017-02-22T08:34:59.070" LastActivityDate="2017-02-22T14:39:04.893" Title="Building a personal computer for automated trading/analysis...what bottlenecks could I run into?" Tags="&lt;automated-trading&gt;" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17821" PostTypeId="1" CreationDate="2015-05-16T01:27:11.023" Score="2" ViewCount="44" Body="&lt;p&gt;On Page 5 of Duffie's Dynamic Asset Pricing Theory, the budget-feasible set is defined as:&#xA;$$X(q,e) = {e+D^T\theta \in R_+^s:\theta \in R^N, q\theta \leq 0}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Compared to Kerry Back's presentation of investor budget constraint, at least for me, this is rather odd. Can anyone please explain the economics intuition of this set for me?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $q\theta$ is the cost of the portfolio $\theta$, then why don't we set the budget constraint as $q\theta \leq e$, where e is the initial endowment?&lt;/p&gt;&#xA;" OwnerUserId="6804" LastActivityDate="2015-05-16T01:27:11.023" Title="Budget Constraint in Duffie's book" Tags="&lt;portfolio&gt;&lt;asset-pricing&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17822" PostTypeId="2" ParentId="1161" CreationDate="2015-05-16T07:22:10.790" Score="1" Body="&lt;p&gt;The differential equation guarantees no arbitrage. There is no need to list each one individually.&lt;/p&gt;&#xA;" OwnerUserId="15081" LastActivityDate="2015-05-16T07:22:10.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17823" PostTypeId="1" CreationDate="2015-05-16T09:01:35.967" Score="1" ViewCount="154" Body="&lt;p&gt;I am wondering what is the policy practiced by most exchanges from different market segments (FX, equities, futures, etc.) about the privacy implications of &lt;strong&gt;order identification&lt;/strong&gt; in their market data feed. Let me explain the two options here:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;For each order streamed in their market data feed, there will be an account ID field that, although not capable of identifying exactly the company/entity that placed the order, will certainly offer some information that some might argue it would rather be kept private.&lt;/li&gt;&#xA;&lt;li&gt;For each order streamed in their market data feed, there will be no account ID field of any kind.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;With option 1 the party receiving the feed is able to easily identify and filter its own orders from the market data feed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With option 2 the party is not able to easily identify and filter its own orders. Other more complicated procedures must be done by the party in order to accomplish that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Filtering your own orders is a desirable procedure for most parties since they would not want to act on their on liquidity. So my doubt is: &lt;strong&gt;do most exchanges choose to provide option 1 or option 2?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: This is most relevant for UDP multicast. For TCP, each party will have its own connection so it is trivial to provide this information without any privacy implications.&lt;/p&gt;&#xA;" OwnerUserId="11804" LastActivityDate="2015-05-16T09:01:35.967" Title="Filtering my own orders from a UDP multicast market data feed" Tags="&lt;exchange&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17824" PostTypeId="2" ParentId="17820" CreationDate="2015-05-16T17:10:38.450" Score="3" Body="&lt;p&gt;Depending on how you are processing the data it might be cheaper to create a simple web app and run this on Amazon or Google Web services. You get charged in ¢ per hour that way and can focus on improving the logic of your algorithms etc. Rather than upgrading your hardware. This way you have a speedy connection even a few milliseconds in delay can cost you throughout the course of a year.&lt;/p&gt;&#xA;" OwnerUserId="16252" LastActivityDate="2015-05-16T17:10:38.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17825" PostTypeId="1" AcceptedAnswerId="17832" CreationDate="2015-05-16T17:37:25.947" Score="10" ViewCount="7373" Body="&lt;p&gt;I have recently completed an MSc in Control Systems from a top university. It seems to me that control theory must have an application within quantitative finance. I would like to apply my degree within finance, but I want to be sure that it is relevant to the role of a quantitative analyst.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The topics which I have particular interest and experience in are State Space Control, Systems Identification, Model Predictive Control and Optimal Control. I imagine that effective management of finances must involve modelling of financial systems in terms of transfer functions/state space models (based on large sets of historical data). These models could then be used to predict the evolution of a market over time, and therefore optimise a given cost function such as profit, risk etc.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this kind of role exists within quantitative finance/ other areas, can you please give me more information/ ideas of job roles/ industries to research.&lt;/p&gt;&#xA;" OwnerUserId="16253" LastEditorUserId="2299" LastEditDate="2015-06-01T05:35:56.517" LastActivityDate="2015-06-01T05:35:56.517" Title="Application of Control Theory in Quantitative Finance" Tags="&lt;trading&gt;&lt;optimization&gt;&lt;portfolio-optimization&gt;&lt;stochastic-control&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="17826" PostTypeId="2" ParentId="17825" CreationDate="2015-05-16T17:53:13.717" Score="1" Body="&lt;p&gt;Actually, a lot of finance and economics are centered around optimal control problems. Traditionally, most economies are modeled as dynamic systems. In finance, portfolio optimizations, advanced option pricing etc are all optimal control problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could look at the book Non Linear Option Pricing, it has a lot of optimal control problems.&lt;/p&gt;&#xA;" OwnerUserId="13415" LastActivityDate="2015-05-16T17:53:13.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17827" PostTypeId="1" AcceptedAnswerId="17829" CreationDate="2015-05-16T18:22:21.313" Score="2" ViewCount="331" Body="&lt;p&gt;Let $W_{t}$ be a Brownian Motion.  Verify that variations of Brownian Motion of higher order, say, of order three, vanishes. I try to prove that $\lim_{n\rightarrow\infty}\sum^{n}_{i=1}(W_{t_{i}}-W_{t_{i-1}})^{3}=0$ but I have trouble continuing the step. Thank you! &lt;/p&gt;&#xA;" OwnerUserId="16126" LastActivityDate="2015-05-17T00:26:36.430" Title="Why Variations of order higher than two vanish for Brownian motion?" Tags="&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17828" PostTypeId="1" AcceptedAnswerId="17847" CreationDate="2015-05-16T20:38:30.673" Score="4" ViewCount="620" Body="&lt;p&gt;In Mandelbrot(1968)'s paper, the fractional brownian motion, denoted by $B_{H}(t,\omega)$,(t&gt;0) is defined by &#xA;$$B_{H}(0,\omega)=b_{0}$$&#xA;$$B_{H}(t,\omega)-B_{H}(0,\omega)=\frac{1}{\Gamma(H+\frac{1}{2})}\{\int^{0}_{-\infty}[(t-s)^{H-1/2}-(-s)^{H-1/2}]dB(s,\omega)+\int^{t}_{0}(t-s)^{H-1/2}dB(s,\omega)\}$$&#xA;I have difficulty understanding fractional brownian motion by self study.Is there an intuitive interpretation of this definition? Why time s can have negative value? Thanks! &lt;/p&gt;&#xA;" OwnerUserId="16126" LastEditorUserId="2587" LastEditDate="2015-05-18T10:22:49.443" LastActivityDate="2015-05-18T20:24:56.697" Title="Fractional Brownian motion" Tags="&lt;stochastic-processes&gt;&lt;brownian-motion&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17829" PostTypeId="2" ParentId="17827" CreationDate="2015-05-16T23:43:41.550" Score="1" Body="&lt;p&gt;I will assume that the convergence is in probability and the partition $\Pi_n$ is given by&#xA;\begin{align*}&#xA;0=t_0 &amp;lt; t_1 &amp;lt; \cdots &amp;lt; t_n = t.&#xA;\end{align*}&#xA;Note that&#xA;$$\mathbb{E}\big((W_{t_i}-W_{t_{i-1}})^3 \big)=0,$$ and $$\mathbb{E}\big((W_{t_i}-W_{t_{i-1}})^6 \big)=15(t_i-t_{i-1})^3.$$&#xA;Let $\|\Pi_n\| = \max_{i=1}^n|t_i-t_{i-1}|$.&#xA;Then, for any small $\delta&amp;gt;0$, by Chebyshev inequality,&#xA;\begin{align*}&#xA;\mathbb{P}\Big(\Big|\sum_{i=1}^n (W_{t_i}-W_{t_{i-1}})^3\Big| &amp;gt; \delta \Big)&amp;amp; \leq \frac{1}{\delta^2}\mathbb{E}\bigg(\Big( \sum_{i=1}^n (W_{t_i}-W_{t_{i-1}})^3\Big)^2\bigg)\\&#xA;&amp;amp;=\frac{1}{\delta^2}\mathbb{E}\bigg( \sum_{i,j=1}^n (W_{t_i}-W_{t_{i-1}})^3(W_{t_j}-W_{t_{j-1}})^3\bigg)\\&#xA;&amp;amp;=\frac{1}{\delta^2}\mathbb{E}\Big( \sum_{i=1}^n (W_{t_i}-W_{t_{i-1}})^6\Big)\\&#xA;&amp;amp;=\frac{15}{\delta^2}\sum_{i=1}^n (t_i-t_{i-1})^3\\&#xA;&amp;amp;\leq  \frac{15\, t}{\delta^2}\|\Pi_n\|^2.&#xA;\end{align*}&#xA;That is,&#xA;$$\lim_{n\rightarrow \infty} \mathbb{P}\Big(\Big|\sum_{i=1}^n (W_{t_i}-W_{t_{i-1}})^3\Big| &amp;gt; \delta \Big) = 0.$$&#xA;Therefore, for any $t&amp;gt;0$,&#xA;$$\lim_{n\rightarrow \infty} \sum_{i=1}^n (W_{t_i}-W_{t_{i-1}})^3 = 0$$&#xA;in probability.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-05-17T00:26:36.430" LastActivityDate="2015-05-17T00:26:36.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17830" PostTypeId="2" ParentId="17083" CreationDate="2015-05-17T00:14:35.467" Score="6" Body="&lt;p&gt;Let $T= \inf\{t&amp;gt;0: S_t = H\}$. Then the option payoff is given by&#xA;$\mathbb{1}_{\{T &amp;lt; \infty\}}$, and the value of the option is given by $\mathbb{P}(T&amp;lt; \infty)$. We assume that the stock price process is a geometric Brownian motion, that is, for $t&amp;gt;0$&#xA;$$ S_t = \exp\big(-\frac{1}{2}\sigma^2 t + \sigma W_t\big),$$&#xA;where $\{W_t, t \geq 0\}$ is a standard Brownian motion, and $\sigma$ is the volatility. Then, &#xA;\begin{align*}&#xA;S_t = H \Leftrightarrow -\frac{1}{2}\sigma t + W_t = \frac{1}{\sigma}\ln H.&#xA;\end{align*}&#xA;Let $\nu= -\frac{1}{2}\sigma$ and $y= \frac{1}{\sigma}\ln H$. It is well known that the density of $T$ is given by&#xA;\begin{align*}&#xA;f(t) = \frac{y}{\sqrt{2\pi t^3}}\exp\big(-\frac{1}{2t}(y-\nu t)^2\big)\mathbb{1}_{\{t \geq 0\}};&#xA;\end{align*}&#xA;see, for example, &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1852333766&quot; rel=&quot;nofollow&quot;&gt;&quot;Mathematical Methods for Financial Markets&quot;&lt;/a&gt; by Jeanblanc et. al. Then,&#xA;\begin{align*}&#xA;\mathbb{P}(T&amp;lt; \infty) &amp;amp;= e^{2 \nu y}\\&#xA;&amp;amp;= \frac{1}{H}.&#xA;\end{align*}&#xA;That is, $\frac{1}{H}$ is indeed the option price under the geometric Brownian motion stock price assumption.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-07-21T12:57:56.303" LastActivityDate="2015-07-21T12:57:56.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17831" PostTypeId="1" AcceptedAnswerId="17877" CreationDate="2015-05-17T05:41:49.417" Score="3" ViewCount="817" Body="&lt;p&gt;I am trying to get some intuition for the fact that a Black-Scholes price for an option is equal to the cost of replicating the option. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say the interest is 0. The option is obviously still worth something, which must be the cost of hedging the option. From what I have read, this cost comes from the fact that you always rebalance your portfolio &lt;em&gt;after&lt;/em&gt; the stock has moved, so you incur a small loss from &quot;buying high, selling low&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this is not completely clear when considering the fact that we are trading in continuous time and in a frictionless market. Does it mean that even in the limit, for infinitesimal time steps, the stock moves faster than the trading strategy?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In that case, which assumptions in the BS-model create this effect, and on the other hand what assumptions would make the cost of hedging equal 0?&lt;/p&gt;&#xA;" OwnerUserId="7555" LastEditorUserId="7555" LastEditDate="2015-05-19T09:44:32.270" LastActivityDate="2015-05-19T12:09:46.270" Title="The source of &quot;Cost of hedging&quot; in the Black Scholes model" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17832" PostTypeId="2" ParentId="17825" CreationDate="2015-05-17T08:51:21.630" Score="8" Body="&lt;p&gt;Of course, optimal control is at the core of math finance. Take few applications:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Option Pricing&lt;/strong&gt;: you have an exposure to a time dependent combination of market factors; you have some knowledge of their dynamics. They are partly deterministic, partly stochastic (i.e. random). At each &quot;&lt;em&gt;time step&lt;/em&gt;&quot; you can adjust your portfolio at a given cost. Your goal is to lower your risk. Of course it is a control program, see &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/3642100449&quot; rel=&quot;noreferrer&quot;&gt;Continuous-time Stochastic Control and Optimization with Financial Applications&lt;/a&gt;, by Huyen Pham, for examples (and &lt;a href=&quot;http://www1.ucam.ac.ma/itn-marrakech/School/PHAM.pdf&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt; for a summary by the same author).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Portfolio Construction&lt;/strong&gt;: you have a given amount of money to invest, you will build a portfolio with it. You have some expectations in terms of the dynamics of returns of the available investment instruments (stocks, bonds, etc) and estimated for the associated risk. Changing your allocation has a cost at each time step. Again it is a control program, see for instance &lt;a href=&quot;http://www.lse.ac.uk/fmg/events/capitalMarket/pdf/CMW64N_Garleanu.pdf&quot; rel=&quot;noreferrer&quot;&gt;Dynamic Portfolio Choice with Frictions&lt;/a&gt;, Garleanu and Pedersen.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Trading&lt;/strong&gt;: you have a large amount of stocks to buy or sell today. You have the whole day (around 8h) to do it, and you can take a decision every millisecond. The faster you go the more you move the market at your detriment, the slower you go the more your are exposed to a bad price change. It is nothing else than control again, see &lt;a href=&quot;http://www.worldscientific.com/worldscibooks/10.1142/8967&quot; rel=&quot;noreferrer&quot;&gt;Market Microstructure in Practice&lt;/a&gt;, by L and Laruelle. &lt;a href=&quot;http://ebooks.cambridge.org/chapter.jsf?bid=CBO9781139151184&amp;amp;cid=CBO9781139151184A175&amp;amp;tabName=Chapter&quot; rel=&quot;noreferrer&quot;&gt;Market Microstructure Knowledge Needed for Controlling an Intra-Day Trading Process&lt;/a&gt; for an overview (there is a preprint available &lt;a href=&quot;http://arxiv.org/abs/1302.4592&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2015-05-17T08:51:21.630" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17834" PostTypeId="1" AcceptedAnswerId="17846" CreationDate="2015-05-17T11:23:02.680" Score="1" ViewCount="227" Body="&lt;p&gt;In Martin Pring's book &quot;Technical analysis explained&quot;, when talking about volume, he asserts that it is &quot;a totally independent variable from price&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is this?&lt;/p&gt;&#xA;" OwnerUserId="6461" LastActivityDate="2015-05-18T17:43:27.170" Title="Why is volume a totally independent variable from price?" Tags="&lt;price&gt;&lt;volume&gt;&lt;technical-analysis&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17836" PostTypeId="2" ParentId="17083" CreationDate="2015-05-17T14:38:56.833" Score="1" Body="&lt;p&gt;Unfortunately I cannot upvote user2142's answer because I lack the reputation, but his reasoning makes sense to me: the price is $\$1/H$ because as the seller of the option you buy $1/H$ shares for the premium. You sell them when the $S_t$ hits $H$ to obtain the $\$1$ you have to pay to the option buyer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the price is model free for any model with &lt;em&gt;continuous&lt;/em&gt; $S_t$. If you assume that paths of $S_t$ &quot;typically&quot; contain &lt;em&gt;upward jumps&lt;/em&gt; it's less clear to me and I would expect the price to become model dependent.&lt;/p&gt;&#xA;" OwnerUserId="1739" LastActivityDate="2015-05-17T14:38:56.833" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="17837" PostTypeId="2" ParentId="17083" CreationDate="2015-05-17T15:01:14.233" Score="2" Body="&lt;p&gt;Important assumptions:&lt;br&gt;&#xA;- we have zero interest rate,&lt;br&gt;&#xA;- option is perpetual,&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;with probability 1, share price will hit the barrier $H$ (in fact this is a hidden assumption that price changes continuously or we can at least trade at the very moment when $S_t = H$).&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;No, we can't assume that, because , as @q.t.f noted, it would imply arbitrage. In fact with no arbitrage and zero interest rate we have that share price process $S_t$ is a martingale with respect to some &quot;arbitrage&quot; probability. Thus $\mathbb{E}(S_t) = S_0$ for all $t\geq 0$, and assuming $S_t$ is positive, by Doob's inequality $\mathbb{P}(\sup_t S_t &amp;gt; H) \leq \sup_t \mathbb{E}(S_t)/H = S_0/H$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;At time 0 you create zero-cost portfolio:&lt;br&gt;&#xA;- you buy 1 share at current price $S_0 = 1$,&lt;br&gt;&#xA;- you sell $1/C_0$ options each worth $C_0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the moment of exercise:&lt;br&gt;&#xA;- have to pay 1 for every $1/C_0$ option, which costs you $1/C_0$,&lt;br&gt;&#xA;- you can sell your share for $H$.&lt;br&gt;&#xA;This gives you $H - 1/C_0$, and be no arbitrage, this can't be be positive. Thus we have $H - 1/C_0 \leq 0 \iff H \leq 1/C_0 \iff C_0 \leq 1/H$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And in fact it is only a different presentation of arguments given in the question post. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now IMO this (and bound $C_0 \geq 0$, since option is no obligation) is all we can get by pure arbitrage arguments without any further assumptions. And again I agree with @q.t.f: price is model dependent and any price in the range $[0, 1/H]$ is possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us consider the following model: at time $t=1$ price either jumps up to $S^u = 3$ or falls down to $S^d = 1/2$. Let $H=2$. I claim that $C_0 = 1/5$, since this is the cost of replicating portfolio constructed with $2/5$ long shares and borrowed $1/5$ of cash.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This price is calculated as $C_0 = \frac{S_0 - S^d}{S^u - S^d}$, so letting $S^u \to \infty$, we can get as close to zero as we want. &lt;/p&gt;&#xA;" OwnerUserId="16260" LastEditorUserId="16260" LastEditDate="2015-05-22T13:55:14.427" LastActivityDate="2015-05-22T13:55:14.427" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17838" PostTypeId="2" ParentId="17002" CreationDate="2015-05-17T16:29:44.773" Score="5" Body="&lt;p&gt;While @Baruch Youssin answers correctly in the general sense, the first part of his answer isn't what happened in the example code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While QLNet is a port of QuantLib, it's not a direct port. Your quoted example doesn't show up in QLNet. The example in QuantLib was written in a very complicated way, in fact it's a simple example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;discountingTermStructure&lt;/em&gt; is simply a variable in the code. I can name it as something else. It links to &lt;em&gt;bondDiscountingTermStructure&lt;/em&gt;, a yield-curve derived by today's market quotes. The yield-curve is derived by zero-coupon-rates and fixed-rate bonds. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;     // Adding the ZC bonds to the curve for the short end&#xA;     bondInstruments.push_back(zc3m);&#xA;     bondInstruments.push_back(zc6m);&#xA;     bondInstruments.push_back(zc1y);&#xA;&#xA;     // Adding the Fixed rate bonds to the curve for the long end&#xA;     for (Size i=0; i&amp;lt;numberOfBonds; i++) {&#xA;         bondInstruments.push_back(bondsHelpers[i]);&#xA;     } &#xA;&#xA;     boost::shared_ptr&amp;lt;YieldTermStructure&amp;gt; bondDiscountingTermStructure(&#xA;             new PiecewiseYieldCurve&amp;lt;Discount,LogLinear&amp;gt;(&#xA;                     settlementDate, bondInstruments,&#xA;                     termStructureDayCounter,&#xA;                     tolerance));&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This curve can be used for discounting in bond pricing.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;     boost::shared_ptr&amp;lt;PricingEngine&amp;gt; bondEngine(&#xA;             new DiscountingBondEngine(discountingTermStructure));&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;DiscountingBondEngine would ask the underlying fixed-rate bond for the cash-flow amount. This amount would need to be discounted. The discount rate is supplied by the &lt;em&gt;discountingTermStructure&lt;/em&gt; yield-curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next, we'd want to price a floating-rate bond. It requires a forward curve. In particular, we need a forward curve of 3M USD LIBOR because the bond links to the 3M LIBOR index.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    FloatingRateBond floatingRateBond(&#xA;             settlementDays,&#xA;             faceAmount,&#xA;             floatingBondSchedule,&#xA;             libor3m,&#xA;             Actual360(),&#xA;             ModifiedFollowing,&#xA;             Natural(2),&#xA;             // Gearings&#xA;             std::vector&amp;lt;Real&amp;gt;(1, 1.0),&#xA;             // Spreads&#xA;             std::vector&amp;lt;Rate&amp;gt;(1, 0.001),&#xA;             // Caps&#xA;             std::vector&amp;lt;Rate&amp;gt;(),&#xA;             // Floors&#xA;             std::vector&amp;lt;Rate&amp;gt;(),&#xA;             // Fixing in arrears&#xA;             true,&#xA;             Real(100.0),&#xA;             Date(21, October, 2005));&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This forward curve bootstrapped by:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;     // A depo-swap curve&#xA;     std::vector&amp;lt;boost::shared_ptr&amp;lt;RateHelper&amp;gt; &amp;gt; depoSwapInstruments;&#xA;     depoSwapInstruments.push_back(d1w);&#xA;     depoSwapInstruments.push_back(d1m);&#xA;     depoSwapInstruments.push_back(d3m);&#xA;     depoSwapInstruments.push_back(d6m);&#xA;     depoSwapInstruments.push_back(d9m);&#xA;     depoSwapInstruments.push_back(d1y);&#xA;     depoSwapInstruments.push_back(s2y);&#xA;     depoSwapInstruments.push_back(s3y);&#xA;     depoSwapInstruments.push_back(s5y);&#xA;     depoSwapInstruments.push_back(s10y);&#xA;     depoSwapInstruments.push_back(s15y);&#xA;     boost::shared_ptr&amp;lt;YieldTermStructure&amp;gt; depoSwapTermStructure(&#xA;             new PiecewiseYieldCurve&amp;lt;Discount,LogLinear&amp;gt;(&#xA;                     settlementDate, depoSwapInstruments,&#xA;                     termStructureDayCounter,&#xA;                     tolerance));&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The relationship between zero rates and swap rates will tell us the forward rates.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2015-05-17T16:29:44.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17839" PostTypeId="1" CreationDate="2015-05-17T19:20:34.143" Score="5" ViewCount="434" Body="&lt;p&gt;Some notation: We consider a financial market with $d+1$ assets, the $0$-th asset is considered the risk-free asset, the others are the risky ones. The vector $\overline \pi \in \mathbb R^{d+1}$ denotes the pricing vectors, and the random vector $\overline S = (S^0,S^1,\ldots, S^d)$ denotes the vector of the random variables corresponding to the assets. Further we have $\pi^0 = 1, S^0 \equiv 1 + r$, as these are risk-free.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here a portfolio $\overline \xi \in \mathbb R^{d+1}$ is called an &lt;em&gt;arbitrage opportunity&lt;/em&gt; if $\overline \xi \cdot \overline \pi \le 0$ but $\overline \xi \cdot \overline S \ge 0$ P-a.s. and $P(\overline \xi \cdot \overline S &amp;gt; 0) &amp;gt; 0$. And the market model is called &lt;em&gt;non-redundant&lt;/em&gt; if&#xA;$$&#xA; \overline \xi \cdot \overline S = 0 ~\mbox{P-a.s.} \Rightarrow \overline \xi = 0&#xA;$$&#xA;i.e. non of the assets $S^i$ could be synthezied by investing in the others.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Show that in a non-redundant and arbitrage-free market model the set&#xA;  $$&#xA; \{ \overline \xi \in \mathbb R^{d+1} : | \overline \pi \cdot \overline \xi = w \mbox{ and } \overline \xi \cdot \overline S \ge 0 ~ \mbox{P-a.s.} \}&#xA;$$&#xA;  is compact for any $w &amp;gt; 0$.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;First, as this is a subset of the euclidean space $\mathbb R^{d+1}$, compactness is equivalent with bounded and closed. But already showing boundedness gives me a hard time, I do not see where to start?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I guess a non-redundant market model also implies that it is arbitrage-free, so the presupposition of just arbitrage-free'ness should be enough.&lt;/p&gt;&#xA;" OwnerUserId="16264" LastActivityDate="2015-05-17T19:20:34.143" Title="Show that in an arbitrage-free and non-redundant market a certain set is compact" Tags="&lt;arbitrage&gt;&lt;mathematics&gt;&lt;no-arbitrage-theory&gt;&lt;theory&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17840" PostTypeId="1" CreationDate="2015-05-17T19:50:13.040" Score="3" ViewCount="298" Body="&lt;p&gt;For a short volatility strategy using option strangles, is it better to target a fixed premium to earn? Or a fixed vega? Objective is to maximise the return/risk (sharpe) of the strategy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help is much appreciated.&lt;/p&gt;&#xA;" OwnerUserId="7161" LastActivityDate="2015-05-30T00:34:04.120" Title="Short volatility strategy using strangles" Tags="&lt;options&gt;&lt;quant-trading-strategies&gt;&lt;option-strategies&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17841" PostTypeId="1" AcceptedAnswerId="17843" CreationDate="2015-05-17T20:00:29.443" Score="3" ViewCount="1360" Body="&lt;p&gt;Consider Hull White model $dr(t)=[\theta(t)-\alpha(t)r(t)]dt+\sigma(t)dW(t)$&#xA;when we solve the SDE above we have $r(t)=e^{-\alpha t}r(0)+\frac{\theta}{\alpha}(1-e^{-\alpha t})+\sigma e^{-\alpha t}\int_{0}^{t}e^{\alpha u}dW(u) $ and when we take expectation and variance we have $r(t) \sim N(e^{-\alpha t}r(0)+\frac{\theta}{\alpha}(1-e^{-\alpha t}),\frac{\sigma^2}{2\alpha}(1-e^{-\alpha t}))$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know the calculate how find SDE and find expectation or variance but&#xA;I don't understand why $r(t)$ has normal distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks.&lt;/p&gt;&#xA;" OwnerUserId="13490" LastEditorUserId="2587" LastEditDate="2015-05-18T10:24:04.220" LastActivityDate="2019-11-26T19:19:12.557" Title="Why does the short rate in the Hull White model follow a normal distribution?" Tags="&lt;stochastic-processes&gt;&lt;finance&gt;&lt;stochastic-calculus&gt;&lt;hullwhite&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17843" PostTypeId="2" ParentId="17841" CreationDate="2015-05-17T21:51:41.063" Score="3" Body="&lt;p&gt;For simplicity, we assume that &lt;span class=&quot;math-container&quot;&gt;$\alpha$&lt;/span&gt; is a positive constant. You need to show that, for any &lt;span class=&quot;math-container&quot;&gt;$t&amp;gt;0$&lt;/span&gt;,&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}&#xA;M_t = \int_0^t e^{\alpha u} dW_u&#xA;\end{align*}&lt;/span&gt;&#xA;is normally distributed, where &lt;span class=&quot;math-container&quot;&gt;$\{W_t, \, t \ge 0\}$&lt;/span&gt; is a standard Brownian motion with respect to the filtration &lt;span class=&quot;math-container&quot;&gt;$\{\mathscr{F}_t,\, t \ge 0\}$&lt;/span&gt;.  Here, we employ the time-changed Brownian motion technique. For &lt;span class=&quot;math-container&quot;&gt;$t\ge 0$&lt;/span&gt;, let &lt;span class=&quot;math-container&quot;&gt;$\mathscr{G}_t = \mathscr{F}_{\frac{1}{2}\ln(1+2t)}$&lt;/span&gt;. Consider the process &lt;span class=&quot;math-container&quot;&gt;$X=\{X_t, t \geq 0\}$&lt;/span&gt;, where&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}&#xA;X_t = \int_0^{\frac{1}{2}\ln(1+2t)} e^{\alpha u} dW_u.&#xA;\end{align*}&lt;/span&gt;&#xA;Then &lt;span class=&quot;math-container&quot;&gt;$X$&lt;/span&gt; is a continuous martingale with respect to the filtration &lt;span class=&quot;math-container&quot;&gt;$\{\mathscr{G}_t,\, t \ge 0\}$&lt;/span&gt;. Moreover, &#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}&#xA;\langle X, X\rangle_t &amp;amp;= \langle M, M\rangle_{\frac{1}{2}\ln(1+2t)}\\&#xA;&amp;amp;=\int_0^{\frac{1}{2}\ln(1+2t)} e^{2u} du =t.&#xA;\end{align*}&lt;/span&gt;&#xA;By Levy's martingale characterization of Brownian motion, &lt;span class=&quot;math-container&quot;&gt;$\{X_t, t \ge 0\}$&lt;/span&gt; is a Brownian motion.  That is, for &lt;span class=&quot;math-container&quot;&gt;$t &amp;gt;0$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$X_t$&lt;/span&gt; is normally distributed. Consequently, for any &lt;span class=&quot;math-container&quot;&gt;$t &amp;gt;0$&lt;/span&gt;,&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}&#xA;M_t &amp;amp;= \int_0^t e^{\alpha u} dW_u\\&#xA;&amp;amp;=X_{\frac{1}{2}(e^{2t}-1 )}&#xA;\end{align*}&lt;/span&gt;&#xA;is normally distributed, and &lt;span class=&quot;math-container&quot;&gt;$r_t$&lt;/span&gt; is also normally distributed.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2019-11-26T19:19:12.557" LastActivityDate="2019-11-26T19:19:12.557" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="17844" PostTypeId="1" CreationDate="2015-05-17T22:03:26.817" Score="1" ViewCount="637" Body="&lt;p&gt;Is there a correct and up to date procedure? I just run the equation in VEC form and test the significance of the time trends? What are the possible problems that I should be aware of?&lt;/p&gt;&#xA;" OwnerUserId="6897" LastActivityDate="2015-05-20T20:25:24.453" Title="Cointegration tests: how do you accurately test the necessity of time trends in the Johansen and Engle-Granger Test?" Tags="&lt;time-series&gt;&lt;econometrics&gt;&lt;cointegration&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17846" PostTypeId="2" ParentId="17834" CreationDate="2015-05-18T04:37:19.643" Score="5" Body="&lt;p&gt;Pring was (probably) simply referring to the fact that most indicators are function of price -- lots of different ways to twist and contort prices to define trends, reversal points, etc. Volume is another parameter entirely, as it doesn't depend on price; the market or share price can have an up day on average, high, or low volume, it can have a down day on average, high, or low volume, it can have a sideways day on average, high, or low volume. Whether price and volume are parameterized on a common factor, as you suggest, is certainly a valid question, and indeed what a lot of technical analysis is based on -- trying to divine crowd sentiment and intentions from the &lt;em&gt;combination&lt;/em&gt; of price and volume.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More informed, certainly more thorough, insight was given by Mandelbrot. He noted that price change per &lt;em&gt;market time&lt;/em&gt; (i.e. per trade, although some use volume, but I'm not sure how thoroughly tested this is) tends to follow a normal distribution (Gaussian, although it should never be assumed so), while the number of trades per clock time tends to follow fat-tailed distributions, the result being very non-Gaussian distribution of prices as is normally assumed for simplicity. This does suggest some coupling of price movement (but &lt;em&gt;not&lt;/em&gt; direction) with number of trades, and possibly volume.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;References:&lt;br/&gt;&#xA;Mandelbrot, The (Mis)Behaviour of Markets&lt;br/&gt;&#xA;Mandelbrot, Fractals and Scaling in Finance&lt;br/&gt;&#xA;Kobeissi, Multifractal Financial Markets&lt;/p&gt;&#xA;" OwnerUserId="7174" LastActivityDate="2015-05-18T04:37:19.643" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17847" PostTypeId="2" ParentId="17828" CreationDate="2015-05-18T05:15:02.847" Score="3" Body="&lt;p&gt;The more phenomenological definitions in his books are probably more helpful. Whether one uses the fractal dimension, Hurst coefficient, or exponential coefficient alpha, there is a value that corresponds to pure Brownian motion, a regime relative to this value that corresponds to persistence of motion, and the opposite regime that corresponds to anti-persistence of motion. Mandelbrot's book The (Mis)behaviour of Markets gives several good examples.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Only the pure Brownian motion regime doesn't depend on the past. You don't define any variables, but I'd guess Mandelbrot is using the Hurst coefficient in the equation you give, where pure Brownian motion is H = 0.5. In this case the first integral gives 1 - 1, i.e. no dependence on the past (times leading up to time 0, i.e. &quot;negative&quot; time). For other cases (0 &amp;lt;= H &amp;lt;= 1, H != 0.5), the process leading up to time zero, and continuing on until time $t$, each incremental step in the process does depend on the previous steps.&lt;/p&gt;&#xA;" OwnerUserId="7174" LastActivityDate="2015-05-18T05:15:02.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17848" PostTypeId="2" ParentId="17828" CreationDate="2015-05-18T05:40:12.487" Score="6" Body="&lt;p&gt;For a Brownian motion, if you wait $dt$, the variance will grow linearly with (proportionally to) $dt$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a fractional Brownian motion, it will grow with a power law of $dt$, in fact in $dt^{H}$, where $H$ is the &lt;strong&gt;Hurst exponent&lt;/strong&gt;. See &lt;a href=&quot;http://en.m.wikipedia.org/wiki/Hurst_exponent&quot; rel=&quot;nofollow&quot;&gt;wikipedia&lt;/a&gt; for more details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It means the fBM will somehow keep &lt;strong&gt;memory&lt;/strong&gt; of the past. When $H$ is lower than 1/2, it will &lt;em&gt;mean revert&lt;/em&gt;, when it is greater than 1/2, it will be &lt;em&gt;superdiffusive&lt;/em&gt;. At $H$, it is a Brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This paper &lt;a href=&quot;http://arxiv.org/abs/1410.3394&quot; rel=&quot;nofollow&quot;&gt;Volatility is rough&lt;/a&gt; by Gatheral, Jasson and Rosenbaum gives a good idea of how to use properties of fBM in financial modelling.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2015-05-18T20:24:56.697" LastActivityDate="2015-05-18T20:24:56.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17849" PostTypeId="2" ParentId="17812" CreationDate="2015-05-18T05:46:55.793" Score="7" Body="&lt;p&gt;NN Taleb has some discussion of this in his book Dynamic Hedging. You'll find a lot of criticism of the book out in the aether, and there are certainly a good number of typos, but it is probably the least academic and most experience-based resource out there, and certainly worth considering. Augen is another big experience-based proponent of volatility (e.g. &quot;The Volatility Edge in Options Trading&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Putting the two together, with what you have given: your equation is simply calculating the simple moving average of the root-mean-square deviation (RMSD) from zero of returns, and expressing it as annualized volatility (based on the assumption of a Gaussian distribution). Firstly, it's not clear if you're using simple returns or log-returns. Both Taleb and Augen urge the use of log returns. Augen uses the RMSD from the average, Taleb advocates just using zero as you have. Augen uses the simple average as you have, Taleb also suggests an exponential moving average. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;All of the above are variations on the theme of time-averaging. In contrast, Taleb also suggests the Garman-Klass estimator, which uses only a single day's common price details: &lt;em&gt;O&lt;/em&gt;pen, &lt;em&gt;H&lt;/em&gt;igh, &lt;em&gt;L&lt;/em&gt;ow, &lt;em&gt;C&lt;/em&gt;lose:&#xA;$$&#xA;\sigma_{GK} = \left\{\frac{1}{2}\left[\ln\left(\frac{H}{L}\right)\right]^2 - (2\ln2 - 1)\left[\ln\left(\frac{C}{O}\right)\right]^2\right\}&#xA;$$&#xA;Note that this equation is different to his; it's the one I use that I believe corrects the typos/mistakes.&lt;/p&gt;&#xA;" OwnerUserId="7174" LastActivityDate="2015-05-18T05:46:55.793" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17851" PostTypeId="1" AcceptedAnswerId="17855" CreationDate="2015-05-18T10:39:50.693" Score="1" ViewCount="799" Body="&lt;p&gt;I am trying to find the correlation between wins and losses by applying Z-Score according to formula attached below. I put them in an array by assigning 1 to wins and -1s to losers.  I am trying to determine if winners follow winners or losers follow losers. &lt;strong&gt;What I wanna ask is before applying Z-Score into this should I remove non-streaks from this array?&lt;/strong&gt; (When I include non-streaks I find Z-Score -125 which is not a logical number)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;my array=[1,1,-1,1,-1,1,1,1,1,1,-1,1,-1,1...] &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The formula of the z-score is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Z=(N*(R-0.5)-P)/((P*(P-N))/(N-1))^(1/2)&#xA;&#xA;N - total number of trades in a series &#xA;R - total number of series of profitable and losing trades &#xA;P = 2*W*L;&#xA;W - total number of profitable trades in the series;&#xA;L - total number of losing trades in the series.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;a href=&quot;http://www.forextraders.com/forex-money-management/using-the-z-score-to-determine-trade-size.html&quot; rel=&quot;nofollow&quot;&gt;http://www.forextraders.com/forex-money-management/using-the-z-score-to-determine-trade-size.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15960" LastActivityDate="2015-05-18T15:12:22.223" Title="Z-Score calculation for a win-loss streak" Tags="&lt;trading-systems&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17852" PostTypeId="2" ParentId="17834" CreationDate="2015-05-18T10:40:08.293" Score="0" Body="&lt;p&gt;So lets test if volume and price are independent. We can estimate this by using mutual information. When x and y are independent, their mutual information is 0 so measures of mutual information entropy should be zero. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets calculate this for the IBM case with 10 years of daily closing price and data volumen.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;library(infotheo)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a&amp;lt;-c(186.76,186.22,183.9,182.21,185.81,186.81,184.71,187.9,186.67,188.25,195.04,192.62,189.83,190.45,192.49,194.5,193.55,192.69,191.77,194.52,193.29,196.64,195.68,195.19,197.77,197.02,196.4,190.01,192.27,192.15,191.73,190.22,189.63,193.14,195.11,196.47,193.53,191.44,191.26,190.03,189.3,188.91,190.08,192.57,192.19,188.72,186.46,187.06,187,184.89,186.39,185.68,185.94,184.78,183.08,183.76,184.36,185.69,184.37,184.51,185.98,186.37,186.22,184.29,182.25,181.22,182.56,182.35,182.26,183.6,182.82,181.55,182.14,180.88,180.72,180.37,181.71,181.27,186.35,188.39,188.53,188.04,187.22,188.42,187.7,188,189.86,188.49,192.36,192.49,192.5,190.85,194.09,193.63,195.24,194.4,195.78,194.57,194,191.67,189.15,189.64,187.1,185.97,184.3,186.63,187.47,187.34,187.95,187.88,187.38,189.36,190.07,190.1,191.23,190.41,191.16,192.99,192.25,192,192.3,191.56,191.95,190.68,191.2,190.14,189.99,191.54,191.72,191.28,191.81,192.96,192.8,193.75,194,193.11,191.62,192.31,189.01,190.06,189.64,189.83,187.17,186.91,188.67,189.04,185.71,189.36,186.42,185.93,183.52,183.8,181.75,179.84,182.05,169.1,163.23,161.79,162.18,162.08,161.87,163.6,163.46,164.35,164.4,164.36,162.65,161.82,161.46,162.07,163.49,163.3,161.92,162.79,164.16,164.16,161.89,161.43,160.64,160.92,162.15,161.76,161.95,162.17,161.54,162.67,164.52,164.05,163.27,161.86,162.99,160.51,161.07,155.38,153.06,151.41,151.93,157.68,158.51,161.44,162.24,161.82,162.34,160.51,160.05,160.44,162.06,159.51,156.07,155.05,158.42,159.11,156.44,156.81,155.8,154.57,157.14,156.95,152.09,155.39,155.87,156.36,153.67,151.55,155.48,153.31,154.66,158.47,156.96,157.91,156.72,155.75,158.56,158.2,158.52,160.4,160.96,162.19,163.89,163.65,162.91,164.83,162.81,160.87,161.94,160.48,161.03,159.42,161.18,158.5,160.77,157.81,156.8,157.98,154.28,157.08,156.96,159.81,159.81,162.88,164.63,163,159.2,160.59,160.4,162.67,160.5,159.18,160.45,162.04,162.07,161.85,162.34,162.86,162.38,162.3,164.13,163.13,160.67,166.16,164.26,165.36,170.24,169.78,170.73,173.92,174.4,171.29,173.67,173.97,173.08,170.05,170.99,172.68,171.12,170.55,172.28,174.05,173.26) &#xA;b&amp;lt;-c(4229458,4833043,4912569,5479729,4938122,3959058,4319687,5059611,12535240,5738487,10902080,6851710,6749697,5193721,8537265,5394135,4923642,4074541,6089856,6740548,5112029,5480087,8417865,4834989,5431064,5351281,8467967,11248880,5419311,3878576,4735761,4407111,3871007,5632139,4626270,4206079,3673954,3049853,2222041,3186237,3817452,2431943,2261646,3777411,2226577,5251499,4202156,3946049,3270670,3023761,2984907,2215309,2562907,4793716,3721398,2759903,4620386,3200540,2515006,2375817,2852248,3296692,2728403,4138348,4061486,4425086,2773423,3538718,2445357,3925158,3551005,10686760,3231689,3875358,2762820,3258470,4575380,4223820,6643078,5092954,2422363,2958707,3135115,3309559,3177816,2402540,4501073,4858779,7811181,8827453,8165628,4154446,4851325,3584165,3503667,3376430,3242107,3264124,3943779,4207339,5178022,2125035,3307945,3847041,2708590,2781486,2527208,1858635,1794941,1929422,2814815,2418687,2038470,2177642,2496475,1940334,1723557,3158767,2190185,1503582,2909422,2679529,1822765,2864944,2260202,2524233,2390391,2763994,2297955,2900953,2456411,2561528,3126159,2963346,8847306,3288454,3300715,3082583,4151355,2493862,2336317,2870283,3705432,2281749,3071521,2099525,2990954,2982451,2625359,5090174,3596738,3924621,6895843,5578469,4350238,23393800,20947830,11084830,7599154,6652126,4989112,7894973,4738734,3895869,5817961,4683808,4241264,4102438,4067487,3491874,4956409,3534400,3377542,3239343,4974605,4795042,5410056,3801179,4182186,4076193,6615896,4062338,3966022,2405512,4165523,3465647,6432090,3860288,3013455,2851383,3865355,4081495,3987625,8603486,6489279,6781567,5135799,7289467,8863708,4671176,4044120,1869977,1912278,3328597,2820875,4007568,5521275,4877949,6140885,4694891,4240432,4485123,4185540,4376654,4679570,4251472,5755866,8368458,11891690,6118450,4830128,7887907,5659328,4493190,8312100,6563442,4711986,5536804,3676106,5253628,3256440,2981444,4440579,3626629,3331904,3706909,2892929,4358252,3504269,3346955,2712218,4048109,4003088,7107766,4403866,5910972,3234006,3633335,3787426,4538724,5193874,4600260,5709280,4566291,6057170,3749638,3311792,5737794,3871119,9001842,5929727,4331090,5428222,4391017,3477801,4137986,4254808,3694519,4671478,3465581,3147566,2521583,2263480,2511035,3868071,2716418,3495848,3130813,4308880,9572126,9681557,4022236,8226707,3887859,3166588,5814978,4515143,5058348,3311743,4023794,3593415,3610295,2472627,3092479,2657123,2954387,2457170,2438669,2916087)&#xA;&#xA;c&amp;lt;-data.frame(a,b)&#xA;d&amp;lt;-discretize( c, disc=&quot;equalfreq&quot;, nbins=NROW(c)^(1/3) )&#xA;mutinformation(d[,1],d[,2], method= &quot;shrink&quot;)&#xA;0.09123699&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can see that the two variables are not totally independent in the case of IBM and I guess this is the same case for all securities. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can calculate if there is causality of one time series causing the other and viceversa via granger causality, however this needs the data to be stationary.  &lt;/p&gt;&#xA;" OwnerUserId="7616" LastEditorUserId="7616" LastEditDate="2015-05-18T17:43:27.170" LastActivityDate="2015-05-18T17:43:27.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17853" PostTypeId="2" ParentId="17825" CreationDate="2015-05-18T11:08:30.407" Score="3" Body="&lt;p&gt;The problem of when to exercise an option with Bermudan features is an optimal stopping problem. I have a done a lot of work on how to do these things when the state space is high dimensional. There are various more complicated problems where the contract is more difficult eg swing options. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-05-18T11:08:30.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17854" PostTypeId="1" CreationDate="2015-05-18T13:55:59.250" Score="11" ViewCount="570" Body="&lt;p&gt;I know how to compute VaR with long positions using PerformanceAnalytics. What about a portfolio consisting in two equities A and B, 100 USD long positions in each, and 2 stock options for the same equities A and B, 100 USD worth protection short positions in each, delta-neutral.&lt;/p&gt;&#xA;" OwnerUserId="16271" LastEditorUserId="7202" LastEditDate="2015-05-18T20:05:48.203" LastActivityDate="2015-05-18T20:05:48.203" Title="Computing Value at Risk for portfolio in R" Tags="&lt;portfolio-management&gt;&lt;r&gt;&lt;var&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17855" PostTypeId="2" ParentId="17851" CreationDate="2015-05-18T15:12:22.223" Score="1" Body="&lt;p&gt;Your source is not particularly clear about why what they're doing is a Z-score. To give some background, what they're doing is calculating $$\frac{R-\mu_{R}}{\sigma_{R}}$$ where R is the number of runs and the mean and standard deviation are of the number of runs. It's really more of a test statistic than a Z-score per se. The denominator in their formula is actually the same standard deviation as is used in the Wald-Wolfowitz runs test but divided by $N$ (which cancels out from the mean). While I get a slightly different result if I calculate the Z-score solely using the Wald-Wolfowitz values for the mean of runs, it is conceptually the same thing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So back to your question, you're asking if you should remove the streaks from your array before calculating the value. I would emphasize that you should not. The point of the runs test is to test the number of runs. If you remove everything that is not a run, then your test statistic is no longer valid. If you are not getting sensible numbers, there could be an issue with the calculation somewhere. I was getting perfectly sensible numbers when I was testing this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The benefit of the original approach is that it is very easy to calculate. There are some other options that might be a little more sophisticated and could provide some interesting information. For instance, you could fit a Hidden Markov Model (HMM) that tries to estimate the probability of a win given whether the previous period was a win or not. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2015-05-18T15:12:22.223" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17856" PostTypeId="1" AcceptedAnswerId="17865" CreationDate="2015-05-18T15:46:11.533" Score="9" ViewCount="418" Body="&lt;p&gt;I don't understand why the iTraxx indices family, which are credit default swap indices, are in practice often used to gauge the bond market. How are CDS prices related to bonds prices?&#xA;And what other index would be a good one for the global bond market ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for your help&lt;/p&gt;&#xA;" OwnerUserId="15650" LastEditorUserId="15650" LastEditDate="2016-02-08T11:36:56.067" LastActivityDate="2016-02-09T17:43:10.363" Title="Why can CDS indices be used as a bond market index?" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;index&gt;&lt;cds&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17858" PostTypeId="1" CreationDate="2015-05-18T17:28:03.753" Score="-3" ViewCount="686" Body="&lt;p&gt;I have the solution as given &lt;img src=&quot;https://i.stack.imgur.com/sNX6c.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on this, I have to show that this solves the Black-Scholes formula&#xA;&lt;img src=&quot;https://i.stack.imgur.com/6LCNW.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It means that I should take the partial derivatives of the solution above and then receive the differential equation of Black-Scholes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone can give me an intuition how should I do that? Should I use Ito's lemma to compute the derivatives?&lt;/p&gt;&#xA;" OwnerUserId="13582" LastActivityDate="2015-05-20T17:22:53.283" Title="Show that the equation solves the Black-Scholes PDE" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;black-scholes-pde&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17859" PostTypeId="1" AcceptedAnswerId="17862" CreationDate="2015-05-18T17:41:37.687" Score="21" ViewCount="9087" Body="&lt;p&gt;In Dupire's local volatility model, the volatility is is a deterministic function of the underlying price and time, chosen to match observed European option prices. &#xA;To be more specific, given a smooth surface $(K,T)\mapsto C(K,T)$ where K is the strike and T is time to maturity. Dupire equation implies that there exits an unique continuous function $\sigma_{loc}$ defined by &#xA;$$\sigma_{loc}^{2}(K,T)=\frac{\partial_{T}C(K,T)+rK\partial_{K}C(K,T)}{\frac{1}{2}K^{2}\partial_{KK}C(K,T)}$$ for all $(K,T)\in(0,\infty)\times(0,\infty)$ such that the solution to the stochastic differential equation $dS_{t}/S_{t}=rdt+\sigma(t,S_{t})dW_{t}$ exactly generates the European call option prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What do the dynamics of the local volatility mean? Are dynamics equivalent to the volatility surface? Why the dynamics of local volatility model is highly unrealistic?&lt;/p&gt;&#xA;" OwnerUserId="16126" LastActivityDate="2016-11-17T20:37:18.053" Title="Why dynamics of local volatility is wrong?" Tags="&lt;local-volatility&gt;&lt;dynamic&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="18" ContentLicense="CC BY-SA 3.0" />
  <row Id="17860" PostTypeId="2" ParentId="17858" CreationDate="2015-05-18T19:59:23.267" Score="3" Body="&lt;p&gt;The above equation is the price of a call option. It has nothing stochastic inside it. It only depends on the current price and the time. So no Ito is needed. &#xA;You should just compute the derivatives of your solution v (like you do for any deterministic multivariable function), plug them into the PDE and verify that it's satisfied. &lt;/p&gt;&#xA;" OwnerUserId="16272" LastActivityDate="2015-05-18T19:59:23.267" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17861" PostTypeId="2" ParentId="17859" CreationDate="2015-05-18T20:46:14.827" Score="6" Body="&lt;p&gt;Here &quot;dynamics&quot; means the assumed future behaviour of the spot process, namely that it follows the SDE&#xA;$$ dS/S = r dt + \sigma_{loc}(S,t) dW_t .$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are various ways to see that these dynamics are unrealistic.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One is to look for time homogeneity.  In normal cases, you expect the market to follow the same rules in one week and in one year from today.  But inevitably a local volatility model will be calibrated to have more steeply increasing $\sigma_{loc}(K,T)$ as a function of $K$ when $T$ is small compared to when $T$ is large.  This non-homogeniety of the calibrated model reflects a mismatch between the model and reality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another is to look at the model calibrated to subsequent days' option prices.  If the model is right, the recalibrated $\tilde{\sigma}_{loc}$ is obtained from $\sigma_{loc}$ by translation.  In practice that does not hold.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A third is to study hedge performance of vanilla options.  According to the local volatility model, continuous time delta hedging can exactly replicate any option payoff.  In practice there are hedging errors, and backtesting will show they are significant for the local volatility model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, one can look at exotic option prices.  For an example, the local volatility model tends to significantly underestimate the fair value of a double-no-touch option with symmetric barrier levels around the current spot and moderate (10-20%) probability of paying off.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2015-05-18T20:46:14.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17862" PostTypeId="2" ParentId="17859" CreationDate="2015-05-18T20:53:07.777" Score="25" Body="&lt;p&gt;A general model (with continuous paths) can be written &#xA;$$&#xA;  \frac{dS_t}{S_t} = r_t dt + \sigma_t dW_t^S&#xA;$$&#xA;where the short rate $r_t$ and spot volatility $\sigma_t$ are stochastic processes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the Black-Scholes model both $r$ and $\sigma$ are deterministic functions of time (even constant in the original model). This produces a flat smile for any expiry $T$. And we have the closed form formula for option prices &#xA;$$&#xA;  C(t,S;T,K) = BS(S,T-t,K;\Sigma(T,K)) &#xA;$$&#xA;where $BS$ is the BS formula and $\Sigma(T,K) = \sqrt{\frac{1}{T-t}\int_t^T \sigma(s)^2 ds}$. This is not consistent with the smile observed on the market. In order to match market prices, one needs to use a different volatility for each expiry and strike. This is the implied volatility surface $(T,K) \mapsto \Sigma(T,K)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the local volatility model, rates are deterministic, instant volatility is stochastic but there is only one source of randomness &#xA;$$&#xA;  \frac{dS_t}{S_t} = r(t) dt + \sigma_{Dup}(t,S_t) dW_t^S&#xA;$$&#xA;this is a special case of the general model with &#xA;$$&#xA;  d\sigma_t = (\partial_t \sigma_{Dup}(t,S_t) + r(t)S_t\partial_S\sigma_{Dup}(t,S_t) + \frac{1}{2}S_t^2\partial_S^2\sigma_{Dup}(t,S_t)) dt + \frac{1}{2}S_t\partial_S\sigma_{Dup}(t,S_t)^2 dW_t^S &#xA;$$&#xA;What is appealing with this model is that the function $\sigma_{Dup}$ can be perfectly calibrated to match all market vanilla prices (and quite easily too). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that while correlated to the spot, statistical study show that the volatility also has its own source of randomness independent of that of the spot. Mathematically, this means the instant correlation between the spot and vol is not 1 contrary to what happens in the local volatility model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be seen in several ways:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The forward smile. Forward implied volatility is implied from prices of forward start options: ignoring interest rates, &#xA;$$&#xA;  C(t,S;T\to T+\theta,K) := E^Q[(\frac{S_{T+\theta}}{S_{T}}-K)_+] =: C_{BS}(S=1,\theta,K;\Sigma(t,S;T\to T+\theta,K))&#xA;$$&#xA;Alternatively, it is sometimes defined as the expectation of implied volatility at a forward date. In a LV model, as the maturity $T$ increases but $\theta$ is kept constant, the forward smile gets flatter and higher. This is not what we observe in the markets where the forward smile tends to be similar to the current smile.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This is because the initial smile you calibrate the model too has decreasing skew: &#xA;$$&#xA;\partial_K \Sigma(0,S;T,K) \xrightarrow[T\to +\infty]{} 0&#xA;$$ &lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;Smile rolling. In a LV model, smile tends to move in the opposite direction of the spot and get higher independently of the direction of the spot.&#xA;This is not consistent with what is observed on markets. See Hagan and al. Managing Smile Risk for the derivation. This means that &#xA;$\partial_S \Sigma_{LV}(t,S;T,K)$ often has the wrong sign so your Delta will be wrong which can lead to a higher hedging error than using BS. &lt;/li&gt;&#xA;&lt;li&gt;Barrier options. In FX markets, barrier options like Double No Touch are liquid but a LV model calibrated to vanilla prices does not reproduce these prices. This is a consequence of the previous point.   &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The LV model is a static model. Its whole dynamic comes from the volatility surface at time 0. But the vol surface has a dynamic that is richer than that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are alternatives using multiple factors like SV models, LSV models (parametric local vol like SABR or fully non parametric local vol), models of the joint dynamic of the spot and vol surface etc... but the LV model remains the default model in many cases due to its simplicity, its ability to calibrate the initial smile perfectly and its numerical efficiency.     &lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2016-11-17T20:37:18.053" LastActivityDate="2016-11-17T20:37:18.053" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17863" PostTypeId="2" ParentId="17841" CreationDate="2015-05-18T21:15:07.927" Score="4" Body="&lt;p&gt;This is a special case of the question of why &#xA;$$ \int_0^T f(t) dW_t $$&#xA;is normally distributed for a continuous function $f(t).$  This Ito integral can be approximated by a sum&#xA;$$ \sum_{i=0}^{N-1} f(i T/N) (W_{(i+1)T/N} - W_{i T/N}) .$$&#xA;The Brownian increments $(W_{(i+1)T/N} - W_{i T/N})$ are independent normally distributed random variables.  The key point is that the sum of independent normally distributed variables is again normally distributed.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2015-05-18T21:15:07.927" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17864" PostTypeId="1" CreationDate="2015-05-19T00:11:02.633" Score="4" ViewCount="9165" Body="&lt;p&gt;I have a basic question for which I feel like I should have found the answer by googling it, but I didn't get a definitive answer, so here I am: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can the time value for a plain vanilla (European) option be negative? I've read it can be (without an satisfactory explanation), while my professor said it cannot, not even for deep-in-the-money options and now I'm confused. Could someone please explain this to me? &lt;/p&gt;&#xA;" OwnerUserId="16218" LastActivityDate="2018-11-12T23:20:42.750" Title="Negative time value european options" Tags="&lt;options&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17865" PostTypeId="2" ParentId="17856" CreationDate="2015-05-19T00:33:01.027" Score="10" Body="&lt;p&gt;It is helpful to think of the yield $r_b$ of a risky bond (say a corporate) in your country as the yield of the risk-free government bond $r_f$ plus a &quot;spread&quot; $r_s$  ($r_b = r_f + r_s$). This extra spread is the extra yield that the market needs to be paid to purchase the corporate bond instead of buying an equivalent amount of risk-less bonds.  In other words $r_s$ the (annualized) rate needed to pay someone to take the risk on losing their money if that particular bond defaults.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a &lt;a href=&quot;https://en.wikipedia.org/wiki/Credit_default_swap&quot; rel=&quot;nofollow&quot;&gt;credit default swap&lt;/a&gt; the protection buyer generally pays a annualized rate &lt;a href=&quot;https://www.markit.com/cds/most_liquid/markit_liquid.shtml&quot; rel=&quot;nofollow&quot;&gt;$r_{cds}$&lt;/a&gt; to the protection seller and the protection seller pays the buyer if a bond (like the corporate bond above) defaults.  In particular the amount the seller pays is designed to be fairly close to what an owner of the corporate bond would lose if the bond were to default.  So, buying protection using CDS is like having insurance on a bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if you had perfect insurance on a domestic corporate bond then it is a risk-free bond.  So, the risk-free rate should be the bond rate minus the cost of insurance ($r_f \approx r_b - r_{cds}$) or spread due to risk should be approximately the cds rate ($r_s \approx r_{cds}$).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a metric ton of messy details here, especially for &lt;a href=&quot;https://en.wikipedia.org/wiki/Credit_default_swap_index&quot; rel=&quot;nofollow&quot;&gt;cds indices&lt;/a&gt; which are not weighted indices like a stock/bond index, but this gets the main relationship across.  Essentially, a risky bond index like &lt;a href=&quot;https://index.barcap.com/Benchmark_Indices/Aggregate/Bond_Indices&quot; rel=&quot;nofollow&quot;&gt;Barclays Bond Indicies&lt;/a&gt; will change both if the risk-free rate changes and also when the &quot;average&quot; default risk changes for those bonds. A CDS index changes (mostly) on just that default risk part.&lt;/p&gt;&#xA;" OwnerUserId="5689" LastEditorUserId="5689" LastEditDate="2016-02-09T17:43:10.363" LastActivityDate="2016-02-09T17:43:10.363" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17866" PostTypeId="2" ParentId="17864" CreationDate="2015-05-19T01:55:29.157" Score="4" Body="&lt;p&gt;I don't know where you would have read that, but no, time value cannot be negative.  Time value is option value minus intrinsic value.  Intrinsic value is a model-imdependent no-arbitrage bound on option value. For an out-of-the-money payoff, intrinsic value is zero, and since the call or put payoff is non-negative this is a clear lower bound.  For an in-the-money payoff, intrinsic value is $\pm e^{-r T}(F-K)$ where $F$ is the forward, $r$ the risk-free rate, $K$ the strike, and $T$ the maturity, with $+$ for a call and $-$ for a put. This is the price of a forward struck at $K$, which has a payoff less-or-equal to the corresponding option payoff.  So negative time value would mean option price below the intrinsic value, which means one could buy the option, hedge with the forward (if in the money) and have an arbitrage: initial cost negative but final payoff non-negative.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2015-05-19T01:55:29.157" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17868" PostTypeId="1" AcceptedAnswerId="17879" CreationDate="2015-05-19T05:59:21.983" Score="5" ViewCount="790" Body="&lt;p&gt;I want to show that: if $σ$ is positive then there is no arbitrage in the model, even if $r &amp;gt; µ$. Whilst I have satisfied this for $ r &amp;gt; \mu$, I cannot see why the conditioning on $\sigma&amp;gt;0 $ is necessary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given:&#xA;$S_0 = 1$, $B_t$ = Brownian motion and $S_t$ = stock price&#xA;And our Black-scholes model:&#xA;$$dS_t = \mu S_t dt + \sigma S_t dB_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then this model is arbitrage free if there is some Equivalent Martingale Measure $\mathbb{Q}$ such that $S_t e^{-rt}$ is a martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So why do we require that $\sigma &amp;gt; 0$ for this to be arbitrage free?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution to BSM:&#xA;$$S_T = S_0 e^{(r - \frac{1}{2}\sigma^2)T + B_T}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now to discount it, let $X_t = S_T e^{-rT}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So $$X_t = e^{(\mu - \frac{\sigma^2}{2} - r)T + \sigma(B_t)}$$&#xA;So we need to show $X_t$ is EMM under $\mathbb{Q}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dX_t = \sigma S_t e^{-rt}( \frac{\mu - r}{\sigma}dt + dB_t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then by Girsanov's theorem with $c = \frac{\mu - r}{\sigma}$, There's $\mathbb{Q}$ such that $ct + B_t = \hat B_t$ is a Brownian motion &lt;strong&gt;(is this called brownian motion with drift?)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gives:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X_t = X_0 e^{\sigma \hat B_t - \frac{1}{2}\sigma^2t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And this is an exponential martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BUT, why does this rely on $$\sigma &amp;gt;0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is clear that $X_t$ is independent of $r$ and $\mu$ so that's why the case of $r &amp;gt;\mu$ doesn't effect us.&lt;/p&gt;&#xA;" OwnerUserId="16184" LastEditorUserId="16184" LastEditDate="2015-05-19T06:05:40.523" LastActivityDate="2019-01-30T23:23:45.283" Title="Why is the black-scholes model arbitrage free when σ&gt;0?" Tags="&lt;black-scholes&gt;&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;&lt;martingale&gt;&lt;black-scholes-merton&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17869" PostTypeId="1" CreationDate="2015-05-19T07:01:05.907" Score="3" ViewCount="975" Body="&lt;p&gt;Can you reccomend model for high frequency data (1 second and less) (returns and volatility forecasting)?&#xA;Most papers use ARMA, GARCH etc in 1 minute and lower time frame.&#xA;PROBLEM ARMA does not know nothing about order imbalance and order flow correlation so i looking for model which can combine order book and time series forecasting model.&#xA;&lt;a href=&quot;https://www.olseninvest.com/customer/pdf/paper/020221-efficientVolEstimator.pdf&quot; rel=&quot;nofollow&quot;&gt;Efficient estimation of volatility Zumbach 2002&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.econ.mq.edu.au/Econ_docs/research_seminars/2008_research_seminars/Petko_Kalev.pdf&quot; rel=&quot;nofollow&quot;&gt;Order Book Slope and Price Volatility ,  Petko Kalev&lt;/a&gt;&#xA;EGARCH aproach. Anybody used it ?Or know something better? What do you use?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know there are a lot or papers and question already about volatility/But just want to know expert opinion what to choose for high frequency?&lt;/p&gt;&#xA;" OwnerUserId="3392" LastEditorUserId="3392" LastEditDate="2015-05-19T07:19:28.603" LastActivityDate="2015-11-27T03:14:39.203" Title="High frequency price forecast model ARMA GARCH or another?" Tags="&lt;volatility&gt;&lt;time-series&gt;&lt;high-frequency&gt;&lt;garch&gt;&lt;market-microstructure&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17870" PostTypeId="1" AcceptedAnswerId="18026" CreationDate="2015-05-19T07:36:54.110" Score="69" ViewCount="29917" Body="&lt;p&gt;I know the title sounds a little extreme but I wonder whether R is phased out by a lot of quant desks at sell side banks as well as hedge funds in favor of Python. I get the impression that with improvements in Pandas, Numpy and other Python packages functionality in Python is drastically improving in order to meaningfully mine data and model time series. I have also seen quite impressive implementations through Python to parallelize code and fan out computations to several servers/machines. I know some packages in R are capable of that too but I just sense that the current momentum favors Python. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need to make a decision regarding architecture of a subset of my modeling framework myself and need some input what the current sentiment is by other quants. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also have to admit that my initial reservations regarding performance via Python are mostly outdated because some of the packages make heavy use of C implementations under the hood and I have seen implementations that clearly outperform even efficiently written, compiled OOP language code. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you please comment on what you are using? I am not asking for opinions whether you think one is better or worse for below tasks but specifically why you use R or Python and whether you even place them in the same category to accomplish, among others, the following tasks:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;acquire, store, maintain, read, clean time series&lt;/li&gt;&#xA;&lt;li&gt;perform basic statistics on time series, advanced statistical models such as multivariate regression analyses,...&lt;/li&gt;&#xA;&lt;li&gt;performing mathematical computations (fourier transforms, PDE solver, PCA, ...)&lt;/li&gt;&#xA;&lt;li&gt;visualization of data (static and dynamic)&lt;/li&gt;&#xA;&lt;li&gt;pricing derivatives (application of pricing models such as interest rate models)&lt;/li&gt;&#xA;&lt;li&gt;interconnectivity (with Excel, servers, UI, ...)&lt;/li&gt;&#xA;&lt;li&gt;(Added Jan 2016): Ability to design, implement, and train deep learning networks. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&#xA;I thought the following link might add more value though its slightly dated [2013] (for some obscure reason that discussion was also closed...): &lt;a href=&quot;https://softwareengineering.stackexchange.com/questions/181342/r-vs-python-for-data-analysis&quot;&gt;https://softwareengineering.stackexchange.com/questions/181342/r-vs-python-for-data-analysis&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also search for several posts on the r-bloggers website that address computational efficiency between R and Python packages. As was addressed in some of the answers, one aspect is data pruning, the preparation and setup of input data. Another part of the equation is the computational efficiency when actually performing statistical and mathematical computations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update (Jan 2016)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wanted to provide an update to this question now that AI/Deep Learning networks are very actively pursued at banks and hedge funds. I have spent a good amount of time on delving into deep learning and performed experiments and worked with libraries such as Theano, Torch, and Caffe. What stood out from my own work and conversations with others was that a lot of those libraries are used via Python and that most of the researchers in this space do not use R in this particular field. Now, this still constitutes a small part of quant work being performed in financial services but I still wanted to point it out as it directly touches on the question I asked. I added this aspect of quant research to reflect current trends. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="-1" LastEditDate="2017-04-12T07:32:02.093" LastActivityDate="2019-09-03T20:29:35.880" Title="Is R being replaced by Python at quant desks?" Tags="&lt;time-series&gt;&lt;statistics&gt;&lt;r&gt;&lt;python&gt;&lt;quants&gt;" AnswerCount="8" CommentCount="19" FavoriteCount="60" ContentLicense="CC BY-SA 3.0" />
  <row Id="17871" PostTypeId="1" AcceptedAnswerId="17881" CreationDate="2015-05-19T08:24:55.393" Score="2" ViewCount="398" Body="&lt;p&gt;$a_t S_t$ = number of shares ($S_t$ is stock price at $t$), $S_0 = 1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$b_t \beta _t$ = saving account value , $d \beta_t = r \beta_t dt$, $r=$ interest rate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the value of the portfolio:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V_t = a_t S_t + b_t \beta_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is self-financing if &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dV_t = a_t dS_t + b_t d \beta_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $a_t = 1-t$, how can I choose $b_t$ such that my portfolio is self-financing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V_t = (1-t)S_t + b_t \beta_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I formulate $dV_t$ now? Don't I require more information, in particular, what is $S_t$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a need to use the stochastic product rule?&lt;/p&gt;&#xA;" OwnerUserId="16184" LastActivityDate="2015-05-19T13:07:52.327" Title="How can I make this portfolio self-financing?" Tags="&lt;black-scholes&gt;&lt;stochastic-calculus&gt;&lt;itos-lemma&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17872" PostTypeId="1" AcceptedAnswerId="17882" CreationDate="2015-05-19T08:54:44.287" Score="-6" ViewCount="109" Body="&lt;p&gt;As we are seeing here &lt;a href=&quot;http://www.theoptionsguide.com/strike-price.aspx&quot; rel=&quot;nofollow&quot;&gt;http://www.theoptionsguide.com/strike-price.aspx&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Relationship between Strike Price &amp;amp; Call Option Price &lt;/li&gt;&#xA;&lt;li&gt;Relationship between Strike Price &amp;amp; Put Option Price&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I do not understand these two things. Can anyone help me to understand this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks, &lt;/p&gt;&#xA;" OwnerUserId="16276" LastActivityDate="2015-05-19T14:26:56.180" Title="Can not understand options pricing" Tags="&lt;options&gt;&lt;equities&gt;" AnswerCount="1" CommentCount="2" ClosedDate="2015-05-19T14:49:20.773" ContentLicense="CC BY-SA 3.0" />
  <row Id="17873" PostTypeId="2" ParentId="17871" CreationDate="2015-05-19T09:13:35.797" Score="1" Body="&lt;p&gt;In the Black-Scholes model, you would have $d S_t = \mu\, d t + \sigma\, d W_t$ where $W$ is a Brownian motion. So if $V_t = a_t S_t + b_t \beta_t$, then&#xA;$$&#xA;dV_t = a_t\, d S_t + S_t\, d a_t + da_t\,dS_t + b_t\,d\beta_t + \beta_t\,d b_t + db_t\, d\beta_t&#xA;$$&#xA;by the product rule. In your case, when $a_t = 1-t$ you will have&#xA;$$&#xA;dV_t = (1-t) \, dS_t - S_t\, dt + b_t\,d\beta_t + \beta_t\,db_t&#xA;$$&#xA;since $da$ and $d\beta$ have no $dW$-term. Hence, you will need to pick $b$ such that $\beta\,db_t = S_t\,dt$, for the portfolio to be self-financing.&lt;/p&gt;&#xA;" OwnerUserId="15244" LastActivityDate="2015-05-19T09:13:35.797" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17874" PostTypeId="1" AcceptedAnswerId="17876" CreationDate="2015-05-19T09:48:39.850" Score="0" ViewCount="93" Body="&lt;p&gt;Good morning,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i am in the middle of developing my own stock exchange system and have implemented limit orders (basics) matching. The system is just a DIY solution for my own purposes and for fun mainly. The whole system is utilising my own text protocol for traders to be able to login/place orders/receive notifications. This is done for BTC exchange.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However i am stuck when it comes to calculations of the traders wallets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't think i know exactly what is going on behind the scenes therefore i would really appreciate if somebody could shed a bit of light on it for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe wallets are updated only in 3 places:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;New Order is placed: What happens with trader wallet when he places order (buy/sell)&lt;/li&gt;&#xA;&lt;li&gt;Cancel order is placed: What happens with trader wallet when he places cancel order (buy/sell)&lt;/li&gt;&#xA;&lt;li&gt;Match is made and a Trade is generated (full/partial) - what happens with te wallets of both traders?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What i am trying to understand is what happens with the BTC's and USD's in Traders wallets when orders are placed/cancelled/matched and how is this handled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much for your input into this.&lt;/p&gt;&#xA;" OwnerUserId="16278" LastEditorUserId="16278" LastEditDate="2015-05-19T09:59:04.680" LastActivityDate="2015-05-19T11:29:29.223" Title="Order Book vs Wallet Updates" Tags="&lt;limit-order-book&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17875" PostTypeId="2" ParentId="17870" CreationDate="2015-05-19T11:27:52.693" Score="25" Body="&lt;p&gt;This is interesting because I see another trend: Matlab is being replaced by R, but I guess this is another story.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use R for my academic (I am also teaching this stuff) as well as my consulting work (I am mainly working in the &lt;span class=&quot;math-container&quot;&gt;$\mathbb{P}$&lt;/span&gt; area, with some excursions into &lt;span class=&quot;math-container&quot;&gt;$\mathbb{Q}$&lt;/span&gt;). I tried Python but it didn't work for me. I think the main reasons I will stick with R are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;especially in the area of statistics and analytics there is such a&#xA;huge amount of high quality packages with sometimes even very recent&#xA;methods which is unrivalled by any other language out there&lt;/li&gt;&#xA;&lt;li&gt;for me R has the right mixture of low level capabilities of e.g. (re-)organizing data and high level commands (e.g. even k-means in the&#xA;core package)&lt;/li&gt;&#xA;&lt;li&gt;the speed is ok for me because I am not working in the area of HFT and there are many possibilities of speeding up code (vectorization,&#xA;parallelization, good connectivity with C asf)&lt;/li&gt;&#xA;&lt;li&gt;the community is really very much into the kind of stuff I am interesting in whereas with Python it is really everybody and his dog doing all kinds of stuff I am not interested in... I guess this is also about the mindset how to approach some problems, I don't know.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I think in general one should focus: I wouldn't try to build a webpage or a game with R but when it comes to statistics and analytics I think Python is no real competitor and I would strongly recommend R as your future setup.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&lt;br&gt;&#xA;I also wrote a blog post with additional points about why R is better suited for data science than Python: &lt;a href=&quot;http://blog.ephorie.de/why-r-for-data-science-and-not-python&quot; rel=&quot;noreferrer&quot;&gt;http://blog.ephorie.de/why-r-for-data-science-and-not-python&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2018-12-02T16:03:44.173" LastActivityDate="2018-12-02T16:03:44.173" CommentCount="8" ContentLicense="CC BY-SA 4.0" />
  <row Id="17876" PostTypeId="2" ParentId="17874" CreationDate="2015-05-19T11:29:29.223" Score="1" Body="&lt;p&gt;Only the transactions affect the account. See example implementation below. The &lt;code&gt;position&lt;/code&gt; and &lt;code&gt;money&lt;/code&gt; should be initialized at the beginning. Note that both of them, and also &lt;code&gt;quantity&lt;/code&gt; can be positive and negative.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;public static class PNL {&#xA;    private double position = 0; // number of BTC&#xA;    private double money = 0.0; // USD&#xA;&#xA;    public double get_position() {&#xA;        return position;&#xA;    }&#xA;&#xA;    public void on_execution(double price, double quantity) {&#xA;        position += quantity;&#xA;        money -= quantity * price;&#xA;    }&#xA;&#xA;    public double get_pnl(double current_price){&#xA;        return money + position * current_price;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When a new order is placed or an existing order modified, it affects the risk and exposure of the account. The risk manager must validate that in worst-case-scenario the the exposure will not breach the exposure limitations. Also, it needs to take into account the In-Flight state of orders. Here is an an &lt;a href=&quot;http://www.cmegroup.com/confluence/display/EPICSANDBOX/iLink+Order+Cancel-Replace+and+In-Flight+Mitigation&quot; rel=&quot;nofollow&quot;&gt;example&lt;/a&gt; how CME allows to manage it.&#xA;Similarly, order cancellation also affects only the risk management.&lt;/p&gt;&#xA;" OwnerUserId="1515" LastActivityDate="2015-05-19T11:29:29.223" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17877" PostTypeId="2" ParentId="17831" CreationDate="2015-05-19T12:09:46.270" Score="1" Body="&lt;p&gt;In the BS model, with friction-free markets in continuous time, the cost of the hedging portfolio is the initial cost of setting up the portfolio. There are no costs over time as the hedging portfolio is self-financing: any purchase of the underlying is paid for by borrowing money and any selling of the underlying is invested at the risk-free rate. &#xA;At maturity of the derivative, the hedging portfolio will have exactly the same value as the payoff of the derivative. Hence, the cost today of setting up the hedging portfolio has to be the same as the price of the derivative.&lt;/p&gt;&#xA;" OwnerUserId="7396" LastActivityDate="2015-05-19T12:09:46.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17878" PostTypeId="1" AcceptedAnswerId="17880" CreationDate="2015-05-19T12:41:40.253" Score="3" ViewCount="4484" Body="&lt;p&gt;I have been to two different interviews for jobs related to option trading, and both time I have been asked a question, which is pretty basic, and still I could not answer it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have an European call option, with :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Expiration : 1 year&lt;/li&gt;&#xA;&lt;li&gt;Volatility : 10%&lt;/li&gt;&#xA;&lt;li&gt;Strike : 100&lt;/li&gt;&#xA;&lt;li&gt;Spot : 100 (at the money)&lt;/li&gt;&#xA;&lt;li&gt;Risk free rates : 0&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What is its price? I could not use the BS formula, because I have no calculator. I think I should probably have used a binomial tree, but I didn't find out how.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for your help&lt;/p&gt;&#xA;" OwnerUserId="15650" LastActivityDate="2015-05-20T12:00:00.947" Title="Estimate simple option price without a calculator" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;binomial-tree&gt;&lt;call&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17879" PostTypeId="2" ParentId="17868" CreationDate="2015-05-19T12:53:32.977" Score="1" Body="&lt;p&gt;If $\sigma=0$ there is no randomness: the spot follows a single deterministic path.  That is, the measure consists of a point mass at that path.  Any equivalent measure can again only give a point mass at that same path, with the same drift.  So in this case we must have $\mu = r$ to have an equivalent martingale measure.  This is arbitrage free, but there is no longer a market-price-of-risk giving different risk-neutral vs. real-world measures.  This makes sense: there is no randomness so no risk!&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2015-05-19T12:53:32.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17880" PostTypeId="2" ParentId="17878" CreationDate="2015-05-19T13:00:15.953" Score="5" Body="&lt;p&gt;There is a good quick well-known approximation for at-the-money options: &#xA;$$\textrm{Call,Put} = 0.4 S \sigma \sqrt{T}.$$&#xA;See further discussion at&#xA; &lt;a href=&quot;https://quant.stackexchange.com/questions/1150/what-are-some-useful-approximations-to-the-black-scholes-formula&quot;&gt;What are some useful approximations to the Black-Scholes formula?&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2015-05-19T13:00:15.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17881" PostTypeId="2" ParentId="17871" CreationDate="2015-05-19T13:07:52.327" Score="2" Body="&lt;p&gt;We have&#xA;$$&#xA;V_t = a_t S_t + b_t \beta_t.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By Ito's product rule,&#xA;\begin{align*}&#xA;dV_t &amp;amp; = d(a_t S_t) + d(b_t \beta_t) \\&#xA;&amp;amp; = a_t dS_t + S_t da_t + da_t dS_t + b_t d\beta_t + \beta_t db_t + db_td\beta_t.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $da_t$ and $db_t$ have no $dW_t$ term, the cross terms are both zero and we have&#xA;\begin{align*}&#xA;dV_t &amp;amp; = a_t dS_t + S_t da_t + b_t d\beta_t + \beta_t db_t.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now just plug in your value for $da_t$ and solve one equation in the unknown $b_t$:&#xA;\begin{align*}&#xA;dV_t &amp;amp; = a_tdS_t - S_t dt + b_t d\beta_t + \beta_t db_t \triangleq a_t dS_t + b_t d\beta_t \\&#xA;&amp;amp; \iff \beta_t db_t = S_t dt \\&#xA;&amp;amp; \iff b_t = b_0 + \int_0^t S_u/\beta_u du.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you may be able to solve for $b_t$ explicitly depending on your model for $S_t$.&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2015-05-19T13:07:52.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17882" PostTypeId="2" ParentId="17872" CreationDate="2015-05-19T14:26:56.180" Score="2" Body="&lt;p&gt;Option pricing is all about intrinsic value and time value. The intrinsic value is the difference between the strike price and the underlying market price.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;A call is a right to buy the underlying. Therefore intrinsic value of a call is positive when the strike price is below the underlying market price. You can buy for less than the market offer.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A put is the right to sell the underlying. Therefore intrinsic value of a put option is positive when the strike price is above the underlying market price. You can sell for more than the market bid.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2015-05-19T14:26:56.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17883" PostTypeId="1" AcceptedAnswerId="17891" CreationDate="2015-05-19T14:42:35.237" Score="4" ViewCount="258" Body="&lt;p&gt;Attempting to derive density of a GBM (which we know is log-normal) the long way, using the Fokker Planck-equation.  Can't figure out where I went wrong - would appreciate a few sets of extra eyes!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GBM: $dS_t = \mu S_t dt + \sigma S_t dW_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $p(t,T,x,y) = \mathbb{P}(S(T) = y|S(t) = x)$ be the transition density for $S_t$, for which we know &#xA;\begin{align}&#xA;p(0,T,x,y) = \frac{1}{y\sigma \sqrt{2 \pi T}} \exp\left(-\frac{1}{2}\left(\frac{\log(y) - \left(\log(x) + (\mu - \frac{\sigma^2}{2})T\right)}{\sigma \sqrt{T}}\right)^2 \right).&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to derive this result using the fact that $p$ (viewed as $p(T,y)$) satisfies the Fokker Planck PDE&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;\frac{\partial p}{\partial T} &amp;amp; = -\frac{\partial}{\partial y}(\mu yp) + \frac{\partial^2}{\partial y^2}\left(\frac{1}{2}\sigma^2 y^2 p\right) \\&#xA;&amp;amp; = -\mu \left(p + y\frac{\partial p}{\partial y}\right) + \frac{1}{2}\sigma^2 \left(2p + 4y\frac{\partial p}{\partial y} + y^2 \frac{\partial^2 p}{\partial y^2}\right) \\&#xA;&amp;amp; = \frac{\sigma^2 y^2}{2} \frac{\partial^2 p}{\partial y^2} + (2 \sigma^2 - \mu)y \frac{\partial p}{\partial y} + (\sigma^2 - \mu)p.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To solve this PDE, I first transform it to a constant coefficient problem using the change of variables $w = \log y$, so $\frac{\partial p}{\partial y} = \frac{\partial p}{\partial w}\frac{1}{y}$ and $\frac{\partial^2 p}{\partial y^2} = \frac{\partial^2 p}{\partial w^2}\frac{1}{y^2} - \frac{\partial p}{\partial w} \frac{1}{y^2}$, giving&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;\frac{\partial p}{\partial T} &amp;amp; = \frac{\sigma^2}{2} \left(\frac{\partial^2 p}{\partial w^2} - \frac{\partial p}{\partial w}\right)  + (2 \sigma^2 - \mu) \frac{\partial p}{\partial w}+ (\sigma^2 - \mu)p \\&#xA;&amp;amp; = \frac{\sigma^2}{2} \frac{\partial^2 p}{\partial w^2} + \left(\frac{3\sigma^2}{2} - \mu\right) \frac{\partial p}{\partial w} + (\sigma^2 - \mu)p.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take Fourier transform to convert this to an ODE:&#xA;\begin{align*}&#xA;\frac{\partial \hat{p}}{\partial T} &amp;amp; = -\frac{\sigma^2 \omega^2}{2} \hat{p} + i\omega\left(\frac{3\sigma^2}{2} - \mu\right) \hat{p} + (\sigma^2 - \mu)\hat{p} \\&#xA;\hat{p} &amp;amp; = \hat{p}_0\exp\left((\sigma^2 - \mu)T\right)\exp\left(-\frac{\sigma^2 \omega^2}{2}T + i\omega\left(\frac{3\sigma^2}{2} - \mu\right)T \right)&#xA;\end{align*}&#xA;where the transform I'm using is&#xA;$$&#xA;\mathcal{F}[f](\omega) = \int_{-\infty}^\infty e^{-i \omega x} f(x) dx.&#xA;$$&#xA;Since&#xA;$$&#xA;\mathcal{F}\left[\frac{1}{s \sqrt{2\pi}} \exp\left(\frac{1}{2}\left(\frac{w - m}{s}\right)^2\right)\right](\omega) = \exp(-i\omega m - \omega^2s^2/2),&#xA;$$&#xA;with $m = -\left(\frac{3\sigma^2}{2} - \mu\right)T$ and $s = \sigma \sqrt{T}$ we see that&#xA;\begin{align*}&#xA;\hat{p} &amp;amp; = \hat{p}_0\exp\left((\sigma^2 - \mu)T\right)\mathcal{F}\left[\frac{1}{\sigma \sqrt{2\pi T}}\exp\left(-\frac{1}{2}\left(\frac{w -\left(\mu - \frac{3\sigma^2}{2}\right)T}{\sigma \sqrt{T}}\right)^2 \right)\right].&#xA;\end{align*}&#xA;Now, since $\mathcal{F}[f \ast g] = \mathcal{F}[f] \mathcal{F}[g]$ and $p_0 = p(0,w) = \delta(w - w_0)$,&#xA;\begin{align*}&#xA;p(T,w) &amp;amp; = \exp\left((\sigma^2 - \mu)T\right)\frac{1}{\sigma \sqrt{2\pi T}}\exp\left(-\frac{1}{2}\left(\frac{w - w_0 -\left(\mu - \frac{3\sigma^2}{2}\right)T}{\sigma \sqrt{T}}\right)^2 \right).&#xA;\end{align*}&#xA;Finally, changing back $w \to \log y$ we get the supposed solution&#xA;\begin{align*}&#xA;p(T,y) &amp;amp; = \exp\left((\sigma^2 - \mu)T\right)\frac{1}{\sigma \sqrt{2\pi T}}\exp\left(-\frac{1}{2}\left(\frac{\log(y) - \left(\log(y_0) + \left(\mu - \frac{3\sigma^2}{2}\right)T\right)}{\sigma \sqrt{T}}\right)^2 \right),&#xA;\end{align*}&#xA;which is not the lognormal density as above.&lt;/p&gt;&#xA;" OwnerUserId="6866" LastEditorUserId="6866" LastEditDate="2015-05-19T19:18:49.950" LastActivityDate="2015-05-21T14:47:44.597" Title="Density of Geometric BM via Fokker-Planck" Tags="&lt;distribution&gt;&lt;density&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17884" PostTypeId="1" AcceptedAnswerId="17904" CreationDate="2015-05-19T16:03:59.073" Score="5" ViewCount="1000" Body="&lt;p&gt;In the context of modern portfolio theory, one often wishes to minimise&#xA;$\mathbf{w}^{\mathrm{{\scriptstyle T}}}\boldsymbol{\Sigma}\mathbf{w}$&#xA;subject to $\mathbf{w}^{T}\boldsymbol{\mu}=c_{1}$, $\left\Vert \mathbf{w}\right\Vert _{1}&amp;lt;c_{2}$&#xA;and $\mathbf{w}^{T}\mathbf{1}=1$. Is there an R function or package&#xA;to do this?&lt;/p&gt;&#xA;" OwnerUserId="15723" LastEditorUserId="15723" LastEditDate="2015-05-26T17:15:32.387" LastActivityDate="2015-05-26T17:15:32.387" Title="R package for portfolio" Tags="&lt;r&gt;&lt;modern-portfolio-theory&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17885" PostTypeId="2" ParentId="14383" CreationDate="2015-05-19T16:04:08.233" Score="1" Body="&lt;p&gt;I think wiki calculated upon new way and your excel calculated upon Wilder way (Wilder book).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have same issue when use both method. Look like new Metastock 5 software offer both method.&lt;/p&gt;&#xA;" OwnerUserId="16282" LastActivityDate="2015-05-19T16:04:08.233" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17887" PostTypeId="1" AcceptedAnswerId="17954" CreationDate="2015-05-19T19:57:17.960" Score="11" ViewCount="1543" Body="&lt;p&gt;Assume the price of a stock $S_t$ paying continuous dividend $a$ satisfies&#xA;$$&#xA;dS_t = S_t\left((\mu - a)dt + \sigma dW_t\right).&#xA;$$&#xA;The risk-neutral pricing formula states that if $\mathbb{Q}$ is any probability measure such that $e^{-rt}S_t$ is a $\mathbb{Q}$-martingale (MG), then the value of any self-financing replicating strategy $V_t$ that replicates a payoff $X = f(S_T)$ is&#xA;$$&#xA;V_t = \mathbb{E}_{\mathbb{Q}}\left[e^{-r(T-t)}X|\mathcal{F}_t\right].&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, discount $S_t$ and compute the differential&#xA;$$&#xA;dZ_t := d(e^{-rt}S_t) = Z_t\left((\mu - a - r)dt + \sigma dW_t\right).&#xA;$$&#xA;Define $\frac{d \mathbb{P}}{d \mathbb{Q}} = \exp\left(-\theta W_t -\frac{1}{2} \theta^2 t\right)$ and $\tilde{W}_t = W_t + \theta t$ for some $\theta$, which we determine by replacing $W_t$ with $\tilde{W}_t$ in $dZ_t$ and making it driftless:&#xA;\begin{align*}&#xA;dZ_t &amp;amp; = Z_t\left((\mu - a - r)dt + \sigma (d\tilde{W}_t - \theta dt)\right) \\&#xA;&amp;amp; = Z_t\left((\mu - a - r - \theta \sigma)dt + \sigma d\tilde{W}_t \right) \\&#xA;&amp;amp; = \sigma Z_td\tilde{W}_t,&#xA;\end{align*}&#xA;where we set $\theta = \frac{\mu - a - r}{\sigma}$.  We have found a $\mathbb{Q}$ such that $Z_t$ is a $\mathbb{Q}$-MG, and so can price as usual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, Shreve (Stochastic Calculus for Finance II) on p. 235 instead derives the discounted portfolio process (with reinvested dividends), and finds the market price of risk $\theta$ for that process, showing that when this is done, the discounted stock process is indeed not a martingale.  Why not do it the way I did?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2016-06-30T19:50:30.310" Title="Why Must Dividends Be Reinvested to Use Risk-Neutral Pricing?" Tags="&lt;derivatives&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17889" PostTypeId="2" ParentId="17478" CreationDate="2015-05-19T21:43:55.980" Score="2" Body="&lt;p&gt;Yes, the function does not consider cases when the price is flat. The solution is very simple. Look at the OBV2 function below. The series from OBV and OBV2 are highly correlated, but the strict definition would be higher (smaller) depending on the market evolution. In the QQQ case that difference is about 50% &lt;a href=&quot;https://i.stack.imgur.com/hskDJ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;1&lt;/a&gt;. You could find the maintainer here: &lt;a href=&quot;http://cran.r-project.org/web/packages/TTR/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://cran.r-project.org/web/packages/TTR/index.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    OBV2 &amp;lt;-  function(price, volume) { #&#xA;    # On Balance Volume 2&#xA;    price &amp;lt;- try.xts(price, error=as.matrix)&#xA;    volume &amp;lt;- try.xts(volume, error=as.matrix)&#xA;&#xA;    if(!(is.xts(price) &amp;amp;&amp;amp; is.xts(volume))) {&#xA;       price &amp;lt;- as.vector(price)&#xA;      volume &amp;lt;- as.vector(volume)&#xA;   }&#xA;   obv &amp;lt;- c( volume[1], ifelse(ROC(price) &amp;gt; 0, volume, -volume)[-1] )&#xA;   obv[ROC(price)==0]&amp;lt;-0&#xA;   obv &amp;lt;- cumsum( obv )&#xA;   if(is.xts(obv)) {&#xA;     obv &amp;lt;- xts(obv,index(price))&#xA;     colnames(obv) &amp;lt;- 'obv2'&#xA;   }&#xA;   reclass( obv, price )&#xA;   }&#xA;&#xA;   require(&quot;quantmod&quot;)  &#xA;&#xA;   getSymbols('QQQ', src='yahoo',from='2012-01-01')&#xA;   chartSeries(QQQ,TA = NULL)&#xA;   addOBV()&#xA;   sobv=OBV(QQQ[,4],QQQ[,5])&#xA;   #addTA(sobv,on=3)&#xA;   head(cbind(QQQ,sobv))&#xA;   table(ROC(QQQ[,4])==0)&#xA;&#xA;   sobv2=OBV2(QQQ[,4],QQQ[,5])&#xA;   addTA(sobv2,on=2,col=&quot;red&quot;)&#xA;   cor(sobv,sobv2)&#xA;   tail(cbind(sobv,sobv2,sobv2/sobv-1))&#xA;   chartSeries(sobv2,TA = NULL)&#xA;   addTA(sobv,on=1,col=&quot;red&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13571" LastActivityDate="2015-05-19T21:43:55.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17891" PostTypeId="2" ParentId="17883" CreationDate="2015-05-20T00:59:01.683" Score="4" Body="&lt;p&gt;Hi bcf: This is a good question. As you pointed out below, &#xA;\begin{align*}&#xA;p_0 &amp;amp;= \delta(y-y_0)\\&#xA;&amp;amp;=\delta(e^w-y_0).&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;p_0 * g &amp;amp;= \int_{-\infty}^{\infty}\delta(e^z-y_0) g(w-z) dz\\&#xA;&amp;amp;=\int_{0}^{\infty}\delta(u-y_0) g(w-\ln u) \frac{1}{u}du\\&#xA;&amp;amp;= \frac{1}{y_0}g(w-\ln y_0).&#xA;\end{align*}&#xA;Consequently, your last equality becomes&#xA;\begin{align*}&#xA;p(T,y) &amp;amp;= \frac{1}{y_0}\exp\big((\sigma^2 - \mu)T\big)\frac{1}{\sigma \sqrt{2\pi T}}\exp\bigg(-\frac{1}{2}\bigg(\frac{\ln y - \big[\ln y_0 + \big(\mu - \frac{3\sigma^2}{2}\big)T\big]}{\sigma \sqrt{T}}\bigg)^2 \bigg)&#xA;\end{align*}&#xA;Let $Z= \ln y - \big[\ln y_0 + \big(\mu - \frac{\sigma^2}{2}\big)T\big]$. Then, &#xA;\begin{align*}&#xA;p(T,y) &amp;amp;= \frac{1}{y_0}\exp\big((\sigma^2 - \mu)T\big)\frac{1}{\sigma \sqrt{2\pi T}}\exp\bigg(-\frac{1}{2}\bigg(\frac{\ln y - \big[\ln y_0 + \big(\mu - \frac{3\sigma^2}{2}\big)T\big]}{\sigma \sqrt{T}}\bigg)^2 \bigg)\\&#xA;&amp;amp;= \frac{1}{y_0}\exp\big((\sigma^2 - \mu)T\big)\frac{1}{\sigma \sqrt{2\pi T}}\exp\bigg(-\frac{1}{2}\bigg(\frac{\ln y - \big[\ln y_0 + \big(\mu - \frac{\sigma^2}{2}\big)T\big]}{\sigma \sqrt{T}} + \sigma \sqrt{T}\bigg)^2 \bigg)\\&#xA;&amp;amp;= \frac{1}{y_0}\exp\big((\sigma^2 - \mu)T\big)\frac{1}{\sigma \sqrt{2\pi T}}\exp\bigg(-\frac{1}{2}\bigg(\frac{Z}{\sigma \sqrt{T}} + \sigma \sqrt{T}\bigg)^2 \bigg)\\&#xA;&amp;amp;= \frac{1}{y_0}\exp\big((\sigma^2 - \mu)T\big)\frac{1}{\sigma \sqrt{2\pi T}}\exp\bigg(-\frac{1}{2}\bigg(\frac{Z}{\sigma \sqrt{T}}\bigg)^2 - Z - \frac{\sigma ^2}{2}T \bigg)\\&#xA;&amp;amp;= \frac{1}{y_0}\frac{1}{\sigma \sqrt{2\pi T}}\exp\bigg(-\frac{1}{2}\bigg(\frac{Z}{\sigma \sqrt{T}}\bigg)^2 + \ln y_0 -\ln y \bigg)\\&#xA;&amp;amp;= \frac{1}{y \sigma \sqrt{2\pi T}} \exp\bigg(-\frac{1}{2}\bigg(\frac{\ln y - \big[\ln y_0 + \big(\mu - \frac{\sigma^2}{2}\big)T\big]}{\sigma \sqrt{T}}\bigg)^2 \bigg).&#xA;\end{align*}&#xA;This is the transition density you provided above. &lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-05-21T14:47:44.597" LastActivityDate="2015-05-21T14:47:44.597" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17892" PostTypeId="2" ParentId="17796" CreationDate="2015-05-20T01:49:20.573" Score="1" Body="&lt;p&gt;I'd question the assertion in your question, what proof do you have that leveraged ETFs must go to zero? A plausible price pattern can easily be constructed that leads to a leveraged ETF that climbs forever. That same leveraged portfolio would climb forever as well.&lt;/p&gt;&#xA;" OwnerUserId="16289" LastActivityDate="2015-05-20T01:49:20.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17894" PostTypeId="1" CreationDate="2015-05-20T10:32:12.060" Score="3" ViewCount="926" Body="&lt;p&gt;I'm doing some analysis on VIX and VSTOXX futures and require historical prices of each contract as a result. VIX info is free to download on CBOE website: &lt;a href=&quot;http://cfe.cboe.com/products/historicalvix.aspx&quot; rel=&quot;nofollow&quot;&gt;http://cfe.cboe.com/products/historicalvix.aspx&lt;/a&gt;. Basically I can download daily settlement price for each VIX future contract ever traded. I am trying to find the same for VSTOXX but not see it anywhere on Eurexchange. I placed a request but was told I need to place an order. Is that true? where can I find such info. I do not mind paying but just want to get more info.&#xA;Regards,&#xA;Li&lt;/p&gt;&#xA;" OwnerUserId="16293" LastActivityDate="2016-09-04T18:52:17.903" Title="Where to get historical daily settlement price of each VSTOXX futures contract" Tags="&lt;futures&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17895" PostTypeId="1" CreationDate="2015-05-20T11:25:21.773" Score="2" ViewCount="77" Body="&lt;p&gt;I want to calculate the Value-at-Risk at date $t$ in such a way that I minimize the capital requirements given as&#xA;\begin{align}&#xA;	\text{CR}_{\,t+1\,:\,t+250} = \sum_{h=0}^{249}\max\left( -(3+k_{t})\overline{\text{VaR}}^{60}_{t+h}, -\text{VaR}_{t+h}\right),&#xA;\end{align}&#xA;in which $\overline{\text{VaR}}^{60}_{t} = 1/60\sum_{\tau=1}^{60} \text{VaR}_{t-\tau+1}$ and $k_{t} = f(\sum_{\tau=1}^{250} H_{t-\tau+1})$ where $H_t = 1_{\left\{r_t &amp;lt; \text{VaR}_t\right\}}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that that $\text{VaR}_t$ minimizing the $\text{CR}_{t+1}$ does not necessarily minimize $\text{CR}_{\,t+1\,:\,t+250}$. Any idea how we can approach this problem is appreciated.&lt;/p&gt;&#xA;" OwnerUserId="16294" LastEditorUserId="16294" LastEditDate="2015-05-20T12:30:39.970" LastActivityDate="2015-05-20T12:30:39.970" Title="Value-at-Risk Calculation with respect to the Capital Requirements" Tags="&lt;value-at-risk&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17896" PostTypeId="2" ParentId="17878" CreationDate="2015-05-20T12:00:00.947" Score="2" Body="&lt;p&gt;I think that you can find the answer to this question here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://people.stern.nyu.edu/wsilber/chuang-silber%20approx%20option%20value.pdf&quot; rel=&quot;nofollow&quot;&gt;http://people.stern.nyu.edu/wsilber/chuang-silber%20approx%20option%20value.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16295" LastActivityDate="2015-05-20T12:00:00.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17901" PostTypeId="2" ParentId="17884" CreationDate="2015-05-20T13:27:52.037" Score="2" Body="&lt;p&gt;I wonder if it's possible to use &lt;code&gt;solve.QP&lt;/code&gt; from &lt;code&gt;quadprog&lt;/code&gt; by using dummy variables.  One dummy variable $y_i$ would be used for each $w_i$, each $y_i$ would be constrained to be greater than zero, and the leverage constraint would be applied to the sum of the $y_i$. Problem formulation would look like&#xA; $$&#xA;       \text{min }  w^tΣw &#xA; $$&#xA;subject to the constraints&#xA;$$  &#xA;    w^t\mu= c_1&#xA;$$&#xA;$$&#xA;    w^t 1 = 1&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$  &#xA;    y_i \geq  0&#xA;$$&#xA;$$&#xA;    w_i + y_i \geq 0&#xA;$$&#xA;$$&#xA;   -w_i + y_i \geq 0&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;    -\sum y_i \geq -c_2&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Code could look like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;leveraged_port &amp;lt;- function( er,cov.mat, target_return=NULL, leverage=1., tickers=NULL ){&#xA;   library(quadprog)&#xA;# leverage checks and adjustments&#xA;   if(leverage &amp;lt; 1.) stop( &quot;leverage must be &amp;gt;= 1.&quot;)&#xA;   if( target_return &amp;gt; (leverage+1)/2*max(er)) stop(&quot;target_return not achievable; increase leverage or decrease target_return&quot;)&#xA;   lev_adj  &amp;lt;- 1.E-06&#xA;   if(leverage &amp;lt; 1 + lev_adj) leverage  &amp;lt;- 1 + lev_adj&#xA;   n_asset &amp;lt;- length(er)&#xA;   zeros &amp;lt;- integer(n_asset)&#xA; # quad problem&#xA; # calculate small diag value for dummy variables so Dmat is positive def.&#xA;    diag_dum &amp;lt;- 1.e-05*min(diag(cov.mat))&#xA;    Dmat &amp;lt;- diag(diag_dum, nrow=2*n_asset, ncol=2*n_asset)&#xA;    Dmat[1:n_asset, 1:n_asset] &amp;lt;- 2*cov.mat&#xA;    dvec &amp;lt;- numeric(2*n_asset)&#xA;    meq &amp;lt;-  2&#xA; # constraints on weights&#xA;    bvec &amp;lt;- c(1, target_return)&#xA;    Amat &amp;lt;- matrix( c(rep(1,n_asset), er, diag(n_asset), -diag(n_asset), diag(0, nrow=n_asset),&#xA;                      zeros), nrow=n_asset) &#xA; # constraints on dummy variables&#xA;    bvec &amp;lt;- c(bvec, zeros, zeros, zeros, -leverage)&#xA;    Amat &amp;lt;- rbind( Amat, matrix(c(zeros, zeros, diag(n_asset), diag(n_asset), diag(n_asset), &#xA;                                  -rep(1,n_asset)), nrow=n_asset))&#xA;    sol&amp;lt;-solve.QP(Dmat, dvec, Amat, bvec, meq=meq)&#xA;    weights&amp;lt;-sol$solution[1:n_asset]&#xA;        names(weights) &amp;lt;- tickers&#xA;        exp.ret &amp;lt;- t(er)%*%weights&#xA;        std.dev &amp;lt;- sqrt(weights %*% cov.mat %*% weights)&#xA;        ret &amp;lt;- list(er = as.vector(exp.ret),&#xA;                    StdDev = as.vector(std.dev),&#xA;                    weights = weights,&#xA;                    sum_weights = sum(weights),&#xA;                    leverage = sum(abs(weights)),&#xA;                    lagrange_mults=sol$Lagrangian )  &#xA; }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Results on the following example problem seem feasible&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quantmod)&#xA;tickers &amp;lt;- c(&quot;MSFT&quot;,&quot;AAPL&quot;, &quot;AMZN&quot;, &quot;YHOO&quot;, &quot;XOM&quot;, &quot;CVX&quot;, &quot;UNH&quot;, &quot;NKE&quot;)&#xA;prices &amp;lt;- do.call(cbind, &#xA;         lapply(tickers, function(x) getSymbols(x, from=&quot;2010-01-01&quot;, auto.assign=FALSE, warnings=FALSE)[,6]))&#xA;colnames(prices) &amp;lt;- tickers&#xA;returns &amp;lt;- diff(prices, arithmetic=FALSE, na.pad=FALSE) - 1&#xA;means &amp;lt;- sapply(returns, mean)&#xA;&#xA;QPsol &amp;lt;- leveraged_port(er=means, cov.mat=cov(coredata(returns)), target_return=.0016, leverage=1.8, tickers)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with the results&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;QPsol&#xA;$er&#xA;[1] 0.0016&#xA;&#xA;$StdDev&#xA;[1] 0.01830004&#xA;&#xA;$weights&#xA;         MSFT          AAPL          AMZN          YHOO           XOM           CVX           UNH           NKE &#xA;-9.809695e-14  1.044254e+00 -5.297152e-14 -1.780017e-17 -4.000000e-01 -1.556950e-13  3.557464e-01  4.224909e-14 &#xA;&#xA;$sum_weights&#xA;[1] 1&#xA;&#xA;$leverage&#xA;[1] 1.8&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11889" LastEditorUserId="15723" LastEditDate="2015-05-26T11:09:08.143" LastActivityDate="2015-05-26T11:09:08.143" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17902" PostTypeId="2" ParentId="1870" CreationDate="2015-05-20T13:54:20.077" Score="0" Body="&lt;p&gt;If you're looking for an alternative to Q, try R.  It's a a great language for modeling and time series analysis.   For a DB, try cassandra, which supports partitioned data, high-speed access/queries.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nice thing is that you can quickly produce compelling graphs and charts in R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, R has a big community compared to J.   And it's all open source, with a strong, dynamic base of users...so you won't get stuck with code that no one can support or understand.&lt;/p&gt;&#xA;" OwnerUserId="16297" LastActivityDate="2015-05-20T13:54:20.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17903" PostTypeId="1" AcceptedAnswerId="17905" CreationDate="2015-05-20T14:20:19.963" Score="6" ViewCount="800" Body="&lt;p&gt;If I have a trading strategy such that at each time $t$ I own $\Delta_t$ units of stock $S_t$ and $\psi_t$ units of bond $B_t$, it is a replicating strategy for some claim with time $T \geq t$ payoff $X$ if the value of this portfolio $V_T = X$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Written out, the time $t$ value of the portfolio is $V_t = \Delta_t S_t + \psi_t B_t$, and is self-financing if $dV_t = \Delta_t dS_t + \psi_t dB_t$; that is, changes in value are brought on only by changes in asset prices, not the strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, why is a self-financing strategy so important for option pricing?  If $V_T = X$ but this strategy is NOT self-financing, doesn't the time $t$ price of the option still have to be $V_t$, else arbitrage?  If it's NOT self-financing, there may be cash injections/consumption along the way to the payoff, but so be it - it still replicates the payoff, so at each $t$ the price of the option must still be $V_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please let me know how I've confused myself so badly!&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2015-05-20T14:57:36.257" Title="Why must a replicating portfolio be self-financing?" Tags="&lt;options&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17904" PostTypeId="2" ParentId="17884" CreationDate="2015-05-20T14:34:41.457" Score="4" Body="&lt;p&gt;If you can add linear constriants (as you can do in quadprog) then you can formulate $w \mu = c_1$ as linear constraint, no matter what $\mu$ is (and first delete it from the objective by setting the parameter to zero.&#xA;The only problem is  the one norm. Let my clarify, this is:&#xA;$$&#xA;\sum_{i=1}^n |w_i| &amp;lt; c_2&#xA;$$&#xA;Thus you allow for short sales but you want to limit leverage -&gt; right?&#xA;I am afraid that quadprog can not handle such constraints.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some solvers can handle quadratic constraints then&#xA;$$&#xA;\sum_{i=1}^n |w_i|^2  = w^T w&amp;lt; c_2^*&#xA;$$&#xA;would limit leverage.&#xA;The first equation above describes a constraint for the $L_1$-&lt;a href=&quot;http://en.wikipedia.org/wiki/Taxicab_geometry&quot; rel=&quot;nofollow&quot;&gt;norm&lt;/a&gt;. If you mean that $|w_i|$ should be bounded for each $i$ then of course you get this by the two inequalities:&#xA;$$&#xA;w \le c_2 \quad \text{and} \quad  w \ge -c_2.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT after the comment of John:&#xA;THe package &lt;a href=&quot;http://cran.r-project.org/web/packages/nloptr/vignettes/nloptr.pdf&quot; rel=&quot;nofollow&quot;&gt;nloptr&lt;/a&gt; can handle non-linear constraints. Follow the examples in the link to define the objective function and the constraint. Note that the gradient of&#xA;$$&#xA;f(w) = w^T \Sigma w&#xA;$$&#xA;is given by $$ 2 \Sigma w.$$ &#xA;Providing the gradient will improve the result of this non-linear optimizer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: If you want something built for portfolio optimization directly then you could look at fPorfolio and e.g. this &lt;a href=&quot;http://www.revolutionanalytics.com/sites/default/files/26jan11-portfolio-design-presentation.pdf&quot; rel=&quot;nofollow&quot;&gt;presentaton&lt;/a&gt;. I find that the documentation lacks details and I wonder whether all features &quot;promised&quot; in the presentation work properly. On page 13 they say that the package can handle non-linear constraints. If you try it then please tell us whether this works.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-05-21T12:28:24.917" LastActivityDate="2015-05-21T12:28:24.917" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="17905" PostTypeId="2" ParentId="17903" CreationDate="2015-05-20T14:57:36.257" Score="3" Body="&lt;p&gt;I'll provide an extreme counterexample.  Suppose your non self-financing replicating portfolio is to do the following.  At time t through T you own no stock and no bonds.  Then you observe X at time T and place X dollars in the portfolio.  It would be incorrect to say that the options value at time t is zero.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea of a replicating portfolio is that at time t all you need to provide is an amount $V_t$ so that in all outcomes of the world you end up with a portfolio worth $X$ without providing any additional money.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suppose you could extend the portfolios to include deterministic influx/outfluxes of money and then you could present value all those changes.  However, if an influx/outflux at any time depends on the outcome of your process, then that means at time $t$ you cannot say exactly how much cash is needed to end up at $X$.  It's not that it provides an arbitrage but instead it just doesn't provide you with what you are looking for.  &lt;/p&gt;&#xA;" OwnerUserId="16281" LastActivityDate="2015-05-20T14:57:36.257" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17906" PostTypeId="2" ParentId="17894" CreationDate="2015-05-20T15:16:03.183" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;Yes, you'd need to place a data order in data shop on &lt;a href=&quot;http://datashop.deutsche-boerse.com/2001/en&quot; rel=&quot;nofollow&quot;&gt;Eurexchange&lt;/a&gt;. The problem: You can't select a single instrument (like VSTOXX), but you are getting all traded options and futures series.&lt;/li&gt;&#xA;&lt;li&gt;Alternatively, if you are an institutional investor, you could buy a data cut from OptionMetrics.&lt;/li&gt;&#xA;&lt;li&gt;Lastly, you could write a parser and grab the prices &lt;a href=&quot;http://www.eurexchange.com/exchange-en/market-data/clearing-data/settlement-prices&quot; rel=&quot;nofollow&quot;&gt;online&lt;/a&gt;, but that won't include historical prices (only going forward).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2909" LastActivityDate="2015-05-20T15:16:03.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17907" PostTypeId="1" CreationDate="2015-05-20T16:11:54.207" Score="1" ViewCount="884" Body="&lt;p&gt;What is the reason (better if it is intuitive, and not too math heavy), that when we talk of Greeks, we consider second derivative with respect to price (gamma), but only first derivative with respect to time (theta) and volatility (vega).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At least, most brokerage platforms only publish values for these Greeks.&#xA;Why not consider the second derivative with respect to time and volatility? Are they not important?&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2015-05-20T17:06:35.643" Title="Why we consider second derivative w.rt price but only first derivative w.r.t time and volatility" Tags="&lt;option-pricing&gt;&lt;derivatives&gt;&lt;greeks&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17908" PostTypeId="2" ParentId="17907" CreationDate="2015-05-20T17:06:35.643" Score="2" Body="&lt;p&gt;I would consider the financial applications of the Greeks: hedging.  The &quot;main&quot; greeks, viz. Delta, Gamma, Theta, Vega and Rho, all have intuitive financial meanings.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gamma is the rate of change of your Delta (how many shares of stock to own) with respect to the stock price, so a high Gamma implies you will be rebalancing in large quantities (often happens near expiration, at least in theory) - probably an undesireable situation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider, instead, $\frac{\partial \theta}{\partial t}$, i.e. the second derivative of price w.r.t. time.  What sort of financial application might this have?  By itself, $\theta$ tells us the rate of change of the option price w.r.t. time, and so $\frac{\partial \theta}{\partial t}$ would be the &quot;acceleration&quot; of the price.  While this has a nice physical meaning, it isn't of much use from a hedging perspective, in that it isn't explicitly used to calculate hedges.&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2015-05-20T17:06:35.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17910" PostTypeId="1" CreationDate="2015-05-20T19:11:26.937" Score="12" ViewCount="2294" Body="&lt;p&gt;I have a problem calculating VaR with the Monte Carlo Simulation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I followed the next steps and would like know if it is a right way to calculate VaR or if I need something more?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The steps&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Generate random numbers&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Define Correlation Matrix&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Define volatilities, drift and weights&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Perform a Cholesky decomposition of the correlation matrix&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Multiply random numbers by the Cholesky matrix&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Multiply result of step 5 by volatility and drift&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Take the exponent of results from step 6&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Take log returns of step 7 results&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Create the weighted portfolio returns&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Calculate the VaR (use percentile function at right confidence interval)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Calculate the volatilites of your random numbers&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Cross-check with analytical VaR&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="16286" LastEditorUserId="467" LastEditDate="2016-07-05T01:50:47.143" LastActivityDate="2018-08-31T05:01:47.703" Title="Are these steps correct to calculate Value-at-Risk with a Monte Carlo simulation?" Tags="&lt;monte-carlo&gt;&lt;portfolio&gt;&lt;var&gt;" AnswerCount="4" CommentCount="6" FavoriteCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="17911" PostTypeId="2" ParentId="4349" CreationDate="2015-05-20T19:39:28.447" Score="0" Body="&lt;p&gt;This depends on your volatility model. Even for underlying like stocks, many vol models have parameter of vol of vol. And option pricing results from the model obviously have sensitivity to that parameter. Once you hedge out all the other risks (delta, vanna, vega) but leaves out the sensitivity to that parameter, by the model, pnl depends on vol of vol.&lt;/p&gt;&#xA;" OwnerUserId="5861" LastActivityDate="2015-05-20T19:39:28.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17912" PostTypeId="1" AcceptedAnswerId="18969" CreationDate="2015-05-20T20:22:08.730" Score="9" ViewCount="1124" Body="&lt;p&gt;To estimate high frequency tick data stock intraday volatility, I have read Robert Almgren's notes7.pdf &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cims.nyu.edu/~almgren/timeseries/notes7.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.cims.nyu.edu/~almgren/timeseries/notes7.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where he talks about the bias free estimator by Zhou:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Z = \sum ((y_j - y_{j-1})^2 + 2(y_j - y_{j-1})(y_{j+1} - y_j))$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $y_j$ is the log return of the price at time $j$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, this expression sometimes yields negative volatility. We see that the first term is a square which is always positive, but the second term $2(y_j-y_{j-1})(y_{j+1}-y_j)$ can be negative. So how do I treat this estimator? I want a positive volatility, not a negative! I am thinking of just applying absolute value on the second term, but that does not sound right. Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="9327" LastActivityDate="2020-02-16T18:45:11.443" Title="Negative high frequency intraday volatility - Zhou estimator" Tags="&lt;volatility&gt;&lt;variance&gt;&lt;tick-data&gt;&lt;intraday&gt;&lt;high-frequency-estimators&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17913" PostTypeId="2" ParentId="17844" CreationDate="2015-05-20T20:25:24.453" Score="1" Body="&lt;p&gt;In the Johansen methodology there are five models&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;unrestricted constant and unrestricted trend&lt;/li&gt;&#xA;&lt;li&gt;unrestricted constant and restricted trend&lt;/li&gt;&#xA;&lt;li&gt;unrestricted constant and no trend&lt;/li&gt;&#xA;&lt;li&gt;restricted constant and no trend&lt;/li&gt;&#xA;&lt;li&gt;no constant and no trend.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;As these models are nested they can be tested sequentially using likelihood ratio tests.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the usual sample sizes these processes can look very similar and the tests probably have low power and it is better to use your economic understanding of the variables involved. Chapter 5 of Johansen (1955), Likelihood -based inference in cointegrated vector autoregressive models contains more details of these models and their implication on the models being estimated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the residual based cointegration test the trend and constant can be included in the OLS estimation of the residuals and there is then no need to include a constant or trend in the cointegrating test regression. The decision to include a constant or trend in the first OLS estimation should be based on economic theory.   &lt;/p&gt;&#xA;" OwnerUserId="9458" LastActivityDate="2015-05-20T20:25:24.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17914" PostTypeId="2" ParentId="84" CreationDate="2015-05-20T20:37:48.673" Score="7" Body="&lt;p&gt;I'd like to give an alternative derivation not involving the clever (mystifying?) transformation to the heat equation and thus present a more general technique for solving constant coefficeint advection-diffusion PDEs.  All we need is the Fourier transform:&#xA;\begin{align*}&#xA;\mathcal{F}[f] &amp;amp; = \int_{-\infty}^\infty e^{-i \omega y} f(y) dy,&#xA;\end{align*}&#xA;where $\mathcal{F}[f] = \mathcal{F}[f](\omega)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We'll use the following well-known facts:&#xA;\begin{align*}&#xA;\mathcal{F}\left[ \frac{1}{s \sqrt{2\pi}} \exp\left( -\frac{1}{2}\left(\frac{y - m}{s}\right)^2\right) \right] &amp;amp; = \exp(-i \omega m - s^2\omega^2/2), \\&#xA;\mathcal{F}\left[\frac{ \partial^n f}{\partial y^n}\right] &amp;amp; = (i \omega)^n \mathcal{F}[f], \\&#xA;\mathcal{F}[cf] &amp;amp; = c \mathcal{F}[f], \\&#xA;\mathcal{F}[f \ast g] &amp;amp; = \mathcal{F}[f]\mathcal{F}[g],&#xA;\end{align*}&#xA;where the convolution $(f \ast g)(y) = \int_{-\infty}^\infty f(z)g(y-z)dz$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using @olaker's notation, start with the constant coefficient PDE ((3) above)&#xA;$$&#xA;\frac{\partial C}{\partial \tau} = \frac{\sigma^2}{2}\frac{\partial^2 C}{\partial y^2} + \left(r-\frac{\sigma^2}{2}\right)\frac{\partial C}{\partial y} - rC.&#xA;$$&#xA;&lt;strong&gt;Step 1.&lt;/strong&gt; Take the Fourier transform of each term term above and solve the resulting (very simple) ODE:&#xA;\begin{align*}&#xA;\frac{\partial \hat{C}}{\partial \tau} &amp;amp; = -\frac{\sigma^2 \omega^2}{2}\hat{C} + i \omega\left(r-\frac{\sigma^2}{2}\right)\hat{C} - r\hat{C}, \\&#xA;\hat{C} &amp;amp; = \hat{C}_0 e^{-r\tau} \exp \left(-\frac{\sigma^2 \omega^2}{2}\tau + i \omega\left(r-\frac{\sigma^2}{2}\right)\tau\right).&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step 2.&lt;/strong&gt; Letting $m = \left(\frac{\sigma^2}{2} - r\right)\tau$ and $s = \sigma \sqrt{\tau}$ from the Fourier transform notation, note &#xA;$$&#xA;\exp \left(-\frac{\sigma^2 \omega^2}{2}\tau + i \omega\left(r-\frac{\sigma^2}{2}\right)\tau\right) = \mathcal{F}\left[ \frac{1}{\sigma \sqrt{2\pi\tau}} \exp\left( -\frac{1}{2}\left(\frac{y - \left(\frac{\sigma^2}{2} - r\right)\tau}{\sigma \sqrt{\tau}}\right)^2\right) \right],&#xA;$$&#xA;so&#xA;\begin{align*}&#xA;\hat{C} &amp;amp; = \hat{C}_0 e^{-r\tau}\mathcal{F}\left[ \frac{1}{\sigma \sqrt{2\pi\tau}} \exp\left( -\frac{1}{2}\left(\frac{y - \left(\frac{\sigma^2}{2} - r\right)\tau}{\sigma \sqrt{\tau}}\right)^2\right) \right] \\&#xA;&amp;amp; = \frac{1}{\sigma \sqrt{2\pi\tau}} e^{-r\tau}\mathcal{F}\left[C_0 \ast \exp\left( -\frac{1}{2}\left(\frac{y - \left(\frac{\sigma^2}{2} - r\right)\tau}{\sigma \sqrt{\tau}}\right)^2\right) \right].&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step 3.&lt;/strong&gt; Take inverse transform: &#xA;\begin{align*}&#xA;C(y, \tau) &amp;amp; = \frac{1}{\sigma \sqrt{2\pi\tau}} e^{-r\tau} \int_{-\infty}^\infty C_0(z) \exp\left( -\frac{1}{2}\left(\frac{y - z - \left(\frac{\sigma^2}{2} - r\right)\tau}{\sigma \sqrt{\tau}}\right)^2\right) dz \\&#xA;C(y, \tau) &amp;amp; = \frac{1}{\sigma \sqrt{2\pi\tau}} e^{-r\tau} \int_{-\infty}^\infty C_0(z) \exp\left( -\frac{1}{2}\left(\frac{z - \left(y + \left(r - \frac{\sigma^2}{2}\right)\tau\right)}{\sigma \sqrt{\tau}}\right)^2\right) dz&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step 4.&lt;/strong&gt; Finally, change variables back $y \to S$, where we had $y = \log S$. Before we do this, note $S$ is really the ``initial'' stock price in the usual sense, i.e. $S = S_0$, but to be consistent we'll stick with $S$ as the initial (known) stock price.  We'll also transform the $z$ variable, suggestively calling it $S_T$ by $S_T = e^z$.&#xA;\begin{align*}&#xA;C(S, \tau) &amp;amp; = \frac{1}{\sigma \sqrt{2\pi\tau}} e^{-r\tau} \int_0^\infty C_0(S_T) \frac{1}{S_T} \exp\left( -\frac{1}{2}\left(\frac{\log S_T - \left(\log S + \left(r - \frac{\sigma^2}{2}\right)\tau\right)}{\sigma \sqrt{\tau}}\right)^2\right) dS_T.&#xA;\end{align*}&#xA;Just note&#xA;\begin{align*}&#xA;f(S_T) := \frac{1}{S_T \sigma \sqrt{2\pi\tau}} \exp\left( -\frac{1}{2}\left(\frac{\log S_T - \left(\log S + \left(r - \frac{\sigma^2}{2}\right)\tau\right)}{\sigma \sqrt{\tau}}\right)^2\right)&#xA;\end{align*}&#xA;is the probability density function for a log $\mathcal{N}\left(\log S + \left(r - \frac{\sigma^2}{2}\right)\tau, \sigma^2 \tau\right)$ random variable, and under Black-Scholes, this is indeed the distribution of $S_T$ under $\mathbb{Q}$.  Hence&#xA;\begin{align*}&#xA;C(S,\tau) = e^{-r\tau}\mathbb{E}_{\mathbb{Q}}[C_0(S_T)|\mathcal{F}_t].&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2015-05-20T20:37:48.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17915" PostTypeId="2" ParentId="4349" CreationDate="2015-05-20T20:55:35.897" Score="0" Body="&lt;p&gt;The VIX itself is connected to a special strip of options which is sensitive to just the volatility of an underlying in a non model dependent manner.  This can be performed for any underlying that has options on it, not just the S&amp;amp;P.  There is an excellent white paper regarding it you can find on the CBOE site.  &lt;a href=&quot;https://www.cboe.com/micro/vix/vixwhite.pdf&quot; rel=&quot;nofollow&quot;&gt;VIX White Paper&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may not be aware that there is also a skew index designed to be sensitive to the third moment of an underlying's distribution.  It uses a similar technique of putting together a strip of options to calculate that value.  I'm sure you could repeat to produce something that is sensitive to the fourth moment, which you can think of as vol-vol.  I'd also be surprised there is isn't a paper out there that has done this yet.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answer would then be to buy those options.&lt;/p&gt;&#xA;" OwnerUserId="16281" LastActivityDate="2015-05-20T20:55:35.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17916" PostTypeId="2" ParentId="17870" CreationDate="2015-05-20T21:08:28.570" Score="23" Body="&lt;p&gt;I've used both R and Python with Pandas in a professional quantitative financial work to do both large and small scale projects.  I would strongly recommend Python with Pandas over R for most new projects in the field especially in time series analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While I don't dispute vonjd in that you will find more libraries in R with algorithms on the bleeding edge of statistical research, the libraries in Python are very robust and fleshed out in that area.  Also, I find in my work and the work of my colleagues that we are grabbing libraries from electrical engineering, computer vision, big data and more.  People in these fields mostly have libraries in Python, not R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the main advantage of Python over R in this field is workflow.  The workflow with R tended to be that you used Perl/Python for data cleaning, preparation database work because R was too slow awkward for large complicated datasets though this is getting better.  You then build the statistical model in R taking advantage of its libraries.  Afterwards, the R model was rewritten in C for speed, control, interface, parallelization and error handling for production.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Python can handle this full workflow start to finish.  All the inter-connectivity steps surrounding the main research projects is much more robust and a lot of time is saved in development when using the same language throughout.  Also, with Pandas the even the core research portion and data handling is now easier and cleaner in my opinion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, if you are just focusing only on advanced statistics/data-mining time series research then R and Python with Pandas are interchangeable at least for now.  However it sounds like from your question that you are also are worried also about inter-connectivity and architecture for that Python is far superior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit for 2018:&#xA;It's amazing how much easier it is to get into data munging in Python these days compared to when I first wrote this.  Try &lt;a href=&quot;https://www.anaconda.com/&quot; rel=&quot;noreferrer&quot;&gt;Anaconda&lt;/a&gt; for those that would like to check out Python/Pandas without any fuss.&lt;/p&gt;&#xA;" OwnerUserId="5689" LastEditorUserId="5689" LastEditDate="2018-08-16T14:41:33.683" LastActivityDate="2018-08-16T14:41:33.683" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="17917" PostTypeId="1" CreationDate="2015-05-20T23:10:19.340" Score="4" ViewCount="464" Body="&lt;p&gt;Is there a simple integral that gives barrier option prices without having to deal with messy, hard PDEs and change of variables&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand there is a reflection principle such that the simulation stock prices bounces off the reflection at the barrier $b$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking the derivative with respect to $x$ and plugging in $b$ it's equal to zero, so the PDF should be something like this &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(e^{-((x-u)/a)^2/2}+e^{-((x+u-2b)/a)^2/2)})/(2\pi)^{1/2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and with the help of wolfram alpha I got this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know how to get this part: $(\frac{p}{b})^{a}$ Every barrier option pricing formula has this distinctive feature, but i don't know how you get that from $e^{a^2t+2b}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the integral &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://upload.wikimedia.org/math/9/d/8/9d80d384d06e1e2068c1463e08fe8a61.png&quot; rel=&quot;nofollow&quot;&gt;https://upload.wikimedia.org/math/9/d/8/9d80d384d06e1e2068c1463e08fe8a61.png&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15081" LastEditorUserId="15081" LastEditDate="2015-06-12T23:22:34.213" LastActivityDate="2015-06-12T23:22:34.213" Title="simple, intuitive barrier option derivation" Tags="&lt;options&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17918" PostTypeId="1" CreationDate="2015-05-20T23:21:42.297" Score="2" ViewCount="875" Body="&lt;p&gt;For the purpose of this question a local vol model is a 1d SDE which &#xA;specifies the price process and we have a contingent claim that depends on &#xA;those prices (in general, at multiple times).  e.g. $dX_t = \sigma(X_t, &#xA;t)dW_t$.  A stochastic vol model is an at least 2d SDE where one of the &#xA;equations is for the aforementioned prices process, but the additional &#xA;equations specify other variables that the price process is not independent &#xA;of.  e.g. $dX_t = X_t Y_t dW^1_t, dY_t = \nu Y_t dW^2_t$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you agree that in general, given a stochastic vol model, there is no &#xA;equivalent local vol model in the following sense:  The joint density across &#xA;all times of the price process $X_t$ in both models can be made the same.  In other words, given a set of prices of contingent claims on $X_t$(that &#xA;depend on multiple dates) a stochastic vol model determines, there is no &#xA;local vol model that gives the same set of prices.  If so, can you point me &#xA;in the direction of a proof of this?  If no proof is available, a nice &#xA;counterexample will suffice.  A local vol and stochastic vol model which &#xA;give the same vanilla options price, but have at least one different joint &#xA;density.&lt;/p&gt;&#xA;" OwnerUserId="16281" LastActivityDate="2015-05-21T11:49:33.923" Title="A Difference between Local Vol and Stochastic Vol Models" Tags="&lt;stochastic-volatility&gt;&lt;local-volatility&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17919" PostTypeId="2" ParentId="15797" CreationDate="2015-05-21T01:20:44.813" Score="5" Body="&lt;p&gt;Yahoo Finance calculates beta from monthly prices over a time of three years. The S&amp;amp;P500 is used as the benchmark&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need 37 monthly prices (so you can get 36 returns) on the first trading day of each month. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The final price should be on the first trading day of the previous month. &lt;/li&gt;&#xA;&lt;li&gt;The first price should be on the first trading day of the month 36 months prior to the previous month.&lt;/li&gt;&#xA;&lt;li&gt;These are closing prices (not the adjusted close)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You then calculate the monthly returns for your stock and benchmark. You can then calculate beta using Excel (for example, using the slope function). e.g. =SLOPE(range of stock returns, range of benchmark returns)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;a href=&quot;http://investexcel.net/how-does-yahoo-finance-calculate-beta/&quot; rel=&quot;noreferrer&quot;&gt;This website&lt;/a&gt; contains more detail, and has reproduced the beta given by Yahoo Finance for a specific stock.&lt;/p&gt;&#xA;" OwnerUserId="16302" LastActivityDate="2015-05-21T01:20:44.813" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17920" PostTypeId="2" ParentId="17917" CreationDate="2015-05-21T01:56:20.820" Score="4" Body="&lt;p&gt;Try this paper by Rolf Poulsen : &lt;a href=&quot;http://colloquium.mathfinance.de/abstracts/poulsen.pdf&quot; rel=&quot;nofollow&quot;&gt;http://colloquium.mathfinance.de/abstracts/poulsen.pdf&lt;/a&gt;.  He derives barrier option prices in the Black-Scholes model using only reflection and Girsanov's Theorem, and then discusses extensions.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2015-05-21T01:56:20.820" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17921" PostTypeId="2" ParentId="4349" CreationDate="2015-05-21T02:56:13.760" Score="0" Body="&lt;p&gt;Varswap vs volswap would do the trick. Similarly, varswap vs straddle more or less accomplishes the same thing (more local wrt spot), or even a strangle vs straddle (ratio'd vega neut) as the poor mans vol of vol trade. &lt;/p&gt;&#xA;" OwnerUserId="15229" LastActivityDate="2015-05-21T02:56:13.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17922" PostTypeId="1" CreationDate="2015-05-21T03:28:13.643" Score="1" ViewCount="77" Body="&lt;p&gt;Assume my firm is based in USD and agrees with some counterparty to buy, at time $T$, some quantity $Q$ of asset $A$ for a fixed price $K$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume also that $A$ prices and $K$ are denominated in EUR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume also that we have forward prices:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;For $A$, denotated by $F^A(t,T)$&lt;/li&gt;&#xA;&lt;li&gt;For the FX rate, denotated by $F^{FX}(t,T)$, expressed in USD per EUR.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Now my mark-to-market at time $t$ for this agreement is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{MTM}_t = DF(t,T)\cdot  Q\cdot( F^A(t,T) - K ) \cdot F^{FX}(t,T)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to hedge my position for both FX and market effects, assuming I can get perfectly matching contracts for asset and FX in order to hedge.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would sell $Q$ &quot;lots&quot; of to $F^A(t,T)$ hedge the dynamics of the hedge. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I'm unclear how much to hedge for the FX. Indeed, my FX exposure at time $t$ is $F^A(t,T) - K$, which can vary very much from $F^A(t-1,T) - K$ and hence results in an hedge completely off. So, what should be the amount to hedge in FX? I thought about $\mathbb{E}[ F^A(t,T) - K | \mathcal{F_{t-1}}]$ but my backtest doesn't give me good results at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a common way of hedging this king of &quot;spread&quot; exposure?&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2015-06-20T10:42:05.917" Title="How to effectively hedge a Fixed-Term deal in a foreign currency?" Tags="&lt;risk-management&gt;&lt;fx&gt;&lt;hedging&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17923" PostTypeId="2" ParentId="2828" CreationDate="2015-05-21T05:33:48.387" Score="2" Body="&lt;p&gt;One way to start thinking about this is to work out a couple of&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;&lt;a href=&quot;http://math.hawaii.edu/wordpress/bjoern/discrete-versions-of-itos-lemma/&quot; rel=&quot;nofollow&quot;&gt;Discrete versions of Ito's lemma&lt;/a&gt;&lt;/h2&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Øksendal (6th edition) Example 3.1.9: almost surely,&#xA;    $$&#xA;		B_t^2 - t = \int_0^t 2B_s dB_s&#xA;		$$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This has a discrete version which holds everywhere: let $X_n=\pm 1$ and $S_n=\sum_{i=1}^n X_i$, then &#xA;$$&#xA;S^2_n-n = 2\sum_{i=0}^{n-1} S_i X_{i+1} &#xA;$$&#xA;To verify just note that both sides increase by $2S_{n-1}X_n$ when going from $n-1$ to $n$.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;Øksendal's exercise 4.2:&#xA;    $$&#xA;		B_t^3 = \int_0^t 3B_s ds + \int_0^t 3B_s^2 dB_s&#xA;		$$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Here the discrete version is not a perfect analogue:&#xA;$$&#xA;S_n^3 - S_n = 3\sum_{i=0}^{n-1} (S_i + S_i^2 X_{i+1})&#xA;$$&#xA;The extra term $S_n$ seems related to the fact that $(dB_t)^3 = 0$.&lt;/p&gt;&#xA;" OwnerUserId="7431" LastActivityDate="2015-05-21T05:33:48.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17924" PostTypeId="1" CreationDate="2015-05-21T09:48:26.837" Score="2" ViewCount="265" Body="&lt;p&gt;I would like to identify the orders p and q for ARIMA model using least squares method in Matlab. &#xA;I have got also two data files (one with noise and one without)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Previously I identified p and q for AR and MA using ACF function and PACF, but now I have mixed model (ARIMA). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you give any tip hint how to do this? &lt;/p&gt;&#xA;" OwnerUserId="16305" LastActivityDate="2015-05-25T22:44:08.970" Title="How to identify the orders p and q for ARIMA model using least squares method?" Tags="&lt;statistics&gt;&lt;matlab&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17925" PostTypeId="1" CreationDate="2015-05-21T09:52:12.387" Score="4" ViewCount="1432" Body="&lt;p&gt;Consider a hypothetical Payment in Kind (PIK) bond of XYZ Corporation.&#xA;The bond has 2 years to maturity, a face value of $1000, and has an annual coupon rate of 10%. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Coupons are paid annually.&#xA;XYZ has the right to pay the first coupon either in cash or in additional PIK bonds – i.e., the bond holder may get either $100 in cash or 10 additional PIK bonds for every 100 bonds she has. The second coupon must however be paid in cash along with the face value at the end of two years.&#xA;The PIK bonds are risk free and trade at par while the yield curve is flat at 9% &lt;/p&gt;&#xA;&#xA;&lt;p&gt;risk free 1 year and 2 year zero coupon bonds trade at a yield to maturity of 9% (Effective Annual Yield).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose you can buy and short sell (borrow and sell) the PIK and zero coupon bonds without transactions costs. You forecast that the yield to maturity on one year zero coupon bonds one year from now will either stay at 9% or change to 8.5% or 9.5%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) Assume XYZ always pays the first coupon in cash, what should be the price of the bond?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) Given your forecast on future interest rate (as stated in the problem), show that there is an arbitrage opportunity. (&lt;/p&gt;&#xA;" OwnerUserId="13464" LastActivityDate="2015-08-26T12:33:18.137" Title="Arbitrage question" Tags="&lt;arbitrage&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17926" PostTypeId="2" ParentId="17918" CreationDate="2015-05-21T10:02:34.187" Score="6" Body="&lt;p&gt;The local vol model has exactly enough freedom to match the individual densities $X_t.$  There is no additional freedom in the local vol model to match even a joint density for a pair of times $(X_t,X_s).$  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you ask about the joint density across the continuum of times $t \in [0,T]$ it is pretty easy to show that any local vol model differs from any stochastic vol model provided the stochastic volatility model has nonzeeo vol-of-vol.  That is because the joint density along the continuum of times gives full information about the measure on paths $X_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a local vol model, the instantaneous variance of a path $X_t$ at time $t$ is almost surely $\sigma^2(X_t,t).$  For a stochastic volatility model with nontrivial vol-of-vol this is not true for $t&amp;gt;0$: the instantaneous variance at time $t$ conditioned on $X_t$ is a random variable with mean $\sigma^2(X_t,t)$ but posive variance. &lt;/p&gt;&#xA;" OwnerUserId="11936" LastEditorUserId="11936" LastEditDate="2015-05-21T11:49:33.923" LastActivityDate="2015-05-21T11:49:33.923" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17927" PostTypeId="2" ParentId="17922" CreationDate="2015-05-21T10:37:20.000" Score="1" Body="&lt;p&gt;You have already agreed to pay $QK$ EUR at $T$ to receive $Q$ units of A.  If you sell $Q$ lots of $F^A(t,T)$ then you will receive $Q F^A(t,T)$ EUR and deliver $Q$ units of A. The combined flow is now just in EUR: at $T$ you receive a net of $Q(F^A(t,T)-K)$ EUR.  You can hedge that by selling $Q(F^A(t,T)-K)$ of $F^{FX}(t,T).$  Then with both hedges, the net flow is just you receive $Q(F^A(t,T)-K)F^{FX}(t,T)$ USD at $T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are confusing yourself by trying to calculate the FX hedge without assuming the asset hedge is in place.  Indeed, if you didn't hedge the asset move but did hedge the FX move, the FX hedge has to be rebalanced every time the asset price moves, which is what you are seeing. &lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2015-05-21T10:37:20.000" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17928" PostTypeId="2" ParentId="17912" CreationDate="2015-05-21T16:12:38.843" Score="0" Body="&lt;p&gt;I think it's ok: the total correction is $\approx -N\eta^2 \sim N^{-1/2},$ which tends to zero for large $N.$ So as long as it is a correction to the estimator $Q &amp;gt; 0$ you are ok.&lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2015-05-21T16:12:38.843" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="17929" PostTypeId="1" AcceptedAnswerId="17939" CreationDate="2015-05-21T17:07:13.243" Score="-4" ViewCount="292" Body="&lt;p&gt;Assume the zero-coupon bonds from 1 year to 4 years are all available, and the current 1-year, 2-year, 3-year and 4-year spot rates are 4%, 5%, 6% and 7% accordingly. Interest rates are annually compounded. You want to lock in a 1-year interest rate beginning in 3 years, by using some of the zero-coupon bonds above. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question: ) Which zero-coupon bonds would you use? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And what is the locked-in 1-year rate beginning in 3 years?&lt;/p&gt;&#xA;" OwnerUserId="13464" LastActivityDate="2015-05-22T00:54:56.757" Title="Zero coupon bonds" Tags="&lt;spot-rate&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2015-05-22T06:52:37.273" ContentLicense="CC BY-SA 3.0" />
  <row Id="17932" PostTypeId="1" AcceptedAnswerId="19163" CreationDate="2015-05-21T18:54:34.633" Score="2" ViewCount="1637" Body="&lt;p&gt;My strategy is designed to buy and sell all assets of a universe and rebalance periodically. It goes either long or short. To limit risk exposure to a single currency I would like the assets in the universe to have low relashionship and low price correlation between them (positive or even negative as it can go short).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if the universe has 3 currency pairs A, B and C, my objective is to have price correlation c1 (between A and B), c2 (between B and C) and c3 (between A and C) as low as possible. Let's say c0 is the average of c1, c2, and c3, it will give information on the &quot;global&quot; correlation between pairs A, B and C.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now imagine we have 26 currency pairs (from A to Z) to consider for creating a small universe of 5 of them (3 was for the example). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The method I apply is to create every possible combination of groups of 5 currency pairs and then it calculates c0 &lt;code&gt;correl$corr&lt;/code&gt; of every single group. I also calculate standard deviation of c1, c2 and c3 &lt;code&gt;correl$stddev&lt;/code&gt; as it will filter out groups with low c0 and high c1, c2 and c3. Finally I sum the global correlation and the stddev in order to rank groups with a single value &lt;code&gt;correl$&quot;corr+stddev&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this example 16 pairs are candidates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My dataset is an xts object with historical prices of the 16 currency pairs. I could extend it to ~50 to improve the selection as I guess bigger is the pool and better it must be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is how I proceed to achieve this :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Put all symbols name in a list &#xA;pairs &amp;lt;- names(mydata)&#xA;# Create groups of 5 currency pairs with no duplication&#xA;group &amp;lt;- combn( pairs , 5 )&#xA;# Calculate number of groups&#xA;nb_group &amp;lt;- ncol(group)&#xA;# Create empty object to store my result&#xA;result &amp;lt;- NULL&#xA;# For every groups&#xA;for (i in 1:nb_group) {&#xA;&#xA;  # Calculate the mean correlation for the group&#xA;  correl &amp;lt;- round(mean(cor(mydata[, group[,i]])),3)&#xA;  # Transform as data frame and give a name&#xA;  correl &amp;lt;- as.data.frame(correl)&#xA;  colnames(correl) &amp;lt;- &quot;cor&quot;&#xA;  rownames(correl) &amp;lt;- toString(group[,i])&#xA;  # Calculate stddev and the sum of correlation and stddev&#xA;  correl$stddev &amp;lt;- round(sd(cor(mydata[, group[,i]])),3)&#xA;      correl$&quot;cor+sddev&quot; &amp;lt;- correl$cor + correl$stddev&#xA;  # export data&#xA;  result &amp;lt;- rbind(correl, result)&#xA;}&#xA;&#xA;# Basket of currency pairs with the lowest correlation and stddev&#xA;head(result[order(result[,3]),])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This return something like :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; head(result[order(result[,3]),])&#xA;                                          cor stddev      cor+sddev&#xA;GBPUSD, USDCAD, USDRUB, USDTRY, NZDUSD  0.032  0.583          0.615&#xA;GBPUSD, USDCHF, USDCAD, USDRUB, USDTRY  0.048  0.569          0.617&#xA;GBPUSD, USDJPY, USDRUB, USDTRY, NZDUSD  0.052  0.576          0.628&#xA;GBPUSD, USDCAD, EURCHF, USDRUB, USDTRY  0.048  0.582          0.630&#xA;GBPUSD, USDCAD, USDRUB, USDMXN, NZDUSD  0.065  0.566          0.631&#xA;GBPUSD, USDCHF, USDCAD, USDRUB, USDMXN  0.097  0.536          0.633&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Result is same when I average correlation and stddev (instead of the sum)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Do you think R could help to achieve this and is there a more efficient approach to create such basket of currency pairs ?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've checked portfolio optimization packages like &lt;a href=&quot;http://www.google.fr/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0CCQQFjAA&amp;amp;url=http%3A%2F%2Fcran.r-project.org%2Fweb%2Fpackages%2Ftawny%2Ftawny.pdf&amp;amp;ei=DSFeVd6EFcGkUqfhgWg&amp;amp;usg=AFQjCNGpK39vNAup5RK-cImXyna4xqxxhg&amp;amp;bvm=bv.93756505,d.d24&quot; rel=&quot;nofollow&quot;&gt;tawny&lt;/a&gt;, &lt;a href=&quot;https://r-forge.r-project.org/R/?group_id=579&quot; rel=&quot;nofollow&quot;&gt;PortfolioAnalytics&lt;/a&gt; and &lt;a href=&quot;http://cran.r-project.org/web/packages/fPortfolio/index.html&quot; rel=&quot;nofollow&quot;&gt;fPortfolio&lt;/a&gt; but unfortunatly I'm not familiar with financial formulas and I got lost.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you,&#xA;Florent&lt;/p&gt;&#xA;" OwnerUserId="15328" LastEditorUserId="15328" LastEditDate="2015-05-22T08:37:52.350" LastActivityDate="2015-11-02T05:11:39.927" Title="How to create a basket of currency pairs with the lowest correlation in R?" Tags="&lt;r&gt;&lt;fx&gt;&lt;correlation&gt;&lt;correlation-matrix&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17933" PostTypeId="1" CreationDate="2015-05-21T19:12:06.487" Score="1" ViewCount="875" Body="&lt;p&gt;I am trying to derive the HJB equation in a stochastic setting. Let&#xA;me exemplify my problem with the simplest case where there is no control,&#xA;just one state variable. Assume the payoff is given by&#xA;$$&#xA;V(X_{t})\equiv E_{t}\left\{ \int_{t}^{\infty}e^{-\rho(s-t)}u(X_{s})ds\right\} &#xA;$$&#xA;where $X_{t}$ is given by&#xA;$$&#xA;dX_{t}=\mu(X_{t})dt+\sigma(X_{t})dZ_{t}&#xA;$$&#xA;and $Z_{t}$ is the standard Brownian Motion. For any $dt&amp;gt;0$ we can&#xA;write:&#xA;$$&#xA;V(X_{t})=E_{t}\left\{ \int_{t}^{t+dt}e^{-\rho(s-t)}u(X_{s})ds+e^{-\rho dt}V(X_{t+dt})\right\} &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\left(1-e^{-\rho dt}\right)V(X_{t})=E_{t}\left\{ \int_{t}^{t+dt}e^{-\rho(s-t)}u(X_{s})ds+e^{-\rho dt}\left[V(X_{t+dt})-V(X_{t})\right]\right\} \tag{1}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From Ito calculus we get that (and assuming that $W(\cdot)$ is well behaved):&#xA;$$&#xA;V(X_{t+dt})-V(X_{t})=\int_{t}^{t+dt}V'(X_{s})dX_{s}+\frac{1}{2}\int_{t}^{t+dt}V''(X_{s})d[X_{s}]=\int_{t}^{t+dt}V'(X_{s})dX_{s}+\frac{1}{2}\int_{t}^{t+dt}\sigma(X_{s})^2V''(X_{s})ds&#xA;$$&#xA;where the last equality follows from the known properties of the quadratic&#xA;variation of the process $X_{t}$. Plugging this back in (1):&#xA;$$&#xA;\left(1-e^{-\rho dt}\right)V(X_{t})=E_{t}\left\{ \int_{t}^{t+dt}e^{-\rho(s-t)}u(X_{s})ds+e^{-\rho dt}\left[\int_{t}^{t+dt}V'(X_{s})dX_{s}+\frac{1}{2}\int_{t}^{t+dt}\sigma(X_{t})^2V''(X_{s})ds\right]\right\} &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dividing both sides by $dt$ and taking the limit $dt\rightarrow0$:&#xA;$$&#xA;\rho V(X_{t})=E_{t}\left\{ u(X_{t})+\lim_{dt\rightarrow0}\frac{\int_{t}^{t+dt}V'(X_{s})dX_{s}}{dt}+\frac{1}{2}\sigma(X_{t})^2V''(X_{t})\right\} &#xA;$$&#xA;where I used the fact that when dealing with the Riemann integral:&#xA;$\lim_{dt\rightarrow0}\frac{\int_{t}^{t+dt}f(x_{s})ds}{dt}=f(x_{t})$ (from standard&#xA;calculus).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see, I am almost there. I just don't know how to deal with&#xA;term $\lim_{dt\rightarrow0}\frac{\int_{t}^{t+dt}V'(X_{s})dX_{s}}{dt}$.&#xA;For example, assume $\mu(X_{t})=0$ and $\sigma(X_{t})=1$, so&#xA;that $X_{t}$ is simply the standard Brownian Motion $Z_{t}$. In&#xA;that case, to get the HJB formula right I would need:&#xA;$$&#xA;\lim_{dt\rightarrow0}\frac{\int_{t}^{t+dt}V'(Z_{s})dZ_{s}}{dt}=0&#xA;$$&#xA;But I don't know how to prove that this is true. More generally (for&#xA;any $\mu(X_{t})$ and $\sigma(X_{t})$), I would need to prove:&#xA;$$&#xA;\lim_{dt\rightarrow0}\frac{\int_{t}^{t+dt}V'(X_{s})dX_{s}}{dt}=\mu(X_{t})V'(X_{t})&#xA;$$&#xA;which I am also not sure how to do. Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="16309" LastEditorUserId="848" LastEditDate="2015-07-21T07:11:26.633" LastActivityDate="2015-07-21T07:11:26.633" Title="Derivation of HJB equation" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17934" PostTypeId="2" ParentId="17933" CreationDate="2015-05-21T19:56:04.530" Score="1" Body="&lt;p&gt;By using the fact that the brownian integral has expected value $0$, we find&#xA;\begin{eqnarray*}&#xA;&amp;amp; &amp;amp; \left(1-e^{-\rho dt}\right)v(X_{t}) \\&#xA;&amp;amp;=&amp;amp; E_{t}\left\{ \int_{t}^{t+dt}e^{-\rho(s-t)}u(X_{s})ds+e^{-\rho dt}\left[\int_{t}^{t+dt}v'(X_{s})dX_{s}+\frac{1}{2}\int_{t}^{t+dt}\sigma(X_{s},s)^2 v''(X_{s})ds\right]\right\} \\&#xA;&amp;amp;= &amp;amp; E_{t}\left\{ \int_{t}^{t+dt}e^{-\rho(s-t)}u(X_{s}) +e^{-\rho dt}\left(v'(X_{s})\mu(s,X_s) +\frac{1}{2}\sigma(X_{s},s)^2 v''(X_{s})\right)ds\right\}&#xA;\end{eqnarray*}&#xA;So the PDE is &#xA;\begin{eqnarray*}&#xA;\rho v(x) &amp;amp;=&amp;amp; u(x) + \left(\mu(t,x) v'(x) +\frac{1}{2}\sigma(t,x)^2 v''(x)\right)&#xA;\end{eqnarray*}&#xA;or &#xA;\begin{eqnarray*}&#xA; (- \mathcal{A}_t + \rho) v(x) &amp;amp;=&amp;amp; u(x) &#xA;\end{eqnarray*}&#xA;where $\mathcal{A}_t = \mu(t,x)\partial_x + \frac{1}{2}\sigma(t,x)^2 \partial_x^2$ is the generator of the diffusion. &lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2015-05-21T19:56:04.530" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17937" PostTypeId="1" AcceptedAnswerId="17938" CreationDate="2015-05-21T21:47:08.817" Score="1" ViewCount="408" Body="&lt;p&gt;Consider a 2-period binomial tree where the derivative price is $f$ and the stock price is $S$.  Also, let the bond be deterministic with continuous growth rate $r$ and initial value $B_0$.  &lt;a href=&quot;https://i.stack.imgur.com/Oy6oA.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;binomial tree&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recall the replicating strategy is at each time $t_i$ hold $\phi_i = \frac{f_{i+1}^{up} - f_{i+1}^{down}}{S_{i+1}^{up} - S_{i+1}^{down}}$ units of the stock and $\psi_i = B_0^{-1} e^{-r(i+1)\Delta t}(f_{i+1}^{up} - \phi_i S_{i+1}^{up})$ units of the bond.  In particular, the value of the portfolio at time $0$ is $V_0 = \phi_0 S_0 + \psi_0 B_0$.  When we arrive at time tick 1, lets say our stock price went up to $S_3$.  Before rebalancing, our portfolio is worth $V_0|_{end} = \phi_0 S_3 + \psi_0 B_0e^{r \Delta t}$, and after rebalancing it is $V_1 = \phi_1 S_3 + \psi_1 B_0e^{r \Delta t}$.  In order for this to be self-financing, we must have $V_1 - V_0|_{end} = 0$.  However,&#xA;\begin{align*}&#xA;V_1 - V_0|_{end} &amp;amp; = (\phi_1 - \phi_0)S_3 + (\psi_1 - \psi_0)B_0e^{r \Delta t} \\&#xA;&amp;amp; = (\phi_1 - \phi_0)S_3 + \left(B_0^{-1} e^{-2r\Delta t}(f_7 - \phi_1 S_{7}) - B_0^{-1} e^{-r\Delta t}(f_{3} - \phi_0 S_{3})\right)B_0e^{r \Delta t} \\&#xA;&amp;amp; = (\phi_1 - \phi_0)S_3 + e^{-r\Delta t}(f_7 - \phi_1 S_{7}) - (f_{3} - \phi_0 S_{3}) \\&#xA;&amp;amp; = \phi_1 S_3 + e^{-r\Delta t}(f_7 - \phi_1 S_{7}) - f_{3} \\&#xA;&amp;amp; = \frac{f_{7} - f_{6}}{S_7 - S_6} S_3 + e^{-r\Delta t}(f_7 - \frac{f_{7} - f_{6}}{S_7 - S_6} S_{7}) - f_{3} \\&#xA;&amp;amp; = \frac{1}{S_7 - S_6} \left((f_{7} - f_{6})S_3 + (S_7 - S_6)e^{-r\Delta t}f_7 - e^{-r\Delta t}(f_{7} - f_{6}) S_{7} - (S_7 - S_6)f_{3} \right)\\&#xA;&amp;amp; = \frac{1}{S_7 - S_6} \left((f_{7} - f_{6})S_3 - S_6e^{-r\Delta t}f_7 + e^{-r\Delta t}f_{6} S_{7} - (S_7 - S_6)f_{3} \right)\\&#xA;&amp;amp; \neq 0.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems a lot of effort is put into self-financing strategies, and in fact the binomial representation theorem is used to prove the existence of them in the binomial model.  Am I missing something?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2015-05-22T01:01:39.533" Title="Is the Binomial Tree Model not self-financing?" Tags="&lt;options&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17938" PostTypeId="2" ParentId="17937" CreationDate="2015-05-21T22:30:32.717" Score="1" Body="&lt;p&gt;I'd add a comment if I could but don't have enough reputation.  How do you know your final equation is not equal to zero.  The $f_i$ have not yet been calculated in terms of $S$.  Certainly the $f_i$ that are in the final set of nodes are known since they are defined in terms of the payoff and the terminal price.  The ones in intermediate steps have to be calculated.&lt;/p&gt;&#xA;" OwnerUserId="16281" LastEditorUserId="16281" LastEditDate="2015-05-21T22:42:08.917" LastActivityDate="2015-05-21T22:42:08.917" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17939" PostTypeId="2" ParentId="17929" CreationDate="2015-05-22T00:54:56.757" Score="0" Body="&lt;p&gt;You're asking for the forward rates between 3y and 4y. I don't want to tell you the answer because it's something that you should attempt. Please read the section on forward rates and how to get the implied interest rate from a zero coupon bond.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2015-05-22T00:54:56.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17940" PostTypeId="2" ParentId="17937" CreationDate="2015-05-22T01:01:39.533" Score="2" Body="&lt;p&gt;The binomial model certainly is self-financing. First, get the value at every node by working backwards using risk-neutral evaluation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then at each step and node, you get the value in the up node and the down node from where you are. You can fit a straight line as a function of stock through the two. You hold stocks and bonds to fit this straight line with a replicating portfolio. The cost of set-up is precisely the price at the node you are currently at and it is self-financing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think you need to read an account that's a little more discursive and less equationy (see eg my book Concepts) or actually do an example numerically. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-05-22T01:01:39.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17941" PostTypeId="2" ParentId="17912" CreationDate="2015-05-22T06:42:33.193" Score="0" Body="&lt;p&gt;Well for real hf stock tick data, i do get negativa volatility. So it can happens for large N&lt;/p&gt;&#xA;" OwnerUserId="16313" LastActivityDate="2015-05-22T06:42:33.193" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17942" PostTypeId="1" AcceptedAnswerId="17943" CreationDate="2015-05-22T08:04:01.670" Score="3" ViewCount="451" Body="&lt;p&gt;I was wondering what the overall approach/intuition behind how to price options under Jump Diffusion Models. My understanding is under Diffusion models such as Geometric Brownian Motion (Black Sholes), allows for concept of complete markets in particular that the perfect hedging strategies thus one can replicate a call option thus leading to a pricing of the options by a no arbitrage argument. But since in Jump Diffusion models markets are incomplete, how would one approach this problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There may be some fundamental misunderstanding that I have with problem of pricing a derivative. So as an additional question, when someone prices a derivative what is one usual thought process in deciding a price?&lt;/p&gt;&#xA;" OwnerUserId="11756" LastActivityDate="2015-05-22T08:52:34.633" Title="Option Pricing under Jump Diffusion Models" Tags="&lt;option-pricing&gt;&lt;derivatives&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17943" PostTypeId="2" ParentId="17942" CreationDate="2015-05-22T08:52:34.633" Score="3" Body="&lt;p&gt;The first consideration is to set prices which do not generate arbitrage opportunities. The existence of a risk-neutral probability measure ensures that the model is arbitrage-free. In the Black-Scholes setting, as you mentioned, the market is complete and there as a unique martingale measure, hence only one possible price for each derivative. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a jump-diffusion setting, due to incompleteness, you have many possible risk-neutral measures, hence many ways to price a derivative. You will get an interval of possible prices which cannot be aribtraged by the underlying assets of that economy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So that is where the problem starts, since you will have to make a choice in some specific risk-neutral measure. There is a myriad of ways to do that, each of which will be based on your own preferences and assumptions. One way is to have a utility function on the payoff and try to maximise that. The original idea of Merton, when he introduced the jump-diffusion, was to use Girsanov and only change the drift of the diffusion part and leave the jumps untouched. This has the interpretation that the price of the jump-risk is 0. His reasoning was that the jumps could be diversified away in a portfolio of many stocks (this is obviously not true since most assets are correlated). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Financial modelling with Jump Processes&lt;/em&gt; by by Rama Cont &amp;amp; Peter Tankov treats many of the alternative ways to price in incomplete markets.&lt;/p&gt;&#xA;" OwnerUserId="7555" LastActivityDate="2015-05-22T08:52:34.633" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17944" PostTypeId="1" CreationDate="2015-05-22T11:25:55.903" Score="0" ViewCount="77" Body="&lt;p&gt;&lt;em&gt;Problem&lt;/em&gt; True or fale? The stock of a firm has an expected return of 10%, and a volatility of 10%. The weight of the &#xA;stock in a portfolio is 5%, and the correlation of the stock’s return with the portfolio is 0.5. In that case, &#xA;the contribution of the stock to the volatility of the portfolio is 0.25%. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Attempt&lt;/em&gt; $Var(Portfolio)=Var(aX,bY)=a^2 VarX + b^2 VarY+2ab StDev(X) StDev(Y) Corr(X,Y)$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;so $Var(Portfolio)_{contributedByX}=a^2 VarX + +2aStDev(X)Corr(X,Y)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and we have Corr(X,Y)=0.5 ;  VarX=10% ; a=5%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I get $Var(Portfolio)_{contributedByX} = 0.050025 $ so $Volatility=\sqrt{0.050025}=0.22366...$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Solution&lt;/em&gt; True, is the right answer. So 0.22366 must be wrong..&lt;/p&gt;&#xA;" OwnerUserId="12002" LastEditorUserId="12002" LastEditDate="2015-05-22T12:44:24.790" LastActivityDate="2015-05-22T13:45:48.847" Title="Portfolio volatility" Tags="&lt;volatility&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17945" PostTypeId="1" CreationDate="2015-05-22T13:15:13.053" Score="5" ViewCount="322" Body="&lt;p&gt;In some texts (e.g. Baxter &amp;amp; Rennie, Shreve I) the binomial model is first constructed using the usual backward induction argument, and it is concluded that by no-arbitrage the time $t$ value of a claim with time $T$ payoff $X$ is $\mathbb{E}_\mathbb{Q}[\frac{B_t}{B_T} X|\mathcal{F}_t]$, where $B_t$ is the price of a cash bond at time $t$.  In other words, &lt;em&gt;because we determined the price of the claim at each step, the price of the portfolio that replicates that claim must be the claim's price at each step, else arbitrage.&lt;/em&gt; There is no mention of self-financing strategies (SFSs) or binomial representation theorem (BRT); rather, we explicitly construct a hedging strategy that replicates the claim's payoff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Only after we have determined this price does it seems like the concept of SFSs are introduced, with the BRT invoked to prove the existence of them.  Then we use a slightly different argument to arrive at the same price: the value of a SFS that replicates $X$ is $\mathbb{E}_\mathbb{Q}[\frac{B_t}{ B_T} X|\mathcal{F}_t]$ by the BRT, and &lt;em&gt;because this is a SFS that replicates $X$ this must be the price of the claim, else arbitrage.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So we have two distinct approaches to arrive at the same conclusion.  My question is, what purpose does the BRT serve in the binomial model?  Does it just serve as an intuition builder for the martingale representation theorem (MRT) in continuous time models, where explicit construction of the hedging strategy isn't as clear?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that's the case, it seems the BRT is specific to the binomial model, while the MRT is model-free.  Is this correct?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastEditorUserId="16328" LastEditDate="2015-05-23T17:51:39.773" LastActivityDate="2015-06-27T21:17:00.740" Title="Need for Binomial Representation Theorem" Tags="&lt;option-pricing&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17946" PostTypeId="2" ParentId="17944" CreationDate="2015-05-22T13:45:48.847" Score="2" Body="&lt;p&gt;For a portfolio you have that the variance is:&#xA;$$&#xA;\sigma^2 = w \Sigma w&#xA;$$&#xA;Thus the volatility is $\sigma^2/\sigma = w \Sigma w/\sigma$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just focusing on one asset with weight $w_i$ and return $r_i$ we get &#xA;$$&#xA;\sigma^2 = covar(\sum_{i=1}^n w_i r_i, r_P) = \sum_{i=1}^n w_i covar(r_i, r_P),&#xA;$$&#xA;where $r_p$ is the return of the portfolio, and thus&#xA;$$&#xA;\sigma  = \sum_{i=1}^n w_i covar(r_i, r_P)/\sigma.&#xA;$$&#xA;Thus the risk contribution to volatility by asset $i$ can be formulated as&#xA;$$&#xA;w_i covar(r_i, r_P)/\sigma.&#xA;$$&#xA;Pluggin in your numbers we get (using $covar(r_i,r_p) = \sigma_i \cdot cor \cdot \sigma$ and simplifying $\sigma$ from the above equation )&#xA;$$&#xA;5\% \cdot 10\% \cdot 0.5 = 0.25\%.&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-05-22T13:45:48.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17947" PostTypeId="1" AcceptedAnswerId="17950" CreationDate="2015-05-22T14:01:04.497" Score="1" ViewCount="649" Body="&lt;p&gt;I am studying the Markowitz portfolio optimization theory, and I just wanted to ask if I understood this correctly. For a stock portfolio we distinguish two kinds of risks: an unsystematic risk, which is due to the correlations between the stocks and which can be minimized by diversification, and a systematic risk, which is  due to general trends in the market and which cannot be reduced by diversification.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, Markowitz portfolio optimization is a procedure to minimize this unsystematic risk by choosing appropriate weights. Right? It only deals with the unsystematic risk and not with the systematic one. Is there a way to reduce the systematic risk?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="16316" LastActivityDate="2015-05-22T21:00:03.573" Title="Markowitz portfolio optimization question" Tags="&lt;risk&gt;&lt;modern-portfolio-theory&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17948" PostTypeId="1" AcceptedAnswerId="17958" CreationDate="2015-05-22T16:41:07.830" Score="1" ViewCount="400" Body="&lt;p&gt;I've just started reading about expected utility and utility functions and have the following question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\textbf{Question:}$ An investor has an initial wealth of 100 and a utility function of the form:&#xA;\begin{align}&#xA;U(w) = \log(w)&#xA;\end{align}&#xA;What is their expected utility?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Upon one of the slides I found on the web it states the following:  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\textbf{Calculating Expected Utility}$&lt;br&gt;&#xA;1. When the choice variable $x$ is constant, then $E(U(x)) = U(x)$.&lt;br&gt;&#xA;2. When the choice variable $x$ is a random variable, then $E(U(x))$ is driven by the PDF of $x$.&lt;br&gt;&#xA;3. If $x$ has $k$ outcomes, each with probability $p_k$, then &#xA;\begin{align}&#xA;E(U(x)) = \sum_{1}^{k} p_i U(x_i)&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I'm told the initial wealth is 100 does this simply mean the expected utility is $E(U(100)) = \log(100)$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apologies if this is trivial - I'm just starting out.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;All help is appreciated.&lt;br&gt;&#xA;John&lt;/p&gt;&#xA;" OwnerUserId="15796" LastActivityDate="2016-09-23T06:03:09.737" Title="Expected Utility and $\log$" Tags="&lt;risk&gt;&lt;modern-portfolio-theory&gt;&lt;utility-theory&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17949" PostTypeId="2" ParentId="8119" CreationDate="2015-05-22T18:47:17.843" Score="0" Body="&lt;p&gt;Have you thought about opening an &lt;a href=&quot;http://www.interactivebrokers.com&quot; rel=&quot;nofollow&quot;&gt;Interactive Brokers&lt;/a&gt; paper trading account?  They keep track of the total return, though their reporting can be trickier to use than it should be.  It's also a very good simulation of what investment professionals use, since it's what investment professionals use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to teach investment, I believe &lt;a href=&quot;https://www.equitieslab.com&quot; rel=&quot;nofollow&quot;&gt;Equities Lab&lt;/a&gt; might be helpful: it can track total return, can plug into a paper trading account from Interactive Brokers, but it also is a good tool to learn investment.  You can simulate strategies, figure out what works, and why, and have a variety of jumping off points to research stocks.  Plus the charts are pretty :-)&lt;/p&gt;&#xA;" OwnerUserId="16308" LastActivityDate="2015-05-22T18:47:17.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17950" PostTypeId="2" ParentId="17947" CreationDate="2015-05-22T21:00:03.573" Score="1" Body="&lt;p&gt;To answer your first question: Under the necessary assumptions, the Markowitz portfolio optimization framework can be used to obtain the minimum variance portfolio for a given level of return. Together all the portfolio with a minimum variance for a specified level of return are (or span) the efficient frontier. By definition it is not possible to get another portfolio with a lower variance than the lowest variance portfolio on this frontier. This risk can't be diversified away and is called systematic risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your second question, if a risk free asset exists it is of course possible to have no risk at all: create a portfolio fully invested in the risk free asset. If you want to create a portfolio with a higher return than the risk free rate you can combine the risk free asset with some asset. However, this will always lead to exposure to systematic, undiversifiable risk.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2015-05-22T21:00:03.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17952" PostTypeId="1" AcceptedAnswerId="17953" CreationDate="2015-05-22T22:41:09.613" Score="8" ViewCount="416" Body="&lt;p&gt;Let $\phi$ be a self-financing strategy that replicates a time $T$ option payoff $X$ on stock $S$.  By definition of a trading strategy, $\phi$ is previsible.  Finally, let $V_t$ be the time $t$ value of the portfolio implementing $\phi$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Usual theorem:&lt;/strong&gt;  If $S_te^{-rt}$ is a $\mathbb{Q}$-martingale then $V_t = \mathbb{E}_\mathbb{Q}[e^{-r(T-t)}X|\mathcal{F}_t]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note if the price of the option were anything other than $V_t$, we would have arbitrage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My Claim:&lt;/strong&gt;  If $S_t$ is a $\mathbb{Q}$-martingale then $V_t = \mathbb{E}_\mathbb{Q}[X|\mathcal{F}_t]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No discounting necessary, and again this $\phi$ is a replicating self-financing strategy, so the value of the option must again be $V_t$ for all $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Proof of My Claim.&lt;/strong&gt;  Consider discrete time and let $S_t$ be a $\mathbb{Q}$-martingale.  By definition of a self-financing strategy, $\Delta V_{t+1} = \phi_{t+1}\Delta S_{t+1}$. where $\Delta V_{t+1} = V_{t+1} - V_t$.  Hence&#xA;\begin{align*}&#xA;\mathbb{E}_\mathbb{Q}[\Delta V_{t+1}|\mathcal{F}_t] =\mathbb{E}_\mathbb{Q}[\phi_{t+1}\Delta S_{t+1}|\mathcal{F}_t] =\phi_{t+1}\mathbb{E}_\mathbb{Q}[\Delta S_{t+1}|\mathcal{F}_t] = 0,&#xA;\end{align*}&#xA;where the second equality is because $\phi$ is previsible.  So $V_t$ is a $\mathbb{Q}$-martingale, and&#xA;\begin{align*}&#xA;V_t = \mathbb{E}_\mathbb{Q}[V_T | \mathcal{F}_t] = \mathbb{E}_\mathbb{Q}[X | \mathcal{F}_t],&#xA;\end{align*}&#xA;where the second equality is because $\phi$ replicates $X$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I missing?  Why do we only consider discounted stock prices, and hence what's the point of discounting the expectation?  The only good reason I can think of for considering only discounted stock prices is that martingale representation theorem guarantees the existence of self-financing strategies in this case.  But still, the usual theorem is valid for &lt;em&gt;any&lt;/em&gt; self-financing strategy, so the discounting still seems unnecessary.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; Okay, my previous example indeed assumed I was trading in only one stock, in which it's generally not possible to have a replicating self-financing strategy (right?).  Let me prove a new, more general claim, again asserting discounting is not necessary by trading in two stocks $S^1$ and $S^2$ and requiring them both to be $\mathbb{Q}$-martingales.  This will be slightly different than the &quot;usual&quot; theorem above in that we'll require &lt;em&gt;both&lt;/em&gt; stocks to be martingales, but this seems valid.  Furthermore, if we had an option payoff that was a function of two stocks, we could use this same claim to trade in only those two stocks; i.e., no &quot;extra&quot; stocks needed to trade in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Again let $\phi$ be a self-financing strategy that replicates a time $T$ option payoff $X$ on stock $S^1$, but now $\phi$ trades in both $S^1$ and $S^2$.  By definition of a trading strategy, $\phi$ is previsible.  Finally, let $V_t$ be the time $t$ value of the portfolio implementing $\phi$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Updated claim:&lt;/strong&gt; If the vector $S = (S_1, S_2)$ is a $\mathbb{Q}$-martingale; i.e., each component of $S$ is a $\mathbb{Q}$-martingale, then $V_t = \mathbb{E}_\mathbb{Q}[X|\mathcal{F}_t]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Proof.&lt;/strong&gt; Let $S = (S_1, S_2)$ be a $\mathbb{Q}$-martingale.  By definition of a self-financing strategy, $\Delta V_{t+1} = \phi_{t+1}\cdot\Delta S_{t+1}$, where $\Delta V_{t+1} = V_{t+1} - V_t$ and &quot;$\cdot$&quot; is the dot product.  Hence&#xA;\begin{align*}&#xA;\mathbb{E}_\mathbb{Q}[\Delta V_{t+1}|\mathcal{F}_t] =\mathbb{E}_\mathbb{Q}[\phi_{t+1}\cdot\Delta S_{t+1}|\mathcal{F}_t] =\phi_{t+1}\cdot\mathbb{E}_\mathbb{Q}[\Delta S_{t+1}|\mathcal{F}_t] = 0,&#xA;\end{align*}&#xA;where the second equality is because $\phi$ is previsible.  So $V_t$ is a $\mathbb{Q}$-martingale, and&#xA;\begin{align*}&#xA;V_t = \mathbb{E}_\mathbb{Q}[V_T | \mathcal{F}_t] = \mathbb{E}_\mathbb{Q}[X | \mathcal{F}_t],&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this seem correct?  If so, it indeed seems discounting (in general, by some numeraire) would be necessary for the &quot;usual&quot; theorem, but this seems just as valid.&lt;/p&gt;&#xA;" OwnerUserId="6866" LastEditorUserId="6866" LastEditDate="2015-05-24T22:01:46.480" LastActivityDate="2015-05-25T15:02:06.233" Title="What's the point of discounting in risk-neutral pricing?" Tags="&lt;options&gt;&lt;option-pricing&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17953" PostTypeId="2" ParentId="17952" CreationDate="2015-05-22T23:44:50.313" Score="6" Body="&lt;p&gt;You only have one asset in your portfolio which means that you can only statically hedge.  By the definition of self financing, $V_0=\phi_0 S_0$, $V_1=V_0+\phi_1 (S_1-S_0)$, and $V_1= \phi_1 S_1$.  Putting these last two together, $V_0=\phi_1 S_0 $.  Hence $\phi_1=\phi_0$ and you have a static position.  Intuitively, this is because you cannot trade in another asset.  If you could dynamically trade another asset, then your logic breaks down since no asset has a zero rate of return (in general).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The previous result can be generalized.  By no arbitrage, all assets denominated in terms of other assets are martingales in the measure induced by the denominating asset.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the &quot;Risk Neutral&quot; case, the denominating asset is a bond or money market account, and hence the &quot;discounted&quot; $S_t$ is a martingale (or, perhaps more clearly, $\frac{S_t}{M_t}$ is a martingale where $M_t$ is the money market account).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regardless of the chosen denominating asset, the option pricing formula will remain the same.  You cam prove this to yourself by solving the Black Scholes option price using the stock rather than the money market as the denominating asset.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So no, you can't simply take the expected value of the terminal payoff under the measure under which $S_t$ is a martingale as in general there is no asset which has zero return.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit in response to OP's update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have two stocks to trade and only two stocks to trade.  I am trying to replicate the payoff of a function of one of the stocks; say $g(S_1 ^ T)$.  My self financing portfolio is $X=\Delta_1 S_1 + \Delta_2 S_2$ and $dX=\Delta_1 dS_1 + \Delta_2 dS_2$.  I will assume for simplicity that both stocks have dynamics of the form $dS=\alpha S dt+\sigma S dW_t $ and that they are independent.  Then &#xA;$$dX=\Delta_1 \alpha_1 S_1 dt+\Delta_1 \sigma_1 S_1 dW_1+\Delta_2 \alpha_2 S_2 dt+\Delta_2 \sigma_2 S_2 dW_2 $$&#xA;Substituting $X=\Delta_1 S_1 +\Delta_2 S_2$,&#xA;$$dX=\Delta_1 \alpha_1 S_1 dt+\Delta_1 \sigma_1 S_1 dW_1+ \alpha_2 (X-\Delta_1 S_1)dt+\sigma_2 (X-\Delta_1 S_1) dW_2 $$&#xA;Letting $\hat{X}=\frac{X}{S_2}$, &#xA;$$d\hat{X}=\frac{dX}{S_2}-\frac{X}{S_2 ^2} dS_2+\frac{X}{S_2 ^3}\sigma^2 S_2^2 dt-\frac{dXdS_2}{S_2 ^2}$$&#xA;$$=\Delta_1 \alpha_1 \frac{S_1}{S_2} dt+\Delta_1 \sigma_1 \frac{S_1}{S_2} dW_1+ \alpha_2(\hat{X}-\Delta_1 \frac{S_1}{S_2})dt+(\hat{X}-\Delta_1 \frac{S_1}{S_2})\sigma_2 dW_2-\hat{X} \alpha_2 dt-\hat{X} \sigma_2 dW_2+\hat{X} \sigma_2 ^2 dt -\Delta_2 \sigma_2 ^2  dt$$&#xA;$$=\Delta_1 d\hat{S}$$&#xA;Where $\hat{S}=\frac{S_1}{S_2}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the problem reduced to finding a measure under which $d\hat{S}$ is a martingale since then the value of the option is $$S_2 ^ 0 \hat{X}_0= S_2 ^ 0 \mathbb{\hat{E}}[\hat{X}_T]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The differential of $d\hat{S}$ is &#xA;$$d\hat{S}=\hat{S}\left(\alpha_1 -\alpha_2\right)dt + \hat{S}( \sigma_1 dW_1-\sigma_2 dW_2)+\hat{S} \sigma^2 dt $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We try to find a pair $\theta_1, \theta_2 $ that solves &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \hat{S}( \sigma_1 (dW_1+\theta_1 dt)-\sigma_2 (dW_2+\theta_2 dt))=\hat{S}\left(\alpha_1 -\alpha_2\right)dt + \hat{S}( \sigma_1 dW_1-\sigma_2 dW_2)+\hat{S} \sigma^2 dt $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be simplified to&#xA;$$\sigma_1 \theta_1-\sigma_2 \theta_2=\alpha_1-\alpha_2+\sigma_2 ^2 $$&#xA;There is no unique solution, so the market is incomplete.  However, note that your proposed solution $\theta_1=\frac{\alpha_1}{\sigma_1}$, $\theta_2=\frac{\alpha_2}{\sigma_2}$ is not one of the possible solutions.&lt;/p&gt;&#xA;" OwnerUserId="9403" LastEditorUserId="9403" LastEditDate="2015-05-24T23:27:18.300" LastActivityDate="2015-05-24T23:27:18.300" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="17954" PostTypeId="2" ParentId="17887" CreationDate="2015-05-23T08:44:48.820" Score="6" Body="&lt;p&gt;What do you mean by &quot;so we can price as usual&quot;? What you showed is that for every $c \in \mathbb R$ we can find a probability measure such that the drift of $S$ is $c$. But that does not really say anything about pricing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can easily see that $V_t = E^Q_t[e^{-r(T-t)} \Phi_T]$ does not give arbitrage free prices with your choice of $Q$. Indeed if $\Phi_T = S_T$, then  $E^Q_t[e^{-r(T-t)} S_T] = S_0$. But if I invest $S_0$ in the stock at time $0$, then at time $T$, I will own $S_T$ plus all the dividends I earned.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What matters in arbitrage free pricing is the notion of self-financing portfolio (= strategy). Two self-financing portfolio giving the same cashflows must have equal price. The problem is that, in the presence of dividends, a portfolio $V_t = S_t$ is not self-financing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: You may be confused by the fact that a risk neutral measure is often defined as a measure under which the discounted underlyings price processes are martingales. If that was the case your measure would be a risk neutral measure. But the &lt;em&gt;right&lt;/em&gt; definition of a risk neutral measure is a measure under which the self-financing portfolios discounted price processes are martingales (this is mentionned by Shreve p. 234). This is important because being self-financing is independent of the measure you consider so you can reason under the historical measure to decide whether a portfolio is self-financing or not and then use risk neutral pricing to actually price it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is where the pricing formula comes from: if &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;the payoff $\Phi_T$ can be replicated by a self-financing portfolio $V_T = \Phi_T$, &lt;/li&gt;&#xA;&lt;li&gt;there exists a measure under which self-financing portfolios discounted prices are martingales&#xA;then&#xA;$$&#xA;  V_t= E_t^Q[e^{-r(T-t)}V_T]= E_t^Q[e^{-r(T-t)}\Phi_T].&#xA;$$ &#xA;which gives us the price of the cashflow. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Consider a market with underlying assets $(S^1,\ldots,S^d)$ and money account $S^0_t = e^{rt}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Claim&lt;/strong&gt;: In the abscence of dividend, if all the discounted $S^i$ are martingales under a probability measure $\mathbb{Q}$ then so are all the discounted self-financing portfolios (so $\mathbb{Q}$ is a risk neutral measure).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Proof: Consider a portfolio&#xA;$$&#xA;  V_t = \delta^0_t S^0_t + \sum_{i=1}^d \delta_t^i S^i_t&#xA;$$&#xA;Notice that $\delta^0_t S^0_t = V_t - \sum_{i=1}^d \delta_t^i S^i_t$. Plug this in the self-financing equation &#xA;\begin{eqnarray*}&#xA;  dV_t &amp;amp;=&amp;amp; \delta^0_t dS^0_t + \sum_{i=1}^d \delta_t^i dS^i_t \\&#xA;  dV_t &amp;amp;=&amp;amp; \delta^0_t rS^0_tdt + \sum_{i=1}^d \delta_t^i dS^i_t \\&#xA;  dV_t &amp;amp;=&amp;amp; r(V_t - \sum_{i=1}^d \delta_t^i S^i_t)dt + \sum_{i=1}^d \delta_t^i dS^i_t \\&#xA;  dV_t - rV_t &amp;amp;=&amp;amp;  \sum_{i=1}^d \delta_t^i (dS^i_t - rS^i_t dt) \\&#xA;  d(e^{-rt}V_t) &amp;amp;=&amp;amp;  \sum_{i=1}^d \delta_t^i d(e^{-rt}S^i_t)&#xA;\end{eqnarray*}&#xA;Since all the $(e^{-rt}S^i_t)$ are $\mathbb{Q}$-martingales, so is $(e^{-rt}V_t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt; What makes risk neutral measure useful for pricing is that discounted self-financing portfolios are martingales. In the abscence of dividends, this is equivalent to the discounted underlyings being martingales. But a dividend paying asset by itself is not a self financed portfolio so it is not useful to find a probability measure under which it is a martingale.&lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2016-06-30T19:50:30.310" LastActivityDate="2016-06-30T19:50:30.310" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17956" PostTypeId="1" AcceptedAnswerId="17957" CreationDate="2015-05-23T09:49:23.973" Score="2" ViewCount="1936" Body="&lt;p&gt;In the formula, the stock return is modelled as a brownian motion that is a drift + a stochastic term, ok I get that. But the drift term is then modelled as r - volatility ^ 2 / 2. I am not sure how they derive this &quot;volatility ^ 2 / 2&quot;. Is this derived out of the Ito Lemma??&lt;/p&gt;&#xA;" OwnerUserId="16325" LastActivityDate="2015-05-23T10:21:06.167" Title="Black Scholes Formula, drift term" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17957" PostTypeId="2" ParentId="17956" CreationDate="2015-05-23T10:21:06.167" Score="4" Body="&lt;p&gt;This drift comes from making the discounted stock a martingale in the risk-neutral measure $\mathbb Q$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You start with a stock in $\mathbb P$ having this form:&#xA;$$&#xA;dS_t = \mu S_t dt + \sigma S_t dW_t&#xA;$$&#xA;You also have a discount factor $e^{rt}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea is to remove the drift of the discounted process in $\mathbb Q$ so you get (after applying Girsanov's theorem) a martingale:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;d\hat S_t = \sigma \hat S_t d \tilde W_t&#xA;$$&#xA;where $\hat S_t$ is the discounted stock and $\tilde W_t$ is a $\mathbb Q$-brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you solve this last SDE you get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\hat S_t = \hat S_0\exp(\sigma W_t - \frac{1}{2}\sigma^2t)&#xA;$$&#xA;Multiplying with $e^{rt}$ on both sides you get the un-discounted process and the drift you were asking about.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the gist of why you get the correction term $\frac{1}{2}\sigma^2t$ is when solving the SDE&#xA;$$&#xA;dX_t = \sigma X_t dW_t&#xA;$$&#xA;you get &#xA;$X_t = X_0 \exp(\sigma W_t - \frac{1}{2}\sigma^2t)$&lt;/p&gt;&#xA;" OwnerUserId="7555" LastActivityDate="2015-05-23T10:21:06.167" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17958" PostTypeId="2" ParentId="17948" CreationDate="2015-05-23T15:37:14.507" Score="0" Body="&lt;p&gt;This is a strange question. Usually questions about expected utility involve some uncertainty about the future wealth of the investor. If there is no uncertainty in the outcome and the investor is not &lt;em&gt;doing&lt;/em&gt; anything which might change his or her future wealth then the expectation of utility is a constant, that is $E[U(w)] = U(w)$.&lt;/p&gt;&#xA;" OwnerUserId="16328" LastActivityDate="2015-05-23T15:37:14.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17960" PostTypeId="2" ParentId="17870" CreationDate="2015-05-24T06:32:00.820" Score="13" Body="&lt;p&gt;For data analysis, particularly for large data analysis project, pretty much most of the top quant hedge funds and a lot of the banks are using Python (over R) for a couple of reasons but many still have bits and pieces of R for specific packages or functions (I work at a bank and interface with quite a few quant hedge funds on data analysis):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Earlier Python 2 used to have a lot of backward compatibility issues, but Python 3 is more stable between versions. Even Pandas versions since 0.13 are very stable between versions. No one wants to use a language for which they have to revisit and rewrite significant codes sometime in the future.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;People needed same codes to run on both Linux and Windows. Installing, compiling packages in Python can be a super pain, whether Linux or Windows. A lot of people did not wanted to do any new project in Python 2 as sometime in the future one would need to move to Python 3 and they stuck to R for quite a while. Also for a while, Python 3 was available only with WinPython distro and WinPython used to work only on Windows. Anaconda, which is leading Python disto for Linux (&amp;amp; Mac), came out with Python 3 support sometime in 2014, which then caused a huge migration. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Advantages of Python (vs R): &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(i) Raw speed is the biggest motive (allowing you to do way more statistical data analysis in the same time)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(ii) Pandas can read csv files very fast (one of the reasons why many folks moved from Matlab to R at some point)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(iii) Cython is more flexible than RCpp (at least my experience)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(iv) organize code files neatly into logical directories and classes within files (classes in R are an oversight) and the project looks much better &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(v) As of 2015, PyCharm is a significantly better IDE than RStudio (although RStudio is better than Spyder). Tools matter&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Disadvantages of Python (vs R):  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(i) The big issue with Pandas used to be that it didn't have its own binary data format. R's RData format is a huge edge. PyData's HDF5 based storage is not compressible easily, gives a lot of errors every now and then, and for big data it was a hindrance. Pickle, and other formats didn't just cut it. After years of Python-vs-R exploration, most ended up writing their own custom binary data format (to store Pandas data frame) or using significant modifications of PostgreSQL for big data storage. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Statistical packages are generally great with both languages. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have projects in R that took 4 hours to run every day (over night). Now, in Python, they take a total of 20 minutes (with much less use of Cython codes than RCpp codes in R). That's the speed difference for you.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer your question:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;acquire, store, maintain, read, clean time series: Python is better&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;perform basic statistics on time series, advanced statistical models such as multivariate regression analyses, etc.: both Python and R&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;performing mathematical computations (fourier transforms, PDE solver, PCA)&#xA;visualization of data (static and dynamic): both Python and R&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;pricing derivatives (application of pricing models such as interest rate models) : both Python and R&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;interconnectivity (with Excel, servers, UI): Python is better&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="5948" LastEditorUserId="5948" LastEditDate="2015-10-17T23:14:56.623" LastActivityDate="2015-10-17T23:14:56.623" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17961" PostTypeId="1" CreationDate="2015-05-24T11:45:00.793" Score="12" ViewCount="315" Body="&lt;p&gt;I would like to find the probability density function (at stationarity) of the random variable $X_t$, where:&#xA;\begin{equation*}&#xA;dX_t = -aX_t dt + d N_t,&#xA;\end{equation*}&#xA;$a$ is a constant and $N_t$ is a compound Poisson process with Poisson jump size distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, $X_t$ solves the ordinary differential equation &#xA;$\frac{d X_t}{dt} + a X_t=0$, &#xA;but at times $t_i$ say, where the $t_i$ are exponentially distributed with mean $1/k$, $X_t$ increases by an integer drawn from $M\sim Poi(m)$ (i.e. $X_t$ gets a Poisson-distributed &quot;kick&quot; upwards at exponentially distributed intervals).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way of obtaining the pdf for this random variable $X$? If I have understood things correctly, the Kramers-Moyal equation for the pdf of $X$ is of infinite order because it is a jump Markov process. I have also tried looking at the Master Equation but I get lost. However, I am new to this literature and was wondering if the solution is easy for those in the know, since it is such a simple system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks for your help!&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Addendum:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the following paper, an expression for the Fourier transform of the probability density function is provided for general jump size distribution (see Section 5.2):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://link.springer.com/article/10.1140%2Fepjb%2Fe2009-00126-3&quot; rel=&quot;nofollow&quot;&gt;Generalized Fokker-Planck equation: Derivation and exact solutions&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or in the ArXiv: &lt;a href=&quot;http://arxiv.org/pdf/0808.0274.pdf&quot; rel=&quot;nofollow&quot;&gt;http://arxiv.org/pdf/0808.0274.pdf&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the case I am interested in (Poisson jump size distribution), I don't think the Fourier transform can be inverted analytically. However, the paper gives the exact solution for exponentially-distributed jump sizes as an example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you to those who have answered or commented so far. It is actually very helpful for me to know that there isn't a straightforward way to obtain the pdf (if at all). Nevertheless, if anyone else out there does know of a way I'd be interested to hear about it. &lt;/p&gt;&#xA;" OwnerUserId="16330" LastEditorUserId="36393" LastEditDate="2019-12-11T12:22:06.683" LastActivityDate="2019-12-11T12:22:06.683" Title="Probability density function of simple equation, compound Poisson noise" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;probability&gt;&lt;markov&gt;&lt;poisson&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="17962" PostTypeId="1" AcceptedAnswerId="18030" CreationDate="2015-05-24T12:01:23.417" Score="3" ViewCount="280" Body="&lt;p&gt;I need for my project the values of the EUR-USD exchange (both intra-day and ticker). I've been playing around with the Yahoo's YQL API and at this moment I can obtain the current value of the exchange. But no idea about how to get the intra-day values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="16332" LastActivityDate="2017-08-10T12:56:25.433" Title="Obtaining intra-day values of the EUR-USD exchange" Tags="&lt;programming&gt;&lt;yahoo&gt;&lt;exchange&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17963" PostTypeId="1" AcceptedAnswerId="19132" CreationDate="2015-05-24T12:50:55.230" Score="11" ViewCount="10744" Body="&lt;p&gt;Anyone have a clue how to calculate the JdK RS-Ratio?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say I want to compare the Relative strength for these:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;EWA  iShares MSCI Australia Index Fund &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;EWC iShares MSCI Canada Index    Fund &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;EWD iShares MSCI Sweden Index Fund &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;EWG iShares MSCI Germany    Index Fund &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;EWH iShares MSCI Hong Kong Index Fund &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;EWI iShares MSCI    Italy Index Fund &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;EWJ iShares MSCI Japan Index Fund &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;EWK iShares MSCI    Belgium Index Fund &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;EWL iShares MSCI Switzerland Index Fund    &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;EWM iShares MSCI Malaysia Index Fund &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;EWN iShares MSCI Netherlands    Index Fund &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;EWO iShares MSCI Austria Index Fund &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;EWP iShares MSCI Spain    Index Fund &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;EWQ iShares MSCI France Index Fund &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;EWS iShares MSCI    Singapore Index Fund &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;EWU iShares MSCI United Kingdom Index Fund    &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;EWW iShares MSCI Mexico Index Fund &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;EWT iShares MSCI Taiwan Index Fund    &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;EWY iShares MSCI South Korea Index Fund &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;EWZ iShares MSCI Brazil Index    Fund &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;EZA iShares MSCI South Africa Index Fund&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Each of them should be compared to the SP500 (SPY index). &#xA;Calculate the relative strength of each of them to SPY and have it normalized (I think it is the only solution)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More info on the concept.&#xA;&lt;a href=&quot;http://www.mta.org/eweb/docs/pdfs/11symp-dekempanaer.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.mta.org/eweb/docs/pdfs/11symp-dekempanaer.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/UccdH.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/SFkD1.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="16331" LastEditorUserId="743" LastEditDate="2015-10-01T00:57:40.930" LastActivityDate="2019-11-18T17:53:25.610" Title="How to calculate the JdK RS-Ratio" Tags="&lt;statistics&gt;&lt;trading&gt;&lt;normalization&gt;&lt;momentum&gt;&lt;technical-analysis&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="17964" PostTypeId="2" ParentId="17870" CreationDate="2015-05-24T12:52:00.673" Score="6" Body="&lt;p&gt;For the tasks listed, both Python and R perform very well. There are some packages in Python not in R and vice versa. My solution for this is to simply &lt;a href=&quot;https://stackoverflow.com/questions/24544190/calling-r-script-from-python-using-rpy2&quot;&gt;call R from Python.&lt;/a&gt; This allows for the best of both worlds. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is also important to note I do not write any R code other than calling an R library from Python. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Calling Python from R does not work equally across all major OSes as well.&lt;/p&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="-1" LastEditDate="2017-05-23T11:33:46.017" LastActivityDate="2015-10-17T20:37:25.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17965" PostTypeId="1" CreationDate="2015-05-24T14:03:00.757" Score="2" ViewCount="434" Body="&lt;p&gt;My question can be summarised as such:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Consider a portfolio. Say it has a price $\Pi = x$.&lt;/li&gt;&#xA;&lt;li&gt;Portfolio consists of a stock and a sequence of call options underlying on the stock.&lt;/li&gt;&#xA;&lt;li&gt;It has been announced that a dividend will be paid in half year. However, assume that the stock price does not change today.&lt;/li&gt;&#xA;&lt;li&gt;How will the value of the portfolio change today?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;My argument:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;If the stock price does not change today due to announcement, then we can assume the dividend is already priced into the stock value.&lt;/li&gt;&#xA;&lt;li&gt;In order to use the Black-Scholes-Merton option pricing model, the underlying stock price must only consist of a risky component, and not the certain dividend component as it must be assumed that stock prices follow a geometric Brownian motion.&lt;/li&gt;&#xA;&lt;li&gt;Since the stock price used for the model decreases (subtracting the present value of the dividend in half year), and the delta of the portfolio is positive, the value of the portfolio must decrease.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Where is the flaw in my argument (if there is one) ?&lt;/p&gt;&#xA;" OwnerUserId="13726" LastEditorUserId="13726" LastEditDate="2015-05-24T14:43:37.797" LastActivityDate="2015-05-26T08:17:20.293" Title="Black Scholes Model and Dividends" Tags="&lt;options&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17967" PostTypeId="2" ParentId="16318" CreationDate="2015-05-24T22:20:10.690" Score="-1" Body="&lt;p&gt;I'm new in using bootstrapping, but the relationship used to recover the discount function $v(t,t_m)$ from the price of the bond $P(t,T:c)$ and the coupon $c$ is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$v(t,t_m)=\frac{P(t,T:c)-c\sum_{i=1}^{m-1}v(t,t_i)}{1+c}$&lt;/p&gt;&#xA;" OwnerUserId="16045" LastActivityDate="2015-05-24T22:20:10.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17969" PostTypeId="1" AcceptedAnswerId="17976" CreationDate="2015-05-25T10:59:14.070" Score="8" ViewCount="948" Body="&lt;p&gt;I'm reading Peter Carr's &lt;a href=&quot;http://www.pstat.ucsb.edu/crfms/inaugural%20slide/Peter-Carr.pdf&quot;&gt;&quot;A Practitioner’s Guide to Mathematical Finance&quot;&lt;/a&gt;. When talking about the math used in mathematical finance, he mentions Lie groups, differential geometry, string theory. Can anyone explain (either in an understandable or informal way is ok), and with examples if possible, how these 3 can be applied in MF?&lt;/p&gt;&#xA;" OwnerUserId="6461" LastEditorUserId="848" LastEditDate="2015-05-25T12:54:33.440" LastActivityDate="2015-05-25T18:04:24.163" Title="Why Lie groups, differential geometry and string theory relate to MF?" Tags="&lt;reference-request&gt;&lt;quants&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="17970" PostTypeId="1" AcceptedAnswerId="17971" CreationDate="2015-05-25T12:57:15.350" Score="-4" ViewCount="78" Body="&lt;p&gt;Can someone please help me out with this loop over here? Matlab simple refuses to consider the for o=k:k-20 statement inside the if statement. :pullingmyhair:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if d(k)&amp;lt;=-1.5 || d(k) &amp;gt;=1.5&#xA;    k&#xA;    tab=tab+1&#xA;    6&#xA;&#xA;    for o=k:k-20  &#xA;        5&#xA;        if abs(d(o))&amp;lt;abs(d(o-1))&#xA;        bench_value=o;&#xA;        break;&#xA;        end&#xA;    end&#xA;.&#xA;.&#xA;.&#xA;.&#xA;.&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="15843" LastActivityDate="2015-05-25T13:52:44.147" Title="Matlab loop statement is driving me mad" Tags="&lt;matlab&gt;" AnswerCount="1" CommentCount="2" ClosedDate="2015-05-25T15:34:34.897" ContentLicense="CC BY-SA 3.0" />
  <row Id="17971" PostTypeId="2" ParentId="17970" CreationDate="2015-05-25T13:52:44.147" Score="1" Body="&lt;p&gt;You're looping from k to k-20 by +1 steps. Try with o = k:-1:-20.&lt;/p&gt;&#xA;" OwnerUserId="15336" LastActivityDate="2015-05-25T13:52:44.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17972" PostTypeId="1" CreationDate="2015-05-25T14:15:59.067" Score="6" ViewCount="925" Body="&lt;p&gt;I am new to mean reversion trading, and I would like to get some good references about how to estimate the time it takes to a mean reverting process to cross its long term mean.&lt;/p&gt;&#xA;" OwnerUserId="16081" LastEditorUserId="7202" LastEditDate="2015-05-26T09:57:42.093" LastActivityDate="2015-05-26T09:57:42.093" Title="Mean reversion time estimation" Tags="&lt;options&gt;&lt;volatility&gt;&lt;pairs-trading&gt;&lt;mean-reversion&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17973" PostTypeId="2" ParentId="17972" CreationDate="2015-05-25T14:30:33.250" Score="10" Body="&lt;p&gt;Well, &quot;mean reversion trading&quot; could mean a lot of things, I am not qualified to describe it in full generality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, there is a simple model of mean reversion called the Ornstein Uhlenbeck process that is often seen. It has two parameters \lambda and \sigma, where lambda is the strength of the mean reversion (so one over lambda is the mean reversion time).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a nice web site that covers the estimation of OU process parameters from time series data using two methods: least squares (most intuitive) and max likelihood (more exact).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.sitmo.com/article/calibrating-the-ornstein-uhlenbeck-model/&quot;&gt;http://www.sitmo.com/article/calibrating-the-ornstein-uhlenbeck-model/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2015-05-25T14:42:35.410" LastActivityDate="2015-05-25T14:42:35.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17974" PostTypeId="2" ParentId="17952" CreationDate="2015-05-25T15:02:06.233" Score="0" Body="&lt;p&gt;It seems to me that if it were a martingale, one could make a lot of money (in expectation) by shorting it and investing the proceeds in the risk neutral asset/bank account. &lt;/p&gt;&#xA;" OwnerUserId="3491" LastActivityDate="2015-05-25T15:02:06.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17975" PostTypeId="1" AcceptedAnswerId="17977" CreationDate="2015-05-25T15:46:47.063" Score="0" ViewCount="51" Body="&lt;p&gt;I am assembling a pitch which will aim towards investors by the end of this year/beginning of next year, and I need to gather information such as how much the Cloud Storage market is worth and how much the Hard Drive market is worth.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How is such statistical data found?&lt;/p&gt;&#xA;" OwnerUserId="16342" LastActivityDate="2015-05-25T21:05:20.827" Title="Calculating or finding info about the value of a market? for example Cloud Storage" Tags="&lt;data&gt;&lt;statistics&gt;&lt;market-data&gt;&lt;market&gt;" AnswerCount="1" CommentCount="5" ClosedDate="2015-05-26T06:40:19.603" ContentLicense="CC BY-SA 3.0" />
  <row Id="17976" PostTypeId="2" ParentId="17969" CreationDate="2015-05-25T17:31:27.503" Score="6" Body="&lt;p&gt;MF is linked with physics mostly because it solves the same PDEs (Black-Scholes equation is a certain type of Schrödinger equation for instance). As for the specific links you mentioned :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Lie Algebra : Magnus expansion (to build fast approximation of time dependent ODEs like those arising in credit risk)&lt;/li&gt;&#xA;&lt;li&gt;Differential geometry : link with Varadhan approximation (used for instance in &lt;a href=&quot;https://www.math.nyu.edu/faculty/avellane/AvellanedaQCongress2005.pdf&quot; rel=&quot;noreferrer&quot;&gt;Avellaneda's SABR&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2411" LastEditorUserId="2411" LastEditDate="2015-05-25T18:04:24.163" LastActivityDate="2015-05-25T18:04:24.163" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17977" PostTypeId="2" ParentId="17975" CreationDate="2015-05-25T21:05:20.827" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://www.forbes.com/sites/louiscolumbus/2015/01/24/roundup-of-cloud-computing-forecasts-and-market-estimates-2015/&quot; rel=&quot;nofollow&quot;&gt;http://www.forbes.com/sites/louiscolumbus/2015/01/24/roundup-of-cloud-computing-forecasts-and-market-estimates-2015/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this give you a place to start?&lt;/p&gt;&#xA;" OwnerUserId="15284" LastActivityDate="2015-05-25T21:05:20.827" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17978" PostTypeId="1" AcceptedAnswerId="17980" CreationDate="2015-05-25T22:22:23.540" Score="6" ViewCount="218" Body="&lt;p&gt;Let $(\Omega,\mathcal{F},P)$ be a probability space, equipped with a filtration $(\mathcal{F})_{0 \leq t \leq T}$ that is the natural filtration of a standard Brownian motion $(W_{t})_{0 \leq t \leq T}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $X=\exp(W_{T/2}+W_{T})$. Find the expectation $E[X]$;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $X_{t}=E[X|\mathcal{F}_{t}]$ for $0 \leq t \leq T$. Find $X_{t}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first question is easy for me: $W_{T/2}+W_{T}=2W_{T/2}+W_{T}-W_{T/2}$, by independence of increments and the property of Brownian motion, $W_{T/2}+W_{T} \sim N(0,5T/2)$,therefore, $E[X]=\exp(5T/4)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried to solve the second question as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $W_{t/2}+W_{t}\sim N(0,5t/2)$, $B_{}t:=\sqrt{2/5}(W_{t/2}+W_{t})\sim N(0,t)$&#xA;Can I say that B_{t} is a Brownian motion? If not, Is there any rigorous way to prove this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If B_{t} is a Brownian motion, then,&#xA;$E[e^{\sqrt{\frac{5}{2}}B_{T}}|\mathcal{F}_{t}]=E[e^{\sqrt{\frac{5}{2}}(B_{T}-B_{t}+B_{t})}|\mathcal{F}_{t}]=e^{\sqrt{\frac{5}{2}}B_{t}}e^{5(T-t)/4}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i.e.$X_{t}=e^{W_{t}+W_{t/2}}e^{5(T-t)/4}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, how can we solve by discuss the cases $t&amp;lt;T/2$ and $T/2 \leq t &amp;lt; T$ seperately?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="16343" LastActivityDate="2015-05-27T12:55:53.297" Title="Questions about exponential Brownian motion" Tags="&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17979" PostTypeId="2" ParentId="17924" CreationDate="2015-05-25T22:44:08.970" Score="3" Body="&lt;p&gt;To identify the number of AR and MA terms you still need to look at the ACF and PACF.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To identify the orders of differencing, the easiest way is run an ARIMA model on the data with different orders of differencing (0,1,2) and with only a constant (no AR or MA term). Look at the standard deviation of these models, as well as the ACF plot - the optimal model is most likely the one with the lowest standard of deviation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once the identified order of differencing is taken, look at the ACF and PACF of the stationary series. In particular, look at whether the PACF or ACF cuts off sharply - if the PACF cuts off sharply start with an AR model, and vice versa. From there, look at the ACF and PACF again to determine if you need to add another term of either variety. Specifically, if there is a spike at a lower-order lag in the ACF then you should increase the MA term by 1, and vice versa. &lt;/p&gt;&#xA;" OwnerUserId="11632" LastActivityDate="2015-05-25T22:44:08.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17980" PostTypeId="2" ParentId="17978" CreationDate="2015-05-25T23:14:08.383" Score="3" Body="&lt;p&gt;For $T/2 \leq t \leq T$, &#xA;\begin{align*}&#xA;E(X\mid \mathcal{F}_t) &amp;amp;= \exp\big(W_{\frac{T}{2}}+\frac{1}{2}T\big) E\big(\exp\big(W_{T}-\frac{1}{2}T\big)\mid \mathcal{F}_t\big)\\&#xA;&amp;amp;= \exp\big(W_{\frac{T}{2}}+\frac{1}{2}T\big) \exp\big(W_{t}-\frac{1}{2}t\big)\\&#xA;&amp;amp;=\exp\big(W_{\frac{T}{2}}+W_{t} + \frac{1}{2}T-\frac{1}{2}t\big).&#xA;\end{align*}&#xA;For $0 \leq t \leq T/2$, &#xA;\begin{align*}&#xA;E(X\mid \mathcal{F}_t) &amp;amp;= E\big( E(X\mid \mathcal{F}_{T/2})\mid\mathcal{F}_t)\big)\\&#xA;&amp;amp;=E\big(\exp(2W_{\frac{T}{2}}+ T/4)\mid\mathcal{F}_t\big)\\&#xA;&amp;amp;=\exp\big(\frac{5}{4}T\big)E\big(\exp\big(2W_{\frac{T}{2}} - \frac{1}{2}\times 2^2 \times T/2\big)\mid\mathcal{F}_t\big)\\&#xA;&amp;amp;= \exp\big(\frac{5}{4}T\big)\exp\big(2W_{\frac{t}{2}} - \frac{1}{2}\times 2^2 \times t/2\big)\\&#xA;&amp;amp;=\exp\big(2W_{\frac{t}{2}} +\frac{5}{4}T - t\big).&#xA;\end{align*}&#xA;We can then also have that&#xA;\begin{align*}&#xA;E(X) = \exp\big(\frac{5}{4}T\big).&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, to show that $B_t = \sqrt{2/5}(W_t+W_{t/2})$ is not a Brownian motion, we need only note that&#xA;\begin{align*}&#xA;B_t - B_{\frac{t}{2}} &amp;amp;= \sqrt{2/5}\big(W_t - W_{\frac{t}{4}}\big) \\&#xA;&amp;amp;=\sqrt{2/5}\big(W_t - W_{\frac{t}{2}} + W_{\frac{t}{2}} - W_{\frac{t}{4}}\big)&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;B_{\frac{t}{2}} - B_{\frac{t}{4}} &amp;amp;= \sqrt{2/5}\big(W_{\frac{t}{2}} - W_{\frac{t}{8}}\big) \\&#xA;&amp;amp;=\sqrt{2/5}\big(W_{\frac{t}{2}} - W_{\frac{t}{4}} + W_{\frac{t}{4}} - W_{\frac{t}{8}}\big)&#xA;\end{align*}&#xA;are not independent. That is, $(B_t)_{t\geq 0}$ does not have independent increments.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-05-27T12:55:53.297" LastActivityDate="2015-05-27T12:55:53.297" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17981" PostTypeId="2" ParentId="17965" CreationDate="2015-05-26T08:11:35.500" Score="1" Body="&lt;p&gt;The option portfolio would not change its value because the dividend also has been already priced in as you can assume that option markets have the same information on the underlying as the stock market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A dividend in general decreases the value of the call options because these are foregone relative to holding the asset as soon as the market has as an expectation about it. You should assume though that the maturity of your call options is greater or equal the dividend payment date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fact that the dividend was already priced in upon the announcement is not relevant because it may change the underlying price (or not) $S_t$, but not the calculation of the underlying for the option pricing $S_te^{-d(T-t)}$.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2015-05-26T08:17:20.293" LastActivityDate="2015-05-26T08:17:20.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17982" PostTypeId="2" ParentId="17962" CreationDate="2015-05-26T08:20:57.287" Score="1" Body="&lt;p&gt;Intraday data on FX markets are not publicly available. I can only recommend a paid source where you may eventually ask for a student trial:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://thomsonreuters.com/en/products-services/financial/quantitative-research-and-trading/tick-history.html&quot; rel=&quot;nofollow&quot;&gt;http://thomsonreuters.com/en/products-services/financial/quantitative-research-and-trading/tick-history.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2015-05-26T08:20:57.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17983" PostTypeId="2" ParentId="17925" CreationDate="2015-05-26T08:43:37.857" Score="0" Body="&lt;p&gt;a) $$P_t=100/1.09+(100+1000)/1.09^2=1017,591112$$&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2015-05-26T08:43:37.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17984" PostTypeId="2" ParentId="17910" CreationDate="2015-05-26T10:17:02.023" Score="0" Body="&lt;p&gt;You have been not really precise in the explanation of your steps, however remember that &quot;random number&quot; is a rather generic expression since the method you describe can be applied to a restricted class of distribution ( among which normal and t ). Considering I am not sure about your methodology my advice is to follow a more classical approach, therefore define the distribution of your risk factors and generate them ( apriori any distribution is fine) . Once you have a sample you can compute the losses from the risk factor making explicit the relation L=-V(t+1)+V(t)=-f(t+1,Z(t+1))+f(t,Z(t))where Z are the risk factors ...Then sort all the losses you have simulated and take the (q*(# simulations)) highest value to obtains VaR(q)&lt;/p&gt;&#xA;" OwnerUserId="15900" LastActivityDate="2015-05-26T10:17:02.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17985" PostTypeId="2" ParentId="17962" CreationDate="2015-05-26T11:03:37.077" Score="2" Body="&lt;p&gt;You might be interested in this link:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.dukascopy.com/swiss/english/marketwatch/historical/&quot; rel=&quot;nofollow&quot;&gt;https://www.dukascopy.com/swiss/english/marketwatch/historical/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's not as good as Reuters or Bloomberg data, but it's free.&lt;/p&gt;&#xA;" OwnerUserId="4769" LastActivityDate="2015-05-26T11:03:37.077" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="17987" PostTypeId="1" CreationDate="2015-05-26T13:53:10.693" Score="0" ViewCount="61" Body="&lt;p&gt;&lt;strong&gt;QUESTION:&lt;/strong&gt;&#xA;How should I analyze the statistical significance of the difference between two buy-and-hold strategies (or the relative performance) when the samples are not independent?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Background:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to compare the performance of two stock classes from a certain company (e.g. Class A shares and Class B shares) after a stock-split. &#xA;I want to analyze how this stock-split affects the return of Class B shares relative to Class A shares. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to analyze the performance difference over a long time span, hence an event-study is inappropriate. Therefore, I want to use a buy-and-hold strategy. Simple analyzing the statistical differences by conducting a &lt;em&gt;t&lt;/em&gt;-test or &lt;em&gt;F&lt;/em&gt;-test is not appropriate as both samples are not independent. Hence, I want to analyze the difference in prices between the buy-and-hold strategy holding Class A shares (P1) and the buy-and-hold strategy holding Class B (P2) shares, i.e.:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;c = P1 - P2, where c is a constant (e.g. 1)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, as both shares increase in value over the years the variance increases and I'm left with heteroskedasticity. Thus, analyzing whether the constant is statistically significant also does not make sense. Can someone tell me how I should analyze the statistical significance of the difference between two buy and hold strategies (or the relative performance)? For example, how can I tell whether P2 is higher than P1 and statistically significant?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S I do not want to analyze returns as the returns only differ on the days surrounding the stock-split, hence the differences in returns are negligible over longer time periods. On the other hand, differences in prices can vary significantly (my hypothesis) as differences in returns accumulate.&lt;/p&gt;&#xA;" OwnerDisplayName="user15050" LastActivityDate="2015-05-26T13:53:10.693" Title="Compare performance buy-and-hold strategies after stock-split" Tags="&lt;testing&gt;&lt;statistical-significance&gt;" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="17988" PostTypeId="2" ParentId="16440" CreationDate="2015-05-26T15:15:07.727" Score="3" Body="&lt;p&gt;You do note require a sum up constraint that gives you that the weights sum up to 1?&#xA;Then the problem is equivalent to a maximization without constraints:&#xA;$$Z(\omega)=w'\mu -  \frac{\gamma}{2}w'Vw$$&#xA;then it holds that&#xA;$$\frac{dZ}{d\omega}=\mu-\gamma V\omega\overset{!}{=}0\\&#xA;\Leftrightarrow \frac{1}{\gamma}\mu=V\omega^*\\&#xA;\Leftrightarrow\omega^* = \frac{1}{\gamma}V^{-1}\mu $$ &lt;/p&gt;&#xA;" OwnerUserId="16249" LastActivityDate="2015-05-26T15:15:07.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17989" PostTypeId="1" CreationDate="2015-05-26T17:02:10.200" Score="4" ViewCount="1218" Body="&lt;p&gt;Where can I find a reasonably-priced or free API, database or CSV which contains a list of competitors for a given stock symbol?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I want to find competitors for various symbols, like GOOG, TWTR, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By reasonably priced, I mean, under $50 per month. I've seen Owler and others, but the pricing is hidden.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One option is to scrape data from Yahoo Finance, but I prefer to do it properly and leave that as a last resort. I tried to find an API that returns Yahoo Finance competitor data, but haven't found one yet.&lt;/p&gt;&#xA;" OwnerUserId="16352" LastActivityDate="2018-07-03T13:58:17.423" Title="List competitors for a given stock?" Tags="&lt;market-data&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="17990" PostTypeId="2" ParentId="17989" CreationDate="2015-05-26T17:34:37.373" Score="2" Body="&lt;p&gt;There are two main classifications professionals use. You would need to purchase one of the two main standards, get it from your university or hand source it. Using this information it is easy to sort out which competitors are in a given sector.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The two main sources are the &lt;a href=&quot;http://en.wikipedia.org/wiki/Global_Industry_Classification_Standard&quot; rel=&quot;nofollow&quot;&gt;Global Industry Classification Standard (GICS)&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/Industry_Classification_Benchmark&quot; rel=&quot;nofollow&quot;&gt;Industry Classification Benchmark (ICB)&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To obtain GICS: &lt;a href=&quot;https://www.msci.com/gics&quot; rel=&quot;nofollow&quot;&gt;click here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To obtain ICB: &lt;a href=&quot;http://www.icbenchmark.com/&quot; rel=&quot;nofollow&quot;&gt;click here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to understand a companies key competitors analytically, without digging through the financials yourself. &lt;a href=&quot;http://www.factset.com/campaigns/revere&quot; rel=&quot;nofollow&quot;&gt;Revere from FactSet&lt;/a&gt; sells supply chain data that may be useful.&lt;/p&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="1764" LastEditDate="2015-05-26T22:27:07.620" LastActivityDate="2015-05-26T22:27:07.620" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="17991" PostTypeId="2" ParentId="3319" CreationDate="2015-05-26T20:42:48.690" Score="0" Body="&lt;p&gt;Lots of answers, but not totally clear...  Let me try to explain the I understood...&#xA;Take 3 bonds -&gt; &#xA;1) treasury bond&#xA;2) risky bond&#xA;3) risky bond (same as above) with embedded call option&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For bond 2, Z-spread = 2% (200 basis points)&#xA;For bond 3, Z-spread = 3% (which includes the optionality) -&gt; if you adjust the optionality(that is with out option) or OAS, it will be 2% -&gt; which is same as above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So Z-spread for bond 3 = Z-spread for bond 2(=OAS) + option cost&#xA;Not sure whether I confused more or make it little clearer.&lt;/p&gt;&#xA;" OwnerUserId="16356" LastActivityDate="2015-05-26T20:42:48.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17992" PostTypeId="1" AcceptedAnswerId="17994" CreationDate="2015-05-26T21:00:16.320" Score="8" ViewCount="5167" Body="&lt;p&gt;Consider the vector of $n$ Ito processes&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;d \mathbf{X}_t = \mathbf{\mu}(\mathbf{X}_t,t)dt + \Sigma(\mathbf{X}_t,t)d\mathbf{W}_t&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\mathbf{\mu} \in \mathbb{R}^n$ and $\Sigma \in \mathbb{R}^{n \times n}$.  Let $f$ be a twice continuously differentiable real-valued function of $n$ real variables, so $f: \mathbb{R}^n \to \mathbb{R}$.  Ito's lemma in multiple dimensions tells us&#xA;$$&#xA;df(\mathbf{X}) = \sum_{i=1}^n \frac{\partial f}{\partial x_i}(\mathbf{X}_t)dX_t^i + \frac{1}{2} \sum_{i,j=1}^n \frac{\partial^2 f}{\partial x_i \partial x_j}(\mathbf{X}_t)dX_t^i dX_t^j.&#xA;$$&#xA;The quantity $df \in \mathbb{R}$, like $f$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, what about vector-values $f$?  E.g. with $\mathbf{X_t}$ as above, let $dS_t = \mu(S_t,t)dt + \sigma(S_t,t)dW_t$ and set $f(\mathbf{x},s) = \frac{\mathbf{x}}{s} = (\frac{x_1}{s}, \ldots, \frac{x_n}{s})^T$.  This would come up when discounting a vector of assets by a numeraire.  Now $f: \mathbb{R}^{n+1} \to \mathbb{R}^n$, so it seems to make sense that the differential $df \in \mathbb{R}^n$, too, but I can't see to find such a statement.  How should one handle such a differential?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2015-05-27T02:56:18.730" Title="Multidimensional Ito's Lemma for Vector-Valued functions" Tags="&lt;stochastic-calculus&gt;&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="17993" PostTypeId="1" CreationDate="2015-05-26T23:54:07.680" Score="9" ViewCount="2403" Body="&lt;p&gt;I have 2 interest rate curves (LIBOR 3M and OIS). I want to create stress scenarios for those two curves. &#xA;Is it possible that some scenarios will make my term structure arbitrageable? &#xA;How can I test if, after I apply the shocks to the curves, I did break the no-arbitrage condition in the term structure? &lt;/p&gt;&#xA;" OwnerUserId="15038" LastActivityDate="2015-11-25T10:08:16.967" Title="How to check that an interest rate curve is arbitrage free" Tags="&lt;interest-rates&gt;&lt;arbitrage&gt;&lt;no-arbitrage-theory&gt;&lt;term-structure&gt;&lt;stress-testing&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="17994" PostTypeId="2" ParentId="17992" CreationDate="2015-05-27T02:56:18.730" Score="4" Body="&lt;p&gt;Maybe I'm missing something?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given $f:\mathbb{R}^n \rightarrow \mathbb{R}^m$, you can write $f = (f_1,\ldots,f_m)$, where each $f_i:\mathbb{R}^n \rightarrow \mathbb{R}$.  Apply Ito to each $f_i$ separately.&lt;/p&gt;&#xA;" OwnerUserId="3415" LastActivityDate="2015-05-27T02:56:18.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17995" PostTypeId="1" AcceptedAnswerId="18045" CreationDate="2015-05-27T03:56:18.630" Score="3" ViewCount="211" Body="&lt;p&gt;I know that the Kelly Criterion maximizes bankroll, but i was wondering how much value it contributes to the total return and under what circumstances. I'm trying to understand the difference between using Kelly Criterion for sizing vs. arbitrary allocations, say... every bet that I make, I allocate 10% of my bankroll, and my alternative is using Kelly Criterion. In the long run, how much more bankroll would I have if I used Kelly Criterion? I'm sure people have looked into these simulations, any pointers would be great. I'm also looking for an intuitive or conceptual answer if there are general rules of thumb.&lt;/p&gt;&#xA;" OwnerUserId="15482" LastEditorUserId="15482" LastEditDate="2015-05-27T04:06:30.003" LastActivityDate="2015-05-29T17:19:17.507" Title="the incremental value of Kelly Criterion under difference circumstances" Tags="&lt;position-sizing&gt;&lt;kelly-criterion&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17996" PostTypeId="1" AcceptedAnswerId="18017" CreationDate="2015-05-27T05:11:20.407" Score="3" ViewCount="276" Body="&lt;p&gt;If you look at the FOMC announcement schedule &lt;a href=&quot;http://www.federalreserve.gov/monetarypolicy/fomccalendars.htm&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;, you will see that since 2011, there have been 4 unscheduled meetings. By any chance, though they are &quot;unscheduled&quot; do market participants know one day or few hours before the meeting that there will be an actual &quot;unscheduled&quot; meeting or it is known to market participants only after the meeting took place?&lt;/p&gt;&#xA;" OwnerUserId="2570" LastActivityDate="2015-05-28T15:00:02.470" Title="FOMC Unscheduled Meetings" Tags="&lt;fomc&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="17999" PostTypeId="2" ParentId="12617" CreationDate="2015-05-27T11:45:58.100" Score="2" Body="&lt;p&gt;Since Fx Fwd has different underlying risk factors, it decomposes the positions into different cash flows. The spot (currency) position is created to account for the impact of exchange rate fluctuation. &lt;/p&gt;&#xA;" OwnerUserId="16361" LastActivityDate="2015-05-27T11:45:58.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18001" PostTypeId="1" AcceptedAnswerId="18020" CreationDate="2015-05-27T13:34:33.407" Score="2" ViewCount="4804" Body="&lt;p&gt;I am using python to access the Bloomberg Desktop API and am running into issues with the timezone conversion for their tick data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The data they deliver is supposed to be UTC but there is something strange going on where some data seems to be offset by a day. See the below conversation for details-- I have tried this but it doesnt seem to be working. I haven't been able to find a pattern in the offset so far:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Hi *******, &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;So the offset comes in either positive or negative depending on&#xA;  whether or not GMT is ahead or behind the exchange time zone. So in&#xA;  that sense, I would always grab the hour from the API, sum that with&#xA;  the offset, if we're &gt; 24 hours then add a day and modulo 24 - else if&#xA;  we're &amp;lt; 24 hours, I would take that negative number and add it to 24,&#xA;  and subtract a day. &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Something along those lines should do the trick here. &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Please reach out with H#******* with any questions - take care, &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Bloomberg Help&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;For further help: Press the  key twice. Reference H#******* to&#xA;  continue this inquiry.&lt;/p&gt;&#xA;  &#xA;  &lt;hr&gt;&#xA;  &#xA;  &lt;p&gt;*******@bloomberg.net&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Your question was: Re:H#****** Adjusting GMT to local  exchange&#xA;  time&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;How about this:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Take GMT timestamp returned by API, take the hour, subtract the&#xA;  offset....if the result is less than 0, need to adjust the date&#xA;  forward by one after converting to EST? Does that sound right?&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;From: HELP DESK (BLOOMBERG) At: May 11 2015 11:21:18 Subject:&#xA;  Re:H#******** Adjusting GMT to local  exchange time&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Hi *******, &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Following up on our conversation from Friday. Ultimately what we'll&#xA;  need to do is pull in the offset with the TIME_ZONE_NUM field, and add&#xA;  some logic to your code to adjust for the fact that we may go over 24&#xA;  hours here. &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;One way to do that would be by taking the GMT + offset modulo 24 to&#xA;  get the hour on the next day - then incorporate the fact that we will&#xA;  need to adjust the day forward as well. &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Please reach out with h#******** with any further questions here. &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Have a good one, &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Bloomberg Help&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;For further help: Press the  key twice. Reference H#******** to&#xA;  continue this inquiry.&lt;/p&gt;&#xA;  &#xA;  &lt;hr&gt;&#xA;  &#xA;  &lt;p&gt;Your question was: I am getting API TickData for 8035 JP&#xA;  Equity....something seems be wierd with the timezone conversion. For&#xA;  example...I am looking at a trade in my Terminal at 23:00:07 on&#xA;  01/08/15 [600 shares @ 8670] EST....when I pull the same trade through&#xA;  teh IntraDayTick API function the trade is reported as 04:00:07 on&#xA;  01/08/15 (THIS IS UTC/GMT). However converting this to EST would be&#xA;  23:00:07 on 01/07/15, not 01/08/15....what is going on?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Wondering if anyone has had a similar issue / has solved this? Seems strange to me that this is not clear. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the full example of the problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the Terminal:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;8035 JP Equity QR:&#xA;&#xA;FROM: 23:00:07 01/08/2015&#xA;TO: 23:00:07 01/08/2015&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Returns Trade:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Time: 23:00:07, Size: 600, Price: 8670&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The Date/Time here is &lt;strong&gt;&lt;code&gt;EST 23:00:07 01/08/2015&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same trade via API &lt;code&gt;IntradayTickRequest&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;tickData = {TIME = 2015-01-08T04:00:07.000&#xA;    TYPE = TRADE&#xA;    VALUE = 8670.000000&#xA;    SIZE = 600}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The Date/Time here is &lt;code&gt;UTC 04:00:07 01/08/2015&lt;/code&gt;, which converted (using &lt;a href=&quot;http://www.timezoneconverter.com/&quot; rel=&quot;nofollow&quot;&gt;http://www.timezoneconverter.com/&lt;/a&gt;) is &lt;strong&gt;&lt;code&gt;ETC 23:00:07 01/07/2015&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the Terminal and API are reporting different days for certain trades, I am looking for some sort of rule to standardize the data.&lt;/p&gt;&#xA;" OwnerUserId="13446" LastEditorUserId="13446" LastEditDate="2015-05-28T15:23:17.550" LastActivityDate="2015-05-28T17:20:38.733" Title="Bloomberg tick data timezone offset" Tags="&lt;time-series&gt;&lt;bloomberg&gt;&lt;tick-data&gt;" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18003" PostTypeId="1" CreationDate="2015-05-27T14:12:23.817" Score="3" ViewCount="1839" Body="&lt;p&gt;Did anyone work with Bloomberg scripting language (BLAN is the name I guess). If so is it really flexible and is it competitive with other valuation services (say Super Derivatives). Does it enable you to create complex structured payoffs? What are possible problems when working with it?&lt;/p&gt;&#xA;" OwnerUserId="15916" LastActivityDate="2017-01-14T13:05:20.080" Title="Bloomberg scripting language (BLAN)" Tags="&lt;programming&gt;&lt;derivatives&gt;&lt;bloomberg&gt;&lt;exotics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18004" PostTypeId="1" CreationDate="2015-05-27T14:22:39.893" Score="3" ViewCount="978" Body="&lt;p&gt;I am coding some simple .mql4 program, you know, the fx market is offline on weekend, and the market will be not shown in Meta trader 4 platform. I wanna test my program in meta trader 4 on weekend. If you know how to test it when the market offline, please let me how to do this?&lt;/p&gt;&#xA;" OwnerUserId="16365" LastActivityDate="2018-06-05T16:12:12.660" Title="Test .mql4 (meta trader 4 editor) when the fx market offline" Tags="&lt;programming&gt;&lt;market-data&gt;&lt;fx&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18006" PostTypeId="2" ParentId="17962" CreationDate="2015-05-27T18:35:23.900" Score="1" Body="&lt;p&gt;Oanda also offers tick data for free provide you have an account with them and maintain a balance in excess of $1,000 (academic exceptions are possible). The data can be downloaded from&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://fxtrade.oanda.com/trade-forex/fxtrade/historical-data&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://fxtrade.oanda.com/trade-forex/fxtrade/historical-data&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It appears that you need to log in to see the relevant restrictions but I have included them here for people to see&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;To qualify for this service, you need an fxTrade account with a balance of USD 1000 or more. (See below for additional restrictions, and to find out about academic exemptions.)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Restrictions&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;To qualify for this service, you need an fxTrade account with a balance of USD 1000 or more. (There is an exemption for academics—see below.)&#xA;  You can order data dated as far back as January 1, 2004, and as recent as two (2) months ago. Dates begin and end at midnight GMT.&#xA;  Orders may take up to two weeks to process.&#xA;  So that we can fairly accommodate as many people as possible, each user account can have only one order queued for processing at any time. You may submit a new order as soon as your previous order is processed.&#xA;  This service requires a Javascript-enabled browser.&#xA;  OANDA Rates® are proprietary. Access and use is subject to a limited purpose, fixed-term license agreement. Use is restricted to Licensee's own internal use. Rates are provided &quot;as is&quot; without warranty of accuracy or completeness. All rights reserved.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Academic Exemptions&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If you are an academic, you can apply for an exemption from the USD 1000 account minimum:&#xA;  You still must open an fxTrade account.&#xA;  Click the exemption box located at the bottom of the form.&#xA;  In the form's description box, supply details of your academic institution and faculty and include an email address from your academic institution.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.truefx.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;TrueFX&lt;/a&gt; also has good history with a variety of pairs. Registration is required but is free.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;TrueFX brings you real, dealable prices from market making banks, delivered directly with no intermediary. With TrueFX, everyone with an Internet connection has access to clean, untouched liquidity, direct from leading market makers. TrueFX offers streaming real-time, tick-by-tick bid/offer currency rates for free. It also provides access to a database of historical tick-by-tick bid/offer currency rates without charge.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="5420" LastEditorUserId="5420" LastEditDate="2017-08-10T12:56:25.433" LastActivityDate="2017-08-10T12:56:25.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18007" PostTypeId="1" AcceptedAnswerId="18022" CreationDate="2015-05-27T19:10:24.580" Score="11" ViewCount="2494" Body="&lt;p&gt;I would like to understand the intuition behind the following question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why a certain weighted sum of prices of put and calls is equivalent to the implied variance of an underlying?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A variance swap is replicated with a static basket of calls and puts (I understand that this replicates the implied variances) which are delta-hedged (this replicates the realized variance), but what I find difficult is the intuition behind that.&lt;/p&gt;&#xA;" OwnerUserId="15285" LastEditorUserId="7202" LastEditDate="2015-05-28T12:13:45.440" LastActivityDate="2016-09-13T21:18:35.593" Title="Variance replication using options" Tags="&lt;options&gt;&lt;volatility&gt;&lt;implied-volatility&gt;&lt;variance&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="18008" PostTypeId="1" CreationDate="2015-05-27T19:15:58.620" Score="1" ViewCount="178" Body="&lt;p&gt;I'd like to represent graphically/visually a fund/portfolio by something that resembles a pie chart. But... the fund/portfolio contains things that have negative value (think of liabilities such as: accrued fees, FX hedging marks etc.) These are relatively quite small (e.g., less than 10%).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I graphically present such a portfolio? I like the pie chart, but other suggestions are welcome too. However, I'm not super enthusiastic about a single column bar chart. I'm hoping for some ingenious find. &lt;/p&gt;&#xA;" OwnerUserId="13924" LastActivityDate="2015-05-28T07:00:18.447" Title="Pie-chart (or alternative) representation with negative values/liabilities" Tags="&lt;visualization&gt;&lt;graphs&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18009" PostTypeId="2" ParentId="18004" CreationDate="2015-05-27T20:37:30.453" Score="1" Body="&lt;p&gt;You need to use the strategy tester. It is a built in feature of mt4 and well known and documented. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more information you can google &quot;mt4 strategy tester&quot; or just check mql4.com (or mql5.com.... they are starting to merge pages from mql4 to mql5).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can start here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.investopedia.com/university/forex-software-metatrader-4-advanced-guide/strategy-testing-and-optimization.asp&quot; rel=&quot;nofollow&quot;&gt;http://www.investopedia.com/university/forex-software-metatrader-4-advanced-guide/strategy-testing-and-optimization.asp&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15871" LastActivityDate="2015-05-27T20:37:30.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18010" PostTypeId="1" AcceptedAnswerId="18062" CreationDate="2015-05-27T21:48:23.843" Score="2" ViewCount="2927" Body="&lt;p&gt;Suppose $S$ is some FX rate, EUR/USD say, and $\sigma_{S}(K,T)$ is the implied volatility for some option written on $S$, sourced from the surface $\sigma_{S}(\cdot,\cdot)$ (alternatively, consider the implied volatility surface $(\Delta,T)\mapsto\sigma_{S}(\Delta,T)$, commonly used for FX implied volatility data).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose we have the following term-structure data (maturity tenors $T$ for 1D, 1W, 2W, 3W, 1M, ..., 1Y, ..., 10Y):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Forward rates $F(\cdot)$&lt;/li&gt;&#xA;&lt;li&gt;Risk-free zero rates $r_{d}(\cdot)$ and $r_{f}(\cdot)$ for both currencies&lt;/li&gt;&#xA;&lt;li&gt;ATM volatilities $\sigma_{S}(K^{*},\cdot)$ or $\sigma_{S}(\Delta^{*},\cdot)$ (the ATM strike or delta, denoted with the asterisk, is not known)&lt;/li&gt;&#xA;&lt;li&gt;$25\Delta$ &quot;Risk Reversal&quot; $RR(\cdot)$&lt;/li&gt;&#xA;&lt;li&gt;$25\Delta$ &quot;Butterfly&quot; $BF(\cdot)$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Is there anyway to use (1)-(5) to approximate $\sigma_{S}(K,T)$ given the option's $(K,T)$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(The motivation for asking this question is that I have access to (1)-(5) through an automated data import tool, but not the entire surface, and would like to price some options using the data that can be imported automatically.  The valuation is not being done for trading purposes, so an absolutely precise valuation is not needed, only an estimate.)&lt;/p&gt;&#xA;" OwnerUserId="8230" LastEditorUserId="11936" LastEditDate="2015-05-29T21:22:50.180" LastActivityDate="2021-04-29T13:15:50.657" Title="Using FX ATM/RR/BF Volatility to Estimate Smile" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;implied-volatility&gt;&lt;fx&gt;&lt;valuation&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18011" PostTypeId="1" CreationDate="2015-05-27T23:36:07.430" Score="2" ViewCount="358" Body="&lt;p&gt;From the plot of volatility surface, as maturity goes up, the implied volatility will decrease. Dose it mean that options with the same strike have higher value when maturity is larger. If so why price of large maturity option is often higher, which can contribute to calendar spread?&lt;/p&gt;&#xA;" OwnerUserId="16343" LastActivityDate="2015-05-29T07:20:07.957" Title="Questions on the relationship between option price and maturity" Tags="&lt;option-pricing&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18012" PostTypeId="2" ParentId="18011" CreationDate="2015-05-28T05:34:14.823" Score="1" Body="&lt;p&gt;I'll try to make a guess. Maybe it's due to the properties of the underlying, since we know that GBM will go to almost every point with a sufficient amount of time. The higher the time, the higher the probability of hitting a given price, the higher the value of an option.&lt;/p&gt;&#xA;" OwnerUserId="16045" LastActivityDate="2015-05-28T05:34:14.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18013" PostTypeId="2" ParentId="18011" CreationDate="2015-05-28T06:06:55.393" Score="0" Body="&lt;p&gt;An option is hedged by holding some stocks and risk-free bonds. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Option Price = a * stock + (1-a) * risk-free-bonds&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where a is the position of the stock needed for hedging in the self-finance portfolio. Therefore, the option price depends on price of the zero coupon bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if we have two options, everything the same but time-to-maturity, let's say T1, T2, T2 &gt; T1. The T2 option needs to be hedged with a T2 zero-coupon-bond. However, the T2 bond costs less than the T1 bond because everyone prefers a bond that pays back the money earlier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, the price of the option must go up for the T2 option. The relationship can be explained by how Black-Scholes is derived in the first-place (delta continuous hedging).&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2015-05-28T06:06:55.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18014" PostTypeId="2" ParentId="18008" CreationDate="2015-05-28T07:00:18.447" Score="2" Body="&lt;p&gt;I would suggest you have a look at the waterfall chart: &lt;a href=&quot;http://en.m.wikipedia.org/wiki/Waterfall_chart&quot; rel=&quot;nofollow&quot;&gt;http://en.m.wikipedia.org/wiki/Waterfall_chart&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16067" LastActivityDate="2015-05-28T07:00:18.447" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18015" PostTypeId="1" AcceptedAnswerId="18069" CreationDate="2015-05-28T07:13:01.003" Score="8" ViewCount="926" Body="&lt;p&gt;I am familiar with the theory of Monte-Carlo techniques in the numerical integration, and recently I have started my experiments with these methods applied to derivatives pricing. I am using Glasserman's book as my reference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've started by computing simply ATM vanilla call price. My setting is very basic: I have 100 time steps, I use Black-Scholes model (so that I can check the validity of the results) and Euler-Maryuama, Runge Kutta and Milstein numerical integration schemes. It appears that I need about $10^6$ samples to get stable results, and in Python that takes about 6 minutes. I have a rather fast machine, and I find this speed to be really low. Initially I thought the reason is in random sampler. However from what I've checked, sampling normal random variables does take some time, but $80\%$ of the computational time comes from the arithmetic operations (addition and multiplication) - even in case of basic Euler-Maryuama scheme. I do understand that in case of Geometric Brownian Motion there are much smarter simulation techniques available, but I'd like to keep it generic since I ultimately would like to work with more general diffusions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps that's just an issue with Python, but that issue made me thought of speeding up my Monte-Carlo simulations. In Glasserman's book there are two types of speeding procedures:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Variance reduction, including control variates, antithetic sampling and importance sampling. I've used the latter before, and my best bet is on that.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Quasi Monte Carlo (low discrepancy sequences). I've never used it before, and it seems now to me that it can only be applied to compute integrals in the usual form, say when the densities are given explicitly just the analytic formula for the integral is unknown.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So far my goal is to be able to price exotic options with Monte-Carlo. Say, the model is 1-dimensional, and exotic payoff is extremely path-dependent. Perhaps later I'd need to price also an American version of such option. My questions are as follows: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Which of the variance reduction methods shall I pay special attention to?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is QMC at all possible to apply in such problem, or do I really need to have an integral expression (over a finite-dimensional domain) for the option price? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;To clarify my question regarding QMC. I see three ways (Q)MC can be applied in pricing.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;to sample increments of Brownian motion/jump components over the real line&lt;/li&gt;&#xA;&lt;li&gt;to sample whole paths from the path space&lt;/li&gt;&#xA;&lt;li&gt;if the value of the option &lt;em&gt;have been found&lt;/em&gt; to have shape &#xA;$$&#xA;\tag{1}  \int_D p(S_1,\dots,S_n)f(S_1,\dots,S_n)\;\mathrm dS_1\dots \mathrm dS_n&#xA;$$&#xA;where $p$ is a payoff function, $S_1,\dots, S_n$ are payoff variable (multiple stocks or multiple time measurements of stock or whatever else), then (Q)MC can also be used to sample from $D$ to compute the integral in $(1)$ numerically.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As far as I understood from Glasserman's book, he only considers QMC as a good solution for the very last method, where he provides some evidence that it beats usual random MC. In contrast, for the first two methods he talks about usual MC and variance reduction techniques. So my question regarding QMC is: can it be successfully applied in the first two methods, or it is not well-designed for them and I shall not expect much benefits from using QMC in the first two methods?&lt;/p&gt;&#xA;" OwnerUserId="13480" LastEditorUserId="13480" LastEditDate="2015-05-29T08:17:34.793" LastActivityDate="2015-06-03T09:05:17.927" Title="Speeding up computations: when to use Quasi and standard Monte-Carlo in pricing" Tags="&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;numerical-methods&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="18016" PostTypeId="2" ParentId="18001" CreationDate="2015-05-28T14:55:19.620" Score="0" Body="&lt;p&gt;&quot;some data is offset by a day&quot;: you don't give enough detail about what security/data and what time is involved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This may have to do with the difference between the calendar date and the trading session date.  For example S&amp;amp;P futures begin trading at 6pm new york time on Sunday. However that is considered part of the monday session. So you have to be clear about the actual date and the trading session date. There is trading on Sunday for the Monday business date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, don't talk only to the general Bloomberg help desk, try to reach an API specialist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;HTH &lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2015-05-28T14:55:19.620" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18017" PostTypeId="2" ParentId="17996" CreationDate="2015-05-28T15:00:02.470" Score="5" Body="&lt;p&gt;Investors only know about the scheduled meetings. They only find out about the emergency meetings afterwards when the Fed issues a press release the next day at say 8am, which surprises the market. It would be highly improper and illegal for anyone to know about it in advance.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2015-05-28T15:00:02.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18018" PostTypeId="1" CreationDate="2015-05-28T15:41:12.817" Score="11" ViewCount="2003" Body="&lt;p&gt;I've recently learned that at the delivery of Treasury futures the short side can decide which of the $n$ Treasury bonds (with relevant maturities) to deliver. If the short side chooses to deliver the $i$-th bond, the the long side has to pay $c_i\cdot F$ for delivery, where $c_i$ is the conversion factor for the $i$-th bond, which is the value everybody knows. If the bond price at delivery is $B_i$ then the short side delivers the cheapest-to-deliver (CDT) $\hat i$-th bond where&#xA;$$&#xA;\tag{1}  \hat i = \operatorname{argmin}\limits_{1\leq i\leq n}\left(B_i - c_i\cdot F\right).&#xA;$$&#xA;As a result, CDT bonds depend on the $F$ whereas $F$ itself shall be some kind of expected value of the delivered bond, that is &#xA;$$&#xA;\tag{2}  F = \frac{\Bbb E B_{\hat i}}{\Bbb E c_\hat i}.&#xA;$$&#xA;From these arguments it seems that to find $F$ one has to solve a fixpoint problem $(1)-(2)$, and it does not seem to be trivial even to prove existance there. Am I missing something?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In case I don't miss anything, I think the problem can be simplified as follows. To avoid all the discounting/margin account issues, let's talk about the forward contract the expires on one of the stocks $S_i$ where $1\leq i\leq n$. To each of these stocks we assign some constant adjustment weighting $c_i$, and at the maturity of the contract the short side has to choose $i$ and deliver the cash difference $S_i - c_i\cdot F$, where $F$ is the forward price we agree upon now, and $S_i$ is the stock price at the delivery. I assume that neither of stocks pays dividends, and interest rates are $0$. Of course, since it's a cash delivery, the short side will deliver $S_{\hat i}$&#xA;$$&#xA;  \hat i = \operatorname{argmin}\limits_{1\leq i\leq n}\left(S_i - c_i\cdot F\right).&#xA;$$&#xA;Under these conditions it may be ok to assume that the forward price satisfies&#xA;$$&#xA;  \Bbb E[S_\hat i -  c_\hat i\cdot F] = 0&#xA;$$&#xA;which of course translates into $(2)$.&lt;/p&gt;&#xA;" OwnerUserId="13480" LastEditorUserId="13480" LastEditDate="2015-05-29T07:10:12.343" LastActivityDate="2015-05-29T13:30:56.327" Title="Pricing Treasury futures" Tags="&lt;fixed-income&gt;&lt;futures&gt;&lt;bond&gt;&lt;bond-futures&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="18020" PostTypeId="2" ParentId="18001" CreationDate="2015-05-28T17:20:38.733" Score="5" Body="&lt;p&gt;It turns out that the Bloomberg Terminal &lt;code&gt;QR&lt;/code&gt; function, when adjusting the timezone from Exchange/UTC to your timezone, will convert the time but not the day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Trades displayed via &lt;code&gt;IntradayTickRequest&lt;/code&gt; API are correct in UTC time, trades displayed via Bloomberg Terminal &lt;code&gt;QR&lt;/code&gt; may be incorrect due to failure to adjust the stated date for timezone adjustments.&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="13446" LastActivityDate="2015-05-28T17:20:38.733" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18022" PostTypeId="2" ParentId="18007" CreationDate="2015-05-28T18:00:12.660" Score="28" Body="&lt;p&gt;Let $t_0, t_1, \ldots, t_n$ be observation dates, where $0=t_0 &amp;lt; \cdots &amp;lt; t_n = T$, and $\{S_t \mid t \geq 0\}$ be the equity price process without dividend payments. Then the realized variance is defined by&#xA;\begin{align*}&#xA;\frac{252}{n}\sum_{i=1}^n \ln^2 \frac{S_{t_i}}{S_{t_{i-1}}}.&#xA;\end{align*}&#xA;Note that, for sufficiently small $x$, &#xA;\begin{align*}&#xA;\ln (1+x) \approx x - \frac{1}{2}x^2.&#xA;\end{align*}&#xA;Moreover,&#xA;\begin{align*}&#xA;\ln^2 (1+x) &amp;amp;\approx x^2\\&#xA;&amp;amp;\approx 2x - 2 \ln(1+x).&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;\sum_{i=1}^n \ln^2 \frac{S_{t_i}}{S_{t_{i-1}}} &amp;amp;\approx 2\sum_{i=1}^n \frac{S_{t_{i}}-S_{t_{i-1}}}{S_{t_{i-1}}}-2\ln\frac{S_T}{S_0}.&#xA;\end{align*}&#xA;Assuming that the short interest rate $r_t$ is deterministic, &#xA;\begin{align*}&#xA;E\bigg(\sum_{i=1}^n \ln^2 \frac{S_{t_i}}{S_{t_{i-1}}}\bigg) &#xA;&amp;amp;\approx 2\sum_{i=1}^n E\Bigg(E\bigg(\frac{S_{t_{i}}-S_{t_{i-1}}}{S_{t_{i-1}}}\mid S_{t_{i-1}}\bigg)\Bigg)-2E\bigg(\ln\frac{S_T}{S_0}\bigg)\\&#xA;&amp;amp;= 2\sum_{i=1}^n E\Bigg(\frac{S_{t_{i-1}}e^{\int_{t_{i-1}}^{t_i}r_s ds}-S_{t_{i-1}}}{S_{t_{i-1}}}\Bigg)-2E\bigg(\ln\frac{S_T}{S_0}\bigg)\\&#xA;&amp;amp;= 2\sum_{i=1}^n \Big(e^{\int_{t_{i-1}}^{t_i}r_s ds} -1\Big)-2E\bigg(\ln\frac{S_T}{S_0}\bigg)\\&#xA;&amp;amp;\approx 2\sum_{i=1}^n \int_{t_{i-1}}^{t_i}r_s ds - 2E\bigg(\ln\frac{S_T}{S_0}\bigg)\\&#xA;&amp;amp;= 2\int_0^T r_s ds - 2E\bigg(\ln\frac{S_T}{S_0}\bigg)\\&#xA;&amp;amp;= 2\ln \Big(S_0 e^{\int_0^T r_s ds} \Big) - 2 \ln S_0 - 2E\bigg(\ln\frac{S_T}{S_0}\bigg)\\&#xA;&amp;amp;= -2E\bigg(\ln\frac{S_T}{E(S_T)} \bigg).&#xA;\end{align*}&#xA;Note that, for any smooth function $f$, $a&amp;gt;0$, and $x&amp;gt;0$,&#xA;\begin{align*}&#xA;f(x) = f(a) + f'(a)(x-a) + \int_a^{\infty}(x-k)^+ f''(k)dk + \int_0^a (k-x)^+f''(k)dk.&#xA;\end{align*}&#xA;See also &lt;a href=&quot;https://quant.stackexchange.com/questions/10775/how-to-hedge-a-derivative-that-pays-the-reciprocal-of-the-stock-price/14224#14224&quot;&gt;How to hedge a derivative that pays the reciprocal of the stock price?&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the function $f(x)=\ln x$ with $x=S_T$ and $a = E(S_T)$. We have that&#xA;\begin{align*}&#xA;\ln S_T = \ln E(S_T) + \frac{S_T - E(S_T)}{E(S_T)} - \int_{E(S_T)}^{\infty} \frac{(S_T-k)^+}{k^2} dk - \int_0^{E(S_T)} \frac{(k-S_T)^+}{k^2} dk.&#xA;\end{align*}&#xA;Therefore,&#xA;\begin{align*}&#xA;E\bigg(\sum_{i=1}^n \ln^2 \frac{S_{t_i}}{S_{t_{i-1}}}\bigg) &amp;amp;\approx -2E\bigg(\ln\frac{S_T}{E(S_T)} \bigg)\\&#xA;&amp;amp;=2E\bigg[\int_{E(S_T)}^{\infty} \frac{(S_T-k)^+}{k^2} dk + \int_0^{E(S_T)} \frac{(k-S_T)^+}{k^2} dk\bigg],&#xA;\end{align*}&#xA;which is a weighted sum of prices of put and calls.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For an elementary and intuitive explanation, we consider the Black Scholes setting with a geometric Brownian motion. That is,&#xA;\begin{align*}&#xA;S_T &amp;amp;= S_0 \exp\big((r-\frac{1}{2}\sigma^2)T+\sigma W_T \big)\\&#xA;&amp;amp;= E(S_T) \exp\big(-\frac{1}{2}\sigma^2T+\sigma W_T \big),&#xA;\end{align*}&#xA;where $\{W_t\mid t\geq 0\}$ is a standard Brownian motion.&#xA;Then, we have the variance&#xA;\begin{align*}&#xA;\sigma^2 =\frac{2}{T}\Big(\sigma W_T -\ln \frac{S_T}{E(S_T)} \Big).&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;\sigma^2  = -\frac{2}{T}E\Big(\ln \frac{S_T}{E(S_T)}\Big),&#xA;\end{align*}&#xA;which, as demonstrated above, can be approximated by a weighted sum of prices of put and calls.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2015-05-29T12:53:17.077" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="18025" PostTypeId="1" CreationDate="2015-05-28T19:50:26.853" Score="3" ViewCount="185" Body="&lt;p&gt;I have financial assets with totally different volatilities, thus I must standardize them before PCA, otherwise, assets with high variance may be considered as principle components, which is wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the moment I am trying to decide among following methods : &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Calculate all in USD, divide each one by volatility or&#xA;deviation coefficient, substract mean&lt;/li&gt;&#xA;&lt;li&gt;Get logarithm on each price, substract mean&lt;/li&gt;&#xA;&lt;li&gt;Limit time series by [-1:1]&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Image below describes how time series look like after transformation, coefficients at the right is the first eigenvector.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt; : as you can see on the image, coefficients for each method are quite different and I would like to get an advice about which standardization method looks more appropriate in this case and does not create biases in calculations?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Purpose&lt;/strong&gt; : I do not need unit form vectors, thus, I calculate PCA based on covariance matrix and want to have vectors that really represent projection of specific asset to selected principal component.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Large copy of the image - &lt;a href=&quot;http://snag.gy/iaRRP.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://snag.gy/iaRRP.jpg&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Resulting projection of assets onto first principal component - &lt;a href=&quot;http://snag.gy/DftMT.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://snag.gy/DftMT.jpg&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I think, that if second window shows lowest variance it means that usage of logarithms is the best option, am I right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/R9szp.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Xt2cx.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="6855" LastEditorUserId="6855" LastEditDate="2015-05-28T21:05:41.243" LastActivityDate="2015-05-28T21:05:41.243" Title="Which kind of normalization to prefer before PCA (generic solution for any factor analysis)" Tags="&lt;pca&gt;&lt;normalization&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18026" PostTypeId="2" ParentId="17870" CreationDate="2015-05-28T19:55:45.943" Score="47" Body="&lt;p&gt;My deal is HFT so what I care about is &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;read/load data from file or DB quickly in memory &lt;/li&gt;&#xA;&lt;li&gt;perform very efficient data-munging operations (group,transform)&lt;/li&gt;&#xA;&lt;li&gt;visualize easily the data&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I think is is pretty clear that 3. goes to R, graphics and &lt;a href=&quot;https://github.com/hadley/ggplot2&quot; rel=&quot;noreferrer&quot;&gt;ggplot2&lt;/a&gt; and others allow you to plot anything from scratch with little effort.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;About 1. and 2. I am amazed reading previous post to see that people are advocating for python based on &lt;a href=&quot;https://github.com/pydata/pandas&quot; rel=&quot;noreferrer&quot;&gt;pandas&lt;/a&gt; and that no one cites &lt;a href=&quot;https://github.com/Rdatatable/data.table&quot; rel=&quot;noreferrer&quot;&gt;data.table&lt;/a&gt;&#xA;The data.table is a fantastic package that allows blazing fast grouping/transforming of tables with 10s million rows. From &lt;a href=&quot;https://github.com/Rdatatable/data.table/wiki/Benchmarks-:-Grouping&quot; rel=&quot;noreferrer&quot;&gt;this bench&lt;/a&gt; you can see that data.table is multiple time faster than pandas and much more stable (pandas tend to crash on massive tables)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;R) library(data.table)&#xA;R) DT = data.table(x=rnorm(2e7),y=rnorm(2e7),z=sample(letters,2e7,replace=T))&#xA;R) tables()&#xA;     NAME       NROW NCOL  MB COLS  KEY&#xA;[1,] DT   20,000,000    3 458 x,y,z    &#xA;Total: 458MB&#xA;R) system.time(DT[,.(sum(x),mean(y)),.(z)])&#xA;   user  system elapsed &#xA;  0.226   0.037   0.264 &#xA;&#xA;R)setkey(DT,z)&#xA;R)system.time(DT[,.(sum(x),mean(y)),.(z)])&#xA;  user  system elapsed &#xA;  0.118   0.022   0.140 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then there is speed, as I work in HFT neither R nor python can be used in production. But the &lt;a href=&quot;https://github.com/RcppCore/Rcpp&quot; rel=&quot;noreferrer&quot;&gt;Rcpp&lt;/a&gt; package allows you to write efficient C++ code and integrate it to R trivially (literally adding 2 lines). I doubt R is fading, given the number of new packages created every day and the momentum the language has...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT 2018-07&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few years latter I am amazed by how the R ecosystem has evolved. For in-memory computation you get unmatched tools, from fst for blazing fast binary read/write, fork or cluster parallelism in one liners. C++ integration is incredibly easy with Rcpp. You get interactive graphics with the classics like plotly, crazy features like ggplotly (just makes your ggplot2 interactive).&#xA;For trying python with pandas I honestly do not understand how there could even be a match. Syntax is clunky and performance is poor, I must be too used to R I guess.&#xA;Another thing that is really missing in python is litterate programming, nothing comes close to rmarkdown (the best I could find in python was jupyter but that does even come close).&#xA;With all the fuss surrounding the R vs Python langage war I realize that vast majority of people are simply uninformed, they do not know what data.table is, that it has nothing to do with a data.frame, they do not know that R fully supports tensorflow and keras....&#xA;To conclude I think both tools can do everything and it seems that python langage has very good PR...&lt;/p&gt;&#xA;" OwnerUserId="5339" LastEditorUserId="5339" LastEditDate="2019-09-03T20:29:35.880" LastActivityDate="2019-09-03T20:29:35.880" CommentCount="35" ContentLicense="CC BY-SA 4.0" />
  <row Id="18027" PostTypeId="1" AcceptedAnswerId="18035" CreationDate="2015-05-28T20:09:08.877" Score="1" ViewCount="150" Body="&lt;p&gt;In a simple one-period binomial model we have two possible payoffs: $f(S^u)$ and $f(S^d)$.  To replicate this we must trade in two assets, usually the stock $S$ and the money market account (assumed to initially be 1), and then solve the equations&#xA;$$&#xA;\phi S^u + \psi e^{rT} = f(S^u), \\&#xA;\phi S^d + \psi e^{rT} = f(S^d)&#xA;$$&#xA;to get our hedging strategy $\phi = \frac{f(S^u) - f(S^d)}{S^u - S^d}$, $\psi = e^{-rT} (f(S^u) - \phi S^u)$.  Then for a multi-period model we use backward induction and repeat this program at each node.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why must we trade in the underlying to replicate this payoff?  It seems like absolutely any asset would do as long as they follow our binomial model.  For example, let $C$ be the current price of a cow.  Then, trading in cows (and still assuming $S$ follows the binomial model) I can still solve the equations&#xA;$$&#xA;\hat{\phi} C^u + \hat{\psi} e^{rT} = f(S^u), \\&#xA;\hat{\phi} C^d + \hat{\psi} e^{rT} = f(S^d)&#xA;$$&#xA;to get my hedging strategy $\hat{\phi} = \frac{f(S^u) - f(S^d)}{C^u - C^d}$, $\hat{\psi} = e^{-rT}(f(S^u) - \hat{\phi} C^u)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It just seems that we don't actually need to trade in the underlying at all to replicate an option payoff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, letting $V = \phi S_0 + \psi$ and $\hat{V} = \hat{\phi} C_0 + \hat{\psi}$, we have $V \neq \hat{V}$ in general.  Indeed,&#xA;\begin{align*}&#xA;V = \hat{V} &amp;amp; \iff \phi S_0 + \psi = \hat{\phi} C_0 + \hat{\psi} \\&#xA;&amp;amp; \iff \frac{f(S^u) - f(S^d)}{S^u - S^d}S_0 + e^{-rT} \left(f(S^u) - \frac{f(S^u) - f(S^d)}{S^u - S^d} S^u\right) \\&#xA;&amp;amp; \qquad = \frac{f(S^u) - f(S^d)}{C^u - C^d}C_0 + e^{-rT} \left(f(S^u) -\frac{f(S^u) - f(S^d)}{C^u - C^d} C^u\right) \\&#xA;&amp;amp; \iff \frac{f(S^u) - f(S^d)}{S^u - S^d}S_0 - e^{-rT} \left(\frac{f(S^u) - f(S^d)}{S^u - S^d} S^u\right) \\&#xA;&amp;amp; \qquad = \frac{f(S^u) - f(S^d)}{C^u - C^d}C_0 - e^{-rT} \left(\frac{f(S^u) - f(S^d)}{C^u - C^d} C^u\right) \\&#xA;&amp;amp; \iff \frac{S_0}{S^u - S^d} -  \frac{S^ue^{-rT}}{S^u - S^d} = \frac{C_0}{C^u - C^d} - \frac{C^u e^{-rT}}{C^u - C^d},&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which doesn't seem necessary.  So then the question becomes, what's the correct asset to trade in to price the option?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastEditorUserId="6866" LastEditDate="2015-05-29T19:12:15.900" LastActivityDate="2015-05-29T21:45:28.313" Title="Is Trading in the Underlying Necessary for Replication?" Tags="&lt;option-pricing&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18028" PostTypeId="1" AcceptedAnswerId="18033" CreationDate="2015-05-28T20:21:23.217" Score="6" ViewCount="761" Body="&lt;p&gt;What mathematical concepts are required before I can understand what exactly is a Geometric Brownian motion as applicable to stock prices?&#xA;I mean which branches of probability, calculus, statistics etc. are needed to understand GBM?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By 'understand', I mean gain an intuitive understanding.&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2015-07-31T19:43:26.940" Title="Math background required to understand geometric brownian motion" Tags="&lt;brownian-motion&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18029" PostTypeId="2" ParentId="17945" CreationDate="2015-05-28T20:33:00.887" Score="3" Body="&lt;p&gt;I think I've resolved this for myself, let me know your thoughts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The backward induction argument to arrive at a price is a very explicit construction of a replicating strategy.  I think of this as a &quot;first go&quot; at option pricing using a particular model.  Each step is very explicit, and there is less room for confusion about why this must be the correct price.  Again, no mention of self-financing strategies (SFSs) and hence no mention of the binomial representation theorem (BRT).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, only after we have determined the no-arbitrage price do we can a second pass at what we have done.  It's like we're saying, &quot;I know we already explicitly constructed this strategy, and we already have determined the no-arbitrage price, but let's define these things called martingales and we'll see that we can &lt;em&gt;rephrase&lt;/em&gt; what we've done in a different language: you find me a binomial process that's a martingale and I'll be able to represent any other martingale in terms of it by BRT.  Then after defining a SFS you'll see SFSs exist via BRT, and that the price must again be given as the discounted expectation.&quot;  We can then introduce the Fundamental Theorem of Asset Pricing.&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2015-05-28T20:33:00.887" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18030" PostTypeId="2" ParentId="17962" CreationDate="2015-05-28T20:33:40.743" Score="3" Body="&lt;p&gt;&lt;strong&gt;Option #1&lt;/strong&gt; - If you need historical data you can use one of the links from other answers&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://eareview.net/tick-data/download-free-tick-data&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://eareview.net/tick-data/download-free-tick-data&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/422/training-set-of-tick-by-tick-data&quot;&gt;Training set of tick-by-tick data?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Option #2&lt;/strong&gt; - Also, historical data can be exported from Metatrader or Ninjatrader :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.mql5.com/en/articles/27&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.mql5.com/en/articles/27&lt;/a&gt; (OHLC bars only)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.ninjatrader.com/support/helpGuides/nt7/index.html?exporting.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.ninjatrader.com/support/helpGuides/nt7/index.html?exporting.htm&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Option #3&lt;/strong&gt; - if you need real time tick data, again, export them from Ninjatrader as far as some brokers now allow to open account in NT &lt;strong&gt;for free&lt;/strong&gt;, e.g. FXCM&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.fxcm.com/products/ninjatrader/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.fxcm.com/products/ninjatrader/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="6855" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-05-28T20:33:40.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18031" PostTypeId="1" CreationDate="2015-05-28T20:45:35.923" Score="1" ViewCount="927" Body="&lt;p&gt;Lets say that I have a benchmark, $BM$ that consists of 3 assets- 30% asset $A$, 30% asset $B$ and 40% asset $C$.  Now, lets further assume I am trying to construct a portfolio that uses $BM$ as its benchmark.  In order to calculate my residual risk, active risk, etc, I need to calculate $\beta_n$ for each holding $n$ in the portfolio.  I am wondering what the most consistent way to do this is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One thought is to create a return stream for $BM$ and use it to calculate $\beta_n$ for each holding as I would for a single index benchmark.  But questions arise as to the weighting I should use- do I assume the benchmark is continuously rebalanced (i.e.- scale each daily return of $A$, $B$, and $C$ by 0.3, 0.3, and 0.4 respectively?  Or do I solve for the original weights I would have had at some time in the past to get to my 30/30/40 today?  Or something else entirely?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another thought, is to use the covariance matrix, and some &quot;tricky&quot; weighting.  e.g.:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know that the variance of a portfolio $P$ can be calculated from its covariance matrix ($V$) and weight row vector ($x$) like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma^2_{P} = x V x^T$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We also know that given 2 portfolios ($P_x$ and $P_y$) with the same holdings but different weight vectors ($x$ and $y$), we can calculate the covariance between them as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$cov(P_x,P_y) = x V y^T$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, could I solve for the covariance matrix for holdings $A$, $B$, $C$, and $n$, ($V^*$) and create two weight vectors:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$x = [0.3, 0.3, 0.4, 0.0]$ and $y = [0.0, 0.0, 0.0, 1.0]$ and solve:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\beta_n = \frac{xV^*y^T}{xV*x^T}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe this may be the same as the &quot;continuously re-balanced benchmark&quot; above, but could be a bit more straight forward programming-wise.  Thoughts?  Am I just making this more complicated than it needs to be?&lt;/p&gt;&#xA;" OwnerUserId="7534" LastActivityDate="2015-05-28T20:45:35.923" Title="How to calculate beta against a multi-asset benchmark" Tags="&lt;covariance&gt;&lt;beta&gt;&lt;calculation&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18033" PostTypeId="2" ParentId="18028" CreationDate="2015-05-28T22:43:56.310" Score="-4" Body="&lt;p&gt;you need to know multivariable calculus and partial differential equations &lt;/p&gt;&#xA;" OwnerUserId="15081" LastActivityDate="2015-05-28T22:43:56.310" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18034" PostTypeId="2" ParentId="18028" CreationDate="2015-05-28T23:40:09.380" Score="5" Body="&lt;p&gt;If you know basic probability and basic programming you can write a MATLAB program less than 10 lines long to simulate (in discrete time) geometric brownian motion and thus gain a &lt;em&gt;basic&lt;/em&gt; understanding of how GBM works.  To understand what happens as the time step goes to zero, and to prove properties of the resulting continuous limit see the other answer above..&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2015-05-28T23:45:11.007" LastActivityDate="2015-05-28T23:45:11.007" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18035" PostTypeId="2" ParentId="18027" CreationDate="2015-05-29T00:05:30.667" Score="2" Body="&lt;p&gt;There is an implicit assumption in your model. Namely that the price of the cow is perfectly correlated with the stock: they always move in the same direction. In this case you can indeed hedge your risk using cows. I let you be the judge of the validity of that assumption. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;More likely the moves of cow prices are independent which means that you should consider 2 binomial models or a quadrinomial model and you cannot hedge your derivative using cows only.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in practice you can often hedge your option using something else than the underlying e.g. a forward contract on the stock because it is linear in the stock price just like the cow price was in your model.&lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2015-05-29T00:05:30.667" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18036" PostTypeId="1" CreationDate="2015-05-29T02:56:29.547" Score="2" ViewCount="3355" Body="&lt;p&gt;Is anybody aware of Java/C++/Python API's available for ASX stock market depth? I'm currently using IB which is ok but has a number of limitations / issues - the one I care most about is the limit of 3 simultaneous market depth subscriptions. Really I need at least 10 and preferably 20 or more - with IB I can get up to 10 by paying but it adds up and I'd prefer something a bit more reliable if I'm paying that much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found Spark Iguana 2 but when I sent them an email requesting pricing they never replied.. not exactly the best first impression but if they're good I'd be interested. &lt;a href=&quot;https://iguana2.com/spark-sdk&quot; rel=&quot;nofollow&quot;&gt;https://iguana2.com/spark-sdk&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would appreciate any insight into anything else that might be available (either ASX specific or global but with proper ASX support).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="7390" LastActivityDate="2016-03-24T14:42:27.940" Title="ASX level 2 data via API" Tags="&lt;programming&gt;&lt;market-data&gt;&lt;market-making&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18038" PostTypeId="2" ParentId="17406" CreationDate="2015-05-29T04:12:57.680" Score="6" Body="&lt;p&gt;Independently if it makes economically sense or not, negative interest rates have become a reality for Europe which can no longer be neglected. (Even LIBOR became negative in the last months.)&#xA;One common but wrong solution was to set the rate simply to zero. (One must - by the way take care - that this &quot;solution&quot; is not automatically applied by correction algorithms in systems.)&#xA;Concerning modeling issues, the main impact is on products that require implicit lognormal distributions. Here, two solutions are possible:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Use a model that implies just normal distributions. The disadvantage is, however, that the &quot;real&quot; distribution is probably not symmetric since it's very improbable that interest rates ever become e.g. -5%. Hence, this approach makes sense only for short horizons.&lt;/li&gt;&#xA;&lt;li&gt;Another possible solution is by using shifted lognormal models. Here, the distribution is &quot;shifted&quot; by a certain parameter. This solution is normally used by financial institutes today. However, the main disadvantage is that a new variable - the shift parameter - is introduced.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;A description of the models can be found here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.d-fine.com/fileadmin/d-fine/hochgeladen/Fachartikel/WhitePaper_Vols_NegIR_V1_1_en.pdf&quot;&gt;http://www.d-fine.com/fileadmin/d-fine/hochgeladen/Fachartikel/WhitePaper_Vols_NegIR_V1_1_en.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For exotics, some models probably have still to be developed...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, negative interest rates do also affect volas which were traditionally quoted as lognormal (Black76) but today more as normal or shifted lognormal. Additional problems can also occur with time series (which often don't provide negative interest rates) or stress tests (which are often no longer real &quot;stress&quot; tests since reality became more extreme).&lt;/p&gt;&#xA;" OwnerUserId="16378" LastActivityDate="2015-05-29T04:12:57.680" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18039" PostTypeId="2" ParentId="18036" CreationDate="2015-05-29T04:22:26.943" Score="3" Body="&lt;p&gt;Some worth contacting to determine whether they have the features you seek:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Paritech pxAPI: &lt;a href=&quot;http://www.paritech.com.au/products/pxapi.html&quot; rel=&quot;nofollow&quot;&gt;http://www.paritech.com.au/products/pxapi.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IRESS: &#xA;&lt;a href=&quot;http://www.iress.com.au/_/media/Files/Brochures/IRESS_API_Solutions.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.iress.com.au/_/media/Files/Brochures/IRESS_API_Solutions.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;eSignal QLink&#xA;&lt;a href=&quot;http://www.esignal.com/development-tools/esignal_sdk_tools/qlink.aspx&quot; rel=&quot;nofollow&quot;&gt;http://www.esignal.com/development-tools/esignal_sdk_tools/qlink.aspx&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Two other real-time platforms are Bourse Data and Phoenix AI but I don't know if they have any API capabilities.&lt;/p&gt;&#xA;" OwnerUserId="13859" LastActivityDate="2015-05-29T04:22:26.943" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18041" PostTypeId="2" ParentId="18028" CreationDate="2015-05-29T06:24:22.673" Score="5" Body="&lt;p&gt;In order to really understand Geometric Brownian motion (GBM) you should study the basics of so called &quot;stochastic analysis&quot;. You could start with the book &lt;a href=&quot;http://imcs.dvfu.ru/lib.int/NEW/Math/MV_Probability/MVspa_Stochastic%20processes/Oksendal%20B.%20Stochastic%20differential%20equations%20%285ed,%20Springer,%202000%29%28332s%29.pdf&quot; rel=&quot;nofollow&quot;&gt;Stochastic Differenctial Equations&lt;/a&gt; by Bernt Oksendal. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to simulate it, either basic understanding of the above suffices, or you have a look at the numerics of SDEs &lt;a href=&quot;https://books.google.es/books/about/Numerical_Solution_of_Stochastic_Differe.html?hl=es&amp;amp;id=BCvtssom1CMC&quot; rel=&quot;nofollow&quot;&gt;Numerical Solution of Stochastic Differential Equations&lt;/a&gt; by Eckhard Platen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Stochastic calculus is different from ordinary calculus. PDEs will help but you don't need them for GBM. &lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-06-01T07:15:38.653" LastActivityDate="2015-06-01T07:15:38.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18042" PostTypeId="2" ParentId="18011" CreationDate="2015-05-29T07:20:07.957" Score="0" Body="&lt;p&gt;First of all, IV does not always decrease with maturity. Even with focus on the ATM IV volatility, the term structure can be very different in different circumstances: it can go up, down or be rather bumpy. Nevertheless, in the BS formula the option price is a function of $\sigma(\tau)\sqrt \tau$, so even if $\sigma(\tau)\downarrow$ it may still happen that $\sigma(\tau)\sqrt \tau \uparrow $, otherwise clearly you'll get a negative calendar spread which would be quickly arbitraged by other market participants.&lt;/p&gt;&#xA;" OwnerUserId="13480" LastActivityDate="2015-05-29T07:20:07.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18043" PostTypeId="2" ParentId="18018" CreationDate="2015-05-29T08:36:00.627" Score="14" Body="&lt;p&gt;Treasury futures are actually really complicated... There are complete books dedicated to this topic (e.g., &lt;em&gt;The Treasury Bond Basis&lt;/em&gt;) and really good sell-side research papers (&quot;Understanding Treasury Bond Futures&quot; by Salomon Brothers) that I highly recommend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You're actually very much on the right track, but I'll try to paint a somewhat complete picture.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's start by assuming that the delivery basket has one one bond, then ignoring margining (the usual forward-future difference), then the future's fair price is simply the bond's forward price (for settlement on the delivery date).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's now assume that the delivery basket is composed of multiple bonds. This introduces the so-called &quot;quality option.&quot; As you mentioned, it's the short that determines which bond to deliver. Effectively, the long has sold an option to the short.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Let's first assume that today IS the delivery date. Then the short will simply look at all the bonds in the delivery basket, calculate their invoice prices ($f \cdot CF_i + AI_i$, where $f$ is the futures price, $CF$ is the conversion factor, and $AI$ is the accrued interest), and choose the bond with the lowest invoice price. To preclude arbitrage opportunities, the price of the future must be $\min_i P_i / CF_i $, where $P_i$ is each bond's clean price. The bond with the lowest invoice price is delivered and is called the cheapest-to-deliver (CTD).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If today is a date before the delivery date and if the CTD is known deterministically (as is frequently the case in recent years), then the fair futures price is simply $ \min_i F_i / CF_i$, where $F_i$ is the forward price of each bond.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It gets interesting when the CTD is NOT known at the time of pricing; i.e., there's the probability of a &quot;CTD switch.&quot; Suddenly, the quality option becomes valuable! Because it's an option that the short has bought from the long, the quality option reduces the futures price from the min forward price:&#xA;$$ f = \min_i\left( \frac{F_i}{CF_i} \right) - \text{delivery option value}. $$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The question is of course how to come up with the delivery option value (DOV). In practice, it's actually easier to calculate the futures price and back out the DOV, rather than the other way around.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Conceptually, let's assume that you have an interest rate model at hand. Using this model, you can create a large number of scenarios of bond yields as of the delivery date. For each scenario, you can look at who the CTD is and set the futures price to be the converted forward price of that bond, in that scenario. The futures fair price is then the probability-weighted average of all the converted forward prices across all the different scenarios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a very simple example, let's say there are two bonds up for delivery and yields can either go up or down with equal probabilities. When rates go up, bond A is the CTD and the fair futures price in that case should be $F^A_\text{up} / CF_A$. When rates go down, bond B is the CTD and the fair price is $F^B_\text{dn} / CF_B$. Then the futures price must be the average of these two numbers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What gets more interesting is that&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The delivery period is not one day but a full month (for US Treasury futures). This creates the so-called timing option. Practically speaking, the timing option is worthless – if carry is positive, you deliver as late as possible. But you can easily incorporate this option into your model (it's like pricing an American option that allows continuous exercises).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Futures stop trading about a week before the last delivery date. During this week, futures price is fixed, but the cash market is still trading and the CTD can switch yet again! This creates the end-of-month option and can be valuable sometimes. This requires some very fancy modeling that's better discussed elsewhere...&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2015-05-29T13:30:56.327" LastActivityDate="2015-05-29T13:30:56.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18044" PostTypeId="2" ParentId="18028" CreationDate="2015-05-29T10:00:00.963" Score="3" Body="&lt;p&gt;In my experience, in order to understand in depth what GBM is you need to know some single/multi variable calculus, knowledge of ordinary differential equations, some probability (even in several variables), lebesgue integration and some basics of functional analysis.&#xA;These concepts are fundamental if you want to understand what an Itö process is (since GBM is a particular case of it) and how to use Itö's lemma.&lt;/p&gt;&#xA;" OwnerUserId="16045" LastActivityDate="2015-05-29T10:00:00.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18045" PostTypeId="2" ParentId="17995" CreationDate="2015-05-29T11:12:21.660" Score="1" Body="&lt;p&gt;What are you saying is not completely correct. What kelly criterion maximizes is the average growth of the capital invested. In fact, if I want to invest a fraction $f$ of my 1000 units the amount that I will have after $M$ trades will be&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$1000\Pi_{i=1}^{M} (1+f\phi_i)$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What we need to maximize is expected long-term growth rate.&#xA;Growth rate is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{1}{M} \log (1000\Pi_{i=1}^{M} (1+f\phi_i)) = \frac{1}{M} \sum_{i=1}^{M} \log (1+f\phi_i)+ \frac{1}{M}\log(1000)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming that the outcome of each trade is independent, then the expected value of this is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb{E}[\log(1+f\phi_1)]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Expanding the argument of the log in Taylor series we get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb{E}[f\phi_i - \frac{1}{2}f^2\phi^2_i+...]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From this we find that expected long term growth rate is approximately&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$f\mu-\frac{1}{2} f^2 \sigma^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is maximized by choice&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$f^*=\frac{\mu}{\sigma^2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Giving an expected growth rate of $\frac{\mu^2}{2\sigma^2}$ per trade.&#xA;If $\mu&amp;gt;0$ then $f&amp;gt;0$ and we can make a profit, in the long term.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if given your strategy, your 10% is less than the optimal fraction $f$, your bankroll is not growing as it could, since you are playing too conservatively. Vice versa, if your 10% is higher than the optimal fraction $f$ you are playing in a risky way and increasing your odds of ruin. &lt;/p&gt;&#xA;" OwnerUserId="16045" LastEditorUserId="16045" LastEditDate="2015-05-29T17:19:17.507" LastActivityDate="2015-05-29T17:19:17.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18049" PostTypeId="1" CreationDate="2015-05-29T13:37:14.433" Score="2" ViewCount="212" Body="&lt;p&gt;Let $t$ mean current time,&#xA;let $T_0, T_n$ mean two times such that $T_0\le T_n$, and&#xA;let $y_t[T_0, T_n]$ mean the forward swap rate of a swap starting at $T_0$ and ending at $T_n$. (I am ignoring $T_0+2$ issues, and assume that the swap starts at $T_0$.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then under the annuity numeraire $N_t = P_t[T_0, T_n]$, the forward swap rate $y_t[T_0, T_n]$ is a martingale under the risk-neutral measure associated with $N_t$. This follows from the fact that $y_t$ is a ratio of a portfolio of assets by $P_t[T_0, T_n]$. Indeed,&#xA;$$&#xA;y_t[T_0, T_n] = (Z(t,T_0)-Z(t,T_n))/P_t[T_0,T_n],&#xA;$$&#xA;where $Z(t, T_i)$ means the zero-coupon bond from $t$ to $T_i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a corresponding numeraire for the yield of a bond?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am guessing the answer is &lt;em&gt;no&lt;/em&gt; under some mild assumptions because bonds are tradeable and their price has a non-zero second derivative with respect to yields, but cannot hack through the thicket of results at the moment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance, any help appreciated!&lt;/p&gt;&#xA;" OwnerUserId="16384" LastActivityDate="2015-05-29T13:37:14.433" Title="Bond yield: is it martingale with respect to risk-neutral probability measure of some numeraire?" Tags="&lt;martingale&gt;&lt;itos-lemma&gt;&lt;bond-yields&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18050" PostTypeId="1" CreationDate="2015-05-29T14:37:05.553" Score="5" ViewCount="164" Body="&lt;p&gt;I have two geometric Brownian motions (GBMs) driven by the same underlying Brownin motion, namely&#xA;\begin{align*}&#xA;S_t^1 = S_0^1\exp\left(\left(\mu_1 - \frac{\sigma_1^2}{2}\right)t + \sigma_1 W_t\right), \\&#xA;S_t^2 = S_0^2\exp\left(\left(\mu_2 - \frac{\sigma_2^2}{2}\right)t + \sigma_2 W_t\right).&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The theoretical correlation between these two processes at time $t$ is&#xA;$$&#xA;Corr(S_t^1, S_t^2) = \frac{\exp(\sigma_1 \sigma_2 t) - 1}{\sqrt{(\exp(\sigma_1^2t) - 1)(\exp(\sigma_2^2t) - 1)}}.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, letting $\sigma_1 = 0.15$ and $\sigma_2 = 0.1$, a plot of $Corr(S_t^1, S_t^2)$ for $0 &amp;lt; t \leq 10$ looks like&#xA;&lt;img src=&quot;https://i.stack.imgur.com/Eqxqc.png&quot; alt=&quot;GBM Correlation Plot&quot;&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A simulation of the processes $S_t^1$ and $S_t^2$ over $0 \leq t \leq 10$ using the same $\sigma_1$ and $\sigma_2$ and letting $\mu_1 = 0.02$, $\mu_2 = 0.1$, $S_0^1 = 30$ and $S_0^2 = 40$ looks like&#xA;&lt;img src=&quot;https://i.stack.imgur.com/FlAJv.png&quot; alt=&quot;GBM Simulation Plot&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I use the MATLAB function &lt;code&gt;corr(S_1, S_2)&lt;/code&gt; I get that the correlation from this particular time series is &lt;code&gt;corr(S_1, S_2)&lt;/code&gt; = 0.6428.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So there are these interpretations of correlation: the correlation of two &lt;em&gt;random variables&lt;/em&gt; at a given time, given by $Corr(S_t^1, S_t^2)$, and the correlation of two &lt;em&gt;time series&lt;/em&gt;, computed by &lt;code&gt;corr(S_1, S_2)&lt;/code&gt;.  I'm trying to reconcile the difference between the two, and I'd appreciate a solid explanation!&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2015-07-01T19:01:43.003" Title="Interpretation of Correlation" Tags="&lt;time-series&gt;&lt;correlation&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18051" PostTypeId="1" CreationDate="2015-05-29T15:00:43.163" Score="4" ViewCount="142" Body="&lt;p&gt;For a beginner option trader in equity options, how can he use this metric that is provided by his broker/data vendor?&#xA;How can he use this metric to gain an added understanding of the option pricing/mispricing?&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2015-05-29T15:00:43.163" Title="How can a beginner trader make use of 'volatility of volatility'" Tags="&lt;option-pricing&gt;&lt;volatility&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18052" PostTypeId="2" ParentId="18050" CreationDate="2015-05-29T15:00:59.460" Score="1" Body="&lt;p&gt;The second one is not a correlation at all. For correlation you need to have several realizations of the very same thing, that is several observations of the very same random variable, hence all of the realization must be drawn from the same distribution. The series $S_i$ is not an observation of the very same random variable, since it contains asset values for different times, hence of course different distribution. To compute empirical correlation, just sample both time series several times up to moment $t$ and only take the last obtained value to compute the correlation.&lt;/p&gt;&#xA;" OwnerUserId="13480" LastActivityDate="2015-05-29T15:00:59.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18053" PostTypeId="1" CreationDate="2015-05-29T15:51:13.880" Score="2" ViewCount="252" Body="&lt;p&gt;In his book 'Dynamic Hedging', Nassim Taleb gives the relation:&lt;br&gt;&#xA;P = 1.67*historical volatility, where P is the Parkinson number.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the basis of this relationship. Does this hold under special situations, or always?&lt;br&gt;&#xA;He goes on to say that if&#xA; P is higher than 1.67*HV, then the trader needs to hedge a long gamma position more frequently.&lt;br&gt;&#xA;Otherwise,he can lag the adjustment, letting the gammas run.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is this?&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2021-02-28T21:07:05.690" Title="Relation between Parkinson number and historical volatility" Tags="&lt;volatility&gt;&lt;historical&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18054" PostTypeId="1" AcceptedAnswerId="18063" CreationDate="2015-05-29T15:55:53.793" Score="6" ViewCount="9617" Body="&lt;p&gt;I noticed that for some securities, puts were more expensive than calls (with same expiration).  For example, suppose the underlying security is trading at 50.  A put with a strike of 45 is more expensive than a call with a strike of 55.  A put with a strike of 40 is more expensive than a call with a strike of 60.  And so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means that the market thinks the security has a greater chance of falling than of rising.  But if this were the case, shouldn't the underlying security simply fall immediately?  Shouldn't this sentiment just be priced into the underlying security until a put-call equilibrium is reached?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've read about put-call parity, but that seems to be addressing puts and calls with equal strike prices.  Here, I'm talking about puts and calls with different strike prices that are equidistant from the current trading price.&lt;/p&gt;&#xA;" OwnerUserId="16389" LastActivityDate="2017-09-05T13:16:48.007" Title="How can put options be more expensive than call options in an efficient market?" Tags="&lt;option-pricing&gt;" AnswerCount="6" CommentCount="2" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18055" PostTypeId="2" ParentId="18054" CreationDate="2015-05-29T16:02:23.970" Score="4" Body="&lt;p&gt;if put call parity seems to be violated there could be things you are ignoring like dividends or hard to borrow fees. Hard to borrow will make puts more expensive &lt;/p&gt;&#xA;" OwnerUserId="15081" LastActivityDate="2015-05-29T16:02:23.970" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18056" PostTypeId="1" AcceptedAnswerId="18057" CreationDate="2015-05-29T16:19:41.737" Score="3" ViewCount="15767" Body="&lt;p&gt;Can someone explain to a non-math person (myself) what is the difference between these three? If they are so different that a comparison does not even make sense, please point it out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1.Ito process&#xA;2.Brownian motion&#xA;3.Random walk&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The wikipedia articles are too in depth (yes!) for me at  this point.&lt;/p&gt;&#xA;" OwnerUserId="218" LastEditorUserId="218" LastEditDate="2015-05-29T16:52:59.610" LastActivityDate="2018-12-27T22:58:22.290" Title="Difference between ito process, brownian motion and random walk" Tags="&lt;brownian-motion&gt;&lt;itos-lemma&gt;&lt;random-walk&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18057" PostTypeId="2" ParentId="18056" CreationDate="2015-05-29T17:14:52.160" Score="4" Body="&lt;p&gt;Assuming no math at all: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using an &lt;em&gt;Ito process&lt;/em&gt; we can describe the return of a stock with two components: an average level (the &quot;drift&quot;) plus some uncertainty (the &quot;volatility&quot;). This uncertainty is represented by a &lt;em&gt;Brownian Motion&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As written in Wikipedia,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A random walk is a mathematical formalization of a path that consists&#xA;  of a succession of random steps.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can get the random steps by tossing a coin &lt;em&gt;n&lt;/em&gt; times. If head, go up one step; if tail, go down one step.  This is the &quot;&lt;em&gt;symmetric&lt;/em&gt; random walk&quot;. You can obtain a Brownian Motion from the symmetric random walk using a bit of mathematical machinery. &lt;/p&gt;&#xA;" OwnerUserId="12214" LastActivityDate="2015-05-29T17:14:52.160" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18058" PostTypeId="1" CreationDate="2015-05-29T18:48:30.920" Score="2" ViewCount="94" Body="&lt;p&gt;I've asked two related questions.  First &lt;a href=&quot;https://money.stackexchange.com/q/16990/1516&quot;&gt;this one on the money stack exchange&lt;/a&gt; and &lt;a href=&quot;https://math.stackexchange.com/q/203446/5886&quot;&gt;this one on the math stack exchange&lt;/a&gt;.  But have not yet found a complete answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given an index such as the S&amp;amp;P 500, how to I compute or locate its volatility?  If I'm trying to control the risk to meet a particular level of tolerance by controlling the amount of exposure (e.g. 0.25 of assets or 1.10 of assets are invested and rebalanced periodically), would I use price or return volatility?  How does a return being logarithmic or linear impact this and any adjustment to the standard deviation?&lt;/p&gt;&#xA;" OwnerUserId="3007" LastEditorUserId="-1" LastEditDate="2017-04-13T12:25:30.743" LastActivityDate="2015-05-31T15:01:28.487" Title="How to compute/find the volatility of an index like the S&amp;P 500 to be used to control risk exposure?" Tags="&lt;volatility&gt;&lt;index&gt;" AnswerCount="0" CommentCount="6" FavoriteCount="1" ClosedDate="2015-05-29T19:21:31.463" ContentLicense="CC BY-SA 3.0" />
  <row Id="18059" PostTypeId="1" AcceptedAnswerId="18064" CreationDate="2015-05-29T19:24:15.637" Score="6" ViewCount="5812" Body="&lt;p&gt;In the book 'Dynamic Hedging', Nassim Taleb writes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    All operators in options learn that a rise in &#xA;volatility would cause the delta of an out of the money&#xA; call to rise and that of an in the money call to drop,&#xA;thereby bringing deltas closer to 50%.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why is this? Why would the OTM delta rise? It can only rise if the underlying rallies. But if underlying rallies, the ITM delta will also rise, approaching 1. Why would it drop?&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2021-03-31T16:55:30.000" Title="Effect of volatility on the delta of a call option" Tags="&lt;option-pricing&gt;&lt;volatility&gt;&lt;delta-hedging&gt;&lt;delta&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18060" PostTypeId="2" ParentId="18054" CreationDate="2015-05-29T19:59:05.897" Score="7" Body="&lt;p&gt;The typical investor is long. To protect the portfolio, he buys puts, thus driving up the price. To generate income against his long position, he sells covered calls, thus driving down the price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the most basic explanation for the difference in put call prices that are equidistant from the money. Obviously other factors are there as pointed out by Thomas Baert.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Last but not the least, it could be a temporary imbalance that will correct itself.&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2015-05-29T19:59:05.897" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18061" PostTypeId="2" ParentId="17840" CreationDate="2015-05-29T20:19:23.470" Score="3" Body="&lt;p&gt;The risk of a short strangle is theoretically infinite, and the max return is fixed (the premium received on the 2 legs). This remains true whether you target max return or max vega.&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2015-05-29T20:19:23.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18062" PostTypeId="2" ParentId="18010" CreationDate="2015-05-29T20:49:26.183" Score="2" Body="&lt;p&gt;This is pretty much exactly the problem description for a standard over-the-counter FX option pricing tool from 10-20 years ago.  (For more modern contexts, the data would almost surely contain also 10 delta RR and BF, and perhaps more points as well.)  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best solution is, don't build this yourself, but instead use a prexisting tool. FX conventions are somewhat tricky and poorly documented; it takes some effort to build a tool to do this right. Unfortunately I don't know of any free tools, but there are many vendors who have solutions, so maybe you have access to something already.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you really want to hack something together yourself, I suggest this paper by Reiswich and Wystup : &lt;a href=&quot;http://www.thfinance.de/Playground/fxblog/website/wp-content/uploads/2009/09/CPQF_Arbeits20.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.thfinance.de/Playground/fxblog/website/wp-content/uploads/2009/09/CPQF_Arbeits20.pdf&lt;/a&gt;.  They detail the most common variants of FX quoting conventions and compare several simple techniques for building complete option smiles from ATM/RR/BF data.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastEditorUserId="11936" LastEditDate="2015-05-29T21:25:58.410" LastActivityDate="2015-05-29T21:25:58.410" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18063" PostTypeId="2" ParentId="18054" CreationDate="2015-05-29T21:01:44.580" Score="8" Body="&lt;p&gt;Its a stylized fact in academia that put options are overpriced.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g., the monthly average return on S&amp;amp;P500 put options is around -40% for ATM options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most often quoted reason for this phenomenon are hedging costs: A put is more difficult to hedge from a market maker's perspective, hence the prices artificially go up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An important paper on this issue with a good introduction can be found here: &lt;a href=&quot;http://www.investps.com/images/Why_Are_Put_Options_So_Expensive.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.investps.com/images/Why_Are_Put_Options_So_Expensive.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2015-05-29T21:01:44.580" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18064" PostTypeId="2" ParentId="18059" CreationDate="2015-05-29T21:12:00.337" Score="11" Body="&lt;p&gt;Options have an asymmetric payoff profile: The payoffs are zero for almost all cases and positive else (as we well know).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the option is OTM, most of its payoffs are zero. A rise in volatility will hence increase the likelihood for instead positive payoffs from a change in the underlying price (i.e. delta increases).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the option is already ITM, most(many) of its payoffs are already positive. Hence an increase in volatility will increase the likelihood for zero payoffs instead from a shift in the underlying price (i.e. delta decreases).&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2015-05-29T21:12:00.337" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18065" PostTypeId="2" ParentId="18027" CreationDate="2015-05-29T21:37:42.533" Score="1" Body="&lt;p&gt;The fact that you can solve the second set of equations means that you can hedge the option through another asset aswell, in a simple binomial world this may indeed be true. Note that your strategy must replicate $f(S)$ through $C$ in all states at all time steps. E.g. it is possible that you don't get a solution for $\phi$ if $C^u-C^d=0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the hedging weights would differ based on the assets you used to replicate the option payoff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your question is related to incomplete markets, where an asset may be replicated through a range of trading strategies such that no unique price exists. In complete markets, $\mathbb{Q}$ is unique and $f(S)$ can be replicated through only one strategy.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2015-05-29T21:45:28.313" LastActivityDate="2015-05-29T21:45:28.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18066" PostTypeId="2" ParentId="18056" CreationDate="2015-05-29T22:03:04.010" Score="1" Body="&lt;p&gt;A Brownian Motion is a continuous time series of random variables whose increments are i.i.d. normally distributed with 0 mean.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An Ito Process is a Brownian Motion with possibly nonzero mean.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A random walk is a discrete process whose increments are +/-1 with equal probability.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2015-05-29T22:03:04.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18067" PostTypeId="2" ParentId="18056" CreationDate="2015-05-29T22:12:52.827" Score="7" Body="&lt;p&gt;First, for Ito processes and Brownian motion. Ito process is a continuous-time trajectory with random evolution, so non-smooth and very kinky - also has a fractal look: no matter how much you'd zoom in, it will look similar. Ito process consists in fact of two parts: the drift part (deterministic evolution) and the diffusion part (where all the kinkiness and fractalness comes from). If Ito process does not posses the latter, it just looks like a continuous smooth trajectory. For example, $y = x^2$ is such an (purely drift) Ito process. In contrast, if Ito process has only diffusion component, you won't be able to spot it. That is, when the diffusion component is present, it's hard to say whether there is a drift component or not, because of the noise diffusion provides. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Brownian motion is a special case of an Ito process, and is the main building block for the diffusion component. In fact, any diffusion is just a time scaled Brownian motion. One important property of Brownian motion is that its increments are uncorrelated (in fact, they are independent) whereas in general Ito process there can be loads of cross-correlation happening.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, formally random walk is a discrete-time process - hence not comparable with Ito processes which are continuous-time things. On the other hand, random walk must also have independent increments - that's why Brownian motion sometimes referred to as a (continuous-time) random walk.&lt;/p&gt;&#xA;" OwnerUserId="464" LastActivityDate="2015-05-29T22:12:52.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18068" PostTypeId="2" ParentId="17840" CreationDate="2015-05-30T00:34:04.120" Score="3" Body="&lt;p&gt;Generally, when you are short volatility, the 'size' of your position is measured using Vega.  You have volatility risk, and that risk is Vega. In fact I am not even sure what it means 'to earn a fixed premium'...&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-05-30T00:34:04.120" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18069" PostTypeId="2" ParentId="18015" CreationDate="2015-05-30T10:47:10.473" Score="8" Body="&lt;p&gt;By definition the fair value of an option is given by an expectation value of the payoff, $\mathbf{E}\left[\textrm{payoff}(\textit{paths})\right]$. The probability distribution of the &lt;code&gt;paths&lt;/code&gt; is the risk neutral measure. This is just an integral expression of the form you wrote. This applies to &lt;em&gt;all&lt;/em&gt; option prices. Many options are, of course, special in the sense that they only depend on the terminal value of each path. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quasi Monte Carlo can therefore always be applied in these situations, and the sampling of paths is essentially the same thing as computing an integral (i.e. the expectation value of the option payoff). Glasserman's comment most likely refers to the fact that if you simply use QMC to generate paths, then it is possible that you are not receiving the full benefit of the low discrepancy of the random numbers generated by QMC. Put differently: the samples have a low discrepancy, but the generated paths might not. So the variance reduction might not be that big. This is all relative, in the sense that other variance reduction methods might produce better results (i.e. lower variance in the price estimate).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, your actual problem doesn't have anything to do with QMC. It's Python which is holding you back. Schemes such as Euler-Maryuama, Runge Kutta and Milstein are all schemes which cannot be vectorized. Therefore I suspect that you might have some code snippets of the form:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import numpy as np&#xA;... some definitions ...&#xA;for i in range(1, N_timesteps):&#xA;    for j in range(N_paths):&#xA;        S[i, j] = S[i - 1, j] * np.exp((r-0.5*sigma**2)*dt&#xA;                 + sigma*np.sqrt(dt) * np.random.randn())&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is that this is usually very slow in Python. Things you can do to speed this up:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Sample all your random numbers outside the loop.&lt;/li&gt;&#xA;&lt;li&gt;Pre-compute as many factors outside the loops as possible.&lt;/li&gt;&#xA;&lt;li&gt;Vectorize inner loops, if possible.&lt;/li&gt;&#xA;&lt;li&gt;Avoid functions calls inside the loop as much as possible.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So in general, we want to do as little as possible inside the for loops, since these calls are very expensive in Python.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, we could write the above as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import numpy as np&#xA;... some definitions ...&#xA;Z = sigma*np.sqrt(dt) *np.random.randn(N_timesteps -1, N_paths)&#xA;drift = (r-0.5*sigma**2)*dt&#xA;for i in range(1, N_timesteps):&#xA;        S[i] = S[i - 1] * np.exp(drift + Z[i-1])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So the inner loop has been &quot;vectorized&quot; away, the sampling is all done before the loops, etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that is still not enough (which is very likely if you have many for loops), then you will need to perform some more &quot;advanced&quot; optimization. This usually comes down to taking the slowest piece of your code (almost always the for loop), put that in a function and write this function in e.g. Cython or Numba.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, with Numba we might define the for loop in a decorated function as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;from numba import autojit&#xA;&#xA;@autojit&#xA;def my_loop(S, Z, drift):&#xA;    for i in range(1, S.shape[0]):&#xA;        for j in range(S.shape[1]):&#xA;            S[i, j] = S[i - 1, j] * np.exp(drift + Z[i-1, j])&#xA;&#xA;... some definitions ...&#xA;Z = sigma*np.sqrt(dt) *np.random.randn(N_timesteps -1, N_paths)&#xA;drift = (r-0.5*sigma**2)*dt&#xA;my_loop(S, Z, drift)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first time my_loop is called Numba will compile the function (takes half a second). This results in a function that runs much, much faster. It's a great way to optimize certain routines in your code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But to really help you we'll need to see some code!&lt;/p&gt;&#xA;" OwnerUserId="3371" LastEditorUserId="13480" LastEditDate="2015-06-03T09:05:17.927" LastActivityDate="2015-06-03T09:05:17.927" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18070" PostTypeId="1" CreationDate="2015-05-30T22:48:47.590" Score="8" ViewCount="4316" Body="&lt;p&gt;I'm new to stochastic calculus and I did an exercise but I don't know if it is correct, so I need somebody with more experience to check if it is true.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to compute the variance of the following random variable:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Z=\int _0^T e^{W_t} dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\text{Var}(Z)=\text{Var}\left(\int _0^T e^{W_t} dW_t\right)$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By Itō's isometry we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}\left[\int _0^T e^{2W_t} dt\right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;we can then bring inside the expectation to get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\int _0^T \mathbb{E}\left[e^{2W_t}\right] dt = \int_0^T e^{2t} dt = \frac{e^{2T}}{2}-\frac{1}{2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, if the above result is correct, what should I get instead of the problem asked me to compute &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Var}\left(\int _0^T e^{W_t} dt \right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It should simply be the variance of a lognormal distributed random variable, computed in the extrema of the interval, or not?&lt;/p&gt;&#xA;" OwnerUserId="16045" LastEditorUserId="467" LastEditDate="2016-12-29T10:01:28.453" LastActivityDate="2016-12-29T19:09:38.593" Title="How to compute the variance of this stochastic integral?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;lognormal&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18075" PostTypeId="1" AcceptedAnswerId="31133" CreationDate="2015-05-31T14:09:26.103" Score="6" ViewCount="972" Body="&lt;p&gt;Consider the following SDE&#xA;$dV_t = rV_tdt +\sigma V_t dW_t + dJ_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $J_t$ is a Compound poisson process with log-Normal jump size $Y_i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How am I supposed to calibrate this model to CDS spreads?&#xA;The problem of course is there doesn't exist an analytical formula for the survival probability function...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[EDIT]&#xA;Well, what I'd need is in fact the distribution of the first hitting time, that is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\tau = \inf\{t&amp;gt;0 : V_t = x\}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where x is some barrier $\in R$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Pr\left\{V_0 e^{(r-(1/2) \sigma^2)t + \sigma W_t + \sum_{i=0}^{N(t)} Y_i} = x \right\} =\\Pr \left\{(r-(1/2)\sigma^2)t + \sigma W_t + \sum_{i=0}^{N(t)}Y_i =\ln(x/V_0) \right\} = \\  Pr\left\{\sigma W_t + \sum_{i=0}^{N(t)}Y_i =\ln(x/V_0) - (r-(1/2)\sigma^2)t \right\}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is here...I don't know which distribution comes out in the left hand side&lt;/p&gt;&#xA;" OwnerUserId="11943" LastEditorUserId="11943" LastEditDate="2015-05-31T14:39:51.530" LastActivityDate="2016-11-22T22:59:58.630" Title="Calibration Merton Jump-Diffusion" Tags="&lt;calibration&gt;&lt;cds&gt;&lt;credit-risk&gt;" AnswerCount="2" CommentCount="8" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18076" PostTypeId="1" AcceptedAnswerId="18077" CreationDate="2015-05-31T14:42:15.193" Score="1" ViewCount="223" Body="&lt;p&gt;I want to ask if the bootstrap method for asset allocation is preferable. For instance, suppose that we have data for the past returns for two stocks. Is it wise to generate the efficient frontierby estimating the correlations, the returns and the variances via the bootstrap method?&lt;/p&gt;&#xA;" OwnerUserId="16401" LastActivityDate="2015-05-31T15:03:50.487" Title="bootstrap asset allocation" Tags="&lt;correlation&gt;&lt;asset-allocation&gt;&lt;asset&gt;&lt;bootstrap&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18077" PostTypeId="2" ParentId="18076" CreationDate="2015-05-31T15:03:50.487" Score="1" Body="&lt;p&gt;I am not sure you have the same definition of bootstrap than myself: bootstrap is mainly a way to estimate the variance of estimators when you do not have a closed form formula to obtain it directly (thanks to Efron's theorem).&#xA;It means if you want the variance of your estimator of returns or covariance, you could use bootstrapping.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bad news: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;if you believe your data are iid and Gaussian, you have a closed form formula,&lt;/li&gt;&#xA;&lt;li&gt;if you don't, and especially if you believe in &lt;strong&gt;autocorrelations&lt;/strong&gt; in retruns, bootstrap is the very difficult.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The best reference for bootstrapping non iid series is &lt;a href=&quot;http://www.math.uconn.edu/~gine/publications/bootstrap.pdf&quot; rel=&quot;nofollow&quot;&gt;Giné, E. (1997). Lectures on some aspects of the bootstrap. In E. Giné, G. R. Grimmett, L. S. Coste, and P. Bernard (Eds.), Ecole d'été de Probabilités de Saint-Flour, XXVI, Volume 1665 of Lecture Notes in Math, pp. 37-152. Springer Verlag&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2015-05-31T15:03:50.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18078" PostTypeId="2" ParentId="17063" CreationDate="2015-05-31T16:08:16.097" Score="5" Body="&lt;p&gt;Any ARCH type model always requires an additional model for the mean of the time series. If nothing is said about the mean model, then usually is simply a time average plus residual. So, if $y_t$ is your stationary time series, the mean model would be&#xA;$$ y_t = \bar{y} + \epsilon_t $$&#xA;where $\bar{y}$ is the average value of $y_t$. And then $\epsilon_t$ would be assumed to follow another time series model, such as GARCH(p,q):&#xA;$$\epsilon_t = \sigma_t z_t$$&#xA;$$ \sigma_t^2 = \alpha_0 + \sum_{i=1}^{q} \alpha_i \epsilon_{t-i} + \sum_{j=1}^{p} \beta_i \sigma_{t-i}^2$$&#xA;You can, however, use any mean model for the original time series $y_t$ (such as ARIMA) and then specify the model for the residuals via GARCH; subject to some parameter restrictions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A common question in this regard is how to estimate the model. In principle, a joint estimation via Maximum Likelihood of both the mean and volatility model simultaneously is preferable. Depending on the model, this may lead to a large number of free parameters which cannot be estimated precisely. In such cases, it is sometimes preferable to first estimate the mean model and then estimate the volatility model from the residuals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use joint estimation via maximum likelihood, you can get correct standard errors in the normal way via the Fisher-Information matrix. Any statistical software should produce these by default.&lt;/p&gt;&#xA;" OwnerUserId="7396" LastActivityDate="2015-05-31T16:08:16.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18079" PostTypeId="2" ParentId="7876" CreationDate="2015-05-31T18:42:48.033" Score="1" Body="&lt;p&gt;It depends. &lt;a href=&quot;http://people.stern.nyu.edu/adamodar/New_Home_Page/TenQs/TenQsBottomupBetas.htm&quot; rel=&quot;nofollow&quot;&gt;If, and only if, you assume that debt carries a market risk of exactly 0&lt;/a&gt;, you may use &lt;a href=&quot;http://en.wikipedia.org/wiki/Hamada%27s_equation&quot; rel=&quot;nofollow&quot;&gt;Hamada's equation&lt;/a&gt; to easily go from levered to unlevered beta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\theta = D/E$&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$\beta^L = \beta^U \times(1+(1-\tau)\times\theta)$&lt;/li&gt;&#xA;&lt;li&gt;$\beta^U = \beta^L \div(1+(1-\tau)\times\theta)$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Where $\tau$ is the tax rate, and $D$ and $E$ are the firm's &lt;strong&gt;&lt;em&gt;market&lt;/em&gt;&lt;/strong&gt; value of debt and equity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, a lot of people use that just because it is hard to estimate debt betas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you dislike that simplifying assumption, and if you have a way to estimate a debt beta, then the correct equation is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$\beta^L = \beta^U \times(1+(1-\tau)\times\theta) \space – \space \beta_d\times(1-\tau)\times\theta$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="9495" LastEditorUserId="9495" LastEditDate="2015-10-14T15:20:09.107" LastActivityDate="2015-10-14T15:20:09.107" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18080" PostTypeId="1" AcceptedAnswerId="18093" CreationDate="2015-05-31T19:00:55.310" Score="0" ViewCount="101" Body="&lt;p&gt;which are the best distributions in order to model the bonds and exchange rate returns distributions. I am searching for a distribution such as the log-normal one of the stocks ( N(m-0.5*v),Sqrt[v])&lt;/p&gt;&#xA;" OwnerUserId="16401" LastActivityDate="2015-06-01T13:31:51.047" Title="returns of Bonds and exchange rates" Tags="&lt;fixed-income&gt;&lt;returns&gt;&lt;exchange&gt;&lt;rates&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18081" PostTypeId="1" AcceptedAnswerId="18329" CreationDate="2015-05-31T20:33:02.757" Score="0" ViewCount="95" Body="&lt;p&gt;I came across an interesting pair of VIX ETPs, &lt;a href=&quot;http://www.accushares.com/products&quot; rel=&quot;nofollow&quot;&gt;VXUP and VXDN&lt;/a&gt;. This new product referred to as &lt;a href=&quot;http://www.sec.gov/rules/sro/nasdaq/2015/34-74299.pdf&quot; rel=&quot;nofollow&quot;&gt;&quot;paired class shares&quot;&lt;/a&gt; ETFs are quite different from traditional ETPs. Some interesting highlights from the &lt;a href=&quot;http://www.accushares.com/resources/vix-fund-prospectus&quot; rel=&quot;nofollow&quot;&gt;prospectus&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;The Fund will hold only cash, short-dated U.S. Treasuries or&#xA;  collateralized U.S. Treasury repurchases. The Fund will not invest in&#xA;  equity securities, futures, swaps, or other assets that may track its&#xA;  Underlying Index.&quot;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&quot;Unlike other exchange traded products, the fund will engage&#xA;  principally in cash distributions and potentially paired share&#xA;  distributions to deliver to the shareholders the economic exposure to&#xA;  the fund’s underlying Index, the CBOE Volatility Index.&quot;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&quot;The Fund Will Only Effect Creations and Redemptions in Creation Units&#xA;  Composed of Equal Quantities of Up Shares and Down Shares.&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It seems to me it solves some of the problems with other vix ETF/ETNs (credit risk and futures roll contango). However it also seems many more problems are caused, the potential for frequent distributions to eliminate premium/discount can be a tax burden for instance. These distributions will also ensure the up and down shares maintain a certain ratio of aum such that a large movement or redemption in one share class will topple the entire fund.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is what are the underlying mechanics that make this work?&lt;/p&gt;&#xA;" OwnerUserId="1764" LastActivityDate="2015-06-12T18:18:53.327" Title="Underlying mechanics of paired class shares ETFs" Tags="&lt;vix&gt;&lt;etf&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18082" PostTypeId="1" AcceptedAnswerId="18095" CreationDate="2015-05-31T21:13:15.987" Score="3" ViewCount="846" Body="&lt;p&gt;QuantLib has great facilities for Monte-Carlo pricing engines, classes McSimulation and MonteCarloModel do a lot of work. But they do it in a single thread. What is best way to introduce parallel run in my custom engine (inherited from McSimulation class, as it is done for some instruments in QuantLib)?&#xA;Now I see 2 options&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Use QuantLib routines as they are present, and handle multiple deals in parallel.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Customize MonteCarloModel&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2.1 Make a subclass of MonteCarloModel and overwrite addSamples: insert there OpenMP code&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2.2 My engine is already a subclass of McSimulation (I overwrite timeGrid, pathGenerator, pathPricer), I will also overwrite &quot;calculate&quot; - I will copy its current code, but replace instantiation of MonteCarloModel with my implementation.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I don't like neither first, nor second options. The first doesn't allow me to price a single deal quickly, the second makes me in trouble in case of amendments in classes MonteCarloModel and McSimulation in QuantLib distributive.&lt;/p&gt;&#xA;" OwnerUserId="7486" LastActivityDate="2015-06-01T11:48:14.157" Title="Best way to do multithread Monte-Carlo in QuantLib" Tags="&lt;monte-carlo&gt;&lt;quantlib&gt;&lt;exotics&gt;&lt;opensource&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18083" PostTypeId="1" CreationDate="2015-05-31T21:35:27.130" Score="3" ViewCount="81" Body="&lt;p&gt;What are your list of concept or model in standard textbooks that are always reliable to used in working?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As opposed back to this: &lt;a href=&quot;https://quant.stackexchange.com/questions/156/what-concepts-are-the-most-dangerous-ones-in-quantitative-finance-work&quot;&gt;What concepts are the most dangerous ones in quantitative finance work?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2744" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-05-31T22:40:18.357" Title="What are your list of concept or model in standard textbooks that are always reliable to used in working?" Tags="&lt;finance&gt;&lt;books&gt;&lt;big-list&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" CommunityOwnedDate="2015-06-01T06:54:19.463" ContentLicense="CC BY-SA 3.0" />
  <row Id="18084" PostTypeId="2" ParentId="18080" CreationDate="2015-05-31T22:11:48.627" Score="0" Body="&lt;p&gt;To a first approximation bond and FX returns are also assumed log-normal, but of course with different mu and sigma. &lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-05-31T22:11:48.627" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18085" PostTypeId="1" AcceptedAnswerId="18088" CreationDate="2015-05-31T22:28:50.307" Score="5" ViewCount="4161" Body="&lt;p&gt;I need to calculate the year-to-date relative return of a given dataset. I usually caculate the cumulative relative return with this simple function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def RelPerf(price):&#xA;    RelPerf = (price/price[0])&#xA;    return RelPerf  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem ist that I need to set instead of &quot;price[0]&quot; the price by the start of each year (first available datapoint of the year). Since the dataset does not contain data for each day of the year I can't simply use sth like +365. So the question is how do I get dynamically the location of the first available datapoint into the formula?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a short example of the dataframe used:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;              CLOSE_SPX    Close_iBoxx  A_Returns  B_Returns  A_Vola    B_Vola&#xA;2014-05-15    1870.85      234.3017    -0.009362   0.003412   0.170535  0.075468   &#xA;2014-05-16    1877.86      234.0216     0.003747  -0.001195   0.170153  0.075378&#xA;2014-05-19    1885.08      233.7717     0.003845  -0.001068   0.170059  0.075384   &#xA;2014-05-20    1872.83      234.2596    -0.006498   0.002087   0.170135  0.075410   &#xA;2014-05-21    1888.03      233.9101     0.008116  -0.001492   0.169560  0.075326   &#xA;2014-05-22    1892.49      233.5429     0.002362  -0.001570   0.169370  0.075341   &#xA;2014-05-23    1900.53      233.8605     0.004248   0.001360   0.168716  0.075333   &#xA;2014-05-27    1911.91      234.0368     0.005988   0.000754   0.168797  0.075294   &#xA;2014-05-28    1909.78      235.4454    -0.001114   0.006019   0.168805  0.075474   &#xA;2014-05-29    1920.03      235.1813     0.005367  -0.001122   0.168866  0.075451   &#xA;2014-05-30    1923.57      235.2161     0.001844   0.000148   0.168844  0.075430   &#xA;2014-06-02    1924.97      233.8868     0.000728  -0.005651   0.168528  0.075641   &#xA;2014-06-03    1924.24      232.9049    -0.000379  -0.004198   0.167852  0.075267&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="16404" LastActivityDate="2018-07-31T06:31:26.273" Title="calculate YTD return / find first available datapoint of a year in python" Tags="&lt;python&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18086" PostTypeId="2" ParentId="18081" CreationDate="2015-05-31T22:31:00.000" Score="0" Body="&lt;p&gt;VXUP and VXDN are very new. They have only been in existence for 8 days.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Date    VXUP    VXDN    VIX&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5/29/2015   28.47   21.59   13.84&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5/28/2015   28.39   21.69   13.31&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5/27/2015   28.10   21.65   13.27&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5/26/2015   28.91   21.1    14.06&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5/22/2015   28.00   21.89   12.13&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5/21/2015   28.29   21.86   12.11&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5/20/2015   28.51   21.59   12.88&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5/19/2015   27.64   22.35   12.85&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far they appear to be doing a poor job of tracking the VIX. For example on May 26 VIX increased by 16% but VXUP only increased by 3.25%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in addition to being bafflingly complex (as shown by the prospectus) the structure does not seem to work properly, at least so far.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-05-31T22:31:00.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18088" PostTypeId="2" ParentId="18085" CreationDate="2015-06-01T00:04:56.737" Score="4" Body="&lt;p&gt;You need to use a groupby, timegrouper, and its annual option, and take the first value in each group.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if I grab yahoo data:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import pandas as pd&#xA;import pandas.io.data as web&#xA;&#xA;# Grab S&amp;amp;P 500 data going back to beginning of 2011&#xA;SPY_Dat = web.DataReader('SPY', 'yahoo', datetime.date(2011,1,1), end)&#xA;&#xA;# Convert to annual data:&#xA;SPY_Ann_Dat = SPY_Dat.groupby(pd.TimeGrouper('A')).nth(0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this case we are using the Annual time grouper ('A').  We could also use monthly (M), quarterly (Q), or weekly (W).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interestingly, nth can also use negative indexing, so if we wanted to get the last day of each year, we could change the last line to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;SPY_Last_Ann_Dat = SPY_Dat.groupby(pd.TimeGrouper('A')).nth(-1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, now if we wanted to, as in your example, calculate the YTD return, we can tweak things a bit, to not just grab the first date, but apply a transformation using the data from the first date in each group:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import pandas as pd&#xA;import pandas.io.data as web&#xA;&#xA;# Grab S&amp;amp;P 500 data going back to beginning of 2011&#xA;SPY_Dat = web.DataReader('SPY', 'yahoo', datetime.date(2011,1,1))&#xA;&#xA;# Group the data with the same TimeGrouper to get things grouped by year&#xA;SPY_GroupedDat = SPY_Dat.groupby(pd.TimeGrouper('A'))&#xA;&#xA;# Create a new column with YTD data of adjusted close, using a transformation lambda function applied to our group data.&#xA;SPY_Dat[&quot;YTD&quot;] = SPY_GroupedDat['Adj Close'].transform(lambda x: x/x.iloc[0]-1.0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will yield a column in SPY_Dat which is a running YTD return, reset on the first trading date of each year.&lt;/p&gt;&#xA;" OwnerUserId="7534" LastEditorUserId="7534" LastEditDate="2015-06-01T01:42:28.563" LastActivityDate="2015-06-01T01:42:28.563" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18089" PostTypeId="2" ParentId="8501" CreationDate="2015-06-01T02:14:41.263" Score="3" Body="&lt;p&gt;If you have a linear/gaussian state space model and you're using a Kalman Filter, you can use maximum likelihood estimation or the EM algorithm. I personally prefer the former since you don't need to know anything about smoothing. If you use the EM, you do. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your observations are $z_1, \ldots, z_n$, then you can write down an innovations likelihood &#xA;$$L(\theta) = \prod_{t=1}^n p(\epsilon_t; \theta) $$&#xA;where $\epsilon_t = z_t - E(z_t|z_1, \ldots z_{t-1})$. Each $p(\epsilon_t;\theta)$ is Gaussian, and you can get them from a kalman filter iteration. However, they're usually really nonlinear in $\theta$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Learning/fitting with particle filters is very difficult since you can't evaluate $L(\theta)$. Fortunately for you, it seems to be irrelevant. You don't need them in the linear gaussian case.&lt;/p&gt;&#xA;" OwnerUserId="1870" LastActivityDate="2015-06-01T02:14:41.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18090" PostTypeId="1" CreationDate="2015-06-01T04:39:41.363" Score="0" ViewCount="1231" Body="&lt;p&gt;I am working on some research that requires parsing of SEC 10 K/Q filings. We have built a parser that will parse the raw txt SEC filing that usually contains many blocks of unencoded files (html, xml, pdfs, images, spreadsheets, etc). A typical decoded 10 K/Q (as of CY 2014) has a set of files that looks like the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/97ZWC.png&quot; alt=&quot;10 K/Q Payload&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have any documentation or guidance that explains what the R1.htm - RX.htm files are supposed to contain and more broadly any documentation that describes what is typically found in a decoded 10 K/Q? The SEC doesn't have any documentation at this level of granularity. (Reasons being this that this submission exemplified above maybe from that of a particular filing prep vendor / software, however, this format seems to be the most pervasive as of CY2014).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance for any guidance.&lt;/p&gt;&#xA;" OwnerUserId="16409" LastActivityDate="2019-01-03T18:11:15.070" Title="SEC 10-Q/K Filings" Tags="&lt;sec&gt;&lt;edgar&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18091" PostTypeId="5" CreationDate="2015-06-01T05:38:29.777" Score="0" Body="&lt;p&gt;Optimal control is at the core of math finance.&#xA;From a formal viewpoint, &lt;strong&gt;Markovian dynamics&lt;/strong&gt;, &lt;strong&gt;&lt;a href=&quot;http://en.m.wikipedia.org/wiki/Dynamic_programming&quot; rel=&quot;nofollow&quot;&gt;Dynamic Programming Principle&lt;/a&gt;&lt;/strong&gt; (DPP), and the &lt;strong&gt;&lt;a href=&quot;http://en.m.wikipedia.org/wiki/Hamilton%E2%80%93Jacobi%E2%80%93Bellman_equation&quot; rel=&quot;nofollow&quot;&gt;Hamilton-Jacobi-Bellman&lt;/a&gt;&lt;/strong&gt; master equation are the main tools of stochastic control.&#xA;Take few applications:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Option Pricing&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have an exposure to a time dependent combination of market factors; you have some knowledge of their dynamics. They are partly deterministic, partly stochastic (i.e. random). At each &quot;&lt;em&gt;time step&lt;/em&gt;&quot; you can adjust your portfolio at a given cost. Your goal is to lower your risk. Of course it is a control program, see &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/3642100449&quot; rel=&quot;nofollow&quot;&gt;Continuous-time Stochastic Control and Optimization with Financial Applications&lt;/a&gt;, by Huyen Pham, for examples (and &lt;a href=&quot;http://www1.ucam.ac.ma/itn-marrakech/School/PHAM.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; for a summary by the same author).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://en.m.wikipedia.org/wiki/Black%E2%80%93Scholes_model&quot; rel=&quot;nofollow&quot;&gt;Black-Scholes PDE&lt;/a&gt; is a straightforward translation of the HJB to a portfolio containing a diffusive product.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Portfolio Construction&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have a given amount of money to invest, you will build a portfolio with it. You have some expectations in terms of the dynamics of returns of the available investment instruments (stocks, bonds, etc) and estimated for the associated risk. Changing your allocation has a cost at each time step. Again it is a control program, see for instance &lt;a href=&quot;http://www.lse.ac.uk/fmg/events/capitalMarket/pdf/CMW64N_Garleanu.pdf&quot; rel=&quot;nofollow&quot;&gt;Dynamic Portfolio Choice with Frictions&lt;/a&gt;, Garleanu and Pedersen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Intraday Trading&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have a large amount of stocks to buy or sell today. You have the whole day (around 8h) to do it, and you can take a decision every millisecond. The faster you go the more you move the market at your detriment, the slower you go the more your are exposed to a bad price change. It is nothing else than control again, see &lt;a href=&quot;http://www.worldscientific.com/worldscibooks/10.1142/8967&quot; rel=&quot;nofollow&quot;&gt;Market Microstructure in Practice&lt;/a&gt;, by L and Laruelle. &lt;a href=&quot;http://ebooks.cambridge.org/chapter.jsf?bid=CBO9781139151184&amp;amp;cid=CBO9781139151184A175&amp;amp;tabName=Chapter&quot; rel=&quot;nofollow&quot;&gt;Market Microstructure Knowledge Needed for Controlling an Intra-Day Trading Process&lt;/a&gt; for an overview (there is a preprint available &lt;a href=&quot;http://arxiv.org/abs/1302.4592&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2015-06-01T05:52:33.343" LastActivityDate="2015-06-01T05:52:33.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18092" PostTypeId="4" CreationDate="2015-06-01T05:38:29.777" Score="0" Body="Stochastic control is widely used in finance since it is about decision taking in a random environment. Option replication, portfolio construction, intraday trading are typical applications of stochastic control." OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2015-06-01T05:44:18.690" LastActivityDate="2015-06-01T05:44:18.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18093" PostTypeId="2" ParentId="18080" CreationDate="2015-06-01T08:07:20.897" Score="1" Body="&lt;p&gt;Do you want to model the returns in a risk-neutral framework (for derivatives) or in the real world measure (for risk analysis/portfolio construction)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the first approach (say modelling under $Q$) you should go to the literature on bond and FX-derivatives. I would go more into detail if this is your aim. The formulation $N(\mu-\sigma^2/2,\sigma)$ suggests this a bit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the second (say modelling under $P$) I have 2 things to say:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;don't confuse it with risk neutral pricing. Looking at log-returns the expected return and the variance can be estimated from the sample directly, say as $\mu$ and $\sigma$. You don't have to plug-in $\mu-\sigma^2/2$ for the expected value&lt;/li&gt;&#xA;&lt;li&gt;A very flexible family of distributions is the &lt;a href=&quot;http://en.wikipedia.org/wiki/Generalised_hyperbolic_distribution&quot; rel=&quot;nofollow&quot;&gt;Generalized Hyperbolic distrbution&lt;/a&gt;. There is also an R package for this &lt;a href=&quot;http://cran.r-project.org/web/packages/ghyp/vignettes/Generalized_Hyperbolic_Distribution.pdf&quot; rel=&quot;nofollow&quot;&gt;ghyp&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;EDIT after comment of OP:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you look at the log-return of a stock price. ie. $X_i = \log(S_i)-\log(S_{i-1})$ then you can assume that has unlimited support (no left or right end point). If you look at simple returns $S_i/S_{i-1}-1$ then you have a left endpoint of $-1$ (if $S_i=0$). Thus if you want to use something like a normal-distribution then you should use log-returns. If you have the expected value $\mu$ and the variance $\sigma^2$ then you can model the log-return $X$ by a normal distribtion $N(\mu,\sigma^2)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The $N(\mu-\sigma^2/2,\sigma^2)$ comes from the SDE approach (world of $Q$) where&#xA;$$&#xA;S_t = S_0 \exp( (\mu-\sigma^2/2) t + \sigma B_t )&#xA;$$&#xA;solves the SDE&#xA;$$&#xA;dS_t/S_t = \mu dt + \sigma dB_t&#xA;$$&#xA;as due to Ito's lemma you get a quadratic variation term $\sigma^2 t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT 2:&#xA;If you look at the log-returns and the mean is $\mu$ then it is $\mu$ and not $\mu - \sigma^2/2$. The latter is only used to identify $\mu$ as the drift of the SDE. If $\mu$ is the drift, then $\mu  - \sigma^2/2$ is the expected value of&#xA;$$&#xA;\log(S_{t+1}/S_t) = \mu-\sigma^2/2) t + \sigma B_t&#xA;$$&#xA;as you can derive from the equation above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if $\hat{\mu}$ is the mean log-return then your SDE should have drift $\hat{\mu} - \sigma^2/2$ in order to be consistent with this statistic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use SDEs for risk mgmt. But if you just look at returns - why do you need a continuous time framework? VIX tells you something about the options market. The implied vol is often different from realized vol. These are 2 different but connected things.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-06-01T13:31:51.047" LastActivityDate="2015-06-01T13:31:51.047" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="18094" PostTypeId="1" AcceptedAnswerId="18101" CreationDate="2015-06-01T08:17:46.210" Score="6" ViewCount="36149" Body="&lt;p&gt;I need to calculate the a time dynamic Maximum Drawdown in Python. The problem is that e.g.:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;( df.CLOSE_SPX.max() - df.CLOSE_SPX.min() ) / df.CLOSE_SPX.max()&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;can't work since these functions use all data and not e.g. considering the minimum only from a given maximum onwards on the timeline. Does anone know how to implement that in python?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a short example of the dataframe used:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;              CLOSE_SPX    Close_iBoxx  A_Returns  B_Returns  A_Vola    B_Vola&#xA;2014-05-15    1870.85      234.3017    -0.009362   0.003412   0.170535  0.075468   &#xA;2014-05-16    1877.86      234.0216     0.003747  -0.001195   0.170153  0.075378&#xA;2014-05-19    1885.08      233.7717     0.003845  -0.001068   0.170059  0.075384   &#xA;2014-05-20    1872.83      234.2596    -0.006498   0.002087   0.170135  0.075410   &#xA;2014-05-21    1888.03      233.9101     0.008116  -0.001492   0.169560  0.075326   &#xA;2014-05-22    1892.49      233.5429     0.002362  -0.001570   0.169370  0.075341   &#xA;2014-05-23    1900.53      233.8605     0.004248   0.001360   0.168716  0.075333   &#xA;2014-05-27    1911.91      234.0368     0.005988   0.000754   0.168797  0.075294   &#xA;2014-05-28    1909.78      235.4454    -0.001114   0.006019   0.168805  0.075474   &#xA;2014-05-29    1920.03      235.1813     0.005367  -0.001122   0.168866  0.075451   &#xA;2014-05-30    1923.57      235.2161     0.001844   0.000148   0.168844  0.075430   &#xA;2014-06-02    1924.97      233.8868     0.000728  -0.005651   0.168528  0.075641   &#xA;2014-06-03    1924.24      232.9049    -0.000379  -0.004198   0.167852  0.075267&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="16404" LastActivityDate="2020-12-14T16:10:02.460" Title="How can I calculate the Maximum Drawdown MDD in python" Tags="&lt;python&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="18095" PostTypeId="2" ParentId="18082" CreationDate="2015-06-01T11:48:14.157" Score="5" Body="&lt;p&gt;Sigh. I'm not sure that there's a best way to do multi-threaded MC in QuantLib.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm afraid that you're underestimating the amount of development you'd need for option 2. You're not going to get away with some OpenMP code as you suggest, because calculations on different paths are not trivially parallel:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the RNGs we have are not parallel, and even if you use a different instance for each thread, you still risk superposition in the set of random numbers they'll draw;&lt;/li&gt;&#xA;&lt;li&gt;the path generator keeps state, so you can't use the same one in different threads;&lt;/li&gt;&#xA;&lt;li&gt;the statistics class keeps state, so you have to either use a different instance per thread and aggregate the results afterwards, or add a lock to the existing one to serialize access.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And these are just the problems that just come to mind in the first two minutes without looking too hard.  All in all, I'd go for option 1 if you don't want to invest a lot of development time.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2015-06-01T11:48:14.157" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18096" PostTypeId="1" CreationDate="2015-06-01T12:14:32.037" Score="11" ViewCount="9059" Body="&lt;p&gt;How google finance calculates beta of a stock &#xA;-   What is the proxy for the market?&#xA;-   What is the time period it uses for regression?&lt;/p&gt;&#xA;" OwnerUserId="16413" LastActivityDate="2017-11-04T14:21:15.553" Title="How google finance calculates beta of a stock" Tags="&lt;equities&gt;&lt;beta&gt;&lt;google&gt;" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18097" PostTypeId="1" AcceptedAnswerId="18171" CreationDate="2015-06-01T12:43:24.753" Score="1" ViewCount="448" Body="&lt;p&gt;I am wondering about the Markowitz theory of portfolio construction in practice. Hence, if one wants to know the efficient frontier, what variances can one use. The only method that I can think is the MLE estimation from past data, but using past data is not effective in my opinion? What do you think?&lt;/p&gt;&#xA;" OwnerUserId="16401" LastEditorUserId="2587" LastEditDate="2015-06-02T06:37:59.733" LastActivityDate="2015-06-04T21:39:11.510" Title="Modern portfolio theory in practice" Tags="&lt;portfolio-management&gt;&lt;variance&gt;&lt;markowitz&gt;&lt;mean&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18099" PostTypeId="2" ParentId="18075" CreationDate="2015-06-01T13:46:37.067" Score="2" Body="&lt;p&gt;There is no analytic solution.  You have to solve numerically, either by monte carlo or PIDE.  &lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2015-06-01T13:46:37.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18100" PostTypeId="2" ParentId="18096" CreationDate="2015-06-01T15:39:26.457" Score="1" Body="&lt;p&gt;According to a comment &lt;a href=&quot;https://quant.stackexchange.com/questions/15797/how-does-yahoo-finance-calculate-beta&quot;&gt;on another post here&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;. It regresses against the SP500 using MONTH-END closing prices for the last five years.&quot; - @Dimitri &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2015-06-01T15:39:26.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18101" PostTypeId="2" ParentId="18094" CreationDate="2015-06-01T15:50:00.727" Score="21" Body="&lt;p&gt;You can get this using a pandas rolling_max to find the past maximum in a window to calculate the current day's drawdown, then use a rolling_min to determine the maximum drawdown that has been experienced.&lt;/p&gt;&#xA;&lt;p&gt;Lets say we wanted the moving 1-year (252 trading day) maximum drawdown experienced by a particular symbol.  The following should do the trick:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;import pandas as pd&#xA;import pandas_datareader as  web&#xA;import matplotlib.pyplot as pp&#xA;import datetime&#xA;&#xA;# Get SPY data for past several years&#xA;&#xA;SPY_Dat = web.DataReader('SPY', 'yahoo', datetime.date(2007,1,1))&#xA;&#xA;# We are going to use a trailing 252 trading day window&#xA;window = 252&#xA;&#xA;# Calculate the max drawdown in the past window days for each day in the series.&#xA;# Use min_periods=1 if you want to let the first 252 days data have an expanding window&#xA;Roll_Max = SPY_Dat['Adj Close'].rolling(window, min_periods=1).max()&#xA;Daily_Drawdown = SPY_Dat['Adj Close']/Roll_Max - 1.0&#xA;&#xA;# Next we calculate the minimum (negative) daily drawdown in that window.&#xA;# Again, use min_periods=1 if you want to allow the expanding window&#xA;Max_Daily_Drawdown = Daily_Drawdown.rolling(window, min_periods=1).min()&#xA;&#xA;# Plot the results&#xA;Daily_Drawdown.plot()&#xA;Max_Daily_Drawdown.plot()&#xA;pp.show()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Which yields (Blue is daily running 252-day drawdown, green is maximum experienced 252-day drawdown in the past year):&#xA;&lt;img src=&quot;https://i.stack.imgur.com/QGpUC.png&quot; alt=&quot;Max Drawdown Result&quot; /&gt;&lt;/p&gt;&#xA;&lt;p&gt;Note: with the newest&lt;/p&gt;&#xA;" OwnerUserId="7534" LastEditorUserId="36129" LastEditDate="2020-12-14T16:10:02.460" LastActivityDate="2020-12-14T16:10:02.460" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="18102" PostTypeId="2" ParentId="18050" CreationDate="2015-06-01T18:53:25.293" Score="0" Body="&lt;p&gt;The answer provided by Ulysses is basically correct. For a particular time $t$, the correlation at $t$ is the &quot;term correlation&quot;, which can be computed by realizations at time $t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The time series generated from the two processes can not be used to estimate the term correlation. However, they can be used to estimate the correlation between the driving Brownian motions, based on the log-returns. Note that the log-returns lead to increments of the driving Brownian motions, which are assumed to be independent, and the log-return of the historical values can be treated as independent realizations.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-06-01T18:53:25.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18103" PostTypeId="2" ParentId="17215" CreationDate="2015-06-01T18:58:21.363" Score="1" Body="&lt;p&gt;CME Group offers exchange-traded Asian-style options on WTI Crude Oil Futures, among other underlying products:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cmegroup.com/trading/energy/crude-oil/west-texas-intermediate-wti-crude-oil-calendar-swap-futures_contractSpecs_options.html&quot; rel=&quot;nofollow&quot;&gt;http://www.cmegroup.com/trading/energy/crude-oil/west-texas-intermediate-wti-crude-oil-calendar-swap-futures_contractSpecs_options.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7889" LastActivityDate="2015-06-01T18:58:21.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18104" PostTypeId="1" CreationDate="2015-06-01T19:00:14.783" Score="3" ViewCount="468" Body="&lt;p&gt;Hey guys I'm looking for worked examples who show how to apply Itô's lemma in several variables, starting from the very basics. Thank you in advance!&lt;/p&gt;&#xA;" OwnerUserId="16045" LastActivityDate="2015-06-02T01:24:59.707" Title="Multivariate Itô's lemma" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;itos-lemma&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18105" PostTypeId="1" CreationDate="2015-06-01T20:25:16.530" Score="0" ViewCount="1293" Body="&lt;p&gt;This question comes from a Financial Economics exam and I'm very confused about a state-price deflator which doesn't seem to exist. I've included the whole question for completeness, but my actual question is quite concise.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;An investment bank has issued a two-month European call option on a&#xA;  non-dividend-paying share (whose current price $S_0 = 100$) with a&#xA;  strike price $K = 98$. The risk-free rate of interest $r = 8\%$ per&#xA;  annum and the expected return on the share is $15\%$ per annum, both&#xA;  continously compounded. The share price process is assumed to follow&#xA;  Geometric Brownian motion with the annual standard deviation of the&#xA;  change in the log share price equal to $25\%$.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;tldr&lt;/strong&gt;: $S_0 = 100$, $K = 98$, $r = 8\%$, $\sigma = 0.25$ and $dS_t = S_t(0.15dt + 0.25dW_t)$&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(i) Construct a two period recombining binomial model where each&#xA;  period is one month, and hence derive the &lt;strong&gt;state price deflators&lt;/strong&gt; at&#xA;  time $t = 2$. The parameters determining the share price after an&#xA;  up-jump and down-jump should be those which calibrate the model to the&#xA;  above standard deviation.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(ii) Use the state price deflators from (i) above to derive the value of the option at time $t = 0$.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(iii) Confirm that the same option value is obtained by means of risk-neutral&#xA;  valuation&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now, I can price this option without using state price deflators. A summary of my workings so far is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the Cox-Ross-Rubinstein assumption,, the size of the up-jump:&#xA;$$u = e^{\sigma\sqrt{\delta t}} = e^{0.25/\sqrt{12}} = 1.07484 = 1/d$$&#xA;Risk-neutral probability of an up-jump: $q = \frac{e^{r\delta t} - d}{u - d} = 0.52826$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From here it is easy to work out the risk-neutral probabilities for each of the states:&#xA;$$\mathbb{Q}(\{uu\}) = 0.27907$$&#xA;$$\mathbb{Q}(\{ud\}) = \mathbb{Q}(\{du\}) = 0.24920$$&#xA;$$\mathbb{Q}(\{dd\}) = 0.22253$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From there, risk-neutral pricing is easy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, what are the &lt;strong&gt;state-price deflators&lt;/strong&gt; in this example?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From my notes: the state price deflator in the Binomial model is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$A_n = e^{-rn}(\frac{q}{p})^{N_n}(\frac{1-q}{1-p})^{n-N_n}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $N_n$ is the number of upsteps up to time $n$ and $p$ is the real-world probability of an up-step.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, because we are given that $S_t$ has GBM dynamics in the real-world probability measure:&#xA;$$p = \mathbb{P}[\text{up-step}] = \mathbb{P}[S_{t+1} = u \cdot S_t] = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question:&lt;/strong&gt; How do we define the state-price deflator when the assumed real-world distribution is continuous but we're working in the (necessarily discrete) Binomial model?&lt;/p&gt;&#xA;" OwnerUserId="16328" LastActivityDate="2019-01-23T18:10:04.350" Title="The State-Price Deflator in a Binomial pricing model" Tags="&lt;option-pricing&gt;&lt;risk-neutral-measure&gt;&lt;binomial&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18106" PostTypeId="1" AcceptedAnswerId="18107" CreationDate="2015-06-01T21:08:08.043" Score="1" ViewCount="424" Body="&lt;p&gt;I understand that in an arbitrage-free Binomial model, we assume that $S_{t+1} = S_t \cdot u$ in the event of an up-jump and $S_{t+1} = S_t \cdot d$ in the event of a down-jump. We call $u$ and $d$ the growth factors. A neccessary condition for no-arbitrage is that $d &amp;lt; e^{r \delta t} &amp;lt; u$, where $r$ is the risk-free lending rate and $\delta t$ is the time elapsed during each step. A common assumption, due to Cox, Ross and Rubinstein, is to let $u = 1/d = e^{\sigma \sqrt{\delta t}}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that this assumption is inconsistent with no-arbitrage in the case where $e^{r \delta t} \geq e^{\sigma \sqrt{\delta t}}$ or, equivalently, when $r \geq \sigma / \sqrt{\delta t}$. What is the typical recourse in this situation?&lt;/p&gt;&#xA;" OwnerUserId="16328" LastActivityDate="2015-06-01T21:52:55.377" Title="Binomial pricing model: When the Cox-Ross-Rubinstein assumption is not arbitrage-free" Tags="&lt;option-pricing&gt;&lt;binomial-tree&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18107" PostTypeId="2" ParentId="18106" CreationDate="2015-06-01T21:52:55.377" Score="3" Body="&lt;p&gt;if you let $\delta t$ be small enough, this won't happen. So the solution is to take more steps. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The CRR tree is very out dated in any case. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-06-01T21:52:55.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18108" PostTypeId="2" ParentId="18105" CreationDate="2015-06-01T21:58:24.863" Score="2" Body="&lt;p&gt;first you have to find the p, u and d that match standard deviations in part (I). The problem is a little underdefined in that even if you match mean and standard deviation precisely, there are multiple solutions. Impose an extra condition to get all three. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once this is done compute $q$ via &#xA;$$&#xA;q = \frac{e^{r \delta t} - d}{u-d}.&#xA;$$&#xA;The state-price deflator is then found from the ratio $q/p.$&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-06-01T21:58:24.863" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18109" PostTypeId="1" AcceptedAnswerId="18111" CreationDate="2015-06-02T00:18:13.320" Score="2" ViewCount="801" Body="&lt;p&gt;Is the Brownian motion multiplication rule a definition or is it a theorem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Refer to the highlight part of &lt;a href=&quot;https://i.stack.imgur.com/doQuT.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://i.stack.imgur.com/doQuT.png&lt;/a&gt; where $dw_1(t)dw_1(t)=dt$&lt;/p&gt;&#xA;" OwnerUserId="2744" LastEditorUserId="2744" LastEditDate="2015-06-02T00:32:10.203" LastActivityDate="2015-06-02T13:28:51.540" Title="Is the Brownian motion multiplication rule a definition or is it a theorem?" Tags="&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18110" PostTypeId="1" CreationDate="2015-06-02T00:26:50.157" Score="17" ViewCount="406" Body="&lt;p&gt;I received this question during an onsite interview for a quant job and I'm still scratching my head on how to solve this problem. Any help would be appreciated.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Mr Quant thinks that there is a linear relationship between past and future intraday returns. So he would like to test this idea. For convenience, he decided to parameterize return in his data set using a regular time grid dt where $d=0, …, D-1$ labels date and $t=0, …, T-1$ intraday time period. For example, if we split day into 10 minute intervals then $T = 1440 / 10$. His model written on this time grid has the following form:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$y_{d,t}$ $=$ $\beta_t$ * $x_{d,t}$ + $\epsilon_{d,t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $y_{d,t}$ is a return over the time interval $(t,t+1)$ and $x_{d,t}$ is a return over the previous time interval, $(t–1,t)$ at a given day $d$. In other words, he thinks that previous 10-minute return predicts future 10-minute return, but the coefficient between them might change intraday.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, to fit $\beta_t$ he can use $T$ ordinary least square regressions, one for each “$t$”, but:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(a) his data set is fairly small $D$=300, $T$=100;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(b) he thinks that signal is very small, at best it has correlation with the target of 5%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;He hopes that some machine learning method that can combine regressions from nearby intraday times can help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would you solve this problem?&#xA;Data provided is an $x$ matrix of predictors of size $300\times100$ and a $y$ matrix of targets of size $300\times100$.&lt;/p&gt;&#xA;" OwnerUserId="16417" LastEditorUserId="16417" LastEditDate="2015-06-02T21:17:25.700" LastActivityDate="2016-08-28T00:46:28.283" Title="Regression model when samples are small and not correlated" Tags="&lt;regression&gt;&lt;machine-learning&gt;&lt;intraday&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18111" PostTypeId="2" ParentId="18109" CreationDate="2015-06-02T00:39:13.117" Score="7" Body="&lt;p&gt;It's a lemma! Ito's Lemma gives the change of coordinates rule for stochastic calculus. The multiplication rule is a shorthand way of expressing it. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-06-02T00:39:13.117" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="18113" PostTypeId="1" CreationDate="2015-06-02T08:04:00.687" Score="3" ViewCount="121" Body="&lt;p&gt;I'm having troubles with this proof:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\{Z_i\}_{i\in\mathbb{Z}}$ be i.i.d. random variables with zero mean and unit standard deviation. For $(a_0, a_1, ..., a_r)$ a sequence of $r$ real numbers and $j\in\mathbb{Z}$, let&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align}&#xA;Y_j &amp;amp; = \sum_{i=0}^ r a_i Z_{j-i} &#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For $r=2$, state and prove a general and sufficient condition on $(a_0, a_1, a_2)$ such that $Y_j$ and $Y_{j-1}$ are independent regardless of the probability distribution of $Z$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can one prove independence in this case? I was thinking about applying convolution and then expliciting $(a_0, a_1, a_2)$ in a way that $f_{Y_{j}, Y_{j-1}} = f_{Y_j}f_{Y_{j-1}}$ holds... But it seems to be a little complicated and I don't really know how to tackle the problem in a simpler way. Any help would be greatly appreciated!&lt;/p&gt;&#xA;" OwnerUserId="16045" LastActivityDate="2015-06-03T14:26:15.960" Title="Sums of random variables and independence" Tags="&lt;probability&gt;&lt;proof&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18114" PostTypeId="1" CreationDate="2015-06-02T09:09:30.717" Score="3" ViewCount="699" Body="&lt;p&gt;I have a few questions regarding GARCH modelling and forecasting and it would be great if someone could help me. I am modelling the log return of oil spot prices using various GARCH models: GARCH, APARCH, EGARCH... and I am trying to forecast the prices. I found using ACF and PACF plots that the best model for the series is ARMA(0,1) and then the best model for the error term follows GARCH(1,1) or APARCH(1,1) etc&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are my questions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) garch1&amp;lt;-garchFit(~arma(0,1)+garch(1,1),data=brentlog,trace=FALSE,include.mean=TRUE) predict(garch1,n.ahead=25) I have a doubt whether I am forecasting the volatility of the prices or the actual values of return?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Since I am not looking at options, there is no point forecasting the volatility right? because it won't tell me whether prices will go up or down&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Since I have an ARMA(0,1) for my model, my forecasts will always be constant and if I don't include a mean in the model then the forecasts are the same using egarch, garch, aparch or any model: it is 0. So is there a point of using those different models in this case?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks a lot!&lt;/p&gt;&#xA;" OwnerUserId="16419" LastActivityDate="2015-06-02T09:09:30.717" Title="GARCH modelling and forecasting" Tags="&lt;r&gt;&lt;garch&gt;&lt;forecasting&gt;&lt;modelling&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18115" PostTypeId="1" AcceptedAnswerId="18120" CreationDate="2015-06-02T11:57:39.473" Score="8" ViewCount="3332" Body="&lt;p&gt;I have read that the E-Mini S&amp;amp;P 500 Futures trade 24/7, how is that possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I mean the underlying stocks which form the index are traded from 9:30am-4pm - so outside of these hours the S&amp;amp;P 500 index doesn't change (in my understanding).&#xA;So how can then the futures be traded - or maybe the better question: why does it makes sense to trade the futures outside the normal market hours when the underlying value doesn't change?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="16421" LastActivityDate="2020-04-01T13:54:12.077" Title="How can index futures trade 24/7 when the index doesn't change?" Tags="&lt;equities&gt;&lt;trading&gt;&lt;futures&gt;&lt;index&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18116" PostTypeId="2" ParentId="18109" CreationDate="2015-06-02T12:18:26.970" Score="5" Body="&lt;p&gt;Formally, this is a shorthand for the quadratic variation. &#xA;For a more rudimentary definition, $\langle W, W\rangle$ is a process such that $W^2-\langle W, W\rangle$ is a martingale. Moreover, $\langle W, W\rangle_t$ is a limit, in probability, of the variation&#xA;\begin{align*}&#xA;\sum_{i=1}^n|W_{t_{i}}-W_{t_{i-1}}|^2,&#xA;\end{align*}&#xA;over the partition&#xA;\begin{align*}&#xA;0=t_0 &amp;lt; t_1 &amp;lt; \cdots &amp;lt; t_n = t.&#xA;\end{align*}&#xA;From the property of a standard Brownian motion, it can be shown that the above limit equals $t$. That is, $\langle W, W\rangle_t = t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, if $X_t = \int_0^t \xi_s dW_s$ and $Y_t = \int_0^t \eta_s dW_s$, then&#xA;\begin{align*}&#xA;\langle X, Y \rangle_t &amp;amp;= \int_0^t \xi_s \eta_s ds,&#xA;\end{align*}&#xA;which we also write as&#xA;\begin{align*}&#xA;\langle dX_t, dY_t\rangle = \xi_t\eta_tdt.&#xA;\end{align*}&#xA;For $\xi_t=\eta_t = 1$, we then have&#xA;\begin{align*}&#xA;\langle dW_t, dW_t\rangle = dt,&#xA;\end{align*}&#xA;which is usually write as $dW_t dW_t = dt$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-06-02T13:28:51.540" LastActivityDate="2015-06-02T13:28:51.540" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18117" PostTypeId="2" ParentId="18115" CreationDate="2015-06-02T12:24:08.207" Score="-3" Body="&lt;p&gt;Because in the time interval expectations change (due to news etc.).&lt;/p&gt;&#xA;" OwnerUserId="16423" LastEditorUserId="848" LastEditDate="2015-06-02T13:01:36.290" LastActivityDate="2015-06-02T13:01:36.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18118" PostTypeId="2" ParentId="18113" CreationDate="2015-06-02T12:26:48.587" Score="0" Body="&lt;p&gt;My first idea would be to try writing up the characteristic functions and use the theorem stated in the bottom answer about independence here: &lt;a href=&quot;https://math.stackexchange.com/questions/376511/a-criterion-for-independence-based-on-characteristic-function&quot;&gt;https://math.stackexchange.com/questions/376511/a-criterion-for-independence-based-on-characteristic-function&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16067" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2015-06-02T12:26:48.587" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18119" PostTypeId="2" ParentId="18113" CreationDate="2015-06-02T13:05:32.787" Score="3" Body="&lt;p&gt;Write out the simple equations&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align}&#xA;Y_j &amp;amp;= a_0 Z_j + a_1 Z_{j-1} + a_2 Z_{j-2}\\&#xA;Y_{j-1} &amp;amp;= a_0 Z_{j-1} + a_1 Z_{j-2} + a_2 Z_{j-3}&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are some very simple cases that make $Y_j \perp Y_{j-1}$ due to the independence assumption of the random variables $\{Z_i\}_{i\in\mathbb{Z}}$. An example is $a_0 \in \mathbb{R}\setminus \{0\},\, a_1 = 0,\, a_2 = 0$. Not sure if you were looking for a complete solution but this should help get you started. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, an easy check for RV which are not independent is using the contrapositive form of the common theorem&#xA;$$X\perp Y \implies E[XY] = E[X]E[Y]$$&#xA;Note that the converse of this statement is not true. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Proof&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assertion $a_1a_0 + a_2a_1 = 0 \iff Y_j \perp Y_{j-1}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Define $\mu = E[Z]$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;($\implies$) Suppose $a_1a_0 + a_2a_1 = 0$. There are two cases where this is possible. Case 1, suppose $a_1 = 0$. The equations become &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align}&#xA;Y_j &amp;amp;= a_0 Z_j + a_2 Z_{j-2}\\&#xA;Y_{j-1} &amp;amp;= a_0 Z_{j-1} + a_2 Z_{j-3}&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Their $\sigma$-algebras are given by $\sigma(Y_j) = \sigma(Z_j)\cup\sigma(Z_{j-2})$ and $\sigma(Y_{j-1}) = \sigma(Z_{j-1})\cup \sigma(Z_{j-3})$. Thus $Y_j \perp Y_{j-1}$. This could be more gruesomely detailed but I take some for granted. See &lt;a href=&quot;http://math.iisc.ernet.in/~manju/ProbTheory/Notes/1-3%20Independence.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; for more details including definitions etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Case 2, suppose $a_2 = 0$ and $a_0 = 0$. The equations become&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align}&#xA;Y_j &amp;amp;= a_1 Z_{j-1} \\&#xA;Y_{j-1} &amp;amp;=  a_1 Z_{j-2}&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same $\sigma$-algebra argument applies more easily but a more elegant solution presents itself in the form of the CDF.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align}&#xA;F_{Y_j, Y_{j-1}}(y_j, y_{j-1}) &amp;amp;= P(Y_j \leq y_j \text{ and } Y_{j-1} \leq y_{j-1}) \\&#xA;&amp;amp; = F_{Z_j}(y_j/a_1)F_{Z_{j-1}}(y_{j-1}/a_1)\\&#xA;&amp;amp; = F_{Y_j}(y_j)F_{Y_{j-1}}(y_{j-1})&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;($\impliedby$) Suppose $Y_j \perp Y_{j-1}$ by theorem, we know that $E[Y_j Y_{j-1}] = E[Y_j]E[Y_{j-1}]$ calculating these values separately,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align}&#xA;E[Y_jY_{j-1}] &amp;amp; = (a_0^2  + a_0a_1 + a_0 a_2 + a_1^2  + a_1 a_2 +  a_2 a_0 + a_2^2 )\mu^2 \\&#xA;&amp;amp; + (a_1a_0 + a_2a_1)E[Z^2]&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align}&#xA;E[Y_j]E[Y_{j-1}] &amp;amp; = (a_0^2  + a_0a_1 + a_0 a_2 + a_1^2  + a_1 a_2 +  a_2 a_0 + a_2^2)\mu^2\\&#xA;&amp;amp;+ (a_1a_0 + a_2a_1)\mu^2&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the non-degenerate case when the distribution of $Z$ is not a constant, &lt;a href=&quot;https://math.stackexchange.com/a/786016/75988&quot;&gt;the variance is strictly positive&lt;/a&gt; so that $E[Z^2] - \mu^2 &amp;gt; 0$ and so $E[Z^2] &amp;gt; \mu^2$ and more importantly $E[Z^2] \neq \mu^2$ Thus for the equality $E[Y_j Y_{j-1}] = E[Y_j]E[Y_{j-1}]$ to hold, it must be the case that $a_1a_0 + a_2a_1 = 0$. &lt;/p&gt;&#xA;" OwnerUserId="4910" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2015-06-03T14:26:15.960" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="18120" PostTypeId="2" ParentId="18115" CreationDate="2015-06-02T13:46:42.060" Score="5" Body="&lt;p&gt;Theoretically &quot;information&quot; about stock prices is still arriving (including information about developments outside the United States) and the futures market is doing its best in estimating what the price of the index would be &lt;em&gt;if&lt;/em&gt; it was trading.  In practice, during the night, traders are following the foreign markets (Europe, Asia) and adjusting the price of the futures accordingly. No arbitrage is possible since the US stock market is closed, but that does not prevent an &lt;em&gt;estimate&lt;/em&gt; of US stock market value from being generated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way they don't really trade 24 hours, there is a  pause between 16:15 and 16:30 New York time (15:15 15:30 CT) and another pause between 17:00 and 18:00 (16: 17:00 CT). So 22.75 hours of trading and 1.25 hour to rest, reset the computers, and get ready to start again.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2020-04-01T13:54:12.077" LastActivityDate="2020-04-01T13:54:12.077" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="18122" PostTypeId="1" CreationDate="2015-06-02T16:09:40.207" Score="1" ViewCount="126" Body="&lt;p&gt;it is just the computation of a second moment but however is creating debate !!... Can someone spot the error?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/PeHaO.jpg&quot; alt=&quot;here is the problem&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="15900" LastEditorUserId="15900" LastEditDate="2015-06-02T17:21:40.983" LastActivityDate="2015-06-02T17:45:37.617" Title="Stochastic calculus: what am I doing wrong?" Tags="&lt;stochastic-calculus&gt;&lt;mathematics&gt;&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18123" PostTypeId="2" ParentId="18122" CreationDate="2015-06-02T17:38:34.890" Score="2" Body="&lt;p&gt;For a martingale $\{M_t \mid t\geq 0\}$ and the stochastic integral &#xA;\begin{align*}&#xA;I_t = \int_0^tZ_s dM_s,&#xA;\end{align*}&#xA;we have that&#xA;\begin{align*}&#xA;E((I_t)^2) = E\bigg( \int_0^tZ_s^2 d\langle M\rangle_s\bigg),&#xA;\end{align*}&#xA;where $\langle M\rangle$ is the quadratic variation. That is, the ito's isometry holds for a martingale integrator only. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in your question, $\{X_t \mid t\geq 0\}$ is not a martingale, then&#xA;\begin{align*}&#xA;E\big( Y_t^2)\big) \neq E\bigg(\int_0^t (1+s)^2 d\langle X\rangle_s \bigg).&#xA;\end{align*}&#xA;Instead, since&#xA;\begin{align*}&#xA;Y_t^2 &amp;amp;= \bigg(4\int_0^t(1+s)ds + 6\int_0^t(1+s)W_sdW_s \bigg)^2\\&#xA;&amp;amp;=16\bigg( \int_0^t(1+s)ds\bigg)^2 + 48 \int_0^t(1+s)ds\int_0^t(1+s)W_sdW_s + 36 \bigg( \int_0^t(1+s)W_sdW_s\bigg)^2,&#xA;\end{align*}&#xA;then&#xA;\begin{align*}&#xA;E\big( Y_t^2)\big) &amp;amp;= 16\bigg( \int_0^t(1+s)ds\bigg)^2 + 36 E\bigg[\bigg( \int_0^t(1+s)W_sdW_s\bigg)^2\bigg]\\&#xA;&amp;amp;=16\bigg( \int_0^t(1+s)ds\bigg)^2 + 36 E\bigg[\bigg( \int_0^t(1+s)^2W_s^2ds\bigg)\bigg]\\&#xA;&amp;amp;= 16\bigg( \int_0^t(1+s)ds\bigg)^2 + 36\int_0^t(1+s)^2 s\, ds.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-06-02T17:45:37.617" LastActivityDate="2015-06-02T17:45:37.617" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18126" PostTypeId="1" AcceptedAnswerId="18127" CreationDate="2015-06-03T01:30:54.357" Score="8" ViewCount="423" Body="&lt;p&gt;A couple questions regarding stochastic vol PDE derivation.  Following &lt;a href=&quot;http://www.math.ku.dk/~rolf/teaching/ctff03/Gatheral.1.pdf&quot;&gt;Gatheral&lt;/a&gt;, a general stochastic vol model is given by&#xA;\begin{align*}&#xA;dS(t) &amp;amp; = \mu(t) S(t) dt + \sqrt{v(t)}S(t) dW_1, \\&#xA;dv(t) &amp;amp; = \alpha(S,v,t) dt + \eta \beta(S,v,t)\sqrt{v(t)} dZ_2, \\&#xA;dZ_1dZ_2 = \rho dt&#xA;\end{align*}&#xA;To price an option on a stock whose price process follows $S$, we construct a portfolio consisting of the option whose price is $V(S,v,t)$, short $\Delta$ shares of the stock and short $\Delta_1$ units of some other asset whose value $V_1$ depends on volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;First Question: Is this &quot;other asset&quot; absolutely anything such that $V_1 = V_1(v)$?  E.g., another option on $S$, or some other option on another stock, or another stock, or...?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value $\Pi$ of this portfolio is&#xA;$$&#xA;\Pi = V - \Delta S - \Delta_1 V_1.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We then derive the SDE satisfied by $\Pi$, select $\Delta$ and $\Delta_1$ to make the portfolio riskless, argue that $d\Pi = r\Pi dt$ else arbitrage, and finally get&#xA;$$&#xA;\frac{\frac{\partial V}{\partial t} + \frac{1}{2}vS^2\frac{\partial^2 V}{\partial S^2} + \rho \eta v \beta S \frac{\partial^2 V}{\partial v \partial S} + \frac{1}{2}\eta^2v\beta^2\frac{\partial^2 V}{\partial v^2} + rS\frac{\partial V}{\partial S} - rV}{\frac{\partial V}{\partial v}} \\&#xA;= \frac{\frac{\partial V_1}{\partial t} + \frac{1}{2}vS^2\frac{\partial^2 V_1}{\partial S^2} + \rho \eta v \beta S \frac{\partial^2 V_1}{\partial v \partial S} + \frac{1}{2}\eta^2v\beta^2\frac{\partial^2 V_1}{\partial v^2} + rS\frac{\partial V_1}{\partial S} - rV_1}{\frac{\partial V_1}{\partial v}}&#xA;$$&#xA;Since the LHS only depends explicitly on $t,v,S,V$ and the RHS only on $t,v,S,V_1$, they must each be a function of only $t,v,S$, say $f(t,v,S)$.  In particular, the price $V$ of the option must satisfy&#xA;$$&#xA;\frac{\partial V}{\partial t} + \frac{1}{2}vS^2\frac{\partial^2 V}{\partial S^2} + \rho \eta v \beta S \frac{\partial^2 V}{\partial v \partial S} + \frac{1}{2}\eta^2v\beta^2\frac{\partial^2 V}{\partial v^2} + rS\frac{\partial V}{\partial S} - rV = \frac{\partial V}{\partial v}f(t,v,S).&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, &lt;strong&gt;for whatever reason&lt;/strong&gt;, we choose $f = -(\alpha - \varphi \beta)$, and as Gatheral states following eqn (3), &quot;...$\varphi(S,v,t)$ is called the market price of volatility risk because it tells us how much of the expected return of $V$ is explained by the risk (i.e. standard deviation) of $b$ in the CAPM framework.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Second question:  How does this market price of risk ($\varphi$) relate to the market price of risk I'm familiar with in the Black-Scholes model, $\frac{\mu - r}{\sigma}$?  More importantly, how did they (Heston?) settle on $f = -(\alpha - \varphi \beta)$?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2016-06-09T11:47:08.700" Title="Derivation of Stochastic Vol PDE" Tags="&lt;options&gt;&lt;option-pricing&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18127" PostTypeId="2" ParentId="18126" CreationDate="2015-06-03T07:20:15.720" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;This other asset can be anything that can be priced with the very same equation. So in case you considering pricing the original option that expires on a single underlying, then any other option on that underlying would work. In case you use an option on a different underlying, you would need to have a model for the joint evolution of the two underlyings, and even if you do, things may not cancel nicely, so there's no big help in that. Think of that from the practical perspective: you'd like to hedge your position (make it indifferent) to changes in stock. For that you'd need a security for which you know for sure how does it depend on the stock price. Stock itself is a good choice. Another stock maybe highly correlater with the original one, and you may want to use it for hedging both in pricing and in theory - however in both domain you'd have some risk left in case the correlation is not perfect.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;According to &quot;Willmot on QF&quot;, the motivation is as follows. If you only consider a $\Delta$-hedge portfolio $\Pi = V - \Delta S$ you'd get&#xA;$$&#xA;  \mathrm d\Pi = \eta\beta\frac{\partial V}{\partial \sigma}(\varphi \;\mathrm  dt + \mathrm dZ_2)&#xA;$$&#xA;so that with focus on the term in brackets, for every unit of risk you receive $\varphi$ as a reward.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="13480" LastActivityDate="2015-06-03T07:20:15.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18128" PostTypeId="2" ParentId="16229" CreationDate="2015-06-03T09:12:46.313" Score="0" Body="&lt;p&gt;Ito integrals differ in their complexity depending on which function you'd like to integrate. Let's talk about the simplest but still powerful version - the one mentioned by Innombrabre, for integrands from the $L^2$ space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, you can think of the procedure as follows. You have two complete metric spaces $(X,d_X)$ and $(Y,d_Y)$. Let $A$ be a subset of &quot;simple&quot; elements of $X$ for which we can easily define a function $f$. If $f$ is Lipschitz, then every Cauchy sequence $x_0,x_1,\dots$ on $X$ generates a Cauchy sequence $y_0,y_1,\dots$ on $Y$ where $y_i = f(x_i)$. As a result, if you define $f$ on $A$ then you can for free continuously extend it to $\bar A$. Moreover, it will still stay Lipschitz.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case $X$ is the path space, and $Y$ is the space of random variables, $A$ are simple (piece-wise constant) paths and $f$ is the Ito integral.&lt;/p&gt;&#xA;" OwnerUserId="13480" LastActivityDate="2015-06-03T09:12:46.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18129" PostTypeId="1" AcceptedAnswerId="18131" CreationDate="2015-06-03T09:13:07.380" Score="8" ViewCount="1294" Body="&lt;p&gt;In the derivation of the Black-Scholes formula given by Joshi (extract below), he says $C(t,S_t)/B_t$ is a martingale. Why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand this can be deduced &lt;strong&gt;from&lt;/strong&gt; the Black-Scholes PDE since the drift term is equal to zero. But how can he deduce $C(t,S_t)/B_t$ is a martingale &lt;strong&gt;before&lt;/strong&gt; we have derived the Black-Scholes PDE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/KKGBN.png&quot; alt=&quot;enter image description here&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/wKffW.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="15723" LastActivityDate="2015-07-07T19:49:12.373" Title="Why is $C(t,S_t)/B_t$ a martingale?" Tags="&lt;black-scholes&gt;&lt;black-scholes-pde&gt;" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18130" PostTypeId="2" ParentId="18129" CreationDate="2015-06-03T09:29:24.607" Score="0" Body="&lt;p&gt;Not sure whether author explains that, but when talking about replicating portfolios, the discounted portfolio must be a martingale for non-arbitrage conditions. That's a very important fact in the theory of risk-neutral pricing. More details are in &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/9810236050&quot; rel=&quot;nofollow&quot;&gt;Shiryaev's &quot;Essentials of Stochastic Finance&quot;&lt;/a&gt;, and maybe in some probability theory oriented books on the topic, e.g. &lt;a href=&quot;http://www.amazon.ca/Martingale-Methods-Financial-Modelling-Musiela/dp/3540209662&quot; rel=&quot;nofollow&quot;&gt;Musiela and Rutkowski&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13480" LastEditorUserId="11678" LastEditDate="2015-07-07T18:59:36.510" LastActivityDate="2015-07-07T18:59:36.510" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18131" PostTypeId="2" ParentId="18129" CreationDate="2015-06-03T11:14:44.903" Score="8" Body="&lt;p&gt;It is important to note that he says: &quot;&lt;strong&gt;In the risk-neutral world&lt;/strong&gt;, $\frac{C(t,S_t)}{B_t}$ is a martingale.&quot; That is true by definition of what the risk-neutral measure is, also called martingale measure for exactly that reason.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A risk-neutral measure is defined such that asset prices deflated by the numeraire (unit with which prices are measured) are martingales. In your example, the standard numeraire is used: a bank account which is continuously reinvested at the risk-free rate. There are plenty of sources that discusses the (almost) equivalence of the existence of a risk-neutral measure and the absence of arbitrage (or more precisely: No free lunch with vanishing risk). The most comprehensive book on these issues is by &lt;a href=&quot;http://www.springer.com/us/book/9783540219927&quot; rel=&quot;nofollow&quot;&gt;Delbaen and Schachermeyer&lt;/a&gt;, but it's mathematically very demanding. I personally like the book by &lt;a href=&quot;http://press.princeton.edu/titles/7223.html&quot; rel=&quot;nofollow&quot;&gt;Duffie&lt;/a&gt;, but opinions about the books vary. A good compromise between mathematical completeness and financial intuition is the book by &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/019957474X&quot; rel=&quot;nofollow&quot;&gt;Björk&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Joshi's Book &quot;&lt;a href=&quot;http://www.markjoshi.com/concepts/&quot; rel=&quot;nofollow&quot;&gt;The Concepts and Practice of Mathematical Finance&lt;/a&gt;&quot;, the whole chapter 6 is devoted to this topic.&lt;/p&gt;&#xA;" OwnerUserId="7396" LastEditorUserId="7396" LastEditDate="2015-07-07T19:49:12.373" LastActivityDate="2015-07-07T19:49:12.373" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18132" PostTypeId="2" ParentId="16423" CreationDate="2015-06-03T13:48:21.357" Score="2" Body="&lt;p&gt;If you are after treasuries, you can check &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.newyorkfed.org/research/staff_reports/sr381.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.newyorkfed.org/research/staff_reports/sr381.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which discusses trade impact on BrokerTec. If you are after equities, the literature is enormous, you can pretty much google for &quot;trade impact limit order book&quot; or smth similar. In practice, it's an empirical approach: you put all the factors, that seem important, run regression or some ML algo on it, and pick the factors, that have most explanatory power.&lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2015-06-03T13:48:21.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18133" PostTypeId="1" CreationDate="2015-06-03T14:35:33.980" Score="2" ViewCount="1139" Body="&lt;p&gt;It looks like the commissions alone for a non-index option trade is around 2-5%. For example, a BAC June ATM Call is currently trading at \$0.20; Interactive Brokers charges $0.7 per contract, which means that the commission alone is 3.5% of the value of the option! If one were to trade a more complicated strategy such as an Iron Condor to limit risk, the commission will go up even further. Yet BAC is the second most traded single-stock option! But why would anyone trade it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, SPX options have ~10x less commissions than SPY options per unit of risk, so why trade SPY options? I'm also puzzled by the lack of index options on things like gold. (Only a month ago did index options on non-US indices launch). Do investors primarily &quot;buy-and-hold&quot; options using strategies like call-writing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that any sort of &quot;clever&quot; strategy that trades volatility as an asset class faces incredible transaction costs. Is it simply not done?&lt;/p&gt;&#xA;" OwnerUserId="7887" LastEditorUserId="7887" LastEditDate="2015-06-03T15:14:14.330" LastActivityDate="2015-07-03T22:50:52.633" Title="Transaction costs on option trades" Tags="&lt;options&gt;&lt;transaction-costs&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18134" PostTypeId="1" CreationDate="2015-06-03T15:17:21.157" Score="8" ViewCount="6221" Body="&lt;p&gt;Since couple of weeks, I started to do my research on quant finance. During this time, I could discover a lot of stuff and with that stuff, a lot of questions came to my mind. A lot of news or economic journals/magazines write about HFT/Algorithmic trading. Most of them say that the companies or software developers prefer to use C++. In some articles, the writers talk about Java, C#, C or even ASM. I tried to find the reason for C++, but I weren't successful. This topic doesn't provide answers that I need (&lt;a href=&quot;https://quant.stackexchange.com/questions/1764/why-is-c-still-a-very-popular-language-in-quantitative-finance&quot;&gt;Why is C++ still a very popular language in quantitative finance?&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are my questions: 1. Why C++? That some companies might use ASM (and I can only imagine ASM in HFT where milliseconds play a role), that's fine. But in medium frequency trading or in algorithms? Is it because of speed? I looked for quant finance libraries for C++, but I couldn't find a lot. The only thing is QuantLib, MatLib and TA-Lib. But no chart APIs/Libs or tutorials. Seems like no one doing tutorials. 2. Why do some people choose Java? I know, Java is very popular language and has a lot of APIs/Libs and the community is growing. But if the speed might play a role, then Java can't be the fastest (because of virtual environment). Or am I wrong? 3. Why no one is using Python for medium frequency trading or algo trading? Python has a lot of Apis/Libs like MatLib, TA-Lib, Pyqtgraph. Ok, I have to say, Python is not the fastest. 4. In this discussion &lt;a href=&quot;https://quant.stackexchange.com/questions/1764/why-is-c-still-a-very-popular-language-in-quantitative-finance&quot;&gt;Why is C++ still a very popular language in quantitative finance?&lt;/a&gt;, some people claim that C# might be much better for quant finance developing. Is it really true? How about Libs, APIs, Tutorials etc?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And my final question, what is the important property for choosing a language for quant finance? I don't talk about ASM because it's the fastest language and it's used for very complex calculations that have to be made fast. But what's about C++, C#, Python and Java? For me, it's important that there should be Libs and Tutorials/Examples. And the beginning, I started with python, but after all I have read, I'm not sure about Python anymore.&lt;/p&gt;&#xA;" OwnerUserId="16433" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2015-09-05T23:58:48.053" Title="Quantitative Finance Programming Language" Tags="&lt;algorithmic-trading&gt;&lt;quantitative&gt;&lt;algorithm&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="18135" PostTypeId="2" ParentId="441" CreationDate="2015-06-03T16:04:03.907" Score="1" Body="&lt;p&gt;I think barchart just released a free market data api, but I doubt it has what your looking for.... &lt;a href=&quot;http://freemarketdataapi.barchartondemand.com&quot; rel=&quot;nofollow&quot;&gt;freemarketdataapi.barchartondemand.com&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16434" LastActivityDate="2015-06-03T16:04:03.907" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18136" PostTypeId="2" ParentId="18129" CreationDate="2015-06-03T19:24:51.830" Score="3" Body="&lt;p&gt;In the Black-Scholes world, it is assumed that the option value $C(t, S_t)$ is replicable by an admissible self-financing trading strategy $\phi$, where $\phi_t=(\alpha_t, \beta_t)$. That is,&#xA;\begin{align*}&#xA;C(t, S_t) = \alpha_t B_t + \beta_t S_t,&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;dC(t, S_t) = \alpha_t dB_t + \beta_t dS_t.&#xA;\end{align*}&#xA;Since $dB_t = rB_t dt$, and $dS_t = S_t(rdt + \sigma dW_t)$, then&#xA;\begin{align*}&#xA;d\bigg(\frac{C(t, S_t)}{B_t} \bigg) &amp;amp;= \frac{dC(t, S_t)}{B_t}-\frac{C(t, S_t)}{B_t^2}dB_t\\&#xA;&amp;amp;=\beta_t \frac{dS_t}{B_t} - \beta_t \frac{S_t}{B_t^2}dB_t\\&#xA;&amp;amp;=\beta_t \frac{S_t(rdt + \sigma dW_t)}{B_t} - \beta_t \frac{S_t}{B_t}rdt\\&#xA;&amp;amp;=\sigma\beta_t\frac{S_t}{B_t}dW_t.&#xA;\end{align*}&#xA;Therefore, $\{C(t, S_t)/B_t \mid 0\leq t \leq T\}$ is a martingale.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-06-03T19:24:51.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18137" PostTypeId="2" ParentId="17619" CreationDate="2015-06-03T20:12:01.050" Score="2" Body="&lt;p&gt;Your portfolio composition is not clear. To simplify, we assume that it consists of units of a stock and options on this stock. What you can do is to sell 4000 units of options that will bring it to gamma neutral, and then to balance the delta, you can buy 2,400-450=1,950 units of the stock.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-06-03T20:12:01.050" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18138" PostTypeId="2" ParentId="18133" CreationDate="2015-06-03T21:02:33.630" Score="2" Body="&lt;p&gt;Volatility is mostly an &quot;institutional&quot; trade. People who trade it have a seat on one of the exchanges so they do not pay broker commissions. On top OPRA still imposes its own fees, which can add up. In regards of why anyone would trade an asset when transaction costs are 3-5%. Ask millions of people who flip real estate - transaction costs are 5% and up. Yet real estate is the most popular trade in the world :)&lt;/p&gt;&#xA;" OwnerUserId="7973" LastActivityDate="2015-06-03T21:02:33.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18139" PostTypeId="2" ParentId="17585" CreationDate="2015-06-03T21:14:59.097" Score="-2" Body="&lt;p&gt;communicate risk in terms of loss to a given portfolio in simple terms so that ANY client would understand.&lt;/p&gt;&#xA;" OwnerUserId="13504" LastActivityDate="2015-06-03T21:14:59.097" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18140" PostTypeId="1" CreationDate="2015-06-03T21:18:28.497" Score="2" ViewCount="107" Body="&lt;p&gt;In Vasicek's seminal 1977 paper &quot;An equilibrium characterization of the term structure&quot;, he states the bond price $P(t,s)$ is a function of the spot rate $r(t)$, $P(t,s) = P(t,s,r(t))$.  He then states &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;Thus, the value of the spot rate is the only variable for the whole&#xA;  term structure. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Okay, so far so good.  He continues,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;Since there exists only one state variable, the&#xA;  instantaneous returns on bonds of different maturities are perfectly correlated.  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I'm not sure why that would follow...could I get this translated to math, with a decent explanation?  Finally, he states&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This means that the short bond and just one other bond completely span the whole of the term structure.&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What exactly does this mean, and why would he need it?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2015-06-08T18:29:50.990" Title="One state variables implies perfect correlation of returns?" Tags="&lt;fixed-income&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18141" PostTypeId="2" ParentId="17585" CreationDate="2015-06-03T21:42:54.857" Score="1" Body="&lt;p&gt;The work of the &lt;a href=&quot;http://vlab.stern.nyu.edu/&quot; rel=&quot;nofollow&quot;&gt;NYU V-Lab&lt;/a&gt; is interesting to me. They try to measure risk in the system as a whole &lt;a href=&quot;http://vlab.stern.nyu.edu/doc/3?topic=apps&quot; rel=&quot;nofollow&quot;&gt;&quot;systemic risk&quot;&lt;/a&gt;, rather than risk in a single portfolio. &lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2015-06-04T14:45:59.787" LastActivityDate="2015-06-04T14:45:59.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18142" PostTypeId="1" AcceptedAnswerId="18165" CreationDate="2015-06-03T22:40:11.180" Score="0" ViewCount="2047" Body="&lt;p&gt;I am trying to use delta-gamma method with montecarlo simulations to calculate the VAR of a portfolio consisting in options and equities. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To use the method I need to compute a gamma matrix, that has gammas in its diagonal and cross-gammas in the i,j components. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is how do I compute the cross-gammas? I have looked everywhere but cannot find a closed formula or method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BR&lt;/p&gt;&#xA;" OwnerUserId="16436" LastActivityDate="2015-06-04T17:21:52.353" Title="Compute cross-gamma" Tags="&lt;monte-carlo&gt;&lt;var&gt;&lt;gamma&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18143" PostTypeId="1" CreationDate="2015-06-03T23:24:00.237" Score="0" ViewCount="197" Body="&lt;p&gt;Could any one explain the difference&lt;/p&gt;&#xA;" OwnerUserId="13504" LastActivityDate="2015-06-04T04:00:44.650" Title="Difference between Tick data and NASDAQ ITCH VIEW" Tags="&lt;data&gt;&lt;nasdaq&gt;&lt;tick&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2015-06-04T07:38:24.023" ContentLicense="CC BY-SA 3.0" />
  <row Id="18146" PostTypeId="2" ParentId="18129" CreationDate="2015-06-04T02:43:21.417" Score="0" Body="&lt;p&gt;Let's go to Chapter 6 in the book where he talks about risk-neutrality. In the chapter he proved the existence of a risk-neutral measure. Now, let's stop and think what this means.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It means our hedging portfolio for the option can't beat the risk-free rate. Although not exactly mathematically correct, you can think C/B as a ratio of the option price to the zero-coupon-bond. If this ratio has a drift (i.e: a trend), the option (i.e: heading portfolio) performs better than the zero-coupon-bond. Obviously, it'll create an arbitrage opportunity. Mathematically, this is simply a martingale under the risk-neutral measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, we know the option price must be a martingale under the risk-neutral measure and we also know that the drift is zero, it's not hard to see why Mark Joshi derived the way he did in the book.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2015-06-04T02:43:21.417" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18147" PostTypeId="2" ParentId="18134" CreationDate="2015-06-04T03:10:17.153" Score="5" Body="&lt;p&gt;Unfortunately, there is no correct answer for this question, it's like what car you should drive on your weekend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;C++ is a popular language in quantitative finance, but it's usually (but not always!) only used to build the application backbone, such as derivative pricing. Why C++? C++ is a good choice because C++ is platform independent, we can natively build an option pricing code for Linux, Mac, Windows etc. QuantLib is a good example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;C# is another very popular language in finance. We can use C# to create a trading application, parse XML data from another bank, create a web-server etc. Of course, we can also do derivative pricing in C# but we might not be able to optimise the performance. In C++, we could split the workloads with OpenMP, vectorise a Monte-Carlo loops etc etc, harder with C#.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;C# is definitely not a better language than C++ in quantitative finance. It really depends on what you want to do. For example, nobody would use C# for HPC trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not everybody in quantitative finance can do hard-core programming, most don't. Python (Excel VBL or R) would be a better language for them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to learn something for your first job, start off with C++. Try to understand QuantLib.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2015-06-04T03:10:17.153" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18148" PostTypeId="1" CreationDate="2015-06-04T03:11:08.507" Score="2" ViewCount="204" Body="&lt;p&gt;I'm fairly new to the quant finance space, and I was hoping to get some guidance. Say I have a csv/excel file with columns of daily returns data for various asset classes or securities (one column per asset). I want to be able to import these returns data into Python, probably as lists/arrays. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there are many days worth of data (say 10 years worth), what's the best way to go about this, import-wise and data structure-wise? Any packages that could help?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A minor note, I was considering using dictionaries so I could still retain the date/day, whereas if I just use lists I would just index it as 1,2,3,4...n_th day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="16366" LastActivityDate="2015-06-04T04:49:54.580" Title="importing columns of returns data into python from excel/csv" Tags="&lt;backtesting&gt;&lt;returns&gt;&lt;python&gt;" AnswerCount="1" CommentCount="3" ClosedDate="2015-06-04T07:21:54.183" ContentLicense="CC BY-SA 3.0" />
  <row Id="18149" PostTypeId="1" CreationDate="2015-06-04T03:40:01.653" Score="1" ViewCount="129" Body="&lt;p&gt;I'm reading about volatility analysis here &lt;a href=&quot;http://vlab.stern.nyu.edu/doc?topic=mdls&quot; rel=&quot;nofollow&quot;&gt;http://vlab.stern.nyu.edu/doc?topic=mdls&lt;/a&gt;. There are many variations of GARCH.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: rather than trial-and-error approach, is there any systematic approach to decide when to use which type of GARCH? Or equivalently, each variation of GARCH is used in which situation?&lt;/p&gt;&#xA;" OwnerUserId="6461" LastActivityDate="2015-06-12T15:46:45.557" Title="Uses of Volatility models" Tags="&lt;volatility&gt;&lt;garch&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18150" PostTypeId="2" ParentId="18143" CreationDate="2015-06-04T04:00:44.650" Score="2" Body="&lt;p&gt;What Tick data you have in mind? NASDAQ ITCH is tick data but you have to construct the limit order book yourself to keep track of the best bid and ask price for each stocks. Not a trivial task. If you get TAQ data, you will get the best bid and ask (NBBO) but TAQ data has some issues like no odd-lot trades and trades are not mark buyer or seller initiated.&lt;/p&gt;&#xA;" OwnerUserId="2570" LastActivityDate="2015-06-04T04:00:44.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18151" PostTypeId="2" ParentId="18148" CreationDate="2015-06-04T04:49:54.580" Score="1" Body="&lt;p&gt;True this is a stackoverflow question but have you tried the fool around with the package &lt;code&gt;Pandas&lt;/code&gt;? You can do in Python&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;import pandas as pd&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;data = pd.read_csv('filepath/file.csv')&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's the easiest way.&lt;/p&gt;&#xA;" OwnerUserId="2570" LastActivityDate="2015-06-04T04:49:54.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18153" PostTypeId="2" ParentId="111" CreationDate="2015-06-04T07:47:52.023" Score="5" Body="&lt;p&gt;Sorry, but despite being used as a popular example in machine learning, no one has ever achieved a stock market prediction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It does not work for several reasons (check random walk by Fama and quite a bit of others, rational decision making fallacy, wrong assumptions ...), but the most compelling one is that if it would work, someone would be able to become insanely rich within months, basically owning all the world. As this is not happening (and you can be sure all the bank have tried it), we have good evidence, that it just does not work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Besides: How do you think you will achieve what tens of thousands of professionals have failed to, by using the same methods they have, plus limited resources and only basic versions of their methods?&lt;/p&gt;&#xA;" OwnerUserId="16440" LastActivityDate="2015-06-04T07:47:52.023" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18154" PostTypeId="2" ParentId="16691" CreationDate="2015-06-04T08:06:57.533" Score="1" Body="&lt;p&gt;The implementation is explained in more detail in the Horse - Race of DeMiguel: &lt;a href=&quot;http://faculty.london.edu/avmiguel/DeMiguel-Garlappi-Uppal-RFS.pdf&quot; rel=&quot;nofollow&quot;&gt;see here&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16249" LastActivityDate="2015-06-04T08:06:57.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18155" PostTypeId="2" ParentId="16358" CreationDate="2015-06-04T08:12:28.867" Score="2" Body="&lt;p&gt;As you are especially interested in applications in Finance I'll recommend &lt;a href=&quot;http://eu.wiley.com/WileyCDA/WileyTitle/productCd-0471920835.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;this book&lt;/a&gt; of Rachev which focus on Bayesian Methods in Finance &lt;/p&gt;&#xA;" OwnerUserId="16249" LastEditorUserId="15154" LastEditDate="2017-04-05T11:25:16.047" LastActivityDate="2017-04-05T11:25:16.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18156" PostTypeId="1" CreationDate="2015-06-04T08:44:07.107" Score="3" ViewCount="2007" Body="&lt;p&gt;I am using the predict and ugarchforecast functions in R.&#xA;When I fit my models and try to forecast, I get either only increasing or decreasing values for sigma, does anyone know why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;eGARCHfit2 = ugarchspec(variance.model=list(model=&quot;eGARCH&quot;, garchOrder=c(1,1)), mean.model=list(armaOrder=c(0,0), include.mean=TRUE), distribution.model=&quot;norm&quot;) eGARCH2 &amp;lt;- ugarchfit(brentlog2, spec=eGARCHfit2)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ugarchforecast(eGARCH2, data =brentlog2, n.ahead = 21) &lt;br/&gt;&#xA; * GARCH Model Forecast * ------------------------------------ &lt;br/&gt;&#xA; * Model: eGARCH &lt;br/&gt;&#xA; * Horizon: 21 Roll Steps: 0 Out of Sample: 0 0-roll&lt;br/&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;forecast [T0=1976-06-26 01:00:00]: &lt;br/&gt;&#xA;      Series   Sigma &lt;br/&gt;&#xA;T+1 0.0002619  0.008350 &lt;br/&gt;&#xA;T+2 0.0002619 0.008387 &lt;br/&gt;&#xA;T+3 0.0002619 0.008423 &lt;br/&gt;&#xA;T+4 0.0002619 0.008459 &lt;br/&gt;&#xA;T+5 0.0002619 0.008496 &lt;br/&gt;&#xA;T+6 0.0002619 0.008532 &lt;br/&gt;&#xA;T+7 0.0002619 0.008569 &lt;br/&gt;&#xA;T+8 0.0002619 0.008605 &lt;br/&gt;&#xA;T+9 0.0002619 0.008642 &lt;br/&gt;&#xA;T+10 0.0002619 0.008678&lt;br/&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first value is the mean which is always constant and the second one is sigma which is always increasing as you can see.&lt;/p&gt;&#xA;" OwnerUserId="16419" LastEditorUserId="16419" LastEditDate="2015-06-04T10:44:01.157" LastActivityDate="2015-09-02T22:43:41.620" Title="Forecasting using GARCH in R" Tags="&lt;r&gt;&lt;garch&gt;&lt;forecasting&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18157" PostTypeId="2" ParentId="18140" CreationDate="2015-06-04T13:20:06.827" Score="2" Body="&lt;p&gt;Under the Vasicek's model, the price of a zero-coupon bond is given by&#xA;\begin{align*}&#xA;P(t, T) = A(t, T)\exp\big(-B(t, T) r_t\big),&#xA;\end{align*}&#xA;where $A$ and $B$ are deterministic functions. In particular,&#xA;$B$ is a positive increasing function (see any books on interest rate models).&#xA;Then&#xA;\begin{align*}&#xA;\ln P(t, T) = \ln A(t, T) - B(t, T) r_t.&#xA;\end{align*}&#xA;For any four maturities $T_1$, $T_2$, $T_3$, and $T_4$, where $T_1 &amp;lt; T_2 &amp;lt;T_3 &amp;lt; T_4$,&#xA;\begin{align*}&#xA;\ln \frac{P(t, T_2)}{P(t, T_1)} = \ln \frac{A(t, T_2)}{A(t, T_1)} - [B(t, T_2)-B(t, T_1)] r_t,&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;\ln \frac{P(t, T_4)}{P(t, T_3)} = \ln \frac{A(t, T_4)}{A(t, T_3)} - [B(t, T_4)-B(t, T_3)] r_t.&#xA;\end{align*}&#xA;It is now easy to check that&#xA;\begin{align*}&#xA;Var\bigg(\ln \frac{P(t, T_2)}{P(t, T_1)}\bigg) &amp;amp;= [B(t, T_2)-B(t, T_1)]^2 Var(r_t),\\&#xA;Var\bigg(\ln \frac{P(t, T_4)}{P(t, T_3)}\bigg) &amp;amp;= [B(t, T_4)-B(t, T_3)]^2 Var(r_t),&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;Cov\bigg(\ln \frac{P(t, T_2)}{P(t, T_1)}, \ln \frac{P(t, T_4)}{P(t, T_3)}\bigg) &amp;amp;= [B(t, T_2)-B(t, T_1)] [B(t, T_4)-B(t, T_3)]Var(r_t).&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;Corr\bigg(\ln \frac{P(t, T_2)}{P(t, T_1)}, \ln \frac{P(t, T_4)}{P(t, T_3)}\bigg) &amp;amp;= 1.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As there are three model parameters, any two bonds can be used to calibrate them (there are two $A$s and two $B$s), and then all bond prices are known.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Updates based on poster's comments: Assuming that&#xA;\begin{align*}&#xA;dr_t = \alpha(r_t, t)dt + \beta(r_t, t) dW_t,&#xA;\end{align*}&#xA;where $\{W_t \mid t \geq 0\}$ is a standard Brownian motion. Moreover, assuming that the zero-coupon bond price is defined by &#xA;\begin{align*}&#xA;P(t, T) = P(t, T, r_t).&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;dP(t, T) &amp;amp;= \frac{\partial P(t, T)}{\partial t}dt + \frac{\partial P(t, T)}{\partial r_t}dr_t + \frac{1}{2}\frac{\partial^2 P(t, T)}{\partial r_t^2}\beta^2(r_t, t) dt\\&#xA;&amp;amp;=\bigg(\frac{\partial P(t, T)}{\partial t}+ \frac{\partial P(t, T)}{\partial r_t} \alpha(r_t, t) + \frac{1}{2}\frac{\partial^2 P(t, T)}{\partial r_t^2}\beta^2(r_t, t)\bigg)dt \\&#xA;&amp;amp;\qquad\qquad+ \frac{\partial P(t, T)}{\partial r_t}\beta(r_t, t)dW_t\\&#xA;&amp;amp;=P(t, T)\big[\mu(r_t, t, T)dt + \sigma(r_t, t, T)dW_t \big],&#xA;\end{align*}&#xA;for certain adapted functions $\mu(r_t, t, T)$ and $\sigma(r_t, t, T)$. Moreover,&#xA;\begin{align*}&#xA;Var\Big[dP(t, T)/P(t, T) \mid \mathcal{F}_t\Big] = \sigma^2(r_t, t, T) dt.&#xA;\end{align*}&#xA;Furthermore, for $T_1$, $T_2$, where $t &amp;lt; T_1 \leq T_2$,&#xA;\begin{align*}&#xA;Cov\Big[dP(t, T_1)/P(t, T_1),\, dP(t, T_2)/P(t, T_2) \mid \mathcal{F}_t\Big] = \sigma(r_t, t, T_1)\sigma(r_t, t, T_2) dt.&#xA;\end{align*}&#xA;That is, &#xA;\begin{align*}&#xA;Corr\Big[dP(t, T_1)/P(t, T_1),\, dP(t, T_2)/P(t, T_2) \mid \mathcal{F}_t\Big] = 1.&#xA;\end{align*}&#xA;In other words, the instantaneous returns on bonds of different maturities are perfectly correlated.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-06-08T18:29:50.990" LastActivityDate="2015-06-08T18:29:50.990" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18158" PostTypeId="1" AcceptedAnswerId="18191" CreationDate="2015-06-04T14:41:06.403" Score="1" ViewCount="4483" Body="&lt;p&gt;Why is &quot;Deferred revenue&quot; treated as a non-monetary liability during temporal method FX translation while &quot;Accrued Expenses&quot; is treated as a monetary liability?&lt;/p&gt;&#xA;" OwnerUserId="11815" LastActivityDate="2017-09-13T04:33:32.900" Title="Why is &quot;Deferred revenue&quot; a non-monetary liability?" Tags="&lt;fx&gt;&lt;accounting&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18160" PostTypeId="1" AcceptedAnswerId="18162" CreationDate="2015-06-04T14:52:20.337" Score="6" ViewCount="1680" Body="&lt;p&gt;This question is related to recent rule changes in the &lt;a href=&quot;https://www.quantopian.com/posts/june-contest-rules-update-its-all-about-that-beta-star?utm_source=All+Active+Members&amp;amp;utm_campaign=34d911f0c5-15-05-20-May-monthly&amp;amp;utm_medium=email&amp;amp;utm_term=0_7cca55778a-34d911f0c5-60434073&quot; rel=&quot;noreferrer&quot;&gt;Quantopian Open&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to figure out a closed form solution to a beta constrained minimum variance portfolio problem but it doesn't seem particularly tractable. Has anyone else tried this? So far, I have set up the problem&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align}&#xA;\min_w \quad&amp;amp; w^\prime \Sigma w \\&#xA;s.t. \quad&amp;amp; w^\prime\vec 1 = 1 \\&#xA;\text{and} \quad &amp;amp; w^\prime \beta = c&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$w$ is the vector of portfolio weights, our control &lt;/li&gt;&#xA;&lt;li&gt;$\Sigma$ is the total covariance matrix&lt;/li&gt;&#xA;&lt;li&gt;$\beta$ is the vector of CAPM-type market betas&lt;/li&gt;&#xA;&lt;li&gt;$c$ a constant that the portfolio beta should be equal to&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Changing constraints to Lagrange multipliers the objective becomes&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\min_w \quad w^\prime\Sigma w - \lambda_1(w^\prime\vec 1 - 1) - \lambda_2(w^\prime\beta - c)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the first order conditions are&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align}&#xA;0 &amp;amp;= 2w^\prime\Sigma - \lambda_1\vec 1 - \lambda_2 \beta\\&#xA;1 &amp;amp;= w^\prime\vec 1\\&#xA;c &amp;amp;= w^\prime\beta&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I cannot seem to get the equations to work out nicely, perhaps no closed form solution exists but I wanted to check here and see if anyone could get something reasonable before I go to numerical optimization.&lt;/p&gt;&#xA;" OwnerUserId="4910" LastEditorUserId="4910" LastEditDate="2015-06-04T16:35:21.083" LastActivityDate="2015-08-05T12:46:51.053" Title="Beta Constrained Markowitz Minimum Variance Portfolio - Closed Form Solution" Tags="&lt;optimization&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;&lt;beta&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18161" PostTypeId="2" ParentId="10905" CreationDate="2015-06-04T15:03:39.797" Score="15" Body="&lt;p&gt;&lt;a href=&quot;https://www.quantconnect.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;QuantConnect&lt;/a&gt; provides an open-source, community-driven project called &lt;a href=&quot;http://lean.quantconnect.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;Lean&lt;/a&gt;. The project has thousands of engineers using it to create event-driven strategies, on any resolution data, any market, or asset class.&lt;/p&gt;&#xA;&lt;p&gt;Our system models margin leverage and margin calls, cash limitations, transaction costs. We maintain a full cashbook of your currencies. It's about as close to reality as possible. It's 20x faster than Zipline and runs on any asset class or market. We provide tick, second or minute data in Equities and Forex for free.&lt;/p&gt;&#xA;&lt;p&gt;QuantConnect supports &lt;a href=&quot;https://github.com/QuantConnect/Lean/tree/master/Algorithm.Python&quot; rel=&quot;nofollow noreferrer&quot;&gt;Python&lt;/a&gt;, &lt;a href=&quot;https://github.com/QuantConnect/Lean/tree/master/Algorithm.CSharp&quot; rel=&quot;nofollow noreferrer&quot;&gt;C#&lt;/a&gt;, and &lt;a href=&quot;https://github.com/QuantConnect/Lean/tree/master/Algorithm.FSharp&quot; rel=&quot;nofollow noreferrer&quot;&gt;F#&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;I'm a founder @ QuantConnect&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;January 2017:&lt;/em&gt; We now offer intraday Options, Futures, Forex, CFD, and US Equities backtesting through QuantConnect.com&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;October 2017:&lt;/em&gt; We have added crypto trading on GDAX.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;April 2018:&lt;/em&gt; We have created a modular algorithm framework; separate algorithm components that can be plugged together for rapid algorithm development.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Jan 2019:&lt;/em&gt; Launched an Alpha Marketplace, with submissions from quants around the world.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;July 2020:&lt;/em&gt; We broke apart the platform into services like AWS. Allowing you to spin up different parts of our platform and only pay for what you use.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;August 2020:&lt;/em&gt; We added L1-Spread data and fill models for equities backtesting.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;December 2020:&lt;/em&gt; We added future-options support.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;January: 2021:&lt;/em&gt; Deployed cloud-optimization to test parameter sensitivity.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;February 2021:&lt;/em&gt; Opened our alpha market place to all investors containing hundreds of strategies with SR &amp;gt;1.&lt;/p&gt;&#xA;" OwnerUserId="16443" LastEditorUserId="16443" LastEditDate="2021-02-16T08:01:00.023" LastActivityDate="2021-02-16T08:01:00.023" CommentCount="6" CommunityOwnedDate="2015-06-04T15:03:39.797" ContentLicense="CC BY-SA 4.0" />
  <row Id="18162" PostTypeId="2" ParentId="18160" CreationDate="2015-06-04T15:25:28.743" Score="2" Body="&lt;p&gt;Assuming that $\Sigma$ is invertible, then&#xA;\begin{align}&#xA;2\omega' = \lambda_1\overrightarrow{1}'\Sigma^{-1}+\lambda_2\beta'\Sigma^{-1}.&#xA;\end{align}&#xA;We can then solve $\lambda_1$ and $\lambda_2$ from the system of equations&#xA;\begin{align*}&#xA;2 &amp;amp;= \lambda_1\overrightarrow{1}'\Sigma^{-1}\overrightarrow{1}+\lambda_2\beta'\Sigma^{-1}\overrightarrow{1}\\&#xA;2c &amp;amp;= \lambda_1\overrightarrow{1}'\Sigma^{-1}\beta+\lambda_2\beta'\Sigma^{-1}\beta.&#xA;\end{align*}&#xA;Consequently, $\omega$ can be obtained from the above equation.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-06-04T15:44:48.083" LastActivityDate="2015-06-04T15:44:48.083" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18163" PostTypeId="1" CreationDate="2015-06-04T15:28:15.920" Score="0" ViewCount="103" Body="&lt;p&gt;Given the &lt;a href=&quot;http://www.treasury.gov/resource-center/data-chart-center/interest-rates/Pages/TextView.aspx?data=yield&quot; rel=&quot;nofollow&quot;&gt;Daily US Treasury Yield Curve Rates&lt;/a&gt; for a specific date I will fit the curve with the cubic spline method, but first I need to know how to use the data points given by the Treasury.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if today is June 1st, 2015, and the 3 months rate is 0.8%, does this mean that I need to simply add 3 to today's month (resulting in September 1st, 2015) or I need to add 90 days to today's date (resulting in August 30th, 2015) ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly with the 30 years rate, should I add 365 x 30 days, should I consider leap years, or simply add 30 to the year (following the example above, it will result in June 1st, 2045) ?&lt;/p&gt;&#xA;" OwnerUserId="11920" LastActivityDate="2015-06-04T19:28:26.637" Title="How do I interpret yield curve data points given by the US Treasury?" Tags="&lt;interest-rates&gt;&lt;yield-curve&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18164" PostTypeId="1" CreationDate="2015-06-04T15:48:42.860" Score="0" ViewCount="476" Body="&lt;p&gt;I want to analize Bitcoin returns using the CAPM.&#xA;I was thinking if it makes sense to compare returns of (BTC/USD) against (EUR/USD), taking the latter as the market returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, since EUR is just a fraction of the foreign exchange market, I'm not sure if this makes much sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this analysis reasonable?&lt;/p&gt;&#xA;" OwnerUserId="16447" LastActivityDate="2015-06-09T17:58:48.973" Title="Apply CAPM using returns on a foreign currency as the market returns" Tags="&lt;fx&gt;&lt;returns&gt;&lt;capm&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18165" PostTypeId="2" ParentId="18142" CreationDate="2015-06-04T16:15:48.153" Score="1" Body="&lt;p&gt;Consider an instrument value $f(S_0^1, \ldots, S_0^n)$ that depends on $n$ spot levels. Let $$\overrightarrow{S}_0=[S_0^1, \ldots, S_0^n]^T$$ be an $n$-dimensional vector representing the spot levels. We can approximate the cross gamma &#xA;\begin{align*}&#xA;\frac{\partial^2 f\big(\overrightarrow{S}_0\big)}{\partial S_0^i \partial S_0^j}&#xA;\end{align*}&#xA;by a finite difference scheme of the form&#xA;\begin{align*}&#xA;&amp;amp;\frac{1}{4 \varepsilon^2 S_0^i S_0^j}\Big[f\big(\overrightarrow{S}_0 + \varepsilon S_0^i\overrightarrow{1}_i + \varepsilon S_0^j\overrightarrow{1}_j\big) - f\big(\overrightarrow{S}_0 + \varepsilon S_0^i\overrightarrow{1}_i - \varepsilon S_0^j\overrightarrow{1}_j\big)\\&#xA;&amp;amp; \qquad\qquad - f\big(\overrightarrow{S}_0 - \varepsilon S_0^i\overrightarrow{1}_i + \varepsilon S_0^j\overrightarrow{1}_j\big) + f\big(\overrightarrow{S}_0 - \varepsilon S_0^i\overrightarrow{1}_i - \varepsilon S_0^j\overrightarrow{1}_j\big)\Big],&#xA;\end{align*}&#xA;where $\overrightarrow{1}_i$ is an $n$-dimensional vector with $1$ in the $i^{th}$ element and zeros elsewhere. Here, $\varepsilon$ is a small perturbation, which is usually set to $0.01$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To justify the above, we use Taylor expansion. For example,&#xA;\begin{align*}&#xA;f\big(\overrightarrow{S}_0 + \Delta_i\overrightarrow{1}_i + \Delta_j\overrightarrow{1}_j\big)&amp;amp;\approx f\big(\overrightarrow{S}_0\big)+\Big(\Delta_i\frac{\partial }{\partial S_0^i}+ \Delta_j\frac{\partial }{\partial S_0^j}\Big)f\big(\overrightarrow{S}_0\big)\\&#xA;&amp;amp; \ \ + \frac{1}{2}\Big(\Delta_i\frac{\partial }{\partial S_0^i}+ \Delta_j\frac{\partial }{\partial S_0^j}\Big)^2f\big(\overrightarrow{S}_0\big) + o(\Delta_i \Delta_j ).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-06-04T17:21:52.353" LastActivityDate="2015-06-04T17:21:52.353" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18166" PostTypeId="1" CreationDate="2015-06-04T16:47:07.400" Score="2" ViewCount="156" Body="&lt;p&gt;In order to do cash flow mapping I need zero rates for corporate bonds , where to find or how to find the o rates ?&lt;/p&gt;&#xA;" OwnerUserId="16448" LastActivityDate="2015-07-05T12:53:35.370" Title="Zero rates coupon bond calculation" Tags="&lt;zero-coupon&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18167" PostTypeId="2" ParentId="18163" CreationDate="2015-06-04T19:28:26.637" Score="1" Body="&lt;p&gt;Your question is really about how to map between term-to-maturity and calendar dates, which can be a tricky problem since the number of days in a month varies by month. In short, you should increment using months if your incremental term is in months, and increment using years if your incremental term is in years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your examples, three months (or 0.25 years) forward from 2015-06-01 is 2015-09-01, and 30 years forward from 2015-06-01 is 2045-06-01. In the case of annual increments, this is consistent with Treasury note and bond issuance conventions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of monthly increments, this is consistent with common sense. As far as Treasury securities are concerned, the closest &quot;3-month&quot; securities are 13-week T-bills, so you might consider counting by weeks if you're looking for a T-bill maturity date. These pages from the TreasuryDirect website might help:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.treasurydirect.gov/indiv/research/indepth/tbills/res_tbill_rates.htm&quot; rel=&quot;nofollow&quot;&gt;Treasury Bill Rates &amp;amp; Terms&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.treasurydirect.gov/indiv/research/indepth/tnotes/res_tnote_rates.htm&quot; rel=&quot;nofollow&quot;&gt;Treasury Note Rates &amp;amp; Terms&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1417" LastActivityDate="2015-06-04T19:28:26.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18168" PostTypeId="1" AcceptedAnswerId="18169" CreationDate="2015-06-04T00:54:54.223" Score="0" ViewCount="65" Body="&lt;p&gt;This is Question No.11 from 2007 May MFE Exam.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;For a two-period binomial model for stock prices, you are given:&lt;/p&gt;&#xA;&lt;p&gt;(1) Each period is 6 months.&lt;/p&gt;&#xA;&lt;p&gt;(2) The current price for a nondividend paying stock is &lt;span class=&quot;math-container&quot;&gt;$70.00$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;(3) &lt;span class=&quot;math-container&quot;&gt;$u=1.181$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$d=0.890$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;(4) The continuously compounded risk-free interest rate is &lt;span class=&quot;math-container&quot;&gt;$5\%$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Calculate the current price of a one-year American put option on the stock with strike price of &lt;span class=&quot;math-container&quot;&gt;$80.00$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I supposed that for a nondividend paying stock, the price of American put option should be the same as the price of the corresponding European option. Following that thought, I constructed the binomial tree and my calculation is that&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$24.553\times e^{-0.05} \times (1-0.465)^2+6.4237\times e^{-0.05}\times 2 \times (1-0.465)\times 0.465$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;But I was reading the answer, and apparently when calculating the payoff at node &lt;span class=&quot;math-container&quot;&gt;$P_d$&lt;/span&gt;, the answer suggests it is optimal to early exercise the option.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$P_d=\max (K-S_d,e^{-rh} [P_{ud}p+P_{dd}(1-p)])=\max(80-62.30, e^{-0.05*0.5}[6.42\times 0.465+24.55\times(1-0.465)])=\max(17.70,15.72)$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Is there anything wrong with the question? Or did I miss something? Thank you very much!&lt;/p&gt;&#xA;" OwnerDisplayName="Misakov" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2015-06-04T20:17:24.963" Title="European option and American option are equivalent in this case?" Tags="&lt;finance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18169" PostTypeId="2" ParentId="18168" CreationDate="2015-06-04T03:21:28.603" Score="3" Body="&lt;p&gt;European puts need not agree with American ones. The equality is true for call options when there is non-negative interest rates and non-positive dividends. &lt;/p&gt;&#xA;" OwnerUserId="1809" OwnerDisplayName="Mark Joshi" LastActivityDate="2015-06-04T03:21:28.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18170" PostTypeId="1" CreationDate="2015-06-04T20:25:26.517" Score="0" ViewCount="663" Body="&lt;p&gt;I'm preparing a corporate finance exam and I need a book with illustrated exercises that make you really understand the subject, since the written exam is not much mechanical, but more similar to &quot;understand concepts, then juggle with them&quot;. I was thinking about using the wiley study guide for the CFA exam, but I need suggestions if it is adequate or not for my purpose.&lt;/p&gt;&#xA;" OwnerUserId="16045" LastActivityDate="2015-06-05T02:31:38.130" Title="Corporate finance exercise book" Tags="&lt;finance&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18171" PostTypeId="2" ParentId="18097" CreationDate="2015-06-04T20:38:40.777" Score="2" Body="&lt;p&gt;In literature you'll find many approaches to compute the variance. As mentioned already, the standard ideas are to use MLE, Shrinkage on the Covariance Matrix (Ledoit, Wolf), Shrinkage on the inverse of the Covariance Matrix (Kourtis,Dotsis) which makes sense as in fact the inverse of the Covariance Matrix determines the shape of the efficient frontier. &#xA;Incorporating dynamics into the estimation as for example with the complete battery of GARCH models is another approach. &#xA;As you mentioned, relaying on past data is not always effective, as the possibility of structural breaks in the Covariance Matrix exist which would not be observable in past data. In order to overcome this problem there are also approach to use forward-looking data in order to estimate the Covariance Matrix. &#xA;The core idea of &lt;a href=&quot;http://www.google.de/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CCcQFjAA&amp;amp;url=http%3A%2F%2Fwww.cfr-cologne.de%2Fdownload%2Fworkingpaper%2Fcfr-11-10.pdf&amp;amp;ei=DbZwVZXJOof6ywOw44C4Cw&amp;amp;usg=AFQjCNGIi3ZspubM3-0LIq2Of5MR2NTb0g&amp;amp;sig2=qJgdwalHy_Sf_Us7UAmhUA&amp;amp;bvm=bv.94911696,d.bGQ&amp;amp;cad=rja&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt; (Kempf) is to rely solely on current option prices&#xA;when estimating the covariance matrix instead of using historical return information. They argue 'since option prices reflect the expectations of market participants about risk, this approach - unlike the backward-looking approaches used so far - is inherently forward looking'&lt;/p&gt;&#xA;" OwnerUserId="16249" LastActivityDate="2015-06-04T20:38:40.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18172" PostTypeId="1" AcceptedAnswerId="18177" CreationDate="2015-06-04T21:15:08.440" Score="1" ViewCount="93" Body="&lt;p&gt;In Wilmott's third volume, on p. 857, he tries giving an insight into the market price of risk by showing what it is for traded assets.  For this he constructs a portfolio of two different options: long one option worth $V$ and short $\Delta$ units of another option worth $V_1$ giving a portfolio value of&#xA;$$&#xA;\Pi = V - \Delta V_1.&#xA;$$&#xA;Following the derivation he gave above for stochastic volatility, he gives the PDE&#xA;$$&#xA;\frac{\partial V}{\partial t} + \frac{1}{2}\sigma^2S^2\frac{\partial^2 V}{\partial S^2} + (\mu - \lambda_S \sigma)S\frac{\partial V}{\partial S} - rV = 0.&#xA;$$&#xA;So far, so good.  But he then states,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/RbxKV.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Why does the stock being tradeable mean its price must satisfy this PDE?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Assuming that $V=S$ is a solution of the PDE, where did the $\frac{\partial S}{\partial t}$ go?  Is it that, by $S$ he really means the &lt;em&gt;initial&lt;/em&gt; stock price, i.e., $S = S(0)$?  We would then have the time derivative vanishing.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="6866" LastEditorUserId="601" LastEditDate="2015-06-05T06:59:09.283" LastActivityDate="2015-06-06T09:30:19.493" Title="Tradeable =&gt; Satisfies pricing equation?" Tags="&lt;option-pricing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18173" PostTypeId="2" ParentId="18170" CreationDate="2015-06-04T21:32:20.940" Score="1" Body="&lt;p&gt;The famous textbook of &lt;a href=&quot;http://www.amazon.de/Principles-Corporate-Finance-Global-Edition/dp/0077151569&quot; rel=&quot;nofollow&quot;&gt;Brealey Myers and Allen&lt;/a&gt; provides tons of exercises ranging from easy to understand up to quite hard problems for the whole range of Corporate Finance related topics. &lt;/p&gt;&#xA;" OwnerUserId="16249" LastActivityDate="2015-06-04T21:32:20.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18174" PostTypeId="2" ParentId="18097" CreationDate="2015-06-04T21:39:11.510" Score="1" Body="&lt;p&gt;This is why Markowitz says that the diversification of the portfolio is always preferable. You have a lot of certain past data and some fallible speculations to evaluate the variance and expected return of a title. &#xA;Inherently the best possible evaluation method, and there are several main ones, is not a foolproof inference.&#xA;But, if you diversify your portfolio, you minimize the impact of bad assessment, including &lt;a href=&quot;http://www.tylervigen.com/spurious-correlations&quot; rel=&quot;nofollow&quot;&gt;spurious correlations&lt;/a&gt; and of wrong speculation.&lt;/p&gt;&#xA;" OwnerUserId="16116" LastActivityDate="2015-06-04T21:39:11.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18175" PostTypeId="2" ParentId="18156" CreationDate="2015-06-04T21:50:25.023" Score="1" Body="&lt;p&gt;This should follow from the properties of the forecast - for example the GARCH(1,1) forecast for $h$ steps is computing the conditional expectation of $\sigma^2_{t+h}$ based on the information set-up in $t$. This can be computed recursively by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;V(\varepsilon_{t+h}|F_t)=\omega+\alpha\varepsilon_{t+h-1|F_t}+\beta\sigma^2_{t+h-1|F_t}\\&#xA;=\omega\sum\limits_{i=0}^{h-2}(\alpha+\beta)^i+(\alpha+\beta)^{h-1}\sigma^2_{t+1}&#xA;$$&#xA;something similar but more complicated should hold for the EGARCH model. Stationarity for $\varepsilon_t^2$ hold if $|\alpha+\beta|&amp;lt;1$. If we assume stationarity the second term of the formula above should decrease with $h$. The first term is an increasing function in $h$ for $\omega&amp;gt;0$ which is a standard assumption to ensure the positiveness of the conditional variance. Therefore it seems to me like there is no monotonicity in $h$ but one saddle point at which the forecast starts to increase.&lt;/p&gt;&#xA;" OwnerUserId="16249" LastActivityDate="2015-06-04T21:50:25.023" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18176" PostTypeId="2" ParentId="18170" CreationDate="2015-06-05T02:31:38.130" Score="1" Body="&lt;p&gt;While I'm not saying corporate finance isn't a part of quantitative finance, it's more traditionally viewed as just &quot;finance&quot;. The Wiley book is heavily focused on quantitative finance, such as option pricing. It's not something that you'll need for your corporate finance exam. Therefore, I think the Wiley book is simply too advanced for a CFA exam. You should consider something else, such as the book recommended by @muffin1974.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2015-06-05T02:31:38.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18177" PostTypeId="2" ParentId="18172" CreationDate="2015-06-05T05:28:42.687" Score="2" Body="&lt;p&gt;$V_t $ is the price of a tradeable. Because we can delta hedge it, $V_t =v(t,S_t) $ where $v$ is a solution of the PDE on some domain whose boundary corresponds to the exercise of the option. For a European option with payoff $g(S_T)$ at time $T$, the price function $v$ is the solution&#xA;$$&#xA;  \frac{\partial v}{\partial t} + \frac{1}{2}\sigma^2S^2\frac{\partial^2 v}{\partial S^2} + (\mu - \lambda_S \sigma)S\frac{\partial v}{\partial S} - rv = 0.&#xA;$$&#xA;on $[0,T] \times \mathbb{R}^*_+$ with boundary&#xA;$$&#xA;  v(T,S) = g(S)&#xA;$$&#xA;Consider the special case of a derivative that delivers the stock at time $T$: $g(S) = S$. Obviously you can replicate this by buying the stock at time $0$ and holding it until $T$ so the price is $V_t = S_t$. The corresponding price function is thus $v(t,S) = S$. Its partial derivative with respect to $t$ is $0$ (no Theta), its partial derivative with respect to the variable $S$ (Delta) is $1$ and its second partial derivative with respect to the variable $S$ (Gamma) is 0. Since it is the price of a European option, it satisfies the PDE which reduces to&lt;br&gt;&#xA;$$&#xA;  (\mu - \lambda_S \sigma)S - rS = 0.&#xA;$$&#xA;This allows to deduce the market price of risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I think to avoid confusion you need to distinguish between the partial and total derivative. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value of a portfolio is stochastic. Its &quot;total derivative&quot; is a formal notation&#xA;$$&#xA;  dV_t = \mu^V_t dt + \sigma^V_t dW_t &#xA;$$&#xA;for an Ito integral. Intuitively, this is your P&amp;amp;L over a small time period $[t,t+dt]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand the price function $v(t,S)$ is deterministic. Its partial derivative are the Greeks: $\Theta = \partial_t v$, $\Delta = \partial_S v$, $\Gamma = \partial^2_S v$. Here $S$ is nothing but a letter to identify the second variable of $v$. We could write $\partial_2 v$ just as well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The two are related when you plug the stochastic price process in the price function: $$V_t = v(t,S_t)$$ And Ito's lemma tells you how to compute the &quot;total derivative&quot; in terms of the partial derivatives of $v$:&#xA;$$&#xA;  dV_t = \partial_tv(t,S_t) dt + \partial_Sv(t,S_t)  dS_t + \frac{1}{2}\partial^2_Sv(t,S_t)  d\langle S,S\rangle_t &#xA;$$&#xA;which leads to the BS PDE. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case $v(t,S) = S$ clearly the partial derivative is $\partial_t v(t,S) = 0$ for all $(t,S) \in [0,T]\times \mathbb{R}^*_+$ but the total derivative $dv(t,S_t) = dS_t = \mu S_t dt + \sigma S_t dW_t$ corresponds to a non-constant stochastic process.  &lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2015-06-06T09:30:19.493" LastActivityDate="2015-06-06T09:30:19.493" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="18178" PostTypeId="1" CreationDate="2015-06-05T05:42:40.260" Score="1" ViewCount="1596" Body="&lt;p&gt;in Hull's solutions manual of Options, Futures &amp;amp; Derivatives (8th edition), there's question 4.7, in which is asked to put the following in descending order: a) the five-year zero rate, b) the yield on a five-year coupon-bearing bond, c) the forward rate corresponding to the period between 4.75 and 5 years in the future. The yield curve is upward sloping. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution is c&gt;a&gt;b. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With an upward sloping yield curve, it makes sense to me that the forward rate at the end of the curve is highest among the three. However, I don't get how to put a and b in order; what's the reasoning behind it? &lt;/p&gt;&#xA;" OwnerUserId="16218" LastActivityDate="2015-06-05T05:42:40.260" Title="Zero rate vs. yield on coupon bearing bond" Tags="&lt;yield-curve&gt;&lt;zero-coupon&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18179" PostTypeId="2" ParentId="18166" CreationDate="2015-06-05T05:44:11.840" Score="1" Body="&lt;p&gt;This is a topic that can be covered by an entire book... Typically, you select some liquid instruments such as swaps, deposits, futures etc etc to bootstrap a yield curve, from which you can use it for discounting. The problem is not how to bootstrap, but what to bootstrap. It's a very complicated issue, you may have to consider cost of funding, liquidity, maturity etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please read: &lt;a href=&quot;http://www.bankofcanada.ca/wp-content/uploads/2010/01/wp00-17.pdf&quot; rel=&quot;nofollow&quot;&gt;A Practical Guide to Swap Curve Construction&lt;/a&gt;, you can find it on Google.&lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorDisplayName="user16651" LastEditDate="2015-07-05T12:53:35.370" LastActivityDate="2015-07-05T12:53:35.370" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18180" PostTypeId="1" AcceptedAnswerId="18183" CreationDate="2015-06-05T07:03:52.257" Score="1" ViewCount="184" Body="&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;does anybody know what type of residuals is used in the Ljung box test in R? &#xA;raw or standardized?&lt;br/&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because basically when I fit a GARCH model using garchFit, the summary() function gives me all the Ljung box test results. But when I use ugarch to fit an EGARCH model, then the results don't come up.&#xA;SO I try to use Box.test((residuals(eGARCH,standardize=T))^2,lag=5,type=&quot;Ljung-Box&quot;,fitdf=2) but I get very different results whether I use standardize or not. Box.test((residuals(gjrGARCH1,standardize=T))^2,lag=5,type=&quot;Ljung-Box&quot;,fitdf=2)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="16419" LastActivityDate="2015-06-05T10:42:04.893" Title="Residuals in the Ljung box test" Tags="&lt;r&gt;&lt;garch&gt;&lt;testing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18181" PostTypeId="1" AcceptedAnswerId="18182" CreationDate="2015-06-05T07:18:05.033" Score="2" ViewCount="59" Body="&lt;p&gt;On page 16, first paragraph of &lt;a href=&quot;http://search.arxiv.org:8081/paper.jsp?r=1504.04296&amp;amp;qid=14331998030919a_nCnN_779701406&amp;amp;qs=program&amp;amp;in=q-fin&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt;, the authors introduce a function called &quot;borne&quot;, which divides the normal distribution into n ranges of equal size, without citation. The definition is clear enough for implementation, but I couldn't find any other reference to this function. Where did the authors come up with this name and is there a more standard or more rigorous definition of it somewhere?&lt;/p&gt;&#xA;" OwnerUserId="15485" LastActivityDate="2015-06-05T10:09:45.700" Title="What is the borne function mentioned in this paper?" Tags="&lt;statistics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18182" PostTypeId="2" ParentId="18181" CreationDate="2015-06-05T10:09:45.700" Score="2" Body="&lt;p&gt;&lt;a href=&quot;http://www.larousse.com/en/dictionaries/french-english/borne/10141&quot; rel=&quot;nofollow&quot;&gt;It's French&lt;/a&gt; for bound or limit (the authors are French) and it means whatever they define it to be ;) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm was not aware of this concept before and so I don't know a description or definition in English of the same.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2015-06-05T10:09:45.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18183" PostTypeId="2" ParentId="18180" CreationDate="2015-06-05T10:42:04.893" Score="1" Body="&lt;p&gt;So you are asking whether the function Box.test requires standardized or raw residuals as input? I do not know this function but as you mention that the results change based on your input it should be such that the function requires standardized values. In case a standardization is implemented directly the output should not differ because you either plug-in values that are &lt;strong&gt;(i)&lt;/strong&gt; standardized (then nothing changes by standardization) or values that are &lt;strong&gt;(ii)&lt;/strong&gt; not standardized (then they get standardized and the same variables are processed as in &lt;strong&gt;(i)&lt;/strong&gt;).&lt;/p&gt;&#xA;" OwnerUserId="16249" LastActivityDate="2015-06-05T10:42:04.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18184" PostTypeId="2" ParentId="17095" CreationDate="2015-06-05T12:19:10.307" Score="1" Body="&lt;p&gt;Intuitively speaking this statement should be clear, as in case the risk-free rate is equal to the expected return of the global minimum variance portfolio you can just assume that the minimum variance portfolio is just an investment into the risk-free rate. Therefore the intersection between the efficient frontier and the tangent line between $r_f$ and the efficient frontier &lt;strong&gt;is&lt;/strong&gt; at $0$ standard deviation and expected return $r_f$. &lt;/p&gt;&#xA;" OwnerUserId="16249" LastActivityDate="2015-06-05T12:19:10.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18185" PostTypeId="1" AcceptedAnswerId="18186" CreationDate="2015-06-05T13:32:26.853" Score="14" ViewCount="2966" Body="&lt;p&gt;In Shreve II, on p. 265 he states the Hull-White interest rate model as&#xA;$$&#xA;dR(u) = \left( a(u) - b(u)R(u)\right) dt + \sigma(u)d\tilde{W}(u),&#xA;$$&#xA;and then mentions &quot;...$\tilde{W}(u)$ is a Brownian motion under a risk-neutral measure $\tilde{\mathbb{P}}$.&quot;  However, when he defines a risk-neutral measure on p. 228, he states that $\tilde{\mathbb{P}}$ is a measure under which the &lt;em&gt;discounted stock price is a martingale.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This definition doesn't really apply here, so what is meant by a &quot;risk-neutral measure&quot; when modelling interest rates?  Also, why do interest rate models always seem to be stated under these risk-neutral probabilities?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastEditorUserId="6866" LastEditDate="2015-06-05T14:00:11.263" LastActivityDate="2017-02-22T12:16:30.137" Title="What's Risk-Neutral in an Interest Rate Model?" Tags="&lt;interest-rates&gt;&lt;risk-neutral-measure&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18186" PostTypeId="2" ParentId="18185" CreationDate="2015-06-05T13:58:57.123" Score="9" Body="&lt;p&gt;It is a very interesting question. There is a brief explanation in the book &lt;a href=&quot;http://www.springer.com/us/book/9783540209669&quot; rel=&quot;noreferrer&quot;&gt;Martingale methods in financial modelling&lt;/a&gt;. Basically, it says that, the interest short rate $r_t$ can be modeled in any martingale measure $Q$, however, as long as the zero-coupon bond price $P(t, T)$ is defined by &#xA;\begin{align*}&#xA;P(t, T) = E^{Q}\Big(e^{-\int_t^T r_s ds} &#xA;\mid \mathcal{F}_t\Big)&#xA;\end{align*}&#xA;then the discounted bond price $$\frac{P(t, T)}{B(t)},$$ &#xA;is a $Q-$martingale, and is arbitrage free. Here $B(t)= e^{\int_0^tr_sds}$ is the money market account value. This provides us the freedom to choose the martingale measure, and people always assume that the interest rate model is defined under the risk-neutral probability measure.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorDisplayName="user16651" LastEditDate="2015-06-29T19:58:22.327" LastActivityDate="2015-06-29T19:58:22.327" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="18187" PostTypeId="2" ParentId="17705" CreationDate="2015-06-05T14:08:16.253" Score="8" Body="&lt;p&gt;The best overview I have seen so far is this paper which lists 214 (!) factors (or anomalies if you like) on over one hundred (!) pages:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Harvey, Campbell R. and Liu, Yan and Zhu, Caroline, …and the Cross-Section of Expected Returns (February 3, 2015). Available at SSRN: &lt;a href=&quot;https://ssrn.com/abstract=2249314&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://ssrn.com/abstract=2249314&lt;/a&gt; or &lt;a href=&quot;http://dx.doi.org/10.2139/ssrn.2249314&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://dx.doi.org/10.2139/ssrn.2249314&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Abstract:      &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Hundreds of papers and hundreds of factors attempt to explain the&#xA;  cross-section of expected returns. Given this extensive data mining,&#xA;  it does not make any economic or statistical sense to use the usual&#xA;  significance criteria for a newly discovered factor, e.g., a t-ratio&#xA;  greater than 2.0. However, what hurdle should be used for current&#xA;  research? Our paper introduces a multiple testing framework and&#xA;  provides a time series of historical significance cutoffs from the&#xA;  first empirical tests in 1967 to today. Our new method allows for&#xA;  correlation among the tests as well as publication bias. We also&#xA;  project forward 20 years assuming the rate of factor production&#xA;  remains similar to the experience of the last few years. The&#xA;  estimation of our model suggests that today a newly discovered factor&#xA;  needs to clear a much higher hurdle, with a t-ratio greater than 3.0.&#xA;  Echoing a recent disturbing conclusion in the medical literature, we&#xA;  argue that most claimed research findings in financial economics are&#xA;  likely false.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;br&gt;&#xA;The authors now provide a datasheet with an exhaustive overview of all factors: &lt;a href=&quot;https://tinyurl.com/y23ozzkc&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://tinyurl.com/y23ozzkc&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;br&gt; The following chart is taken from the paper and summarizes its key results:&#xA;&lt;img src=&quot;https://i.stack.imgur.com/4BJkr.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;br&gt;&#xA;A new record! The following new paper lists and tests 452 (!) anomalies on more than 130 pages:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hou, Kewei and Xue, Chen and Zhang, Lu, Replicating Anomalies (October 2018). Review of Financial Studies, forthcoming; Fisher College of Business Working Paper No. 2017-03-010; Charles A. Dice Center Working Paper No. 2017-10. Available at SSRN: &lt;a href=&quot;https://ssrn.com/abstract=3275496&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://ssrn.com/abstract=3275496&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It indicates &quot;that most published U.S. stock market anomalies are not replicable after reasonably demoting microcaps to a very minor role, and especially after raising the threshold for significance to account for data snooping.&quot;&lt;br&gt;&#xA;Source and summary of the paper (behind a paywall):&lt;br&gt;&#xA;&lt;a href=&quot;https://www.cxoadvisory.com/29802/big-ideas/most-stock-anomalies-fake-news/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.cxoadvisory.com/29802/big-ideas/most-stock-anomalies-fake-news/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Abstract &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Most anomalies fail to hold up to currently acceptable standards for&#xA;  empirical finance. With microcaps mitigated via NYSE breakpoints and&#xA;  value-weighted returns, 65% of the 452 anomalies in our data library,&#xA;  including 96% of the trading frictions category, cannot clear the&#xA;  single test hurdle of the absolute t-value of 1.96. Imposing the&#xA;  higher, multiple test hurdle of 2.78 at the 5% significance level&#xA;  raises the failure rate to 82.1%. Even for the replicated anomalies,&#xA;  their economic magnitudes are much smaller than originally reported.&#xA;  In all, capital markets are more efficient than previously recognized.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2019-04-13T20:00:31.253" LastActivityDate="2019-04-13T20:00:31.253" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="18188" PostTypeId="1" CreationDate="2015-06-05T15:31:04.990" Score="2" ViewCount="227" Body="&lt;p&gt;Is there any online data source of ETF and/or mutual fund fees? Free or paid is fine, although hopefully there's something out there cheaper than Bloomberg&lt;/p&gt;&#xA;" OwnerUserId="5251" LastActivityDate="2015-10-13T15:11:22.887" Title="Online database of ETF &amp; Mutual Fund Fees?" Tags="&lt;data&gt;&lt;etf&gt;&lt;mutual-fund&gt;&lt;fees&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18189" PostTypeId="2" ParentId="17705" CreationDate="2015-06-05T17:26:52.870" Score="5" Body="&lt;p&gt;You have started a huge job, an enormous number of anomalies have been reported. The web site quantpedia.com has a list, here for example is their writeup on &lt;a href=&quot;http://quantpedia.com/Screener/Details/14&quot; rel=&quot;noreferrer&quot;&gt;momentum effect in stocks&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2015-06-05T17:26:52.870" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18190" PostTypeId="1" AcceptedAnswerId="18200" CreationDate="2015-06-05T17:38:24.960" Score="1" ViewCount="500" Body="&lt;p&gt;I am trying to forecast the volatility using GARCH modelling in R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I fit an ARMA(1,1)-GARCH(1,1) model, but my sigma predictions are constantly decreasing. Anybody know why?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;predict(garch1,n.ahead=63)&#xA;    meanForecast  meanError standardDeviation&#xA;1  -0.0005595252 0.02732987        0.02732987&#xA;2   0.0014640502 0.02736439        0.02732390&#xA;3   0.0001896293 0.02737454        0.02731802&#xA;4   0.0009922427 0.02737510        0.02731222&#xA;5   0.0004867674 0.02737190        0.02730651&#xA;6   0.0008051090 0.02736726        0.02730088&#xA;7   0.0006046217 0.02736210        0.02729534&#xA;8   0.0007308860 0.02735678        0.02728988&#xA;9   0.0006513664 0.02735145        0.02728450&#xA;10  0.0007014468 0.02734615        0.02727919&#xA;11  0.0006699068 0.02734093        0.02727397&#xA;12  0.0006897703 0.02733577        0.02726882&#xA;13  0.0006772605 0.02733069        0.02726375&#xA;14  0.0006851390 0.02732568        0.02725875&#xA;15  0.0006801772 0.02732074        0.02725383&#xA;16  0.0006833021 0.02731588        0.02724898&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="16419" LastEditorUserId="848" LastEditDate="2015-07-04T20:16:41.550" LastActivityDate="2015-07-04T20:16:41.550" Title="Constant decreasing volatility, GARCH forecasting" Tags="&lt;volatility&gt;&lt;r&gt;&lt;garch&gt;&lt;forecasting&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18191" PostTypeId="2" ParentId="18158" CreationDate="2015-06-05T18:18:31.047" Score="3" Body="&lt;p&gt;Deferred Revenue arises when the contract between you and your customer requires the customer to pay in advance of your delivering your products or services.  i.e. you've been paid, now you owe the customer the &lt;strong&gt;work&lt;/strong&gt;!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Accrued Expenses represent expenses for which you will be reimbursed in the future. i.e. you are or will be owed &lt;strong&gt;money&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5161" LastActivityDate="2015-06-05T18:18:31.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18192" PostTypeId="1" CreationDate="2015-06-05T18:31:14.303" Score="0" ViewCount="150" Body="&lt;p&gt;I wish to buy Matlab Home and learn to model the risks of a derivatives portfolio and then stress test it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I am guessing I will need :&lt;br&gt;&#xA;Stochastic calculus&lt;br&gt;&#xA;Linear algebra&lt;br&gt;&#xA;Stats/Probability&lt;br&gt;&#xA;Some ML algorithms?&lt;br&gt;&#xA;So is it enough to purchase Matlab Home for 149$ or I need to purchase simulink also?&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2015-09-03T21:13:12.007" Title="Do I need simulink to model the risks of an option portfolio" Tags="&lt;option-pricing&gt;&lt;risk-management&gt;&lt;matlab&gt;&lt;stress-testing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18193" PostTypeId="2" ParentId="18192" CreationDate="2015-06-05T18:53:49.660" Score="1" Body="&lt;p&gt;Well, I am not an expert in this field but I set up quite some simulation studies in Matlab and I never had to use Simulink before.&lt;/p&gt;&#xA;" OwnerUserId="16249" LastActivityDate="2015-06-05T18:53:49.660" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18194" PostTypeId="1" AcceptedAnswerId="18199" CreationDate="2015-06-05T19:29:52.733" Score="1" ViewCount="712" Body="&lt;p&gt;As per &lt;a href=&quot;http://en.wikipedia.org/wiki/Black%E2%80%93Scholes_model&quot; rel=&quot;nofollow&quot;&gt;wikipedia&lt;/a&gt;&#xA;the Black Scholes assumption is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(&lt;code&gt;random walk) The instantaneous log returns of the stock price is an infinitesimal random walk with drift; more precisely, it is a geometric Brownian motion&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But later on, under section, under &lt;a href=&quot;http://en.wikipedia.org/wiki/Black%E2%80%93Scholes_model#Black.E2.80.93Scholes_in_practice&quot; rel=&quot;nofollow&quot;&gt;this section&lt;/a&gt;&#xA;to the right, there is picture and it says: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    The normality assumption of the Black–Scholes&#xA; model does not capture extreme movements such as stock market crashes.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So does it assume a normal distribution or a GBM with drift?&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2015-06-06T02:35:56.267" Title="What is the distribution assumption of the black scholes model" Tags="&lt;black-scholes&gt;&lt;brownian-motion&gt;&lt;normal-distribution&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18195" PostTypeId="1" CreationDate="2015-06-05T19:31:37.653" Score="1" ViewCount="26" Body="&lt;p&gt;For every day in a year, I have the return on an asset and the CAPM estimation for the return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to measure the average difference between the set of returns and set of estimations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far, I have applied Chi Squared but I want to use other measurements as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anything equivalent to Chi_Squared which is normally used for measuring the difference between returns and estimations of a financial model?&lt;/p&gt;&#xA;" OwnerUserId="16447" LastActivityDate="2015-06-08T09:14:45.180" Title="Measure difference between estimations and historic returns" Tags="&lt;returns&gt;&lt;models&gt;&lt;capm&gt;&lt;estimation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18197" PostTypeId="1" CreationDate="2015-06-05T21:41:56.307" Score="3" ViewCount="1848" Body="&lt;p&gt;Consider a general multidimensional market model in which each of $m$ stocks is driven by $d$ Brownian motions (as in Shreve II, p. 226), viz.&#xA;$$&#xA;dS_i/S_i = \alpha_i dt + \sum_{j=1}^d \sigma_{ij}dW_j, \qquad i=1,\ldots,m,&#xA;$$&#xA;where each $W_j$ is independent of the others.  We could write this as a vector equation as&#xA;$$&#xA; dS/S = \alpha dt + A dW&#xA;$$&#xA;where $S = (S_1,\ldots,S_m)^T$, $\alpha = (\alpha_1,\ldots,\alpha_m)^T$, $dW = (dW_1,\ldots,dW_m)^T$ and&#xA;$$&#xA;A = &#xA;\begin{pmatrix}&#xA;\sigma_{11} &amp;amp; \ldots &amp;amp; \sigma_{1d} \\&#xA;\vdots &amp;amp; \ddots &amp;amp; \\&#xA;\sigma_{m1} &amp;amp; \ldots &amp;amp; \sigma_{md}&#xA;\end{pmatrix}.&#xA;$$&#xA;I've seen $A$ called the &quot;volatility matrix,&quot; for obvious reasons.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, I've also seen (similar to eqn (1) &lt;a href=&quot;http://www.wilmott.com/pdfs/120201_rainbow.pdf&quot; rel=&quot;nofollow&quot;&gt;in this article&lt;/a&gt;) a multidimensional market model posed in matrix-vector form as&#xA;$$&#xA;dS/S = \alpha dt + B dW,&#xA;$$&#xA;where again each component of $W$ is independent of the rest.  The difference is the matrix $B$ is called the &quot;square root of the covariance matrix $\Sigma$&quot; in the article above, and they state that it is &quot;...typical to take $B$ to be the Cholesky decomposition matrix of $\Sigma$,&quot; i.e., $BB^T = \Sigma$ where $B$ is lower triangular.  Note here that the authors implicitly assume $m=d$ in the notation above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;First question:&lt;/strong&gt; I assume by &quot;covariance matrix&quot; we mean $\Sigma_{i,j} = Cov(R_i, R_j)$ where $R_i = \log\left(S_i(t) / S_i(0)\right)$ are the log returns.  Is this correct?  If so, there seems to be a factor of $t$ missing somewhere between the two model statements.  As a concrete example, let $m=d=2$ an consider &lt;em&gt;any&lt;/em&gt; square root of the matrix $\Sigma$ (not necessarily a lower triangular one).  Then in the first model&#xA;$$&#xA;A = &#xA;\begin{pmatrix}&#xA;\sigma_{11} &amp;amp; \sigma_{12} \\&#xA;\sigma_{21} &amp;amp; \sigma_{22}&#xA;\end{pmatrix}&#xA;$$&#xA;and in the second&#xA;$$&#xA;\Sigma = &#xA;\begin{pmatrix}&#xA;Var(R_1) &amp;amp; Cov(R_1,R_2) \\&#xA;Cov(R_2,R_1) &amp;amp; Var(R_2)&#xA;\end{pmatrix}&#xA;= t&#xA;\begin{pmatrix}&#xA;\sigma_{11}^2 + \sigma_{12}^2 &amp;amp; \sigma_{11}\sigma_{21} + \sigma_{12}\sigma_{22} \\&#xA;\sigma_{11}\sigma_{21} + \sigma_{12}\sigma_{22} &amp;amp; \sigma_{21}^2 + \sigma_{22}^2&#xA;\end{pmatrix}.&#xA;$$&#xA;If the two model statements are consistent, then I would expect $AA^T = \Sigma$, but in fact $AA^T = \frac{1}{t}\Sigma$.  So, by &quot;covariance matrix&quot; do we really mean $\Sigma_{ij} = \frac{1}{t}Cov(R_i,R_j)$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Second question:&lt;/strong&gt;  In the example above, $A$ was indeed a square root of the matrix $\Sigma$ where $\Sigma_{ij} = \frac{1}{t}Cov(R_i,R_j)$, and this seemed like the obvious choice for $A$ (at least to me).  But the authors of the article state $A$ could be taken to be lower triangular, which means stock $i$ is driven by only $i$ Brownian motions.  This seems like an extra restriction on the general model, where each stock is driven by some linear combination of &lt;em&gt;all&lt;/em&gt; the Brownian motions.  So, is taking the &quot;volatility&quot; matrix to be lower triangular an extra restriction?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastEditorUserId="6866" LastEditDate="2015-06-05T22:40:21.797" LastActivityDate="2015-06-06T10:53:20.927" Title="Covariance Matrix vs. Volatility Matrix" Tags="&lt;modeling&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18198" PostTypeId="2" ParentId="3831" CreationDate="2015-06-06T00:45:34.037" Score="3" Body="&lt;p&gt;Here is another Credit Default Swap database which is rather extensive, &lt;a href=&quot;http://www.datagrapple.com/&quot; rel=&quot;nofollow&quot;&gt;daily spreads of roughly 700 entities starting in 2006&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="16457" LastActivityDate="2015-06-06T00:45:34.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18199" PostTypeId="2" ParentId="18194" CreationDate="2015-06-06T02:35:56.267" Score="1" Body="&lt;p&gt;In the Black-Scholes framework, we assume the &lt;strong&gt;log&lt;/strong&gt; returns are normally distributed. This is equal to saying the underlying is log-normally distributed. If you look at Geometric Brownian Motion on wikipedia, you'll see this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;The above solution  S_t  (for any value of t) is a **log-normally distributed** random variable&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The wikipedia is correct.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2015-06-06T02:35:56.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18200" PostTypeId="2" ParentId="18190" CreationDate="2015-06-06T03:40:54.217" Score="1" Body="&lt;p&gt;Garch models are not good to predict &quot;many&quot; periods ahead, but for &quot;very short&quot; times.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to predict 2 months from here, maybe you should be working with monthly data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did a similar exercise with some indexes (&lt;code&gt;symb=c(&quot;^BVSP&quot;,&quot;^MERV&quot;,&quot;^DJA&quot;,&quot;^N225&quot;)&lt;/code&gt;) using daily returns &lt;code&gt;from=&quot;1991/01/01&quot;&lt;/code&gt;, look the incredible predictions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/u5KfF.png&quot; alt=&quot;enter image description here&quot;&gt; &#xA;&lt;img src=&quot;https://i.stack.imgur.com/iuz2D.png&quot; alt=&quot;enter image description here&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/M3rzG.png&quot; alt=&quot;enter image description here&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/eYN18.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="13571" LastActivityDate="2015-06-06T03:40:54.217" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18201" PostTypeId="1" AcceptedAnswerId="18207" CreationDate="2015-06-06T03:56:33.570" Score="13" ViewCount="16407" Body="&lt;p&gt;Look at &lt;a href=&quot;http://finance.yahoo.com/echarts?s=SPY%20Interactive#%7B%22comparisons%22:%22%5EGSPC%22,%22comparisonsColors%22:%22#cc0000%22,%22comparisonsWidths%22:%221%22,%22comparisonsGhosting%22:%220%22,%22range%22:%221mo%22%7D&quot;&gt;SPY vs ^GSPC&lt;/a&gt; -- the difference seems bigger than can be explained by the ETF fees. Is it only because of SPY re-invests dividends quarterly or something else? Since &lt;code&gt;^GSPC&lt;/code&gt; is a total return index, it should be replicable in principle, correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, Yahoo reports a &lt;a href=&quot;http://finance.yahoo.com/q/hp?s=%5EGSPC+Historical+Prices&quot;&gt;huge volume for &lt;code&gt;^GSPC&lt;/code&gt;&lt;/a&gt;, how is this calculated?&lt;/p&gt;&#xA;" OwnerUserId="7887" LastEditorUserId="7887" LastEditDate="2015-06-06T04:16:33.283" LastActivityDate="2018-11-06T16:10:22.877" Title="Why the difference between SPY and ^GSPC?" Tags="&lt;data&gt;&lt;index&gt;&lt;etf&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18202" PostTypeId="2" ParentId="18197" CreationDate="2015-06-06T09:43:13.747" Score="2" Body="&lt;p&gt;1) People usually consider an instantaneous covariance while you are considering a integrated covariance. In a model &#xA;$$&#xA;  dS_t = S_t \cdot (\alpha(t)dt + A(t)dW_t) &#xA;$$&#xA;the integrated covariance of log-returns is simply the integral over time of the instantaneous covariance: &#xA;$$&#xA;  Cov(R_i(t),R_j(t)) = (i,j)\textrm{-coeff. of} \int_0^t \underbrace  {A(s)A(s)^\top}_{\Sigma_{ij}(s)} ds&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) This is not a restriction since the law of the process is the same (this is  just a change of coordinates of the driving brownian motion). From a modelling point of view, volatility (or correlation) is not what matters because it is never observed. Only (co)variance is. &lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2015-06-06T10:53:20.927" LastActivityDate="2015-06-06T10:53:20.927" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="18204" PostTypeId="2" ParentId="7728" CreationDate="2015-06-06T12:45:08.547" Score="1" Body="&lt;p&gt;I think that this code solves your problems. In your case h0 is zero while lag can be set equal to 6 (or 5)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;function y=NWtest(ret,lag,h0)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;T=size(ret,1);&#xA;vv=var(ret);&#xA;&#xA;for l=1:1:lag&#xA;&#xA;    cc=cov(ret(1:end-l),ret(l+1:end));&#xA;    vv=vv+2*(1-l/lag)*cc(1,2);&#xA;end&#xA;&#xA;y=(mean(ret)-h0)/sqrt(vv)*sqrt(T);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;end&lt;/p&gt;&#xA;" OwnerUserId="16458" LastActivityDate="2015-06-06T12:45:08.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18206" PostTypeId="1" CreationDate="2015-06-06T13:17:01.167" Score="1" ViewCount="1007" Body="&lt;p&gt;I want to calculate a bandwith rebalancing machanism for a portfolio of two assets. As soon as the performance of one ov the assets gets bigger or smaller than the other one + a defined tolerance level, one starts a recalculation of the relative value from that point of time on. The code explained below tries to do exactly that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below you find the code I wrote to calculate a relative change in value of df.a and df.b while df is a dataframe. What has to be calculated is basically &lt;code&gt;df[&quot;c&quot;] = df.a/df.a.iloc[df.d].values&lt;/code&gt;. df.d is set equal to df.t if &lt;code&gt;df.a/df.a.iloc[df.d].values&lt;/code&gt; is bigger or smaller than &lt;code&gt;df.b/df.b.iloc[df.d].values * (1+ tolerance)&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that the code currently brings the following error code: &lt;code&gt;ValueError: ('The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().', u'occurred at index 2011-01-01 00:00:00')&lt;/code&gt;and I absolutely don't know why... &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import pandas as pd&#xA;import numpy as np&#xA;import datetime&#xA;&#xA;randn = np.random.randn&#xA;rng = pd.date_range('1/1/2011', periods=10, freq='D')&#xA;&#xA;df = pd.DataFrame({'a': [1.1, 1.2, 2.3, 1.4, 1.5, 1.8, 0.7, 1.8, 1.9, 2.0], 'b': [1.1, 1.5, 1.3, 1.6, 1.5, 1.1, 1.5, 1.7, 2.1, 2.1],'c':[None] * 10},index=rng)&#xA;&#xA;df[&quot;t&quot;]= np.arange(len(df))&#xA;tolerance = 0.3&#xA;&#xA;def set_t(x):&#xA;    if df.a/df.a.iloc[df.d].values &amp;lt; df.b/df.b.iloc[df.d].values * (1+tolerance):&#xA;        return  df.iloc[df.index.get_loc(x.name) - 1]['d'] == df.t&#xA;    elif df.a/df.a.iloc[df.d].values &amp;gt; df.b/df.b.iloc[df.d].values * (1+tolerance):&#xA;        return df.iloc[df.index.get_loc(x.name) - 1]['d'] == df.t&#xA;&#xA;&#xA;df['d'] = df.apply(set_t, axis =1)&#xA;&#xA;#df[&quot;d&quot;]= [0,0,0,3,3,3,6,7,7,7] this should be the coutcome for d&#xA;&#xA;df[&quot;c&quot;] = df.a/df.a.iloc[df.d].values &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The desired outcome looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;              a    b         c  d  t&#xA;2011-01-01  1.1  1.1  1.000000  0  0&#xA;2011-01-02  1.2  1.5  1.090909  0  1&#xA;2011-01-03  2.3  1.3  2.090909  0  2&#xA;2011-01-04  1.4  1.6  1.000000  3  3&#xA;2011-01-05  1.5  1.5  1.071429  3  4&#xA;2011-01-06  1.8  1.1  1.285714  3  5&#xA;2011-01-07  0.7  1.5  1.000000  6  6&#xA;2011-01-08  1.8  1.7  1.000000  7  7&#xA;2011-01-09  1.9  2.1  1.055556  7  8&#xA;2011-01-10  2.0  2.1  1.111111  7  9&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any ideas how to solve that?&lt;/p&gt;&#xA;" OwnerUserId="16404" LastActivityDate="2015-09-27T19:06:46.613" Title="bandwith portfolio rebalancing in python" Tags="&lt;portfolio&gt;&lt;python&gt;&lt;rebalancing&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18207" PostTypeId="2" ParentId="18201" CreationDate="2015-06-06T18:12:27.923" Score="18" Body="&lt;p&gt;^GSPC is a price index, not a total return index, so it does not include dividends.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;SPY is an ETF that holds the underlying stocks. When it receives a dividend it keeps it in a cash account (which of course affects the NAV and market value of SPY shares) until the end of the quarter. At that time (on the 3d friday of Mar Jun Sep or Dec) it will pay out the cash to SPY shareholders. The cash account is now empty and the process repeats for the next quarter. So there is a periodic build up and then disbursal (not reinvestment!) of dividends.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2015-06-06T18:26:55.860" LastActivityDate="2015-06-06T18:26:55.860" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18208" PostTypeId="1" CreationDate="2015-06-07T09:30:33.397" Score="6" ViewCount="3654" Body="&lt;p&gt;For a vanilla European call, my Monte Carlo method gives the right option price and delta but the wrong gamma. In particular, the value of gamma varies wildly each time I run the method. I estimate gamma by&#xA;$$ &#xA;\Gamma = \frac{C(S+\Delta S,K,T,\sigma,r) - 2C(S,K,T,\sigma,r) + C(S-\Delta S,K,T,\sigma,r)}{(\Delta S)^2}&#xA;$$&#xA;Here's my Matlab code. Could anyone tell me what I'm doing wrong? Thanks.&#xA;&lt;img src=&quot;https://i.stack.imgur.com/q8hpu.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="16463" LastActivityDate="2020-08-27T01:28:52.347" Title="Greeks: Why does my Monte Carlo give correct delta but incorrect gamma?" Tags="&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;hedging&gt;&lt;delta&gt;&lt;gamma&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18210" PostTypeId="1" CreationDate="2015-06-07T12:38:08.147" Score="1" ViewCount="229" Body="&lt;p&gt;I did some analysis for CAC 40, the French market benchmark, for the period 2005-2014, and I tried to fit the data with a GJR(1,1) model in MATLAB. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then some warning showed &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Lower bound constraints are active; standard errors may be inaccurate.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and the ARCH coefficient is disappeared in the parameters, I guess it may be the reason that the ARCH coefficient is not necessary in the GJR model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I tried another method, MCMC method and get the estimation for ARCH coefficient: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mu$ = 0.004222282 (considered as an approximation of the true value);&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma$ = 0.003775541;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They are in the same scalar and, so, it can explain that this coefficient is insignificant in the model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But is there any method we can do a test to show that the ARCH coefficient is not necessary in the model? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="15201" LastEditorUserId="2553" LastEditDate="2015-06-10T13:34:48.590" LastActivityDate="2015-06-10T13:34:48.590" Title="How to decide if the ARCH coefficient is necessary in the GJR-GARCH model?" Tags="&lt;garch&gt;&lt;econometrics&gt;&lt;matlab&gt;&lt;arch&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18211" PostTypeId="2" ParentId="18208" CreationDate="2015-06-07T14:20:49.510" Score="2" Body="&lt;p&gt;It's a combination of too few sample paths and/or too small an increment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your estimation error on the price is magnified by the $dS^2$. Try using a larger sample or a larger increment. Alternatively, you can use a multiplier instead of a fixed increment; in my experience, it usually yields better results.&lt;/p&gt;&#xA;" OwnerUserId="15336" LastActivityDate="2015-06-07T14:20:49.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18213" PostTypeId="2" ParentId="17273" CreationDate="2015-06-07T15:24:32.090" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://finance.bi.no/~bernt/gcc_prog/recipes/recipes/img169.png&quot; rel=&quot;nofollow&quot;&gt;http://finance.bi.no/~bernt/gcc_prog/recipes/recipes/img169.png&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;let $q t$ be big (t goes to infinity where q is the yield) and you will see why . The first part of the BS formula becomes zero. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also in accordance to put call parity,  the call must be worth zero if the entire stock price has been paid out in dividends:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Put%E2%80%93call_parity&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Put%E2%80%93call_parity&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dividends cause the stock price to call so if you pay out enough of them the price will be zero, hence C=0.  If r&gt;d then you must discount your dividends. (A 1% dividend isn't so great when the risk-free interest is 10%) If d&gt;r then the dividends erode the call price more then interest boosts stock prices. Eventually you have a situation where r=d(discounted dividend). If d&gt;r you can intuitively see how dividends would make calls worthless.   When d=r it's harder to visualize, but consider 'interest' causes the price to be boosted by p(1+r) and then dividends cause it to fall p(1-d) so you have p=p(1+r)(1-d) since d=r and if you repeat this 100 or so times the (1-d^2)^100 part goes to zero and the expected value of the stock as time goes to infinity is zero. If r&gt;d the discounting process on the dividend makes the above relation hold.&lt;/p&gt;&#xA;" OwnerUserId="15081" LastEditorUserId="15081" LastEditDate="2015-06-07T16:22:32.367" LastActivityDate="2015-06-07T16:22:32.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18214" PostTypeId="2" ParentId="17917" CreationDate="2015-06-07T19:58:48.320" Score="1" Body="&lt;p&gt;an up and out call involves an absorbing barrier. There is no pricing formula with a reflective barrier.  &lt;/p&gt;&#xA;" OwnerUserId="15081" LastActivityDate="2015-06-07T19:58:48.320" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18215" PostTypeId="1" CreationDate="2015-06-07T20:29:01.900" Score="52" ViewCount="132781" Body="&lt;p&gt;I am looking for long time historical intraday day data on the S&amp;amp;P500  composite for a time horizon like 10 years with a - for example 10-minutes tick - or prices for call/put options on the S&amp;amp;P500 index itself. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I tried so far:&#xA;I checked Bloomberg Terminal and also contacted their Help Desk. They do have intraday data, but not on such a long time basis. They do offer 140 days to export to Excel and 240 days to view in terminal. That's it.&#xA;I also checked Datastream 5.1, but they don't seem to offer intraday data at all...&#xA;I am familiar with the Oxford-Man database, which is pretty nice, but I do need the raw data. I already saw the OptionMetrics database, is there any alternative? Maybe Macrobond?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering whether or not someone has any idea where to get such data from, any tips are highly welcome!&lt;/p&gt;&#xA;" OwnerUserId="16466" LastEditorUserId="15763" LastEditDate="2015-08-11T18:27:03.633" LastActivityDate="2020-04-22T15:02:04.930" Title="Where to get long time historical intraday data?" Tags="&lt;market-data&gt;&lt;historical-data&gt;" AnswerCount="13" CommentCount="0" FavoriteCount="48" ContentLicense="CC BY-SA 3.0" />
  <row Id="18216" PostTypeId="1" AcceptedAnswerId="18222" CreationDate="2015-06-07T22:51:52.803" Score="2" ViewCount="224" Body="&lt;p&gt;It is common knowledge that a random walk can be represented in the form of a binomial process. Is it possible to represent any generic stochastic process (including non-linear) of the form $dX=adt+bdW(t)$ (where $W(t)$ is a Wiener process) as a binomial process? Are there any papers which have dealt with this topic?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="16467" LastEditorUserId="16467" LastEditDate="2015-06-07T22:57:57.297" LastActivityDate="2015-06-08T19:51:50.480" Title="Binomial representation of stochastic processes" Tags="&lt;stochastic-processes&gt;&lt;binomial-tree&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18217" PostTypeId="1" CreationDate="2015-06-07T22:55:37.443" Score="2" ViewCount="110" Body="&lt;p&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am a bit confused about the formulation of the EGARCH(1,1) model.&lt;br&gt;&#xA;First, we have the error term: $\epsilon_t=\sigma_t*\zeta_t$, where $\zeta_t$ is white noise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the EGARCH(1,1) should be:&lt;br&gt;&#xA;$$&#xA;log(\sigma_t^2)=w+\alpha_1*log(\sigma_{(t-1)}^2)+g(\zeta_t)  &#xA;$$&#xA;but instead I always see $g(\epsilon_t)$.&lt;br&gt;&#xA;does anyone know why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="16419" LastEditorUserId="16419" LastEditDate="2015-06-08T09:25:12.517" LastActivityDate="2015-06-08T09:25:12.517" Title="EGARCH formulation" Tags="&lt;garch&gt;&lt;modelling&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18219" PostTypeId="2" ParentId="18215" CreationDate="2015-06-07T23:41:18.073" Score="3" Body="&lt;p&gt;Historical intraday data for S&amp;amp;P500 going back to the 1980's is available from Tickdata.com . It is not free.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2015-06-08T00:33:42.287" LastActivityDate="2015-06-08T00:33:42.287" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18220" PostTypeId="2" ParentId="18208" CreationDate="2015-06-07T23:51:26.100" Score="10" Body="&lt;p&gt;the problem is that the pay-off has discontinuous first derivative. Try a contract with  pay-off that is twice differentiable and it will probably work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that all the value comes from the tiny number of paths within $\Delta S$ of the strike, and these paths have huge value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a well-known problem. As the bump size goes to zero, the pathwise value converges to differentiating along the path twice. Since the second derivative is a delta function, you get nonsense. A huge amount of work has gone into coping with discontinuities for the pathwise method. See eg &lt;a href=&quot;http://ssrn.com/abstract=2431580&quot;&gt;http://ssrn.com/abstract=2431580&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-06-07T23:51:26.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18221" PostTypeId="1" AcceptedAnswerId="18236" CreationDate="2015-06-08T00:46:17.467" Score="3" ViewCount="93" Body="&lt;p&gt;In his book &lt;em&gt;Risk and Asset Allocation&lt;/em&gt;, Meucci &lt;a href=&quot;http://www.symmys.com/sites/default/files/Risk%20and%20Asset%20Allocation%20-%20Springer%20Quantitative%20Finance%20-%20Optimization_0.pdf#page=19&quot; rel=&quot;nofollow&quot;&gt;writes&lt;/a&gt; (last paragraph)&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Indeed, since all the indices of satisfaction $\mathcal{S}$ discussed&#xA;  in Chapter 5 are consistent with weak stochastic dominance, for a&#xA;  given level of variance of the objective, higher expected values of&#xA;  the objective are always appreciated, no matter the functional&#xA;  expression of $\tilde{\mathcal{H}}$.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I'm trying to figure out the mathematical content/proof behind this statement. The context:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\mathbf{M} : \Omega \to \mathbb{R}^n$ be a random vector, $\mathbf{\alpha} \in \mathbb{R}^n$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Define a random variable $\mathbf{\Psi}_\mathbf{\alpha} = \mathbf{\alpha}^T \mathbf{M}$, the &lt;em&gt;objective&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\mathcal{S}(\mathbf{\alpha}) = \tilde{\mathcal{H}}(\mathrm{E}\{\mathbf{\Psi}_\mathbf{\alpha}\}, \mathrm{Var}\{\mathbf{\Psi}_\mathbf{\alpha}\})$, the &lt;em&gt;index of satisfaction&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover assume that $\mathcal{S}$ is consistent with weak stochastic dominance, ie.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbf{\Psi}_\mathbf{\alpha} \leq_{\mathrm{weak}} \mathbf{\Psi}_\mathbf{\beta} \Rightarrow \mathcal{S}(\mathbf{a}) \leq \mathcal{S}(\mathbf{b})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I feel that Meucci is saying that if $\mathrm{Var}\{\mathbf{\Psi}_\mathbf{\alpha}\} = \mathrm{Var}\{\mathbf{\Psi}_\mathbf{\beta}\}$ and $\mathrm{E}\{\mathbf{\Psi}_\mathbf{\alpha}\} \leq \mathrm{E}\{\mathbf{\Psi}_\mathbf{\beta}\}$ then $\mathbf{\Psi}_\mathbf{\alpha} \leq_{\mathrm{weak}} \mathbf{\Psi}_\mathbf{\beta}$. But this isn't true.&lt;/p&gt;&#xA;" OwnerDisplayName="user16469" LastEditorDisplayName="user16469" LastEditDate="2015-06-08T20:39:52.347" LastActivityDate="2015-06-09T03:18:36.260" Title="Higher expected value and same variance implies weak dominance?" Tags="&lt;portfolio-management&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18222" PostTypeId="2" ParentId="18216" CreationDate="2015-06-08T05:37:03.653" Score="4" Body="&lt;p&gt;For a martingale $dX=a(X,t)\,dt+b(X,t) dW(t)$ where $a$ and $b$ are not constant, your tree &lt;strong&gt;will not recombine&lt;/strong&gt; in general [edit]. This is the main issue. See for instance: Florescu, I. and F. G. Viens (2008, March). Stochastic volatility: &lt;a href=&quot;http://www.stat.purdue.edu/~viens/publications/old/quatrtree7.pdf&quot; rel=&quot;nofollow&quot;&gt;Option pricing using a multinomial recombining tree. Applied Mathematical Finance 15 (2), 151-181&lt;/a&gt;. It deals with the case of &lt;strong&gt;stochastic volatility&lt;/strong&gt;, i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS=aS\,dt+b(Y_t)S dW(t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dY=\alpha(\nu − Y_t)dt + \psi(Y_t)dZ(t)$&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2015-06-08T19:51:50.480" LastActivityDate="2015-06-08T19:51:50.480" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18224" PostTypeId="2" ParentId="18217" CreationDate="2015-06-08T09:06:59.203" Score="2" Body="&lt;p&gt;Just a quick fix. Looking at the &lt;a href=&quot;http://en.wikipedia.org/wiki/Autoregressive_conditional_heteroskedasticity#EGARCH&quot; rel=&quot;nofollow&quot;&gt;wikipedia entry&lt;/a&gt; of EGARCH: $g(\zeta_t)$ (the unit-scale random variable) seems correct - as you say.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-06-08T09:06:59.203" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18225" PostTypeId="2" ParentId="18195" CreationDate="2015-06-08T09:14:45.180" Score="1" Body="&lt;p&gt;You can apply the &lt;a href=&quot;http://en.wikipedia.org/wiki/Kolmogorov%E2%80%93Smirnov_test&quot; rel=&quot;nofollow&quot;&gt;Kolmogorov-Smirnov test&lt;/a&gt;. I simply quote from the entry: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;The two-sample K–S test is one of the most useful and general nonparametric methods for comparing two samples, as it is sensitive to differences in both location and shape of the empirical cumulative distribution functions of the two samples.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is an &lt;a href=&quot;https://stat.ethz.ch/R-manual/R-devel/library/stats/html/ks.test.html&quot; rel=&quot;nofollow&quot;&gt;R-implementation&lt;/a&gt; too.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-06-08T09:14:45.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18228" PostTypeId="1" CreationDate="2015-06-08T13:12:44.703" Score="1" ViewCount="136" Body="&lt;p&gt;Having read a chapter in Bodie, Kane and Marcus' Investment, I came across a formula I do not quite understand. It states that the percentage fee in excess of what an index fund would charge on active management of an optimal portfolio is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f = \frac{1}{2A}\sum_{i=1}^{n} \left[\frac{\alpha_{i}}{\sigma(e_{i})}\right]^2.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When applying the formula to the following question, I can not seem to get the correct answer:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;One mutual fund has a team of analysts that performs security&#xA;  analysis. They are able to produce forecasts of annual alphas of 1%,&#xA;  on average, in a universe of 100 stocks with an accuracy of 5%&#xA;  (measured in terms of r-square). The standard deviation of the&#xA;  residuals is 6%. The assets under management of the fund are&#xA;  $50,000,000. What is the amount of fees the fund can charge from a&#xA;  mean-variant investor with a risk aversion of 3 (in excess of a&#xA;  passive index fund)?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;A few things I can immediately deduce is the value of $A$. It then becomes quite ambiguous. I am assuming that the $i$'s of the alpha's and standard deviation of residuals correspond to stocks in the active portfolio. However, what am I exactly summing here? I only have one value for alpha, and it seems that it is representative of the whole universe of stocks. Any help would be greatly appreciated. It seems that the answer is &quot;$57,870,37&quot;. As you can see, there is a typo in the answer which makes matters worse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you to all in advanced for you help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gus. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After a tiring amount of trial and error I have come to a solution I do not understand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f=\frac{1}{2\cdot3}\cdot 100 \cdot \left[\frac{1\%\cdot \frac{5}{10}}{6\%}\right]^{2}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why multiply the alpha by $\frac{5}{10}$?.&lt;/p&gt;&#xA;" OwnerUserId="13726" LastEditorUserId="13726" LastEditDate="2015-06-09T01:45:53.250" LastActivityDate="2015-06-09T12:22:55.337" Title="Calculating Fees (Kane, Marcus, and Trippi)" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;fees&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18229" PostTypeId="2" ParentId="18216" CreationDate="2015-06-08T14:20:56.967" Score="1" Body="&lt;p&gt;Yes, this is trivially true once you know that &lt;a href=&quot;https://fabricebaudoin.wordpress.com/2012/09/27/lecture-23-time-changed-martingales-and-planar-brownian-motion/&quot; rel=&quot;nofollow&quot;&gt;every continuous local martingale is a time-changed brownian motion&lt;/a&gt;.  Therefore, if you change your time variable $t$ in $dX=a\,dt+b\,dW(t)$ to the right $t^\prime$ you can get a standard tree representation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, the correct time change may be difficult or impossible to figure out, so this theorem is of limited use.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One then becomes tempted to try making a tree adapted to the original SDE.  As @lehalle notes, you are then likely to end up with a tree that does not recombine.  You may be able to overcome that flaw by interpolating nodes &lt;em&gt;back&lt;/em&gt; onto a recombined tree and applying some reasonable boundary conditions, but at that point most people just go with PDE solvers instead.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2015-06-08T14:20:56.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18232" PostTypeId="2" ParentId="18215" CreationDate="2015-06-08T19:50:35.120" Score="3" Body="&lt;p&gt;Every exchange in North America sells their historical data.  NYSE and Nasdaq are the one's I'm most familiar with.  They will sell you the data on a one off instance, ie no monthly fees, just a single flat rate.&lt;/p&gt;&#xA;" OwnerUserId="743" LastActivityDate="2015-06-08T19:50:35.120" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18233" PostTypeId="1" CreationDate="2015-06-08T20:02:05.190" Score="1" ViewCount="24" Body="&lt;p&gt;we learn a lot about finite and infinite horizon control in dynamic programming. but I was wondering if we want to minimize the cost per time(discrete time) is there any work to find the optimum size of the horizon. Specially in the case of stochastic control with stochastic demand where we sample from the demand distribution to build the controller?&lt;/p&gt;&#xA;" OwnerUserId="818" LastActivityDate="2015-06-08T20:02:05.190" Title="Is there any theoretical work to find an optimum size for the size of horizon in finite-horizon optimization or control?" Tags="&lt;programming&gt;&lt;stochastic-processes&gt;&lt;optimization&gt;&lt;dynamic&gt;&lt;stochastic-control&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18234" PostTypeId="2" ParentId="18208" CreationDate="2015-06-08T20:47:11.780" Score="1" Body="&lt;p&gt;consider adjoint algorithmic differentiation to get an exact derivative here. Works especially well for monte carlo. Here is an example paper: &lt;a href=&quot;http://luca-capriotti.net/pdfs/Finance/jcf_capriotti_press_web.pdf&quot; rel=&quot;nofollow&quot;&gt;http://luca-capriotti.net/pdfs/Finance/jcf_capriotti_press_web.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1105" LastActivityDate="2015-06-08T20:47:11.780" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18235" PostTypeId="2" ParentId="18221" CreationDate="2015-06-08T21:18:39.663" Score="1" Body="&lt;p&gt;I think I figured it out. In an earlier paragraph Meucci says&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Suppose that we can focus on the two first moments only and neglect&#xA;  all the higher moments.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So two random variables are equivalent if their first two moments agree. Therefore any random variable can be replaced by $\mathcal{U}(\mu - \sqrt{3}\sigma, \mu + \sqrt{3}\sigma)$ as far as $\mathcal{S}$ is concerned.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By looking at the cdf below, it is clear that&#xA;$$\mathcal{U}(\mu_1 - \sqrt{3}\sigma, \mu_1 + \sqrt{3}\sigma) \leq_\mathrm{weak} \mathcal{U}(\mu_2 - \sqrt{3}\sigma, \mu_2 + \sqrt{3}\sigma)$$&#xA;when $\mu_1 \leq \mu_2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/r4mJn.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user16469" LastActivityDate="2015-06-08T21:18:39.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18236" PostTypeId="2" ParentId="18221" CreationDate="2015-06-08T21:20:17.000" Score="1" Body="&lt;p&gt;This is because the author has assumed the approximation (6.67)&#xA;$$\mathcal{S}(\alpha)\approx   \tilde{\mathcal{H}} (\mathrm{E}\{\Phi_\alpha\},\mathrm{Var}\{\Phi_\alpha\})$$&#xA;That is, the index of satisfaction $\mathcal{S}(\alpha)$ depends only on&#xA;the first two moments of the marginals. As explained by the author in section&#xA;6.5.1, this is a good approximation because in a wide range of applications,&#xA;the market $\mathbf M$ is &lt;em&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Elliptical_distribution&quot; rel=&quot;nofollow&quot;&gt;elliptically distributed&lt;/a&gt;&lt;/em&gt;&#xA;(see (6.126)). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One important example is &#xA;$$&#xA;\mathbf{M}\sim \mathcal{N}(\boldsymbol\mu,\,\boldsymbol\Sigma)&#xA;$$&#xA;where $\mathcal{N}$ is the &lt;a href=&quot;http://en.wikipedia.org/wiki/Multivariate_normal_distribution&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;multivariate&lt;/em&gt; Gaussian distribution&lt;/a&gt;&#xA;with mean $\boldsymbol \mu$ and covariance matrix $\boldsymbol \Sigma$. In&#xA;this case, if $\mathrm{Var}(\boldsymbol \Psi_\alpha)=\mathrm{Var}(\boldsymbol\Psi_\beta)$&#xA;and $\mathrm{E}[\boldsymbol \Psi_\alpha]\le\mathrm{E}[\boldsymbol\Psi_\beta]$,&#xA;then indeed we have weak stochastic dominance, i.e. for all $t\in \mathbb{R}$,&#xA;$$ &#xA;P\{\boldsymbol\Psi_\alpha\le t\}=\int_{-\infty}^t \frac{1}{\sigma\sqrt{2\pi}}\,&#xA;e^{-\frac{(x - \mu_1)^2}{2 \sigma^2}}dx\ge\int_{-\infty}^t\frac{1}{\sigma\sqrt{2\pi}}\,&#xA;e^{-\frac{(x - \mu_2)^2}{2 \sigma^2}}dx= P\{\boldsymbol\Psi_\beta\le t\}&#xA;$$&#xA;where $\sigma^2=\mathrm{Var}(\boldsymbol \Psi_\alpha)=\mathrm{Var}(\boldsymbol\Psi_\beta)=\boldsymbol\alpha^T\boldsymbol&#xA;\Sigma\boldsymbol\alpha=  \boldsymbol\beta^T\boldsymbol \Sigma \boldsymbol&#xA;\beta$, $\mu_1=\mathrm{E}[\boldsymbol \Psi_\alpha]=\boldsymbol \alpha^T\mathrm{E}[\boldsymbol\Psi]$,&#xA;and $\mu_2=\mathrm{E}[\boldsymbol \Psi_\beta]=\boldsymbol \beta^T\mathrm{E}[\boldsymbol\Psi]$. (Recall that we say $\boldsymbol \Psi_\alpha\le_{\mathrm{weak}} \boldsymbol \Psi_\beta$ if $$P\{\boldsymbol\Psi_\alpha\le t\}\ge P\{\boldsymbol\Psi_\beta\le t\}$$ — the inequality is reversed — see (5.35).)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reasoning for a general elliptic distribution is similar. &#xA;We will show that&#xA;the distribution functions of  $\boldsymbol \Psi_\alpha$ and $\boldsymbol&#xA;\Psi_\beta$ are translates of each other.  Since $\mathbf{M}  $ is elliptically&#xA;distributed, its characteristic function  $\varphi_{\mathbf{M } }$ is of&#xA;the form &#xA;$$&#xA;\varphi_{\mathbf{M } }( \boldsymbol t) =  e^{i \boldsymbol t^T\boldsymbol\mu}&#xA;\chi(\boldsymbol t^T\boldsymbol\Sigma&#xA;\boldsymbol t)&#xA;$$for some  $\boldsymbol\mu \in \mathbb{R}^N$,&#xA;positive-definite matrix $\boldsymbol\Sigma$, and characteristic function&#xA;$\chi$. Hence, for any $\boldsymbol \alpha \in \mathbb{R}^N$, the characteristic&#xA;function $\varphi_{\boldsymbol \Psi_\alpha}$ of  $\boldsymbol \Psi_\alpha=\boldsymbol\alpha^T&#xA;\mathbf{M}$ is&#xA;$$&#xA;\varphi_{\boldsymbol&#xA;\Psi_\alpha}(t)=\varphi_{\mathbf{M } }(t\boldsymbol\alpha)=  e^{it\boldsymbol&#xA;\alpha^T\boldsymbol\mu} \chi(t^2 \boldsymbol\alpha^T\boldsymbol\Sigma \boldsymbol&#xA;\alpha) &#xA;$$ &#xA;After calculating the derivatives of  $\varphi_{\boldsymbol&#xA;\Psi_\alpha}$, we find that &#xA;$$&#xA;E[\boldsymbol\Psi_\alpha ] =\boldsymbol\alpha^T\boldsymbol\mu &#xA;$$&#xA;and &#xA;$$&#xA;\mathrm{Var}(\boldsymbol\Psi_\alpha)=2\boldsymbol\alpha^T \boldsymbol\Sigma&#xA;\boldsymbol\alpha\chi&#xA;   '(0)   &#xA;$$&#xA;Thus, if $\mathrm{Var}(\boldsymbol\Psi_\alpha)=\mathrm{Var}(\boldsymbol\Psi_\beta)$,&#xA;then $\boldsymbol\alpha^T \boldsymbol\Sigma&#xA;\boldsymbol\alpha=\boldsymbol\beta^T \boldsymbol\Sigma\boldsymbol\beta$.&#xA;Therefore,   $$&#xA;  \varphi_{\boldsymbol&#xA;\Psi_\beta}(t) =e^{it(\boldsymbol \beta^T\boldsymbol\mu-\boldsymbol \alpha^T\boldsymbol\mu)}\varphi_{\boldsymbol&#xA;\Psi_\alpha}(t) &#xA;$$which implies that&#xA;$$&#xA;f_{\boldsymbol&#xA;\Psi_\beta}(x)=f_{\boldsymbol&#xA;\Psi_\alpha}(x-(\boldsymbol \beta^T\boldsymbol\mu-\boldsymbol \alpha^T\boldsymbol\mu))&#xA;$$that is, the density functions $f_{\boldsymbol&#xA;\Psi_\alpha}$ and $f_{\boldsymbol&#xA;\Psi_\beta}$ are translates of each other. Since $\boldsymbol \beta^T\boldsymbol\mu-\boldsymbol&#xA;\alpha^T\boldsymbol\mu=E[\boldsymbol\Psi_\beta ]-E[\boldsymbol\Psi_\alpha&#xA;]\ge0$ by assumption, we have shown that $\boldsymbol\Psi_\alpha\le_{\mathrm{weak}}\boldsymbol\Psi_\beta&#xA;$. &lt;/p&gt;&#xA;" OwnerUserId="16483" LastEditorUserId="16483" LastEditDate="2015-06-09T03:18:36.260" LastActivityDate="2015-06-09T03:18:36.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18237" PostTypeId="1" CreationDate="2015-06-09T00:57:32.540" Score="2" ViewCount="630" Body="&lt;p&gt;I've seen two ways to account for dilution when valuing a European option using Black Scholes. I'm not sure which is the correct way and why these methods differ. The two ways I've seen are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Multiplying the value of the warrant/option by 1/(1+q) where q is the amount of dilution (e.g. q is the number of options over basic shares plus options)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Using an adjusted share price to calculate d1, d2 and the value of the call. This adjusted share price is calculated the number of shares outstanding multiplied by the share price plus the value of the call option (as calculated by Black-Scholes) multiplied by the number of options being issued. This is then divided by the number of options being issued plus the basic shares outstanding, which gives you an adjusted diluted share price, which you then run Black-Scholes with to get the value of the diluted call option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you please advise which (if any) of these methodologies are correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks!&lt;/p&gt;&#xA;" OwnerUserId="16486" LastActivityDate="2015-06-09T00:57:32.540" Title="Black Scholes with Dilution" Tags="&lt;black-scholes&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18238" PostTypeId="2" ParentId="545" CreationDate="2015-06-09T05:26:39.160" Score="7" Body="&lt;p&gt;I just made a Genetic Algorithms calculator you can try at &lt;a href=&quot;http://www.gregthatcher.com/Stocks/GeneticAlgorithmCalculator.aspx&quot;&gt;http://www.gregthatcher.com/Stocks/GeneticAlgorithmCalculator.aspx&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not a &quot;quant expert&quot; like all of you (I'm just a programmer), but here is what I've found.&lt;br&gt;&#xA;1.) If you set the constraints up correctly, the results are amazing.  e.g. you can get portfolios that have very high return and low risk.  However, it is very important to have conflicting constraints (e.g. a parent can have many children, but the total number of children in a generation cannot go over a certain number) if you want to get good results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2.) I don't think GA is over-fitting data.  Rather, it says &quot;I have too many genes (stocks) to start with, so I'm just going to pick a few to start with, and, except for an occasional mutation, I'll stick with these.&quot;  Then, over generations, it figures out how to make the best use of what it started with, creating optimum porfolios with the &quot;genes&quot; (a.k.a) stocks it started with (plus a few mutations).  Kind of like a builder at Home Depot.  Home Depot has lots of tools, but the builder only picks a few to start.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IMHO, Genetic Algorithms are an incredible tool for solving problems that human brains can't.&lt;/p&gt;&#xA;" OwnerUserId="15302" LastActivityDate="2015-06-09T05:26:39.160" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18239" PostTypeId="1" AcceptedAnswerId="18251" CreationDate="2015-06-09T08:31:17.450" Score="3" ViewCount="276" Body="&lt;p&gt;It appears to me that retail investors can only buy calls and puts, but not short them through any standardized way (except maybe borrowing the option from a friend ;) ).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is that correct, or how can I short puts/calls (directly without replication)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More specifically, I assume there are standard options on S&amp;amp;P500 and I would want to take one of these existing retail options and betting short on it (through a standalone product). The view is to be from a U.S. retail investor.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2015-06-09T18:28:10.297" LastActivityDate="2015-06-11T03:00:53.620" Title="How to short an option?" Tags="&lt;options&gt;&lt;trading&gt;&lt;short-selling&gt;&lt;call&gt;&lt;put&gt;" AnswerCount="4" CommentCount="7" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18240" PostTypeId="2" ParentId="18228" CreationDate="2015-06-09T12:22:55.337" Score="1" Body="&lt;p&gt;It is supposed to be multiplied by 5/100 (5%). You should then be able to get $57,870.37 if you multiply it by the fund value.&lt;/p&gt;&#xA;" OwnerUserId="16490" LastActivityDate="2015-06-09T12:22:55.337" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18241" PostTypeId="1" CreationDate="2015-06-09T12:36:41.327" Score="5" ViewCount="390" Body="&lt;p&gt;I didn't understand how to simulate asset prices by using non normal random numbers. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am assuming that it would be incorrect to use the standard Geometric Brownian Motion, since it is based solely on normally distributed random variables z~N(0,dt).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As discussed below it should be a good idea to simply assume that the random numbers are logreturns. &lt;/p&gt;&#xA;" OwnerUserId="16474" LastEditorUserId="16474" LastEditDate="2015-07-20T13:47:13.417" LastActivityDate="2015-07-20T13:47:13.417" Title="Simulate (imaginary) asset prices using random numbers that follow a Frank Copula" Tags="&lt;r&gt;&lt;monte-carlo&gt;&lt;simulations&gt;&lt;asset-pricing&gt;&lt;copula&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18242" PostTypeId="2" ParentId="18239" CreationDate="2015-06-09T12:57:45.913" Score="3" Body="&lt;p&gt;It depends on the derivatives exchange but e.g. &lt;a href=&quot;http://www.eurexchange.com/exchange-en/&quot; rel=&quot;nofollow&quot;&gt;Eurex exchange&lt;/a&gt; can also be used by retail investors as long as they are qualified (concerning their max. risk level) and their bank offers access to it (some at least do that).&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2015-06-09T12:57:45.913" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="18243" PostTypeId="2" ParentId="18241" CreationDate="2015-06-09T12:59:26.000" Score="2" Body="&lt;p&gt;For non-normal asset price models you could look at the theory of Lévy-processes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we assume that you work in the physical probability measure $P$ and that the random numbers that you have generated are daily log-returns, then you can do the following:&#xA;Asset $i$ has starting price $S_0^i$ and for the future prices you can put&#xA;$$&#xA;S_t^i = S_0^i \exp(\sum_{k=1}^t r^i_k),&#xA;$$&#xA;where the $(r_k^i)_{k=1}^N$ are the sampled returns from the copula that you have described.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT after comment by the OP:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to price an option then you can sample the paths but with a drift equal to the risk free rate. Thus you subtract the expected value (depending on your distribution) and add the risk free rate. If you look at the theory of Lévy processes this means that you calculate the compensator (for the theory of Lévy processes you can look &lt;a href=&quot;http://www.people.fas.harvard.edu/~shephard/introlevy120608.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually in the context of non-Gaussian models options are priced using Fourier-transform techniques.&#xA;To learn the standard theory of these processes you would work through &quot;Financial Modelling with Jump Processes&quot; by Cont and Tankov.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that using a different distribution for the log-returns than a Gaussian you already model jumps of the stock price (very small ones).&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-06-10T12:49:17.443" LastActivityDate="2015-06-10T12:49:17.443" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18244" PostTypeId="1" CreationDate="2015-06-09T13:12:26.350" Score="7" ViewCount="2014" Body="&lt;p&gt;It is often explained, that the rule of thumb for exercising American options is to check when the benefit from the interest rate (sell the stock earlier, get the cash, put in the bank) is higher than the time value of the option. This is all clear in the positive interest rate environment, but the question is then - would we exercise some put options in case $r = 0$, and why would we do that? I thought, that there's no reason for such exercise, however according to &lt;a href=&quot;http://economia.unipr.it/DOCENTI/DEDONNO/docs/files/battauz-dedonno-sbuelz-real_options_and_american_derivatives_MS.pdf&quot; rel=&quot;noreferrer&quot;&gt;this paper&lt;/a&gt; it is even sometimes optimal to early exercise American puts when $r&amp;lt;0$. What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="13480" LastActivityDate="2015-06-11T09:24:04.010" Title="American put for negative interest rates" Tags="&lt;american-options&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="18245" PostTypeId="2" ParentId="17249" CreationDate="2015-06-09T13:32:43.513" Score="1" Body="&lt;p&gt;What you are looking at is relative PPP, which claims that exchange rate movements are explained by relative inflation movements, see &lt;a href=&quot;https://en.wikipedia.org/wiki/Relative_purchasing_power_parity#Explanation&quot; rel=&quot;nofollow&quot;&gt;wiki&lt;/a&gt;. However from the picture I would guess he is looking at a bottom up purchasing power parity aggregate, which as @user1483 eluded to, is a different calculation. There are several providers of this type of index, the OECD provides one. A brief description of their methodology is explained &lt;a href=&quot;https://www.oecd.org/std/prices-ppp/purchasingpowerparities-frequentlyaskedquestionsfaqs.htm#FAQ2&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; and a more detailed description can be found &lt;a href=&quot;https://www.oecd.org/std/prices-ppp/13-3012041ec015.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. Ultimately the two are related and under a set of set of economic assumptions on the world (which don't hold empirically) are equivalent however practically speaking the calculation methodologies are quite different and will yield different results.&lt;/p&gt;&#xA;" OwnerUserId="5420" LastActivityDate="2015-06-09T13:32:43.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18247" PostTypeId="2" ParentId="18239" CreationDate="2015-06-09T14:23:25.140" Score="0" Body="&lt;p&gt;Maybe interactive brokers do it, see &lt;a href=&quot;https://www.interactivebrokers.com/en/?f=%2Fen%2Fsoftware%2Fpdfhighlights%2FPDF-OptionTrader.php&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2015-06-09T14:23:25.140" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18250" PostTypeId="1" AcceptedAnswerId="18252" CreationDate="2015-06-09T14:40:59.693" Score="0" ViewCount="236" Body="&lt;p&gt;Would anyone know and API or Database where one could access Zero Coupon Bond Yield Curves? Also, is it wrong to use Coupon Paying Bonds Yield Curves and then zero-finding and then bootstrapping to find the price of a Zero Coupon Bond as I can currently only find the prices of Coupon Paying Bonds. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank You&lt;/p&gt;&#xA;" OwnerUserId="11917" LastEditorUserId="11917" LastEditDate="2015-06-09T15:52:30.697" LastActivityDate="2015-06-09T15:52:30.697" Title="API that provides Zero Coupon Bond Yield Curves?" Tags="&lt;fixed-income&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18251" PostTypeId="2" ParentId="18239" CreationDate="2015-06-09T15:04:03.093" Score="5" Body="&lt;p&gt;Given one satisfies margin requirements anyone can short exchange traded options as long as local regulators permit (American retail investors at present are not permitted, for example, to trade futures options . As long as there is a market and one finds a willing counterpart nothing speaks against shorting options contracts. Some brokers might require a hedge in place such as holding long stock inventory when selling calls. But there are no regulations in place at any of the exchanges (to my knowledge) that prevent retail from selling options. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, some brokers even offer the shorting of retail geared otc options contracts though it is quite rare.&lt;/p&gt;&#xA;" OwnerUserId="2114" LastEditorUserId="2114" LastEditDate="2015-06-09T16:33:17.873" LastActivityDate="2015-06-09T16:33:17.873" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="18252" PostTypeId="2" ParentId="18250" CreationDate="2015-06-09T15:06:37.937" Score="2" Body="&lt;p&gt;The Fed publishes yield curve data (par, zero &amp;amp; fwd) built with the Svensson model and using coupon bonds: &lt;a href=&quot;http://www.federalreserve.gov/econresdata/researchdata/feds200628_1.html&quot; rel=&quot;nofollow&quot;&gt;http://www.federalreserve.gov/econresdata/researchdata/feds200628_1.html&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The data is 2 day delayed, however.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2015-06-09T15:06:37.937" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="18254" PostTypeId="1" AcceptedAnswerId="18263" CreationDate="2015-06-09T16:50:30.723" Score="3" ViewCount="1068" Body="&lt;p&gt;I'm a full time undergraduate student from Peru, and I'm trying to use the Geometric Brownian Motion example used in the help section  from Wolfram Mathematica in order to forecast future stock prices, as in the example. But it seems that there might be some kind of error, because when I take the mean function of the simulated future paths in order to find the predicted future values the resulting path is ridiculous due to the extremely low volatility it has.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code I'm using is the same as the example provided by Mathematica:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Getting the data:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;LUVdata = FinancialData[&quot;LUV&quot;, &quot;Close&quot;, {{2015, 1, 1}, {2015, 4, 28}}];&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Adjusting the data to a Time Series:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;LUVseries = TimeSeries[LUVdata[[All, 2]], {LUVdata[[1, 1]]}];&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fitting a Geometric Brownian Motion Process to the values:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;eprocess = &#xA; EstimatedProcess[LUVseries[&quot;Values&quot;],GeometricBrownianMotionProcess[\[Mu], \[Sigma], \[Alpha]]];&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simulate 4000 future paths for the next 17 days:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;paths = RandomFunction[eprocess, {LUVseries[&quot;PathLength&quot;], LUVseries[&quot;PathLength&quot;] + 17, 1}, 4000];&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;td = TemporalData[paths[&quot;ValueList&quot;], {LUVdata[[-1, 1]], Automatic, &quot;Day&quot;},  ValueDimensions -&amp;gt; 1];&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Plot the simulations:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;forecastPlot = DateListPlot[td, Joined -&amp;gt; True, PlotStyle -&amp;gt; Directive[Opacity[.4]]]&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/pDzD3.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, calculate the mean function of the simulations to find predicted future values:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;meanPath = TimeSeriesThread[Mean, td];&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Plot the mean fuction of the simulations:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;DateListPlot[meanPath]&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Ikn6g.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you see in the plot of the mean function, it says that the stock will only varies in a range of 0.05 cents in 17 days which is totally wrong taking into account that this stock varies more than 1 dollar in a normal trading day:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/qSkN6.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please I will be very thankful to anyone who can tell me what is wrong with the code or with the estimation. &lt;/p&gt;&#xA;" OwnerUserId="16493" LastActivityDate="2015-06-10T11:18:00.940" Title="Forecasting problem with Geometric Brownian Motion in Wolfram Mathematica" Tags="&lt;equities&gt;&lt;brownian-motion&gt;&lt;forecast&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18255" PostTypeId="2" ParentId="18254" CreationDate="2015-06-09T17:09:32.660" Score="1" Body="&lt;p&gt;There is probably nothing wrong with your code although I did not check it in Mathematica.&#xA;Normally, Geometric Brownian motion is just a model. Here, you simulate lots of paths and then average over it. The first plot gives something like&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;E(S_t) = S_0*\exp(\mu t)&#xA;$$&#xA;with $S_0$ the initial stock price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, because of the simulation, you do not get an exponential (which increases only by a small amount over that time scale). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second plot is the actual stock price. If you want to have something similar, just plot one trajectory of your simulation.&#xA;One path of the geometric brownian motion has the same statistical properties as the stock price in the past had (if the actual process could be perfectly described by a geometric brownian motion!). And the jagged trajectory comes from the &quot;random&quot; Wiener process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To summarize: The geometric brownian motion can be used as a model with similar parameters (which can change in practice) like the actual stock, but the actual price path will with certainty be different from your model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS If you want more realistic trajectories, you should sample with a smaller time difference and continue your studies including jumps etc. &lt;/p&gt;&#xA;" OwnerUserId="560" LastEditorUserId="560" LastEditDate="2015-06-10T11:18:00.940" LastActivityDate="2015-06-10T11:18:00.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18256" PostTypeId="2" ParentId="18164" CreationDate="2015-06-09T17:58:48.973" Score="1" Body="&lt;p&gt;The CAPM model is based on the relationship existing between an asset and its benchmark market; assuming that the bitcoin could be thought as a currency, according to me, you should take the mean of returns over all the currencies traded and then regress the BTCUSD on the the average currency market returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed, although the EURUSD is one of the most liquid and traded currencies, in my humble opinion, it should not be considered as a benchmark of the currency market. Anyway, in this case too you are only approximating the market portfolio, as Roll (1977) suggests.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe you could find pretty interesting the &lt;strong&gt;Roll's critique&lt;/strong&gt; about constructing a market portfolio and testing the CAPM model; here below you can find the paper citation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Roll, Richard (March 1977), &quot;A critique of the asset pricing theory's&#xA;  tests Part I: On past and potential testability of the theory&quot;,&#xA;  Journal of Financial Economics 4 (2): 129–176&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Hope this will help.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-06-09T17:58:48.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18257" PostTypeId="2" ParentId="17719" CreationDate="2015-06-09T20:38:13.833" Score="2" Body="&lt;p&gt;The quick answer is: &lt;strong&gt;There's no such thing as a free lunch&lt;/strong&gt;, the no-arbitrage principle.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The longer answer:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To push the price down, you must short a massive amount of shares relative to float (tradeable shares). Don't forget that to have a short position, you must actually sell the shares. If you short large volume, then the market price will go down, but so will YOUR selling price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means your average selling price relative to normal volume trading is low. Remember that profit on a short position is: sell price - buy price. You must buy back the shares to make a profit. Since the price is artificially low, it is likely to rebound as others (most likely algorithms) will spot the sudden price lowering for no reason and buy the shares at bargain prices. The price will quickly rebound. Even if you were quick on your toes and sold the put options at a profit, you must still buy back the shares at higher prices than you sold at. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This strategy will result in huge losses. If it were to be a profitable strategy, it would not be because the market would spot the mispricing and correct for it. Otherwise, arbitrage would be possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Flash Crash&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note selling huge quantities of shares is not illegal in itself. But fake trades and false information to manipulate prices is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may be interested in looking up the Flash Crash of 2010. The accused trader made profit by manipulating prices, close to what you were asking. The difference is he put in massive &lt;strong&gt;fake&lt;/strong&gt; trades in order to drive down prices. The trades were &quot;fake&quot; as they were never executed. He would put in massive quantities of sell orders on futures, but above current market prices, giving the allusion people were dumping shares. This drove the price down. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a much better strategy than shorting shares as you propose. The only problem is you won't get to enjoy your millions from a jail cell ;)&lt;/p&gt;&#xA;" OwnerUserId="16496" LastActivityDate="2015-06-09T20:38:13.833" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18259" PostTypeId="1" CreationDate="2015-06-09T21:52:07.930" Score="4" ViewCount="71" Body="&lt;p&gt;Do Regional Central Banks such as the Federal Reserve and ECB have API's to access their Statistics? I've been searching all day and haven't been able to find them. They seem to provide most of their data in CSV Files or one has to carry out some web-scraping. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank You &lt;/p&gt;&#xA;" OwnerUserId="11917" LastActivityDate="2015-06-11T20:55:07.340" Title="Do Regional Central Banks have API's?" Tags="&lt;market-data&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18260" PostTypeId="2" ParentId="18244" CreationDate="2015-06-09T22:00:27.180" Score="5" Body="&lt;p&gt;The classic result is never early exercise an American call if  $r \geq 0, d \leq 0.$ If we think in terms of FX, calls and puts are really the same thing and by switching currency, we get never early exercise an American put if $ r \leq 0, d \geq 0.$ If one of these is violated it may be worth early exercising. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastEditorUserId="1809" LastEditDate="2015-06-10T03:14:49.773" LastActivityDate="2015-06-10T03:14:49.773" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18261" PostTypeId="1" CreationDate="2015-06-09T22:03:25.993" Score="0" ViewCount="171" Body="&lt;p&gt;I'm trying to recreate some historical curves using EONIA swap rates. Unfortunately I can't find a concrete specification for the swaps. Without knowing if there are intermediate coupon payments, I can't accurately bootstrap the curve. I've spent maybe 6/7 hours today looking for these so any help from memory or otherwise would be much appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the index whose values I'm trying to use: &lt;a href=&quot;http://www.emmi-benchmarks.eu/eoniaswap-org/eoniaswap-rates.html&quot; rel=&quot;nofollow&quot;&gt;http://www.emmi-benchmarks.eu/eoniaswap-org/eoniaswap-rates.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers!&lt;/p&gt;&#xA;" OwnerUserId="16498" LastActivityDate="2015-07-14T12:28:39.853" Title="Looking for the conventions for EONIA swaps used to define EONIA swap rates" Tags="&lt;fixed-income&gt;&lt;yield-curve&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18262" PostTypeId="1" AcceptedAnswerId="18265" CreationDate="2015-06-10T04:04:05.880" Score="1" ViewCount="586" Body="&lt;p&gt;In Science, Entropy is generally considered to be the irreversibility of stuff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Google defines entropy as:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;lack of order or predictability; gradual decline into disorder&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The 'gradual decline in to disorder', although pessimistic in its approach, fits with my idea of entropy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In finance, the idea of entropy is present in the idea of spending money - this is an &lt;em&gt;energy exchange&lt;/em&gt;, and (in principle at least) once the transaction is completed, it cannot be reversed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This example is obviously at the micro-economic level. I am aiming to write a paper on the idea of &lt;strong&gt;Financial Entropy&lt;/strong&gt;, and I am looking for macro-economic examples (financial relations where entropic properties are present between large corporations, e.g. Microsoft/Oracle, and/or governments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am thinking all we really need to do is take existing definitions of entropy and thermodynamics for physics and maths, for example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Entropy&quot; rel=&quot;nofollow&quot;&gt;Wikipedia, Thermodynamics&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Entropy_(information_theory)&quot; rel=&quot;nofollow&quot;&gt;Wikipedia, Information Theory&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;and simply change the words 'heat' and 'information' to 'money'. My idea is that the equations should be equally applicable! The concept of this is similar to the translation of quantum mechanics into &lt;strong&gt;Quantum Economics&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any links to stories, experiences, papers, theories, etc.. are appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Appendum : There is a motive to this question - the main change to financial entropy occurs when a purchase is made, and I am wondering if the entropy of a financial system is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;continuous before and after a trigger event (a spend event)&lt;/li&gt;&#xA;&lt;li&gt;independent of external forces&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="15898" LastEditorUserId="15898" LastEditDate="2015-08-18T07:44:48.313" LastActivityDate="2015-08-18T07:44:48.313" Title="Looking for a definition of financial entropy" Tags="&lt;volatility&gt;&lt;economics&gt;&lt;macro-economics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18263" PostTypeId="2" ParentId="18254" CreationDate="2015-06-10T06:44:48.013" Score="0" Body="&lt;p&gt;Maybe this is rather a comment then an answer but three points:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;GBM is a stochastic model for stock prices. It is used to price derivatives in an arbitrage free setting. In this case you look at a process whose expected return is just the risk free rate (due to no-arbitrage). Forecast this price is trivial.&lt;/li&gt;&#xA;&lt;li&gt;It is debatable how forecastable stock prices are. If you want to learn about forecasting in a statistical sense then you could look at Rob Hyndman's resources (papers, R packages, free &lt;a href=&quot;https://www.otexts.org/fpp/&quot; rel=&quot;nofollow&quot;&gt;online book&lt;/a&gt;).&lt;/li&gt;&#xA;&lt;li&gt;one more point. You write: &quot;As you see in the plot of the mean function, it says that the stock will only varies in a range of 0.05 cents in 17 days which is totally wrong taking into account that this stock varies more than 1 dollar in a normal trading&quot;. This is the dominance of variance over the mean that we often see in stock prices and for sure in stochastic  models. During short time periods what you see in your (real or simulated) price path is mainly volatility (the sigma) while you &quot;feel&quot; the mu only for longer horizons. Just forecasting the price for the future with today's value will give you a forecast as precise as the mean that you apply - it is all noise on your timeframe.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-06-10T07:08:28.087" LastActivityDate="2015-06-10T07:08:28.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18265" PostTypeId="2" ParentId="18262" CreationDate="2015-06-10T10:07:09.803" Score="2" Body="&lt;p&gt;The concept of entropy in the financial field is related to the market efficiency and predictability one; the measure &lt;em&gt;approximate entropy&lt;/em&gt; by Pincus (1991) is considered as a market efficiency measure  and it has been empirically proven it is correlated to the main market efficiency measures as shown by &lt;a href=&quot;http://arxiv.org/pdf/0802.1500.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Eon &amp;amp; Kim (2008)&lt;/a&gt; and Risso (2008).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suggest you to read:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Eom, Cheoljun, et al. &quot;Effects of time dependency and efficiency on&#xA;  information flow in financial markets.&quot; Physica A: Statistical&#xA;  Mechanics and its Applications 387.21 (2008): 5219-5224.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Risso, Wiston Adrián. &quot;The informational efficiency and the financial&#xA;  crashes.&quot; Research in International Business and Finance 22.3 (2008):&#xA;  396-408.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;to study the application of entropy in financial markets, that is what you asked for; the paper deals with the stock market only, but the procedure can be applied to all other markets. As you suggested in the question, according to me too, the idea is applicable also in financial markets, but there do not exist many studies about this topic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Read also Pincus (1991) and Pincus &amp;amp; Singer (1996) for a complete &lt;strong&gt;definition&lt;/strong&gt; and further studies about the measure itself, while, if you are interested to know other measures of market efficiency, look at this &lt;a href=&quot;https://quant.stackexchange.com/questions/17605/what-are-the-main-market-efficiency-measures&quot;&gt;question&lt;/a&gt; I asked some time ago on quant.SE in which I update periodically the market efficiency measures known in the academic literature&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2015-06-10T11:02:20.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18266" PostTypeId="2" ParentId="18244" CreationDate="2015-06-10T11:23:27.917" Score="3" Body="&lt;ul&gt;&#xA;&lt;li&gt;Let $r=0$:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The maximum payoff ever from the put is when $S=0$ so $P= K$. So one would always exercise at this maximum because you cant get any better in the future and dont forego any interest. Based on @MarkJoshi 's comment, we have to assume that $S=0$ never recovers, so if $r=0$ you are essentially indifferent between exercising then or later because you gain/loose no interest and the payoff will never decrease. So it holds $P_t=p_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $S&amp;gt;0$ you can theoretically always have an infinitesimal increase in payoff when $S\to 0$ and wait, however I would expect that there is an exercise boundary at which point you would exercise because the probability of ending OTM vs. being close to maximum payoff already is too high and hence the AM put dominates at this point and $P_t\geq p_t$. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Let $r&amp;lt;0$:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you exercise at the maximum payoff, your received cash will vanish over time through the negative interest. I expect it is then a question of the expected opportunity cost from not exercising at the maximum vs. the negative interest until maturity. If the volatility of the asset is very high, you have a high probability of moving away from the maximum in the future and would probably rather accept the negative interest. If the volatility is very low or even close to zero, you will likely not move away from the maximum much and rather exercise later to avoid negative interest. Hence the AM put fully dominates and $P_t&amp;gt;p_t$.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2015-06-11T09:24:04.010" LastActivityDate="2015-06-11T09:24:04.010" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="18267" PostTypeId="1" AcceptedAnswerId="18271" CreationDate="2015-06-10T12:35:07.640" Score="1" ViewCount="1103" Body="&lt;p&gt;If a stock pays a discrete dividend, the stock price falls by the amount of the dividend. There is no arbitrage opportunity from this predictable jump, because the investors receive the same amount of price depreciation back in cash from the dividend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But how about options? If the underlying jumps down at the dividend payment, the call option holder receives a direct loss without any compensation in cash as the dividend is only paid to the stock owners and the stock price is now worth less for exercise. So isnt there an arbitrage opportunity to short all call before the dividend and buy them back cheaper afterwards?&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2015-06-11T10:58:59.687" Title="Option arbitrage with dividends?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;arbitrage&gt;&lt;option-strategies&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18268" PostTypeId="1" CreationDate="2015-06-10T13:00:21.843" Score="3" ViewCount="1005" Body="&lt;p&gt;I have the cusip of about 300 bonds. I want to retrieve the security description from bloomberg and then export it into excel. Does anyone have any tips as to how to accomplish this?&lt;/p&gt;&#xA;" OwnerUserId="16510" LastActivityDate="2015-06-10T17:14:15.357" Title="Export security description data from bloomberg into excel" Tags="&lt;fixed-income&gt;&lt;bloomberg&gt;&lt;excel&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18269" PostTypeId="2" ParentId="18267" CreationDate="2015-06-10T14:07:13.473" Score="2" Body="&lt;p&gt;Generally no, because 'dividends' are already 'priced into' the options.&#xA;Which means, if an ATM call cost 0.50, and stock price drops by 1.00(amount of dividend), the ATM becomes OTM, but it may still cost 0.50, because the initial price of 0.50 already factored in the dividend.&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2015-06-10T14:07:13.473" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18270" PostTypeId="1" CreationDate="2015-06-10T14:30:28.707" Score="5" ViewCount="476" Body="&lt;p&gt;I'm using modern portfolio theory to compute the frontier of efficient portfolios. I'd like to pick the best one in the spirit of Kelly betting, ie. maximising expected growth.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for a reference that describes rigorously how I'd go about doing this.&lt;/p&gt;&#xA;" OwnerDisplayName="user16469" LastActivityDate="2019-04-20T10:49:54.150" Title="Combining modern portfolio theory and Kelly betting?" Tags="&lt;modern-portfolio-theory&gt;&lt;reference-request&gt;&lt;kelly-criterion&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18271" PostTypeId="2" ParentId="18267" CreationDate="2015-06-10T14:44:32.577" Score="3" Body="&lt;p&gt;&lt;strong&gt;Fact 1:&lt;/strong&gt; if you are not good at pricing options, of course you can create a lot of arbitrage opportunities for the rest of the market. It does not matter whether the reason is in dividends or anything else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Fact 2:&lt;/strong&gt; if you are good in pricing options, you price the dividend effect in advance. Consider the situation of the European calls, and suppose that both the volatility and the drift are zero. The stock is at a 100, and there is gonna be a dividend of 4 before expiry. If you hold an ITM option with a strike 90, you would not price is at 10 = 100 - 90, rather you would price it at 6 = (100 - 4) - 90. They also say that European options expire on the forward rather than on the spot, notice that the forward for that expiry would be exactly 96 = 100 - 4. At the same time, American call would still be 10 worth since you would exercise it just before the dividend drop out time. Essentially, when pricing option around dividend one makes sure that the price of the option &lt;em&gt;along&lt;/em&gt; the path of the stock (which does feature the jump) stay continuous: $V(S_{t-},t-) = V(S_{t+},t+)$ - see any book by Wilmott, perhaps also appears in Hull (maybe M. Joshi also has that). That's done exactly to avoid arbitrage. It's like you know in advance that your call would not be worth that much, so why would you buy it for such price?&lt;/p&gt;&#xA;" OwnerUserId="13480" LastEditorUserId="13480" LastEditDate="2015-06-11T10:58:59.687" LastActivityDate="2015-06-11T10:58:59.687" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18273" PostTypeId="2" ParentId="18268" CreationDate="2015-06-10T17:14:15.357" Score="3" Body="&lt;p&gt;If you just need the description you can use &lt;code&gt;=BDP(TICKER,&quot;CIE DES&quot;)&lt;/code&gt; directly in Excel.&lt;/p&gt;&#xA;" OwnerUserId="2393" LastActivityDate="2015-06-10T17:14:15.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18274" PostTypeId="1" AcceptedAnswerId="18287" CreationDate="2015-06-10T17:22:37.767" Score="1" ViewCount="646" Body="&lt;p&gt;I am just trying to get an explanation as to why Spot Rates can't be used to create a yield curve for Zero-Coupon Bonds? Or if they can, would it involve Bootstrapping? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="11917" LastActivityDate="2015-06-10T23:28:38.473" Title="Using Spot Rates to construct Zero-Coupon Bond Yield Curve" Tags="&lt;fixed-income&gt;" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="18275" PostTypeId="1" AcceptedAnswerId="18286" CreationDate="2015-06-10T17:59:03.563" Score="1" ViewCount="806" Body="&lt;p&gt;My question is with regards to the calculation of &quot;Compound Interest&quot;. I have the formula below where I would get an answer to the total value of the investment over a period of &quot;years&quot;.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$A$ = Future value&lt;/li&gt;&#xA;&lt;li&gt;$P$ = Principal amount&lt;/li&gt;&#xA;&lt;li&gt;$R$ = Annual interest rate &lt;/li&gt;&#xA;&lt;li&gt;$N$ = Number of times compounded each year &lt;/li&gt;&#xA;&lt;li&gt;$T$ = The number of years the money is invested for&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$$A = P\left(1 + \frac{R}{N} \right) ^{NT}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for example if I have the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P = 5,000\$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$R = 5\%= 0.05$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$N = 12$ (Compounded monthly)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$T = 10$ years&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answer for &lt;strong&gt;A&lt;/strong&gt; will be equal to &lt;strong&gt;$8,235.05&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is how can I derive the equation above to account for the period of years and months? So, for example, how would I calculate $A$ if I had $T$ being equals to $T$ = $10$ years + $6$ months?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think that the answer to the equation derivation is shown below but I'm not sure:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$A = P\left(1 + \frac{R}{N}\right)^{N(10 + 1/2)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone confirm if my calculations are correct?&lt;/p&gt;&#xA;" OwnerDisplayName="user16517" LastActivityDate="2015-06-10T22:41:43.627" Title="Compound Interest Calculation (Years + Months)" Tags="&lt;finance&gt;&lt;interest&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18276" PostTypeId="1" AcceptedAnswerId="18283" CreationDate="2015-06-10T18:20:23.103" Score="2" ViewCount="1133" Body="&lt;p&gt;I'm a newbie to the world of swaps. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I have a Total Return Inflation Swap (Receive CPI, Pay Fixed Zero Coupon)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on CPI Index starting level = &lt;a href=&quot;http://www.bloomberg.com/quote/CPURNSA:IND&quot; rel=&quot;nofollow&quot;&gt;236&lt;/a&gt;&#xA;Notional = 100,000&#xA;Term = 5 Years&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I calculate the final payoff at maturity using a hypothetical future CPI level e.g. 300 ? Are there any excel and/or R examples?&lt;/p&gt;&#xA;" OwnerUserId="13498" LastActivityDate="2015-06-10T21:20:38.653" Title="Calculate single cashflow at maturity for a Total Return Inflation swap (zero coupon)" Tags="&lt;inflation&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18277" PostTypeId="1" AcceptedAnswerId="18278" CreationDate="2015-06-10T18:26:27.513" Score="10" ViewCount="7317" Body="&lt;p&gt;I recently had an interview where I was asked what to use as risk-free rate. In all my textbooks it was always the US treasury yield curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But they said no its now the &quot;swap curve&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is the swap curve now used as riskfree rate instead of government bonds?&#xA;This includes to explain the difference between swapcurve and yieldcurve.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2019-08-09T11:52:02.310" Title="Why using the swap curve as riskfree rate and no longer gov bonds?" Tags="&lt;interest-rates&gt;&lt;risk&gt;&lt;swaps&gt;&lt;interest-rate-swap&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18278" PostTypeId="2" ParentId="18277" CreationDate="2015-06-10T19:06:44.570" Score="15" Body="&lt;p&gt;I guess it depends on what they're referring to... The traditional swap curve (LIBOR-based) is certainly &lt;strong&gt;not&lt;/strong&gt; risk free, as evidenced by the experience of the financial crisis and the resulting migration to OIS discounting. The OIS curve (which is a kind of swap curve...) is now the standard risk-free curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Treasury yield curve is not favored, because everyone builds their own smoothed Treasury curves. Depending not the smoothing techniques, the resulting Treasury curves can be pretty different. By contrast, although the curve building methodologies for swap curve can vary, the resulting curves tend to be much more similar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Treasury market is also much more technical; e.g., an issue trading special in the repo market can be very expensive, the CTD of a futures can trade rich if the shorts have difficulty finding the issue to make delivery, etc.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2015-06-10T19:12:29.967" LastActivityDate="2015-06-10T19:12:29.967" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18279" PostTypeId="2" ParentId="18275" CreationDate="2015-06-10T20:02:06.883" Score="0" Body="&lt;p&gt;If your compound period is monthly, then what you have is correct. &lt;/p&gt;&#xA;" OwnerUserId="15284" LastActivityDate="2015-06-10T20:02:06.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18280" PostTypeId="2" ParentId="18276" CreationDate="2015-06-10T20:18:54.953" Score="0" Body="&lt;p&gt;The trick to swap calculations is understanding what your profit is. Profit is (what you receive - what you pay). You can use this to calculate swaps on interest rates, equity swaps, and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What will you receive? You are receiving: CPI appreciation x Notional. (300/236 - 1) * 100,000 = 27,118.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are you paying? You are paying the zero coupon rate. Let's say it is 10%, which is 10,000.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Final payoff to swap long at maturity = 27,118 - 10,000 = 17,118. You said &quot;you have&quot; the swap, so I assume you are the fixed rate payer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Excel, you could do something like this:&#xA;&lt;a href=&quot;http://www.fincad.com/resources/resource-library/article/how-build-workbook-value-total-return-swap-floating-rate-loan&quot; rel=&quot;nofollow&quot;&gt;http://www.fincad.com/resources/resource-library/article/how-build-workbook-value-total-return-swap-floating-rate-loan&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Modify for you specific swap.&lt;/p&gt;&#xA;" OwnerUserId="16496" LastActivityDate="2015-06-10T20:18:54.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18281" PostTypeId="1" CreationDate="2015-06-10T21:06:14.240" Score="2" ViewCount="421" Body="&lt;p&gt;I'm doing a Heston model in Matlab using simple Monte Carlo simulations (5.000 paths and 2 steps per day, simulating 360 days). When I try to calibrate the Heston parameters using fminsearch it takes a lot of time and initial values almost doesn't change, so I guess there are a lot local minimization points. So is there any algorithm to obtain good initial values?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kind regards,&#xA;Oliver.&lt;/p&gt;&#xA;" OwnerUserId="16520" LastActivityDate="2018-04-16T20:41:18.713" Title="Initial values for Heston Model calibration" Tags="&lt;monte-carlo&gt;&lt;matlab&gt;&lt;calibration&gt;&lt;heston&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18282" PostTypeId="2" ParentId="17736" CreationDate="2015-06-10T21:14:30.677" Score="1" Body="&lt;p&gt;With a dedicated portfolio all interest rate risk has been eliminated, since you hold ZCB's that deliver exactly the cash you need when you need it. So it is a perfect hedge against i.r. risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With an immunized portfolio you have reduced i.r. risk (by matching duration and convexity) but you still have a probability distribution of outcomes.  Yields at different maturities do not always increase by the same amount [i.e. non parallel shifts], so you are exposed to changes in the shape of the yield curve. This cuts both ways, you could end up with more $ than you need or less.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it is a question of how safe do you want to be. If you can't tolerate any slippage between the cash flows you will get and your projected needs, then go with dedication, which will force you to have a pretty specific portfolio including some zero coupon bonds that may well be illiquid and thus cost you more. If you can handle some variation, the immunization may be enough, and you have more choices of what bonds to buy.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16160" LastEditDate="2015-06-11T04:33:56.483" LastActivityDate="2015-06-11T04:33:56.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18283" PostTypeId="2" ParentId="18276" CreationDate="2015-06-10T21:20:38.653" Score="2" Body="&lt;p&gt;For ZC inflation swaps, the fixed side cash flow is&#xA;$$ N \big((1 + r)^T - 1\big), $$&#xA;where $N$ is the national amount, $r$ is the agreed upon ZC swap rate, and $T$ is the tenor of the swap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The floating side cash flow is&#xA;$$ N\left( \frac{I(T)}{I_\text{base}} - 1 \right), $$&#xA;where $I_\text{base}$ is the base index level (reference index as of the effective date) and $I(T)$ is the reference index as of the termination date.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2015-06-10T21:20:38.653" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="18284" PostTypeId="2" ParentId="16129" CreationDate="2015-06-10T21:28:44.323" Score="4" Body="&lt;p&gt;The derivation in the book appears wrong. However, the results make sense as the option price at time $t$ should not be impacted by prior dividend payments. It may be out-of topic, I would like to provide some justification of the Musiela-Rutkowski formula. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\{H_t \mid t &amp;gt;0\}$, where &#xA;\begin{align*}&#xA;H_t = \sum_{0 &amp;lt; T_i \leq t} q_i,&#xA;\end{align*}&#xA;be a step process. Moreover, we assume that, under the risk-neutral probability measure, the stock price $S_t$ satisfies an SDE of the form&#xA;\begin{align*}&#xA;dS_t = S_{t-}(r dt + \sigma dW_t) - dH_t,&#xA;\end{align*}&#xA;where $\{W_t\mid t&amp;gt;0\}$ is a standard Brownian motion. For $0&amp;lt;t \leq T$, assuming that &#xA;\begin{align*}&#xA;t &amp;lt; T_{i_0} &amp;lt; \cdots &amp;lt; T_m \leq T.&#xA;\end{align*}&#xA;Then, &#xA;\begin{align*}&#xA;S_{T_{i_0}} &amp;amp;= S_te^{\int_t^{T_{i_0}}(r-1/2\sigma^2)ds +\int_t^{T_{i_0}}\sigma dW_s}-q_{i_0}\\&#xA;S_{T_{i_0+1}} &amp;amp;= \bigg(S_te^{\int_t^{T_{i_0}}(r-1/2\sigma^2)ds +\int_t^{T_{i_0}}\sigma dW_s}-q_{i_0}\bigg)e^{\int_{T_{i_0}}^{T_{i_0+1}}(r-1/2\sigma^2)ds +\int_{T_{i_0}}^{T_{i_0+1}}\sigma dW_s} -q_{i_0+1}\\&#xA;&amp;amp;\approx S_te^{\int_t^{T_{i_0+1}}(r-1/2\sigma^2)ds +\int_t^{T_{i_0+1}}\sigma dW_s}-q_{i_0} e^{\int_{T_{i_0}}^{T_{i_0+1}}rds} - q_{i_0+1}\\&#xA;&amp;amp; \ldots\ldots\\&#xA;S_T &amp;amp;\approx S_te^{\int_t^{T}(r-1/2\sigma^2)ds +\int_t^{T}\sigma dW_s}-\sum_{i=i_0}^m q_{i} e^{\int_{T_{i}}^{T}rds}\\&#xA;&amp;amp;=  S_te^{\int_t^{T}(r-1/2\sigma^2)ds +\int_t^{T}\sigma dW_s}-I_t.&#xA;\end{align*}&#xA;Now, the Musiela-Rutkowski formula follows immediately.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-06-10T21:28:44.323" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18285" PostTypeId="2" ParentId="18270" CreationDate="2015-06-10T22:06:35.470" Score="3" Body="&lt;p&gt;Maybe you will find the following papers pretty interesting:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Laureti, P., Medo, M., and Zhang, Y.-C. (2010). Analysis of&#xA;  Kelly-optimal portfolios. Quantitative Finance, 10(7): 689–697.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Nekrasov, Vasily, Kelly Criterion for Multivariate Portfolios: A&#xA;  Model-Free Approach (September 30, 2014).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The last one is available at &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2259133&quot; rel=&quot;nofollow noreferrer&quot;&gt;SSRN&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Particularly, the last one shows how to apply the Kelly Criterion to stock portfolios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, in my humble opinion, you have to keep attention to what you are going to apply the model for and to the underlying hypothesis; such hypothesis, as, for instance, the joint normally distributed stock returns assumption, are pretty strong for an application of such strategy to the realty.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="16595" LastEditDate="2019-04-20T10:49:54.150" LastActivityDate="2019-04-20T10:49:54.150" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="18286" PostTypeId="2" ParentId="18275" CreationDate="2015-06-10T22:41:43.627" Score="0" Body="&lt;p&gt;Your answer is correct. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The point is you need to match the interest rate periods with the compounding periods. So if (R/N) is the rate for a 1-month period, then &quot;NT&quot; must be the number of compounding months. Since you are compounding for 10.5 years, this represents 126 months (10.5 * 12). If, on the other hand, your compounding is semiannual (as is usual with bonds), NT = 10.5 * 2. &lt;/p&gt;&#xA;" OwnerUserId="16496" LastActivityDate="2015-06-10T22:41:43.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18287" PostTypeId="2" ParentId="18274" CreationDate="2015-06-10T23:28:38.473" Score="1" Body="&lt;p&gt;If you want a zero coupon curve, you can interpolate it given the spot rates. This is typically not done, since spot rates are not traded on the market. Instead, cash instruments are used in the near term, FRAs and futures - in the medium-term, and swaps in the long term to imply rates at specific times, and an interpolation (and extrapolation) scheme is imposed to create the values for arbitrary points in time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hagan and West in a classic paper show that the simplest sane interpolation scheme is piecewise constant forwards.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for where one may get a series of such rates, I would try the &lt;code&gt;CRVF&lt;/code&gt; function on the Bloomberg for the specific country of interest. Just make sure you pick the calibrated zero rates curve.&lt;/p&gt;&#xA;" OwnerUserId="3029" LastActivityDate="2015-06-10T23:28:38.473" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18288" PostTypeId="2" ParentId="18239" CreationDate="2015-06-11T03:00:53.620" Score="3" Body="&lt;p&gt;Of course you can sell options and you can certainly sell options on most major indices. Thinkorswim (TDAmeritrade) offers and excellent platform. Moreover, one can short options without &quot;full&quot; account privileges provided a defined risk trade is entered (such as an iron condor or call spread) &lt;/p&gt;&#xA;" OwnerUserId="15832" LastActivityDate="2015-06-11T03:00:53.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18289" PostTypeId="1" AcceptedAnswerId="18303" CreationDate="2015-06-11T03:24:35.830" Score="12" ViewCount="7138" Body="&lt;p&gt;I'm trying to implement the Black-Scholes formula to price a call option under stochastic interest rates. Following the book of McLeish (2005), the formula is given by (assuming interest rates are nonrandom, i.e. known):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E[exp\{-\int_0^Tr_t dt\}(S_T-k)^+]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;=$E[(S_0 exp\{N(-0.5\sigma^2T,\sigma^2T)\}-exp\{-\int_0^Tr_tdt\}K)^+]$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;=$BS(S_0,k,\bar{r},T,\sigma)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\bar{r}=\frac{1}{T}\int_0^Tr_tdt$ is the average interest rate over the life of the option . &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If interest rates are random, &quot;we could still use the Black-Scholes formula by first conditioning on the interest rates, so that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E[e^{-\bar{r}T}(S_T-K)^+|r_s, 0&amp;lt;s&amp;lt;T]= BS(S_0,K,\bar{r},T,\sigma)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and then computing the unconditional expected value of this by simulating values of $\bar{r}$ and averaging&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure how can I calculate $\bar{r}$ given a simulated sample paths.&lt;/p&gt;&#xA;" OwnerUserId="12214" LastActivityDate="2020-03-31T16:20:19.987" Title="Black-Scholes under stochastic interest rates" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;interest-rates&gt;&lt;monte-carlo&gt;&lt;stochastic-discount&gt;" AnswerCount="3" CommentCount="6" FavoriteCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="18290" PostTypeId="1" CreationDate="2015-06-11T03:58:37.760" Score="4" ViewCount="302" Body="&lt;p&gt;Does anyone know how to find the probability law (distribution) under P* of a Black Scholes Call Option price $C_t$ for $0 &amp;lt; t &amp;lt; T $?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Under P*, $ dC_t = \frac{\partial c}{\partial s}\sigma S_t dW_t^{*} + rcdt $, where $C_t = c(s,t)$,    $t \in [0,T]$ )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm expecting it will not be geometric Brownian motion but I'm not sure how to prove it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="16523" LastActivityDate="2015-06-12T23:31:23.060" Title="Distribution of Black Scholes call option price at time 0&lt;t &lt;T" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18291" PostTypeId="2" ParentId="8816" CreationDate="2015-06-11T10:10:28.130" Score="4" Body="&lt;p&gt;Reuters uses a proprietary model defined &lt;em&gt;StarMine&lt;/em&gt; structural/SmartRatios Credit Risk model that has been developed by themselves and provided with the Reuters data service.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It does not exist a formal definition or paper about the model, in which it is explained how to get that score; Reuters simply explains roughly what is in its website without going into details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://alphanow.thomsonreuters.com/solutions/starmine/starmine-analytic-faqs/#StarMine_SmartRatios_Credit_Risk&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; you can find the link to the webpage&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The model combines financial ratios and metrics that are predictive of&#xA;  credit risk into five components: profitability, leverage, debt&#xA;  coverage, liquidity, and growth. The model also incorporates&#xA;  industry-specific metrics where appropriate, particularly for banks&#xA;  and insurance companies but also for retailers, utilities, airlines,&#xA;  and others. The model output includes 1-100 scores for each of the&#xA;  five components, default probabilities, overall 1-100 percentile&#xA;  scores, and letter ratings.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-06-11T10:10:28.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18292" PostTypeId="1" CreationDate="2015-06-11T10:35:38.860" Score="4" ViewCount="350" Body="&lt;p&gt;Since markets are showing negative interest rate, I'm forced to find a model that can catch this behaviour. Because of that, I have implemented and calibrated the G2++ (or the Hull-White 2 Factors) for the EURIBOR 6 Months.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The EURIBOR 6M has already been calibrated, but I also need to model the indexes EURIBOR OIS, EURIBOR 3M and EURIBOR 12M at the same time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you know how to model these ibor indexes? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Shall I model the basis spread? or shall I implement also the G2++ for the rest of indexes?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we implement the G2++ for the rest of indexes and we execute a Monte Carlo, we may get some trouble when indexes twist. I mean, in some cases EURIBOR 3M could become greater than EURIBOR 6M and theoretically it shouldn't be allowed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea about stochastic basis models?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much in advance!&lt;/p&gt;&#xA;" OwnerUserId="5595" LastEditorUserId="2553" LastEditDate="2015-06-11T13:31:12.433" LastActivityDate="2015-07-11T14:16:39.300" Title="Negative Interest Rate &amp; Basis Models" Tags="&lt;interest-rates&gt;&lt;stochastic-processes&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18293" PostTypeId="2" ParentId="2355" CreationDate="2015-06-11T11:23:24.170" Score="5" Body="&lt;p&gt;This is a bit of an old question, but I thought I'd contribute to add more weight to to what some people have been saying. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A CSO (calendar spread option) is NOT a calendar spread of options. If you read it carefully, you can see the Hull quote Max Li posted is talking about a calendar spread, not a CSO.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A CSO needs to be priced the same way as a spread option. The two underlying futures can be thought of as seperate instruments although with a very high correlation before the first future expires.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means that any spread option model (such as Kirk's approximation) can be used to price the CSO if you are careful, although the same issues apply as with any spread option model, such as you must be very careful when picking the correlation to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The link edouard gave originally, &lt;a href=&quot;http://www.icmacentre.ac.uk/files/analytic_spread_options.pdf&quot;&gt;Analytic Approximations for Spread Options&lt;/a&gt; goes through Kirk's approximation in some detail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is also possible to look at the spread itself as normally distributed but I can't find any useful links with a quick search.&lt;/p&gt;&#xA;" OwnerUserId="16525" LastActivityDate="2015-06-11T11:23:24.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18294" PostTypeId="1" AcceptedAnswerId="32642" CreationDate="2015-06-11T12:31:14.363" Score="8" ViewCount="3476" Body="&lt;p&gt;This may be seen as a follow up question for the previous discussion on time-series vs cross-sectional factor models: &lt;a href=&quot;https://quant.stackexchange.com/questions/1914/which-approach-to-estimating-fundamental-factor-models-is-better-cross-sectiona&quot;&gt;Which approach to estimating fundamental factor models is better, cross-sectional (unobservable) factors or time-series (observable) factors?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume that we use a cross-sectional factor model (e.g. BARRA model). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using cross-sectional regressions, we estimate the pure factor returns for each time period (by regressing stock returns on firm characteristics, such as P/E). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So we obtain time series of pure factor returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, is it appropriate to estimate a &lt;strong&gt;&lt;em&gt;time-series&lt;/em&gt;&lt;/strong&gt; regression where individual stock returns (that are also used in developing the cross sectional model) are regressed on pure factor returns (that are estimated using cross sectional regressions)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And if yes: &#xA;1) What are the econometric implications of such an approach? Since the explanatory variables are also estimates, we may have an errors-in-variables problem.&#xA;2) How the betas estimated in time-series regressions compare with the original factor exposures (i.e. firm characteristics)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any research papers on these issues?&lt;/p&gt;&#xA;" OwnerUserId="16506" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2017-02-23T17:47:42.923" Title="Using cross-sectional factor model (BARRA type) returns in a time series factor model (Fama-French type)?" Tags="&lt;regression&gt;&lt;factor-models&gt;&lt;beta&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="18295" PostTypeId="2" ParentId="18292" CreationDate="2015-06-11T13:37:46.547" Score="2" Body="&lt;p&gt;You can start with a deterministic basis spread. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several attempts to model the basis spread both modeling the spreads separately with positive stochastic processes and by modelling the different indexes. &#xA;You are right: if you model the indices they could cross and it is hard to enforce abscence of twists. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Probably every paper on this subject cites Mercurio's seminal paper. Search your model in the papers citing Mercurio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, negative basis spreads have occasionally been observed. &lt;/p&gt;&#xA;" OwnerUserId="6249" LastActivityDate="2015-06-11T13:37:46.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18296" PostTypeId="1" CreationDate="2015-06-11T14:17:29.813" Score="3" ViewCount="4023" Body="&lt;p&gt;I'm new to the quant finance and have a very basic question about LIBOR curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;LIBOR is published every day for 4 different tenors (1M, 3M, 6M, 1Y), and each rate means how much annual interest should be paid when leading banks borrow money from another.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my understanding, there should be a unique LIBOR yield curve, in which 1M, 3M, 6M, 1Y point values are the same as the quoted value above. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it doesn't seem to be the case. There's a LIBOR curve for each 4 different tenors. Given this, what does the value of 1M LIBOR curve at 1Y point?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And, when you model LIBOR using short rate model, you're modelling the unique LIBOR short rate, not the LIBOR of each tenor separately. Correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thx!&lt;/p&gt;&#xA;" OwnerUserId="16518" LastEditorUserId="16518" LastEditDate="2015-06-11T14:23:59.363" LastActivityDate="2016-09-27T19:42:58.780" Title="Basic LIBOR curve question" Tags="&lt;interest-rates&gt;&lt;yield-curve&gt;&lt;libor&gt;&lt;short-rate&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18297" PostTypeId="1" CreationDate="2015-06-11T15:55:01.053" Score="2" ViewCount="322" Body="&lt;p&gt;I am trying to access the Swiss Zero-Coupon Yield Curve Data. I know that the Swiss National Bank provides this data, as noted on the 8th Page of &lt;a href=&quot;https://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=2&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0CCYQFjABahUKEwjZwfGU_4fGAhUHUZIKHUIzDdo&amp;amp;url=https%3A%2F%2Fwww.alexandria.unisg.ch%2Fpublications%2F222514&amp;amp;ei=N655VZnKNoeiyQTC5rTQDQ&amp;amp;usg=AFQjCNFWwIzJGC-u0MK9Kqs5qoBlSHKh1g&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt; under Section 3.2. However, I am for the life of me unable to find it and was wondering if someone on here has possibly accessed it at some point. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My apologies for asking this sort of question again. However, I don't have access to a Bloomberg Terminal and hence cannot make use of their Zero-Coupon Yield Curve Data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have also contacted the Swiss National Bank about this but they have yet to respond and I don't know if they will. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank You&lt;/p&gt;&#xA;" OwnerUserId="11917" LastActivityDate="2018-05-27T13:28:49.973" Title="Swiss Zero-Coupon Bond Yield Curve Data" Tags="&lt;fixed-income&gt;&lt;zero-coupon&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18298" PostTypeId="1" AcceptedAnswerId="18309" CreationDate="2015-06-11T15:57:40.333" Score="3" ViewCount="1179" Body="&lt;p&gt;I am reading S. Shreve, Stochastic Calculus for Finance, Vol. I. There he proves that American Call Options have the same value as European Call Options. In the proof he uses that for a Call option the payoff function $g(s) = (s - K)^+$ is convex, and then shows that &#xA;$$&#xA; \frac{1}{(1+r)^n} g(S_n)&#xA;$$&#xA;is a submartingale (he calles this process the &lt;em&gt;discounted intrinsic value&lt;/em&gt; process, where the intrinsic value process is the process which gives the immediate payout at each time and for each event). Because it is a submartingale under the risk-neutral measure by the optional sampling theorem for each stopping time $\tau : \Omega \to \mathbb N \cup \{\infty\}$ the stopped process considered at the $N$-th time step&#xA;$$&#xA; \frac{1}{(1+r)^{N \wedge \tau}} g(S_{N\wedge \tau})&#xA;$$ &#xA;has a lower expectation, i.e. we can not get better by stopping some time before $N$, which shows the claim.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After the proof, there are some explanations I do not understand:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;[The Theorem] shows that the early exercise feature of the American call contributes nothing to its value. An examination of the proof of the theorem indicates that this is because the discounted intrinsic value of the call is a submartingale (i.e. has a tendency to rise) under the risk-neutral probabilities. The discounted intrinsic value of an American put is not a submartingale. If $g(s) = (K - s)^+$, then the Jensen inequality still holds but [here he refers to an equation in the proof] does not. Jensen's inequality says that the convex payoff of the put imparts to the discounted intrinsic value of the put a tendency to rise over time, but this may be overcome by a second effect. Because the owner of the put receives $K$ upon exercise, she may exercise early in order to prevent the value of this payment from being discounted away. For low stock prices, this second effect becomes more important than the convexity, and early exercise becomes optimal.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In his explanations he seems to say that $(K - s)^+$ is convex too (&quot;[...] Jensen's inequality says that the convex payoff of the put [...]&quot;), but it is not (indeed it is concave...) and so his explanations and Jensen's inequality does not apply, so I can not follows his explanations, maybe I have understood something wrong? Could someone please explain?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: The relevant part could be accessed with &lt;a href=&quot;https://books.google.de/books?id=zXhCAAAAQBAJ&amp;amp;pg=PA113&amp;amp;lpg=PA113&amp;amp;dq=shows%20that%20the%20early%20exercise%20feature%20of%20the%20American%20call%20contributes%20nothing%20to%20its%20value.%20An%20examination%20of%20the%20proof&amp;amp;source=bl&amp;amp;ots=mF_zKmmg6X&amp;amp;sig=ya1FDY1DxWQqoLeYwrrW0SqMJ08&amp;amp;hl=de&amp;amp;sa=X&amp;amp;ved=0CCIQ6AEwAGoVChMIvfG7h4GIxgIVh4ssCh2Q7wAS#v=onepage&amp;amp;q=shows%20that%20the%20early%20exercise%20feature%20of%20the%20American%20call%20contributes%20nothing%20to%20its%20value.%20An%20examination%20of%20the%20proof&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;google books&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="16264" LastEditorUserId="16264" LastEditDate="2015-06-11T16:03:26.583" LastActivityDate="2015-06-11T22:05:07.740" Title="Value of European Call equals Value of American Call, Question on Explanation/Proof" Tags="&lt;option-pricing&gt;&lt;mathematics&gt;&lt;american-options&gt;&lt;european&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18299" PostTypeId="1" AcceptedAnswerId="18328" CreationDate="2015-06-11T17:41:29.027" Score="2" ViewCount="328" Body="&lt;p&gt;Are there any books with practice problems for Market Risk, with special emphasis on vanilla and exotic options?  Or should I look into old exam papers from FRM as sold by Kaplan/GARP?&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2015-06-14T21:18:05.593" Title="Books on Market Risk for practice problems" Tags="&lt;market-risk&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18300" PostTypeId="2" ParentId="18296" CreationDate="2015-06-11T17:51:56.060" Score="4" Body="&lt;p&gt;Libor rates include credit risk. It is riskier to make a 6m loan than two 3m loan. So the 6M Libor curve is not the same as the 3M one. Their difference is the basis spread. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When using a short rate model, you are modelling one curve. As a first approximation, you can deduce the other curves by adding a deterministic basis spread.&lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2016-09-27T19:42:58.780" LastActivityDate="2016-09-27T19:42:58.780" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18301" PostTypeId="1" CreationDate="2015-06-11T18:02:07.710" Score="2" ViewCount="496" Body="&lt;p&gt;I want to use PCA for rich/cheap analysis of interest rates. For this I did the PCA on the time series of daily difference in interest rates, which is stationary. I cant do pca on levels, as they are not stationary and I have not been able to find any suitable transformation to convert it to stationary either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can then reproduce the daily changes using selected eigen vectors. But since I want to make a conclusion about the levels of the original rates(rich/cheap), how should I reproduce the levels from these PCA-based changes? And if doing this even makes sense statistically. I can post my data if that helps.&lt;/p&gt;&#xA;" OwnerUserId="7117" LastEditorUserId="7117" LastEditDate="2015-06-11T22:08:35.820" LastActivityDate="2015-06-12T00:12:48.387" Title="Reproducing levels when PCA has been done on changes" Tags="&lt;interest-rates&gt;&lt;pca&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18302" PostTypeId="2" ParentId="18299" CreationDate="2015-06-11T18:06:08.353" Score="2" Body="&lt;p&gt;I'm not an expert of market risk, but, as regards the market risk references I know, the best one and more related to the question posted above is Dynamic Hedging by N. N. Taleb.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here below you can find the full reference:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Taleb, Nassim. Dynamic hedging: managing vanilla and exotic options.&#xA;  Vol. 64. John Wiley &amp;amp; Sons, 1997.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It concentrates the book on options trading mainly, but you can find it useful in terms of risk management too, and, so I suggest you read that by integrating with more recent papers about the topic.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-06-11T18:06:08.353" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18303" PostTypeId="2" ParentId="18289" CreationDate="2015-06-11T18:25:25.080" Score="17" Body="&lt;p&gt;We assume that the short interest rate $r_t$ follows the Hull-White model, that is, the short rate $r$ and the stock price $S$ satisfies a system of SDEs of the form&#xA;\begin{align*}&#xA;dr_t &amp;amp;= (\theta_t -a\, r_t)dt + \sigma_0 dW_t^1,\\&#xA;dS_t &amp;amp;= S_t\Big[r_t dt + \sigma \Big(\rho dW_t^1 + \sqrt{1-\rho^2} dW_t^2\Big)\Big],&#xA;\end{align*}&#xA;where $a$, $\sigma_0$, $\sigma$, and $\rho$ are constants, and $\{W_t^1, t\ge 0\}$ and $\{W_t^2, t\ge 0\}$ are two independent standard Brownian motions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that,&#xA;\begin{align*}&#xA;&amp;amp;\ E\bigg(\exp\Big(-\int_0^T r_t dt \Big) (S_T-K)^+\bigg) \\&#xA;=&amp;amp; \  E\bigg(e^{-\bar{r}T} \Big(S_0e^{\bar{r}T -\frac{1}{2}\sigma^2 T - \sigma \big(\rho W_T^1 + \sqrt{1-\rho^2}W_T^2\big)} -K\Big)^+ \bigg)\\&#xA;=&amp;amp; \ E\Bigg(E\bigg(e^{-\bar{r}T} \Big[S_0e^{\bar{r}T -\frac{1}{2}\sigma^2 T + \sigma \big(\rho W_T^1 + \sqrt{1-\rho^2}W_T^2\big)} -K\Big]^+ \Bigg\vert r_s, 0&amp;lt;s \leq T\bigg)\Bigg)\\&#xA;=&amp;amp; \ E\Big(F(S_0,K,\bar{r},T,\sigma, W_T^1) \Big\vert r_s, 0&amp;lt;s \leq T\Big),&#xA;\end{align*}&#xA;for a certain function $F$. Note the random variable $W_T^1$ in the formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $\rho=0$, that is, $S$ and $r$ are independent, then&#xA;\begin{align*}&#xA;&amp;amp;\ E\bigg(\exp\Big(-\int_0^T r_t dt \Big) (S_T-K)^+\bigg) \\&#xA;=&amp;amp; \ E\Bigg(E\bigg(e^{-\bar{r}T} \Big(S_0e^{\bar{r}T -\frac{1}{2}\sigma^2 T + \sigma W_T^2} -K\Big)^+ \bigg\vert r_s, 0&amp;lt;s \leq T\bigg)\Bigg)\\&#xA;=&amp;amp;\ E\Big(BS(S_0,K,\bar{r},T,\sigma) \Big\vert r_s, 0&amp;lt;s \leq T \Big).&#xA;\end{align*}&#xA;That is, the formula provided in the question holds if the stock price and the interest rate are independent. In this case, $\bar{r}$ can be approximated by a Riemann sum.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;EDIT&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Here, we provide an analytical valuation formula for the above vanilla European option. From &lt;a href=&quot;https://quant.stackexchange.com/questions/21513/extended-hull-white-interest-rate-model-for-zero-coupon-bond/21516#21516.&quot;&gt;this question&lt;/a&gt;,  the zero-coupon bond price is given by&#xA;\begin{align*}&#xA;P(t, T) &amp;amp;=  E\left(e^{-\int_t^T r_s ds} \Big\vert \mathcal{F}_t \right)\\&#xA;&amp;amp;=\exp\left(-B(t, T) r_t - \int_t^T  \theta(s) B(s, T) ds + \frac{1}{2}\int_t^T \sigma_0^2 B(s, T)^2 ds\right),&#xA;\end{align*}&#xA;where&#xA;\begin{align*}&#xA;B(t, T) = \frac{1}{a}\Big(1-e^{-a(T-t)} \Big).&#xA;\end{align*}&#xA;Then &#xA;\begin{align*}&#xA;d\ln P(t, T) &amp;amp;=-e^{-a(T-t)}r_tdt -B(t, T)dr_t + \theta(t)B(t, T)dt - \frac{1}{2} \sigma_0^2 B(t, T)^2 dt\\&#xA;&amp;amp;=\left(r_t-\frac{1}{2} \sigma_0^2 B(t, T)^2\right) dt - \sigma_0 B(t, T)dW_t,\tag{1}&#xA;\end{align*}&#xA;or &#xA;\begin{align*}&#xA;\frac{dP(t, T)}{P(t, T)} = r_t dt -  \sigma_0 B(t, T)dW_t.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $Q$ denote the risk-neutral measure and $Q^T$ denote the $T$-forward measure. Moreover, let $B_t = e^{\int_0^t r_s ds}$ be the money market account value. From $(1)$,&#xA;\begin{align*}&#xA;\frac{dQ^{T}}{dQ}\Bigg|_t &amp;amp;= \frac{P(t, T)B_0}{P(0, T)B_t}\ \ (\text{with } B_0=1) \\&#xA;&amp;amp;=\exp\left(-\frac{1}{2}\int_0^t \sigma_0^2 B(s, T)^2 ds - \int_0^t \sigma_0 B(s, T) dW_s\right).&#xA;\end{align*}&#xA;Then by the &lt;a href=&quot;http://galton.uchicago.edu/~lalley/Courses/390/Lecture10.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Girsanov theorem&lt;/a&gt;, under $Q^T$, the process $\{(\widehat{W}_t^1, \widehat{W}_t^2), t \ge 0 \}$, where&#xA;\begin{align*}&#xA;\widehat{W}_t^1 &amp;amp;= W_t^1 + \int_0^t \sigma_0 B(s, T) ds,\\&#xA;\widehat{W}_t^2 &amp;amp;= W_t^2,&#xA;\end{align*}&#xA;is a standard two-dimensional Brownian motion. Moreover, under $Q^T$,&#xA;\begin{align*}&#xA;\frac{dP(t, T)}{P(t, T)} &amp;amp;= r_t dt -  \sigma_0 B(t, T)dW_t^1 \\&#xA;&amp;amp;=\big(r_t +\sigma_0^2 B(t, T)^2\big)dt -  \sigma_0 B(t, T)d\widehat{W}_t^1 \\&#xA;\frac{dS_t}{S_t} &amp;amp;= r_t dt + \sigma \Big(\rho dW_t^1 + \sqrt{1-\rho^2} dW_t^2\Big) \\&#xA;&amp;amp;=\big(r_t- \rho\sigma_0\sigma B(t, T)\big)  dt + \sigma \Big(\rho d\widehat{W}_t^1 + \sqrt{1-\rho^2} d\widehat{W}_t^2\Big).\tag{2}&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that, the forward price $F(t, T)$ has the form&#xA;\begin{align*}&#xA;F(t, T) &amp;amp;= E_{Q^T}(S_T \mid \mathcal{F}_t)\\&#xA;&amp;amp;=\frac{S_t}{P(t, T)}.&#xA;\end{align*}&#xA;which is a martingale under the $T$-forward measure $Q^T$ and satisfies an SDE of the form&#xA;\begin{align*}&#xA;dF(t, T) &amp;amp;= \frac{dS_t}{P(t, T)} -\frac{S_t}{P(t, T)^2}dP(t, T) \\&#xA;&amp;amp;\qquad - \frac{d\langle S_t, P(t, T)\rangle}{P(t, T)^2} + \frac{S_t}{P(t, T)^3}d\langle P(t, T), P(t, T)\rangle\\&#xA;&amp;amp;= F(t, T)\left[\sigma \Big(\rho d\widehat{W}_t^1 + \sqrt{1-\rho^2} d\widehat{W}_t^2\Big) + \sigma_0 B(t, T)d\widehat{W}_t^1 \right]\\&#xA;&amp;amp;= F(t, T) \left[ \big(\sigma\rho + \sigma_0 B(t, T)\big)  d\widehat{W}_t^1 + \sigma \sqrt{1-\rho^2} d\widehat{W}_t^2 \right].&#xA;\end{align*}&#xA;Let $\hat{\sigma}$ be a quantity defined by&#xA;\begin{align*}&#xA;T\hat{\sigma}^2 &amp;amp;= \int_0^T\Big[\big(\sigma\rho + \sigma_0 B(s, T)\big)^2 + \sigma^2\big(1-\rho^2\big) \Big] ds\\&#xA;&amp;amp;=\int_0^T\Big[\sigma^2 + 2\rho\sigma\sigma_0 B(s, T) +  \sigma_0^2 B^2(s, T)\Big] ds\\&#xA;&amp;amp;=\sigma^2T + \frac{2\rho\sigma\sigma_0}{a}\Big[T-\frac{1}{a}\big(1-e^{-aT}\big)\Big] + \frac{\sigma_0^2}{a^2}\Big[T+\frac{1}{2a}\big(1-e^{-2aT} \big) - \frac{2}{a}\big(1-e^{-aT} \big) \Big]\\&#xA;&amp;amp;=\sigma^2T + \frac{2\rho\sigma\sigma_0}{a}\Big[T-\frac{1}{a}\big(1-e^{-aT}\big)\Big] + \frac{\sigma_0^2}{a^2}\Big[T-\frac{1}{2a}e^{-2aT}+\frac{2}{a}e^{-aT} -\frac{3}{2a} \Big].&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;F(T, T) = F(0, T)\exp\left(-\frac{1}{2}\hat{\sigma}^2T + \hat{\sigma}\sqrt{T} Z \right),&#xA;\end{align*}&#xA;where $Z$ is a standard normal random variable. Consequently,&#xA;\begin{align*}&#xA;E_Q\left(\frac{(S_T-K)^+}{B_T}\right) &amp;amp;= E_Q\left(\frac{(F(T, T)-K)^+}{B_T}\right)\\&#xA;&amp;amp;=E_{Q^T}\left(\frac{(F(T, T)-K)^+}{B_T} \frac{dQ}{dQ^T}\bigg|_T \right)\\&#xA;&amp;amp;=P(0, T)E_{Q^T}\left((F(T, T)-K)^+\right)\\&#xA;&amp;amp;=P(0, T)\big[F(0, T)N(d_1) - KN(d_2) \big],&#xA;\end{align*}&#xA;where  $d_1 = \frac{\ln F(0, T)/K + \frac{1}{2}\hat{\sigma}^2 T}{\hat{\sigma} \sqrt{T}}$ and $d_2 = d_1 - \hat{\sigma} \sqrt{T}$. &lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="6686" LastEditDate="2018-08-16T12:52:15.197" LastActivityDate="2018-08-16T12:52:15.197" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="18304" PostTypeId="1" AcceptedAnswerId="18312" CreationDate="2015-06-11T19:34:18.193" Score="7" ViewCount="1186" Body="&lt;p&gt;For counterparty credit risk, in particular, for potential future exposure computation, people use the real-world probability measure to evolve the underlying risk factors. My question is that whether there is only a single real-world probability measure for the whole market, or an individual one for each individual market, for example, one for the US market and another one for the European market. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For risk-neutral probability measure, we certainly have one for each individual market, and thus we can say domestic risk-neutral measure and foreign risk-neutral measure and so on. Is there any such thing as domestic physical measure or foreign physical measure? That is, for an equity basket with underliers from various markets, do we need the so-called quanto adjustment in domestic physical measure? Is there any references for discussions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Acknowledgements: Thanks to every one for your participation. Your insights, ideas, or debates are very helpful for myself and many people here.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-06-14T16:14:16.363" LastActivityDate="2015-06-14T16:14:16.363" Title="Physical or Real-world Probability Measure" Tags="&lt;risk-neutral-measure&gt;&lt;counterparty-risk&gt;&lt;exposure&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18305" PostTypeId="1" AcceptedAnswerId="27648" CreationDate="2015-06-11T20:15:03.680" Score="10" ViewCount="600" Body="&lt;p&gt;The following is an excerpt from the dialogue in the book &quot;Counterparty Risk and Funding - A Tale of Two Puzzles&quot;, regarding the statistics such as the volatility and correlation estimation under the real-world probability measure $P$ and the risk-neutral probability measure $Q$.&#xA;&lt;img src=&quot;https://i.stack.imgur.com/CftNH.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is then: What does &quot;Parametrizing the Radon Nikodym&quot; mean? Any ideas or elaborations?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additional information: Consider a portfolio of $n$-assets. If there is only a single real-world probability measure $P$, then by a Girsanov transformation, we can move from $P$ to $Q$ with a single Radon-Nikodym derivative. However, if we assume that there is a real-world probability measure $P_s$ for each individual asset $s$, then we have a Radon-Nikodym derivative corresponding to asset $s$. Does the phrase &quot;Parametrizing the Radon Nikodym&quot;, in the above excerpt, mean the Radon-Nikodym derivative parametrized by assets?&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-06-14T16:34:49.580" LastActivityDate="2016-06-21T14:19:25.997" Title="Parametrizing the Radon Nikodym" Tags="&lt;counterparty-risk&gt;" AnswerCount="1" CommentCount="9" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="18306" PostTypeId="2" ParentId="18259" CreationDate="2015-06-11T20:55:07.340" Score="2" Body="&lt;p&gt;The Federal Reserve bank of St Louis has a widely used and popular application called FRED &lt;a href=&quot;http://research.stlouisfed.org/fred2/&quot; rel=&quot;nofollow&quot;&gt;http://research.stlouisfed.org/fred2/&lt;/a&gt; which is a fairly rich data source for US macro time series data considering that it's freely available! Check out their API &lt;a href=&quot;https://api.stlouisfed.org&quot; rel=&quot;nofollow&quot;&gt;https://api.stlouisfed.org&lt;/a&gt; for more info. &lt;/p&gt;&#xA;" OwnerUserId="16027" LastActivityDate="2015-06-11T20:55:07.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18307" PostTypeId="1" AcceptedAnswerId="18315" CreationDate="2015-06-11T20:56:22.277" Score="2" ViewCount="26" Body="&lt;p&gt;I am trying to find the growth rate of a stock over a given year. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say I wanted to find the growth rate from today, June 11, 2015 to June 11, 2014. This is easy enough when you have perfect information and both sets of data exist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However let's say June 11,2014 stock data does not exist, but June 10th and June 12th do. Which date do I compare to? Do I extend the &quot;year&quot; by a day and go to June 10th, or do I shorten the year and go to June 12th?&lt;/p&gt;&#xA;" OwnerUserId="16531" LastActivityDate="2015-06-12T00:48:56.077" Title="Calculating the rate of return over a year then the data for a year before does not exist" Tags="&lt;returns&gt;&lt;yahoofinance&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18309" PostTypeId="2" ParentId="18298" CreationDate="2015-06-11T22:05:07.740" Score="2" Body="&lt;p&gt;A convex function is when the line between two points on the graph always lies above the graph. And this does hold for the put, its also sometimes called a sublinear function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also see &lt;a href=&quot;http://en.wikipedia.org/wiki/Convex_function&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Convex_function&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the author is correct in saying that $(K-s)^+$ is convex.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2015-06-11T22:05:07.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18311" PostTypeId="2" ParentId="18301" CreationDate="2015-06-11T22:17:41.337" Score="3" Body="&lt;p&gt;The literature on cointegration in large datasets or panels is really the only place where I've seen this sort of issue discussed. &lt;a href=&quot;https://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=2&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0CCwQFjABahUKEwiQ85uM0ojGAhUpRIwKHSW8Bj4&amp;amp;url=https%3A%2F%2Fwww.bundesbank.de%2FRedaktion%2FEN%2FDownloads%2FPublications%2FDiscussion_Paper_1%2F2005%2F2005_11_30_dkp_42.pdf%3F__blob%3DpublicationFile&amp;amp;ei=LQV6VdCoNKmIsQSl-JrwAw&amp;amp;usg=AFQjCNFb7Xk-0KvDsrGbNseNb2LSX4kW0g&amp;amp;sig2=__gtmao1TWs93i-FqT7Hvw&amp;amp;bvm=bv.95277229,d.cWc&quot; rel=&quot;nofollow&quot;&gt;Breitung and Pesaran&lt;/a&gt;, among other places, talks about it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would recommend applying the PCA to the rate changes (perhaps with some kind of zero lower bound adjustment). Then, take the cumulative sum of each of the factors. This is effectively like the cumulative factor you would be using in a cointegration test or factor error correction model. Next, regress the rates (in levels) against the cumulative factors. At this point, you can test the residuals of this regression for stationarity (I would expect the residuals to be mean-reverting, there are a lot of nuances to panel unit root testing that I'm ignoring). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have a number of options when creating an investment strategy based on this information. The most obvious is to just buy (sell) the bonds where the residuals are most positive (negative). Highly positive residuals indicates that the yields are more than what the model would suggest and should fall. Obviously, there are a lot of variations you can make on this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another alternative is to estimate a factor error correction model. A factor error correction model bears a lot of similarity to the approach described in the second paragraph, but just extends it a little. Once you estimate the model, you can forecast rates, and use that to determine your bond positioning. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2015-06-11T22:17:41.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18312" PostTypeId="2" ParentId="18304" CreationDate="2015-06-11T23:02:38.147" Score="6" Body="&lt;p&gt;There is only one real world! You would use the measure that best describes all the markets together. Bear in mind that for credit you are really interested in portfolio effects. What is the potential credit risk we could have to a particular name? This depends on all the contracts we have them regardless of currency and they need to be modelled simultaneously.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-06-11T23:02:38.147" CommentCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="18313" PostTypeId="2" ParentId="18301" CreationDate="2015-06-12T00:06:21.527" Score="3" Body="&lt;p&gt;I just want to mention that it's highly prevalent to apply PCA to rate &lt;em&gt;levels&lt;/em&gt; in rich/cheap analyses. Personally I prefer that...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's an old MS publication that discusses this very topic and the recommendation is to use level PCA for rich/cheap, and to use change PCA for risk management. There's a really good Salomon paper (Principles of Principal Component) that discusses this in depth as well.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2015-06-12T00:12:48.387" LastActivityDate="2015-06-12T00:12:48.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18314" PostTypeId="2" ParentId="18296" CreationDate="2015-06-12T00:15:02.157" Score="3" Body="&lt;p&gt;You wrote &lt;em&gt;Given this, what does the value of 1M LIBOR curve at 1Y point represent?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is a real number X such that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following deal can be agreed today in the swap market: You will pay me the amount X (fixed in advance) one year from now, and in return I agree to pay you one year from now the amount Y equal to the 1 Month Libor Rate published at that time. Note that X is known today while Y is unknown and will only be known later, it could turn out to be greater or smaller than X.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2015-06-12T00:29:04.243" LastActivityDate="2015-06-12T00:29:04.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18315" PostTypeId="2" ParentId="18307" CreationDate="2015-06-12T00:48:56.077" Score="1" Body="&lt;p&gt;There are several ways to do this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you need the price for June 11 and the market is closed on that day, you can use the price for June 10th (which is known on June 11th). I would advise against using the price of June 12th because it is not known on the 11th, so you would be &quot;looking into the future&quot; which is a bad idea and can lead to subtle fallacies and traps. Always use &quot;information which could have been known on that date&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even simpler however, is to use trading days instead of calendar years. There are about 255 trading days a year. If I have an vector P containing the prices on trading days I would just compare P[i] to P[i+255] and call that the yearly return. Put a footnote explaining how it was calculated.  &lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-06-12T00:48:56.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18317" PostTypeId="2" ParentId="18304" CreationDate="2015-06-12T08:00:23.883" Score="4" Body="&lt;p&gt;The quanto adjustment is required to achieve the martingale property for the discounted payoff after currency transformation. Since you do not require discounted asset values to be martingales for risk measurement you do not need a quanto adjustment. But of course you need to include the distribution of future FX-rates in your modelling (which might be what emcor was alluding to). I see a danger of getting confused by loose language here. One needs to distinguish different events and random variables and using different measures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question of one or more Real-World measures is a very practical one. While most would agree that there is just one Real World measure describing a fair six-sided die, things are more complicated with more complex random variables. Different Real World measures are regularly a result of different calibrations. Obviously fitting a GARCH-model over 1 year or 10 years of past data will produce different distributions hence different measures for your target variables. From a practical risk management perspective I would encourage (and the regulator might require) testing different assumptions (i.e. different measures) of the real world.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a side remark, if phrased carefully, there are no different Martingale measures if you price in different markets. The measure without quanto adjustment is simply not a Martingale measure for a cash stream with currency transformation. The reason why this distinction is more than hairsplitting, is that having two different Martingale measures for the same asset would mean two prices for the same asset. Which some people feel is undesirable, since it is ruled out in liquid complete markets.&lt;/p&gt;&#xA;" OwnerUserId="482" LastActivityDate="2015-06-12T08:00:23.883" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18318" PostTypeId="2" ParentId="16650" CreationDate="2015-06-12T08:54:52.120" Score="1" Body="&lt;p&gt;Of course this does not make sense. But the problem is not the total return index but (most likely) the range of historical values used in the calibration. In a Solvency II setting we are talking about annual VaR on the 99.5% level. As a quick reality check assume you are a well versed extreme event modeller. In fact you just need at least 5 events. Furthermore you are an optimistic individual and agree that you are fine with a time series which has a 90% chance of observing those 5 events. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question: How many years of data do you need for the calibration of your model? &#xA;Observing the event is Bernoulli with a probability of 0.005. So the probability to observe more than 5 &quot;successes&quot; in n years is 1 - B(n,0.005,5) where B(n, p, k) is the Binomial Distribution. A quick look into Excel shows n=1853 years are necessary to reach 90%.&#xA;So unless those guys had bond prices roughly since the birth of Christ they do not have enough data for a VaR based on historic data alone. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;At these VaR levels historic testing just does not work! You always need to augment historic data by a parametric assumption (such as &lt;a href=&quot;http://en.wikipedia.org/wiki/Pareto_distribution&quot; rel=&quot;nofollow&quot; title=&quot;Pareto&quot;&gt;Pareto&lt;/a&gt;) and by additional &quot;artificial&quot; stress scenarios. &lt;/p&gt;&#xA;" OwnerUserId="482" LastEditorUserId="482" LastEditDate="2015-06-13T05:06:26.477" LastActivityDate="2015-06-13T05:06:26.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18319" PostTypeId="1" AcceptedAnswerId="18325" CreationDate="2015-06-12T09:07:52.850" Score="1" ViewCount="207" Body="&lt;p&gt;If I have 3 different currency trades (ex short EURSEK, short NZDUSD, long USDJPY), how do I size each trade if I wish to allocate risk equally in order to target a 12% portfolio volatility (allowing for leverage and short selling)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any guidance would be greatly appreciated, along with R or python code examples.&lt;/p&gt;&#xA;" OwnerUserId="2851" LastEditorUserId="2851" LastEditDate="2015-06-12T09:15:58.503" LastActivityDate="2015-06-12T15:05:26.320" Title="FX Portfolio Volatility Targeting" Tags="&lt;volatility&gt;&lt;portfolio&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18321" PostTypeId="1" AcceptedAnswerId="18323" CreationDate="2015-06-12T11:22:10.060" Score="3" ViewCount="1148" Body="&lt;p&gt;The Ornstein–Uhlenbeck process is defined as the stochastic process that solves the following SDE:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dx_t = \theta (\mu-x_t)\,dt + \sigma\, dW_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\theta&amp;gt;0$, $\mu$ and $\sigma&amp;gt;0$ are parameters and $W_t$ is Brownian motion. It is well known the solution to this equation. In particular, it is known that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E(x_t)=x_0 e^{-\theta t}+\mu(1-e^{-\theta t})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\operatorname{cov}(x_s,x_t) = \frac{\sigma^2}{2\theta}\left( e^{-\theta(t-s)} - e^{-\theta(t+s)} \right).$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can be easily seen that $\lim_{t\to+\infty}E(x_t)=\mu$ and that $\lim_{t\to+\infty}Var(x_t)=\frac{\sigma^2}{2\theta}$. Assume that $f(t)$ is a well behaved function. What is it known about the process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dx_t = \theta (f(t)-x_t)\,dt + \sigma\, dW_t$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a closed form expression for $x_t$ as in the constant case?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular, assume that $f(t)$ is periodic with certain period $\tau$. What is the limit of $E(x_t)$?     &lt;/p&gt;&#xA;" OwnerUserId="6065" LastEditorUserId="6065" LastEditDate="2015-06-12T14:26:25.063" LastActivityDate="2015-06-12T15:04:58.437" Title="Variable Drift Ornstein–Uhlenbeck Process" Tags="&lt;stochastic-processes&gt;&lt;derivatives&gt;&lt;statistical-finance&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18322" PostTypeId="2" ParentId="18149" CreationDate="2015-06-12T13:17:49.103" Score="1" Body="&lt;p&gt;You won't find a systematic approach, that would require the models to be arranged in some system, whereas generally each is an adjustment of GARCH. The best you can do is to know the usage cases of as many as possible and then use your own judgement as to which model is appropriate.&lt;/p&gt;&#xA;" OwnerUserId="16525" LastActivityDate="2015-06-12T13:17:49.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18323" PostTypeId="2" ParentId="18321" CreationDate="2015-06-12T13:24:14.597" Score="4" Body="&lt;p&gt;You can just take expectations on both sides of your SDE/corresponding integral equation and obtain an ODE on the expectation function $m_t = \Bbb E[x_t]$:&#xA;$$&#xA;  \dot m  = \theta(f - m)&#xA;$$&#xA;which you can easily solve using ansatz $m_t = c_t \mathrm e^{-\theta t}$ which brings you to&#xA;$$&#xA;  m_t = x_0\mathrm e^{-\theta t} + \theta\cdot\int_0^tf(s)\mathrm e^{\theta(s-t)}\mathrm ds&#xA;$$&#xA;so for $x_0 = 0$ you get a truncated version of convolution $m = f*\exp$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, assume for simplicity that $x_0 = 0$, that would not matter for the asymptotic analysis of periodic $f$ anyways. Let's $p&amp;gt;0$  be the period of $f$, then for any integer $n$ we have&#xA;$$&#xA;\begin{align}&#xA;m(np) &amp;amp;= \theta\mathrm e^{-\theta np}\cdot \sum_{k=0}^{n-1}\int\limits_{kp}^{(k+1)p}f(s)\mathrm e^{\theta s}\mathrm ds = \theta \mathrm e^{-\theta np}\cdot \sum_{k=0}^{n-1}F\mathrm e^{\theta kp}&#xA;\\&#xA;&amp;amp;= \theta F\cdot\frac{1 - \mathrm e^{-\theta np}}{\mathrm e^{\theta p} - 1} \to \frac{\theta F}{\mathrm e^{\theta p} - 1}&#xA;\end{align}&#xA;$$&#xA;where &#xA;$$&#xA;F = \int_0^pf(s)\mathrm e^{\theta s}\mathrm ds.&#xA;$$&#xA;Notice that if $f \equiv \mu$ then we need to take a limit at $p\to 0$ in ratio, so we get $\mathrm e^{\theta p} -1\sim \theta p$ and $F \sim \mu p$ so that ratio is $\mu$, which confirms the case of constant $f$.&lt;/p&gt;&#xA;" OwnerUserId="13480" LastEditorUserId="13480" LastEditDate="2015-06-12T14:09:26.363" LastActivityDate="2015-06-12T14:09:26.363" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18324" PostTypeId="2" ParentId="18321" CreationDate="2015-06-12T14:33:24.533" Score="3" Body="&lt;p&gt;For the general solution in the case where $f$ is not a constant, note that, from the SDE&#xA;\begin{align*}&#xA;dx_t = \theta(f(t)-x_t)dt + \sigma dW_t,&#xA;\end{align*}&#xA;we obtain that&#xA;\begin{align*}&#xA;d\big(e^{\theta t} x_t \big) = \theta e^{\theta t} f(t)dt + \sigma e^{\theta t} dW_t.&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;e^{\theta t} x_t = x_0 + \int_0^t \theta e^{\theta s} f(s)ds + \sigma \int_0^t e^{\theta s} dW_s.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;x_t = x_0e^{-\theta t}  + \int_0^t \theta e^{-\theta (t-s)} f(s)ds + \sigma \int_0^t e^{-\theta (t-s)} dW_s.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-06-12T15:04:58.437" LastActivityDate="2015-06-12T15:04:58.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18325" PostTypeId="2" ParentId="18319" CreationDate="2015-06-12T14:57:42.960" Score="1" Body="&lt;p&gt;First, for each of the 3 currencies taken separately, find out the leverage lambda_i (i=1,2,3) that would be required to produce an annual standard deviation of 12%. [In my experience the std dev of currencies is about 8 or 10%, so the three lambdas will be small, like 1.25 or 1.2].&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then find out what is the volatility that results when the three 12% vol currency positions are combined equally into a portfolio. Because of diversification it will not be quite 12%, so adjust the three lambdas proportionately to bring it to the desired 12%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I visualize this as a spreadsheet with separate columns for the historical returns of the different currencies, plus another column for the portfolio; but then I am an Exhell addict ;)&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2015-06-12T15:05:26.320" LastActivityDate="2015-06-12T15:05:26.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18326" PostTypeId="2" ParentId="18149" CreationDate="2015-06-12T15:46:45.557" Score="2" Body="&lt;p&gt;My 2 Zimbabwe cents:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few years ago developing new ARCH like models became almost a fad and large numbers of them were published without a clear justification in my humble opinion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However there is an important distinction I do think. Some markets are symmetric, while others (such as Stock Indexes) show a Leverage Effect where the volatility rises when the underlying goes down. It is important to use the right kind of model accordingly. For example for Stock Indexes I like GJR-GARCH which incorporates a leverage effect.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2015-06-12T15:46:45.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18327" PostTypeId="1" CreationDate="2015-06-12T17:04:16.977" Score="0" ViewCount="988" Body="&lt;p&gt;I have a question on the following exercise from &lt;a href=&quot;https://books.google.de/books?id=lwhhrGEkt_AC&amp;amp;pg=PA115&amp;amp;lpg=PA115&amp;amp;dq=Consider%20an%20agent%20who%20borrows%201.36%20a%20time%20zero%20and%20buys%20the%20put.%20Explain&amp;amp;source=bl&amp;amp;ots=tBM76WFpCw&amp;amp;sig=JQDMkfSqih5hoVs0z7bKwiUU9KE&amp;amp;hl=de&amp;amp;sa=X&amp;amp;ved=0CCoQ6AEwAWoVChMI9aSSiMyKxgIVRVcsCh0bcA4k#v=onepage&amp;amp;q=Consider%20an%20agent%20who%20borrows%201.36%20a%20time%20zero%20and%20buys%20the%20put.%20Explain&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;S. Shreve: Stochastic Calculus for Finance, I&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Exercise 4.2. In Example 4.2.1, we computed the time-zero value of the American put with strike price $5$ to be $1.36$. Consider an agent who borrows $1.36$ at time zero and buys the put. Explain how this agent can generate sufficient funds to pay off his loan (which grows by $25 \%$ each period) by trading in the stock and money markets and optimally exercising the put.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The model from Example 4.2.1 he refers to is the following:&#xA;\begin{align*}&#xA; S_0 &amp;amp; = 4 \\&#xA; S_1(H) &amp;amp; = 8, S_1(T) = 2 \\&#xA; S_2(HH) &amp;amp; = 16, S_2(HT) = S_2(TH) = 4, S_2(TT) = 1&#xA;\end{align*}&#xA;with $r = 1/4$ and risk-neutral probabilities $\hat p = \hat q = 1/2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So now my question, I am not sure how to solve this, I guess the agent wants in some way hedge that he can always pay the credit by utilising the option. First how should I think about it, that he should pay back his credit at time step $2$, or earlier if possible by exercising the option, or should he stay liquide until the end? And what means optimal, hedging with minimal invest?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Okay, I solved it by considering two scenarios, first using the option at time step $1$, and then at time step $2$. By using it at time step one I found that he has to invest additional $0.16$, buy $1/2$ from the share, and accordingly borrow $0.16 - 1/2 \cdot 4$ from the bank/monkey market. Then at the first time step, as the option was exercised and the value of the portfolio equals $(1 + r)1.36$ he could just invest everything riskless, i.e. readjusting his portfolio by not buying any shares of stock, and investing in the riskless asset $(1+r)1.36$, in this way at time step $2$ he could pay $(1+r)^2 1.36$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the second scenario, i.e. exercising the option at time step $2$, I found&#xA;that he has to invest additional $1.36$ and buy no share at the initial step, and then readjust in the next step his portfolio as to buy $1/12$ of the share if it goes up and $1.06$ if it goes down, and by exersing the option, if it goes up after paying his debt $(1+r)^2 1.36$ his portfolio has the value $1.3$, meaning he still has money, or $-0.3$ if it goes down, meaning he still has some debt (this point I do not understand fully?...)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So can someone help me in understand and solving this exercise (if my approach is wrong...)?&lt;/p&gt;&#xA;" OwnerUserId="16264" LastActivityDate="2018-06-20T20:05:12.873" Title="&quot;Hedging&quot; a put option, question on exercise" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;portfolio-management&gt;&lt;hedging&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18328" PostTypeId="2" ParentId="18299" CreationDate="2015-06-12T17:08:06.663" Score="3" Body="&lt;p&gt;Lookup something like &quot;free FRM exam&quot; or &quot;FRM exercises&quot;. Here is a free exam from GARP itself, with explanations:&#xA;&lt;a href=&quot;http://www.garp.org/media/613028/frm%20practice%20exam052711.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.garp.org/media/613028/frm%20practice%20exam052711.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this helps&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good luck!&lt;/p&gt;&#xA;" OwnerUserId="16496" LastActivityDate="2015-06-12T17:08:06.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18329" PostTypeId="2" ParentId="18081" CreationDate="2015-06-12T18:18:53.327" Score="0" Body="&lt;p&gt;I found a &lt;a href=&quot;http://sixfigureinvesting.com/2010/09/how-do-vxup-and-vxdn-work/&quot; rel=&quot;nofollow&quot;&gt;blog post&lt;/a&gt; that does a great job summarizing the mechanics behind them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another great article &lt;a href=&quot;http://seekingalpha.com/instablog/10211511-eli-mintz/4020976-the-relation-between-vxup-and-the-vix-futures&quot; rel=&quot;nofollow&quot;&gt;on the relationship between the pair and the future.&lt;/a&gt;. Which may have an impact on &lt;a href=&quot;http://sixfigureinvesting.com/2015/05/vxup-vxdn-impacting-vix-future-term-structure/&quot; rel=&quot;nofollow&quot;&gt;linearizing the VIX Futures Term Structure?&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1764" LastActivityDate="2015-06-12T18:18:53.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18331" PostTypeId="2" ParentId="17389" CreationDate="2015-06-12T23:12:01.620" Score="1" Body="&lt;p&gt;An American Call without dividends is never exercised before maturity, because it is always better to sell it instead. With dividends, one would exercise if the value of future dividends is higher than the time value (from selling the Call).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An American put without dividends is exercised when $S$ hits an optimal exercise boundary (e.g. if $S=0$ one would always exercise because the maximum payoff is reached). Finding the optimal exercise boundary for an AM put is however still an open question, some researches assume an explicit functional and fit it to the model.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2015-06-12T23:12:01.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18332" PostTypeId="2" ParentId="18290" CreationDate="2015-06-12T23:31:23.060" Score="2" Body="&lt;p&gt;This is the Black Scholes Call Price:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;  C(S, t) &amp;amp;= N(d_1)S - N(d_2) Ke^{-r(T - t)} \\&#xA;     d_1 &amp;amp;= \frac{1}{\sigma\sqrt{T - t}}\left[\ln\left(\frac{S}{K}\right) + \left(r + \frac{\sigma^2}{2}\right)(T - t)\right] \\&#xA;     d_2 &amp;amp;= \frac{1}{\sigma\sqrt{T - t}}\left[\ln\left(\frac{S}{K}\right) + \left(r - \frac{\sigma^2}{2}\right)(T - t)\right] \\&#xA;         &amp;amp;= d_1 - \sigma\sqrt{T - t}&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All parameters except the underlying price $S$ are assumed constant.  $S$ has a lognormal distribution and follows a GBM under $Q$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S_t=S_0e^{(r-\frac{\sigma^2}{2})t+\sigma W_{t}^{Q}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can directly observe from the $C(S,t)$ formula that the distribution of $C$ cannot be in closed form since $N(*)$ is not in closed form.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can simulate the distribution of $C$ by drawing many samples from $W\sim N(0,T)$.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2015-06-12T23:31:23.060" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18333" PostTypeId="1" AcceptedAnswerId="18642" CreationDate="2015-06-13T10:17:01.450" Score="11" ViewCount="665" Body="&lt;p&gt;For the purpose of getting fatter tails than the Guassian, I have seen people for example use $\alpha$-stable processes to model the stock. But in that case they end up using 'tempered' versions of the processes, where the tails decay exponentially so as to make the second moment finite. So the standard seems to be that the second moment must be finite. But why is this so? Is it just for tractability of the model or do they believe that finite second moment is an empirical fact? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additional discussion:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;a href=&quot;http://fooledbyrandomness.com/complexityAugust-06.pdf&quot;&gt;this paper&lt;/a&gt; Taleb explores the possibility of constructing a risk-neutral measure in an infinite-variance setting. As he mentions, this destroys the dynamic-hedging theory, but in practice it does not make a difference. &lt;/p&gt;&#xA;" OwnerUserId="7555" LastEditorUserId="7555" LastEditDate="2015-06-29T20:31:40.907" LastActivityDate="2015-07-17T13:38:42.143" Title="Why do people always seek finite-variance models for option pricing" Tags="&lt;option-pricing&gt;&lt;stochastic-processes&gt;&lt;modelling&gt;" AnswerCount="3" CommentCount="7" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18335" PostTypeId="1" CreationDate="2015-06-13T15:02:10.167" Score="4" ViewCount="226" Body="&lt;p&gt;I am analyzing if good governance portfolios outperform bad governance portfolios. After dividing firms with good governance into one pf and bad ones into another for European companies I tried to run the regression of excess monthly returns on the Fama an French factors (from the official library). I have 3 portfolios and I obtain for each a market beta smaller than 0.5 which tells me that my sample is much less volatile than the market, which makes no sense. Any suggestions ? Please&lt;/p&gt;&#xA;" OwnerUserId="16542" LastActivityDate="2015-08-18T06:10:32.080" Title="Fama French model-small market beta (weird)" Tags="&lt;beta&gt;&lt;market&gt;&lt;fama-french&gt;" AnswerCount="2" CommentCount="7" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18336" PostTypeId="1" CreationDate="2015-06-13T16:39:06.113" Score="3" ViewCount="1120" Body="&lt;p&gt;This is probably a very easy question but I am new to the field and couldn't find an answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming that I am building a hedged portfolio with a long option and going short delta on the underlying. Then, if I understood correctly tomorrow's value of the portfolio will be the same as today's. (Please correct if this is a wrong understanding.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: If tomorrow's value is the same as today's (and by extension the day after tomorrow and so on until the option expires) how does this strategy make profits?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="16543" LastEditorUserId="16543" LastEditDate="2015-06-13T18:54:07.740" LastActivityDate="2015-06-13T22:18:15.960" Title="Why/How does a hedged portfolio make profits?" Tags="&lt;option-strategies&gt;&lt;delta-hedging&gt;&lt;hedge&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18337" PostTypeId="2" ParentId="18335" CreationDate="2015-06-13T17:14:33.080" Score="3" Body="&lt;p&gt;Market beta just tells your portfolio has low covariance, scaled by variance, with the market. Remember that &#xA;$$&#xA;\beta= \frac{Cov(x,y)}{Var(x)} = \rho\frac{\sigma_x \sigma_y}{\sigma_x^2}=\rho\frac{\sigma_y}{\sigma_x}&#xA;$$&#xA;You can see that it well may be that $\sigma_x&amp;lt;\sigma_y$ but $\rho$ is small enough to have a beta of 0.5. By the way, you can directly check whether the sample variance of your portfolios is smaller than the sample variance of the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What in general happens with Fama-French factors, to be fair with many other factor models, is that market betas tend to be close to one. But i don't see any problem with the fact you have a beta of 0.5&lt;/p&gt;&#xA;" OwnerUserId="8028" LastEditorUserId="8028" LastEditDate="2015-06-13T17:19:39.380" LastActivityDate="2015-06-13T17:19:39.380" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18338" PostTypeId="1" CreationDate="2015-06-13T17:56:21.797" Score="2" ViewCount="502" Body="&lt;p&gt;I have a table containing the following fields: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Date, PortfolioReturn, CashReturn, Sector1Return,...,Sector10Returns&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;'PortfolioReturn' is the sum of CashReturn + return contributed from 10 market sectors. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are some of the industry standard ways to visually present the return contribution by sectors over time?&lt;/p&gt;&#xA;" OwnerUserId="16544" LastEditorUserId="16544" LastEditDate="2015-06-13T22:57:38.233" LastActivityDate="2015-08-13T14:36:44.437" Title="Portfolio Return Contribution by Sectors" Tags="&lt;returns&gt;&lt;portfolio&gt;&lt;charts&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18339" PostTypeId="1" CreationDate="2015-06-13T18:18:59.630" Score="2" ViewCount="126" Body="&lt;p&gt;I am doing an empirical test of the CIP from the recent financial crisis between Canada and the United States. I am using 1,2,3,6,12 month forwards (monthly data). What interest rates should I use? I don't think T-bills are suitable because you can lend at that rate, but not borrow. Currently I am using LIBOR rates for the US and Canada (even though the Canadian LIBOR was discontinued in 2013 I think it is sufficient). Any feedback would be appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you. &lt;/p&gt;&#xA;" OwnerUserId="16545" LastActivityDate="2015-06-15T11:50:18.687" Title="What interest rate should I use for testing the covered interest parity?" Tags="&lt;finance&gt;&lt;interest&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18340" PostTypeId="1" CreationDate="2015-06-13T19:24:40.283" Score="5" ViewCount="495" Body="&lt;p&gt;I'm reading a 2008 JoFMarkets paper by Shkilko et al. with title &quot;Locked and crossed markets on NASDAQ and the NYSE&quot; in which the authors investigate the determinants of locked and crossed markets. Their data is 3 months (October to December 2003) of quoting and trading (from TAQ database) for 100 NYSE and NASDAQ stocks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the paper the authors talk about &quot;autoquotes&quot;, certain 100 share size limit orders that &quot;... inter-market participants are not required to honor and can trade through them, as they are likely to be placeholder (non-economic) quotes.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone clarify what are these limit orders and whether they still &quot;exist&quot; in today's equity markets? &lt;/p&gt;&#xA;" OwnerUserId="11874" LastActivityDate="2018-10-11T05:11:43.627" Title="What are &quot;Autoquotes&quot;?" Tags="&lt;equities&gt;&lt;market-data&gt;&lt;market-microstructure&gt;&lt;limit-order-book&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18341" PostTypeId="2" ParentId="18336" CreationDate="2015-06-13T20:59:58.537" Score="4" Body="&lt;p&gt;An Investment Bank earns a profit by selling you an option at a slightly higher price than the theoretical price, or buying it back from you at a slightly lower price. They call this &quot;earning a spread&quot;. Then they hedge the option, so as not to make any [further] gains or losses on  it (other than the risk free rate).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way they could earn a profit is if they have a more accurate estimate of volatility than other people have. But that is not easy to do consistently.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2015-06-13T22:18:15.960" LastActivityDate="2015-06-13T22:18:15.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18342" PostTypeId="2" ParentId="18336" CreationDate="2015-06-13T21:35:41.433" Score="1" Body="&lt;p&gt;A perfectly hedged portfolio should not make any profits different from the risk free interest rate. However, you won't be able to hedge perfectly in the real world. Delta hedging for example requires continous trading and adjusting  (this is one way to derive the black -scholes formula: thex hedge the stock perfectly and therefore obtain a risk -free rate deterministic return) - continous trading can not be realized. Furthermore trading costs will distort your return.&#xA;Therefore, you will not obtain a perfect hedge and leave room for making profits  (and loses )&lt;/p&gt;&#xA;" OwnerUserId="16249" LastActivityDate="2015-06-13T21:35:41.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18343" PostTypeId="2" ParentId="18304" CreationDate="2015-06-13T21:47:22.520" Score="0" Body="&lt;p&gt;I think the terminology often leads to confusion. Risk neutral pricing is essentially based on the idea of state prices or Arrow securities.  One imagines or attempts to replicate securities that represent a state of the market. The price that is the consensus price of the market participants is the price of the Arrow security and this defines the state price density and this the risk neutral measure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason different markets often require different risk neutral measures is that the markets are not interconnected enough so that the beliefs of one market's participants determine the state prices in the other market.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of the real world, as mark Joshi said, there is only one real world. It doesn't make sense to have more than one real world measure unless you are alluding to Bayesian interpretations of probability. &lt;/p&gt;&#xA;" OwnerUserId="2477" LastActivityDate="2015-06-13T21:47:22.520" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="18344" PostTypeId="2" ParentId="18338" CreationDate="2015-06-14T00:39:49.860" Score="1" Body="&lt;p&gt;I would make a cumulative return chart, using a different color for each sector. Each line starts at 1, and each successive point is found by multiplying the previous point by (1+SectorReturn) for that sector.  The horizontal axis shows dates. By looking at the lines on this chart you get a visual feel for what sectors performed best overall and also the pattern over time of sector returns.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-06-14T00:39:49.860" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18345" PostTypeId="2" ParentId="18340" CreationDate="2015-06-14T00:54:58.200" Score="2" Body="&lt;p&gt;Quote: Starting in 2003, the NYSE started disseminating automatically, with a software called autoquote, any change in the best quotes in its listed stocks. Before that specialists had to update manually new inside quotes in the LOB. This implementation considerably accelerated the speed at which algorithmic traders receive information Endquote&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source: Market Microstructure: Confronting many viewpoints, book by Abergel and others, Published by Wiley (2012)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it sounds to me like an early step in the automation of trading and the transition away from a manual &quot;specialist&quot; and is probably of historical interest only at this point. But I am not sure.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2015-06-15T04:46:53.567" LastActivityDate="2015-06-15T04:46:53.567" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18346" PostTypeId="1" CreationDate="2015-06-14T03:35:23.860" Score="8" ViewCount="666" Body="&lt;p&gt;A question in some private notes I'm struggling to work through (exam. prep.). (iii) is where I hit a wall with my understanding &amp;amp; I'm lost thereafter. Any help/clarification gratefully received.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a financial market with $d = 1$ risk security, whose price $S^1$ is determined by $$dS_t^1 = (1/{S_t^1})dt + dW_t^1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, the risk-free rate is $r_f=0$, so the price of the money-market account is $S^0 = 1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i) Derive an expression for the market price of risk&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ii) Derive a stochastic differential equation for the numeraire portfolio&lt;/p&gt;&#xA;&#xA;&lt;p&gt;iii) Use the real-world pricing forumla to derive an expression for the price of a zero-coupon bond (ZCB) with a face-value of $1 (Note: Notice the ZCB is an equity derivative in this model!)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;iv) Derive expression for the weights of the hedge portfolio for the ZCB&lt;/p&gt;&#xA;&#xA;&lt;p&gt;v) Consider a portfolio consisting of a long position in the hedge portfolio above, and a short position in the money-market account, structured in such a way that its initial value is zero. What is the final payoff of this portfolio? What type of arbitrage is it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;vi) Does the model in question satisfy NA$_+$? Justify.&#xA;vii) Does the model in question satisfy NA? Justify.&#xA;viii) Does the model in question satisfy NUPBR? Justify.&#xA;ix) Does the model in question satisfy NFLVR? Justify.&lt;/p&gt;&#xA;" OwnerUserId="16548" LastEditorUserId="9336" LastEditDate="2015-06-14T07:59:26.940" LastActivityDate="2018-12-10T04:04:55.920" Title="Completeness and Hedging Question" Tags="&lt;portfolio&gt;" AnswerCount="2" CommentCount="7" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18347" PostTypeId="1" CreationDate="2015-06-14T11:30:46.570" Score="1" ViewCount="64" Body="&lt;p&gt;I modeled the performance of several portfolios with adjusted close data and would now like to understand how much of it is driven by changes in stock price and dividend payouts. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have all the data but am unsure about the right approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have a pointer where to learn more about doing this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help will be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="16550" LastEditorUserId="2553" LastEditDate="2015-06-25T11:25:49.877" LastActivityDate="2015-06-25T11:25:49.877" Title="Disaggregating stock performance and dividend yield" Tags="&lt;portfolio-management&gt;&lt;dividends&gt;&lt;asset-returns&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18349" PostTypeId="1" CreationDate="2015-06-14T13:54:59.187" Score="1" ViewCount="85" Body="&lt;p&gt;I'm following the methodology outlined in &lt;a href=&quot;http://dspace.mit.edu/bitstream/handle/1721.1/59122/658860705-MIT.pdf&quot; rel=&quot;nofollow&quot;&gt;Developing High-Frequency Equities Trading Models&lt;/a&gt;. On page 27, the author outlines an OLS regression model to obtain beta coefficients. The model is defined as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_{t+1} + ... + r_{t+H} = \beta_1\sum_{i=0}^HD_{t-i,1}+...+\beta_{k}\sum_{i=0}^HD_{t-i,k}+\eta_{t+H,H}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $r_{t+1} + ... + r_{t+H}$ is the accumulated $H$-period log return, $D=R^{T,k}$ is a $Txk$ matrix of dimentionally reduced log returns (principal components) obtained after projecting de-meaned log returns on the highest $k$ eigenvectors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The author defines the process estimating $r_{t+1} + ... + r_{t+H}$ as such:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We calculated the accumulated future $H$-period log returns. Then we ran a regression, estimated by OLS, on the future accumulate log returns with the last sum of $H$-period dimensionally reduced returns in the principal component space.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I'm struggling a bit to understand how to implement this model. I suppose where I am most confused is in the statement &quot;We calculated the accumulated future $H$-period log returns.&quot; I can see clearly that the independent variables are the accumulated $H$-period dimentionally reduced log returns but I do not understand what the dependent variable would be in this case as we do not have future accumulated returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is likely simply a question on syntax but one that has confused me in the past as well. So stated simply, what is the independent variable in this model?&lt;/p&gt;&#xA;" OwnerUserId="1112" LastEditorUserId="1112" LastEditDate="2015-06-15T07:53:16.820" LastActivityDate="2015-06-15T08:58:43.397" Title="Regression model syntax" Tags="&lt;high-frequency&gt;&lt;regression&gt;&lt;principal-components&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18351" PostTypeId="1" CreationDate="2015-06-14T18:58:32.873" Score="2" ViewCount="162" Body="&lt;p&gt;I am having some trouble setting up a replicating strategy for a call option with a three step binomial model (discrete).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have no trouble doing this in a two step binomial model by backward recursion on time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any guidance on how to do this with a three step binomial model (discrete)?&lt;/p&gt;&#xA;" OwnerUserId="16555" LastActivityDate="2015-06-14T18:58:32.873" Title="replicating strategy three step binomial" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;replication&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18352" PostTypeId="1" CreationDate="2015-06-14T19:13:41.627" Score="0" ViewCount="97" Body="&lt;p&gt;I priced a long-term option (10 or 20 years) using two different models: one assumes constant interest rates, the other assumes stochastic interest rates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way (e.g. a benchmark) to compare these results or a test to choose the best model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also noted that the result of the model which has stochastic interest rates depends on the (chosen) initial value of the simulation. Since it is reasonable to use for this the last observable value of the interest rate time series, what would be the right value to assume constant for the other model (taking into account that this is a long-term option)? &lt;/p&gt;&#xA;" OwnerUserId="12214" LastActivityDate="2015-06-14T19:13:41.627" Title="Benchmarking option pricing under stochastic interest rates" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;interest-rates&gt;&lt;pricing&gt;&lt;stochastic-discount&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18354" PostTypeId="2" ParentId="18299" CreationDate="2015-06-14T21:18:05.593" Score="3" Body="&lt;p&gt;Interesting question. The one book I heard about is &quot;Market Risk Analysis&quot; by  &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470997990&quot; rel=&quot;nofollow&quot;&gt;Carol Alexander&lt;/a&gt;. However I think you should try to search for some company specific materials. Sometimes big banks like Credit-Suisse or Deutche Bank publish some materials which are hard-to-find by other means.&lt;/p&gt;&#xA;" OwnerUserId="6599" LastActivityDate="2015-06-14T21:18:05.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18355" PostTypeId="1" CreationDate="2015-06-14T21:51:57.763" Score="6" ViewCount="473" Body="&lt;p&gt;In the following exercise, I can't get started on question 2) as I am not sure what to do when there is an integral inside:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/UnXWH.png&quot; alt=&quot;ito-example&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you help me out?&lt;/p&gt;&#xA;" OwnerUserId="16557" LastEditorUserId="467" LastEditDate="2015-06-16T08:04:32.403" LastActivityDate="2015-06-16T12:42:48.793" Title="How to tackle this exercise about Ito's formula?" Tags="&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18356" PostTypeId="1" CreationDate="2015-06-14T23:00:07.620" Score="-1" ViewCount="100" Body="&lt;p&gt;How can I calculate the monthly return net of fees if the fee is annual?For example, if every year there is a 20% incentive fee, is there a formula to adjust the return of each month to compensate for the annual fee?&lt;/p&gt;&#xA;" OwnerUserId="16558" LastEditorUserId="16160" LastEditDate="2015-06-15T06:42:25.340" LastActivityDate="2015-06-15T06:42:25.340" Title="Monthly Return Net of Fees" Tags="&lt;backtesting&gt;&lt;finance&gt;&lt;hedge-fund&gt;" AnswerCount="1" CommentCount="4" ClosedDate="2015-06-15T13:38:45.447" ContentLicense="CC BY-SA 3.0" />
  <row Id="18357" PostTypeId="2" ParentId="18339" CreationDate="2015-06-14T23:18:51.267" Score="1" Body="&lt;p&gt;I believe in the literature they use either the T-bill rate or short term bank deposit rate.  &lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-06-14T23:18:51.267" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18358" PostTypeId="2" ParentId="18356" CreationDate="2015-06-14T23:54:37.613" Score="1" Body="&lt;p&gt;Let Ri be the monthly returns (R1 for Jan, R2 for Feb, etc)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let Ci the the cumulative returns (C0= 0, C1=R1, C2=R1+R2, etc)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let AWCi be the above water cumulative return, defined as AWCi=MAX[0,Ci]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In any month, the manager &quot;receives&quot; 0.2*[AWCi-AWC{i-1}] ; I say receives in quotes because this number can be negative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the investor receives the rest of the return i.e. Ri-0.2*[AWCi-AWC{i-1}]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: This is the &lt;em&gt;simplest&lt;/em&gt; approach, there can be additional complications, so best find out the rules used by the particular HF in question.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2015-06-15T00:13:09.543" LastActivityDate="2015-06-15T00:13:09.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18359" PostTypeId="1" AcceptedAnswerId="18362" CreationDate="2015-06-15T05:11:49.753" Score="1" ViewCount="3163" Body="&lt;p&gt;If an implied volatility of an out of the money call option goes to infinity,what happens to the delta of the said call option?&lt;/p&gt;&#xA;" OwnerUserId="16560" LastActivityDate="2015-06-15T09:19:46.323" Title="Implied volatility interview question" Tags="&lt;implied-volatility&gt;&lt;delta&gt;" AnswerCount="1" CommentCount="2" ClosedDate="2015-06-15T15:01:50.433" ContentLicense="CC BY-SA 3.0" />
  <row Id="18361" PostTypeId="2" ParentId="18349" CreationDate="2015-06-15T08:58:43.397" Score="1" Body="&lt;p&gt;I browsed through the work and this is what I see:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the lhs $r_{t+1} + \cdots + r_{t+H}$ is the sum of log-returns after $t$.&lt;/li&gt;&#xA;&lt;li&gt;the rhs is indexed by $t-i, i=0, \ldots, H$ thus this has something to do with the past before (and at) $t$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Thus the regression models the future ($r_{t+1} + \cdots + r_{t+H}$) dependent of the past where only PCA projections of past returns are used. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the thesis they talk about historical $H-$period (dimensionally-reduced) returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus the estimation of the model is clear. Then having estimated the vector $\beta$ you do the following at time $t$:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Do PCA on the returns before and at $t$  to get $D_{t-i,j}$.&lt;/li&gt;&#xA;&lt;li&gt;Predict $r_{t+1} + \cdots + r_{t+H}$ by multiplying these quantities be the betas estimated.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-06-15T08:58:43.397" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18362" PostTypeId="2" ParentId="18359" CreationDate="2015-06-15T09:19:46.323" Score="2" Body="&lt;p&gt;The Black-Scholes &lt;a href=&quot;https://en.wikipedia.org/wiki/Black%E2%80%93Scholes_model#The_Greeks&quot; rel=&quot;nofollow&quot;&gt;delta&lt;/a&gt;:&#xA;$$\partial_SC=N\left(\dfrac{\ln\left(\frac{S_0}{K}\right) +(r - q + \frac{1}{2}\sigma^2)(T - t)}{\sigma\sqrt{T - t}}\right)$$&#xA;As you can see this delta would go to$1$ if $\sigma\to\infty$ (and $t&amp;lt;T$).&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2015-06-15T09:19:46.323" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18363" PostTypeId="2" ParentId="18339" CreationDate="2015-06-15T11:50:18.687" Score="1" Body="&lt;p&gt;My personal preference is to use OIS rate for recent years, and LIBOR when OIS isn't available. If neither is available, CB target rate can also be used.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2015-06-15T11:50:18.687" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18364" PostTypeId="2" ParentId="18188" CreationDate="2015-06-15T13:06:06.603" Score="1" Body="&lt;p&gt;MorningStar or Lipper will be your best bets if you want everything in a nice machine readable format. &lt;a href=&quot;http://www.etf.com/etfanalytics/etfcom-data-products&quot; rel=&quot;nofollow&quot;&gt;factset/etf.com&lt;/a&gt; or &lt;a href=&quot;http://etfdb.com/data-and-licensing-opportunities/&quot; rel=&quot;nofollow&quot;&gt;etfdb&lt;/a&gt; are great sources for etf data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to go through the web, you can try etf.com or etfdb.com for the ETFs and morningstar.com for the mutual funds.&lt;/p&gt;&#xA;" OwnerUserId="1764" LastActivityDate="2015-06-15T13:06:06.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18366" PostTypeId="1" AcceptedAnswerId="18368" CreationDate="2015-06-15T14:58:31.357" Score="2" ViewCount="360" Body="&lt;p&gt;To hedge a call, one would invest the option price proceeds into $\Delta_t*S_t + B_t = c_t$. (ok)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, a put has negative delta, so I would short $\Delta_t*S_t$ and invest $p_t+\Delta_t*S_t&amp;gt;p_t$ into a risk-free bond?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It just seems a bit odd to me that I would invest more than the actual put price into a bond.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="467" LastEditDate="2015-06-16T02:06:16.453" LastActivityDate="2015-06-16T02:06:16.453" Title="How to hedge a put under the Black-Scholes model?" Tags="&lt;options&gt;&lt;hedging&gt;&lt;delta-hedging&gt;&lt;put&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18367" PostTypeId="1" AcceptedAnswerId="18379" CreationDate="2015-06-15T16:39:04.083" Score="8" ViewCount="349" Body="&lt;p&gt;I would be interested in knowing if the fact that returns are Gaussian is disproved on all time frames, or if, for example, the 5 minute intra-day time frame could exhibits Gaussian returns assuming there are no micro-structure issues (low volume).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally is there any relationship between the time frame of equity returns and their generating distribution? Any known research in this direction?&lt;/p&gt;&#xA;" OwnerUserId="15188" LastActivityDate="2015-07-30T11:06:16.263" Title="Can Gaussianity of returns depend on the time frame?" Tags="&lt;equities&gt;&lt;returns&gt;&lt;reference-request&gt;&lt;distribution&gt;" AnswerCount="3" CommentCount="5" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18368" PostTypeId="2" ParentId="18366" CreationDate="2015-06-15T17:08:13.893" Score="2" Body="&lt;p&gt;Assuming zero interest, the put option has the price&#xA;\begin{align*}&#xA;KN(-d_2)-S_0N(-d_1),&#xA;\end{align*}&#xA;and delta $-N(-d_1)$. When $N(-d_1)$ units of stocks are shorted and invested in bonds, the total value in bonds is $KN(-d_2)$, which is indeed greater than the option price. However, as you have shorted $N(-d_1)$ units of stocks, your portfolio value is &#xA;\begin{align*}&#xA;KN(-d_2) -N(-d_1) S_t&#xA;\end{align*}&#xA;at time $t$. That is, the portfolio value is not necessarily greater than the option price, and at the deal inception, is the same as the option price. &lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="-1" LastEditDate="2015-06-15T22:33:13.250" LastActivityDate="2015-06-15T22:33:13.250" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18370" PostTypeId="2" ParentId="18355" CreationDate="2015-06-15T19:10:55.800" Score="6" Body="&lt;p&gt;Let&#xA;\begin{align*}&#xA;X_t = W(t)W_*(t) - \frac{1}{2}\int_0^t\big(W_*(u)^2+ W(u)^2\big)du.&#xA;\end{align*}&#xA;Then, &#xA;\begin{align*}&#xA;dX_t &amp;amp;= W(t) dW_*(t) + W_*(t) dW(t) -\frac{1}{2}\left(W_*(t)^2+ W(t)^2\right)dt,&#xA;\end{align*}&#xA;as $W$ and $W_*$ are independent. Consequently,&#xA;\begin{align*}&#xA;X_t = \int_0^t \big[W(s) dW_*(s) + W_*(s) dW(s)\big] -\frac{1}{2}\int_0^t\left(W_*(s)^2+ W(s)^2\right)ds.&#xA;\end{align*}&#xA;Moreover,&#xA;\begin{align*}&#xA;\langle X, X\rangle_t = \int_0^t\left(W_*(s)^2+ W(s)^2\right)ds.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;d\langle X, X\rangle_t &amp;amp;= \left(W_*(t)^2+ W(t)^2\right)dt.&#xA;\end{align*}&#xA;Since $R_2(t) = e^{X_t}$, &#xA;\begin{align*}&#xA;dR_2(t) &amp;amp;= e^{X_t} dX_t + \frac{1}{2}e^{X_t}d\langle X, X\rangle_t\\&#xA;&amp;amp;= R_2(t)\Big( W(t) dW_*(t) + W_*(t) dW(t) \Big).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-06-16T12:42:48.793" LastActivityDate="2015-06-16T12:42:48.793" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18371" PostTypeId="1" CreationDate="2015-06-15T20:25:30.313" Score="4" ViewCount="541" Body="&lt;p&gt;Consider a Monte Carlo (MC) approximation to a European call with BS parameters $r = 0.05, \sigma = 0.4, T = 10, S_0 = 50$ and $K = 95$.  Consider the following results, each using 1M points: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;plain MC: $\$21.6901 \pm \$0.1735$&lt;/li&gt;&#xA;&lt;li&gt;importance sampling with the sampling &lt;em&gt;mean&lt;/em&gt; of $S_T = K$: $\$21.7161 \pm \$0.1511$&lt;/li&gt;&#xA;&lt;li&gt;importance sampling with the sampling &lt;em&gt;median&lt;/em&gt; of $S_T = K$: $\$21.8104 \pm \$0.0650$&lt;/li&gt;&#xA;&lt;li&gt;importance sampling with the sampling &lt;em&gt;mode&lt;/em&gt; of $S_T = K$: $\$21.7801 \pm \$0.0210$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;where the $\pm$ is a 95% confidence interval.  The BS price is $\$21.7766$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that setting the sampling mode of $S_T$ to $K$ offers the greatest variance reduction, but is this a general rule?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am actually a bit suspicious of importance sampling because when I use more &quot;reasonable&quot; parameters, importance sampling sometimes increases the variance. Indeed, again with 1M points but using $r = 0.05, \sigma = 0.2, T = 1, S_0 = 50$ and $K = 50$ I get&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;plain MC: $\$5.2192 \pm \$0.0144$&lt;/li&gt;&#xA;&lt;li&gt;importance sampling with the sampling &lt;em&gt;mean&lt;/em&gt; of $S_T = K$: $\$5.2162 \pm \$0.0197$&lt;/li&gt;&#xA;&lt;li&gt;importance sampling with the sampling &lt;em&gt;median&lt;/em&gt; of $S_T = K$: $\$5.2133 \pm \$0.0173$&lt;/li&gt;&#xA;&lt;li&gt;importance sampling with the sampling &lt;em&gt;mode&lt;/em&gt; of $S_T = K$: $\$5.2207 \pm \$0.0136$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;with BS price $\$5.2253$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For plain vanillas, is there a good rule on how to pick the sampling distribution?  (plain vanillas because they are more tractable for me :))&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2015-06-16T22:09:09.510" Title="Importance Sampling - where to center the sampling distribution?" Tags="&lt;option-pricing&gt;&lt;monte-carlo&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18372" PostTypeId="2" ParentId="18371" CreationDate="2015-06-15T21:39:20.313" Score="6" Body="&lt;p&gt;importance sampling is well known to be tricky. See the extensive discussion in Glasserman's book. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I presume that you are simply meanshifting and multiply by the ratio of normal densities. For this sort of problem, I'd use a more stratified algorithm instead and force every path to end in the money. To do this I'd compute the uniform that goes to the strike and rescale uniforms to be above it. I'd then multiply by the probability of this event to compensate. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-06-15T21:39:20.313" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18373" PostTypeId="1" CreationDate="2015-06-15T23:27:28.020" Score="5" ViewCount="151" Body="&lt;p&gt;When learning econometrics I have usually seen stuff from the following perspective:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Assume $Y_t = f(X_t) + e_t$, where f is some function of $X_t$ (typically linear). For example, assume $Y_t = X_t * \beta + e_t$. Then if $e_t$ satisfies certain properties the OLS estimator will converge to beta.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;However I have also seen, but less frequently:&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;Make no assumption on the function relationship between $Y_t$ and $X_t$. Without any assumptions we know there exists an optimal linear approximation of $E[Y_t|X_t]$ (the alpha such that $X_t*\alpha + e_t$ minimizes MSE, for example). Now if we assume that $(Y_t,X_t)$ is covariance stationary, the OLS estimator converges to alpha.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;To me it seems like the perspective of 2. is more interesting because the analysis is not predicated on assuming that Y and X have a specific functional relationship. Instead, assumptions like &quot;covariance stationary&quot; seem more general than assuming that $Y = a + bX + e$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a reason why there seems to be more of a focus on 1.? Are the two perspectives related in some way? &lt;/p&gt;&#xA;" OwnerUserId="16567" LastEditorUserId="16567" LastEditDate="2015-06-16T03:10:06.453" LastActivityDate="2015-06-17T19:38:24.903" Title="Is there a relation between these two forecasting/estimation approaches?" Tags="&lt;time-series&gt;&lt;forecasting&gt;&lt;econometrics&gt;&lt;estimation&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18375" PostTypeId="2" ParentId="18367" CreationDate="2015-06-16T02:07:12.510" Score="4" Body="&lt;p&gt;Surely, there is; search for aggregational gaussianity in &lt;a href=&quot;https://scholar.google.com.hk/&quot; rel=&quot;nofollow&quot;&gt;Google Scholar&lt;/a&gt; or &lt;a href=&quot;http://www.sciencedirect.com/&quot; rel=&quot;nofollow&quot;&gt;ScienceDirect&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, 5 minutes returns are leptokurtic and fat-tailed; then as you increase timeframe, returns become more and more normal. Yearly data is almost normal, if you have enough points.&lt;/p&gt;&#xA;" OwnerUserId="6535" LastEditorUserId="467" LastEditDate="2015-06-16T06:36:30.063" LastActivityDate="2015-06-16T06:36:30.063" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18377" PostTypeId="1" CreationDate="2015-06-16T08:59:28.430" Score="2" ViewCount="270" Body="&lt;p&gt;Let's say I have a stock that pays dividend once a year. I know how much did it pay in 2014, and at which level was stock trading when the dividend decision was made. I'd like to use these data to estimate dividend of 2015 as a function of the stock price: $D = f(S)$. Clearly, $f(S) \leq S$ and a naive assumption would be that $f$ is monotonic. Is there any research done on this topic, I mean what are other natural properties $f$ shall have, and examples of it?&lt;/p&gt;&#xA;" OwnerUserId="13480" LastEditorUserId="13480" LastEditDate="2015-06-17T15:32:20.440" LastActivityDate="2015-06-17T15:32:20.440" Title="Dividend as a function of stock" Tags="&lt;dividends&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18378" PostTypeId="1" AcceptedAnswerId="18454" CreationDate="2015-06-16T09:09:19.437" Score="2" ViewCount="256" Body="&lt;p&gt;In portfolio allocation literature there is lot of effort made in obtaining 'better' portfolio weights, for example via improving parameter estimates, introducing Bayesian approaches, incorporating constraints in the optimization procedure or by incorporating other predictive variables.&#xA;However, in most empirical horse races &lt;a href=&quot;http://www.google.de/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0CCIQFjAAahUKEwiFtZn67ZPGAhXF8XIKHcO7DOc&amp;amp;url=http%3A%2F%2Ffaculty.london.edu%2Favmiguel%2FDeMiguel-Garlappi-Uppal-RFS.pdf&amp;amp;ei=yeZ_VcWsF8XjywPD97K4Dg&amp;amp;usg=AFQjCNH_jV6Gdnk4vRjnSTf4KssSOUfBZg&amp;amp;sig2=9H6MFZfflI1cN4-nra52tw&amp;amp;bvm=bv.96041959,d.bGQ&quot; rel=&quot;nofollow&quot;&gt;(for example the famous work of &lt;strong&gt;DeMiguel et al&lt;/strong&gt;)&lt;/a&gt; monthly reallocation is considered. Especially when taking transaction costs into account, most of the models fail as they loose performance due to estimation risk and the extreme weights cause high turnover. Therefore I am primarily interested in approaches that specify &lt;strong&gt;when&lt;/strong&gt; to rebalance your portfolio instead of searching for fancier optimization techniques. What approaches do you know that monitor portfolio weights for 'structural breaks' in the allocation and help to specify the timing of reallocation?&lt;/p&gt;&#xA;" OwnerUserId="16249" LastEditorUserId="16249" LastEditDate="2015-06-16T17:20:17.823" LastActivityDate="2015-06-19T22:41:02.603" Title="When to adjust portfolio weights?" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;reference-request&gt;&lt;portfolio-optimization&gt;&lt;transaction-costs&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18379" PostTypeId="2" ParentId="18367" CreationDate="2015-06-16T09:59:29.380" Score="3" Body="&lt;p&gt;My main reference will be &lt;a href=&quot;http://arxiv.org/abs/1506.01660&quot; rel=&quot;nofollow&quot;&gt;&quot;Dan Xu, Christian Beck - Transition from lognormal to chi-square superstatistics for financial time series&quot;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Non-equilibrium statistical mechanics (more specifically, superstatistics) gives some ideas of explaining the relation between time frame and its distribution: &quot;...to regard the time series as a superposition of local Gaussian process weighted with a process of a slowly changing variance parameter&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In their article, the authors found out empirically that: &quot;Chi-square superstatistics appears to best suitable for daily price change (assuming independent variation of volatility parameter in each interval), whereas on much smaller time scales of minutes, lognormal superstatistics seems preferrable&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are couples of related articles on this topic:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;M. Ausloos and K. Ivanova - Dynamical model and nonextensive statistical mechanics of a market index on large time windows&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Katz, Y.A.; Tian, L. - Superstatistical fluctuations in time series of leverage returns&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;S.M.D. Queirós and C. Tsallis - On the connection between financial processes with stochastic volatility and nonextensive statistical mechanics&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;C. Becka, E.G.D. Cohen - Superstatistics&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I'm not expert in this field, but hope the idea may help.&lt;/p&gt;&#xA;" OwnerUserId="6461" LastEditorUserId="6461" LastEditDate="2015-07-30T11:06:16.263" LastActivityDate="2015-07-30T11:06:16.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18380" PostTypeId="2" ParentId="3094" CreationDate="2015-06-16T10:15:42.693" Score="3" Body="&lt;p&gt;I am also interested in resolving this problem, although, decided not to create separate thread for it yet. This is kind of continuation of previous question below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stats.stackexchange.com/questions/34396/im-getting-jumpy-loadings-in-rollapply-pca-in-r-can-i-fix-it&quot;&gt;https://stats.stackexchange.com/questions/34396/im-getting-jumpy-loadings-in-rollapply-pca-in-r-can-i-fix-it&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In factor analysis, specifically PCA, sign of the loadings does not mean anything, but if someone, like me, wants to project time series to selected principal component then we will see the picture like on the link above - jumpy loadings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All answers that I have seen speculated with multiplying vector by minus 1 if you think that particular vector with loadings jumps too much. There are even answers that suggest how exactly to identify that &quot;too much&quot; by comparing two vectors - actual and previous. But it is still not enough because even according to the answers I will be able to identify sign changes only in the middle of the sequence, when I have calculated 2 vectors and am able to compare them. It is not enough because I still need to be sure that first sign was defined properly and &lt;strong&gt;here is the problem&lt;/strong&gt; - you assume that first eigenvector is correct, compute next one and realize that sign needs to be changed, the same for the rest of the sequence and when you plot this to the chart you realize that loadings are not jumpy anymore but the whole &lt;strong&gt;chart is inverted&lt;/strong&gt; because when you calculated first eigenvector it was wrong and nobody yet suggested how to check exactly FIRST eigenvector without comparing it with the others.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the moment, I have three suggestions of how these jumps in loadings can be removed.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;summarize all values in eigenvector to predict what eigenspace it lays in&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;eigenvector [-0.5, 0.2, 0.4]&#xA;-0.5 + 0.2 + 0.4 = 0.1 &amp;gt; 0 = sign is correct and should not change&#xA;&#xA;eigenvector [-0.5, 0.2, 0.1]&#xA;-0.5 + 0.2 + 0.1 = -0.2 &amp;lt; 0 = change sign&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;compute dot product between actual and previous vectors&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;vectorActual [-0.5, 0.2]&#xA;vectorPrev [0.3, -0.1]&#xA;-0.5 * 0.3 + 0.2 * -0.1 = -0.17 &amp;lt; 0 = change sign&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;compute difference between actual and previous vectors&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;vectorActual [-0.5, 0.2]&#xA;vectorPrev [0.3, -0.1]&#xA;&#xA;Diff = MathAbs(-0.5 - 0.3) + MathAbs(0.2 - -0.1) = 1.1&#xA;Sum  = MathAbs(-0.5 + 0.3) + MathAbs(0.2 + -0.1) = 0.3&#xA;Diff &amp;gt; Sum = change sign&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I am attaching image with a chart to show what I mean.&#xA;As far as you can see, simple summary shows good results without inversion but in some case jumps are possible. At the same time, Dot Product and comparison between Diff - Sum show chart without jumps at all but it is inverted, which is wrong!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;High resolution image - &lt;a href=&quot;http://snag.gy/zCqHx.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://snag.gy/zCqHx.jpg&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/NwH0n.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, as far as this may be an answer to the question in this topic I am still interested in &lt;strong&gt;how to check that orientation of the FIRST vector in a sequence is correct?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="6855" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2015-06-16T16:43:52.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18381" PostTypeId="1" CreationDate="2015-06-16T10:16:15.810" Score="1" ViewCount="2896" Body="&lt;p&gt;section 1. Calculating sensitivity of the price of derivatives American or European option using binomial tree model&lt;/p&gt;&#xA;&#xA;&lt;p&gt;section 2. Calculating first order greeks &lt;/p&gt;&#xA;&#xA;&lt;p&gt;the code compiles till this point value = optionM(1,1);&#xA;unable to proceed to the next iteration to calculate the delta, gamma,vega, rho&#xA;Kindly give your inputs&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in Advance&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function [value,delta,gamma,theta,vega,rho] = BinomialTreeGreeks(putCall,...&#xA;exerciseType,S0,K,sigma,r,div,T,n)&#xA;%&#xA;% This function calculates the American or European option value by a&#xA;% binomal tree model.&#xA;%&#xA;% [value,delta,gamma,theta,vega,rho] = ...&#xA;% BinomialTreeGreeks(putCall,exerciseType,S0,K,sigma,r,div,T,n)&#xA;%&#xA;% Input: putCall: indicates the option type&#xA;% putCall = ’Call’ for a call option&#xA;% putCall = ’Put’ for a put&#xA;% option&#xA;% exerciseType: European (’E’) or American (’A’)&#xA;% exercise type&#xA;% S: Stock price&#xA;% K: Strike price&#xA;% sigma: Volatility&#xA;% r: riskfree rate&#xA;% div: Dividend yield&#xA;% T: Time to maturity&#xA;% n: Number of steps in the tree&#xA;%&#xA;% OUTPUT: value: option value&#xA;% delta: dV/dS&#xA;% gamma: dV^2/d^2S&#xA;% theta: dV/dT&#xA;% vega: dV/dsigma&#xA;% rho: dV/dr&#xA;%&#xA;% EXAMPLE: [value,delta,gamma,theta,vega,rho] = ...&#xA;% BinomialTreeGreeks(’Put’,’A’,50,50,0.4,0.05,0.02,2,500)&#xA;% Parameters for binomial tree&#xA;dt = T/n;&#xA;u = exp(sigma*sqrt(dt));&#xA;d = 1/u;&#xA;p = (exp((r-div)*dt)-d)/(u-d);&#xA;q = 1-p;&#xA;disc = exp(-r*dt);&#xA;% Initialize matrices&#xA;stockM = zeros(n+1,n+1);&#xA;optionM = zeros(n+1,n+1);&#xA;% Create stock tree&#xA;stockM (1,1) = S0;&#xA;for j = 2:n+1&#xA;for i = 1:j-1&#xA;stockM(i,j) = stockM(i,j-1)*u;&#xA;end&#xA;stockM(i+1,j) = stockM(i,j-1)*d;&#xA;end&#xA;% Set z parameter to calculate the option payoff depending on the&#xA;% selected option type (Call, Put)&#xA;switch putCall&#xA;case 'Call'&#xA;z = 1;&#xA;case 'Put'&#xA;z = -1;&#xA;otherwise&#xA;error('Check option type!');&#xA;end&#xA;% Insert terminal values&#xA;optionM(:,end) = max(z*(stockM(:,end)-K),0);&#xA;% Value call by working backward from time n-1 to time 0&#xA;switch exerciseType&#xA;% European option&#xA;case 'E'&#xA;for j=n:-1:1;&#xA;for i=j:-1:1;&#xA;optionM(i,j) = disc*(p*optionM(i,j+1)+q*optionM(i+1,j+1));&#xA;end&#xA;end;&#xA;% American exercise type&#xA;case 'A'&#xA;for j=n:-1:1;&#xA;for i=j:-1:1;&#xA;optionM(i,j) = max(z*(stockM(i,j)-K),disc*(p*optionM(i,j+1)+q*optionM(i+1,j+1)));&#xA;end&#xA;end&#xA;otherwise&#xA;error('Check exercise type!');&#xA;end&#xA;value = optionM(1,1);&#xA;% Calculate greeks&#xA;if nargout &amp;gt; 1&#xA;delta = (optionM(1,2)-optionM(2,2))/(stockM(1,2)-stockM(2,2));&#xA;end&#xA;if nargout &amp;gt; 2&#xA;deltaUp = (optionM(1,3)-optionM(2,3))/(stockM(1,3)-stockM(2,3));&#xA;deltaDown = (optionM(2,3)-optionM(3,3))/(stockM(2,3)-stockM(3,3));&#xA;gamma = (deltaUp-deltaDown)/((stockM(1,3)-stockM(3,3))/2);&#xA;end&#xA;if nargout &amp;gt; 3&#xA;theta = (optionM(2,3)-optionM(1,1))/(2*dt);&#xA;end&#xA;% Calculate vega and rho with re-evaluation&#xA;if nargout &amp;gt; 4&#xA;vegaUp = feval(@BinomialTreeGreeks,putCall,exerciseType,S0,K,...&#xA;sigma+0.01,r,div,T,n);&#xA;vegaDown = feval(@BinomialTreeGreeks,putCall,exerciseType,S0,K,...&#xA;sigma-0.01,r,div,T,n);&#xA;vega = (vegaUp - vegaDown)/(2*0.01);&#xA;end&#xA;if nargout &amp;gt; 5&#xA;rhoUp = feval(@BinomialTreeGreeks,putCall,exerciseType,S0,K,sigma,...&#xA;r+0.01,div,T,n);&#xA;rhoDown = feval(@BinomialTreeGreeks,putCall,exerciseType,S0,K,sigma,...&#xA;r-0.01,div,T,n);&#xA;rho = (rhoUp - rhoDown)/(2*0.01);&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="16570" LastEditorUserId="16570" LastEditDate="2015-06-18T09:05:18.023" LastActivityDate="2015-06-18T09:05:18.023" Title="Calculating Greeks using BinomialTree in Matlab" Tags="&lt;greeks&gt;&lt;binomial-tree&gt;" AnswerCount="0" CommentCount="5" ClosedDate="2015-06-16T11:21:00.667" ContentLicense="CC BY-SA 3.0" />
  <row Id="18382" PostTypeId="1" CreationDate="2015-06-16T10:23:04.683" Score="7" ViewCount="715" Body="&lt;p&gt;I am reading the 2014 SEC filing against Athena, a HFT firm. (&lt;a href=&quot;http://www.sec.gov/litigation/admin/2014/34-73369.pdf&quot;&gt;http://www.sec.gov/litigation/admin/2014/34-73369.pdf&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At point 29, they describe the behavior of Athena moments before market closing time. I am confused by 3:50:00.578. What are Sell Imbalance-Only orders? Why are they priced at only $0.01? And how do they help in Athena's profits?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="16376" LastActivityDate="2016-06-21T04:28:10.000" Title="What are Sell Imbalance-Only Orders?" Tags="&lt;high-frequency&gt;&lt;automated-trading&gt;&lt;algorithmic-trading&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18383" PostTypeId="1" AcceptedAnswerId="18386" CreationDate="2015-06-16T12:05:30.163" Score="5" ViewCount="338" Body="&lt;p&gt;I am interested in a rigorous explanation on why the Lipschitz condition plays a major part in stochastic calculus, most significantly in mathematical finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be specific, suppose we want to compute the expected value of $f(S_T)$, where $f(S)$ is a scalar function with a uniform Lipschitz bound, i.e., there exists a constant $c$ such that &#xA;$$&#xA;\mid f(U) - f(V) \mid \leq c \, \mid\mid U-V\mid\mid&#xA;$$&#xA;for every $U,V$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is, why do we need to guarantee that an instrument's payoff must satisfy this condition? If this condition is not satisfied, does it mean we can't construct an efficient pricing model?&lt;/p&gt;&#xA;" OwnerUserId="13457" LastEditorUserId="12" LastEditDate="2015-06-16T13:22:41.140" LastActivityDate="2015-06-17T05:53:30.693" Title="Lipschitz condition in mathematical finance" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;probability&gt;&lt;stochastic-control&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18385" PostTypeId="2" ParentId="3094" CreationDate="2015-06-16T13:19:54.313" Score="0" Body="&lt;p&gt;Personally, I don't find any of the answers provided to be of that much help in answering the question. Factor analysis was developed for information collected for a single point in time. It's only been in the last few decades that extensions were made to, first, two or a few time periods, and then most recently truly longitudinal models have been proposed. Everyone writing about these challenges points to the same issues that the OP has noted: scores and loadings can and will change over time, not only that, the qualitative meaning of the factors can and will change. For instance, if your time series data isn't consistently massaged and transformed, how can you distinguish between real underlying change from simple noise? These challenges have to be dealt with in a systematic and rigorous fashion which, e.g., &quot;overlapping windows&quot; or &quot;rollover&quot; R modules simply do not address. This is because no matter how big your data sample is, it's still a finite data sample subject to all the vagaries and vicissitudes of less than infinite amounts of information. In other words, it's only in the infinite theoretical asymptotic limit that many theorems, proofs and results hold true. This is just as much true for FA as it is for portfolio theory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From my point of view, you need to bite the bullet and work through the academic literature. The quantitative finance literature's kluge answers are as already noted in the answers posted to this thread. Forget about that and read the psychometric academic literature. There you will find thoughtful suggestions and answers to these challenges. You will also find that the &quot;state-of-the-art&quot; may not have &lt;em&gt;all&lt;/em&gt; the answers that you're looking for. In other words, textbook answers may not yet have been developed. If you find new and creative solutions, you might get a paper pub'd.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example of a recent book which has articles on this topic: &lt;em&gt;Factor Analysis at 100: Historical Developments and Future Directions&lt;/em&gt; by Cudek and McCallum (eds., 2007). In particular, pay attention to the two papers by MacArdle, Brown and Zhong. The structural equations literature also has useful contributions. Just google &quot;longitudinal factor analysis&quot; and a plethora of articles will pop up.&lt;/p&gt;&#xA;" OwnerUserId="16392" LastEditorUserId="16392" LastEditDate="2015-06-16T13:29:47.860" LastActivityDate="2015-06-16T13:29:47.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18386" PostTypeId="2" ParentId="18383" CreationDate="2015-06-16T13:30:44.880" Score="5" Body="&lt;p&gt;In this case it is just the notion that your payoff function should not explode at some point - made mathematically rigorous.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have a look at the following picture from &lt;a href=&quot;https://en.wikipedia.org/wiki/Lipschitz_continuity&quot; rel=&quot;nofollow noreferrer&quot;&gt;wikipedia&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/EhdY3.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuitively the Lipschitz condition (or Lipschitz continuity) ensures that your payoff function always remains entirely outside the white cone, so it cannot e.g. become infinitely steep at one point. Depending on the kinds of payoff functions you want to price and the implementation of the system this is something that could enhance the efficiency of the pricing model.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2015-06-17T05:53:30.693" LastActivityDate="2015-06-17T05:53:30.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18387" PostTypeId="2" ParentId="17328" CreationDate="2015-06-16T14:37:42.683" Score="4" Body="&lt;p&gt;I don't have much experience in the matter, but I've been doing some related literature research recently and I think these links can be helpful:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.automatedtrader.net/Files/z/futures_etfs.pdf&quot; rel=&quot;nofollow&quot;&gt;A rather recent study from CME&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.ishares.com/fr/investisseurs-qualifies/fr/literature/brochure/etfs-vs-futures-beyond-the-future-en-pc-brochure.pdf?siteEntryPassthrough=true&quot; rel=&quot;nofollow&quot;&gt;A (possible a bit biased) report by BlackRock&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.lyxor.com/fileadmin/_fileup/lyxor_wp/document/140120-BRO-ETF-Swap-Future-HD-internet.pdf&quot; rel=&quot;nofollow&quot;&gt;A report by Lyxor (asset manager affialiated to Societe Generale)&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16572" LastEditorUserId="1764" LastEditDate="2015-06-16T21:06:48.273" LastActivityDate="2015-06-16T21:06:48.273" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18388" PostTypeId="2" ParentId="17328" CreationDate="2015-06-16T15:39:53.737" Score="2" Body="&lt;p&gt;The current contract value is roughly 30k euros. The bidask spread is 1 tick, which equals 10 euros. Lets say you buy the contract and roll 3 times a year and then liquidate your position at expiry. You will hence pay 1 full bidask spread + 3 rolls, which if done via spreads with market orders, are equal to 1 tick each, hence you will pay 40 euros on bidasks + comissions, which can vary depending on the broker, but you can probably assume it is on average 5 euros per transaction. Hence over all, for the year, you can expect to pay 25+40~65 euros, which equates to roughly 65/30k ~= 0.22%&lt;/p&gt;&#xA;" OwnerUserId="16090" LastActivityDate="2015-06-16T15:39:53.737" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18390" PostTypeId="2" ParentId="18382" CreationDate="2015-06-16T19:25:37.427" Score="2" Body="&lt;p&gt;From the &lt;a href=&quot;http://www.nasdaqtrader.com/trader.aspx?id=openclose&quot; rel=&quot;nofollow&quot;&gt;Nasdaq page,&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;IMBALANCE-ONLY CLOSE ORDERS   Provides liquidity intended to offset&#xA;  on-close orders during the Closing Cross.&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;Must be priced (limit), no market IO orders.&lt;/li&gt;&#xA;  &lt;li&gt;&lt;strong&gt;IO buy/sell orders only execute at or above/below the 4:00 p.m., ET, bid/ask.&lt;/strong&gt;&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;They simply mean they were +\$0.01 or at \$23.56 from the price on their sell Imbalance-Only orders.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same notation is used shortly after, &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;4:00:03.348 – NASDAQ ran its Closing Cross auction.  Athena’s Sell&#xA;  Imbalance-Only  Orders were filled by selling 233,979 shares for&#xA;  &lt;strong&gt;\$23.61, \$.03&lt;/strong&gt; or 13 bps, higher than the  best offer in the milliseconds prior to Gravy.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="1764" LastEditDate="2015-06-16T19:39:59.927" LastActivityDate="2015-06-16T19:39:59.927" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18391" PostTypeId="2" ParentId="16228" CreationDate="2015-06-16T19:32:30.827" Score="4" Body="&lt;p&gt;For a swap, we have a sequence of re-setting and payment dates. The # of forward rates corresponding to the # of payment dates. For example, let us assume that we have $n$ payment dates $t_1, \ldots, t_n$, where $0&amp;lt; t_1 &amp;lt; \cdots &amp;lt; t_n$. Then there are $n$ forward rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;During the simulation, for time steps prior to $t_1$, there exist $n$ &quot;simultaneous&quot; forward rates, corresponding to payment dates $t_1, \ldots, t_n$, while for time steps between $t_1$ and $t_2$, there exist $n-1$ &quot;simultaneous&quot; forward rates, corresponding to payment dates $t_2, \ldots, t_n$. For time steps between $t_{n-1}$ and $t_n$, there is only a single forward rate that corresponds to the last payment date $t_n$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because of the existence of these &quot;simultaneous&quot; forward rates, except for the time steps between $t_{n-1}$ and $t_n$, the Cholesky decomposition of the correlation matrix between the driving Brownian motions of the existing forward rate dynamics is needed. That is how the covariance matrix come into play in the Monte Carlo simulation.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-06-16T19:32:30.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18392" PostTypeId="1" AcceptedAnswerId="18396" CreationDate="2015-06-16T20:05:04.467" Score="3" ViewCount="665" Body="&lt;p&gt;So, you can find all the data bases on this &lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html#Research&quot; rel=&quot;nofollow&quot;&gt;site&lt;/a&gt;. More explicitly, I would like to take the &quot;&lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html#Developed&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;Developed Market Factors and Returns&lt;/em&gt;&lt;/a&gt;&quot; part. Even more explicitly, let us take the &quot;&lt;em&gt;25 Portfolios Formed on Size and Momentum (5 x 5)&lt;/em&gt;&quot; part (my questions are based on this specific data base).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By clicking on &quot;details&quot;, we have the explanation on the construction of the data base: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;All returns are in U.S. dollars, include dividends and capital gains,&#xA;  and are not continuously compounded. We sort stocks in a region into&#xA;  five market cap and five lagged momentum return groups at the end of&#xA;  each month t.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The size breakpoints for a region are the 3rd, 7th, 13th, and 25th&#xA;  percentiles of the region's aggregate market capitalization. For&#xA;  portfolios formed at the end of month t–1, the lagged momentum return&#xA;  is a stock's cumulative return for t–12 to t–2. The momentum&#xA;  breakpoints for all stocks in a region are the 20th, 40th, 60th, and&#xA;  80th percentiles of the lagged momentum return for big (top 90% of&#xA;  market cap) stocks of the region.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The global portfolios use global size breaks, but we use the momentum&#xA;  breakpoints for each region to allocate the region's stocks to the&#xA;  global portfolios. Similarly, the global ex us portfolios use global&#xA;  ex us size breaks and regional momentum breakpoints. The 25&#xA;  value-weight size-momentum portfolios for a region are the&#xA;  intersections of the independent 5x5 size and momentum sorts.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So my question is that I don't understand how they explain the construction of the database and I am looking for a better (and maybe with &quot;easier&quot; words) explanation. I am not a practitioner in the domain and this words seems to be &quot;logic&quot; for them... but not for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) what does &quot;&lt;em&gt;The size breakpoints for a region are the 3rd, 7th, 13th, and 25th percentiles of the region's aggregate market capitalization&lt;/em&gt;&quot; mean?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) &quot;&lt;em&gt;The momentum breakpoints for all stocks in a region are the 20th, 40th, 60th, and 80th percentiles of the lagged momentum return for big (top 90% of market cap) stocks of the region.&lt;/em&gt;&quot; what does that mean?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) &quot;&lt;em&gt;The global portfolios use global size breaks, but we use the momentum breakpoints for each region to allocate the region's stocks to the global portfolios. Similarly, the global ex us portfolios use global ex us size breaks and regional momentum breakpoints. The 25 value-weight size-momentum portfolios for a region are the intersections of the independent 5x5 size and momentum sorts.&lt;/em&gt;&quot; Well, same what does that mean? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And finally (cherry on the cake), I would like to use this data base to simulate some momentum strategies. However the &quot;size&quot; factor is not really part of my study. Should I use only 1 of the 25 columns (let's say the neutral one) although the stocks might change from small to big and from low to high at any year? if not, which column(s) should I use? The last sub question can be summed up like that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) What would you suggest to use this data base if you wanted to simulate&#xA;a momentum strategy?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Modification after a first answer&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I understand how the data base is constructed, let me reformulate the question 4).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my goal is to use this data base to simulate a momentum strategy. However, the &quot;size&quot; part of it is completely useless for me, and I would like it to be removed if can be. As you said I cannot pick one part of the data base (for example the smalls only) because stocks are changing size every time and might be in other columns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a suggestion about that: &lt;em&gt;what if I take 3% of the momentum of the Small companies, 4% (7-3) the next one, 6% (13-7) for the next one, 12% (25-13) and finally 75% (100-25) for the Big companies and I would add all of the data into their respective momentum columns (High or Low) regarding their respective percentage? At then end I would only have momentum values (without the size factor) and the data base will be usable for a momentum strategy.&lt;/em&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I give you this suggestion in order for you to understand what I want, please feel free to add other another suggestion (or comment this one).&lt;/p&gt;&#xA;" OwnerUserId="9481" LastEditorUserId="9481" LastEditDate="2015-06-17T15:48:29.163" LastActivityDate="2015-06-17T18:18:16.563" Title="Kenneth R. French data base on momentum and size: construction and how to use it concretely with momentum only" Tags="&lt;database&gt;&lt;momentum&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18394" PostTypeId="2" ParentId="18377" CreationDate="2015-06-16T21:35:47.817" Score="2" Body="&lt;p&gt;As a first Idea I would propose to incorporate basic ideas of Behavioural Finance and Dividend Theory into your considerations; for reference, look at: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Baker, Malcolm, and Jeffrey Wurgler. Behavioral corporate finance: An&#xA;  updated survey. No. w17333. National Bureau of Economic Research,&#xA;  2011.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;They state that investors prefer rather smooth dividend payments, this should indicate an high persistence. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This reasoning could be enough to start with a simple regression of the lagged dividend payments. You already stated a upper limit of the payoff function, a lower limit can also be approximated at least for several reporting regimes.&lt;/p&gt;&#xA;" OwnerUserId="16249" LastEditorUserId="2553" LastEditDate="2015-06-17T13:02:38.193" LastActivityDate="2015-06-17T13:02:38.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18395" PostTypeId="1" CreationDate="2015-06-16T21:40:26.990" Score="4" ViewCount="313" Body="&lt;p&gt;Consider the UK RPI index. This index is published every month around the 15th (give or take a few days). The publication refers to the RPI index of the month before, so there is a lag of a few weeks between when the RPI is &quot;set&quot; and when it is published. How do I deal with this lag?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be more specific, I'm performing a Monte Carlo simulation of the RPI index using the Jarrow-Yildirim model. The inflation process is determined through a geometric Brownian motion:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$I(T) = I(t) \exp\left( \int_t^T(n(t) - r(t))dt - \frac{1}{2} \sigma^2 (T-t) + \sigma_I (W_I(T) -W_I(t))\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $n(t)$ and $r(t)$ are the nominal and real rates. These follow a Hull-White process in the JY model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So suppose I gather all my data on June 1st, i.e. discount curves and perhaps other data to calibrate the JY model. This sets the drift term of the real and nominal process. But on June 1st the &quot;last known RPI&quot; is that of April. How do I account for this lag? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My view: I simply perform a simulation starting from April. I interpret all data that I have as if it was gathered in April as well. In some sense I &quot;roll back the clock&quot; on my data, so I can make it match with the RPI index. Does that make sense?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem with this is is that 1) any valuations using this MC simulation give prices that are valid &quot;in April&quot;, but I like to have a &quot;June 1st&quot; price. 2) I'm not sure if the data of June 1st can simply be rewind to April. Can prices of ZC inflation bonds, YoY swaps and caps be interpreted like that (i.e. simply shift all the paydates)?&lt;/p&gt;&#xA;" OwnerUserId="3371" LastActivityDate="2015-06-17T18:10:45.390" Title="How do you deal with Inflation lag in a MC simulation?" Tags="&lt;monte-carlo&gt;&lt;inflation&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18396" PostTypeId="2" ParentId="18392" CreationDate="2015-06-16T21:49:02.123" Score="3" Body="&lt;p&gt;Let me start with a general point: Why do you want to use these datapoints if it is so hard to understand how they are constructed?&#xA;First of all 4) I am not familiar with testing momentum strategies but you should be aware that the datapoints given are not normal assets you can invest in at the end of the day because at the end of each time period they are reallocated. This mean if you are just tracking for example the first row you will probably end up with tracking the returns of different stocks...not sure whether you want this or not...&#xA;1) what does &quot;The size breakpoints for a region are the 3rd, 7th, 13th, and 25th percentiles of the region's aggregate market capitalization&quot; mean?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the end you obtain 25 different portfolios at each time point based on 2 factors: The Size (Market Capitalization) and Momentum. They build the portfolios by splitting each available asset into one of 25 groups, whereas there are 5 different groups for market capitalization and 5 for momentum (5 x 5 =25). Each asset belongs to either the 3 percent with the lowest market capitalization, the group between 3 and 7% percent and so on. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) &quot;The momentum breakpoints for all stocks in a region are the 20th, 40th, 60th, and 80th percentiles of the lagged momentum return for big (top 90% of market cap) stocks of the region.&quot; what does that mean?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Same holds here for the momentum factor. They define 5 different groups (&amp;lt;20,21-40,41-60,80-100 percentiles).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) &quot;The global portfolios use global size breaks, but we use the momentum breakpoints for each region to allocate the region's stocks to the global portfolios. Similarly, the global ex us portfolios use global ex us size breaks and regional momentum breakpoints. The 25 value-weight size-momentum portfolios for a region are the intersections of the independent 5x5 size and momentum sorts.&quot; &#xA;As said in 1), 2) the 25 portfolios are constructed with the 25 groups you can build when considering the 5x5 possible combinations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Added due to your modification&lt;/strong&gt;&#xA;I have to repeat again that I doubt that your choice of the French Dataset is appropriate for your aims: The dataset consists of the returns of changing mixtures of different assets, so how do you want to use these datapoints to compute Moment strategies? If you do not want the effects of the size, my simple argument would be as follows: You know that the first five columns of your data consist of portfolios with changing size but equal momentum. So if you just take the average over these groups (column 1 to 5, 6 to 10, etc.) You'll obtain 5 portfolios that are just selected due to their historical momentum.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure if your suggestion is the same, however, averaging will cancel out the size effect.&lt;/p&gt;&#xA;" OwnerUserId="16249" LastEditorUserId="16249" LastEditDate="2015-06-17T18:18:16.563" LastActivityDate="2015-06-17T18:18:16.563" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18397" PostTypeId="2" ParentId="18373" CreationDate="2015-06-16T21:51:45.617" Score="-1" Body="&lt;p&gt;look at the econometrics literature on &quot;total Least squares&quot; (van huffel has a text out by that name)...or more generally think about what principal components does (hint: it's minimizing the distance to a regression line as in #2..it's not minimizing just the &quot;vertical&quot; distance)&lt;/p&gt;&#xA;" OwnerUserId="16577" LastActivityDate="2015-06-16T21:51:45.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18398" PostTypeId="2" ParentId="18371" CreationDate="2015-06-16T22:09:09.510" Score="1" Body="&lt;p&gt;Given two representations:&#xA;$$&#xA;  C = E_f[\varphi(X)] =  \int \varphi(x) f(x)dx   = \int \varphi(x) \frac{f(x)}{g(x)}g(x)dx  = E_g[\varphi(X)\frac{f(X)}{g(X)}]&#xA;$$&#xA;The difference of the variances of the MC estimators associated with the two expression is &#xA;$$&#xA;  Var[\widehat{C}^f_N] - Var[\widehat{C}^g_N] = \frac{1}{N}\int \varphi(x)^2 \left(1 - \frac{f(x)}{g(x)}\right) f(x)dx &#xA;$$&#xA;We want this to be positive for importance sampling to improve estimation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, you can compute explictly this variance gain by setting $\varphi(x) = S_0(e^x - e^k)_+$ (where $k =\ln(K/S_0e^{rT})$ is the log-moneyness forward)  and $f$, $g$ gaussian densities of parameters $(-\sigma^2/2,\sigma^2)$ and $(\mu-\tau^2/2,\tau^2)$.&lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2015-06-16T22:09:09.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18399" PostTypeId="1" CreationDate="2015-06-16T22:15:21.380" Score="3" ViewCount="278" Body="&lt;p&gt;My overall goal is to find an efficient frontier using QP in terms of $\alpha$ and residual variance ($\omega^2$) for a portfolio $P$ given a benchmark $B$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know the equation for residual variance is (excuse my bad latex skills):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\omega_P^2 = \sigma^2_P - \beta^2\sigma^2_B$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using an n X n covariance matrix $\Sigma$, a weight vector $\bar{w}$, a beta vector $\bar{\beta}$ made of each portfolio holding's beta compared to the benchmark, and a scalar $\sigma^2_B$ which is the calculated variance of the benchmark, we can derive a QP compatible objective function:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\omega_P^2 = \bar{w}^T_P(\Sigma_P - \sigma^2_B\bar{\beta}\bar{\beta}^T)\bar{w}_P$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in the Quadratic Programming Framework, given the above, a vector of alphas ($\bar{\alpha_P}$), a risk aversion parameter ($\lambda$):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\min_\limits{\bar{w}_P} \frac{1}{2}\lambda\bar{w}^T_P(\Sigma_P - \sigma^2_B\bar{\beta}\bar{\beta}^T)\bar{w}_P - \bar{w}^T_P\bar{\alpha_P}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;subject to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$A\bar{w}_P = b$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$G\bar{w}_P \le h$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $A$ is a vector of ones, and $b$ is 1 (sum of weights must equal 1) and G and h define min and max weights for each holding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that my constraints are valid, as if I change this to be a typical MVO (replace $\Sigma_P - \sigma^2_B\bar{\beta}\bar{\beta}^T$ with $\Sigma_P$) the QP optimizer returns optimized portfolios with the proper bounds on weights.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem however, seems to be that the resulting matrix (residual covariance?) $\Sigma_P - \sigma^2_B\bar{\beta}\bar{\beta}^T$ is not positive definite (though it is symmetrical), and thus the QP solvers fail.  In other words, my residual covariance matrix can yield portfolios with negative residual variance.  I am still wrapping my head around what a negative residual variance would mean (and perhaps this is a sign that something is awry).  Any thoughts on how to progress (or where I've gone wrong) would be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="7534" LastEditorUserId="7534" LastEditDate="2015-06-17T15:38:58.370" LastActivityDate="2015-06-17T15:38:58.370" Title="Residual Covariance Matrix, and MVO for Residual Variance and Alpha" Tags="&lt;optimization&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;&lt;covariance-matrix&gt;&lt;markowitz&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18400" PostTypeId="1" CreationDate="2015-06-17T01:06:39.530" Score="10" ViewCount="5618" Body="&lt;p&gt;I'm curious how an option pricing model like the Heston model is calibrated in practice.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's how I imagine it happens:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say I have access to the most recent option prices on a given stock for $n$ strikes and $m$ expirations dates for each strike.  Let now say it's the end of the business day, so I have a set of $n \times m$ closing prices $p$ each given by $p(K,\tau)$.  The collection of all closing prices would be denoted $\{p(K_i,\tau_j)\}_{i,j=1}^{n,m}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm going to need to price options on this stock tomorrow, so let's calibrate Heston's model to this most recent closing data.  For this, use some method of least squares optimization, finding the parameter values that best describes the price data.  Whatever method I use, I calibrate Heston's model to the $n \times m$ data points of today.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, let's say I also have access to previous days' closing prices, say $d$ days, each with $n \times m$ prices.  That's $d \times n \times m$ closing prices. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Should I include all $d \times n \times m$ closing prices in my calibration?  That is, should I try to fit Heston's model to $d \times n \times m$ data points?  This seems like it would better capture the recent history of the option prices.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Or, should I stick with the most recent data, perhaps relying on some efficient markets idea to argue this is all I need?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Or, perhaps calibrate the model $d$ times, once to each day of data, build a &lt;em&gt;distribution&lt;/em&gt; of parameters and pick the most likely parameters?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Or,...&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;It seems there are many methods for calibration.  I'd be excited to hear from those with experience on how they have seen it done!&lt;/p&gt;&#xA;" OwnerUserId="6866" LastEditorUserId="2553" LastEditDate="2015-06-17T15:03:19.720" LastActivityDate="2015-06-26T18:51:47.943" Title="Option Pricing Model Calibration In Practice" Tags="&lt;option-pricing&gt;&lt;calibration&gt;&lt;heston&gt;&lt;modelling&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="18401" PostTypeId="2" ParentId="18382" CreationDate="2015-06-17T01:35:23.167" Score="1" Body="&lt;p&gt;From what i understand about Athena's strategy, they always wanted to execute on the imbalance. They would drive the continuous price in one direction and cover in the cross at an in-/de-flated price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Setting the sell price of an imbalance only order would basically be like sending a market order and give them the best chance of executed on the imbalance at close.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's how i understood it, but a few things still don't make sense to me. It sounds like time shifting arbitrage, even if it wasn't pursued with the noblest of intentions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've run strategies that participated in  the cross but don't know profitable this could have been. They did lose big on this too, which sounds definitely likely if the imbalance moves the other way on you. &lt;/p&gt;&#xA;" OwnerUserId="758" LastActivityDate="2015-06-17T01:35:23.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18402" PostTypeId="2" ParentId="18400" CreationDate="2015-06-17T05:31:13.713" Score="5" Body="&lt;p&gt;I know two papers explaining how to calibrate this kind of models, and one of them explain the impact of the quality of the fit on a pricing model:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Aït-Sahalia, Y. (2002, January). &lt;a href=&quot;http://faculty.chicagobooth.edu/finance/papers/mle.pdf&quot; rel=&quot;noreferrer&quot;&gt;Maximum likelihood estimation of discretely sampled diffusions: A closed-form approximation approach&lt;/a&gt;. Econometrica 70 (1), 223-262.&lt;/li&gt;&#xA;&lt;li&gt;Azencott, R., Y. Gadhyan, and R. Glowinski (2014). &lt;a href=&quot;http://arxiv.org/pdf/1404.4014.pdf&quot; rel=&quot;noreferrer&quot;&gt;Option pricing accuracy for estimated heston models&lt;/a&gt;. International Journal of Theoretical and Applied Finance.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I guess you should start by the second one. Authors have put numerical examples on the S&amp;amp;P 500 and the VIX. &lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2015-06-17T05:31:13.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18403" PostTypeId="2" ParentId="17330" CreationDate="2015-06-17T10:30:03.347" Score="2" Body="&lt;p&gt;Portfolio &lt;em&gt;behaving&lt;/em&gt; like a small cap portfolio is not necessarily a small cap portfolio. Your regression shows the appearance, not the fundamentals.&lt;/p&gt;&#xA;" OwnerUserId="16579" LastActivityDate="2015-06-17T10:30:03.347" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18404" PostTypeId="1" CreationDate="2015-06-17T12:58:38.733" Score="4" ViewCount="298" Body="&lt;p&gt;How to allocate asset classes in a multi-asset portfolio?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An institutional client needs to meet his pension liabilities, and suggested a multi-asset-class strategy. I'm trying to find ideas to pitch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My experience is mostly from equity, so the way to go would be to balance some kind of covariance based risk minimization with a 1/n-style diversification, both to avoid concentration risks, as well as dependency on the model. Then possibly buy some puts to reduce downside risks, etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm really not sure however how/how much to allocate to other classes. Would you use a covariance based approach, and optimize over those? Would you pick a class allocation and stick with it? Follow marco-trends? I guess you can do any of those, but is there a 'standard' approach? Can you even use covariances to diversify bonds against stocks against commodities?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now my idea is to start 95% equity/5% cash, and then shift to duration matched bonds to meet the liabilities. That way, I can handle the equity with the options, potentially have some base risks, and take care of the liabilities in advance. &lt;/p&gt;&#xA;" OwnerUserId="1976" LastActivityDate="2015-07-07T01:47:57.097" Title="Multi-asset class allocation" Tags="&lt;asset-allocation&gt;&lt;strategy&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18405" PostTypeId="2" ParentId="16573" CreationDate="2015-06-17T14:12:50.460" Score="2" Body="&lt;p&gt;A variance swap can be replicated with vanilla European options. If you take derivative with respect to variance, you need to do the same thing on both sides. That is, you need also take derivative with respect to variance on those vanilla options. However, the resulting derivative is not the vega in the usual sense, which is the derivative with respect to the employed volatility. The confusion you have is that you are comparing different objects.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-06-17T14:58:04.277" LastActivityDate="2015-06-17T14:58:04.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18406" PostTypeId="2" ParentId="18404" CreationDate="2015-06-17T14:34:05.473" Score="3" Body="&lt;p&gt;In this case it is important to differentiate between a &lt;a href=&quot;https://en.wikipedia.org/wiki/Liability-driven_investment_strategy&quot; rel=&quot;nofollow&quot;&gt;liability-driven investment strategy (LDI)&lt;/a&gt; and a (the classical) &lt;a href=&quot;https://en.wikipedia.org/wiki/Benchmark-driven_investment_strategy&quot; rel=&quot;nofollow&quot;&gt;benchmark-driven investment strategy&lt;/a&gt;. The first one is what you need in this case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;LDI was first established by Martin Leibowitz in 1986 (&quot;Liability returns: A new perspective on asset allocation&quot;). So googling that might help you already.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To dive into the matter and for many more details on all of your questions above (which are quite broad!) I would recommend the following current book:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://factorinvestingbook.com/&quot; rel=&quot;nofollow&quot;&gt;Ang, A.: &quot;Asset Management. A systematic approach to factor investing&quot;, Oxford University Press, 2014.&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2015-06-17T14:34:05.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18407" PostTypeId="1" AcceptedAnswerId="18459" CreationDate="2015-06-17T15:33:48.043" Score="3" ViewCount="178" Body="&lt;p&gt;I have created quite a large financial model in Excel with lots of input parameters which (after all calculations) have an influence on the output business indicators.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Among the input parameters are&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the expected average price of product;&lt;/li&gt;&#xA;&lt;li&gt;the expected number of purchases in first day;&lt;/li&gt;&#xA;&lt;li&gt;the expected demand growth rate;&lt;/li&gt;&#xA;&lt;li&gt;the market size limit;&lt;/li&gt;&#xA;&lt;li&gt;and so on.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Among the output indicators are&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;amount of investments required;&lt;/li&gt;&#xA;&lt;li&gt;pay-back period;&lt;/li&gt;&#xA;&lt;li&gt;IRR;&lt;/li&gt;&#xA;&lt;li&gt;the absolute profit on 3rd or 4th year of project execution;&lt;/li&gt;&#xA;&lt;li&gt;and so on.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I want to investigate different scenarios of project execution by varying input parameters in certain range. The goal is to find out the worst possible, the best possible and the most likely scenarios and to prove project attractiveness from the risks point of view.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any well-known scientific approach to such kind of modelling? &#xA;(One of the main caveats here is that the input and output data is multi-dimensional)&lt;/p&gt;&#xA;" OwnerUserId="16582" LastActivityDate="2015-06-21T09:19:17.910" Title="Parameters variation in fundraising financial model" Tags="&lt;finance&gt;&lt;models&gt;&lt;investment&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18408" PostTypeId="1" CreationDate="2015-06-17T15:47:08.903" Score="4" ViewCount="138" Body="&lt;p&gt;Similarly to &lt;a href=&quot;https://quant.stackexchange.com/questions/18367/can-gaussianity-of-returns-depend-on-the-time-frame&quot;&gt;my last question&lt;/a&gt;, for which I obtained very interesting and useful answers, I would like to know if there has been any study regarding heteroskedasticity and time-frames of the returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example could it be that the lower the time frame (take the 5 minute returns) the less heteroskedastic are returns?&lt;/p&gt;&#xA;" OwnerUserId="15188" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2015-06-18T09:08:30.297" Title="Does heteroskedasticity of returns depend on the time frame?" Tags="&lt;time-series&gt;&lt;returns&gt;&lt;reference-request&gt;&lt;variance&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18409" PostTypeId="2" ParentId="4846" CreationDate="2015-06-17T17:07:02.433" Score="-1" Body="&lt;p&gt;Check out Barchart Ondemand, they just released a Free market data api and they offer real-time and delayed market data apis... I would test out their api &lt;a href=&quot;http://freemarketdataapi.barchartondemand.com&quot; rel=&quot;nofollow&quot;&gt;http://freemarketdataapi.barchartondemand.com&lt;/a&gt; before. I'm currently using it and its very easy to use.&lt;/p&gt;&#xA;" OwnerUserId="16445" LastActivityDate="2015-06-17T17:07:02.433" CommentCount="2" CommunityOwnedDate="2015-06-17T17:07:02.433" ContentLicense="CC BY-SA 3.0" />
  <row Id="18410" PostTypeId="1" CreationDate="2015-06-17T17:50:25.900" Score="3" ViewCount="394" Body="&lt;p&gt;Let $F(t;S,T)$ be the forward rate from $S$ to $T$ seen at time $t$, and $I$ be one of tenors, i.e. $I$ is one of {1M, 3M, 6M, 12M}. Then the forward curve $t\mapsto F(0;t,t+I)$ is $I$-forward curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that the forward curve above is easy to calibrate to market values that involves LIBOR of tenor $I$, such as swaps. But how can I get $I$-discounting curve (zero coupon curve) from the forward curve? Is it simply to find the function $P_I(0,t)$ that satisfies the following equation?&#xA;$$F(0;t,t+I)=\frac{1}{I}\bigg(\frac{P_I(0,t)}{P_I(0,t+I)}-1\bigg)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this is the case, what is the meaning of the value $P_I(0,t)$? Is it simply a function gives the forward curve back?&lt;/p&gt;&#xA;" OwnerUserId="16518" LastActivityDate="2015-06-19T21:56:16.683" Title="LIBOR with different tenor" Tags="&lt;libor&gt;&lt;bootstrapping&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18411" PostTypeId="2" ParentId="18395" CreationDate="2015-06-17T18:10:45.390" Score="3" Body="&lt;p&gt;In inflation world, the deal payoff is always based on a certain lag convention. That is, the value $I(T)$ always refers to a published index level several months ago or is interpolated based on those published index levels. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, for a payoff on July 15, 2015, the indexed level referred is the published index level for May, 2015, based on the 2m lag convention, or April, 2015, based on the 3m lag convention, or interpolated from the index levels in April and May, 2015, based on the 2m-3m lag convention. See Section 4.3 in &lt;a href=&quot;http://the.earth.li/~jon/junk/kerkhof.pdf&quot; rel=&quot;nofollow&quot;&gt;http://the.earth.li/~jon/junk/kerkhof.pdf&lt;/a&gt; for more details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your simulation, except for your model parameters, you also need the spot level $I(t_0)$ on the valuation date $t_0$, which can be referred or interpolated from the published index levels as above based on the respective lag convention.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-06-17T18:10:45.390" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18412" PostTypeId="1" CreationDate="2015-06-17T18:28:28.760" Score="5" ViewCount="277" Body="&lt;p&gt;Probably the most popular horse race study for portfolio strategies is&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Optimal versus Naive Diversification: How Inefficient Is the 1/N Portfolio Strategy?, with DeMiguel, L. Garlappi and R. Uppal. The Review of Financial Studies 22(5), 1915--1953 (2009)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In their Paper DeMiguel et al. use several datasets as well as simulated data and compare different portfolio strategies with several performance measures, for example: Sharpe Ratio, CE, Mean, Turnover, Return-Loss...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously the drawback of such strategies can always be found in their 'relatively' arbitrary choice of the datasets, the evaluation methods etc. I would like to learn other approaches (purely theoretical ones are also welcome) in literature to evaluate the goodness of a portfolio strategy. I really think that is important to improve the evaluation process in order to justify all these fancy allocation methods that are proposed in literature.&#xA;What papers did you come across that propose different performance measures than DeMiguel?&lt;/p&gt;&#xA;" OwnerUserId="16249" LastActivityDate="2019-02-12T09:01:40.287" Title="Reference Request: Horse Race for Portfolio Allocation" Tags="&lt;modern-portfolio-theory&gt;&lt;reference-request&gt;&lt;portfolio-optimization&gt;&lt;asset-allocation&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18413" PostTypeId="1" CreationDate="2015-06-17T19:35:03.393" Score="16" ViewCount="8691" Body="&lt;p&gt;Does leverage affect the Sharpe ratio? If my Sharpe is 2 at no leverage, does it change, fall by half say, at a different leverage?&lt;/p&gt;&#xA;" OwnerUserId="16204" LastEditorUserId="24250" LastEditDate="2016-11-11T20:28:29.463" LastActivityDate="2016-11-11T20:28:29.463" Title="Sharpe ratio and leverage" Tags="&lt;leverage&gt;&lt;ratio&gt;&lt;sharpe&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="18414" PostTypeId="2" ParentId="18373" CreationDate="2015-06-17T19:38:24.903" Score="1" Body="&lt;p&gt;Approach 1 is parametric regression, whereas approach 2 is non-parametric regression. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How are they related: non-parametric regression models the entire distribution of all possible function forms, and then do the integration to calculate a single value E[Y|X]. It is function-form free. In contrast, parametric linear regression ASSUMES that the function form can be well described by a simple linear relation between Y and X.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, yes, approach 2 is more flexible than approach 1. However, such flexibility does come at a cost. To reach an acceptable standard error in estimates, Non-parametric regression typically requires a much much larger amount of observations than the simple linear regression. Also, linear regression has a straightforward interpretation (1 unit increase in X would drive Y up by alpha units), but non-parametric regression result is not so intuitive (you can think of it as an weighted average of Y taken around the neighbourhood of X=X0). &lt;/p&gt;&#xA;" OwnerUserId="16585" LastActivityDate="2015-06-17T19:38:24.903" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18415" PostTypeId="2" ParentId="18413" CreationDate="2015-06-17T19:58:07.097" Score="6" Body="&lt;p&gt;Generally no.  Sharpe ratio should vary linearly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use leverage: the return increases, but so does volatility.&#xA;De-lever&quot; the return decreases but, so does volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/l9rKb.png&quot; alt=&quot;Sharpe ratio&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="2789" LastActivityDate="2015-06-17T19:58:07.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18416" PostTypeId="2" ParentId="18408" CreationDate="2015-06-17T21:23:51.023" Score="1" Body="&lt;p&gt;This paper states that heteroskedasticity is a stylized fact in daily as well as intra-day returns:  &lt;a href=&quot;https://statistik.econ.kit.edu/download/doc_secure1/HandbookITandFinan.pdf&quot; rel=&quot;nofollow&quot;&gt;https://statistik.econ.kit.edu/download/doc_secure1/HandbookITandFinan.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2015-06-17T21:23:51.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18417" PostTypeId="2" ParentId="18367" CreationDate="2015-06-17T21:42:10.770" Score="1" Body="&lt;p&gt;If high frequency returns are iid and the mean and variance are finite and vthe variance is greater than zero then the Central Limit theorem holds Then, regardless of the distribution of the high returns, when aggregated over time the aggregated returns will tend in distribution to a Normal distribution. The Lindeberg-Lévy-Feller version of the Central Limit Theorem gives a generalization of this result to independent random variables. &#xA;If the higher frequency returns have fat tailed distributions with density such that&#xA;\begin{equation}&#xA;f(x)\sim&#xA;\begin{cases}&#xA;B_{-}|x|^{-(1+a)}\quad \text{as} \quad x \rightarrow - \infty \\&#xA;B_{+}|x|^{-(1+a)}\quad \text{as} \quad x \rightarrow \ \infty,&#xA;\end{cases}&#xA;\end{equation}&#xA;where $0&amp;lt;a&amp;lt;2$ and $B_{-}$ and B_{+} are appropriate constants then the aggregated distributions will tend to $\alpha$-stable by the Generalized Central limit Theorem.&#xA;One should note that with the sample sizes available no normality test has power against the alternative of an $\alpha$-stable distribution.&lt;/p&gt;&#xA;" OwnerUserId="9458" LastActivityDate="2015-06-17T21:42:10.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18418" PostTypeId="2" ParentId="15697" CreationDate="2015-06-17T21:48:50.650" Score="0" Body="&lt;p&gt;You're buying a call and selling a put, both are directional up bets and your delta will be positive regardless. Therefore you're net long&lt;/p&gt;&#xA;" OwnerUserId="16586" LastActivityDate="2015-06-17T21:48:50.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18419" PostTypeId="2" ParentId="18413" CreationDate="2015-06-17T22:26:00.327" Score="19" Body="&lt;p&gt;Sharpe ratio is defined as $\frac{(x - r)}{\sigma}$  where $x$ is return, $r$ is the risk free rate and $\sigma$ is volatility. Now levering up $n$ times multiplies both the return and volatility by $n$. But shouldn't the ratio change since $r$ stays the same? Ah, but remember, leverage isn't free. You have to fund leverage, and that cuts out of your return. So if you can fund the leverage at the risk free rate, then you should subtract from your return $r(n-1)$. And thus, this is as if we were multiplying both the numerator and denominator by $n$. The Sharpe thus stays the same. &lt;/p&gt;&#xA;" OwnerUserId="11795" LastActivityDate="2015-06-17T22:26:00.327" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18420" PostTypeId="1" CreationDate="2015-06-17T22:26:16.777" Score="2" ViewCount="775" Body="&lt;p&gt;Consider a scenario in which Y_t represents the % change in price and we want to use X_t to predict Y_t. We assume that X_t is information we get before Y_t is revealed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose that in reality Y_t = 0.01*X_t + e_t (beta = 0.01), where e_t ~ N(0,1). Moreover, X_t ~ N(0,1). Suppose we have 1000 points of historical data to test on. This generates the distribution of beta when simulating the estimation 1000 times:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/b8QPU.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few questions: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Is this approach a feasible money making strategy in finance? First, the assumptions I have made are already really optimistic (Y_t,X_t are iid over 1000 samples and the true relationship is linear). However, because of the noise the variance of the estimated parameter is very high, and 40% of the parameters are the wrong sign. Adding more rhs variables would presumably just make this worse. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even presuming we got beta = 0.01, the signal is so small that we will have a high error rate of falsely rejecting our signal when the strategy does poorly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) What are possible solutions? If we had enough data (HFT?) we could precisely estimate small signals. What if we are looking at lower frequency time series (daily data?). Is another solution to look for a Z_t that has a much higher beta? However, given that markets are relatively efficient, why would a large beta continue to exist? Do we need to add more low-signal variables into the RHS of the regression (this would just increase the variance though)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another approach to get a higher &quot;beta&quot; seems to be stat arb? If Y_t and X_t are contemporaneous stock prices of cointegrated price series, we could expect beta to be large enough to estimate more precisely (relative to its magnitude). However, I have read (although I clearly don't have first hand experience) that stat arb profits have been declining since everybody knows the idea nowadays. &lt;/p&gt;&#xA;" OwnerUserId="16567" LastActivityDate="2015-06-18T08:43:10.810" Title="Extracting Signal from Noisy Data" Tags="&lt;time-series&gt;&lt;forecasting&gt;&lt;estimation&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18421" PostTypeId="1" CreationDate="2015-06-17T22:38:21.480" Score="5" ViewCount="222" Body="&lt;p&gt;Lets have the next  jump difussion Stochastic Process: &#xA;$$S_t = S_0 e^{\sigma W_t + (v-\frac{\sigma ^2}{2})t}\prod_{i=1}^{N_t}(1+J_i)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W_t$ is the Brownian Motion, hence $G_t \equiv e^{\sigma W_t + (v-\frac{\sigma ^2}{2})t}$ is the Geometric Brownian Motion, $N_t$ is the Poisson Process and $R_t \equiv \prod_{i=1}^{N_t}(1+J_i)$ is the Multiplicative Poisson Compound Process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose there exists a Martingale Probability $\mathbb{Q}$ and that under $\mathbb{Q}$ the Girsanov Theorem hipótesis valid. Moreover suppose that under   $\mathbb{Q}$ $N_t$ has a Poisson Rate $\widehat{\lambda}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this context I have to price the European Put Option of S_t, that is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P=e^{-r(T-t)}\mathbb{E}_\mathbb{Q}((k-S_T)_+|S_t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have thought this way, but I don´t know if it is correct. &#xA;\begin{eqnarray}&#xA;\mathbb{E}_\mathbb{Q}((k-S_T)|S_t)_+&amp;amp; = &amp;amp; \mathbb{E}_\mathbb{Q}((k-S_0 e^{\sigma W_T + (v-\frac{\sigma ^2}{2})T}\prod_{i=1}^{N_T}(1+J_i))_+|S_t)\\&#xA;&amp;amp; = &amp;amp; \mathbb{E}_\mathbb{Q}((k-S_t e^{\sigma (W_T-W_t) + (v-\frac{\sigma ^2}{2})(T-t)}\prod_{i={N_{t}+1}}^{N_T}(1+J_i))_+)\\&#xA;&amp;amp; = &amp;amp; \mathbb{E}_\mathbb{Q}(\mathbb{E}_\mathbb{Q}((k-S_t e^{\sigma (W_T-W_t) + (v-\frac{\sigma ^2}{2})(T-t)}\prod_{i={N_{t}+1}}^{N_T}(1+J_i))_+|N_T-N_t=n))\\&#xA;&amp;amp; = &amp;amp; \mathbb{P}_\mathbb{Q}(N_T-N_t=n))(\mathbb{E}_\mathbb{Q}((k-S_t e^{\sigma (W_T-W_t) + (v-\frac{\sigma ^2}{2})(T-t)}\prod_{i={1}}^{n}(1+J_i)_+)&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So finally, $$\mathbb{P}_\mathbb{Q}(N_T-N_t=n)=e^{-\widehat{\lambda}(t-t)}\frac{(\widehat{\lambda} (T-t))^n}{n!}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And $\mathbb{E}_\mathbb{Q}((k-S_t e^{\sigma (W_T-W_t) + (v-\frac{\sigma ^2}{2})(T-t)}\prod_{i={1}}^{n}(1+J_i)_+)$ can be calculated using Black-Sholes usual formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this okay or is it another way? Thanks! :)&lt;/p&gt;&#xA;" OwnerUserId="16565" LastActivityDate="2015-07-01T11:47:33.423" Title="How to price an European Call/Put Option of a jump difussion Process?" Tags="&lt;stochastic-processes&gt;&lt;derivatives&gt;&lt;brownian-motion&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18422" PostTypeId="1" CreationDate="2015-06-17T22:51:21.523" Score="2" ViewCount="110" Body="&lt;p&gt;I was told of a way of measuring the volatility of a stock by looking at the reported execution prices (from Level III or Level II data.) I'm well aware of how to measure volatility by looking at the mid-quote or similar but I have never heard of a way that would use solely the prices of the executions.&#xA;Unfortunately, I cannot find any paper that would either use such method or define it. Can anyone point me in the right direction?&lt;/p&gt;&#xA;" OwnerUserId="11874" LastActivityDate="2015-06-18T08:53:19.750" Title="Measuring Volatility from Execution Prices" Tags="&lt;volatility&gt;&lt;equities&gt;&lt;order-execution&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18423" PostTypeId="1" CreationDate="2015-06-17T23:58:06.540" Score="2" ViewCount="159" Body="&lt;p&gt;I'm considering the standard stochastic volatility model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$x_t = \rho x_{t-1} + \sigma \epsilon_x$$&#xA;$$y_t = \beta \exp\left[ \frac{x_t}{2} \right] \epsilon_y$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $y_t$ is the log-returns and $x_t$ the log-vol associated to $y_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used &lt;a href=&quot;http://www.stats.ox.ac.uk/~doucet/andrieu_doucet_holenstein_PMCMC.pdf&quot; rel=&quot;nofollow&quot;&gt;PMCMC&lt;/a&gt; to estimate $\rho, \sigma, \beta$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My target is to model the volatility of an asset (equity spread) $(p_t)_t$ based on this model. $y_t$ is calculated this way:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;y_t = \log(p_t) - \log(p_{t-1})&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now that I estimated the latent variables, I get $x_t$, I don't know how I can get back the volatility of the spread $p_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you help me out?&lt;/p&gt;&#xA;" OwnerUserId="16588" LastEditorUserId="467" LastEditDate="2015-06-19T01:18:03.067" LastActivityDate="2015-06-19T01:18:03.067" Title="How to use calibrated Standard Stochastic Volatility?" Tags="&lt;volatility&gt;&lt;stochastic-volatility&gt;" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="18424" PostTypeId="1" CreationDate="2015-06-18T00:59:39.507" Score="1" ViewCount="31" Body="&lt;p&gt;if a bond matures, and there is no other existing bond from the legal entity that has not matured.  Then how does that affect the CDS that corresponds to that bond?&lt;/p&gt;&#xA;" OwnerUserId="6490" LastActivityDate="2015-06-18T00:59:39.507" Title="how does a bond maturing affect the pricing of the corresponding CDS?" Tags="&lt;credit&gt;&lt;cds&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18425" PostTypeId="2" ParentId="18422" CreationDate="2015-06-18T01:02:27.580" Score="1" Body="&lt;p&gt;Possibly you might be able to first estimate the bid-ask spread from execution prices, using the method of Roll (1984), and then adjust the volatility for this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially the bid-ask bounce adds to the underlying volatility, so knowing an estimate of the b/a and the apparent volatility, the underlying volatility could be recovered by subtraction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.bauer.uh.edu/rsusmel/phd/roll1984.pdf&quot; rel=&quot;nofollow&quot;&gt;Roll(1984)&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-06-18T01:02:27.580" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18426" PostTypeId="1" CreationDate="2015-06-18T04:01:09.583" Score="1" ViewCount="245" Body="&lt;p&gt;I'm working through revision questions at the moment and we are asked to compute the price of an American call option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose that $dS_t = \sigma S_t dW^*_t, S_0 &amp;gt;0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $0&amp;lt;U&amp;lt;T$ be fixed dates and let $K&amp;gt;0$ be a constant. Consider the American call option with expiration date $T$ and payoff process $(X_t)_{t\in[0,T]}$ given by the following expressions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_t = g_1(S_t,t) = (S_t-K)^+ , \forall t \in [0,U]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_t = g_2(S_t,t) = (S_t-S_U)^+ , \forall t \in (U,T]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Find the arbitrage price of the option at time $t\in [0,T]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know that in time $t \in (U,T]$ the price is a European call with strike $S_U$, and the price at time $U$ is max$(C_u(K), C_u(S_u))$ (I think). &lt;/p&gt;&#xA;" OwnerUserId="16591" LastEditorUserId="16523" LastEditDate="2015-06-18T08:18:11.633" LastActivityDate="2015-06-18T08:18:11.633" Title="Price of an American call option" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;american-options&gt;" AnswerCount="0" CommentCount="1" ClosedDate="2015-06-18T04:33:34.977" ContentLicense="CC BY-SA 3.0" />
  <row Id="18427" PostTypeId="2" ParentId="18413" CreationDate="2015-06-18T05:44:46.690" Score="8" Body="&lt;p&gt;The textbook academic answer is that Sharpe ratio is not impacted by leverage as explained by other answers. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, reality tells a different tale entirely: Imagine you lever up your investments by such amount that your future performance will critically hinge on the following conditions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;That those who extended credit to you will not re-call their funding at any time, something which they are generally fully entitled to&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;That in case that your broker extended credit to you, it will not impose additional margin requirements or modity margin requirements that you will be subjected to.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;That the assets you invest in will not exhibit staggering return volatility. If that is the case such as during the flash crash, during the financial crisis, or when the Swiss National Bank removed its Euro-Swissie peg, you will be fully exposed to forced liquidation in case of over-leverage. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;There are couple other points but the above I deem the core issues in this question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, what will happen when your assets's return volatility rises and you are heavily leveraged? You will receive either a margin call and need to inject additional funding, or your funding supplier will pull his/her funding entirely or will modify leverage ratios. In some of those cases you will end up with forced liquidation at the worst possible time which in turn will cause a negative impact on your portfolio returns. As sharpe ratios measure your risk adjusted returns in fact your portfolio returns will be negatively impacted while your return variations will increase, causing a stark reduction in the sharpe ratio measure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In summary, in practice I argue that nothing could be further from the truth that your leverage ratio both identically scales your returns and return volatility. &lt;/p&gt;&#xA;" OwnerUserId="2114" LastActivityDate="2015-06-18T05:44:46.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18428" PostTypeId="2" ParentId="18420" CreationDate="2015-06-18T06:20:57.127" Score="0" Body="&lt;p&gt;You estimate a model&#xA;$$&#xA;Y_t = \beta X_t + \epsilon_t.&#xA;$$&#xA;which is just time-series regression. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Concerning your question 1):&#xA;One usually looks at the beta of a single security w.r.t. a stock index (see the CAPM). High beta (above 1)will indicate that the stock would rise and fall more than the market. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other approaches where one estimates a beta is in hedging. If you have a security $X$ and a security $Y$ and you wonder how many pices of $X$ you need to hedge $Y$ (i.e. minimize $|\beta X-Y|^2$) then you can take the beta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Directly making money with the regression coefficient beta: I would really say no. If beta is too small: forget the model at all (what would one expect?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For 2): estiamting a beta is really basic. If there were profits to make (even in HFT) then one of the large companies already does this.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-06-18T06:20:57.127" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18429" PostTypeId="2" ParentId="18423" CreationDate="2015-06-18T06:40:54.430" Score="1" Body="&lt;p&gt;The volatility of your asset $y_t$ is simply its time varying standard deviation, given by $\beta \exp(x_t/2)$. Once you've got the estimates for latent factor $x_t$ from converged MCMC chain, calculate the expected value for volatility at time $t$ using&#xA;$$&#xA;\hat{v_t} = \mathbb{E}[\beta \exp(x_t/2)] = \frac{1}{R}\sum_{r=1}^R \beta \exp(x_t^{(r)})&#xA;$$&#xA;where $R$ is the total number of MCMC chains you've got and $x_t^{(r)}$ is the value of $x_t$ in $r$-th chain.&lt;/p&gt;&#xA;" OwnerUserId="16585" LastActivityDate="2015-06-18T06:40:54.430" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="18430" PostTypeId="2" ParentId="18420" CreationDate="2015-06-18T08:43:10.810" Score="1" Body="&lt;p&gt;Yes, these are the fundamental building blocks for a money making strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To partially solve the issues you mention (small/low positive means/profits with large standard errors), you can investigate on many assets simultaneously. The idea is to take the advantage of Central Limit Theorem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming the signal for each asset are i.i.d., and each signal $i=1,2,.., N$ can make you money $r_t^{(i)} \sim \mathbb{N}(\mu, \sigma^2)$ if you fully invest in that signal, where $\mu$ is quite small when compared with $\sigma$. Central Limit Theorem tells us that&#xA;$$&#xA;\sum_{i=1}^N \frac{1}{N} r_t^{(i)} \sim \mathbb{N}(\mu, \sigma^2/N)&#xA;$$&#xA;so now your portfolio profit doesn't hurt but has a much smaller standard error $\sigma^2/\sqrt{N}$. Taking $N$ to a large value, say 1000, and by taking leverage strategically, you can make your portfolio profit attractive while reduce the volatility to be a manageable level.&lt;/p&gt;&#xA;" OwnerUserId="16585" LastActivityDate="2015-06-18T08:43:10.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18431" PostTypeId="2" ParentId="18422" CreationDate="2015-06-18T08:53:19.750" Score="0" Body="&lt;p&gt;Do you mean the &quot;realize measure&quot; of volatility using the intraday Transaction-and-Quote data? If that's the case, just trade data, or mid-quote would be sufficient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at Level II and level III data really introduces a lot of noises (hudge cancellation rates, orders placed by HFT blindly to gain time-priority advantage). Using those data to calculate some weighted-average of price is not a sound approach to me.&lt;/p&gt;&#xA;" OwnerUserId="16585" LastActivityDate="2015-06-18T08:53:19.750" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18432" PostTypeId="2" ParentId="18408" CreationDate="2015-06-18T09:08:30.297" Score="2" Body="&lt;p&gt;In practice, for heavily traded assets (above 60% quantile of average daily dollar volume), individual asset return is pretty scalable across different time frame by a factor of $\sqrt{T}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, for covariance among different assets, moving between different time frame is not linearly scalable (although it should be in math). This is known as &quot;Epps Effect&quot;. &lt;/p&gt;&#xA;" OwnerUserId="16585" LastActivityDate="2015-06-18T09:08:30.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18433" PostTypeId="1" AcceptedAnswerId="18439" CreationDate="2015-06-18T12:45:51.113" Score="1" ViewCount="2957" Body="&lt;p&gt;In preparation for my Options, Future's and Risk Management examination next week, I have been presented with a series of questions and their answers. Unfortunately, my lecturer, one of the less organised, does not respond to emails and attempts for consultation. I have resorted to these forums to relieve some stress.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is presented as follows:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The share price of company XYC Inc. exhibits an instantaneous drift of 7% per year with return volatility of 45%. What is the probability that XYZ shares exceed \$95 after 10 months when they cost $55 today&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Of course, I will display my attempted solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, I assume that the change in stock price follows a geometric brownian motion (GBM). That is,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\Delta S}{S_{0}}=\mu \Delta t+\sigma\sqrt{\Delta t}\cdot \varepsilon.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following some algebra,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align*} &#xA;\frac{\Delta S}{S_{0}} &amp;amp;=\mu \Delta t+\sigma\sqrt{\Delta t} \cdot \varepsilon \\&#xA;\frac{S-S_{0}}{S_{0}} &amp;amp;= \mu \Delta t+\sigma\sqrt{\Delta t} \cdot \varepsilon \\S &amp;amp;= \left(S_{0} + \mu S_{0} \Delta t\right) + \sigma S_{0} \sqrt{\Delta t} \cdot \varepsilon&#xA;\end{align*}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore the distribution of future stock price is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S \sim \phi\left(S_{0} + \mu S_{0} \Delta t,\left(\sigma S_{0} \sqrt{\Delta t}\right)^{2}\right).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Substituting appropriate figures,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S \sim \left(58.21, \left(22.59\right)^2\right).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For probabilistic problems regarding normal distributions, I relate to standardised scores. I calculate that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$z_{95} = 1.63.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using Microsoft Excel, the probability that the z-score is greater than 1.63, and therefore, the price of the stock is greater than 95 is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$1- \mathrm{NORMDIST(95,58.21,22.59,TRUE)}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answer I get is 5.17%. The answer states it is 8.23%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would be beyond thankful for any help and advice on how to properly solve this problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advanced,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gustavo.&lt;/p&gt;&#xA;" OwnerUserId="13726" LastEditorUserId="13726" LastEditDate="2015-06-19T03:01:13.337" LastActivityDate="2015-06-19T03:01:13.337" Title="Confidence Intervals of Stock Following a Geometric Brownian Motion" Tags="&lt;probability&gt;&lt;brownian-motion&gt;&lt;normal-distribution&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18435" PostTypeId="1" AcceptedAnswerId="18436" CreationDate="2015-06-18T13:40:49.937" Score="4" ViewCount="1406" Body="&lt;p&gt;What seasonal patterns are there in financial markets? Is my feeling &quot;true&quot; that Mondays are more volatile than e.g. Tuesdays (as information gathered during the weekend can only be turned into an investment decision on Monday)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so do weekly returns form Monday to Monday differ from returns from Tuesday to Tuseday? Are the latter in general less volatile than the former due to such effects? What other stylized facts are there? In which markets (stock, bonds, currency)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for experiences but underpinned with references from the literature.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-06-18T14:17:22.630" Title="Seasonal patterns in financial markets (weekday effects)" Tags="&lt;market-data&gt;&lt;seasonal-effects&gt;&lt;stylized-facts&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18436" PostTypeId="2" ParentId="18435" CreationDate="2015-06-18T13:57:08.563" Score="6" Body="&lt;p&gt;You can find a good overview here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1760610&quot; rel=&quot;nofollow&quot;&gt;Seasonal Anomalies by Ziemba, W.; Dzahabarov, C.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Abstract:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This chapter is a survey of seasonal anomalies. Ziemba has been&#xA;  involved in the re- search and trading of such anomalies as the&#xA;  January turn-of-the-year effect since 1982. His research plus that of&#xA;  other academics plus the very useful practitioner research of Yale&#xA;  Hirsch’s Stock Trader’s Almanac starting in 1972 is reviewed. (We&#xA;  academics reference Hirsch but the Hirsches operate in a closed&#xA;  economy, not referencing others.) The discussion begins with an&#xA;  assessment of why the seasonal anomalies are so controversial but&#xA;  valuable and discusses some survey papers and books. Then beginning&#xA;  with the seminal anomaly, the January small firm effect, we discuss&#xA;  various other anomalies and their use in strategies including the&#xA;  construction of seasonality calendars that rank the various trading&#xA;  days of the year. The treatment is selective not exhaustive of this&#xA;  huge topic and does not cover all topics such as weekend and daily&#xA;  effects.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;br&gt;Another interesting paper, which investigates seasonality in factors, is the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1760610&quot; rel=&quot;nofollow&quot;&gt;Seasonalities in Anomalies by Bogousslavsky, V.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Abstract&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I investigate seasonalities in a set of well-known anomalies in the&#xA;  cross-section of U.S. stock returns. A January seasonality goes beyond&#xA;  a size effect and strongly affects most anomalies. For several&#xA;  anomalies, the long-short portfolio return switches sign in January.&#xA;  In addition, return seasonality exists outside of January depending on&#xA;  the month of the quarter. These results have implications for the&#xA;  interpretation of several anomalies, such as asset growth,&#xA;  idiosyncratic volatility, illiquidity, and momentum.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;br&gt;A whole bunch of papers (and their summaries when you are a subscriber) can be found here: &lt;a href=&quot;http://www.cxoadvisory.com/calendar-effects/&quot; rel=&quot;nofollow&quot;&gt;http://www.cxoadvisory.com/calendar-effects/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;br&gt;&lt;strong&gt;Edit&lt;/strong&gt;&lt;br&gt;&#xA;Because you are especially interested in day-of-the-week effects:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The analysis &lt;a href=&quot;http://www.cxoadvisory.com/4049/calendar-effects/any-recent-day-of-the-week-anomalies/&quot; rel=&quot;nofollow&quot;&gt;&quot;Any Recent Day-of-the-Week Anomalies?&quot;&lt;/a&gt; concludes:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In summary, evidence from simple tests on recent data offers little&#xA;  support for belief in exploitable day-of-the-week anomalies in U.S.&#xA;  stock market returns.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;br&gt;Concerning day-of-the-week effects in the VIX:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2014742&quot; rel=&quot;nofollow&quot;&gt;Day of the Week Effect on VIX: A Parsimonious Representation by Gonzalez-Perez, M.; Guerrero, D.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Abstract&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The study of significant deterministic seasonal patterns in financial&#xA;  asset returns is of high importance to academia and investors. This&#xA;  paper analyzes the presence of seasonal daily patterns in the VIX and&#xA;  S&amp;amp;P 500 returns series using a trigonometric specification. First, we&#xA;  show that, given the isomorphism between the trigonometrical and&#xA;  alternative seasonality representations (i.e. daily dummies) it is&#xA;  possible to test daily seasonal patterns employing a trigonometrical&#xA;  representation based on a finite sum of weighted sines and cosines. We&#xA;  find a potential evolutive seasonal pattern in the daily VIX that is&#xA;  not in the daily S&amp;amp;P 500 log-returns series. In particular, we find an&#xA;  inverted Monday effect in VIX level and changes, and a U-shaped&#xA;  seasonal pattern in VIX changes when we control for outliers. The&#xA;  trigonometrical representation is more robust to outliers than the one&#xA;  commonly used by the literature, but it is not immune to them.&#xA;  Finally, we do not find a day-of-the-week effect in S&amp;amp;P 500 returns&#xA;  series, what suggests the presence of a deterministic seasonal pattern&#xA;  in the relation between VIX and S&amp;amp;P 500 returns.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2015-06-18T14:17:22.630" LastActivityDate="2015-06-18T14:17:22.630" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="18437" PostTypeId="2" ParentId="18435" CreationDate="2015-06-18T14:05:58.940" Score="2" Body="&lt;p&gt;In my humble opinion, the most volatile day during the week should be monday, since it is the day that incorporates the greater number of information that are still not incorporated by the price, but I never tested by myself, so, as you suggested monday-to-monday returns should be different from tuesday-to-tuesday.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The literature suggests different solution for returns and volatility to your question; as regards the stock market, I think it should be useful to read:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Berument, Hakan, and Halil Kiymaz. &quot;The day of the week effect on&#xA;  stock market volatility.&quot; Journal of economics and finance 25.2&#xA;  (2001): 181-193.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It analyze the US stock returns by using a simple OLS regression model with dummies to model the mkt behaviour in particular days and reporting that Monday and Friday exhibit particular patterns on average; particularly, Monday exhibits slightly negative returns, while Friday positive on average. The paper could be useful as starting point, but not applicable because, according to me, it is not statistically robust.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, there are more interesting results for volatility. &lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-06-18T14:05:58.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18439" PostTypeId="2" ParentId="18433" CreationDate="2015-06-18T15:12:20.263" Score="2" Body="&lt;p&gt;As the stock price process $S$ follows a geometric Brownian motion, we have that&#xA;\begin{align*}&#xA;S_T &amp;amp;= S_0 e^{(\mu-\frac{1}{2}\sigma^2)\, T + \sigma\, W_T}\\&#xA;&amp;amp;= S_0 e^{(\mu-\frac{1}{2}\sigma^2)\, T + \sigma\, \sqrt{T}\, \xi},&#xA;\end{align*}&#xA;where $\xi$ is a standard normal random variable. Then, we have the probability&#xA;\begin{align*}&#xA;P(S_T &amp;gt; 95) &amp;amp;= P\Big( S_0 e^{(\mu-\frac{1}{2}\sigma^2)\, T + \sigma\, \sqrt{T}\, \xi} &amp;gt; 95\Big)\\&#xA;&amp;amp;= P\bigg(\xi &amp;gt; \frac{\ln \frac{95}{S_0} - (\mu-\frac{1}{2}\sigma^2)\, T}{\sigma\, \sqrt{T}} \bigg)\\&#xA;&amp;amp;= 1- NORMSDIST\left(\frac{\ln \frac{95}{S_0} - (\mu-\frac{1}{2}\sigma^2)\, T}{\sigma\, \sqrt{T}} \right)\\&#xA;&amp;amp;=NORMSDIST\left(\frac{\ln \frac{S_0}{95} + (\mu-\frac{1}{2}\sigma^2)\, T}{\sigma\, \sqrt{T}} \right).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-06-18T15:12:20.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18440" PostTypeId="2" ParentId="18433" CreationDate="2015-06-18T15:22:04.687" Score="1" Body="&lt;p&gt;Given its price today, the stock price at time T is lognormally distributed, whereas $lnS_T$ is normally distributed, that is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$lnS_T$ ~ $N \Bigr(lnS_0 + (\mu- \frac{\sigma^2}{2}T),\sigma^2T \Bigl)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;see for example Hull - Options, Futures, and other Derivatives.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Plugging in the numbers you get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$lnS_T$ ~ $N(3.981291519,0.16875)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the probability you want is&#xA;$P[lnS_T&amp;gt;ln95]=1-P[lnS_T&amp;lt;ln95]=1-P\Bigr[Z&amp;lt;z=\frac{ln95-3.981291519}{\sqrt{0.16875}}\Bigl] \\=1-P[Z&amp;lt;z=1.391]=1-0.9177=0.0823$&lt;/p&gt;&#xA;" OwnerUserId="12214" LastActivityDate="2015-06-18T15:22:04.687" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18441" PostTypeId="1" AcceptedAnswerId="18446" CreationDate="2015-06-18T20:53:39.967" Score="30" ViewCount="7114" Body="&lt;p&gt;Back in the 90's, Goldman Sachs (publicly?) released a series called &quot;Quantitative Strategies Research Notes&quot; — mostly technical papers on topic. &lt;a href=&quot;https://en.wikipedia.org/wiki/Emanuel_Derman&quot;&gt;Emanuel Derman&lt;/a&gt; co-authored almost all of them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some of them are available online:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.javaquant.net/papers/derman_1999_regimes.pdf&quot;&gt;Regimes of Volatility&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.emanuelderman.com/media/gs-trading_and_hedging.pdf&quot;&gt;Trading and Hedging Local Volatility&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://buildingarks.files.wordpress.com/2014/06/gs-foreign-indices-quanto-compo.pdf&quot;&gt;How to Value and Hedge Options on Foreign Indexes&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.columbia.edu/cu/cap/zhou-paper.pdf&quot;&gt;Strike-Adjusted Spread&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://bfi.cl/papers/Derman%20Kani%20Zou%201995%20-%20Local%20volatility%20surface%20Unlocking%20the%20information%20in%20index%20option%20prices.pdf&quot;&gt;The Local Volatility Surface&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;But 15 more papers are apparently missing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Did anyone see them published, perhaps, as a book? Or just a comprehensive collection?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;References&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;This is the latest list of the publications that I took from a late 1999 paper:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Understanding Guaranteed Exchange-Rate Contracts In Foreign Stock Investments.&#xA;Emanuel Derman, Piotr Karasinski and Jeffrey Wecker&lt;/li&gt;&#xA;&lt;li&gt;Valuing and Hedging Outperformance Options.&#xA;Emanuel Derman&lt;/li&gt;&#xA;&lt;li&gt;Pay-On-Exercise Options.&#xA;Emanuel Derman and Iraj Kani&lt;/li&gt;&#xA;&lt;li&gt;The Ins and Outs of Barrier Options.&#xA;Emanuel Derman and Iraj Kani&lt;/li&gt;&#xA;&lt;li&gt;The Volatility Smile and Its Implied Tree.&#xA;Emanuel Derman and Iraj Kani&lt;/li&gt;&#xA;&lt;li&gt;Static Options Replication.&#xA;Emanuel Derman, Deniz Ergener and Iraj Kani&lt;/li&gt;&#xA;&lt;li&gt;Enhanced Numerical Methods for Options with Barriers.&#xA;Emanuel Derman, Iraj Kani, Deniz Ergener and Indrajit Bardhan&lt;/li&gt;&#xA;&lt;li&gt;The Local Volatility Surface: Unlocking the Information in Index Option Prices.&#xA;Emanuel Derman, Iraj Kani and Joseph Z. Zou&lt;/li&gt;&#xA;&lt;li&gt;Implied Trinomial Trees of the Volatility Smile.&#xA;Emanuel Derman, Iraj Kani and Neil Chriss&lt;/li&gt;&#xA;&lt;li&gt;Model Risk.&#xA;Emanuel Derman,&lt;/li&gt;&#xA;&lt;li&gt;Trading and Hedging Local Volatility.&#xA;Iraj Kani, Emanuel Derman and Michael Kamal&lt;/li&gt;&#xA;&lt;li&gt;Investing in Volatility.&#xA;Emanuel Derman, Michael Kamal, Iraj Kani, John McClure, Cyrus Pirasteh and Joseph Zou&lt;/li&gt;&#xA;&lt;li&gt;Is the Volatility Skew Fair?&#xA;Emanuel Derman, Michael Kamal, Iraj Kani and Joseph Zou&lt;/li&gt;&#xA;&lt;li&gt;Stochastic Implied Trees: Arbitrage Pricing with Stochastic Term and Strike Structure of Volatility.&#xA;Emanuel Derman and Iraj Kani&lt;/li&gt;&#xA;&lt;li&gt;The Patterns of Change in Implied Index Volatilities.&#xA;Michael Kamal and Emanuel Derman&lt;/li&gt;&#xA;&lt;li&gt;Predicting the Response of Implied Volatility to Large Index Moves: An October 1997 S&amp;amp;P Case Study.&#xA;Emanuel Derman and Joe Zou&lt;/li&gt;&#xA;&lt;li&gt;How to Value and Hedge Options on Foreign Indexes.&#xA;Kresimir Demeterfi&lt;/li&gt;&#xA;&lt;li&gt;Regimes of Volatility: Some Observations on the Variation of S&amp;amp;P 500 Implied Volatilities.&#xA;Emanuel Derman&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="11701" LastEditorUserId="11701" LastEditDate="2015-06-19T13:49:01.043" LastActivityDate="2015-06-19T13:49:01.043" Title="Have Goldman Sachs Quantitative Strategies Research Notes been published as a book or a comprehensive collection?" Tags="&lt;volatility&gt;&lt;research&gt;&lt;hedging&gt;&lt;quantitative&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="47" ContentLicense="CC BY-SA 3.0" />
  <row Id="18442" PostTypeId="2" ParentId="18441" CreationDate="2015-06-18T22:08:58.693" Score="11" Body="&lt;p&gt;I had read some of them; actually, it does not exist an on-line library that collected them (or, better, it existed &lt;a href=&quot;http://www.gs.com/qs&quot;&gt;here&lt;/a&gt;, but it seems the website does not work anymore).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I reported here below some of them that you did not find:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://wwwf.imperial.ac.uk/~ajacquie/IC_Volatility/IC_Volatility_Docs/Literature/Goldman_VarSwaps.pdf&quot;&gt;More Than You Ever Wanted To Know* About Volatility Swaps&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.emanuelderman.com/media/gs-model_risk.pdf&quot;&gt;Model Risk&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.cmat.edu.uy/~mordecki/hk/derman-kani.pdf&quot;&gt;The Volatility Smile And Its implied Tree&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ciberconta.unizar.es/bolsa/enhaced.pdf&quot;&gt;Enhanced Numerical Methods&#xA;for Options with Barriers&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Those are ones I read and I know, while, here below, you can find other papers of that series:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Emanuel Derman and Joe Zou, “Is the Volatility Skew Fair?” Goldman&#xA;  Sachs Quantitative Strategies Research Notes, 1997.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: the &lt;a href=&quot;http://www.moneyscience.com/pg/bookmarks/Admin/read/211861/goldman-sachs-quantitative-strategies-research-notes&quot;&gt;moneyscience&lt;/a&gt; provides a list of them, but I'm not sure about its completeness.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT 2&lt;/strong&gt;: This is the latest list of the publications that I took from a late 1999 paper:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Understanding Guaranteed Exchange-Rate Contracts In Foreign Stock &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Investments Emanuel Derman, Piotr Karasinski and Jeffrey Wecker&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Valuing and Hedging Outperformance Options Emanuel Derman&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Pay-On-Exercise Options Emanuel Derman and Iraj Kani&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The Ins and Outs of Barrier Options Emanuel Derman and Iraj Kani&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The Volatility Smile and Its Implied Tree Emanuel Derman and Iraj Kani&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Static Options Replication Emanuel Derman, Deniz Ergener and Iraj Kani&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Enhanced Numerical Methods for Options with Barriers Emanuel Derman, Iraj Kani, Deniz Ergener and Indrajit Bardhan&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The Local Volatility Surface: Unlocking the Information in Index Option Prices Emanuel Derman, Iraj Kani and Joseph Z. Zou&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Implied Trinomial Trees of the Volatility Smile Emanuel Derman, Iraj Kani and Neil Chriss&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Model Risk Emanuel Derman,&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Trading and Hedging Local Volatility Iraj Kani, Emanuel Derman and Michael Kamal&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Investing in Volatility Emanuel Derman, Michael Kamal, Iraj Kani, John McClure, Cyrus Pirasteh and Joseph Zou&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is the Volatility Skew Fair? Emanuel Derman, Michael Kamal, Iraj Kani and Joseph Zou&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Stochastic Implied Trees: Arbitrage Pricing with Stochastic Term and Strike Structure of Volatility Emanuel Derman and Iraj Kani&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The Patterns of Change in Implied Index Volatilities Michael Kamal and Emanuel Derman&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Predicting the Response of Implied Volatility to Large Index Moves: An October 1997 S&amp;amp;P Case Study Emanuel Derman and Joe Zou&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How to Value and Hedge Options on Foreign Indexes Kresimir Demeterfi&#xA;Regimes of Volatility: Some Observations on the Variation of S&amp;amp;P 500 Implied Volatilities Emanuel Derman&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-06-18T23:06:04.607" LastActivityDate="2015-06-18T23:06:04.607" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18443" PostTypeId="1" AcceptedAnswerId="18445" CreationDate="2015-06-19T03:34:00.597" Score="2" ViewCount="1040" Body="&lt;p&gt;In Hull, we are presented that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\Delta S}{S_{0}}=\mu \Delta t+\sigma\sqrt{\Delta t}\cdot \varepsilon.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following some algebra,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align*} &#xA;\frac{\Delta S}{S_{0}} &amp;amp;=\mu \Delta t+\sigma\sqrt{\Delta t} \cdot \varepsilon \\&#xA;\frac{S-S_{0}}{S_{0}} &amp;amp;= \mu \Delta t+\sigma\sqrt{\Delta t} \cdot \varepsilon \\S &amp;amp;= \left(S_{0} + \mu S_{0} \Delta t\right) + \sigma S_{0} \sqrt{\Delta t} \cdot \varepsilon&#xA;\end{align*}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore the distribution of future stock price is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S \sim \phi\left(S_{0} + \mu S_{0} \Delta t,\left(\sigma S_{0} \sqrt{\Delta t}\right)^{2}\right).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, the future stock price follows a &lt;strong&gt;normal distribution&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We are then introduced to Itô's Lemma. By letting $G = \ln(S_{0})$, we derive that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dG = \left(\mu - \frac{1}{2}\sigma^{2}\right)dt+\sigma dz.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $G = \ln{S_{0}}$, in a discrete sense, it can be said that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dG = \ln{S_{T}} - \ln{S_{0}}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\ln{S_{T}} - \ln{S_{0}} = \left(\mu - \frac{1}{2}\sigma^{2}\right)dt+\sigma dz \\&#xA;\implies \ln{S_{T}} = \ln{S_{0}} + \left(\mu - \frac{1}{2}\sigma^{2}\right)dt+\sigma dz.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It then follows that since $\ln{S_{T}}$ follows a normal distribution, the future stock price must follow a lognormal distribution&#xA;&#xA;&lt;p&gt;I am now confused, which process do I use to answer questions about the probabilistic nature of future stock prices?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have one other question. Why does&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathcal{P}(\ln{S_{T}} &amp;gt; \ln{X}) = \mathcal{P}(S_{T} &amp;gt; X)?$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The context for my last question can be found &lt;a href=&quot;https://quant.stackexchange.com/questions/18433/confidence-intervals-of-stock-following-a-geometric-brownian-motion&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13726" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-06-25T07:22:01.643" Title="The Distribution of Future Stock Price" Tags="&lt;brownian-motion&gt;&lt;normal-distribution&gt;&lt;lognormal&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18445" PostTypeId="2" ParentId="18443" CreationDate="2015-06-19T06:41:25.380" Score="6" Body="&lt;p&gt;You ask 2 questions and I try to answer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Why do we use geometric Brownian motion ($\ln S_t-\ln S_0$ is normally distributed)? &#xA;In this case you have&#xA;$$&#xA;S_t = S_0 \exp( (\mu-\sigma^2/2) t + \sigma B_t), &#xA;$$&#xA;which means that you model positive prices. Furthermore the log-return&#xA;$$&#xA;\ln(S_t/S_0) = (\mu-\sigma^2/2) t + \sigma B_t,&#xA;$$&#xA;is normally distributed. As log returns can cover the whole real line $(-\infty,\infty)$ this is a nice model. Keep in mind that simple returns $S_t/S_0-1$ can only take values from $[-1,\infty)$. The best place to model a normal distribution is the whole real line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use a model (the Bachelier model)&#xA;$$&#xA;S_t = S_0 + \mu t + \sigma B_t,&#xA;$$&#xA;then your returns $S_t-S_0$ are normally distributed. But there is the chance that prices get negative (if $B_t$ becomes very negative). You probably don't want this in your model.&#xA;Some people use this model nevertheless to price options that are close to maturity as you don't need such large $\sigma$ to match (relatively high) prices of OTM options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For 2)&#xA;Why is $P(\ln S&amp;gt;\ln X)=P(S &amp;gt; X)$? because the logarithm is a monotonous transformation. We speak of the same events. If $S&amp;gt;X$ then always $\ln S &amp;gt; \ln X$. Thus the same events have the same probability.&#xA;Another example&#xA;$$&#xA;P ( S &amp;gt; X ) = P ( S+4 &amp;gt; X + 4).&#xA;$$&#xA;Just the same events.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-06-19T06:41:25.380" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18446" PostTypeId="2" ParentId="18441" CreationDate="2015-06-19T12:54:28.727" Score="33" Body="&lt;p&gt;Many of them are on my website at &lt;a href=&quot;http://emanuelderman.com/&quot;&gt;emanuelderman.com&lt;/a&gt;.  Others I probably have anyway. Feel free to email me   &lt;/p&gt;&#xA;" OwnerUserId="16599" LastEditorUserId="12" LastEditDate="2015-06-19T13:24:50.517" LastActivityDate="2015-06-19T13:24:50.517" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18447" PostTypeId="2" ParentId="17796" CreationDate="2015-06-19T14:12:40.857" Score="0" Body="&lt;p&gt;I may not have fully understood your question, but I assume you are asking what will happen on a leverage portfolio over time if the underlying price stays the same. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A leveraged portfolio would likely eventually go to zero (and below) simply because of the cost of leverage. At minimum, you are borrowing at the risk-free rate. An ETF would just go to zero.&lt;/p&gt;&#xA;" OwnerUserId="16496" LastActivityDate="2015-06-19T14:12:40.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18448" PostTypeId="2" ParentId="18404" CreationDate="2015-06-19T14:46:45.067" Score="2" Body="&lt;p&gt;This is a huge topic in itself. It is impossible to answer without sitting down with the client. Modern Portfolio Theory would argue against a 1/n-style diversification, with the CFA calling it a behavioural finance bias. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The CFA answer would be: You want to develop an IPS with the client. What are their risk/return objectives? Also look at: time horizon, tax concerns, liquidity needs, legal constaints, and unique concerns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the client may have specific requirements, such as &quot;no derivatives&quot; or &quot;no negative return in any year more than X%&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Normally for a pension plan you need to figure out what the required return is for the client to meet its pension obligations and start with that. You could propose a portfolio following &lt;a href=&quot;https://en.wikipedia.org/wiki/Asset_liability_management&quot; rel=&quot;nofollow&quot;&gt;Asset Liability Management principles&lt;/a&gt;. Allocate assets to meet pension needs, any surplus can be actively managed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, beware of correlations between investment assets and the client's business.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These really just scratch the surface. Look at CFA Level 3 material, it goes into more detail. &lt;/p&gt;&#xA;" OwnerUserId="16496" LastActivityDate="2015-06-19T14:46:45.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18449" PostTypeId="2" ParentId="18378" CreationDate="2015-06-19T14:56:03.440" Score="2" Body="&lt;p&gt;I think generally there are two approaches: &quot;calendar rebalancing&quot; (such as monthly as you mention) and &quot;optimal corridor width&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the first option, the danger is the portfolio could stray considerably from your benchmark between rebalancing dates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the second option, track tactical deviation on a continuous basis. When you are outside the corridor, then rebalance. The corridor size depends on:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Transaction cost (higher cost -&gt; wider corridor)&lt;/li&gt;&#xA;&lt;li&gt;Correlations (higher correlation amongst portfolio assets -&gt; wider corridor)&lt;/li&gt;&#xA;&lt;li&gt;Volatility (higher volatility -&gt; narrower corridor)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="16496" LastActivityDate="2015-06-19T14:56:03.440" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18450" PostTypeId="2" ParentId="18407" CreationDate="2015-06-19T16:35:05.257" Score="0" Body="&lt;p&gt;I would try a &lt;a href=&quot;https://en.wikipedia.org/wiki/Gradient_descent&quot; rel=&quot;nofollow&quot;&gt;Gradient Descent&lt;/a&gt; algorithm if possible, although this might take a little VBA knowledge. In general, finding the absolute minimum of a multidimensional problem like that is complicated and time consuming, but the gradient descent will find a local minimum easily.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you will need to do for worst case scenarios:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Construct a cost function that can fold all of your outputs into one &quot;cost&quot;, or simply choose one output to minimize or maximize.&lt;/li&gt;&#xA;&lt;li&gt;Choose a starting combination of inputs that you think might be close to the worst-case scenario.&lt;/li&gt;&#xA;&lt;li&gt;Calculate the &quot;cost&quot; term.&lt;/li&gt;&#xA;&lt;li&gt;Evaluate the partial derivative of your cost function with respect to each input. Adjust each input such that $input_n = (input_n-1)*cost*derivative*(LearningWeight)$,  where learning weight is some constant you choose to control the speed of adjustment.&lt;/li&gt;&#xA;&lt;li&gt;Repeat with new inputs until the change in costs is less than some small threshold you set.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;What this basically does is at every step, move the inputs in the direction that most increases the cost, like finding the top of a hill by going uphill at each step.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can repeat for best-case scenarios just by switching the sign of the cost function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this is too time-intensive, try a &lt;a href=&quot;https://en.wikipedia.org/wiki/Stochastic_gradient_descent&quot; rel=&quot;nofollow&quot;&gt;Stochastic Gradient&lt;/a&gt; instead.&lt;/p&gt;&#xA;" OwnerUserId="16598" LastEditorUserId="2553" LastEditDate="2015-06-20T06:35:44.103" LastActivityDate="2015-06-20T06:35:44.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18451" PostTypeId="1" CreationDate="2015-06-19T18:16:36.380" Score="3" ViewCount="980" Body="&lt;p&gt;Consider the common model of stock prices given by a geometric Brownian motion (GBM), which follows the SDE&#xA;$$&#xA;dS(t) = \mu S(t) dt + \sigma S(t) dW(t).&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is a plot of a simulation of such a GBM using $N = 1000$ points starting at $S(0) = 100$ and volatility $\sigma = 0.2$.  What would you think the drift $\mu$ was set to?&#xA;&lt;img src=&quot;https://i.stack.imgur.com/ioJoC.jpg&quot; alt=&quot;drift0&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you were to do an MLE estimate of $\mu$ and $\sigma$ on this time series you would get $\mu = 0.5054$ and $\sigma = 0.1966$.  In fact, this simulation was run with $\mu = 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's clear to me that I don't have a good intuition for $\mu$, as I would be tempted to agree with the MLE estimates.  How should I be thinking of $\mu$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think this has important implications for understanding calibration in practice.  I've done an MLE estimate to a GBM because I believe the process I'm trying to model follows a GBM to some extent - in this case, it IS a GBM, so there is no &quot;modelling error&quot;.  My &quot;best guess&quot; of its parameters are $\mu = 0.5054$ and $\sigma = 0.1966$.  But, in fact, $\mu = 0$.  That is, &lt;em&gt;my GBM model for a GBM with drift $0$ has drift $0.5054$.&lt;/em&gt;  What.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Some requested details:  Set $R_i = \log \left( \frac{S(t_i)}{S(t_{i-1})} \right)$, $i = 1,\ldots,N$.  The likelihood function $L$ for the data $\{R_i\}$ is&#xA;\begin{align*}&#xA;L(\mu, \sigma) = \prod_{i=1}^N \phi(R_i; \left(\mu - \frac{\sigma^2}{2}\right)\Delta t, \sigma \sqrt{\Delta t})&#xA;\end{align*}&#xA;where $\phi(x; m,s)$ is the pdf for a $\mathcal{N}(m,s^2)$-distributed random variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The MATLAB code I'm using:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% Simulates a GBM(mu,sigma) and plots the path.&#xA;% Here, GBM(mu,sigma) ~ log N((mu - sigma^2/2)*t, sigma^2*t)&#xA;&#xA;% ----------------- Simulation (Generation of Data) ---------------------&#xA;&#xA;%------------ set up parameters ----------------&#xA;N=1000; % number of points in path&#xA;mu=0;  % drift&#xA;sigma=0.2;  % vol&#xA;S0=100;  % initial value of process&#xA;T=1;  % final time&#xA;dt=T/N;  % time step&#xA;&#xA;%------------ allocation &amp;amp; initialization ----------------&#xA;t=linspace(0,T,N+1);  % time axis values&#xA;S=zeros(1,N+1);  % allocate vector of process values&#xA;S(1)=S0;  % assign initial value to process' first value&#xA;Z=normrnd(0,1,1,N);  % std normals&#xA;&#xA;%------------ compute paths ----------------&#xA;for i=2:N+1&#xA;    S(i)=S(i-1)*exp((mu - sigma^2/2)*dt + sigma*sqrt(dt)*Z(i-1));&#xA;end&#xA;&#xA;% create plot of process&#xA;plot(t,S);&#xA;&#xA;&#xA;&#xA;% ----------------- Parameter Estimation ----------------------&#xA;% create vector of log returns&#xA;R=zeros(1,N);&#xA;for i=2:N+1&#xA;  R(i-1) = log(S(i)/S(i-1));  &#xA;end&#xA;&#xA;%------------ MLE Estimates ----------------&#xA;mle_est = mle(R,'distribution','normal');&#xA;theta(2) = sqrt(mle_est(2)^2/dt);  % sigma&#xA;theta(1) = mle_est(1)/dt + 0.5*theta(2)^2;  % mu&#xA;&#xA;disp('MLE Estimates:')&#xA;disp(sprintf('mu = %f, sigma = %g',theta(1), theta(2)));&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6866" LastEditorUserId="6866" LastEditDate="2015-06-19T20:10:49.677" LastActivityDate="2015-06-20T19:56:07.523" Title="Interpretation of Drift" Tags="&lt;calibration&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18452" PostTypeId="2" ParentId="18451" CreationDate="2015-06-19T21:11:29.753" Score="1" Body="&lt;p&gt;You generated only one realization of the GBM. The variance of a GBM increases with time and so you must generate more realizations to get accurate estimates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here see a sample of Brownian simluations: &lt;a href=&quot;https://tex.stackexchange.com/questions/59926/how-to-draw-brownian-motions-in-tikz-pgf&quot;&gt;https://tex.stackexchange.com/questions/59926/how-to-draw-brownian-motions-in-tikz-pgf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="-1" LastEditDate="2017-04-13T12:36:11.583" LastActivityDate="2015-06-19T21:11:29.753" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18453" PostTypeId="2" ParentId="18410" CreationDate="2015-06-19T21:56:16.683" Score="1" Body="&lt;p&gt;Your $P_I(t,T)$ is the formula for the so-called &quot;pseudo&quot; discount curve. It can be used to compute relevant LIBOR forward rates and LIBOR zero rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &quot;true&quot; discount curve is of course the OIS discount curve, which can be built independently of the LIBOR curve.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2015-06-19T21:56:16.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18454" PostTypeId="2" ParentId="18378" CreationDate="2015-06-19T22:41:02.603" Score="1" Body="&lt;p&gt;vega captures the two most common solutions to this problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are some valid criticisms of corridors as well.  Because assets are correlated within a portfolio the decision to trade a particular asset should actually depend on the movements of other assets rather than having a corridor per asset.  Also, finding the right corridor is often done using various forms of single period analysis, but this is really a multi-period problem (if I trade now what are the chances I'll have to trade next period).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Multi period dynamic balancing problems can be solved using &lt;a href=&quot;http://ssg.mit.edu/group/fan/15.451/main.pdf&quot; rel=&quot;nofollow&quot;&gt;dynamic programming&lt;/a&gt;.  This solution really gets at the main tradeoff between tracking and costs.  I realize this is to some extent this sounds like trading one &quot;fancy optimization&quot; for another, but the cost and correlations inputs are much more stable than return estimates so optimization can be expected to perform closer to the goal. &lt;a href=&quot;http://74.115.228.67/wp-content/uploads/2014/01/Page-Optimal_Rebalancing.pdf&quot; rel=&quot;nofollow&quot;&gt;Kritzman et. al.&lt;/a&gt; found a great trick to make dynamic programming scalable for larger portfolios as well.&lt;/p&gt;&#xA;" OwnerUserId="5689" LastActivityDate="2015-06-19T22:41:02.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18455" PostTypeId="1" CreationDate="2015-06-20T11:01:22.370" Score="1" ViewCount="436" Body="&lt;p&gt;There is a statement in Paul Wimott Introduce Quantitative Finance:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Often capital gains due to the rise in a stock price are taxed differently from a dividend, which is often treated as income. Some people can make a lot of  risk-free money by exploiting tax 'inconsistencies'&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Can anyone give an example how this exploits work?&lt;/p&gt;&#xA;" OwnerUserId="16609" LastActivityDate="2015-06-20T18:48:30.403" Title="Capital gains and dividends tax arbitrage" Tags="&lt;arbitrage&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18456" PostTypeId="2" ParentId="43" CreationDate="2015-06-20T14:51:52.493" Score="1" Body="&lt;p&gt;The easiest way ,i suppose, would be to analyze the market depth. If there is a 20 cent gap between each 100 shares on the bid then to sell 1000 shares instantly would have an impact of $2. Your average price is the midpoint. There are more complicated formulations, but this seems to be how it works on simple examples such as bitcoin exchanges.&lt;/p&gt;&#xA;" OwnerUserId="15081" LastActivityDate="2015-06-20T14:51:52.493" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18457" PostTypeId="2" ParentId="80" CreationDate="2015-06-20T15:01:33.177" Score="1" Body="&lt;p&gt;It's like a giant game of tug-of-war except there are many ropes and thousands of participants. The SPY tugs at the ES, which tugs at the SPY, which tugs at other ETFs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suppose in theory you could manipulate the ES in a low volume setting by selling a huge block in the thinly-traded period before 12AM PST, selling enough to make the price fall 1/2 -1% and hope the price remains depressed until the liquid normal trading session, and use the depressed price as an opportunity to initiate option trades or buy many more shares at a cheaper price.&lt;/p&gt;&#xA;" OwnerUserId="15081" LastActivityDate="2015-06-20T15:01:33.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18458" PostTypeId="2" ParentId="18455" CreationDate="2015-06-20T18:48:30.403" Score="1" Body="&lt;p&gt;A prime example of tax arbitrage is described in the paper &lt;a href=&quot;http://www.kellogg.northwestern.edu/faculty/mcdonald/htm/rfs14_3_2.pdf&quot; rel=&quot;nofollow&quot;&gt;Cross-Border Investing with Tax Arbitrage: The Case of German Dividend Tax Credits&lt;/a&gt; by Robert L. McDonald (excerpt below). In this case, dividend income can be used to gain tax credits and as a result, the next day dividend drop exceeds the dividend value.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;German dividends typically carry a tax credit which makes the dividend&#xA;  worth 42.86% more to a taxable German shareholder than to a tax-exempt&#xA;  or foreign shareholder. This results  in  a  penalty  for  foreign &#xA;  investors  who  buy  and  hold  German  dividend-paying stocks. I&#xA;  document that, as a result of the credit, the ex-day drop exceeds the&#xA;  dividend by more than one-half of the tax credit, and show that&#xA;  futures and option prices embed more  than  one-half  of  the  tax &#xA;  credit.  The  existence  of  the  credit  creates  opportunities for &#xA;  cross-border  tax  arbitrage—in  which  foreign  holders  of  German &#xA;  stock  transfer  the dividend to German shareholders—and implies that&#xA;  it is tax efficient for foreign investors to hold derivatives rather&#xA;  than investing directly in German stocks.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Another arbitrage strategy used by non-financial firms that does not involve cross border transactions is described in the paper &lt;a href=&quot;http://faculty.chicagobooth.edu/austan.goolsbee/research/munis.pdf&quot; rel=&quot;nofollow&quot;&gt;How Prevalent is Tax Arbitrage? Evidence from the Market for Municipal Bonds&lt;/a&gt;, by M. Erickson et. al.:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;[Non-financial firms] hold municipal bonds tax-free&#xA;  while simultaneously borrowing and deducting the interest expenses&#xA;  from their taxable income.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2015-06-20T18:48:30.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18459" PostTypeId="2" ParentId="18407" CreationDate="2015-06-20T19:41:11.603" Score="5" Body="&lt;p&gt;Yes, a &lt;a href=&quot;https://en.wikipedia.org/wiki/Monte_Carlo_methods_in_finance&quot;&gt;Monte Carlo simulation&lt;/a&gt; (MC) is what you need. It is a well known and documented approach with many uses in finance, science and engineering. MC simulations are used to simulate the returns of complex financial assets or in your case returns of business ventures under uncertainty. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your input variables ($x_1, x_2,\cdots, x_n$) are uncertain. If you select values for your input variables you can feed them to your model and get the result vector ($y_1, y_2, \cdots, y_m$). You want to calculate the expected price for each of your output variables but also best and worst case scenarios. You can programmatically feed your model with thousands of input vectors to get a distribution of $y_1, y_2, \cdots, y_m$. The distribution will give you access to &lt;a href=&quot;https://en.wikipedia.org/wiki/Value_at_risk#Common_VaR_calculation_models&quot;&gt;VaR&lt;/a&gt; types of measures (loss will not exceed this level 95% of the time).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An MC simulation will require VBA. Luckily there are a lot of resources online and it is not difficult to implement. Here is a &lt;a href=&quot;https://theexcelninja.wordpress.com/2012/10/14/excel-monte-carlo-simulation/&quot;&gt;MC with Excel/VBA tutorial&lt;/a&gt; by the &quot;Excel Ninja&quot;.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Determine a probability distribution for your input variables.&lt;/li&gt;&#xA;&lt;li&gt;Are your input variables dependent? Then you might need a correlation matrix - and you will need to get its Cholesky decomposition and perform some linear algebra, which would increase the complexity of your solution.&lt;/li&gt;&#xA;&lt;li&gt;Create a loop to feed your model with the random generated vectors trough VBA. Save the results for each simulation on a worksheet.&lt;/li&gt;&#xA;&lt;li&gt;Calculate measures like expected return, VaR at various confidence intervals and visualize the results. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2015-06-20T19:41:11.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18460" PostTypeId="2" ParentId="18451" CreationDate="2015-06-20T19:56:07.523" Score="1" Body="&lt;p&gt;This is related to a common misconception called the Time Diversification fallacy. Returns do not average out over longer periods of time. On the contrary, as emcor points out, the variance increases. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might find this article named &lt;a href=&quot;http://www.norstad.org/finance/risk-and-time.html&quot; rel=&quot;nofollow&quot;&gt;Risk and Time&lt;/a&gt; by John Norstad interesting.&lt;/p&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2015-06-20T19:56:07.523" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18461" PostTypeId="1" CreationDate="2015-06-20T20:57:17.713" Score="3" ViewCount="858" Body="&lt;p&gt;For a standard geometric Brownian motion model of stock prices:&#xA;$$ dS = a S dt + \sigma S dZ$$&#xA;we can transform the process to be under risk neutral measure:&#xA;$$ dS = r S dt + \sigma S d \tilde{Z}$$&#xA;and from the references I found, this risk neutral measure is &quot;unique&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we make a transform, say&#xA;$$ dS = r S dt + \tau S d \hat{Z}$$&#xA;where $\tau$ is different from $\sigma$, this equation gives the correct price of stock. but Black-Scholes equation will fail as we have changed volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, for a discrete model, e.g. a tree model, if there are $n$ states of world, then we need $n-1$ assets plus cash to uniquely pin down risk neutral measure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;:The Brownian motion model in effect has infinite number of states and only one asset, then where does uniqueness of risk neutral measure come from?&lt;/p&gt;&#xA;" OwnerUserId="16614" LastActivityDate="2015-06-24T15:30:17.730" Title="Unique risk neutral measure for Brownian Motion" Tags="&lt;brownian-motion&gt;&lt;risk-neutral-measure&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18463" PostTypeId="2" ParentId="80" CreationDate="2015-06-20T21:58:58.593" Score="1" Body="&lt;p&gt;We will know the answer to this question when Navinder Singh Sarao is put on trial in the United States on charges of doing precisely this.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-06-20T21:58:58.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18464" PostTypeId="2" ParentId="18461" CreationDate="2015-06-20T23:55:53.547" Score="1" Body="&lt;p&gt;essentially it comes down the fact that the dyadic quadratic variation of $W_t$ is $t$ with probability 1 and any measure change has to preserve this fact. Changing volatility would violate this invariance. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-06-20T23:55:53.547" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18465" PostTypeId="1" CreationDate="2015-06-21T02:46:04.657" Score="2" ViewCount="2006" Body="&lt;p&gt;I'm writing some software that includes a feature to calculate Yield to Maturity for a Bond. I'm using an HP 10bii Financial Calculator to double check the answers produced by my software. I'm running into a problem where the output of my code sometimes doesn't match up with the physical plastic calculator. I don't know much about Bonds except for what I've learned while trying to understand how to write this code. :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the scenario I've been testing with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Purchase Price: $110&#xA;    Call Value: $100&#xA;Coupon Rate/CPN%: 5%&#xA;Annual Coupons&#xA;Actual Year (as opposed to a 360 day year)&#xA;Settlement Date: Dec 1, 2009&#xA;Maturity Date: Jan 1, 2020&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From that, I'm trying to calculate the Yield to Maturity (YTM%). I started with a more &quot;normal&quot; Settlement -&gt; Maturity date (i.e. Jan 1, 2010 -&gt; Jan 1, 2020). For those dates, my code works just fine and I get the right answer (3.780524135%). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I push the Settlement Date back one month (Dec 1, 2009 -&gt; Jan 1, 2020), then my calculated YTM% is slightly wrong.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;The plastic 10bii calculator gives me: 3.787688399%&#xA;                 My software gives me: 3.788517337%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That's pretty close, but not close enough for my software. :) Whenever I calculate using a Settlement date that matches up exactly with a period boundary (a coupon date, if I'm using that terminology correctly), then the answer produced by my software is exactly right. Whenever the Settlement Date lands on any other date (non-coupon date), then my answer is slightly wrong. This leads me to believe that the discrepancy is related to the amount of interest which has accrued on the bond during the period leading up to the next coupon... but I really don't know how the interest is supposed to be handled on Bonds. I'm a real estate investor and a computer nerd, so I'm really good with TVM and Notes, but Bonds aren't something I've had a lot of experience with. :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is how my algorithm works:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Step 1) Determine the coupon/period dates the surround the Settlement Date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This Bond uses annual periods, so counting backward from the Maturity Date... Jan 1, 2020 -&gt; Jan 1, 2019 ..etc.. Jan 1, 2010 -&gt; Jan 1, 2009. So, the coupon period that surrounds the Settlement Date is: [&lt;strong&gt;Jan 1, 2009&lt;/strong&gt; | Settlement: &lt;em&gt;Dec 1, 2009&lt;/em&gt; | &lt;strong&gt;Jan 1, 2010&lt;/strong&gt;].&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rounding down to whole periods, that's 10 periods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Step 2) Determine the fractional part of the remaining period&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, determine how many days there are from the Settlement Date to the end of the current period. (Dec 1, 2009 -&gt; Jan 1, 2010) = 31. Next, divide that by the total number of days in that period = 365. So, 31/365 = 0.08493150685. Add that to the number of whole periods in Step 1. Num periods from Settlement to Maturity = 10.08493150685&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Step 3) Perform a standard interest rate TVM calculation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;N = 10.08493150685&#xA;PV = -110&#xA;PMT = +5&#xA;FV = +100&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Interest rate (I/YR) is calculated to be: 3.788517337%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I put those inputs into my plastic calculator, I get the same interest rate. So, my software is performing Step 3 correctly given those inputs, but since this interest rate doesn't match the YTM% calculated for the overall Bond thats says to me that I'm not giving it the right inputs in Step 3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you see anything I'm doing wrong? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the above calculation, I'm paying \$110 now, then a month later I receive \$5 (\$100 x 5%) and I continue to receive a $5 payment on each Jan 1st until Jan 1st, 2020 when I receive the face value on the Bond (\$100). Am I modelling how a Bond sale actually works? (albeit a bond that I'm purchasing above par?) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not doing anything with the interest that accrued from Jan 1, 2009 -&gt; Dec 1, 2009 (i.e. the part of the period that comes before the Settlement Date). Is that accrued interest supposed to be included in one of my values in Step 3?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried taking the interest rate that the plastic calculator gives me (3.787688399%) and putting that into I/YR and then calculating N to see if I was calculating using the wrong number of periods, but the value I get would be equivalent to 10 years + 27 days instead of 10 years + 31 days. So, that seems wrong. That's why I'm assuming there is a problem with one of my PV, PMT, or FV values (and potentially N).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help is appreciated!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did some automated testing to compare my software output with the plastic 10bii output. I found that the farther I get away from a coupon date, the worse my answer and the closer I get, the better. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; #:  Difference  | Settlement Date&#xA; 0:  0.000828938 | 2009-12-01&#xA; 1:  0.000000000 | 2010-01-01&#xA; 2:  0.000827953 | 2010-02-01&#xA; 3:  0.001450767 | 2010-03-01&#xA; 4:  0.001999783 | 2010-04-01&#xA; 5:  0.002388311 | 2010-05-01&#xA; 6:  0.002639847 | 2010-06-01&#xA; 7:  0.002735772 | 2010-07-01&#xA; 8:  0.002679892 | 2010-08-01&#xA; 9:  0.002463739 | 2010-09-01&#xA;10:  0.002099264 | 2010-10-01&#xA;11:  0.001559277 | 2010-11-01&#xA;12:  0.000875747 | 2010-12-01&#xA;13:  0.000000000 | 2011-01-01&#xA;14:  0.000875541 | 2011-02-01&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This says to me that it's not the accrued interest, because if it was the AccInt then the discrepancy would grow and grow and then drop to 0 at each coupon period. The fact that it grows for 6 months and then shrinks for 6 months says to me something else is going on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What aspect of the YTM am I missing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit 2:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried calculating the amount of accrued interest and both adding and subtracting that from the PV (which I think is the &quot;dirty&quot; price?), but that just makes my YTM calculation go much further away from the target number. Interest accrued from Jan 1, 2009 -&gt; Nov 30, so the amount accrued was 4.58 out of 5.00. So, when I make the PV -114.58 or -105.42 that just gives me wildly wrong answers. :(&lt;/p&gt;&#xA;" OwnerUserId="16616" LastEditorUserId="16616" LastEditDate="2015-06-22T18:02:07.753" LastActivityDate="2015-06-22T18:02:07.753" Title="Why is my YTM incorrect? How does accrued interest play into Yield to Maturity?" Tags="&lt;interest-rates&gt;&lt;bond&gt;&lt;yield&gt;&lt;present-value&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18467" PostTypeId="1" AcceptedAnswerId="18472" CreationDate="2015-06-21T06:56:26.323" Score="3" ViewCount="148" Body="&lt;p&gt;My question is what would be the better( in terms of estimation accuracy) method of VaR calculation among below two:, also any small code snippet will be great as a starting point for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1st method: I am trying to using a Generalized Pareto Distribution(GPD) there. I think R package POT or EVD might be of some help to fit my monthly historical return data to a GPD. Then using fExtremes package VaR might be calculated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2nd Method : Another way is using PerformanceAnalytics package and trying calculate Modified Cornish-Fisher VaR.&lt;/p&gt;&#xA;" OwnerUserId="3456" LastActivityDate="2015-06-21T17:40:33.353" Title="VaR calculation accuracy/comparison/effectiveness through different R packages" Tags="&lt;r&gt;&lt;risk-management&gt;&lt;var&gt;&lt;distribution&gt;&lt;cvar&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18468" PostTypeId="2" ParentId="18407" CreationDate="2015-06-21T09:19:17.910" Score="1" Body="&lt;p&gt;Your question is little broad and has two aspect: Theory and Application.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are interested in scientific approach and academic literature this kind of thing is called &lt;a href=&quot;https://en.wikipedia.org/wiki/Mathematical_optimization&quot; rel=&quot;nofollow&quot;&gt;Mathematical_optimization&lt;/a&gt; which is branch of &lt;a href=&quot;https://en.wikipedia.org/wiki/Multi-objective_optimization&quot; rel=&quot;nofollow&quot;&gt;Multi-objective optimization&lt;/a&gt; which is again a branch of &lt;a href=&quot;https://en.wikipedia.org/wiki/Operations_research&quot; rel=&quot;nofollow&quot;&gt;Operations_research&lt;/a&gt;.&#xA;In terms of mathematics of solving these problems &lt;a href=&quot;https://en.wikipedia.org/wiki/Multivariable_calculus&quot; rel=&quot;nofollow&quot;&gt;multivariate calculus&lt;/a&gt; is the foundation for it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A very relevant research paper which uses Monte Carlo simulation with both DCF and real options risk pricing techniques to evaluate an actual project financing proposal for a small gold mine, that link is &lt;a href=&quot;http://inside.mines.edu/~gdavis/Papers/IJFERM.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now for real-world applied solution if it is in highly rich corporate setting some people use &lt;a href=&quot;https://www.crystalballservices.com/Software/OracleCrystalBall/CrystalBallDecisionOptimizer.aspxhttp://&quot; rel=&quot;nofollow&quot;&gt;Oracle Crystal Ball &amp;amp; Decision Optimizer&lt;/a&gt; which integrates with excel where this DCF analysis is being done. For a medium cost solution you can use &lt;a href=&quot;http://www.palisade.com/risk/&quot; rel=&quot;nofollow&quot;&gt;@RISK software from Palisade&lt;/a&gt; which also has excel and VBA support. A relevant case study from them for DCF is &lt;a href=&quot;http://www.palisade.com/cases/isa.asp&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3456" LastActivityDate="2015-06-21T09:19:17.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18469" PostTypeId="1" AcceptedAnswerId="18473" CreationDate="2015-06-21T11:11:05.110" Score="2" ViewCount="247" Body="&lt;p&gt;I read from various sources that yield curve is normally upward sloping. If that's the case, if we borrow short term and lend long term, won't we always make money on average?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say 1-year interest rate is 1% and 2-year interest rate is 2%. I could borrow for one year and lend for 2 years. After one year I refinance, and as long as the interest rate is below 3%, I will make money. So &lt;strong&gt;the only way I could lose money is if one-year interest rate rises above 3%&lt;/strong&gt;. However interest rates are as likely to go down as it is to go up, and the chance that it rises above 3% is even slimmer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So here's my argument. If the shape of the yield curve is consistently upward sloping, the short term interest rate has to go up by a significant amount in order for the &quot;short borrowing long lending&quot; strategy to lose money. However interest rates cannot go up forever. On average, it goes down as often as it goes up. Therefore the &quot;short borrowing long lending&quot; strategy will most likely profitable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know there are other risks involved, such as credit risk or inflation risk. But are these enough to explain it?&lt;/p&gt;&#xA;" OwnerUserId="16622" LastActivityDate="2015-06-21T18:37:21.087" Title="Arbitraging upward sloping yield curve" Tags="&lt;yield-curve&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18470" PostTypeId="2" ParentId="17819" CreationDate="2015-06-21T11:18:47.707" Score="1" Body="&lt;p&gt;If you are using Bloomberg then you can pull prices adjusted for corporate actions such as splits, dividends, and other capital adjustments, assuming this meets your needs (i.e. momentum based quant strategies). If you know which global equity indices to track then you can pull the historical constituents to minimise survivorship bias. In Bloomberg, MSCI index constituent lists requires a subscription whereas S&amp;amp;P index members are readily available. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From there you can create a security master list of all the unique tickers in your global universe and pull their adjusted/unadjusted historical data in a specified currency. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Admittedly the tickers can change after your download which requires management if you intend to run a real-time database for production purposes via this process, but it is possible to manage that process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise you could look at e.g. Thompson-Reuters, CapitalIQ, Factset, etc. but these can be very expensive. I find Bloomberg data via the terminal to be quite a cost effective solution for global equities, albeit far from perfect. Ideally one would have a loader that auto populates your DB tables each day and manages ticker/ security ID changes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this is helpful.&lt;/p&gt;&#xA;" OwnerUserId="16623" LastActivityDate="2015-06-21T11:18:47.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18472" PostTypeId="2" ParentId="18467" CreationDate="2015-06-21T17:40:33.353" Score="0" Body="&lt;p&gt;The results depend on your distribution of losses.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there is lot of departure from Normality, Cornish-Fisher VaR results will not be as accurate as GPD. But again to estimate block maxima effectively you need a large amount of data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it is difficult to say much without looking at the data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I would use the QRM package that accompanies the book, &quot;Quantitative Risk Management&quot;. &lt;/p&gt;&#xA;" OwnerUserId="2142" LastActivityDate="2015-06-21T17:40:33.353" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18473" PostTypeId="2" ParentId="18469" CreationDate="2015-06-21T18:32:00.043" Score="6" Body="&lt;p&gt;This is what banks have been doing for hundreds of years. They borrow short term (mainly through deposits and interbank lending) and lend long term (e.g. mortgages).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would not call it arbitrage, as it is not riskless profit. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apart from credit risk and interest rate risk, there is also liquidity risk. In these type of strategies, the investor has to renew (roll over) the short term debt. What happens if the short term lending markets dry up and the  short term debt cannot be rolled over, as indeed happened in &lt;a href=&quot;https://en.wikipedia.org/wiki/Financial_crisis_of_2007%E2%80%9308&quot; rel=&quot;noreferrer&quot;&gt;2007-2008&lt;/a&gt;? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an idea: What about buying 30 year treasury bonds and financing this trade through the repo market using the treasury bonds as collateral. This eliminates credit risk, right? Moreover, due to very small haircuts on the repo transaction, we could have a higly leveraged position, using a small amount of own capital. Could we then call this strategy an arbitrage strategy? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answer is no. Liquidity risk is exacerbated when high degrees of leverage are employed. A famous case study showing this point is the &lt;a href=&quot;https://en.wikipedia.org/wiki/Robert_Citron#County_bankruptcy&quot; rel=&quot;noreferrer&quot;&gt;Orange County bankruptcy&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13311" LastEditorUserId="13311" LastEditDate="2015-06-21T18:37:21.087" LastActivityDate="2015-06-21T18:37:21.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18474" PostTypeId="1" AcceptedAnswerId="18534" CreationDate="2015-06-21T23:06:21.930" Score="2" ViewCount="99" Body="&lt;p&gt;Why there are almost no book for revenue analytic?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By revenue analytic, it is meant to be predicting the revenue of a firm in the future&lt;/p&gt;&#xA;" OwnerUserId="2744" LastActivityDate="2015-06-27T14:04:32.023" Title="Why there are almost no book for revenue analytic?" Tags="&lt;finance&gt;&lt;financial-engineering&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18475" PostTypeId="2" ParentId="18465" CreationDate="2015-06-21T23:08:37.077" Score="1" Body="&lt;p&gt;In a case like this, where the settlement date is in the middle of the coupon period, it is not right to use PV = -110 (minus the purchase price) in Step 3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead you should increase the purchase price by the accrued interest, which is a fraction of the coupon based on how far the settlement date is within the current coupon period. (So for ex if you are in the middle of the period add half a coupon. In your example I believe you are eleven twelvefths into the settlement period, so try -110-5*(11/12) for PV.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-06-21T23:08:37.077" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18476" PostTypeId="2" ParentId="17462" CreationDate="2015-06-22T13:42:17.150" Score="0" Body="&lt;p&gt;Let $S_t$ and $B_t$ be respectively the stock price and the money market account value at time $t$. Then $S_t/B_t$ is called the discounted stock price. Note that&#xA;\begin{align*}&#xA;E\left(\frac{S_N}{S_0}\right) &amp;amp;= E\left(\frac{S_N}{B_N} \frac{B_N}{B_0}\right)\frac{B_0}{S_0}\\&#xA;&amp;amp;= E\left(\frac{S_N}{B_N}\right) E\left(\frac{B_N}{B_0}\right)\frac{B_0}{S_0} + Cov\left(\frac{S_N}{B_N}, \frac{B_N}{B_0}\right)\frac{B_0}{S_0},&#xA;\end{align*}&#xA;where $Cov(\,)$ is the covariance operator. If the interest rate is deterministic, then&#xA;\begin{align*}&#xA;E\left(\frac{S_N}{S_0}\right) &#xA;&amp;amp;= E\left(\frac{S_N}{B_N}\right) E\left(\frac{B_N}{B_0}\right)\frac{B_0}{S_0}\\&#xA;&amp;amp;= E\left(\frac{B_N}{B_0}\right).&#xA;\end{align*}&#xA;However, if the interest rate is stochastic, this conclusion may not be true.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-06-22T13:54:24.660" LastActivityDate="2015-06-22T13:54:24.660" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18477" PostTypeId="2" ParentId="422" CreationDate="2015-06-22T14:21:55.970" Score="0" Body="&lt;p&gt;Heres a link to free tick data for all S&amp;amp;P 500 stocks for the last 40 days. &#xA;&lt;a href=&quot;http://alphamodus.com/alphamodus/mod.asp?modid=1048&quot; rel=&quot;nofollow&quot;&gt;http://alphamodus.com/alphamodus/mod.asp?modid=1048&lt;/a&gt;. Hope this helps!&lt;/p&gt;&#xA;" OwnerUserId="16630" LastActivityDate="2015-06-22T14:21:55.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18478" PostTypeId="1" CreationDate="2015-06-22T15:18:17.707" Score="5" ViewCount="459" Body="&lt;p&gt;I am looking for a cheap (&amp;lt; $500) NASDAQ TotalView-ITCH real-time streaming data feed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any cheap and (relatively) good market vendors out there that offer this? It seems as if the TotalView feed is rather difficult to come by as many vendors offer it only as an add-on to their own visualisation tool. I am looking specifically for the raw data feed itself.&lt;/p&gt;&#xA;" OwnerUserId="16631" LastActivityDate="2015-06-23T05:53:20.317" Title="Availability of TotalView-ITCH data" Tags="&lt;market-data&gt;&lt;tick-data&gt;&lt;nasdaq&gt;&lt;feed&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18479" PostTypeId="2" ParentId="18461" CreationDate="2015-06-22T15:26:28.600" Score="3" Body="&lt;p&gt;The uniqueness of the risk-neutral measure comes from the abundance of  tradable assets. Let $B_t$ be the money-market account at time $t$. Let $Q_1$ and $Q_2$ be two risk-neutral measures. Then, for any tradable asset $X$ with maturity $T$,&#xA;\begin{align*}&#xA;E^{Q_1}\left(\frac{X_T}{B_T}\right) &amp;amp;= E^{Q_2}\left(\frac{X_T}{B_T}\right)\\&#xA;&amp;amp;=\frac{X_0}{B_0}.&#xA;\end{align*}&#xA;For any $A\in \mathcal{F}_T$, we define an asset with payoff &#xA;$$\mathbb{I}_{A} B_T.$$&#xA;Note that, this deal may not be exchange traded, however, it can be made over-the-counter. Then&#xA;\begin{align*}&#xA;Q_1(A) &amp;amp;= E^{Q_1}\left(\frac{\mathbb{I}_{A} B_T}{B_T}\right)\\&#xA;&amp;amp;= E^{Q_2}\left(\frac{\mathbb{I}_{A} B_T}{B_T}\right)\\&#xA;&amp;amp;= Q_2(A).&#xA;\end{align*}&#xA;That is, $Q_1=Q_2$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-06-22T15:26:28.600" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18480" PostTypeId="1" CreationDate="2015-06-22T16:05:17.500" Score="2" ViewCount="1298" Body="&lt;p&gt;I am trying to calculate pillar-wise sensitivity of a fixed coupon bond using par rates (given pillar-wise zero coupon sensitivities). I came across the formula pv01(par) = pv01(zero) * dz/dr, where dz/dr is the rate of change of the zero rates w.r.t the par rates. I am however unable to understand how to use this formula in excel. Any help is appreciated. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="16632" LastActivityDate="2015-06-22T17:05:13.360" Title="Jacobian transformation" Tags="&lt;fixed-income&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18481" PostTypeId="2" ParentId="18480" CreationDate="2015-06-22T17:05:13.360" Score="2" Body="&lt;p&gt;As zero rates are usually not observable, people tend to use the sensitivity with respect to par, or coupon, rates. Here, pv01(zero) is a vector, which cen be computed using the pricing formula that is usually expressed in terms of the zero rates. To compute $dz/dr$, you may need to use a finite difference scheme, for example, to shift the par rate $r$, and then re-compute the zero rates.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-06-22T17:05:13.360" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18482" PostTypeId="1" CreationDate="2015-06-22T20:47:35.200" Score="1" ViewCount="211" Body="&lt;p&gt;I have monthly data for each of the 18 sectors in the ISM PMI.&lt;br/&gt;&lt;br/&gt;&#xA;Each datapoint shows the trend of a sector: growing, contracting or neutral.&lt;br/&gt;&#xA;It also tells the strength of that trend with a number:&lt;br/&gt;&#xA;&quot;Growing 1&quot; is the sector that shows the mosts growth in that month.&lt;br/&gt;&#xA;&quot;Contracting 1&quot; is the sector that has the biggest contraction in that month.&lt;br/&gt;&#xA;Neutral always has the number 0.&lt;br/&gt;&lt;br/&gt;&#xA;So, for example, if you'd have to list a number of sectors from biggest growth to biggest contraction, it would be:&lt;br/&gt;&#xA;Sector A: Growth 1 (==&gt; biggest growth)&lt;br/&gt;&#xA;Sector B: Growth 2&lt;br/&gt;&#xA;Sector C: Growth 3&lt;br/&gt;&#xA;Sector D: Growth 4&lt;br/&gt;&#xA;Sector E: Neutral 0&lt;br/&gt;&#xA;Sector F: Contraction 3&lt;br/&gt;&#xA;Sector G: Contraction 2&lt;br/&gt;&#xA;Sector H: Contraction 1 (==&gt;biggest contraction)&lt;br/&gt;&#xA;&lt;br/&gt;&#xA;My &lt;strong&gt;goal&lt;/strong&gt; is to be able construct a chart like this,&lt;br/&gt;&#xA;which shows the &lt;strong&gt;underlying trend of a sector&lt;/strong&gt; (dashed line):&lt;br/&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/f1MlA.png&quot; alt=&quot;enter image description here&quot;&gt;&#xA;Source: &lt;a href=&quot;https://twitter.com/StoneTorch/status/608184517111603200/photo/1&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://twitter.com/StoneTorch/status/608184517111603200/photo/1&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;&#xA;The dashed line represents the underlying trend of the ISM &quot;Computer &amp;amp; Electronic Products&quot; sector.&#xA;It's the ISM sector's ranking on a 1 to -1 scale and ran through seasonal decomposition (left hand scale).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way I see it, it's a 3-part problem:&lt;br/&gt;&#xA;1. &lt;strong&gt;Ranking&lt;/strong&gt;: For each month, the sectors need to be ranked (biggest growth to biggest contraction) and get a ranking number.&lt;br/&gt;&#xA;2. &lt;strong&gt;Scaling&lt;/strong&gt;: Put the ranking number on a 1 to -1 scale&lt;br/&gt;&#xA;3. &lt;strong&gt;Seasonal decomposition&lt;/strong&gt;: For each sector (&quot;Computer &amp;amp; Electronic Products&quot; in the example chart), you have a datapoint for each month.This constitutes a time series, which can be used for seasonal decomposition to discover the actual trend.&lt;br/&gt;&#xA;&lt;br/&gt;&#xA;However, for each of these 3 steps, I don't how to perform the calculations.&lt;br/&gt;&#xA;Who can provide tips or examples on how to accomplish this please?&#xA;&lt;br/&gt;&lt;br/&gt;&#xA;&lt;em&gt;Example data&lt;/em&gt;&lt;br/&gt;&#xA;Should you need data to work with, I have put an excel with monthly data of all the ISM Manufacturing Sectors as of January 2008 here:&#xA;&lt;a href=&quot;https://goo.gl/IUuaj2&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://goo.gl/IUuaj2&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16593" LastActivityDate="2016-11-16T23:39:36.513" Title="ISM PMI data - sector trend through ranking and seasonal decomposition" Tags="&lt;data&gt;&lt;statistics&gt;&lt;quant-trading-strategies&gt;&lt;trading&gt;&lt;statistical-finance&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18483" PostTypeId="1" CreationDate="2015-06-22T20:49:58.600" Score="5" ViewCount="574" Body="&lt;p&gt;I have two question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does an option on volatility control index exist? If I google it, it seems like there is such an option, but I can't find the option on any of exchanges. So this is my first question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible that the option can be OTC? From my knowledge, options are all listed on the exchange.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="16636" LastActivityDate="2015-06-23T21:59:41.643" Title="Options on Volatility Control Index" Tags="&lt;options&gt;&lt;volatility&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18484" PostTypeId="2" ParentId="18483" CreationDate="2015-06-22T21:18:41.533" Score="1" Body="&lt;p&gt;There does exist some volatility control indexes (e.g., see page 37 of the S &amp;amp; P index methodology, which can be downloaded from &lt;a href=&quot;http://ca.spindices.com/documents/methodologies/methodology-index-math.pdf?force_download=true&quot; rel=&quot;nofollow&quot;&gt;http://ca.spindices.com/documents/methodologies/methodology-index-math.pdf?force_download=true&lt;/a&gt;), and also options on them, which are usually embedded in certain structured notes (e.g., google &quot;Risk Aligned Deposit Notes&quot;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, these are mainly OTC based. For valuation, they usually do not have analytical formulas, and Monte Carlo simulation should be used. However, in practice, the trader likes to value them at the controlled volatility levels, that is, assuming constant volatility, in a so called conservativeness sense.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-06-23T21:59:41.643" LastActivityDate="2015-06-23T21:59:41.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18485" PostTypeId="2" ParentId="16024" CreationDate="2015-06-22T22:26:32.157" Score="3" Body="&lt;p&gt;I suggest you to read:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Lancaster, Tony. An introduction to modern Bayesian econometrics.&#xA;  Oxford: Blackwell, 2004.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I studied that to learn &lt;em&gt;Bayesian Regression Model&lt;/em&gt;; the book is very clear and well-done and it is a good reference, IMHO, for who is a newbie, but, at the same time, is interested to the topic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-06-22T22:26:32.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18486" PostTypeId="2" ParentId="18478" CreationDate="2015-06-23T05:53:20.317" Score="3" Body="&lt;p&gt;Simply put, no, you won't find this.  The most basic one-port ITCH feed with no redistribution rights runs \$750/mo.  Historical ITCH data which is useful for backtesting is \$1,000/mo. with a 12 month initial minimum contract.  Fees for distributors are much, much more expensive (all costs can be found on the NASDAQ OMX website), and the restrictions on redistribution are quite prohibitive so no one can simply sublicense it cheap.&lt;/p&gt;&#xA;" OwnerUserId="2560" LastActivityDate="2015-06-23T05:53:20.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18487" PostTypeId="1" AcceptedAnswerId="18490" CreationDate="2015-06-23T07:31:11.323" Score="4" ViewCount="947" Body="&lt;p&gt;I am studying the Arbitrage Pricing Theory using Pairs Trading: Quantitative Methods and Analysis.In page 44 the author gives an example on how to calculate the covariance between two stocks. I will tell how the author do it first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two stocks using two factor model, for stock A, the two factor model is (0.5, 0.75) and the factor covariance matrix is [ 0.625 0.0225,0.0225, 0.1024]. And for stock B, the two factor model is (0.75, 0.5). Then the author says we can calculate the covariance between stocks as [0.5, 0.75][0.625 0.0225,0.0225, 0.1024][0.75,0.5].&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I do not understand is that in calculating the covariance between stocks, the mid-term is the factor covariance matrix for stock A, we do not know the factor covariance matrix for stock B, so is it right to calculate the covariance between the stocks as the author says? &lt;/p&gt;&#xA;" OwnerUserId="15198" LastActivityDate="2015-06-23T13:20:46.073" Title="Covariance between two stocks in a two-factor model" Tags="&lt;quant-trading-strategies&gt;&lt;finance&gt;&lt;quants&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18488" PostTypeId="2" ParentId="18487" CreationDate="2015-06-23T08:02:25.443" Score="2" Body="&lt;p&gt;The factors are the same for both stocks, so there is just one factor covariance matrix for both A and B. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Factor models are a way to &lt;em&gt;reduce&lt;/em&gt; the dimension of a problem. If every stock had its own set of factors, this would increase the problem dimension.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2015-06-23T08:02:25.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18489" PostTypeId="1" CreationDate="2015-06-23T10:17:13.463" Score="4" ViewCount="1586" Body="&lt;p&gt;In some implied volatility code I came across, there is a check to ensure there is no violation of the arbitrage bounds based on the inputs to the method. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the call option, if&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P &amp;lt; 0.99 * (S-K*e^{-t*r})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(where $P$ is the market price of the option and $S, K, t $ and $r$ are underlying price, strike price, time to maturity and rate, respectively) then the price input to the method violates the bound and the method returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the comparable test for a put option and how is it derived?&lt;/p&gt;&#xA;" OwnerUserId="1112" LastActivityDate="2015-06-24T13:53:07.357" Title="Arbitrage bounds for Black-Scholes" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18490" PostTypeId="2" ParentId="18487" CreationDate="2015-06-23T10:39:16.163" Score="6" Body="&lt;p&gt;Your questions is unclear but I guess you mean that for the return of stock A you find a model&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;r_A = (0.5, 0.75) (r_F^1, r_F^2) + \epsilon_A &#xA;$$&#xA;where $r_F^i$ are the factor returns and $\epsilon_A $ is an uncorrelated error. Let us denote $e_A = (0.5, 0.75)$, the exposure of stock $A$ to the factors.&#xA;For $B$ you have&#xA;$$&#xA;r_B = (0.75, 0.5) (r_F^1, r_F^2) + \epsilon_B.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore the covariance matrix of the factor returns is given by&#xA;$$ \Sigma_F:=&#xA; \left( \begin{array}{ccc}&#xA;0.625 &amp;amp; 0.0225  \\&#xA;0.0225 &amp;amp; 0.1024 \end{array} \right).&#xA;$$&#xA;Then the covariance of $r_A$ and $r_B$ can be calculated as follows&#xA;\begin{align}&#xA;cov(r_A,r_B) &amp;amp;= cov(e_A(r_F^1,r_F^2)+\epsilon_A,e_B(r_F^1,r_F^2)+\epsilon_B ) \\&#xA;             &amp;amp;= cov(e_A(r_F^1,r_F^2),e_B  (r_F^1,r_F^2) ) \\&#xA;             &amp;amp;= e_A \Sigma_F e_B,&#xA;\end{align}&#xA;where we have used the assumption that the errors are uncorrelated from all other random variables and some matrix algebra to arrive at the vector times matrix times vector expression that you have up there.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-06-23T13:20:46.073" LastActivityDate="2015-06-23T13:20:46.073" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18491" PostTypeId="1" AcceptedAnswerId="18501" CreationDate="2015-06-23T10:57:59.543" Score="2" ViewCount="144" Body="&lt;p&gt;How can I extraction this PDE &#xA;\begin{align*}&#xA; 0 =&amp;amp; P_t+P_SS(r-\delta)+P_\sigma a(\sigma)+P_r\alpha (r,t) \\&#xA;   +&amp;amp; \frac{1}{2}P_{SS}S^2\sigma ^2 + \frac{1}{2}P_{\sigma \sigma}b^2(\sigma)+\frac{1}{2}P_{rr}\beta^2(r) \\&#xA;   +&amp;amp; P_{S\sigma}\sigma Sb(\sigma)\rho _{12}+P_{Sr}\sigma S\beta(\sigma)\rho _{13}+P_{\sigma r}\beta(\sigma)b(\sigma)\rho _{23}-rP&#xA;\end{align*}&#xA;for option price $P(S,\sigma ,r ,t)$ from stochastic system &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;dS_t &amp;amp;= (r_t-\delta)S_tdt+\sigma _tS_tdW_t^{(1)} \\&#xA;d\sigma _t &amp;amp;=a(\sigma _t)dt+b(\sigma _t)dW^{(2)}_t\\&#xA;dr_t &amp;amp;= \alpha(r_t,t)dt+\beta (r_t)dW_t^{(3)}&#xA;\end{align*} &#xA;such that &#xA;$$ dW^{(i)}_tdW^{(j)}_t=\rho_{ij}dt $$&#xA;for american option pricing ?&lt;/p&gt;&#xA;" OwnerUserId="13370" LastEditorUserId="13370" LastEditDate="2015-06-23T11:39:09.947" LastActivityDate="2015-06-24T12:45:33.123" Title="Hedging portfolio and extraction PDE of SV model with stochastic interest rate" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;american-options&gt;&lt;delta-hedging&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18492" PostTypeId="2" ParentId="18489" CreationDate="2015-06-23T11:45:08.157" Score="3" Body="&lt;p&gt;The No-Arbitrage bounds for a European put are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ (Ke^{-rT}-S)^+ \leq P \leq K e^{-rT}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is because the maximum payoff at maturity is $K$ (discounted) and the minimum value is the discounted intrinsic value (since $E(e^{-rT}S_T)=S_t$ by the martingale condition and the payoff being always semi-positive).&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2015-06-23T13:31:43.517" LastActivityDate="2015-06-23T13:31:43.517" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18493" PostTypeId="1" AcceptedAnswerId="23007" CreationDate="2015-06-23T14:58:51.543" Score="8" ViewCount="262" Body="&lt;p&gt;Let us consider the BS model and let $f(s,t)$ denote the price of an American put option with $t$ to expiry, then it is known the solution of the optimal stopping  (when it is risk neutral) related to this American put option can be characterised by a curve continuous, monotonically decreasing, convex curve $c(t)$ such that $c(0)=K$ and $c(\infty)$ is a known limit from the perpetual problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us denote $C$ as the continuation region of this problem, that is $\{(s,t):s&amp;gt;C(t)\}$ and $D=C^c$ is the stopping region. It is well established that smooth pasting is exhibited at the boundary, that is to say&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\lim_{(t,s)\rightarrow(T,C(T))}\partial_sf(s,t)= -1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This condition can be proved in many different ways via classical theory as well as arguments using viscosity solutions. My question is that: is anything known about time derivative when we approach the boundary?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, does &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\lim_{(t,s)\rightarrow(T,C(T))}\partial_tf(s,t)= 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;hold?&lt;/p&gt;&#xA;" OwnerUserId="3334" LastEditorUserId="3334" LastEditDate="2015-06-26T13:07:49.937" LastActivityDate="2016-02-28T16:22:22.200" Title="Does price of american (put) option exhibit smooth pasting in time direction under B-S model?" Tags="&lt;black-scholes&gt;&lt;american-options&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18494" PostTypeId="2" ParentId="18491" CreationDate="2015-06-23T15:09:43.237" Score="0" Body="&lt;p&gt;The PDE only holds in t he continuation region, in the excerise region, P is just the pay off of the function. Let $\tau$ be the first time you enter the stopping region, then by the martingale property of the option price up to the first stopping time&#xA;$$\mathbb{E}P(S_{t\wedge\tau},\sigma_{t\wedge\tau},r_{t\wedge\tau})e^{-r{t\wedge\tau}}=P(S_0,\sigma_0,r_0)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You apply ito's formula to the left hand side to get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P(S_{t\wedge\tau},\sigma_{t\wedge\tau},r_{t\wedge\tau})e^{-r{t\wedge\tau}}=P(S_0,\sigma_0,r_0)+\text{something dt}+\text{a local martingale} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you substitute the last equation to the left hand side of the 1st equation, note the expectation of the local martingale is 0, you are left with&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}\int^{\tau\wedge t}_0 ... \text{d}t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now divide this by $1/t$ and take the limit $t\rightarrow 0$ and justify the exchange of appropriate limits. Note that $\tau$ can be ignored because $P(\tau&amp;lt;t)\rightarrow 0$ as you start in the continuous region and the process is continuous.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this is exactly the same thing you would get if you deal with a European option.&lt;/p&gt;&#xA;" OwnerUserId="3334" LastActivityDate="2015-06-23T15:09:43.237" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18495" PostTypeId="1" AcceptedAnswerId="18497" CreationDate="2015-06-23T15:23:58.253" Score="2" ViewCount="173" Body="&lt;p&gt;Selling and delivering real-time data seems to be the focus of practically all large data vendors, but I am more interested in acquiring large sets of historical daily data covering, say, 5.000 instruments (equity, rates, fx, commodities, etc) about 15-25 years back. It does not seem to be a priority for any vendor to deliver such a service - is this true? It would seem like an interesting set to mine. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please note that I am not asking for a free service - I am aware of the typical free sources, but calling them repeatedly seems like a hassle and besides, they often have greatly varying time series lengths depending on the instrument.&lt;/p&gt;&#xA;" OwnerUserId="13808" LastActivityDate="2015-06-23T16:17:56.150" Title="Acquiring large sets of price series" Tags="&lt;data&gt;&lt;historical-data&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18496" PostTypeId="1" AcceptedAnswerId="18504" CreationDate="2015-06-23T15:37:03.247" Score="0" ViewCount="180" Body="&lt;p&gt;Is it possible  to estimate the local volatility using the spot price S at time t instead of the strike price K and the expiry date T ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="16647" LastEditorUserId="2553" LastEditDate="2015-06-23T15:55:21.273" LastActivityDate="2015-06-24T18:11:42.180" Title="Local volatility parametrization using the spot" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;local-volatility&gt;&lt;modelling&gt;&lt;parameter-estimation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18497" PostTypeId="2" ParentId="18495" CreationDate="2015-06-23T16:17:56.150" Score="1" Body="&lt;p&gt;It's not entirely true. The challenge is to obtain a clean and well maintained historical set, not just a prices set. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typically, there are many vendors that provide historical data sets, but fail to accommodate corporate actions or other adjustments, so in order to use the set in a research, you'd still need to clean the data thoroughly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Depending on what asset classes you are looking for, here is a short list of vendors with relatively clean historical data:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Equities and indices: MorningStar, SIX Financial, Interactive Data&lt;/li&gt;&#xA;&lt;li&gt;Options: CBOE, OptionMetrics&lt;/li&gt;&#xA;&lt;li&gt;Futures: DTN, Barchart&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;There are more sources indicated &lt;a href=&quot;http://computeraidedfinance.com/2012/05/02/comprehensive-list-of-free-historical-market-data-sources/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2909" LastActivityDate="2015-06-23T16:17:56.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18498" PostTypeId="2" ParentId="18489" CreationDate="2015-06-23T19:37:22.433" Score="5" Body="&lt;p&gt;For a call option, the payoff is given by $(S_T-K)^+$. Note that the function $x^+$ is convex, then, by Jensen's inequality, the price $c$ satisfies&#xA;\begin{align*}&#xA;c &amp;amp;= e^{-rT}E\big((S_T-K)^+\big) \\&#xA;&amp;amp; \geq e^{-rT}\big(E(S_T-K)\big)^+\\&#xA;&amp;amp;=\big(S_0 -  K \, e^{-rT}\big)^+.&#xA;\end{align*}&#xA;For the upper bound, note that&#xA;\begin{align*}&#xA;c &amp;amp;= e^{-rT}E\big((S_T-K)^+\big) \\&#xA;&amp;amp;&amp;lt; e^{-rT}E\big(S_T\big) \\&#xA;&amp;amp;=S_0.&#xA;\end{align*}&#xA;That is, &#xA;\begin{equation}&#xA;\big(S_0 -  K \, e^{-rT}\big)^+ \leq c &amp;lt; S_0 .&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, for a put option, the payoff is given by $(K-S_T)^+$. The price $p$ then satisfies&#xA;\begin{align*}&#xA;p &amp;amp;= e^{-rT}E\big((K-S_T)^+\big) \\&#xA;&amp;amp; \geq e^{-rT}\big(E(K-S_T)\big)^+\\&#xA;&amp;amp;=\big(K \, e^{-rT}-S_0\big)^+.&#xA;\end{align*}&#xA;For the upper bound, note that&#xA;\begin{align*}&#xA;p &amp;amp;= e^{-rT}E\big((K-S_T)^+\big) \\&#xA;&amp;amp;&amp;lt; e^{-rT}E\big(K\big) \\&#xA;&amp;amp;=K \, e^{-rT}.&#xA;\end{align*}&#xA;That is, &#xA;\begin{equation}&#xA;\big(K \, e^{-rT}-S_0\big)^+ \leq p &amp;lt; K \, e^{-rT}.&#xA;\end{equation}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-06-24T13:53:07.357" LastActivityDate="2015-06-24T13:53:07.357" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18500" PostTypeId="2" ParentId="18489" CreationDate="2015-06-23T22:29:18.743" Score="2" Body="&lt;p&gt;you can do the bounds without using a model or martingales. At maturity&#xA;$$&#xA;0 \leq C \leq S_T&#xA;$$&#xA;with positive probability of strict inequalities. So before maturity,&#xA;$$&#xA;0 &amp;lt; C &amp;lt; S_t. &#xA;$$&#xA;Since if these are violated, you can make an arbitrage. eg if $C \geq S_t$ hold $S_t - C$ to get a profit with positive probability and no chance of loss. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, if $B_T$ is a zero coupon bond expiring at $T,$ then we have&#xA;$$&#xA;S_T - KB_T \leq C&#xA;$$&#xA;at time $T$ and before maturity, we have&#xA;$$&#xA;S_t - KB_T(t) &amp;lt; C.&#xA;$$&#xA;That is&#xA;$$&#xA;S_t - Ke^{-r(T-t)} &amp;lt; C &amp;lt; S_t&#xA;$$&#xA;and positive as well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(see my book concepts for more discussion.)&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-06-23T22:29:18.743" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="18501" PostTypeId="2" ParentId="18491" CreationDate="2015-06-24T12:45:33.123" Score="2" Body="&lt;p&gt;First we write dynamic of ${{x}_{t}}=\ln ({{S}_{t}})$&#xA;\begin{align}&#xA;  &amp;amp; d{{x}_{t}}=({{r}_{t}}-\delta -\frac{1}{2}\sigma _{t}^{2})t+{{\sigma }_{t}}d{{W}_{1}}(t) \\&#xA; &amp;amp; d{{\sigma }_{t}}=a({{\sigma }_{t}},t)dt+b({{\sigma }_{t}},t)d{{W}_{2}}(t) \\&#xA; &amp;amp; d{{r}_{t}}=\alpha ({{r}_{t}},t)dt+\beta ({{r}_{t}},t)d{{W}_{3}}(t) \\&#xA;\end{align}&#xA;Let&#xA;\begin{align}&#xA;  &amp;amp; {{W}_{1}}={{B}_{1}} \\&#xA; &amp;amp; {{W}_{2}}={{\rho }_{12}}{{B}_{1}}+\sqrt{1-\rho _{12}^{2}}{{B}_{2}} \\&#xA; &amp;amp; {{W}_{3}}={{\rho }_{13}}{{B}_{1}}+\frac{{{\rho }_{23}}-{{\rho }_{12}}{{\rho }_{13}}}{\sqrt{1-\rho _{12}^{2}}}{{B}_{2}}+\sqrt{1-\rho _{13}^{2}-\frac{{{({{\rho }_{23}}-{{\rho }_{12}}{{\rho }_{13}})}^{2}}}{1-\rho _{12}^{2}}}{{B}_{3}} \\&#xA;\end{align}&#xA;Such that $dB_i dB_j=0$ then&#xA;\begin{align}&#xA;  &amp;amp; d{{x}_{t}}=({{r}_{t}}-\delta -\frac{1}{2}\sigma _{t}^{2})dt+{{\sigma }_{t}}d{{B}_{1}}(t) \\&#xA; &amp;amp; d{{\sigma }_{t}}=a({{\sigma }_{t}},t)dt+b({{\sigma }_{t}},t)({{\rho }_{12}}d{{B}_{1}}(t)+\sqrt{1-\rho _{12}^{2}}d{{B}_{2}}(t)) \\&#xA; &amp;amp; d{{r}_{t}}=\alpha ({{r}_{t}},t)dt+\beta ({{r}_{t}},t)\left( {{\rho }_{13}}d{{B}_{1}}(t)+\frac{{{\rho }_{23}}-{{\rho }_{12}}{{\rho }_{13}}}{\sqrt{1-\rho _{12}^{2}}}d{{B}_{2}}(t)+\sqrt{1-\rho _{13}^{2}-\frac{{{({{\rho }_{23}}-{{\rho }_{12}}{{\rho }_{13}})}^{2}}}{1-\rho _{12}^{2}}}d{{B}_{3}}(t) \right)(t) \\&#xA;\end{align}&#xA;Now we define&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Sigma (x(t),t)=\left( \begin{matrix}&#xA;   {{\sigma }_{t}} &amp;amp; 0 &amp;amp; 0  \\&#xA;   b({{\sigma }_{t}},t){{\rho }_{12}} &amp;amp; b({{\sigma }_{t}},t)\sqrt{1-\rho _{12}^{2}} &amp;amp; 0  \\&#xA;   \beta ({{r}_{t}},t){{\rho }_{13}} &amp;amp; \beta ({{r}_{t}},t)\frac{{{\rho }_{23}}-{{\rho }_{12}}{{\rho }_{13}}}{\sqrt{1-\rho _{12}^{2}}} &amp;amp; \beta ({{r}_{t}},t)\sqrt{1-\rho _{13}^{2}-\frac{{{({{\rho }_{23}}-{{\rho }_{12}}{{\rho }_{13}})}^{2}}}{1-\rho _{12}^{2}}}  \\&#xA;\end{matrix} \right)$$&#xA;$$\Xi (x(t),t)=\left( \begin{matrix}&#xA;   ({{r}_{t}}-\delta -\frac{1}{2}\sigma _{t}^{2})  \\&#xA;   a({{\sigma }_{t}},t)  \\&#xA;   \alpha ({{r}_{t}},t)  \\&#xA;\end{matrix} \right)$$&#xA;$$B(t)=\left( \begin{matrix}&#xA;   {{B}_{1}}(t)  \\&#xA;   {{B}_{2}}(t)  \\&#xA;   {{B}_{3}}(t)  \\&#xA;\end{matrix} \right)\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,X(t)=\left( \begin{matrix}&#xA;   {{x}_{1}}(t)  \\&#xA;   {{x}_{2}}(t)  \\&#xA;   {{x}_{3}}(t)  \\&#xA;\end{matrix} \right)=\left( \begin{matrix}&#xA;   x(t)  \\&#xA;   \sigma (t)  \\&#xA;   r(t)  \\&#xA;\end{matrix} \right)$$&#xA;then&#xA;$$dX(t)=\Xi (x(t),t)dt+\Sigma (x(t),t)dB(t)$$&#xA;For simplicity,as we let&#xA;$${{l}_{1}}=\sqrt{1-\rho _{12}^{2}}\,\,\,\,\,\,\,,\,\,\,\,\,{{l}_{2}}=\frac{{{\rho }_{23}}-{{\rho }_{12}}{{\rho }_{13}}}{\sqrt{1-\rho _{12}^{2}}}\,\,\,\,\,,\,\,\,\,\,\,\,{{l}_{3}}=\sqrt{1-\rho _{13}^{2}-\frac{{{({{\rho }_{23}}-{{\rho }_{12}}{{\rho }_{13}})}^{2}}}{1-\rho _{12}^{2}}}$$&#xA;$$\Sigma (x(t),t)=\left( \begin{matrix}&#xA;   \sigma  &amp;amp; 0 &amp;amp; 0  \\&#xA;   b{{\rho }_{12}} &amp;amp; b{{l}_{1}} &amp;amp; 0  \\&#xA;   \beta {{\rho }_{13}} &amp;amp; \beta {{l}_{2}} &amp;amp; \beta {{l}_{3}}  \\&#xA;\end{matrix} \right)$$&#xA;Simply it follows that&#xA;$$\Sigma {{\Sigma }^{\text{T}}}=\left( \begin{matrix}&#xA;   {{\sigma }^{2}} &amp;amp; \sigma b{{\rho }_{12}} &amp;amp; \sigma \beta {{\rho }_{13}}  \\&#xA;   \sigma b{{\rho }_{12}} &amp;amp; {{b}^{2}}\rho _{12}^{2}-{{b}^{2}}l_{1}^{2} &amp;amp; b\beta ({{\rho }_{12}}{{\rho }_{13}}+{{l}_{1}}{{l}_{2}})  \\&#xA;   \sigma \beta {{\rho }_{13}} &amp;amp; b\beta ({{\rho }_{12}}{{\rho }_{13}}+{{l}_{1}}{{l}_{2}}) &amp;amp; {{\beta }^{2}}(\rho _{13}^{2}+l_{2}^{2}+l_{3}^{2})  \\&#xA;\end{matrix} \right)$$&#xA;As a result&#xA;$$\Sigma {{\Sigma }^{\text{T}}}=\left( \begin{matrix}&#xA;   {{\sigma }^{2}} &amp;amp; \sigma b{{\rho }_{12}} &amp;amp; \sigma \beta {{\rho }_{13}}  \\&#xA;   \sigma b{{\rho }_{12}} &amp;amp; {{b}^{2}} &amp;amp; b\beta {{\rho }_{23}}  \\&#xA;   \sigma \beta {{\rho }_{13}} &amp;amp; b\beta {{\rho }_{23}} &amp;amp; {{\beta }^{2}}  \\&#xA;\end{matrix} \right)$$&#xA;Kolmogorov backward operator &#xA;$$(A\,\,P)(t,x(t))=\sum\limits_{i=1}^{3}{{{\Xi }_{i}}\frac{\partial P}{\partial {{x}_{i}}}(t,x(t))+\frac{1}{2}}\sum\limits_{i,j=1}^{3}{{{(\Sigma {{\Sigma }^{\text{T}}})}_{i,j}}\frac{{{\partial }^{2}}P}{\partial {{x}_{i}}\partial {{x}_{j}}}(t,x(t))}$$&#xA;According to Feynman–Kac Theorem&#xA;$${{P}_{t}}+A\,(P)-rP=0$$&#xA;Change PDE for $S(t)={{e}^{x(t)}}$ then&#xA;\begin{align}&#xA;  &amp;amp; 0={{P}_{t}}+({{r}_{t}}-\delta )S{{P}_{S}}+a({{\sigma }_{t}},t){{P}_{\sigma }}+\alpha ({{r}_{t}},t){{P}_{r}} \\&#xA; &amp;amp; \,\,\,\,\,\,\,+\frac{1}{2}{{\sigma }^{2}}{{S}^{2}}{{P}_{SS}}+\frac{1}{2}{{b}^{2}}{{P}_{\sigma \sigma }}+\frac{1}{2}{{\beta }^{2}}{{P}_{rr}} \\&#xA; &amp;amp; \,\,\,\,\,\,\,+\sigma b{{\rho }_{12}}S{{P}_{S\sigma }}+\sigma \beta {{\rho }_{13}}S{{P}_{Sr}}+b\beta {{\rho }_{23}}{{P}_{\sigma r}}-rP \\&#xA;\end{align}&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastActivityDate="2015-06-24T12:45:33.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18502" PostTypeId="1" CreationDate="2015-06-24T14:13:17.080" Score="9" ViewCount="4654" Body="&lt;p&gt;Bridgewater Associates send out Daily Observations to their clients, but I haven't found many traces of these publications online. The series started some 40 years ago by Ray Dalio, and there're just few papers lying around.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some &lt;a href=&quot;https://www.bwater.com/home/research--press/daily-observations.aspx&quot;&gt;publications are available&lt;/a&gt; upon registration on bwater.com:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Formula for Economic Success - Part 2 - October 31, 2012 &lt;/li&gt;&#xA;&lt;li&gt;Formula for Economic Success - Part 1 - October 30, 2012 &lt;/li&gt;&#xA;&lt;li&gt;Seeing Today's Crisis from Two Worlds - June 18, 2012 &lt;/li&gt;&#xA;&lt;li&gt;Hedge Fund Returns Dominated by Beta - May 3, 2012 &lt;/li&gt;&#xA;&lt;li&gt;Asset Class Returns in Deleveragings - April 19, 2012 &lt;/li&gt;&#xA;&lt;li&gt;A Beautiful Deleveraging - February 24, 2012 &lt;/li&gt;&#xA;&lt;li&gt;Update on the Seismic Shift - January 3, 2012&lt;/li&gt;&#xA;&lt;li&gt;Approaching the Seismic Shift - April 25, 2011&lt;/li&gt;&#xA;&lt;li&gt;More Will Likely be Necessary from the Fed - July 29, 2010 &lt;/li&gt;&#xA;&lt;li&gt;The New Decade: 2010-2019 - January 11, 2010&lt;/li&gt;&#xA;&lt;li&gt;A Modern Day D-Process - April 28, 2009&lt;/li&gt;&#xA;&lt;li&gt;Great Moves! - September 19, 2008&lt;/li&gt;&#xA;&lt;li&gt;An Inflection Point in Banking - April 29, 2008&lt;/li&gt;&#xA;&lt;li&gt;Hedge Funds Selling Beta as Alpha (An Update) - May 24, 2005&lt;/li&gt;&#xA;&lt;li&gt;The Biggest Mistake in Investing - August 18, 2004&lt;/li&gt;&#xA;&lt;li&gt;It's All Macro - May 7, 2004&lt;/li&gt;&#xA;&lt;li&gt;The Next Decade - January 5, 2000&lt;/li&gt;&#xA;&lt;li&gt;The First Day of the New...Decade, Century, or Millennium - January 4, 2000&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;But that's just a fraction of them. Are there more anywhere else?&lt;/p&gt;&#xA;" OwnerUserId="11701" LastActivityDate="2020-03-06T02:48:17.997" Title="Bridgewater's Daily Observations" Tags="&lt;research&gt;&lt;hedging&gt;&lt;reference-request&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="18503" PostTypeId="2" ParentId="18461" CreationDate="2015-06-24T15:30:17.730" Score="1" Body="&lt;p&gt;Let M denote the number of underlying traded assets in&#xA;the model excluding the risk free asset, and let R denote the number of random&#xA;sources. Generically we then have the following relations:&#xA;1. The model is arbitrage free if and only if M ≤ R.&#xA;2. The model is complete if and only if M ≥ R.&#xA;3. The model is complete and arbitrage free if and only if M = R.&#xA;Black Scholes Model is Complete and arbitrage free then risk-neutral measure is unique.&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastActivityDate="2015-06-24T15:30:17.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18504" PostTypeId="2" ParentId="18496" CreationDate="2015-06-24T18:11:42.180" Score="2" Body="&lt;p&gt;One does not estimate the local volatility at a given $T$ and $K$. Instead, &#xA;Dupire's formula actually gives $\sigma(T,K)$ &lt;strong&gt;&lt;em&gt;for all&lt;/em&gt;&lt;/strong&gt; $T$ and $K$.&#xA;$$&#xA;\sigma^2(t_0,S_0;T,K)= \frac{\frac{\partial C}{\partial T} + (r - q)K \frac{\partial C}{\partial K} + qC}{\frac{1}{2} K^2 \frac{\partial^2C}{\partial K^2}}&#xA;$$&#xA;where $C(t_0,S_0;T,K)$ are the call prices for maturity $T$ and strike $K$.&#xA;You can also express this directly in terms of the whole implied volatility surface $\Sigma : (T,K) \mapsto \Sigma(T,K)$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you computed the function, you can evaluate at $T = t$ and $K = S$ or any other value you want.    &lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2015-06-24T18:11:42.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18505" PostTypeId="1" CreationDate="2015-06-24T20:18:29.667" Score="3" ViewCount="240" Body="&lt;p&gt;&lt;strong&gt;Background:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We want to design a compensated prepayment liability index to define an amount a bond buyer would need to receive in a redemption prior to the nominal maturity of a bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally we'd like to deliver a floating rate BBB return (with the rate reset each year) through redemption.  Said another way, at redemption the bond buyer will receive their entire principal + a return over the bond's rating through the length of time we have the bond buyer's money.  OR another way, think of a something like a high quality corporate bond that one can redeem if you deliver a higher (BBB) return (with the floating feature to hedge rate increases).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The bond's coupons float at 1 year Treasuries + something subject to CAPS and FLOORS.  The compensated prepayment liability index does not need to align with how we calculate coupons, but it might make for a simpler description of the instrument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I could find a &lt;em&gt;floating rate BBB yield curve&lt;/em&gt; (going out to perhaps 10 years) that would work or at least serve as a starting point, but I haven't found a ready example of one.  Even a fixed rate BBB yield curve would help, then I could make some kind of adjustment for it floating.    If anyone can suggest sources or Bloomberg pages I can call up for either these, that would help a lot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To model a &lt;em&gt;floating rate BBB return&lt;/em&gt; we've looked at resetting the rate each year to 1 year Treasuries + 200 bp and this might make a fair compensated prepayment if the company issuing the bond can redeem it in under 5 years.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It just doesn't look rich enough to me over longer timeframes, but my colleagues and I are divided on this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to develop a simple model, from which to derive a &lt;em&gt;floating rate BBB yield curve&lt;/em&gt; from something more basic and readily available, like the US Treasury yield curve or a Corporate Bond yield curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly, it will need factors to address the spread between BBB and treasuries or corporates and something to fairly price floating.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It might also need a kind of altered float, perhaps something like the following redemption schedule:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;1 year: 1 year treasuries + n bps&lt;/li&gt;&#xA;&lt;li&gt;2 year: 2 year treasuries + n bps&lt;/li&gt;&#xA;&lt;li&gt;3 year: ... &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Any suggestions of how to go about this, think about it, or sources to inform it much appreciated.&lt;/p&gt;&#xA;" OwnerUserId="2789" LastActivityDate="2015-06-27T02:49:45.573" Title="Model a floating rate BBB yield curve" Tags="&lt;bond-yields&gt;&lt;floating-rate&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18506" PostTypeId="1" CreationDate="2015-06-24T21:51:17.397" Score="5" ViewCount="1100" Body="&lt;p&gt;For example, if a company reports earnings today after the close (6/24), the earnings date would be 6/24 but the field I'm looking for would be 6/25. If they reported tomorrow before the open, both fields would be 6/25. If they reported this Friday 6/26 after the close, this field would be Monday 6/29.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BB obviously has this since they show day 1 price reaction (on ERN for example) but can't tell me how to get it as a single field.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(This would be for US stocks, mainly earnings and offerings.)&lt;/p&gt;&#xA;" OwnerUserId="16662" LastEditorUserId="16662" LastEditDate="2015-06-25T12:08:47.870" LastActivityDate="2015-11-22T14:44:05.287" Title="Is there a Bloomberg field for the first trading date after an event?" Tags="&lt;bloomberg&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18507" PostTypeId="2" ParentId="15773" CreationDate="2015-06-24T22:06:50.293" Score="2" Body="&lt;p&gt;Let $s_1 = r_1 -r_f$ and $s_2 =r_2-r_f$. Then, this is the maximization problem:&#xA;\begin{align*}&#xA;&amp;amp; \ \max_{w_1, w_2} SR = \frac{\mu_p}{\sigma_p}, \, \mbox{ subject to}\\&#xA;\mu_p = &amp;amp; \ w_1 s_1 + w_2 s_2,\\&#xA;\sigma_p^2 = &amp;amp; \ \sigma^2\big(w_1^2 + w_2^2 + 2 w_1 w_2 \rho\big),\\&#xA;1 = &amp;amp; \ w_1+w_2.&#xA;\end{align*}&#xA;By certain substitution, we convert the problem to the following&#xA;\begin{align*}&#xA;\max_{w_1} \frac{w_1(s_1-s_2)+s_2}{\sqrt{w_1^2 + (1-w_1)^2+2 w_1(1-w_1)\rho}} = \max_{w_1} \frac{w_1(s_1-s_2)+s_2}{\sqrt{2\big(w_1-w_1^2\big)(\rho-1) +1}}.&#xA;\end{align*}&#xA;From the first order condition,&#xA;\begin{align*}&#xA;(s_1-s_2)\big[2(w_1-w_1^2)(\rho-1)+1\big] -\big[w_1(s_1-s_2) + s_2\big](1-2w_1)(\rho-1)=0,&#xA;\end{align*}&#xA;we obtain that&#xA;\begin{align*}&#xA;(s_1-s_2) + w_1 (s_1-s_2) (\rho-1) - s_2(1-2w_1)(\rho-1)=0,&#xA;\end{align*}&#xA;and, consequently,&#xA;\begin{align*}&#xA;w_1 &amp;amp;= \frac{s_1-\rho s_2}{(s_1+s_2)(1-\rho)},\\&#xA;w_2 &amp;amp;= 1- w_1.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-06-25T13:13:10.647" LastActivityDate="2015-06-25T13:13:10.647" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18508" PostTypeId="1" CreationDate="2015-06-24T23:27:54.390" Score="3" ViewCount="130" Body="&lt;p&gt;There are uncountably many factor models to estimate stock returns, such as CAPM, Fama-French, Carhart-Momentum, APT etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which models can estimate the market (index) return?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found only three models: &lt;a href=&quot;http://www.econ.nyu.edu/user/ludvigsons/eqprem1.pdf&quot; rel=&quot;nofollow&quot;&gt;Cay&lt;/a&gt;, &lt;a href=&quot;https://www0.gsb.columbia.edu/faculty/gbekaert/stockreturn.pdf&quot; rel=&quot;nofollow&quot;&gt;Dividends&lt;/a&gt; and &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S0304405X10000437&quot; rel=&quot;nofollow&quot;&gt;Average Correlation&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2015-10-09T09:54:45.693" LastActivityDate="2015-10-09T09:54:45.693" Title="Estimate market risk premium?" Tags="&lt;market-data&gt;&lt;factor-models&gt;&lt;market&gt;&lt;stylized-facts&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18509" PostTypeId="2" ParentId="675" CreationDate="2015-06-25T06:02:33.543" Score="1" Body="&lt;p&gt;I just pushed Python implementations of some common portfolio optimizers to &lt;a href=&quot;https://github.com/czielinski/portfolioopt&quot; rel=&quot;nofollow&quot;&gt;my GitHub&lt;/a&gt;. It uses the &lt;code&gt;CVXOPT&lt;/code&gt; library to solve the resulting quadratic programs. It supports the construction of Markowitz portfolios, minimum variance portfolios and tangency portfolios (both long-only or long/short).&lt;/p&gt;&#xA;" OwnerUserId="16663" LastActivityDate="2015-06-25T06:02:33.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18510" PostTypeId="2" ParentId="18443" CreationDate="2015-06-25T06:58:12.037" Score="1" Body="&lt;p&gt;You know that Brownian motion {W(t)} is a stochastic process with the following properties:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;(Independence of increments) W(t) − W(s) , for  t &gt; s , is independent of&#xA;the past, that is, of W(u) , 0 ≤ u ≤ s, or of $F_s$ , the σ-field generated by&#xA;W(u), u ≤ s.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;(Normal increments) W(t) − W(s) has Normal distribution with mean 0&#xA;and variance t − s. This implies (taking s = 0) that W(t) − W(0) has&#xA;N(0, t) distribution.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;(Continuity of paths) W(t), t ≥ 0 are continuous functions of t.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Let ${{x}_{t}}=\ln ({{S}_{t}})$ . The Itˆo formula gives us &#xA;\begin{align}&#xA;  &amp;amp; d{{x}_{t}}=(\mu -\frac{1}{2}\sigma ^{2})dt+{{\sigma }}d{W}(t) \\&#xA;\end{align}&#xA;Then&#xA;\begin{align}&#xA;  &amp;amp; {x}_{t}={x}_{0}+(\mu -\frac{1}{2}\sigma^{2})t+{{\sigma }_{t}}{W}(t) \\&#xA;\end{align}&#xA;As we said W(t) has Normal distribution with mean 0 and variance t then $x_t$ is normal process&#xA;such that the expected value is given by&#xA;\begin{align}&#xA;  &amp;amp; E[{x}_{t}]=E[{x}_{0}+(\mu -\frac{1}{2}\sigma^{2})t]+E[\sigma{W}(t)]={x}_{0}+(\mu -\frac{1}{2}\sigma ^{2})t\\&#xA;\end{align}&#xA;and&#xA;\begin{align}&#xA;  &amp;amp; Var[{x}_{t}]=Var[{{\sigma }_{t}}{W}(t)]=\frac{1}{2}\sigma ^{2}t\\&#xA;\end{align}&#xA;And your other question.fix t and let&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;&amp;amp; A_\omega =\{\omega|S_t,\omega&amp;gt;K\}=\{\omega|\ln S_t,\omega&amp;gt;\ln K\}\,\, (Almost\,Surely)&#xA;\end{align}&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2015-06-25T07:22:01.643" LastActivityDate="2015-06-25T07:22:01.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18511" PostTypeId="1" CreationDate="2015-06-25T08:30:34.547" Score="4" ViewCount="1750" Body="&lt;p&gt;Is it possible to estimate the optimal look back period for OLS from which we test if residuals are stationary? Almost all papers that I read use random look back periods of 100 days, 252 days, 500 days etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think this procedure introduces data snooping bias. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only &quot;quantitative&quot; method that I've found so far is calculation &lt;a href=&quot;https://mathtopics.wordpress.com/2013/01/07/ornstein-uhlenbeck-process/&quot; rel=&quot;nofollow&quot;&gt;half-life&lt;/a&gt; of mean reversion and using it as a look back period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can somebody suggest a methodology or a procedure to select the optimal length of a look back period which can be used to test if a pair of stocks is co-integrated? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help will be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="17921" LastEditorUserId="2553" LastEditDate="2015-06-25T11:11:50.077" LastActivityDate="2015-06-26T14:43:02.587" Title="How to select optimal look back period for statistical arbitrage?" Tags="&lt;cointegration&gt;&lt;pairs-trading&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18512" PostTypeId="2" ParentId="18506" CreationDate="2015-06-25T08:54:24.883" Score="1" Body="&lt;p&gt;HELP HELP can probably help you on this. But as far as I know there isn't a field that has this information. You can probably calculate it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could retrieve the content of the &lt;code&gt;EARN_ANN_DT_TIME_HIST_WITH_EPS&lt;/code&gt; field - it contains dates and times of earning releases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively you could use the &lt;code&gt;EXPECTED_REPORT_TIME&lt;/code&gt; which has a &lt;code&gt;EQY_FUND_RELATIVE_PERIOD&lt;/code&gt; override if you need past data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then compare the times with the trading hours for the stock.&lt;/p&gt;&#xA;" OwnerUserId="2393" LastActivityDate="2015-06-25T08:54:24.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18514" PostTypeId="2" ParentId="18508" CreationDate="2015-06-25T12:41:29.683" Score="3" Body="&lt;p&gt;Yes, those are probably the variables that predict the better the stock market return. However, the OOS evidence is usually weak. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Goyal &amp;amp; Welch provide a good summary on predictors: &lt;a href=&quot;http://rfs.oxfordjournals.org/content/21/4/1455.abstract&quot; rel=&quot;nofollow&quot;&gt;http://rfs.oxfordjournals.org/content/21/4/1455.abstract&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-06-25T12:41:29.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18515" PostTypeId="1" CreationDate="2015-06-25T12:41:36.333" Score="3" ViewCount="156" Body="&lt;p&gt;The PDE for the American put option price $P(S,\sigma ,r,t)$ is&#xA;\begin{align*}&#xA; 0 =&amp;amp; P_t+P_SS(r-\delta)+P_\sigma a(\sigma)+P_r\alpha (r,t) \\&#xA;   +&amp;amp; \frac{1}{2}P_{SS}S^2\sigma ^2 + \frac{1}{2}P_{\sigma \sigma}b^2(\sigma)+\frac{1}{2}P_{rr}\beta^2(r) \\&#xA;   +&amp;amp; P_{S\sigma}\sigma Sb(\sigma)\rho _{12}+P_{Sr}\sigma S\beta(\sigma)\rho _{13}+P_{\sigma r}\beta(\sigma)b(\sigma)\rho _{23}-rP&#xA;\end{align*}&#xA;that was extracted from stochastic system &#xA;\begin{align*}&#xA;dS_t &amp;amp;= (r_t-\delta)S_tdt+\sigma _tS_tdW_t^{(1)} \\&#xA;d\sigma _t &amp;amp;=a(\sigma _t)dt+b(\sigma _t)dW^{(2)}_t\\&#xA;dr_t &amp;amp;= \alpha(r_t,t)dt+\beta (r_t)dW_t^{(3)}&#xA;\end{align*} &#xA;such that &#xA;$$ dW^{(i)}_tdW^{(j)}_t=\rho_{ij}dt $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found this boundary conditions &#xA;\begin{align}&#xA;  &amp;amp; P(\infty ,\sigma ,r,t)=0 \\ &#xA; &amp;amp; P(S,\sigma ,r,T)=\max (K-S,0) \\ &#xA; &amp;amp; P(\bar{S}(T-t),\sigma ,r\,,t\,)=\max (K-\bar{S}(T-t)\,,\,0\,) \\ &#xA; &amp;amp; {{P}_{S}}(\bar{S}(T-t),\sigma ,r\,,t)=-1 \\ &#xA;\end{align}&#xA;Here, $\bar S(T-t)$ is the early exercise price, which  depends on the option time-to-maturity $\tau =T-t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Now How can I find others boundary conditions ?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="13370" LastActivityDate="2015-06-26T10:32:22.363" Title="Boundary conditions of PDE from SV model with stochastic interest rate" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;american-options&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18516" PostTypeId="2" ParentId="17605" CreationDate="2015-06-25T14:07:58.263" Score="2" Body="&lt;p&gt;There are different methodologies to detect a change in the market efficiency, both in the market and firm-specific cases.&lt;/p&gt;&#xA;&lt;p&gt;In the &lt;strong&gt;FIRM-SPECIFIC case&lt;/strong&gt;, the most common procedure is the event study methodology; you can find how to construct an event-study case explained in Kothari &amp;amp; Warner (2006), who collected all the event study methodology implemented till 2006 in the academic literature; below, you can find the paper reference and relative link:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.bu.edu/econ/files/2011/01/KothariWarner2.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Kothari, S. P., and Jerold B. Warner. &amp;quot;The econometrics of event studies.&amp;quot;   &amp;gt; Available at SSRN 608601 (2004).&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;In the &lt;strong&gt;BROAD MARKET case&lt;/strong&gt;, there exist different measures/proxy for the market efficiency exploited in the academic literature to test and measure the effects of the change in market efficiency on the markets.&lt;/p&gt;&#xA;&lt;p&gt;Below, you can find a list of the proxies developed in the academic literature to test/measure the level of market efficiency and the relative references in chronological order.&lt;/p&gt;&#xA;&lt;p&gt;As regards the &lt;strong&gt;review&lt;/strong&gt; about market efficiency test and measuring:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.e-m-h.org/BoHo92.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bollerslev, Tim, and Robert J. Hodrick. Financial market efficiency tests. No. w4108. National bureau of economic research, 1992.&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Lim, Kian‐Ping, and Robert Brooks. &amp;quot;The evolution of stock market&#xA;efficiency over time: a survey of the empirical literature.&amp;quot; Journal&#xA;of Economic Surveys 25.1 (2011): 69-108.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;As regards the market efficiency &lt;strong&gt;test&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;ARMA() Model test&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.business.unr.edu/faculty/liuc/files/RUC/topic_tradingmechanism/Amihud_Mendelson_1987.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Amihud, Yakov, and Haim Mendelson. &amp;quot;Trading mechanisms and stock returns: An empirical investigation.&amp;quot; The Journal of Finance 42.3 (1987): 533-553.&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;Variance Ratio Test/MEC()&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.econ.sdu.edu.cn/jrtzx/uploadfile/pdf/empiricalfinance/20.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Lo, Andrew W., and A. Craig MacKinlay. &amp;quot;Stock market prices do not follow &amp;gt; random walks: Evidence from a simple specification test.&amp;quot; Review of financial &amp;gt; studies 1.1 (1988): 41-66.&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;Hurst Exponent Over-Time&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Peters, Edgar E. Fractal market analysis: applying chaos theory to&#xA;investment and economics. Vol. 24. John Wiley &amp;amp; Sons, 1994.&#xA;Cajueiro, Daniel O., and Benjamin M. Tabak. &amp;quot;The Hurst exponent over&#xA;time: testing the assertion that emerging markets are becoming more&#xA;efficient.&amp;quot; Physica A: Statistical Mechanics and its Applications&#xA;336.3 (2004): 521-537.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;As regards the market efficiency &lt;strong&gt;measures&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;Approximate Entropy&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&quot;http://arxiv.org/pdf/1307.3060.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Pincus, Steven M. &amp;quot;Approximate entropy as a measure of system complexity.&amp;quot; Proceedings of the National Academy of Sciences 88.6 (1991): 2297-2301.&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Look at &lt;a href=&quot;http://www.tandfonline.com/doi/abs/10.1080/03610929208830963&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; to know more about the statistical properties of the approximate entropy measure.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;Efficiency Index&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;L. Kristoufek and M. Vosvrda. Measuring capital market efficiency:&#xA;Global and local correlations structure. Physica A, 392:184–193, 2013.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;Market Model &lt;span class=&quot;math-container&quot;&gt;$R^2$&lt;/span&gt;&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&quot;http://siba-ese.unile.it/index.php/ejasa/article/viewFile/12385/11416&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bramante, Riccardo, Diego Zappa, and Giovanni Petrella. &amp;quot;On the interpretation and estimation of the market model R-square.&amp;quot; Electronic Journal of Applied Statistical Analysis 6.1 (2013): 57-66.&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;THIS ANSWER WILL BE UPDATED; ANY HINT, ADVISES OR IDEA WILL BE APPRECIATED&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2015-07-08T18:56:30.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18517" PostTypeId="2" ParentId="8273" CreationDate="2015-06-25T16:11:28.433" Score="3" Body="&lt;p&gt;The first principle component of interest rates will not help you capture the term structure better at all. It will basically remove all term structure affects you are going to see. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When we decompose the returns on interest rates you are going to get 3 PC's which explain 99.9% of the variance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;PC1 - Level of the interest rates (~90% of variance)&#xA;PC2 - Slope of the interest rates (~8% of variance)&#xA;PC3 - Curvature of the interest rates (~2% of variance)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Forecasting volatility for options pricing is difficult and I don't think PCA is going to be your one stop shop for a good estimate.&lt;/p&gt;&#xA;" OwnerUserId="5940" LastActivityDate="2015-06-25T16:11:28.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18518" PostTypeId="2" ParentId="18511" CreationDate="2015-06-25T18:11:35.047" Score="1" Body="&lt;p&gt;I think there is no quantitative method, but one can use some common sense based on how long one is willing to hold the position. For instance, if you don't want to hold a position in oil futures for more than a month, using a 10-year window is of no use even if the annual oil price is stationary. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, the trader probably tests a few windows whose size is proportional to the reasonable holding period and picks the one that works best. As always, data snooping is offset by testing the strategy out-of-sample.&lt;/p&gt;&#xA;" OwnerUserId="12031" LastEditorUserId="12031" LastEditDate="2015-06-26T14:43:02.587" LastActivityDate="2015-06-26T14:43:02.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18519" PostTypeId="2" ParentId="18515" CreationDate="2015-06-25T18:20:02.280" Score="1" Body="&lt;p&gt;When $\sigma=0$ , the boundary condition is little more complicated:&#xA;\begin{align}&#xA;P_t+(r-\delta)SP_S +\alpha P_r +\beta^2\frac{1}{2} P_{rr}-rP=0&#xA;\end{align}&#xA;When $\sigma\rightarrow\infty$ , we have&#xA;\begin{align}&#xA;P(S,\infty,r,t)=0&#xA;\end{align}&#xA;When $r=0$ , then&#xA;\begin{align}&#xA;P_t+aP_\sigma+\frac{1}{2}b^2P_{\sigma\sigma}+\sigma S b \rho_{12}P_{S\sigma}=0&#xA;\end{align}&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2015-06-26T10:32:22.363" LastActivityDate="2015-06-26T10:32:22.363" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18520" PostTypeId="2" ParentId="18400" CreationDate="2015-06-25T19:57:06.170" Score="6" Body="&lt;p&gt;The Heston model is represented by the bivariate system of stochastic differential equations (SDE)&#xA;\begin{align}&#xA;  &amp;amp; d{{S}_{t}}=rS_tdt+{\sqrt\upsilon_t} d{{W}_{1}}(t) \\&#xA; &amp;amp; d{{\upsilon}_{t}}=\kappa(\theta-\upsilon_t) dt+\sigma{\sqrt\upsilon_t}d{{W}_{2}}(t) \\&#xA;\end{align}&#xA;The most popular way to estimate the parameters of the Heston model is with loss&#xA;functions. This method uses the error between quoted market prices and model&#xA;prices, or between market and model implied volatilities. The parameter estimates&#xA;$\hat\Theta=(\hat\kappa, \hat\theta,\hat\sigma,\hat\upsilon_o,\hat\rho)$ are those values which minimize the value of the loss function, so that the model prices or implied volatilities are as close as possible to their market counterparts.&#xA;A constrained minimization algorithm must be used in this regard so that the&#xA;constraints on the parameters&#xA;\begin{align}&#xA;\kappa&amp;gt;0\ ,\ \theta&amp;gt;0\ , \ \sigma&amp;gt;0 \, \ ,\upsilon_0&amp;gt;0  \, \ , \,\rho\in[-1,1] &#xA;\end{align}&#xA;are respected. Since loss functions use market option prices (or implied volatility&#xA;derived from those prices) as inputs, they produce estimates of the risk-neutral&#xA;parameters of the Heston model.Suppose we have a set of $N_T $ maturities $\tau_i$($ i=1,2,...,N_T)$ and set $N_K$ strikes $K_k$ ($k=1,2,...,N_k$).For each maturity For each maturity-strike combination $(\tau_t,\ K_k)$ we have market price $P(\tau_t , K_k)$ and a corresponding model price $P(\tau_t , K_k;\Theta)=P_{t,k}^{\Theta}$ generated&#xA;by the Heston model. Attached to each option is an optional weight $w_{t,k}$ . There are&#xA;many possible ways to define a loss function, but they usually fall into one of two&#xA;categories: those based on prices, and those based on implied volatilities.&#xA;The first category of loss functions are those that minimize the error between&#xA;quoted and model prices. The error is usually defined as the squared difference&#xA;between the quoted and model prices, or the absolute value of the difference; relative&#xA;errors can also be used. For example, parameter estimates obtained using the mean&#xA;error sum of squares (MSE) loss function are obtained by minimizing&#xA;\begin{align}&#xA;\frac{1}{N}\sum_{t,k}w_{t,k}(P_{t,k}-P_{t,k}^{\Theta})^2 &#xA;\end{align}&#xA;with respect to $\Theta$ where $N$ is the number of quotes. The relative mean error sum of&#xA;squares (RMSE) parameter estimates are obtained with the loss function&#xA;\begin{align}&#xA;\frac{1}{N}\sum_{t,k}w_{t,k}\frac{(P_{t,k}-P_{t,k}^{\Theta})^2}{P_{t,k}} &#xA;\end{align}&#xA;The second category of loss functions are those that minimize the error between&#xA;quoted and model implied volatilities. Again, the error is usually defined as the&#xA;squared difference, absolute difference, or relative difference, between quoted and&#xA;model implied volatilities. This category of loss function is sensible, since options&#xA;are often quoted in terms of implied volatility, and since the fit of model is often&#xA;assessed by comparing quoted and model implied volatilities. Hence, for example,&#xA;the implied volatility mean error sum of squares (IVMSE) parameter estimates are&#xA;based on the loss function&#xA;\begin{align}&#xA;\frac{1}{N}\sum_{t,k}w_{t,k}(IV_{t,k}-IV_{t,k}^{\Theta})^2 &#xA;\end{align}&#xA;where $IV_{t,k}$ and $IV_{t,k}^\Theta$ are are the quoted and model implied&#xA;volatilities, respectively. The relative and absolute versions can also be used.Estimation of the Heston model parameters by loss functions has been used by&#xA;Bakshi, Cao, and Chen (1997), Bams et al. (2009), Christoffersen and Jacobs (2004),&#xA;Mikhailov and No¨ gel, (2003), and many others. There is no consensus on which&#xA;loss function is the best one, but Christoffersen and Jacobs (2004) point out that&#xA;the same loss function should be used for parameter estimation and for evaluating&#xA;model fit.&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2015-06-25T20:57:41.630" LastActivityDate="2015-06-25T20:57:41.630" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="18521" PostTypeId="1" CreationDate="2015-06-25T21:29:48.653" Score="7" ViewCount="2057" Body="&lt;p&gt;When doing Sharpe optimization &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\max_x \frac{\mu^T x}{\sqrt{x^T Q x}}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;there is a common trick (&lt;a href=&quot;http://www.ie.bilkent.edu.tr/~mustafap/courses/OIF.pdf&quot;&gt;section 5.2&lt;/a&gt;) used to put the problem in convex form.  You add a variable $\kappa$ such that $x = y/\kappa$ choose $\kappa$ s.t. $\mu^T y=1$.  Changing the problem to the simple convex problem&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\min_{y,\kappa} y^T Q y \; \text{where} \; \mu^T y = 1, \kappa &amp;gt; 0&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is easy to solve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, my problem also has a second-order constraint that becomes non-convex in $(y,\kappa)$&#xA;$$&#xA;x^T P x \leq \sigma^2 \implies y^T P y \leq \kappa^2 \sigma^2&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a trick to keep this problem convex and allow the use of second-order cone programming algorithms?&lt;/p&gt;&#xA;" OwnerUserId="5689" LastActivityDate="2015-07-28T20:56:09.650" Title="Sharpe Maximization under Quadratic Constraints" Tags="&lt;optimization&gt;&lt;portfolio-optimization&gt;&lt;convexity&gt;&lt;markowitz&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18522" PostTypeId="2" ParentId="18511" CreationDate="2015-06-25T21:58:16.277" Score="1" Body="&lt;p&gt;Yes, you're right.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Choosing a fixed lookback period allows you to find more couple of candidates to implement a statistical arbitrages, but it is misleading, in the sense that, looking back, it leads you in finding the period in which a couple of assets are cointegrated and not a couple of assets are really cointegrated; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, what could be the solution to this problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Test (and, after, backtest) for different periods; if the results are too different, the cointegration relationship is not robust and, so, the candidated couple of assets is not good&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my humble opinion, it is interesting to follow E. Chan's &lt;a href=&quot;http://epchan.blogspot.it/&quot; rel=&quot;nofollow&quot;&gt;blog&lt;/a&gt;, who deals with the statistical arbitrage topic pretty often; his books are pretty interesting too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As regards the &lt;strong&gt;half-life&lt;/strong&gt;, it corresponds to how long (approximately) on average you should expect to hold the spread you're investing in, before it becomes profitable and it is not the optimal length of the lookback period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-06-25T21:58:16.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18524" PostTypeId="1" CreationDate="2015-06-26T08:46:11.267" Score="1" ViewCount="72" Body="&lt;p&gt;Good morning,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to compute a 2-day forward exchange rate on EURUSD. For that, I have historical data on EURUSD spot price, and I know that theoretically, when maturity is T we have :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$F_0$ $=$ $S_0$*$exp^{(r-r_f)T}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $F_0$ is the forward exchange rate, $S_0$ is the spot rate,$r$ is the risk-free rate of the base currency, $r_f$ the risk-free rate of the foreign currency and T the maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that I'm not sure what to choose to get values for $r$ and $r_f$ (there are many kinds of interest rates on the Fed's website, many kinds of EURIBOR depending on maturity, ...)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks for your help.&lt;/p&gt;&#xA;" OwnerUserId="16675" LastEditorUserId="2553" LastEditDate="2015-06-26T09:06:29.233" LastActivityDate="2015-06-26T09:06:29.233" Title="How should I use central banks rates in order to compute 2-day forward exchange rate on EURUSD" Tags="&lt;forward&gt;&lt;currency&gt;&lt;forward-rate&gt;&lt;spot-rate&gt;&lt;risk-free&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18525" PostTypeId="2" ParentId="18346" CreationDate="2015-06-26T14:53:07.467" Score="1" Body="&lt;p&gt;$i,ii,iii)$ Define $x_t$ by $x_t=(S_t^1)^2$. Ito's formula give us&#xA;\begin{align}&#xA;&amp;amp; dx_t=d(S_t^1)^2=2S_t^1dS_t+\frac{1}{2}(2)d[S_t^1,S_t^1](t)\\&#xA;&amp;amp; dx_t=d(S_t^1)^2=2S_t^1(\frac{1}{S_t^1}+dW_t)+dW_tdW_t=3dt+2S_t^1dW_t\\&#xA;\end{align}&#xA;then&#xA;\begin{align}&#xA;&amp;amp; dx_t=3\ dt+2\sqrt x_t\  dW_t\\&#xA;\end{align}&#xA;The following portfolio is constructed:&#xA;we buy a bond of dollar value $V_1$ with maturity $T_1$ and sell another bond of dollar value $V_2$ with maturity $T_2$. The portfolio value $\Pi$ is given by&#xA;\begin{align}&#xA;\Pi=V_1-V_2&#xA;\end{align}&#xA;where the $t$ subscripts are omitted for convenience. Assuming the portfolio is&#xA;self-financing, the change in portfolio value is&#xA;\begin{align}&#xA;d\,\Pi=dV_1-dV_2&#xA;\end{align}&#xA;The strategy is similar to that for the Black-Scholes case. I apply Ito’s lemma to obtain the processes for $V_1$ , which allows us to find the process for $\Pi$ .To form the hedging portfolio, first apply Ito’s lemma to the value of the derivative,$V_1=V_1(x_t,t)$ We must differentiate $V_1$ with respect to the variables $t$ and $x$,The result is that $dV_1$ follows the process&#xA;\begin{align}&#xA;dV_1=\frac{\partial V_1}{\partial t}dt+\frac{\partial V_1}{\partial x}dx+\frac{1}{2}\frac{\partial^2 V_1}{\partial x^2}d[x,x](t)&#xA;\end{align}&#xA;in other words&#xA;\begin{align}&#xA;dV_1=(\frac{\partial V_1}{\partial t}+3\frac{\partial V_1}{\partial x}+2x_t\frac{\partial^2 V_1}{\partial x^2})dt+2\sqrt x_t \frac{\partial V_1}{\partial x}dW_t&#xA;\end{align}&#xA;I have use the fact that $d[x,x](t)=(2\sqrt x_t\  dW_t)(2\sqrt x_t\  dW_t)=4x_t dt$ , $dt\,dW_t=0$  and $dt\,dt=0$. Then portfolio value can be written&#xA;\begin{align}&#xA;&amp;amp;d\,\Pi=(\frac{\partial V_1}{\partial t}+3\frac{\partial V_1}{\partial x}+2x_t\frac{\partial^2 V_1}{\partial x^2})dt+2\sqrt x_t \frac{\partial V_1}{\partial x}dW_t\\&#xA;&amp;amp;\,\,\,\,\,\,\,\,\,\,-(\frac{\partial V_2}{\partial t}+3\frac{\partial V_2}{\partial x}+2x_t\frac{\partial^2 V_2}{\partial x^2})dt-2\sqrt x_t \frac{\partial V_2}{\partial x}dW_t\\&#xA;\end{align} &#xA;In order for the portfolio to be hedged against movements Wiener process last two terms in this equation must be zero. This implies that the hedge parameters must be&#xA;\begin{align}&#xA;\frac{\partial V_1}{\partial x}=\frac{\partial V_2}{\partial x}&#xA;\end{align}&#xA;then&#xA;\begin{align}&#xA;&amp;amp;d\,\Pi=(\frac{\partial V_1}{\partial t}+2x_t\frac{\partial^2 V_1}{\partial x^2})dt\\&#xA;&amp;amp;\,\,\,\,\,\,\,\,\,\,-(\frac{\partial V_2}{\partial t}+2x_t\frac{\partial^2 V_2}{\partial x^2})dt\\&#xA;\end{align}&#xA;The condition that the portfolio earn the risk-free rate, $S^0=1$, implies that the change in portfolio value is $d\,\Pi=S^0\,\Pi dt$&#xA;\begin{align}&#xA;d\,\Pi=S^0\,\Pi\,dt=\Pi\,dt=(V_1-V_2)dt&#xA;\end{align}&#xA;By combination these equations we have&#xA;\begin{align}&#xA;\frac{\partial V_1}{\partial t}+2x_t\frac{\partial^2 V_1}{\partial x^2}-V_1=\frac{\partial V_2}{\partial t}+2x_t\frac{\partial^2 V_2}{\partial x^2}-V2&#xA;\end{align}&#xA;The above relation is valid for arbitrary maturity dates $T_1$ and $T_2$, so this equation should be independent of maturity  $T$.Then&#xA;\begin{align}&#xA;\frac{\partial V}{\partial t}+2x_t\frac{\partial^2 V}{\partial x^2}-V=\lambda&#xA;\end{align}&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2015-06-26T15:07:46.090" LastActivityDate="2015-06-26T15:07:46.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18526" PostTypeId="2" ParentId="18400" CreationDate="2015-06-26T18:51:47.943" Score="7" Body="&lt;p&gt;The typical approach is: you only use option data from the last day. Furthermore, you only include those points that are liquid enough. One approach to this is to weigh the modelling error of an option by its bid-ask spread and vega.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using data from multiple days is not a good approach, because you might have options with the same strike but different prices. The calibration might then get stuck at a point where neither market price is recovered by the calibrated model. Furthermore, there is no guarantee that option data taken over multiple days can form an arbitrage-free surface.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For liquid options the most recent data is enough, provided you don't just have at-the-money strikes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is not common for institutes to look at the uncertainty on the calibrated model parameters, but this is definitely a good thing to do. It might be difficult and time-consuming to implement a Bayesian-like optimization scheme though, which is why it is usually not done. It is more important to look at the effect of &quot;what happens if I bump the volatility surface by 1%&quot;, or what happens if the interest rate shifts up or down by 10 bp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, the loss function usually has many local minima, and small changes in the option prices might put the global minimum in a completely different region in the parameter space. Put differently: smooth deformations of the market option prices can induce very discontinuous behaviour in the calibration parameters. As a result model parameters can jump on a day-to-day basis, even though the implied volatility surface hasn't change that much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more complicated models, that involve multiple underlying (e.g. interest rates and stocks: a Hull-White Heston model) it really becomes an art to properly calibrate the model. You often see that parameters like correlation are replaced by historical estimates instead, and the range of other parameters are severely restricted, simply because you might have a global minimum in a region with very unlikely parameters. It takes quite a bit of experience to figure out what instruments you should include in the calibration procedure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also this work by Homescu:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://arxiv.org/abs/1107.1834&quot; rel=&quot;noreferrer&quot;&gt;http://arxiv.org/abs/1107.1834&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3371" LastActivityDate="2015-06-26T18:51:47.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18527" PostTypeId="1" AcceptedAnswerId="18533" CreationDate="2015-06-27T00:37:52.593" Score="7" ViewCount="1398" Body="&lt;p&gt;Say I have found a way through technical analysis to predict how stocks would behave with 58% accuracy, how good is this percentage?&lt;/p&gt;&#xA;" OwnerUserId="16682" LastActivityDate="2015-07-19T21:54:04.827" Title="If I have found a way to predict stocks trend with 58% accuracy, is it good?" Tags="&lt;equities&gt;&lt;trading&gt;&lt;exchange&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18528" PostTypeId="2" ParentId="18527" CreationDate="2015-06-27T03:59:27.590" Score="2" Body="&lt;p&gt;Directional forecast is insufficient. You could have a signal that has 100% accuracy and you would not necessarily be able to profit from it because of transaction cost, implementation etc.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2015-06-27T03:59:27.590" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18529" PostTypeId="2" ParentId="74" CreationDate="2015-06-27T04:48:43.317" Score="1" Body="&lt;p&gt;QuantyCarlo (quantycarlo.com) is a workbench for evaluation and optimization of option trading systems.  It comes in several flavors, the most basic of which allows automated options backtesting.  A free version is available with a limited number of end of day symbols.  Other subscription plans offer more symbols and intraday data.  QuantyCarlo Enterprise Edition exposes two programming APIs, offers Factorial Analysis, Applied Predictive Modeling (see &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1461468485&quot; rel=&quot;nofollow&quot;&gt;http://www.amazon.com/Applied-Predictive-Modeling-Max-Kuhn/dp/1461468485&lt;/a&gt;), and cluster computing to efficiently generate the optimal parameters for a given strategy.  This is also offered as a service to financial institutions by IOTA Technologies (www.iotatx.com), the maker of QuantyCarlo.&lt;/p&gt;&#xA;" OwnerUserId="16687" LastActivityDate="2015-06-27T04:48:43.317" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18531" PostTypeId="2" ParentId="18527" CreationDate="2015-06-27T08:43:26.430" Score="3" Body="&lt;p&gt;It's not unusual to find a financial time series with positive trend samples biased between 55-60%, depending on the period sampled.  Stocks tend to have an upward drift over the long run. When you account for the drift, I would say, that number is really not much better than chance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A better way to verify your question would be to make certain to build your estimates and models (with parameter optimization) on a certain portion of the sample and comparing out of sample results of your model's performance to the actual performance of the stock series under the same out of sample time frames. Using a rolling window is commonly used.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And also, make sure to look at the actual expectation or performance of the actual returns over the comparison period, as simple directional signs can be close to meaningless without values for context.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Incidentally,this &lt;a href=&quot;http://www.jonathankinlay.com/Articles/ONE%20MILLION%20MODELS.pdf&quot; rel=&quot;nofollow&quot;&gt;researcher&lt;/a&gt; tested 1 million machine learning models using data from 93 - 2008 to predict SPY ETF direction and acheived an astounding 78% in sample performance. When the trained model was tested over the next two years out of sample data, it dropped all the way to 50%... not so remarkable, and a good example of why its really important to consider validating data over different periods.&lt;/p&gt;&#xA;" OwnerUserId="3040" LastEditorUserId="3040" LastEditDate="2015-06-28T09:47:24.047" LastActivityDate="2015-06-28T09:47:24.047" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18532" PostTypeId="1" CreationDate="2015-06-27T08:59:56.800" Score="1" ViewCount="41" Body="&lt;p&gt;Lets assume a FIFO rules in futures, I buy a contract and id like to sell it. Should I estimate the possibilite of orders on opposite side would be filled first? If I watch new orders incoming at new discovery price in the session could I be sure that the market will have to go now in my direction?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tx&lt;/p&gt;&#xA;" OwnerUserId="16690" LastActivityDate="2015-06-27T08:59:56.800" Title="order routing for a fill" Tags="&lt;futures&gt;&lt;algorithmic-trading&gt;&lt;algorithm&gt;&lt;order&gt;" AnswerCount="0" CommentCount="0" ClosedDate="2015-07-06T07:03:20.307" ContentLicense="CC BY-SA 3.0" />
  <row Id="18533" PostTypeId="2" ParentId="18527" CreationDate="2015-06-27T09:12:02.160" Score="4" Body="&lt;p&gt;In the long term you will underperform buy &amp;amp; hold because you need an accuracy of at least 65%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See these papers for more:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Bauer, R.; Dahlquist, J.: „Market Timing and Roulette Wheels Revisited“, CFA Institute, 2012.&lt;br&gt;&#xA;&lt;a href=&quot;http://www.cfapubs.org/doi/pdf/10.2469/irpn.v2012.n1.10&quot; rel=&quot;nofollow&quot;&gt;http://www.cfapubs.org/doi/pdf/10.2469/irpn.v2012.n1.10&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Sharpe, W.: “Likely Gains from Market Timing”, Financial Analysts Journal, March/April 1975.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="12" LastActivityDate="2015-06-27T09:12:02.160" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18534" PostTypeId="2" ParentId="18474" CreationDate="2015-06-27T10:18:21.687" Score="1" Body="&lt;p&gt;There are many books about revenue analytic and management:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://books.google.com/books?isbn=0124166989&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;1.Segmentation, Revenue Management and Pricing Analytic(2014).&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://books.google.com/books?isbn=0307788989&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;2.Revenue Management(2011)&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://books.google.com/books?id=issiAQAAMAAJ&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;3.Revenue vs. needs : an analytical approach&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://books.google.com/books?isbn=0124166989&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;4.Freemium Economics: Leveraging Analytics and User Segmentation to Drive    Revenue(2013)&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://books.google.com/books?isbn=1481900307&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;5.Marketing Analytics: Strategic Models and Metrics(2013)&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorUserId="13370" LastEditDate="2015-06-27T14:04:32.023" LastActivityDate="2015-06-27T14:04:32.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18535" PostTypeId="1" CreationDate="2015-06-27T11:44:49.933" Score="1" ViewCount="104" Body="&lt;p&gt;ESOs are typically priced using the black-scholes model, but with an additional parameter for for the employee turnover rates . An example  &lt;a href=&quot;http://www.investopedia.com/university/employee-stock-options-eso/eso3.asp&quot; rel=&quot;nofollow&quot;&gt;http://www.investopedia.com/university/employee-stock-options-eso/eso3.asp&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume that employee turnover rate can be modeled as a dividend-like parameter on the original black-scholes equation, which makes calls cheaper. But what about the distribution of stock returns? What if 90% of companies with a market cap of less than $200 million (or some size) lose 90% of their market-cap within a decade, and that the expected return is less than than the broader market? (meaning a few winners and lots and lots of losers) Given the high failure rate of small businesses, employee stock options maybe vastly overvalued  &lt;/p&gt;&#xA;" OwnerUserId="15081" LastActivityDate="2015-08-27T17:59:41.617" Title="Pricing employee stock options" Tags="&lt;option-pricing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18536" PostTypeId="2" ParentId="18527" CreationDate="2015-06-27T13:34:05.570" Score="4" Body="&lt;p&gt;It's not bad but you have to backtest the method out-of-sample.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say you have discovered an indicator that works 100% in history, you still cannot be sure if it works next time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another advise is you might want to investigate the distribution of loss when your system fails to work. If your system delivers 1% every time you trade, and loses 10% each time it fail, you probably wind up losing in the end.&lt;/p&gt;&#xA;" OwnerUserId="16554" LastEditorUserId="16554" LastEditDate="2015-07-19T21:54:04.827" LastActivityDate="2015-07-19T21:54:04.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18537" PostTypeId="1" CreationDate="2015-06-27T18:26:08.187" Score="15" ViewCount="505" Body="&lt;p&gt;I am looking for some references treating of what I would call&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;liquidation cost&lt;/li&gt;&#xA;&lt;li&gt;market impact cost &lt;/li&gt;&#xA;&lt;li&gt;transaction cost(*)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;in the usual &quot;portfolio optimization problem under linear constraints&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me define the terms here.&#xA;$$&#xA;\text{Find } w^*=\underset{w}{\text{argmax}} \ \ r^Tw - \lambda w^{T} \Sigma w\\&#xA;\text{uc.} \ \ l_b \leq Aw \leq u_b&#xA;$$&#xA;where $w \in \mathbb{R}^n$ is the final position of a portfolio of $n$ assets. $r \in \mathbb{R}^n$ is the vector of expected returns over a time period (say $[0,T]$), $\Sigma$ is the $\mathbb{M}_{n,n}(\mathbb{R})$ covariance matrix of the asset returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One can use a factor model $r=Xf+u$, where returns are modeled as a linear combination of the weighted factor returns $f$ plus an idiosyncratic part&#xA;$u$. By assuming independence between $f$ and $u$, and between the&#xA;individual components of $u$ one gets $\Sigma = X^T F X + D$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So we rewrite&#xA;$$&#xA;\text{Find } w^*=\underset{w}{\text{argmax}} \ \ r^Tw - \lambda w^{T} (X^T F X + D) w\\&#xA;\text{uc.} \ \ l_b \leq Aw \leq u_b&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally $A \in \mathbb{M}_{p,n}(\mathbb{R})$ is a matrix that allows constraints (initial positions, delta). If one wants turnover, bookvalue constraints the usual linearisation trick $n \rightarrow 5n$ allows to keep the exact same formulation, only $A$ would change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This brings my &lt;strong&gt;question 1&lt;/strong&gt;: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is well known from Grinhold and Kahn that &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;market impact should increase as the square&#xA;  root of the amount traded. This agrees remarkably well with the empirical work of Loeb (1983). Because the total trading cost depends on the cost per share times the number of shares traded, it&#xA;  increases as the 3/2 power of the amount traded.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;As such my view is that whatever portfolio achieved should take into account the cost it will take to liquidate the portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Same thing for &lt;strong&gt;question 2&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solving the problem does not take into account the impact that working out the solution portfolio will have on the expected returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think &lt;strong&gt;question 3&lt;/strong&gt; brings non-continuous cost on the table so, I'll leave it for now (tell me if I am wrong)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As such I think I want to solve&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\text{Find } w^*=\underset{w}{\text{argmax}} \ \ (r-I(t))^Tw - \lambda w^{T} (X^T F X + D) w - \Theta |w|^{\frac{3}{2}}\\&#xA;\text{uc.} \ \ l_b \leq Aw \leq u_b&#xA;$$&#xA;where $t=|w-w_0|$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you give me references on adding those additional terms, the more applied the better.&lt;/p&gt;&#xA;" OwnerUserId="5339" LastEditorUserId="26595" LastEditDate="2018-05-18T05:32:16.730" LastActivityDate="2018-06-24T21:34:48.083" Title="Are there references about liquidation, transaction, market impact costs in portfolio optimization" Tags="&lt;portfolio-management&gt;&lt;optimization&gt;&lt;portfolio-optimization&gt;&lt;market-microstructure&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="18539" PostTypeId="1" AcceptedAnswerId="18541" CreationDate="2015-06-27T20:01:38.063" Score="4" ViewCount="265" Body="&lt;p&gt;How can I calculate? &#xA;\begin{align}&#xA;Cov\left(\int_{0}^{s}W_u\,du\,\,\,,\,\int_{0}^{t}W_v\,dv\right)&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for your attention.&lt;/p&gt;&#xA;" OwnerDisplayName="user16692" LastActivityDate="2015-06-27T21:02:46.347" Title="How can I calculate $Cov\left(\int_{0}^{s}W_u\,du\,\,\,,\,\int_{0}^{t}W_v\,dv\right)$" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;wienerprocess&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18540" PostTypeId="1" CreationDate="2015-06-27T20:22:13.253" Score="5" ViewCount="5320" Body="&lt;p&gt;I'm having trouble with the Ho-Lee model for short rates and differentiating between how to find the values for the free parameter λ versus using the model to predict future rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Ho-Lee model for each step in a binomial tree:&#xA;$$&#xA;\lambda_tdt + \sigma \sqrt dt&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've read that to set the free parameter at each step in a recombining binomial tree, you set the rate at state 0 to the current spot rate (ie: 1 month spot rate) and find a value for lambda that when plugged into the model will result in the current spot rate for the next time step (eg: starting with 1 month spot rate at state 0 and using a 1 month time step, the correct value for lambda when plugged into the model will produce the current 2 month spot rate etc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;This confuses me.&lt;/strong&gt; Once I've determined the value of lambda for each step in my tree, what inputs do I change to use the model with my binomial tree to predict futures rates .. ie: one month rate in one month, in two months etc?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case my description isn't clear, here is an except from Bruce Tuckman's book on the subject.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;... find λ1 such that the model produces a two-month spot rate equal&#xA;  to that in the market. Then find λ2 such that the model produces a&#xA;  three-month spot rate equal to that in the market. Continue in this&#xA;  fashion until the tree ends.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="9265" LastEditDate="2015-06-27T20:29:07.233" LastActivityDate="2015-06-28T10:21:58.207" Title="Ho-Lee Model; Please explain" Tags="&lt;interest-rates&gt;&lt;binomial-tree&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18541" PostTypeId="2" ParentId="18539" CreationDate="2015-06-27T21:02:46.347" Score="8" Body="&lt;p&gt;You know that $E\left[\int_{0}^{s}W_udu\right]=E\left[\int_{0}^{t}W_vdv\right]=0$. By definition &#xA;\begin{align}&#xA;&amp;amp; Cov\left(\int_{0}^{s}W_u\,du\,\,,\,\int_{0}^{t}W_v\,dv\right)=E\left[\int_{0}^{s}W_u\,du\int_{0}^{t}W_v\,dv\right]-0&#xA;\end{align}&#xA;then&#xA;\begin{align}&#xA;&amp;amp; Cov\left(\int_{0}^{s}W_u\,du\,\,,\,\int_{0}^{t}W_v\,dv\right)=\int_{0}^{s}\int_{0}^{t}E\,[W_uW_v]\,\,du\,dv&#xA;\end{align}&#xA;Since $E\,[W_uW_v]=min \{\,u\,,v \}$ therefor&#xA;\begin{align}&#xA;&amp;amp; Cov\left(\int_{0}^{s}W_u\,du\,\,,\,\int_{0}^{t}W_v\,dv\right)=\int_{0}^{s}\int_{0}^{t}min \{\,u\,,v \}\,\,du\,dv&#xA;\end{align}&#xA;For the case $s&amp;lt;t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;\int_{0}^{s}\int_{0}^{t}min \{\,u\,,v \}\,\,du\,dv=\int_{0}^{s}\int_{0}^{s}min \{\,u\,,v \}\,\,du\,dv+\int_{0}^{s}\int_{s}^{t}min \{\,u\,,v \}\,\,du\,dv&#xA;\end{align}&#xA;we immediately have&#xA;\begin{align}&#xA;\int_{0}^{s}\int_{0}^{t}min \{\,u\,,v \}\,\,du\,dv=\frac{1}{3}s^3+\frac{1}{2}(t-s)s^2&#xA;\end{align}&#xA;Following the same steps as described above, for the case $s &amp;gt; t$ we can also&#xA; show&#xA;\begin{align}&#xA;\int_{0}^{s}\int_{0}^{t}min \{\,u\,,v \}\,\,du\,dv=\frac{1}{3}t^3+\frac{1}{2}(s-t)s^2&#xA;\end{align}&#xA;Thus,&#xA;\begin{align}&#xA;Cov\left(\int_{0}^{s}W_u\,du\,\,,\,\int_{0}^{t}W_v\,dv\right)=\frac{1}{3}min\{s^3\,\,,t^3\}+\frac{1}{2}|t-s|min\{s^2\,\,,t^2\}&#xA;\end{align}&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastActivityDate="2015-06-27T21:02:46.347" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18543" PostTypeId="2" ParentId="4946" CreationDate="2015-06-28T00:12:13.510" Score="3" Body="&lt;p&gt;You can calibrate the model by discretizing in time, and using a forward induction method as originally proposed by Jamishidian in 1991:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;F.Jamshidian, Forward Induction and Construction of Yield Curve Diffusion Models, J.Fixed Income 6, 62-74 (1991).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although he formulated this induction in the language of the binomial tree, the method is more general, and can be applied for example by allowing the state variable to be continuous. &lt;/p&gt;&#xA;" OwnerUserId="16700" LastActivityDate="2015-06-28T00:12:13.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18544" PostTypeId="2" ParentId="18540" CreationDate="2015-06-28T10:21:58.207" Score="6" Body="&lt;p&gt;You know that the Ho-Lee model is represented by the stochastic differential equations&#xA;\begin{align}&#xA;dr_t=\lambda_t\,dt+\sigma\,dW_t&#xA;\end{align}&#xA;In order to Implementation our binomial tree, we use the Euler discretization.&#xA;\begin{align}&#xA;r_t=r_{t-\Delta t}+\lambda_{t-\Delta t}\,\Delta t+\sigma\,\sqrt {\Delta t} \,Z&#xA;\end{align}&#xA;where $Z$ is a standard normal random variable.Let $t_0=0&amp;lt;t_1&amp;lt;...&amp;lt;t$ and expand equation, in discrete time &#xA;\begin{align}&#xA;r_t=r_0+\Delta t\sum_{t_0\leq t_i\leq t-\Delta t}\lambda_{t_i}+\sigma\Delta t\sum_{t_0\leq t_i\leq t-\Delta t}\ \,Z&#xA;\end{align}&#xA;This relation shows that the short rate is the sum of a set of non-stochastic drift terms and a set of random terms.The no-arbitrage zero coupon bond price $P(t,t+\Delta t)$ will thus be stated as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;P(0,t_n)=E^Q\left[exp\left(-\Delta t\,\sum_{i=0}^{n-1}r(t_i) \right)\right]&#xA;\end{align}&#xA;For instance calculating the bond price at time $n=2$, gives us:&#xA;\begin{align}&#xA;P(0,t_2)=E^Q[\Delta t\,exp(-r_{t_0}-r_{t_1})]=e^{-\Delta t\,r_{t_0}}E^Q[e^{-\Delta t\,r_{t_1}}]&#xA;\end{align}&#xA;in other words&#xA;\begin{align}&#xA;P(0,t_2)=e^{-\Delta t\,r_{t_0}}\,exp\left(-\Delta t\,E^Q[r_{t_1}]+\frac{1}{2}\Delta t\,Var^Q[r_{t_1}]\right)&#xA;\end{align}&#xA;In this case, $r_t$ has a normal distribution,thus&#xA;\begin{align}&#xA;\ln P(0,t_2)=-\Delta t\,r_{t_0}-\Delta t\,r_{t_0}-\Delta t\lambda_0\,+\frac{1}{2}\sigma^2(\Delta t)^2=-2\Delta t\,r_{t_0}-\lambda_0\,\Delta t+\frac{1}{2}\sigma^2(\Delta t)^2\&#xA;\end{align}&#xA;But&#xA;\begin{align}&#xA;\ln P(0,t_2)=\Delta t\,[-f(0,0)-f(0,t_1)]&#xA;\end{align}&#xA;It can be rewritten as:&#xA;\begin{align}&#xA;-r_{t_0}-f(0,t_1)=-2r_{t_0}-\lambda_0\ t+\frac{1}{2}\sigma^2\Delta t\&#xA;\end{align}&#xA;then&#xA;\begin{align}&#xA;\lambda_{t_0}=f(0,t_1)-r_{t_0}+\frac{1}{2}\sigma^2\Delta t\&#xA;\end{align}&#xA;This relaton give the necessary recursive relations to evolve the Ho-Lee no arbitrage model of short rates. We take a set of bond prices and structure of volatilities as an input for the short rates. Therefore we get the evolutionary equation to depict the binomial tree of the model.&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastActivityDate="2015-06-28T10:21:58.207" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18545" PostTypeId="1" AcceptedAnswerId="18552" CreationDate="2015-06-28T13:50:37.370" Score="5" ViewCount="134" Body="&lt;p&gt;If $W_t$ be a wiener process then,how can i show that $W_{t}^{3}$ is not a martingale by definition?&lt;/p&gt;&#xA;" OwnerDisplayName="user16692" LastActivityDate="2015-06-28T18:47:14.037" Title="Why $W_{t}^3$ is not a martigale?(by Definition)" Tags="&lt;stochastic-calculus&gt;&lt;stochastic&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18546" PostTypeId="1" CreationDate="2015-06-28T14:42:54.680" Score="1" ViewCount="213" Body="&lt;p&gt;I'm just starting to learn about quantitative finance and I'm overwhelmed by the amount of tradable securities out there. I'm seeing all these things like VXX, TLT, TMF, SPY, SPXL, HYG, VWEHX and so on and have no clue what they are (have to google them each time). I'm hoping to compile a list (or be pointed to a list) of all major categories of tradable securities and the ETF's that track them, and how they are calculated, so that I know what's out there and start to understand other people's trading strategies. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a good place to start? What's the best way to learn about all of these indexes/securities? Does such a list exist?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sorry if this is off-topic, I'm just hoping to get some pointers from experienced quants on getting started. Thanks all.&lt;/p&gt;&#xA;" OwnerUserId="16702" LastEditorUserId="16160" LastEditDate="2017-07-03T03:00:20.687" LastActivityDate="2017-10-31T05:06:52.613" Title="Major categories of tradable securities and the ETF's that track them?" Tags="&lt;quant-trading-strategies&gt;&lt;trading&gt;&lt;index&gt;&lt;etf&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18547" PostTypeId="1" AcceptedAnswerId="18555" CreationDate="2015-06-28T15:31:35.977" Score="0" ViewCount="4395" Body="&lt;p&gt;A bank is advertising 9.5% accounts that yield 9.84% annually. How often is the interest compounded?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Answer is Quarterly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been trying to look for the formula for this; it doesn't seem to be effective rate:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ER = (1+i)^m - 1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or Nominal Rate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$i = NR/m$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What should I be using?&lt;/p&gt;&#xA;" OwnerUserId="16683" LastEditorDisplayName="user13444" LastEditDate="2016-12-18T07:43:37.127" LastActivityDate="2016-12-18T07:43:37.127" Title="Finding the Interest Compounded with Bank Advertising Yield" Tags="&lt;interest-rates&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18548" PostTypeId="2" ParentId="18535" CreationDate="2015-06-28T16:57:21.703" Score="1" Body="&lt;p&gt;Employee stock options (ESOs) have a couple of disadvantages, but the high volatility of small tech company stocks is NOT one of them. It is actually an advantage, as the higher the volatility of the underlying, the higher the option value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Disadvantages for ESO holders:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Withholding fees for early exercise.&lt;/li&gt;&#xA;&lt;li&gt;Income tax treatment instead of capital gains. &lt;/li&gt;&#xA;&lt;li&gt;Decreased portfolio/income &lt;strong&gt;diversification&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I will expand on the last one as I think it could be often overlooked. An employee works for a small to mid-sized tech company and holds ESO of the company. If the company goes south, the employee is in danger of not only losing her income stream but also sustaining great losses on the ESOs. The employee's income stream and portfolio value are greatly correlated and unless steps are taken to hedge and diversify, ESOs will represent less value to the individual on a Risk Adjusted basis.&lt;/p&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2015-06-28T16:57:21.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18549" PostTypeId="1" CreationDate="2015-06-28T17:23:42.030" Score="4" ViewCount="549" Body="&lt;p&gt;I am trying to value a illiquid corporate bond issued at a discount to face value by a privately held company in India. The corporate bond is a sinkable bond (amortizing principle) with coupon rate of more than twice the risk free rate of the country.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What all should be component of discount yield of the bond &lt;/li&gt;&#xA;&lt;li&gt;Once we have identified the components on the issuance date, how do we carry on the valuation as on different dates&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How do we identify the credit spread for the bond issued (since this is a privately held company in a sector where bonds with similar ratings are unavailable&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How can one justify such high coupon for the bond&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="16704" LastActivityDate="2017-11-12T00:24:04.857" Title="Yield for valuation of illiquid corporate bond" Tags="&lt;bond&gt;&lt;pricing&gt;&lt;spread&gt;&lt;valuation&gt;&lt;yield&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18550" PostTypeId="1" CreationDate="2015-06-28T18:06:50.097" Score="3" ViewCount="739" Body="&lt;p&gt;The question is that I want to know whether there is difference in the applying of sign bias test in detecting the exist of asymmetric effects and the adequacy of symmetric GARCH model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the definition of sign bias test, we need to do the t test for the coefficient $\beta$ in the regression equation $\hat{\epsilon}_t^2 = \alpha + \beta S_{t-1}^- + z_t$, where $\hat{\epsilon}_t$ is the estimated residual, $S_{t-1}^-$ is the dummy function that $\hat{\epsilon}_{t-1} &amp;lt; 0 $ and 0 otherwise and $z_t$ is the noise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My quiz is that how do I get the estimated $\hat{\epsilon}$. In the original paper by Engle and Ng &#xA;&lt;a href=&quot;http://www.finance.martinsewell.com/stylized-facts/volatility/EngleNg1993.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.finance.martinsewell.com/stylized-facts/volatility/EngleNg1993.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It explained that $\hat{\epsilon}_t$ is from the equation that $\hat{\epsilon}_t = y_t - \mu_t$. My understanding is that, if $\hat{\epsilon}_t$ is from the that equation, then it is only with the purpose to check the exist of asymmetric effects. But some material explain $\hat{\epsilon}_t$ is estimated from a symmetric GARCH model, for example, GARCH(1,1), if we want to show whether a symmetric GARCH model is adequate in describing the asymmetric effects. I am confused about it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="15201" LastActivityDate="2015-06-28T18:06:50.097" Title="The difference in sign bias test in detecting the exist of asymmetric effects and the adequacy of symmetric GARCH model." Tags="&lt;garch&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18552" PostTypeId="2" ParentId="18545" CreationDate="2015-06-28T18:47:14.037" Score="4" Body="&lt;p&gt;Note that, for $0 \leq s &amp;lt; t$,&#xA;\begin{align*}&#xA;W_t^3 &amp;amp;= (W_t-W_s+W_s)^3\\&#xA;&amp;amp;= (W_t-W_s)^3 + 3(W_t-W_s)^2 W_s + 3 (W_t-W_s) W_s^2 + W_s^3.&#xA;\end{align*}&#xA;Moreover,&#xA;\begin{align*}&#xA;E\big( (W_t-W_s)^3 \mid \mathcal{F}_s\big) &amp;amp;= E\big( (W_t-W_s)^3\big)\\&#xA;&amp;amp;= 0,\\&#xA;E\big((W_t-W_s)^2 W_s \mid \mathcal{F}_s\big) &amp;amp;= W_s E\big( (W_t-W_s)^2\big)\\&#xA;&amp;amp;= (t-s)W_s,&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;E\big( (W_t-W_s) W_s^2 \mid \mathcal{F}_s\big) &amp;amp;= W_s^2 E\big( (W_t-W_s)\big)\\&#xA;&amp;amp;=0.&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;E\big(W_t^3\mid \mathcal{F}_s\big) &amp;amp;= 3(t-s)W_s+W_s^3.&#xA;\end{align*}&#xA;That is, $\{W_t^3 \mid t\geq 0\}$ is not a martingale. We note that, however, &#xA;$\{W_t^3 -3tW_t \mid t\geq 0\}$ is a martingale. See Question&#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/14956/show-that-eb-t-mathscrf-s-b-s/14989#14989&quot;&gt;Show that $E[B_t|\mathscr{F}_s] = B_s$&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-06-28T18:47:14.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18553" PostTypeId="2" ParentId="18521" CreationDate="2015-06-28T20:40:14.343" Score="2" Body="&lt;p&gt;There is no generic solution. However, the KKT conditions are of the forms&#xA;\begin{align*}&#xA;\begin{cases}&#xA;Qy + \lambda_1 \mu +\lambda_2 Py = 0,\\&#xA;\mu^T y = 1,\\&#xA;y^TPy \leq k^2 \sigma^2,\\&#xA;\lambda_2 \big( y^TPy - k^2 \sigma^2\big) = 0.&#xA;\end{cases}&#xA;\end{align*}&#xA;Here, the condition $$\lambda_2 \big( y^TPy - k^2 \sigma^2\big) = 0 $$ means that two cases need to considered, that is, the one on the boundary $y^TPy = k^2 \sigma^2$ and the one inside the domain $y^TPy &amp;lt; k^2 \sigma^2.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the boundary, it is the standard Lagrange problem with conditions&#xA;\begin{align*}&#xA;\begin{cases}&#xA;Qy + \lambda_1 \mu +\lambda_2 Py = 0,\\&#xA;\mu^T y = 1,\\&#xA;y^TPy = k^2 \sigma^2.&#xA;\end{cases}&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Inside the domain, the constraints are&#xA;\begin{align*}&#xA;\begin{cases}&#xA;Qy + \lambda_1 \mu  = 0,\\&#xA;\mu^T y = 1,\\&#xA;y^TPy &amp;lt; k^2 \sigma^2.&#xA;\end{cases}&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The final solution $(y^T, k)$ is the one so that the global overall minimum is reached.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-06-28T20:40:14.343" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18554" PostTypeId="1" CreationDate="2015-06-28T20:47:32.867" Score="7" ViewCount="324" Body="&lt;p&gt;I am pricing an American call under the &lt;a href=&quot;http://engineering.nyu.edu/files/jbarticle.pdf&quot; rel=&quot;nofollow&quot;&gt;CGMY model&lt;/a&gt; ($0 &amp;lt; Y &amp;lt; 1$) with strike $K$ at grid point $(x_i,\tau_j)$ where $x_i=x_{min}+i\,\Delta x $ for $i=0,1,...N$ and $\Delta x=\frac{x_{max}-x_{min}}{N}$.Why in the region $y\in(x_N-x_i,\infty)$ we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;\int_{x_N-x_i}^{\infty}(w(x_i+y,\tau_j)-w(x_i,\tau_j))\frac{exp(-\lambda_p) y}{\nu(x_i,\tau_j)\, y^{1+Y}}\,\,dy=0&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $w(x_i,\tau_j)$ is the premium at $(x_i,\tau_j)$.&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-08-19T18:23:18.717" LastActivityDate="2016-08-19T18:23:18.717" Title="Pricing an American call under the CGMY model" Tags="&lt;american-options&gt;" AnswerCount="0" CommentCount="9" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18555" PostTypeId="2" ParentId="18547" CreationDate="2015-06-28T21:11:13.230" Score="1" Body="&lt;p&gt;The quarterly compound rate:&#xA;\begin{align*}&#xA;\Big(1+\frac{0.095}{4}\Big)^4 - 1= 9.84\,\%.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-06-28T21:11:13.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18556" PostTypeId="1" CreationDate="2015-06-28T23:12:47.047" Score="0" ViewCount="164" Body="&lt;p&gt;Is there any chance to get order data from any broker with a label from which account it came from? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;br&gt;The accounts can be anonymized, i just need to identify an account's orders sent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help will be appreciated. &lt;/p&gt;&#xA;" OwnerUserId="15684" LastEditorUserId="2553" LastEditDate="2015-06-29T11:13:51.157" LastActivityDate="2015-07-01T16:04:12.580" Title="How can one get broker order data?" Tags="&lt;data&gt;&lt;trading&gt;&lt;order&gt;&lt;broker&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18557" PostTypeId="1" CreationDate="2015-06-29T02:24:59.810" Score="13" ViewCount="842" Body="&lt;p&gt;I’m studying the BSM model and having a look at the greeks. I was reading &lt;em&gt;Derivatives&lt;/em&gt;, by Paul Wilmott, and he gives the closed form solutions without making the reader see where these solutions come from.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a good book that explains in detail how each greek, from Delta to Rho, is derived and computed?&lt;/p&gt;&#xA;" OwnerUserId="16045" LastEditorUserId="8100" LastEditDate="2015-06-29T11:01:12.793" LastActivityDate="2018-08-25T12:59:21.827" Title="The greeks: where do they come from?" Tags="&lt;black-scholes&gt;&lt;greeks&gt;&lt;books&gt;&lt;black-scholes-pde&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18558" PostTypeId="1" CreationDate="2015-06-29T02:26:27.360" Score="1" ViewCount="219" Body="&lt;p&gt;Discounting a cashflow using given forward rates will result in the following present value:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PV = 102.875 = ${5\over (1+3\%)}$ + ${5\over (1+3\%)(1+4\%)}$ + ${105\over (1+3\%)(1+4\%)(1+5\%)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where 3%, 4% and 5% are the forward rates from years &lt;em&gt;0 to 1&lt;/em&gt;, &lt;em&gt;1 to 2&lt;/em&gt; and &lt;em&gt;2 to 3&lt;/em&gt;, respectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The IRR corresponding to this cashflow is IRR = 3.964%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I use this IRR as an average rate to calculate the future value of the cashflow at the begining of year 3?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If positive, why is it different than the result achieved when using the forward rates above?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Future value of cashflow using the IRR:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$FV_{year\ 3}$ = 115.603 = $5(1+3.964\%)^2$ + $5(1+3.964\%)$ + 105&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Future value of cashflow using the forward Rates:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$FV_{year\ 3}$ = 115.710 = $5(1+4\%)(1+5\%)$ + $5(1+5\%)$ + 105&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question came to be when I noticed that I end up with exactly the same present value when using either the IRR or the forward rates but end up with different future values when using the IRR or the forward rates.&lt;/p&gt;&#xA;" OwnerUserId="16705" LastActivityDate="2017-01-21T15:12:00.473" Title="Using IRR to calculate future value of cashflow" Tags="&lt;finance&gt;&lt;forward-rate&gt;&lt;yield&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18559" PostTypeId="1" CreationDate="2015-06-29T02:36:51.197" Score="4" ViewCount="1241" Body="&lt;p&gt;there's something I've been trying to understand for a while now and I just can't quite understand with regards to skew. In the same month, why can't you buy a option that have low implied vol on the skew and sell options that have a high implied vol and dynamically? For instance, let's say XYZ is trading at $30 and has a normal skew (smirk) you buy Aug 45 calls at an implied vol of 24 and sell Aug 20 calls at an implied vol of 40 and dynamically hedge, wouldn't you be guaranteed to make money? If stock moved on a 50 vol you would make 26 vol points of profit on your long call and only lose 10 vol points of profit on your short call? Any scenario you construct you would make money in terms of implied vol vs realized vol. Obviously this can't be true, can someone please explain why? &lt;/p&gt;&#xA;" OwnerUserId="16709" LastEditorUserId="2183" LastEditDate="2017-08-08T09:50:09.637" LastActivityDate="2017-08-08T09:50:09.637" Title="Why can't you arb skew by buying options with low implied vol and selling high implied vol in the same month and dynamically hedging?" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;skew&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18560" PostTypeId="2" ParentId="18557" CreationDate="2015-06-29T03:44:31.383" Score="7" Body="&lt;p&gt;First, my notation. $K$ is the strike price, $S$ is the stock price, $r$ is the continuously compounded risk-free rate, $T$ is time at expiration, $t$ is time at issue, $\sigma$ is volatility, $\delta$ is continuously compounded dividend rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Black-Scholes formula for a European call is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C = Se^{-\delta (T-t)} N(d_1) - Ke^{-r(T-t)} N(d_2)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d_1 = \dfrac{\ln(S/K) + (r - \delta + 0.5\sigma^2)(T-t)}{\sigma \sqrt{(T-t)}}$ and $d_2 = d_1 - \sigma \sqrt{(T-t)}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some common greeks are&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Delta$ = $\dfrac{ \partial C}{\partial S}$, $\Gamma = \dfrac{ \partial^2 C}{\partial S^2}$, $\rho = \dfrac{\partial C}{\partial r}$, $v = \dfrac{\partial C}{\partial \sigma}$, $\theta = \dfrac{\partial C}{\partial t}$ and $\psi = \dfrac{\partial C}{\partial \delta}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that $\theta$ is often equivalenty defined as $- \dfrac{\partial C}{\partial T}$. You can derive the greeks by taking the partial derivatives. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, I will derive $\Delta = e^{-\delta (T-t)} N(d_1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;\Delta &amp;amp;= \dfrac{\partial C}{\partial S} \\&#xA;&amp;amp;= e^{-\delta (T-t)} N(d_1) + \dfrac{\partial C}{\partial S} Se^{-\delta (T-t)} N(d_1) - \dfrac{\partial C}{\partial S} Ke^{-r(T-t)} N(d_2) \\&#xA;&amp;amp;= e^{-\delta (T-t)} N(d_1)&#xA;\end{align*}  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is not obvious that the last two terms cancel out. I prove this below. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;&amp;amp;\dfrac{\partial C}{\partial S} Se^{-\delta (T-t)} N(d_1) - Ke^{-r(T-t)} N(d_2) \\ &amp;amp;= Se^{-\delta (T-t)} \dfrac{\partial}{\partial S} d_1 \dfrac{1}{\sqrt{2\pi}} e^{-0.5d_1^2} - Ke^{-r(T-t)} \dfrac{\partial}{\partial S} d_2 \dfrac{1}{\sqrt{2\pi}}e^{-0.5d_2^2} \\ &#xA;&amp;amp;\propto \dfrac{\partial}{\partial S}d_1 \left( Se^{-\delta (T-t)} e^{-0.5d_1^2} - Ke^{-r(T-t)} e^{-0.5 d_2^2} \right) \\&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;&amp;amp;\ln\left(Se^{-\delta(T-t)}e^{-0.5d_1^2}\right) - \ln\left(Ke^{-r(T-t)} e^{0.5d_2^2} \right) \\ &amp;amp;= \ln(S) - \delta(T-t) - \ln(K) + rT + 0.5d_2^2 - 0.5d_1^2 \\&#xA;&amp;amp;= \ln(S/K) + (r-\delta)(T-t) - 0.5(d_1^2 - (d_1 - \sigma\sqrt{T-t})^2) \\&#xA;&amp;amp;= \ln(S/K) + (r-\delta)(T-t) - 0.5(2d_1\sigma\sqrt{T-t} - \sigma^2(T-t)) \\&#xA;&amp;amp;= \ln(S/K) + (r-\delta)(T-t) - d_1 \sigma\sqrt{T-t} + 0.5\sigma^2(T-t) \\&#xA;&amp;amp;= \ln(S/K) + (r-\delta)(T-t) - \left(\ln(S/K) + (r-\delta + 0.5\sigma^2)(T-t)\right) + 0.5\sigma^2(T-t)&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So $\left( Se^{-\delta (T-t)} e^{-0.5d_1^2} - Ke^{-r(T-t)} e^{-0.5 d_2^2} \right) = 0$ and $\Delta$ = $e^{-\delta(T-t)} N(d_1)$ as shown above. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that $\Delta &amp;gt; 0$ for a European call. Hedging greeks is a common topic in financial economics. To hedge a European call, short sell $\Delta$ shares of stock. This protects a portfolio against small changes in the stock price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT 1&lt;/strong&gt;&#xA;By the BSE, $V_t + 0.5V_ss(\sigma S)^2 = rV - VsS(r-\delta)$ can be written as $\theta + 0.5\Gamma(\sigma S)^2 = rV - \Delta S(r-\delta)$. The solution to the BSE depends on the terminal conditions and payoff. &lt;/p&gt;&#xA;" OwnerUserId="16710" LastEditorUserId="16710" LastEditDate="2015-06-29T19:03:13.027" LastActivityDate="2015-06-29T19:03:13.027" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18561" PostTypeId="2" ParentId="18558" CreationDate="2015-06-29T03:56:20.480" Score="0" Body="&lt;p&gt;The time $0$ forward rate from tme $n-1$ to time $n$ is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;1 + i_0(n-1, n) = \dfrac{(1 + s_0(n))^n}{(1+s_0(n-1))^{n-1}}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $s_0(n)$ is the $n$-year spot rate and $i_0(n-1, n)$ is the time $0$ forward rate from time $n-1$ to time $n$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The term structure of interest rates must be increasing to avoid arbitrage opportunities. Suppose you have a dollar today. The accumulated value in one year is $1 + s_0(1) = 1 + i_0(0,1)$ and the accumulated value in two years in $(1 + s_0(2))^2$ = $(1 + i_0(1))(1 + i_0(i,2))$. You can't just use the IRR (that would assume a flat yield curve).&lt;/p&gt;&#xA;" OwnerUserId="16710" LastActivityDate="2015-06-29T03:56:20.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18562" PostTypeId="1" AcceptedAnswerId="18567" CreationDate="2015-06-29T05:08:42.523" Score="4" ViewCount="2265" Body="&lt;p&gt;I'm looking for an excel example (not a copy of Dupire's eqn) of how to convert an IV surface to a local vol surface. If unsuccessful I'll work through Dupire's eqn but would be helpful to look at an example first.&lt;/p&gt;&#xA;" OwnerUserId="13397" LastActivityDate="2015-06-29T10:32:11.430" Title="Numerical example of how to calculate local vol surface from IV surface" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;stochastic-volatility&gt;&lt;local-volatility&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18563" PostTypeId="1" CreationDate="2015-06-29T07:04:27.887" Score="3" ViewCount="601" Body="&lt;p&gt;To hedge a strategy is it accurate &quot;enough&quot; to price an option using an implied vol curve vs moneyness (strike/spot) assuming sticky delta? The moneyness can be read off the chart, its corresponding IV and then price can be calculated using BS formula. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think this has to be an over simplification, but I'm not sure why. Can someone show me where this falls apart? &lt;/p&gt;&#xA;" OwnerUserId="13397" LastActivityDate="2016-12-31T21:31:07.567" Title="Hedging - calculating option prices using implied volatility surface" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;implied-volatility&gt;&lt;delta-hedging&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18565" PostTypeId="1" AcceptedAnswerId="18569" CreationDate="2015-06-29T09:25:09.220" Score="4" ViewCount="3844" Body="&lt;p&gt;A Bermuda option allows early exercise at predefined dates,  e.g. at maturity equal to $t_1$, $t_2$, $t_3$,...;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;hence , would its value be the sum of 3 discounted European options with 1-year maturity?&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="2553" LastEditDate="2015-06-29T10:22:54.110" LastActivityDate="2015-06-29T15:51:18.013" Title="How can one value a Bermuda option?" Tags="&lt;option-pricing&gt;&lt;hedging&gt;&lt;american-options&gt;&lt;valuation&gt;&lt;bermudan&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18567" PostTypeId="2" ParentId="18562" CreationDate="2015-06-29T10:32:11.430" Score="2" Body="&lt;p&gt;I know one article (&lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.348.5119&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow&quot;&gt;download&lt;/a&gt;) that explaining how to calculate local vol surface from IV surface and also chapter 18 of &lt;a href=&quot;http://users.aims.ac.za/~ronnie/NM1&amp;amp;2Notes/Chap18.pdf&quot; rel=&quot;nofollow&quot;&gt;this book&lt;/a&gt; is very good In this context. However you know that Dupire’s (1994) formula for local volatility is&#xA;\begin{align}&#xA;\sigma_L(k,T)=\sqrt\frac{\frac{\partial C}{\partial T}}{\frac{1}{2}K^2\frac{\partial^2 C}{\partial K^2}}&#xA;\end{align}&#xA;where $C = C(K,T)$ is the time-$t$ call price with strike $K$ and maturity $T$ when the spot price is $S_t$.The analytic expressions for the derivatives required of the Dupire (1994) local volatility formula require extensive coding From a coding point of view, it is simpler to approximate the derivatives using finite differences. Write $C(K) = C(K,T)$ to emphasize the dependence of the European call price on the maturity T. We use a small time increment $\Delta t$ and approximate the time derivative as the central difference&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;\frac{\partial C}{\partial T}\approx\frac{C(K,T+\Delta T)-C(K,T-\Delta T)}{2\Delta t}&#xA;\end{align}&#xA;Similarly, we can use a small strike increment $\Delta K$ and approximate the second order strike derivative as the central difference&#xA;\begin{align}&#xA;\frac{\partial^2 C}{\partial K^2}\approx\frac{C(K-\Delta K,T)-2C(K,T)+C(K+\Delta K,T)}{(\Delta K )^2}&#xA;\end{align}&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastActivityDate="2015-06-29T10:32:11.430" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18568" PostTypeId="1" CreationDate="2015-06-29T11:34:42.327" Score="1" ViewCount="820" Body="&lt;p&gt;I am using matlab and interactive brokers API. I am getting real time data using &lt;/p&gt;&#xA;&#xA;&lt;p&gt;tickerID = ib.realtime({ct},'233',@(varargin)ibEventRealTimeData(varargin{:}));&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where ib is the interface to interactive brokers TWS Activex object and ct is the contract.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am getting all the events (ticksize, tickprice and so on) but I can't aggregate data/prices (for example, in 5 minute bars). What am I missing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="16714" LastActivityDate="2015-10-13T17:11:11.997" Title="Aggregate interactive brokers data in matlab" Tags="&lt;matlab&gt;&lt;interactive-brokers&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18569" PostTypeId="2" ParentId="18565" CreationDate="2015-06-29T15:51:18.013" Score="1" Body="&lt;p&gt;we should first define some&#xA;notation before discussing pricing. Let $t_0$ be initial time and $ t_1, . . . , t_M$ be pre-specified exercise dates with $t_0 &amp;lt; t_1 &amp;lt; · · · &amp;lt; t_M = T$ , the final maturity, and $Δt = t_m−t_{m−1}$. Without a loss of generality it is assumed exercise dates are equidistant. To price a Bermudan option, its value is split into two parts, the continuation value and the immediate exercise payoff.&#xA;At time  $t_{m−1}$, the value of $ v(x, t_{m−1})$ consists of the continuation value and the early exercise payoff value.An approximated continuation value, assuming the option is not exercised in the current period, is (&lt;a href=&quot;https://quanto.inria.fr/pdf_html/ap_cosine_doc/&quot;&gt;look article&lt;/a&gt;)&#xA;\begin{align}&#xA;c(x,t_{m-1})=\sum_{k=0}^{N-1} Re\left[\phi\left(\frac{k\pi}{b-a};y|x\right)exp\left(-ik\pi\frac{a}{b-a}\right)\right]V_k(t_m)&#xA;\end{align}&#xA;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$x:$ be the modeled quantity at t, often the log asset price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$y:$ be the modeled quantity at T, often the log asset price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$f(y|x):$ be the probability density function under the pricing measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&#xA;\begin{align}&#xA;V_k(t_m)=\frac{2}{b-a}\int_{a}^{b}v(y,t_m) cos\left(k\pi\frac{y-a}{b-a}\right)dy&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for more details, you can see &lt;a href=&quot;https://quanto.inria.fr/pdf_html/ap_cosine_doc/&quot;&gt;this article.&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastActivityDate="2015-06-29T15:51:18.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18570" PostTypeId="1" CreationDate="2015-06-29T15:59:18.640" Score="6" ViewCount="467" Body="&lt;p&gt;I'm trying to find the optimal portfolio of options and stock which minimizes the standard deviation of the portfolio returns but also taking into consideration the bid and ask prices of the assets.  I am given a snapshot of the stock and related options (all with same maturity but different strikes) with their bid and ask prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am making the assumption that the stock price follows a geometric brownian motion and that infinite amounts of each asset can be sold/bought at their bid/ask price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My approach, if there was only a mid price would be to simulate returns for each asset, calculate the average returns and the covariance matrix then pass this into a quadprog function in MATLAB to minimize the variance of the portfolio with no upper or lower bounds on the quantity of each asset (i.e. short selling is allowed).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, with the bid/ask spread, the return on selling an asset is slightly different to the return of buying that same asset and so passing the returns and covariances the same way as above would not be accurate.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone suggest a plausible method to account for this bid/ask spread?  I thought about treating the buy and the sell of an asset as two separate assets, calculating their respective returns and altering the constraints to accommodate the buying and selling direction but it gets very messy and my results don't look correct.  Is there an easier way to do this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&#xA;Michael.&lt;/p&gt;&#xA;" OwnerUserId="16716" LastEditorUserId="48272" LastEditDate="2020-08-14T19:49:17.730" LastActivityDate="2020-08-14T19:49:17.730" Title="Matlab Portfolio Optimization with bid ask spread" Tags="&lt;programming&gt;&lt;portfolio-optimization&gt;&lt;mean-variance&gt;&lt;markowitz&gt;&lt;market-impact&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18571" PostTypeId="2" ParentId="16041" CreationDate="2015-06-29T17:16:45.007" Score="1" Body="&lt;p&gt;You Know that $dB_t=r_tB(t)dt$ . Ito's formula give us&#xA;\begin{align}&#xA;dZ(t)=\frac{1}{B(t)}d\,\Pi(t)-\frac{\Pi(t)}{B\,^2(t)}dB(t)+0&#xA;\end{align}&#xA;As your teacher mentioned, $d\Pi(t)=r(t)\Pi(t)dt+\sigma(\Pi(t),t)dW(t)$,Thus we have&#xA;\begin{align}&#xA;&amp;amp; dZ(t)=\frac{1}{B(t)}[r(t)\Pi(t)dt+\sigma(\Pi(t),t)dW(t)]-\frac{\Pi(t)}{B\,^2(t)}r(t)B(t)dt\\&#xA;&amp;amp; dZ(t)=\frac{1}{B(t)}r(t)\Pi(t)dt+\frac{1}{B(t)}\sigma(\Pi(t),t)dW(t)-\frac{1}{B(t)}r(t)\Pi(t)dt\\&#xA;\end{align}&#xA;then&#xA;\begin{align}&#xA; dZ(t)=\frac{1}{B(t)}\sigma(\Pi(t),t)dW(t)&#xA;\end{align}&#xA;Martingale Representation Theorem shows that $Z(t)$ is a Martingale. &lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorUserId="11678" LastEditDate="2015-06-29T20:46:56.400" LastActivityDate="2015-06-29T20:46:56.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18572" PostTypeId="2" ParentId="18559" CreationDate="2015-06-29T18:23:16.710" Score="2" Body="&lt;p&gt;The market does not follow Black-Scholes assumptions, as you clearly know : there is a skew and vol levels change.  Neither does it follow any other particular known model.  So when you say &quot;dynamically hedge&quot; you have to understand this as an approximate hedge that still leaves some significant risk.  Vols will move, and not always together and in the way you predict.  The skew may flatten or steepen; the spot may be up or down.  In the end you have some outcome of profit or loss and no guarantee it is one or the other. &lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2015-06-29T18:23:16.710" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18573" PostTypeId="1" AcceptedAnswerId="18577" CreationDate="2015-06-29T20:01:37.697" Score="3" ViewCount="248" Body="&lt;p&gt;I'm learing ARCH&amp;amp;GARCH model. I have four questions that I don't know the answers&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1st: ARCH &amp;amp; GARCH are often used to evaluate equities. Does it mean that ARCH and GARCH are fitter for high volatility market? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2nd: Can I use these two models to estimate Interest Rate market?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3rd: If yes, the accuracy of forecasting depends on lag? In another word, the longer the lag, the better of forecasting?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ex: if lag is 1 day, I can estimate tomorrow's price by today's price. If lag is 3 day, I can estimate price in 3 day from today's price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4th: What's the right maximum likelihood function so that I can estimate all parameters in R language?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance &lt;/p&gt;&#xA;" OwnerUserId="16718" LastActivityDate="2015-06-29T22:42:47.943" Title="Accuracy of GARCH&amp; ARCH forecast" Tags="&lt;time-series&gt;&lt;r&gt;&lt;garch&gt;&lt;arch&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18574" PostTypeId="1" CreationDate="2015-06-29T20:21:48.890" Score="3" ViewCount="217" Body="&lt;p&gt;I have a high frequency time series of the bid and ask prices of a stock recorded on every tick. For each data point I also have a certain indicators that predict the future movement of the price. The indicators have different horizons of the predictions, some being optimal at few second intervals and others few minutes. I need to assign these predictors weights and based on weather the linear combination crosses a threshold, the decision will be taken to buy of sell the stock. So far I have tried the Differential Evolution (DE) method to figure out the weights. I use a black box model with the weights vector($w_i$) and threshold as inputs. For each data point I have a vector of indicators($\alpha _i$). &#xA;$$&#xA;total\_alpha = \sum\alpha _i*w_i&#xA;$$&#xA;If&#xA;$$&#xA;total\_alpha &amp;gt; threshold, BUY&#xA;$$&#xA;Else If&#xA;$$&#xA;total\_alpha &amp;lt; -threshold, SELL&#xA;$$&#xA;The output of the model is the sum of difference between each between the price of each consecutive buy and sell. This output is being optimised by the DE algorithm. The issues with it being the computational aspects. I have large data sets of sizes(~7e8x20) and the time it takes for the DE algorithm. Is there a better and a faster way to solve this problem? &lt;/p&gt;&#xA;" OwnerUserId="16719" LastActivityDate="2015-06-29T20:21:48.890" Title="Fitting High Frequency Indicators" Tags="&lt;optimization&gt;&lt;high-frequency&gt;&lt;modeling&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18575" PostTypeId="2" ParentId="3607" CreationDate="2015-06-29T20:30:49.167" Score="1" Body="&lt;p&gt;The arithmetic average of +100% in Year 1 and -100% in Year 2 is 0%, but I we all know the result is not a 0% return. So arithmetic returns are absurd to use in any real life context. Maybe in another universe they can serve some purpose.&lt;/p&gt;&#xA;" OwnerUserId="16720" LastActivityDate="2015-06-29T20:30:49.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18576" PostTypeId="1" AcceptedAnswerId="18579" CreationDate="2015-06-29T21:38:09.793" Score="3" ViewCount="130" Body="&lt;p&gt;E.g., a model for $N$ stocks might have each follow a GBM $dS_i = \mu_i S_i dt + \sigma_i S_i dW_i$, where each $W_i$ is independent of the others.  Letting $(\Omega, \mathcal{F}, P)$ be the underlying probability space, what should I be thinking of for $\Omega$?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps it's easier with just one stochastic process?  Some candidate spaces I've heard of are $\Omega = \{$infinite sequences of coin tosses$\}$ and $\Omega = \{$continuous functions on $[0,T]$ starting at $0\}$, but I can't really get a good handle on these.  Is there a a good explanation for these, or a better example of the possible underlying space?  I would prefer a rigorous (measure-theoretic) explanation, if possible.&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2015-06-30T06:13:53.233" Title="Underlying Sample Space in Continuous Market Model" Tags="&lt;stochastic-processes&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18577" PostTypeId="2" ParentId="18573" CreationDate="2015-06-29T22:42:47.943" Score="1" Body="&lt;p&gt;Few comments on your questions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Yes, Arch and Garch are suitable for equities volatility, please see:&#xA;&lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1002/jae.800/pdf&quot; rel=&quot;nofollow&quot;&gt;http://onlinelibrary.wiley.com/doi/10.1002/jae.800/pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) No. These are models of volatility. To model interest rates use CIR, Vasicek or similar. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) and 4) Check paper above. &lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-06-29T22:42:47.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18578" PostTypeId="2" ParentId="18421" CreationDate="2015-06-30T01:11:42.007" Score="0" Body="&lt;p&gt;You have to make further assumptions on the distribution of $J_i$s. For example, if $J_i$s are iid normal, your option pricing problem becomes that of &lt;a href=&quot;http://www.people.hbs.edu/rmerton/optionpricingwhenunderlingstock.pdf&quot; rel=&quot;nofollow&quot;&gt;Merton (1976)&lt;/a&gt; and the solution to it is an infinite sum. If $J_i$s are assumed to be double exponential, you end up with &lt;a href=&quot;http://www.columbia.edu/~sk75/KouWangMS.pdf&quot; rel=&quot;nofollow&quot;&gt;Kou (2004)&lt;/a&gt; model and it has an analytical solution. &#xA;Furthermore, there are three different sources of randomness in the price process. Do you assume that $W_t, N_t$, and $J_i$ are independent from each other? &lt;/p&gt;&#xA;" OwnerUserId="3582" LastActivityDate="2015-06-30T01:11:42.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18579" PostTypeId="2" ParentId="18576" CreationDate="2015-06-30T06:13:53.233" Score="3" Body="&lt;p&gt;I would say the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the tripple $(\Omega,\mathcal{F},P)$ is an abstract probability space with all the properties that I assume that you know.&lt;/li&gt;&#xA;&lt;li&gt;then we can define random variables as mappings from this probability space to the real numbers&#xA;$$&#xA;X: \omega \mapsto X(\omega) \in \mathbb{R}.&#xA;$$&#xA;But we want to study processes&#xA;$$&#xA;(X_t)_{t \ge 0}: \omega \mapsto (X_t(\omega))_{t \ge 0} \in W,&#xA;$$&#xA;where the canonical space, $W$, for these continuous (no jumps) stochastic processes is &lt;a href=&quot;https://en.wikipedia.org/wiki/Classical_Wiener_space&quot; rel=&quot;nofollow&quot;&gt;Wiener space&lt;/a&gt; - the space of continuous functions on the real (half-) line. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you search the internet for these keywords (Wiener space, stochastic process) then you find the mathematical details. You can start e.g. &lt;a href=&quot;https://www.math.ucdavis.edu/~hunter/m280_09/ch5.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-06-30T06:13:53.233" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18580" PostTypeId="2" ParentId="18568" CreationDate="2015-06-30T07:07:21.690" Score="1" Body="&lt;p&gt;In order to aggregate the 5-min bars, you need to add code within your &lt;code&gt;ibEventRealTimeData&lt;/code&gt; function that remembers the previous values (possibly using a &lt;code&gt;global&lt;/code&gt; or &lt;code&gt;persistent&lt;/code&gt; variable) and appends the new data to it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do not need realtime info, you could make a single request for 5-min historical data. But here too, IB sends the results in separate events that you would need to aggregate within your callback.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an alternative you could use the &lt;a href=&quot;http://UndocumentedMatlab.com/IB-Matlab&quot; rel=&quot;nofollow&quot;&gt;IB-Matlab product&lt;/a&gt;, which connects IB and Matlab, and aggregates the information for you, in both the historical/intra-day request and the realtime bars request.&lt;/p&gt;&#xA;" OwnerUserId="16724" LastActivityDate="2015-06-30T07:07:21.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18581" PostTypeId="1" CreationDate="2015-06-30T09:29:26.027" Score="1" ViewCount="1024" Body="&lt;p&gt;I hope you can help me with this one. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using cointegration to discover potential pairs trading opportunities within stocks and more precisely I am utilizing the &lt;strong&gt;Johansen trace test&lt;/strong&gt; for only two stocks at a time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have several securities, but for each test I only test two at a time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If two stocks are found to be cointegrated using the Johansen test, the idea is to define &lt;strong&gt;the spread&lt;/strong&gt; as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;beta' * p(t-1) - c&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where beta'=[1 beta2] and p(t-1) is the (2x1) vector of the previous stock prices. Notice that I seek a normalized first coefficient of the cointegration vector. c is a constant which is allowed within the cointegration relationship. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using Matlab to run the tests (&lt;strong&gt;jcitest&lt;/strong&gt;), but have also tried utilizing Eviews for comparison of results. The two programs yields the same. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I run the test and find two stocks to be cointegrated, I usually get output like&lt;/p&gt;&#xA;&#xA;&lt;p&gt;beta_1 = 12.7290&lt;/p&gt;&#xA;&#xA;&lt;p&gt;beta_2 = -35.9655&lt;/p&gt;&#xA;&#xA;&lt;p&gt;c = 121.3422&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I want a normalized first beta coefficient, I set beta1 = 1 and obtain &lt;/p&gt;&#xA;&#xA;&lt;p&gt;beta_2 = -35.9655/12.7290 = -2.8255&lt;/p&gt;&#xA;&#xA;&lt;p&gt;c =121.3422/12.7290 = 9.5327 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can then generate the spread as beta' * p(t-1) - c. When the spread gets sufficiently low, I buy 1 share of stock 1 and short beta_2 shares of stock 2 and vice versa when the spread gets high. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;/p&gt;&#xA;&#xA;&lt;p&gt;~~~~~~~~~~~~~~~~  The problem ~~~~~~~~~~~~~~~~~~~~~~~&lt;/p&gt;&#xA;&#xA;&lt;p&gt;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I am testing an awful lot of stock pairs, I obtain a lot of output. Quite often, however, I receive output where the estimated beta_1 and beta_2 are of the same sign, e.g.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;beta_1= -1.4&lt;/p&gt;&#xA;&#xA;&lt;p&gt;beta_2= -3.9&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I normalize these according to beta_1, I get: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;beta_1 = 1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;beta_2 = 2.728&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The current pairs trading literature doesn't mention any cases where the betas are of the same sign - how should it be interpreted? Since this is pairs trading, I am supposed to long one stock and short the other when the spread deviates from its long run mean. However, when the betas are of the same sign, to me it seems that I should always go long/short in both at the same time? Is this the correct interpretation? Or should I modify the way in which I normalize the coefficients? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could really use some help...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EXTRA QUESTION: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under some of my tests, I reject both the hypothesis of r=0 cointegration relationships and r&amp;lt;=1 cointegration relationships. I find this very mysterious, as I am only considering two variables at a time, and there can, at maximum, only be r=1 cointegration relationship. Can anyone tell me what this means?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All the best, &#xA;Johan&lt;/p&gt;&#xA;" OwnerUserId="16723" LastActivityDate="2016-11-10T17:40:17.650" Title="Johansen test on two stocks (for pairs trading) yielding annoying results" Tags="&lt;trading&gt;&lt;cointegration&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18582" PostTypeId="1" CreationDate="2015-06-30T10:13:42.040" Score="3" ViewCount="4518" Body="&lt;p&gt;I have a system that I use intraday that works great on SPY. Due to the extra leverage available plus other benefits I am thinking about trading the system using ES. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a conversion factor that can be used to convert SPY prices to ES prices? What other factors would I have to take account for before using a system that works well on SPY on the ES?&lt;/p&gt;&#xA;" OwnerUserId="16727" LastActivityDate="2015-11-03T22:54:51.730" Title="Conversion of SPY prices to ES prices" Tags="&lt;futures&gt;&lt;derivatives&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18583" PostTypeId="2" ParentId="74" CreationDate="2015-06-30T10:24:55.920" Score="1" Body="&lt;p&gt;I really don't know that this will work for you or not but &lt;a href=&quot;http://samoasky.software.informer.com&quot; rel=&quot;nofollow&quot;&gt;OptionsOracle&lt;/a&gt; tool is worth a try !!&#xA;This is the one of the best Stock options strategy trading analysis tool provided free . The code is accessible at &lt;a href=&quot;http://sourceforge.net/projects/optionsoracle/&quot; rel=&quot;nofollow&quot;&gt;SourceForge&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16726" LastActivityDate="2015-06-30T10:24:55.920" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18584" PostTypeId="1" CreationDate="2015-06-30T11:55:58.697" Score="4" ViewCount="637" Body="&lt;p&gt;Did someone know how to discretize this process efficiently :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dX(t) = \kappa [\theta(t)-X(t)]dt + \sigma \sqrt{X(t)}dW(t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for something more sophisticated than the trivial Euler Schema :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X(t_{k+1}) =X(t_{k}) + \kappa[\theta(t_k)-X(t_{k})]\Delta t + \sigma \sqrt{X(t_{k})}\Delta_k W$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance,&lt;/p&gt;&#xA;" OwnerUserId="3571" LastActivityDate="2015-07-03T14:58:59.963" Title="Extended CIR and discretization" Tags="&lt;stochastic-processes&gt;&lt;simulations&gt;&lt;hullwhite&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18585" PostTypeId="1" CreationDate="2015-06-30T12:36:32.340" Score="3" ViewCount="38" Body="&lt;p&gt;What are worth conferences for credit portfolio managers? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I appreciate your recommendations!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS:I am aware that this question is not the typical quant.SE question, BUT I couldn`t find reliable information about this subject.&lt;/p&gt;&#xA;" OwnerUserId="5414" LastActivityDate="2015-06-30T12:36:32.340" Title="conferences for credit portfolio managers" Tags="&lt;risk&gt;&lt;portfolio-management&gt;&lt;risk-management&gt;&lt;credit-risk&gt;&lt;soft-question&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18586" PostTypeId="2" ParentId="18584" CreationDate="2015-06-30T13:36:17.970" Score="5" Body="&lt;p&gt;&lt;strong&gt;Milstein Scheme&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This scheme is described in Glasserman (2003) and in Kloeden and Platen (1992)&#xA;for general processes.Hence, for simplicity, we can assume that the Stochastic Process is driven by the SDE&#xA;\begin{align}&#xA;&amp;amp;dX_t=\Xi(t,X_t)dt+\Sigma(t,X_t)dW_t\\&#xA;\end{align}&#xA;Milstein discretization is,&#xA;\begin{align}&#xA;dX_{t+\Delta t}=X_t+\Xi(t,X_t)dt+\Sigma(t,X_t)\sqrt{\Delta t}\,Z+\frac{1}{2}\Sigma(t,X_t)\frac{\partial\Sigma(t,X_t)}{\partial X_t}\Delta t(Z^2-1)&#xA;\&#xA;\end{align}&#xA;where Z is is a standard normal variable.The coefficients of C.I.R process are&#xA;\begin{align}&#xA;\Xi(t,X_t) = \kappa(\theta(t) − X_t)&#xA;\end{align}&#xA;and&#xA;\begin{align}&#xA;\Sigma(t,X_t) = \sigma\sqrt X_t&#xA;\end{align}&#xA;by application of Milstein scheme,we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;dX_{t+\Delta t}=X_t+\kappa(\theta(t) − X_t)\Delta t+\sigma\sqrt{\Delta t \,X_t}\,Z+\frac{1}{4}\sigma^2\Delta t(Z^2-1)&#xA;\end{align}&#xA;Other Methods as follow&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ssrn.com/abstract=1153950&quot; rel=&quot;nofollow&quot;&gt;Transformed volatility scheme&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www2.math.uni-wuppertal.de/~kahl/publications/FastStrongApproximationMonteCarloSchemesForStochasticVolatilityModels.pdf&quot; rel=&quot;nofollow&quot;&gt;IJK Scheme&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.ressources-actuarielles.net/EXT/ISFA/1226.nsf/0/1826b88b152e65a7c12574b000347c74/$FILE/LeifAndersenHeston.pdf&quot; rel=&quot;nofollow&quot;&gt;Quadratic exponential method&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerDisplayName="user16651" LastEditorUserId="11678" LastEditDate="2015-07-03T14:58:59.963" LastActivityDate="2015-07-03T14:58:59.963" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18587" PostTypeId="2" ParentId="18421" CreationDate="2015-06-30T14:09:32.767" Score="1" Body="&lt;p&gt;There are three main issues. As per my comment, one is the lack of specification for the distribution of the jumps (I'll assume that there is a $J_0 = 0$ at time 0 (otherwise, the process doesn't account for no jumps). Unless $P (J \leq -1) = 0$, your price process is problematic, and the Girsanov theorem is not applicable. To see why:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_t = S_0 e^{\sigma W_t + (\nu - \frac{\sigma^2}{2}) t} \prod_{i=1}^N (1 + J_i) \\&#xA;= S_0 e^{\sigma W_t + (\nu - \frac{\sigma^2}{2}) t + \sum_{i=1}^N \log (1 + J_i)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously, the Radon-Nikodym derivative cannot be derived unless $(1 + J_i) \gt 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming a proper distribution for the jumps, the second issue concerns your risk-neutral measure. Assuming that you're using $W_t$ rather than another brownian motion for the sake of simplicity, your new measure doesn't seem to take into account the jumps, and it is by no means certain that you're dealing with a martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, there is an issue when going from the expectation on the number of jumps to the probability of $n$ jumps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P = E_{\mathbb{Q}} \left[ E_{\mathbb{Q}} \left[ (k - X_T \prod_{i = 0}^n (1 + J_i))^+ \mid N_T - N_t = n \right] \right] \\ = \sum_{n = 0}^\infty P_{\mathbb{Q}} (N_T - N_t = n) E_{\mathbb{Q}} \left[ (k - X_T \prod_{i = 0}^n (1 + J_i))^+ \right]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $X_T$ is obviously the price process without the jumps. While the expectation can be calculated using BS (with the proper risk-neutral measure), the unboundedness on the number of jumps can be problematic, though a truncation can give a reasonable approximation.&lt;/p&gt;&#xA;" OwnerUserId="15336" LastEditorUserId="15336" LastEditDate="2015-07-01T11:47:33.423" LastActivityDate="2015-07-01T11:47:33.423" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18588" PostTypeId="1" AcceptedAnswerId="18590" CreationDate="2015-06-30T14:34:01.770" Score="4" ViewCount="176" Body="&lt;p&gt;According to &lt;a href=&quot;https://www.math.ucdavis.edu/~hunter/m280_09/ch5.pdf&quot; rel=&quot;nofollow&quot;&gt;these notes&lt;/a&gt; (top of p 133), &quot;We say that random variables $X_1, X_2, \ldots X_n : \Omega \to \mathbb{R}$ are jointly continuous if there is a joint probability density function $p(x_1, x_2, \ldots, x_n)$ such that&#xA;$$&#xA;P(\{X_1 \in A_1, X_2 \in A_2,\ldots, X_n \in A_n\}) =&#xA;\int_A p (x_1, x_2,\ldots, x_n) dx_1dx_2\ldots dx_n.&#xA;$$&#xA;where $A = A_1 \times A_2 \times \cdots \times A_n$.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems like we can only measure &quot;rectangle&quot; Borel subsets of $\mathbb{R}^n$.  What about sets like $\{X &amp;lt; Y\}$?  It seems like I wouldn't be able to measure such sets...Clearly, I'm misunderstanding something.&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2015-07-06T13:56:38.423" Title="Joint probability distribution only measures product sets?" Tags="&lt;probability&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18589" PostTypeId="1" AcceptedAnswerId="18592" CreationDate="2015-06-30T14:48:27.927" Score="7" ViewCount="2880" Body="&lt;p&gt;Let $\{N_t\,|\,0\leq t\leq T\}$ be a Poisson process with intensity $\lambda&amp;gt;0$ defined on the probability space $(\Omega,\mathcal{F}_t,P)$ with respect to the filtration $\mathcal{F}_t$ and &#xA;\begin{align}&#xA;X_t=e^{(\lambda-\eta)\,t}\,\left(\frac{\eta}{\lambda}\right)^{N_t},&#xA;\end{align}&#xA;where $\eta&amp;gt;0$.How can I obtain $dX_t$?&lt;/p&gt;&#xA;" OwnerDisplayName="user16692" LastActivityDate="2018-07-02T13:32:29.547" Title="Ito's formula for Jump process" Tags="&lt;stochastic-processes&gt;&lt;poisson&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18590" PostTypeId="2" ParentId="18588" CreationDate="2015-06-30T14:56:39.900" Score="2" Body="&lt;p&gt;Let's try to define the solution first&#xA;$$&#xA;P[\{X&amp;lt; Y\}] = \int_{-\infty}^\infty \int_{-\infty}^y f_{(X,Y)}(x,y) dx dy,&#xA;$$&#xA;and the set over which we integrate can not be written as the product of two sets as defined there. &#xA;So: we can measure other sets as well. We can calculate probabilities but the author seems to use a definition of continuous random variables that if &#xA;$A$ is product of sets then there is a density (p).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think this statement is just the definition of the density of continuous rvs and not a statement about which sets we can measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way to read it is if $A$ is of the product form and if we can write the above formula with some $p$, then we call $p$ a density. That's the statement.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-06-30T15:07:13.830" LastActivityDate="2015-06-30T15:07:13.830" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18591" PostTypeId="1" AcceptedAnswerId="18603" CreationDate="2015-06-30T15:18:45.020" Score="4" ViewCount="207" Body="&lt;p&gt;The source code for Margarble's formula in QuantLib is &lt;a href=&quot;https://github.com/lballabio/quantlib/blob/2a5c086844775b6c1b986df2a5631d2ba3b1e6a4/QuantLib/ql/experimental/exoticoptions/analyticeuropeanmargrabeengine.cpp&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. The implementation requires a forward price be computed:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    Real forward1 = process1_-&amp;gt;stateVariable()-&amp;gt;value() *&#xA;        dividendDiscount1 / riskFreeDiscount;&#xA;    Real forward2 = process2_-&amp;gt;stateVariable()-&amp;gt;value() *&#xA;        dividendDiscount2 / riskFreeDiscount;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why do we have to calculate the forward price? Margrable's formula explicity states that risk-free interest rate is not assumed because we can price the option under a stock measure. The formula in the original paper and wikipedia doesn't require it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    Real d1 = (std::log((quantity1*forward1)/(quantity2*forward2))&#xA;               + 0.5*variance) / stdDev;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If one of the dividends is zero, we would get into a situation of log(0). Where do the extra terms that not shown come from? &lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="36636" LastEditDate="2020-07-14T22:51:00.273" LastActivityDate="2020-07-14T22:51:00.273" Title="Why risk-free interest is needed for Margrabe's Formula?" Tags="&lt;options&gt;&lt;quantlib&gt;&lt;pricing&gt;&lt;margrabes-formula&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18592" PostTypeId="2" ParentId="18589" CreationDate="2015-06-30T15:49:56.187" Score="6" Body="&lt;p&gt;By Ito's lemma,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;dX_t=\frac{\partial X_t}{\partial t}dt+\frac{\partial X_t}{\partial N(t)}dN_t+\frac{1}{2!}\frac{\partial^2 X_t}{\partial N^2_t}(dN_t)^2+\frac{\partial^2 X_t}{\partial N_t\partial t}{}dN_tdt+\frac{1}{3!}\frac{\partial^3 X_t}{\partial N^3_t}(dN_t)^3+...&#xA;\end{align}&#xA;Since $dN_t\,dt = 0, (dN_t)^2 = (dN_t)^3 = . . . = dN_t$, we have&#xA;\begin{align}&#xA;dX_t=\frac{\partial X_t}{\partial t}dt+\left(\frac{\partial X_t}{\partial N_t}+\frac{1}{2!}\frac{\partial^2 X_t}{\partial N^2_t}+\frac{1}{3!}\frac{\partial^3 X_t}{\partial N^3_t}+...\right)dN_t.&#xA;\end{align}&#xA;On the other hand&#xA;\begin{align}&#xA;&amp;amp;\frac{\partial X_t}{\partial t}=(\lambda-\eta)\,X_t\\&#xA;&amp;amp;\frac{\partial^n X_t}{\partial N_t^n}=\left[\ln \left(\frac{\eta}{\lambda}\right)\right]^nX_t,\\&#xA;\end{align} &#xA;therefore&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;dX_t=(\lambda-\eta)\,X_tdt+\sum_{n=1}^{\infty}\frac{1}{n!}\left[\ln \left(\frac{\eta}{\lambda}\right)\right]^nX_t\,dN_t&#xA;\end{align}&#xA;We know $\sum_{n=1}^{\infty}\frac{1}{n!}\left[\ln \left(\frac{\eta}{\lambda}\right)\right]^n=exp\left(\ln \left(\frac{\eta}{\lambda}\right)\right)-1=\frac{\eta}{\lambda}-1=\frac{\eta-\lambda}{\lambda}$ thus we have&#xA;\begin{align}&#xA;dX_t=(\lambda-\eta)\,X_tdt+\frac{\eta-\lambda}{\lambda}X_t\,dN_t&#xA;\end{align}&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorUserId="31903" LastEditDate="2018-07-02T13:32:29.547" LastActivityDate="2018-07-02T13:32:29.547" CommentCount="8" ContentLicense="CC BY-SA 4.0" />
  <row Id="18593" PostTypeId="1" CreationDate="2015-06-30T18:06:27.903" Score="6" ViewCount="6982" Body="&lt;p&gt;Is there a definite list of momentum indicators? &lt;a href=&quot;https://www.google.com/search?q=list%20of%20momentum%20indicators&amp;amp;ie=utf-8&amp;amp;oe=utf-8&quot; rel=&quot;noreferrer&quot;&gt;A quick search on Google did not yield much&lt;/a&gt;, so I thought to ask this here.&lt;/p&gt;&#xA;" OwnerUserId="1764" LastActivityDate="2015-07-01T08:48:32.810" Title="List of momentum indicators" Tags="&lt;indicator&gt;&lt;momentum&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="18594" PostTypeId="2" ParentId="18593" CreationDate="2015-06-30T18:50:53.863" Score="5" Body="&lt;p&gt;The following paper gives you a range of different indicators and methods and, even better, unifies the whole concept:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2603731&quot; rel=&quot;noreferrer&quot;&gt;Which Trend Is Your Friend?&lt;/a&gt;&lt;br&gt;&#xA;by Levine, A., Pedersen, L.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Abstract&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Managed-futures funds (sometimes called CTAs) trade predominantly on&#xA;  trends. There are several ways of identifying trends, either using&#xA;  heuristics or statistical measures often called “filters.” Two&#xA;  important statistical measures of price trends are time series&#xA;  momentum and moving average crossovers. We show both empirically and&#xA;  theoretically that these trend indicators are closely connected. In&#xA;  fact, they are equivalent representations in their most general forms,&#xA;  and they also capture many other types of filters such as the HP&#xA;  filter, the Kalman filter, and all other linear filters. Further, we&#xA;  show how trend filters can be equivalently represented as functions of&#xA;  past prices vs. past returns. Our results unify and broaden a range of&#xA;  trend-following strategies and we discuss the implications for&#xA;  investors.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="12" LastActivityDate="2015-06-30T18:50:53.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18595" PostTypeId="1" AcceptedAnswerId="18600" CreationDate="2015-06-30T19:02:39.233" Score="4" ViewCount="747" Body="&lt;p&gt;Let $(\Omega,\mathcal{F},P)$ be a probability space and  $\{W_t ∶ t ≥ 0\}$ be a standard&#xA;Wiener process. By setting $\tau$ as a stopping time and defining&#xA;\begin{align}&#xA;W^*(t)=\Big\{\matrix{W_t\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,,t\leq\tau\cr2 W_{\tau}-W_t\,\,,\,t&amp;gt;\tau}&#xA;\end{align}&#xA;Why $W^*(t)$ is standard Wiener process?&#xA;I want to solve it by Reflection Principle.is it Correct?Please help me&lt;/p&gt;&#xA;" OwnerDisplayName="user16731" LastActivityDate="2015-07-02T07:14:31.337" Title="Reflection Principle" Tags="&lt;stochastic-processes&gt;&lt;wiener&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18597" PostTypeId="2" ParentId="18595" CreationDate="2015-06-30T20:04:31.890" Score="2" Body="&lt;p&gt;First note that paths are a.s continuous.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then by strong Markov property and reflection principle, $(W_\tau - W_t)$ is a Brownian motion independant of the before tau part.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you can verify that increments are independent and gaussian by decomposing them in before and after tau part.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or you can décompose the quadratic variation and use Lévy 's characterization.&lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2015-06-30T20:04:31.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18598" PostTypeId="1" AcceptedAnswerId="18677" CreationDate="2015-06-30T20:55:14.270" Score="1" ViewCount="749" Body="&lt;p&gt;What is type of Operating income to total assets ratio? Leverage, Profitability, Asset composition or Liquidity? and why?&lt;/p&gt;&#xA;" OwnerUserId="8234" LastActivityDate="2015-07-04T15:32:05.723" Title="What is type of Operating income to total assets ratio?" Tags="&lt;ratio&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2015-07-11T05:48:38.390" ContentLicense="CC BY-SA 3.0" />
  <row Id="18599" PostTypeId="2" ParentId="18589" CreationDate="2015-06-30T21:29:26.173" Score="7" Body="&lt;p&gt;Write $X_t = A_t B_t$ with $A_t = e^{(\lambda - \eta)t}$ and $B_t = \left(\frac{\eta}{\lambda} \right)^{N_t}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then $dX_t = A_t dB_t + B_t dA_t$ by the product rule of calculus.  There are no second order terms since both $A_t$ and $B_t$ are finite variation (i.e. $\langle A_t, B_t\rangle$= 0).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next, $dA_t = (\lambda - \eta)A_t dt$, and $dB_t = B_t \cdot \left(\frac{\eta}{\lambda} - 1\right)dN_t$.  The form of $dA_t$ follows from normal calculus, and the form of $dB_t$ follows from subtracting before and after values of the jump process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the two paragraphs above, we get $$dX_t = A_tB_t \left( \left(\frac{\eta}{\lambda} - 1 \right)dN_t + (\lambda - \eta)dt\right) = X_t\left( \left(\frac{\eta}{\lambda} - 1 \right)dN_t + (\lambda - \eta)dt\right).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit for @Behrouz:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dB_t = \left(\frac{\eta}{\lambda}\right)^{N_t} - \left(\frac{\eta}{\lambda}\right)^{N_{t-}}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When $N_t$ does not jump, this value is zero.  When $N_t$ does jump, it is equal to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\left(\frac{\eta}{\lambda}\right)^{N_t} - \left(\frac{\eta}{\lambda}\right)^{N_{t} - 1}&#xA;= B_{t-}\left(\frac{\eta}{\lambda} - 1 \right)dN_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So actually in my original answer, I should have minuses for left hand limits to be technically correct.&lt;/p&gt;&#xA;" OwnerUserId="3415" LastEditorUserId="3415" LastEditDate="2015-06-30T21:45:18.900" LastActivityDate="2015-06-30T21:45:18.900" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="18600" PostTypeId="2" ParentId="18595" CreationDate="2015-06-30T22:46:55.603" Score="0" Body="&lt;p&gt;If $\tau$ is finite then from the strong Markov property both the paths $X_t = \{W_{t+\tau} −W_\tau ∶ t\geq 0\}$ and $−X_t = \{−(W_{t+\tau} − W_\tau) ∶ t \geq 0\}$ are standard Wiener processes and independent of $Y_t = \{W_t ∶ 0 \leq t \leq \tau\}$, and hence both $(X_t, Y_t)$ and $(X_t ,−Y_t)$ have the same distribution. Given the two processes defined on $[0, \tau]$ and $[0, \infty)$, respectively, we can paste them together as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;(Y,X)\rightarrow\{\,(X_{t-\tau}+W_t)1_{\{t&amp;gt;\tau\}}+Y_t 1_{\{t\leq\tau\}}+:t\geq0\}&#xA;\end{align}&#xA;Thus, the process arising from pasting $Y_t$ to $X_t$ has the same distribution ,which is $\{W_t ∶ t \geq 0\}$.In contrast, the process arising from pasting $Y_t$ to $-X_t$ is $\{W_t^* ∶ t ≥ 0\}$.Thus,$\{W_t^* ∶ t ≥ 0\}$ is also a standard Wiener process.&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2015-07-02T07:14:31.337" LastActivityDate="2015-07-02T07:14:31.337" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18601" PostTypeId="1" AcceptedAnswerId="18631" CreationDate="2015-06-30T23:28:43.543" Score="-1" ViewCount="91" Body="&lt;p&gt;On the Federal Reserve of St. Louis FRED website we can find the 10-year government bond yields: &lt;a href=&quot;https://research.stlouisfed.org/fred2/data/IRLTLT01USM156N.txt&quot; rel=&quot;nofollow&quot;&gt;https://research.stlouisfed.org/fred2/data/IRLTLT01USM156N.txt&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I chose monthly frequency and percent units. I'm wondering if the yields are quoted annually even though they have a monthly frequency.&lt;/p&gt;&#xA;" OwnerUserId="12214" LastActivityDate="2015-07-02T09:36:24.057" Title="Long-Term Government Bond Yields" Tags="&lt;data&gt;&lt;bond-yields&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18602" PostTypeId="1" AcceptedAnswerId="18622" CreationDate="2015-06-30T23:51:49.140" Score="4" ViewCount="11870" Body="&lt;p&gt;I would like to have a bit more of intuition about the concept of &quot;speed of mean reversion&quot; for an interest rate model, e.g. Vasicek or CIR. In particular, is a negative speed of mean reversion possible? What's the connection between a mean reverting process and an AR(1) process? Does explosive AR(1) imply negative speed of mean reversion? &lt;/p&gt;&#xA;" OwnerUserId="12214" LastActivityDate="2015-07-02T11:12:58.680" Title="Speed of mean reversion of an interest rate model" Tags="&lt;time-series&gt;&lt;interest-rates&gt;&lt;stochastic-processes&gt;&lt;mean-reversion&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="18603" PostTypeId="2" ParentId="18591" CreationDate="2015-07-01T00:09:24.147" Score="2" Body="&lt;p&gt;you don't need the risk-free rate, it's just the way it's been implemented. It will cancel out when you take the ratio of the forwards. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-07-01T00:09:24.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18604" PostTypeId="2" ParentId="18556" CreationDate="2015-07-01T01:10:49.403" Score="1" Body="&lt;p&gt;When an exchange (or ECN) receives an order, there is no identifier of the buyer or seller.  Therefore the only place that this is available is at the broker themselves.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No broker would be willing to provide this information even on an anonymized basis and it would be a violation of other laws and regulations (such as Regulation S-P).&#xA;&lt;a href=&quot;https://www.law.cornell.edu/cfr/text/17/part-248/subpart-A&quot; rel=&quot;nofollow&quot;&gt;https://www.law.cornell.edu/cfr/text/17/part-248/subpart-A&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FINRA has a whole stack of documents relating to Customer Information Protection and broker requirements in this area:&#xA;&lt;a href=&quot;http://www.finra.org/industry/issues/customer-information-protection&quot; rel=&quot;nofollow&quot;&gt;http://www.finra.org/industry/issues/customer-information-protection&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13859" LastActivityDate="2015-07-01T01:10:49.403" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18605" PostTypeId="1" AcceptedAnswerId="21840" CreationDate="2015-07-01T02:39:37.353" Score="4" ViewCount="219" Body="&lt;p&gt;I am able to calculate the money-weighted return (XIRR equivalent in Excel) of my portfolio. Whilst I can compare this with ‘headline’ returns of ETF’s, Mutual Funds etc, I want to isolate the timing of my cashflows from my choice of investments. In other words, I want to see if I would have been better making my investment timing decisions and investing in the benchmark rather than investing in my own choice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The difficulty seems to be that if I apply the same cashflows to benchmark the benchmark itself can be very misrepresentative – for example, if I have outperformed the benchmark, then make a cashflow deduction from my portfolio and try and replicate this in the benchmark (with the same dollar amount) then the benchmark return itself may go negative.&#xA;Is there a common approach to this?&lt;/p&gt;&#xA;" OwnerUserId="2034" LastActivityDate="2017-01-13T09:53:29.433" Title="Comparing a money-weighted return of my own portfolio with a benchmark ETF/other portfolio that is subject to the same cashflows" Tags="&lt;returns&gt;&lt;benchmark&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18606" PostTypeId="2" ParentId="422" CreationDate="2015-07-01T06:02:00.223" Score="0" Body="&lt;p&gt;On ratedata.gaincapital.com you can find about 150 GB of FX tick data.&#xA;The data is split into zipped weekly .csv files.&#xA;You can write a script downloading, unpacking and merging the .csv files as i did. Works fine.&lt;/p&gt;&#xA;" OwnerUserId="15684" LastActivityDate="2015-07-01T06:02:00.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18608" PostTypeId="2" ParentId="18556" CreationDate="2015-07-01T07:22:38.233" Score="0" Body="&lt;p&gt;I've read a paper from an asian institute on trader's profitability. Unfortunately I can't find it anymore. They had such order data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe it is easier to get such information in less regulated markets. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I couldn't find anything useful there yet.&lt;/p&gt;&#xA;" OwnerUserId="15684" LastEditorUserId="15684" LastEditDate="2015-07-01T13:03:26.023" LastActivityDate="2015-07-01T13:03:26.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18609" PostTypeId="1" AcceptedAnswerId="18611" CreationDate="2015-07-01T07:50:36.023" Score="6" ViewCount="1584" Body="&lt;p&gt;I am using for now the package &lt;code&gt;fOptions&lt;/code&gt; but it doesn't allow for vectorized computation of black76 prices and delta.&#xA;Which package can be used to do that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As noted by @Richard, I could use &lt;code&gt;lapply&lt;/code&gt;, but it is actually looping in R, which is slow (at least too slow for me). I am looking for a package that has a compiled loop, ie that provides a native vectorized function. &lt;/p&gt;&#xA;" OwnerUserId="134" LastEditorUserId="134" LastEditDate="2015-07-01T08:02:47.187" LastActivityDate="2015-07-01T08:18:01.290" Title="good R package for vectorized option pricing" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;r&gt;&lt;black76&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18610" PostTypeId="2" ParentId="18609" CreationDate="2015-07-01T07:57:32.170" Score="0" Body="&lt;p&gt;if you put all your option objects into a list then you can use &lt;code&gt;lapply&lt;/code&gt;. Read the documentation or just &lt;a href=&quot;https://rollingyours.wordpress.com/category/r-programming-apply-lapply-tapply/&quot; rel=&quot;nofollow&quot;&gt;thist post&lt;/a&gt; for details.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-07-01T07:57:32.170" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18611" PostTypeId="2" ParentId="18609" CreationDate="2015-07-01T08:18:01.290" Score="4" Body="&lt;p&gt;Answering my own question as it could be useful for others.&#xA;Actually package &lt;code&gt;fOptions&lt;/code&gt; is vectorized. The only constraint (and that make sense) is that you can't compute at the same time 2 different greeks, or mix up calls and puts. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So assuming that you want to compute the delta of a set of puts, the code will be the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;fOptions::GBSGreeks(Selection = &quot;Delta&quot;,&#xA;                    TypeFlag=&quot;p&quot;,&#xA;                    S=c(100,100)+1:2, &#xA;                    X=c(100,100), &#xA;                    Time=c(0.1,0.2),&#xA;                    r=c(0,0), &#xA;                    b=c(0,0), &#xA;                    sigma=c(0.2,0.2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which returns the same (that's the validation) as the output of &lt;code&gt;mapply&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mapply(FUN       = fOptions::GBSGreeks,&#xA;       Selection = c(&quot;Delta&quot;,&quot;Delta&quot;),&#xA;       TypeFlag=c(&quot;p&quot;,&quot;p&quot;),&#xA;       S=c(100,100)+1:2, &#xA;       X=c(100,100),&#xA;       Time=c(0.1,0.2),&#xA;       r=c(0,0), &#xA;       b=c(0,0), &#xA;       sigma=c(0.2,0.2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;nice...&lt;/p&gt;&#xA;" OwnerUserId="134" LastActivityDate="2015-07-01T08:18:01.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18612" PostTypeId="2" ParentId="18593" CreationDate="2015-07-01T08:48:32.810" Score="4" Body="&lt;p&gt;I think, the following list answers your question. Even  though the below list is exhaustive, there might be some recent changes. Try looking for additional sources, you might find some more useful information. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;ADX  Average Directional Movement Index  &lt;/li&gt;&#xA;&lt;li&gt;ADXR Average Directional   Movement Index Rating  &lt;/li&gt;&#xA;&lt;li&gt;APO  Absolute Price Oscillator  &lt;/li&gt;&#xA;&lt;li&gt;AROON    Aroon&lt;/li&gt;&#xA;&lt;li&gt;AROONOSC Aroon Oscillator &lt;/li&gt;&#xA;&lt;li&gt;BOP  Balance Of Power &lt;/li&gt;&#xA;&lt;li&gt;CCI  Commodity Channel    Index &lt;/li&gt;&#xA;&lt;li&gt;CMO  Chande Momentum Oscillator &lt;/li&gt;&#xA;&lt;li&gt;DX   Directional Movement Index&lt;/li&gt;&#xA;&lt;li&gt;MACD Moving Average Convergence/Divergence &lt;/li&gt;&#xA;&lt;li&gt;MACDEXT  MACD with    controllable MA type &lt;/li&gt;&#xA;&lt;li&gt;MACDFIX  Moving Average Convergence/Divergence Fix 12/26 &lt;/li&gt;&#xA;&lt;li&gt;MFI  Money Flow Index &lt;/li&gt;&#xA;&lt;li&gt;MINUS_DI Minus Directional Indicator&lt;/li&gt;&#xA;&lt;li&gt;MINUS_DM Minus Directional Movement &lt;/li&gt;&#xA;&lt;li&gt;MOM  Momentum &lt;/li&gt;&#xA;&lt;li&gt;PLUS_DI  Plus    Directional Indicator &lt;/li&gt;&#xA;&lt;li&gt;PLUS_DM  Plus Directional Movement&lt;/li&gt;&#xA;&lt;li&gt;PPO  Percentage Price Oscillator &lt;/li&gt;&#xA;&lt;li&gt;ROC  Rate of change :&lt;/li&gt;&#xA;&lt;li&gt;ROCP Rate of change Percentage:&lt;/li&gt;&#xA;&lt;li&gt;ROCR Rate of change ratio:&lt;/li&gt;&#xA;&lt;li&gt;ROCR100  Rate of change ratio 100 scale:&lt;/li&gt;&#xA;&lt;li&gt;RSI  Relative Strength Index &lt;/li&gt;&#xA;&lt;li&gt;STOCH    Stochastic&lt;/li&gt;&#xA;&lt;li&gt;STOCHF   Stochastic Fast &lt;/li&gt;&#xA;&lt;li&gt;STOCHRSI Stochastic Relative Strength Index&lt;/li&gt;&#xA;&lt;li&gt;TRIX 1-day Rate-Of-Change (ROC) of a Triple Smooth EMA&lt;/li&gt;&#xA;&lt;li&gt;ULTOSC   Ultimate Oscillator &lt;/li&gt;&#xA;&lt;li&gt;WILLR    Williams' %R     &lt;/li&gt;&#xA;&lt;li&gt;ASI  Accumulative Swing Index &lt;/li&gt;&#xA;&lt;li&gt;ADR  Advance Decline Ratio &lt;/li&gt;&#xA;&lt;li&gt;IMI  Intraday Momentum Index&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="6799" LastActivityDate="2015-07-01T08:48:32.810" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18613" PostTypeId="1" CreationDate="2015-07-01T09:01:35.917" Score="8" ViewCount="492" Body="&lt;p&gt;I have the following system of SDE's&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ dA_t = \kappa_A(\bar{A}-A_t)dt + \sigma_A \sqrt{B_t}dW^A_t \\&#xA;dB_t = \kappa_B(\bar{B} - B_t)dt + \sigma_B \sqrt{B_t}dW^B_t $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $\sigma_B &amp;gt; \sigma_A$ I would consider the volatility $B_t$ to be more volatile than $A_t$ because &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ d\langle A_\bullet\rangle_t = \sigma_A^2 B_t  dt$ and $ d\langle B_\bullet\rangle_t = \sigma_B^2 B_t  dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if I rescale the process $B$ by $\sigma_A^2$ and define $\sigma_A^2B =\tilde{B}$, I get the an equivalent system of SDE's&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ dA_t = \kappa_A(\bar{A}-A_t)dt + \sqrt{\tilde{B}_t}dW^A_t \\&#xA;d\tilde{B}_t = \kappa_B(\sigma_A^2\bar{B} - \tilde{B}_t)dt + \sigma_A\sigma_B \sqrt{\tilde{B}_t}dW^B_t $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But now the claim &quot;If $\sigma_B &amp;gt; \sigma_A$ I would consider the volatility $\tilde{B}_t$ to be more volatile than $A_t$&quot; does not hold anymore. Consider $1&amp;gt;\sigma_B&amp;gt;\sigma_A$ and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ d\langle A_\bullet\rangle_t = \tilde{B}_t  dt$ and $ d\langle \tilde{B}_\bullet\rangle_t = \sigma_A^2\sigma_B^2 \tilde{B}_t  dt$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case the volatility $\tilde{B}$ of $A$ is more volatile than $A$ only if $\sigma_A^2\sigma_B^2&amp;gt;1$, which is completely different from the condition above (i.e., $\sigma_B &amp;gt; \sigma_A$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What went wrong? Is there some error in the rescalling? &lt;/p&gt;&#xA;" OwnerUserId="6640" LastEditorUserId="11678" LastEditDate="2017-04-13T12:20:51.247" LastActivityDate="2018-01-08T16:46:25.503" Title="Stochastic Calculus Rescale Exercise" Tags="&lt;stochastic-calculus&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18614" PostTypeId="2" ParentId="620" CreationDate="2015-07-01T12:58:52.853" Score="2" Body="&lt;p&gt;In optimiazation system, you have to weight the price for the different maturities in a way that reflect your confidence in each data point (influenced by liquidity). One way to do so is to weight, each price by its Black-Scholoes Vega (see Tankov (2003)). So when minimazing the squared differences of the sum your weighted option prices, you can use the following approximation (in term of call price).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \sum_{i=1}^{N} w_i (C^\theta(T_i,K_i)-C(T_i,K_i))^2=\sum_{i=1}^{N} \frac{ (C^\theta(T_i,K_i)-C(T_i,K_i))^2}{ \text{Vega}_i^2(T_i,K_i)}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The advantage of this method is that the option prices scaled by its vega is approximately equal to its implied volatility and implied volatility are more uniform across maturity and strike than option prices.&#xA; As a proof, you can apply a taylor approximation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C^\theta\approx C+\text{Vega}_{BS}(\sigma^\theta-\sigma_{BS}) \Leftrightarrow \frac{C^\theta-C}{Vega}\approx (\sigma^\theta-\sigma)$$&lt;/p&gt;&#xA;" OwnerUserId="16736" LastEditorDisplayName="user16651" LastEditDate="2016-09-28T04:59:36.063" LastActivityDate="2016-09-28T04:59:36.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18615" PostTypeId="2" ParentId="18613" CreationDate="2015-07-01T13:32:46.713" Score="0" Body="&lt;p&gt;When you scale your process you set the following:&#xA;$\tilde{B}_t=f(B_t)=\sigma_A^2 B_t$&#xA;so then by means of &lt;a href=&quot;https://en.wikipedia.org/wiki/It%C5%8D&amp;#39;s_lemma&quot; rel=&quot;nofollow&quot;&gt;Ito-Lemma&lt;/a&gt;, you get,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$df(B_t)=\partial_x f(B_t)dB_t+\frac{1}{2}\partial_{x^2}f(B_t)dt=\sigma_A^2 dB_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;hence&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d\tilde{B}_t=\sigma_A^2dB_t=\sigma_A^2 \kappa(\hat{B}_t-B_T)dt+\sigma_A^2\sigma_B dW_t^B$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but you can still symplify it and nothing has change such that your condition still holds.&lt;/p&gt;&#xA;" OwnerUserId="16736" LastActivityDate="2015-07-01T13:32:46.713" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18616" PostTypeId="2" ParentId="18333" CreationDate="2015-07-01T14:34:35.880" Score="1" Body="&lt;p&gt;On a pure technical aspect, a model does not need to have a finite variance.  In the context of option pricing, what you need it a way to replicate the behaviour of the stock price. Once you have it you need to find a corresponding risk-neutral measure. There you will have the first difficulty, with infinite variance, the corresponding hedging strategy is not obious. However, as in the case of jumpe processes, you might still find a risk-neutral measure by means of min entropy for instance (see Fujiwara, Miyahara (2003)). So in theory, you can apply compute option prices using monte carlo.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other side, on a practical point of view, infinite variance distribution will cause many difficulties during the calibration of your model (simply because infinite variance are directly observable). Furthermore the standard stochastic calculs like Ito's-Lemma does not apply in this context. Infinte variance distribution model, that bring higher cost in term of complexity, should allow for better performences. However, the class of jump-diffusion processes (see Crepey (2013)) or even infinite levy process (see Tankov (2007)) are in pricipe rich enough to enable a efficient pricing (both in term of price replication as computation speed).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, in my opinion, the reason why there are not used in practice is because there are not tractable enough the outperform more classical model.&lt;/p&gt;&#xA;" OwnerUserId="16736" LastActivityDate="2015-07-01T14:34:35.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18617" PostTypeId="1" CreationDate="2015-07-01T15:27:39.317" Score="4" ViewCount="238" Body="&lt;p&gt;I am trying to add a volatility factor to Fama-French factor model. Does anybody know of a source where I can get data for &quot;volatility mimicking factor&quot; or suggest a simple methodology for calculation. &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=681343&quot; rel=&quot;nofollow&quot;&gt;(Ang, 2006)&lt;/a&gt; introduces a FVIX factor and points that change in VIX cannot be used directly. I am open to trying other volatility factors if someone has a suggestion&lt;/p&gt;&#xA;" OwnerUserId="2142" LastEditorUserId="1764" LastEditDate="2015-07-01T22:43:04.527" LastActivityDate="2015-07-02T09:40:24.760" Title="volatility factor" Tags="&lt;volatility&gt;&lt;portfolio-management&gt;&lt;factor-models&gt;&lt;fama-french&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18618" PostTypeId="2" ParentId="18556" CreationDate="2015-07-01T15:47:00.463" Score="0" Body="&lt;p&gt;I dug around and there's indeed an old publication on Risk.net written by a university professor that uses Citi's data: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The data set on which we base our analysis contains, before filtering, almost 700,000 US stock trade orders executed by Citigroup equity trading desks for the 19-month period from December 2001 to June 2003.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2015-07-01T15:47:00.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18619" PostTypeId="2" ParentId="18556" CreationDate="2015-07-01T16:04:12.580" Score="0" Body="&lt;p&gt;Yes indeed. There is a western paper which uses order data, albeit trader identification was removed.&#xA;It is obviously this one: &lt;br&gt;&#xA;&lt;a href=&quot;http://www.cims.nyu.edu/~almgren/papers/costestim.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.cims.nyu.edu/~almgren/papers/costestim.pdf&lt;/a&gt;&#xA;&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, this data wasn't public. The co-authors were senior analysts at Citi:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Robert Almgren is associate professor in the departments of&#xA;  mathematics and computer science at the University of Toronto, and&#xA;  Chee Thum, Emmanuel Hauptmann and Hong Li are senior analysts at&#xA;  Citigroup Global Quantitative Research in New York and London.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="15684" LastActivityDate="2015-07-01T16:04:12.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18622" PostTypeId="2" ParentId="18602" CreationDate="2015-07-01T17:48:08.663" Score="8" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Mean reversion speed $\kappa$ is better interpreted with the concept of half-life, which can be calculated from $\text{HL} = \ln(2) / \kappa$. For example, if the mean reversion coefficient is $\kappa = 1.5$, then the half-life of the process is $\ln(2) / 1.5 = 0.46209812$ years, or about 6 months. Let's assume that the current interest rate is 1% and the equilibrium level is 5%. Then you'd expect interest rate to travel half the distance toward the equilibrium level (i.e., 2%) in about 6 months. Generally speaking, $\kappa$ should be positive, since interest rates do not tend to explode.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It is not uncommon to estimate mean reversion speed using an AR(1) process. In the context of interest rate modeling, this procedure gives you the mean reversion speed $\kappa$ in the physical measure (&quot;real world&quot;). For derivatives pricing, however, you need $\kappa$ in the risk-neutral measure, which can be obtained by fitting the model to market prices of some benchmark instruments.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2015-07-01T17:48:08.663" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18624" PostTypeId="1" CreationDate="2015-07-01T18:34:07.463" Score="1" ViewCount="31" Body="&lt;p&gt;I am trying to calculate the rate of renewal for a large stock of Certificates of Deposit. These contracts are given on a fixed amount of time and some of them get renewed every time they reach maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought one way I could model the situation was taking the percentage of renewal every day and then making a regression to project that number but I think its not robust enough. &lt;/p&gt;&#xA;" OwnerUserId="12128" LastActivityDate="2015-07-01T18:34:07.463" Title="Calculating rate of renewal for Certificate of Deposit" Tags="&lt;regression&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18626" PostTypeId="1" CreationDate="2015-07-01T22:17:59.407" Score="3" ViewCount="467" Body="&lt;p&gt;I am very new to using stata and very new to using Garch models. I am currently doing my final dissertation for my MSc in Finance studies and regarding my topic I understood that i had to use garch to find answers to my questions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I am trying to find if natural disaster events have any effect on a daily data of composite index (time series variable). I have my two data sets. one of the composite index and I have created a few dummy variables, each one for the date that every event took place (within my time range).&#xA;Moreover, I want to include one control variable that affects the dependent variable (composite index) and I want to include it to remove any noise on my examination.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, my questions are:&#xA;1) how to include these variables, meaning where should i put the control variables and where my independents ( I am using the menu of ARCH/GARCH testing, I'm not writing code)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) I would like to examine the persistence of each event (each dummy variable) on my dependent variable. meaning that I want to check if the shock is still affecting the dependent variable up to 5 days after of its occurrence. how can I do that? give my dummy variable the value of 1 not only on the day of the occurrence of the event but on the 5 following days as well?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) finally, do you think that it is correct to create one dummy variable for each catastrophic event or one dummy variable for each type of shock (i.e. 1 for floods, 1 for storms, 1 for earthquakes etc..)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot in advance,&#xA;Evangelos&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: my work is based on this paper. (Lin Wang 2013 -  The Impact of Japanese Natural Disasters on Stock Market) &lt;a href=&quot;http://artsci.wustl.edu/~gradconf/LinWang.pdf&quot; rel=&quot;nofollow&quot;&gt;http://artsci.wustl.edu/~gradconf/LinWang.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16743" LastEditorUserId="2553" LastEditDate="2015-07-06T10:46:42.197" LastActivityDate="2015-07-10T18:13:19.677" Title="Measure the effect of a natural disaster on a stock market index" Tags="&lt;garch&gt;&lt;arch&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18627" PostTypeId="2" ParentId="18582" CreationDate="2015-07-02T02:34:50.237" Score="1" Body="&lt;p&gt;The (cash) index level is approximately 10 times the SPY price. Furthermore, for each ES contract you own you make or lose 50 USD for each 1 point change in the index future. (So for example SPY goes from 200 to 201, so SPX index goes from from 2000 to 2010, ES future goes from 1994 to 2004 (assuming a 6 point basis), if you are long 2 ES contracts you make 2*50*10 = 1000 USD. This is the same gain as if you owned 1000 shares of SPY).&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2015-11-03T22:54:51.730" LastActivityDate="2015-11-03T22:54:51.730" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18628" PostTypeId="1" CreationDate="2015-07-02T07:04:25.980" Score="3" ViewCount="77" Body="&lt;p&gt;I know how barrier options are priced in Black-Scholes scheme. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm wondering if an analytical formula exists also for range (corridor) digital options i.e. options paying only if the price remains between an up and an out barrier. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think that if the joint distribution for the minimum and the max of a Wiener is known, an analytical pricing formula should exists. Would this contain the relevant literature?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.yats.com/doc/stochastic-processes-en.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.yats.com/doc/stochastic-processes-en.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6249" LastEditorUserId="848" LastEditDate="2015-08-31T19:41:43.317" LastActivityDate="2015-08-31T19:41:43.317" Title="Range options in BS" Tags="&lt;black-scholes&gt;&lt;barrier&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18630" PostTypeId="1" CreationDate="2015-07-02T09:05:36.587" Score="2" ViewCount="453" Body="&lt;p&gt;I've been asked to re-create a spreadsheet that used RBloomberg using a different data source. But I'm having trouble figuring out exactly what one of the spreadsheet's formulas does. Can anyone tell me what exactly the following formula is calculating? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think it's something along the lines of (CurrentPrice/30dayEMA-1)*100. But I can't seem to get that calculation to match the values given by this formula. I wonder if this is caused by differences in things like whether this formula is using adjusted prices or not, when the EMA calculation starts, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;=IF($A19&amp;lt;&amp;gt;&quot;&quot;,(BDH($A19,&quot;PX_LAST&quot;,$B$7,$B$7,&quot;Days=A&quot;, &quot;Fill=P&quot;, &quot;Dts=H&quot;)/BTH($A19,&quot;EMAVG&quot;,$B$7,$B$7,&quot;EMAVG&quot;,&quot;TAPeriod=30&quot;,&quot;DSClose=PX_LAST&quot;,&quot;Dir=V&quot;,&quot;Dts=H&quot;,&quot;Sort=A&quot;,&quot;QtTyp=P&quot;,&quot;Days=T&quot;,&quot;Per=cd&quot;,&quot;UseDPDF=N&quot;, &quot;CshAdjNormal=Y&quot;,&quot;CshAdjAbnormal=Y&quot;,&quot;CapChg=Y&quot;)-1)*100,&quot;&quot;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(A19 is a security name.B7 is the current date.)&lt;/p&gt;&#xA;" OwnerUserId="16745" LastActivityDate="2015-07-02T09:05:36.587" Title="Can you tell me what this RBloomberg formula means?" Tags="&lt;statistics&gt;&lt;r&gt;&lt;bloomberg&gt;&lt;indicator&gt;&lt;moving-average&gt;" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="18631" PostTypeId="2" ParentId="18601" CreationDate="2015-07-02T09:36:24.057" Score="0" Body="&lt;p&gt;Yes, the quotes are annually. You can cross-check with these:&#xA;&lt;a href=&quot;http://www.federalreserve.gov/releases/h15/data.htm&quot; rel=&quot;nofollow&quot;&gt;http://www.federalreserve.gov/releases/h15/data.htm&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-07-02T09:36:24.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18632" PostTypeId="2" ParentId="18617" CreationDate="2015-07-02T09:40:24.760" Score="1" Body="&lt;p&gt;FVIX is not hard to compute. &#xA;Just regress changes in VIX on excess returs of your base assets (it can be the 25 FF portfolios if those are what you are trying to explain) i.e run the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\Delta VIX_t =  X_t\beta+\epsilon&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-07-02T09:40:24.760" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18634" PostTypeId="1" AcceptedAnswerId="18645" CreationDate="2015-07-02T11:08:30.220" Score="1" ViewCount="1940" Body="&lt;p&gt;Hi has anyone seen or know how to create an indicator for fractals in quantstrat?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;fractals explained&#xA;&lt;a href=&quot;http://forex-indicators.net/bill-williams/fractals&quot; rel=&quot;nofollow&quot;&gt;http://forex-indicators.net/bill-williams/fractals&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;example code (only interested in type 1 fractal)&#xA;&lt;a href=&quot;http://forexsb.com/forum/topic/68/fractals/&quot; rel=&quot;nofollow&quot;&gt;http://forexsb.com/forum/topic/68/fractals/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16748" LastActivityDate="2015-07-04T01:24:56.483" Title="Fractals indicator (Bill Williams) R Quantstrat" Tags="&lt;r&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18635" PostTypeId="1" AcceptedAnswerId="18644" CreationDate="2015-07-02T11:42:00.640" Score="2" ViewCount="416" Body="&lt;p&gt;I want to find Boundary conditions for Convertible Bond under  Two-factor Model Interest Rate.The portfolio contains stock where stochastic differential equation for the stock price is &#xA;\begin{align}&#xA;ds_t=rS_t+\sigma S_tdW_1(t)&#xA;\end{align}&#xA;where $\sigma$ is constant and dynamics of $r$ as follow&#xA;\begin{align}&#xA;dr_t=\kappa(\theta-r_t)dt+\Sigma dW_2(t)&#xA;\end{align}&lt;/p&gt;&#xA;" OwnerDisplayName="user16749" LastEditorUserId="848" LastEditDate="2016-11-10T13:54:19.563" LastActivityDate="2016-11-10T16:38:13.770" Title="Boundary Condition for Convertible Bond under Two-factor Model Interest Rate" Tags="&lt;options&gt;&lt;interest-rates&gt;&lt;bond&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18636" PostTypeId="1" AcceptedAnswerId="18670" CreationDate="2015-07-02T14:08:43.857" Score="3" ViewCount="265" Body="&lt;p&gt;At first, Lo and MacKinlay &lt;em&gt;(When are Contrarian Profits Due to Stock Market Overreaction?, 1990)&lt;/em&gt; didn't do it for momentum precisely. However,Kyung-In Park and Dongcheol Kim &lt;em&gt;(Sources of Momentum Profits in International Stock Markets, 2011)&lt;/em&gt; use it to identify and analyse the difference in the momentum effect across different countries. Here is the exact part that I would like to understand:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The purpose of this paper is to examine the differences in the&#xA;  underlying forces determining momentum profits between countries&#xA;  exhibiting and non-exhibiting the momentum phenomenon and to induce&#xA;  which component(s) drives momentum profits. In order to determine the&#xA;  underlying forces of momentum profits, we use the decomposition method&#xA;  of momentum profits by Lo and MacKinlay (1990). They decompose&#xA;  momentum profits into three components; (1) the first-order serial&#xA;  covariance of market returns, (2) the average of first-order serial&#xA;  covariances of all individual assets, and (3) the cross-sectional&#xA;  dispersion in unconditional mean returns of individual assets. The&#xA;  total momentum profit equals minus (1) plus (2) plus (3) [i.e.,&#xA;  1  2  3. That is, the first term contributes&#xA;  negatively, and the second and third terms contribute positively to&#xA;  momentum profits. The first two components reflect the intertemporal&#xA;  behavior [1  2], and the third component reflects the&#xA;  cross- sectional behavior of asset returns [3].&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;As you can see, Kim and Park have subsumed the 3 parts into 2 parts: the &lt;strong&gt;inter temporal behavior&lt;/strong&gt; and the &lt;strong&gt;cross-sectional behaviour&lt;/strong&gt; of asset returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More precisely, in the conclusion of the article we can find:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Momentum profits can be decomposed into two parts; the part reflecting&#xA;  the cross-sectional difference in unconditional expected returns and&#xA;  the part reflecting the intertemporal behavior of asset returns.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So my question can rewritten like this: what is exactly the part reflecting the &lt;strong&gt;cross-sectional difference in unconditional expected returns&lt;/strong&gt; and the part reflecting the &lt;strong&gt;intertemporal behavior of asset returns&lt;/strong&gt; ? &lt;/p&gt;&#xA;" OwnerUserId="9481" LastActivityDate="2015-07-03T20:49:10.893" Title="According to Lo and MacKinlay (1990), momentum profits can be divided in 3 parts. What do they represent exactly?" Tags="&lt;asset-pricing&gt;&lt;momentum&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18637" PostTypeId="1" AcceptedAnswerId="18640" CreationDate="2015-07-02T15:35:35.527" Score="2" ViewCount="150" Body="&lt;p&gt;Let $X$ be a random variable on a probability space $(\Omega, \mathcal{F}, P)$ and let $g$ be a Borel-measurable function on $\mathbb{R}$.  In Shreve II (p 28) he proves, using the standard machine, that&#xA;$$&#xA;\mathbb{E}(g(X)) = \int_{\mathbb{R}} g(x)\, d(P \circ X^{-1})(x),&#xA;$$&#xA;where $P \circ X^{-1}$ is the &lt;a href=&quot;https://en.wikipedia.org/wiki/Pushforward_measure&quot; rel=&quot;nofollow&quot;&gt;pushforward measure&lt;/a&gt; on $\mathbb{R}$.  He then &lt;em&gt;again&lt;/em&gt; uses the standard machine to prove that, for a continuous random variable $X$, that&#xA;$$&#xA;\mathbb{E}(g(X)) = \int_{\mathbb{R}} g(x) f(x) d\lambda(x),&#xA;$$&#xA;where $f$ is the probability density function of $X$ and $\lambda$ is the Lebesgue measure on $\mathbb{R}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, is the standard machine really necessary for this second part?  By definition of a continuous random variable, $f = \frac{d(P \circ X^{-1})}{d \lambda}$, and so&#xA;$$&#xA;\int_{\mathbb{R}} g(x)\, d(P \circ X^{-1})(x) = \int_{\mathbb{R}} g(x)f(x) d\lambda(x)&#xA;$$&#xA;since $f$ is the Radon-Nikodym derivative of $P \circ X^{-1}$ w.r.t. $\lambda$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps I am overlooking some integrability conditions?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2015-07-02T17:28:25.933" Title="Proving $\mathbb{E}(g(X)) = \int_{\mathbb{R}} g(x) f(x) dx$" Tags="&lt;probability&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18639" PostTypeId="2" ParentId="16949" CreationDate="2015-07-02T15:55:06.653" Score="4" Body="&lt;p&gt;On the website interface, you can get a CEF's NAV by circumfixing X-...-X (prefix &amp;amp; suffix) to the ticker. For example, the NAV time series ticker corresponding to the PDI price series is XPDIX. Or, XBTZX (NAV), BTZ (price). That might work for you.&lt;/p&gt;&#xA;" OwnerUserId="16751" LastActivityDate="2015-07-02T15:55:06.653" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18640" PostTypeId="2" ParentId="18637" CreationDate="2015-07-02T15:57:21.923" Score="0" Body="&lt;p&gt;As the Radon-Nykodim derivative is defined for measures on the same measurable space, and while probability $P$ is defined on the probability space $\Omega$, the standard machine is necessary to have the two measures $\lambda$ and $P \circ X^{-1}$ both defined on $\mathbb{R}$. That is,&#xA;\begin{align*}&#xA;\mathbb E(g(X)) &amp;amp;=\lim_{n\rightarrow \infty}\sum_{m=-\infty}^{\infty}\sum_{i=1}^{2^n}\Big(\frac{i-1}{2^n}+m\Big)P\Big(\frac{i-1}{2^n}+m \leq g(X) &amp;lt; \frac{i}{2^n}+m\Big)\\&#xA;&amp;amp;=\lim_{n\rightarrow \infty}\sum_{m=-\infty}^{\infty}\sum_{i=1}^{2^n}\Big(\frac{i-1}{2^n}+m\Big)P \circ X^{-1}\bigg(g^{-1}\Big[\frac{i-1}{2^n}+m, \ \frac{i}{2^n}+m\Big)\bigg)\\&#xA;&amp;amp;=\int_{\mathbb{R}} g(x)\, d(P \circ X^{-1})(x)\\&#xA;&amp;amp;= \int_{\mathbb{R}} g(x) f(x) d\lambda(x),&#xA;\end{align*}&#xA;where $f = \frac{d(P \circ X^{-1})}{d \lambda}$ is the Radon Nykodim derivative.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-07-02T17:28:25.933" LastActivityDate="2015-07-02T17:28:25.933" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18641" PostTypeId="1" AcceptedAnswerId="18727" CreationDate="2015-07-02T16:31:53.303" Score="6" ViewCount="543" Body="&lt;p&gt;I've spent a while looking for an answer to this question and while I feel it is a simple question I have not found an answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know prices of option contracts follow an implied, risk-neutral distribution which is observable and equities follow an unobservable, physical distribution of returns. Now, do futures contracts follow a risk-neutral or physical distribution? Or is my thinking flawed at some point? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm still learning so I would greatly appreciate anyone providing me some direction with this.&lt;/p&gt;&#xA;" OwnerUserId="16752" LastEditorUserId="16752" LastEditDate="2015-07-02T18:40:40.190" LastActivityDate="2015-07-06T15:16:00.520" Title="Do futures follow physical or risk-neutral distributions" Tags="&lt;options&gt;&lt;probability&gt;&lt;futures&gt;&lt;distribution&gt;&lt;risk-neutral&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18642" PostTypeId="2" ParentId="18333" CreationDate="2015-07-02T16:38:15.390" Score="3" Body="&lt;p&gt;I would argue that there is some path-dependency involved. The BS model is considered &lt;em&gt;the&lt;/em&gt; big breakthrough and it presented the world with some kind of tractable toy model. After that people saw that you had to adjust the model to account for all kinds of stylized facts (e.g. non-constant volatility for different strikes, over time and so on). Yet finite variance somehow survived this tweaking of the models, may it be for mathematical convenience, may it be that people just didn't think into this direction because there are other, more important issues (like numerical stability and so on).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another thing is that empirically variance is &lt;em&gt;always&lt;/em&gt; finite and even theoretically stock prices can only fall to zero but not indefinitely so finite variance (even though as high as needed) seems like a not too bad idea.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just another trivial reason is that most of statistics deals with probability distributions with finite variance and people tend to use what they find and what they are used to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an aside there is a new paper by Taleb where he develops an option pricing model which can cope with infinite variance:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://arxiv.org/abs/1405.2609&quot; rel=&quot;nofollow&quot;&gt;Risk Neutral Option Pricing With Neither Dynamic Hedging nor Complete Markets&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Abstract&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Proof that under simple assumptions, such as constraints of Put-Call&#xA;  Parity, the probability measure for the valuation of a European option&#xA;  has the mean derived from the forward price which can, but does not&#xA;  have to be the risk-neutral one, under any general probability&#xA;  distribution, bypassing the Black-Scholes-Merton dynamic hedging&#xA;  argument, and without the requirement of complete markets and other&#xA;  strong assumptions. We confirm that the heuristics used by traders for&#xA;  centuries are both more robust, more consistent, and more rigorous&#xA;  than held in the economics literature. We also show that options can&#xA;  be priced using infinite variance (finite mean) distributions.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2015-07-02T16:43:54.447" LastActivityDate="2015-07-02T16:43:54.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18644" PostTypeId="2" ParentId="18635" CreationDate="2015-07-02T17:35:16.970" Score="0" Body="&lt;p&gt;For a two-factor option pricing model with underlying variables $S$ and $r$ defined as above, if we assume there is &lt;strong&gt;no correlation between&lt;/strong&gt; the two Wiener&#xA;processes $W_1$ and $W_2$, one finds the &lt;strong&gt;generalized Black-Scholes PDE&lt;/strong&gt;&#xA;\begin{align}&#xA;V_t+\frac{1}{2}\sigma^2V_{SS}+r\,S\,V_S-r\,V+\frac{1}{2}\Sigma\,^2\,V_{rr}+\kappa(\theta-r)V_r=0&#xA;\end{align}&#xA;This equation is subject to initial and boundary conditions. Generally speaking, derivative pricing models for different financial scenarios may share a similar pricing partial differential equation (PDE) with adjusted parameters&#xA;and boundary conditions.Boundary conditions defining two portfolios will be considered. The first set of conditions will describe a European call stock option. The second set of conditions models a convertible bond. The stock price $S$ and interest rate, $r$. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;At the maturity time T, the call option price will be the payoff function&#xA;\begin{align}&#xA;V(S,r,T)=\max\{S-K,0\}&#xA;\end{align}&lt;/li&gt;&#xA;&lt;li&gt;At $S = 0$, the option is worthless:&#xA;\begin{align}&#xA;V(0,r,T)=0&#xA;\end{align}&lt;/li&gt;&#xA;&lt;li&gt;For large stock price $S_{\max}$, it is almost certain that the bond will be&#xA;converted to one share of the stock. Hence&#xA;\begin{align}&#xA;V(S_{\max},r,t)=S_{\max}&#xA;\end{align}&lt;/li&gt;&#xA;&lt;li&gt;When $r_t$ is infinitely large, the bond component tends to zero. Since we&#xA;do not enforce any time-dependent constraints of puttable and callable features, the upper bound and the lower bound to the price of the convertible&#xA;bond are $\max\{S,\infty\}$ and $\max\{S,0\}$ respectively. Therefore we define the boundary condition as&#xA;\begin{align}&#xA;V(S,r_{\max},t)=\min\left\{\max\{S,\infty\},\max\{S,0\}\right\}=S&#xA;\end{align}&lt;/li&gt;&#xA;&lt;li&gt;For a very small interest rate, we use homogeneous Neumann condition suggested by &lt;a href=&quot;http://www.worldscientific.com/doi/abs/10.1142/S0218202504003246&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bermudez and Nogueiras&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-11-10T16:38:13.770" LastActivityDate="2016-11-10T16:38:13.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18645" PostTypeId="2" ParentId="18634" CreationDate="2015-07-02T18:19:14.923" Score="2" Body="&lt;p&gt;Most technical indicators must be available in the TTR package. However, if they are not then you can write a custom indicator for use in quantstrat as follows.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;fractalindicator.up &amp;lt;- function(x) {&#xA;&#xA;  High &amp;lt;- Hi(x); Bars &amp;lt;- nrow(x)&#xA;  afFrUp &amp;lt;- rep(NA, Bars)&#xA;&#xA;  for(iBar in seq(8,Bars-2))&#xA;  {&#xA;    if(High[iBar-1]&amp;lt;High[iBar-2] &amp;amp;&amp;amp; High[iBar]&amp;lt;High[iBar-2])&#xA;    {&#xA;      #Fractal type 1&#xA;      if( High[iBar-4]&amp;lt;High[iBar-2] &amp;amp;&amp;amp;&#xA;          High[iBar-3]&amp;lt;High[iBar-2] )&#xA;          afFrUp[iBar+1]=High[iBar-2];&#xA;    }&#xA;  }&#xA;&#xA;  names(afFrDn) &amp;lt;- &quot;F.Up&quot;&#xA;}&#xA;&#xA;fractalindicator.dn &amp;lt;- function(x) {&#xA;&#xA;  Low &amp;lt;- Lo(x); Bars &amp;lt;- nrow(x)&#xA;  afFrDn &amp;lt;- rep(NA, Bars)&#xA;&#xA;  for(iBar in seq(8,Bars-2))&#xA;  {&#xA;    if(Low[iBar-1]&amp;gt;Low[iBar-2] &amp;amp;&amp;amp; Low[iBar]&amp;gt;Low[iBar-2])&#xA;    {&#xA;      #Fractal type 1&#xA;      if( Low[iBar-4]&amp;gt;Low[iBar-2] &amp;amp;&amp;amp; &#xA;        Low[iBar-3]&amp;gt;Low[iBar-2] )&#xA;        afFrDn[iBar+1]=Low[iBar-2];&#xA;    }&#xA;  }&#xA;&#xA;  names(afFrDn) &amp;lt;- &quot;F.Down&quot;&#xA;}&#xA;&#xA;#Add indicators&#xA;add.indicator(strategy = &quot;fractal&quot;, name = &quot;fractalindicator.up&quot;,&#xA;          arguments = list(x = quote(mktdata)), label=&quot;fractalup&quot;)&#xA;&#xA;#Add indicators&#xA;add.indicator(strategy = &quot;fractal&quot;, name = &quot;fractalindicator.dn&quot;,&#xA;          arguments = list(x = quote(mktdata)), label=&quot;fractaldn&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have defined two here, fractalindicator.up and fractalindicator.dn. You can work with these just like you do in a regular quantstrat strategy. I may be wrong in constructing the indicator so check the logic. It is also possible to combine the two functions into one with an additional parameter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, quantstrat related questions are best asked on r-sig-finance mailing list. The authors of quantstrat and many more R enthusiasts are very active on that mailing list.&lt;/p&gt;&#xA;" OwnerUserId="2142" LastActivityDate="2015-07-02T18:19:14.923" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18646" PostTypeId="1" AcceptedAnswerId="18648" CreationDate="2015-07-02T18:25:29.480" Score="13" ViewCount="4128" Body="&lt;p&gt;Suppose that $f(t)$ is a deterministic square integrable function.&#xA;I want to show $$\int_{0}^{t}f(\tau)dW_{\tau}\sim N(0,\int_{0}^{t}|f(\tau)|^{2}d\tau)$$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to know if the following approach is correct and/or if there's&#xA;a better approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First note that $$\int_{0}^{t}f(\tau)dW_{\tau}=\lim_{n\to\infty}\sum_{[t_{i-1},t_{i}]\in\pi_{n}}f(t_{i-1})(W_{t_{i}}-W_{t_{i-1}})$$&#xA;where $\pi_{n}$ is a sequence of partitions of $[0,t]$ with mesh&#xA;going to zero. Then $\int_{0}^{t}f(\tau)dW_{\tau}$ is a sum of normal&#xA;random variables and hence is normal. So all we need to do is calculate&#xA;the mean and variance. Firstly: &#xA;\begin{eqnarray*}&#xA;E(\lim_{n\to\infty}\sum_{[t_{i-1},t_{i}]\in\pi_{n}}f(t_{i-1})(W_{t_{i}}-W_{t_{i-1}})) &amp;amp; = &amp;amp; \lim_{n\to\infty}\sum_{[t_{i-1},t_{i}]\in\pi_{n}}f(t_{i-1})E(W_{t_{i}}-W_{t_{i-1}})\\&#xA; &amp;amp; = &amp;amp; \lim_{n\to\infty}\sum_{[t_{i-1},t_{i}]\in\pi_{n}}f(t_{i-1})\times0\\&#xA; &amp;amp; = &amp;amp; 0&#xA;\end{eqnarray*}&#xA;due to independence of Wiener increments. Secondly: &#xA;\begin{eqnarray*}&#xA;var(\int_{0}^{t}f(\tau)dW_{\tau}) &amp;amp; = &amp;amp; E((\int_{0}^{t}f(\tau)dW_{\tau})^{2})\\&#xA; &amp;amp; = &amp;amp;E( \int_{0}^{t}f(\tau)^{2}d\tau)=\int_{0}^{t}f(\tau)^{2}d\tau&#xA;\end{eqnarray*}&#xA;by Ito isometry.&lt;/p&gt;&#xA;" OwnerUserId="6661" LastEditorUserId="16991" LastEditDate="2015-12-12T08:32:12.453" LastActivityDate="2015-12-13T15:43:55.917" Title="Distribution of stochastic integral" Tags="&lt;stochastic-calculus&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="18648" PostTypeId="2" ParentId="18646" CreationDate="2015-07-02T18:56:50.987" Score="5" Body="&lt;p&gt;Similar question has been discussed previously; see &lt;a href=&quot;https://quant.stackexchange.com/questions/17841/why-does-the-short-rate-in-the-hull-white-model-follow-a-normal-distribution/17863#comment25957_17863&quot;&gt;Why does the short rate in the Hull White model follow a normal distribution?&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, the probabilistic limit of normal random variables is still normal.&#xA;Then, as $$\sum_{[t_{i-1},t_{i}]\in\pi_{n}}f(t_{i-1})(W_{t_{i}}-W_{t_{i-1}})$$ is normal, the limit $$\int_{0}^{t}f(\tau)dW_{\tau},$$&#xA;in probability, is also normal, with the mean and variance as you provided.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-07-02T19:02:37.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18650" PostTypeId="2" ParentId="18641" CreationDate="2015-07-02T19:17:27.293" Score="3" Body="&lt;p&gt;Your question is not clear. What you might want to say is what distribution should the futures price follow, under the risk-neutral or physical probability measure. In this sense, it will depend on your intention. For potential future exposure, you may want to use the physical measure for the price evolution, while the distribution will depend on your model assumption -- could be normal or log-normal. However, for valuation, risk-neutral probability measure is assumed. Moreover, the futures price process is a martingale under the risk-neutral probability measure, and is usually assumed to be log-normal.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-07-02T19:34:01.237" LastActivityDate="2015-07-02T19:34:01.237" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18651" PostTypeId="1" AcceptedAnswerId="18652" CreationDate="2015-07-02T20:49:20.460" Score="2" ViewCount="248" Body="&lt;p&gt;If we consider binary FX options in the market and estimate the market implied probabilities of certain FX rates occurring, would these resulting probabilities be risk neutral or real world?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hear the term &quot;market implied probability&quot; being used in the work place estimated from binary options, I am not sure if this relates to risk neutral or real world?&lt;/p&gt;&#xA;" OwnerUserId="16756" LastActivityDate="2021-05-15T21:29:05.630" Title="Is probability implied by binary FX options risk neutral or real world?" Tags="&lt;risk-neutral-measure&gt;&lt;binary-options&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18652" PostTypeId="2" ParentId="18651" CreationDate="2015-07-02T20:55:03.343" Score="4" Body="&lt;p&gt;risk-neutral. Really the forward measure. The price of the binary is struck at $K$ is &#xA;$$&#xA;Z P( F_T &amp;gt; K)&#xA;$$&#xA;with $Z$ the discount factor and $F_T$ the forward, and $P$ the probability in the forward measure. If rates are deterministic, the forward measure and the risk-neutral measure will agree. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-07-02T20:55:03.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18653" PostTypeId="2" ParentId="16430" CreationDate="2015-07-02T23:46:22.823" Score="1" Body="&lt;p&gt;Yes you can do that by simply using the &lt;code&gt;PROC LOAN&lt;/code&gt; already implemented in SAS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It gives the possibility to take into account ballon dates, floating &amp;amp; fixed interest rates and all you mentioned in the question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://support.sas.com/documentation/onlinedoc/ets/132/loan.pdf&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; you can find the guide to use this procedure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suggest to use that instead of other statistical procedure, because SAS provides already implemented functions and in terms of time, you should be able to do that in less than one minute.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you need some help to understand the procedure, please ping me below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this help.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-07-02T23:46:22.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18654" PostTypeId="1" CreationDate="2015-07-03T01:09:48.077" Score="3" ViewCount="466" Body="&lt;p&gt;I'm looking for a tick by tick high performance container.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far I've been using List where Tick is a simple struct with a DateTime and double field.  I'm using Linq for date lookups but it's painfully slow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So after reading &lt;a href=&quot;https://quant.stackexchange.com/questions/613/what-is-the-best-data-structure-implementation-for-representing-a-time-series&quot;&gt;this&lt;/a&gt; I was thinking of using two arrays, one for date one for values, use binary search and wrapping it in my own data structure but I was wondering if there is something similar to pandas in python?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had a look at deedle but didn't have time to test its performance, is it based the above mentionned method ( two arrays, one for date one for values) or is it based on linq. If it's based on linq, I don't expect it to perform well. &lt;/p&gt;&#xA;" OwnerUserId="16451" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2015-07-03T02:06:29.920" Title="What is the best data structure/implementation for representing a time series in C#?" Tags="&lt;time-series&gt;&lt;programming&gt;&lt;high-frequency&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18655" PostTypeId="2" ParentId="18654" CreationDate="2015-07-03T02:06:29.920" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://bluemountaincapital.github.io/Deedle/&quot; rel=&quot;nofollow&quot;&gt;http://bluemountaincapital.github.io/Deedle/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Disclaimer: I haven't used this.&lt;/p&gt;&#xA;" OwnerUserId="1397" LastActivityDate="2015-07-03T02:06:29.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18658" PostTypeId="1" AcceptedAnswerId="18659" CreationDate="2015-07-03T09:40:42.137" Score="4" ViewCount="352" Body="&lt;p&gt;Let $V=V(S_t,t)$ be the option price and &#xA;\begin{align}&#xA;V_t+\mu\,S\,V_S+\frac{1}{2}\sigma^2\,S^2\,V_{SS}=0\\&#xA;V(S_T,T)=\ln (S_T)^{2}.&#xA;\end{align}&#xA;&lt;strong&gt;My question&lt;/strong&gt;: How can I obtain a closed form solution of $V=V(S_t,t)$. Please help me.&lt;/p&gt;&#xA;" OwnerDisplayName="user16764" LastEditorUserId="2587" LastEditDate="2015-07-03T12:42:09.540" LastActivityDate="2015-07-05T10:24:16.353" Title="Closed form solution of PDE of Option Price" Tags="&lt;options&gt;&lt;stochastic-calculus&gt;&lt;finance&gt;&lt;black-scholes-pde&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18659" PostTypeId="2" ParentId="18658" CreationDate="2015-07-03T11:13:36.033" Score="5" Body="&lt;p&gt;&lt;strong&gt;Feynman–Kac Theorem&lt;/strong&gt;: Assume that $F$ is a solution to the boundary value problem&#xA;\begin{align}&#xA;&amp;amp;F_t+\mu(t,x)F_x+\frac{1}{2}\sigma^2(t,x)F_{xx}-rF=0\\&#xA;&amp;amp;F(T,x)=\Phi(x),&#xA;\end{align}&#xA;Assume furthermore that the process $e^{-r_s}\sigma(s,X_s)F_s$ is in $\mathcal L^2$ where &#xA;\begin{align}&#xA;dX_s=\mu(s,x)ds+\sigma(s,x)dW_s,&#xA;\end{align}&#xA;then $F$ has the representation.&#xA;\begin{align}&#xA;F(t,x)=e^{-r(T-t)}E^Q_{t,x}[\Phi(X_T)]&#xA;\end{align}&#xA;Now, let &#xA;\begin{align}&#xA;dS_t=\mu S_tdt+\sigma S_tdW_t&#xA;\end{align}&#xA;by application Ito lemma,we have&#xA;\begin{align} &#xA;\ln S_T=\ln S_t\,\,+(\mu-\frac{1}{2}\sigma^2)(T-t)+\sigma\,(W_T-W_t) &#xA;\end{align}&#xA;then &#xA;\begin{align}&#xA;&amp;amp;V(S_t,t)=e^{-0\times(T-t)}E^Q_{t,s}[\ln(S_T)^2]=E^Q_{t,s}[2\ln(S_T)]\\&#xA;&amp;amp;\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,=E^Q_{t,s}[2\ln(S_t)+2(\mu-\frac{1}{2}\sigma^2)(T-t)+2\sigma\,(W_T-W_t)]\\&#xA;&amp;amp;\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,=2\ln(S_t)+2(\mu-\frac{1}{2}\sigma^2)(T-t)+2\sigma\,E^Q_{t,s}[(W_T-W_t)]\\&#xA;\end{align}&#xA;The process $W_t$ has independent increments,therefor&#xA;\begin{align}&#xA;V(S_t,t)=2\ln(S_t)+2(\mu-\frac{1}{2}\sigma^2)(T-t)&#xA;\end{align}&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2015-07-05T10:24:16.353" LastActivityDate="2015-07-05T10:24:16.353" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18660" PostTypeId="1" CreationDate="2015-07-03T12:41:27.363" Score="4" ViewCount="433" Body="&lt;p&gt;I was wondering from those with commercial machine learning financial experience, what the machine learning language of choice in this industry in the most general sense. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, what would be the best language for adaptive, unsupervised machine learning, in order to inform trading decisions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I say best I mean a balance of speed and developer productivity, and to some extent existing libraries, although with generic deep learning tools this might weigh in less.&lt;/p&gt;&#xA;" OwnerUserId="3424" LastEditorUserId="3424" LastEditDate="2015-07-03T16:59:40.120" LastActivityDate="2017-07-03T01:49:55.663" Title="What is the machine learning language of choice in this industry for unsupervised learning" Tags="&lt;machine-learning&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18663" PostTypeId="1" CreationDate="2015-07-03T16:15:08.020" Score="3" ViewCount="77" Body="&lt;p&gt;I am interested in adaptive mesh methods for numerical solution of PDEs with applications to finance. As part of a school project, I have been pricing vanilla European call and put options using 2D FEM (space+time) and successfully applied an adaptive mesh algorithm to reduce the numerical error introduced by non-smooth payoffs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have not been able to find a lot of existing work on 2D &lt;em&gt;space-time&lt;/em&gt; FEM in finance, let alone adaptive mesh methods in this context. Hence the question: do people tend to use FDMs due to ease of implementation (separate discretisation of the dimensions is much easier to handle code-wise), or are there other reasons for the apparent absence of space-time FEM in the literature?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am contemplating whether or not it makes sense to keep working in this direction, as the lack of similar papers/works in progress might suggest that it is not of any relevance. If I have missed any existing papers on this topic, please provide references if possible.&lt;/p&gt;&#xA;" OwnerUserId="16765" LastActivityDate="2015-07-03T20:13:00.027" Title="Time discretisations, FDM vs FEM" Tags="&lt;numerical-methods&gt;&lt;black-scholes-pde&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18664" PostTypeId="1" CreationDate="2015-07-03T16:27:14.120" Score="1" ViewCount="108" Body="&lt;p&gt;I know that the Geomtric Brownian Motion, with the expresion $dX_t = v X_t dt + \sigma X_t dW_t$ has the next solution $$X_t = X_0 e^{\sigma W_t+ (v-\frac{\sigma ^2}{2})t}$$ on the interval [0,t]. But, what would be the solution on a general interval $[t_1,t_2]$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would it be, $X_{t_2} = X_{t_1} e^{\sigma (W_{t_2}-W_{t_1})+ (v-\frac{1}{2}\sigma^2)(t_2-t_1)}$?&lt;/p&gt;&#xA;" OwnerUserId="16565" LastEditorDisplayName="user16651" LastEditDate="2015-07-03T19:09:48.620" LastActivityDate="2015-07-03T20:34:05.387" Title="Geometric Brownian Motion in a general interval $[t_1,t_2]$" Tags="&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18666" PostTypeId="2" ParentId="18664" CreationDate="2015-07-03T17:42:50.047" Score="1" Body="&lt;p&gt;let $Y_t=\ln X_t$ by application of Ito lemma we have&#xA;\begin{align}&#xA;dY_t=\frac{1}{X_t}dX_t-\frac{1}{2X_t^2}d[X,X](t)=(v-\frac{1}{2}\sigma^2)dt+\sigma\,dW_t&#xA;\end{align}&#xA;by integration on $[t_1,t_2]$, we have&#xA;\begin{align}&#xA;Y_{t_2}=Y_{t_1}+(v-\frac{1}{2}\sigma^2)(t_2-t_1)+\sigma\,(W_{t_2}-W_{t_1})&#xA;\end{align}&#xA;then&#xA;\begin{align}&#xA;X_{t_2}=X_{t_1}exp\left((v-\frac{1}{2}\sigma^2)(t_2-t_1)+\sigma\,(W_{t_2}-W_{t_1})\right)&#xA;\end{align}&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2015-07-03T20:34:05.387" LastActivityDate="2015-07-03T20:34:05.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18667" PostTypeId="2" ParentId="18660" CreationDate="2015-07-03T18:00:02.083" Score="4" Body="&lt;p&gt;R. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The others in-play are Python and, increasingly, Scala. But if you're trying to create or test a machine learning algorithm for a new problem, it's R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update July 2, 2017:  This answer came up in my feed because of an upvote, so I suppose its worth updating.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These days there are a few key deciding factors in what language I choose for a problem. It the problem is to perform an analysis of data that can't fit in-memory on one machine, then I'm probably going to use Scala for Spark.  If it can fit in-memory and the data is of a form where the relevant fields are either numbers or categories, then I'm going to use R. If the data contains text or images, then I'm more likely to use Python (unless I intend to use one of the R text modelling packages.)&lt;/p&gt;&#xA;" OwnerUserId="16767" LastEditorUserId="16767" LastEditDate="2017-07-03T01:49:55.663" LastActivityDate="2017-07-03T01:49:55.663" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18670" PostTypeId="2" ParentId="18636" CreationDate="2015-07-03T20:49:10.893" Score="1" Body="&lt;p&gt;As a simple example: if stock A went up a lot in 2014 and also went up a lot in 2015 it could be: (a) that Stock A is a high Beta stock and the market was up in both years. This is the cross sectional property of expected returns. Some stocks, in this case high beta stocks go up more than others when the market goes up. (b) Somehow the fact that Stock A went up the first year caused it to go up the next year. This is the intertemporal behavior of asset returns. In this case there is a true momentum effect and stocks that increase one year are likely to go up the next.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-07-03T20:49:10.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18671" PostTypeId="1" CreationDate="2015-07-03T21:47:12.967" Score="2" ViewCount="122" Body="&lt;p&gt;I am using the formula &lt;a href=&quot;https://en.wikipedia.org/wiki/Yield_curve#Construction_of_the_full_yield_curve_from_market_data&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; to determine the discount factor function and eventually the zero-coupon yields. I get the data for Coupons, Face Values and Closing Prices from Thomson Reuters, which I insert into the Dataframe &lt;code&gt;df&lt;/code&gt;. The code below is used to determine the inverse of the &lt;code&gt;matrix_of_coupons_and_facevalues&lt;/code&gt; in the Bootstrapping process. The &lt;code&gt;matrix_of_coupons_and_facevalues&lt;/code&gt; prints out exactly as I want it. However, I find that &lt;code&gt;matrix_of_coupons_and_facevalues&lt;/code&gt; turns out to be Singular and &lt;strong&gt;I'm trying to figure out if there is an issue with the logic in my code below&lt;/strong&gt;. I am using Python 3.4 and part of the Dataframe &lt;code&gt;df&lt;/code&gt; looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   months_to_maturity                      orig_iss_dt  \&#xA;1                   6                    2015-06-25 00:00:00.0   &#xA;2                  12                    2015-06-25 00:00:00.0   &#xA;3                  18                    2015-06-30 00:00:00.0   &#xA;4                  24                    2015-06-15 00:00:00.0   &#xA;5                  30                    2015-06-30 00:00:00.0   &#xA;&#xA;             maturity_dt  pay_freq_cd  coupon  closing_price  FACE_VALUE  &#xA;1  2015-12-24 00:00:00.0          NaN   0.000      99.960889         100  &#xA;2  2016-06-23 00:00:00.0          NaN   0.000      99.741444         100  &#xA;3  2017-06-30 00:00:00.0            2   0.625      99.968750         100  &#xA;4  2018-06-15 00:00:00.0            2   1.125     100.390625         100  &#xA;5  2020-06-30 00:00:00.0            2   1.625      99.984375         100  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#Determining the dimensions of the matrix of coupons and face values&#xA;#pay_freq_cd is number of coupon payments per year&#xA;number_of_columns_and_rows = 0&#xA;for (i, row) in df.iterrows():&#xA;    no_of_coupons_per_year_2 = row['pay_freq_cd'] &#xA;    no_of_months_between_payments_2 = 12/no_of_coupons_per_year_2&#xA;    candidate_number_of_columns_and_rows = row['months_to_maturity']/no_of_months_between_payments_2&#xA;    if  candidate_number_of_columns_and_rows &amp;gt; number_of_columns_and_rows:&#xA;        number_of_columns_and_rows = candidate_number_of_columns_and_rows&#xA;        no_of_months_between_payments_for_matrix = no_of_months_between_payments_2&#xA;&#xA;    matrix_of_coupons_and_facevalues = numpy.zeros((number_of_columns_and_rows, number_of_columns_and_rows))      &#xA;    #Inserting Coupons and Face values into the Matrix    &#xA;    for (i,row) in df.iterrows():&#xA;        no_of_coupons_per_year_2 = row['pay_freq_cd']&#xA;        no_of_months_between_payments_2 = 12/no_of_coupons_per_year_2&#xA;        if math.isnan(no_of_months_between_payments_2):&#xA;            matrix_of_coupons_and_facevalues[i,0:((number_of_columns_and_rows)-1)] = 0&#xA;            matrix_of_coupons_and_facevalues[i,(row.months_to_maturity/no_of_months_between_payments_for_matrix)-1] = (row['FACE_VALUE']) + row['coupon']&#xA;        else:&#xA;            matrix_of_coupons_and_facevalues[i,0:((row.months_to_maturity/no_of_months_between_payments_2)-1)] = row['coupon']&#xA;            matrix_of_coupons_and_facevalues[i,(row.months_to_maturity/no_of_months_between_payments_2)-1] = (row['FACE_VALUE']) + row['coupon']&#xA;&#xA;    inv_matrix_of_coupons_and_facevalues = numpy.inv(matrix_of_coupons_and_facevalues)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thank You&lt;/p&gt;&#xA;" OwnerUserId="11917" LastEditorUserId="11917" LastEditDate="2015-07-05T22:03:50.270" LastActivityDate="2015-07-05T22:03:50.270" Title="Problem with Naive Bootstrapping (US Government Bonds)" Tags="&lt;fixed-income&gt;&lt;python&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18672" PostTypeId="2" ParentId="18634" CreationDate="2015-07-04T01:24:56.483" Score="0" Body="&lt;p&gt;so i had to do a couple changes to get it fully working for me, but Rohit you pretty much got it close. Again this is what worked in my env&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; fractalindicator.up &amp;lt;- function(x) {&#xA;&#xA;  x$FUp  &amp;lt;- 0&#xA;&#xA;  High &amp;lt;- Hi(x); Bars &amp;lt;- nrow(x)&#xA;&#xA;&#xA;  for(iBar in seq(8,Bars-2))&#xA;  {&#xA;    if(High[[iBar-1]]&amp;lt;High[[iBar-2]] &amp;amp;&amp;amp; High[[iBar]]&amp;lt;High[[iBar-2]])&#xA;    {&#xA;      #Fractal type 1&#xA;      if( High[[iBar-4]]&amp;lt;High[[iBar-2]] &amp;amp;&amp;amp;&#xA;            High[[iBar-3]]&amp;lt;High[[iBar-2]] )&#xA;        #afFrUp[iBar+1]=High[iBar-2];&#xA;        x$FUp[iBar]= 1;&#xA;    }&#xA;  }&#xA;&#xA;  return(x$FUp)&#xA;}&#xA;&#xA;fractalindicator.dn &amp;lt;- function(x) {&#xA;  x$FDown  &amp;lt;- 0&#xA;&#xA;  Low &amp;lt;- Lo(x); Bars &amp;lt;- nrow(x)&#xA;&#xA;  for(iBar in seq(8,Bars-2))&#xA;  {&#xA;    if(Low[[iBar-1]]&amp;gt;Low[[iBar-2]] &amp;amp;&amp;amp; Low[[iBar]]&amp;gt;Low[[iBar-2]])&#xA;    {&#xA;      #Fractal type 1&#xA;      if( Low[[iBar-4]]&amp;gt;Low[[iBar-2]] &amp;amp;&amp;amp; &#xA;            Low[[iBar-3]]&amp;gt;Low[[iBar-2]] )&#xA;        #afFrDn[iBar+1]=Low[iBar-2];&#xA;        x$FDown[iBar]=1;&#xA;        }&#xA;      }&#xA;      return(x$FDown)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I needed to return an xts object and include [[]] to access values in the dataframe&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pasted below is the full code (without analytics), I used the boilerplate code from Ilya Kipnis so full credit goes to him (please source the code from the link and not copy and paste from this) &#xA;&lt;a href=&quot;https://github.com/IlyaKipnis/DSTrading/blob/master/demo/TVI2.R&quot; rel=&quot;nofollow&quot;&gt;https://github.com/IlyaKipnis/DSTrading/blob/master/demo/TVI2.R&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The strategy just buys as soon as it gets and up fractal and exits on a down fractal, obviously this is not a strategy anyone would trade, This is just an example of using fractals. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;require(quantstrat)&#xA;require(IKTrading)&#xA;require(devtools)&#xA;require(DSTrading)&#xA;require(PerformanceAnalytics)&#xA;options(&quot;getSymbols.warning4.0&quot;=FALSE)&#xA;rm(list=ls(.blotter), envir=.blotter)&#xA;currency('USD')&#xA;Sys.setenv(TZ=&quot;UTC&quot;)&#xA;symbols  &amp;lt;- &quot;SPY&quot;&#xA;suppressMessages(getSymbols(symbols, from=&quot;1998-01-01&quot;, to=&quot;2015-05-15&quot;))&#xA;stock(symbols, currency=&quot;USD&quot;, multiplier=1)&#xA;initDate=&quot;1990-01-01&quot;&#xA;&#xA;tradeSize  &amp;lt;- 10000&#xA;initEq  &amp;lt;- tradeSize*length(symbols)&#xA;&#xA;account.st  &amp;lt;- 0&#xA;strategy.st  &amp;lt;- portfolio.st &amp;lt;- account.st  &amp;lt;- &quot;fractal&quot;&#xA;rm.strat(portfolio.st)&#xA;rm.strat(strategy.st)&#xA;initPortf(portfolio.st, symbols=symbols, initDate=initDate, currency='USD')&#xA;initAcct(account.st, portfolios=portfolio.st, initDate=initDate, currency='USD',initEq=initEq)&#xA;initOrders(portfolio.st, initDate=initDate)&#xA;strategy(strategy.st, store=TRUE)&#xA;&#xA;&#xA;#new&#xA;fractalindicator.up &amp;lt;- function(x) {&#xA;&#xA;  x$FUp  &amp;lt;- 0&#xA;&#xA;  High &amp;lt;- Hi(x); Bars &amp;lt;- nrow(x)&#xA;&#xA;&#xA;  for(iBar in seq(8,Bars-2))&#xA;  {&#xA;    if(High[[iBar-1]]&amp;lt;High[[iBar-2]] &amp;amp;&amp;amp; High[[iBar]]&amp;lt;High[[iBar-2]])&#xA;    {&#xA;      #Fractal type 1&#xA;      if( High[[iBar-4]]&amp;lt;High[[iBar-2]] &amp;amp;&amp;amp;&#xA;            High[[iBar-3]]&amp;lt;High[[iBar-2]] )&#xA;        #afFrUp[iBar+1]=High[iBar-2];&#xA;        x$FUp[iBar]= 1;&#xA;    }&#xA;  }&#xA;&#xA;  return(x$FUp)&#xA;}&#xA;&#xA;fractalindicator.dn &amp;lt;- function(x) {&#xA;  x$FDown  &amp;lt;- 0&#xA;&#xA;  Low &amp;lt;- Lo(x); Bars &amp;lt;- nrow(x)&#xA;&#xA;  for(iBar in seq(8,Bars-2))&#xA;  {&#xA;    if(Low[[iBar-1]]&amp;gt;Low[[iBar-2]] &amp;amp;&amp;amp; Low[[iBar]]&amp;gt;Low[[iBar-2]])&#xA;    {&#xA;      #Fractal type 1&#xA;      if( Low[[iBar-4]]&amp;gt;Low[[iBar-2]] &amp;amp;&amp;amp; &#xA;            Low[[iBar-3]]&amp;gt;Low[[iBar-2]] )&#xA;        #afFrDn[iBar+1]=Low[iBar-2];&#xA;        x$FDown[iBar]=1;&#xA;        }&#xA;      }&#xA;      return(x$FDown)&#xA;}&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;#Add indicators&#xA;add.indicator(strategy = &quot;fractal&quot;, name = &quot;fractalindicator.up&quot;,&#xA;              arguments = list(x = quote(mktdata)), label=&quot;fractalup&quot;)&#xA;&#xA;#Add indicators&#xA;add.indicator(strategy = &quot;fractal&quot;, name = &quot;fractalindicator.dn&quot;,&#xA;              arguments = list(x = quote(mktdata)), label=&quot;fractaldn&quot;)&#xA;&#xA;applyIndicators(strategy=strategy.st, mktdata)&#xA;&#xA;&#xA;# &#xA;# mktdata$FDown.FDownCompare &amp;lt;- 1&#xA;    # mktdata$FUp.FUpCompare &amp;lt;- 1&#xA;&#xA;add.signal(strategy.st, name = &quot;sigComparison&quot;, arguments = list(columns=c(&quot;fractalup&quot;, &quot;fractaldn&quot;),&#xA;                                                               relationship=&quot;gt&quot;), label=&quot;upFractal&quot;)&#xA;&#xA;add.signal(strategy.st, name = &quot;sigComparison&quot;, arguments = list(columns=c(&quot;fractaldn&quot;, &quot;fractalup&quot;),&#xA;                                                        relationship=&quot;gt&quot;), label=&quot;downFractal&quot;)&#xA;&#xA;applySignals(strategy=strategy.st,mktdata)&#xA;&#xA;#enter rule&#xA;add.rule(strategy.st, name = &quot;ruleSignal&quot;, arguments = list(sigcol=&quot;upFractal&quot;,&#xA;                                                            sigval=TRUE, &#xA;                                                            ordertype=&quot;market&quot;,&#xA;                                                            orderside=NULL,&#xA;                                                            replace=FALSE,&#xA;                                                            prefer=&quot;close&quot;,&#xA;                                                            orderqty=1),&#xA;         type=&quot;enter&quot;,path.dep=TRUE,label=&quot;ruleUp&quot;)&#xA;&#xA;#exit rule&#xA;add.rule(strategy.st, name = &quot;ruleSignal&quot;, arguments = list(sigcol=&quot;downFractal&quot;,&#xA;                                                            sigval=TRUE, &#xA;                                                            orderqty=&quot;all&quot;,&#xA;                                                            orderqty=-1,&#xA;                                                            ordertype=&quot;market&quot;,&#xA;                                                            orderside=NULL,&#xA;                                                            replace=FALSE,&#xA;                                                            prefer=&quot;open&quot;),&#xA;         type=&quot;enter&quot;,path.dep=TRUE,label=&quot;ruleDown&quot;)&#xA;&#xA;#apply strategy&#xA;t1 &amp;lt;- Sys.time()&#xA;out &amp;lt;- applyStrategy(strategy=strategy.st,portfolios=portfolio.st,debug=TRUE )&#xA;t2 &amp;lt;- Sys.time()&#xA;print(t2-t1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="16748" LastActivityDate="2015-07-04T01:24:56.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18673" PostTypeId="1" CreationDate="2015-07-04T01:41:30.903" Score="0" ViewCount="179" Body="&lt;p&gt;Let's say there is a $1 stock, with say 1 day to expiration. The 1.5 strike call, is probably a 0 delta at this point; however, a 1 point increase would mean the stock would be at trading at 2 dollars; thus the 1.5 strike call would now almost be guaranteed to finish in the money right, and would seemingly now have close to a 100 delta. It seems then, that it's gamma was 100 in this scenario, making it higher than an ATM option. Where am I wrong? &lt;/p&gt;&#xA;" OwnerUserId="16709" LastActivityDate="2015-09-09T07:16:51.193" Title="In this scenario could gamma be higher for OTM options?" Tags="&lt;options&gt;&lt;greeks&gt;&lt;gamma&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18674" PostTypeId="1" CreationDate="2015-07-04T06:06:13.270" Score="4" ViewCount="2796" Body="&lt;p&gt;Moving average crossover strategy is a widely used strategy in algo trading. Is there a way to optimize return in a moving average crossover stratergy. I have used &lt;a href=&quot;http://www.etfreplay.com/backtest_ma.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;this site&lt;/a&gt; to backtest MA crossover stratergy in ETF's.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;parameters used &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ETF= DIA&#xA;MA Length=21 days(long),9 days(short)&#xA;Trade On= Day of cross&#xA;start date = 03-Jan-2000&#xA;end date= 02-Jul-2015&#xA;Advance setting= Default&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Backtest statistics&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/opjZt.png&quot; alt=&quot;enter image description here&quot;&gt;&#xA;&lt;img src=&quot;https://i.stack.imgur.com/5FJ3b.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Total Return= +62.7&#xA;&#xA;Buy                 Sell       Return   Days In Trade  &#xA;Mar 20, 2000    Apr 17, 2000    -0.76   20                  &#xA;May 23, 2000    May 26, 2000    -1.26   3&#xA;Jun 07, 2000    Jun 21, 2000    -3.08   10&#xA;Jul 11, 2000    Jul 31, 2000    -1.96   14&#xA;Aug 10, 2000    Sep 18, 2000    -0.65   26&#xA;Oct 31, 2000    Nov 20, 2000    -4.19   14&#xA;Dec 11, 2000    Dec 26, 2000    +0.15   10&#xA;Dec 28, 2000    Jan 17, 2001    -2.56   12&#xA;Jan 30, 2001    Feb 22, 2001    -2.68   16&#xA;Apr 11, 2001    Jun 05, 2001    +12.03  37&#xA;Jul 23, 2001    Aug 01, 2001    +1.34   7&#xA;Aug 03, 2001    Aug 08, 2001    -2.30   3&#xA;Oct 10, 2001    Jan 16, 2002    +5.44   67&#xA;Feb 12, 2002    Mar 28, 2002    +5.28   31&#xA;May 16, 2002    May 31, 2002    -3.68   10&#xA;Aug 07, 2002    Sep 05, 2002    -1.35   20&#xA;Oct 18, 2002    Dec 12, 2002    +3.32   38&#xA;Jan 08, 2003    Jan 24, 2003    -5.47   11&#xA;Feb 27, 2003    Mar 03, 2003    -0.57   2&#xA;Mar 20, 2003    Jul 01, 2003    +9.71   71&#xA;Jul 14, 2003    Aug 11, 2003    +0.78   20&#xA;Aug 12, 2003    Sep 29, 2003    +1.06   33&#xA;Oct 09, 2003    Oct 31, 2003    +1.04   16&#xA;Nov 04, 2003    Nov 20, 2003    -2.07   12&#xA;Dec 03, 2003    Feb 04, 2004    +6.11   42&#xA;Feb 12, 2004    Mar 04, 2004    -1.07   14&#xA;Apr 02, 2004    Apr 23, 2004    +0.02   14&#xA;Jun 02, 2004    Jul 07, 2004    -0.14   23&#xA;Aug 25, 2004    Sep 23, 2004    -1.30   20&#xA;Nov 04, 2004    Jan 10, 2005    +3.49   45&#xA;Feb 04, 2005    Mar 18, 2005    -0.60   29&#xA;May 06, 2005    Jun 28, 2005    +0.96   36&#xA;Jul 15, 2005    Aug 10, 2005    -0.05   18&#xA;Sep 12, 2005    Sep 23, 2005    -2.40   9&#xA;Oct 28, 2005    Dec 15, 2005    +5.02   33&#xA;Dec 23, 2005    Dec 30, 2005    -1.66   4&#xA;Jan 04, 2006    Jan 24, 2006    -1.54   13&#xA;Feb 08, 2006    Mar 10, 2006    +2.27   21&#xA;Mar 16, 2006    Apr 06, 2006    -0.31   15&#xA;Apr 21, 2006    May 19, 2006    -1.46   20&#xA;Jun 27, 2006    Jul 17, 2006    -1.59   13&#xA;Jul 31, 2006    Feb 28, 2007    +11.03  145&#xA;Mar 23, 2007    Jun 12, 2007    +6.97   55&#xA;Jun 21, 2007    Jun 27, 2007    -0.92   4&#xA;Jul 09, 2007    Jul 31, 2007    -3.04   16&#xA;Aug 31, 2007    Oct 22, 2007    +1.83   35&#xA;Dec 05, 2007    Dec 26, 2007    +0.96   14&#xA;Feb 06, 2008    Feb 15, 2008    +1.07   7&#xA;Feb 25, 2008    Mar 07, 2008    -5.29   9&#xA;Mar 26, 2008    May 21, 2008    +2.11   40&#xA;Jul 24, 2008    Aug 26, 2008    +0.63   23&#xA;Nov 04, 2008    Nov 14, 2008    -12.46  8&#xA;Dec 05, 2008    Dec 30, 2008    +0.42   16&#xA;Jan 06, 2009    Jan 15, 2009    -8.84   7&#xA;Mar 19, 2009    Jun 23, 2009    +13.41  66&#xA;Jul 20, 2009    Oct 06, 2009    +10.72  55&#xA;Oct 14, 2009    Nov 03, 2009    -2.33   14&#xA;Nov 11, 2009    Jan 25, 2010    -0.47   49&#xA;Feb 19, 2010    May 06, 2010    +1.50   53&#xA;Jun 17, 2010    Jul 01, 2010    -6.74   10&#xA;Jul 16, 2010    Aug 18, 2010    +3.52   23&#xA;Sep 09, 2010    Nov 19, 2010    +8.07   51&#xA;Dec 07, 2010    Mar 03, 2011    +8.46   59&#xA;Mar 29, 2011    May 19, 2011    +3.09   36&#xA;Jun 29, 2011    Jul 29, 2011    -0.99   21&#xA;Aug 31, 2011    Sep 14, 2011    -3.06   9&#xA;Sep 16, 2011    Sep 20, 2011    -0.85   2&#xA;Oct 13, 2011    Nov 21, 2011    +0.84   27&#xA;Dec 07, 2011    Apr 10, 2012    +4.97   84&#xA;Apr 26, 2012    May 11, 2012    -2.78   11&#xA;Jun 15, 2012    Aug 31, 2012    +3.22   54&#xA;Sep 11, 2012    Oct 10, 2012    +0.35   21&#xA;Nov 30, 2012    Apr 25, 2013    +13.92  99&#xA;Apr 30, 2013    Jun 06, 2013    +1.79   26&#xA;Jul 09, 2013    Aug 14, 2013    +0.48   26&#xA;Sep 12, 2013    Oct 03, 2013    -2.00   15&#xA;Oct 21, 2013    Dec 12, 2013    +2.76   37&#xA;Dec 23, 2013    Jan 22, 2014    +0.60   19&#xA;Feb 19, 2014    Mar 21, 2014    +1.76   22&#xA;Mar 28, 2014    Apr 14, 2014    -0.86   11&#xA;Apr 25, 2014    Jul 31, 2014    +1.75   67&#xA;Aug 20, 2014    Oct 01, 2014    -0.90   29&#xA;Oct 29, 2014    Dec 15, 2014    +1.67   32&#xA;Dec 29, 2014    Jan 13, 2015    -2.29   10&#xA;Feb 10, 2015    Mar 11, 2015    -0.94   20&#xA;Apr 15, 2015    May 06, 2015    -1.31   15&#xA;May 13, 2015    Jun 04, 2015    -0.63   15&#xA;Jun 23, 2015    Jul 01, 2015    -2.05   6&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From the backtest data we can infer that the total return percentage of our moving average stragery is way lesser (71%) than the Benchmark DIA (135%). So how should we optimize our MA crossover algorithm to get a total return percentage equal or more than that of benchmark. How to prevent negative returns ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;example&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Dec 29, 2014    Jan 13, 2015    -2.29   10&#xA;Feb 10, 2015    Mar 11, 2015    -0.94   20&#xA;Apr 15, 2015    May 06, 2015    -1.31   15&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;a way to prevent trades when return are in negative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider this pseudo code as the MA crossover algorithm&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;initial_invest=1500        //initial investment amount&#xA;shareprice=15             // value of one share//&#xA;ma_short=9               // moving averages 9 days&#xA;ma_long=21&#xA;if ma_short crossabove ma_long&#xA;Buy share&#xA;elif ma_short crossbelow ma_long&#xA;sell share&#xA;endif&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="16754" LastEditorUserId="16754" LastEditDate="2015-07-04T06:13:26.017" LastActivityDate="2017-01-26T12:34:50.217" Title="How to optimize return in a moving average crossover algorithm" Tags="&lt;quant-trading-strategies&gt;&lt;optimization&gt;&lt;backtesting&gt;&lt;moving-average&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18675" PostTypeId="1" CreationDate="2015-07-04T06:45:11.803" Score="1" ViewCount="121" Body="&lt;p&gt;I have the following information:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Call Premium: 0.30&#xA;Put Premium: 40.4&#xA;Strike: 130&#xA;1-Month Risk-Free Rate: 0%&#xA;Market Price: $85.00&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I use the Synthetic Long formula I get a price of: &lt;code&gt;$89.90&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Synthetic-Long = call - put + X/(1+Rf)^t&#xA;Synthetic-Long = 0.30 - 40.4 + 130/[(1+0.00)^(30/360)]&#xA;Synthetic-Long = $89.90&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is significantly higher than the market price. If the Investor buys the stock at the market price &lt;code&gt;$85.00&lt;/code&gt; how many options and bonds must they buy/sell?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Shorting the Synthetic would make the formula:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-(Synthetic-Long) = -call + put - X/(1+Rf)^t&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since 1 option contract = 100 shares, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;then sell 1 call &amp;amp; buy 1 put, but how much of the bond must they sell? (assuming US treasury, &amp;amp; assuming the Risk-Free Rate  is 0%)&lt;/p&gt;&#xA;" OwnerUserId="15401" LastActivityDate="2015-07-04T06:45:11.803" Title="Shorting a Synthetic Long" Tags="&lt;option-pricing&gt;&lt;synthetic&gt;" AnswerCount="0" CommentCount="0" ClosedDate="2015-07-04T07:19:46.350" ContentLicense="CC BY-SA 3.0" />
  <row Id="18677" PostTypeId="2" ParentId="18598" CreationDate="2015-07-04T15:32:05.723" Score="1" Body="&lt;p&gt;It is a measure of profitability commonly used in the Banking industry. We can exclude the other 3 answers: it does not take into account the bank's leverage (i.e. it is a measure of pre-leverage profitability), it has nothing to do with asset composition (since it is based on total assets, irrespective of their composition), and it has nothing to do with liquidity (which again would have to be based on a distinction between liquid and illiquid assets).&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-07-04T15:32:05.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18678" PostTypeId="1" CreationDate="2015-07-04T19:18:30.683" Score="3" ViewCount="179" Body="&lt;p&gt;Assume $\,\mathcal{F}$ be a nonempty collection of subsets of $\Omega$. $\,\mathcal{F}$ is called a $\sigma$-Algebra whenever&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;if $A\in\mathcal{F}$ then  $A^c\in\mathcal{F}$, and&lt;/li&gt;&#xA;&lt;li&gt;if $A_1,A_2,...\in\mathcal{F}$ then $\bigcup_{n=1}^{\infty}A_n\in\mathcal{F}$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Is there a countably infinite Sigma-Algebra? Why?I want to prove it by definition (without real analysis).&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorUserId="2587" LastEditDate="2015-07-06T07:56:27.970" LastActivityDate="2015-08-05T08:27:51.520" Title="Is there a countably infinite Sigma-Algebra? Why?" Tags="&lt;stochastic-processes&gt;&lt;probability&gt;&lt;finance-mathematics&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18679" PostTypeId="2" ParentId="16840" CreationDate="2015-07-04T20:03:10.573" Score="1" Body="&lt;p&gt;If I understand your question correctly, you're asking what's a good design for a normalized feed. This is a somewhat trivial question of (i) picking which data fields (e.g. price, volume) to filter out from each feed and (ii) how to keep that in a trading system with minimal computational overhead.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Regarding (i)&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I highly recommend you approach this in a test-driven manner. In other words, figure out what data your application is going to use downstream and 'reverse out' what you need to normalize upstream.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A trivial example: If your strategy just needs prices, there's probably little use in normalizing the match numbers. If your compliance and post-trade analysis is keyed by transaction times rather than sequence numbers, then you probably don't need that either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Two tips that I can give you are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Don't overstretch yourself. It's easy to make the mistake of trying to normalize too many from day 1. You don't want to waste time trying to get spot FX, swaps, equity options, equities, exchange-traded futures etc. all onto the same normalized feed. It will probably take you a very long time before you're dealing with all that, and by the time you have to, you probably have someone else redoing this for you anyway.&lt;/li&gt;&#xA;&lt;li&gt;Think a bit about how you will maintain depreciated fields and version changes you make to your normalized feed. No matter how exhaustive your initial design, I guarantee you will encounter changes over the course of implementation and real-time use.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;Regarding (ii)&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Without knowing your exact architecture, the best answer we can give you is a collection of obvious software development tips: keep this in memory, minimize allocation and GC overhead, and minimize the number of times you're shuttling the data from thread to thread.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Important note&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;If you're trading based on more than 1 data feed, this is not something you want to do alone. It's seriously not worth your time. There's a reason why vendor normalized data feeds are costly, they take a lot of time to maintain.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The part I don't get about your question is: Bloomberg is a normalized data feed provider whereas FIX is sometimes used by exchanges directly, why are you normalizing across the two? Then you're just introducing unnecessary overhead in the Bloomberg path. I would just use Bloomberg alone if that's the case.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2015-07-04T20:03:10.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18680" PostTypeId="2" ParentId="3284" CreationDate="2015-07-04T20:08:59.193" Score="-2" Body="&lt;p&gt;I am and have been a silver member for 3 years with EODDATA. I have had no problems. BTW I write my own code and have a degree in Economics and am a former computer systems analyst. I download their data about once a week. I do not care about hourly price fluctuations or Milan stock exchange or commodities. I am just a simple and profitable investor in the style of Benjamin Graham. EODDATA works. Its simple and has value.&lt;/p&gt;&#xA;" OwnerUserId="16773" LastActivityDate="2015-07-04T20:08:59.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18683" PostTypeId="1" CreationDate="2015-07-04T23:02:32.587" Score="1" ViewCount="28" Body="&lt;p&gt;I am trying to calculate what % of times the price touches R1 before the pivot level.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the data for the last 10 years and know how often it touches the R1 one and pivot point but I don't know how to calculate when one is touched before the other. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any hint will be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="16774" LastEditorUserId="2553" LastEditDate="2015-07-04T23:24:05.840" LastActivityDate="2015-07-04T23:24:05.840" Title="How do I calculate what % of price hits R1 before pivot" Tags="&lt;statistics&gt;&lt;technical-analysis&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18684" PostTypeId="1" AcceptedAnswerId="18686" CreationDate="2015-07-04T23:52:16.857" Score="9" ViewCount="3653" Body="&lt;p&gt;What is the formula for the vanilla option (Call/Put) price in the Heston model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I only found the  bi-variate system of stochastic differential equations of Heston model but no expression for the option prices.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorDisplayName="user16651" LastEditDate="2015-07-05T18:25:58.130" LastActivityDate="2017-06-10T07:20:55.087" Title="Heston Model Option Price Formula" Tags="&lt;option-pricing&gt;&lt;heston&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18686" PostTypeId="2" ParentId="18684" CreationDate="2015-07-05T08:08:15.513" Score="7" Body="&lt;p&gt;In the &lt;a href=&quot;http://elis.sigmath.es.osaka-u.ac.jp/research/Heston-original.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Heston Model&lt;/a&gt; we have&#xA;\begin{align}&#xA;C(t\,,{{S}_{t}},{{v}_{t}},K,T)={{S}_{t}}{{P}_{1}}-K\,{{e}^{-r\tau }}{{P}_{2}}&#xA;\end{align}&#xA;where, for $j=1,2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;&amp;amp; {{P}_{j}}({{x}_{t}}\,,\,{{v}_{t}}\,;\,\,{{x}_{T}},\ln K)=\frac{1}{2}+\frac{1}{\pi }\int\limits_{0}^{\infty }{\operatorname{Re}\left( \frac{{{e}^{-i\phi \ln K}}{{f}_{j}}(\phi ;t,x,v)}{i\phi } \right)}\,d\phi  \\ &#xA; &amp;amp; {{f}_{j}}(\phi \,;{{v}_{t}},{{x}_{t}})=\exp [{{C}_{j}}(\tau ,\phi )+{{D}_{j}}(\tau ,\phi ){{v}_{t}}+i\phi {{x}_{t}}] \\ &#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;  &amp;amp; {{C}_{j}}(\tau ,\phi )=(r-q)i\phi \,\tau +\frac{a}{{{\sigma }^{2}}}{{\left( ({{b}_{j}}-\rho \sigma i\phi +{{d}_{j}})\,\tau -2\ln \frac{1-{{g}_{j}}{{e}^{{{d}_{j}}\tau }}}{1-{{g}_{j}}} \right)}_{_{_{_{{}}}}}} \\ &#xA; &amp;amp; {{D}_{j}}(\tau ,\phi )=\frac{{{b}_{j}}-\rho \sigma i\phi +{{d}_{j}}}{{{\sigma }^{2}}}\left( \frac{1-{{e}^{{{d}_{j}}\tau }}}{1-{{g}_{j}}{{e}^{{{d}_{j}}\tau }}} \right) \\ &#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&#xA;\begin{align}&#xA;  &amp;amp; {{g}_{j}}=\frac{{{b}_{j}}-\rho \sigma i\phi +{{d}_{j}}}{{{b}_{j}}-\rho \sigma i\phi -{{d}_{j}}} \\ &#xA; &amp;amp; {{d}_{j}}=\sqrt{{{({{b}_{j}}-\rho \sigma i\phi )}^{2}}-{{\sigma }^{2}}(2i{{u}_{j}}\phi -{{\phi }^{2}})} \\ &#xA; &amp;amp; {{u}_{1}}=\frac{1}{2}\,,\,{{u}_{2}}=-\frac{1}{2}\,,\,a=\kappa \theta \,,\,{{b}_{1}}=\kappa +\lambda -\rho \sigma \,,\,{{b}_{2}}=\kappa +\lambda \,,\ {{i}^{2}}=-1 \\ &#xA;\end{align}&#xA;Other representations:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.math.nyu.edu/research/carrp/papers/pdf/jcfpub.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Carr-Madan (1999)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.optioncity.net/pubs/ch1excerpt.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Lewis (2000)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=520042&quot; rel=&quot;nofollow noreferrer&quot;&gt;Attari (2004)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://eu.wiley.com/WileyCDA/WileyTitle/productCd-0471792519.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Gatheral (2006)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://perswww.kuleuven.be/~u0009713/HestonTrap.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Albercher (2007)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerDisplayName="user16651" LastEditorUserId="5617" LastEditorDisplayName="user16651" LastEditDate="2017-06-10T07:20:55.087" LastActivityDate="2017-06-10T07:20:55.087" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18687" PostTypeId="1" CreationDate="2015-07-05T10:15:54.080" Score="4" ViewCount="3187" Body="&lt;p&gt;I need to estimate a multivariate VECM-GARCH (or simply VAR-GARCH) in R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Browsing on the internet, I did not find anything yet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you know if such kind of packages exists?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please, note that a BEKK approach is required since I am working on some optimal hedge ratio calculation and volatility analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any hint will be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="16782" LastEditorUserId="16782" LastEditDate="2015-07-18T06:05:50.430" LastActivityDate="2015-12-07T05:10:19.453" Title="Any package to run VAR-GARCH or VECM-GARCH models in R?" Tags="&lt;r&gt;&lt;garch&gt;&lt;var&gt;&lt;econometrics&gt;&lt;multivariate&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18688" PostTypeId="1" CreationDate="2015-07-05T10:27:14.897" Score="4" ViewCount="402" Body="&lt;p&gt;I am currently writing a paper about the performance characteristics of alternative energy equity indexes and am therefore comparing them to their benchmark indexes (msci world, etc). To calculate the Sharpe Ratio i first take the logarithmic difference of monthly index returns and then subtract it by 1 month LIBOR USD rate over my complete dataset (starting 2002). Afterwards i simply take the monthly mean excess return (as above) divided by the STDEV of the index returns. To annualise the mean monthly excess return and the STDEV i use the following formulas respectively: MEAN*12 and STDEV*SQRT(12). &#xA;&lt;img src=&quot;https://i.stack.imgur.com/nNJrw.png&quot; alt=&quot;Overview&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My results are mostly negative Sharpe Ratios, now i am wondering if this has to do with the timeseries being affected by the 08 crisis and wether the 1 month LIBOR is the correct riskfree asset?&lt;/p&gt;&#xA;" OwnerUserId="16783" LastActivityDate="2015-07-07T11:47:54.113" Title="Annualised Sharpe Ratio for Index vs Index Benchmarking" Tags="&lt;index&gt;&lt;sharpe-ratio&gt;&lt;libor&gt;&lt;annualized&gt;&lt;sharpe&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18689" PostTypeId="5" CreationDate="2015-07-05T13:06:23.897" Score="0" Body="&lt;p&gt;The first authors to show this phenomenon up financial markets were Jegadeesh &amp;amp; Titman (1993) that reported this strategy gains ~1% of returns per month on average; particularly, they tested momentum on different holding periods, finding that the stocks that had the higher (lower) returns over the past 3 months will have positive (negative) returns over the next 12 months.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It doesn't exist consensus about this theory, since economists had a lot of troubles reconciling this phenomenon with the market efficiency theory and the contrarian strategy.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-07-05T14:09:59.357" LastActivityDate="2015-07-05T14:09:59.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18690" PostTypeId="4" CreationDate="2015-07-05T13:06:23.897" Score="0" Body="Momentum is a trading system of buying financial assets that had high returns over the past months and selling those ones had low returns over the same time period." OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-07-05T14:09:49.193" LastActivityDate="2015-07-05T14:09:49.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18691" PostTypeId="2" ParentId="18687" CreationDate="2015-07-05T13:22:11.103" Score="3" Body="&lt;p&gt;Yes, it exists and it is called &lt;code&gt;ccgarch&lt;/code&gt; package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can install that by simply running in R &lt;code&gt;install.packages(&quot;ccgarch&quot;)&lt;/code&gt; and learn more about that on the &lt;a href=&quot;http://cran.r-project.org/web/packages/ccgarch/ccgarch.pdf&quot; rel=&quot;nofollow&quot;&gt;CRAN relative paper&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, I suggest you to read this &lt;a href=&quot;http://www.r-project.org/conferences/useR-2008/slides/Nakatani.pdf&quot; rel=&quot;nofollow&quot;&gt;lecture&lt;/a&gt; hold by the author during an R conference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this help.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-07-05T13:22:11.103" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18692" PostTypeId="1" CreationDate="2015-07-05T13:43:12.380" Score="4" ViewCount="1308" Body="&lt;p&gt;I'm required to use the Euler Monte Carlo method to compute the option price under Heston model settings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know from some paper that the convergence is volatile for the Heston model with a plain Monte Carlo and Euler scheme, so I use the &lt;a href=&quot;http://web.maths.unsw.edu.au/~fkuo/sobol/joe-kuo-notes.pdf&quot; rel=&quot;nofollow&quot;&gt;Sobol sequence&lt;/a&gt; to generate quasi-random numbers. However, now the problem comes to that the generated series is correlated at different time steps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In detail, it's OK when I use norminv to transform the quasi-random numbers to standard normal distribution. However, after I use the correlation $\rho$ to make correlated series at the same time step, it turns out that the series in different time steps are also correlated. If I ignore this problem, the result of my function would be significantly larger than the analytical solution given by &lt;a href=&quot;https://quanto.inria.fr/premia/koPremia&quot; rel=&quot;nofollow&quot;&gt;https://quanto.inria.fr/premia/koPremia&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should I use a Brownian Bridge to deal with this problem? If so, how&#xA;do I do it in &lt;a href=&quot;http://en.wikipedia.org/wiki/MATLAB&quot; rel=&quot;nofollow&quot;&gt;MATLAB&lt;/a&gt;? Or how could I eliminate the series correlation in quasi-random numbers?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my MATLAB code for the plain Monte Carlo method. The problem is that it doesn't converge at all.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function [price,error] = heston_mc(S0, K, V0, rho, kappa, theta, eta, r, T, n, m, rseed)&#xA;&#xA;    %V0 is the initial variance, and kappa is the mean reversion speed of&#xA;    %variance, theta the mean reversion level, neta the volatility of&#xA;    %variance.&#xA;&#xA;    %Generate correlated random numbers&#xA;&#xA;    if ~exist('rseed','var')&#xA;        rseed = 42;&#xA;    end&#xA;&#xA;    seed = RandStream.create('mcg16807','seed',rseed);&#xA;    z = randn(seed, n-1, 2*m);&#xA;    zX = z(:, 1:m);&#xA;    zV = rho*zX + sqrt(1-rho^2)*z(:, m+1:2*m);&#xA;    delta = T/n;&#xA;    V = [repmat(V0,1,m); zeros(n-1,m)];&#xA;    X = [repmat(log(S0), 1, m); zeros(n-1, m)];&#xA;&#xA;    for i = 2:n&#xA;        X(i, :) = X(i-1, :) + (r-max(V(i-1, :), 0)/2)*delta + sqrt(delta)*sqrt(max(V(i-1, :), 0)).*zX(i-1, :);&#xA;        V(i, :) = V(i-1, :) + kappa*(theta-max(V(i-1, :),0))*delta + eta*sqrt(delta)*sqrt(max(V(i-1, :), 0)).*zV(i-1, :);&#xA;    end&#xA;&#xA;    option = exp(-r*T)*max(exp(X(end, :))-K, 0);&#xA;    price = mean(option);&#xA;    error = std(option)/sqrt(m);&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7308" LastEditorUserId="16786" LastEditDate="2015-07-05T17:53:28.543" LastActivityDate="2016-11-14T13:12:38.243" Title="How to do a Brownian Bridge with quasi-random numbers in the Heston model?" Tags="&lt;monte-carlo&gt;&lt;heston&gt;&lt;sde&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18693" PostTypeId="1" AcceptedAnswerId="18722" CreationDate="2015-07-05T14:16:39.673" Score="2" ViewCount="4569" Body="&lt;p&gt;I am a little bit confused about VaR in Options and I need a clarification for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I collected the following &lt;a href=&quot;http://www.quantitative-finance-by-examples.com/Value-at-Risk-Model-II.html&quot; rel=&quot;nofollow&quot;&gt;formulas&lt;/a&gt;, can you suggest what is the best formula and explain me why, please?&lt;/p&gt;&#xA;" OwnerUserId="16401" LastEditorUserId="2553" LastEditDate="2015-07-05T14:39:09.427" LastActivityDate="2015-11-06T14:44:31.667" Title="VaR calculation methods of options" Tags="&lt;options&gt;&lt;var&gt;&lt;delta&gt;&lt;gamma&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18694" PostTypeId="2" ParentId="18692" CreationDate="2015-07-05T14:40:48.857" Score="5" Body="&lt;p&gt;You don't need to use the &lt;a href=&quot;http://web.maths.unsw.edu.au/~fkuo/sobol/joe-kuo-notes.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Sobol sequence&lt;/a&gt; to generate quasi-random numbers in MATLAB. We know the Heston model is represented by the bi-variate system of stochastic differential equations (SDE):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;  &amp;amp; d{{S}_{t}}=rS_tdt+{\sqrt\upsilon_t} d{{W}_{1}}(t) \\&#xA; &amp;amp; d{{\upsilon}_{t}}=\kappa(\theta-\upsilon_t) dt+\sigma{\sqrt\upsilon_t}d{{W}_{2}}(t), \\&#xA;\end{align}&#xA;where&#xA;\begin{align}&#xA;dW_1(t)dW_2(t)=\rho dt.&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All of the simulation schemes, like the Euler-scheme for the Heston model, contain the same basic steps. First, two independent standard normal random variables are generated, and then made dependent by applying a Cholesky decomposition. These are multiplied by $\sqrt{\Delta t}$ to make them proxy Brownian motion increments. Second, we obtain the updated $v_{t+\Delta t}$. Third, we obtain the updated value $S_{t+\Delta t}$ or $x_t=\ln S_{t+\Delta t}$.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Initialize $S_0$ to the spot price (or $x_0$ to the log spot price), and initialize $v_0$ to the current variance parameter.&lt;/li&gt;&#xA;&lt;li&gt;Generate two independent normal random variables $Z_1$ and $Z_2$, and define&#xA;$Z_v= Z_1$ and $Z_S=\rho Z_v+\sqrt{1-\rho^2}Z_2$. Proxy the Brownian motion by $dW_1(t)=\sqrt{\Delta t}Z_S$ and $dW_2(t)=\sqrt{\Delta t}Z_v$.&lt;/li&gt;&#xA;&lt;li&gt;Obtain the updated value $v_{t+\Delta t}$.&lt;/li&gt;&#xA;&lt;li&gt;Given $v_{t+\Delta t}$, obtain the updated value $S_{t+\Delta t}$ (or $x_{t+\Delta t}$) and return to Step 2.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Implementation in the MATLAB&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please insert $\kappa, \theta, \sigma, v_0, S_0, r, q, \rho, T, M, and N$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/KecMm.png&quot; alt=&quot;Enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1153950&quot; rel=&quot;nofollow noreferrer&quot;&gt;Jianwei Zhu's example&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/RiKgs.png&quot; alt=&quot;Enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/I3Npr.png&quot; alt=&quot;Enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2015-07-05T17:37:35.197" LastActivityDate="2015-07-05T17:37:35.197" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="18695" PostTypeId="2" ParentId="18557" CreationDate="2015-07-05T15:11:52.097" Score="4" Body="&lt;p&gt;The following paper gives a simple derivation of the BSM (via a simple integration approach instead of the classical PDE approach) and the Greeks plus some intuition for each:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://garven.com/papers/garven_options.pdf&quot; rel=&quot;nofollow&quot;&gt;Derivation and Comparative Statics of the Black-Scholes Call and Put Option Pricing Formulas by Garven, J.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You find the derivation of the Greeks in chapter 4 (called &quot;comparative statics&quot;) on p. 12ff.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2015-07-05T15:11:52.097" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18697" PostTypeId="1" AcceptedAnswerId="18705" CreationDate="2015-07-05T20:03:04.197" Score="2" ViewCount="3513" Body="&lt;p&gt;Does anybody know how to use the Halton pseudo random technique in monte carlo simulation. I'm able to generate the sequences and I know they are correct. I checked a couple of numbers from different sequences. But how do I use these numbers when I want to generate a path? Do I only use one base number and use this vector for generating asset paths? For different paths I wouldn't use the same numbers but I won't change the base, or do I need the change the base? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hopefully somebody can explain me this.&lt;/p&gt;&#xA;" OwnerUserId="16788" LastActivityDate="2017-01-21T04:11:12.803" Title="How to use Halton sequence in monte carlo simulation" Tags="&lt;monte-carlo&gt;&lt;random-variables&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18698" PostTypeId="5" CreationDate="2015-07-05T20:12:11.703" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2015-07-05T20:12:11.703" LastActivityDate="2015-07-05T20:12:11.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18699" PostTypeId="4" CreationDate="2015-07-05T20:12:11.703" Score="0" Body="Financial ratio analysis" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2015-07-06T07:03:54.447" LastActivityDate="2015-07-06T07:03:54.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18701" PostTypeId="1" CreationDate="2015-07-05T21:51:18.913" Score="6" ViewCount="522" Body="&lt;p&gt;John Hull states in his text that &quot;AS the maturity of the option is increases the percentage impact of nonconstant volatility on (option) prices becomes more pronounced, but its percentage impact on implied volatility usually becomes less pronounced.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm having difficulty understanding what he means here. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Does nonconstant volatility produce higher option prices than a constant volatility would for options with the same underlying, strike and time to maturity ?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How does a nonconstant volatility effect implied volatility / what's the relationship here ?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="9265" LastEditDate="2015-07-05T21:57:30.200" LastActivityDate="2015-07-06T04:50:46.370" Title="Implied volatility and nonconstant volatility" Tags="&lt;options&gt;&lt;volatility&gt;&lt;implied-volatility&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18702" PostTypeId="1" CreationDate="2015-07-05T21:56:31.273" Score="3" ViewCount="475" Body="&lt;p&gt;I was reading a textbook and came across some surprising stuff in the section about gap options.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Let $X$ be a  payoff function such that $X=\Big\{\matrix{0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  , \ \ \ \ S(T)\leq K_2 \cr  S(T)-K_1\ \ \ \ ,\ \ \ \ \ S(T)&amp;gt; K_2}$ &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The payoff would be negative if $K_2&amp;lt;S(T)&amp;lt; K_1$. The textbook says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Notice that sometimes the option holder is forced to exercise at a loss! Perhaps the name &quot;option&quot; is a misnomer.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This seems surprising.  Is it true that gap options can incur loss for the option holder beyond the initial price?  Can you be &quot;forced&quot; to exercise options?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I looked online and didn't find anything.  Also, feel free to edit/migrate if necessary.&lt;/p&gt;&#xA;" OwnerUserId="16789" LastEditorDisplayName="user16651" LastEditDate="2015-07-05T22:24:50.737" LastActivityDate="2015-10-04T02:02:50.740" Title="Forced to exercise gap options" Tags="&lt;options&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18703" PostTypeId="2" ParentId="18702" CreationDate="2015-07-05T22:18:42.957" Score="1" Body="&lt;p&gt;Trigger contracts certainly exist and sometimes the trigger is out of the money and so yes the holder loses out. I have seen traded swaps that cancel when a reference rate is passed and the cancelling is disadvantageous. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Stop thinking of the contracts as &quot;options&quot; and start thinking of them as derivatives. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-07-05T22:18:42.957" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18704" PostTypeId="1" AcceptedAnswerId="18706" CreationDate="2015-07-05T22:20:42.733" Score="3" ViewCount="488" Body="&lt;p&gt;I have an IT background and I would like to use data from a forex calendar like &lt;a href=&quot;http://www.dailyfx.com/calendar&quot; rel=&quot;nofollow&quot;&gt;this one&lt;/a&gt; to predict prices. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that calendar news impacts can last for days or weeks or even can effect previous hours to their release. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I would like to use this fundamental information as signal for a trading system, I have read about &lt;a href=&quot;https://en.wikipedia.org/wiki/Time_delay_neural_network&quot; rel=&quot;nofollow&quot;&gt;Time Delay Neural Networks&lt;/a&gt; and I think it could be useful for this task.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone knows or can point to references on how can I apply a Time Delay Neural Network to accomplish this? Thanks beforehand!&lt;/p&gt;&#xA;" OwnerUserId="16335" LastActivityDate="2015-07-05T22:34:37.847" Title="Applying Time Delay Neural Network to financial events" Tags="&lt;time-series&gt;&lt;fundamentals&gt;&lt;neural-networks&gt;&lt;calender&gt;&lt;economic-calender&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18705" PostTypeId="2" ParentId="18697" CreationDate="2015-07-05T22:27:15.270" Score="3" Body="&lt;p&gt;First I provide a brief description of Halton sequences. A &lt;strong&gt;Halton&lt;/strong&gt; sequence is a deterministic sequence of numbers that provides well-spaced 'draws' from an interval and provides negative correlation between simulated probability for individuals. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Generation is based on a prime number&lt;/li&gt;&#xA;&lt;li&gt;Sequence is constructed based on finer and finer prime-based divisions of sub-intervals of unit interval&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;prime = 3&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;del&gt;0&lt;/del&gt;, 1/3, 2/3, &lt;del&gt;3/3&lt;/del&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;1/3, 2/3&lt;/strong&gt;    (length is 3^1 - 1)&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;del&gt;0&lt;/del&gt;, 1/9, 2/9, 3/9, 4/9, 5/9, 6/9, 7/9, 8/9, &lt;del&gt;9/9&lt;/del&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;3/9, 6/9, &lt;strong&gt;1/9, 4/9, 7/9, 2/9, 5/9, 8/9&lt;/strong&gt; (length is 3^2 - 1)&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;del&gt;0&lt;/del&gt;, 1/27, 2/27, 3/27, 4/27, 5/27, 6/27, 7/27, 8/27, 9/27, 10/27, 11/27, 12/27, 13/27, 14/27, 15/27, 16/27, 17/27, 18/27, 19/27, 20/27, 21/27, 22/27, 23/27, 24/27, 25/27, 26/27, &lt;del&gt;27/27&lt;/del&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;3/9, 6/9, 1/9, 4/9, 7/9, 2/9, 5/9, 8/9, &lt;strong&gt;1/27, 10/27, 19/27, 4/27, 13/27, 22/27, 2/27, 7/27, 16/27, 25/27, 2/27, 11/27, 20/27, 5/27, 14/27, 23/27, 8/27, 17/27, 26/27&lt;/strong&gt; (length is 3^3 - 1)&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;A quick explanation for this long sequence. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;del&gt;0&lt;/del&gt;, 1/27 [9], 2/27 [18]&lt;/li&gt;&#xA;&lt;li&gt;9/27 [1], 10/27 [10], 11/24 [19]&lt;/li&gt;&#xA;&lt;li&gt;18/27 [2], 19/27 [11], 20/27 [20]&lt;/li&gt;&#xA;&lt;li&gt;3/27 [3], 4/27 [12], 5/27 [21]&lt;/li&gt;&#xA;&lt;li&gt;12/27 [4], 13/24 [13], 14/27 [22]&lt;/li&gt;&#xA;&lt;li&gt;21/27 [5], 22/27 [14], 23/27 [23]&lt;/li&gt;&#xA;&lt;li&gt;6/27 [6], 7/27 [15], 8/27 [24]&lt;/li&gt;&#xA;&lt;li&gt;15/27 [7], 16/27 [16], 17/27 [25]&lt;/li&gt;&#xA;&lt;li&gt;24/27 [8], 25/27 [17], 26/27 [26]&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Hopefully the pattern is clear. Now, let's say that I take the sequence of length 8, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;3/9, 6/9, 1/9, 4/9, 7/9, 2/9, 5/9, 8/9&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to find the value of a European call option with payoff at time $t$ of $max(0, S(t) - K)$ where $K$ is the strike price and $S(t)$ is the stock price at $t$. Let's say that the risk neutral process for the stock is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dS(t)/S(t) = (r-\delta)dt + \sigma \tilde{dZ}(t)$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $dZ(t) = \phi dt + dZ(t)$. Then $d\ln(S(t)) = (r - \delta - 0.5\sigma^2) dt + \sigma \tilde{dZ(t)}$ so that $\ln(S(t)/S(0)) \sim N(m = (r-\delta - 0.5\sigma^2)t, v = \sigma \sqrt{t})$ where $\delta$ is the continuously compounded dividend rate on the stock, $r$ is the risk-free interest rate and $\sigma$ is the volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First we can use the inversion method to transform the uniform number into random normal numbers. The first number would be $N^{-1}(1/3)$ = -0.43. This is the quantile function of the standard normal distribution with $N(-0.43) = 1/3$. The transformed standard normal numbers are &lt;strong&gt;-0.43, 0.43, -1.22, -0.139, 0.765, -0.765, 0.139, 1.22&lt;/strong&gt;. Denote a standard normal number by $z_j$. Then a normal random number from our distribution, $n_j = v z_j + m_j$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's assume that $\sigma = 0.3$, $r = 0.05$, $\delta = 0$ and $t=1$ is the time to expiration. Then $m = (0.05 - 0 - 0.5*0.3^2) = 0.005$ and $v = 0.30$. The first transformed normal number is $0.30 (-0.43) + 0.005 = -0.124$. The list of numbers is&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;-0.124, 0.134, -0.361, -0.0369, 0.234, -0.2244, 0.0469, 0.3712&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Then we take $x_j = exp(n_j)$ to get the log-normal random numbers. The first log-normal random number is $exp(-0.124) = 0.883$. The list of numbers i&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;0.883, 1.14, 0.697, 0.964, 1.264, 0.80, 1.048, 1.45&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Let's say that the initial stock price is $S(0) = 40$. Then the stock prices at expiration, $S(1) = S(0) x_j$. The first stock price is 40 * 0.883 = 35.33. The list of stock prices are shown, following by the payoffs with $K=40$ for a European call.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;S(1): &lt;strong&gt;35.33, 45.75, 27.87, 38.55, 50.57, 31.96, 41.92, 57.98&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;Payoff(1): &lt;strong&gt;0, 5.75, 0, 0, 10.57, 0, 1.92, 17.98&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The average payoff is 3.286. The time 0 estimated price of the option is $C = exp(-0.05) 3.286 = 4.53$. The Black-Scholes price of the option is 5.692502. If we use 26 numbers, our price becomes 4.89. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT 1&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will provide an example of what I mean by intermediate price - I will use the Halton sequence above to estimate the price of a Geometric Average Price Call with $K=40$. Note that there is a closed form Black Scholes formula for this option shown &lt;a href=&quot;https://quant.stackexchange.com/questions/17450/using-black-scholes-to-price-a-geometric-average-price-call&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$u$ = 3/9, 6/9, 1/9, 4/9, 7/9, 2/9, 5/9, 8/9&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$z$ = -0.43, 0.43, -1.22, -0.1397, 0.765, -0.765, 0.1397, 1.22&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$n$ = 0.089, 0.094, -0.2564, -0.027, 0.165, -0.160, 0.032, 0.2614&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$x$ = 0.915, 1.10, 0.774, 0.973, 1.18, 0.852, 1.03, 1.30&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_{1/2}$ = 36.60, 43.94, 30.95, 38.93, 47.16, 34.09, 41.31, 51.95&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's now use a different set of Halton numbers (with prime = 2). The sequence is 1/2, 1/4, 3/4, 1/8, 5/8, 3/8, 7/8, 1/16, 9/16, 5/16, ... but we only want the first 8 numbers. Note that the stock price $36.69 = 36.60 * 1.0025$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$u$ = 1/2, 1/4, 3/4, 1/8, 5/8, 3/8, 7/8, 1/16&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$z$ = 0.00, -0.674, 0.674, -0.115, 0.3189, -0.3189, 1.15, -1.534&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$n$ = 0.0025, -0.1405, 0.1455, -0.2415, 0.070, -0.0651, 0.2465, -0.3229&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$x$ = 1.0025, 0.8689, 1.16, 0.785, 1.072, 0.9370, 1.28, 0.724&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_{1}$ = 36.69, 38.17, 35.80, 30.58, 50.59, 31.95, 52.86, 37.61&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The geometric averages are $( S_{1/2} S_{1} )^{1/2}$. For instance, $36.64 = (36.60 * 36.69)^{0.5}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$G$ = 36.64, 40.95, 33.289, 34.50, 48.845, 33.00, 46.73, 44.21&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value of the option for each of these averages is shown below. Note that $max(0, 36.64 - 40) = 0$ and $max(0, 40.954 - 40) = 0.95433$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V$ = 0.00, 0.954, 0.00, 0.00, 8.85, 0.00, 6.73, 4.21&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The option price is estimated to be $\overline{V} e^{-r (1)} = 2.59 e^{-0.05} = 2.47$.&lt;/p&gt;&#xA;" OwnerUserId="16710" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2015-07-06T18:01:54.690" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="18706" PostTypeId="2" ParentId="18704" CreationDate="2015-07-05T22:34:37.847" Score="0" Body="&lt;p&gt;I suggest you to read as reference the following paper:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Yao, Jingtao, and Chew Lim Tan. &quot;A case study on using neural networks&#xA;  to perform technical forecasting of forex.&quot; Neurocomputing 34.1&#xA;  (2000): 79-98.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The authors applied TDNNs to the forex markets and I think it could be useful for you purposes; you can find the pdf version of the paper &lt;a href=&quot;http://www.researchgate.net/profile/Jingtao_Yao/publication/222517139_A_case_study_on_using_neural_networks_to_perform_technical_forecasting_of_forex/links/00b49534422f0227e1000000.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As regards the available tools to construct this kind of model, I know you can implement that in &lt;code&gt;matlab&lt;/code&gt;, by exploiting `&lt;a href=&quot;http://it.mathworks.com/help/nnet/ref/timedelaynet.html&quot; rel=&quot;nofollow&quot;&gt;timedelaynet&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this will help.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-07-05T22:34:37.847" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18707" PostTypeId="1" AcceptedAnswerId="18710" CreationDate="2015-07-05T23:06:30.670" Score="3" ViewCount="3727" Body="&lt;p&gt;I am using an EWMA model to evaluate the correlation between yearly time series. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know Riskmetrics uses $\lambda=0.94$ for daily data and $\lambda=0.97$ for monthly data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a value suggested for yearly data? If not, how can it be estimated?&lt;/p&gt;&#xA;" OwnerUserId="12214" LastEditorUserId="2553" LastEditDate="2015-07-06T00:08:17.983" LastActivityDate="2019-08-17T15:03:14.797" Title="Estimating correlation using EWMA" Tags="&lt;time-series&gt;&lt;correlation&gt;&lt;estimation&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18708" PostTypeId="2" ParentId="18701" CreationDate="2015-07-05T23:20:38.033" Score="4" Body="&lt;p&gt;In general, $v = \frac{\partial C}{\partial \sigma} &amp;gt; 0$ and $\theta = \frac{\partial C}{\partial t} &amp;lt; 0$. If maturity $T$ increases than $C$ increases. Suppose volatility is non-constant. Then if $T$ increases, the option value is more volatile, since the stock price is more volatile. Since $v &amp;gt; 0$ the option price must increase. He claims that $\frac{\partial v}{\partial T} &amp;gt; 0$. Let $\phi(x)$ represent the standard normal density. Below I will derive $\frac{\partial v}{\partial T}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align*}&#xA;v &amp;amp;= S\phi(d_1)\sqrt{T} \\&#xA;\frac{\partial v}{\partial T} &amp;amp;= 0.5T^{-0.5}S\phi(d_1) - d_1 v \cdot \frac{\partial v}{\partial T}d_1 \\&#xA;&amp;amp;= \frac{v}{t} \left(\frac{2 - d_3}{2} \right)&#xA;\end{align*}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $d_3 = d_1 - \frac{2\ln(S/K)}{\sigma\sqrt{T}}$. This term is &gt; 0 if $d_3 &amp;lt; 2$. From my understanding the percentage impact of the implied volatility would decrease if the partial derivative is negative ($d_3 &amp;gt; 2$). If $\sigma(t)$ represents non constant volatility and $v(t) = \frac{\partial C}{\partial \sigma(t)}$ then $\frac{\partial v(t)}{\partial T}$ should be &gt; 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe that a GARCH model (non-constant volatility) could result in higher or lower prices than the Black-Scholes formula (constant, implied volatility). For instance, look &lt;a href=&quot;https://www.google.ca/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0CCwQFjAA&amp;amp;url=http%3A%2F%2Fwww.mcgill.ca%2Ffiles%2Fdesautels%2FGar96oct.pdf&amp;amp;ei=yLqZVcLqC4vwoASJvLf4Cw&amp;amp;usg=AFQjCNFOSqDDnO7-yZ0C9V6z5KATG5zN3Q&amp;amp;sig2=82z9MrLfZf7vl2N9KLWecg&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT 1&lt;/strong&gt; (ignore above)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(A) &quot;As the maturity of the option increases the percentage impact of non-constant volatility on (option) prices becomes more pronounced&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(B) &quot;As the maturity of the option increases, the percentage impact of non-constant volatility on implied volatility usually becomes less pronounced.&quot;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Does non-constant volatility produce higher option prices than a constant volatility would for options with the same underlying, strike and time to maturity?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How does a non-constant volatility effect implied volatility / what's the relationship here ?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Given more time to expiration, the stock price can fluctuate more. This means that the option value can fluctuate more. Because volatility (in particular non-constant volatility) will likely change the stock price more given a longer amount of time, the option price will change more. This is how I interpret (A).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An average volatility becomes more stable over time. The implied volatility is an estimated constant volatility. Therefore, as time increases, the implied volatility will change less since the average non-constant volatility will remain more or less the same. This is how I interpret (B).&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Non-constant volatility &lt;em&gt;may&lt;/em&gt; produce higher option prices, but this is not always true.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I explained this question in my interpretation of (B).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="16710" LastEditorUserId="16710" LastEditDate="2015-07-05T23:39:10.567" LastActivityDate="2015-07-05T23:39:10.567" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18709" PostTypeId="2" ParentId="8514" CreationDate="2015-07-05T23:36:38.123" Score="1" Body="&lt;p&gt;There exist a lot of way to choose risk factors and the choice differs according to the kind of underlying assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, particularly, since the portfolio is composed by currencies, I would choose the risk factors mainly among all the macroeconomic variables available in your dataset or data provider. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After that, to choose on which of them basing the stress test, evaluate which ones are more predictive of the portfolio returns; again, there exists in academic literature different ways to evaluate the predictive ability of a variable and it is up to you choose which one (correlation, linear regression model $adj-R^2$, granger-causality (particular cases only),...).&#xA;I suggest to read:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Wickens, Michael R., and Peter N. Smith. &quot;Macroeconomic sources of&#xA;  FOREX risk.&quot; Univ. of York Econ. Discussion Paper 2001/13 (2001).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;that shows synthetic measures of risk in the forex market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, choose them on judgemental/expert way, trying to give an economic/rational explanation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-07-05T23:36:38.123" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18710" PostTypeId="2" ParentId="18707" CreationDate="2015-07-06T00:23:21.980" Score="4" Body="&lt;p&gt;The $\lambda$ value used in the original paper is arbitrary, but you can estimate that by assuming (in the simplest case) 2 assets and running the following model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma^2_{12,t+1}$ $=$ $\lambda$$*$$\sigma^2_{12,t-1}$$+$$(1-\lambda)$$r_{1,t}$$*$$r_{2,t}$;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;given $r_{1,t}$ and $r_{2,t}$ respectively as the returns for the asset 1 and 2 and $\sigma^2_{12,t}$ the volatility at time t.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solving by $\lambda$ as unique unknown variable, you can find the $\lambda$ estimation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To compute the correlation forecast, replace $\sigma^2_{12,t+1}$ in:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\rho_{t+1}$ $=$ $\frac{\sigma^2_{12,t+1}}{\sigma_{1,t+1}* \sigma_{2,t+1}}$;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\rho_{t+1}$ is the forecast of the correlation 1 period  ahead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://pascal.iseg.utl.pt/~aafonso/eif/rm/TD4ePt_2.pdf&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; the reference of the original paper by JP Morgan; I suggest you to read the paper an estimate $\lambda$ again, since its value depends on the volatility of returns and it changes over time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The authors used a 20-day returns period to estimate asset volatility and returns and the choice of such time period, again, was arbitrary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-07-06T08:31:40.300" LastActivityDate="2015-07-06T08:31:40.300" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18711" PostTypeId="2" ParentId="18701" CreationDate="2015-07-06T04:43:31.017" Score="3" Body="&lt;p&gt;In black-scholes the option price depends not on sigma^2 but on sigma^2 T. So if volatility is going to be 20% or 21% over the next 10 years (assume for simplicity no other values are possible, just these two with equal prob, but we don't know which) then that will have a bigger impact on the option value than a 20 vs 21 uncertainty for a 1 year option. That is at least in part what is going on here. &lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2015-07-06T04:50:46.370" LastActivityDate="2015-07-06T04:50:46.370" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18712" PostTypeId="5" CreationDate="2015-07-06T09:20:27.100" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2015-07-06T09:20:27.100" LastActivityDate="2015-07-06T09:20:27.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18713" PostTypeId="4" CreationDate="2015-07-06T09:20:27.100" Score="0" Body="The credit rating is a qualitative evaluation of the credit worthiness of a borrower (consumer, company or government) done by a rating agency, a credit bureau or a bank that consists of an estimate of the borrower's capacity to to pay back the debt." OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-07-06T11:14:02.573" LastActivityDate="2015-07-06T11:14:02.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18714" PostTypeId="1" CreationDate="2015-07-06T09:47:32.747" Score="3" ViewCount="865" Body="&lt;p&gt;I have to find the CDS's default probability using the simplest Poisson Process (intensity constant). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm wondering how to get this estimate if I have only a CDS with maturity 5years. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I had different maturities I could assume, for example, that the PD (probability of default) related to 1 years is that extracted from the CDS 1 y, then the one related to 2 years is extracted from the CDS with 2-years maturity assuming a pd for the first year equal to the one evaluated before(1year PD) and so on. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, my &lt;strong&gt;question&lt;/strong&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if I have just 1 CDS, as, for instance, the case of iTraxx crossover index, can I compute the PD assuming that this probability remains constant throughout the 5 years? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do alternative solutions exist?&lt;/p&gt;&#xA;" OwnerUserId="16791" LastEditorUserId="2553" LastEditDate="2015-07-06T12:03:02.827" LastActivityDate="2015-11-03T17:43:22.037" Title="Extracting Default probability from a single CDS" Tags="&lt;risk-management&gt;&lt;cds&gt;&lt;credit-risk&gt;&lt;default-probability&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18715" PostTypeId="1" AcceptedAnswerId="18718" CreationDate="2015-07-06T10:03:06.297" Score="3" ViewCount="921" Body="&lt;p&gt;This question might appear trivial to many (considering the questions on this site), but I think it reflects something fundamental that I am missing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To keep things simple, assume everyone is risk-neutral and there is no inflation etc, so that prices are determined using expected values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us be in year 0. Consider an asset that pays \$1 in year 1 and \$1 in year 2. Let $r_{01}$ and $r_{02}$ denote the (annually compounded) 1-year spot rate and 2-year spot rate respectively. The standard textbook way to price this asset is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P_0 = \frac{1}{1+r_{01}} + \frac{1}{(1+r_{02})^2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an alternative approach that seems reasonable. We have $P_0 = \frac{1}{1+r_{01}} + \frac{E[P_1]}{1+r_{01}}$ where $P_1$ is the expected price the asset will fetch in year 1. At time 0, $P_1$ is still a random variable and it is calculated by $P_1 = \frac{1}{1+r_{12}}$ where $r_{12}$ is the one-year spot rate when we are in year 1 (hence this is a random variable at year 0). In this case,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P_0 = \frac{1}{1+r_{01}} + \frac{E[P_1]}{1+r_{01}} = \frac{1}{1+r_{01}} + E\left(\frac{1}{1+r_{12}}\right)\frac{1}{1+r_{01}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If these two pricing methods are to be equal, then one needs&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{1}{(1+r_{02})^2} = E\left(\frac{1}{1+r_{12}}\right)\frac{1}{1+r_{01}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It does not appear to me that this must be so. In fact, I think it is the case that $(1+r_{01})E(1+r_{12})=(1+r_{02})^2$ [by considering the expected amount \$1 under a two-year strip or rollover one-year strips will earn; if LHS&gt;RHS, then borrow \$1 cash using $(1+r_{02})^2$ units of 2-year strips and lend out all that cash on $1+r_{01}$ units of 1-year strips and lent out all earnings again at end of year 1 on $(1+r_{01})(1+r_{12})$ units of 1-year strip to make profit in year 2 in expectation]. Since $E(1/X)\neq 1/E(X)$ in general, the two pricing methods cannot lead to equal outcomes. How do I resolve this contradiction?&lt;/p&gt;&#xA;" OwnerUserId="16793" LastEditorUserId="16793" LastEditDate="2015-07-06T12:41:21.347" LastActivityDate="2015-07-06T18:02:25.980" Title="Two different ways of pricing that leads to two answers" Tags="&lt;pricing&gt;&lt;spot-rate&gt;&lt;discounting&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18716" PostTypeId="2" ParentId="18626" CreationDate="2015-07-06T10:39:36.800" Score="1" Body="&lt;p&gt;As regards the &lt;strong&gt;point (1)&lt;/strong&gt;, you do not have to include the exogenous variables in the garch model, but, as described in the paper (&lt;em&gt;IV. Methodology&lt;/em&gt;, p. 7), you must estimate the following models and steps:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Get residuals vector $\epsilon_t$ by running:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$RetJP_t$ $=$ $\alpha_0$$+$$\alpha_1$$RetUS_{t-1}$$+$$\alpha_2$$ChgIR_{t-1}$$+$$\alpha_3$$RetEXR_{t}$$+$$\epsilon_t$;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To run the previous linear regression model, type the &lt;code&gt;regress&lt;/code&gt; command in stata followed by all the dependent variables ($RetJP_t$ $RetUS_{t-1}$ ...) with the variable name you gave them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get the residuals, type &lt;code&gt;predict epsilon, resid&lt;/code&gt; in stata and you'll find a new variable in the stata variable manager called &lt;code&gt;epsilon&lt;/code&gt; and corresponding to the model residuals.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Get the &lt;strong&gt;mean equation&lt;/strong&gt; by running:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$RetJP_t$ $=$ $\alpha_0$$+$$\alpha_1$$RetUS_{t-1}$$+$$\alpha_2$$ChgIR_{t-1}$$+$$\alpha_3$$RetEXR_{t}$$+$$+$$\alpha_4$$RetJP_{t-1}$$+$$\alpha_5$$\epsilon_{t-1}$$+$$w_t$;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Get the &lt;strong&gt;conditional variance&lt;/strong&gt; estimate by running the following model in stata:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$ln(h_i)$ $=$ $\beta_0$ $+$ $\beta_1$*$\left|\frac{\epsilon_{t-1}}{\sqrt[2]{h_{t-1}}}\right|$ $+$ $\beta_2$$\frac{\epsilon_{t-1}}{\sqrt[2]{h_{t-1}}}$$+$$v_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $h_i$ is the variance of $RetJP_t$ and $\epsilon_t$ is he residuals vector you got at the previous step; to get the estimate of the conditional variance, type the &lt;code&gt;predict&lt;/code&gt; command after you run the previous model at this step.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Estimate the GARCH-in-mean equation, by running the following model:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$RetJP_t$ $=$ $\alpha_0$$+$$\alpha_1$$RetUS_{t-1}$$+$$\alpha_2$$ChgIR_{t-1}$$+$$\alpha_3$$RetEXR_{t}$$+$$+$$\alpha_4$$RetJP_{t-1}$$+$$\alpha_5$$\epsilon_{t-1}$$+$$\alpha_6$$\sqrt[]{\hat{ln(h_i)}}$$+$$z_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\hat{ln(h_i)}$ is estimated conditional variance got in the previous step by using the command &lt;code&gt;predict&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You cannot do this procedure by the menus in stata, but only by command line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As regards the &lt;strong&gt;point (2)&lt;/strong&gt;, you need to use the event study methodology; to this purpose, I suggest you to follow:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=608601&quot; rel=&quot;nofollow&quot;&gt;Kothari, S. P., and Jerold B. Warner. &quot;The econometrics of event studies.&quot; Available at SSRN 608601 (2004).&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;that explains how to conduct this kind of study.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As regards the &lt;strong&gt;point (3)&lt;/strong&gt;, it is not convenient to create a dummy variable for each event. This mainly is because a natural disaster is a rare event and you will have too little observation in your dummies, such that the model will not be able to measure fully the effect of the event on your dependent variable; so, I suggest to collect all the event and create a unique dummy variable to measure the effect of such event. Moreover, the effect of a natural disaster is supposed to be negative in all cases, so, it is reasonable to think collecting all events together and assuming the weight of the different effects is similar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-07-10T18:13:19.677" LastActivityDate="2015-07-10T18:13:19.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18717" PostTypeId="2" ParentId="17268" CreationDate="2015-07-06T10:41:31.400" Score="6" Body="&lt;ol&gt;&#xA;&lt;li&gt;$S_0$: The stock price today.&lt;/li&gt;&#xA;&lt;li&gt;$p$: The probability of a price rise.&lt;/li&gt;&#xA;&lt;li&gt;$u$:The factor by which the price rises.&lt;/li&gt;&#xA;&lt;li&gt;$d$: The factor by which the price falls.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Three equations are required to be able to uniquely specify values for the three parameters of the binomial model. Two of these equations arise from the expectation that over a small period of time the binomial model should behave in the same way as an asset in a risk neutral world.This leads to the equation &#xA;\begin{align}&#xA;p\,u+(1-p)d=e^{r\,\Delta t}&#xA;\end{align}&#xA;which ensures that over the small period of time $\Delta t$ the expected return of the binomial model matches the expected return in a risk-neutral world, and the equation,&#xA;\begin{align}&#xA;p\,u^2+(1-p)d^2=\sigma^2\Delta t&#xA;\end{align}&#xA;which ensures that the variance matches. &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Cox-Ross-Rubinstein&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Cox, Ross and Rubinstein proposed the third equation &#xA;\begin{align}&#xA;u=\frac{1}{d}&#xA;\end{align}&#xA;Rearranging the above three equations to solve for parameters p, u and d leads to, &#xA;\begin{align}&#xA;&amp;amp;p=\frac{e^{r\,\Delta t}-d}{u-d}\\&#xA;&amp;amp;u=e^{\sigma\,\sqrt{\Delta t}}\\&#xA;&amp;amp;d=e^{-\sigma\,\sqrt{\Delta t}}&#xA;\end{align}&#xA;The unique solution for parameters p, u and d given in above Equation  ensures that over a short period of time the binomial model matches the mean and variance of an asset in a risk free world, and as will be seen shortly, ensures that for a multi-step model the price of the underlying asset is symmetric around the starting price $S_0$ .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/weBVs.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general the time period between today and expiry of the option is sliced into many small time periods. A tree of potential future asset prices is then calculated. Each point in the tree is refer to as a node. The tree contains potential future asset prices for each time period from today through to expiry.  &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Discounting the Payoff for American put option.&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;V_n=max\{K-S_n\,,\, e^{-\sigma\,\sqrt{\Delta t}}\left(p\,V_u+(1-p)V_d\right)\}&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$n$ designates a node prior to expiry.&lt;/li&gt;&#xA;&lt;li&gt;$V_n$ is the option value.&lt;/li&gt;&#xA;&lt;li&gt;$K$ is the strike.&lt;/li&gt;&#xA;&lt;li&gt;$S_n$ is the price of the underlying asset.&lt;/li&gt;&#xA;&lt;li&gt;$V_u$ is the option value from node upper node at $n+1$.&lt;/li&gt;&#xA;&lt;li&gt;$V_d$ is the option value from the lower node at $n+1$.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This example shows how to price an American put option with an exercise price of $\$ 90$ that matures in 1 year. The current asset price is $\$100$, the risk-free interest rate is $ 10\%$, and the volatility is $92\%$. There is no dividend payment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[Price, Option]=binprice(Price, Strike, Rate, Time, Increment, Volatility, Flag)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Flag:Specifies whether the option is a call (Flag = 1) or a put (Flag = 0). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/iLEZb.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2015-07-06T13:08:01.427" LastActivityDate="2015-07-06T13:08:01.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18718" PostTypeId="2" ParentId="18715" CreationDate="2015-07-06T11:34:17.253" Score="7" Body="&lt;p&gt;$$\frac{1}{(1+r_{02})^2} = E\left(\frac{1}{1+r_{12}}\right)\frac{1}{1+r_{01}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed, in the pricing measure, the distribution of $r_{12}$ has to be such that this relation holds. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you look at drift derivations for the LIBOR market model, a lot of work goes into making this sort of equation hold.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-07-06T11:34:17.253" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18719" PostTypeId="2" ParentId="18714" CreationDate="2015-07-06T12:16:05.763" Score="1" Body="&lt;p&gt;Yes, you can assume that, since you cannot extract the probability of default for shorter maturity, but for the 5-years only CDS one, because of unavailability of data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, you'll have to update with shorter frequency your estimate, because the extracted PD will change overtime and the $PD_t$ could be different from $PD_{t+1}$, according to the macroeconomic scenarios will affect the economy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suggest you to take a cue from:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;a href=&quot;http://businessperspectives.org/journals_free/imfi/2009/imfi_en_2009_04_Tokat.pdf&quot; rel=&quot;nofollow&quot;&gt;Byström, Hans. &quot;Credit default swaps and equity prices: The iTraxx CDS index market.&quot; Working Papers, Department of Economics, Lund University 24 (2005).&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;to understand how one analyze that kind of index and, consequently, construct the scenarios to which the CDS is exposed and how the extracted PD could change overtime.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-07-06T12:16:05.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18720" PostTypeId="1" CreationDate="2015-07-06T13:00:46.840" Score="4" ViewCount="1016" Body="&lt;p&gt;In Black Scholes model I would like to compute&#xA;$$&#xA;\beta_K = \frac{\mathrm{cov}(C_{K,T},S_T)}{\mathrm{cov}(S_T,S_T)} = \frac{\mathrm{cov}((S_T - K)^+,S_T)}{\mathrm{cov}(S_T,S_T)}&#xA;$$&#xA;with respect to say risk-neutral measure. Here $C_{K,T}$ is the payoff of the call with expiry $T$ and strike $K$ at expiry, and $S_T$ is the price of the underlying at expiry. Of course, this all can be computed just by using the log-normal distribution of $S_T$, however I wondered whether there is some trick to compute it in a faster way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Motivation: I would like to know which $\beta_K = \Delta$ minimizes the variance of $C - \Delta S$. That is, if you can't hedge dynamically, but only once, would you still choose the BS delta, or whether it is gonna be something else.&lt;/p&gt;&#xA;" OwnerUserId="13480" LastEditorUserId="13480" LastEditDate="2015-07-06T15:18:49.617" LastActivityDate="2015-07-06T15:46:06.710" Title="Beta between stock and option" Tags="&lt;black-scholes&gt;&lt;probability&gt;&lt;covariance&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18721" PostTypeId="2" ParentId="18720" CreationDate="2015-07-06T13:24:37.737" Score="1" Body="&lt;p&gt;For the terminal distributions, I don't have the closed-form solution to hand, but it's computable, since we can price power options (with payoffs like $(S_T^n-K)^+$).  You need to find&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;E[S_T C_{K,T}] = \int_K^\infty x(x-K) \cdot p_{BS}(x) dx \\=-Ke^{(r-q)T} C_{K,T} + \int_K^\infty x^2 \cdot p_{BS}(x) dx&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The latter formula is just a power-option price, which is a common homework problem whose solution can be found in many places, including &lt;a href=&quot;http://arxiv.org/pdf/1203.0599&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If an instantaneous treatment is good enough, then you really just need to know the instantaneous volatility $\omega$ of an option $C$ to compute this.  If you are willing to believe Black-Scholes, you can apply Ito's Lemma to find that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;C \cdot \omega = \Delta \cdot S \cdot \sigma_S&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit:&lt;/em&gt; added terminal distribution integrals and comments on instantaneous versus terminal&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2015-07-06T15:46:06.710" LastActivityDate="2015-07-06T15:46:06.710" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18722" PostTypeId="2" ParentId="18693" CreationDate="2015-07-06T13:29:04.933" Score="2" Body="&lt;p&gt;The &quot;right&quot; thing to do is to treat the options as derivative contracts.  Let's say for simplicity that you are using Monte Carlo to compute VaR.  Then you would simulate the equity prices on each iteration, and then apply an option-pricing formula to get the corresponding option prices on that iteration.  This lets you obtain an accurate simulated portfolio value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The VaR then just comes out as the usual tail measure of the simulated distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Technically, what is going on is that $\text{VaR}_b^\tau$ is a quantile of the portfolio value distribution&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\Pi^\tau = \sum_{i=1}^N A_i^\tau&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where some of the instruments $A_i$ may be options.  That is,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\text{VaR}_b^\tau = Q_b(\Pi^\tau).&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Delta-Gamma approximation is giving you inaccurate values of the $A_i$ (though they are fast to compute and often &quot;good-enough&quot; in real-world situations).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you look at commercial packages like RiskMetrics, they offer the user an option to use Delta-Gamma, or alternatively to price options as derivatives.  In the latter case you can also simulate volatility changes and credit risk changes to get even more precise values.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2015-07-06T13:36:15.757" LastActivityDate="2015-07-06T13:36:15.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18723" PostTypeId="2" ParentId="18570" CreationDate="2015-07-06T13:40:24.593" Score="1" Body="&lt;p&gt;Depending on how big is bid-ask spread, it may not matter at all. To start with I'd suggest that for each security you randomly pick either it's bid or ask price, and see whether the optimal weights differ much depending on your choice. If not, you can simply disregard such asymmetry. If not, I am not sure whether MPT will work nicely with your setting since it is a very linear theory, whereas using ask (for buying) and bid (for selling) introduces non-linearity.&lt;/p&gt;&#xA;" OwnerUserId="13480" LastActivityDate="2015-07-06T13:40:24.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18724" PostTypeId="2" ParentId="18588" CreationDate="2015-07-06T13:56:38.423" Score="2" Body="&lt;p&gt;This is a standard way of defining a product measure in measure theory. The reasoning is a bit technical, but pretty natural.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say you have two measure spaces $(X,\mathcal A, \mu)$ and $(Y,\mathcal B, \nu)$, and you would like to construct a product measure space $(Z,\mathcal C, \phi)$ where $Z = X\times Y$, and $\mathcal C = \mathcal A\otimes\mathcal B$. Recall from the definition of the product $\sigma$-algebra that $\mathcal C$ is generated by the family of sets $\{A\times B:A\in \mathcal A, B\in \mathcal B\}$, that is measurable rectangles. Of course this means that to define a product measure $\phi$ we need &lt;em&gt;at least&lt;/em&gt; to define it for measurable rectangles. We do this in a pretty natural way by requiring that $\phi$ is such that &#xA;$$&#xA;  \phi(A\times B) = \mu(A)\nu(B) \qquad \text{ for all }A\in \mathcal A \text{ and }B\in \mathcal B. \tag{1}&#xA;$$&#xA;You can see $(1)$ as an equation for unknown $\phi$. Two bad things can happen: even though we only put conditions on the measurable rectangles (not on all elements of the product $\sigma$-algebra) there may not be solution at all; or, if there is a solution, it may not be unique, so we'd have to come up with additional conditions. Magically (and really trivial to show), none of these issues arise: there is always a $\phi$ that satisfies $(1)$, and even better - it is unique. That's why we say that $(1)$ uniquely characterizes the product measure, and use this as a definition of the product measure. The knowledge of which values does product measure take over measurable rectangles is enough to compute its value over any product measurable set, although of course it's gonna be trickier. In fact, you can prove the following:&#xA;$$&#xA;  \phi(C) = \int_{X}\nu(C_x)\,\mu(\mathrm dx) \qquad \text{ for all }C\in \mathcal C\tag{2}&#xA;$$&#xA;where $C_x = \{y\in Y:(x,y)\in C\}$ is the $x$-section of $C$. With $(2)$ you can compute the measure over any set $C$, and in fact $(1)$ is a special case of $(2)$ since $(A\times B)_x = B$ for all $x\in X$. In some of the books $(2)$ is used as a definition of the product measure, but I'd say that's is less often.&lt;/p&gt;&#xA;" OwnerUserId="13480" LastActivityDate="2015-07-06T13:56:38.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18726" PostTypeId="2" ParentId="18715" CreationDate="2015-07-06T14:54:12.813" Score="4" Body="&lt;p&gt;There is no conflict here. In the identity,&#xA;\begin{align*}&#xA;\frac{1}{(1+r_{02})^2} = E\left(\frac{1}{1+r_{12}}\right)\frac{1}{1+r_{01}},&#xA;\end{align*}&#xA;the expectation is under the year-1 forward measure. However, in the identity \begin{align*}&#xA;(1+r_{01})E(1+r_{12})=(1+r_{02})^2,&#xA;\end{align*} &#xA;the expectation is under the year-2 forward measure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For illustration, let $P(t, u)$ be the price at time $t$ of a zero-coupon bond with maturity $u$ and unit face value. Moreover, let $B_t$ be the money market account (or deposit account) value at time $t$. For notations, let $T_1=1$ and $T_2=2$. Then &#xA;\begin{align*}&#xA;r_{12} &amp;amp;\triangleq L(T_1; T_1, T_2)\\&#xA;&amp;amp;=\frac{1}{T_2-T_1}\left(\frac{P(T_1, T_1)}{P(T_1, T_2)}-1\right)\\&#xA;&amp;amp;=\frac{1}{P(T_1, T_2)}-1.&#xA;\end{align*}&#xA;We also note that&#xA;$&#xA;P(0, T_1) = \frac{1}{1+r_{01}},&#xA;$&#xA;and&#xA;$&#xA;P(0, T_2) = \frac{1}{(1+r_{02})^2}.&#xA;$&#xA;Let $E$, $E_1$, and $E_2$ be respectively the expectation operators under the risk-neutral measure $P$, the year-1 forward measure $P_1$ and the year-2  forward measure $P_2$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is well known that the process $\{L(t; T_1, T_2) \mid 0\leq t \leq T_1 \}$ is a martingale under the year-2 forward measure. Then&#xA;\begin{align*}&#xA;E_2(1+r_{12}) &amp;amp;= E_2(1+L(T_1; T_1, T_2))\\&#xA;&amp;amp;= 1+ L(0; T_1, T_2)\\&#xA;&amp;amp;= \frac{P(0, T_1)}{P(0, T_2)}\\&#xA;&amp;amp;= \frac{(1+r_{02})^2}{1+r_{01}}.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;(1+r_{01})E_2(1+r_{12})=(1+r_{02})^2.&#xA;\end{align*} &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, note that, for $0 \leq t \leq T_1$,&#xA;\begin{align*}&#xA;\frac{dP}{dP_1}\big|_t = \frac{B_t P(0, T_1)}{P(t, T_1)}.&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;\frac{1}{(1+r_{02})^2} &amp;amp;= P(0, T_2)\\&#xA;&amp;amp;= E\left(\frac{1}{B_{T_2}}\right)\\&#xA;&amp;amp;= E\left(\frac{1}{B_{T_1}}E\left(\frac{B_{T_1}}{B_{T_2}} \mid \mathcal{F}_{T_1}\right)\right)\\&#xA;&amp;amp;= E\left(\frac{1}{B_{T_1}} P(T_1, T_2)\right)\\&#xA;&amp;amp;= E_1\left(\frac{dP}{dP_1}\big|_{T_1} \frac{1}{B_{T_1}} P(T_1, T_2)\right)\\&#xA;&amp;amp;= P(0, T_1)E_1(P(T_1, T_2))\\&#xA;&amp;amp;= P(0, T_1)E_1\left(\frac{1}{1+r_{12}}\right)\\&#xA;&amp;amp;= \frac{1}{1+r_{01}}E_1\left(\frac{1}{1+r_{12}}\right),&#xA;\end{align*}&#xA;where $\mathcal{F}_{T_1}$ is the information set at time $T_1$.&#xA;That is,&#xA;\begin{align*}&#xA;\frac{1}{(1+r_{02})^2} = E_1\left(\frac{1}{1+r_{12}}\right)\frac{1}{1+r_{01}}.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: The last identity can also be shown by the measure change between the forward measures $P_1$ and $P_2$. Specifically, for $0 \leq t \leq T_1$,&#xA;\begin{align*}&#xA;\frac{dP_1}{dP_2}\big|_t = \frac{P(t, T_1)P(0, T_2)}{P(t, T_2)P(0, T_1)}.&#xA;\end{align*}&#xA;Consequently,&#xA;\begin{align*}&#xA;E_1\left(\frac{1}{1+r_{12}}\right) &amp;amp;= E_1\left(P(T_1, T_2)\right)\\&#xA;&amp;amp;= E_2\left(\frac{dP_1}{dP_2}\big|_{T_1} P(T_1, T_2)\right)\\&#xA;&amp;amp;= \frac{P(0, T_2)}{P(0, T_1)}\\&#xA;&amp;amp;= \frac{1+r_{01}}{(1+r_{02})^2}.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-07-06T18:02:25.980" LastActivityDate="2015-07-06T18:02:25.980" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18727" PostTypeId="2" ParentId="18641" CreationDate="2015-07-06T15:16:00.520" Score="1" Body="&lt;p&gt;Perhaps other memeber of qSE are going to correct me, but I think the following rule of thumb is useful. Whenever you have a doubt, try to forget that a pricing measure is a probability measure. This is just a pricing tool: originally for any option/derivative/contingent claim we'd like to know its price, so we introduce a map $\pi:X\to \Bbb R$ such that $\pi(x)$ is the current price of the contingent claim $x$. For example, $x$ can be a call option with maturity of 1 year and ATM strike, or $x$ can be the futures contract expiring in 10 days. Now, it happens that $\pi$ is a linear functional on $X$, and $\pi(1) = 1$ - that is the value of the assets that will pay us $1$ under any circumstance is $1$ (let's assume discount rates are $0$). From that we see that $\pi$ is similar to an expectation operator, so we can define a corresponding probability measure - which we call a pricing (risk-neutral) measure. There are perhaps some deeper thought underlying such a coincidence, but for all philosophical questions: use pricing measure to find the price, to find the Greeks etc. For anything else use the physical measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example: let's say we want to buy an option which we know we can't hedge perfectly, and estimate whether we can afford vacation on Hawaii after expiry. We do the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Price the option (use pricing measure)&lt;/li&gt;&#xA;&lt;li&gt;Compute Greeks to hedge (use pricing measure)&lt;/li&gt;&#xA;&lt;li&gt;Run Monte-Carlo to estimate our losses/profits from imperfect hedge under the imperfect hedging strategy computed in step 2. (use &lt;em&gt;real&lt;/em&gt; measure)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="13480" LastActivityDate="2015-07-06T15:16:00.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18728" PostTypeId="2" ParentId="18715" CreationDate="2015-07-06T16:30:44.503" Score="0" Body="&lt;p&gt;If the prices were not equal, there would be an immediate arbitrage opportunity as you can lock in the forward rate today. Hence the law of one price holds.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2015-07-06T16:30:44.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18730" PostTypeId="1" CreationDate="2015-07-06T17:53:47.357" Score="3" ViewCount="1708" Body="&lt;p&gt;I need key Stock Fundamentals like in &lt;a href=&quot;http://finance.yahoo.com/q/ks?s=KO+Key+Statistics&quot; rel=&quot;nofollow&quot;&gt;http://finance.yahoo.com/q/ks?s=KO+Key+Statistics&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But that page shows only the last quarter data, I need to analyze how that data has changed over past years.&#xA;Yahoo provides Historical Data only for prices, where to find it for fundamentals also?&lt;/p&gt;&#xA;" OwnerUserId="7827" LastEditorUserId="2553" LastEditDate="2015-07-06T18:04:27.460" LastActivityDate="2021-03-19T16:33:31.207" Title="How to get Stock Fundamental time series data?" Tags="&lt;equities&gt;&lt;data&gt;&lt;historical-data&gt;&lt;fundamentals&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18731" PostTypeId="1" AcceptedAnswerId="18876" CreationDate="2015-07-06T18:01:07.680" Score="5" ViewCount="8210" Body="&lt;p&gt;The order-books of trading exchanges are often hidden as so-called &quot;Dark Pools&quot;. The measure was taken to avoid apparent market manipulation strategies executed by traders back then.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which such arbitrage/manipulation strategies are possible if the order book is public?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Explain the strategies in detail.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Hint #1: There are three example strategies in the comments below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hint #2: &lt;a href=&quot;https://en.wikipedia.org/wiki/High-frequency_trading&quot; rel=&quot;nofollow&quot;&gt;Google&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2015-07-13T12:54:17.457" LastActivityDate="2016-01-13T14:26:33.377" Title="Orderbook Arbitrage" Tags="&lt;quant-trading-strategies&gt;&lt;trading&gt;&lt;market-microstructure&gt;&lt;algorithmic-trading&gt;&lt;trading-systems&gt;" AnswerCount="2" CommentCount="11" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="18732" PostTypeId="2" ParentId="18730" CreationDate="2015-07-06T18:03:37.593" Score="2" Body="&lt;p&gt;There are two mainly (good) free sources available online:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.wolframalpha.com/&quot; rel=&quot;nofollow&quot;&gt;wolphramalpha.com&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.quandl.com/&quot; rel=&quot;nofollow&quot;&gt;Quandl&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;They report the mainly market and fundamental data, so you will not find any particular fundamental accounting ratio. In the case you need particular ratio or data, you should get some better financial data provider, as, for instance, Bloomberg or Thompson Reuters.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-07-06T18:03:37.593" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="18735" PostTypeId="1" CreationDate="2015-07-06T21:06:12.723" Score="1" ViewCount="65" Body="&lt;p&gt;I am using the formula &lt;a href=&quot;https://en.wikipedia.org/wiki/Yield_curve#Construction_of_the_full_yield_curve_from_market_data&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; to determine the discount factor function. I get the data for Coupons, Face Values and Closing Prices from Thomson Reuters, which I insert into the Dataframe &lt;code&gt;df&lt;/code&gt;. However, I am getting that &lt;code&gt;dicount_factors&lt;/code&gt; contains negative values as a result of the inverse of &lt;code&gt;matrix_of_coupons_and_facevalues&lt;/code&gt;. &lt;strong&gt;I am trying to decipher if there is a flaw in my code below&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;df:&#xA;&#xA;   months_to_maturity                      orig_iss_dt  \&#xA;1                   6                    2015-06-25 00:00:00.0   &#xA;2                  12                    2015-06-25 00:00:00.0   &#xA;3                  18                    2015-06-30 00:00:00.0   &#xA;4                  24                    2015-06-15 00:00:00.0   &#xA;5                  30                    2015-06-30 00:00:00.0   &#xA;&#xA;             maturity_dt  pay_freq_cd  coupon  closing_price  FACE_VALUE  &#xA;1  2015-12-24 00:00:00.0          NaN   0.000      99.960889         100  &#xA;2  2016-06-23 00:00:00.0          NaN   0.000      99.741444         100  &#xA;3  2017-06-30 00:00:00.0            2   0.625      99.968750         100  &#xA;4  2018-06-15 00:00:00.0            2   1.125     100.390625         100  &#xA;5  2020-06-30 00:00:00.0            2   1.625      99.984375         100  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#Determining the dimensions of the matrix of coupons and face values&#xA;#pay_freq_cd is number of coupon payments per year&#xA;max_freq_payments = df['pay_freq_cd'].max()&#xA;no_of_months_between_payments_for_matrix = 12/max_freq_payments&#xA;number_of_columns_and_rows = df['months_to_maturity'].max()/no_of_months_between_payments_for_matrix&#xA;&#xA;df['FACE_VALUE'] = 100&#xA;df = df.sort(['months_to_maturity'], ascending=[True])&#xA;df = df.reset_index()&#xA;&#xA;for (i,row) in df.iterrows():&#xA;    no_of_coupons_per_year_2 = row['pay_freq_cd']&#xA;    no_of_months_between_payments_2 = 12/no_of_coupons_per_year_2               &#xA;    if math.isnan(no_of_months_between_payments_2):&#xA;&#xA;        matrix_of_coupons_and_facevalues[i,(row.months_to_maturity/no_of_months_between_payments_for_matrix)-1] = (row['FACE_VALUE']) &#xA;    else:&#xA;        matrix_of_coupons_and_facevalues[i,0:((row.months_to_maturity/no_of_months_between_payments_2)-1)] = row['coupon']&#xA;        matrix_of_coupons_and_facevalues[i,(row.months_to_maturity/no_of_months_between_payments_2)-1] = (row['FACE_VALUE']) + row['coupon']&#xA;&#xA;price_array = df['closing_price'].values&#xA;price_array = np.where(np.isnan(price_array), 100, price_array)&#xA;inv_matrix_of_coupons_and_facevalues = inv(matrix_of_coupons_and_facevalues)&#xA;dicount_factors = np.dot(inv_matrix_of_coupons_and_facevalues, price_array)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: I am not accounting for $epsilon$ , as stated &lt;a href=&quot;https://en.wikipedia.org/wiki/Yield_curve#Construction_of_the_full_yield_curve_from_market_data&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;, in the equation $AP = F + epsilon$ and can hence directly solve $AP = F$ as a system of Equations. &lt;strong&gt;However, I am wondering could this be where my problem stems from?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank You&lt;/p&gt;&#xA;" OwnerUserId="11917" LastEditorUserId="11917" LastEditDate="2015-07-07T19:46:33.937" LastActivityDate="2015-07-07T19:46:33.937" Title="Issue with Naive Bootstrapping (US Government Bonds)" Tags="&lt;fixed-income&gt;&lt;python&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18736" PostTypeId="1" AcceptedAnswerId="18833" CreationDate="2015-07-06T21:06:34.360" Score="8" ViewCount="803" Body="&lt;p&gt;I'm working in double exponential Jump-diffusion model (we know as kou model)&#xA;with following form , under the physical probability measure $P$:&#xA;\begin{equation}&#xA;‎\frac{dS(t)}{S(t-)}=\mu‎‏ ‎dt+\sigma ‎dW(‎t)+d(\sum_{i=1}^{N(t)}(V_i-1))‎&#xA;\end{equation}‎&#xA;where $W(t)$ is a standard Brownian motion, $N(t)$ is a Poisson process with rate $‎\lambda$ , and $\{V_i\}$ is a sequence of independent identically distributed (i.i.d.) non negative random variables such that $Y = log(V)$  has an asymmetric double exponential distribution with the density&#xA;\begin{equation}&#xA;f_Y(y)=p.‎\eta_1 e^{-‎\eta_{1}y‎‎}‎\upharpoonleft_{y‎\geq 0‎}+q.‎\eta_2 e^{‎\eta_2 y‎} \upharpoonleft_{y&amp;lt;0},\eta_{1}&amp;gt;1,\eta_{2}&amp;gt;0 ‎‎‎&#xA;‎\end{equation}‎&#xA;where $p, q \ge 0$, $p+q = 1$, represent the probabilities of&#xA;upward and downward jumps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ $$&#xA;Solving the stochastic differential equation  gives the dynamics of the asset price:&#xA;\begin{equation}&#xA; S(t)=S(0)‎\exp‎\{(\mu- ‎\frac{1}{2}‎\sigma‎^2‎)t+‎\sigma ‎W(t)‎\} ‎\prod‎_{i=1}^{N(t)}V_i ‎‎&#xA; \end{equation}&#xA;and also The stock price process, $(S_t)_{t ‎\geq 0‎} $‎‎, driven by these model, is given by:&#xA;\begin{equation}&#xA;S_{t}=S_{0}e^{L_t}&#xA;\end{equation}&#xA;where $S_0$ is the stock price at time zero and $L_t$ is defined by:&#xA;‎\begin{equation}&#xA;‎L_t:=‎\gamma‎_{c}t+‎\sigma ‎W_t‎‎+\sum_{i=1}^{N_i}Y_i‎‎&#xA;\end{equation}&#xA;here,$‎‎‎‎‎\gamma‎_{c}$‎  is a drift term , $‎‎‎‎‎\sigma‎$‎ is a volatility, $‎‎‎‏‎W_t‎$‎‎‎‎‎ is a Brownian motion, $‎‎‎‎N_t$‎ is a Possion process with intensity ‎$ ‎‎\lambda‎‎ $‎, $ ‎Y_i‎ $ is an i.i.d. sequence of random variables.Since $‎‎‎\sigma‎&amp;gt;0$ in up equation, there exists a risk-neutral probability measure $‎‎‎‎‎‏‎Q‎$‎‎‎‎ such that the discounted process ‎$‎‎‎‎\{e^{-(r-q)} S_t\}_{t ‎\geq 0‎}$‎ becomes&#xA;a martingale,where ‎$ ‎r‎ $‎‎is the interest rate and $ ‎q‎ $ is the&#xA;dividend rate.Then under this new measure $ ‎Q‎ $, the risk-neutral Levy triplet of $L_t$ can be described as follows:&#xA;‎\begin{equation*}&#xA;(‎\gamma‎_{c},‎\sigma‎,‎‎\nu‎‎)&#xA;\end{equation*}&#xA;where&#xA;‎\begin{align*}&#xA;‎\gamma‎_{c} &amp;amp; = r-q-‎\frac{1}{2}‎\sigma‎^2+ ‎\int_{‎\mathbb{R}‎} ‎(e^x-1) ‎\nu(dx) ‎\\‎&#xA;&amp;amp; =‎ ‎‎r-q-‎\frac{1}{2}‎\sigma‎^2+ ‎\lambda ‎\eta‎&#xA;\end{align*}‎&#xA;Here we focus on the case where the Levy measure is associated to the pure-jump component and hence the Levy measure‎$ ‎\nu(dx)‎ $‎ can be written as ‎$ ‎‎\lambda‎‎‏ ‎f(x) ‎dx‎ $‎, where the weight function &#xA;‎$ ‎f(x)‎ $‎&#xA;can take the following form: &#xA;\begin{equation}&#xA;f(x):=p.‎\eta_1 e^{-‎\eta_{1}x‎‎}‎\upharpoonleft_{x‎\geq 0‎}+(1-p).‎\eta_2 e^{‎\eta_2 x‎} ‎‎‎\upharpoonleft_{x&amp;lt;0},\eta_1&amp;gt;1,\eta_2&amp;gt;0&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also in  ‎$ ‎\eta‎‏ = ‎\int_{‎\mathbb{R}‎}(e^x-1)f(x) ‎dx‎ $‎‎  represents the expected relative price change due to a jump. Since we have defined the Levy density function ‎$ ‎f(x)‎ $‎ for  double exponential Jump-diffusion model,&#xA;‎$ ‎‎\eta‎‎ $‎‏‎ can be computed as:&#xA; ‎\begin{equation}&#xA; \eta=‏ ‎‎\frac{p‏ ‎‎\alpha‎‎_1}{‎‎\alpha‎_{1}-1}+‎\frac{(1-p)‎\alpha‎_2}{‎\alpha‎_2+1}-1‎‎&#xA; \end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is found by integrating $ ‎e^x‎ $‎ over the real line by setting ‎$ ‎‎\alpha‎_1‎‏ ‎&amp;gt;1‎ $‎ and ‎$ ‎‎\alpha‎_{2}&amp;gt;0‎ $.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We let $\tau=T-t$, the time-to-maturity, where $T$ is the maturity of the financial option under consideration and we introduce $x = log S_t$, the underlying asset's log-price. If&#xA;$u(x; \tau )$ denotes the values of some (American and European) contingent claim on $S_t$ when $log St = x$ and $\tau = T - t$, then it is well-known, see for example, (Cont and Tankov, 2004)&#xA;that $u$ satisfies the following $PIDE$ in the non-exercise region:&#xA;\begin{align*}‎‎‏‎&#xA;  ‎\partial_‎\tau\, u(x,‎\tau‎)‏ &amp;amp;‎ = ‎‎\frac{1}{2}‎\sigma‎^2‏ ‎‎\partial‎_{x}^2‎ u‎ ‎+(r-q-‎\frac{1}{2}‎\sigma‎^2‎-\lambda \eta)‎\partial‎_x ‎u-(r+‎\lambda‎)u \\ ‎&amp;amp;+ ‎‎\lambda ‎\int ‎_{‎\mathbb{R}‎} ‎u(x+y,‎\tau‎) ‎f(y) ‎dy‎&#xA;  ‎‎\end{align*}‎‎‎&#xA;with initial value&#xA;‎\begin{equation}&#xA;‎  u(x,0)=g(x):‎=G(e^x)=&#xA;\begin{cases}&#xA;max\{e^x-k,0\},  &amp;amp; \text{call option} \\&#xA;max\{k-e^x,0\}, &amp;amp; \text{put option}&#xA;\end{cases}&#xA;‎\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;my question is how we can derive the above $PIDE$ I've searched a lot of article but most of them only mention the $PIDE$ and we said you can find in Cont and Tankov Book and also  I've searched in this book but I could not find the Exactly above $PIDE$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks for help. &lt;/p&gt;&#xA;" OwnerUserId="13490" LastEditorUserId="11678" LastEditDate="2015-07-15T20:13:58.023" LastActivityDate="2015-07-15T20:13:58.023" Title="how we can derive $PIDE$ of double exponential Jump-diffusion model (we know as kou model)?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;stochastic-calculus&gt;&lt;jump&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18738" PostTypeId="2" ParentId="18404" CreationDate="2015-07-07T01:47:57.097" Score="2" Body="&lt;p&gt;Short Update on the specific way we have chosen:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Have a risky and a safe portfolio, and shift assets over time into the safe one to protect liabilities. The safe portfolio is duration matched and holds Bunds and cash. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The risky portfolio is multi asset class. Specific allocation is based on a constrained MV optimization on index level. This part is dynamic and will be reallocated quarterly. Implementation using index funds and fund-of-funds, as well as absolute return funds. Put options on the related benchmarks are used for each fund individually to minimize base risk.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The allocation between risky and safe portfolio somewhat resembles a CPPI concept. First make sure that liabilities are met, then generate some performance. Shifting like this allows more capital to be employed in performance generation, and thus keep risk in check. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I'll keep this open to see other input. &lt;/p&gt;&#xA;" OwnerUserId="1976" LastActivityDate="2015-07-07T01:47:57.097" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18739" PostTypeId="1" CreationDate="2015-07-07T02:59:07.237" Score="3" ViewCount="8936" Body="&lt;p&gt;Is there any way to record or piggyback with an app, code or excel Google finances' or Yahoo finance's data stream?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally, I need tick by tick data, as in every price change of the day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All the downloaders and codes I found can only get 1-minute intervals in the format of OHLC. I have not found any code snippet for tick by tick or every price change when denoting the interval change for downloading EOD data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The closest thing I can come up with is: &lt;a href=&quot;http://code.google.com/p/finansu/&quot; rel=&quot;nofollow&quot;&gt;http://code.google.com/p/finansu/&lt;/a&gt;  and the idea of Live, streaming web import capabilities in Excel. However I am not sure whether this just queries Google in frequent time periods or whether it would reflect what you see with the real time ticker changes. In fact, going by tick change would give you different EOD results than if you queried every 1m or so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, using an index price like the Dow if the price does not change for three minutes your query would return that figure three times leading you to believe it transacted more than it did at the end of the day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is is it possible to get tick data from these services?&lt;/p&gt;&#xA;" OwnerUserId="16803" LastEditorUserId="467" LastEditDate="2015-10-08T07:47:43.680" LastActivityDate="2016-09-26T08:53:29.523" Title="How to record tick data from Google/Yahoo Finance data streams?" Tags="&lt;market-data&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18740" PostTypeId="1" CreationDate="2015-07-07T04:04:46.873" Score="9" ViewCount="1683" Body="&lt;p&gt;I'm wondering if there is an application of quantitative finance to real estate investment? Specifically I'm wondering about models for pricing small neighborhoods (or even single houses) that take into account things like price, average rent, taxes, interest rates, etc. A preliminary google search showed a few basic models, for example geometric brownian motion. Is there a good reason why quantitative finance methods might not be as useful for real estate pricing?&lt;/p&gt;&#xA;" OwnerUserId="16804" LastActivityDate="2019-03-07T16:35:26.310" Title="Quantitative Real Estate Investment Finance" Tags="&lt;modeling&gt;&lt;risk-models&gt;&lt;real-estate&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18741" PostTypeId="1" CreationDate="2015-07-07T04:49:29.860" Score="1" ViewCount="837" Body="&lt;p&gt;One what basis the pricing model can be differentiated for particular trade pricing. For exapmle why PDE or Binomial tree or MC or Analytical method will be consider for pricing any trade. &#xA;Question may be sound little vague but trying to understand on the broader level.&#xA;Thanks for the help.&lt;/p&gt;&#xA;" OwnerUserId="11661" LastActivityDate="2015-07-07T04:49:29.860" Title="PDE vs TREE vs MC vs Analytical" Tags="&lt;pricing&gt;&lt;models&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18742" PostTypeId="1" CreationDate="2015-07-07T08:18:04.763" Score="1" ViewCount="2546" Body="&lt;p&gt;I have a time series of the three month interbank rate each month and I suppose that the rate is has yearly frequency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need these interbank rates to be on a monthly basis because I want to us these rate as a proxy for the risk- free rate, so I can subtract the rates from my monthly return to get the excess rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's consider an example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;by assuming the monthly return of stock x in April is 6%. The interbank rate at the end of April is 3% annually. Can I simply subtract o.25%(3/12) from 6% resulting in 5.75% of excess return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be much appreciated.&lt;/p&gt;&#xA;" OwnerUserId="16740" LastEditorUserId="2553" LastEditDate="2015-07-07T10:09:09.480" LastActivityDate="2015-12-04T14:31:46.537" Title="convert three months interbank rate into monthly rate" Tags="&lt;return&gt;&lt;interbank-rates&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18743" PostTypeId="1" AcceptedAnswerId="18747" CreationDate="2015-07-07T08:31:44.427" Score="9" ViewCount="9133" Body="&lt;p&gt;I hope this is on-topic. I want to set-up a set of investment rules and back-test it on a mix of asset-classes. Thus I thought that using ETFs for the back-test would be a good idea (time series could be of good quality, I can actually invest in them).&#xA;I am using R with the package &lt;code&gt;quantmod&lt;/code&gt; and I find it quite annoying and difficult to search for ETFs and the (google/yahoo finance) symbols to get the price series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be perfect to have something like this: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I want e.g. European stocks, EM hard currency, corporate bonds&lt;/li&gt;&#xA;&lt;li&gt;ETF A covers the stocks, B EM HC and C Corporates&lt;/li&gt;&#xA;&lt;li&gt;the symbols are ...&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;How do you solves such problems? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&#xA;&lt;a href=&quot;http://etf.stock-encyclopedia.com/&quot; rel=&quot;noreferrer&quot;&gt;This&lt;/a&gt; is a quite beta website that groups ETFs by asset class and provides tickers ... I guess there is something better.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-07-07T11:07:47.753" LastActivityDate="2019-04-24T18:57:02.730" Title="Getting ETF data from google finance" Tags="&lt;market-data&gt;&lt;backtesting&gt;&lt;etf&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18744" PostTypeId="2" ParentId="18742" CreationDate="2015-07-07T09:01:42.740" Score="0" Body="&lt;p&gt;I think you are on the right track... To double check I tried to get the Monthly return by using the following formula: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Monthly Return = [(1 + Annual Rate)^(1/12)]-1&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;by using this formula with the stated 3% Annual Return, the Investor receives approximately 0.25% per month....&lt;/p&gt;&#xA;" OwnerUserId="13428" LastActivityDate="2015-07-07T09:01:42.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18745" PostTypeId="2" ParentId="18730" CreationDate="2015-07-07T11:41:40.907" Score="3" Body="&lt;p&gt;If you have a friend studying at almost any university you can get access to WRDS.&#xA;Inside WRDS just go to Compustat which has all the info you need for dates since 1950.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-07-07T11:41:40.907" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18746" PostTypeId="2" ParentId="18688" CreationDate="2015-07-07T11:47:54.113" Score="3" Body="&lt;p&gt;I do not have access to the exact time-series of the MSCI world, but looking at the returns from the tracking ETF, since 2001 the average return is negative. Thus regardless of the risk-free you use you will get a negative sharpe ratio.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-07-07T11:47:54.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18747" PostTypeId="2" ParentId="18743" CreationDate="2015-07-07T12:03:01.913" Score="4" Body="&lt;p&gt;There are plenty of sites you can get this information from. etfdb.com and etf.com are two of the bigger ones. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See this for an example:&#xA;&lt;a href=&quot;http://etfdb.com/etfdb-category/europe-equities/&quot; rel=&quot;nofollow&quot;&gt;http://etfdb.com/etfdb-category/europe-equities/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://etfdb.com/tool/etf-stock-exposure-tool/&quot; rel=&quot;nofollow&quot;&gt;http://etfdb.com/tool/etf-stock-exposure-tool/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1764" LastActivityDate="2015-07-07T12:03:01.913" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18748" PostTypeId="1" CreationDate="2015-07-07T13:29:38.410" Score="12" ViewCount="1050" Body="&lt;p&gt;Consider a time series $\{r_t\}$ following a standard GARCH(1,1) model, i.e.,&#xA;$$ r_t = \sigma_t \epsilon_t,$$ where $\epsilon_t \sim N(0,1)$ and are i.i.d, and&#xA;$$\sigma_t^2 = \omega + \alpha_1 r_{t-1}^2 + \beta_1 \sigma_{t-1}^2, $$&#xA;where $\omega, \alpha_1, \beta_1$ are constant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: can we derive analytically the expectation of the random variable $\sigma_t$ for a given $t$, i.e., $\mathbb{E}(\sigma_t)$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is easy to derive $\mathbb{E}(\sigma_t^2) = \frac{\omega}{1-\alpha_1 - \beta_1}$, assuming $\mathbb{E}(\sigma_t^2)$ is constant over time, but I did not find any result on $\mathbb{E}(\sigma_t)$?&lt;/p&gt;&#xA;" OwnerUserId="16807" LastEditorUserId="16807" LastEditDate="2015-07-07T15:13:45.427" LastActivityDate="2015-08-11T00:15:25.137" Title="GARCH model, expectation of volatility?" Tags="&lt;volatility&gt;&lt;time-series&gt;&lt;statistics&gt;&lt;garch&gt;&lt;mean&gt;" AnswerCount="2" CommentCount="9" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18750" PostTypeId="1" CreationDate="2015-07-07T18:10:56.730" Score="3" ViewCount="661" Body="&lt;p&gt;I would like to know if there is some way to adapt the period of a moving average to market conditions like for instance the stop loss can be adapted to market conditions using the average true range. Thanks! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: As suggested, I add some references and context to my question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a trend following system that in the test period 2009 - 2014, with one hour candles, no parameters to optimize, EUR/USD produces these figures:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Max drawdown        -48$ 13% (MAE -74$ 20%)&#xA;Number of trades    165 (28/year, 1/week, 1/day)&#xA;Percent winning     31%&#xA;Annual return       139%&#xA;Profit factor       1.99 (PRR 1.56)&#xA;Sharpe ratio        0.92&#xA;Kelly criterion     0.55&#xA;R2 coefficient      0.647&#xA;Ulcer index         9.4%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However the same system in 2003 - 2008 makes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    Max drawdown        -131$ 158% (MAE -154$ 185%)&#xA;    Number of trades    212 (36/year, 1/week, 1/day)&#xA;    Percent winning     19%&#xA;    Annual return       14%&#xA;    Profit factor       1.15 (PRR 0.90)&#xA;    Sharpe ratio        0.27&#xA;    Kelly criterion     0.39&#xA;    R2 coefficient      0.110&#xA;    Ulcer index         68.2%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I tried to look for an adaptive moving average that adapts to market conditions, I read among others these two references:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.mesasoftware.com/papers/MAMA.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.mesasoftware.com/papers/MAMA.pdf&lt;/a&gt;&#xA;&lt;a href=&quot;http://web.archive.org/web/20141021073610/http://www.mesasoftware.com/Papers/MAMA.pdf&quot; rel=&quot;nofollow&quot;&gt;(just in case it goes down)&lt;/a&gt;&#xA;&lt;a href=&quot;https://books.google.com.uy/books?id=_KjOT1b9bfUC&amp;amp;pg=PA113&amp;amp;lpg=PA113#v=onepage&amp;amp;q&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;https://books.google.com.uy/books?id=_KjOT1b9bfUC&amp;amp;pg=PA113&amp;amp;lpg=PA113#v=onepage&amp;amp;q&amp;amp;f=false&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried to reproduce the method of the first link mith mixed results, I tested with EUR/USD and candles of 8 hours this code, sorry for the length, I hope you bear with me:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;vars Price = series(price());           &#xA;Stop = 2*ATR(100);  &#xA;MAMA(Price,0.05,0.5);&#xA;vars MAMAs = series(rMAMA);&#xA;vars FAMAs = series(rFAMA);&#xA;&#xA;if( crossUnder(FAMAs,MAMAs) ){&#xA;    reverseShort(1);//if the Following Adaptive Moving Average crosses under the Mother of Adaptive Moving Averages then I enter long, closing previous short if any&#xA;} else if( crossOver(FAMAs,MAMAs) ) {&#xA;    reverseLong(1);&#xA;}&#xA;plot(&quot;price&quot;,Price[0],MAIN|LINE,BLACK);&#xA;plot(&quot;Mama&quot;,MAMAs,LINE,RED);&#xA;plot(&quot;Fama&quot;,FAMAs,LINE,BLUE);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Testing that in 2009 - 2014 gave&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Max drawdown        -157$ 64% (MAE -159$ 65%)&#xA;Number of trades    392 (68/year, 2/week, 1/day)&#xA;Percent winning     62%&#xA;Annual return       35%&#xA;Profit factor       1.15 (PRR 1.00)&#xA;Sharpe ratio        0.52&#xA;Kelly criterion     0.73&#xA;R2 coefficient      0.002&#xA;Ulcer index         21.2%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But in 2003 - 2008 it gives&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Max drawdown        -255$ -1396% (MAE -255$ -1397%)&#xA;Number of trades    383 (66/year, 2/week, 1/day)&#xA;Percent winning     60%&#xA;Annual return       -2%&#xA;Profit factor       0.99 (PRR 0.85)&#xA;Sharpe ratio        -0.02&#xA;Kelly criterion     -0.05&#xA;R2 coefficient      0.013&#xA;Ulcer index         38.7%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However if I test in 2003 - 2008 with &lt;strong&gt;4 hour candles&lt;/strong&gt; the results are&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Max drawdown        -145$ 67% (MAE -146$ 67%)&#xA;Number of trades    790 (134/year, 3/week, 1/day)&#xA;Percent winning     61%&#xA;Annual return       32%&#xA;Profit factor       1.10 (PRR 0.99)&#xA;Sharpe ratio        0.50&#xA;Kelly criterion     0.71&#xA;R2 coefficient      0.415&#xA;Ulcer index         23.0%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, even this 'adaptive' moving average needed to be adapted to a different market by adjusting the duration of candles, but I don't know whether this is curve fitting. Is there a way to detect this change in market conditions between 2003 - 2008 and 2009 - 2014 in this test?&lt;/p&gt;&#xA;" OwnerUserId="16335" LastEditorUserId="16335" LastEditDate="2015-07-12T08:59:15.250" LastActivityDate="2015-09-10T10:14:22.503" Title="How to adapt a Moving Average period to market conditions?" Tags="&lt;volatility&gt;&lt;market&gt;&lt;moving-average&gt;" AnswerCount="1" CommentCount="13" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18751" PostTypeId="1" AcceptedAnswerId="18915" CreationDate="2015-07-07T18:55:13.277" Score="4" ViewCount="281" Body="&lt;p&gt;Assuming an asset price $S$ follows a geometric Brownian motion (GBM), the log returns $R$ are distributed as&#xA;$$&#xA;R_i := \log\left(\frac{S_i}{S_{i-1}}\right) \sim \mathcal{N}\left(\left(\mu - \frac{\sigma^2}{2}\right) \Delta t, \sigma^2 \Delta t \right), \quad i=1,\ldots,N.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $m = \left(\mu - \frac{\sigma^2}{2}\right) \Delta t$ and $s^2 = \sigma^2 \Delta t$ and consider calibrating a GBM to some returns $R_i$.  We'll use the maximum likelihood estimate for $m$, and for simplicity we assume $s$ is known (as would be the case if we were generating the data through a simulation ourselves), in which case&#xA;$$&#xA;\hat{m} = \frac{1}{N} \sum_{i=1}^M R_i.&#xA;$$&#xA;Then the sampling distribution for the sample mean is approximately $\hat{m} \sim \mathcal{N}\left(m, \frac{s^2}{N}\right)$, and an approximate $(1-\alpha)100\%$ confidence interval for the true mean $m$ is&#xA;$$&#xA;[\hat{m} - z_{\alpha/2}\frac{s}{\sqrt{N}},\: \hat{m} + z_{\alpha/2}\frac{s}{\sqrt{N}}] \qquad (1).&#xA;$$&#xA;In particular, increasing the number of observations $N$ results in a smaller confidence interval.  This, of course, is a standard result from elementary statistics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, we really need an estimate for $\mu$ in practice, and from $(1)$ we can derive a confidence interval for $\hat{\mu} = \frac{\hat{m}}{\Delta t} + \frac{\sigma^2}{2}$:&#xA;\begin{align*}&#xA;&amp;amp; \hat{m} - z_{\alpha/2}\frac{s}{\sqrt{N}} &amp;lt; m &amp;lt; \hat{m} + z_{\alpha/2}\frac{s}{\sqrt{N}} \\&#xA;&amp;amp; \qquad \iff \hat{m} - z_{\alpha/2}\frac{s}{\sqrt{N}} &amp;lt; \left(\mu - \frac{\sigma^2}{2}\right) \Delta t &amp;lt; \hat{m} + z_{\alpha/2}\frac{s}{\sqrt{N}} \\&#xA;&amp;amp; \qquad \iff \frac{\hat{m}}{\Delta t} + \frac{\sigma^2}{2} - z_{\alpha/2}\frac{s}{\Delta t\sqrt{N}} &amp;lt; \mu  &amp;lt; \frac{\hat{m}}{\Delta t} + \frac{\sigma^2}{2} + z_{\alpha/2}\frac{s}{\Delta t\sqrt{N}} \\&#xA;&amp;amp; \qquad \iff \hat{\mu} - z_{\alpha/2}\frac{\sigma}{\sqrt{N \Delta t}} &amp;lt; \mu  &amp;lt; \hat{\mu} + z_{\alpha/2}\frac{\sigma}{\sqrt{N \Delta t}}.&#xA;\end{align*}&#xA;Then, since $\Delta t = \frac{T}{N}$ for some final observation time $T$, a $(1-\alpha)100\%$ confidence interval for the true drift $\mu$ is&#xA;$$&#xA;[\hat{\mu} - z_{\alpha/2}\frac{\sigma}{\sqrt{T}},\: \hat{\mu} + z_{\alpha/2}\frac{\sigma}{\sqrt{T}}].&#xA;$$&#xA;In particular, increasing the number of observations $N$ &lt;strong&gt;has no effect&lt;/strong&gt; on the confidence interval for the drift $\mu$.  Instead, we only obtain a smaller confidence interval by increasing the final time, $T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed, for fixed $T$ we may think of obtaining higher and higher frequency data so that $N$ becomes larger and larger.  But then $\Delta t$ becomes smaller and smaller by definition, such that $dt = \frac{T}{N}$.  This seems quite counter intuitive: for fixed $T$, no matter if I have 1,000 or $1e16$ observations, I get no closer to my true drift $\mu$.  On the other hand, if I have only 10 observations over 100 years, I get a much better estimate of $\mu$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have I overlooked something?  Perhaps this is a well-known problem with estimating the drift that I'm not aware of?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2015-07-17T20:04:52.050" Title="Estimating $\mu$ - only increasing $T$ improves estimate?" Tags="&lt;calibration&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18753" PostTypeId="1" AcceptedAnswerId="18755" CreationDate="2015-07-07T20:23:44.773" Score="4" ViewCount="518" Body="&lt;p&gt;Can someone point me to any notes on how to derive the closed form formula for Asian geometric average option with payoff $\text{max}\left(\text{log}\left(\frac{A_T}{K}\right), 0\right)$ where $A_T$ is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;A_T=\text{exp}\left(\frac{1}{T}\int_0^T \text{log}(S_u) du \right)&#xA;$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can assume that the stock follows a GBM as in the black scholes model.&lt;/p&gt;&#xA;" OwnerUserId="15771" LastEditorUserId="11678" LastEditDate="2015-07-08T13:07:50.537" LastActivityDate="2015-07-08T13:07:50.537" Title="Asian Option with Geometric Averaging" Tags="&lt;asian-option&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18754" PostTypeId="1" CreationDate="2015-07-07T20:38:46.893" Score="5" ViewCount="7466" Body="&lt;p&gt;I'm reading the paper's summary of:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Beckers, Stan, and Jolly Ann Thomas. &quot;On the persistence of style&#xA;  returns.&quot; The Journal of Portfolio Management 37.1 (2010): 15-30.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;about how some of these 'Barra style factors' create significant risk premiums, but I don't understand what they are and how a strategy can use them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The full article is paywalled, but hopefully &lt;a href=&quot;http://www.researchgate.net/publication/247906339_On_the_Persistence_of_Style_Returns&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; gives an idea of the context.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any hint will be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="7974" LastEditorUserId="1764" LastEditDate="2015-07-08T05:30:56.613" LastActivityDate="2015-07-08T09:21:34.347" Title="What are Barra style factors useful for?" Tags="&lt;quant-trading-strategies&gt;&lt;factor-models&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18755" PostTypeId="2" ParentId="18753" CreationDate="2015-07-07T21:16:39.490" Score="5" Body="&lt;p&gt;Note that&#xA;\begin{align*}&#xA;\int_0^T\ln S_u du &amp;amp;= \int_0^T\Big[\big(r-\frac{1}{2}\sigma^2\big)u + \sigma W_u  \Big] du\\&#xA;&amp;amp;=\frac{1}{2}\big(r-\frac{1}{2}\sigma^2\big)T^2 + \sigma\int_0^T\int_0^u dW_s \,du\\&#xA;&amp;amp;=\frac{1}{2}\big(r-\frac{1}{2}\sigma^2\big)T^2 + \sigma\int_0^T\int_s^T du \,dW_s\\&#xA;&amp;amp;=\frac{1}{2}\big(r-\frac{1}{2}\sigma^2\big)T^2 + \sigma\int_0^T(T -s) \,dW_s,\\&#xA;\end{align*}&#xA;which is normally distributed. Then&#xA;\begin{align*}&#xA;\ln \frac{A_T}{K} &amp;amp;= \frac{1}{T}\int_0^T\ln S_u\, du -\ln K\\&#xA;&amp;amp;\sim N\left(\frac{1}{2}\big(r-\frac{1}{2}\sigma^2\big)T-\ln K, \ \Big(\frac{\sigma T}{\sqrt{3}}\Big)^2 \right)\\&#xA;&amp;amp;=\mu + \Sigma\, \xi,&#xA;\end{align*}&#xA;where $\mu = \frac{1}{2}\big(r-\frac{1}{2}\sigma^2\big)T -\ln K$, $\Sigma = \frac{\sigma T}{\sqrt{3}}$, and $\xi$ is standard normal random variable.&#xA; Consequently, the option payoff has value&#xA;\begin{align*}&#xA;e^{-rT} E\left(\max\Big(\ln \frac{A_T}{K}, \, 0 \Big) \right) &amp;amp;= e^{-rT} E\left(\max\big(\mu + \Sigma\, \xi, \, 0 \big) \right)\\&#xA;&amp;amp;=\frac{e^{-rT}}{\sqrt{2\pi}}\int_{-\frac{\mu}{\Sigma}}^{\infty} (\mu+\Sigma \, x) e^{-\frac{1}{2}x^2}dx\\&#xA;&amp;amp;=e^{-rT}\bigg[\mu \Phi\Big(\frac{\mu}{\Sigma}\Big)+\frac{\Sigma}{\sqrt{2\pi}} \, e^{-\frac{\mu^2}{2\Sigma^2}}\bigg],&#xA;\end{align*}&#xA;where $\Phi$ is the cumulative distribution function of a standard normal random variable.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-07-08T13:05:57.010" LastActivityDate="2015-07-08T13:05:57.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18756" PostTypeId="1" AcceptedAnswerId="24566" CreationDate="2015-07-07T22:40:25.873" Score="2" ViewCount="232" Body="&lt;p&gt;I use now this code from hier &lt;a href=&quot;https://quant.stackexchange.com/questions/2183/why-does-the-following-data-fail-my-cointegration-test&quot;&gt;Why does the following data fail my cointegration test?&lt;/a&gt; with slightly modification of possibility to load something directly from Dropbox file storage .&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(RCurl)&#xA;library(zoo)&#xA;library(tseries)&#xA;&#xA;x &amp;lt;- getURL(&quot;https://dl.dropboxusercontent.com/u/12337149/stat/CBA.csv&quot;)&#xA;y &amp;lt;- read.csv(text = x)&#xA;&#xA;x1 &amp;lt;- getURL(&quot;https://dl.dropboxusercontent.com/u/12337149/stat/WBC.csv&quot;)&#xA;y1 &amp;lt;- read.csv(text = x1)&#xA;&#xA;&#xA;&#xA;##gld &amp;lt;- read.csv(&quot;CBA.csv&quot;, stringsAsFactors=F)&#xA;##gdx &amp;lt;- read.csv(&quot;GDX.csv&quot;, stringsAsFactors=F)&#xA;&#xA;gld &amp;lt;- y&#xA;gdx &amp;lt;- y1&#xA;&#xA;gld &amp;lt;- zoo(gld[,5], as.Date(gld[,1]))&#xA;gdx &amp;lt;- zoo(gdx[,5], as.Date(gdx[,1]))&#xA;&#xA;t.zoo &amp;lt;- merge(gld, gdx, all=FALSE)&#xA;t &amp;lt;- as.data.frame(t.zoo)&#xA;&#xA;cat(&quot;Date range is&quot;, format(start(t.zoo)), &quot;to&quot;, format(end(t.zoo)), &quot;\n&quot;)&#xA;&#xA;m &amp;lt;- lm(gld ~ gdx + 0, data=t)&#xA;beta &amp;lt;- coef(m)[1]&#xA;&#xA;cat(&quot;Assumed hedge ratio is&quot;, beta, &quot;\n&quot;)&#xA;&#xA;sprd &amp;lt;- t$gld - beta*t$gdx&#xA;ht &amp;lt;- adf.test(sprd, alternative=&quot;stationary&quot;, k=0)&#xA;&#xA;cat(&quot;ADF p-value is&quot;, ht$p.value, &quot;\n&quot;)&#xA;&#xA;if (ht$p.value &amp;lt; 0.05) {&#xA;    cat(&quot;The spread is likely mean-reverting\n&quot;)&#xA;} else {&#xA;    cat(&quot;The spread is not mean-reverting.\n&quot;)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How to construct a cointegrating vector using more than 2 price series in R?&lt;/p&gt;&#xA;" OwnerUserId="16814" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-03-27T17:58:46.597" Title="How to construct a cointegrating vector using more than 2 price series in R?" Tags="&lt;time-series&gt;&lt;statistics&gt;&lt;r&gt;&lt;statistical-finance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18757" PostTypeId="2" ParentId="18754" CreationDate="2015-07-08T00:00:04.557" Score="3" Body="&lt;p&gt;Style factors are used to describe the risk or returns of a portfolio or a asset. Style factors describe them in consistent terms that a board of directors or a portfolio manager can understand. You cannot easily do this with eigen values for example.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;... Identify segments of the market  with distinguishable patterns of returns.&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first known style factor was the value factor, described in Ben Ghrams 1934 Securities Analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They are used the same as other factors and this question has been &lt;a href=&quot;https://quant.stackexchange.com/questions/tagged/factor-models&quot;&gt;answered before on the site.&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-07-08T04:12:04.103" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18758" PostTypeId="1" AcceptedAnswerId="18835" CreationDate="2015-07-08T01:37:10.133" Score="5" ViewCount="15285" Body="&lt;p&gt;I just started with quantmod package. If I want to select stocks based on their recent performance, then I need to loop through all the stocks in, say, NYSE. So I need:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;get all the stock symbols&lt;/li&gt;&#xA;&lt;li&gt;select those symbols that do have data&lt;/li&gt;&#xA;&lt;li&gt;loop through them one by one(say, each time, download the stock data as $X$, and do some analysis. Then loop to next one, and set it as $X$)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;My question is: how can I do these? Here is part of my thought:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;use &lt;strong&gt;stockSymbols()&lt;/strong&gt; function in TTR package: &lt;code&gt;AllSym &amp;lt;- stockSymbols()&lt;/code&gt;. The first column of &lt;code&gt;AllSym&lt;/code&gt; are all the potential symbols.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use &lt;code&gt;getSymbols(AllSym[i,1])&lt;/code&gt; to loop all the stock &lt;code&gt;i&lt;/code&gt;:&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Questions here:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Not all the symbols from TTR have data. Some may have error when using &lt;code&gt;getSymbols&lt;/code&gt;. I actually do not care about this certain stock. So how can I continue with the loop? [How can I use the &lt;code&gt;try&lt;/code&gt; function?]&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The &lt;code&gt;getSymbols&lt;/code&gt; function will automatically make the stock symbols as the variables. How can I copy(or set) it to $X$(instead of something like $APPL$)?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How can I loop trough the variables with their names saved as strings in a vector? For example, if we do use &lt;code&gt;getSymbols&lt;/code&gt; function to get data with name as the stock symbol. How can I loop through those stocks?[Note that their variable name are stored in first column &lt;code&gt;AllSym&lt;/code&gt; as string]&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thank you very much!&lt;/p&gt;&#xA;" OwnerUserId="3206" LastActivityDate="2017-11-08T19:43:29.633" Title="how do I loop through all the stocks with quantmod and ttr?" Tags="&lt;r&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="18759" PostTypeId="1" AcceptedAnswerId="18762" CreationDate="2015-07-08T01:41:23.020" Score="1" ViewCount="1256" Body="&lt;p&gt;I'm looking for some reference on how to calibrate a non-mean-reverting Ornstein-Uhlenbeck process to historical data using MLE or OLS. The model has the following SDE:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d\lambda(t)=a\lambda(t)dt+\sigma dW(t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $a&amp;gt;0$ and $\sigma \geq 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hints on how to adapt the procedure from a mean-reverting OU may be useful too.&lt;/p&gt;&#xA;" OwnerUserId="12214" LastActivityDate="2016-10-20T08:48:40.537" Title="Calibration of non-mean-reverting OU process" Tags="&lt;stochastic-processes&gt;&lt;calibration&gt;&lt;mean-reversion&gt;&lt;parameter-estimation&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18761" PostTypeId="2" ParentId="18731" CreationDate="2015-07-08T06:07:17.263" Score="10" Body="&lt;p&gt;I am not sure Dark Pools (DP) have been created to avoid &quot;&lt;em&gt;market manipulation&lt;/em&gt;&quot;. They have been created by firms because they found an advantage to create them (see &lt;a href=&quot;http://www.worldscientific.com/worldscibooks/10.1142/8967&quot; rel=&quot;nofollow noreferrer&quot;&gt;Market Microstructure in Practice&lt;/a&gt;, L and Laruelle Eds.). The main reasons have been:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;spare market fees, for DP created by brokers (like &lt;a href=&quot;http://www.ubs.com/microsites/multilateral-trading-facility/en/home.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;UBS MTF&lt;/a&gt;);&lt;/li&gt;&#xA;&lt;li&gt;spare market impact, for block pools (like &lt;a href=&quot;http://www.itg.com/posit-alert/&quot; rel=&quot;nofollow noreferrer&quot;&gt;ITG/POSIT&lt;/a&gt;);&lt;/li&gt;&#xA;&lt;li&gt;spare half of the bid ask spread, for DP created by market makers (like &lt;a href=&quot;https://www.kcg.com/market-making/knight-link-by-kcg&quot; rel=&quot;nofollow noreferrer&quot;&gt;Knight Link&lt;/a&gt;).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Optimal trading in DP is possible, see for instance &lt;a href=&quot;http://arxiv.org/abs/0910.1166&quot; rel=&quot;nofollow noreferrer&quot;&gt;Optimal split of orders across liquidity pools: a stochastic algorithm approach&lt;/a&gt;, by Laruelle, Pagès and L (published in SIAM Journal on Financial Mathematics, Vol. 2 (2011), pp. 1042-1076). You can have a look at &lt;a href=&quot;http://research.microsoft.com/en-us/um/people/alekha/300_paper.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Optimal Allocation Strategies for the Dark Pool Problem&lt;/a&gt;, by Agarwal, Bartlett, and Dama. And to &lt;a href=&quot;https://www.cis.upenn.edu/~mkearns/papers/darkpools-final.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Censored exploration and the dark pool problem&lt;/a&gt;, by  Ganchev, Nevmyvaka, Kearns, and Vaughan too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of optimal trading in orderbooks, you have few nice papers:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;one for very short term trading: &lt;a href=&quot;http://arxiv.org/abs/1112.2397&quot; rel=&quot;nofollow noreferrer&quot;&gt;Optimal posting price of limit orders: learning by trading&lt;/a&gt;, by Laruelle, Pagès and L (again), published in Mathematics and Financial Economics, Vol. 7, No. 3. (11 June 2013), pp. 359-403.&lt;/li&gt;&#xA;&lt;li&gt;one to make the market: &lt;a href=&quot;http://arxiv.org/abs/1105.3115&quot; rel=&quot;nofollow noreferrer&quot;&gt;Dealing with the inventory risk: a solution to the market making problem&lt;/a&gt;, by Guéant, Fernandez-Tapia and L, in  Mathematics and Financial Economics, Vol. 4, No. 7. (3 September 2013), pp. 477-507.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1964781&quot; rel=&quot;nofollow noreferrer&quot;&gt;Buy Low Sell High: A High Frequency Trading Perspective&lt;/a&gt;, by Cartea, Jaimungal, and  Ricci.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You will find here all that you need to build &lt;strong&gt;you own&lt;/strong&gt; orderbook strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I strongly suggest you have a look at other posts on Quant.SE, since you will need to understand:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;how to backtest your strategies: &lt;a href=&quot;https://quant.stackexchange.com/questions/839/how-to-design-a-custom-equity-backtester/1477#1477&quot;&gt;How to design a custom equity backtester?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;how to include latency into it: &lt;a href=&quot;https://quant.stackexchange.com/questions/3576/what-latency-should-i-use-for-backtesting-a-high-frequency-strategy&quot;&gt;What latency should I use for backtesting a high-frequency strategy?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;EDIT: these strategies are mostly robust to gaming. As soon as you value your position in terms of price and risk (i.e. using a value function) and not relatively to the mid, it is far more difficult to game you. Of course you can suffer from adverse selection, but only conditionaly to the fact you agreed on the price with respect to an historical measure. You can add some &lt;em&gt;usual&lt;/em&gt; anti gaming features, like not using the same quantity for each of your orders, but again if your sizes are optimized according to a sophisticated enough measure, you will never place two orders with the same size.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-01-13T14:26:33.377" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="18762" PostTypeId="2" ParentId="18759" CreationDate="2015-07-08T09:08:25.917" Score="3" Body="&lt;p&gt;EDIT: My reasoning below seems to be wrong. The process as you write it tends to infinity if $a$ is big enough and positive and if $\lambda_0$ is positive.&#xA;I would not call this process non-meanreverting OU. It is just an Ito process of a simple form. If we remove the stochastic part then we get&#xA;$$&#xA;d\lambda_t = a \lambda_t dt&#xA;$$&#xA;with the solution (if $\lambda_0&amp;gt;0$) $\lambda_t = \lambda_0 \exp(a t)$ which for $a&amp;gt;0$ just grows exponentially.&#xA;If look at the whole thing then we add a stochastic disturbance at each time step of size $\sigma dB_t$.&#xA;Thinking about it this way I think that the process above does not have too much in common with an OU-process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I delete my previous answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Concerning the estimation: If you have a process that you have observed on a time grid with width $ \Delta t$ then a discretization of your SDE could look like this:&#xA;$$&#xA;\lambda(t + \Delta t) - \lambda(t) = \theta \lambda(t) \Delta t + \sigma \sqrt{\Delta t} \epsilon_i&#xA;$$&#xA;where $\epsilon_i$ is standard normal.&#xA;Thus a regression of $\lambda(t + \Delta t) - \lambda(t)$ on $\lambda(t)$ gives you $\theta \Delta t$. The volatility of the residuals gives you an estimate of $\sigma \sqrt{\Delta t}$. Dividing these quantities by the grid width (resp its square-root) gives you the parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Look at a similar question &lt;a href=&quot;https://quant.stackexchange.com/questions/11055/ornstein-versus-ar1-for-modeling-stationary-data&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2015-07-08T14:43:42.937" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18763" PostTypeId="2" ParentId="18754" CreationDate="2015-07-08T09:21:34.347" Score="3" Body="&lt;p&gt;Barra risk factors are particular factors used to implement the Barra risk factor analysis, that consists in a multi-factor model developed by Barra inc. to measure the overall risk to which a financial asset is exposed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to &lt;a href=&quot;http://www.investopedia.com/terms/b/barra-risk-factor-analysis.asp&quot; rel=&quot;nofollow&quot;&gt;investopedia.com&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Barra Risk Factor Analysis incorporates over &lt;strong&gt;40 data metrics&lt;/strong&gt;&#xA;  including: earnings growth, share turnover and senior debt rating. The&#xA;  model then measures risk factors associated with three main&#xA;  components: industry risk, risk from exposure to different investment&#xA;  themes and company-specific risk.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Finally, Barra risk factors do not differ from common risk factors used by other practioners or academics from a theoretical point of view, but, rather, are a synthesis of them and of the asset risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suggest to read the last release of &lt;a href=&quot;https://www.msci.com/eqb/methodology/meth_docs/MSCI_Barra_Factor%20Indices_Methodology_Nov13.pdf&quot; rel=&quot;nofollow&quot;&gt;MSCI/Barra methodology&lt;/a&gt;, in which MSCI explains which are the factors used and how they construct them to get a clear idea about such risk factors.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-07-08T09:21:34.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18764" PostTypeId="1" AcceptedAnswerId="18770" CreationDate="2015-07-08T09:39:55.437" Score="0" ViewCount="145" Body="&lt;p&gt;As far as I understand, under the Libor Market Model the forward rates are assumed to have a log-normal distribution. Given that I have constructed my LMM model and now have a matrix of:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;k different forward rates, that is, they mature on different dates.&lt;/li&gt;&#xA;&lt;li&gt;t time steps&lt;/li&gt;&#xA;&lt;li&gt;N different scenarios&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;How can I make either a chi-squared test or a Kolmogorov-Smirnov test to check for log-normality?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have already done tests with:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;One forward rate, one time-step and all scenarios at a time&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;One forward r ate, all time-steps and one scenario at a time&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;These two tests reject the hypothesis that they should have a log-normal distribution, and my question is therefore:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;In what way are they assumed to be log-normal, that is, with what part of the data do I test?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Worth noticing is that I simulated under the &lt;em&gt;spot measure&lt;/em&gt;, does this matter?&lt;/p&gt;&#xA;" OwnerUserId="16817" LastActivityDate="2015-07-08T11:27:45.920" Title="Test Log-Normality for LIBOR forward rates under the Libor Market Model" Tags="&lt;libor&gt;&lt;lognormal&gt;&lt;lmm&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18765" PostTypeId="2" ParentId="18740" CreationDate="2015-07-08T10:26:24.977" Score="3" Body="&lt;p&gt;Quant finance is about finding prices of illiquid assets in terms of more liquid assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you have the the data for liquid small house prices you should be able to come up with a reasonable guess for less liquid larger houses, for example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's basically what's been done all the time - replication of complicated derivatives wrt more liquid assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wouldn't worry about brownian motion and think more along the lines of regression for now.&lt;/p&gt;&#xA;" OwnerUserId="7682" LastActivityDate="2015-07-08T10:26:24.977" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18766" PostTypeId="1" CreationDate="2015-07-08T10:45:41.463" Score="0" ViewCount="115" Body="&lt;p&gt;Will a rise in interest rate always result in a lower price of an American put option?&lt;/p&gt;&#xA;" OwnerUserId="16819" LastActivityDate="2015-10-06T13:33:01.410" Title="American put option and rising interest rate" Tags="&lt;options&gt;&lt;put&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18767" PostTypeId="2" ParentId="18766" CreationDate="2015-07-08T10:52:51.170" Score="1" Body="&lt;p&gt;Generally no. Check page 21 of the following document:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.frankfurt-school.de/clicnetclm/fileDownload.do?goid=000000053103AB4&quot; rel=&quot;nofollow&quot;&gt;http://www.frankfurt-school.de/clicnetclm/fileDownload.do?goid=000000053103AB4&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-07-08T10:52:51.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18768" PostTypeId="5" CreationDate="2015-07-08T11:25:58.377" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2015-07-08T11:25:58.377" LastActivityDate="2015-07-08T11:25:58.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18769" PostTypeId="4" CreationDate="2015-07-08T11:25:58.377" Score="0" Body="The exposure is the total amount of money an investor can loose after arising of negative event.&#xD;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-07-08T12:00:03.630" LastActivityDate="2015-07-08T12:00:03.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18770" PostTypeId="2" ParentId="18764" CreationDate="2015-07-08T11:27:45.920" Score="0" Body="&lt;p&gt;well they aren't actually log-normal! if you use the terminal measure and test the last forward rate, it is log-normal. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The essential point is that the drifts that make the ratio of bond prices to nuemraire a martingale are state-dependent. This state dependence destroys log-normality. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can take the real-world measure rates to be log-normal but the real-world process is not very relevant. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-07-08T11:27:45.920" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18771" PostTypeId="1" CreationDate="2015-07-08T12:53:58.773" Score="3" ViewCount="2362" Body="&lt;p&gt;I installed an quantlib on my mac, but have no idea, how to start using it with an excel. Please advise hoq to do it. I followed all instructions here:&#xA;&lt;a href=&quot;http://quantlib.org/install/macosx.shtml&quot; rel=&quot;nofollow&quot;&gt;http://quantlib.org/install/macosx.shtml&lt;/a&gt;. I think I need a kind of add-in or so. &lt;/p&gt;&#xA;" OwnerUserId="16820" LastActivityDate="2020-10-22T12:05:56.127" Title="How to use quantlib with excel?" Tags="&lt;quantlib&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18772" PostTypeId="2" ParentId="18750" CreationDate="2015-07-08T13:03:24.743" Score="-1" Body="&lt;p&gt;As it was already mentioned. Try to read about Kalman filter and Markow Switching models. I have even seen some academic papers where authors tried to define MA length based on MSM or KF. Try to google it ...&lt;/p&gt;&#xA;" OwnerUserId="15878" LastActivityDate="2015-07-08T13:03:24.743" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18774" PostTypeId="1" CreationDate="2015-07-08T13:39:44.897" Score="1" ViewCount="712" Body="&lt;p&gt;Does any one have the Black-Scholes formula for a European call with time-dependent but deterministic interest rate and dividend yield ?&lt;/p&gt;&#xA;" OwnerUserId="16647" LastEditorUserId="11678" LastEditDate="2015-07-09T15:01:32.533" LastActivityDate="2015-07-09T15:01:32.533" Title="Black-Scholes formula with deterministic interest rate and dividend yield" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="18777" PostTypeId="2" ParentId="18771" CreationDate="2015-07-08T14:41:45.173" Score="8" Body="&lt;p&gt;The QuantLib you installed is just a C++ library.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you were on a Windows machine, you'd need the QuantLibXL addin to use it in Excel (&lt;a href=&quot;http://quantlib.org/quantlibxl/&quot; rel=&quot;noreferrer&quot;&gt;http://quantlib.org/quantlibxl/&lt;/a&gt;).  But on a Mac, you've no such luck.  As far as I know, Excel for Mac only allows addins written in VBA, so QuantLibXL can't be built for it.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2015-07-08T14:41:45.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18778" PostTypeId="1" AcceptedAnswerId="18783" CreationDate="2015-07-08T15:00:18.267" Score="1" ViewCount="780" Body="&lt;p&gt;I am trying to construct a Zero Coupon Yield curve for US Government Bonds from market data (coupons, face values, prices, months to maturity) via Bootstrapping. However, I am not too sure how I would go about solving the equation AP = F over &lt;a href=&quot;https://en.wikipedia.org/wiki/Yield_curve#Construction_of_the_full_yield_curve_from_market_data&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; if I have the Matrix A such that it isn't square. I currently have more columns (which represent the months between each coupon payment) than rows (each row represents a bond with a particular number of months to maturity). For example one of the bonds I have has a coupon issued every 3 months and the maximum months to maturity among the bonds is 360, which implies my matrix A has 120 columns. However, I have only 60 rows as I have only 60 bonds with unique months to maturity, leaving matrix A as non-square. I am sure this is easily solvable but I haven't been able to find anything on this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank You&lt;/p&gt;&#xA;" OwnerUserId="11917" LastEditorUserId="11917" LastEditDate="2015-07-08T15:23:28.543" LastActivityDate="2015-07-08T16:52:18.200" Title="Solving the Bootstrapping equation when matrix is non-square" Tags="&lt;fixed-income&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18779" PostTypeId="1" AcceptedAnswerId="18782" CreationDate="2015-07-08T15:17:28.510" Score="1" ViewCount="869" Body="&lt;p&gt;I try to solve this exercise:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) Calclculate the price of a 3-month European put option on a non-dividend-paying stock with a strike price of 45 when the current stock price is 40, the risk-free interest rate is 5% per annum, and the volatility is 40% per annum.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) What dierence does it make to the option price if a dividend of 1.50 is expected in 2 months?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While I can solve a) im not able to solve b). My solution for a) is:&#xA;$T=\frac{1}{4}, K=45, S_0=40,r=0.05,\sigma=0.4$ leads to $$d_{+}=\frac{\ln\left( \frac{S_0}{K}\right)-(r+\frac{\sigma^2}{2})T}{\sigma \sqrt T}=-0.7514$$ and $$d_{-}=-0.9514.$$ Hence the put option price is given by $$P_0=-S_0N(-d_{+})+Ke^{-rT}N(-d_{-})=5.9042.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anybody explain how b) works?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Greetings&lt;/p&gt;&#xA;" OwnerUserId="16826" LastActivityDate="2015-07-08T16:15:35.893" Title="Calculate put price with Black-Scholes and one discrete dividend" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;european&gt;&lt;discrete-dividends&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18781" PostTypeId="2" ParentId="18778" CreationDate="2015-07-08T15:53:41.513" Score="1" Body="&lt;p&gt;By multiplying the transpose of $A$ to both sides, you can make it to be a square matrix. That is $$A^T A P = A^T F.$$ Moreover, if $A^T A$ is invertible, you can have that $$P = \big(A^T A\big)^{-1}A^T F.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, for a non-square matrix, or a square matrix, $A$, but not invertible, the singular value decomposition approach can be employed. See the book &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/818561816X&quot; rel=&quot;nofollow&quot;&gt;Numerical Recipes in C&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-07-08T15:53:41.513" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18782" PostTypeId="2" ParentId="18779" CreationDate="2015-07-08T16:15:35.893" Score="1" Body="&lt;p&gt;One solution is to calculate the annual dividend yield implied by that. &#xA;$Div_{yield}=\delta=1.5/40$ and then replace the $r$ on $d_+$ by $r-\delta$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A cleaner way would be to compute it using a binomial tree.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-07-08T16:15:35.893" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18783" PostTypeId="2" ParentId="18778" CreationDate="2015-07-08T16:52:18.200" Score="1" Body="&lt;p&gt;There are many ways to bootstrap the Treasury curve. I'll start by talking about my personal preference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The key step is to select appropriate securities to be included in the procedure. My preference is to use 60 Treasuries that are spaced out evenly (i.e., maturing 6 months after each other). Specifically for US Treasuries, it is convenient to select Treasuries auctioned in the February and August cycles, since they span the entire maturity spectrum. So as of today, you'd start with the note maturing on 15-August-2015, then the one maturing on 15-Feb-2016, ..., 15-Feb-2045.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There will be some gaps using this scheme and you'd need to fill in the gaps. For example, there are no bonds maturing on 15-Aug-2032, but you can easily create &quot;hypothetical bonds&quot; using nearby issues (in this case, it would be the Feb31s and Feb36s).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you have created this sample set, it's trivial to create a square matrix of cash flows. Given the cashflow structure of this selection, this matrix is almost certainly invertible. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, this is not the only way to do this. Another popular strategy is to use only on-the-run issues, linearly connect all the yields and assume that's the par curve, and bootstrap off of these hypothetical par bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, bootstrapping the Treasury curve is not that great of a strategy. I'd recommend looking into spline fitting techniques for the Treasury market, given the large number of issues outstanding.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2015-07-08T16:52:18.200" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18785" PostTypeId="2" ParentId="14992" CreationDate="2015-07-08T18:42:57.073" Score="1" Body="&lt;p&gt;Sharpe Ratio is defined as the slope of the line that is the return in function of the variance of a portfolio composed by a risky and a risky-less asset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, if you have a bunch of risky assets (A,B) and a risky-less (C) you simply calculate the efficient portfolio for your risky asset (A,B), and then calculate the Sharpe ratio for the tangential portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words the properties of the combination of A,B assets (given $x_A + x_B = 1$) are,&#xA;$$\mu_e = \mu_A x_A + \mu_B x_B =  \mu_A x_A + \mu_B (1-x_A)=x_A(\mu_A - \mu_B)+\mu_B, $$&#xA;$$\sigma^2_e = \sigma^2_A x^2_A +  \sigma^2_B x^2_B + \sigma_{AB}x_A x_B = x^2_A (\sigma^2_A+\sigma^2_B-2\sigma_{AB}) +2 x_A(\sigma_{AB} - \sigma^2_B) + \sigma^2_B,$$&#xA;with $mu$ the expected returns, and $\sigma^2$ the risks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This results that when you consider the risk-free asset C in the mix you have&#xA;$$\mu_p = (1-x_e) r_f + x_e \mu_e = r_f + x_e(\mu_e-r_f),$$&#xA;with $r_f$ the risk-free return, in your case the 4% return of C.&#xA;The variance is given only by the risky part of the portfolio, therefore&#xA;$$\sigma^2_p = x^2_e \sigma^2_e,$$&#xA;from which one can conveniently define the weight to be given to the efficient portfolio as&#xA;$$x_e = \sigma_p / \sigma_e,$$&#xA;determining that&#xA;$$\mu_p = (1-x_e) r_f + x_e \mu_e = r_f + \frac{(\mu_e-r_f)}{\sigma_e}\sigma_p.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The angular coefficient of such line, telling us that one can tune the expected return on the volatility using the risk-free rate as buffer (and eventually shorting on it), is known as Sharpe Ratio,&#xA;$$\frac{(\mu_e-r_f)}{\sigma_e}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you substitute $\sigma_e$ and $\mu_e$ with the above given equations, you have the sharpe ratio in function of $x_A$ (or Wpa as you call it).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For this first assignment the Utility function is not needed, but I guess it will come handy later when it will ask to use it to calculate the desired weights.&lt;/p&gt;&#xA;" OwnerUserId="16116" LastActivityDate="2015-07-08T18:42:57.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18788" PostTypeId="1" CreationDate="2015-07-08T22:11:20.303" Score="5" ViewCount="176" Body="&lt;p&gt;$$&#xA;p(S,t;S',t') = \frac{1}{\sigma S'\sqrt{2\pi (t'-t)}} \exp\left(-\frac{(\log(S/S') + (\mu-1/2\sigma^2)(t'-t))^2}{2\sigma^2(t'-t)}\right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found this equation when I was reading &quot;Paul Wilmots on Quantitative Finance&quot; which calculates the probability that of a stock price ending/landing on a particular price (S'). So if the stock price is 100 USD and the volatility is 30%, the probability the stock closes at 105 USD, exactly 30 days from now, according to the formula, is 3.850%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I tried to use the formula for different strikes S' (95 96 97 98 99 100 101 102 103..), &lt;strong&gt;integer&lt;/strong&gt; wide, and a fixed 30 days, the probabilities at those respective strikes summed to exactly 1, as it should. However when I used a fractional spacing/mesh (100 100.1 100.2 100.3 ...) I the probabilities summed more than 1. And that makes sense I guess? If the probability that a stock worth a 100 USD now will close at 105 USD, 30 days from now, is 3.85% than it shouldn't vary too far from the the probability of a 100 USD stock closing at 105.10 USD 30days, the two numbers are within the vicinity of one another by 10 cents.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But is there a way to normalize the formula such that if I wanted to know the probability that a stock will land within the interval [105.00, 106.00], I would not be getting probabilities that sum to more than 1?&lt;/p&gt;&#xA;" OwnerUserId="4729" LastEditorDisplayName="user13444" LastEditDate="2016-12-27T07:55:51.067" LastActivityDate="2016-12-27T07:55:51.067" Title="Probability of Closing Stock Price Over a Defined Period" Tags="&lt;equities&gt;&lt;probability&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18789" PostTypeId="2" ParentId="18215" CreationDate="2015-07-09T00:10:42.283" Score="2" Body="&lt;p&gt;If you are looking for historical data there are a few websites I can think of that provide it.  www.eodata.com provides 30 days of historical EOD data for free in various text formats.  Additionally, you can purchase up to 90 months of historical intraday data as well.  An added benefit is that they cover US Options, Mutual Funds, Currencies, and Commodities.  &lt;/p&gt;&#xA;" OwnerUserId="6839" LastEditorUserId="6839" LastEditDate="2015-07-09T16:20:28.400" LastActivityDate="2015-07-09T16:20:28.400" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18790" PostTypeId="1" CreationDate="2015-07-09T01:26:11.610" Score="7" ViewCount="2554" Body="&lt;p&gt;Why do stocks fall so quickly? China's market is down 40% in the past month ,for example. But when you look at charts of individual stocks, you see many instances of stocks giving up months of weeks of gains on very little relative volume and in a very small duration of time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is why does this happen, besides the predictable 'greed/fear'&#xA; explanation, which does not take into account market micro structure.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My belief that is on longer time-frames while the stock market does exhibit the classic GBM zig-zags, when you zoom in much closer there are lots of jumps which when can reduced to fundamental discrete units, violating self-similarity. The discretization of the microstructure causes huge swings in the short-run, but over the longer-run it smooths out.  &lt;/p&gt;&#xA;" OwnerUserId="15081" LastActivityDate="2018-02-11T19:48:52.427" Title="Why do stocks fall so quickly? Technical explanations" Tags="&lt;market-microstructure&gt;&lt;market&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18791" PostTypeId="2" ParentId="3979" CreationDate="2015-07-09T03:15:40.740" Score="-1" Body="&lt;p&gt;One workaround for this is to add to the cumulative profit and loss the initial equity and transform the points gained in cash.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what i usually do. I trade forex.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dollarPerPip = contracts * 100; % Here i calculate how much a pip worth in dollar, this value is true for EURUSD forex&#xA;cpnl = cumsum(pnl);&#xA;cpnl = (cpnl * dollarperPip) % Here transform pips in cash&#xA;cpnl = cpnl + initialEquity; % add the initialEquity&#xA;maxdd = maxdrawdown(cpnl); % calculate the max drawdown&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If a strategy go under the required margin to trade, in my opinion, its not worth to calculate the max drawdown, so i discard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="16834" LastEditorUserId="16834" LastEditDate="2015-07-11T01:05:51.847" LastActivityDate="2015-07-11T01:05:51.847" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18792" PostTypeId="2" ParentId="18790" CreationDate="2015-07-09T08:19:01.163" Score="5" Body="&lt;p&gt;So basically your question boils down to: How can markets be non-normal in the short run but (more) normal in the long run?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answer to that lies in the fact that certain assumptions of normality are not satisfied in the short run, one of them being independence. In the short run returns are just not independent (think e.g. volatility clustering) because the situations that lead to the respective behaviour of markets has at least some persistence in reality and information flow and processing is just not infinitely fast (and will never be).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the long run those assumptions are better justifiable - the memory of markets (and people!) is just not that long which leads to a more normal behaviour.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2015-07-09T08:19:01.163" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18793" PostTypeId="2" ParentId="18736" CreationDate="2015-07-09T08:58:11.303" Score="1" Body="&lt;p&gt;Let's start with the main idea, I hope you can finish the computations yourself. Whenever you want to derive a pricing equation, try the following approach: discounted value of portfolio/option/derivative &lt;a href=&quot;https://quant.stackexchange.com/q/18129/13480&quot;&gt;must be a martingale&lt;/a&gt; for non-arbitrage reasons. Since you have a Markovian dynamics in variables $t$ and $S$, you assume that the price is some function $V(t,S)$. What you need to do know is to compute the Ito differential&#xA;$$&#xA;  \mathrm d\left(\mathrm e^{-rt}V(t,S_t)\right) = (\dots)\mathrm dt + (\dots)\mathrm dw_t + (\dots)\mathrm d\bar N_t&#xA;$$&#xA;where $\bar N_t$ is the compensated Poisson process. The last two terms are martingales, so the term in the first bracket must be zero: that gives you the pricing equation. For the computation of this differential, and $\bar N_t$ see e.g. Shreve's II volume.&lt;/p&gt;&#xA;" OwnerUserId="13480" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-07-09T08:58:11.303" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18796" PostTypeId="2" ParentId="18788" CreationDate="2015-07-09T12:16:04.517" Score="3" Body="&lt;p&gt;That formula actually does not make much sense, given that for a continuous random variable the probability of any given point is zero. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming a Black-Scholes world you are better of by doing:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P(S_T&amp;gt;S_T^*)=N(d_2)$ where $d_2$ is the standard black-scholes term. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From this it is straightforward to compute $P(S_T^{-}&amp;lt;S_T&amp;lt;S_T^+)$.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-07-09T12:16:04.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18799" PostTypeId="1" CreationDate="2015-07-09T13:21:34.473" Score="2" ViewCount="198" Body="&lt;p&gt;Take a general linear Gaussian state space model (SSM)(aka Dynamic Linear Model DLM):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_{t+1}=FX_t + V_t$&lt;br&gt;&#xA;$Y=HX_t+W_t$   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V_t \sim N(0,Q)$&lt;br&gt;&#xA;$W_t \sim N(0,R)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am interested in the unidentifiability issues related to these models: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hamilton (1994) states that ”in the absence of restrictions on F, H, Q&#xA;and R, the parameters of the state-space representation are unidentified -&#xA;more than one set of values for the parameters can give rise to the identical&#xA;value of the likelihood function, and the data give us no guide for choosing&#xA;among these”&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I realise that this representation is not unique as multiplication by any orthonormal matrix $M$ produces a new representation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$MX_{t+1}=MFM^{-1}X_t + MV_t$&lt;br&gt;&#xA;$Y=HM^{-1}MX_t+W_t$  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This type of unidentifiability where the observed values can be produced by various orthonormal transformations of the state variables is inherent to state space models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I also came across another type of unidentificability that seems to be related to the estimation method. In this case &quot;Kalman Filtering&quot;. See the simple example starting on page 8 below: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://rucore.libraries.rutgers.edu/rutgers-lib/25840/pdf/1/&quot; rel=&quot;nofollow&quot;&gt;https://rucore.libraries.rutgers.edu/rutgers-lib/25840/pdf/1/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case there is a linear transformation of the observation equation and an offsetting one made to the variance of the state equation  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q1.) Do both the transformations above give rise to the same kind of identifiability issues described by Hamilton (I believe they do but want to check)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q2.) Are there other ways in which identifiability issues can manifest themselves in Linear Gaussian SSMs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q3.) Is the fix always the same find constraints or analogously (Bayesian priors) that will ensure that the final parameters are correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly this link in Matlab suggests that it is possible to build an &quot;identifiable SSM&quot;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://uk.mathworks.com/help/ident/ref/idss.html#btq_tib-1&quot; rel=&quot;nofollow&quot;&gt;http://uk.mathworks.com/help/ident/ref/idss.html#btq_tib-1&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately the link doesn't explain the theory:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q4.) It is possible to translate any Linear Gaussian SSM into an &quot;identifiable form&quot;? Can someone please supply a link reference explaining how this works. It would seem at first blush that no matter what representation is used initially it would still be subject to the problems shown above?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Baz&lt;/p&gt;&#xA;" OwnerUserId="7077" LastActivityDate="2015-07-09T13:21:34.473" Title="Identifiability of a state space model (Dynamic Linear Model)" Tags="&lt;time-series&gt;&lt;kalman&gt;&lt;bayes-theory&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18800" PostTypeId="1" AcceptedAnswerId="18801" CreationDate="2015-07-09T14:33:30.960" Score="3" ViewCount="187" Body="&lt;p&gt;Consider some stock with observed price $S$ and a call option on the stock with value $C$, time to maturity $T$ and strike $K$. Assume there is a constant, continuously compounded interest rate $r$. Assume everything is traded. It is well known that to avoid static arbitrages we must have&#xA;$$&#xA;C \in (\max\{S-Ke^{-rT},0\},S).&#xA;$$&#xA;Denote the interval $I$.&#xA;Consider now the Black-Scholes model and the function $f:\sigma \mapsto C_{BS}(\sigma)$ the function sending its volatility into its corresponding model price.&#xA;The function is monotone so it must be surjective. Since the model is arbitrage free necessarily the image of $f$ is contained in $I$, but is its image equal to $I$? What is known about this situation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess this must be a studied question, but I've never seen it discussed.&lt;/p&gt;&#xA;" OwnerUserId="2264" LastActivityDate="2015-07-09T17:03:30.727" Title="Is the Black-Scholes model price a bijection on the interval of static arbitrage free prices" Tags="&lt;black-scholes&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18801" PostTypeId="2" ParentId="18800" CreationDate="2015-07-09T15:31:56.603" Score="4" Body="&lt;p&gt;It is. Note that the interval I is open on both ends. Moreover, &#xA;\begin{align*}&#xA;C_{BS}(\sigma) = S\Phi(d_1)-Ke^{-rT}\Phi(d_2),&#xA;\end{align*}&#xA;where $\Phi$ is the cumulative distribution function of a standard normal random variable, and &#xA;\begin{align*}&#xA;d_{1,2} = \frac{\ln\frac{S}{K e^{-rT}} \pm \frac{1}{2}\sigma^2T}{\sigma \sqrt{T}}.&#xA;\end{align*}&#xA;Note that&#xA;\begin{align*}&#xA;\lim_{\sigma\rightarrow \infty} d_{1} = \infty, \,\,\,\mbox{ and }\,\,\, \lim_{\sigma\rightarrow \infty} d_{2} = -\infty.&#xA;\end{align*}&#xA;That is, $$\lim_{\sigma\rightarrow \infty} C_{BS}(\sigma) = S.$$&#xA;Moreover, note that&#xA;\begin{align*}&#xA;\lim_{\sigma\rightarrow 0+} d_{1, 2} = &#xA;\begin{cases}&#xA;\infty, &amp;amp; \mbox{ if }\,\, S&amp;gt;K e^{-rT},\\&#xA;-\infty, &amp;amp; \mbox{ otherwise}.&#xA;\end{cases}&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;\lim_{\sigma\rightarrow 0+} C_{BS}(\sigma) = \max\left(S-Ke^{-rT}, \, 0\right).&#xA;\end{align*}&#xA;consequently, &#xA;$$C_{BS}: (0, \,\,\, \infty) \mapsto  \left(\max\left(S-Ke^{-rT}, \, 0\right), \,\,\, S\right)$$ &#xA;is a bijection (i.e., one-to-one and onto).&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-07-09T17:03:30.727" LastActivityDate="2015-07-09T17:03:30.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18802" PostTypeId="2" ParentId="18790" CreationDate="2015-07-09T16:34:22.733" Score="6" Body="&lt;p&gt;Stock market indices fall faster than they rise, in part, due to leveraged long investors.  As individual stocks fall, investors must de-risk due to margin calls, and those margin calls may need to be met by selling other stocks.  This causes correlations to increase as markets fall.  This also causes indices to fall more quickly than they rise, since the dispersion narrows in declines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long story short, a big part is leverage-induced contagion.&lt;/p&gt;&#xA;" OwnerUserId="3491" LastActivityDate="2015-07-09T16:34:22.733" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18804" PostTypeId="1" AcceptedAnswerId="18821" CreationDate="2015-07-09T19:24:43.397" Score="3" ViewCount="344" Body="&lt;p&gt;I’m going to test for the effect corporate credit rating announcements have on stock prices through different economic climates (good times vs. bad times). I want to research whether or not the stock price reaction to a corporate credit rating upgrade/downgrade is more extreme in a tough economic climate (financial crisis).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A lot of research has been done on corporate credit rating announcements (upgrade, downgrade, positive and negative watch) effect on stock prices but not a lot of research has compared the results from different time periods (before/after vs. during financial crisis, before vs. after regulation). Joo &amp;amp; Pruitt (2006) studied the Korean financial crisis, and Jorion et al. (2006) studied the effects before and after Regulation Fair Disclosure. However, these papers are fairly short and don’t explain the statistical framework in detail (At least to me it’s not clear what they are doing).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have done some previous research using the event study methodology presented by Brown &amp;amp; Warner (1985) and MacKinlay (1997) but I’m not sure if it’s applicable to this problem. And if it is, I’m not completely sure how to compare the results from different periods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd be forever grateful if anyone could point me in the right direction.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Brown, S. J., &amp;amp; Warner, J. B. (1985). Using daily stock returns: The case of event studies. Journal of financial economics, 14(1), 3-31. &lt;/li&gt;&#xA;&lt;li&gt;Joo, S. L., &amp;amp; Pruitt, S. W. (2006). Corporate bond ratings changes and economic instability: Evidence from the Korean financial crisis. Economics Letters, 90(1), 12-20.&lt;/li&gt;&#xA;&lt;li&gt;Jorion, P., Liu, Z., &amp;amp; Shi, C. (2005). Informational effects of regulation FD: evidence from rating agencies. Journal of financial economics, 76(2), 309-330.&lt;/li&gt;&#xA;&lt;li&gt;MacKinlay, A. C. (1997). Event studies in economics and finance. Journal of economic literature, 13-39.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="16845" LastEditorUserId="16845" LastEditDate="2015-07-12T13:47:57.950" LastActivityDate="2015-07-12T13:47:57.950" Title="Compare events effect on stock prices from different time periods" Tags="&lt;statistics&gt;&lt;research&gt;&lt;statistical-finance&gt;&lt;testing&gt;&lt;event-study&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18806" PostTypeId="2" ParentId="15415" CreationDate="2015-07-09T23:10:18.003" Score="1" Body="&lt;p&gt;Cashflow at time $T_i$&#xA;$$CF_{T_i} = Not \times cov(T_{i-1},T_i) \times ( L(T_{i-1},T_i) + spread)$$ &#xA;where $L(T_{i-1},T_i)$ is the Libor fixed at time $T_{i-1}$ and $cov(T_{i-1},T_i)$ is the coverage or daycount fraction for period $[T_{i-1},T_i]$ (which depends on the specified convention eg Act/360).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The present value of this cashflow is &#xA;$$&#xA;  PV(t) = DF(t,T_i) \times Not \times cov(T_{i-1},T_i) \times ( L(t,T_{i-1},T_i) + spread)&#xA;$$&lt;br&gt;&#xA;where  $L(t,T_{i-1},T_i) = E^{T_i}_t[L(T_{i-1},T_i)]$ is the forward Libor and $DF(t,T_i)$ is the discount factor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Present value of one leg is the sum of cashflow pvs&#xA;$$&#xA;Leg(t) = \sum_i DF(t,T_i) \times Not \times cov(T_{i-1},T_i) \times ( L(t,T_{i-1},T_i) + spread)$$  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, present value of the swap is the difference between the two legs pvs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: I neglected the delay between fixing and settlement (usually a few days).&lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2015-07-09T23:10:18.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18807" PostTypeId="1" CreationDate="2015-07-10T01:37:50.533" Score="0" ViewCount="1803" Body="&lt;p&gt;Under the Heston model, the stock price and volatility follow the processes&#xA;\begin{align*}&#xA;dS &amp;amp; = \mu S dt + \sqrt{V} S dW^1, \\&#xA;dV &amp;amp; = \kappa (\theta - V)dt + \sigma \sqrt{V} dW^2, \\&#xA;dW^1 dW^2 &amp;amp; = \rho dt.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The parameters to be calibrated are $\kappa$, $\theta$, $\sigma$, $\rho$, and $V_0$, which appears in the pricing formula.  Below, I've used MATLAB's &lt;a href=&quot;http://www.mathworks.com/help/optim/ug/lsqnonlin.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;lsqnonlin&lt;/code&gt;&lt;/a&gt; function to minimize the objective function&#xA;$$&#xA;\sum_{i=1}^N \frac{1}{ask_i - bid_i}(C_i - \hat{C}_i)^2,&#xA;$$&#xA;where $C_i$ is the $i^{th}$ European call's market price and $\hat{C}_i$ is the corresponding Heston value.  After running this calibration to 170 separate days of prices, I've obtained the following empirical distributions for $\kappa$, $\theta$ and $\sigma$, and was curious if the orders of magnitude seem about right?&#xA;&lt;img src=&quot;https://i.stack.imgur.com/IVELN.jpg&quot; alt=&quot;kappa&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/6OKuh.jpg&quot; alt=&quot;sigma&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/zSHTX.jpg&quot; alt=&quot;theta&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I should mention I placed the following restrictions on the admissible parameter values during calibration, following the paper by &lt;a href=&quot;http://math.nyu.edu/~atm262/fall06/compmethods/a1/nimalinmoodley.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Moodley&lt;/a&gt;:&#xA;$$&#xA;\kappa &amp;gt; 0 \\&#xA;\theta \in [0, 1] \\&#xA;\sigma \in [0, 5] \\&#xA;\rho \in [-1, 0] \\&#xA;V_0 \in [0, 1]&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2015-07-10T01:37:50.533" Title="Values for Heston Model Parameters" Tags="&lt;calibration&gt;&lt;heston&gt;" AnswerCount="0" CommentCount="6" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18808" PostTypeId="1" CreationDate="2015-07-10T01:51:03.897" Score="7" ViewCount="8257" Body="&lt;p&gt;Ken French on his &lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html&quot; rel=&quot;nofollow&quot;&gt;website&lt;/a&gt; publishes daily, monthly and yearly returns for the Fama-French 3 Factors model which are excess market (Rm-Rf), small-minus-big (SMB) and high-minus-low (HML) returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't understand how he converts daily to monthly returns. For example for the last month the daily returns are&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;           Mkt-RF     SMB     HML      RF&#xA;20150501    1.01   -0.33   -0.60   0.000&#xA;20150504    0.32    0.06    0.16   0.000&#xA;20150505   -1.19   -0.10    0.34   0.000&#xA;20150506   -0.31    0.62   -0.20   0.000&#xA;20150507    0.39    0.03   -0.43   0.000&#xA;20150508    1.21   -0.54   -0.21   0.000&#xA;20150511   -0.39    0.67   -0.11   0.000&#xA;20150512   -0.27    0.00    0.11   0.000&#xA;20150513    0.01    0.02   -0.06   0.000&#xA;20150514    1.01   -0.10   -0.36   0.000&#xA;20150515    0.05   -0.26   -0.01   0.000&#xA;20150518    0.44    0.72   -0.09   0.000&#xA;20150519   -0.09   -0.08    0.03   0.000&#xA;20150520   -0.05    0.21   -0.09   0.000&#xA;20150521    0.23   -0.31    0.09   0.000&#xA;20150522   -0.22   -0.11   -0.14   0.000&#xA;20150526   -1.01   -0.04   -0.02   0.000&#xA;20150527    0.93    0.33   -0.39   0.000&#xA;20150528   -0.11    0.11    0.07   0.000&#xA;20150529   -0.58    0.02    0.05   0.000&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And the monthly returns are &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;        Mkt-RF     SMB     HML      RF&#xA;201505    1.36    0.92   -1.89    0.00&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For example to convert the daily Mkt-RF return to a monthly returns I use the following formula&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\text{ret}_\text{monthly} = \left(\prod_{i\in\text{day}} \left(\frac{\text{Mkt-RF}_i}{100} + 1\right) - 1 \right)*100&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\text{ret}_\text{monthly} = \left[\left(&#xA;\left(\frac{1.01}{100} + 1\right)\times&#xA;\left(\frac{0.32}{100} + 1\right)\times\cdots\times&#xA;\left(\frac{(-0.58}{100} + 1\right)&#xA;\right) - 1\right]\times100&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I find the following monthly returns&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;               CUSTOM CALCULATIONS&#xA;        Mkt-RF     SMB     HML      RF&#xA;201505    1.35    0.91   -1.85    0.00&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't understand why I get these differences. What am I doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="11958" LastEditorUserId="16160" LastEditDate="2017-04-17T02:53:18.187" LastActivityDate="2020-05-06T14:52:48.490" Title="Fama-French Data from daily to monthly returns" Tags="&lt;returns&gt;&lt;fama-french&gt;&lt;monthly&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18810" PostTypeId="1" CreationDate="2015-07-10T02:40:56.557" Score="2" ViewCount="689" Body="&lt;p&gt;I am a MFE student and we have project on the Markowitz portfolio optimization problem.&lt;/p&gt;&#xA;&lt;p&gt;i am wondering how much impact there will be, if I use a simpler linear optimizater instead of a quadratic one.&lt;/p&gt;&#xA;&lt;p&gt;Say, i have a target portfolio &lt;span class=&quot;math-container&quot;&gt;$x$&lt;/span&gt;, my alpha is &lt;span class=&quot;math-container&quot;&gt;$a$&lt;/span&gt;. I will try to maximize &lt;span class=&quot;math-container&quot;&gt;$xa$&lt;/span&gt;, and apply a factor exposure limit:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$l_0 &amp;lt; Ax &amp;lt; l_1$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;while &lt;span class=&quot;math-container&quot;&gt;$A$&lt;/span&gt; is my factor exposure&lt;/p&gt;&#xA;&lt;p&gt;What's the biggest disadvantage of above approach, compared with the classic quadratic approach widely used in Markowitz portfolio optimization.&lt;/p&gt;&#xA;&lt;p&gt;Can anyone explain to me a bit?&lt;/p&gt;&#xA;" OwnerUserId="16832" LastEditorUserId="41390" LastEditDate="2020-10-21T12:29:00.797" LastActivityDate="2020-10-21T12:29:00.797" Title="What's the disadvantage of using linear programming for portfolio optimization?" Tags="&lt;portfolio-optimization&gt;&lt;portfolio&gt;&lt;modern-portfolio-theory&gt;&lt;optimization&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="18811" PostTypeId="1" AcceptedAnswerId="18819" CreationDate="2015-07-10T07:47:09.970" Score="4" ViewCount="822" Body="&lt;p&gt;I am working on a credit scoring model for a credit without a garanty (consumer credit). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for a methodology for an expert system for credit scoring decision that doesn't base on statistical methods. I tried several statistical methods on my data (logistic regression, random forest) - without sucess. My variables are not predictive enough and predictions are too poor to build a scorecard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am modeling a binary variable with levels 0 and 1 where 1 is the default and I have several predictive variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I'm looking for a method that combines the information of the data with an expert system (human knowledge)? What can I do?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does a method/algorithm like this exists? What about Apriori?&lt;/p&gt;&#xA;" OwnerUserId="16852" LastEditorUserId="16852" LastEditDate="2015-07-10T14:43:37.327" LastActivityDate="2015-07-11T11:53:40.797" Title="Expert System for Credit Scoring" Tags="&lt;credit-scoring&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18812" PostTypeId="2" ParentId="18810" CreationDate="2015-07-10T09:14:21.757" Score="0" Body="&lt;p&gt;The Markowitz setup assumes agents have mean-variance preferences (CARA utility when returns are normally distributed yields the same). So the standard markowitz optimization maximizes risk-return tradeoff, where risk is measured by variance and return by mean. It penalizes risk depending on the degree of risk aversion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If instead you use linear programming, that is ok, but you should have a strong theory behind on why those constraints matter. As I said before the markowitz setup is based on a strong theory.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-07-10T09:14:21.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18813" PostTypeId="2" ParentId="18808" CreationDate="2015-07-10T09:17:18.573" Score="4" Body="&lt;p&gt;You are doing it right. The differences are rounding issues and can be safely ignored for any practical purpose. &lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-07-10T09:17:18.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18815" PostTypeId="1" CreationDate="2015-07-10T12:21:26.977" Score="0" ViewCount="56" Body="&lt;p&gt;Let's say you want to model the next day price returns for a set of US equities large cap ETFs (a relatively homogenous group). Would you model all the ETFs as a single, 15 years data set, or each ETF individually? Each ETF would have around 15*252 = 3780 unique data points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know, it's a general question that is relative to the predictors used, the strategy goal and other things. But what are the plus and minuses of each approach?&lt;/p&gt;&#xA;" OwnerUserId="1791" LastActivityDate="2015-09-22T17:39:55.603" Title="Modeling EOD ETFs price returns together or individually?" Tags="&lt;modeling&gt;&lt;etf&gt;&lt;prediction&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18818" PostTypeId="2" ParentId="17315" CreationDate="2015-07-10T16:24:29.227" Score="1" Body="&lt;p&gt;If paying for it is not an issue you should get CRSP dataset which is available on Wharton Research Data Services. I think the only thing you can't do is search by ISIN. However, you do can get all stocks of an index in a single file. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also you can search by ticker, permno, permco, secid, etc.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-07-10T16:24:29.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18819" PostTypeId="2" ParentId="18811" CreationDate="2015-07-10T17:08:54.933" Score="6" Body="&lt;p&gt;The best model used by practitioners to model consumer credit is the logistic regression model; now, you said that you tried modelling by using logistic model without success, but I want trying to suggest you the step-by-step procedure I would use in such case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To model consumer credit, I'd follow the following procedure:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Sample Analysis&lt;/strong&gt;: &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I analyze the distribution of such sample, verifying that it has approximately the same distribution of the population or benchmark. The sample size should be adequate (at least 50k observations over at least 5/7 years observations, according to what is suggested by Basel agreement).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In such step, you can perform this kind of analysis by using the &lt;em&gt;Population Stability Index&lt;/em&gt;, given, for each variable, by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$PSI$ $=$ $\sum\limits_{i=1}^n (P_{i,1}-P_{i,2})*ln\frac{P_{i,1}}{P_{i,2}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $P_{i,1}$ is the percentage of observations in the j-class of the population/benchmark you considered and $P_{i,2}$ is the the percentage of observations in the j-class of the sample.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Compute the PSI for each variable in your sample, by verifying that the PSI is less than 10%; the threshold is empirical and depends on the country/instrument you're analyzing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Eliminate from the sample variables that are not stable on the basis of the PSI.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Data Quality Analysis&lt;/strong&gt;: &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;analyze the sample values pinpointing the percentage of &lt;em&gt;missing values&lt;/em&gt;, &lt;em&gt;anomalies&lt;/em&gt; in the values (as, for instance, value 999.999) and &lt;em&gt;error values&lt;/em&gt; according to the economic sense (as, for instance, negative values for variables that should be necessarily positive, like the loan value). I'd eliminate all variables with missings, anomalies or error values with a percentage greater than 5%.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Logistic Regression Analysis&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Implement a logistic by regressing the target variable on the independent ones, by eliminating the variables that are not significative at the 5% level; eliminate the variables with correlation greater than 30% (again, this is an empirical rule, so, use that as rule of thumbs and not as threshold point). After that, run a stepwise variable selection model, by keeping the significant variables only.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, this is the basic step-by-step procedure I'd use to model consumer credit market. Following this one, you should get an AUROC about equal to 80% (70% on the test/validation set). If it is not, you could calibrate/adjust your model by introducing expert/judgemental variables in. This means asking your colleagues to define what variables, according to them, influences the probability of default and adjust the weight the variables have in the model by capping them; this is the simpler way. Secondly, you could develop a parallel model constructed on judgemental way entirely (for instance, make a questionnaire about the variables could affect the PD and ask to several practitioners to compile that and, finally, take the more significative variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're not a practitioner, the following ones are the most common variables affecting the PD:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Loan/Credit amount;&lt;/li&gt;&#xA;&lt;li&gt;Debt-To-Income ratio;&lt;/li&gt;&#xA;&lt;li&gt;Age;&lt;/li&gt;&#xA;&lt;li&gt;Job;&lt;/li&gt;&#xA;&lt;li&gt;Wage/salary amount;&lt;/li&gt;&#xA;&lt;li&gt;Credit Bureau score;&lt;/li&gt;&#xA;&lt;li&gt;Past consumer hystory (if the customer bought something in the past and was be able to pay back or not the debt);&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;and so on... Unfortunately, it does not exist an algorithm to develop expert-based credit risk model. Indeed, the expert judge is based on the experience of the bank teller/manager and such experience changes according to the country in which the employer. The consumer credit market changes according to a lot of things, such as the country culture, the rules, the law, the way the Central Banks applies Basel agreement, and so on. It is not possible to adapt a model build to perform in UK to a Latin country, like Spain, Italy, etc&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastEditorUserId="2553" LastEditDate="2015-07-11T11:53:40.797" LastActivityDate="2015-07-11T11:53:40.797" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="18821" PostTypeId="2" ParentId="18804" CreationDate="2015-07-10T21:49:15.697" Score="1" Body="&lt;p&gt;The rating downgrade/upgrade effect is definitely more extreme during financial crisis, because of several effects (among all, flight-to quality, flight-to-liquidity and news effects itself), as shown by:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;a href=&quot;http://www.econstor.eu/bitstream/10419/46555/1/660173077.pdf&quot; rel=&quot;nofollow&quot;&gt;Arezki, Rabah, Bertrand Candelon, and Amadou Nicolas Racine Sy. &quot;Sovereign rating news and financial markets spillovers: Evidence from the European debt crisis.&quot; IMF working papers (2011): 1-27.&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The paper analyzes the news effects on financial markets by using simply linear regression model, as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_{i,t}$ = $\alpha$ + $\sum\limits_{i=1}^n \beta_i*D_{i,t}$ + $\epsilon_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $r_{i,t}$ is the market returns relative to the country you're going to analyze and $D_{i,t}$ is the variable relative to the presence of news; if $D_{i,t}$ results to be statistically significant and different from $0$, then news will have been affected the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This could be a solution to your question, but, alternatively, you could take into consideration:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Brown, S. J., &amp;amp; Warner, J. B. (1985). Using daily stock returns: The&#xA;  case of event studies. Journal of financial economics, 14(1), 3-31.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;that you cited in the question, or, better:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;a href=&quot;http://down.cenet.org.cn/upfile/10/2008725123226110.pdf#page=30&quot; rel=&quot;nofollow&quot;&gt;Kothari, S. P., and Jerold B. Warner. &quot;The econometrics of event studies.&quot; Available at SSRN 608601 (2004).&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;that is more recent and used in event study methodology.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to carry with linear regression model on, I suggest you to implement the following model: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_{i,t}$ = $\alpha$ + $\sum\limits_{i=1}^n \beta_i*D^1_{i,t}$ + $\sum\limits_{i=1}^n \delta_i*D^2_{i,t}$ + $\epsilon_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where, in this case, $D^1_{i,t}$ is the news presence during normal times and $D^2_{i,t}$ is the news presence during financial crisis time periods. If $\delta$ $&amp;gt;$ $\beta$, you showed that, on average, news affects financial markets much more during financial crisis than during normal times.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="2553" LastActivityDate="2015-07-10T21:49:15.697" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18822" PostTypeId="1" CreationDate="2015-07-10T23:01:19.043" Score="7" ViewCount="3668" Body="&lt;p&gt;I bought &lt;a href=&quot;http://quantquote.com&quot; rel=&quot;noreferrer&quot;&gt;quantquote.com&lt;/a&gt; historical data of AAPL on second basis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To comapre I also got &lt;a href=&quot;http://activetick.com&quot; rel=&quot;noreferrer&quot;&gt;activetick.com&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For activetick I used the historical trading API.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you look at around 15:13:53 you see that ActiveTick reports Quotes where QuantCode claims non exist in specific second.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does QuantQuote only consider quotes form certain exchanges?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;ActiveTick (quotes)&#xA;Datetime,Price,Size,Exchange,Cond1,Cond2,Cond3,Cond4&#xA;2014-07-21 15:13:40.134,94.045,1100,Q,37,0,14,0&#xA;2014-07-21 15:13:41.003,94.047,3,D,0,0,0,37&#xA;2014-07-21 15:13:43.429,94.05,100,D,0,0,0,0&#xA;2014-07-21 15:13:43.472,94.045,900,D,0,0,0,0&#xA;2014-07-21 15:13:47.612,94.0401,50,D,0,0,0,37&#xA;2014-07-21 15:13:47.869,94.04,12,D,0,0,0,37&#xA;2014-07-21 15:13:48.508,94.0401,21,D,0,0,0,37&#xA;2014-07-21 15:13:48.648,94.0449,159,D,0,0,0,0&#xA;2014-07-21 15:13:49.291,94.0497,100,D,0,0,0,0&#xA;2014-07-21 15:13:50.350,94.047,105,D,0,0,0,0&#xA;&lt;strong&gt;2014-07-21 15:13:51.449,94.05,100,Y,0,0,0,0&#xA;2014-07-21 15:13:51.450,94.05,95,J,0,0,0,37&#xA;2014-07-21 15:13:51.450,94.05,100,J,0,0,0,0&#xA;2014-07-21 15:13:51.450,94.045,100,Z,0,0,0,0&#xA;2014-07-21 15:13:51.450,94.045,500,Z,0,0,0,0&#xA;2014-07-21 15:13:51.450,94.05,100,Z,0,0,0,0&#xA;2014-07-21 15:13:51.623,94.05,400,D,0,0,0,0&#xA;2014-07-21 15:13:51.623,94.05,200,D,0,0,0,0&#xA;2014-07-21 15:13:51.623,94.05,200,D,0,0,0,0&#xA;2014-07-21 15:13:52.683,94.045,200,Z,0,0,14,0&#xA;2014-07-21 15:13:54.319,94.0499,50,D,0,0,0,37&#xA;2014-07-21 15:13:55.278,94.045,200,Z,0,0,0,0&lt;/strong&gt;&#xA;2014-07-21 15:13:58.186,94.05,20,Z,0,0,0,37&#xA;2014-07-21 15:13:58.212,94.05,100,D,0,0,0,0&#xA;2014-07-21 15:13:58.346,94.0499,20,D,0,0,0,37&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;QuantQuote (seconds)&#xA;datetime_unix, datetime,time,usd_open,usd_high,usd_low,usd_close,volume&#xA;1405969978 2014-07-21 15:12:58 33178000 94.63 94.6394.63 94.63 55&#xA;1405969988 2014-07-21 15:13:08 33188000 94.62 94.6294.62 94.621000&#xA;1405969993 2014-07-21 15:13:13 33193000 94.62 94.6294.62 94.62 300&#xA;1405969994 2014-07-21 15:13:14 33194000 94.62 94.6294.62 94.62 200&#xA;1405969998 2014-07-21 15:13:18 33198000 94.62 94.6294.62 94.621919&#xA;1405970000 2014-07-21 15:13:20 33200000 94.62 94.6294.62 94.62 100&#xA;1405970006 2014-07-21 15:13:26 33206000 94.63 94.6394.63 94.63 25&#xA;1405970010 2014-07-21 15:13:30 33210000 94.62 94.6294.62 94.622000&#xA;1405970016 2014-07-21 15:13:36 33216000 94.62 94.6294.62 94.622400&#xA;1405970017 2014-07-21 15:13:37 33217000 94.62 94.6294.61 94.61 100&#xA;1405970023 2014-07-21 15:13:43 33223000 94.63 94.6494.62 94.642100&#xA;1405970029 2014-07-21 15:13:49 33229000 94.63 94.6394.63 94.63 100&#xA;&lt;strong&gt;1405970030 2014-07-21 15:13:50 33230000 94.64 94.6494.63 94.631900&#xA;1405970033 2014-07-21 15:13:53 33233000 94.63 94.6394.63 94.63 100&#xA;1405970035 2014-07-21 15:13:55 33235000 94.63 94.6394.63 94.63 200&lt;/strong&gt;&#xA;1405970037 2014-07-21 15:13:57 33237000 94.63 94.6394.63 94.634323&#xA;1405970039 2014-07-21 15:13:59 33239000 94.63 94.6394.63 94.63 400&#xA;1405970048 2014-07-21 15:14:08 33248000 94.63 94.6394.63 94.631000&#xA;1405970049 2014-07-21 15:14:09 33249000 94.63 94.6394.63 94.63 200&#xA;1405970061 2014-07-21 15:14:21 33261000 94.63 94.6394.63 94.63 200&#xA;1405970062 2014-07-21 15:14:22 33262000 94.62 94.6294.62 94.62 100&#xA;1405970072 2014-07-21 15:14:32 33272000 94.63 94.6394.63 94.63 100&#xA;1405970073 2014-07-21 15:14:33 33273000 94.63 94.6394.63 94.633176&#xA;1405970106 2014-07-21 15:15:06 33306000 94.64 94.6494.64 94.64 265&#xA;1405970112 2014-07-21 15:15:12 33312000 94.65 94.6594.65 94.65 100&#xA;1405970120 2014-07-21 15:15:20 33320000 94.65 94.6594.65 94.65 200&#xA;1405970133 2014-07-21 15:15:33 33333000 94.66 94.6694.66 94.663339&#xA;1405970134 2014-07-21 15:15:34 33334000 94.66 94.6694.66 94.66 400&#xA;1405970135 2014-07-21 15:15:35 33335000 94.66 94.6694.66 94.66 200&#xA;1405970142 2014-07-21 15:15:42 33342000 94.66 94.6694.66 94.66 296&#xA;1405970146 2014-07-21 15:15:46 33346000 94.66 94.6794.66 94.67 400&#xA;&lt;/code&gt;&#xA;EDIT: ActiveTick includes the following exchanges in the data:&#xA;&lt;code&gt;&#xA;exchange    value&#xA;ExchangeAMEX    A&#xA;ExchangeNasdaqOmxBx B&#xA;ExchangeNationalStockExchange   C&#xA;ExchangeFinraAdf    D&#xA;ExchangeCQS E&#xA;ExchangeForex   F&#xA;ExchangeInternationalSecuritiesExchange I&#xA;ExchangeEdgaExchange    J&#xA;ExchangeEdgxExchange    K&#xA;ExchangeChicagoStockExchange    M&#xA;ExchangeNyseEuronext    N&#xA;ExchangeNyseArcaExchange    P&#xA;ExchangeNasdaqOmx   Q&#xA;ExchangeCTS S&#xA;ExchangeCTANasdaqOMX    T&#xA;ExchangeOTCBB   U&#xA;ExchangeNNOTC   u&#xA;ExchangeChicagoBoardOptionsExchange W&#xA;ExchangeNasdaqOmxPhlx   X&#xA;ExchangeBatsYExchange   Y&#xA;ExchangeBatsExchange    Z&#xA;ExchangeCanadaToronto   T&#xA;ExchangeCanadaVenture   V&#xA;ExchangeComposite&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="16858" LastEditorUserId="16858" LastEditDate="2015-07-11T16:13:18.587" LastActivityDate="2019-01-23T22:59:59.270" Title="Why are Quantquote historical trades different vom ActiveTick historical trades" Tags="&lt;quant-trading-strategies&gt;&lt;historical-data&gt;" AnswerCount="8" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18823" PostTypeId="2" ParentId="18822" CreationDate="2015-07-11T02:37:52.817" Score="2" Body="&lt;p&gt;You won't get an exact answer for this I'm sure, all one can say is welcome to the world of finance and bad data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All jokes aside there could be a number of reasons (one vendor missed a message, network lag, not getting quotes from a certain exchange exc).&lt;/p&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="1764" LastEditDate="2015-07-11T02:56:15.687" LastActivityDate="2015-07-11T02:56:15.687" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18825" PostTypeId="2" ParentId="18581" CreationDate="2015-07-11T08:03:03.980" Score="3" Body="&lt;p&gt;Before making regression you have to perform test on fractional integration on each component.&#xA;The power and size of traditional unit root tests are poor. The tests’ weak power implies that the statistical tests cannot distinguish between a unit root process and a fractionally integrated series with long memory (Baillie, 1996). As a consequence, a mean-reverting time series is incorrectly considered as a unit root process.&#xA;The residual also could be fractional and therefore bad mean reverting.&lt;/p&gt;&#xA;" OwnerUserId="16861" LastActivityDate="2015-07-11T08:03:03.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18827" PostTypeId="1" CreationDate="2015-07-11T17:13:48.327" Score="2" ViewCount="1708" Body="&lt;p&gt;I am currently working on implementing Heston model in matlab for option pricing (in this case I am trying to price a European call) and I wanted to compare the results I obtain from using the exact formula and the Monte-Carlo simulation using the Milstein discretization.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to provide you more details about what I am doing, here is the equation I use for each code :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;The process :&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS_t = \mu_tS_tdt + v_t^{1/2}S_tdZ_1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dv_t = -\lambda(v_t - \theta)dt + \eta(v_t)^{1/2}dZ_2$ with $&amp;lt;dZ_1 dZ_2&amp;gt; = \rho dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Exact formula :&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this part, I am using the following formula (from Gatheral).&#xA;$C(x, v, \tau) = K[e^xP_1(x, v, \tau) - P_0(x, v, \tau)]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\alpha = -\frac{u^2}{2} - \frac{iu}{2} + iju$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\beta = \lambda - \rho \eta j - \rho \eta i u$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\gamma = \frac{\eta^2}{2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_\pm = \frac{\beta \pm \sqrt{\beta^2 - 4\alpha \gamma}}{2\gamma} := \frac{\gamma \pm d}{\eta^2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$g := \frac{r_-}{r_+}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$D(u, \tau) = r_- \frac{1-e^{-d\tau}}{1-ge^{-d\tau}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C(u, \tau) = \lambda[r_- \tau- \frac{2}{\eta^2}log(\frac{1-ge^{-d\tau}}{1-g})]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P_j(x, v, \tau) = \frac{1}{2} + \frac{1}{\pi}\int_0^{\infty}{Re(\frac{exp(C_j(u, \tau)\theta + D_j(u, \tau)v+iux)}{iu}du)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Monte-Carlo scheme&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$v_{i+1} = (\sqrt{v_i} + \frac{\eta}{2} \sqrt{\Delta t}Z)^2 - \lambda (v_i - \theta)\Delta t - \frac{\eta^2}{4} \Delta t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$x_{i+1} = x_i - \frac{v_i}{2}\Delta t + \sqrt{v_i \Delta t}W$ with $x_i := log(S_i/S_0)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem I have when implementing this two methods is that the result I get is very different from each other (by factor 10). I compared the result of the first method with some I could find on internet and it was coherent with what I get. I also compare the result of the Monte-Carlo simulation with parameters with bring back the Black-Scholes formula and the result is quite good. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem arise when I try the same parameters on the 2 methods and the output is no even comparable from each other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I provide you also with the code I use for implementing those methods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Close form method :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function [ res ] = HestonPrice( t, S, V, K, T, r, lambda, vMean, eta, rho)&#xA;%UNTITLED Summary of this function goes here&#xA;%   This function compute the price of a call option using the close form&#xA;%   of the Heston model&#xA;%   Inputs : &#xA;%   t : date at which one we want to compute the price&#xA;%   S : price of the asset at time t&#xA;%   V : volatility at time t&#xA;%   K : Strike of the option&#xA;%   T : Expiration date of the option&#xA;%   r : Risk free rate&#xA;%   lambda : speed of the mean reversion&#xA;%   vMean : long-term mean for the variance (not the volatility !!!)&#xA;%   eta : volatility of the volatility equation&#xA;%   rho : correlation between the two brownian processes&#xA;%&#xA;%   Output : &#xA;%   res : Price of the call option&#xA;%&#xA;%   Example : &#xA;%   HestonPrice(0, 1, 0.16, 2, 10, 0, 1, 0.16, 2, -0.8) -&amp;gt; 0.0495&#xA;&#xA;FtT = S * exp(r*(T-t));&#xA;x = log(FtT / K);&#xA;tau = T-t;&#xA;&#xA;P0 = P(0, V, x, tau, rho, eta, lambda, vMean);&#xA;P1 = P(1, V, x, tau, rho, eta, lambda, vMean);&#xA;&#xA;res = K * (exp(x) * P1 - P0) * exp(-r*(T-t));&#xA;&#xA;end&#xA;&#xA;function [ res ] = D(j, u, tau, rho, eta, lambda)&#xA;&#xA;    alpha = - u .* u / 2 - 1i .* u / 2 + 1i .* j .* u;&#xA;    beta = lambda - rho .* eta .* j - rho .* eta .* 1i .* u;&#xA;    gamma = eta .* eta / 2;&#xA;    d = sqrt(beta .* beta - 4 .* alpha .* gamma);&#xA;&#xA;    rPlus = (beta + d)./(2 * gamma);&#xA;    rMinus = (beta - d)./(2 * gamma);&#xA;    g = rMinus ./ rPlus;&#xA;&#xA;    res = rMinus .* (1 - exp(-d .* tau)) ./ (1 - g .* exp(-d .* tau));&#xA;&#xA;end&#xA;&#xA;function [ res ] = C(j, u, tau, rho, eta, lambda)&#xA;&#xA;    alpha = - u .* u / 2 - 1i * u / 2 + 1i .* j .* u;&#xA;    beta = lambda - rho * eta * j - rho .* eta .* 1i .* u;&#xA;    gamma = eta .* eta / 2;&#xA;    d = sqrt(beta .* beta - 4 .* alpha .* gamma);&#xA;&#xA;    rPlus = (beta + d)./(2 .* gamma);&#xA;    rMinus = (beta - d)./(2 .* gamma);&#xA;    g = rMinus ./ rPlus;&#xA;&#xA;    res = lambda .* (rMinus .* tau - 2 ./ (eta .* eta) .* log((1 - g .* exp(-d .* tau))./(1-g)));&#xA;&#xA;end&#xA;&#xA;function [ res ] = funToIntegrate(j, v, x, u, tau, rho, eta, lambda, vMean)&#xA;    CCompute = C(j, u, tau, rho, eta, lambda);&#xA;    DCompute = D(j, u, tau, rho, eta, lambda);&#xA;    res = real(exp(CCompute .* vMean + DCompute .* v + 1i .* u .* x) ./ (1i .* u));&#xA;end&#xA;&#xA;function [ res ] = P(j, v, x, tau, rho, eta, lambda, vMean)&#xA;fun = @(u) funToIntegrate(j, v, x, u, tau, rho, eta, lambda, vMean);&#xA;resIntegration = integral(fun, 0, Inf);&#xA;&#xA;res = 1/2 + 1/pi * resIntegration;&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Monte Carlo Method : &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function [ res ] = HestonPrice_MC( t, S, V, K, T, r, lambda, vMean, eta, rho, n, samples )&#xA;%UNTITLED4 Summary of this function goes here&#xA;%   Detailed explanation goes here&#xA;%   HestonPrice_MC(0, 1, 0.16, 2, 10, 0, 1, 0.16, 2, -0.8, 1000, 10000)&#xA;&#xA;    temp = zeros(samples, 1);&#xA;&#xA;    parfor i=1:samples&#xA;       temp(i) = finalPriceX(t, r, V, T, lambda, vMean, eta, rho, n);&#xA;    end&#xA;    temp = S * exp(temp);&#xA;    temp = max(temp - K, 0);&#xA;    res = mean(temp) * exp(-r * (T-t));&#xA;end&#xA;&#xA;function [X, V] = nextStep(r, x, v, lambda, vMean, eta, rho, deltaT)&#xA;    coovMat = [1 rho; rho 1];&#xA;    rdVar = mvnrnd([0 0], coovMat);&#xA;&#xA;    V = (sqrt(v) + eta * 0.5 * sqrt(deltaT) * rdVar(1))^2 - lambda * (v - vMean) * deltaT - eta^2 * 0.25 * deltaT;&#xA;    if V &amp;lt; 0&#xA;        V = 0;&#xA;    end&#xA;    X = x + (r - v * 0.5) * deltaT + sqrt(v * deltaT) * rdVar(2);&#xA;end&#xA;&#xA;function [price] = finalPriceX(t, r, V, T, lambda, vMean, eta, rho, n) &#xA;    x = 0;&#xA;    v = V;&#xA;    deltaT = (T-t)/n;&#xA;&#xA;    for i=1:n&#xA;        [x_temp, v_temp] = nextStep(r, x, v, lambda, vMean, eta, rho, deltaT);&#xA;        x = x_temp;&#xA;        v = v_temp;&#xA;    end&#xA;&#xA;    price = x;&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I use the following parameters for the simulation : &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;fprintf('Computation of the Heston price with the close form formula');&#xA;HestonPrice(0, 1, 0.16, 2, 10, 0, 1, 0.16, 2, -0.8)&#xA;&#xA;% Computation of the Heston price using Milstein discretization and&#xA;% Monte-Carlo method&#xA;&#xA;fprintf('Computation of the Heston price with the Milstein discretization + Monte-Carlo');&#xA;HestonPrice_MC(0, 1, 0.16, 2, 10, 0, 1, 0.16, 2, -0.8, 500, 1000)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With the close form formula I obtain : 0.0495&#xA;With the Monte-Carlo Simulation I obtain : 0.2300&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If anyone of you have any idea about where this problem could come from, I would be very happy of it since I've spend 2 weeks trying to find the issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you by advance ! :)&lt;/p&gt;&#xA;" OwnerUserId="16862" LastActivityDate="2015-07-11T17:13:48.327" Title="Simulation of Heston process" Tags="&lt;options&gt;&lt;monte-carlo&gt;&lt;matlab&gt;&lt;heston&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18828" PostTypeId="1" AcceptedAnswerId="18829" CreationDate="2015-07-11T18:26:58.350" Score="3" ViewCount="454" Body="&lt;p&gt;I'm interested in learning how to adjust my own futures contracts for analysis. Unfortunately my quantitative classes didn't really go into this, and I would like to learn it on my own. The methods seem fairly straight forward, but I noticed something in the data that seemed concerning. Take the CZ2014 December Corn Futures data:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.quandl.com/data/CME/CZ2014-Corn-Futures-December-2014-CZ2014&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.quandl.com/data/CME/CZ2014-Corn-Futures-December-2014-CZ2014&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The data look like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/aXeAf.png&quot; alt=&quot;data&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first question - why am I seeing 2012-2013 data in a December 2014 historical price listing? Shouldn't this just be data for the month of December?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next question is, why is there a sudden whip-saw early in the data but it seems to stabilize after that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm sure these questions are trivial but I'm pretty confused at the moment. Thanks for the help!&lt;/p&gt;&#xA;" OwnerUserId="16863" LastActivityDate="2016-04-01T18:52:20.020" Title="Understanding Quandl Futures Data" Tags="&lt;data&gt;&lt;futures&gt;&lt;historical-data&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18829" PostTypeId="2" ParentId="18828" CreationDate="2015-07-11T18:45:22.290" Score="2" Body="&lt;p&gt;If you plot the price series against volume or open interest, you'll see there was no trading at all in the contract during the early part of the series. This is common for futures – the exchange lists quite a few of them, but only nearby expiries are actually traded. The other contracts still have daily settlement prices, but cannot be relied upon.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2015-07-11T18:45:22.290" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18830" PostTypeId="2" ParentId="17188" CreationDate="2015-07-11T18:48:30.440" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/jamesmawm/Options-Modelling/blob/master/BS.py&quot; rel=&quot;nofollow&quot;&gt;See this resource at github , it uses different methods to calculate IV programmatically &lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16726" LastActivityDate="2015-07-11T18:48:30.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18832" PostTypeId="2" ParentId="18822" CreationDate="2015-07-11T23:28:06.833" Score="7" Body="&lt;p&gt;Let me guess, you fell for one of the fake Quantquote reviews and decided to purchase their buggy data?&lt;/p&gt;&#xA;&lt;p&gt;The reason for the missing quotes is Quantquote data is more of a snap-shot of market activity. It will not record every quote the way TickData or CQG does. ActiveTick is not as expansive as TickData but is more comprehensive than Quantquote.&lt;/p&gt;&#xA;&lt;p&gt;Maybe this will help on their capture process: &lt;a href=&quot;https://www.bigmiketrading.com/421509-post14.html&quot; rel=&quot;noreferrer&quot;&gt;https://www.bigmiketrading.com/421509-post14.html&lt;/a&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;I wouldn't recommend QuantQuote for your purposes. They only provide the historical/live consolidated feed and IQFeed is better priced for those features.&lt;/p&gt;&#xA;&lt;p&gt;It's not a seasoned group. I happen to know one of the main persons (a 25 year old physics major out of Caltech) behind QuantQuote through the CERN network and he is currently focused on crowdfunding a secure email product rather than QQ. From what I know of their credentials, they don't have a strong development team. Also, If I'm not wrong, QuantQuote is associated with Sam Barnett's (Sam Barnett SBB Research Group - Business Insider) group - I don't know for sure but I'm guessing that they are just selling a capture of SBB Research's live data.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;In a nutshell, Garbage In Garbage Out.&lt;/p&gt;&#xA;" OwnerUserId="16868" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2015-07-11T23:28:06.833" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18833" PostTypeId="2" ParentId="18736" CreationDate="2015-07-12T02:02:44.750" Score="5" Body="&lt;p&gt;Let $\{P_t \mid t \geq 0\}$ be a compound Poisson process, where&#xA;\begin{align*}&#xA;P_t = \sum_{i=1}^{N_t} (V_i -1),&#xA;\end{align*}&#xA;and $N_t$ is a Poisson process with intensity $\lambda$ and jump times $\tau_i$, $i = 1, \ldots, \infty$.&#xA;Let $Y_i=\ln V_i$ and $f(x)$ be the density function. Then&#xA;\begin{align*}&#xA;P_t - \lambda t E(V_1) &amp;amp;= P_t - \lambda t \int_{\mathbb{R}}(e^x-1)f(x) dx&#xA;\end{align*}&#xA;is a martingale. We denote by $\eta = \int_{\mathbb{R}}(e^x-1)f(x) dx$. Moreover, we assume that the equity price process $\{S_t \mid t \geq 0\}$ satisfies the SDE&#xA;\begin{align*}&#xA;\frac{dS_t}{S_t} = (r-q-\lambda \eta)dt + \sigma dW_t + dP_t,&#xA;\end{align*}&#xA;where $\{W_t \mid t \geq 0\}$ is a standard Brownian motion. Then&#xA;\begin{align*}&#xA;S_t = S_0 \exp\Big(\big(r-q-\frac{1}{2}\sigma^2 - \lambda \eta \big)t + \sigma W_t + \sum_{i=1}^{N_t} Y_i \Big).&#xA;\end{align*}&#xA;That is, &#xA;\begin{align*}&#xA;d \ln S_t = (r-q-\frac{1}{2}\sigma^2-\lambda \eta)dt + \sigma dW_t + d\sum_{i=1}^{N_t} Y_i.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $X_t = \ln S_t$, and $u(X_t, t)$ be the option price at time $t$, where $0  \leq t \leq T$. Then, by Ito's formula,&#xA;\begin{align*}&#xA;u(X_t, t) &amp;amp;= u(X_0, 0) + \int_0^t\partial_t u(X_s, s) ds + \int_0^t\partial_x u(X_{s-}, s) dX_s + \frac{1}{2}\sigma^2 \int_0^t \partial_{xx} u(X_s, s)ds\\&#xA;&amp;amp; \qquad +\sum_{s \leq t}\big[u(X_s, s) - u(X_{s-}, s) - \partial_x u(X_{s-}, s)\Delta X_s\big] \quad (\mbox{where } \Delta X_s=X_s - X_{s-})\\&#xA;&amp;amp;= u(X_0, 0) + \int_0^t\partial_t u(X_s, s) ds + \int_0^t\partial_x u(X_{s}, s) dX_s^c + \frac{1}{2}\sigma^2 \int_0^t \partial_{xx} u(X_s, s)ds\\&#xA;&amp;amp; \qquad +\sum_{s \leq t}\big[u(X_t, t) - u(X_{t-}, t) \big] \quad (\mbox{where } X_t^c = \big(r-q-\frac{1}{2}\sigma^2 - \lambda \eta \big)t + \sigma W_t)\\&#xA;&amp;amp;=  u(X_0, 0) + \int_0^t\partial_t u(X_s, s) ds + \int_0^t\partial_x u(X_{s}, s) dX_s^c + \frac{1}{2}\sigma^2 \int_0^t \partial_{xx} u(X_s, s)ds\\&#xA;&amp;amp; \qquad +\int_0^t \int_{\mathbb{R}}\big[ u(X_{s-} + y, s) - u(X_{s-}, s))\big]\mu(ds, dy) \quad (\mbox{where } \mu = \sum_{i=1}^{\infty} \delta_{\tau_i, Y_i})\\&#xA;&amp;amp;=  u(X_0, 0) + \int_0^t\partial_t u(X_s, s) ds + \int_0^t\partial_x u(X_{s}, s) dX_s^c + \frac{1}{2}\sigma^2 \int_0^t \partial_{xx} u(X_s, s)ds\\&#xA;&amp;amp;\qquad  +\int_0^t \int_{\mathbb{R}}\big[ u(X_{s-} + y, s) - u(X_{s-}, s))\big](\mu(ds, dy) - ds v(dy)) \\&#xA;&amp;amp;\qquad  +\int_0^t ds\int_{\mathbb{R}}\big[ u(X_{s} + y, s) - u(X_{s}, s))\big]\lambda f(y)dy,&#xA;\end{align*}&#xA;where $v(dy) = \lambda f(y)dy$. Here &#xA;\begin{align*}&#xA;M_t = \int_0^t \int_{\mathbb{R}}\big[ u(X_{s-} + y, s) - u(X_{s-}, s))\big](\mu(ds, dy) - ds v(dy))&#xA;\end{align*}&#xA;is a martingale. Since $u(X_t, t) e^{-rt}$ is a martingale, and&#xA;\begin{align*}&#xA;d\big(u(X_t, t) e^{-rt}\big) &amp;amp;= e^{-rt}\big[-r u dt + du\big],&#xA;\end{align*}&#xA;we obtain that&#xA;\begin{align*}&#xA;&amp;amp;-ru(X_t, t) + \partial_t u(X_t, t) + \big(r-q-\frac{1}{2}\sigma^2 - \lambda \eta \big)\partial_x u(X_{s}, s)&#xA;+ \frac{1}{2}\sigma^2 \partial_{xx} u(X_t, t) \\&#xA;&amp;amp; \qquad\qquad + \int_{\mathbb{R}}\big[ u(X_{t} + y, t) - u(X_{t}, t))\big]\lambda f(y)dy = 0.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;&amp;amp; \partial_t u(X_t, t) + \big(r-q-\frac{1}{2}\sigma^2 - \lambda \eta \big)\partial_x u(X_{s}, s)&#xA;+ \frac{1}{2}\sigma^2 \partial_{xx} u(X_t, t) -(r+\lambda)u(X_t, t)\\&#xA;&amp;amp; \qquad\qquad + \lambda \int_{\mathbb{R}} u(X_{t} + y, t) f(y)dy = 0.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-07-12T20:06:57.677" LastActivityDate="2015-07-12T20:06:57.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18834" PostTypeId="2" ParentId="15953" CreationDate="2015-07-12T03:44:13.113" Score="1" Body="&lt;p&gt;in the continuous case, you can regard the dividend rate as the interest on a foreign bank account if we invest it so the number of shares grows at the rate $d.$ So we can think it as a call option on a foreign exchange rates. Now calls and puts are the same thing in foreign exchange just by changing viewpoint. So the pricing is just as hard for calls as for puts and exercise can happen any time depending on the relative interest rates. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-07-12T03:44:13.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18835" PostTypeId="2" ParentId="18758" CreationDate="2015-07-12T06:12:37.753" Score="10" Body="&lt;p&gt;Try the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quantmod)  # also loads xts and TTR&#xA;&#xA;# Fetch all Symbols &amp;amp; store only the tickers to retrieve the data&#xA;symbols &amp;lt;- stockSymbols()&#xA;symbols &amp;lt;- symbols[,1]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Next we will specify where to to store data &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;dataset&amp;lt;- xts() # Only run once&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following code is the loop that will download OHLC data to your environment. It will then store the Adjusted Close of the downloaded companies and merge them in &lt;code&gt;dataset&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# cool progress bar to see the % of completion&#xA;n &amp;lt;- length(symbols)&#xA;pb &amp;lt;- txtProgressBar(min = 0, max = n, style=3)&#xA;&#xA;&#xA;# Actual loop: &#xA;for(i in 1:length(symbols)) {&#xA;  symbols[i]-&amp;gt; symbol&#xA;# specify the &quot;from&quot; date to desired start date&#xA;  tryit &amp;lt;- try(getSymbols(symbol,from=&quot;2014-01-01&quot;, src='yahoo'))&#xA;  if(inherits(tryit, &quot;try-error&quot;)){&#xA;    i &amp;lt;- i+1&#xA;  } else {&#xA;  # specify the &quot;from&quot; date to desired start date&#xA;  data &amp;lt;- getSymbols(symbol, from=&quot;2014-01-01&quot;, src='yahoo')&#xA;  dataset &amp;lt;- merge(dataset, Ad(get(symbols[i])))&#xA;  rm(symbol)&#xA;  }&#xA;  setTxtProgressBar(pb, i)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If the loop breaks, say on the 50th iteration, then just re run the last block of code by changing the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# cool progress bar to see the % of completion&#xA;n &amp;lt;- length(symbols)&#xA;pb &amp;lt;- txtProgressBar(min = 0, max = n, style=3)&#xA;&#xA;&#xA;# Actual loop: &#xA;# IF IT BREAKS ON THE 50th ITERATION, it must be skipped, therefore change it to 51&#xA;for(i in 51:length(symbols)) { &#xA;  symbols[i]-&amp;gt; symbol&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Keep on doing it until &lt;code&gt;symbols&lt;/code&gt; is exhausted. Remember that it will download all the data unto your environment &amp;amp; that all the Adjusted Close prices are to be found in &lt;code&gt;dataset&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="13428" LastEditorUserId="56" LastEditDate="2015-07-18T12:28:48.320" LastActivityDate="2015-07-18T12:28:48.320" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18836" PostTypeId="1" CreationDate="2015-07-12T06:43:52.163" Score="1" ViewCount="4542" Body="&lt;p&gt;I am using urca package of R for Johansen Cointegration test in 2 stocks datas( A and B.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is very elementar, but have cause some problems for me. How I interpret the critical values, for exemple, &lt;code&gt;H1 &amp;lt;- ca.jo(ll,type = &quot;eigen&quot;, ecdet= &quot;const&quot;, K = 4,spec = &quot;longrun&quot;)&lt;/code&gt; produce:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Values of teststatistic and critical values of test:&#xA;&#xA;      test 10pct  5pct  1pct&#xA;r &amp;lt;= 1 |  6.39  7.52  9.24 12.97&#xA;r = 0  | 11.62 13.75 15.67 20.20&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;1 - In this case, for 10pct I have 11.62 &amp;lt; 13.75, then I can accept the hipotesis that A and B is not co-intregrate  ? (whatever if for r &amp;lt;= 1 test is smaller that critical value ?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2 - If for result in Trace statistic I find that A and B is cointegrate and for eigenvalue test A and B is not ? what does that mean it ? I reject the result of Trace Statistics in this case and admit A and Bnot cointegrate ?&lt;/p&gt;&#xA;" OwnerUserId="16869" LastActivityDate="2016-04-11T20:53:35.100" Title="Interpretation of Johansen cointegration test in R" Tags="&lt;r&gt;&lt;cointegration&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18838" PostTypeId="1" AcceptedAnswerId="18839" CreationDate="2015-07-12T10:45:49.417" Score="1" ViewCount="111" Body="&lt;p&gt;I am having difficulty deciding whether a company's earnings should be modelled normally or lognormally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we consider two arguments:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(i) The earnings of a company are the returns on the assets of the company, therefore we could model them as normally distributed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(ii) However, in some industries, say if the company is a commodity producer, one could argue the earnings should be lognormally distributed (because the commodities are modelled this way)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the most correct way to model this? Say for a commodity producer but also for a non commodity producer (say retail)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I fully understand that earnings can be negative therefore one would naturally assume a normal distribution. However, for a commodity producer the revenue will be dependent on a commodity. In a lognormal simulation there will be paths where revenue less costs is negative (there will be both fixed and variable operating costs). In other words there could be negative earnings paths if revenue is modelled lognormally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit 2: Strictly speaking, I am modelling the revenue of a company with the costs being largely fixed.&lt;/p&gt;&#xA;" OwnerUserId="16756" LastEditorUserId="16756" LastEditDate="2015-07-12T12:38:14.683" LastActivityDate="2015-07-12T12:38:14.683" Title="Should earnings be modelled normally or lognormally?" Tags="&lt;monte-carlo&gt;&lt;simulations&gt;&lt;normal-distribution&gt;&lt;lognormal&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18839" PostTypeId="2" ParentId="18838" CreationDate="2015-07-12T11:50:36.673" Score="1" Body="&lt;p&gt;Well, log-normality does not allow you to have negative earnings and companies do have negative earnings. I suggest you to download the earnings data and perform a Jarque-Bera test for normality. &lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-07-12T11:50:36.673" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18840" PostTypeId="1" CreationDate="2015-07-12T13:08:19.353" Score="2" ViewCount="540" Body="&lt;p&gt;Let's assume the stock moves according to a classic Black-Scholes model, and makes a proportional jump with an unknown proportion. Say, it is either +1% or -3% of the stock value, and we know for sure that no other outcomes are possible. After that we assume the stock to move with the same volatility. Interest rates are zero. Hence, the total return on the stock $\xi$ until expiry $T$ becomes&#xA;$$&#xA;  \xi = \eta_1\sigma\sqrt{t_j} + j + \eta_2\sigma\sqrt{T-t_j}&#xA;$$&#xA;where $t_j$ is the time of the jump, $\eta_i$ are iid standard normal random variables, and $j \in \{0.01, -0.03\}$. If I have market prices for options for the expiry $T$, I can use them to find distribution of $j$. My question is what is the meaning of this distribution, that is - what can I use it for? In particular, is that really what market things are the &lt;em&gt;real&lt;/em&gt; probabilities for the jump? My guess is no, as we'll get the risk-neutral probability of the jump, hence its mean would be zero, even though people may be sure it is 99% possible.&lt;/p&gt;&#xA;" OwnerUserId="464" LastEditorUserId="464" LastEditDate="2015-07-14T13:52:55.087" LastActivityDate="2016-11-07T01:59:34.220" Title="Which distribution do I get?" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;arbitrage&gt;" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18842" PostTypeId="1" CreationDate="2015-07-12T17:18:29.000" Score="2" ViewCount="134" Body="&lt;p&gt;Suppose we do not have a particular pricing model, we have just a frictionless market with constant interest rate (say $0$), and some traded stock $S$ which does not pay dividends. For any expiry $T$ to price options/contingent claims consistently we need a pricing rule, or equivalently a pricing (risk-neutral) probability measure. In particular, to price European call options we only need a marginal of such probability measure being the distribution of $S_T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Standard non-arbitrage arguments imply that the futures price $F(0,T) = \Bbb E^{\Bbb Q}S_T$ must satisfy $F(0,T) = S_T$, otherwise using a static replication strategy we can exploit mispricing in case of inequality. Hence, for the pricing distribution $\Bbb Q$ at least the first moment is fixed externally. What about the rest of the distribution? Say, we only focus on distributions that can be completely recovered from their moments. The first one is fixed, what about others, are we completely free in choosing them given the conditions above?&lt;/p&gt;&#xA;" OwnerUserId="464" LastActivityDate="2015-07-13T10:58:36.690" Title="How free are we in risk-neutral distributions?" Tags="&lt;option-pricing&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18843" PostTypeId="2" ParentId="18842" CreationDate="2015-07-12T22:36:18.737" Score="0" Body="&lt;p&gt;The other moments are not free. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose we are in the standard BS environment with one stock and one bond and a single brownian motion. Suppose we have a derivative that at maturities pays: $V_T=S^2_T$ and we want to price it. Under the martingale measure we know that: $E_t^Q[S_T]=S_t e^{r(T-t)}$ and $Var^Q_t(S_T)=S_t^2e^{2r(T-t)}(e^{\sigma^2(T-t)}-1)$. Using the fact that $Var(X)=E(X^2)-E(X)$ we can pin-down the value of the security $V$ at time $t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this example shows that we are not free to pick other moments. I am not sure whether I fully understood your question though.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-07-12T22:36:18.737" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18845" PostTypeId="1" CreationDate="2015-07-13T03:01:50.540" Score="4" ViewCount="124" Body="&lt;p&gt;I ran into this trying to simulate trading interlisted names between the NYSE and the TSX. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Depending on my strategy parametrization it would sometimes end up with a significant short or long dollar position at both venues. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the end of the day, for each name, I compute a fifo pnl (where I mix the trades between venues by converting with the EOD fx rate) and aggregate it across days but in doing so the open position can blow up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do practitioners/(should I) have to simulate this type of trading in serial fashion across days carrying over the open position per name and using position limits to keep it within bounds? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e. when simulating intraday strategies which don't close flat does one not treat consecutive days independently in practice?&lt;/p&gt;&#xA;" OwnerUserId="16876" LastEditorUserId="2553" LastEditDate="2015-07-13T23:46:06.363" LastActivityDate="2015-07-19T11:51:37.527" Title="How does one simulate intraday strategies which don't end up flat at the close?" Tags="&lt;quant-trading-strategies&gt;&lt;simulations&gt;&lt;performance-evaluation&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18846" PostTypeId="2" ParentId="18842" CreationDate="2015-07-13T05:50:34.247" Score="1" Body="&lt;p&gt;The answer is: yes. We can consider a model that assumes there is only one jump with distribution $p$, and otherwise the stock value does not change. Then for $p$ to be a martingale measure the only condition is on expectation of $p$. Hence, any distribution with desired expectation can be a marginal of some pricing measure.&lt;/p&gt;&#xA;" OwnerUserId="464" LastActivityDate="2015-07-13T05:50:34.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18847" PostTypeId="2" ParentId="18842" CreationDate="2015-07-13T10:58:36.690" Score="0" Body="&lt;p&gt;basically, you have very few constraints. The main other constraint you might consider is that if the real-world probability of lying in a given set is positive, the risk-neutral probability must be too. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So a point mass at the futures price is not valid unless you believe that this is the case in real-world too. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(see chapter 6 of my book &quot;concepts etc&quot; for further discussion.)&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-07-13T10:58:36.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18850" PostTypeId="1" CreationDate="2015-07-13T13:02:28.397" Score="12" ViewCount="1173" Body="&lt;p&gt;Is there a better model than &lt;a href=&quot;https://en.wikipedia.org/wiki/Markov_switching_multifractal&quot;&gt;Markov-Switching Multifractal&lt;/a&gt; (MSM) for detecting regime shifts in FX rates across multiple time horizons? I am especially interested in the different aspects of the question that have been covered in &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0121500136&quot;&gt;Multifractal Volatility: Theory, Forecasting, and Pricing&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Multifrequency Equilibrium&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Ability to detect regime switches across multiple time horizons, from seconds to years, and to &lt;em&gt;&quot;imitate one of the defining features of long memory, a hyperbolic decline of the autocovariogram.&quot;&lt;/em&gt; The combination of long-memory behavior with sudden volatility movements is one of the qualities that make MSM very attractive.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Volatility persistence&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Ability to deal with volatility persistence components that have different degrees of persistence.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Persistence skewness&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;“We observe that investors may learn quickly about volatility increases, because a single extreme fluctuation is highly improbable with low volatility. By contrast, learning about reduced risk takes time because observations near the mean are a relatively likely outcome regardless of the true state. Thus bad news about volatility is incorporated into prices quickly, while good news is assimilated slowly.”&lt;/em&gt; The MSM model takes this skewness into account.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Information quality&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;“Skewness increases and kurtosis falls as information quality deteriorates.”&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Daily seasonality&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;High-frequency data for FX rates show strong patterns of daily seasonality.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Parsimony&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Ability to model the process with very few variables. For example, MSM can model $2^k$ states where $k$ is the number of time horizons with just 4 parameters. This is a direct result of the observation that volatility shocks have the same magnitude at all time scales.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Closed-form parameters estimation&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Ability to estimate parameters by maximixing the closed-form likelihood of the return series. Alternatively, return moments can be used to quickly calibrate or estimate the model.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Discrete and continuous-time versions&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Ability to easily switch between discrete and continuous-time versions of the model.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Good performance&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Ability to provide good forecasts of volatility and generate reliable estimates of the value-at-risk in a position or portfolio of assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0121500136&quot;&gt;Multifractal Volatility&lt;/a&gt; was written in 2008. Have there been more recent developments that should be taken into account? Do significantly-different models provide much better results along the lines outlined above, especially when dealing with real-time data?&lt;/p&gt;&#xA;" OwnerUserId="4634" LastEditorUserId="4634" LastEditDate="2015-07-13T13:13:24.420" LastActivityDate="2015-07-13T13:13:24.420" Title="Markov-Switching Multifractal and FX Rates" Tags="&lt;time-series&gt;&lt;fx&gt;&lt;markov-switching&gt;&lt;fractals&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="18851" PostTypeId="1" CreationDate="2015-07-13T15:09:55.213" Score="7" ViewCount="6729" Body="&lt;p&gt;I have been struggling to understand the logic behind cross currency OIS discounting (where cash flows happen in different currencies than the collateral is paid). I will illustrate my question through example with very much simplified numbers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let’s assume a world where:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;JPY OIS = 10% per day, flat  &#xA;USD OIS = 0% per day, flat  &#xA;USDJPY spot = 100  &#xA;USDJPY Forward for tomorrow = 100  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My counterparty (you) is paying me tomorrow 100 JPY, and we have a “perfect” (daily calls, USD cash only, pays USD OIS interest) CSA. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, all sources I have found (see, for example, &lt;a href=&quot;http://eduriskinternational.com/ConstructingANonUSDSwapDiscountingCurveWithUSDCollateral.pdf&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt;), claim the same about the proper discounting process. We first convert the cash flow with forward rates to CSA currency, &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;100 JPY /100 USDJPYtomorrow = 1 USD    &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then discount with the CSA currency OIS curve:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;1/(1+0.0) = 1 USD&lt;/code&gt; is the value of your 100 JPY tomorrow and that you should pay me as collateral today. Any other valuation would give one of us arbitrage opportunity or cause unfair value transfer to one direction or another. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, for example following discounting is completely wrong:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We discount the JPY cash flow with the  JPY OIS:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;100 JPY / (1+ 0.1) = 90.91&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And convert that at spot to USD:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;90.91 JPY / 100 USDJPY= 0.9091 USD.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, clearly, if you default today, I can sell my 0.9091 USD and buy JPY, invest that at JPY OIS and receive 100 JPY tomorrow. So I should be happy. But every source I have claims that if I take only 0.9091 USD instead of 1 USD as collateral, I will lose (or win?) some money to you. I just do not understand where and how. Could someone describe step by step all transactions in detail that show the wealth transfer/arbitrage opportunity? &lt;/p&gt;&#xA;" OwnerUserId="16880" LastEditorUserId="20454" LastEditDate="2017-10-09T15:47:22.853" LastActivityDate="2017-10-09T15:47:22.853" Title="Why is CSA currency OIS rate used in discounting instead of local currency OIS?" Tags="&lt;swaps&gt;&lt;ois-discounting&gt;&lt;multicurve&gt;&lt;collateral&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18852" PostTypeId="1" CreationDate="2015-07-13T15:18:38.253" Score="1" ViewCount="505" Body="&lt;p&gt;I am looking for a broker that offers a python API for downloading historical intraday data on futures. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far I have only seen Interactive Brokers and Tradestation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there some other brokers that provide a python API to query intraday historical data for futures?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I would like to be able to create a csv which would look like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;7/12/15, 11:15, 52.33&#xA;7/12/15, 11:10, 52.17&#xA;7/12/15, 11:05, 52.35&#xA;7/12/15, 11:00, 52.54&#xA;7/12/15, 10:55, 52.01&#xA;7/12/15, 10:50, 52.03&#xA;7/12/15, 10:45, 51.62&#xA;7/12/15, 10:40, 51.51&#xA;7/12/15, 10:35, 51.18&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;for about 1000 bars. &lt;/p&gt;&#xA;" OwnerUserId="6766" LastActivityDate="2015-11-05T16:37:23.660" Title="Broker or source of intraday futures data for a python API?" Tags="&lt;programming&gt;&lt;futures&gt;&lt;historical-data&gt;&lt;python&gt;&lt;interactive-brokers&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18853" PostTypeId="1" AcceptedAnswerId="18857" CreationDate="2015-07-13T20:34:42.913" Score="1" ViewCount="663" Body="&lt;p&gt;Just a question regarding &quot;convention&quot;: Is the Vega in Heston / Bates model the sensitivity with regards to $\sqrt v_0$ or a term of $\sqrt v_0$ and $\theta$ (Long term variance)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards&lt;/p&gt;&#xA;" OwnerUserId="15166" LastEditorDisplayName="user16891" LastEditDate="2015-07-16T23:28:56.800" LastActivityDate="2015-07-16T23:28:56.800" Title="Vega in Heston / Bates Model" Tags="&lt;heston&gt;&lt;vega&gt;&lt;bates&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18854" PostTypeId="1" CreationDate="2015-07-14T00:54:38.753" Score="5" ViewCount="633" Body="&lt;p&gt;Consider the 2 following approaches to pricing a security:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Monte-carlo ($\mathbb{Q}$-measure)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\begin{equation}&#xA;C = \frac{1}{N} \sum_{i=1}^{n} e^{-rT} max(S_i(t) - K, 0)&#xA;\end{equation}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Monte-carlo ($\mathbb{P}$-measure)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\begin{equation}&#xA;C = \frac{1}{N} \sum_{i=1}^{n} D_i max(S_{i}(t) - K, 0)&#xA;\end{equation}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $D_i = \left(\frac{q_i}{p_i}\right) \frac{1}{(1+r)^t}$ is the stochastic discount factor / deflator / pricing kernel under scenario $i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, I assume that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;ln(S_t/S_0) &amp;amp;\sim N(r - 0.5\sigma^2, \sigma\sqrt{T}) \mbox{ under the $\mathbb{Q}$ measure} \\&#xA;ln(S_t / S_0) &amp;amp;\sim N(\alpha - 0.5\sigma^2, \sigma\sqrt{T}) \mbox{ under the $\mathbb{P}$ measure}&#xA;\end{align}&#xA;I am wondering how to calculate $q_i$ and $p_i$. Then I would like to compare $C$ under the Black-Scholes, Monte-carlo $\mathbb{Q}$ measure and Monte-carlo $\mathbb{P}$ measure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I expect that $C_{BS}(S=100, \ K=100, \ \sigma=0.25, \ r=0.03,\  T=1) = 11.35$ is close to $C_{MC, \mathbb{Q}} \ (N=10,000)$ and $C_{MC, \mathbb{P}} \ (N=10,000)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use the standard Monte-Carlo technique - i.e. I simulate values of $S(1)$ by taking a random draw from a normal distribution and converting this to the appropriate lognormal distribution.&lt;/p&gt;&#xA;" OwnerUserId="16710" LastEditorUserId="16710" LastEditDate="2015-07-14T02:54:03.673" LastActivityDate="2015-08-13T09:05:10.703" Title="Real world monte-carlo (P-measure)" Tags="&lt;option-pricing&gt;&lt;risk-neutral-measure&gt;&lt;stochastic-discount&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18856" PostTypeId="2" ParentId="18854" CreationDate="2015-07-14T02:53:07.480" Score="1" Body="&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think I figured it out. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under the $\mathbb{Q}$ measure,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\begin{equation}&#xA;S_t \sim LN(ln(S_0) + r - 0.5\sigma^2, \ \sigma\sqrt{t})&#xA;\end{equation}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under the $\mathbb{P}$ measure&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\begin{equation}&#xA;S_t \sim LN(ln(S_0) + \alpha - 0.5\sigma^2, \ \sigma\sqrt{t})&#xA;\end{equation}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose we simulate the following stock prices&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Si = 96.33, 69.04, 115.19&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The corresponding probabilities of observing these prices under the $\mathbb{Q}$ measure are&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;qi = 0.0164, 0.00777, 0.0118&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The corresponding probabilities of observing these prices under the $\mathbb{P}$ measure are&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pi = 0.01615, 0.006879, 0.01228&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The stochastic discount factors are $\left( \frac{q_i}{p_i} \right) e^{-r}$&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; Di = 0.9848683 1.0956499 0.9301017&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We can then compute the Monte-carlo price of the option under the $\mathbb{P}$ measure using &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\begin{equation}&#xA;\dfrac{1}{3} \sum_{i=1}^{3} max(0, S_i - K) D_i&#xA;\end{equation}$&lt;/p&gt;&#xA;" OwnerUserId="16710" LastActivityDate="2015-07-14T02:53:07.480" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="18857" PostTypeId="2" ParentId="18853" CreationDate="2015-07-14T08:33:06.200" Score="4" Body="&lt;p&gt;Since $v_0$ and $\theta$ are responsible for the initial and long-term level of the variance,&lt;a href=&quot;http://www.springer.com/gp/book/9783642018077&quot; rel=&quot;nofollow&quot;&gt;Zhu (2010)&lt;/a&gt; recommends basing vega on those two parameters. Both parameters represent variance, so to create measures of sensitivity to volatility, Zhu (2010) defines two vegas, one based on $\upsilon=\sqrt v_0$ and the other based on $\omega=\sqrt \theta$ for the call are, therefore, the derivatives&#xA;\begin{align}&#xA;\vartheta_1=\frac{\partial C}{\partial\upsilon}=\frac{\partial C}{\partial v_0}2\sqrt v_0&#xA;\end{align}&#xA;and&#xA;\begin{align}&#xA;\vartheta_2=\frac{\partial C}{\partial\omega}=\frac{\partial C}{\partial \theta}2\sqrt \theta&#xA;\end{align}&#xA;The first vega is&#xA;\begin{align}&#xA;\vartheta_1=S\,e^{-q\tau}\frac{\partial P_1}{\partial v_0}2\sqrt{v_0}-K\,e^{-r\tau}\frac{\partial P_2}{\partial v_0}2\sqrt{v_0}&#xA;\end{align}&#xA;where, for $j=1,2$&#xA;\begin{align}&#xA;P_j=\frac{1}{\pi}\int_{0}^{\infty}Re\left[\frac{e^{-i\phi\ln K}f_j(x_t,v_t,t;\phi)D_j(\tau;\phi)}{i\phi}\right]d\phi&#xA;\end{align}&#xA;such that $x_t=\ln S_t$ and&#xA;\begin{align}&#xA;&amp;amp;\\&#xA;&amp;amp;f_j(x_t,v_t,t;\phi)=exp[C_j(\tau;\phi)+D_j(\tau;\phi)v_t+i\phi x_t]\\&#xA;&amp;amp;\\&#xA;&amp;amp;D_j(\tau;\phi)=\frac{b_j-\rho\sigma i\phi+d_j}{\sigma^2}\left(\frac{1-e^{d_j\tau}}{1-g_j e^{d_j\tau}}\right)\\&#xA;&amp;amp;\\&#xA;&amp;amp;C_j(\tau;\phi)=r i\phi\tau+\frac{\kappa\theta}{\sigma^2}\left[(b_j-\rho\sigma i\phi+d_j)\left(\frac{1-g_{j}\,e^{d_j\tau}}{1- g_j}\right)\right]\\&#xA;\end{align}&#xA;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;&amp;amp;d_j=\sqrt{(\rho\sigma i\phi-b_j)^2-\sigma^2(2\,u_{j}\,i\phi-\phi^2)}\\&#xA;&amp;amp;g_j=\frac{b_j-\rho\sigma i\phi+d_j}{b_j-\rho\sigma i\phi-d_j}\\&#xA;&amp;amp;b_1=\kappa+\lambda-\rho\sigma,b_2=\kappa+\lambda,u_1=-\frac{1}{2},u_2=\frac{1}{2}&#xA;\end{align}&#xA;for more details look at &lt;a href=&quot;http://elis.sigmath.es.osaka-u.ac.jp/research/Heston-original.pdf&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastEditorDisplayName="user16891" LastEditDate="2015-07-14T08:57:12.697" LastActivityDate="2015-07-14T08:57:12.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18858" PostTypeId="1" CreationDate="2015-07-14T10:12:14.653" Score="2" ViewCount="50" Body="&lt;p&gt;I was looking for a book that could explain me well the Generalized Method of Moments, its mathematical nuances, and even have a look to the empirical side, maybe with some guided exercises with Stata or another software package. &#xA;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="16045" LastEditorUserId="848" LastEditDate="2015-07-14T10:41:50.460" LastActivityDate="2015-07-14T10:41:50.460" Title="Texts on the Generalized Method of Moments" Tags="&lt;reference-request&gt;&lt;parameter-estimation&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18859" PostTypeId="2" ParentId="18261" CreationDate="2015-07-14T12:28:39.853" Score="2" Body="&lt;p&gt;EONIA swaps stopped trading some time in 2014. Since it stopped trading, it does not make sense to remember when it stopped trading :).&lt;/p&gt;&#xA;" OwnerUserId="16896" LastActivityDate="2015-07-14T12:28:39.853" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18860" PostTypeId="1" AcceptedAnswerId="18877" CreationDate="2015-07-14T14:15:01.143" Score="3" ViewCount="593" Body="&lt;p&gt;I have recently come across this paper by Battalio et al. &quot;Can Brokers Have it all? On the Relation between Make Take Fees &amp;amp; Limit Order Execution Quality&quot; and realized how little I know about the &quot;plumbing&quot; connecting the exchanges (I'm taking about US equities.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After reading this paper I have been thinking about what kind of delay/latency is there when trading simultaneously on several exchanges. Assuming that I have already decided the Limit Order sizes and the target venues I want to send them to, and assuming that I send the Limit Orders to the various exchanges at the same time, what kind of delay can I expect in the time-stamp of the &quot;Limit Order Submission&quot; message reported in the data-feed of the various exchanges? I assume that it depends from what kind of connection I have to the exchange, from the time of day, from the type of stock and so forth but I'm still curious about a range of possible values.&lt;/p&gt;&#xA;" OwnerUserId="11874" LastActivityDate="2015-07-15T18:07:03.253" Title="Latency and Delays across Exchanges" Tags="&lt;equities&gt;&lt;market-data&gt;&lt;market-microstructure&gt;&lt;limit-order-book&gt;&lt;latency&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18862" PostTypeId="2" ParentId="18860" CreationDate="2015-07-14T21:43:52.007" Score="0" Body="&lt;p&gt;Assuming you are not doing HFT, seconds scale, then you could measure it. By placing a limit order and then monitoring its appearance in Level 2 market depth quotes. During quiet market, with limit price away from spread and not crowded.&lt;/p&gt;&#xA;" OwnerUserId="2297" LastActivityDate="2015-07-14T21:43:52.007" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18863" PostTypeId="2" ParentId="18860" CreationDate="2015-07-15T00:59:36.387" Score="0" Body="&lt;p&gt;I'm no expert in this topic, but I'm not sure people will be willing to share this kind of data openly, given a lot of HFT shops use such &quot;trade secrets&quot; to gain a competitive edge. Incidentally, I've been reading the book &quot;Flash Boys&quot; and there are some numbers related to your query in there. For instance, when you submit a trade from downtown Manhattan, it reaches BATS first, before going elsewhere...&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2015-07-15T00:59:36.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18866" PostTypeId="1" AcceptedAnswerId="18873" CreationDate="2015-07-15T08:25:54.733" Score="2" ViewCount="2060" Body="&lt;p&gt;It seems to be a foolish question but I can't take my mind off from , Is it true that there is no analytic formula for the value of an American put option on a non-dividend-paying stock (or a divident paying stock either) has been produced ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your helping in advanced.&lt;/p&gt;&#xA;" OwnerUserId="13370" LastActivityDate="2015-07-15T10:42:06.173" Title="analytic formula for the value of an American put option" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;option-strategies&gt;&lt;american-options&gt;" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18867" PostTypeId="2" ParentId="18840" CreationDate="2015-07-15T08:29:58.360" Score="1" Body="&lt;p&gt;First your equation for returns is false. Forgetting about the jump, it does not reduce to Gbm returns. The variance term from Ito's formula is missing. In the case of a jump, a similar term should appear. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly, the distribution is obviously not &quot;what market things are the real probabilities&quot;: you chose to impose specific sizes for the jump, the market did not. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally you cannot expect to imply real world probabilities from option prices since the latter do not depend on the drift.&lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2015-07-15T17:48:43.990" LastActivityDate="2015-07-15T17:48:43.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18868" PostTypeId="1" AcceptedAnswerId="18869" CreationDate="2015-07-15T08:35:49.793" Score="1" ViewCount="166" Body="&lt;p&gt;I am looking at plots of the Security Market (SML) line and Capital market line (CML). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The X axis is the beta for the SML and Standard deviation for CML; the y axis is labeled with excess return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Normally it would be expected return. The CML ans SML both have an Inteercept (y axis) at 0%. The intercept should normally be at the risk-free rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the Intercept at 0% and not at the risk free rate because the y axis is plotting the EXCESS returns?&lt;/p&gt;&#xA;" OwnerUserId="16740" LastEditorUserId="2553" LastEditDate="2015-07-15T09:14:35.690" LastActivityDate="2015-07-15T09:14:35.690" Title="Intrepreting the Capital Market Line plot" Tags="&lt;asset-pricing&gt;&lt;capm&gt;&lt;return&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18869" PostTypeId="2" ParentId="18868" CreationDate="2015-07-15T09:09:41.840" Score="0" Body="&lt;p&gt;Yes. If on the y axis you have excess returns, then the intercept of the line is zero. This are the implications of the CAPM model. E.g. for the SML: $E[R_i,t^e]=\beta \lambda_t$, where $R_i,t^e$ is the excess return on stock $i$ at time $t$ and $\lambda$ is the market price of risk.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-07-15T09:09:41.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18870" PostTypeId="2" ParentId="18866" CreationDate="2015-07-15T09:13:04.400" Score="1" Body="&lt;p&gt;Yes, there is none. Quoting Higham (2004):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;The mathematical problem defined by (...) is much more difficult than&#xA;the Black–Scholes PDE that arose without the early exercise facility. In general,&#xA;there is no closed form expression for $P^{Am}(S, t$) and we must use numerical methods to obtain approximate values.&quot; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where (...) refers to the American Option PDE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please check chapter 18 of &lt;a href=&quot;http://stocksfirst.com/books/trading-econ-investing/An%20Introduction%20to%20Financial%20Option%20Valuation%20-%20Mathematics,%20Stochastics%20and%20Computation%20-%20Higham%202004.pdf&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; book.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="16472" LastEditDate="2015-07-15T10:19:12.757" LastActivityDate="2015-07-15T10:19:12.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18871" PostTypeId="2" ParentId="18866" CreationDate="2015-07-15T09:39:34.497" Score="1" Body="&lt;p&gt;it all comes down to how you define analytic. If you push the definition far enough there are some. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An exact and explicit solution for the valuation of American put options&#xA;DOI:10.1080/14697680600699811&#xA;Song-Ping Zhu&#xA;pages 229-242&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it's an infinite sum of recursively defined double integrals. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-07-15T09:39:34.497" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18872" PostTypeId="2" ParentId="15356" CreationDate="2015-07-15T09:42:28.737" Score="1" Body="&lt;p&gt;&lt;strong&gt;Edit for Gordon.&lt;/strong&gt;&#xA;First, fix point in time $T_0,...,T_n$ whereas $T_1,...,T_n$ are the coupon dates and $T_0$ is interpreted as the emission date of the bond. At time $T_i$, $i = 1,...,n$ the owner of the bond receives $c_i$.At time $T_n$ the owner receives the face value K.We now go on to compute the price of this bond, and it is obvious that the coupon bond can be replicated by holding a portfolio of zero coupon bonds with maturities $T_i$, $i = 1,...,n$.So the price,$P(t)$, at a time $t &amp;lt; T_1$, of the coupon bond is given by&#xA;$$P(t)=KP(t,T_{n})+\sum_{i=1}^{n}c_i P(t,T_{i})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the coupon rate $r_i$ is set to the spot &lt;strong&gt;LIBOR&lt;/strong&gt; rate $L(T_{i−1}, T_i)$ ,then&#xA;\begin{align}&#xA;c_i=(T_i-T_{i−1})L(T_{i−1}, T_i)K&#xA;\end{align}&#xA;We now go on to compute the value of this bond at some time $t &amp;lt; T_0$, in the case when the coupon dates are equally spaced, with $T_i−T_{i−1}=\delta$, and to this end we study the individual coupon $c_i$. Without loss of generality we may assume that $K = 1$, and inserting the definition of the LIBOR rate&#xA;\begin{align}&#xA;c_i=\frac{1}{P(T_{i−1}, T_i)}-1&#xA;\end{align}&#xA;The value at $t$, of the term $−1$ , is of course equal to $-P(t, T_i)$ and it remains to compute the value of the term$\frac{1}{P(T_{i−1}, T_i)}$ which is paid out at $T_i$.This is, however, easily done through the following argument.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Buy, at time $t$, one $T_{i−1}$-bond. This will cost $P(t, T_{i−1})$.&lt;/li&gt;&#xA;&lt;li&gt;At time $T_{i−1}$ you will receive the amount $1$.&lt;/li&gt;&#xA;&lt;li&gt;Invest this unit amount in $T_{i−1}$-bond. This will give you exactly &#xA;$\frac{1}{P(T_{i−1}, T_i)}$ bonds.&lt;/li&gt;&#xA;&lt;li&gt;At  $\,T_i$ the bonds will mature, each at the face value $1$. Thus, at time $T_i$, you will obtain the amount $\frac{1}{P(T_{i−1}, T_i)}$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thus the value at $t$, of obtaining  $\frac{1}{P(T_{i−1}, T_i)}$ at $T_i$, is given by $P(t, T_{i-1})$, and the value at t of the coupon&#xA;$c_i$ is $P(t, T_{i−1}) − P(t, T_i)$. then, by summing up all values of $c_i$ and the value of the notional amount (i.e. 1) at $T_n$, &#xA; we have&#xA;$$P(t)=P(t,T_{n})+\sum_{i=1}^{n}P(t,T_{i-1})-P(t,T_{i})=p(t,T_0)$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastEditorDisplayName="user16891" LastEditDate="2015-07-15T18:40:02.363" LastActivityDate="2015-07-15T18:40:02.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18873" PostTypeId="2" ParentId="18866" CreationDate="2015-07-15T10:08:25.280" Score="2" Body="&lt;p&gt;There is no closed formula for American put option. However, there is an analytic solution for perpetual American put option. The only difference is that the maturity of the perpetual American option is infinite.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why that makes such a difference? That's because we can determine the optimal stopping time (and therefore optimal exercise price) if we don't have to worry about maturity. Unfortunately, there is no such solution if the optimal exercise price is a function of maturity. Consider:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/rZwZ3.png&quot; alt=&quot;enter image description here&quot;&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;L is the optimal exercise price. It's a convex function of maturity. Far away from maturity, the price is significantly lower than K because we'd expect a deep in-the-money intrinsic value to compensate giving up the option right early. The price approaches to the strike price as shown in the plot. This function is clearly non-linear.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might need to do approximation. For example, the Barone-Adesi-Whaley quadratic approximation. Google for the paper if you're interested.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2015-07-15T10:08:25.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18874" PostTypeId="2" ParentId="18866" CreationDate="2015-07-15T10:24:33.870" Score="1" Body="&lt;p&gt;In the Black-Scholes Model or Heston Model, the American option satisfies the same PDE, but with different boundaries.For an American call option $C_A(S,\tau )$, we can therefore write&#xA;\begin{align}&#xA;\frac{\partial {{C}_{A}}}{\partial \tau }=+\frac{1}{2}{{\sigma }^{2}}{{S}^{2}}\frac{{{\partial }^{2}}{{C}_{A}}}{\partial {{S}^{2}}}+(r-q)S\frac{\partial {{C}_{A}}}{\partial S}-r{{C}_{A}}&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or(Heston) $C_A(S,v,\tau )$ satisfy&#xA;\begin{align}&#xA;\frac{\partial {{C}_{A}}}{\partial \tau }=\,+\frac{1}{2}v{{S}^{2}}\frac{{{\partial }^{2}}{{C}_{A}}}{\partial {{S}^{2}}}+\rho \sigma \,vS\frac{{{\partial }^{2}}{{C}_{A}}}{\partial S \partial v}+\frac{1}{2}{{\sigma }^{2}}v\frac{{{\partial }^{2}}{{C}_{A}}}{\partial {{v}^{2}}}-rC_A+(r-q)S\frac{\partial {{C}_{A}}}{\partial S}+\kappa (\theta -v)\,\frac{\partial {{C}_{A}}}{\partial v}&#xA;\end{align}&#xA;where $\tau$ is the time until maturity. The PDE holds for $0 ≤ \tau &amp;lt; T$, where $T$ is the maturity calendar time, and for $0 &amp;lt; S ≤ b(v, \tau)$, where $b(v, τ )$ is the early exercise boundary. Essentially, this means that as long as the stock price is within the early exercise boundary, the American call option behaves like its European counterpart and the PDE holds.&#xA;Building on the work of &lt;a href=&quot;https://editorialexpress.com/cgi-bin/conference/download.cgi?db_name=SCE2005&amp;amp;paper_id=77&quot; rel=&quot;nofollow&quot;&gt;Chiarella and Ziogas(2006)&lt;/a&gt;, &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=381220&quot; rel=&quot;nofollow&quot;&gt;Tzavalis, and  Wang(2003)&lt;/a&gt;. approximate the early exercise boundary $b(v,\tau )$ with the log-linear function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;b(v,\tau )=exp(b_0(\tau)+b_1(\tau)v)&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They show the American call is obtained by adding the early exercise premium to the price of the European call&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;C_A=C_E+V&#xA;\end{align}&#xA;where $V$ is the early exercise premium on an American call with strike $K$ and maturity is $\tau$&lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastEditorDisplayName="user16891" LastEditDate="2015-07-15T10:42:06.173" LastActivityDate="2015-07-15T10:42:06.173" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18876" PostTypeId="2" ParentId="18731" CreationDate="2015-07-15T11:58:35.743" Score="11" Body="&lt;p&gt;A public order book gives traders information not only on the current price of a security, but also the volume and structure of the entire supply and demand schedule.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Such information can be used for arbitrage and market manipulation strategies in various ways:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Spoofing: Inserting a large limit order as an apparent buy or sell signal which is canceled any time before it could be executed.&lt;/li&gt;&#xA;&lt;li&gt;Quote stuffing: Inserting a fast sequence of limit or market orders to give market the impression of an upcoming large movement.&lt;/li&gt;&#xA;&lt;li&gt;Closing Fire: Many financial institutions use only closing prices but not intraday prices for their financial models. Hence it is possible rapidly change the closing price just before end of day if the order book is not thick enough, and there can be no further orders after this time.&lt;/li&gt;&#xA;&lt;li&gt;Flashing: highspeed trading algorithms can spot a public order and then trade in advance to &quot;ride&quot; on its market impact. Is known to amplify market crashes from large orders.&lt;/li&gt;&#xA;&lt;li&gt;Latency Arbitrage: uses price differences between exchanges and fastspeed orders to capture deviations from law of one price.&lt;/li&gt;&#xA;&lt;li&gt;Machine Learning: The public orderbook and its flow of orders may be used to extract valuable information on expected price changes.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="16912" LastActivityDate="2015-07-15T11:58:35.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18877" PostTypeId="2" ParentId="18860" CreationDate="2015-07-15T13:38:01.490" Score="6" Body="&lt;p&gt;The round-trip latency from point A to a matching engine at point B can be thought of being comprised of two components:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$RTT_{total,A \rightarrow B} = RTT_{network\_transit,A \rightarrow B} + MPL_{matching\_engine,B}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $RTT$ is the round-trip time and $MPL$ is the message processing latency (how long it takes to receive a message and produce an event). The total round trip time, $RTT_{total}$ would be measured from the moment it leaves your network interface (i.e., excluding whatever internal processing day your software may have) to the moment your network interface receives the message indicating the action has been processed. You might find my other answer regarding latency informative: &lt;a href=&quot;https://quant.stackexchange.com/questions/3446/hft-how-to-define-and-measure-latency/3447#3447&quot;&gt;HFT - How to define and measure latency?&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, with respect to $RTT_{total}$: when communicating with an exchange in an different data center transit latency will almost always dominate. Matching engines are very fast, but moving packets can be relatively slow in comparison. For example, from Carteret (where NASDAQ hosts their matching engines) to Mahwah (where NYSE hosts theirs) is approximately 45 miles (rough measurement from Google Maps). The best case round-trip transit latency is about 500$us$ (approximately 250$us$ one way), but this is not achievable due to frictions related to network transit: (1) fiber doesn't run as the crow flies; (2) switches and routers add latency along the way; and, (3) packets don't travel at the speed of light through fiber (I believe it is about 70% of $c$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, Mahwah and Carteret are the two extreme cases as they are the two data centers furtherest away from each other. The BATS data center is located in Weehawken at NY5. This data center is about at the half-way point between Mahwah and Carteret so you would be looking at a best-case (unachievable) round-trip latency of about 250$us$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Transit latency is also the only component directly under the control of the participant. $MPL_{matching\_engine}$ is largely a constant for all participants (although, not always due to matching engine architecture and loading of order entry gateways). $RTT_{network\_transit}$, on the other hand, can be manipulated by reducing 2 of the 3 frictions above. The revelation made in &quot;Flash Boys&quot; was well known throughout The Street (it seems Brad and the IEX guys were somewhat late to the party): there was a lot of low-hanging fruit in minimizing the impact of the first friction: the path that the fiber takes. By doing this savvy participants can be closer on a relative-basis to other matching engines even if they are located directly next to their competitors in real-space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remember, this discussion is almost exclusively limited to cross-data center messaging. There is very little ability to minimize the impact of $RTT_{network\_transit}$ within a single data center because: (1) the length of fiber interconnects are largely normalized for all cross-connected participants; and, (2) there are very few network elements between participant and matching engine. This means that internal latency to a specific participant is the most important (in other words, faster software).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All that being said, to answer your question specifically is not something many folks will do as latency numbers are held close to the vest. However, the reason for all of the above is to demonstrate to you that you can easily estimate it by simply estimating $RTT_{network\_transit}$. I think you'll find that, for example, $RTT_{total,NASDAQ \rightarrow ARCA}$ is going to be between 600$us$ and 1.5$ms$ assuming that packets travel through fiber at $0.7c$ and then depending on what penalty you want to add for the path of the fiber.&lt;/p&gt;&#xA;" OwnerUserId="1355" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2015-07-15T18:07:03.253" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18878" PostTypeId="1" CreationDate="2015-07-15T13:51:25.910" Score="2" ViewCount="3769" Body="&lt;p&gt;I was going to simulate a geometric brownian motion in matlab, when I recognized that I didnt fully understand the underlying Wiener process. &#xA;Following the instuctions &lt;a href=&quot;http://investexcel.net/geometric-brownian-motion-excel/&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; I am starting from the form:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/Cz7Vm.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where the $dW_t$ denotes the Wiener process. So $E(dW_t)=0$ and $Var(dW_t) = dt$, right? Could I also write $dW_t = W_{dt}$? Becasue I find the latter more intuitively. So I can simulate $dW_t$ by simulating  $X \sim N(0,1)$ and then $dW_t = X\sqrt{dt}$?.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The next step is the discretization of the differential term. So I write:&#xA;$S_{t+dt} = S_t + S_t \mu dt + S_t \sigma X \sqrt{dt}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_{t+dt} = S_t*(1+ \mu dt + \sigma X \sqrt{dt})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_{t+dt} = S_t*(1+ r_{dt})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_{T} = S_0 *(1+r_1)*(1+r_2)*...*(1+r_T)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $r_{dt}$ means the rate after each time-step. $T$ is the ending time.&#xA;So I wrote the following matlab-code. Could some one verify this code please? &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function [x,y]= brown_data(T, dt,sigma, mu, y0)&#xA;x = 0:dt:T;&#xA;y = zeros(size(x));&#xA;dws = normrnd(0,1,1,numel(x)-1);&#xA;tic&#xA;ratesPlus1 = [y0 ,1 + mu*dt + sigma*dws*sqrt(dt) ];&#xA;y = cumprod(ratesPlus1);&#xA;toc&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="16913" LastActivityDate="2015-07-15T14:11:16.070" Title="Geometric Brownian Motion - Why Sqrt(dt)?" Tags="&lt;brownian-motion&gt;&lt;matlab&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ClosedDate="2015-07-15T14:57:27.633" ContentLicense="CC BY-SA 3.0" />
  <row Id="18879" PostTypeId="2" ParentId="18878" CreationDate="2015-07-15T14:11:16.070" Score="1" Body="&lt;p&gt;Your procedure is correct. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, given that the stock follows a GBM it has a closed form solution, which will yield more accurate results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_{t+\Delta t}=S_te^{(\mu-0.5\sigma^2)\Delta t+\sigma \sqrt{\Delta t}X_{t+\Delta t}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a matlab code with the method above:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;clear all&#xA;% GBM stock price&#xA;&#xA;t = 250;&#xA;nsim = 1000;&#xA;&#xA;S = NaN(nsim, t);&#xA;Sminus = NaN(nsim, t);&#xA;&#xA;&#xA;dt = 1/250;&#xA;&#xA;S(:,1) = 100;&#xA;mu = 0.08;&#xA;sigma = 0.2;&#xA;r = 0.08;&#xA;&#xA;epsilon = normrnd(0,1,nsim,t);&#xA;&#xA;% Stock Price Path&#xA;&#xA;for i = 2:250&#xA;    S(:,i) = S(:,i-1).*exp((mu-0.5*sigma^2)*dt+sigma*sqrt(dt).*epsilon(:,i));&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-07-15T14:11:16.070" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18880" PostTypeId="1" CreationDate="2015-07-15T14:24:41.953" Score="-1" ViewCount="38" Body="&lt;p&gt;I am thinking to start investing monthly and i am trying to calculate my investment using excel with a compound interest of 5% monthly plus addition of certain amount.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First month investment is 10000 and from second month onwards i add monthly certain amount (1000/month or 5000/month).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I am getting this weird result (&lt;a href=&quot;http://s000.tinyupload.com/index.php?file_id=41795306762900819822&quot; rel=&quot;nofollow&quot;&gt;spreadsheet attached&lt;/a&gt;) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;if I invest 1000/month (sheet 1) after 3 years I get 3.39 times more  profit comparing to 5000/month (sheet 2) which was just 2.8.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming my calculation are not wrong, is it better to invest only a small amount monthly.&lt;/p&gt;&#xA;" OwnerUserId="16754" LastActivityDate="2015-07-15T14:31:57.873" Title="What is wrong in my investment calculation" Tags="&lt;investing&gt;&lt;investment&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2015-07-15T14:38:22.007" ContentLicense="CC BY-SA 3.0" />
  <row Id="18881" PostTypeId="2" ParentId="18880" CreationDate="2015-07-15T14:31:57.873" Score="1" Body="&lt;p&gt;The problem is the way you compute profit, in which you are not accounting for the timing of cashflows. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you compute NPV's you get a better comparison. Also if you check the IRR, it will be 5% for both investments.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-07-15T14:31:57.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18882" PostTypeId="1" CreationDate="2015-07-15T14:51:32.847" Score="3" ViewCount="515" Body="&lt;p&gt;I am interested in the formula LendingClub provides as their measure of &lt;a href=&quot;https://www.lendingclub.com/public/lendersPerformanceHelpPop.action&quot; rel=&quot;nofollow&quot;&gt;&quot;Net Annualized Return&quot;&lt;/a&gt;: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\big(1 + \frac{\sum_{i=1}^N{((I_i + L_i - S_i - C_i + R_i) / P_i) P_i}}{\sum_{i=1}^N{P_i}}\big)^{12}-1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the variables $I,L,S,C,R,$ and $P$ denote interest, late charges, service charges, charge offs, collections recoveries, and principal remaining, and $i=1...N$ parametrizes months in the portfolio. For example, if we have one loan that matured over Jan 2008 - Jan 2011 and another that matured over Feb 2009 - Feb 2014, $i = 1...N$ would index over all the months from Jan 2008 to Feb 2014. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, I would like to confirm that in the numerator, the $P_i$ are indeed supposed to cancel, and LendingClub is merely trying to illustrate that they are taking a &quot;fraction of principal&quot; explicitly. The variables are all available in the &lt;a href=&quot;http://additionalstatistics.lendingclub.com/&quot; rel=&quot;nofollow&quot;&gt;full historical payment data&lt;/a&gt; (see All payments at the bottom of the link) LendingClub provides. However, I am having some trouble applying the definition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking the conservative estimate and assigning all loans that are Charged Off, Default, Late (31 - 120 days), Late (16 - 30 days), and In Grace Period as defaulted and incorporated into the $C_i$ charge-off term, I still get a 10.9% portfolio-wide NAR. This seems high, since LendingClub advertises historical returns of ~6%. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It should be noted that LendingClub does not provide this information on an installment-by-installment basis except principal remaining, $P_i$, so I simply took total interest received, late fees received, etc. over the lifetime of the loan. I believe this substitution is acceptable because the sum ranges over all non-censored installments, so after collapsing sums it should produce the same result regardless of whether the loan yet reached maturity.&lt;/p&gt;&#xA;" OwnerUserId="16917" LastActivityDate="2015-07-15T14:51:32.847" Title="Calculating Net Annualized Return on LendingClub historical data" Tags="&lt;fixed-income&gt;&lt;portfolio-optimization&gt;&lt;return&gt;&lt;annualized&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18884" PostTypeId="2" ParentId="18568" CreationDate="2015-07-15T15:22:35.047" Score="3" Body="&lt;p&gt;Here is a pure Java library with Matlab examples for getting daily and minute aggregated bars. It is based on IB Java API. I wrapped it to have a simple interface: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.spreadvectors.com/wisentgenus#code&quot; rel=&quot;nofollow&quot;&gt;http://www.spreadvectors.com/wisentgenus#code&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;br&gt;&#xA;IB has limitations when requesting historical data:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Making identical historical data requests within 15 seconds.&lt;/li&gt;&#xA;&lt;li&gt;Making six or more historical data requests for the same Contract, Exchange and Tick Type within two seconds.&lt;/li&gt;&#xA;&lt;li&gt;Do not make more than 60 historical data requests in any ten-minute period.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2297" LastActivityDate="2015-07-15T15:22:35.047" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18885" PostTypeId="1" CreationDate="2015-07-15T17:22:15.460" Score="4" ViewCount="661" Body="&lt;p&gt;I've built a simplistic Excel monte carlo model to price a zero-coupon bond, but it came up with a slightly unepxected result so I wanted to confirm whether my maths is just a little rusty or my model is wrong. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose we have a 40 year ZCB with a price $P_t$ that equates to a flat discount rate of $z_t$ at time $t$; i.e. the price $P_t = \exp(-(40 - t) \cdot z_t)$, and let's say $z_0 = 2\%$ in this case . (This is obviously different from the usual zero coupon bond vs rate pricing formula,  $P_t = \mathbb{E}[\exp(-\int_t  r_t)]$, as it refers to a single &quot;average&quot; rate over the remaining life of the bond)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The monte carlo starts with this spread $z_0$, which evolves randomly after each period with no drift, according to $z_{t+\Delta t} = z_t + (\sigma \cdot \sqrt{\Delta t} \cdot \omega)$ where $\sigma$ is a vol parameter and $\omega \sim \text{N}(0,1)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;At year 30, I look at the simulated value of $z_{30}$, and then infer the price of the bond as $P_{30} = \exp (-(40 - 30) \cdot z_{30})$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having run this simulation for a number of Monte Carlo runs, I took the average spread $z_t$ at $t = 30$, which was unsurprisingly equal to $2\% = z_0$, and the average price $P_{30}$ across all of these runs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was expecting that this average price would be approximately $\exp (-(40 - 30) \cdot z_{0}) = \exp(-10 \cdot 2\%)) = \exp (-(40 - 30) \cdot \mathbb{E}(z_{30}))$ but in fact the value was consistently higher than . &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To some extent I can justify this to myself; the bond price is convex, so in absolute terms you'll see bigger absolute positive gains than negative losses when the spread moves tighter or wider by the same $\%$ amount (assuming the avg spread is still centered around $z_0 = 2\%$). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But on the other hand, this means your expected bond price in the monte carlo is a function of volatility: $\sigma = 0$ gives you $z_{30} = z_0$ in all cases and therefore a lower expected price than for some $\sigma &amp;gt; 0 $. I wouldn't intuitively expect that the expected bond price over time is dependent on vol even with zero drift; it's not an option-type payoff after all, and I've never previously seen bond prices contemplated as a function of vol. Discussions such as &lt;a href=&quot;http://www.wilmott.com/messageview.cfm?catid=8&amp;amp;threadid=40244&quot; rel=&quot;nofollow noreferrer&quot;&gt;this one&lt;/a&gt; make me think that the $+\sigma^2/2$ lognormal expectation effect, skewing gains over losses, should be offset by $-\sigma^2/2$ term in the expected Brownian motion path (though admittedly this is a slightly different security from the one in that link), but my model appears to suggest otherwise. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I missing here? Is my model wrong, am I trying to reconcile 2 fundamentally different quantities or should the expected bond price with nonzero vol genuinely be higher than the bond price discounted at the expected spread?&lt;/p&gt;&#xA;" OwnerUserId="16920" LastActivityDate="2017-10-26T20:07:25.887" Title="Monte Carlo, convexity and Risk-Neutral ZCB Pricing" Tags="&lt;volatility&gt;&lt;interest-rates&gt;&lt;monte-carlo&gt;&lt;brownian-motion&gt;&lt;simulations&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18886" PostTypeId="2" ParentId="15356" CreationDate="2015-07-15T18:44:12.367" Score="3" Body="&lt;p&gt;In another solution, the answer is based on replication approach. Here, we provide some other approaches for the valuation of the LIBOR rate, &#xA;\begin{align}&#xA;L(T_{i-1}; T_{i-1}, T_i) = \frac{1}{\Delta T_i}\left(\frac{1}{P(T_{i-1}, T_i)}-1\right),&#xA;\end{align}&#xA;set a $T_{i-1}$ and paid at $T_i$, where $\Delta T_i =T_i-T_{i-1}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $E$ be the expectation operator under the risk-neutral measure $P$, which has the money market account value process $B_t$ as the numeraire. &#xA;Then the value at time $t$ of the float payment $L(T_{i-1}; T_{i-1}, T_i)\Delta T_i$ made at $T_i$ is given by&#xA;\begin{align*}&#xA;B_t E\left(\frac{L(T_{i-1}; T_{i-1}, T_i)\Delta T_i}{B_{T_i}}\mid\mathcal{F}_t \right) &amp;amp;=&#xA;B_t E\left(\frac{L(T_{i-1}; T_{i-1}, T_i)\Delta T_i}{B_{T_{i-1}}} E\left(\frac{B_{T_{i-1}}}{B_{T_i}} \mid \mathcal{F}_{T_{i-1}}\right)\mid\mathcal{F}_t \right)\\&#xA;&amp;amp;=B_t E\left(\frac{L(T_{i-1}; T_{i-1}, T_i)\Delta T_i}{B_{T_{i-1}}} P(T_{i-1}, T_i)\mid\mathcal{F}_t \right)\\&#xA;&amp;amp;=B_t E\left(\frac{1}{B_{T_{i-1}}} \Big[1 - P(T_{i-1}, T_i)\Big]\mid\mathcal{F}_t \right)\\&#xA;&amp;amp;= B_t E\left(\frac{1}{B_{T_{i-1}}}\mid\mathcal{F}_t \right) - B_t E\left(\frac{P(T_{i-1}, T_i)}{B_{T_{i-1}}}\mid\mathcal{F}_t \right)\\&#xA;&amp;amp;=P(t, T_{i-1}) - B_t \times \frac{P(t, T_i)}{B_t}\\&#xA;&amp;amp;= P(t, T_{i-1}) - P(t, T_i).&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, let $E_{T_i}$ be the expectation operator under the $T_i$-forward measure $P_{T_i}$, which has the bond price process $\{P(t, T_i)\mid t \geq 0\}$ as the numeraire. Then the LIBOR rate process $\{L(t; T_{i-1}, T_i) \mid 0\leq t \leq T_{i-1} \}$ is a martingale under $P_{T_i}$. Moreover, for $0 \leq t \leq T_{i-1}$, let&#xA;\begin{align}&#xA;\eta_t &amp;amp;\triangleq \frac{dP}{dP_{T_{i}}}\big|_t\\&#xA;&amp;amp;=\frac{B_t P(0, T_{i})}{P(t, T_i)}.&#xA;\end{align}&#xA;By Bayes formula, for $0 \leq t \leq T_{i-1}$, the value at time $t$ of the float payment $L(T_{i-1}; T_{i-1}, T_i)\Delta T_i$ made at $T_i$ is given by&#xA;\begin{align*}&#xA;B_t E\left(\frac{L(T_{i-1}; T_{i-1}, T_i)\Delta T_i}{B_{T_i}}\mid\mathcal{F}_t \right) &amp;amp;=&#xA;B_t E_{T_i}\left(\frac{\eta_{T_i}}{\eta_t}\frac{L(T_{i-1}; T_{i-1}, T_i)\Delta T_i}{B_{T_i}}\mid\mathcal{F}_t \right)\\&#xA;&amp;amp;=P(t, T_i)E_{T_i}\left(L(T_{i-1}; T_{i-1}, T_i)\Delta T_i\mid\mathcal{F}_t \right)\\&#xA;&amp;amp;=P(t, T_i)L(t; T_{i-1}, T_i) \Delta T_i\\&#xA;&amp;amp;=P(t, T_{i-1}) - P(t, T_i),&#xA;\end{align*}&#xA;from the martingale property of $L$ under the $T_i$-forward measure $P_{T_i}$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-07-15T20:04:11.533" LastActivityDate="2015-07-15T20:04:11.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18888" PostTypeId="1" CreationDate="2015-07-15T22:44:24.977" Score="1" ViewCount="73" Body="&lt;p&gt;I am trying to see if after I trade a stock the price movements at 2, 5, 7, 10, 30 and 60 seconds after exhibit any autocorrelation.  Below I have the returns from my trade price to the trade 2,5,7,10 30 and 60 seconds after my trade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does it make sense to run and acf test in r to see if there is autocorrelation and the box test OR is 6 data points not enough data to run the test?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does it also matter that my returns are not evenly spaced apart?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;r&amp;lt;- c(.2,.3,.3,.5,1,1.1)&#xA;acf(r)&#xA;Box.test(r, lag = 1, type = c(&quot;Box-Pierce&quot;, &quot;Ljung-Box&quot;), fitdf = 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="16923" LastActivityDate="2015-08-15T10:36:41.380" Title="Does it make sense to interpret autocorrelation and box test on 5 data points?" Tags="&lt;time-series&gt;&lt;mean-reversion&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18889" PostTypeId="1" AcceptedAnswerId="18965" CreationDate="2015-07-15T23:07:37.047" Score="3" ViewCount="3279" Body="&lt;p&gt;I am looking at some high frequency data and I would like to know how to interpret and compare Realized volatility (RV) and Two Scale Realized Volatility (TSRV). References below. Given X is the log return of a stock&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;     [X,X]_{T}^{all} =  \sum\limits_{i=1}^{n} (X_{t_{i+1}} - X_{t_{i}})^2 &#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Here subscript all means use all the data. In my case my data is second by second so it would be the sum of the differences of squared log returns 1 second apart.&lt;/p&gt;&#xA;&lt;p&gt;To compute RV in R I have a function that takes prices, takes there log, then differences, squares them and sums them up:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;RV&amp;lt;-function(prices)&#xA;{&#xA;  logprices = log(as.numeric(prices))&#xA;  logreturns = diff(logprices)&#xA;  return(sum(logreturns^2))&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;the Two Scale Realized Volatility (TSRV) partitons the whole sample 1 to n in to K subsamples. In my case K= 300. So there will be a moving window time301-time1, time302 -time 2...and the RV for those windows will be averaged over.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$[X,X]_{T}^{K} = \dfrac 1K\sum\limits_{i=1}^{n-K+1} (X_{t_{i+K}} - X_{t_{i}})^2  $$&lt;/span&gt;&#xA;Then&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \text{TSRV} =  \Big(1- \dfrac zn\Big)^{-1}\Big([X,X]_{T}^{K} - \dfrac zn [X,X]_{T}^{all}\Big)$$&lt;/span&gt;&#xA;where &lt;span class=&quot;math-container&quot;&gt;$z = (n-K+1)/K$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Taking the difference between &lt;span class=&quot;math-container&quot;&gt;$$[X,X]_{T}^{K}$$&lt;/span&gt; and  &lt;span class=&quot;math-container&quot;&gt;$$[X,X]_{T}^{all}$$&lt;/span&gt; cancels the effect of microstructure noise. The factor &lt;span class=&quot;math-container&quot;&gt;$(1-z/n)^{-1}$&lt;/span&gt; is a coefficient to adjust for finite sample bias.&lt;/p&gt;&#xA;&lt;p&gt;In R there is a function to calculate TSRV:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;myTSRV&amp;lt;-function (pdata, K = 300, J = 1) &#xA;{ &#xA;  #pdata contains prices for a stock&#xA;  #K the slow time scale = 300 seconds&#xA;  #J is the fast time scale = 1 second&#xA;  logprices = log(as.numeric(pdata))&#xA;  n = length(logprices)&#xA;  nbarK = (n - K + 1)/(K) &#xA;  nbarJ = (n - J + 1)/(J)&#xA;  adj = (1 - (nbarK/nbarJ))^-1  #adjust for finite sample bias&#xA;  logreturns_K = logreturns_J = c()&#xA;  for (k in 1:K) {&#xA;    sel = seq(k, n, K)&#xA;    logreturns_K = c(logreturns_K, diff(logprices[sel]))&#xA;  }&#xA;  for (j in 1:J) {&#xA;    sel = seq(j, n, J)&#xA;    logreturns_J = c(logreturns_J, diff(logprices[sel]))&#xA;  }&#xA;  TSRV = adj * ((1/K) * sum(logreturns_K^2) - ((nbarK/nbarJ) *  (1/J) * sum(logreturns_J^2)))&#xA;  return(TSRV)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I took tick data for IBM for about &lt;span class=&quot;math-container&quot;&gt;$2$&lt;/span&gt; hours and calculated the RV  and and TSRV with &lt;span class=&quot;math-container&quot;&gt;$K= 300$&lt;/span&gt; seconds and &lt;span class=&quot;math-container&quot;&gt;$J= 1$&lt;/span&gt; second for about &lt;span class=&quot;math-container&quot;&gt;$2$&lt;/span&gt; hours.&lt;/p&gt;&#xA;&lt;p&gt;I have a few questions.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The RV is in the range of .00002 to .00005. How do I interpret this? In the literature RV is also called integrated variance. I want the volatility so do I need to square root these number to get to .0044 to .007?&lt;/li&gt;&#xA;&lt;li&gt;Even if I square root them what does .0044 or .007 mean? The volatility for IBm during those 2 hours was .44% to .7%?&lt;/li&gt;&#xA;&lt;li&gt;Does .0044 and .007 need to be normalized to an annual or daily number somehow? Can you suggest how?&lt;/li&gt;&#xA;&lt;li&gt;How does one compare the RV or TSRV from different length intervals. Let's say I have an RV that is calculated using 2 hours of data. How do I compare it to and RV using 6 hours of data?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;References&lt;/p&gt;&#xA;&lt;p&gt;All of my post  is from: &lt;a href=&quot;https://lirias.kuleuven.be/bitstream/123456789/282532/1/AFI_1048.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://lirias.kuleuven.be/bitstream/123456789/282532/1/AFI_1048.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;original paper for TSRV: &lt;a href=&quot;http://wwwf.imperial.ac.uk/%7Epavl/AitSahalia2005.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://wwwf.imperial.ac.uk/~pavl/AitSahalia2005.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;R code getAnywhere(&amp;quot;TSRV&amp;quot;)&lt;/p&gt;&#xA;" OwnerUserId="16923" LastEditorUserId="6686" LastEditDate="2020-10-23T01:36:02.740" LastActivityDate="2020-10-23T01:36:02.740" Title="How to interpret Realized Volatility and TSRV using R" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;high-frequency&gt;&lt;local-volatility&gt;&lt;high-frequency-estimators&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="18890" PostTypeId="1" AcceptedAnswerId="18892" CreationDate="2015-07-16T01:24:03.957" Score="12" ViewCount="5518" Body="&lt;p&gt;How was this 67% probability calculated from Fed funds futures? &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Fed funds futures show a 67 percent chance the central bank will&#xA;  increase its benchmark rate by year-end from virtually zero, according&#xA;  to data compiled by Bloomberg. The central bank last raised the rate&#xA;  in 2006.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.bloomberg.com/news/articles/2015-07-16/dollar-bulls-accelerate-charge-as-yellen-provides-rates-spur&quot;&gt;http://www.bloomberg.com/news/articles/2015-07-16/dollar-bulls-accelerate-charge-as-yellen-provides-rates-spur&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6190" LastActivityDate="2019-08-02T06:08:50.037" Title="How does one estimate the probability of the Fed increasing its benchmark rate based on Fed funds futures?" Tags="&lt;interest-rates&gt;&lt;futures&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="18891" PostTypeId="1" CreationDate="2015-07-16T05:49:56.917" Score="3" ViewCount="179" Body="&lt;p&gt;I'd like to know, how the integral part of the semi-closed Heston pricing formula for call options can be simulated for a given set of model parameters. Monte Carlo simulations shoud work for this purpose.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be great, if someone could provide an example, where this is computed or can give a paper, where an explicit example is given. Maybe a Matlab code can also be helpful in this case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am refering to equation (18) on page 331 of the paper &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://elis.sigmath.es.osaka-u.ac.jp/research/Heston-original.pdf&quot; rel=&quot;nofollow&quot;&gt;http://elis.sigmath.es.osaka-u.ac.jp/research/Heston-original.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Arjen&lt;/p&gt;&#xA;" OwnerUserId="16924" LastActivityDate="2015-07-16T15:45:29.977" Title="Evaluation of the semi-closed Heston pricing formula for call options" Tags="&lt;monte-carlo&gt;&lt;simulations&gt;&lt;heston&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18892" PostTypeId="2" ParentId="18890" CreationDate="2015-07-16T09:59:22.700" Score="5" Body="&lt;p&gt;I am not sure how that probability was computed. However, the standard approach is to use fed futures to proxy for the &quot;unexpected change&quot; of FED rate. The most prominent reference is &lt;a href=&quot;http://www.jstor.org/stable/3694925?seq=1#page_scan_tab_contents&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bernanke and Kuttner (2005)&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What they do, is to estimate the unexpected FED target rate change by doing:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\Delta i^u = \frac{D}{D-d}(f_{m,d}^0-f_{m,d-1}^0)$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;span class=&quot;math-container&quot;&gt;$f_{m,d}^0$&lt;/span&gt; is the current month future rate and &lt;span class=&quot;math-container&quot;&gt;$D$&lt;/span&gt; is the number of days in the month. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The extension to probability of change is given in &lt;a href=&quot;http://www.arborresearch.com/bianco/samples/SR2v1.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Geraty (2000)&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where he basically estimates the probability &lt;span class=&quot;math-container&quot;&gt;$p$&lt;/span&gt; of change by doing:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$p=\frac{\text{Fed funds rate implied by futures contract} - \text{The current fed funds rate}}{\text{Fed funds rate assuming a rate hike} - \text{The current fed funds rate}}$$&lt;/span&gt;&lt;/p&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="28784" LastEditDate="2019-08-01T09:48:04.980" LastActivityDate="2019-08-01T09:48:04.980" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="18893" PostTypeId="2" ParentId="18888" CreationDate="2015-07-16T10:05:33.350" Score="1" Body="&lt;p&gt;You can do it with 6 data points. However two caveats:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) With returns no evenly spaced apart you need some adjustments. &lt;a href=&quot;https://stats.stackexchange.com/questions/103288/estimating-auto-correlation-with-unequally-spaced-data&quot;&gt;This&lt;/a&gt; topic might help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) With only six data points you will get huge standard deviations, so almost sure your statistics will not be significant and you cannot do anything with them.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2015-07-16T10:05:33.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18894" PostTypeId="2" ParentId="18891" CreationDate="2015-07-16T12:46:07.500" Score="3" Body="&lt;p&gt;I have approximate the integrals by Monte Carlo Method but you can use several method such as Newton-Cotes formulas and Gaussian quadrature.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Function&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/uuk5j.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Example&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/yAAho.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Solutions&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Call =&lt;/p&gt;&#xA;&#xA;&lt;p&gt;34.0976&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put =&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;4.8941&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Parameters were extracted from &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1153950&quot; rel=&quot;nofollow noreferrer&quot;&gt;Jianwei Zhu(2008)&lt;/a&gt;,Page 10,Table 4&lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastEditorDisplayName="user16891" LastEditDate="2015-07-16T13:14:17.277" LastActivityDate="2015-07-16T13:14:17.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18895" PostTypeId="1" CreationDate="2015-07-16T14:55:20.133" Score="-3" ViewCount="120" Body="&lt;p&gt;Is it possible to get a calculation of IV from the volatility on components of the options chain?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EG I have this data:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+--------+-----------------+---------+------------+--------+&#xA;| symbol | underlyingPrice | ivMean  | Expiration | strike |&#xA;+--------+-----------------+---------+------------+--------+&#xA;| aapl   | 141.4           | 13.83   | Aug2015    | 140    |&#xA;| aapl   | 141.4           | 13.43   | Aug2015    | 142.5  |&#xA;| aapl   | 141.4           | 13.12   | Aug2015    | 145    |&#xA;+--------+-----------------+---------+------------+--------+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can I reach a conclusion about the 30-day IV of this underlying without doing the whole VIX-style calculation?&lt;/p&gt;&#xA;" OwnerUserId="16929" LastActivityDate="2015-07-16T15:58:57.067" Title="Approximating the IV of an underlying from Individual Options IV" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18896" PostTypeId="2" ParentId="18890" CreationDate="2015-07-16T15:02:15.140" Score="11" Body="&lt;p&gt;There is actually a lot of art involved. The most simplistic framework is as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first step is to obtain a list of FOMC meeting dates. These are available currently for 2015 and 2016 &lt;a href=&quot;http://www.federalreserve.gov/monetarypolicy/fomccalendars.htm&quot;&gt;here&lt;/a&gt;. If you're interested for rate expectations beyond 2016, you'd need to &quot;guess&quot; the meeting dates in the future based on past patterns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The next step is to calculate the implied target rate coming out of each meeting. This is best explained with an example. Let's assume that the current Fed funds target rate is 0.125% (it's actually a range of 0%-0.25%) and that the next FOMC meeting is on September 17th, 2015 (actually July, but let's stay simple). The September 2015 Fed Funds future price is 99.835, implying a rate of $100-99.835 = 0.165\%$. Recall that Fed funds futures price is based on the arithmetic average of the daily Fed Funds effective rate, so we must have&#xA;$$ 0.165\% = \frac{0.125\% \times 17 + r \times 13}{30},$$&#xA;where $r$ is the target rate coming out of the September meeting. (The first 17 days are based on rate coming out of the previous meeting, and the remaining 13 days based on the rate after the September meeting.) This gets us $r = 0.217307692\%$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, we can compute the probability of a rate hike. The assumption we'll use is that the Fed will either raise rate by 25bp or keep it unchanged. Assuming the probability of a 25bp hike is $p$, then we must have&#xA;$$0.217307692\% = p\times 0.375\% + (1-p) \times 0.125\%.$$&#xA;(probability-weighted average of keeping rates at 0.125% or raising rates 25bp to 0.375%). This allows you to solve for $p$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The example above is a gross simplification. More sophisticated models would adjust for term premium (since observed interest rate is not equal to rate expectations), allow for more scenarios coming out of each meeting, etc. If you're interested in longer-dated rate expectations, Eurodollar futures must be used as well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are some useful references:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.cmegroup.com/trading/interest-rates/fed-funds.html?utm_source=direct&amp;amp;utm_medium=print&amp;amp;utm_campaign=CTA-Intelligence-advert&quot;&gt;CME's FedWatch tool&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.federalreserve.gov/pubs/feds/2002/200256/200256pap.pdf&quot;&gt;Extracting the Expected Path of Monetary Policy from Futures Rates&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;There's an old Lehman Brothers report talking about their Fediscope that's really good.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2015-07-16T18:58:28.337" LastActivityDate="2015-07-16T18:58:28.337" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18898" PostTypeId="2" ParentId="18895" CreationDate="2015-07-16T15:58:40.460" Score="2" Body="&lt;p&gt;This is a somewhat ill-posed question. The &quot;components&quot; in your question are not components, they are just different options and all have different implied volatilities - all for the same underlying. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are looking to get single number volatility a-la VIX without the whole VIX calculation, you should use ATM (at-the-money) implied volatility, which is implied volatility of options closest to the underlying price.&lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2015-07-16T15:58:40.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18899" PostTypeId="2" ParentId="18895" CreationDate="2015-07-16T15:58:57.067" Score="1" Body="&lt;p&gt;If you want a quick back of the envelop number, just use the IV of the nearest ATM option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still the best would be to get the IV which is quite simple. However, three data points are definitely not enough to do this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a matlab code that allows you to do it (credits to: volopta.com):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% Variance swap calculation using the replication algorithm of&#xA;% Demeterfi, Derman, Kamal, and Zou (1999).&#xA;% Example using SPX options on 2/28/2011. Linear interpolation of implied&#xA;% volatility to create a continuum of IV along a fine grid.&#xA;% This example ignores dividends on the S&amp;amp;P 500.&#xA;% By Fabrice Douglas Rouah&#xA;&#xA;clc; clear;&#xA;&#xA;% Select the maturity (t = 1 through 9).&#xA;t = 5;&#xA;&#xA;% Auxiliary Function&#xA;f = @(S, Sb, T) 2/T*((S - Sb) / Sb - log(S/Sb));&#xA;&#xA;% Input the SPX spot price on 2/28/2011 and define the cutoff&#xA;S  = 1327.22;&#xA;Sb = S;&#xA;&#xA;% Input the implied volatility surface for SPX on 2/28/2011&#xA;IV = [ ...&#xA;0.66249 0.46257 0.35304 0.24611 0.14728 0.10517 0.10375 0.10375 0.10375 0.10375;...&#xA;0.48812 0.35515 0.28751 0.22307 0.16360 0.12388 0.11477 0.11477 0.11477 0.11477;...&#xA;0.41881 0.31711 0.26753 0.22104 0.17847 0.14578 0.12511 0.12266 0.12266 0.12266;...&#xA;0.38830 0.30064 0.25893 0.22012 0.18468 0.15602 0.13465 0.12496 0.12491 0.12491;...&#xA;0.37170 0.29163 0.25422 0.21965 0.18821 0.16231 0.14205 0.12896 0.12559 0.12555;...&#xA;0.32688 0.27052 0.24523 0.22215 0.20128 0.18354 0.16873 0.15639 0.14591 0.13695;...&#xA;0.31740 0.27327 0.25354 0.23552 0.21915 0.20442 0.19115 0.17915 0.16815 0.15797;...&#xA;0.32155 0.28460 0.26801 0.25280 0.23892 0.22632 0.21485 0.20440 0.19474 0.18575;...&#xA;0.33407 0.30398 0.29032 0.27771 0.26612 0.25551 0.24580 0.23693 0.22870 0.22103];&#xA;&#xA;% Input the strikes (ATM is column 5)&#xA;Strike = [0.5 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5].*S;&#xA;&#xA;%% Input the maturities and the date for 2/28/2011&#xA;Today = '02/28/11';&#xA;Mat  = {'03/28/11'; '05/31/11'; '08/29/11'; '11/28/11'; '02/28/12'; '02/28/14'; '02/29/16'; '02/28/18'; '03/01/21'};&#xA;Time = (datenum(Mat) - datenum(Today))/365;&#xA;&#xA;% Input the discount factors based on the 2/28/2011 yield curve&#xA;Dates = {...&#xA;'03/03/11'; '03/05/11'; '03/09/11'; '03/16/11'; '03/23/11'; '04/02/11'; '05/02/11'; ...&#xA;'06/02/11'; '06/16/11'; '09/15/11'; '12/21/11'; '03/21/12'; '06/21/12'; '09/20/12'; ...&#xA;'12/19/12'; '03/19/13'; '06/20/13'; '09/19/13'; '12/18/13'; '03/18/14'; '03/02/15'; ...&#xA;'03/01/16'; '03/01/17'; '03/01/18'; '03/01/19'; '03/02/20'; '03/01/21'; '03/01/22'; ...&#xA;'03/01/23'; '03/02/26'; '03/03/31'; '03/03/36'; '03/01/41'; '03/01/51'; '03/01/61'};&#xA;&#xA;Years = (datenum(Dates) - datenum(Today))/365;&#xA;&#xA;DF = [...&#xA;0.99998500014869800 0.99997500044912600 0.99995111308640100 0.99991222912297800 0.99987334818351100 ...&#xA;0.99979198571696100 0.99954964292588800 0.99923668663870500 0.99910794722545700 0.99818605657608200 ...&#xA;0.99697717643439500 0.99544225977217400 0.99323396957980800 0.99017081381990600 0.98625297354899800 ...&#xA;0.98154157399382700 0.97598196677327000 0.96990691843316500 0.96333781311287600 0.95622588310726600 ...&#xA;0.92563237401242000 0.88771864100926600 0.84756561049366600 0.80726790504638900 0.76781566721062900 ...&#xA;0.72959238518582100 0.69284469670556100 0.65686678080626400 0.62404851186287800 0.53360097103237400 ...&#xA;0.41623864372750800 0.32729883450264000 0.25866419647973800 0.16729143399603000 0.12188702483655400];&#xA;&#xA;% Extract the interest rate for the selected maturity&#xA;T  = Time(t);&#xA;df = interp1(Years,DF,T);&#xA;r  = -log(df)/T;;&#xA;&#xA;%% Select and interpolate the strikes and implied volatilies&#xA;% Select the implied volatility for OTM calls and puts&#xA;CallV = IV(t,5:10);&#xA;PutV  = IV(t,1:5);&#xA;&#xA;% Select OTM strikes for calls, create fine grid, and interpolate the IV&#xA;CallK = Strike(5:10);&#xA;CallKI = [CallK(1)+0.1:0.1:CallK(end)];&#xA;CallVI = interp1(CallK,CallV,CallKI,'linear');&#xA;&#xA;% Select OTM strikes for puts, create fine grid, and interpolate the IV&#xA;PutK = Strike(1:5);&#xA;PutKI = [PutK(1):0.1:PutK(end)-0.1];&#xA;PutVI = interp1(PutK,PutV,PutKI,'linear');&#xA;&#xA;%% Do the required calculations on calls.  &#xA;% Rename CallK and CallV for convenience.&#xA;n = length(CallVI);&#xA;K = CallKI;&#xA;V = CallVI;&#xA;&#xA;for i=1:n-1&#xA;    Temp(i) = (f(K(i+1), Sb, T) - f(K(i), Sb, T)) / (K(i+1) - K(i));&#xA;    if i==1 &#xA;        CallWeight(1) = Temp(1);&#xA;    end&#xA;    CallValue(i) = BSPrice(S, K(i), r, T, V(i), 'Call');&#xA;    if i&amp;gt;1&#xA;        CallWeight(i) = Temp(i) - Temp(i-1);&#xA;    end;&#xA;    CallContrib(i) = CallValue(i)*CallWeight(i);&#xA;end&#xA;Pi1 = sum(CallContrib);&#xA;&#xA;%% Do the calculations on puts. Flip the Vectors for Convenience&#xA;n = length(PutVI);&#xA;K = fliplr(PutKI);&#xA;V = fliplr(PutVI);&#xA;&#xA;for i=1:n-1&#xA;    Temp2(i) = (f(K(i+1), Sb, T) - f(K(i), Sb, T)) / (K(i) - K(i+1));&#xA;    if i==1&#xA;        PutWeight(1) = Temp2(1);&#xA;    end;&#xA;    PutValue(i) = BSPrice(S, K(i), r, T, V(i), 'Put');&#xA;    if i&amp;gt;1&#xA;        PutWeight(i) = Temp2(i) - Temp2(i-1);&#xA;    end&#xA;    PutContrib(i) = PutValue(i) * PutWeight(i);&#xA;end&#xA;Pi2 = sum(PutContrib);&#xA;&#xA;% Total cost of the portfolio&#xA;Pi_CP = Pi1 + Pi2;&#xA;&#xA;%% Results of the replication&#xA;% Estimate of fair variance&#xA;Kvar = 2/T*(r*T - (S/Sb*exp(r*T) - 1) - log(Sb/S)) + exp(r*T)*Pi_CP;&#xA;&#xA;% Estimate of fair volatility&#xA;Kvol = sqrt(Kvar)*100;&#xA;&#xA;% Estimates from Numerix&#xA;Numerix = [...&#xA;17.4346541536 19.5067089310 20.9119726457 21.3518611465 21.7475857520 ...&#xA;21.6785038366 21.4961533188 21.4257801140 20.8642345295];&#xA;&#xA;disp(char('For maturity on '))&#xA;disp(Mat(t))&#xA;disp(char('Matlab fair volatility'))&#xA;disp(Kvol)&#xA;disp(char('Numerix fair volatility'))&#xA;disp(Numerix(t))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-07-16T15:58:57.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18900" PostTypeId="2" ParentId="17657" CreationDate="2015-07-16T17:20:33.150" Score="6" Body="&lt;h2&gt;Bond Prices&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Assume that the short rate $r_t$ follows the Ito process as described by the following stochastic differential equation&#xA;\begin{align}&#xA;d{{r}_{t}}=\mu ({{r}_{t}},t)dt+\sigma ({{r}_{t}},t)d{{W}_{t}^{P}}&#xA;\end{align}&#xA;we assume the bond price to be dependent on $r_t$ only, independent of default risk, liquidity and other factors. If we write the bond price as $P(r_t, t)=V(t,r_t,T)$ such that $V(t,r_t,t)=1$ then&#xA;\begin{align}&#xA;dV=({{V}_{t}}+\mu \,{{V}_{r}}\,+\frac{1}{2}{{\sigma }^{2}}{{V}_{rr}})dt+\sigma {{V}_{r}}d{{W}_{t}}&#xA;\end{align}&#xA;for simplicity let&#xA;\begin{align}&#xA;  &amp;amp; {{\mu }_{V}}=\frac{{{V}_{t}}+\mu {{V}_{r}}\,+\frac{1}{2}{{\sigma }^{2}}{{V}_{rr}}}{V} \\ &#xA; &amp;amp; {{\sigma }_{V}}=\frac{\sigma {{V}_{r}}\,}{V} \\ &#xA;\end{align} &#xA;thus we have&#xA;\begin{align}&#xA;dV={{\mu }_{V}}\,Vdt+{{\sigma }_{V}}\,V\,d{{W}_{t}}&#xA;\end{align}&#xA;The following portfolio is constructed: we buy a bond of dollar value V1 with maturity $T_1$ and sell another bond of dollar&#xA;value $V_2$ with maturity $T_2$. The portfolio value $\Pi$ is given by&#xA;\begin{align}&#xA;\Pi ={{V}_{1}}-{{V}_{2}}&#xA;\end{align}&#xA;According to the bond price dynamics,we have&#xA;\begin{align}&#xA;\Pi =({{\mu }_{{{V}_{1}}}}{{V}_{1}}-{{\mu }_{{{V}_{2}}}}{{V}_{2}})\,dt+({{\sigma }_{{{V}_{1}}}}{{V}_{1}}-{{\sigma }_{{{V}_{2}}}}{{V}_{2}})\,d{{W}_{t}}&#xA;\end{align}&#xA;Suppose $V_1$ and $V_2$ are chosen such that&#xA;\begin{align}&#xA;  &amp;amp; {{V}_{1}}=\frac{{{\sigma }_{{{V}_{2}}}}}{{{\sigma }_{{{V}_{2}}}}-{{\sigma }_{{{V}_{1}}}}}\Pi  \\ &#xA; &amp;amp; {{V}_{2}}=\frac{{{\sigma }_{{{V}_{1}}}}}{{{\sigma }_{{{V}_{2}}}}-{{\sigma }_{{{V}_{1}}}}}\Pi  \\ &#xA;\end{align}&#xA;then the stochastic term in $d\Pi$ vanishes and the equation becomes&#xA;$$d\Pi =\left( \frac{{{\mu }_{{{V}_{1}}}}{{\sigma }_{{{V}_{2}}}}-{{\mu }_{{{V}_{2}}}}{{\sigma }_{{{V}_{1}}}}}{{{\sigma }_{{{V}_{2}}}}-{{\sigma }_{{{V}_{1}}}}} \right)\Pi \,dt$$&#xA;Since the portfolio is instantaneously riskless, in order to avoid arbitrage opportunities,it must earn the riskless short rate so that $d\Pi =r(t)\Pi dt$ ,then&#xA;$$\frac{{{\mu }_{{{V}_{1}}}}-r(t)}{{{\sigma }_{{{V}_{1}}}}}=\frac{{{\mu }_{{{V}_{2}}}}-r(t)}{{{\sigma }_{{{V}_{2}}}}}$$&#xA;The above relation is valid for arbitrary maturity dates $T_1$ and $T_2$, so the ratio should be independent of maturity $T$.Let the common ratio be defined&#xA;by $\lambda$, that is,&#xA;$$\frac{{{\mu }_{V}}-r(t)}{{{\sigma }_{V}}}=\lambda \,({{r}_{t}},t)$$&#xA;The quantity $\lambda$ is called the market price of risk of the short rate.If we substitute $μ_V(r, t)$ and $σ_V(r, t)$ into above Equation, we obtain the following governing differential equation for the price of a zero-coupon bond&#xA;$${{V}_{t}}+(\mu -\lambda \sigma \,){{V}_{r}}\,+\frac{1}{2}{{\sigma }^{2}}{{V}_{rr}}-{{r}_{t}}\,V=0$$&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Change Measure&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;we assume $Q$ be a martingale measure such that &#xA;$$dW_{t}^{P}=-\lambda(r,t)dt+dW_{t}^{Q}$$&#xA;thus we have&#xA;$$d{{r}_{t}}=\mu^*(r_t,t)dt+\sigma ({{r}_{t}},t)dW_{t}^{Q}$$&#xA;where&#xA;$$\mu^*(r_t,t)=\mu({{r}_{t}},t)-\lambda ({{r}_{t}},t)\sigma ({{r}_{t}},t)$$&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Affine Term Structure Models&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;A short rate model that generates the bond price solution of the form&#xA;$$P(t\,,T)=V(t,r_t,T)={{e}^{A(t,T)\,-\,B(t,T){{r}_{t}}\,}}$$&#xA;Suppose the dynamics of the short rate $r_t$ under the risk neutral measure $Q$ is governed by&#xA;\begin{align}&#xA;d{{r}_{t}}=\mu^* ({{r}_{t}},t)dt+\sigma ({{r}_{t}},t)d{{W}_{t}^{Q}}&#xA;\end{align}&#xA;where&#xA;\begin{align}&#xA; &amp;amp;\mu^* ({{r}_{t}},T)=\alpha (t)\,{{r}_{t}}+\beta (t) \\ &#xA; &amp;amp;{{\sigma }^{2}}({{r}_{t}},T)=\gamma (t)\,{{r}_{t}}+\delta (t) \\ &#xA;\end{align}&#xA;We show the governing equation for $P(t, T )=V(t,r,T)$ is given by&#xA;$${{V}_{t}}+\mu ^*{{V}_{r}}\,+\frac{1}{2}{{\sigma }^{2}}{{V}_{rr}}-{{r}_{t}}\,V=0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Substituting the assumed affine solution of bond price into this equation, we obtain&#xA;\begin{align}&#xA;  &amp;amp; {{B}_{t}}(t,T)+\alpha (t)B(t,T)-\frac{1}{2}\gamma (t){{B}^{2}}(t,T)=-1 \\ &#xA; &amp;amp;B(T,T)=0 \\ &#xA;\end{align}&#xA;and&#xA;\begin{align}&#xA; &amp;amp; {{A}_{t}}(t,T)=\beta (t)B(t,T)-\frac{1}{2}\delta (t){{B}^{2}}(t,T) \\ &#xA; &amp;amp; A(T,T)=0 \\ &#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Vasicek Model&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Vasicek (1977) proposed the stochastic process for the short rate $r_t$ under the Martingle measure to be governed by the Ornstein–Uhlenbeck process:&#xA;$$d{{r}_{t}}=a(b-r_t)dt+\sigma d{{W}_{t}^{Q}}$$&#xA;hence&#xA;\begin{align}&#xA; &amp;amp; \alpha (t)=-a\,\,\,\,\,\,,\,\,\,\,\,\,\,\beta (t)=ab \\ &#xA; &amp;amp; \gamma (t)=\,0\,\,\,\,\,\,\,\,\,\,\,,\,\,\,\,\,\,\,\,\delta (t)={{\sigma }^{2}} \\ &#xA;\end{align}&#xA;thus we have&#xA;$$ B(t,T)= \frac{1 - e^{-a(T-t)}}{a}\\$$&#xA;and&#xA; $$ A(t,T)= exp\left((b + \frac{\sigma\phi}{a}-\frac{\sigma^2}{a^2})(B(t,T) - T + t) + \frac{B(t,T)^2\sigma^2}{4a}\right)$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastActivityDate="2015-07-16T17:20:33.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18901" PostTypeId="1" CreationDate="2015-07-16T18:04:01.930" Score="1" ViewCount="88" Body="&lt;p&gt;Are there any studies on the average difference or ratio between Settlement (execution price) and the Spot price dependant on lot size.&lt;/p&gt;&#xA;&lt;p&gt;I'm looking for a function such as &lt;code&gt;SETTLEMENT=SPOT*LOT_SIZE^CURVING_FACTOR/commodity_constant*ASK/BID&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;This settlement/spot ratio is dependent on the amount of liquidity and the commodity type.  However the ask/bid spread is also dependent on the amount of liquidity.  So I was hoping that the ASK/BID spread would be a good starting point.  However I don't have enough knowledge to decide what the best &amp;quot;curving factor&amp;quot; I should use, quadratic/cubic/exponentioal/linear...  Is this the correct way to model it?&lt;/p&gt;&#xA;&lt;p&gt;I have to do this because I'll be working with a system that can't do limit/stop orders and so I need to estimate what the execution price will be &lt;em&gt;before&lt;/em&gt; execution.&lt;/p&gt;&#xA;&lt;h1&gt;Example&lt;/h1&gt;&#xA;&lt;p&gt;A 10 quantity lot transaction with a spot of 100 USD/lot could yield a settlement after execution of 1002 USD.  This is a .2% increase over the spot rate/lot.  However a 100 quantity lot transaction could yield a settlement of 1010 USD giving a 1% increase of the spot.&lt;/p&gt;&#xA;" OwnerUserId="16933" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2015-07-16T18:04:01.930" Title="Settlement/Spot/(bid ask spread) ratio" Tags="&lt;spread&gt;&lt;liquidity&gt;&lt;order-execution&gt;&lt;spot-rate&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18902" PostTypeId="1" CreationDate="2015-07-17T00:02:42.397" Score="1" ViewCount="307" Body="&lt;p&gt;I am familiar with the FIFO methodology of netting buys and sells to obtain a realized P&amp;amp;L and outstanding position. Suppose there's a strategy which runs in two different places A, and B and tries to place trades at A and B which are offsetting (like pair trading). In practice, they will both generate a log of trades (A.trades and B.trades). When I backtest the strategy I look at the trades in the order from concatenating B.trades to A.trades. This pnl can be very different from concatenating the other way, or interleaving more realistically by matching timezone adjusted trades. For example. For illustration only. Suppose we had:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A.trades&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Sell 1 for 10$&#xA;Buy  2 for 10$&#xA;Sell 3 for 7$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and B.trades:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Buy 1 for 5$&#xA;Buy 2 for 5$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I concatenate B.trades to A.trades and run a fifo algorithm I get a realized PNL of 1$ with 1 share left long. However, if interleave them I could have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interleaved.trades:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Sell 1 for 10$&#xA;Buy  1 for 5$&#xA;Buy  2 for 5$&#xA;Buy  2 for 10$&#xA;Sell 3 for 7$&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then in that case the FIFO algorithm gives me a realized P&amp;amp;L of 6$ with one share long in the end. I can see from running this by hand that the reason is that the &quot;more expensive&quot; buy is left unmatched in the second case. But it illustrates how strongly it can influence P&amp;amp;L. Now, it's not always straightforward to interleave trades in correct order of time if the units are small and there is clock drift (measuring time in two different places with different clocks) so it's not always clear we can capture a universal ordering. What could be done or is done in practice with a situation like this?&lt;/p&gt;&#xA;" OwnerUserId="16876" LastActivityDate="2015-08-16T00:44:17.370" Title="What P&amp;L netting should one use when a strategy has trades in two different geographic locations?" Tags="&lt;returns&gt;&lt;pairs-trading&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18903" PostTypeId="2" ParentId="18902" CreationDate="2015-07-17T00:30:42.480" Score="2" Body="&lt;p&gt;I would definitely want to mark to market, instead of reporting realized + open p&amp;amp;l. Because the time ordering doesn't really affect the p&amp;amp;l, just the breakdown between realized and open. Which I don't think matters to most people.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To do this you need a market price, to mark your open position at. In an intraday context you could use the last traded price. In a long term context you could use the most recent close.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your timestamps are so close as to make A &amp;amp; B clocks not reliably ordered, the prices at A &amp;amp; B should be pretty much the same too. Otherwise you have some pretty awesome pairs opportunities. So this problem might only matter to a tax accountant (which you may be, of course).&lt;/p&gt;&#xA;" OwnerUserId="5550" LastActivityDate="2015-07-17T00:30:42.480" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18904" PostTypeId="1" AcceptedAnswerId="18909" CreationDate="2015-07-17T05:15:54.380" Score="2" ViewCount="882" Body="&lt;p&gt;&lt;img src=&quot;https://upload.wikimedia.org/math/7/3/f/73f31f30fbd210115558ec6803911648.png&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://upload.wikimedia.org/math/8/4/2/842374ea406b2eeb749d4fb172e86b1b.png&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why do we model it as sqrt root of v(t)? Is that because we don't want the volatility to go negative? If this is the case, can we model it as square of v(t)?&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2015-07-18T09:36:40.217" Title="Why square root of volatility in Heston model?" Tags="&lt;heston&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18905" PostTypeId="1" AcceptedAnswerId="18907" CreationDate="2015-07-17T06:16:47.737" Score="7" ViewCount="8603" Body="&lt;p&gt;I am trying to understand the intuitive reasoning for why volatility is more for deep OTM/ITM put/call then ATM..(why Simles for equity) Why ATM will not have more volatility as deep OTM/ITM option will be less likely to be exercised..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for the help!!&lt;/p&gt;&#xA;" OwnerUserId="11661" LastEditorUserId="19645" LastEditDate="2021-05-05T08:44:37.207" LastActivityDate="2021-05-05T08:44:37.207" Title="Intuitive Explanation for Volatility Smile for Equity" Tags="&lt;volatility&gt;&lt;volatility-smile&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18906" PostTypeId="2" ParentId="18790" CreationDate="2015-07-17T07:28:52.747" Score="1" Body="&lt;p&gt;Greed/fear and leveraged long investors accelerates the fall in deed. But remember for every tick the mkt advances, someone is putting money at stake, for prices to fall nobody has to put up any money. Law of relativity.. &lt;/p&gt;&#xA;" OwnerUserId="16937" LastActivityDate="2015-07-17T07:28:52.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18907" PostTypeId="2" ParentId="18905" CreationDate="2015-07-17T07:29:02.117" Score="8" Body="&lt;p&gt;There are several reasons, maybe the most important and also quite intuitive one:&#xA;Implied volatility more or less assumes that the stock price is driven by Brownian motion and thus moves in a continuous fashion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What we observe is that stocks can jump (usually downwards, sometimes upwards) which needs to be modelled using something like a jump process (maybe in addition to some diffusion part). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This possibility of jumps leads to prices of OTM options to be relatively high. In order to account for this high price we need a relatively high implied vol.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-07-17T07:29:02.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18908" PostTypeId="2" ParentId="18904" CreationDate="2015-07-17T07:45:38.270" Score="0" Body="&lt;h2&gt;Edit&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;we assume $X_t$ follows the differential stochastic process&#xA;$$d X(t)=\mu (t,{{X}_{t}})dt+\sigma (t,{{X}_{t}}) dW(t)$$&#xA;if &#xA;$$\underset{{{X}_{t}}\to 0}{\mathop{\lim }}\,\,\mu (t,{{X}_{t}} )-\frac{1}{2}\frac{\partial }{\partial x}{{\sigma }^{2}}(t,{{X}_{t}})\geq 0$$&#xA;then&#xA;$$P(\{\,t\in [0\,,\infty )|\,X(t\,,x )\leq 0\})=0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in the C.I.R Model ,we have&#xA;$$\underset{{{v}_{t}}\to 0}{\mathop{\lim }}\,\,\left( \kappa (\theta -{{v}_{t}})-\frac{1}{2}\frac{\partial }{\partial v}{{(\sigma \sqrt{{{v}_{t}}})}^{2}} \right)=\underset{{{v}_{t}}\to 0}{\mathop{\lim }}\,\,\kappa (\theta -{{v}_{t}})-\frac{1}{2}{{\sigma }^{2}}=\kappa \theta -\frac{1}{2}{{\sigma }^{2}}$$&#xA;another property of the square-root process for instantaneous variance is the fact that it leads in many case of interest to close-form or semi-close form solution for the characteristic function. we are also able to drive a close-form solution based on hyper-geometric functions when the underlying follow as mean reverting process. &lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastEditorDisplayName="user16891" LastEditDate="2015-07-17T13:26:25.027" LastActivityDate="2015-07-17T13:26:25.027" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18909" PostTypeId="2" ParentId="18904" CreationDate="2015-07-17T08:38:53.303" Score="3" Body="&lt;p&gt;V(t) is the variance process of the stock price, not volatility process. Cox-Ingersoll-Ross demonstrated that that specific process can be non-negative under certain conditions, which is what you want for variance.&lt;/p&gt;&#xA;" OwnerUserId="7405" LastActivityDate="2015-07-17T08:38:53.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18910" PostTypeId="2" ParentId="18904" CreationDate="2015-07-17T10:30:54.600" Score="1" Body="&lt;p&gt;The reason is that Heston managed to solve the case with square root. The log-normal vol process leads to nasty properties. The 3/2 model is another case that have been solved. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-07-17T10:30:54.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18911" PostTypeId="2" ParentId="18905" CreationDate="2015-07-17T10:31:24.043" Score="2" Body="&lt;p&gt;As Richard mentioned, in some particular Markets for a given expiration, options whose strike price differs substantially from the underlying asset's price command higher prices  than what is suggested by standard option pricing models. These options are said to be either deep in-the-money or out-the-money.&#xA;Graphing implied volatilities against strike prices for a given expiry yields a skewed &quot;smile&quot; instead of the expected flat surface.f you plot the implied volatilities against the strike prices, you might get the following U-shaped curve resembling a smile. Hence, this particular volatility skew pattern is better known as the volatility smile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/V1R6N.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact,Volatility smiles tell us that demand is greater for options that are in-the-money or out-of-the-money.&lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastActivityDate="2015-07-17T10:31:24.043" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18912" PostTypeId="2" ParentId="18333" CreationDate="2015-07-17T13:38:42.143" Score="1" Body="&lt;p&gt;I would also say that the pricing of some exotic products require to compute expectations of functions of the random variable at consideration, and these functions may grow more than linearly : you need finite moments in order for the prices of these exotic derivatives to be bounded.&lt;/p&gt;&#xA;" OwnerUserId="16942" LastActivityDate="2015-07-17T13:38:42.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18913" PostTypeId="1" AcceptedAnswerId="18914" CreationDate="2015-07-17T18:00:10.840" Score="2" ViewCount="4574" Body="&lt;p&gt;I am trying to query every single series in the fred database using r. I have checked out both the quantmod and fImport packages, and they work fine, though it seems that quantmod fits my use a bit better. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only problem is that the query function in both packages takes as an input the name or names of the symbols you want, and doesn't have any funciton for &quot;query all data&quot; or even &quot;query all data of a certain type&quot;. I was hoping at least that there would be some comprehensive list of all symbols in FRED, but I have googled and searched all over, and there isn't even a mention of this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I realize this use case may sound a bit strange, and unfortunately I can't explain the  reason for it for proffesional reasons.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be much appreciated!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Paul&lt;/p&gt;&#xA;" OwnerUserId="12162" LastActivityDate="2018-04-24T17:39:29.310" Title="How to get list of all symbols in fred database?" Tags="&lt;r&gt;&lt;quantmod&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18914" PostTypeId="2" ParentId="18913" CreationDate="2015-07-17T18:18:25.717" Score="2" Body="&lt;p&gt;Please check whether this has what you are looking for:&#xA;&lt;a href=&quot;https://fred.stlouisfed.org/categories&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://fred.stlouisfed.org/categories&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each category is available for bulk download.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="13311" LastEditDate="2018-04-23T17:32:28.443" LastActivityDate="2018-04-23T17:32:28.443" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18915" PostTypeId="2" ParentId="18751" CreationDate="2015-07-17T20:04:52.050" Score="1" Body="&lt;p&gt;Yes, you are correct. Consider the following toy example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Log prices follow: $dp_t=\mu dt+\sigma dW_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Then: $r_{t+h,h}=p_{r+h,h}-p_t ~ N(\mu h, \sigma^2 h)$&#xA;3) standard ML estimators:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$\hat{\mu}=\frac{1}{nh}\sum_{k=1} r_{kh,h}$&lt;/li&gt;&#xA;&lt;li&gt;$\hat{\sigma^2}=\frac{1}{nh}\sum_{k=1} (r_{kh,h}-\hat{\mu}h)^2$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Assymptotic distribution of estimators:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$\sqrt T(\hat{\mu}-\mu) \rightarrow N(0,\sigma^2)$&lt;/li&gt;&#xA;&lt;li&gt;$\sqrt n (\hat{\sigma^2}-\sigma^2)\rightarrow N(0,\sigma^4)$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So when $n$ tends to infinity we get precise estimator of $\sigma^2$ , and when $T$ tends to infinity we get it for $\mu$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This was first noted by &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/0304405X80900070&quot; rel=&quot;nofollow&quot;&gt;Merton (1980)&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-07-17T20:04:52.050" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18916" PostTypeId="2" ParentId="18905" CreationDate="2015-07-17T23:03:06.670" Score="2" Body="&lt;p&gt;The volatility smile is the result of market forces knowing form experience that out of the money option pay out more often that what would be expected by a normal (Gaussian) distribution.  For years Quants speculated why the market drove the out of the money options higher that the price of the Black-Scholes model.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best theory speculates that the smile is because the distribution of returns of stock prices are not a normal distribution having large jumps in price that occur too often.  The distribution is much closer to a power law distribution or Pareto distribution.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that the math becomes messy without the normal distribution so the most recent models that include smile uses a jump diffusion process ( a normal distribution with random jumps).  &lt;/p&gt;&#xA;" OwnerUserId="16946" LastActivityDate="2015-07-17T23:03:06.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18917" PostTypeId="1" CreationDate="2015-07-17T23:48:10.670" Score="5" ViewCount="179" Body="&lt;p&gt;This question has so long preoccupied my mind.Please help me to solve it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; Assume $X_t$ described by the following stochastic differential equation &#xA;$$dX_t^{\,\alpha}=\alpha X_t^{\,\alpha} dt+dW_t$$&#xA;where $W_t$ is a standard wiener process and $\alpha \in R$. How do I compute &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ E\left[exp\left((\beta-\alpha)\int_{0}^{T}X_t^{\,\alpha}\,dX_t^\alpha+\frac{\alpha^2}{2}\int_{0}^{T}X_t^{\,2\alpha}\,dt\right)\right]$$ &#xA;for all $\beta&amp;lt;\frac{1}{T}$&lt;/p&gt;&#xA;" OwnerUserId="16947" LastEditorDisplayName="user16891" LastEditDate="2015-07-19T03:26:04.700" LastActivityDate="2015-07-19T22:09:54.063" Title="Computation of Expectation" Tags="&lt;stochastic-calculus&gt;&lt;sde&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18918" PostTypeId="1" CreationDate="2015-07-18T02:21:47.937" Score="3" ViewCount="296" Body="&lt;p&gt;Is there any places (like EDGAR) that I can download Earnings Conference Call transcripts in bulk? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="16948" LastActivityDate="2020-07-27T21:53:30.050" Title="Where to download Earnings Conference Call transcripts?" Tags="&lt;earnings&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18919" PostTypeId="1" AcceptedAnswerId="18933" CreationDate="2015-07-18T04:57:23.503" Score="0" ViewCount="133" Body="&lt;p&gt;What is some book that is complete and easy but hard enough to serve as prerequisite for asset pricing and portfolio choice theory by kerry back?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder how come a beginning graduate textbook is so hard... &lt;/p&gt;&#xA;" OwnerUserId="2744" LastEditorUserId="2744" LastEditDate="2015-07-19T01:47:34.370" LastActivityDate="2015-08-18T11:12:50.923" Title="What is some book that is complete and easy but hard enough to serve as prerequisite for asset pricing and portfolio choice theory?" Tags="&lt;asset-pricing&gt;&lt;financial-engineering&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18920" PostTypeId="2" ParentId="18687" CreationDate="2015-07-18T05:54:37.983" Score="0" Body="&lt;p&gt;I tried using mgarchBEKK (or mgarch) but it seems like the package firstly estimate the VECM model, then use the residuals (Epsilon t) of the VECM (and their variances) in estimating the BEKK-GARCH model. &#xA;I believe the correct method is to run the two models as a system, but I do not know how to proceed! Can anyone give me a hint please?&lt;/p&gt;&#xA;" OwnerUserId="16782" LastActivityDate="2015-07-18T05:54:37.983" CommentCount="0" CommunityOwnedDate="2015-07-18T05:54:37.983" ContentLicense="CC BY-SA 3.0" />
  <row Id="18922" PostTypeId="1" AcceptedAnswerId="18924" CreationDate="2015-07-18T09:23:38.247" Score="5" ViewCount="1138" Body="&lt;p&gt;In finance, many stochastic processes $X(t)$ are defined via&#xA;\begin{equation}&#xA;dX = \text{(some drift term)} dt + \sigma X^\gamma dW_t&#xA;\end{equation}&#xA;with $\gamma = 1/2$ (for instance the Heston model or the CIR process). Generally, this is called a square-root process. My question is: How does one justify the choice of $\gamma = 1/2$. I am aware that it is convenient to chose $0 &amp;lt; \gamma &amp;lt; 1$ since for $\gamma &amp;gt; 1$, no unique Martingale measure exists. But why exactly $\gamma = 1/2$ and not, say $\gamma = 6/7$. &#xA;(I have found one related question here &lt;a href=&quot;https://quant.stackexchange.com/questions/18904/why-square-root-of-volatility-in-heston-model&quot;&gt;Why square root of volatility in Heston model?&lt;/a&gt; but no satisfying answer has been given.)&lt;/p&gt;&#xA;" OwnerUserId="16950" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2015-07-18T12:52:05.527" Title="justification of square root process" Tags="&lt;stochastic-processes&gt;&lt;heston&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18923" PostTypeId="2" ParentId="18904" CreationDate="2015-07-18T09:36:40.217" Score="2" Body="&lt;p&gt;In this paper &#xA;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2626552&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2626552&lt;/a&gt;&#xA;the authors compare the Heston model with volatility given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ dV_t = \kappa_V(\bar{V}-V_t)dt+\sigma_V\sqrt{V_t}dW_t $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with the a model where the volatiltiy is given by &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ dV_t = \kappa_V(\bar{V}-V_t)dt+\sigma_VV_tdW_t $.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They show that the latter is inverse gamma distributed and leads to a more stable volatility distribution with higher kurtosis and fater tails.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, a quick read shows, that the inverse gamma model seems to be relatively unexplored. &lt;/p&gt;&#xA;" OwnerUserId="6640" LastActivityDate="2015-07-18T09:36:40.217" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18924" PostTypeId="2" ParentId="18922" CreationDate="2015-07-18T12:52:05.527" Score="4" Body="&lt;ol&gt;&#xA;&lt;li&gt;C.I.R Process belongs the class of affine diffusion processes.For processes within this class, a closed form solution of the &lt;strong&gt;characteristic function&lt;/strong&gt; exists(&lt;a href=&quot;http://pages.stern.nyu.edu/~dbackus/Disasters/DuffiePanSingleton%20jumps%20Econometrica%2000.PDF&quot; rel=&quot;nofollow noreferrer&quot;&gt;Duffie,et al&lt;/a&gt;). For more details, Suppose we have given a &lt;strong&gt;scalar SDEs&lt;/strong&gt;, i.e.,&#xA;$$dX_t=\mu(X_t,t)dt+\sigma(X_t,t)dW_t$$ &#xA;this process ($\{X_t\}_{0\leq t\leq T}$) is said to be of the affine form if&#xA;\begin{align}&#xA;&amp;amp;&amp;amp;\mu(X_t,t)=\alpha_0+\alpha_1X_t\\&#xA;&amp;amp;&amp;amp;\sigma^2(X_t,t)=\beta_0+\beta_1X_t&#xA;\end{align}&#xA;where $\alpha_j,\beta_j\in R$. We claim  C.I.R Process belongs the class of affine diffusion processes,because&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;  &amp;amp; \mu (t,{{r}_{t}})\,\,=\kappa (\theta -{{r}_{t}})=\underbrace{\kappa \theta }_{{{\alpha }_{0}}}+\underbrace{(-\kappa )}_{{{\alpha }_{1}}}\,{{r}_{t}} \\ &#xA; &amp;amp; {{\sigma }^{2}}(t,{{r}_{t}})=\sigma^2r_t=\underbrace{0}_{\beta_0}+\underbrace{{{\sigma }^{2}}\,}_{\beta {{}_{1}}}\,{{r}_{t}} \\ &#xA;\end{align}&#xA;Now, if $\gamma\ne\frac{1}{2}$,then C.I.R Process doesn't belong the class of affine diffusion processes(please check yourself) and  the discounted characteristic function &lt;strong&gt;is not of the following form&lt;/strong&gt; &#xA;$$\Phi(\phi,r_t,t,T)=e^{A(\phi,\tau)+B(\phi,\tau)r_t}$$&#xA;Consequently, conditional distribution of on  $r_t$ doesn't follow a non-central chi-square distribution.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;If $\gamma&amp;gt;\frac{1}{2}$ e.g $\gamma=\frac{6}{7}$ then &lt;a href=&quot;https://quant.stackexchange.com/questions/18904&quot;&gt;Feller's Condition&lt;/a&gt; holds for any value of $\kappa$ and $\theta$ (we know $\kappa,\theta&amp;gt;0$)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;$$\underset{{{r}_{t}}\to 0}{\mathop{\lim }}\,\,\left( \kappa (\theta -{{r}_{t}})-\frac{1}{2}\frac{\partial }{\partial r}(\sigma\,r_{t}^{\,\gamma})^2 \right)=\kappa \theta&amp;gt;0 $$&#xA;In other words, $r_t$ is always positive and this is inconsistent with financial Modeling. Also,if $\gamma&amp;lt;\frac{1}{2}$ then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\underset{{{r}_{t}}\to 0}{\mathop{\lim }}\,\,\left( \kappa (\theta -{{r}_{t}})-\frac{1}{2}\frac{\partial }{\partial r}(\sigma\,r_{t}^{\,\gamma})^2 \right)\rightarrow-\infty $$&#xA;In other words, $r_t$ is always negative and this is inconsistent with reality.&lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2015-07-18T12:52:05.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18926" PostTypeId="2" ParentId="7049" CreationDate="2015-07-18T22:33:06.867" Score="1" Body="&lt;p&gt;Depends on the execution algorithm and market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have heard of many funds spending few PhD years of research finding out the answer wrt their in house algorithms. Ususally they failed as they do not have enough trades for this (even big funds). Impact is on the order of magnitude of bps, while daily volatility is few orders of magnitues higher. Attributing asset movements to your trades is not an easy task.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One rule of thumb I apply for permanent one-way impact for a VWAP order, is as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$0.3 \times spread + 2 \times IVP \times bps$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where IVP is Interval Volume Percentage (Q/V). The formula is clearly flawed, but represents an average of models across markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On a side note (although the square root term is popular): &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;If we had a non-linear impact, how would the coefficients change if participants would have traded differnt relative sizes?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Would the impact would be still sub linear if we traded huge sizes?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You might also find this discussion useful: &lt;a href=&quot;https://www.quantopian.com/posts/proposed-new-default-slippage-and-commissions&quot; rel=&quot;nofollow&quot;&gt;Quantopian Slippage Model&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="16956" LastEditorUserId="16956" LastEditDate="2015-07-19T19:29:37.273" LastActivityDate="2015-07-19T19:29:37.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18929" PostTypeId="2" ParentId="43" CreationDate="2015-07-19T10:23:46.150" Score="4" Body="&lt;p&gt;In practice all impact models are sub-linear. Despite this is fact (seen in many academic publications, commercial and proprietary models), there is an interesting argument for using a linear impact models (other than being careful and pessimistic). Would anyone try to build a model, this approach would be also more parsimonious with less parameters to fit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Imagine 10 VWAP orders of 10 different traders making up the buy trades of a day for a security, each of them trading the same amount. If impact would be sub-linear (concave) then only one of them trading $10 \times$ more, would result in a different impact. Assuming they are using the same VWAP algorithm (or same broker even), this would lead to contradiction as the impact should be the same. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might also find this discussion useful: &lt;a href=&quot;https://www.quantopian.com/posts/proposed-new-default-slippage-and-commissions&quot; rel=&quot;nofollow noreferrer&quot;&gt;Quantopian Slippage Model&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="16956" LastEditorUserId="16956" LastEditDate="2018-07-26T13:43:44.213" LastActivityDate="2018-07-26T13:43:44.213" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="18930" PostTypeId="2" ParentId="1264" CreationDate="2015-07-19T10:32:36.323" Score="1" Body="&lt;p&gt;Given that you're tradeing low volumes ($&amp;lt;1\%$ of volume, I take), I would not assume more than 1 bps slippage in your case.&lt;/p&gt;&#xA;" OwnerUserId="16956" LastEditorUserId="16956" LastEditDate="2015-07-20T00:55:15.330" LastActivityDate="2015-07-20T00:55:15.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18931" PostTypeId="2" ParentId="18913" CreationDate="2015-07-19T10:42:01.300" Score="0" Body="&lt;p&gt;You might find Quandl useful, where amoung other sources you'll also find FRED: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.quandl.com/data/FRED?page=13&quot; rel=&quot;nofollow&quot;&gt;https://www.quandl.com/data/FRED?page=13&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Rotating the &lt;code&gt;page=13&lt;/code&gt; counter in the URL, you will eventually donwload names of all datasets (you'll need to download all pages and parse them a bit).&lt;/p&gt;&#xA;" OwnerUserId="16956" LastActivityDate="2015-07-19T10:42:01.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18933" PostTypeId="2" ParentId="18919" CreationDate="2015-07-19T10:59:41.277" Score="2" Body="&lt;p&gt;I would recommend &quot;Active Portfolio Management&quot; from Richard Grinold and Ronald Kahn. The book builds up most theories used in portfolio composition with much detail.&lt;/p&gt;&#xA;" OwnerUserId="16956" LastActivityDate="2015-07-19T10:59:41.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18934" PostTypeId="1" CreationDate="2015-07-19T11:10:26.490" Score="1" ViewCount="151" Body="&lt;p&gt;I have heard that ITG, LiquidMetrix, MarkIT and TradingScreen has good Transaction Cost Analysis (TCA) research. I wonder which firm one would choose to have an impact model formula inside his simulations (that is to optimize traded portfolio size).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two ways to achive this:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;find a firm which discloses their complete impact model&lt;/li&gt;&#xA;&lt;li&gt;find a firm which provides a detailed simulator including the impact models&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Open for suggestions for both options.&lt;/p&gt;&#xA;" OwnerUserId="16956" LastActivityDate="2015-07-19T11:10:26.490" Title="What are commercial impact models and transaction cost analysis models out there for simulation?" Tags="&lt;simulations&gt;&lt;transaction-costs&gt;&lt;market-impact&gt;&lt;slippage&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18935" PostTypeId="2" ParentId="16024" CreationDate="2015-07-19T11:44:29.450" Score="3" Body="&lt;p&gt;To many statistical questions you can get frequentist and Bayesian answers which actually coincide. Such a subject is covariance matrix shrinkage and Bayesian regression. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have a look at the article &quot;Honey, I Shrunk the Sample Covariance Matrix&quot; from Lediot and Wolf. They introduce a transformation of the covariance matrix, so that the diagonals become more pronounced, hence less (over) fitting happens on the correlation matrix when doing regression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similar -- shrinked -- covariance matrix can be used in regression and you will arrive to ridge regression (L2 regularization) or Lasso, LARS (L1 regularization). These regression methods are expressed as minimization of the quadratic error term plus an L1 or L2 penalty term on regression weights. Consider L2 regularization for example, which minimizes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\|A\mathbf{x}-\mathbf{b}\|^2+ \lambda\| \mathbf{x}\|^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While at first this looks like frequentist formula aimed at reducing over-fitting, is is equivalent to the Bayesian solutions of regression with Normal prior on the regression weights (the penalty coefficient $\lambda$ is a function of variance of the Normal prior).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many statistical packages are equipped with L1 and L2 regressions and covariance shrinkage (e.g. scikit-learn in Python), so you won't have to get your hands very dirty.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An other interesting Bayesian model in portfolio optimizaiton is the Black-Litterman model, where they use a reasonable prior on expected asset returns (derived from reverse optimization in portfolio theory), and Bayesian theory to arrive to a mixed estimation of future asset returns.&lt;/p&gt;&#xA;" OwnerUserId="16956" LastActivityDate="2015-07-19T11:44:29.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18938" PostTypeId="2" ParentId="1464" CreationDate="2015-07-19T13:30:03.587" Score="13" Body="&lt;p&gt;A digital call option (cash-or-nothing) can be replicated with two call options with different Strike. When we make the delta infinitely small and assume we have arbitrary strike prices. We get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/pXbI6.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/052u5.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="43085" LastEditDate="2019-10-27T16:39:10.423" LastActivityDate="2019-10-27T16:39:10.423" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="18939" PostTypeId="1" CreationDate="2015-07-19T15:13:49.220" Score="3" ViewCount="377" Body="&lt;p&gt;In the usual &quot;portfolio optimization problem under linear constraints&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me define the terms here.&#xA;$$&#xA;\text{Find } w^*=\underset{w}{\text{argmax}} \ \ r^Tw - \lambda w^{T} \Sigma w - tradingCost(|w-w_0|)\\&#xA;\text{uc.} \ \ l_b \leq Aw \leq u_b&#xA;$$&#xA;where $w \in \mathbb{R}^n$ is the final position of a n-assets portfolio, $w_0 \in \mathbb{R}^n$ the initial position, $r \in \mathbb{R}^n$ is vector of expected returns over a time period (say $[0,T]$), $\Sigma$ is the $\mathbb{M}_{n,n}(\mathbb{R})$ matrix of covariance of the asset returns. Second line are constraints.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem here is that $r$ is an estimation with a low correlation to ex-post returns (that I am trying to predict). The trading cost on the other hand are much likely to be a more more accurate prediction of real trading cost.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is there a usual way to scale those quantities ?&lt;/li&gt;&#xA;&lt;li&gt;Is there references describing a theory/methodology ?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5339" LastActivityDate="2016-02-15T07:06:40.577" Title="How to scale $\alpha$, trading costs in a standard portfolio optimization problem" Tags="&lt;portfolio-management&gt;&lt;optimization&gt;&lt;portfolio-optimization&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18940" PostTypeId="2" ParentId="18917" CreationDate="2015-07-19T19:00:29.550" Score="4" Body="&lt;p&gt;let $Y_t=(X_t)^\alpha$,then&#xA;$$dY_t=\alpha Y_tdt+dW_t^P$$&#xA;we define $Q$ measure by&#xA;$$\frac{dQ}{dP}=exp\left(-\alpha\int_{0}^{T}Y_t\,dW_t^p-\frac{1}{2}\alpha^2\int_{0}^{T}Y_t^2 dt\right)$$&#xA;this shows that&#xA;$$W_t^Q=W_t^P+\alpha\,\int_{0}^{t}Y_s\,ds$$&#xA;is standard wiener process under $Q$ measure, thus we have&#xA;$$dW_t^P=dW_t^Q-\alpha\,Y_t dt$$&#xA;and&#xA;$$dY_t=\alpha Y_tdt+dW_t^P=\alpha Y_tdt+dW_t^Q-\alpha\,Y_t dt=dW_t^Q$$&#xA;This means that $\{Y_t\}_{0\leq t \leq T}$ &lt;strong&gt;is a standard Wiener process under $Q$ measure.&lt;/strong&gt; Now we can compute the expectation as follow&#xA;$$ E^P\left[exp\left((\beta-\alpha)\int_{0}^{T}Y_t\,dY_t+\frac{\alpha^2}{2}\int_{0}^{T}Y_t^2\,dt\right)\right]=E^Q\left[exp\left(\beta\int_{0}^{T}Y_t\,dY_t\right)\right]=E^Q\left[exp\left(\beta\int_{0}^{T}W_t^Q\,dW_t^Q\right)\right]=E^Q\left[exp\left(\frac{\beta}{2}[(W_T^Q)^2-T]\right)\right]=\frac{e^\frac{-\beta\,T}{2}}{\sqrt{1-\beta\,T}}\,\,\,\,\,\,\,\,\,\,\,\,\,$$ &lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastEditorDisplayName="user16891" LastEditDate="2015-07-19T22:09:54.063" LastActivityDate="2015-07-19T22:09:54.063" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18942" PostTypeId="1" CreationDate="2015-07-19T19:08:52.153" Score="2" ViewCount="1196" Body="&lt;p&gt;I managed to forecast a GARCH model yesterday and run a Monte Carlo simulation on R. Nevertheless, I can't do the same with an ARMA-GARCH. I tested 4 different method but without achieving an ARMA-GARCH simulation with my data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The packages and the data I used:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quantmod)&#xA;library(tseries)&#xA;library(TSA)&#xA;library(betategarch)&#xA;library(mcsm)&#xA;library(PerformanceAnalytics)&#xA;library(forecast)&#xA;library(fGarch)&#xA;library(GEVStableGarch)&#xA;&#xA;getSymbols(&quot;DEXB.BR&quot;,from=&quot;2005-07-01&quot;, to=&quot;2015-07-01&quot;)&#xA;STOCK = DEXB.BR&#xA;STOCK.rtn=diff(STOCK[,6] )&#xA;STOCK.diff = STOCK.rtn[2:length(STOCK.rtn)]&#xA;ARI_2_1=arima(STOCK[,6],order=c(2,1,1))&#xA;GA_1_1=garch(ARI_2_1$residuals, order = c(1,1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;First tested method&lt;/h1&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;specifi = garchSpec(model = list(ar = c(0.49840, -0.0628), ma =c(-0.4551), omega = 8.393e-08, alpha = 1.356e-01, beta = 8.844e-01))&#xA;&#xA;garchSim(spec = specifi, n = 500, n.start = 200, extended = FALSE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This lead to a &quot;NaN&quot; forecast.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;garchSim(spec = specifi, n = 500)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;n=1000&#xA;armagarch.sim_1 = rep(0,n)&#xA;armagarch.sim_50 = rep(0,n)&#xA;armagarch.sim_100 = rep(0,n)&#xA;for(i in 1:n)&#xA;{&#xA;    armagarch.sim=garchSim(spec = specifi, n = 500, n.start = 200, extended = FALSE)&#xA;    armagarch.sim_1[i] = armagarch.sim[1]&#xA;    armagarch.sim_50[i] = armagarch.sim[50]&#xA;    armagarch.sim_100[i] = armagarch.sim[100]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;}&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Second tested method&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;GSgarch.Sim(N = 500, mu = 0, a = c(0.49840, -0.0628), b = c(-0.4551),&#xA;omega = 8.393e-08, alpha = c(1.356e-01), gm = c(0), beta = c(8.844e-01),&#xA; cond.dist = &quot;norm&quot;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This part works.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;n=10000&#xA;&#xA;Garmagarch.sim_1 = rep(0,n)&#xA;Garmagarch.sim_50 = rep(0,n)&#xA;Garmagarch.sim_100 = rep(0,n)&#xA;&#xA;for(i in 1:n)&#xA;{&#xA;    Garmagarch.sim= GSgarch.Sim(N = 500, mu = 0, a = c(0.49840, -0.0628), b = c(-0.4551),omega = 8.393e-08, alpha = c(1.356e-01), gm = c(0), beta c(8.844e-01), cond.dist = &quot;norm&quot;)&#xA;&#xA;    Garmagarch.sim_1[i] = Garmagarch.sim[1]&#xA;    Garmagarch.sim_50[i] = Garmagarch.sim[50]&#xA;    Garmagarch.sim_100[i] = Garmagarch.sim[100]&#xA;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The simulation runs but&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; Garmagarch.sim[1]&#xA;$model&#xA;[1] &quot;arma(2,1)-aparch(1,1) ## Intercept:FALSE&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; Garmagarch.sim[50]&#xA;$&amp;lt;NA&amp;gt;&#xA;NULL&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Third tested method&lt;/h1&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ga_arma = garch.sim(alpha=c(8.393e-08,1.356e-01),beta =8.844e-01 ,n=500, ntrans=200)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This lead to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error in garch.sim(alpha = c(8.393e-08, 0.1356), beta = 0.8844, n = 500,  : &#xA;  Check model: it does not have finite variance&#xA;&#xA;&#xA;arima.sim(ARI_2_1, 500, innov = ga_arma ,n.start = 200)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And this to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error in arima.sim(ARI_2_1, 500, innov = ga_arma, n.start = 200) : &#xA;  la partie 'ar' du mopdèle n'est pas stationaire&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which mean that the 'ar' part of the model isn't stationnary.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Fourth tested method&lt;/h1&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;forecast(ARI_2_1, h = 500, bootstrap = TRUE, npaths=200)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This one actually works but I don't know how to add the GARCH component.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;forecast(specifi, h = 500, bootstrap = TRUE, npaths=200)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks !&lt;/p&gt;&#xA;" OwnerUserId="16962" LastActivityDate="2016-08-23T06:28:43.100" Title="Forecast of ARMA-GARCH model in R" Tags="&lt;r&gt;&lt;monte-carlo&gt;&lt;garch&gt;&lt;forecasting&gt;&lt;arma&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18943" PostTypeId="2" ParentId="18939" CreationDate="2015-07-19T19:41:57.060" Score="1" Body="&lt;p&gt;One standard approach is to shrink your forecasts towards zero (or to some reasonable value as in the Black-Littermann model). Shrinking towards zero is done by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$w^*=\underset{w}{\text{argmax}} \ \ \lambda_{\alpha} r^Tw - \lambda_r w^{T} \Sigma w - tradingCost(|w-w_0|)\\$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$0\leq\lambda_{\alpha}\leq1$$&#xA;Shrinkage coefficient $\lambda_{\alpha}$ is best backtested using simulation. If you are really careful about overfitting, you'd also want to run an on-line algorithm for choosing the best coefficients.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively you can use a shrinked regression to come up with return predictions as L1 or L2 regularization (Lasso or Ridge regression).&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;EDIT&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;I'm afraid you won't find much better than fitting one more parameter, although I'd hope to read a new solution here. By on-line algorithm I mean a causal expert combination, which won't overfit your data. Have a look at &lt;a href=&quot;http://www.cs.bme.hu/~oti/portfolio/articles/tgyorfi.pdf&quot; rel=&quot;nofollow&quot;&gt;Empirical log-optimal portfolio selections: a survey.&lt;/a&gt;, in particular &quot;Kernel/Histogram/Nearest Neighbort based strategy&quot; sections. Using a grid wisely will avoid over-fitting completely and result in un-biased (or pessimistic) return estimates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;W.r.t. L1 and L2 regularization (try Lasso or Ridge first, it's more simple than elastic net)... once you chose the right shrinkage coefficient in your regression by cross-validation or backtesting, you won't have this problen in your portfolio optimizaiton anymore.&lt;/p&gt;&#xA;" OwnerUserId="16956" LastEditorUserId="16956" LastEditDate="2015-07-19T21:32:31.867" LastActivityDate="2015-07-19T21:32:31.867" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18944" PostTypeId="1" CreationDate="2015-07-19T21:15:01.280" Score="1" ViewCount="224" Body="&lt;p&gt;I've tested my code against individual symbols and very small groups of symbols. I'm finding the more symbols I add the fewer trades I get. For instance, if I just include the first five symbols, all of them seem to have at least one trade. If I expand to 20 or so then a few symbols have trades but none of the symbols in the first group have trades anymore.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking to execute the strategy on the list of 158 symbols.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've added the parallel package. That does not seem to help. I'm using &lt;a href=&quot;http://www.r-programming.org/papers&quot; rel=&quot;nofollow&quot;&gt;Guy Yollin's Luxor (MACD) example&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My initial applyStrategy was: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;out &amp;lt;- applyStrategy(strategy=strategy.st, &#xA;                   portfolios=portfolio.st, &#xA;                   parameters=list(nFast=fastMA, &#xA;                                   nSlow=slowMA, &#xA;                                   nSig=signalMA, &#xA;                                   maType=maType), &#xA;                   debug=TRUE, &#xA;                   verbose=TRUE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above returns no errors, but no trades either (again, tested on smaller samples I do get trades). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My attempt with the foreach/parallel package was:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;foreach (i=1:length(symbols)) %dopar%&#xA;  out &amp;lt;- applyStrategy(strategy=strategy.st, &#xA;                   portfolios=portfolio.st, &#xA;                   parameters=list(nFast=fastMA, &#xA;                                   nSlow=slowMA, &#xA;                                   nSig=signalMA, &#xA;                                   maType=maType), &#xA;                   symbols=c(symbols[i]), &#xA;                   debug=TRUE, &#xA;                   verbose=TRUE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This piece of code returns the following error:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Error in foreach(i = 1:length(symbols)) %dopar% out &amp;lt;- applyStrategy(strategy = strategy.st,  : &#xA;       target of assignment expands to non-language object&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So, naturally now I'm at a loss. I can do the symbols individually (did yesterday) but it took forever and I know it can be simpler.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.dropbox.com/s/3ypywb4r079xzax/sample.R?dl=0&quot; rel=&quot;nofollow&quot;&gt;Sample script uploaded to Dropbox&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any advice greatly appreciated!&lt;/p&gt;&#xA;" OwnerUserId="16757" LastActivityDate="2015-07-19T21:15:01.280" Title="Issues with +100 symbols in Quantstrat, Erratic Trades" Tags="&lt;r&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18945" PostTypeId="1" CreationDate="2015-07-19T22:04:42.317" Score="2" ViewCount="387" Body="&lt;p&gt;In Edmond Levy's 1992 paper, he introduced a moment-matching method to approximate the price of an Asian option assuming GBM for the underlying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It suggested that, if some monitor points are already observed, and the average of these points are $A$, then in the pricing formula, the strike is adjusted to $K^*=K-\frac{m+1}{N+1}A$, where $m+1$ is the number of points observed, and $N+1$ is the total number of monitor points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it is possible that $K^*$ is below $0$, which causes trouble when we try to log them in $d_1$ and $d_2$. Is it the method's own limitless or did I do something wrong here? &lt;/p&gt;&#xA;" OwnerUserId="16554" LastEditorUserId="11678" LastEditDate="2017-04-11T13:49:45.290" LastActivityDate="2017-04-11T13:49:45.290" Title="Negative adjusted strike in Levy's Asian option approximation?" Tags="&lt;options&gt;&lt;asian-option&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18946" PostTypeId="1" CreationDate="2015-07-20T07:12:43.823" Score="4" ViewCount="229" Body="&lt;p&gt;How can one fit a linear model to the higher moments of CAPM in R? &#xA;Fitting a linear model to the second moment (classical CAPM) would be      &lt;code&gt;lm(stock~market, data=example)&lt;/code&gt; &#xA;$$R_{i,t} - R_{f,t} = \alpha_i + \beta_i(R_{M,t}-R_{f,t}) + \epsilon_t \tag{2nd}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But how would one fit a linear model to third and fourth moment of CAPM? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R_{i,t}-R_{f,t} = \alpha_i + \beta_i(R_{m,t}-R_{f,t})+\gamma_i(R_{m,t}-R_{f,t})^2 \tag{3rd}$$&#xA;$$R_{i,t}-R_{f,t} = \alpha_i + \beta_i(R_{m,t}-R_{f,t})+\gamma_i(R_{m,t}-R_{f,t})^2+\delta_i(R_{m,t}-R_{f,t})^3 \tag{4th}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where the $\beta_i$ is systematic variance, $\gamma_i$ is systematic skewness and $\delta_i$ is systematic kurtosis calculated as follows, $\beta_i = Cov(R_i,R_m)/E[(R_m-E(R_m))^2] =Cov(R_i,R_m)/Var(R_m)$ ,$\gamma_i = Cov(R_i,R_m^2)/E[(R_m-E(R_m))^3]$, $\delta_i = Cov(R_i,R_m^3)/E[(R_m-E(R_m))^4]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried squaring the market excess returns and fitting a linear model as follows &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;market2 &amp;lt;- market^2&#xA;lm(stock~market+market2, data=example)&#xA;market3 &amp;lt;- market^3&#xA;lm(stock~market+market2+market3, data=example)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This could be right but I doubt it, it's hard to check. Any ideas about this?&lt;/p&gt;&#xA;" OwnerUserId="16964" LastEditorUserId="16964" LastEditDate="2015-07-20T19:25:42.177" LastActivityDate="2015-07-20T19:25:42.177" Title="Fit linear model to higher moments of CAPM" Tags="&lt;r&gt;&lt;statistics&gt;&lt;asset-pricing&gt;&lt;capm&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18947" PostTypeId="2" ParentId="18946" CreationDate="2015-07-20T08:30:32.940" Score="1" Body="&lt;p&gt;The R code is correct.&#xA;You could also use the &lt;code&gt;I()&lt;/code&gt; operator. You can look &lt;a href=&quot;https://cran.r-project.org/doc/manuals/R-intro.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; on page 53. The code then would be&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;lm(stock~market+I(market^2)+I(market^3), data=example)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;EDIT: going more into detail:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Doing the above you define regressors $market^2$ and $market^3$. The coefficients will be calculated the usual way (covariance of response with the regressors over variance of regressors .. in the matrix sense if needed).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the univariate case you get&#xA;$$&#xA;R_i = \beta R_M^2 + \epsilon&#xA;$$&#xA;with&#xA;$$&#xA;\beta = cov(R_i,R_M^2)/var(R_M^2).&#xA;$$&#xA;Plugging in definitions we get&#xA;$$&#xA;\beta = E[(R_i-E[R_i])(R_M^2-E[R_M^2])]/E[(R_M^2-E[R_M^2])^2].&#xA;$$&#xA;Note that the term $E[R_M^2]$ will be close to $VAR(R_M)$.&#xA;Thus the terms that appear are related to what you write but using the definitions we see that they are different.&#xA;Your definitions look similar to the concepts of &lt;a href=&quot;https://en.wikipedia.org/wiki/Coskewness&quot; rel=&quot;nofollow&quot;&gt;co-skewness&lt;/a&gt; and cokurtosis - but careful inspections again show that they are different.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-07-20T08:56:35.320" LastActivityDate="2015-07-20T08:56:35.320" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="18950" PostTypeId="1" AcceptedAnswerId="18951" CreationDate="2015-07-20T08:53:36.090" Score="2" ViewCount="293" Body="&lt;p&gt;Reading Glasserman - &quot;Monte Carlo Methods in Finance&quot; it says in the introduction to Chapter 6 - Discretization Methods, that moste models arising in derivatives pricing can be simulated only approximately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is in contrast to geometric brownian motion for which it is possible to simulate exactly at a finite set of dates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My interpretation is that it's always suboptimal to use discretization methods when the pricing problem merely involves geometric brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;b&gt;My question is&lt;/b&gt; when does it become necessary to use e.g. Milstein or Euler discretization? What are some common examples?&lt;/p&gt;&#xA;" OwnerUserId="5888" LastActivityDate="2019-06-16T19:56:54.697" Title="What are some examples of non-solvable SDE where Monte Carlo discretization is necessary" Tags="&lt;monte-carlo&gt;&lt;brownian-motion&gt;&lt;euler&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18951" PostTypeId="2" ParentId="18950" CreationDate="2015-07-20T10:13:09.193" Score="7" Body="&lt;p&gt;the LIBOR market model&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the Heston model -- Euler and Milstein are actually bad for this and much more sophisticated methods are necessary&lt;/p&gt;&#xA;&#xA;&lt;p&gt;local volatility models&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-07-20T10:13:09.193" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18952" PostTypeId="2" ParentId="18950" CreationDate="2015-07-20T10:15:51.850" Score="0" Body="&lt;p&gt;Monte Carlo simulation in the context Financial Modeling refers to a set of&#xA;techniques to generate artificial time series of the stock price,volatility  and interest rate and... overtime, from which option prices can be derived. There are several choices available in this regard. The first choice is to apply a standard method such as the Euler, Milstein, or implicit Milstein scheme, as described by &lt;a href=&quot;http://www.wiley.com/WileyCDA/WileyTitle/productCd-0471792519.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Gatheral&lt;/a&gt;  and &lt;a href=&quot;http://www2.math.uni-wuppertal.de/~kahl/publications/FastStrongApproximationMonteCarloSchemesForStochasticVolatilityModels.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Kahl and Jackel&lt;/a&gt;, for example. &lt;strong&gt;The advantage of these schemes is that they are easy to understand, and their convergence properties are famous&lt;/strong&gt;. The other choice is to use a method that is better suited, or that is specifically designed for the especial models. These methods include quadratic-exponential scheme of Andersen, the transformed volatility scheme of &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1153950&quot; rel=&quot;nofollow noreferrer&quot;&gt;Zhu&lt;/a&gt;, the scheme of &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.159.9333&quot; rel=&quot;nofollow noreferrer&quot;&gt;Alfonsi&lt;/a&gt;, or the moment-matching scheme of &lt;a href=&quot;http://www.risk.net/journal-of-computational-finance/technical-paper/2160448/extended-libor-market-models-stochastic-volatility&quot; rel=&quot;nofollow noreferrer&quot;&gt;Andersen,et al&lt;/a&gt;. &lt;strong&gt;These schemes are designed to have faster convergence to the true option price, and in some cases, to also avoid the negative variances that can sometimes be generated from standard methods&lt;/strong&gt;. These and other schemes are reviewed by Van Haastrecht and Pelsser (2010). Also, to valuing American options, you can use the simulation-based algorithm of &lt;a href=&quot;https://people.math.ethz.ch/~hjfurrer/teaching/LongstaffSchwartzAmericanOptionsLeastSquareMonteCarlo.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Longstaff and Schwartz&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastEditorUserId="16595" LastEditorDisplayName="user16891" LastEditDate="2019-06-16T19:56:54.697" LastActivityDate="2019-06-16T19:56:54.697" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="18954" PostTypeId="1" CreationDate="2015-07-20T11:19:39.937" Score="4" ViewCount="255" Body="&lt;p&gt;As my question states, the problem I am having is finding a sensible way to search a large space. Any help or insight that could be provided would be hugely appreciated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I am trying to search through a space of possible investment strategies. This space has been restricted to 3 possible assets (Equity, Cash and Bonds) across 100 years where strategies are constant for 10 years at a time. I have also constrained the area by only allowing 100% investment in one asset or a 50/50 split between two. All of the fund must be invested at each time. This means that there are 10 times to choose between 6 possible combinations of investments. I have already preformed a basic search of the space using a labour intensive method of Genetic Algorithms which requires me to choose suitably optimal strategies across larger times, working my way down to decades starting at 50 year blocks. However I believe that there would be a better solution but my lack of knowledge in optimization is hindering me here. A strategy is ran through a programme to provide quantiles of a fund life which are then matched to given criteria.This is what indicates the suitability of a strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been looking into using Bellman's equation but since it requires markovian assumptions I don't know if I can apply this. If anyone has any ideas that could be applied it would be a great help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If anything I've said requires clarification or if I have been a bit vague on some information please let me know. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="16967" LastActivityDate="2015-07-20T11:19:39.937" Title="How would it be possible to use Dynamic Programming to search a space of investment strategies to find an optimum?" Tags="&lt;programming&gt;&lt;optimization&gt;&lt;investment&gt;&lt;dynamic&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18956" PostTypeId="1" AcceptedAnswerId="21089" CreationDate="2015-07-20T13:45:38.093" Score="2" ViewCount="69" Body="&lt;p&gt;I am working on some consumption based asset pricing models. I am modelling consumption growth in several different ways. An obvious one is to model consumption growth as an AR(1) process:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$g_{t+1} = \phi_0 + \phi_1 g_t +\epsilon_{t+1 }$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $g_{t+1}$ is consumption growth. What are the implications of having $\phi_1=0$? What about $\phi_1=1$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In which case is consumption growth iid?&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-10-07T11:03:06.783" Title="Consumption Based Asset Pricing" Tags="&lt;asset-pricing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18957" PostTypeId="1" AcceptedAnswerId="41603" CreationDate="2015-07-20T18:26:45.997" Score="18" ViewCount="972" Body="&lt;p&gt;In their seminal paper &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/j.1540-6261.1993.tb04702.x/abstract&quot;&gt;Jegadeesh and Titman (1993)&lt;/a&gt; develop a statistical model to infer where moment comes from. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice they setup the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_{it}=\mu_i + b_i f_t +e_{it}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E(f_t)=E(e_{it})=cov(e_{it},f_t)=cov(e_{it},e_{j,t-1})=0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The implication of momentum is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E[(r_{it}-\bar{r_t})(r_{it-1}-\bar{r_{t-1}})]&amp;gt;0$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the equation above they get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E[(r_{it}-\bar{r_t})(r_{it-1}-\bar{r_{t-1}})]=\sigma^2_\mu+\sigma^2_bCov(f_t,f_{t-1})+\bar{\text{Cov}}(e_{it},e_{it-1})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is equation (3) of the above paper. &#xA;Does anyone know how do they get this?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Edit: I think I am close to the answer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E[(r_{it}-\bar{r_t})(r_{it-1}-\bar{r_{t-1}})]=E[r_{it} r_{it-1}]-E[r_{it}]E[ r_{it-1}] = E[(\mu_i + b_i f_t +e_{it})(\mu_i + b_i f_{t-1} +e_{it-1})]-\mu_i^2=E[\mu_i^2+\mu_ibf_{t-1}+\mu_ie_{it}+bf_t\mu_i+b^2f_tf_{t-1}+bf_te_{it-1}+\mu_ie_{it-1}+bf_{t-1}e_{it-1}+e_{it}e_{it-1}]-\mu_i^2=E[\mu_i^2+b^2f_tf_{t-1}+e_{it}e_{it-1}]-\mu_i^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am just now not sure:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Why can I factor out from the expectation $b^2f_tf_{t-1}=\sigma^2_bCov(f_t,f_{t-1})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Why is there a bar above the last covariance&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) What happened to the $\mu_i^2$ term?&lt;/p&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="16472" LastEditDate="2015-07-20T18:46:17.343" LastActivityDate="2018-09-13T10:23:49.290" Title="Momentum - Statistical Argument" Tags="&lt;momentum&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="16" ContentLicense="CC BY-SA 3.0" />
  <row Id="18958" PostTypeId="2" ParentId="15257" CreationDate="2015-07-20T21:15:58.637" Score="1" Body="&lt;p&gt;The Feynman-Kac theorem can be used in both directions. That is,&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;If we know that $r_t$ follows the Ito process as described by the following stochastic differential equation &#xA;\begin{align}&#xA;d{{r}_{t}}=\mu ({{r}_{t}},t)dt+\sigma ({{r}_{t}},t)d{{W}_{t}^{Q}}\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,(1)&#xA;\end{align}&#xA;and we are given a&#xA;function $Z(r,t; T)$ with boundary condition $Z(r,T; T)=1$, then we can always&#xA;obtain the solution for $Z(r,t; T)$ as Equation&#xA;\begin{align}&#xA;{{Z}_{t}}+\mu(r_t,t)\,{{Z}_{r}}\,+\frac{1}{2}{{\sigma }^{2}(r_t,t)}    {{Z}_{rr}}-{{r(t)}}\,Z=0\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,(2)&#xA;\end{align}&#xA;and with boundary condition $Z(r,T; T)=1$ The theorem asserts that $Z(r,t; T)$ has the solution&#xA;\begin{align}&#xA;Z(r,t;T)={{E}^{Q}}\left[ exp\left(-\int_{t}^{T}r_s\,ds\right)\underbrace{Z(r,T;T)}_{1}\,\,|{\mathcal{F}_{t}} \right](3)&#xA;\end{align} &lt;/li&gt;&#xA;&lt;li&gt;If we know that the solution to $Z(r,t; T)$ is given by equation $(3)$ and that $r_t$ follows the process in $(1)$ then we are assured that $Z(r,t; T)$  satisfies the PDE in Equation $(2)$. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerDisplayName="user16891" LastActivityDate="2015-07-20T21:15:58.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18959" PostTypeId="2" ParentId="17805" CreationDate="2015-07-20T22:11:23.580" Score="3" Body="&lt;p&gt;In the Hull-White model, $r_t$ follows the Ito process as described by the following stochastic differential equation &#xA;$$d{{r}_{t}}=(\alpha (t)-\beta (t)\,{{r}_{t}})dt+\sigma (t)d{{W}_{t}^Q}$$&#xA;let&#xA;$$K(t)=\int_{0}^{t}{\beta (u)\,du}$$&#xA;then the zero coupon bond price is given by equation&#xA;$$p(t\,,T)=exp\,[-A(t\ ,T)-r(t)B(t,T)\,]$$&#xA;where&#xA;\begin{align}&#xA;  &amp;amp; A(t\,,T)=\int_{t}^{T}{\left[ \alpha (u)\,{{e}^{K(u)}}\left( \int_{u}^{T}{{{e}^{-K(v)}}dv} \right)-\frac{1}{2}{{e}^{2K(u)}}{{\sigma }^{2}}(u){{\left( \int_{u}^{T}{{{e}^{-K(v)}}dv} \right)}^{2}}\, \right]}\,du \\ &#xA; &amp;amp; B(t\,,T)=\int_{t}^{T}{{{e}^{-K(v)}}}dv \\ &#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Hint&lt;/h2&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;By application of Ito's lemma, we have&#xA;$$r(t)={{e}^{-K(t)}}\left[ r(0)+\int_{0}^{t}{{{e}^{K(u)}}\alpha (u)\,du+\int_{0}^{t}{{{e}^{K(u)}}\sigma (u)\,d{{W}_{u}}}} \right]$$ &lt;/li&gt;&#xA;&lt;li&gt;$r_t$ is a normal process and&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;  &amp;amp; \mathbb{E^Q}[{{r}_{t}}]={{e}^{-K(t)}}\left[ r(0)+\int_{0}^{t}{{{e}^{K(u)}}\alpha (u)\,du} \right] \\ &#xA; &amp;amp; Var^Q({{r}_{t}})={{e}^{-2K(t)}}\int_{0}^{t}{{{e}^{2K(u)}}{{\sigma }^{2}}(u)\,du} \\ &#xA;\end{align}&#xA; 3. Compute $\int_{0}^{T}{r(t)\,dt}$ and use&#xA;$$P(t,T)=\mathbb{E^Q}\left[ exp\left( -\int_{t}^{{{T}^{{}}}}{r(u)du} \right)\left| \,{\mathcal {F}_{t}} \right. \right]$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastActivityDate="2015-07-20T22:11:23.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18960" PostTypeId="2" ParentId="18889" CreationDate="2015-07-21T00:14:35.300" Score="0" Body="&lt;p&gt;Removed incorrect answer. Sorry. Thank you Colin T Bowers&lt;/p&gt;&#xA;" OwnerUserId="185" LastEditorUserId="185" LastEditDate="2015-07-21T23:04:45.610" LastActivityDate="2015-07-21T23:04:45.610" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18961" PostTypeId="1" CreationDate="2015-07-21T01:29:22.060" Score="1" ViewCount="397" Body="&lt;p&gt;A stock option trader taught me yesterday that the correlation between the spot price of asset X and the variance of asset X is approximately -1. Can anyone give me a explanation why this is true?&lt;/p&gt;&#xA;" OwnerUserId="16977" LastActivityDate="2019-04-08T21:35:46.157" Title="Spot price and volatility has a correlation of -1, why?" Tags="&lt;statistics&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18962" PostTypeId="2" ParentId="18961" CreationDate="2015-07-21T01:57:57.983" Score="1" Body="&lt;p&gt;The statement is not correct as it stands for several reasons. First and foremost, it is only remotely meaningful if asset X is an option (or a similar type of derivative contract). Second, I think he meant 1, not -1. Third, correlation is probably not the best word to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The grounds for your trader friends statement is the work on option pricing theory done in the 1970's by Fischer Black, Myron Scholes, and Robert Merton &lt;a href=&quot;https://en.wikipedia.org/wiki/Black%E2%80%93Scholes_model&quot; rel=&quot;nofollow&quot;&gt;(see here)&lt;/a&gt; (although possibly Ed Thorpe beat them to it by a decade).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The model they developed demonstrated that if stock prices follow a continuous-time semi-martingale (essentially a mathematical construct that implies you can't predict the &lt;em&gt;direction&lt;/em&gt; in which stock prices will move), then the only relevant factor in determining the current price of an option is the volatility of the underlying security (that the option is written on). Strictly speaking, it is the volatility of the underlying security between the present time and the expiry time of the option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, if the model is correct, then an increase in volatility of the underlying will always simultaneously increase the present value of the option, while a decrease in volatility of the underlying will lead to a decrease in the value of the option. This implies the two are &lt;em&gt;positively&lt;/em&gt; correlated, which is why I asserted in the first paragraph that your trader friend probably meant 1, not -1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, correlation is a measure of linear response. But if you click through the link I provided above and have a look at the Black-Scholes-Merton formula, you'll notice that the relationship between the present value of the option and volatility is &lt;em&gt;non-linear&lt;/em&gt;. So correlation is not really the right word to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Two final thoughts: First, empirically, the Black-Scholes-Merton formula only holds approximately, so the word &quot;approximately&quot; in your traders sentence is important. Second, remember in all of this that &lt;em&gt;true&lt;/em&gt; volatility is &lt;em&gt;unobservable&lt;/em&gt;, even &lt;em&gt;ex-post&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps. I've deliberately avoided going into the details of the Black-Scholes-Merton model and equation as I don't think they're really necessary to answer the question.&lt;/p&gt;&#xA;" OwnerUserId="2998" LastEditorUserId="2998" LastEditDate="2015-07-21T02:05:26.980" LastActivityDate="2015-07-21T02:05:26.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18963" PostTypeId="1" AcceptedAnswerId="18964" CreationDate="2015-07-21T05:34:33.740" Score="3" ViewCount="2142" Body="&lt;p&gt;Under the P-measure, a geometric Brownian motion can be specified using the following SDE:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dS_t=\mu S_tdt+\sigma S_tdW_t^P$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and its Euler discretization is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S_{t+\Delta t}=S_t + \mu S_t \Delta t + \sigma S_t \sigma \sqrt{\Delta t}Zt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under the Q-measure, should the drift $\mu$ be substituted by $r$ or by $r-\frac{\sigma^2}{2}$?&lt;/p&gt;&#xA;" OwnerUserId="12214" LastEditorUserId="467" LastEditDate="2015-07-21T06:14:23.910" LastActivityDate="2015-07-21T08:30:19.710" Title="How to discretize a GBM under P- and Q-measures?" Tags="&lt;brownian-motion&gt;&lt;risk-neutral-measure&gt;&lt;simulations&gt;&lt;euler&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18964" PostTypeId="2" ParentId="18963" CreationDate="2015-07-21T06:06:55.497" Score="1" Body="&lt;p&gt;$r-\frac{\sigma^2}{2}$ for the drift only applies to the log-returns. The Euler discretisation simply discretises the SDE directly. You'd use the risk-free rate &#xA;for you drift under the risk-neutral measure for your question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your reference:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/fZE8B.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please read the &lt;a href=&quot;https://en.wikipedia.org/wiki/Geometric_Brownian_motion&quot; rel=&quot;nofollow noreferrer&quot;&gt;wikipedia&lt;/a&gt; for more details.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2015-07-21T06:06:55.497" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18965" PostTypeId="2" ParentId="18889" CreationDate="2015-07-21T07:03:12.690" Score="3" Body="&lt;p&gt;I'll address your questions in order:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1a) For TSRV constructed using high frequency returns from NYSE market open to market close on a single day, the output should be numbers on the order of magnitude of 1e-4 to 1e-5. In other words, your numbers look about right. I got these number from calculating TSRV for IBM data myself using Kevin Sheppard's MatLab code for TSRV.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1b) RV is &lt;em&gt;not&lt;/em&gt; called integrated variance in the literature. In a continuous-time modelling framework &lt;em&gt;without&lt;/em&gt; jumps or microstructure noise, RV is consistent for integrated variance. If you include jumps, RV incorporates the jump component and so is consistent for quadratic variation = integrated variance plus jump variance. If you include microstructure noise, RV diverges. Note, the other answerer on this question suggested that TSRV is consistent for integrated variance, but not quadratic variation. To my knowledge, this is incorrect. See my comment on that answer for more detail. (&lt;strong&gt;UPDATE:&lt;/strong&gt; The other answerer was thinking of bi-power variation BPV, not TSRV. Lot's of acronyms in this field :-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1c) If you want an estimate of the volatility of a return spanning market open to market close then take the square root of either RV, or TSRV, (calculated using high frequency data from market open to close) and that is a valid estimator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) The interpretation of the square root number is that it is the volatility of a return &lt;em&gt;that spans the same interval as the high frequency data you used to calculate the estimator&lt;/em&gt;. In the standard case, that is market open to market close.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Let $v_{t_a,t_b}$ denote a &lt;em&gt;variance&lt;/em&gt; estimator spanning the interval $[t_a, t_b]$. You can always scale it up or down using the square root of time (or just time if working with &lt;em&gt;volatility&lt;/em&gt;) so that all your estimators are on a consistent scale, e.g. annualized variance. But be aware, this is just a scaling trick so everything is measured in comparable units. Your estimator &lt;em&gt;still only relates to the variance of a return spanning the interval&lt;/em&gt; $[t_a, t_b]$. Actually interpreting your scaled variance estimator as the variance of a return spanning a longer interval, like a year, is only meaningful under very strict modelling assumptions (e.g. constant variance). Personally, I think it is cleaner to always store with your variance estimator some record of the period it spans and refer to that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) See question 3. You can scale your RV from two hours to be in comparable six hour units using the square root of the time (ie multiply by square root of 3). However, see the point I made above. It would be better to compare RV and TSRV estimators that both span the same interval, since if you do a comparison of the two-hour and six-hour estimators, you are implicitly disadvantaging the two-hour estimator unless true variance is constant over the six-hour interval (which it almost certainly is not if you're working with financial data).&lt;/p&gt;&#xA;" OwnerUserId="2998" LastEditorUserId="2998" LastEditDate="2017-04-06T23:44:27.027" LastActivityDate="2017-04-06T23:44:27.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18966" PostTypeId="2" ParentId="17083" CreationDate="2015-07-21T07:32:13.903" Score="1" Body="&lt;p&gt;Maybe it is better to use martingale theory to characterise whether it is an equality or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $S_t$ be a  (right)-continuous positive martingale with $S_0 &amp;lt; H$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\tau = \inf \{ t &amp;gt; 0| S_t = H \}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The option pays 1 unit of cash at $\tau$, and there is no maturity (perpetual option). What is the price of the option? I.e. compute&#xA;$$P_0 = \mathbb{E} \left(I_{\{ \tau &amp;lt; \infty \}}\right) = \mathbb{P}\left ( \tau &amp;lt; \infty\right).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the optional sampling theorem, the stopped process $S_{t \wedge \tau}$ is also a martingale. Therefore, we have&#xA;$$S_0 =  \mathbb{E}\left(S_{t \wedge \tau}\right) = \mathbb{E}\left(S_t I_{\{ t \leq \tau\}}\right) + \mathbb{E}\left(S_{\tau} I_{\{ \tau &amp;lt; t\}}\right).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking the limit $t \rightarrow \infty$ on both side and using the fact that $S_{\tau} = H$, we have&#xA;$$S_0 =  \lim_{t \rightarrow \infty} \mathbb{E}\left(S_t I_{\{ t \leq \tau\}}\right) + H \mathbb{P}\left ( \tau &amp;lt; \infty\right).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the dominated convergence theorem and the fact that any (right)-continuous positive martingale converges almost surely, we have&#xA;$$\lim_{t \rightarrow \infty} \mathbb{E}\left(S_t I_{\{ t \leq \tau\}}\right)  =  \mathbb{E}\left(S_{\infty} I_{\{ \tau = \infty\}}\right).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, $P_0 = S_0/H$ if only if  $\mathbb{E}\left(S_{\infty} I_{\{ \tau = \infty\}}\right) = 0$. In particular, if the martingale converges to zero this holds true. For example we can think of the GBM $S_t = S_0 \exp\left(\sigma B_t - 0.5 \sigma^2 t\right)$. It is a martingale converging to zero a.s. However, as a counter-example, we can think of $S_t + x$ with a positive constant $x &amp;gt; 0$. This process is still a martingale but it converges to $x &amp;gt; 0$ and&#xA;$$P_0 = \mathbb{P}\left ( \tau &amp;lt; \infty\right) &amp;lt; S_0/H.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, without any model assumption, I think that we can only claim that $P_0 \leq S_0/H$.&lt;/p&gt;&#xA;" OwnerUserId="16981" LastActivityDate="2015-07-21T07:32:13.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18968" PostTypeId="2" ParentId="18963" CreationDate="2015-07-21T08:11:45.247" Score="-1" Body="&lt;h2&gt;Girsanov'Theorem&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;let $\theta_t$ be an adapted procee such that the solution of SDE&#xA;$$dL_t=-L_t\, \theta_t \,dW_t , \, L_0=1$$&#xA;is a Martingale.We set $Q{{|}_{\mathcal{F}_t}}=L_t\,P{{|}_{\mathcal{F}_t}}$,then &#xA;$$W_{t}^{Q}=W_{t}^{P}+\int_{0}^{t} \theta_s\,ds$$&#xA;is a standard wiener process under Q measure.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Result&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Now we assume $\{S_t\}_{t\geq0}$ be a Geometric Brownian Motion. let $\theta=\frac{\mu-r}{\sigma}$ and $dL_t=-L_t\, \theta \,dW_t$. Then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$W_{t}^{Q}=W_{t}^{P}+\left(\frac{\mu-r}{\sigma}\right)t$$&#xA;is a standard wiener process under Q measure. As a result &#xA;$$dW_{t}^{Q}=dW_{t}^{P}+\frac{\mu-r}{\sigma}dt$$&#xA;and&#xA;$$&#xA;dS_t= \mu S_t dt+\sigma S_t dW_t^P=\mu S_t dt+\sigma \,S_t(dW_t^Q-\frac{\mu-r}{\sigma}dt)=r S_t dt+\sigma S_tdW_t^Q$$&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Euler scheme&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;First let $x_t=\ln S_t$, by application of Ito's lemma, we have &#xA;$$d{{x}_{t}}=\left( r-\frac{1}{2}{{\sigma }^{2}} \right)dt+\sigma d{{W}_{t}}$$&#xA;and&#xA;$$x_{t+\Delta t}=x_t+\left( r-\frac{1}{2}{{\sigma }^{2}} \right)\Delta t+\sigma (W_{t+\Delta t}-W_t)$$&#xA;but we know ${{W}_{t+\Delta t}}-{{W}_{t}}\sim N(0,\Delta t)$ then&#xA;$$x_{t+\Delta t}=x_t+\left( r-\frac{1}{2}{{\sigma }^{2}} \right)\Delta t+\sigma \sqrt{\Delta t }Z$$&#xA;where $Z$ is a standard normal stochastic Variable.&lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastEditorDisplayName="user16891" LastEditDate="2015-07-21T08:30:19.710" LastActivityDate="2015-07-21T08:30:19.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18969" PostTypeId="2" ParentId="17912" CreationDate="2015-07-21T12:04:02.803" Score="7" Body="&lt;p&gt;In any finite sample, it is always possible for the Zhou estimator to return a negative number, even though we know the unobservable parameter being estimated is non-negative. This is a well known issue in the academic literature. There are several approaches to dealing with this problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Ignore it. (I don't like this one). It is particularly nefarious if you ever move to a multivariate setting and you suddenly end up with a covariance matrix that is not positive semi-definite. (try taking the inverse of it and watch everything go to hell in your code).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Set your final estimator equal to $max(v, 0)$, where $v$ is the Zhou estimator. In practice, there is nothing wrong with this ad hoc estimator, although a pure theorist might get cross about the fact that the asymptotic distribution is affected. From a coding perspective, you might even want to use $max(v, \alpha)$ for some small positive constant $\alpha$ so you don't accidentally end up dividing by zero anywhere. NOTE: please do &lt;em&gt;not&lt;/em&gt; take the absolute value of the autocovariance portion of the estimator, as you mention in the question. This makes no sense from an estimation perspective and will result in a heavily biased estimator that is inconsistent even under ideal modelling assumptions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Use a different intraday-data based estimator of volatility that doesn't suffer from this problem. I strongly recommend this option. The Zhou estimator was state-of-the-art in 1996 (and that paper itself was astonishingly pre-scient - it took another decade for everyone else to catch on to the problems Zhou tried to solve in that paper), but a lot of work since then has demonstrated that it will be heavily biased for many high-frequency datasets, see e.g. Hansen, Lunde (2006) &quot;Realised Variance and Market Microstructure Noise&quot;. Probably the most popular estimator at the present point in time is the realised kernels estimator of Barndorff-Nielsen, Hansen, Lunde, and Shephard. The original 2008 paper is a bit heavy going for a non-theorist, but have a look at Barndorff-Nielsen, Hansen, Lunde, and Shephard (2009) &quot;Realized Kernels in Practice&quot; - it is much more friendly. (I have an implementation of this estimator in the Julia language based off this paper).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This estimator also has the nice property that if you use a Parzen kernel (see the above reference for more detail), then the estimator will always be non-negative. Be warned, for other types of kernel function, especially flat-top kernels, there is no guarantee of non-negativity. See eg footnote 2 of the above-mentioned paper.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want something simpler in that you can implement quickly, then just use a low sampling frequency realized variance, e.g. 5-minute realized variance or maybe 10-minute. Since this is just a sum of squared intrady returns, it is guaranteed to always be non-negative and will, in my experience, provide a better estimate than the Zhou estimator anyway.&lt;/p&gt;&#xA;" OwnerUserId="2998" LastEditorUserId="2998" LastEditDate="2015-07-22T03:58:43.190" LastActivityDate="2015-07-22T03:58:43.190" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="18970" PostTypeId="1" CreationDate="2015-07-21T13:56:03.040" Score="6" ViewCount="451" Body="&lt;p&gt;I am looking for any research about optimal strategies for gradually building (scaling in) positions inside a trend as well as optimal gradual exit strategies on pullbacks/reversals to minimise possible losses.&lt;/p&gt;&#xA;" OwnerUserId="16612" LastActivityDate="2015-07-25T23:41:02.870" Title="Is there any research on pyramiding techniques of entering/exiting a trend?" Tags="&lt;time-series&gt;&lt;quant-trading-strategies&gt;&lt;risk-management&gt;&lt;trading&gt;&lt;position-sizing&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18971" PostTypeId="1" CreationDate="2015-07-21T14:10:07.833" Score="3" ViewCount="877" Body="&lt;p&gt;In the paper Super-Whiteness of Returns Spectra from Erhard Reschenhofer&#xA;of University of Vienna it is commented the following&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Until the late 70’s the spectral densities of stock returns and stock&#xA;index returns exhibited a type of non-constancy that could be detected by&#xA;standard tests for white noise. Since then these tests have been unable to&#xA;find any substantial deviations from whiteness in stocks returns and index returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually, there is a striking power deficiency, which implies that&#xA;these series exhibit even fewer patterns than white noise. A typical frequency domain test for white noise rejects the null hypothesis whenever the time series contains sinusoidal components with too large amplitudes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under the null hypothesis of white noise, all amplitudes are roughly of&#xA;the same size, no amplitudes can be systematically larger than others. There is&#xA;a perfect uniformity. Amazingly, the amplitudes obtained from the S&amp;amp;P 500 returns appear even more uniform. This super-whiteness can not just be the result of random fluctuations. Something more must be at work besides chance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All in all, it seems that active traders contribute to market efficiency only up to a certain point. Beyond that point, their activities may lead to super-efficiency, which must on no account be misinterpreted as perfect efficiency but rather implies some special form of predictability.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This paper seems to imply that a portfolio should be taken as just white noise or better super white noise so basically there is no signal or if there is must be microcopic in power and that this super white noise must be a mix of superpossitioned different distribution white noises with additional noise components as to lead to this greater uniformity in amplitude than white noise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have any additional information on what processes could create this superwhite noise kindly let me know.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Power deficiency of significance of tests on the frequency domain for rolling windons of 5 years found after the 70s (data analyzed from the 50s). This significance results of tests with much lower rates than the rejection level of the null hipothesis implies that any deviation from the null hypothesis reveals that the spectrum should be greater at some frequencies and lower at others. &lt;/p&gt;&#xA;" OwnerUserId="7616" LastEditorUserId="7616" LastEditDate="2015-07-21T16:42:28.767" LastActivityDate="2015-07-21T16:42:28.767" Title="Are all stocks and stock indexes just white noise" Tags="&lt;r&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18972" PostTypeId="1" CreationDate="2015-07-21T14:21:15.347" Score="3" ViewCount="914" Body="&lt;p&gt;In Shreve II, exercise 1.8, he walks the reader through proving the derivative of a moment-generating function $\phi$ is equal to the expectation $\mathrm{E}[Xe^{tX}]$; i.e., &#xA;$$&#xA;\phi^\prime(t) = \mathrm{E}[Xe^{tX}].&#xA;$$&#xA;He does this first assuming $X$ is nonnegative and asks the reader to use the dominated congergence theorem along with the mean value theorem, then asks the reader to prove it for an integrable $X$ by considering the positive and negative parts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, is all this machinery necessary for this exercise?  Assuming $X$ has a density function $f$, I would prove this result by&#xA;$$&#xA;\phi^\prime(t) = \frac{d}{dt}\int_{0}^\infty e^{tx}f(x) dx = \int_{0}^\infty \frac{d}{dt}e^{tx}f(x) dx = \int_{0}^\infty xe^{tx}f(x) dx = \mathrm{E}[Xe^{tX}],&#xA;$$&#xA;where I guess I would have to justify moving the derivative inside the integral (is it enough that $e^{tx}$ is continuous in $t$?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, is this more rigorous proof in Shreve just to show it holds if $X$ doesn't have a density?  Or perhaps just to practice using the dominated convergence theorem?  I wish authors would state the spirit behind their exercises...&lt;/p&gt;&#xA;" OwnerUserId="6866" LastEditorDisplayName="user16891" LastEditDate="2015-07-21T15:44:25.627" LastActivityDate="2015-11-19T00:04:14.687" Title="Proving Derivative Property of Moment-Generating Function" Tags="&lt;probability&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18973" PostTypeId="2" ParentId="18971" CreationDate="2015-07-21T14:45:58.973" Score="1" Body="&lt;p&gt;First. Use quotes around the quoted part of this question to make it clear what isn't your opinion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second. White noise is exactly what efficiency should generate. This para. neither makes sense nor is supported (if the support is elsewhere in the quoted article please post it). My questions in parentheses prefaced with &quot;AC&quot;: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Under the null hypothesis of white noise, all amplitudes are roughly of the same size, no amplitudes can be systematically larger than others. There is a perfect uniformity. Amazingly, the amplitudes obtained from the S&amp;amp;P 500 returns appear even more uniform (AC: explain. White noise is defined as mean-variance stationary IID). This super-whiteness can not just be the result of random fluctuations (AC: why not? White noise would appear to be defined as random fluctuations). Something more must be at work besides chance. (AC: ?)&quot; &lt;/p&gt;&#xA;" OwnerUserId="13902" LastActivityDate="2015-07-21T14:45:58.973" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="18974" PostTypeId="2" ParentId="17819" CreationDate="2015-07-21T15:17:58.383" Score="2" Body="&lt;p&gt;You can try premiumdata.net. Among several sources I used this provides most clean data. They account for splits and dividends. Delisted securities are present in the data. This is not free but the price is modest for this quality for my point of view. They provide EOD data for US, Australian and Singapore stock exchanges.&lt;/p&gt;&#xA;" OwnerUserId="16805" LastActivityDate="2015-07-21T15:17:58.383" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18975" PostTypeId="2" ParentId="18972" CreationDate="2015-07-21T17:05:53.553" Score="2" Body="&lt;p&gt;As Sherev has said, first let $\varphi(t)=E\left[e^{tX}\right]$ then&#xA;$$\varphi '(t)=\underset{s\to t}{\mathop{\lim }}\,\frac{\varphi (t)-\varphi (s)}{t-s}=\underset{s\to t}{\mathop{\lim }}\,\frac{E[{{e}^{tX}}]-E[{{e}^{sX}}]}{t-s}=\underset{s\to t}{\mathop{\lim }}\,E\left[ \frac{{{e}^{tX}}-{{e}^{sX}}}{t-s} \right]$$&#xA;Sherev continue ,we can choose a sequence of numbers $\{s_n\}_{n=1}^{\infty}$ that converges to $t$ and compute&#xA;$$\underset{s_n\to t}{\mathop{\lim }}\,E\left[ \frac{{{e}^{tX}}-{{e}^{s_nX}}}{t-s_n} \right]$$&#xA;where now we are taking a limit of the expectations of the sequence of random&#xA;variables.&#xA;$$Y_n=\frac{{{e}^{tX}}-{{e}^{s_nX}}}{t-s_n}$$&#xA;he fixes $\omega\in \Omega$ and by application of Mean Value Theorem concludes&#xA;$$e^{tX(\omega)}-e^{s_nX(\omega)}=(t-s_n)X(\omega)e^{\theta(\omega )X(\omega)}$$&#xA;where $\theta(\omega)$ is a number depending on $\omega$ such that $s_n\leq\theta(\omega)\leq t$.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;$$|Y_n|=\left|\frac{e^{tX(\omega)}-e^{s_nX(\omega)}}{t-s_n}\right|\leq X(\omega) e^{\theta(\omega )X(\omega)}\leq X(\omega) e^{2t\,X(\omega)}$$&#xA;So by the Dominated Convergence Theorem we have &#xA;$$\varphi'(t)=\underset{n\to \infty }{\mathop{\lim }}\,E[{{Y}_{n}}]=E[\underset{n\to \infty }{\mathop{\lim }}\,{{Y}_{n}}]=E[X{{e}^{tX}}]$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastEditorDisplayName="user16891" LastEditDate="2015-07-21T21:25:23.620" LastActivityDate="2015-07-21T21:25:23.620" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18976" PostTypeId="1" CreationDate="2015-07-21T21:45:08.300" Score="7" ViewCount="542" Body="&lt;p&gt;I am trying to determine the parameters for the Nelson Siegel Svensson model and am solving a Non- Linear Optimization problem to do this. Some of the code I have written is below and this is where my problem lies as I find that some of my discount factors are of the order 10^-30 and I don't know where I am going wrong. I am using the procedure presented in Pg. 5 of &lt;a href=&quot;http://webcache.googleusercontent.com/search?q=cache:2mNOF_yPvqAJ:www.vse.cz/polek/download.php%3Fjnl%3Defaj%26pdf%3D9.pdf+&amp;amp;cd=3&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;gl=us&quot; rel=&quot;noreferrer&quot;&gt;this paper&lt;/a&gt;. &lt;code&gt;df&lt;/code&gt; is a dataframe which consists of observed bond data. All coupon payments will take place in 6 month intervals. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def calculatingprices(df, beta_0, beta_1, beta_2, beta_3, tau_1, tau_2):&#xA;    #I am just creating a dict 'd' which will have the months to maturity for each bond as keys and &#xA;    #a list as its values. The lists will contain the months to maturity - payments associated &#xA;    #with the bond &#xA;    months_to_maturity_matrix = df['months_to_maturity'].values&#xA;    number_of_rows = df.shape[0]&#xA;    theoretical_price_for_bonds = np.zeros((number_of_rows, 1))&#xA;    d = {}&#xA;    for months_to_maturity_bond in months_to_maturity_matrix: &#xA;        l = []&#xA;        #Adding the difference in dates to the dict d. Differences, will just be multiples of 6 upto 360 (i.e. the 30 year bond)&#xA;        for i in range(6, 360, 6):                  &#xA;            if i &amp;lt;= months_to_maturity_bond:&#xA;                l.append(months_to_maturity_bond - i)&#xA;            else:&#xA;                l.append(0)    &#xA;                d[months_to_maturity_bond] = l                  &#xA;                d_ordered = collections.OrderedDict(sorted(d.items()))&#xA;&#xA;#I then use the formula for the discount factor as follows&#xA;for x, value in np.ndenumerate(months_to_maturity_matrix):&#xA;    diff_between_maturity_and_payments_array = np.array(d_ordered[value])&#xA;    years_diff_between_maturity_and_payments_array = diff_between_maturity_and_payments_array/12&#xA;    theoretical_discount_factor = np.exp(-years_diff_between_maturity_and_payments_array * (beta_0 + ((beta_1 + beta_2)*((1-np.exp(-years_diff_between_maturity_and_payments_array/tau_1))/years_diff_between_maturity_and_payments_array/tau_1))-(beta_2*np.exp(-years_diff_between_maturity_and_payments_array/tau_1)) + (beta_3*(((1-np.exp(-years_diff_between_maturity_and_payments_array/tau_2))/years_diff_between_maturity_and_payments_array/tau_2) -np.exp(-years_diff_between_maturity_and_payments_array/tau_2)))))                                &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: Please let me know if I need to provide more information. I realize in the paper I have cited they just consider the Nelson Siegel model, however in the code above I have accounted for the extra parameters associated with the Nelson Siegel Svensson model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank You&lt;/p&gt;&#xA;" OwnerUserId="11917" LastEditorUserId="11917" LastEditDate="2015-07-22T15:27:52.960" LastActivityDate="2018-08-06T11:01:01.477" Title="Wrong discount factors when finding Nelson Siegel Svensson model parameters" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;yield-curve&gt;&lt;python&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18977" PostTypeId="2" ParentId="18961" CreationDate="2015-07-21T22:02:03.173" Score="5" Body="&lt;p&gt;I think the trader was referring to the &lt;a href=&quot;https://brainmass.com/file/285288/Black_75.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;leverage effect&lt;/a&gt;: stock price &lt;strong&gt;changes&lt;/strong&gt; (not stock price) are negatively correlated with volatility. Stock price and stock price change (i.e. returns) are not the same thing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we consider variance and option pricing, then there are pricing models (example: &lt;a href=&quot;https://en.wikipedia.org/wiki/Heston_model&quot; rel=&quot;nofollow noreferrer&quot;&gt;Heston model&lt;/a&gt;) that represent the stock price evolution and the evolution of the variance of the stock price. The correlation between the two quantities is also considered and often it will be negative. This may be what the stock option trader was referring to, but assuming always a -1 correlation is a big approximation.&lt;/p&gt;&#xA;" OwnerUserId="7405" LastEditorUserId="7405" LastEditDate="2019-04-08T21:35:46.157" LastActivityDate="2019-04-08T21:35:46.157" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="18978" PostTypeId="2" ParentId="18976" CreationDate="2015-07-22T08:45:12.143" Score="1" Body="&lt;p&gt;if I read it correctly the paper you mention is about Nelson-Siegel and not Nelson-Siegel Svensson. The easier way to cross check it is to simply start by fixing theta and estimate the remaining parameters by OLS. If that works, then the optimization algorithm should work similarly. Below I attach a simple matlab code that does it and that you can adapt for your purposes:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    % Define yield structure used in the estimation&#xA;maturity = [ 1/12; 2/12; 3/12; 4/12; 5/12; 6/12; 9/12; 12/12; 18/12; 24/12;];&#xA;&#xA;&#xA;%************************    PARAMETERS     *****************************&#xA;&#xA;yn = size(maturity,1);  % number of yields&#xA;lamda=0.3;         % as in Diebold, Rudebusch and Aruoba(2003)&#xA;Roll=1;              % Rolling estimation (1) or recursive estimation (0).&#xA;length = size(xdata,1); % data length&#xA;&#xA;&#xA;&#xA;%% Ex 2-1).Calculate and plot Nelson-Siegel factor loadings, given lamda.&#xA;mat = 1:1:120; &#xA;pNS1 = ones(1,120); &#xA;pNS2 = zeros(1,120); &#xA;pNS3 = zeros(1,120);&#xA;for imat = 1:120;&#xA;    pNS2(imat) = exp(-(imat/12)/lamda);&#xA;    pNS3(imat) = ((imat/12)/lamda)*exp(-(imat/12)/lamda);&#xA;end;&#xA;&#xA;&#xA;&#xA;&#xA;CCw = [pNS1; pNS2; pNS3]'; %Coefficient matrix for all maturity 1:120&#xA;CC = CCw((maturity')*12,:);&#xA;&#xA;&#xA;% Extract (Estimate) Nelson-Siegel factors for yields by OLS.&#xA;yield= xdata(1:length,1:10);  &#xA;NS = ((CC'*CC)\eye(size(CC,2)))*CC'*yield';&#xA;&#xA;&#xA;&#xA;   % Plot the NS factors and their empirical proxies&#xA;   tm = dates;&#xA;   tm = tm';&#xA;   figure(2)&#xA;   subplot(3,1,1)&#xA;     ymin = min(NS(1,:))-0.05; ymax = max(NS(1,:))+0.05;&#xA;     plot(tm,NS(1,:),'r-', tm, yield(:,10), 'b:');&#xA;     h = legend('NS 1st factor','2year yield',1);&#xA;     axis([tm(1),tm(length),ymin,ymax])  &#xA;     %xlabel('Time')&#xA;     ylabel('%')&#xA;     %title('');&#xA;&#xA;   subplot(3,1,2)&#xA;     plot(tm,NS(2,:),'r-', tm, -(yield(:,10)-yield(:,1)), 'b:');&#xA;     h = legend('NS 2nd factor',' -(2year - 1month)',1);&#xA;     axis([tm(1),tm(length),min(NS(2,:))-0.05,max(NS(2,:))+0.05])&#xA;     %xlabel('Time')&#xA;     ylabel('%')&#xA;     %title('');&#xA;&#xA;   subplot(3,1,3)&#xA;     plot(tm,NS(3,:),'r-', tm, 2*yield(:,3)-(yield(:,1)+yield(:,10)), 'b:');&#xA;     h = legend('NS 3rd factor','2*3month - (1month + 24month)',1);&#xA;      axis([tm(1),tm(length),min(NS(2,:))-0.05,max(NS(2,:))+0.05])&#xA;     xlabel('Time')&#xA;     ylabel('%')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="16472" LastEditDate="2015-07-22T11:36:33.213" LastActivityDate="2015-07-22T11:36:33.213" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18979" PostTypeId="1" CreationDate="2015-07-22T15:07:01.413" Score="1" ViewCount="450" Body="&lt;p&gt;Consider the following plot, courtesy of &lt;a href=&quot;http://financialexamhelp123.com/cal-vs-cml-vs-sml/&quot; rel=&quot;nofollow noreferrer&quot;&gt;this page&lt;/a&gt;:&lt;a href=&quot;https://i.stack.imgur.com/acIku.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/acIku.png&quot; alt=&quot;cal&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the $y$-axis, how does this &quot;expected return&quot; relate to the &quot;instantaneous expected return&quot; in a geometric Brownian motion (GBM)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g., assume each stock price follows $dS(t) = \mu S(t) dt + \sigma S(t) dW(t)$, and so $S(t) = S(0)\exp\left(\left(\mu - \frac{\sigma^2}{2}\right)t + \sigma \sqrt{t} Z\right)$ where $Z \sim \mathcal{N}(0,1)$.  Then I would calculate the (annual) expected return as &#xA;$$&#xA;\mathrm{E}\left[\frac{S(1)}{S(0)} - 1\right] = \mathrm{E}\left[\exp\left(\mu - \frac{\sigma^2}{2} + \sigma Z\right)\right] - 1 = \exp\left(\mu - \frac{\sigma^2}{2} + \frac{\sigma^2}{2}\right) - 1 = e^\mu - 1,&#xA;$$&#xA;where the second equality is from the moment-generating function of a normal random variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take Portfolio A in the plot and suppose it's just a single stock, driven by the GBM above with instantaneous rate of return $\mu$.  Portfolio A has an &quot;expected return&quot; of $8\%$.  So, which of the following (if any) do we mean?&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$e^\mu - 1 = 8\%$&lt;/li&gt;&#xA;&lt;li&gt;$\mu = 8\%$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2015-07-22T16:18:01.357" Title="What Exactly is Expected Return" Tags="&lt;modern-portfolio-theory&gt;&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18980" PostTypeId="1" CreationDate="2015-07-22T16:02:05.750" Score="3" ViewCount="400" Body="&lt;p&gt;I have a question regarding the usage of European vs American Options. According to Professional Risk Mgr Handbook 2010, American-style options are used mostly on equities whereas European-style options are used on equity index options like Eurostoxx 50. Why is this the case?&lt;/p&gt;&#xA;" OwnerUserId="16995" LastEditorUserId="6101" LastEditDate="2015-07-24T19:36:48.777" LastActivityDate="2015-07-24T19:36:48.777" Title="American vs European Options on equity index options" Tags="&lt;options&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18981" PostTypeId="2" ParentId="18979" CreationDate="2015-07-22T16:18:01.357" Score="1" Body="&lt;p&gt;Suppose we have no dividends like in Black-Scholes-Merton and in your example. Expected return between time $t$ and $t+\Delta t$ is defined as&#xA;$$&#xA;\mathbb{E}_t\left[R_{t+\Delta t}\right]\equiv\mathbb{E}_t\left[\frac{S_{t+\Delta t} - S_t}{S_t}\right] = \mathbb{E}_t\left[\frac{\Delta S_t}{S_t}\right]&#xA;$$&#xA;You can see that, as $\Delta t \to dt$, $\mathbb{E}_t\left[\frac{\Delta S_t}{S_t}\right] \to \mathbb{E}_t\left[\frac{dS_t}{S_t}\right] = \mu dt$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding your question, $\mu$ is the instantaneous rate of return so $e^\mu - 1 = 8\%$. Alternatively, you know that rate of returns should be defined for a certain timeframe (e.g. 4% per semester, 8% per year etc…) and with some compounding method (e.g. yearly compounding, quarterly compounding etc…). &#xA;$\mu$ is the annual nominal expected interest rate obtained by continuous compounding. &lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2015-07-22T16:18:01.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18982" PostTypeId="1" CreationDate="2015-07-22T16:23:29.597" Score="3" ViewCount="144" Body="&lt;p&gt;I'm writing software for calculating distribution waterfalls. When displaying the results of a particular calculation, I want to show amounts that correspond to specific provisions in the relevant LPA. When showing the distribution waterfall structure for a fund or other entity, I'd like to title the list of components of that structure. Is 'provision' the relevant term? Or is there another term that is used for these components?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My team is currently using the term 'tranch' ('tranche') internally, and it seems to at least roughly correspond to how that term is used, but it doesn't seem to be used when describing waterfalls.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that I'm not asking about a term or phrase for particular (standard) provisions, e.g. 'recovery phase', 'catchup phase', 'clawback'. I would like to know if a term (or phrase) covers all such possible components in general. The intended audience handles a wide variety of agreements with many different types of components, so I'd like to know of a term they'd recognize and readily understand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some candidates:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Phase&lt;/li&gt;&#xA;&lt;li&gt;Provision&lt;/li&gt;&#xA;&lt;li&gt;Tranche&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="16996" LastActivityDate="2015-07-22T17:32:18.210" Title="Standard term for the components of a distribution waterfall?" Tags="&lt;terminology&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="18983" PostTypeId="2" ParentId="18982" CreationDate="2015-07-22T17:32:18.210" Score="2" Body="&lt;p&gt;It depends on what the LPA stipulates. I worked in PE for couple of years and we would title the cash flow waterfall as &quot;Cash-flow waterfall&quot; and then name each component accordingly (e.g. Total released cashflow, investors cashflow up to subscribed capital, Investors up to hurdle, Mangt Company up to catch-up, etc.)&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-07-22T17:32:18.210" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18984" PostTypeId="1" AcceptedAnswerId="19000" CreationDate="2015-07-22T18:16:53.647" Score="1" ViewCount="252" Body="&lt;p&gt;I'm new to quantlib. I am trying to construct a PiecewiseYieldCurve. I been looking at the implementation of FRA. It seems that the start date of the FRA must be an integer number of month from the valuation date. How do I implement an FRA with a start date that is shifted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Valuation date: Jan 9, 2012&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Start date of the first 3m FRA: Mar 19, 2012&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rate of the first 3m FRA: 0.01&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="16998" LastActivityDate="2015-07-24T01:24:54.693" Title="Quantlib FRA with shifted start date" Tags="&lt;quantlib&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18986" PostTypeId="1" CreationDate="2015-07-22T20:35:39.580" Score="1" ViewCount="291" Body="&lt;p&gt;I want to solve an exotic options of PIDE by Numerical Methods.I just focus on the integral part of PIDE and want to underestand some tips on numerical solution of how to numerically solve it. Exactly I just consider &#xA;$$\int_{-\infty}^{\infty}(F(e^yS_{t^{-}},t)-F(S_{t^{-}},t))k(y)dy$$&#xA;I am going to solve numerically for the given Lévy density&#xA;$$k(y)=\frac{e^{-\lambda_p y}}{v\,y}1_{y&amp;gt;0}+\frac{e^{-\lambda_n |y|}}{v\,|y|}1_{y&amp;lt;0}$$&#xA;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="17002" LastActivityDate="2015-09-21T23:15:47.840" Title="Numerical Solutions for PIDE" Tags="&lt;options&gt;&lt;numerical-methods&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18987" PostTypeId="1" CreationDate="2015-07-22T21:08:24.640" Score="0" ViewCount="1100" Body="&lt;p&gt;I am trying to determine the parameters for the Nelson Siegel Svensson model and am solving a Non- Linear Optimization problem to do this. I am using the procedure presented in &lt;a href=&quot;http://webcache.googleusercontent.com/search?q=cache:2mNOF_yPvqAJ:www.vse.cz/polek/download.php%3Fjnl%3Defaj%26pdf%3D9.pdf%20&amp;amp;cd=3&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;gl=us&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way I am currently thinking of the set-up is as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bond 1 is associated with vector $m_1$ which contains all the differences between times to maturity and times of each of the payments for Bond 1. For example, if Bond 1 has 24 months to maturity and has semi_annual coupons $m_1 = [18,12,6,0]$. However, the paper suggests that even the face value needs to be included in $c_{ij}$. But the equation $\sum\limits_{j=1}^{l_i}c_{ij}*d(m_{ij}, \theta)$ gives a very low value for the price of the bond as the  $d(m_{ij}, \theta)$ values are turning out to be very small (of the order 10^-34 through to 10^-1, for each bond, as the differences between times to maturity and time of the payment decreases). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;So, am I correct in thinking that each bond is associated with a different discount factor vector as $m_{ij}$ changes for each bond?&lt;/em&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;I guess my main issue is, am I interpreting $m_{ij}$ correctly and hence correctly calculating the discount factors the right way, as I find that they are very small and hence the prices are very small and only got a reasonable answer for the parameters when I take the discount factor to be 1 when $c_{ij} = Face value + Coupon$&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I realize in the paper I have cited they just consider the Nelson Siegel model, however in the code I have written below I account for the extra parameters associated with the Nelson Siegel Svensson model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the code that I am using to determine the prices, where &lt;code&gt;df&lt;/code&gt; contains all  the observed market data:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def calculatingprices(df, beta_0, beta_1, beta_2, beta_3, tau_1, tau_2):&#xA;    #I am just creating a dict 'd' which will have the months to maturity for each bond as keys and &#xA;    #a list as its values. The lists will contain the months to maturity - payments associated &#xA;    #with the bond &#xA;    months_to_maturity_matrix = df['months_to_maturity'].values&#xA;    number_of_rows = df.shape[0]&#xA;    theoretical_price_for_bonds = np.zeros((number_of_rows, 1))&#xA;    d = {}&#xA;    for months_to_maturity_bond in months_to_maturity_matrix: &#xA;        l = []&#xA;        #Adding the difference in dates to the dict d. Differences, will just be multiples of 6 upto 360 (i.e. the 30 year bond)&#xA;        for i in range(6, 360, 6):                  &#xA;            if i &amp;lt;= months_to_maturity_bond:&#xA;                l.append(months_to_maturity_bond - i)&#xA;            else:&#xA;                l.append(0)    &#xA;                d[months_to_maturity_bond] = l                  &#xA;        d_ordered = collections.OrderedDict(sorted(d.items()))&#xA;&#xA;#I then use the formula for the discount factor as follows&#xA;    for x, value in np.ndenumerate(months_to_maturity_matrix):&#xA;        diff_between_maturity_and_payments_array = np.array(d_ordered[value])&#xA;        years_diff_between_maturity_and_payments_array = diff_between_maturity_and_payments_array/12&#xA;        theoretical_discount_factor = np.exp(-years_diff_between_maturity_and_payments_array * (beta_0 + ((beta_1 + beta_2)*((1-np.exp(-years_diff_between_maturity_and_payments_array/tau_1))/years_diff_between_maturity_and_payments_array/tau_1))-(beta_2*np.exp(-years_diff_between_maturity_and_payments_array/tau_1)) + (beta_3*(((1-np.exp(-years_diff_between_maturity_and_payments_array/tau_2))/years_diff_between_maturity_and_payments_array/tau_2) -np.exp(-years_diff_between_maturity_and_payments_array/tau_2)))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thank You&lt;/p&gt;&#xA;" OwnerUserId="11917" LastEditorUserId="11917" LastEditDate="2015-07-25T04:22:19.203" LastActivityDate="2015-07-25T04:22:19.203" Title="Understanding how to obtain Nelson Siegel Svensson parameters" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;yield-curve&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18988" PostTypeId="2" ParentId="8364" CreationDate="2015-07-22T22:55:42.260" Score="-1" Body="&lt;p&gt;The Laplace transform of the integrated process CIR process is given by, see e.g. Dufresne (2001). you can download it&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.ressources-actuarielles.net/EXT/ISFA/1226.nsf/0/3198727f14369487c1256e780050bd87/$FILE/DUFRESNE%20%5B2001%5D.pdf&quot; rel=&quot;nofollow&quot;&gt;The integrated square-root process&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerDisplayName="user16891" LastActivityDate="2015-07-22T22:55:42.260" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18989" PostTypeId="2" ParentId="18980" CreationDate="2015-07-23T00:40:32.160" Score="2" Body="&lt;p&gt;It is an attempt to make a general statement that is not entirely correct, and  certainly will become increasingly incorrect as new products are introduced. It is true that individual stock options traded in the US are American exercise. And the index options that are traded on the CBOE are European type, however there are also index options traded on the CME which are American. Also, I am not familiar with the situation in other countries, but it is unlikely that this pattern fits everywhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it is just a generalization valid for the US in 2010 but with some exceptions (the CME options) even in that case. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reasons are historical (choices that were made by option exchanges long ago) rather than anything substantial.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2015-07-23T00:48:59.373" LastActivityDate="2015-07-23T00:48:59.373" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="18990" PostTypeId="1" AcceptedAnswerId="18993" CreationDate="2015-07-23T02:01:58.770" Score="2" ViewCount="4782" Body="&lt;p&gt;I'm a little embarrassed about this because I have a PhD in math, but I'm having a little trouble working out how to bootstrap an OIS curve from libor rates and basis swap rates. If I had an equation for valuing everything I'd be set. What I have is a libor curve and a mysterious rate (US dollar OIS) coming from Bloomberg that is somehow related to basis swaps. I have been told that the basis swaps are between Libor and OIS, and I don't know what the equation for that looks like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For some background, I just learned how to value a swap today, and from that I was able to figure out how to bootstrap the libor curve. I just need an equation to fit the numbers into. I've gotten loads of verbal explanations, so no need to go out of your way to provide one. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="16684" LastActivityDate="2015-07-23T17:12:35.173" Title="Libor OIS basis swap equation" Tags="&lt;swaps&gt;&lt;libor&gt;&lt;ois-discounting&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="18991" PostTypeId="2" ParentId="18980" CreationDate="2015-07-23T07:15:39.070" Score="-1" Body="&lt;p&gt;You asked genuine question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remember one thing always, volatility is considered good by derivative players but not by the market as whole. More volatile is market, more riskier it is. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since American option can be exercised at any time, whereas European options can only be exercised at the maturity only, so American options leads to excess volatility that would be otherwise either without the options or American options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regulator always aim to keep the volatility within a specific bound, since excess volatility would discourage investor for investing into the market, so they prefer European style option for both i.e. for index and individual stock. But American type is the first preference of speculator always. What is chosen at the end, believe me, depend on the bargaining power of both group i.e. regulator and speculator. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since Index is the broad indicator of market performance it is the first thing seen by the investor before investing into the market. So regulators keep Index option as European and while Individual stock options as American. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some countries might have American style option for both but now can understand why it is so.&lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2015-07-23T07:15:39.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18993" PostTypeId="2" ParentId="18990" CreationDate="2015-07-23T14:15:19.767" Score="4" Body="&lt;p&gt;An OIS, or Overnight Index Swap, is an interest rate swap whose floating leg payments are calculated as a geometric average of the daily fixings of some underlying O/N or T/N index (these indices are generally volume-weighted averages of reported daily transactions). The annualized floating leg rate is defined as&#xA;$$&#xA;c_T^{float} = \frac{\prod^{s+T}_{t=s}{(1+r_t\delta (t))}-1}{\delta (T-s)},&#xA;$$&#xA;where $s$ is the first fixing day of the coupon period and $T$ is the last. $r$ is the value of the underlying index at time $t$, and $\delta (\cdot)$ is the year fraction according to an appropriate day count convention.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A basis swap is an exchange of one floating rate for another. In this case, it refers to the exchange of USD Libor for USD OIS or vice versa. Generally, if we refer to the two bases in a basis swap as $\alpha$ and $\beta$ and you are fixed payer in the swap with basis $\alpha$, your basis swap rate (or fixed rate spread) is&#xA;$$&#xA;r_{basis swap} = c^{fixed}_\beta-c^{fixed}_\alpha,&#xA;$$&#xA;where $c_b^{fixed}$ is the fixed coupon rate for a interest rate swap with basis $b$. From here on out, you may derive your implied OIS rates from the two rates and bootstrap as normal.&lt;/p&gt;&#xA;" OwnerUserId="16914" LastEditorUserId="16914" LastEditDate="2015-07-23T17:12:35.173" LastActivityDate="2015-07-23T17:12:35.173" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18994" PostTypeId="2" ParentId="18986" CreationDate="2015-07-23T18:04:38.260" Score="2" Body="&lt;p&gt;Without loss of generality, we can assume $y&amp;gt;0$.let $x =\ln S_t$ and defining $\tilde{F}(x, t)=F(S, t)$ we have&#xA;$$\int_{0}^{\infty}(\,{F}(e^yS_{t^{-}},t)-{F}(S_{t^{-}},t)\,)k(y)\,dy=\int_{0}^{\infty}(\,\tilde F(x+y,t)-\tilde F(x,t)\,)k(y)\,dy$$&#xA;Beginning,it is natural to look at the following interval first&#xA;$$\int_{0}^{\Delta x}(\,\tilde{F}(x+y,t)-\tilde{F}(x,t)\,)\,k(y)dy$$&#xA;for some small $\Delta x &amp;gt; 0$. Using Taylor expansion, we can write $\tilde {F} (x + y, t)$ as follows:&#xA;$$\tilde{F}(x+y,t)=\tilde{F}(x,t)+y\frac{\partial\tilde{F}}{\partial x}(x,t)+\frac{1}{2}y^2\frac{\partial^2\tilde{F}}{\partial x^2}(\xi,t)$$&#xA;or equivalently&#xA;$$\tilde{F}(x+y,t)-\tilde{F}(x,t)=y\frac{\partial\tilde{F}}{\partial x}(x,t)+O(y^2)$$&#xA;Substituting and we get&#xA;\begin{align}&#xA;&amp;amp;\int_{0}^{\Delta x}(\,\tilde{F}(x+y,t)-\tilde{F}(x,t)\,)\,k(y)dy=\int_{0}^{\Delta x}y\frac{\partial\tilde{F}}{\partial x}(x,t)\,k(y)dy\\&#xA;&amp;amp;\\&#xA;&amp;amp;\hspace{7.25cm}=\frac{\partial\tilde{F}}{\partial x}(x,t) \int_{0}^{\Delta x}y\,\frac{e^{-\lambda_p y}}{v\,y}1_{y&amp;gt;0}\,dy\\&#xA;&amp;amp;\\&#xA;&amp;amp;\hspace{7.25cm}=\frac{1}{v}\frac{\partial\tilde{F}}{\partial x}(x,t) \int_{0}^{\Delta x}e^{-\lambda_p y}\,dy\\&#xA;&amp;amp;\\&#xA;&amp;amp;\hspace{7.25cm}=\frac{1}{v\,\lambda_p}\frac{\partial\tilde{F}}{\partial x}(x,t)(1-e^{-\lambda_p\Delta x}) \\&#xA;\end{align}&#xA;Away from zero, we can look at some arbitrary small subinterval. For $y\in (k\Delta x\,, (k + 1)\Delta x)$, forsome integer k we should evaluate the following integral&#xA;$$\int_{k\Delta x}^{(k + 1)\Delta x}(\,\tilde{F}(x+y,t)-\tilde{F}(x,t)\,)\,k(y)dy$$&#xA;Using linear approximation yields we can write $\tilde{F}(x+y,t)$ on $(k\Delta x \, (k + 1)\Delta x)$ as follow&#xA;$$\tilde{F}(x+y,t)=\tilde{F}(x+k\Delta x,t)+(y-k\Delta x)\frac{\tilde{F}(x+(k+1)\Delta x,t)-\tilde{F}(x+k\Delta x,t)}{\Delta x}+O(\Delta x^2)$$&#xA;Substituting it would yield&#xA;\begin{align}&#xA;&amp;amp;\int_{k\Delta x}^{(k + 1)\Delta x}\left[\,\tilde{F}(x+k\Delta x,t)+(y-k\Delta x)\frac{\tilde{F}(x+(k+1)\Delta x,t)-\tilde{F}(x+k\Delta x,t)}{\Delta x}-\tilde{F}(x,t)\,\right]\frac{e^{-\lambda_p y}}{v\,y}1_{y&amp;gt;0}\,dy\\&#xA;&amp;amp;=\frac{(1-k)\tilde{F}(x+k\Delta x,t)-\tilde{F}(x,t)-k\tilde{F}(x+(k+1)\Delta x,t)}{v}\times\int_{k\Delta x}^{(k + 1)\Delta x}\frac{e^{-\lambda_py}}{y}dy+\frac{\tilde{F}(x+(k+1)\Delta x,t)-\tilde{F}(x+k\Delta x,t)}{\lambda_p\,v\,\Delta x}(e^{-\lambda_pk\Delta x}-e^{-\lambda_p(k+1)\Delta x})&#xA;\end{align}&#xA;So the only thing you have to do is calculate&#xA;$$\int_{k\Delta x}^{(k + 1)\Delta x}\frac{e^{-\lambda_py}}{y}dy$$&#xA;there are several Methods for fast calculation of it.&lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastEditorDisplayName="user16891" LastEditDate="2015-07-23T21:32:29.720" LastActivityDate="2015-07-23T21:32:29.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18995" PostTypeId="2" ParentId="18987" CreationDate="2015-07-23T18:42:26.253" Score="1" Body="&lt;p&gt;Say at time $t$ , the cash flows of some bond $b$ can be described by the two vectors $\textbf{c}$ and $\textbf{t}$, containing information about the value of the nominal cash flows and cash flow times in years, respectively. Similarly, if we have a range of bonds $B = \{ b_1, ..., b_n\}$ that trade on a market, the matrices $\textbf{C}$ and $\textbf{T}$ contain information about the cash flows and cash flow times for all bonds on the market (in this example, assume that each bond occupy one row).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming no-arbitrage and term-invariant default risk, the vector $\textbf{p}$ of dirty prices for the bonds trading on the market can be recovered using the expression&#xA;$$&#xA;\textbf{p} = diag(\textbf{D(T)} \textbf{C}^T)&#xA;$$&#xA;where $\textbf{D(T)}$ is a matrix of &lt;strong&gt;observed&lt;/strong&gt; discount factors corresponding the the individual entries in $\textbf{T}$; for instance $\textbf{d}_{i, j} = e^{-r(\textbf{t}_{i,j})\textbf{t}_{i,j}}$, where $r(t)$ is some function for the spot (or zero coupon) term structure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the real world, instead of solving for $\textbf{p}$, we can in fact &lt;em&gt;observe&lt;/em&gt; $\textbf{p}$ through our broker or on our Bloomberg terminals, and so we wish to estimate $\textbf{D(T)}$ instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, you've chosen to model $r(t)$ using the NSS parametric model (sometimes referred to as a &lt;em&gt;parsimonious model&lt;/em&gt; when comparing with other models of potentially many more predictors). We then choose an objective function, say&#xA;$$&#xA;\min_\theta{\sum{(p_i - \hat p_i)^2}}.&#xA;$$&#xA;Here, $p_i$ is the observed dirty price of the $i^{th}$ bond and $\hat p_i$ is the fitted dirty price of the $i^{th}$ bond and $\theta$ is a vector of estimation parameters in our model. We then simply employ some numerical optimization routine on our parameter vector $\theta$ until we find an optimum.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this helps to not only see how to estimate parameters in the NSS model, but also why it is theoretically more consistent to model &lt;strong&gt;spot rates&lt;/strong&gt; over &lt;strong&gt;nominal coupon YTMs&lt;/strong&gt; (the latter of which I believe you've tried to model, if I interpret your question correctly).&lt;/p&gt;&#xA;" OwnerUserId="16914" LastActivityDate="2015-07-23T18:42:26.253" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="18996" PostTypeId="1" CreationDate="2015-07-23T19:12:39.910" Score="0" ViewCount="82" Body="&lt;p&gt;Given:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;vector of portfolio weights $W = [w_1 w_1 ]$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;correlation matrix $C = \left( \begin{array}{ccc}&#xA;a &amp;amp; b \\&#xA;d &amp;amp; e \end{array} \right) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;standard deviation of the asset returns $S = [s_1 s_2]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I calculate the portfolio volatility?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I had the covariance I'd just say $W* Cov * W^{T}$, correct?&lt;/p&gt;&#xA;" OwnerUserId="7769" LastEditorUserId="7769" LastEditDate="2015-07-23T19:21:04.583" LastActivityDate="2015-07-23T19:44:04.667" Title="calculating portfolio volatility" Tags="&lt;risk&gt;&lt;modern-portfolio-theory&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2015-07-23T20:04:34.263" ContentLicense="CC BY-SA 3.0" />
  <row Id="18997" PostTypeId="2" ParentId="18996" CreationDate="2015-07-23T19:37:40.510" Score="2" Body="&lt;p&gt;You are correct in your basic approach. Given the correlation matrix $\textbf{C}$ and standard deviation matrix $\textbf{S}$ where standard deviations occupy the diagonal and zeros the rest (i.e. $s_{i,j} = \sigma_i | i = j$ and $s_{i,j} = 0 | i \neq j$), the covariance matrix can be found as $\textbf{R} = \textbf{SCS}$. Then your portfolio standard deviation is $\sqrt{\textbf{w}^T\textbf{Rw}}$.&lt;/p&gt;&#xA;" OwnerUserId="16914" LastEditorUserId="16914" LastEditDate="2015-07-23T19:44:04.667" LastActivityDate="2015-07-23T19:44:04.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18998" PostTypeId="2" ParentId="8247" CreationDate="2015-07-23T21:19:37.847" Score="4" Body="&lt;p&gt;If $\mu$ is large, then it is more likely for the call to finish in the money. Your and my intuitions suggest that this means that the option is more valuable. But this is wrong. A call option is an insurance policy. A call option is useful because it protects you in the case that the value of the stock goes down. That is why call options are valuable for high volatility stocks. You are able to bound your losses while allowing for potentially large gains. If a stock has a super high rate of return (several times the volatility, for example) then there is almost no chance of the stock price going down. So an insurance policy is not very valuable. We are better off just buying the amazing stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Our intuition tells us that if $\mu$ is high, the price of the option should be high because it is more likely to finish in the money. At the same time, our intuition tells us that the option (insurance policy) is less valuable because there is less chance of the stock finishing out of the money.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The math tells us that $\mu$ actually just doesn't affect the price of options.&lt;/p&gt;&#xA;" OwnerUserId="17014" LastActivityDate="2015-07-23T21:19:37.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="18999" PostTypeId="1" CreationDate="2015-07-23T23:41:23.823" Score="1" ViewCount="170" Body="&lt;p&gt;The Indian Rupee (INR) seems fairly stable against the USD (1 USD = 62-64 INR) in the recent times even though most other currencies have weakened against USD, some by 20-30%. Apparently, INR is responsive to most other currencies these days except the USA. Is it related to the strength of the Indian economy, or that INR has already fallen to its lowest point well before other currencies?&lt;/p&gt;&#xA;" OwnerUserId="17016" LastActivityDate="2015-07-24T19:50:06.303" Title="Why is Indian rupee is stable against the USD even though most other currencies weakening?" Tags="&lt;fx&gt;&lt;currency&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19000" PostTypeId="2" ParentId="18984" CreationDate="2015-07-24T01:24:54.693" Score="2" Body="&lt;p&gt;FRARateHelper takes a number of constructors. You should take a look at the ones that take Period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The definition for Period is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;class Period {&#xA;  public:&#xA;    Period()&#xA;    : length_(0), units_(Days) {}&#xA;    Period(Integer n, TimeUnit units)&#xA;    : length_(n), units_(units) {}&#xA;    explicit Period(Frequency f);&#xA;    Integer length() const { return length_; }&#xA;    TimeUnit units() const { return units_; }&#xA;    Frequency frequency() const;&#xA;    Period&amp;amp; operator+=(const Period&amp;amp;);&#xA;    Period&amp;amp; operator-=(const Period&amp;amp;);&#xA;    Period&amp;amp; operator/=(Integer);&#xA;    void normalize();&#xA;  private:&#xA;    Integer length_;&#xA;    TimeUnit units_;&#xA;};&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Period encapsulates a time-frame, the frame can be specified by Days. In your example, you might want to do something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;int days = Actual360(Mar 19, 2012 - Jan 9, 2012)&#xA;Period p = Period(days, Days)&#xA;FRARateHelper(0.01, p, ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The pseudo-code should give you enough information to complete your code. You'd decide a day-counting convention, and use it to count number of days, then use the Period class to start FRARateHelper.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2015-07-24T01:24:54.693" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19001" PostTypeId="1" AcceptedAnswerId="19004" CreationDate="2015-07-24T02:27:50.880" Score="1" ViewCount="2602" Body="&lt;p&gt;I am trying to determine the parameters for the Nelson Siegel Svensson model and am solving a Non-Linear Optimization problem to do this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to solve:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\min_\theta{\sum{(p_i - \hat p_i)^2}}.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $p_i$ are the observed dirty prices of the bonds and $\hat p_i$ are the prices that have been calculated using the NSS parameters, $\theta$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using the procedure presented in &lt;a href=&quot;http://webcache.googleusercontent.com/search?q=cache:2mNOF_yPvqAJ:www.vse.cz/polek/download.php%3Fjnl%3Defaj%26pdf%3D9.pdf%20&amp;amp;cd=3&amp;amp;hl=en&amp;amp;ct=clnk&amp;amp;gl=us&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt;. But I've also read that the Optimization is highly sensitive to the input set of parameters ($\theta$) as mentioned in Page 2 of &lt;a href=&quot;http://www.efmaefm.org/0EFMAMEETINGS/EFMA%20ANNUAL%20MEETINGS/2010-Aarhus/papers/Smoothed_Bootstrap_-_Nelson-Siegel_Revisited_June_2010.pdf&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt;. Hence, if I don't have data on these parameters how should I look to set the input. I am currently trying to do this for GBP Government Bonds, but am unable to find any published parameters. I was also unable to find how people circumvent this problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently, I am using the $\theta$ values presented &lt;a href=&quot;http://www.federalreserve.gov/econresdata/researchdata/feds200628_1.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; as I thought they may be similar for the GBP Government Bonds. However, the Optimization proves to be unsolvable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is part of the code that I am using in Python to solve the optimization problem. &lt;code&gt;func&lt;/code&gt; just returns the sum of the squared difference in prices (Objective function) and &lt;code&gt;params&lt;/code&gt; refer to $\theta$. These are the input &lt;code&gt;params&lt;/code&gt; I am currently using.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;params = [3.15698855,    -2.98240445,    -3.37586632,    -1.67713694,    0.88538977,    3.84324841] #Theta&#xA;optimize.minimize(func, params, method='COBYLA', constraints = cons, options={'disp': True})&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thank You&lt;/p&gt;&#xA;" OwnerUserId="11917" LastEditorUserId="11917" LastEditDate="2015-07-24T12:36:43.670" LastActivityDate="2015-07-24T13:35:36.850" Title="Setting input parameters for Nelson Siegel Svensson model" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;yield-curve&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19003" PostTypeId="2" ParentId="9862" CreationDate="2015-07-24T12:44:25.340" Score="3" Body="&lt;p&gt;It is straightforward to include dividends into the model if it can be assumed that the dividend payment is a continuous dividend yield, &lt;span class=&quot;math-container&quot;&gt;$q$&lt;/span&gt;. Under &lt;span class=&quot;math-container&quot;&gt;$Q$&lt;/span&gt; measure, in the Black-Scholes Model, Heston Model etc, &lt;span class=&quot;math-container&quot;&gt;$r$&lt;/span&gt; is replaced by &lt;span class=&quot;math-container&quot;&gt;$r − q$&lt;/span&gt;., Here, We are going to simulate underlying asset in the Black-Scholes model by Milstein Method. Indeed, we assume underlying asset follows the Ito process as described by the following stochastic differential equation&#xA;&lt;span class=&quot;math-container&quot;&gt;$$dS_t=(r-q)S_t dt+\sigma\, S_tdW_t$$&lt;/span&gt; &#xA;Apply Milstein discretization to this equation,we have&#xA;&lt;span class=&quot;math-container&quot;&gt;$$S_{t+\Delta t} = S_t+(r-q)S_t \Delta t+\sigma\,S_t \sqrt{\Delta t}\,Z+\frac{1}{2}\sigma^2\Delta t(Z^2-1)$$&lt;/span&gt; &#xA;where &lt;span class=&quot;math-container&quot;&gt;$Z$&lt;/span&gt; is distributed as standard normal.&#xA;We then retain the last stock price from each stock price path and obtain the&#xA;payoff of the European option at expiry, take the average over all stock price paths and discount back to time zero. Hence, for example, the call  &lt;span class=&quot;math-container&quot;&gt;$C(K)$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$C(K,S_T,r,\sigma)$&lt;/span&gt; is&#xA;&lt;span class=&quot;math-container&quot;&gt;$$C(K,S_T,r,\sigma)=e^{-rt}\frac{1}{N}\sum_{i=1}^{N}max\{S_T^{(i)}-K, 0\}$$&lt;/span&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastEditorUserId="44602" LastEditDate="2020-04-12T14:11:03.300" LastActivityDate="2020-04-12T14:11:03.300" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="19004" PostTypeId="2" ParentId="19001" CreationDate="2015-07-24T12:55:23.867" Score="3" Body="&lt;p&gt;Jojo, once again the paper is about Nelson-Siegel and not Nelson-Siegel svensson (the former allows for one hump whereas the latter for two humps).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Jojo, in practice people often start by fixing $\lambda$ then estimate the model by OLS and check the squared errors of the model. Then change $\lambda$ and repeat the procedure. This is highly efficient, and you can do it for a reasonable large range for $\lambda$. Then check which $\lambda$ yields the lowest squared errors. This should not take more than 30 seconds in a standard computer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then do the optimization algorithm setting as initial parameters the ones obtained using the procedure outlined before. The should move (hopefully not much), and reduce the squared errors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is almost equivalent to a simulation annealing technique.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="16472" LastEditDate="2015-07-24T13:35:36.850" LastActivityDate="2015-07-24T13:35:36.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19007" PostTypeId="2" ParentId="18999" CreationDate="2015-07-24T19:50:06.303" Score="4" Body="&lt;p&gt;To answer this question, lets dive into some of the factors that generally determine foreign exchange rates. I've outlined the two of the most widely discussed factors below.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Current account balance&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An economy's current account is a component of an economy's &lt;em&gt;balance of payments&lt;/em&gt; and is a measure of the economy's financial transactions with the rest of the world. The current account measures transactions such as those involving goods and services, but also wage income, financial transactions, dividend and interest payments and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The current account is therefore also a proxy for the structural supply and demand conditions for an economy's currency. An economy running a current account deficit sees net outflow of currency, while an economy running a surplus sees net inflow of currency. In these transactions, the party that is funds receivable will generally have to exchange the foreign currency received for their own currency, which means that they will have to sell their foreign currency holdings in the foreign exchange markets. For economies running a currency account deficit, this means that there is a structural supply of that economy's currency to the market, which all else equal results in a depreciating trend.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Interest and inflation differentials&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've grouped interest and inflation differentials here since the correlation between an economy's rate of interest and its inflation rate are highly correlated. To understand why, I encourage you to read up on for instance &lt;a href=&quot;https://en.wikipedia.org/wiki/Fisher_equation&quot; rel=&quot;nofollow&quot;&gt;Irving Fisher's Equation&lt;/a&gt; or Eugene Fama's &lt;a href=&quot;http://www.ressources-actuarielles.net/EXT/ISFA/1226.nsf/0/38019a3264b83e49c125751e0055f911/$FILE/Mod%C3%A8le%20de%20Fama%20pour%20l&amp;#39;inflation.pdf&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; on the matter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short, an economy with high relative interest rates will all else equal attract more capital, since the prospect for capital gains are higher here, than the country to which it is compared. However, high interest rates are generally caused by loose monetary conditions, that is to say expansion of the monetary base or inflation (a decrease in purchasing power of one unit of currency).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, also understand that monetary expansion is necessary in well-functioning economies. Some schools of economics, for instance, &lt;a href=&quot;https://en.wikipedia.org/wiki/Friedman%27s_k-percent_rule&quot; rel=&quot;nofollow&quot;&gt;advocate that the monetary base be expanded by the rate of long-run real GDP growth&lt;/a&gt;. Other scholars disagree with this idea, but this is merely to show that the nominal interest rate differential between two economies cannot stand alone.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taken together, economists have studied the effects of interest rate differentials on foreign exchange rates, under the umbrella term &lt;em&gt;interest parities&lt;/em&gt;. Please read up on these yourself, but suffice it to say that these hypotheses of interest rates and foreign exchange rates roughly predict that, on the long term, interest income made from a deposit in a foreign currency funded by a loan in the home currency, will on average be outweighed by an depreciation in the foreign currency. In short, all cancels out, and you cannot make any significant profits from &lt;a href=&quot;https://en.wikipedia.org/wiki/Carry_(investment)#Currency&quot; rel=&quot;nofollow&quot;&gt;the foreign exchange carry trade&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In terms of the Indian Rupee specifically, it has generally been in a long-term depreciating trend against the US Dollar, as is the case with most other developing nations' currencies (BRL, ZAR, PLN, MXN etc.). I do not have any personal opinions as to the direction of the INR, but following is my two cents' worth on how to couple the above points to the INR specifically. India runs a current account deficit, however much smaller than that of the U.S. India, along with other developing economies, have seen a growing discrepancy between inflation rates and economic growth, meaning that while economic growth has slowly diminished, inflation rates have stayed relatively elevated (please look these figures up yourself to check my claim). Furthermore, monetary authorities might wish to intentionally depreciate the value of its currency, since a weaker currency means that the economy's competitive standing improves.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope the above helps shed some light onto some of the factors that determine foreign exchange rates in general. However, this is by no means an exhaustive list or explanation. If you wish to learn more about foreign exchange markets, I encourage you to read for instance Piet Sercu's &quot;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/069113667X&quot; rel=&quot;nofollow&quot;&gt;International Finance&lt;/a&gt;&quot; or similar works.&lt;/p&gt;&#xA;" OwnerUserId="16914" LastActivityDate="2015-07-24T19:50:06.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19008" PostTypeId="1" AcceptedAnswerId="19009" CreationDate="2015-07-24T19:55:40.160" Score="1" ViewCount="238" Body="&lt;p&gt;First of all, warm hello to all.&#xA;I am newbie and i admit it, but with at least 15+ years of exp in C++.&#xA;Working in IB - derivatives mainly, but unfortunately on the business side not trading at all. Got interested in Quant trading very much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intro:&#xA;I am learning very hard to understand the basics of quant trading currently building my first out of 2 applications. The Feeder - which generally speaking retrieves tick data (OHLC, price and volume) from Bitcoin Exchanges with a resolution of 1 minute (queries the markets every minute and stores the tick values in the database). No place to mention theory i read about in books and blogs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question:&#xA;Is it enough to get the tick values from exchanges to be able to backtest strategies ? Should i consider downloading orderbooks too?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reason:&#xA;I am interested in backtesting and eventually quant trading Bitcoins, no options, futures or any derivatives. I understand BTC markets as FX. &lt;/p&gt;&#xA;" OwnerUserId="16278" LastEditorUserId="16278" LastEditDate="2015-07-24T20:01:03.547" LastActivityDate="2015-07-24T20:23:27.927" Title="Newbie Quant: Bulding price feeder to securities master db" Tags="&lt;quants&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19009" PostTypeId="2" ParentId="19008" CreationDate="2015-07-24T20:23:27.927" Score="2" Body="&lt;p&gt;Whether to store L1 (trades/BBO only), OHLC and order book depends on your downstream application. I encourage you to start with L1 (easy to store) and then think about what to do as your use cases evolve. If your trading strategy only uses trade prices, then you are fine with L1. And OHLC can be backed out from L1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is very tempting to store more data than you actually need and overoptimize your data infrastructure and get lost in shifting objectives, and in my experience it gets overly time-consuming.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly, FX and Bitcoin are very different markets. I would encourage you think carefully about this assumption.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2015-07-24T20:23:27.927" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19010" PostTypeId="1" CreationDate="2015-07-25T00:23:30.500" Score="0" ViewCount="1484" Body="&lt;p&gt;I have a set of assets, &lt;em&gt;n&lt;/em&gt;. I'm trying to find the correlation between 2 portfolios, say &lt;em&gt;x&lt;/em&gt; and &lt;em&gt;y&lt;/em&gt;, where &lt;em&gt;x&lt;/em&gt; is nested in, or, a sub-set of &lt;em&gt;y&lt;/em&gt;. That is, &lt;em&gt;x&lt;/em&gt; is a portfolio based on a sub-set of &lt;em&gt;n&lt;/em&gt;, while &lt;em&gt;y&lt;/em&gt; is a portfolio based on the entire set of assets, &lt;em&gt;n&lt;/em&gt;. The weights in each portfolio sum to 1, and I'm using Excel. Thanks for your time!&lt;/p&gt;&#xA;" OwnerUserId="17020" LastActivityDate="2015-07-25T15:52:56.963" Title="Correlation Between 2 Portfolios" Tags="&lt;portfolio-management&gt;&lt;correlation&gt;&lt;portfolio-optimization&gt;&lt;correlation-matrix&gt;&lt;covariance-matrix&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19011" PostTypeId="2" ParentId="19010" CreationDate="2015-07-25T04:32:48.270" Score="1" Body="&lt;p&gt;You will need the &lt;a href=&quot;https://en.wikipedia.org/wiki/Covariance_matrix&quot; rel=&quot;nofollow noreferrer&quot;&gt;covariance matrix&lt;/a&gt; to calculate this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say you have a collection of $n$ assets. The value of asset $i$ is represented by the random variable $X_i$ and the corresponding portfolio weight is are $w_i$, and $v_i$ for the two portfolios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The correlation between the two portfolios is: &#xA;$$ \frac{\sigma(w^TX,v^TX)}{\sqrt{(w^T\Sigma w)(v^T\Sigma v) }} = \frac{w^T\Sigma(X)v}{\sqrt{(w^T\Sigma w)(v^T\Sigma v) }}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $\Sigma$ is the covariance matrix. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can arrive to this conclusion by using variance's bilinear property.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And without using vector notation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \rho = \frac{\Sigma ^n _i \Sigma ^n _k w_iv_k \sigma(X_i,X_k)}{\sqrt{Var( P_1 )Var(P_2) }} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $Var( P_1 )$ the variance of portfolio 1. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also take a look at &lt;a href=&quot;https://math.stackexchange.com/questions/125422/correlation-between-two-linear-sums-of-random-variables&quot;&gt;this related question&lt;/a&gt; at math stack exchange.&lt;/p&gt;&#xA;" OwnerUserId="13311" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2015-07-25T04:32:48.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19013" PostTypeId="2" ParentId="19010" CreationDate="2015-07-25T15:52:56.963" Score="0" Body="&lt;p&gt;If you're in Excel, get the returns of both portfolios into 2 columns, matched up by time.  The &quot;correl()&quot; function will get you the correlation coefficient.   &lt;/p&gt;&#xA;" OwnerUserId="9251" LastActivityDate="2015-07-25T15:52:56.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19014" PostTypeId="1" AcceptedAnswerId="19017" CreationDate="2015-07-25T18:04:58.850" Score="1" ViewCount="195" Body="&lt;p&gt;Suppose I have an optimization where I need to impose ADV-like constraint (for a case where Shorting is allowed):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\max \mu'w - \lambda w'\Sigma w$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ |w| \le V $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ Aw = 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and I want to use a Quadratic Programming formulation. I read somewhere that I can replace $|w| = z$ by two inequalities. Which one of the two is valid:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Case 1&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\max \mu'w - \lambda w'\Sigma w - M z$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ z \le V $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ w \le z$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ -w \le z$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ Aw = 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $M$ is a very large constraint, which &lt;strong&gt;I think&lt;/strong&gt; will force $|w| = z$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Case 2&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\max \mu'w - \lambda w'\Sigma w$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ z \le V $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ w \le z$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ -w \le z$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ Aw = 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Case 2 above is what I saw a few places on the net, but it got me thinking that this constraint is equivalent to $|w| \le z$ and I need to find another way to force the equality. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is either Case 1 or Case 2 or both a correct way to handle the $|w| \le V$ constraint? &lt;/p&gt;&#xA;" OwnerUserId="5948" LastActivityDate="2015-07-25T19:19:43.663" Title="optimization with absolute constraints" Tags="&lt;optimization&gt;&lt;portfolio&gt;&lt;portfolio-optimization&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19016" PostTypeId="2" ParentId="18970" CreationDate="2015-07-25T18:50:55.197" Score="4" Body="&lt;p&gt;Here is a collection of papers. The general idea is that the market has investor classes that share different expectations. When in bubble territory, many investors generally agree that assets are overpriced, but they still invest in expectation of more investors entering the market (the greater fools). There are also sophisticated investors who know assets are overpriced. If they act in tandem, then the bubble will collapse. In general no sophisticated investor is large enough to fight the irrational exuberance of a large number of retail investors and noise traders (generally speaking traders with &quot;erroneous&quot; beliefs that are following trends). Therefore from each sophisticated investor's perspective, there is synchronization risk in attacking the bubble.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A list of papers follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Harrison and Kreps of NYU, have written a paper called &quot;&lt;a href=&quot;http://pages.stern.nyu.edu/~lpederse/courses/LAP/papers/ShortSales/HarrisonKreps78.pdf&quot; rel=&quot;nofollow&quot;&gt;Speculative market behavior in a stock market with heterogeneous expectations&lt;/a&gt;&quot; where they create a model of a market with imperfect information, where different classes of investors have heterogeneous expectations. One of their results is that buy and hold is not profitable in their model's framework. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;&lt;a href=&quot;http://attach3.bdwm.net/attach/boards/Stock/M.1177600988.A/pft.pdf&quot; rel=&quot;nofollow&quot;&gt;Positive Feedback Investment Strategies and Destabilizing Rational Speculation&lt;/a&gt;&quot;, a paper by De Long et. al, proposes a model to analyze positive feedback (i.e. trend following) investors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my favorite, and a good read. &lt;a href=&quot;https://repositori.upf.edu/bitstream/handle/10230/508/861.pdf?sequence=1&quot; rel=&quot;nofollow&quot;&gt;A 1720 case study of a bank/broker in Britain, that successfully rode the South Sea Company bubble&lt;/a&gt;. The paper is by Temin and Voth.&lt;/p&gt;&#xA;" OwnerUserId="13311" LastEditorUserId="13311" LastEditDate="2015-07-25T23:41:02.870" LastActivityDate="2015-07-25T23:41:02.870" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="19017" PostTypeId="2" ParentId="19014" CreationDate="2015-07-25T19:19:43.663" Score="3" Body="&lt;p&gt;Why not just do: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ max \,\, \mu ^T w - \lambda w^T \Sigma w $$&#xA;s.t.:&#xA;$$ w \leq V $$&#xA;$$ -w \leq V $$&#xA;$$ A w = 0 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Google for LP absolute value constraint transformations. Here is a helpful online &lt;a href=&quot;http://lpsolve.sourceforge.net/5.5/absolute.htm&quot; rel=&quot;nofollow&quot;&gt;tutorial&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And if these are portfolio weights, don't forget that they should add up to 1.&lt;/p&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2015-07-25T19:19:43.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19018" PostTypeId="2" ParentId="18970" CreationDate="2015-07-25T22:37:21.790" Score="1" Body="&lt;p&gt;The way to do gradual position entry and exit is to use multiple trend following rules, each of which is responsible for managing a part of the available capital. Only if all the trading rules agree will 100% of the capital be deployed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a simple example, suppose you have three rules. The first rule is based on 10 day momentum; this rule produces a score of +1/3 if p[0]&gt;p[10] (i.e. the price is up over the last 10 days) and -1/3 otherwise. The second rule is a 20 day momentum rule, with output 1/3 if 20 day momentum is positive, and -1/3 otherwise. The third rule is based on 40 day momentum, again 1/3 or -1/3 depending on the direction of prices the last 40 days. The overall stance is based on the sum of the three rules. So if 10, 20 and 40 day momentum is positive the overall score is 1/3+1/3+1/3 = 1 so you will be 100% long; if one rule is bullish and the other two are bearish you will have 1/3-1/3-1/3 = -1/3 so you will be 33% short.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course this can be generalized and expanded in various ways. It is a well known idea, but I can't recall in what paper I first read about it.  &lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2015-07-25T22:48:28.137" LastActivityDate="2015-07-25T22:48:28.137" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19019" PostTypeId="1" CreationDate="2015-07-26T09:48:58.287" Score="4" ViewCount="155" Body="&lt;p&gt;I am working a bit on &lt;a href=&quot;http://rfs.oxfordjournals.org/content/23/8/3190.short&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; paper, which is about Long-run risk through Consumption Smoothing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In equation (8) and (9) the authors define the stochastic process for the technology as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Z_t = \exp(\mu t + z_t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$z_t = \varphi z_{t-1}+\epsilon_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is straightforward, why do they specify these two equations? Wouldn't it be exactly the same to specify:&#xA;$z_t = \mu_t + \varphi z_{t-1}+\epsilon_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, with their specification, if you take logs of the first equation, the $z_t$ cancel out, right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am assuming that $z_t = \ln(Z_t)$ which I believe is correct.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="467" LastEditDate="2015-10-26T06:29:33.533" LastActivityDate="2015-10-26T06:29:33.533" Title="Asset pricing - Technology" Tags="&lt;asset-pricing&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19020" PostTypeId="1" CreationDate="2015-07-26T11:39:31.980" Score="1" ViewCount="495" Body="&lt;p&gt;I need to estimate the expected value and the Greeks of an European call down and out option, assuming geometrical Brownian motion of the asset, with Monte Carlo simulation employing Euler discretization scheme. Given are the strike K,S0, Barier(B), volatility (v), risk free rate(r) and time to end (T). I can program the code, but I cant find the mathematics behind the calculations. Can someone show them to me? Thank you in advance.&lt;/p&gt;&#xA;" OwnerUserId="17034" LastActivityDate="2015-12-24T09:37:00.180" Title="European call down and out option (geometric Brownian motion, Monte Carlo, Euler)" Tags="&lt;options&gt;&lt;monte-carlo&gt;&lt;brownian-motion&gt;&lt;european&gt;&lt;euler&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19021" PostTypeId="1" CreationDate="2015-07-26T11:46:12.727" Score="3" ViewCount="113" Body="&lt;p&gt;In their classic paper &quot;&lt;a href=&quot;https://web.stanford.edu/class/msande348/papers/PeroldSharpe.pdf&quot; rel=&quot;nofollow&quot;&gt;Dynamic Strategies for Asset Allocation&lt;/a&gt;&quot; Perold and Sharpe state:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;That convex and concave strategies are mirror images of one&#xA;  another tells us that the more demand there is for one of these&#xA;  strategies, the more costly its implementation will become, and the&#xA;  less healthy it may be for markets generally. If growing numbers of&#xA;  investors switch to convex strategies, then markets will become more&#xA;  volatile, for there will be insufficient buyers in down markets and&#xA;  insufficient sellers in up markets at previously “fair” prices. In&#xA;  this setting, those who follow concave strategies may be handsomely&#xA;  rewarded. Conversely, if growing numbers of investors switch to&#xA;  concave strategies, then the markets may become too stable. Prices may&#xA;  be too slow to adjust to fair economic value. This is the most&#xA;  rewarding environment for those following convex strategies.&#xA;  Generally, whichever strategy is “most popular” will subsidize the&#xA;  performance of the one that is “least popular.” Over time, this will&#xA;  likely swell the ranks of investors following the latter and contain&#xA;  the growth of those following the former, driving the market toward a&#xA;  balance of the two.&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question&lt;/strong&gt;&lt;br&gt;&#xA;Although this seems intuitive enough I would like to find references which corroborate this result by means of multi-agent simulation in artificial financial markets.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2015-07-26T11:46:12.727" Title="Long-term proportion of convex and concave strategies in artificial financial markets" Tags="&lt;simulations&gt;&lt;artificial-markets&gt;&lt;multi-agent-simulations&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19022" PostTypeId="1" CreationDate="2015-07-26T14:18:45.430" Score="5" ViewCount="82" Body="&lt;p&gt;I hear many quants sating that markets change very slowly. This &quot;fact&quot; is even presented as a justification of statistical arbitrage, for example, by affirming that correlations remain roughly the same for long periods, and then insight given by these correlations or by a PCA applied on the correlation matrix is valid through time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is : indeed, correlation matrix does not change on a daily basis, but isn't that due to an estimation bias? When the estimation is based on last 250 days for example, any new day contribution is very small and does not dramatically change the estimator, and real correlation may be much more stochastic than the stable matrix estimated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this is the case, how come this artificially stable correlation matrix can give profitable trading strategies relying on it?&lt;/p&gt;&#xA;" OwnerUserId="8128" LastActivityDate="2015-12-23T19:15:04.270" Title="market change, correlation and estimation bias" Tags="&lt;statistics&gt;&lt;correlation&gt;&lt;arbitrage&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19023" PostTypeId="1" CreationDate="2015-07-26T15:30:56.160" Score="1" ViewCount="109" Body="&lt;p&gt;The changing in price of shares are down to the number of people buying or selling stock. So, if there is a large demand for a stock then the share price will increase, and if there are lots of people selling stock, the share price will decrease. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How then, can the price at the open of one market day be different to the price at the close of the previous market day?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Surely if trading is closed between 16:30 and 08:00 then people can neither buy nor sell shares, and hence the share price cannot change. So how then does a share price change overnight? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it a case of such a large volume of buys/sells as soon as the market opens, that the time taken for a change in price is negligible, so the open price would appear to be different from the previous close?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take for example a share price I was just looking at: Barrick Gold closed at 7.07 on 23 July and opened at 6.96 on 24 July. &lt;/p&gt;&#xA;" OwnerUserId="8010" LastActivityDate="2015-07-27T22:32:20.793" Title="How can a share price be different on its open than it was on the previous close?" Tags="&lt;trading&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19024" PostTypeId="2" ParentId="19023" CreationDate="2015-07-26T16:06:20.530" Score="2" Body="&lt;p&gt;There is trading happening overnight. &#xA;A nice paper is Dong Lou et. al:&#xA;&lt;a href=&quot;http://personal.lse.ac.uk/loud/OvernightMom.pdf&quot; rel=&quot;nofollow&quot;&gt;http://personal.lse.ac.uk/loud/OvernightMom.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They explain the overnight trading and actually document that most known anomalies occur on that period.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-07-26T16:06:20.530" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19025" PostTypeId="2" ParentId="19022" CreationDate="2015-07-26T16:09:37.470" Score="2" Body="&lt;p&gt;One easy way to cross-check that is to compute option implied correlations. Those correlations are model free and only depend on the current day option prices and they are indeed stable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a nice article on computing option implied correlations check Vilkov's website he has several articles discussing option implied correlations.&#xA;&lt;a href=&quot;http://www.vilkov.net/www/content/research&quot; rel=&quot;nofollow&quot;&gt;http://www.vilkov.net/www/content/research&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-07-26T16:09:37.470" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19026" PostTypeId="1" CreationDate="2015-07-26T17:25:20.980" Score="2" ViewCount="170" Body="&lt;p&gt;A lot of parameters in one title, I know. So there's credit scoring but not using credit history. Then there's using a Bayesian logit model. Then there's doing so in a developing country such as Haiti or Peru.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question: Does anyone know of any papers about psychometric or behavioural testing using Bayesian logit model to determine whether a loan applicant in a developing country would be creditworthy?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Background: &lt;a href=&quot;https://cogsci.stackexchange.com/questions/10721/how-can-psychometric-or-behavioural-tests-be-used-in-banking-to-evaluate-creditw&quot;&gt;How can psychometric or behavioural tests be used in banking to evaluate creditworthiness?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like they use psychological factors or questionnaires like in job interviews instead of financial factors such as financial ratios and then they have some methodology that reduces it to less factors then they make a regression model out of it or something but then they use Bayesian analysis or something there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: So far all I have found are &lt;a href=&quot;http://www.hks.harvard.edu/fs/akhwaja/papers/EFLpaper2013.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Enterprising Psychometrics and Poverty Reduction&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/vqArm.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/vqArm.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;a href=&quot;https://www.eflglobal.com/wp-content/uploads/2014/09/EFL-Technical-Note-July-2012_s.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Technical  Note    – EFL   Modeling    Methodology&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Last part:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;RESULTS Here   we  illustrate  the     improved    performance     from    this&lt;br&gt;&#xA;  modeling   approach,   using   data    from    one    active  EFL country.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;-&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Results    from    other   countries   show    the     same    result:     the     EFL&lt;br&gt;&#xA;  Bayesian   Hierarchical    Model&#xA;  produces  more    accurate    predictions and more    stability   out-of-sample.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Reading this has already earned much appreciation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Answering or commenting will merit much more.&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="-1" LastEditDate="2017-04-13T12:56:18.350" LastActivityDate="2015-08-08T14:42:22.867" Title="Bayesian logit model in Psychometric or Behavioural Testing for Credit Scoring in Developing Countries" Tags="&lt;credit-risk&gt;&lt;credit-ratings&gt;&lt;credit-scoring&gt;&lt;bayes-theory&gt;&lt;logit&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19027" PostTypeId="2" ParentId="19023" CreationDate="2015-07-26T19:13:13.687" Score="0" Body="&lt;p&gt;Major news can come out during the night.  Imagine a company declaring bankruptcy or getting wiped off the map because of a natural disaster.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take a look at the weekly opening gaps in futures and currency pairs.&lt;/p&gt;&#xA;" OwnerUserId="3188" LastActivityDate="2015-07-26T19:13:13.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19028" PostTypeId="5" CreationDate="2015-07-26T19:44:18.843" Score="0" Body="&lt;p&gt;GARCH, or Generalized AutoRegressive Conditional Heteroskedasticity is a generalization of the ARCH model. It is used to model the time-dependent conditional variance (volatility) of financial time series. A GARCH model represents the current volatility in terms of both past volatility and past errors. E.g. in the standard GARCH($q,p$) model we have&#xA;$$ &#xA;\sigma_t^2 = \omega + \sum_{i=1}^q\alpha_i\varepsilon_{t-i}^2 + \sum_{j=1}^p\beta_j\sigma_{t-j}^2&#xA;$$&#xA;where $\varepsilon_t$ is the error of the conditional mean model and $\sigma_t^2$ is its conditional variance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A GARCH model defines the conditional variance but not the conditional mean of a time series. A GARCH-type conditional variance specification can be combined with an arbitrary specification for the conditional mean, yielding e.g. an ARIMA-GARCH model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The conditional variance equation in a GARCH model is deterministic (the variance is completely determined by lags of own values and of the error term), in contrast to Stochastic Volatility (SV) models. As such, the conditional variance itself does not follow an ARMA model (a frequent misconception), but the squared error term does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GARCH models are mostly used for forecasting return distributions and variances and are instrumental in estimating Value at Risk, Expected Shortfall and other financial risk measures.&lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastEditorUserId="19645" LastEditorDisplayName="user16891" LastEditDate="2017-06-14T10:34:44.047" LastActivityDate="2017-06-14T10:34:44.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19029" PostTypeId="4" CreationDate="2015-07-26T19:44:18.843" Score="0" Body="Generalized Autoregressive Conditional Heteroskedasticity (GARCH) model is used for time series in which the conditional variance is time-varying and autocorrelated. The conditional variance is a linear combination of lagged conditional variances and lagged squared errors. The conditional variance equation in GARCH models is deterministic, in contrast to Stochastic Volatility (SV) models." OwnerDisplayName="user16891" LastEditorUserId="19645" LastEditorDisplayName="user16891" LastEditDate="2017-06-14T10:34:59.327" LastActivityDate="2017-06-14T10:34:59.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19031" PostTypeId="2" ParentId="19020" CreationDate="2015-07-27T04:42:55.020" Score="1" Body="&lt;p&gt;first, there is a formula for the continuously monitored case. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;second, if you use log coordinates the Euler discretization is exact so this should be done. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;third, the convergence for discretely monitored to continuously is actually very slow so you will need a lot of steps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;fourth, it's actually better to draw the hitting time to the barrier rather than stepping naively. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;fifth, as has already been noted this is a big question so hard to answer well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;sixth, see my paper &lt;a href=&quot;http://ssrn.com/abstract=1441142&quot; rel=&quot;nofollow&quot;&gt;http://ssrn.com/abstract=1441142&lt;/a&gt; for further discussion, also Glasserman's book is good.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-07-27T04:42:55.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19032" PostTypeId="2" ParentId="18748" CreationDate="2015-07-27T06:53:12.583" Score="0" Body="&lt;p&gt;&quot;conditional volatilities from GARCH models are not stochastic since at time $t$ the volatility is completely pre-determined (deterministic) given previous values&quot;-&lt;a href=&quot;https://en.wikipedia.org/wiki/Stochastic_volatility&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Stochastic_volatility&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma_t$ is still a random variable in the sense that it has an unconditional distribution.  However, this unconditional distribution is not known in full parametric form (all we know is it's first two moments).  As such the GARCH model is not really built to answer the types of questions your interested in like $E[\sigma_t]$, $\mathrm{VAR}[\sigma_t]$, etc.  You can approximate these values using calculus which is what @ColinTBrowns does below...but that can get messy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A class of model better suited to answer your question is the stochastic volatility (SV) model.  For example, a simple SV model goes something like&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;r_t=\varepsilon_t\sigma_t,\;\;\sigma_t=e^{h_t/2}$$ &#xA;$$&#xA;h_t=\alpha_0+\alpha_1h_{t-1}+v_t&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\varepsilon_t\stackrel{iid}{\sim}N(0,1),\;\;v_t\stackrel{iid}{\sim}N(0,w^2)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming $h_t$ is stationary its unconditional distribution is $h_t \sim N \bigg(\frac{\alpha_0}{1-\alpha_1},\frac{w^2}{1-\alpha_1^2} \bigg)$ so $\sigma_t$ is log normally distributed&#xA;$$&#xA;\sigma_t \sim LN \bigg(\frac{\alpha_0}{2(1-\alpha_1)},\frac{w^2}{4(1-\alpha_1^2)} \bigg)&#xA;$$&#xA;Thus&#xA;$$&#xA;E[\sigma_t]=exp\bigg(\frac{\alpha_0}{2(1-\alpha_1)}-\frac{w^2}{2(1-\alpha_1^2)} \bigg)&#xA;$$&#xA;See the Wikipedia pg for the log-normal distribution if the last step is hard to follow (i.e. it comes from the formula of the mean for a log-normal)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long story short, if you are interested in the statistical properties of the underlying volatility states, it's better to use a model that treats those states as stochastic variables.  There are also a lot more SV models to choose from in addition to the one used in this example.&lt;/p&gt;&#xA;" OwnerUserId="17040" LastEditorUserId="17040" LastEditDate="2015-07-28T05:52:39.957" LastActivityDate="2015-07-28T05:52:39.957" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19033" PostTypeId="2" ParentId="19019" CreationDate="2015-07-27T09:39:29.043" Score="2" Body="&lt;p&gt;Well this is not my area of expertise but I have come across this sort of work before in Time Series Analysis/ Financial Econometrics. I don't know how much detail you want but from my understanding the author has written the two equation in State Space Form. I believe it is fairly common to write ARCH and GARCH models in this fashion. There are a lot of papers covering the basics and motivation behind State Space Models. There is a decent introduction into them on: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://uk.mathworks.com/help/ident/ug/what-are-state-space-models.html?refresh=true&quot; rel=&quot;nofollow&quot;&gt;http://uk.mathworks.com/help/ident/ug/what-are-state-space-models.html?refresh=true&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some other further reading into State Space models and their construction can be found in such books as &quot;System Dynamics in Economic and Financial Models&quot; by Heij, Schumacher and  Hanzon (1997) in Chapter 9 and &quot;Journal of Basic Engineering&quot; by Kalman (1960). This overlaps with the theory of Kalman Filters. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I said above this isn't an area I have much exposure too but if you maybe know anyone who has studied Financial Econometrics they might be able to help since that is where I have encountered these sort of models before.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I have missed the point of the question I am sorry, but I thought some direction may be better than nothing. Tbh I would have left this as a comment but not enough reputation.&lt;/p&gt;&#xA;" OwnerUserId="16967" LastEditorUserId="16967" LastEditDate="2015-07-27T10:20:41.627" LastActivityDate="2015-07-27T10:20:41.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19035" PostTypeId="1" AcceptedAnswerId="19036" CreationDate="2015-07-27T13:44:01.203" Score="1" ViewCount="2293" Body="&lt;p&gt;Could someone give the strict definition of static arbitrage? I know what the arbitrage means but have no idea about the term &quot;Static&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="16362" LastActivityDate="2015-07-27T15:50:36.013" Title="What‘s the definition of static arbitrage?" Tags="&lt;arbitrage&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19036" PostTypeId="2" ParentId="19035" CreationDate="2015-07-27T14:07:57.397" Score="2" Body="&lt;p&gt;A static arbitrage is an arbitrage that does not require any re-balancing of the portfolio. For example, the CME offers a mini euro future for 62,500 euros and a big euro future worth 125,000 euros. You could sell 1 big future and buy 2 mini futures and this would be a static arbitrage. Another example would be the forward price arbitrage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A dynamic arbitrage is one in which you have to re-balance your portfolio. An example of this would be buying an under priced option in the perfect black-scholes world while continuously delta hedging. &lt;/p&gt;&#xA;" OwnerUserId="5940" LastActivityDate="2015-07-27T14:07:57.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19037" PostTypeId="2" ParentId="19035" CreationDate="2015-07-27T15:50:36.013" Score="8" Body="&lt;p&gt;The definition of arbitrage can be broken down into categories such as:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;A &lt;strong&gt;static arbitrage&lt;/strong&gt; is an arbitrage that does not require rebalancing of positions.For example &lt;a href=&quot;http://repository.cmu.edu/cgi/viewcontent.cgi?article=1352&amp;amp;context=tepper&quot; rel=&quot;noreferrer&quot;&gt;static-arbitrage bounds&lt;/a&gt; on the Prices of Basket Options&lt;/li&gt;&#xA;&lt;li&gt;A &lt;strong&gt;dynamic arbitrage&lt;/strong&gt; is an arbitrage that requires trading instruments in the future, generally contingent on market states.&lt;/li&gt;&#xA;&lt;li&gt;A &lt;strong&gt;statistical arbitrage&lt;/strong&gt; is a likely profit as predicted by past statistics.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Model-independent arbitrage&lt;/strong&gt; does not depend on any mathematical model of financial instruments to work. An example of this would be a violation of Put-call parity.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Model-dependent arbitrage&lt;/strong&gt; does require a model. An example would be options mispriced because of incorrect volatility.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerDisplayName="user16891" LastActivityDate="2015-07-27T15:50:36.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19038" PostTypeId="1" CreationDate="2015-07-27T18:42:01.657" Score="12" ViewCount="3130" Body="&lt;p&gt;Assume the stock price follows a geometric Brownian motion Then in Black-Scholes pricing model, $N(d_2)$ is the risk-neutral probability that the option expires in-the-money. However, it is said that $N(d_1)$ is also the probability that the option expires in-the-money under the measure that uses the stock itself as the numeraire.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that risk-neutral measure uses discounted stock price $\frac{S}{B}$ as the numeraire, but how do you use the stock itself as the numeraire?&lt;/p&gt;&#xA;" OwnerUserId="16554" LastEditorUserId="6101" LastEditDate="2015-07-28T10:33:58.030" LastActivityDate="2015-10-28T15:36:13.950" Title="Understanding $N(d_1)$ and how to use the stock itself as the numeraire?" Tags="&lt;black-scholes&gt;&lt;numerairechange&gt;" AnswerCount="4" CommentCount="4" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="19039" PostTypeId="2" ParentId="19038" CreationDate="2015-07-27T19:31:04.093" Score="0" Body="&lt;p&gt;If $\{N_t\}_t$ be a numerair,and $S_t$ any asset price process, then there exists a measure $Q^S$ which is equivalent to the risk-neutral measure $Q$ such that  process&#xA;$$\frac{S_t}{N_t}$$&#xA;is a martingale under $Q^S$ and Derivative pricing under the new measure $Q^S$ is similar as risk-neutral pricing. In particular, the time-t price of a derivative that pays $X$ at maturity $T$ is given by&#xA;$$V(S_t,t,T)=N_t\mathbb{E^{Q^S}}[N_T^{-1}X|\mathcal{F}_t]$$.&#xA;Now, if $S_t$ be a numerair then $Q=Q^S$ and change measure is Meaningless.&lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastEditorDisplayName="user16891" LastEditDate="2015-07-27T21:37:59.533" LastActivityDate="2015-07-27T21:37:59.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19041" PostTypeId="1" AcceptedAnswerId="19044" CreationDate="2015-07-27T22:11:01.723" Score="0" ViewCount="86" Body="&lt;p&gt;I am just trying to understand what TTM (Term to Maturity) means in Page 8 of &lt;a href=&quot;http://www.bankofcanada.ca/wp-content/uploads/2010/01/tr84.pdf&quot; rel=&quot;nofollow&quot;&gt;this PDF&lt;/a&gt; when calculating the discount function. Is it just the vector representing the difference between the time to maturity and the various coupon payments for the bonds? For example, if we are considering 1 year, 2 year, 5 year, 10 year and 30 year bonds and each has semi-annual coupons what would the TTM be?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank You&lt;/p&gt;&#xA;" OwnerUserId="11917" LastActivityDate="2015-07-28T00:02:44.693" Title="Term to Maturity when calculating discount function" Tags="&lt;fixed-income&gt;&lt;bond&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19042" PostTypeId="2" ParentId="19023" CreationDate="2015-07-27T22:32:20.793" Score="4" Body="&lt;p&gt;The opening and closing prices are set during an auction. If there are overnight news, then the opening auction will reflect information which wasn't there during the closing auction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And even without the auctions, the last traded price yesterday results from different orders than the first traded price today.&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2015-07-27T22:32:20.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19043" PostTypeId="1" AcceptedAnswerId="19045" CreationDate="2015-07-27T22:49:20.277" Score="1" ViewCount="616" Body="&lt;p&gt;When is it preferable to use a currency hedged ETF over a none currency hedged ETF? There has been studies which have shown over the longer term currency hedging does not make a difference. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;However, we believe that studies and our own experience have&#xA;  generally shown that over long measurement periods, the returns of&#xA;  hedged portfolios have been similar to the returns of portfolios that&#xA;  have not been hedged.&quot; &#xA;   - &lt;a href=&quot;http://www.tweedy.com/resources/library_docs/papers/HowHedgingOct2014Fund.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;TWEEDY, BROWNE FUND INC&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However there is clear evidence this is not the case over the short term. Take Japan for example, the two largest ETFs &lt;code&gt;EWJ&lt;/code&gt; in red and the currency hedged &lt;code&gt;DXJ&lt;/code&gt; in blue. &lt;a href=&quot;https://i.stack.imgur.com/1hj7U.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/1hj7U.png&quot; alt=&quot;EWJ vs DXJ total return&quot;&gt;&lt;/a&gt;. There are clear periods where one variant is more a preferable investment over the other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using interest rates, currency rates and some other metrics how can you decide to use a currency hedged ETF or not? Can the same approach be applied to regional ETFs (EEM, EFA exc.)?&lt;/p&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="1764" LastEditDate="2015-07-28T00:03:39.143" LastActivityDate="2017-03-07T18:22:59.267" Title="To currency hedge or not to currency hedge (ETFs)?" Tags="&lt;risk&gt;&lt;fx&gt;&lt;exposure&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19044" PostTypeId="2" ParentId="19041" CreationDate="2015-07-28T00:02:44.693" Score="1" Body="&lt;p&gt;It is simply the difference between &quot;today&quot; and the cash flow date in years. A 30-years bond paying semi-annual coupons has 60 cash flows, and each cash flow has its own &quot;TTM&quot;.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2015-07-28T00:02:44.693" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19045" PostTypeId="2" ParentId="19043" CreationDate="2015-07-28T00:14:23.633" Score="3" Body="&lt;p&gt;A famous article many years ago was &lt;a href=&quot;http://www.hbs.edu/faculty/Pages/item.aspx?num=5305&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Free Lunch in Currency Hedging&lt;/a&gt; by Andre Perold (1988). It showed that while currency hedging does not change long term returns, it does reduce volatility. Thus, for a mean variance investor, it could be beneficial. This is because FX is not much correlated with equity returns, and thus accepting FX risk adds unnecessary volatility (an argument first made by Solnik in 1974).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An argument for not hedging was made by Froot in 1993 &lt;a href=&quot;http://www.people.hbs.edu/kfroot/oldwebsite/cvpaperlinks/currency_hedging.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Currency hedging over long horizons&lt;/a&gt;: because in the long run you benefit from the purchasing power parity effect in FX. (For example if you are a US investor who has some investments abroad and there is a long period of high inflation at home, the USD will depreciate and your foreign assets will be worth more, providing some inflation protection).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A recent paper on this issue is Schmittman: &lt;a href=&quot;https://www.imf.org/external/pubs/cat/longres.cfm?sk=23994.0&quot; rel=&quot;nofollow noreferrer&quot;&gt;Currency Hedging for International Portfolios, IMF, June 2010&lt;/a&gt;. Again hedging is shown to reduce volatility. But how much depends on what your home currency is.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2017-03-06T15:02:59.080" LastActivityDate="2017-03-06T15:02:59.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19046" PostTypeId="2" ParentId="19038" CreationDate="2015-07-28T01:13:55.397" Score="0" Body="&lt;p&gt;Risk-neutral is just one of the many possible measures. It's the most common because we can discount an asset by the risk-free rate under this measure. Of course, we can use any other measure, such as pricing under the stock measure. The mathematics will be very similar, you'll still try to form a martingale under the measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In @Farahvartish's answer, you can basically replace N with anything.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2015-07-28T01:13:55.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19047" PostTypeId="2" ParentId="18748" CreationDate="2015-07-28T05:14:36.927" Score="3" Body="&lt;p&gt;You can see fairly quickly that an exact answer to this question is not going to be feasible because your functional transformation is to take the square root of $\sigma_t^2$, and the square root function has a countably infinite number of derivatives. This implies that a Taylor expansion is going to leave us with a countably infinite number of terms, most of which won't vanish.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So is all hope lost? No. Interestingly enough, for an appropriate choice of constant to expand around, the first order term in the Taylor expansion drops out, and the second term is known, so we can get a fairly good approximation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, define $c_0 = \mathbb{E} \sigma_t^2$, which, as you point out in the question, is a known quantity. Note also that $\mathbb{V} \sigma_t^2$ is a known quantity (it is a reasonably complicated function of the parameters of the GARCH model - I can't remember the reference off the top of my head but you should be able to google it fairly easily). Using Taylor's theorem, we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\sigma_t = \sqrt{c_0} + \frac{1}{2} c_0^{-\frac{1}{2}}(\sigma_t^2 - c_0) - \frac{1}{8} c_0^{\frac{-3}{2}}(\sigma_t^2 - c_0)^2 + R&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $R$ is the remainder term from the expansion. Taking expectations of both sides, you can see immediately that the first order term is going to vanish, since we will get $(\mathbb{E} \sigma_t^2 - c_0)$ which by definition of $c_0$ will equal zero. Further, note the bracketed portion of the second order term will become $\mathbb{E} (\sigma_t^2 - c_0)^2$ which again, given our initial choice of $c_0$, will simplify to $\mathbb{V} \sigma_t^2$. Thus, assuming that $\mathbb{E} R$ is small, we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathbb{E} \sigma_t \approx \sqrt{\mathbb{E} \sigma_t^2} - \frac{1}{8} (\mathbb{E} \sigma_t^2)^{\frac{-3}{2}} (\mathbb{V} \sigma_t^2)&#xA;\end{equation} &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I said before, $\mathbb{E} \sigma_t^2$ and $\mathbb{V} \sigma_t^2$ are both known expressions w.r.t. to the parameters of the model, and so the right hand side of this equation is known (albeit it would be very messy if I wrote it out with all the parameters from a GARCH model).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how good is the above approximation? Initially I was tempted to suggest that it might be quite good (I was short on time and it seemed an easy way to tie off the answer). However, the comment made by @ZacharyBlumenfeld is a good one, and now I'm not so sure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are many factors at play here, some promising, and some not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) The series has alternating signs, i.e. $x_1 + x_2 - x_3 + x_4 - x_5 + ...$. This is good, as the conditions for a series with alternating signs to converge are much weaker than for a series with the same sign.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) The Taylor coefficients get small quite quickly. They go up in the factorial, i.e. $\frac{1}{2!}, \frac{1}{3!}, \frac{1}{4!}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) If $\omega &amp;gt; 1 - \alpha - \beta$, then $c_0 &amp;gt; 1$ and so $c_0^{k}$ gets small quickly as $k \rightarrow -\infty$. This is good. However, note that if $\omega &amp;lt; 1 - \alpha - \beta$ we get the opposite effect, which would be bad. So the parameters of the model matter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) We have moments of $\sigma_t^2$ increasing as the terms increase. This is the one that worries me the most. I'm fairly sure I read a paper a while back on laws of large numbers for GARCH processes that shows that under quite reasonable conditions, higher moments of $\sigma_t^2$ may not exist, i.e. are infinite. This would be very bad for our approximation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this question is really important to you, I would recommend leveraging the wonderful amount of computing power we have these days and running some simulations for different input parameter values and seeing how good the above approximation really is. Feel free to report back here with your findings!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers, hope this helps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-colin&lt;/p&gt;&#xA;" OwnerUserId="2998" LastEditorUserId="2998" LastEditDate="2015-08-11T00:15:25.137" LastActivityDate="2015-08-11T00:15:25.137" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19048" PostTypeId="1" CreationDate="2015-07-28T05:28:39.783" Score="4" ViewCount="451" Body="&lt;p&gt;Consider two sample portfolio optimizations:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Optimization 1:&lt;/strong&gt;&lt;br&gt;&#xA;$\begin{matrix}&#xA;\\ \min \frac{1}{2} w'\Sigma w &#xA;\\ w'\mu = r&#xA;\\ Aw = 0&#xA;\\ w_l \le w \le w_u&#xA;\end{matrix}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Optimization 2:&lt;/strong&gt;&lt;br&gt;&#xA;$\begin{matrix}&#xA;\\ \min \frac{1}{2} w'\Sigma w - \lambda_1 (w'\mu - r)^2 - \lambda_2 w'(A'A)w&#xA;\\ w_l \le w \le w_u&#xA;\end{matrix}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In both cases (wherever applicable):&lt;br&gt;&#xA;$\begin{matrix}&#xA;\\ w, w_l, w_u \in \mathbb{R}^{N\times 1}&#xA;\\ \Sigma \in \mathbb{R}^{N \times N}&#xA;\\ A \in \mathbb{R}^{m \times N}&#xA;\\ r, \lambda_1, \lambda_2 \in \mathbb{R}^{1 \times 1}&#xA;\end{matrix}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $N$ is the number of instruments and $m$ is the number of constraints&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question - Calibration of $\lambda_1$ and $\lambda_2$&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;In the first Optimization, which uses &lt;strong&gt;hard&lt;/strong&gt; constraints, we don't have to calibrate any $\lambda_1$, $\lambda_2$, however there is a possibility that the optimization is infeasible, or the constraints are too binding (causing the optimal answer to be very poor compared to practically desired portfolios)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In the second Optimization, the  &lt;strong&gt;soft&lt;/strong&gt; constraints can ensure the optimization is feasible and the constraints are also not overly binding if necessary, but it is not clear how to calibrate or set reasonable values of $\lambda_1$ or $\lambda_2$ so that there is a balance between the original objective function $w'\Sigma w$ and the penalties? Example, in this case, too small values of $\lambda_1$ and $\lambda_2$ will make the objective function equivalent to $w'\Sigma w$, and too large values will ignore the original objective function altogether.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Has this sort of problem been looked at before? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this sort of problem have a name? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any papers or academic work related to this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any work that has evaluated such pros and cons in more detail?&lt;/p&gt;&#xA;" OwnerUserId="5948" LastEditorUserId="5948" LastEditDate="2015-07-28T12:43:31.770" LastActivityDate="2017-09-29T02:45:10.660" Title="soft vs hard contraints in portfolio optimizations" Tags="&lt;portfolio-optimization&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19049" PostTypeId="1" CreationDate="2015-07-28T06:54:43.393" Score="2" ViewCount="95" Body="&lt;p&gt;I downloaded data from NSE(National Stock Exchange) website regarding closing price of European &lt;strong&gt;Call&lt;/strong&gt; Option written on Index.&#xA;From standard textbook, I read that option contract must satisfy&#xA;$C(t) \geq S(t)e^{-dt} - Ke^{-rt}$&#xA;where S(t) is the value of underlying Security, d is the dividend rate, r is risk free rate of interest, k is strike price, and t is time to maturity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I calculated minimum price, i found many contract were priced less than their minimum price. Not only these, such contract were evenly distributed across various maturities  so not restricted to just near the maturity , say less than one week. Further not only highly deep in the money contract but many contract near the money found below their minimum price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I read in book, if option traded at below minimum price it would lead to arbitrage opportunity. I want to know why these contracts price  below their minimum price? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To calculate Minimum price, I used following methodology : &#xA;1) Option contract having volume less than 500 is excluded. So only actively traded option contracts are considered. &#xA;2) Risk free rate of interest is proxy by treasury rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your answer will be appreciated.&#xA;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="9336" LastEditDate="2015-07-28T08:47:07.643" LastActivityDate="2015-07-28T08:47:07.643" Title="why many option contract price less than minimum boundary price?" Tags="&lt;option-pricing&gt;&lt;derivatives&gt;&lt;asset-pricing&gt;&lt;option-strategies&gt;" AnswerCount="0" CommentCount="7" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19050" PostTypeId="1" AcceptedAnswerId="19109" CreationDate="2015-07-28T08:51:07.003" Score="0" ViewCount="170" Body="&lt;p&gt;I am interested in aggregated Amihud ratios measures over bond groups. For a large panel data set with daily bond prices and volumes I have calculated already Amihud ratios per ISIN/day.&lt;br&gt;&#xA;Naive aggregation of the Amihud ratios over subgroups of bonds would yield biased results however, as daily returns appear to be increasing in Coupon rates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is: Is there a computational way to immunize differences in coupon rates across bonds, i.e. is there an approach to construct daily zero coupon returns to increase comparability?  &lt;/p&gt;&#xA;" OwnerUserId="17047" LastActivityDate="2015-07-30T17:58:56.417" Title="Transforming coupon bond returns to ZC bond returns" Tags="&lt;fixed-income&gt;&lt;zero-coupon&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19051" PostTypeId="1" AcceptedAnswerId="19055" CreationDate="2015-07-28T09:16:55.013" Score="3" ViewCount="113" Body="&lt;p&gt;I am trying to compare 2 equity funds, I have 10Y of monthly returns (no knowledge of their share allocations) - and their index benchmark returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;They are both Value managers but I am not looking for qualitative comparisons. Are there any clever/interesting ways of going about doing this comparison that you may know of, aside from showing the usual YTD, MTD, 1Y,2Y returns and Sharpe ratio, drawdowns,...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Thanks&lt;/p&gt;&#xA;" OwnerUserId="17048" LastActivityDate="2015-07-28T12:54:26.473" Title="Comparing Equity Funds" Tags="&lt;equities&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19052" PostTypeId="1" CreationDate="2015-07-28T09:56:09.393" Score="4" ViewCount="2424" Body="&lt;p&gt;When it comes to foreign exchange carry trade strategy, the definition is straightforward: an investor borrows 1 US-\$ in the US (low interest country) and invests that \$1 to AU (high interest country). By doing so, his dollar denominated return will be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$R_{t+1}^i = \frac{S_{t+1}^i}{S_{t}^i}(1+r_{f,t}^i) - (1+r_{f,t}^{US})$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;span class=&quot;math-container&quot;&gt;$S_t$&lt;/span&gt; is the exchange rate today, and &lt;span class=&quot;math-container&quot;&gt;$S_{t+1}$&lt;/span&gt; is the exchange rate at time &lt;span class=&quot;math-container&quot;&gt;$t+1$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$r_f$&lt;/span&gt; is the risk-free interest rate in the corresponding country.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the literature on the subject suggests using synthesized carry trade using forward contract, that is, buying forward AU currency at time &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt; with delivery for &lt;span class=&quot;math-container&quot;&gt;$t+1$&lt;/span&gt;, and then the difference between spot rate at time &lt;span class=&quot;math-container&quot;&gt;$t+1$&lt;/span&gt; and forward rate would be the return to the investor:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$R_{t+1}^i = \frac{S_{t+1}^i}{F_{t,t+1}^i} -1 = \frac{S_{t+1}^i (1+r_{f,t}^i)}{S_{t}^i (1+r_{f,t}^{US})} -1$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apparently, the latter is a common way FX carry trade is actually implemented. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to recall that return to Carry Trade strategy consists of both:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Gain on appreciation of investment currency&lt;/li&gt;&#xA;&lt;li&gt;Gain on interest rate differential, that is, that after you borrowed&#xA;in US and lent in AU, the payments you receive from investing in AU&#xA;are higher than what you need to pay to the lender of USD.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;It seems to me that using forwards approach, you capture the gain on FX appreciation of high-yield currency, but you don't actually capture the gain on interest rate differential. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, my question is whether these two ways of implementing carry trade give actually different returns, or they are actually equivalent (despite me not seeing that)?&lt;/p&gt;&#xA;" OwnerUserId="13262" LastEditorUserId="29318" LastEditDate="2019-09-09T08:32:58.997" LastActivityDate="2019-09-09T08:32:58.997" Title="Carry Trade vs synthetic Carry Trade using forward contracts" Tags="&lt;fx&gt;&lt;returns&gt;&lt;forward&gt;&lt;synthetic&gt;&lt;trade&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="19053" PostTypeId="2" ParentId="19038" CreationDate="2015-07-28T11:14:24.587" Score="3" Body="&lt;p&gt;&lt;strong&gt;How to use the stock as Numeraire:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{\tilde{E}}[e^{-rT}(S_T-K)^+]=\mathbb{\tilde{E}}\left[e^{-rT}S_T\left(1-\frac{K}{S_T}\right)^+\right]$$&#xA;$$=S_0\mathbb{\tilde{E}}\left[\frac{e^{-rT}S_T}{S_0} \left(1-\frac{K}{S_T}\right)^+\right]$$&#xA;$$=S_0\mathbb{\hat{E}}\left[\left(1-\frac{K}{S_T}\right)^+\right]$$&#xA;Where under $\mathbb{\hat{P}}$ the stock follows $dS=(r+\sigma^2)Sdt+\sigma S d\hat{W}_t$.&#xA;The rest is straightforward computation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How $\mathcal{N}(d_1)$ is the probability that the option expires in the money under the stock measure:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The delta of a call option is $\frac{\partial C}{\partial S}$.  Writing the value of a call options as &#xA;$\mathbb{\tilde{E}}[e^{-rT}(S_T-K)^+]=\mathbb{\tilde{E}}[e^{-rT}(S_0e^{(r-\frac{\sigma^2}{2})T+\sigma W_T}-K)^+]$ and taking the derivative with respect to $S_0$,&#xA;$$\frac{\partial C}{\partial S}=\mathbb{\tilde{E}}\left[e^{-rT}(e^{(r-\frac{\sigma^2}{2})T+\sigma W_T})\mathbb{I}_{S_T&amp;gt;K}\right]$$&#xA;Where $\mathbb{I}$ is the indicator function.&#xA;$$=\mathbb{\tilde{E}}\left[e^{\sigma W_T-\frac{T\sigma^2}{2}}\mathbb{I}_{S_T&amp;gt;K}\right]$$&#xA;$$=\mathbb{\hat{E}}\left[\mathbb{I}_{S_T&amp;gt;K}\right]=\mathbb{\hat{P}}(S_T&amp;gt;K)$$&lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2015-07-28T11:14:24.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19054" PostTypeId="1" AcceptedAnswerId="19057" CreationDate="2015-07-28T11:55:32.090" Score="0" ViewCount="667" Body="&lt;p&gt;I am trying to understand how to calculate the discount factors $disc(TTM)$ mentioned on Page 9 of &lt;a href=&quot;http://www.bankofcanada.ca/wp-content/uploads/2010/01/tr84.pdf&quot; rel=&quot;nofollow&quot;&gt;this pdf&lt;/a&gt;. When I'm calculating the discount factors,  mentioned each bond has its own cash flow and cash flow time vector. Wouldn't this imply that since there are as many TTM Vectors as there are bonds, there will be as many $disc(TTM)$ values as there are bonds, and as a result the discount vector will have as many rows as there are bonds? However, shouldn't it have as many rows as the number of cash flows of the bond with the longest time to maturity (Only then would we be able to multiply the matrix of coupons and face values ($A$) with the discount vector ($P$) as listed &lt;a href=&quot;https://en.wikipedia.org/wiki/Yield_curve&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: I apologize if I've asked a question similar to this one. But I'm trying to gather as much information as I can and ask this question thats been plaguing me as clearly as possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank You&lt;/p&gt;&#xA;" OwnerUserId="11917" LastActivityDate="2015-07-28T13:52:22.983" Title="Calculating discount factors using Nelson Siegel Svensson model" Tags="&lt;fixed-income&gt;&lt;bond&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19055" PostTypeId="2" ParentId="19051" CreationDate="2015-07-28T12:54:26.473" Score="3" Body="&lt;p&gt;Most literature focus on comparing fund returns using a model alpha. A good overview is: &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/j.1540-6261.1997.tb03808.x/pdf&quot; rel=&quot;nofollow&quot;&gt;Cahart (1997)&lt;/a&gt; and &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S0304405X15000628&quot; rel=&quot;nofollow&quot;&gt;Berk and Binsbergen (2015)&lt;/a&gt;.&#xA;Basically you regress the fund returns on most common used factors (market return, HML, SMB, Liquidity and Momentum factors) and compare alphas after fees. &lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-07-28T12:54:26.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19056" PostTypeId="1" CreationDate="2015-07-28T13:34:30.527" Score="3" ViewCount="376" Body="&lt;p&gt;I have a question about the solution of the Black-Scholes PDE for the European call option when I read the book Stochastic Calculus for Finance II of Steven E.Shreve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $c(t,x)$ be the value of the European call option at time $t$ if the stock price at that time is $S(t)=x$. Then, $c(t,x)$ satisfies the following equation:&#xA;$$c_t(t,x) + r x c_x(t,x)+ \frac{1}{2} \sigma^2 x^2 c_{xx}(t,x)=rc(t,x) \text{ for all $t\in [0, T), x\geq 0$},$$&#xA;and $c(T, x)=(x-K)^{+}.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To resolve the above equation, one needs boundary conditions at $x=0$ and $x= +\infty$. For $x=0$. It's easy to derive that $c(t,0)=0$ for all $t \in [0,T]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As $x=+\infty$, I do not know understand how the author finds out (w/o a detailed explanation)(c.f. page 158 in that book) that&lt;br&gt;&#xA;$$\lim_{x \rightarrow +\infty} c(t,x)- (x- e^{-r (T-t) }K) =0 \text{ for all $t \in [0, T]$}?$$&lt;/p&gt;&#xA;" OwnerUserId="17050" LastEditorDisplayName="user16891" LastEditDate="2015-07-29T07:09:24.107" LastActivityDate="2015-10-27T08:41:45.633" Title="About the boundary conditions of the Black-Scholes-Merton PDE" Tags="&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19057" PostTypeId="2" ParentId="19054" CreationDate="2015-07-28T13:46:32.460" Score="1" Body="&lt;p&gt;You really don't even need to put them into matrices, which I feel is confusing you more than helping...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For each bond, you have a list of cash flows ($c_i$'s). For each cash flow, you can compute the corresponding discount factor ($d(t_i)$'s). Sum up the discounted cash flows gets you the theoretical price: $P = \sum_i c_i d(t_i)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Repeat this for every bond, and add up all the (weighted squared) errors. That's the thing you need to minimize.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2015-07-28T13:52:22.983" LastActivityDate="2015-07-28T13:52:22.983" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="19058" PostTypeId="2" ParentId="19056" CreationDate="2015-07-28T15:00:14.907" Score="1" Body="&lt;p&gt;In words the equation says that when the stock price is very high, the value of the call is (approximately) equal to the stock price minus the PV of the exercise. It is fairly intuitive: if K=100 and x is 1000, the stock is so much above K that exercise is for all practical purposes certain; the call today is worth x minus PV(k), since you can set aside PV(K) today today to exercise at maturity. So it is an arbitrage argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This equation is sometimes called the deep-in-the-money bound for the value of a European call.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2015-07-28T15:50:27.560" LastActivityDate="2015-07-28T15:50:27.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19059" PostTypeId="5" CreationDate="2015-07-28T15:30:11.587" Score="0" Body="&lt;p&gt;A dividend is a distribution of a portion of a company's earnings, decided by the board of directors, to a class of its shareholders. Dividends can be issued as cash payments, as shares of stock, or other property.&#xA;The definition of dividend can be broken down into categories such as:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Cash dividends&lt;/strong&gt; are the most common form of payment and are paid out in currency, usually via electronic funds transfer or a printed paper check. Such dividends are a form of investment income and are usually taxable to the recipient in the year they are paid. This is the most common method of sharing corporate profits with the shareholders of the company. For each share owned, a declared amount of money is distributed. Thus, if a person owns 100 shares and the cash dividend is 50 pence per share, the holder of the stock will be paid GBP £50. Dividends paid are not classified as an expense, but rather a deduction of retained earnings. Dividends paid does not show up on an income statement but does appear on the balance sheet.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Stock or scrip dividends&lt;/strong&gt; are those paid out in the form of additional stock shares of the issuing corporation, or another&#xA;corporation (such as its subsidiary corporation). They are usually&#xA;issued in proportion to shares owned (for example, for every 100&#xA;shares of stock owned, a 5% stock dividend will yield 5 extra&#xA;shares).&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Stock dividend distributions&lt;/strong&gt; are issues of new shares made to limited partners by a partnership in the form of additional shares.&#xA;Nothing is split, these shares increase the market capitalization&#xA;and total value of the company at the same time reducing the&#xA;original cost basis per share.&lt;/li&gt;&#xA;&lt;li&gt;Stock dividends are not includable in the gross income of the&#xA;shareholder for US income tax purposes. Because the shares are&#xA;issued for proceeds equal to the pre-existing market price of the&#xA;shares; there is no negative dilution in the amount recoverable.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Property dividends or dividends in specie&lt;/strong&gt;  are those paid out in the form of assets from the issuing corporation or another&#xA;corporation, such as a subsidiary corporation. They are relatively&#xA;rare and most frequently are securities of other companies owned by&#xA;the issuer, however they can take other forms, such as products and&#xA;services.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Interim dividends&lt;/strong&gt; are dividend payments made before a company's Annual General Meeting (AGM) and final financial statements. This&#xA;declared dividend usually accompanies the company's interim&#xA;financial statements.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Other dividends can be used in structured finance. Financial assets with a known market value can be distributed as dividends; warrants are sometimes distributed in this way. For large companies with subsidiaries, dividends can take the form of shares in a subsidiary company. A common technique for &quot;spinning off&quot; a company from its parent is to distribute shares in the new company to the old company's shareholders. The new shares can then be traded independently.&lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastEditorDisplayName="user16891" LastEditDate="2015-07-29T03:01:38.207" LastActivityDate="2015-07-29T03:01:38.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19060" PostTypeId="4" CreationDate="2015-07-28T15:30:11.587" Score="0" Body="A dividend is a payment made by a corporation to its shareholders, usually as a distribution of profits." OwnerDisplayName="user16891" LastEditorDisplayName="user16891" LastEditDate="2015-07-29T03:00:51.847" LastActivityDate="2015-07-29T03:00:51.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19061" PostTypeId="1" AcceptedAnswerId="19062" CreationDate="2015-07-28T16:51:03.393" Score="1" ViewCount="102" Body="&lt;p&gt;Recently I've been learning about the markowitz algorithm. It's pretty interesting, but I'm curious how we apply this in practice. Lets say I have some optimal portfolio:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$R_p = x_aR_a + x_bR_b$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which for simplicity's sake, we will say is just a simple two asset portfolio. This question will apply to a portfolio with a riskless asset and a tangency portfolio as well, and the n-asset case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's suppose the markowitz algorithm says&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;x_a = 0.34938&#xA;$$&#xA;$$&#xA;x_b = 0.65062&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is fine in theory, but now how do we buy the stock? If I have $10,000 to invest then my dollar value given to asset A is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$10,000 * 0.34938$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and my dollar value in asset B is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$10,000 * 0.65062$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if I go to my broker and say &quot;buy me $3493.8 dollars worth of asset A&quot;, I will most likely be buying some fraction of a share of a company to get this exact value. I'm not aware of a case where you can buy fractional shares of a company via a broker.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a rule to go by here to use these weights, or am I not understanding how to apply them correctly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="17052" LastActivityDate="2015-07-28T16:58:16.823" Title="Understanding portfolio weights and purchasing stock in modern portfolio theory" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;asset-allocation&gt;&lt;markowitz&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19062" PostTypeId="2" ParentId="19061" CreationDate="2015-07-28T16:58:16.823" Score="2" Body="&lt;p&gt;That's the way you apply. Usually you get the closest number of shares possible. However, if you use that strategy you are very likely to underperform the market.&#xA;Check table 3 on &lt;a href=&quot;http://faculty.london.edu/avmiguel/DeMiguel-Garlappi-Uppal-RFS.pdf&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt; for the Out of sample performance of the Markowitz strategy. Over their sample the Sharpe Ratio is 0.07 whereas a simple naive strategy 1/N yielded 0.18.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-07-28T16:58:16.823" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19063" PostTypeId="1" AcceptedAnswerId="19064" CreationDate="2015-07-28T17:13:28.883" Score="0" ViewCount="40" Body="&lt;p&gt;I am a programmer interning at a small contract furniture company. This company receives multiple discounts from the manufacturers, and I am trying to calculate the end discount. For example, the first discount is 50%, the second discount is 20% off that price, and the third is 20% of that, then the total discount is 68%. They already have an Excel worksheet that calculates this, but I want to write a recursive function that can perform this calculation as many times as is necessary. My question is; what is this type of discounting called?&lt;/p&gt;&#xA;" OwnerUserId="17053" LastActivityDate="2015-07-28T17:34:11.437" Title="Compound Discounting(?)" Tags="&lt;accounting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19064" PostTypeId="2" ParentId="19063" CreationDate="2015-07-28T17:34:11.437" Score="0" Body="&lt;p&gt;This is in general simply referred to as compounding. In functional terms, consider the inefficient python code below&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def total_discount(rates):&#xA;    return (1.0 - discount(1.0, rates))*100.0&#xA;&#xA;def discount(original, rates):&#xA;    if len(rates) == 1:&#xA;        return (1.0-rates[0]/100.0)*original&#xA;    else:&#xA;        return (1.0-rates[0]/100.0)*discount(original, rates[1:])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This type of thing is often seen in forward rates.&lt;/p&gt;&#xA;" OwnerUserId="4910" LastActivityDate="2015-07-28T17:34:11.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19065" PostTypeId="2" ParentId="19043" CreationDate="2015-07-28T18:52:55.330" Score="1" Body="&lt;p&gt;There is an interesting relationship between currency hedging and the carry trade. It can be shown that currency hedging will add to returns iff the carry trade is profitable. The two are equivalent if you think it through. So for example in the past 20 years interest rates have been very low in Japan and it has been profitable to borrow in Japan and invest abroad (i.e. the carry trade). It has also been a good idea for Japanese investors to hedge their foreign investments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You ask about interest rates. I would suggest that currency hedging makes the most sense for an investor in a low interest rate country (such as Japan) when investing abroad in a high interest rate country (such as Australia).&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2015-07-28T18:52:55.330" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19066" PostTypeId="1" CreationDate="2015-07-28T19:00:19.217" Score="3" ViewCount="3362" Body="&lt;p&gt;I have a matrix of returns and weights for every time period.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;returns&amp;lt;-rbind(c(-0.05,0.04,0.37),c(0.15,0.02,-0.07))&#xA;weights&amp;lt;-rbind(c(0.5,0.1,0.4),c(0.4,0.2,0.4))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to rebalance the weights at the end of every time period:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To do so I first calculate percent change every month in the returns:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ones &amp;lt;- matrix(1,ncol=ncol(returns),nrow=nrow(returns))&#xA;add &amp;lt;- returns&#xA;percentChange &amp;lt;- ones+add&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then I calculate the total change:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;percentChangeSums &amp;lt;- rowSums(percentChange*weights) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then I calculate the weights after accounting for the returns:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;WeightsBefore &amp;lt;- weights * percentChange&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I calculate how much I should invest in the shares to have the original weights I wanted to maintain:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ShareAfter &amp;lt;- percentChangeSums * weights &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Just to check that I still have the original weights:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;WeightsAfter &amp;lt;- ShareAfter/percentChangeSums&#xA;&#xA;&#xA;rebalanced.weights &amp;lt;- ShareAfter&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My goal is to do this without using any built in functions (e.g. the ones in the PerformanceAnalytics package).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that I get different results from the built in functions (&lt;code&gt;Return.portfolio()&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I missing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on XY's comment I modified my code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;return &amp;lt;- rbind(c(-5,4,37),c(15,2,-7))&#xA;&#xA;weights &amp;lt;- rbind(c(0.5,0.1,0.4), c(0.5,0.1,0.4),c(0.5,0.1,0.4))&#xA;&#xA;N=3&#xA;add &amp;lt;- return/100&#xA;ones &amp;lt;- matrix(1,ncol=N,nrow=nrow(return))&#xA;ShareAfter &amp;lt;- matrix(NA,ncol=N,nrow=nrow(return))&#xA;firstPeriodReturns &amp;lt;- weights[1,]*add[1,]&#xA;percentChange &amp;lt;- ones+add&#xA;&#xA;&#xA;WeightsBefore &amp;lt;- weights[1,] * percentChange[1,]&#xA;percentChangeSums &amp;lt;- sum(WeightsBefore)&#xA;&#xA;ShareAfter[1,] &amp;lt;- percentChangeSums * weights[1,] &#xA;&#xA;for (i in 2:nrow(return)){&#xA;&#xA;  WeightsBefore &amp;lt;- ShareAfter[i-1,] * percentChange[i,]&#xA;  percentChangeSums &amp;lt;- sum(WeightsBefore)&#xA;&#xA;  ShareAfter[i,] &amp;lt;- percentChangeSums * weights[i,]   &#xA;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I still do not get the desired result.&#xA;Can someone point me to whats missing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please note again I want to do this manually, not with a package.&lt;/p&gt;&#xA;" OwnerUserId="17055" LastEditorUserId="-1" LastEditDate="2015-08-01T17:44:38.867" LastActivityDate="2015-08-01T17:44:38.867" Title="Rebalancing portfolio weights" Tags="&lt;r&gt;&lt;portfolio&gt;&lt;rebalancing&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19067" PostTypeId="2" ParentId="19043" CreationDate="2015-07-28T20:59:24.503" Score="1" Body="&lt;p&gt;GMO recently published on this (&quot;The Case for Not Currency Hedging Foreign Equity Investments: A U.S. Investor’s Perspective&quot; &lt;a href=&quot;https://www.gmo.com/docs/default-source/research-and-commentary/strategies/asset-allocation/cl_currrencyhedging_4-153cd2212e8b9d64339213ff0000a1a898.pdf?sfvrsn=6&quot; rel=&quot;nofollow&quot;&gt;1&lt;/a&gt;).  The basic take-away is that anytime the company or ETF's underlying fundamentals should have nothing to do with the trading currency, it could make sense to &lt;em&gt;not&lt;/em&gt; hedge.  Think, in the simple case, of a company that is US domiciled and has all revenues and costs in USD but happens to trade in GBP on the London Stock Exchange when USDGBP = 1.  Then, imagine the scenario where the pound loses half its value to the dollar.  Since nothing has changed fundamentally to the underlying asset, then, &lt;em&gt;in theory&lt;/em&gt;, the price in nominal terms should double.  Hence, your hedge would have made you money while there was no change in the value of the underlying asset - which was not the intended purpose of the trade.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;GMO cites the major areas (in equity land) where they would avoid hedging as export-oriented companies, multinationals and commodity producers.  They also rightly note that you should always hedge fixed income products as they represent the discounted value of future cash flows in the local currency.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I believe the basis for an argument to not hedge comes with some caveats - key among which are the fact that you must assume your portfolio or ETF is globally diversified and that your holding period is significantly long (&gt; 5 years).  In reality, it can take some time before the underlying asset prices adjust like in the hypothetical example provided.  Hence, when choosing between a currency hedged or non-currency hedged ETF, it makes sense to take a look at the underlying assets as well as your intended holding period.  My key takeaway would be as follows: &lt;em&gt;the idea that hedging will reduce the volatility of the portfolio in the shorter term rests on the correlation between the currency and underlying being zero or negative – which must persist for efficacy.  Separately, without a long term view and a globally diversified portfolio, it may make little sense to ignore the FX trading risk for each position.&lt;/em&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So perhaps you dont need to use rates or FX to determine this (although high FX vol amplifies the risk from making the wrong choice).  Instead, analysis of the underlying assets and the markets in which they trade should help to get you the answer.  As another example, consider an ETF of Swiss exporters that was hedged against moves in CHF.  What happened to this asset in January of 2015 when the SNB abandoned the floor against the EUR? The hedge incurred large losses as the CHF appreciated drastically but the asset got crushed too because people expected swiss stocks to lose if the CHF appreciated beyond the floor.  Perhaps in a case like this you would have chosen to invest unhedged.  &lt;/p&gt;&#xA;" OwnerUserId="826" LastActivityDate="2015-07-28T20:59:24.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19068" PostTypeId="1" CreationDate="2015-07-28T21:01:43.897" Score="0" ViewCount="874" Body="&lt;p&gt;I had previously asked &lt;a href=&quot;https://quant.stackexchange.com/questions/19001/setting-input-parameters-for-nelson-siegel-svensson-model/19004#19004&quot;&gt;this question&lt;/a&gt; and have come to better understand the answer with regards to setting the input parameters for the Non-Linear Optimization problem that provides the NSS parameters. However, I realize that the answer assumes that I have zero coupon yields and can thus use the equation (2) on Page 2 of &lt;a href=&quot;http://comisef.eu/files/wps031.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;this pdf&lt;/a&gt; in order to obtain the input NSS parameters. However, if I don't have the Zero-Coupon Yield data, how may I proceed in order to obtain the input parameters. Would I need to bootstrap these Yields and if so, won't this hamper the whole process of obtaining a satisfactory solution to the Non-Linear Optimization problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank You&lt;/p&gt;&#xA;" OwnerUserId="11917" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2015-07-29T14:08:50.640" Title="Legitimate input parameters for Nelson Siegel Svensson model" Tags="&lt;fixed-income&gt;&lt;bond&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19069" PostTypeId="5" CreationDate="2015-07-28T22:27:29.623" Score="0" Body="&lt;p&gt;The &lt;a href=&quot;http://elis.sigmath.es.osaka-u.ac.jp/research/Heston-original.pdf&quot; rel=&quot;nofollow&quot;&gt;Heston model&lt;/a&gt; assumes that the underlying stock price,$S_t$ follows a Geometric Brownian Motion process but with a stochastic variance $v_t$ that follows a &lt;a href=&quot;http://www.riskmathics.com/files/PODCAST/Cox-Ingersoll-Ross-CIR-interest-rate-model-1985-Wojciech-Szatzschneider.pdf&quot; rel=&quot;nofollow&quot;&gt;Cox, Ingersoll, and Ross&lt;/a&gt; (1985) process. Hence, the Heston model is represented by the bivariate system of stochastic differential equations&#xA;$$ dS_t=\mu S_t dt+\sqrt{v_t}S_t dW_1(t)$$&#xA;$$dv_t=\kappa(\theta-v_t)dt+\sigma\sqrt{v_t}\,dW_2(t)$$&#xA;where $\mathbb{E}^P=[dW_1(t),dW_2(t)]=\rho dt$.The parameters of the model are&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$\mu$ the drift of the process for the stock.&lt;/li&gt;&#xA;&lt;li&gt;$\kappa&amp;gt;0$ the mean reversion speed for the variance.&lt;/li&gt;&#xA;&lt;li&gt;$\theta &amp;gt; 0$ the mean reversion level for the variance.&lt;/li&gt;&#xA;&lt;li&gt;$\sigma &amp;gt; 0$ the volatility of the variance.&lt;/li&gt;&#xA;&lt;li&gt;$\rho \in [−1, 1]$ the correlation between the two Brownian motions $W_1$ and $W_2$.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If the parameters obey the following condition (known as the Feller condition) then the process $v_t$ is strictly positive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$2\kappa\theta\geq\sigma^2$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastEditorDisplayName="user16891" LastEditDate="2015-07-29T07:09:09.873" LastActivityDate="2015-07-29T07:09:09.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19070" PostTypeId="4" CreationDate="2015-07-28T22:27:29.623" Score="0" Body="A type of stochastic volatility model developed by associate finance professor Steven Heston in 1993 for analyzing bond and currency options. The Heston model is a closed-form solution for pricing options that seeks to overcome the shortcomings in the Black-Scholes option pricing model related to return skewness and strike-price bias. &#xD;&#xA;" OwnerDisplayName="user16891" LastEditorDisplayName="user16891" LastEditDate="2015-07-29T07:09:12.780" LastActivityDate="2015-07-29T07:09:12.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19071" PostTypeId="2" ParentId="19068" CreationDate="2015-07-28T23:22:01.110" Score="1" Body="&lt;p&gt;Zero coupon rates are outputs, not inputs. As mentioned in the other post, given the parameters (say the initial guesses), you can easily compute the theoretical prices of each bond, which can then be converted into their theoretical yields (standard price to yield conversion). You should minimize the residuals between these theoretical yields and the market yields.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: I made a pretty crude spreadsheet that illustrates what you need to do: &lt;a href=&quot;https://app.box.com/s/6i3vae7lb02n6glam7vwts7qpuc44q2w&quot; rel=&quot;nofollow&quot;&gt;https://app.box.com/s/6i3vae7lb02n6glam7vwts7qpuc44q2w&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2015-07-28T23:57:02.173" LastActivityDate="2015-07-28T23:57:02.173" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19072" PostTypeId="5" CreationDate="2015-07-29T06:33:33.073" Score="0" Body="&lt;p&gt;The standard Wiener process $W_t$ is characterized by four facts:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$W_0$ = 0&lt;/li&gt;&#xA;&lt;li&gt;$W_t$ is almost surely continuous.&lt;/li&gt;&#xA;&lt;li&gt;$W_t$ has independent increments.The condition that it has independent increments means that if $0\leq s_1\leq t_1\leq s_2\leq t_2$&#xA;then $W_{t_1}-W_{s_1}$ and $W_{t_2}-W_{s_2}$ are independent random variables.&lt;/li&gt;&#xA;&lt;li&gt;$W_{t}-W_{s}\tilde{} N(0,t-s)$ &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerDisplayName="user16891" LastEditorDisplayName="user16891" LastEditDate="2015-07-30T07:26:48.760" LastActivityDate="2015-07-30T07:26:48.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19073" PostTypeId="4" CreationDate="2015-07-29T06:33:33.073" Score="0" Body="In mathematics, Brownian motion is described by the Wiener process; a continuous-time stochastic process named in honor of Norbert Wiener." OwnerDisplayName="user16891" LastEditorDisplayName="user16891" LastEditDate="2015-07-30T07:26:43.037" LastActivityDate="2015-07-30T07:26:43.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19074" PostTypeId="1" AcceptedAnswerId="19077" CreationDate="2015-07-29T07:17:46.140" Score="11" ViewCount="16057" Body="&lt;p&gt;In my project, I have to get the delta of up and out call option (with vol surface). I found out that QuantLib might help me on that.&#xA;Since my main language is python and I don't know well about C++, I installed QuantLib-python, in the hope that python is enough to understand QuantLib. But I couldn't find a well-written documentation about QuantLib-Python. I managed to understand some sources in blog posts, like calculating vanilla call option price. I now think that to do what I want to do, I have to understand the C++ sources in QuantLib. Am I right? Or Would there a better and faster way?&lt;/p&gt;&#xA;" OwnerUserId="17061" LastEditorUserId="308" LastEditDate="2017-02-21T20:49:22.660" LastActivityDate="2020-03-05T09:25:05.670" Title="How to learn QuantLib-python at first?" Tags="&lt;python&gt;&lt;quantlib&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="19075" PostTypeId="2" ParentId="19068" CreationDate="2015-07-29T07:31:43.970" Score="1" Body="&lt;p&gt;A simple example might help. You need to transform your coupon bonds in equivalent zeros. Imagine that you have 5 coupon bonds and you are at the end of 2011:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Coupon, Maturity, Price = 5.25% 2012 101.69&lt;/li&gt;&#xA;&lt;li&gt;Coupon, Maturity, Price = 4.5% 2013 101.52&lt;/li&gt;&#xA;&lt;li&gt;Coupon, Maturity, Price = 5.5% 2014 104.49&lt;/li&gt;&#xA;&lt;li&gt;Coupon, Maturity, Price = 5% 2015 103.35&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;From the first one you can get: $R_{0,1}= 3.5\%$, from the second and first ones you get: $R_{0,1}= 3.70\%$, from the third, second and first you get: $R_{0,3}= 3.9\%$, etc.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="16472" LastEditDate="2015-07-29T14:08:50.640" LastActivityDate="2015-07-29T14:08:50.640" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19076" PostTypeId="1" AcceptedAnswerId="19078" CreationDate="2015-07-29T10:36:46.620" Score="1" ViewCount="411" Body="&lt;p&gt;I am reading some lecture notes about Black-Scholes (BS) option pricing. Since the BS-formula is not supported by observed data because of the dependence of the implied volatility on the strik and time to maturity, three possible solutions are suggested: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Stochastic Volatility Models&lt;/li&gt;&#xA;&lt;li&gt;Local Volatility Models &lt;/li&gt;&#xA;&lt;li&gt;Implied Probability.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The first two make intuitively sense to me but the third does not. So, in my notes is $\dfrac{\partial C(S,t,K,T)}{\partial K} = -e^{-r\tau} \{1 - Q(K)\} \\ &#xA;\implies C(S,t,K,T) = e^{-r\tau} \int^{\infty}_{K} \overline{Q}(K) dK$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you please explain why these results are a solution to the implied volatility problem? &lt;/p&gt;&#xA;" OwnerUserId="13585" LastActivityDate="2015-07-29T12:45:52.853" Title="Connection between implied volatily and implied probability" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;implied-volatility&gt;&lt;volatility-smile&gt;&lt;implied&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19077" PostTypeId="2" ParentId="19074" CreationDate="2015-07-29T11:42:01.030" Score="11" Body="&lt;p&gt;At this time, there's no specific documentation for QuantLib-Python, except for a series of screencasts that I started a while ago (you can find them on YouTube at &lt;a href=&quot;https://www.youtube.com/playlist?list=PLu_PrO8j6XAvOAlZND9WUPwTHY_GYhJVr&quot; rel=&quot;noreferrer&quot;&gt;https://www.youtube.com/playlist?list=PLu_PrO8j6XAvOAlZND9WUPwTHY_GYhJVr&lt;/a&gt;) but which is far from exhaustive; there's just a few of them for now, and there's no definite learning path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the structure of the library in Python is the same as in C++, except for some changes (like the use of &lt;code&gt;std::shared_ptr&lt;/code&gt; in C++ being hidden in Python) that were made so that one could write more idiomatic Python code.  Therefore, you should be able to use the resources listed on the QuantLib site at &lt;a href=&quot;http://quantlib.org/docs.shtml&quot; rel=&quot;noreferrer&quot;&gt;http://quantlib.org/docs.shtml&lt;/a&gt; and translate their advice to the corresponding Python code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One thing you might run into is that not all of QuantLib is exported to Python. Again, there's no documentation of what's there; so when in doubt, search for a feature inside the SWIG interface files to check if it's exported.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: last year, Goutham and I have pooled our material and published the &lt;a href=&quot;https://leanpub.com/quantlibpythoncookbook&quot; rel=&quot;noreferrer&quot;&gt;QuantLib Python Cookbook&lt;/a&gt;. It's still a work in progress, but it might already be useful.&lt;/p&gt;&#xA;" OwnerUserId="308" LastEditorUserId="308" LastEditDate="2017-02-21T14:02:17.480" LastActivityDate="2017-02-21T14:02:17.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19078" PostTypeId="2" ParentId="19076" CreationDate="2015-07-29T12:45:52.853" Score="1" Body="&lt;p&gt;Take a look at Hull's Appendix of the Volatility Smiles chapter. (Chapter 16 in my version). It gives a method to calculate the probability density function based on option prices:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ g(K) = e^{rT} \frac{\partial ^2 c}{\partial K^2} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This result comes from the &lt;a href=&quot;http://www.federalreserve.gov/econresdata/ifdp/2014/files/ifdp1122.pdf&quot; rel=&quot;nofollow&quot;&gt;Breeden Litzenberger 1978 paper&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2015-07-29T12:45:52.853" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19079" PostTypeId="1" AcceptedAnswerId="19172" CreationDate="2015-07-29T13:30:28.793" Score="9" ViewCount="3763" Body="&lt;p&gt;I struggeling with calculating the delta of a swaption. In the interest rate case I usually mess around with the multiple cash flows over time so that the discounting is more complex than in the equity case. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me first introduce some notation. We denote with $D(0,T)$ the discounting factor with maturity $T$, $P(0,T)$ the price of a zero coupon bond with maturity $T$ and let $Q$ denote the risk neutral measure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By simple risk neutral valuation we know:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$D(0,0)V_0 = V_0 = E_Q[V_TD(0,T)|\mathcal{F}_t]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No we are interested in a swaption, where we expiry of the option is at $T_\alpha$ and the underlying swap has a tenor $T_\beta$. The discounted value of the swpation can be writen as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$D(t,T_\alpha)(S_{\alpha,\beta}(T_\alpha)-K)^+\sum_{i=\alpha + 1}^\beta\tau_iP(T_\alpha,T_i)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\tau_i$ is the daycount convention between $T_{i-1}$ and $T_i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now regarding valution using the above two equations:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ V_0 = E_Q[D(0,T_\alpha)(S_{\alpha,\beta}(T_\alpha)-K)^+\sum_{i=\alpha + 1}^\beta\tau_iP(T_\alpha,T_i)|\mathcal{F}_0]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;using a smart change of numeraire, the swap measuer $S$, i.e. the numeraire introduced by $\sum_{i=\alpha + 1}^\beta\tau_iP(t,T_i)$ yield&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ V_0 = E_Q[D(0,T_\alpha)(S_{\alpha,\beta}(T_\alpha)-K)^+\sum_{i=\alpha + 1}^\beta\tau_iP(T_\alpha,T_i)|\mathcal{F}_0]=\sum_{i=\alpha + 1}^\beta\tau_iP(0,T_i)E_S[(S_{\alpha,\beta}(T_{\alpha})-K)^+|\mathcal{F}_0]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know that under the measure $S$, the forward swap rate $S_{\alpha,\beta}(t)$ is a martingale. For the price we could now simple apply Black formula, if we assume that the forward swap rate is normally distributed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now my question, if I would apply the normal calculation for the delta I would get $\sum_{i=\alpha + 1}^\beta\tau_iP(0,T_i) N(d_1)$, where $d_1$ is the expression from Black 76 formula. However this term $\sum_{i=\alpha + 1}^\beta\tau_iP(0,T_i)$ annoys me. I get completely wrong results. If I used just $N(d_1)$ I would get reasonable result. So my question, is the delta given by $N(d_1)$ for a swaption as well? If so, where is my mistake?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For simplicity I add an example with concrete numbers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;example&lt;/strong&gt;&#xA;We take a swaption with expiry $5$ years and underlying tenor of $5$ years.&#xA;$S_{\alpha,\beta}(0) = 0.0271$, $\sigma = 0.34$, $r = 0.011$, $T=5$, $K = 0.028$ and annuity $A=4.92$. Using Black 76 we should get for $\Delta$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta = A\cdot N(d_1),$$ where &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d_1 = \frac{\log{\frac{S_{\alpha,\beta}(0)}{K}}+\frac{\sigma^2\cdot T}{2}}{\sigma\cdot\sqrt{T}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here I get the values $N(d_1) = 0.332296$ and $\Delta = 1.634896$, which doesn't make sense.&lt;/p&gt;&#xA;" OwnerUserId="17133" LastEditorUserId="11678" LastEditDate="2015-08-04T17:41:17.500" LastActivityDate="2015-08-04T23:39:58.993" Title="Greeks of a swaption using Brigo" Tags="&lt;swaption&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19081" PostTypeId="1" CreationDate="2015-07-29T14:18:40.693" Score="8" ViewCount="324" Body="&lt;p&gt;I am using &lt;a href=&quot;https://quant.stackexchange.com/questions/8091/risk-budgets-with-target-portfolio-volatility&quot;&gt;this question&lt;/a&gt; to compute optimal weights following a risk budgeting approach. The problem is I am using non-linear portfolios (options,equity,fixed income,fx). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I am looking for is that each asset class contributes the same amount of risk to the portfolio, and I am sure I can't use the regular approach if I have derivatives in my portfolio.&lt;/p&gt;&#xA;" OwnerUserId="17043" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-12-22T23:00:18.540" Title="How to perform risk budgeting for non-linear portfolios?" Tags="&lt;portfolio-management&gt;&lt;risk-management&gt;&lt;nonlinear&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19082" PostTypeId="1" CreationDate="2015-07-29T14:27:51.693" Score="2" ViewCount="208" Body="&lt;p&gt;What is known about the question:&#xA;If someone buys or sells a huge amount of some asset how the price would change ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, it depends on the kind of assets and other context.&#xA;My main interest is liquid forex market like EURUSD.&#xA;Say someone buy or sell 500 million -  how many pips the price would change ?&#xA;(Time of deal - American session - most liquid time). &#xA;Does it matter the speed of execution ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any way I  would be happy to get any kind of advice on any kind of market not only forex - and any kind of info - theoretical or practical.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know the simple way to estimate - we need to consider the order book and just &#xA;calculate the depth which will cover 500 Million.&#xA;However it seems this method is too naive - since &#xA;order book is a kind of alive - due to HFT guys new orders appear and disappear.&#xA;So it may happen that the price changes and then returns to initial value in  seconds. &lt;/p&gt;&#xA;" OwnerUserId="4652" LastActivityDate="2018-09-27T07:55:40.780" Title="Impact of big order on price" Tags="&lt;order-execution&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19083" PostTypeId="2" ParentId="19082" CreationDate="2015-07-29T14:47:29.107" Score="1" Body="&lt;p&gt;This is probably a nice paper you should refer to: Yogo, Koijen (2015) (&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2537559&amp;amp;download=yes&quot; rel=&quot;nofollow&quot;&gt;link&lt;/a&gt;). &#xA;They estimate an asset pricing model which endogenizes the price impact of large trades. It is a quite hard paper to grasp, so probably you do not want to start here, but is still one of the main references.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-07-29T14:47:29.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19084" PostTypeId="1" AcceptedAnswerId="19089" CreationDate="2015-07-29T14:53:53.173" Score="9" ViewCount="842" Body="&lt;p&gt;I'm struggling to understand the meaning of $d_1$ and $d_2$ in Black &amp;amp; Scholes formula and why they're different from each other. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As per the formula, $$C = SN(d_1) - e^{-rT}XN(d_2)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which means if the call option gets exercised, one would receive the stock and pay the strike price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly, the strike price payment is conditional on the option finishing in the money, ie. future value of this payment is $X \cdot \mathbb{P} (S_T &amp;gt; X)$ and thus discounted present value would be $$e^{-rT}X \cdot \mathbb{P} (S_T &amp;gt; X)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From this we can see that Black &amp;amp; Scholes $N(d_2)$ is the probability of the option exercise (under risk neutral measure).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But then it should logically follow that the first part of the formula - conditional receipt of the stock - should equally depend on the above probability, in which case its future value would be $S e^{rT} \cdot \mathbb{P} (S_T &amp;gt; X)$, with the present value $S \cdot \mathbb{P} (S_T &amp;gt; X)$, and so Black &amp;amp; Scholes formula &quot;should be&quot; $$C = SN(d_2) - e^{-rT}XN(d_2)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the formula does use $N(d_1)$ and since $d_1 &amp;gt; d_2$ my understanding is that it gives higher probability to receiving the stock than to paying the strike price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I went through &lt;a href=&quot;http://www.ltnielsen.com/wp-content/uploads/Understanding.pdf&quot;&gt;Understanding $N(d_1)$ and $N(d_2)$: Risk-Adjusted Probabilities in the Black &amp;amp; Scholes Model&lt;/a&gt; and also found &lt;a href=&quot;http://www.quora.com/In-the-black-scholes-formula-how-can-N-d1-represent-the-expected-return-in-the-event-of-an-exercise-and-at-the-same-time-also-mean-delta-probability-that-the-option-will-expire-in-the-money&quot;&gt;this explanation on Quora&lt;/a&gt; helpful, but still don't see what is fundamentally wrong with the train of thought I described above.&lt;/p&gt;&#xA;" OwnerUserId="3090" LastEditorUserId="6101" LastEditDate="2015-07-29T16:47:10.443" LastActivityDate="2015-07-29T17:55:51.583" Title="Why $N(d_1)$ and $N(d_2)$ are different in Black &amp; Scholes" Tags="&lt;black-scholes&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19085" PostTypeId="2" ParentId="19084" CreationDate="2015-07-29T15:06:40.037" Score="5" Body="&lt;p&gt;Note that, for the first term, it is&#xA;\begin{align*}&#xA;e^{-rT} \mathbb{E}(S_T \mathbb{I}_{S_T &amp;gt;X}),&#xA;\end{align*}&#xA;which is not equal to $e^{-rT}S\,\mathbb{P}(S_T &amp;gt;X)$. Here, $\mathbb{P}$ is the risk-neutral measure and $\mathbb{E}$ is the corresponding expectation operator. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\tilde{\mathbb{P}}$ be the probability measure with the stock price process as the numeraire. Then&#xA;\begin{align*}&#xA;e^{-rT} \mathbb{E}(S_T \mathbb{I}_{S_T &amp;gt;X}) = S \tilde{\mathbb{P}}(S_T&amp;gt;X).&#xA;\end{align*}&#xA;That is, $N(d_1) = \tilde{\mathbb{P}}(S_T&amp;gt;X)$, while $N(d_2) = \mathbb{P}(S_T&amp;gt;X)$. The different probability measures caused the difference between $N(d_1)$ and $N(d_2)$. See also the discussion in Question &lt;a href=&quot;https://quant.stackexchange.com/questions/19038/understanding-nd-1-and-how-to-use-the-stock-itself-as-the-numeraire&quot;&gt;Understanding $N(d_1)$ and how to use the stock itself as the numeraire?&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2015-07-29T15:13:03.953" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19086" PostTypeId="2" ParentId="19082" CreationDate="2015-07-29T16:08:57.373" Score="1" Body="&lt;p&gt;To start with the simplest model maybe you could start by googling &quot;Kyle's Lambda&quot; and proceed from there.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2015-07-29T16:08:57.373" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19087" PostTypeId="2" ParentId="19082" CreationDate="2015-07-29T16:43:29.553" Score="1" Body="&lt;p&gt;You might find something useful here: &lt;a href=&quot;https://quant.stackexchange.com/questions/43/is-there-a-standard-model-for-market-impact&quot;&gt;Is there a standard model for market impact?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And Here's a decent paper about the cost impact on equities:&#xA;&lt;a href=&quot;http://www.cims.nyu.edu/~almgren/papers/costestim.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.cims.nyu.edu/~almgren/papers/costestim.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would have added this as a comment but I don't have enough reputation&lt;/p&gt;&#xA;" OwnerUserId="7769" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2015-07-29T16:43:29.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19088" PostTypeId="1" AcceptedAnswerId="19183" CreationDate="2015-07-29T16:45:35.563" Score="7" ViewCount="441" Body="&lt;p&gt;The &lt;a href=&quot;http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=327148&quot;&gt;gain/loss asymmetry&lt;/a&gt; is a well known stylized fact: It basically states that real financial time series take longer for going up than going down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question&lt;/strong&gt;&lt;br&gt;&#xA;Are you aware of any artificial markets (multi-agent simulations) that are capable of reproducing this stylized fact of real markets?&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2015-12-01T14:22:05.547" Title="Gain/loss-asymmetry in artificial financial markets?" Tags="&lt;stylized-facts&gt;&lt;artificial-markets&gt;&lt;multi-agent-simulations&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19089" PostTypeId="2" ParentId="19084" CreationDate="2015-07-29T17:38:51.487" Score="7" Body="&lt;p&gt;The time-$t$ price of a European call on a non-dividend paying stock with spot price $S_t$, when the strike is $K$ and the time to maturity is $\tau = T − t$, is the discounted expected value of the payoff under the risk-neutral measure $Q$&#xA;$$C(t,{{S}_{t}},K,T)={{e}^{-r(T-t)}}\mathbb{E}_{t}^{Q}\,[{{({{S}_{T}}-K)}^{+}}]={{e}^{-r\tau }}\mathbb{E}_{t}^{Q}[({{S}_{T}}-K\,)\,{{1}_{\,{{S}_{T}}&amp;gt;K}}]$$&#xA;where $1$ is the indicator function,thus we have&#xA;$$C(t,{{S}_{t}},K,T)=\underbrace{{{e}^{-r\tau }}\,\mathbb{E}_{t}^{Q}[S_T\,1_{S_T&amp;gt;K}]}_{J}-K e^{-r\tau}\,\underbrace{\mathbb{E}_{t}^{Q}[1_{S_T&amp;gt;K}]}_{I}$$&#xA;We can therefore write&#xA;$$I=\mathbb{E}_{t}^{Q}[ 1_{S_T&amp;gt;K}]=Q(S_T&amp;gt;K)$$&#xA;Indeed,the expected value $\mathbb{E}_{t}^{Q}[ 1_{S_T&amp;gt;K}]$ is the probability of the call expiring in-the-money under the measure $Q$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Evaluating $J={{e}^{-r\tau }}\,\mathbb{E}_{t}^{Q}[S_T\,1_{S_T&amp;gt;K}]$ requires changing the original measure $Q$ to another measure $Q^S$.Consider the Radon-Nikodym derivative&#xA;$$\frac{dQ^S}{dQ}=\frac{{{S}_{T}}/{{S}_{t}}}{{{B}_{T}}/{{B}_{t}}}$$&#xA;where $d{{B}_{t}}=r{{B}_{t}}dt$ or $B_t=e^{rt}$. As a result&#xA;$${{e}^{-r\tau }}\mathbb{E}_{t}^{Q}[{{S}_{T}}{{1}_{{{S}_{T}}&amp;gt;K}}]={{S}_{t}}\mathbb{E}_{t}^{Q}\left[{{e}^{-r\tau }}\frac{{{S}_{T}}}{{{S}_{t}}}{{1}_{{{S}_{T}}&amp;gt;K}}\right]={{S}_{t}}\mathbb{E}_{t}^{Q}\left[\frac{{{S}_{T}}/{{S}_{t}}}{{{B}_{T}}/{{B}_{t}}}{{1}_{{{S}_{T}}&amp;gt;K}}\right]={{S}_{t}}\mathbb{E}_{t}^{{{Q}^{S}}}[{{1}_{{{S}_{T}}&amp;gt;K}}]$$&#xA;in othere words&#xA;$$J={{e}^{-r\tau }}\,\mathbb{E}_{t}^{Q}[{{S}_{T}}{{1}_{{{S}_{T}}&amp;gt;K}}]={{S}_{t}}\mathbb{E}_{t}^{{{Q}^{S}}}[{{1}_{{{S}_{T}}&amp;gt;K}}]=S_t Q^S(S_T&amp;gt;K)$$&#xA;This implies that the European call price of Equation be written in&#xA;terms of both measures as&#xA;$$C(t,{{S}_{t}},K,T)=S_t Q^S(S_T&amp;gt;K)- {{e}^{-r\tau}}K Q(S_T&amp;gt;K)$$&#xA;Under  measure $Q$, $S_T$ is distributed as lognormal with mean&#xA;$m=\ln S_t+(r-\frac{1}{2}\sigma^2)\tau$ and variance $\Sigma=\sigma^2\tau$ then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Q(S_T&amp;gt;K)=N\left(\frac{m-\ln K}{\sqrt{\Sigma}}\right)=N\left(\frac{\ln(S_T/K)+(r-\frac{1}{2}\sigma^2)\tau}{\sigma\sqrt{\tau}}\right)=N(d_2)$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastEditorDisplayName="user16891" LastEditDate="2015-07-29T17:55:51.583" LastActivityDate="2015-07-29T17:55:51.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19090" PostTypeId="2" ParentId="19066" CreationDate="2015-07-29T18:15:26.717" Score="2" Body="&lt;p&gt;The calculation of rebalanced portfolio returns using &lt;code&gt;PerformanceAnalytics&lt;/code&gt; functions makes use of what the package authors call &quot;end-of-period&quot; weights.  As described in the documentation for &lt;code&gt;Return.portfolio&lt;/code&gt;,  the rebalancing uses the weights for the last trading day of the period to rebalance the portfolio  after the markets close on that day. As an example, in the code below I've added dates to your weight and return data.    Here the weights for 2015-05-31 specify the weights used to rebalance the portfolio following the close of trading on that date. These become the &quot;beginning-of-period&quot; weights for the trading period starting on 2015-06-01 and are the proper ones to use with the returns of 2015-06-30 to calculate the portfolio returns for the month of June.   For this case, where the weights and returns have the same number of data points per period, returns for a period are just the scalar product of the asset returns and the weights.  The code below also performs this calculation so you can compare the two methods.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From your post, it looked as though you might also be interested in the cumulative returns.  The code below includes that calculation using both &lt;code&gt;PerformanceAnalytics&lt;/code&gt; and direct calculations.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;returns&amp;lt;-rbind(c(-0.05,0.04,0.37),c(0.15,0.02,-0.07))&#xA;weights&amp;lt;-rbind(c(0.5,0.1,0.4),c(0.4,0.2,0.4))&#xA;library(PerformanceAnalytics)&#xA;ret &amp;lt;- xts(returns, order.by= as.Date(c(&quot;2015-06-30&quot;, &quot;2015-07-31&quot;)))&#xA;wts &amp;lt;- xts(weights, order.by= as.Date(c(&quot;2015-05-31&quot;,&quot;2015-06-30&quot;)))&#xA;#  Period returns&#xA;returns_PA &amp;lt;- Return.portfolio(ret, wts)&#xA;returns_direct &amp;lt;- reclass(sapply(1:nrow(wts), function(n) ret[n,]%*%t(wts[n,])), ret)&#xA;&#xA;# Cummulative returns&#xA;returns_PA_cum &amp;lt;- Return.cumulative(returns_PA)&#xA;returns_direct_cum &amp;lt;- prod(returns_direct+1) -1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11889" LastActivityDate="2015-07-29T18:15:26.717" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19091" PostTypeId="1" CreationDate="2015-07-29T18:40:31.070" Score="2" ViewCount="507" Body="&lt;p&gt;I want to know if you can easily convert a notional of a bond futures contract into the nominal of the ctd bond if you have the conversion factor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example you have 1000 notional of a futures contract and the conversion factor is 0.80 of a particular ctd bond, how much nominal you would get at expiration. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="16788" LastActivityDate="2015-07-30T00:23:26.460" Title="how to convert notional to nominal of bond future to ctd bond" Tags="&lt;bond&gt;&lt;futures&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19092" PostTypeId="2" ParentId="19091" CreationDate="2015-07-29T19:27:17.413" Score="2" Body="&lt;p&gt;I'm not sure I follow your question completely but I will try my best to explain how Bond Futures relate to their underlying contracts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all the 5 Year, 10 Year, 30 Year, and Ultrabond Futures that trade on the CME all have a par value of the $100,000.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So let's say you hold short a 10 year future that expired with the price of 126.00. The conversion factor is 0.80. The amount you would receive for the bond would be 126.00 * 100,000 * 0.80 + Accrued Interest. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general the price is (Notional Value * Settlement Price * Conversion Factor) + Accrued Interest&lt;/p&gt;&#xA;" OwnerUserId="5940" LastActivityDate="2015-07-29T19:27:17.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19094" PostTypeId="1" AcceptedAnswerId="19115" CreationDate="2015-07-29T21:50:33.387" Score="2" ViewCount="405" Body="&lt;p&gt;Ive been implementing a little exercise to obtain the first 2 forecasting points of an AR(1) process. And i want to have the forecasting ponts using the three forms: Im folowing this pdf &lt;a href=&quot;http://www.le.ac.uk/users/dsgp1/COURSES/BANKERS/BANKERS6.PDF&quot; rel=&quot;nofollow&quot;&gt;http://www.le.ac.uk/users/dsgp1/COURSES/BANKERS/BANKERS6.PDF&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Difference Equation Forms, Moving Aerage Form and Auroregressive Form:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did well for the first two forms:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(forecast)&#xA;set.seed(20141221)&#xA;x &amp;lt;- arima.sim(n=108, list(ar=0.5))&#xA;data.ts &amp;lt;- ts(x, start=c(1999,01), freq=12)&#xA;time = window(data.ts, start=c(1999,01),end=c(2007,12))&#xA;inflarima1 &amp;lt;- arima( x,order = c(1, 0, 0))&#xA;&#xA;inflarima1$coef&#xA;    #    ar1    intercept&#xA;    #0.4945659  0.2069526 &#xA;    predict(inflarima,2)$pred&#xA;#Jan       Feb&#xA;#2008 0.1147776 0.1613660&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;FIRST FORM: Difference Equation Form&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# c^= INTERCEPT*(1-phi) &#xA;#h=1 -&amp;gt; yt+1 = c^ + phi*Yt &#xA;0.2069526*(1-0.4945659) + 0.4945659*x[108]&#xA;0.1147776&#xA;#h=2 -&amp;gt; yt+1 = c^ + phi*Yt+1 = c^ + phi*[c^ + phi*Yt]= c^+phi*c^+ phi^2*Yt&#xA;0.2069526*(1-0.4945659) + 0.2069526*(1-0.4945659)*0.4945659 &#xA;+ 0.4945659^2*x[108]&#xA;0.1613660&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;SECOND FORM: MOVING AVERAGE&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#Forecasting h=1;&#xA;&#xA;#Yt+h = mu + phi*et + phi^(2)*et-1 +... + phi^(108)*et-107&#xA;&#xA;#residuals&amp;lt;-inflarima1$residuals&#xA;&#xA;MatrizFIrstForecasting&amp;lt;-matrix(NA,108,1)&#xA;&#xA;for (i in 108:1) {      &#xA;&#xA;  MatrizFIrstForecasting[i]&amp;lt;-residuals[i]*0.4945659^(108-(i-1) )    &#xA;&#xA;  } &#xA;&#xA;#Yt+1 = mu + phi*et + phi^2*et-1 + ... + phi^108*et-107&#xA;&#xA;0.2069526 + sum(Matrizphie) #0.1147776&#xA;&#xA;#Forecasting h=2;&#xA;&#xA;#Yt+h = mu + phi^2*et + phi^(3)*et-1 +... + phi^(109)*et-107&#xA;MatrizSECONDForecasting&amp;lt;-matrix(NA,108,1)&#xA;for (i in 108:1) {&#xA;MatrizSECONDForecasting[i]&amp;lt;-residuals[i]*0.4945659^(108-(i-2) )&#xA;&#xA;  } &#xA;#Yt+2 = mu + phi^2*et + phi^3*et-1 + ... + phi^109*et-107&#xA;0.2069526 + sum(MatrizSECONDForecasting) #0.161366&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So far so it worked...the problem is that I am not being able toimplement for the third form. I belive my code is wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you help me find my mistake?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Third Form: Autoregressive&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Y^_t+1|t = pi_1*yt + pi2*yt-1 + ... + pi_108*yt-107... CORRECT?&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The PI´s coefficient are obtained like this?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pi_1 = (-phi_1) ; pi_2 = (-phi_1)^2 ; pi_3= (-phi_1)^3; ...;pi_108 = (-phi_1)^108&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thus,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I build a code for the first forecasting:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;MATRIZpi&amp;lt;-matrix(,108,1)&#xA;for (i in 108:1) {&#xA;  MATRIZpi[i]&amp;lt;-x[108-(108-i)]*(0.4945659)^(108-(i-1))&#xA;} &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and the i sum each line of MATRIZpi matrix, to obtain:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Y^_t+1|t = pi_1*yt + pi2*yt-1 + ... + pi_108*yt-107&#xA;&#xA;sum(MATRIZpi)&#xA;&#xA;The value is 0.2099202&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Obviously this wrong. I already modified the code a few times and I can not fix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you suggest me something?&lt;/p&gt;&#xA;" OwnerUserId="15685" LastActivityDate="2015-07-31T00:26:07.503" Title="FORECASTING Model AR(1) in an Autoregressive Form The Pi´s Parameters" Tags="&lt;time-series&gt;&lt;r&gt;&lt;statistics&gt;&lt;forecasting&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19095" PostTypeId="2" ParentId="19091" CreationDate="2015-07-30T00:23:26.460" Score="1" Body="&lt;p&gt;Delivery is 1:1. 100k notional of futures calls for delivery of 100k par amount of the underlying bonds.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2015-07-30T00:23:26.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19097" PostTypeId="1" AcceptedAnswerId="37742" CreationDate="2015-07-30T06:35:05.890" Score="3" ViewCount="314" Body="&lt;p&gt;The &lt;a href=&quot;http://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=327148&quot; rel=&quot;nofollow noreferrer&quot;&gt;gain/loss asymmetry&lt;/a&gt; is a well known stylized fact: It basically states that real financial time series take longer for going up than going down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To detect it a heavy statistical machinery is needed: Detrending the time series, calculating the inverse statistics, normalizing the distribution, fitting a Generalized Gamma distribution... to name but a few.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The result are plots like these (from &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=844364&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=844364&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/HJdx1.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/HJdx1.png&quot; alt=&quot;from: http://papers.ssrn.com/sol3/papers.cfm?abstract_id=844364&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question&lt;/strong&gt;&lt;br&gt;&#xA;I want to reproduce those plots. Do you know any software, tools and/or preferably R code/packages with which this can be done? Every little hint may be helpful - Thank you.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2015-07-30T07:46:44.217" LastActivityDate="2018-01-15T15:28:49.937" Title="Tools/R-code to create gain/loss-asymmetry plots" Tags="&lt;r&gt;&lt;software&gt;&lt;stylized-facts&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19099" PostTypeId="1" AcceptedAnswerId="19424" CreationDate="2015-07-30T07:42:50.980" Score="2" ViewCount="353" Body="&lt;p&gt;I am doing orthogonal regression. My X matrix consists of returns on a broad market index, value index, growth index, a few sectors,.....(my Y is the returns on an equity fund)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am regressing the Y on the (1st two) principal components of X (this is to avoid the problem of multicollinearity in X). I then back out the betas for the original X variables by the matrix multiplication of the eigenvector matrix and the betas for the principal components. All good so far&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wanted to make sure everything was right so decided as a test to regress the returns of the broad market index on X (and remember that the broad market index returns are actually in X). I would expect the beta for the broad market index to be very near 1 but when I do that orthogonal regression it is not - it is similar in value to all the other betas (around 0.15).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This surely does not make sense right? When I do plain old regression of the returns of the market index on X (which would suffer from multicollinearity given the high correlation amongst the X variables, right?), the beta estimate is exactly 1 (and the betas for the other factors are very small in comparison), but when I use orthogonal regression the beta is 0.15. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the small beta for the market index factor not a concern?&lt;/p&gt;&#xA;" OwnerUserId="17048" LastEditorUserId="17048" LastEditDate="2015-07-31T09:39:53.550" LastActivityDate="2015-10-20T16:32:24.637" Title="Orthogonal Regression/PCA" Tags="&lt;regression&gt;&lt;pca&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19100" PostTypeId="1" AcceptedAnswerId="19110" CreationDate="2015-07-30T09:05:18.783" Score="2" ViewCount="2010" Body="&lt;p&gt;I found big inconsistency in the GARCH models and their underlying assumption of stationarity. &#xA;GARCH models require that data must be stationary, where stationary means both mean and variance are time invariant. &#xA;If variance is time invariant i.e. constant then what is logic behind using GARCH models. &lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2015-07-30T18:46:22.110" Title="Garch models and assumption of stationarity ?" Tags="&lt;volatility&gt;&lt;time-series&gt;&lt;garch&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19102" PostTypeId="5" CreationDate="2015-07-30T12:05:09.380" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2015-07-30T12:05:09.380" LastActivityDate="2015-07-30T12:05:09.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19103" PostTypeId="4" CreationDate="2015-07-30T12:05:09.380" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2015-07-30T12:05:09.380" LastActivityDate="2015-07-30T12:05:09.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19104" PostTypeId="5" CreationDate="2015-07-30T13:41:18.020" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2015-07-30T13:41:18.020" LastActivityDate="2015-07-30T13:41:18.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19105" PostTypeId="4" CreationDate="2015-07-30T13:41:18.020" Score="0" Body="A bond is a fixed-income instrument generating cash flows at some specific dates in the futures.&#xD;&#xA;These cash-flows depend on the interest rate of the bond, which can either be fixed or variable.&#xD;&#xA;It is a debt instrument acting as a loan made from the buyer to the seller." OwnerUserId="26595" LastEditorUserId="26595" LastEditDate="2019-04-10T08:32:00.523" LastActivityDate="2019-04-10T08:32:00.523" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="19106" PostTypeId="5" CreationDate="2015-07-30T13:48:23.697" Score="0" Body="&lt;p&gt;In some particular Markets for a given expiration, options whose strike price differs substantially from the underlying asset's price command higher prices than what is suggested by standard option pricing models. These options are said to be either deep in-the-money or out-the-money. Graphing implied volatilities against strike prices for a given expiry yields a skewed &quot;&lt;strong&gt;smile&lt;/strong&gt;&quot; instead of the expected flat surface.In fact,&lt;strong&gt;Volatility smiles&lt;/strong&gt; tell us that demand is greater for options that are in-the-money or out-of-the-money.&lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastEditorDisplayName="user16891" LastEditDate="2015-07-30T14:20:45.063" LastActivityDate="2015-07-30T14:20:45.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19107" PostTypeId="4" CreationDate="2015-07-30T13:48:23.697" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2015-07-30T13:48:23.697" LastActivityDate="2015-07-30T13:48:23.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19108" PostTypeId="2" ParentId="8114" CreationDate="2015-07-30T17:52:25.807" Score="6" Body="&lt;h2&gt; 1. weighted Milstein Scheme&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;We assume $\{X_t\}_{t\geq0}$ described by the following stochastic differential equation&#xA;$$dX_t=\mu(t,X_t)dt+\sigma(t,X_t)dW_t\,\,\,\,\,\,\,\,\,\,\,\,\,(1)$$&#xA;Under the Ito version of this scheme Equation $(1)$ becomes&#xA;$$dX_{t+\Delta t}=X_t+[\alpha\,\mu(t,X_t)+(1-\alpha)\mu(t+\Delta t,X_{t+\Delta t})]\Delta t+\sigma\sqrt{\Delta t \,X_t}\,Z+\frac{1}{2}\sigma(t,X_t)\sigma'(t,X_t)\Delta t(Z^2-1)$$&#xA;where $0\leq\alpha\leq1$ is the weight and $Z$ is normal random variable.By application of the Weighted Milstein scheme to the CIR model,&#xA;$$dr_t=\kappa(\theta-r_t)dt+\sigma\sqrt{r_t}dW_t$$ &#xA;we have&#xA;$${{r}_{t+\Delta t}}=\frac{{{r}_{t}}+\kappa (\theta -\alpha\,{{r}_{t}})\Delta t+\sigma \sqrt{{{r}_{t}}}\sqrt{\Delta t}\,{{Z}}+\frac{1}{4}{{\sigma }^{2}}\Delta t({{Z}}^{2}-1)}{1+(1-\alpha )\kappa \,\Delta t}$$&lt;/p&gt;&#xA;&#xA;&lt;h2&gt; 2. Balanced Implicit Scheme&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;This scheme is able to preserve positivity of the variance process. It is defined in &lt;a href=&quot;http://www.springer.com/us/book/9783540262121&quot; rel=&quot;noreferrer&quot;&gt;Platen and Heath&lt;/a&gt; as &#xA;$${{r}_{t+\Delta t}}=\frac{{{r}_{t}}(1+C(r_t))+\kappa (\theta -{{r}_{t}})\Delta t+\sigma \sqrt{{{r}_{t}}}\sqrt{\Delta t}\,{{Z}}}{1+C(t,r_t)}$$&#xA;where&#xA;$$C(t,r_t)=\kappa dt+\frac{\sigma \sqrt{\Delta t}|Z|}{\sqrt{r_t}}$$&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;3.Pathwise Adapted Linearization Quadratic&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Its convergence is fast,especially for small values of $\sigma$. The discretization scheme is given by&#xA;$${{r}_{t+\Delta t}}=r_t+(\kappa (\tilde{\theta} -r_t)+\sigma\beta_n\sqrt{r_t}\,)\left(1+\frac{\sigma\beta_n-2\kappa\sqrt{r_t}}{4\sqrt{r_t}}\Delta t\right)\Delta t$$&#xA;where $\beta_n=\frac{Z}{\sqrt{\Delta t}}$ and $\tilde{\theta}=\theta-\frac{\sigma^2}{4\kappa} $&#xA;This scheme presented in &lt;a href=&quot;http://www.tandfonline.com/doi/abs/10.1080/14697680600841108#preview&quot; rel=&quot;noreferrer&quot;&gt;Kahl and Jackel&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;4. Quadratic-exponential scheme&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Another scheme for discretization of the CIR process is Quadratic-exponential scheme.For more details,please download &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=946405&quot; rel=&quot;noreferrer&quot;&gt;it&lt;/a&gt;. Also,&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1153950&quot; rel=&quot;noreferrer&quot;&gt;Transformed volatility scheme&lt;/a&gt; is useful.&lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastEditorDisplayName="user16891" LastEditDate="2015-07-30T18:32:58.570" LastActivityDate="2015-07-30T18:32:58.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19109" PostTypeId="2" ParentId="19050" CreationDate="2015-07-30T17:58:56.417" Score="0" Body="&lt;p&gt;Back when I had lots of free time, I used to publish a series of constant maturity par bond total return indices (&lt;a href=&quot;http://hungrydummy.com/datacenter/&quot; rel=&quot;nofollow&quot;&gt;http://hungrydummy.com/datacenter/&lt;/a&gt;). Because these are &quot;par&quot; bonds, they are immune to coupon effects. I briefly described the computational methodology on that page, which is copied below. The same methodology can be used to create constant maturity zero bond returns.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The Constant Maturity Total Return Indices are constructed using the Gurkaynak, Sack, and Wright’s fitted curves. More specifically, I assume the index rolls into a new par bond at the end of each month. This same bond is then held through the following month, with daily returns marked again with the GSW fitted curves. Note that the returns reported here are higher than the returns of comparable benchmark bond indices (annualized excess return of 1.5% for 10s since 1981). Here are a few reasons: 1) Bonds in my indices typically have higher durations than benchmark issues. For example, if 10-year notes are issued once a year, then 11 months after issuance, the bond in the benchmark index would have only 9.1 years to maturity. In my index, the bonds would have at least 9.9 years to maturity, since they are rolled into new 10-year bonds monthly. 2) Benchmark bonds tend to be rich at issuance, and gradually cheapen as they age, thus reducing their returns, all else equal. Hypothetical bonds created with fitted curves don’t suffer from this issue. It’s debatable whether it’s a good idea to use hypothetical bonds, since an index should ideally reflect actual investable performance. I devised these indices mainly because most bond indices do not have long enough a history and do not provide the kind of granularity I’m interested in. On the other hand, my indices more accurately reflect yield curve dynamics, instead of being plagued by other idiosyncratic factors. Furthermore, it sheds some light on possible return enhancement opportunities. For example, instead of rolling on-the-run issues, buying and holding cheaper off-the-run issues not trading special in the repo market may generate higher returns.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2015-07-30T17:58:56.417" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19110" PostTypeId="2" ParentId="19100" CreationDate="2015-07-30T18:46:22.110" Score="3" Body="&lt;p&gt;GARCH models are essentially white noise models with some time dependency. The reason GARCH models are used is because they have a lot of nice properties. The main being that the Conditional Volatility is time-dependent. This means that volatility can cluster. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's true that conditional vol will regress towards &quot;normality&quot; as a random walk process with drift. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second nice property is the closed-form solution allows you to calculate expected vol with ease.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A third nice property is that the model is simple and very easy to fit to historical data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As with all models you need to understand it's underlying assumptions so you can assess it's downfalls. In this case your big assumption is the stationary mean and volatility. One of which may not be true and the other nigh impossible to measure. &lt;/p&gt;&#xA;" OwnerUserId="5940" LastActivityDate="2015-07-30T18:46:22.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19111" PostTypeId="1" CreationDate="2015-07-30T22:26:38.570" Score="0" ViewCount="214" Body="&lt;p&gt;Has anyone gone through this migration? Just wanted to have an idea of the amount of effort required.&lt;/p&gt;&#xA;" OwnerUserId="15964" LastActivityDate="2015-11-10T14:23:42.597" Title="How difficult/easy it is to migrate from CME FAST to CME MDP3.0?" Tags="&lt;fix&gt;&lt;cme&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19115" PostTypeId="2" ParentId="19094" CreationDate="2015-07-31T00:19:38.307" Score="1" Body="&lt;p&gt;I am struggling a little to understand your question, but I suspect I know where you're running into trouble, because it is a question we frequently use on students to test their understanding of how R estimates ARIMA models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you estimate an ARIMA model in R, the output is provided in what we often call &lt;em&gt;Normal&lt;/em&gt; form. For the specific case of an AR(1) model, the normal form is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;(1 - \phi L)(Y_t - c) = \epsilon_t&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $L$ is the lag operator, $\phi$ is the AR(1) coefficient, and $c$ is the constant parameter &lt;em&gt;that is output by R&lt;/em&gt;. Now, let's say we want to turn all of this into a forecasting equation. We need to get $Y_t$ on the left hand side, and everything else on the right hand side. If you grind through the maths, you'll find that we end up with:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;Y_t = c(1 - \phi) + \phi Y_{t-1} + \epsilon_t&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Aha! Note that the intercept term in our forecasting model, ie $c(1 - \phi)$, is &lt;em&gt;not&lt;/em&gt; equal to the &quot;intercept&quot; term output by R, which I have denoted just $c$ above. So if you just used $c$ as the intercept term in your forecasting equation, you'll get the wrong answer, which I &lt;em&gt;think&lt;/em&gt; is where you're going wrong above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, just to be very clear. If $\phi$ is the AR(1) coefficient output by R, and $c$ is the intercept term output by R, then your forecasting equation for an AR(1) should be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathbb{E}_t Y_{t+1} = c(1 - \phi) + \phi Y_t&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the $\epsilon_{t+1}$ term dropped out because by assumption $\mathbb{E}_t \epsilon_{t+1} = 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that for an AR(p) model with $p&amp;gt;1$, the correct intercept term to use the forecasting equation is a bit more complicated again. Deriving it is a good exercise. Fortunately, there is no interaction between the $c$ term and any MA coefficients, so for an ARMA(p, q), you only need to worry about the interaction with the AR(p) bit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're struggling with this, the best thing is to write down an ARMA(p,q) in &lt;em&gt;Normal&lt;/em&gt; form, and then try and convert it into a forecasting equation, and then try and convert it back. For reference, the &lt;em&gt;Normal&lt;/em&gt; form for an ARMA(p,q) is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;(1 - \phi_1 L - ... - \phi_p L^p) (Y_t - c) = (1 + \theta_1 L + ... + \theta_q L^q) \epsilon_t&#xA;\end{equation}&lt;/p&gt;&#xA;" OwnerUserId="2998" LastEditorUserId="2998" LastEditDate="2015-07-31T00:26:07.503" LastActivityDate="2015-07-31T00:26:07.503" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19116" PostTypeId="1" CreationDate="2015-07-31T03:50:14.830" Score="1" ViewCount="309" Body="&lt;p&gt;I'm simulating dynamic delta hedging for up-and-out call option.&#xA;For plain vanilla call options, I heard that the option price is the expected value of the accumulated delta hedging cost. Does it also hold for exotic option, like up-and-out call options?&lt;/p&gt;&#xA;" OwnerUserId="17061" LastActivityDate="2015-09-29T08:16:52.217" Title="Delta hedging cost of exotic options?" Tags="&lt;option-pricing&gt;&lt;delta-hedging&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19119" PostTypeId="2" ParentId="19116" CreationDate="2015-07-31T06:23:22.827" Score="1" Body="&lt;p&gt;Yes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use the BS Model for computing deltas and the same model for evolving the stock price then you should replicate the pay-off of any contract.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastEditorUserId="467" LastEditDate="2015-09-29T08:16:52.217" LastActivityDate="2015-09-29T08:16:52.217" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19122" PostTypeId="2" ParentId="19097" CreationDate="2015-07-31T15:52:42.023" Score="2" Body="&lt;p&gt;Here is a quick example, you grab the total returns for each holding period, avg them out and compare the days for each level of return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can change tmp1 for whatever is your preferred filtered data set.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; require(PerformanceAnalytics)&#xA;&#xA;require(sqldf)&#xA;data(edhec)&#xA;&#xA;tmp1=edhec[,1]&#xA;&#xA;&#xA;period_seq = 1:nrow(tmp1)&#xA;combos=expand.grid(period_seq,period_seq)&#xA;###Remove impossible investments&#xA;combos=combos[combos[,2]&amp;gt;combos[,1],]&#xA;colnames(combos) = c('start','finish')&#xA;combos$day_length = combos[,2]-combos[,1]&#xA;###Calculater return for each period&#xA;combos$perreturn=NA&#xA;&#xA;###Calculate return for each combo&#xA;&#xA;for(i in 1:nrow(combos)){&#xA;  combos[i,]$perreturn = as.numeric(last(cumprod(1+(tmp1[combos[i,1]:combos[i,2]])))-1)&#xA;&#xA;&#xA;&#xA;}&#xA;&#xA;###Round the total return&#xA;combos$roundedperreturn = round(combos$perreturn,2)&#xA;###Calulate the avg day length per return level&#xA;ans=sqldf('select avg(day_length) as avg_day_length,roundedperreturn as return_level from combos group by 2')&#xA;&#xA;##Plot it&#xA;plot(ans$avg_day_length,ans$return_level,main=&quot;Holding period per level of return&quot;,xlab=&quot;periods&quot;,ylab='Return level')&#xA;&#xA;##look only at levels that have a + and -&#xA;up_side=ans[ans$return_level&amp;lt;=abs(min(ans$return_level))&amp;amp;ans$return_level&amp;gt;0,]&#xA;down_side = ans[ans$return_level&amp;lt;=abs(min(ans$return_level))&amp;amp;ans$return_level&amp;lt;0,]&#xA;down_side$return_level = abs(down_side$return_level)&#xA;plot(up_side,col=&quot;blue&quot;,type='b',main='Comparison of days required to return a return level')&#xA;points(x = down_side$avg_day_length,y=down_side$return_level,col=&quot;red&quot;,type='b')&#xA;&#xA;###Constant level of return plot&#xA;&#xA;time_distribution_for_level=combos[combos$roundedperreturn==0.05,]&#xA;time_distribution_for_level_down=combos[combos$roundedperreturn==-0.05,]&#xA;&#xA;up_five_pct_plot=table(time_distribution_for_level$day_length)/sum(time_distribution_for_level$day_length)&#xA;up_five_pct_plot = data.frame(density=as.numeric(up_five_pct_plot),periods=as.integer(names(up_five_pct_plot)))&#xA;down_five_pct_plot=table(time_distribution_for_level_down$day_length)/sum(time_distribution_for_level_down$day_length)&#xA;down_five_pct_plot = data.frame(density=as.numeric(down_five_pct_plot),periods=as.integer(names(down_five_pct_plot)))&#xA;plot(x=up_five_pct_plot$periods,y=up_five_pct_plot$density,type='b',col='blue',main='Density plot of time required for a five percent return (loss in red)',xlab='periods',ylab='density')&#xA;points(x=down_five_pct_plot$periods,y=down_five_pct_plot$density,type='b',col='red')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/kkIlk.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/kkIlk.png&quot; alt=&quot;Holding period required&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ftVWl.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ftVWl.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/eHZpG.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/eHZpG.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;It paints a different picture likely due to my use of monthly sample data.&lt;/p&gt;&#xA;" OwnerUserId="2154" LastEditorUserId="2154" LastEditDate="2015-08-04T05:01:59.477" LastActivityDate="2015-08-04T05:01:59.477" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19123" PostTypeId="2" ParentId="19081" CreationDate="2015-07-31T16:00:40.247" Score="2" Body="&lt;p&gt;An approach to consider is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Computing the total return streams of all the instruments in the portfolio&lt;/li&gt;&#xA;&lt;li&gt;Calculate the risk parameters using 1&lt;/li&gt;&#xA;&lt;li&gt;Weight appropriately (Equal risk contribution, min variance etc)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2154" LastActivityDate="2015-07-31T16:00:40.247" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19124" PostTypeId="1" AcceptedAnswerId="19126" CreationDate="2015-07-31T17:37:49.240" Score="0" ViewCount="146" Body="&lt;p&gt;I am in the process of calculating sovereign zero coupon yield curves using the NS-Svensson parameter for a number of countries. Due to data constraints, I would like to use the information from price data of both zero coupon and coupon bonds for the construction of the curves.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had a look into different statistical packages (notably &lt;code&gt;termstrc&lt;/code&gt; in R and &lt;code&gt;IRFunctionCurve.fitSvensson&lt;/code&gt;in Matlab), where some appear to be able to cope with the optimization across the two asset classes and others restrict themselves to Coupon bonds. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ignoring for now the question which packages dominates others in terms of implemention, is there any conceptual problem in optimizing the parameters of the model over both asset classes? &lt;/p&gt;&#xA;" OwnerUserId="17047" LastActivityDate="2015-07-31T20:28:24.433" Title="Constructing NS-Svensson parameters with zero coupon AND coupon bonds" Tags="&lt;fixed-income&gt;&lt;yield-curve&gt;&lt;zero-coupon&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19125" PostTypeId="2" ParentId="18028" CreationDate="2015-07-31T19:43:26.940" Score="0" Body="&lt;p&gt;No fancy theory is needed to understand why a GBM is applied to model stock prices. To get an intuitive understand, simple Macro-economics should suffice to understand why it is being applied:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;it has a Brownian component&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;it has (exponential) drift - this makes the model able to deal with stock prices growing in line with GDP (actually  faster than gdp since equity by definition already contains implied leverage)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;it can`t become zero&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;it is relatively simple - the time-T distribution is lognormal and hence the derivation of asset prices at time T is easy to compute&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;in the long run, only a few realizations of the GBM will be above average, but these will then be signficantly above average (think: Google, Apple). The vast majority of realizations will be below average.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;the reason why people use the GBM is because it also can be expressed with stochastic differential equations, but is still relatively simple to express (and solve) in mathematical terms. With a few modifications to the GBM SDE, you can obtain powerful models that allow you to model anything you observe in the markets (e.g. jumps, stochastic volatilites, etc.). If you want to understand what is going on mathematically, I highly recommend Oksendal.&lt;/p&gt;&#xA;" OwnerUserId="17086" LastActivityDate="2015-07-31T19:43:26.940" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19126" PostTypeId="2" ParentId="19124" CreationDate="2015-07-31T20:28:24.433" Score="1" Body="&lt;p&gt;Nowadays, government yield curves are customarily built with only coupon bonds. Zero coupon bonds (i.e., STRIPS in the US) are much less liquid compared with coupon Treasuries, and tend to trade very differently. If you plot a zero curve implied by coupon Treasuries vs yields of STRIPS, you'll notice that they can differ quite a bit in certain parts of the curve. If you include both coupon bonds and zeros, you'd get an &quot;in-between&quot; curve between the two very segmented markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mechanically, as @Physcs Envy mentioned, there's no point in differentiating the two though. The curve fitting process can proceed with both in exactly the same fashion. After all, zero coupon bonds are simply coupon bonds with coupon rate of 0%.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2015-07-31T20:28:24.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19127" PostTypeId="1" AcceptedAnswerId="19129" CreationDate="2015-08-01T07:19:48.150" Score="1" ViewCount="3212" Body="&lt;p&gt;What is the difference between Closing price, Last traded price and settlement price ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I got the difference between Closing Price and Settlement price from previous post : &#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/2307/the-difference-between-close-price-and-settelment-price-for-future-contracts&quot;&gt;The difference between Close price and Settelment Price for future contracts&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but still confused how closing price is different from Last traded price ? &lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-02-02T14:36:10.897" Title="Difference between Closing Price, Last traded price and Settlement Price for option contracts?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;equities&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19128" PostTypeId="2" ParentId="183" CreationDate="2015-08-01T09:35:31.337" Score="1" Body="&lt;p&gt;In mathematics and statistics, a stationary process (or strict(ly) stationary process or strong(ly) stationary process) is a stochastic process whose joint probability distribution does not change when shifted in time. Consequently, parameters such as the mean and variance, if they are present, also do not change over time and do not follow any trends.&lt;/p&gt;&#xA;" OwnerUserId="11710" LastActivityDate="2015-08-01T09:35:31.337" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19129" PostTypeId="2" ParentId="19127" CreationDate="2015-08-01T09:41:22.937" Score="2" Body="&lt;p&gt;To answer your question consider the following example using actual prices for SPY ETF on 7/31/15:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/voxQt.jpg&quot; alt=&quot;Last 19 Trades on AMEX&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;hopey.netfonds.no&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By looking at the last 19 trades that occurred at the very last second, you will see a notable price movement on prices. If you go to Google/Yahoo Finance the Closing Price for the ETF is 210.50 (largest trade at the close?) but the very Last trade according to the AMEX exchange was 500 shares at 210.47. The settlement price is the average price (say on the last 15 minutes ) to avoid manipulation since an option would be considered to be ITM by 0.01 above the strike price for a call. &lt;/p&gt;&#xA;" OwnerUserId="13428" LastActivityDate="2015-08-01T09:41:22.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19130" PostTypeId="1" AcceptedAnswerId="19131" CreationDate="2015-08-01T14:40:43.083" Score="1" ViewCount="125" Body="&lt;p&gt;Define:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$q_\alpha(F_L)=F^{\leftarrow}(\alpha)=\inf\lbrace{x\in \mathbb{R}\mid F_L(x)\geq \alpha\rbrace}=VaR_\alpha(L)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to prove that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ES_\alpha = \frac{1}{1-\alpha}\mathbb{E}[\mathbb{1}_{\lbrace{ L\geq q_\alpha(L)\rbrace}}\cdot L] \overset{!!!}{=}\mathbb{E}[L\mid L\geq q_\alpha(L)] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get stuck as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}[\mathbb{1}_{\lbrace{ L\geq q_\alpha(L)\rbrace}}\cdot L]= \mathbb{E}[\mathbb{E}[\mathbb{1}_{\lbrace{ L\geq q_\alpha(L)\rbrace}}\cdot L\mid L\geq q_\alpha(L)]] = \mathbb{E}[\mathbb{1}_{\lbrace{ L\geq q_\alpha(L)\rbrace}}\cdot\mathbb{E}[L\mid L\geq q_\alpha(L)]\ ]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I would like to use that $\Pr(L\geq q_\alpha(L) \ )=1-\alpha$, but I don't know how to proceed.&lt;/p&gt;&#xA;" OwnerUserId="15887" LastActivityDate="2015-08-01T16:33:59.207" Title="Expected Shortfall alternative formulation" Tags="&lt;risk-management&gt;&lt;var&gt;&lt;value-at-risk&gt;&lt;market-risk&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19131" PostTypeId="2" ParentId="19130" CreationDate="2015-08-01T16:33:59.207" Score="2" Body="&lt;p&gt;Note that &#xA;\begin{align*}&#xA;\mathbb{E}\big(L \mid L\geq q_\alpha(L)\big) &amp;amp;= \frac{\mathbb{E}\big(\pmb{1}_{\{L\geq q_\alpha(L)\}} L\big)}{\mathbb{P}\big(L\geq q_\alpha(L) \big)}.&#xA;\end{align*}&#xA;The formula follows immediately.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-08-01T16:33:59.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19132" PostTypeId="2" ParentId="17963" CreationDate="2015-08-01T16:46:29.370" Score="6" Body="&lt;p&gt;Reading what I have, I can only offer a guess.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1: Let's say you're looking at 9 sectors compared to \$SPX on a daily chart.  Foreach sector, compute relative closing price: 100 * Sector/\$SPX&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2: It looks like the RS-Ratio is averaged over 14 periods. I say 14 because stockcharts.com shows RS-Ratio peaking after a lag (2-3wks), despite price peaking 2-3 weeks earlier. I use 14 because that's a common number in TA.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3: RS-Momentum looks like it's simply the rate-of-change of the calculation in #1. Indeed, stockcharts.com says exactly this: &quot;RS-Momentum is an indicator that measures the momentum (rate-of-change) of RS-Ratio.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4: When they talk about normalizing, compute the mean &amp;amp; stddev of the 9 calculations in #1, then normalize as ... 100 * ((value-mean)/stddev + 1). I would guess that these values are &quot;normalized&quot; per day. I would guess that a separate normalization would be required for the values from #3 as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's how I would approach the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I consulted: &lt;a href=&quot;http://stockcharts.com/school/doku.php?st=rrg&amp;amp;id=chart_school:technical_indicators:rrg_relative_strength&quot; rel=&quot;noreferrer&quot;&gt;http://stockcharts.com/school/doku.php?st=rrg&amp;amp;id=chart_school:technical_indicators:rrg_relative_strength&lt;/a&gt; in formulating my response, and I've had a few months to sleep on it.&lt;/p&gt;&#xA;" OwnerUserId="17093" LastActivityDate="2015-08-01T16:46:29.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19133" PostTypeId="1" CreationDate="2015-08-01T17:59:25.687" Score="3" ViewCount="260" Body="&lt;p&gt;Define $q(t)$ as the log price minus a linear trend&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA; q(t) = \ln P(t) - \mu t&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume the log price process = Equation 1:&#xA;$$&#xA;  dq(t) = - \Theta q(t) dt + \sigma dW(t)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you show that the solution to Equation 1 is:&#xA;$$&#xA;\ln P(t+h) - \ln P(t) = \mu h + (\exp(-h \Theta) - 1) \ln P(t) + \sigma \int_t^{t+h} \exp(-\Theta(t-u))dW_u&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="16923" LastEditorUserId="11678" LastEditDate="2015-11-02T16:07:04.427" LastActivityDate="2015-11-02T16:07:04.427" Title="Derivation using Ito's Lemma of price process" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19134" PostTypeId="2" ParentId="19133" CreationDate="2015-08-01T19:10:57.750" Score="1" Body="&lt;p&gt;by application of Ito's lemma , we have &#xA;$$d\left(q(t)e^{\Theta\,t}\right)=\Theta \,q(t)e^{\Theta\,t}dt+e^{\Theta\,t}dq(t)+0$$&#xA;then&#xA;$$d\left(q(t)e^{\Theta\,t}\right)=\sigma e^{\Theta\,t}dW_t$$ &#xA;in other words&#xA;$$q(t+h)e^{\Theta\,(t+h)}-q(t)e^{\Theta\,t}=\sigma\int_{t}^{t+h}e^{\Theta\,u}dW_u\Rightarrow$$&#xA;$$q(t+h)-q(t)=\left(e^{-h\Theta}-1\right)q(t)+\sigma\int_{t}^{t+h}e^{-\Theta\,(t+h-u)}dW_u$$&#xA;By substituting $\ln P(t)-\mu\,t$ to last equation , we have&#xA;$$&#xA;\ln P(t+h) -\ln P(t) =\mu h+\left(e^{-h\Theta}-1\right)(\ln P(t)-\mu t) + \sigma\int_{t}^{t+h}e^{-\Theta\,(t+h-u)}dW_u&#xA;$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastEditorDisplayName="user16891" LastEditDate="2015-08-01T21:49:00.700" LastActivityDate="2015-08-01T21:49:00.700" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="19135" PostTypeId="1" CreationDate="2015-08-02T11:28:45.510" Score="3" ViewCount="215" Body="&lt;p&gt;I am trying to implement the Ledoit-Wolf minimum variance portfolio strategy on a real-world stock dataset.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quadprog)&#xA;library(Rsolnp)&#xA;&#xA;#first I read in the data and the corresponding market rates:&#xA;&#xA;data&amp;lt;-read.table(&quot;https://dl.dropboxusercontent.com/u/22681355/data.txt&quot;)&#xA;market.rate &amp;lt;-read.table(&quot;https://dl.dropboxusercontent.com/u/22681355/market.rate.txt&quot;)&#xA;&#xA;&#xA;&#xA;sample.data&amp;lt;-data[1:120, ]&#xA;sample.market.rate&amp;lt;-market.rate[1:120]&#xA;&#xA;# I calculate the Ledoit-Wulf portfolio strategy:&#xA;&#xA;Te &amp;lt;- nrow(sample.data)&#xA;s2&amp;lt;-var(sample.market.rate)&#xA;estimates&amp;lt;-sapply(1:N, function(x) lm(sample.data[,x]~sample.market.rate ))&#xA;slopes&amp;lt;-sapply(1:N,function(x) estimates[,x]$coefficients[2])&#xA;    residuals&amp;lt;-sapply(1:N, function(x) estimates[,x]$residuals)&#xA;B&amp;lt;-as.vector(slopes)&#xA;D&amp;lt;-diag(N)&#xA;diag(D)&amp;lt;-diag(cov(residuals))&#xA;&#xA;Fe&amp;lt;- s2 * B %*% t(B) + D&#xA;S.hat&amp;lt;-cov_shrink(Fe)&#xA;cov.Rt&amp;lt;-S.hat&#xA;inv.cov&amp;lt;-solve(cov.Rt)  &#xA;one.vec&amp;lt;-rep(1,N)   &#xA;weights&amp;lt;-as.vector(inv.cov%*%one.vec)/( t(one.vec) %*% inv.cov %*% one.vec)&#xA;} &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I get the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error in solve.default(cov.Rt) : &#xA;  system is computationally singular: reciprocal condition number = 2.08164e-18&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I must be doing something wrong because according to Ledoit Wolf their covariance estimator should not be computationally singular by construction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="17096" LastEditorUserId="16148" LastEditDate="2015-08-07T20:02:17.317" LastActivityDate="2015-08-07T20:02:17.317" Title="Ledoit-Wolf portfolio weights calculation" Tags="&lt;portfolio-management&gt;&lt;r&gt;&lt;portfolio&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19137" PostTypeId="1" CreationDate="2015-08-02T15:24:59.130" Score="0" ViewCount="59" Body="&lt;p&gt;I am presented with an investment opportunity where I am given #481,000 on day 1. Thereafter, every 10 days, I am required to give back #50,000 every for 100 days (10 * 50000 = 500000).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I calculate the interest rate I am paying?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am guessing I have to use the present value of annuity problem to find out the interest rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, my present value is #481,000. My &quot;annuity&quot; is 50000 every 10 days. First payment is due on the 10th day. Last payment is due on day 100. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Plugging the above values in wolframalpha I get .7107% for interest rate. I divide that by 10 to get per day interest rate and multiply by 365 to get 25.94%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am surprised to see the above answer. It is a lot more than 14% which is what the rate would be if I were to pay 500000 at the end of 100 days. Is my reasoning incorrect?&lt;/p&gt;&#xA;" OwnerUserId="17099" LastEditorUserId="467" LastEditDate="2015-09-02T06:06:28.207" LastActivityDate="2015-09-02T06:06:28.207" Title="Given cash flows, what is the interest rate of the following contract?" Tags="&lt;present-value&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2015-09-02T06:15:26.143" ContentLicense="CC BY-SA 3.0" />
  <row Id="19138" PostTypeId="1" CreationDate="2015-08-02T15:43:52.897" Score="4" ViewCount="108" Body="&lt;p&gt;i have a rookie question but can't find the answer anywhere so..what is the right way to compute a simple moving average when you have an array of (open,close,low,high) tuples ?  From what i saw so far it is the closing price that must be taken but i'm clearly not sure, i guess it could as well be open, or (open + close)/2, or anything else..Also, can this be generalized to other indicators ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thank you very much.&lt;/p&gt;&#xA;" OwnerUserId="17100" LastActivityDate="2015-10-01T17:30:35.170" Title="compute technical indicators from candle data" Tags="&lt;time-series&gt;&lt;moving-average&gt;&lt;technical-analysis&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19139" PostTypeId="2" ParentId="19138" CreationDate="2015-08-02T16:56:04.790" Score="1" Body="&lt;p&gt;got my answer myself, and the answer is: That depends, but people mostly use close price. &lt;a href=&quot;http://www.macroption.com/calculating-moving-average-prices/&quot; rel=&quot;nofollow&quot;&gt;http://www.macroption.com/calculating-moving-average-prices/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17100" LastActivityDate="2015-08-02T16:56:04.790" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19140" PostTypeId="5" CreationDate="2015-08-02T17:09:48.363" Score="0" Body="&lt;p&gt;A zero coupon bond with maturity date $T$, also called a $T$-bond, is a contract which guarantees the holder $1$ dollar to be paid on the date $T$. The convention that the payment at the time of maturity, known as the principal value or face value, equals one is made for computational convenience.The price at time t of a bond with maturity date T is denoted by $P(t, T)$ and it is assumed&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;There exists a (frictionless) market for $T$-bonds for every $T &amp;gt; 0$.&lt;/li&gt;&#xA;&lt;li&gt;The relation $P(t, t) = 1$ holds for all $t$. &lt;/li&gt;&#xA;&lt;li&gt;For each fixed t, the bond price $P(t, T)$ is differentiable w.r.t. time of maturity $T$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The relation $P(t, t) = 1$ above is necessary in order to avoid arbitrage.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Risk neutral valuation&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Zero Coupon Bond prices are given by the formula&#xA;$$P(t,T)=\mathbb{E}^Q\left[\exp\left(\int_{t}^{T}r_s ds\right)|\mathcal{F}_t\right]$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastEditorDisplayName="user16891" LastEditDate="2015-08-02T17:30:36.600" LastActivityDate="2015-08-02T17:30:36.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19141" PostTypeId="4" CreationDate="2015-08-02T17:09:48.363" Score="0" Body="A debt security that doesn't pay interest (a coupon) but is traded at a deep discount, rendering profit at maturity when the bond is redeemed for its full face value." OwnerDisplayName="user16891" LastEditorDisplayName="user16891" LastEditDate="2015-08-02T17:30:39.530" LastActivityDate="2015-08-02T17:30:39.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19142" PostTypeId="1" AcceptedAnswerId="19144" CreationDate="2015-08-02T17:28:47.467" Score="3" ViewCount="6771" Body="&lt;p&gt;Can someone give me an intuitive understanding of why the Merton model models the value of the debt from the lender's point of view as a short put with a risk free bond?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not well versed in this so I'd appreciate answers that are not heavy on math; I'm just looking for an intuitive understanding.&lt;/p&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="467" LastEditDate="2015-08-31T10:43:33.893" LastActivityDate="2019-06-21T16:44:23.780" Title="Why is the value of debt modeled as a short put option in Merton's model?" Tags="&lt;merton-model&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19143" PostTypeId="1" CreationDate="2015-08-02T20:54:36.443" Score="2" ViewCount="70" Body="&lt;p&gt;with what likelihood would one expect an ATM caplet to end up in the money? Just as a very rough guess, from real world experience.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I consider N(d2) from the Black formula, for spot = strike = 4%, vola = 20%, T = 1, tenor = 12m, I get something around 46.*%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, when I think about it qualitatively: Under most market conditions, the forward rate curve is increasing. As a very, very rough argument, we would expect the spot rate 1 year into the future to be similar to today's spot rate rather than today's 1 year forward rate, i.e. to be lower than today's ATM strike. Thus, under the physical measure, the caplet should be less likely to end up in the money than end up out of the money. Does this roughly conform with a number around 46%?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For my thesis, I am using a simulation model that tries to create synthetic realizations of market data (in a complicated procedure that would go too far to explain here). In this synthetic world, I get ITM-likelihoods much lower than the above and I am wondering about real world estimates from a practitioner's point of view.&lt;/p&gt;&#xA;" OwnerUserId="17103" LastEditorUserId="-1" LastEditDate="2015-08-03T09:42:35.957" LastActivityDate="2015-10-02T10:39:30.890" Title="Likelihood of a caplet ending in the money" Tags="&lt;forward-rate&gt;&lt;black76&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19144" PostTypeId="2" ParentId="19142" CreationDate="2015-08-02T22:17:07.490" Score="4" Body="&lt;p&gt;If the company was risk free the lender would always get back the promised amount $L$ at maturity. So the lender would be holding a risk free bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But companies are not risk free, there is a chance that they won't be able to repay the full amount $L$. This can be modeled as a risk free bond plus a &quot;thing&quot; which will have negative value if the company defaults and zero value otherwise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is this &quot;thing&quot;? If the company value $V$ is less than $L$ at maturity, the company will default and the lenders will take over the company, which they can then sell to partially recover what they were owed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, if at maturity $V&amp;gt;L$ the lender loses 0 (no default) while if $V&amp;lt;=L$ the lender loses $L-V$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are familiar with options you will see that the &quot;thing&quot; is identical to a short position in a put option. (You lose nothing if the underlying is above the strike at maturity and you lose (S-K) otherwise).&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="467" LastEditDate="2015-08-31T10:49:23.577" LastActivityDate="2015-08-31T10:49:23.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19145" PostTypeId="2" ParentId="19143" CreationDate="2015-08-03T00:03:41.763" Score="1" Body="&lt;p&gt;I would say that the real issue here is do you think the forward rate an is unbiased estimate of the actual rate? and if not why not? The statistical test would then be to take historical time series and see where the bias lies. If there truly is a non-trivial bias, what would be the risk-return trade-off of trying to exploit it?&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-08-03T00:03:41.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19146" PostTypeId="2" ParentId="19137" CreationDate="2015-08-03T00:58:01.977" Score="1" Body="&lt;p&gt;The annuity method is the correct method. I am not familiar with wolframalpha but I assume it is correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Look at it this way: in the second case (take out 481,000, repay 500,000 after 100 days) you have full use of the borrowed 481,000 for 100 days.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the first case (takeout 481,000, repay with an annuity of 10 payments over 100 day) you effectively borrow less because they force you to start repaying some of it after just 10 days. In a rough sense you only borrow half as much over time (in term of dollar days) so it is not surprising that it is a much more costly loan. The amount you repay is the same (500,000) but the amount available to you is far less, resulting in (roughly) twice the cost.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-08-03T00:58:01.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19149" PostTypeId="2" ParentId="11273" CreationDate="2015-08-03T01:41:51.047" Score="1" Body="&lt;p&gt;In a world of uncertainty no one knows what future profits will be (especially &gt; 1 year from now). All we can do is estimate. Who should we ask? The company management has an incentive to give out estimates that may be too optimistic. If you ask the competitors they are probably too pessimistic. Fortunately we have a machine called the stock market which objectively estimates the present value of future profits to determine the stock price. This estimate is not driven by any one party, but is the result of a consensus in a competitive market with many informed players. So it should be a good estimate. Then all the management has to do is maximize the stock price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW this view did not originate with Peter Diamond, but with the earlier work of Arrow and Debreu. Diamond extended it.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2015-08-03T02:07:44.077" LastActivityDate="2015-08-03T02:07:44.077" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19150" PostTypeId="1" CreationDate="2015-08-03T07:53:40.053" Score="3" ViewCount="129" Body="&lt;p&gt;FFR published by Fed Bank of NY is the average rate US banks charge each other for the overnight loans of their reserves required by the Fed regulations. Since Fed acts similar to a clearing house here, I guess there is little credit risk involved. For that reason we may as well expect LIBOR rate for the very same maturity to be a bit higher. In fact, currently overnight USD LIBOR is 12 bps whereas FFR is 13-14 bps, so that does not quite hold.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nevertheless, I'm looking into longer maturities LIBOR and of course the feature much higher rates. For example, 2-months is 25 bps and 3-months is 30 bps. I wonder which part of that comes from the credit risk, and which comes from the potential rate hike before that maturity. Unfortunately there is no 2- or 3-months FFR available, so I wondered whether there's any proxy for that: that would help estimating the rate hike component in LIBOR rates. From the other direction, I thought of estimating the credit risk component from LIBOR rates in other currencies (the less they are dependent on the US rates the better of course), and hence getting rate hike effect left. Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="13480" LastActivityDate="2015-08-03T07:53:40.053" Title="Fed Funds Rate: longer maturities" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19153" PostTypeId="1" CreationDate="2015-08-03T13:13:28.053" Score="0" ViewCount="41" Body="&lt;p&gt;I am wondering if there is a considered floor to the percentage variation the 1st principal component must explain in general for PCA - ie. any lower and it is not worth doing PCA at all? Is the floor near 75%, 80% or should the 1st 3 explain a minimum of 90% or what?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a follow on, if I have 10 X variables (index &amp;amp; sector returns) and only 6 are highly correlated (I take a correlation above 0.8 to be highly correlated - or is that too high?) should I just do PCA on those 6, then combine the 1st two principal components with the 4 remaining original variables and use that as my X for regression?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I was doing was doing PCA on all 10 variables, taking the 1st 2 or 3 principal components, regressing those on Y (which is a single stock's return) then taking those PC's betas and matrix multiplying them by the eigenvectors to back out sensitivities to the original 10 factors but I am left with the situation of not knowing if all 10 factors are significant (all I know is that the 1st 2 PCs are significant)  &lt;/p&gt;&#xA;" OwnerUserId="17048" LastEditorUserId="17048" LastEditDate="2015-08-03T15:01:30.500" LastActivityDate="2015-08-03T15:01:30.500" Title="Is there a considered floor for variation the 1st principal component must explain?" Tags="&lt;regression&gt;&lt;pca&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19154" PostTypeId="2" ParentId="17661" CreationDate="2015-08-03T14:16:19.367" Score="0" Body="&lt;p&gt;If you assume first order correlation and stationnary assumptions and no autocorrelation between true returns and estimated returns, the answer is the following&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Denote by $ R^e $ the estimated return, $R^t $ the true return and $ \rho $ the autocorrelation coefficient&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By assumptions, you have that &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$ R^e(t)= \rho R^e(t-1) + (1-\rho ) R^t(t) $&lt;/li&gt;&#xA;&lt;li&gt;$ Cov( R^t(t), R^e(t-1) ) = 0 $&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Then the estimated volatility is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Var(R^e(t))= Var\{\rho R^e(t-1)+(1-\rho)R^t(t)\} = \rho^2Var(R^e(t-1))+(1-\rho )^2Var(R^t(t))$ or&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Var(R^e)= \rho^2 Var(  R^e)  + (1-\rho )^2 Var(R^t) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Var(R^e)= \frac{1-\rho}{1+\rho} Var(R^t) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;this is the answer you may be looking for&lt;/p&gt;&#xA;" OwnerUserId="17108" LastActivityDate="2015-08-03T14:16:19.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19155" PostTypeId="1" CreationDate="2015-08-03T14:26:51.733" Score="2" ViewCount="132" Body="&lt;p&gt;In stock and index we have a beautiful forward-spot parity &#xA;$$&#xA;  F(t,T) = S(t)\cdot B(t,T) \tag{1}&#xA;$$&#xA;which tells us that to price a forward contract at time $t$ with expiry $T$ we can just borrow money using the bond $B$ and buy a stock now to deliver it at expiry. If the parity does not hold, given that all securities involved are very liquid, we can make free money by going short one leg and long another. One can even say that all risk-neutral/martingale pricing idea arises from an elaborate version of $(1)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder whether similar relations do exist in Fixed Income world. For example, I was thinking of Eurodollar futures: if I short the futures, at expiry I'll lose if 3 months LIBOR goes higher than the initial forward price. Thus, to find an opposing leg as a hedge, I need to somehow gain from LIBOR going up. Intuitively thinking, I shall benefit from future upward movements of LIBOR in case I borrow money at this rate. However, I am not sure how to translate it into a valid strategy. In general, I'd be interested in valuation techniques for Eurodollar futures.&lt;/p&gt;&#xA;" OwnerUserId="13480" LastActivityDate="2015-08-06T18:25:13.563" Title="Forward parity in fixed income" Tags="&lt;fixed-income&gt;&lt;futures&gt;&lt;forward&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19157" PostTypeId="1" CreationDate="2015-08-03T18:36:35.173" Score="4" ViewCount="2061" Body="&lt;p&gt;I am doing a survey of market making strategies, what's the popular market making strategies?&lt;/p&gt;&#xA;" OwnerUserId="13627" LastActivityDate="2019-12-16T08:30:29.163" Title="What market making strategies are often used nowadays ？" Tags="&lt;market-making&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="19158" PostTypeId="1" CreationDate="2015-08-03T19:18:45.413" Score="9" ViewCount="895" Body="&lt;p&gt;I have been working on getting input parameters to the Non-Linear Optimization which gives the Nelson Siegel Svensson model parameters and am carrying out the OLS regression as described in &lt;a href=&quot;https://quant.stackexchange.com/questions/19001/setting-input-parameters-for-nelson-siegel-svensson-model&quot;&gt;this answer&lt;/a&gt;. However, the input parameters obtained from the OLS are too far off the actual parameters, which I checked against some parameters I actually do have. I am using the equations shown in 'Figure 5' on Page 12 of &lt;a href=&quot;http://www.academia.edu/9582801/The_Nelson-Siegel-Svensson_approach&quot; rel=&quot;nofollow noreferrer&quot;&gt;this paper&lt;/a&gt;, and obtain the yield data, by choosing Par Bonds and using their coupons as Par Yields to bootstrap from to get the Spot Rates, which appears to be an okay method based on Page 3 of &lt;a href=&quot;http://comisef.eu/files/wps044.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;this paper&lt;/a&gt;. The code that I use is below, where I've just implemented the formula in the previous link and have carried out the regression in Python. &lt;strong&gt;My query is if there is an issue with the way I set &lt;code&gt;matrix_of_params&lt;/code&gt; or if it could be to do with the data in &lt;code&gt;df&lt;/code&gt; itself&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I run the function above for different values of &lt;code&gt;tau_1&lt;/code&gt; and &lt;code&gt;tau_2&lt;/code&gt;. I then have a function to get the &lt;code&gt;params&lt;/code&gt; associated with the lowest &lt;code&gt;residuals&lt;/code&gt;, which I am positive is correct.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#df is a Dataframe containing all the data about the Bonds&#xA;def obtainingparams(self, df, tau_1, tau_2, residuals):&#xA;    values = []&#xA;    face_values = df['FACE_VALUE'].values #Writing face values to an array&#xA;    yields = (df['coupon'].values) #COUPON = YTM for Par Bonds         &#xA;    spot_rate = np.zeros((yields.shape[0]))   &#xA;&#xA;    #Calculating Spot Rates&#xA;    for x, value in np.ndenumerate(yields):&#xA;        index = x[0]&#xA;        if index == 0:&#xA;            spot_rate[index] = (yields[index]/face_values[index]) * 100&#xA;&#xA;        else:    &#xA;            adding_negatives = 0&#xA;            if index &amp;lt; spot_rate.shape[0]:&#xA;                for i in range (0, index, 1):&#xA;                    adding_negatives = adding_negatives + (value*face_values[index]/200)/np.power((1+(spot_rate[i]/200)),i+1)&#xA;                    term_1 = face_values[index] - adding_negatives &#xA;                    spot_rate[index] = (2 * ((np.power(((((face_values[index] + ((value*face_values[index]/200)))/term_1))),1/(index+1)))-1))*100&#xA;&#xA;    matrix_of_params = np.empty(shape=[1, 4])&#xA;    months_to_maturity_matrix = df.months_to_maturity.values #Writing months to maturity to an array&#xA;&#xA;    #Populating the Matrix of Parameter Coefficients&#xA;    count = 0&#xA;    for x, value in np.ndenumerate(months_to_maturity_matrix):&#xA;        if count &amp;lt; months_to_maturity_matrix.shape[0]:&#xA;            months_to_maturity = months_to_maturity_matrix[count]&#xA;            years_to_maturity = months_to_maturity/12.0  &#xA;&#xA;            #Applying the equation in the link&#xA;            newrow = [1, ((1-np.exp(-years_to_maturity/tau_1))/(years_to_maturity/tau_1)), ((1-np.exp(-years_to_maturity/tau_1))/(years_to_maturity/tau_1))-(np.exp(-years_to_maturity/tau_1)), ((((1-np.exp(-years_to_maturity/tau_2))/(years_to_maturity/tau_2))))-(np.exp(-years_to_maturity/tau_2))] &#xA;            count = count + 1&#xA;&#xA;            #Just adding the new row to the matrix of parameter coefficients&#xA;            matrix_of_param_coefficients = np.vstack([matrix_of_params, newrow]) &#xA;&#xA;    #Carrying out OLS Regression                &#xA;    params = np.linalg.lstsq(matrix_of_params,spot_rate)[0] &#xA;    residuals = np.sqrt(((spot_rate - matrix_of_params.dot(params))**2).sum())  &#xA;&#xA;   #To keep track of which params are associated with which residuals&#xA;   values.append((tau_1, tau_2, residuals, params)) &#xA;   return values&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thank You&lt;/p&gt;&#xA;" OwnerUserId="11917" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2019-08-16T16:02:45.353" Title="Issue with OLS Regression for Nelson Siegel Svensson parameters" Tags="&lt;fixed-income&gt;&lt;programming&gt;&lt;bond&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19159" PostTypeId="2" ParentId="16138" CreationDate="2015-08-03T20:57:47.047" Score="4" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The stock price and variance follow the processes in this bivariate&#xA;system of stochastic differential equations under the historical&#xA;measure $\mathbb{P}$ also called the physical measure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For pricing purposes,however, we need the processes for under the&#xA;risk-neutral measure $\mathbb{Q}$.This is done by modifying each SDE&#xA;separately by an application of Girsanov’s theorem.The risk-neutral&#xA;process for the variance is defineded by introducing a function&#xA;$\phi(S_t,v_t,t)$ into the drift of $dv_t$ as follows&#xA;$$dv_t=[\alpha(S_t,v_t,t)-\phi(S_t,v_t,t)]dt+\eta\,\beta(S_t,v_t,t)\sqrt{v_t}dW_2(t),$$&#xA;where&#xA;$$W_2(t)=Z_2(t)+\frac{\phi(S_t,v_t,t)}{\eta\,\beta(S_t,v_t,t)\sqrt{v_t}}t$$&#xA;The risk-neutral process for the stock price is&#xA;$$dS_t=rS_t+\sqrt{v_t}S_tdW_1(t)$$ where&#xA;$$W_1(t)=Z_1(t)+\frac{\mu_t-r}{\sqrt{v_t}}t.$$ To summarize, the&#xA;risk-neutral process is \begin{align}&#xA;    &amp;amp;dS_t=rS_t+\sqrt{v_t}S_tdW_1(t)\\&#xA;    &amp;amp;dv_t=[\underbrace{\alpha(S_t,v_t,t)-\phi(S_t,v_t,t)}_{\alpha^*(S_t,v_t,t)}]dt+\eta\,\beta(S_t,v_t,t)\sqrt{v_t}dW_2(t)&#xA;    \end{align} where $$\mathbb{E^Q}[dW_1(t)dW_2(t)]=\rho\,dt$$ Now by&#xA;application of delta hedging argument, we have $$\frac{\partial&#xA;    V}{\partial t} +\frac{1}{2}v\,S^2\frac{\partial^2 V}{\partial&#xA;    S^2}+\rho\,\eta\,\,v\,S \frac{\partial^2 V}{\partial v\,\partial S}&#xA;    + \frac{1}{2}\eta^2v\frac{\partial^2 V}{\partial v^2} + rS \frac{\partial V}{\partial S}-rV=-\alpha^* \frac{\partial&#xA;    V}{\partial v}$$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;Note that,when $\phi=0$ we have $\alpha^*=\alpha$ so that these parameters under the physical and risk-neutral measures are the same.we set $\phi=0$, because &lt;strong&gt;when we estimate the risk-neutral parameters to price options&#xA;we do not need to estimate&lt;/strong&gt; $\phi$. Estimation of $\phi$ is the subject of its own research.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Let $M$ denote the number of underlying traded assets in the model excluding the risk free asset, and let $R$ denote the number of random&#xA;sources.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The model is arbitrage free if and only if $M\leq R$.&lt;/li&gt;&#xA;&lt;li&gt;The model is complete if and only $M\geq R$&lt;/li&gt;&#xA;&lt;li&gt;The model is complete and arbitrage free if and only if $M=R$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In the stochastic volatility model we have $M=1$ and $R=2$ thus model is  arbitrage free.In other words we can say,the risk-neutral measure is not unique.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerDisplayName="user16891" LastEditorDisplayName="user16891" LastEditDate="2015-08-04T12:04:14.113" LastActivityDate="2015-08-04T12:04:14.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19160" PostTypeId="2" ParentId="19157" CreationDate="2015-08-03T22:30:57.087" Score="22" Body="&lt;p&gt;There are hundreds of different market making strategies that exist. I'm going to change &quot;market making&quot; into liquidity provision and try to give you some areas to begin your research.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Arbitrage. Basically you are going to be quoting in one market using limit orders so that you when you get filled you can spread it into another market where you will probably have to take liquidity. Low Latency. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Gamma Scalping. A super basic idea would be to buy some options so that you get a ton of gamma. Then you would place your limit orders in the book such that you would maintain a delta neutral position. Medium Frequency.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Rebate Trading. Most equity exchanges offer a rebate when you get filled on a limit order that does not cross the market. Many of these strategies try to get $0.01 per trade or scratch and make a living off the rebates. Low Latency.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;There are other market making algorithms that take advantage of the matching algorithm (Pro-Rata, Time/Priorty, etc.) I don't think you will find much, if any, information on these types of strategies because they are closely guarded secrets. Most likely all High Frequency/Low Latency.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Designated Market Makers (DMM's). These guys basically do some form of all of the above but they get some advantages based on exchange rules. You can learn more about DMM's at exchange websites like &lt;a href=&quot;https://www.cmegroup.com/&quot; rel=&quot;noreferrer&quot;&gt;www.cmegroup.com&lt;/a&gt; or &lt;a href=&quot;https://www.theice.com/&quot; rel=&quot;noreferrer&quot;&gt;www.theice.com&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Options Market Making. This is a whole different ball game but you basically quote in an options market at a ton of different strikes/expiration dates and manage a portfolio of risks. Again I don't know how much information you could find for a specific example.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I'm sure I'm missing a few examples but this should get you pointed in the right direction. &lt;/p&gt;&#xA;" OwnerUserId="5940" LastEditorUserId="31393" LastEditDate="2019-12-16T08:30:29.163" LastActivityDate="2019-12-16T08:30:29.163" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="19161" PostTypeId="1" AcceptedAnswerId="19162" CreationDate="2015-08-03T23:41:03.457" Score="1" ViewCount="1275" Body="&lt;p&gt;I have some question about realized variance(RV) and I have some sample prices below to work with.  You can run the R code below to build a vector of log returns. Three are 78 5-minute buckets in a trading day (from open to close) so the log returns  vector has length(logreturns) = 78.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The calculation for RV is the sum of the squared log returns. Where X is the log PRICE and n is the number of buckets in a day RV equals:&lt;br&gt;&#xA;$$&#xA;     RV =  \sum\limits_{i=1}^{n} (X_{t_{i+1}} - X_{t_{i}})^2 &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So below I calculate RV, then get the volatility by take square root, then annualize it. .&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;RV = sum(logreturns^2)&#xA;RV&#xA;[1] 2.509554e-05&#xA;daily_volatility = sqrt(RV) &#xA;daily_volatility &#xA;[1] 0.005009545 # i.e. open to close volatility  = .49%&#xA;annualized_volatility = sqrt(260)*volatility&#xA;annualized_volatility&#xA;[1] 0.08033328  # on an annualized basis that is 8.03% &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question 0: My price time series was built using the last tick in each 5-minute bucket. Would it be better to use the VWAP in each bucket instead of the last tick in each bucket?  VWAP would be defined as the product of the PRICEs of all the tick (P) and VOLUME of all the ticks (V)  in a 5-minute bucket divided by the sum of the volume of all the ticks in a bucket 5 minute bucket.  ie.VWAP =  (P*V)/sum(V)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question 1: Can it then be interpreted that the volatility for this day was .5%? or 8.03% on an annualized basis?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I am measuring RV so that I can use it in post-trade regressions looking at trade costs.  I will be measuring volatility from the time the market opens to the time time a trade takes place. For example if a trade takes place in the 16th minute there will be 3 5-minute buckets used in the RV calculation. If another trade takes place in the 76th minute there will be 15 5-minute buckets used. I believe I need to scale the RVs to a daily RV before I can use them in a regression. This is because, using the example above, if the 16th minute RV and the 76th minute RV are the same that would be misleading because the 16th minute RV is not on the same time scale. So...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question 2: How should one properly scale RVs calculated from different number of buckets? For example using the logreturns vector lets say a trade takes place in the 21 minute so I will use the first 4 5-minute buckets to calculate an RV:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;RV = sum(logreturns[1:4]^2) # HERE ONLY USE 1st 4 BUCKETS&#xA;daily_volatility = sqrt(RV) &#xA;daily_volatility &#xA;[1] 0.001503846  # here the volatility using the first 4 buckets is .15%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How should this 0.001503846 be scaled so that it can be used in post trade regressions with different RVs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was thinking scaling by the number of buckets used to get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;scaled_volatility = daily_volatility * sqrt(78/4)&#xA;[1] 0.006640803  #daily volatility would be .66%&#xA;scaled_volatility_annualized = daily_volatility * sqrt(78/4)*sqrt(260)&#xA;[1] 0.1070797  # annualized volatility would be 10.7%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Would that be correct?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question 3:  Does it even make sense to check the annualized RV number against a close-to-close volatility number? Should there be any expectation that they are similar or different?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# R code to build price vector&#xA;prices= c(69.354346196)&#xA;prices= rbind(prices,69.290432)&#xA;prices= rbind(prices,69.300752759)&#xA;prices= rbind(prices,69.219979108)&#xA;prices= rbind(prices,69.208148518)&#xA;prices= rbind(prices,69.246598516)&#xA;prices= rbind(prices,69.316969994)&#xA;prices= rbind(prices,69.382236297)&#xA;prices= rbind(prices,69.439047295)&#xA;prices= rbind(prices,69.303030426)&#xA;prices= rbind(prices,69.215724903)&#xA;prices= rbind(prices,69.235499743)&#xA;prices= rbind(prices,69.228075019)&#xA;prices= rbind(prices,69.226522461)&#xA;prices= rbind(prices,69.278545753)&#xA;prices= rbind(prices,69.279946134)&#xA;prices= rbind(prices,69.294667184)&#xA;prices= rbind(prices,69.325204623)&#xA;prices= rbind(prices,69.296794394)&#xA;prices= rbind(prices,69.271009358)&#xA;prices= rbind(prices,69.258763087)&#xA;prices= rbind(prices,69.230728678)&#xA;prices= rbind(prices,69.250976948)&#xA;prices= rbind(prices,69.275912906)&#xA;prices= rbind(prices,69.266953813)&#xA;prices= rbind(prices,69.275524358)&#xA;prices= rbind(prices,69.257009203)&#xA;prices= rbind(prices,69.248320494)&#xA;prices= rbind(prices,69.239413345)&#xA;prices= rbind(prices,69.169838829)&#xA;prices= rbind(prices,69.15291089)&#xA;prices= rbind(prices,69.181671655)&#xA;prices= rbind(prices,69.171275889)&#xA;prices= rbind(prices,69.149855396)&#xA;prices= rbind(prices,69.181647188)&#xA;prices= rbind(prices,69.116412877)&#xA;prices= rbind(prices,69.169805719)&#xA;prices= rbind(prices,69.17149549)&#xA;prices= rbind(prices,69.171311493)&#xA;prices= rbind(prices,69.150704259)&#xA;prices= rbind(prices,69.168990869)&#xA;prices= rbind(prices,69.167502639)&#xA;prices= rbind(prices,69.169828509)&#xA;prices= rbind(prices,69.136281414)&#xA;prices= rbind(prices,69.137206043)&#xA;prices= rbind(prices,69.108438269)&#xA;prices= rbind(prices,69.10342004)&#xA;prices= rbind(prices,69.165636224)&#xA;prices= rbind(prices,69.193646811)&#xA;prices= rbind(prices,69.2072143)&#xA;prices= rbind(prices,69.232462739)&#xA;prices= rbind(prices,69.255101895)&#xA;prices= rbind(prices,69.278061272)&#xA;prices= rbind(prices,69.33507867)&#xA;prices= rbind(prices,69.378308505)&#xA;prices= rbind(prices,69.373578935)&#xA;prices= rbind(prices,69.42822269)&#xA;prices= rbind(prices,69.433781902)&#xA;prices= rbind(prices,69.448787913)&#xA;prices= rbind(prices,69.441731914)&#xA;prices= rbind(prices,69.444092485)&#xA;prices= rbind(prices,69.440302981)&#xA;prices= rbind(prices,69.379244744)&#xA;prices= rbind(prices,69.430264889)&#xA;prices= rbind(prices,69.441485395)&#xA;prices= rbind(prices,69.492248013)&#xA;prices= rbind(prices,69.513478661)&#xA;prices= rbind(prices,69.567990492)&#xA;prices= rbind(prices,69.580500697)&#xA;prices= rbind(prices,69.51972368)&#xA;prices= rbind(prices,69.561692927)&#xA;prices= rbind(prices,69.563459496)&#xA;prices= rbind(prices,69.538617278)&#xA;prices= rbind(prices,69.58494135)&#xA;prices= rbind(prices,69.564894664)&#xA;prices= rbind(prices,69.548091511)&#xA;prices= rbind(prices,69.604420178)&#xA;prices= rbind(prices,69.574414993)&#xA;prices= rbind(prices,69.632808692)&#xA;head(prices)&#xA;logreturns = diff(log(prices))#log returns&#xA;head(logreturns)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="16923" LastEditorUserId="16923" LastEditDate="2015-08-04T03:13:33.557" LastActivityDate="2018-09-17T23:13:51.677" Title="Interpreting and scaling of Realized Variance with sample data" Tags="&lt;volatility&gt;&lt;stochastic-processes&gt;&lt;implied-volatility&gt;&lt;high-frequency&gt;&lt;high-frequency-estimators&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19162" PostTypeId="2" ParentId="19161" CreationDate="2015-08-04T00:42:30.430" Score="1" Body="&lt;p&gt;I'll address things in order as I encountered them in the question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, your formula for RV only makes sense if $X_{t_i}$ is the log-&lt;em&gt;price&lt;/em&gt;, not log-&lt;em&gt;return&lt;/em&gt;. If this was just a mistype it would probably be best if you edited the question to correct it. If it is not a mistype, let me know, because then you have bigger problems...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Answer 0:&lt;/strong&gt; I have no idea what VWAP is. However, I can tell you that the standard in the academic literature is to use the most recent observation in each bucket. Assuming VWAP is some kind of smooth function over all the observations in the bucket, you might find that RV calculated using VWAP is smaller on average than RV calculated using the most recent observation. Whether or not this is a good thing is really application dependent. &lt;strong&gt;2018 Edit:&lt;/strong&gt; Okay, so VWAP is volume-weighted average price. I probably should have guessed that. I've never looked into VWAP. I did once look into weighted best-bid/best-ask, ie instead of bid-ask midpoint, weight the best bid and best ask by the respective best bid volumes and best ask volumes. Using this price proxy resulted in high frequency variance estimates that were &lt;em&gt;significantly&lt;/em&gt; larger than when using transaction of bid-ask midpoint data. I ended up abandoning it entirely as the numbers did not look sensible from a heuristic perspective.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Answer 1:&lt;/strong&gt; Using the notation you describe in the question, realised volatility is an estimate of &lt;em&gt;the true volatility of a return that spans the time-period $[t_1, t_n]$&lt;/em&gt;. You can scale the number up or down but this only changes the &lt;em&gt;units&lt;/em&gt;. It does &lt;em&gt;not&lt;/em&gt; change the interpretation. However you choose to scale the number, the estimator itself still only pertains to the interval $[t_1, t_n]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put another way, an RV estimator that spans $[t_1, t_n]$ can &lt;em&gt;not&lt;/em&gt; be interpreted as an estimator for a different time-span, such as $[t_1, t_{n+1}]$ except under the strict assumption that true volatility is constant (and this assumption is almost never valid in financial markets).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, I am not saying you can't scale your RV estimators up so that they are all in annualized units. Feel free to talk about your RV estimator as being ~8% in annualised units. There is nothing wrong with that. I am merely stating that you must never forget that the estimator itself was derived only from data spanning $[t_1, t_n]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Answer 2:&lt;/strong&gt; This is a hard one to answer without knowing &lt;em&gt;exactly&lt;/em&gt; what you are trying to do with your regressions. For example, if you only care about the statistical significance of your estimated coefficients, then the question of scaling is irrelevant as it will have no effect on the statistical significance of your estimators. This is because scaling a sequence of random variables by a constant has no effect on the correlation with other random variables. (Note, I'm assuming here you are doing a relatively common method of estimation like OLS - I can think of some exotic estimation methods where it might make a difference).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, if you want to make ad hoc comparisons between the &lt;em&gt;magnitude&lt;/em&gt; of your estimated coefficients, then yes, it might prove useful to scale all your realised variance estimators up to the same units. You can do this using the square-root of time as you have discussed in the question, but just keep in mind my warnings about interpretation from &lt;strong&gt;Answer 1&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; Based on the regression problem that OP describes in the comments my analysis is as follows: If you want to use realised volatility estimators from many different spans of time to estimate the coefficient (beta term) in the described regression then it is &lt;em&gt;very&lt;/em&gt; important that you scale the realised volatilities to all be in the same units, e.g. annualized. This is because your regression appears to be attempting to isolate the effect of &quot;spot&quot; (I'm using that term loosely here - apologies to any purists reading) volatility on trading costs. But if you don't scale all RV to the same units, you'll also be measuring the effect of time of day on trading costs, because RVs from earlier in the day are measured over a shorter span and so will be smaller. I'm assuming the object is to isolate the effect of volatility on trading costs, which means we want to eliminate any other effects. So in this case, scaling realised variances so they're all measured in the same units makes good sense to me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Answer 3:&lt;/strong&gt; I am not really sure what you mean by close-to-close volatility number. I'm guessing you mean the sample variance estimator calculated using close-to-close returns that, together, span a year. If this is the case, then as I stated in &lt;strong&gt;Answer 1&lt;/strong&gt;, the comparison is only meaningful if true volatility is constant over the entire year (which would never happen in financial markets).&lt;/p&gt;&#xA;" OwnerUserId="2998" LastEditorUserId="2998" LastEditDate="2018-09-17T23:13:51.677" LastActivityDate="2018-09-17T23:13:51.677" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="19163" PostTypeId="2" ParentId="17932" CreationDate="2015-08-04T03:07:53.857" Score="1" Body="&lt;p&gt;If I understand your problem correctly you are trying to search for the optimal basket of 5 pairs (without worrying about weighting).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is computationally there are too many combinations to sort through.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I will propose a simple algorithm:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Calculate correlation matrix, grab the pair that has the least avg correlation as a seed for your basket, then iterate through the correlations with the rest of pairs searching for the next pair that is the least correlated with the current basket and iteratively adding them until you have enough items required.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to add correlation and stddev I suggest you come up with a preference function or utility function to model the tradeoff between them.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;require(PerformanceAnalytics)&#xA;data(edhec)&#xA;##simple example on edhec test data&#xA;&#xA;cormat = cor(edhec)&#xA;&#xA;###Seed the basket&#xA;inital_asset = which.min(colMeans(cormat))&#xA;names_in_basket = labels(inital_asset)&#xA;&#xA;&#xA;###Grab the one least avg correlated with existing basket&#xA;while(length(names_in_basket)&amp;lt;5){&#xA;  if(length(names_in_basket)&amp;lt;2){&#xA;  names_in_basket=c(names_in_basket, labels(which.min(cormat[,names_in_basket[1]])))&#xA;  }else{&#xA;    names_in_basket=c(names_in_basket, labels(which.min(rowMeans(cormat[!rownames(cormat)%in%names_in_basket,names_in_basket]))))&#xA;&#xA;      }&#xA;&#xA;    }&#xA;&#xA;###Sanity Check&#xA;mean(cormat[rownames(cormat)%in%names_in_basket,names_in_basket])&amp;lt;mean(cormat)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2154" LastActivityDate="2015-08-04T03:07:53.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19164" PostTypeId="1" AcceptedAnswerId="19170" CreationDate="2015-08-04T05:41:15.980" Score="3" ViewCount="336" Body="&lt;p&gt;If I have a large order to fill, shouldn't I always buy a derivative in the same direction to profit from the market impact?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. I sell 1 million shares and so I buy a put, which will hence almost surely increase in value (due to large market impact).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that I lose value from selling shares as the price goes down, but my point is more about always adding the put (assuming I want to sell the shares anyways)? It would be a kind of self-frontrunning strategy.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2015-08-04T13:34:56.577" LastActivityDate="2015-08-04T15:24:34.433" Title="Self-Frontrunning Arbitrage" Tags="&lt;quant-trading-strategies&gt;&lt;trading&gt;&lt;arbitrage&gt;&lt;automated-trading&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19166" PostTypeId="2" ParentId="17910" CreationDate="2015-08-04T08:36:31.650" Score="2" Body="&lt;p&gt;Concerning the weighted portfolio returns.&#xA;If you have weights $w_i$ and individual returns $r_i$ of your assets then it is only precisely true that the portfolio return $r$ is given by the scalar product&#xA;$$&#xA;r = \sum_{i=1}^n w_i r_i&#xA;$$&#xA;if $r_i$ is the usual arithmetic/simple return (not logreturn).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thereby I mean the simple return&#xA;$$&#xA;r = P_{t+1}/P_t - 1&#xA;$$&#xA;as opposed to the log-returm&#xA;$$&#xA;R = \ln(P_{t+1}/P_t) = \ln P_{t+1} - \ln P_{t+1}.&#xA;$$&#xA;Switching between the two is easy as &#xA;$$&#xA;R = \ln(1+r)&#xA;$$&#xA;and&#xA;$$&#xA;r = \exp(R)-1.&#xA;$$&#xA;Logreturns are good for statistical modelling as they range from $-\infty$ to $\infty$ and that's where the useful distributions live on. &#xA;For a portfolio should use the geometric return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you can do: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;generated random log-returns for each asset, convert to somple returns.&lt;/li&gt;&#xA;&lt;li&gt;aggregate to the simple-returns of the portfolio&lt;/li&gt;&#xA;&lt;li&gt;convert the portfolio-returns to log-returns&lt;/li&gt;&#xA;&lt;li&gt;calculate a quantile.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For more information on returns you can look &lt;a href=&quot;https://en.wikipedia.org/wiki/Rate_of_return#Arithmetic_average_rate_of_return&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;https://quantivity.wordpress.com/2011/02/21/why-log-returns/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-08-04T08:50:56.220" LastActivityDate="2015-08-04T08:50:56.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19167" PostTypeId="1" AcceptedAnswerId="19191" CreationDate="2015-08-04T09:02:43.987" Score="2" ViewCount="465" Body="&lt;p&gt;I'm preparing a project at my Uni where I have to make a simple &lt;em&gt;pair trading&lt;/em&gt; strategy using cointegration between two stocks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm stuck on the equity line calculation. I have prepared opening and closing signals but still have to prepare a &lt;strong&gt;plot of equity line&lt;/strong&gt; but I don't know how to calculate it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are some details:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-long position in undervalued stock and short in overvalued&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-short selling allowed without boundaries, with the deposit of 100% of the short sell value&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-when opening the position, we assume &lt;strong&gt;equal shares&lt;/strong&gt; of short and long positions&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-&lt;strong&gt;open/close&lt;/strong&gt; signals are defined by the &lt;strong&gt;close price&lt;/strong&gt;, positions are &lt;strong&gt;opened/closed&lt;/strong&gt; by the next day &lt;strong&gt;open price&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-&lt;strong&gt;transaction fee&lt;/strong&gt; are &lt;strong&gt;0,1%&lt;/strong&gt; of position value (at the open and the close)&lt;/p&gt;&#xA;" OwnerUserId="17113" LastActivityDate="2015-08-05T15:26:16.240" Title="Pair trading based on cointegration - equity line" Tags="&lt;trading&gt;&lt;returns&gt;&lt;cointegration&gt;&lt;pairs-trading&gt;&lt;equity-curve&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19169" PostTypeId="2" ParentId="17661" CreationDate="2015-08-04T13:59:08.650" Score="0" Body="&lt;p&gt;The Blundell Ward filter is a fairly commonly used method for removing first order autocorrelation see;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.scribd.com/doc/142748206/Impact-of-Auto-correlation-on-Expected-Maximum-Drawdown#scribd&quot; rel=&quot;nofollow&quot;&gt;http://www.scribd.com/doc/142748206/Impact-of-Auto-correlation-on-Expected-Maximum-Drawdown#scribd&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2911" LastActivityDate="2015-08-04T13:59:08.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19170" PostTypeId="2" ParentId="19164" CreationDate="2015-08-04T15:24:34.433" Score="1" Body="&lt;p&gt;Just take a look at the bid ask spreads plus transaction costs. It's nonsense what you are saying because on one side you implicitly assume enough liquidity so you market maker executes the Delta of your position. On the other hand you assume the market is liquid so you can move the market when you sell your position.&lt;/p&gt;&#xA;" OwnerUserId="13398" LastActivityDate="2015-08-04T15:24:34.433" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19171" PostTypeId="2" ParentId="19158" CreationDate="2015-08-04T15:35:52.893" Score="1" Body="&lt;p&gt;First of all you need to get the YTM. The parametric model has an economic interpretation so coupons would mess the estimation and the interpretation of your model. Because of that the values of both taus must be restricted so you can avoid multicoliniarity. If they are the same you are saying that both curvatures are on the same tenor but then your model is reduced to the Nelson Siegel. &lt;/p&gt;&#xA;" OwnerUserId="13398" LastActivityDate="2015-08-04T15:35:52.893" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19172" PostTypeId="2" ParentId="19079" CreationDate="2015-08-04T17:41:46.997" Score="6" Body="&lt;p&gt;As the swap rate is not tradable, the delta hedge ratio with respect to the spot swap rate is not really useful. However, note that&#xA;\begin{align*}&#xA;V_0 &amp;amp;= \sum_{i=\alpha+1}^{\beta}\tau_i P(0, T_i)\big[S_{\alpha, \beta}(0)N(d_1) - k N(d_2) \big]\\&#xA;&amp;amp;= \sum_{i=\alpha+1}^{\beta}\tau_i P(0, T_i) S_{\alpha, \beta}(0)N(d_1) - N(d_2) k \sum_{i=\alpha+1}^{\beta}\tau_i P(0, T_i)\\&#xA;&amp;amp;= \Big[P(0, T_{\alpha}) -  P(0, T_{\beta})\Big]N(d_1) - N(d_2) k \sum_{i=\alpha+1}^{\beta}\tau_i P(0, T_i)\\&#xA;&amp;amp;= \bigg[P(0, T_{\alpha}) -  P(0, T_{\beta})- k \sum_{i=\alpha+1}^{\beta}\tau_i P(0, T_i)\bigg]N(d_1) \\&#xA;&amp;amp; \qquad\qquad\qquad\qquad + \Big[N(d_1)- N(d_2)\Big] k \sum_{i=\alpha+1}^{\beta}\tau_i P(0, T_i).&#xA;\end{align*}&#xA;Here,&#xA;\begin{align*}&#xA;A_{\alpha, \beta} &amp;amp;\triangleq P(0, T_{\alpha}) -  P(0, T_{\beta}) - k \sum_{i=\alpha+1}^{\beta}\tau_i P(0, T_i)\\&#xA;&amp;amp;= \sum_{i=\alpha+1}^{\beta}\tau_i P(0, T_i)\big[S_{\alpha, \beta}(0) -k \big]&#xA;\end{align*}&#xA;is the value of the underlying swap, and&#xA;\begin{align*}&#xA;k \sum_{i=\alpha+1}^{\beta}\tau_i P(0, T_i)&#xA;\end{align*}&#xA;is the value of a portfolio of zero-coupon bonds. We define the delta hedge ratio of the swaption to the derivative of the swaption value with respect to the swap value $A_{\alpha, \beta}$. Note that&#xA;\begin{align*}&#xA;S_{\alpha, \beta}(0) = \frac{A_{\alpha, \beta}}{\sum_{i=\alpha+1}^{\beta}\tau_i P(0, T_i)} + k.&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;\frac{\partial V_0}{\partial A_{\alpha, \beta}} &amp;amp;= \frac{\partial V_0}{\partial S_{\alpha, \beta}(0)} \frac{\partial S_{\alpha, \beta}(0)} {\partial A_{\alpha, \beta}}\\&#xA;&amp;amp;= N(d_1),&#xA;\end{align*}&#xA;which is, for hedging purpose, the quantity of the underlying swap to buy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See alos the discussion in &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.28.7064&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow&quot;&gt;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.28.7064&amp;amp;rep=rep1&amp;amp;type=pdf&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-08-04T23:39:58.993" LastActivityDate="2015-08-04T23:39:58.993" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="19173" PostTypeId="1" CreationDate="2015-08-04T19:17:59.377" Score="3" ViewCount="331" Body="&lt;p&gt;Assume $r_t$ follow the CIR process and $P(t,T)=E[exp(-\int_{t}^{T}r_s ds)|F_t]$.I am going to show $\frac{P(t,S)}{P(t,T)}$ ($S&amp;lt;T$) is an $F_t$-martingale under Forward Measure but So confused!&#xA;Do I need to solve C.I.R process?&#xA;Should I use the definition of martingale?&#xA;please guide me!&#xA;so thanks.&lt;/p&gt;&#xA;" OwnerUserId="17118" LastActivityDate="2015-08-05T16:28:51.337" Title="Is $\frac{P(t,S)}{P(t,T)}$ martingale?" Tags="&lt;martingale&gt;&lt;zero-coupon&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19174" PostTypeId="2" ParentId="19173" CreationDate="2015-08-04T19:28:03.750" Score="3" Body="&lt;p&gt;By definition of the $T$-forward measure $P_T$, the process $\Big\{\frac{P(t,S)}{P(t,T)} \mid t\geq 0\Big\}$ is a martingale under the measure $P_T$, without assuming any specific models of the short rate $r_t$. &#xA;That is, this martingale property is model independent. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, as a good exercise, you can also do the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Given the CIR interest rate model under the risk-neutral measure $P$, compute the bond prices.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Find the Radon-Nykodim derivative of the $T$-forward measure with respect to the risk-neutral measure, that is, $\frac{dP_T}{dP}\big|_t$, for $0 \leq t \leq T$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Find the bond price formula or SDE under the $T$-forward measure.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Show that the process $\Big\{\frac{P(t,S)}{P(t,T)} \mid t\geq 0\Big\}$ is a martingale under the $T$-forward measure.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-08-05T13:32:42.720" LastActivityDate="2015-08-05T13:32:42.720" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19175" PostTypeId="1" AcceptedAnswerId="19194" CreationDate="2015-08-04T21:11:11.580" Score="2" ViewCount="87" Body="&lt;p&gt;What econometric symbol list (or tickers) could be used to forecast return of global stock market indexes (S&amp;amp;P500, TSX, CAC40, ...) and their subsectors?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm aware of the answer to question: &#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/141/what-data-sources-are-available-online&quot;&gt;What data sources are available online?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I'm looking to build is a actual list of tickers that could be used from the databases stated above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please add to the follow items:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;US Economy: FRED-MD: A Monthly Database for Macroeconomic Research&#xA;&lt;a href=&quot;https://research.stlouisfed.org/wp/2015/2015-012.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://research.stlouisfed.org/wp/2015/2015-012.pdf&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Canada:&lt;/li&gt;&#xA;&lt;li&gt;Euro Zone:&lt;/li&gt;&#xA;&lt;li&gt;Asia-Pacific Zone:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="17015" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2015-08-05T16:30:12.790" Title="List of Economic Data for Index Forecast" Tags="&lt;market-data&gt;&lt;forecasting&gt;&lt;econometrics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19176" PostTypeId="1" AcceptedAnswerId="19177" CreationDate="2015-08-04T21:33:24.083" Score="1" ViewCount="247" Body="&lt;p&gt;I am calculating the theoretical discount factors associated with a bond that has 30 months to maturity from today with the parameters below obtained from &lt;a href=&quot;http://www.federalreserve.gov/econresdata/researchdata/feds200628_1.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; using the  Nelson-Siegel-Svensson Model. The Python code is just a direct application of the Nelson-Siegel-Svensson Model formula. &lt;em&gt;Are the theoretical Discount factors obtained from NSS meant to be this small?&lt;/em&gt; &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;beta_0 = 6.33120453&#xA;beta_1 =-6.22139731&#xA;beta_2 = -4.55116776&#xA;beta_3 = -8.72097716&#xA;tau_1 = 1.68437012&#xA;tau_2 = 11.18918219&#xA;months_to_maturity_array = numpy.array([6, 12, 18, 24, 30])&#xA;years_to_maturity_array = months_to_maturity_array/12&#xA;term_1 = (beta_0) + (beta_1*((1-numpy.exp(-years_to_maturity_array/tau_1))/(years_to_maturity_array/tau_1))) + (beta_2*((((1-numpy.exp(-years_to_maturity_array/tau_1))/(years_to_maturity_array/tau_1)))-(numpy.exp(-years_to_maturity_array/tau_1))) + (beta_3*((((1-numpy.exp(-years_to_maturity_array/tau_2))/(years_to_maturity_array/tau_2)))-(numpy.exp(-years_to_maturity_array/tau_2))))&#xA;test = numpy.exp(-years_to_maturity_array * (term_1))&#xA;print('RESULT:', test)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The output discount factors come out to be &lt;code&gt;[ 0.9032555   0.70209724  0.44987297  0.23612997  0.10293834]&lt;/code&gt;, which seems very low. Such small discount factors will result in very small prices as expected, which effects the Non-Linear Optimization used to calculate the parameters. For example if the bond has the set of coupons and face values as shown below, then the &lt;code&gt;price&lt;/code&gt; turns out to be &lt;code&gt;27.2861601745&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;coupons_and_facevals = [1.5, 1.5, 1.5, 102.5]          &#xA;coupons_and_facevals = numpy.array(coupons_and_facevals)&#xA;price = 0&#xA;for i in range(0,4,1):&#xA;    price = price + coupons_and_facevals[i] * test[i]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've been dabbling with this for a while but am stuck. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank You&lt;/p&gt;&#xA;" OwnerUserId="11917" LastEditorUserId="11917" LastEditDate="2015-08-04T22:30:59.217" LastActivityDate="2015-08-04T22:30:59.217" Title="Correct Theoretical Discount Factors from Nelson-Siegel-Svensson?" Tags="&lt;fixed-income&gt;&lt;programming&gt;&lt;bond&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19177" PostTypeId="2" ParentId="19176" CreationDate="2015-08-04T22:30:24.837" Score="1" Body="&lt;p&gt;Your &lt;code&gt;term_1&lt;/code&gt;, which represent the zero coupon rates, are expressed in %. You have to divide the values by 100 to compute discount factors.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2015-08-04T22:30:24.837" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19178" PostTypeId="2" ParentId="16798" CreationDate="2015-08-04T22:57:03.770" Score="1" Body="&lt;p&gt;&quot;It must dominate at zero&quot; means that when the final spot level is zero, the value of the super-replicating portfolio must be greater than or equal to the value of the payoff, which is zero.  Since the super-replicating portfolio consists of some stock (which has zero value when the spot price is zero) and some bonds (which have value one), there must be a non-negative number of bonds.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2015-08-04T22:57:03.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19179" PostTypeId="2" ParentId="15702" CreationDate="2015-08-04T23:18:39.997" Score="2" Body="&lt;p&gt;In options pricing language, the probability of a spot process being above a given level $K$ at time $T$ is the undiscounted price of a digital call option on that spot process.  In the Heston model, there is an analytic expression for this in terms of Fourier transform.  You can find this in various standard references, e.g. Alan Lewis's book &quot;Option Valuation Under Stochastic Volatility&quot; or by google search.  When I try &quot;digital option in heston model&quot; the top result I find is a student paper &lt;a href=&quot;http://www.cs.ubbcluj.ro/~studia-m/2003-3/lazar.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.cs.ubbcluj.ro/~studia-m/2003-3/lazar.pdf&lt;/a&gt; which at first glance looks basically correct, though I don't see a discussion of the branch cut issue which often trips up unwary implementors of Heston model analytics.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2015-08-04T23:18:39.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19181" PostTypeId="1" CreationDate="2015-08-05T08:42:09.420" Score="7" ViewCount="2762" Body="&lt;p&gt;I would like to know how you would compute Value at Risk on a portfolio of futures i.e rates futures, commodity futures and equity. How do you deal with the discontinuous form of commodity futures for example, how do you select the right time series for these futures when liquidity and seasonality aspects kicks in. Do we need to build a constant maturity futures contract to be able to calculate the VaR? Or we can directly calculate the VaR on the continuous price time series( GFUT as example on Bloomberg). I am afraid that as Parametric VaR involves the calculation of CovVar matrix of returns, the selection of good n fair prices of futures in critical in order not to get misleading results of VaR?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any experience on that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much&lt;/p&gt;&#xA;&#xA;&lt;p&gt;S&lt;/p&gt;&#xA;" OwnerUserId="17123" LastActivityDate="2015-08-06T15:11:35.180" Title="Value at Risk for Futures Contracts" Tags="&lt;time-series&gt;&lt;futures&gt;&lt;var&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19182" PostTypeId="2" ParentId="8952" CreationDate="2015-08-05T08:57:47.480" Score="1" Body="&lt;p&gt;According to &lt;a href=&quot;http://javarevisited.blogspot.fr/2011/02/repeating-groups-in-fix-protcol.html&quot; rel=&quot;nofollow&quot;&gt;http://javarevisited.blogspot.fr/2011/02/repeating-groups-in-fix-protcol.html&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Repeating group are used to carry repeating data&lt;/li&gt;&#xA;&lt;li&gt;It starts with a particular tag which specifies how many repeating tags are present within repeating group&lt;/li&gt;&#xA;&lt;li&gt;A specific field identifies the beginning of a group new entry.&lt;/li&gt;&#xA;&lt;li&gt;Any tag which doesn't belong to repeating group automatically indicates the end of the repeating group. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="17124" LastActivityDate="2015-08-05T08:57:47.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19183" PostTypeId="2" ParentId="19088" CreationDate="2015-08-05T10:10:39.027" Score="3" Body="&lt;p&gt;Is this basically a version of the Leverage Effect? If so then there is an extensive literature on that and you might find something if you google with those keywords.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example is something like the following what you are looking for?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Agent-based model with asymmetric trading and herding for complex financial systems&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://arxiv.org/abs/1407.5258&quot; rel=&quot;nofollow&quot;&gt;http://arxiv.org/abs/1407.5258&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://icpcs.lzu.edu.cn/summerschool2013/summer-school_PPT/zhengb6.pdf&quot; rel=&quot;nofollow&quot;&gt;slides&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="142" LastActivityDate="2015-08-05T10:10:39.027" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19184" PostTypeId="2" ParentId="19173" CreationDate="2015-08-05T10:33:11.110" Score="3" Body="&lt;p&gt;We assume $\mathbb{Q}$ is forward measure. &#xA;$$\mathbb{E^Q}\left[\frac{P(t,S)}{P(t,T)}|\mathcal{F}_s\right]=\mathbb{E^P}\left[\frac{P(t,S)}{P(t,T)}\frac{e^{-\int_{s}^{T}r_u\,du}}{P(s,T)}\,|\,\mathcal{F}_s\right]$$&#xA;$$\hspace{5cm}=\frac{1}{P(s,T)}\mathbb{E^P}\left[\frac{P(t,S)}{P(t,T)}{e^{-\int_{s}^{T}r_u\,du}}\,|\,\mathcal{F}_s\right]$$&#xA;$$\hspace{6.9cm}=\frac{1}{P(s,T)}\mathbb{E^P}\left[\mathbb{E^P}\left[\frac{P(t,S)}{P(t,T)}{e^{-\int_{s}^{T}r_u\,du}}\,|\,\mathcal{F}_t\right]|\mathcal{F}_s\right]$$&#xA;we have&#xA;$$\hspace{0.3cm}\mathbb{E^Q}\left[\frac{P(t,S)}{P(t,T)}|\mathcal{F}_s\right]=\frac{1}{P(s,T)}\mathbb{E^P}\left[{e^{-\int_{s}^{t}r_u\,du}}\frac{P(t,S)}{P(t,T)}\mathbb{E^P}\left[e^{-\int_{t}^{T}r_u\,du\,}\,\,|\,\mathcal{F}_t\right]|\mathcal{F}_s\right]$$&#xA;$$\hspace{1.5cm}=\frac{1}{P(s,T)}\mathbb{E^P}\left[{e^{-\int_{s}^{t}r_u\,du}}\frac{P(t,S)}{P(t,T)}P(t,T)|\mathcal{F}_s\right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$=\frac{1}{P(s,T)}\mathbb{E^P}\left[{e^{-\int_{s}^{t}r_u\,du}}P(t,S)|\mathcal{F}_s\right]$$&#xA;then&#xA;$$\mathbb{E^Q}\left[\frac{P(t,S)}{P(t,T)}|\mathcal{F}_s\right]=\frac{1}{P(s,T)}{e^{\int_{0}^{s}r_u\,du}}\,\,\mathbb{E^P}\left[{e^{-\int_{0}^{t}r_u\,du}}P(t,S)|\mathcal{F}_s\right]$$&#xA;we know the discounted bond price process $\{e^{-\int_{0}^{t}r_u\,du}P(t,S)\}$ is a martingale under $\mathbb{P}$, thus we have&#xA;$$\hspace{1cm}\mathbb{E^Q}\left[\frac{P(t,S)}{P(t,T)}|\mathcal{F}_s\right]=\frac{1}{P(s,T)}{e^{\int_{0}^{s}r_u\,du}}{e^{-\int_{0}^{s}r_u\,du}}P(s,S)$$&#xA;$$=\frac{P(s,S)}{P(s,T)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$$$&#xA;EDIT: Alternatively,&#xA;\begin{align*}&#xA;\mathbb{E^Q}\left[\frac{P(t,S)}{P(t,T)}\mid \mathcal{F}_s\right] &amp;amp;= \frac{1}{P(s,T)}\mathbb{E^P}\left[{e^{-\int_{s}^{t}r_u\,du}}P(t,S)\mid\mathcal{F}_s\right]\\&#xA;&amp;amp;=\frac{1}{P(s,T)}\mathbb{E^P}\left[{e^{-\int_{s}^{t}r_u\,du}}\mathbb{E^P}\Big(e^{-\int_t^Sr_u\,du} \mid \mathcal{F}_t \Big)\mid\mathcal{F}_s\right]\\&#xA;&amp;amp;=\frac{1}{P(s,T)}\mathbb{E^P}\left[\mathbb{E^P}\Big(e^{-\int_s^Sr_u\,du} \mid \mathcal{F}_t \Big)\mid\mathcal{F}_s\right]\\&#xA;&amp;amp;= \frac{1}{P(s,T)}\mathbb{E^P}\left[e^{-\int_s^Sr_u\,du}\mid\mathcal{F}_s\right]\\&#xA;&amp;amp;= \frac{P(s,S)}{P(s,T)}.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastEditorUserId="11678" LastEditDate="2015-08-05T16:28:51.337" LastActivityDate="2015-08-05T16:28:51.337" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="19185" PostTypeId="1" AcceptedAnswerId="19198" CreationDate="2015-08-05T12:16:36.047" Score="5" ViewCount="3503" Body="&lt;p&gt;In this [&lt;a href=&quot;https://quant.stackexchange.com/questions/18684/heston-model-option-price-formula&quot;&gt;post&lt;/a&gt;] discussed the European put and call price formulas under the Heston Stochastic Volatility model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There exists an important extension of Heston model to include diffusion jumps, known as Bates Stochastic Volatility Jump (SVJ) model, as referred to in this &lt;a href=&quot;https://www0.gsb.columbia.edu/faculty/mjohannes/PDFpapers/BCJ2.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;paper&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the option price formulas in SVJ model?&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2019-09-25T14:29:18.460" Title="Option prices in Bates SVJ model?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;stochastic-volatility&gt;&lt;jump&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19186" PostTypeId="2" ParentId="18160" CreationDate="2015-08-05T12:46:51.053" Score="1" Body="&lt;p&gt;This is an interesting problem. I don't think the problem is set up correctly quite yet. I rewrote it slightly to correspond to how it's generally written as a quadratic program. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The optimization problem you write down fixes betas to be a certain value. That could make sense but instead I wondered if we could simply minimize beta across the portfolio while minimizing correlations. In that case, the optimization problem becomes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;\min_w \quad&amp;amp; w^\prime \Sigma w + w^\prime\lvert\beta\rvert\\&#xA;s.t. \quad&amp;amp; w^\prime\vec 1 = 1 \\&#xA;\text{and} \quad &amp;amp; w &amp;gt; 0&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't think a closed-form solution exists to this problem. But it's quite easy (and fast) to solve this with a quadratic optimizer such as provided by &lt;code&gt;cvxopt&lt;/code&gt;. Here is some example code:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;pre&gt;&lt;code&gt;&lt;/p&gt;&#xA;&#xA;import numpy as np&#xA;import matplotlib.pyplot as plt&#xA;import cvxopt as opt&#xA;from cvxopt import blas, solvers&#xA;import pandas as pd&#xA;&#xA;np.random.seed(123)&#xA;&#xA;# Turn off progress printing &#xA;solvers.options['show_progress'] = False&#xA;&#xA;## NUMBER OF ASSETS&#xA;n_assets = 4&#xA;&#xA;## NUMBER OF OBSERVATIONS&#xA;n_obs = 1000&#xA;&#xA;# Generate returns&#xA;return_vec = np.random.randn(n_assets, n_obs)&#xA;&#xA;betas = np.array([.1, .8, .2, .05])&#xA;&#xA;def markowitz_beta(returns, betas):&#xA;    n = len(returns)&#xA;    returns = np.asmatrix(returns)&#xA;&#xA;    # Convert to cvxopt matrices&#xA;    # minimize: w * mu*S * w + betas * x &#xA;    S = opt.matrix(np.cov(returns))&#xA;&#xA;    # Minimize betas, can add mean returns here if desired&#xA;    pbar = opt.matrix(np.abs(betas))&#xA;&#xA;    # Create constraint matrices&#xA;    # Gx &amp;lt; h: Every item is positive&#xA;    G = opt.matrix(-np.eye(n))   # negative n x n identity matrix&#xA;    h = opt.matrix(np.zeros(n))&#xA;    # Ax = b sum of all items = 1&#xA;    A = opt.matrix(1.0, (1, n))&#xA;    b = opt.matrix(1.0)&#xA;&#xA;    # CALCULATE THE OPTIMAL PORTFOLIO&#xA;    wt = solvers.qp(S, pbar, G, h, A, b)['x']&#xA;    return np.asarray(wt).ravel()&#xA;&#xA;weights = markowitz_beta(return_vec, betas)&#xA;print weights&#xA;print betas.ravel()&#xA;print np.dot(weights, betas)&#xA;&#xA;&#xA;Output:&#xA;&#xA;[  3.50677883e-01   3.34638307e-07   2.50326847e-01   3.98994936e-01]&#xA;[ 0.1   0.8   0.2   0.05]&#xA;0.105083172131&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see, the highest betas receive very low weights.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We also wrote a blog post on this (and the code is a version from there) which you can find here: &lt;a href=&quot;https://www.quantopian.com/posts/the-efficient-frontier-markowitz-portfolio-optimization-using-cvxopt-repost-cloning-of-nb-now-enabled&quot; rel=&quot;nofollow&quot;&gt;https://www.quantopian.com/posts/the-efficient-frontier-markowitz-portfolio-optimization-using-cvxopt-repost-cloning-of-nb-now-enabled&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Disclaimer: I work at Quantopian.&lt;/p&gt;&#xA;" OwnerUserId="17125" LastActivityDate="2015-08-05T12:46:51.053" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19188" PostTypeId="2" ParentId="15702" CreationDate="2015-08-05T12:57:31.250" Score="1" Body="&lt;p&gt;COS method is an efficient way to recover the distribution function from the characteristic function in the Heston model. For other methods, you may refer to &quot;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2274506&quot; rel=&quot;nofollow&quot;&gt;Inverting Analytic Characteristic Functions and Financial Applications&lt;/a&gt;&quot;.&lt;/p&gt;&#xA;" OwnerUserId="16993" LastEditorDisplayName="user16891" LastEditDate="2015-08-05T17:41:21.623" LastActivityDate="2015-08-05T17:41:21.623" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19191" PostTypeId="2" ParentId="19167" CreationDate="2015-08-05T15:26:16.240" Score="2" Body="&lt;p&gt;Yes, that can be really sophisticated even using such nice tools as pandas.&#xA;But the basic idea is to find position enters &amp;amp; exits to derive cashflow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my code to derive all that stuff from generated signals (in my backtester signals are fractions of 2 stocks in portfolio for each moment). I hope I've found all bugs here, but no warranties.&#xA;&lt;em&gt;Total_invested&lt;/em&gt; variable is used to calculate total number of shares in portfolio using only initial capital.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually, this code is part of my backtest engine that I'm gonna open-source in a few months. It also deals with spreads and fixed commissions, so you may skip this part. It will require adaptation to your conditions, but hope that helps!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also take a look at &lt;a href=&quot;https://www.quantstart.com/articles&quot; rel=&quot;nofollow&quot;&gt;articles by Mike Halls-Moore&lt;/a&gt;. This site helped me a lot!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def get_portfolio(self, signals, prices):&#xA;    time_index = prices.index&#xA;    end = time_index[-1]&#xA;    # Assets prices&#xA;    x_prices = prices[self.sym1]&#xA;    y_prices = prices[self.sym2]&#xA;    # Assets weights in portfolio&#xA;    x_weights = signals.map(lambda sig:sig[self.sym1])&#xA;    y_weights = signals.map(lambda sig:sig[self.sym2])&#xA;    # Total number of invested shares&#xA;    total_invested = pd.Series(index = signals.index)&#xA;    # Need trade enters to calculate portfolio size&#xA;    enter_points = x_weights.diff().fillna(0)!=0&#xA;    # Index magic here:&#xA;    # We need to delete position exits, we suppose there are separate enters/exits&#xA;    enter_points[enter_points[enter_points].index[1::2]] = False&#xA;    # capital = w₁⋅total⋅p₁ + w₂⋅total⋅p₂ (cover position)&#xA;    total_invested[enter_points] = (self.initial_capital&#xA;        /(x_weights.abs()[enter_points]*x_prices[enter_points]&#xA;        + y_weights.abs()[enter_points]*y_prices[enter_points]))&#xA;    # Zero for right initial open and final close&#xA;    total_invested.iloc[0] = 0; total_invested.iloc[-1] = 0;&#xA;    total_invested.fillna(method='ffill', inplace=True)&#xA;    # Positions rounded to lot sizes&#xA;    x_positions = (total_invested*x_weights//self.lot1*self.lot1).fillna(0)&#xA;    y_positions = (total_invested*y_weights//self.lot2*self.lot2).fillna(0)&#xA;    long_pos = x_positions.copy(); long_pos[long_pos&amp;lt;0] = 0&#xA;    short_pos = x_positions.copy(); short_pos[short_pos&amp;gt;0] = 0&#xA;    x_pos_diff = x_positions.diff().fillna(0)&#xA;    y_pos_diff = y_positions.diff().fillna(0)&#xA;&#xA;    # Tribute to the market-makers: spread&#xA;    # Binary divide because we count twice: enter &amp;amp; exit&#xA;    tribute = (abs(x_pos_diff)*self.spread1 + abs(y_pos_diff)*self.spread2)/2&#xA;    # Cashflow &amp;amp; Turnover: not the same!&#xA;    cashflow = -x_pos_diff*x_prices - y_pos_diff*y_prices&#xA;    turnover = abs(x_pos_diff)*x_prices + abs(y_pos_diff)*y_prices&#xA;    # Commission from turnover&#xA;    commission = turnover * self.commission&#xA;    commission[cashflow!=0] += self.fixed_commission&#xA;    portfolio = pd.DataFrame(index=time_index, columns=['EQ','holdings',&#xA;        'cash','cashflow','long_trades','short_trades',&#xA;        'x_positions','y_positions'])&#xA;    # Value of shares&#xA;    portfolio['holdings'] = x_positions*x_prices + y_positions*y_prices&#xA;    # Value of cash, paid commission on each transaction&#xA;    portfolio['cash'] = self.initial_capital + (cashflow&#xA;        - commission - tribute).cumsum()&#xA;    # Equity is the sum of both&#xA;    portfolio['EQ'] = portfolio['cash'] + portfolio['holdings']&#xA;    portfolio['turnover'] = turnover&#xA;&#xA;    # Time points of trades&#xA;    portfolio['long_trades'] = long_pos.diff().fillna(0)&#xA;    portfolio['short_trades'] = short_pos.diff().fillna(0)&#xA;&#xA;    portfolio['x_positions'] = x_positions&#xA;    portfolio['y_positions'] = y_positions&#xA;    return portfolio&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="15931" LastActivityDate="2015-08-05T15:26:16.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19192" PostTypeId="1" AcceptedAnswerId="19193" CreationDate="2015-08-05T15:37:22.413" Score="1" ViewCount="1043" Body="&lt;p&gt;I am trying to calculate the accrued interest for a set of Treasury Bonds. I am comparing the answer from the code below with that for the 1st Bond(row) &lt;a href=&quot;https://app.box.com/s/6i3vae7lb02n6glam7vwts7qpuc44q2w&quot; rel=&quot;nofollow&quot;&gt;over here&lt;/a&gt;. In the link the AI is &lt;code&gt;0.061&lt;/code&gt; whereas from the Python code I get &lt;code&gt;0.125&lt;/code&gt; and am therefore trying to understand where I'm going wrong. I use the formula for AI available &lt;a href=&quot;http://www.riskencyclopedia.com/articles/bond-accrued-interest/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#l contains the months to maturity &#xA;accrued_interest = 0&#xA;d_ordered = {}&#xA;l = [0]*59 # My set of Bonds (not included here) includes a 30 year to maturity Semi-Annual coupon bearing bond and hence l will have 59 periods&#xA;l[0] = 3 # I have a function (not included here) which calculates the difference in months between each of the coupon payments (and the settlement date and first coupon payment)&#xA;d_ordered[0] = l&#xA;coupon = 0.250&#xA;days_in_coupon_period = 180 #The Link contains half-yearly bonds&#xA;for i in range(0,1,1):&#xA;    months_to_maturity_array = numpy.array(d_ordered[i])&#xA;    for k in range(0,59,1):&#xA;        # Adding the AI associated with each period k&#xA;        accrued_interest = accrued_interest + ((coupon) * ((30*months_to_maturity_array[k]) /days_in_coupon_period))&#xA;    print('AI', accrued_interest)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thank You&lt;/p&gt;&#xA;" OwnerUserId="11917" LastEditorUserId="11917" LastEditDate="2015-08-05T20:13:07.157" LastActivityDate="2015-08-05T20:13:07.157" Title="Calculating Accrued Interest of Bonds" Tags="&lt;fixed-income&gt;&lt;programming&gt;&lt;bond&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19193" PostTypeId="2" ParentId="19192" CreationDate="2015-08-05T16:02:26.207" Score="1" Body="&lt;p&gt;US Treasuries follow the Actual/Actual day count convention, so you can't make the assumption that there are 180 days in a coupon period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's assume that the settlement date (T + 1 for US Treasuries) is 8/6/2015, the previous coupon date for a bond is 7/31/2015, and the next coupon date is 1/31/2016. Then the number of days in the coupon period is 184 days, and the accrual period is 4 days. The accrued interest, assuming a 5% coupon rate, must be $4/184 \times 5/2 = 0.054347826$.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2015-08-05T16:02:26.207" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19194" PostTypeId="2" ParentId="19175" CreationDate="2015-08-05T16:30:12.790" Score="0" Body="&lt;p&gt;There are three categories of variables in Fred that have been shown to have &lt;em&gt;some&lt;/em&gt; predictiveness for [longer run] stock returns:&lt;/p&gt;&#xA;&lt;p&gt;-Interest rate spreads (constructed from the following)&lt;/p&gt;&#xA;&lt;p&gt;FEDFUNDS Effective Federal Funds Rate&lt;/p&gt;&#xA;&lt;p&gt;TB3MS    3-Month Treasury Bil&lt;/p&gt;&#xA;&lt;p&gt;GS1      1-Year Treasury Rate&lt;/p&gt;&#xA;&lt;p&gt;GS5      5-Year Treasury Rate&lt;/p&gt;&#xA;&lt;p&gt;GS10     10-Year Treasury Rate&lt;/p&gt;&#xA;&lt;p&gt;-Credit spreads&lt;/p&gt;&#xA;&lt;p&gt;BAAFFM Moody's Baa Corporate Bond Minus FEDFUNDS&lt;/p&gt;&#xA;&lt;p&gt;-DivYields &amp;amp; E/P ratios&lt;/p&gt;&#xA;&lt;p&gt;S&amp;amp;P div yield S&amp;amp;P's Composite Common Stock: Dividend Yield&lt;/p&gt;&#xA;&lt;p&gt;S&amp;amp;P_PE_ratio  S&amp;amp;P's Composite Common Stock: Price-Earnings Ratio&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2015-08-05T16:30:12.790" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19195" PostTypeId="1" AcceptedAnswerId="19197" CreationDate="2015-08-05T17:35:17.457" Score="1" ViewCount="2685" Body="&lt;p&gt;When calculating the accrued Interest of Treasury Bonds, how does one set the settlement date? And, is it possible for certain bonds that there are no coupon payments before the settlement date and hence there will be no accrued interest (i.e. the case when the bond is bought before the first coupon payment and after the issue date)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although I asked a very similar question &lt;a href=&quot;https://quant.stackexchange.com/questions/19192/calculating-accrued-interest-of-bonds&quot;&gt;here&lt;/a&gt;, I am still unclear about these particular details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank You&lt;/p&gt;&#xA;" OwnerUserId="11917" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2015-08-05T19:45:40.777" Title="Understanding how to calculate Accrued Interest of Bonds" Tags="&lt;fixed-income&gt;&lt;bond&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19196" PostTypeId="1" CreationDate="2015-08-05T18:08:26.377" Score="7" ViewCount="2324" Body="&lt;p&gt;I am looking to measure the volatility from the open of the market until a trade takes place and use that volatility in post-trade regressions to help explain transaction costs. A simple regression would be $Cost_{trade} = \beta_0 + \beta_1\cdot(Volatility_{FromOpenUntilTrade})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To calculate the $Volatility_{FromOpenUntilTrade}$ I was going to use 5-minute Realized Variance (RV) which is defined as the sum of the 5-minute squared log returns. Since I am using 5 minute RV, I will not calculate an RV for any trade that takes place within the first 5 minutes. For all other trades there will be at least one 5-minute bucket and I will scale it up using the square root of time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example if a trade takes place in the 6th minute:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I take the first 5-minute RV. Suppose for example that it's $.0000129$.&lt;/li&gt;&#xA;&lt;li&gt;Then take the square root to get the volatility $.0035$.&lt;/li&gt;&#xA;&lt;li&gt;Then scale this up to get a scaled daily volatility $.0035\cdot\sqrt{\frac{78}{1}}\approx 3.1\%$ daily vol. I am using $78$ because there are $78$ 5-minute buckets in a trading day.&lt;/li&gt;&#xA;&lt;li&gt;Then scale this &quot;daily&quot; value to an annualized number: $\sqrt{252}\cdot3.1\% = 50\%$ annualized vol&lt;/li&gt;&#xA;&lt;li&gt;Then I can use this annualized volatility as a explanatory variable in the  regression above.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Similarly if a trade takes place in the last minute I would use $77$ of the $78$ 5-minute buckets to calculate the RV and the daily scaling factor would be $\sqrt{\frac{78}{77}}$.  So for each trade the &quot;daily&quot; scaling factor depends on the bucket in which the trade took place. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question is this:&lt;/strong&gt; Does calculating an annualized number only using one bucket have too much error associated with it since the sample size is small or is it acceptable to use one 5-minute bucket as the RV?  If it is not acceptable can you offer any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="16923" LastEditorUserId="6101" LastEditDate="2015-08-06T05:49:34.820" LastActivityDate="2015-08-07T01:40:53.297" Title="Calculating 6-minute, 20-minute, 45-minute, and 3-hour volatility" Tags="&lt;volatility&gt;&lt;high-frequency&gt;&lt;stochastic-volatility&gt;&lt;high-frequency-estimators&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19197" PostTypeId="2" ParentId="19195" CreationDate="2015-08-05T19:29:24.333" Score="1" Body="&lt;p&gt;Conceptually, let's say you sell a bond three months after the previous coupon date. Because you've sold the bond, you won't receive the next coupon payment, which happens in three months' time. But you deserve half of the next coupon payment, because you've held onto it for half the coupon period. That's what accrued interest is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Accrued interest, in general, is calculated as&#xA;$$\text{AI} = \text{AIF} \times \frac{c}{f}, $$&#xA;where AIF is the accrued interest fraction, and $c$ is the annual coupon rate, and $f$ is the coupon frequency. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;AIF is simply the day count fraction between the previous coupon date and the settlement date. For US Treasuries, which follows the Actual/Actual convention, it is calculated as&#xA;$$\text{AIF} = \frac{\text{settlement date} - \text{previous coupon date}}{\text{next coupon date} - \text{previous coupon date}}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As mentioned, US Treasuries follows $T+1$ settlement convention, which means the settlement date is always the next business day following the trade date. More specifically, if you bought the Treasury today, then it settles tomorrow. (An exception is made for Treasuries trading in the when-issued market, in which case the settlement date is the issue date.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Accrued interest is zero on all coupon dates. On any other date, it would be non-zero. So if a bond settlement before the first coupon date and after the first interest accrual date, it would have a non-zero AI.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. I think the preference is for you to edit your old question, and we can update the answers accordingly (the questions are so similar...).&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2015-08-05T19:45:40.777" LastActivityDate="2015-08-05T19:45:40.777" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19198" PostTypeId="2" ParentId="19185" CreationDate="2015-08-05T21:24:30.683" Score="5" Body="&lt;p&gt;The Bates model is represented by the bivariate system of stochastic differential equations&#xA;\begin{align}&#xA;&amp;amp;dS_t=(r-q)S_tdt+\sqrt{v_t}S_tdW_1(t)+S_tdN_t\\&#xA;&amp;amp;dv_t=\kappa(\theta-v_t)dt+\sigma\sqrt{v_t}dW_2(t)\\&#xA;\end{align}&#xA;where &#xA;$$\mathbb{E^Q}[dW_1(t)dW_2(t)]=\rho dt$$&#xA;and $N_t$ is a compound Poisson process with intensity $\lambda$ and independent jumps $J$ with &#xA;$$\ln{(1+J)}\tilde{~} N\left(\ln(1+\beta)-\frac{1}{2}\alpha^2\,\, ,\,\,\alpha^2\right)$$&#xA;The parameters $\beta$ and ${\alpha}$ determine the distribution of the jumps and the Poisson process is assumed to be independent of the Wiener processes.By application of delta-hedging argument,we have&#xA;$$\frac{\partial U}{\partial t}+\frac{1}{2}{{v}_{t}}{{S}_{t}}^{2}\frac{{{\partial }^{2}}U}{\partial {{S}^{2}}}+\frac{1}{2}{{\sigma }^{2}}{{v}_{t}}\frac{{{\partial }^{2}}U}{\partial {{v}^{2}}}+\rho \sigma \,{{v}_{t}}{{S}_{t}}\frac{{{\partial }^{2}}U}{\partial S \partial v}+\,(r-q-\lambda\,\bar{k}){{S}_{t}}\frac{\partial U}{\partial S}+\kappa (\theta -{{v}_{t}})\,\frac{\partial U}{\partial v}-rU+I_U=0\,\,\,(1)$$&#xA;where&#xA;$$I_U=\lambda\int_{0}^{\infty}[U(S\xi,v,t)-U(S,v,t)]\,g(\xi)\,d\xi$$&#xA;$$g(\xi)=\frac{1}{\sqrt{2\pi}\alpha\xi}e^{-\frac{1}{2\alpha^2}(\ln{\xi-m})^2}$$&#xA;$$m=\ln(1+\beta)-\frac{1}{2\alpha^2}$$&#xA;$$\bar{k}=e^{\frac{1}{2}\alpha^2+m}-1$$&#xA;It should be noted that &lt;a href=&quot;http://rfs.oxfordjournals.org/content/9/1/69.abstract&quot; rel=&quot;nofollow&quot;&gt;closed-form solutions&lt;/a&gt; for vanilla-option payoff do exist but PIDE (1) is easily approximated by Numerical Methods.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;close form solution&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I edited my Answer for emcor.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Dynamic of $S_t$ under historical measure&#xA;\begin{align}&#xA;&amp;amp;\frac{dS_t}{S_t}=(\mu-\lambda\,\bar{J})dt+\sqrt{v_t}dW_1(t)+J\,dN(t)\\&#xA;&amp;amp;\hspace{0.3cm}dv_t=\kappa(\theta-v_t)dt+\sigma\sqrt{v_t}dW_2(t),\\&#xA;\end{align} &#xA;where&#xA;$$\mathbb{E^P}[dW_1(t)dW_2(t)]=\rho dt,$$&#xA;$N_t$ is a compound Poisson process with intensity $\lambda$ and independent jumps $J$ with&#xA;$$\ln{(1+J)}\tilde{~} N\left(\ln(1+\bar{J})-\frac{1}{2}\alpha^2\,\, ,\,\,\alpha^2\right).$$&#xA;The parameters $\bar{J}$ and ${\alpha}$ determine the distribution of the jumps and the Poisson process is assumed to be independent of the Wiener processes.&lt;/li&gt;&#xA;&lt;li&gt;Change measure: $\mathbb{P\rightarrow Q}$&#xA;\begin{align}&#xA;&amp;amp;\frac{dS_t}{S_t}=(r-q-\lambda^*\,\bar{J^*})dt+\sqrt{v_t}dW_1^{\mathbb{Q}}(t)+J^*\,dN^*(t)\\&#xA;&amp;amp;\hspace{0.3cm}dv_t=\kappa^*(\theta^*-v_t)dt+\sigma\sqrt{v_t}dW_2^{\mathbb{Q}}(t),\\&#xA;\end{align} &#xA;where&#xA;$$\mathbb{E^Q}[dW_1^{\mathbb{Q}}(t)dW_2^{\mathbb{Q}}(t)]=\rho dt$$&#xA;$$\kappa^*=\kappa +\xi$$&#xA;$$\hspace{0.3cm}\theta^*=\frac{\kappa\theta}{\kappa+\xi},$$&#xA;such that $\xi$ is volatility market price and&#xA;$$J^*=J+J\,\mathbb{E^P}\left[\frac{\Delta J_w}{J_w}\right]$$&#xA;$$\bar{J}^*=\bar{J}+\frac{\mathbb{Cov}\left(J,\frac{\Delta J_w}{J_w}\right)}{1+\mathbb{E^P}\left[\frac{\Delta J_w}{J_w}\right]}.$$&#xA;Where $\frac{\Delta J_w}{J_w}$ is random percentage jump conditional on a jump occurring and $\frac{dJ_w}{J_w}$ is percentage shock in the absence of jump.&lt;/li&gt;&#xA;&lt;li&gt;Note that,when $\xi=0$ we have $\kappa^*=\kappa$  and $\theta^*=\theta$. We set $\xi=0$, because when we estimate the risk-neutral parameters to price options we do not need to estimate $\xi$. Also, when $\Delta J_w/J_w\rightarrow0$ thus we have $J^*=J$ and $\bar{J}^*=\bar{J}.$&lt;/li&gt;&#xA;&lt;li&gt;let $x_t=\ln S_t$ then&#xA;\begin{align}&#xA;C(t\,,{{S}_{t}},{{v}_{t}},J,K,T)={{S}_{t}}{{P}_{1}}-K\,{{e}^{-r\tau }}{{P}_{2}}&#xA;\end{align}&#xA;where,for $j=1,2$&#xA;\begin{align}&#xA;&amp;amp; {{P}_{j}}({{x}_{t}}\,,\,{{v}_{t}}\,;\,\,{{x}_{T}},\ln K)=\frac{1}{2}+\frac{1}{\pi }\int\limits_{0}^{\infty }{\operatorname{Re}\left( \frac{{{e}^{-i\phi \ln K}}{{f}_{j}}(\phi ;t,x,v)}{i\phi } \right)}\,d\phi  \\ &#xA;&amp;amp;\\&#xA;&amp;amp;\hspace{1.9cm}{{f}_{j}}(\phi ;{{v}_{t}},{{x}_{t}})=\exp\left[{{C}_{j}}(\tau ,\phi) +{{D}_{j}}(\tau ,\phi ){{v}_{t}}+i\phi{{x}_{t}}+{{\Xi }_{j}}\right]\\&#xA;&amp;amp;\\&#xA;&amp;amp;\hspace{3.8cm}\Xi_j={{\lambda }^{*}}\tau\,{{(1+{{\kappa }^{*}})}^{{{u}_{j}}+\frac{1}{2}}}\left[ {{(1+{{\kappa }^{*}})}^{\phi }}{{e}^{{{\alpha }^{2}}({{u}_{j}}\phi +0.5{{\phi }^{2}})}}-1 \right],\\&#xA;\end{align}&#xA;such that&#xA;\begin{align}&#xA;&amp;amp;C_j(\tau ,\phi)=(r-q-\lambda^*\bar{\kappa}^*)\phi\,\tau-\frac{\kappa^*\theta^*\,\tau}{\sigma^2}(\rho\sigma\phi-\beta_j-\gamma_j)-\frac{2\kappa^*\theta^*\,\tau}{\sigma^2}\ln\left(1+\frac{1}{2}(\rho\sigma\phi-\beta_j-\gamma_j)\frac{1-e^{\gamma_j\tau}}{\gamma_j}\right)\\&#xA;&amp;amp;\\&#xA;&amp;amp;D_j(\tau ,\phi)=\frac{-2(u_j\phi+\frac{1}{2}\phi^2)}{\rho\sigma\phi-\beta_j+\gamma_j\frac{1+e^{1-\gamma_j\tau}}{1-e^{1-\gamma_j\tau}}}\\&#xA;&amp;amp;\\&#xA;&amp;amp;\hspace{1.1cm}\gamma_j=\sqrt{(\rho\sigma\phi-\beta_j)^2-2\sigma^2(u_j\phi+0.5\phi^2)}\\&#xA;\end{align}&#xA;and&#xA;$$u_1=\frac{1}{2}\,,u_2=-\frac{1}{2}\,,\beta_1=\kappa^*-\rho\sigma\,,\beta_2=\kappa^*\,$$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerDisplayName="user16891" LastEditorDisplayName="user16891" LastEditDate="2015-08-07T00:15:53.493" LastActivityDate="2015-08-07T00:15:53.493" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19199" PostTypeId="1" CreationDate="2015-08-05T21:32:51.757" Score="0" ViewCount="287" Body="&lt;p&gt;What is known about interrelation between the currency (say EURUSD) spot prices vs. futures on the the same currencies (traded at Chicago CME) ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I mean what is typical situation - the main price changes happens on futures and then translated to spot by arbitragers or vice versa ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Especially during the news &lt;/p&gt;&#xA;" OwnerUserId="4652" LastActivityDate="2015-08-10T08:14:55.203" Title="Futures vs. spot for currencies - who is the leader" Tags="&lt;fx&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19200" PostTypeId="1" CreationDate="2015-08-06T03:48:03.467" Score="6" ViewCount="616" Body="&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/7761/how-to-compute-implied-volatility-calculation&quot;&gt;How to compute Implied Volatility Calculation?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above link shows that there multiple ways to calculate implied volatility. My question is that for most of the common data sources like Bloomberg, Fidelity, etc, how is the implied volatility calculated?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.cboe.com/micro/vix/vixwhite.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.cboe.com/micro/vix/vixwhite.pdf&lt;/a&gt; shows that for the VIX index, it &quot;estimates expected volatility by averaging the weighted prices of&#xA;SPX puts and calls over a wide range of strike prices&quot;. What does this mean mathematically? Can anyone shed more light on this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is implied vol (and for that matter historical vol) correlated with bear markets and inversely correlated with bull markets? Since historical vol is the standard deviation of historical returns, why should the sign matter? Ie. if I add a point to a dataset that is far from the mean, it will increase variance regardless of the sign.&lt;/p&gt;&#xA;" OwnerUserId="17136" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-08-13T06:29:26.110" Title="How is implied volatility derived?" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;vix&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19201" PostTypeId="2" ParentId="19200" CreationDate="2015-08-06T07:02:24.350" Score="7" Body="&lt;p&gt;For How VIX works you can read this wonderful blog :  &lt;a href=&quot;http://onlyvix.blogspot.com/2011/09/intuitive-understanding-of-vix-formula.html&quot; rel=&quot;nofollow&quot;&gt;http://onlyvix.blogspot.com/2011/09/intuitive-understanding-of-vix-formula.html&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It provide wonderful non mathematical explanation of the how  vix is actually  computed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now comes to your last answer why vix is inversely related to market movement ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In simple words, if market is more volatile then investor would expect higher return from the market.  To get the higher return, traders will continue to sell the stock until its price is consistent with the perceived risk. Lets take simple example : if current price of stock is $ 100 and investor expect price to be 110 after one year. Here expected return is 10 percent which is consistent with the perceived risk of lets say 20%. If this risk increased then investor would expect higher return from the same stock. Assume, risk increased to 25% and investor expect now 12% return. So now the fair price is 110/1.12 = 98.21. So stock is overprice and investor continue to sell it until price reaches 98.21 which is consistent with revised expected return of 12%. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reverse happen when volatility fall. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above explanation is simply based on risk return theory of stock price. I hope it would help you to understand why VIX is inversely related to market movement.    &lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="16991" LastEditDate="2015-08-13T06:29:26.110" LastActivityDate="2015-08-13T06:29:26.110" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19202" PostTypeId="2" ParentId="18742" CreationDate="2015-08-06T11:08:59.273" Score="1" Body="&lt;p&gt;To get one-month rate X from three-month rate Y, you use this formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;1 + X = (1 + Y)^(1/3)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get one-month rate X from annual (12-month) rate Y, you use this formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;1 + X = (1 + Y)^(1/12)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get three-month rate X from annual (12 month) rate Y, you use:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;1 + X = (1 + Y)^(3/12)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;0.25% is annual 3% converted to a monthly rate, i.e. (1+0.03)^(1/12) - 1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, multiplying by 1/12 or 3/12 etc. is just a linear approximation of raising numbers like 1.03 (that are close to 1) to the power of 1/12 and 3/12 respectively.&lt;/p&gt;&#xA;" OwnerUserId="17131" LastActivityDate="2015-08-06T11:08:59.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19203" PostTypeId="1" AcceptedAnswerId="19208" CreationDate="2015-08-06T11:38:54.537" Score="4" ViewCount="744" Body="&lt;p&gt;On a Bloomberg terminal, it is possible to use the HRH (Historical Return Histogram) function on individual assets. It basically generates a histogram of the (simple) returns and overlays them with a theoretical normal distribution, indicating whether the distribution of the (daily, weekly, monthly,...) returns is approximately normally distributed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With a geometric Brownian motion model, we would assume that the log return is normally distributed and the (simple) return is lognormally distributed. Hence my question: Why does it test for normality and not lognormality?&lt;/p&gt;&#xA;" OwnerUserId="17138" LastActivityDate="2015-08-06T14:43:42.470" Title="Why does Bloomberg's HRH test the simple returns for normality?" Tags="&lt;bloomberg&gt;&lt;normal-distribution&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19205" PostTypeId="2" ParentId="19181" CreationDate="2015-08-06T13:19:16.637" Score="0" Body="&lt;p&gt;There are ways to get a continuous time series from switching futures prices. These include:&#xA;1) Taking return of a leading future contract (max open interest) on every date, and 2) Taking a weighted average return among a group of leading contracts, with weights based on open interest of each contract. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;R_average = (OI1*R1 + OI2*R2)/(OI1 + OI2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;on any given date, where OI is Open Interest and R is return for contracts with top 2 OIs among the contracts traded on that date.&lt;/p&gt;&#xA;" OwnerUserId="17131" LastActivityDate="2015-08-06T13:19:16.637" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19208" PostTypeId="2" ParentId="19203" CreationDate="2015-08-06T14:21:55.307" Score="4" Body="&lt;p&gt;For small changes, the log-return  $\ln \frac{S_{t_i}}{S_{t_{i-1}}}$ is close to the simple return $\frac{S_{t_i}-S_{t_{i-1}}}{S_{t_{i-1}}}$:&#xA;\begin{align*}&#xA;\ln \frac{S_{t_i}}{S_{t_{i-1}}} &amp;amp;= \ln \Big(1+ \frac{S_{t_i}-S_{t_{i-1}}}&#xA;{S_{t_{i-1}}} \Big)\\&#xA;&amp;amp;\approx \frac{S_{t_i}-S_{t_{i-1}}}{S_{t_{i-1}}}.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note also that, assuming the SDE&#xA;\begin{align*}&#xA;\frac{dS_t}{S_t} = \mu dt + \sigma\, dW_t,&#xA;\end{align*}&#xA;then&#xA;\begin{align*}&#xA;\frac{S_{t_i}-S_{t_{i-1}}}{S_{t_{i-1}}} \approx \mu \Delta t_i + \sigma \Delta W_{t_i},&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;\ln \frac{S_{t_i}}{S_{t_{i-1}}} = \big(\mu -\frac{1}{2}\sigma^2\big) \Delta t_i + \sigma \Delta W_{t_i},&#xA;\end{align*}&#xA;where $\Delta t_i=t_i-t_{i-1}$, and $\Delta W_{t_i} = W_{t_i}-W_{t_{i-1}}$ is normal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, if the stock price is log-normally distributed, then the log-return is normally distributed, while the simple return is approximately normally distributed.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-08-06T14:43:42.470" LastActivityDate="2015-08-06T14:43:42.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19209" PostTypeId="2" ParentId="19181" CreationDate="2015-08-06T15:11:35.180" Score="1" Body="&lt;p&gt;This link has a worthwhile discussion of two possible approaches: the Nearby approach (paragraph 6.6.1) and the Constant Maturity approach (para 6.6.2). &lt;a href=&quot;http://www.value-at-risk.net/futures-prices/&quot; rel=&quot;nofollow&quot;&gt;http://www.value-at-risk.net/futures-prices/&lt;/a&gt; . With the pluses and minuses of each. Ultimately it is going to come down to your judgement of what is best in your situation.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2015-08-06T15:11:35.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19211" PostTypeId="1" CreationDate="2015-08-06T17:01:02.003" Score="1" ViewCount="56" Body="&lt;p&gt;I am just trying to calculate Spot Rates from Par yields. I find that the code below gives very similar spot rates for the data &lt;a href=&quot;http://financialexamhelp123.com/par-curve-spot-curve-and-forward-curve/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;, yet if I increase the size of the &lt;code&gt;yields&lt;/code&gt; array I end up getting NaN values from the Python code as &lt;code&gt;adding_negatives&lt;/code&gt; turns out to be greater than &lt;code&gt;face_values[index]&lt;/code&gt; making &lt;code&gt;term_1&lt;/code&gt; negative. I've basically just directly implemented the steps in the link to get the Spot Rates. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#df is a Dataframe that contains the bond information&#xA;import numpy as np&#xA;face_values = df['FACE_VALUE'].values #ALL 100 as only Par Bonds are taken&#xA;yields = (df['coupon'].values) #PAR YIELDS         &#xA;spot_rate = np.zeros((yields.shape[0]))    &#xA;&#xA;#Obtaining Spot Yields&#xA;for x, coupon in np.ndenumerate(yields):&#xA;    index = x[0]&#xA;    if index == 0:&#xA;        spot_rate[index] = (yields[index]/face_values[index]) * 100&#xA;    else:    &#xA;        adding_negatives = 0&#xA;        if index &amp;lt; spot_rate.shape[0]:&#xA;            for i in range (0, index, 1):&#xA;                adding_negatives = adding_negatives + (coupon/2)/np.power((1+(spot_rate[i]/200)),i+1)                        &#xA;            term_1 = face_values[index] - adding_negatives &#xA;            spot_rate[index] = 2*(((np.power(((((face_values[index] + ((coupon/2)))/term_1))),1/(index+1)))-1)) * 100&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If &lt;code&gt;yields&lt;/code&gt; is a Vector like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;[ 1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5&#xA;  1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5&#xA;  1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5&#xA;  1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5&#xA;  1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5&#xA;  1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5&#xA;  1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5&#xA;  1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5&#xA;  1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.5    1.75   2.&#xA;  2.     2.     2.05   2.1    2.5    2.99   4.     4.04   4.1    4.5    4.8&#xA;  4.875  4.97   5.125  5.25   5.5    5.75   5.75   5.95   5.967  6.15   6.3&#xA;  6.375]&lt;/code&gt;, some of the Spot Rates turn out to be NaN as &lt;code&gt;adding_negative&lt;/code&gt; keeps adding up and turns to be greater than 100 (&lt;code&gt;face_values[index]&lt;/code&gt;)  eventually. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please let me know if more information is required. &lt;em&gt;This code is directly usable, with the &lt;code&gt;yields&lt;/code&gt; array given above.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: In reference to Gordon's comment:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get the spot rate for the 2'nd period:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Price} = \frac{c/2}{1 + spotrate_{period 0}/200} +  \frac{facevalue + c/2}{(1 + spotrate_{period 1}/200)^2} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code basically follows the steps:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{adding_negatives} = \frac{c/2}{1 + spotrate_{period 0}/200}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{term_1} = \text{Price} - \text{adding_negatives}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$spotrate_{period 1} = 2 * ((((\text{facevalue} + (\text{coupon/2}))/\text{term_1})^{1/periodno} -1))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, with regards to the spot rates in the Link: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code gives: &lt;code&gt;[ 2.      2.4024  2.7669  3.0933  3.4021  3.6721]&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The link gives: &lt;code&gt;[ 2.      2.4024  2.7669  3.0974  3.3975  3.6701]&lt;/code&gt;, so maybe there actually is an Error here too?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank You&lt;/p&gt;&#xA;" OwnerUserId="11917" LastEditorUserId="11917" LastEditDate="2015-08-06T19:03:36.533" LastActivityDate="2015-08-06T19:03:36.533" Title="Is there a limit to the number of Spot rates than can be calculated from Par Yields" Tags="&lt;fixed-income&gt;&lt;programming&gt;&lt;bond&gt;&lt;spot-rate&gt;" AnswerCount="0" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="19212" PostTypeId="2" ParentId="11273" CreationDate="2015-08-06T17:40:09.970" Score="0" Body="&lt;p&gt;I agree with Alex C. Profit is too slippery a measure to work with. Focusing on profit raises a number of questions.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Can the reported profit be trusted? Profit as a measure is much more open to manipulation than stock price. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What year’s profits should be maximised? You can see straightaway that a good business decision may result in lower profits for the year while a bad one may actually increase profits for that year. Profit measures some selected short-term period. Stock value attempts a more comprehensive view by examining the short-term (the capitalised value of earnings if the company doesn’t invest) plus the long-term (the present value of growth opportunities if it does invest).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is the company using the cash optimally? A company may reduce dividends and invest the funds in a project that increases future years’ profits. That looks good. But the shareholder should be asking: if I had received this cash as dividends, could I have earned a return greater than the company is now earning from its new project?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Regards,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anthony&lt;/p&gt;&#xA;" OwnerUserId="17142" LastEditorUserId="17142" LastEditDate="2015-08-06T20:32:45.940" LastActivityDate="2015-08-06T20:32:45.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19213" PostTypeId="2" ParentId="19155" CreationDate="2015-08-06T18:25:13.563" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;if I short the futures, at expiry I'll lose if 3 months LIBOR goes higher than the initial forward price&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you short the future and LIBOR rate goes up you will actually make money, not lose money. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you short a Eurodollar contract you are effectively locking in that interest rate. Here's an example. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say it's December 2015 and you need to borrow 1M in March 2016. The GEH6 is currently trading at 99.27. This corresponds to an interest rate of 0.73%. This seems like a perfectly reasonable rate to you so you sell the GEH6 future. Now at expiration you are able to borrow at the current LIBOR rate, which is also where your Eurodollar future is going to settle. Let's say that the LIBOR rate at settlement was 1.1%. So rates went up quite a bit and that sucks because you need to borrow 1M dollars. However, your Eurodollar contract settled at 98.9. (100 - 1.1). That means you that you made 925 dollars on your hedge. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if you check what your interest on a 1M 3 month loan @ 1.1% vs @ 0.73% is you'll notice it's about 925. Or the exact amount you made on the hedge.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason I say that the Eurodollar future here is a proxy for a swap is because you are effectively turning a floating rate (LIBOR) into a fixed rate. The difference is that there is no exchange of cash flow throughout the life of the contract. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for arbitraging Eurodollar future, it's a bit more complicated. I'm not sure if a pure arbitrage(Cash-Carry type trade) actually exists because the rate at time T is a stochastic process. I would take a look at this paper for some arbitrage ideas anyways. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.jamesgoulding.com/Research_II/Eurodallar/Eurodollar%20(Study%20-%20Contract%20Design).pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.jamesgoulding.com/Research_II/Eurodallar/Eurodollar%20(Study%20-%20Contract%20Design).pdf&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There do of course exist arbitrage opportunities between the Eurodollar contracts, swaps, and deposits.&lt;/p&gt;&#xA;" OwnerUserId="5940" LastActivityDate="2015-08-06T18:25:13.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19214" PostTypeId="2" ParentId="19196" CreationDate="2015-08-07T01:04:40.720" Score="6" Body="&lt;p&gt;Quick summary: Your model should still be well specified, as long as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) You do the analysis on a heavily traded asset, e.g. IBM on NYSE, and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) You use heteroskedasticity-consistent standard errors in your estimation framework, e.g. White's standard errors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm going to start the long answer by re-stating the question to make sure I've got it right.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $v_{t_n}$ denote true volatility on day $t$ of a return that spans $[t_0, t_n]$, where $n$ is also stochastic, and is the time of the first trade that you make. Let $c_t$ be the cost associated with your first trade on day $t$. Then you want to estimate the model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;c_t = \alpha + \beta v_{t_n} + e_t&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where we make the usual assumptions on our residual $e_t$, e.g. $\mathbb{E} e_t | v_{t_n} = 0$, e.t.c. $c_t$ is observable (I'm assuming), but $v_{t_n}$ is obviously not observable. Thus instead you replace $v_{t_n}$ with the estimator $\hat{v}_{t_n}$ which is realised volatility, estimated using all available 5-minute returns on day $t$ from time $t_0$ to $t_n$, where these returns are constructed from looking at all transactions that are publicly available on day $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's assume (to make life easier) that $t_n$ falls on an exact multiple of $5$ minutes after $t_0$, and that similarly you are able to observe other transactions on each exact multiple of $5$ minutes in order to construct your realised vol. If the above assumptions are not satisfied, it is just a matter of scaling things by the appropriately small increments of time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can always write our estimator as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;v_{t_n} = \hat{v}_{t_n} + u_t&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;that is, true vol is equal to realised vol plus an estimation error term. Subbing the equation into your original regression gives:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;c_t = \alpha + \beta (\hat{v}_{t_n} + u_t) + e_t&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or rather:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;c_t = \alpha + \beta \hat{v}_{t_n} + \epsilon_t&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\epsilon_t = \beta u_t + e_t$. We need at least $\mathbb{E} \epsilon_t | \hat{v}_{t_n} = 0$ to estimate the model in its present form. I would be reasonably willing to make this assumption for a heavily traded asset. Roughly speaking, we are assuming that our realised vol error is centred on zero and that whether it takes a positive or negative value on any given day is not related to the magnitude of realised vol. Note that for a thinly traded asset, this assumption would be a bit dodgy, since we might expect realised vol to exhibit a larger positive bias on days when true vol is small (since the vol from microstructure noise will be larger relative to true vol). So there is our first constraint: &lt;em&gt;make sure you do the analysis on a heavily traded stock, like IBM on NYSE for example&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What other intuition can we get from the model? Well, assuming $cov(e_t, e_s) = 0, t \neq s$ seems reasonable, and similarly I can't see any reason why $cov(u_t, u_s)$ wouldn't be zero, so we can safely assume $cov(\epsilon_t, \epsilon_s) = 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, we get the the heart of your question: We would definitely expect that $\mathbb{V} u_t \neq \mathbb{V} u_s, t \neq s$, since, as you point out, some realised vols will be calculated using 1 return, and others might use 70 returns (I don't want to go into the exact relationship in too much detail as the analysis is not necessarily straightforward - standard realised vol theory uses &lt;em&gt;infill&lt;/em&gt; asymptotics, but the situation we have here is more akin to &lt;em&gt;regular&lt;/em&gt; asymptotics, and the true parameter of interest spans a different time interval on different days...).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I don't think we need to worry about that. All that matters is that we can be fairly sure that $\mathbb{V} \epsilon_t \neq \mathbb{V} \epsilon_s, t \neq s$. In other words, our regression will exhibit heteroskedasticity. So &lt;em&gt;do not use OLS&lt;/em&gt;. Instead, use heteroskedasticity consistent standard errors, e.g. &lt;a href=&quot;https://en.wikipedia.org/wiki/Heteroscedasticity-consistent_standard_errors&quot; rel=&quot;noreferrer&quot;&gt;White's standard errors&lt;/a&gt;. Any decent statistical software will provide standard routines for this. Note, you shouldn't need to worry about getting full HAC-consistent standard errors, since there is no reason to believe the residuals will exhibit autocorrelation (although maybe test for it just to be safe).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, of course your estimates of the parameters of your model will not be as good because you are using realised vol insted of true vol. There isn't really anything you can do about this except use as many observations as you can possibly get your hands on. However, your primary concern which is the statistical effects from the noise in your RV estimators has hopefully been dealt with by my analysis above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One other thing: If you start using your second, third, and fourth, e.t.c. trade from a given day, then you will need to revisit this analysis as I'm fairly sure that will introduce some non-trivial dependence into the residuals of your regression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Colin&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ps if you feel I have answered the question, please click the tick mark and consider upvoting (the up arrow).&lt;/p&gt;&#xA;" OwnerUserId="2998" LastEditorUserId="2998" LastEditDate="2015-08-07T01:40:53.297" LastActivityDate="2015-08-07T01:40:53.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19215" PostTypeId="1" CreationDate="2015-08-07T09:54:15.127" Score="1" ViewCount="367" Body="&lt;p&gt;Let $X_t= e^{\left(\mu-\sigma^2/2 \right)t+\sigma W_t}$ be a geometric Brownian motion with drift $\mu$ and volatility $\sigma$. I am trying to find an analytical solution to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}\left[ \max(a X_T + b X_S -K,0)\right],$$&#xA;where $a$, $b$ and $K$ are constants and $0&amp;lt;S&amp;lt;T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My objective is to find the critical point as from which $aX_T + bX_S$ will be greater than $K$ so that I can disregard the maximum function and evaluate the expectation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I right to say that if I had only $Y= X_T + X_S$, I could use the relation $X_T + X_S=2X_S + X_T - X_S$ to find its mean and variance and subsequently find the critical point?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to proceed in the same way for my original problem?&lt;/p&gt;&#xA;" OwnerUserId="17146" LastActivityDate="2015-08-07T21:16:37.110" Title="Linear combination of geometric Brownian motion" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;finance&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19217" PostTypeId="2" ParentId="19215" CreationDate="2015-08-07T12:26:40.507" Score="0" Body="&lt;ol&gt;&#xA;&lt;li&gt;let $X$ be a log-normal random with mean $\mu$ and variance $\sigma^2$ then $aX$  is said to have a scaled log-normal distribution with mean $a\mu$ and and variance $a^2\sigma^2$.&lt;/li&gt;&#xA;&lt;li&gt;Let $X_j$ be a independent log-normally distributed variables with mean $\mu_j$ and variance $\sigma_j^2$ and $Y=\sum_{j=1}^{n}X_j$.The distribution of $Y$ has no closed-form expression, but can be reasonably approximated by another log-normal distribution $Z$ at the right tail.  Its probability density function at the neighborhood of $0$ has been characterized and it does not resemble any log-normal distribution.A commonly used approximation due  is obtained by matching the mean and variance of another log-normal distribution:&#xA;\begin{align}&#xA;&amp;amp;\mu_Z=\ln\left(\sum_{j=1}^{n}e^{2\mu_j+\sigma_j^2/2}\right)-\frac{1}{2}\sigma^2_Z\\&#xA;&amp;amp;\sigma^2_Z=\ln\left(\frac{\sum_{j=1}^{n}{e^{2\mu_j+\sigma_j^2}}(e^{\sigma_j^2}-1)}{\left[\sum_{j=1}^{n}e^{2\mu_j+\sigma_j^2}\right]^2}+1\right)&#xA;\end{align}&lt;/li&gt;&#xA;&lt;li&gt;for more details, you can download these&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.hindawi.com/journals/ijmms/2009/630857/&quot; rel=&quot;nofollow&quot;&gt;Asymptotic Behavior of Tail Density for Sum of Correlated Log-normal Variables&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://airccj.org/CSCP/vol4/csit43105.pdf&quot; rel=&quot;nofollow&quot;&gt;Fitting The Log Skew Normal To The Sum Of Independent Log-normals Distribution.&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerDisplayName="user16891" LastEditorDisplayName="user16891" LastEditDate="2015-08-07T14:10:21.410" LastActivityDate="2015-08-07T14:10:21.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19218" PostTypeId="1" CreationDate="2015-08-07T15:35:49.673" Score="0" ViewCount="22" Body="&lt;p&gt;I'm fact checking my analysis, so there's only one possible answer in that I'm either right or way out in left field (wrong).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A friend of mine mentioned this bitcoin lending site and I looked at it to see if the returns they're promising are correct.  When I look at &lt;a href=&quot;https://www.bitbond.com/listings/1VW9TK3ZEE&quot; rel=&quot;nofollow&quot;&gt;this loan&lt;/a&gt; for this question's purpose, I see that it offers a 19.47% return (&lt;a href=&quot;http://help.bitbond.com/knowledgebase/articles/529072-how-are-interest-payments-calculated&quot; rel=&quot;nofollow&quot;&gt;this is how their interest rates are calculated&lt;/a&gt;).  What I see is that the borrower borrowed 3 BTC and paid back the 2.99998200 BTC plus 0.37685100 in interest.  That is a 12.561775% return, not 19.47%, based on my math and this is a one-year loan (they adjust when it's less than a year).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, it's possible that the user paid some early, which would have reduce his later payments, but I haven't heard back from the company when I asked them about this several weeks ago, so I wanted to fact check the math I'm doing because I'm getting a ~7% miss.  Thanks!&lt;/p&gt;&#xA;" OwnerUserId="17148" LastActivityDate="2015-08-07T15:35:49.673" Title="Overstating Interest Rates?" Tags="&lt;finance&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19219" PostTypeId="1" AcceptedAnswerId="19220" CreationDate="2015-08-07T18:36:26.067" Score="1" ViewCount="1857" Body="&lt;p&gt;Could someone please share a good starting point to learn about Multiple curves? More than exact theorems and proofs, I am mainly interested in reading about -&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;How to build multiple curves - how to bootstrap simultaneously etc&lt;/li&gt;&#xA;&lt;li&gt;For a given swap trade, how will my risk look like on these curves.&lt;/li&gt;&#xA;&lt;li&gt;How should the curves handle different combinations of collateral/netting, forward settle etc.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The closest I got by searching on forums was &lt;a href=&quot;https://quant.stackexchange.com/questions/214/paradoxes-in-quantitative-finance/217#217&quot;&gt;here&lt;/a&gt;, but I'm looking for something more specific.    &lt;/p&gt;&#xA;" OwnerUserId="7117" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2020-05-19T10:02:37.693" Title="Introduction to Multiple Curve construction" Tags="&lt;multicurve&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19220" PostTypeId="2" ParentId="19219" CreationDate="2015-08-07T19:28:47.847" Score="4" Body="&lt;p&gt;I've always enjoyed OpenGamma's white paper: &lt;a href=&quot;https://quant.opengamma.io/Multiple-Curve-Construction-OpenGamma.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;MULTIPLE CURVE CONSTRUCTION&lt;/a&gt;. It's a solid starting point from an implementation perspective.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Andersen &amp;amp; Piterbarg's &quot;Interest Rate Modeling&quot; (Volume 1) also has a good chapter on this topic that's pretty easy to follow.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="18748" LastEditDate="2020-05-19T10:02:37.693" LastActivityDate="2020-05-19T10:02:37.693" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="19222" PostTypeId="2" ParentId="19215" CreationDate="2015-08-07T21:16:37.110" Score="2" Body="&lt;p&gt;You can write &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}\left[ \max(a X_T + b X_S -K,0)\right] = \mathbb{E}\left[ \max(a X_S Y_{S,T} + b X_S -K,0)\right],$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $Y_{S,T} = X_T/X_S.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a given value of $X_S$ we can write &#xA;$$\mathbb{E}\left[ \max(a X_S Y_{S,T} + b X_S -K,0)\right] = X_S \mathbb{E}\left[ \max(a Y_{S,T} + b  -K/X_s,0)\right],$$&#xA;since $Y_{S,T}$ is log-normal this can be evaluated by a BS type formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We then integrate numerically over the value of $X_S$ with a log-normal density. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-08-07T21:16:37.110" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19223" PostTypeId="1" AcceptedAnswerId="19226" CreationDate="2015-08-07T22:09:21.253" Score="10" ViewCount="813" Body="&lt;p&gt;In a more general way: is there &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) a methodological approach to quantify the correctness of a model that produces a probability distribution for the, say, S&amp;amp;P 500 index return for the next trading day? and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) a good modeling framework for such family of distributions? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most trivial answer is: use the VIX, the log-normal model with it as standard deviation is the model that the market considers the best assumption. OK, no problem, BUT: does the market really assume the one-day return distribution log-normal? Everybody knows that, &quot;deep inside&quot;, it does not. So the VIX is not the thing we are looking for, correct? Or, there's a valid probabilistic methodology that says that log-normality and VIX is good enough as a forecast?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One clarification: I guess, we need some sort of methodology that takes the model distribution for each day, takes the realized return for each day the forecast is built for, and kind of &quot;compares&quot; one to the other. Any methodology for such kind of model validation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any helpful links or books or advice would be MUCH appreciated.&lt;/p&gt;&#xA;" OwnerUserId="17131" LastEditorUserId="17131" LastEditDate="2015-08-07T22:14:32.133" LastActivityDate="2020-09-22T21:15:36.270" Title="Is volatility for the next day forecastable? To any extent?" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;forecasting&gt;&lt;risk-models&gt;&lt;distribution&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="19226" PostTypeId="2" ParentId="19223" CreationDate="2015-08-08T06:36:51.697" Score="13" Body="&lt;p&gt;Upon close reading, this appears to be 3 (interesting) questions, not one. I'm not sure if the mods have the tools needed to split it up, so I'm just going to write down the three questions as I see them and then deal with them one by one. Note, it is simpler for me to talk about variance instead of volatility. This has no material impact on the answer.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Question 1:&lt;/strong&gt; Is the variance of the one-day ahead return forecastable?&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Question 2:&lt;/strong&gt; Is the distribution of the one-day ahead return forecastable?&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Question 3:&lt;/strong&gt; What methods are available for &lt;em&gt;ex post&lt;/em&gt; assessment of a forecasting model for variance or a forecasting model for the return distribution?&lt;/p&gt;&#xA;&lt;p&gt;My answers will use a common notation, so I begin with that:&lt;/p&gt;&#xA;&lt;p&gt;Let &lt;span class=&quot;math-container&quot;&gt;$p_{n,t}$&lt;/span&gt; denote the &lt;span class=&quot;math-container&quot;&gt;$n^{th}$&lt;/span&gt; transaction on the &lt;span class=&quot;math-container&quot;&gt;$t^{th}$&lt;/span&gt; day on some risky asset in a financial market. For simplicity let us assume the market is open all 24 hours of the day, e.g. the FX market. I'm only making this assumption so I can skip dealing with pesky institutional details when talking about high frequency data. Let &lt;span class=&quot;math-container&quot;&gt;$N+1$&lt;/span&gt; denote the number of transactions each day, and, again for simplicity, assume one of those transactions occurs at the exact roll-over time from one day to the next. The sequence of intraday  continuously compounding returns on day &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt; can thus be defined &lt;span class=&quot;math-container&quot;&gt;$r_{n,t} = \log(p_{n,t}) -\log(p_{n-1, t})$&lt;/span&gt;. By construction, the daily return is thus:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;\begin{equation}&#xA;r_t = \log(p_{N,t}) - \log(p_{0,t}) = \sum_{n=1}^N r_{n,t}&#xA;\end{equation}&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Okay, here we go.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Answer 1:&lt;/strong&gt; Assume we're at time &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt;. Then the variance of the one-day ahead return is &lt;span class=&quot;math-container&quot;&gt;$\mathbb{V} r_{t+1}$&lt;/span&gt;. This is an &lt;em&gt;unconditional&lt;/em&gt; variance. Before we do anything else, let's ask a very simple question: Does this quantity exist? The unconditional distribution of daily financial returns are known to be heavily fat-tailed, and this has led several authors to attempt to test for the existence of the &lt;em&gt;unconditional&lt;/em&gt; second moment of daily returns. In general, this is a hard thing to test for (in a rigorous statistical framework), so rather than point you toward hefty academic literature, have a look at some of the more heuristic evidence presented by authors like Nassim Taleb or Benoit Mandelbrot.&lt;/p&gt;&#xA;&lt;p&gt;However, based on your question, I suspect that you are more interested in a &lt;em&gt;conditional&lt;/em&gt; distribution of daily returns. Probably the most well-known literature dealing with this question is the ARCH/GARCH strand which was partially responsible for netting the original author (Rob Engle) a Nobel prize (well, the Nobel-equivalent presented by the Royal Swedish Academy of Sciences).&lt;/p&gt;&#xA;&lt;p&gt;This strand of the literature proposed a set of models for volatility at time &lt;span class=&quot;math-container&quot;&gt;$t+1$&lt;/span&gt; based on time &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt; information. The most famous is probably the GARCH model: &lt;span class=&quot;math-container&quot;&gt;$\sigma_{t+1}^2 = \omega + \alpha \epsilon_t^2 + \beta \sigma_t^2$&lt;/span&gt;, where &lt;span class=&quot;math-container&quot;&gt;$\epsilon_t$&lt;/span&gt; is the source of randomness, sometimes set equal to &lt;span class=&quot;math-container&quot;&gt;$r_t$&lt;/span&gt;. Does this model have any predictive ability?&lt;/p&gt;&#xA;&lt;p&gt;There were quite a few papers in the 1990's that suggested, via the methodology of Mincer-Zarnowitz regressions (Mincer, Zarnowitz (1969) &amp;quot;The Evaluation of Economic Forecasts&amp;quot;), that it has almost &lt;em&gt;no predictive ability&lt;/em&gt;. These regressions involve regressing the forecast on the quantity that you are attempting to forecast. Of course, the quantity that we are attempting to forecast here is &lt;em&gt;unobservable&lt;/em&gt;. So the authors used squared daily returns as a proxy. This proved to be a poor choice, because although it is unbiased for true variance, it is also a very &lt;em&gt;noisy&lt;/em&gt; proxy. In the classic paper, Andersen, Bollerslev (1998) &amp;quot;Answering the Skeptics: Yes, Standard Volatility Models do Provide Accurate Forecasts&amp;quot;, it was shown that the poor forecast evaluation results of the early 90's were purely a result of the noise in the proxy. Andersen and Bollerslev used a more accurate proxy, the &amp;quot;realised variance&amp;quot; which was first proposed in Merton (1980) &amp;quot;On Estimating the Expected Return Of the Market&amp;quot; (in an appendix). The realised variance is just the sum of squared intraday returns, i.e.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;\begin{equation}&#xA;RV_t = \sum_{n}^N r_{n,t}^2&#xA;\end{equation}&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;and under ideal modelling assumptions, it can be shown that &lt;span class=&quot;math-container&quot;&gt;$RV_t$&lt;/span&gt; converges to a quantity known as quadratic variation, which, for the purposes of answering this question we will pretend is equal to &lt;span class=&quot;math-container&quot;&gt;$\mathbb{V} r_t | \sigma_t = \sigma_t^2$&lt;/span&gt; (a deeper discussion of this is fraught with pit-falls and low-level assumptions and is not suitable for answering this question). Thus, Andersen and Bollerslev simply used a proxy that had a lot less noise in it. They were able to show that, in fact, the conditional volatility models actually have a quite good predictive ability for daily variance.&lt;/p&gt;&#xA;&lt;p&gt;More recently, other classes of variance forecasting models have been proposed, e.g. stochastic volatility models, or, perhaps the most interesting, forecasting models that use estimators like realised variance as inputs. These models have been shown to have predictive ability that is at least as good as (and possibly much better than) the conditional volatility models.&lt;/p&gt;&#xA;&lt;p&gt;The other candidate is, as you mention, the VIX. I have mixed feelings about this. First, it is fairly well-known in the literature (can't remember the reference off the top of my head) that there are periods where the VIX will be a significantly biased forecast of true volatility (that is, &lt;em&gt;ex post&lt;/em&gt;, one can show periods of several months where VIX forecasts were consistently too large or too small). On the other hand, there are solid theoretical reasons for using VIX, although they are all based on modelling the price process as a continuous-time semi-martingale... I am approaching another discussion here fraught with dangers and pitfalls, so best to leave it at that. Certainly I would expect the VIX to massively outperform a monkey throwing darts at a dartboard.&lt;/p&gt;&#xA;&lt;p&gt;So in conclusion, there are lots of methods for forecasting variance, and ample evidence that they work quite well. I'll talk a little bit more about the specific methodologies of forecast evaluation in answer 3.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Answer 2:&lt;/strong&gt; Under certain modelling the assumptions, the answer to this question is identical to the answer for the previous question. Specifically, if:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;\begin{equation}&#xA;r_t | \sigma_t \backsim \mathcal{N}(0, \sigma_t^2)&#xA;\end{equation}&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;then a forecast model for variance is equivalent to a forecast model for the distribution.&lt;/p&gt;&#xA;&lt;p&gt;So what evidence do we have to support the above model for the &lt;em&gt;conditional&lt;/em&gt; distribution of daily returns?&lt;/p&gt;&#xA;&lt;p&gt;If we knew &lt;span class=&quot;math-container&quot;&gt;$\sigma_t^2$&lt;/span&gt; &lt;em&gt;ex post&lt;/em&gt;, then such a model would be trivial to test for. Simply apply a Kolmogorov-Smirnov test to the sequence &lt;span class=&quot;math-container&quot;&gt;$r_t / \sigma_t$&lt;/span&gt; with null of the sequence being generated by a standard Normal distribution. Unfortunately, as mentioned, &lt;span class=&quot;math-container&quot;&gt;$\sigma_t$&lt;/span&gt; is unobservable. However, as mentioned previously in this answer, we do know that &lt;span class=&quot;math-container&quot;&gt;$RV_t \rightarrow \sigma_t^2$&lt;/span&gt; under certain modelling assumptions. So in Andersen, Bollerslev, Diebold, and Ebens (2001) &amp;quot;The Distribution of Realized Stock Return Volatility&amp;quot;, the authors examine the sequence &lt;span class=&quot;math-container&quot;&gt;$r_t / \sqrt{RV_t}$&lt;/span&gt; and find that it is very close to a standard Normal (see Figure 1 of that paper). The slight deviation from the standard Normal that is observed could easily be due to the noise present in &lt;span class=&quot;math-container&quot;&gt;$RV_t$&lt;/span&gt; as a proxy for true variance, and so the evidence quite strongly supports the suggestion that &lt;span class=&quot;math-container&quot;&gt;$r_t | \sigma_t \backsim \mathcal{N}(0, \sigma_t^2)$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Of course the assumption that &lt;span class=&quot;math-container&quot;&gt;$\mathbb{E} r_t = 0$&lt;/span&gt; is clearly false, however, over horizons as short as one day, the expected value of &lt;span class=&quot;math-container&quot;&gt;$r_t$&lt;/span&gt; is often assumed to be small enough relative to the (conditional) variance of &lt;span class=&quot;math-container&quot;&gt;$r_t$&lt;/span&gt; that assuming &lt;span class=&quot;math-container&quot;&gt;$\mathbb{E} r_t = 0$&lt;/span&gt; is relatively harmless (and infinitely preferable to substituting in a very noisy estimator for &lt;span class=&quot;math-container&quot;&gt;$\mathbb{E} r_t$&lt;/span&gt;). In practice, this is not much use to many practitioners, who are &lt;em&gt;very&lt;/em&gt; interested in days in which the conditional mean of &lt;span class=&quot;math-container&quot;&gt;$r_t$&lt;/span&gt; is not zero. For now (and possibly forever) this is an open issue in financial economics and financial econometrics.&lt;/p&gt;&#xA;&lt;p&gt;So what about non-normal distributions &lt;span class=&quot;math-container&quot;&gt;$r_t$&lt;/span&gt;? We have already discussed that the unconditional distribution is clearly fat-tailed, and possibly does not even have finite variance. Regarding other modelling assumptions, there has been plenty of literature, e.g. autoregressive models for distribution functions e.t.c., but it is all fairly heavy-going and probably not what you're really after here.&lt;/p&gt;&#xA;&lt;p&gt;The only exception to the above is the forecasting of a specific parameter of the distribution, namely, the quantile. This has received a lot of attention due to the widespread use of Value-at-Risk. Off the top of my head, forecasting models for quantiles that do not make any assumption of Normality include those based on Extreme Value Theory, and the CAViaR class of models first proposed in Engle, Manganelli (2004) &amp;quot;CAViaR: Conditional Autoregressive Value-at-Risk by Regression Quantiles&amp;quot;.&lt;/p&gt;&#xA;&lt;p&gt;So in summary, yes, the &lt;em&gt;conditional&lt;/em&gt; probability distribution of &lt;span class=&quot;math-container&quot;&gt;$r_{t+1}$&lt;/span&gt; can be predicted with some accuracy if one is willing to assume that &lt;span class=&quot;math-container&quot;&gt;$r_t | \sigma_t \backsim \mathcal{N}(0, \sigma_t^2)$&lt;/span&gt;. This predictive accuracy comes from the predictive accuracy discussed in answer 1 above.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Answer 3:&lt;/strong&gt; We can split this answer into two parts: 1) methods for evaluating forecast procedures for daily variance, and 2) methods for evaluating forecast procedures for the distribution of a daily return.&lt;/p&gt;&#xA;&lt;p&gt;There are a couple of ways one can evaluate forecast models for daily variance. The most popular in the extant literature is via loss-based methods, e.g. Diebold, Mariano (1995) &amp;quot;Comparing Predictive Accuracy&amp;quot;, West (1996) &amp;quot;Asymptotic Inference About Predictive Ability&amp;quot;, White (2000) &amp;quot;A Reality Check For Data Snooping&amp;quot;, Hansen (2005) &amp;quot;A Test for Superior Predictive Ability&amp;quot; or Hansen, Lunde and Nason &amp;quot;The Model Confidence Set&amp;quot;. All these methods, one way or another, are simply evaluating the distance (for some suitably chosen metric) between the forecast, and the thing we are attempting to forecast. Of course, the forecast target is &lt;em&gt;unobservable&lt;/em&gt;, so we use the same trick mentioned above of substituting in a proxy. There are some surprising tricks lurking here for the unwary, see e.g. Patton (2011) &amp;quot;Volatility Forecast Comparison Using Imperfect Volatility Proxies&amp;quot;. In summary, if your proxy is a fairly good one, e.g. Realised Variance for a highly-traded asset, then you can use whatever loss function you want, but if you use a noisier proxy, e.g. squared daily returns, you'll need to restrict your analysis to a class of &amp;quot;robust&amp;quot; loss functions.&lt;/p&gt;&#xA;&lt;p&gt;Next up is methods for evaluating forecasts of probability distributions. This hasn't received as much attention in the literature. Why? Well, A large part of financial economics is based on the continuous-time semi-martingale model. In particular, the following specific assumption is often made:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;\begin{equation}&#xA;dp_t = \mu_t dt + \sigma_t dW_t&#xA;\end{equation}&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;where &lt;span class=&quot;math-container&quot;&gt;$\mu_t$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$\sigma_t$&lt;/span&gt; obey some set of boundedness conditions, and &lt;span class=&quot;math-container&quot;&gt;$W_t$&lt;/span&gt; is a Wiener process. It is readily apparent that this model is going to suggest that daily returns should be modelled as conditionally Normal (conditioning on &lt;span class=&quot;math-container&quot;&gt;$\mu_t$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$\sigma_t$&lt;/span&gt;). So other distributional assumptions simply don't arise that much.&lt;/p&gt;&#xA;&lt;p&gt;Don't get me wrong, I am not particularly enamoured of this assumption (or even the above model). Nonetheless, that is the current state of affairs.&lt;/p&gt;&#xA;&lt;p&gt;To conclude this answer, you mentioned in the question some sort of ad hoc procedure for looking at &lt;em&gt;ex post&lt;/em&gt; daily returns and seeing if they fit some sore of distributional forecast model. Such a procedure could probably be made to work for the &lt;em&gt;unconditional&lt;/em&gt; distribution without too much additional work, but for the &lt;em&gt;conditional&lt;/em&gt; distribution it is a bit more difficult. As in answer 2, some work has been done in this area for one specific aspect of the conditional distribution, namely, the quantile. You might be interested in having a look at either Christoffersen (1998) &amp;quot;Evaluating Interval Forecasts&amp;quot; or the Dynamic Quantile (DQ) test in Engle, Manganelli (2004) &amp;quot;CAViaR: Conditional Autoregressive Value-at-Risk by Regression Quantiles&amp;quot;. Both tests look at &lt;em&gt;ex post&lt;/em&gt; daily returns and analyse the number of VaR violations relative to those predicted by the VaR forecasting model.&lt;/p&gt;&#xA;&lt;p&gt;If you wanted to compare &lt;em&gt;ex post&lt;/em&gt; returns to forecasts of the entire conditional distribution, I think you would need a &lt;em&gt;lot&lt;/em&gt; of daily returns to do this with any accuracy. I can definitely think of a way to do it using intraday data, but that is quite a long story and this is already quite a long answer.&lt;/p&gt;&#xA;&lt;p&gt;Cheers all, I hope the readers who made it to this point don't feel like they've wasted their time.&lt;/p&gt;&#xA;&lt;p&gt;Colin&lt;/p&gt;&#xA;" OwnerUserId="2998" LastEditorUserId="6686" LastEditDate="2020-09-22T21:15:36.270" LastActivityDate="2020-09-22T21:15:36.270" CommentCount="12" ContentLicense="CC BY-SA 4.0" />
  <row Id="19228" PostTypeId="2" ParentId="18788" CreationDate="2015-08-08T15:51:22.067" Score="1" Body="&lt;p&gt;Actually, the probabilities in the first case will not sum to exactly 1, since you are truncating the distribution (S' is unbounded above), but will be arbitrarily close.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get the 'right' cumulative probability, you have to adjust for the step size; so, in the first case, you were assigning a weight of 1. In the second case, using a weight of 0.1 will yield a cumulative probability arbitrarily close to 1, given the truncation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively (as pointed out by volcompt), since this formula assumes a log-normal distribution, it seems much simpler to use the difference between the CDF on the returns: $P(S' \leq 106) - P(S' \lt 105)$. &lt;/p&gt;&#xA;" OwnerUserId="15336" LastActivityDate="2015-08-08T15:51:22.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19229" PostTypeId="1" AcceptedAnswerId="19281" CreationDate="2015-08-08T16:24:00.197" Score="10" ViewCount="4390" Body="&lt;p&gt;I am trying to calculate the turnover for a portfolio strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First I generate some random data and assign it dates:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;data &amp;lt;- replicate(6,rnorm(1000))&#xA;data &amp;lt;- as.data.frame(data)    &#xA;dates&amp;lt;-seq(as.Date(&quot;1932/09/01&quot;), as.Date(&quot;2015/12/01&quot;), by = &quot;1 month&quot;,tzone=&quot;GMT&quot;)-1&#xA;    rownames(data)&amp;lt;-dates&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I convert it to xts format:    &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(xts)&#xA;data&amp;lt;-as.xts(data,dateFormat=&quot;Date&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I use the Return.portfolio() function to calculate the rebalanced weights assuming an equal weighted strategy:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(PerformanceAnalytics)&#xA;results &amp;lt;- Return.portfolio(data,rebalance_on=&quot;months&quot;,geometric=F,verbose=T)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In order to calculate the turnover I'm assuming that I need the beginning of period weights and end of period weight.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I extract these from the results:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bop &amp;lt;- results$BOP.Weight #beginning of period weights&#xA;&#xA;eop &amp;lt;- results$EOP.Weight #end of period weights&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then to calculate the turnover I substract &lt;code&gt;bop&lt;/code&gt; from &lt;code&gt;eop&lt;/code&gt; and take the absolute value:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;f&amp;lt;-abs(bop-eop)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Finally, to calculate the turnover I use the following formula:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; sum(f)*(1/(nrow(data)-1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I test this on real-data (where I know what the turnover should be) I get huge, unrealistic numbers with this method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My definition of turnover comes from: Demiguel et al Constraining Portfolio Norms &lt;a href=&quot;http://faculty.london.edu/avmiguel/DeMiguelGarlappiNogalesUppalMS.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://faculty.london.edu/avmiguel/DeMiguelGarlappiNogalesUppalMS.pdf&lt;/a&gt; page 806&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The definition is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/rHD5I.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/rHD5I.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17153" LastEditorUserId="17153" LastEditDate="2015-08-11T19:06:10.187" LastActivityDate="2020-06-29T21:26:35.170" Title="Calculate turnover for portfolio" Tags="&lt;portfolio-management&gt;&lt;r&gt;" AnswerCount="2" CommentCount="10" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19232" PostTypeId="1" AcceptedAnswerId="19234" CreationDate="2015-08-09T07:42:16.617" Score="1" ViewCount="413" Body="&lt;p&gt;I am new to R and I have found this simple backtesting code and can you explain me what is happening here.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quantmod)&#xA;library(PerformanceAnalytics)&#xA;&#xA;s &amp;lt;- get(getSymbols('SPY'))[&quot;2012::&quot;]&#xA;s$sma20 &amp;lt;- SMA(Cl(s) , 20)&#xA;s$position &amp;lt;- ifelse(Cl(s) &amp;gt; s$sma20 , 1 , -1)&#xA;myReturn &amp;lt;- lag(s$position) * dailyReturn(s)&#xA;charts.PerformanceSummary(cbind(dailyReturn(s),myReturn))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/B1h7E.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/B1h7E.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know the code uses this strategy&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    Buy    &#xA;    close &amp;gt; SMA20&#xA;    sell&#xA;    close &amp;lt; SMA20&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I have doubts especially in these lines&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;s$position &amp;lt;- ifelse(Cl(s) &amp;gt; s$sma20 , 1 , -1) &#xA;myReturn &amp;lt;- lag(s$position) * dailyReturn(s)&#xA;charts.PerformanceSummary(cbind(dailyReturn(s),myReturn))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;s$position &amp;lt;- ifelse(Cl(s) &amp;gt; s$sma20 , 1 , -1)&lt;/code&gt; if close price is greater than 20 days moving average then &lt;code&gt;s$postion=1&lt;/code&gt; else &lt;code&gt;s$postion=-1&lt;/code&gt;, Buy why assign 1 and -1? why calculating dailyreturns and whats is happing with myReturn,cbind()? Also can you explain this results &lt;a href=&quot;https://i.stack.imgur.com/B1h7E.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://i.stack.imgur.com/B1h7E.png&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16754" LastEditorUserId="16754" LastEditDate="2015-08-09T07:49:29.797" LastActivityDate="2015-08-09T12:18:55.267" Title="What is the logic behind this backtesting code in R" Tags="&lt;r&gt;&lt;quant-trading-strategies&gt;&lt;returns&gt;&lt;backtesting&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19233" PostTypeId="2" ParentId="15969" CreationDate="2015-08-09T09:04:43.710" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;Purpose:&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;CIR process maximum likelihood estimation.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Input&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Model.Data       = Time series of interest rates observations.&lt;/li&gt;&#xA;&lt;li&gt;Model.TimeStep  = Delta t; recommended: 1/250 for daily data and 1/12 for monthly data.&lt;/li&gt;&#xA;&lt;li&gt;Model.Disp       = 'y'  |  'n',  (default: 'n').&lt;/li&gt;&#xA;&lt;li&gt;Model.Method     =  'ncx2pdf'   |   'besseli'  (default: 'besseli').&lt;/li&gt;&#xA;&lt;li&gt;Model.MatlabDisp = 'off' | 'iter' | 'notify' |' final' (default: 'off').&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Output:&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Results.Params   = Estimated parameters (kappa, theta, sigma).&lt;/li&gt;&#xA;&lt;li&gt;Results.Fval     = Objective function value.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function Results = CIRestimation(Model)&#xA;Nobs = length(Model.Data);&#xA;r = Model.Data(1:end-1);&#xA;dr = diff(Model.Data);           &#xA;dr = dr./r.^0.5;&#xA;regressors = [Model.TimeStep./r.^0.5, Model.TimeStep*r.^0.5];&#xA;drift = regressors\dr;&#xA;res = regressors*drift - dr;&#xA;alpha = -drift(2);&#xA;theta = -drift(1)/drift(2);&#xA;sigma = sqrt(var(res, 1)/Model.TimeStep);&#xA;InitialParams = [kappa theta sigma];&#xA;if ~isfield(Model, 'Disp'), Model.Disp = 'y'; &#xA;end;&#xA;if strcmp(Model.Disp, 'y')&#xA;    fprintf('\n initial kappa=...%+3.6f\n initial theta=...%+3.6f\n initial sigma = %+3.6f\n',kappa, theta, sigma);&#xA;end&#xA;if ~isfield(Model, 'MatlabDisp'), Model.MatlabDisp = 'off';&#xA;end;&#xA;options = optimset('LargeScale', 'off', 'MaxIter', 300, 'MaxFunEvals',300, 'Display', Model.MatlabDisp, 'TolFun', 1e-4, 'TolX', 1e-4, 'TolCon', 1e-4); &#xA;if ~isfield(Model, 'Method'), Model.Method = 'besseli'; &#xA;end;&#xA;if strcmp(Model.Method, 'ncx2pdf')&#xA;    [Params, Fval, Exitflag] =  fminsearch(@(Params) CIRobjective2(Params, Model),InitialParams, options);   &#xA;else&#xA;    [Params, Fval, Exitflag] =  fminsearch(@(Params) CIRobjective1(Params, Model),InitialParams, options);   &#xA;end   &#xA;Results.Params = Params;&#xA;Results.Fval = -Fval/Nobs;&#xA;Results.Exitflag = Exitflag;&#xA;&#xA;if strcmp(Model.Disp, 'y')&#xA;    fprintf('\n kappa = %+3.6f\n theta    = %+3.6f\n sigma = %+3.6f\n',...&#xA;        Params(1), Params(2), Params(3));&#xA;    fprintf(' log-likelihood = %+3.6f\n', -Fval/Nobs);&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;end&lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastActivityDate="2015-08-09T09:04:43.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19234" PostTypeId="2" ParentId="19232" CreationDate="2015-08-09T12:18:55.267" Score="2" Body="&lt;p&gt;When position = 1, then you are long the S&amp;amp;P ETF. When position is -1, your portfolio consist of a short position of -1 S&amp;amp;P ETF. &#xA;You will therefore have a vector like $Pos = (1,1,1,1,1,-1,-1,-1,-1,1,1,1,-1,-1,-1, \ldots)$, that will give you the evolution of your portfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your returns are then the daily returns on the S&amp;amp;P multiplied by your position. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cbind is the command for binding two vector together by their columns. So you take the evolution of the S&amp;amp;P (dailyReturns) and column-bind them with the evolution of your portfolio (myReturn), and plot them using the PerformanceAnalytics package. &lt;/p&gt;&#xA;" OwnerUserId="13808" LastActivityDate="2015-08-09T12:18:55.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19235" PostTypeId="1" CreationDate="2015-08-09T12:20:02.547" Score="3" ViewCount="212" Body="&lt;p&gt;I'm interested in the topic of VIX futures being overpriced, so I'm looking for different models to find evidence for it. &lt;a href=&quot;https://www.google.de/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0CCIQFjAAahUKEwjovve47JvHAhWCjywKHYkoDlY&amp;amp;url=http%3A%2F%2Fwww.uvic.ca%2Fsocialsciences%2Feconomics%2Fassets%2Fdocs%2Fseminars%2FAsensio.pdf&amp;amp;ei=0DLHVeiWHoKfsgGJ0biwBQ&amp;amp;usg=AFQjCNFnXSNup-gj13qWcnoC1nWOOp9smw&quot; rel=&quot;nofollow&quot;&gt;Asensio 2013&lt;/a&gt; uses a regression to evaluate the forecast biasness of the VIX term structure. &#xA;$$&#xA;\left(\frac{1}{k}\right)\sum_{i=1}^{k-1}\left[(\sigma^{VIX}_{i,i\rightarrow i+j})^2-(\sigma^{VIX}_{0,0\rightarrow j})^2\right] = \alpha_0 + \beta_0 \left[(\sigma^{VIX}_{0,0\rightarrow k+j})^2-(\sigma^{VIX}_{0,0\rightarrow j})^2\right] + \sum_{i=1}^{k-1}u_i\,.&#xA;$$&#xA;That's equation (14) in the paper, such that&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$u_i$  represent the expectational errors.&lt;/li&gt;&#xA;&lt;li&gt;$j$ represents the future date.&lt;/li&gt;&#xA;&lt;li&gt;$k$ represents the number of periods.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Now I am asking myself, due to confusion of these indices, which values should I plug into this equation, when I want to apply this to the VIX and VIX futures. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would be very thankful if someone could explain this to me!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: &#xA;First, thanks to Farahvartish for correcting my first version.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, Asensio uses in a previous step (equation 13) Campa and Chang's (1995) risk neutral formula to test expectations hypothesis:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ &#xA;\sigma^2_{0,km} = (\frac{1}{k})E_0[\sum_{i=0}^{k-1}\sigma^2_{im,(i+1)m}](\frac{\theta_{km}}{\theta_m})&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$\theta$  represents the concavity adjustment for a given tenor (assumed to be 1).&lt;/li&gt;&#xA;&lt;li&gt;$m$ represents the number of months until expiration.&lt;/li&gt;&#xA;&lt;li&gt;$k$ represents the number of periods.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Originally this formula is applied to options. I don't know how to use it for VIX futures and how to imply it to the formula of forecast biasness. Is it that:&#xA;$$\sigma^2_{0,km} = (\sigma^{VIX}_{0,0\rightarrow j})^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Again, thanks for your help!&lt;/p&gt;&#xA;" OwnerUserId="17156" LastEditorUserId="17156" LastEditDate="2015-08-10T20:28:04.577" LastActivityDate="2015-08-10T20:28:04.577" Title="Forecast biasness of VIX term structure" Tags="&lt;vix&gt;&lt;term-structure&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19236" PostTypeId="2" ParentId="15355" CreationDate="2015-08-09T17:07:09.313" Score="0" Body="&lt;p&gt;For simplicity,we let&#xA;\begin{align}&#xA;&amp;amp;\delta=\frac{T_n-T_0}{n}\\&#xA;&amp;amp;T_i=T_0+i\delta,&#xA;\end{align}&#xA;for $i=1,2,...,n$ we have&#xA;$$c_i=r\,\delta\,K.$$&#xA;The price, $p(t)$ at a time $t &amp;lt; T_1$, of the coupon bond is given by&#xA;$$p(t)=KP(t,T_{n})+\sum_{i=1}^{n}c_i P(t,T_{i}),$$&#xA;we know the price of the bond, at $T_0$, equals its face value,thus we have&#xA;$$p(T_0)=K=KP(T_0,T_{n})+r\,\delta\,K\sum_{i=1}^{n} P(T_0,T_{i}),$$&#xA;then&#xA;$$r=\frac{1-P(T_0,T_{n})}{\delta\sum_{i=1}^{n} P(T_0,T_{i})}.$$&#xA;For more details, you can see &lt;a href=&quot;https://quant.stackexchange.com/questions/15356&quot;&gt;this link&lt;/a&gt;  &lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastEditorUserId="-1" LastEditorDisplayName="user16891" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-08-09T17:30:23.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19237" PostTypeId="1" CreationDate="2015-08-09T19:12:42.207" Score="0" ViewCount="1368" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/JIzFy.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/JIzFy.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I failed to see the mathematics truism. Can someone care to elaborate.&lt;/p&gt;&#xA;" OwnerUserId="17158" LastActivityDate="2015-08-09T19:41:02.363" Title="Multiplying by the Square Root of Twelve to calculate annual standard deviation" Tags="&lt;standard-deviation&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19238" PostTypeId="1" AcceptedAnswerId="19264" CreationDate="2015-08-09T19:14:42.987" Score="6" ViewCount="2135" Body="&lt;p&gt;To execute large orders under minimum price impact or to hide a market view, trading systems sometimes utilize special order execution algorithms or order types.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One example is an iceberg order, which only shows a small piece of the existing order.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What other order execution strategies or order types exist?&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="743" LastEditDate="2015-08-11T17:51:08.800" LastActivityDate="2015-08-11T17:51:08.800" Title="Order Execution Algorithms" Tags="&lt;automated-trading&gt;&lt;limit-order-book&gt;&lt;order-execution&gt;&lt;order&gt;&lt;orderbook&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19239" PostTypeId="2" ParentId="19237" CreationDate="2015-08-09T19:41:02.363" Score="4" Body="&lt;p&gt;If $$ X_1, X_2, \dots, X_{12} $$ are i.i.d. (stochastic independent identical distributed) it holds $$ var(\sum X_i) = \sum var(X_i) = \sum var(X_1) = 12var(X_1) $$. now take the square root to get the stated result.&lt;/p&gt;&#xA;" OwnerUserId="6640" LastActivityDate="2015-08-09T19:41:02.363" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19240" PostTypeId="2" ParentId="18810" CreationDate="2015-08-10T01:29:38.547" Score="1" Body="&lt;p&gt;The Markowitz model for portfolio optimization (&lt;a href=&quot;http://www.princeton.edu/~rvdb/542/lectures/lec17.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.princeton.edu/~rvdb/542/lectures/lec17.pdf&lt;/a&gt;) is formulated as a quadratic programming (QP) problem, not an LP one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You cannot use an LP solver to solve a QP problem.&lt;/p&gt;&#xA;" OwnerUserId="3188" LastEditorUserId="3188" LastEditDate="2015-08-10T17:10:34.210" LastActivityDate="2015-08-10T17:10:34.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19241" PostTypeId="1" CreationDate="2015-08-10T05:11:38.507" Score="1" ViewCount="81" Body="&lt;p&gt;Can someone point into the right direction for NZX market depth data specifically for individuals?&#xA;I have tried many vendors but seem to be coming up with &quot;institution-only&quot; responses. &lt;/p&gt;&#xA;" OwnerUserId="17161" LastActivityDate="2015-08-10T05:11:38.507" Title="NZX market depth data" Tags="&lt;market-data&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19242" PostTypeId="2" ParentId="18215" CreationDate="2015-08-10T06:03:40.433" Score="7" Body="&lt;p&gt;Thomson Reuters Tick History. Reasons you might want to use it:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) It has just about everything you could possibly imagine, going back a &lt;em&gt;long&lt;/em&gt; way, and more. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) The API is (mostly) straightforward to use, so you can download tons of stuff without mucking around in Excel or spreadsheets of any kind.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) The data can arrive pre-cleaned. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, it is very &lt;em&gt;not&lt;/em&gt; free unless you're an academic, and even then you'll need to persuade your university to purchase a subscription (most of the bigger universities in USA, Europe, and Australia do have a subscription in my experience).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For pure academic work, I also think the T&amp;amp;Q (Trade and Quotations) database has what you are after. It is available through WRDS (Wharton Research Data Services). Again, very &lt;em&gt;not&lt;/em&gt; free unless your uni pays for it for you. This database in particular is looked on very favourably by academic journals as there exists a full-time academic position at the NYSE simply to maintain this database and make sure it is fit for use in a research environment.&lt;/p&gt;&#xA;" OwnerUserId="2998" LastActivityDate="2015-08-10T06:03:40.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19243" PostTypeId="2" ParentId="19199" CreationDate="2015-08-10T08:07:10.460" Score="1" Body="&lt;p&gt;EBS and Reuters are major FX spot price discovery sources, but CME futures can be used as a spot price discovery source as well, as well as smaller venues and exchanges. They are all liquidity pools. The typical situation depends on the traders and the machines they use (and perhaps geographic location) but there is basically no difference between spot and futures prices once the futures interest rate differential is stripped out. In other words, the futures price reacts to news in the FX market just like the spot price. Indeed, the futures can be used to hedge FX spot risk, and used when there's a liquidity shortage in spot. I don't think there is any arbitrage opportunity between spot and futures. All the major players are hooked up to both the core spot liquidity venues and the futures, CME in particular, so there is no &quot;leader&quot;.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastEditorUserId="7369" LastEditDate="2015-08-10T08:14:55.203" LastActivityDate="2015-08-10T08:14:55.203" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19245" PostTypeId="1" AcceptedAnswerId="20630" CreationDate="2015-08-10T11:19:38.980" Score="0" ViewCount="168" Body="&lt;p&gt;I read forum post from another site. Which stated...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;XYZ has 60k+ CALL contracts are in the money for this Friday vs 5k PUTS.&#xA;That will be extra 5,500,000 supply this Friday.&#xA;Big drop!&#xA;Chances of XYZ being green tomorrow = 0%&#xA;4 mln shares supply (20% daily volume) from OPEX imbalance will accelerate profit taking run.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My question is... is this a technically valid statement? if so why?... &#xA;What happens to the underlying when someone closes or exercises an in the money call that causes an addition to the daily volume of a stock?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="17166" LastActivityDate="2015-09-04T23:09:54.310" Title="Can a large OpenInt of calls cause a stock to go down?" Tags="&lt;options&gt;&lt;option-pricing&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19246" PostTypeId="1" CreationDate="2015-08-10T11:23:25.273" Score="3" ViewCount="395" Body="&lt;p&gt;If the initial value of a forward contract is zero, surely the forward price used would be the spot price at the time the contract was created?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, my notes tell me that the forward price F, at $t = 0$ for delivery at time $t = T$, is given by $F = e^{rT}S_{0}$ where &lt;em&gt;r&lt;/em&gt; is the risk-free rate and $S_{0}$ is the spot price at $t = 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is this?&lt;/p&gt;&#xA;" OwnerUserId="7714" LastEditorUserId="7714" LastEditDate="2015-08-10T13:15:41.920" LastActivityDate="2015-08-10T23:35:55.653" Title="Why is the spot price not used as the forward price when a forward contract is created?" Tags="&lt;futures&gt;&lt;forward&gt;&lt;forward-rate&gt;&lt;yield-futures&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19247" PostTypeId="2" ParentId="19246" CreationDate="2015-08-10T13:27:07.997" Score="2" Body="&lt;p&gt;When you buy a forward you don't have to invest any money, so that's to your advantage in a world of positive interest rates. To charge you the same as the spot rate would be unfair, you would be &quot;getting something for nothing&quot;, that is why the appropriate price for a forward is higher. It takes the interest rate into account, balancing things out. In equilibrium you are indifferent between a cheaper spot and a more expensive forward that frees up your money (which you can invest elsewhere).&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2015-08-10T13:32:39.993" LastActivityDate="2015-08-10T13:32:39.993" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19249" PostTypeId="2" ParentId="12816" CreationDate="2015-08-10T16:15:02.023" Score="0" Body="&lt;p&gt;Using the $T$-forward measure $Q^T$, where the numeraire is the price of the zero-coupon bond $p(t, T)$ maturing at time $T$, we can see that the forward rate is the expectation of the future short rate $r_T$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;f(t,T) = \mathbb{E}^T \left[ r_T \mid \mathcal{F}_t \right] \, .&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See chapter 26 of Tomas' book &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/019957474X&quot; rel=&quot;nofollow&quot;&gt;http://www.amazon.com/Arbitrage-Theory-Continuous-Oxford-Finance/dp/019957474X&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3188" LastActivityDate="2015-08-10T16:15:02.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19250" PostTypeId="2" ParentId="19246" CreationDate="2015-08-10T16:29:43.220" Score="2" Body="&lt;p&gt;The forward price $F$ for a forward contract, determined at the contract inception time today, is the price that the holder will pay at maturity $T$ to buy the underlying equity. Then the payoff, at maturity $T$, of the forward contract is given by&#xA;\begin{align*}&#xA;S_T-F.&#xA;\end{align*}&#xA;The present value of the contract is then&#xA;\begin{align*}&#xA;e^{-rT} \mathbb{E}\big(S_T-F\big) = S_0 - e^{-rT} F.&#xA;\end{align*}&#xA;As the forward price $F$ is determined so that the value of the forward contract is zero, we have &#xA;\begin{align*}&#xA;F= S_0 e^{rT}.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-08-10T16:29:43.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19251" PostTypeId="2" ParentId="18810" CreationDate="2015-08-10T16:33:34.207" Score="0" Body="&lt;p&gt;After Markowitz published his famous paper, William F. Sharpe published &quot;A Linear Programming Algorithm for Mutual Fund Portfolio Selection&quot; (1967). I haven't re-read it 20 years, but AFAIR it relies on a special structure for the covariance matrix and some assumptions about the utility. Maybe reading this paper would tell you if you are onto something new or not. &lt;a href=&quot;http://pubsonline.informs.org/doi/abs/10.1287/mnsc.13.7.499&quot; rel=&quot;nofollow&quot;&gt;http://pubsonline.informs.org/doi/abs/10.1287/mnsc.13.7.499&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2015-08-10T16:33:34.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19252" PostTypeId="1" AcceptedAnswerId="19256" CreationDate="2015-08-10T16:36:45.280" Score="1" ViewCount="188" Body="&lt;p&gt;I need to obtain the initial parameters that would be used in the Non-Linear Optimization that provides the Nelson-Siegel Svensson parameters for US Treasury Bonds. The Optimization appears to be very sensitive to input parameters and so the initial &lt;a href=&quot;https://quant.stackexchange.com/questions/19001/setting-input-parameters-for-nelson-siegel-svensson-model&quot;&gt;Ordinary Least Squares Regression&lt;/a&gt; that I do to get them is of critical importance. My code is such that if I pass the &lt;a href=&quot;http://www.federalreserve.gov/econresdata/researchdata/feds200628_1.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;actual yields&lt;/a&gt; to the OLS regression I get the same parameters in that link, which mean the code works and &lt;em&gt;my selection process for the bonds that go into the code is wrong&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;My selection method for the bonds&lt;/em&gt;: 3 month, 6 month, 9 month, 2 year, 3 year, 5 year, 10 year and 30 year on-the-run par treasury bonds.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried multiple different sets of bonds, but none of them have resulted in initial parameters close to those in the second link, which should be the case. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And one further question I have is, if I do end up obtaining a selection method that provides appropriate parameters, could I apply this to Bonds issued by other Governments? Is there a general selection procedure that tends to work across various currencies?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please let me know if I need to provide more information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank You&lt;/p&gt;&#xA;" OwnerUserId="11917" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-08-10T18:48:43.213" Title="Selecting bonds to be used in Nigel-Siegel Svensson OLS Regression" Tags="&lt;fixed-income&gt;&lt;bond&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19253" PostTypeId="2" ParentId="7169" CreationDate="2015-08-10T17:30:01.420" Score="1" Body="&lt;p&gt;Isn't the option's delta a close approximation for the probability the option will be in the money?&lt;/p&gt;&#xA;" OwnerUserId="17172" LastActivityDate="2015-08-10T17:30:01.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19256" PostTypeId="2" ParentId="19252" CreationDate="2015-08-10T18:48:43.213" Score="1" Body="&lt;p&gt;There could be many reasons:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You're using on-the-run yields, but the Fed's fitted curves are off-the-run yield curves.&lt;/li&gt;&#xA;&lt;li&gt;You're using only a few points on the curve, the Fed uses virtually all outstanding issues.&lt;/li&gt;&#xA;&lt;li&gt;The optimization, as you stated, is unstable. There's also no guarantee that the Fed's parameters are necessarily the best. If you look at the historical time series of the parameters, they're in fact very noisy and jumpy.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2015-08-10T18:48:43.213" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19257" PostTypeId="1" AcceptedAnswerId="19258" CreationDate="2015-08-10T20:41:43.087" Score="1" ViewCount="100" Body="&lt;p&gt;I am trying to find a good database for Spatial Data. &#xA;What are the examples of this kind of data? IS it always related to geography?&#xA;Any Spatial data related to finance, economics and statistics?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot in advance&lt;/p&gt;&#xA;" OwnerUserId="7985" LastActivityDate="2015-08-10T22:21:10.563" Title="what are database for downloading Spatial Data?" Tags="&lt;data&gt;&lt;econometrics&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19258" PostTypeId="2" ParentId="19257" CreationDate="2015-08-10T22:21:10.563" Score="0" Body="&lt;p&gt;You might want to take a look at some of the &lt;a href=&quot;http://www.factset.com/campaigns/revere&quot; rel=&quot;nofollow&quot;&gt;supply chain data&lt;/a&gt;, I personally have no idea how useful this is. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another interesting area is the import export data sets. There are many &lt;a href=&quot;http://arxiv.org/abs/cond-mat/0301015&quot; rel=&quot;nofollow&quot;&gt;interesting papers on this&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1764" LastActivityDate="2015-08-10T22:21:10.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19259" PostTypeId="2" ParentId="19246" CreationDate="2015-08-10T23:35:55.653" Score="3" Body="&lt;p&gt;it's easiest to see in terms of replication. The pay-off of a forward contract&#xA;is&#xA;$$&#xA;S_T - K.&#xA;$$&#xA;We can replicate this precisely and statically by buying one unit of stock, $S_0,$ and $Ke^{-rT}$ riskless bonds growing at rate $r.$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So its value today is &#xA;$$&#xA;S_0 - Ke^{-rT}.&#xA;$$&#xA;This has zero value if and only if $K= S_0 e^{rT}.$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This value is then called the forward price since it makes the forward contract have zero value.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-08-10T23:35:55.653" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19263" PostTypeId="1" AcceptedAnswerId="19268" CreationDate="2015-08-11T12:14:08.317" Score="2" ViewCount="876" Body="&lt;p&gt;I know that for a swap for example, the swap rate is just what adopts equilibrium for both legs by no arbitrage, on the other hand for a FRA its just the same only with one period of time. Considering what most economist do which is saying that the forward rates are the expectations of the marke (at least here) why are these numbers (just values of equilibrium given today's spot rates) good predictors for anything?&lt;/p&gt;&#xA;" OwnerUserId="12128" LastActivityDate="2019-08-04T14:52:03.727" Title="Why AREN'T forward rates what the market expects of the spot rates?" Tags="&lt;forward&gt;&lt;rates&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19264" PostTypeId="2" ParentId="19238" CreationDate="2015-08-11T12:18:15.853" Score="3" Body="&lt;p&gt;Most of the big players offer a suite of execution algorithms for big orders, as seen in &lt;a href=&quot;https://www.credit-suisse.com/ch/en/investment-banking/client-offering/aes/algorithmic-trading.html&quot; rel=&quot;nofollow&quot;&gt;this listing&lt;/a&gt; from Credit Suisse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Very generally speaking, the algorithms will have a pedigree going back to volume weighted average pricing schedules, or perhaps to the famous paper by &lt;a href=&quot;http://www.courant.nyu.edu/~almgren/papers/optliq.pdf&quot; rel=&quot;nofollow&quot;&gt;Almgren and Chriss&lt;/a&gt;.  They have various modifications, including use of &quot;unusual&quot; order types, trades in dark pools etc., etc., along with parameters exposed to Credit Suisse's customers to allow control of timing, aggressiveness and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alex C. explained in the comments how this differs from iceberg orders, which are generally used as part of an algorithmically generated set of trades.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2015-08-11T12:18:15.853" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19268" PostTypeId="2" ParentId="19263" CreationDate="2015-08-11T14:55:01.807" Score="2" Body="&lt;p&gt;Strictly speaking, any risk-free interest rate can be composed into three components:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The &lt;strong&gt;rate expectations&lt;/strong&gt; component is the market's &quot;true&quot; expectation for future interest rate. &lt;/li&gt;&#xA;&lt;li&gt;A &lt;strong&gt;bond risk premium&lt;/strong&gt; component: longer maturity bonds have higher duration risk than cash. Accordingly market participants will demand more compensation for taking on duration risk; i.e., they'll ask for a higher yield. This is why even if market expectation for rates for the next 100 years is completely flat, the yield curve will still typically be upward sloping.&lt;/li&gt;&#xA;&lt;li&gt;A &lt;strong&gt;convexity bias&lt;/strong&gt; component: longer maturity bonds are more positively convex, providing more return advantages when rates increase or decrease. Because of this &quot;convexity advantage,&quot; investors are willing to accept a lower yield (all else equal). This is why the long end of the yield curve sometimes dip down.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So simply put, forward rates do NOT represent market expectation of future interest rates – you must subtract bond risk premium and add back convexity bias.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is also well known that forward rates frequently overstate subsequently realized interest rates. This is known as &quot;forward rate bias.&quot;&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2015-08-11T14:55:01.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19270" PostTypeId="1" CreationDate="2015-08-11T15:29:35.317" Score="2" ViewCount="704" Body="&lt;p&gt;I am trying to implement a stock matching engine/order book in C++, and am searching for a more cache friendly architecture. Currently, my data structures are as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An intrusive rb-tree for the limit prices.&#xA;An intrusive doubly linked list for holding the orders at the limit prices.&#xA;I have thought about ways to replace the rb-tree, such as a sparse array of limit prices which are themselves linked, but I believe the rb-tree is a better use case as I'm dealing with a sparse book. Now, for the doubly linked list, I have thought about using an array. Aside from resizing it if it fills up, appending and traversing would be optimal, but deletion would require either shifting or skipping deleted entries. I have also considered an unrolled linked list, but from my research and testing, it seems that it works much better when entries are a couple of bytes instead of larger Order structure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any other data structures anyone could point me to, particularly to optimize the cache friendliness?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On another note, if I used a LIFO stack as a memory pool and provided the doubly linked quote lists with objects from this stack to reuse recently deleted quotes, it would preserve cache-time locality, but not necessarily spatial locality. Are my instincts correct in this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I've tried to do quite a bit of testing and analyzing the cache with perf stat in linux, but it hasn't been easy. If someone has any more tips on how to do cache analysis, they would be more than welcome.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly, please no comments on premature optimization. I am doing this largely as an exercise and to learn more. This project is not for production and I don't have a completion timeline. Thanks!&lt;/p&gt;&#xA;" OwnerUserId="17187" LastActivityDate="2015-08-11T15:29:35.317" Title="More cache friendly linked list or alternative with optimal append, delete, and ordered traversal for limit order book?" Tags="&lt;programming&gt;&lt;limit-order-book&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19271" PostTypeId="1" CreationDate="2015-08-11T15:51:43.500" Score="1" ViewCount="222" Body="&lt;p&gt;I am trying to analysis the price of S&amp;amp;P 500 during the flash crash in 2010. Where can I get the data?&lt;/p&gt;&#xA;" OwnerUserId="17188" LastEditorUserId="17188" LastEditDate="2015-08-11T16:31:25.083" LastActivityDate="2020-04-24T23:41:46.040" Title="where can I get the intraday data for S&amp;P 500" Tags="&lt;finance&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ClosedDate="2020-04-25T06:40:45.067" ContentLicense="CC BY-SA 3.0" />
  <row Id="19272" PostTypeId="2" ParentId="19238" CreationDate="2015-08-11T15:55:53.353" Score="3" Body="&lt;p&gt;To slice up an order you can use several execution strategies.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;TWAP which will execute small slices of your order over a time period&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;VWAP which will spread your order over time and try to minimize slippage against the vwap benchmark for a given instrument&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;POV which will split your order up into smaller chunks and attempt to keep your order filled as a certain percentage of the total instruments volume.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You can also use various order types, like iceberg as mentioned, to show only a small part of the order.  Fill or Kill (FOK) and Immediate or Cancel(IOC) are order types that are often used with the above algos to either search for dark liquidity between the bid and ask or to attempt to get an entire slice filled for a given order.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can target a dark pool where your order will be hidden from the lit order book.&lt;/p&gt;&#xA;" OwnerUserId="743" LastActivityDate="2015-08-11T15:55:53.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19275" PostTypeId="1" AcceptedAnswerId="19278" CreationDate="2015-08-11T20:05:27.260" Score="1" ViewCount="287" Body="&lt;p&gt;Is there a way to find out how many of the Russell 2000 stocks are listed on the NYSE and how many on the Nasdaq?&lt;/p&gt;&#xA;" OwnerUserId="17193" LastActivityDate="2015-08-12T03:08:05.213" Title="Percentage of Russell 2000 stocks listed on NYSE and Nasdaq?" Tags="&lt;nasdaq&gt;&lt;nyse&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19277" PostTypeId="1" AcceptedAnswerId="19280" CreationDate="2015-08-11T23:21:20.570" Score="0" ViewCount="66" Body="&lt;p&gt;I want to analyse whether two return series are different. I was told to run the following regression:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;diff = return series 1 - return series 2&#xA;constant = beta * diff&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where I set the constant equal to 1. I use a t-test to evaluate this regression with HAC standard errors. In R this would look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;diff &amp;lt;- as.numeric(series1[startRow:endRow]) - as.numeric(series2[startRow:endRow])&#xA;reg &amp;lt;- lm (formula = diff ~ 1, na.action = na.omit)&#xA;coeftest(reg, vcov=NeweyWest(reg, lag = 1, prewhite=FALSE), df=length(diff)-1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The results are as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;t test of coefficients:&#xA;&#xA;               Estimate | Std. Error | t value | Pr(&amp;gt;|t|)&#xA;(Intercept) -8.7425e-05 | 9.3240e-05 | -0.9376 |  0.3485&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I do not know how to interpret the results. What does the constant do? What does the beta mean? What does it mean when the results are significant or insignificant?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Problems with my sample: return series are dependent &amp;amp; individual return series are non-normal)&lt;/p&gt;&#xA;" OwnerDisplayName="user15050" LastActivityDate="2015-08-12T04:03:46.150" Title="Determining significant difference between to return series" Tags="&lt;returns&gt;&lt;testing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19278" PostTypeId="2" ParentId="19275" CreationDate="2015-08-12T03:08:05.213" Score="3" Body="&lt;p&gt;Your best bet might be to find lists of the companies on each exchange and cross-reference them with a list of the companies on the Russell 2000. It shouldn't be too hard to write a little script in python or something that does the comparison for you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It appears that nasdaq.com has a tool that allows you to download csv lists of the stocks listed on the Nasdaq, NYSE, and AMEX exchanges. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.nasdaq.com/screening/company-list.aspx&quot; rel=&quot;nofollow&quot;&gt;http://www.nasdaq.com/screening/company-list.aspx&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8097" LastActivityDate="2015-08-12T03:08:05.213" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19279" PostTypeId="1" CreationDate="2015-08-12T03:09:32.273" Score="2" ViewCount="1166" Body="&lt;p&gt;I am reading this paper(Stock market forecasting using hidden Markov model: a new approach) and get confused about how they predict the next day's close price. Below is what the authors say about how to implement the hmm:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Using the trained HMM, likelihood value for&#xA;current day’s dataset is calculated. For example, say the&#xA;likelihood value for the day is ‘ , then from the past&#xA;dataset using the HMM we locate those instances that&#xA;would produce the same ‘  or nearest to the ‘ likelihood&#xA;value. That is we locate the past day(s) where the stock&#xA;behaviour is similar to that of the current day. Assuming&#xA;that the next day’s stock price should follow about the&#xA;same past data pattern, from the located past day(s) we&#xA;simply calculate the difference of that day’s closing price&#xA;and next to that day’s closing price. Thus the next day’s&#xA;stock closing price forecast is established by adding the&#xA;above difference to the current day’s closing price.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I just begin learning the hmm and know that in a hidden markov model, we have hidden states and observation states. So in order to train a hmm model, one needs to specify what is the hidden states and what is the observation state.But in their paper, I did not quite get what they use as the hidden states and observation to train the model. Besides, they mention a likelihood value which I do not understand. So my questions are: in this paper&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1.what are the hidden states and what are the observation states.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2.what is the likelihood value and how to calculate it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="15198" LastActivityDate="2015-10-19T05:54:17.307" Title="predict next day's close price using hmm" Tags="&lt;time-series&gt;&lt;equities&gt;&lt;prediction&gt;&lt;hidden-markov-model&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19280" PostTypeId="2" ParentId="19277" CreationDate="2015-08-12T03:45:52.823" Score="0" Body="&lt;p&gt;It is similar to a Diebold and Mariano test. It tests whether series1 minus series2 is positive or negative, while taking into account the possibility there is autocorrelation. If you had normal i.i.d data you could just look at series1-series2 and do a Student t-test as to whether the differences are on average zero or not. This is a fancy way of doing it, more general because of the HAC methodology. In your case series2 is better than series1 [i.e. on average series2[i] &gt; series1[i] for all i] but not significantly so.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2015-08-12T04:03:46.150" LastActivityDate="2015-08-12T04:03:46.150" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19281" PostTypeId="2" ParentId="19229" CreationDate="2015-08-12T06:07:27.633" Score="5" Body="&lt;p&gt;First and foremost you are using bad data. min(data) gets me -3.67 (it's random remember) which would be -367% as in the position went bankrupt and took out two other ones (could be possible in a levered porftolio). However for the sake of an reproducible answer lets use the edhec data set, very little changes to your original code need to be done.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(PerformanceAnalytics)&#xA;data(edhec)&#xA;results &amp;lt;- Return.portfolio(edhec,rebalance_on=&quot;months&quot;,verbose=T)&#xA;&#xA;bop &amp;lt;- results$BOP.Weight #beginning of period weights&#xA;&#xA;eop &amp;lt;- results$EOP.Weight #end of period weights&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is a potential for error here in the non equal weight case as you are subtracting the beginning of period weights from the end of period weights when it SHOULD be the following period weights. E.g. the market has shifted your weights and you need to reset.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;f&amp;lt;-abs(bop-eop)&#xA;&#xA;&#xA;YourTurnover=sum(f)*(1/(nrow(edhec)-1)) # 0.01242465&#xA;SanityCheck=sum(abs(eop-1/ncol(edhec)))/(nrow(edhec)-1) #0.01242465&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Please note that the above definition of turnover is the sum of all the % weight changes divided by number of trading periods. Also the authors do NOT count the initial allocation in their turnover (e.g. the 100% change from cash to investments.) The sanity check is ONLY for the EW case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An average turnover of 1.24% which appears to be in line for an equal weight strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My suspicion if you are not running an equal weight strategy is the bop-eop line. As it should be EoP weights - next BoP weights.&lt;/p&gt;&#xA;" OwnerUserId="2154" LastEditorUserId="2154" LastEditDate="2015-08-12T06:21:20.810" LastActivityDate="2015-08-12T06:21:20.810" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19282" PostTypeId="1" AcceptedAnswerId="19283" CreationDate="2015-08-12T10:47:48.883" Score="2" ViewCount="684" Body="&lt;p&gt;Here is a relatively simple question about PDE's pricing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume that we are within the BS framework and moreover that interest rate is zero. The price $V(t,S_t)$ of the digital is known to be $\Phi(d2)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now consider the BS PDE and solve it backwards using the explicit method with the straightforward boundary conditions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V(T,S_T) = payoff(S_T)$$&#xA;$$V(t,0) =0, \qquad \text{ for } 0\leq t \leq T$$&#xA;$$V(t,S_t) = 1, \qquad \text{ for } S_t \text{ large}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The numerical solution yields a price that is close enough to BS, but when I plotted the price against the spot at time zero I get this picture, where the PDE solution is the one in black and the red one is a numerical approximation to the SDE:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/kpw8r.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/kpw8r.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some details:&#xA;(Volatility $=25\%$, Strike $=100$, r $=0$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; How can the staircase-like behaviour of the PDE, instead of a roughly strictly increasing one, be explained mathematically ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am assuming it is because the payoff is discontinuous (also pricing other derivatives that were continuous worked just fined), but I would like a semi-rigorous mathematical explanation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="17091" LastActivityDate="2015-08-15T09:32:45.097" Title="Numerical Solution to BS PDE - Digital Option" Tags="&lt;numerical-methods&gt;&lt;black-scholes-pde&gt;&lt;binary-options&gt;&lt;continuous-time&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19283" PostTypeId="2" ParentId="19282" CreationDate="2015-08-12T13:49:27.550" Score="1" Body="&lt;p&gt;Rather than thinking about the steps, think about the piecewise regions where your value is constant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When using the explicit scheme, time zero option value at any stock price for your simple digital option is basically just a function of which antecedent nodes (accounting for backwards timestepping) were above or below the strike.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Slight modifications of the initial stock price are not affecting the value of the antecedent nodes, leading to no change in option value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's worth noting that an implicit scheme does not have the same problem, due its greater &quot;smoothing&quot; power -- from allowing neighboring points at a given timestep to influence each others' option values.  This is related to, but not the same thing as, implicit schemes' greater stability under altered grid proportions.  Implicit schemes are well-known for handling discontinuous payoffs much better than explicit schemes, and better than Crank-Nicholson schemes as well.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2015-08-12T13:49:27.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19284" PostTypeId="1" CreationDate="2015-08-12T14:24:36.807" Score="3" ViewCount="146" Body="&lt;p&gt;In this paper:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.ssc.upenn.edu/~fdiebold/papers/paper55/DRAfinal.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.ssc.upenn.edu/~fdiebold/papers/paper55/DRAfinal.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in eqns 3,5 the state eqn has the mean removed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(z_t-\mu)=A(z_{t-1}-\mu) + \epsilon_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$y_t=C z_t + \delta_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I have looked at several implementations of Kalman Filters for state space models I haven't seen this &quot;de-meaned&quot; version any where?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover if you look at implementations such as this by Kevin Murphy he doesn't de-mean the state process either:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/kmatzen/FullBNT-1.0.1/blob/master/Kalman/kalman_update.m&quot; rel=&quot;nofollow&quot;&gt;https://github.com/kmatzen/FullBNT-1.0.1/blob/master/Kalman/kalman_update.m&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus Murphy (and most other authors) take the state space model to be i.e the state equation is NOT demeaned:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$z_t=Az_{t-1} + \epsilon_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$y_t=Cz_t + \delta_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However this model also includes an initial observation x0 which is distributed as $N(\xi, \Lambda)$. (Note that in the paper the choice over what x0 to use is not covered.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q1.) From a theoretical point of view are the two representations equivalent? Clearly they are if $\mu=0$ but more generally for non zero values of $\mu$?Does the mean of $x_0=\xi$ offset the process so that the rest of the observations cab be treated as mean zero? If so can someone show me how this makes the processes equivalent algebraically!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I test the model I use data generated using the non demeaned version of the state equation, with the appropriate x_0, and use the toolbox to estimate it (which also does not demean the state equation) and I get good estimates. This is to be expected as $\mu$ in this case is zero by design. However when I work with empirical data I can't be sure that the empirical state process will be mean zero. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q.2) Therefore should I always de-mean the state process when working with empirical data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kind Regards&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Baz&lt;/p&gt;&#xA;" OwnerUserId="7077" LastActivityDate="2015-08-12T14:24:36.807" Title="Correct form for State Space Equation for Kalman Filter for DNS" Tags="&lt;fixed-income&gt;&lt;kalman&gt;&lt;term-structure&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19285" PostTypeId="1" CreationDate="2015-08-12T15:47:19.643" Score="10" ViewCount="432" Body="&lt;p&gt;The minimum variance portfolio should minimize the standard deviation (variance) of the portfolio at time $t+1$.  The covariance matrix $\Sigma_{t+1}$ needs to be estimated in order to form the mvp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a list of forecast methods of the covariance matrix and I would like to evaluate their performance.  My current strategy consists of estimating the covariance matrix at the end of each week using the past 2 year daily returns, forming the MVP and rebalancing it at the end of each week.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Between-method's evaluation is trivial since i just compare performance statistics.  However, I would also like to know what the performance statistics are under PERFECT information.  How would i go about calculating the covariance matrices for each time period and forming the &lt;em&gt;true&lt;/em&gt; (proxied) optimal portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would I simply be forming a covariance matrix using daily returns of the entire week or would I be taking the single week return vector and forming the covariance based on that? e.g $\Sigma_{t+1} = (r_{t+1} - \mu)(r_{t+1} - \mu)'$ where $r_{t+1}$ is a vector of the week's return (under out-of-sample, it is unknown, for perfect information, I know this).  That brings to the question of $\mu$, how would i calculate that under perfect information?  Should I be using another measure such as the realized variance by Merton?&lt;/p&gt;&#xA;" OwnerUserId="11888" LastEditorUserId="11888" LastEditDate="2015-08-12T16:14:12.973" LastActivityDate="2018-10-27T04:02:00.213" Title="How to evaluate minimum-variance strategies against perfect information mvp" Tags="&lt;portfolio-management&gt;&lt;performance-evaluation&gt;&lt;minimum-variance&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19286" PostTypeId="2" ParentId="19285" CreationDate="2015-08-12T18:08:34.247" Score="0" Body="&lt;p&gt;Here is a simple way of solving the above:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Take future returns (use the daily return matrix of all the assets for the future investment horizon), calculate covariance matrix.&lt;/li&gt;&#xA;&lt;li&gt;Calculate weights using future perfect data.&lt;/li&gt;&#xA;&lt;li&gt;Repeat for all time periods.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Pick whichever method of estimating the covariance matrix you prefer the most and plug it into 1), likewise for optimizer choice.&lt;/p&gt;&#xA;" OwnerUserId="2154" LastActivityDate="2015-08-12T18:08:34.247" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="19287" PostTypeId="1" CreationDate="2015-08-12T19:44:42.393" Score="1" ViewCount="121" Body="&lt;p&gt;I'm currently reading the following lecture notes: &lt;a href=&quot;http://www1.maths.leeds.ac.uk/~jitse/math2515/lecture04.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www1.maths.leeds.ac.uk/~jitse/math2515/lecture04.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the second page, under the subsection titled &quot;The Risk-Neutral World&quot; it points out that the model previously used to value options contracts does not take into account the probability of prices going up or down. It then suggests that this may be because a stocks current price takes into account the probability of it going up (or down) in the future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone explain, in simple terms, why this might be true?&lt;/p&gt;&#xA;" OwnerUserId="7714" LastEditorUserId="7714" LastEditDate="2015-08-12T20:26:43.173" LastActivityDate="2015-08-14T05:17:28.597" Title="Is it realistic to assume that the current price of a stock takes into account the probability of it going up or down in the future?" Tags="&lt;options&gt;&lt;american-options&gt;&lt;binary-options&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19289" PostTypeId="1" AcceptedAnswerId="19303" CreationDate="2015-08-12T21:58:16.270" Score="6" ViewCount="243" Body="&lt;p&gt;The second unexpected devaluation of the Chinese currency CNY caused some &lt;a href=&quot;http://www.zerohedge.com/news/2015-08-12/china-currency-war-contagion-spills-out-leads-global-fx-heatmap-bloodbath-pboc-inter&quot; rel=&quot;noreferrer&quot;&gt;turbulent market movements&lt;/a&gt; in currencies today.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was surprised that the EUR went to a 1-week high against the USD up by almost 1.5% on a single day to a 1-month high.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone explain why the CNY devalutation would benefit the EUR and harm the USD?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As we know, the EUR offers a negative ECB rate, while the fed is expected to raise its rate, hence I expected the USD to rise vs. the EUR. Then I thought that maybe together with a solution of the Greek debt crisis markets preferred going into EUR and saw the USD already overvalued.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/noZTB.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/noZTB.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2015-08-13T12:53:44.137" Title="CNY Devaluation: Why EUR up, USD down?" Tags="&lt;fx&gt;&lt;currency&gt;&lt;banks&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19290" PostTypeId="2" ParentId="19287" CreationDate="2015-08-12T22:41:28.037" Score="1" Body="&lt;p&gt;well, the current share price reflects fair value. So you'd expect it to be close to its expected price, but slightly below because of risk aversion and discounting. If it was very far off its expectation, it would either be over or under valued and people would trade accordingly. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-08-12T22:41:28.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19293" PostTypeId="2" ParentId="17870" CreationDate="2015-08-13T03:14:22.093" Score="3" Body="&lt;p&gt;The major advantage of Python (w/ pandas) over R is that Python supports OOP (object-oriented programming).  It makes sense to organize a large code base using a hierarchy of classes.  Python also supports the notion of polymorphism so that we can use well-known design patterns (e.g., Strategy, Observer, etc.) in our code.&lt;/p&gt;&#xA;" OwnerUserId="3188" LastActivityDate="2015-08-13T03:14:22.093" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19295" PostTypeId="5" CreationDate="2015-08-13T06:05:18.470" Score="0" Body="&lt;p&gt;A routine question from a textbook, course, or test used for a class or self-study. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following guidelines are for &lt;strong&gt;those who are asking&lt;/strong&gt; and &lt;strong&gt;those who would answer&lt;/strong&gt; self-study questions.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;They are rooted in two principles:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;It is okay to ask about homework&lt;/strong&gt;.  Homework is included in this self-study tag. This site exists to help people learn and provide a standard repository for questions in statistics and machine learning, both simple and complex, and this includes helping students.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Providing an answer that doesn't help a student learn is not in the student's own best interest. Therefore you might choose to &lt;strong&gt;treat self-study questions differently&lt;/strong&gt; than other questions.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;Asking about self-study questions&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Make a &lt;strong&gt;good faith attempt&lt;/strong&gt; to solve the problem yourself first. If don't seem to be making a genuine attempt, your question might be voted down or closed.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Ask about &lt;strong&gt;specific problems&lt;/strong&gt; you have encountered in your initial efforts. If you can't do that yet, try some more of your own work first or searching for more general help.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Be honest about the source of the question.&lt;/strong&gt;  Do this by adding the self-study tag and mentioning whether it is for some class in the question text.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Be aware of school policy&lt;/strong&gt; (if relevant). If your school has a policy regarding outside help on homework, make sure you are aware of it before you ask for/receive help here. If there are specific restrictions (for example, you can receive help, but not full solutions), include them in the question so that those providing assistance can keep you out of trouble.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Never use a solution you don't understand&lt;/strong&gt;. It definitely won't help you later (after school, in later assignments, on tests, etc.) and it could be, at best, very embarrassing if you are asked to explain what you turned in.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;Answering self-study questions&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Try to provide explanations that will &lt;strong&gt;lead the asker&lt;/strong&gt; in the correct direction. Genuine understanding is the real goal for students, but trying to provide that is seldom unappreciated for any question.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It's usually better &lt;strong&gt;not to provide a complete solution&lt;/strong&gt; (or code sample) if you believe it would not help the student, using your best judgment. You can use pseudo-code and general descriptions first.  In the spirit of creating a resource, you may come back after a suitable amount of time and edit your response to include more details, if the question seems like such information will have lasting value. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Don't downvote others&lt;/strong&gt; who answer coursework-related questions in good faith, even if they break these guidelines. It is a good idea to suggest editing the response in a comment.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Don't ridicule&lt;/strong&gt; a student because they haven't yet learned something obvious or developed the good habits you'd expect from an expert. Do add a respectful comment or answer that points them towards best practices and better style.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Don't downvote a homework question&lt;/strong&gt; that follows the guidelines and was asked in good faith. CV explicitly accepts homework questions that follow the guidelines. Consider making helpful suggestions for improving the question instead.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(Adapted from an &lt;a href=&quot;http://meta.stackexchange.com/questions/10811/how-to-ask-and-answer-homework-questions/10812#10812&quot;&gt;SO post by Joe Coehoorn&lt;/a&gt; as suggested in a &lt;a href=&quot;http://meta.stats.stackexchange.com/q/12/919&quot;&gt;meta discussion&lt;/a&gt;. Taken and adapted from stats for quant.)&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="848" LastEditDate="2015-08-13T06:05:18.470" LastActivityDate="2015-08-13T06:05:18.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19296" PostTypeId="4" CreationDate="2015-08-13T06:05:18.470" Score="0" Body="A routine question from a textbook, course, or test used for a class or self-study.  This community's policy is to &quot;provide helpful hints&quot; for self-study questions.&#xD;&#xA;" OwnerUserId="848" LastEditorUserId="848" LastEditDate="2015-08-13T06:05:18.470" LastActivityDate="2015-08-13T06:05:18.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19297" PostTypeId="2" ParentId="19287" CreationDate="2015-08-13T07:19:01.627" Score="0" Body="&lt;p&gt;Mark has rightly pointed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may think like this, If there is high probability price would go up in future(in very short period), lets say 90% then investors would continue to buy until they no longer expect price to increase with such a high probability. Or until this strategy of buying shares with high probability of going up is not profitable(excess risk adjusted return). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, if there is very high probability that price will fall in future, then investors would continue to sell until they no longer expect price to fall beyond that level. Or until this strategy of selling shares with high probability of going down is not profitable(excess risk adjusted return). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So your question : is it realistic to assume that current price of stock takes into account probability of going up and down in the future? Answer is completely yes. After all price are not deterministic. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets come to your dilemma on pricing of option contract. Since derivatives derive their value from some underlying assets it is completely realistic to assume that current price of security is fair( only for actively traded) and hence does not require to take into account expected return on the underlying one. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope it would help you to understand. &lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2015-08-13T07:19:01.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19299" PostTypeId="1" CreationDate="2015-08-13T07:34:06.273" Score="0" ViewCount="433" Body="&lt;p&gt;When implementing a code for the new model, even if it provides sensible price, it is still a good idea to compare it against some benchmarks, even in the special case of constant volatility Black-Scholes model. For example, I am interested in the price for American-style Call with strike 100 and expiry in 1 year, on stock that is 100 now, pays 3 eur fixed discrete deterministic dividend after 0.5 years, in the 0 interest rate environment. Are there any source with similar examples?&lt;/p&gt;&#xA;" OwnerUserId="13480" LastEditorUserId="36636" LastEditDate="2020-06-15T18:51:51.893" LastActivityDate="2020-06-15T18:51:51.893" Title="Examples for the option model validation" Tags="&lt;option-pricing&gt;&lt;modeling&gt;&lt;validation&gt;&lt;model-validation&gt;" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19300" PostTypeId="1" AcceptedAnswerId="19306" CreationDate="2015-08-13T07:43:31.003" Score="1" ViewCount="94" Body="&lt;p&gt;I want to compare the performance of two mutual funds. The only data I have is annual returns for the past 7 years. So I have 7 observations for Fund 1 and 7 observations for Fund 2. In addition, I have data for market returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To compare the mean return of the two funds, I performed a $t$-test. Since the sample size is small, I expected to get no significant difference in mean return of two funds, and the result fits this expectation. What I want to know is which fund performed better in the past, Fund 1 or Fund 2? Is there any way to compare the performance of two funds?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also performed bootstrapping to calculate the standard error of the mean. But, as per literature, bootstrapping is also not very efficient when the sample size is very small.&lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="6101" LastEditDate="2015-08-13T20:08:02.717" LastActivityDate="2015-08-13T20:12:10.307" Title="How can I compare two mutual funds' performance with a sparse set of data?" Tags="&lt;risk-models&gt;&lt;performance-evaluation&gt;&lt;statistical-finance&gt;&lt;return&gt;&lt;mutual-fund&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19301" PostTypeId="2" ParentId="18854" CreationDate="2015-08-13T09:05:10.703" Score="3" Body="&lt;p&gt;Essentially the question is importance sampling&#xA;$$&#xA;\int f(S_T) \psi_{r}(S_T) dS_T = \int f(S_T) \psi_{\alpha}(S_T)  \frac{\psi_r}{\psi_\alpha}(S_T) dS_T &#xA;$$&#xA;Here $\psi_{\mu}$ denotes the log-normal density with drift $\mu.$ So when you simulate with drift $\alpha$ each sample used is &#xA;$$&#xA;f(S_T)  \frac{\psi_r}{\psi_\alpha}(S_T)&#xA;$$&#xA;instead of $f(S_T).$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also do a change of variable and write the integral in terms of $\log S_T$ to get simpler expressions for the densities. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-08-13T09:05:10.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19302" PostTypeId="1" CreationDate="2015-08-13T12:26:04.800" Score="2" ViewCount="83" Body="&lt;p&gt;Ok guys, I'm studying from Danthine and Donaldson - Intermediate Financial Theory. The book itself doesn't have a lot of worked examples, and I'm lacking the basics for understanding some concepts related to utility functions. This is the text of the exercise I'm stuck with:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a two goods/two agents pure exchange economy where agents' utility functions ade of the form: $U(c_1^j,c_2^j) = (c_1^j)^{\alpha}(c_2^j)^{1-\alpha}, j=1, 2$ with $\alpha=0.5$. Initial endowments are $e_1^1 = 6$, $e_2^1 = 4$, $e_1^2 = 14$, $e_2^2 = 16$ (superscripts represent agents).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) describe the Pareto set (the set of Pareto optima)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) assume that there exists a competitive market for each good. What is the equilibrium allocation? What are the equilibrium prices? Comment. What are the utility levels and MRS after trading? What do you conclude?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, can anybody suggest me a reference, lecture notes, and maybe worked examples that can help me understand better this kind of exercises? Thanks to everybody who wants to help!&lt;/p&gt;&#xA;" OwnerUserId="16045" LastEditorUserId="848" LastEditDate="2015-08-13T13:59:18.900" LastActivityDate="2015-08-13T13:59:18.900" Title="Financial theory" Tags="&lt;reference-request&gt;&lt;utility-theory&gt;&lt;self-study&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19303" PostTypeId="2" ParentId="19289" CreationDate="2015-08-13T12:53:44.137" Score="6" Body="&lt;p&gt;Today (1 day after the fact) the following headline appeared in the Financial Times: &quot;September Fed rate lift-off put in doubt, Fallout from China’s currency move turns market mood&quot;. If true, this would certainly explain why the USD declined (i.e. the interest rate rise that everyone expected has been postponed). However, in my experience it is very hard to understand these things as they happen or before they happen.  After the fact, once you know what happened, many explanations look plausible, but they are impossible to check against each other.  The public wants an explanation. but the markets are complex and not easy to decipher.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2015-08-13T12:53:44.137" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19304" PostTypeId="2" ParentId="18338" CreationDate="2015-08-13T14:36:44.437" Score="1" Body="&lt;p&gt;I think that the approach suggested by @Alex is pretty standard and I have seen such charts before but for a less orthodox approach that may clean up the graphics a bit, you might consider the final cumulative return as a segmented bar or pie chart (though I might discourage pie chart). See &lt;a href=&quot;http://lh3.ggpht.com/-BavIH05sCU8/UBFYjfRQxbI/AAAAAAAAZ-4/qKQ36B54uJs/image%25255B82%25255D.png?imgmax=800&quot; rel=&quot;nofollow&quot;&gt;this example&lt;/a&gt; of a segmented bar for what I'm talking about. Each bar could be an annual period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may also consider a 100% stacked area, or simple stacked area chart again on cumulative returns.&lt;/p&gt;&#xA;" OwnerUserId="4910" LastActivityDate="2015-08-13T14:36:44.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19305" PostTypeId="2" ParentId="19282" CreationDate="2015-08-13T19:17:16.170" Score="0" Body="&lt;p&gt;We denote by $V_{i}^{n}=V(\tau_n,S_i)$ the value of a Digital call at time $\tau_n$ when the stock price is $S_i$. We use $N_S+1$ points for the stock price,and $N_{\tau}+1$ points for the maturity.Using ${{S}_{\min }}={{t}_{\min }}=0$ uniform grid for $(S,\tau)$ can be constructed as&#xA;\begin{align}&#xA;  &amp;amp; {{S}_{i}}=i\times ds\quad \quad ,\quad \quad i=0\,,\,1\,,\,2\,,\,\ldots \,,\,{{N}_{S}} \\ &#xA; &amp;amp; {{\tau }_{n}}=n\times d\tau \quad \,\,\,\,,\quad \quad n=0\,,\,1\,,\,2\,,\,\ldots \,,\,{{N}_{\tau}} \\ &#xA;\end{align} &#xA;Where the increments are $ds=S_{max}/N_S$ and $d\tau=\tau_{max}/N_{\tau}$.The&#xA;first-order derivatives approximated with central differences for an interior point $(S_i,\tau_n)$ &#xA;\begin{align}&#xA;  &amp;amp; \frac{\partial V}{\partial S}({{S}_{i}},{{\tau}_{n}})=\frac{V_{i+1}^{n}-V_{i-1}^{n}}{2ds} \\ &#xA; &amp;amp; \frac{\partial V}{\partial t}({{S}_{i}},{{\tau}_{n}})=\frac{V_{i}^{n+1}-V_{i}^{n}}{dt},\\ &#xA;\end{align}&#xA;and second-order derivatives is approximated by&#xA;$$\frac{{{\partial }^{2}}V}{\partial {{S}^{2}}}({{S}_{i}},{{\tau }_{n}})=\frac{V_{i+1}^{n}-2V_{i}^{n}+V_{i-1}^{n}}{ds{{\,}^{2}}}$$ &#xA;thus,we have&#xA;$$V_{i}^{n+1}=V_{i}^{n}+\,\left[ \frac{1}{2}{{\sigma }^{2}}{{i}^{2}}(V_{i+1}^{n}-2V_{i}^{n}+V_{i-1}^{n}) \right.\left. +\frac{r}{2}i(V_{i+1}^{n}-V_{i-1}^{n})-r\,V_{i}^{n} \right]d\tau,$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;You assumed $r=0$,then &#xA;$$V_{i}^{n+1}=V_{i}^{n}+\,\frac{1}{2}{{\sigma }^{2}}{{i}^{2}}(V_{i+1}^{n}-2V_{i}^{n}+V_{i-1}^{n})$$&#xA;Indeed,without any changing variable, you convert Black-Scholes PDE into Heat equation.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;we continue our discussion!.let&#xA;\begin{align}&#xA;  &amp;amp; a=1-({{\sigma }^{2}}{{i}^{2}}+r)dt \\ &#xA; &amp;amp; b=\frac{1}{2}\,\,\,\,\,({{\sigma }^{2}}{{i}^{2}}-ri)dt \\ &#xA; &amp;amp; c=\frac{1}{2}\,\,\,\,\,({{\sigma }^{2}}{{i}^{2}}+ri)dt \\ &#xA;\end{align} &#xA;then&#xA;$$V_{i}^{n+1}=aV_{i}^{n}+bV_{i-1}^{n}+cV_{i+1}^{n} $$&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Conditions of stability issue&lt;/h2&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;For $i=1,2,...,N_S$ , $a&amp;gt;0$, then&#xA;$$ dt&amp;lt;\frac{1}{\sigma^2\,N_S^{\,2}+r}$$&lt;/li&gt;&#xA;&lt;li&gt;For $i=1,2,...,N_S$ , $b&amp;gt;0$, then $\sigma^2&amp;gt;r$&lt;/li&gt;&#xA;&lt;li&gt;$a+b+c&amp;lt;1$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerDisplayName="user16891" LastActivityDate="2015-08-13T19:17:16.170" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19306" PostTypeId="2" ParentId="19300" CreationDate="2015-08-13T20:12:10.307" Score="2" Body="&lt;p&gt;I think the only valid answer is you can't. The techniques you describe would work of the signal was much stronger than the noise but it seems that with your fund returns this is not the case. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could try to get more data or look at other risk measures like max drawdown to get some idea of the risks involved.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2015-08-13T20:12:10.307" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19307" PostTypeId="1" AcceptedAnswerId="19308" CreationDate="2015-08-13T20:28:15.677" Score="0" ViewCount="3978" Body="&lt;p&gt;The author in this article -- &lt;a href=&quot;http://streetwiseprofessor.com/?p=7294&quot; rel=&quot;nofollow&quot;&gt;http://streetwiseprofessor.com/?p=7294&lt;/a&gt; -- states that an increase in stock borrowing costs decreases a stock's forward price:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In the absence of manipulation, the forward price of a stock should be the current spot price plus the cost of financing the position at the prevailing interest rate until the delivery date on the forward.  In the absence of a squeeze, the cost/fee to borrow the stock should be small.  However, in a squeeze, it is costly to borrow the stock: the bigger the squeeze, the bigger the cost of borrowing.  This borrowing cost depresses the forward price.  Thus, during a squeeze, the forward price is below the spot price plus financing costs. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But why? Shouldn't the effect be similar to increased dollar financing rates, namely an &lt;em&gt;increase&lt;/em&gt; in the forward price?&lt;/p&gt;&#xA;" OwnerUserId="17214" LastActivityDate="2015-08-13T20:50:35.873" Title="Why does increased stock borrow costs decrease a stock's forward price?" Tags="&lt;derivatives&gt;&lt;forward&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19308" PostTypeId="2" ParentId="19307" CreationDate="2015-08-13T20:40:21.970" Score="3" Body="&lt;p&gt;The rate of interest on cash and the cost of borrowing the stock work in opposite directions. Think of the cost of borrowing the stock as a kind of &quot;dividend&quot; that the stock pays off to its holders. As a stock owner you &lt;em&gt;receive&lt;/em&gt; this amount [if you lend the shares] while you &lt;em&gt;pay&lt;/em&gt; the interest rate if you hold the stock on margin.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2015-08-13T20:50:35.873" LastActivityDate="2015-08-13T20:50:35.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19310" PostTypeId="2" ParentId="19287" CreationDate="2015-08-14T05:17:28.597" Score="0" Body="&lt;p&gt;What the author is arguing is that the current price exactly at this instant takes into account all the views of the market participants as expressed by orders (which would be correct). Note that those views may change almost instantaneously generating orders thus causing price to change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example is you have an expected future price of 10 and the current price is 9, therefore you will allocate a certain amount of capital to this trade (say 1 lot - 100 shares). Let's assume that the next Ask is 9.10 @ 1 lot. So the price is now $9.10, given enough participants with views as you the price will move accordingly. &lt;/p&gt;&#xA;" OwnerUserId="2154" LastActivityDate="2015-08-14T05:17:28.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19315" PostTypeId="5" CreationDate="2015-08-14T14:26:31.630" Score="0" Body="&lt;p&gt;The &lt;a href=&quot;http://rfs.oxfordjournals.org/content/9/1/69.abstract&quot; rel=&quot;nofollow&quot;&gt;Bates model&lt;/a&gt; is represented by the bivariate system of stochastic differential equations&#xA;$$\hspace{2cm}\frac{dS_t}{S_t}=(\mu-\lambda\,\bar{J})dt+\sqrt{v_t}dW_1(t)+JdN(t)$$&#xA;$$dv_t=\kappa(\theta-v_t)dt+\sigma\sqrt{v_t}dW_2(t)$$&#xA;where &#xA;$$\mathbb{E^Q}[dW_1(t)dW_2(t)]=\rho dt$$&#xA;and $N_t$ is a compound Poisson process with intensity $\lambda$ and independent jumps $J$ with &#xA;$$\ln{(1+J)}\tilde{~} N\left(\ln(1+\beta)-\frac{1}{2}\alpha^2,\alpha^2\right)$$&#xA;The parameters $\beta$ and ${\alpha}$ determine the distribution of the jumps and the Poisson process is assumed to be independent of the Wiener processes.&lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastEditorDisplayName="user16891" LastEditDate="2015-08-14T14:43:49.577" LastActivityDate="2015-08-14T14:43:49.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19316" PostTypeId="4" CreationDate="2015-08-14T14:26:31.630" Score="0" Body="An efficient Model  is developed for option pricing under stochastic volatility and jump diffusion processes." OwnerDisplayName="user16891" LastEditorDisplayName="user16891" LastEditDate="2015-08-15T18:05:52.310" LastActivityDate="2015-08-15T18:05:52.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19317" PostTypeId="1" CreationDate="2015-08-14T15:15:24.777" Score="4" ViewCount="13373" Body="&lt;p&gt;I am interested in calculating high frequency 5-minute intraday volatility. I am going to use the standard Realized volatility which is the square root of the sum of squared log returns.&lt;/p&gt;&#xA;&lt;p&gt;Given X is the log price of a stock the log return Y is calculated as &lt;span class=&quot;math-container&quot;&gt;$$ log \ returns = Y =  \frac{x_i+1}{x_i} $$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Then the realized variance is the sum of the squared log returns:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;   Realized\  Variance  =  \sum\limits_{i=1}^{n} (y_{t_{i}})^2 &#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;   Realized  \ Volatility =  \sqrt{\sum\limits_{i=1}^{n} (y_{t_{i}})^2 }&#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;For 5-minute realized volatility n = 78 (there are 6.5 hours in the NYSE trading day)&lt;/p&gt;&#xA;&lt;p&gt;Now if Y is the log returns and the mean of Y is assumed to be zero you can also calculate a standard deviation&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ standard \ deviation  = \sqrt{\frac{1}{N}\sum\limits_{i=1}^{N} (y_i)^2}$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;So you can see the only difference between the Realized Volatility of Y and the standard deviation of Y is the &lt;span class=&quot;math-container&quot;&gt;$ \frac{1}{N} $&lt;/span&gt; term in the standard deviation calculation.&lt;/p&gt;&#xA;&lt;p&gt;Can you explain the significance of this? Why does realized variance not have 1/N and how can the 2 be interpreted?&lt;/p&gt;&#xA;&lt;p&gt;reference &lt;a href=&quot;https://en.wikipedia.org/wiki/Realized_variance&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Realized_variance&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16923" LastEditorUserId="8164" LastEditDate="2020-12-22T14:20:30.150" LastActivityDate="2020-12-22T18:40:10.080" Title="Realized Volatility vs. Standard deviation of log returns" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;high-frequency&gt;&lt;high-frequency-estimators&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="19319" PostTypeId="2" ParentId="19317" CreationDate="2015-08-14T16:11:48.037" Score="4" Body="&lt;p&gt;It is all a matter of frequency. For instance if you want to get annual realized volatility you multiply your last expression by $\sqrt{(N*251)}$ or the second to last expression by $\sqrt{(251)}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, your last expression is the 5-min realized volatility whereas the second to last expression is the daily realized volatility.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-08-14T16:11:48.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19320" PostTypeId="1" CreationDate="2015-08-14T16:45:00.053" Score="5" ViewCount="1248" Body="&lt;p&gt;I would like to measure the momentum in the price of a stock from the time the market opens until the time I trade each day. I want to use this momentum number in post-trade analysis (regression of trading cost and performance, etc...) I know there is no universally accepted definition for momentum and I need this momentum calculation to be consistent and hopefully simple so I was thinking defining momentum as the amount of autocorrelation in the time series where the autocorrelation is measured by the AR(1) coefficient&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;METHOD 1&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An AR(1) process Y is defined as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$  y_t = c + \beta y_{t-1} + \epsilon_t  $ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $ \epsilon_t  $ is white noise and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;c is a constant. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the absolute value of beta $ |\beta|  $ is &gt;= 1 then shocks accumulate over time and the process is nonstationary. If beta $ |\beta|  $ is &amp;lt; 1 then the process is stationary&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example in R here is the SPY modeled as an AR(1) for 200 days. The prices below are daily prices but I will be using 1-minute or 5-minute prices:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;require(quantmod)&#xA;getQuote(&quot;SPY&quot; )&#xA;URL &amp;lt;- &quot;http://ichart.finance.yahoo.com/table.csv?s=SPY&quot;&#xA;dat &amp;lt;- read.csv(URL)&#xA;dat$Date &amp;lt;- as.Date(dat$Date, &quot;%Y-%m-%d&quot;)&#xA;n= 200 #number of prices&#xA;logret = diff(log(dat$Close[1:n]))                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    &#xA;arima(logret, c(1,0,0))&#xA;plot(logret,type=&quot;l&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The AR(1) coefficient is -.02 and I would this -.02 as my measure of momentum.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;METHOD 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My other approach was to be even more simplistic and to just test IF there is any autocorrelation at all using the Box.test which would say if the autocorrelations are all zero.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Box.test(logret, lag=15, type = 'Ljung')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in this case the p-value = .93 so there is no autocorrelation for lags 1...15 so I was thinking of using this Box.test p-value as my measure of momentum.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you comment on these methods? Which one is better or do you have suggestions? Again I am looking for something consistent and simple. I do not want to estimate the &quot;best&quot; time series model for each trade because each trade the preceding time series might be an AR(1) one day but an ARIMA(2,0,5) another day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;NOTE:  Above I am using LOG RETURNS in the fitted AR(1) model and the Box.Test. I am doing this to perform the calculations on a stationary time series. But is it acceptable/preferred to perform these tests on raw prices?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an extension of weather to use Price or log returns:  Below is an example showing using price recognizes high serial autocorrelation in the price while log returns do not recognize it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;set.seed(12345)&#xA;###auto correlation in price&#xA;r =rep(seq(1,20,1),20)&#xA;plot(r,type='l')&#xA;acf(r, lag.max= 1)$acf # .72 = this DOES recognize the price dynamics of high serial correlation for runs of 20 at a time&#xA;arima(r, c(1,0,0))&#xA;&#xA;&#xA;### autocorrelation in log returns&#xA;r =diff(log(rep(seq(1,20,1),20)))&#xA;plot(r,type='l')&#xA;acf(r, lag.max= 1)$acf   # -.15 = this DOES NOT recognize the price dynamics of high serial correlation for runs of 20 at a time&#xA;arima(r, c(1,0,0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="16923" LastEditorUserId="8164" LastEditDate="2018-02-13T20:00:37.310" LastActivityDate="2018-02-13T20:00:37.310" Title="Measuring momentum as AR(1) process" Tags="&lt;time-series&gt;&lt;auto-correlation&gt;&lt;time&gt;&lt;momentum&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19321" PostTypeId="1" CreationDate="2015-08-14T18:27:23.883" Score="4" ViewCount="714" Body="&lt;p&gt;When using the PerformanceAnalytics package of R, I am getting an error from the Return.portfolio function whenever I ask it to rebalance_on any frequency.  If the rebalance parameter is removed, the function works fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Return.portfolio(portfolio.returns.daily, weights=risk.weights, rebalance_on=&quot;months&quot;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Error in &lt;code&gt;[&amp;lt;-&lt;/code&gt;(&lt;code&gt;*tmp*&lt;/code&gt;, k, , value = c(0.734291071622665, 0.629392347105141,  : &#xA;  subscript out of bounds&lt;/p&gt;&#xA;" OwnerUserId="16288" LastActivityDate="2016-10-01T19:07:46.973" Title="Return.portfolio error from PerformanceAnalytics package" Tags="&lt;time-series&gt;&lt;portfolio-management&gt;&lt;r&gt;&lt;performanceanalytics&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19323" PostTypeId="2" ParentId="17870" CreationDate="2015-08-14T21:59:28.673" Score="29" Body="&lt;p&gt;Instead of wild guesses about R's/python's future in the community, here some facts:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following query on StackExchange Data Explorer counts the number of questions that have &lt;code&gt;&amp;lt;r&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;python&amp;gt;&lt;/code&gt; tags. If you scroll down on one of the three webpages provided below, you can see a graph with data on a monthly basis.&#xA;You can easily run this query on databases for other sites as well (just go to &quot;Switch sites&quot; right below the query).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;stats&#xA;&lt;a href=&quot;http://data.stackexchange.com/stats/query/350129/r-versus-python-tags#graph&quot; rel=&quot;noreferrer&quot;&gt;http://data.stackexchange.com/stats/query/350129/r-versus-python-tags#graph&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;stack &lt;a href=&quot;http://data.stackexchange.com/stackoverflow/query/350129/r-versus-python-tags#graph&quot; rel=&quot;noreferrer&quot;&gt;http://data.stackexchange.com/stackoverflow/query/350129/r-versus-python-tags#graph&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;quant &lt;a href=&quot;http://data.stackexchange.com/quant/query/350129/r-versus-python-tags#graph&quot; rel=&quot;noreferrer&quot;&gt;http://data.stackexchange.com/quant/query/350129/r-versus-python-tags#graph&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The results:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;In absolute terms, R has more hits for both &lt;code&gt;stats.stackexchange.com&lt;/code&gt; and &lt;code&gt;quant.stackexchange.com&lt;/code&gt; (the latter having very few data points). Python has more hits for &lt;code&gt;stackoverflow.com&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In relative terms, the gap between R and python is closing for &lt;code&gt;stackoverflow.com&lt;/code&gt; (ratio approx 1 to 3 at the moment). The ratio between R and python tags on &lt;code&gt;stats.stackexchange.com&lt;/code&gt; is more or less stable since mid/end 2013 (roughly a factor 10 or a little above).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I really do think that the tag statistics in the stackexchange universe are a good indicator of the &lt;em&gt;current&lt;/em&gt; interest in a particular programming language - probably even more so for its &lt;em&gt;future&lt;/em&gt; popularity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All-in-all, I am confident that the present data makes a strong case against Matt Wolf's hypothesis that &lt;em&gt;&quot;R might be obsolete in 3-4 years&quot;&lt;/em&gt;. ;)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Update:&#xA;So now it's been 6 months since my initial answer. We still have to wait another 2.5-3.5 years to definitely see whether R has become obsolete. :)&#xA;In the meantime, a quick addition due to Matt Wolf's comment. Here are variations of the above queries that give you the tag ratios (that's what I have been referring to in the second point of my answer).&#xA;All ratios are python tags divided by R tags.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;stats&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://data.stackexchange.com/stats/query/421036/r-versus-python-tags-quotient-py-r#graph&quot; rel=&quot;noreferrer&quot;&gt;http://data.stackexchange.com/stats/query/421036/r-versus-python-tags-quotient-py-r#graph&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not see a clear trend here. The Py/R ratio is around 0.07 (there was a spike to 0.095 in November though). Since mid 2013, the ratio varies between 0.04 and 0.11. So I would call it relatively stable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;SO&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://data.stackexchange.com/stackoverflow/query/421032/r-versus-python-tags-quotient-py-r#graph&quot; rel=&quot;noreferrer&quot;&gt;http://data.stackexchange.com/stackoverflow/query/421032/r-versus-python-tags-quotient-py-r#graph&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There was indeed a short term trend in favor of Python since Jul 15 (Py/R ratio went from 3.1 to 3.5). So the statement that &quot;R is closing the gap wrt the Py/R ratio&quot; could be called obsolete at the moment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;quant&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://data.stackexchange.com/quant/query/421042/r-versus-python-tags-quotient-py-r#graph&quot; rel=&quot;noreferrer&quot;&gt;http://data.stackexchange.com/quant/query/421042/r-versus-python-tags-quotient-py-r#graph&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still very noisy. Python did seem to catch up a little bit the last few months. But hard to tell with that little data.&lt;/p&gt;&#xA;" OwnerUserId="3303" LastEditorUserId="3303" LastEditDate="2016-01-08T12:36:54.930" LastActivityDate="2016-01-08T12:36:54.930" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="19324" PostTypeId="1" AcceptedAnswerId="19327" CreationDate="2015-08-14T23:17:15.770" Score="1" ViewCount="168" Body="&lt;p&gt;When selling options, e.g. a straddle I read often the optimal time for selling options is 30-40 days until expiration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For me intuitively the optimal time would be around one week until expiration because the option will loose most of it's time value in the last week (theta is highest).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for example when we look at the AAPL options and want to sell a ATM straddle on 8/15/2015:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Selling the Aug. 21 116 Straddle we would collect 1.56+1.57=3.13 premium.&lt;/li&gt;&#xA;&lt;li&gt;Selling the Sep. 11 116 Straddle we would collect 3.50+3.39=6.89 premium.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So basically I could collect about 1/2 of the premium in the last week, and then do another trade next week and collecting another 3 premium and so on, so why is it more optimal to sell a lower theta position? Also the longer to expiration position has 3 times more time to go in an unfavourable direction.&lt;/p&gt;&#xA;" OwnerUserId="16421" LastActivityDate="2015-08-15T02:26:07.970" Title="Option writing optimal sell time" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;short-selling&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19325" PostTypeId="1" AcceptedAnswerId="19326" CreationDate="2015-08-14T23:56:51.070" Score="1" ViewCount="204" Body="&lt;p&gt;I'm just wondering, if following an IPO the share price goes up and the underwriter calls the option, where do those extra 15% shares come from?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does the company have to issue more stock to cover the option, or are those stocks originally issued anyways but just not sold? (in which case, do they sell them afterwards?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And also, are Greenshoe options public information?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="17222" LastActivityDate="2015-08-15T00:57:55.253" Title="Where do Over-allotment (Greenshoe) option shares come from?" Tags="&lt;options&gt;&lt;equities&gt;&lt;call&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19326" PostTypeId="2" ParentId="19325" CreationDate="2015-08-15T00:57:55.253" Score="2" Body="&lt;p&gt;Yes, the greenshoe option, technically called overallotment option is described in the prospectus.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yes, in the event the greenshoe option is exercised by the underwriters, the company issues additional shares and receives additional proceeds. Essentially it is as though a small secondary offering took place.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-08-15T00:57:55.253" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19327" PostTypeId="2" ParentId="19324" CreationDate="2015-08-15T02:26:07.970" Score="1" Body="&lt;p&gt;If you assume that IV of different expiration options is equal, then it mathematically follows that you are correct. Weeklies would give you the maximum theta decay. That is the theoretical answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, you may not have weeklies on every stock or index and you might have them but they trade too thinly. Wide bid/ask spreads etc. Also sometimes there will be a sizable skew between the expirations and you would want to sell the higher one.&lt;/p&gt;&#xA;" OwnerUserId="7973" LastActivityDate="2015-08-15T02:26:07.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19328" PostTypeId="2" ParentId="19282" CreationDate="2015-08-15T09:32:45.097" Score="0" Body="&lt;p&gt;there are has been a lot of papers on the analysis of the convergence of binomial trees for European options. You can regard a tree as an explicit finite difference method. The conclusions are that the location of the nodes near the strike determine the error. So if $\kappa$ is the fraction of the distance between the strike and the lower node as opposed to the distance between them, you get an asymptotic expansion whose coefficients are functions of $\kappa. $ (see Diener-Diener). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can avoid the issue by adapting the tree to the strike so that $\kappa$ is constant. Similarly for PDEs. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-08-15T09:32:45.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19329" PostTypeId="1" CreationDate="2015-08-15T10:33:14.410" Score="1" ViewCount="357" Body="&lt;p&gt;Hey everyone and I hope that there are some smarter people out here that can help me out with my problem...:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have trouble with my implementation of a GARCH(1,1) model and I do not know how to move forward:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My data in MATLAB consists of returns (with no NaN Values) and I am performing rolling regressions on a 60 month basis. So the return column vector I create is of the form (60,1) for each asset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I now define my GARCH model:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Mdl = garch(1,1);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and now when I try to estimate the model using the data I unfortunately cannot move forward:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;EstMdl = estimate(Mdl,return_vector);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;as MATLAB returns the error message:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Estimated GARCH model is invalid.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Caused by: Error using garch/validateModel (line 782) Non-zero degree&#xA;  P requires a non-zero degree Q.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I guess I could even provide more info on my data:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found this piece of code online which works perfectly:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;load Data_MarkPound&#xA;r  = price2ret(Data);&#xA;pR = 100*r;&#xA;T  = length(r);&#xA;Mdl = garch(1,1);&#xA;EstMdl = estimate(Mdl,pR);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;now, the only difference in my opinion is the length of the returns (and the fact that they have been created with the price2ret function and mine are directly from CRSP) now, the data of one of the stocks that I have issues with are as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have now noticed that for some assets the GARCH estimation works, however it delivers unplausible results such as ARCH and GARCH values of -0.6 and -0.6. Also in the cases where the GARCH model does not work, I am able to use a eGARCH. This as well delivers disillusional results as above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have come to the conclusion, that my returns need to be transformed somehow, but I do not know what the exact problem is....&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I really really appreciate any help!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you guys so much already!&lt;/p&gt;&#xA;" OwnerUserId="17227" LastActivityDate="2015-08-15T10:33:14.410" Title="GARCH estimation does not work, error in my returns?" Tags="&lt;volatility&gt;&lt;finance&gt;&lt;garch&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19330" PostTypeId="1" CreationDate="2015-08-15T12:42:41.200" Score="2" ViewCount="124" Body="&lt;p&gt;The author Malz states the future value of the firm's debt under the Merton model can be found from: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;D_{t} = D - \max(D - A_{t} , 0) &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(where $D$ is the par value of the debt, $A_{t}$ is the current value of the firm's assets)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that according to the model, the value of the debt can be modeled as a simultaneous position in a risk-less bond with face value of the risky debt discounted using the risk free rate and a short put on the firm's assets with a strike of the value of the debt. If the asset value is below the value of the debt at maturity, the payoff is max(asset value, 0).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How then do we get $D_{t} = D - \max(D - A_{t}, 0)$ ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can see $D_{t} = \min(D, \max(A_{t}, 0))$ but not $D_{t} = D - \max(D - A_{t}, 0)$ &lt;/p&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="18977" LastEditDate="2016-01-13T16:24:19.810" LastActivityDate="2016-01-13T16:24:19.810" Title="Future value of the debt under Merton model" Tags="&lt;credit-risk&gt;&lt;merton-model&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19331" PostTypeId="1" AcceptedAnswerId="19380" CreationDate="2015-08-15T12:56:54.613" Score="12" ViewCount="795" Body="&lt;p&gt;&lt;a href=&quot;http://www.cbsnews.com/news/the-man-who-figured-out-madoffs-scheme-27-02-2009/&quot;&gt;http://www.cbsnews.com/news/the-man-who-figured-out-madoffs-scheme-27-02-2009/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Asked how long it took him to figure out something was wrong,&#xA;  Markopolos said, &quot;It took me five minutes to know that it was a fraud.&#xA;  It took me another almost four hours of mathematical modeling to prove&#xA;  that it was a fraud. &quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="6190" LastEditorUserId="12" LastEditDate="2015-08-18T17:20:42.547" LastActivityDate="2015-08-23T08:24:21.333" Title="What mathematical models did Harry Markopolos run to prove that Bernie Madoff 1% a month gain was a Ponzi scheme?" Tags="&lt;quant-trading-strategies&gt;&lt;backtesting&gt;&lt;option-strategies&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19332" PostTypeId="1" CreationDate="2015-08-15T15:04:52.207" Score="0" ViewCount="799" Body="&lt;p&gt;What is the difference between RWH and EMH?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In efficient market, the price will be fully reflected by available information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there is no news, the price would be unchanged.&#xA;If there is a news, the price would immediately adjust to a new price reflecting the price. &#xA;This is the same as the idea of RWH.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it is not necessary for efficient efficient market to have random walk prices.&#xA;I do not totally understand the difference between two hypothesis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, when will the stock prices follow martingale property in efficient market?&#xA;Only in risk-neutrality? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which one is the better model for EMH?&lt;/p&gt;&#xA;" OwnerUserId="17229" LastActivityDate="2015-08-15T15:34:10.210" Title="Is the stock price process a martingale or a random walk in efficient markets?" Tags="&lt;martingale&gt;&lt;random-walk&gt;&lt;emh&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19333" PostTypeId="1" AcceptedAnswerId="19334" CreationDate="2015-08-15T15:22:08.553" Score="4" ViewCount="222" Body="&lt;p&gt;In a recent ft.com video an analyst mentioned that markets postponed their Fed rate hike expectation from September to around November 2015 due to the CNY devaluation, based on the &quot;shift&quot; of some &quot;futures&quot; curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which future rate curve predicts(reflect) rate hike expectations and please include a real-time updated link to that curve?&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2015-08-16T18:41:33.440" LastActivityDate="2015-08-16T18:41:33.440" Title="U.S. Rate Hike Prediction" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;fx&gt;&lt;futures&gt;&lt;forward-rate&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19334" PostTypeId="2" ParentId="19333" CreationDate="2015-08-15T15:29:55.850" Score="5" Body="&lt;p&gt;The CME' Fed Fund Futures are what you are looking for. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cmegroup.com/trading/interest-rates/stir/30-day-federal-fund.html&quot;&gt;http://www.cmegroup.com/trading/interest-rates/stir/30-day-federal-fund.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On settlement day they settle at the average overnight rate set by the Fed during the contract month. &lt;/p&gt;&#xA;" OwnerUserId="5940" LastActivityDate="2015-08-15T15:29:55.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19335" PostTypeId="2" ParentId="19332" CreationDate="2015-08-15T15:34:10.210" Score="1" Body="&lt;p&gt;EMH: An asset always trades at its fair value. That is, all information is continuously being priced in. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;RWH: The asset price is not predictable and follows a random walk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So RWH is a hypothesis which is consistent with EMH. If every piece of information is being priced in continuously, and you cannot predict what information will become available, then from your standpoint the price follows a random walk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On martingales: The stock itself is never a martingale in an efficient market. That is a popular misconception. If that were true, the risk premium for the stock would be negative and you would invest in riskless assets instead. Even the &lt;em&gt;discounted&lt;/em&gt; stock price shouldn't be a martingale, because, again, that would imply that the risk premium is 0 and again the riskless asset would be a better choice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the discounted stock price under risk-neutral dynamics is a martingale if the market is arbitrage-free.&lt;/p&gt;&#xA;" OwnerUserId="7555" LastActivityDate="2015-08-15T15:34:10.210" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19336" PostTypeId="1" AcceptedAnswerId="19337" CreationDate="2015-08-15T18:51:59.490" Score="1" ViewCount="228" Body="&lt;p&gt;We know that under certainty, any increasing monotone transformation of a utility function is also a utility function representing the same preferences. Under uncertainty, we must restrict this statement to linear transformations if we are to keep the same preference representation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the problem is that I don't know how to give to this concept a mathematical and a economic explanation. I know that Von Neumann - Morgenstern utility function is used in these cases, but what this means? Can anybody help me, maybe give me an exhausting and understandable reference? Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="16045" LastActivityDate="2015-08-16T00:00:01.503" Title="Expected Utility" Tags="&lt;utility-theory&gt;&lt;self-study&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19337" PostTypeId="2" ParentId="19336" CreationDate="2015-08-15T19:12:47.273" Score="2" Body="&lt;p&gt;The best explanation I came across so far is the one in &lt;a href=&quot;http://catalogue.pearsoned.co.uk/catalog/academic/product?ISBN=0582404878&quot; rel=&quot;nofollow&quot;&gt;Gravelle and Rees (2003) chapter 17&lt;/a&gt;. I could exactly write here what they state, but that would be copying.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="848" LastEditDate="2015-08-15T20:41:36.453" LastActivityDate="2015-08-15T20:41:36.453" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19338" PostTypeId="1" CreationDate="2015-08-15T21:41:56.470" Score="5" ViewCount="1040" Body="&lt;p&gt;I am currently working on comparing different models for modelling the volatility and then pricing vanilla options (I use option prices on real stocks in order to calibrate my models and then I compare them). I already implemented the Heston model (close form formula and Monte-Carlo) and the SABR models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering if you have any ideas of which stochastic volatility models I can also use (if you have any paper about recent models for example). I have heard about Jacobi model but I was not able to find anything about this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had also in mind to compare with the result I obtain from the SVI model but as it is not really a stochastic volatility model, I would like to find something else I can work on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance for your ideas !&lt;/p&gt;&#xA;" OwnerUserId="16862" LastActivityDate="2019-06-02T21:22:43.080" Title="Ideas about Stochastic volatility models" Tags="&lt;volatility&gt;&lt;stochastic-processes&gt;&lt;modeling&gt;&lt;models&gt;&lt;heston&gt;" AnswerCount="2" CommentCount="11" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19340" PostTypeId="1" CreationDate="2015-08-15T22:24:02.160" Score="10" ViewCount="2055" Body="&lt;p&gt;In Pairs Trading by Vidyamurthy, on page 83 (and throughout the book), the author describes an elementary example of trading with log prices. The long run equilibrium of the basic portfolio is given by &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \log(p_t^A) - \gamma \log(p_t^B) = \mu $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $p_t^A$ and $p_t^B$ represent the prices of stocks $A$ and $B$ at time $t$, respectively, and $\gamma$ is the cointegration coefficient. When using these log prices, Vidyamurthy uses the cointegration coefficient ($\gamma$) to indicate the ratio of &lt;strong&gt;shares&lt;/strong&gt; to hold rather than &lt;strong&gt;market values&lt;/strong&gt; of positions (&lt;a href=&quot;http://epchan.blogspot.com/2013/11/cointegration-trading-with-log-prices.html&quot; rel=&quot;noreferrer&quot;&gt;as stated should be the case here&lt;/a&gt;, for example).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions are:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;What is the correct practical interpretation of $\gamma$ when cointegrating log prices, should it represent the ratio of &lt;strong&gt;shares&lt;/strong&gt; or the ratio of &lt;strong&gt;market values&lt;/strong&gt;? If the latter, why does Vidyamurthy use the former interpretation throughout his book? Could both be valid?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Here is the example from the book:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/PeZPs.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/PeZPs.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2812" LastActivityDate="2019-08-27T21:02:50.407" Title="What does the cointegration coefficient represent in pairs trading when cointegrating log stock prices?" Tags="&lt;cointegration&gt;&lt;pairs-trading&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="19341" PostTypeId="2" ParentId="19336" CreationDate="2015-08-15T22:45:16.477" Score="1" Body="&lt;p&gt;Under uncertainty we have to deal with &quot;lotteries&quot; where for example with 75% chance you get A and with 25% chance you get B and you have to compute expected utility 0.75*U(A)+0.25*U(B). It is clear that transformations of the utility function are going to create problems (i.e. different outcomes) unless they are linear.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2015-08-16T00:00:01.503" LastActivityDate="2015-08-16T00:00:01.503" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19342" PostTypeId="1" CreationDate="2015-08-16T00:41:32.500" Score="4" ViewCount="5022" Body="&lt;p&gt;Embedded in this thread are multiple questions.  I'm currently im the process of implementing a DCC GARCH forecast model on quantopian (a python-powered trading platform).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The two step consists of first estimating the conditional volatility over time $D_t$ (as canonicalized by Engle).  I apply the traditional log-likelihood with the minimize function from scipy package.  For 2nd step, it is the same except I run into a bit of ambiguity:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the log-likelihood for the 2nd step $L(\phi|\hat{\theta})\propto \sum_{t=1}^{T}log(|R_{t}|)+\epsilon_t^{'}R_t^{-1}\epsilon_t$.  The first term evaluates to an N by N matrix while the second term evaluates to a scalar.  Thus, the likelihood for each timestep is an N by N matrix.  In implementation, only a scalar is expected to be return, do I just sum all the terms in $log(|R_t|)$ when calculating the actual likelihood?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, the current time it takes for the minimize function to converge takes too long, any advice on faster estimation techniques is appreciated.&lt;/p&gt;&#xA;" OwnerUserId="11888" LastActivityDate="2020-04-10T20:34:07.713" Title="2-step estimation of DCC GARCH model in Python" Tags="&lt;volatility&gt;&lt;time-series&gt;&lt;garch&gt;&lt;estimation&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19344" PostTypeId="1" CreationDate="2015-08-16T09:16:46.230" Score="12" ViewCount="7619" Body="&lt;p&gt;I've read the following &lt;a href=&quot;http://arxiv.org/pdf/1204.0646.pdf&quot;&gt;paper&lt;/a&gt; by Gatheral and Jacquier and have several question regarding the calibration of a volatility surface in a arbitrage free way and some theoretical aspects. Let me first introduce some notation. They define the log strike as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$k:=\log{\frac{K}{F}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $F$ denotes the forward. Moreover, $\sigma_{BS}(k,t)$ denotes the implied Black-Scholes volatility with strike $k$ and maturity $t$ and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$w(k,t):=\sigma_{BS}^2(k,t)t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the so called total implied variance. With $\theta_t:=\sigma_{BS}^2(0,t)t$ we denote the at the money implied total variance. What follows they present different parametrization of a single slice in the surface, i.e. not depending on $t$. My first question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;1. Question:&lt;/strong&gt; &lt;em&gt;Why do they authors use the total implied variance instead of the directly observable $\sigma_{BS}(k,t)$ for the parametrization? Is there any advantage / meaning of that? Naturally, I would fit a model to the implied volatility&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are three parametrizations of a single surface slide:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;raw SVI:&lt;/strong&gt; For a parameter set $\xi_R:=\{a,b,\rho,m,\sigma\}$ the raw parametrization is given by: $$ w(k,\xi_R):=a+b\left(\rho(k-m)+\sqrt{(k-m)^2+\sigma^2}\right)$$&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;natural SVI:&lt;/strong&gt; For a parameter set $\xi_N:=\{\Delta,\mu,\rho,\omega,\zeta\}$ the natural parametrization is given by: $$ w(k,\xi_N):=\Delta+\frac{\omega}{2}\left(1+\zeta\rho(k-\mu)+\sqrt{(\zeta(k-\mu)+\rho)^2+(1-\rho^2)}\right)$$&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;SVI Jump Wings (SVI_JW):&lt;/strong&gt; For a given time to expiry $t &amp;gt;0$ and a parameter set $\xi_J:=\{v_t,\psi_t,p_t,c_t,\tilde{v_t}\}$ the SVI-JW&#xA;parametrization is given in raw SVI parameters: $$\begin{align}&#xA;v_t &amp;amp;= \frac{a+b\left(-\rho m+\sqrt{m^2+\sigma^2}\right)}{t}\\&#xA;\psi_t &amp;amp;=\frac{b}{2\sqrt{w_t}}\left(-\frac{m}{\sqrt{m^2+\sigma^2}}+\rho\right)\\&#xA;p_t &amp;amp;= \frac{b}{\sqrt{w_t}}(1-\rho)\\&#xA;c_t &amp;amp;= \frac{b}{\sqrt{w_t}}(1+\rho)\\&#xA;\tilde{v_t} &amp;amp;= \frac{1}{t}\left(a+b\sigma\sqrt{1-\rho^2}\right)\\&#xA;\end{align}$$&#xA;where $w_t:=v_tt$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2. Question:&lt;/strong&gt; &lt;em&gt;Why is it an advantage of having a dependency on time to expiration $t$ in the SVI-JW parametrization? As far as I see, you still fit the model to a given slice in all of the above parametrization, that is: You fix time to expiry and fit the model to the observed quotes. So that you could also introduce a time to expiry parameter in the raw/natural SVI.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The authors introduce now a new parametrization for a complete surface, the SSVI.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;SSVI:&lt;/strong&gt; For a smooth function $\phi$ (with some additional properties)  the SSVI parameterization is given by: $$ w(k,\theta_t):=\frac{\theta_t}{2}\left(1+\rho\phi(\theta_t)k+\sqrt{(\phi(\theta_t)k+\rho)^2+(1-\rho^2)}\right)$$&#xA;a common choice is $\phi(\theta) = \frac{\eta}{\theta^\gamma(1+\theta)^{1-\gamma}}$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;They are translations how to convert one parametrization to another.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;3. Question:&lt;/strong&gt; &lt;em&gt;Is it correct that the SSVI tries to fit a whole surface not just a single slice at once?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My last question is more about the actual calibration. For the raw and natural parametrization you would try to find optimal parameters so that $$\sum_{i=1}^n(w(k_i,\xi_R)-w(k_i)_{market})^2$$&#xA;is minimized, where $w(k_i)_{market}$ are observed market quotes (calculated from $\sigma_{BS}$) for strike $k_1,\dots,k_n$ for a fixed time to expiry $t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now for the SSVI, if its really about fitting the whole surface, what function are you minimizing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sum_{t_i}\left(\sum_{i=1}^n(w(k_i,\theta_{t_i})-w(k_i,t_i)_{market})^2\right)$$&#xA;where you also sum over the maturities?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;4. Question:&lt;/strong&gt; &lt;em&gt;How does the minimization function for the SSVI look like? It seems that the authors are using still for a fixed time to expiry $t_i$ a slice parametrization and then compare it with previous / next slice, run additional calibration if needed to avoid calendar spread arbitrage. See page 21 &quot;An example SVI calibration recipe&quot;&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="17133" LastActivityDate="2015-09-08T21:13:40.213" Title="How to calibrate a volatility surface using SVI" Tags="&lt;volatility&gt;&lt;calibration&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="19345" PostTypeId="2" ParentId="19338" CreationDate="2015-08-16T14:18:11.283" Score="3" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S0167947305000332?np=y&quot; rel=&quot;nofollow noreferrer&quot;&gt;Comparing stochastic volatility models through Monte Carlo simulations(2006)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.springer.com/us/book/9783642018077&quot; rel=&quot;nofollow noreferrer&quot;&gt;Applications of Fourier Transform to Smile Modeling(2010)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ta.twi.tudelft.nl/mf/users/oosterle/oosterlee/SZHW.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Extension of Stochastic Volatility Equity Models with&#xA;Hull-White Interest Rate Process&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.mathnet.or.kr/mathnet/thesis_file/02_B08-109.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Comparison Of Stochastic Volatility Models.&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The second reference is very good in this context. I hope you can download it.&lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastEditorUserId="16595" LastEditorDisplayName="user16891" LastEditDate="2019-06-02T21:22:43.080" LastActivityDate="2019-06-02T21:22:43.080" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="19346" PostTypeId="1" CreationDate="2015-08-16T18:39:30.057" Score="5" ViewCount="2578" Body="&lt;p&gt;The EMH states that stocks are traded at its fair values.&#xA;This means there is no arbitrage strategy in efficient markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if the market is no arbitrage, can we conclude the market is efficient?&#xA;I am confused about the relationship between these two.&#xA;Can someone give a example that satisfies NO arbitrage but not the EMH?&lt;/p&gt;&#xA;" OwnerUserId="17239" LastActivityDate="2015-10-19T08:48:53.677" Title="Does No arbitrage(NA) imply efficient markets (EMH)?" Tags="&lt;stochastic-processes&gt;&lt;no-arbitrage-theory&gt;&lt;emh&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19347" PostTypeId="2" ParentId="19346" CreationDate="2015-08-16T19:04:40.727" Score="0" Body="&lt;p&gt;It seems reasonable that no-arbitrage doesn't necessarily imply EMH. If we are talking pure arbitrage opportunities, like offsetting the same contract on 2 exchanges, futures cash and carry, BS options no-arbitrage, etc. Mainly, for derivative products it's very easy to do the arbitrage trade. However, this means that you are assuming the underlying product is priced at fair-value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in theory you could have some person who is beating the index by buying /selling products not priced at fair value. However, you can still satisfy the no-arbitrage property by correctly pricing all the derivatives on that product.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are many more examples that could satisfy no-arbitrage and not EMH.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For what it's worth the weak EMH is a plausible claim. In this case the no-arbitrage clause would be easily satisfied. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The semi-strong EMH doesn't make sense in practice. For a market to adjust prices to new information instantaneously is impossible. Information would have to dissipate from it's source to every other market participant simultaneously. Since current technology doesn't allow for this we end up with a some participants being fast, and others being slow. The fast guys end up making their money from this inefficiency, even if it only lasts for microseconds.&lt;/p&gt;&#xA;" OwnerUserId="5940" LastActivityDate="2015-08-16T19:04:40.727" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19348" PostTypeId="1" CreationDate="2015-08-16T20:45:31.257" Score="1" ViewCount="132" Body="&lt;p&gt;I tried this on stack exchange, but think it is a better question here. I am beginning user and I need help with an error / bad output I am getting when calculating returns (using ROC) on stock closing prices. I created a trading strategy using 1,0,-1 as signals, but can't return an accurate percentage for my returns. I know the code is incorrect, but unsure how to correct it. Any help is much appreciated! &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sum(ROC(Cl(x)) * x$signal, na.rm=TRUE) # Return of fully invested account&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This returns: -0.004259766&#xA;Where, based on my strategy, it actually should be: 0.101174&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Calculating this using: (88.16-80.06) / 80.06&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; Date        Closing Price Signal &#xA; 2015-03-06:     80.06        1 # enter trade&#xA; 2015-05-12:     88.16       -1 # exit trade&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hopefully that helps clarify my question. If not, please leave comments on how to improve it further. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Find sample code below: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;getSymbols(&quot;CAT&quot;, src=&quot;google&quot;, from=&quot;2014-07-30&quot;, to=&quot;2015-07-29&quot;)&#xA;&#xA;#######################################&#xA;######### BOLLINGER BANDS #############&#xA;#######################################&#xA;&#xA;x &amp;lt;- na.omit(merge(CAT, BBands(Cl(CAT))))&#xA;x$sig &amp;lt;- NA&#xA;&#xA;x$sig[c(FALSE, diff(sign(Cl(x) - x$mavg), na.pad=FALSE) != 0)] &amp;lt;- 0&#xA;x$sig[Cl(x) &amp;gt; x$up] &amp;lt;- -1 # short when Close is above up&#xA;x$sig[Cl(x) &amp;lt; x$dn] &amp;lt;- 1 # long when Close is below dn&#xA;x$sig[1] &amp;lt;- 0 # flat on the first day&#xA;    x$sig[nrow(x)] &amp;lt;- 0 # flat on the last day&#xA;&#xA;# Fill in the signal for other times&#xA;x$sig &amp;lt;- na.locf(x$sig) &#xA;x$sig &amp;lt;- Lag(x$sig)&#xA;x$sig[1] &amp;lt;- 0 &#xA;&#xA;#######################################&#xA;############ STOCHASTICS ##############&#xA;#######################################&#xA;&#xA;y &amp;lt;- na.omit(merge(CAT, stoch(Cl(CAT))))&#xA;y$diff &amp;lt;- y$fastK - y$slowD&#xA;    y$sig &amp;lt;- ifelse(y$diff &amp;gt;= -.1 &amp;amp; y$diff &amp;lt;= .1,1,0)&#xA;y$sig &amp;lt;- Lag(y$sig)&#xA;y$sig[1] &amp;lt;- 0 &#xA;&#xA;#######################################&#xA;############### MACD ##################&#xA;#######################################&#xA;&#xA;z &amp;lt;- na.omit(merge(CAT, MACD(Cl(CAT))))&#xA;z$diff &amp;lt;- z$macd - z$signal&#xA;    z$sig &amp;lt;- ifelse(z$diff &amp;gt;= -0.1 &amp;amp; z$diff &amp;lt;= 0.1,1,0)&#xA;z$sig &amp;lt;- Lag(z$sig)&#xA;z$sig[1] &amp;lt;- 0 &#xA;&#xA;#######################################&#xA;################ MERGE ################&#xA;#######################################&#xA;&#xA;all &amp;lt;- merge(x$sig,y$sig,z$sig)&#xA;    all[is.na(all)] &amp;lt;- 0&#xA;    all &amp;lt;- cbind(all,rowSums(all))&#xA;    all$..2 &amp;lt;- all$sig*all$sig.1*all$sig.2;&#xA;&#xA;x$signal &amp;lt;- cbind(all$..2)&#xA;x$signal &amp;lt;- na.locf(x$signal)&#xA;x$signal &amp;lt;- Lag(x$signal)&#xA;x$signal[1] &amp;lt;- 1&#xA;&#xA;#######################################&#xA;######## $$$ RETURNS $$$ ##############&#xA;#######################################&#xA;&#xA;sum(abs(diff(x$signal, na.pad=FALSE))) # number of trades&#xA;    sum(diff(Cl(x)) * x$signal, na.rm=TRUE) # PnL of 1 share&#xA;cumsum(diff(Cl(x), na.pad=FALSE) * x$signal[-1]) # equity over time&#xA;&#xA;sum(ROC(Cl(x)) * x$signal, na.rm=TRUE) # Return of fully invested account&#xA;    cumsum(ROC(Cl(x), na.pad=FALSE) * x$sig[-1]) # cumulative return&#xA;&#xA;myReturn &amp;lt;- lag(x$signal) * dailyReturn(x)&#xA;charts.PerformanceSummary(cbind(dailyReturn(x),myReturn))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="17174" LastActivityDate="2015-08-16T20:45:31.257" Title="ROC -- Output from Calculating Stock Returns Producing Lower Numbers Than Actual" Tags="&lt;r&gt;&lt;quantmod&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19349" PostTypeId="1" CreationDate="2015-08-16T22:07:44.387" Score="3" ViewCount="1051" Body="&lt;p&gt;Recently, a modified Black-Scholes equation was proposed (&lt;a href=&quot;http://www.iaeng.org/publication/WCE2010/WCE2010_pp364-367.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Zheng&lt;/a&gt;), namely&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Gd4gS.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Gd4gS.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please consider the case when &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma \left( S,t \right) =\sigma\,{S}^{k/2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and with the European put option&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/8UilN.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/8UilN.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using Maple I am obtaining the following analytical solution in terms of the associated Laguerre polynomials&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/L5YUm.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/L5YUm.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Such solution can be used with Maple to compute the price for many instances of the European put option.&#xA;For example when $k=3$ the solution is (please do right click on the image to enlarge it)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/c9DjY.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/c9DjY.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and taking the first three terms in the series we have (please do right click on the image to enlarge it)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/7Z2B8.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/7Z2B8.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A numerical example.  Please consider the following values for the parameters&#xA;$$S=100,K=95,T=90/365,r=4/100, \sigma=0.5;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;using the standard Black-Scholes formula, the price of the put option is $6.9082$; and using my formula with $300$ terms in the series, the price of the put option is $70.51873101$.  Assuming that the standard Black-Scholes formula underestimates the price of the put option and my formula overestimates the price of the put option, it is possible to fix the price of the put option near to the simple average between the two results, namely $38.5$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;I claim that such solution is new.  Do you agree?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I claim that such solution could have important applications in computational finance.  Do you agree?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="17216" LastEditorUserId="17216" LastEditDate="2015-08-17T16:42:53.487" LastActivityDate="2015-08-17T17:20:56.580" Title="Analytical solution for a modified Black-Scholes equation" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19350" PostTypeId="1" CreationDate="2015-08-17T08:10:51.447" Score="3" ViewCount="203" Body="&lt;p&gt;I'm new to this forum, this is the first question I posted. I have many candidate pairs and I've used ADF test to make a first selection. There are more than 800 selected. The pairs are absolutely too many. I'm thinking of other criteria to eliminate some of them. I've calculated the half-life and I want keep those who have low half-life, but all of them have a half-life less than 30 days(since all of them have passed the ADF test). Are there any other criteria which could select paris who have good mean reversion property? Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="17240" LastActivityDate="2019-04-15T09:05:45.253" Title="what are the criteria to select pairs?" Tags="&lt;time-series&gt;&lt;pairs-trading&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19351" PostTypeId="1" CreationDate="2015-08-17T08:28:04.053" Score="2" ViewCount="2545" Body="&lt;p&gt;I know Ho-Lee model and want to extract the price at $t$, of a&#xA;European call option with strike price $K$ and exercise date $T$, on an underlying&#xA;$S$-bond, but I don't know what way should I choose:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;PDE approach &lt;/li&gt;&#xA;&lt;li&gt;Risk Neutral Valuation&lt;/li&gt;&#xA;&lt;li&gt;Forward Measure&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Please Help me.So Thanks.&lt;/p&gt;&#xA;" OwnerUserId="17244" LastActivityDate="2015-08-17T21:56:27.687" Title="Bond price in Ho-Lee Model" Tags="&lt;option-pricing&gt;&lt;interest-rates&gt;&lt;bond&gt;&lt;risk-neutral-measure&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19352" PostTypeId="1" AcceptedAnswerId="19397" CreationDate="2015-08-17T09:15:17.383" Score="4" ViewCount="824" Body="&lt;p&gt;I am looking at a market neutral portfolio and have a question which I think is probably pretty simple.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I can see the individual stock weights.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;The sum of the longs is 0.83&#xA;The sum of the shorts is -0.78&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So the net weight is 0.05. The weight of the cash part is 0.95 giving a total weight of 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this normal for a market neutral or long short portfolio to have that much cash? I'm obviously missing something here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also have an addition question. I then see that with these weights they do the following manipulations to get 'fully invested portfolio', (the weights above summed to 1 so not quite following why the below is required).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; someMultiplier = 0.95 / sum of the longs (i.e 0.83)&#xA; someMultiplier = 1.144578&#xA; wgts = all wgts (excluding cash) * someMultiplier&#xA; cash = 1 - wgts&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What are they doing here? The cash value is approx 0.94&lt;/p&gt;&#xA;" OwnerUserId="7530" LastActivityDate="2015-08-24T13:09:52.477" Title="market neutral weights and cash values" Tags="&lt;portfolio-management&gt;&lt;portfolio-optimization&gt;&lt;portfolio-selection&gt;&lt;longshort&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19353" PostTypeId="1" AcceptedAnswerId="19361" CreationDate="2015-08-17T09:54:52.337" Score="1" ViewCount="511" Body="&lt;p&gt;The &lt;a href=&quot;https://quant.stackexchange.com/questions/19185/option-prices-in-bates-svj-model&quot;&gt;Bates model&lt;/a&gt; adds a Jump process to the Underlying. I understand this may represent observed time series more realistically, but why would one care about this in option pricing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The option price is just an expected value, which does not have any jump. I would think that adding jumps is just the same as increasing volatility.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-08-17T21:36:03.367" Title="Why Jumps in Option Pricing models?" Tags="&lt;stochastic-volatility&gt;&lt;jump&gt;&lt;bates&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19354" PostTypeId="2" ParentId="19353" CreationDate="2015-08-17T11:26:11.377" Score="1" Body="&lt;p&gt;Jumps are totally different from volatility. Imagine a stock whose price has jumps but has no volatility. The asset pricing implications for options on that stock are totally different than from a stock with volatility. Below I simulated 3 stock paths:&#xA;(i) Jumps and volatility, (2) Only Jumps  and (3) No jumps but higher volatility.&lt;/p&gt;&#xA;&lt;p&gt;As you can imagine the asset pricing implications are very different for each case - and increasing volatility is not the same as jumps.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/nqpaX.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/nqpaX.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2015-08-17T11:33:17.637" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="19355" PostTypeId="1" CreationDate="2015-08-17T14:05:54.333" Score="1" ViewCount="509" Body="&lt;p&gt;When valuing a vanilla option on an index (eg FTSE 100), should we take index dividend yield into account?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;c=Se^{-q\tau}N\left(d_1\right)-Ke^{-r\tau}N\left(d_2\right)&#xA;$$&#xA;$$&#xA;d_1=\frac{\ln\left(\frac{S}{K}\right)+\left(r-q+\frac{1}{2}\sigma^2\right)\tau}{\sigma\sqrt{\tau}}&#xA;$$&#xA;$$&#xA;d_2=d_1-\sigma\sqrt{\tau}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the above formulae, should $q$ be 0 or &quot;equivalent index dividend yield&quot; when $S$ is an index (eg FTSE 100)?&lt;/p&gt;&#xA;" OwnerUserId="6428" LastActivityDate="2015-08-27T19:42:02.953" Title="When valuing a vanilla option on an index, should we take dividend into account?" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;index&gt;&lt;dividends&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19356" PostTypeId="2" ParentId="19350" CreationDate="2015-08-17T14:15:29.050" Score="2" Body="&lt;p&gt;In no particular order here are some ideas to get you started.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Liquidity (ADV, # of shares, etc)&lt;/li&gt;&#xA;&lt;li&gt;Cost Basis (Cost to put on a trade)&lt;/li&gt;&#xA;&lt;li&gt;Back test / Cross validation&lt;/li&gt;&#xA;&lt;li&gt;P-values&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5940" LastActivityDate="2015-08-17T14:15:29.050" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19357" PostTypeId="1" AcceptedAnswerId="19368" CreationDate="2015-08-17T15:24:37.150" Score="8" ViewCount="2919" Body="&lt;p&gt;So Dirk Eddelbuettel, Whit Armstrong, and John Laing released Rblpapi to CRAN recently, and it is awesome. I'm having some difficulty understanding how the overrides work though, hopefully someone can help me out.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to import price returns from two indices, and want to do so using monthly data. W/out the periodicity override, it imports daily data fine. When I try and add an override to convert it to monthly data requests, I get an error.  In the python api the override command is periodicity. Is it the same in Rblpapi? Does anyone know how this is this designed to work in Rblpapi? Are the override names and values the same as in the BBG developer's guide? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a code sample and the resulting output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(Rblpapi)&#xA;&#xA;#initalize data import&#xA;end.dt = Sys.Date()&#xA;start.dt = as.Date(x = &quot;1995-03-31&quot;) #define start date&#xA;&#xA;&#xA;blpConnect() #connect to BBG, does not need to be closed&#xA;&#xA;#set import variables&#xA;index.growth = &quot;MXUS000G Index&quot; #define growth index&#xA;index.value = &quot;MXUS000V Index&quot; #define value index&#xA;&#xA;indices = c(index.growth,index.value)&#xA;&#xA;overrides.px = &quot;Monthly&quot;&#xA;names(overrides.px) = &quot;periodicity&quot;&#xA;&#xA;px = bdh(securities = indices,fields = &quot;px_last&quot;,start.date = start.dt,end.date = end.dt,&#xA;         overrides = overrides.px)&#xA;&#xA;Error: Choice sub-element not found for name 'securityData'.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="17245" LastEditorUserId="69" LastEditDate="2015-08-18T02:00:23.723" LastActivityDate="2016-09-21T14:56:29.157" Title="Change periodicity on Rblpapi" Tags="&lt;r&gt;&lt;programming&gt;&lt;finance&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19358" PostTypeId="2" ParentId="19351" CreationDate="2015-08-17T17:10:45.100" Score="3" Body="&lt;p&gt;We assume&#xA;$$dr_t=\alpha(t)dt+\beta dW_{t}^{\mathbb{Q}},$$ &#xA;and &#xA;$$dP(t,T)=r(t)P(t,T)dt+\Sigma(t,T)P(t,T)dW_{t}^{\mathbb{Q}},$$&#xA;in the Ho-Lee model,   bond prices are given by&#xA;$$P(t,T)=e^{A(t\,,\,T)-B(t\,,\,T)\,r_t}$$&#xA;where &#xA;\begin{align}&#xA;&amp;amp;B(t,T)=T-t\\&#xA;&amp;amp;A(t,T)=\frac{\beta^2}{2}\times\frac{(T-t)^3}{3}+\int_{t}^{T}\alpha(u)(u-T)du\,.&#xA;\end{align}&#xA;By application of Ito's lemma, we have&#xA; $$\Sigma(t,T)=-\beta\times(T-t)\,.$$ &#xA;Price at $t$ of a European call option with strike $K$ and exercise date $T$, on an underlying zero coupon $S-$bond is given by&#xA;$$C(t,T,K;S)=\mathbb{E^Q}\left[e^{-\int_{t}^{T}\,r_u du}\,\mathbb{max}\{P(T,S)-K\,,\,0\}\,|\,\mathcal{F}_t\right],$$&#xA;now we use change of measure,then&#xA;$$C(t,T,K;S)=P(t,T)\mathbb{E}^{\mathbb{Q}_T}\left[\mathbb{max}\{P(T,S)-K\,,\,0\}\,|\,\mathcal{F}_t\right].$$&#xA;let $Z(t)=\frac{P(t,S)}{P(t,T)}$.We assume that $Z(t)$ follows the Ito process as described by the following stochastic differential equation &#xA;$$dZ(t)=\{...\}dt+\sigma(t)Z(t)dW_{t}^{\mathbb{Q}}$$&#xA;We know $Z(t)$ is a martingale under forward measur $\mathbb{Q}_T$, thus we have&#xA;$$dZ(t)=\sigma(t)Z(t)dW_{t}^{\mathbb{Q}_T}.$$&#xA;We can also be written as&#xA;$$Z(t)=e^{A(t\,,\,S)-A(t\,,\,T)-[B(t\,,\,T)-B(t\,,\,T)]\,r_t}$$&#xA;By application of Ito's lemma, we have&#xA;$$\sigma(t)=-[B(t\,,\,T)-B(t\,,\,T)]=-\beta\times(S-T),$$&#xA;then&#xA;$$\ln Z(T)\sim N\left[\ln Z(t) - \frac{1}{2}\beta^2\,(S-T)^2(T-t)\,\, ,\beta^2\,(S-T)^2(T-t)\right]$$&#xA;on the other hand&#xA;\begin{align}&#xA;&amp;amp;P(t,T)\mathbb{E}^{\mathbb{Q}_T}\left[\mathbb{max}\{P(T,S)-K\,\,0\}\,|\,\mathcal{F}_t\right]=P(t,T)\mathbb{E}^{\mathbb{Q}_T}\left[ \mathbb{max}\left\{\frac{P(T,S)}{\underbrace{P(T,T)}_{1}}-K\,,\,0\right\}\,|\,\mathcal{F}_t\right]\\&#xA;&amp;amp;\\&#xA;&amp;amp;\hspace{7.8cm}=P(t,T)\,\mathbb{E}^{\mathbb{Q}_T}\left[max\{Z(T)-K\,,\,0\}|\,\mathcal{F}_t\right]\\&#xA;&amp;amp;\\&#xA;&amp;amp;\hspace{7.8cm}=P(t,T)[Z(t)\,N(d_1)-K\,N(d_2)]\\&#xA;&amp;amp;\\&#xA;&amp;amp;\hspace{7.8cm}=P(t,S)\,N(d_1)-K\,P(t,T)\,N(d_2)\\&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&#xA;$$d_1=\frac{\ln \frac{P(t,S)}{K\,P(t,T)}+\frac{1}{2}\beta^2\,(S-T)^2(T-t)}{\beta\,(S-T)\sqrt{T-t}}$$&#xA;and&#xA;$$d_2=d_1-\beta\,(S-T)\sqrt{T-t}$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16891" LastEditorDisplayName="user16891" LastEditDate="2015-08-17T21:56:27.687" LastActivityDate="2015-08-17T21:56:27.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19359" PostTypeId="2" ParentId="19349" CreationDate="2015-08-17T17:20:56.580" Score="2" Body="&lt;p&gt;The term of art in our industry for this type of option pricing formula is a &lt;em&gt;series solution&lt;/em&gt;.  As Farahvartish indicates in the comments, a series solution is not considered to be an &quot;analytical solution&quot; due to the reliance on a converging infinite sum for actual numeric output.(*)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Series solutions have been employed at least since the 1990s, when they were used along with the reflection principle to estimate prices of options with knock-out features.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More specific to your case, &lt;a href=&quot;http://faculty.chicagobooth.edu/dacheng.xiu/research/Expansion.pdf&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt; also gives a series solution for option prices with volatility dependent on asset level.  It is more general than your formula above, though it uses Hermite polynomials rather than Laguerre.  In it, Xiu allows for $\sigma(S)$ to be any function whose reciprocal is Lebesgue integrable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Note: I have not checked your result or the Xiu paper for correctness)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(*) I might add that the attitude about series solutions versus analytical solutions is logically inconsistent in practice, since the cumulative distribution function $N(\cdot)$ of the standard gaussian is numerically obtained from a series expansion in Legendre polynomials. &lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2015-08-17T17:20:56.580" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19360" PostTypeId="1" CreationDate="2015-08-17T18:06:35.410" Score="2" ViewCount="266" Body="&lt;p&gt;&lt;a href=&quot;http://pages.stern.nyu.edu/~xgabaix/papers/powerLaws.pdf&quot; rel=&quot;nofollow&quot;&gt;Power law&lt;/a&gt; basically states that after a certain threshold, probability distribution $p(x)\sim c\,x^{a}$ where $x &amp;gt; x_{min}$, which is often the case for financial time series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is also generally advised that estimation of parameter a is difficult as data in the tail is sparse. Can someone refer me to any application of power law in a trading context? E.g prediction of large returns, trading strategies, etc.&lt;/p&gt;&#xA;" OwnerUserId="5861" LastEditorDisplayName="user16891" LastEditDate="2015-08-18T07:11:01.263" LastActivityDate="2015-08-18T07:11:01.263" Title="Is there any application of power law to predict large returns?" Tags="&lt;quant-trading-strategies&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19361" PostTypeId="2" ParentId="19353" CreationDate="2015-08-17T18:27:16.103" Score="2" Body="&lt;p&gt;The problem is that what some mean when they say &quot;volatility&quot; is BS implied vol from an option price. What some others mean when they say &quot;volatility&quot; is some diffusion parameter from a drift diffusion model (with or without jumps). These are the same value in the log normal model of stock prices but different for many other models including those with jumps. Therefore, a model with jumps would have a higher option implied volatility as mention by @Farahvartish in the comments, but it may have its own diffusion parameter which could be called volatility that would be lower than the option implied volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer your question as to why anyone would care about better modelling, it comes down to arbitrage and hedging portfolios. If I can better price and hedge an option position than you can, I can make money from inconsistent pricing in the market.  &lt;/p&gt;&#xA;" OwnerUserId="4910" LastActivityDate="2015-08-17T18:27:16.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19362" PostTypeId="1" CreationDate="2015-08-17T19:12:34.750" Score="3" ViewCount="624" Body="&lt;p&gt;I'm using daily settlement data to get yield levels for a couple of products. From this data I am doing PCA on a rolling collection of the yield levels. I have been using sci-kit learn's PCA function, but I also see the issue when doing my own PCA through Numpy. So as far as I know it's not an issue of the libraries. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After I get the vectors I solve the linear equations such that the first two principle components sum to 0. This is done by setting one of the weights = 1.0&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example. &#xA;I have data for 150 settlements and I calculate the PC's using data from day 0-100, then I recalculate 10 days later on data 10-110, etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I do this I get a graph of the PC's&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/osVKG.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/osVKG.png&quot; alt=&quot;Graph of PC&amp;#39;s&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And here are the corresponding weights.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/wyXIH.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/wyXIH.png&quot; alt=&quot;Weights&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Relevant math:&#xA;After performing the PCA I get the components matrix&#xA;$~ \left( \begin{array}{ccc}&#xA;a &amp;amp; b &amp;amp; c \\&#xA;d &amp;amp; e &amp;amp; f \\&#xA;g &amp;amp; h &amp;amp; i \end{array} \right) $&#xA;From here I take the first two vectors $[a, b, c]$ and $[d, e, f]$.&#xA;Which I then turn into the equation $Ax = B$ that looks something like this&#xA;$~ \left( \begin{array}{ccc}&#xA;a &amp;amp; c \\&#xA;d &amp;amp; f \end{array} \right) &#xA;\left(\begin{array}{ccc}&#xA;x_1 \\&#xA;x_3 \end{array} \right) = &#xA;\left(\begin{array}{ccc}&#xA;b \\&#xA;e \end{array} \right)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see the $x_1$, $x_3$ weights start to blow up at some point which doesn't really make sense given the nature of the data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anybody have any insight to my problem?&lt;/p&gt;&#xA;" OwnerUserId="5940" LastActivityDate="2018-02-07T10:17:34.917" Title="Weights Blowing up in PCA" Tags="&lt;interest-rates&gt;&lt;statistics&gt;&lt;yield-curve&gt;&lt;pca&gt;&lt;yield&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19363" PostTypeId="1" CreationDate="2015-08-17T20:57:14.230" Score="2" ViewCount="135" Body="&lt;p&gt;The basket of corporate bonds that I am following barely traded after the issuance. Hence, there is no historical data to estimate the volatility. Can you suggest me a different approach to come up with a risk related measure. The market is really small and there are not many similar bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="17250" LastActivityDate="2015-08-17T21:27:08.027" Title="How to measure the volatility of illiquid bond with no historical prices" Tags="&lt;volatility&gt;&lt;fixed-income&gt;&lt;risk&gt;&lt;value-at-risk&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19364" PostTypeId="2" ParentId="19363" CreationDate="2015-08-17T21:27:08.027" Score="2" Body="&lt;p&gt;The best solution is to matrix-price these bonds first. For each bond, either find a comparable bond or use your own judgment to determine the appropriate spread to a benchmark curve (e.g., OAS to LIBOR), then use the daily LIBOR curve and the corresponding OAS to obtain the daily prices.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2015-08-17T21:27:08.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19365" PostTypeId="2" ParentId="19353" CreationDate="2015-08-17T21:36:03.367" Score="2" Body="&lt;p&gt;Diffusion brings about a standard deviation which increases with the square root of time (just like in Brownian motion), while jumps add variability proportional to time (since the jump times are a Poisson process). So they are quite different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Experience shows that sharp stock market moves do occur (in connection with big news events for example), so modeling both a diffusion component and a jump component (as Merton 1976 did) can be worthwhile.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2015-08-17T21:36:03.367" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19366" PostTypeId="1" CreationDate="2015-08-17T23:37:30.807" Score="0" ViewCount="2301" Body="&lt;p&gt;Let's say you want to measure intra day autocorrelation from 9:30 am to 1pm using 5-minute prices should you calculate the autocorrelation using raw prices or log returns (i.e. diff(log(prices)))?&#xA;Can you explain?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is an example showing using price recognizes high serial autocorrelation in the price while log returns does not recognize it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;set.seed(12345)&#xA;###auto correlation in price&#xA;r =rep(seq(1,20,1),20)&#xA;plot(r,type='l')&#xA;acf(r, lag.max= 1)$acf #this DOES recognize the price dynamics of high serial correlation for runs of 20 at a time&#xA;arima(r, c(1,0,0))&#xA;&#xA;&#xA;### autocorrelation in log returns&#xA;r =diff(log(rep(seq(1,20,1),20)))&#xA;plot(r,type='l')&#xA;acf(r, lag.max= 1)$acf   #this DOES NOT recognize the price dynamics of high serial correlation for runs of 20 at a time&#xA;arima(r, c(1,0,0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="16923" LastEditorUserId="16923" LastEditDate="2015-08-17T23:54:34.213" LastActivityDate="2015-08-18T01:15:13.353" Title="When measuring autocorrelation should you use log returns or prices?" Tags="&lt;correlation&gt;&lt;auto-correlation&gt;&lt;log-returns&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19367" PostTypeId="2" ParentId="19366" CreationDate="2015-08-18T01:15:13.353" Score="2" Body="&lt;p&gt;The high serial correlation you are getting in the first case is a spurious correlation. The correct way to do it is with returns. The price series has a unit root. You need to take diff(log(prices))) in order to have a stationary time series, on which you can then estimate autocorrelations, auto regressive coefficients, etc. properly. This was shown by Granger and Newbold in their paper 'Spurious Regression in Econometrics' (1974).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To test this yourself, generate uncorrelated returns yourself by monte carlo and the corresponding prices. Compute the correlation both ways. The return correlations will be near zero [correctly so], the price correlations  will be biased and will often appear to be significantly different from zero.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-08-18T01:15:13.353" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19368" PostTypeId="2" ParentId="19357" CreationDate="2015-08-18T02:54:28.383" Score="6" Body="&lt;p&gt;At first we considered it to be a bug where the &lt;code&gt;overrides&lt;/code&gt; does not propagate correctly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit:&lt;/em&gt;  Here is a corrected examples, thanks to @Sid. Setting it as an &lt;code&gt;options&lt;/code&gt; field works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(Rblpapi)&#xA;blpConnect()&#xA;&#xA;## initalize data import&#xA;end.dt &amp;lt;- Sys.Date()&#xA;start.dt &amp;lt;- end.dt - 100  # keep it simple for example&#xA;&#xA;index.growth &amp;lt;- &quot;MXUS000G Index&quot; #define growth index&#xA;index.value &amp;lt;- &quot;MXUS000V Index&quot; #define value index&#xA;indices &amp;lt;- c(index.growth,index.value)&#xA;&#xA;overrides.px &amp;lt;- structure(&quot;MONTHLY&quot;, names=c&quot;periodicitySelection&quot;)&#xA;px &amp;lt;- bdh(indices,&quot;px_last&quot;,start.dt, end.dt, options = overrides.px)&#xA;print(px)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which works as you'd expect:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ r /tmp/periodicity.R &#xA;$`MXUS000G Index`&#xA;        date px_last&#xA;1 2015-05-29 3456.53&#xA;2 2015-06-30 3410.59&#xA;3 2015-07-31 3517.17&#xA;&#xA;$`MXUS000V Index`&#xA;        date px_last&#xA;1 2015-05-29 2169.20&#xA;2 2015-06-30 2108.77&#xA;3 2015-07-31 2121.89&#xA;&#xA;$ &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(As an aside, we suggest to file bug reports etc over at GitHub. You got lucky that I saw this...)&lt;/p&gt;&#xA;" OwnerUserId="69" LastEditorUserId="69" LastEditDate="2015-08-18T13:10:56.953" LastActivityDate="2015-08-18T13:10:56.953" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19369" PostTypeId="2" ParentId="19360" CreationDate="2015-08-18T03:47:07.603" Score="3" Body="&lt;p&gt;You may have a look at what is called: econophysics. Basically, it applies techniques in statistical physics into financial time series, including power law as you mentioned. You may start with: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;This paper: &lt;a href=&quot;https://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0CB4QFjAAahUKEwijor6-27HHAhUKHZQKHbsMDBE&amp;amp;url=http%3A%2F%2Fpolymer.bu.edu%2Fhes%2Farticles%2Fggps03.pdf&amp;amp;ei=0qnSVaPxO4q60AS7mbCIAQ&amp;amp;usg=AFQjCNGHbhd72J6ucN8JOrGn6kUyrlbJ5g&amp;amp;bvm=bv.99804247,d.dGo&quot; rel=&quot;nofollow&quot;&gt;A theory of power-law distributions in financial market fluctuations&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;This classical book &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0521741866&quot; rel=&quot;nofollow&quot;&gt;Theory of Financial Risk and Derivative Pricing: From Statistical Physics to Risk Management&lt;/a&gt; &lt;/li&gt;&#xA;&lt;li&gt;A good start of econophysics:  &lt;a href=&quot;http://polymer.bu.edu/hes/book-mantegna00stanley.pdf&quot; rel=&quot;nofollow&quot;&gt;An introduction to econophysics&lt;/a&gt;. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'm not expert in this field but hope it help.&lt;/p&gt;&#xA;" OwnerUserId="6461" LastEditorUserId="6461" LastEditDate="2015-08-18T04:04:11.960" LastActivityDate="2015-08-18T04:04:11.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19370" PostTypeId="2" ParentId="18335" CreationDate="2015-08-18T06:10:32.080" Score="1" Body="&lt;p&gt;I am afraid you are missing something (as a lot of people) about beta computation and meaning:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The model you are fitting links the returns of a market factor $r_m$ with your returns $r_g$ thanks to a linear relationship:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_g = \beta \;r_m + \epsilon_{m,g}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see, it does not say the volatility of $r_g$ can be deduced from the one of $r_m$ using $\beta$: you forgot the volatility of $\epsilon_{m,g}$, which is the idiosyncratic part of $r_g$ seen from your market factor $r_m$.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2015-08-18T06:10:32.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19371" PostTypeId="2" ParentId="19357" CreationDate="2015-08-18T06:39:50.643" Score="5" Body="&lt;p&gt;You're setting an option, not an override. Your code works fine if you replace&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;names(overrides.px) = &quot;periodicity&quot;&#xA;px = bdh(securities = indices,fields = &quot;px_last&quot;,start.date = start.dt,end.date = end.dt,&#xA;     overrides = overrides.px)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;names(overrides.px) = &quot;periodicitySelection&quot;&#xA;px = bdh(securities = indices,fields = &quot;px_last&quot;,start.date = start.dt,end.date = end.dt,&#xA;     options = overrides.px)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="17251" LastActivityDate="2015-08-18T06:39:50.643" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19372" PostTypeId="2" ParentId="18851" CreationDate="2015-08-18T06:49:37.890" Score="3" Body="&lt;p&gt;you have a missing element in your data - you need to take into account xccy basis.  when you do so, then you would get the same valuation in both methods.&#xA;the key is to remember that since your payoff of 100JPY is collateralised in usd, it effectively needs to be thought of as if your payoff is cash settled in usd.  &lt;/p&gt;&#xA;" OwnerUserId="17252" LastActivityDate="2015-08-18T06:49:37.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19373" PostTypeId="1" CreationDate="2015-08-18T09:18:17.960" Score="1" ViewCount="58" Body="&lt;p&gt;Trying to find some good review of agent-based models for quantitative finance, covering opinion dynamics, correlated behavior, etc. Are there any articles or books that cover major advances in these areas? &lt;/p&gt;&#xA;" OwnerUserId="17131" LastActivityDate="2015-08-18T09:18:17.960" Title="Good broad review of network modeling for quant finance?" Tags="&lt;correlation&gt;&lt;multi-agent-simulations&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19374" PostTypeId="1" CreationDate="2015-08-18T09:42:36.080" Score="2" ViewCount="758" Body="&lt;p&gt;We are evaluating a model for risk management based on extreme value theory using peaks over threshold and markov chain monte carlo methods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In doing this, we are firstly fitting a GARCH (we have tried GARCH(1,1), E-GARCH, Asymmetric GARCH, GJR-GARCH, ...) model in order to filter the return series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We are encountering a problem here however, wherein our filtered return distribution is far less leptokurtic than the original one, even when we use e.g. Student T or Generalized Hyperbolic distributions for the innovations. Informally speaking, we feel the GARCH model is over-reactive and negatively affects the subsequent POT step.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are we missing something here? Is it, in practice, better to use a simpler (e.g. EWMA) volatility model? Any insight is highly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="5888" LastActivityDate="2015-08-18T09:42:36.080" Title="GARCH filtering and extreme value theory" Tags="&lt;volatility&gt;&lt;risk&gt;&lt;garch&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19375" PostTypeId="2" ParentId="19346" CreationDate="2015-08-18T12:39:42.493" Score="2" Body="&lt;p&gt;Existence of arbitrage opportunities does not lead to market as inefficient. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Samuelson has defined relationship between existence of arbitrage opportunities and market efficiency. He said:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;if market adjust quickly to arbitrage opportunities to return back to&#xA;  normal without cost of any other investor and through market mechanism&#xA;  then market can be said efficient. But if price differences persist&#xA;  (or arbitrage opportunities) for a long period then market is not&#xA;  efficient&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So both arbitrage opportunities and market efficiency can exist together. It is how quickly market responds to arbitrage opportunities that distinguishes between an efficient or inefficient market. &lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="467" LastEditDate="2015-10-19T08:48:53.677" LastActivityDate="2015-10-19T08:48:53.677" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19376" PostTypeId="1" CreationDate="2015-08-18T13:05:07.520" Score="2" ViewCount="652" Body="&lt;p&gt;Please consider the following modified European Call Option&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/clFmH.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/clFmH.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $ 0 &amp;lt; a  	\leq 1$.  When $a = 1$ the modified European call option is reduced to the standard European call option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Transforming the Black-Scholes equation in the standard heat equation and using Fourier transform, I am obtaining the following analytical solution for such modified European call option (please do right click on the image to enlarge it)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/kN7Qy.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/kN7Qy.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When $a=1$ the standard Black-Scholes formula for the usual European call option is recovered, namely&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/TELTL.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/TELTL.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Do you know another method to derive the solution for the modified European Cal option.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Do you know real life cases on which a modified European Call options are applied.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="17216" LastEditorUserId="17216" LastEditDate="2015-10-08T12:30:25.090" LastActivityDate="2015-10-10T20:22:50.223" Title="Analytical soluton to the Black-Scholes equation with a modified European Call Option" Tags="&lt;option-pricing&gt;&lt;black-scholes-pde&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19378" PostTypeId="1" CreationDate="2015-08-18T16:25:54.297" Score="0" ViewCount="103" Body="&lt;p&gt;I am aware of the reasoning of quoting vanilla options as implied volatilities rather than dollar values. However, I would like to have a literature reference where this is explained, to quote / cite in a thesis. I have gone through all books that I have and searched the internet for quite some time but I was unable to find a citable source - which surprises me, since this is such a fundamental consideration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would be grateful if somebody could point me to a good book or paper that includes at least a paragraph on this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best regards&lt;/p&gt;&#xA;" OwnerUserId="17104" LastActivityDate="2015-08-21T17:01:20.433" Title="Citable source: Why implied volatility over dollar prices" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;implied-volatility&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19379" PostTypeId="1" AcceptedAnswerId="19482" CreationDate="2015-08-18T16:53:43.647" Score="3" ViewCount="1302" Body="&lt;p&gt;For example I have 7Y interest rate swap rate and 7Y Fed funds/Libor basis spread. What is the step-by-step procedure to derive OIS rate from these two?&lt;/p&gt;&#xA;" OwnerUserId="17220" LastEditorUserId="17220" LastEditDate="2015-08-19T15:51:49.220" LastActivityDate="2015-08-26T13:36:18.027" Title="Derive OIS rate from IRS rate and Fed Funds/Libor basis spread" Tags="&lt;interest-rates&gt;&lt;swaps&gt;&lt;interest-rate-swap&gt;&lt;ois-discounting&gt;&lt;self-study&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19380" PostTypeId="2" ParentId="19331" CreationDate="2015-08-18T16:55:10.877" Score="8" Body="&lt;p&gt;You can find everything you want to know about this here (and in a very readable and easily reproducible form):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://oldleeds.colorado.edu/asset/burridge/backtestmadoffsclaims.pdf&quot; rel=&quot;nofollow&quot;&gt;How Students Can Backtest Madoff’s Claims by Michael J. Stutzer (2009)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the abstract:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Markopolos’ writings neither described nor included any specific&#xA;  backtests of the strike conversion strategy. Fortunately, a backtest&#xA;  is relatively easy to implement, using just a few, free data series&#xA;  found online, a single spreadsheet, and the Black-Scholes formula. I&#xA;  developed a disguised, simplified backtest as a home assignment for&#xA;  undergrads students, and extended it into a longer, more realistic&#xA;  paper assignment for another student. Based on those experiences, I&#xA;  describe herein a suitable backtest methodology and questions that may&#xA;  be answered through it.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2015-08-23T08:24:21.333" LastActivityDate="2015-08-23T08:24:21.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19381" PostTypeId="1" CreationDate="2015-08-18T17:17:39.013" Score="2" ViewCount="168" Body="&lt;p&gt;There was an interesting post made by Jonathan Kinlay where he discusses the use of a Fourier Transform to discover a potentially optimum bar frequency to choose as an input to a trading system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am hoping that someone could shed some light on exactly what is being used here to generate the indicator graph as I don't find it completely clear.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Link to post is here:  &lt;a href=&quot;http://jonathankinlay.com/index.php/2015/08/signal-processing-sample-frequency-www-jonathankinlay-com/&quot; rel=&quot;nofollow&quot;&gt;Signal Processing and Sample Frequency&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I appreciate any info on this.&lt;/p&gt;&#xA;" OwnerUserId="6151" LastActivityDate="2015-08-18T17:17:39.013" Title="Choosing Optimum Sampling Frequency" Tags="&lt;trading&gt;&lt;automated-trading&gt;&lt;algorithmic-trading&gt;&lt;digital-signal-processing&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19382" PostTypeId="2" ParentId="19376" CreationDate="2015-08-18T19:06:50.950" Score="1" Body="&lt;p&gt;Using the usual arbitrage arguments, we can write option prices as discounted expectations of future values under risk-neutral probabilities.  That is&#xA;$$&#xA;V(S,0) = B(0,T) E\left[ V(S,T) \right]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Start by re-writing your particular payoff as the following sum&#xA;$$&#xA;C_K+aC_{2K}+KD_K&#xA;$$&#xA;where $C_x$ is a call struck at $x$ and $D_x$ is a digital option struck at $x$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since expectation is a &lt;em&gt;linear operator&lt;/em&gt; (i.e. $E[aX+bY] = aE[X]+bE[Y]$) we can then write the value of your option using the standard Black-Scholes formulas $BS_{Call}(\cdot)$ and $Digital_{Call}(\cdot)$ as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;V(S,0) = BS_{Call}(K) + a\,BS_{Call}(2K) + K\,Digital_{Call}(K)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally, $any$ non-pathological terminal payoff $P(S_T)$ can be written in terms of a (finite or converging infinite) sum of standard calls and puts, or of digital calls and puts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Linearity of the expectation operator then tells us that the present value $V(S_0)$ of that payoff is also a converging infinite sum.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a measure theory point of view, this happens because linear functions (and step functions) provide a basis for the space of (nonpathological) payoff functions.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2015-08-18T19:06:50.950" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19383" PostTypeId="2" ParentId="19344" CreationDate="2015-08-18T19:30:04.100" Score="4" Body="&lt;p&gt;I will just answer your first question as I do not know the details of SSVI. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Total variance is more intrinsic than volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The BS formula can be rewritten in terms of 3 parameters: the log-strike (log-moneyness would be more accurate) $k$, the total variance $w$ and the discount factor. Volatility never appears without a $\sqrt{T}$. It is just there because we chose make it appear. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most arbitrages are easier to derive and interpret in terms of $w$: For example calendar arbitrage is just $\partial_t w \ge 0$ and follows from the fact that variance is additive. Roger Lee's tail formula is also better expressed in terms of growth of $w$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this is in part due to the face that $w$ is scaleless when $\sigma$ is not which is also the reason why $\sigma$ is more intuitive to us. So it usually makes sense to use $w$ as an internal parameter even if the results are expressed in terms of $\sigma$. &lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2015-08-18T19:30:04.100" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19384" PostTypeId="1" CreationDate="2015-08-18T20:21:51.893" Score="1" ViewCount="272" Body="&lt;p&gt;I am attempting to tweak a quantstrat based backtest but have run into an issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The maxPos limits are share based, and I would rather use a fixed dollar amount instead. So I've tried generating a max position based on a fixed dollar amt divided by the closing price:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;MaxPos = 10000/Cl(OLN)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but this throws the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error in xts(cbind(maxpos, longlevels, minpos, shortlevels), order.by = as.POSIXct(timestamp)) : &#xA;  NROW(x) must match length(order.by)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is limited documentation on how to work with this package and I am really stuck on what would seem to have a simple solution. &lt;/p&gt;&#xA;" OwnerUserId="17219" LastActivityDate="2015-08-18T20:21:51.893" Title="R quantstrat backtest with dollar based position sizing" Tags="&lt;r&gt;&lt;backtesting&gt;&lt;error&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19385" PostTypeId="1" CreationDate="2015-08-18T20:33:14.990" Score="1" ViewCount="3659" Body="&lt;p&gt;The market efficiency hypothesis means securities are traded at their fair price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the market is at the equilibrium, does it mean the market is efficiency?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If equilibrium cannot implies efficiency, why was that?&#xA;As the equilibrium  price should be achieved by supply and demand, why the price is not the fair price?&lt;/p&gt;&#xA;" OwnerUserId="17239" LastActivityDate="2016-11-13T19:56:58.453" Title="What is the difference between market equilibrium and market efficiency? equilibrium implies efficiency?" Tags="&lt;market&gt;&lt;price&gt;&lt;emh&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19386" PostTypeId="2" ParentId="19376" CreationDate="2015-08-18T20:57:10.160" Score="4" Body="&lt;p&gt;When a pay-off is piecewise linear plus jumps, it the same as the portfolio of calls and digital calls. Its price must agree with that of the portfolio by no arbitrage. Every time there is a jump we add in a digital call and every time there is a change in gradient we add in calls equal to the gradient change. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here we have a call struck at $K$. Just below $2K$ the option pays&#xA;$K$ and above it pays $a K.$ We have $(a-1)$ digital calls struck at $aK$ and $(a-1)$ calls as well to get the gradient to change to $a.$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just add the BS formulas for the three contracts to get the price in the BS model. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-08-18T20:57:10.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19388" PostTypeId="1" CreationDate="2015-08-18T21:29:10.760" Score="1" ViewCount="93" Body="&lt;p&gt;I don´t know how to derivate the Expected Value for the following problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose that the random vector &lt;code&gt;(S_1, S_2)&lt;/code&gt; has a bivariate lognormal distribution with parameter vector &lt;code&gt;(u_1, u_2, v_1, v_2, p)&lt;/code&gt; such that vector &lt;code&gt;(U_1, U_2)=[(ln{S_1}-u_1)/v_1, (ln{S_2}-u_2)/v_2]&lt;/code&gt; has a standard bivariate normal distribution with correlation p&lt;/p&gt;&#xA;&#xA;&lt;p&gt;...&#xA;Now, how would you derivate expected positive difference of the bivariate lognormal spread, t.i. :&#xA;&lt;code&gt;E[max(S_1 - S_2, 0)]&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="17259" LastActivityDate="2015-08-20T05:28:03.797" Title="Expected value of bivariate lognormal spread" Tags="&lt;spread&gt;&lt;lognormal&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19391" PostTypeId="1" CreationDate="2015-08-19T00:41:00.567" Score="1" ViewCount="256" Body="&lt;p&gt;I am considering a number of assets (N) in a portfolio. each asset follows a geometric Brownian motion process therefore the stochastic differential equation is  dS(i) = S(i)μdt + S(i)σdX(i). &#xA;The price changes are correlated as measured by the linear correlation coefficients rho(ij) . how do i deduce the multi-dimensional Ito's Lemma to write down the SDE for F(S1; S2; : : : ; SN) in the most compact&#xA;form possible (with clear drift and diffusion terms) including crorrelation between dX(i)dX(j) that is rho(i,j)dt?&lt;/p&gt;&#xA;" OwnerUserId="17260" LastEditorUserId="17260" LastEditDate="2015-08-19T07:05:49.483" LastActivityDate="2015-08-19T07:05:49.483" Title="stochastic calculus and multidimentional itos lemma" Tags="&lt;stochastic-calculus&gt;&lt;itos-lemma&gt;&lt;self-study&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19392" PostTypeId="2" ParentId="19320" CreationDate="2015-08-19T06:11:20.320" Score="1" Body="&lt;p&gt;It is not entirely clear what you're after, since &lt;strong&gt;Method 1&lt;/strong&gt; from the question is a statistical &lt;em&gt;model&lt;/em&gt;, while &lt;strong&gt;Method 2&lt;/strong&gt; is a statistical &lt;em&gt;test&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the initial question, I'm going to make the assumption that what you're actually after is some number that summarises &quot;momentum&quot; on a given day. If this is the case, I would weakly prefer the Ljung-Box test statistic (using, say 10 lags of the autocorrelation coefficient) as my metric, over the estimated coefficient from an AR(1).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason for this is that under standard estimation procedures, the estimated AR(1) coefficient is just the sample first order autocorrelation coefficient, so this is a pretty simplistic metric for momentum effects.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In contrast, the Ljung-Box statistic is just a sum over the autocorrelation coefficients and so reflects a wider range of possible structures of the autocorrelation function. Given that, as you say, there is no agreed upon definition of &quot;momentum&quot;, the greater flexibility in the Ljung-Box approach seems preferable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, you'll need to be very careful about what frequency of log-returns you are using. If the frequency is too high, then your statistic will actually be a measure of the magnitude of &lt;strong&gt;microstructure effects&lt;/strong&gt;&#xA; such as bid-ask bounce, rather than a measure of momentum. You could potentially mitigate this somewhat by looking at log-returns in a series like the bid-ask midpoint instead of the transactions series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a general comment though, I suspect that you'll have great difficulty separating out correlation induced by microstructure and correlation induced by momentum at any frequency higher than about 15 minutes (of course, it depends on how liquid the underlying asset is).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Colin&lt;/p&gt;&#xA;" OwnerUserId="2998" LastEditorUserId="2998" LastEditDate="2015-08-24T04:16:47.750" LastActivityDate="2015-08-24T04:16:47.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19393" PostTypeId="2" ParentId="19385" CreationDate="2015-08-19T06:13:57.080" Score="1" Body="&lt;p&gt;Market is efficient when all available public information gets priced-in relatively fast by market participants. This yields the fair price. Efficiency depends on the speed of the information dissemination. Equilibrium is a balance between supply and demand, which can be skewed by short term liquidity issues. So market can be efficient and not in equilibrium at the same time.&lt;/p&gt;&#xA;" OwnerUserId="2297" LastActivityDate="2015-08-19T06:13:57.080" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19395" PostTypeId="2" ParentId="19385" CreationDate="2015-08-19T12:51:08.190" Score="1" Body="&lt;p&gt;Read paper written by &lt;strong&gt;Malkiel, &quot;The Efficient Market Hypothesis and Its Critics&quot;&lt;/strong&gt;. It is wonderful paper on EMH. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://eml.berkeley.edu/~craine/EconH195/Fall_14/webpage/Malkiel_Efficient%20Mkts.pdf&quot; rel=&quot;nofollow&quot;&gt;http://eml.berkeley.edu/~craine/EconH195/Fall_14/webpage/Malkiel_Efficient%20Mkts.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It will help you to gain conceptual clarity in EMH.&lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="4910" LastEditDate="2015-08-19T20:07:24.807" LastActivityDate="2015-08-19T20:07:24.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19396" PostTypeId="1" CreationDate="2015-08-19T15:31:25.573" Score="2" ViewCount="128" Body="&lt;p&gt;If my math is correct, if I construct the following portfolio of options the worst that I can do regardless of what the underlying does is profit $1.74 (less commissions).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this correct? Are there any risks that I'm not taking into account? How likely are those risks to occur? &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;SELL 2 SPY150918P00225000 FOR 17.50 (444 open)&lt;/li&gt;&#xA;&lt;li&gt;SELL 1 SPY150918C00169000 FOR 39.44 (105 open)&lt;/li&gt;&#xA;&lt;li&gt;SELL 1 SPY150918C00168000 FOR 40.44 (104 open)&lt;/li&gt;&#xA;&lt;li&gt;BUY 1 SPY150918P00170000 FOR 0.05 (1500 open)&lt;/li&gt;&#xA;&lt;li&gt;BUY 1 SPY150918P00167000 FOR 0.04 (1500 open)&lt;/li&gt;&#xA;&lt;li&gt;BUY 1 SPY150918C00224000 FOR 0.03 (3010 open)&lt;/li&gt;&#xA;&lt;li&gt;BUY 1 SPY150918C00226000 FOR 0.02 (1192 open)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-JWW&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE 2016-10-03:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Originally, I was trying to find arbitrage opportunities in options with the same underlying and the same expiration using a linear programming toy I was working on at the time. It would do this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Go through each ticker on the S&amp;amp;P 500&lt;/li&gt;&#xA;&lt;li&gt;Go through each option expiration period&lt;/li&gt;&#xA;&lt;li&gt;Build an LP model that combines buying / selling puts / calls so that the model is profitable regardless what happens to the underlying (falls to 0, or goes to ~infinity)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The model discovered a strategy that worked like this (my post on trade-king forums at the time):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;First find a call and put option (sell 1, buy the other) with the same strike and expiration that if executed today would be profitable. If you're selling a put, prepare to sell 100 shares of the underlying short. When you do, your profit is locked in. Set up a trigger to sell short the stocks when the underlying falls to a certain point. It seems like this would create a synthetic call option that you get paid to get into. If you come into a situation where you buy a put and sell a call; be prepared to buy 100 shares (margin?). This would create a synthetic put. If you're lucky enough to find this situation on the same stock at the same expiration; you could do a synth-straddle.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;...and why it doesn't work:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Unfortunately it looks like ex-div date nukes this concept. 96% of the stocks that show up in my screener as being profitable through this trade have an ex-div date &amp;lt; option expiration date. Oh well...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Hope this helps someone&lt;/p&gt;&#xA;" OwnerUserId="17268" LastEditorUserId="17268" LastEditDate="2016-10-03T11:02:06.207" LastActivityDate="2016-10-03T11:02:06.207" Title="Risks Associated with Option Arbitrage Portfolio" Tags="&lt;options&gt;&lt;arbitrage&gt;&lt;option-strategies&gt;" AnswerCount="0" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19397" PostTypeId="2" ParentId="19352" CreationDate="2015-08-19T16:19:56.483" Score="2" Body="&lt;p&gt;Yes, it is normal for a L/S fund to have a lot of cash. When you short securities your account is credited with the proceeds from the sales. So if you short 1 million of stock you end up with 1 million cash and -1 million short stock position. Another way to look at it is: as you mentioned, the weights as a fraction of NAV have to add up to 1.0 by definition and cash can be seen as mechanically determined by that identity [i.e. cash=1.0-0.83+0.78].&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What the other calculation is about I have NO IDEA. Maybe the &quot;normal&quot; long exposure they want is 0.95 rather than 0.83 and they are trying to adjust for that. Do they mention what they mean by &quot;fully invested&quot;?&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2015-08-19T18:33:59.660" LastActivityDate="2015-08-19T18:33:59.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19399" PostTypeId="1" CreationDate="2015-08-19T16:47:52.683" Score="1" ViewCount="254" Body="&lt;p&gt;Guys I'm stuck with a problem...&#xA;Consider the portfolio choice problem of a risk-averse individual with a strictly increasing utility function. There is a single risky asset, and a risk free asset. Formulate an investor's choice problem and comment on the first-order conditions. What is the minimum risk premium required to induce the individual to invest all his wealth in the risky asset?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since we know that the choice problem an investor must solve can be expressed as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\max_{a} \mathcal{E}[U(Y_1)] = \max \mathcal{E}[U(Y_0(1+r_f)+a(r_i-r_f))]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $U( )$ is the utility of money function and $\mathcal{E}$ the expectation operator. Moreover, $Y_1$ is the wealth at time 1 whereas $Y_0$ the wealth at time 0, whereas $a$ is the portion that should be invested in the risky asset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By differentiating into the expectation we can solve the maximization problem and we have:&#xA;$\mathcal{E}[(U'(Y_0(1+r_f)+a(r_i-r_f))(r_i-r_f)]=0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The FOC that solves the problem, that is written on the solution of the exercise, is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathcal{E}[U'(Y_0(1+r_i)(r_i-r_f))]\geq0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $a=1$.&#xA;I don't get why the FOC is this...  Can anybody explain me better?&lt;/p&gt;&#xA;" OwnerUserId="16045" LastEditorUserId="16045" LastEditDate="2015-08-19T18:20:24.750" LastActivityDate="2015-08-21T12:41:30.720" Title="Investor choice problem" Tags="&lt;portfolio-management&gt;&lt;utility-theory&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19402" PostTypeId="1" CreationDate="2015-08-20T03:59:49.907" Score="0" ViewCount="173" Body="&lt;p&gt;I'm learning about the SMA/EMA technical analysis, as well as, indicators such as Bollinger Bands, Stochastic Oscillators, MACD, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do you know which one to use and which to weigh more over each other?&lt;/p&gt;&#xA;" OwnerUserId="17273" LastActivityDate="2015-08-20T14:28:28.563" Title="How to weigh many factors using a SMA/EMA" Tags="&lt;moving-average&gt;&lt;technical-analysis&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19403" PostTypeId="2" ParentId="19388" CreationDate="2015-08-20T05:28:03.797" Score="2" Body="&lt;p&gt;if they are stocks, this problem is called pricing a Margrabe option and it is generally solved by change of numeraire. Take $S_2$ to be the numeraire. Then the value of the option is&#xA;$$&#xA;S_2(0) \mathbb{E}_{S_2}( (S_1(T)/S_2(T)-1)_+)&#xA;$$&#xA;where the expectation is taken in the measure that has $S_1/S_2$ as a martingale. Since it's a martingale and log-normal at time T the expectation is easy to compute and you are done.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-08-20T05:28:03.797" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19405" PostTypeId="2" ParentId="19352" CreationDate="2015-08-20T09:24:44.220" Score="1" Body="&lt;p&gt;Market-neutral portfolios seek to eliminate market risk, so sum of the weights could be even a zero. That would mean that you bought a lot of some equity, and then borrowed some other equity and sold it. You have cash now, but you also have risks, because you will have to return the borrowed equity in the end, and who knows how much you will have to pay to buy it back from the market. So you have twofold price risks. There's a difference between Net Exposure (in your case, it is 0.05) and Gross Exposure (in your case, it is 0.83 + 0.78 = 1.61). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the code provided:&#xA;I think it seeks to keep the balance of longs and shorts, while increasing the long weight to 0.95. At least, that's what it looks like if you consider &quot;wgts&quot; a vector.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope that helps!&lt;/p&gt;&#xA;" OwnerUserId="17131" LastEditorUserId="17131" LastEditDate="2015-08-24T08:10:38.303" LastActivityDate="2015-08-24T08:10:38.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19407" PostTypeId="1" AcceptedAnswerId="19410" CreationDate="2015-08-20T12:28:50.960" Score="4" ViewCount="5361" Body="&lt;p&gt;I am a developer rather than a quant. I need to decide whether a given equity passes some basic liquidity threshold.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It doesn't have to be precise, just good enough. I have a Bloomberg terminal data feed access (e.g. can get PX_LAST, VOLUME etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Someone suggested using average volume multiplied by the price. Is this a good idea?&lt;/p&gt;&#xA;" OwnerUserId="1915" LastActivityDate="2015-08-20T14:03:52.573" Title="How do I calculate approximate equity liquidity?" Tags="&lt;equities&gt;&lt;bloomberg&gt;&lt;liquidity&gt;&lt;fundamentals&gt;&lt;calculation&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19408" PostTypeId="2" ParentId="19407" CreationDate="2015-08-20T12:38:46.380" Score="2" Body="&lt;p&gt;I would consider &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.145.9505&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow&quot;&gt;Amihud (2002)&lt;/a&gt; as a good first approximation with that level of data.&lt;/p&gt;&#xA;" OwnerUserId="4910" LastActivityDate="2015-08-20T12:38:46.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19409" PostTypeId="2" ParentId="19407" CreationDate="2015-08-20T13:04:16.873" Score="1" Body="&lt;p&gt;I think one of the main liquidity measures is the one from &lt;a href=&quot;http://faculty.chicagobooth.edu/lubos.pastor/research/liquidity.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Pastor and Stambaugh (2003).&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;You can use it for both individual stocks or indexes.&lt;/p&gt;&#xA;&lt;p&gt;Just run the following intra-month regression with daily data:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$r^e_{i,d+1,t} = \theta_{i,t}+\phi_{i,t}r_{i,d,t}+\gamma_{i,t}sign(r^e_{i,d,t}) \times v_{i,d,t}+\epsilon_{i,d+1,t}$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Where &lt;span class=&quot;math-container&quot;&gt;$r^e_{i,d+1,t}$&lt;/span&gt; is the excess stock return of stock &lt;span class=&quot;math-container&quot;&gt;$i$&lt;/span&gt; at day &lt;span class=&quot;math-container&quot;&gt;$d+1$&lt;/span&gt; of month &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$v_{i,d,t}$&lt;/span&gt; the dollar volume for stock &lt;span class=&quot;math-container&quot;&gt;$i$&lt;/span&gt; on day &lt;span class=&quot;math-container&quot;&gt;$d$&lt;/span&gt; in month &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Check equation (1) of the paper for further details.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2015-08-20T13:04:16.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19410" PostTypeId="2" ParentId="19407" CreationDate="2015-08-20T14:03:52.573" Score="4" Body="&lt;p&gt;You can use refined methodologies but if you just need a rough estimation of liquidity, you can simply use an average of daily volume over N days. In practice, for equities, people tend to use N = 20 or 30.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you have the average daily volume (say 100,000 shares), you compare it to your holding (say 50,000 shares) to determine the the size of your position (in my example: 0.5 days of volume).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is important to decide which volume to use (primary exchange vs. all exchange volume - on some securities the latter can be 2x or 3x the former).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then qualify the liquidity of the holding by making an assumption on the % of volume you think you can trade without impacting prices too much. 20-25% is typical although some argue that for larger positions 15% is already disruptive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say you think you can use 25% of the daily volume, in my previous example, you would conclude that it would take ca. 2 days to liquidate the position. Or put another way that you would be able to liquidate about 50% of the position in one day.&lt;/p&gt;&#xA;" OwnerUserId="2393" LastActivityDate="2015-08-20T14:03:52.573" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19411" PostTypeId="1" CreationDate="2015-08-20T14:08:47.700" Score="0" ViewCount="618" Body="&lt;p&gt;I want to be able to plot Donchian-channels. It's probably easier to use numpy but, am not that fluent with numpy yet so i thought i could make a function that takes two arrays as input(Highs and lows), make a little size-limited-dynamical-array over x days and then within that array find out the max and min value. And at the end output two arrays to plot the data with.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code  that i came up with is &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;zl=[2,3,4,5,5,4,3,2,3,4,3,4,5,6,7,8,7,6,5,4,5,6]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;zh=[3,4,5,6,6,5,4,3,4,5,4,5,6,7,8,9,8,7,6,5,6,7]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;def donchianChannels(highValue, lowValue, window):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;highOutput = []&#xA;lowOutput = []&#xA;lsth = [None]*window&#xA;lstl = [None]*window&#xA;for i in range(0, len(highValue)):&#xA;    maxValue=0&#xA;    lsth.append(highValue[i])&#xA;    lsth = lsth[-window:]&#xA;&#xA;    for j in range(0, len(lsth)):&#xA;        if lsth[j] &amp;gt; maxValue:&#xA;            maxValue = lsth[j]&#xA;&#xA;    highOutput.append(maxValue)&#xA;&#xA;for i in range(0, len(lowValue)):&#xA;    minValue=100000&#xA;    lstl.append(lowValue[i])&#xA;    lstl = lstl[-window:]&#xA;&#xA;    for j in range(0, len(lstl)):&#xA;        if lstl[j] &amp;lt; minValue:&#xA;            minValue = lstl[j]&#xA;&#xA;    lowOutput.append(lowValue)&#xA;&#xA;return highOutput, lowOutput&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;maxvalue, minvalue = donchianChannels(zh, zl, 3)&#xA;print maxvalue, minvalue&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;and the output i get is &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;[3, 4, 5, 6, 6, 6, 6, 5, 4, 5, 5, 5, 6, 7, 8, 9, 9, 9, 8, 7, 6, 7] [[2, 3, 4, 5, 5, 4, 3, 2, 3, 4, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 5, 6], [2, 3, 4, 5, 5, 4, 3, 2, 3, 4, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 5, 6], [2, 3, 4, 5, 5, 4, 3, 2, 3, 4, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 5, 6], [2, 3, 4, 5, 5, 4, 3, 2, 3, 4, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 5, 6], [2, 3, 4, 5, 5, 4, 3, 2, 3, 4, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 5, 6], [2, 3, 4, 5, 5, 4, 3, 2, 3, 4, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 5, 6], [2, 3, 4, 5, 5, 4, 3, 2, 3, 4, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 5, 6], [2, 3, 4, 5, 5, 4, 3, 2, 3, 4, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 5, 6], [2, 3, 4, 5, 5, 4, 3, 2, 3, 4, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 5, 6], [2, 3, 4, 5, 5, 4, 3, 2, 3, 4, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 5, 6], [2, 3, 4, 5, 5, 4, 3, 2, 3, 4, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 5, 6], [2, 3, 4, 5, 5, 4, 3, 2, 3, 4, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 5, 6], [2, 3, 4, 5, 5, 4, 3, 2, 3, 4, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 5, 6], [2, 3, 4, 5, 5, 4, 3, 2, 3, 4, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 5, 6], [2, 3, 4, 5, 5, 4, 3, 2, 3, 4, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 5, 6], [2, 3, 4, 5, 5, 4, 3, 2, 3, 4, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 5, 6], [2, 3, 4, 5, 5, 4, 3, 2, 3, 4, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 5, 6], [2, 3, 4, 5, 5, 4, 3, 2, 3, 4, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 5, 6], [2, 3, 4, 5, 5, 4, 3, 2, 3, 4, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 5, 6], [2, 3, 4, 5, 5, 4, 3, 2, 3, 4, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 5, 6], [2, 3, 4, 5, 5, 4, 3, 2, 3, 4, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 5, 6], [2, 3, 4, 5, 5, 4, 3, 2, 3, 4, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 5, 6]]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the algorithm for the maximum array works fine, but the minimum one does not work at all. &#xA;First of all it makes 22 arrays(the lenght of the input array) within one array. &#xA;Second none of the minimum arrays plots the minimum values.&#xA;They should be&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[2,2,2,3,4,4,3,2,2,2,3,3,3,4,5,6,7,6,5,4,4,4,5]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Due to my calculations i can not see the problem &#xA;it would be great if i could get some help please :)&lt;/p&gt;&#xA;" OwnerUserId="17278" LastActivityDate="2015-08-20T14:17:15.613" Title="need help with Donchian-channels function!" Tags="&lt;python&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19412" PostTypeId="2" ParentId="19402" CreationDate="2015-08-20T14:15:30.100" Score="1" Body="&lt;p&gt;They are different things, it depends on what you are looking for:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Bollinger bands&lt;/strong&gt; are constructed based on the standard deviation of closing prices over the last n periods. An analyst can draw high and low bands a chosen number of standard deviations (typically two) above and below the n-period moving average. The bands move away from one another when price volatility increases and move closer together when prices are less volatile. Bollinger bands are viewed as useful for indicating when prices are extreme by recent&#xA;standards on either the high or low side. Prices at or above the upper Bollinger band may be viewed as indicating an overbought market, one that is &quot;too high&quot; and likely to decrease in the near term. Likewise, prices at or below the lower Bollinger band may be viewed as indicating an oversold market, one that is &quot;too low&quot; and likely to increase in the near term.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Moving average convergence/divergence.&lt;/strong&gt; MACD oscillators are drawn using&#xA;exponentially smoothed moving averages, which place greater weight on more&#xA;recent observations. The &quot;'MACD line&quot; is the difference between two exponentially smoothed moving averages of the price, and the &quot;signal line&quot; is an exponentially smoothed moving average of the MACD line. The lines oscillate around zero but are not bounded. The MACD oscillator can be used to indicate overbought or oversold conditions or to identify convergence or divergence with the price trend. Points where the two lines cross can be used as trading signals. The MACD line crossing above the smoother signal line is viewed as a buy signal and the MACD line crossing below the signal line is viewed as a sell signal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Stochastic oscillator&lt;/strong&gt;. A stochastic oscillator is calculated from the latest closing price and highest and lowest prices reached in a recent period, such as 14 days. In a sustainable uptrend, prices tend to close nearer to the recent high, and in a sustainable downtrend, prices tend to close nearer to the recent low. Stochastic oscillators use two lines that are bounded by 0 and 100. The &quot;%Ku line is the difference between the latest price and the recent low as a percentage of the difference between the recent high and low. The &quot;%D&quot; line is a 3-period average of the %K line. Technical analysts typically use stochastic oscillators to identify overbought and oversold markets. Points where the %K line crosses the %D line can also be used as trading signals in the same way as the MACD lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From: Schwerser Notes - adapted&lt;/p&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="16472" LastEditDate="2015-08-20T14:28:28.563" LastActivityDate="2015-08-20T14:28:28.563" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19413" PostTypeId="2" ParentId="19411" CreationDate="2015-08-20T14:17:15.613" Score="1" Body="&lt;pre&gt;&lt;code&gt;highOutput = []&#xA;lowOutput = []&#xA;lsth = [None]*window&#xA;lstl = [None]*window&#xA;for i in range(0, len(highValue)):&#xA;    maxValue=0&#xA;    lsth.append(highValue[i])&#xA;    lsth = lsth[-window:]&#xA;&#xA;    for j in range(0, len(lsth)):&#xA;        if lsth[j] &amp;gt; maxValue:&#xA;            maxValue = lsth[j]&#xA;&#xA;    highOutput.append(maxValue)&#xA;&#xA;for i in range(0, len(lowValue)):&#xA;    minValue=100000&#xA;    lstl.append(lowValue[i])&#xA;    lstl = lstl[-window:]&#xA;&#xA;    for j in range(0, len(lstl)):&#xA;        if lstl[j] &amp;lt; minValue:&#xA;            minValue = lstl[j]&#xA;&#xA;    lowOutput.append(minValue)    #Change this&#xA;&#xA;return highOutput, lowOutput&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5940" LastActivityDate="2015-08-20T14:17:15.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19414" PostTypeId="1" CreationDate="2015-08-20T16:27:27.520" Score="5" ViewCount="399" Body="&lt;p&gt;I have just read this paper &lt;a href=&quot;http://www.cfapubs.org/loi/doi/abs/10.2469/faj.v66.n5.3&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.cfapubs.org/loi/doi/abs/10.2469/faj.v66.n5.3&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the paper they define financial turbulence formula as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/W4pGu.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/W4pGu.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anyone help me calculate/understand this formula, maybe with a simple numeric example?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Numeric example you could improve:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say we want to find the financial turbulence of Dow Jones Industrial at time &lt;strong&gt;&lt;em&gt;t&lt;/em&gt;&lt;/strong&gt;, and I have DJI monthly returns of last 24 months (monthly returns created by using month end prices):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;DJIR = [0.03, 0.01, -0.04, ..., 0.015]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thus:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;DJIR[1] is 0.03 (it means 3% return)&#xA;DJIR[2] is 0.01&#xA;DJIR[3] is -0.04&#xA;DJIR[4] is -0.02&#xA;DJIR[5] is 0.05&#xA;...&#xA;DJIR[24] is 0.015&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now let's say I want to calculate the financial turbulence &lt;strong&gt;&lt;em&gt;d&lt;/em&gt;&lt;/strong&gt; at &lt;strong&gt;&lt;em&gt;t = 5&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d[5] = (DJIR[5] - \mu) * Covariance$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what's $\mu$ here at &lt;strong&gt;&lt;em&gt;t = 5&lt;/em&gt;&lt;/strong&gt;? How to calculate it? Is it the average of returns until this point, or is it a moving average of the last &lt;strong&gt;&lt;em&gt;n&lt;/em&gt;&lt;/strong&gt; returns?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And what's Covariante here at time &lt;strong&gt;&lt;em&gt;t = 5&lt;/em&gt;&lt;/strong&gt;, I know Covariance is calculated like this: $\frac{1}{N-1}\sum_{i=1}^{n}(x_i-\bar{x})(y_i-\bar{y})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But who is $x_i$ and who is $y_i$ in the formula?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;P.S. &lt;a href=&quot;https://www.tradestation.com/education/labs/analysis-concepts/identifying-periods-of-financial-turbulence&quot; rel=&quot;nofollow noreferrer&quot;&gt;here is another article that explains the formula, but it's not clear to me.&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="1466" LastEditorUserId="1466" LastEditDate="2015-08-24T20:30:51.207" LastActivityDate="2015-08-24T20:30:51.207" Title="How to calculate Skulls Financial Turbulence for one asset?" Tags="&lt;equities&gt;&lt;portfolio-management&gt;&lt;calculation&gt;&lt;financial&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19416" PostTypeId="1" CreationDate="2015-08-20T17:43:21.500" Score="0" ViewCount="29" Body="&lt;p&gt;Looking at XOM (but it is the same for many stocks) there is an odd drop in the stock price during 1988.  It drops around the new year and pops back up around the next new year.  This drop is present in a lot of stocks reported by google finance.  The same shift is not present on Yahoo Finance and as far as I can tell it doesn't coincide with actual market data.  So is this just a glitch?  Do others see this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More specifically:  is there an explanation for this error?  Why 1988 across so many securities? Is it an algorithm oops, or was there some underlying change in reporting or source data that could cause it?&lt;/p&gt;&#xA;" OwnerUserId="17285" LastEditorUserId="17285" LastEditDate="2015-08-20T23:33:02.013" LastActivityDate="2015-08-20T23:33:02.013" Title="Strange / Incorrect / Unusual Data on Google Finance 1988" Tags="&lt;historical-data&gt;&lt;google&gt;" AnswerCount="0" CommentCount="2" ClosedDate="2015-08-20T19:41:00.597" ContentLicense="CC BY-SA 3.0" />
  <row Id="19417" PostTypeId="2" ParentId="19414" CreationDate="2015-08-20T18:54:28.197" Score="2" Body="&lt;p&gt;You wrote: $$d[5] = (DJIR[5] - \mu) * Covariance$$ but you left out half of it (the inverse and the transposed vector on the right side). The  correct formula is&#xA;$$d[5] = (DJIR[5] - \mu)^2 / Var[DJIR]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The covariance &quot;matrix&quot; becomes the variance in a 1-dimensional case (in other words $x_i$ and $y_i$ are both equal to DJIR[i] in this case) and the &quot;matrix inverse&quot; of a number just becomes one over the number. [That is why you DIVIDE by variance, you don't multiply]. For mu you can use mean[DJIR] over a very long period of time (many years) but you could also set it to zero (which is commonly done and that is what I would recommend, it wont make much difference). Of course the variance is the variance up to this point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the formula is intended for more than 1 asset. You already have DJIA, add some other assets. Then you will have a true covariance matrix. The whole point is that there are a lot of markets and this formula lets you watch over all of them simultaneously in a clever way. With 1 market it is trivial.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2015-08-21T14:06:33.987" LastActivityDate="2015-08-21T14:06:33.987" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19418" PostTypeId="1" AcceptedAnswerId="19446" CreationDate="2015-08-20T20:51:19.170" Score="0" ViewCount="222" Body="&lt;p&gt;I am trying to measure &lt;strong&gt;exchange rate volatility&lt;/strong&gt; in some countries and I am &lt;strong&gt;using their currencies against euro&lt;/strong&gt;. Problem is that &lt;strong&gt;one of them is Slovakia which has changed the currency in 2009&lt;/strong&gt; from crown to euro. From that year there is no way for me to measure its exchange rate against euro, because it is using euro (obviously). How would you suggest to solve this issue in the most correct way? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Approach I think of is comparing Slovakia currency for the whole time period against USD, but I am afraid this might introduce another problems (inaccuracies?) into my results. Also, if I do so, should I measure the other countries against USD and not EUR as well?&lt;/p&gt;&#xA;" OwnerUserId="17286" LastActivityDate="2015-08-25T16:12:44.597" Title="How to handle currency change in exchange rate volatility measurement" Tags="&lt;volatility&gt;&lt;fx&gt;&lt;currency&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19419" PostTypeId="2" ParentId="19399" CreationDate="2015-08-21T12:41:30.720" Score="2" Body="&lt;p&gt;Try to formulate the problem as a &lt;em&gt;constrained&lt;/em&gt; optimization problem, and examine the KKT (Karush-Kuhn-Tucker) complementary slackness conditions.&lt;/p&gt;&#xA;" OwnerUserId="114" LastActivityDate="2015-08-21T12:41:30.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19420" PostTypeId="2" ParentId="19385" CreationDate="2015-08-21T13:00:57.880" Score="0" Body="&lt;p&gt;The answer to your question depends on the type of equilibrium.&#xA;In a perfect information rational expectations equilibrium with preferences that assume that agents always prefer more money to less, the equilibrium is efficient with respect to the information.&#xA;If you introduce biases in preferences or different information sets (differing ability to interpret information, different access to information, etc.) then an equilibrium does not have to be efficient. This is mainly due to the fact that it is not quite obvious with respect to which information prices should be efficient.&#xA;Also, differing transaction costs or differences in attention to markets, liquidity effects, sun spots, and other market frictions often result in models in which equilibria do not (necessarily) imply efficiency.&lt;/p&gt;&#xA;" OwnerUserId="7396" LastActivityDate="2015-08-21T13:00:57.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19421" PostTypeId="2" ParentId="9313" CreationDate="2015-08-21T13:15:59.983" Score="2" Body="&lt;p&gt;The main reason to use traditional methods is interpretability. Specially when you are dealing with portfolios. Portfolios are nothing more than a linear combination of assets. Many Machine Learning methods are highly non-linear and therefore are hard to replicate with a real portfolio. For example if you want to minimize volatility of your emerging markets stock portfolio with a currency hedge portfolio a traditional optimization through a regression problem would give you weights on individual currencies but a Machine Learning method like SVM, ANN, etc give you no clue on what to buy or sell. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having said that I think non traditional methods could work very well on feature selection, outlier or anomaly detection or classification. I see no problem on combining them as long as you can still interpret the model.&lt;/p&gt;&#xA;" OwnerUserId="17292" LastActivityDate="2015-08-21T13:15:59.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19423" PostTypeId="2" ParentId="9313" CreationDate="2015-08-21T14:38:37.930" Score="10" Body="&lt;p&gt;I was just like you when I started out: I had learned a lot about machine learning (mainly neural networks and genetic algorithms/programming) and used it heavily. I also had learned about classic statistics but not nearly as much as about ML.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem with ML is - as I see it today - that you are often taking a sledgehammer to crack a nut, meaning: Because financial markets are so highly stochastic you have a lot of overfitting and often are confusing noise for signal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also here: &lt;a href=&quot;http://datagrid.lbl.gov/backtest/&quot;&gt;http://datagrid.lbl.gov/backtest/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is that such a problem with ML? Because you just have so many parameters to tinker with! Take ANNs as an example: How many layers? How many neurons? Which learning algorithm (each with many different parameters)? Which stopping criterion? How to find the best combination of these parameters - with genetic algorithms? Or just as an art? Combine different models with an ensemble approach? And so on...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then comes interpretability because ANNs are a black box. Even if the results are promising you don't know what the model has actually learned.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also here: &lt;a href=&quot;https://neil.fraser.name/writing/tank/&quot;&gt;https://neil.fraser.name/writing/tank/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Over the years I came to appreciate classic statistics because they are still the benchmark. I agree that they are mainly about linear models and Gaussians - something that is clearly wrong in financial markets, but it is a starting point!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also here: &lt;a href=&quot;http://www.johndcook.com/blog/2012/01/04/nonlinear-is-not-a-hypothesis/&quot;&gt;http://www.johndcook.com/blog/2012/01/04/nonlinear-is-not-a-hypothesis/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Today I try to use modelling methods that represent a sweet spot:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;They must be simple enough to be interpretable,&lt;/li&gt;&#xA;&lt;li&gt;they must be complex enough to reproduce the most important stylized facts of financial markets,&lt;/li&gt;&#xA;&lt;li&gt;there must be some kind of economic intuition involved why they should work.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So my humble conclusion is that it would be wrong to just use linear regression and the normal distribution but it would be equally wrong to just use some kind of super ML algorithm to find the right solution for you. When I have learned one thing over the years is that modeling the stock market is first and foremost an ongoing lesson in humility... and you still have to do the thinking yourself.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2015-08-21T14:38:37.930" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19424" PostTypeId="2" ParentId="19099" CreationDate="2015-08-21T15:47:43.230" Score="1" Body="&lt;p&gt;If X contains several highly correlated indexes, the first PCA will be a linear combination of them and its weights will be similar because at the end they represent the same underlying phenomena. When you do a regression with the same variable in Y and X you will have perfect match of that specific regressor by construction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The real problem of colinearity is that many different linear combinations of your variables X gives you very similar results. PCA only restricts the possibilities of those combinations to get more stability in your model parameters, but it does not mean that those are &quot;the&quot; real parameters and there are many other combinations that will give you similar results, therefore betas are not so easy to interpret.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My suggestion is that you build a model with less colinearity by construction. For example you could use a broad stock index, like a world index weighted by country GDP or market cap (let's call it I1), then find the projection of X in into the subspace orthogonal to I1 (let's call it X') to eliminate the broad market effect in each index of X. Doing that you will eliminate most colinearity problems, unless you use similar indexes in X. In that way your model would have two kinds of betas. One associated to broad  market movements (the one associated to I1) and the rest associated with specific sectors, styles,countries, etc. One way to easily find X' is to construct It using the Regresion residuals of each index in X using I2 and constant as the only regressors. X' will be the matrix with the residuals of each individual regressions. Then you use I2 and X' as regressors. If you avoid X' indexes too similar (like using oil and energy) you will avoid multi colinearity issues and will be able to interpret your results easily. If your X has many similar variables I would consider using PCA on the X' values, but again it could be difficult to interpret.&lt;/p&gt;&#xA;" OwnerUserId="17292" LastEditorUserId="17292" LastEditDate="2015-08-21T15:53:09.783" LastActivityDate="2015-08-21T15:53:09.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19425" PostTypeId="2" ParentId="19362" CreationDate="2015-08-21T16:45:46.497" Score="2" Body="&lt;p&gt;A couple quick thoughts.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Do the PCA on &lt;strong&gt;changes&lt;/strong&gt; or &lt;strong&gt;log-changes&lt;/strong&gt; in your series.  That is often how PCA is conducted in fixed-income settings.&lt;/li&gt;&#xA;&lt;li&gt;You're large move in wights corresponds to outlier moves in the blue series.  Given the assumptions of a PCA, I would consider whether your dataset has suffered from any breakpoints, regime changes or other rare events&lt;/li&gt;&#xA;&lt;li&gt;Think about smoothing your weights (with some priors).  Remember that you are trying to explain the interaction of three fixed income instruments (which are driven by economies, politics, and market forces) by only &lt;strong&gt;9 parameters&lt;/strong&gt;.  You need to match your analysis with reasonable expectations on its performance.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="15338" LastActivityDate="2015-08-21T16:45:46.497" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19426" PostTypeId="2" ParentId="19378" CreationDate="2015-08-21T17:01:20.433" Score="2" Body="&lt;p&gt;I don't believe you will necessarily find a cite-able source as, I believe, this comes from a practical rather than theoretical motivation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you know option prices are a function of: future prices, discount rates and implied volatility, volatility surface skew and other supple/demand factors.  So when you are trading these instruments, you need to understand how all of these factors are moving over the course of pricing, the option, getting quotes and confirming the trades.  (Note: for some OTC options this can take several hours).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By far the most volatile component driving an options price on given day (assuming the option isn't expiring soon) is the futures prices.  Given that the option's delta can be hedged out for little transaction cost, dealers prefer to quote in implied volatility as that is the second biggest driver of prices; it will also be somewhat stable over the course of pricing and confirming the trade.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The pricing risk associated with other factors such as discount-rate risk and some local spot-vol correlation risk are usually incorporated into the vol quote you are given.  However there these effects on the prices are usually minimal over the course of an hour.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Different markets will agree on different transformations between implied vols and spot dollar prices.  Some markets use Black-Scholes Formula, in others more complex formulas can be used such as Stochastic-Local Volatility.&lt;/p&gt;&#xA;" OwnerUserId="15338" LastActivityDate="2015-08-21T17:01:20.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19427" PostTypeId="1" AcceptedAnswerId="19428" CreationDate="2015-08-21T21:38:56.443" Score="2" ViewCount="34" Body="&lt;p&gt;In George and Hwang's 2010 JFE paper, they are trying to resolve the so called distress risk and leverage puzzles. This is their explanation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This is a puzzle because high distress intensity or&#xA;  nearness to default means the firm has exhausted its&#xA;  capacity to issue low-risk debt.Since leverage amplifies&#xA;  the exposure of equity to priced systematic risks,firms&#xA;  with high distress measures should be those for which&#xA;  equity exposures are most amplified.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How does leverage amplify the exposure of equity to priced systematic risks? Can someone please elaborate this?&lt;/p&gt;&#xA;" OwnerUserId="6804" LastActivityDate="2015-08-22T08:48:22.473" Title="Distress firms and cross section returns" Tags="&lt;asset-pricing&gt;&lt;expected-return&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19428" PostTypeId="2" ParentId="19427" CreationDate="2015-08-21T22:03:36.907" Score="1" Body="&lt;p&gt;Yes leverage amplifies the exposure of equity to systematic risks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just consider the standard textbook formula (Modigliani-Miller):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\beta_e = \beta_a \times (1+\frac{D(1-\tau)}{V})$&#xA;where $\beta_e$ is the sensitivity of the stock to systematic risk, $\tau$ is the tax-rate and $D/V$ is the leverage ratio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So beta (i.e. the exposure to systematic risk) increases with leverage. If we use Harris-Pringle or Milles-Ezzel formulas we get a similar result.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="16472" LastEditDate="2015-08-22T08:48:22.473" LastActivityDate="2015-08-22T08:48:22.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19431" PostTypeId="1" AcceptedAnswerId="19536" CreationDate="2015-08-23T00:11:53.767" Score="1" ViewCount="599" Body="&lt;p&gt;The formula for calculating the VIX from SPX options is given on page 4 of this document:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.cboe.com/micro/vix/vixwhite.pdf&quot; rel=&quot;nofollow&quot;&gt;https://www.cboe.com/micro/vix/vixwhite.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, why is the option price at each strike weighted by the inverse of the strike price squared?  This would seem to overweight OTM put options (with low strikes) and underweight OTM call options (with high strikes).&lt;/p&gt;&#xA;" OwnerUserId="16389" LastActivityDate="2015-08-30T00:22:52.363" Title="VIX Calculation - weighting of strikes" Tags="&lt;options&gt;&lt;vix&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19432" PostTypeId="1" CreationDate="2015-08-23T14:25:56.507" Score="1" ViewCount="130" Body="&lt;p&gt;We got the stochastic process for stock price of n stocks at continues time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can find if there is a arbitrage trading strategy or dominant trading strategy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder if we cannot find such strategies, &#xA;Can we conclude there is no mispricing in the stock prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my opinion, although no such strategies exists in the stochastic process. The mispricing still possibly exists in stock prices.&#xA;I don't know if I am right.&lt;/p&gt;&#xA;" OwnerUserId="17258" LastActivityDate="2015-09-26T06:12:18.373" Title="Question about find no arbitrage trading strategy" Tags="&lt;stochastic-processes&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19433" PostTypeId="2" ParentId="11026" CreationDate="2015-08-23T14:40:11.953" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/hZNBb.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/hZNBb.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt; In the paragraph before the one from which you gave the quotation is written such a thing: “…when $u_i^2$ is high, there is a tendency for $u_{i+1}^2$, $u_{i+2}^2$, … to be high; when $u_i^2$ is low, there is a tendency for $u_{i+1}^2$, $u_{i+2}^2$, … to be low.” This means that they $u_{i+1}^2,u_{i+1}^2, u_{i+2}^2,…$ are correlated. Which by itself means that $u_i^2$ exhibits autocorrelation. If we predicted well the $σ_i^2-s$ (and $u_i^2$ is an approximation of it), after dividing $σ_i^2$ on $u_i^2$ we should no more have the pattern described in quotation. Which means we are “removing autocorrelation.” &lt;/p&gt;&#xA;" OwnerUserId="17305" LastEditorUserId="16991" LastEditDate="2015-10-24T16:33:22.293" LastActivityDate="2015-10-24T16:33:22.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19435" PostTypeId="1" CreationDate="2015-08-23T18:44:58.723" Score="1" ViewCount="205" Body="&lt;p&gt;was working on a project and could use some help. New to the community and looking fwd to being an active part of it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, let's say we have a vector of securities V, and it trades with some correlation to another vector of securities W. I'm trying to figure out what the best way is to rebucket the risk in V to W equivalents. I tried running a PCA on V and W but am having trouble standardizing the variables. I'm also worried that I might be &quot;overfitting&quot; my dataset a little. Any guidance is appreciated. &lt;/p&gt;&#xA;" OwnerUserId="17306" LastActivityDate="2015-08-26T13:20:34.673" Title="Rebucketing Risk using PCA/other methods" Tags="&lt;risk&gt;&lt;portfolio&gt;&lt;regression&gt;&lt;beta&gt;&lt;pca&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19437" PostTypeId="1" CreationDate="2015-08-23T21:47:06.917" Score="1" ViewCount="116" Body="&lt;p&gt;I am using government bullet bond data and have bootstrapped a yield curve by solving the following optimization which minimizes unweighted price error:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{min}\sum_i\left(P_i-\sum_t\frac{F_{it}}{\left(1+r_t\right)^t}\right)^2$$&#xA;where $i$ denotes a specific bond, and $t$ a specific time. The optimization is subject to the condition:&#xA;$$\left(1+r_t\right)^t\geq\left(1+r_{t-1}\right)^{t-1} \quad\forall{t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The resulting yield curve displays a pretty significant hump. Now I am told to smoothen it, for which purpose my text introduces a weighting variable $\lambda=\{0.1,0.2,\dots,1\}$ and tags on a term containing the difference between the forward rate at $t$ vs. the forward rate at $t-1$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{min}\;\lambda\cdot\sum_i\left(P_i-\sum_t\frac{F_{it}}{\left(1+r_t\right)^t}\right)^2\\+\left(1-\lambda\right)\sum_t\left(f_{(t)(t+1)}-f_{(t-1)(t)}\right)^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under the condition:&#xA;$$f_{t\tau}=&#xA;\begin{cases}&#xA;r_t, &amp;amp; \text{if $\tau=0$}\\&#xA;\left(\frac{\left(1+r_\tau\right)^\tau}{\left(1+r_t\right)^t}\right)^{1/\left(\tau-t\right)}, &amp;amp; \text{if $\tau\gt 0$}&#xA;\end{cases}\qquad\tau\geq t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need to decide which value of $\lambda$ would be optimal, but I do not fully understand the added optimization term, nor the properties of the yield curve itself. I am hopeful that you can help me make sense of it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The original term works by minimizing the unweighted price errors, but this leads to bonds with a longer maturity being weighted more during the regression. The new term works by minimizing the slope of the forward curve. As $\lambda$ decreases in value, the weight of the optimization shifts from minimizing the unweighted price errors to minimizing the slope of the forward curve. This leads to a lessening of aforementioned hump displayed by yield curve, and eventually its complete disappearance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Why does minimizing the forward curve slope smoothen the yield curve? What is happening financially?&lt;/li&gt;&#xA;&lt;li&gt;Why is a smooth yield curve desirable in the context of asset liability matching?&lt;/li&gt;&#xA;&lt;li&gt;The variance between estimated and observed spot rate increases as $\lambda$ decreases, i.e. the model becomes more uncertain as minimizing price errors becomes less important - this is not surprising. But what makes curve smoothness worth the cost of increased variance?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8134" LastEditorUserId="8134" LastEditDate="2015-08-24T07:13:01.597" LastActivityDate="2015-08-24T07:13:01.597" Title="Smoothening yield curve by minimizing forward curve slope" Tags="&lt;fixed-income&gt;&lt;optimization&gt;&lt;yield-curve&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19438" PostTypeId="1" AcceptedAnswerId="19439" CreationDate="2015-08-23T23:26:26.577" Score="0" ViewCount="292" Body="&lt;p&gt;I've come across this equation in a text and can't figure out what part of it is doing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Using quarterly installments)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{1}{4*10^4}s^t \sum\limits_{u=1}^{4t} p_{0.25u}[(1-\pi_{0.25u}) + \frac{1}{2}(\pi_{0.25u-1} - \pi_{0.25u})] = (1-R) \sum\limits_{u=1}^{4t} p_{0.25u}(\pi_{0.25u-1} - \pi_{0.25u})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $p_{0.25u}$ is the price of a risk free zero coupon bond maturing at time $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why are we dividing the left hand side by $4*10^4$?&lt;/p&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="9265" LastEditDate="2015-08-24T01:08:02.113" LastActivityDate="2015-08-24T01:30:22.057" Title="Explain equation to calculate CDS spread" Tags="&lt;cds&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19439" PostTypeId="2" ParentId="19438" CreationDate="2015-08-24T01:30:22.057" Score="1" Body="&lt;p&gt;The $10^4$ factor is to calculate the answer in &lt;a href=&quot;https://en.wikipedia.org/wiki/Basis_point&quot; rel=&quot;nofollow&quot;&gt;bps (basis points).&lt;/a&gt; &#xA;It looks like $4$ is the denominator for the summation of the quarterly installments.&lt;/p&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2015-08-24T01:30:22.057" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19440" PostTypeId="1" AcceptedAnswerId="21929" CreationDate="2015-08-24T02:21:29.267" Score="3" ViewCount="6026" Body="&lt;p&gt;Does the presence of a optional/mandatory right-to-break clause affect CVA calculations, and if so, how?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given two (otherwise identical) 10y swaps with the same counterparty, one of which has a right to break at 5y (ours), intuitively I'd say the one with the break clause should have a lower CVA - if the counterparty default spread takes a dive we can exit the trade at replacement cost. The question is how do we take that into account when calculating CVA?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Definitions&lt;/strong&gt;: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;For the banks I deal with, when a break event occurs (regardless of whether the break was optional or mandatory) the trade is marked to market, a payment is made to whichever party is in the money &amp;amp; the trade is ripped up.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Trades with a mandatory break are often &quot;replaced&quot; with a similar trade. That might be because a counterparty isn't allowed to have a 20Y trade on their books, for example.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="6416" LastEditorUserId="6416" LastEditDate="2015-09-25T02:09:00.297" LastActivityDate="2015-11-26T13:30:05.823" Title="How do right-to-break clauses affect CVA calculations" Tags="&lt;credit-risk&gt;&lt;cva&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19441" PostTypeId="2" ParentId="17169" CreationDate="2015-08-24T02:28:40.387" Score="2" Body="&lt;p&gt;This is the challenge for below-mean semivariance in optimization.  Since the mean becomes a moving target, the observations that impact the min function change.  Estrada proposed a heuristic method for optimization and Beach(2011) discusses the decomposition and semi covariances.  Below target semivariance assumes investors do not change their target return, if you believe that one.&lt;/p&gt;&#xA;" OwnerUserId="17311" LastActivityDate="2015-08-24T02:28:40.387" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19442" PostTypeId="2" ParentId="19440" CreationDate="2015-08-24T05:18:14.023" Score="1" Body="&lt;p&gt;would it affect CVA? that would depend on what happens on breaking.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Normally if we break a swap, the swap is over and there are no more cash-flows. &#xA;We would only break if the NPV is negative and in that case we have no credit exposure so no effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, CVA is generally computed on a book basis and that is more complicated. Ultimately, you have to simulate and PV the book on each default date. That PV will change if the swap has a break clause. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-08-24T05:18:14.023" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19443" PostTypeId="1" CreationDate="2015-08-24T10:23:27.613" Score="2" ViewCount="2376" Body="&lt;p&gt;I have a problem with vega hedging.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the management of an exotic derivative, such as Barrier option. Typically we do the following tasks:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;selecting a pricing model, say, a local volatility model such as CEV model.&lt;/li&gt;&#xA;&lt;li&gt;choosing a relevant European option &lt;strong&gt;implied volatility smile/skew&lt;/strong&gt; as the calibration instrument.&lt;/li&gt;&#xA;&lt;li&gt;Calibrating the pricing model to the calibration instrument and use the calibrated model to find the value of exotic.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;My question is how to find the vega greek? As it's the whole &lt;strong&gt;imp vol smile/skew&lt;/strong&gt; that affects the value of the exotic, should I calculate vega(K) by bumping each imp vol with strike K one at a time, and construct the hedging portfolio by using vanilla options across all strikes? (I don't think it's going to happen in practice considering the illiquidity of OTM option.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be best if anyone could provide some reference dealing with this issue. Thanks!!!&lt;/p&gt;&#xA;" OwnerUserId="6910" LastActivityDate="2015-10-23T21:40:19.900" Title="Vega hedging with implied volatility smile" Tags="&lt;option-pricing&gt;&lt;hedging&gt;&lt;volatility-smile&gt;&lt;local-volatility&gt;&lt;vega&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19444" PostTypeId="1" AcceptedAnswerId="19453" CreationDate="2015-08-24T11:15:27.493" Score="2" ViewCount="173" Body="&lt;p&gt;Is there a noun for investment funds which do not disclose the assets they are investing in to their customers?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some exchanges are called &quot;Dark Pools&quot; where the orderbook is hidden to traders, so I thought there might be a similar noun for hidden investment strategies.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2015-08-24T17:54:03.310" LastActivityDate="2015-08-24T18:10:27.503" Title="Hidden/Dark Pool Hedge Funds" Tags="&lt;investing&gt;&lt;hedge-fund&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19445" PostTypeId="2" ParentId="19352" CreationDate="2015-08-24T13:09:52.477" Score="0" Body="&lt;p&gt;In addition to the previous comments, I would like to add that are plenty of definitions for market neutrality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can for instance be market neutral in dollars, or market neutral in beta or running a spread based on some other mechanics (f.ex. cointegration)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some more info would help better answer your question.&lt;/p&gt;&#xA;" OwnerUserId="6781" LastActivityDate="2015-08-24T13:09:52.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19446" PostTypeId="2" ParentId="19418" CreationDate="2015-08-24T14:48:31.920" Score="1" Body="&lt;p&gt;The volatility goes to 0 once the crown is pegged to the Euro.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value of an exchange rate between Currency1 and Currency2 the the ratio of the value of Currency1/Currency2.  The realized volatility of a currency pair is the usually measured as some trailing average of the daily log-changes in this ratio.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After the conversion was made  the crown at a ratio of 30.1260 crowns to 1 Euro, this ratio hasn't changed and therefore the exchanged rate is fixed.  The volatility of a constant series is 0.&lt;/p&gt;&#xA;" OwnerUserId="15338" LastActivityDate="2015-08-24T14:48:31.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19447" PostTypeId="1" CreationDate="2015-08-24T15:01:00.897" Score="1" ViewCount="29" Body="&lt;p&gt;What can I do with stiffness of numerical methods for SDE? &#xA;I want to use numerical approach for solving SDE in market's scenarios generation.&#xA;Is there any general approach to handle it?&lt;/p&gt;&#xA;" OwnerUserId="15935" LastActivityDate="2015-08-24T15:01:00.897" Title="Stiffness of numerical methods for SDE" Tags="&lt;numerical-methods&gt;&lt;sde&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19448" PostTypeId="1" CreationDate="2015-08-24T15:07:13.687" Score="2" ViewCount="61" Body="&lt;ol&gt;&#xA;&lt;li&gt;What general approaches could you recommend for modeling spot rates(for different maturities) and forward rates?(eg for LIBOR)&lt;/li&gt;&#xA;&lt;li&gt;I need to generate scenarios for term-structure of interest rates.&lt;/li&gt;&#xA;&lt;li&gt;What is an optimal way to generate scenarios for interest rates when the number of scenarios is restricted(# of paths is bounded)? I want to build optimal ensemble of trajectories.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="15935" LastEditorUserId="15935" LastEditDate="2015-08-26T11:05:53.047" LastActivityDate="2015-08-26T11:05:53.047" Title="The best way to generate market scenarios" Tags="&lt;risk-management&gt;&lt;risk-models&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="1" ClosedDate="2015-08-25T04:48:56.260" ContentLicense="CC BY-SA 3.0" />
  <row Id="19450" PostTypeId="1" AcceptedAnswerId="19457" CreationDate="2015-08-24T17:30:42.423" Score="1" ViewCount="174" Body="&lt;p&gt;I'm attempting to follow an author's steps in an argument and having trouble seeing how Taylor series expansion can be applied to give the stated result.  The scenario is as follows. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The mid price of a stock evolves according to:&#xA;$$&#xA;dS_{u} = \sigma dW_{u}&#xA;$$&#xA;with initial value $S_{t}=s$ and $W_{t}$ being a standard one-dimensional Brownian motion with constant $\sigma$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming an stock inventory of size $q$ and an initial wealth, in dollars, of $x$, and agent's value function is given as:&#xA;$$&#xA;v(x, s, q, t)= \mathbb{E}[-exp(-\gamma(x+qS_{T}))]&#xA;$$&#xA;The author moves to state that this expectation can be written as:&#xA;$$&#xA;v(x, s, q, t)= -exp(-\gamma x)exp(-\gamma qs)exp&#xA;\left(\frac{\gamma^2q^2\sigma^2(T-t)}{2}\right)&#xA;$$&#xA;I believe that a Taylor series expansion is be applied to get this result but I can't follow how this is the case.  Can someone help me understand the steps?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried to follow the method outlined in this &lt;a href=&quot;https://en.wikipedia.org/wiki/Taylor_expansions_for_the_moments_of_functions_of_random_variables&quot; rel=&quot;nofollow&quot;&gt;Wikipedia entry&lt;/a&gt; on Taylor and random variables, but the above doesn't quite 'fit'.&lt;/p&gt;&#xA;" OwnerUserId="5498" LastActivityDate="2016-02-17T07:39:47.380" Title="How to arrive at expectation of negative utility function via Taylor series expansion" Tags="&lt;brownian-motion&gt;&lt;utility-theory&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19451" PostTypeId="1" AcceptedAnswerId="19496" CreationDate="2015-08-24T17:58:25.280" Score="1" ViewCount="2019" Body="&lt;p&gt;There are various sources for real-time exchange rate data, e.g. &lt;a href=&quot;http://www.ariva.de/euro-dollar-kurs/push-chart?boerse_id=130&quot; rel=&quot;nofollow&quot;&gt;Ariva EUR/USD&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there also an API or other source which enables to automatically retrieve real-time exchange rates as a data stream e.g. for a trading tool (e.g. in Excel/C#)?&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2017-05-29T17:24:05.247" Title="Realtime Exchange Rate Data API" Tags="&lt;programming&gt;&lt;fx&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19452" PostTypeId="2" ParentId="19451" CreationDate="2015-08-24T18:02:18.137" Score="3" Body="&lt;p&gt;Bloomberg's programmable plugin will do this.&#xA;So will Reuters or Activ Tick or any other number of manage data brokers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All it involves is signing a contract and paying. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think you'll need to flesh out your question a bit more to get a more detailed answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interactive brokers does offer a fair bit of data in &quot;real time&quot;, assume its a few seconds delayed due to receiving it over the internet.  I'm guessing they probably throttle their feeds to around a max of 2 quote changes per second per symbol.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Is there also an API or other source which enables to automatically retrieve real-time exchange rates as a data stream e.g. for a trading tool (e.g. in Excel/C#)?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This might just be a terminology issue but you probably want your real time data to stream to you not be retrieved as that implies polling.&lt;/p&gt;&#xA;" OwnerUserId="743" LastEditorUserId="743" LastEditDate="2015-08-24T18:21:15.430" LastActivityDate="2015-08-24T18:21:15.430" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19453" PostTypeId="2" ParentId="19444" CreationDate="2015-08-24T18:10:27.503" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Is there a noun for investment funds which do not disclose the assets they are investing in to their customers?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Hedge fund?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other than 13F filling requirements( US specific) I don't really know any that make their entire book public to their investors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But to directly answer the question I haven't heard of a term that is meant to describe this.  It just happens to be that almost all hedge funds are as secretive about their holdings as possible until  its in their best interest to make it public ala the olive garden break stick manifesto&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.usatoday.com/story/money/business/2014/09/12/olive-garden-darden-starboard-value/15510761/&quot; rel=&quot;nofollow&quot;&gt;http://www.usatoday.com/story/money/business/2014/09/12/olive-garden-darden-starboard-value/15510761/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="743" LastActivityDate="2015-08-24T18:10:27.503" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19454" PostTypeId="1" AcceptedAnswerId="19456" CreationDate="2015-08-24T19:10:24.547" Score="5" ViewCount="6452" Body="&lt;p&gt;I would like to ask 5 questions about relations between these processes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Could white noise be also a random walk?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Could random walk be also a white noise?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Could white noise be stationary?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) Could random walk be stationary?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5) Could stationary process have autocorrelation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance.&lt;/p&gt;&#xA;" OwnerUserId="17113" LastActivityDate="2015-08-25T03:44:33.083" Title="Relationships between white noise and random walk" Tags="&lt;time-series&gt;&lt;stochastic-processes&gt;&lt;random-walk&gt;&lt;stationarity&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19455" PostTypeId="2" ParentId="1392" CreationDate="2015-08-24T19:23:38.797" Score="5" Body="&lt;p&gt;Cassandra is the obvious choice. With MongoDB or any RDBMS, you will hold all ticks in a table (collection in Mongo-speak) and index by ticker. This means that when you want to retrieve data for a ticker, the data will not be contiguously stored, and you will have a &lt;em&gt;massive&lt;/em&gt; usage of index and random reads. Even with SSDs this is slow. For 500k ticks into Python from Mongo it takes me well over 200 seconds on a single 16GB SSD-equipped I7. Yes you can cluster, but the starting point is poor. Imagine if you need to bring in 100 tickers?&lt;/p&gt;&#xA;&lt;p&gt;With Cassandra, everything is stored in column families. Big dicts of dicts, basically. You get entirely sequential storage of each ticker, meaning you can go back to spinning HDs if you want, but with SSDs it positively screams for data retrieval. I'm talking under 15 seconds for the same as the above. I'm not even going to go into the ease with which adding nodes to Cassandra speeds this up. The 15-second average is on a &lt;em&gt;single computer&lt;/em&gt;. Lots of the &amp;quot;reasons for Cassandra&amp;quot; on the web talk about its easy scale-out using multiple nodes, and it's true this will make it even faster / safer, but for me this sequential columnar storage is what makes it perfect for finance. It starts out geared for timeseries, wherease Mongo does not. The design gives you at least an order of magnitude out-of-the-box before you even start messing with clusters and/or optimization. If you know Python, the analogy is simple. Cassandra is to Mongo (or an RDBMS) as Numpy is to Python lists. Chained pointers to scattered datapoints as opposed to a big chunk of contiguous data.&lt;/p&gt;&#xA;&lt;p&gt;The converse of course is also true. If your use case is single (few) record(s) amongst millions (typical in web applications), Mongo makes this much easier than Cassandra. Cassandra is for big data, whereas Mongo/RDBMS map better to website-userID style workloads. Parodoxically, while SQL for example is considered quite rigid compared with &amp;quot;NoSQL&amp;quot;, in my opinion, Cassandra is even more rigid than relational databases. But boy do you get performance if you accept its structures.&lt;/p&gt;&#xA;&lt;p&gt;BTW Hbase is another columnar choice but I have no experience with it. The main message is, forget about RDBMS or &amp;quot;traditional&amp;quot; NoSQL. These are bad choices for multiple time series. What you want is a column database, of which Cassandra is an excellent example.&lt;/p&gt;&#xA;" OwnerUserId="954" LastEditorUserId="25057" LastEditDate="2020-08-20T13:02:13.750" LastActivityDate="2020-08-20T13:02:13.750" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="19456" PostTypeId="2" ParentId="19454" CreationDate="2015-08-24T20:08:02.750" Score="11" Body="&lt;p&gt;I will assume a white noise is a process $(\varepsilon_t)$ with zero mean, no autocorrelation and constant variance $\sigma^2 &amp;gt; 0$ while a random walk is a process $(x_t)$ defined by &#xA;$$&#xA;  x_{t+1} = x_t + \varepsilon_{t+1} &#xA;$$&#xA;where $\varepsilon$ is a white noise. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) No since $Var(x_{t+1}) = Var(x_t) + Var(\varepsilon_{t+1})$ is stricly increasing while the variance of a white noise is constant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) No same reason as above. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) By definition, it is stationary up to order 2. A strong white noise (i.e. an i.i.d sequence) is strongly stationary. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) No, again because $Var(x_{t+1}) &amp;gt; Var(x_t)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;5) Yes, the simplest example is an AR(1) process &#xA;$$&#xA;  x_{t+1} = c + \varphi x_t + \varepsilon_{t+1}&#xA;$$&#xA;It has autocorrelation $\rho(j) = \varphi^j$ and it is stationary if $|\varphi| &amp;lt; 1$.  &lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2015-08-24T20:08:02.750" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19457" PostTypeId="2" ParentId="19450" CreationDate="2015-08-24T20:15:55.107" Score="1" Body="&lt;p&gt;To answer your question you need to look at what the distribution is of $S_T$. Since $dS = \sigma dW$ we have that $S_T$ is normal distribution with variance  of $\sigma^2 (T)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you get $E(-exp(-\gamma(x + qS_T))) = -exp(-\gamma x) E (exp(-\gamma q S_T))$. Given that $S_T$ is normal $-\gamma q S_T$ is normal as well. You just scale the variance with $q^2 \gamma^2$. Finally you need to see that an exponent of a normal distribution is log-normal. The mean of a log normal is given by $exp(\mu + 0.5\sigma^2)$ (where $\mu$ is mean of your normal and $\sigma$ is stdev of your normal). You just need to plug in the mean and variance of your scaled normal $\gamma q S_T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also see &#xA;&lt;a href=&quot;https://en.wikipedia.org/wiki/Log-normal_distribution&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Log-normal_distribution&lt;/a&gt;&#xA;&lt;a href=&quot;https://en.wikipedia.org/wiki/Geometric_Brownian_motion&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Geometric_Brownian_motion&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2015-08-24T20:15:55.107" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19458" PostTypeId="2" ParentId="19443" CreationDate="2015-08-24T20:21:38.573" Score="1" Body="&lt;p&gt;since vega is the sensitivity to a parallel shift of the entire vol surface, why do you not simply bump the entire input surface all at the same time? You can bump all your vanillas simultanous then recalibrate your model to the bumped surface. The use your model to reprice, which gives you your vega.&lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2015-08-24T20:21:38.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19459" PostTypeId="2" ParentId="3864" CreationDate="2015-08-24T20:24:39.570" Score="0" Body="&lt;p&gt;There's a decent amount of literature about market making under uncertainty, one just needs to look.  Start with the below and then use this title as a search for other relevant articles, it's cited a lot:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.researchgate.net/publication/4787638_Optimal_Dealer_Pricing_Under_Transactions_and_Return_Uncertainty&quot; rel=&quot;nofollow&quot;&gt;Optimal Dealer Pricing Under Transactions and Return Uncertainty&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="5498" LastActivityDate="2015-08-24T20:24:39.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19460" PostTypeId="2" ParentId="19443" CreationDate="2015-08-24T20:44:50.903" Score="3" Body="&lt;p&gt;Instead of just considering a parallel shift of the whole volatility surface, you can decompose the surface into maturities/strikes domains, so called buckets and consider Vega buckets which are sensitivities wrt to bumps of each of these domains. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The vol smile is often inter/extra-polated using a model calibrated to market prices, e.g. the SABR model or SVI. So you can measure risk by considering sensitivities to bumps of the internal parameters of the model instead ($\alpha,\beta$ and $\rho$ risks for SABR).   &lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2015-08-24T20:44:50.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19461" PostTypeId="1" CreationDate="2015-08-24T20:59:17.240" Score="2" ViewCount="38" Body="&lt;p&gt;Following model was estimated on 200 observations. How to specify the level of integration of $X_t?$ In brackets there are standard errors and p-value of Breusch-Godfrey test is also shown.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_t=0,02+\underset{(0,06)}{0,94}X_{t-1}+\varepsilon_t\qquad pv(BG)=0,765$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Delta X_t=0,03-\underset{(0,71)}{0,52}X_{t-1}+\varepsilon_t\qquad pv(BG)=0,878$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Delta X_t=0,03-\underset{(0,05)}{0,51}X_{t-1}-\underset{(0,09)}{0,02}\Delta X_{t-1}+\varepsilon_t\qquad pv(BG)=0,775$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Delta \Delta X_t=0,02-\underset{(0,05)}{0,62} \Delta X_{t-1}+\varepsilon_t\qquad pv(BG)=0,852$ &lt;/p&gt;&#xA;" OwnerUserId="17113" LastActivityDate="2015-08-24T20:59:17.240" Title="Specifying integration level of time series" Tags="&lt;time-series&gt;&lt;stochastic-processes&gt;&lt;models&gt;&lt;cointegration&gt;&lt;testing&gt;" AnswerCount="0" CommentCount="2" ClosedDate="2015-08-26T12:55:33.133" ContentLicense="CC BY-SA 3.0" />
  <row Id="19462" PostTypeId="2" ParentId="16261" CreationDate="2015-08-24T22:37:57.393" Score="5" Body="&lt;p&gt;To answer your questions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is the trading p&amp;amp;l meant to be the delta-hedging p&amp;amp;l?&lt;/strong&gt;&#xA;Yes, in his example it concerns delta hedged pnl.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;how come p&amp;amp;l is raising steadily even when stock price is rising?&lt;/strong&gt;&#xA; the trader should be losing money on the delta hedging because he is short gamma?&#xA;He is short gamma but long theta. He is initially making money because as per his chart (the bottom one) initially when the stock is rising the realized vol is below 30%. His gamma pnl would equal his theta pnl if realized would equal 30%. However initially the realized vol is less than 30% therefore he makes more on his theta than he loses on his gamma. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This follow from the black scholes PDE. &#xA;$\theta + 0.5 \sigma^2 S^2 \gamma + r S \delta - rV = 0$&#xA;(perhaps a bit sloppy. you can derive this much nicer with r&gt;0) but take r = 0. Then you will see immediately that $\theta = - 0.5 \sigma^2 \gamma$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;why does it start from zero ? When trader has sold the option, he should have bought the stock and trading p&amp;amp;l at that point was negative?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If at time 0 the value of any asset is say S, and you buy it at S and immediately you look at your pnl then you bought at S and you can sell at S. Therefore your theoretical pnl is 0. &lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2015-08-24T22:37:57.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19463" PostTypeId="2" ParentId="19454" CreationDate="2015-08-25T03:25:23.193" Score="4" Body="&lt;p&gt;Regarding the relationship between white noise and a random walk, I would put it this way: a random walk is integrated white noise. [And vice versa we get a white noise when we differentiate/difference a random walk]. Or to put it in quant finance terms: white noise is like the daily changes in the S&amp;amp;P in points, a random walk is the S&amp;amp;P daily level itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, just for fun, of these two time series, which is the white noise and which is the random walk?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[2115,2120.5,2117.1,2097.4,2113.4,2114.2,2098.5,2101.6,2099.1,2108.3,2091.3]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[5.5,-3.4,-19.7,16,0.8,-15.7,3.1,-2.5,9.2,-17]&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2015-08-25T03:44:33.083" LastActivityDate="2015-08-25T03:44:33.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19464" PostTypeId="1" CreationDate="2015-08-25T06:54:03.397" Score="1" ViewCount="215" Body="&lt;p&gt;I have a student doing a project on  default rate &amp;amp; prepayment rate for mortgages.  She would like to include a section on how the quantities affect pricing, &amp;amp; so would like to reference a formula that gives the value of a mortgage in terms of them, say for constant values of them.  I think it used to be possible to find them in one or both of Fabozzi's books, (fixed income handbook and mortgage handbook) but the editions she found in the library did not in fact have them.&#xA;So the QUESTION is does someone know a readily available source that has a formula for the value of a mortgage in terms of these quantities or basically the same thing, psa, smm etc.&lt;/p&gt;&#xA;" OwnerUserId="17319" LastActivityDate="2016-07-01T07:14:15.510" Title="reference for elementary mortgage math" Tags="&lt;mbs&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19465" PostTypeId="2" ParentId="19418" CreationDate="2015-08-25T14:22:11.330" Score="1" Body="&lt;p&gt;I am not sure what the purpose of your volatility calculation is. So, frankly, the question does not make 100% sense to me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, countries do not engage in trade with just one other country but with many, so from an International Trade Theory point of view looking at a single bi-lateral rate (even an important one like SLOVAKIA/EUR) is not enough. Slovakia no longer experiences currency fluctuations with its eurozone partners, but it still trades (presumably) with USA, China, etc. So you should consider looking at an Effective Exchange Rate for Slovakia. EER's are computed by central banks or national statistics institutes by a mathematical formula that essentially averages together many bilateral exchange rates in proportion to how much the country trades with those countries. [In fact they are sometimes called trade weighted exchange rates].&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2015-08-25T16:12:44.597" LastActivityDate="2015-08-25T16:12:44.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19466" PostTypeId="1" CreationDate="2015-08-25T15:26:26.000" Score="4" ViewCount="403" Body="&lt;p&gt;Can someone explain how the monthly earnings estimates are derived for S&amp;amp;P500? &#xA;Quandl sources &lt;a href=&quot;http://www.multpl.com/s-p-500-earnings-yield/table/by-month&quot; rel=&quot;noreferrer&quot;&gt;multpl.com&lt;/a&gt;, who state:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Yields following March 2015 (including current yield) are estimated based on 12 month earnings through March 2015 — the latest reported by S&amp;amp;P. &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there a release schedule for S&amp;amp;P500 (ttm) earnings somewhere?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to be able to manually derive and match the Quandl estimates on the first of each month.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, how stable are the Quandl estimates? That is to say, if I use some historical record, but try to replicate each estimate on the first of each month, are they often revised such that the 1st of the month estimates would not reflect the historical values?&lt;/p&gt;&#xA;" OwnerUserId="17324" LastEditorUserId="17324" LastEditDate="2015-08-25T16:21:36.703" LastActivityDate="2018-03-21T12:31:06.920" Title="How are Quandl monthly S&amp;P500 earnings estimates derived?" Tags="&lt;estimation&gt;&lt;earnings&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19467" PostTypeId="2" ParentId="16532" CreationDate="2015-08-25T17:19:40.160" Score="1" Body="&lt;p&gt;Sorry to disagree but if interest rates is 0, the binary is still not worth $1 now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose spot $S(0) = 100$, assume $x = 110$ and upon touch (whenever it happens as the option has no maturity) you receive one dollar. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose I buy 1 stock. If the barrier hits, i sell the stock and receive 110 USD. What if I buy N stocks at t=0? upon hit of barrier i sell my stock and pocket N*110. Now pick N = $\frac{1}{110}$. When i sell my N stocks upon hit, I will hold $N*110 = 1$ USD. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this strategy of holding $N = 1/110$ stocks replicates the payout. Furthermore at iniation it costs me $N*S(0) = 100/110 = 0.909090$. Note that this is cheaper than your price of 1 USD.&lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2015-08-25T17:19:40.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19468" PostTypeId="1" AcceptedAnswerId="19470" CreationDate="2015-08-25T21:30:14.277" Score="4" ViewCount="431" Body="&lt;p&gt;I am very new to the stocks. I checked the TNTE.AS stock on Yahoo Finance website. Here it provides &quot;Interactive Chart&quot; and &quot;Historical Prices&quot;.&#xA;But I found they are showing different values.&#xA;For example:&#xA;in the &quot;Interactive Chart&quot;, if you put the cursor for the date (24-March-2015), you can see that the High value of the price is 5.91. But in the &quot;Historical Prices&quot;, the High value on date 24-March-2015 is 11.82.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But for the date 25-March-2015, the values from &quot;Interactive Chart&quot; are the same as the values from &quot;Historical Prices&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that it may have something to do with &quot;split&quot;. But the values from &quot;Interactive Chart&quot; are the ones I want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question is: how do I download an csv.file, which has the values exactly the same as those from &quot;Interactive Chart&quot;? --- Especially for &quot;High&quot; values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The url for &quot;Interactive Chart&quot; is&#xA;&lt;a href=&quot;http://finance.yahoo.com/echarts?s=TNTE.AS+Interactive#&quot; rel=&quot;nofollow&quot;&gt;http://finance.yahoo.com/echarts?s=TNTE.AS+Interactive#&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The url for &quot;Historical Prices&quot; is&#xA;&lt;a href=&quot;http://finance.yahoo.com/q/hp?s=TNTE.AS&amp;amp;d=7&amp;amp;e=25&amp;amp;f=2015&amp;amp;g=d&amp;amp;a=4&amp;amp;b=25&amp;amp;c=2011&amp;amp;z=66&amp;amp;y=66&quot; rel=&quot;nofollow&quot;&gt;http://finance.yahoo.com/q/hp?s=TNTE.AS&amp;amp;d=7&amp;amp;e=25&amp;amp;f=2015&amp;amp;g=d&amp;amp;a=4&amp;amp;b=25&amp;amp;c=2011&amp;amp;z=66&amp;amp;y=66&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17326" LastActivityDate="2015-08-25T21:33:13.910" Title="Yahoo finance, interactive chart and historical prices are different" Tags="&lt;programming&gt;&lt;finance&gt;&lt;yahoo&gt;&lt;split&gt;&lt;csv&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19469" PostTypeId="1" AcceptedAnswerId="19506" CreationDate="2015-08-25T21:30:45.570" Score="11" ViewCount="657" Body="&lt;p&gt;Some people &lt;a href=&quot;http://www.cnbc.com/2015/08/25/cuban-takes-another-jab-at-high-frequency-trading.html?utm_medium=twitter&amp;amp;utm_source=twitterfeed&quot;&gt;1&lt;/a&gt;, &lt;a href=&quot;http://www.investmentnews.com/article/20150825/BLOG09/150829955/are-hft-and-computers-to-blame-for-the-markets-quick-drop?utm_medium=twitter&amp;amp;utm_source=twitterfeed&quot;&gt;2&lt;/a&gt;, &lt;a href=&quot;http://www.zerohedge.com/news/2015-08-25/cutting-through-hft-lies-what-really-happened-during-flash-crash-august-24-2015&quot;&gt;3&lt;/a&gt; claim that High Frequency Trading is partly to blame for the extreme volatilities in the markets yesterday (24. August 2015). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is that true?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the amount HFTs move even enough to push the markets down like that? Does this behaviour align with the way they operate?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can you explain the low Dow Jones market open? Isn't it more likely that private investors just sell at market open? Why would HFTs even trade directly to market open when there is no &lt;em&gt;arbitrage&lt;/em&gt; to make?&lt;/p&gt;&#xA;" OwnerUserId="15763" LastActivityDate="2016-08-23T07:59:51.010" Title="HFT to blame for Flash Crashes?" Tags="&lt;volatility&gt;&lt;high-frequency&gt;&lt;market-making&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19470" PostTypeId="2" ParentId="19468" CreationDate="2015-08-25T21:33:13.910" Score="1" Body="&lt;p&gt;You need the &quot;adjusted high&quot;. However, Yahoo Finance does not provide that: &lt;a href=&quot;https://help.yahoo.com/kb/SLN2311.html&quot; rel=&quot;nofollow&quot;&gt;https://help.yahoo.com/kb/SLN2311.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However you can adjust manually. From the Normal Close and the Adjusted Close just compute the adjustment factor and then manually adjust the High. &lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-08-25T21:33:13.910" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19472" PostTypeId="2" ParentId="19432" CreationDate="2015-08-25T23:10:19.717" Score="1" Body="&lt;p&gt;Philosphically, I agree with you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes you will see people like Icahn, Kohlberg Kravis... buy a majority stake in a company and take it private, selling off parts of the company, restructuring others. One interpretation of this activity is exactly what you said: there is a mispricing in the stock (compared to assets, earnings, whatever), but no way to profit by setting up an arbitrage strategy involving stocks, bonds and other publicly traded securities of this and other firms, futures, ... . So these people have to do something else to earn a living [ ;-) ]. Arbitrage only takes care of situations where you can &lt;em&gt;replicate&lt;/em&gt; one security by taking positions in other securities. In the real world (unlike the Arrow Debreu world) often you cannot do that, there aren't enough securities.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2015-08-25T23:23:59.967" LastActivityDate="2015-08-25T23:23:59.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19473" PostTypeId="1" AcceptedAnswerId="19474" CreationDate="2015-08-25T23:38:35.653" Score="2" ViewCount="1366" Body="&lt;p&gt;In his &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1118316673&quot; rel=&quot;nofollow&quot;&gt;book&lt;/a&gt;, Gregory describes a netting set as&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;a set of trades that can be legally netted together in the event of a&#xA;  default&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Obviously, the netting agreements (as per ISDA master agreement) need to be compatible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But are there other requirements?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a generally-accepted algorithm for producing netting sets from a portfolio?&lt;/p&gt;&#xA;" OwnerUserId="6416" LastEditorUserId="467" LastEditDate="2015-08-26T01:06:48.140" LastActivityDate="2015-08-26T01:20:15.490" Title="How are netting sets determined for CVA calculation?" Tags="&lt;credit-risk&gt;&lt;cva&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19474" PostTypeId="2" ParentId="19473" CreationDate="2015-08-26T01:20:15.490" Score="1" Body="&lt;p&gt;I believe netting sets are usually provided as inputs to the algorithm in most-cases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you were to kind of &quot;guess&quot; netting sets given different trades (in general) data, you could start by grouping them by counterparty. I'm not a legal specialist but my understanding is that counterparty here is to be understood as &quot;legal entity&quot; or something like that, and the fact that one entity defaults doesn't necessarily entitle you not to pay what you may own to some other entity on another leg of the deal.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2015-08-26T01:20:15.490" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19475" PostTypeId="1" AcceptedAnswerId="19478" CreationDate="2015-08-26T04:55:27.737" Score="1" ViewCount="966" Body="&lt;p&gt;Can't seem to figure this one out by thinking it through.  Let's say that the simple return $R_t=P_{t+1}/P_t -1$ is assumed to be $R_t \sim iid N(0,\sigma^2)$.  Thus, a two period return would be $(1+R_t)(1+R_{t+1})-1$.  Would the variance of the two period return be equal to $2\sigma^2 + \sigma^4$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Var((1+R_t)(1+R_{t+1})-1)=Var(1+R_{t+1}+R_t+R_tR_{t+1})$$&#xA;$$ = 2\sigma^2 +Var(R_tR_{t+1}) = 2\sigma^2 + \sigma^4$$&#xA;since variance of two independent random variable products are just the product of both random variable variance (with $\mu=0$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under log returns, returns become additive and two period would be $log(1+R_t)+log(1+R_{t+1})$ and variance is equal to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Var(log(1+R_t)+log(1+R_{t+1})) = Var(log(1+R_t))+Var(log(1+R_{t+1}))=\sigma^2 + \sigma^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am i missing anything here?&lt;/p&gt;&#xA;" OwnerUserId="11888" LastActivityDate="2015-08-28T10:03:30.553" Title="Is variance additive only under Log-returns?" Tags="&lt;statistics&gt;&lt;variance&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19476" PostTypeId="2" ParentId="19020" CreationDate="2015-08-26T07:23:47.270" Score="0" Body="&lt;p&gt;I know this is almost a month old, but...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unless it is a homework assignment, you could have a look at &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2529539&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt; by Del Moral and Shevchenko, which gives a different estimator than the one you're probably using. It gives both a crude Monte Carlo-estimator and a sequential Monte Carlo-estimator. You probably just want the crude Monte Carlo one. Eq. (27) follows from Eq. (8) and standard MC arguments, as can be found in Glasserman's book. Eq. (8) follows from the tower property, as far as I recall.&lt;/p&gt;&#xA;" OwnerUserId="15244" LastActivityDate="2015-08-26T07:23:47.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19477" PostTypeId="2" ParentId="19475" CreationDate="2015-08-26T07:29:53.083" Score="1" Body="&lt;p&gt;You should clarify a bit your question.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Your first computation with $$Var((1+R_t)(1+R_{t+1})-1)$$ is ambiguous. What do you mean by $Var$ here? You have time subscripts $t$ and $t + 1$ so unless you specify which filtration you compute your variance, it is unclear what you're computing. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you are computing at $t = 0$, then this is not a two period return (especially when $t &amp;gt; 1$).  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you are computing at $\tau = t$ then the $t$-measurable random variables drop out of the variance computation. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;As to your log return computation, you are just abusing notations. Note that if $Z \sim N(\mu, \sigma)$, then it is definitely not true that $Var (  log (1 + Z) ) = \sigma^2$. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="17332" LastEditorUserId="16472" LastEditDate="2015-08-26T09:38:40.070" LastActivityDate="2015-08-26T09:38:40.070" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19478" PostTypeId="2" ParentId="19475" CreationDate="2015-08-26T08:34:08.230" Score="1" Body="&lt;p&gt;If you use log-returns, then it is true that the return over n periods is the sum of the returns over each subperiod (e.g. the 10 day return is the sum of 10 1-day returns)&#xA;$$&#xA;R = \sum_{i=1}^n r_i.&#xA;$$&#xA;If we now look at the variance of $R$ then we get&#xA;$$&#xA;VAR(R) = VAR( \sum_{i=1}^n r_i ),&#xA;$$&#xA;if we assume that the returns are uncorrelated then we get&#xA;$$&#xA;VAR(R) =  \sum_{i=1}^n VAR(r_i ).&#xA;$$&#xA;if we finally assume that $VAR(r_i) = \sigma^2$, i.e. it is the same for each day, then we get&#xA;$$&#xA;VAR(R) =  n \sigma^2.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: in you equastion above you have the expression&#xA;$VAR(R_tR_{t+1})$. This is not (!) $\sigma^4$ as $R_t$ and $R_{t+1}$ are usually 2 different random variables. They might have the same variance $\sigma^2$ but this does not mean that $VAR(R_tR_{t+1}) = E[R_t^4]$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This expression is rather:&#xA;$$&#xA;VAR(R_tR_{t+1}) = E[(R_tR_{t+1})^2]-E[R_tR_{t+1}]^2,&#xA;$$&#xA;and $E[R_tR_{t+1}]$ is connected to the lag one auto-correlation.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-08-28T10:03:30.553" LastActivityDate="2015-08-28T10:03:30.553" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19479" PostTypeId="2" ParentId="17925" CreationDate="2015-08-26T12:33:18.137" Score="1" Body="&lt;p&gt;First, set up the initial position with 0 initial cost: buy 1 PIK bond at face value (1000\$) and sell 1000$ worth of the 2-year zero-coupon to finance the purchase.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After one year, you either get paid 0.1 PIK bonds or 100$. In the first case, the position is kept unchanged until maturity at year 2. Your payoff will be the repayment of the PIK bonds (+ coupon) - the value of the zero bonds:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(1) V_2 = 1.1 V_{PIK} - 1000 (1+0.09)^2 = 1.1 (1000 + 100) - 1000 (1.09)^2 = 1210 - 1188.1 = 21.90$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the second scenario, you get 100$ from the coupon, which you reinvest in a 1-year ZC. If the worst-case scenario (lowest reinvestment rate, which is 8.5% in this case) yields a profit, we'll have an arbitrage. So, at maturity, we get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(2) V_2 = 1 V_{PIK} - 1000 (1+0.09)^2 + 100 (1+0.085) = 1 (1000 + 100) - 1000 (1.09)^2 + 100 (1.085) = 1100 - 1188.1 + 108.5 = 20.40$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We've just proved that a zero-cost portfolio yields a positive profit under all scenarios, which is the definition of an arbitrage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another possible arbitrage can be built by financing the buying of the PIK bond by selling $100\$ (1+0.09)^{-1} = 91.74$ of the 1-year ZC, and making up the rest (908.26) by selling the 2-year ZC. This is also a zero-cost portfolio; but, in this case, if the year 1 coupon is in cash, we get repay the borrowing earlier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At year 1, same scenarios as before. But, in this case, if we receive 0.1 PIK, we need to roll over the short-term borrowing; so we'll use the worst-case rate for borrowing, which is 9.5%. At year 2, we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(1) V_2 = 1.1 V_{PIK} - (908.26)(1.09)^2 - 100(1.095) = 1210 - 1079.10 - 109.50 = 1210 - 1188.60 = 21.40$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the coupon is in cash, we repay the 100$ worth of the 1-year ZC, and at year 2, we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(2) V_2 = 1 V_{PIK} - (908.26)(1.09)^2 = 1100 - 1079.10 = 20.90$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Again, the zero-cost initial portfolio yields a positive profit with probability 1, so constitutes an arbitrage.&lt;/p&gt;&#xA;" OwnerUserId="15336" LastActivityDate="2015-08-26T12:33:18.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19481" PostTypeId="2" ParentId="19435" CreationDate="2015-08-26T13:20:34.673" Score="1" Body="&lt;p&gt;Sounds like PCA is not the approach you're looking for. If you're looking to transform a risk vector in terms of securities V into a risk vector in terms of securities W, then the basic approach would be to perform a linear regression of V against W. The resulting regression coefficients will form a matrix B which will give a change of basis between V and W.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that there will in general be some residual &quot;unexplained&quot; risk, i.e. part of the variation in the securities V will not be explained by variation in the securities W.&lt;/p&gt;&#xA;" OwnerUserId="17336" LastActivityDate="2015-08-26T13:20:34.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19482" PostTypeId="2" ParentId="19379" CreationDate="2015-08-26T13:36:18.027" Score="2" Body="&lt;p&gt;If you're lucky enough that the payment schedules (start/end dates, frequency, day count, business day adjustment etc.) are the same between the fixed leg of the interest rate swap and the &quot;spread&quot; leg of the basis swap, then you can simply use:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OIS rate (%) = IRS Rate (%) - 0.01 * (basis spread (bps))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise, to do it accurately, you'll need to do a bootstrap the two term structures (possibly simultaneously if there is mutual dependence between them).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[In fact, in the USD case, there is an added complication that comes from the OIS rate being a compounding rate, while the FedFunds rate is an arithmetic average.]&lt;/p&gt;&#xA;" OwnerUserId="17336" LastActivityDate="2015-08-26T13:36:18.027" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19483" PostTypeId="2" ParentId="16733" CreationDate="2015-08-26T13:55:41.493" Score="0" Body="&lt;p&gt;In general, practitioners may run a combined book of Bonds and Interest Rate derivatives (Libor IRS, OIS etc.) In this case, in order to have an understanding of risk which includes all parts of the book in a systematic way, it makes sense to link the price of bonds to the LIBOR/OIS curves which underlie the valuation of interest rate derivatives.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also there are some technical complexities when building a US treasury curve (or any bond curve for that matter) - individual bonds are driven by idiosyncratic factors (liquidity, specialness etc.) over and above the interest rate &amp;amp; credit default term structures. It can be difficult/impossible to isolate the different components that drive a bond's price and recover an idealised &quot;pure&quot; treasury-implied zero curve.&lt;/p&gt;&#xA;" OwnerUserId="17336" LastActivityDate="2015-08-26T13:55:41.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19484" PostTypeId="2" ParentId="19469" CreationDate="2015-08-26T14:19:45.387" Score="2" Body="&lt;p&gt;By design, market makers do not exacerbate volatility because their trades are, as a whole, net passive.&lt;/p&gt;&#xA;" OwnerUserId="4614" LastActivityDate="2015-08-26T14:19:45.387" CommentCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="19485" PostTypeId="1" CreationDate="2015-08-26T16:04:06.767" Score="4" ViewCount="651" Body="&lt;p&gt;There are a number of exchanges that trade vanilla Call/Put American/European options on various underlyings (equities, indices, futures). There have been some trading in digital options on certain underlyings in US, but I don't see any indication that they are still traded. The ICE exchange lists some Asian APOs (Average Price Options), while both CME and The ICE list some CSOs (Calendar Spread Options) which I would also consider exotic for the purposes of this question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What other exchange-traded exotic options do you know? Please, specify the name of the exchange and the type of the exotic options that are offered there.&lt;/p&gt;&#xA;" OwnerUserId="2530" LastActivityDate="2020-04-18T13:37:32.837" Title="What exotic options are exchange-traded?" Tags="&lt;options&gt;&lt;exotics&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19487" PostTypeId="2" ParentId="17993" CreationDate="2015-08-26T20:13:23.287" Score="1" Body="&lt;p&gt;Conventional wisdom would have it that the system would be arbitrage free if and only if:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;All the implied spot and forward rates on each curve are non-negative (I.e implied discount factors are monotonic non-increasing wrt maturity)&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;All the implied spot and forward rates on the 3M curve are greater than or equal to the corresponding rates on the OIS curve (I.e implied 3M curve discount factors are &amp;lt;= the corresponding implied OIS curve discount factors)&lt;/li&gt;&#xA;&lt;/ol&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;HOWEVER, 1. has been persistently violated in the EUR OIS market for months, and 2. has been violated from time to time. This shows that conventional wisdom is bunkum.&lt;/p&gt;&#xA;" OwnerUserId="17337" LastActivityDate="2015-08-26T20:13:23.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19488" PostTypeId="2" ParentId="16553" CreationDate="2015-08-26T20:45:51.653" Score="1" Body="&lt;p&gt;Deposits are tradable instruments and the deposit rates on broker screens etc. represent indicative market quotes for these instruments. They can be traded for any maturity in theory but most deposits would be less than a year in maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;LIBOR rates, on the other hand are benchmark interest rates for selected maturities, published each working day by a central calculating agent based on the submissions of participating banks' opinions on hypothetical borrowing rates.&lt;/p&gt;&#xA;" OwnerUserId="17337" LastActivityDate="2015-08-26T20:45:51.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19489" PostTypeId="1" CreationDate="2015-08-27T05:01:03.047" Score="8" ViewCount="662" Body="&lt;p&gt;I want to study if the odds of an up or down day in a forex pairs is 50-50. I just count the total number of up and down days in X years and compare it with the total days. The results are very similar to a 50-50 chance. &#xA;&lt;strong&gt;Now&lt;/strong&gt; I want to see if by applying an EMA200 filter you have more probabilities of an up day if the closing price is above the EMA, and vice-versa for a closing price below the EMA. The results show that it´s more probable to obtain an up day if the closing price is above the EMA. &#xA;&lt;strong&gt;&lt;em&gt;The question is:&lt;/em&gt;&lt;/strong&gt; Does the test have any bias? I am worried that the results aren't true because of a bias in the test. Because the EMA depends on the price, maybe it´s just obvious that there are most up days if the price is above the EMA.  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$ema = EMA(Close,200); &#xA;foreach (NewDay) { $Totaldays++; &#xA;if (Today(Close) &amp;gt; Today(Open)){ $Totalup++; } &#xA;if (Today(Close) &amp;lt; Today(Open)){ $Totaldown++; } &#xA;if (Today(Close) == Today(Open)){ $Totaldojis++; } &#xA;    if (Today(Close) &amp;gt; Today($ema)){ $Totalabove++; &#xA;        if (Today(Close) &amp;gt; Today(Open)){ $Upabove++; } &#xA;        if (Today(Close) &amp;lt; Today(Open)){ $Downabove++; } &#xA;        if (Today(Close) == Today(Open)){ $Dojisabove++; } &#xA;    } &#xA;    if (Today(Close) &amp;lt; Today($ema)){ $Totalbelow++; &#xA;        if (Today(Close) &amp;gt; Today(Open)){ $Upbelow++; } &#xA;        if (Today(Close) &amp;lt; Today(Open)){ $Downbelow++; } &#xA;        if (Today(Close) == Today(Open)){ $Dojisbelow++; } &#xA;    }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;}&lt;/p&gt;&#xA;" OwnerUserId="17343" LastEditorUserId="17343" LastEditDate="2015-08-29T16:59:09.967" LastActivityDate="2021-05-09T23:05:10.587" Title="Up and Down days in GBPUSD and a Filter" Tags="&lt;time-series&gt;&lt;trading&gt;&lt;backtesting&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19490" PostTypeId="1" CreationDate="2015-08-27T05:01:16.247" Score="1" ViewCount="44" Body="&lt;p&gt;Data on the Medium (approx. 5-years) and Short (approx. 2-years) futures contract listed on ICE only goes back to 2009. Is anyone able to point me towards where I can get a longer time series, perhaps by joining data from a previous incarnation of the contract (even if on a different exchange).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, can anyone explain why there are large gaps in the 3-year swap and 3-year government bond in data around 2008&lt;/p&gt;&#xA;" OwnerUserId="11632" LastActivityDate="2015-08-27T05:01:16.247" Title="Historical UK Gilt 2-year and 5-year data" Tags="&lt;data&gt;&lt;market-data&gt;&lt;futures&gt;&lt;historical-data&gt;&lt;bond-futures&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19491" PostTypeId="2" ParentId="3446" CreationDate="2015-08-27T05:31:44.347" Score="1" Body="&lt;p&gt;Exchanges provides the following six timestamps:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Gateway In Timestamp-T1. Time at which the order was received by the Gateway from the members TCP connection.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Gateway Out Timestamp-T2. This is the time when the order was dispatched by the Gateway to the Matching engine.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Matcher In Timestamp-T3. This is the time the order was received by the Matching engine.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Matcher Out Timestamp-T4. This is the time the response leaves the Matching engine. This response could be an order confirmation or an immediate execution or both.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Gateway In Timestamp-Response-T5. This is the time the gateway receives the response from the Matching engine.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Gateway Out Timestamp-Response-T6. This is the time the gateway dispatches the response to the Members TCP connection.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The RTT(Round trip time) is T6-T1. All timestamps are in Nano seconds. This enables the member to accurately calculate the time spent in each leg of the journey for an order.&lt;/p&gt;&#xA;" OwnerUserId="3053" LastActivityDate="2015-08-27T05:31:44.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19492" PostTypeId="2" ParentId="19432" CreationDate="2015-08-27T05:56:13.370" Score="0" Body="&lt;p&gt;I'm trying to understand your question. To be concrete --- and trying to really putting your question in solid terms --- suppose for simplicity we are dealing with something like a standard geometric Brownian motion, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dS_t = \mu S_t dt + \Sigma S_t dW_t $$ &#xA;where $S = (S_{1}, ..., S_{n})$ represent stock price of the $n$ risky assets at time, and $W = (W_1, ..., W_n)$ is an $n$-dimensional Brownian motion. Say $\mu$ is $n$-dimensional drift and $\Sigma$ is $n \times n$ variance-covariance matrix. Assume the usual conditions such that there exists a strong or weak solution to this SDE. For good measure, throw in a risk free asset with instantaneous risk free rate $r$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So up to this point, I think most people would agree that this is a standard continuous time model for modeling $n$ risky assets (yes, you can put in other bells and whistles with jumps, stochastic volatility, more general stochastic integrator, etc, but let's just keep things simple). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this is the next point where I start to lose you. You say,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We can find if there is a arbitrage trading strategy or dominant&#xA;  trading strategy.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;I wonder if we cannot find such strategies, Can we conclude there is&#xA;  no mispricing in the stock prices.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;In my opinion, although no such strategies exists in the stochastic&#xA;  process. The mispricing still possibly exists in stock prices. I don't&#xA;  know if I am right.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;At this point, whether this model admits arbitrage or not is simply to invoke the First and Second Fundamental Theorem of Asset Pricing. But then are you deliberately rigging a model so that it admits arbitrage? But what is a good motivation to do so, especially in a continuous-time model? How would this be beneficial in pricing derivatives and/or understanding other asset pricing questions? &lt;/p&gt;&#xA;" OwnerUserId="17332" LastActivityDate="2015-08-27T05:56:13.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19493" PostTypeId="1" CreationDate="2015-08-27T12:29:59.117" Score="3" ViewCount="282" Body="&lt;p&gt;I am new to risk management.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am calculating the &lt;code&gt;VaR&lt;/code&gt; for a portfolio of futures contracts, long and shorts. I calculated it using the historical, parametric, and MC method. But there is something which is not very clear for me when it comes to the parameters i take to calculate the &lt;code&gt;MC VaR&lt;/code&gt;. I do a lookback on 270 days then generate my returns etc etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I have a doubt when it comes to the positions of my portfolio. How do you include that, you directly pick your position and fill your position matrix? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did that, but i think with this, you are missing the whole leverage aspect of the portfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would include this leverage in this, by multiplying the number of contracts by each point value of each futures composing the portfolio, say 250 for SP 500 futures? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because right now, I feel my &lt;code&gt;VaR&lt;/code&gt; figures a very low compared to the size of fictitious portfolio of around 10 million USD. I have some positions, and number of contracts( &gt; 5 ) on each 7 lines of my portfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One last question, if i have a short position, i should just add a minus in front my position right for the VaR calculation right?&lt;/p&gt;&#xA;" OwnerUserId="17123" LastEditorUserId="743" LastEditDate="2015-12-28T19:27:56.047" LastActivityDate="2015-12-28T19:27:56.047" Title="Futures Parameters for Value at Risk" Tags="&lt;risk&gt;&lt;futures&gt;&lt;var&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19494" PostTypeId="1" CreationDate="2015-08-27T12:42:25.563" Score="2" ViewCount="5360" Body="&lt;p&gt;Im using VaR to estimate parametric VaR. I have been able to do this using a Normal Distribution, however I want to also do this using a Student t-distribution and I'm unsure how to implement that in Matlab. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a dataset of portfolio values, I have log returns and returns as well as mean and standard deviation. The only suggested method I was able to find elsewhere was the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mu - t_\alpha * (sd/\sqrt{n})$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $\mu$ is the mean, sd is the standard deviation, t is the t stat at the alpha level and n is the number of returns. This would give the lower level of the alpha confidence interval. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone confirm if this is the correct or incorrect method to implement parametric VaR using a t-distribution. If it is incorrect, how would I be able to implement it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="17347" LastEditorUserId="11678" LastEditDate="2015-08-27T16:45:17.797" LastActivityDate="2020-11-17T21:45:18.840" Title="Parametric VaR with Student-t distribution" Tags="&lt;var&gt;&lt;value-at-risk&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19495" PostTypeId="2" ParentId="19485" CreationDate="2015-08-27T12:50:57.487" Score="2" Body="&lt;p&gt;Options on the spread between crude oil and petrol are traded on the cme&#xA;&lt;a href=&quot;http://www.cmegroup.com/trading/energy/refined-products/rbob-crack-spread-swap-futures_quotes_globex_options.html&quot; rel=&quot;nofollow&quot;&gt;http://www.cmegroup.com/trading/energy/refined-products/rbob-crack-spread-swap-futures_quotes_globex_options.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cmegroup.com/trading/energy/refined-products/heating-oil_quotes_globex_options.html#optionProductId=566&quot; rel=&quot;nofollow&quot;&gt;http://www.cmegroup.com/trading/energy/refined-products/heating-oil_quotes_globex_options.html#optionProductId=566&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17348" LastEditorUserId="17348" LastEditDate="2015-08-27T13:49:05.450" LastActivityDate="2015-08-27T13:49:05.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19496" PostTypeId="2" ParentId="19451" CreationDate="2015-08-27T12:54:58.657" Score="2" Body="&lt;p&gt;One of the spread betting firms in the UK (IG Index) has an API freely available (at &lt;a href=&quot;https://labs.ig.com/&quot; rel=&quot;nofollow&quot;&gt;https://labs.ig.com/&lt;/a&gt;) that provides streaming FX rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need an account to access the API, but you can sign-up for free and start using the API. They have a C# SDK available so you should be able to get up and running quite quickly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="17346" LastActivityDate="2015-08-27T12:54:58.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19497" PostTypeId="2" ParentId="2238" CreationDate="2015-08-27T12:55:12.200" Score="1" Body="&lt;p&gt;Of your list, usd callable swaps are definitely most popular, as, they are needed by banks to hedge fixed rate mortgages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ps, jeebs answer is not relevent for the interest rates markets&lt;/p&gt;&#xA;" OwnerUserId="17348" LastActivityDate="2015-08-27T12:55:12.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19498" PostTypeId="2" ParentId="2337" CreationDate="2015-08-27T13:04:50.967" Score="2" Body="&lt;p&gt;Normal distribution makes most sense these days for ratesthat are very low, or even negative, like euribor, chf libor&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Normal distribution is what is assumed by option brokers impliedvolatility quotes for these currencies&lt;/p&gt;&#xA;" OwnerUserId="17348" LastActivityDate="2015-08-27T13:04:50.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19499" PostTypeId="1" AcceptedAnswerId="19528" CreationDate="2015-08-27T13:48:13.320" Score="6" ViewCount="556" Body="&lt;p&gt;Given the dynamics of the risky asset ( with dividend $q$ ), &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{dS_t}{S_t}=(\mu-q)dt + \sigma dW_t^P&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a european option with payoff, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;  P_0(S) =&#xA;\begin{cases}&#xA;1,  &amp;amp; \text{if $S\le K$} \\&#xA;\frac{K^2}{S^2}, &amp;amp; \text{if $S\gt K$}&#xA;\end{cases}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm supposed to show that the value of the option is given by, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;V(S, t) = \left( \frac{K^2}{S^2}\right)e^{(3\sigma^2+2q-3r)(T-t)}\mathcal{N}(\hat{d_1})+e^{-r(T-t)}\mathcal{N}(-\hat{d_2})&#xA;$$&#xA;where&#xA;$$&#xA;\begin{align}&#xA;\hat{d_1}&amp;amp;=\frac{\text{log}(S/K)+(r-q-\frac{5}{2}\sigma^2)(T-t)}{\sigma \sqrt{T-t}}\\&#xA;\hat{d_2}&amp;amp;=\frac{\text{log}(S/K)+(r-q-\frac{1}{2}\sigma^2)(T-t)}{\sigma \sqrt{T-t}}\\&#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I got pretty close by doing the following, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align}&#xA;V(S, t) &amp;amp;= e^{-r(T-t) }\mathbb{E}_t^\mathbb{Q}\left[\mathbb{1}_{S_T \le K}  + \frac{K^2}{S^2}\mathbb{1}_{S_T\ge K}\right]\\&#xA;&amp;amp;= e^{-r(T-t) }\mathbb{Q}(S_T \le K) + \mathbb{E}_t^\mathbb{Q}\left[\frac{K^2}{S_T^2}\mathbb{1}_{S_T\ge K}\right]\\&#xA;&amp;amp;= e^{-r(T-t)}\mathcal{N}(-\hat{d_2})+ \frac{K^2}{S_t^2}\mathbb{E}_t^\mathbb{Q}\left[\frac{S_t^2}{S_T^2}\mathbb{1}_{S_T\ge K}\right]\\&#xA;&amp;amp;= e^{-r(T-t)}\mathcal{N}(-\hat{d_2})+ \frac{K^2}{S^2}\mathbb{E}_t^\mathbb{Q}\left[\text{exp}(-2(r-q-\frac{1}{2}\sigma^2)(T-t)-2\sigma W^Q_{T-t}) \cdot\mathbb{1}_{S_T\ge K} \right]\\&#xA;&amp;amp;= e^{-r(T-t)}\mathcal{N}(-\hat{d_2})+ \frac{K^2}{S^2}e^{(\sigma^2+2q-3r)}\mathbb{E}_t^\mathbb{Q}\left[\text{exp}(-2\sigma W^Q_{T-t}) \cdot\mathbb{1}_{S_T\ge K}\right]\\ &#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and then i'm not quite sure how to proceed from here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help is greatly appreciated!&lt;/p&gt;&#xA;" OwnerUserId="15771" LastEditorUserId="15771" LastEditDate="2015-08-29T07:28:10.450" LastActivityDate="2015-08-29T07:28:10.450" Title="Option with payoff $K^2/S^2$" Tags="&lt;option-pricing&gt;&lt;risk-neutral-measure&gt;&lt;numerairechange&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19500" PostTypeId="2" ParentId="19451" CreationDate="2015-08-27T13:56:47.593" Score="-1" Body="&lt;p&gt;Interactivebrokers is also an excellent platform thats been around for ages, and has api interfacing &lt;/p&gt;&#xA;" OwnerUserId="17348" LastActivityDate="2015-08-27T13:56:47.593" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19501" PostTypeId="2" ParentId="16553" CreationDate="2015-08-27T14:02:32.163" Score="2" Body="&lt;p&gt;Boththe base and term depos cannot be equal to libor rates.  This is because the forward points and spot are known , so, whatever rate you choose for 1 of the interest rates, the other will be implied from the arbitrage equation fwd=spot x (1 +rT)/(1+qT)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Practice in recent years has been to have the usd int rate come from the 3m libor curve.&lt;/p&gt;&#xA;" OwnerUserId="17348" LastActivityDate="2015-08-27T14:02:32.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19503" PostTypeId="2" ParentId="19475" CreationDate="2015-08-27T14:17:45.527" Score="0" Body="&lt;p&gt;Variance is additive also for any other distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason that variance is additive is because of the assumption of independent increments - ie, the change in underlying value between 2 moments is assumed to be independent of the change in value between 2 later moments&lt;/p&gt;&#xA;" OwnerUserId="17348" LastActivityDate="2015-08-27T14:17:45.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19504" PostTypeId="2" ParentId="19355" CreationDate="2015-08-27T14:38:36.743" Score="1" Body="&lt;p&gt;Ftse100 would not have a smooth dividend yield, as your formula has, it would be discrete, being much higher on certain days of year than others.  In pricing options on ftse, u need to take into account implied dividends (dividends that are implied by put call parity)&lt;/p&gt;&#xA;" OwnerUserId="17348" LastActivityDate="2015-08-27T14:38:36.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19506" PostTypeId="2" ParentId="19469" CreationDate="2015-08-27T15:39:22.093" Score="12" Body="&lt;p&gt;Using months of proprietary data that labels participants by their participant ID, it has been found that during periods of significant volatility, the composition of HFT participants in the book remains mostly constant as a fraction of the total BBO composition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What really changes, it was found, was that the fraction of low-frequency traders aggressing on HFT market makers increases significantly during periods of high volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This suggests that extreme volatility is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Not exacerbated by market makers withdrawing liquidity&lt;/li&gt;&#xA;&lt;li&gt;Likely exacerbated by low-frequency traders&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/oPrRP.png&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/oPrRP.png&quot; alt=&quot;HFT composition&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2015-08-27T15:39:22.093" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19507" PostTypeId="2" ParentId="12617" CreationDate="2015-08-27T15:48:40.420" Score="2" Body="&lt;p&gt;If I interpret your question below correctly:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I don't understand why the cash flow for the EUR spot long position is&#xA;  being calculated the way it is. It makes no sense to me. Seeing as it&#xA;  is a spot rate why is it's cash flow not simply spot * 100 MM EUR&#xA;  notional ?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You want to know why Jorion takes 100MM EUR * spot * 1/(1+&lt;strong&gt;eur_rate&lt;/strong&gt;) instead of 100MM * spot. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;First of all:&lt;/strong&gt; Note that you made the mistake of saying 100MM eur * spot * 1/(1+usd_rate) it should be the eur_rate. As in this context euro rate is foreigen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Secondly&lt;/strong&gt; the reason why he takes 100M EUR * spot * euroDiscount is because you do not need 100MM EUR at t=0; you need 100MM EUR at maturity. Therefore it is sufficient to start off with a smaller position (the discounted one against euro rate). &lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2015-08-27T15:48:40.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19508" PostTypeId="2" ParentId="19355" CreationDate="2015-08-27T16:27:03.267" Score="0" Body="&lt;p&gt;When valuing a plain index option, there are two options in terms of index dividend:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) The underlying price is a spot price like in the FTSE 100 case (option is valued off the index): you can use continuous dividend yield. You can imply a dividend yield from a linearized call-put parity:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The present value of the dividend payment is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$PV(div)=P-C+(S-K)+K(e^{rt} - 1)$, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;then the implied dividend yield is $d = \frac {PV(div)}{T*S}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) The underlying instrument is a future contract on the index (for example, IBEX35 or TAIEX), you'd set index dividend yield to &lt;strong&gt;zero&lt;/strong&gt; and use future price of corresponding maturity as an underlying price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the purposes of calculating option prices or implied volatilities, the use of a dividend forecasting model based on projected actual dividend growth rates can lead to an option model which is internally inconsistent. In contrast, the&#xA;use of a model based on constant dividend yields is not only consistent, but also easier to implement.&lt;/p&gt;&#xA;" OwnerUserId="2909" LastEditorUserId="2909" LastEditDate="2015-08-27T19:42:02.953" LastActivityDate="2015-08-27T19:42:02.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19509" PostTypeId="2" ParentId="19355" CreationDate="2015-08-27T16:33:26.637" Score="0" Body="&lt;p&gt;To expand on Randor's answer, the standard Black-Scholes formula as you've given it assumes a constant continuous dividend yield of $q$. To adapt this to cope with discrete deterministic (absolute) dividends $d_i$ at known times $\tau_i$, you could recast the formula in terms of the &quot;dividend-free&quot; stock price:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S^* := S - \sum_i d_i e^{-r\tau_i}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and set $q$ to zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;N.B. You only include dividends between spot and the option expiry.&lt;/p&gt;&#xA;" OwnerUserId="17337" LastActivityDate="2015-08-27T16:33:26.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19512" PostTypeId="2" ParentId="18559" CreationDate="2015-08-27T18:00:43.387" Score="2" Body="&lt;p&gt;It also depends on at what levels of the spot the higher vol gets realized. In your example:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;if you buy an option on a 40 vol expiring in a month and over the next&#xA;  month stock the average vol of the stock is 60 and you dynamically&#xA;  hedge, are you guaranteed to make money? If not could you please give&#xA;  me a simple example perhaps where you'd wind up losing money?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If the high volatility materializes in a region of the spot where your option has very little gamma, and the stock realizes high vol when your option has high gamma. Then even though on average realized &gt; implied you might not have made any money. So your gamma scalped pnl is dependent on the path the stock takes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So to make the above point more clear. Let's use your own numerical example:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;For instance, let's say XYZ is trading at $30 and has a normal skew&#xA;  (smirk) you buy Aug 45 calls at an implied vol of 24 and sell Aug 20&#xA;  calls at an implied vol of 40 and dynamically hedge&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So we know that you are short the K = 20 at vol of 40; and you are long K =45 at vol=24. Now start your blackscholes pricer and look up what the gamma is of your long and your short. You will notice that both options have very little gamma. Therefore no matter what realized is currently your not making much money from gamma hedging, but you are losing your theta. So not good. You need the realized vol to happen near the strikes that you are long (or short).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;lucky for you the stock drops like a brick and now trades around S=20. You re very happy cause you are short vol at 40. However, unlucky for you the realized turns out to be 50. So you lose on your short. Maybe you will now say....&quot;hang on, i am also long vol at 24. So therefore i make 26vol points on my long call&quot;. Unfortunately for you your long call K = 45 is so far out that it has 0.0 gamma left. So you just got creamed. Had the ultra high vol of 50 realized while the stock was at S = 45, then yes you d be making a lot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So. lucky for you the stock shoots up again and it is trading now at S=45. You remember that the vol used to be 50 while it was trading low. You hope to get a few high vol days at the strike that you are long. Too bad for you. Vol realizes to be 2. And you lose on your long call and your short call has 0.0 gamma at these levels and you're screwed again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Long story short&lt;/strong&gt; it matters where vol realizes relative to the strikes where you have gamma.&lt;/p&gt;&#xA;" OwnerUserId="17316" LastEditorUserId="17316" LastEditDate="2015-08-31T08:06:11.403" LastActivityDate="2015-08-31T08:06:11.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19513" PostTypeId="2" ParentId="18559" CreationDate="2015-08-27T18:48:58.513" Score="0" Body="&lt;p&gt;In an interview on Tastytrade, NYU's Phil Maymin talks a bit about this exact question: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.tastytrade.com/tt/shows/what-else-ya-got/episodes/dr-philip-maymin-skew-10-22-2014?locale=en-US&quot; rel=&quot;nofollow&quot;&gt;https://www.tastytrade.com/tt/shows/what-else-ya-got/episodes/dr-philip-maymin-skew-10-22-2014?locale=en-US&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A full example of this is also covered in Maymin's book, &lt;em&gt;Financial Hacking&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="5671" LastActivityDate="2015-08-27T18:48:58.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19516" PostTypeId="2" ParentId="19493" CreationDate="2015-08-27T23:39:59.353" Score="2" Body="&lt;p&gt;Yes, for futures I would use the Notional Value of the contracts for example Number of Contracts times 250 times S&amp;amp;P level for the big S&amp;amp;P futures, and similarly for other futures (50 for mini S&amp;amp;P, 1000 for Crude, 100 for Gold, etc.). And number of contracts is negative for a short position.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2015-08-29T19:09:33.627" LastActivityDate="2015-08-29T19:09:33.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19517" PostTypeId="1" AcceptedAnswerId="28341" CreationDate="2015-08-27T23:54:40.337" Score="4" ViewCount="1159" Body="&lt;p&gt;&lt;a href=&quot;http://blogs.barrons.com/focusonfunds/2015/08/24/high-frequency-trading-firms-just-made-a-killing/&quot; rel=&quot;nofollow&quot;&gt;http://blogs.barrons.com/focusonfunds/2015/08/24/high-frequency-trading-firms-just-made-a-killing/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Virtu Financial (VIRT), the high-speed trading firm that went public&#xA;  earlier this year, was one of the few stocks on the market to log&#xA;  gains on Monday while the S&amp;amp;P 500 dropped nearly 4%. Indeed, Virtu,&#xA;  which claims not to have posted a daily loss in years, just had one of&#xA;  its &lt;strong&gt;most profitable trading days in history&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="6190" LastActivityDate="2016-08-03T02:52:51.533" Title="What are some quantitative trading strategies used by high-frequency trading companies to make a killing on a market crash day on 24Aug2015?" Tags="&lt;quant-trading-strategies&gt;&lt;trading&gt;&lt;high-frequency&gt;&lt;hedge-fund&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19518" PostTypeId="1" CreationDate="2015-08-28T03:09:30.990" Score="13" ViewCount="2359" Body="&lt;p&gt;I am quite new to R and will be doing an empirical analysis of momentum strategies in R using a dataset from the index OSEAX from 1980 to 2014. The momentum strategy will for the most part resemble Titman (1993) where we go long on the 30% top performing assets for a given horizon and short the 30% losing stocks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far I have found this resource (part 1-5): &#xA;&lt;a href=&quot;https://rbresearch.wordpress.com/2012/08/23/momentum-with-r-part-1/&quot;&gt;https://rbresearch.wordpress.com/2012/08/23/momentum-with-r-part-1/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any good R specific finance books og other resources that might help? &lt;/p&gt;&#xA;" OwnerUserId="17354" LastActivityDate="2016-02-14T14:52:57.107" Title="Thesis using Momentum strategies in R, tips on good books, guidelines etc on how to do the programming?" Tags="&lt;time-series&gt;&lt;equities&gt;&lt;r&gt;&lt;programming&gt;&lt;momentum&gt;" AnswerCount="4" CommentCount="4" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="19519" PostTypeId="2" ParentId="19499" CreationDate="2015-08-28T04:10:57.727" Score="6" Body="&lt;p&gt;Let $$I= \mathbb{E}_t^\mathbb{Q}\left[\text{exp}(-2\sigma W_{T-t}) \cdot\mathbb{1}_{S_T\ge K}\right] = \frac{1}{\sqrt{2\pi}} \int_{\hat{d}_2}^{\infty} e^{-2\sigma x} e^{-x^2/2} dx.$$&#xA;So &#xA;$$&#xA;I = \frac{1}{\sqrt{2\pi}} \int_{\hat{d}_2}^{\infty} e^{-(x-2\sigma)^2/2} dx \, e^{2\sigma^2}.&#xA;$$&#xA;Change variables $y = x-2\sigma$ and you are done. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-08-28T04:10:57.727" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19520" PostTypeId="1" AcceptedAnswerId="19521" CreationDate="2015-08-28T07:35:44.937" Score="2" ViewCount="1543" Body="&lt;p&gt;I used ten year daily data for 407 stocks and computed the daily and monthly covariance matrices. Since I have more variables than observations for the monthly matrix, I wasn't surprised to find the matrix to be not invertible (and hence useless for portfolio optimization). I was surprised to see the daily covariance matrix not invertible. I then tried to shrink the matrix with the Ledoit-Wolf shrinkage estimator using the package tawny. It didn't help. It makes the covariance matrix really, really small, but no invertible. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have any suggestions what could be the problem? How could I improve the covariance matrix? &lt;/p&gt;&#xA;" OwnerUserId="17358" LastActivityDate="2019-11-19T16:57:07.213" Title="Ledoit-Wolf Shrinkage estimator not giving positive definite covariance matrix" Tags="&lt;data&gt;&lt;optimization&gt;&lt;finance&gt;&lt;covariance&gt;&lt;covariance-matrix&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19521" PostTypeId="2" ParentId="19520" CreationDate="2015-08-28T07:41:38.993" Score="2" Body="&lt;p&gt;Are your 407 stocks all different? No A and B listings contained that are strongly if not perfectly correlated? The observation that the daily covariance matrix is singular makes me wonder.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can try the package &lt;a href=&quot;https://cran.r-project.org/web/packages/corpcor/index.html&quot; rel=&quot;nofollow&quot;&gt;corpcor&lt;/a&gt; for another shrinkage estimator.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-08-28T07:41:38.993" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19522" PostTypeId="2" ParentId="19494" CreationDate="2015-08-28T10:10:43.113" Score="3" Body="&lt;p&gt;You got some things wrong:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You don't have to devide sd by &lt;span class=&quot;math-container&quot;&gt;$\sqrt{n}$&lt;/span&gt;, the division is already part of the definition of &lt;span class=&quot;math-container&quot;&gt;$sd$&lt;/span&gt;.&lt;/li&gt;&#xA;&lt;li&gt;The &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt; distribution has a parameter &lt;span class=&quot;math-container&quot;&gt;$\nu$&lt;/span&gt;, the degrees of freedom.&lt;/li&gt;&#xA;&lt;li&gt;The variance of a standard &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt; distributed random variable &lt;span class=&quot;math-container&quot;&gt;$T$&lt;/span&gt; is&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;VAR(T) = \frac{\nu}{(\nu-2)}.&#xA;$$&lt;/span&gt;&#xA;Thus you have to define &lt;span class=&quot;math-container&quot;&gt;$$\sigma = sd * \sqrt{\frac{(\nu-2)}{\nu}}$$&lt;/span&gt; and a random variable&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;X = \sigma T.&#xA;$$&lt;/span&gt;&#xA;Then you will have that&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;VAR(X) = VAR(T \sigma) = \sigma^2 VAR(T) = sd^2  \frac{(\nu-2)}{\nu} \times \frac{\nu}{(\nu-2)} = sd^2.&#xA;$$&lt;/span&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;For VaR you estimate &lt;span class=&quot;math-container&quot;&gt;$\nu$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$sd$&lt;/span&gt; and look at&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;\mu - \sigma t_{\alpha},&#xA;$$&lt;/span&gt;&#xA;where &lt;span class=&quot;math-container&quot;&gt;$\sigma$&lt;/span&gt; is defined above and &lt;span class=&quot;math-container&quot;&gt;$t_{\alpha}$&lt;/span&gt; is the quantile of a t-distribution with &lt;span class=&quot;math-container&quot;&gt;$\nu$&lt;/span&gt; degrees of freedom.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="41390" LastEditDate="2020-11-17T21:45:18.840" LastActivityDate="2020-11-17T21:45:18.840" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="19525" PostTypeId="1" CreationDate="2015-08-28T14:32:31.763" Score="1" ViewCount="97" Body="&lt;p&gt;I have a historical covariance matrix which is invertible for daily and monthly returns. I used the Ledoit,Wolf shrinkage estimator for the covariance matrix and now I get really small portfolio variances, implying unrealistic Sharpe-ratios. I assume this has to do with the fact that I didn't shrink the return vector. Which shrinkage estimator would you use on the return vector? Do you know any R-Script for this? &lt;/p&gt;&#xA;" OwnerUserId="17358" LastActivityDate="2015-08-28T14:32:31.763" Title="Shrinkage Estimator giving unrealistic portfolio variances" Tags="&lt;finance&gt;&lt;portfolio-optimization&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19526" PostTypeId="2" ParentId="19517" CreationDate="2015-08-28T20:39:21.513" Score="-5" Body="&lt;p&gt;hft is in general a sure bet simply because , by definition, they get their orders in faster than anyone else, with minimal transactions costs... (except other hft'ers!).&#xA;so, there is virtually no risk in the trades they do&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i would not expect any hfters to lose money ever, except if they have a bug in their algos, ir they are actually taking risks&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the faster the market moves, the more money hfters wohld make per trade. &lt;/p&gt;&#xA;" OwnerUserId="17348" LastActivityDate="2015-08-28T20:39:21.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19527" PostTypeId="1" AcceptedAnswerId="19530" CreationDate="2015-08-29T06:53:03.210" Score="5" ViewCount="852" Body="&lt;p&gt;Consier geometric Brownian motion: $dS_t/S_t=\mu dt+\sigma dW_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Feynman Kac theorem tells us that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the conditional expectation $v(t,x)=E[ e^{-rT}\Psi(S_T) | S_t=x]$ can be computed by solving the following PDE:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;v_t(t,x)+1/2\sigma^2 x^2 V_{xx}(t,x)+rxV_{x}(t,x)-rV(t,x)=0&#xA;$$&#xA;with a boundary condition $V(T,x)=\Psi(x)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is for path-independent European claim with the payoff $\Psi$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is how to apply Feynman Kac theorem for path-depedent option like a barrier option. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;the value of a down and out barrier option is $v(t,x)=E[ e^{-rT}\Psi(S_T)1_{m_{t,T}^S&amp;gt;L} | S_t=x]$&#xA;where $m_{t,T}^S=\inf_{\{t\leq s \leq T\}} S_s$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, Feynman Kac theorem is not available for $E[ e^{-rT}\Psi(S_T)1_{m_{t,T}^S&amp;gt;L} | S_t=x]$ due to path-dependent term $1_{m_{t,T}^S&amp;gt;L}$. However, we still have same PDE for those of vanilla option except that additional boundary condition $v(t,L)=0$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I came to think that we can still utilize Fenyman Kac thoerem for a barrier option. Am I right??&lt;/p&gt;&#xA;" OwnerUserId="12093" LastActivityDate="2015-08-30T11:47:29.793" Title="Feynman Kac Formula for path-dependent options" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;stochastic-processes&gt;&lt;exotics&gt;&lt;black-scholes-pde&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19528" PostTypeId="2" ParentId="19499" CreationDate="2015-08-29T07:18:16.950" Score="2" Body="&lt;p&gt;I managed to figure out another way of doing it via change of measure as follows...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know that the dynamics of $S_t^2$ is given by, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align}&#xA;S_t^2&amp;amp;=S_0^2 \text{exp}\left( \left( 2r-2q-\sigma^2\right)t+2\sigma^2 W_t^Q \right)\\&#xA;\Rightarrow \frac{1}{S_t^2}&amp;amp;=\frac{1}{S_0^2} \text{exp}\left( -\left( 2r-2q-\sigma^2\right)t-2\sigma^2 W_t^Q \right)\\&#xA;\Rightarrow  \text{exp}\left( \left( 2r-2q-3\sigma^2\right)t \right)\frac{S_0^2}{S_t^2} &amp;amp;= \text{exp}\left( -2\sigma^2 t -2\sigma W_t^Q \right)\\&#xA;&amp;amp;=D_t&#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $D_t$ is a change of measure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By Girsanov, we have, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;D_t=\frac{d\mathbb{Q}^{S^2} }{d\mathbb{Q}}=\text{exp}\left( -2\sigma^2 t -2\sigma W_t^Q \right)\\&#xA;$$&#xA;and&#xA;$$&#xA;W^{S^2}_t=W_t^Q+2\sigma t &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is a $Q^{S^2}$-Brownian Motion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the above we have,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align}&#xA;e^{-r(T-t)}E_t^Q\left[\frac{K^2}{S_T^2}\mathbb{1}_{\{S_T\gt K\}}\right]&amp;amp;=K^2 e^{-r(T-t)} \left[ \frac{1}{E_t^{Q^{S^2}}\left[\frac{1}{D_T}\right]}  E_t^{Q^{S^2}}  \left[\frac{1}{D_T S_T^2}\mathbb{1}_{\{S_T\gt K\}}\right]\right]\\&#xA;&amp;amp;=K^2 e^{-r(T-t)}D_t  E_t^{Q^{S^2}}  \left[e^{- \left( 2r-2q-3\sigma^2\right)t}\frac{S_T^2}{S^2_0}\frac{1}{S_T^2}\mathbb{1}_{\{S_T\gt K\}}\right]\\&#xA;&amp;amp;=K^2 e^{-r(T-t)}e^{ \left( 2r-2q-3\sigma^2\right)} \frac{S_0^2}{S_t^2} E_t^{Q^{S^2}}  \left[e^{- \left( 2r-2q-3\sigma^2\right)T}\frac{1}{S_0^2}\mathbb{1}_{\{S_T\gt K\}}\right]\\&#xA;&amp;amp;=\frac{K^2}{S^2} e^{ \left( 3\sigma^2 + 2q -3r \right)(T-t)} E_t^{Q^{S^2}}  \left[\mathbb{1}_{\{S_T\gt K\}}\right]\\&#xA;&amp;amp;=\frac{K^2}{S^2} e^{ \left( 3\sigma^2 + 2q -3r \right)(T-t)} Q^{S^2} \left( S_T\gt K\right)\\&#xA;&amp;amp;=\frac{K^2}{S^2} e^{ \left( 3\sigma^2 + 2q -3r \right)(T-t)} Q^{S^2} \left( S_t^2 e^{\left( r-q-\frac{1}{2}\sigma^2\right)(T-t)+\sigma W_{T-t}^Q } \gt K \right)\\&#xA;&amp;amp;=\frac{K^2}{S^2} e^{ \left( 3\sigma^2 + 2q -3r \right)(T-t)} Q^{S^2} \left(  \left( r-q-\frac{1}{2}\sigma^2\right)(T-t)+\sigma\left( W_{T-t}^{Q^{S^2}}-2\sigma (T-t) \right)  \gt \text{log}\frac{K}{S} \right)\\&#xA;&amp;amp;=\frac{K^2}{S^2} e^{ \left( 3\sigma^2 + 2q -3r \right)(T-t)} Q^{S^2} \left(  \sigma\left( W_{T-t}^{Q^{S^2}}\right)  \gt \text{log}\frac{K}{S} - \left( r-q-\frac{5}{2}\sigma^2\right)(T-t)\right)\\&#xA;&amp;amp;=\frac{K^2}{S^2} e^{ \left( 3\sigma^2 + 2q -3r \right)(T-t)} Q^{S^2} \left(  -W_{T-t}^{Q^{S^2}}  \lt \frac{\text{log}\frac{S}{K} + \left( r-q-\frac{5}{2}\sigma^2\right)(T-t)}{\sigma }\right)\\&#xA;&amp;amp;=\frac{K^2}{S^2} e^{ \left( 3\sigma^2 + 2q -3r \right)(T-t)} Q^{S^2} \left(  \frac{1}{\sqrt{T-t}}W_{T-t}^{Q^{S^2}}  \lt \frac{\text{log}\frac{S}{K} + \left( r-q-\frac{5}{2}\sigma^2\right)(T-t)}{\sigma \sqrt{T-t}}\right)\\&#xA;&amp;amp;=\frac{K^2}{S^2} e^{ \left( 3\sigma^2 + 2q -3r \right)(T-t)} N(\hat{d_1})\\&#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Combining it with the earlier part gives the required result.&lt;/p&gt;&#xA;" OwnerUserId="15771" LastActivityDate="2015-08-29T07:18:16.950" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19530" PostTypeId="2" ParentId="19527" CreationDate="2015-08-29T11:08:18.383" Score="5" Body="&lt;p&gt;In short answer, Yes: the backward PDE solution with $v(t,L)=0$ and the expectation coincides under the Black-Scholes market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the one dimensional case, this topic is mathematically treated in the theory of the scale function and the spead measure. See Revez-Yor 3rd.ed. Ch.VII.3 for details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know whether there are some rigorous theories on the general case. But I present an intuitive sketch here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming a no arbitrage market and let the underlying process is $X_t$. Then if we decide a numeraire $N_t$, we have the equivalent martingale measure $Q$ that makes any discounted financial trade price $U_t$ a martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$M_t = \frac{U_t}{N_t} = E^Q\left[\frac{U_T}{N_T} \Bigg| \mathbb{F_t}\right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of the Black Scholes market,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dX_t=X_t(\mu dt + \sigma dW_t), \qquad N_t=\exp(rt)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For simplicity, let us assume that $N_t$ can be described as $N_t = n(t, X_t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Further assume that $X_t$ is a Markov process. And assume that if we have an expression $U_t = u(t,X_t)$, then the martingale $M_t$ follows the SDE with the infinitesimal generator $\mathcal{A}$ and a martingale $Y$ such that,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dM_t = \frac{\partial}{\partial t}g(t, X_t)dt + \mathcal{A}_t g(t, X_t) dt + dY_t, \qquad g(t,x) = \frac{u(t,x)}{n(t,x)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of the Black Scholes model, applying Ito formula yields,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathcal{A}_t = \frac{1}{2}\sigma^2x^2\frac{\partial^2}{\partial x^2} + \mu x \frac{\partial}{\partial x}, \qquad dY_t=\sigma X_t g(t,X_t) dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Roughly speaking, what the Feynman-Kac theorem says is that if $g(t, x)$ satisfies,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\partial}{\partial t}g(t,x) + \mathcal{A}_t g(t,x) = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then it admits the stochastic representation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$g(t, x) = E^Q[g(T, X_T)|\mathbb{F}_t] = E^Q\left[\frac{U_T}{N_T} \Bigg| \mathbb{F}_t \right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And the Feynman-Kac theorem is from the simple fact that $M_t$ becomes a martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align}&#xA;E^Q[M_T | \mathbb{F}_t] &amp;amp;= M_t + E^Q\left[ \int_t^T \left( \frac{\partial}{\partial s}g(s, X_s) + \mathcal{A}_s g(s, X_s) \right) ds \Bigg| \mathbb{F}_t \right] + E^Q\left[\int_t^T dY_s \Bigg| \mathbb{F}_t \right] \\&#xA;&amp;amp;= M_t&#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us consider to construct the same argument in the case of knock out options. Let $\tau$ be a hitting time $\tau=\inf\{t | X_t \leq L\}$ and let $J_t$ be the discounted price of the down and out option $V_t$ with the payoff function $f$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$J_t = \frac{V_t}{N_t} = E^Q\left[\frac{V_T}{N_T} \Bigg| \mathbb{F}_t \right] = E^Q\left[1_{\tau &amp;gt; T} \frac{f(X_T)}{N_T} \Bigg| \mathbb{F}_t \right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us assume that $V_t$ can be expressed as $V_t=v(t, X_t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under the assumption, $J_t$ also follows the SDE on with the corresponding martingale part $Z$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dJ_t = \frac{\partial}{\partial t}h(t, X_t)dt + \mathcal{A}_t h(t, X_t) dt + dZ_t, \qquad h(t,x) = \frac{v(t,x)}{n(t,x)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the price of the knock out option satisfies the following, since $J_{\tau}=J_T = 0$ on $\{\tau \leq T\}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E^Q[J_T| \mathbb{F}_t] = E^Q[J_{\tau \wedge T}| \mathbb{F}_t], \qquad \tau \wedge t := \min(\tau, t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using this equation,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align}&#xA;E^Q[J_T | \mathbb{F}_t]=E^Q[J_{\tau \wedge T} | \mathbb{F}_t] &amp;amp;= J_t + E^Q\left[\int_t^{\tau \wedge T} \left( \frac{\partial}{\partial s}h(s, X_s) + \mathcal{A}_s h(s, X_s) \right) ds \Bigg| \mathbb{F}_t \right] \\&#xA;&amp;amp; \qquad + E^Q\left[\int_t^{\tau \wedge T} dZ_s \Bigg| \mathbb{F}_t \right] \\&#xA;&amp;amp;=J_t + E^Q\left[1_{\tau &amp;gt; T} \int_t^T \left( \frac{\partial}{\partial s}h(s, X_s) + \mathcal{A}_s h(s, X_s) \right) ds \Bigg| \mathbb{F}_t \right] \\&#xA;&amp;amp; \qquad + E^Q\left[1_{t \leq \tau \leq T} \int_t^{\tau} \left( \frac{\partial}{\partial s}h(s, X_s) + \mathcal{A}_s h(s, X_s) \right) ds \Bigg| \mathbb{F}_t \right] &#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $h(t,x)$ satisfies the PDE,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{\partial}{\partial t} h(t,x) + \mathcal{A}_t h(t,x) = 0 \qquad x &amp;gt; L \\&#xA;h(t, L) = 0&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the second term is equal to zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E^Q\left[1_{\tau &amp;gt; T} \int_t^T \left( \frac{\partial}{\partial s}h(s, X_s) + \mathcal{A}_s h(s, X_s) \right) ds \Bigg| \mathbb{F}_t \right]=0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The last term is somewhat difficult to treat rigorously. Approximately, if we discretize the time interval $[t,T]$ with $\{t_0, t_1, \cdots, t_K\}$, $\Delta t=t_{i+1}-t_i$, we have the following.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align}&#xA;&amp;amp; E^Q\left[1_{t \leq \tau \leq T} \int_t^{\tau} \left( \frac{\partial}{\partial s}h(s, X_s) + \mathcal{A}_s h(s, X_s) \right) ds \Bigg| \mathbb{F}_t \right] \\&#xA;&amp;amp;\approx  \sum_{i=0}^K E^Q\left[1_{t_i \leq \tau \leq t_{i+1}} \int_{t_i}^{t_{i+1}} \left( \frac{\partial}{\partial s}h(s, X_s) + \mathcal{A}_s h(s, X_s) \right) ds \Bigg| \mathbb{F}_t \right] \\&#xA;&amp;amp;\approx  \sum_{i=0}^K E^Q\left[1_{t_i \leq \tau \leq t_{i+1}} \int_{t_i}^{t_{i+1}} \left( \frac{\partial}{\partial s}h(s, L) + \mathcal{A}_s h(s, L) \right) ds \Bigg| \mathbb{F}_t \right] \\&#xA;&amp;amp;\approx \sum_{i=0}^K E^Q\left[1_{t_i \leq \tau \leq t_{i+1}} \int_{t_i}^{t_{i+1}} \frac{\partial}{\partial s}h(s, L) ds \Bigg| \mathbb{F}_t \right] \\&#xA;&amp;amp;\approx \sum_{i=0}^K E^Q\left[1_{t_i \leq \tau \leq t_{i+1}} h(t_i, L) \Bigg| \mathbb{F}_t \right]  \Delta t = 0&#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, this approximation assumes a lot of things, especially on the regularity of the solution $h(t,x)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above argument is just for showing the idea and is not at all rigorous mathematically. It assumes the existence and the regularity of the solution of the SDE and the PDE, and never mentions about the uniqueness.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If someone knows rigorous treatment, please put an answer or a comment to let me know.&lt;/p&gt;&#xA;" OwnerUserId="17365" LastEditorUserId="17365" LastEditDate="2015-08-30T11:47:29.793" LastActivityDate="2015-08-30T11:47:29.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19531" PostTypeId="1" AcceptedAnswerId="19533" CreationDate="2015-08-29T13:55:05.533" Score="0" ViewCount="181" Body="&lt;p&gt;I am comparing Monte Carlo estimates of VaR (using importance sampling) under both the normal and student distributions. I am also considering risk factors other than log-prices; in particular, implied volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To undertake simulation one must know the sensitivities of the option price with respect to changes in the underlying risk factor. My problem is when I consider an S&amp;amp;P500 option and a NASDAQ option (using the current closing price and implied volatilities of the respective indexes) I get extremely large values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From my matlab code, the parameters into BS are given below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[p1 t1  d1  g1  v1  r1]= call_fn(2035.73 , 2050 , 0.002 , 0.1914 , 20/365); %S&amp;amp;P500 VIX = 19.14&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[p2 t2  d2  g2  v2  r2]= call_fn(4877.49 , 5100 , 0.002 , 0.2161 , 20/365); %NASDAQ VXN = 21.61%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The outputted values of vega are 188.48 and 316.197 (SP and NAS, resp.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These seem extremely large to me and have led me to think the numbers need modifying e.g. /365 or /100 etc. Note: I have double and triple checked that the formulas I use to compute vega are correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks&lt;/p&gt;&#xA;" OwnerUserId="17062" LastActivityDate="2015-08-29T18:25:07.420" Title="Interpretation of vega out of BS formula" Tags="&lt;options&gt;&lt;monte-carlo&gt;&lt;greeks&gt;&lt;vix&gt;&lt;spx&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19532" PostTypeId="1" AcceptedAnswerId="19534" CreationDate="2015-08-29T15:04:07.317" Score="1" ViewCount="183" Body="&lt;p&gt;The well known calculation of unweighted index of stocks is just calculating an arithmetic average. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And then, to calculate the performance of the index, I calculate the %change of the unweighted index between 2 points of time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But how about I calculate the %change for every stocks between 2 points of time first, and then take the arithmetic average of those %changes?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the second method valid? I found the results are quite different. Which one is better?&lt;/p&gt;&#xA;" OwnerUserId="16381" LastActivityDate="2015-08-29T22:10:32.740" Title="Calculating unweighted performance of stocks within a period" Tags="&lt;equities&gt;&lt;statistics&gt;&lt;index&gt;&lt;performance-evaluation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19533" PostTypeId="2" ParentId="19531" CreationDate="2015-08-29T18:25:07.420" Score="1" Body="&lt;p&gt;Your Vega of 188.48 is correct, in the sense that matches my calculation. What it means is that if the volatility increase by 1 (i.e. by 100 percentage points, from 19.14% to 119.14%) the call will increase by 188 dollars. Obviously that is an unrealistic move. More realistically if the volatility increases by 0.01 (i.e. 1 percentage point, from 19.14% to 20.14%) then the call will increase by one-hundredths of this i.e. 1.8848 dollars. And you can verify this by plugging 20.14% in your calculation, the call price increase by about 1.8.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what is confusing you is just the units. &lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-08-29T18:25:07.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19534" PostTypeId="2" ParentId="19532" CreationDate="2015-08-29T18:46:07.083" Score="0" Body="&lt;p&gt;The first method gives you the return of a a price-weighted average, like the Dow Jones average. So I suppose it is OK to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second method gives you a rebalanced EW (equal weighted) average: you initially invest the same amount (say 1000 dollars) in each stock and then you rebalance to equal weights at each point where you do the calculation. Obviously the results depend on how frequently you do the calculation; if it is very frequently (e.g. daily) it becomes somewhat unrealistic because it means you would have to buy/sell every stock every day to get back to equal dollars per stock, if one stock now has too many dollars you must sell some of it and buy more of another that has gone down in relative price. It can be done but it is an active strategy, not a passive index.  With monthly or quarterly (or yearly) recalculation it is probably OK, in the sense that there is a more realistic amount of activity involved. Still I would recommend that you either NOT USE this method, or at least disclose the calculation period (e.g. EW rebalanced monthly) otherwise no one will be able to reproduce your calculation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the most popular indexes like the S&amp;amp;P index are of a third kind: market weighted indexes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or else, the fourth method: to compute the return to an investor you must know the number of shares of each stock that the investor owns. This is the most general method. The others are a special case of this: for example the first method assumes that the investor buys an equal number of shares in each company, which is a strange method of investing, to say the least. The second method simulates constantly buying and selling shares, as I described above.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2015-08-29T22:10:32.740" LastActivityDate="2015-08-29T22:10:32.740" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19536" PostTypeId="2" ParentId="19431" CreationDate="2015-08-30T00:22:52.363" Score="1" Body="&lt;p&gt;As the other comments already suggest this topic has been discussed many times and the references / links that are provided are far more detailed than my quick solution below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the construction / replication of a variance swap one tries to achieve a &lt;strong&gt;CONSTANT&lt;/strong&gt; &lt;strong&gt;dollar gamma&lt;/strong&gt;. This is done by buying a strip of calls and puts, weighted by 1/K^2 as you suggested. Now why did I all-cap the word CONSTANT? because the dollar gamma = $\gamma S^2$. As you can see the black scholes gamma is scaled by the squared level of the stock price. So to get a constant dollar gamma you need to have more of the lower strike options else they won't generate enough dollar gamma because the level of the stock is too low.&lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2015-08-30T00:22:52.363" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19540" PostTypeId="1" AcceptedAnswerId="19553" CreationDate="2015-08-30T15:40:00.513" Score="1" ViewCount="218" Body="&lt;p&gt;I'm trying to understand a fundamental link between mathematical finance and economics.&#xA;I understand that risk-neutral pricing is free of arbitrage with replicating portfolio. Does risk-neutral pricing mean that there needs to be risk-neutral agents in the economy that actually does the arbitraging/portfolio replication? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In economics, risk-neutrality translates into linear utility function, that is, there is no risk aversion. But if there are market participants who are risk-neutral and unconstrained, would we still observe risk premia?  Macro-finance/representative agent models in economics almost always assume some degree of risk aversion. In these models, there could not be equity premium without risk aversion. (For instance, Consumption CAPM model has equity premium as $\gamma*cov(C_{t+1},R_{t+1})$). How do we reconcile the idea of risk-neutral pricing with representative agent models in economics that require risk aversion.&lt;/p&gt;&#xA;" OwnerUserId="17375" LastActivityDate="2015-08-31T10:51:09.247" Title="does there need to be risk-neutral agents in the market to enforce risk-neutral pricing?" Tags="&lt;risk-neutral-measure&gt;&lt;economics&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19541" PostTypeId="1" AcceptedAnswerId="19546" CreationDate="2015-08-30T15:50:33.910" Score="2" ViewCount="378" Body="&lt;p&gt;I am trying to use the discrete Kalman filter for forecasting and I wonder what is commonly considered as the optimal way of determining the measurement noise covariance constants (Q and R) for a given time series? Do you recommend some approaches based on your research/experience? &lt;/p&gt;&#xA;" OwnerUserId="5745" LastActivityDate="2015-08-30T20:15:51.753" Title="How to find optimal noise covariance matrices Q &amp; R" Tags="&lt;kalman&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19542" PostTypeId="1" CreationDate="2015-08-30T16:24:40.030" Score="3" ViewCount="145" Body="&lt;p&gt;I am trying to implement Theorem 1 from this &lt;a href=&quot;http://www.iaeng.org/IJAM/issues_v43/issue_2/IJAM_43_2_01.pdf&quot; rel=&quot;nofollow&quot;&gt;Journal&lt;/a&gt; in RStudio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The journal says the it is possible to find a approximate price of a geometric asian option in a Heston setup this way:&#xA;$$X_{1cGAO}=e^{0.5\hat{\sigma}-rT+a}N(d_+)-Ke^{-rT}N(d_-)$$&#xA;where&#xA;$$a=log(S_0)+0.5rT- \frac{1}{2T}\int_0^T[\int_0^t\sigma^2(s)ds]dt$$&#xA;$$\hat{\sigma}^2=\frac{1}{n^2}\sum_{j=1}^n[2(n-j)+1]\int_0^{j\frac{T}{n}}\sigma^2(s)ds$$&#xA;where $n$ goes to $\infty$ and $d_-=\frac{a-log(K)}{\hat{\sigma}}$, $d_+=d_-+\hat{\sigma}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The trick is, according to the journal to substitute the stochastic volatility from the Heston process with its deterministic expected value:&#xA;$$E[\sigma^2_t]=v_0e^{-\kappa*t}+\theta(1-e^{-\kappa t})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And here comes my problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When i am trying to implement the code in RStuido (see code below) I do not get a plausibly result. I get the price $8.592864$ and when I am using Monte Carlo simulation I get about $5.430642$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone see what I am doing wrong or what I am missing?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;kappa=2&#xA;theta=0.04&#xA;v0=0.04&#xA;S=100&#xA;rf=0.05&#xA;K=100&#xA;T=1&#xA;&#xA;MC_Heston_Std_Asian_GEO(S,K,rf,T,v0,theta,10^6,10,kappa,0,0)&#xA;&#xA;&#xA;#Expected value of CIR-Prices&#xA;ExpectedVarians &amp;lt;- function(t) {&#xA;  exp(-kappa*t)*v0+(theta)*(1-exp(-kappa*t))&#xA;}&#xA;&#xA;sqrt(ExpectedVarians(1))&#xA;&#xA;#My function&#xA;AsianGEO = function(S,K,rf,T,n){&#xA;&#xA;  a=log(S)+0.5*rf*T-(1/(2*T))*integrate(function(y) { &#xA;    sapply(y, function(y) {&#xA;      integrate(ExpectedVarians, 0, y)$value&#xA;        })&#xA;      }, 0, T)$value&#xA;&#xA;  sum=0&#xA;  for (j in 1:n){&#xA;    sum=sum+(2*(n-j)+1)*integrate(ExpectedVarians, 0, j*(T/n))$value&#xA;  }&#xA;  sigma_hat=sqrt(sum/n^2)&#xA;  d_minus=(a-log(K))/(sigma_hat)&#xA;  d_plus=d_minus+(sigma_hat)&#xA;&#xA;  (exp(0.5*sigma_hat-rf*T+a)*pnorm(d_plus)-K*exp(-rf*T)*pnorm(d_minus))&#xA;}&#xA;&#xA;AsianGEO(S,K,rf,T,1000)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Added:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;MC_Heston_Std_Asian_GEO &amp;lt;- function(S,K,rf,T,V0,theta,n,b,kappa,sigma_vol,rho) {&#xA;&#xA;  values &amp;lt;- c(4)&#xA;  # Start the clock!&#xA;  ptm &amp;lt;- proc.time()&#xA;&#xA;  S_pris=0&#xA;  Price_sum_i_2=0&#xA;  Price_sum=0&#xA;  delta=(T)/(b)&#xA;&#xA;  Z1=matrix(rnorm(n*b),n, b)&#xA;  Z2=matrix(rnorm(n*b),n, b)&#xA;&#xA;  Z_vol=Z1&#xA;  Z=rho * Z_vol + sqrt(1-rho^2)*Z2&#xA;&#xA;  for (i in 1:n) {&#xA;    x_t=log(S)&#xA;    vol_i=V0&#xA;    S_produkt = 1*S&#xA;    S_mean_GEO=0&#xA;&#xA;    for (j in 1:b) {&#xA;&#xA;      vol_i=V0&#xA;      x_t=x_t + (rf - 0.5*max(vol_i,0))*delta+(max(vol_i,0))**(0.5)*delta**(0.5)*Z[i,j]&#xA;      vol_i = vol_i + kappa * (theta - max(vol_i,0)) * delta + sigma_vol * (max(vol_i,0))**(0.5)*(delta)**(0.5)*Z_vol[i,j]&#xA;      S_produkt = S_produkt*exp(x_t)&#xA;    }&#xA;&#xA;    S_mean_GEO=S_produkt^(1/(b+1))&#xA;&#xA;&#xA;    C = exp(-1*rf*T)*max(S_mean_GEO-K,0)&#xA;    Price_sum=Price_sum+C&#xA;    Price_sum_i_2=Price_sum_i_2+C^2&#xA;&#xA;    if (i==n) {&#xA;      print(&quot;*STANDARD HESTON MONTE CARLO MODELLEN ASIAN GEO*&quot;)&#xA;      values[1]=Price_sum/n #PRIS&#xA;      print(paste0(&quot;Option Price: &quot;, values[1]))&#xA;      values[2]=(Price_sum_i_2/n)-(Price_sum/n)^2 #VARIANS&#xA;      values[3]=sqrt(values[2])/sqrt(n) #STD&#xA;      print(paste0(&quot;Std on estimat: &quot;, values[3]))&#xA;    } &#xA;  }&#xA;  # Stop the clock&#xA;  values[4]=(proc.time() - ptm)[3]&#xA;  print(paste0(&quot;TIme: &quot;, values[4]))&#xA;&#xA;  return(list(Price=values[1],Varians=values[2],Std.dev=values[3],Time=values[4]))&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="17374" LastEditorUserId="17374" LastEditDate="2015-08-31T15:05:59.003" LastActivityDate="2015-08-31T15:05:59.003" Title="Approximate asian geometric option with Heston" Tags="&lt;option-pricing&gt;&lt;programming&gt;&lt;stochastic-volatility&gt;&lt;heston&gt;&lt;asian-option&gt;" AnswerCount="0" CommentCount="6" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19543" PostTypeId="2" ParentId="19540" CreationDate="2015-08-30T18:28:26.943" Score="2" Body="&lt;p&gt;No. Actually &quot;risk neutral pricing&quot; does not make assumptions on the risk preferences of the agents. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Securities are priced as if agents were risk neutral (that is to say as a straight expectation of discounted payoffs) but where probabilities of states of the world are not the true ones but they have been adjusted to reflect preferences. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The math:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say that the representative agent has utility of consumption $U(c;\gamma)$ where $\gamma$ reflects risk aversion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We are in a two-period setting. Time-zero is fixed and certain. There is a state variable that summarizes uncertainty at time-one, say $X$. Also utility is discounted with factor $\delta$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consumption will depend on the state of the world, as $C_1=C_1(X)$. Also we want to find the time-zero price of a security that has pay-off as a function of the state at time-one, namely $P_1=P_1(X)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The standard result is that in equilibrium the following is satisfied:&#xA;$$&#xA;P_0\ U'(C_0) = \delta E[P_1\ U'(C_1)] = E[P_1(X)\ U'(C_1(X))]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a state independent unit payoff $P_1(X)=1$ we have a bond which determines the discount factor in the economy as&#xA;$$&#xA;DF = E[M(X)] \text{ for } M(X) = \delta \frac{U'(C_1(X))}{U'(C_0)}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a generic payoff one can write the pricing formula as&#xA;$$&#xA;P_0 = E[M(X) P_1(X)] = \int M(x) P_1(x) f(x) dx&#xA;$$&#xA;The price is the expectation of the payoff times the stochastic discount factor aka marginal rate of substitution aka pricing kernel. Here $f(x)$ is the probability density of the state variable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, now we can define the function&#xA;$$&#xA;q(x) = \frac{M(x)f(x)}{\int M(x)f(x)dx}=\frac{M(x)f(x)}{DF}&#xA;$$&#xA;and confirm that this is a valid probability density function (non negative and integrates to one) of the state variable. This is obviously not the 'true' probability density, but it attaches probabilities to events and therefore can be used to compute an expectation (which we denote with $E^q$ to avoid confusion with the expectation under the true state probability density). Then we can write that when we use these preference-adjusted probabilities we can write&#xA;$$&#xA;P_0=DF\ E^q[P_1(X)]&#xA;$$&#xA;This is a discounted 'risk neutral' expectation, in the sense that preferences are not explicitly present. However preferences are hidden in the way 'risk neutral probabilities' are derived from the true ones. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2015-08-30T19:49:23.937" LastActivityDate="2015-08-30T19:49:23.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19544" PostTypeId="2" ParentId="18096" CreationDate="2015-08-30T19:13:27.153" Score="1" Body="&lt;p&gt;There are some &lt;a href=&quot;http://www.quantinvestor.net/viewtopic.php?f=15&amp;amp;t=109&quot; rel=&quot;nofollow&quot;&gt;variants to calculate the beta of a stock&lt;/a&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not fully documented at Google, in doubt you have to validate yourself. You will find a help to do this in the linked website. However, the results of the different calculation variants are usually quite similar. &lt;/p&gt;&#xA;" OwnerUserId="17376" LastActivityDate="2015-08-30T19:13:27.153" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19546" PostTypeId="2" ParentId="19541" CreationDate="2015-08-30T20:15:51.753" Score="3" Body="&lt;p&gt;I recently blogged about this very topic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially, there are 3 ways to estimate Q &amp;amp; R.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;approximate&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;calculate variate estimate of error in a controlled environment&lt;/li&gt;&#xA;&lt;li&gt;if z doesn't change, calculate variance estimate of z&lt;/li&gt;&#xA;&lt;li&gt;if z does change, calculate variance of regression estimate of z    &lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;guess&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;use some constant multiplied by the identity matrix&lt;/li&gt;&#xA;&lt;li&gt;higher the constant, higher the noise&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;MLE&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;pykalman's &lt;a href=&quot;https://pykalman.github.io/#optimizing-parameters&quot; rel=&quot;nofollow&quot;&gt;em&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;unfortunately, non-convex problem =&gt; local optima&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Check out the rest of my post &lt;a href=&quot;http://alphamaximus.com/kalman/statistics/python/2015/08/21/kalman-filters.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13857" LastActivityDate="2015-08-30T20:15:51.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19547" PostTypeId="2" ParentId="12618" CreationDate="2015-08-30T20:47:06.907" Score="5" Body="&lt;p&gt;I think the best choice for technical analysis with node is &lt;strong&gt;&lt;a href=&quot;https://github.com/oransel/node-talib&quot; rel=&quot;noreferrer&quot;&gt;node-talib&lt;/a&gt;&lt;/strong&gt;, a wrapper around &lt;a href=&quot;http://ta-lib.org/&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;TA-Lib&lt;/strong&gt;&lt;/a&gt;. We're using it for some projects and it works ok so far. Here's a list of the indicators you get out of the box:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;AD                  Chaikin A/D Line&#xA;ADOSC               Chaikin A/D Oscillator&#xA;ADX                 Average Directional Movement Index&#xA;ADXR                Average Directional Movement Index Rating&#xA;APO                 Absolute Price Oscillator&#xA;AROON               Aroon&#xA;AROONOSC            Aroon Oscillator&#xA;ATR                 Average True Range&#xA;AVGPRICE            Average Price&#xA;BBANDS              Bollinger Bands&#xA;BETA                Beta&#xA;BOP                 Balance Of Power&#xA;CCI                 Commodity Channel Index&#xA;CDL2CROWS           Two Crows&#xA;CDL3BLACKCROWS      Three Black Crows&#xA;CDL3INSIDE          Three Inside Up/Down&#xA;CDL3LINESTRIKE      Three-Line Strike &#xA;CDL3OUTSIDE         Three Outside Up/Down&#xA;CDL3STARSINSOUTH    Three Stars In The South&#xA;CDL3WHITESOLDIERS   Three Advancing White Soldiers&#xA;CDLABANDONEDBABY    Abandoned Baby&#xA;CDLADVANCEBLOCK     Advance Block&#xA;CDLBELTHOLD         Belt-hold&#xA;CDLBREAKAWAY        Breakaway&#xA;CDLCLOSINGMARUBOZU  Closing Marubozu&#xA;CDLCONCEALBABYSWALL Concealing Baby Swallow&#xA;CDLCOUNTERATTACK    Counterattack&#xA;CDLDARKCLOUDCOVER   Dark Cloud Cover&#xA;CDLDOJI             Doji&#xA;CDLDOJISTAR         Doji Star&#xA;CDLDRAGONFLYDOJI    Dragonfly Doji&#xA;CDLENGULFING        Engulfing Pattern&#xA;CDLEVENINGDOJISTAR  Evening Doji Star&#xA;CDLEVENINGSTAR      Evening Star&#xA;CDLGAPSIDESIDEWHITE Up/Down-gap side-by-side white lines&#xA;CDLGRAVESTONEDOJI   Gravestone Doji&#xA;CDLHAMMER           Hammer&#xA;CDLHANGINGMAN       Hanging Man&#xA;CDLHARAMI           Harami Pattern&#xA;CDLHARAMICROSS      Harami Cross Pattern&#xA;CDLHIGHWAVE         High-Wave Candle&#xA;CDLHIKKAKE          Hikkake Pattern&#xA;CDLHIKKAKEMOD       Modified Hikkake Pattern&#xA;CDLHOMINGPIGEON     Homing Pigeon&#xA;CDLIDENTICAL3CROWS  Identical Three Crows&#xA;CDLINNECK           In-Neck Pattern&#xA;CDLINVERTEDHAMMER   Inverted Hammer&#xA;CDLKICKING          Kicking&#xA;CDLKICKINGBYLENGTH  Kicking - bull/bear determined by the longer marubozu&#xA;CDLLADDERBOTTOM     Ladder Bottom&#xA;CDLLONGLEGGEDDOJI   Long Legged Doji&#xA;CDLLONGLINE         Long Line Candle&#xA;CDLMARUBOZU         Marubozu&#xA;CDLMATCHINGLOW      Matching Low&#xA;CDLMATHOLD          Mat Hold&#xA;CDLMORNINGDOJISTAR  Morning Doji Star&#xA;CDLMORNINGSTAR      Morning Star&#xA;CDLONNECK           On-Neck Pattern&#xA;CDLPIERCING         Piercing Pattern&#xA;CDLRICKSHAWMAN      Rickshaw Man&#xA;CDLRISEFALL3METHODS Rising/Falling Three Methods&#xA;CDLSEPARATINGLINES  Separating Lines&#xA;CDLSHOOTINGSTAR     Shooting Star&#xA;CDLSHORTLINE        Short Line Candle&#xA;CDLSPINNINGTOP      Spinning Top&#xA;CDLSTALLEDPATTERN   Stalled Pattern&#xA;CDLSTICKSANDWICH    Stick Sandwich&#xA;CDLTAKURI           Takuri (Dragonfly Doji with very long lower shadow)&#xA;CDLTASUKIGAP        Tasuki Gap&#xA;CDLTHRUSTING        Thrusting Pattern&#xA;CDLTRISTAR          Tristar Pattern&#xA;CDLUNIQUE3RIVER     Unique 3 River&#xA;CDLUPSIDEGAP2CROWS  Upside Gap Two Crows&#xA;CDLXSIDEGAP3METHODS Upside/Downside Gap Three Methods&#xA;CMO                 Chande Momentum Oscillator&#xA;CORREL              Pearson's Correlation Coefficient (r)&#xA;DEMA                Double Exponential Moving Average&#xA;DX                  Directional Movement Index&#xA;EMA                 Exponential Moving Average&#xA;HT_DCPERIOD         Hilbert Transform - Dominant Cycle Period&#xA;HT_DCPHASE          Hilbert Transform - Dominant Cycle Phase&#xA;HT_PHASOR           Hilbert Transform - Phasor Components&#xA;HT_SINE             Hilbert Transform - SineWave&#xA;HT_TRENDLINE        Hilbert Transform - Instantaneous Trendline&#xA;HT_TRENDMODE        Hilbert Transform - Trend vs Cycle Mode&#xA;KAMA                Kaufman Adaptive Moving Average&#xA;LINEARREG           Linear Regression&#xA;LINEARREG_ANGLE     Linear Regression Angle&#xA;LINEARREG_INTERCEPT Linear Regression Intercept&#xA;LINEARREG_SLOPE     Linear Regression Slope&#xA;MA                  All Moving Average&#xA;MACD                Moving Average Convergence/Divergence&#xA;MACDEXT             MACD with controllable MA type&#xA;MACDFIX             Moving Average Convergence/Divergence Fix 12/26&#xA;MAMA                MESA Adaptive Moving Average&#xA;MAX                 Highest value over a specified period&#xA;MAXINDEX            Index of highest value over a specified period&#xA;MEDPRICE            Median Price&#xA;MFI                 Money Flow Index&#xA;MIDPOINT            MidPoint over period&#xA;MIDPRICE            Midpoint Price over period&#xA;MIN                 Lowest value over a specified period&#xA;MININDEX            Index of lowest value over a specified period&#xA;MINMAX              Lowest and highest values over a specified period&#xA;MINMAXINDEX         Indexes of lowest and highest values over a specified period&#xA;MINUS_DI            Minus Directional Indicator&#xA;MINUS_DM            Minus Directional Movement&#xA;MOM                 Momentum&#xA;NATR                Normalized Average True Range&#xA;OBV                 On Balance Volume&#xA;PLUS_DI             Plus Directional Indicator&#xA;PLUS_DM             Plus Directional Movement&#xA;PPO                 Percentage Price Oscillator&#xA;ROC                 Rate of change : ((price/prevPrice)-1)*100&#xA;ROCP                Rate of change Percentage: (price-prevPrice)/prevPrice&#xA;ROCR                Rate of change ratio: (price/prevPrice)&#xA;ROCR100             Rate of change ratio 100 scale: (price/prevPrice)*100&#xA;RSI                 Relative Strength Index&#xA;SAR                 Parabolic SAR&#xA;SAREXT              Parabolic SAR - Extended&#xA;SMA                 Simple Moving Average&#xA;STDDEV              Standard Deviation&#xA;STOCH               Stochastic&#xA;STOCHF              Stochastic Fast&#xA;STOCHRSI            Stochastic Relative Strength Index&#xA;SUM                 Summation&#xA;T3                  Triple Exponential Moving Average (T3)&#xA;TEMA                Triple Exponential Moving Average&#xA;TRANGE              True Range&#xA;TRIMA               Triangular Moving Average&#xA;TRIX                1-day Rate-Of-Change (ROC) of a Triple Smooth EMA&#xA;TSF                 Time Series Forecast&#xA;TYPPRICE            Typical Price&#xA;ULTOSC              Ultimate Oscillator&#xA;VAR                 Variance&#xA;WCLPRICE            Weighted Close Price&#xA;WILLR               Williams' %R&#xA;WMA                 Weighted Moving Average&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="15489" LastActivityDate="2015-08-30T20:47:06.907" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19548" PostTypeId="1" AcceptedAnswerId="19550" CreationDate="2015-08-30T23:56:44.210" Score="1" ViewCount="144" Body="&lt;p&gt;My first assignment for my Quantitative Finance Masters is to design a portfolio that &lt;strong&gt;theoretically&lt;/strong&gt; makes money under any market movement. I am also asked to state all necessary assumptions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What I'm investigating:&lt;/strong&gt;&#xA;I wrote a C++ application that generates a payoff diagrams at maturity with any combination of financial derivatives. I have been researching various well known option strategies (such as straddle, bear-spread, strangle etc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The problem I am facing:&lt;/strong&gt; &#xA;All of these strategies only work under certain predictions about the market. None of them work for all market movement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; &#xA;Under suitable assumptions, is it possible to design a portfolio that theoretically makes money under any market movement?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suppose what I am really asking: Does there exist theoretical arbitrage opportunities under certain market assumptions? I am not looking for anything overly complex here. I have very little finance knowledge. If this topic is deemed too broad to answer, I would appreciate some direction toward particular readings. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Edit: I am still looking for more readings on possible models.&lt;/p&gt;&#xA;" OwnerUserId="20156" LastEditorUserId="20156" LastEditDate="2015-08-31T15:40:14.540" LastActivityDate="2015-08-31T15:40:14.540" Title="Portfolio Strategies Project" Tags="&lt;arbitrage&gt;&lt;portfolio-optimization&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19549" PostTypeId="2" ParentId="19518" CreationDate="2015-08-31T00:45:49.363" Score="1" Body="&lt;p&gt;Introduction to R for Quantitative Finance received a favorable review here: &#xA;&lt;a href=&quot;http://www.thertrader.com/category/book-review/&quot; rel=&quot;nofollow&quot;&gt;http://www.thertrader.com/category/book-review/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Besides finance-specific books, perhaps 'R Cookbook'? &lt;/p&gt;&#xA;" OwnerUserId="17379" LastActivityDate="2015-08-31T00:45:49.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19550" PostTypeId="2" ParentId="19548" CreationDate="2015-08-31T06:17:30.063" Score="2" Body="&lt;p&gt;If I understand the question correctly, you're asked to invent a strategy that if under some unrealistic assumptions, your strategy will always earn at a rate higher than the risk-free rate without any risk. This is important because simply buying a risk-free zero-coupon-bond will make money for you, but this is not arbitrage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the simplest assumptions is the &lt;a href=&quot;https://en.wikipedia.org/wiki/Put%E2%80%93call_parity&quot; rel=&quot;nofollow&quot;&gt;Put-call parity&lt;/a&gt;. If you can assume your call option is always cheaper than it's theoretical value, you can take a long position on the cheaper call option and a short position on the put option. You can cover up your investment by short selling your stock. If you draw a payoff diagram, your portfolio will always generate positive profits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a &lt;a href=&quot;http://pages.stern.nyu.edu/~adesouza/teaching/handouts/putcall.pdf&quot; rel=&quot;nofollow&quot;&gt;PDF document&lt;/a&gt; that may be helpful.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2015-08-31T06:17:30.063" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19551" PostTypeId="2" ParentId="19548" CreationDate="2015-08-31T08:04:41.647" Score="0" Body="&lt;p&gt;Reading your comment on Student T's answer, it could be possible that your professor is expecting you to come up with the simple fact that, under assumptions of no arbitrage, there is now way to generate a return superior to the risk-free rate without taking any risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;em&gt;making money&lt;/em&gt; is probably not the right terminology, &lt;em&gt;making on average more money than the risk-free bond&lt;/em&gt; is probably what he meant, and &lt;em&gt;in all market conditions&lt;/em&gt; would mean &lt;em&gt;without risk&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a typical question you ask to beginners in finance in general, to generate the concept that &lt;em&gt;there is no free lunch&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2015-08-31T08:04:41.647" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19552" PostTypeId="2" ParentId="19518" CreationDate="2015-08-31T09:26:41.417" Score="1" Body="&lt;p&gt;&quot;The Art of R Programming (A Tour of Statistical Software Design)&quot; by Norman Matloff. It has quite high marks on Amazon. Moreover, you can find a legal version of this book on the Internet. &lt;/p&gt;&#xA;" OwnerUserId="5745" LastActivityDate="2015-08-31T09:26:41.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19553" PostTypeId="2" ParentId="19540" CreationDate="2015-08-31T09:45:01.060" Score="0" Body="&lt;p&gt;Risk Neutral Valuation is based on arbitrage opportunities between the derivative and its underlying. So simply the arbitrage opportunity has to exist. Risk neutrality of market agents is not necessary, as their is no risk when realising the arbitrage opportunity.&lt;/p&gt;&#xA;" OwnerUserId="17384" LastEditorUserId="848" LastEditDate="2015-08-31T10:51:09.247" LastActivityDate="2015-08-31T10:51:09.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19555" PostTypeId="2" ParentId="19142" CreationDate="2015-08-31T10:18:11.707" Score="0" Body="&lt;p&gt;Here is a very to the point explanation of the &lt;a href=&quot;http://www.quantinvestor.net/viewtopic.php?f=11&amp;amp;t=52&quot; rel=&quot;nofollow&quot;&gt;Merton model&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="17384" LastActivityDate="2015-08-31T10:18:11.707" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19557" PostTypeId="1" CreationDate="2015-08-31T10:41:30.850" Score="3" ViewCount="54" Body="&lt;p&gt;I am trying to find a conservative approximation for the propagated estimation error of a investment portfolio's variance (comprising two assets), given we know the estimation error for the variance of the two underlying assets and the correlation coefficient between these assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have attempted to work through this using standard results for the propagation of estimation error but I am unsure that the end result is correct. Can you confirm whether you think this is a reasonable conservative estimation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use the assumptions that the asset weights will always be between 0 and 1, and furthermore that the error of the variance of the two assets will also always be between 0 and 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[\begin{array}{l}&#xA;\sigma _p^2 = w_1^2\sigma _1^2 + w_2^2\sigma _2^2 + 2{w_1}{w_2}{\sigma _{1,2}}\\&#xA;{\sigma _{1,2}} = {\sigma _1}{\sigma _2}{\rho _{1,2}}\\&#xA;{\varepsilon _{{\sigma _1}}} = \frac{{{\varepsilon _{\sigma _1^2}}}}{{2{\sigma _1}}}\\&#xA;{\varepsilon _{{\sigma _2}}} = \frac{{{\varepsilon _{\sigma _2^2}}}}{{2{\sigma _2}}}\\&#xA;{\varepsilon _{{\sigma _{1,2}}}} \approx {\sigma _{1,2}}\left( {\frac{{{\varepsilon _{{\sigma _1}}}}}{{{\sigma _1}}} + \frac{{{\varepsilon _{{\sigma _2}}}}}{{{\sigma _2}}} + \frac{{{\varepsilon _{{\rho _{1,2}}}}}}{{{\rho _{1,2}}}}} \right) = {\sigma _{1,2}}\left( {\frac{{{\varepsilon _{\sigma _1^2}}}}{{2\sigma _1^2}} + \frac{{{\varepsilon _{\sigma _2^2}}}}{{2\sigma _2^2}} + \frac{{{\varepsilon _{{\rho _{1,2}}}}}}{{{\rho _{1,2}}}}} \right)\\&#xA;{\sigma _{{\varepsilon _{\sigma _1^2}},{\varepsilon _{{\sigma _{1,2}}}}}} = \frac{{{\sigma _{1,2}}\varepsilon _{\sigma _1^2}^2}}{{2\sigma _1^2}}\\&#xA;{\varepsilon _{\sigma _p^2}} \approx w_1^2\varepsilon _{\sigma _1^2}^{} + w_2^2\varepsilon _{\sigma _2^2}^{} + 2{w_1}{w_2}{\varepsilon _{{\sigma _{1,2}}}} + 2w_1^3{w_2}\left( {\frac{{{\sigma _{1,2}}\varepsilon _{\sigma _1^2}^2}}{{2\sigma _1^2}}} \right) + 2w_2^3{w_1}\left( {\frac{{{\sigma _{1,2}}\varepsilon _{\sigma _2^2}^2}}{{2\sigma _2^2}}} \right)\\&#xA;0 \le {w_i},{\varepsilon _{{\sigma _j}}} \le 1 \Rightarrow w_i^3 \le {w_i},\varepsilon _{{\sigma _j}}^2 \le {\varepsilon _{{\sigma _j}}}\\&#xA;{\varepsilon _{\sigma _p^2}} \le w_1^2\varepsilon _{\sigma _1^2}^{} + w_2^2\varepsilon _{\sigma _2^2}^{} + 2{w_1}{w_2}{\sigma _{1,2}}\left( {\frac{{{\varepsilon _{\sigma _1^2}}}}{{\sigma _1^2}} + \frac{{{\varepsilon _{\sigma _2^2}}}}{{\sigma _2^2}} + \frac{{{\varepsilon _{{\rho _{1,2}}}}}}{{{\rho _{1,2}}}}} \right) = {w^T}\Sigma w\\&#xA;w = \left( {\begin{array}{*{20}{c}}&#xA;{{w_1}}\\&#xA;{{w_2}}&#xA;\end{array}} \right),\Sigma  = \left( {\begin{array}{*{20}{c}}&#xA;{{\varepsilon _{\sigma _1^2}}}&amp;amp;{{\sigma _{1,2}}\left( {\frac{{{\varepsilon _{\sigma _1^2}}}}{{\sigma _1^2}} + \frac{{{\varepsilon _{\sigma _2^2}}}}{{\sigma _2^2}} + \frac{{{\varepsilon _{{\rho _{1,2}}}}}}{{{\rho _{1,2}}}}} \right)}\\&#xA;{{\sigma _{1,2}}\left( {\frac{{{\varepsilon _{\sigma _1^2}}}}{{\sigma _1^2}} + \frac{{{\varepsilon _{\sigma _2^2}}}}{{\sigma _2^2}} + \frac{{{\varepsilon _{{\rho _{1,2}}}}}}{{{\rho _{1,2}}}}} \right)}&amp;amp;{{\varepsilon _{\sigma _2^2}}}&#xA;\end{array}} \right)&#xA;\end{array}]&lt;/p&gt;&#xA;" OwnerUserId="17385" LastEditorUserId="17385" LastEditDate="2015-08-31T14:59:07.580" LastActivityDate="2015-08-31T14:59:07.580" Title="How to calculate the estimation error of portfolio variance using propagation results?" Tags="&lt;portfolio&gt;&lt;covariance&gt;&lt;estimation&gt;&lt;variance&gt;&lt;error&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19559" PostTypeId="1" CreationDate="2015-08-31T11:40:40.330" Score="1" ViewCount="119" Body="&lt;p&gt;I am trying to calculate return on investment for a couple of companies and their respective products.&#xA;I have two main products:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;credit card &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;installment loan&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Owners would like to be able to compare these two companies (products) return on investment.&#xA;What I have done so far is to calculate IRR (similar to XIRR formula and requirements in EXCEL).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) The issue is that I am calculating IRR on revolving product. Consequently, when a customer is good but withdraws more money than returns the IRR is negative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Additionally, I am not sure I am sure how to incorporate costs in the revolving product - I cannot put % of used principal because of the positive and negative cash-flows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas how to overcome these issues (especially point 1); maybe use something instead of IRR as a metric?&lt;/p&gt;&#xA;" OwnerUserId="17386" LastEditorUserId="17386" LastEditDate="2015-08-31T12:00:31.533" LastActivityDate="2015-08-31T12:00:31.533" Title="Calculate and compare IRR among products and companies" Tags="&lt;finance&gt;&lt;credit&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19560" PostTypeId="1" CreationDate="2015-08-31T15:17:27.120" Score="2" ViewCount="4777" Body="&lt;p&gt;I have a question concerning 1-factor Hull-White model. For my master project I need to calibrate it to compute Counterparty credit risk metrics. I know that the model might be calibrated either for risk-neutral measure (in CVA applications) using market-traded swaptions or caps or for historical measure. This is where I am stuck at the moment. Can anyone offer a good paper / or some idea how to calibrate mean reversion parameter a and variance sigma to the &lt;strong&gt;historical&lt;/strong&gt; data? What historical data do I have to use? And how to perform the calibration step-by-step?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If anyone also has also a solution in Matlab and could share it - that would be also highly appreciated =))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="17387" LastActivityDate="2018-06-02T10:23:33.590" Title="Historical calibration of Hull-White model" Tags="&lt;interest-rates&gt;&lt;calibration&gt;&lt;hullwhite&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19561" PostTypeId="1" CreationDate="2015-08-31T16:10:37.740" Score="0" ViewCount="285" Body="&lt;p&gt;I am looking to model the cash flows associated with a company as part of a Project finance experiment, where I got the idea from &lt;a href=&quot;http://www.investopedia.com/articles/financial-theory/08/monte-carlo-multivariate-model.asp&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. I'm looking to project cash flows for an Automotive company in India upto 2018, given that I have its set of cash flows upto 2014. I was just wondering how I could look to set this up, in terms of the actual model, as I wasn't able to find any relevant documentation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, would the random variables be something like these, where I'll have to assume some sort of distributions based on historical data:&#xA;1) Oil prices&#xA;2) Price of plastic/steel &#xA;3) Average disposable income of people&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank You&lt;/p&gt;&#xA;" OwnerUserId="11917" LastEditorUserId="11917" LastEditDate="2015-08-31T20:02:19.313" LastActivityDate="2015-08-31T21:05:16.940" Title="Projecting cash flows via Monte Carlo Simulation" Tags="&lt;monte-carlo&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19562" PostTypeId="2" ParentId="19561" CreationDate="2015-08-31T21:05:16.940" Score="1" Body="&lt;p&gt;Usually in corporate finance you don't value a firm using monte carlo. &#xA;You define 4-5 scenarios such as: Base Case, Optimistic Case, Conservative Case, Stress Test, and model them accordingly. &#xA;E.g. In your stress test you would have price plastic/steel soaring, average disposable income going down, etc. &#xA;Then you test how much debt the firm can handle and how to optimize its capital structure.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-08-31T21:05:16.940" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19563" PostTypeId="1" AcceptedAnswerId="19566" CreationDate="2015-09-01T01:05:17.367" Score="1" ViewCount="1419" Body="&lt;p&gt;Is the Put-Call-Parity valid for binary (asset-or-nothing) options? If not, is there another formula for such exotic options? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that for regular options, there are arbitrage opportunities when the put-call-parity does not hold. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Please note that I am very new to learning finance and I am not looking for overly complex answers. &lt;/p&gt;&#xA;" OwnerUserId="20156" LastActivityDate="2015-09-01T04:09:18.563" Title="Put-Call Parity Arbitrage Exploitation for Binary-Asset-or-Nothing Options" Tags="&lt;exotics&gt;&lt;binary-options&gt;&lt;put-call-parity&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19564" PostTypeId="1" AcceptedAnswerId="19579" CreationDate="2015-09-01T02:05:36.803" Score="1" ViewCount="62" Body="&lt;p&gt;I'm working through some actuarial practice and am lost as to what's going on with the differentiation here (it's been a while since I've had calc):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Derive an expression for $\delta_t$ if accumulation is based on:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(a) simple interest at annual rate &lt;i&gt;i&lt;/i&gt;, and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(b) compound interest at annual rate &lt;i&gt;i&lt;/i&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand the answer to (a), which is $\delta_t$ = $\frac{ A'(t)}{A(t)}$ = $\frac{i}{1+i \cdot t}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I don't understand their method of getting $\ln(1+i)$ for part (b).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be much appreciated!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(p.s. this is Example 1.13 p.40 from Broverman's Mathematics of Investment and Credit 5th ed)&lt;/p&gt;&#xA;" OwnerUserId="7718" LastActivityDate="2017-10-26T07:30:33.823" Title="Force of Interest Compounding at Annual Rate i" Tags="&lt;interest&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19565" PostTypeId="1" AcceptedAnswerId="19576" CreationDate="2015-09-01T03:50:11.767" Score="2" ViewCount="713" Body="&lt;p&gt;Strategies published in journal papers like SMB, HML, UMD have annualized sharpe ratios around 0.5. These long-short portfolios are formed with monthly rebalance. People who backtest some daily rebalancing strategies usually claim annualized sharpe ratio that is above imaginable like above 3. How is this frequency of trading affect this? From what I can recall, if returns are iid, one can simply multiply your sample average daily return over sample daily standard deviation of your return by $\sqrt{365}$ to get the annualized shape. Mean grows as horizon increases at a speed of T, and std grows at speed of sqrt T. That is where this number come from. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it fair to compare strategies with different rebalancing period by sharpe ratio? How come a strategy that is backtested to perform this well exist, assuming there is some rationale behind it not just pure data mining?&lt;/p&gt;&#xA;" OwnerUserId="6804" LastActivityDate="2015-10-09T20:05:12.093" Title="Sharpe Ratio for strategies with different rebalancing period" Tags="&lt;sharpe-ratio&gt;&lt;investment&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19566" PostTypeId="2" ParentId="19563" CreationDate="2015-09-01T04:09:18.563" Score="1" Body="&lt;p&gt;the call version pays&#xA;$$&#xA;I_{S_T &amp;gt; K } S_T&#xA;$$&#xA;the put version pays&#xA;$$&#xA;-I_{S_T &amp;lt; K } S_T&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Subtract to get a pay-off&#xA;$$&#xA;S_T.&#xA;$$&#xA;(ignoring the probability zero event of $S_T=K.$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the prices subtract to give $S_0.$&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-09-01T04:09:18.563" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19567" PostTypeId="1" AcceptedAnswerId="19568" CreationDate="2015-09-01T06:13:26.063" Score="3" ViewCount="2122" Body="&lt;p&gt;I have written some software to price a call option using Monte Carlo simulation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It produces a price which is consistent with the model when I set the time step as recommended in a tutorial that I am following, which instructs to divide the expiration by 100.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I decided to experiment with the time step size and noticed that if I make the time steps further smaller by a factor of 10, the simulation does not produce the correct answer anymore. In fact the answer is way out (answer should be 10.45 but changing the time step gives an answer of around 70).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is whether this is expected behaviour from Monte Carlo simulations when the time step size is adjusted like this? If so, what is the theory behind this. It could also be that my implementation is wrong but I have followed Glasserman's &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0387004513&quot; rel=&quot;nofollow&quot;&gt;book&lt;/a&gt; to letter in writing the software.&lt;/p&gt;&#xA;" OwnerDisplayName="user16556" LastEditorDisplayName="user16556" LastEditDate="2015-09-01T09:43:29.127" LastActivityDate="2015-09-01T14:33:02.620" Title="Why does changing the time step size in my Monte Carlo simulation change my result a lot?" Tags="&lt;option-pricing&gt;&lt;monte-carlo&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19568" PostTypeId="2" ParentId="19567" CreationDate="2015-09-01T06:20:55.490" Score="1" Body="&lt;p&gt;You don't say anything about the model or discretization so it is a little hard to judge. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However,  if you are using an exact discretization, the time step-size should be irrelevant. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are using an approximate one, the more steps you use, the more accurate it should get. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Possible sources of error:&#xA;1) random number generator is not good enough and this only shows up if you use a lot of steps&#xA;2) some term is not scaling correctly with step size.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-09-01T06:20:55.490" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19570" PostTypeId="1" AcceptedAnswerId="20633" CreationDate="2015-09-01T12:30:00.723" Score="5" ViewCount="3095" Body="&lt;p&gt;Who are the major suppliers of index data that cover multiple index providers, e.g. MSCI, FTSE, S&amp;amp;P etc?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a huge number of people sourcing e.g. equity data, but index data is much harder to come by.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am only looking for very high level information and at low frequency - the EOD number for each index would almost be enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basic information on the constituents and their weights would also be useful, but in depth analysis and such like of the indexes and their constituents isn't required.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sites like Yahoo Finance just seem to cover a small number of major indexes, whereas I'm interested in sector indexes and such like that aren't commonly covered, e.g. MSCI World Telecommunication Services.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for a provider with historical data (going back e.g. 10 years) who will also provide data day-by-day going forward.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I work with a data aggregator who, before they supply particular data, requires us to negotiate agreements directly with the individual index providers, e.g. MSCI or FTSE, rather than handling this on our behalf.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They also provide the data in a highly non-standardized form, e.g. data from MSCI will come in a different form to that from FTSE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And they only sell the data in very non-flexible bundles, e.g. rather than just buying basic EOD numbers one has to buy a hugely expensive package of in-depth analysis of which these numbers are a tiny part.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's not that I don't expect to pay for this data - but it would be nicer if possible to pay for just the basic data needed and to have the negotiation with the actual index providers handled behind the scenes by the data provider themselves.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apologies if you feel this, as a rather commercial question rather than something interesting on e.g. option pricing, isn't directly appropriate to this stack exchange.&lt;/p&gt;&#xA;" OwnerUserId="17395" LastActivityDate="2015-12-22T13:21:16.043" Title="Sources of index data (MSCI, FTSE, S&amp;P etc.)?" Tags="&lt;market-data&gt;&lt;historical-data&gt;&lt;index&gt;" AnswerCount="3" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19571" PostTypeId="1" CreationDate="2015-09-01T12:52:42.190" Score="4" ViewCount="692" Body="&lt;p&gt;In this paper, &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2226985&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2226985&lt;/a&gt;, in the derivation of the mean variance efficient portfolio using lagrangians in the appendix, on page 29, the two portfolios are defined:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\pi_R=\frac{V^{-1}R}{1^TV^{-1}R},  \quad \pi_\sigma=\frac{V^{-1} 1}{1^TV^{-1}1}&#xA;$$&#xA;where $V$ is the covariance matrix, $R$ is a column vector of returns and $1$ is the vector of ones. $\pi_R$ is said to be the portfolio that maximises the sharpe ratio while $\pi_\sigma$ is the portfolio that minimises variance, I'm not quite sure  how the definitions follow?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: For background:If we let $d$ be a column vector of active weights, that is, the difference between the portfolio weight and the benchmark, then the objective is to:&#xA;$$&#xA;\text{max}  ~~R^T d&#xA;$$&#xA;subject to&#xA;$$&#xA;d^T V d = \sigma^2_\alpha, \quad 1^Td =0&#xA;$$&#xA;where $\sigma^2_\alpha$ is the active portfolios variance of arithmetic return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Setting up the lagrangian and a bit of calculus gets to:&#xA;$$&#xA;d=\frac{1}{2\lambda_1} \left( V^{-1}R - \left(\frac{1^TV^{-1}R}{1^TV^{-1}1} \right)V^{-1} 1\right)&#xA;$$&#xA;this is the last step before the portfolios are defined.&lt;/p&gt;&#xA;" OwnerUserId="8105" LastEditorUserId="8105" LastEditDate="2015-09-01T14:37:24.050" LastActivityDate="2020-07-24T09:04:35.613" Title="Definition of sharpe ratio maximising and variance minimising portfolios" Tags="&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;&lt;markowitz&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19572" PostTypeId="1" AcceptedAnswerId="19577" CreationDate="2015-09-01T13:49:47.493" Score="1" ViewCount="196" Body="&lt;p&gt;If you have an index and have measured its beta with respect to the overall market, how would you go about adjusting it against spread dv01 and why would you want this number?&lt;/p&gt;&#xA;" OwnerUserId="11723" LastEditorUserId="11723" LastEditDate="2015-09-01T13:58:47.317" LastActivityDate="2015-09-01T15:03:29.530" Title="Adjusting index betas for spread DV01" Tags="&lt;index&gt;&lt;beta&gt;&lt;duration&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19573" PostTypeId="2" ParentId="19567" CreationDate="2015-09-01T14:33:02.620" Score="0" Body="&lt;p&gt;I don't have any background in financial simulations or the Monte Carlo Algorithm, and I do not know about the program you wrote, which language you used, your background in programming, et cetera.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might be observing some effects based on floating point numbers. If you make the step size smaller, the result of some multiplication will be smaller. You will most likely add that to some existing result, and you could lose precision in that step. Basically, adding a very very small number to a bigger number can cancel out the smaller number. Because the exponent of both numbers needs to be the same, the numbers will be shifted before the addition. After the addition, the result gets shifted again, and the very small part might be shifted away. Look up floating point addition and go through your code to clarify if this is the case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also try to debug the code and calculate single steps with a calculator and compare that to your computer's result.&lt;/p&gt;&#xA;" OwnerUserId="17398" LastActivityDate="2015-09-01T14:33:02.620" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19574" PostTypeId="2" ParentId="15199" CreationDate="2015-09-01T14:34:45.027" Score="-1" Body="&lt;p&gt;Wealth Management and Asset Management are closely related to one another. &#xA;However, there are differences between the two.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Wealth management is broader in perspective and includes asset management services, investment management, real estate management, tax planning etc.&lt;/li&gt;&#xA;&lt;li&gt;Asset management is related to the management of assets and investments such as stocks, bonds, real estate and also other assest.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="17397" LastActivityDate="2015-09-01T14:34:45.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19575" PostTypeId="1" CreationDate="2015-09-01T14:55:12.813" Score="5" ViewCount="833" Body="&lt;p&gt;From page 27, &lt;a href=&quot;http://www.opengamma.com/sites/default/files/pricing-and-risk-management-credit-default-swaps-opengamma.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Table 6&lt;/a&gt;: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/6xljN.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/6xljN.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why are sensitivities of CDS slightly negative before the maturity of the CDS?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not get the intuition: if I am long a 5-year CDS, the spreads &amp;lt;5y increase, and the 5y spread remains constant, according to the table above I am loosing money because of the negative signs of the sensitivity. How is this possible?&lt;/p&gt;&#xA;" OwnerUserId="17291" LastEditorUserId="467" LastEditDate="2015-11-02T02:54:07.153" LastActivityDate="2015-11-02T02:54:07.153" Title="How to interpret this CDS spread sensitivity pattern?" Tags="&lt;greeks&gt;&lt;credit&gt;&lt;cds&gt;&lt;sensitivities&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19576" PostTypeId="2" ParentId="19565" CreationDate="2015-09-01T14:56:20.170" Score="2" Body="&lt;p&gt;It is true that strategies with higher trading frequencies have Sharpe ratios that appear implausibly high by the standards of Fama-French factors.  The strong law of large numbers really helps them, as they realize profits repeatedly while not increasing the standard deviation very quickly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The real barriers to entry for them are the costs that traditionally don't make it into Sharpe calculations.   FPGA programmers don't work for free!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tend to think of this as something like a law firm, where there's not necessarily any capital to speak of so the return on capital is &quot;nearly infinite&quot;.  It doesn't mean that, as a business, the enterprise is infinitely profitable. &lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2015-09-01T14:56:20.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19577" PostTypeId="2" ParentId="19572" CreationDate="2015-09-01T15:03:29.530" Score="2" Body="&lt;p&gt;If you believe that the fundamental economic relationship is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;r_{\text{Spread}} = \beta \, r_{\text{Market}} + \text{const}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then in order to obtain the beta of a credit index $I$ with CD01 $c$ to the market you would write&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;r_I = c \, r_{\text{Spread}}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and thus &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;r_I = c\, \beta \, r_{\text{Market}} + \text{const}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you need to estimate $\beta$ from observed data.   To do so, you need a time series of $r_{\text{Market}}$ and $r_{\text{Spread}}$.   To obtain the $r_{\text{Spread}}$  you simply take&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;r_{\text{Spread}}^{(t)} = r_{I}^{(t)} / c^{(t)}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the &quot;adjusting it against spread dv01&quot; that you have observed.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2015-09-01T15:03:29.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19579" PostTypeId="2" ParentId="19564" CreationDate="2015-09-01T16:02:30.713" Score="1" Body="&lt;p&gt;Compound interest is $A(t) = (1+i)^t$.&#xA;So then $\delta_t = \frac{d}{dt}ln(A(t)) = \frac{d}{dt}t*ln(1+i) = ln(1+i)$&lt;/p&gt;&#xA;" OwnerUserId="5940" LastActivityDate="2015-09-01T16:02:30.713" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19581" PostTypeId="1" CreationDate="2015-09-01T18:18:19.577" Score="3" ViewCount="113" Body="&lt;p&gt;For Example : if Risk weighted asset (RWA) increased or decreased this month, which other risk metrics could have influenced RWA to increase or decrease.  Also in different situations like, upward trend, sudden increase, downward trend, sudden decrease, neutral or stable RWA. I want to understand and trying to create a document for my reference and learning purpose.&lt;/p&gt;&#xA;" OwnerUserId="12108" LastActivityDate="2019-10-31T15:47:30.703" Title="Want to understand the links and relationship between all the risk metrics?" Tags="&lt;risk-management&gt;&lt;finance&gt;&lt;risk-models&gt;&lt;credit-risk&gt;&lt;banks&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19582" PostTypeId="2" ParentId="19575" CreationDate="2015-09-01T21:02:57.480" Score="2" Body="&lt;p&gt;When you long a 5y CDS and the spreads &amp;lt;5y increase and the 5y spread remains constant, the premium leg value is decreased. It appears that the CDS value should increase, and you should have a positive sensitivity. However, depending on the shape of the survival probability curve, the protection leg value may also decreased, and then the CDS value, which is defined as the protection leg value minus the premium leg value, may decrease as well. Then you may have a negative sensitivity.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-09-01T22:45:33.663" LastActivityDate="2015-09-01T22:45:33.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19583" PostTypeId="1" CreationDate="2015-09-01T22:59:54.863" Score="0" ViewCount="90" Body="&lt;p&gt;I am running a simple Monte Carlo analysis in Excel using mean return, standard deviation and the =NORMINV(RAND(),mean,std dev) method. I have a correlation matrix that I use to compute the portfolio variance for varying weights of 16 assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to compute the standard deviation of a single asset after accounting for correlations with the portfolio. For example using the data in the attached picture, if I wanted to run a Monte Carlo analysis on asset 1 after accounting for the correlations with assets 2 and 3 in portfolio 1, what would me steps be? The mean return would simply be the weight of the asset in the portfolio times the assets return but what would the standard deviation of the asset be, the standard deviation of the portfolio times the weight of the asset?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/43hQ7.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/43hQ7.png&quot; alt=&quot;Data&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17407" LastEditorUserId="17407" LastEditDate="2015-09-01T23:07:10.410" LastActivityDate="2016-01-31T00:20:42.837" Title="Isolating single assets standard deviation in a portfolio accounting for correlation" Tags="&lt;portfolio-management&gt;&lt;correlation-matrix&gt;&lt;standard-deviation&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19584" PostTypeId="1" CreationDate="2015-09-02T00:25:21.747" Score="3" ViewCount="2275" Body="&lt;p&gt;I came across this multiple choice question on yield spread and I can't understand why the reasoning for the selected answer is correct.Can you confirm or clarify ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(&#xA;emphasis in the text is mine)&#xA;&lt;a href=&quot;https://i.stack.imgur.com/dV3x2.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/dV3x2.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The bond's market price of 103.73 can be computed by discounting its&#xA;  cash flows continuously at 4.0% per annum, which is represented by the&#xA;  flat yellow line. Specifically:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$3.00e^{-.04*0.5} + 3.00e^{-.04*1.0} + 3.00e^{-.04*1.5} +&#xA;&amp;gt; 103.00e^{-.04*2}&#xA;&amp;gt; = 103.73$. &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The bond's same market price of $104.73 can also be derived by&#xA;  discounting the same cash flows according to the continuous discount&#xA;  rates given by the the steep blue line. The lower steep line, which&#xA;  shows a rate of 0.40% at six months, is actually two nearby curves: a&#xA;  swap rate curve and nearby spot rate curve. &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Both start at 0.40% but, as the spot rate curve is slightly steeper,&#xA;  by year 2.0, the &lt;strong&gt;spot rate is 1.61%&lt;/strong&gt; while the swap rate is 1.60%.&#xA;  For this purpose, we assume both the spot and are risk-free curves;&#xA;  e.g., US Treasury.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Each of the following is true about this bond EXCEPT which is&#xA;  &lt;strong&gt;false&lt;/strong&gt;?&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;a) The bond's yield-to-maturity is 4.0%&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;b) The yield spread, represented by the solid red vertical arrow, is&#xA;  the difference between 4.0% (yellow line) and 0.40% (spot rate at six&#xA;  months)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;c) If the price of the bond decreased due solely to perceived credit&#xA;  risk of bond (without any change in market risk), the upper curves&#xA;  (yellow and blue) would shift up&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;d) The z-spread, represented by the dashed red vertical arrow, is the&#xA;  difference between the (upper steep) blue line and the (lower steep)&#xA;  spot rate; e.g., 2.42% = 4.03% - 1.61%&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The given answer is:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;B.&lt;/strong&gt; The yield spread is the &quot;single-point&quot; difference between the yield to maturity (YTM) and the corresponding riskless spot rate; in&#xA;  this case, yield spread ~= 4.0% -&#xA;  1.61% ~= 2.39%. As the endpoints at year 2.0 are near to each other, this yield is only slightly less than the z-spread of 2.42%, due&#xA;  primarily to the fact that the upper blue line endpoint must&#xA;  necessarily be slightly greater than the 4.0% YTM. If the&#xA;  corresponding riskless swap rate is necessarily interpolated, then&#xA;  this yield spread is an i-spread&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Isn't yield spread the difference in yield to maturity between the corporate bond and the risk free bond? In this question, 1.61 is the 2 year spot and not a yield to maturity. What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="467" LastEditDate="2015-09-02T06:27:32.793" LastActivityDate="2015-09-02T06:27:32.793" Title="How to calculate yield spread?" Tags="&lt;spread&gt;&lt;yield&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19586" PostTypeId="1" AcceptedAnswerId="19587" CreationDate="2015-09-02T12:10:25.480" Score="5" ViewCount="296" Body="&lt;p&gt;I'm currently comparing empirically the differences between Markowitz and Kelly portfolios. I calculated the Kelly weights for monthly return observations over 10 years for a sample of 50 stocks from the S&amp;amp;P 500.  Without constraints, I received a highly levered Kelly portfolio of weights summing up to 23 with mean of 85% and std. deviation of 91%. I then de-levered the portfolio proportionally and received the same tangency portfolio with the exact same weights as in the Mean-Variance-Optimization case. I was surprised by this result and wanted to ask you if someone knows why this could be the case or made similar observations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I’m very grateful for any kind of advice on this subject. &lt;/p&gt;&#xA;" OwnerUserId="17358" LastActivityDate="2015-09-02T16:12:21.570" Title="Full Kelly portfolios having same weights as tangency portfolios" Tags="&lt;optimization&gt;&lt;portfolio&gt;&lt;markowitz&gt;&lt;kelly-criterion&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19587" PostTypeId="2" ParentId="19586" CreationDate="2015-09-02T16:12:21.570" Score="2" Body="&lt;p&gt;They are the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The maximum growth rate is achieved when the Sharpe ratio is maximized.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the proof, see &lt;a href=&quot;http://epchan.blogspot.com/2014/08/kelly-vs-markowitz-portfolio.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13857" LastActivityDate="2015-09-02T16:12:21.570" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="19588" PostTypeId="1" AcceptedAnswerId="20622" CreationDate="2015-09-02T16:16:06.283" Score="4" ViewCount="2715" Body="&lt;p&gt;I am finding it difficult to understand the difference between the sharpe ratio and the information ratio and the relationship between the two, and cannot find a decent reference that breaks it down in terms of the actual mathematical definitions of the two. The Wiki page for the two is quite confusing as well, since it defines sharpe ratios almost identically to information ratios, but SR is in terms of a single asset, IR is in term of a portfolio of assets. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;update&lt;/strong&gt;: for clarity, the definiton of sharpe ratio (Wiki):&#xA;$$&#xA;S_a = \frac{E(R_a-R_b)}{\sqrt{Var(R_a - R_b)}}&#xA;$$&#xA;and definition of information ratio:&#xA;$$&#xA;IR_p = \frac{E(R_p-R_b)}{\sqrt{Var(R_p - R_b)}}&#xA;$$&#xA;where a is the reference asset, b is the benchmark and p is the reference portfolio&lt;/p&gt;&#xA;" OwnerUserId="8105" LastEditorUserId="8105" LastEditDate="2015-09-03T02:47:14.160" LastActivityDate="2018-10-25T14:29:04.870" Title="Difference between Sharpe Ratio and Information Ratio" Tags="&lt;modern-portfolio-theory&gt;&lt;sharpe-ratio&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19591" PostTypeId="2" ParentId="19583" CreationDate="2015-09-02T22:17:49.530" Score="1" Body="&lt;p&gt;If I understand correctly what you are after is the marginal volatility contribution of a single asset to the portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is given by&#xA;$$&#xA;\sigma(X_j;X) = \sigma(X_j)\ \rho(X_j, X)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.greta.it/credit/credit2007/thursday/1_Tasche.pdf&quot; rel=&quot;nofollow&quot; title=&quot;See here&quot;&gt;See here&lt;/a&gt; for details.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2015-09-02T22:17:49.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19592" PostTypeId="1" CreationDate="2015-09-02T23:01:17.803" Score="1" ViewCount="41" Body="&lt;p&gt;I went through Whites paper of the reality check for multiple strategy testing.&#xA;To summarize at a simple example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have 2 strategies, s1 and s2.&#xA;s1 gives 2 signals and therefore 2 returns, s2 gives 10 signals and therefore &#xA;10 returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the Reality Check procedure:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I compare the means of the returns to some benchmark., e.g., mean(returns) = zero.&#xA;To get p-values of H0, strat returns are zero, I&#xA;do a Bootstrap of both strat returns, calculate both means, take the max&#xA;and repeat this prozess a high number of times. I call this array BSvals.&#xA;From those values I get the p-value of H0(s1) and H0(s2) being the fraction of BSvals values, that is &gt; mean return .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, &#xA;In this method I see a flaw. Because of the lower number of signals in s1 &#xA;the variance of the bootstrapped mean of s1 will be much higher than in s2. Therefore s1 will push pvalues of H0 much higher then if s1 would have signaled more often. Therefore the mean of returns as a performance statistic&#xA;might not be suitable when comparing strategies with different number of trades/signals. &#xA;I think of using t statistic as a unbiased performance measure to compensate &#xA;for different signal numbers, being&#xA;t = mean(strat returns) * squareroot(number returns) / stddev&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How is your thoughts about this?&#xA;Strat returns being not normal distributed squareroot(number returns)&#xA;might not be an appropriate scaling factor, though... &lt;/p&gt;&#xA;" OwnerUserId="11635" LastActivityDate="2015-09-02T23:01:17.803" Title="number of trades - flaw in White Reality Check?" Tags="&lt;hullwhite&gt;&lt;bootstrapping&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19594" PostTypeId="2" ParentId="18134" CreationDate="2015-09-03T00:34:09.000" Score="9" Body="&lt;p&gt;I think you might find this answer in &lt;a href=&quot;https://quant.stackexchange.com/questions/16792/the-future-language-of-quant-programming/17445#17445&quot;&gt;The future language of quant programming?&lt;/a&gt; useful.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;People get this problem wrong because they always end up discussing the theoretical advantages of these languages rather than the practical uses of these languages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Theoretically speaking:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Haskell&lt;/strong&gt; is elegant and has many of the theoretical advantages (language conciseness, orthogonality, parametric polymorphism, ADTs, higher-order functions, smart compiler), has been around for 25 years, but still isn't mainstream in finance.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Python&lt;/strong&gt; is an &lt;em&gt;ugly&lt;/em&gt; language. The syntax is adored for its expressiveness, but design decisions such as the &lt;a href=&quot;http://www.dabeaz.com/python/UnderstandingGIL.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;GIL&lt;/a&gt;, dynamic typing, object-oriented paradigm etc. are inherently anti-parallel and decades down the road when we have hundreds of cores on each processor, our children are going to laugh at the obscurity and obsoleteness of such languages (among other things such as floppy disks).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Yet today almost everyone would encourage you to pick up Python. Why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;A language's (or any technology's, for that matter) future is decided by its community, the richness of its libraries and development tools and the self-perpetuating nature of legacy code in that language&lt;/strong&gt;, and never its theoretical advantages. We can write essays about how we hate &lt;strong&gt;Java&lt;/strong&gt;; the &lt;strong&gt;ROOT&lt;/strong&gt; and &lt;strong&gt;Boost&lt;/strong&gt; libraries; the verbosity of &lt;strong&gt;XML&lt;/strong&gt;, but these things are here to stay because they've achieved a &lt;em&gt;critical mass&lt;/em&gt; of users who are willing to build production strength tools or libraries around them. Dozens of functional languages such as &lt;strong&gt;F#&lt;/strong&gt; will come and go, but C++ will almost certainly remain because of the sheer amount of legacy code in C++. Besides, C++ '11 is a huge milestone in sorting out the theoretical mishaps along its development path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few choices I'd approach cautiously:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Languages built around concurrent and functional paradigms: &lt;strong&gt;Scala, F#&lt;/strong&gt;. I'd say to approach it cautiously because it's used in production at Dropbox, Lime, Tower Research, Credit Suisse etc. but these languages have taken a much longer time to rise to mainstream use than you'd expect them to given the current trends in processor architecture. It's hard for me to tell you whether or not investing your time now in these languages will pay off exactly 5 years from now, but we all seem to agree that these languages eventually will.&lt;/li&gt;&#xA;&lt;li&gt;Domain-specific languages: &lt;strong&gt;Julia&lt;/strong&gt;. Unfortunately, Julia markets itself with &quot;C-speed numerical inner loops&quot;. It attracts the same subset of the Python crowd who would argue with these Julia users that this is irrelevant since they can always drop to Cython. Both crowds espouse a doomed paradigm and attract low quality developers. (I say &lt;em&gt;unfortunately&lt;/em&gt;, because Julia has a great number of things that people don't realize: type-parametric multimethods, symmetric coroutines, clean interfaces with foreign languages, Lisp influences and metaprogramming support etc.)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;With that, I'd encourage a few choices:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Languages with big brother support: &lt;strong&gt;Go, Swift, C#&lt;/strong&gt;. Aside from Google's support, Go has become very popular in China; Microsoft had made a huge move forward by open-sourcing C#; and plenty of high quality UI development tools always spawn around Apple's core languages.&lt;/li&gt;&#xA;&lt;li&gt;Languages intended to supplant C/C++ as a systems-level programming language: &lt;strong&gt;D, Nimrod&lt;/strong&gt;. D already has Facebook's backing, and Nimrod retains the expressiveness of Python's syntax while achieving impressive benchmarks and being used for certain systems-level programming projects. Beware however that both still rely on the GC approach to memory management.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Have any of the above achieved a critical mass of good developers? I don't think so. The real solution for you is that a programming language really isn't difficult to pick up! What's more important is that you pick up how to &lt;strong&gt;design&lt;/strong&gt; a program rather than a specific language. Spend time with the 6 major language paradigms:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Imperative programming (C) and class abstractions (C++, C#, Java)&lt;/li&gt;&#xA;&lt;li&gt;Functional abstraction (Lisp, ML, F#)&lt;/li&gt;&#xA;&lt;li&gt;Declarative specifications (C++ templates, Haskell, Prolog)&lt;/li&gt;&#xA;&lt;li&gt;Syntactic abstraction (Lisp)&lt;/li&gt;&#xA;&lt;li&gt;Parallelism (Cilk, SISAL, Clojure, Erlang)&lt;/li&gt;&#xA;&lt;li&gt;Coroutines (C#, F#, Haskell, Scheme, Icon)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Quantitative trading often invokes concepts from these three core fields:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Algorithms, design patterns and data structures: B-trees, skip lists, memoization, DP etc.&lt;/li&gt;&#xA;&lt;li&gt;Systems programming: Memory addressing, assembly, linking, heap/stack, cache etc.&lt;/li&gt;&#xA;&lt;li&gt;Databases: Normalization, two phase commit, replication, mirroring, schema design etc.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And if you move closer to the quant developer end of the spectrum:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Distributed systems&lt;/li&gt;&#xA;&lt;li&gt;Operating systems&lt;/li&gt;&#xA;&lt;li&gt;Networks&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-09-03T00:34:09.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19595" PostTypeId="1" CreationDate="2015-09-03T00:53:51.370" Score="1" ViewCount="98" Body="&lt;p&gt;Was curious if anyone has methodologies they can recommend for systematically labeling (discrete) signals generated from intraday tick data for use in classification or detection models ? &lt;/p&gt;&#xA;" OwnerUserId="17414" LastActivityDate="2015-09-03T00:53:51.370" Title="labeling high frequency signal data" Tags="&lt;time-series&gt;&lt;high-frequency&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19596" PostTypeId="2" ParentId="908" CreationDate="2015-09-03T04:03:22.150" Score="4" Body="&lt;p&gt;I haven't posted on SE much, so hope you will not mind if I also answer some comments here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best paper I have seen articulating what Soros does is by Flavia Cymbalista, a psychologist writing in the tradition of Eugen Gendlin.  It's  a very brainy paper, and Soros himself has spoken favourably about it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A link to it is here:&#xA;&lt;a href=&quot;http://www.martinkronicle.com/wp-content/uploads/2010/03/How_George_Soros_Knows_What_He_Knows.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.martinkronicle.com/wp-content/uploads/2010/03/How_George_Soros_Knows_What_He_Knows.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And her website is here:&#xA;&lt;a href=&quot;http://marketfocusing.com/&quot; rel=&quot;nofollow&quot;&gt;http://marketfocusing.com/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have written a bit more myself here:&#xA;&lt;a href=&quot;https://www.quora.com/How-did-George-Soros-and-Jim-Rogers-fund-the-Quantum-Fund-earn-33-annualized-returns-for-30+-years&quot; rel=&quot;nofollow&quot;&gt;https://www.quora.com/How-did-George-Soros-and-Jim-Rogers-fund-the-Quantum-Fund-earn-33-annualized-returns-for-30+-years&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's a mistake in my view to think that what he discusses is something that can be turned into a mathematical model.  In markets one is dealing with conditions of radical/Knightian uncertainty, where in truth assigning a distribution of probabilities is rather fraught since to do so requires understanding the structure of the problem, something that quite often isn't the case.  One doesn't know what one doesn't know.  Ludwig Lachmann, GLS Shackle, Israel Kirzner, James Buchanan, and Viktor Vanberg as well as Frank Knight have written about this problem.  The post-Keynesians too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So he isn't talking about mean reversion or the fact that markets trend (or that there is momentum).  These things are true, and they naturally emerge from his world-view, but that isn't what he was talking about.  If that's what he meant he would have said so, and I am pretty sure it isn't.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, it's also not true to say that Soros's approach is bottom-up.  It's not top down either.  But you could describe it as based on a gestalt that involves a to-ing and froing between different levels.  Analysis means breaking something down into pieces to understand it better.  (See Stanford dictionary of philosophy).  You can't get to a gestalt merely from analysis, because the whole is more than the sum of the parts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sornette's work is interesting, but I never met a guy who made money from it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Non-linear dynamics - either you mean this literally or metaphorically.  If literally this raises some problems, because how can anyone possibly have insight using a non-quantitative approach.  Soros isn't in essence some kind of calculating savant.  If metaphorically, you can call it what you like, but I don't know the metaphor helps you to understand the problem better.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's my belief that one isn't going to get anywhere as regards deep insight into economic and financial trends with stochastic processes that are ergodic because economic life isn't such.  And non-ergodic processes present difficulties of their own.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.dictionaryofeconomics.com/article?id=pde2008_O000096&quot; rel=&quot;nofollow&quot;&gt;http://www.dictionaryofeconomics.com/article?id=pde2008_O000096&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed, I hadn't seen this before now, but Soros specifically objects to ergodicity:&#xA;&lt;a href=&quot;https://rwer.wordpress.com/2012/03/28/the-ergodic-axiom-davidson-versus-stiglitz-and-lucas/&quot; rel=&quot;nofollow&quot;&gt;https://rwer.wordpress.com/2012/03/28/the-ergodic-axiom-davidson-versus-stiglitz-and-lucas/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my view, the essence of reflexivity relates to how humans perceive change.  That requires an understanding of psychology, too, and this cannot be separated from what the neuroeconomics tells us about the primacy of affect.  (It's a lesson also from the Gestalt school, which tells us that affect does not just shape the hedonic value placed on something but also the perception of that thing itself).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, one will get much further with taking affect seriously than with pretending it doesn't exist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I write informed by some of the academic literature, but this perspective is based rather more on experience than on academics.  Hope it's been interesting to a few.&lt;/p&gt;&#xA;" OwnerUserId="13552" LastActivityDate="2015-09-03T04:03:22.150" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19597" PostTypeId="1" CreationDate="2015-09-03T05:41:23.673" Score="6" ViewCount="4589" Body="&lt;p&gt;Posting here after searching around and not finding any responses to basically the same question that I saw &lt;a href=&quot;http://www.elitetrader.com/et/index.php?threads/send-trail-stop-order-when-price-reaches-a-certain-level-with-ib-tws.292663/&quot; rel=&quot;nofollow noreferrer&quot;&gt;on EliteTrader&lt;/a&gt;, with another variant posted &lt;a href=&quot;http://www.elitetrader.com/et/index.php?threads/ib-tws-homemade-conditional-stop.50270/&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;em&gt;10 years ago&lt;/em&gt;&lt;/a&gt; (update: &lt;a href=&quot;https://money.stackexchange.com/questions/39771/is-this-a-trailing-limit-if-touched-order-or-something-simpler&quot;&gt;the same question on Money&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say I bought X at 100 and want to have TWS automatically submit a TRAIL STOP order when the price reaches 110, with a trailing amount of 2 Assume I don't care how long it takes for the price to reach that level. How can I do that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;X is now at 95. The order should wait until X hits 110. No order parameters should change.&lt;/li&gt;&#xA;&lt;li&gt;X hits 110. Trailing order is submitted, with trailing amount 2.&lt;/li&gt;&#xA;&lt;li&gt;X goes to 115. Great. Stop price is now 113.&lt;/li&gt;&#xA;&lt;li&gt;X drops to 112. Market order triggers.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I tried attaching a condition, but got this error:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ebvlz.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ebvlz.png&quot; alt=&quot;Can&amp;#39;t add conditions for trail orders&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Conditional submission of orders is supported for Limit, Market, Relative and Snap order types only.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The goal is to lock in some profit and have unlimited upside, at the expense of downside risk. A &lt;a href=&quot;https://www.interactivebrokers.com/en/?f=%2Fen%2Ftrading%2Forders%2FtrailingMarketTouched.php&quot; rel=&quot;nofollow noreferrer&quot;&gt;Trailing Market if Touched&lt;/a&gt; &lt;em&gt;sounds&lt;/em&gt; right for selling, but apparently isn't:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A sell trailing market if touched order moves with the market price, and continually recalculates the trigger price at a fixed amount above the market price, based on the user-defined &quot;trailing&quot; amount.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This goes against what I want for step 1 above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Same for &lt;a href=&quot;https://www.interactivebrokers.com/en/?f=%2Fen%2Ftrading%2Forders%2FtrailingLimitTouched.php&quot; rel=&quot;nofollow noreferrer&quot;&gt;Trailing Limit if Touched&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;As the market price falls, the trigger price falls by the user-defined trailing amount, but if the price rises, the trigger price remains the same. When the trigger price is touched, a market order is submitted.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I don't want the trigger price to fall. It should stay 110.&lt;/p&gt;&#xA;" OwnerUserId="4848" LastEditorUserId="-1" LastEditDate="2017-04-13T12:25:30.743" LastActivityDate="2020-11-30T11:43:53.033" Title="Send TRAIL STOP order when price hits a certain level, with IB TWS" Tags="&lt;order-execution&gt;&lt;interactive-brokers&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19598" PostTypeId="1" AcceptedAnswerId="20677" CreationDate="2015-09-03T10:07:59.360" Score="6" ViewCount="2430" Body="&lt;p&gt;I was wondering if someone knows how Bloomberg does their computations for the implied volatility smile for equities. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I understand, they use a lognormal mixture to model the stock prices. But I could not find any more documentation about this topic.&#xA;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="15767" LastActivityDate="2015-09-09T12:58:48.533" Title="Bloomberg implied volatility smile for equities" Tags="&lt;implied-volatility&gt;&lt;bloomberg&gt;&lt;lognormal&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="19599" PostTypeId="1" CreationDate="2015-09-03T11:38:16.807" Score="1" ViewCount="14370" Body="&lt;p&gt;I have 36 months of relative returns and I need to calculate the annualised tracking error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, using 36 months of returns is it simply like below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;stdev(36 months of returns) * sqrt(12)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why the &lt;code&gt;sqrt(12)&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="7530" LastEditorUserId="467" LastEditDate="2015-11-03T03:32:50.890" LastActivityDate="2015-11-03T03:32:50.890" Title="How to calculate annualised tracking error?" Tags="&lt;portfolio-management&gt;&lt;returns&gt;&lt;tracking-error&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19602" PostTypeId="2" ParentId="19599" CreationDate="2015-09-03T13:02:20.587" Score="1" Body="&lt;p&gt;$\sqrt{12}$ annualizes monthly deviations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I don't understand why you measure tracking error with stdev. It should be $$ ATE = \sqrt{\frac{12}{36}\sum_{i=1}^{36}(r_{b,i}-r_{t,i})^2}$$ where $r_{b,i}$ is benchmark  return for month $i$ and $r_{t,i}$ is tracking portfolio return for same period. So you shouldn't substract average error inside square.&lt;/p&gt;&#xA;" OwnerUserId="16805" LastEditorUserId="16805" LastEditDate="2015-09-03T13:10:29.893" LastActivityDate="2015-09-03T13:10:29.893" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19603" PostTypeId="1" AcceptedAnswerId="20851" CreationDate="2015-09-03T13:02:57.303" Score="7" ViewCount="420" Body="&lt;p&gt;I am a masters student looking for some direction on using neural network on market depth data to help predict market liquidity and bid-ask spreads. Can some of the more experienced people give me some research guidance and guide me to some papers that I should be reading? I have tried Google scholar but can't find something meaningful to kick off my research. Thanks&lt;/p&gt;&#xA;" OwnerUserId="17162" LastActivityDate="2015-09-22T21:53:07.287" Title="Research topics - neural networks and market liquidity" Tags="&lt;market&gt;&lt;liquidity&gt;&lt;neural-networks&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="19605" PostTypeId="2" ParentId="19603" CreationDate="2015-09-03T14:22:38.570" Score="5" Body="&lt;p&gt;You can try using different approaches. Starting from something not that &quot;heavy&quot; like the NN. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;0) Pre study&lt;/strong&gt; &lt;br&gt;&#xA;- you need to prepare your data &lt;br&gt; (how you will treat a negative spread (i.e. ASK - BID &amp;lt;0), &lt;br&gt;&#xA;what will you do if you will have 0 spread and then you will divide some value by it?),&lt;br&gt;&#xA;- plan your research ahead - how will you divide your limited data &lt;a href=&quot;https://en.wikipedia.org/wiki/Cross-validation_(statistics)&quot;&gt;https://en.wikipedia.org/wiki/Cross-validation_(statistics)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;1) Time series models&lt;/strong&gt; &lt;br&gt;&#xA;- check if the bid-ask spread tends to be stationary (you can check it using some extracted moving period from your time series), apply statistical tests  &lt;br&gt;&#xA;- apply ARMA, ARIMA models for periods which bid-ask spread is stationary &lt;br&gt; - try to figure out what should you do when the time series stop to be stationary &lt;br&gt;&#xA;- try to apply mean reverting models &lt;br&gt;&#xA;- after doing this you will have some solid understanding of the characteristics of bid-ask spread models and it will be easier to build NN models.  &lt;br&gt;&#xA;- this book might be useful &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0691042896&quot;&gt;http://www.amazon.com/Series-Analysis-James-Douglas-Hamilton/dp/0691042896&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2) Neural networks&lt;/strong&gt;  &lt;br&gt;&#xA;- try to use different input parameters (i.e. you can smooth the data using moving average) &lt;br&gt;&#xA;- try to use also &quot;bid ask volume&quot;, &quot;time&quot; variables  &lt;br&gt;&#xA;- try to use different type of neural networks (different layers) and output neurons and discover which one is the best &quot;out of sample&quot; and &quot;in sample&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW what is your goal of the research? Where is the science? What do you want to discover or prove? What is your hypothesis? Answering those questions might help to plan the research in advance. &lt;/p&gt;&#xA;" OwnerUserId="5745" LastActivityDate="2015-09-03T14:22:38.570" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="19607" PostTypeId="1" CreationDate="2015-09-03T14:46:10.243" Score="-1" ViewCount="466" Body="&lt;p&gt;I want to price a call option using the Heston model for a given set of parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;theory from URL: &lt;a href=&quot;http://elis.sigmath.es.osaka-u.ac.jp/research/Heston-original.pdf&quot; rel=&quot;nofollow&quot;&gt;http://elis.sigmath.es.osaka-u.ac.jp/research/Heston-original.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The integral equation (18) needs to be approximated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to either use the Simpson Rule or Gauss-Legendre method for it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anybody have the matlab or scilab codes for it ?&lt;/p&gt;&#xA;" OwnerUserId="17423" LastEditorUserId="848" LastEditDate="2015-09-03T15:04:51.923" LastActivityDate="2016-07-13T11:56:55.727" Title="Numerical computation of Heston model Integral: Simpsone Rule or Gauss-Legendre Method" Tags="&lt;option-pricing&gt;&lt;numerical-methods&gt;&lt;heston&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19608" PostTypeId="2" ParentId="19607" CreationDate="2015-09-03T14:49:23.800" Score="0" Body="&lt;p&gt;I guess this it, but you need to create an account: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Gauss- Kegendre method&lt;/strong&gt; &lt;br&gt;&#xA;&lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/4540-legendre-gauss-quadrature-weights-and-nodes&quot; rel=&quot;nofollow&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/4540-legendre-gauss-quadrature-weights-and-nodes&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Simpsone Rule&lt;/strong&gt;&lt;br&gt;&#xA;&lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/28726-simpson-s-rule-integration/content/simpsons.m&quot; rel=&quot;nofollow&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/28726-simpson-s-rule-integration/content/simpsons.m&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5745" LastActivityDate="2015-09-03T14:49:23.800" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19610" PostTypeId="2" ParentId="18327" CreationDate="2015-09-03T18:09:37.553" Score="1" Body="&lt;p&gt;I think the question is about dynamic replication in a binomial context except it is worded a bit odd. Normally a tree would be given and one needs to find x(t) and y(t), where x(t) is amount of stock at time t and y(t) is amount of cash at time t.&#xA;Then you do your replication argument and you have that the option price P(0) = X(0) + Y(0).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way this problem is worded you already have the price at time zero. In order to be able to pay off the loan of 1.36 at every time you would still have to go over the replication.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So at t= 0 you need X(0) stocks such that no matter what (either up or down) your portfolio consisting of stocks, cash and put is flat. Note that you will be long the put, you will be long the stock (cause the put has negative delta) and therefore you need to fund both the put (1.36 as well as X(0)*4 for your stock position).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solving gives X(0) = 0.4333 and y(0) = 1.36 + 0.433*4 = 3.0933.&#xA;You can check that this position will always be flat. if stock goes down then you lose on the long stock but make cash on your put (which you need to exercise). etc. If stock goes up you need to readjust your X(1) and rebalance Y(1) to replicate the put payoff again. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you need more help let me know, but you should be fine from here on. Just solve the linear algebra.&lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2015-09-03T18:09:37.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19611" PostTypeId="2" ParentId="19520" CreationDate="2015-09-03T20:23:12.383" Score="2" Body="&lt;p&gt;The problem with Ledoit-Wolf is that it's very sensitive to outliers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should try these:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;DCC GARCH&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;unfortunately, not available in Python&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://pandas.pydata.org/pandas-docs/stable/computation.html#exponentially-weighted-moment-functions&quot; rel=&quot;nofollow&quot;&gt;Exponentially weighed moving average (EWMA)&lt;/a&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;gives slighly worse results than DCC-GARCH&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://scikit-learn.org/stable/modules/generated/sklearn.covariance.MinCovDet.html#sklearn.covariance.MinCovDet&quot; rel=&quot;nofollow&quot;&gt;Minimum Covariance Determinant&lt;/a&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;suggestted by Scikit-Learn&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://arch.readthedocs.org/en/latest/bootstrap/timeseries-bootstraps.html&quot; rel=&quot;nofollow&quot;&gt;bootstrap&lt;/a&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;could be used to calculate confidence interval, then you can decided how conservative you want to be&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Here are some good references:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2650644&quot; rel=&quot;nofollow&quot;&gt;The Impact of Covariance Misspecification in Risk-Based Portfolios&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2411493&quot; rel=&quot;nofollow&quot;&gt;A Test of Covariance Matrix Forecasting Methods&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://scikit-learn.org/stable/modules/covariance.html&quot; rel=&quot;nofollow&quot;&gt;Scikit Learn Covariance Manual&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="13857" LastActivityDate="2015-09-03T20:23:12.383" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="19613" PostTypeId="1" CreationDate="2015-09-03T22:36:32.087" Score="1" ViewCount="48" Body="&lt;p&gt;I have a portfolio ($w_0=1$) and two hedging assets ($w_1,w_2$) and a co-variance matrix for the three $\Sigma$.  However the co-variance $\Sigma$ is only an estimate.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;For fairly well behaved assets (close to normal), what is a good way to understand the uncertainty in co-variance matrix using historical data?&lt;/li&gt;&#xA;&lt;li&gt;Using the two assets, how do I lower my portfolio volatility $\sigma_0$ to a target amount $\sigma_T$ with the most certainty?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;References would be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="5689" LastEditorUserId="5689" LastEditDate="2015-09-03T22:45:15.897" LastActivityDate="2015-09-03T22:45:15.897" Title="Portfolio Hedging under Uncertain Correlations" Tags="&lt;hedging&gt;&lt;portfolio-optimization&gt;&lt;covariance&gt;&lt;robust-optimization&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="19614" PostTypeId="1" AcceptedAnswerId="20616" CreationDate="2015-09-03T23:35:41.580" Score="2" ViewCount="2827" Body="&lt;p&gt;I have a question on the following exercise from chapter 9 of D. Luenberger, Investment Science, International Edition.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Exercise 2 (Wealth Independence)&lt;/p&gt;&#xA;&lt;p&gt;Suppose an investor has exponential utility function &lt;span class=&quot;math-container&quot;&gt;$U(x) = -e^{-ax}$&lt;/span&gt; and an initial wealth level of W. The investor is faced with an opportunity to invest an amount &lt;span class=&quot;math-container&quot;&gt;$w \le W$&lt;/span&gt; and obtain a random payoff &lt;span class=&quot;math-container&quot;&gt;$x$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Show that his evaluation of this incremental investment is independent of W.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I  first considered that the utility after the investment is &lt;span class=&quot;math-container&quot;&gt;$-e^{-aW}*e^{-a(x-w)}$&lt;/span&gt; and that this is a factor above the original utility of &lt;span class=&quot;math-container&quot;&gt;$-e^{-aW}$&lt;/span&gt; which is independent of W, and then that's the solution.&lt;/p&gt;&#xA;&lt;p&gt;However, this doesn't really take into consideration the randomness of x. For instance, I know of one possible example where if &lt;span class=&quot;math-container&quot;&gt;$x$&lt;/span&gt; takes only 2 values with probability of &lt;span class=&quot;math-container&quot;&gt;$\frac{1}{2}$&lt;/span&gt; each then it can be shown that &lt;span class=&quot;math-container&quot;&gt;$w$&lt;/span&gt;, the absolute value amount to be invested, is the exact same for any initial wealth &lt;span class=&quot;math-container&quot;&gt;$W$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;So if it's the case that this question requires a similar result for any random payoff &lt;span class=&quot;math-container&quot;&gt;$x$&lt;/span&gt;, how would I go about doing that if I don't know the probability function of &lt;span class=&quot;math-container&quot;&gt;$x$&lt;/span&gt;?&lt;/p&gt;&#xA;&lt;p&gt;Perhaps I should consider &lt;span class=&quot;math-container&quot;&gt;$w$&lt;/span&gt; as a proportion of &lt;span class=&quot;math-container&quot;&gt;$W$&lt;/span&gt; and then show somehow that this is equal to some constant &lt;span class=&quot;math-container&quot;&gt;$\frac{k}{W}$&lt;/span&gt; when &lt;span class=&quot;math-container&quot;&gt;$E(U(x))$&lt;/span&gt; is maximized with respect to &lt;span class=&quot;math-container&quot;&gt;$x$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;If this is the approach, how do you differentiate &lt;span class=&quot;math-container&quot;&gt;$E(U(x))$&lt;/span&gt; with respect to x?&lt;/p&gt;&#xA;" OwnerUserId="17430" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2015-09-11T22:04:10.283" Title="Utility Theory - How to show that this exponential utility function is wealth-independent?" Tags="&lt;utility-theory&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20614" PostTypeId="1" AcceptedAnswerId="20615" CreationDate="2015-09-04T08:07:03.600" Score="1" ViewCount="44" Body="&lt;p&gt;I relatively new to financial mathematics but I am wondering if at all there exists a relationship between credit utilization (the rate at which the public accesses credit from financial institutions) and stock market growth (credit utilization influence on the stock market) of an economy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please I need advice on these questions: &#xA;If there is a relationship, how can I best model this situation. If no, what would be the reasons for this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much&lt;/p&gt;&#xA;" OwnerUserId="15726" LastActivityDate="2015-09-04T08:40:48.000" Title="Modeling credit utilization and stock market growth" Tags="&lt;modeling&gt;&lt;credit&gt;&lt;credit-ratings&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20615" PostTypeId="2" ParentId="20614" CreationDate="2015-09-04T08:26:18.897" Score="2" Body="&lt;p&gt;&lt;strong&gt;Yes of course&lt;/strong&gt;, credit rates depend on interest rates (i.e. &lt;a href=&quot;https://en.wikipedia.org/wiki/Libor&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Libor&lt;/a&gt;), which are set by some group of banks in almost every country &lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Going further bankers analyze the market situation and also national interest rates, which are set by central bankers in every country which has a central bank (&lt;a href=&quot;https://en.wikipedia.org/wiki/Central_bank&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Central_bank&lt;/a&gt;). They must do it because they usually borrow money from the general national system. &lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly, central bankers need to analyze the economy, money fluctuations, inflation and adjust the money supply (through national interest rates) in a way which maximize output (GDP growth in most cases) in the long term. They also tend to realize some short term goals (like Quantitative Easing in the primary form). In many models which are developed by central bankers a stock market is also taken as an indicator, often considered as an economy anticipating indicator.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example. Last statistics show that there is a low inflation(below the goal written in the country's constitution). The stock market is falling because the economy needs money for the current operations (paying the invoices, salaries etc.). The central bank decides to lower the interest rates which give the commercial bank's an opportunity to earn more or also to lower their interest rates and compete for the clients. That leads to cheaper credits (lower installments) and the credit availability increases for institutional and individual clients.  &lt;br&gt;&lt;/p&gt;&#xA;" OwnerUserId="5745" LastEditorUserId="5745" LastEditDate="2015-09-04T08:40:48.000" LastActivityDate="2015-09-04T08:40:48.000" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20616" PostTypeId="2" ParentId="19614" CreationDate="2015-09-04T08:35:44.277" Score="1" Body="&lt;p&gt;The answer is relatively straightforward if you assume that $x$ is normally distributed - $x \sim N(\mu_x,\sigma^2_x)$. If $x$ is normally distributed then maximizing $U(x)=−e^{ax}$ is the same as maximizing a mean variance utility: $U = E(W) - 0.5a Var(W)$ . &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now given that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E(W) = s\mu_x + (W-s)  $ where $s$ is the amount of money on the risky stock and $W-s$ is the amount not invested - this assumes a risk-free rate of zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Var(W) = s^2 \sigma^2_x$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take first order conditions to:&#xA;$U = s\mu_x + (W-s) - 0.5a s^2 \sigma^2_x$  and get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mu_x - a s \sigma^2_x = 0 $. So : $s = \frac{\mu_x}{a\sigma^2_x}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which does not depend on the initial wealth q.e.d. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&#xA;&lt;strong&gt;Following the comment below let's show it without assuming normality:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Denoting the amount invested on the risky asset by $\theta$ and the initial level of wealth by $W$, the agent's expected utility is:&#xA;$U = \int \exp(-a[(W-\theta)Rf + \theta x])f(x)dx = \int \exp(-aWRf) \exp[-a\theta(x-Rf)]f(x)dx = \exp[-aWR_f]\int \exp[-a\theta(x-R_f)]f(x)dx$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the solution to the problem is independent of initial wealth (just take f.o.c. on equation above and note that $W$ does not show up).&lt;/p&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="16472" LastEditDate="2015-09-04T09:26:47.410" LastActivityDate="2015-09-04T09:26:47.410" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20617" PostTypeId="1" CreationDate="2015-09-04T11:17:17.777" Score="1" ViewCount="111" Body="&lt;p&gt;So this ratio has come up in some work I'm doing and I can't seem to figure out if it is attested in the literature.  Here's the setting:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given a risk free rate $r(t)$ and a stock price which follows a geometric brownian motion, $\frac{dS(t)}{S(t)} = \mu_S(t)dt + \sigma_S(t)dW(t)$, what is the significance/definition/terminology for the ratio of expected growth in stock prices to the risk free rate, $\frac{\mu_S(t)}{r(t)}$?  This is more of a question regarding vocabulary/interpretation, so any ideas would be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="17436" LastActivityDate="2015-09-04T11:54:50.973" Title="What is this ratio: expected returns on stock divided by risk free rate?" Tags="&lt;interest-rates&gt;&lt;brownian-motion&gt;&lt;continuous-time&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20618" PostTypeId="1" AcceptedAnswerId="20619" CreationDate="2015-09-04T11:35:39.307" Score="3" ViewCount="1584" Body="&lt;p&gt;If $P$ is price, $D$ modified duration and $y$ yield then we have the relationship,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dP=-D \cdot P \cdot dy$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is there a minus sign and what does correspond to?&lt;/p&gt;&#xA;" OwnerUserId="11723" LastActivityDate="2015-09-04T11:42:19.287" Title="Why the negative sign in modified duration relationship" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;duration&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20619" PostTypeId="2" ParentId="20618" CreationDate="2015-09-04T11:42:19.287" Score="2" Body="&lt;p&gt;The price-yield relationship is negatively correlated; when prices go down, the implied yield goes up. The minus sign allows the modified duration to be positive for a normal bond.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2015-09-04T11:42:19.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20620" PostTypeId="2" ParentId="20617" CreationDate="2015-09-04T11:54:50.973" Score="2" Body="&lt;p&gt;Maybe it makes sense to refer to &lt;a href=&quot;https://en.wikipedia.org/wiki/Capital_asset_pricing_model&quot; rel=&quot;nofollow&quot;&gt;CAPM theory&lt;/a&gt;: it is expected that stock return is proportional to market excess return and it beta&#xA;$$ \mu_S(t) = r(t) + \beta_S\cdot(r_m(t)-r(t)).$$ Where $r_m(t)$ is market expected return and $\beta_S$ is stock beta. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus according to CAPM it's expected that $\frac{\mu_S(t)}{r(t)} = 1+\beta_S\cdot(\frac{r_m(t)}{r(t)}-1).$&lt;/p&gt;&#xA;" OwnerUserId="16805" LastActivityDate="2015-09-04T11:54:50.973" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20621" PostTypeId="1" AcceptedAnswerId="20624" CreationDate="2015-09-04T13:03:00.980" Score="3" ViewCount="1653" Body="&lt;p&gt;I'm trying to understand how QuantLib creates (bootstraps) a yield curve from a vanilla swap at the &lt;strong&gt;source level&lt;/strong&gt;. I have the following test code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;void testYieldFromIRSwap()&#xA;{&#xA;Settings::instance().evaluationDate() = Date(1, Jan, 2015);&#xA;&#xA;auto dc = Actual360();&#xA;&#xA;auto h1 = boost::shared_ptr&amp;lt;RateHelper&amp;gt;(new DepositRateHelper&#xA;                                               (0.03, Period(1, Years), 0.0, UnitedStates(), Following, false, Actual360()));&#xA;auto h2 = boost::shared_ptr&amp;lt;RateHelper&amp;gt;(new DepositRateHelper&#xA;                                               (0.04, Period(2, Years), 0.0, UnitedStates(), Following, false, Actual360()));&#xA;&#xA;auto index = boost::shared_ptr&amp;lt;IborIndex&amp;gt;(new EURLibor1Y());&#xA;auto h3 = boost::shared_ptr&amp;lt;RateHelper&amp;gt;(&#xA;                new SwapRateHelper(0.05, Period(3, Years), UnitedStates(), Annual,&#xA;                                   Following, Actual360(), index));&#xA;&#xA;std::vector&amp;lt;boost::shared_ptr&amp;lt;RateHelper&amp;gt;&amp;gt; helpers;&#xA;helpers.push_back(h1);&#xA;helpers.push_back(h2);&#xA;helpers.push_back(h3);&#xA;&#xA;boost::shared_ptr&amp;lt;YieldTermStructure&amp;gt; yield(&#xA;                new PiecewiseYieldCurve&amp;lt;Discount,LogLinear&amp;gt;(&#xA;                    Settings::instance().evaluationDate(), helpers,&#xA;                        Actual360()));&#xA;&#xA;const auto t1 = dc.yearFraction(Date(1, Jan, 2015), Date(1, Jan, 2016)); // 1.014&#xA;const auto t2 = dc.yearFraction(Date(1, Jan, 2015), Date(1, Jan, 2017)); // 2.031&#xA;const auto t3 = dc.yearFraction(Date(1, Jan, 2015), Date(1, Jan, 2018)); // 3.044&#xA;&#xA;std::cout &amp;lt;&amp;lt; yield-&amp;gt;discount(0)  &amp;lt;&amp;lt; std::endl; // Must be 1&#xA;std::cout &amp;lt;&amp;lt; yield-&amp;gt;discount(t1) &amp;lt;&amp;lt; std::endl; // 1/((1+0.03) ^ 1.014) = 0.9704721&#xA;std::cout &amp;lt;&amp;lt; yield-&amp;gt;discount(t2) &amp;lt;&amp;lt; std::endl; // 1/(1+0.04) ^ 2.031   = 0.9234328&#xA;std::cout &amp;lt;&amp;lt; yield-&amp;gt;discount(t3) &amp;lt;&amp;lt; std::endl;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is obviously a toy example. I have two deposits that gives the discount rates for the first two years. My swap is an annual 3y swap, I expect the swap gives me the discount rate for the the third year. I do get the value but I don't understand how it's computed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code for bootstrapping a discount factor from a swap is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Real SwapRateHelper::impliedQuote() const {&#xA;    QL_REQUIRE(termStructure_ != 0, &quot;term structure not set&quot;);&#xA;    // we didn't register as observers - force calculation&#xA;    swap_-&amp;gt;recalculate();&#xA;    // weak implementation... to be improved&#xA;    static const Spread basisPoint = 1.0e-4;&#xA;    Real floatingLegNPV = swap_-&amp;gt;floatingLegNPV();&#xA;    Spread spread = spread_.empty() ? 0.0 : spread_-&amp;gt;value();&#xA;    Real spreadNPV = swap_-&amp;gt;floatingLegBPS()/basisPoint*spread;&#xA;    Real totNPV = - (floatingLegNPV+spreadNPV);&#xA;    Real result = totNPV/(swap_-&amp;gt;fixedLegBPS()/basisPoint);&#xA;    return result;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Everytime when QuantLib guesses a new discount factor (i.e. iteratively bootstrapping), this function computes a new NPV for the floating leg. I'd expect this NPV be set to equal to the NPV for the fixed leg, from which a new swap rate can be computed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I don't understand is this &lt;strong&gt;particular line&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Real result = totNPV/(swap_-&amp;gt;fixedLegBPS()/basisPoint);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think BPS is the sum of accurate interest and is computed by:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bps += cp-&amp;gt;nominal() * cp-&amp;gt;accrualPeriod() * df;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why do we need to divide the new fixed-leg NPV by BPS and basisPoint? Why basisPoint is set to 1.0e-4 (1 basis point)? What's the point of doing it?&lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="601" LastEditDate="2015-09-05T12:08:42.183" LastActivityDate="2015-09-05T12:08:42.183" Title="Why QuantLib computes the fixed-leg swap rate by this formula?" Tags="&lt;pricing&gt;&lt;yield-curve&gt;&lt;swaps&gt;&lt;quantlib&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20622" PostTypeId="2" ParentId="19588" CreationDate="2015-09-04T13:20:08.033" Score="5" Body="&lt;p&gt;Sharpe's 1966 equation had $R_b$ defined as the risk free rate. Looks like that was revised in 1994 to the 'reference benchmark', making the formulas essentially equivalent. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we refer to the original definitions, then that is the primary difference - Sharpe's ratio looks at reward/risk of the excess return for an asset over the risk-free rate while the information ratio looks at the reward/risk of the excess return for an asset over some reference benchmark. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example: Sharpe Ratio could be used by someone developing a trading strategy who wants to study the average risk/reward profile over time (signal-to-noise) such that $R_b$ is set to the risk free rate, or even 0, while the Information Ratio could be used by a mutual fund manager whose job is to beat the S&amp;amp;P 500, thus $R_b$ could be the expected index return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The mechanics of the two formulas are the same, e.g. there really isn't a difference especially since Sharpe has updated his formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;From Wiki: &lt;a href=&quot;https://en.wikipedia.org/wiki/Information_ratio&quot; rel=&quot;noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Information_ratio&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&quot;The information ratio is similar to the Sharpe ratio but, whereas the Sharpe ratio is the 'excess' return of an asset over the return of a risk free asset divided by the variability or standard deviation of returns, the information ratio is the 'active' return to the most relevant benchmark index divided by the standard deviation of the 'active' return or tracking error.&quot;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Sharpe_ratio&quot; rel=&quot;noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Sharpe_ratio&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&quot;This is often confused with the information ratio, in part because the newer definition of the Sharpe ratio matches the definition of information ratio within the field of finance. Outside of this field, information ratio is simply mean over the standard deviation of a series of measurements.&quot;&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="7889" LastActivityDate="2015-09-04T13:20:08.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20623" PostTypeId="2" ParentId="20621" CreationDate="2015-09-04T15:00:50.460" Score="0" Body="&lt;p&gt;it seems the method &lt;strong&gt;fixedLegBPS()&lt;/strong&gt; returns the sum of the discount factors associated to the fixed leg multiplied by 1 basisPoint. So what &lt;strong&gt;SwapRateHelper::impliedQuote()&lt;/strong&gt; returns is actually the new fair rate of the swap to be used in the minimization algorithm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried to find the implementation of the calculate() method from class &lt;strong&gt;VanillaSwap::engine&lt;/strong&gt; (VanillaSwap.recalculate() calls calculate() which calls its engine calculate() method ) but I haven't been successful. I think you can find confirmation of the behavior of the method &lt;strong&gt;fixedLegBPS()&lt;/strong&gt; there since it calls calculate() and then returns legBPS_[0].&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope it helps. (and let me know where this implementation is if you find it)&lt;/p&gt;&#xA;" OwnerUserId="17408" LastActivityDate="2015-09-04T15:00:50.460" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20624" PostTypeId="2" ParentId="20621" CreationDate="2015-09-04T15:39:09.053" Score="6" Body="&lt;p&gt;&lt;code&gt;fixedLegBPS&lt;/code&gt; is the basis-point sensitivity of the fixed leg, that is, how much its NPV changes when the fixed rate changes by one basis point: it's calculated as the NPV corresponding to a fixed rate of 1 bps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the NPV of the fixed leg is linearly proportional to the fixed rate, you can write the equation&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;targetNPV : fixedRate = BPS : 1 basis point&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The line you highlight simply solves it for the fixed rate.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2015-09-04T15:39:09.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20625" PostTypeId="1" CreationDate="2015-09-04T16:58:40.357" Score="30" ViewCount="17846" Body="&lt;p&gt;We would like to store financial tick data in a database (potentially billions of rows) and then create aggregated (open-high-low-close) bar data from it (e.g. 1min or 5min bars). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It was mentioned to us that a NoSQL or time series database might be a good choice for this. Can anybody give any advice on which open source product might fit this requirement best. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: query performance is very important for us.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In our research we came across the following products (maybe there are more):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.influxdata.com/&quot; rel=&quot;noreferrer&quot;&gt;InfluxDB&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://opentsdb.net/&quot; rel=&quot;noreferrer&quot;&gt;OpenTSDB&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://kairosdb.github.io/&quot; rel=&quot;noreferrer&quot;&gt;KairosDB&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.monetdb.org/Home&quot; rel=&quot;noreferrer&quot;&gt;MonnetDB&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;We did run a test with InfluxDB with around 10 million ticks. Unfortunately the creation of 1min bars was 3-5 slower than with a relation database (i.e. MySQL).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We are aware that KDB now offers a free 32-bit version, but unfortunately 32-bit will not be enough for our use case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any advice is appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT (Sept 2015): We also did a test with OpenTSDB which seems to be quite fast. The import of 10 mio. prices took about one minute and the aggregation into 1 Min Bars took about 5 seconds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT (Jan 2017): More than one year after the initial test we gave InfluxDB another try and it turns out that they have made huge progress in the meantime. Write performance is now up to 2 mio. data points per second (with version 1.2)! We have now decided to integrate InfluxDB into our own product &lt;a href=&quot;http://www.algotrader.com/algotrader-3-1-integrates-influxdb/&quot; rel=&quot;noreferrer&quot;&gt;AlgoTrader&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5530" LastEditorUserId="5530" LastEditDate="2017-01-29T12:10:14.323" LastActivityDate="2021-01-20T18:40:17.433" Title="Performance of Open Source Time Series Database for Financial Market Data" Tags="&lt;time-series&gt;&lt;database&gt;" AnswerCount="4" CommentCount="3" FavoriteCount="19" ContentLicense="CC BY-SA 3.0" />
  <row Id="20626" PostTypeId="1" AcceptedAnswerId="20632" CreationDate="2015-09-04T19:27:56.150" Score="4" ViewCount="4352" Body="&lt;p&gt;Can someone please give me an explanation as to what put-call gamma imbalance specifically refers to (imbalance of what?), and why they may exacerbate volatility from a market perspective, and why the risk increases on option expiry day? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My guess is it that these imbalances force option sellers/dealers to more aggressively delta-hedge their positions, but I would like to have a better grasp on what is really going on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some confustion is coming from the fact that I thought put and call gamma must be equal else put/call parity would be violated based on put delta + call delta = 1 for a given option strike.   &lt;/p&gt;&#xA;" OwnerUserId="7889" LastActivityDate="2019-06-12T19:40:10.307" Title="Gamma Imbalance Explanation" Tags="&lt;options&gt;&lt;greeks&gt;&lt;gamma&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20627" PostTypeId="1" CreationDate="2015-09-04T20:18:44.923" Score="1" ViewCount="417" Body="&lt;p&gt;I want to calculate the VaR of two correlated option positions, and I know the correlation between stock price returns. I want to separately calculate $Var_1$,$Var_2$ for option 1 and 2, and then use $$\sqrt{(w_1var1)^2+(w_2var2)^2+2*corr*w_1*w_2*var_1*var_2}$$  to calculate the portfolio var, but I don't know if the option correlation is the same with its underlying stock returns correlation?&lt;/p&gt;&#xA;" OwnerUserId="13627" LastActivityDate="2015-09-05T00:41:10.320" Title="What is the correlation of stock options?" Tags="&lt;options&gt;&lt;correlation&gt;&lt;var&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20628" PostTypeId="1" AcceptedAnswerId="20629" CreationDate="2015-09-04T21:34:21.933" Score="2" ViewCount="1720" Body="&lt;p&gt;I have a question on an exercise from chapter 9 of D. Luenberger, Investment Science, International Edition, where I suspect there may be a typo.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Exercise 8 (Certainty approximation)&lt;/p&gt;&#xA;&lt;p&gt;There is a useful approximation to the certainty equivalent  that is easy to derive. A second-order expansion near &lt;span class=&quot;math-container&quot;&gt;$\bar x=E(x)$&lt;/span&gt; gives &lt;span class=&quot;math-container&quot;&gt;$$U(x)\approx U(\bar x)+U^{'}(\bar x)(x-\bar x)+\frac12U^{''}(\bar x)(x-\bar x)^2$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Hence, &lt;span class=&quot;math-container&quot;&gt;$$E[U(x)]\approx U(\bar x)+\frac 12 U^{''}(\bar x)var(x)$$&lt;/span&gt;&#xA;On the other hand, if we let c denote the certainty equivalent and assume it is close to &lt;span class=&quot;math-container&quot;&gt;$\bar x$&lt;/span&gt;, we can use the first-order expansion &lt;span class=&quot;math-container&quot;&gt;$$U(c)\approx U(\bar x)+U^{'}(\bar x)(c-\bar x)$$&lt;/span&gt;&#xA;Using these approximations, show that &lt;span class=&quot;math-container&quot;&gt;$$c \approx \bar x+{U^{''}(\bar x) \over U^{'}(\bar x)}var(x)$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Now, I used general methods of algebra along with the fact that &lt;span class=&quot;math-container&quot;&gt;$E[U(x)] = U(c)$&lt;/span&gt; to show directly that &lt;span class=&quot;math-container&quot;&gt;$$c \approx \bar x+\frac 12 ({U^{''}(\bar x) \over U^{'}(\bar x)})var(x)$$&lt;/span&gt; as follows:&lt;/p&gt;&#xA;&lt;p&gt;Take the third equation and transform it into &lt;span class=&quot;math-container&quot;&gt;$$ c\approx \bar x + {U(c)-U(\bar x) \over U^{'}(\bar x)}$$&lt;/span&gt;&#xA;Now all I have to do is show that the numerator in the fraction part is &lt;span class=&quot;math-container&quot;&gt;$\frac 12 U^{''}(\bar x)var(x)$&lt;/span&gt; which is done by putting &lt;span class=&quot;math-container&quot;&gt;$E[U(x)] = U(c)$&lt;/span&gt; into the second formula and you can see the result is immediately there.&lt;/p&gt;&#xA;&lt;p&gt;On top of this work, I wrote out an example of an investment with the log utility function and showed that my approximation for c worked whereas the book's formula without the &amp;quot;2&amp;quot; didn't.&lt;/p&gt;&#xA;&lt;p&gt;However, I would like to post all this here just to verify that this is a typo from the book and not some misunderstanding on my part.&lt;/p&gt;&#xA;&lt;p&gt;Thanks in advance for any feedback.&lt;/p&gt;&#xA;" OwnerUserId="17430" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2015-09-04T22:10:52.833" Title="Utility Theory - Certainty equivalent approximation formula derivation" Tags="&lt;utility-theory&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20629" PostTypeId="2" ParentId="20628" CreationDate="2015-09-04T22:10:52.833" Score="2" Body="&lt;p&gt;Your calculation seems to be correct. I found this document here:&lt;a href=&quot;http://home.uchicago.edu/rmyerson/teaching/util206.pdf&quot; rel=&quot;nofollow&quot;&gt;http://home.uchicago.edu/rmyerson/teaching/util206.pdf&lt;/a&gt;. You can see that in P10, the certainty equivalence formula has that 1/2 factor there.&lt;/p&gt;&#xA;" OwnerUserId="6804" LastActivityDate="2015-09-04T22:10:52.833" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20630" PostTypeId="2" ParentId="19245" CreationDate="2015-09-04T23:09:54.310" Score="3" Body="&lt;p&gt;This is not a valid statement.  Most obvious reason is that this situation would provide an arbitrage opportunity for those that take the 30 seconds to check open interest :-)  But more specifically for every call that is in the money there is a person (firm, hedge fund . . you pick) that is short the call and another person (etc) that is long it.  Simply put, the long will exercise, lose the value of the option but get the stock for the strike price . . .a net wash (assuming it is exercised at expiry and no time premium is foolishly thrown away).  The short option holder gets to keep the option premium but will have to deliver shares to the long call holder at a price below market value . . .again, a theoretical scratch.  Another interesting point.  Much of the open interest in options is tied up by market makers and hedge-funds that may in fact have a net 0 holding of calls.  For example, 2 traders a&amp;amp;b.  Stock trading 100, trader a long 100,000 of the 70 calls and short 100,000 of the 75 call (note the massive 200k open interest on the in the money call side representing 20 million share equivalent).  Trader B has the exact opposite position.  With expiration just days away both options are trading at parity and both trader a and trader b will have no shares to buy or cell as, for example, trader a will exercise his 100,000 70 calls and trader b will exercise his 100,000 75 calls with the net effect that each trader exercises or is assigned on all of their options with a net share transfer of zero.  Hardly the making of a volatile situation in either direction&lt;/p&gt;&#xA;&#xA;&lt;p&gt;hope this helps&lt;/p&gt;&#xA;&#xA;&lt;p&gt;John&lt;/p&gt;&#xA;" OwnerUserId="17441" LastActivityDate="2015-09-04T23:09:54.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20631" PostTypeId="2" ParentId="19570" CreationDate="2015-09-04T23:23:40.007" Score="0" Body="&lt;p&gt;I am not sure of the cost involved or if they have a minimum fee to partner with, but MARKIT (&lt;a href=&quot;https://www.markit.com/Product/All&quot; rel=&quot;nofollow&quot;&gt;https://www.markit.com/Product/All&lt;/a&gt;) has a pretty wide offering.  I was at a large investment bank for years and they provided much of the index composition data we used&lt;/p&gt;&#xA;" OwnerUserId="17441" LastActivityDate="2015-09-04T23:23:40.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20632" PostTypeId="2" ParentId="20626" CreationDate="2015-09-04T23:50:07.907" Score="0" Body="&lt;p&gt;I do not think the term put-call gamma imbalance refers to the imbalance between &quot;a put&quot; and &quot;a call&quot; at the same strike. . .so put call parity lives on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the exacerbated volatility, my experience has shown that there is pressure to &quot;pin&quot; at a strike which would decrease volatility near expiry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;scenario: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Strike = 100&#xA;Stock =100&#xA;expiry in 10 minutes&#xA;all else equal&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Those traders long the 100 straddle will scalp their gamma aggressively in the final moments.  As the stock trades below 100, the 100 straddle will generate short stock for the long holder.  The long option holder buys stock as it drops and sells it as it rallies butting pressure on the stock to stay at 100.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The short option holder locks in losses every time he hedges so is more incline to not take such energetic hedging action as that of the longs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if the market makes a surprise move of substance. . .all bets are off, there may exist a very large delta imbalance (short option holders) and they might be forced (pain of large loses changes everything) to sell their long deltas on the downside or buy in their short delta on the upside.  In either case this will increase volatility . . .until the next trike is reached and the &quot;pinning&quot; battle can begin again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;this article gives a better explanation than mine :-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://realmoney.thestreet.com/articles/12/15/2011/how-options-expiration-affects-stock-prices&quot; rel=&quot;nofollow&quot;&gt;http://realmoney.thestreet.com/articles/12/15/2011/how-options-expiration-affects-stock-prices&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17441" LastActivityDate="2015-09-04T23:50:07.907" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20633" PostTypeId="2" ParentId="19570" CreationDate="2015-09-05T00:20:45.953" Score="4" Body="&lt;p&gt;I dont know of any provider that fulfills your whole requirements, but perhaps I can give you some useful information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;General thoughts&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Some vendors (e.g. MSCI) can have statements in their license agreements that prohibit an entity from storing historical data older than e.g. 3 years. This could be one obstacle in finding a supplier who has full 10 year coverage of all required vendors and indexes. Historical data would probably need to be requested separately which would induce extra cost.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The licensing agreements are a big issue here. You would probably need a license for &lt;em&gt;derived data&lt;/em&gt; as you use the data in your decision making algorithms. The company that provides the data to you would either need a &lt;em&gt;distribution license&lt;/em&gt; or a custom agreement with the vendor for your company and your specific data.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Some vendors might not issue license agreements on fractals of theirs &lt;em&gt;portfolio&lt;/em&gt;. It is possible that you have to pay for full packages.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.rimes.com/&quot; rel=&quot;nofollow&quot;&gt;Rimes&lt;/a&gt; offers index and constituent data from different providers in a format that you can discuss with them (e.g. CSV).&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;As far as I know, you need to provide them with a license up-front as well, so this solution would probably not ease the burden of license agreements. I however can't guarantee this - you would have to contact them to be sure.&lt;/li&gt;&#xA;&lt;li&gt;You would have to pay separately for every index - constituents are not included, but you could buy them for an extra fee. As you said that you need a large number of indexes, the cost could become very high. You would need to find the break-even point between this approach and &lt;em&gt;bulk&lt;/em&gt; licensing.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Transparency: I work for this company - not in the sales department&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://investmentdataservices.info/en/&quot; rel=&quot;nofollow&quot;&gt;InvestmentDataServices&lt;/a&gt; could offer you a unified way to retrieve the data that you need.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Customized processing logic could be added to your data exports e.g. forward filling, reports on missing values etc. This could however involve extra development cost - depending on your specification.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Maybe it is possible that you can outsource your license negotiations here. At the moment there is no such offering as far as I know, but they are very flexible when it comes to customer requirements.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I am quite sure that both vendors could at least provide you with loads of index data from different providers and custom tailored data files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But you need to get in contact with them to discuss your requirement and to get a cost estimation to see if it pays off.&lt;/p&gt;&#xA;" OwnerUserId="17442" LastEditorUserId="17442" LastEditDate="2015-09-05T00:38:01.860" LastActivityDate="2015-09-05T00:38:01.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20634" PostTypeId="2" ParentId="20627" CreationDate="2015-09-05T00:25:17.640" Score="2" Body="&lt;p&gt;I do not think that the correlation for stock1 and stock2 equals the correlation for option1 and option2. For example, assume stock1 and stock2 are perfectly correlated. Now assume option1 is a deep in the money call on stock1, assume option2 is a deep in the money put on stock2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now stock1 goes up. Since correlation is perfect stock2 goes up.&#xA;Option1 is deep in the money call and therefore also goes up with a delta close to 1. However, Option2 is a put. Since stock2 went up as well, Option2 will drop in value. As you see the sign flipped on the correlation. So from this example I would think you can not use the stock correlation directly for your options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like you want to calculate the Value at Risk using a normal variance/covariance approach. I think most text books will say that this method is not the best when dealing with non linear products. I would advise on using a different approach (maybe historical sim).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See link for description of other available methods.&#xA;&lt;a href=&quot;https://web.stanford.edu/class/msande444/2012/MS&amp;amp;E444_2012_Group2a.pdf&quot; rel=&quot;nofollow&quot;&gt;https://web.stanford.edu/class/msande444/2012/MS&amp;amp;E444_2012_Group2a.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Btw, if you insist on using the variance/covariance method. I guess you could always use only a delta approximation. Then you simply take the delta of option1 and the delta of option2. This approx your option position as if were just positions in the underlying. With the deltas as weights. My example with the put and the call would give that you have delta of 1 in stock1 and a delta of -1 for stock2. So you d be long stock1 and short stock2. &lt;/p&gt;&#xA;" OwnerUserId="17316" LastEditorUserId="17316" LastEditDate="2015-09-05T00:41:10.320" LastActivityDate="2015-09-05T00:41:10.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20635" PostTypeId="1" CreationDate="2015-09-05T05:07:49.910" Score="2" ViewCount="32" Body="&lt;p&gt;There are many securities and exchanges on platforms like Bloomberg and Quandl, but many securities are described with the relevant pit close times and pit open times, exchanges, related futures, and settlement procedures. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a reliable source where people go to find these things out? Kind of like a one stop shop. &lt;/p&gt;&#xA;" OwnerUserId="6766" LastActivityDate="2015-09-05T06:41:15.080" Title="Source of market or security attribute information?" Tags="&lt;futures&gt;&lt;bloomberg&gt;&lt;exchange&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20636" PostTypeId="2" ParentId="20625" CreationDate="2015-09-05T06:38:47.757" Score="14" Body="&lt;p&gt;You could try &lt;a href=&quot;https://github.com/manahl/arctic&quot;&gt;Arctic&lt;/a&gt;. Other open source column-oriented databases that you may not have considered include LucidDB and C-Store.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="4660" LastEditDate="2015-09-05T20:54:14.250" LastActivityDate="2015-09-05T20:54:14.250" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20637" PostTypeId="2" ParentId="20635" CreationDate="2015-09-05T06:41:15.080" Score="1" Body="&lt;p&gt;People often use Compustat or FactSet for high-level data like that.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2015-09-05T06:41:15.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20638" PostTypeId="2" ParentId="16798" CreationDate="2015-09-05T12:21:23.593" Score="1" Body="&lt;p&gt;&quot;Dominating at zero&quot; is what it sounds like:  It means that the value of the portfolio has a &gt;0 value when the spot price (and α) is at 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if α = 0 then β must be a positive (non zero) value in order to &quot;dominate&quot; or be &gt;= 0.&lt;/p&gt;&#xA;" OwnerUserId="17446" LastActivityDate="2015-09-05T12:21:23.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20640" PostTypeId="2" ParentId="4237" CreationDate="2015-09-05T15:50:11.003" Score="1" Body="&lt;p&gt;As John mentioned, there are limits to short-term trading or portfolio composition data. However, there are a couple of relevant studies which feature intraday data that I transcribed from this pretty old &lt;a href=&quot;https://www.imf.org/external/pubs/ft/wp/2000/wp0048.pdf&quot; rel=&quot;nofollow&quot;&gt;IMF white paper&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.jstor.org/stable/4479855&quot; rel=&quot;nofollow&quot;&gt;Christie and Huang (1995)&lt;/a&gt; studied returns of US stock equities, finding that (controlling for clustering of correlated assets) dispersion on daily and monthly returns is higher at times of large stock movements. However, it's a pretty weak measure of &quot;herding&quot; because it's asset-specific, and overlooks assets of the same individual class/geographical region.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kodres and Pritsker (1996) analysed public disclosures of intraday commodities trading data from the CFTC (i.e. only large participants), ran correlations/probit to see how likely participants will make the same trades when others are doing the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These studies seem to be very vanilla reg methods. I feel that the amount of &quot;herding&quot; is so market-specific and limited by paucity of data that I wouldn't dare generalise; I strongly suspect, however, that traders using technical analysis are implicitly trying to predict herding behaviors. &lt;/p&gt;&#xA;" OwnerUserId="17451" LastActivityDate="2015-09-05T15:50:11.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20641" PostTypeId="1" CreationDate="2015-09-05T20:27:54.627" Score="6" ViewCount="8859" Body="&lt;p&gt;(source John Hull, Options Futures and Other Derivatives 8th edition)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't follow why Hull calculates Credit VaR in the following manner. I thought CVaR was Unexpected Loss$_{confidence}$ - Expected Loss.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hull calculates the 1 year 99.9% worst case default rate as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V(confidence,T) = N(\frac{N^{-1}(PD)+(\sqrt{p}) N^{-1}(confidence)}{\sqrt{p}})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CVaR = portfolio value * $V(confidence, T)$ * Loss Given Default&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(in the given example, he get correlation (P) via a Guassian copula)&lt;/p&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="9265" LastEditDate="2015-09-05T21:06:18.280" LastActivityDate="2019-12-25T17:02:20.530" Title="How to calculate Credit VaR?" Tags="&lt;var&gt;&lt;credit-risk&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20642" PostTypeId="1" CreationDate="2015-09-05T20:29:44.333" Score="1" ViewCount="777" Body="&lt;p&gt;Where do I get original fundamental accounting data from income statement, balance sheet and cash flow statement, like Sales/Revenue, Gross Income, EBIT, Operating Income, Cash &amp;amp; Short Term Investments,  Total Accounts Receivable, Inventories, Cash Flows From Operations, Cash Flows From Investing, Cash Flow from Financing, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally downloadable by an R Interface.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[edit]&#xA;Something very important, I have forgotten. I also need the publishing date of the accounting data (which is different from the reporting as of date!), because I want to run a predictive statistical model on it (will otherwise produce an error of future input data). Maybe I have to source the publishing date from another website, in case I cannot get everything out of one hand, maybe also by webscraping from HTML.&#xA;[/edit] &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance&#xA;Consuli&lt;/p&gt;&#xA;" OwnerUserId="17376" LastEditorUserId="17376" LastEditDate="2015-09-05T23:48:21.633" LastActivityDate="2016-09-02T10:17:53.103" Title="Original Fundamental Accounting Data (Not Ratios)" Tags="&lt;data&gt;&lt;r&gt;&lt;fundamentals&gt;&lt;accounting&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20643" PostTypeId="1" AcceptedAnswerId="20645" CreationDate="2015-09-05T21:03:08.253" Score="3" ViewCount="6611" Body="&lt;p&gt;I have downloaded historical data for FTSE from 1984 to now. What I would like to do is to &lt;strong&gt;graph volatility as a function of time&lt;/strong&gt;. What I have written is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import matplotlib.pyplot as plt&#xA;import datetime as dt&#xA;import numpy as np&#xA;import math&#xA;&#xA;lines = [line.rstrip('\n') for line in open(&quot;Data.txt&quot;)]&#xA;a = list(range(len(lines)))&#xA;adjClose = [float(i) for i in lines]&#xA;adjClose.reverse()&#xA;dates = [line.rstrip('\n') for line in open(&quot;Date.txt&quot;)]&#xA;dates.reverse()&#xA;x = [dt.datetime.strptime(d,'%Y-%m-%d').date() for d in dates]&#xA;dailyVolatility = np.std(np.diff(np.log(adjClose))).round(4)&#xA;&#xA;# Calculate returns&#xA;returns = []&#xA;for i in range(len(adjClose[1:])):&#xA;    element = adjClose[i]/adjClose[i-1]&#xA;    element = math.log(element)&#xA;    returns.append((element))&#xA;returns = returns[1:]&#xA;&#xA;mean_returns = np.mean(returns)&#xA;vol = []&#xA;for i in range(len(returns)):&#xA;    element = (returns[i]-mean_returns)**2&#xA;    element=math.sqrt((element))&#xA;    vol.append(element)&#xA;for i in range(len(vol)):&#xA;    vol[i]*=math.sqrt(252)&#xA;x = x[2:]&#xA;plt.plot(x,vol)&#xA;plt.show()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I first load the data and then calculate the log returns and also take the average; moreover, I calculate the standard deviation for every &lt;strong&gt;pair of numbers in my log returns&lt;/strong&gt;. Is my reasoning correct? In this case I haven't averaged at all for the standard deviation formula, since N-1 = 2-1=1.&lt;/p&gt;&#xA;" OwnerUserId="17453" LastEditorUserId="11678" LastEditDate="2015-09-09T18:25:31.487" LastActivityDate="2015-09-09T18:25:31.487" Title="Calculate and plot historical volatility with Python" Tags="&lt;volatility&gt;&lt;data&gt;&lt;python&gt;&lt;historical&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20644" PostTypeId="2" ParentId="20642" CreationDate="2015-09-05T22:17:29.273" Score="1" Body="&lt;p&gt;You can pull Financial Statement (Income Statement, Balance Sheet, and Statement of Cash Flows) data from Google Finance with the &lt;code&gt;getFinancials&lt;/code&gt; function in the &lt;code&gt;quantmod&lt;/code&gt; R package.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; library(quantmod) &#xA;&amp;gt; getFinancials('IBM')&#xA;&amp;gt; head(viewFin(IBM.f, type = 'IS'))&#xA;Annual Income Statement for IBM&#xA;                                       2014-12-31 2013-12-31 2012-12-31&#xA;Revenue                                     92793      98367     102874&#xA;Other Revenue, Total                           NA         NA         NA&#xA;Total Revenue                               92793      98367     102874&#xA;Cost of Revenue, Total                      46386      49683      52513&#xA;Gross Profit                                46407      48684      50361&#xA;Selling/General/Admin. Expenses, Total      21385      22214      23463&#xA;                                       2011-12-31&#xA;Revenue                                    106916&#xA;Other Revenue, Total                           NA&#xA;Total Revenue                              106916&#xA;Cost of Revenue, Total                      56778&#xA;Gross Profit                                50138&#xA;Selling/General/Admin. Expenses, Total      22865&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From the quantmod documentation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;viewFinancials(x, type=c('BS','IS','CF'), period=c('A','Q'),&#xA;               subset = NULL)&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the type is for Balance Sheet, Income Statement, and Statement of Cash Flows, and period is Annual or Quarterly. &lt;/p&gt;&#xA;" OwnerUserId="17448" LastActivityDate="2015-09-05T22:17:29.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20645" PostTypeId="2" ParentId="20643" CreationDate="2015-09-05T23:06:31.833" Score="2" Body="&lt;p&gt;I don't have enough reputations points to comment, so I'll put this into an answer.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure what this means, &quot;standard deviation for every pair of numbers in my log returns.&quot; but it sounds like you are taking the standard deviation of two consecutive returns.  If that is the case, I would not do that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think you want &lt;a href=&quot;https://en.wikipedia.org/wiki/Realized_variance&quot; rel=&quot;nofollow&quot;&gt;&quot;realized variance&quot;&lt;/a&gt;.  This is just the sum of squared log returns.  You can then take the square root of this sum to get realized volatility.  If you sum over a week or month, you get the realized volatility over that week or month.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the Wikipedia article for the nice mathematical properties of realized variance.&lt;/p&gt;&#xA;" OwnerUserId="17448" LastActivityDate="2015-09-05T23:06:31.833" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20648" PostTypeId="1" CreationDate="2015-09-06T14:45:21.567" Score="3" ViewCount="342" Body="&lt;p&gt;I would like to ask help concerning the utilization of GARCH(p,q) models to identify volatility. Suppose that I have daily closing prices of 6 financial sectors spanning several years, and I am interested in identifying which sector is the most and the least volatile (in terms of return). I have modeled their volatility using GARCH(p,q) and is now wondering how to use the estimated model to identify their volatility. Can I do the comparison by simply comparing the orders (perhaps, p) of their models? Or the coefficients? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. I have a computation of historical volatility and am planning to supplement my findings with fitted GARCH(p,q) models. Can I do this?&lt;/p&gt;&#xA;" OwnerUserId="17460" LastEditorUserId="467" LastEditDate="2015-09-07T05:22:49.063" LastActivityDate="2015-09-07T09:08:52.743" Title="How to user GARCH(p,q) to identify most volatile sector?" Tags="&lt;volatility&gt;&lt;finance&gt;&lt;garch&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20649" PostTypeId="1" CreationDate="2015-09-06T15:14:25.137" Score="2" ViewCount="1406" Body="&lt;p&gt;I want to read financial statements in XBRL Format from the SEC site automatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance the 10-Q File from Apple:&#xA;&lt;a href=&quot;http://www.sec.gov/Archives/edgar/data/320193/000119312515259935/aapl-20150627.xml&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.sec.gov/Archives/edgar/data/320193/000119312515259935/aapl-20150627.xml&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For conversion of the XBRL data I want to use the R package XBRL.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Are the names of document and its web-address at SEC standardized, so that I can download the files automatically in a job? Or do I still have to look up the webadress in the full index (see &lt;a href=&quot;https://quant.stackexchange.com/questions/3312/automated-10-k-xbrl-data-grab-using-the-sec-file-structure&quot;&gt;Automated 10-K XBRL data grab using the SEC file structure&lt;/a&gt; )?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is the XBRL tag in conjunction with 10-Q /10-K requirements in that way standardized, that I can expect standardized tags? Especially that NOT the first firm tags &quot;Cost of Goods Sold&quot;, the next company &quot;COGS&quot; and the third company &quot;Cost of Revenue&quot;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is the time period of 10-Q files standardized 3 month?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Which proportion of the 10-Q and 10-K are files available in XBRL format (approximate percentage)?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is there something like a XBRL definition available somewhere? When applying &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;inst &amp;lt;- &quot;&lt;a href=&quot;http://www.sec.gov/Archives/edgar/data/320193/000119312515259935/aapl-20150627.xml&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.sec.gov/Archives/edgar/data/320193/000119312515259935/aapl-20150627.xml&lt;/a&gt;&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;aapl_10q= xbrlDoAll(inst, verbose=TRUE)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;str(aapl_10q)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;there appears so much weired data!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Jujo&lt;/p&gt;&#xA;" OwnerUserId="17434" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2018-12-27T21:05:31.783" Title="Automated Import of 10-Q and 10-K Statements in XBRL Format from SEC.gov" Tags="&lt;r&gt;&lt;fundamentals&gt;&lt;sec&gt;&lt;edgar&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20650" PostTypeId="2" ParentId="16679" CreationDate="2015-09-06T15:22:54.303" Score="1" Body="&lt;p&gt;you can just transform the payoff into a form that becomes a linear combination of the ordinary black scholes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$max(S(0), e^{-aT} S(T))$ = $S(0) + e^{-at}max(0, S(T) - S(0)e^{aT})$&#xA;this equals $S(0) + constant * max(0, S(T)- K)$ where $K = S(0)e^{aT}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The option you can value with regular black scholes, then just scale it etc.&lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2015-09-06T15:22:54.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20651" PostTypeId="2" ParentId="20648" CreationDate="2015-09-06T16:25:38.127" Score="1" Body="&lt;p&gt;In the very begining I advice you to model always linear effects in the time series (&lt;strong&gt;ARMA models&lt;/strong&gt;). Then you add a model which investigate ARCH effects (&lt;strong&gt;GARCH family&lt;/strong&gt;). &lt;br&gt;&#xA;When you have done the models estimation part It is advised to check if residuals of the models do not show any dependiencies ( close to normal distribution, independent).&lt;br&gt;&#xA;In another step you calculculate the volatility of your time series using the calculated models and you can calculate their statistics ( min, max, average volatility). You can also calculate forecasts of the volatilities and compare them. It is worth checking the plots and analize how often do we have volatility clustering in our time series. &lt;br&gt;&#xA;Analizing the parameters of the model can be problematic becase you can get different models for different time series and how will you measure and compare them objectively.&lt;/p&gt;&#xA;" OwnerUserId="5745" LastActivityDate="2015-09-06T16:25:38.127" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20652" PostTypeId="1" AcceptedAnswerId="20653" CreationDate="2015-09-06T17:33:44.383" Score="7" ViewCount="880" Body="&lt;p&gt;I have been studying methods of &lt;strong&gt;Technical Analysis&lt;/strong&gt; for several years and I am disappointed. I actually do not consider it useful. I have not met anyone who can constantly win in the market using these technics. &lt;br&gt;&#xA;Right now I am more lining towards &lt;strong&gt;methods derived from physics&lt;/strong&gt; and here comes my questions. Do you know some methods which can be considered as indicators for measuring market fluctuations and “the heat”? Is this approach worth investigating? &lt;/p&gt;&#xA;" OwnerUserId="17462" LastActivityDate="2015-09-07T11:20:07.860" Title="How to use physics models in Time Series Analysis and Forecasting." Tags="&lt;time-series&gt;&lt;forecasting&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20653" PostTypeId="2" ParentId="20652" CreationDate="2015-09-06T17:43:21.280" Score="5" Body="&lt;p&gt;I am not a physicist, but I thought about some approaches based on&#xA;physics several months ago. Some of them are easy to implement and&#xA;some are really hard. The list below is made from the easiest method&#xA;to the hardest:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-          You can start from the basic physics of the movement and&#xA;measure the velocity of the time series ( based on v = road/ time).&#xA;You can calculate road using different approaches: &lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a)      Using a sum of absolute values of returns or price changes. &lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b)      Using a sum of returns or  price changes. &lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;c)       Compare price changes between point A and B in time series. &lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt; It will give you some kind of volatility indicator for the time series. &lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-          Then you can analyze the road - s (from the equation s =&#xA;0.5*a *t^2) using a model with acceleration &lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-          Moreover, you can measure the “kinetic energy” of the time&#xA;series using the equation E_kin =  0.5 * m* v^2 where mass can be&#xA;considered as the volume of the security. &lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-          You can use the Fourier transformation&#xA;&lt;a href=&quot;https://en.wikipedia.org/wiki/Fourier_transform&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Fourier_transform&lt;/a&gt; and try to decompose&#xA;the time series into a series of wavelets. This might be very hard&#xA;computationally . In this case you need to analyze how to predict how&#xA;long this wavelet models will last in time. An advantage of this&#xA;approach is the fact that you can make a forecast when you have the&#xA;model calculated. &lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-          Lastly, there is a lot of methods for derivative pricing&#xA;based on physics. For example the most popular model for options&#xA;pricing – the Black Scholes model is based on the equation which is&#xA;identical to the heat diffusion equation. &lt;br&gt;&lt;/p&gt;&#xA;" OwnerUserId="5745" LastEditorUserId="5745" LastEditDate="2015-09-07T11:20:07.860" LastActivityDate="2015-09-07T11:20:07.860" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20654" PostTypeId="2" ParentId="20641" CreationDate="2015-09-06T18:52:05.387" Score="1" Body="&lt;p&gt;You are confusing C-VaR and capital requirements for the credit risk of a counterparty. C-VaR is given by the Hull's formula you wrote, whereas what you call &quot;Malz approach&quot; is the calculation of the capital requirements. Check Hull - Risk Management and Financial Institutions p. 341.&lt;/p&gt;&#xA;" OwnerUserId="12214" LastActivityDate="2015-09-06T18:52:05.387" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20656" PostTypeId="1" AcceptedAnswerId="21911" CreationDate="2015-09-07T00:35:12.337" Score="8" ViewCount="1124" Body="&lt;p&gt;I am currently working on developing a series of &lt;strong&gt;density forecasts&lt;/strong&gt; and I am encountering some problems. I am working on weekly S&amp;amp;P 500 returns and the returns process is described as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_{t} = \mu + \delta r_{t-1} + h_{t}z_{t}$ &#xA;where $z_{t}$ comes from the Gaussian distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am forecasting the returns and volatility of the series using the &lt;strong&gt;ARMAX-GARCH-K Toolbox&lt;/strong&gt; in &lt;strong&gt;Matlab&lt;/strong&gt;. Initially I estimate the ARMA(1,0)-GARCH(1,1) model and obtain the one-step ahead forecast of the returns and volatility. I obtain the $\mu$ parameter from the parameters of the GARCH model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I understand the next step to obtain the density forecast (assuming Gaussian distribution) is to use the pdf of Gaussian distribution, so the &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;normpdf(x, mu, sigma)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;function in Matlab.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And here is the essence of my trouble. To obtain the density forecast should I use the actual observed return as x or the point forecast from the garch model? And should I use the $\mu$ parameter from the GARCH model as input for the mu parameter of normpdf and the forecasted volatility as as sigma in the normpdf function?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I now this may be a basic question but I cannot find any elementary examples on the internet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kind regards&lt;/p&gt;&#xA;" OwnerUserId="17464" LastActivityDate="2015-12-03T14:45:20.073" Title="Density forecast of a GARCH model" Tags="&lt;volatility&gt;&lt;garch&gt;&lt;forecasting&gt;&lt;matlab&gt;&lt;density&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20657" PostTypeId="2" ParentId="20648" CreationDate="2015-09-07T09:08:52.743" Score="0" Body="&lt;p&gt;Volatility is a difficult object and it is not always clear what we mean when we use the word volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would make the following distinction as a first step:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;historical volatility: measuring the ex-post volatility of an asset/market/sector. You pick an observation period of interest (e.g. 3 months up to 3 years). You pick a frequency (often daily or weekly returns), calculate the standard deviation and annualize these numbers to make volatilities comparable (multiply by $\sqrt{250}$ if you use daily data, take $\sqrt{50}$ for weekly. Doing this you can find the time series that was most volatile in the past.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;ex-ante volatility: you want to predict/forecast volatility. Then do the above and chose an observation period together with a frequency and then fit a (G)ARCH model or something similar. Such models give you a forecast of each asset's volatility for the coming period in the future. Doing this you can estimate the time series that could be most volatile in the future.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-09-07T09:08:52.743" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20658" PostTypeId="1" CreationDate="2015-09-07T14:09:49.450" Score="3" ViewCount="98" Body="&lt;p&gt;...as a function of NIG (Normal Inverse Gaussian) or VG (Variance Gamma) parameters, obviously. I've read that the NIG $\alpha$ is related to the $\alpha$-stable tail parameter, which conversely maps to the tail index. &lt;/p&gt;&#xA;" OwnerUserId="3015" LastEditorUserId="848" LastEditDate="2015-09-07T14:21:39.243" LastActivityDate="2016-05-06T23:57:09.790" Title="What is the tail index for NIG and/or VG?" Tags="&lt;variance-gamma&gt;&lt;normal-inverse-gaussian&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20659" PostTypeId="1" CreationDate="2015-09-07T14:22:28.823" Score="2" ViewCount="72" Body="&lt;p&gt;I am trying to find a place where I can get S&amp;amp;P Emini contract trading days. I would like to get the contract first appearance (September 9th 1997) until today.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can get  &lt;a href=&quot;http://www.cmegroup.com/tools-information/holiday-calendar/&quot; rel=&quot;nofollow&quot;&gt;Holidays&lt;/a&gt; but nothing for 1997. Is there a place where I can find this?&lt;/p&gt;&#xA;" OwnerUserId="16145" LastActivityDate="2015-09-15T20:50:54.480" Title="Futures Holiday Schedule" Tags="&lt;trading&gt;&lt;futures&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20660" PostTypeId="2" ParentId="10968" CreationDate="2015-09-07T14:28:20.577" Score="3" Body="&lt;p&gt;this is how i would explain your approximation.&#xA;First start with notation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Define $K_{atm}$ to be the atm strike.&#xA;Define $\Delta K := K2 - K1$ where $K2 &amp;gt; K_{atm} &amp;gt; K1$. This corresponds to $\Delta K = $$StrD$ in your notation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now assume a black scholes world, within this world we can approximate the Call and Put price of an atm option with:&#xA;$C_{atm} = P_{atm} = 0.4 \sigma \sqrt{T} F$.Therefore the price of a straddle is given by $0.8 \sigma \sqrt{T} F$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The delta of an option is given by $N(d1)$. For $K_{atm}$ we get that $d1 =\frac{ 0.5\sigma^2 T}{\sigma \sqrt{T}}$. So $N(d1)$ is close to 0.54. Now we evaluate $N(d1)$ at $K = K_{atm}+-straddle$. For example suppose r = 0, S = 100, T = 1, vol = 0.2 then K_{atm} = 100, the straddle = 0.8*0.2*1*100 = 16 (and a vanilla call is priced at 8). &lt;strong&gt;Question:&lt;/strong&gt; what is the delta when evaluated at K=116 or 84? &lt;strong&gt;Answer:&lt;/strong&gt; delta is 0.26 and 0.84. Comparing 0.26 against 0.54 and 0.84 against 0.54 we see that for the up and down &lt;strong&gt;straddle move&lt;/strong&gt; the delta changes about &lt;strong&gt;0.3&lt;/strong&gt;. Furthermore, by simply plotting the delta against strikes we can observe that the &lt;strong&gt;delta is approximately linear&lt;/strong&gt; between the these strike levels. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore we can explain your $\Delta CS$.&#xA;You have a move of 0.3 deltas for 1 move of size straddle. thefore a move of size $\delta K = (K_{new} - K_{atm})$ changes the delta by: $0.3 \frac{\delta K}{straddle}$. Alternatively we can write the Delta as function of K. $\Delta(K) = 0.50 + \frac{0.3(K - K_{atm})}{straddle}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The price of a callspread is given by $C(K1) - C(K2)$. Now we approx C(K2) by:&#xA;$C(K2) = C(K1) + \int_{K1}^{K2} \Delta(K) dK$. The value of your callspread therefore is: $\int_{K1}^{K2} \Delta(K) dK$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think integrating the above gets you very close to the formula that you want. &lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2015-09-07T14:28:20.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20661" PostTypeId="1" AcceptedAnswerId="20662" CreationDate="2015-09-07T19:45:38.243" Score="6" ViewCount="4789" Body="&lt;p&gt;I have several weeks of minute-by-minute stock data (start and end prices, volume). Everything I've read so far leads me to believe there isn't a standard method for volatility, which is leaving me confused on what to use.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to calculate the volatility for each minute so I can see how volatility is changing through the day and whether there is a correlation with other variables. What methods would apply here? &lt;/p&gt;&#xA;" OwnerUserId="17440" LastActivityDate="2015-10-07T10:30:22.957" Title="How to calculate volatility on intraday data?" Tags="&lt;volatility&gt;&lt;high-frequency&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20662" PostTypeId="2" ParentId="20661" CreationDate="2015-09-07T20:00:13.760" Score="6" Body="&lt;p&gt;Financial modeling is often considered as a mixture of art and science. That is a way how you model your data depends on you. You can choose several approaches, for example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;calculate &lt;strong&gt;max - min&lt;/strong&gt; price for a given minute data - a very simple approach,&lt;/li&gt;&#xA;&lt;li&gt;calculate &lt;strong&gt;the standard deviation&lt;/strong&gt; of minute-by-minute stock data,&lt;/li&gt;&#xA;&lt;li&gt;calculate &lt;strong&gt;GARCH family models&lt;/strong&gt; for measuring the volatility. This is a more complicated approach but gives you the most adapting models which can detect &lt;strong&gt;volatility clustering&lt;/strong&gt; and thanks to it you can make volatility forecasts. You do not have to implement these models. They are implemented in a dedicated software (ox-metrics, gretl) or implemented in some open source libraries. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;To sum up.&lt;/strong&gt; There is no final answer. Try to use different approaches and decide which suits best for you. Probably in the end of the day GARCH family models will appear the best. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more information, see:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Autoregressive_conditional_heteroskedasticity&quot;&gt;https://en.wikipedia.org/wiki/Autoregressive_conditional_heteroskedasticity&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="5745" LastActivityDate="2015-09-07T20:00:13.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20663" PostTypeId="1" CreationDate="2015-09-07T20:16:11.390" Score="-2" ViewCount="289" Body="&lt;p&gt;im looking at the bobl future for september and for december and see 1.8 basis points difference.&#xA;i wanted to know why there is this gap?&#xA;and if im holding a position in september and want to roll it to december what is my cost?&#xA;thank you &lt;/p&gt;&#xA;" OwnerUserId="17470" LastActivityDate="2015-09-07T20:40:19.963" Title="what is the cost for rolling 5 year german future?" Tags="&lt;futures&gt;&lt;bond&gt;&lt;bond-futures&gt;&lt;roll-adjustment&gt;&lt;yield-futures&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20664" PostTypeId="2" ParentId="20663" CreationDate="2015-09-07T20:40:19.963" Score="1" Body="&lt;p&gt;Ignoring delivery option and margining, then you can treat bond futures like a bond forward. Like any forward contract, fair values of bond forwards are determined by&#xA;$$ \text{forward price} = \text{spot price} - \text{carry}. $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The calendar spread is therefore nonzero for several reasons:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The underlying cheapest-to-delivers might be different, so both spot prices and carries differ for the two contracts;&lt;/li&gt;&#xA;&lt;li&gt;Even if the underlyings are identical for both contracts (so the spot price is the same), carries can differ – for the December contract, you'd earn three more months worth of accrue interest, but must also pay three more months worth of financing cost. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Flows and other factors can also drive the roll away from fair value. For example, if a lot of longs decide to roll together, then the back contract (December) will no doubt richen relative to the front contract, cheapening the roll.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other factors such as delivery options can also play a major role in determining the value of such calendar spreads, depending on the interest rate environment.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2015-09-07T20:40:19.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20665" PostTypeId="2" ParentId="17253" CreationDate="2015-09-07T22:22:00.143" Score="0" Body="&lt;p&gt;Not sure if I understand your question, but if you're looking to analyze the extent to which interest rates differentials drive currencies, you'd probably want to focus on forward interest rate swaps in order to capture market implied expectations. So 1y1y spreads could be meaningful for G10 currencies. You may also want to incorporate yield curve slopes which could be captured by a 2s10s swap differential. &lt;/p&gt;&#xA;" OwnerUserId="2851" LastActivityDate="2015-09-07T22:22:00.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20667" PostTypeId="1" CreationDate="2015-09-08T10:49:36.313" Score="4" ViewCount="73" Body="&lt;p&gt;Trying to create a custom stock sector index, however adding/dropping of the constituents will be frequent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which kind of index calculation methodology (e.g. Price Weighted, Equal Weighted, Cap Weighted) is suitable for this sector index construction?&#xA;Or, will any re-balancing be able to cancel the effect of adding/dropping?&lt;/p&gt;&#xA;" OwnerUserId="16381" LastEditorUserId="848" LastEditDate="2015-09-08T12:54:32.243" LastActivityDate="2015-09-08T12:54:32.243" Title="Is there any index calculation methodology that is suitable when constituents change frequently?" Tags="&lt;equities&gt;&lt;index&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20668" PostTypeId="1" AcceptedAnswerId="20669" CreationDate="2015-09-08T11:37:30.090" Score="2" ViewCount="117" Body="&lt;p&gt;What's the logical/scientific explanation for Black Scholes &amp;amp; Binomial using &lt;strong&gt;year&lt;/strong&gt; rather than &lt;strong&gt;second&lt;/strong&gt; (SI standard for time) ?&lt;/p&gt;&#xA;" OwnerUserId="17473" LastActivityDate="2015-09-08T12:00:37.373" Title="Why t (time) in Black Scholes &amp; Binomial defined as year?" Tags="&lt;black-scholes&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20669" PostTypeId="2" ParentId="20668" CreationDate="2015-09-08T11:47:13.020" Score="5" Body="&lt;p&gt;It's just a matter of convention as it is customary to also quote the interest rate as a yearly rate. Furthermore, this time scale plays well with the size of other variables such as the interest rate and volatility. It's just not convenient to quote a tiny number for the volatility. Sure, one could scale these numbers back to something more reasonable but that only complicates matters. Especially since scaling is hard if you take into account holiday, weekends, etc.&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="848" LastEditDate="2015-09-08T12:00:37.373" LastActivityDate="2015-09-08T12:00:37.373" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20670" PostTypeId="2" ParentId="20668" CreationDate="2015-09-08T11:48:31.503" Score="1" Body="&lt;p&gt;If you will take a look at the BS equation &lt;a href=&quot;https://en.wikipedia.org/wiki/Black%E2%80%93Scholes_model&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Black%E2%80%93Scholes_model&lt;/a&gt; particularly at the BS equation and its variables, you can see that all of them are annualized.&lt;br&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover: &lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The model would be incorrect if it had some variables annualized and some not annualized (monthly, weekly). &lt;/li&gt;&#xA;&lt;li&gt;It is harder to obtain data (i.e. monthly interest rates, not mentioning weekly interest rates) for some countries. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If you want you can try to scale all of the variables and see the results. &lt;/p&gt;&#xA;" OwnerUserId="5745" LastActivityDate="2015-09-08T11:48:31.503" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20671" PostTypeId="1" CreationDate="2015-09-08T18:21:55.653" Score="2" ViewCount="288" Body="&lt;p&gt;I am trying to value an inflation linked swap and wish to calculate the associated CVA and DVA. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the best way to approach this would be via a simulation.&#xA;Suppose I wish to calculate CVA over the period $[0,T]$ that is split into $[t_{i-1},t_{i}]$ for $i=0,1,2,...M$. We would then want to calculate an EPE (expected positive exposure) during each of the sub intervals and the set&#xA;CVA = $\Sigma EPE*PD*LGD$ for each of the intervals. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My thinking on methodology to calculate the expected exposures would be as follows: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Forecast an expected CPI index level into the future to calibrate the simulations to. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) For each $t_{i}$ simulate N CPI index levels (obviously dependent on the prior level and calibrated to the base forecast and appropriate volatility). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From here I am not entirely sure, but I realize that I essentially need a forward CPI index curve from this point until point $T$. How would I have to make use of my input CPI forecast to project a CPI forecast from each simulated point forward? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Then make use of the simulated CPI and associated forecast in each simulation, at each point in time, to value the swap and finally take an average over all the simulation, at each point in time to get the expected exposure at each $t_{i}$ and use this to calculate the CVA and DVA. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A side from my question in point 2 above, if anyone can suggest an improvement to this method or confirm that I am going about this in the correct way I would appreciate it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks. &lt;/p&gt;&#xA;" OwnerUserId="17480" LastActivityDate="2015-09-08T18:21:55.653" Title="CVA for an inflation linked swap" Tags="&lt;swaps&gt;&lt;inflation&gt;&lt;cva&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20672" PostTypeId="1" CreationDate="2015-09-08T18:54:18.793" Score="4" ViewCount="8889" Body="&lt;p&gt;Part of my master thesis I am working with a company.  I have the project to use their financial database with all the financials data (7 years) of approximately 3’000 companies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They have their own credit score from 1 that is the best score, to 4 the worst. What I intend to do is to calculate the Z-score (Altman score) and do a corresponding map between these two scores.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My ultimate goal is to compute the probability of default for these two different credit score.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you advise me if my logic of how to do it is correct? Or I am free to take any advises with a different approach. For instance I am hesitating to use the Black-Schole-Merton model to have the probability of default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first step is: calculate the Z-score of each company with this formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Formula for Private Companies: (Altman 2000) : Z' = 0.717*X1 + 0.847*X2 + 3.107*X3+ 0.420*X4+0.998*X5&lt;/p&gt;&#xA;&#xA;&lt;p&gt;X1=Working Capital/Total Asset &lt;/p&gt;&#xA;&#xA;&lt;p&gt;X2=Retained Earnings / Total Assets&lt;/p&gt;&#xA;&#xA;&lt;p&gt;X3=Earnings Before Interest and Taxes / Tot Assets&lt;/p&gt;&#xA;&#xA;&lt;p&gt;X4=Book Value of Equity / Book Value of Total Debt&lt;/p&gt;&#xA;&#xA;&lt;p&gt;X5=Sales / Total Assets&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2nd step: I would like to do a corresponding table between the internal credit score and the Z-score. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;3rd: create a normal distribution to find the probability of default.  BUT  on this part I would need some advise to see how it is possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope I am clear in what I would like to do. Thank you in advance.&lt;/p&gt;&#xA;" OwnerUserId="17350" LastActivityDate="2016-03-15T12:16:46.997" Title="credit risk - How to calculate the probability of default (private companies)?" Tags="&lt;risk-models&gt;&lt;credit-risk&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20673" PostTypeId="2" ParentId="19344" CreationDate="2015-09-08T21:13:40.213" Score="0" Body="&lt;p&gt;(1) as AFK says, total remaining variance is somewhat more natural mathematically.  Of course it is just a choice of coordinate, and mathematically you can do changes of coordinate so it is for aesthetic rather than hard mathematical reasons.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) time dependence in SVI-JW parameters is carefully chosen so that if the parameters are held constant across maturities, the vol surface stays approximately constant as a function of delta as maturity changes.  This gives a way to extrapolate volatilities that is much more similar to how real markets look than e.g. holding raw SVI parameters fixed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(3) yes, SSVI is trying to fit the near-the-money part of the whole vol surface.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(4) my understanding is for SSVI you fit exactly the at-the-money vol level and at-the-money skew at each maturity.  That is an exact calibration to two guven quantities, rather than an optimisation.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2015-09-08T21:13:40.213" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20674" PostTypeId="2" ParentId="19570" CreationDate="2015-09-08T21:22:52.130" Score="-3" Body="&lt;p&gt;Quandl.com is the way to Go.&#xA;Just have a look !&lt;/p&gt;&#xA;" OwnerUserId="17482" LastActivityDate="2015-09-08T21:22:52.130" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20675" PostTypeId="1" CreationDate="2015-09-08T21:43:47.400" Score="10" ViewCount="2976" Body="&lt;p&gt;&lt;strong&gt;Introduction:&lt;/strong&gt;&lt;br&gt; I have seen a plenty of articles/books regarding volatility forecasting applied to high frequency data, but none of them were dedicated to forecasting the actual prices (for example bid/ask of currency pairs, stock prices).&lt;br&gt;&#xA;Example:&lt;br&gt;&#xA;&lt;a href=&quot;http://public.econ.duke.edu/~get/browse/courses/201/spr11/DOWNLOADS/VolatilityMeasures/SpecificlPapers/hansen_lunde_forecasting_rv_11.pdf&quot; rel=&quot;noreferrer&quot;&gt;Forecasting Volatility using High Frequency Data (P. R. HANSEN, A. LUNDE)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I realize that forecasting hft data must be hard because of several problems:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How long model will be valid? &lt;/li&gt;&#xA;&lt;li&gt;How to check such validity?&lt;/li&gt;&#xA;&lt;li&gt;Will a new model be calculated on time? (NN and most of subtypes of NN need a lot of time to be recalculated)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;br&gt;&#xA;&lt;strong&gt;Questions:&lt;/strong&gt;&lt;br&gt;&#xA;Given the above mentioned problems/restrictions I would like to ask you: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What's the best way of forecasting high-frequency data? &lt;br&gt;&lt;/li&gt;&#xA;&lt;li&gt;What kind of scientific papers/books should I follow in order to be up-to-date in this topic?&#xA;&lt;br&gt;&#xA;&lt;br&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Personal feedback:&lt;/strong&gt;&lt;br&gt;From my own research based on hft data I can write that generally only few models are better than naive forecasting (but only in some sub time series - few minutes etc.) &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Kalman Filtering (calibrated accordingly)&lt;/li&gt;&#xA;&lt;li&gt;ARIMA, ARMA models&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Generally worse than naive forecasting are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Holts linear model (ARIMA (0,2,2) &lt;/li&gt;&#xA;&lt;li&gt;Linear Regression&lt;/li&gt;&#xA;&lt;li&gt;Exponential Smoothing&lt;/li&gt;&#xA;&lt;li&gt;Moving averages (different types)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="5745" LastActivityDate="2019-07-12T07:26:12.003" Title="How to forecast high-frequency data?" Tags="&lt;time-series&gt;&lt;high-frequency&gt;&lt;forecasting&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20677" PostTypeId="2" ParentId="19598" CreationDate="2015-09-09T00:37:43.483" Score="6" Body="&lt;p&gt;please go to {drvd} BVOL Equity Implied Volatilities Calculations paper.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Disclamer: I was working for Bloomberg, that is as far we disclosed.&lt;/p&gt;&#xA;" OwnerUserId="16987" LastActivityDate="2015-09-09T00:37:43.483" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20678" PostTypeId="1" AcceptedAnswerId="20681" CreationDate="2015-09-09T02:04:57.490" Score="4" ViewCount="241" Body="&lt;p&gt;I am trying to determine an appropriate haircut for a basket of illiquid stocks that barely traded during the year. Can someone suggest me an approach to estimate the risk? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My dataset has a lot of missing dates. If I replace these blanks with the previous price, when I come up with a measure for the returns I obtain several days without change and a date with a huge change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much for any suggestion.&lt;/p&gt;&#xA;" OwnerUserId="17250" LastActivityDate="2015-09-09T23:06:19.647" Title="Estimating an appropriate haircut for illiquid stocks" Tags="&lt;volatility&gt;&lt;equities&gt;&lt;risk&gt;&lt;liquidity&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20680" PostTypeId="2" ParentId="18673" CreationDate="2015-09-09T07:16:51.193" Score="1" Body="&lt;p&gt;under the black scholes assumptions it is nearly impossible to move 50% in 1 day. A 1day move will be of size $\sigma \sqrt{1/252}$ (assuming 252 trading days). So you are talking about something that is about a 40 stdev move (assuming $\sigma$ = 0.2).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;that's why your gamma is 0.&lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2015-09-09T07:16:51.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20681" PostTypeId="2" ParentId="20678" CreationDate="2015-09-09T07:43:48.400" Score="2" Body="&lt;p&gt;Generally if they are missing a &lt;strong&gt;completely at random&lt;/strong&gt; data in few places, you do not have to be worried. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I advice you to use one of the technics of imputation:&lt;br&gt;&#xA; - &lt;strong&gt;Previous value&lt;/strong&gt; - cannot be used in this case &lt;br&gt;&#xA; - &lt;strong&gt;Educated Guessing&lt;/strong&gt; - you have &quot;knowledge&quot; about the data, you can try to use some interpolation in your mind. &lt;br&gt;&#xA; - &lt;strong&gt;Common-Point Imputation&lt;/strong&gt; - try to average a missing value or do an interpolation if several values are missing. &lt;br&gt;&#xA; - &lt;strong&gt;Regression analysis or moving average&lt;/strong&gt; - use previous X values to predict the missing values&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally I would go for the common-point imputation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To see more, please visit:&lt;br&gt;&#xA;&lt;a href=&quot;http://www.measuringu.com/blog/handle-missing-data.php&quot; rel=&quot;nofollow&quot;&gt;7 Ways To Handle Missing Data&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="5745" LastEditorUserId="5745" LastEditDate="2015-09-09T23:06:19.647" LastActivityDate="2015-09-09T23:06:19.647" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20682" PostTypeId="2" ParentId="19598" CreationDate="2015-09-09T12:58:48.533" Score="3" Body="&lt;p&gt;Generally Bloomberg is very open with their methodologies.  Look up the documentation as recommended above, and if you have further questions you can ask HELP HELP to put you in touch with someone on their quant development team for more details.  As long as you are a paying subscriber it should be no problem.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2015-09-09T12:58:48.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20683" PostTypeId="2" ParentId="20678" CreationDate="2015-09-09T13:39:23.540" Score="2" Body="&lt;p&gt;You're going to have to do a lot of guesswork, obviously, so it's best to keep things mathematically simple.  First off, choose a &quot;certainty level&quot; as some quantile $q$, perhaps around 0.9, and the corresponding normal variate $z=N^{-1}(1-q)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Start by figuring out how much time $T_i$ you think each position $N_i$ will take to liquidate if necessary.  Then choose some high percentile (not necessarily $q$) like 95% and set your overall horizon $T$ to the 95th percentile of those liquidation times.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$T = Q_{95}(\{T_i\})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now for each stock, use the existing data to find a return beta to the SP500&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_i = \beta^{(i)} r_{SP} + \epsilon^{(i)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The variance $\sigma_i^2$ of the error terms $\epsilon^{(i)}$ is the &quot;idiosyncratic variance&quot; for this stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To account for the fact that correlations go to 1.0 in times of market stress, we will use a haircut model where the SP500 and every idiosyncratic term in the portfolio has experienced a $q$-level loss at horizon $T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ignoring interest rates, we value each stock with current price $S_i$ at&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ P_i = S_i\exp\left[\beta^{(i)} \sigma_{SP} \sqrt{T} z + \sigma_{i} \sqrt{T} z - (\beta^{(i)} \sigma_{SP}^2 + \sigma_{i})T/2\right]$$&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2015-09-09T13:39:23.540" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20684" PostTypeId="1" CreationDate="2015-09-09T15:30:55.820" Score="3" ViewCount="131" Body="&lt;p&gt;suppose $L(T_i, T_{i+1})$ is the LIBOR rate between $T_i$ and $T_{i+1}$, and $T_N$ is some time later than $T_{i+1}$. $E^{T_N}$ is the $T_N$-forward measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to work this out using John Hull's timing adjustment methods (ch 29.2 of &quot;Options, futures and other derivatives&quot;), but to no avail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you pls throw some lights here?&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2015-09-10T00:07:26.320" Title="How to calculate $E^{T_N}(L(T_i, T_{i+1}))$?" Tags="&lt;option-pricing&gt;&lt;convexity&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20685" PostTypeId="2" ParentId="18297" CreationDate="2015-09-09T17:44:10.123" Score="3" Body="&lt;p&gt;In case you're still looking: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://data.snb.ch/en/topics/ziredev#!/cube/rendoblid&quot; rel=&quot;nofollow&quot;&gt;https://data.snb.ch/en/topics/ziredev#!/cube/rendoblid&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17491" LastActivityDate="2015-09-09T17:44:10.123" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20686" PostTypeId="2" ParentId="20658" CreationDate="2015-09-09T20:11:29.937" Score="1" Body="&lt;p&gt;If the tail index is $\alpha$ then moments beyond that do not exist. The fact that all moments exist for NIG and VG indicates that the tail index is infinite (like the Gaussian).&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2015-09-09T20:11:29.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20687" PostTypeId="1" AcceptedAnswerId="20688" CreationDate="2015-09-09T20:19:17.723" Score="4" ViewCount="7702" Body="&lt;p&gt;Is there a package to run simplified multivariate GARCH models in Python?  I found the Arch package but that seems to work on only univariate models.  I'd like to test out some of the more simple methods described in &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1002/jae.842/pdf&quot; rel=&quot;nofollow&quot;&gt;Bauwends et. al. (2006)&lt;/a&gt; like constant conditional correlation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Python libraries are preferred though I'll play with R as well.&lt;/p&gt;&#xA;" OwnerUserId="5689" LastActivityDate="2020-10-12T09:52:38.780" Title="Multivariate GARCH in Python" Tags="&lt;garch&gt;&lt;python&gt;&lt;multivariate&gt;&lt;covariance-estimation&gt;" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20688" PostTypeId="2" ParentId="20687" CreationDate="2015-09-09T20:37:25.577" Score="3" Body="&lt;p&gt;&lt;strong&gt;PYTHON&lt;/strong&gt;&lt;br&gt;&#xA;I have found &lt;a href=&quot;https://github.com/statsmodels/statsmodels/blob/5931ec43c72373ed810c1305b87abf025f867306/statsmodels/sandbox/tsa/garch.py&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; class from the statsmodels library for calculating Garch models. &lt;br&gt; Unfortunately, I have not seen MGARCH class/library. &#xA;Below you can see the basic information about the garch models in mentioned class from the statsmodels. Probably you have to implement it by your own in python, so this class might be used as a starting point.  &lt;br&gt; &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;roadmap for garch: &lt;br&gt;&#xA;   * simple case &lt;br&gt;&#xA;   * starting values: garch11 explicit formulas&lt;br&gt;&#xA;   * arma-garch, assumed separable, blockdiagonal Hessian&lt;br&gt;&#xA;   * other standard garch: egarch, pgarch,&lt;br&gt;&#xA;   * non-normal distributions&lt;br&gt;&#xA;   * other methods: forecast, news impact curves (impulse response)&lt;br&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;R&lt;/strong&gt; &lt;br&gt;&#xA;In R there is a package called mgarch which is available in &lt;a href=&quot;https://github.com/vst/mgarch/&quot; rel=&quot;nofollow&quot;&gt;this github repository&lt;/a&gt; and &lt;a href=&quot;http://hackersome.com/p/vst/mgarch&quot; rel=&quot;nofollow&quot;&gt;here you can find some examples.&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5745" LastActivityDate="2015-09-09T20:37:25.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20690" PostTypeId="2" ParentId="20684" CreationDate="2015-09-10T00:07:26.320" Score="1" Body="&lt;p&gt;well you need to specify dynamics for the rates between &#xA;$$T_{i+1}$$ and $T_N.$ If you make them log-normal then the standard BGM/LMM drift computation applies and you get a state dependent drift. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The expectation does not exist in closed form however. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(See eg More Mathematical Finance for detailed discussion.)&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-09-10T00:07:26.320" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20691" PostTypeId="1" CreationDate="2015-09-10T00:17:51.703" Score="2" ViewCount="883" Body="&lt;p&gt;Couldn't we just cancel existing order and enter new order?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any other reason apart from a communication overhead that now we need to send 2 messages vs just 1 message to cancel replace?&lt;/p&gt;&#xA;" OwnerUserId="6303" LastActivityDate="2019-02-21T10:39:44.143" Title="why is there a cancel/replace message in FIX?" Tags="&lt;fix&gt;&lt;order-handling&gt;&lt;order&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20692" PostTypeId="1" CreationDate="2015-09-10T06:09:24.237" Score="5" ViewCount="1268" Body="&lt;p&gt;I've read an answer &lt;a href=&quot;https://quant.stackexchange.com/a/3547&quot;&gt;here&lt;/a&gt; that say  if your security has vega, then it has gamma and theta. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;is there an analytical proof that vega-neutral also provides (gamma &amp;amp; theta) neutral?&lt;/p&gt;&#xA;" OwnerUserId="17496" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-09-10T11:08:07.430" Title="is there an analytical proof that vega-neutral also provides (gamma &amp; theta) neutral?" Tags="&lt;black-scholes&gt;&lt;greeks&gt;&lt;gamma&gt;&lt;vega&gt;&lt;theta&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20693" PostTypeId="2" ParentId="20691" CreationDate="2015-09-10T06:59:59.550" Score="15" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Order Cancel-Replace might save you from losing priority in the book (for instance when cancelling some of the remaining shares - check the venue rules!).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The communication overhead is very significant - it halves the round trip time (otherwise you have to cancel; wait for confirmation; re-send -- if you don't wait you risk getting double fills). &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;At any given time you have your order active in the book (unless rejected).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Margin/risk checks might also be faster (vendor-specific of course)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="16351" LastActivityDate="2015-09-10T06:59:59.550" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="20694" PostTypeId="2" ParentId="20692" CreationDate="2015-09-10T08:37:27.513" Score="1" Body="&lt;p&gt;I don't think your hypothesis is correct.&#xA;If you have a very short dated ATM option, then your option will have close to infinite gamma but close to 0 vega. So this short dated ATM option is vega neutral but definitely not gamma neutral.&lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2015-09-10T08:37:27.513" CommentCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="20695" PostTypeId="1" CreationDate="2015-09-10T08:46:18.530" Score="2" ViewCount="169" Body="&lt;p&gt;First of, I'm not sure if this is the right place for this question, but a search on Google for another programmatically related question regarding stocks led me here, so here it goes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to programmatically get a list of the institutional owners of stocks traded on (primarily, other exchanges are also of interest) Nasdaq? And in case my financial vocabulary isn't up to par, the list I'm looking for is one like &lt;a href=&quot;http://www.nasdaq.com/symbol/achc/institutional-holdings&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: To clarify, I'm not interested in reading the data from the web page. I'm curious if there are any FTP, API or other sort of service offering the data in such a way that it's easy to get and assimilate for a computer program. Parsing the data on a web page is kind of a last resort kind of thing.&lt;/p&gt;&#xA;" OwnerUserId="17498" LastEditorUserId="17498" LastEditDate="2015-09-10T12:06:32.943" LastActivityDate="2015-09-10T17:10:39.117" Title="Get institutional holdings of stocks programmatically" Tags="&lt;equities&gt;&lt;programming&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20696" PostTypeId="2" ParentId="20692" CreationDate="2015-09-10T11:08:07.430" Score="5" Body="&lt;p&gt;if you have a portfolio of calls and puts with the same maturity then your portfolio is gamma neutral if and only if it is vega neutral. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reasons is that the BS gamma divided by the BS vega is a function of $S$ and $T$ that does not vary with $K.$ So if you construct a linear combination that has zero gamma then the vega is zero too, and vice versa.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-09-10T11:08:07.430" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20698" PostTypeId="1" CreationDate="2015-09-10T13:30:43.423" Score="4" ViewCount="194" Body="&lt;p&gt;I want to find the relationship between volume and price returns in the S&amp;amp;P500. My first thought was to run a cross correlation in order to find who leads and who lags in the relation. It´s my first time running cross correlations so I have three basic questions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Using volume as X and returns as Y in a CCF I obtain the following results using SPSS. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Lag -2 : 0.103&lt;/li&gt;&#xA;&lt;li&gt;Lag -1 : -0.131&lt;/li&gt;&#xA;&lt;li&gt;Lag 0 : -0.113&lt;/li&gt;&#xA;&lt;li&gt;Lag 1 : -0.022&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Lag 2 : -0.008&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under these results, who lead and who lags? If I obtained higher values in the negative lags is correct to assume that volume (x) leads returns (y)?  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;2) Should I consider not the trading volume, but rather the volume growth rate? (the difference in logarithm between two consecutive values of trading volume)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Any idea for testing the significance level and p-value for each lag? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="17343" LastActivityDate="2015-10-25T23:36:11.560" Title="volume-returns cross correlation interpretation" Tags="&lt;time-series&gt;&lt;correlation&gt;&lt;auto-correlation&gt;&lt;volume&gt;&lt;lags&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20699" PostTypeId="2" ParentId="20695" CreationDate="2015-09-10T17:10:39.117" Score="1" Body="&lt;p&gt;The usual suspects maintain lists  for each stock.  Bloomberg for instance has &lt;code&gt;OWN&amp;lt;GO&amp;gt;&lt;/code&gt; and &lt;code&gt;HLDS&amp;lt;GO&amp;gt;&lt;/code&gt; but in those cases you need to iterate through each stock individually.  These are done on a best efforts basis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm pretty sure this is a design choice to keep you using the terminal front end and not the api.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other than that, you are going to be left with writing a web spider.&lt;/p&gt;&#xA;" OwnerUserId="743" LastActivityDate="2015-09-10T17:10:39.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20700" PostTypeId="1" CreationDate="2015-09-10T21:46:03.323" Score="2" ViewCount="2908" Body="&lt;p&gt;I am trying to use Thomson Reuters Eikon to get a list of historically large companies, for example, what were the 1000 largest companies by market capitalization in 1990? I would like to get lists of every company from 1990 to 2015 that had a market capitalization [at any point] over $10 billion USD. I have tried using the formula builder and Eikon's research tools but cannot do this task. &lt;/p&gt;&#xA;" OwnerUserId="17505" LastActivityDate="2015-09-10T21:46:03.323" Title="How can I use Thomson Reuters Eikon to get a list of large historical companies?" Tags="&lt;market-data&gt;&lt;market&gt;&lt;reuters&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20701" PostTypeId="2" ParentId="20698" CreationDate="2015-09-11T03:15:56.580" Score="2" Body="&lt;p&gt;The direction of the relationship cannot be determined from just this information (a set of correlation coefficients). You need to estimate a model of volume based on lagged volume and lagged returns, checking if the lagged return terms are significant. Then as a second step you estimate a model of returns that includes past returns and past volumes and see if the volume terms are statistically significant. This is the procedure known as Granger causality testing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It will show whether past information about volume is helpful in predicting returns and vice versa. Having done this exercise many years ago I found that returns have an influence on volume, but not vice versa.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2015-10-25T23:36:11.560" LastActivityDate="2015-10-25T23:36:11.560" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20702" PostTypeId="1" AcceptedAnswerId="20703" CreationDate="2015-09-11T05:19:20.153" Score="1" ViewCount="215" Body="&lt;p&gt;Most commonly due to latency reasons, market data is published using multicast protocol. However since multicast is built on top of UDP, it is possible that there could be packet drops. How can the client get the missed messages and build the order book correctly?&lt;/p&gt;&#xA;" OwnerUserId="6303" LastActivityDate="2015-09-11T06:14:58.983" Title="how are gaps usually handled in market data received with multicast?" Tags="&lt;market-data&gt;&lt;limit-order-book&gt;&lt;fix&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20703" PostTypeId="2" ParentId="20702" CreationDate="2015-09-11T06:14:58.983" Score="4" Body="&lt;p&gt;You are usually given an option to either -&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Request a re-transmission of the messages you missed (through a different channel).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Request a snapshot of the current book from a dedicated server.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Both are likely TCP based.&lt;/p&gt;&#xA;" OwnerUserId="16351" LastActivityDate="2015-09-11T06:14:58.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20704" PostTypeId="1" CreationDate="2015-09-11T11:56:22.573" Score="3" ViewCount="411" Body="&lt;p&gt;I am trying to construct a portfolio whose return is $a + bm_{t+1}$ where $a$ and $b$ are some constants for a certain investor. $m_{t+1}$ is the stochastic discount factor at time $t+1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am guessing that to have $a$ as return, you would have to buy $\frac{a}{1+r_f}$ units of the risk-free asset, whose existence we take for granted. Here $r_f$ is the risk-free interest rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then for the portfolio that returns $m_{t+1}$, I proceed as follows. I have been given the hint that I should consider the regression $m_{t+1} = \sum_j^J \beta_jR_{j,t+1} +\varepsilon_{t+1}$ with $E[\varepsilon_{t+1}R_{i,t+1}] = 0$ for all $i=1,\ldots,J$. Here $R_{i,t+1}$ is the return on asset $i$ and $J$ is the total number of assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My guess was to find a $(\beta_j)_{j=1,\ldots,J}$ such that $m_{t+1} = \sum_j^J \beta_jR_{j,t+1}$ almost surely. Then if I show that&#xA;$$E[\lvert m_{t+1}-\sum_j^J \beta_jR_{j,t+1}\rvert^2] = 0$$&#xA;I will have what I want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This gives me something like $E[m_{t+1}^2] = \sum_j^J \beta_j$. I am not sure where I am going with this to be honest. I am fairly new to this stuff. I would appreciate it if someone could put me on the right path in solving this problem. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="11597" LastActivityDate="2016-10-06T16:43:46.470" Title="The portfolio whose return is the stochastic discount factor" Tags="&lt;asset-pricing&gt;&lt;stochastic-discount&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20705" PostTypeId="1" CreationDate="2015-09-11T14:58:56.370" Score="1" ViewCount="22" Body="&lt;p&gt;I am currently trying to better understand capital increases and dilution. I came across a few presentations of companies. I am trying to find out, if there are any standards, which are commonly part of these advertisements. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously, companies usually show an overall cash flow, balance sheet, and P&amp;amp;L forecast/plan. But are there any other &quot;must haves&quot; to attract potential investors?&lt;/p&gt;&#xA;" OwnerUserId="17509" LastEditorUserId="17509" LastEditDate="2015-09-11T15:07:36.587" LastActivityDate="2015-09-11T15:07:36.587" Title="In what way are capital increases usually advertised?" Tags="&lt;equities&gt;&lt;investment&gt;&lt;capital-structure&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20708" PostTypeId="1" CreationDate="2015-09-11T21:34:42.710" Score="3" ViewCount="493" Body="&lt;p&gt;&lt;em&gt;Disclaimer: I come from an academic finance perspective and hence I will definitely have my inherent biases in this question.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does one think about &quot;alpha&quot; in portfolio management? In particular, in some practitioner's literature, there's this discussion of an &quot;alpha factor&quot; in the linear factor models. Taking an instance out of numerous examples out there, see &#xA;&lt;a href=&quot;http://www.iijournals.com/doi/abs/10.3905/jpm.2008.709976&quot; rel=&quot;nofollow&quot;&gt;http://www.iijournals.com/doi/abs/10.3905/jpm.2008.709976&lt;/a&gt;&#xA;&lt;a href=&quot;https://www.msci.com/documents/10199/c6e5e3f7-cd44-4322-aeb5-331e20e2afb7&quot; rel=&quot;nofollow&quot;&gt;https://www.msci.com/documents/10199/c6e5e3f7-cd44-4322-aeb5-331e20e2afb7&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I understand it, the practitioner has in mind a linear factor model of the form, &#xA;$$R_k = \alpha_k + \beta_{k1} R_{k1} + \ldots + \beta_{kN} R_{kN} + \epsilon_k $$,&#xA;where $R_{kn}$ are the $n = 1, \ldots, N$ factor excess returns and $R_k$ is the excess return of asset $k$, and $\epsilon_k$ is the usual idiosyncratic risk. But what is this discussion of $\alpha_k$ being &quot;spanned&quot; by risk factors (i.e., it can be rewritten as a linear form of $R_{kn}$) or that it represents &quot;return forecasts&quot;? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To my (perhaps limited) understanding, no top academic finance journal would ever interpret $\alpha_k$ as an &quot;alpha factor&quot; that is spanned by risk factors (i.e. this would imply that such an &quot;alpha&quot; can be collapsed into the linear span of ${ R_{k1}, ..., R_{kN} }$ and hence is risky; or that it can be viewed as a forecast of future returns, since the expectation would simply be $E R_k$, which when $R_{kn}$ have nonzero expectations, is not equal to $\alpha_k$. In our usual terminology, the presence of a nonzero $\alpha_k$ represents mispricings in the market, skills of a portfolio manager, or an error in the model that drives returns. Indeed, going way back to tests of flaws in the CAPM, this was exactly what was done. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;In all:&lt;/strong&gt; is &quot;alpha&quot; as understood by academics and practitioners equivalent? &lt;/p&gt;&#xA;" OwnerUserId="17332" LastActivityDate="2015-09-11T21:34:42.710" Title="Interpretation of &quot;alpha&quot; --- industry vs academia" Tags="&lt;factor-models&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20709" PostTypeId="1" AcceptedAnswerId="20710" CreationDate="2015-09-11T22:02:10.643" Score="8" ViewCount="615" Body="&lt;p&gt;I have a question on the following problem from chapter 9 of D. Luenberger, Investment Science, International Edition:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;(Portfolio Optimization)&lt;/p&gt;&#xA;&lt;p&gt;Suppose an investor has utility function &lt;span class=&quot;math-container&quot;&gt;$U$&lt;/span&gt;. There are &lt;span class=&quot;math-container&quot;&gt;$n$&lt;/span&gt; risky assets with rates of return &lt;span class=&quot;math-container&quot;&gt;$r_i$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$i=1,2,...,n$&lt;/span&gt;, and one risk-free asset with rate of return &lt;span class=&quot;math-container&quot;&gt;$r_f$&lt;/span&gt;. The investor has initial wealth &lt;span class=&quot;math-container&quot;&gt;$W_o$&lt;/span&gt;. Suppose that the optimal portfolio for this investor has (random) payoff &lt;span class=&quot;math-container&quot;&gt;$x^*$&lt;/span&gt;. Show that &lt;span class=&quot;math-container&quot;&gt;$$E[U^{'}(x^*)(r_i-r_f)]=0$$&lt;/span&gt; for &lt;span class=&quot;math-container&quot;&gt;$i=1,2,...,n.$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I'm finding this a very hard problem, as I don't see how I can prove this analytically using the formulas for &lt;span class=&quot;math-container&quot;&gt;$E[XY]$&lt;/span&gt; or &lt;span class=&quot;math-container&quot;&gt;$Cov[X,Y]$&lt;/span&gt; in some straightforward way.&lt;/p&gt;&#xA;&lt;p&gt;It is not mentioned whether or not the risky assets are correlated or not which also raises my level of uncertainty about this problem.&lt;/p&gt;&#xA;&lt;p&gt;One thought is that the optimal portfolio should be such that &lt;span class=&quot;math-container&quot;&gt;$U(x^*)$&lt;/span&gt; is maximized, but this does not mean that &lt;span class=&quot;math-container&quot;&gt;$U^{'}(x^*)=0$&lt;/span&gt; even then since &lt;span class=&quot;math-container&quot;&gt;$U$&lt;/span&gt; is monotone increasing.&lt;/p&gt;&#xA;&lt;p&gt;I've tried to look at some simple examples in Excel to see if this identity holds true in practice, but I'm finding it very difficult to show this even if I use some simple utility function like a linear utility function.&lt;/p&gt;&#xA;&lt;p&gt;In fact, if I assume that &lt;span class=&quot;math-container&quot;&gt;$U(x)=x$&lt;/span&gt; as a simple starting step, then &lt;span class=&quot;math-container&quot;&gt;$U^{'}(x)=1$&lt;/span&gt; for all &lt;span class=&quot;math-container&quot;&gt;$x$&lt;/span&gt;, and then the equation would read &lt;span class=&quot;math-container&quot;&gt;$E[r_i-r_f]=0$&lt;/span&gt;, which isn't necessarilly true.&lt;/p&gt;&#xA;&lt;p&gt;I've tried to think about it from a few different angles but I just can't process it. Is there anyone who would know how to show this lemma true or false?&lt;/p&gt;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="17430" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2015-09-14T23:12:14.163" Title="Utility Theory and portfolio optimization - Proof of a lemma" Tags="&lt;portfolio-optimization&gt;&lt;utility-theory&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20710" PostTypeId="2" ParentId="20709" CreationDate="2015-09-11T22:12:28.230" Score="6" Body="&lt;p&gt;This is the well known Euler's equation for optimality. The trick here is to setup the budget constraint correctly. Your initial wealth $W_0$ is irrelevant. The terminal (risky) wealth is, &#xA;$$W = W_0( 1 + \pi_1 (R_1 - r_f) + \ldots + \pi_n (R_n - r_f) )$$ &#xA;(Check that this can be written this way), where $\pi_i \in \mathbf{R}$ is the weight allocated to asset $i$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your optimization problem is then simply maximize expected utility, &#xA;$$ \sup_{ \pi_1, \ldots, \pi_n } E[ U(W) ]$$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take first order conditions above, assuming that you can interchange the order of integration and differentiation (there are technical conditions to ensure that this will hold, and if you want to see the details, &lt;a href=&quot;https://en.wikipedia.org/wiki/Differentiation_under_the_integral_sign&quot;&gt;https://en.wikipedia.org/wiki/Differentiation_under_the_integral_sign&lt;/a&gt;. But in finance, these conditions practically always hold). Once you've done that, you'll see your desired result. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt; Your example of risk neutrality (i.e. $U(x) = x$) is precisely the case when the optimization problem is mute. In this case, when the investor does not care about risk, he will simply invest an infinite amount of wealth into the asset with the highest excess return $E[R_i - r_f]$ and short an infinite amount into everything else. That is why in that special case, your equation will not hold. You need that $U$ is a utility function that represents a risk averse agent.  &lt;/p&gt;&#xA;" OwnerUserId="17332" LastEditorUserId="17332" LastEditDate="2015-09-11T22:18:47.440" LastActivityDate="2015-09-11T22:18:47.440" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="20711" PostTypeId="2" ParentId="20704" CreationDate="2015-09-12T08:11:43.180" Score="1" Body="&lt;p&gt;There is more than one way to construct the portfolio that mimics  the evolution of the Stochastic Discount Factor (SDF). &#xA;In these regards, one of the best references is &lt;a href=&quot;https://workspace.imperial.ac.uk/business-school/Public/people/crobotti/article19.pdf&quot; rel=&quot;nofollow&quot;&gt;Balduzzi&amp;amp;Robotti, Journal of Business &amp;amp; Economic Statistics, 2008&lt;/a&gt; . &lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2015-09-12T08:11:43.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20712" PostTypeId="1" CreationDate="2015-09-12T08:16:32.890" Score="1" ViewCount="55" Body="&lt;p&gt;Any suggestions on compound poisson processes in bets of a customer? &lt;/p&gt;&#xA;" OwnerUserId="17519" LastEditorUserId="17519" LastEditDate="2015-09-21T14:59:48.497" LastActivityDate="2015-09-21T14:59:48.497" Title="Any idea of compound Poisson processes in betting?" Tags="&lt;stochastic-processes&gt;&lt;poisson&gt;" AnswerCount="0" CommentCount="3" ClosedDate="2015-09-21T15:06:18.150" ContentLicense="CC BY-SA 3.0" />
  <row Id="20713" PostTypeId="2" ParentId="20709" CreationDate="2015-09-12T12:11:21.747" Score="2" Body="&lt;p&gt;&lt;em&gt;Edit: The original follow fill in the details answer to my answer by James is still wrong (despite many hints). I'll just go in to fix it to avoid detracting future readers of this post.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;s&gt;Just to fill in the details from the answer that has been accepted already:&lt;/s&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is required to maximize $$\sup_{ \pi_1, \ldots, \pi_n } E[ U(W) ] = \sup_{ \pi_1, \ldots, \pi_n }\;\int ... \int U(W)dF(r_1,\ldots, r_n)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for example in the two asset case the first order condition for $\pi_1$ is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$0 = {\partial \over \partial \pi_1} \int_{\mathbf{R}} \int_{\mathbf{R}} U(W^*)dF(r_1,r_1) \Big\vert_{ \pi_1 = \pi_1^*, \pi_2 = \pi_2^*}$$,&#xA;where $W^*$ is the optimal terminal portfolio, evaluated at the optimal portfolios $\pi_i^*$; in the original problem, this notation would be $x^*$. To be even more explicit, &#xA;$$ W^* = W_0(1 + \pi_1^* (r_1 - r_f) + \pi_2^* (r_2 - r_f) )$$ &#xA;&lt;em&gt;Note to James:&lt;/em&gt; It would be very helpful for your sake if you could understand what is the difference between a random return $R_i$ and its realization $r_i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If one can interchange the order of differentiation and integration, then we can rewrite the FOC as, &#xA;$$ 0 = \int_{\mathbf{R}} \int_{\mathbf{R}}U'(W^*)(r_1-r_f) dF(r_1,r_2)\Big\vert_{ \pi_1 = \pi^*_1, \pi_2 = \pi_2^*}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly for $\pi_1$ this is done.&lt;/p&gt;&#xA;" OwnerUserId="17430" LastEditorUserId="17332" LastEditDate="2015-09-14T23:12:14.163" LastActivityDate="2015-09-14T23:12:14.163" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="20715" PostTypeId="1" AcceptedAnswerId="20766" CreationDate="2015-09-12T18:47:03.370" Score="2" ViewCount="30072" Body="&lt;p&gt;Just read some materials about SVaR. Is there only holding period that changes in comparison to VaR methodology?&lt;/p&gt;&#xA;" OwnerUserId="6599" LastActivityDate="2015-10-04T19:34:03.190" Title="Stressed Value at Risk vs Value at Risk" Tags="&lt;risk-management&gt;&lt;var&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20716" PostTypeId="2" ParentId="20715" CreationDate="2015-09-13T01:01:05.200" Score="5" Body="&lt;p&gt;The most important difference is that the calculations are based on a &quot;stressed&quot; historical period in the markets as opposed to the most recent X number of years.&lt;/p&gt;&#xA;" OwnerUserId="17415" LastActivityDate="2015-09-13T01:01:05.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20717" PostTypeId="1" CreationDate="2015-09-13T01:17:50.143" Score="0" ViewCount="262" Body="&lt;p&gt;Assume that a stock $S_t$ follows simple geometric Brownian motion. Let's say we sold option whose payoff is $f(S_T)$. Now, we are only allowed to trade 2 times in the interval [0,T]. What kind of strategy should we use to minimize the variance of (gains through trading - payoff of option)? This accounts to figuring out 2 Stopping times $T_1 \leq T_2 \leq T$ and the amount to invest in the stock at these times. I tried to solve it by starting with given time $t_1$ and $t_2$ but I did not get far from here. Any help is highly appreciated. Thanks&lt;/p&gt;&#xA;" OwnerUserId="17526" LastEditorUserId="17526" LastEditDate="2015-09-13T01:39:47.503" LastActivityDate="2015-09-13T01:39:47.503" Title="Discrete Hedging of Options" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;optimization&gt;&lt;reference-request&gt;&lt;option-strategies&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20718" PostTypeId="2" ParentId="1135" CreationDate="2015-09-13T05:30:25.710" Score="1" Body="&lt;p&gt;Although binary option is not as liquid and common as European option, it makes perfect sense. There is only two possibility in payoff in your scenario: 100 or nothing. The cost of the option is therefore cheaper than an European option with everything else equal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Binary option can be replicated by two call options around the strike (see diagram). Mathematically, the payoff can be defined by letting h infinitely small, exactly the same logic as @ldnquant has written.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/JvzHB.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/JvzHB.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2015-09-13T05:30:25.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20719" PostTypeId="1" AcceptedAnswerId="20776" CreationDate="2015-09-13T17:05:18.917" Score="2" ViewCount="301" Body="&lt;p&gt;I am struggling with Hull-White model now and have the following question: in the lecture notes under the link below I see how A(t,T) and B(t,T) are being derived. This requires the solution of ordinary differential equations. With B(t,T) it is more or less clear, still I don't understand how the author comes up with the formula (5) which expresses A(t,T). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would be grateful for any hint.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.math.nyu.edu/~benartzi/Slides10.3.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.math.nyu.edu/~benartzi/Slides10.3.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17387" LastEditorUserId="7117" LastEditDate="2016-01-23T17:35:26.780" LastActivityDate="2016-01-23T17:35:26.780" Title="Function A(t,T) in one-factor Hull-White model" Tags="&lt;interest-rates&gt;&lt;hullwhite&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20720" PostTypeId="1" AcceptedAnswerId="20894" CreationDate="2015-09-13T19:53:07.530" Score="4" ViewCount="140" Body="&lt;p&gt;According to John Gregory, &quot;netted positions are inherently more volatile than their underlying gross positions&quot;. Given the context, I think he's talking about close-out netting and not payment netting. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't figure out why the netted position would be more (or for that matter less) volatile.&lt;/p&gt;&#xA;" OwnerUserId="9265" LastActivityDate="2015-09-25T00:03:28.220" Title="Why are netted positions more volatile?" Tags="&lt;counterparty-risk&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20721" PostTypeId="1" AcceptedAnswerId="20722" CreationDate="2015-09-13T20:34:58.840" Score="1" ViewCount="1251" Body="&lt;p&gt;After one day of research i did not figured how to compute the input volatility for PRIVATE COMPANY in order to calculate the PD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My goal is to compute the PD of each of my company in my portfolio, all companies are private companies. To do that i found 2 models that can fit my expectation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Merton's Model and KMV model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Problem for both I cannot figured it out how to calculate the volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your information, I have accounting data at least for 3 years up to 10 years for some companies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could send you my excel sheet if you would like. It is very important for me as it is part of my master thesis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance for your help.&lt;/p&gt;&#xA;" OwnerUserId="17350" LastEditorUserId="17350" LastEditDate="2015-09-13T21:51:24.747" LastActivityDate="2015-09-14T07:23:57.803" Title="How to compute the volatility for the Merton's Model for Private firm?" Tags="&lt;black-scholes&gt;&lt;credit-risk&gt;&lt;black-scholes-merton&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20722" PostTypeId="2" ParentId="20721" CreationDate="2015-09-14T07:23:57.803" Score="3" Body="&lt;p&gt;Accounting data won't work for what you are looking for. The only way to do it is to look to public firms on same industry, similar growth stage, same regulatory/legal challenges and compute the volatility of those and use it as a proxy for your firm. &#xA;It is the best you will be able to get, and it will be a bad approximation. The Merton and KMV models already rely on some non-trivial assumptions. &lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-09-14T07:23:57.803" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20723" PostTypeId="1" AcceptedAnswerId="20729" CreationDate="2015-09-14T13:31:43.003" Score="0" ViewCount="105" Body="&lt;p&gt;Please illustrate that a bond with maturity N years that has coupon equal to its yield is associated with the conversion factor of 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do this by writing out&#xA;$$\frac1{100} \left( \sum_{t=1}^N \left[ \frac{100 (0.06)}{1.06^t} \right]+\frac{100}{1.06^N} \right)$$&#xA;but I do not get that this = 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use the formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sum_{k=m}^n a^k = &#xA;\begin{cases}\frac{a^{n+1} - a^m}{a-1}, \quad &amp;amp;a \neq 1\\n-m+1, \quad &amp;amp;a=1\end{cases}$$&lt;/p&gt;&#xA;" OwnerUserId="12002" LastActivityDate="2015-09-14T22:01:58.293" Title="Conversion factor for bond with coupon=yield" Tags="&lt;bond&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20724" PostTypeId="1" CreationDate="2015-09-14T15:46:36.080" Score="1" ViewCount="85" Body="&lt;p&gt;Not an investment specialist, so please excuse the very basic math.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given a lump sum, I need to distribute this lump sum over (&lt;strong&gt;x&lt;/strong&gt;) segments, each lasting (&lt;strong&gt;y&lt;/strong&gt;) years (years can be different for each segment). Each segment could potentially be deferred from paying out, during which time it will earn (&lt;strong&gt;z&lt;/strong&gt;) interest rate during the deferral period, but once payments begin, will earn (&lt;strong&gt;w&lt;/strong&gt;) interest rate during the payment period (&lt;strong&gt;p&lt;/strong&gt;) years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I assumed was that the amount of money in the first segment, which will have no deferral and start paying immediately, will have a larger portion of the lump sum. Whereas the last segment, which has the greatest deferral time, will get a smaller portion on the lump sum. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my very naive manner, I tried to solve this by doing an average of the number of deferral years (y), an average of (z), (w) and (p) - then I took the lump sum and divided that by (x) number of segments and used that value to calculate a monthly return for that value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To calculate a payment:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;monthly_payment = ((lump_sum / x) * (1 + z)^y) * (1 + w)^p) / (p * 12)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get really close, but the utilization of the lump sum is off by a good 5%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been looking up Optimization and Solvers - but being new to this, I could use a little help in being pointed in the right direction as well as understanding some of the concepts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone give me names of formulae that could solve this or point me in the right direction?&lt;/p&gt;&#xA;" OwnerUserId="17537" LastEditorUserId="17537" LastEditDate="2015-09-17T15:12:49.887" LastActivityDate="2016-02-20T10:57:43.973" Title="Segmented investment to yield same monthly return in each segment" Tags="&lt;optimization&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20725" PostTypeId="1" AcceptedAnswerId="20734" CreationDate="2015-09-14T16:08:42.683" Score="2" ViewCount="519" Body="&lt;p&gt;I am studying for the Society of Actuaries - Exam FM and encountered the following problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/LOI0U.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/LOI0U.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $x$ be the face amount of the 5-year bond and let $y$ be the face amount of the 10-year bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the coupon rate of the 5-year bond is the same as the yield rate, the bond is purchased at face value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first condition of immunization requires that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PV(Assets) = PV(Liabilities) or&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$x + \frac{y}{(1.03)^{20}} = \frac{5000}{(1.03)^{20}} = 3115.83.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second condition of immunization requires that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;MacD(Assets) = MacD(Liabilities).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The duration of a 5-year coupon bond with semi-annual coupons that sells at its par value is $a_{10}\cdot(1.03) = 8.7862$ half-years, or 4.3931 years. ($a_{10}$ is a 10-year annuity immediate).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The duration of the 10-year zero-coupon bond is simply 10 years. The duration of the liability is 8 years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now here is where I am confused. Is duration linear, in the sense that the &quot;total&quot; duration of the assets is the sum of the duration of the individual assets?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would we have MacD(Assets) = MacD(x) + MacD(y)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To meet the second condition, it seems like we have 10 + 4.3931 = 8, which I don't know what to make sense of.&lt;/p&gt;&#xA;" OwnerUserId="5641" LastEditorUserId="5641" LastEditDate="2015-09-14T16:31:50.010" LastActivityDate="2018-03-16T21:09:23.570" Title="A question on immunization and Macaulay duration" Tags="&lt;portfolio-management&gt;&lt;duration&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20726" PostTypeId="1" CreationDate="2015-09-14T18:03:45.527" Score="1" ViewCount="80" Body="&lt;p&gt;I got a seminar topic named Forecasting risk from cross sectional moments? Could at least someone tell me what should I write about and if there is any paper that I could read. Thank you very much in advance.&lt;/p&gt;&#xA;" OwnerUserId="17539" LastActivityDate="2015-09-14T18:03:45.527" Title="Cross-sectional moments" Tags="&lt;risk&gt;&lt;forecasting&gt;&lt;distribution&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20727" PostTypeId="1" CreationDate="2015-09-14T18:19:39.543" Score="8" ViewCount="479" Body="&lt;p&gt;I've read in many places that rehypothecation causes systemic risk (not to be confused with systematic risk), but none offer an explanation. Is this because of the daisy-chain effect that would happen if a posted collateral to b who then posted it to c who then went into bankruptcy leaving A's original collateral tied up in bankruptcy proceedings?&lt;/p&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="20454" LastEditDate="2017-10-09T15:43:26.997" LastActivityDate="2017-10-09T15:43:26.997" Title="How does rehypothecation cause systemic risk?" Tags="&lt;risk&gt;&lt;collateral&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20729" PostTypeId="2" ParentId="20723" CreationDate="2015-09-14T22:01:58.293" Score="2" Body="&lt;p&gt;We are given a bond with Coupon = Yield = $6 \%$ and Maturity $N$. We want to check that the conversion factor = 1, in other words that&#xA;        $$\frac1{100} &#xA;		\left(&#xA;		\frac{100}{1.06^N}     +     &#xA;		\sum_{t=1}^N \frac{100 \cdot 0.06}{1.06^t}&#xA;		\right) &#xA;		= 1 &#xA;		$$&#xA;        or equivalently &#xA;        $$&#xA;				\frac{1}{1.06^N}     +     &#xA;		\sum_{t=1}^N \frac{0.06}{1.06^t}&#xA;		= 1.&#xA;		$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first term is &#xA;$\frac{1}{1.06^N} = &#xA;\left( &#xA;	\frac{1}{1.06} &#xA;\right)^N.$&#xA;The second term can be simplified using the formula for geometric sums&#xA;$$\sum_{t=1}^N &#xA;\frac{0.06}{1.06^t} = &#xA;1  -   \left( &#xA;			\frac{1}{1.06} &#xA;							\right)^N.$$&#xA;Now we add the first term and the second term and see that&#xA;$$\left( &#xA;		\frac{1}{1.06} &#xA;						\right)^N &#xA;\quad + \quad&#xA;1  -   \left( &#xA;			\frac{1}{1.06} &#xA;							\right)^N&#xA;=&#xA;1.&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="12002" LastActivityDate="2015-09-14T22:01:58.293" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20730" PostTypeId="2" ParentId="4440" CreationDate="2015-09-14T23:22:49.133" Score="1" Body="&lt;p&gt;You find the IRC methodology paper written by Tim Xiao at&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2426836&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2426836&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5491" LastActivityDate="2015-09-14T23:22:49.133" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20731" PostTypeId="2" ParentId="11059" CreationDate="2015-09-14T23:25:14.253" Score="1" Body="&lt;p&gt;Here is a new paper written by Tim Xiao at&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2400101&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2400101&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5491" LastActivityDate="2015-09-14T23:25:14.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20734" PostTypeId="2" ParentId="20725" CreationDate="2015-09-15T03:04:33.343" Score="4" Body="&lt;p&gt;Duration is not linear. It is the weighted average of the duration of the underlyings with the weightings being their values. To get a linear system multiply the durations by the associated pvs and match that quantity instead.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-09-15T03:04:33.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20735" PostTypeId="1" AcceptedAnswerId="20762" CreationDate="2015-09-15T11:44:49.927" Score="2" ViewCount="313" Body="&lt;p&gt;If a stock has a process: $dS(t) = sigma*dB(t)$, where $B(t)$ is a standard Brownian motion, and current stock price is $S(0)$. There is a barrier $H&amp;gt;S(0)$. What is the probability that the stock price will breach $H$ before time $T (T&amp;gt;0)$?&lt;/p&gt;&#xA;" OwnerUserId="11917" LastActivityDate="2015-09-16T16:38:48.237" Title="Probability of Stock breaching barrier" Tags="&lt;stochastic-calculus&gt;&lt;probability&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20736" PostTypeId="1" CreationDate="2015-09-15T12:18:06.443" Score="4" ViewCount="216" Body="&lt;p&gt;A rather simple question. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have a portfolio of USD100 in cash. You now take USD10 and buy a derivative that gives you exposure of USD200 to something.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the weighting of cash in the portfolio now: USD90/USD100 or USD90/USD290?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(You want the weight that you would multiply the asset's return by if you were calculating the portfolio's return.)&lt;/p&gt;&#xA;" OwnerUserId="17547" LastEditorUserId="17547" LastEditDate="2015-09-15T12:35:23.527" LastActivityDate="2015-10-15T13:24:40.000" Title="Calculating portfolio weights of derivatives" Tags="&lt;portfolio&gt;&lt;derivatives&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20737" PostTypeId="1" AcceptedAnswerId="20739" CreationDate="2015-09-15T12:32:00.253" Score="1" ViewCount="382" Body="&lt;p&gt;log long return is log((exitprice-fees)/entryprice)  without leverage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;log short return is the negative long return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, from the above I would get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;short return = log(entryprice/(exitprice-fees)). Which doesn't make sence.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, should it be log(entryprice/(exitprice+fees))&#xA;or log((entryprice-fees)/exitprice) ?&lt;/p&gt;&#xA;" OwnerUserId="11635" LastActivityDate="2015-09-15T12:48:18.460" Title="Calculate short log return including fees" Tags="&lt;log-returns&gt;&lt;short-selling&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20738" PostTypeId="2" ParentId="20736" CreationDate="2015-09-15T12:42:37.190" Score="1" Body="&lt;p&gt;You need to calculate your weights using your total exposure, no matter which product you are using. &#xA;In this case, as you said will be 90/290. &lt;/p&gt;&#xA;" OwnerUserId="12089" LastActivityDate="2015-09-15T12:42:37.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20739" PostTypeId="2" ParentId="20737" CreationDate="2015-09-15T12:48:18.460" Score="1" Body="&lt;p&gt;If you are short you need to use log((entryprice-fees)/exitprice). &#xA;It is the same logic as in log long return case. You just need to change your entryprice and exitprice inputs. In this case, entryprice is the selling operation and exitprice will be the buying operation (just the opposite). &lt;/p&gt;&#xA;" OwnerUserId="12089" LastActivityDate="2015-09-15T12:48:18.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20740" PostTypeId="1" AcceptedAnswerId="20761" CreationDate="2015-09-15T13:16:28.607" Score="6" ViewCount="946" Body="&lt;p&gt;Many momentum studies skip the most recent month when calculating momentum to account for &quot;reversal effects.&quot; On the other hand, I've read online that some people get better results from not skipping the most recent month. And some papers seem to skip two months.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What was the first paper to propose the skip-month? Does the momentum effect generally appear stronger across time and across different countries when skipping a month?&lt;/p&gt;&#xA;" OwnerUserId="5251" LastActivityDate="2015-09-16T14:37:39.907" Title="Momentum - skipping the most recent month" Tags="&lt;quant-trading-strategies&gt;&lt;econometrics&gt;&lt;momentum&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20741" PostTypeId="1" AcceptedAnswerId="20780" CreationDate="2015-09-15T15:12:05.710" Score="13" ViewCount="8019" Body="&lt;p&gt;We know linear interpolation is not appropriate for constructing a surface, but why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the book, &quot;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470683686&quot;&gt;Foreign Exchange Option Pricing: A Practitioners Guide&lt;/a&gt;&quot;, the author writes:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;native linear interpolation with regard to time can lead to&#xA;  unrealistic forward volatility dynamics... this implies a negative&#xA;  forward variance between ...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I am not sure I understand the reasoning. Why does linear interpolation imply negative forward volatility ? Can anyone provide a better explanation? Is there any other reason that the simple linear interpolation should not be used?&lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="601" LastEditDate="2015-09-16T01:32:19.643" LastActivityDate="2015-10-05T20:51:38.363" Title="Why linear interpolation not appropriate for volatility surface construction?" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20743" PostTypeId="1" CreationDate="2015-09-15T19:28:42.250" Score="0" ViewCount="170" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Using Macaulay Duration, determine the duration of Bond B if Bond A and B (market value of 600 000 dollars and 400 000 dollars respectively) have a duration of 6.7 years and the duration of A is 8.5 years.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My thinking:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since duration looks at the time of maturity of the bond prices, Bond A and B's duration will be inter-linked. Hence, I will be able to write µ(ab) ≠ µ(a) or µ(b). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if that is the case, then I would be unable to draw a link to the two equations between Bond A and B and Bond A? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is my thinking correct in finding duration of Bond B?&lt;/p&gt;&#xA;" OwnerUserId="17551" LastActivityDate="2015-09-15T20:32:03.793" Title="Macaulay Duration: Duration for 2 bonds" Tags="&lt;duration&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20744" PostTypeId="1" AcceptedAnswerId="24644" CreationDate="2015-09-15T19:49:24.707" Score="4" ViewCount="122" Body="&lt;p&gt;I have two &lt;a href=&quot;https://en.wikipedia.org/wiki/Autoregressive_conditional_heteroskedasticity&quot; rel=&quot;nofollow&quot;&gt;GARCH(1,1) processes&lt;/a&gt; ($q=1,2$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \sigma_{q,t} = \gamma_q + \alpha_q \, \sigma^2_{q,t-1} + \beta_q \, \epsilon^2_{q,t-1} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;that have a constant correlation $\sigma_{12,t} = \rho \, \sigma_{1,t} \, \sigma_{2,t}$.  This is sometimes called a CC-GARCH(1,1).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is a (weighted?) sum of these two processes a GARCH process?  If so, say my weight on the second process is $w_2$ ($w_1=1$) is it possible to calculate $\gamma$, $\alpha$ and $\beta$ for this new process?&lt;/p&gt;&#xA;" OwnerUserId="5689" LastActivityDate="2016-03-01T17:51:59.853" Title="Sum of two GARCH(1,1) Models" Tags="&lt;portfolio-management&gt;&lt;garch&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20745" PostTypeId="2" ParentId="20727" CreationDate="2015-09-15T20:26:13.007" Score="3" Body="&lt;p&gt;With some help of &lt;a href=&quot;https://en.wikipedia.org/wiki/Hypothecation#Rehypothecation&quot; rel=&quot;nofollow&quot;&gt;Wikipedia&lt;/a&gt; I pieced together an answer, the meat is in this &lt;a href=&quot;http://www.imf.org/external/pubs/ft/wp/2010/wp10172.pdf&quot; rel=&quot;nofollow&quot;&gt;IMF paper&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First a definition:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Re-hypothecation occurs when banks or broker-dealers re-use the collateral posted by clients such as hedge funds to back the broker's own trades and borrowing.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Indeed, a daisy chain involving enormous amounts was created before the Lehman collapse as in the UK it is possible to rehypotecate without limit which led to \$1 trillion of original collateral pledges to be transformed in \$4 trillion collateral. The ratio between the transformed collateral and the original factor has a name:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\textrm{Churn Factor} = \frac{\textrm{Transformed collateral}}{\textrm{Original collateral}}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The paper agrees with the @experquisite's suggestion and because of the size of the outstanding collateral and the dependence of the banks on it for funding a real problem was created. In cases of stress systemic risk appears as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Asset values went down because the bubble deflated. Furthermore, the original providers of the collateral demanded that their collateral was not reused by the bank so that their assets would not end up in bankruptcy proceedings. This leads to both a decrease in the original collateral and the churn factor greatly reducing the transformed collateral and thus to a funding crisis for all banks. A systemic crisis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also worth mentioning is that the valuation and legal issues surrounding this collateral can be messy resulting in uncertainty, delays and disputes. For example: two parties disagree about the value of assets (for which there is no liquid market (any more)) and both make claims on each other.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2015-09-15T20:26:13.007" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20746" PostTypeId="2" ParentId="20743" CreationDate="2015-09-15T20:32:03.793" Score="3" Body="&lt;p&gt;Macaulay duration is simply a weighted average. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$MacD(A,B)=\frac{V(A) \cdot MacD(A)+ V(B) \cdot MacD(B)}{V(A)+V(B)}$&lt;/p&gt;&#xA;" OwnerUserId="16351" LastActivityDate="2015-09-15T20:32:03.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20747" PostTypeId="2" ParentId="20659" CreationDate="2015-09-15T20:50:54.480" Score="1" Body="&lt;p&gt;The easiest way is to use a specific holiday code while downloading the schedule from Bloomberg (&quot;cdr = CE&quot;, in the API formula). if not, you might have to rely on wikipedia or other public source, and just remove the holidays from a more complete list. While the date changes every year, the HOLIDAYS doesn't.&lt;/p&gt;&#xA;" OwnerUserId="17552" LastActivityDate="2015-09-15T20:50:54.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20748" PostTypeId="2" ParentId="8896" CreationDate="2015-09-15T22:16:02.773" Score="15" Body="&lt;p&gt;&lt;em&gt;Edit (2016-06-21)&lt;/em&gt;: Now with live data/trading integration with Interactive Brokers.  It has taken a while but it has finally arrived.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit (2017-09-20)&lt;/em&gt;: live data/trading includes Visual Chart and Oanda (legacy accounts), order types, timers and market calendars, update with Python 3.6 and the community and other links updated&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;A (now) very mature (imho) Python backtesting framework is &quot;backtrader&quot;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Home Page: &lt;a href=&quot;https://www.backtrader.com&quot; rel=&quot;noreferrer&quot;&gt;https://www.backtrader.com&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Documentation: &lt;a href=&quot;https://www.backtrader.com/docu&quot; rel=&quot;noreferrer&quot;&gt;https://www.backtrader.com/docu&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Blog: &lt;a href=&quot;https://www.backtrader.com/blog&quot; rel=&quot;noreferrer&quot;&gt;https://www.backtrader.com/blog&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Community: &lt;a href=&quot;https://community.backtrader.com&quot; rel=&quot;noreferrer&quot;&gt;https://community.backtrader.com&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Repository: &lt;a href=&quot;https://github.com/mementum/backtrader&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/mementum/backtrader&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Some features:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Can run in (pseudo)event-mode (called 'next') or (pseudo)vectorized mode (called 'runonce')&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;In &quot;next&quot; mode it can also be configured to work in &quot;exactbars&quot; mode which will keep memory consumption to the minimum (disabling plotting along the way)&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Order/Trade notification to strategies (this obviously is always an event)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Supports CSV (some specific sources and a Generic CSV loader) binary sources (VisualChart, Pandas, Blaze) and online (Yahoo Finance Data - beware of the changes/quirks/problems introduced by Yahoo in 2017)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Data Resampling and Data Replaying&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Mix datas of different timeframes (including a data and its &quot;resampled&quot; counterpart)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Multi-Asset capable&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Multi-Strategy capable&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A fine (imho) broker implementation supporting stocks-like and futures-like (with margin) instruments with user implementable commission schemes if needed, including slippage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The nicest part is cash adjustment for future-like instruments on each bar&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Orders: Market, Limit, Stop, StopLimit, StopTrail, Bracket, OCO, Future-Spot compensation, Market-On-Close&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Sizers for automated staking&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;cheat-on-close and cheat-on-open modes to work with already past prices or prices to come, when not having access to lower resolution data&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Has a comprehensive list of implemented indicators&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Integration with TA-lib&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A few analyzers (AnnualReturn, Sharpe, TradeAnalyzer)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Can optimize strategies and use multiple cores for the task&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Plotting support via Matplotlib (&gt;= 1.4.1) with a high degree of configurability and flexibility (plots look nice)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A text writer for console output of data points (csv) and datas/strategies/indicators/analyzers summaries&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Supports market calendars&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Timers even during backtesting&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Heavy use of metaclasses and operator overloading in order to implement ease of use and a declarative expression approach for the strategy/indicator logic and implementation&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Works with Python 2.7 / 3.2 / 3.3 / 3.4 / 3.5 / 3.6&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Disclosure&lt;/strong&gt;: I am the author having worked during 2015 on this as a hobby project but aiming at making it as feature complete and professional as possible&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is of course left to the reader to decide if the aforementioned statements and goals have been reached&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As mentioned by edouard each framework has its own quirks and I actually started this after toying around with pyAlgoTrade and not really liking the API, which is of course a matter of personal taste. &lt;/p&gt;&#xA;" OwnerUserId="17554" LastEditorUserId="17554" LastEditDate="2017-09-20T10:42:10.260" LastActivityDate="2017-09-20T10:42:10.260" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20749" PostTypeId="1" AcceptedAnswerId="20787" CreationDate="2015-09-15T22:23:24.040" Score="1" ViewCount="769" Body="&lt;p&gt;What is the industry standard way to calculate returns, which will be used to calculate sharpe ratio for e-mini S&amp;amp;P500? &lt;/p&gt;&#xA;" OwnerUserId="17546" LastEditorUserId="3150" LastEditDate="2015-09-18T13:29:48.110" LastActivityDate="2015-09-19T09:01:29.677" Title="How to calculate returns and sharpe ratio for futures?" Tags="&lt;returns&gt;&lt;futures&gt;&lt;sharpe-ratio&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20751" PostTypeId="1" AcceptedAnswerId="20752" CreationDate="2015-09-16T01:54:24.503" Score="0" ViewCount="515" Body="&lt;p&gt;According to Gregory, the most obvious driving force behind credit exposure is future uncertainty. He characterizes the credit exposure of a forward contract as increasing with time; where exposure is at its highest just before maturity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As maturity nears, wouldn't my future uncertainty drop, thus causing exposure to drop?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;EDIT&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just thinking, if we're talking about positive exposure and ignoring negative exposure, might this have something to do with exposure increasing as we get more and more in the money as maturity nears ?&lt;/p&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="9265" LastEditDate="2015-09-16T02:06:36.960" LastActivityDate="2015-09-16T08:05:58.757" Title="Why does the credit exposure of a forward increase with time" Tags="&lt;credit-risk&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20752" PostTypeId="2" ParentId="20751" CreationDate="2015-09-16T08:05:58.757" Score="3" Body="&lt;p&gt;Your edit gets at the heart of the matter.  When you enter a forward contract it generally should be very close to net zero current value.  So credit risk for either side is negligible and should the counterparty immediately default one can likely reenter the desired position with a second counterparty near the desired strike so future uncertainty not a large concern either at least if the market is liquid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, as time progresses your contract may become significantly in the money.  In this case the larger amount owed to you increases the counterparty risk at the same time it increases the chance the counterparty will default as they owe more money in general.  Also, if the position has moved in your favor it is now very hard to take on a contract at a similar strike if the counterparty does default.  This can be devastating if you were counting on these forwards as a hedge.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So while the odds of a counterparty defaulting during the period of the contract decrease over time the pain from a default can increase significantly.  Many forwards contracts will have some (usually banded) mark-to-market accounting to mitigate some of this risk.&lt;/p&gt;&#xA;" OwnerUserId="5689" LastActivityDate="2015-09-16T08:05:58.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20753" PostTypeId="1" AcceptedAnswerId="20794" CreationDate="2015-09-16T09:55:14.857" Score="2" ViewCount="592" Body="&lt;p&gt;I would like to know what are the issues related to a possible &lt;code&gt;CallableFloatingRateBond&lt;/code&gt; class in QuantLib and to have some hints on implementation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My (very obvious) idea is to declare such a class like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;class CallableFloatingRateBond : public FloatingRateBond, public CallableBond&#xA;{&#xA;public:&#xA;  CallableFloatingRateBond();  //ctor&#xA;  virtual ~CallableFloatingRateBond();  //dtor&#xA;protected:&#xA;  // ..?..&#xA;private:&#xA;  // ..?..&#xA;};&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Nevertheless, &lt;code&gt;CallableFixedRateBond&lt;/code&gt; class inherits just from &lt;code&gt;Bond&lt;/code&gt; class through the abstract &lt;code&gt;CallableBond&lt;/code&gt; class, whose purpose seems to be for the most setting up pricing engine and relinkable handles to stuff like Black volatilities and discount curves.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, &lt;code&gt;CallableFixedRateBond&lt;/code&gt; implementation works a lot with &lt;code&gt;PricingEngine::arguments*&lt;/code&gt; to set up cash flows and callability schedule, but this does not involve the issue of an &lt;code&gt;IborIndex&lt;/code&gt; or a &lt;code&gt;SwapIndex&lt;/code&gt; which should be amended along with the short term rate dynamics (e.g. an &lt;code&gt;HullWhite&lt;/code&gt; short rate model discretized by a &lt;code&gt;TreeCallableFixedRateBondEngine&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A different, raw, solution could be to:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;set up a &lt;code&gt;FloatingRateBond&lt;/code&gt; with its &lt;code&gt;CouponPricer&lt;/code&gt;;&lt;/li&gt;&#xA;&lt;li&gt;extract cash flows from this FRN and possible optionlets' prices;&lt;/li&gt;&#xA;&lt;li&gt;set &lt;code&gt;CallableFixedRateBond&lt;/code&gt; cash flows equal to the ones extracted from above;&lt;/li&gt;&#xA;&lt;li&gt;price a &lt;code&gt;CallableFixedRateBond&lt;/code&gt; by using the default implementation;&lt;/li&gt;&#xA;&lt;li&gt;sum optionlet's prices (if any) to 4.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;A &quot;dirty&quot; class like this one could make the job of returning something like an OAS to the user just by shifting up &lt;code&gt;IborIndex&lt;/code&gt;'s / &lt;code&gt;SwapIndex&lt;/code&gt;'s term structure &lt;strong&gt;and&lt;/strong&gt; &lt;code&gt;HullWhite&lt;/code&gt;'s term structure all together, but I am really wondering whether this is theoretically consistent.&lt;/p&gt;&#xA;" OwnerUserId="3058" LastActivityDate="2015-09-18T14:05:41.380" Title="CallableFloatingRateBond in QuantLib: just a matter of multiple inheritance?" Tags="&lt;option-pricing&gt;&lt;fixed-income&gt;&lt;quantlib&gt;&lt;short-rate&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20754" PostTypeId="1" AcceptedAnswerId="20757" CreationDate="2015-09-16T10:35:23.553" Score="1" ViewCount="148" Body="&lt;p&gt;The title of the question says it all. Why can we only apply the method to parabolic PDEs like the heat equation, and not to ordinary PDEs?&lt;/p&gt;&#xA;" OwnerUserId="13457" LastActivityDate="2015-09-16T12:29:44.100" Title="Why can't we use Finite Differences with non-parabolic PDEs?" Tags="&lt;numerical-methods&gt;&lt;black-scholes-pde&gt;&lt;finite-difference-method&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20757" PostTypeId="2" ParentId="20754" CreationDate="2015-09-16T12:29:44.100" Score="3" Body="&lt;p&gt;Who gave you that idea?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You absolutely can use Finite Differences for other PDEs. They are routinely used to solve hyperbolic PDEs (wave equation, both first and second order) and elliptic PDEs (steady state diffusion/heat equation). You can even mix and match the equation types and create PDEs that have characteristic of both hyperbolic and parabolic equations, such as the Navier-Stokes equations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're interested in learning how to implement solvers for these, most numerical fluid mechanics textbooks have a pretty thorough treatment on discretizing PDEs of many types with finite differences.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For reference:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First order wave equation: $\frac{\partial u}{\partial t} + \nabla \cdot(c\,u) = 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second order wave equation: $\frac{\partial^2 u}{\partial^2 t} - c^2 \nabla^2 u = 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Elliptic diffusion: $\nabla^2 u + f = 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Navier Stokes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\rho\left(\frac{\partial\mathbf{u}}{\partial t} + (\mathbf{v}\cdot\nabla)\mathbf{v}\right) = -\nabla{P} + \mu\nabla^2 \mathbf{u}&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="8097" LastActivityDate="2015-09-16T12:29:44.100" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20758" PostTypeId="2" ParentId="20741" CreationDate="2015-09-16T13:25:55.993" Score="3" Body="&lt;p&gt;It implies negative forward &lt;em&gt;variance&lt;/em&gt;. I have the book, and went through the section following your quote. In math terms, he is making a proof by contradiction. He first assumes that you &lt;em&gt;can&lt;/em&gt; interpolate Iinearly, and comes to the conclusion that it is not a good assumption. The argument does involve some calculus. I don't think I have a better explanation, so let me know if you have any questions about his argument.&lt;/p&gt;&#xA;" OwnerUserId="3150" LastActivityDate="2015-09-16T13:25:55.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20759" PostTypeId="1" AcceptedAnswerId="20782" CreationDate="2015-09-16T14:11:48.040" Score="0" ViewCount="154" Body="&lt;p&gt;I am studying financial math and here is a problem and the solution from the author:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Ivjjq.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Ivjjq.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are my calculations:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The short sale is $200\cdot24.82 = 4964$. Now half of this amount will be taken for a haircut and $0.3$% will be taken for a commission. Then we will have (0.5)(0.997)4964 = 2474.55 at t = 0. At t = 3 months, we will have $2474.55e^{0.06 \cdot 0.25} = 2511.95.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Covering the short position at t = 3 requires 200(21.64) = 4328. The close commission is 200(21.64)(0.003) = 12.98.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We will receive the haircut and rebate which will be $4964(0.50)e^{0.04 \cdot 0.25} = 2506.94.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The profit is then 2511.95 - 4328 - 12.98 + 2506.94 = 677.91.&lt;/p&gt;&#xA;" OwnerUserId="5641" LastEditorUserId="848" LastEditDate="2015-09-18T06:15:35.037" LastActivityDate="2015-09-18T06:15:35.037" Title="Where am I making a mistake in my calculation of profit on a short-sale?" Tags="&lt;short-selling&gt;&lt;self-study&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20760" PostTypeId="1" CreationDate="2015-09-16T14:14:09.380" Score="3" ViewCount="264" Body="&lt;p&gt;In the risk neutral version of the Variance Gamma model the stock dynamics are &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S_T=S_0 e^{ (r-q+\omega)t + X(t;\sigma,\nu,\theta)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\omega=\frac{1}{\nu}\ln\left(1-\theta \nu - \frac{\sigma^2 \nu }{2}\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X(t;\sigma,\nu,\theta) = \theta G(t; \nu)+\sigma G(t;\nu)W_t$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;is a Variance Gamma process where $G(t;\nu)$ is a Gamma distribution with mean $t$ and variance $\nu t$, and $W$ is $N(0,1)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the VG process $X(t;\sigma,\nu,\theta)$ $\sigma$ controls the volatility, while $\nu$ and $\theta$ jointly control the  asymmetry and kurtosis. Specifically, if $\theta = 0$, the VG process is symmetric and $\nu$ determines the excess kurtosis, but in other cases both $\nu$ and $\theta$ are joinly needed to obtain the higher moments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I wonder how these interpretations translate to the risk neutral process for $S_T$. In particular:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is there any simple interpretation of how $\sigma$, $\nu$ and $\theta$ affect the risk neutral process? &lt;/li&gt;&#xA;&lt;li&gt;How does $\sigma$, $\nu$ and $\theta$ relate to the four first moments of $S_T$ (or $\frac{ S_T} { S_0}$)? This &lt;a href=&quot;https://mpra.ub.uni-muenchen.de/15395/1/option_pricing_under_the_variance_gamma_process.pdf&quot; rel=&quot;nofollow&quot;&gt;thesis&lt;/a&gt; (pages 31/32) obtains these four moments for $X(t;\sigma,\nu,\theta)$, but I have not seen a similar result for $S_T$ (or $\frac{ S_T} { S_0}$).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5208" LastEditorDisplayName="user16651" LastEditDate="2016-09-07T10:10:04.283" LastActivityDate="2016-09-07T10:31:35.693" Title="Risk Neutral Variance Gamma" Tags="&lt;stochastic-processes&gt;&lt;kurtosis&gt;&lt;variance-gamma&gt;&lt;moments&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20761" PostTypeId="2" ParentId="20740" CreationDate="2015-09-16T14:37:39.907" Score="6" Body="&lt;p&gt;The idea of skipping a month was already in Jegadeesh and Titman 1993.  The key academic paper in this area.     &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Jegadeesh himself (without Titman) discovered a 1-month return REVERSAL effect in 1990, so it makes sense that he would take out 1 month in calculating returns in his later (1993) study. He already knew what happens to stocks that are up a lot over previous month; and wanted to investigate the effect of longer term (3mo, 6mo, 9mo, 12 mo) returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Academic researchers coming after have usually reproduced the Jegadeesh Titman procedure. IMHO that is the way careful research should be done. Of course you can also try minor variants &quot;to see if you can do better&quot; but that adds very little value statistically speaking (i.e. non significant, random variations).&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2015-09-16T14:37:39.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20762" PostTypeId="2" ParentId="20735" CreationDate="2015-09-16T16:38:48.237" Score="2" Body="&lt;p&gt;You can use the reflection principle to solve this problem.&#xA;First you calculate the probability that the Stock will be above the barrier at time T. i.e. $P(S_T &amp;gt; H) = blabla$ (which is easy to calculate since it is just normally distributed). Then via the reflection principle you know that the probability of crossing the barrier between time 0 and T is 2x as big, i.e. $2 blabla$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Reflection_principle_(Wiener_process)&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Reflection_principle_(Wiener_process)&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2015-09-16T16:38:48.237" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20765" PostTypeId="1" AcceptedAnswerId="20768" CreationDate="2015-09-16T23:19:06.840" Score="1" ViewCount="97" Body="&lt;p&gt;I'm working on a simple forecast model that uses Cumulative Annual Growth Rate (CAGR) to project future growth, and I've run into an apparent paradox.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The model includes multiple lines of business that change at different rates. &#xA;I'm ultimately concerned with the projected total of all the lines combined. However I'd also like to project the growth of the individual lines to show how they contribute to the total.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Issue: the sum of individual line projections does not equal the projection of the total.&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example: &lt;pre&gt; &#xA;           2011   2012   2013   2014 |   CAGR    2015(P)&#xA;    Line A  100    200    300    400 |    59%     634.96&#xA;    Line B  100    100    200    300 |    44%     432.67&#xA;    Line C  200    800   1500   2500 |   132%   5,801.99&#xA;    TOTAL   400   1100   2000   3200 |   100%   6,400.00&#xA;&lt;/pre&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CAGR is 2014/2011^(1/3). &#xA;Projected values 2015(P) are found by multiplying the previous year by 1+CAGR.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;2015(P) Line A + Line B + Line C = 6,869.62&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;2015(P) TOTAL = 3200 * (1 + 100%) = 6400&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What accounts for the difference? Is there a way to reconcile the growth rates of the individual lines and the total, or do I just need to pick a level of detail and stick with it? Been banging my head against a wall on this one for a while and any help is appreciated.&lt;/p&gt;&#xA;" OwnerUserId="17562" LastActivityDate="2015-09-17T02:38:48.310" Title="Aggregating growth rates" Tags="&lt;finance&gt;&lt;forecasting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20766" PostTypeId="2" ParentId="20715" CreationDate="2015-09-17T01:11:03.860" Score="3" Body="&lt;p&gt;VaR gives us an idea of possible losses given our current portfolio and the markets as they are today. The idea behind stressed VaR is to get an idea of possible losses given more worse market conditions.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To do this we will &quot;stress&quot; the inputs such as volatilities, interest rates FX rates etc. Thus making them much more unfavorable than they really are. &lt;/p&gt;&#xA;" OwnerUserId="9265" LastActivityDate="2015-09-17T01:11:03.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20767" PostTypeId="1" AcceptedAnswerId="20778" CreationDate="2015-09-17T01:15:30.783" Score="1" ViewCount="839" Body="&lt;p&gt;According to Gregory, the exposure for. the long party of a credit default swap increases in its early years and then skyrockets when there is a credit event of the reference entity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would have suspected the exposure starts off negative and then skyrockets when there is a credit event. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this behaviour related to the theory that default probabilities increase with time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case I misunderstood (I don't think I did), here is the source text&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Consider the exposure profile of a single-name CDS as shown in Figure&#xA;  8.20 (long CDS protection). The exposure increases in the early stages, which corresponds to scenarios in which the CDS premium&#xA;  (credit spread) will have widened. However, the maximum exposure on&#xA;  the CDS corresponds to the reference entity experiencing a credit&#xA;  event, which triggers an immediate payment of the notional less a&#xA;  recovery value&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="9265" LastEditDate="2015-09-17T22:26:28.890" LastActivityDate="2015-09-17T22:26:28.890" Title="Credit exposure of a long CDS" Tags="&lt;credit-risk&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20768" PostTypeId="2" ParentId="20765" CreationDate="2015-09-17T02:38:48.310" Score="1" Body="&lt;p&gt;This is just basic mathematics. Simplify to two business lines just to make the point more transparent. Suppose you have two business lines with initial values $X_0, Y_0$ and terminal values $X_T, Y_T$. Then the sum of the initial values are $X_0 + Y_0$ and the terminal values are $X_T + Y_T$. Let the projected $T+1$ values be $X_{T+1}, Y_{T+1}, (X+Y)_{T+1}$. Then the $T$ period CAGR's are simply &#xA;$$ &#xA;\begin{align} &#xA;CAGR^X &amp;amp;= \left(\frac{X_T}{X_0}\right)^{(1/T)} \\  &#xA;CAGR^Y &amp;amp;= \left(\frac{Y_T}{Y_0}\right)^{(1/T)} \\  &#xA;CAGR^{X+Y} &amp;amp;= \left(\frac{X_T + Y_T}{X_0 + Y_0}\right)^{(1/T)} \\  &#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By your &quot;projection formula&quot;, then &#xA;$$ &#xA;\begin{align} &#xA;X_{T+1} &amp;amp;= (1 + CAGR^X) X_T \\  &#xA;Y_{T+1} &amp;amp;= (1 + CAGR^Y) Y_T \\ &#xA;(X+Y)_{T+1} &amp;amp;= (1 + CAGR^{X+Y}) (X_T + Y_T) \\   &#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly, then, $X_{T+1} + Y_{T+1} \neq (X+Y)_{T+1}$ simply because the CAGR rate computation is not linear in the values argument. &lt;/p&gt;&#xA;" OwnerUserId="17332" LastActivityDate="2015-09-17T02:38:48.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20769" PostTypeId="1" CreationDate="2015-09-17T09:05:27.550" Score="1" ViewCount="70" Body="&lt;p&gt;All the big indexes have well known fairly standard ticker like names, e.g. SPX for the S&amp;amp;P 500.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However there are huge numbers of lesser known indexes (and a huge number of variants on each).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there actual or de-facto standards for identifying indexes, e.g. like CUSIP or ISIN values or ticker/exchange pairs for equities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. if I talk about the Credit Suisse AllHedge index I can find all these variants:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;DJ CS ALL HEDGE&lt;/li&gt;&#xA;&lt;li&gt;DJ CS ALL HEDGE CONVRT ARBITRG&lt;/li&gt;&#xA;&lt;li&gt;DJ CS ALL HEDGE DEDCT SH BIAS&lt;/li&gt;&#xA;&lt;li&gt;DJ CS ALL HEDGE EMER MKTS&lt;/li&gt;&#xA;&lt;li&gt;DJ CS ALL HEDGE EQ MKT NUETRAL&lt;/li&gt;&#xA;&lt;li&gt;DJ CS ALL HEDGE EVENT DRIVEN&lt;/li&gt;&#xA;&lt;li&gt;DJ CS ALL HEDGE FIXED INC ARB&lt;/li&gt;&#xA;&lt;li&gt;DJ CS ALL HEDGE GLOBAL MACRO&lt;/li&gt;&#xA;&lt;li&gt;DJ CS ALL HEDGE L/S EQUITY&lt;/li&gt;&#xA;&lt;li&gt;DJ CS ALL HEDGE MANAGED FUTURS&lt;/li&gt;&#xA;&lt;li&gt;DJ CS ALL HEDGE MULTI-STRATEGY&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Plus, in addition to USD, there are GBP, EUR, CHF and JPY variants of each.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a standard identifier scheme to allow me to be absolutely clear in the above example which variant I'm interested in?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally one that's agreed across index providers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or are we doomed to use names that are subject to personal wording choices, e.g. one person may write &quot;Credit Suisse&quot;, another &quot;CS&quot;, or &quot;AllHedge&quot; instead of &quot;All Hedge&quot; etc?&lt;/p&gt;&#xA;" OwnerUserId="17395" LastActivityDate="2015-09-17T12:49:44.827" Title="Is there a de-facto standard identifier scheme for indexes?" Tags="&lt;index&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20770" PostTypeId="1" CreationDate="2015-09-17T09:50:05.030" Score="1" ViewCount="151" Body="&lt;p&gt;I derived a class template, &lt;code&gt;OISCurve&amp;lt;Traits,Interpolator,Bootstrap&amp;gt;&lt;/code&gt;, from &lt;code&gt;PiecewiseYieldCurve&amp;lt;Traits,Interpolator,Bootstrap&amp;gt;&lt;/code&gt;. The functionality provided by the class works fine as long as i use the default class &lt;code&gt;IterativeBootstrap&lt;/code&gt; as the third template parameter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other side I have implemented a bootstrap algorithm as the &lt;code&gt;calculate()&lt;/code&gt; method of a new class, &lt;code&gt;OISBootstrap&lt;/code&gt;. The implementation follows the structure of the default class &lt;code&gt;IterativeBootstrap&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have also added in my derived class the following friend class as done in the declaration of &lt;code&gt;PiecewiseYieldCurve&amp;lt;Traits,Interpolator,Bootstrap&amp;gt;&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;friend class Bootstrap &amp;lt;PiecewiseYieldCurve&amp;lt;Traits, Interpolator, Bootstrap&amp;gt;&amp;gt;;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;OISBootstrap&lt;/code&gt; needs in fact access to private members of &lt;code&gt;OISCurve&lt;/code&gt;, but also to private members of &lt;code&gt;PiecewiseYieldCurve&lt;/code&gt; and to its derived members as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately I'm still getting compiling errors saying that &lt;code&gt;OISBootstrap&lt;/code&gt; cannot access private/protected members of the classes &lt;code&gt;OISCurve&lt;/code&gt; derives from, like &lt;code&gt;PiecewiseYieldCurve&lt;/code&gt;, &lt;code&gt;InterpolatedCurve&lt;/code&gt; and &lt;code&gt;TermStructure&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; The declaration of friendship in &lt;code&gt;PiecewiseYieldCurve&lt;/code&gt; shouldn't suffice to give access to &lt;code&gt;OISBootstrap&lt;/code&gt; as well? (of course not since i'm getting compiling erros but i hope i made my point)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for the help.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;EDIT&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;OISCurve.h&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;template &amp;lt;class Traits, class Interpolator,&#xA;    template &amp;lt;class&amp;gt; class Bootstrap = IterativeBootstrap&amp;gt;&#xA;class OISCurve : public PiecewiseYieldCurve &amp;lt; Traits, Interpolator, Bootstrap &amp;gt;&#xA;{&#xA;public:&#xA;&#xA;    OISCurve(&#xA;        Natural settlementDays,&#xA;        const Calendar&amp;amp; calendar,&#xA;        const std::vector&amp;lt;boost::shared_ptr&amp;lt;Quote&amp;gt;&amp;gt;&amp;amp; quotes,&#xA;        const DayCounter&amp;amp; dayCounter,&#xA;        Real accuracy,&#xA;        const Interpolator&amp;amp; i = Interpolator(),&#xA;        const Bootstrap&amp;lt;PiecewiseYieldCurve&amp;lt;Traits, Interpolator, Bootstrap&amp;gt;&amp;gt;&amp;amp; bootstrap = Bootstrap&amp;lt;PiecewiseYieldCurve&amp;lt;Traits, Interpolator, Bootstrap&amp;gt;&amp;gt;());&#xA;&#xA;    friend std::vector&amp;lt;boost::shared_ptr&amp;lt;RateHelper&amp;gt;&amp;gt; constructRateHelpers(const std::vector&amp;lt;boost::shared_ptr&amp;lt;Quote&amp;gt;&amp;gt;&amp;amp; quotes);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;OISBootstrap&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;template&amp;lt;class Curve&amp;gt;&#xA;class OISBootstrap&#xA;{&#xA;protected:&#xA;    typedef typename Curve::traits_type Traits;&#xA;    typedef typename Curve::interpolator_type Interpolator;&#xA;&#xA;public:&#xA;    OISBootstrap();&#xA;    void setup(Curve* ts);&#xA;    virtual void calculate() const;&#xA;    virtual ~OISBootstrap();&#xA;&#xA;protected:&#xA;    void initialize() const;&#xA;    void setupHelpers() const;&#xA;    Curve* ts_;&#xA;    Size n_;&#xA;    mutable bool initialized_, validCurve_;&#xA;    mutable Size firstAliveHelper_, alive_;&#xA;    mutable std::vector&amp;lt;Real&amp;gt; previousData_;&#xA;};&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Instantiation&lt;/strong&gt;&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;boost::shared_ptr&amp;lt;YieldTermStructure&amp;gt; oisCurve( new&#xA;            OISCurve&amp;lt;Discount, LogLinear, OISBootstrap&amp;gt;(2, TARGET(), _quotes, Actual360(), 1.0e-12));&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="17408" LastEditorUserId="17408" LastEditDate="2015-09-18T06:54:20.333" LastActivityDate="2015-09-18T06:54:20.333" Title="QuantLib C++: Friendship dilemma between derived class from PiecewiseYieldCurve and Bootstrap class" Tags="&lt;programming&gt;&lt;quantlib&gt;" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="20771" PostTypeId="1" AcceptedAnswerId="20773" CreationDate="2015-09-17T12:24:36.287" Score="4" ViewCount="1149" Body="&lt;p&gt;A European Put Option on a non-dividend paying stock with strike price 80 is currently priced at 8 and a put option on the same stock with strike price 90 is priced at 9. Is there an arbitrage opportunity existing in these two Options?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know we have to used the fact that Put Options values are convex with respect to their Strike Prices and could use the equation $P(\lambda K) &amp;lt; \lambda P(K)$? But, in the solution book that I have, they take $\lambda$ to be 8/9 and I don't know why this is.&lt;/p&gt;&#xA;" OwnerUserId="11917" LastEditorUserId="848" LastEditDate="2015-09-17T12:49:10.853" LastActivityDate="2015-09-17T16:10:47.870" Title="Finding Arbitrage in two Puts" Tags="&lt;arbitrage&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20772" PostTypeId="2" ParentId="20769" CreationDate="2015-09-17T12:49:44.827" Score="3" Body="&lt;p&gt;No there is no &lt;code&gt;&quot;One True Symbology&quot;&lt;/code&gt;.  Infact its even worse as it used to be teh case that some symbologies were proprietary, and we eneded up with Rics, Cusips, Isins, bloomberg tickers, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bloomberg has at least released their open symbology for everyone to use:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://bsym.bloomberg.com/sym/&quot; rel=&quot;nofollow&quot;&gt;http://bsym.bloomberg.com/sym/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Though you could probably say that the move is a bit self serving:).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What ends up happening is that you often resort to using several symbologies,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;1 from from the counterparty you trade with.&lt;/li&gt;&#xA;&lt;li&gt;1 for your back end accounting software&lt;/li&gt;&#xA;&lt;li&gt;1 for your internal tools&lt;/li&gt;&#xA;&lt;li&gt;1 for historical data you get from your data provider(Exchange or data aggregator)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As someone who is a plumber in this industry, I think symbology is one of the worst parts of this industry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;TL/DR Your going to need to be flexible in how you name things as everyone else will want to use a different name for the same instruments.&lt;/p&gt;&#xA;" OwnerUserId="743" LastActivityDate="2015-09-17T12:49:44.827" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20773" PostTypeId="2" ParentId="20771" CreationDate="2015-09-17T15:07:08.723" Score="10" Body="&lt;p&gt;Let $K_1=0$, $K_2=80$, and $K_3=90$. Then&#xA;\begin{align*}&#xA;K_2 = 1/9 \,  K_1 + 8/9 \, K_3.&#xA;\end{align*}&#xA;Moreover,&#xA;\begin{align*}&#xA;Put(K_2) &amp;amp;= Put(1/9 \,  K_1 + 8/9 \, K_3)\\&#xA;&amp;amp;&amp;lt; 1/9 \, Put (K_1) + 8/9\, Put(K_3)\\&#xA;&amp;amp;= 8/9 \, Put(K_3).&#xA;\end{align*}&#xA;Taking $K=K_3$ and $\lambda = 8/9$, we have that&#xA;$$ Put(\lambda K) &amp;lt; \lambda Put(K).$$&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-09-17T16:10:47.870" LastActivityDate="2015-09-17T16:10:47.870" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="20775" PostTypeId="2" ParentId="20724" CreationDate="2015-09-17T16:48:21.863" Score="1" Body="&lt;p&gt;Not 100% sure if i understood your question. But below is solution to what I understood from your explain.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;let $N_i(t)$ be the notional allocated to segment i at time t, i = 1,..., x. &#xA;Suppose segment i is deferred for period $T^{def}_i$ during which it earns interest z. &#xA;Suppose that segment i pays $w_i$ for period $T^{payment}_i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At time t = 0 (now) you have allocated $N_i(0)$ to segment i. After the deferral period ends, the notional  will have grown to:&#xA;$N_i(T^{def}_i) = N_i(0) * exp(z*T^{def}_i)$. This amount will earn the rate $w_i$ going forward.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So at the end of contract segment i will now have accumulated to $N_i(0)  * exp(z*T^{def}_i) * exp(w_i*T^{payment}_i)$. To simplify notation, &#xA;let s define $c_i := exp(z*T^{def}_i) * exp(w_i*T^{payment}_i)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you want is to pick $N_i(0)$ for all i=1,...x in such a way that at the end we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$N_i(0) c_i = N_j(0) c_j$ for all i and j. Furthermore we have the condition that $\sum_{i=1}^x N_i(0) = lumpsum$.&#xA;You want to solve this for $N_i(0)$. What we described above is linear system of the form Ax = b. &#xA;I have provided example of A,x, b in case the number of segments is 3 just as an example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;A =  \left( \begin{array}{ccc}&#xA;1 &amp;amp; 1 &amp;amp; 1 \\&#xA;c_1 &amp;amp; -c_2 &amp;amp; 0 \\&#xA;c_1 &amp;amp; 0 &amp;amp; -c_3 \\&#xA;0 &amp;amp; c2 &amp;amp; -c_3 \end{array} \right) &#xA;\end{equation}&#xA;\begin{equation}&#xA;x =  \left( \begin{array}{c}&#xA;N_1(0)   \\&#xA;N_2(0) \\&#xA;N_3(0) \end{array}\right) &#xA;\end{equation}&#xA;\begin{equation}&#xA;b =  \left( \begin{array}{c} &#xA;lumpsum\\&#xA;0\\&#xA;0\\&#xA;0  \end{array}\right)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution to this system (if it exists) is given by $x = A^{-1}b$. details on matrix algebra and such can be found here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Matrix_(mathematics)&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Matrix_(mathematics)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(edit: added wiki link)&lt;/p&gt;&#xA;" OwnerUserId="17316" LastEditorUserId="17316" LastEditDate="2015-09-23T08:53:56.420" LastActivityDate="2015-09-23T08:53:56.420" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20776" PostTypeId="2" ParentId="20719" CreationDate="2015-09-17T18:54:43.207" Score="1" Body="&lt;p&gt;looks like it comes directly from integration when I look at the slides. As per your slide we have that A(t,T) should satisfy:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$A_t − \theta(t)AB + 0.5 σ^2 AB^2 = 0$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simplifying above condition (by bringing all the A terms to the left side) we get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \frac{1}{A}dA = \theta(t)B - 0.5 σ^2 B^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;now we integrate both sides:&#xA;$ln(A) = -\int_t^T \theta(s)B(s) ds + 0.5 \sigma^2 \int B^2 ds$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;edited the signs of the integrals&lt;/strong&gt;. Note the signs of the integral as we are dealing with a &lt;strong&gt;backward ODE&lt;/strong&gt; instead of a regular forward ODE. This because we have &lt;strong&gt;terminal condition&lt;/strong&gt; A(T,T) and B(T,T) instead of &lt;strong&gt;initial conditions.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You already were able to derive the formula for B. Stick it in and do the integration on the $B^2$ part. that should give you the answer as provided in the slides. &lt;/p&gt;&#xA;" OwnerUserId="17316" LastEditorUserId="17316" LastEditDate="2015-09-19T22:09:02.420" LastActivityDate="2015-09-19T22:09:02.420" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="20777" PostTypeId="1" CreationDate="2015-09-17T19:01:28.670" Score="2" ViewCount="165" Body="&lt;p&gt;Does anyone know if there is a near-realtime machine-readable feed that reflects the FOMC target rate announcement?  The announcement came in today at 2 pm, but I can't find a way to download the revised target rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FWIW, &#xA;here is the calendar: &lt;a href=&quot;http://www.federalreserve.gov/monetarypolicy/fomccalendars.htm&quot; rel=&quot;nofollow&quot;&gt;http://www.federalreserve.gov/monetarypolicy/fomccalendars.htm&lt;/a&gt;&#xA;here is the announcement: &lt;a href=&quot;http://www.federalreserve.gov/newsevents/press/monetary/20150917a.htm&quot; rel=&quot;nofollow&quot;&gt;http://www.federalreserve.gov/newsevents/press/monetary/20150917a.htm&lt;/a&gt;&#xA;Here are the two series (upper/lower bound) on FRED (St. Louis Fed Data engine) but they are updated &quot;next day&quot;: &lt;a href=&quot;https://research.stlouisfed.org/fred2/series/DFEDTARU&quot; rel=&quot;nofollow&quot;&gt;https://research.stlouisfed.org/fred2/series/DFEDTARU&lt;/a&gt; &lt;a href=&quot;https://research.stlouisfed.org/fred2/series/DFEDTARL&quot; rel=&quot;nofollow&quot;&gt;https://research.stlouisfed.org/fred2/series/DFEDTARL&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm hoping for something web-scrapeable from a &quot;federal&quot; source.  The actual latency is not terribly important as long as it's less than a few minutes.&lt;/p&gt;&#xA;" OwnerUserId="13995" LastEditorUserId="13995" LastEditDate="2015-09-17T19:48:35.350" LastActivityDate="2015-12-16T20:54:33.747" Title="Fed FOMC Target Rate annnouncement machine readable data point" Tags="&lt;interest-rates&gt;&lt;market-data&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20778" PostTypeId="2" ParentId="20767" CreationDate="2015-09-17T19:32:03.880" Score="2" Body="&lt;p&gt;The value of a long protection CDS is the value of the protection leg minus the value of the premium leg. As time goes, the premium leg value decreases since the # of premium payments reduces. However, the protection leg value will increase because of the survival probability reduces while the LGD is held the same.The exposure, which is the positive port of the CDS value, will then increase.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-09-17T19:32:03.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20779" PostTypeId="2" ParentId="20777" CreationDate="2015-09-17T19:43:02.123" Score="1" Body="&lt;p&gt;Unsure of any free feeds, but if you have access to bloomberg the tickers for the upper range and lower range are FDTR Index and FDTRFTRL Index respectively. I haven't checked with other providers but I would be very surprised if Reuters did not also provide a similar feed. These tickers update at 2 P.M. however I can't comment on their latency, some discussion of that topic can be found in this  &lt;a href=&quot;https://quant.stackexchange.com/questions/7365/fastest-news-feed-apis-targeting-high-frequency-trading&quot;&gt;thread&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5420" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2015-09-17T19:43:02.123" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20780" PostTypeId="2" ParentId="20741" CreationDate="2015-09-17T19:49:57.967" Score="12" Body="&lt;p&gt;Note that total implied variance defined as &#xA;$$&#xA;  V(T,K) = T\Sigma(T,K)^2 &#xA;$$&#xA;should be an increasing function of $T$. Otherwise you have a calendar arbitrage (sell the call with shorter expiry and buy the cheap longer one).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you interpolate linearly your implied volatility is&#xA;$$&#xA;\Sigma(T,K) = w\Sigma(T_i,K) + (1-w)\Sigma(T_{i+1},K)&#xA;$$&#xA;with weight $w = \frac{T_{i+1}-T}{T_{i+1}-T_i}$. This can also be written &#xA;as&#xA;$$&#xA;\Sigma(T,K) = \Sigma(T_i,K) + s(T-T_i)&#xA;$$ &#xA;with slope $s = (\Sigma(T_{i+1},K)-\Sigma(T_{i},K))/(T_{i+1}-T_i)$. Note that $s$ can be negative, i.e. $\Sigma(T_{i+1},K) &amp;lt; \Sigma(T_{i},K)$ even in an arbitrage-free situation: $V(T_{i+1},K) \ge V(T_{i},K)$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now all you have to do is check for calendar arbitrage:&#xA;$$&#xA;  \partial_T V(T,K) \geq 0 &#xA;$$&#xA;A simple computation will show you that the lhs is a 2nd order polynomial in $T$ and that it can turn negative. &lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2015-10-05T20:51:38.363" LastActivityDate="2015-10-05T20:51:38.363" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20781" PostTypeId="1" CreationDate="2015-09-17T20:29:56.467" Score="7" ViewCount="1604" Body="&lt;p&gt;Is there any usual/best practice to fetch historical fomc meetings events online?&lt;/p&gt;&#xA;" OwnerUserId="8175" LastActivityDate="2015-09-20T16:11:14.120" Title="Where do quants get historical FOMC meetings events for backtesting?" Tags="&lt;data&gt;&lt;fomc&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20782" PostTypeId="2" ParentId="20759" CreationDate="2015-09-17T21:12:40.447" Score="1" Body="&lt;p&gt;You assume that you receive the 6% interest rate on the receivings of the short sale (2474.55) and you assume that you will receive the 4% interest rate on the haircut (2474.55). This is not stated in the question and the only thing you should calculate based on the information in the question is the loss from not being able to receive the 6% interest on the haircut, which is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$2474.55*e^{.06/4}-2474.55e^{.04/4} = 12.53$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By adding the interest proceedings to both the sale proceedings and the haircut you arrive at your answer. The correct answer is indeed A, as given by the author:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;\text{Proceedings: } &amp;amp; 200*24.82*.997 &amp;amp;= 4949.11 \\&#xA;\text{- Interest Loss: } &amp;amp; 2474.55*e^{.06/4}-2474.55e^{.04/4} &amp;amp;= 12.53 \\&#xA;\text{- Close: } &amp;amp; 200*21.64*1.003 &amp;amp;= 4340.98 \\&#xA;\text{Profit: } &amp;amp; 595.60&#xA;\end{align}&lt;/p&gt;&#xA;" OwnerUserId="6886" LastActivityDate="2015-09-17T21:12:40.447" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20783" PostTypeId="1" CreationDate="2015-09-17T21:43:04.240" Score="3" ViewCount="64" Body="&lt;p&gt;suppose I have $N$ models, with returns $r_{n,t}$ over $1,...,T$ periods ($T&amp;gt;&amp;gt;N$). I want to find weights $w_n$ for model $n \in 1,...,N$ such the final model $p$, whose returns will be &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_{p, t} = \sum_{n=1}^{N} w_n * r_{n, t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;has the maximum number of positive days, i.e. I want to maximize &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{\sum_{t=1}^{T} 1\{ r_{p,t} &amp;gt; 0\}}{T}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has can I solve this kind of optimization problem? Does it have a name? Are there any papers written about this?&lt;/p&gt;&#xA;" OwnerUserId="5948" LastActivityDate="2015-09-18T03:08:05.373" Title="optimization to maximize number of positive days" Tags="&lt;portfolio-optimization&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20784" PostTypeId="2" ParentId="20767" CreationDate="2015-09-17T22:15:29.007" Score="0" Body="&lt;p&gt;First, one needs a definition of exposure. I believe in this case the author is referring to &lt;a href=&quot;https://en.m.wikipedia.org/wiki/Potential_future_exposure&quot; rel=&quot;nofollow&quot;&gt;PFE&lt;/a&gt;. If you are long CDS, you are paying premiums to receive protection from default. When default occurs, you receive a payout, and the value of your CDS contract is at a maximum. By definition of PFE, the exposure is at a maximum.&lt;/p&gt;&#xA;" OwnerUserId="3150" LastActivityDate="2015-09-17T22:15:29.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20785" PostTypeId="2" ParentId="20715" CreationDate="2015-09-17T23:03:46.063" Score="0" Body="&lt;p&gt;The idea of historical VaR is that the chosen historical time frame gives the empirical probability distribution of changes in market variables. Generally each day's changes are equally weighted, but you can choose your weighting arbitrarily. See for example Meucci's &lt;a href=&quot;http://www.symmys.com/node/150&quot; rel=&quot;nofollow&quot;&gt;Historical Scenarios with Fully Flexible Probabilities&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3150" LastActivityDate="2015-09-17T23:03:46.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20786" PostTypeId="2" ParentId="20783" CreationDate="2015-09-17T23:32:36.783" Score="-1" Body="&lt;p&gt;I would solve it numerically. You are trying to solve for &lt;em&gt;N&lt;/em&gt; variables, you'll want to specify appropriate (and realistic) constraints such that your optimization procedure converges.&lt;/p&gt;&#xA;" OwnerUserId="3150" LastEditorUserId="3150" LastEditDate="2015-09-18T03:08:05.373" LastActivityDate="2015-09-18T03:08:05.373" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20787" PostTypeId="2" ParentId="20749" CreationDate="2015-09-18T03:52:54.273" Score="1" Body="&lt;p&gt;There's no industry standard for calculating returns on derivative contracts. The reason is that derivative contract assets are different from what I'll call real assets. Examples of real assets are an ounce of gold, or an equity. Derivatives require you to invest, or allocate some amount of cash (i.e. margin), to accommodate losses. But this allocation is basically arbitrary, and depends on what amount of loss you can withstand before you unwind your contract. For more discussion on this topic, read Meucci's &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1675067&quot; rel=&quot;nofollow&quot;&gt;Return Calculations for Leveraged Securities and Portfolios&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="3150" LastEditorUserId="15401" LastEditDate="2015-09-19T09:01:29.677" LastActivityDate="2015-09-19T09:01:29.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20788" PostTypeId="1" CreationDate="2015-09-18T05:03:18.333" Score="4" ViewCount="319" Body="&lt;p&gt;I have been reading online about the FX carry trade and how this can be profitable (in general). From my understanding, the idea is to be long (lend) the currency with higher interest rate and short (borrow) the currency with lower interest rate. This is effectively borrowing at the lower rate and lending at the higher one. However, say that 1 NZD = 1USD today. If yearly interest rates are 10% in NZ and 1% in US, then doesnt that mean that 1 year from now, 1.1 NZD = 1.01 USD so it takes more NZD than before to purchase a single dollar? &lt;/p&gt;&#xA;" OwnerUserId="17136" LastActivityDate="2015-09-18T13:22:36.887" Title="Simple question about FX carry trade" Tags="&lt;interest-rates&gt;&lt;fx&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20789" PostTypeId="2" ParentId="20781" CreationDate="2015-09-18T07:40:23.203" Score="5" Body="&lt;p&gt;You can find information about the meetings online here:&#xA;&lt;a href=&quot;http://www.federalreserve.gov/monetarypolicy/fomccalendars.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.federalreserve.gov/monetarypolicy/fomccalendars.htm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example the following paper backtests certain effects supposedly connected with these meetings and whether they might be exploited:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1923197&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Pre-FOMC Announcement Drift&lt;/a&gt;&lt;br&gt; by David O. Lucca (Federal Reserve Banks - Federal Reserve Bank of New York) and Emanuel Moench (Deutsche Bundesbank), Journal of Finance, Forthcoming FRB of New York Staff Report No. 512, July 26, 2013&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Abstract&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We document large average excess returns on U.S. equities in&#xA;  anticipation of monetary policy decisions made at scheduled meetings&#xA;  of the Federal Open Market Committee (FOMC) in the past few decades.&#xA;  These pre-FOMC returns have increased over time and account for&#xA;  sizable fractions of total annual realized stock returns. While other&#xA;  major international equity indices experienced similar pre-FOMC&#xA;  returns, we find no such effect in U.S. Treasury securities and&#xA;  money market futures. Other major U.S. macroeconomic news&#xA;  announcements also do not give rise to pre-announcement excess equity&#xA;  returns. Pre-FOMC returns are higher in periods when the slope of the&#xA;  Treasury yield curve is low, implied equity market volatility is high,&#xA;  and when past pre-FOMC returns have been high. We discuss challenges&#xA;  at explaining these returns with standard asset pricing theory.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The following chart is taken from the paper:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/KmYmm.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/KmYmm.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2015-09-18T07:45:30.430" LastActivityDate="2015-09-18T07:45:30.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20790" PostTypeId="2" ParentId="20788" CreationDate="2015-09-18T08:52:28.600" Score="1" Body="&lt;p&gt;If you would want to lock in a Forward USDNZD rate then both the 10% and 1% are taken into account like you suggested. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you would enter the fx carry trade like you suggested without trying to lock in a forward rate. Then the spot rate 1 year from now is still a random variable from todays perspective. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might get lucky and the rate does not change, giving you a 9% (10 -1) rate differential. You might get even luckier and the fx spot moves in your favour. Or you might get unlucky. But as said earlier, if you want to remove this randomness of the fx spot by entering into a Fwd you will give up all your interest rate gains as there is no free lunch. &lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2015-09-18T08:52:28.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20792" PostTypeId="2" ParentId="20788" CreationDate="2015-09-18T13:11:40.370" Score="1" Body="&lt;p&gt;You wrote &quot;doesnt that mean that 1 year from now, 1.1 NZD = 1.01 USD&quot;. This is true if the UIP (Uncovered Interest Parity) is true, or in other words if the forward rate is an unbiased predictor of the future exchange. However empirical research has cast doubts on this theoretical proposition. It seems, for reasons that are not entirely clear yet, that high interest rate currencies on average depreciate less than your statement indicates, making the carry trade &lt;em&gt;on average&lt;/em&gt; profitable over long historical periods. [As mbison points out sometimes you lose and sometimes you gain]. A good overview article (though somewhat old) is Froot K.A. and Thaler R.H., 1990.“Foreign Exchange,” Journal of Economic Perspectives,vol 4.pp.179-192. &lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2015-09-18T13:22:36.887" LastActivityDate="2015-09-18T13:22:36.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20794" PostTypeId="2" ParentId="20753" CreationDate="2015-09-18T14:05:41.380" Score="3" Body="&lt;p&gt;No, I don't think the raw solution you sketch is going to work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First and foremost, by extracting the cash flows from the bond you're discarding the dynamics of their rate under the Hull/White model you're using. You should both forecast and discount them on the tree; the way to do it correctly is implemented, e.g., in the &lt;code&gt;DiscretizedSwap&lt;/code&gt; class (and explained at length in &lt;em&gt;&lt;a href=&quot;http://implementingquantlib.com/p/the-book.html&quot; rel=&quot;nofollow&quot;&gt;Implementing QuantLib&lt;/a&gt;&lt;/em&gt;). In your solution, you would underestimate the rates on one side of the tree and overestimate them on the other with respect to the true forecast, which in turn would lead to wrong exercise probabilities if you were to insert them into a &lt;code&gt;CallableFixedRateBond&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, the treatment of the optionlets wouldn't be correct either. On the one hand, you would be already considering optionality during the &lt;code&gt;CallableFixedRateBond&lt;/code&gt; calculation, so you would be putting it in twice. On the other hand, you can't just add optionlets; they're not independent, since calling the bond at one exercise date implies exercising all the optionlets coming after that date, whether any single one is in the money or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In conclusion: sorry, but you'll need a full solution, and that will take some work. You can use &lt;code&gt;CallableFixedRateBond&lt;/code&gt; as a model implementation and look into &lt;code&gt;DiscretizedSwap&lt;/code&gt; for how to model floating payments.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2015-09-18T14:05:41.380" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20795" PostTypeId="1" CreationDate="2015-09-18T14:45:16.873" Score="3" ViewCount="95" Body="&lt;p&gt;I have the following problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us assume that $S_t$, the stock price follows, geometric Brownian moation with parameters $(\mu,\sigma^2)$. We are given an amount of money $M$ and at each point in time $t$ we invest $U_t$ in the stock and put the rest into the bank account with $0$ interest rate. We will trade at $n$ points in time $t_0 &amp;lt; \cdots &amp;lt; t_n = T$. After having done this we have a final value $V_T$ (stock gains and losses and the money on the account).&#xA;We want to choose $(U_{t_i})_{i=0}^{n-1}$ such that in the end at time $T$ we have&#xA;$$&#xA;P[V_T &amp;lt; K] \le \alpha,&#xA;$$&#xA;for some protection level $K$ (e.g. $0.95 * M$) and a probability $\alpha$ (e.g. $0.01$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How is such a problem called in the literature (in continuous time, is it &quot;quantile&quot; hedging?). Can you point to a paper where the solution is described? I assume that this is a rather common problem. Thanks!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I have been discussing this problem with colleagues and we had the feeling that the usual approach of estimating $\sigma$ and finding a solution at point $0$ that is updated either after a fixed period of time or at an event (a sudden drop, or a rise in vol) is not satisfying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can't we incorporate in the solution at time time $0$ that if we lose in the first period then we will reduce risk for the next? Therefore we can take some more risk now. Something like this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or is it really the best solution to take as much risk at time $0$ to stay above $K$ with probabilty $\alpha$ and then just solve for the remaining period after we have seen the outcome at $t_1$? Can we do better? As a first step I mean in the model world.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-09-25T07:21:17.657" LastActivityDate="2015-09-25T07:21:17.657" Title="Portfolio insurance strategy with path dependence" Tags="&lt;portfolio-management&gt;&lt;stochastic-control&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20796" PostTypeId="1" CreationDate="2015-09-18T14:52:24.063" Score="2" ViewCount="362" Body="&lt;p&gt;I guess this a pretty easy question to answer, but I'm not able to get the intuition despite reading the concept a couple of times. So, the Greek Theta is almost always negative, except for when an American Put is deep in the money, the American Puts price may increase as the time to maturity nears and it may also be positive for the case of an American Call on a dividend paying stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, wouldn't this just that it would be optimal to hold the American Put and the American Call on a dividend paying stock up to maturity rather than exercise them early as their values are actually increasing with the passage of time? But in reality we would only exercise an American Put or an American Call on a dividend paying stock prior to maturity, so my intuition is clearly wrong. Please could explain where my logic is failing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank You&lt;/p&gt;&#xA;" OwnerUserId="11917" LastActivityDate="2015-09-18T14:52:24.063" Title="Trying to understand the sign of Theta" Tags="&lt;greeks&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20798" PostTypeId="1" AcceptedAnswerId="20824" CreationDate="2015-09-19T01:14:42.857" Score="1" ViewCount="120" Body="&lt;p&gt;Is it to protect against overfills? Can anyone explain in simple terms?&lt;/p&gt;&#xA;" OwnerUserId="15964" LastEditorUserId="13428" LastEditDate="2015-09-19T09:01:08.757" LastActivityDate="2015-09-21T03:53:51.117" Title="Why some exchanges enforce that you send the total quantity (fill qty + open qty) when changing the order size?" Tags="&lt;exchange&gt;&lt;order-handling&gt;&lt;order&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20799" PostTypeId="1" AcceptedAnswerId="30390" CreationDate="2015-09-19T05:36:43.170" Score="4" ViewCount="656" Body="&lt;p&gt;Suppose I have 2 strategies;&#xA;A) Buying A One Year Bond And Holding To Maturity (Buy &amp;amp; Hold To Maturity)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;B) Buying A 3 Year Bond and Selling After One Year  (Rolling Down The Yield Curve)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume that the 1 year treasury yield to be 0.24%, the two year 0.55%, and 3 year to be .80%. The cost of funding is assumed to be zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;During the next one year, interest rates do not move at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which strategy will be more profitable? Some bond mathematics, if possible, would be useful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand strategy B will be more profitable if interest rates go down later. I am wondering what happens if interest rates remain static.&lt;/p&gt;&#xA;" OwnerUserId="6190" LastEditorUserId="6190" LastEditDate="2015-09-19T06:43:02.113" LastActivityDate="2016-12-19T03:38:19.423" Title="Will rolling-down-yield-curve bond strategy work if interest rates remain unchanged?" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;yield-curve&gt;&lt;bond-yields&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20800" PostTypeId="5" CreationDate="2015-09-19T08:14:27.157" Score="0" Body="&lt;p&gt;R package of Econometric tools for performance and risk analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://cran.r-project.org/web/packages/PerformanceAnalytics/PerformanceAnalytics.pdf&quot; rel=&quot;nofollow&quot;&gt;LIST OF FUNCTIONS&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13428" LastEditorUserId="13428" LastEditDate="2015-09-19T09:01:20.123" LastActivityDate="2015-09-19T09:01:20.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20801" PostTypeId="4" CreationDate="2015-09-19T08:14:27.157" Score="0" Body="R package of Econometric tools for performance and risk analysis." OwnerUserId="13428" LastEditorUserId="13428" LastEditDate="2015-09-19T09:43:45.587" LastActivityDate="2015-09-19T09:43:45.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20803" PostTypeId="1" AcceptedAnswerId="20857" CreationDate="2015-09-19T15:58:07.860" Score="6" ViewCount="619" Body="&lt;p&gt;I am reading this classic paper(&lt;a href=&quot;http://www.business.unr.edu/faculty/liuc/files/BADM742/Jegadeesh_Titman_1993.pdf&quot;&gt;http://www.business.unr.edu/faculty/liuc/files/BADM742/Jegadeesh_Titman_1993.pdf&lt;/a&gt;) and got confused by one of their arguments on their overlapping portfolio strategy to test momentum. They claimed on page 68:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;To  increase  the  power  of  our  tests,  the  strategies  we &#xA;  examine  include  portfolios  with  overlapping  holding  periods.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I don't quite sure why overlapping holding periods increase the power of their statistical test. Can someone please give an intuitive explanation?&lt;/p&gt;&#xA;" OwnerUserId="6804" LastActivityDate="2015-09-23T04:36:15.353" Title="Jegadeesh and Titman 1993 Power of their test" Tags="&lt;portfolio&gt;&lt;asset-pricing&gt;&lt;momentum&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20806" PostTypeId="2" ParentId="20625" CreationDate="2015-09-19T20:06:04.043" Score="5" Body="&lt;p&gt;(I work for Axibase)&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://axibase.com/docs/atsd/finance/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Axibase Time Series Database&lt;/a&gt; is not open-source but it's free on single node.&lt;/p&gt;&#xA;&lt;p&gt;Time precision is microseconds.&lt;/p&gt;&#xA;&lt;p&gt;It supports OLCHV+VWAP aggregators in SQL and REST API with various functions for filtering by trading calendar, auction stages, indices etc.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;SELECT datetime, symbol, close(), vwap()&#xA;  FROM atsd_trade&#xA;WHERE in_index('&amp;lt;index-name&amp;gt;')&#xA;  AND in_session(DAY, CLOSING)&#xA;  AND datetime BETWEEN '2021-01-01' AND '2021-01-15' EXCL&#xA;GROUP BY exchange, class, symbol, PERIOD(1 DAY)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;(I work Axibase)&lt;/p&gt;&#xA;" OwnerUserId="17588" LastEditorUserId="17588" LastEditDate="2021-01-20T18:40:17.433" LastActivityDate="2021-01-20T18:40:17.433" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="20807" PostTypeId="2" ParentId="3156" CreationDate="2015-09-19T20:15:23.217" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://axibase.com/docs/atsd/finance/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Axibase Time Series Database&lt;/a&gt; is free on a single node regardless of RAM, CPU, disk. You can store trades, Level 1 quotes, order book statistics, day/auction summaries and reference data for instruments of various types.&lt;/p&gt;&#xA;&lt;p&gt;Time precision is microseconds.&lt;/p&gt;&#xA;&lt;p&gt;Supports SQL with various functions for filtering by trading calendar, auction stages, indices etc.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;SELECT datetime, symbol, close(), vwap()&#xA;  FROM atsd_trade&#xA;WHERE in_index('&amp;lt;index-name&amp;gt;')&#xA;  AND in_session(DAY, CLOSING)&#xA;  AND datetime BETWEEN '2021-01-01' AND '2021-01-15' EXCL&#xA;GROUP BY exchange, class, symbol, PERIOD(1 DAY)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;(I work Axibase)&lt;/p&gt;&#xA;" OwnerUserId="17588" LastEditorUserId="17588" LastEditDate="2021-01-20T18:41:00.910" LastActivityDate="2021-01-20T18:41:00.910" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="20808" PostTypeId="1" AcceptedAnswerId="20809" CreationDate="2015-09-19T22:45:26.920" Score="0" ViewCount="1141" Body="&lt;p&gt;I want to implement the approach described in the following recipe for calculating VaR: &lt;a href=&quot;https://quant.stackexchange.com/questions/12592/is-there-a-step-by-step-guide-for-calculating-portfolio-var-using-monte-carlo-si&quot;&gt;Is there a step-by-step guide for calculating portfolio VaR using monte carlo simulations&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was told that I can safely assume that $\mu=0$ for stocks when calculating VaR over a short time horizon (1 to 10 days). Is this correct? The reasoning would be that $\sigma$ will be much larger than $\mu$, which will be negligible in comparison (and close to zero). In that case can I simply use $\mu=0$ for stocks and $\mu=r$ for options in the step-by-step approach described in the previous link? Also how should I approximate $\mu$ in the general case if I needed to? Should I use historical stock returns over a period of time (for example 100 days), average it and consider the result as an approximation of $\mu$? &#xA;Thanks for your help!   &lt;/p&gt;&#xA;" OwnerUserId="9249" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2015-09-19T23:02:38.793" Title="Is it OK to consider the expected return is zero for stocks when calculating VaR over a short horizon?" Tags="&lt;var&gt;&lt;expected-return&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20809" PostTypeId="2" ParentId="20808" CreationDate="2015-09-19T22:53:17.720" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Yes, for a short time horizon like 1 - 10 days, assuming $\mu = 0$ is fine. As you'd correctly pointed out, for 1 - 10 days (and referring to the link you'd referenced to), it scales linearly by $T$ (recall that $T$ is an annual number, so convert to a % number in reference to days), but volatility scales by $\sqrt{T}$ and so it is much larger than $T$ for small $T$'s like the time horizon you're considering. This is especially true since you're using a GBM type setup. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It seems to me that you'd be somewhat inconsistent if you use $\mu = 0$ for stocks and yet $\mu = r$ for options, since then your risk premia would be $\mu - r = 0$. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I suppose that that is one approach to estimate $\mu$. However, given that people usually work with risk neutral probabilities when pricing options, and the actual prices you observe are physical probabilities, it is unclear whether that is a good estimate of $\mu$ in general. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="17332" LastEditorUserId="17332" LastEditDate="2015-09-19T23:02:38.793" LastActivityDate="2015-09-19T23:02:38.793" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20810" PostTypeId="2" ParentId="9253" CreationDate="2015-09-20T00:30:42.273" Score="4" Body="&lt;p&gt;An answer has already been accepted, but I'd like to share what I believe is a more intuitive explanation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are many risk neutral probabilities ... probability of a stock going up over period $T-t$, probability of default over $T-t$ etc.&#xA;The intuition is the same behind all of them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In reality, you want to be compensated for taking on risk. This is why corporate bonds are cheaper than government bonds. In risk neutral valuation we pretend that investors are stupid and are willing to take on extra risk for no added compensation. The reason is it make the math easier. The intuition is to follow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Let's consider the probability of a bond defaulting:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Imagine a corporate bond with a real world probability of default of 1%. This 1% is based on the historical probabilities of default for similar grade bonds and obtained form a rating agency. If the bond defaults we get 40% of the par value.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we try to price the bond using only the real world probability of default given above to calculate the expected value of this bond and then present value it, we will come up with the wrong price. In fact, the price will bee too high.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why? Because the bond's price takes into consideration the risk the investor faces and various other factors such as liquidity. We've ignored these and only have part of the picture. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Enter risk-neutral pricing. Instead of trying to figure out these pieces we've ignored, we are simply going to solve for a probability of default that sets PV(expected value) to the current market price. This is called a risk neutral probability. Well, the real world probability of default was 1% and just using that to value the bond overshot the actual price, so clearly our risk-neutral probability needs to be higher than the real world one. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've borrowed my example from this book. I think the author gives the best explanation I've seen &lt;a href=&quot;https://books.google.ca/books?id=6ITOBQAAQBAJ&amp;amp;pg=PA229&amp;amp;lpg=PA229&amp;amp;dq=risk+neutral+credit+spread+vs+actuarial&amp;amp;source=bl&amp;amp;ots=j9o76dQD5e&amp;amp;sig=oN7uV33AsQ3Nf3JahmsFoj6kSe0&amp;amp;hl=en&amp;amp;sa=X&amp;amp;ved=0CCMQ6AEwAWoVChMIqKb7zpqEyAIVxHA-Ch2Geg-B#v=onepage&amp;amp;q=risk%20neutral%20credit%20spread%20vs%20actuarial&amp;amp;f=true&quot; rel=&quot;nofollow&quot;&gt;https://books.google.ca/books?id=6ITOBQAAQBAJ&amp;amp;pg=PA229&amp;amp;lpg=PA229&amp;amp;dq=risk+neutral+credit+spread+vs+actuarial&amp;amp;source=bl&amp;amp;ots=j9o76dQD5e&amp;amp;sig=oN7uV33AsQ3Nf3JahmsFoj6kSe0&amp;amp;hl=en&amp;amp;sa=X&amp;amp;ved=0CCMQ6AEwAWoVChMIqKb7zpqEyAIVxHA-Ch2Geg-B#v=onepage&amp;amp;q=risk%20neutral%20credit%20spread%20vs%20actuarial&amp;amp;f=true&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="9265" LastActivityDate="2015-09-20T00:30:42.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20811" PostTypeId="1" CreationDate="2015-09-20T10:07:54.743" Score="2" ViewCount="122" Body="&lt;p&gt;I'm trying to see how the Euler discretization error behaves with respect to the number of steps. To do this I'm simulating a &lt;a href=&quot;https://en.wikipedia.org/wiki/Geometric_Brownian_motion&quot; rel=&quot;nofollow&quot;&gt;geometric brownian motion&lt;/a&gt; and comparing it with it's 'exact' solution. However when using the root mean squared error as a measure of the error it is increasing with the number of steps, which is very weird! So now I'm confused if I made a coding error or I'm just missing something. Help would be appreciated!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my matlab code, I hope it is self explanatory. (The problem is that the elements of meanvec are increasing while it is expected they decrease)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;X0=100;&#xA;mu=0.04;&#xA;sigma=0.2;&#xA;T=10;&#xA;M=10^5;&#xA;meanvec=zeros(6,1);&#xA;&#xA;for i=1:6&#xA;    N=2^i;&#xA;    dt=T/N;&#xA;&#xA;    t=0;&#xA;    X=X0;&#xA;    for k=1:N&#xA;        dW = sqrt(dt)*randn(M,1);&#xA;        dX = mu*X*dt + sigma*X.*dW;&#xA;        X  = X + dX;&#xA;        t  = t + dt;&#xA;    end&#xA;    Y=100.*exp((mu-sigma^2/2)*T+sigma.*sqrt(T).*randn(M,1));&#xA;&#xA;    meanvec(i)=sqrt(mean((X-Y).^2))/mean(Y);&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="17594" LastEditorUserId="467" LastEditDate="2015-12-21T02:59:30.113" LastActivityDate="2015-12-21T02:59:30.113" Title="Why is my Euler discretization error increasing with number of steps?" Tags="&lt;programming&gt;&lt;stochastic-processes&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20812" PostTypeId="1" CreationDate="2015-09-20T13:57:53.503" Score="1" ViewCount="785" Body="&lt;p&gt;About last week you can see MSFT call &amp;amp; put option appears to be resembling volatility smile. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And then I open trade positions on a 4 MSFT long call option contract (all 4 contract with fixed/same strike) &amp;amp; short stock and dynamically hedge each day (only delta hedging) on that portfolio over 2 weeks but I didn't see any loss on my portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;So what is exactly volatility smile risk people talking about, since I didn't experience any loss on my portfolio?&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;P.S:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My interpretation about the underlying &amp;amp; options with different strike is like this:&#xA;People are assuming the implied volatility is same for all options with different strikes because they're mixing the implied volatility (IV) is same as underlying volatility (UV). If the UV is high, and then the IV must be high too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in reality both underlying &amp;amp; &lt;strong&gt;options with different strikes are traded separately&lt;/strong&gt;, so each options with different strikes must have their own implied volatility.&lt;/p&gt;&#xA;" OwnerUserId="17496" LastEditorUserId="17496" LastEditDate="2015-09-20T14:10:07.267" LastActivityDate="2017-05-17T03:06:30.557" Title="Volatility smile risk (negative effect) on dynamically hedged portfolio?" Tags="&lt;black-scholes&gt;&lt;volatility-smile&gt;&lt;binomial&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20813" PostTypeId="2" ParentId="20811" CreationDate="2015-09-20T14:06:45.013" Score="1" Body="&lt;p&gt;After thinking about it a bit more I realized what the problem is. Y is generated with different increments than X, while I should use the same. I fixed this and know it is decreasing.&lt;/p&gt;&#xA;" OwnerUserId="17594" LastActivityDate="2015-09-20T14:06:45.013" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20814" PostTypeId="1" CreationDate="2015-09-20T15:23:50.733" Score="2" ViewCount="1536" Body="&lt;p&gt;Or should Fama-French only be applied to portfolios?&lt;/p&gt;&#xA;" OwnerUserId="13857" LastActivityDate="2017-07-23T14:58:47.700" Title="Does it make sense to calculate Fama-French betas of a single stock?" Tags="&lt;factor-models&gt;&lt;fama-french&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20815" PostTypeId="2" ParentId="20781" CreationDate="2015-09-20T16:11:14.120" Score="2" Body="&lt;p&gt;The Fed website has all this information. The period 2010 to 2016 is very conveniently laid out here &lt;a href=&quot;http://www.federalreserve.gov/monetarypolicy/fomccalendars.htm&quot; rel=&quot;nofollow&quot;&gt;http://www.federalreserve.gov/monetarypolicy/fomccalendars.htm&lt;/a&gt; [as already noted by vonjd], and meetings from earlier years can be looked up more laboriously here &lt;a href=&quot;http://www.federalreserve.gov/monetarypolicy/fomc_historical.htm&quot; rel=&quot;nofollow&quot;&gt;http://www.federalreserve.gov/monetarypolicy/fomc_historical.htm&lt;/a&gt; . &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I made my own spreadsheet and I just update it once a year when the Fed posts new information.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-09-20T16:11:14.120" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20816" PostTypeId="2" ParentId="3322" CreationDate="2015-09-20T16:57:35.813" Score="4" Body="&lt;p&gt;If both legs are in CNY, you definitely cannot discount using Libor curves. Instead, you need to construct CNY curves with &quot;primary&quot; instruments (deposits, swaps, FRA, futures) which have the best liquidity in the CNY market. As far as I know, some banks use deposit rate up to 1M, fixed-float swap with quarterly payments up to 15Y to bootstrap the discount curve. In this way, your swap will be valued zero at inception (that's how you solve for the discounting factors) and value of swap won't be changed by Libor rates. &lt;/p&gt;&#xA;" OwnerUserId="17593" LastActivityDate="2015-09-20T16:57:35.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20817" PostTypeId="2" ParentId="20814" CreationDate="2015-09-20T17:55:10.997" Score="2" Body="&lt;p&gt;In theory, the Fama-French model --- a linear factor asset pricing model --- applies to ALL assets (in particular, a single stock is a portfolio with one stock as its holding). &lt;/p&gt;&#xA;" OwnerUserId="17332" LastActivityDate="2015-09-20T17:55:10.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20818" PostTypeId="2" ParentId="16048" CreationDate="2015-09-20T18:23:47.460" Score="1" Body="&lt;p&gt;Your discount factors are not inverted properly.  Intuitively, df(0,T) should be a number between 0 and 1.  For example, if r=0 then there is no discount so df = 1.  If r &gt; 0, then discount is going to be less than 1.    &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your formula for df will always be greater than 1.  Check the formula given by the prof on the last slide titled &quot;Term structure of interest rates&quot; for the PDF on linear pricing in week 2.  &lt;/p&gt;&#xA;" OwnerUserId="17598" LastActivityDate="2015-09-20T18:23:47.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20819" PostTypeId="2" ParentId="20814" CreationDate="2015-09-20T19:06:21.820" Score="2" Body="&lt;p&gt;In theory, each cross sectional equilibrium model applies to every single financial asset, therefore to single stocks, bonds, options, other derivatives etc…&#xA;Fama-French’s model doesn’t work when tested on financial assets other than 25 size-value portfolios, as shown &lt;a href=&quot;http://web.mit.edu/lewellen/www/Documents/AssetPricingTests.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; or &lt;a href=&quot;http://www.newyorkfed.org/research/staff_reports/sr464.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. Therefore it’s very likely it won’t hold on single stocks, too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One side note: the reason why cross-sectional models are tested on portfolios is to average out all the noise involved in estimating the betas. But when you construct a portfolio you need to be sure there is a valid reason to believe that it will lead to more stable betas. Check &lt;a href=&quot;https://vimeo.com/14032902&quot; rel=&quot;nofollow&quot;&gt;this lecture by Michael Brandt&lt;/a&gt; in which he discusses about this issue.&lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2015-09-20T19:06:21.820" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20820" PostTypeId="1" CreationDate="2015-09-20T20:24:25.250" Score="0" ViewCount="738" Body="&lt;p&gt;Let's assume&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;I buy 1 call with strike 100 and 1 call with strike 120&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I sell 2 calls with strike 110&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(with same expiration)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder why value of this portfolio is negative at $t=0$? &lt;/p&gt;&#xA;" OwnerUserId="17599" LastActivityDate="2015-09-21T13:20:28.937" Title="Why the value of this portfolio is negative?" Tags="&lt;options&gt;&lt;option-pricing&gt;" AnswerCount="2" CommentCount="1" ClosedDate="2015-09-23T00:40:49.720" ContentLicense="CC BY-SA 3.0" />
  <row Id="20821" PostTypeId="1" AcceptedAnswerId="20833" CreationDate="2015-09-20T20:44:46.317" Score="6" ViewCount="2002" Body="&lt;p&gt;I was of the understanding that risk neutral drift was always the risk free rate. A section from Gregory's book on Credit Value Adjustment seems to say risk neutral drifts are typically estimated from futures. Have I just misunderstood the text (I'm hoping so, because it sounds completely wrong to me)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If risk neutral drifts can be different than the risk free rate and risk neutral drift can be estimated from futures, how then do we observe real world drifts?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an excerpt of the text:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;One area where risk-neutral parameters tend to be used even for risk&#xA;  management simulations is the determination of the drifts of&#xA;  underlying risk factors, which are typically calibrated from forward&#xA;  rates.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;...&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Despite the above problems with drifts, most PFE (potential future&#xA;  exposure) and CVA calculations will calibrate to forward rates in the&#xA;  market. From the CVA point of view, this is justified by hedging. For&#xA;  PFE purposes, this is often done more for convenience’s sake, since it&#xA;  means that simple instruments are by construction priced properly and&#xA;  circumvents the need to attempt to estimate the “real-world” drift of&#xA;  risk factors.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="9265" LastActivityDate="2015-09-21T15:24:24.060" Title="Risk neutral drift vs real world" Tags="&lt;risk&gt;&lt;risk-neutral-measure&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20822" PostTypeId="2" ParentId="20820" CreationDate="2015-09-20T21:00:16.533" Score="-1" Body="&lt;p&gt;This portfolio clearly doesn't have value of $0$ at $t = 0$. Ignoring the fact that you seem to have confused payoffs of option strategies and the value of a portfolio of options, even the payoffs themselves as given here will have state where the payoff is nonzero (i.e. $S_T \in [100,110]$). This by itself ensures that no matter what model you use for asset prices, you'll enjoy a nonnegative value to this portfolio at $t = 0$. &lt;/p&gt;&#xA;" OwnerUserId="17332" LastActivityDate="2015-09-20T21:00:16.533" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20823" PostTypeId="1" CreationDate="2015-09-21T01:59:35.823" Score="9" ViewCount="1147" Body="&lt;p&gt;If I have a simple linear regression that has statistical signification but I would like to improve the overall prediction results. Will a Kalman filter be always an improvement or as least achieve similar results to linear regression?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Relevant Threads:&#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/8501/how-to-tune-kalman-filters-parameter/8512#8512&quot;&gt;How to tune Kalman filter&amp;#39;s parameter?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5861" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2015-09-22T15:15:34.567" Title="Does Kalman filter always improve over linear regression?" Tags="&lt;time-series&gt;&lt;regression&gt;&lt;kalman&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="20824" PostTypeId="2" ParentId="20798" CreationDate="2015-09-21T03:53:51.117" Score="1" Body="&lt;p&gt;Let's say you have an order with 10 shares open. Now you want to cancel it down to 6 shares. If you send just the &lt;strong&gt;open quantity&lt;/strong&gt; you can have the following scenario:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Reduce to 6 sent&lt;/li&gt;&#xA;&lt;li&gt;3 shares got executed by the exchange while the reduce above was in-flight&lt;/li&gt;&#xA;&lt;li&gt;The exchange finally receives and processes the reduce, bringing the open quantity now to 6&lt;/li&gt;&#xA;&lt;li&gt;The remaining 6 shares are executed&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Final situation: your order had 9 shares executed, even thought you wanted to reduce from 10 to 6. That was probably what you did not want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if the exchange is requesting &lt;strong&gt;total quantity&lt;/strong&gt; instead of open quantity:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Reduce to 6 sent&lt;/li&gt;&#xA;&lt;li&gt;3 shares got executed by the exchange while the reduce above was in-flight&lt;/li&gt;&#xA;&lt;li&gt;The exchange finally receives and processes the reduce, bringing the total quantity now to 3 instead of 6. That's because the 6 you sent was the total quantity and since now there are 3 shares executed, the open quantity must be 3 (open quantity = total quantity - executed quantity).&lt;/li&gt;&#xA;&lt;li&gt;The remaining 3 shares are executed  &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The final situation is that your order had 6 shares executed, probably the maximum exposure you wanted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;So total quantity avoids overfills.&lt;/strong&gt; It is a more conservative way to reduce an open order. &lt;/p&gt;&#xA;" OwnerUserId="11804" LastActivityDate="2015-09-21T03:53:51.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20826" PostTypeId="1" AcceptedAnswerId="20827" CreationDate="2015-09-21T06:58:12.733" Score="1" ViewCount="126" Body="&lt;p&gt;Suppose that the Federal Reserve had raised interest rate by 0.25% last week 17Sep2015. What is an estimated rise in the interest rise of the 10-year Treasury? Which futures contract should one use to make this estimation? How does one calculate the estimation?&lt;/p&gt;&#xA;" OwnerUserId="6190" LastActivityDate="2016-10-13T19:52:19.523" Title="What is an estimated rise in the interest rate of the 10-year Treasury in this scenario?" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;bond-futures&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20827" PostTypeId="2" ParentId="20826" CreationDate="2015-09-21T07:40:40.090" Score="2" Body="&lt;p&gt;Not sure this is a quantitative finance question, since it's more or less a judgment call.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no futures contract that you can use to make this estimation; instead, it requires an understanding of the Fed, what's going on in the economy, what's priced in by the market, what's the positioning profile of different players, etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming the Fed hiked, it's not even clear that 10-year Treasury yield would necessarily rise. It may very well be the case that the market becomes so concerned about future growth potential that yield ended up declining.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do want to depend on quantitative methods, the best you can do is to look at how much yields moved during historical hikes. Even this is not reliable. The economic cycles differ; how much of the hike was priced prior to the decision being announced also make a big difference.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2015-09-21T07:40:40.090" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20828" PostTypeId="2" ParentId="20823" CreationDate="2015-09-21T07:53:18.747" Score="6" Body="&lt;p&gt;There is no a &quot;&lt;strong&gt;yes/no answer&lt;/strong&gt;&quot; to that question. Generally Kalman Filter tends to be better than linear regression, but everything depends on &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;the data which you have, &lt;/li&gt;&#xA;&lt;li&gt;how you calibrate your model. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I expect that you have used some library for estimating linear regression parameters. Now you need to think how will you &quot;tune&quot; Kalman filter - the constants F, H, R, Q. &lt;a href=&quot;https://en.wikipedia.org/wiki/Kalman_filter&quot; rel=&quot;nofollow noreferrer&quot;&gt;See Wiki Page of Kalman Filter&lt;/a&gt;. I have asked a&lt;a href=&quot;https://quant.stackexchange.com/questions/19541/how-to-find-optimal-noise-covariance-matrices-q-r&quot;&gt; related question&lt;/a&gt; and Kalman Filter parameters tuning is not as easy as in the linear regression example. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;General rule is - &lt;strong&gt;simple models tends to be better than complicated ones&lt;/strong&gt;. Take a look at the quote from &lt;a href=&quot;https://en.wikipedia.org/wiki/Makridakis_Competitions&quot; rel=&quot;nofollow noreferrer&quot;&gt;Makridakis Competitions&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;The most interesting test of how academic methods fare in the real&#xA;  world was provided by Spyros Makridakis, who spent part of his career&#xA;  managing competitions between forecasters who practice a &quot;scientific&#xA;  method&quot; called econometrics -- an approach that combines economic&#xA;  theory with statistical measurements. Simply put, he made people&#xA;  forecast in real life and then he judged their accuracy. This led to a&#xA;  series of &quot;M-Competitions&quot; he ran, with assistance from Michele Hibon,&#xA;  of which M3 was the third and most recent one, completed in 1999.&#xA;  Makridakis and Hibon reached the sad conclusion that &quot;statistically&#xA;  sophisticated and complex methods do not necessarily provide more&#xA;  accurate forecasts than simpler ones.&quot;&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="5745" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-09-21T07:53:18.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20829" PostTypeId="2" ParentId="20820" CreationDate="2015-09-21T13:20:28.937" Score="1" Body="&lt;p&gt;You need to check them individually and understand how option pricing works. &#xA;Then you will realize that you want to sell 2 put options &lt;em&gt;Deeply in the money&lt;/em&gt;(cheap to buy), buy one call option &lt;em&gt;At the money&lt;/em&gt; (a bit expensive) and finally buy an &quot;Out of the money&quot; call option (cheap). &#xA;So you are trying to finance something a bit expensive by selling something cheap, therefore you need to add some of your cash. &#xA;That is why it is negative. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try to draw, and use numeric examples to understand it. &lt;/p&gt;&#xA;" OwnerUserId="12089" LastActivityDate="2015-09-21T13:20:28.937" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20830" PostTypeId="2" ParentId="1687" CreationDate="2015-09-21T14:36:32.313" Score="3" Body="&lt;p&gt;I don't have a huge amount of market experience, but I have traded heat rate options at a merchant generation company and at an investment bank. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First off, I disagree Sid Jacobson's answer. Or at least I have never seen a contract with those settlement terms trade. Those terms are, for a heat rate call, eg, final settlement: C = P/G - K, which = P/G - HR, where K, the strike is a heat rate. So working from the example given, I'll change it around. Supposed the strike is a 10x heat rate and final settlement is 12x. So to plug in: C = 12 - 10 = &quot;2&quot;. Two what? Two &quot;gases&quot;. Or 2x the final gas price. Ok, that could work, but I've never seen it. But there's lots I probably haven't seen. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I have seen trade between multiple generators and banks is called a heat rate option (but might more sensibly be called a spark spread option, given that the above sounds like what a HR opt should be). Final settlement is: C = P - G*HR - K (well Max(0,...)). Both the heat rate and the strike are fixed in the contract terms. (Strike can be zero or negative. Strike is typically a positive number representing the variable non-fuel/non-commodity costs associated with generation. Sometimes called VOM, I think variable operations and maintenance.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The call has two underlyings, power and gas. In theory, either leg could settle either physically or financially. In practice I've always seen gas settled financially, and the power can be phys or fin. When both are fin, the holder bills the seller for the final settlement amount. When the power leg is phys, the holder takes delivery of power (which they typically will flip with an offsetting trade), and pays G*HR + K, for it. (We could imagine both legs phys, where holder takes power and delivers gas, but I haven't seen it.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The two equations I've compared above can be rearranged into each other. But to speak literally of contract terms, I have only seen the form I give. And I have seen that one many times. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Also, I don't think I've ever seen an exchange listing (nymex/cme, or ICE) for HRO's. I have seem some quotes on broker sheets. It would be nice to have something listed. But I think they haven't been. &lt;/p&gt;&#xA;" OwnerUserId="17605" LastEditorUserId="17605" LastEditDate="2015-09-21T15:53:36.030" LastActivityDate="2015-09-21T15:53:36.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20831" PostTypeId="2" ParentId="20823" CreationDate="2015-09-21T14:40:52.290" Score="1" Body="&lt;p&gt;Yes, linear regression can be cast as a Kalman filter estimate. I believe, D. Simons book &quot;Optimal State Estimation: .. &quot; has all the details. &lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2015-09-21T14:40:52.290" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20832" PostTypeId="1" AcceptedAnswerId="20838" CreationDate="2015-09-21T14:53:44.780" Score="3" ViewCount="827" Body="&lt;p&gt;I'm beginning to use QuantLib with Python SWIG, and trying to build a EUR yield curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I face this error which frankly I don't understand; I looked at the code of bool IMM::isIMMdate in &lt;a href=&quot;https://github.com/lballabio/quantlib/blob/2a5c086844775b6c1b986df2a5631d2ba3b1e6a4/QuantLib/ql/time/imm.cpp&quot; rel=&quot;nofollow&quot;&gt;imm.cpp&lt;/a&gt; and that date shouldn't pose a problem. Other dates may cause trouble because some days are &amp;lt; to 15 and in imm.cpp apparently a future whose expiry date is &amp;lt; 15 isn't a IMM date - well, but still in that case 19th Dec 2016 it should be OK, it's a Euribor future.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   this = _QuantLib.new_FuturesRateHelper(*args)&#xA;   RuntimeError: December 19th, 2016 is not a valid IMM date&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is my piece of code that triggers the error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;print('futures: {}'.format(futures))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It outputs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;futures: {Date(19,12,2016): 100.01, Date(13,6,2016): 100.04, Date(19,9,2016): 100.035, Date(14,3,2016): 100.045, Date(14,12,2015): 100.035, Date(18,9,2017): 99.905, Date(13,3,2017): 99.985, Date(19,6,2017): 99.95}&#xA;&#xA;&#xA;futuresHelpers = [ql.FuturesRateHelper(ql.QuoteHandle(futures[d]),&#xA;                                       d, months,&#xA;                                       calendar, ql.ModifiedFollowing,&#xA;                                       True, dayCounter,&#xA;                                       ql.QuoteHandle(ql.SimpleQuote(0.0)))&#xA;                  for d in futures.keys()]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13678" LastEditorUserId="7202" LastEditDate="2016-02-19T05:25:40.860" LastActivityDate="2016-06-18T06:48:09.333" Title="Quantlib FuturesRateHelper triggers not a valid IMM date error" Tags="&lt;yield-curve&gt;&lt;python&gt;&lt;quantlib&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20833" PostTypeId="2" ParentId="20821" CreationDate="2015-09-21T15:24:24.060" Score="7" Body="&lt;p&gt;The risk neutral drift is the risk free rate for an asset with no dividends, no cost of carry, no repo cost, etc. Otherwise the drift has to be adjusted to take these into account, and the easiest way to do it (when available) is to use forwards (equal to the expected asset value under the forward measure) or futures (equal to the expected asset value under the risk neutral measure). &lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2015-09-21T15:24:24.060" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20834" PostTypeId="1" CreationDate="2015-09-21T15:35:21.407" Score="1" ViewCount="19" Body="&lt;p&gt;I'm working with a very basic basic forecast model using Compound Annual Growth Rate and I need to reconcile the forecasts at different levels of detail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose I have two business lines with initial values $X_0,Y_0$ and terminal values $X_T,Y_T$. Then the sum of the initial values are $X_0+Y_0$ and the terminal values are $X_T+Y_T$. Let their projected $T+1$ values be $X_{T+1},Y_{T+1},(X+Y)_{T+1}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I find the Compound Annual Growth Rate $R$ for each line and the sum of all lines:&#xA;\begin{align} &#xA;R_X &amp;amp;= \left(\frac{X_T}{X_0}\right)^{(1/T)} \\  &#xA;R_Y &amp;amp;= \left(\frac{Y_T}{Y_0}\right)^{(1/T)} \\  &#xA;R_{X+Y} &amp;amp;= \left(\frac{X_T + Y_T}{X_0 + Y_0}\right)^{(1/T)} \\ &#xA;\end{align}&#xA;To project forward one period, I multiply the terminal value of each line and the sum of all lines by their respective $R$ values:&#xA;\begin{align}&#xA;X_{T+1} &amp;amp;= X_T(1+R_X)\\&#xA;Y_{T+1} &amp;amp;= X_T(1+R_Y)\\&#xA;(X+Y)_{T+1} &amp;amp;= (X_T + Y_T) (1 + R_{X+Y})  \\   &#xA;\end{align}&#xA;However, I find that $X_{T+1}+Y_{T+1}\neq(X+Y)_{T+1}$ because the rate computation is not linear in the values argument. I need to work with $(X+Y)_{T+1}$ as is, but I also need to discuss how $X_{T+1}$ and $Y_{T+1}$ individually contribute to the total.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a function $f$ such that:&lt;br&gt;&#xA;$(X_T + Y_T) (1 + R_{X+Y})=X_T(1+f(R_X))+Y_T(1+f(R_Y))$&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="17562" LastActivityDate="2015-09-21T15:35:21.407" Title="Reconciling forecasted growth of components and sum" Tags="&lt;forecasting&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20835" PostTypeId="1" CreationDate="2015-09-21T16:00:04.300" Score="3" ViewCount="489" Body="&lt;p&gt;I am calculating a high-frequency beta. For example I have 90 days of data of the S&amp;amp;P and GOOGLE and I have 10-minute percent returns for each instrument. Each day has 34 10-minute percent returns so my data set is 2 vectors that are both 3060 in length (90 days x 34 10-miunute percent returns each day) = 3060 data points for the S&amp;amp;p and 3060 data points for GOOGLE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next in R I run a regression&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;reg= lm(google~snp) # both the google and snp vector have lenght = 3060&#xA;summary(reg)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My question is that sometimes I get low R-squared for the regression. Is this expected...should/can anything thing be done about it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know beta is usually done using daily data NOT 10-minute data but even with daily data sometimes the r-squared is low. What is the significance of beta with a low r-squared?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="16923" LastActivityDate="2015-09-21T17:27:06.017" Title="What do you do with low r-squared when calculating high-frequency beta" Tags="&lt;r&gt;&lt;correlation&gt;&lt;beta&gt;&lt;capm&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20836" PostTypeId="2" ParentId="20835" CreationDate="2015-09-21T16:29:00.607" Score="2" Body="&lt;p&gt;A high R-squared (1.0) means that you can explain the movements of one time series using the other. The lower your R-squared is, the worse your explanation is -- that includes the 'quality' of your beta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can try to improve your R-squared score using different regression types. Beware of overfitting.&lt;/p&gt;&#xA;" OwnerUserId="16351" LastActivityDate="2015-09-21T16:29:00.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20837" PostTypeId="2" ParentId="20835" CreationDate="2015-09-21T17:27:06.017" Score="3" Body="&lt;p&gt;This simply suggests the linear model is a poor fit in high frequency. But is this that surprising, even before you crunch the numbers? I argue not, for the following reasons: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Even at low frequencies (i.e. monthly or annually), it is known that the classical CAPM (which is what you're running, albeit at a much higher frequency) does not fit well. It'd be a truly miracle that the CAPM model that performs poorly in low frequencies would even work any better in high frequencies. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It is also well known that high frequency financial econometrics exhibit a lot of behavior that are not found in their low frequency equivalents. Just a few to think about --- stochastic volatility, jumps, etc., and these properties of a single asset itself, without regard to how it co-moves with another asset (say S&amp;amp;P). All these imply that a simple linear model is expected to fail. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="17332" LastActivityDate="2015-09-21T17:27:06.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20838" PostTypeId="2" ParentId="20832" CreationDate="2015-09-21T18:08:23.577" Score="0" Body="&lt;p&gt;I think the check is correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From wikipeida:&#xA;&lt;a href=&quot;https://en.wikipedia.org/wiki/IMM_dates&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/IMM_dates&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The IMM dates are the four quarterly dates of each year which most futures contracts and option contracts use as their scheduled maturity date or termination date. The dates are the third Wednesday of March, June, September and December (i.e., between the 15th and 21st, whichever such day is a Wednesday), and IMM stands for the International Monetary Market.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So you have a couple of options:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) use a correct date&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) modify that method so that it always returns true, rebuild quantlib, re-run swig to build the python bindings and go to town.&lt;/p&gt;&#xA;" OwnerUserId="743" LastActivityDate="2015-09-21T18:08:23.577" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20839" PostTypeId="2" ParentId="20823" CreationDate="2015-09-21T18:48:11.930" Score="5" Body="&lt;p&gt;There is no magic in the Kalman Filter. The linear regression model usually assumes the coefficients follow a random walk and as such it essentially boils down to an estimation followed by exponential smoothing of the coefficients.&lt;/p&gt;&#xA;" OwnerUserId="1397" LastActivityDate="2015-09-21T18:48:11.930" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20840" PostTypeId="1" CreationDate="2015-09-21T19:37:37.987" Score="2" ViewCount="283" Body="&lt;p&gt;I have a question about returns when dividends are 'paid'. Firstly, will write down some definitions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $P_t$ be the price of an asset at time t. Assuming no dividends the net return over the holding period from time $t-1$  to time $t$ is \begin{equation} R_t = \dfrac{P_t- P_{t-1}}{P_{t-1}} \end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The gross return is defined as $R_t + 1$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The gross return over the most recent $k$ periods is the the product of the single period gross returns (from time $t-k$ to time $t$) \begin{equation} 1+ R_t(k) =  \dfrac{P_t}{P_{t-k}} = \Big(\dfrac{P_t}{P_{t-1}}\Big)\Big(\dfrac{P_{t-1}}{P_{t-2}}\Big)\cdots \Big(\dfrac{P_{t-k+1}}{P_{t-k}}\Big)   \end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, adjusting for dividends. if a dividend $D_t$  is paid prior to time $t$,then the gross return at time $t$ is defined as \begin{equation}1 + R_t = \dfrac{P_t+ D_t}{P_{t-1}}  \end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what I don't understand: Multiple period gross returns are products of single period gross returns so that: \begin{equation} 1+ R_t(k)= \Big(\dfrac{P_t + D_t}{P_{t-1}}\Big)\Big(\dfrac{P_{t-1}+ D_{t-1}}{P_{t-2}}\Big)\cdots \Big(\dfrac{P_{t-k+1} + P_{t-k+1} }{P_{t-k}}\Big) \end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the last formula(with dividends) $1 +  R_t(k) \neq  \dfrac{P_{t} + D_t}{P_{t-k}}$, as far as I can see, so what is it then?&lt;/p&gt;&#xA;" OwnerUserId="17609" LastEditorUserId="848" LastEditDate="2015-09-21T20:50:13.220" LastActivityDate="2015-09-22T10:31:50.967" Title="Multiperiod return formulae with dividends" Tags="&lt;returns&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20841" PostTypeId="1" AcceptedAnswerId="20845" CreationDate="2015-09-21T20:33:38.000" Score="-3" ViewCount="95" Body="&lt;p&gt;If the EUR/USD exchangerate fell by -0,96%, how much has the USD/EUR exchange rate increased?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to the below charts the number would be +0,97% (currently) but I cant figure out how these number are related.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.ariva.de/euro-dollar-kurs&quot; rel=&quot;nofollow&quot;&gt;EUR/USD&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.ariva.de/usd-eur-us-dollar-euro-kurs&quot; rel=&quot;nofollow&quot;&gt;USD/EUR&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please state a formula to convert the percentage change of USD/EUR to the change of EUR/USD.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2015-09-22T05:47:59.297" Title="Exchange rate conversion" Tags="&lt;fx&gt;&lt;currency&gt;&lt;eurodollars&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="3" ClosedDate="2015-09-23T00:40:22.610" ContentLicense="CC BY-SA 3.0" />
  <row Id="20844" PostTypeId="2" ParentId="20803" CreationDate="2015-09-22T05:37:38.647" Score="4" Body="&lt;p&gt;Non overlapping periods would make for a far smaller sample&lt;/p&gt;&#xA;" OwnerUserId="7682" LastActivityDate="2015-09-22T05:37:38.647" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20845" PostTypeId="2" ParentId="20841" CreationDate="2015-09-22T05:47:59.297" Score="2" Body="&lt;p&gt;I just checked Google Finance and the &lt;code&gt;EUR/USD = 1.1190&lt;/code&gt;.... for arguments sake lets say it goes up by &lt;code&gt;0.10&lt;/code&gt; to &lt;code&gt;1.2190&lt;/code&gt; the percentage change = &lt;code&gt;1.2190/1.1190-1 = +8.94%&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in terms of &lt;code&gt;USD/EUR&lt;/code&gt; the beginning quote would be &lt;code&gt;1/1.1190 = 0.8937&lt;/code&gt; but would be &lt;code&gt;1/1.2190 = 0.8203&lt;/code&gt; after the &lt;code&gt;EUR/USD&lt;/code&gt; went up by &lt;code&gt;0.10&lt;/code&gt;. Therefore the change in terms of &lt;code&gt;USD/EUR = 0.8203/0.8937-1 = -8.21%&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;@AlexC formula explains it best: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;1/(1-0.0821)-1= +8.94%&lt;/code&gt; or &lt;code&gt;1/(1+0.0894)-1= -8.21%&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="13428" LastActivityDate="2015-09-22T05:47:59.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20847" PostTypeId="2" ParentId="20840" CreationDate="2015-09-22T10:31:50.967" Score="2" Body="&lt;p&gt;The correct formula is to compute multi period gross returns as products of single period gross returns. Conceptually it is equivalent to calculating the return on a self-financing portfolio initially made of 1 unit of stock, with each cash dividend reinvested in more stocks at the ex-dividend price. &lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2015-09-22T10:31:50.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20848" PostTypeId="2" ParentId="8700" CreationDate="2015-09-22T17:09:33.817" Score="2" Body="&lt;p&gt;I have budget experience as the lead budget officer in the corporate finance departments in both small and mid-sized private companies. In my experience IRR is not used much in small companies due to the limited number of projects. IRR is used but only by a small group in the Finance department of mid-sized companies, essentially just the budget officer and the CFO. Non-Finance managers find IRR confusing and strongly prefer an undiscounted cash flow analysis combined with payback period calcs mainly due to the difficulty in pegging discount rates for methods like NPV. Another complicating factor is that the return on a project is dependent on lifespan estimates. Accountants like to use fixed asset classes with standard lifespans for simplifying depreciation calcs. Managers looking to get their projects approved often estimate longer than standard lives to improve the return. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ranking new projects that have similar timelines with IRR can be useful for projects near the yes/no cutoff on the much more subjective management popularity scale. &lt;/p&gt;&#xA;" OwnerUserId="17612" LastActivityDate="2015-09-22T17:09:33.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20849" PostTypeId="2" ParentId="18815" CreationDate="2015-09-22T17:39:55.603" Score="1" Body="&lt;p&gt;Model them individualy and as a group. When you model them as a group you are essentially building a stock index that you can compare the performance of individual stocks to and can then calculate a subgroup beta for each stock. You can also calculate a beta coefficient for the group as a whole to the wider market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I assume that you are modeling them with the intention of trading on the prediction output, you need to have a sense of the variance of each stock due to the discrete nature of placing trades. You cannot enter a single trade that buys the whole group, unless the group is already a fund of funds ETF. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To build an index you neeed to include all of the data points anyway. 3780 unique points is simple in post 2007 Excel 64 bit model. A solution with a SQL database in any popular programing language will also make 3780 points seem trivial.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The challenge will be to ensure you normalize price movements for stock splits, dividends, etc over such a long time period.&lt;/p&gt;&#xA;" OwnerUserId="17612" LastActivityDate="2015-09-22T17:39:55.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20850" PostTypeId="1" AcceptedAnswerId="20858" CreationDate="2015-09-22T19:03:11.797" Score="0" ViewCount="973" Body="&lt;p&gt;I've read that leverage is created with the tranches of a CDS index because the more junior tranches have more risk than the index. I get that the more junior the tranche the more the risk,  but I don't see how leverage is created (controlling more with less).&lt;/p&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="9265" LastEditDate="2015-09-22T20:40:08.847" LastActivityDate="2015-09-23T05:55:16.547" Title="How does tranching cause leverage?" Tags="&lt;cds&gt;&lt;leverage&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20851" PostTypeId="2" ParentId="19603" CreationDate="2015-09-22T19:11:47.107" Score="2" Body="&lt;p&gt;I agree with all Robert says above, but if you already have the data, and you want to quickly create a neural network model and run the analysis, I would suggest the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The &lt;a href=&quot;http://heatonresearch.com/encog&quot; rel=&quot;nofollow noreferrer&quot;&gt;Heaton Site&lt;/a&gt; has a Wiki, links to papers, links to books, a forum, etc. that will help you get started, but you might try the PluralSight course &lt;a href=&quot;http://www.pluralsight.com/courses/introduction-to-machine-learning-encog&quot; rel=&quot;nofollow noreferrer&quot;&gt;Introduction to Machine Learning with ENCOG 3&lt;/a&gt; if you want to get up to speed very quickly as this course shows you how to use Heaton's free software to create a neural network model.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://heatonresearch.com/download&quot; rel=&quot;nofollow noreferrer&quot;&gt;Download ENCOG 3&lt;/a&gt; from the Heaton site.  It is a machine learning Framework that runs on a variety of languages (C#, Java, JavaScript, etc.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In a few hours, you can get setup with code that looks something like this and have your first neural network analysis: &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/qy8ir.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/qy8ir.png&quot; alt=&quot;Example of setting up Neural Network with ENCOG&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15302" LastEditorUserId="15302" LastEditDate="2015-09-22T21:53:07.287" LastActivityDate="2015-09-22T21:53:07.287" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20852" PostTypeId="1" CreationDate="2015-09-22T20:13:19.520" Score="0" ViewCount="191" Body="&lt;p&gt;When I am trying to value Binary Option using RQuantLib I am not getting all the greeks for exctype &quot;american&quot; wheras &quot;european&quot; exctype is fine. What is the problem here ?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;boe&amp;lt;-BinaryOption(binType=&quot;asset&quot;, type=&quot;call&quot;, excType=&quot;european&quot;,&#xA;             underlying=100, strike=100, dividendYield=0.02,&#xA;             riskFreeRate=0.03, maturity=0.5, volatility=0.4, cashPayoff=10)&#xA;&amp;gt; boe&#xA;Concise summary of valuation for BinaryOption &#xA;   value    delta    gamma     vega    theta      rho   divRho &#xA; 55.7601   1.9365   0.0060  12.0652  -5.0897  68.9439  -96.8239&#xA;&#xA;boa&amp;lt;-BinaryOption(binType=&quot;asset&quot;, type=&quot;put&quot;, excType=&quot;american&quot;,&#xA;                  underlying=100, strike=100, dividendYield=0.02,&#xA;                  riskFreeRate=0.03, maturity=0.5, volatility=0.4, cashPayoff=10)&#xA;&#xA;&amp;gt; boa&#xA;Concise summary of valuation for BinaryOption &#xA;   value    delta    gamma     vega    theta      rho   divRho&#xA;100.0000   0.4375   0.0032      NaN      NaN      NaN   NaN&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My R version is R-3.0.2 64 bit, RQuantLib 0.4.0(latest),OS Windows 8. Could anyone please give me any other package or library to calculate Binary option in R.If at all nothing in R, Python is ok. Also how we can validate these results ?&#xA;Will these show same value vis-a-vis Bloomberg/Thomson Reuter terminal ? Basically I want to know industry-standard way of validating the results.&lt;/p&gt;&#xA;" OwnerUserId="3456" LastActivityDate="2015-09-23T00:44:05.110" Title="Binary Option valuation problem in R using RQuantLib; also result validation aspect" Tags="&lt;option-pricing&gt;&lt;r&gt;&lt;quantlib&gt;&lt;python&gt;&lt;binary-options&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20853" PostTypeId="1" CreationDate="2015-09-22T21:17:53.333" Score="1" ViewCount="196" Body="&lt;p&gt;I've been stumped on this for awhile now. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to determine the price of a call option on a commodity futures contract that expires in the future. My issue is that while the future's contracts are traded 3 years into the future, the options are only actively traded 6 months into the future. I'd like to determine the price of a call option on a future that expires 1 year from now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried using multiple approaches in R from lognormal curves to exponential and nothing quite cuts it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible? How do traders determine the price of an option with no volume?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any tips, hints, or anything that can lead me into the right direction would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="17621" LastEditorUserId="17622" LastEditDate="2015-09-22T21:38:30.683" LastActivityDate="2016-04-21T20:00:30.960" Title="How do you calculate price of non-existant call option on commodity future" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;commodities&gt;&lt;call&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20854" PostTypeId="2" ParentId="20803" CreationDate="2015-09-22T23:21:38.783" Score="0" Body="&lt;p&gt;I have found a great post here explaining the estimation errors with overlapping portfolio construction. &lt;a href=&quot;http://www.alexchinco.com/standard-error-estimation-with-overlapping-samples/&quot; rel=&quot;nofollow&quot;&gt;http://www.alexchinco.com/standard-error-estimation-with-overlapping-samples/&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have not finished reading yet, but it doesn't seem to address the problem of power of statistical test.&lt;/p&gt;&#xA;" OwnerUserId="6804" LastActivityDate="2015-09-22T23:21:38.783" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20855" PostTypeId="2" ParentId="10329" CreationDate="2015-09-22T23:55:06.550" Score="2" Body="&lt;p&gt;Your solution is an optimization, but your symptom is game theory.&#xA;Managers will maximize their share through gaming by placing emphasis on growing the variables that you use for your allocation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example if you give department A 100,000 because there are 10 employees out of 100 total, the manager will hire another employee at a rate below the marginal increase that they expect to receive at the expense of a cost that you are not including as a variable. If they are the only deparment that increases in employee number, they will receive a 11/100 next quarter leaving 89/100 for the other 6 to share.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to define an allocation basis focusing on outputs rather than inputs. This way a more productive department will receive a larger secondary share and therefore your more productive departments will grow and the less productive departments will shrink. That is fundamental to optimizing ROI for your 1,000,000. If these are all sales or production departments then you can use total sales or contribution margin of products. If you use a total products produced method you need to be sure to monitor inventory fluctuations and penalize for over production to inventory that doesn't sell. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have some internal service departments then you need to determine a fixed portion to feed to the service departments and share out the remainder to the sales/production departments. &lt;/p&gt;&#xA;" OwnerUserId="17612" LastActivityDate="2015-09-22T23:55:06.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20856" PostTypeId="2" ParentId="20852" CreationDate="2015-09-23T00:44:05.110" Score="2" Body="&lt;p&gt;It is all &lt;a href=&quot;https://github.com/eddelbuettel/rquantlib/blob/master/src/barrier_binary.cpp#L100-L106&quot; rel=&quot;nofollow&quot;&gt;in the code:&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Rcpp::List rl = &#xA;  Rcpp::List::create(Rcpp::Named(&quot;value&quot;) = opt.NPV(),&#xA;                     Rcpp::Named(&quot;delta&quot;) = opt.delta(),&#xA;                     Rcpp::Named(&quot;gamma&quot;) = opt.gamma(),&#xA;                     Rcpp::Named(&quot;vega&quot;) = &#xA;                         (excType==&quot;european&quot;) ? opt.vega() : R_NaN,&#xA;                     Rcpp::Named(&quot;theta&quot;) = &#xA;                         (excType==&quot;european&quot;) ? opt.theta() : R_NaN,&#xA;                     Rcpp::Named(&quot;rho&quot;) = &#xA;                         (excType==&quot;european&quot;) ? opt.rho() : R_NaN,&#xA;                     Rcpp::Named(&quot;divRho&quot;) = &#xA;                         (excType==&quot;european&quot;) ? opt.dividendRho() : R_NaN);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For American exercise, QuantLib simply does &lt;strong&gt;not&lt;/strong&gt; provide analytical greeks, and the standard recommendation is to approximate these numerically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your question is not new; this comes up about once a year.  &lt;/p&gt;&#xA;" OwnerUserId="69" LastActivityDate="2015-09-23T00:44:05.110" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20857" PostTypeId="2" ParentId="20803" CreationDate="2015-09-23T04:20:20.327" Score="1" Body="&lt;p&gt;It is due to parameter variation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By overlapping portfolios they can better show that their results are not a one-off result that only works given this very specific set of inputs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without testing with different parameters (stocks, timeframe, etc), results are liable to blow up given a different input.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is not to say using parameter variation always guarantees future results, only that it increases the probability.&lt;/p&gt;&#xA;" OwnerUserId="7256" LastEditorUserId="7256" LastEditDate="2015-09-23T04:36:15.353" LastActivityDate="2015-09-23T04:36:15.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20858" PostTypeId="2" ParentId="20850" CreationDate="2015-09-23T05:15:59.210" Score="2" Body="&lt;p&gt;The leverage is conceptual (as you're not borrowing something to buy more of something in the standard form of leverage). I think it'll become clear when you compare an equity tranche position to a position in the underlying index. An equity tranche on CDX IG, 0-3%, would incur a 26.6% loss if one of the constituents in the underlying index defaults. There are 125 names in the index, each representing 0.8% of the basket. 0.8% / 3% = 26.6%. The underlying index would only suffer a 0.8% loss. This risk asymmetry is why spreads of equity tranches move multiples of moves in the underlying index, and this is called tranche delta. Let's say that multiple is 5x, and we want 100mm of short IG exposure. I can buy 20mm of protection on the IG equity tranche instead of 100mm of the IG index to receive similar economic exposure (obviously with a lot of basis risk). That's where the leverage is.&lt;/p&gt;&#xA;" OwnerUserId="17625" LastEditorUserId="17625" LastEditDate="2015-09-23T05:55:16.547" LastActivityDate="2015-09-23T05:55:16.547" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20859" PostTypeId="2" ParentId="20850" CreationDate="2015-09-23T05:21:54.090" Score="0" Body="&lt;p&gt;Without seeing the source I cannot say for sure this is what they were thinking, but this is a way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can sell the CDS index and buy the junior tranche, where the proceeds from selling the index can be used to pay for the junior. (note this is only possible with special accounts)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say you have 100k.  If you sell 50k worth of the index you now have 50k to play with (courtesy of the buyer who gave it to you) minus your margin*.  Your account value is now 150k minus margin.  You take that 50k and use it to buy the junior which is included in the index. And use the other 100k to do the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;150k position from 100k start.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Leverage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course one must have margin available to run a naked short on practically anything.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;*For the big fish, like market makers, well... they play by different rules ;)&lt;/p&gt;&#xA;" OwnerUserId="7256" LastActivityDate="2015-09-23T05:21:54.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20860" PostTypeId="2" ParentId="20826" CreationDate="2015-09-23T05:27:25.817" Score="1" Body="&lt;p&gt;One thing you could do is look at the fed funds futures curve and look at what maturity has a 25bps hike priced in as a certainty. Then you could look at the 10y future that corresponds to that maturity date and present value it. The difference between that calculated value and the prompt future could be a decent theoretical estimate. I agree with haginile though, this would mainly be a theoretical exercise as there are too many other variables that would change in the event of a surprise hike.&lt;/p&gt;&#xA;" OwnerUserId="17625" LastActivityDate="2015-09-23T05:27:25.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20861" PostTypeId="2" ParentId="19440" CreationDate="2015-09-23T05:40:23.657" Score="-1" Body="&lt;p&gt;If you're calculating trade-level CVA, wouldn't it be the equivalent of calculating CVA as if the trade had a 5y maturity instead of 10y?&lt;/p&gt;&#xA;" OwnerUserId="17625" LastActivityDate="2015-09-23T05:40:23.657" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20862" PostTypeId="1" CreationDate="2015-09-23T05:40:38.927" Score="0" ViewCount="248" Body="&lt;p&gt;Is anybody aware of any papers regarding tick/quote filtering algorithms. I'm aware of the Olsen stuff, but I'd prefer something with fewer free parameters.&lt;/p&gt;&#xA;" OwnerUserId="1397" LastActivityDate="2015-09-23T11:40:14.663" Title="Real-time Tick Filtering" Tags="&lt;tick-data&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20863" PostTypeId="2" ParentId="20812" CreationDate="2015-09-23T05:48:57.733" Score="0" Body="&lt;p&gt;My guess would be that implied vol on your options actually rose over the past week, making your call options more valuable and offsetting some delta hedging friction costs. Without knowing more about your strikes / expiration date, I can't say for sure, but 1m ATM implied vol on MSFT moved up from 26% to 29.5% or so over the past week.&lt;/p&gt;&#xA;" OwnerUserId="17625" LastActivityDate="2015-09-23T05:48:57.733" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20864" PostTypeId="1" CreationDate="2015-09-23T06:19:47.063" Score="4" ViewCount="166" Body="&lt;p&gt;Have anyone managed to automate data consolidation between Reuters and Bloomberg for Options on Futures? Are there any common attributes that these vendors share in this particular asset class that can be used to match the Options?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&#xA;Kishore.&lt;/p&gt;&#xA;" OwnerUserId="17626" LastEditorUserId="1764" LastEditDate="2016-06-21T05:12:02.437" LastActivityDate="2016-06-21T05:12:02.437" Title="Vendor data aggregation for Options on Futures" Tags="&lt;options&gt;&lt;data&gt;&lt;bloomberg&gt;&lt;reuters&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20866" PostTypeId="2" ParentId="20853" CreationDate="2015-09-23T06:53:32.380" Score="0" Body="&lt;p&gt;You need to value your option by using any of the known methods. And then add a spread that will value the risk and the unknown volume. &#xA;This also take us to the point that it will be traded over the counter. That means that will be a bilateral agreement with the two counterparties. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I will do is value it with a similar process to valuing a swaption,  divide the valuing of the option in two parts:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;First, the value of the option after the trading period. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Discount the value of the first step, and then calculate the value of it.(I would use montecarlo for this two steps)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As a summary, I would value it with the same method as a swaption, changing the value of the swap for the value of your option. &lt;/p&gt;&#xA;" OwnerUserId="12089" LastActivityDate="2015-09-23T06:53:32.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20868" PostTypeId="2" ParentId="20862" CreationDate="2015-09-23T11:40:14.663" Score="3" Body="&lt;p&gt;You could try just the basics:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Inversion of bid ask spread (&lt;code&gt;if bid_px &amp;gt;= ask_px&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Unusual prints far out (&lt;code&gt;if bid_px - eps_ticks &amp;lt;= trade_px &amp;lt;= ask_px + eps_ticks&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;li&gt;Time sequencing (&lt;code&gt;if event_time[0] &amp;gt;= event_time[1]&lt;/code&gt;, &lt;code&gt;0&lt;/code&gt; for most recent)&lt;/li&gt;&#xA;&lt;li&gt;Max values (&lt;code&gt;if volume == 2^64-1&lt;/code&gt;)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;There's very few papers out there and I believe all of them are outdated anyway. Some things that used to be positives the past would never happen given the exchange-side technology today and old quote filters would probably give you false positives over artefacts of the modern markets (e.g. fragmented trade reporting).&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2015-09-23T11:40:14.663" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20870" PostTypeId="2" ParentId="8247" CreationDate="2015-09-23T14:39:48.980" Score="8" Body="&lt;p&gt;&quot;Intuitively, everything else being equal, if a stock has higher drift, shouldn't it have higher probability of finishing in-the-money (and higher probability of having higher payoff), and the call option should be worth more?&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All these other answers are focusing on the wrong aspect of the question - it is true that the maths makes the drift drop out from the BS PDE, but that doesn't explain why intuitively that feels wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main reason for this is that you are confusing the &lt;em&gt;investment&lt;/em&gt; thought process with the &lt;em&gt;pricing&lt;/em&gt; thought process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To understand it better, look at it this way: imagine you have two stocks $S_1$ and $S_2$, with different underlying Brownian motions, same sigma, but different drifts $\mu_1$ and $\mu_2$ (say $\mu_1 &amp;gt; \mu_2$). This does not introduce arbitrage, as the underlying Brownian motions are different. Since everything but the drifts is the same, the BS PDE ends up being the same, so &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;the call options on $S_1$ and $S_2$ have the same price, which is the same as saying the drift has no impact on the price.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Your intuition, though, tells you that:&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;the call on $S_1$ should be worth more because there's a higher chance of it expiring in the money (equivalent to saying the drift matters).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Both 1 and 2 are correct, and there is no contradiction between the two. 1. is given by the usual BS logic, where the price is set such that there is no arbitrage and the derivative is perfectly hedged. 2. is given by the process followed in the investment process where what matters is the trade off between risk and reward (or the market price of risk). Because of hedging, the option price does not care about what the trade off between risk and reward is in the market, it is oblivious to any market prices of risk. Since the market price of risk is directly tied to the drift, this should make it clearer why drift does not matter in this world.&lt;/p&gt;&#xA;" OwnerUserId="11861" LastEditorUserId="11861" LastEditDate="2015-09-24T12:32:19.117" LastActivityDate="2015-09-24T12:32:19.117" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20871" PostTypeId="2" ParentId="17162" CreationDate="2015-09-23T17:30:51.730" Score="2" Body="&lt;p&gt;Don't be afraid to use one row in your spreadsheet for each day. Enter the date in column A, then increment the date by 1 day for each row until you reach the end of 10 years. In column B enter the formula &quot;=YEAR(A1)&quot; A1 being the cell with the date in it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then calculate your principal and interest amounts based on the interest rate divided by the total number of days in a year. Becareful to consider how the interest is compounded in the loan and modify the interest rate as required.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will have 6 columns: Date, Year, Principal at start, Interest, Payment, Principal at end. Principal at end is the start plus interest less payment. The principal at the start of the next line is equal to the principal at the end of the previous.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fill these formulas down until the date is equal to the last day, ten years later. 3650 rows plus a row for headers, plus a row for each leap year day Feb 29.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The sum of the interest and payment columns can be used to see what the true cost of the loan was. Alternatively you can use a pivot table to analyze the amount of interest and payment by year.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This sounds like it will take a long time, but it can be done in less than five minutes since all you have to do is set up the first couple rows and then fill it down the sheet. &lt;/p&gt;&#xA;" OwnerUserId="17612" LastActivityDate="2015-09-23T17:30:51.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20872" PostTypeId="1" CreationDate="2015-09-23T18:03:18.683" Score="6" ViewCount="214" Body="&lt;p&gt;In the US banks are required to store 10% of their deposits in cash in the form of Fed Funds. Due to misbalance of demand and supply, some banks borrow such cash from others; the volume averaged overnight rate of borrowing is called effective fed funds rate, currently 0.15. At the same time, whatever banks store in fed funds gets interest on excessive (and required) reserves, which is 0.25. Why some banks choose to lend money to other banks at a lower rate, instead of putting this cash at fed at a higher rate?&lt;/p&gt;&#xA;" OwnerUserId="464" LastEditorUserId="464" LastEditDate="2015-09-24T05:59:12.103" LastActivityDate="2015-09-24T05:59:12.103" Title="Seeming arbitrage in excess reserves" Tags="&lt;fixed-income&gt;&lt;libor&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20873" PostTypeId="2" ParentId="20872" CreationDate="2015-09-23T18:23:27.383" Score="6" Body="&lt;p&gt;Federal Home Loan Banks also hold reserves, but are not eligible to earn IOER, so they lend the cash into the fed funds market at a rate below IOER. U.S. branches of foreign banks, who are eligible to earn IOER, borrow from the FHLBs and deposit the proceeds in their accounts at the Fed, earning the spread. U.S. banks don't participate in this arbitrage because they take in retail deposits and are thus subject to an FDIC fee based on the size of their balance sheets, so they are disincentivized to participate in what is a high-volume, low-return trade.&lt;/p&gt;&#xA;" OwnerUserId="17632" LastActivityDate="2015-09-23T18:23:27.383" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20874" PostTypeId="1" AcceptedAnswerId="20876" CreationDate="2015-09-23T19:16:34.300" Score="8" ViewCount="1280" Body="&lt;p&gt;Assets such as stocks usually display kurtosis in their logarithmic returns. However, their logarithmic returns in a time interval &lt;span class=&quot;math-container&quot;&gt;$n$&lt;/span&gt; are the sum of smaller logarithmic returns in &lt;span class=&quot;math-container&quot;&gt;$1/n$&lt;/span&gt; time intervals. In other words, their return distribution can always be decomposed as the sum of many other distributions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Asset return time series, under the Efficient Market Hypothesis, are martingales: they possess no autocorrelation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the Central Limit Theorem, return distributions of such assets should be normal. Nonetheless, they exhibit kurtosis, which is absent in a normal-distributed variate since the gaussian distribution is zero-valued in all moments beyond the second. Indeed, the presence of kurtosis has been famously pointed as a flaw in Black-Scholes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is: &lt;strong&gt;why is there kurtosis in asset returns?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="17633" LastEditorUserId="17633" LastEditDate="2019-09-03T19:09:22.673" LastActivityDate="2019-09-03T19:09:22.673" Title="Kurtosis in asset logarithmic returns" Tags="&lt;equities&gt;&lt;black-scholes&gt;&lt;martingale&gt;&lt;normal-distribution&gt;&lt;market-efficiency&gt;" AnswerCount="6" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="20875" PostTypeId="2" ParentId="20874" CreationDate="2015-09-23T19:29:59.937" Score="3" Body="&lt;p&gt;I think there are a few conflating ideas here. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;With respect to the sum of logs idea, I think you're thinking about infinitely divisible distributions (&lt;a href=&quot;https://en.wikipedia.org/wiki/Infinite_divisibility_(probability)&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Infinite_divisibility_(probability)&lt;/a&gt;). These ideas are indeed used to build more complicated models (i.e. Levy processes) for asset returns. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With regards to the Efficient Market Hypothesis, I think most people think of them as asset &lt;em&gt;prices&lt;/em&gt; --- under an appropriate measure change --- are martingales (i.e. past history information cannot be used to predict tomorrow's asset price), and not &lt;em&gt;returns&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I'm not why you'd think the central limit theorem here would necessary hold. While there are tons of CLT's out there, having a random variable of the form $S_n = \frac{1}{\sqrt{n}} \sum_{i=1}^n (X_i - E X_i)$ does not necessarily mean that as $n \to \infty$, $S_n$ will converge (in distribution, or some other strong sense of convergence) to a Gaussian random variable.&#xA;Next, the absence of kurtosis in the Black-Scholes is not surprising, especially since the asset prices there follow a geometric Brownian motion (so effectively, each small time interval is Gaussian). But if one replaces the GBM asset price assumption to something else (i.e. Levy models and/or the current literature favorite flavor of Ito semimartingales), then one will definitely generate kurtosis and other higher moment properties. The downside, of course, is that more sophisticated asset pricing models inevitably implies it'll be a challenge to model derivative prices, and/or econometric inference on the underlying parameters. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;But going back to the fundamental question of --- &quot;why is there kurtosis in asset prices / returns&quot; --- this I believe, is at heart a question that's too broad to answer. From a statistical perspective, the response is simply: &quot;it is what it is&quot; and people just build models that build kurtosis into it. From an economics and finance perspective, there are simply too many different theories out there; perhaps the representative agent cares about disaster risks in consumption, or that he has a preference that's state dependent and such macro state variable has some higher order effects. Really, who knows. &lt;/p&gt;&#xA;" OwnerUserId="17332" LastEditorUserId="17332" LastEditDate="2015-09-23T19:49:42.450" LastActivityDate="2015-09-23T19:49:42.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20876" PostTypeId="2" ParentId="20874" CreationDate="2015-09-23T19:38:00.983" Score="4" Body="&lt;p&gt;Generally &lt;strong&gt;Kurtosis&lt;/strong&gt; measures the degree to which a distribution is more or less peaked than a normal distribution. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Positive kurtosis indicates a relatively peaked distribution.&lt;/li&gt;&#xA;&lt;li&gt;Negative kurtosis indicates a relatively flat distribution.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In time series we can encounter high kurtosis which is caused by &lt;a href=&quot;https://en.wikipedia.org/wiki/Fat-tailed_distribution&quot; rel=&quot;nofollow&quot;&gt;&quot;fat tails&lt;/a&gt;&quot; (higher frequencies of outcomes) at the extreme negative and positive ends of the distribution curve. &lt;br&gt;&#xA;They are usually caused by ** a very strong price reaction** to a postive or negative information(bankruptcy, war, ceo resignation). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A distribution of returns exhibiting high kurtosis tends to overestimate the probability of achieving the mean return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;And why Kurtosis exists in log time series?&lt;/strong&gt; &lt;br&gt;&#xA;It exists because many researchers claim that we cannot assume that market is efficient. They lean towards &lt;a href=&quot;http://www.investopedia.com/terms/f/fractal-markets-hypothesis-fmh.asp&quot; rel=&quot;nofollow&quot;&gt;Fractal Market Hypothesis&lt;/a&gt; which explains a  investor behavior throughout a market cycle, including booms and busts (which cause the &quot;fat tails&quot; in the data series). &lt;br&gt; &#xA;Secondly, &lt;strong&gt;FMH&lt;/strong&gt; says that market can have show some dependiences hidden in the time series but they are unstable and often small change in initial conditions of a discovered model can lead to big changes in a forecast. To sum up the deterministic nature of these systems does not make them predictable (&lt;a href=&quot;https://en.wikipedia.org/wiki/Chaos_theory&quot; rel=&quot;nofollow&quot;&gt;Chaos Theory&lt;/a&gt;). &lt;br&gt;&#xA;If you want to learn more about the chaos in the financial markets I can recommend you a book by &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0471585246&quot; rel=&quot;nofollow&quot;&gt;Edgar E. Peters  &quot;Fractal Market Analysis: Applying Chaos Theory to Investment and Economics&quot;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5745" LastActivityDate="2015-09-23T19:38:00.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20877" PostTypeId="2" ParentId="20864" CreationDate="2015-09-23T19:52:08.763" Score="1" Body="&lt;p&gt;I think the best you may be able to do here is creating your own unique identifier in your code based off underlying, maturity date, put or call, and strike price, and then match the two data sources on that key. The only identifier Bloomberg seems to have for options on futures is their FIGI number, and I'm doubtful that Reuters supports that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example key with common attributes you could create in your code: CLX5 10/15/15 C44.0. WTI crude oil call option expiring in October struck at 44.&lt;/p&gt;&#xA;" OwnerUserId="17625" LastEditorUserId="17625" LastEditDate="2015-09-23T20:03:42.723" LastActivityDate="2015-09-23T20:03:42.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20879" PostTypeId="1" CreationDate="2015-09-23T21:55:58.473" Score="1" ViewCount="108" Body="&lt;p&gt;I'm studying Financial Engineering, a subject I'm completely new to. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using &lt;code&gt;Principles of Financial Engineering 3rd Edition&lt;/code&gt; and trying to solve the exercises of the chapter on Cash Flow Engineering. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first question states:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;You have a 4-year coupon bond that pays semiannual interest. The coupon rate is 8% and the par value is 100.&#xA;a. Can you construct a synthetic equivalent of this bond? Be explicit and show your cash flows.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, I don't know how to proceed with this. I'm not able to understand how the cash flows would be split. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would it be 8 separate payments? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And if yes, what would the payment amount be at each &lt;code&gt;ti, i=1,2,...8&lt;/code&gt; and why?  &lt;/p&gt;&#xA;" OwnerUserId="17636" LastEditorUserId="743" LastEditDate="2015-09-24T23:03:21.110" LastActivityDate="2015-09-24T23:03:21.110" Title="Need help understanding basics of cash flow engineering" Tags="&lt;financial-engineering&gt;&lt;homework&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20880" PostTypeId="2" ParentId="17444" CreationDate="2015-09-24T01:45:40.853" Score="2" Body="&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&#xA;Risk avoidance is not taking on the risk in the first place by not investing in the product that has the said risks.Risk transfer is akin to buying insurance. You make the investment, are exposed to the risk, but are protected if it happens. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The board of directors sets the firm's risk appetite which is what risks investments they are willing to be exposed to (in the hopes of making money) and what risks they are not. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the risks the firm is willing to be exposed to in the hopes of making a profit, take they must decide how to handle them. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;They can protect themselves by hedging (investing in products that pay if the risk is realized; like insurance). &lt;strong&gt;This is risk transfer&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;They can diversify and bring down the risks that way. This is risk reduction. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;They can ignore them, do nothing and hope for the best. This is retaining the risk&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For the risks the firm chose not to be exposed to, they have avoided them (&lt;strong&gt;risk avoidance&lt;/strong&gt;) by not being exposed to them in the first place.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;For example:&lt;/strong&gt; Imagine an airline like Air Canada, in the course of doing their business of flying people around the globe, they are exposed to the risk of increasing prices of jet fuel. Jet fuel costs go up and it eats into their profit. They want to protect against increases in the price of jet fuel in the spot market and the board will say we are OK with our traders taking positions in jet fuel futures (there are no jet fuel futures, but lets pretend there are for simplicity) to protect against adverse price movements. They may not be OK with their traders taking positions in very complicated products like synthetic CDOs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, they have decided to transfer the risk of the increasing spot price of jet fuel by hedging (investing in futures). &lt;strong&gt;They have not avoided it, because if it happens, the price at which they buy jet fuel is going to go up and they will have to pay the higher price&lt;/strong&gt;. Since they transferred the risk by hedging, it won't negatively affect them since if the price does go up, they will make money from the futures; like an insurance policy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The board decided not to invest in the super complicated synthetic CDOs and thus have avoided the risk that comes from that investment. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;A simpler example&lt;/strong&gt; would be a company deciding to invest in corporate bonds to make a profit. They are exposed to the risk that the companies they invest in will go bankrupt and their investment loses all its value. To transfer this risk and protect themselves, they can hedge and buy a product that will pay them if one of the companies they invested in defaults. &lt;/p&gt;&#xA;" OwnerUserId="9265" LastActivityDate="2015-09-24T01:45:40.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20881" PostTypeId="1" AcceptedAnswerId="20882" CreationDate="2015-09-24T01:59:32.950" Score="2" ViewCount="643" Body="&lt;p&gt;A 2 year bond, yield 6%. A 1 year bond, yield 4%. What's the implied rate for the bond that starts one year from now? &lt;/p&gt;&#xA;" OwnerUserId="11917" LastActivityDate="2017-12-22T03:33:23.520" Title="Implied rate of a bond question" Tags="&lt;bond&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20882" PostTypeId="2" ParentId="20881" CreationDate="2015-09-24T02:16:37.820" Score="2" Body="&lt;p&gt;(1+0.06)^2 = (1+0.04)*(1+x) Solve for x&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The left hand side represents the gross return on a 2 year 6% bond&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The right hand side represents two gross returns in sequence: first we hold a 1 year bond, then (for the next year) we hold a 1 year bond (that starts a year from now) with unknown return x&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By expected interest parity (or by &quot;the Expectations Hypothesis&quot;) the two sides have to be equal, there is no advantage (or disadvantage) to holding the 2 year bond or the two 1-year bonds in sequence.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2017-12-22T03:33:23.520" LastActivityDate="2017-12-22T03:33:23.520" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20883" PostTypeId="1" CreationDate="2015-09-24T03:47:19.600" Score="1" ViewCount="64" Body="&lt;p&gt;The JKY ABMC Model (taken from Jabbour, et al. 2001) parameterizes the binomial model (in a risk-neutral world) such that,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$u = e^{r\Delta t} + e^{r\Delta t}\sqrt{e^{\sigma^2\Delta t} - 1}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d = e^{r\Delta t} - e^{r\Delta t}\sqrt{e^{\sigma^2\Delta t} - 1}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;JKY continue and say that this is equivalent to,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$u = 1 + \sigma\sqrt{\Delta t} + R\Delta t + \mathcal O(\Delta t^\frac{3}{2})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d = 1 - \sigma\sqrt{\Delta t} + R\Delta t + \mathcal O(\Delta t^\frac{3}{2})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm having trouble seeing this rigourously. Specifically, I can find that the first term $e^{r\Delta t} = 1 + R\Delta t + \mathcal O(\Delta t^2)$ from the Taylor expansion of $e^x$, but I'm having troubling seeing how the second term contributes to the $\pm\sigma\sqrt{\Delta t}$ and how it leads to the restriction of the error to $\mathcal O(\Delta t^\frac{3}{2})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="17638" LastActivityDate="2016-01-22T17:48:37.953" Title="Jabbour-Kramin-Young ABMC Binomial Parameterization" Tags="&lt;risk-neutral-measure&gt;&lt;binomial-tree&gt;&lt;binomial&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20884" PostTypeId="2" ParentId="20874" CreationDate="2015-09-24T06:55:11.453" Score="3" Body="&lt;p&gt;At what scale do you see kurtosis? Daily data? Single stocks or indices?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us not look at single stock data, because you always find crazy stocks whose price process breaks all rules.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Talking about daily data of indices: they could be thought of the sum of hourly returns or other returns of high frequency (minute returns, milliseconds ...).&#xA;What are the assumptions of &quot;the&quot; (or most other forms of) Central Limits theorem? You need independent summands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They might be uncorrelated, but this does not imply that they are independent.&#xA;If you look at &lt;span class=&quot;math-container&quot;&gt;$r_t^2$&lt;/span&gt; - the square of returns - then they are highly correlated (volatility clustering). This implies that returns themselves are not independent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally no reason for the CTL to hold true. &#xA;However what we find is &quot;aggreational Gaussianity&quot; meaning that if you go to lower frequencies you get more and more Gaussian looking returns. In my experience this is only true for weekly to monthly returns.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2019-09-03T06:37:07.320" LastActivityDate="2019-09-03T06:37:07.320" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="20885" PostTypeId="2" ParentId="18822" CreationDate="2015-09-24T07:22:01.133" Score="5" Body="&lt;p&gt;I have used QuantQuote minute data previously and found it to be by far some of the best data I have used. It's interesting to observe that DonaldRC has just a single post and is pushing ActiveTick strongly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyways, I came across this post while researching market data for my next project as I wanted to see if there's any new info about QuantQuote. After seeing this, I decided to email QuantQuote support to get their input into it. I got a comprehensive response which I think is worth sharing here.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Dear REDACTED,    &#xA;&#xA;Thank you for contacting QuantQuote. We looked into the post that you linked &#xA;us to and it is also quite mysterious to us. First of all, QuantQuote does&#xA;not provide data with Unix timestamps, so it is possible the data is not&#xA;actually ours.    &#xA;&#xA;It is also possible that it is user error as in our database, the prices for&#xA;that time interval do not correspond to what that post displays. This is &#xA;what we have from our minute resolution dataset (derived from the second &#xA;dataset) which is quite different than the prices posted.     &#xA;&#xA;20140721,1511,94.055,94.06,94.04,94.05,71806,1,0,0,123          &#xA;20140721,1512,94.045,94.05,94.02,94.02,49993,1,0,0,123&#xA;20140721,1513,94.022,94.05,94.022,94.0447,48435,1,0,0,123&#xA;20140721,1514,94.045,94.05,94.04,94.05,31260,1,0,0,123&#xA;20140721,1515,94.05,94.08,94.04,94.08,48934,1,0,0,123     &#xA;&#xA;Our best guess is that this is in fact user error. In fact, if you look&#xA;earlier on that same day, we find the following prices which match what was&#xA;posted:     &#xA;&#xA;20140721,911,94.63,94.65,94.63,94.65,2100,1,0,0,123&#xA;20140721,912,94.66,94.66,94.62,94.63,1720,1,0,0,123&#xA;20140721,913,94.62,94.64,94.61,94.63,17167,1,0,0,123&#xA;20140721,914,94.63,94.63,94.62,94.63,4776,1,0,0,123    &#xA;&#xA;It seems the user accidentally introduced a 6 hour offset when processing&#xA;the data. Although our datasets are geared towards a sophisticated audience&#xA;(largely university and hedge fund researchers), sometimes we do get less&#xA;sophisticated customers who improperly process the data and posts like this   &#xA;appear. However, among experienced industry professionals, we continue to&#xA;have an excellent reputation. We regret that this customer did not reach out &#xA;to us as we could have helped him easily fix his error.&#xA;&#xA;Best Regards,  &#xA;QuantQuote Support&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So, it seems user670186 did not write his code properly and instead of fixing his bug, he went ahead trashed the reputation of a good data provider.&lt;/p&gt;&#xA;" OwnerUserId="2950" LastEditorUserId="2950" LastEditDate="2015-09-24T07:28:24.913" LastActivityDate="2015-09-24T07:28:24.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20886" PostTypeId="1" CreationDate="2015-09-24T07:44:26.940" Score="1" ViewCount="265" Body="&lt;p&gt;It is easy to define the option vega $\nu=\frac{\partial C}{\partial \sigma}$ under Black Scholes model since volatility is a single quantity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, under CEV or local volaility model, it is confusing for me to compute option vega. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the volaility function is defined as $\sigma(S)=\delta S^{\beta}$. Then, how to compute a sensitivity of the option price with respect to $\sigma(S)$??&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At first galance, I think&#xA;$$&#xA;\nu = \frac{\partial C}{\partial \sigma(S)}= \frac{\partial C}{\partial S}\frac{\partial S}{\partial \sigma(S)}=\Delta\frac{1}{\delta\beta S^{\beta-1}}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this right? But it seems wrong..&lt;/p&gt;&#xA;" OwnerUserId="12093" LastActivityDate="2016-02-21T18:27:40.417" Title="Computation of option vega under CEV" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;greeks&gt;&lt;option-strategies&gt;&lt;local-volatility&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20887" PostTypeId="2" ParentId="20874" CreationDate="2015-09-24T09:23:14.100" Score="4" Body="&lt;p&gt;Perhaps an answer coming from a different angle and giving you some perspective: The typical approach taken by statistics is top-down: Just looking at the data and finding patterns and stylized facts (like excess volatility, volatility clustering, fat tails, no autocorrelation in returns but significant autocorrelation in absolute returns etc.) The problem is that you have lots of simplifying assumptions (e.g. iid-ness, CLTs etc.) which make the results hard to explain (in your case &quot;why kurtosis?&quot;...)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another approach is to have a look at the underlying data generating process (traders interacting in markets!), which would be bottom-up. One very fascinating area of research are multi-agent simulations. Even when you create a comparatively simple artificial market with only two types of traders (i.e. technical traders = basically trend-followers and fundamental traders = basically mean-reversion traders) you will be able to replicate all (!) of the abovementioned stylized facts!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way to go would be to really get into the micro-structure of this simplified model and see where and why kurtosis is created (I have no good answer for you at the moment, but when we are not even able to understand such very basic models I guess there is no hope for understanding real markets).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please also see my post here and the links within: &lt;a href=&quot;https://plus.google.com/u/0/108351331401552240682/posts/6Zc77oKChkq&quot; rel=&quot;nofollow&quot;&gt;https://plus.google.com/u/0/108351331401552240682/posts/6Zc77oKChkq&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The paper that is mentioned there can be replicated quite easily (which I have done) - and then you can start your own experiments! It is well worth the effort...&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2015-09-24T09:23:14.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20888" PostTypeId="1" AcceptedAnswerId="20893" CreationDate="2015-09-24T13:56:20.500" Score="1" ViewCount="1287" Body="&lt;p&gt;I'm trying to build a euro swap curve with real up to date data. I should say that examples provided in github work fine.&#xA;as soon as I add the 5y swap, I got the following error :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;RuntimeError: 1st iteration: failed at 14th alive instrument, maturity September 28th, 2020, reference date September 28th, 2015: root not bracketed: f[-1,1] -&amp;gt; [3.260558e-001,5.904525e-002]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;edit (error with error lines) :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;RuntimeError: void __thiscall QuantLib::IterativeBootstrap&amp;lt;class QuantLib::PiecewiseYieldCurve&amp;lt;struct QuantLib::ForwardRate,class QuantLib::BackwardFlat,class QuantLib::IterativeBootstrap&amp;gt; &amp;gt;::calculate(void) const: &#xA;  d:\PycharmProjects\quantlib\QuantLib\ql/termstructures/iterativebootstrap.hpp(217): &#xA;1st iteration: failed at 14th alive instrument, maturity September 28th, 2020, reference date September 28th, 2015: double __thiscall QuantLib::Solver1D&amp;lt;class QuantLib::Brent&amp;gt;::solve&amp;lt;class QuantLib::BootstrapError&amp;lt;class QuantLib::PiecewiseYieldCurve&amp;lt;struct QuantLib::ForwardRate,class QuantLib::BackwardFlat,class QuantLib::IterativeBootstrap&amp;gt; &amp;gt;&amp;gt;(const class QuantLib::BootstrapError&amp;lt;class QuantLib::PiecewiseYieldCurve&amp;lt;struct QuantLib::ForwardRate,class QuantLib::BackwardFlat,class QuantLib::IterativeBootstrap&amp;gt; &amp;gt; &amp;amp;,double,double,double,double) const: &#xA;  d:\PycharmProjects\quantlib\QuantLib\ql/math/solver1d.hpp(202): &#xA;root not bracketed: f[-1,1] -&amp;gt; [3.260558e-001,5.904525e-002]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have to say that I get no error if I remove the 5y swap.&#xA;I have QL_NEGATIVE_RATES in userconfig.hpp that isn't commented.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the piece of code I'm using is here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import QuantLib as ql&#xA;import datetime&#xA;&#xA;calendar = ql.TARGET()&#xA;settlementDays = 2&#xA;now = datetime.datetime.now()&#xA;today = calendar.adjust(ql.Date(now.day, now.month, now.year))&#xA;ql.Settings.instance().evaluationDate = today&#xA;settlementDate = calendar.advance(today, settlementDays, ql.Days)&#xA;&#xA;# market quotes&#xA;deposits = {(1, ql.Weeks): -0.141,&#xA;            (1, ql.Months): -0.107,&#xA;            (2, ql.Months): -0.066,&#xA;            (3, ql.Months): -0.039,&#xA;            (6, ql.Months): 0.033,&#xA;            (9, ql.Months): 0.083,&#xA;            (12, ql.Months): 0.147}&#xA;&#xA;futures = {ql.Date(16, 3, 2016): 100.045,&#xA;           ql.Date(15, 6, 2016): 100.055,&#xA;           ql.Date(21, 9, 2016): 100.06,&#xA;           ql.Date(21, 12, 2016): 100.055,&#xA;           ql.Date(15, 3, 2017): 100.04}&#xA;&#xA;swaps = {(2, ql.Years): 0.0557,&#xA;         (3, ql.Years): 0.1275,&#xA;         (4, ql.Years): 0.2331,&#xA;         #(5, ql.Years): 0.3523&#xA;         }&#xA;&#xA;# convert them to Quote objects&#xA;for n, unit in deposits.keys():&#xA;    deposits[(n, unit)] = ql.SimpleQuote(deposits[(n, unit)])&#xA;for d in futures.keys():&#xA;    futures[d] = ql.SimpleQuote(futures[d])&#xA;for n, unit in swaps.keys():&#xA;    swaps[(n, unit)] = ql.SimpleQuote(swaps[(n, unit)])&#xA;&#xA;dayCounter = ql.Actual360()&#xA;&#xA;depositHelpers = [&#xA;    ql.DepositRateHelper(ql.QuoteHandle(deposits[(n, unit)]), ql.Period(n, unit), settlementDays, calendar,&#xA;                         ql.ModifiedFollowing, False, dayCounter) for n, unit in sorted(deposits.iterkeys())]&#xA;&#xA;dayCounter = ql.Actual360()&#xA;&#xA;futuresHelpers = [&#xA;    ql.FuturesRateHelper(ql.QuoteHandle(futures[d]), d, 3, calendar, ql.ModifiedFollowing, True, dayCounter,&#xA;                         ql.QuoteHandle(ql.SimpleQuote(0.0))) for d in sorted(futures.keys())]&#xA;&#xA;settlementDays = 2&#xA;fixedLegFrequency = ql.Annual&#xA;fixedLegTenor = ql.Period(1, ql.Years)&#xA;fixedLegAdjustment = ql.Unadjusted&#xA;fixedLegDayCounter = ql.Thirty360()&#xA;floatingLegFrequency = ql.Semiannual&#xA;floatingLegTenor = ql.Period(6, ql.Months)&#xA;floatingLegAdjustment = ql.ModifiedFollowing&#xA;&#xA;swapHelpers = [ql.SwapRateHelper(ql.QuoteHandle(swaps[(n, unit)]), ql.Period(n, unit), calendar, fixedLegFrequency,&#xA;                                 fixedLegAdjustment, fixedLegDayCounter, ql.Euribor6M()) for n, unit in&#xA;               swaps.keys()]&#xA;&#xA;# term structure handles&#xA;&#xA;discountTermStructure = ql.RelinkableYieldTermStructureHandle()&#xA;forecastTermStructure = ql.RelinkableYieldTermStructureHandle()&#xA;&#xA;&#xA;def printHelper(x):&#xA;    print('{} | {}'.format(x.latestDate(), x.quote().value()))&#xA;&#xA;&#xA;def printH(t):&#xA;    print('\n======')&#xA;    print t&#xA;    for i in list(t):&#xA;        printHelper(i)&#xA;&#xA;printH(depositHelpers)&#xA;printH(futuresHelpers)&#xA;printH(swapHelpers)&#xA;&#xA;helpers = depositHelpers[:-2] + futuresHelpers + swapHelpers&#xA;printH(helpers)&#xA;&#xA;depoFuturesSwapCurve = ql.PiecewiseFlatForward(settlementDate, helpers, ql.Actual360())&#xA;&#xA;print depoFuturesSwapCurve.dates()&#xA;&#xA;for c in depoFuturesSwapCurve.dates():&#xA;    print depoFuturesSwapCurve.discount(c)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13678" LastEditorUserId="13678" LastEditDate="2015-09-24T16:21:59.397" LastActivityDate="2015-09-24T23:26:42.317" Title="Quantlib bootstraping fails on 5y swap" Tags="&lt;yield-curve&gt;&lt;swaps&gt;&lt;quantlib&gt;&lt;bootstrapping&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20892" PostTypeId="2" ParentId="20874" CreationDate="2015-09-24T22:21:12.100" Score="2" Body="&lt;p&gt;The subordinate return process for log returns is normal (or Gaussian). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;kurtosis&lt;/code&gt; stems from the &quot;activity rate&quot; of events that move asset prices. When we measure in &quot;clock time&quot; we see &lt;code&gt;kurtosis&lt;/code&gt;. However, when we measure in &quot;event times&quot; or &quot;business times&quot; the distribution is normal. The &quot;event time&quot; is a subordinator. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Substitute &quot;event time&quot; for &quot;clock time&quot; and the subordinate process based on the time change removes the &lt;code&gt;kurtosis&lt;/code&gt;. For a literature review and applications see: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2034858&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2034858&lt;/a&gt; and &lt;a href=&quot;http://papers.ssrn.com/abstract=2618071&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/abstract=2618071&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="17653" LastEditorUserId="743" LastEditDate="2015-09-25T18:21:41.030" LastActivityDate="2015-09-25T18:21:41.030" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20893" PostTypeId="2" ParentId="20888" CreationDate="2015-09-24T23:26:42.317" Score="5" Body="&lt;p&gt;You're not the first to trip on this, and unfortunately the fact that the provided example is from a different era doesn't help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quite simply, you're not writing rates correctly. The 5-years swap rate, 0.3523%, must be written in decimal form as 0.003523. The same goes for the deposit rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As your code is now, you're writing that the 4-years rate is 23.31% and the 5-years rate is 35.23%, and the bootstrap code fails to find a solution that accounts for the extreme variation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Writing the rates correctly should allow you to bootstrap the curve as expected.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2015-09-24T23:26:42.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20894" PostTypeId="2" ParentId="20720" CreationDate="2015-09-25T00:03:28.220" Score="3" Body="&lt;p&gt;I think the easiest way to explain this is with an example of a spread trade. Consider a curve trade on WTI crude oil such that you're short 1y oil and long 2y oil. 1y oil is at \$50 and 2y oil is at \$54. You have one contract on each leg for a gross exposure of \$104k and net exposure of \$4k. If 1y oil moves up \$5 to \$55 and 2y oil moves up \$6 to \$60, your gross exposure is now $105k and your net exposure is now \$5k. Your gross exposure moved up ~1% while your net exposure moved up 25%. This is a crude (pun intended!) example of how netted positions can be more volatile than gross positions.&lt;/p&gt;&#xA;" OwnerUserId="17625" LastActivityDate="2015-09-25T00:03:28.220" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20895" PostTypeId="1" AcceptedAnswerId="20896" CreationDate="2015-09-25T06:08:40.187" Score="1" ViewCount="173" Body="&lt;p&gt;I have calculated the simple arithmetic return on a number of different financial securities and am fitting both a Student-T and Generalised Pareto Distribution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is can I just use the simple returns as my input observations or is it better practice to convert the data into log-normal (i.e. take the exponential) or standardise the data (subtract mean and divide by standard deviation). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know this may seem like a very simple question, but I am looking for the soundest statistical practice and why.&lt;/p&gt;&#xA;" OwnerUserId="11632" LastActivityDate="2015-09-25T07:42:38.437" Title="Fitting (marginal/multivariate) distributions to financial return data" Tags="&lt;statistics&gt;&lt;returns&gt;&lt;modeling&gt;&lt;distribution&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20896" PostTypeId="2" ParentId="20895" CreationDate="2015-09-25T07:42:38.437" Score="1" Body="&lt;p&gt;I would personally go for a &lt;strong&gt;normal returns&lt;/strong&gt;, because you do not make any assumptions about the data or returns. &lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When we use log returns we assume that prices are distributed log normally (which, usually is very far from the truth). &lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover if you will investigate different distribution you will not use the log returns features like &lt;a href=&quot;https://quantivity.wordpress.com/2011/02/21/why-log-returns/&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;time additivity&lt;/strong&gt; or &lt;strong&gt;approximate raw-log equality&lt;/strong&gt;&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And if you think about T-Student Distribution this is &lt;a href=&quot;http://mathbabe.org/2011/08/30/why-log-returns/&quot; rel=&quot;nofollow&quot;&gt;worth considering:&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Mathematically there’s a problem: when you assume a student-t&#xA;  distribution (a standard choice) of log returns, then you are&#xA;  automatically assuming that the expected value of any such stock in&#xA;  one day is infinity! This is usually not what people expect about the&#xA;  market, especially considering that there does not exist an infinite&#xA;  amount of money (yet!). I guess it’s technically up for debate whether&#xA;  this is an okay assumption but let me stipulate that it’s not what&#xA;  people usually intend.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This happens even at small scale, so for daily returns, and it’s&#xA;  because the moment generating function is undefined for student-t&#xA;  distributions (the moment generating function’s value at 1 is the&#xA;  expected return, in terms of money, when you use log returns). We&#xA;  actually saw this problem occur at Riskmetrics, where of course we&#xA;  didn’t see “infinity” show up as a risk number but we saw, every now&#xA;  and then, ridiculously large numbers when we let people combine “log&#xA;  returns” with “student-t distributions.” A solution to this is to use&#xA;  percentage returns when you want to assume fat tails.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="5745" LastActivityDate="2015-09-25T07:42:38.437" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20897" PostTypeId="1" AcceptedAnswerId="20899" CreationDate="2015-09-25T10:35:17.257" Score="1" ViewCount="72" Body="&lt;p&gt;What procedures can I apply to control in a regression on company returns for thinly traded stocks?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the inclusion of the SMB-factor a potential approach? Or just a dummy variable indicating if a stock is traded infrequently?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your help!&lt;/p&gt;&#xA;" OwnerUserId="13812" LastActivityDate="2015-09-25T14:43:35.503" Title="Adjust regression for thin trading" Tags="&lt;returns&gt;&lt;regression&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20898" PostTypeId="1" CreationDate="2015-09-25T14:31:41.067" Score="1" ViewCount="59" Body="&lt;p&gt;In this paper &lt;a href=&quot;http://www.researchgate.net/publication/2412812_Penalty_and_front-fixing_methods_for_the_numerical_solution_of_American_option_problems&quot; rel=&quot;nofollow&quot;&gt;Penalty and front-fixing methods for the numerical solution of American option problems&lt;/a&gt; a front fixing method based on Newton is described for an American put option is described. I am trying to implement this method. Can someone confirm that the following is the Jacobian matrix $J$.&#xA;$$\left( \begin{array}{ccccccc}&#xA; \gamma^n_1 &amp;amp; &amp;amp; &amp;amp;&amp;amp;&amp;amp;&amp;amp;-\beta^n_1-\alpha^n_1(1+\Delta x)+(\gamma^n_1)'p^n_2+(\beta^n_1)'(E-\bar{S}^n)\\&#xA; \alpha^n_2 &amp;amp;\gamma^n_2 &amp;amp; &amp;amp;&amp;amp;&amp;amp;&amp;amp;-\beta^n_2(1+\Delta x)+(\gamma^n_2)'p^n_3+(\beta^n_2)'(E-(1+\Delta x)\bar{S}^n)\\&#xA;\beta^n_3 &amp;amp; \alpha^n_3 &amp;amp; \gamma^n_3&amp;amp; &amp;amp;&amp;amp;&amp;amp;(\beta^n_3)'p^n_2+(\gamma^n_3)'p^n_4\\&#xA;&amp;amp;\ddots&amp;amp;\ddots&amp;amp;\ddots&amp;amp;&amp;amp;&amp;amp;\vdots\\&#xA;&amp;amp;&amp;amp;\ddots&amp;amp;\ddots&amp;amp;\ddots&amp;amp;&amp;amp;\vdots\\&#xA;&amp;amp;&amp;amp;&amp;amp; \beta^n_{M-1} &amp;amp; \alpha^n_{M-1} &amp;amp; \gamma^n_{M-1}&amp;amp;(\beta^n_{M-1})'p^n_{M-2}+(\gamma^n_{M-1})'p^n_{M} \\&#xA;&amp;amp;&amp;amp;&amp;amp;&amp;amp;\beta^n_{M} &amp;amp;\alpha^n_{M}&amp;amp;(\beta^n_{M})'p^n_{M-1}\\&#xA;\end{array} \right)$$&lt;/p&gt;&#xA;" OwnerUserId="11855" LastEditorUserId="11855" LastEditDate="2015-09-25T15:09:50.497" LastActivityDate="2015-09-25T15:09:50.497" Title="Jacobian for Newton method for American options by front fixing" Tags="&lt;option-pricing&gt;&lt;programming&gt;&lt;numerical-methods&gt;&lt;american-options&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20899" PostTypeId="2" ParentId="20897" CreationDate="2015-09-25T14:43:35.503" Score="3" Body="&lt;p&gt;SMB is controlling for small stocks. Small and thinly traded are not equivalent. For instance, for most of its history, Berkshire Hathaway was a large stock, but thinly traded (b/c of its high price). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a number of ways to handle liquidity risk. If you're looking to supplement a Fama-French regression, &lt;a href=&quot;http://pages.stern.nyu.edu/~lpederse/courses/LAP/papers/TransactionCosts/PastorStam.pdf%20%22Pastor%20and%20Stambaugh%20(2003)&quot; rel=&quot;nofollow&quot;&gt;Pastor and Stambaugh (2003)&lt;/a&gt; uses order flow information to construct a liquidity factor. Both authors link to the factor data on their websites, so it may just be easier to do that. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your point about using a dummy variable may not work well for a time series regression. This is because if you're identifying the periods where the stock is illiquid there might be other reasons why it is illiquid. I did see a paper by Bakaert et al that looked at something like the % of stocks that are illiquid, which might be similar to your dummy approach. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The benefit of the Pastor-Stambaugh approach is that it is in line with Fama-French in constructing portfolios from the most liquid and least liquid stocks and looking at the returns. You could also do something similar on a cross-sectional basis, but you may as well use the continuous data instead of converting it into discrete buckets.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2015-09-25T14:43:35.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20900" PostTypeId="1" AcceptedAnswerId="20903" CreationDate="2015-09-25T17:09:18.137" Score="2" ViewCount="1361" Body="&lt;p&gt;How can I get an IMM date from its 2 character symbol (eg. &quot;U6&quot;, &quot;Z8&quot;) in python?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have not been able to install the quantlib addin (it's hard if you aren't tech savy), so please don't point me in that direction..&lt;/p&gt;&#xA;" OwnerUserId="17439" LastEditorUserId="467" LastEditDate="2015-10-26T06:25:47.627" LastActivityDate="2015-12-17T17:46:48.933" Title="How to get the IMM dates in Python for a given symbol?" Tags="&lt;python&gt;&lt;date&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20901" PostTypeId="5" CreationDate="2015-09-25T17:58:01.617" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2015-09-25T17:58:01.617" LastActivityDate="2015-09-25T17:58:01.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20902" PostTypeId="4" CreationDate="2015-09-25T17:58:01.617" Score="0" Body="Budgets in corporate finance are forward plans in Capital and Operating streams. Capital budgets for large cash flows in fixed assets and investments. Operating budgets for revenues and expenses. Budgeting is relevant to Quant Finance as a budget is the outcome of a forecasting model. Executives are incentived to make or exceed budgets and so future stock prices may also be influenced or inferred. Questions related to calculation methods are welcome." OwnerUserId="17612" LastEditorUserId="17612" LastEditDate="2015-09-25T18:21:26.863" LastActivityDate="2015-09-25T18:21:26.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20903" PostTypeId="2" ParentId="20900" CreationDate="2015-09-25T18:25:56.737" Score="5" Body="&lt;p&gt;This does the trick. Given &quot;U8&quot;, function will get the IMM date for Sep 2018.  Given &quot;U4&quot;, function gets the IMM date for Sep 2024 (or it will until we've passed that date). Could be easily modified to also pull historical IMMs from a given longer symbol eg. &quot;U2014&quot;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def getIMMDate(IMMcode):&#xA;&#xA;'''Takes 2 digit IMM code and returns effective date as datetime object'''&#xA;from datetime import datetime, timedelta&#xA;&#xA;monthcodes = [[1, 'F'], [2, 'G'], [3, 'H'], [4, 'J'], [5, 'K'], [6, 'M'], [7, 'N'], [8, 'Q'],&#xA;              [9, 'U'], [10, 'V'], [11, 'X'], [12, 'Z']]&#xA;month = [pair[0] for pair in monthcodes if pair[1] == IMMcode[0].upper()][0]&#xA;&#xA;year_prefix = str(datetime.now().year)[:3]&#xA;year = int(year_prefix + IMMcode[1])&#xA;&#xA;the_date = datetime(year, month, 1)&#xA;temp = the_date.replace(day=1)&#xA;nth_week = 3&#xA;week_day = 2&#xA;adj = (week_day - temp.weekday()) % 7&#xA;temp += timedelta(days=adj)&#xA;temp += timedelta(weeks=nth_week - 1)&#xA;&#xA;if temp &amp;lt; datetime.now():&#xA;    year_prefix = str(int(str(datetime.now().year)[:3]) + 1)&#xA;    year = int(year_prefix + IMMcode[1])&#xA;&#xA;    the_date = datetime(year, month, 1)&#xA;    temp = the_date.replace(day=1)&#xA;    nth_week = 3&#xA;    week_day = 2&#xA;    adj = (week_day - temp.weekday()) % 7&#xA;    temp += timedelta(days=adj)&#xA;    temp += timedelta(weeks=nth_week - 1)&#xA;&#xA;return datetime.strftime(temp, &quot;%m/%d/%Y&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="17439" LastEditorUserId="17439" LastEditDate="2015-12-17T17:46:48.933" LastActivityDate="2015-12-17T17:46:48.933" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20904" PostTypeId="1" CreationDate="2015-09-25T18:34:30.797" Score="2" ViewCount="166" Body="&lt;p&gt;According to BSM, Stock Price follows log-normal distribution s.t.&#xA;$$S(t)=S(0)*\exp(\sigma\sqrt t Z-(\sigma^2t)/2)$$&#xA;where Z is standard normal variable&#xA;Then volatility of this stock is $\sigma \sqrt t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose I model a new stock $S'(t)=S_1(t)*S_2(t)$ where $S_1(t)$ and $S_2(t)$ will follow log-normal distribution as mentioned above with parameters $\sigma_1,Z1$ and $\sigma_2,Z2$ and $Z_1$ and $Z_2$ are correlated with a factor rho, then how do I calculate volatility of new stock denoted by price S'(t) ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently, according to &#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/14342/how-to-calculate-the-volatility-matrix-with-multiple-stocks&quot;&gt;How to calculate the volatility matrix with multiple stocks&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I calculated volatilty = sqrt(sigma1^2+sigma^2)*sqrt(t) but I am not sure if it's correct especially for correlated Zs&lt;/p&gt;&#xA;" OwnerUserId="17663" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2015-09-26T11:27:16.150" Title="Volatility of Multiple Stocks" Tags="&lt;option-pricing&gt;&lt;volatility&gt;&lt;equities&gt;&lt;black-scholes&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20905" PostTypeId="1" AcceptedAnswerId="20932" CreationDate="2015-09-25T18:35:31.910" Score="4" ViewCount="320" Body="&lt;p&gt;On a single time series one can run a &lt;a href=&quot;https://www.quantstart.com/articles/Basics-of-Statistical-Mean-Reversion-Testing&quot; rel=&quot;nofollow&quot;&gt;Dickey-Fuller&lt;/a&gt; test to determine if the asset is mean reverting or at least has been mean reverting during your sample.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to test for mean-reversion in a portfolio of assets?  In other words is there a way to test if portfolio re-balancing would have offered statistically significant advantage?&lt;/p&gt;&#xA;" OwnerUserId="5689" LastActivityDate="2015-09-28T19:52:03.897" Title="Tests for Mean Reversion in a Portfolio Rebalancing" Tags="&lt;portfolio-management&gt;&lt;mean-reversion&gt;&lt;rebalancing&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20906" PostTypeId="2" ParentId="20904" CreationDate="2015-09-25T19:15:04.590" Score="1" Body="&lt;p&gt;Use Ito's lemma on the function $f(x,y) = xy$ and then extract out the diffusion term. &lt;/p&gt;&#xA;" OwnerUserId="17332" LastActivityDate="2015-09-25T19:15:04.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20907" PostTypeId="2" ParentId="17366" CreationDate="2015-09-26T05:21:46.593" Score="1" Body="&lt;p&gt;YearFrac returns the fraction of a year represented by the number of whole days between each date entered. The dates entered are one day apart in both cases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The number of days are then divided by the assumed number of days in the year. Entering 0 gives the argument for 30/360 which is 30 days in all months and 360 days per year. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Everything before the ,0) is the numerator. The last argument in yearfrac defines the denominator, which you have set to 360 days in a year. Essentially your formula simplifies to 1/360. Multiply that by 360 and it evaluates to 1. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both cases listed are only separated by 1 day and so the formulae are equivalent and equal to 1, not 3. To return 3 you need to increase the difference between the two dates entered. =YEARFRAC(DATE(2015,2,25),DATE(2015,2,28),0)*360  &lt;/p&gt;&#xA;" OwnerUserId="17612" LastActivityDate="2015-09-26T05:21:46.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20908" PostTypeId="2" ParentId="20904" CreationDate="2015-09-26T11:27:16.150" Score="0" Body="&lt;p&gt;To obtain the vola for the log returns is easy and you don't need itos lemma, since&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \log S'(t) = \log S_1(t) + \log S_2(t),$$&#xA;therefore&#xA;$$ var(S'(t)) = var(\log S_1(t)) + var(\log S_2(t)) + 2covar(\log S_1(t),\log S_2(t))\\  = \sigma_1t+\sigma_2t+2\rho \sigma_1\sigma_2.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, to get the vola for the non-log stock price you indeed need to use the ito formula.&lt;/p&gt;&#xA;" OwnerUserId="6640" LastActivityDate="2015-09-26T11:27:16.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20909" PostTypeId="1" AcceptedAnswerId="37445" CreationDate="2015-09-26T23:34:37.740" Score="14" ViewCount="538" Body="&lt;p&gt;Since options represent leveraged stock investments, at which strike $K$ does a European option provide maximum leverage?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hereby define leverage $L$ as ratio of Delta/Optionprice:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$L(K)=\frac{\Delta(K)}{C(K)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can assume all parameters fixed and positive ($T-t&amp;gt;0$) except strike $K (&amp;gt;0)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Delta is defined as $\Delta=\frac{\partial C(S)}{\partial S}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The maximum option leverage strike is important as it provides the maximum possible profit (and loss) on investment.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Numerical solutions would be acceptable (e.g. MATLAB fmincon).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Graphical solutions would also be acceptable (e.g. MATLAB plot or &lt;a href=&quot;http://www.wolframalpha.com/input/?i=x%5E2&quot; rel=&quot;noreferrer&quot;&gt;http://www.wolframalpha.com/input/?i=x%5E2&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Intuitive explanations would be acceptable.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;For theoretical solutions you can use Black-Scholes model where&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;  C(S, t) &amp;amp;= N(d_1)S - N(d_2) Ke^{-r(T - t)} \\&#xA;     d_1 &amp;amp;= \frac{1}{\sigma\sqrt{T - t}}\left[\ln\left(\frac{S}{K}\right) + \left(r + \frac{\sigma^2}{2}\right)(T - t)\right] \\&#xA;     d_2 &amp;amp;= \frac{1}{\sigma\sqrt{T - t}}\left[\ln\left(\frac{S}{K}\right) + \left(r - \frac{\sigma^2}{2}\right)(T - t)\right] \\&#xA;         &amp;amp;= d_1 - \sigma\sqrt{T - t}&#xA;\end{align}&#xA;and&#xA;\begin{align}&#xA;  P(S, t) &amp;amp;= Ke^{-r(T - t)} - S + C(S, t) \\&#xA;          &amp;amp;= N(-d_2) Ke^{-r(T - t)} - N(-d_1) S&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The deltas for call and put are&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta^C=N(d_1)$$&#xA;$$\Delta^P =N(d_1) - 1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $N(\cdot)$ denotes the cumulative Normal distribution.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2015-10-17T03:32:15.203" LastActivityDate="2017-12-21T14:33:46.747" Title="Max option leverage strike" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;optimization&gt;&lt;leverage&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="20910" PostTypeId="1" AcceptedAnswerId="20917" CreationDate="2015-09-27T00:25:19.637" Score="0" ViewCount="977" Body="&lt;p&gt;&lt;em&gt;&quot;Marginal CVA may be useful to breakdown a CVA for any number of netted trades into trade-level contributions that sum to the total CVA. Whilst it might &lt;strong&gt;not be used for pricing new transactions (due to the problem that marginal CVA changes when new trades are executed&lt;/strong&gt;, implying PnL adjusting to trading books), it may be required for pricing trades transacted at the same time...&quot; - John Gregory&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why would a marginal CVA change when a new trade is executed? I can see that the marginal CVA of a trade is time dependent, as the exposure of a trade changes so would its marginal CVA.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Putting aside that I don't understand how the marginal CVA wold change as a trade is added, why is this a problem for pricing the risk? A trader submits a transaction to the CVA desk for pricing of the risk so that it can be charged back to the counterparty, they come up with the value and voila done. What am I missing ?&lt;/p&gt;&#xA;" OwnerUserId="9265" LastActivityDate="2015-09-27T21:51:59.063" Title="Why can't marginal CVA be used in pricing?" Tags="&lt;risk&gt;&lt;credit-risk&gt;&lt;cva&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20911" PostTypeId="1" CreationDate="2015-09-27T01:32:34.143" Score="2" ViewCount="2261" Body="&lt;p&gt;I am trying to predict the intraday moving range of stock/forex (essentially, high-low). Here are some ideas based on what I've been reading recently (do not have quant background, so basic level of understanding).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) GARCH can be used to model volatility. This seems to model intraday returns (close-open) and not necessarily the daily range. Are there any implications if I choose (high-low) as proxy for returns ? The purpose of using the range predictor is mainly to figure out my stops based on my entry point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) I also came across GARMAN-KLASS (OHLC) volatility estimator. Any pros/cons on using this volatility estimator as a time series and use a weighted moving average to predict next-day volatility and map that volatility to a range ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Lastly, the most basic option would be to simply use a weighted moving average of recent ranges and use that as a prediction ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Appreciate any inputs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;[*EDIT - I've posted this on main page as well since I see this is beta and I am not sure if this gets as much traffic. Please merge when there is a response *]&lt;/p&gt;&#xA;" OwnerUserId="17672" LastEditorUserId="17672" LastEditDate="2015-09-27T04:00:01.207" LastActivityDate="2016-04-06T20:18:41.893" Title="How to predict daily range of forex?" Tags="&lt;volatility&gt;&lt;garch&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20912" PostTypeId="2" ParentId="20911" CreationDate="2015-09-27T06:15:52.797" Score="3" Body="&lt;p&gt;As far as I know, technical analysis won't work to predict  intraday Forex movement. I've done so many backtest using technical analysis but it doesn't have any predictive power.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best way to predict FOREX is to find the difference of interest rates issued by both government of that currency pair.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;Pn = P_0 . e^{(r_{jpy}-r_{usd}) \Delta t }&#xA;$$&#xA;$$&#xA;\Delta t=\frac{t_n-t_0}{365}&#xA;$$&#xA;From that you can predict daily currency pair change/movement by continuously compounding the interest rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can directly backtest the formula above using USDJPY pair with interest rates issued by US &amp;amp; Japan government in previous year.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\sigma = \sqrt{ \frac{\sum\limits_{n=1}^{365} (P_n- \bar{P} )^2 }{365} }&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Theoritically you can also predict volatility after you calculate all the prices. Then you can use GARCH to predict intraday price (OHLC).&lt;/p&gt;&#xA;" OwnerUserId="13496" LastEditorUserId="13496" LastEditDate="2015-09-29T04:44:34.670" LastActivityDate="2015-09-29T04:44:34.670" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20913" PostTypeId="1" CreationDate="2015-09-27T09:17:09.067" Score="1" ViewCount="179" Body="&lt;p&gt;people giving intraday target price of particular share. Most of the times the target is achieved.I am still puzzled how the target price of stock for intraday can calculated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To elaborate my query let me take an example :-&#xA;Person X says&#xA;Current market price : 100&#xA;target : 105&#xA;stop loss : 95.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone enlighten us in this direction&lt;/p&gt;&#xA;" OwnerUserId="17676" LastActivityDate="2015-09-27T22:37:20.240" Title="How we decide the target price for stock" Tags="&lt;equities&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20916" PostTypeId="1" CreationDate="2015-09-27T19:26:49.027" Score="1" ViewCount="255" Body="&lt;p&gt;I'm having trouble grasping this concept; I don't see the relevance of the explanation given in the text (Gregory, Counterparty Credit Risk and CVA) either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When expected exposure and probability of default are positively correlated (wrong way risk), the exposure conditional on default is higher than if the two were independent. This part makes sense. But, according to Gregory (below), the conditional exposure will be higher for a smaller PD than it would for a larger PD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gregory offers an explanation, that exposure will decline because for higher quality counterparties the increase in PD is unexpected. I don't see how this affects it though. Why does an unexpected increase in PD cause exposure to fall? Why would exposure increase more with a smaller probability of default than it would with a larger one?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From John Gregory:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;We can see that with 50% correlation, wrong-way risk approximately&#xA;  doubles the EE whilst with 50% correlation the impact of right-way&#xA;  risk reduces it by at least half. This is exactly the type of behavior&#xA;  expected: positive correlation between the default probability and&#xA;  exposure increases the conditional expected exposure (default&#xA;  probability is high when exposure is high), which is wrong-way risk.&#xA;  Negative correlation causes right-way risk.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/bYsRT.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/bYsRT.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;Let us look into this simple model in a bit more detail. Consider now&#xA;  the impact of counterparty default probability on the EE with&#xA;  wrong-way risk. Figure 15.2 shows the EE using three different hazard&#xA;  rates, indicating that the exposure decreases as the credit quality of&#xA;  the counterparty also decreases. This result might seem at first&#xA;  counterintuitive but it makes sense when one considers that for a&#xA;  better credit quality counterparty, default is a less probable event&#xA;  and therefore represents a bigger surprise when it comes.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/6TZbv.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/6TZbv.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="9265" LastEditDate="2015-10-03T21:43:36.527" LastActivityDate="2015-10-03T21:43:36.527" Title="Why is credit exposure higher for a smaller probability of default than for a larger default?" Tags="&lt;risk&gt;&lt;correlation&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20917" PostTypeId="2" ParentId="20910" CreationDate="2015-09-27T20:10:45.580" Score="1" Body="&lt;p&gt;The marginal CVA depends on every other trade in the netting set. This implies that adding a trade to the portfolio changes the marginal CVA of all the other existing trades in the portfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is that problem?&#xA;Imagine you only charge the client for the marginal CVA of each new trade. Since adding a new trade changes the CVA allocated to previously booked trades, the increase in total CVA will be dispatched among all the trades in the portfolio. So the marginal CVA of the new trade might represent only a fraction of the total increase in CVA and the remaining fraction will never be charged to the client. Note that the bank will still account for it because the total CVA is the sum of the marginal ones. So marginal CVA is good measure for the bank to know at a given date which trades are material to CVA but it is bad for knowing how much to charge for a new trade. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, incremental CVA takes into account the full increase of CVA due to a new trade but the incremental CVA of each trade depends on the order they were booked which is not relevant when you want to assess the bank's books.    &lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2015-09-27T21:51:59.063" LastActivityDate="2015-09-27T21:51:59.063" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20918" PostTypeId="1" CreationDate="2015-09-27T21:22:35.097" Score="2" ViewCount="355" Body="&lt;p&gt;Credit exposure defines the loss in the event of a counterparty defaulting, and expected exposure is the average of all credit exposures. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;BUT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When adjusting the CVA calculation to account for wrong-way-risk we replace expected exposure with expect exposure at time T* conditional on this being the counterparty default time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If exposure is already conditional on default, how is this any different? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are the definitions of credit exposure and wrong way risk from the John Gregory's &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1118316673&quot; rel=&quot;nofollow&quot;&gt;book&lt;/a&gt; as requested:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;​Wrong-way risk&lt;/strong&gt; is used to indicate an unfavorable dependence between exposure and counterparty credit quality&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;​&lt;strong&gt;Credit exposure&lt;/strong&gt; is the loss in the event that the counterparty&#xA;  defaults. Credit exposure is characterized by the fact that a positive&#xA;  value of a financial instrument corresponds to a claim on a defaulted&#xA;  counterparty&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;To characterize exposure we need to answer two questions:&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;What is the current exposure (the maximum loss if the counterparty defaults now)?&lt;/li&gt;&#xA;  &lt;li&gt;What is the exposure in the future (what could be the loss if the counterparty defaults at some point in the future)? This second&#xA;  question is far more complex to answer&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Source text in question (emphasis mine):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The presence of wrong-way risk will (unsurprisingly) increase CVA.&#xA;  However, the magnitude of this increase will be hard to quantify, as&#xA;  we shall show in some examples. Wrong-way risk also prevents one from&#xA;  using the (relatively) simple formulas used for CVA in Chapter 12.We&#xA;  can still use the same CVA expression as long as we calculate the&#xA;  exposure conditional&#xA;  $$CVA \approx (1 - Recovery) \sum\limits_{j=1}^MDF(t_{j})EE(t_{j}| t_{j} = \tau_{c})PD(t_{j-1},t_{j})$$&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;where $EE(t_{j}| t_{j} = \tau_{c})$ represents the expected exposure&#xA;  at time $t_{j}$ conditional on this being the counterparty default&#xA;  time ($\tau_{c}$). This replaces the previous exposure, which was&#xA;  unconditional&lt;/strong&gt;. As long as we use the conditional exposure, everything&#xA;  is correct.upon default of the counterparty. Returning to equation&#xA;  (12.2), we simply rewrite the expression as&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="467" LastEditDate="2015-09-28T16:28:05.650" LastActivityDate="2015-09-28T16:28:05.650" Title="Is credit exposure conditional on default?" Tags="&lt;risk&gt;&lt;credit-risk&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20919" PostTypeId="2" ParentId="20911" CreationDate="2015-09-27T21:47:09.817" Score="0" Body="&lt;p&gt;You could just go with a straight confidence interval. I'll explain it in terms of Gaussian/normal distribution, however, for professional use I'd take the extra steps to do bootstrapping and fitted some fat tail distribution.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Select some time lag for your data.&lt;/li&gt;&#xA;&lt;li&gt;Calculate the rate of returns for each time step.&lt;/li&gt;&#xA;&lt;li&gt;Calculate the standard deviation and mean of the rate of returns. Say the standard deviation is $2\%$ and the mean is $3\%$.&lt;/li&gt;&#xA;&lt;li&gt;Choose a confidence interval, say, $95\%$.&lt;/li&gt;&#xA;&lt;li&gt;Use the inverse of the distribution for the interval $2.5\%$ and $97.5\%$ (a width of $95$ percentage points). This gives z-values of $-1.96$ and $+1.96$.&lt;/li&gt;&#xA;&lt;li&gt;Calculate the interval, which comes out to be $-1\% \approx 3\% - 1.96 * 2\%$ and $+7\% \approx 3\% + 1.96 * 2\%$.&lt;/li&gt;&#xA;&lt;li&gt;If you own $\$1000$ of the currency in question then your confidence interval would be between $\$990 = 1000 \times (1+0.01)$ and $\$1070 = 1000 \times (1+0.07)$ with a confidence of $95\%$, meaning that you typically wouldn't see the price go over or under this interval more often than once every $20$ days $(=1/0.05)$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Again, read up on other distributions than the Gaussian one. Also, note that higher confidence creates wider intervals.&lt;/p&gt;&#xA;" OwnerUserId="2792" LastEditorUserId="2792" LastEditDate="2015-09-27T22:42:38.110" LastActivityDate="2015-09-27T22:42:38.110" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20920" PostTypeId="1" CreationDate="2015-09-27T22:33:23.187" Score="-2" ViewCount="62" Body="&lt;p&gt;&quot;A model estimated with a large no. of observations may allow one to reject null hypothesis of zero coefficients for many explanatory variables.Thus we might choose to select  a somewhat lower significance to make rejection of a null hypothesis more difficult.&quot; Provide an intuitive explanation for the above statement.&lt;/p&gt;&#xA;" OwnerUserId="17682" LastActivityDate="2015-09-28T01:56:17.410" Title="regression analysis" Tags="&lt;regression&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2015-10-07T00:02:34.437" ContentLicense="CC BY-SA 3.0" />
  <row Id="20921" PostTypeId="2" ParentId="20913" CreationDate="2015-09-27T22:37:20.240" Score="1" Body="&lt;p&gt;This really depends on your methods. Earlier today in a different question I talked about confidence intervals using a very simplistic Gaussian model. I could reproduce that example to fit with your example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Select some time lag for your data.&lt;/li&gt;&#xA;&lt;li&gt;Calculate the rate of returns for each time step.&lt;/li&gt;&#xA;&lt;li&gt;Calculate the standard deviation and mean of the rate of returns. Say the standard deviation is $5.1\%$ and the mean is $5.0\%$.&lt;/li&gt;&#xA;&lt;li&gt;Choose a confidence interval, say, $95\%$.&lt;/li&gt;&#xA;&lt;li&gt;Use the inverse of the distribution for the interval $2.5\%$ and $97.5\%$ (a width of $95$ percentage points). For the Gaussian distribution this gives z-values of $-1.96$ and $+1.96$.&lt;/li&gt;&#xA;&lt;li&gt;Calculate the interval, which comes out to be $-5\% = (5\% - 1.96 \times 5.1\%)$ and $+15\% = (5\% + 1.96 \times 5.1\%)$.&lt;/li&gt;&#xA;&lt;li&gt;If the price of the asset is $\$100$ then your confidence interval would be between $\$95 = \$100 \times (1-0.05)$ and $\$115 = \$100 \times (1+0.15)$ with a confidence of $95\%$, meaning that you typically wouldn't see the price go over or under this interval more often than once every $20$ days $(=1/0.05)$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Notice that this conforms to your statement that &quot;Most of the times the target is achieved&quot;, in fact 50% of the time it would've reached the target, but only because I chose a standard deviation and mean which fit your example data. If the analyst did these calculations (with better assumptions I hope) then they could make statements that say something like:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The current market price is \$100. The expected/target return tomorrow is \$105, meaning that half of the time, in circumstances like this, we'd see the price go over this target. That said, one in twenty times we'd expect to see it fall below \$95, thus we set our stop loss there. &lt;em&gt;Small print: Mean return 5%; standard deviation 5.1%; Gaussian model.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Normally you'd hope the analyst used something better than a simple Gaussian model.&lt;/p&gt;&#xA;" OwnerUserId="2792" LastActivityDate="2015-09-27T22:37:20.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20922" PostTypeId="2" ParentId="20920" CreationDate="2015-09-28T01:30:51.427" Score="2" Body="&lt;p&gt;This is called the &quot;p-value problem in large samples&quot; and s not limited to regression.  According to Cohen (1990): &quot;a   fact   widely   understood among  statisticians:  The  null hypothesis,  taken  literally  (and  that’s  the  only  way  you  can  take  it  in  formal  hypothesis  testing),  is  always  false  in  the  real world. If  it  is  false,  even  to  a  tiny  degree,  it  must be the case that a large enough sample will produce a significant result and lead to its rejection.&quot; This is a fundamental problem with p-values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another statistician Chatfield  (1995)  comments,  “The  question  is  not  whether  differences  are  ‘significant’  (they nearly always are in large samples), but whether they are  interesting.  Forget  statistical significance,  what  is the practical significance of the results?” The increased power  of  large  samples  means  that  researchers  can detect smaller, subtler, and more complex effects, but relying on p-values alone can lead to claims of support for hypotheses of little or no practical significance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at practical significance is a better solution than &quot;select a somewhat lower significance to make rejection of a null hypothesis more difficult&quot;, although the effect is similar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found this article interesting : Mingfeng Lin et al.: &quot;Too Big to Fail: Large Samples and the p-Value Problem&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An analogy might be the comparison of two coins (say 2 pennies): if you have an extremely sensitive balance, able to detect differences of a few atoms, you will find that any two coins you compare are always of different weight. A statistical estimator that uses a large sample is the equivalent of the very precise balance.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2015-09-28T01:56:17.410" LastActivityDate="2015-09-28T01:56:17.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20923" PostTypeId="1" CreationDate="2015-09-28T04:06:32.377" Score="1" ViewCount="201" Body="&lt;p&gt;How do I use &lt;code&gt;FixedRateBondPriceByYield()&lt;/code&gt; function on maturity date that is earlier than today? I get &quot;non tradable error&quot; when applying on date older than today.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library('RQuantLib')&#xA;FixedRateBondPriceByYield(, settlementDays=1, yield = 0.01524, &#xA;                          faceAmount=100,&#xA;                          maturityDate = as.Date('2015-07-31'),&#xA;                          issueDate = as.Date('2010-07-31'),&#xA;                          effectiveDate = as.Date('2010-08-10'),&#xA;                          period = 3,&#xA;                          rates = 0.0175)&#xA;&#xA;Error in fixedRateBondPriceByYieldEngine(settlementDays, yield, calendar,  : &#xA;  non tradable at September 28th, 2015 (maturity being July 31st, 2015)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note: Changing the maturityDate to a date later than today returns an answer.&lt;/p&gt;&#xA;" OwnerUserId="17683" LastActivityDate="2015-09-28T04:06:32.377" Title="RQuantLib FixedRateBondPriceByYield() Non-tradable error" Tags="&lt;fixed-income&gt;&lt;r&gt;&lt;bond&gt;&lt;quantlib&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20924" PostTypeId="1" CreationDate="2015-09-28T06:33:28.130" Score="5" ViewCount="769" Body="&lt;p&gt;I'm reading &lt;a href=&quot;http://quantlib.org/slides/dima-ql-intro-1.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Introduction to Selected Classes of the QuantLib Library I&lt;/a&gt; by Dimitri Reiswich and am trying to &quot;convert&quot; it to Python.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems to me that some C++ possibilities aren't available in python.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not familiar with SWIG but I guess it's a matter of declaring them in the appropriate *.i files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance both these work following the pdf text:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;January:  either QuantLib::January or QuantLib::Jan&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;print(ql.Date(12, 12, 2015))&#xA;print(ql.Date(12, ql.January, 2015))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But why Jan doesn't work ? &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;print(ql.Date(12, ql.Jan, 2015))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the Calendar description the 2 following commented lines return an error, browsing through the code I failed at finding them. Would someone be kind enough to point me directions on how to make them available ?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import QuantLib as ql&#xA;&#xA;&#xA;def calendarTesting():&#xA;    frankfurtCal = ql.Germany(ql.Germany.FrankfurtStockExchange)&#xA;    saudiArabCal = ql.SaudiArabia()&#xA;    myEve = ql.Date(31, 12, 2009)&#xA;    print('is BD: {}'.format(frankfurtCal.isBusinessDay(myEve)))&#xA;    print('is Holiday: {}'.format(frankfurtCal.isHoliday(myEve)))&#xA;    # print('is weekend: {}'.format(saudiArabCal.isWeekend(ql.Saturday)))&#xA;    print('is last BD: {}'.format(frankfurtCal.isEndOfMonth(ql.Date(30, 12, 2009))))&#xA;    # print('last BD: {}'.format(frankfurtCal.endOfMonth(myEve)))&#xA;&#xA;&#xA;calendarTesting()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13678" LastEditorUserId="467" LastEditDate="2016-12-22T01:45:10.920" LastActivityDate="2017-01-24T22:50:22.573" Title="Are there missing methods in QuantLib python?" Tags="&lt;quantlib&gt;&lt;python&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20925" PostTypeId="1" CreationDate="2015-09-28T07:46:18.227" Score="1" ViewCount="64" Body="&lt;p&gt;I am currently reading a bit about testing day of the weeks effects. I saw two different model specifications and wonder how to interpret the results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;strong&gt;first model type&lt;/strong&gt; includes only 4 dummies for e.g., Mo till Thu, and an intercept:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Return_t=\beta_0+\beta_1D_{1t}+\beta_2D_{2t}+\beta_3D_{3t}+\beta_4D_{4t}+\epsilon_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;strong&gt;second model type&lt;/strong&gt; includes 5 dummies for all weekdays and no intercept.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Return_t=\beta_1D_{1t}+\beta_2D_{2t}+\beta_3D_{3t}+\beta_4D_{4t}+\beta_5D_{5t}+\epsilon_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have two questions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you explain the difference in the interpretation of the p-values for the models (what does it mean when one of the dummies in model 1 is significant, what does it mean in model 2)?&#xA;In my opinion the model 2 suffers from multicollinearity, because the dummies are linear dependent, is this correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your help!&lt;/p&gt;&#xA;" OwnerUserId="13812" LastActivityDate="2015-09-28T13:53:40.303" Title="Testing day of the week effect" Tags="&lt;returns&gt;&lt;regression&gt;&lt;anomalies&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20926" PostTypeId="1" CreationDate="2015-09-28T10:13:32.027" Score="2" ViewCount="74" Body="&lt;p&gt;Suppose I have a trading system that calculates the daily risk adjusted position from the annualized risk, that is, the standard deviation of the returns of a stock over an arbitrary period of time. I would like to calculate the minimum price change (from the last closing price) required for the trading system to increase the position by 1 stock. Therefore, I thought that by finding the target price from a target position, which would be the last position added by a trade amount (in this case one), I will be able to find the respective price for that position and simply find the difference between that and the previous price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far I have come up with the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1.) Append the price series with the last live price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2.) Calculate the annualized risk as mentioned above and keep note of the risk of the live price (let's call this risk &lt;code&gt;last_risk&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3.) Calculate the risk adjusted position for the returns of the price series and keep note of the position of the live price (let's call this &lt;code&gt;last_position&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4.) We want to find the minimum price change required for the position to increase by 1, therefore we append the risk adjusted position series with the value: &lt;code&gt;last_position + 1&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5.) We also append the annualized risk series with &lt;code&gt;last_risk&lt;/code&gt;, so therefore we are using the same risk for this new target position as the one for the live price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;6.) We then calculate the new resultant price series as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;new_price_series = (capital/risk_adj_position) * (target_risk/risk)&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;such that the capital is the amount of money available, and this is divided by the &lt;code&gt;risk_adj_position&lt;/code&gt; which is a series containing the daily position (number of stocks) including the target one (&lt;code&gt;last_position + 1&lt;/code&gt;) and this is multiplied by the &lt;code&gt;target_risk/risk&lt;/code&gt;, where the &lt;code&gt;target_risk&lt;/code&gt; is a value denoting the percentage of capital willing to be risked, and &lt;code&gt;risk&lt;/code&gt; is a series containing the daily annualized risk values including the risk for the target position for which we want to find the respective price for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;7.) This will will output a price series that will also contain the price for the new target position 'last_position + 1' and the &lt;code&gt;minimum price change&lt;/code&gt; is indeed obtained by finding the difference between this price and the previous price (the live price)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thing is, I am not sure if this method would be correct, namely because I am not confident that using the risk value of the live price for the target price is the right way to go. I only started delving into quantitative finance a couple of months ago so I apologise for any stupid misconceptions and errors, and I will appreciate any insight given.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(P.S: Please note that Python is being used for coding the algorithm and Pandas and Numpy are used for data structure manipulation, etc (such as broadcasting of results) )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you! &lt;/p&gt;&#xA;" OwnerUserId="17686" LastActivityDate="2015-09-28T10:13:32.027" Title="What is the minimum price change required for a trading position increase of 1?" Tags="&lt;trading&gt;&lt;automated-trading&gt;&lt;price&gt;&lt;position-sizing&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20927" PostTypeId="2" ParentId="20918" CreationDate="2015-09-28T12:32:25.763" Score="2" Body="&lt;p&gt;If you provided a source for your definition of &quot;credit exposure&quot; and &quot;wrong-way risk&quot;, we could probably give an answer more easily.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Credit exposure is not &quot;conditional on default&quot;. It basically represents how much a counterparty owes you at a given time $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you compute the CVA, you usually assume that the correlation between counterparty credit quality and your credit exposure is 0. Wrong and right way risk are basically &quot;corrections&quot; of this assumption.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case of &quot;right-way&quot; if the counterparty is having a hard time, our exposure to them is likely to be low: the correlation between counterparty credit and exposure is &lt;strong&gt;not 0&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, you agree with a coal mine to buy some of their coal every month over the next 10 years for a fixed price determined today. The trade is profitable if the price of coal goes up. If the price of coal goes up, the mine is likely to be successful. However if the coal goes down, the mine might shut down because operating costs are simply higher than the price of coal, but if the price of coal went down, your original trade was probably worth not much anymore.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2015-09-28T12:32:25.763" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20928" PostTypeId="2" ParentId="20925" CreationDate="2015-09-28T13:53:40.303" Score="1" Body="&lt;p&gt;1) I'm going from memory here so someone may want to confirm that I'm thinking about this correctly - but the two models will end up with the same results and significance levels - in the first model, the intercept acts as the reference day, such that the average effect of $D_d=\beta_0+\beta_d$. In the second model you should get the same effect, however, it will be equal to simply $\beta_d$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) I don't think one model suffers from collinearity issues and the other one doesn't - both are likely to suffer, given that the correlation between one day and another day will be negative. It will come down to how concerned you are with multicollinearity.&lt;/p&gt;&#xA;" OwnerUserId="7889" LastActivityDate="2015-09-28T13:53:40.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20931" PostTypeId="2" ParentId="20924" CreationDate="2015-09-28T14:37:47.700" Score="0" Body="&lt;p&gt;I'm not sure how you built the python bindings but looking at the swig code here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/lballabio/quantlib/blob/master/QuantLib-SWIG/SWIG/calendars.i#L63&quot; rel=&quot;nofollow&quot;&gt;https://github.com/lballabio/quantlib/blob/master/QuantLib-SWIG/SWIG/calendars.i#L63&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;it doesn't look like there are any specific declarations ie..&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#if defined(SWIGPYTHON) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;that would preclude those methods.  Having said that, I don't see those methods listed in the swig definition at all which indicates you'll need to add them yourself you want to call them.&lt;/p&gt;&#xA;" OwnerUserId="743" LastActivityDate="2015-09-28T14:37:47.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20932" PostTypeId="2" ParentId="20905" CreationDate="2015-09-28T19:52:03.897" Score="3" Body="&lt;p&gt;If two or more (I(1)) time series are cointegrated, then this means that you can find a linear combination of them that is mean-reverting. Thus, if you create a portfolio with weights that are proportional to this linear combination, then the portfolio returns will also be mean-reverting. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a large literature on cointegration and asset prices and many techniques to try to take advantage of this behavior in asset prices. For a small number of assets, you could fit a VAR or ECM. For larger dimensional problems, PCA is often used.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2015-09-28T19:52:03.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20933" PostTypeId="1" AcceptedAnswerId="20939" CreationDate="2015-09-28T20:17:45.720" Score="3" ViewCount="96" Body="&lt;p&gt;Suppose I have a large universe of US stocks and ETFs (3000). Is there any site where I can get free information for tickers that are delisting ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. recently:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) on 9/18/2015, Broadcom (BRCM) announced delisting for effective date 12/31/2016&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) on 9/17/2015, Ryland Group (RYL) announced delisting for effective date 10/02/2015&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(3) on 9/17/2015, Crestwood Midstream (CMLP) announced delisting for effective date 10/01/2015&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can parse websites too. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm just looking for information that becomes available on the same day or within 1-2 days of the announcement date (not around the effective date)&lt;/p&gt;&#xA;" OwnerUserId="5948" LastEditorUserId="467" LastEditDate="2015-09-29T16:51:17.303" LastActivityDate="2015-09-29T16:51:17.303" Title="Where can I get alerts for future delisting?" Tags="&lt;market-data&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20934" PostTypeId="1" CreationDate="2015-09-28T20:57:16.170" Score="1" ViewCount="92" Body="&lt;p&gt;What's the best way to hedge a portfolio against a rise in rates?&#xA;Portfolio: long bonds different maturities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) parallel shift&#xA;b) convex shift (short and long term rise more than mid term)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How is it practically done?&#xA;- Fixed income instruments?&#xA;- Derivatives?&#xA;- ETFs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot.&lt;/p&gt;&#xA;" OwnerUserId="15567" LastActivityDate="2015-09-29T13:46:45.477" Title="Immunization: Whats the best way to hedge my short interest rate exposure?" Tags="&lt;options&gt;&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;interest-rate-swap&gt;&lt;interest&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20936" PostTypeId="2" ParentId="341" CreationDate="2015-09-29T03:34:38.690" Score="1" Body="&lt;p&gt;I probably will answer your question in a simple fashion before getting to a much mathematical term because I may suspect you are not familiar with stochastic terms/jargons yet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A variable could be called a martingale if the expectation of the variable at $t+1$ equals to the expectations of the variable at $t$ (basically we joke that if we don't learn anything it means that we are getting a martingale - we are not better off).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So let's look at the mathematical jargon, according to &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A basic definition of a discrete-time martingale is a discrete-time stochastic process (i.e., a sequence of random variables) $X_1, X_2, X_3, \dots$ that satisfies for any time $n$,&#xA;$$&#xA;\begin{aligned}&#xA;&amp;amp;\mathbf{E} ( \vert X_n \vert ) &amp;lt; \infty \\&#xA;&amp;amp;\mathbf{E} (X_{n+1}\mid X_1,\ldots,X_n) = X_n.&#xA;\end{aligned}&#xA;$$&#xA;That is, the conditional expected value of the next observation, given all the past observations, is equal to the last observation. Due to the linearity of expectation, this second requirement is equivalent to:&#xA;$$&#xA;\mathbf{E} (X_{n+1} - X_n \mid X_1,\ldots,X_n)=0&#xA;$$&#xA;or&#xA;$$&#xA;\mathbf{E} (X_{n+1} \mid X_1,\ldots,X_n)- X_n=0 &#xA;$$&#xA;which states that the average &quot;winnings&quot; from observation $n$ to observation $n+1$ are $0$.&lt;/p&gt;&#xA;" OwnerUserId="7693" LastEditorUserId="19645" LastEditDate="2017-11-11T15:58:37.837" LastActivityDate="2017-11-11T15:58:37.837" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20937" PostTypeId="2" ParentId="9798" CreationDate="2015-09-29T05:19:53.123" Score="14" Body="&lt;p&gt;Basically the Total Return Index assumes reinvestments compared to &quot;regular&quot; indices. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;A total return index is an index that measures the performance of a&#xA;  group of components by assuming that all cash distributions are&#xA;  reinvested, in addition to tracking the components' price&#xA;  movements.&lt;a href=&quot;https://en.wikipedia.org/wiki/Total_return_index&quot; rel=&quot;noreferrer&quot;&gt;1&lt;/a&gt; While it is common to refer to equity based indices,&#xA;  there are also total return indices for bonds and commodities...&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Total_return_index&quot; rel=&quot;noreferrer&quot;&gt;WIKI&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The S&amp;amp;P 500 index just tracks the price-levels of the index itself &amp;amp; assumes no reinvestments such as the Dividend Reinvestment Program (DRIP) &lt;/p&gt;&#xA;" OwnerUserId="13428" LastActivityDate="2015-09-29T05:19:53.123" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20938" PostTypeId="1" CreationDate="2015-09-29T09:20:14.647" Score="2" ViewCount="683" Body="&lt;p&gt;I am a bit confused about the interpretation of the regression coefficients in a regression model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$R_{t}=\beta_0+\beta_1R_{mt}+\beta_2D_{t}+\epsilon_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $R_{t}$ is the log return of some stock, which is defined as $log(P_t) - log(P_{t-1})$, $R_{mt}$ is the log return of some market index e.g.,  SP500) and $D_t$ is a dummy variable ($D_t=1$ if earnings announcements are published on day $t$ and $D_t = 0$ otherwise).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The results are $\beta_1= 0.024$ and $\beta_2= -0.03$. Is the following interpretation correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) an increase in the market return of 1% leads to an increase of the stock return of &lt;strong&gt;2.4%&lt;/strong&gt; or &lt;strong&gt;0.024%&lt;/strong&gt; (as both variables are in logs and thus $\beta_1$ can be interpreted as elasticity)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) And on days with earnings announcements, the return is &lt;strong&gt;-3%&lt;/strong&gt; or &lt;strong&gt;-0.03%&lt;/strong&gt; lower than the average return of the stock (here we have a log dependent and a non-log independent)?&lt;/p&gt;&#xA;" OwnerUserId="13812" LastEditorUserId="13812" LastEditDate="2015-10-07T09:35:36.883" LastActivityDate="2015-10-07T15:07:30.677" Title="How to interpret regression coefficients with dummy explanatory variables?" Tags="&lt;equities&gt;&lt;returns&gt;&lt;regression&gt;" AnswerCount="4" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20939" PostTypeId="2" ParentId="20933" CreationDate="2015-09-29T12:55:11.700" Score="4" Body="&lt;p&gt;You should have this information freely available on &lt;a href=&quot;http://www.sec.gov/edgar.shtml&quot; rel=&quot;nofollow&quot; title=&quot;EDGAR&quot;&gt;EDGAR&lt;/a&gt;. It is going to require some parsing and probably human verification (it's not a lot of data). You can query by filing type (i.e DEFM14A / DEFM14C for M&amp;amp;A).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;** I'm not sure how accurate your examples are, for instance Broadcom's DEFM14A was filed on 9/28/2015, the M&amp;amp;A announcement was made on May/2015. Moreover (AFAIK), the effective delisting dates are uncertain.&lt;/p&gt;&#xA;" OwnerUserId="16351" LastActivityDate="2015-09-29T12:55:11.700" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20940" PostTypeId="2" ParentId="20934" CreationDate="2015-09-29T13:46:45.477" Score="2" Body="&lt;p&gt;For portfolios comprised of instruments in the U.S., Britain or other countries with fairly low credit risk to the government, this is traditionally done by trading various maturities of treasury bonds.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A simple technique is to divide your portfolio instruments into &quot;buckets&quot; of duration, say 0-2, 2-5, 5-10, and 10+ years. Then, you sum up the exposure in each bucket, and hedge with opposite exposure to treasury bonds of approximately the same duration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a more sophisticated approach, you can create a factor model, usually with $N=3$ factors, and compute exposures and hedges using that.  But doing so is somewhat more complicated than the bucket approach without necessarily performing better.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If treasuries are impractical for some reason, high-grade corporate debt can serve as an acceptable proxy.  Some organizations are starting to use ETFs as well, but of course they are composite instruments which makes them tricky to handle on traditional curve models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In derivatives land, you might hedge with interest rate fixed-for-float swaps.  These are standardized and nearly as liquid as treasuries, while also being nearly as easy to work out exposures with.  The main trouble is that using them involves setting up more sophisticated trading relationships with your counterparties, involving agreeing on (and signing) an ISDA, etc.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2015-09-29T13:46:45.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20941" PostTypeId="1" CreationDate="2015-09-29T14:37:32.877" Score="0" ViewCount="228" Body="&lt;p&gt;Can someone give me a simple explanation of how exactly this method works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I have a dataset of say 10 quarters (dependent variable);&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;how should the independent variable (say monthly data) be aligned?&lt;/li&gt;&#xA;&lt;li&gt;What if the quarter ends in June 2010 for example and the independent (higher frequency data) ends in August 2010.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="13527" LastEditorUserId="467" LastEditDate="2015-09-29T16:50:33.710" LastActivityDate="2015-09-29T16:50:33.710" Title="How to use Chow Lin method?" Tags="&lt;data&gt;&lt;data-mining&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20943" PostTypeId="1" CreationDate="2015-09-29T19:40:49.603" Score="3" ViewCount="891" Body="&lt;p&gt;I'm trying to value a super simple receiver swap immediately after the first swap settlement (1 year in). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The given answer is -1.91 million to the floating rate payer, but I am not coming up with that. I can't figure what I'm doing wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Problem given&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notional $100 million&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fixed rate 3.95%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Floating rate term structure: Year 1: 2% Year 2: 3% Year 3: 4%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume the forward rates represent expected future spot rates. All rates are expressed with annual compounding to match the annual settlement cash flows. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My attempt:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Floating leg:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{100*.03}{(1+.03)} + \frac{104}{(1+.04)^2} \approx 99.06$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fixed leg:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{100*.0395}{(1.03)} + \frac{103.95}{(1+ .04)^2} \approx 100$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Making the value to the floating rate payer $\approx$ \$1.06 million&lt;/p&gt;&#xA;" OwnerUserId="17698" LastActivityDate="2015-12-29T11:13:53.383" Title="Something is wrong with my MtM calculation" Tags="&lt;swaps&gt;&lt;valuation&gt;&lt;interest-rate-swap&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20944" PostTypeId="1" CreationDate="2015-09-29T23:12:21.510" Score="2" ViewCount="681" Body="&lt;p&gt;Does anyone know if it is possible to write a software to pull Yahoo message board sentiment for a specific stock?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any API from Yahoo or anyone has done it before?&lt;/p&gt;&#xA;" OwnerUserId="17546" LastEditorUserId="467" LastEditDate="2015-09-30T11:20:00.553" LastActivityDate="2017-03-22T07:52:59.897" Title="How to extract sentiment from Yahoo finance message board?" Tags="&lt;programming&gt;&lt;yahoofinance&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="20945" PostTypeId="1" CreationDate="2015-09-29T23:36:28.673" Score="2" ViewCount="75" Body="&lt;p&gt;Here's a screenshot from InteractiveBrokers TWS for the near-the-money put and call on the ES Dec '15 Future:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/XL17y.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/XL17y.png&quot; alt=&quot;ES future options ATM&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The absolute value of the &lt;a href=&quot;https://quant.stackexchange.com/questions/16973/calculating-time-value-of-an-option&quot;&gt;time value&lt;/a&gt;, 9.50, makes sense. But why is the percentage value over 180%, regardless of &lt;a href=&quot;https://quant.stackexchange.com/questions/2685/how-does-an-options-time-value-depend-on-moneyness&quot;&gt;moneyness&lt;/a&gt;?&lt;/p&gt;&#xA;" OwnerUserId="4848" LastEditorUserId="743" LastEditDate="2015-09-30T17:25:22.130" LastActivityDate="2015-09-30T17:25:22.130" Title="How can the time value portion of an option be higher than 100%?" Tags="&lt;option-pricing&gt;&lt;american-options&gt;&lt;interactive-brokers&gt;&lt;time&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20969" PostTypeId="1" CreationDate="2015-09-30T02:40:57.723" Score="1" ViewCount="1015" Body="&lt;p&gt;I don't understand how the negative rates factor into this and what it means in the market&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Beta= .73&#xA;rf= (-) 0.0032  &#xA;mr= (-)0.0264&#xA;&#xA;CAPM =  [(-)0.0032 + [(-) 0.0264 – (-) 0.0032]0.73 = ???&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="17701" LastEditorUserId="743" LastEditDate="2015-09-30T15:06:54.510" LastActivityDate="2015-10-01T19:40:34.333" Title="how negative rates (mr and rf) affect CAPM" Tags="&lt;finance&gt;&lt;capm&gt;&lt;negative&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20972" PostTypeId="1" CreationDate="2015-09-30T07:46:06.913" Score="1" ViewCount="194" Body="&lt;p&gt;&lt;strong&gt;Background&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm a corporate financial analyst with a small derivatives portfolio (amortizing interest rate swaps and FX forwards) looking to value these derivatives &quot;properly&quot; (which, in my case, means &quot;without gross error&quot; as opposed to say the multiple decimals of precision required for real quants).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using only publicly available free data sources (e.g. the H.15 from the Fed), should I be able to reconstruct both a risk-free and a LIBOR yield curve (risk-free for discounting, LIBOR for swap cash flow forecasting)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What I've figured out so far&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) One approach to the risk-free would be to bootstrap the treasury constant maturities series in the H.15.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) In theory the LIBOR should come from bootstrapping the interest-rate swap series in the H.15.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it doesn't feel like either of these are consistent with approaches discussed on this site advocating using the OIS (which I believe is just the effective federal funds on the H.15) to derive a risk-free curve.&lt;/p&gt;&#xA;" OwnerUserId="2119" LastActivityDate="2015-10-04T00:46:19.510" Title="Is it possible to derive a reasonable USD yield curve using only publicly/freely available data sources?" Tags="&lt;yield-curve&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20973" PostTypeId="2" ParentId="20943" CreationDate="2015-09-30T09:25:34.370" Score="1" Body="&lt;p&gt;If I understood the problem, you are valuying the swap in the 1st year. &#xA;The MtM, as you know, is the difference of both legs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value of your swap will be: &#xA;&lt;code&gt;100*(1+3.95%)-100*(1+2%)=1.95&lt;/code&gt; in year 1. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to calculate the MtM value, just divide by the floating rate: &#xA;&lt;code&gt;1.95/(1+2%)=1.911&lt;/code&gt;. &#xA;This is from the fix leg side. If you just change it to the floating rate side, you obtain &lt;code&gt;-1.91&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="12089" LastActivityDate="2015-09-30T09:25:34.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20975" PostTypeId="1" AcceptedAnswerId="21010" CreationDate="2015-09-30T11:53:03.060" Score="8" ViewCount="1297" Body="&lt;p&gt;I'm reading the following short &lt;a href=&quot;http://www.google.ch/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=7&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0CFMQFjAGahUKEwiF68jd1J7IAhVHWxQKHRBkCG8&amp;amp;url=http%3A%2F%2Fwwwf.imperial.ac.uk%2F~mdavis%2Fcourse_material%2FMOP%2FMOP_NOTES.PDF&amp;amp;usg=AFQjCNHuMHZnbrOwc-XKoi-JrhDdmuL60A&quot;&gt;paper&lt;/a&gt; by Davis. In section 2.6 he wants to derive an expression for the hedging error. Assume we have Black scholes setup:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dS_t = S_t(r dt + \sigma dW_t)$$&#xA;$$ dB_t = B_t r dt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and let $C_h(S, r, \sigma, t) = C(t,S_t)$ be the price time $t$ of an option with exercise value $h(S_T)$. By selling at time $0$ the option we receive $C_h(S_0, r, \hat{\sigma},0) $, where $\hat{\sigma}$ is the implied volatility. He assumes that $\sigma = \hat{\sigma}$, the model volatiltiy is correct. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming that our model is not correct, instead $S$ follows a SDE&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dS_t = S_t(\alpha(t,\omega)dt + \beta(\omega, t)dW_t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the involved processes satisfy some regularity condition. We delta hedge the sold option, i.e. the value of our portfolio $X_t$ is given by $X_0=C(0,S_0)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dX_t = \frac{\partial C}{\partial S}dS_t + (X_t -\frac{\partial C}{\partial S}S_t) r dt $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is selfinancing. Denoting $Y_t \equiv C(t,S_t)$ and $Z_t = X_t - Y_t$, the hedging error we obtain&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{d}{dt}Z_t = rX_t - rS_t\frac{\partial C}{\partial S_t}-\frac{\partial C}{\partial t}-\frac{1}{2}\beta^2_t S^2_t \frac{\partial^2 C}{\partial S^2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;denoting $\Gamma_t = \frac{\partial^2 C}{\partial S^2}$ and using the Black Scholes PDE we find&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{d}{dt}Z_t = rZ_t +\frac{1}{2}S_t^2\Gamma_t^2(\hat{\sigma}^2-\beta_t^2)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the square of the gamma is wrong, it should be $\Gamma_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question how does he derive the following last expression $(Z_0 = 0)$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Z_T = X_T- h(S_T) = \int_0^T e^{r(T-s)}\frac{1}{2}S^2_t\Gamma^2_t(\hat{\sigma}^2-\beta^2_t)dt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess the $dt$ should be a $ds$ and all $t$ should be replaced with $s$ under the integral. $Z_T = X_T-h(S_T)$ is clear, thats true by definition. The very last equality is bothering me.&lt;/p&gt;&#xA;" OwnerUserId="17133" LastActivityDate="2015-10-02T18:25:47.417" Title="derivation of the hedging error in a black scholes setup" Tags="&lt;black-scholes&gt;&lt;hedging&gt;&lt;delta-hedging&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20976" PostTypeId="2" ParentId="19518" CreationDate="2015-09-30T12:17:55.060" Score="1" Body="&lt;p&gt;This book by Shumway and Stoffer (two Pitt Stats profs) is excellent IMO:&#xA;Time Series Analysis and Its Applications: With R Examples (Springer Texts in Statistics): 9781441978646&#xA;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/144197864X&quot; rel=&quot;nofollow&quot;&gt;http://www.amazon.com/Time-Series-Analysis-Its-Applications/dp/144197864X&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11767" LastActivityDate="2015-09-30T12:17:55.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20977" PostTypeId="1" CreationDate="2015-09-30T12:28:34.080" Score="0" ViewCount="36" Body="&lt;p&gt;I know this might be an &quot;amateur&quot; question, but I am pretty surprised to see the following fact:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a dependent variable, let's call it Y.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I have an independent variable, let's call it X.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;X is the log return of another quantity, while Y can be either used as a raw (level -- X1) or a log return ( X2 ).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, my results are significant for the level of the independent variable (X1), but not the log return (X2).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is going on ? It is fine to use the level (X1) for my results, right ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="15676" LastActivityDate="2015-09-30T13:34:42.670" Title="Raw (level) variable is significant while log return is not significant" Tags="&lt;log-returns&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20978" PostTypeId="1" CreationDate="2015-09-30T13:05:17.827" Score="6" ViewCount="660" Body="&lt;p&gt;I'm using classic Hull-White model for short term interest rate dynamic:&#xA;$$dr(t)=[\theta(t)-\alpha(t)r(t)]dt+\sigma(t)dW(t)$$&#xA;(Notation is quite intuitive, anyway I am using the same as &lt;a href=&quot;https://en.wikipedia.org/wiki/Hull%E2%80%93White_model&quot; rel=&quot;noreferrer&quot;&gt;Wikipedia&lt;/a&gt; whether any doubt should occur).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to have some feedback from users about the price sensitivity to constant volatility of a callable fixed rate bond priced under such model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let I have a fantasy bond with following features:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;termination date $=$ 1,825 days starting from today&lt;/li&gt;&#xA;&lt;li&gt;coupon payment tenor $=$ annual&lt;/li&gt;&#xA;&lt;li&gt;face amount $= 100$&lt;/li&gt;&#xA;&lt;li&gt;redemption $= 100\%$&lt;/li&gt;&#xA;&lt;li&gt;coupon $= 3\%$ of face amount&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;That above is a callable bond whose call schedule says it can be called at $100$ every year at the same date of maturity, hence we have $4$ scheduled call dates (e.g. if maturity were 28-Sep-2020, we would have following call dates: 28-Sep-2016, 28-Sep-2017, 28-Sep-2018, 28-Sep-2019).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hull-White model parameters:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$\alpha=0.03$&lt;/li&gt;&#xA;&lt;li&gt;$\sigma=132\%$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For the sake of this example, term structure employed in Hull-White model is a snapshot of (linearly interpolated) current euro swap curve - which I attach here below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;LAST_PRICE  Tenor&#xA;-0,135%     0D&#xA;-0,145%     1W&#xA;-0,113%     1M&#xA;-0,040%     3M&#xA;0,029%      6M&#xA;0,012%      11M&#xA;0,025%      1Y&#xA;0,029%      18M&#xA;0,051%      2Y&#xA;0,122%      3Y&#xA;0,230%      4Y&#xA;0,354%      5Y&#xA;0,484%      6Y&#xA;0,619%      7Y&#xA;0,748%      8Y&#xA;0,860%      9Y&#xA;0,963%      10Y&#xA;1,058%      11Y&#xA;1,142%      12Y&#xA;1,331%      15Y&#xA;1,481%      20Y&#xA;1,516%      25Y&#xA;1,520%      30Y&#xA;1,523%      35Y&#xA;1,522%      40Y&#xA;1,498%      45Y&#xA;1,475%      50Y&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;No credit risk!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regardless of days conventions, day counters and trinomial tree engine grid size - which should account just for small variations in final results - my questions are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;what is the clean price Hull-White model is supposed to return with such parameters (mean reversion, volatility and term structure)?&lt;/li&gt;&#xA;&lt;li&gt;Is it possible that halving volatility has a huge impact on clean price - about 15 ~ 20 points?&lt;/li&gt;&#xA;&lt;li&gt;If volatility drops from $132\%$ to, say, $7\%$ does clean price go from very small default-like values (below $10\%$) to &quot;normal&quot; values (around $100\%$)?&lt;/li&gt;&#xA;&lt;li&gt;If (2) and (3) were correct, how would you &lt;strong&gt;qualitatively&lt;/strong&gt; justify such huge volatility sensitivity of the clean price?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3058" LastActivityDate="2015-09-30T13:05:17.827" Title="Callable bond price sensitivity to Hull-White volatility changes" Tags="&lt;volatility&gt;&lt;fixed-income&gt;&lt;hullwhite&gt;&lt;short-rate&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20979" PostTypeId="2" ParentId="20977" CreationDate="2015-09-30T13:23:11.307" Score="1" Body="&lt;p&gt;In practice, when you encounter a relationship between historical financial variables that looks good on levels but not on returns, the model you get from it essentially always fails to be predictive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I generally think of this as being due to the historical relationship arising from some confounding third (plus fourth and fifth...) variable effects that have not made it into the model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a relationship that works in return space&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\Delta y = \beta \Delta x + \epsilon&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then in integrating the processes we get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;y(T)-y(0) = \beta(x(T)-x(0)) + \int_0^T \epsilon \, dt&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and it will be a fairly clean relationship since integration is a smoothing process.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, if we have &#xA;$$&#xA; y = \beta  x + \epsilon&#xA;$$&#xA; then we differentiate to get increments&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{dy}{dt} = \beta \frac{dx}{dt} + \frac{d\epsilon}{dt}&#xA;$$&#xA;which on the face of it looks promising.  However, taking the derivative is a &quot;roughening&quot; operation,&#xA;so any kind of noise in $\epsilon$ gets &quot;blown up&quot; by the differentiation process, essentially swamping the model with noise terms.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2015-09-30T13:34:42.670" LastActivityDate="2015-09-30T13:34:42.670" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20980" PostTypeId="1" AcceptedAnswerId="20989" CreationDate="2015-09-30T13:33:52.783" Score="0" ViewCount="675" Body="&lt;p&gt;Qu 1. Say I ask for EURUSD 1 week and get prices: 1.120986 / 1.120216&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does that mean to price USDEUR 1 week I can divide 1 / 1.120216 and 1 / 1.120986 and get rates: 0.8921 / 0.8927&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or is that result wrongly pitched according to the facts there's a bid/offer spread in the EUR interest rate to USD interest rate differential, and that the inverse of the EURUSD interest rate differential is not the same as the USDEUR interest rate differential? i.e. to get the inverse of the forward price the deposit and loan rates need to be swapped. The deposit and loan rates being the rates the FX forward rates correlate with to prevent arbitrage between FX markets and money markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Qu 2. If EUR 1 week LIBOR is -0.16286% and USD 1 week LIBOR is 0.15375% then what's the interest rate differential between them? (source &lt;a href=&quot;http://www.global-rates.com/interest-rates/libor/european-euro/euro.aspx&quot; rel=&quot;nofollow&quot;&gt;http://www.global-rates.com/interest-rates/libor/european-euro/euro.aspx&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="7369" LastEditorUserId="7369" LastEditDate="2015-09-30T16:56:14.567" LastActivityDate="2015-10-01T03:57:21.143" Title="can an fx forward price simply be divided into 1 to quote the inverse?" Tags="&lt;interest-rates&gt;&lt;fx&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20981" PostTypeId="1" CreationDate="2015-09-30T13:55:35.260" Score="8" ViewCount="222" Body="&lt;p&gt;The &lt;code&gt;SEC's&lt;/code&gt; execution quality statistics measurements (&lt;code&gt;Rule 605&lt;/code&gt;) arguably does a poor job at measuring the execution quality of illiquid securities.  It also does not cover over the counter securities. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What would be a good method to utilize for measuring execution quality for such securities?&lt;/p&gt;&#xA;" OwnerUserId="17709" LastEditorUserId="743" LastEditDate="2015-09-30T14:47:53.850" LastActivityDate="2016-09-01T20:33:00.707" Title="Execution quality for illiquid securities" Tags="&lt;equities&gt;&lt;order-execution&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20982" PostTypeId="2" ParentId="3864" CreationDate="2015-09-30T14:43:49.637" Score="3" Body="&lt;p&gt;Research where the liquidity is, Who are the holders and who have historically been the buyers. Getting insight who the buyers and at what price level they would sell (or buy more) is a good technique.  Often time ownership information is available to the public information. Once you figure out such levels then you know the price levels you can provide larger sized liquidity.  Customer limit orders and prints on the tape can help benchmark your inside.  You will want to consider displaying smaller size at narrower prices but have the capability to provide larger sized liquidity wider than the inside. Look for short term dislocation of prices can bring profit opportunities.  Be careful if you have firm risk obligations and/or regulatory obligations to cover short positions that you can not borrow (such as SEC's reg SHO for equity short positions). &lt;/p&gt;&#xA;" OwnerUserId="17709" LastActivityDate="2015-09-30T14:43:49.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20983" PostTypeId="1" CreationDate="2015-09-30T15:07:23.300" Score="0" ViewCount="203" Body="&lt;p&gt;Consider the Black Scholes model so&#xA;$$dS_t = \mu S_t dt + \sigma S_t dW_t, \;\;\; dB_t = rB_t dt$$&#xA;I want to delta hedge an European call option with strike price $K$ and strike time $T$.&#xA;It is known that the price of the option at $t=0$ is $C_0 = S_0\Phi(d_1) - \exp(-rT)K\Phi(d_2)$ where $d_1, d_2$ are well known but not relevant for my question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the delta of the stock is $\Phi(d_1)$, so my initial portfolio consists of $\Phi(d_1)$ shares in $S$ the portfolio value is then $S_0\Phi(d_1)$. But as I understand we want the initial portfolio value ($V_0$) equal to $C_0$. But that would mean we need to put another $- \exp(-rT)K\Phi(d_2)/B_0$ bonds in the portfolio so that $V_0 = C_0$. This confuses me. How can we buy a negative amound of bonds? What am I doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="17594" LastActivityDate="2015-10-04T21:06:02.363" Title="Initial holdings of bonds with delta hedging (Black Scholes model)" Tags="&lt;black-scholes&gt;&lt;delta-hedging&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20984" PostTypeId="2" ParentId="20983" CreationDate="2015-09-30T16:48:40.330" Score="0" Body="&lt;p&gt;Holding a negative amount is also known as short sale. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Short_(finance)&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Short_(finance)&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2015-09-30T16:48:40.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20985" PostTypeId="1" CreationDate="2015-09-30T21:04:35.493" Score="4" ViewCount="2008" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/oOgfR.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/oOgfR.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone explain how can I calculate the parity of this convertible bond?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know the formula is  Current price of common stock x Conversion Ratio, but it doesn't seem to be right in this picture.&lt;/p&gt;&#xA;" OwnerUserId="17713" LastActivityDate="2015-10-04T09:23:20.627" Title="How to calculate conversion parity for convertible bond?" Tags="&lt;fixed-income&gt;&lt;bloomberg&gt;&lt;convertible-bond&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20988" PostTypeId="1" AcceptedAnswerId="20990" CreationDate="2015-10-01T03:47:07.917" Score="4" ViewCount="726" Body="&lt;p&gt;I always get confused about the cashflows occurring when a futures position is closed out. For example, say it is January and I enter into a long December Futures position with a futures price F(jan). I want to close out my position in July, and the December futures price is F(july), so I short this futures contract. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, as I understand it, in December, the long futures has a payoff of S(Dec) - F(jan), and the short position has a payoff of F(july) - S(Dec), where S(Dec) denotes the value of the underlying asset in december.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the total payoff in F(july) - F(jan), and this payoff happens in december, not when i close my position out in july. However, it seems that in Hull, this payoff is immediate, is there something I'm missing?&lt;/p&gt;&#xA;" OwnerUserId="8105" LastActivityDate="2015-10-01T04:08:56.433" Title="the cash flows behind closing out futures positions" Tags="&lt;futures&gt;&lt;derivatives&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="20989" PostTypeId="2" ParentId="20980" CreationDate="2015-10-01T03:57:21.143" Score="2" Body="&lt;p&gt;Yes, you can just invert (i.e. &lt;code&gt;1/x&lt;/code&gt;) the EURUSD quotes to get the USDEUR bid and offer, as you did in your example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Deposit and loan rates are really just bids and offers for deposits. The difference between them is what creates the bid-offer difference in the fx prices. All 4 rates (USD loan, USD deposit, EUR loan, EUR deposit) are used in the calculation of the bid and offer for EURUSD. All the information is already there. And inverting the fx rates reverses the direction of the trade, using all that same information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your second question is lacking the detail you need to create a bid and offer side. You quote a single rate for each currency, rather than their bids and offers (i.e. deposit and loan). So you can calculate a single forward fx rate, using the 0.3166% differential, but not a two-way market.&lt;/p&gt;&#xA;" OwnerUserId="5550" LastActivityDate="2015-10-01T03:57:21.143" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="20990" PostTypeId="2" ParentId="20988" CreationDate="2015-10-01T04:08:56.433" Score="5" Body="&lt;p&gt;Futures contracts are marked to market every day. This mean that each evening cash is added to or subtracted from your account as a result of the price movement that day. When you close out your position in July these daily cash movements cease, and you are left with F(july) - F(jan) which has gradually accumulated in your account. Nothing at all happens from July to December, since you are out of the future during that time.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-10-01T04:08:56.433" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20991" PostTypeId="1" AcceptedAnswerId="20995" CreationDate="2015-10-01T09:17:25.690" Score="1" ViewCount="1425" Body="&lt;p&gt;In Hull, the following derivation of PCP for futures options:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/7I8mh.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/7I8mh.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What confuses me is that it is stated that the payoff of the long futures is $F_t-F_0$. The footnote states: the analysis assumes that a futures contract is like a forward contract and settled and the end of its life rather than on a day to day basis. I'm not really sure why we can say this is the futures payoff when the futures payoff is: $S_t - F_0$.&lt;/p&gt;&#xA;" OwnerUserId="8105" LastActivityDate="2015-10-03T18:15:17.210" Title="put call parity for futures options derivation in Hull" Tags="&lt;options&gt;&lt;futures&gt;&lt;derivatives&gt;&lt;put-call-parity&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20994" PostTypeId="1" CreationDate="2015-10-01T14:16:45.287" Score="8" ViewCount="2069" Body="&lt;p&gt;Moody's used to publish probability of default estimates from their Moody's EDF model, but they have temporarily discontinued it. I understand that the Moody's EDF model is closely based on the Merton model, so I coded a Merton model in Excel VBA to infer probability of default from equity prices, face value of debt and the risk-free rate for publicly traded companies. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the probabilities of default that I get from the Merton model are drastically different from the Moody's EDF model. Generally they're extremely high or extremely low and the ranking of the same firms is totally different. I understand that Moody's uses an empirical distribution while Merton uses a normal distribution in order to calculate these probabilities - is this the only source of the discrepancy? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I want to accurately reproduce Moody's EDF probabilities of default, what approach should I use? Since I can't reproduce their empirical distribution, is this pointless?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd be happy to post my code if anybody is interested. &lt;/p&gt;&#xA;" OwnerUserId="17712" LastEditorUserId="17712" LastEditDate="2015-10-01T15:24:10.673" LastActivityDate="2018-04-29T13:07:17.223" Title="KMV-Merton Probabilties of Default vs Moody's EDF" Tags="&lt;probability&gt;&lt;models&gt;&lt;default&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="20995" PostTypeId="2" ParentId="20991" CreationDate="2015-10-01T14:38:23.067" Score="1" Body="&lt;p&gt;Futures payoff is indeed $S_t-F_0$, but the $t$ in question is the maturity date of futures. In this derivation $t$ denotes maturity date of the option, which is always before the futures maturity. Therefore, on the day of option maturities, the futures did not expire yet, but the &lt;em&gt;value&lt;/em&gt; of the futures position is $F_t-F_0$ (in mark-to-market sense, you can obtain the value by liquidating the position), and in this sense we can see the future position as having &quot;payoff&quot; of $F_t-F_0$. It's more of a wordplay, than anything substantial to the case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know if Hull prefaces this derivation with simpler explanation, but maybe my take on put/call parity will help you:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Let's say you Buy call option and sell Put option, both with strike $K$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Then at expiry, if market price is higher then strike, you exercise call and obtain long position. If market is lower then strike, counterparty exercises the put against you and again you have long position. So no matter what, you end up with long position (this is called creating synthetic position).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) So, price of Call minus price of Put must be equal to the price of agreeing to buy underlying for the price $K$ at some day in future (maturity date of the options). (otherwise there would be riskless arbitrage for you).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) This is the basic idea, and then you add details, like, whether the undelying is futures or not, whether you pay option premium immediately or not etc. Simply, you sort out what's the value of &quot;agreeing to buy X in the future for price K&quot; and whether you discount the option price, and these product-specific things.&lt;/p&gt;&#xA;" OwnerUserId="3120" LastActivityDate="2015-10-01T14:38:23.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="20996" PostTypeId="2" ParentId="20994" CreationDate="2015-10-01T15:16:07.950" Score="5" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I understand that Moody's uses an empirical distribution while KMV&#xA;  uses a normal distribution in order to calculate these probabilities&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;KMV doesn't use a normal distribution to map distance to default to a probability of default (EDF in the KMV model). It uses a proprietary database. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;By a strict structural interpretation, $EDF$, the expected default&#xA;  frequency, meaning the probability of observing the firm to default&#xA;  within one year, ought to equal the normal probability&#xA;  $EDF_t=N(DD_t)$. KMV, however, breaks the model at this point, and&#xA;  instead relies on its large database of historical defaults to map&#xA;  $DD$ to $EDF$ by a proprietary function $EDF = f(DD)$.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;a href=&quot;https://www.fields.utoronto.ca/programs/scientific/09-10/finance/courses/hurdnotes2.pdf&quot; rel=&quot;noreferrer&quot;&gt;https://www.fields.utoronto.ca/programs/scientific/09-10/finance/courses/hurdnotes2.pdf&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="9265" LastActivityDate="2015-10-01T15:16:07.950" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="20998" PostTypeId="1" CreationDate="2015-10-01T18:11:50.547" Score="0" ViewCount="89" Body="&lt;p&gt;The client can be a CFO or CEO. The information can indicators, charts, graphs, statistics, ratios, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know the VaR is one of them.&lt;/p&gt;&#xA;" OwnerUserId="15490" LastActivityDate="2015-10-02T11:48:04.673" Title="What information should be delivered to the client so they have enough information to manage their exchange rate risks?" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;fx&gt;&lt;var&gt;&lt;market-risk&gt;" AnswerCount="3" CommentCount="0" ClosedDate="2015-10-03T02:20:13.077" ContentLicense="CC BY-SA 3.0" />
  <row Id="20999" PostTypeId="2" ParentId="16426" CreationDate="2015-10-01T18:33:12.970" Score="1" Body="&lt;p&gt;The log likelihood function is indeed rather flat in the $\mu$-direction, for small time horizons (you used $T = 1$ it looks like).  As you may have noticed, increasing the number of observations but keeping the time horizon the same DOES NOT IMPROVE the accuracy of the estimate of $\mu$ - this is a bit counterintuitive, if you ask me.  But, increasing the time horizon $T$ DOES improve the accuracy of the estimate.  To see this, see my question &lt;a href=&quot;https://quant.stackexchange.com/questions/18751/estimating-mu-only-increasing-t-improves-estimate?rq=1&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/0304405X80900070&quot; rel=&quot;nofollow noreferrer&quot;&gt;Merton (1980)&lt;/a&gt; proposed using a Bayesian technique, in which you first specify a prior distribution for $\mu$ and use Bayes' rule to derive a new log likelihood function.  This is nowadays known as &quot;maximum a-posteriori (MAP)&quot; estimation and is one way to try to get better estimate of $\mu$.  But the fact remains: MLE estimation of $\mu$ is notoriously inaccurate for short time horizons.&lt;/p&gt;&#xA;" OwnerUserId="6866" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-10-01T18:33:12.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21000" PostTypeId="2" ParentId="20969" CreationDate="2015-10-01T19:20:51.467" Score="0" Body="&lt;p&gt;The risk free rate can be viewed as the opportunity cost to hold an investment i.e. Every risky investment should at least pay out the risk free rate. This is why you subtract the &lt;strong&gt;Rf&lt;/strong&gt; from the &lt;strong&gt;Rm&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When yields are negative you would have to add the &lt;strong&gt;Rf&lt;/strong&gt; to &lt;strong&gt;Rm&lt;/strong&gt; meaning you should expect to earn a much lower return [everything else held constant]:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;CAPM1= negative interest rates&#xA;CAPM2= positive interest rates&#xA;&#xA;&#xA;Beta= .73&#xA;rf= (-) 0.0032  &#xA;mr= (-)0.0264&#xA;&#xA;CAPM1=  [(-)0.0032 + [(-) 0.0264 – (-) 0.0032]0.73 = -2.0136%&#xA;&#xA;CAPM2=  [0.0032 + [(-) 0.0264 – 0.0032]0.73 = -1.8408%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Remember that CAPM is the expected return on the investment &lt;/p&gt;&#xA;" OwnerUserId="13428" LastActivityDate="2015-10-01T19:20:51.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21001" PostTypeId="2" ParentId="20969" CreationDate="2015-10-01T19:40:34.333" Score="2" Body="&lt;p&gt;Although &lt;strong&gt;Rf&lt;/strong&gt; can be negative (but not too negative), &lt;strong&gt;Rm&lt;/strong&gt; cannot be less than &lt;strong&gt;Rf&lt;/strong&gt; as in your example. It is a non-equilibrium situation, no one would invest in risky securities if they have an expectation lower than risk-free securities. So &lt;strong&gt;Rm&lt;/strong&gt; &gt; &lt;strong&gt;Rf&lt;/strong&gt; is a necessary assumption of the CAPM, whether rates are positive or negative. Also, algebra is algebra and the CAPM is the CAPM, there is no CAPM2.  &lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2015-10-01T19:40:34.333" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21002" PostTypeId="2" ParentId="20998" CreationDate="2015-10-01T20:50:33.477" Score="0" Body="&lt;ul&gt;&#xA;&lt;li&gt;Offer rates for options and currency futures. &lt;/li&gt;&#xA;&lt;li&gt;Upcoming publications for economic indicators for short term FX exposure.&lt;/li&gt;&#xA;&lt;li&gt;Future interest rate decisions for long term exposure.&lt;/li&gt;&#xA;&lt;li&gt;Regression for predicting trends.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;An equation I made for potential risk exposure:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;x = Days of exposure.&lt;/li&gt;&#xA;&lt;li&gt;p = Current price.&lt;/li&gt;&#xA;&lt;li&gt;delta = Historical daily price changes. Subscript is how many days into the past.&lt;/li&gt;&#xA;&lt;li&gt;s = average of delta.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Ql7JY.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Ql7JY.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17727" LastActivityDate="2015-10-01T20:50:33.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21003" PostTypeId="2" ParentId="20998" CreationDate="2015-10-01T22:03:18.617" Score="2" Body="&lt;p&gt;For business purposes, a CFO/CEO typically won't be interested at low-level modeling. Metrics such as:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Maximum portfolio gross/net exposure (hence gross/net leverage)&lt;/li&gt;&#xA;&lt;li&gt;Maximum per trade size per product&lt;/li&gt;&#xA;&lt;li&gt;Maximum intraday exposure per product&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;are probably among the more important ones for business decisions.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2015-10-01T22:03:18.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21004" PostTypeId="2" ParentId="17239" CreationDate="2015-10-01T23:13:35.233" Score="2" Body="&lt;p&gt;Most practitioners think of option prices in terms of implied volatility. It is easier to interpret and to model. One can consider the implied volatility surface as a random field : $\Sigma : \Omega \times \mathbb{R}_+ \times \mathbb{R}_+ \to \mathbb{R}_+$ and apply PCA. The first 3 eigenmodes correspond to absolute level (ATM vol), slope in the strike direction (skew) and curvature in strike direction (smile). See Dynamic of the implied volatility surface by Cont &amp;amp; de Fonseca. Considering pertubation of the coefficients of the modes by a Gaussian noise and then applying the BS formula probably gives you a more realistic and insightful pertubation of the option prices than trying to model directly the movements of the prices.   &lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2015-10-01T23:13:35.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21005" PostTypeId="2" ParentId="20998" CreationDate="2015-10-02T01:24:42.340" Score="2" Body="&lt;p&gt;A CFO typically is not involved in managing risk, though that's not always the case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your hypothetical CFO is involved in the day-to-day managing of FX risk, the following could be useful:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;MtM&lt;/li&gt;&#xA;&lt;li&gt;VaR &amp;amp; Stressed VaR&lt;/li&gt;&#xA;&lt;li&gt;Expected shortfall&lt;/li&gt;&#xA;&lt;li&gt;Correlation between traded currency pairs&lt;/li&gt;&#xA;&lt;li&gt;Sensitivities (Greeks)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If your hypothetical CFO isn't involved in the day-to-day management of risk, VaR and Stressed VaR are great metrics because they sum up information into a single number.&lt;/p&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="9265" LastEditDate="2015-10-02T11:48:04.673" LastActivityDate="2015-10-02T11:48:04.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21007" PostTypeId="2" ParentId="20985" CreationDate="2015-10-02T13:10:06.810" Score="2" Body="&lt;p&gt;That company is probably traded on the Hungarian stock exchange in Hungarian forint.  You would have to multiply the stock price by the euro/forint rate to find parity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that in this case, the bond has a huge coupon (Euribor+5.5%) after the &quot;call date&quot;, effectively forcing the call and making the bond a 4% maturing in 2016.  There's no real point to modeling it any other way.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2015-10-02T13:10:06.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21009" PostTypeId="1" CreationDate="2015-10-02T15:05:20.510" Score="1" ViewCount="139" Body="&lt;p&gt;In GARCH model why we take assumption that returns are i.i.d.?how can we explain it to a layman?&lt;/p&gt;&#xA;" OwnerUserId="17737" LastEditorUserId="-1" LastEditDate="2015-10-05T13:48:25.350" LastActivityDate="2015-10-05T13:48:25.350" Title="GARCH model why we take assumption that returns arei.i.d. random variable?" Tags="&lt;random-variables&gt;" AnswerCount="0" CommentCount="3" ClosedDate="2015-10-02T16:47:25.997" ContentLicense="CC BY-SA 3.0" />
  <row Id="21010" PostTypeId="2" ParentId="20975" CreationDate="2015-10-02T18:25:47.417" Score="7" Body="&lt;p&gt;The differential equation has a trend due to the interest rate. When you discount you take this trend away:&#xA;$$&#xA;  \frac{d}{dt} (e^{-rt}Z_t) = -re^{-rt}Z_t + e^{-rt}  \frac{d}{dt}Z_t = e^{-rt}\frac{1}{2}S_t^2\Gamma_t(\hat{\sigma}^2-\beta_t^2)&#xA;$$&#xA;$Z$ doesn't appear on the rhs anymore and you can integrate &#xA;$$&#xA;e^{-rT}Z_T - e^{-r0}Z_0 = \int_0^T e^{-rt}\frac{1}{2}S^2_t\Gamma_t(\hat{\sigma}^2-\beta^2_t)\,dt&#xA;$$ and mulitply by $e^{rT}$ to get the formula. &#xA;$$&#xA;  Z_T = \int_0^T e^{r(T-t)}\frac{1}{2}S^2_t\Gamma_t(\hat{\sigma}^2-\beta^2_t)dt&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: Note no squared Gamma and no $s$ in the formula.&lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2015-10-02T18:25:47.417" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21012" PostTypeId="2" ParentId="17399" CreationDate="2015-10-02T21:32:59.537" Score="1" Body="&lt;p&gt;I agree that it is important to correct your question in that you are seeing actual trades and not orders.  Near the opening you are likely seeing the crossing of the opening Spins of NYSE and Nasdaq. You will see the same occur after the close with the closing NYSE Exchange spin. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;During the day it is also possible that large prints are the flip out of an accumulation trade for an institutional account that is traded on a &quot;net&quot; basis. Net trading is where the market makers compensation is built into the transactions price rather than a commission.  As an example consider that Institution X is has an order to buy 50,000 share market &quot;Not Held&quot; and will pay up 1 penny from the Market Makers average price.  Market maker accumulates and trades as part of that order and the accumulation trades go to the tape (in smaller sizes) say 50 1000 share trades go to the tape at 10.  Once full accumulation take place he flips 50K to the institution at cost + $.01 or 50k at 10.01.  Since this trade is done at a different price from the average of the accumulation trades the trade reporting rules require the 50K trade to be reported. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another possibility (which is similar) is with guaranteed VWAP transactions where a firm has an order and guarantees a client a VWAP execution for a block of stock.  The trading desk will trade the order and try to make money by bettering the VWAP. At the end of the trade the client will be given a VWAP execution.  If you see odd sub-penny pricing on these larger trades these are likely VWAP trades being flipped to institutions. Most times this trade go off after the close. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that many institutions trade on a fully disclosed commission basis where you would not see the flip of the large print, but there are some that still do trade net where compensation is built into the trade.  This is mostly a matter of preference with one caveat (soft dollars can not be paid on net trading).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Erroneous trades are unlikely. The Large sized HFT print strategies described in the Adam Clark-Joseph &quot;Exploratory Trading&quot; Paper are probably more in the range of 1000-3000 shares and not likely the prints that the question is asking about.  HFT strategies are very sensitive to risk and I would expect that this is not a common strategy. Not to mention that regulators have cautioned firm's against momentum ignition strategies such as this.&lt;/p&gt;&#xA;" OwnerUserId="17709" LastActivityDate="2015-10-02T21:32:59.537" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21015" PostTypeId="1" CreationDate="2015-10-03T14:23:03.007" Score="3" ViewCount="83" Body="&lt;p&gt;I'm going to study the effect of corporate credit rating changes (Moody's) on stock prices before and after a specific financial regulation. So far i have used an event study where i have divided the events in two different groups (0: Before, 1: After), and studied the effects individually.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Downgrades (Day 0) - I have used the market model, and different tests like the simple t-test (MacKinlay - 1997), Patell Z (Patell - 1976) and Corrado's rank test (Corrado - 1992) are all statistically significant at the 0.05 or 0.1 level.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Full sample: Average abnormal return = -0.0061&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Before regulation: Average abnormal return = -0.0074&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;After regulation: Average abnormal return = -0.0044&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;But, i'm not sure how to compare these results. In other words, i'm not sure how to test if the effect of credit rating changes after the regulation is smaller than the effect before the regulation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have looked at this; &lt;a href=&quot;https://quant.stackexchange.com/questions/18804/compare-events-effect-on-stock-prices-from-different-time-periods&quot;&gt;StackExchange - Event study topic&lt;/a&gt; but didn't quite get it. I'm not sure how you can say that &quot;a&quot; is bigger than &quot;b&quot; without some kind of test. I have also looked at a couple of papers about multivariate regression models (with and without bootstrapping) but they tend to be too complicated for a non-statistican.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would really appreciate it if someone could help me with how i can test if there is a significant difference between the two groups or help me get how to do this with multivariate regression models (eg. Binder, J. J. (1985). On the use of the multivariate regression model in event studies.). Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="17724" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2015-10-03T14:23:03.007" Title="Test for difference in security returns before and after financial regulation" Tags="&lt;statistics&gt;&lt;statistical-finance&gt;&lt;testing&gt;&lt;event-study&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21016" PostTypeId="2" ParentId="20991" CreationDate="2015-10-03T18:15:17.210" Score="0" Body="&lt;p&gt;the futures payoff, at the option expiry date is not St-F0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the futures payoff at the option expiry date is  Ft-F0.&lt;br&gt;&#xA;note that Ft&amp;lt;&gt;St since note that the futures will expiry AFTER the option expiry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the reason this is the futures payoff is because the money in the futures margin account earns zero interest, and by payoff, we mean the money in the margin account.&lt;/p&gt;&#xA;" OwnerUserId="17348" LastActivityDate="2015-10-03T18:15:17.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21017" PostTypeId="2" ParentId="20972" CreationDate="2015-10-03T18:25:00.320" Score="2" Body="&lt;p&gt;bootstrap fedfunds (ois ) swaps to get your discount curve (asuming your portfolio is usd, and is usd collateralised).  strangely i dont see the data on the fed site. i see data on LCH's site:&#xA;&lt;a href=&quot;http://www.lchclearnet.com/asset-classes/otc-interest-rate-derivatives/volumes/settlement-prices-swapclear-global#usd&quot; rel=&quot;nofollow&quot;&gt;http://www.lchclearnet.com/asset-classes/otc-interest-rate-derivatives/volumes/settlement-prices-swapclear-global#usd&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to get libor projection curve, you need to bootstrap libor swaps, keeping in mind that they are discounted on the curve you got just now from the ois.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for the fx forwards, you need to get fx forward points market data...  &lt;/p&gt;&#xA;" OwnerUserId="17348" LastActivityDate="2015-10-03T18:25:00.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21018" PostTypeId="1" AcceptedAnswerId="21019" CreationDate="2015-10-03T19:21:32.390" Score="1" ViewCount="690" Body="&lt;p&gt;I have simulated future term structures in the one-factor Hull-White model and calculated the CVA of a particular trade (let's say, now I have it in absolute value, in dollars). However, I want to represent this CVA value as a running spread. As far as I understood from the Gregory's book (2011) &quot;Counterparty credit risk - The new challenge for global financial markets&quot;, to get the annual spread value I have to divide my absolute CVA value by the CDS risky annuity (and then also by the par value to get the value in %). This is something where I am stuck.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The formula of the risk annuity given in the book is (1-exp(-(r+h)(T-t)))/(r+h) where r is the constant continiously compounded interest rate and h is the hazard rate. For my case T-t = 12 years, and the yearly CDS spread is 300 bps. However, in my example r is not constant (I have the upward-sloping initial interest rate term structure). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone advice me how to estimate CVA as a running spread in this case? If u also can offer a good paper as a reference, I would also be very grateful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="17387" LastActivityDate="2015-10-03T19:31:59.177" Title="CVA as a running spread - risk annuity calculation in the Monte Carlo framework" Tags="&lt;monte-carlo&gt;&lt;cds&gt;&lt;cva&gt;&lt;counterparty-risk&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21019" PostTypeId="2" ParentId="21018" CreationDate="2015-10-03T19:31:59.177" Score="2" Body="&lt;p&gt;This only produces an approximation. As per Gregory (page 256) &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;However, adding a spread to a contract such as a swap, the problem is&#xA;  non-linear since the spread itself will have an impact on the CVA. The&#xA;  correct value should be calculated recursively (since the spread is&#xA;  risky too) until the risky MTM of the contract is zero.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;He points to a simpler solution that doesn't require a recursive solution in Vrins and Gregory (2011)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In regards to what value of r to use for an upward sloping curve, I do believe (but am not certain) you want a risk free rate (such as OIS) for the same maturity as T-t. &lt;/p&gt;&#xA;" OwnerUserId="9265" LastActivityDate="2015-10-03T19:31:59.177" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21020" PostTypeId="1" AcceptedAnswerId="21025" CreationDate="2015-10-03T19:44:54.407" Score="-2" ViewCount="99" Body="&lt;p&gt;The EUR/JPY exchange rate increased by 20%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The USD/JPY exchange rate increased by 25%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By how much will the EUR/USD exchange rate decrease?&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9265" LastEditDate="2015-10-03T20:44:02.640" LastActivityDate="2015-10-03T23:58:21.817" Title="Implied exchange rate" Tags="&lt;fx&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21021" PostTypeId="1" AcceptedAnswerId="21062" CreationDate="2015-10-03T20:20:52.417" Score="3" ViewCount="219" Body="&lt;p&gt;Just found some job offer:&#xA;&lt;a href=&quot;http://www.simplyhired.co.uk/job/xyw5rs4dld&quot; rel=&quot;nofollow&quot;&gt;Index and alpha strategies research analyst&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However it seems that the offer is already closed. The thing is I would like to know what are these alpha/index strategies. Can someone give brief description?&lt;/p&gt;&#xA;" OwnerUserId="6599" LastActivityDate="2015-10-06T02:30:10.713" Title="Index and alpha strategies research analyst" Tags="&lt;research&gt;&lt;index&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21022" PostTypeId="1" AcceptedAnswerId="21023" CreationDate="2015-10-03T20:38:58.807" Score="2" ViewCount="1070" Body="&lt;p&gt;Recently I've found out that quantitative department in my company uses mostly &lt;a href=&quot;https://www.r-project.org/&quot; rel=&quot;nofollow&quot;&gt;R software&lt;/a&gt; for modeling in general. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the advantage of modeling financial data in R instead of Excel, or some statistical packages like SPSS and SAS? (Apart from the obvious merit that it is an open source software.)&lt;/p&gt;&#xA;" OwnerUserId="6599" LastEditorUserId="308" LastEditDate="2015-10-05T13:20:58.617" LastActivityDate="2015-10-05T13:20:58.617" Title="What are the advantages of financial modelling in R?" Tags="&lt;r&gt;&lt;statistical-finance&gt;&lt;quants&gt;" AnswerCount="2" CommentCount="0" ClosedDate="2015-10-05T00:31:34.050" ContentLicense="CC BY-SA 3.0" />
  <row Id="21023" PostTypeId="2" ParentId="21022" CreationDate="2015-10-03T21:38:58.433" Score="4" Body="&lt;p&gt;It is very hard to answer this quiz as people might be good at different at tools. For example, if you are good at VBA, then you can achieve the same effect compared to R in most cases. The following parts are the reasons why I prefer to R based on my own situation.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;'package'. This is the most obvious strength of R over Excel in terms of convenience. You may only need one line code to solve a problem which is impossible in Excel;&lt;/li&gt;&#xA;&lt;li&gt;Speed. Once I tried to select some data with 200,000 items with VBA, it takes more than half day, may be I do not have an efficient algorithm. However, it only takes less than half hour by calling C++ script in R. &lt;/li&gt;&#xA;&lt;li&gt;I am not sure if this could be a strength as I never tried but just read it from some materials that it is very convenient to integrate R and broker with some packages.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Hope this could help you.&lt;/p&gt;&#xA;" OwnerUserId="15201" LastActivityDate="2015-10-03T21:38:58.433" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21025" PostTypeId="2" ParentId="21020" CreationDate="2015-10-03T23:58:21.817" Score="1" Body="&lt;p&gt;This seems pretty basic, assuming no arbitrage: &#xA;$$X^{EUR}_{USD}(t+1) = X^{EUR}_{JPY}(t+1)/X^{USD}_{JPY}(t+1) = (1.2*X^{EUR}_{JPY}(t))/(1.25 * X^{USD}_{JPY}(t)) = 0.96 * X^{EUR}_{JPY}(t)$$&#xA;So EUR/USD decreases by 4%.&lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2015-10-03T23:58:21.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21026" PostTypeId="2" ParentId="12741" CreationDate="2015-10-04T00:14:34.440" Score="1" Body="&lt;p&gt;Technically, anything can happen: stocks can rise in rising and falling rate environments. There is no rule that stocks can only rise when rates fall.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other times the market may rise if rates rise &lt;em&gt;less&lt;/em&gt; than the expectation &lt;/p&gt;&#xA;" OwnerUserId="15081" LastActivityDate="2015-10-04T00:14:34.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21027" PostTypeId="2" ParentId="8247" CreationDate="2015-10-04T00:43:46.677" Score="0" Body="&lt;p&gt;Everyone is giving the same type of answer..here is a different perspective. Put call parity can actually be violated in special cases where a positive drift is established ,which is equal , mathematically speaking, to reflected Brownian motion about some floor value. I've seen a few options that have a risk-free profit that exceeds the interest rates. For example, the Jan 2017 Berkshire Hathaway BRK/B ATM 130 dollar options slightly violate put call parity with a discrepancy of $1. Someone could theoretically go long the underlying, sell the call, and buy the put to get a guaranteed return. But this would tie up a lot of capital , so a fund believes  they can get  better return elsewhere, the inefficiency can theoretically remain open provided the opportunity cost remains high enough. A possible  reason why the discrepancy exists into the reflected Brownian motion, in that Warren Buffet has made pledges to not let the stock fall below its 'book value' which acts as a reflected barrier. Black Scholes Formula makes the assumption stocks can go zero (or very close to it), which in the case of BRK is very unlikely. If the barrier is very close to zero and the expiration is near, the violation would too small to notice and within the rounding error. This barrier concept could also explain why Warren Buffet sold 100-year puts on index futures, believing that BS were overpricing them on mathematical premise the S&amp;amp;P 500 could go to zero. If the S&amp;amp;P 500 has a reflecting barrier of even 5% its present price, the 100-year puts are way overpriced according to BS. You would need nuclear war or something awful like that to get the S&amp;amp;P 500 to fall to 5% its present value, in which case the counter-party would probably default anyway.&lt;/p&gt;&#xA;" OwnerUserId="15081" LastEditorUserId="15081" LastEditDate="2015-10-04T00:56:21.747" LastActivityDate="2015-10-04T00:56:21.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21028" PostTypeId="2" ParentId="20972" CreationDate="2015-10-04T00:46:19.510" Score="1" Body="&lt;p&gt;Instead of the constant maturity series (which IMO would give only a few points), you could use the prices of ZCB to get the USD curve. They are available here &lt;a href=&quot;http://www.wsj.com/mdc/public/page/2_3020-tstrips.html&quot; rel=&quot;nofollow&quot;&gt;http://www.wsj.com/mdc/public/page/2_3020-tstrips.html&lt;/a&gt; It might require some slight smoothing to get a clean curve. This is the best way I know to get a US Govt curve for free.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-10-04T00:46:19.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21029" PostTypeId="1" AcceptedAnswerId="21032" CreationDate="2015-10-04T01:57:04.250" Score="6" ViewCount="1035" Body="&lt;p&gt;Can someone provide an intuitive understanding of the variance risk premium? I am very confused by this definition and cannot interpret my time series analysis. &lt;/p&gt;&#xA;" OwnerUserId="20156" LastActivityDate="2015-10-04T18:43:16.703" Title="What is the variance risk premium?" Tags="&lt;time-series&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21030" PostTypeId="2" ParentId="20985" CreationDate="2015-10-04T09:23:20.627" Score="1" Body="&lt;p&gt;The parity in this picture is given as the percentage of the face value. The stock price is given in HUF. I checked the stock price, It reached 16600  in september 2013. The EURHUF that time was something like 299, but we should now the exact time this picture was taken. So we have everything to calculate the parity:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\text{Parity} = \text{Conv Ratio} \cdot \frac{\text{Stock price}}{\text{EURHUF}}:\text{Face value} =984.8326 \cdot \frac{16635}{299.03} :100000 =54,8 \%$&lt;/p&gt;&#xA;" OwnerUserId="13477" LastActivityDate="2015-10-04T09:23:20.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21032" PostTypeId="2" ParentId="21029" CreationDate="2015-10-04T16:10:09.530" Score="5" Body="&lt;p&gt;Intuitively: empirical research has shown that options on the S&amp;amp;P are priced at a slightly higher implied vol than the actual historical vol of the S&amp;amp;P (on average).  Why? Likely this is because holding these options provides insurance against bad states of the economy (volatility increases when the economy is in trouble); this is valuable and raises their price. In any case, the difference between the squared implied vol and the squared historical vol is called the VRP or Variance Risk Premium. The key paper is Bollerslev's in RFS 2009 (cited above by Phun).&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2015-10-04T18:43:16.703" LastActivityDate="2015-10-04T18:43:16.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21033" PostTypeId="1" CreationDate="2015-10-04T16:44:55.133" Score="3" ViewCount="197" Body="&lt;p&gt;I'm a retail algorithmic trader.  I've written some algorithms that parse intraday movements and make decisions.  I still execute trades manually but eventually I need the ability to execute trades on the fly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need a platform where I can implement these algos in C#, F#, Java or Python against live data feeds to flag the situations.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously, TD Ameritrade has Thinkscript but it's not really what I need.  I need to be able to use regular programming languages against live data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="17759" LastActivityDate="2016-08-27T10:42:13.757" Title="What are some options to execute ML algos against with live data using C#, F# or Python for a retail trader?" Tags="&lt;market-data&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21035" PostTypeId="2" ParentId="20715" CreationDate="2015-10-04T19:34:03.190" Score="3" Body="&lt;p&gt;Just found some interesting presentation from Morgan Stanley, about SVaR: &lt;a href=&quot;https://www.imf.org/external/np/seminars/eng/2010/mcm/pdf/RBerner.pdf&quot; rel=&quot;nofollow&quot;&gt;Stress VaR and Systemic Risk Indicators&lt;/a&gt;&#xA;and short video from OptimalMRM: &lt;a href=&quot;https://www.youtube.com/watch?v=L5nYuDsdmU0&quot; rel=&quot;nofollow&quot;&gt;Stressed VaR&lt;/a&gt;. Both helped to grasp differences between VaR and SVaR.&lt;/p&gt;&#xA;" OwnerUserId="6599" LastActivityDate="2015-10-04T19:34:03.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21036" PostTypeId="2" ParentId="20983" CreationDate="2015-10-04T21:06:02.363" Score="3" Body="&lt;p&gt;It just simply means you have to borrow money&lt;/p&gt;&#xA;" OwnerUserId="17761" LastActivityDate="2015-10-04T21:06:02.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21037" PostTypeId="2" ParentId="21022" CreationDate="2015-10-04T22:11:48.600" Score="3" Body="&lt;p&gt;Some advantages of R over Excel:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;R is a scripting language, which allows to record a data manipulation script once and reuse it multiple times.&lt;/li&gt;&#xA;&lt;li&gt;R, as a [scripting] programming language is much more flexible than very limited Excel's GUI. In fact, R has become a de facto statistical programming environment, which delivers most recent statistical techniques. &lt;/li&gt;&#xA;&lt;li&gt;R can handle much bigger data sets, even out of memory with the help of extra packages.&lt;/li&gt;&#xA;&lt;li&gt;R is fast with the help of &lt;code&gt;data.table&lt;/code&gt;, and fast and very flexible with the help of &lt;code&gt;dplyr&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Community, literature, and existing knowledge base on internet/stackoverlflow.&lt;/li&gt;&#xA;&lt;li&gt;R has a superb quality, easy to learn graphing libraries like &lt;code&gt;ggplot2&lt;/code&gt; and many special case others&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Advantages of R over SPSS/SAS:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Free (open source).&lt;/li&gt;&#xA;&lt;li&gt;Versatility of statistical methods (it should be noted here, that at least SAS, in recognition of R's speed of statistical innovation, provides interface to R)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Having said all that, think twice before investing into R as compared to other more modern scripting languages like Python (or Julia)&lt;/p&gt;&#xA;" OwnerUserId="13718" LastActivityDate="2015-10-04T22:11:48.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21038" PostTypeId="1" CreationDate="2015-10-04T23:24:44.280" Score="1" ViewCount="175" Body="&lt;p&gt;I was speaking with a friend of mine about what techniques are used for quantitative investment management, and he told me that, when assuming active positions on the market, even in high-frequency trading, the most valuable knowledge is about time series analysis, data mining and machine learning. Now, apart from time series analysis, I don't know well the other two aforementioned fields. Can anybody suggest references for getting better in those areas?&lt;/p&gt;&#xA;" OwnerUserId="16045" LastActivityDate="2015-10-06T09:43:57.003" Title="Buy side techniques" Tags="&lt;high-frequency&gt;&lt;investment&gt;&lt;soft-question&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21039" PostTypeId="1" AcceptedAnswerId="21049" CreationDate="2015-10-05T00:14:02.480" Score="6" ViewCount="211" Body="&lt;p&gt;From Hull's Options, Futures, and Other Derivatives, 8th ed., problem 4.23:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Excerpt from &lt;strong&gt;Problem 4.23&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;The cash prices of six-month and one-year Treasury bills are 94.0 and 89.0 ...&#xA;Calculate the six-month, one-year ... zero rates.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Working out the six-month zero rate first, I understand that&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\frac {6}{94} = 0.06383 \text{, or } 6.383\text{% in six months}$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Thus, the six-month zero rate is&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$2 \times 6.383 \cong 12.766\text{% per annum (semi-annual compounding)}$$&lt;/span&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$$2 \times \ln{(1 + 0.06383)} \cong 0.1238 \text{, or }12.38\text{% per annum (continuous compounding)}$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;But it is the following calculuation for the 12-month rate that puzzles me:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\frac {11}{89} = 0.12360 \text{, or }12.36\text{% per annum (annual compounding)}$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Why &lt;strong&gt;11&lt;/strong&gt; for the numerator, and not &lt;em&gt;12&lt;/em&gt;, when calculating the 12-month rate?&lt;/p&gt;&#xA;" OwnerUserId="16878" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2015-10-05T11:24:10.057" Title="12-month rate calculation for Problem 4.23 in Hull's Options, Futures, and Other Derivatives" Tags="&lt;homework&gt;&lt;rates&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21041" PostTypeId="5" CreationDate="2015-10-05T01:28:15.423" Score="0" Body="&lt;p&gt;Standard and Poor's 500 Index is a capitalization-weighted index of 500 stocks. The index is designed to measure performance of the broad domestic economy through changes in the aggregate market value of 500 stocks representing all major industries.&lt;/p&gt;&#xA;" OwnerUserId="4848" LastEditorUserId="4848" LastEditDate="2015-10-05T13:47:53.717" LastActivityDate="2015-10-05T13:47:53.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21042" PostTypeId="4" CreationDate="2015-10-05T01:28:15.423" Score="0" Body="Standard and Poor's 500 Index" OwnerUserId="4848" LastEditorUserId="4848" LastEditDate="2015-10-05T13:47:59.337" LastActivityDate="2015-10-05T13:47:59.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21043" PostTypeId="1" AcceptedAnswerId="21054" CreationDate="2015-10-05T01:28:22.420" Score="5" ViewCount="125" Body="&lt;p&gt;Since options lose 2/3 of their time value in the second half of their lifespan, it makes sense to be aware of when an option was issued. What are ways of figuring out when &lt;a href=&quot;http://www.cmegroup.com/trading/equity-index/us-index/e-mini-sandp500_quotes_globex_options.html&quot;&gt;ES futures options&lt;/a&gt; have been and will be issued?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An ad-hoc way of doing this would be to bring up a yearly chart, which would indicate when data started becoming available. I did that for some ES FOP Dec18'15 options, and data became available on Jan 27 or 28, 2015. That's 3.75 quarters back (why weren't these options issued in Dec 2014?). Same for Mar'16 options - apparently issued in Apr 2015; Jun '16 options - no data prior to 7/1/2015.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, data for Nov20'15 options became available around 7/21 - 7/23, so only one quarter back. Are there two cycles at play here?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But then again, for Oct16 '15 - data became available on 5/19/2015. That's ~5 months before expiration. This is confusing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the general formula, and when are &lt;em&gt;new&lt;/em&gt; options being issued?&lt;/p&gt;&#xA;" OwnerUserId="4848" LastEditorUserId="4848" LastEditDate="2015-10-05T02:21:47.740" LastActivityDate="2017-08-15T12:46:29.840" Title="When are ES E-mini future options issued?" Tags="&lt;options&gt;&lt;futures&gt;&lt;spx&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21044" PostTypeId="2" ParentId="21038" CreationDate="2015-10-05T04:30:17.550" Score="2" Body="&lt;p&gt;The classic text for machine learning is 'The Elements of Statistical Learning' by Tibshirani et al. I believe the term &quot;data mining&quot; is often used synonymously with &quot;machine learning&quot;.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2015-10-05T04:30:17.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21045" PostTypeId="1" AcceptedAnswerId="21065" CreationDate="2015-10-05T06:10:41.707" Score="6" ViewCount="733" Body="&lt;p&gt;I have a Forex trading account with a base currency USD. I am holding a position in EUR/JPY and would like to estimate my daily VaR. If I compute the EUR/JPY returns using the historic prices this would not be the right way of doing it, since it would give me returns in JPY which need to be further converted to USD. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the correct way for me to compute the VaR and the underlying returns? &lt;/p&gt;&#xA;" OwnerUserId="5890" LastActivityDate="2015-10-06T07:14:22.303" Title="How to compute returns and daily VaR of a currency position?" Tags="&lt;fx&gt;&lt;returns&gt;&lt;var&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21046" PostTypeId="1" AcceptedAnswerId="21052" CreationDate="2015-10-05T08:49:32.580" Score="12" ViewCount="3861" Body="&lt;p&gt;I have been looking at QuantLib I am trying to figure out why I need to write so much boilerplate code even when pricing the &quot;simplest&quot; of European Options using the analytical Black-Scholes formula (note: I am new to option pricing and I might be missing what the following code provides beyond the textbook option pricing examples. In other words if this code takes into account &quot;real-world&quot; option issues it would be great to point this out):&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#include &amp;lt;ql/quantlib.hpp&amp;gt;&#xA;&#xA;using namespace QuantLib;&#xA;&#xA;int main(int, char* []) {&#xA;&#xA;// date set up&#xA;Calendar calendar = TARGET(); &#xA;Date todaysDate(27, Jan, 2011);&#xA;Date settlementDate(27, Jan, 2011);&#xA;Settings::instance().evaluationDate() = todaysDate;&#xA;&#xA;// option parameters&#xA;Option::Type type(Option::Call);&#xA;Real stock = 47;&#xA;Real strike = 40;&#xA;Spread dividendYield = 0.00;&#xA;Rate riskFreeRate = 0.05;&#xA;Volatility volatility = 0.20;&#xA;Date maturity(27, May, 2011);&#xA;DayCounter dayCounter = Actual365Fixed();&#xA;&#xA;boost::shared_ptr&amp;lt;Exercise&amp;gt; &#xA;europeanExercise(new EuropeanExercise(maturity));&#xA;&#xA;Handle&amp;lt;Quote&amp;gt; &#xA;underlyingH(boost::shared_ptr&amp;lt;Quote&amp;gt;(new SimpleQuote(stock)));&#xA;&#xA;// bootstrap the yield/dividend/vol curves&#xA;Handle&amp;lt;YieldTermStructure&amp;gt; flatTermStructure(boost::shared_ptr&amp;lt;YieldTermStructure&amp;gt;(&#xA;    new FlatForward(&#xA;        settlementDate,&#xA;        riskFreeRate,&#xA;        dayCounter)));&#xA;&#xA;Handle&amp;lt;YieldTermStructure&amp;gt; flatDividendTS(boost::shared_ptr&amp;lt;YieldTermStructure&amp;gt;(&#xA;    new FlatForward(settlementDate,&#xA;        dividendYield,&#xA;        dayCounter)));&#xA;&#xA;Handle&amp;lt;BlackVolTermStructure&amp;gt; flatVolTS(boost::shared_ptr&amp;lt;BlackVolTermStructure&amp;gt;(&#xA;    new BlackConstantVol(&#xA;        settlementDate,&#xA;        calendar,&#xA;        volatility,&#xA;        dayCounter)));&#xA;&#xA;boost::shared_ptr&amp;lt;StrikedTypePayoff&amp;gt; payoff(&#xA;    new PlainVanillaPayoff(&#xA;        type,&#xA;        strike));&#xA;&#xA;boost::shared_ptr&amp;lt;BlackScholesMertonProcess&amp;gt; bsmProcess(&#xA;    new BlackScholesMertonProcess(&#xA;        underlyingH,&#xA;        flatDividendTS,&#xA;        flatTermStructure,&#xA;        flatVolTS));&#xA;&#xA;// our option is European-style&#xA;VanillaOption europeanOption(&#xA;    payoff,&#xA;    europeanExercise);&#xA;&#xA;// computing the option price with the analytic Black-Scholes formulae&#xA;europeanOption.setPricingEngine(boost::shared_ptr&amp;lt;PricingEngine&amp;gt;(&#xA;    new AnalyticEuropeanEngine(&#xA;        bsmProcess)));&#xA;&#xA;// outputting&#xA;std::cout &amp;lt;&amp;lt; &quot;Option type = &quot; &amp;lt;&amp;lt; type &amp;lt;&amp;lt; std::endl;&#xA;std::cout &amp;lt;&amp;lt; &quot;Maturity = &quot; &amp;lt;&amp;lt; maturity &amp;lt;&amp;lt; std::endl;&#xA;std::cout &amp;lt;&amp;lt; &quot;Stock price = &quot; &amp;lt;&amp;lt; stock &amp;lt;&amp;lt; std::endl;&#xA;std::cout &amp;lt;&amp;lt; &quot;Strike = &quot; &amp;lt;&amp;lt; strike &amp;lt;&amp;lt; std::endl;&#xA;std::cout &amp;lt;&amp;lt; &quot;Risk-free interest rate = &quot; &amp;lt;&amp;lt; io::rate(riskFreeRate) &amp;lt;&amp;lt; std::endl;&#xA;std::cout &amp;lt;&amp;lt; &quot;Dividend yield = &quot; &amp;lt;&amp;lt; io::rate(dividendYield) &amp;lt;&amp;lt; std::endl;&#xA;std::cout &amp;lt;&amp;lt; &quot;Volatility = &quot; &amp;lt;&amp;lt; io::volatility(volatility) &amp;lt;&amp;lt;  std::endl &amp;lt;&amp;lt; std::endl;&#xA;std::cout&amp;lt;&amp;lt;&quot;European Option value = &quot; &amp;lt;&amp;lt; europeanOption.NPV() &amp;lt;&amp;lt; std::endl;&#xA;return 0;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9249" LastEditorUserId="17765" LastEditDate="2015-10-05T11:13:33.383" LastActivityDate="2015-10-28T17:37:42.513" Title="Why does it take so many lines of code to price even the simplest of options with QuantLib" Tags="&lt;options&gt;&lt;pricing&gt;&lt;quantlib&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21047" PostTypeId="1" CreationDate="2015-10-05T09:37:45.900" Score="0" ViewCount="259" Body="&lt;p&gt;I want to download the annual dividends(regular,special and repurchaces) for all stocks at Nasdaq for 5 years. Does anyone know where can I find it? &#xA;Thank you&lt;/p&gt;&#xA;" OwnerUserId="17764" LastActivityDate="2015-11-06T21:30:53.933" Title="Where can I download the history of dividends for Nasdaq?" Tags="&lt;equities&gt;&lt;dividends&gt;&lt;nasdaq&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21048" PostTypeId="1" CreationDate="2015-10-05T10:47:44.377" Score="2" ViewCount="221" Body="&lt;p&gt;I have read the description of by.column for rollapply in the manual but i couldn't understand how to use it. see below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;x=matrix(1:60,nrow=10)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;rollapply(x,3,mean,fill=NA,align=&quot;right&quot;,by.column=FALSE)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; [1] NA NA 27 28 29 30 31 32 33 34&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;when i use by.column= FALSE: it applies mean to width (3) rolling number of lines mean(x[1:3,])&lt;/p&gt;&#xA;&#xA;&lt;p&gt;now, if i use by.column=TRUE then i get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;x=matrix(1:60,nrow=10)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;rollapply(x,3,mean,fill=NA,align=&quot;right&quot;,by.column=TRUE)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;     [,1] [,2] [,3] [,4] [,5] [,6]&#xA;&#xA;[1,]  NA   NA   NA   NA   NA   NA&#xA;&#xA;[2,]  NA   NA   NA   NA   NA   NA&#xA;&#xA;[3,]  2   12   22   32   42   52&#xA;&#xA;[4,]  3   13   23   33   43   53&#xA;&#xA;[5,]  4   14   24   34   44   54&#xA;&#xA;[6,]  5   15   25   35   45   55&#xA;&#xA;[7,]  6   16   26   36   46   56&#xA;&#xA;[8,]  7   17   27   37   47   57&#xA;&#xA;[9,]  8   18   28   38   48   58&#xA;&#xA;[10,] 9   19   29   39   49   59&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;i can't make sense of the result. could anyone please explain what's the use of by.column and maybe provide an example?&#xA;Thanks&lt;/p&gt;&#xA;" OwnerUserId="15606" LastEditorUserId="15606" LastEditDate="2015-10-05T11:03:01.720" LastActivityDate="2015-10-05T11:03:01.720" Title="Rollapply: what does by.column do?" Tags="&lt;r&gt;&lt;programming&gt;" AnswerCount="0" CommentCount="2" ClosedDate="2015-10-05T13:47:05.517" ContentLicense="CC BY-SA 3.0" />
  <row Id="21049" PostTypeId="2" ParentId="21039" CreationDate="2015-10-05T11:24:10.057" Score="4" Body="&lt;p&gt;The rate is the return on your investment. Since you'll receive 100\$ after 12 months,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{100 - P}{P} = \frac{100 - 89.0}{89.0} = \frac{11}{89} = 12.36 \%$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Same for the 6-month T-Bill:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{100 - P}{P} = \frac{100 - 94.0}{94.0} = \frac{6}{94} = 6.38 \%$.&lt;/p&gt;&#xA;" OwnerUserId="15336" LastActivityDate="2015-10-05T11:24:10.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21050" PostTypeId="1" CreationDate="2015-10-05T11:48:26.873" Score="2" ViewCount="89" Body="&lt;p&gt;I have new learner &amp;amp; want to make trading as my full time work. I read some articles on charts, that helps to buy or sell shares. Pls tell me, how to read charts &amp;amp; buy or sell shares using that.&lt;/p&gt;&#xA;" OwnerUserId="17766" LastActivityDate="2015-10-05T11:48:26.873" Title="Which is best chart for intraday trading &amp; how to use it?" Tags="&lt;trading&gt;&lt;intraday&gt;&lt;charts&gt;&lt;trading-patterns&gt;" AnswerCount="0" CommentCount="3" ClosedDate="2015-10-05T13:47:33.717" ContentLicense="CC BY-SA 3.0" />
  <row Id="21051" PostTypeId="1" AcceptedAnswerId="21059" CreationDate="2015-10-05T12:42:46.967" Score="3" ViewCount="3525" Body="&lt;p&gt;I am estimating &lt;strong&gt;GARCH model&lt;/strong&gt; for volatility calculation and as a &lt;strong&gt;data input I have used log first difference data&lt;/strong&gt; (ln(a)-ln(b)). &lt;strong&gt;Usually I would check for autocorrelation in residuals&lt;/strong&gt;(to check the model), but since my input was already in the form of first difference, &lt;strong&gt;is this check still necessary?&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason I am not sure is that one of the solutions for autocorrelation is the first difference which I have already applied in the first step and when I did the test I got the autocorrelation for some of my datasets.&lt;/p&gt;&#xA;" OwnerUserId="17286" LastActivityDate="2017-08-22T09:58:23.773" Title="Autocorrelation in the GARCH model residuals" Tags="&lt;garch&gt;&lt;auto-correlation&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21052" PostTypeId="2" ParentId="21046" CreationDate="2015-10-05T13:09:38.600" Score="13" Body="&lt;p&gt;I've been using QuantLib for quite a while. Let me share some experience:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;QuantLib is a highly sophisticated quantitative framework. It can do &lt;strong&gt;much&lt;/strong&gt; and &lt;strong&gt;much&lt;/strong&gt; more than a simple pricing of European option. For example, in your example, you could have changed the payoff to binary payoff or giving a monte-carlo pricing engine (rather than &lt;em&gt;AnalyticEuropeanEngine&lt;/em&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's complicated because the library is designed for flexibility and powers, &lt;strong&gt;not&lt;/strong&gt; simplicity. The QuantLib team does that by clever Object-Oriented and C++ templating. What you see in the code is already fairly advanced.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To appreciate the design, what would you do if you want to incorporate stochastic volatility into the model? You'd modify: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;em&gt;boost::shared_ptr &amp;lt; BlackScholesMertonProcess &gt;&lt;/em&gt; to point to some other stochastic process&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Pass a different pricing engine to &lt;em&gt;setPricingEngine()&lt;/em&gt; &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Can you see the pattern? Pricing with a stochastic model is highly mathematical demanded, but the actual coding would look pretty simple. We'd simply need to give a different pricing engine and a different stochastic process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that you were a bit worried because you were expecting a much simpler pricing code. However, real world pricing code is usually not as simple as you see in the textbook. A real-world pricing library needs to handle calendar, day-counting, dates and many more. QuantLib must be able to do all consistently. If you think QuantLib is hard to learn, try OpenGamma...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, this is a bit overkill for a simple text-book European option pricing. If I was Dr Ballabio, I'd write a simple wrapper.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially, the powers of Quantlib comes when you dive further into quantitative finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDITED for the comment:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can price an option like a calculator in QuantLib. I don't do it because I consider it too low-level (also no day-counting), but it's possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, to price a European option like a text-book, you'd look into &lt;strong&gt;BlackScholesCalculator&lt;/strong&gt; (&lt;a href=&quot;https://github.com/lballabio/quantlib/blob/2a5c086844775b6c1b986df2a5631d2ba3b1e6a4/QuantLib/ql/pricingengines/blackscholescalculator.hpp&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/lballabio/quantlib/blob/2a5c086844775b6c1b986df2a5631d2ba3b1e6a4/QuantLib/ql/pricingengines/blackscholescalculator.hpp&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is as simple as you can get in QuantLib. If you're looking for pricing code, I'd recommend you &lt;em&gt;OptionMatrix&lt;/em&gt;. It's like a cookbook for quantitative finance.&lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="2379" LastEditDate="2015-10-06T15:41:53.393" LastActivityDate="2015-10-06T15:41:53.393" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="21053" PostTypeId="2" ParentId="21038" CreationDate="2015-10-05T13:36:04.433" Score="1" Body="&lt;p&gt;I second Tibshirani's book. There is an another edition you can download free on internet : &lt;a href=&quot;http://www-bcf.usc.edu/~gareth/ISL/&quot; rel=&quot;nofollow&quot;&gt;http://www-bcf.usc.edu/~gareth/ISL/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12228" LastActivityDate="2015-10-05T13:36:04.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21054" PostTypeId="2" ParentId="21043" CreationDate="2015-10-05T13:37:18.033" Score="3" Body="&lt;p&gt;These options are not &quot;issued&quot; in the same way, say, employee stock options are &quot;issued&quot;.  Instead, the expiration months already exist indefinitely into the future, and in a sense options at all expirations already exist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The data series therefore start showing prints when market interest in a given expiration date starts up.  This is of course highly variable and depends on the business needs and psychology of market participants.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2015-10-06T13:51:34.373" LastActivityDate="2015-10-06T13:51:34.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21055" PostTypeId="2" ParentId="20661" CreationDate="2015-10-05T15:42:56.883" Score="1" Body="&lt;p&gt;There are many ways to calculate the volatility. timeframe does not metter. it can be monthly quarterly or daily data. You can call them as volatility metrics.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Volatility Metrics&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Volatility is the degree of trading price over a specific time window. Historical volatility is the degree of price changes of past market prices.Volatility indicates the risk your are taking by investing into a specific instrument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;here are some simple methods&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Best and worst returns&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;A volatility measure is to find worst and best returns for a specific time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, SPY has worst return -8% and best return +4%. Volatility measure is +4%/-8%.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Standard Deviation&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Another measure is standard deviation of monthly returns.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Number of trading days in access of 1%&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;A fourth volatility metric is the number of trading days during a year on which the price of an asset increased or decreased by more than 1 percent.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;True Range&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Average true range (ATR) is a technical analysis volatility indicator originally developed by J. Welles Wilder, Jr. for commodities&#xA;see : Average true range - Wikipedia, the free encyclopedia&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Standard Deviation&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this helps&lt;/p&gt;&#xA;" OwnerUserId="17767" LastEditorUserId="17767" LastEditDate="2015-10-07T10:30:22.957" LastActivityDate="2015-10-07T10:30:22.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21056" PostTypeId="2" ParentId="21046" CreationDate="2015-10-05T16:04:06.423" Score="5" Body="&lt;p&gt;To add to Student T's answer, which I second: the complex setup starts making sense (and its cost gets amortized) once you start keeping the instruments around instead of throwing them away after the pricing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, once the option above is built, you can change the market price of the underlying (or its volatility, or the risk free rate) by just setting a new value to the corresponding quote, and the option will update its price accordingly. You can see an example of this at &lt;a href=&quot;https://www.youtube.com/watch?v=__PBUqjCy6E&quot;&gt;https://www.youtube.com/watch?v=__PBUqjCy6E&lt;/a&gt;, which also demonstrates changing the engine as Student T suggested; the code is in Python, but can be easily translated to C++.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the suggestion of a simple wrapper: instead of writing that and have it call the framework, I'd go the other way and try to extract a simple functional core that the framework would call. But how to do that and remain compatible with the current code is still an open problem...&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2015-10-05T16:04:06.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21058" PostTypeId="2" ParentId="17577" CreationDate="2015-10-05T19:32:10.663" Score="3" Body="&lt;p&gt;The reason these &quot;fake&quot; orders weren't filled was because they would be placed outside of the bid-ask spread. So, imagine the following: you're trying to buy/turnaround S&amp;amp;P 500 E-Mini futures to make a quick profit. The bid is 1976.50 and the ask is 1977.10. What you do is place a large sell order in the market for 1976.10 (or some price below bid) to make it look as if the market is bidding the asset down. You're hoping that this large volume causes the price to fall temporarily, but not enough so to cause your order to actually be filled. In a successful case, the bid falls (because of your large, below-market order) to 1976.20 (or whatever lower figure) causing the resulting ask to be lower as well. You then buy in at this lower ask and cancel your sell order at 1976.10. The strategy is that the price will return to its fair level with your low order now cancelled while you profit on the security you purchased at the artificially depressed price. You can go the opposite direction when it's time to sell and set a fake buy order above market, too.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the risk is when you place your aforementioned 1976.10 sell order, but the market conditions are such that this actually falls within the appropriate bid - ask range, causing the order to execute. This is risky because these fake orders are usually massive in volume, sometimes more than the trader can afford and almost always more than they should allocate. Thus, any small losses on this unintended position can prove disastrous. Additionally, these fake orders are in the opposite direction of the trader's actual bet.&lt;/p&gt;&#xA;" OwnerUserId="17742" LastActivityDate="2015-10-05T19:32:10.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21059" PostTypeId="2" ParentId="21051" CreationDate="2015-10-05T21:54:47.350" Score="3" Body="&lt;p&gt;You should check for autocorrelation. However, its presence does not necessarily mean your model will produce inaccurate figures. The ARCH family of models were developed to help analyze the volatility of a time-series. This data is assumed to display a degree of heteroskedasticity. Using the GARCH model, small amounts of auto-correlation (not of practical importance) can cause large p-values unless your sample-size is massive.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should test the squared residuals of your model for autocorrelation rather than the standard method of t vs (t-1), since significant (short-term) autocorrelation in this data may actually be appropriate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Good insight from @John as well. Would comment on his answer but don't have the rep. First-differencing can theoretically cause inaccurate GARCH residuals and is really not the preferred method for dealing with autocorrelation in this instance. John's suggestion or weighted OLS estimators is the better way to go in this case. &lt;/p&gt;&#xA;" OwnerUserId="17742" LastEditorUserId="17742" LastEditDate="2015-10-05T23:45:51.407" LastActivityDate="2015-10-05T23:45:51.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21060" PostTypeId="2" ParentId="21051" CreationDate="2015-10-05T23:29:05.447" Score="1" Body="&lt;p&gt;To add to @Brumder's answer, people typically take a two-step approach when concerned about both Garch and autocorrelation: first fit some sort of ARMA(p,q) model, and then second use maximum likelihood on the residuals of the first step to estimate the Garch parameters.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2015-10-05T23:29:05.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21061" PostTypeId="2" ParentId="20981" CreationDate="2015-10-05T23:57:36.493" Score="2" Body="&lt;p&gt;You would need intra-day bid-ask and volume data, otherwise this would be difficult to analyze. Even with large spreads, your trade can execute on either end of the spectrum just based off of how the market is trending that second as a whole for most low-volume securities. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For most truly illiquid securities, execution is more dependent on the broker's relationships and ability to move volume than it is the market, making it hard to classify execution for a single product as a whole. Not addressing OTC securities is really not leaving you with a lot of assets to investigate anyway.  &lt;/p&gt;&#xA;" OwnerUserId="17742" LastEditorUserId="17742" LastEditDate="2016-09-01T20:33:00.707" LastActivityDate="2016-09-01T20:33:00.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21062" PostTypeId="2" ParentId="21021" CreationDate="2015-10-06T02:30:10.713" Score="3" Body="&lt;p&gt;It is a very broad statement that just means that you would research and document the performance of fixed income strategies of two kinds: those that simply follow an index (passive strategies) or those that attempt to outperform passive indexes by following an active (but systematic) approach. An example of the latter might be momentum strategies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in essence it hardly says anything at all ;)&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-10-06T02:30:10.713" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21063" PostTypeId="1" CreationDate="2015-10-06T03:02:59.660" Score="4" ViewCount="335" Body="&lt;p&gt;I came across a ratio plotting of Corn And Soybeans contracts, notice it's in a historical low, an intuitive question came to my mind, how should I trade this ratio (or relationship)? It's unlike flat or spread prices, which is always linear to the underlyings, what is also interesting on how to calculate the pnl if I trade a ratio not a linear combination of underlyings? &lt;a href=&quot;https://i.stack.imgur.com/be3Sf.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/be3Sf.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2479" LastEditorUserId="467" LastEditDate="2015-10-08T07:55:11.963" LastActivityDate="2016-01-06T10:13:05.300" Title="How to trade a Ratio?" Tags="&lt;time-series&gt;&lt;programming&gt;&lt;quant-trading-strategies&gt;&lt;commodities&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21064" PostTypeId="2" ParentId="21063" CreationDate="2015-10-06T07:13:58.837" Score="0" Body="&lt;p&gt;Let me try to explain it. &#xA;What I will do is to check if the ratio is increasing or decreasing. I mean, if the difference between the two assets is getting bigger or smaller. In this case, the difference among corn and soybeans. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I did is just consider it as an independant portfolio with only two assets, and buying or selling depending on the slope of the ratio(difference) and my previous position. &#xA;I mean, if I expected the ratio to increase(corn increases more than soybean) and I was neutral in soybean, and I needed financing, I sell soybean and buy corn. Considering the same case and I didn't need financing, I just bought corn.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this answers your question?&lt;/p&gt;&#xA;" OwnerUserId="12089" LastActivityDate="2015-10-06T07:13:58.837" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21065" PostTypeId="2" ParentId="21045" CreationDate="2015-10-06T07:14:22.303" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;Apply your trading strategy to history.&lt;/li&gt;&#xA;&lt;li&gt;Convert account equity to USD by applying historical USD/JPY rates.&lt;/li&gt;&#xA;&lt;li&gt;Calculate VAR/returns as usual.  &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Remember, VAR calculated in such a way will underestimate the impact of extreme events: i.e. 95% VAR will return you minimum of what you can lose on 5% trading days.&lt;/p&gt;&#xA;" OwnerUserId="13718" LastActivityDate="2015-10-06T07:14:22.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21066" PostTypeId="2" ParentId="21038" CreationDate="2015-10-06T08:56:49.397" Score="0" Body="&lt;p&gt;Buy side techniques such as machine learning might be useful but i have not seen any trader applying this method. (see market wizards book series) Some tried but stopped using.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Larry Williams, and seasonal, cyclical traders are using patterns based on month of day, days of week etc... you can analyze them as well. There is also best know 6 months of year pattern (see Traders Almanac)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You must know how to backtest any trading/investing strategy before applying them even you read them in a book from a master trader. You have to analyse the strategy by yourself. Do not forget that the markets do not behave the same as they where before. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some of the key metrics to analyse any daily pattern or trading/investing strategy are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;No Trades (must be greater than 30 – pref. much more) &lt;/li&gt;&#xA;&lt;li&gt;No. Trades/ Year/ Month (whatever time period is relevant) &lt;/li&gt;&#xA;&lt;li&gt;% Long Trades/ % Short Trades (is there a bias?) &lt;/li&gt;&#xA;&lt;li&gt;Win%/ Success Rate &lt;/li&gt;&#xA;&lt;li&gt;Average R:R &lt;/li&gt;&#xA;&lt;li&gt;Expectancy (Average profit per dollar risked) – Must be a positive number!&lt;/li&gt;&#xA;&lt;li&gt;Avg. no days in trade (Carry costs/ duration exposed to risk) &lt;/li&gt;&#xA;&lt;li&gt;Maximum R multiple drawdown measured &lt;/li&gt;&#xA;&lt;li&gt;Min/ Max/ Avg. Pips Risked&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(see &lt;a href=&quot;http://blog.cmcmarkets.com.au/analysts/ric-spooner/backtesting-trading-strategies/&quot; rel=&quot;nofollow&quot;&gt;http://blog.cmcmarkets.com.au/analysts/ric-spooner/backtesting-trading-strategies/&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To avoid any biases. You have to test your method by using different time periods such as insample outof sample etc... to validate its validity. blindly apply datamining, or machine learning will not guide you anywhere.&lt;/p&gt;&#xA;" OwnerUserId="17767" LastEditorUserId="17767" LastEditDate="2015-10-06T09:43:57.003" LastActivityDate="2015-10-06T09:43:57.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21067" PostTypeId="1" CreationDate="2015-10-06T08:57:51.597" Score="4" ViewCount="126" Body="&lt;p&gt;Consider the condition  which the weights of any portfolio belonging to the efficient frontier satisfy:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\gamma\boldsymbol{wC} = \boldsymbol{m} - \mu\boldsymbol{u}\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming we have three securities &#xA;$\boldsymbol{w}= [w_1,w_2,w_3],m=[\mu_1,\mu_2,\mu_3],u =[1,1,1], \gamma =\dfrac{u_V-\mu}{\sigma^2_v}$.$\boldsymbol{C}$ is the covariance matrix,$\mu_V$ is the expected return of this portfolio, $w_i$ is the weight and $\mu_i$ is the expected return on security $i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I need to do is to compute the values of $\gamma$ and $\mu$ such that the weights $\boldsymbol{w}$ satisfy $\gamma\boldsymbol{wC} = \boldsymbol{m} - \mu\boldsymbol{u}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume that we have all values except $\mu$ and $\gamma$ The way to do this,according to my book, is by first multiply this condition(equality) by $\boldsymbol{C}^{-1}\boldsymbol{u}^T$ and, respectively, $\boldsymbol{C}^{-1}\boldsymbol{m}^t$ so that we get: &#xA;\begin{equation}\mu_V(\boldsymbol{m} - \mu\boldsymbol{u})\boldsymbol{C}^{-1}\boldsymbol{u}^T = (\boldsymbol{m}-\mu \boldsymbol{u})\boldsymbol{C}^{-1}m^T \end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(since $\boldsymbol{w}\boldsymbol{u}^{T}$ = 1 and $\boldsymbol{w}\boldsymbol{m}^T = \mu_V$ , also if it is of any use $\sigma^2_V = \boldsymbol{w}\boldsymbol{C}\boldsymbol{w}^T$  )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I don't see how to obtain this equality the way the book describes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\gamma\boldsymbol{wC} (\boldsymbol{C}^{-1}\boldsymbol{u}^T)(\boldsymbol{C}^{-1}\boldsymbol{m}^T)  = (\boldsymbol{m} - \mu\boldsymbol{u}) (\boldsymbol{C}^{-1}\boldsymbol{u}^T)(\boldsymbol{C}^{-1}\boldsymbol{m}^T)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the left hand side I get $\gamma (\boldsymbol{C}^{-1}\boldsymbol{m}^T) $.Anyhow I don't see how to get this to the equation above(how the book did it).Could someone show me how they did it or what Iam missing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;...The next step would be to solve for $\mu$ and this is as follows&#xA;\begin{equation} \mu= \dfrac{\boldsymbol{m} \boldsymbol{C}^{-1}( \boldsymbol{m}^T - \mu_V \boldsymbol{u}^T) }{\boldsymbol{u} \boldsymbol{C}^{-1}( \boldsymbol{m}^T - \mu_V \boldsymbol{u}^T)} \end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is obtained from: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}\mu_V(\boldsymbol{m} - \mu\boldsymbol{u})\boldsymbol{C}^{-1}\boldsymbol{u}^T = (\boldsymbol{m}-\mu \boldsymbol{u})\boldsymbol{C}^{-1}m^T \end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once again I don't know how they did it. Could someone show the steps in more detail??&lt;/p&gt;&#xA;" OwnerUserId="17610" LastEditorUserId="17610" LastEditDate="2015-10-06T09:03:39.877" LastActivityDate="2016-02-22T02:27:57.523" Title="Computing $\gamma$ and $\mu$ at the efficient frontier" Tags="&lt;portfolio-management&gt;&lt;finance&gt;&lt;markowitz&gt;&lt;self-study&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21068" PostTypeId="2" ParentId="21046" CreationDate="2015-10-06T12:44:13.317" Score="6" Body="&lt;p&gt;And don't forget that there &lt;em&gt;are&lt;/em&gt; wrappers as eq &lt;a href=&quot;http://dirk.eddelbuettel.com/code/rquantlib.html&quot;&gt;RQuantLib&lt;/a&gt; which I use on the command-line here:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;edd@max:~$ r -l RQuantLib -e 'print(EuropeanOption(&quot;call&quot;, 47, 40, 0.05, 0.0, 4/12, 0.2))'&#xA;    Concise summary of valuation for EuropeanOption &#xA;       value    delta    gamma     vega    theta      rho   divRho &#xA;      6.4728   0.8899   0.0307   4.5139   0.7372  11.7849 -13.9425 &#xA;    edd@max:~$ &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where 4/12 is quick and dirty for the maturity.  That should pick up your example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At an R prompt, it looks a little more natural:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;R&amp;gt; library(RQuantLib)&#xA;R&amp;gt; ans &amp;lt;- EuropeanOption(&quot;call&quot;, 47, 40, 0.05, 0.0, 4/12, 0.2)&#xA;R&amp;gt; ans&#xA;Concise summary of valuation for EuropeanOption &#xA;   value    delta    gamma     vega    theta      rho   divRho &#xA;  6.4728   0.8899   0.0307   4.5139   0.7372  11.7849 -13.9425 &#xA;R&amp;gt; str(ans)&#xA;List of 7&#xA; $ value : num 6.47&#xA;     $ delta : num 0.89&#xA; $ gamma : num 0.0307&#xA;     $ vega  : num 4.51&#xA; $ theta : num 0.737&#xA;     $ rho   : num 11.8&#xA; $ divRho: num -13.9&#xA; - attr(*, &quot;class&quot;)= chr [1:2] &quot;EuropeanOption&quot; &quot;Option&quot;&#xA;R&amp;gt; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This shows both the result of the default &lt;code&gt;print&lt;/code&gt; method as well as the components of the returned object.&lt;/p&gt;&#xA;" OwnerUserId="69" LastActivityDate="2015-10-06T12:44:13.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21069" PostTypeId="1" CreationDate="2015-10-06T13:21:43.467" Score="1" ViewCount="61" Body="&lt;p&gt;For a project of mine I need to find a stock that is traded on two venues, e.g. &lt;code&gt;NYSE&lt;/code&gt; and &lt;code&gt;NASDAQ&lt;/code&gt;, but could be others. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I need to use data from both venues. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know how one would go about finding a stock that are traded on two venues? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because it seems like an overly tedious task to go through the single stocks one by one and check if they are on another exchange. Are there e.g. a list somewhere with this information?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another information that is important in my choice is, that it needs to have a very large average trade volume.&lt;/p&gt;&#xA;" OwnerUserId="15936" LastEditorUserId="743" LastEditDate="2015-10-06T17:31:15.597" LastActivityDate="2015-10-06T17:31:15.597" Title="Finding a stock traded at two venues" Tags="&lt;market-data&gt;&lt;finance&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21071" PostTypeId="1" CreationDate="2015-10-06T14:13:44.883" Score="1" ViewCount="21" Body="&lt;p&gt;Perhaps some of you came across the following task that I am trying to automate for @RISK, VOSE or other simulation software? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a question as we are trying to use the software to estimate the project sizing by modelling each step along the way. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Project contains three different types of steps (A,B,C) defined by their own distributions and the number of each might not be equal (N of A's, M B's, K of C's). As per statistics rules I will need to generate a value for each of A's, each of B's and each of C's and then add them up together. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I cannot generate one value and then just multiply it as each event is unique on its own. I want to have the model being locked in a separate tab and not modified, while as the first page should contain the N,M, and K where user should input parameters. How can I allow the number of variables change in accordance to the numbers of N,M, and K? &lt;/p&gt;&#xA;" OwnerUserId="17774" LastEditorUserId="743" LastEditDate="2015-10-06T15:02:29.850" LastActivityDate="2015-10-06T15:02:29.850" Title="Multiple similar values simulation" Tags="&lt;risk-management&gt;&lt;monte-carlo&gt;&lt;probability&gt;&lt;analysis&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21072" PostTypeId="2" ParentId="21069" CreationDate="2015-10-06T15:01:37.843" Score="0" Body="&lt;p&gt;If you have access to datastream:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://datateamoftheeur.wordpress.com/2013/05/23/faq-how-can-i-find-cross-listed-stocks-in-datastream/&quot; rel=&quot;nofollow&quot;&gt;https://datateamoftheeur.wordpress.com/2013/05/23/faq-how-can-i-find-cross-listed-stocks-in-datastream/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-10-06T15:01:37.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21073" PostTypeId="2" ParentId="21069" CreationDate="2015-10-06T15:23:16.637" Score="1" Body="&lt;p&gt;I'm not sure the question makes sense with today's cash equity markets.  Pretty much all cash equities can trade on any of the 40 dark pools and ECN's in the US.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See: &lt;a href=&quot;https://en.wikipedia.org/wiki/List_of_stock_exchanges_in_the_Americas&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/List_of_stock_exchanges_in_the_Americas&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I guess the answer is that almost all stocks listed on say the NYSE can trade on any of the other stock exchanges.  Now whether or not they actually execute trades on those exchanges is another story.&lt;/p&gt;&#xA;" OwnerUserId="743" LastActivityDate="2015-10-06T15:23:16.637" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21075" PostTypeId="1" CreationDate="2015-10-06T17:58:38.670" Score="3" ViewCount="6366" Body="&lt;p&gt;My model exports a vector that have for each day b-buy s-sell or h- hold&#xA;it's look like this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;sig   [1] b b s s b b b s s b s b s s b s b s s s s b b s s b b b b b&#xA;  b s b b b b b b b&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I want to backtest that it will buy or sell all the equity in the portfolio at the end of each day and for hold will do nothing.&#xA;what is the best way to backtest in R or other method this strategy?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="17585" LastActivityDate="2020-09-18T19:15:57.807" Title="Is there a good backtesting package in R?" Tags="&lt;r&gt;&lt;backtesting&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21077" PostTypeId="1" AcceptedAnswerId="21078" CreationDate="2015-10-06T21:08:20.590" Score="1" ViewCount="515" Body="&lt;p&gt;I have a bond with a time to maturity of 5, a nominal value of $100, coupons of \$3,- and an yield price that I need to calculate so that the bond price equals \$100,-. This yield value is symbolized by y in the following formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P_{markt}=\sum\limits_{t=1}^{5}\frac{3}{(1+y)^t}+\frac{100}{(1+y)^{11}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to easilly calculate this value of $y$ in excel? At the moment, I sum all the bond payments and the present value, and change the interest rate until I have the right value. Can this be done more efficient?&lt;/p&gt;&#xA;" OwnerUserId="17778" LastActivityDate="2015-10-06T21:38:31.493" Title="Calculate yield of maturity for a certain price in excel" Tags="&lt;bond&gt;&lt;bond-yields&gt;&lt;excel&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21078" PostTypeId="2" ParentId="21077" CreationDate="2015-10-06T21:29:20.523" Score="0" Body="&lt;p&gt;This formula in excel should do it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;=RATE((5*1),((3/100)*100),-100,100)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You'll find it's 3% since YTM = coupon when the nominal value = market price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, for the bond's market price to = 100 (face value), the YTM will be the same as the coupon which in this case = (payment/face value) = (3/100) or 3%. You can change the market price of the bond (-100 in the formula) and y will adjust to the appropriate figure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By hand, guessing &amp;amp; checking is the only way to get an exact figure (unless you have a financial calculator). However, for an estimate you can use the following: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/DwPTY.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/DwPTY.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17742" LastEditorUserId="17742" LastEditDate="2015-10-06T21:38:31.493" LastActivityDate="2015-10-06T21:38:31.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21079" PostTypeId="2" ParentId="21067" CreationDate="2015-10-06T21:39:02.820" Score="2" Body="&lt;p&gt;First of all I’ll work with column vectors because I find it easier than with row vectors as you did. I guess it’s a little bit easier if we modify your first equation a little bit. Notice that is really the first order condition of the following lagrangian:&#xA;$$L(w, \lambda, \delta)= \frac{1}{2}{\bf w^TCw} - \lambda({\bf w^Tm} - \mu_v) - \delta({\bf w^Tu} - 1)$$&#xA;that you use to minimize variance ${\bf w^TCw}$ s.t. to the portfolio having a specific return (${\bf w^Tm}=\mu_v$) and portfolio weights summing to one (${\bf w^Tu}=1$). The first order condition w.r.t. portfolio weights is:&#xA;$${\bf Cw}=\lambda {\bf m} - \delta {\bf u}$$&#xA;which is exactly your first equation when $\lambda=1/\gamma$ and $\delta=\mu/\gamma$. Every mean-variance efficient portfolio must satisfy this relationship. Now you can premultiply by ${\bf C^{-1}}$ both sides to obtain &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$${\bf (Eqn. 1)} \text{  }{\bf w}=\lambda {\bf C^{-1}m} + \delta {\bf C^{-1}u}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally you realise that your constraints were ${ \bf u^Tw}=1$ and ${\bf m^T w}=\mu_v$ therefore if you premultiply &lt;strong&gt;(Eqn. 1)&lt;/strong&gt; once by ${\bf u^T}$ and once by ${ \bf m^T}$ you’ll get the following two equations:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$${\bf u^Tw}=\lambda {\bf u^TC^{-1}m} + \delta {\bf u^TC^{-1}u} = 1$$&#xA;$${\bf m^Tw} = \lambda {\bf m^TC^{-1}m} + \delta {\bf m^TC^{-1}u} = \mu_v$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice that $a={\bf u^TC^{-1}m}={\bf m^TC^{-1}u}$ , $b={\bf u^TC^{-1}u}$ and $c={\bf m^TC^{-1}m}$ are all scalars, hence you can find $\lambda$ and $\delta$ (and therefore your desired $\gamma=1/\lambda$ and $\mu=\delta/\gamma$) as the solutions of the following linear system in two unknowns:&#xA;$$a\lambda + b\delta = 1$$&#xA;$$c\lambda + a\delta = \mu_V$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;A Bonus:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just to give you a little bit of intuition: if you normalise the first addend on the right hand side of &lt;strong&gt;(Eqn. 1)&lt;/strong&gt; by ${\bf u^TC^{-1}m}$ and the second addend by ${\bf u^TC^{-1}u}$ you have:&#xA;$${\bf (Eqn. 2 ) }  {\bf w}=\lambda {\bf u^TC^{-1}m} \frac{{\bf C^{-1}m}}{{\bf u^TC^{-1}m}} + \delta {\bf u^TC^{-1}u \frac{C^{-1}u}{u^TC^{-1}u}} =$$$$= k^* {\bf w^*} + k^{MV} {\bf w^{MV}} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $k^*=\lambda {\bf u^TC^{-1}m}$ and $k^{MV}=\delta {\bf u^TC^{-1}u}$ are two scalars that sum up to one, that is $k^*+k^{MV} = \lambda {\bf u^TC^{-1}m} + \delta {\bf u^TC^{-1}u} = {\bf u^T}(\lambda {\bf C^{-1}m} + \delta {\bf C^{-1}u}) = {\bf u^Tw} = 1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;${\bf w^*=\frac{C^{-1}m}{u^TC^{-1}m}}$ and ${\bf w^{MV}\frac{C^{-1}u}{u^TC^{-1}u}}$ are two portfolios on the frontier; in particular it can be shown that ${\bf w^{MV}}$ is the portfolio with the global minimum variance. From here you can see that &lt;a href=&quot;https://en.wikipedia.org/wiki/Mutual_fund_separation_theorem&quot; rel=&quot;nofollow&quot;&gt;two funds are enough to span the whole frontier&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8028" LastEditorUserId="8028" LastEditDate="2015-10-06T21:53:57.493" LastActivityDate="2015-10-06T21:53:57.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21080" PostTypeId="1" CreationDate="2015-10-06T23:12:19.217" Score="4" ViewCount="94" Body="&lt;p&gt;By term structure I mean a &lt;strong&gt;non-stationarity&lt;/strong&gt; in the pattern of &lt;strong&gt;intraday adverse selection&lt;/strong&gt; as a given instruments approaches its &lt;strong&gt;expiry&lt;/strong&gt;. Note that I am interested in the adverse selection on the instrument itself, not the underlying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the empirical side, I've seen myself a significant uptick of the price impact on S&amp;amp;P500 E-mini futures in the week leading into expiry. I am interested in understanding if that empirical observation is linked to a general decrease of liquidity as people rotate out of the instrument, or if there is something else in play.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;References on models, whether theoretical or empirical would be greatly appreciated!&lt;/p&gt;&#xA;" OwnerUserId="17779" LastActivityDate="2015-10-06T23:12:19.217" Title="Are there academic papers on the 'term structure' of adverse selection for futures and options?" Tags="&lt;options&gt;&lt;futures&gt;&lt;high-frequency&gt;&lt;market-microstructure&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21082" PostTypeId="1" CreationDate="2015-10-07T02:23:09.487" Score="3" ViewCount="1131" Body="&lt;p&gt;Estimating the volatility of a portfolio is typically done by first estimating the covariance matrix. This, however, can be difficult to do accurately and predictivly. This &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2411493&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; gives a nice summary of the various methods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But why make it so complicated?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say there are $n$ securities $s_1, s_2 \dots s_n$, which at time $t$ has a price of $p_{i,t}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You're interested in the portfolio with weights $w_i$ in security $s_i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why not take the time series of the portfolio value $\sum w_i p_{i,t}$ and do a normal GARCH estimate on that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This technique seems more straight forward and probably just as accurate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I missing something?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;This was also asked &lt;a href=&quot;https://stats.stackexchange.com/questions/175793/estimate-volatility-of-portfolio-by-using-garch-on-the-portfolio-returns&quot;&gt;here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update 10/7&lt;/strong&gt;: To be clear, I would like to estimate the current volatility of the portfolio.&lt;/p&gt;&#xA;" OwnerUserId="13857" LastEditorUserId="13857" LastEditDate="2015-10-07T15:22:08.383" LastActivityDate="2015-10-07T17:41:35.023" Title="Could we estimate a portfolio's volatility using a GARCH on the portfolio returns?" Tags="&lt;volatility&gt;&lt;garch&gt;&lt;portfolio-optimization&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21083" PostTypeId="2" ParentId="21082" CreationDate="2015-10-07T05:28:46.173" Score="1" Body="&lt;p&gt;If you want to use &lt;a href=&quot;https://en.wikipedia.org/wiki/Autoregressive_conditional_heteroskedasticity&quot; rel=&quot;nofollow&quot;&gt;GARCH&lt;/a&gt; to estimate past local volatility of the portfolio you can do but, but you'd use GARCH to model the portfolio returns, not prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you will be able to build a range of possible volatilities in the futures given a certain confidence level and you would have a local volatility $\sigma_t$ for each historical point.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2015-10-07T05:28:46.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21084" PostTypeId="1" AcceptedAnswerId="21108" CreationDate="2015-10-07T06:35:14.300" Score="-1" ViewCount="601" Body="&lt;p&gt;I am using explicit finite difference (backward scheme) to price a binary call option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my MATLAB code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;clear&#xA;clc&#xA;&#xA;S=100;&#xA;K=100;&#xA;R=0.05;&#xA;Sigma=0.2;&#xA;T=1;&#xA;&#xA;% Binary Option&#xA;d1=(log(S/K)+(R+0.5*Sigma^2)*T)/(Sigma*sqrt(T));&#xA;d2=d1-(Sigma*sqrt(T));&#xA;&#xA;Binary_BS=normcdf(d2)*exp(-R*T);&#xA;&#xA;%% Finite Difference Method&#xA;&#xA;% Stability Condition&#xA;&#xA;Asset_Steps=400;&#xA;ds=2*K/Asset_Steps;&#xA;dt=0.9/(Asset_Steps*Asset_Steps)/(Sigma*Sigma);&#xA;NTS=round(T/dt)+1;&#xA;dt=T/NTS;&#xA;&#xA;% Allocation Memory&#xA;V_New=zeros(Asset_Steps+1,1);&#xA;&#xA;% Setting The Payoff Function&#xA;Stock=(1:(Asset_Steps+1))*ds;&#xA;Payoff(Stock&amp;gt;K,1)=1;&#xA;V_Old=Payoff;&#xA;&#xA;&#xA;&#xA;%Solving The Grid&#xA;&#xA;for k=NTS:-1:0&#xA;&#xA;    for i=(Asset_Steps):-1:2&#xA;&#xA;        % Discretizing The Option Value and Computing The Greeks&#xA;&#xA;        Delta= (V_Old(i + 1) - V_Old(i - 1)) / (2*ds);&#xA;&#xA;        Gamma= (V_Old(i + 1) - 2 * V_Old(i) + V_Old(i - 1)) / (ds*ds);&#xA;&#xA;        Theta = -0.5 * Sigma * Sigma * Stock(i) * Stock(i) * Gamma + ...&#xA;            R*(V_Old(i)-(Stock(i) * Delta));  % Black Scholes PDE Solving&#xA;&#xA;        V_New(i) = V_Old(i) - dt * Theta; % Explicit Scheme&#xA;&#xA;    end&#xA;&#xA;    % Boundary Conditions&#xA;&#xA;    V_New(1) = V_Old(1) * (1 - R * dt); % Lower Boundary&#xA;&#xA;    V_New(Asset_Steps+1) = 2 * V_New(Asset_Steps) - V_New(Asset_Steps - 1); % Upper Boundary&#xA;&#xA;    %Marching Backwards in T&#xA;&#xA;    V_Old=V_New;&#xA;&#xA;end&#xA;&#xA;% Interpolate the Grid to find the Option Value for the Stock Price&#xA;&#xA;FDM_Binary=spline(Stock,V_New,S);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is the way how I code the boundary conditions correct?&lt;/p&gt;&#xA;" OwnerUserId="17260" LastEditorUserId="601" LastEditDate="2015-10-07T21:49:34.163" LastActivityDate="2015-10-08T01:06:30.800" Title="Is the code of my binary call option pricer (using explicit finite difference, backward scheme) correct?" Tags="&lt;programming&gt;&lt;derivatives&gt;&lt;binary-options&gt;&lt;finite-difference-method&gt;" AnswerCount="1" CommentCount="5" ClosedDate="2015-10-08T01:03:45.467" ContentLicense="CC BY-SA 3.0" />
  <row Id="21085" PostTypeId="2" ParentId="20938" CreationDate="2015-10-07T07:38:45.850" Score="2" Body="&lt;p&gt;To answer you correctly we'd need to see the exact inputs of your regression... and I doubt you can mix easily linear and binary variables like that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the market return is 1% at time $t$ do you have $R_{m,t} = 0.01$ or $R_{m,t} = 1$. Same question for $R_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming both are using the &quot;0.01&quot; convention, then a move of $1\% = 0.01$ results in a move of $\beta_1 \cdot 0.01 = 0.00024 = 0.024\%$. Same reasoning for the other beta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should also make sure that the parameters you fitted are statistically meaningful, by checking their &lt;a href=&quot;https://en.wikipedia.org/wiki/P-value&quot; rel=&quot;nofollow&quot;&gt;p-values&lt;/a&gt;, as a starting point.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2015-10-07T08:11:32.267" LastActivityDate="2015-10-07T08:11:32.267" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21086" PostTypeId="2" ParentId="20938" CreationDate="2015-10-07T08:59:23.300" Score="3" Body="&lt;p&gt;The dummy function is always used to construct non-linear models. In your model, it is interpreted that the announcements have an non-linear effect on the return. So it is incorrect to say it is a linear regression problem, it should be called as a non-linear regression problem. In total, it means the announcements have asymmetric effects in explaining the returns.&lt;/p&gt;&#xA;" OwnerUserId="15201" LastEditorUserId="15201" LastEditDate="2015-10-07T09:36:36.900" LastActivityDate="2015-10-07T09:36:36.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21087" PostTypeId="2" ParentId="21082" CreationDate="2015-10-07T09:06:09.277" Score="2" Body="&lt;p&gt;Yes, you can use Multivariate GARCH model to estimate the volatility of a portfolio. For example, the Constant Conditional Correlation(CCC) GARCH model. In the CCC GARCH model, it says there is a constant correlation between portfolio and the model is defined as:&lt;a href=&quot;https://i.stack.imgur.com/JvhPP.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/JvhPP.png&quot; alt=&quot;Definition of the covariance matrix in CCC-GARCH model&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you have estimated the correlation matrix, the the composed volatility can be computed by the product $w'H_tw$.&lt;/p&gt;&#xA;" OwnerUserId="15201" LastActivityDate="2015-10-07T09:06:09.277" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21088" PostTypeId="1" CreationDate="2015-10-07T09:59:04.657" Score="3" ViewCount="315" Body="&lt;p&gt;I am currently trying to calculate a vector for the mean annual returns of 4 different asset classes along with their 4x4 covariance matrix in excel. However, I am having problems since the data I have been supplied is quarterly returns (as calculated from the relevant stock indicies). I know that quarterly and annual returns are linked by the following equation $$r_{Annual,x}=\prod_{q=1}^{4}(1+r_{q,x})-1$$ Where $r_{i}$ is the return for the $i^{th}$ quarter and $x$ denotes that this is the $x^{th}$ year. What I have done is calculate $(1+r_{i,j})^4-1$ where $r_{i,j}$ is the $j^{th}$ quarterly return observation for the $i^{th}$ asset class (I have 4 asset class).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This results in 4 new vectors where each quarterly return has been converted to an effective annual return. I then apply the mean and covariance functions to these converted values to get the mean vector and covariance matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I get the feeling this is wrong. Any feedback would be greatly appreciated and if you could provide a worked example with the following (quarterly return) data simulated in excel that would be great.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Asset 1 Asset 2 Asset 3 Asset 4&#xA;1.98%   2.99%   1.91%   3.24%&#xA;-1.22%  -1.87%  1.18%   2.35%&#xA;5.00%   6.10%   1.08%   4.46%&#xA;2.45%   -0.10%  1.75%   3.06%&#xA;5.70%   3.70%   1.47%   2.10%&#xA;8.29%   1.96%   1.51%   0.62%&#xA;-3.36%  -1.25%  1.11%   2.72%&#xA;-2.01%  0.21%   1.49%   0.90%&#xA;-4.99%  2.44%   1.48%   2.02%&#xA;4.67%   -0.29%  1.48%   1.51%&#xA;0.86%   2.92%   1.54%   2.38%&#xA;7.52%   -0.75%  1.43%   3.36%&#xA;-1.24%  3.11%   1.20%   1.93%&#xA;-4.25%  1.41%   1.35%   0.84%&#xA;3.89%   -0.25%  0.86%   1.46%&#xA;0.67%   4.13%   1.45%   2.30%&#xA;3.93%   1.53%   1.43%   1.35%&#xA;-5.00%  -0.63%  1.50%   3.35%&#xA;3.47%   2.99%   1.50%   3.06%&#xA;7.76%   3.61%   0.98%   3.79%&#xA;-8.26%  1.03%   1.18%   2.90%&#xA;5.45%   1.57%   1.05%   3.38%&#xA;-2.65%  2.25%   1.44%   1.45%&#xA;0.76%   7.50%   1.52%   1.79%&#xA;4.55%   -2.72%  1.31%   1.82%&#xA;1.32%   8.70%   1.36%   1.24%&#xA;-3.02%  -1.43%  1.52%   3.92%&#xA;2.05%   1.20%   1.94%   2.50%&#xA;7.37%   0.29%   1.64%   2.73%&#xA;-0.66%  2.36%   1.75%   2.68%&#xA;-6.86%  -1.40%  1.35%   2.62%&#xA;13.55%  6.03%   1.30%   1.33%&#xA;-2.23%  5.26%   1.44%   1.48%&#xA;-4.26%  0.45%   1.61%   2.93%&#xA;6.75%   1.70%   1.08%   1.26%&#xA;-0.84%  -2.16%  0.89%   2.45%&#xA;-0.66%  4.03%   1.66%   2.98%&#xA;0.15%   1.94%   1.21%   3.13%&#xA;-4.74%  0.26%   1.44%   2.35%&#xA;1.29%   -0.76%  0.96%   1.52%&#xA;13.22%  0.37%   1.74%   4.11%&#xA;-2.37%  0.41%   1.25%   2.71%&#xA;3.16%   1.27%   1.22%   2.54%&#xA;1.56%   4.54%   0.87%   3.55%&#xA;0.97%   2.18%   1.52%   1.75%&#xA;3.32%   2.41%   1.64%   2.12%&#xA;-1.80%  -2.07%  1.12%   0.77%&#xA;7.16%   1.87%   1.61%   3.68%&#xA;10.65%  4.89%   1.25%   2.47%&#xA;5.47%   4.26%   1.33%   1.94%&#xA;0.31%   5.53%   1.32%   3.89%&#xA;3.59%   4.55%   1.46%   2.27%&#xA;7.24%   1.50%   1.67%   1.32%&#xA;3.06%   0.87%   1.78%   3.43%&#xA;7.43%   3.92%   1.58%   3.05%&#xA;11.29%  2.17%   1.47%   2.76%&#xA;11.85%  3.64%   1.59%   1.57%&#xA;1.68%   -1.25%  1.48%   2.37%&#xA;9.93%   -0.53%  1.95%   1.76%&#xA;-9.09%  -3.53%  1.32%   3.30%&#xA;-3.09%  3.00%   1.41%   2.86%&#xA;2.99%   1.49%   1.34%   1.97%&#xA;0.28%   3.81%   1.30%   2.27%&#xA;9.23%   6.06%   1.17%   2.44%&#xA;6.74%   7.60%   1.52%   1.66%&#xA;0.48%   5.72%   1.61%   1.25%&#xA;-2.28%  0.96%   1.30%   2.69%&#xA;4.16%   -1.94%  1.68%   2.95%&#xA;7.21%   4.77%   1.59%   1.40%&#xA;-3.97%  -0.84%  1.56%   2.11%&#xA;2.48%   1.46%   1.22%   3.60%&#xA;5.89%   1.65%   1.83%   1.62%&#xA;-2.73%  4.73%   1.37%   1.99%&#xA;9.12%   -0.52%  1.29%   2.89%&#xA;1.29%   3.89%   1.35%   2.47%&#xA;4.18%   -1.76%  1.58%   3.85%&#xA;-9.78%  2.66%   1.09%   1.63%&#xA;10.73%  -1.80%  1.57%   3.11%&#xA;3.37%   -0.03%  1.67%   1.57%&#xA;11.17%  5.92%   1.26%   2.04%&#xA;7.13%   3.02%   1.79%   2.29%&#xA;13.12%  -0.75%  1.25%   2.72%&#xA;-2.73%  1.45%   1.04%   3.61%&#xA;-8.38%  -1.19%  1.16%   2.15%&#xA;4.63%   0.53%   1.33%   3.00%&#xA;1.93%   4.88%   1.39%   3.65%&#xA;-6.75%  0.74%   0.95%   2.40%&#xA;5.43%   0.75%   1.33%   2.76%&#xA;-4.68%  3.02%   0.90%   2.38%&#xA;4.99%   4.99%   1.66%   0.84%&#xA;-0.44%  3.68%   1.51%   1.84%&#xA;13.18%  3.82%   1.69%   2.88%&#xA;8.05%   2.02%   0.79%   2.50%&#xA;-3.39%  1.93%   1.15%   2.65%&#xA;21.79%  3.30%   1.36%   2.12%&#xA;-5.96%  6.49%   1.58%   3.43%&#xA;1.43%   -1.17%  0.89%   0.57%&#xA;10.21%  4.70%   1.27%   1.69%&#xA;-13.53% 7.99%   1.31%   2.62%&#xA;-5.25%  -0.46%  1.08%   3.75%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7626" LastActivityDate="2015-10-07T09:59:04.657" Title="Finding mean vector and covariance matrix for annual returns given quarterly returns" Tags="&lt;modern-portfolio-theory&gt;&lt;covariance&gt;&lt;mean-variance&gt;&lt;markowitz&gt;&lt;mean&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21089" PostTypeId="2" ParentId="18956" CreationDate="2015-10-07T11:03:06.783" Score="2" Body="&lt;p&gt;After some careful thought, the answer is trivially simple, actually.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $\phi_1=0$ then consumption growth is iid. If If $\phi_1=1$ then consumption growth is has a unit root and is not stationary, and so will be the model. &lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-10-07T11:03:06.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21090" PostTypeId="2" ParentId="20938" CreationDate="2015-10-07T11:13:49.217" Score="2" Body="&lt;p&gt;Is this for one firm only? Is there positive and negative announcements (ie do the abnormal returns differ in sign)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As per Binder (1998):&#xA;$$R_{it}=\alpha _{i} + \beta _{i}R_{mt} + \gamma _{i}D_{i} + u_{it} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the coefficient $\gamma _{i}$ is the abnormal return for security $i$ during period $t$. If the events tend to affect the security prices both positive and negative, a regression such as yours tend not be very powerful. Binder (1998) suggests a multivariate regression model with one equation for each of the $N$ events.&#xA;$$&#xA;\\&#xA;R_{1t}=\alpha _{1} + \beta _{1}R_{mt} + \sum_{a=1}^{A} \gamma _{1a}D_{at} + u_{1t}&#xA;\\&#xA;\vdots&#xA;\\&#xA;R_{Nt}=\alpha _{N} + \beta _{N}R_{mt} + \sum_{a=1}^{N} \gamma _{1a}D_{Nt} + u_{1t}&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="17724" LastActivityDate="2015-10-07T11:13:49.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21091" PostTypeId="1" AcceptedAnswerId="21093" CreationDate="2015-10-07T13:14:21.233" Score="2" ViewCount="41" Body="&lt;p&gt;Let's say I have fund A with 20% annualized volatility and portfolio B with 15% annualized volatility. If A and B have 0 correlation, can the combination of these funds have volatility &amp;lt; 15% ? Are there any papers explaining this?&lt;/p&gt;&#xA;" OwnerUserId="7769" LastActivityDate="2015-10-07T14:35:40.020" Title="Can adding an uncorrelated high vol strategy to a low vol portfolio result in a portfolio with even lower volatility?" Tags="&lt;modern-portfolio-theory&gt;&lt;diversification&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21092" PostTypeId="1" AcceptedAnswerId="21104" CreationDate="2015-10-07T14:09:33.590" Score="1" ViewCount="8967" Body="&lt;p&gt;I've been getting very confused on the topic of calculating returns. To get cumulative returns in time, log-returns are used, but apparently log-returns aren't used across different securities at a fixed time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;I would like to get cumulative returns as a function of time over my portfolio.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have two securities, A and B. I buy one share of both A and B when the market opens and sell when it closes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose these are the prices for a specific day:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    open    close&#xA;A   9       10&#xA;B   10      8&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My overall return for that day is &lt;code&gt;(10+8)/(10+9) - 1 = -5.2%&lt;/code&gt;. I store that -5.2% for that day. I repeat this for many days.  How do I then calculate my cumulative sum?  If it helps, I'm doing this in python. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Side note: I can use a &lt;code&gt;cumsum()&lt;/code&gt; function very easily in python, but that assumes log-returns.  I have no issue working with log-returns, but I'm not sure how to go about doing that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will add that I always purchase 1 share of whatever security is in my portfolio for that day.  The securities in my portfolio change over the course of time.&lt;/p&gt;&#xA;" OwnerUserId="17783" LastActivityDate="2015-10-07T20:50:28.243" Title="Calculating log-returns across multiple securities and time" Tags="&lt;returns&gt;&lt;python&gt;&lt;log-returns&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21093" PostTypeId="2" ParentId="21091" CreationDate="2015-10-07T14:35:40.020" Score="1" Body="&lt;p&gt;The total volatility of a portfolio is calculated as follows: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/XkDiC.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/XkDiC.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recall that Cov(a,b) is just (Correlation a,b)/(StD A * StD B). So in this case, no the portfolio could not have a total volatility of less than 15%. For this to happen, we would need negative correlation between the two assets. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Think of volatility in this case as the amount of movement in portfolio value. Only by having some degree of negative correlation between assets could one return offset the other (from a theoretical standpoint) on the same day and cause the price swing of the total portfolio to be less wild than the least volatile holding. &lt;/p&gt;&#xA;" OwnerUserId="17742" LastActivityDate="2015-10-07T14:35:40.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21094" PostTypeId="2" ParentId="21092" CreationDate="2015-10-07T14:47:59.710" Score="1" Body="&lt;p&gt;When doing series like this in Python, I usually just add 1 to each return, then multiply across these sums for cumulative returns. Such as, if my returns over three days were -5.2%, 2.1% &amp;amp; 4.8%, then the values I would store would be:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;1 + (-0.052) = 0.948&lt;/p&gt;&#xA;&lt;p&gt;1 + (0.021) = 1.021&lt;/p&gt;&#xA;&lt;p&gt;1 + (0.048) = 1.048&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Then, to calculate my cumulative returns, I would just multiply (0.948)(1.021)(1.048) - 1 = 0.0144 or 1.44%.&lt;/p&gt;&#xA;&lt;p&gt;This works especially well with arrays in Python, where you can store each return as an array in a larger array, allowing you to date index each part of the series then slice it however you want. Happy to work through the code for this if you provide me more detail on your data set.&lt;/p&gt;&#xA;" OwnerUserId="17742" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2015-10-07T14:47:59.710" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21095" PostTypeId="2" ParentId="20938" CreationDate="2015-10-07T15:07:30.677" Score="0" Body="&lt;p&gt;What you are doing is to try to construct a variable (&lt;code&gt;Rt&lt;/code&gt;) by decomposing the value in some explanatory components. Therefore your interpretation is correct. &#xA;You need to substitute the values you obtained in your equation, and that gives you the answer to your question: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1)0.024-&gt; 2.4%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2)−0.03-&gt; -3%&lt;/p&gt;&#xA;" OwnerUserId="12089" LastActivityDate="2015-10-07T15:07:30.677" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21096" PostTypeId="2" ParentId="21047" CreationDate="2015-10-07T15:07:54.743" Score="0" Body="&lt;p&gt;While I do not subscribe to this particular database, I have used Quandl extensively for a variety of reasons and have paid for subscriptions. Zacks apparently has a fairly robust database of dividends, you might want to create an account on Quandl.com and try it. They do offer trials&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.quandl.com/data/ZDIV/pricing&quot; rel=&quot;nofollow&quot;&gt;https://www.quandl.com/data/ZDIV/pricing&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3084" LastActivityDate="2015-10-07T15:07:54.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21097" PostTypeId="2" ParentId="21082" CreationDate="2015-10-07T17:41:35.023" Score="0" Body="&lt;p&gt;It depends on what you are trying to do. First of all, you would estimate GARCH on the portfolio returns, not the portfolio value, as @SRKX points out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are trying to forecast what the volatility of the portfolio will be in the future, then the danger is the portfolio weights you have today are not the same as what you held in the past. For instance, suppose I was fully invested in Treasuries over the GARCH estimation period, then I sold all the bonds and bought out of the money call options on the S&amp;amp;P 500. The GARCH forecast would be too low because it does not reflect the new portfolio characteristics. How important this issue is depends on how much trading the portfolio does. If there is no portfolio turnover during the GARCH estimation period, then it's a reasonable enough approach. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If instead of trying to forecast GARCH volatility of the current portfolio, you are just trying to evaluate what the historic volatility of the portfolio was, then this is a good approach.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2015-10-07T17:41:35.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21098" PostTypeId="1" CreationDate="2015-10-07T17:47:44.373" Score="2" ViewCount="389" Body="&lt;p&gt;For my thesis I'm currently generating several time series of random numbers, so far so good.&#xA;Now I realized some autocorrelation in the series as well and don't really know how to cope with it. Can I use the Cholesky factorization to generate random numbers with auto-correlation and then afterwards use the Cholesky decomposition again for simulating with the overall correlation structure between the different time series? Because I'm uncertain whether that destroys the autocorrelation I previously created?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or put differently, I'm currently doing this for $n$ variables:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$x_{t,1} = x_{t,0} \exp(my+std\cdot rv_1)$$&#xA;$$y_{t,1} = y_{t,0} \exp(my+std(p\cdot rv_1+(1-p^2)^{0.5}rv_2))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now those are correlated just fine, but how do I insert the autocorrelation without harming the cross series correlation? Or is it unaffected when I change the random variables?&lt;/p&gt;&#xA;" OwnerUserId="17784" LastEditorDisplayName="user13444" LastEditDate="2016-12-13T08:53:07.520" LastActivityDate="2016-12-13T08:53:07.520" Title="Correlated random variables with additional autocorrelation - multi dimensional Cholesky?" Tags="&lt;monte-carlo&gt;&lt;cholesky&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21099" PostTypeId="1" AcceptedAnswerId="21204" CreationDate="2015-10-07T18:15:19.450" Score="1" ViewCount="289" Body="&lt;p&gt;I'm relative new to this, so I might be asking something that doesn't make sense. Here is my scenario:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have intraday day at 1 minute intervals. This data has ohlc data and I want to compute for any given interval what the likely sell price would be. I could just assume the worst case and take the low price, but I'm assuming there is something a little more accurate than that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get that there is no way to accurately predict what the sell price would be, since an actual order potentially changes the outcome. I just want to know if there is a best practice for predicting what the sell price would be if I tried to execute an order on a given interval using historical data.&lt;/p&gt;&#xA;" OwnerUserId="17785" LastEditorUserId="467" LastEditDate="2015-10-14T02:06:07.093" LastActivityDate="2015-10-14T02:06:07.093" Title="How to estimate probable seeling pricegiven OHLC data for backtesting?" Tags="&lt;backtesting&gt;&lt;historical-data&gt;&lt;estimation&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21101" PostTypeId="2" ParentId="21098" CreationDate="2015-10-07T18:39:27.400" Score="1" Body="&lt;p&gt;To produce autocorrelated correlated random variables, you would want to first generate the correlated random variables and then add the relevant autocorrelation terms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You ask about adding the autocorrelation without harming the correlation terms. You need to think carefully about the steps taken to estimate the terms used in the simulation. You need to first estimate the appropriate univariate AR(p) models, get the residuals, then fit the covariance matrix to the residuals. This makes it like a restricted VAR(p) model. You cannot use the covariance matrix of the original time series (i.e. not the residuals) because it presumably has autocorrelation in it. The residuals should (if you have done things correctly) should have had the autocorrelation removed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1404905&quot; rel=&quot;nofollow&quot; title=&quot;here&quot;&gt;here&lt;/a&gt; for more details on a more general way to think about it.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2015-10-07T18:39:27.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21102" PostTypeId="2" ParentId="21063" CreationDate="2015-10-07T19:10:06.530" Score="1" Body="&lt;p&gt;&quot;Trading a ratio&quot; is called statistical arbitrage or pairs trading. The key here is &quot;cointegration&quot; between two series, i.e. even if 2 series may be non-stationary, their linear combination is. To check statistically if 2 series are cointegrated you may try Dickey-Fuller test.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That was theory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Practically speaking, from the plot you presented 2 series do appear to become cointegrated recently (at least visually as the ratio moves up and down within a range, whatever ADF statistics may say).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I would do in terms of evaluating this trading opportunity: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Run rolling regression of one asset onto the other to find a ratio with a window length as a parameter.  &lt;/li&gt;&#xA;&lt;li&gt;Check if this ratio stays reasonably constant (or drift should be added, or no stable hedging ratio at all)  &lt;/li&gt;&#xA;&lt;li&gt;Adjust length of window over which you calculate hedge ratio to maximize income (via backtesting).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In terms of execution, you trade the residual (i.e. X - H*Y, where H is the hedge ratios found via linear regression). One &lt;strong&gt;&lt;em&gt;possible&lt;/em&gt;&lt;/strong&gt; strategy is:  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;sell residual (or X - H*Y if you wish), when residual touches upper band of oscillations, cover when ratio returns to &quot;normality&quot; &lt;/li&gt;&#xA;&lt;li&gt;buy residual when it touches lower band of oscillations, sell when it returns to normality. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The difference between entry and exit is your P&amp;amp;L.&lt;/p&gt;&#xA;" OwnerUserId="13718" LastEditorUserId="13718" LastEditDate="2015-10-07T19:18:10.043" LastActivityDate="2015-10-07T19:18:10.043" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21104" PostTypeId="2" ParentId="21092" CreationDate="2015-10-07T20:50:28.243" Score="5" Body="&lt;p&gt;In Python, simple geometric returns:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    import numpy as np&#xA;    import pandas as pd&#xA;    sp500 = pd.io.data.DataReader('^GSPC', 'yahoo')['Close']&#xA;    simple_ret = sp500.pct_change()&#xA;    (1+simple_ret).cumprod()[-1] -1&#xA;&#xA;    0.74751768460019963&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Log-returns:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    log_ret = np.log(1+simple_ret)&#xA;    np.exp(log_ret.cumsum()[-1]) -1&#xA;&#xA;    0.74751768460020074&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In Quantitative Finance, doing your math in log-returns &lt;strong&gt;&lt;em&gt;considered&lt;/em&gt;&lt;/strong&gt; good manners, however for many practical applications (backtesting trading strategies e.g.), simple geometric returns suffice.  &lt;/p&gt;&#xA;" OwnerUserId="13718" LastActivityDate="2015-10-07T20:50:28.243" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21106" PostTypeId="2" ParentId="21075" CreationDate="2015-10-07T21:32:09.283" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;In R, there are basically two packages to backtest your strategy: &lt;code&gt;SIT&lt;/code&gt; and &lt;code&gt;quantstrat&lt;/code&gt;. I personally prefer the former because it's much faster and more transparent in terms of how your positions are managed. In addition, &lt;code&gt;SIT&lt;/code&gt; gives your more flexibility in how your trading signals are formed. &lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you have a very basic strategy, like long/short/stay on the sidelines, perhaps the best approach to quickly test your strategy is to have 2 vectors like @Rime advised above: one for returns and the other for your positions (either 1, -1, or 0), and multiply them to get returns for your positions when you are in the market (either short or long). Two pieces of advice if I may: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Shift your action (buy or sell) one period forward relative to the signal. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Short position. Think carefully how you would accumulate profits over multiple periods. If you happen to short a stock which had lost 10% each day for 3 days in a row (i.e. from 100 to 90 on first day, to 81 on second, and to 72.9 on the third day) that wouldn't make you wealthier by 33.1% (1.1^3 -1), as if it were for positive returns on the long side. Your return would rather be 27.1% which you would not get by simply multiplying returns and positions... (more at &lt;a href=&quot;https://systematicinvestor.wordpress.com/2011/12/02/backtesting-with-short-positions/&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; blogpost at SIT)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="13718" LastEditorUserId="13718" LastEditDate="2015-10-07T23:00:47.757" LastActivityDate="2015-10-07T23:00:47.757" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21107" PostTypeId="2" ParentId="17655" CreationDate="2015-10-07T22:21:35.640" Score="1" Body="&lt;p&gt;One of these two books may help you:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://riskbooks.com/a-guide-to-quantitative-finance&quot; rel=&quot;nofollow&quot;&gt;A Guide to Quantitative Finance&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://riskbooks.com/option-pricing-via-quadrature&quot; rel=&quot;nofollow&quot;&gt;Option Pricing via Quadrature&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;They are both from the same author. Both price European vanilla options under various stochastic processes.&lt;/p&gt;&#xA;" OwnerUserId="7405" LastActivityDate="2015-10-07T22:21:35.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21108" PostTypeId="2" ParentId="21084" CreationDate="2015-10-08T01:06:30.800" Score="0" Body="&lt;p&gt;I don't understand how you derived the boundary conditions in your code. You're supposed to get the option price (binary payoff) based on the strike, but I just don't see the variable K is even used in the boundary conditions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also don't quite follow how you compute theta. Your implementation looks different to the formulas I see in &lt;a href=&quot;http://www.goddardconsulting.ca/option-pricing-finite-diff-explicit.html&quot; rel=&quot;nofollow&quot;&gt;http://www.goddardconsulting.ca/option-pricing-finite-diff-explicit.html&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a good C++ reference implementation if you need help:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.quantstart.com/articles/C-Explicit-Euler-Finite-Difference-Method-for-Black-Scholes&quot; rel=&quot;nofollow&quot;&gt;https://www.quantstart.com/articles/C-Explicit-Euler-Finite-Difference-Method-for-Black-Scholes&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2015-10-08T01:06:30.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21109" PostTypeId="1" AcceptedAnswerId="21110" CreationDate="2015-10-08T02:03:45.193" Score="-1" ViewCount="337" Body="&lt;p&gt;I have no idea about finances, trading and other things.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But very interested in passive long term income.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've read many things about how cheap was microsoft, google, facebook shares in the past.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And will like to find more information about this business of shares exchange. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="17790" LastActivityDate="2015-10-08T02:29:42.573" Title="where to get shares trading info" Tags="&lt;finance&gt;&lt;exchange&gt;&lt;trade&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2015-10-08T06:42:40.357" ContentLicense="CC BY-SA 3.0" />
  <row Id="21110" PostTypeId="2" ParentId="21109" CreationDate="2015-10-08T02:29:42.573" Score="0" Body="&lt;p&gt;Your question is very broad and perhaps a better fit for &lt;a href=&quot;https://money.stackexchange.com/&quot;&gt;https://money.stackexchange.com/&lt;/a&gt;.&lt;br&gt;&#xA;Historical prices for many securities including the ones you mentioned can be browsed at &lt;a href=&quot;https://www.google.com/finance?q=GOOG%2C+FB%2C+MSFT&amp;amp;ei=VtQVVpjTNYiPmAGb4KCQDg&quot; rel=&quot;nofollow noreferrer&quot;&gt;Google Finance&lt;/a&gt;.&lt;br&gt;&#xA;If you actually want to get into trading, you will need to do so through a brokerage firm, many of which are online with highly featured Web sites.  Exercise a lot of caution before investing and seriously consider diversification (that is, buying an index fund or similar security that aggregates many) instead of investing in just a few individual stocks, to help reduce your risks.  &lt;/p&gt;&#xA;" OwnerUserId="17090" LastEditorUserId="-1" LastEditDate="2017-04-13T12:25:30.743" LastActivityDate="2015-10-08T02:29:42.573" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21111" PostTypeId="2" ParentId="18739" CreationDate="2015-10-08T07:31:26.343" Score="1" Body="&lt;p&gt;You can use something like &lt;a href=&quot;http://digitalpbk.com/stock/google-finance-get-stock-quote-realtime&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://digitalpbk.com/stock/google-finance-get-stock-quote-realtime&lt;/a&gt;; lower the timer to 1 second and you have 1 second refreshes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get real-time quotes from Yahoo, see &lt;a href=&quot;https://stackoverflow.com/questions/1763310/yahoo-finance-api&quot;&gt;https://stackoverflow.com/questions/1763310/yahoo-finance-api&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Combine both API into observables:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Observable.Interval(TimeSpan.FromMilliseconds(500),DoPollingActionForStock(&quot;AAPL&quot;)).DistinctUntilChanged(OnNext));&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="17793" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2015-10-08T16:53:59.203" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21112" PostTypeId="1" CreationDate="2015-10-08T08:02:57.490" Score="2" ViewCount="135" Body="&lt;p&gt;My understanding of CFDs is that the profit you make on a CFD is the difference between the price at which you bought the CFD and the price at which you sold your CFD minus various charges/commission.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea being that the CFD tracks the underlying and therefore you can speculate on the price of the underlying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, why does the CFD track the underlying? There is nothing about the CFD that forces it to follow it is there? Or is there?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: To clarify the question...&#xA;The CFD is priced according to supply and demand&#xA;The underlying is priced according to supply and demand&#xA;These two are priced independently. Isn't it possible that they move completely independently of each other?&lt;/p&gt;&#xA;" OwnerUserId="17795" LastEditorUserId="17795" LastEditDate="2015-10-08T10:14:42.600" LastActivityDate="2015-10-09T18:13:30.990" Title="Why do CFDs track the underlying?" Tags="&lt;correlation&gt;&lt;cfd&gt;" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21113" PostTypeId="2" ParentId="1656" CreationDate="2015-10-08T08:12:11.340" Score="3" Body="&lt;p&gt;In Japan we get ISIN data with &lt;a href=&quot;http://www.isin.org/isin-database&quot; rel=&quot;nofollow&quot;&gt;http://www.isin.org/isin-database&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;they have free search tool.&lt;/p&gt;&#xA;" OwnerUserId="17796" LastActivityDate="2015-10-08T08:12:11.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21114" PostTypeId="2" ParentId="21112" CreationDate="2015-10-08T09:55:58.817" Score="2" Body="&lt;p&gt;I might be wording this answer incorrectly so if some law expert wants to correct anything, please feel free.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is my understanding that CFD are contracts you pass with your CFD broker. So, this contract has a value as long as your broker exists and hasn't decided not to pay you. So, in a sense, the price is just set by the agreement between you and him.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say the broker defaults, you won't have any claim on the underlying, and you won't be able to get anything out of you're winning positions (except, of course, claiming you're owed your gains if the broker goes into liquidation and waiting to see if you get something after all legal procedures are over... i.e you won't get anything).&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2015-10-08T09:55:58.817" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21115" PostTypeId="1" AcceptedAnswerId="21343" CreationDate="2015-10-08T14:54:12.720" Score="5" ViewCount="355" Body="&lt;p&gt;I would like to use the following model in QuantLib:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{dF(t,T)}{F(t,T)} = \sigma_se^{-\beta(T-t)}dW_{t}^{1} + \sigma_L\left(1-e^{-\beta(T-t)}\right)dW_{t}^{2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a reformulation of the Schwartz Smith model (&lt;a href=&quot;https://faculty.fuqua.duke.edu/~jes9/bio/Short-term_Long-term_Model.pdf&quot; rel=&quot;noreferrer&quot;&gt;Schwartz-Smith&lt;/a&gt;).&#xA;$F(t,T)$ is the commodity future price and the model is to be calibrated to American option prices (options on futures).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I plan to proceed in the following way:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Derive a class from &lt;strong&gt;StochasticProcess&lt;/strong&gt; for the process.&lt;/li&gt;&#xA;&lt;li&gt;Implement a &lt;strong&gt;PricingEngine&lt;/strong&gt; for the analytical formula of european options.&lt;/li&gt;&#xA;&lt;li&gt;Implement a &lt;strong&gt;PricingEngine&lt;/strong&gt; for American Options. I will use the Barone-Adesi/Whaley approximation. I have adapted the algorithm to use it with this model. I cannot use the provided implementation in the library though. My implementation will follow the lines of the one in the library I just have to plug-in 3 things: the analytical formula for the european option, the delta and the term that multiplies the second derivative wrt $F$ in the pricing PDE (the first two coming from the european pricing engine and the last one coming from the process).&lt;/li&gt;&#xA;&lt;li&gt;Implement a &lt;strong&gt;CalibratedModel&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Implement a &lt;strong&gt;CalibrationHelper&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;My problem is with point number &lt;strong&gt;1&lt;/strong&gt;. Is it OK to use the &lt;strong&gt;StochasticProcess&lt;/strong&gt; class ? or should I implement a different class because in fact I'm modelling a family of processes, one for each &lt;strong&gt;T&lt;/strong&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for any help and thoughts.&lt;/p&gt;&#xA;" OwnerUserId="17408" LastActivityDate="2015-10-21T11:48:54.240" Title="QuantLib: Is the StochasticProcess class adapt for a HJM type of modelling?" Tags="&lt;programming&gt;&lt;quantlib&gt;&lt;commodities&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21116" PostTypeId="2" ParentId="1804" CreationDate="2015-10-08T15:25:28.903" Score="0" Body="&lt;p&gt;See &lt;a href=&quot;http://www.nanlee.net&quot; rel=&quot;nofollow&quot;&gt;www.nanlee.net&lt;/a&gt; for a book doing what you are trying to do. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It scientifically tested 26 older ATFs and found that the average annual return doubled using a moving average of weekly unemployment claims as a buy and sell indicator. A summary of the results is in the Fall, 2015 issue of the Journal of Index Investing.&lt;/p&gt;&#xA;" OwnerUserId="17802" LastEditorUserId="743" LastEditDate="2015-10-08T18:31:29.210" LastActivityDate="2015-10-08T18:31:29.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21117" PostTypeId="1" CreationDate="2015-10-08T17:51:33.937" Score="2" ViewCount="2884" Body="&lt;p&gt;I'm studying the &quot;single factor model&quot; in Malz text &quot;Financial Risk Management - Models, History and Institutions&quot;. He only refers to it as such and gives it no proper name.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The model:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$a_{i} = \beta_{i}m+(\sqrt{1-\beta^2})\epsilon_{i}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\beta$ is the correlation of the firm to the state of the economy&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$m$ is the state of the economy&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;I'm a bit confused here.&lt;/strong&gt; The author first says we can use the model to convert an unconditional probability of default into one conditional on the state of the economy &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and then further says &quot;The &lt;strong&gt;&lt;em&gt;unconditional probability&lt;/em&gt;&lt;/strong&gt; of a particular loss level (the fraction of the portfolio that defaults) is equal to the probability that the market factor return that leads to that loss level is realized&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We find both probabilities in the same way:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$p(m) = \phi( \frac{k_{i}-\beta_{i}m}{\sqrt{1 - \beta^2}} )$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $k = \phi^{-1}(\pi)$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and $\pi$ = unconditional probability of default in the first usage and probability of realizing the market factor leading to observed the loss level in the second usage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These sound opposite to me. In one usage we are finding a conditional PD and in another what is described as an unconditional. &lt;/p&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="9265" LastEditDate="2015-10-08T17:57:11.183" LastActivityDate="2015-10-08T18:09:23.700" Title="A little help with the Single Factor model for credit risk" Tags="&lt;risk&gt;&lt;credit-risk&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21118" PostTypeId="2" ParentId="21117" CreationDate="2015-10-08T18:09:23.700" Score="3" Body="&lt;p&gt;The name for the model is Vasicek's single factor model.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The model is very similar to CAPM: each asset has idiosyncratic and systemic risk with systemic risk driven by a single factor.  Default occurs when an asset has a realization that is below some threshold.  The level of this threshold doesn't matter; we can solve for it if we know the unconditional probability of default for the asset.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Much like CAPM, the idiosyncratic risk can be &quot;diversified&quot; away.  In a large portfolio of homogenous assets the only &quot;risk&quot; (that is, variability around the expected loss) comes from the systemic variable.  Without this variable the distribution converges to a Dirac-delta function around the expected loss. Hence the final output (the distribution of loss) from the model is solely dependent on the systemic variable.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To summarize, the unconditional default is used to parameterize the model, while the conditional is used to determine the output.    &lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2015-10-08T18:09:23.700" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21119" PostTypeId="2" ParentId="18739" CreationDate="2015-10-08T19:07:01.553" Score="1" Body="&lt;p&gt;You can save the entire yahoo webpage as a string with C#:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  string yahoosite = Encoding.UTF8.GetString(new WebClient().DownloadData(&quot;http://finance.yahoo.com/q?s=VOW.DE&quot;));&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then you can periodically extract the price snippet from this string to generate the tick-by-tick data.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2015-12-08T09:58:16.533" LastActivityDate="2015-12-08T09:58:16.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21120" PostTypeId="1" AcceptedAnswerId="21123" CreationDate="2015-10-08T20:21:32.003" Score="8" ViewCount="4491" Body="&lt;p&gt;What should be the value of a Sharpe Ratio for an intraday quantitative strategy to be accepted by a bank or hedge fund's prop desk? Let's assume the returns are daily changes in account equity, close to close.&lt;/p&gt;&#xA;" OwnerUserId="13718" LastEditorUserId="13718" LastEditDate="2015-10-09T17:37:19.747" LastActivityDate="2015-10-09T20:49:10.233" Title="What is an acceptable Sharpe Ratio for a prop desk?" Tags="&lt;quant-trading-strategies&gt;&lt;backtesting&gt;&lt;sharpe-ratio&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21122" PostTypeId="1" CreationDate="2015-10-08T23:27:20.970" Score="2" ViewCount="119" Body="&lt;p&gt;Assuming you can somewhat forecast the underling asset price movement, and you want to translate this value into the corresponding option price. In practice, which are the better models for this task?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Black-Scholes sometimes gives me unrealistic implied volatility, even for near the money cases, and Heston model fitting is not very stable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't have a huge set of option price data to test.&lt;/p&gt;&#xA;" OwnerUserId="16104" LastEditorUserId="16104" LastEditDate="2015-10-09T13:07:38.697" LastActivityDate="2015-10-09T13:07:38.697" Title="Which option pricing models agree best with the market, given the asset price is known?" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21123" PostTypeId="2" ParentId="21120" CreationDate="2015-10-09T02:05:47.690" Score="9" Body="&lt;p&gt;A Sharpe ratio of at least 1 in backtesting is a promising start, but that is just one of many statistics of interest.  The Sharpe ratio measures return per unit volatility, i.e., return per unit risk.  Some other important Sharpe-like measures with different definitions of risk include:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Return per unit turnover (aka yield): A high yielding strategy is more desirable in many ways, since it may also require less liquidity, have less market impact, and be less sensitive to transaction cost modeling errors or future regime changes in transaction costs.   &lt;/li&gt;&#xA;&lt;li&gt;Return per unit transaction costs: Similar to yield, this gives an indication as to how sensitive the strategy performance is to errors in the transaction cost model, and shows how much of an alpha buffer is available for costs which may be hard or difficult to capture in backtesting.&lt;/li&gt;&#xA;&lt;li&gt;Return per unit max/avg asset exposure: A strategy that is more diversified across assets is less sensitive to event risk, and more likely to have a higher capacity.&lt;/li&gt;&#xA;&lt;li&gt;Return per unit max drawdown: Drawdown is in many ways a better measure of risk compared to volatility.  Day to day Gaussian-like volatility is not likely to wipe out the strategy, while a sustained period of losses will. The leverage of a strategy is likely to be backed out from the max drawdown, based on how much the fund is willing to lose.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In addition, any of these numbers are usually not computed just for the entire backtest period, but are instead shown on a rolling basis, to show how consistent the performance is over time, i.e., the performance is not just due  to a few lucky trades.&lt;/p&gt;&#xA;" OwnerUserId="1039" LastActivityDate="2015-10-09T02:05:47.690" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21124" PostTypeId="1" AcceptedAnswerId="21126" CreationDate="2015-10-09T02:09:16.583" Score="3" ViewCount="126" Body="&lt;p&gt;If economic capital is set by the institution to cover unexpected loss (given a confidence level) and regulatory capital is set by the regulator, can one &quot;absorb&quot; the other?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if I determine I want my fictional bank to hold 5bn in economic capital as that corresponds to 99.98% confidence of my loss distribution and the local regulator says I need to hold a total of 3bn in regulatory capital based on my regulatory filings, can I say I'm holding 5 already for EC so I'm covered? Or do I have to hold 5 + 3?&lt;/p&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="9265" LastEditDate="2015-10-09T02:30:49.383" LastActivityDate="2015-10-09T10:52:09.157" Title="Can Economic Capital cover Regulatory Capital?" Tags="&lt;risk&gt;&lt;credit-risk&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21125" PostTypeId="2" ParentId="21124" CreationDate="2015-10-09T08:27:00.103" Score="2" Body="&lt;p&gt;Economic Capital (EC) covers potential losses under normal conditions, whereas Regulatory Capital (RC) covers potential losses under stressed conditions.&#xA;Thus, is not uncommon for the RC to be grater than the EC.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $T1$ is the bank's Tier 1 capital and $T1^*$ is the related minimum capital, we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$T1 = T1^* + EC$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suggest reading Chapter 22 of &lt;strong&gt;&lt;em&gt;Resti &amp;amp; Sironi - Risk management and shareholder's value in banking&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12214" LastActivityDate="2015-10-09T08:27:00.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21126" PostTypeId="2" ParentId="21124" CreationDate="2015-10-09T10:52:09.157" Score="1" Body="&lt;p&gt;Depending on the bank and the country the bank operates in, regulators don't care about your bank's EC so you wouldn't have to hold 5+3; just 3 (or, if you are prudent/conservative, 5).    In the US the regulatory capital requirements tend to be fairly conservative and I would think most banks have EC that is well below regulatory capital.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under the Basel advanced approaches banks can substitute internal estimates of capital for regulatory capital, though I believe that the equity ratio has a hard floor of 5% and that frequently a 2% &quot;buffer&quot; is required above this.  &lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2015-10-09T10:52:09.157" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21127" PostTypeId="1" CreationDate="2015-10-09T11:31:22.497" Score="2" ViewCount="568" Body="&lt;p&gt;I want to estimate the parameters of time-varing Normal Copula using R. A bivariate Normal copula is defined as following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Vx7KC.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Vx7KC.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The dynamic equation of dependance parameter ρ is :&#xA;&lt;a href=&quot;https://i.stack.imgur.com/hgZ9t.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/hgZ9t.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I need the identify the parameters ω,α and β. &#xA;To be more specific, I wander if there is Patton's code in R which allows the dependence parameter ρ to vary over time.&lt;/p&gt;&#xA;" OwnerUserId="17808" LastEditorUserId="848" LastEditDate="2015-10-10T16:10:00.477" LastActivityDate="2018-12-07T07:27:43.883" Title="Gaussian Time-varing copula in R" Tags="&lt;r&gt;&lt;copula&gt;" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="21132" PostTypeId="2" ParentId="21112" CreationDate="2015-10-09T18:13:30.990" Score="0" Body="&lt;p&gt;When you enter a position with CFD, you're buying it from the CFD provider. And you can only sell it back to the CFD provider for the value of the underlying. So if AAPL is trading at \$100, you can only sell the CFD back to broker for \$100. If you're a CFD buyer, why would you buy the contract for more than \$100. If you're a CFD seller, why would you sell it for less than \$100? If the price of CFD is different from the price of underlying, there's arbitrage opportunity. &lt;/p&gt;&#xA;" OwnerUserId="15284" LastActivityDate="2015-10-09T18:13:30.990" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21135" PostTypeId="2" ParentId="19565" CreationDate="2015-10-09T20:05:12.093" Score="0" Body="&lt;p&gt;One very basic reason why one can't compare Sharpe ratios with different rebalancing (trading?) timeframes is in the way they calculate SR: the numerator is proportional to $N$ while denominator is proportional to $\sqrt(N)$. By increasing the frequency over which returns are averaged and annual volatility is calculated one inflates SR by a factor of $\sqrt(N)$. This is a well known trick in the industry so full disclosure is necessary for comparability.&lt;/p&gt;&#xA;" OwnerUserId="13718" LastActivityDate="2015-10-09T20:05:12.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21136" PostTypeId="2" ParentId="21120" CreationDate="2015-10-09T20:05:35.150" Score="2" Body="&lt;p&gt;The required Sharpe ratio depends strongly on whether you are referring to actual profits or a simulation. For actual results, a Sharpe of 1+ over 12+ months is probably the minimum. If the strategy trades liquid markets at liquid times such that it can be scaled up to generate large revenues then, all else being equal, it is more attractive. This is assuming that by intraday you mean just a few trades a day. If it's a high-frequency strategy turning over hundreds or thousands of times per day then Sharpe will likely need to be above four. For high-frequency strategies, if the strategy works the Sharpe is often quite high, routinely above ten. Therefore, larger firms will scrutinize capacity. That is, the total amount of revenue that can be generated from the strategy. There isn't much practical difference between a Sharpe 10 and Sharpe 20 strategy is the latter can't generate any additional revenue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simulations are a different matter. Many firms won't hire traders based purely on backtested results, regardless of Sharpe. To break in with a backtest you will need either (1) strong credentials, (2) a really good story to go along with the backtest or (3) experience at another firm that is somewhat successful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keep in mind I am talking about respectable firms here. There are a lot of two bit firms out there that will hire anyone off the street and let them start trading with small limits. Those firms won't offer much in the way of training or infrastructure.      &lt;/p&gt;&#xA;" OwnerUserId="3398" LastActivityDate="2015-10-09T20:05:35.150" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21137" PostTypeId="2" ParentId="21120" CreationDate="2015-10-09T20:49:10.233" Score="1" Body="&lt;p&gt;Uh-oh, wrong move.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's no point looking at Sharpe here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a large bank, your job is generally to maximize the gross profit of your desk, because the firm achieves diversification at the operational level (across business units).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that you are thinking specifically about the Sharpe ratio of low latency prop trading. In those cases, it gets to a point that you have enough strategies that you just call it off as &quot;infinite Sharpe&quot; and start worrying about your expenses.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2015-10-09T20:49:10.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21141" PostTypeId="1" CreationDate="2015-10-10T13:37:38.987" Score="1" ViewCount="61" Body="&lt;p&gt;I'm looking for a source for fundamental financial data, where I can download financial statements into excel. The source should provide the exact figures shown in the annual reports (not standardized) and it should be free. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To clarify I'm not looking for the standard SEC answer (I want both US and european companies) and neither am I looking for yahoo finance or google finance... I'm looking for Bloomberg/ Factset quality data.&lt;/p&gt;&#xA;" OwnerUserId="17820" LastEditorUserId="17820" LastEditDate="2015-10-10T20:54:06.470" LastActivityDate="2015-10-10T20:54:06.470" Title="What are the best sources for fundamental financial data? (not yahoo or google, neiter SEC counts as good)" Tags="&lt;data&gt;&lt;fundamentals&gt;&lt;financial&gt;" AnswerCount="0" CommentCount="0" ClosedDate="2015-10-10T16:36:17.603" ContentLicense="CC BY-SA 3.0" />
  <row Id="21142" PostTypeId="2" ParentId="1865" CreationDate="2015-10-10T16:21:17.130" Score="0" Body="&lt;p&gt;The moderator Bob Jansen deleted my previous response without meaningful comment.  Bob, please explain why highchart heatmap cannot be used to &amp;quot;order track through time&amp;quot;.&lt;/p&gt;&#xA;&lt;p&gt;The user asked for:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Order tracking through time.&lt;/p&gt;&#xA;&lt;p&gt;My preference is for free/open source that are available for R or Python&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;You need a heat map to do that.&lt;/p&gt;&#xA;&lt;p&gt;I recommended the Heatmap plugin for Highcharts.  It is absolutely capable of everything that &amp;quot;Bookmap&amp;quot; (as recommened by Serg) does; as bookmap is really just another heatmap utility with a gui interface.  I really have no idea why this was not an adequate response.  Its even offered as a free web utility for trial and its compatible with python.&lt;/p&gt;&#xA;&lt;p&gt;You can input an array to HTML field and adjust chart params in java field. Test free it here:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/highcharts/demo/heatmap-canvas/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://jsfiddle.net/gh/get/jquery/1.9.1/highslide-software/highcharts.com/tree/master/samples/highcharts/demo/heatmap-canvas/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15468" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2015-10-10T16:21:17.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21145" PostTypeId="2" ParentId="19376" CreationDate="2015-10-10T20:22:50.223" Score="1" Body="&lt;p&gt;I will try to derive from the scratch as follows:&#xA;Define the three indicator random variables for the three events:&#xA;$1_A$ equals 1 if the event ${2K&amp;lt;S_T}$ happens,$1_B$ equals 1 if the event ${K\leq S_T \leq 2K}$, and $1_C$ as the indicator for any other events.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there exists a stochastic discount factor $M_t$ that prices both the stock and bond, then we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\begin{align}&#xA;p_t &amp;amp;= E_t[M_T\{a(S_T-K) \cdot 1_A+(S_T-K) \cdot 1_B\}] \\&#xA;&amp;amp;= aE_t[M_TS_T1_A]-aE_t[M_TK1_A]+ E_t[M_TS_T1_B]-E_t[M_TK1_B]\\&#xA;&amp;amp;=a(Prob^s(A)-Prob^R(A)) + Prob^s(B)-Prob^R(B)&#xA;\end{align}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where  $Prob^S$ and $Prob^R$ are the probability of these events under the measures with numeriare of the stock (assuming non-dividend-paying) and the money market account respectively. These probability are pretty easy to calculate.&lt;/p&gt;&#xA;" OwnerUserId="6804" LastActivityDate="2015-10-10T20:22:50.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21146" PostTypeId="1" CreationDate="2015-10-10T21:06:10.380" Score="2" ViewCount="132" Body="&lt;p&gt;What data is available from the SEC in XBRL format? Is it just 10-Qs and 10-Ks, or other filings as well?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When did XBRL become mandatory for all filers (or is it still not?)&lt;/p&gt;&#xA;" OwnerUserId="5251" LastActivityDate="2016-07-31T19:44:27.040" Title="Exactly what data is available in XBRL, and how far back does it go?" Tags="&lt;data&gt;&lt;fundamentals&gt;&lt;sec&gt;&lt;edgar&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21147" PostTypeId="1" AcceptedAnswerId="21179" CreationDate="2015-10-10T23:09:18.297" Score="3" ViewCount="53" Body="&lt;p&gt;One of the BCBS papers on operational risk says the following:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Consistent with other operational risk losses, a bank should use a&#xA;  date no later than  the date of reserve for including legal related&#xA;  losses/exposures as an input in its AMA model.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What is the date of reserve? The paper doesn't define it and I can't find anything on Google. &lt;/p&gt;&#xA;" OwnerUserId="9265" LastActivityDate="2015-10-12T22:22:53.717" Title="What is the date of reserve (operational risk)" Tags="&lt;risk&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21149" PostTypeId="1" AcceptedAnswerId="21405" CreationDate="2015-10-11T08:49:41.693" Score="15" ViewCount="10835" Body="&lt;p&gt;Some &lt;a href=&quot;http://www.forbes.com/sites/chancebarnett/2015/09/01/fintech-trends-wealth-management-and-the-rise-of-robo-advisors/&quot;&gt;pundits&lt;/a&gt; claim that there is a revolution in portfolio management under way: The rise of the robots, a.k.a. robo-advisors. The most well known are Betterment.com, FutureAdvisor, Schwab Intelligent Portfolios and Wealthfront.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to &lt;a href=&quot;https://en.wikipedia.org/wiki/Robo-advisor&quot;&gt;wikipedia&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;robo-advisors employ algorithms such as Modern portfolio theory that&#xA;  originally served the traditional advisory community, which has used&#xA;  algorithmically-based automated investment solutions (dubbed in the&#xA;  industry as &quot;rebalancing software&quot;) to conduct portfolio management.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question&lt;/strong&gt;&lt;br&gt;&#xA;Do you know whether there is some more information available which algorithms these firms use exactly? Is it just good old MPT or also more sophisticated stuff? (In this context it is interesting that they often get &lt;a href=&quot;http://blogs.wsj.com/totalreturn/2015/04/24/five-robo-advisers-five-very-different-portfolios/&quot;&gt;totally different portfolios&lt;/a&gt;). Best would be some kind of overview of the algorithms used by different providers.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2016-10-05T11:44:52.857" Title="Which algorithms do robo-advisors use?" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;algorithmic-trading&gt;&lt;algorithm&gt;" AnswerCount="3" CommentCount="6" FavoriteCount="16" ContentLicense="CC BY-SA 3.0" />
  <row Id="21150" PostTypeId="1" CreationDate="2015-10-11T12:48:56.303" Score="2" ViewCount="58" Body="&lt;p&gt;In the past few days I have been thinking about a question which seems trivial, yet I can't think of any efficient way to find the optimal solution...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the problem: imagine you have a portfolio which can be composed of up to N different assets (N being quite small, like 5 or 6). You have X dollars to invest at time t0. You can only sell assets that you have previously bought (no shorting), however you buy and sell (without fees) as many times as you like (within the limits of your portfolio).&#xA;Now if you know the stock values of these 5 assets between t0 and T, is there an (efficient) way to calculate the trading sequence that would give the maximum profit at time T?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried to look if others have had the same question, but I haven't found any relevant answer: either I have been looking for the wrong keywords or no-one has looked into the problem ... (which is understandable since one would need a time-machine for it to have a practical use!)&lt;/p&gt;&#xA;" OwnerUserId="17828" LastActivityDate="2015-10-11T12:48:56.303" Title="Given (past) stock values for N assets, how to find the maximum - theoretical - profit?" Tags="&lt;portfolio-management&gt;&lt;optimization&gt;&lt;historical-data&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21151" PostTypeId="1" CreationDate="2015-10-11T15:28:51.030" Score="2" ViewCount="190" Body="&lt;p&gt;I am trying to find out if exchanges impose limits on the total number of orders which can be in an order book at any one time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know of examples of these order book size limit policies. If they exist how are orders which violate that limit handled? Do they ignore new orders, or evict orders from the book based on price/time?&lt;/p&gt;&#xA;" OwnerUserId="17830" LastEditorUserId="2299" LastEditDate="2015-10-11T20:54:33.757" LastActivityDate="2015-10-16T23:03:50.810" Title="Order book size limit" Tags="&lt;market-microstructure&gt;&lt;limit-order-book&gt;&lt;orderbook&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21152" PostTypeId="2" ParentId="21151" CreationDate="2015-10-11T20:53:46.740" Score="6" Body="&lt;p&gt;I am not aware on any rules preventing a too high number of entries at a limit price. Nevertheless you usually have controls for each trader id. A trader cannot have too many orders in the book or send them at a too high frequency.&lt;/p&gt;&#xA;&lt;p&gt;[EDIT] Moreover, on most trading platforms you cannot have orders too far away from the mid (or a reference price like the previous close). See for instance the &lt;a href=&quot;http://www.convergex.com/uploads/Traders_Guide_2014_Q4.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;2014Q4 convergex traders guide&lt;/a&gt; p4&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Hong Kong, for instance, will reject a limit order that is more than 24 ticks away from the current bid or offer. During its pre-opening period, Tel Aviv will not allow a limit order that is more than 35% from the previous day's closing price. In the US, NYSE Arca uses percentage price checks:&lt;/p&gt;&#xA;&lt;p&gt;• If the price is USD 0.01-25.00, your order must be within 10% of the price.&lt;/p&gt;&#xA;&lt;p&gt;• If the price is USD 25.01-50.00, your order must be within 5% of the price.&lt;/p&gt;&#xA;&lt;p&gt;• If the price is higher than USD 50.00, your order must be within 3% of the price.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;It more or less controls the number of orders in the book.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2015-10-12T21:50:36.600" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21153" PostTypeId="1" CreationDate="2015-10-11T22:44:33.410" Score="8" ViewCount="213" Body="&lt;p&gt;Is there a way (website/code) to find funds/etfs for a given asset class and how much data history is available (yahoo finance or other) ? It could be as simple as a list of funds by asset class and their data start date.&lt;/p&gt;&#xA;" OwnerUserId="17836" LastActivityDate="2016-10-10T15:25:20.020" Title="How to find funds with long history to use in backtest?" Tags="&lt;backtesting&gt;&lt;historical-data&gt;&lt;etf&gt;&lt;mutual-fund&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21154" PostTypeId="1" AcceptedAnswerId="21155" CreationDate="2015-10-12T00:29:58.357" Score="1" ViewCount="868" Body="&lt;p&gt;I have two different event study approaches and I wonder if the results are exactly the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Model 1&lt;/strong&gt; applies a dummy regression market model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) $R_{t}=\beta_{0} + \beta_{1}R_{mt}+\beta_{2}D_{t}+\epsilon_{t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where ${R}_{t}$ is the return of a company at time t, $R_{mt}$ is the market return at time t and $D_{t}$ is a dummy variable that equals one in the event window and 0 otherwise. As far as I know: the coefficient $\beta_{2}$ signals the abnormal return of the event.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Model 2&lt;/strong&gt; applies a market model and then the dummy regression on its residuals:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2.1) $R_{t}=\beta_{0} + \beta_{1}R_{mt}+u_{t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2.2) $\hat{u}_{t}=\gamma_{0} + \gamma_{1}D_{t}+\epsilon_{t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is $D_t$ the measure for the abnormal return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: Does it make any difference to apply Model 1 or Model 2? Is the interpretation of the abnormal return measures exactly the same in both models?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your help!&lt;/p&gt;&#xA;" OwnerUserId="13812" LastActivityDate="2015-10-12T01:53:41.553" Title="Differences between dummy regression event study and regression on residuals from market model" Tags="&lt;returns&gt;&lt;regression&gt;&lt;expected-return&gt;&lt;event-study&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21155" PostTypeId="2" ParentId="21154" CreationDate="2015-10-12T01:53:41.553" Score="1" Body="&lt;p&gt;It is the same. With enough data, you could not reject the null &lt;code&gt;γ1=β2&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could test that with simulation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See this with &lt;code&gt;R&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;##&#xA;set.seed(12456)&#xA;ns=500&#xA;t=1:ns&#xA;D[]=0&#xA;D[t&amp;gt;.1*ns&amp;amp;t&amp;lt;.33*ns]=1&#xA;rm=rnorm(ns,.01,1.5)&#xA;ri=0.01+1.2*rm+.15*D+rnorm(ns,0,.5)&#xA;&#xA;plot(ri~rm,col=D+2)&#xA;#Model 1&#xA;summary(lm(ri~rm+D))&#xA;&#xA;#Model 2&#xA;(m1=lm(ri~rm))&#xA;res=resid(m1)&#xA;summary(lm(res~D))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;#Model 1 Dependent ri&#xA;Coefficients:&#xA;            Estimate Std. Error t value Pr(&amp;gt;|t|)    &#xA;(Intercept)  0.04691    0.02504   1.873  0.06160 .  &#xA;rm           1.19633    0.01433  83.459  &amp;lt; 2e-16 ***&#xA;D            0.14057    0.05246   2.680  0.00762 ** &#xA;&#xA;#Model 2 Dependent ri&#xA;Coefficients:&#xA;(Intercept)           rm  &#xA;      0.079        1.195&#xA;&#xA;#Dependent u&#xA;Coefficients:&#xA;            Estimate Std. Error t value Pr(&amp;gt;|t|)   &#xA;(Intercept) -0.03198    0.02500  -1.279  0.20138   &#xA;D            0.14026    0.05235   2.679  0.00762 **&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="13571" LastActivityDate="2015-10-12T01:53:41.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21156" PostTypeId="1" CreationDate="2015-10-12T03:03:52.073" Score="1" ViewCount="68" Body="&lt;p&gt;In his book &quot;Asset Pricing&quot; chapter 20, Cochrane said&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;For example, suppose that average returns were higher for stocks&#xA;  whose ticker symbols start later in the alphabet. (Maybe investors&#xA;  search for stocks alphabetically, so the later stocks are “over-&#xA;  looked.”) This need not trouble us if Z stocks happened to have higher&#xA;  betas. If not – if letter of the alphabet were a CAPM anomaly like&#xA;  book to market – however, it would not necessar- ily follow that&#xA;  letter based stock portfolios move together. Adding A-L and M-Z&#xA;  portfolios to the right hand side of a regression of the 26 A,B,C,&#xA;  etc. portfolios on the market portfolio need not (and probably does&#xA;  not) increase the R 2 at all.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I am having trouble understanding this example. He is trying to illustrate why forming HML and SMB the way Fama and French did to explain the 25 Size/Book to Market Portfolio is not tautology.&lt;/p&gt;&#xA;" OwnerUserId="6804" LastActivityDate="2015-10-12T03:03:52.073" Title="How to understand stock return comovement" Tags="&lt;portfolio&gt;&lt;factor-models&gt;&lt;asset-pricing&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21157" PostTypeId="1" CreationDate="2015-10-12T03:26:05.957" Score="1" ViewCount="144" Body="&lt;p&gt;I have already written the base of a trading algorithm, however there are some optimisations that I would like to add that might be best programmed by more experienced quantitative programmers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This could be done in pseudo code or ideally in C#.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any thoughts?&lt;/p&gt;&#xA;" OwnerUserId="17841" LastActivityDate="2015-10-12T03:26:05.957" Title="What are the best online platforms to hire a quant?" Tags="&lt;programming&gt;&lt;quant-trading-strategies&gt;&lt;trading&gt;" AnswerCount="0" CommentCount="1" ClosedDate="2015-10-12T05:08:10.163" ContentLicense="CC BY-SA 3.0" />
  <row Id="21159" PostTypeId="1" CreationDate="2015-10-12T07:23:28.523" Score="1" ViewCount="1653" Body="&lt;p&gt;How do cost of revenue and SG&amp;amp;A compare (across industries)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For cost of revenue, one definition is &quot;the cost of manufacturing and delivering a product or service&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming my product is beer, my cost of revenue would be cost of water, barley, wheat etc, correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But that's very incomplete. I mean, to generate revenue from water and barley I needed:&#xA; - all the brewery equipment&#xA; - possibly financing the above&#xA; - sell the product to the customer&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But from what I understand, the cost of sales (and marketing etc) of my product is only included in operating expenses (under SG&amp;amp;A) and my financial expenses in continous operations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if anything, the name &quot;cost of revenue&quot; seems to be misleading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then as we start comparing companies and industries, it seems not everybody is using the same standards. For example, Oracle has only 20% of their cost presented as &quot;cost of revenue&quot; while IBM has about 50%. Without really understanding what's in there, the numbers seems incomparable.&#xA;Then what if we'd compare say automotive to IT... does it have any sense at all?&lt;/p&gt;&#xA;" OwnerUserId="17844" LastActivityDate="2015-10-12T23:30:16.043" Title="Cost of revenue vs SG&amp;A" Tags="&lt;finance&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2015-10-13T15:03:55.390" ContentLicense="CC BY-SA 3.0" />
  <row Id="21160" PostTypeId="1" AcceptedAnswerId="21170" CreationDate="2015-10-12T08:38:05.393" Score="3" ViewCount="315" Body="&lt;p&gt;As I am not a student of hard core mathematics,I just want to know how stochastic calculus is different from newton calculus. What make stochastic calculus different from simple newton calculus ?&lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2015-10-12T18:07:04.663" Title="Difference between stochastic calculus and newton calculus" Tags="&lt;finance&gt;&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21161" PostTypeId="1" CreationDate="2015-10-12T09:33:26.897" Score="1" ViewCount="212" Body="&lt;p&gt;I am trying to calculate numerically the price of a plain vanilla call through Fourier Transform, by applying the Gil-Pelaez formula. &#xA;More precisely, we have that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;C(K) = S_0 \Pi_1 - K e^{-r T} \Pi_2,&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\Pi_1 &amp;amp; = &amp;amp; \frac{1}{2} + \frac{1}{\pi} \int_0^\infty \mathfrak{Re} \left\{ \frac{\phi(u-i) e^{-\mathrm{i} u \ln(K)}}{\phi(-\mathrm{i}) \mathrm{i}u} \right\} \mathrm{d}u,\\&#xA;\Pi_2 &amp;amp; = &amp;amp; \frac{1}{2} + \frac{1}{\pi} \int_0^\infty \mathfrak{Re} \left\{ \frac{\phi(u) e^{-\mathrm{i} u \ln (K)}}{\mathrm{i} u} \right\} \mathrm{d}u&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\phi(u) = \exp \left\{ \mathrm{i} \left( \ln \left( S_0 \right) + \left( r - \frac{1}{2} \sigma^2 \right) T \right) u - \frac{1}{2} \sigma^2 u^2 T \right\}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although I do the algebra, it seems that that the integrands I get inside $\Pi_1$ and $\Pi_2$ are the same, something which is obviously false. Although I know it's a stupid question, could you please help me on which are the real parts of the integrands? You help is highly appreciated since I have tried calculating them several times.&lt;/p&gt;&#xA;" OwnerUserId="16272" LastEditorUserId="24222" LastEditDate="2016-12-20T19:46:40.397" LastActivityDate="2019-07-16T08:15:19.237" Title="Gil-Palaez Inversion Formula in Black Scholes world" Tags="&lt;options&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21162" PostTypeId="1" CreationDate="2015-10-12T11:05:08.357" Score="2" ViewCount="55" Body="&lt;p&gt;Certificates issued by famous industry names are usually made up by a combination of a fixed income instrument and some vanilla and exotic options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for something which explains:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;how to decompose a certificate in its derivatives instruments (e.g. &quot;A &lt;em&gt;XYZ&lt;/em&gt; certificate is usually made up by a zero coupon bond, a down &amp;amp; out Put striked ad $D$ and a vanilla Call striked at $K$);&lt;/li&gt;&#xA;&lt;li&gt;some suitable pricing strategies (e.g. pricing single instruments and then sum up NPVs to obtain current NPV of certificate).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In particular, my focus would be on these types: &lt;strong&gt;Equity protection&lt;/strong&gt; and &lt;strong&gt;Butterfly&lt;/strong&gt; certificates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you know any good source for such material? Internet offers a lot of &quot;easy&quot; stuff to explain how these instruments work from a purely qualitative point of view (&lt;a href=&quot;http://www.my-structured-products.com/Capital-Guarantee/capital-guarantee-without-cap&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;this&lt;/strong&gt;&lt;/a&gt; site, as instance), but it lacks of well organized quantitative material for pricing purposes.&lt;/p&gt;&#xA;" OwnerUserId="3058" LastActivityDate="2015-10-12T11:05:08.357" Title="Equity protection and butterfly certificates pricing" Tags="&lt;options&gt;&lt;fixed-income&gt;&lt;pricing&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21163" PostTypeId="1" CreationDate="2015-10-12T11:47:49.227" Score="7" ViewCount="835" Body="&lt;p&gt;I want to use the Monte Carlo Method described in Aronsons book Evidence based Technical Analysis to test if a given pairs trading strategy is useless.&#xA;First step there is to randomize the returns of the underlying instrument. Second step is to calculate daily log returns of the strategy as a performence measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the first step: Is it sufficient to randomize the spread that is already calculated or are the underlying instruments to be randomized and hedging coefficient estimation to be repeated?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the second step: log returns for spreads are not suitable since the spread can have negative values. So may be better use differencies of spread today minus spread yesterday?&lt;/p&gt;&#xA;" OwnerUserId="11635" LastActivityDate="2018-08-30T22:00:48.663" Title="Whites Reality Check for Pair Trading" Tags="&lt;monte-carlo&gt;&lt;spread&gt;&lt;hullwhite&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21164" PostTypeId="1" AcceptedAnswerId="21175" CreationDate="2015-10-12T11:59:28.407" Score="4" ViewCount="4041" Body="&lt;p&gt;I hope you can help me with the following question. What is the correct way to write the formula for the French and Fama Three Factor Model. I have currently found three versions of this formula, these being:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/TLJhR.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/TLJhR.png&quot; alt=&quot;fff&quot;&gt;&lt;/a&gt; &#xA;The question I have, is there are difference between these or are all the same? Primarily I am interested in the explanation for the position of the Alpha and the risk free rate, I also notice that the error term is sometimes noted sometimes not. Is it a mere question of preference or are there deeper implications as to how you write it? I thank you for any feedback! &lt;/p&gt;&#xA;" OwnerUserId="17688" LastActivityDate="2015-10-13T13:47:05.903" Title="French and Fama Three Factor Model - What is the correct formula?" Tags="&lt;fama-french&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21165" PostTypeId="1" CreationDate="2015-10-12T15:05:40.793" Score="3" ViewCount="82" Body="&lt;p&gt;I'm working on the following problem and would appreciate some input because I'm stuck.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a fund that works as follows. The fund starts with $S_0$ worth of assets following a Geometric Brownian Motion. At each time of the schedule $\{t_i\}_{1 \leq i \leq N}$, party $B$ gets a payment worth $\alpha S_{t_i}$. This goes on for $N$ dates, then a party $A$ fills the fund back to $S_0$ if $S_{t_N} &amp;lt; S_0$. If $S_{t_N} &amp;gt; S_0$ the difference is paid to party $C$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I need to value the claims of all three parties. At maturity the claim of $C$ is worth $\max(S_{t_N}-S_0, 0)$, while the claim of $A$ is worth $\min(S_{t_N} - S_0, 0)$.&#xA;Now let $Q$ be the risk-neutral measure. I thought the initial value of these claims to be $e^{-rt_N}E^Q(\max(S_{t_N}-S_0, 0))$ and $e^{-rt_N}E^Q(\min(S_{t_N}-S_0, 0))$ respectively. I approximated this expectation by simulating under $Q$ (so simulate $S_{t_i}$ under $Q$ with drift term $r$, where $r$ is the risk free rate). However at each period I reset as follows:&#xA;$$S_{t_i^+} = (1-\alpha)S_{t_i^-}$$&#xA;where:&#xA;$$S_{t_i^-}=S_{t_{i-1}^+}e^{(r-\frac{\sigma^2}{2})(t_i-t_{i-1})+\sigma W_{t_i-t_{i-1}}}$$&#xA;1) Can I still use this pricing method? Doesn't taking a cut of $S_{t_i}$ every period ruin it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) The second question I have is what is the claim of $B$ and how to price it? My intuition: After $N$ periods $B$ has received $\sum_i \alpha S_{t_i}$. But how to price this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) And lastly: there is supposed to be a parity relationship between the values of the three claims. The fund transforms $S_0$ and the contribution of $A$ into payments to $B$ and $C$ and $S_0$. So I thought, somehow the price of the claim of $A$ should be equal to the prices of $B$ and $C$. Is this correct? If so why? If not what should I do?&lt;/p&gt;&#xA;" OwnerUserId="17594" LastEditorUserId="20454" LastEditDate="2017-10-06T13:12:27.540" LastActivityDate="2017-10-06T18:54:40.350" Title="Pricing claims of parties in a fund" Tags="&lt;option-pricing&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21167" PostTypeId="1" AcceptedAnswerId="21177" CreationDate="2015-10-12T17:15:56.177" Score="4" ViewCount="938" Body="&lt;p&gt;I was revising my stuff about portfolio theory and I noticed that every single time, expected return and corresponding variance or covariance are given! (not calculating ourselves). So I'm just wondering if there is a way to figure out those values statistically. I think, forecasting using autoregressive model or ARIMA is plausible, however, it seems to be very difficult and not useful when we decide to choose a portfolio for a long term investment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It will be very thankful if somebody recommends me related textbook or leaves a brief answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="17849" LastActivityDate="2015-10-12T21:40:28.817" Title="Basic question on Portfolio Theory" Tags="&lt;modern-portfolio-theory&gt;&lt;portfolio&gt;&lt;portfolio-optimization&gt;&lt;statistical-finance&gt;&lt;finance-mathematics&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21168" PostTypeId="2" ParentId="21164" CreationDate="2015-10-12T17:27:02.450" Score="3" Body="&lt;p&gt;It's just a different notation. If you need factors already constructed you can get them on the web, for Example on &lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html&quot; rel=&quot;nofollow&quot;&gt;French's site&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="17850" LastEditorUserId="848" LastEditDate="2015-10-12T18:25:37.777" LastActivityDate="2015-10-12T18:25:37.777" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21169" PostTypeId="1" CreationDate="2015-10-12T18:01:04.513" Score="4" ViewCount="760" Body="&lt;p&gt;I've looked at several sources including Bloomberg, Zacks and Cap IQ. Many times, they don't update their data with the revisions. I'm looking for Income Statement and Balance Sheet data going back to 1994. Who has the best data?&lt;/p&gt;&#xA;" OwnerUserId="17851" LastActivityDate="2017-07-30T09:23:25.087" Title="Where can I find the most reliable historical fundamental data for US Equities" Tags="&lt;historical-data&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21170" PostTypeId="2" ParentId="21160" CreationDate="2015-10-12T18:07:04.663" Score="2" Body="&lt;p&gt;Talking about stochastic calculus in the sense of Ito the basic buidling block is a process with iid Gaussian increments called Brownian motion $(B_t)_{t \ge 0}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then a basic observation that can be generalized in numerous ways is that for a bounded function $f$ it holds that&#xA;$$&#xA;f(B_T) = f(B_0) + \int_{0}^T f'(B_t) dB_t + 1/2 \int_{0}^T f''(B_t) dt,&#xA;$$&#xA;where the definition of the integral with respect to Brownian motion is fundamental. Furthermore in usual calculus the $f''$ would not be present in the above equation.&#xA;In stochastic calculus the second order derivative does not vanish. This is what pops up everywhere.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-10-12T18:07:04.663" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21171" PostTypeId="2" ParentId="21167" CreationDate="2015-10-12T18:17:17.663" Score="5" Body="&lt;p&gt;Of course estimating expected returns is the very core of portfolio management. Finding a useful covariance matrix too. To find both fills a book. So I first thought about closing the question. But it is a chance to discuss today's approaches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A nice approach that is very up-to-date where mementum investing seems very fashionable is the following: &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2606884&quot; rel=&quot;noreferrer&quot;&gt;Momentum and Markowitz: A Golden Combination&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also apply some &lt;a href=&quot;http://www.blacklitterman.org/papers.html&quot; rel=&quot;noreferrer&quot;&gt;Black-Litterman&lt;/a&gt; procedure you learn a lot about this topic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ARMA-like approaches for financial markets does not seem to be a promising approach (see e.g. &quot;What can be forecast&quot; in the &lt;a href=&quot;https://www.otexts.org/fpp&quot; rel=&quot;noreferrer&quot;&gt;book&lt;/a&gt; by Athana­sopou­los and Hyndman.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-10-12T18:17:17.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21172" PostTypeId="1" CreationDate="2015-10-12T18:30:56.830" Score="2" ViewCount="173" Body="&lt;p&gt;I've read that a hybrid approach combing scenario analysis and loss distribution analysis can be used to calculate operational risk capital under the advanced models approach. I've read a couple ways this can be implemented and am not clear on the difference. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;They sound the same to me:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Generate a hybrid distribution (I'm assuming this is the loss severity distribution) where expected losses are comprised of historical internal losses (commensurate with the LDA approach) and use scenario analysis for the right hand side of the distribution. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use scenario analysis to &quot;stress&quot;  the model producing a more appropriate distribution &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Develop loss frequency and severity distributions from the data pool based on a combination of internal historical losses and scenario analysis. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Can someone explain the difference? In LDA,  we use a loss frequency and a loss severity distribution created from internal historical data.  If we are not using different data to create the distributions,  what other means are there to shock the model using scenario analysis? &lt;/p&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="848" LastEditDate="2015-10-12T18:54:19.197" LastActivityDate="2015-10-12T18:54:19.197" Title="Using a hybrid approach to calculate operational risk capital" Tags="&lt;risk&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21173" PostTypeId="1" CreationDate="2015-10-12T18:34:08.850" Score="1" ViewCount="35" Body="&lt;p&gt;Market Prices for European put and call options on ABC stock are as below: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Call = $4.5&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put = $6.8&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Exercise Price, X =$70&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Risk Free Annual Compounded rate r = 5% &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Time to expiration T = 139 days&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Current Stock Price S0 = $67.32&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;A. Determine Synthetic call, put and stock prices using parity relations and explain your observation.&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="17852" LastActivityDate="2015-10-12T18:34:08.850" Title="Financial Derivative, European Option" Tags="&lt;options&gt;&lt;equities&gt;&lt;put-call-parity&gt;&lt;european&gt;&lt;synthetic&gt;" AnswerCount="0" CommentCount="1" ClosedDate="2015-10-12T18:38:29.037" ContentLicense="CC BY-SA 3.0" />
  <row Id="21174" PostTypeId="1" CreationDate="2015-10-12T18:44:23.170" Score="1" ViewCount="249" Body="&lt;p&gt;What is the relationship between put option price and risk free rate? And between call options price and risk free rate? Explain the logic? No calculation.&lt;/p&gt;&#xA;" OwnerUserId="17852" LastActivityDate="2015-10-12T18:44:23.170" Title="Logic between options and risk free rate" Tags="&lt;options&gt;&lt;put-call-parity&gt;&lt;risk-free&gt;" AnswerCount="0" CommentCount="3" ClosedDate="2015-10-12T18:52:49.030" ContentLicense="CC BY-SA 3.0" />
  <row Id="21175" PostTypeId="2" ParentId="21164" CreationDate="2015-10-12T19:49:03.930" Score="5" Body="&lt;p&gt;There are issues with all three of these.   @noob2 has pointed out the inconsistency in the first one. It also uses no subscripts. The second one is probably least wrong. However, there is no index to the error term and no intercept. The third one uses too many indices. It has an index on the intercept and indices on the slopes. Granted, it is possible to estimate a time-varying version of Fama-French that would require indices here. However, that is not what normally people who estimate Fama-French models are doing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One other quibble is that they each use $i$ as an index. Typically $i$ is used for cross-sectional indices and $t$ is used for time indices. It's not really a significant issue, but if you start mixing in panel models, then it becomes important.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So here's how I would write it:&#xA;$$r_{t}-r_{t,f}=\alpha+\beta_{mkt}\left(r_{t,mkt}-r_{t,f}\right)+\beta_{SMB}r_{t,SMB}+\beta_{HML}r_{t,HML} + \varepsilon_{t}$$&#xA;I like making clear that they are all different types of returns. I have a tendency to not work with the excess returns, but it is common in academic finance.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastEditorUserId="2379" LastEditDate="2015-10-13T13:47:05.903" LastActivityDate="2015-10-13T13:47:05.903" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21176" PostTypeId="2" ParentId="21164" CreationDate="2015-10-12T21:34:13.157" Score="2" Body="&lt;p&gt;I have been thinking about this issue a lot recently after reading Cochrane's excellent textbook. After some struggles, I think the key to understand all this is to pay attention to the subscripts, because they are important. Here is my take on your question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will use the form as so:&#xA;$$r^e_{i,t} = \alpha_i+\beta_{i,MKT}(r_{MKT,t}-r_{f,t})+\beta_{i,SMB} r_{SMB,t}+\beta_{i,HML}r_{HML,t}+\epsilon_{i,t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is &lt;em&gt;population&lt;/em&gt; regression. You can think of projecting excess return on to the space of the factors and a constant. If you read the theory part seriously, you can see this is how we define the $\beta$s in the expected return-beta form of any linear factor model.To think about this relationship, you can fix i (or the vectorized form $r^e_t=[r^e_1,\cdots,r^e_N]'$), then we can think of the regression above as a time-series regression as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r^e_{t} = \alpha+\beta_{MKT}(r_{MKT,t}-r_{f,t})+\beta_{SMB} r_{SMB,t}+\beta_{HML}r_{HML,t}+\epsilon_{t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the usual linear regression you see in any textbook. By construction, the $E[\epsilon_t|factors]=0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The more interesting thing is to think about what we are doing when we look at the intercept to see if the model does a good job pricing our left hand side portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all, when you talk about a factor model, the main implication of it is actually on the expected return not on return. &#xA;$$E[r^e_i] = \beta_i \lambda$$.&#xA;where $\lambda$ is the risk premium associated with your factor. There are two things we need to pay attention to.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The subscript doesn't involve t, because we are dealing with an unconditional model which we think of the realization of returns and beta at each time as drawn from a distribution of $r^e_i$ and $\beta_i$ for each firm. &lt;/li&gt;&#xA;&lt;li&gt;You may wonder where is the factor in this model. The factor only enters into the model through its risk premium. It's only in the special case when your factors are excess returns, the risk premium $\lambda=E[f]$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Now with these concepts clear up, we can proceed to understand Fama French 3-factor model.So what they propose is that the 3 factors are three long-short portfolio returns, namely MKT, SMB and HML. Given what I have talked about above, the model (APT, ICAPM) essentially says:&#xA;$$E[r^e_i] = \beta_{i,MKT}E[r_{MKT}-r_f]+\beta_{i,SMB} E[r_{SMB}]+\beta_{i,HML} E[r_{HML}]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remember, these relationship are predicted by the model to hold in the population. What we observe is only the historical realization of these returns, so we need to estimate this relationship. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, let's relate back to the time-series regression of Fama French at the beginning. By taking the unconditional expectation of both sides of the first equation and compared to the theoretical model above. You can see the implication for those MKT, SMB and HML being factors that perfectly price assets is that $\alpha_i =0$ $\forall i$ jointly. To test this, we can use the GRS(1989) test statistics.&lt;/p&gt;&#xA;" OwnerUserId="6804" LastActivityDate="2015-10-12T21:34:13.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21177" PostTypeId="2" ParentId="21167" CreationDate="2015-10-12T21:40:28.817" Score="4" Body="&lt;ol&gt;&#xA;&lt;li&gt;Theoretically speaking (as it's done in financial textbooks at b-school level), variance and covariance are calculated on historical performance of asset classes, forward looking returns are CAPM calculated returns.&lt;/li&gt;&#xA;&lt;li&gt;ARIMA. Practically speaking, ARIMA is useless for predicting long term returns (or portfolio management if you wish). Why? A short answer is that all info from historical prices already incorporated in the current price of an asset (EMH). I haven't seen a theoretical proof of this statement, but this seems to be true (same for using ARIMA for predicting short term).  &lt;/li&gt;&#xA;&lt;li&gt;Practical Portfolio management. You need to have a &quot;correct&quot; prediction of future asset returns (&quot;market&quot;, &quot;below market&quot;, &quot;above market&quot; or &quot;sell&quot;, &quot;hold&quot;, &quot;buy&quot; or sometimes &quot;conviction buy&quot; as GS puts it, based on your research and models. DCF eg). Then you try to combine those assets into portfolios according to some targets: absolute return, asset classes, industries etc, optimizing risk/return based on your forecasts and history.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Competing on predicting returns is hard: some compare this business to throwing darts (both journalists and well respected analysts like Albert Edwards in his &quot;The dangers of DCF&quot;). Putting several assets together to produce a combination with lowest possible variance seems to be a bit easier. Cliff Azness' AQR Management is in this business.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may read more about modern [quantitative] portfolio management in these books:  &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Pfaff, &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470978708&quot; rel=&quot;nofollow&quot;&gt;Financial Risk Modelling and Portfolio Optimization with R&lt;/a&gt;. Examples with R code.&lt;/li&gt;&#xA;&lt;li&gt;Antti Ilmanen, &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1119990726&quot; rel=&quot;nofollow&quot;&gt;Expected Returns: An Investor's Guide to Harvesting Market Rewards&lt;/a&gt;. Book shows how history is incorporated into portfolio management practically.&lt;/li&gt;&#xA;&lt;li&gt;Richard R. Lindsey (editor), &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470452579&quot; rel=&quot;nofollow&quot;&gt;How I Became a Quant: Insights from 25 of Wall Street's Elite&lt;/a&gt;. This book is not a how-to on portfolio management. Rather, it's narrative of successful quants, some of them being portfolio managers. I bought this book because I was interested in what Cliff Azness doing at his firm. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Hope this helps in answering OP's questions...&lt;/p&gt;&#xA;" OwnerUserId="13718" LastActivityDate="2015-10-12T21:40:28.817" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21178" PostTypeId="1" CreationDate="2015-10-12T21:40:40.217" Score="2" ViewCount="97" Body="&lt;p&gt;Tests of market efficiency are the joint tests of (1)the market is efficient and (2) expected return model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please help me (a) explain this and (b) is it possible to test market efficiency with either of these ones?&lt;/p&gt;&#xA;" OwnerUserId="17853" LastActivityDate="2015-10-12T21:40:40.217" Title="Joint tests of market efficiency - Is it possible to test market efficiency with either one?" Tags="&lt;emh&gt;&lt;market-efficiency&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21179" PostTypeId="2" ParentId="21147" CreationDate="2015-10-12T22:05:12.677" Score="0" Body="&lt;p&gt;I think I've found the answer in another Basel paper. This second paper is talking about the treatment of pending losses (losses where the financial impact is not certain at this point e.g. litigation). They way to record these in the loss database is to take a &quot;legal reserve&quot; and record that amount, then adjust the recorded amount in the future if it changes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So from this, I gather &quot;reserve date&quot; is the date the &quot;legal reserve&quot; (which as I understand it is allocating funds now for when this loss might be realized) is taken. &lt;/p&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="9265" LastEditDate="2015-10-12T22:22:53.717" LastActivityDate="2015-10-12T22:22:53.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21180" PostTypeId="2" ParentId="21099" CreationDate="2015-10-12T22:44:11.340" Score="0" Body="&lt;p&gt;It probably depends on the liquidity of your asset and the size of the sell order: if you want to trade a heavily traded [and thus liquid] ETF such as SPY for example, your sell order would probably fill almost instantly - unless it is a very big order. In that case, obtaining second or tick data would remove most uncertainty from the question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if the asset is not liquid and/or a very large order is sent, the sell would certainly be filled around the low [and yes, possibly lower].&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, lacking any additional information, I would either use the Close price, which usually is representative of the time period, or the low, as a [proxy] worst-case scenario [keeping in mind that it is not exactly worst-case].&lt;/p&gt;&#xA;" OwnerUserId="11791" LastActivityDate="2015-10-12T22:44:11.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21181" PostTypeId="2" ParentId="21159" CreationDate="2015-10-12T22:48:33.983" Score="0" Body="&lt;ol&gt;&#xA;&lt;li&gt;Cost of Sales vs. SG&amp;amp;A.  Cost of sales are your expenses directly incurred in the production cycle or service delivery. SG&amp;amp;A is overhead incurred while helping production. The main difference between the two (&lt;strong&gt;roughly&lt;/strong&gt;) is that Costs differ with production level (&lt;strong&gt;almost&lt;/strong&gt;) while SG&amp;amp;A is considered to be fixed. One more subtle accounting difference, Cost of Sales is accounted for on accrual basis (matched to sales) while SG&amp;amp;A is charged to Income statement in the period it's incurred.&lt;/li&gt;&#xA;&lt;li&gt;You may use Cost of Sales vs SG&amp;amp;A within one company for break-even analysis, to calculate how much production you need to sell to cover overhead (or vice versa how many admin people to lay off to match current state of the economy). Or you may use historical records of both to identify why your net income margins have shrunk during the last quarter (this would be called horizontal analysis).&lt;/li&gt;&#xA;&lt;li&gt;Comparing Cost of Sales and SG&amp;amp;A between two companies, even within the same industry may be tricky, as you said. The job of the Financial analyst in this case is to make two sets of the Financial Statements as comparable as possible before drawing any conclusion that one company is more management-wise efficient than the other. Adjustment may include bringing both companies to the same:&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;accounting basis (GAAP or IFRS)  &lt;/li&gt;&#xA;&lt;li&gt;inventory accounting rules (FIFO or LIFO)&lt;/li&gt;&#xA;&lt;li&gt;depreciation rules&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Let alone that similar items in two similar companies may be under different names.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why knowing these two important:  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;when you assess prospects of buying a company you need to understand if the company generates enough cash (think of EBITDA here and EV/EBITDA which is a shortcut for company value), generates it effectively, and if the operations could be improved. Knowing Costs of sales and SG&amp;amp;A (as pct of revenue) helps compare companies at operational level within industry and across industries.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Disclaimer:&#xA;the definitions for Costs of Sales and SG&amp;amp;A are not intended as accounting guidance. E.g., there are situations when production stops, but the company reports some minimum cost of revenue to support production site. Rather, these are intended as general logic behind strict accounting definitions that may help to memorize the difference between the two.&lt;/p&gt;&#xA;" OwnerUserId="13718" LastEditorUserId="13718" LastEditDate="2015-10-12T23:30:16.043" LastActivityDate="2015-10-12T23:30:16.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21182" PostTypeId="1" CreationDate="2015-10-13T01:21:05.197" Score="8" ViewCount="1650" Body="&lt;p&gt;If $W$ and $B$ are independent &lt;a href=&quot;https://en.wikipedia.org/wiki/Brownian_motion&quot; rel=&quot;nofollow&quot;&gt;Brownian Motions&lt;/a&gt; (BM thereafter), then the average of $W$ and $B$ is $X_t=\frac{1}{2}(W_t+B_t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where do I begin to show that indeed it is still a BM?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, if both are martingales, then $X_t$ must be a martingale also. How would I prove this considering it has the two random variables?&lt;/p&gt;&#xA;" OwnerUserId="17854" LastEditorUserId="467" LastEditDate="2015-10-15T08:32:09.563" LastActivityDate="2017-09-30T03:31:41.740" Title="Is the average of independent Brownian Motions still a Brownian Motion?" Tags="&lt;time-series&gt;&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21183" PostTypeId="1" AcceptedAnswerId="21192" CreationDate="2015-10-13T05:25:02.427" Score="2" ViewCount="198" Body="&lt;p&gt;Are there certain strategies and general rules on how to estimate the beta of certain companies? How do I instantly know that it's a beta &amp;lt; 1 or a beta &gt;&gt; 1 corporation? Any helpful ratios that might point in one or the other direction? I'm asking, because so far I've only calculated the beta using Excel and there was not much guessing left to do and I think I still don't have a good instinctive grasp of the matter.&lt;/p&gt;&#xA;" OwnerUserId="17857" LastActivityDate="2015-10-14T21:25:01.363" Title="How to estimate the beta of corporations?" Tags="&lt;beta&gt;" AnswerCount="4" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21184" PostTypeId="2" ParentId="21182" CreationDate="2015-10-13T08:31:31.147" Score="2" Body="&lt;p&gt;Let's $W_t$ and $B_t$ are tow independent Brownian motion, where :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$W_t$ ~ $N(0, t)$,&lt;br&gt;&#xA;$B_t$ ~ $N(0, t)$&lt;br&gt;&#xA;$Cov(W_t,B_t)=0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know that sum of two Gaussian random variable is also Gaussian. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E(1/2(W_t+B_t)) = 1/2(E(W_t+B_t))=0$$&#xA;$$Var(1/2(W_t+B_t))=1/4(var(W_t+B_t))=1/4(var(W_t)+var(B_t))=.5t$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;because $W_t$ and $B_t$ are independent. So: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_t$=$1/2(B_t+W_t)$ ~ $N(0, .5t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT : $X_t$ has continuous path and $X_t=0$ for $t=0$ but $Var(X_t) \neq t$( a necessary condition for Brownian Motion). Hence $X_t$ is not Brownian Motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;@Gordon mention rightly $\sqrt{1/2}(Wt+Bt)$ is a BM but not $X_t$.    &lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="16991" LastEditDate="2015-10-15T07:12:37.363" LastActivityDate="2015-10-15T07:12:37.363" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21185" PostTypeId="1" AcceptedAnswerId="21190" CreationDate="2015-10-13T08:43:46.277" Score="6" ViewCount="496" Body="&lt;p&gt;There are many assumptions on mean-variance portfolio theory and they seem to be very unrealistic, for example&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) investors have the same information at the same time:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;calculating expected returns for assets and their covariance requires many statistical knowledge and the calculation may differ greatly from one forecasting method to the others. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) investors make their decision solely on the means and covariances of asset returns:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even if all investors have the same expected returns and covariances, some investors may make their decision based on their asset preferences &#xA; for example: if you like apple, you may invest in apple without considering any of those statistical information. It seems to be very irrational but I saw some people doing in this way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apart from this, there are many counter-examples for underlying assumptions. So, can we actually make our decisions using mean-variance portfolio? &lt;/p&gt;&#xA;" OwnerUserId="17849" LastActivityDate="2018-06-16T05:59:00.270" Title="Mean Variance Portfolio theory and real-world problem?" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio&gt;&lt;portfolio-optimization&gt;&lt;mean-variance&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21186" PostTypeId="2" ParentId="21185" CreationDate="2015-10-13T09:29:31.307" Score="4" Body="&lt;p&gt;It is well known that the MV-optimal portfolio has some very bad properties in practice:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Backtesting: The MV portfolio performs very bad in backtesting applications&lt;/li&gt;&#xA;&lt;li&gt;Diversification: The MV portfolio tends to invest all funds into the best asset (highest sharpe ratio) of the past, leading to very low diversification.&lt;/li&gt;&#xA;&lt;li&gt;Non-Normality: Return distributions are actually highly non-normal and asymmetric, which contradicts the assumptions of MV (there are other moments of the distribution which should be considered aswell).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The MV model has some important theoretical implications which cannot be shown as easily without its simplifying assumptions, however in practice MV is not recommended.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2015-10-13T10:02:31.713" LastActivityDate="2015-10-13T10:02:31.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21187" PostTypeId="1" AcceptedAnswerId="21222" CreationDate="2015-10-13T09:29:46.287" Score="2" ViewCount="224" Body="&lt;p&gt;I have been reading Wilmott Frequently Asked Question book and this was mentioned that Vega is not useful when measuring risk for options that have gammas changing signs such as Digital option or Barrier option. In particular, even though Vega is 0 when spot is around strike level, it is where the option is most sensitive to volatility. Unfortunately, it was not explained in details. Can anyone please elaborate on this ?&lt;/p&gt;&#xA;" OwnerUserId="13951" LastEditorUserId="13951" LastEditDate="2015-10-13T09:50:29.013" LastActivityDate="2015-10-14T22:01:21.143" Title="Why is Vega meaningful only for options which have single-signed gammas" Tags="&lt;black-scholes&gt;&lt;greeks&gt;&lt;vega&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21188" PostTypeId="1" CreationDate="2015-10-13T10:09:55.093" Score="1" ViewCount="101" Body="&lt;p&gt;The current stock price is \$80.Call ,and ,put, options, with ,exercise ,prices, of $50 and 3 days to maturity are currently trading. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is more likely effect to call and put prices, respectively, if the stock price decreases by \$1?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No Calculation. Hint: sketch indicative payoff and price graphs to observe the price points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A. Decrease by \$0.94.Increase by \$0.08&lt;/p&gt;&#xA;&#xA;&lt;p&gt;B. Decrease by \$0.76.Increase by \$0.96 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;C. Decrease by \$0.07. Increase by \$0.89&lt;/p&gt;&#xA;" OwnerUserId="17852" LastEditorUserId="9265" LastEditDate="2015-10-13T14:02:12.817" LastActivityDate="2015-10-13T14:02:12.817" Title="What is more likely effect to call and put prices, respectively, if the stock price decreases by$1?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;finance&gt;&lt;put-call-parity&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21189" PostTypeId="1" CreationDate="2015-10-13T10:31:02.993" Score="2" ViewCount="136" Body="&lt;p&gt;PLease help me in understanding how to price forward contract for coupon paying security. For instance if we get into a contract to buy a security in next six month whose coupon due in next two month. So how to price it. Please provide me an intuitive understanding of this.&lt;/p&gt;&#xA;" OwnerUserId="17859" LastActivityDate="2015-10-13T18:36:13.700" Title="Forward contract pricing of coupon paying security" Tags="&lt;no-arbitrage-theory&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21190" PostTypeId="2" ParentId="21185" CreationDate="2015-10-13T11:25:10.450" Score="6" Body="&lt;p&gt;Mean-variance (MV) is a framework rather than a prescription. This framework allows one to make, discuss, and defend his investment decision.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, there are many ways to make adjustments to this framework, if you believe they will improve performance. E.g. you can adjust the framework by stating &quot;I will MV-optimize weights subject to &quot;0&quot; if the weights fall below 2%&quot; or you can incorporate your beliefs of the expected returns (Black-Litterman). Or, you can redefine volatility, only diversifying away negative deviations.&lt;/p&gt;&#xA;" OwnerUserId="13718" LastEditorUserId="13718" LastEditDate="2018-06-16T05:59:00.270" LastActivityDate="2018-06-16T05:59:00.270" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="21191" PostTypeId="2" ParentId="21188" CreationDate="2015-10-13T12:10:11.573" Score="2" Body="&lt;p&gt;In this case, call option is deep in the money while put option is deep out of money. As maturity is very near, any change in stock price would have equivalent impact on the call option price. Decline in one dollar in stock price lead to almost one dollar decline in call option price. Whereas for put, its worth would increase but put is still deep out of money (as maturity is also near). So increase in put value would be negligible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So as per your 3 options given above only option A best fit the all possible scenario. So desire answer must be A.    &lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2015-10-13T12:10:11.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21192" PostTypeId="2" ParentId="21183" CreationDate="2015-10-13T12:24:13.267" Score="2" Body="&lt;p&gt;$\beta_s = \frac{cov(r_s,r_m)}{var(r_m)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;High beta stocks (beta &gt;&gt; 1) are those that outperform market when it moves up and, correspondingly, lag market when it goes down. In general blue chips will have betas close to one, for a simple reason: it is this companies that have more weight in the index/market and, thus, they tend to be more correlated with the market. Small and middle cap companies will have higher betas.&lt;/p&gt;&#xA;" OwnerUserId="13718" LastActivityDate="2015-10-13T12:24:13.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21193" PostTypeId="2" ParentId="21183" CreationDate="2015-10-13T12:33:31.423" Score="2" Body="&lt;p&gt;There are many approaches to calculate however mostly people prefer to calculate industry beta and then apply financial leverage on that to get company beta.&lt;/p&gt;&#xA;" OwnerUserId="17859" LastActivityDate="2015-10-13T12:33:31.423" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21194" PostTypeId="2" ParentId="21183" CreationDate="2015-10-13T13:41:19.020" Score="0" Body="&lt;p&gt;Ans easy way is to look for direct competitors and compare the values. &lt;/p&gt;&#xA;" OwnerUserId="12089" LastActivityDate="2015-10-13T13:41:19.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21195" PostTypeId="1" AcceptedAnswerId="21200" CreationDate="2015-10-13T16:40:57.967" Score="1" ViewCount="673" Body="&lt;p&gt;I read an article about arima forecasting and i said that before we forecast arima model, its stationarity has to be checked.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the model is stationary, it is clear that forecasting converges to whatever the mean the model has.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However for ARIMA(p,d,q) where d&gt;0 or some non-stationary ARIMA(p,0,q), we have to consider a drift of the model and it implies that the model has no convergence in long term.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, if we want to forecast non-stationary ARIMA model, then do we have to transform to the model to be stationary and proceed forecasting and then transform back to the original data with the calculated forecasting value?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I know that long-term forecasting using ARIAM is not very useful, but this question is just for understanding the context)&lt;/p&gt;&#xA;" OwnerUserId="17849" LastActivityDate="2015-10-13T18:35:39.303" Title="ARIMA Forecasting always converges?" Tags="&lt;forecasting&gt;&lt;stationarity&gt;&lt;forecast&gt;&lt;arima&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21196" PostTypeId="1" CreationDate="2015-10-13T17:59:55.317" Score="0" ViewCount="132" Body="&lt;ul&gt;&#xA;&lt;li&gt;Value of the firm V = 100&lt;/li&gt;&#xA;&lt;li&gt;Face value of debt X is 120 and still one year to go until maturity&lt;/li&gt;&#xA;&lt;li&gt;Firm value volatility is 40.5% per annum&lt;/li&gt;&#xA;&lt;li&gt;Risk free rate is 6%&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Consider a one-period model. If any information is not available make assumptions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the equity value of the firm &quot;in the money&quot; or &quot;out of the money&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I know how to compute firm value V, return on assets rA, and value of D and E. Just don't get this question.&lt;/p&gt;&#xA;" OwnerUserId="17861" LastActivityDate="2015-10-13T18:21:48.390" Title="Is the equity value of the firm &quot;in the money&quot; or &quot;out of the money&quot;? BOPM &amp; BSOPM" Tags="&lt;equities&gt;&lt;valuation&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2015-10-13T18:29:02.407" ContentLicense="CC BY-SA 3.0" />
  <row Id="21197" PostTypeId="2" ParentId="21182" CreationDate="2015-10-13T18:21:09.927" Score="4" Body="&lt;p&gt;It is nearly a Bronwian motion. Just the variance is not correct:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is more tricky than it seems. A Brownian motion has the distribution properties stated below, so does a linear combination of BMs. But after all it is a martingale in a certain filtration (set of information) which has to be defined. $B_t$ is a BM in its own filtration, so is $W_t$. The mean is a Brownian motion in its own filtration and in the filtration generated by $B_t+W_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the distribution consider that $E[B_t] = E[W_t]=0$ and $Var[B_t] = Var[W_t]=t$. Then $E[X_t]=0$ and $Var[X_t] = 1/2 t$ provided that $(B_t)_{t\ge0}$ and $(W_t)_{t\ge0}$ are independent. The Gaussian law is a known fact.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: $ VAR[1/2(W_t+B_t)] = 1/4 (VAR[W_t] + VAR[B_t]) = 1/4 (t+t)= 1/2 t$. So the variance is wrong and it is no BM.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-10-14T07:02:56.927" LastActivityDate="2015-10-14T07:02:56.927" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21198" PostTypeId="2" ParentId="21196" CreationDate="2015-10-13T18:21:48.390" Score="2" Body="&lt;p&gt;We can value equity as a call option on the value of the firm, where exercising the option requires that the firm be liquidated and the face value of the debt (which corresponds to the exercise price) paid off. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The parameters of equity as a call option are as follows: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Value of the underlying asset = S = Value of the firm = 100&lt;/li&gt;&#xA;&lt;li&gt;Exercise price/Strike price = K = Face Value of outstanding&#xA;debt = 120&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;A call option is in the money, when the strike price is below the market price of the underlying asset. A call option is out of the money, when K &gt; S.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;S = 100 and K = 120; K &gt; S, so the equity value of the firm is out of the money.&lt;/p&gt;&#xA;" OwnerUserId="17861" LastActivityDate="2015-10-13T18:21:48.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21200" PostTypeId="2" ParentId="21195" CreationDate="2015-10-13T18:35:39.303" Score="1" Body="&lt;p&gt;It is too much too text so I take screenshots and the link to Rob Hynman's &lt;a href=&quot;http://robjhyndman.com/hyndsight/arimaconstants/&quot; rel=&quot;nofollow noreferrer&quot;&gt;blog entry&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you formulate the ARIMA model likes this:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/Bri9z.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Bri9z.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you get these long term forecasts:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/n5pta.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/n5pta.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-10-13T18:35:39.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21201" PostTypeId="2" ParentId="21189" CreationDate="2015-10-13T18:36:13.700" Score="3" Body="&lt;p&gt;(This answer is broadly in line with the comment of Amsh. I added it because Amsh his 1 line solution says substract the PV (present value) of the div; However, the example below shows that one should substract the FV (future value) of the div). edit: to be more precise future value from moment you receive div, until you deliver the stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume $S(0) = 100$ is the price of asset at time 0.&#xA;You enter into a forward agreement to deliver the stock at time T = 12 months for K.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume the rate $r$ is fixed. Assume there is one dividend payment Q = 5 at time T_coup = 2 months.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You borrow S(0) dollars and buy 1 stock. &#xA;At t=2/12 you receive 5, these you invest in the money market against rate r.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;at time T = 1 you deliver your stock. You receive K. Your dividend has grown to 5*exp(r*10/12). Your initial loan is repayable 100*exp(r*12/12). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The deal is fair if K + 5*exp(r*0.5) = 100*exp(r*1).&#xA;K = 100*exp(r*1) - 5 exp(r*10/12)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also see:&#xA;&lt;a href=&quot;https://www.ma.utexas.edu/users/mcudina/m375t_lecture_six_forward_prices.pdf&quot; rel=&quot;nofollow&quot;&gt;https://www.ma.utexas.edu/users/mcudina/m375t_lecture_six_forward_prices.pdf&lt;/a&gt;&#xA;equation 6.1&lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2015-10-13T18:36:13.700" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21204" PostTypeId="2" ParentId="21099" CreationDate="2015-10-14T01:37:19.193" Score="0" Body="&lt;p&gt;It sounds like you are trying to backtest a strategy and want to simulate actual trading conditions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this is the case, I make the suggestion that liquidity concerns are of more relevance than nailing a hypothetical order price in a 1-minute interval. If you're really concerned about the price, you could simply average the prices. Note that this is mathematically equivalent to weighing each value at 25%. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could get more industrious and estimate the variance within the interval and make a guess about what that says about the hypothetical price, but you would need to verify that assumption empirically, anyways. To me that sounds like a lot of unnecessary work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you live-test a strategy there are many variables that are present that are not easily modeled in a backtest. So to really work at resolving just one (that is minor IMO) is perhaps not the best use of your energy.  &lt;/p&gt;&#xA;" OwnerUserId="17865" LastActivityDate="2015-10-14T01:37:19.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21205" PostTypeId="2" ParentId="21169" CreationDate="2015-10-14T01:51:53.183" Score="1" Body="&lt;p&gt;If you really want accuracy, the answer is the &lt;a href=&quot;http://edgar.sec.gov/edgar.shtml&quot; rel=&quot;nofollow&quot;&gt;SEC&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise, you'll have to expect some inaccuracies. Bloomberg I would probably rank highest of the ones listed, but this is more qualitative than quantitative, as I know of no studies that suggest it to be most accurate. &lt;/p&gt;&#xA;" OwnerUserId="17865" LastActivityDate="2015-10-14T01:51:53.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21206" PostTypeId="2" ParentId="21163" CreationDate="2015-10-14T02:11:34.660" Score="1" Body="&lt;p&gt;I am not familiar with the book you mention, so this may not be helpful or relevant. But the phrasing of your question is very peculiar to me. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A pairs trade's quantitative appeal is determined by analyzing the historical time series of the stocks. Randomizing the stock prices or the spread also randomizes the time order, which invalidates any method of analyzing a pairs trade that I know of. So I am not sure what this is supposed to demonstrate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, the natural logarithm of stock prices is often used in the process of evaluating pairs trades, and it would not make sense to take the logarithm of the spread.  &lt;/p&gt;&#xA;" OwnerUserId="17865" LastEditorUserId="17865" LastEditDate="2015-10-14T03:19:27.727" LastActivityDate="2015-10-14T03:19:27.727" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21207" PostTypeId="1" AcceptedAnswerId="21211" CreationDate="2015-10-14T03:59:30.200" Score="0" ViewCount="69" Body="&lt;p&gt;Is there a definitive way of mapping tickers to companies for companies with multiple listed tickers? For example, GOOG and GOOGL are both Google (or now Alphabet), or BRK.A and BRK.B are both Berkshire&lt;/p&gt;&#xA;" OwnerUserId="5251" LastActivityDate="2015-10-14T08:58:08.933" Title="Definitive way of figuring out companies with multiple classes of stocks" Tags="&lt;data&gt;&lt;market-data&gt;&lt;fundamentals&gt;&lt;sec&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21208" PostTypeId="2" ParentId="21207" CreationDate="2015-10-14T07:09:50.083" Score="0" Body="&lt;p&gt;I believe if you access to CRSP say under WRDS (&lt;a href=&quot;https://wrds-web.wharton.upenn.edu/wrds/&quot; rel=&quot;nofollow&quot;&gt;https://wrds-web.wharton.upenn.edu/wrds/&lt;/a&gt;), then you can track a company not by its ticker but by its CUSIP. &lt;/p&gt;&#xA;" OwnerUserId="17332" LastActivityDate="2015-10-14T07:09:50.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21209" PostTypeId="2" ParentId="15432" CreationDate="2015-10-14T07:44:11.070" Score="4" Body="&lt;p&gt;Even though it's a straightforward extension, it took me a while (a year? yikes!); but now you can easily incorporate Bayesian ar(1) (or more generally, Bayesian regression) in joint estimation by using &lt;code&gt;designmatrix = &quot;ar(1)&quot;&lt;/code&gt; as an argument to &lt;code&gt;svsample&lt;/code&gt;. It's not well documented yet (except in the help files), but I nevertheless hope easy to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the help file of &lt;code&gt;svsample&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;## Another example, this time with an AR(1) structure for the mean&#xA;## Not run: &#xA;data(exrates)&#xA;y &amp;lt;- exrates$USD&#xA;&#xA;## Fit AR(1)-SV model to EUR-USD exchange rates&#xA;res &amp;lt;- svsample(y, designmatrix = &quot;ar1&quot;)&#xA;&#xA;## Use predict.svdraws to obtain predictive volatilities&#xA;ahead &amp;lt;- 100&#xA;predvol &amp;lt;- predict(res, steps = ahead)&#xA;&#xA;## Use arpredict to obtain draws from the posterior predictive&#xA;preddraws &amp;lt;- arpredict(res, predvol)&#xA;&#xA;## Calculate predictive quantiles&#xA;predquants &amp;lt;- apply(preddraws, 2, quantile, c(.1, .5, .9))&#xA;&#xA;## Visualize&#xA;ts.plot(y, xlim = c(length(y) - ahead, length(y) + ahead),&#xA;    ylim = range(predquants))&#xA;for (i in 1:3) {&#xA; lines((length(y) + 1):(length(y) + ahead), predquants[i,],&#xA;       col = 3, lty = i &#xA;}&#xA;&#xA;## End(Not run)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Please let me know if you find any glitches!&lt;/p&gt;&#xA;" OwnerUserId="17867" LastActivityDate="2015-10-14T07:44:11.070" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21210" PostTypeId="1" CreationDate="2015-10-14T08:50:23.280" Score="7" ViewCount="3096" Body="&lt;p&gt;I'm trying to replicate the &lt;strong&gt;annualized&lt;/strong&gt; Sharpe ratio of an buy-and-hold strategy for the Dow Jones Industrial Average index for a period consisting of multiple years. I got the daily DJIA (closing) price index (variable: &quot;price&quot;) and the risk-free rate (given in a year percentage, variable: &quot;rf&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The procedure I follow:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Compute daily log returns, by: &lt;code&gt;log_returns = log(1+(price(t)/price(t-1)-1))&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Compute daily log risk-free rates, by: &lt;code&gt;log_rf = log(1+(rf/100))/252&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Compute daily excess returns, by: &lt;code&gt;excess_returns = log_returns-log_rf&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Compute daily Sharpe ratio, by: &lt;code&gt;daily_sharpe = mean(excess_returns)/std(excess_returns)&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Compute annualized Sharpe ratio, by: &lt;code&gt;annualized_sharpe = sqrt(252)*daily_sharpe&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;However the annualized Sharpe ratio doesn't correspond to the reported numbers. Am I missing a step/doing something wrong (with the logs?)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The calculation used by the paper (Bajgrowicz &amp;amp; Scaillet, December 2012):&#xA;&lt;a href=&quot;https://i.stack.imgur.com/zbhRs.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/zbhRs.png&quot; alt=&quot;Sharpe ratio calculation&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17869" LastEditorUserId="17869" LastEditDate="2015-10-14T20:30:13.313" LastActivityDate="2015-10-14T20:30:13.313" Title="Annualized Sharpe Ratio calculation" Tags="&lt;returns&gt;&lt;sharpe-ratio&gt;&lt;standard-deviation&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="21211" PostTypeId="2" ParentId="21207" CreationDate="2015-10-14T08:58:08.933" Score="3" Body="&lt;p&gt;You can download the company list csvs from &lt;a href=&quot;http://www.nasdaq.com/screening/company-list.aspx&quot; rel=&quot;nofollow&quot;&gt;nasdaq.com&lt;/a&gt;, it has the mapping you need.&lt;/p&gt;&#xA;" OwnerUserId="16351" LastActivityDate="2015-10-14T08:58:08.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21212" PostTypeId="1" AcceptedAnswerId="21218" CreationDate="2015-10-14T09:33:12.240" Score="3" ViewCount="370" Body="&lt;p&gt;I'm going through the following note by Davis, &lt;a href=&quot;http://www.google.ch/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0CB0QFjAAahUKEwj_z4m80cHIAhWKXSwKHYRNDnU&amp;amp;url=http%3A%2F%2Fwwwf.imperial.ac.uk%2F~mdavis%2Fcourse_material%2FMOP%2FMOP_NOTES.PDF&amp;amp;usg=AFQjCNHuMHZnbrOwc-XKoi-JrhDdmuL60A&amp;amp;bvm=bv.104819420,d.bGg&quot; rel=&quot;nofollow&quot;&gt;link&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In chapter 3 he derives the &lt;code&gt;Magrabe&lt;/code&gt; formula. I got stuck at equation $(3.16)$. &#xA;We have two assets:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dS_i(t)=S_i(t)\sigma_idw_i(t)$$&#xA;for $i\in\{1,2\}$ and $d\langle w_1,w_2\rangle_t = \rho dt$. The payoff we are interested in is the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C(0,s_1,s_2)=E[\max{(S_1(T)-S_2(T),0)}]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea is to perform a change of measure, using $S_2(T)$ as numéraire. We end with a new measure $\tilde{P}$ with&#xA;$$d\tilde{w}_2=dw_2-\sigma_2dt$$&#xA;and&#xA;$$d\tilde{w}_1=dw_1-\rho\sigma_2dt$$&#xA;both brownian motion under $\tilde{P}$. Defining $Y:=\frac{S_1}{S_2}$ one can show that: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dY=Y(\sigma_1d\tilde{w}_1-\sigma_2d\tilde{w}_2)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The authors claims that this can be writen as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dY=Y\sigma dw\tag{3.16}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $w$ is a standard brownian motion and $\sigma = \sqrt{\sigma^2_1+\sigma^2_1-2\sigma_1\sigma_2\rho}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do we get $(3.16)$ and the brownian motion $w$, especially under which measure?&lt;/p&gt;&#xA;" OwnerUserId="17133" LastEditorUserId="743" LastEditDate="2015-10-14T16:28:18.917" LastActivityDate="2015-10-14T16:28:18.917" Title="Derivation of Magrabe formula" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;mathematics&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21214" PostTypeId="2" ParentId="21210" CreationDate="2015-10-14T09:49:24.860" Score="2" Body="&lt;p&gt;This is how people usually approach calculating SR with logreturns:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quantmod)&#xA;getSymbols('DJIA', src='yahoo', from = '2009-01-01')&#xA;price &amp;lt;- Cl(DJIA)&#xA;log_ret &amp;lt;- log(price/lag(price,1))&#xA;mean_log_ret &amp;lt;- mean(log_ret, na.rm=T)&#xA;sd_log_ret &amp;lt;- sd(log_ret, na.rm=T)&#xA;rf &amp;lt;- 0.0025 # benchmark&#xA;SR &amp;lt;- (252 * mean_log_ret - log(1+rf))/(sd_log_ret*sqrt(252))&#xA;SR&#xA;&#xA;[1] 0.5565204&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE. SR with geometrically compounding returns:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;g_ret &amp;lt;- (price/lag(price,1) - 1)[-1]&#xA;n_periods &amp;lt;- length(g_ret)&#xA;avg_g_ret &amp;lt;- prod(1 + coredata(g_ret)) ^ (1/n_periods)&#xA;annual_g_return &amp;lt;- avg_g_ret^252 - 1&#xA;annual_sd_g_return &amp;lt;- sd(g_ret) * sqrt(252)&#xA;SR &amp;lt;- (annual_g_return - rf)/annual_sd_g_return&#xA;SR&#xA;&#xA;[1] 0.5844989&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13718" LastEditorUserId="13718" LastEditDate="2015-10-14T19:51:16.633" LastActivityDate="2015-10-14T19:51:16.633" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="21215" PostTypeId="1" CreationDate="2015-10-14T11:54:38.663" Score="13" ViewCount="1218" Body="&lt;p&gt;The code given below estimates a VEC model with 4 cointegrating vectors. It is a reproducible code, so just copy and paste into your R console (or script editor).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;nobs = 200&#xA;e = rmvnorm(n=nobs,sigma=diag(c(.5,.5,.5,.5,.5)))&#xA;e1.ar1 = arima.sim(model=list(ar=.75),nobs,innov=e[,1])&#xA;e2.ar1 = arima.sim(model=list(ar=.75),nobs,innov=e[,2])&#xA;e3.ar1 = arima.sim(model=list(ar=.75),nobs,innov=e[,3])&#xA;e4.ar1 = arima.sim(model=list(ar=.75),nobs,innov=e[,4])&#xA;y5 = cumsum(e[,5])&#xA;y1 = y5 + e1.ar1&#xA;y2 = y5 + e2.ar1&#xA;y3 = y5 + e3.ar1&#xA;y4 = y5 + e4.ar1&#xA;data = cbind(y1,y2,y3,y4,y5)&#xA;&#xA;jcointt = ca.jo(data,ecdet=&quot;const&quot;,type=&quot;trace&quot;,K=2,spec=&quot;transitory&quot;)&#xA;summary(jcointt)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I went ahead with four cointegrating vectors and estimated a VECM: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;vecm &amp;lt;- cajorls(jcointt,r=4)&#xA;summary(vecm$rlm)&#xA;print(vecm)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here are the estimated cointegrating vectors:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$beta&#xA;&#xA;           ect1    ect2    ect3    ect4&#xA;y1.l1       1        0       0      0&#xA;y2.l1       0        1       0      0&#xA;y3.l1       0        0       1      0&#xA;y4.l1       0        0       0      1&#xA;y5.l1      -1.07    -1.05   -0.985 -1.05&#xA;constant   -0.16    0.505   -0.05   0.116&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, I would like to impose restrictions on the first cointegrating vector (on &lt;code&gt;ect1&lt;/code&gt; parameters) so that I can analyse the long run relationship between the variables. Here is what I want to obtain after imposing and reparameterising the cointegrating vectors:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;            ect1   ect2  ect3   ect4&#xA;y1.l1        1      0      0     0&#xA;y2.l1      b1.1     1      0     0&#xA;y3.l1      b2.1     0      1     0&#xA;y4.l1      b3.1     0      0     1&#xA;y5.l1      b4.1    b4.2   b4.3   b4.4&#xA;constant   b0.1    b0.2   b0.3   b0.4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;here, b1.1 through to b0.1 are the coefficients ($\beta_1,\beta_2,\beta_3,\beta_4$) of the first cointegrating vector labelled as &lt;code&gt;ect1&lt;/code&gt;, which could now be written as $y_{1,t-1}=\beta_0-\beta_1y_{2,t-1}-\beta_2y_{3,t-1}-\beta_3y_{4,t-1}-\beta_4y_{5,t-1}$. Similarly, b4.2 and b0.2 are coefficients of the second cointegrating equation etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering if you could help proceed further in imposing the restrictions and re-estimating the VECM with the restrictions. &lt;code&gt;urca&lt;/code&gt; package has a &lt;code&gt;bltest()&lt;/code&gt;, &lt;code&gt;bh6lrtest()&lt;/code&gt;, and &lt;code&gt;bh5lrtest()&lt;/code&gt; functions to test restrictions on cointegrating vectors, though, I need some guidance on how to construct my &lt;code&gt;H&lt;/code&gt; matrix (restrictions matrix) Thanks.&lt;/p&gt;&#xA;" OwnerUserId="17873" LastEditorUserId="17873" LastEditDate="2015-10-17T20:29:37.230" LastActivityDate="2018-06-01T11:09:48.150" Title="Imposing Restrictions on Cointegrating Vectors, R example" Tags="&lt;time-series&gt;&lt;r&gt;&lt;var&gt;&lt;cointegration&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21216" PostTypeId="2" ParentId="9982" CreationDate="2015-10-14T13:29:58.920" Score="1" Body="&lt;p&gt;If you want a simple example which you can easily reproduce in a spreadsheet, look at section 3 of the paper &quot;Adjoints and automatic (algorithmic) differentiation in computational finance by Christian Homescu. Table 1 is wrong though but you should be able to generate the same numbers using all 4 methods&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Finite Difference&#xA;2) Complex Step&#xA;3) Tangent Linear&#xA;4) Adjoint&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good Luck !&lt;/p&gt;&#xA;" OwnerUserId="17874" LastActivityDate="2015-10-14T13:29:58.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21217" PostTypeId="1" CreationDate="2015-10-14T14:38:02.877" Score="1" ViewCount="173" Body="&lt;p&gt;I'm studying by myself how to model interest rates. Is there any database in which I can find accurate data for indices like &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Libor, &lt;/li&gt;&#xA;&lt;li&gt;Euribor, &lt;/li&gt;&#xA;&lt;li&gt;Eonia &lt;/li&gt;&#xA;&lt;li&gt;etc? &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="16045" LastEditorUserId="743" LastEditDate="2015-10-14T16:27:54.227" LastActivityDate="2017-11-16T18:49:52.950" Title="Interest rate models" Tags="&lt;interest-rates&gt;&lt;data&gt;&lt;market-data&gt;&lt;historical-data&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21218" PostTypeId="2" ParentId="21212" CreationDate="2015-10-14T16:00:03.713" Score="2" Body="&lt;p&gt;Let &#xA;\begin{align*}&#xA;w_t = \frac{1}{\sqrt{\sigma_1^2+\sigma_2^2 -2\sigma_1\sigma_2 \rho}}(\sigma_1\tilde{w}_t^1-\sigma_2\tilde{w}_t^2).&#xA;\end{align*}&#xA;Then, using Levy's characterization, we can show that $\{w_t \mid t \geq 0\}$ is a standard Brownian motion.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-10-14T16:00:03.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21219" PostTypeId="2" ParentId="21210" CreationDate="2015-10-14T16:04:06.853" Score="2" Body="&lt;p&gt;Another way to skin cat:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    # risk-free = 0&#xA;require(quantmod)&#xA;require( PerformanceAnalytics)&#xA;getSymbols('DJIA', src='yahoo', from = '2009-01-01', to ='2014-12-31')&#xA;price       &amp;lt;- Cl(DJIA)&#xA;simple.ret  &amp;lt;- price/lag(price)-1&#xA;table.AnnualizedReturns(simple.ret,Rf=0)[3,]&#xA;# [1] 0.7267&#xA;&#xA;log.ret &amp;lt;- na.omit(ROC(price))&#xA;SD &amp;lt;- sd(log.ret)*sqrt(252)&#xA;R &amp;lt;- exp(mean(log.ret)*252)-1&#xA;SR &amp;lt;- R/SD&#xA;SR &#xA;# [1] 0.7263711&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="17875" LastActivityDate="2015-10-14T16:04:06.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21220" PostTypeId="1" CreationDate="2015-10-14T17:16:52.257" Score="1" ViewCount="440" Body="&lt;p&gt;In practice, when one takes on a large equity ETF position, I would imagine it's not necessarily &quot;optimal&quot; to hedge using a basket of all the constituents even though that should be a perfect hedge. What's the common approach to picking an optimal hedge basket given constraints on its size?&lt;/p&gt;&#xA;" OwnerUserId="1456" LastActivityDate="2015-10-15T15:48:41.630" Title="How to hedge an ETF position with a basket of its underlying components" Tags="&lt;optimization&gt;&lt;hedging&gt;&lt;etf&gt;" AnswerCount="0" CommentCount="11" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21221" PostTypeId="2" ParentId="21183" CreationDate="2015-10-14T21:25:01.363" Score="0" Body="&lt;p&gt;Following the CAPM, which is theteoretical base of beta, the beta of small and large stocks is calulated the same way. In accordance to the CAPM theory the beta of a stock should be constant over time and the risk free rate should be positive. In practice however, beta is not constant and the risk free rate may not be always postive in certain market condisitons. This is why in practice &lt;a href=&quot;http://www.quantinvestor.net/viewtopic.php?f=15&amp;amp;t=109&quot; rel=&quot;nofollow&quot;&gt;there exist some degrees of freedom to calculate the beta&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Further, as a result of distrust in the CAPM model, the empirical beta is often mixed with 1.&lt;/p&gt;&#xA;" OwnerUserId="17434" LastActivityDate="2015-10-14T21:25:01.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21222" PostTypeId="2" ParentId="21187" CreationDate="2015-10-14T22:01:21.143" Score="2" Body="&lt;p&gt;In the Black-Scholes model the price of a binary option is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;B = e^{-r(T-t)}N(d_2)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;d_2 = \frac{\log(\frac{S}{K})-\frac12 \sigma^2 (T-t)}{\sigma\sqrt{T-t}}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Differentiation with respect to $\sigma$ gives our our volatility risk, or &lt;em&gt;vega&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{\partial B}{\partial\sigma} = e^{-r(T-t)} N^\prime(d_2)\frac{d_2+\sigma\sqrt{T-t}}{\sigma}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, if we happen to have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;d_2 = -\sigma\sqrt{T-t}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or equivalently&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;S = Ke^{-\frac12 \sigma^2(T-t)}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the apparent risk is zero.  Of course the instant any of these parameters, especially $\sigma$ or $S$, changes you will find yourself with considerable volatility risk.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2015-10-14T22:01:21.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21223" PostTypeId="1" AcceptedAnswerId="21227" CreationDate="2015-10-15T02:10:16.100" Score="2" ViewCount="225" Body="&lt;p&gt;&lt;a href=&quot;http://eu.wiley.com/WileyCDA/WileyTitle/productCd-0470481803.html&quot; rel=&quot;nofollow&quot;&gt;Malz&lt;/a&gt; explains that marking to model can underestimate liquidity risk. From his example, I don't see it. I can see us underestimating market risk because we are using an incorrect price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Why does a divergence between the market and model prices cause liquidity risk ?&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Another example is convertible bond trading. Convertible bonds can be&#xA;  mapped to a set of risk factors including implied volatilities,&#xA;  interest rates, and credit spreads. Such mappings are based on the&#xA;  theoretical price of a convertible bond, which is arrived at using its&#xA;  replicating portfolio. However, theoretical and market prices of&#xA;  converts can diverge dramatically. &lt;strong&gt;These divergences are liquidity&#xA;  risk events that are hard to capture with market data, so VaR based on&#xA;  the replicating portfolio alone can drastically understate risk&lt;/strong&gt;.&#xA;  Stress testing can mitigate the problem.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="9265" LastEditDate="2015-10-16T13:17:14.133" LastActivityDate="2015-10-17T06:55:28.253" Title="How are we underestimating liquidity risk?" Tags="&lt;risk&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21224" PostTypeId="1" CreationDate="2015-10-15T02:27:15.300" Score="1" ViewCount="25" Body="&lt;p&gt;I am looking for a database that provides me the quarterly (annualized) real GDP growth (quarter t and t-1) of US, Germany and England.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the US data i went here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.philadelphiafed.org/research-and-data/real-time-center/real-time-data/data-files/routput&quot; rel=&quot;nofollow&quot;&gt;https://www.philadelphiafed.org/research-and-data/real-time-center/real-time-data/data-files/routput&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is the first file: &quot;&lt;strong&gt;Vintages 1965:Q4 to present&lt;/strong&gt;&quot; ??&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Germany and England i couldn't find.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="17678" LastActivityDate="2015-10-15T02:27:15.300" Title="Sample data of quarterly (annualized) real GDP growth" Tags="&lt;data&gt;&lt;market-data&gt;&lt;macro-economics&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21225" PostTypeId="1" CreationDate="2015-10-15T04:05:40.477" Score="2" ViewCount="37" Body="&lt;p&gt;I've read about this before on their website directly and via this ITG paper. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.nasdaqtrader.com/content/productsservices/trading/crosses/openclose_faqs.pdf&quot; rel=&quot;nofollow&quot;&gt;nasdaq site&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.itg.com/wp-content/uploads/2009/11/MOOandMOC_11_6_09.pdf&quot; rel=&quot;nofollow&quot;&gt;itg paper&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I was wondering if there are any other good references I can supplement my understanding with? For example, I'm not sure I understand what the risk less arbitrage would be if the reference price were not in line with the near price near the end. Isn't this impossible based on their definition? Or just from the fact that the reference price is constrained to be within the BBO? &lt;/p&gt;&#xA;" OwnerUserId="1456" LastActivityDate="2015-10-15T04:05:40.477" Title="Helpful references for fully understanding the mechanics of NASDAQ's auction system?" Tags="&lt;equities&gt;&lt;arbitrage&gt;&lt;nasdaq&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21227" PostTypeId="2" ParentId="21223" CreationDate="2015-10-15T10:06:45.580" Score="2" Body="&lt;p&gt;In order for the risks of a presumably &quot;correct&quot; model to realize in practice, there should be enough liquidity in the market. This is what he is referring to when saying&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;[...] liquidity risk events that are hard to capture with market data, so VaR based on the replicating portfolio alone can drastically understate risk&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The problem with many models is the fact that when your model raises red flag, there are thousands of similar models at others' traders, that raise red flags too. Too many people rushing to the exit at the same time, no liquidity at all. This is called &lt;a href=&quot;https://en.wikipedia.org/wiki/Liquidity_risk&quot; rel=&quot;nofollow&quot;&gt;Liquidity risk&lt;/a&gt; (or lack thereof): [in]ability to quickly liquidate your position without significant loss (or at preconceived price, if you wish).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe Taleb in his &quot;Fooled by Randomness&quot; discussed this issue (and issues with VaR) in detail.&lt;/p&gt;&#xA;" OwnerUserId="13718" LastEditorUserId="13718" LastEditDate="2015-10-15T10:20:58.487" LastActivityDate="2015-10-15T10:20:58.487" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="21232" PostTypeId="1" CreationDate="2015-10-15T17:08:28.557" Score="1" ViewCount="103" Body="&lt;p&gt;I have multiple quarterly time series data and trying to build a linear regression model using this dataset. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Should the transformations on the LHS and RHS be the same i.e QoQ percent changes?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Could we have Qi/Qi-4 percentage changes on the independent variables to predict QoQ (Qi/Qi-1) changes in response variable? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If yes, is there any literature or book that illustrates or refutes this fact.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="17888" LastEditorUserId="743" LastEditDate="2015-10-15T19:26:42.687" LastActivityDate="2015-10-16T13:05:28.207" Title="Transforming Variables in time series regression" Tags="&lt;time-series&gt;&lt;regression&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21233" PostTypeId="1" CreationDate="2015-10-15T19:18:21.867" Score="2" ViewCount="189" Body="&lt;p&gt;Can someone please suggest me a method to programatically identify trending/consolidating market condition by reading ohlc data?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I'm thinking of checking the current price within last n number of candles to check if the same price can be observed multiple times before.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any other suggestions would be highly appreciated!&lt;/p&gt;&#xA;" OwnerUserId="17890" LastActivityDate="2015-10-15T23:12:14.407" Title="How to distinguish trending/consolidating market conditions programatically?" Tags="&lt;fx&gt;&lt;price&gt;&lt;trends&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21234" PostTypeId="2" ParentId="19338" CreationDate="2015-10-15T19:26:12.460" Score="3" Body="&lt;p&gt;You can look at Bergomi's variance curve model (see his Smile Dynamics articles). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another interesting article is Bergomi and Guyon's smile in stochastic volatility model where they give a very nice second order expansion of the smile in vol of vol that is valid in all stochastic volatility models. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note there is no point in using a stochastic volatility model to price vanilla options. All you need to do is interpolate a volatility surface. So what you are comparing by looking at vanilla options is actually the quality of your calibration. If you want to see the differences between stoch vol models, you should price path dependant options (forward start options in particular).     &lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2015-10-15T19:26:12.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21235" PostTypeId="2" ParentId="21233" CreationDate="2015-10-15T23:12:14.407" Score="1" Body="&lt;p&gt;To start, it very much depends on your outlook. Do you believe that the future price movement is independent of previous price movement? If so you probably wouldn't look for trending or consolidating markets (it would be entirely random). On the other hand, maybe you have a fractal view of the market (search for fractional Brownian motion, regime switching models, ect.) where you think there is some deterministic or perhaps autocorrelated aspect to the price series of the asset. No one can say with certainty (although some statistical studies have indicated certain structural aspects). Really you should ask what you are trying to do with this information. Is it relevant? What time scales are you looking at? One technique that you could try that I like to look at is as follows: take the time series $X_t$ where $t\in\mathbb{N}$. I then define $\mu(t)$ such that $\mu(t)=0$ if $X_t&amp;lt;X_{t-1}$ and $\mu(t)=1$ if $X_t\ge X_{t-1}$. Doing this for some finite run you will get a series of 0s and 1s. Try computing the Shannon entropy or approximate entropy. You may find some interesting results. Long runs of 0s and 1s may indicate trends. However, for your purposes it may be best to see if there is anything interesting happening before a trend begins.&lt;/p&gt;&#xA;" OwnerUserId="15832" LastActivityDate="2015-10-15T23:12:14.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21236" PostTypeId="1" CreationDate="2015-10-16T05:12:24.783" Score="6" ViewCount="612" Body="&lt;p&gt;Assume I have a &quot;complex&quot; options position like a straddle, strangle, or iron condor. In other words, several options traded together as a single position against &lt;strong&gt;one&lt;/strong&gt; underlying asset (not a basket option).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know the implied volatility of each of the options within the position. Is there an accepted method of generating an implied volatility for the overall position?&lt;/p&gt;&#xA;" OwnerUserId="1112" LastActivityDate="2020-10-22T14:12:45.260" Title="Implied volatility of a complex options position" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;option-strategies&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21237" PostTypeId="2" ParentId="21153" CreationDate="2015-10-16T06:11:08.423" Score="2" Body="&lt;p&gt;yahoo finance has a large set of historical data. it's available for free. There are a few libraries, to retrieve the data&lt;/p&gt;&#xA;" OwnerUserId="17897" LastActivityDate="2015-10-16T06:11:08.423" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21238" PostTypeId="1" AcceptedAnswerId="21434" CreationDate="2015-10-16T06:48:02.590" Score="-1" ViewCount="139" Body="&lt;p&gt;I am starting a project to implement the Black-Merton-Scholes model from this &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470080183&quot; rel=&quot;nofollow&quot;&gt;book&lt;/a&gt; in R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I am looking for, ideally free, data sources. Still I have access to a Bloomberg terminal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you recommend data sources, which can be used for a project like that?&lt;/p&gt;&#xA;" OwnerUserId="5414" LastEditorUserId="467" LastEditDate="2015-10-26T05:58:35.570" LastActivityDate="2015-10-26T05:58:35.570" Title="Where can I find data source for structural models?" Tags="&lt;risk&gt;&lt;data&gt;&lt;risk-management&gt;&lt;models&gt;&lt;credit-risk&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21239" PostTypeId="2" ParentId="21236" CreationDate="2015-10-16T09:57:17.577" Score="4" Body="&lt;p&gt;First note that implied volatility only makes sense with respect to an etablished pricing model, like the Black-Scholes or Bachelier model, and it is the quantity which has to be put into a closed form pricing formula obtained in one of those models to get the market dollar price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a straddle with strike $ K $ holds&#xA;$$ \text{Price_Straddle}(K)  = \text{Price_Call}(K) + \text{Price_Put}(K) \\&#xA;= 2\text{Price_Call}(K) - \text{UnderlyingPrice} + K,$$&#xA;due to the Put-Call parity. So the implied vola of a straddle equals the implied vola of a call.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To my knowledge, for strangles such a formula does not exists the same as for iron condors.&lt;/p&gt;&#xA;" OwnerUserId="6640" LastActivityDate="2015-10-16T09:57:17.577" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21240" PostTypeId="1" AcceptedAnswerId="21266" CreationDate="2015-10-16T10:33:14.240" Score="4" ViewCount="6930" Body="&lt;p&gt;I am confused by a particular exercise I am doing right now, I am hopeful that someone can walk me through as to how to solve it. I further hope the question is not considered too basic for this forum.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Build a 15-period binomial model whose parameters should be calibrated to a Black-Scholes geometric Brownian motion model with: T=.25 years, S0=100, r=2%, σ=30% and a dividend yield of c=1%. Compute the fair value of an American call option with strike K=110 and maturity n=10 periods where the option is written on a futures contract that expires after 15 periods. The futures contract is on the same underlying security as described in the previous questions. What is the earliest time period in which you might want to exercise the American?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what I would normally do to compute the value is to build a lattice and then work backwards in order to see what the value is. Yet the part with &quot;where the option is written on a futures contract that expires after 15 periods&quot;, leaves me awfully confused as to what I should be doing as well as what implications that has for the exercise. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for any feedback!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[at this point I found the solution, big thanks to all the contributors, I deleted the lattices in order not to misguide anyone as they clearly did produce the wrong result]&lt;/p&gt;&#xA;" OwnerUserId="17688" LastEditorUserId="17688" LastEditDate="2015-11-11T10:58:15.330" LastActivityDate="2016-06-02T09:02:43.623" Title="Options pricing exercise - American call option on a futures contract" Tags="&lt;options&gt;&lt;futures&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21241" PostTypeId="1" CreationDate="2015-10-16T11:02:41.690" Score="4" ViewCount="222" Body="&lt;p&gt;I'm interested in HFT cointegration stratagies, and recently found interesting article &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2637883&quot; rel=&quot;nofollow&quot;&gt;&quot;Algorithmic Trading of Co-Integrated Assets&quot;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The article describes mean-reversion strategy for N-assets. Authours build the model which suggests optimal inventory at each moment in time based on regression estimates and their derivatives. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I reproduced the model in matlab and it suggests fractions of assets as optimal inventory. However I am trading on futures market, and it is only allowed to trade with integer amount of contracts. What is the best practice to round fractional number of futures for real HFT trading (simply multiply by 10 is too expensive)?&lt;/p&gt;&#xA;" OwnerUserId="7339" LastEditorUserId="7339" LastEditDate="2015-10-16T11:27:50.173" LastActivityDate="2015-10-16T11:27:50.173" Title="Assets cointegration: optimal inventory for futures market" Tags="&lt;quant-trading-strategies&gt;&lt;futures&gt;&lt;high-frequency&gt;&lt;cointegration&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21243" PostTypeId="1" CreationDate="2015-10-16T13:43:46.610" Score="1" ViewCount="69" Body="&lt;p&gt;I am looking for some examples or attempts of using simultaneous stochastic differential equations for financial analysis but there has been none so far.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it just so nasty to apply such thing in modeling or is just me that cannot find any related documents?&lt;/p&gt;&#xA;" OwnerUserId="17849" LastActivityDate="2015-10-16T13:43:46.610" Title="Is there anyone tried to use simultaneous stochastic differential equations?" Tags="&lt;stochastic-calculus&gt;&lt;modeling&gt;&lt;pricing&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21244" PostTypeId="1" AcceptedAnswerId="21249" CreationDate="2015-10-16T14:48:01.907" Score="2" ViewCount="462" Body="&lt;p&gt;For Canadian banks, the CDS market is very illiquid and inactively traded. I want to get an estimate for the spread for a one year CDS on the Bank of Montreal. I was going to estimate this using the CreditGrades model ( &lt;a href=&quot;http://www.creditrisk.ru/publications/files_attached/cgtechdoc.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.creditrisk.ru/publications/files_attached/cgtechdoc.pdf&lt;/a&gt; ). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, they mention that some algorithms (debt per share) may not hold for financial firms. Can CreditGrades be adapted to work for financial firms? Does it even make sense to get a spread estimate in this way? My goal is to find the one year survival probability for BMO. &lt;/p&gt;&#xA;" OwnerUserId="17712" LastActivityDate="2016-07-11T17:50:39.777" Title="Can CreditGrades CDS Pricing Model be used for financial firms?" Tags="&lt;credit-risk&gt;&lt;cds&gt;&lt;default-risk&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21245" PostTypeId="1" AcceptedAnswerId="43901" CreationDate="2015-10-16T14:50:33.130" Score="9" ViewCount="679" Body="&lt;p&gt;With respect to the answer by user AFK&#xA; in &lt;a href=&quot;https://quant.stackexchange.com/questions/19338/ideas-about-stochastic-volatility-models&quot;&gt;Ideas about Stochastic volatility models&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am specifically interested in interest rate options (IR Caps/Floors and Swaptions).&lt;/p&gt;&#xA;" OwnerUserId="17901" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2019-02-05T16:51:40.870" Title="Why is it useless to model stochastic volatility when pricing Vanilla style derivatives?" Tags="&lt;interest-rates&gt;&lt;stochastic-processes&gt;&lt;stochastic-volatility&gt;&lt;finance-mathematics&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21249" PostTypeId="2" ParentId="21244" CreationDate="2015-10-16T18:04:51.290" Score="1" Body="&lt;p&gt;The capital structure of financial firms, especially one like Bank of Montreal, is indeed quite unlike the simple debts-and-assets model of CreditGrades.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For context, the model is basically one that says there are some assets $A$ subject to a stochastic process, and a debt level $L$ (unknown at the present time).  If ever $A&amp;lt;L$ the company defaults.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They provide some calibration techniques and so on to make all of this work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In any case, the picture of assets, where their value but not character varies, is completely wrong for a bank.  The debt also is in flux.  Thus, the model is essentially worthless.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I personally would price CDS for a big bank almost any other way.  My top consideration would be government bailout probability should they get in trouble.  For BMo, I rate that probability quite close to 1.0.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2015-10-16T18:04:51.290" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21250" PostTypeId="1" CreationDate="2015-10-16T19:12:22.667" Score="4" ViewCount="723" Body="&lt;p&gt;I've written some code for the explicit finite difference method to solve the BS equation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For certain sets of parameters (time-steps and asset-steps) I get a stable but wrong solution. For others, I get everything diverging to nonsense. I can't spot any errors in my implementation. Can you?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import numpy as np&#xA;import matplotlib.pyplot as plt&#xA;&#xA;&#xA;def A(vol, asset_step, risk_free_rate, dividend_rate, time_step):&#xA;    return 0.5*time_step*(vol**2*asset_step**2 - (risk_free_rate - dividend_rate)*asset_step)&#xA;&#xA;def B(vol, asset_step, risk_free_rate, time_step):&#xA;    return 1 - time_step*(vol**2*asset_step**2 + risk_free_rate)&#xA;&#xA;def C(vol, asset_step, risk_free_rate, dividend_rate, time_step):&#xA;    return 0.5*time_step*(vol**2*asset_step**2 + (risk_free_rate - dividend_rate)*asset_step)&#xA;&#xA;def call_payoff(asset_price, strike_price):&#xA;    return max(asset_price - strike_price, 0)&#xA;&#xA;S_max          = 140.&#xA;strike         = 100.&#xA;expiry         = 2.&#xA;asset_step     = 1&#xA;risk_free_rate = 0.05&#xA;dividend_rate  = 0.0&#xA;vol            = 0.2&#xA;t_step         = 0.001&#xA;&#xA;no_asset_steps = int(S_max/asset_step)&#xA;print &quot;Number of asset steps: &quot;, no_asset_steps&#xA;&#xA;no_time_steps = int(expiry/t_step)&#xA;print &quot;Number of time steps: &quot;, no_time_steps&#xA;&#xA;S = np.zeros(no_asset_steps+1)&#xA;V = np.zeros((no_asset_steps+1, no_time_steps+1))&#xA;&#xA;for i in xrange(no_asset_steps+1):&#xA;    S[i] = i*asset_step&#xA;    V[i,no_time_steps] = call_payoff(S[i], strike)&#xA;&#xA;for k in range(no_time_steps, 0, -1):&#xA;    for i in xrange(1,no_asset_steps):&#xA;        A_co = A(vol, i, risk_free_rate, dividend_rate, t_step)&#xA;        B_co = B(vol, i, risk_free_rate, t_step)&#xA;        C_co = C(vol, i, risk_free_rate, dividend_rate, t_step)&#xA;        V[i, k-1] = A_co*V[i-1, k] + B_co*V[i,k] + C_co*V[i+1,k]&#xA;&#xA;    V[0, k-1] = 0&#xA;    V[no_asset_steps, k-1] = 2*V[no_asset_steps-1, k-1] - V[no_asset_steps-2, k-1]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="17903" LastActivityDate="2015-10-16T19:12:22.667" Title="Black-Scholes explicit Euler implementation python" Tags="&lt;black-scholes&gt;&lt;python&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21251" PostTypeId="1" AcceptedAnswerId="27535" CreationDate="2015-10-16T20:32:43.323" Score="0" ViewCount="629" Body="&lt;p&gt;I have an equity statarb strategy developed using &lt;code&gt;CRSP&lt;/code&gt; daily data. The strategy is always invested (long or short) in around 400 stocks. The &lt;code&gt;CRSP&lt;/code&gt; dataset has &lt;code&gt;CFACSHR&lt;/code&gt; and &lt;code&gt;CFACPR&lt;/code&gt; factors used to adjust the raw historical price and share information for splits, dividends, and other corporate actions like spin offs, rights, etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am now working on the nuts and bolts of implementing this strategy using a Bloomberg data license for historical data and daily updates. I can use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;EQY_DVD_SPL_SPLIT_RATIO_NEXT&#xA;&#xA;EQY_DVD_SPL_EX_DT_NEXT&#xA;&#xA;EQY_DVD_CASH_EX_DT_NEXT &#xA;&#xA;EQY_DVD_CASH_NET_NEXT&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To find the sizes and dates of upcoming splits and dividends, but I don't have a way of looking up other upcoming corporate events. I would like to know how others have dealt with upcoming corporate events.&lt;/p&gt;&#xA;" OwnerUserId="7769" LastEditorUserId="743" LastEditDate="2015-10-16T22:56:50.943" LastActivityDate="2016-06-09T23:41:55.263" Title="Handling upcoming corporate actions for equity portfolio" Tags="&lt;data&gt;&lt;bloomberg&gt;&lt;dividends&gt;&lt;corporate-actions&gt;&lt;split&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21252" PostTypeId="2" ParentId="21251" CreationDate="2015-10-16T21:19:11.200" Score="1" Body="&lt;p&gt;I don't think you'll find a Bloomberg &lt;code&gt;FLDS&lt;/code&gt; event to get all upcoming corporate actions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But using the terminal you can use &lt;code&gt;CACS&amp;lt;GO&amp;gt;&lt;/code&gt; to get a list of all upcoming corporate actions for a particular ticker.  I'm not sure if you can do the same whit an equity screen &lt;code&gt;EQS&lt;/code&gt;.   &lt;/p&gt;&#xA;" OwnerUserId="743" LastActivityDate="2015-10-16T21:19:11.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21254" PostTypeId="1" CreationDate="2015-10-16T21:59:39.130" Score="3" ViewCount="183" Body="&lt;p&gt;Floating points have rounding errors so algorithm to find eigenvalues may report tiny negative eigenvalues but in reality thsee could actually be 0 if we had full precision.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any way to tell ?  I have correlation matrix. Any way to pick cut off value ?&lt;/p&gt;&#xA;" OwnerUserId="6532" LastActivityDate="2015-10-17T02:30:10.333" Title="How to distinguish true negative eigenvalues from small negative eigenvalues due to floating point error?" Tags="&lt;correlation&gt;&lt;portfolio&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21255" PostTypeId="1" CreationDate="2015-10-16T22:58:51.197" Score="2" ViewCount="1107" Body="&lt;p&gt;I was asked whether Sharpe Ratio was a better measure than Cumulative Returns, in the context of hedge funds. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To me, personally, Sharpe Ratio is a more important measure. By definition, it tells us how much reward we are getting for each unit or risk we are taking. A portfolio that returns 10% that is extremely volatile, indicating a bigger standard deviation of daily returns, is not as favorable as a portfolio that returns 8% with low volatility (however this is purely an opinion). Cumulative returns just tell us how much the portfolio has improved over time, there is no context with regard to volatility. If you had to invest in a portfolio and you could only receive one measure of the portfolio, namely Sharpe Ratio or Cumulative returns, which would you choose as the more important metric and why? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was just wondering the community's thoughts before I respond back to this person. &lt;/p&gt;&#xA;" OwnerUserId="17906" LastActivityDate="2015-10-16T23:19:52.197" Title="Sharpe Ratio versus Cumulative Returns" Tags="&lt;returns&gt;&lt;sharpe-ratio&gt;&lt;behavioral-finance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21256" PostTypeId="2" ParentId="21151" CreationDate="2015-10-16T23:03:50.810" Score="0" Body="&lt;p&gt;No, there is no limit. You could have millions of bids and asks at the same price. Think about very liquid stocks, there are very many orders at the same price. &lt;/p&gt;&#xA;" OwnerUserId="17906" LastActivityDate="2015-10-16T23:03:50.810" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21257" PostTypeId="2" ParentId="21255" CreationDate="2015-10-16T23:19:52.197" Score="2" Body="&lt;p&gt;Your opinion is correct. There is simply more information about risk-reward encoded in the Sharpe ratio than cumulative returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other thing that's important to know is that whatever ratio you choose is simply a social construct or conventional benchmark that people use to compare between each other. The ratio is only useful insofar as other people are using the ratio in a standardized way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To that note, it's difficult to compare cumulative returns also partly because somehow people have more nonstandard ways of computing these. Are you talking about over the entire horizon of a portfolio's existence or arithmetically annualized? Is this a cumulative return on each 1M invested up to 500M or up to 1B? Is this over a 10 year period or a 3 month period?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another corollary of this is that there's fancier ratios (Sortino, Omega, Calmar etc.) - to which your client may ask, why aren't you using those? Well, these ratios are simply less often used by other trading participants, which make it difficult for you to make an apples-to-apples comparison. I could just as easily come up with an arbitrary Madilyn ratio that encodes more statistics than Sharpe but it would be useless because no one else uses it. &quot;I have a great strategy with a Madilyn ratio of 10830.28.&quot;&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2015-10-16T23:19:52.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21258" PostTypeId="1" CreationDate="2015-10-16T23:36:28.440" Score="2" ViewCount="56" Body="&lt;p&gt;Following the maximun likelihood estimation as done in   &lt;a href=&quot;http://dsp.vscht.cz/konference_matlab/MATLAB07/prispevky/kladivko_k/kladivko_k.pdf&quot; rel=&quot;nofollow&quot; title=&quot;a&quot;&gt;Klavidko&lt;/a&gt; I would like to generalize this to more independent  factors . In first istance I would use the transition function at time t as a sum of the non chi squared conditional distributions for each factor:&#xA;\begin{equation}&#xA;p_t = p_{1 t} +.. + p_{N t}&#xA;\end{equation}&#xA;then take the log of the product of all t times used in the data and optimize: &#xA;\begin{equation}&#xA;L = \sum_{t}log(p_t)&#xA;\end{equation}&#xA;On the other hand in the paper &lt;a href=&quot;https://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=5&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0CEcQFjAEahUKEwiI846Yj8jIAhXIpB4KHdg5AWU&amp;amp;url=http%3A%2F%2Fciteseerx.ist.psu.edu%2Fviewdoc%2Fdownload%3Fdoi%3D10.1.1.504.6833%26rep%3Drep1%26type%3Dpdf&amp;amp;usg=AFQjCNEqebJd0l270WdWh9BvDmpmzpg6XA%22%22&quot; rel=&quot;nofollow&quot;&gt;multi&lt;/a&gt; they just optimize the sum of each log product &#xA;\begin{equation}&#xA;L = \sum_{t,i}log(p_{i t})&#xA;\end{equation}&#xA;Which one is correct?&#xA;Thanks&lt;/p&gt;&#xA;" OwnerUserId="17254" LastEditorUserId="17254" LastEditDate="2015-10-19T22:56:31.113" LastActivityDate="2015-10-19T22:56:31.113" Title="MLE for two independent factor CIR" Tags="&lt;interest-rates&gt;&lt;vasicek&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21259" PostTypeId="2" ParentId="21254" CreationDate="2015-10-17T02:30:10.333" Score="2" Body="&lt;p&gt;I know of two procedures to &quot;fix&quot; a correlation matrix which has negative eigenvalues as a result of rounding error. One is by Higham &quot;Computing the nearest correlation matrix, a problem in finance&quot;, which is implemented in the R package nearPD. The other is by Rebonato and is published under the title &quot;the most general method to create a valid correlation matrix&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I addition some people attempt to bypass the problem entirely by estimating the matrix using a shrinkage method that guarantees the result is positive definite. Among these is Ledoit and Wolf's &quot;Improved Estimation of the Covariance Matrix of Stock Returns&quot;, with code available in Matlab, and related papers.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-10-17T02:30:10.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21260" PostTypeId="1" CreationDate="2015-10-17T02:48:33.720" Score="1" ViewCount="24" Body="&lt;p&gt;Not sure if this belongs here on on money SE. &#xA;Just how transparent are CDOs? Would the ultimate investor have insight into the underlying collaterals or just an overall tranche rating? Has transparency changed since the financial crisis ?&lt;/p&gt;&#xA;" OwnerUserId="9265" LastActivityDate="2015-10-17T02:48:33.720" Title="Just how transparent are CDOs?" Tags="&lt;structured-finance&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21261" PostTypeId="1" CreationDate="2015-10-17T03:35:47.907" Score="3" ViewCount="869" Body="&lt;p&gt;I am not sure about my interpretation of the t-ratios in dummy regression models for event studies. I have the results for two different groups of models examining the impact of news on stock returns and I want to compare them. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;strong&gt;first group&lt;/strong&gt; applies the following model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) $R_{t}=\beta_{0} + \beta_{1}R_{mt}+\beta_{2}D_{Gt}+\beta_{3}D_{Bt}+\epsilon_{t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where ${R}_{t}$ is the return of a company at time t, $R_{mt}$ is the market return at time t, $D_{Gt}$ is a dummy variable that equals one in the event window of Good News occurring and $D_{Bt}$ is a similar dummy indicating the occurrence of bad news. Thus, the coefficient $\beta_{2}$ ($\beta_{3}$) signals the abnormal returns after good (bad) news.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;strong&gt;second group&lt;/strong&gt; includes just a dummy for good news:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) $R_{t}=\beta_{0} + \beta_{1}R_{mt}+\beta_{4}D_{Gt}+\epsilon_{t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;here $D_{Gt}$ is equal to one if good news occur and 0 if bad news occur. Thus, $\beta_{4}$ shows the difference in the returns after good news in comparison to bad news. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: How to get the absolute abnormal returns for good and bad news from model type 2? Is the abnormal return after good news $\beta_{0}+\beta_{4}$? And if $\beta_{4}$ has a t-value of 3.00, can I say that the t-value of $\beta_{0}+\beta_{4}$ is also 3.00 and thus the abnormal returns after good news are statistically significant?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your help!&lt;/p&gt;&#xA;" OwnerUserId="13812" LastActivityDate="2015-10-17T18:44:39.910" Title="Interpretation of t-test in event study with dummy regression" Tags="&lt;returns&gt;&lt;regression&gt;&lt;event-study&gt;&lt;dummy&gt;&lt;abnormal-returns&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21262" PostTypeId="1" CreationDate="2015-10-17T06:45:59.860" Score="1" ViewCount="130" Body="&lt;p&gt;Can anyone suggest books about fixed-income portfolio management?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thx&lt;/p&gt;&#xA;" OwnerUserId="17911" LastActivityDate="2015-10-17T06:45:59.860" Title="Can anyone suggest book about fixed-income portfolio management?" Tags="&lt;fixed-income&gt;&lt;portfolio-management&gt;&lt;bond&gt;&lt;portfolio&gt;&lt;fixed&gt;" AnswerCount="0" CommentCount="1" ClosedDate="2015-10-17T15:53:46.460" ContentLicense="CC BY-SA 3.0" />
  <row Id="21263" PostTypeId="2" ParentId="21223" CreationDate="2015-10-17T06:55:28.253" Score="2" Body="&lt;p&gt;I agree with @bushmanov about &quot;running for exit&quot;, but I would like to underline an important point. In the question you stated &quot;&lt;em&gt;marking to model can underestimate liquidity risk.&lt;/em&gt;&quot; It is not true since you will need a model to estimate liquidity risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have two kinds of models that for:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;usual market impact models. If there is not that much people running for exit, &lt;a href=&quot;http://arxiv.org/abs/1412.0217&quot; rel=&quot;nofollow&quot;&gt;square root based models&lt;/a&gt; will be good enough. You may nevertheless need another model to compute the time needed to get rid pf your position, like &lt;a href=&quot;http://arxiv.org/abs/1205.3482&quot; rel=&quot;nofollow&quot;&gt;stopping time computations.&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;models fitted on &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2023776&quot; rel=&quot;nofollow&quot;&gt;extreme events&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2015-10-17T06:55:28.253" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21264" PostTypeId="1" CreationDate="2015-10-17T08:16:28.000" Score="1" ViewCount="85" Body="&lt;p&gt;I would like to forecast likely future demand based on historical demand. The problem is: I have no mathematical background and in relevant tutorials and even in literature formulas are used, that depend at every step on a given value for that time period, or in other words you need to know the value that you are forecasting, which seems either pointless or the word &quot;forecasting&quot; is used different in this context than in everyday language.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am sure you know common models like Holt or Holt-Winters. For trended data, formulas are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Current Forecast = alpha * Current demand + (1-alpha) * (Last Demand + Last trend)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Current trend = beta * (Current Forecast - Last Forecast) + (1-beta) * Last trend&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see, current trend depends on current forecast, and current forecast depends on current demand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What do I do when I want to forecast future values for demand of a product when it has a trend? Please imagine the following list as a table because I dont know how to format the text properly:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Time period: 1, 2, 3, 4, 5, 6&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Demand of waffles: 10, 11, 10, 13, 15, 16&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know I just could calculate a trend line in excel, but for several reasons I need to understand forecasting models (in a second step also for seasonal data).&lt;/p&gt;&#xA;" OwnerUserId="17913" LastEditorUserId="17913" LastEditDate="2015-10-17T17:51:14.963" LastActivityDate="2015-10-17T17:51:14.963" Title="How do I use common forecasting models to forecast FUTURE values?" Tags="&lt;forecasting&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="1" ClosedDate="2015-10-17T13:05:30.363" ContentLicense="CC BY-SA 3.0" />
  <row Id="21265" PostTypeId="1" AcceptedAnswerId="29937" CreationDate="2015-10-17T09:51:18.550" Score="2" ViewCount="2620" Body="&lt;p&gt;I understand why the Fed Funds rate has historically dropped on the final day of each quarter, but in 2015 it appears that the effective Fed Funds rate now drops on the final day of each month as well. Is there a technical reason why this is happening?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the Fed Funds Futures to forecast future Fed Funds rates and want to make sure I incorporate this nuance (as I assume it's being priced into the futures).&lt;/p&gt;&#xA;" OwnerUserId="2119" LastActivityDate="2016-09-01T15:17:53.700" Title="Fed Funds Rate - why has it just started decreasing on the final day of each month (vs quarter)" Tags="&lt;interest-rates&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21266" PostTypeId="2" ParentId="21240" CreationDate="2015-10-17T10:08:30.670" Score="0" Body="&lt;p&gt;You can build the binomial tree for the stock. After ten periods, the option expires and you enter in the future contract at a certain future price (noob2 gave a big help on this): you compute the future price at period 10 and then you work backwards for the option valuation.&lt;/p&gt;&#xA;" OwnerUserId="7405" LastActivityDate="2015-10-17T10:08:30.670" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21267" PostTypeId="2" ParentId="21261" CreationDate="2015-10-17T11:37:44.027" Score="0" Body="&lt;p&gt;I am not quit understand what do you mean by absolute abnormal returns. I can understand you want to test the asymmetric effects of good news and bad news. There is a similar test named sign bias test by Engle, exactly, which is applied in the GARCH model, you can check it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My understanding, if you want to test the difference effects of good news and bad news, your equation 1 is enough. In your equation 2, I assume $D_{Gt}$ is different from it is equation 1 according to your explanation, then $\beta_4$ is fine to explain that the abnormal returns for good and bad news (in total) affect the return of the company. &lt;/p&gt;&#xA;" OwnerUserId="15201" LastActivityDate="2015-10-17T11:37:44.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21268" PostTypeId="2" ParentId="19518" CreationDate="2015-10-17T14:03:12.547" Score="0" Body="&lt;p&gt;You got material about momentum, you got material  about R ... usual definitions of momentum are not that difficult ... what are you looking for? A programmed back testing script? Go &lt;a href=&quot;https://systematicinvestor.wordpress.com/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; and you find it all.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-10-17T14:03:12.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21269" PostTypeId="1" CreationDate="2015-10-17T16:06:09.390" Score="2" ViewCount="77" Body="&lt;p&gt;When I worked on bond desk in we need to be there 8am est.  Is this typical ? Seems late to me as some markets open 8am like the Canada bond futures.  Treasuries futures open 820am.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I work at hedge now and 7am we need to be in office.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This relates to prop strategy I'm working on that is trying to look at prices traders first see when coming into office. &lt;/p&gt;&#xA;" OwnerUserId="17916" LastEditorUserId="17916" LastEditDate="2015-10-17T19:54:00.593" LastActivityDate="2015-10-17T19:54:00.593" Title="What time do bond traders come into office in morning in New York?" Tags="&lt;trading&gt;&lt;futures&gt;" AnswerCount="0" CommentCount="4" ClosedDate="2015-10-17T18:51:16.610" ContentLicense="CC BY-SA 3.0" />
  <row Id="21270" PostTypeId="2" ParentId="1645" CreationDate="2015-10-17T16:44:37.040" Score="-1" Body="&lt;p&gt;Future is backed by exchange so there is risk of exchange going bankrupt or broker.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bund cash backed by German govt which is different credit risk.&lt;/p&gt;&#xA;" OwnerUserId="17916" LastActivityDate="2015-10-17T16:44:37.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21273" PostTypeId="2" ParentId="21261" CreationDate="2015-10-17T18:24:56.197" Score="1" Body="&lt;p&gt;For the t ratio, you should re-parameterise your equation so that $(β_0+β_4)$ is treated as one coefficient, say $\gamma$ or a coeff of a single variable. you cannot use one's t ratio for making inference on the other. $β_0$ is the average return on this stock, the coef on dummy variable absorbs the abnormal returns. You could do this:&#xA;$$R_t=\beta_0+\beta_{0}D_{Gt}-\beta_{0}D_{Gt}+\beta_{1}R_{mt}+\beta_{4}D_{Gt}+\epsilon$$&#xA;then, collecting the common terms you will have&#xA;$$R_t=\beta_0(1-D_{Gt})+\beta_{1}R_{mt}+(\beta_{0}+\beta_{4})D_{Gt}+\epsilon$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;here, $\gamma=(\beta_{0}+\beta_{4})$, and $D=(1-D_{Gt})$ is a new variable which you can create in excel. you should now regress $R_t$ as follows&#xA;$$R_t=\beta_0D+\beta_{1}R_{mt}+\gamma D_{Gt}+\epsilon$$, the t value of $\gamma$ can be used for inference on $(\beta_{0}+\beta_{4})$.&lt;/p&gt;&#xA;" OwnerUserId="17873" LastActivityDate="2015-10-17T18:24:56.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21274" PostTypeId="2" ParentId="21261" CreationDate="2015-10-17T18:44:39.910" Score="2" Body="&lt;p&gt;As far as your second model concerned:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Abnormal returns for good news is $\beta_4$&lt;/li&gt;&#xA;&lt;li&gt;The t-value of 3 tells it is significantly different from 0&lt;/li&gt;&#xA;&lt;li&gt;The model does not account for effect of bad news so the effect of bad news will mostly be found in spikes in residuals around time of bad news releases.&lt;/li&gt;&#xA;&lt;li&gt;$\beta_0$ is return when all other factors in the model (market return, good news) are 0, i.e. more or less &quot;risk-free&quot; return.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="13718" LastActivityDate="2015-10-17T18:44:39.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21275" PostTypeId="1" AcceptedAnswerId="32083" CreationDate="2015-10-17T20:26:59.587" Score="5" ViewCount="187" Body="&lt;p&gt;I am reading Elton's AFA presidential adress article here. &lt;a href=&quot;http://people.stern.nyu.edu/eelton/working_papers/Expected_Return_Realized_Return.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://people.stern.nyu.edu/eelton/working_papers/Expected_Return_Realized_Return.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the paper, he is warning against using the average of realized return as an estimate of expected return. I have a question regarding his last comment just above the Summary section.&#xA;iced. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Now consider momentum. Accept for a moment the empirical evidence that&#xA;  momentum is related to realized returns. If there is any connection&#xA;  between momentum and changes in the opportunity set, I am not aware of&#xA;  it. Thus, momentum is the kind of factor that is likely to appear in&#xA;  the return- generating process and likely to appear priced in sample&#xA;  but for which there is no theory that would suggest that it should be&#xA;  priced and for which current testing procedures are unlikely to be&#xA;  helpful.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I can understand why from the model he kept in mind:&#xA;$$R_{it} -R_{ft}= \alpha_i+\sum\beta_{ij}^uI_{jt}^u + \sum\beta_{ij}^PI_{jt}^P +e_{it}$$&#xA;wehre $I_{jt}^u$ and $I_{jt}^P$ are unpriced and priced factor mimicking index portfolios. My question is why in the first place that the unpriced factors should enter into the return generating process?&lt;/p&gt;&#xA;" OwnerUserId="6804" LastActivityDate="2017-01-25T01:31:16.920" Title="Why should a factor not priced and yet is relevant to the return generating process" Tags="&lt;research&gt;&lt;factor-models&gt;&lt;asset-pricing&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21276" PostTypeId="1" CreationDate="2015-10-17T23:42:17.203" Score="1" ViewCount="394" Body="&lt;p&gt;I'm backtesting a statistical arbitrage strategy. To calculate the PnL I simply use  $Y(t)-Y(t+n)$ for the profit on the first leg and $\beta*X(t) - \beta*X(t+n)$ for the profit on the second leg, then i add both profits together.  $Y$ is the number of share on the first leg and $\beta X$ is the number of shares on the second leg, each of the legs is also multiplied by the price of the corresponding share. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now suppose I would use log prices to calculate the $\beta$. How would the PnL calculation look like then? Would it be appropriate to calculate the PnL by multiplying regular price with the $\beta$ obtained from the log price regression, provided that the long/short signals are received from the spread that was also calculated using log prices? If such approach is not correct then how can you calculate the PnL from the pair while using the log prices?&lt;/p&gt;&#xA;" OwnerUserId="17921" LastEditorUserId="15832" LastEditDate="2015-10-18T18:12:12.330" LastActivityDate="2015-10-18T18:12:12.330" Title="Calculating PnL from log prices" Tags="&lt;arbitrage&gt;&lt;pairs-trading&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21277" PostTypeId="1" CreationDate="2015-10-18T00:00:44.530" Score="-1" ViewCount="260" Body="&lt;p&gt;A seller of an European Call, can, subjectively have unbounded losses. This loss may be mitigated by buying the stock (covered call). In this case,, the loss will be bounded at A. How would one compute the value of A? in this case, the interest rate is 0, the initial stock price is S,  the price of call is C, and C is greater then S.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, there is no position at t=0. Now you sell call and buy the stock. Because S is greater then C, you borrow S - C. Additionally, at expiration, you must pay this back. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would one even begin to compute A here? I have no clue.&lt;/p&gt;&#xA;" OwnerUserId="17922" LastEditorUserId="11678" LastEditDate="2017-04-12T22:41:06.163" LastActivityDate="2017-05-12T23:12:07.963" Title="Computing loss of Call / Stock Purchase" Tags="&lt;options&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21278" PostTypeId="2" ParentId="21277" CreationDate="2015-10-18T00:21:48.437" Score="0" Body="&lt;p&gt;$A$ is the market value of the stock at the time of exercise - making the loss to the short covered call $A_T−K$ where $A_T$ is the market price of the stock at exercise and $K$ is the strike. You observe $A$, not calculate it (at least in the context of your question).&lt;/p&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="9265" LastEditDate="2015-10-18T20:18:17.893" LastActivityDate="2015-10-18T20:18:17.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21279" PostTypeId="1" CreationDate="2015-10-18T01:26:30.343" Score="4" ViewCount="104" Body="&lt;p&gt;I am having a tough time conceptualizing this question here: Let&#xA;$P$= Price of European Option, $S$ = Present Price of Option and&#xA;$K$ = Strike Price.&#xA;If $P &amp;gt; K$, why does abritrage exist? Assuming $r = 0$.&#xA;I really can't figure this out. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that when C(call option) is greater then S abritrage exists because $C - S + K &amp;gt; 0$ and even if you don't execute the option, $C - S &amp;gt; 0$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could the same logic be utilized here?&lt;/p&gt;&#xA;" OwnerUserId="17923" LastEditorUserId="16249" LastEditDate="2015-10-18T13:33:32.170" LastActivityDate="2015-12-17T18:13:02.277" Title="Abritrage when Put Option Greater then Strike Price?" Tags="&lt;portfolio-management&gt;&lt;call&gt;" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21280" PostTypeId="2" ParentId="21279" CreationDate="2015-10-18T02:06:09.033" Score="0" Body="&lt;p&gt;First, assume r = 0 then Put-Call parity holds: C - P = S - K which can be rewritten as C = S - K + P &gt; S - K + K = S. That's your answer.&lt;/p&gt;&#xA;" OwnerUserId="6640" LastActivityDate="2015-10-18T02:06:09.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21281" PostTypeId="2" ParentId="728" CreationDate="2015-10-18T04:15:53.300" Score="3" Body="&lt;p&gt;&lt;strong&gt;What are the limitations of R?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The limitations of the R kernel are well-documented in Sridharan and Patel (2014):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Spends more than 85% time in processor and memory stalls&lt;/li&gt;&#xA;&lt;li&gt;High rate of cache misses (about 90% on linear regression and k-means tasks)&lt;/li&gt;&#xA;&lt;li&gt;Triggers garbage collection very frequently&lt;/li&gt;&#xA;&lt;li&gt;Creates a large number of unnecessary temporary objects, resorting to swap space quickly even for datasets that should have fit main memory&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;C++ is not necessarily &quot;faster than R&quot;. It makes limited sense to talk about faster languages, only faster implementations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;C++ overcomes the above issues and gives you more room for optimization by giving you deterministic control over low level facilities that allow you to manually manage memory and access patterns. That's all. Chances are, a naive C++ implementation of native R routines will be slower than using the R implementation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What quant finance applications is R a (really) bad choice (or at least can be)?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The two most obvious things are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;When you need stable, 24/7 operation of the program without program crashes&lt;/li&gt;&#xA;&lt;li&gt;When you have an application-specific task that needs to be repeated very often, e.g. feed handling, order routing, volatility modeling etc.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2015-10-18T04:15:53.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21282" PostTypeId="2" ParentId="3117" CreationDate="2015-10-18T04:31:04.357" Score="1" Body="&lt;p&gt;The problem with most academic studies is that they do a poor job of defining what is &quot;HFT&quot;, deterministically attributing a structural change to &quot;HFT&quot; and removing the effects of extraneous factors (other algorithmic trading activity such as SORs, large trading by discretionary participants).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the best modern studies of the market structural effect of &quot;HFT&quot; owes to Tokyo Stock Exchange's introduction of Arrowhead in January 2010, which effectively enabled &quot;HFT&quot; in the venue. This is a particularly useful data point because this was carried out by a modern exchange with an earnest effort to monitor the effect of the change and &quot;HFT&quot; participants in a recent date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Market depth and liquidity&lt;/strong&gt;: It was found that the introduction of Arrowhead co-occurred with an instant increase in depth of orders at the best bid and offer of between 62% to 139% in all symbols.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Volatility and liquidity&lt;/strong&gt;: TSE also found that they were now able to distinguish between colocation and non-colocation participants and analyze their flow during periods of high volatility. It was found that during market downturns, non-colocation participants were net sellers whereas the colocation participants were net neutral. As a result, the volatility has to be exacerbated by non-HFT participants and we can infer that non-HFT participants are net liquidity takers during periods of volatility while HFT participants are net liquidity providers during periods of volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/7piWP.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/7piWP.png&quot; alt=&quot;TSE&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2015-10-18T04:31:04.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21284" PostTypeId="2" ParentId="19340" CreationDate="2015-10-18T12:57:39.853" Score="1" Body="&lt;p&gt;Firstly i think if you use log prices then γ shows by how much B stock growth rate outpaces A stock growth rate, but I don't understand why Ernie says that you need to hold market values fixed, if you do this then how are you going to profit from the spread?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly there are typos in the return calculation: log(20.1)-log(19.5) = 0.03 not 0.3. Which refers to the 3% return on the A leg trade. B leg return is indeed 5.6% (assuming cc returns), however it is incorrect to sum these return to get 9% return on the total trade, since they were obtained from different amounts of capital. The return from A leg is 0.6USD and return from B leg is 0.29USD*1.5 = 0.435USD thus the total return is 1.035USD which we divide by the total capital deployed in the trade at time t, 19.5+1.5*7.46 = 30.69$, so 1.035/30.69 = 0.0337 and this is the real return on this trade, not 9%.&lt;/p&gt;&#xA;" OwnerUserId="17921" LastEditorUserId="17921" LastEditDate="2015-10-18T13:17:37.333" LastActivityDate="2015-10-18T13:17:37.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21287" PostTypeId="2" ParentId="12638" CreationDate="2015-10-18T14:33:04.083" Score="2" Body="&lt;p&gt;The prices should be 'really' close to each other. My result is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;result&#xA; Model          Value             &#xA;[1,] &quot;fOptions.BAW&quot; &quot;47.7630796321483&quot;&#xA;[2,] &quot;quantlib.BAW&quot; &quot;47.747504045402&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The reason is here we need to deal with three variables: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;r (risk free rate), d (dividend yield), b (cost-of-carry rate).&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;d = r -b &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The documentation of these two functions are: (look at the end of the first and third line)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;BAWAmericanApproxOption(TypeFlag, S, X, Time, r, b,   &#xA;sigma, title = NULL, description = NULL)&#xA;&#xA;AmericanOption(type, underlying, strike, dividendYield, riskFreeRate,  &#xA;maturity, volatility, timeSteps=150, gridPoints=149, engine=&quot;BaroneAdesiWhaley&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see, one uses &quot;r&quot; and &quot;b&quot;. The other uses &quot;d&quot; and &quot;r&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A little modification (Just change &quot;b&quot; to &quot;r-b&quot;) to the poster's code here will fix the problem.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(fOptions)&#xA;library(RQuantLib)&#xA;&#xA;TypeFlag&amp;lt;-&quot;c&quot;&#xA;S&amp;lt;-530.32&#xA;X&amp;lt;-550&#xA;Time&amp;lt;-283/365&#xA;r&amp;lt;-0.000703&#xA;b&amp;lt;-0.05&#xA;sigma&amp;lt;-0.2442&#xA;&#xA;fOptions.BAW&amp;lt;-BAWAmericanApproxOption(TypeFlag, S, X, Time, r, b, sigma,&#xA;                                      title = NULL, description = NULL)&#xA;quantlib.BAW&amp;lt;-AmericanOption(&quot;call&quot;, S, X,&#xA;                             r-b, r, Time, sigma,&#xA;                             timeSteps=150, gridPoints=149, engine=&quot;BaroneAdesiWhaley&quot;)&#xA;&#xA;modelName&amp;lt;-c(&quot;fOptions.BAW&quot;,&quot;quantlib.BAW&quot;)&#xA;result &amp;lt;-cbind(modelName,&#xA;         c(fOptions.BAW@price,quantlib.BAW[1]$value))&#xA;colnames(result)&amp;lt;-c(&quot;Model&quot;,&quot;Value&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The result will be the &quot;47.76&quot; and &quot;47.74&quot; I posted above. &lt;/p&gt;&#xA;&#xA;##################-----------------------------&#xA;&#xA;&lt;p&gt;Below is the answer that I wrote on Oct 18. I would keep it there.&lt;/p&gt;&#xA;&#xA;##################-----------------------------&#xA;&#xA;&lt;p&gt;In RQuantLib, the formula you are using should include &quot;dividendYield&quot; which is &quot;r-b&quot; instead of b (the annualized cost-of-carry rate) &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;quantlib.BAW&amp;lt;-AmericanOption(type = TypeFlag, underlying = S, strike = X, dividendYield = r - b, &#xA;                  riskFreeRate = r, maturity = Time, volatility = sigma, engine=&quot;BaroneAdesiWhaley&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will provide the same(similar) answer to fOptions. &lt;/p&gt;&#xA;" OwnerUserId="17927" LastEditorUserId="17927" LastEditDate="2015-12-14T20:21:42.437" LastActivityDate="2015-12-14T20:21:42.437" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21289" PostTypeId="2" ParentId="21279" CreationDate="2015-10-18T16:35:21.410" Score="1" Body="&lt;p&gt;Assuming S is non-negative, the payoff function of a put at maturity is dominated by K:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P_T = max(K - S_T, 0) = K + max(-S_T, -K) \leq K$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under the assumption of a zero risk-free rate, one can write a put and invest K until maturity, for a positive cashflow at initiation ($P - K &amp;gt; 0$) and possibility 1 non-negative cashflow at maturity ($P_T \leq K$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally, any put value above $e^{-rT}K$, $T$ being the time to maturity, yields an arbitrage opportunity, it being the amount necessary to dominate the final payoff function.&lt;/p&gt;&#xA;" OwnerUserId="15336" LastActivityDate="2015-10-18T16:35:21.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21290" PostTypeId="1" CreationDate="2015-10-18T17:54:14.300" Score="1" ViewCount="140" Body="&lt;p&gt;Futures trading in stock index gives leverage.  Leverage cuts both ways.  It can give you huge pct gains or wipe you out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typically stock index futures for the major markets have limited daily pct change to upside but to downside there could be huge pct changes.  20 pct sp500 lost in 87 crash.  Around 11pct highest daily gain.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We see negative skew.  So there is bigger downside risk.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If one has enough capital to make margin calls can they ride out a huge daily decline ?  Just hold on long enough and market will eventually recover.  It may take 15 years like for Nasdaq but eventually will.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the loss is eventually made up and you do not go bankrupt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that upside risk is different story as there is no guarantee market will return to lower level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is wrong with this logic ?  &lt;/p&gt;&#xA;" OwnerUserId="17916" LastActivityDate="2015-10-19T23:33:11.487" Title="What is wrong with this argument?" Tags="&lt;risk&gt;&lt;futures&gt;" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21292" PostTypeId="1" CreationDate="2015-10-18T20:15:25.080" Score="2" ViewCount="76" Body="&lt;p&gt;If market resiliency, a measure of liquidity, is the amount of time it takes a market to bounce back from temporarily incorrect prices, then what makes a price &quot;incorrect&quot;? Is this like fat-finger trades and flash crashes ?&lt;/p&gt;&#xA;" OwnerUserId="9265" LastActivityDate="2015-10-19T07:24:51.053" Title="What are the causes of incorrect prices in the market?" Tags="&lt;liquidity&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21294" PostTypeId="1" CreationDate="2015-10-19T02:25:36.813" Score="4" ViewCount="395" Body="&lt;p&gt;I have a HKD callable bond maturing in 2022. the call schedule is bermudan and the next call date is 10/17/16 and redemption price is 100 (the call date is 10/17 every year till maturity). Initially it was priced to next call date using a comparable that was maturing around previous call date 10/17/15. The yield was around 1.1% based on comparables. If I look at the history, a year prior to now it started at a price of 104 and slowly converged to call price and now it again jumps back to 104. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is - is this correct? i.e. is pricing to next call and jumps around call date justified? I don't have a comparable bond maturing in 2022, but do have a few maturing around the next call date. &lt;/p&gt;&#xA;" OwnerUserId="17179" LastActivityDate="2016-06-16T03:12:50.413" Title="Callable bond pricing" Tags="&lt;fixed-income&gt;&lt;bond-yields&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21295" PostTypeId="2" ParentId="19279" CreationDate="2015-10-19T05:49:05.853" Score="2" Body="&lt;p&gt;I cannot seem to find that article for free, so here is a more generalized answer.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;1.what are the hidden states and what are the observation states.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The hidden states are said to be that of an unobserved parameter process following the Markov property. The observation states are generated by the hidden parameter process. The parameter process changes or switches to different sets of parameters depending only on the previous state.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, there is a hidden parameter process that you cannot observe. It is a random process governing which of the m different sets of parameters is generating the observed data.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;2.what is the likelihood value and how to calculate it.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;After making assumptions about the number, m, and types of underlying distributions, we have to multiply the initial distribution of the hidden states, $\delta$, by the probability of each observation, $P(x_T)$, and the transition probability matrix, $\Gamma$, (whose rows sum to 1 and tell us the probability of transitioning from one state to another). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that $P(x_T)$ is an m x m diagonal matrix where the elements are the probability of observing x from each of m underlying distributions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The likelihood is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$L_T = \delta P(x_1) \Gamma P(x_2) ... \Gamma P(x_T) 1^T$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The goal is to find the values for $\delta$, $\Gamma$, and the parameters of the m distributions which maximize $L_T$. This is non trivial. As an alternative to numerically maximizing the likelihood, you can also estimate these parameters using Bayesian inference. See the following for more details and computational considerations:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Zucchini, Walter. Hidden Markov Models for Time Series: An Introduction Using R, 1st Edition. CRC Press, 04/2009. VitalSource Bookshelf Online.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;See the &lt;code&gt;R&lt;/code&gt; package &lt;code&gt;HiddenMarkov&lt;/code&gt; for discrete time, continuous space models and the package &lt;code&gt;HMM&lt;/code&gt; for discrete time, discrete space models. In other words, use &lt;code&gt;HiddenMarkov&lt;/code&gt; if you believe the distributions generating the parameters are continuous (probability density functions), and use &lt;code&gt;HMM&lt;/code&gt; if you believe the distributions are discrete (probability mass functions).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I might add that another calculation of great interest form these models is one which estimates the most likely sequence of states given the parameters above, this is know as the Viterbi algorithm and is implemented in both of the &lt;code&gt;R&lt;/code&gt; packages mentioned above. &lt;/p&gt;&#xA;" OwnerUserId="17938" LastEditorUserId="17938" LastEditDate="2015-10-19T05:54:17.307" LastActivityDate="2015-10-19T05:54:17.307" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21296" PostTypeId="2" ParentId="21292" CreationDate="2015-10-19T07:14:12.223" Score="1" Body="&lt;p&gt;Genereally speaking main identifed liquidity costs  (or prices distortion - see  Amihud, Y., Mendelson, H., Heje Pedersen, L., 2005. Liquidity and Asset Prices) are related to the asymmetric information theory, the inventory risk paradigm for market makers, trading costs and search problems. All that topics are studied in the Market Microstructure theory. A good starting point to know more about it is the following article  : Madhavan, A., 2000. Market microstructure: A survey. Journal of Financial Market.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2015-10-19T07:14:12.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21298" PostTypeId="2" ParentId="21292" CreationDate="2015-10-19T07:24:51.053" Score="1" Body="&lt;p&gt;In addition to Malick's paper, I believe Shleifer and Summers (1990), &lt;a href=&quot;http://scholar.harvard.edu/shleifer/files/noise_trader_approach_finance.pdf&quot; rel=&quot;nofollow&quot;&gt;The Noise Trader Approach to Finance&lt;/a&gt; should answer your question. Some market participants are not fully 'rational' and their decisions to take or provide liquidity are not driven by fundamental pricing information, leading to 'inefficient' or 'irrational' prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This irrationality can be attributed to a variety of reasons - political (e.g. currency pegs), asymmetric information (traders acting on stale data), non-uniform trading costs etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea that liquidity is limited and therefore can be distorted by noise traders isn't something new, as reflected by Keynes's often-cited statement: &quot;The market can stay irrational longer than you can stay solvent.&quot;&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2015-10-19T07:24:51.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21299" PostTypeId="1" AcceptedAnswerId="21325" CreationDate="2015-10-19T09:43:41.580" Score="4" ViewCount="930" Body="&lt;p&gt;I am unpleased with current Interactive Brokers risk graph for option strategies, so I'm planning on writing an application myself to plot it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My initial idea is to get the option greek values from the broker's data feed, so I would have the following data:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Strike price&lt;/li&gt;&#xA;&lt;li&gt;Current underlying price&lt;/li&gt;&#xA;&lt;li&gt;Time to expiration&lt;/li&gt;&#xA;&lt;li&gt;Delta, Gamma, Theta, Rho, Vega&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Since the Black-Scholes formula is as follows:&#xA;$$C=SN(d_1)-e^{-rT}KN(d_2)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And assuming the greeks formulas as described in &lt;a href=&quot;http://www.econ-pol.unisi.it/fm10/greeksBS.pdf&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt;, I can conclude that:&#xA;$$N(d_1)=\delta$$&#xA;$$e^{-rT}N(d_2)=\frac{\rho}{KT}$$&#xA;And therefore I can calculate the Black-Scholes formula knowing only delta, rho, current underlying price, strike price and time to expiration:&#xA;$$C=S \delta-K \rho$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that of course &lt;strong&gt;this must be wrong&lt;/strong&gt;. It cannot be possible that I am able to calculate option price using only 2 greeks, or at least it looks hard to believe from what I know.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, which assumption of those I'm taking is wrong? Is there any resource somewhere of how to calculate the option price from greeks (I searched but couldn't find one, that's why I started playing with these equations).&lt;/p&gt;&#xA;" OwnerUserId="15068" LastEditorUserId="467" LastEditDate="2015-10-20T06:39:59.070" LastActivityDate="2015-10-20T12:24:56.137" Title="Can I get Black-Scholes option price from greeks?" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;greeks&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21300" PostTypeId="2" ParentId="21299" CreationDate="2015-10-19T11:11:04.287" Score="1" Body="&lt;p&gt;I understand Greeks in option pricing as the Taylor Theorem, therefore, the more Greeks you have, the more explanatory your function will be. This is the same idea, you need to approximate the price to a curve (volatility), and depending on the degree of the equation (greeks) you will obtain more accuracy. &lt;/p&gt;&#xA;" OwnerUserId="12089" LastEditorUserId="2587" LastEditDate="2015-10-20T12:24:56.137" LastActivityDate="2015-10-20T12:24:56.137" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="21301" PostTypeId="5" CreationDate="2015-10-19T11:57:11.937" Score="0" Body="&lt;p&gt;&lt;code&gt;hidden Markov models&lt;/code&gt; can be used to detect discrete changes in the unobserved parameters that are generating a random process including the state at the present time and the probability of transitioning to a different state. the detection of  &lt;code&gt;regime switching&lt;/code&gt; is a common application thereof&lt;/p&gt;&#xA;" OwnerUserId="17938" LastEditorUserId="17938" LastEditDate="2015-10-19T12:56:54.807" LastActivityDate="2015-10-19T12:56:54.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21302" PostTypeId="4" CreationDate="2015-10-19T11:57:11.937" Score="0" Body="sequential data analysis using state space models with discrete latent variables and discrete or continuous observed variables" OwnerUserId="17938" LastEditorUserId="17938" LastEditDate="2015-10-19T12:56:47.720" LastActivityDate="2015-10-19T12:56:47.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21303" PostTypeId="1" AcceptedAnswerId="21308" CreationDate="2015-10-19T12:07:18.047" Score="1" ViewCount="105" Body="&lt;p&gt;-Hey all, recently I encountered the necessity to incorporate dividends into options pricing. Lets say I have the following american put option: Initial price - 100, T-0.25, Volatility is 30%, Number of periods is 3, Interest rate is 2%. Lets further say the u = 1.07 and d = 0.93458. Given the prior information I calculate that the risk neutral probabilities are q = 63.08% and q-1=36.92%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First I built the three period lattice given the parameters above:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/AkhJx.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/AkhJx.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;The stock lattice was computed using the excel formula =B2*(B7 ^(0))*(B8^(0)), where B2 is the initial price of 100 and the B7 and B8 are u and d respectively that are exponentiated by the number of up or down movements at any time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the option lattice was obtained from the stock lattice, first using the formula =MAX( H2 - E16, 0) at t=3, where the H2 is the strike price and E16 is the spot price, and then I calculated the t2, t1 and t0 using =MAX(MAX($H$2 - $D$16, 0),  ($B$9 *$E$24 + $B$10 *$E$25)/$B$6), which should be read as =MAX(MAX(strike-spot,0), q *priceU + q-1*priceD)/(1+interest rate).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would I modify these formulas in order to incorporate dividends, given that these are paid in each period and are proportional to the price of the stock. Given that the dividend is 1%.&lt;/p&gt;&#xA;" OwnerUserId="17688" LastEditorUserId="17688" LastEditDate="2015-10-19T12:12:28.730" LastActivityDate="2015-10-19T15:24:53.797" Title="How do I incorporate dividends into options pricing" Tags="&lt;option-pricing&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21304" PostTypeId="2" ParentId="11045" CreationDate="2015-10-19T12:19:07.590" Score="1" Body="&lt;p&gt;Besides using the valuable domain knowledge given in other answer(s) to determine the optimal number of states, and furthermore as an alternative to using the AIC or BIC, we can consider Bayesian estimation of the parameters including the optimal number of states:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Scott, S.L. (2002). Bayesian methods for hidden Markov models: Recursive computing in the 21st century. J. Amer. Statist. Assoc. 97, 337–351.&lt;/p&gt;&#xA;&lt;p&gt;Congdon, P. (2006). Bayesian model choice based on Monte Carlo estimates of posterior model probabilities. Computat. Statist. &amp;amp; Data Analysis 50, 346–357.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="17938" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2015-10-19T15:43:56.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21305" PostTypeId="2" ParentId="21290" CreationDate="2015-10-19T13:03:06.563" Score="0" Body="&lt;p&gt;Basically， based on your assumptions, your logic is correct. However, it's a kind of waste for your money. During the bear market, you still have opportunities to gain at least risk-free return. But if you just put that money in the margin account, you cannot get that profit. This is what we call &quot;opportunity cost&quot;. So in bear market, it's perhaps a better choice to end the long position and invest your money on other assets or simply take a short position.&lt;/p&gt;&#xA;" OwnerUserId="17860" LastActivityDate="2015-10-19T13:03:06.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21306" PostTypeId="1" CreationDate="2015-10-19T14:33:49.303" Score="1" ViewCount="164" Body="&lt;p&gt;I have a Monte Carlo model which measures the Value at Risk (VaR) for given portfolio. I use the geometric brownian motion to model the prices. But let's say I assumed the returns of prices follow the logistic distribution and thereby I want to change the model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would it be correct to substitute the variable that represents standard normal variate with logistic variate? Or would it better to use other process to model prices?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I substituted the logistic variates to the model but I think VaR is too high compared to the previous assumption.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be appreciated!&lt;/p&gt;&#xA;" OwnerUserId="17943" LastActivityDate="2016-03-17T17:38:31.833" Title="Monte Carlo VaR assuming logistic distribution" Tags="&lt;monte-carlo&gt;&lt;portfolio&gt;&lt;var&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21307" PostTypeId="2" ParentId="21306" CreationDate="2015-10-19T15:14:33.930" Score="1" Body="&lt;p&gt;If you want to get rid of the Gaussian returns, then you could have a look at Lévy processes. You could assume a t-distribution for returns for fatter tails or you could have a look at so called variance gamma.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have never seen somebody using the logistic distribution to model asset returns (&lt;a href=&quot;https://en.wikipedia.org/wiki/Logistic_distribution&quot; rel=&quot;nofollow&quot;&gt;this one&lt;/a&gt; ?) Where do you have this idea from (any reference)?&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-10-19T15:14:33.930" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21308" PostTypeId="2" ParentId="21303" CreationDate="2015-10-19T15:24:53.797" Score="1" Body="&lt;p&gt;You want to express your dividend as a continuous rate and subtract it from the risk free rate when calculating the probability of an up jump. See this Wikipedia article: &lt;a href=&quot;https://en.wikipedia.org/wiki/Binomial_options_pricing_model#STEP_3:_Find_Option_value_at_earlier_nodes&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Binomial_options_pricing_model#STEP_3:_Find_Option_value_at_earlier_nodes&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9265" LastActivityDate="2015-10-19T15:24:53.797" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21309" PostTypeId="2" ParentId="21290" CreationDate="2015-10-19T15:31:21.810" Score="1" Body="&lt;p&gt;I think that the key is with youe last comment: &lt;code&gt;Note that upside risk is different story as there is no guarantee market will return to lower level.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You don't know if it will recover when you have a bull or bear market. In the other hand, let's say that it takes 15 years to recover to the actual value. Is it worth the same $100 15 years ago, and nowadays? As you know it isn't, so you have lost money. In addition, there is the value of opportunity and so on....&lt;/p&gt;&#xA;" OwnerUserId="12089" LastActivityDate="2015-10-19T15:31:21.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21310" PostTypeId="1" CreationDate="2015-10-19T15:48:04.813" Score="2" ViewCount="250" Body="&lt;p&gt;My idea is to work with dynamic Nelson Siegel models(DNS) on my master's thesis. As I am finishing undergraduation this year I started researching on the subject. I wonder what is being discussed in this part of Dynamic Nelson Siegel modeling? &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The estimation method I´d like to use is the Bayesian. What I could&#xA;do with the Bayesian method to put me in the state of art of DNS&#xA;models.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I also saw that there is a discussion of terms of arbitrage and&#xA;non arbitrage conditions. What mathematics needed to understand how&#xA;to include no-arbitrage condition (Stochastic Calculus/Process)? I confess I did not quite&#xA;understand the paper (below) reporting this idea.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.frbsf.org/economic-research/files/wp07-20bk.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.frbsf.org/economic-research/files/wp07-20bk.pdf&lt;/a&gt; (this&#xA;one, right?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That would be the type of Dynamic Affine Nelson Siegel models with&#xA;non arbitrage conditions?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;So  the families of Nelson Siegel models are divided into:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Nelson Siegel Dynamic&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Nelson Siegel Dynamic with non arbitrage conditions&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Affine Dynamic Nelson Siegel models with conditions not arbitration&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;As you can see I'm a little lost. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, any information could be useful to me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot.&lt;/p&gt;&#xA;" OwnerUserId="15685" LastEditorUserId="16595" LastEditDate="2019-04-22T08:55:54.153" LastActivityDate="2019-04-22T08:55:54.153" Title="State of Art - Nelson Siegel Modeling" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;stochastic-processes&gt;&lt;term-structure&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="21311" PostTypeId="2" ParentId="21299" CreationDate="2015-10-19T17:41:56.630" Score="0" Body="&lt;p&gt;I don't understand the source of confusion. If you go back to the classical Black-Scholes (1974) paper, or in effect, any other current textbook derivation of the model, your equation of call option price $C$ is EXACTLY the Black-Scholes. Once you have the analytical solution $C = C(s,\sigma,T,K,\cdots)$ as a function of the other parameters, then you take a first order derivative to get the comparative statics (i.e. &quot;Greeks&quot; if you may; but this process of getting the value function and then perturbing the parameters, this is a very, very standard procedure in finance and economic theory. Essentially, an economist is interested in knowing how the solution to a model changes as the underlying parameter changes --- which is precisely the point of the Black-Scholes greeks anyway). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you take those derivatives and get the greeks, you have what you have. And all I can say is that you've found an alternative expression for the Black-Scholes formula, but that's potentially not that surprising nor interesting --- given that the $\delta$ gives you the hedge ratio and $e^{-rT} N(d_2)$ tells you how many bonds you need to hold. This is the precise replicating portfolio argument to pricing a derivative. &lt;/p&gt;&#xA;" OwnerUserId="17332" LastActivityDate="2015-10-19T17:41:56.630" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21313" PostTypeId="1" AcceptedAnswerId="21324" CreationDate="2015-10-19T19:12:33.067" Score="6" ViewCount="188" Body="&lt;p&gt;I am trying to look out for something I can engage in for my final year project (M.Sc) but my interests lie more in risk analysis (specifically credit risk). I have tried searching the web but really failed to get a good answer to my question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question: Can risk analysis be done using stochastic calculus? If yes, why is it that most work on risk analysis is done using GARCH models? (I dont hate GARCH but I am more interested in stochastics)&lt;/p&gt;&#xA;" OwnerUserId="15726" LastEditorUserId="2587" LastEditDate="2015-10-20T06:11:28.853" LastActivityDate="2015-10-20T11:59:10.480" Title="Why is GARCH more often applied in risk analysis than stochastics?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;reference-request&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21314" PostTypeId="2" ParentId="21294" CreationDate="2015-10-19T21:18:43.803" Score="2" Body="&lt;p&gt;It's often true that a bond handled in some arbitrage-free model has pricing behavior like that.  Usually, the situation is that the issuer has pretty good credit, so from a &lt;em&gt;theoretical&lt;/em&gt; point of view they should (almost certainly) be calling the bond at the next call date.  The arbitrage price captures that and so it bounces up once the company declines to call the bond, against theoretical expectations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, calling a bond away in practice carries many costs not captured in most models, such as investment bank fees for issuing a replacement bond, regulatory fees and employee time, etc. etc.  This is what is driving the company's decision.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometime you will see arbitrage models where traders can enter their guesses at call probabilities, or sometimes estimated call penalties, to compensate for the phenomenon.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2015-10-19T21:18:43.803" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21315" PostTypeId="2" ParentId="21290" CreationDate="2015-10-19T21:25:34.773" Score="1" Body="&lt;p&gt;A market does not always come back.  According to &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1299392&quot; rel=&quot;nofollow&quot;&gt;Brown, Goetzmann and Ross&lt;/a&gt;, half the stock exchanges in existence in year 1900 had significant interruptions or were completely abolished.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Beware of survivorship bias!&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2015-10-19T21:25:34.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21316" PostTypeId="1" CreationDate="2015-10-19T21:56:03.227" Score="1" ViewCount="592" Body="&lt;p&gt;The general impact model for trading a VWAP order throughout the day has the form of:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\alpha \cdot \sigma_n \cdot \text{(participation rate)}^\beta$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for an impact / slippage model of any form for the open and closing crossing acution for US equities (or any other assetclass). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What would you use instead of $\sigma_n$, and what would you set as a pessimistic estimate or upper bound on $\alpha$ and $\beta$? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I prefer simulations to be careful and pessimistic, therefore any upper bound on these quantitites or even a rule of thumb would help.&lt;/p&gt;&#xA;" OwnerUserId="16956" LastActivityDate="2015-10-19T21:56:03.227" Title="Impact / slippage model for open and closing crossing auctions?" Tags="&lt;market-microstructure&gt;&lt;slippage&gt;&lt;market-impact&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21317" PostTypeId="2" ParentId="21290" CreationDate="2015-10-19T23:33:11.487" Score="0" Body="&lt;p&gt;Your logic is incorrect because it doesn't make best use of the capital. What if the stock never come back up? Even it does, do you really want to tie your funds in something that you don't know when you can get back?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mathematically, your problem can be modelled by a discount factor. Your money in 15 years will be eaten by the discount factor badly.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2015-10-19T23:33:11.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21318" PostTypeId="1" CreationDate="2015-10-19T23:34:12.313" Score="1" ViewCount="55" Body="&lt;p&gt;I am trying to reproduce the code and plot you see &lt;a href=&quot;https://ccrma.stanford.edu/~wherman/tulane/gauss_newton.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; on pages 8,9 and 10&#xA;which was coded in MATLAB, but I'd like to convert it to R code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe I converted the MATLAB code below to R syntax and if you run it you will see a plot but it does not match the plot you see in the pdf. The R estimation is much worse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BACKGROUND - The matlab code makes a non-linear fit to population data. It is well described on page 8. Basically it uses a gauss newton method to fit a non linear model. I am just trying to get it to work in R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas why?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;df =  function(p,q,a1,a2,index) #calculate partial derivatives&#xA;{&#xA;&#xA;  if  (index == 1){&#xA;    value = exp(a2*p);&#xA;  }&#xA;  if  (index == 2){&#xA;    value = p*a1*exp(a2*p);&#xA;  }&#xA;  return(value)&#xA;}&#xA;&#xA;&#xA;&#xA;      tol = 1e-8  #set a value for the accuracy&#xA;      maxstep = 30 #set maximum number of steps to run for&#xA;      p =   c(1,2,3,4,5,6,7,8,9,10,11,12,13)                #for convenience p is set as 1-13&#xA;      #set q as population of NYC from 1810 to 1930&#xA;      q =   c(119734,152056,242278,391114,696115,1174779,1478103,1911698,2507414,3437202,4766883,5620048,6930446)&#xA;      a =   c(110000, 0.5) #set initial guess for P0 and r&#xA;      m =   length(p); #determine number of functions&#xA;      n =   length(a); #determine number of unkowns&#xA;      J = matrix(0,m,n)&#xA;      JT = matrix(0,n,m)&#xA;      r = numeric(13)&#xA;      aold = a;&#xA;      for (k in 1:maxstep){ #iterate through process&#xA;        S = 0;&#xA;        #k=1&#xA;        #i = 1&#xA;        #j = 2&#xA;        for (i in 1:m){&#xA;          for (j in 1:n){&#xA;              J[i,j] = df(p[i],q[i],a[1],a[2],j)  #calculate Jacobian&#xA;              JT[j,i] = J[i,j] #and its trnaspose&#xA;              J&#xA;              JT&#xA;            }&#xA;        }&#xA;&#xA;      Jz = -JT %*% J #multiply Jacobian and  negative transpose&#xA;      for (i in 1:m){&#xA;         r[i] = q[i] - a[1]*exp(a[2]*p[i]); #calculate r&#xA;          S = S + r[i]^2; #calculate the sum of the squares of the residuals&#xA;      }&#xA;&#xA;      g = solve(Jz)  %*% JT  #mulitply Jz inverse by J transpose&#xA;      a = aold-g*r  #calculate new approximation&#xA;      unknowns = a  #set w equal to most recent approximations of the unkowns&#xA;      #abs(a(1)-aold(1)) #calculate error&#xA;            if (abs(a[1]-aold[1]) &amp;lt;= tol){&#xA;              break #if less than tolerance break&#xA;            } &#xA;      aold = a  #set aold to a&#xA;      }&#xA;        steps = k&#xA;        f = unknowns[1]*exp( unknowns[2] * p  ) #determine the malthusian  approximation using P0 and r determined by Gauss-Newton method&#xA;        plot(p,q) #plot the measured population&#xA;        lines(p,f, type = 'l', col = &quot;red&quot;, main = &quot;Population of NYC 1810 to 1930&quot;, xlab = &quot;year&quot;, ylab = &quot;population&quot;) #plot the approximation&#xA;        title('Population of NYC 1810 to 1930') #set axis lables, title and legend&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is the R plot vs matlab plot in the pdf&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/hM9Qm.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/hM9Qm.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16923" LastEditorUserId="16923" LastEditDate="2015-10-20T15:18:14.580" LastActivityDate="2015-10-20T15:18:14.580" Title="What is wrong in my non-linear estimation sample code?" Tags="&lt;programming&gt;&lt;statistics&gt;&lt;regression&gt;&lt;normal-inverse-gaussian&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21320" PostTypeId="2" ParentId="21318" CreationDate="2015-10-20T01:23:02.533" Score="1" Body="&lt;p&gt;You should try to run both codes step by step and see what the differences are.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only thing that would justify different outputs would be if you're using some built-in functions by either software, which you don't seem to be doing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't have MATLAB available, you can try using Octave (which is kind of an open-source version of it and there is an online version &lt;a href=&quot;http://octave-online.net/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2015-10-20T01:23:02.533" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21321" PostTypeId="1" CreationDate="2015-10-20T03:04:45.857" Score="1" ViewCount="208" Body="&lt;p&gt;I was pricing a option with big dividend in the underlying. However, I got negative transition probability in a trinomial tree. &#xA;Will it cause arbitrage? Does anyone have reference paper or book chapter can share?Can anyone help? Thanks a lot.&#xA;Also can anyone share the paper?&#xA;Mayhew, S. On Estimating the Risk-Neutral Probability Distribution Implied by Option Prices.Working Paper, Purdue University, 1995.&lt;/p&gt;&#xA;" OwnerUserId="17952" LastActivityDate="2015-10-20T03:04:45.857" Title="negative transition probability in trinomial trees" Tags="&lt;binomial-tree&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21322" PostTypeId="1" AcceptedAnswerId="21328" CreationDate="2015-10-20T03:33:08.857" Score="4" ViewCount="257" Body="&lt;p&gt;Let's say that I have two correlated GBMs:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dA_t = A_t \sigma^A dW^A_t$$&#xA;$$dR_t = R_t \sigma^R dW^R_t$$&#xA;$$dW^R_t dW^A_t = \rho dt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to price a derivative which payoff at time $T$ is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Payoff}_T = (A_TR_T - A_T \lambda)^+ $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My idea was to apply Margrabe's &lt;a href=&quot;https://en.wikipedia.org/wiki/Margrabe%27s_formula&quot; rel=&quot;nofollow&quot;&gt;formula&lt;/a&gt;, but for this I need to formulate the two processes $X_t = A_t R_t$ and $Y_t = \lambda A_t$ as GBMs as well in order to find their respective volatilities and their correlation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first one is quite trivial:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dY_t = d(\lambda A_t) = \lambda dA_t + \frac{1}{2} 0 = \lambda A_t \sigma^A dW^A_t = dY_t \sigma^A dW^A_t$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is clearly a GBM and $\sigma_Y = \sigma^A$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I'm a struggling to express the second one, what I came up with so far is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align}&#xA;d(A_t R_t) &amp;amp; = &amp;amp; A_t dR_t + R_t dA_t + dA_tdR_t \\&#xA;&amp;amp; = &amp;amp; A_t R_t \sigma^R dW^R_t + A_t R_t \sigma^A dW^A_t + A_t R_t \sigma^R \sigma^A \underbrace{dW^A_t dW^R_t}_{\rho dt} \\&#xA;&amp;amp; = &amp;amp; A_t R_t \left[ \sigma^R dW^R_t + \sigma^A dW^A_t + \sigma^R \sigma^A \rho dt \right]&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this is where I'm stuck, I can't figure out how to express this as a &quot;simple&quot; GBM as it's quite clearly multivariate... Am I missing something?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way I can still use the Margrabe formula to price my option?&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2015-10-21T10:35:45.027" Title="What is the correlation between these two functions of GBMs?" Tags="&lt;options&gt;&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21324" PostTypeId="2" ParentId="21313" CreationDate="2015-10-20T06:15:02.947" Score="8" Body="&lt;p&gt;Stochastics are usually applied in the field of derivatives pricing. In this setting the task is to price a derivative such that it fits into the landscape of tradable instruments (no-arbitrage). We work using the risk-neutral measure - usually denoted by $Q$. The measure is derived from other traded instruments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In risk analysis (e.g. calculate the VaR, ES of this portfolio of stocks or credits) we work in the real world measure $P$. Usually $P$ is in some sense derived from history. This approach is rather statistical. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the answer is: because this are 2 connected but somehow quite different fields of (quantitative/financial) mathematics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One important EDIT: The GARCH approach tries to forecast volatility. This is doen by local volatility and stochastic volatility in the world of stochastic analysis/derivatives pricing. Still: GARCH is rather a P-thing (and it is calibrated on the past) and the others are Q-things (calibrated in the market).&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-10-20T11:59:10.480" LastActivityDate="2015-10-20T11:59:10.480" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21325" PostTypeId="2" ParentId="21299" CreationDate="2015-10-20T06:39:23.793" Score="3" Body="&lt;p&gt;You're actually pricing your call option with all known inputs here, so the fact that you need only $\delta$ and $\rho$ is just an analytical result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You use the greeks to take a Taylor &lt;a href=&quot;https://en.wikipedia.org/wiki/Taylor_series&quot; rel=&quot;nofollow&quot;&gt;approximation&lt;/a&gt; approach, where the goal is to estimate the value of the call if one of the input changes (the bigger the change the more greeks you'll need to estimate the change in call price accurately), but if the inputs stay the same, you then all the greeks are ignored anyway.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2015-10-20T06:39:23.793" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21326" PostTypeId="1" CreationDate="2015-10-20T07:11:26.527" Score="1" ViewCount="458" Body="&lt;p&gt;I have 5 years stock closing price of a company with some missing values in between (I having 1443 data points).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I create timeseries object in R with frequency 365 it creates 1834 data points, R is imputing these missing values for timeseries object but can anyone help me how it is imputing them? like what formula is used? Also if i don't want to impute these missing values is it possible in R?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;R command used:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;st_ts = ts(stocks[,2],start = c(2010,1),end = c(2015,9),frequency = 365) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/fjioo.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/fjioo.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/sDCrV.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/sDCrV.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17940" LastEditorUserId="17940" LastEditDate="2015-10-20T08:43:36.027" LastActivityDate="2015-10-20T08:43:36.027" Title="How to handle missing data in time series in R?" Tags="&lt;programming&gt;" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="21327" PostTypeId="2" ParentId="10672" CreationDate="2015-10-20T10:47:36.330" Score="3" Body="&lt;p&gt;I think Cholesky on correlation matrix is better because it makes code apply more generally in case we don't have full rank. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, suppose we want to simulate three correlated normals with covariance matrix &#xA;[[a^2,0,0],&#xA; [0,b^2,0],&#xA; [0,0,c^2]]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i.e. variables are uncorrelated and have vols a, b, and c. Because this is positive definite, we can do Cholesky no problem, with result also&#xA;[[a,0,0],&#xA; [0,b,0],&#xA; [0,0,c]]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if we get new data in telling us that b = c = 0, the Cholesky decomposition will fail because of non positive definiteness. Hence we'd need to modify our code to handle this case. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If however we'd done our coding in terms of a [diagonal] matrix S of volatilities and a correlation matrix K, we would perform Cholesky on K (to get matrix A say) and it would run fine even in zero volatility cases. The covariance matrix is the given by (SA)^2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The underlying reason is that a correlation matrix is positive definite whenever the covariance matrix is, but the converse is false. &lt;/p&gt;&#xA;" OwnerUserId="17956" LastActivityDate="2015-10-20T10:47:36.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21328" PostTypeId="2" ParentId="21322" CreationDate="2015-10-20T12:33:16.613" Score="2" Body="&lt;p&gt;Coming back to the line where you are stuck.&#xA;If we define &#xA;$$&#xA;Z_t = \sigma^A/\bar{\sigma} W_t^A + \sigma^R/\bar{\sigma} W_t^R,&#xA;$$&#xA;with $\bar{\sigma}^2 =  (\sigma^A)^2 + 2 \sigma^A \sigma^R \rho + (\sigma^R)^2$,&#xA;then $Z_t$ is a Brownian motion in its own filtration and the first and second moment are correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then we write your last line using $X_t = A_t R_t$ as&#xA;$$&#xA;dX_t = X_t (\bar{\sigma} dZ_t +  \sigma^A\sigma^R \rho dt),&#xA;$$&#xA;with the solution&#xA;$$&#xA;X_t = X_0 \exp((\sigma^A\sigma^R \rho - \bar{\sigma}^2/2) t + \bar{\sigma} Z_t),&#xA;$$&#xA;which is a GBM with (!) drift.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Magrabe's formula you need the covariance (vol times vol times correlation) of the two diffusion terms:&#xA;$$ \begin{eqnarray} &#xA;Cov(\bar{\sigma} Z_t, \lambda \sigma^A W^A_t) = Cov(\sigma^A W_t^A + \sigma^R W_t^R, \lambda \sigma^A W^A_t) &amp;amp;= \\&#xA;Cov(\sigma^A W_t^A,\lambda \sigma^A W^A_t) + Cov(\sigma^R W_t^R,\lambda \sigma^A W^A_t) &amp;amp;= \\&#xA;\sigma^A \lambda Cov(W_t^A,W_t^A) + \sigma^R \lambda \sigma^A Cov(W_t^R,W_t^A) &amp;amp;= \\&#xA;\sigma^A \lambda t + \sigma^R \lambda \sigma^A \rho t.&amp;amp;&#xA;\end{eqnarray} $$&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-10-21T10:35:45.027" LastActivityDate="2015-10-21T10:35:45.027" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21329" PostTypeId="1" CreationDate="2015-10-20T14:00:24.237" Score="2" ViewCount="91" Body="&lt;p&gt;I do some empirical research. I typically use regression analysis and panel data econometrics (with fixed effects).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually, when I include more variables, the initial variables of the model become less significant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, in a few cases, I see that one variable becomes even more significant when I include more variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is this happening? What is the interpretation of that? I suppose it has something with the correlation between the covariates and the residuals?&lt;/p&gt;&#xA;" OwnerUserId="15676" LastActivityDate="2015-10-21T01:37:08.193" Title="Variable becomes more significant when more variables are included" Tags="&lt;statistical-significance&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21330" PostTypeId="1" CreationDate="2015-10-20T14:46:52.473" Score="7" ViewCount="204" Body="&lt;p&gt;Given a standard brownian motion $W_t$ and defining $\tau$ as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\tau :=inf\{t\geq0:W_t=1$ or $W_t=-2\}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The proof below shows that the stopping time is finite:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P(\tau &amp;lt; t) \geq (|W_t|&amp;gt;2)\\$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$=1-P(|W_t| \leq 2)\\$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\geq1-4\frac{d}{dt}P(W_t \leq t)|_{t=0}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$=1-\frac{4}{\sqrt{2 \pi t}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\rightarrow 1$ as $t\rightarrow \infty$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's all staighforward except the line were the derivative is used:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\geq1-4\frac{d}{dt}P(W_t \leq t)|_{t=0}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does this line relate to the line above?&lt;/p&gt;&#xA;" OwnerUserId="7077" LastActivityDate="2015-10-21T08:58:05.857" Title="Proof that the stopping time for a Brownian Motion is finite for given target levels" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21336" PostTypeId="1" CreationDate="2015-10-20T20:48:28.307" Score="1" ViewCount="77" Body="&lt;p&gt;This is my first time posting on a Quant forum (or StackExchange in general), so bear with me. It might be the wrong place to post.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am a rising senior and I plan on majoring in finance and computer science in college. In my free time I have developed financial apps in Java (portfolio optimization using MPT, backtesting etc) but on this Quant forum there is plenty of math and models I dont know. I know a lot of the terms that are mentioned, so the vocabulary I understand (options, call, put, volatility, etc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do you suggest I get more involved with the math associated with this field? Math hasnt been my strongest field, but I want to learn these things. How do I start? Any advice is appreciated. Thanks!&lt;/p&gt;&#xA;" OwnerUserId="17963" LastActivityDate="2015-10-20T20:48:28.307" Title="Advice for college freshman?" Tags="&lt;education&gt;" AnswerCount="0" CommentCount="2" ClosedDate="2015-10-20T20:55:43.910" ContentLicense="CC BY-SA 3.0" />
  <row Id="21337" PostTypeId="2" ParentId="21330" CreationDate="2015-10-20T21:11:17.467" Score="5" Body="&lt;p&gt;I think all they are doing is integrating and estimating&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P(|W_t| \leq 2) = \int_{-2}^{2} \frac{d}{dr} P(W_t \leq r) dr &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so &#xA;$$&#xA;P(|W_t| \leq 2) \leq 4 \sup \limits_{r \in [-2,2]} \frac{d}{dr}P(W_t \leq r) &#xA;$$&#xA;The normal density is maximal at zero and we are done.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastEditorUserId="1809" LastEditDate="2015-10-21T08:58:05.857" LastActivityDate="2015-10-21T08:58:05.857" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21338" PostTypeId="2" ParentId="21329" CreationDate="2015-10-20T22:07:27.200" Score="4" Body="&lt;p&gt;A Change in the statistical significance of a variable when more variables are included can come from two sources.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One is the fact that the estimate of the coefficient becomes larger when new variables are included. This can happen when the newly included variables are negatively correlated with the variable of interest and contribute positively to the depend variable. So essentially, you have an omitted variable bias that bias upwards your original estimates. You are wrongly contributing the negative effect of the omitted variable on the dependent variable to the variable included. Provided that the variance of the model doesn't increase much, your t-stat, $\frac{\beta}{std err}$, will increase, and thus you see a change in your statistical significance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another possible reason is that the newly included variables don't correlate with the variable of interest, but it reduces the model variance (an imporvement of Rsquare). This will help reduce your estimation uncertainty and thus lower the standard error of your estimate. Again, provided that the estimate doesn't change much, you will see an improvement in your t-stat.&lt;/p&gt;&#xA;" OwnerUserId="6804" LastEditorUserId="6804" LastEditDate="2015-10-21T01:37:08.193" LastActivityDate="2015-10-21T01:37:08.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21339" PostTypeId="1" CreationDate="2015-10-21T01:16:40.760" Score="2" ViewCount="455" Body="&lt;p&gt;Let's start out with the CAPM equation itself:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E(R_i) = R_{f1} + \beta_{i}(E(R_m) - R_{f2})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there cases where one should choose a different $R_{f1}$ and $R_{f2}$ (Risk Free Rates Of Interest) or do they always have to be equal?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And what if I had to opt for the Swiss government bonds that now have a negative yield (-0.21%)? Should I just take the mean value over the last 10 years and use this mean value as my $R_{f1}$ &amp;amp; $R_{f2}$? And does it matter what kind of bond yield data (daily, weekly, monthly, yearly) I choose for the &quot;last 10 years&quot;?&lt;/p&gt;&#xA;" OwnerUserId="17857" LastActivityDate="2019-05-17T09:01:55.580" Title="Risk-Free Rate In CAPM" Tags="&lt;capm&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21340" PostTypeId="1" CreationDate="2015-10-21T06:28:34.613" Score="2" ViewCount="161" Body="&lt;p&gt;Let's say we have an 11-year off-the-run Treasury bond, but we only have access to on-the-run Treasury bonds. How do we hedge?&lt;/p&gt;&#xA;" OwnerUserId="17966" LastActivityDate="2015-10-21T08:11:25.710" Title="How to hedge an off-the-run bond?" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;hedging&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21341" PostTypeId="1" AcceptedAnswerId="21347" CreationDate="2015-10-21T06:51:13.807" Score="2" ViewCount="248" Body="&lt;p&gt;When we say Bond prices are martingale under T-Forward measure, do we mean their Clean Price is a martingale or is it their dirty price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess it should be dirty price, as clean price is just a convenient representation while dirty price is the actual price of the bond. But it will be great if somebody could please validate/invalidate my thoughts.&lt;/p&gt;&#xA;" OwnerUserId="7117" LastEditorUserId="467" LastEditDate="2015-10-22T01:11:57.923" LastActivityDate="2015-10-22T01:11:57.923" Title="Is a bond expiring at $T$ clean or dirty price a martingale under the $T$-Forward measure?" Tags="&lt;stochastic-calculus&gt;&lt;bond&gt;&lt;martingale&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21342" PostTypeId="2" ParentId="21340" CreationDate="2015-10-21T08:11:25.710" Score="3" Body="&lt;p&gt;As the manager of a mutual fund (not a hedge fund) you can only short treasury futures. So you take the one that is clostest in duration, look for an optimal hedge ratio and that's it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my experience you have to leave liquidity risk open.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-10-21T08:11:25.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21343" PostTypeId="2" ParentId="21115" CreationDate="2015-10-21T11:48:54.240" Score="3" Body="&lt;p&gt;At first sight, I'd say it's ok. You'll have to let the constructor of your process class take the maturity time, so you can create different instances with different $T$.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2015-10-21T11:48:54.240" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21344" PostTypeId="1" CreationDate="2015-10-21T12:33:30.090" Score="1" ViewCount="248" Body="&lt;p&gt;Code under is taken from &lt;a href=&quot;http://en.literateprograms.org/Monte_Carlo_simulation_(Matlab)&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://en.literateprograms.org/Monte_Carlo_simulation_(Matlab)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;nT  = ceil(T/step);&#xA;[s,c] = cov2corr(sigma);&#xA;s   = s * sqrt(step);&#xA;sigma = corr2cov(s,c);&#xA;Sd  = chol(sigma);&#xA;dW  = randn(nT,length(S0)*nb_traj);&#xA;Sd  = repmat({Sd},1,nb_traj);&#xA;Sdb = blkdiag(Sd{:});&#xA;dWc = dW * Sdb;&#xA;c   = repmat(1+mu*step, nT, nb_traj);&#xA;S   = [repmat(S0, 1, nb_traj); repmat(S0, nT, nb_traj) .* cumprod(c + dWc)];&#xA;S   = reshape(S, [nT+1, size(S0,2), nb_traj]);&#xA;if nargout &amp;gt; 1&#xA;   t = [0;step * (1:nT)'];&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But that code won't work. MATLAB is just crashing. &#xA;I need to simulate multiple paths for multifractal brownian motion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/77oQi.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/77oQi.png&quot; alt=&quot;A more generic Monte Carlo&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any code supporting this formula? Thank you))&lt;/p&gt;&#xA;" OwnerUserId="17971" LastEditorUserId="17971" LastEditDate="2015-10-21T13:49:31.813" LastActivityDate="2015-10-21T13:49:31.813" Title="Monte Carlo simulation of Multifractional Brownian Motion in MATLAB" Tags="&lt;monte-carlo&gt;&lt;brownian-motion&gt;&lt;matlab&gt;&lt;fractals&gt;&lt;codes&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21345" PostTypeId="1" AcceptedAnswerId="21392" CreationDate="2015-10-21T13:22:09.897" Score="3" ViewCount="330" Body="&lt;p&gt;I'm trying to implement a Monte Carlo PricingEngine that stores multidimensional statistics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have done the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Defined a Monte Carlo Trait that among other things stores as the &lt;strong&gt;path_pricer_type&lt;/strong&gt; &lt;code&gt;PathPricer&amp;lt;MultiPath,Array&amp;gt;&lt;/code&gt; (my process is one dimensional but has 2 factors). let's call this struct &lt;strong&gt;MyMCTrait&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Implemented a class that derives from both &lt;code&gt;McSimulation&amp;lt;MyMCTrait,PseudoRandom,SequenceStatistics&amp;gt;&lt;/code&gt; and &lt;code&gt;VanillaOption::engine&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Implemented a &lt;code&gt;PathPricer&amp;lt;MultiPath,Array&amp;gt;&lt;/code&gt; in which the first element of the Array returned by the operator() is the price of the option.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I'm getting compiling errors because in methods value() and valueWithSamples() of class McSimulation we have the following initializations:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a. &lt;code&gt;result_type(mcModel_-&amp;gt;sampleAccumulator().mean());&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b. &lt;code&gt;result_type error(mcModel_-&amp;gt;sampleAccumulator().errorEstimate());&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;that are trying to cast from &lt;code&gt;std::vector&amp;lt;Real&amp;gt;&lt;/code&gt; (returned by the SequenceStatistics methods) to Array (result_type).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I doubt that the right way to go is to implement the cast (if it's possible), could anyone point me to the right direction? Thanks.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;EDIT&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I got the Pricing Engine working by using a derived class from &lt;code&gt;SequenceStatistics&lt;/code&gt;. I just overrode the inspectors mean() and errorEstimate() and made them return an Array. To do this I used the base class methods + the Array constructor that takes begin and end iterators.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;I'm still wondering though if this is the right way to proceed. Thanks for any thoughts.&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="17408" LastEditorUserId="17408" LastEditDate="2015-10-22T10:03:33.427" LastActivityDate="2015-10-23T09:24:17.113" Title="QuantLib C++: Monte Carlo Engine with SequenceStatistics" Tags="&lt;programming&gt;&lt;monte-carlo&gt;&lt;quantlib&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21346" PostTypeId="1" AcceptedAnswerId="21349" CreationDate="2015-10-21T15:24:55.893" Score="1" ViewCount="4717" Body="&lt;p&gt;If we calculate the par rate for n periods, why does the nth swap rate equal the par rate? A mathematical formulation would be helpful apart from an intuitive answer.  &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Edit: Example:- A 2 year bond pays semiannual coupons and has a par value of $100.  &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;Swap Rates&lt;/strong&gt;- &lt;em&gt;0.65% (0.5year), 0.8% (1year), 1.02% (1.5 years), 1.16% (2years)&lt;/em&gt;.  &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Computing &lt;strong&gt;discount rates&lt;/strong&gt; from this gives- &lt;em&gt;0.9968, 0.9920, 0.9848, 0.977&lt;/em&gt;  respectively.   &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Now the par rate would be -&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$Par/2 * [(d(0.5)+d(1.0)+d(1.5)+d(1.5)+d(2.0)] + 100 * d(2.0) = 100$&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Gives &#xA;  &lt;em&gt;par = 1.16%&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="17973" LastEditorUserId="17973" LastEditDate="2015-10-21T17:41:07.667" LastActivityDate="2015-10-21T18:29:50.887" Title="Swap Rate vs Par Rate" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;swaps&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21347" PostTypeId="2" ParentId="21341" CreationDate="2015-10-21T15:36:37.953" Score="4" Body="&lt;p&gt;Your question is not really clear. Why do you need the bond price to be a martingale under the $T$-forward measure? The $T$-forward measure is used mainly for modelling the LIBOR rate. Note that, the bond price itself is not a martingale; instead, the bond price relative to the $T$-maturity zero coupon bond price is a martingale. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a coupon bond, it does not matter whether it is a clean price or dirty price, as the coupon is a known quantity in either case. &lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-10-21T17:51:43.660" LastActivityDate="2015-10-21T17:51:43.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21349" PostTypeId="2" ParentId="21346" CreationDate="2015-10-21T17:40:28.490" Score="3" Body="&lt;p&gt;Since your 2-year bond is at par, the fixed coupon payments over the 2 years match the payments in the fixed leg of the 2-year swap exactly.  Hence the par rate of the bond is the same as the par swap rate.&lt;/p&gt;&#xA;" OwnerUserId="3188" LastEditorUserId="3188" LastEditDate="2015-10-21T18:29:50.887" LastActivityDate="2015-10-21T18:29:50.887" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21351" PostTypeId="1" CreationDate="2015-10-21T17:54:22.870" Score="1" ViewCount="227" Body="&lt;p&gt;I am trying to determine which quantitative model to try and build a predictive model for the next day's closing price for all the S&amp;amp;P stocks based on their bar for &lt;strong&gt;that particular day&lt;/strong&gt;. However, I am not sure how to think about this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've previously used historical data to try and predict closing prices, which would be far easier. Over here, I am thinking I can assume the stocks follow a lognormal distribution and I can then try and determine the parameters of this distribution based off of the bar and eventually use a Monte Carlo Simulation, where I randomly sample from this Lognormal to get the closing price for each stock. Does this sound okay? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: I've rethought the problem and now approaching it as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to find closing price using the equation below:&#xA;$ClosingPrice_{t}=alpha1∗OpeningPrice_{t}+alpha2∗HighPrice_{t}+alpha3∗LowPrice_{t}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where each of the variables opening price, the Highest value and lowest value are modelled by their own ARIMA Time-Series, as is commonly used to model stock prices. However, for the model to determine closing price I plan on using a Ride Regression as I suspect there will be multicollinearity between some of these variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this model make sense?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks &lt;/p&gt;&#xA;" OwnerUserId="11917" LastEditorUserId="11917" LastEditDate="2015-10-25T04:30:36.423" LastActivityDate="2015-10-25T04:30:36.423" Title="Building predictive model for closing price using only previous days data" Tags="&lt;time-series&gt;&lt;equities&gt;&lt;prediction&gt;" AnswerCount="1" CommentCount="11" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21352" PostTypeId="1" AcceptedAnswerId="21432" CreationDate="2015-10-21T18:02:36.647" Score="5" ViewCount="1451" Body="&lt;p&gt;I want to implement the shrinkage intensity given by Ledoit and Wolf, see &lt;a href=&quot;http://www.google.ch/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0CCIQFjAAahUKEwj1_M6okNTIAhVLWT4KHRp9BG4&amp;amp;url=http%3A%2F%2Fwww.ledoit.net%2Fhoney.pdf&amp;amp;usg=AFQjCNHfL9Xy38qWLTs_9ClJTzpxHRnkHw&amp;amp;sig2=yLAyJUYZkCVCMoB793Am4w&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; page 13. They define $y_{it}$ with $1\le i\le N$ and $1\le t\le t$ be the return on stock $i$ at time $t$. Moreover, $z_i:=\bar{y}_i:=\frac{1}{T}\sum_{t=1}^Ty_{it}$ the mean estimator of the $i$-th stock. &#xA;As they explain the optimal shrinkage intensity estimator is given by (for simplicity I drop the hat notation)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\kappa = \frac{\pi-\rho}{\gamma}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a question about the implementation of $\pi$. They define&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\pi_{ij} = \frac{1}{T}\sum_{t=1}^T((y_{it}-z_i)(y_{jt}-z_j)-s_{ij})^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wanted to implement this in a efficient way. The package 'tawny' has a preimplemented function of this. I checked the source code, which can be found &lt;a href=&quot;https://cran.r-project.org/src/contrib/tawny_2.1.2.tar.gz&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; in the file shrinkage.R. They use (I copy):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Sum of the asymptotic variances&#xA;# returns : T x N (zoo) - Matrix of asset returns&#xA;# sample : N x N - Sample covariance matrix&#xA;# Used internally.&#xA;# S &amp;lt;- cov.sample(ys)&#xA;# ys.p &amp;lt;- shrinkage.p(ys, S)&#xA;shrinkage.p &amp;lt;- function(returns, sample)&#xA;{&#xA;  T &amp;lt;- nrow(returns)&#xA;  N &amp;lt;- ncol(returns)&#xA;  ones &amp;lt;- rep(1,T)&#xA;  means &amp;lt;- t(returns) %*% ones / T&#xA;  z &amp;lt;- returns - matrix(rep(t(means), T), ncol=N, byrow=TRUE)&#xA;&#xA;  term.1 &amp;lt;- t(z^2) %*% z^2&#xA;  term.2 &amp;lt;- 2 * sample * (t(z) %*% z)&#xA;  term.3 &amp;lt;- sample^2&#xA;  phi.mat &amp;lt;- (term.1 - term.2 + term.3) / T&#xA;&#xA;  phi &amp;lt;- list()&#xA;  phi$sum &amp;lt;- sum(phi.mat)&#xA;      phi$diags &amp;lt;- diag(phi.mat)&#xA;  phi&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The input is the transposed $y$ as they define it to be a $T\times N$ matrix. &#xA;Their final output I'm interested in is the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;phi.mat &amp;lt;- (term.1 - term.2 + term.3) / T&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If their code works properly (which for sure it does) its true that $(i,j)$ entry of &lt;code&gt;phi.mat&lt;/code&gt; is equal $\pi_{i,j}$. However, this is the point I cant figure out why this is true. Since in &lt;code&gt;R&lt;/code&gt; addition / subtraction of matrices is elementwise it should be true that &lt;code&gt;term.1&lt;/code&gt; is equal to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sum_{t=1}^T(y_{it}-z_i)^2(y_{jt}-z_j)^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;code&gt;term.2&lt;/code&gt; equal to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$2\sum_{t=1}^T(y_{it}-z_i)(y_{jt}-z_j)s_{ij}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and last &lt;code&gt;term.3&lt;/code&gt; equal to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sum_{t=1}^T s_{ij}^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand &lt;code&gt;term.3&lt;/code&gt;. However, &lt;code&gt;term.1&lt;/code&gt; and &lt;code&gt;term.2&lt;/code&gt; are not that clear to me. I guess understanding one of them will help me understand the other. So lets focus on &lt;code&gt;term.1&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt; Why is it true that $(i,j)$ entry of their code &lt;code&gt;term.1&lt;/code&gt; is equal to $\sum_{t=1}^T(y_{it}-z_i)^2(y_{jt}-z_j)^2$? Isn't the matrix product, which they suggest, equal to&lt;br&gt;&#xA;  $$\sum_{t=1}^T(y_{it}-z_i)(y_{tj}-z_j)$$ &#xA;  and the matrix of returns is clearly not symmetric? &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="17133" LastEditorUserId="17133" LastEditDate="2015-10-23T20:34:45.527" LastActivityDate="2015-10-25T23:56:37.907" Title="Implementation of Ledoit Wolf shrinkage estimator within R package tawny" Tags="&lt;programming&gt;&lt;covariance-estimation&gt;" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21353" PostTypeId="1" AcceptedAnswerId="21356" CreationDate="2015-10-21T19:10:56.697" Score="2" ViewCount="129" Body="&lt;p&gt;To what extent may the interest rate models be applied for modeling implied volatity?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The story:&lt;/strong&gt;&#xA;I was checking different stochastic option pricing models for being able to replicate implied volatility term strucure (namely its hump shape). While doing that, it came to my mind that interest rate term structure is roughthly the same thing:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interest rate TS:&#xA;$\frac{1}{h} E^P \int\limits_t^{t+h}r_t dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Volatility TS:&#xA;$\frac{1}{h} E^Q \int_t\limits^{t+h}\sigma_t^2 dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where P is a physical measure, Q - risk-neutral measure and volatility is derived from some option pricing model, for instance, Heston (under risk-neutral measure):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS_t = rS_tdt + \sigma_t S_t dW_t^r$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d\sigma_t^2 = \kappa (\theta - \sigma_t^2) dt + \zeta \sigma_t dW_t^\sigma$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While conceptually interest rate and volatility of asset price are different things, they apper to be just the same thing in analytical sence. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The question:&lt;/strong&gt;&#xA;So the question arises: to what extent can we use interest rate models for modeling implied volatity?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Techically what I'm up to is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We need a model for underlying asset which will perform hump shape in implied volatility term-structure?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just take the interest rate model which allows for a hump in a yield curve, write $\sigma^2$ instead of $r$ and we're done.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Motivation:&lt;/strong&gt;&#xA;I thought that checking various option pricing models for being able to generate humps in TS was a smart research idea for my master thesis (it appeared to that there is a lack of literature on this topic). But if the results for interest rate models may be easily applied for volatility what I'm doing is futile since a bunch of literature exists on replicating all kinds of yield curves (hump, tilt etc). &lt;/p&gt;&#xA;" OwnerUserId="17976" LastActivityDate="2015-10-21T20:18:52.157" Title="Applying interest rate models for volaility rate" Tags="&lt;option-pricing&gt;&lt;interest-rates&gt;&lt;implied-volatility&gt;&lt;stochastic-volatility&gt;&lt;term-structure&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21354" PostTypeId="1" CreationDate="2015-10-21T19:14:53.527" Score="4" ViewCount="161" Body="&lt;p&gt;I've read that RAROC is used to set economic capital requirements for different products, projects, business lines etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it just a matter of solving for the required economic capital level to obtain a desired risk adjusted return on capital with a given risk adjusted return or is there more to it? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$RAROC = \frac{Risk\ adjusted \ return}{Economic\ Capital}$&lt;/p&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="12089" LastEditDate="2015-10-22T10:30:54.317" LastActivityDate="2016-02-19T11:46:54.977" Title="How does RAROC identify capital requirements?" Tags="&lt;risk&gt;&lt;returns&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21355" PostTypeId="1" AcceptedAnswerId="21376" CreationDate="2015-10-21T19:42:59.677" Score="3" ViewCount="327" Body="&lt;p&gt;I'm trying to understand how CFD works. I have question about market maker.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Who is market maker for CFD? Is it a company which provide a trading platform or any stock exchange?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT01&lt;/strong&gt; @noob2 thanks for your answer. I have another question: what is the underlying security for indices CFDs?&lt;/p&gt;&#xA;" OwnerUserId="17424" LastEditorUserId="17424" LastEditDate="2015-10-23T19:36:22.810" LastActivityDate="2020-03-31T07:57:38.743" Title="CFD - how does it work?" Tags="&lt;cfd&gt;" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21356" PostTypeId="2" ParentId="21353" CreationDate="2015-10-21T20:18:52.157" Score="2" Body="&lt;p&gt;&lt;a href=&quot;http://www.quantitative-research.de/&quot; rel=&quot;nofollow&quot;&gt;Hans Buehler&lt;/a&gt; investigated this in some detail, including in his &lt;a href=&quot;http://www.quantitative-research.de/dl/HansBuehlerDiss.pdf&quot; rel=&quot;nofollow&quot;&gt;doctoral thesis&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I tried it out some years ago, back when volatility exotics were more liquid, I found the models nearly impossible to calibrate to my satisfaction, even for the SP500 complex.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the mathematical analogy is fair, and enjoyed Buehler's work, but in practice it won't work because the way we approach interest rate modeling tends to depend on liquidity in the basic bonds that does not appear in options and volatility derivatives. &lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2015-10-21T20:18:52.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21357" PostTypeId="2" ParentId="21352" CreationDate="2015-10-21T22:08:30.303" Score="-1" Body="&lt;p&gt;I believe the &quot;^2&quot; operation is performed element by element in this instance. The matrix square in R is ... um... different. Memory fails me on the exact notation.&lt;/p&gt;&#xA;" OwnerUserId="11767" LastActivityDate="2015-10-21T22:08:30.303" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21358" PostTypeId="2" ParentId="21341" CreationDate="2015-10-21T23:30:32.257" Score="1" Body="&lt;p&gt;Gordon has the correct answer. When you talk about a certain measure, it is associated with a certain numeraire. In this case, it is the zero coupon bond that matures at T. So the bond price is denoted in terms of this numeraire. To price a bond with coupon, you should price it as two parts: (a) the principal to be repaid at maturity, this is equivalent to a zero coupon bond. (b) Every single coupons up to maturity, you should price them separately. At the end, when you sum these together, you will get the time 0 price of the bond.&lt;/p&gt;&#xA;" OwnerUserId="6804" LastActivityDate="2015-10-21T23:30:32.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21360" PostTypeId="2" ParentId="21341" CreationDate="2015-10-22T00:14:04.577" Score="1" Body="&lt;p&gt;The answer is neither. An asset by itself &lt;strong&gt;should not&lt;/strong&gt; be a martingale, it's the asset relative to some other tradable asset a martingale. Martingale is a mathematical concept to compare an asset relative to something else; for example, you would be comparing against the cash account in risk-neutral. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, the T-forward measure is usually used for LIBOR rates because by definition each LIBOR rate can be easily be turned into a T-forward measure (check the definition yourself and you will see).&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2015-10-22T00:14:04.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21361" PostTypeId="1" AcceptedAnswerId="21375" CreationDate="2015-10-22T01:09:52.827" Score="11" ViewCount="1096" Body="&lt;p&gt;I recently asked this &lt;a href=&quot;https://quant.stackexchange.com/questions/21322/what-is-the-correlation-between-these-two-functions-of-gbms&quot;&gt;question&lt;/a&gt; regarding how to price an option with payoff:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Payoff}_T = (A_TR_T - A_T \lambda)^+ $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's assume for generality that $A_t$ and $R_t$ are GMB's:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dA_t = \mu_{A,t} A_t dt + \sigma_{A,t} A_t dW_{A,t}$$ &#xA;$$dR_t = \mu_{R,t} R_t dt + \sigma_{R,t} R_t dW_{R,t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This &lt;a href=&quot;https://quant.stackexchange.com/questions/21322/what-is-the-correlation-between-these-two-functions-of-gbms?noredirect=1#comment30347_21322&quot;&gt;comment&lt;/a&gt; mentioned that because the payoff can be seen as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Payoff}_T = A_T(R_T - \lambda)^+ $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;we could use a change of numeraire approach to price it with Black's formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not really familiar with this method, could somebody show me how it would work?&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2015-10-23T02:20:12.827" Title="How to use a change of numeraire to price this option?" Tags="&lt;options&gt;&lt;numerairechange&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="21362" PostTypeId="1" CreationDate="2015-10-22T01:18:18.720" Score="4" ViewCount="761" Body="&lt;p&gt;Reading a Basel paper on recommendations on internal economic capital models. One of the recommendations says members of the bank's board should be able to demonstrate understanding of the difference between &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;gross (stand alone) and net enterprise wide (diversified) risk when&#xA;  they define and communicate measures of the bank’s risk appetite on a&#xA;  net basis&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; Are they talking about a diversification benefit when aggregating risks firm wide ? &#xA;(Also, I'm not sure if the terms are gross enterprise wide risk and net enterprise wide risk or gross risk and net enterprise wide risk)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The paper is &lt;a href=&quot;http://www.bis.org/publ/bcbs152.pdf&quot; rel=&quot;nofollow&quot;&gt;Range of practices and issues in economic capital frameworks&lt;/a&gt;, and below is the whole paragraph:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Use of economic capital models in assessing capital adequacy . A bank&#xA;  using  an economic capital model in its dialogue with supervisors,&#xA;  should be able to  demonstrate how the economic capital model  has&#xA;  been integrated into the business  decision making process in order to&#xA;  assess its potential impact on the incentives  affecting the bank’s&#xA;  strategic decisions about the mix and direction of inherent risks. &#xA;  The bank’s board of directors should also be able to demonstrate&#xA;  conceptual  awareness and understanding of the gap between gross&#xA;  (stand alone) and net  enterprise wide (diversified) risk when they&#xA;  define and communicate measures of  the bank’s risk appetite on a net&#xA;  basis.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="9265" LastEditDate="2015-10-22T15:25:35.670" LastActivityDate="2015-10-22T15:25:35.670" Title="What is the difference between gross and net enterprise wide risk?" Tags="&lt;risk&gt;&lt;basel&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21364" PostTypeId="1" CreationDate="2015-10-22T03:41:04.287" Score="1" ViewCount="53" Body="&lt;p&gt;When I study the forward contract, I read that the forward price must be the price that makes the the value of the contract zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I searched for the answer, but there are many versions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some say it is because the assumption that the information is available to all, so the buyers and the sellers must be indifferent of whether long or short the contract.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some say it is because of the no-arbitrage principle. But I still cannot fully understand it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why cannot two people sign a forward contract, one pays another some money while setting the forward price?&lt;/p&gt;&#xA;" OwnerUserId="17980" LastEditorUserId="467" LastEditDate="2015-10-22T04:22:52.790" LastActivityDate="2015-10-22T04:22:52.790" Title="Why is the forward price set to make the value of the forward contract to 0 when it is signed?" Tags="&lt;pricing&gt;&lt;forward&gt;" AnswerCount="0" CommentCount="1" ClosedDate="2015-10-22T04:26:15.297" ContentLicense="CC BY-SA 3.0" />
  <row Id="21365" PostTypeId="2" ParentId="21354" CreationDate="2015-10-22T06:22:29.293" Score="1" Body="&lt;p&gt;Raroc is a risk based profitability measure. As you pointed out the connection to Basel is the use of the Capital.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I know, in many banks it is used for steering of the yearly capital allocation. However, I believe that in the near future(see Basel 4) it will become more important to directly steer with economic capital. &lt;/p&gt;&#xA;" OwnerUserId="5414" LastActivityDate="2015-10-22T06:22:29.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21366" PostTypeId="1" AcceptedAnswerId="21408" CreationDate="2015-10-22T07:06:54.637" Score="3" ViewCount="1067" Body="&lt;p&gt;Why is the US 30 day t bill traditionally used as a risk free rate instead of Euro bonds for example? They are both not going to default surely?&lt;/p&gt;&#xA;" OwnerUserId="6661" LastActivityDate="2015-10-24T16:15:39.833" Title="Risk free rate proxy" Tags="&lt;risk-free&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21367" PostTypeId="1" CreationDate="2015-10-22T07:23:42.540" Score="1" ViewCount="84" Body="&lt;p&gt;I'm looking at example 2 here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://fxtrade.oanda.ca/analysis/profit-calculator/how&quot; rel=&quot;nofollow&quot;&gt;http://fxtrade.oanda.ca/analysis/profit-calculator/how&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;You see that the rate for USD/JPY is 115.00/05 and decide to buy 10,000 USD. &#xA;Your trade is executed at 115.05.&#xA;10,000 USD*115.05= 1,150,500 JPY&#xA;You bought 10,000 USD and sold 1,150,500 JPY.&#xA;The market rate of USD/JPY falls to 114.45/50. &#xA;You decide to sell back 10,000 USD at 114.45.&#xA;10,000 USD*114.45=1,144,500 JPY&#xA;You bought 10,000 USD for 1,150,500 JPY and sold 10,000 USD back for 1,144,500 JPY. &#xA;The difference is your loss and is calculated as follows: &#xA;1,150,500-1,144,500= 6,000 JPY. &#xA;Note that your loss is in JPY and must be converted back to dollars.&#xA;To calculate this amount in USD:&#xA;6,000 JPY/ 114.45 = $52.42 USD or &#xA;    6,000 *1/114.45=$52.42&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For the 6000 JPY loss we are dividing by the market bid, correct? What I don't quite understand is why it's not the ask. I verified this is how it works in fxtrade, but I just don't quite understand why. Aren't you trying to buy back USD and sell JPY? To do that, don't you need to use the market sale/ask price of USD/JPY?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I tried this with a different type of pair, like EUR_AUD and AUD_USD. Let's say I end up with a profit of 1000 AUD. There, I divide by 1 / (ask price of the AUD_USD) .. Correct? I'm not sure I understand why this one is different, ie, why it's the market ASK now and not the BID price for AUD_USD&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have an explanation or links that might explain this further? Thanks!!&lt;/p&gt;&#xA;" OwnerUserId="17088" LastActivityDate="2015-12-12T10:39:17.657" Title="Trying to understand how to convert profit to home currency" Tags="&lt;fx&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21368" PostTypeId="2" ParentId="21366" CreationDate="2015-10-22T09:09:56.763" Score="1" Body="&lt;p&gt;Is a proxy. &#xA;Depending on what you are calculating and your considerations. &#xA;If you are calculating something in EUR and in Europe you might want to use the German bond. It just depends on your own criteria. &lt;/p&gt;&#xA;" OwnerUserId="12089" LastActivityDate="2015-10-22T09:09:56.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21369" PostTypeId="2" ParentId="21367" CreationDate="2015-10-22T09:13:38.000" Score="0" Body="&lt;p&gt;In this case, they are not considering bid or ask (reading the original webpage).&#xA;But they are considering the actual FX rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They are converting the losses with the ACTUAL rate, that's why they are taking 114.5.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there is a bid ask spread, and you want to exchange your currency, there is a trick. They will always take the most advantageous rate, so just calculate both, and you will obtain the worse.&lt;/p&gt;&#xA;" OwnerUserId="12089" LastActivityDate="2015-10-22T09:13:38.000" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21370" PostTypeId="1" AcceptedAnswerId="21420" CreationDate="2015-10-22T10:02:12.923" Score="3" ViewCount="277" Body="&lt;p&gt;I am new to finance and valuation in particular. I have a query regarding discounting dividends and terminal value for valuation using dividend discount model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have created an illustration to help in understanding how many years do we have to discount to find the total equity (which is then divided by number of shares to find the value of share)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose I wish to value the firm for 1)Today 2) FYE2015 3) FYE2016 4) FYE 2017 with reference to the image below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/rUlbI.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/rUlbI.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you tell me if my understanding is correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) TODAY:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x/(1+r) + y/(1+r)^2 + z/(1+r)^3 + TV/(1+r)^3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;2) FYE2015&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;y/(1+r) + z/(1+r)^2 + TV/(1+r)^2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;3) FYE 2016&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;z/(1+r) + TV/(1+r)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;4)FYE 2017&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;TV&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If this is incorrect, then what should it be?&lt;/p&gt;&#xA;" OwnerUserId="17981" LastActivityDate="2015-10-25T10:00:03.657" Title="Discounting dividends and terminal value in valuation" Tags="&lt;valuation&gt;&lt;dividends&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21371" PostTypeId="1" AcceptedAnswerId="21390" CreationDate="2015-10-22T10:51:14.607" Score="2" ViewCount="826" Body="&lt;p&gt;It is never optimal to exercise an american call option early if it is written on a stock that doesn't pay dividends, yet when pricing such an option, using a binomial model, we check whether or not it is optimal to exercise at each node. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I find it strange that it is never optimal to exercise early yet we take into account in its price the payoff from exercising early.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know a good argument to explain this? Consider the following example of a call option&#xA;&lt;a href=&quot;https://i.stack.imgur.com/EX0SQ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/EX0SQ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;it is clearly optimal to exercise early everywhere, so it implicit in the question that the stock underlying the option pays dividends?&lt;/p&gt;&#xA;" OwnerUserId="8105" LastEditorUserId="8105" LastEditDate="2015-10-23T02:48:05.363" LastActivityDate="2015-10-23T03:23:42.123" Title="pricing american calls on non dividend paying stocks" Tags="&lt;american-options&gt;&lt;binomial-tree&gt;&lt;call&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21372" PostTypeId="1" AcceptedAnswerId="21395" CreationDate="2015-10-22T12:02:10.273" Score="3" ViewCount="787" Body="&lt;p&gt;I just started working on the Black Scholes formula with help of the book Financial option valuation by Higham. Apparently you are possible to derive the following function:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\log(\frac{SN'(d_1)}{e^{-r(T-t)}EN'(d_2)}) = 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the Black scholes formula:&lt;br&gt;&#xA;$C(S,t)=SN(d_1)-Ee^{-r(T-t)}N(d_2)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been puzzling arround but I'm stuck. This is where I came so far, do you know where I'm going wrong?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\log(\frac{SN'(d_1)}{e^{-r(T-t)}EN'(d_2)}) = \log(SN'(d_1))-\log(e^{-r(T-t)}EN'(d_2))=0$&lt;/p&gt;&#xA;" OwnerUserId="17778" LastActivityDate="2015-10-23T14:56:03.023" Title="Verifying an identity of an equation for Black Scholes formula" Tags="&lt;black-scholes&gt;&lt;calculation&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21373" PostTypeId="2" ParentId="162" CreationDate="2015-10-22T12:51:41.340" Score="0" Body="&lt;p&gt;Appropriately, heterogeneity of approaches has been discussed. But one facet that may bear emphasis is the individual firm's transactions costs. To compete as a market maker, is it would seem paramount to have a edge here. Moreover, some exchanges seem to choose their champions, and it would be best to be among them. &lt;/p&gt;&#xA;" OwnerUserId="11767" LastActivityDate="2015-10-22T12:51:41.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21374" PostTypeId="2" ParentId="21367" CreationDate="2015-10-22T13:00:17.767" Score="1" Body="&lt;p&gt;Ah, it was a dumb question.   The 6000 JPY is a loss so I have to buy the JPY back, so I'm selling the USD/JPY and using the bid price.&lt;/p&gt;&#xA;" OwnerUserId="17088" LastActivityDate="2015-10-22T13:00:17.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21375" PostTypeId="2" ParentId="21361" CreationDate="2015-10-22T13:26:30.383" Score="7" Body="&lt;p&gt;Note: your previous &lt;a href=&quot;https://quant.stackexchange.com/questions/21322/what-is-the-correlation-between-these-two-functions-of-gbms&quot;&gt;question&lt;/a&gt; assumed log-normality instead of normality. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By Cholesky decomposition, we assume that, under measure $P$,&#xA;\begin{align*}&#xA;\frac{dR_t}{R_t} &amp;amp;= \mu_{R,t} dt + \sigma_{R,t}\, dW^1_t\\&#xA;\frac{dA_t}{A_t} &amp;amp;= \mu_{A,t} dt + \sigma_{A,t}\, d\left(\rho W^1_t + \sqrt{1-\rho^2} W^2_t\right),&#xA;\end{align*}&#xA;where $W^1$ and $W^2$ are two independent standard Brownian motions. Here, we assume that $\mu_{R,t}$, $\mu_{A,t}$, $\sigma_{R,t}$, and $\sigma_{A,t}$ are deterministic or constants.&#xA;Define the probability measure $\widetilde{P}$ such that we have the Radon Nykodym derivative&#xA;\begin{align*}&#xA;\frac{d\widetilde{P}}{dP}\big|_t &amp;amp;= \frac{A_t}{A_0}\frac{1}{e^{\int_0^t\mu_ {A,s}ds}}\\&#xA;&amp;amp;= \exp\left(-\frac{1}{2}\int_0^t\sigma_{A,s}^2 ds + \int_0^t\sigma_{A,s}\,d\left(\rho W^1_s + \sqrt{1-\rho^2} W^2_s\right)\right).&#xA;\end{align*}&#xA;By Girsanov theorem,&#xA;\begin{align*}&#xA;\widetilde{W}^1_t &amp;amp;= W_t^1 - \rho \int_0^t \sigma_{A,s} ds \,\, \mbox{ and}\\&#xA;\widetilde{W}^2_t &amp;amp;= W_t^2 - \sqrt{1-\rho^2} \int_0^t \sigma_{A,s} ds&#xA;\end{align*}&#xA;are two independent standard Brownian motions under $\widetilde{P}$. Moreover, under $\widetilde{P}$,&#xA;\begin{align*}&#xA;\frac{dR_t}{R_t} &amp;amp;= \left(\mu_{R,t}+\rho \sigma_{A,t} \sigma_{R,t}\right) dt + \sigma_{R,t}\, d\widetilde{W}^1_t.&#xA;\end{align*}&#xA;Note also that&#xA;\begin{align*}&#xA;\frac{dP}{d\widetilde{P}}\big|_t &amp;amp;= \frac{A_0}{A_t}e^{\int_0^t\mu_ {A,s}ds}.&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;E_P(A_T(R_T - \lambda)^+) &amp;amp;= E_{\widetilde{P}}\left(\frac{dP}{d\widetilde{P}}\big|_T A_T (R_T - \lambda)^+ \right)\\&#xA;&amp;amp;= A_0\, e^{\int_0^T\mu_{A, s} ds }\,E_{\widetilde{P}}\left( (R_T - \lambda)^+ \right),&#xA;\end{align*}&#xA;which reduces to Black-Scholes' formula. Some details are omitted here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $\mu_{A,t}$ is the short interest rate at time $t$, then $e^{\int_0^t\mu_ {A,s}ds}$ is the money-market account value at time $t$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2015-10-22T19:09:56.427" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21376" PostTypeId="2" ParentId="21355" CreationDate="2015-10-22T13:57:45.583" Score="3" Body="&lt;p&gt;CFD is not really a &quot;derivative&quot;, although it is presented as such. There are no market makers. It is just an agreement between you as the client and a broker/dealer who can buy sell the underlying security for his own account. So it is just a legal construct to avoid Stamp Duty etc., not a traded security. &lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2015-10-22T13:57:45.583" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="21377" PostTypeId="2" ParentId="21371" CreationDate="2015-10-22T14:14:06.950" Score="0" Body="&lt;p&gt;Even though it is not optimal to exercise early, you still have that right, thus the price must reflect it &lt;/p&gt;&#xA;" OwnerUserId="9265" LastActivityDate="2015-10-22T14:14:06.950" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21378" PostTypeId="2" ParentId="21372" CreationDate="2015-10-22T14:21:52.407" Score="1" Body="&lt;p&gt;The numerator is&#xA;$$&#xA;S N'(d_1) = S  \frac{1}{\sqrt{2 \pi}} \exp(-1/2 d_1^2) = \\&#xA;S \frac{1}{\sqrt{2 \pi}}  \exp\left(- \frac12 \left(\log(S/E)+ (r + \frac12 \sigma^2(T-t)) \right)^2 / \sigma^2 (T-t) \right)  &#xA;$$&#xA;the denominator is:&#xA;$$&#xA;\exp(-r (T-t)) E N'(d_2) = \\  &#xA;E \frac{1}{\sqrt{2 \pi}}  \exp\left(- \frac12 \left(\log(S/E)+(r- \frac12 \sigma^2(T-t)) \right)^2 / \sigma^2 (T-t) -r(T-t) \right).  &#xA;$$&#xA;Now what if we extend the square, match exp and log and if then nominator and denominator are equal we get the result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I did not finish the calculation. But the latex above is too much for a comment. Maybe you can do the calculation. It not that clear to see whether the claim is true...&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-10-22T14:37:52.953" LastActivityDate="2015-10-22T14:37:52.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21379" PostTypeId="1" AcceptedAnswerId="21381" CreationDate="2015-10-22T14:30:20.500" Score="0" ViewCount="1038" Body="&lt;p&gt;I just wanted to make sure this was correct:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If AUD/USD has bid ask of 0.71999/  0.72032, that implies there is another (theoretical) pair USD/AUD which has a bid ask of (1/aud_usd_ask) / (1/aud_usd_bid) .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason for the theoretical pair is that if my quote currency profits are in AUD, I only have the AUD/USD bid/ask to convert back into USD and I want to make sure I have the correct bid/ask spread for the inverse pair that I'm going to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ie, if I have a profit of 1000 AUD, then to convert back into USD by purchasing USD / selling AUD, I would use 1000 AUD / (1/AUD_USD_BID)  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and if I have a loss of 1000 AUD, then I'd need to buy the AUD back and sell my USD in my account.  For that I would use 1000 AUD / (1/AUD_USD_ASK)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Correct??  Thanks!! &lt;/p&gt;&#xA;" OwnerUserId="17088" LastActivityDate="2018-10-25T15:38:14.787" Title="Implied inverse forex pair bid/ask spread" Tags="&lt;fx&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21381" PostTypeId="2" ParentId="21379" CreationDate="2015-10-22T15:43:06.520" Score="2" Body="&lt;p&gt;You are correct, but in finance, you should avoid talking about the theoretical pair you are talking about as you will make it even more confusing.&lt;/p&gt;&#xA;" OwnerUserId="12089" LastEditorUserId="26556" LastEditDate="2018-10-25T15:38:14.787" LastActivityDate="2018-10-25T15:38:14.787" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="21382" PostTypeId="1" CreationDate="2015-10-22T16:59:01.667" Score="2" ViewCount="267" Body="&lt;p&gt;I am looking at the market impact paper here (&lt;a href=&quot;http://www.cims.nyu.edu/~almgren/papers/costestim.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.cims.nyu.edu/~almgren/papers/costestim.pdf&lt;/a&gt;) and I had a question about volatility on page 11.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On page 11 it is stated: &quot;For volatility, we use an intraday estimator that makes use of every transaction in the day. We find that it is important to track changes in these variables not only between different stocks but also across time for the same stock.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure what the intraday estimator is.  Is it only the current day's volatility or it is an average of previous days volatility?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It states &quot;...makes use of every transaction in the day&quot; but if you are trading 10 minutes after the open and want to estimate market impact it seems like having only 10 minutes of tick data to calculate a volatility would be concerning. I was thinking he meant an average of a number of days of volatility using all the ticks in EACH day.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you. &lt;/p&gt;&#xA;" OwnerUserId="16923" LastActivityDate="2017-04-18T01:29:59.993" Title="impact model what volatility to use" Tags="&lt;volatility&gt;&lt;high-frequency&gt;&lt;high-frequency-estimators&gt;&lt;market-impact&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21383" PostTypeId="2" ParentId="21351" CreationDate="2015-10-22T17:03:13.923" Score="-5" Body="&lt;p&gt;Yes sounds OK!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try also stochastic volatility models like ARCH or GARCH.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way of forecasting would be using a Mandelbrotian fractal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other solution: Markov Chains&lt;/p&gt;&#xA;" OwnerUserId="17990" LastActivityDate="2015-10-22T17:03:13.923" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21384" PostTypeId="2" ParentId="21382" CreationDate="2015-10-22T18:15:45.200" Score="-2" Body="&lt;p&gt;In the posted script it is stated that:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$$ V = \text{Average daily volume in shares, and} $$ $$ σ =&#xA; \text{Daily volatility} $$ $V$ is a ten-day moving average. For&#xA;  volatility, we use an intraday estimator that makes use of every&#xA;  transaction in the day.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Hence, I guess from this statement that volatility is the change of traded volume per day, which is plotted in the graphs on page 12.&lt;/p&gt;&#xA;" OwnerUserId="5414" LastActivityDate="2015-10-22T18:15:45.200" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21385" PostTypeId="2" ParentId="21371" CreationDate="2015-10-22T18:27:42.753" Score="0" Body="&lt;p&gt;IMHO the code checks for early exercise because it is a general purpose code. That &quot;if&quot; statement will never be true for a non-dividend paying stock. It does not harm and it is good to make your code general.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2015-10-22T18:27:42.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21386" PostTypeId="1" CreationDate="2015-10-22T19:34:58.453" Score="2" ViewCount="40" Body="&lt;p&gt;I am working with compustat data and I can't figure out difference between 2 columns:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Working Capital Changes - Total&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Working Capital Change / Other / Increase/(Decrease)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the same date columns have significantly different numbers&lt;/p&gt;&#xA;" OwnerUserId="17992" LastActivityDate="2015-10-22T19:34:58.453" Title="Working Capital Change vs. Working Capital Changes-Total" Tags="&lt;capital-structure&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21387" PostTypeId="1" AcceptedAnswerId="21409" CreationDate="2015-10-22T20:01:08.633" Score="4" ViewCount="282" Body="&lt;p&gt;Say i have two 3 year bonds, which pay an annual coupon of 8% (1st bond) and 10% (2nd bond) respectively. Also, let's assume, that the spot curve is the same for both bonds. Other things equal, how can i compare the IRRs of these 2 bonds? (Only using the fact, that the spot rates are the same)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This was a question from my exam today, and i was really confused. I was given the IRR of the second bond, it was 8.87, i had to select one of 3 possible answers for the first bond's IRR: a)8.9 b)8.87 c)8.7&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When i got home, i did a couple of simple simulations, and managed to get 3 sets of spot rates, for which the IRR of the second bond was 8.9 and 8.87 and 8.7&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So is there some logic that i should have used in order to get to the answer or no? Is there a right answer? I mean, although i got the spots for each of the answers, they looked quite awkward (e.g. the spots for 8.7  were 15.43, 23.32, 7.88), so is the answer assuming that it's logic should be right for MOST of the spot rates (or at least those near to reality)?&lt;/p&gt;&#xA;" OwnerUserId="15071" LastEditorUserId="15071" LastEditDate="2015-10-22T20:24:05.690" LastActivityDate="2015-10-24T17:10:08.857" Title="Compare the IRRs of two bonds" Tags="&lt;bond&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21388" PostTypeId="5" CreationDate="2015-10-22T20:17:59.530" Score="0" Body="&lt;p&gt;See &lt;a href=&quot;http://quant.stackexchange.com/q/141/848&quot;&gt;this question&lt;/a&gt; for an overview&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="848" LastEditDate="2015-10-22T20:17:59.530" LastActivityDate="2015-10-22T20:17:59.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21389" PostTypeId="4" CreationDate="2015-10-22T20:17:59.530" Score="0" Body="Questions about sources of (financial) data" OwnerUserId="848" LastEditorUserId="848" LastEditDate="2015-10-22T20:17:59.530" LastActivityDate="2015-10-22T20:17:59.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21390" PostTypeId="2" ParentId="21371" CreationDate="2015-10-23T02:09:21.297" Score="3" Body="&lt;p&gt;The argument that the American and European call are worth the same is model independent. So it holds for the binomial model. So there is no need to check to&#xA;see if the early exercise occurs because it won't. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, if you have written general purpose code, it is much easier to test&#xA;for early exercise and always have the test fail than to try and deal with special cases. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-10-23T02:09:21.297" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21391" PostTypeId="2" ParentId="21371" CreationDate="2015-10-23T03:23:42.123" Score="1" Body="&lt;p&gt;It's been proven mathematically that it's never optimal to exercise an American call without dividend. If your spreadsheet shows otherwise, it has to be wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's a bad idea to drop off the check for early exercising just because you know it'll never happen, because your code will break for anything else, say a dividend-paying American call.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, it's a good practice to keep the code for model validation.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2015-10-23T03:23:42.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21392" PostTypeId="2" ParentId="21345" CreationDate="2015-10-23T09:24:17.113" Score="3" Body="&lt;p&gt;Yes, your solution is correct, given the implementation of &lt;code&gt;McSimulation&lt;/code&gt; and the interface of &lt;code&gt;SequenceStatistics&lt;/code&gt;. We should probably have defined &lt;code&gt;SequenceStatistics&lt;/code&gt; as returning instances of &lt;code&gt;Array&lt;/code&gt;...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you might have seen, trying to return &lt;code&gt;std::vector&amp;lt;Real&amp;gt;&lt;/code&gt; from the path pricer wouldn't work; the result type needs to define arithmetic operations such as addition and subtraction.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2015-10-23T09:24:17.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21393" PostTypeId="2" ParentId="21387" CreationDate="2015-10-23T10:58:31.213" Score="-1" Body="&lt;p&gt;For this, you donot need to perform any calculation. Examiner simply want to test the understanding. You just need to clarify would IRR of the First bond would be lower or higher or same as 2nd bond. Here, You can understand IRR as Yield to maturity. Assuming cashflow {+10,+10,+110} at time t=1,2,3 price of 2nd bond must be 102.867 to consistent with IRR of 8.87. Assuming both bond have same risk characteristic, market would ensure that both bond provide same return ie IRR(YTM). It means IRR for the first bond must be 8.87 otherwise it would lead to arbitrage opportunities. Difference would be reflected in the price of bond, hence  price of 1st bond would be 97.79 at IRR of 8.87 assuming cashflow {+8,+8,+108}. I also uploaded excel spreadsheet assuming spot rate .0877. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Time    Bond A  Bond B  Discount A  Discount B&#xA;1   8   10  7.3482134656    9.185266832&#xA;2   8   10  6.749530142 8.4369126775&#xA;3   108 110 83.6949177157   85.2448235993&#xA;            97.7926613233   102.8670031088&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2015-10-23T10:58:31.213" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21394" PostTypeId="1" CreationDate="2015-10-23T13:48:59.910" Score="2" ViewCount="855" Body="&lt;p&gt;How do I hedge a bond portfolio against currency risk?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally I'm looking for books or other references on this topic.&lt;/p&gt;&#xA;" OwnerUserId="18000" LastEditorUserId="848" LastEditDate="2015-10-24T07:55:35.873" LastActivityDate="2016-04-22T18:23:23.547" Title="Bond portfolio hedging against currency risk" Tags="&lt;risk&gt;&lt;bond&gt;&lt;currency&gt;&lt;hedge&gt;" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21395" PostTypeId="2" ParentId="21372" CreationDate="2015-10-23T14:49:48.567" Score="2" Body="&lt;p&gt;I am trying to fill in what Richard left for the second part:&#xA;\begin{align*}&#xA;\exp(-r(T-t))E\, N'(d_2) &amp;amp;= \frac{1}{\sqrt{2\pi}}\exp(-r(T-t))E\, \exp\left(-\frac{1}{2}d_2^2\right) \\&#xA;&amp;amp;=\frac{1}{\sqrt{2\pi}}\exp(-r(T-t))E\, \exp\left(-\frac{1}{2}\big(d_1-\sigma\sqrt{T-t}\,\big)^2\right) \\&#xA;&amp;amp;=\frac{1}{\sqrt{2\pi}}\exp(-r(T-t))E\\&#xA;&amp;amp;\qquad\qquad \exp\left(-\frac{1}{2} d_1^2 -\frac{1}{2}\sigma^2 (T-t) + d_1 \sigma\sqrt{T-t}\right)\\&#xA;&amp;amp;=\frac{1}{\sqrt{2\pi}}\exp(-r(T-t))E\\&#xA;&amp;amp;\qquad\qquad \exp\left(-\frac{1}{2} d_1^2 +\ln(S/E) + r(T-t)\right)\\&#xA;&amp;amp;=\frac{1}{\sqrt{2\pi}} S \, \exp\left(-\frac{1}{2}d_1^2\right)\\&#xA;&amp;amp;= SN'(d_1).&#xA;\end{align*}&#xA;That is, &#xA;\begin{align*}&#xA;\ln\frac{SN'(d_1)}{\exp(-r(T-t))E\, N'(d_2)} = 0.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-10-23T14:56:03.023" LastActivityDate="2015-10-23T14:56:03.023" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21397" PostTypeId="1" AcceptedAnswerId="21399" CreationDate="2015-10-23T18:08:58.037" Score="1" ViewCount="495" Body="&lt;p&gt;I'm trying to understand how the equation for Geometric Brownian Motion is formed from a random walk. I'm following the book &lt;a href=&quot;https://books.google.co.uk/books?id=I_Ua05TV1M0C&amp;amp;source=gbs_similarbooks&quot; rel=&quot;nofollow&quot;&gt;'Statistics of Financial Markets'&lt;/a&gt; but I'm struggling to follow how the drift is found from the expected value. I understand that for a random walk $ \left \{ X_n; n \geq 0 \right \}$,  $ E(X_t) = n(2p-1) \cdot \Delta x$ where $p$ is the probability of increasing the random variable by $\Delta x$ and that for $t = n \Delta t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E(X_t) = (2p-1) \cdot t \frac{\Delta x}{\Delta t} $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;however the book claims that for&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \Delta t \rightarrow 0, \Delta x = \sqrt{\Delta t}, p = \frac{1}{2} \left( 1+\mu \sqrt{\Delta t} \right)$$ we obtain that $\forall t$ $E(X_t) \rightarrow \mu t $. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How is this result obtained? Earlier in the book it suggests that these values may have been chosen to prevent the Variance from converging to $0$, however I don't understand why $\Delta x = \sqrt{\Delta t} $ and in particular why we have chosen $p = \frac{1}{2} \left( 1+\mu \sqrt{\Delta t} \right)$. &lt;/p&gt;&#xA;" OwnerUserId="18001" LastEditorUserId="18001" LastEditDate="2015-10-23T19:45:39.073" LastActivityDate="2015-10-23T20:31:38.030" Title="Obtaining the drift of a Wiener process formed from a random walk" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;modeling&gt;&lt;brownian-motion&gt;&lt;wienerprocess&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21398" PostTypeId="1" CreationDate="2015-10-23T19:10:29.997" Score="2" ViewCount="575" Body="&lt;p&gt;I am having some trouble using python to access Bloomberg as I cant find much documentation. All I really need to do is a simple lookup of dates in the PRTU function of Bloomberg, PRTU  via a python program. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone help me out with this or point me in the right direction?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any and all help!&lt;/p&gt;&#xA;" OwnerUserId="18002" LastActivityDate="2018-02-16T11:41:07.620" Title="Bloomberg Python Question - How do you access PRTU via python?" Tags="&lt;bloomberg&gt;&lt;python&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21399" PostTypeId="2" ParentId="21397" CreationDate="2015-10-23T19:32:22.587" Score="0" Body="&lt;p&gt;Here Δx must be in the sense of deviation and as a measure of deviation √Δt suits well, as it's the standart deviation of the increments. As this is not a symmetrical process, it has a drift (upper or lower), meaning that the probability of going in any direction is skewed. The bigger the time interval between two points, the bigger the skewness of X's path from it's mean. μ should be representing the skewness of the distribution, if X has an upper drift, then the probability of going up is bigger, and the &quot;biggerness&quot; is determined by μ itself. I'm guessing, that p was chosen this way just to get to the mean result. Because the real distribution of the increments is normal and can not be a linear function of the mean.&lt;/p&gt;&#xA;" OwnerUserId="15071" LastEditorUserId="15071" LastEditDate="2015-10-23T20:31:38.030" LastActivityDate="2015-10-23T20:31:38.030" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21400" PostTypeId="2" ParentId="21398" CreationDate="2015-10-23T19:57:05.517" Score="1" Body="&lt;p&gt;I'm guessing your best bet would be to get setup with an &lt;code&gt;SFTP&lt;/code&gt; account with Bloomberg.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just contact your rep to get the ball rolling.  We upload 10's of protfolio's 10's of times a day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't think there is an actual api for pulling data from &lt;code&gt;PRTU&lt;/code&gt; as I'm not sure exaclty what you'd pull other than the last upload time.&lt;/p&gt;&#xA;" OwnerUserId="743" LastActivityDate="2015-10-23T19:57:05.517" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21401" PostTypeId="2" ParentId="21067" CreationDate="2015-10-23T21:44:20.297" Score="0" Body="&lt;p&gt;What the book actually meant was  multiplying both sides of the condition equation by $C^{-1}u^T$ first, which would give you $(1)$ $\gamma=(m-\mu u)C^{-1}u^T$. Then multiply both sides of the SAME ORIGINAL condition by $C^{-1}m^T$, which would give you $(2)$ $\gamma\mu_V=(m-\mu u)C^{-1}m^T$. Now, using $(1)$ and $(2)$ you get $\mu_V(m-\mu u)C^{-1}u^T=(m-\mu u)C^{-1}m^T$. After that you will only need to open the braces, rearrange the $\mu$ terms and get the solution for $\mu$.&#xA; I would highly recommend to also read this part from Zastawniak's &quot;Mathematics for Finance - An Introduction to Financial Engineering&quot; book, chapter 5. The authors have used a maximization approach there, which is quite informative.&lt;/p&gt;&#xA;" OwnerUserId="15071" LastEditorUserId="15071" LastEditDate="2015-10-24T19:45:08.570" LastActivityDate="2015-10-24T19:45:08.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21402" PostTypeId="1" CreationDate="2015-10-24T06:02:45.423" Score="4" ViewCount="3996" Body="&lt;p&gt;&lt;a href=&quot;http://eu.wiley.com/WileyCDA/WileyTitle/productCd-0470852771.html&quot; rel=&quot;nofollow&quot;&gt;Martinelli et al.&lt;/a&gt; show that when the 3-month Libor is replaced by the 3-month Libor forward rates (which are obtained from the spot zero-coupon yield) then the swap price depends only on zero-coupon&#xA;prices. I argue that this result still true when the difference between the measurement date and the payment date is not equal to the maturity of the 3-month Libor. The Libor is replaced by the forward rate which depends on $B(t,T_{measurement})$ and $B(t,T_{_{measurement}+maturity})$. However the swap can not be regarded as the difference between the price of a coupon-bearing bond maturing at the maturity date of the swap and the price of a zero-coupon maturing at the next floating cash-flow payment.&#xA;Thoughts, am I on the right track? &#xA;Furthermore, Martinelli et al. claim that it is necessary to apply a convexity adjustment to the forward rate. I hope some could explain in simple arguments.&lt;/p&gt;&#xA;" OwnerUserId="18005" LastEditorUserId="7867" LastEditDate="2015-11-09T06:26:34.590" LastActivityDate="2017-07-01T17:21:28.960" Title="Why is convexity adjustment applied to swap price for a nonstandard swap, in simple terms?" Tags="&lt;swaps&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21403" PostTypeId="1" CreationDate="2015-10-24T06:50:44.923" Score="2" ViewCount="30" Body="&lt;p&gt;If I create portfolio consisting of three stocks and build efficient frontier for this portfolio and if there is a risk free rate for treasury bills and then I draw tangent line from risk free rate on vertical axis to the efficient frontier of graph, than what the tangent point will mean? &lt;/p&gt;&#xA;" OwnerUserId="18007" LastActivityDate="2015-10-24T06:50:44.923" Title="Market portfolio" Tags="&lt;modern-portfolio-theory&gt;" AnswerCount="0" CommentCount="0" ClosedDate="2015-10-24T07:57:44.873" ContentLicense="CC BY-SA 3.0" />
  <row Id="21404" PostTypeId="2" ParentId="21394" CreationDate="2015-10-24T10:10:16.853" Score="0" Body="&lt;p&gt;Take a look at &lt;a href=&quot;https://www.casact.org/library/astin/vol32no1/171.pdf&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; article. Also, there is a good reference list in the end.&lt;/p&gt;&#xA;" OwnerUserId="15071" LastActivityDate="2015-10-24T10:10:16.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21405" PostTypeId="2" ParentId="21149" CreationDate="2015-10-24T10:24:38.673" Score="12" Body="&lt;p&gt;After having done a lot of research on the topic I found the following excellent research piece on ETF.com:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Wealthfront modifies historic asset-class returns with current market&#xA;  implied expected returns (Black-Litterman) as well as with the&#xA;  in-house views of Chief Investment Officer Burton Malkiel’s team. In&#xA;  addition, Wealthfront sets minimum and maximum weights for each asset&#xA;  type. The resulting portfolio has an unmistakable Malkiel flavor to&#xA;  it, with an emerging market allocation that reflects his interest in&#xA;  China.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Betterment uses Black-Litterman currently implied market expected&#xA;  returns, but deliberately includes small-cap and value as separate&#xA;  asset classes, adding a classic Fama-French factor tilt. It doesn’t&#xA;  constrain the portfolio weights, but they do account for downside&#xA;  risk. Betterment’s portfolios wind up quite similar to the global&#xA;  market, at least on the equities side.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Covestor deliberately veers away from its optimizer to hedge its&#xA;  portfolios against inflation and to adjust for downside risk. Its wide&#xA;  constraints allow heavy weights to emerging markets.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Wise Banyan constrains its portfolio weights “tighter than most,” back&#xA;  toward market-cap weights, according to Herbert Moore, co-founder and&#xA;  chief investment officer. This might explain why its portfolios&#xA;  allocate generously to U.S. equities, and away from the rest of the&#xA;  global equity market.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Invessence includes the largest number of asset types, adding&#xA;  granularity to the fixed-income side. It bases asset-class returns&#xA;  expectations on up to 80 years of historical ETF or index returns, but&#xA;  uses only nine years of volatility history. Invessence employs gold as&#xA;  an inflation hedge. It also constrains all asset weights except for&#xA;  U.S. equity. Sure enough, the U.S. dominates its equity allocation.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;FutureAdvisor doesn’t optimize. Instead, its builds its portfolio in&#xA;  sleeves, creating a glide path much as the target-date mutual funds&#xA;  do. It builds in a “strategic” allocation to REITs as an inflation&#xA;  hedge, adding Fama-French type tilts. They’re not kidding. The firm’s&#xA;  portfolios emphasize small- and midcap stocks, and financials (REITS),&#xA;  with highest-in-class dividend yields and lowest price/book ratios.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;There a many more details here:&lt;br&gt;&#xA;&lt;a href=&quot;http://www.etf.com/sections/blog/22973-ghosts-in-the-robo-advisor-machine.html?nopaging=1&quot;&gt;http://www.etf.com/sections/blog/22973-ghosts-in-the-robo-advisor-machine.html?nopaging=1&lt;/a&gt; &lt;br&gt;and here:&lt;br&gt;&#xA;&lt;a href=&quot;http://www.etf.com/sections/blog/22982-inside-robo-advisor-asset-allocation.html?nopaging=1&quot;&gt;http://www.etf.com/sections/blog/22982-inside-robo-advisor-asset-allocation.html?nopaging=1&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The whole 7-parts series on the topic starts here:&lt;br&gt;&#xA;&lt;a href=&quot;http://www.etf.com/sections/blog/22946-which-robo-advisor-for-my-teen.html?nopaging=1&quot;&gt;http://www.etf.com/sections/blog/22946-which-robo-advisor-for-my-teen.html?nopaging=1&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2015-10-24T10:24:38.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21406" PostTypeId="1" CreationDate="2015-10-24T12:03:39.277" Score="1" ViewCount="1409" Body="&lt;p&gt;The question goes like this :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;**Particulars             Plant A              Plant B**  &#xA;Capacity utilization       70%                  60%&#xA;&#xA;Sales                      150 mil.             90 mil.  &#xA;Variable costs             105 mil.             75 mil.  &#xA;Fixed costs                30 mil.              20 mil.  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We are asked to calculate (i) the break-even point of plants before merger&#xA;(ii) BEP of plants after merger which will have an additional fixed cost of $2 million.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, BEP = (Fixed Costs/Contribution)* Sales&lt;br&gt;&#xA;where, Contribution = Sales - Variable Cost&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the first part we can easily calculate the BEP using the formula.&lt;br&gt;&#xA;However, for the second part we are required to take into consideration the capacity utilization also. (we scale it to 100% then solve)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Why do we do this only for the merged plant and not while calculating separately for different plants?&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks&lt;/p&gt;&#xA;" OwnerUserId="18008" LastActivityDate="2018-12-13T13:05:22.943" Title="How to calculate break-even point of merged plant/company?" Tags="&lt;risk-management&gt;&lt;finance&gt;&lt;analysis&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21407" PostTypeId="2" ParentId="10905" CreationDate="2015-10-24T14:40:15.853" Score="5" Body="&lt;p&gt;As a beginner in AlgoTrading QuantConnect and Quantopian are great for practice and improving your skills but for a serious Algo Trader , they are basically useless. An Algo Trader requires flexibility to investigate trading ideas and add or remove libraries or parts of the system that do not work. You need to automatically and constantly reevaluate your systems . At this level of trading , Quantopian and Quantconnect are very rigid and completely not capable. May be in a few years they will be at a level where implementing new trading ideas with more advanced libraries is possible. This two startups are looking for money , plain and simple. If you have been developing algos that are actually profitable and you are in know in the trading industry. if you have worked with the Big boys, Hedge funds, HFT firms, and Trading firms you will know why i say this. Just be careful do not put all your eggs in one basket&lt;/p&gt;&#xA;" OwnerUserId="18010" LastActivityDate="2015-10-24T14:40:15.853" CommentCount="0" CommunityOwnedDate="2015-10-24T14:40:15.853" ContentLicense="CC BY-SA 3.0" />
  <row Id="21408" PostTypeId="2" ParentId="21366" CreationDate="2015-10-24T16:03:49.460" Score="3" Body="&lt;p&gt;For many purposes we need a short term risk free rate. T-bill rates are ideal for this. Most Euro bonds have maturities measured in years, they cannot be considered &quot;short term&quot; or &quot;money market&quot; rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, Eurobonds are issued by a variety of issuers. Although generally highly rated, they may differ somewhat as to default probability. In other words they are not a good reference because of &lt;em&gt;non uniformity&lt;/em&gt;. Which specific Eurobonds would be used ?&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2015-10-24T16:15:39.833" LastActivityDate="2015-10-24T16:15:39.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21409" PostTypeId="2" ParentId="21387" CreationDate="2015-10-24T17:10:08.857" Score="1" Body="&lt;p&gt;Given no specific information about the term structure, no definite answer can be given. As you found out yourself, different term structures lead to different yield-to-maturities for the second bond. However, the following can be said:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Rising term structures will give you a lower yield for higher coupon rates and&lt;/li&gt;&#xA;&lt;li&gt;Falling term structures will give you a higher yield for higher coupon rates.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The only time that the yield to maturity of both bonds will be the same is when the term structure is flat.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A good read on this topic is:&#xA;Weingartner, H. Martin. &quot;The generalized rate of return.&quot; Journal of Financial and Quantitative Analysis 1.03 (1966): 1-29.&lt;/p&gt;&#xA;" OwnerUserId="17138" LastActivityDate="2015-10-24T17:10:08.857" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21410" PostTypeId="1" CreationDate="2015-10-24T17:42:55.140" Score="5" ViewCount="455" Body="&lt;p&gt;I'm trying to get my head around how a Brownian motion is formed from a simple random walk. I've seen two similar methods used:&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/sthmu.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/sthmu.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Y9ENQ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Y9ENQ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Why has one approach used $\frac{1}{\sqrt{k}}$ and the other hasn't? How are they both valid? The second approach suggests $\frac{1}{\sqrt{k}}$ was added so that the resulting Brownian motion followed a normal distribution by the central limit theorem. Is this still the case for the first approach? &lt;/p&gt;&#xA;" OwnerUserId="18001" LastEditorUserId="18001" LastEditDate="2015-12-28T16:24:50.113" LastActivityDate="2015-12-28T17:34:15.340" Title="Constructing a Brownian motion from a Simple Random Walk" Tags="&lt;stochastic-processes&gt;&lt;brownian-motion&gt;&lt;random-walk&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21411" PostTypeId="2" ParentId="21394" CreationDate="2015-10-24T18:31:46.720" Score="1" Body="&lt;p&gt;The idea is you want the hedge to benefit when the bond's currency weakens against the currency you will be exchanging it for. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A couple ways are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Enter into an FX swap where you pay in the currency you are receiving on the bond and receive another currency. If the currency you are receiving on the bond weakens, you will lose on the bond but gain on the swap.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Buy and FX forward (or similar an FX future) where you are short the currency you are receiving in the bond. Again, when that currency weakens, your hedge position will gain.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;These are just a couple simple points on a deeper underlying topic. &lt;/p&gt;&#xA;" OwnerUserId="9265" LastActivityDate="2015-10-24T18:31:46.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21412" PostTypeId="2" ParentId="21394" CreationDate="2015-10-24T19:43:36.197" Score="0" Body="&lt;p&gt;Quote: Currency hedging is most commonly carried out with forward contracts, which are agreements with a counterparty to buy or sell one currency against another at a pre-specified exchange rate and time. The agreed upon exchange rate (the forward rate) is a function of the existing spot rate and short-term interest rates in the hedged and base currency. EndQuote. Source: A Short Course in Currency Overlay.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An article I like is Currency Hedging for International Portolios: &lt;a href=&quot;https://www.imf.org/external/pubs/cat/longres.aspx?sk=23994.0&quot; rel=&quot;nofollow&quot;&gt;https://www.imf.org/external/pubs/cat/longres.aspx?sk=23994.0&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-01-23T15:30:47.590" LastActivityDate="2016-01-23T15:30:47.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21413" PostTypeId="2" ParentId="21410" CreationDate="2015-10-24T20:09:20.170" Score="3" Body="&lt;p&gt;Not sure about the correctness of the first approach, but second approach uses $1 /\sqrt k$ to scale the variance of the total sum by $k$. So the difference of two processes (say $W_t$ and $W_{t+\Delta t}$) generated by the random walk would have a variation of $\Delta t$, which satisfies one of conditions needed to get a Wiener's process.&lt;/p&gt;&#xA;" OwnerUserId="15071" LastActivityDate="2015-10-24T20:09:20.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21414" PostTypeId="2" ParentId="21149" CreationDate="2015-10-24T20:16:56.723" Score="-1" Body="&lt;p&gt;Many use systemic trading strategies that buy/sell according but not limited to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;P/E - price to earning&lt;/li&gt;&#xA;&lt;li&gt;P/B - price to book&lt;/li&gt;&#xA;&lt;li&gt;Dividend size&lt;/li&gt;&#xA;&lt;li&gt;STD Deviation - volatility&lt;/li&gt;&#xA;&lt;li&gt;Sharpe Ratio - return factoring volatility of returns in&lt;/li&gt;&#xA;&lt;li&gt;Interest Rates&lt;/li&gt;&#xA;&lt;li&gt;Credit Ratings&lt;/li&gt;&#xA;&lt;li&gt;Economic indicators (GDP growth, CPI/inflation, Housing data, PMI)&lt;/li&gt;&#xA;&lt;li&gt;other various financial ratios for pricing and measuring risk and return of assets&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="17727" LastEditorUserId="17727" LastEditDate="2015-10-24T20:18:35.787" LastActivityDate="2015-10-24T20:18:35.787" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21415" PostTypeId="1" CreationDate="2015-10-24T20:21:35.830" Score="2" ViewCount="747" Body="&lt;p&gt;I believe this question is best asked here, as it pertains to risk, rather than English SE. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the meaning of conservative in the context of risk management? In general, conservative would mean small or comparatively small, but coming across the term in different industry papers, I get the feeling it is the opposite.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if one applies a conservative haircut to a counterparty's collateral, is this a small haircut? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another example, this from the Fed's paper on capital planning at bank holing companies: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The federal Reserve expects BHCs to apply generally conservative&#xA;  assumptions throughout the stress testing process.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In this context, I can't figure they are suggesting to make stressed variables small. &lt;/p&gt;&#xA;" OwnerUserId="9265" LastActivityDate="2015-11-26T14:45:28.987" Title="Meaning of conservative in risk management?" Tags="&lt;risk&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21416" PostTypeId="2" ParentId="21415" CreationDate="2015-10-24T20:34:40.470" Score="1" Body="&lt;p&gt;If your looking for a conservative investment it would be a low standard deviation of returns i.e. a bond, fixed income asset, or low beta equity. From the context of equities, the beta is just the standard deviation of an equity divided by the standard deviation of the SP500, so a beta of say 0.8 along with a low standard deviation of returns would be more conservative. a beta of say 1.5 and a high standard deviation of returns would be less conservative. Typically, although not always, lower beta assets mean less returns, where as higher beta assets mean greater returns. A lower standard deviation of returns, means a more predictable asset and thus an asset averaging 3% return a month and 4% standard deviation of returns is less conservative than 0.5% returns a month, and 0.4% standard deviation of returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With regards to a haircut, a conservative haircut would be fairly large portion of the notional value of the client's portfolio. &lt;/p&gt;&#xA;" OwnerUserId="17727" LastEditorUserId="17727" LastEditDate="2015-10-24T20:43:22.793" LastActivityDate="2015-10-24T20:43:22.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21417" PostTypeId="1" CreationDate="2015-10-25T04:12:07.147" Score="2" ViewCount="315" Body="&lt;p&gt;A couple questions about the CAPM model:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;If I only know the riskfree rate and expected market return, how do I solve for $\beta$ ?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Given the stock's variance, how do I solve the percentage of it that is due to market risk and how do I interpret this?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I searched this question through google, but I cannot find reasonable answer. Please help me! Thanks in advance for your help.&lt;/p&gt;&#xA;" OwnerUserId="18016" LastEditorUserId="9265" LastEditDate="2015-10-26T08:31:53.850" LastActivityDate="2019-04-17T12:30:08.783" Title="Fundamental CAPM questions" Tags="&lt;capm&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21418" PostTypeId="2" ParentId="21417" CreationDate="2015-10-25T05:47:13.107" Score="0" Body="&lt;p&gt;Hint:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;write the return of stock B as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$R_B=\beta R_M +  e$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $e$ is uncorrelated to $R_M.$ Find a formula for its variance and substitute all the terms you know.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-10-25T05:47:13.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21419" PostTypeId="1" AcceptedAnswerId="21446" CreationDate="2015-10-25T09:14:33.613" Score="10" ViewCount="4062" Body="&lt;p&gt;When delta hedging an option until expiry at implied volatility, is it better to rehedge using the fixed implied volatility given by the option price upon its purchase (or sale), or to rehedge using the changing implied volatility given by the market price of the option? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the consequences of each option?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&#xA;On day 1 you buy an option at 20% implied volatility, thinking realised volatility will be higher. You use implied vol of 20% to calculate the delta of the option to hedge its sensitivity to movement in the underlying. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On day 2, the underlying has moved and the market now prices the option you bought with a 25% implied volatility. You look to rebalance your hedge. Do you use 20% or 25% implied volatility to calculate your delta? And Why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="18020" LastActivityDate="2015-10-26T13:54:16.730" Title="Delta Hedging with fixed Implied Volatility or floating Implied Volatility?" Tags="&lt;implied-volatility&gt;&lt;delta-hedging&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="21420" PostTypeId="2" ParentId="21370" CreationDate="2015-10-25T09:43:11.463" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Can you tell me if my understanding is correct?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes it's correct, with minor clarification: you're valuing &quot;ex dividend&quot;, meaning for FY2017, e.g., you're valuing the company the next moment the dividend was paid out. Should you be interested in &quot;cum dividend&quot; value, you'd add the value of dividends for the year you are entitled for.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;...then what should it be?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Assuming what you wrote is correct, Terminal Value (TV) in Dividend Discount Model is Present Value of all future dividend inflows. Generally speaking, TV will be: $$TV=\frac{d_t}{r_t}$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $d_t$ is &lt;strong&gt;constant&lt;/strong&gt; dividend paid &lt;strong&gt;forever&lt;/strong&gt; (follows from definition of &quot;terminal&quot;), usually assumed equal to $z*(1+r_t)$, and $r_t$ is &lt;strong&gt;constant&lt;/strong&gt; discount rate applicable to terminal period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Beware of three caveats:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;All values are real (cleaned of inflation)&lt;/li&gt;&#xA;&lt;li&gt;You can't &quot;port&quot; rates estimated for one currency, say dollar, to cash flows estimated in another currency, say peso. You should carry out the total valuation exercise, including estimation of dividends and discount rates, in a single currency.&lt;/li&gt;&#xA;&lt;li&gt;There will be a certain leeway in estimating $r_t$, to which the model is &lt;strong&gt;very&lt;/strong&gt; sensitive. The right thing here is not to find the &quot;right&quot; $r_t$ that does not exist, but to (i) apply it consistently to all your valuation universe of companies so that your relative valuation is right (ii) make your assumptions transparent so that they can be discussed (iii) make it comply to common sense.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="13718" LastEditorUserId="13718" LastEditDate="2015-10-25T10:00:03.657" LastActivityDate="2015-10-25T10:00:03.657" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21421" PostTypeId="2" ParentId="3005" CreationDate="2015-10-25T10:27:06.867" Score="4" Body="&lt;p&gt;Continuous time has a so-called elegance, but it is rarely correct. Most Q-measure people rarely care about correctness anyway, since they usually don't root their models in statistics. With no goodness of fit measures, continuous time models are elegant theory. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, we also see that most ex-ante hedges are rarely good, ex-post. They have large elements of directionality. There are lots of minor alterations, and even kluges (e.g., hedging delta by using the 'smile'). Even simple things like calibrating implied vol is technically wrong (recall the P-measure dynamic in Black-Scholes uses the same vol-i.e., the change of measure doesn't change the vol, so technically it must be the same as given by the historical dynamic, the DGP-in a Black-Scholes world, there is no implied-realized premium!). Of the many standard methods for hedging swaptions I have seen and used and backtested, it's pretty clear none are great. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In some ways you could say that continuous time finance with its beautiful formulas and elegant equations is merely a method for splining (calibrate to 4 points on the smile, and infer all others). But as I say rarely do Q-measure types care about the reality of P-measure. (exception: the failed attempt of the Macro-Affine community). Model Validation people try to do this correctly, but as far as I can tell, their methods are not altogether satisfactory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Continuous time finance gives us some nice formulas and rules of thumb. But the world around us can be modelled more effectively for the most part in discrete time. Moreover, the dynamics are far richer in discrete time. Autocorrelation, seasonality, long-lag lengths--all of these phenomena are impossible to fit into SDEs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One &lt;em&gt;must&lt;/em&gt; know continuous time mathematics to understand and get an intuition about optionality and nonlinear payoffs. But until academics and practitioners start using delay-differential stochastic differential equations (used in areas such as signal processing/electrical engineering, and other physical sciences) in finance, we can model many more interesting phenomena in discrete time than we can in continuous time.&lt;/p&gt;&#xA;" OwnerUserId="15602" LastActivityDate="2015-10-25T10:27:06.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21422" PostTypeId="1" CreationDate="2015-10-25T15:55:25.073" Score="1" ViewCount="171" Body="&lt;p&gt;What methods are there for showing a time series is mean reverting?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a hypothesis relating to the &lt;a href=&quot;https://en.wikipedia.org/wiki/Ornstein%E2%80%93Uhlenbeck_process&quot; rel=&quot;nofollow&quot;&gt;Ornstein-Uhlenbeck&lt;/a&gt; process for example?&lt;/p&gt;&#xA;" OwnerUserId="6661" LastEditorUserId="467" LastEditDate="2015-10-26T06:18:46.930" LastActivityDate="2015-10-26T06:18:46.930" Title="What methods are there for showing a time series is mean reverting?" Tags="&lt;time-series&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21423" PostTypeId="2" ParentId="21422" CreationDate="2015-10-25T16:38:38.617" Score="3" Body="&lt;p&gt;In econometrics all these tests are under the banner of 'Unit Root Tests'. There is a vast body of literature that deals with their formulation, treatment and pifalls. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2015-10-25T16:38:38.617" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21424" PostTypeId="1" CreationDate="2015-10-25T18:03:44.283" Score="1" ViewCount="286" Body="&lt;p&gt;In the course of my master thesis I’ve come across a paper by Carr and Wu (2009) where the authors evaluate whether returns on variance swaps can be explained by the simple CAPM. (really only market factor). They do this by regressing  overlapping 30-day returns on the variance swap on the excess market return and checking whether the alpha is significant.&#xA;So here is the point that I do not understand. They use the generalized method of moments (GMM) and say that the weighting matrix is computed according to Newey-West (1987). I have read in several books and works (Cochrane (2001)), (also here &lt;a href=&quot;https://www.kevinsheppard.com/images/5/55/Chapter6.pdf&quot; rel=&quot;nofollow&quot;&gt;https://www.kevinsheppard.com/images/5/55/Chapter6.pdf&lt;/a&gt;) that to evaluate a beta-factor model where the factor itself is a traded asset with GMM, the two moment conditions are &#xA;I: (ri-alpha-beta&lt;em&gt;ft)=0&#xA;II: (ri-alpha-beta&lt;/em&gt;ft)*ft=0 , where ri denotes the excess return on asset i and ft the market excess return.&#xA;If I understood the concept of GMM correctly, these two moment conditions would just identify the system and for this case, GMM would collapse to OLS. Then, for my understanding, there would be no weighting matrix. &#xA;I am really no expert on GMM and pretty sure that I got something wrong or missed something, so I have two questions and would be grateful for an answer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1)  Is there a special reason to prefer GMM over OLS when you use Newey-West HAC errors in combination with OLS to control for the correlation in the residuals in the context outlined above? (on every single day, I have overlapping 30-day returns to regress on the market)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2)  What could the described weighting matrix refer to in this context or did I understand the concept of just defined wrongly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much in advance and best regards,&#xA;Sven&lt;/p&gt;&#xA;" OwnerUserId="18027" LastActivityDate="2015-10-25T18:03:44.283" Title="Generalized method of moments concept in CAPM testing" Tags="&lt;beta&gt;&lt;capm&gt;&lt;return&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21425" PostTypeId="2" ParentId="21417" CreationDate="2015-10-25T18:36:00.073" Score="5" Body="&lt;p&gt;Because you have CAPM therefore the following holds:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$$r_i = r_f + \beta_i (r_M - r_f) + \epsilon_i$$ &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;where $r_i$ is the expected return of stock $i$, $r_f$ is the risk free return and $r_M$ is the expected market return, and $\epsilon$ is an idiosyncratic return adjustment or an error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if you take the $\text{Var}[\cdot]$ operator over the equation above you should have. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{split}&#xA;\text{Var}[r_i] &amp;amp; =\text{Var} \left [ r_f + \beta_i (r_M - r_f) + \epsilon_i \right ] \\&#xA;&amp;amp; = \text{Var}[r_f] + \beta_i^2  \text{Var} [r_M - r_f] + \text{Var} [\epsilon_i] \\&#xA;&amp;amp; = 0 +  \beta_i^2 \text{Var} [r_M] + \text{Var} [\epsilon_i] \\&#xA;&amp;amp; = \beta_i^2 \text{Var} [r_M] + \text{Var} [\epsilon_i]&#xA;\end{split}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;This is the relation you're looking for, it's a decomposition of variance.&lt;/strong&gt; (Notice there's no covariance terms by the assumption of CAPM). It tells you that the variance of your stock return is two-fold. First, it comes from the systematic risk where you bear from market risk, namely $\beta_i^2 \text{Var} [r_M]$. Second, each stock has its idiosyncratic risk, which is $\text{Var} [\epsilon_i]$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now in this problem you have $\beta_i$, $\text{Var} [r_M]$ and $\text{Var}[r_i]$ given. What percentage of this variance is due to market risk you ask? That's just &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\beta_i^2 \text{Var} [r_M]}{\text{Var}[r_i]}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if you want to be even more convenient. You can re-write the above relation as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\beta_i^2 \text{Var} [r_M]}{\text{Var}[r_i]} = \frac{\text{Cov}^2[r_i,r_M]}{\text{Var} [r_M] \text{Var} [r_i]} = \rho_i^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is because &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\beta_i = \frac{\text{Cov}[r_i,r_M]}{\text{Var} [r_M]}$$&lt;/p&gt;&#xA;" OwnerUserId="6016" LastEditorUserId="6016" LastEditDate="2015-10-26T12:35:20.370" LastActivityDate="2015-10-26T12:35:20.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21426" PostTypeId="2" ParentId="21422" CreationDate="2015-10-25T18:46:53.743" Score="1" Body="&lt;p&gt;In essence, and without using any equations:  A process that is mean reverting to zero will have a tendency to decrease when it is above zero and a tendency to increase when it is below zero. This can be tested by regressing the observed process changes during each time interval on the process state at the beginnning of each time interval.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-10-25T18:46:53.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21427" PostTypeId="1" AcceptedAnswerId="21433" CreationDate="2015-10-25T19:02:36.220" Score="1" ViewCount="52" Body="&lt;p&gt;Fed papers make reference to a post-stress and pre-stress capital. I can't find definitions of these online, but from the context (below), it sounds like the post-stress capital is the estimated capital resulting from a Fed stress test of a bank holding company and pre-stress capital the capital going in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is my understanding correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Context:Fed Paper - &lt;a href=&quot;http://www.federalreserve.gov/bankinforeg/ccar-and-stress-testing-as-complementary-supervisory-tools.htm&quot; rel=&quot;nofollow&quot;&gt;CCAR and Stress Testing as Complementary Supervisory Tools&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Importantly, the SCAP assessed whether a BHC had sufficient capital to&#xA;  absorb losses and to continue to operate as a financial intermediary&#xA;  by requiring BHCs to meet a post-stress tier 1 common equity ratio of&#xA;  4 percent and a tier 1 risk-based capital ratio of 6 percent&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="9265" LastActivityDate="2015-10-26T00:43:18.637" Title="What are pre and post stress capital?" Tags="&lt;risk-management&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21428" PostTypeId="1" CreationDate="2015-10-25T19:15:33.343" Score="4" ViewCount="1265" Body="&lt;p&gt;I’m considering a career in finance when I complete my PhD in Mathematics in 2016. My only major programming experience was a C++ course during my MPhys in the 2007-8 academic year, although since then I’ve used LaTeX a lot, which has some similarities to proper programming. What should I be able to do as a programmer if I seek an entry-level job such as a quant? I’ve tried googling this, but what I find discussed instead is which languages are worth learning. I appreciate there may be too many exercises worth doing to list here, but I’d welcome any reference material that goes into this in appropriate detail.&lt;/p&gt;&#xA;" OwnerUserId="18028" LastActivityDate="2015-10-25T23:33:38.457" Title="What programming skills are needed in quantitative finance?" Tags="&lt;programming&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ClosedDate="2015-10-26T08:31:25.757" ContentLicense="CC BY-SA 3.0" />
  <row Id="21429" PostTypeId="1" AcceptedAnswerId="21460" CreationDate="2015-10-25T22:35:18.353" Score="4" ViewCount="6807" Body="&lt;p&gt;At time $t=0$, swap has zero cost. In fact, both parties may have valued the swap differently based on their zero swap curve-but somehow they agreed. Once a swap is agreed upon it cannot be dissolved because it is an OTC contract.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even if the first floating payment is known after the first reset, surely the floating payments after that are not known. It seems that one would need to estimate the evolution of the forward rates in time. No book talks about that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They just assume that the forward rates will be realized; post a ficticious payment at the end; make them look like bonds; find discount rate that matches the value of both the legs. No simulation. I must be missing something here. I will appreciate an explanation.&lt;/p&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="467" LastEditDate="2015-10-27T09:08:31.063" LastActivityDate="2017-06-24T12:12:03.447" Title="Why does the valuation of the floating leg of a swap only use the next payment?" Tags="&lt;swaps&gt;&lt;interest-rate-swap&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21430" PostTypeId="2" ParentId="21428" CreationDate="2015-10-25T23:21:13.213" Score="1" Body="&lt;p&gt;Well, i mostly use $MatLab$, it has pre-constructed tools, user-friendly interface. Also $Stata$ for econometric analysis &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For econometrics you can also use $Eviews$, it can't be considered as programming though, everything is packed for easy use. In contrast, $Stata$ is better for some complex models. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have learnt $C++$, in fact, if you dig under most (if not all) applications, you'll find that $C$ is their &quot;dad&quot;. $C++$ is great for &quot;freestyle&quot; and crazy ideas. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, Matlab (and most computational prorgams) have limited bytes for their data. Due to some circumstances i had to solve a set of equations, which involved numbers going beyond 308 (MatLab's limit) digits. C++ turned out to be handy there (made a new class of floating numbers). Just saying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For daily basis $Excel$ should be good. Knowing how to use $VBA$ with it would give you a huge performance boost too. Good luck!&lt;/p&gt;&#xA;" OwnerUserId="15071" LastActivityDate="2015-10-25T23:21:13.213" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21431" PostTypeId="2" ParentId="21428" CreationDate="2015-10-25T23:33:38.457" Score="2" Body="&lt;p&gt;It depends on what part of finance you want to go into.  Basic scripting in SAS is often enough for some commercial banks.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my opinion (and others will disagree I'm sure) to be a &quot;world class&quot; quant you need to have in-depth knowledge of a low level programming language (eg C++), working knowledge in a few high level languages (R and Python, for example), and strong working knowledge of SQL and databases.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Stay away from Excel, SAS, and STATA if you want long term (15+ years) of employability: those &quot;languages&quot; are obsolete and are being phased out.   &lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2015-10-25T23:33:38.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21432" PostTypeId="2" ParentId="21352" CreationDate="2015-10-25T23:56:37.907" Score="3" Body="&lt;p&gt;The question you asked can be explained by these two lines of the code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;e   means &amp;lt;- t(returns) %*% ones / T&#xA;z &amp;lt;- returns - matrix(rep(t(means), T), ncol=N, byrow=TRUE)&#xA;term.1 &amp;lt;- t(z^2) %*% z^2 e&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here returns is TxN which gives you matrix ${y_{nt}}$ where n has i and j elements ; means is TxN of  matrix ${z_i}$ , same mean for each asset for the time series.&#xA;Therefore, line 2 of code above gives you z variable which is  matrix ${y_{nt}-z_i}$. When you take a transpose and multiply you get a sum of cross multiplication elements. Elements were squared when you do z^2. therefore you are taking a transpose of matrix of squared elements like $({y_{nt}-z_i})^2$ and multiplying by matrix $({y_{nt}-z_i})^2$. That is how you get cross  multiplication of the squared elements for term.1. Likewise for term 2, the code uses t(z) and not t(z^2) which explains the elements are not squared. I hope this explains it.&lt;/p&gt;&#xA;" OwnerUserId="7867" LastActivityDate="2015-10-25T23:56:37.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21433" PostTypeId="2" ParentId="21427" CreationDate="2015-10-26T00:43:18.637" Score="1" Body="&lt;p&gt;Yes, your guess is right. Basically the stress test scenarios result in Market Risk, Credit Risk and other capital charges which alter the tier 1 capital requirement. Tier 1 known, as going-concern divided by Total capital is the ratio they are looking at. Post stress capital is the tier 1 capital that is available after the application of the stress scenario.&lt;/p&gt;&#xA;" OwnerUserId="7867" LastActivityDate="2015-10-26T00:43:18.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21434" PostTypeId="2" ParentId="21238" CreationDate="2015-10-26T01:40:52.000" Score="1" Body="&lt;p&gt;You are trying to apply BSM in the context of Credit instruments. While you have the Bloomberg terminal you can find the data there. The key is determining what are you investigating and what particular data you need. I have used something similar - Black and Cox Structural model, with changing barrier. I was able to get some free data, regarding balance sheets, from various web sites, just google. If you are doing it to learn then pick stocks that you can get the information for free when you no longer have Bloomberg, otherwise center on it and do your work. &#xA;Here is another source &lt;a href=&quot;https://quant.stackexchange.com/questions/141/what-data-sources-are-available-online]&quot;&gt;What data sources are available online?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2015-10-26T01:40:52.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21435" PostTypeId="2" ParentId="2546" CreationDate="2015-10-26T02:28:29.587" Score="1" Body="&lt;p&gt;By very nature of VaR, CVAR etc they are dependent on the portfolio, data window, variance-covariance estimation, returns, portfolio weights etc. Backtesting failure requires you to review how you create VaR, for example. I do not see how you can gain much insight from some studies. May be you can start out with a stable sub set and add non linearity incrementally. Developing a very complex model, right of the top, may inhibit comprehension of results. If there was an close form analytical solution then you have some good research that you can use. I do not believe, random studies can do any good. Just realized that this is a very old question, anyways.&lt;/p&gt;&#xA;" OwnerUserId="7867" LastActivityDate="2015-10-26T02:28:29.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21437" PostTypeId="1" AcceptedAnswerId="21439" CreationDate="2015-10-26T03:29:31.113" Score="2" ViewCount="505" Body="&lt;p&gt;I need to form a predictive time series model for monthly Brent crude oil spot price.  I am looking to form 1-12 month ahead forecast horizons.  There is a bounty of previous literature which uses futures prices in a regression framework for this purpose.  See &lt;a href=&quot;https://caia.org/sites/default/files/3.RESEARCH%20REVIEW.pdf&quot; rel=&quot;nofollow&quot;&gt;Crude Oil Price Forecasting Techniques: a Comprehensive Review of Literature&lt;/a&gt; and the references cited therein in for examples, I can provide more citations if necessary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general the models are of the form. &#xA;$$E[P_{t+h}]=F_{t,t+h}+x_{t,h}'\beta$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $E[P_{t+h}]$ is the expected value of Brent crude oil spot price $h$ months in the future at time $t$, $F_{t,t+h}$ is the price of the oil futures contract at  time $t$ with maturity $t+h$, and $x_{t,h}$ is a vector of other economic and financial variables (i.e. proxies for business cycles and or risk premia, etc).  This would call for a regression model of the form&#xA;$$&#xA;P_{t+h}=F_{t,t+h} + x_{t,h}'\beta+\varepsilon_{t,h}&#xA;$$&#xA;Where $\varepsilon_{t,h}$ is the error term.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;I understand the basic concept behind futures contracts, but am struggling with how to obtain a monthly time series of future prices which I can use in the above equation to form a regression model&lt;/strong&gt;.  That is to say, futures contracts are brought into creation and traded in irregular time intervals, often with more than one outstanding contracting existing at a time.  Unlike spot prices, it would seem that obtaining a monthly time series out of futures data would be an involved process, assuming that such futures data was even available.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;What I have Done So far&lt;/h2&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;I have researched some methods to form continuous contract series (eg. &lt;a href=&quot;http://www.premiumdata.net/support/futurescontinuous.php&quot; rel=&quot;nofollow&quot;&gt;http://www.premiumdata.net/support/futurescontinuous.php&lt;/a&gt;).  There are apparently multiple different ways to do &quot;splicing&quot;.  I would really like to know what methods are preferable for the purposes of regression and if there already exists freely available continuous contract data.  Where do I go to look?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I have gone onto Quandl and found some futures data with titles like.  &lt;strong&gt;ICE Brent Crude Oil Futures #11 (B11) - Unadjusted Prices, Roll on First of Month, Continuous Contract History&lt;/strong&gt;.  This sounds kind of like what I want, but I honestly do not know for sure or if it would be appropriate for my model.  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;All in all, I am just looking for advise on where to start and how to go about doing this, things to watch out for, if there is any free resources/data already available, exc.  Any advise would be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="17040" LastEditorUserId="17040" LastEditDate="2015-10-26T06:18:38.127" LastActivityDate="2015-10-26T06:18:38.127" Title="How to retrieve and format futures data for use in regression/time series models?" Tags="&lt;futures&gt;&lt;regression&gt;&lt;historical-data&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21439" PostTypeId="2" ParentId="21437" CreationDate="2015-10-26T04:47:19.027" Score="1" Body="&lt;p&gt;You're getting confused because data providers will actually give you &quot;continuous&quot; contracts which are not the ones traded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you get in a future contract trade, you buy a future contract which has an expiry date. After that date, the contract does not exist anymore, money is exchanged against underlying for those who still have a position. When you do speculative trading, you just don't want to take delivery of thousand of oil barrels, so you basically sell the front-month contract relatively shortly before expiry and buy the following one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, $F_{t,t+h}$ is the time series of a continous contract $h$ month ahead. You can probably find this for some values of $h$ is some provider, but not everywhere. So what you have to do is basically find and download the whole history of prices for all future contracts $F_{t,T}$ and then find to which value $T$ the $t+h$ of your model corresponds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, you will need to download a time series for each future contract that could be concerned by you analysis. It would be good if you added the regression formula you're trying to get to in the question.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2015-10-26T04:47:19.027" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="21441" PostTypeId="1" CreationDate="2015-10-26T05:54:52.667" Score="2" ViewCount="351" Body="&lt;p&gt;I am writing my undergrad honor thesis and want to run a multivariable VAR-EGARCH model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any package in R or formulas in Stata 14 that allows me to implement directly? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, could you give me some advice? &lt;/p&gt;&#xA;" OwnerUserId="18034" LastEditorUserId="467" LastEditDate="2015-10-26T06:04:13.453" LastActivityDate="2016-01-18T06:47:57.090" Title="Is there an implementation of VAR-EGARCH model in R or Stata?" Tags="&lt;time-series&gt;&lt;programming&gt;&lt;garch&gt;&lt;econometrics&gt;" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21442" PostTypeId="1" CreationDate="2015-10-26T09:20:51.637" Score="2" ViewCount="132" Body="&lt;p&gt;How can I perform Euler discretization on this model where $\delta t=1$ and $\delta x_t = x_t-x_{t-1}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/vtR3s.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/vtR3s.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18036" LastEditorUserId="467" LastEditDate="2015-10-28T02:41:10.173" LastActivityDate="2015-10-28T02:41:10.173" Title="How to use Euler discretization for this interest rate model?" Tags="&lt;interest-rates&gt;&lt;stochastic-processes&gt;&lt;euler&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21443" PostTypeId="1" AcceptedAnswerId="22646" CreationDate="2015-10-26T10:13:01.030" Score="8" ViewCount="3292" Body="&lt;p&gt;Before I start: Ok, this is something I investigated for a fair amount of time and my question is semi-academic. To simplify, I will introduce the short bit (TLDR) of my question and then lay out specifics.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Short Question&lt;/strong&gt;: What happens when option pricing model estimate and market price disagree? What is the course of action? What happens to the difference when I take positions on option and delta to create a self replicating portfolio?&lt;/p&gt;&#xA;&lt;p&gt;It would be great if I get recommended some research (as in research papers, articles etc.) also with the answers.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Important! This is not a speculation or arbitrage question, it is a mere confusion about the fair pricing and use of models in the market.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Now the long story...&lt;/p&gt;&#xA;&lt;h1&gt;Problem Specifications&lt;/h1&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Single asset (say XYZ)&lt;/li&gt;&#xA;&lt;li&gt;All options on the are market are European (as if it is an index)&lt;/li&gt;&#xA;&lt;li&gt;Assume no dividend paid on XYZ in any form (no need to overcomplicate)&lt;/li&gt;&#xA;&lt;li&gt;Both option market and underlying market are liquid enough&lt;/li&gt;&#xA;&lt;li&gt;No frictions, no bid-asks, no arbitrage, infinite divisibility, time is continuous, borrow and lend at the same amount from risk free rate &lt;span class=&quot;math-container&quot;&gt;$r$&lt;/span&gt; (BS assumptions) and even fix &lt;span class=&quot;math-container&quot;&gt;$r$&lt;/span&gt; to zero (practically what it is today for short term rates).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Assume there is a contract (a European Call) A on XYZ priced at the market at \$5 per share.&lt;/p&gt;&#xA;&lt;p&gt;Let's say my model M1 is a Black-Scholes model using historical volatility (say vol1) and yields fair price as \$4.9. So, there is a clear disagreement with market and model.&lt;/p&gt;&#xA;&lt;p&gt;I want to use a replicated portfolio. I would take long or short position on the contract and do perfect delta hedging (since my assumptions allow me to do). What happens to the \$0.1 difference? Would it make a difference if I long or short of the option or would delta hedging take care of that difference? (I suspect not)&lt;/p&gt;&#xA;&lt;p&gt;Here are some of my thoughts on the the problem.&lt;/p&gt;&#xA;&lt;h2&gt;Using Implied Volatilities&lt;/h2&gt;&#xA;&lt;p&gt;One might rightfully say &amp;quot;Use implied volatility, so your model price and market price will be one.&amp;quot; OK, I respect that.&lt;/p&gt;&#xA;&lt;p&gt;I adjusted volatility metric of my model's volatility estimate to the implied volatility (say vol2). Now model M1 prices contract A with vol2 on \$5.&lt;/p&gt;&#xA;&lt;p&gt;Enter contract B, essentially same as contract A except the strike price (same maturity and EC). Therefore moneyness is different for contract B. Let's say market price of contract B is \$3 and even though it is acceptable with no arbitrage rule it is on a &lt;em&gt;volatility smile&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;It means if I use vol1 or vol2, there is a good chance that I will not get the same price estimate as the market's. I can still infer the implied volatility of contract B (say vol3).&lt;/p&gt;&#xA;&lt;p&gt;But this time I will have two different volatility measures vol2 and vol3 for the same asset and time period (remember maturities are equal for contracts A and B).&lt;/p&gt;&#xA;&lt;p&gt;It is OK if I'm going to price a synthetic option (an over the counter option, that is not traded on the market). I will find the &amp;quot;interpolated&amp;quot; implied volatility and come up with a fair price estimate where market would probably also agree if the contract were traded on the market. Let's assume I'm not interested in OTC options and I only operate on market options.&lt;/p&gt;&#xA;&lt;p&gt;So having two different volatility measures for the same period for the same asset is &amp;quot;weird&amp;quot;. Sure, technically you can do it. But it says something about your model's functionality and even I know what Fischer Black said about constant volatility assumption.&lt;/p&gt;&#xA;&lt;h2&gt;Fair Price&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;We call price estimate of the model (namely Black Scholes) the fair price.&lt;/li&gt;&#xA;&lt;li&gt;We also call market price of options as the fair price, since it is determined by the market.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Is the following statement true? &amp;quot;Fair price of an option contract is at the expiration no party would get advantage over the other.&amp;quot;&lt;/p&gt;&#xA;&lt;p&gt;Sure, it can be stated more elegantly. Let's illustrate it with an example. If I put \$5 on an option contract and I get back \$5 at the expiration (remember risk-free rate is assumed zero so no time discount), fair value is \$5.&lt;/p&gt;&#xA;&lt;p&gt;If it is true it takes the title &amp;quot;fair price&amp;quot; away from both models and market. Fair price would be an idealised state which both market and models try to converge.&lt;/p&gt;&#xA;&lt;h1&gt;Market vs Model&lt;/h1&gt;&#xA;&lt;p&gt;But, we trade in the market. And market is assumed to be the best approximation to fair prices even in the idealised state. I made some remarks about it on this question &lt;a href=&quot;https://quant.stackexchange.com/questions/11458/is-there-any-other-way-to-measure-option-pricing-model-performance-than-proximit&quot;&gt;Is there any other way to measure option pricing model performance than proximity to market prices?&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;I ask the question in a similar way. Suppose my model price is different from the market price. What should I do?&lt;/p&gt;&#xA;&lt;p&gt;ps. I can understand using market prices as the best prices in the underlying assets. What I cannot understand is using market option prices as the best prices since it is a derivative product on the future state of the underlying market.&lt;/p&gt;&#xA;" OwnerUserId="8147" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-10-13T01:19:44.440" Title="Model Price vs Market Price in terms of Fair Price (Options)" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;european&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21444" PostTypeId="1" CreationDate="2015-10-26T10:19:37.600" Score="14" ViewCount="2072" Body="&lt;p&gt;I consistently read on academic papers, when pricing options, using implied volatility is better than using historical volatility. Because, market is more &quot;forward-looking&quot; and historical data is &quot;backward-looking&quot;. But I see little evidence for the statement in research papers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually the only experiment I encountered is part of an article &lt;strong&gt;&lt;a href=&quot;http://www.jstor.org/stable/30046228&quot;&gt;Which GARCH Model for Option Valuation?&lt;/a&gt;&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;They also say that implied volatility is better since it is forward looking but in one section they do a small experiment also with historical data. Their conclusion is, even though model parameters are different there is no significant difference in price estimation performance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you know about any other research on implied vs historical volatility performance on option pricing?&lt;/p&gt;&#xA;" OwnerUserId="8147" LastActivityDate="2016-03-03T17:30:58.620" Title="Historical Volatility vs Implied Volatility Performance in Pricing Options" Tags="&lt;option-pricing&gt;&lt;volatility&gt;&lt;implied-volatility&gt;&lt;research&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="21446" PostTypeId="2" ParentId="21419" CreationDate="2015-10-26T13:54:16.730" Score="8" Body="&lt;p&gt;Generally speaking, in the real world, you'd always want to use the correct implied vol. But you should think of your question in terms of:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) Vega mark-to-market (m2m) PnL vs. theta/gamma profile&lt;br&gt;&#xA;(2) Change in risk and PnL due to higher order risks (vanna, volga)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Vega mark-to-market PnL vs. theta/gamma profile&lt;/strong&gt;   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a simple, pure Black Scholes world implied volatility is of course constant. Your PnL, should you delta hedge an option to expiry in isolation, is dependent upon both the level and path of realised volatility. That's because the gamma of the option, i.e. the frequency/magnitude with which you need to delta hedge, is highest near the strike of the option, closer to expiry, and with a lower implied volatility. Hull has nice plots of these relationships.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ask yourself: if you buy an option, delta hedge it to expiry, can you lose more money than your premium? (See bottom) This is a simple, intuitive question that people often get wrong because complex mathematics have supplanted their ability to use common sense and reasoning.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your example, if you've bought your option at 20% and the market has repriced to 25%, you can either: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;raise the implied vol you're using for the option price/risk which will mean instant positive vega PnL, a change in delta on top of your gamma (dDelta/dVol, or vanna), but also therefore a higher theta bill and lower gamma going forward. you can lock in the vega PnL by selling the option back or a similar option.&lt;/li&gt;&#xA;&lt;li&gt;ignore the change in implied volatility if you intend to hold the option to maturity, which means the vega m2m PnL is somewhat irrelevant. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If it's your intention to hold and hedge the option to maturity, you can calculate the delta with any implied volatility you like. Broadly speaking, a higher vol (positive vega PnL upfront, higher theta bill, less gamma) would benefit you if realised changes in the underlying ended up being evenly distributed in time and magnitude, and a lower vol (negative vega PnL upfront, lower theta bill, more gamma) would ultimately benefit you if the realised changes were large and centered around the strike near expiry. You can convince yourself of this by running some simulations with delta hedging done using different implied vol levels.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Change in risk and PnL due to higher order risks (vanna, volga)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're using a more realistic stochastic vol model for a market making book or portfolio, your main concern is that (a) the model is arbitrage free and (b) your greeks for a larger group of trades is consistent. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are hedging one option within a portfolio and do not account for the vanna/volga contributions to your change in delta, that is you do not remark the implied vol of that one option, then your portfolio delta is inaccurate, i.e. you've effectively chosen not to mark your portfolio to market and have delayed taking higher order PnL and hedging the associated change in risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On market making and particularly exotic trading books, these higher order contributions to your delta drive a significant percentage of overall PnL, so using the correct implied volatility for your delta is as important as using the correct spot price for the underlying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;If you buy an option, delta hedge it to expiry, can you lose more money than your premium?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Yes!&lt;/strong&gt; A simple example: What is your PnL if you buy a delta-hedged 3 month 37.00 (5% delta) call option on INTC for 0.05 (spot is 35). The stock trades sideways and then rallies instantly to 36.99 into expiry and then the call expires worthless. You've lost your premium, the option has expired worthless, and you've lost money on your delta hedge. &lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-10-26T13:54:16.730" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21447" PostTypeId="1" CreationDate="2015-10-26T14:04:08.447" Score="1" ViewCount="71" Body="&lt;p&gt;I have to build a model portfolio from the data of a portfolio composed of bonds from Emerging Markets accounted in $ (So exclusively corporate bonds from emerging markets). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you have any documentation to realize this task ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I began to do a breakdown with the ratings of the bonds but then I do not know where to head this analysis. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My final goal is to study the currency risks of that portfolio .. &lt;/p&gt;&#xA;" OwnerUserId="18000" LastEditorUserId="848" LastEditDate="2015-10-26T21:12:23.627" LastActivityDate="2015-10-26T21:12:23.627" Title="How to build a bond model portfolio (Invested in Emerging markets)" Tags="&lt;fixed-income&gt;&lt;portfolio&gt;" AnswerCount="0" CommentCount="4" ClosedDate="2015-10-26T21:11:51.713" ContentLicense="CC BY-SA 3.0" />
  <row Id="21448" PostTypeId="2" ParentId="2870" CreationDate="2015-10-26T16:56:34.747" Score="1" Body="&lt;p&gt;One of the more prominent proponents has a current paper on the reasons - and why this anomaly &quot;will persist&quot;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2537050&quot; rel=&quot;nofollow&quot;&gt;Why the Low Volatility Anomaly Will Persist&lt;/a&gt;&lt;br&gt;by Eric G. Falkenstein, March 2015 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Abstract&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Common explanations of the low volatility anomaly&#xA;  involve biases or frictions that cause investors to overpay for high&#xA;  volatility assets, giving them a negative alpha within the CAPM model,&#xA;  yet currently all such mechanisms are either heuristic or partial&#xA;  equilibrium. This paper shows that leverage constraints of Frazzini&#xA;  and Pedersen (2014) alone cannot explain this result if there also&#xA;  exist rational investors. If 3 non-standard assumptions are added —&#xA;  hybrid relative utility, delusional subset of investors, residual&#xA;  systematic risk across beta — then we can capture several facts&#xA;  existing models cannot simultaneously capture: a positive return to&#xA;  the market, positive holdings by rational investors to negative&#xA;  CAPM-alpha stocks, and a negative Security Market Line. New data&#xA;  relevant to these assumptions are presented.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And from the &lt;strong&gt;conclusion&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In sum, you need three assumption to generate the low volatility&#xA;  anomaly: beta estimation risk so that the high beta assets are not&#xA;  perfect substitutes to the market portfolio, some relative preferences&#xA;  that prevent rational agents from avoiding high beta stocks&#xA;  systematically when they offer below-CAPM returns, and lastly you need&#xA;  some sort delusion that causes some investors to reach for the high&#xA;  beta assets outside of the standard model.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="12" LastActivityDate="2015-10-26T16:56:34.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21449" PostTypeId="1" CreationDate="2015-10-26T18:47:24.310" Score="5" ViewCount="2198" Body="&lt;p&gt;I have just simulated 49 weeks of correlated returns on 5 different stocks, assuming returns being &lt;em&gt;lognormally distributed&lt;/em&gt;. Next, I am supposed to assume that the simulated 49 weeks of returns represents the actual performance of the 5 different stocks the last 49 weeks, and thereby measure the performance of each stock using any performance measures I find suitable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first question relates to whether I should use (1) simple returns or (2) log-returns when evaluating the performance of each stock using performance measures based on volatility (e.g. Sharpe ratio), extreme risk (e.g. reward-to-VaR) and lower partial moments (e.g. Sortino ratio)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, depending upon the correct answer to the first question, when calculating the average weekly return (i.e. mean return) on each stock, should I calculate a arithmetic or geometric mean of the simple return/log-return?&lt;/p&gt;&#xA;" OwnerUserId="18042" LastActivityDate="2015-12-26T09:09:18.850" Title="Risk-adjusted performance measurement: Log returns vs. simple returns and geometric vs. arithmetic mean return" Tags="&lt;performance-evaluation&gt;&lt;log-returns&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21451" PostTypeId="2" ParentId="21429" CreationDate="2015-10-26T19:47:21.240" Score="0" Body="&lt;p&gt;The currently existing interest rate curve (expressed for example in terms of the present value of 1 USD paid at various future dates, or equivalently as a list of forward rates for all future periods) is sufficient to price swaps by arbitrage. That is why no model, no simulation of future interest rates is necessary to value a swap (OTOH interest rate options like a caplet are a different kettle of fish). [Edited: Thanks AFK].&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2015-10-26T21:41:00.927" LastActivityDate="2015-10-26T21:41:00.927" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21452" PostTypeId="1" CreationDate="2015-10-26T20:14:41.407" Score="3" ViewCount="648" Body="&lt;p&gt;I'm thinking about the interplay of Dirichlet and Neumann BCs in a FDM scheme.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's assume a simple Black-Scholes call option problem, with BS PDE with constant coefficients, i.e. instead of $S$, in terms of $x=\ln(S)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In that case, the Dirichlet BC's are:&#xA;\begin{equation}&#xA;\begin{array}{l}&#xA;V(t,{x_ + }) = \exp ({x_ + }) - K{e^{ - r(T - t)}}\\&#xA;V(t,{x_ - }) = 0&#xA;\end{array}.&#xA;\end{equation}&#xA;This is normally sufficient for solving the PDE. However, if I consider that &#xA;\begin{equation}&#xA;\frac{{\partial V(t,{x_ + })}}{{\partial x}} = \frac{{{\partial ^2}V(t,{x_ + })}}{{\partial {x^2}}},&#xA;\end{equation}&#xA;this is also a valid BC for the upper boundary because $V(t,x) \propto {e^x}$ at the boundary.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;can I drop the Dirichlet BC, if for that boundary I have also Neumann BC? I know the result won't be the same but is that approach correct?&lt;/li&gt;&#xA;&lt;li&gt;can I use both types of BC at once? Would this yield a better approximation?&lt;/li&gt;&#xA;&lt;li&gt;Is the role of the Neumann BCs important rather in the case of, say, defining the option's behaviour at the boundaries of the variance grid ($v_-,v_+$), e.g. in the Heston model, where no Dirichlet boundaries for $v$ exist?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="18043" LastEditorUserId="18043" LastEditDate="2015-10-26T20:19:50.857" LastActivityDate="2015-10-27T01:46:06.793" Title="Boundary conditions: Dirichlet vs Neumann" Tags="&lt;black-scholes-pde&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21453" PostTypeId="1" AcceptedAnswerId="21474" CreationDate="2015-10-26T20:14:55.207" Score="2" ViewCount="121" Body="&lt;p&gt;I just started out with financial time series and I'm a bit stuck with ARMA models. I have the following ARMA process:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$-4X_t + X_{t-2} = Z_t + 0.2 Z_{t-1}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I am being asked for the polynomials of $\Phi$ and $\Theta$ so we can write the model as: $\Phi (B) X_t = \Theta (B) Z_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is how I am deriving my solution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \Phi(B) = 1-\phi_1 B - \phi_2 B^2 - ... - \phi_p B^p$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$=-4 +0B --1B^2 $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$= -4 +1B^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I'm not convinced that this answer is legit. Shouldn't this polynomial always start with 1?&lt;/p&gt;&#xA;" OwnerUserId="17778" LastEditorUserId="2587" LastEditDate="2015-10-27T07:11:26.910" LastActivityDate="2015-10-27T17:34:55.017" Title="Define polynomials of an ARMA process" Tags="&lt;time-series&gt;&lt;arma&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21454" PostTypeId="2" ParentId="21444" CreationDate="2015-10-26T22:49:43.447" Score="3" Body="&lt;p&gt;There is a lot of literature on the predictive power of IV - HV signal on detla hedged straddles for example. Where HV could be a variety of historical measures. I think there is a goyal and soretto? 2009 paper, and many others that cite it. This would mostly say that iv is predictive of more hv than the current hv measurement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Add the link: looks like I had it right from memory. &lt;a href=&quot;http://www.utdallas.edu/~axs125732/CrossOptionsJFE.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.utdallas.edu/~axs125732/CrossOptionsJFE.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1105" LastEditorUserId="1105" LastEditDate="2015-10-28T16:44:24.367" LastActivityDate="2015-10-28T16:44:24.367" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21455" PostTypeId="2" ParentId="21444" CreationDate="2015-10-26T23:51:36.693" Score="1" Body="&lt;p&gt;There are some old papers on this such as Fleming (1998) &lt;a href=&quot;http://www.ruf.rice.edu/~jfleming/pub/jef9810.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.ruf.rice.edu/~jfleming/pub/jef9810.pdf&lt;/a&gt; sorry I don't know the recent litterature.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-10-26T23:51:36.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21456" PostTypeId="2" ParentId="21452" CreationDate="2015-10-27T01:46:06.793" Score="1" Body="&lt;p&gt;You can certainly mix Dirichlet and Neumann boundary conditions, though the mixture has to be consistent.  For example it is fine to use Neumann as $x \rightarrow \infty$ and Dirichlet as $x \rightarrow 0$.  When pricing options on an $S$ grid rather than an $x$ grid this can make a lot of sense, because then you can put your bottom node right at zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tend to use Neumann more than Dirichlet for two reasons:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Neumann boundary conditions come from the SDE/PDE, so I don't need to do any work finding boundary values&lt;/li&gt;&#xA;&lt;li&gt;Once the option is in our portfolio, we care most about getting the hedge right, which is better done with Neumann.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I haven't used a PDE scheme for Heston but I would be inclined to go Neumann for the very reasons you cite.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2015-10-27T01:46:06.793" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21457" PostTypeId="1" CreationDate="2015-10-27T02:36:56.017" Score="1" ViewCount="192" Body="&lt;p&gt;Forgive me if this isn't the right place, and direct me to the correct place to post.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been trying to figure out how to get the yield rates for Mortgage Backed Securities (MBS's) in the United States dating back the last 30 years or so. I've been unable to do so. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The closest I have gotten is the command string &lt;code&gt;MTGEFNCL F10&amp;lt;GO&amp;gt;&lt;/code&gt; to get there. But that's for the historical current coupon (which I understand to be a different thing).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a command or a way to call the data for the yield rates?&lt;/p&gt;&#xA;" OwnerUserId="18049" LastEditorUserId="743" LastEditDate="2015-10-28T00:45:43.313" LastActivityDate="2015-10-28T00:45:43.313" Title="Returning historical yield rates for Mortgage Backed Securities in a Bloomberg Terminal?" Tags="&lt;bloomberg&gt;&lt;mbs&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21458" PostTypeId="1" CreationDate="2015-10-27T05:13:44.667" Score="2" ViewCount="100" Body="&lt;p&gt;So this question is directly about companies such as Axioma, Barra, Northfield, and etc. that provide risk management, portfolio optimization, and performance attribution related services. I want to get a feel to the extent that investment banks, asset management firms, and hedge funds use these types of services. I know the answer is going to be it varies. However, I would appreciate it if anyone can shed more light as to the extent of use and reasons for their limitations. Does everybody or do most divisions have access to these vendors? I understand cost is a reason, but what would else would prevent institutions from using it. I really would like to know more of their limitations from a practitioner point of view, because from what I understand they have a wealth of information and a diverse array of factors to understand and dissect the drivers of risk and return, relating it to exposure. &lt;/p&gt;&#xA;" OwnerUserId="18052" LastActivityDate="2015-10-27T05:13:44.667" Title="Commercial Vendors for Risk Management and Portfolio Optimization and Performance Attribution" Tags="&lt;risk-management&gt;&lt;portfolio-optimization&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21459" PostTypeId="2" ParentId="21449" CreationDate="2015-10-27T07:37:25.840" Score="0" Body="&lt;p&gt;Simulations are commonly based on a geometrical brownian motion. So in this case using lognormal returns approach is appropriate. This also bounds you to calculate a geometrical mean.&lt;/p&gt;&#xA;" OwnerUserId="15071" LastActivityDate="2015-10-27T07:37:25.840" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21460" PostTypeId="2" ParentId="21429" CreationDate="2015-10-27T07:54:09.933" Score="11" Body="&lt;p&gt;The reason why you can price a swap without a model is because you can replicate the payoff using only zero-coupon bonds. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the fixed leg this is trivial. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the floating leg, &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;at $T_0$ invest $1$ at Libor, &lt;/li&gt;&#xA;&lt;li&gt;at $T_1$ you get $1/B(T_0,T_1) = 1 + \tau L(T_0,T_1)$, &lt;/li&gt;&#xA;&lt;li&gt;you pay the floating coupon $\tau L(T_0,T_1)$ &lt;/li&gt;&#xA;&lt;li&gt;reinvest $1$ at Libor &lt;/li&gt;&#xA;&lt;li&gt;etc... &lt;/li&gt;&#xA;&lt;li&gt;at $T_{n}$, you get $1/B(T_0,T_1) = 1 + \tau L(T_0,T_1)$, &lt;/li&gt;&#xA;&lt;li&gt;you pay the floating coupon $\tau L(T_0,T_1)$ and you keep the $1$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So you replicated the floating leg payment and all you needed was $1$ at $T_0$ and you get back $1$ at $T_n$. So the PV of the float leg at time $t$ is $B(t,T_0) - B(t,T_n)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that I assumed the discount curve is the Libor curve. Things are actually a bit more complicated in a multicurve framework. &lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2015-10-28T01:43:51.023" LastActivityDate="2015-10-28T01:43:51.023" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21461" PostTypeId="2" ParentId="21449" CreationDate="2015-10-27T08:26:32.823" Score="2" Body="&lt;p&gt;In theory, stock prices are lognormally distributed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/HeC72.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/HeC72.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;People usually prove lognormality by referring to positivity and right skewness of stock prices. Mathematically (or philosophically if you wish), lognormality follows from the following equation $\frac{S}{dS}={\mu}dt+{\sigma}dW$, which you may see a lot in quantitative finance (&quot;random walk&quot;) or in physics (&quot;brownian motion&quot; or diffusion). If you solve this equation, you'll see that the price $S$ is lognormal indeed.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if you're not dealing with continuously compounding returns, especially with longer periods like weeks or years, you may not have a chance to observe continuous exponential compounding. Such a process can be very well described (or approximated if you wish) by geometric compounding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, back to your question. My advice for calculating risk adjusted measures in your case would be: unless you can prove, graphically or by statistical testing, that your weekly returns are lognormal, go with geometric averaging of simple percent changes. This will allow for (1) compounding and (2) better interpretability. Arithmetic averaging will give you wrong results when compounding. Lognormality will be an unnecessary complication in your case.&lt;/p&gt;&#xA;" OwnerUserId="13718" LastActivityDate="2015-10-27T08:26:32.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21462" PostTypeId="1" CreationDate="2015-10-27T11:54:04.917" Score="2" ViewCount="2634" Body="&lt;p&gt;I am trying to understand the SABR model. Specifically, I am having difficulty to understand how to calibrate the model parameters, that is,   &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;initial variance,&lt;/li&gt;&#xA;&lt;li&gt;volatility of variance,&lt;/li&gt;&#xA;&lt;li&gt;exponent for the forward rate, and&lt;/li&gt;&#xA;&lt;li&gt;correlation between the Brownian motions.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Small example on the above would be useful. Thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="12126" LastEditorUserId="11678" LastEditDate="2016-05-26T18:07:07.683" LastActivityDate="2016-07-21T21:09:37.030" Title="SABR Implied Volatility and Option Prices" Tags="&lt;implied-volatility&gt;&lt;sabr&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21463" PostTypeId="1" CreationDate="2015-10-27T12:28:34.323" Score="5" ViewCount="314" Body="&lt;p&gt;I am trying to do portfolio optimization for 5 stocks taking into account skewness of the portfolio but I am unable to incorporate skewness to the mean variance model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone please help on how to go about it citing the formulae used for portfolio optimation including the objective function?&lt;/p&gt;&#xA;" OwnerUserId="18056" LastEditorUserId="467" LastEditDate="2015-10-28T09:16:56.243" LastActivityDate="2015-10-28T09:22:44.053" Title="How to optimize a portfolio using skewness?" Tags="&lt;portfolio-management&gt;&lt;portfolio&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21464" PostTypeId="1" CreationDate="2015-10-27T12:51:03.563" Score="3" ViewCount="931" Body="&lt;p&gt;I found some functions for Markowitz mean variance portfolio optimization in R such as &lt;code&gt;portfolio.optim&lt;/code&gt; in &lt;code&gt;tseries&lt;/code&gt; package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I was not able to figure out how to use this function if I want to use my own calculated expected mean/return and variance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas on how to achieve that with this or any other function?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And does &lt;code&gt;portfolio.optim&lt;/code&gt; simply calculate the expected return as the mean of return series and expected volatility/risk as the standard-deviation of the return series? I cannot find it's detailed implementation in the &lt;a href=&quot;https://cran.r-project.org/web/packages/tseries/tseries.pdf&quot; rel=&quot;nofollow&quot;&gt;documentation&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="18057" LastEditorUserId="18057" LastEditDate="2015-10-29T01:44:33.120" LastActivityDate="2015-10-29T07:43:04.800" Title="How to perform portfolio optimization with user-defined expected return and variances using R?" Tags="&lt;programming&gt;&lt;portfolio-optimization&gt;&lt;mean-variance&gt;&lt;markowitz&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21465" PostTypeId="2" ParentId="21464" CreationDate="2015-10-27T13:36:55.210" Score="4" Body="&lt;p&gt;You can use the package &lt;code&gt;quadprog&lt;/code&gt; and define everything yourself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Code can look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quadprog)&#xA;Sigma = cov(data)&#xA;mu = mean(data)&#xA;Amat_in # define constraints here&#xA;bvec_in # define rhs of constraints here&#xA;solve.QP( Dmat = 2*Sigma, dvec = mu, meq=0,Amat=Amat_in,bvec=bvec_in)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;EDIT: Yes, and reading the &lt;a href=&quot;https://cran.r-project.org/web/packages/tseries/tseries.pdf&quot; rel=&quot;nofollow&quot;&gt;documentation&lt;/a&gt; we see that&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;portfolio.optim(x, pm = mean(x), riskless = FALSE,&#xA;shorts = FALSE, rf = 0.0, reslow = NULL, reshigh = NULL,&#xA;covmat = cov(x), ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the argument &lt;code&gt;covmat&lt;/code&gt; can be set. As it seems the single assets' expected return can not be set as &lt;code&gt;pm&lt;/code&gt; is the desired portfolio return. The documentation says that &lt;code&gt;solve.QP&lt;/code&gt; is used.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-10-29T07:43:04.800" LastActivityDate="2015-10-29T07:43:04.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21467" PostTypeId="2" ParentId="21463" CreationDate="2015-10-27T14:37:05.823" Score="1" Body="&lt;p&gt;You can not account or skewness in the mean-variance framework as skewness is the third central moment.&#xA;Thus what I would do is &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;formulate the skewness in terms of the asset returns. I.e. for each time-step you have&#xA;$$&#xA;r_t = \sum_{i=1}^5 w_i r^i_t,&#xA;$$ &#xA;where $r_t^i$ is the return of asset $i$ at time $t$, $w_i$ is the weight and $r_t$ the portfolio return at $t$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Then you can use the empirical estimator of skewness:&#xA;$$&#xA;skew = \frac{ 1/T \sum_{t=1}^T (r_t-\mu)^3}{ \sigma^3},&#xA;$$&#xA;where you need the portfolio variance &#xA;$$&#xA;\sigma^2 = w \Sigma w&#xA;$$&#xA;and the expected value &#xA;$$&#xA;\mu = 1/T \sum_{t=1}^T r_t,&#xA;$$&#xA;where the above is the sample estimator and&#xA;$$&#xA;\mu = \sum_{i=1}^5 w_i \mu_i&#xA;$$&#xA;is the expression in terms of individual expectations.&#xA;Then you can use this skewness above, $\sigma$ and $\mu$ to define the problem. E.g.&#xA;$$&#xA;\mu - \lambda \sigma^2 \rightarrow Max&#xA;$$&#xA;under the constraint $skew \ge x$ for some desired level $x$.&#xA;Or you use the definition of Cornish-Fisher-VaR in the constraint.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-10-28T09:22:44.053" LastActivityDate="2015-10-28T09:22:44.053" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21470" PostTypeId="1" AcceptedAnswerId="21471" CreationDate="2015-10-27T16:11:47.763" Score="1" ViewCount="58" Body="&lt;p&gt;Analysts expect the LIBOR to rise in the next two years. Hence, all companies that have foreign currency loans will face problems. I am preparing a study on this topic, but data is an extreme issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am currently having the &lt;code&gt;LT Debt in Foreign Currency&lt;/code&gt; for around 1000 companies, but I do not have the actual currency and I also do not know if this debt is fixed/floating. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would you set up such a study? Any suggestions, which balance sheet items should be stressed?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I appreciate your replies!&lt;/p&gt;&#xA;" OwnerUserId="5414" LastActivityDate="2015-10-27T16:35:48.013" Title="Stressing the going up of LIBOR - Which balance sheet variables to stress?" Tags="&lt;interest-rates&gt;&lt;economics&gt;&lt;macro-economics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21471" PostTypeId="2" ParentId="21470" CreationDate="2015-10-27T16:35:48.013" Score="2" Body="&lt;p&gt;To evaluate the impact on your FX portfolio of an increase in LIBOR, or any other rate for that matter, you must know:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Which currencies you have exposure to&lt;/li&gt;&#xA;&lt;li&gt;Which positions have a floating rate exposure and to what rate. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You can then model the relationship between LIBOR and those variables. Without that information, you cannot do anything. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if you have an exposure to the USD, you can model the relationship between LIBOR and USD and setup a test that stress LIBOR and using the model asses the impact on your portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As another example, if you have fixed debt, you need to model the relationship between LIBOR and the yield on this debt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You cannot simply stress balance sheet items without information. &lt;/p&gt;&#xA;" OwnerUserId="9265" LastActivityDate="2015-10-27T16:35:48.013" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21472" PostTypeId="1" CreationDate="2015-10-27T16:56:08.630" Score="5" ViewCount="550" Body="&lt;p&gt;I've been trying to understand the skew I see when looking at the skew of SPX.  Here is a snapshot today from thinkorswim.  I understand why IV increases for ITM puts -- namely because there is a negative correlation between volatility and moves of the underlying.  But I don't understand why the OTM puts IV increase with strike or why the ITM calls IV increase with strike.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/mNrq3.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/mNrq3.png&quot; alt=&quot;Skew of SPX&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been studying the different models that give rise to skew.  For example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Local volatility models (e.g. Derman papers)&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Riding on a Smile&lt;/li&gt;&#xA;&lt;li&gt;Regimes of Volatility&lt;/li&gt;&#xA;&lt;li&gt;The Local Volatility Surface&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://math.nyu.edu/~atm262/fall06/compmethods/a1/nimalinmoodley.pdf&quot; rel=&quot;noreferrer&quot;&gt;Heston stochastic volatility model&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I understand the increased IV on the left, but it is not obvious to me how these models explain the right portion of the plot above. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The skew plots seem to say that volatility is inversely correlated with underlying moves &lt;em&gt;for a while&lt;/em&gt;, but after a &quot;big&quot; move, that correlation (between volatility and underlying price) changes to positive.  Is that the correct interpretation?  Is this explained by the mean reverting nature of the stochastic volatility in the Heston model?&lt;/p&gt;&#xA;" OwnerUserId="17412" LastActivityDate="2015-10-27T22:29:42.040" Title="Understanding skew of SPX - Why does IV of OTM puts increase with strike?" Tags="&lt;options&gt;&lt;skew&gt;&lt;spx&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21473" PostTypeId="2" ParentId="21442" CreationDate="2015-10-27T17:15:21.157" Score="2" Body="&lt;p&gt;I would proceed as follows:&#xA;\begin{align*}&#xA;x_t &amp;amp;= x_{t-\delta t} + \alpha (\beta - x_{t-\delta t}) \delta t + \sigma x_{t-\delta t}^\gamma (w_t - w_{t-\delta t}),\\&#xA;x_t &amp;amp;= \max (x_t, \ 0),&#xA;\end{align*}&#xA;where $w_t - w_{t-\delta t}$ is a normal random variable with mean $0$ and variance $\delta t$, which can be obtained by an independent draw for each time step.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-10-27T17:15:21.157" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21474" PostTypeId="2" ParentId="21453" CreationDate="2015-10-27T17:34:55.017" Score="2" Body="&lt;p&gt;There is no particular issue with your polynomials. However if you really want them to both start with a 1, you can apply a change of variable by defining :&#xA;\begin{equation}Y_t = -\frac{1}{4}X_t\end{equation}&#xA;Then your polynomials $\Phi_y(B)$ and $\Theta(B)$ such that :&#xA;\begin{equation}\Phi_y(B)Y_t=\Theta(B)Z_t\end{equation}&#xA;will both start with a $1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is indeed often more convenient for the economic intuition to have both of them starting with $1$ with the idea that you want to explain the value of $X_t$ and not the value of $3X_t$ or $\lambda\cdot X_t$ with $\lambda\in\mathbf{R}$.&lt;/p&gt;&#xA;" OwnerUserId="18053" LastActivityDate="2015-10-27T17:34:55.017" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21475" PostTypeId="1" AcceptedAnswerId="21476" CreationDate="2015-10-27T19:05:58.257" Score="3" ViewCount="2986" Body="&lt;p&gt;What is the difference between historical and Gaussian method of VaR estimation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know how they are calculated, but what are the pros and cons of each?&lt;/p&gt;&#xA;" OwnerUserId="18062" LastEditorUserId="467" LastEditDate="2015-10-28T02:41:56.723" LastActivityDate="2017-10-05T00:05:25.723" Title="What are the pros and cons of historial and Gaussian approaches to VaR?" Tags="&lt;risk&gt;&lt;var&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21476" PostTypeId="2" ParentId="21475" CreationDate="2015-10-27T19:24:47.903" Score="3" Body="&lt;p&gt;&lt;strong&gt;Historical Simulation&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Pros:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Easy to calculate&lt;/li&gt;&#xA;&lt;li&gt;Doesn't make assumptions about distribution of returns (uses empirical distribution)&lt;/li&gt;&#xA;&lt;li&gt;Can add some enhancements onto it such as giving a higher weighting to more recent returns (prevents ghosting mentioned below) or a weighting by volatility where more volatile returns get a higher weight.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Cons&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Assumes the past will repeat itself, doesn't consider events that it has not seen before&lt;/li&gt;&#xA;&lt;li&gt;If you use the most basic historical simulation approach, as your historical window shifts, large losses or returns at the edge of the window will no longer be in your data-set and can cause a significant jump in the Var (this is called ghosting) which in very undesirable&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Guassian/Parametric/Delta Normal/Variance-Covariance (has many names)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Pros&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Relatively easy to calculate (more work than historical, but less compared to monte carlo)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Cons&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Assumes returns are normally distributed, which is often incorrect&lt;/li&gt;&#xA;&lt;li&gt;Assumes delta sensitivity accounts for all the risk&lt;/li&gt;&#xA;&lt;li&gt;Very inaccurate for non-linear positions like options (because of above point re delta)&lt;/li&gt;&#xA;&lt;li&gt;Need to compute an NxN covariance matrix for the portfolio.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="9265" LastEditDate="2015-10-28T03:00:58.987" LastActivityDate="2015-10-28T03:00:58.987" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21478" PostTypeId="2" ParentId="21472" CreationDate="2015-10-27T22:08:28.023" Score="2" Body="&lt;p&gt;When I saw these curves they seemed very strange to me. I believe it is a data-quality issue.I went to Bloomberg and I retrieved the implied vols for 70 near ATM strikes of the weekly SPX options expiring November 27 2015 (I believe that is the yellow curve in your diagrams i.e. November 4th week). This was today 2015-oct-27 at about 15:00 New York time. As you can see from the table below, the vols are monotonic for both calls and puts, completely unlike the U shape seen in the curve you posted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;27 Nov 15 (31d); IDiv 3.22; R .20; FF 2062.47   &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; Strike      Call IV      Put IV&#xA; 1975   15.950  17.352&#xA; 1980   16.484  17.058&#xA; 1985   0.000   16.795&#xA; 1990   16.175  16.462&#xA; 1995   21.817  16.258&#xA; 2000   16.235  16.202&#xA; 2005   15.485  15.908&#xA; 2010   15.730  15.712&#xA; 2015   15.887  15.481&#xA; 2020   15.250  15.330&#xA; 2025   15.148  15.013&#xA; 2030   14.812  14.895&#xA; 2035   14.701  14.598&#xA; 2040   14.341  14.363&#xA; 2045   13.884  14.156&#xA; 2050   13.916  13.899&#xA; 2055   13.774  13.678&#xA; 2060   13.465  13.358&#xA; 2065   13.217  13.194&#xA; 2070   13.041  12.981&#xA; 2075   12.724  12.638&#xA; 2080   12.560  12.289&#xA; 2085   12.307  11.587&#xA; 2090   11.977  11.123&#xA; 2095   11.737  11.042&#xA; 2100   11.606  11.676&#xA; 2105   11.426  11.275&#xA; 2110   11.146  7.126&#xA; 2115   11.081  10.512&#xA; 2120   10.891  9.904&#xA; 2125   10.755  0.000&#xA; 2130   10.574  0.000&#xA; 2135   10.489  0.000&#xA; 2140   10.370  0.000&#xA; 2145   10.243  0.000&#xA; 2150   10.324  0.000&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Make sure that your IV's are computed from the bid ask midpoint, not the last price (which could be several hours old) and that there is real market activity in the way far out of the money strikes that you are displaying. There was no activity at all today in strikes higher than 2120 (for puts) and very little above 2170 for calls. Those prices (and IV's) may not be meaningful. &lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2015-10-27T22:29:42.040" LastActivityDate="2015-10-27T22:29:42.040" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21479" PostTypeId="1" CreationDate="2015-10-28T00:26:20.760" Score="2" ViewCount="35" Body="&lt;p&gt;I wonder how risk-averse or risk-seeking investors behave in a stock market. &#xA;Is there any bibliography that deals with that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, suppose that we have a risk-averse investor that buys a stock of BuyMe Corp. at $10. It does that because the risk of this stock is low (low standard deviation/etc.) and he likes it. But what about the investor that &lt;em&gt;sold&lt;/em&gt; this stock? Is he also risk-averse? How can we infer that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose this stock has variable volatility over-time. When it has low volatility it is more attractive to a risk-averse investor. Then, its volatility increases, so the risk-averse investor wants to sell it, and a less risk-averse investor (or a more risk-seeking one) buys it. Is my intuition correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But then, if the volatility of this stock increases by an increase in price, it will become less attractive to the risk-averse investor. Why should he sell? Is he stupid?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Last, how can we identify the risk attitude of the investors by observing the stock market?&lt;/p&gt;&#xA;" OwnerUserId="8215" LastActivityDate="2015-10-28T00:26:20.760" Title="How does risk attitude influence trading? (Bibliography seeking)" Tags="&lt;risk&gt;&lt;trading&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21480" PostTypeId="1" CreationDate="2015-10-28T08:03:39.057" Score="1" ViewCount="156" Body="&lt;p&gt;In CFA Level Reading 45&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Commodities include precious metals, energy products, industrial&#xA;  metals, and agricultural products. Real assets are tangible properties&#xA;  such as real estate, airplanes, or machinery. Securities, currencies,&#xA;  and contracts are classified as financial assets whereas commodities&#xA;  and real assets are classified as physical assets.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So commodities is not a real asset? Commodities and real assets are part of physical assets?&lt;/p&gt;&#xA;" OwnerUserId="5016" LastEditorUserId="467" LastEditDate="2015-10-28T08:58:26.773" LastActivityDate="2015-10-28T08:59:14.030" Title="Are commodities a real assets or a physical assets?" Tags="&lt;asset&gt;" AnswerCount="0" CommentCount="4" ClosedDate="2015-10-28T09:02:56.150" ContentLicense="CC BY-SA 3.0" />
  <row Id="21483" PostTypeId="1" AcceptedAnswerId="21484" CreationDate="2015-10-28T11:27:55.000" Score="8" ViewCount="16373" Body="&lt;p&gt;In markets, many instruments are quoted in volatility, but how we can tell what kind of volatility is this? Is it normal volatility, or lognormal volatility. because it affect our hedging positions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you cant say that it is always log normal because market instruments are in log normal world. Think of Sweden that has negative interest rates now. As we know, negative rates can not be in log-normal world.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we have normal volatility then we use Bachelier's model to price it and if we have log normal volatility the we use Black 76 model to price. And it should not matter which model we use, we should always get the same price. Right? But what about the risk, delta, gamma, and vega? Two different models give you completely different risk measures and hedge positions.&lt;/p&gt;&#xA;" OwnerUserId="13329" LastEditorDisplayName="user13444" LastEditDate="2016-12-16T17:57:49.157" LastActivityDate="2017-02-17T08:33:01.047" Title="How do we know if the volatility which is quoted in market is Normal (Bachelier model) or log normal (Black 76)?" Tags="&lt;volatility&gt;&lt;gamma&gt;&lt;delta&gt;&lt;lognormal&gt;&lt;black76&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="21484" PostTypeId="2" ParentId="21483" CreationDate="2015-10-28T11:37:50.383" Score="9" Body="&lt;p&gt;Options on interest rates futures in the listed markets are always traded 1-yield (100-yield) just like the futures which are traded 1-yield. So negative rates aren't an issue and its always black volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the OTC market, both normal and black volatility are quoted, but the common practice is to use black volatility is what is way more frequently used. In the case of negative interest rates, as of right now, there aren't any liquid markets or quotes (normal or black volatility doesn't matter), mostly because negative rates is a recent 2015 phenomena. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, as the previous answer said, you can definitely get custom quotes from some experimenting dealers who can use some pricing formula off a SABR model or some other variation (but you can bet that dealer will give you horrible off-the-market quotes with wide bid/ask due to absence of a market). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the volatility curve quotes for EUR Swaptions in both normal and black volatility (see the missing volatility for 1Mo x 1Yr, 1Mo x 2Yr, 3Mo x 1Yr, etc.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Black Volatility&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/II0aW.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/II0aW.jpg&quot; alt=&quot;Black Volatility&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Normal Volatility&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/M4Pro.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/M4Pro.jpg&quot; alt=&quot;Normal Volatility&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When negative interest rates are not an issue, the full surface options quotes are available, e.g. in the US:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Black Volatility&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ZC6tq.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZC6tq.jpg&quot; alt=&quot;US Black Volatility&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Normal Volatility&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/1f3Zp.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/1f3Zp.jpg&quot; alt=&quot;US Normal Volatility&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Price should always match. It is up to the dealers on how they want to hedge it ---- &lt;strong&gt;and by and large, the futures (which is a way more liquid market) is used to hedge OTC options&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would not uncommon to use PCA models (and calculate a beta of the yields to the PCA models) to figure out the right hedge (DV01 based) for the futures, rather than using greeks per se.&lt;/p&gt;&#xA;" OwnerUserId="5948" LastEditorUserId="5948" LastEditDate="2015-10-29T16:40:31.837" LastActivityDate="2015-10-29T16:40:31.837" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21486" PostTypeId="2" ParentId="19038" CreationDate="2015-10-28T13:43:38.580" Score="7" Body="&lt;p&gt;Per @SKRX's suggestion, another solution is provided below. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For simplicity, we assume that the stock price process $\{S_t \mid t \geq 0\}$ follows an SDE, under the risk-neutral measure $\mathbb{Q}$, of the form&#xA;\begin{align*}&#xA;\frac{dS_t}{S_t} = r dt + \sigma dW_t,&#xA;\end{align*}&#xA;where $r$ is the constant interest rate, $\sigma$ is the constant volatility, and $\{W_t \mid t \geq 0\}$ is a standard Brownian motion. Moreover, let $B_t = e^{rt}$ be the money-market account value at time $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that&#xA;\begin{align*}&#xA;(S_T-K)^+ &amp;amp;= (S_T-K)\mathbb{1}_{S_T &amp;gt;K}\\&#xA;&amp;amp;= S_T\mathbb{1}_{S_T &amp;gt;K} - K \mathbb{1}_{S_T &amp;gt;K}.&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;e^{-rT} \mathbb{E}_{\mathbb{Q}}\big((S_T-K)^+ \big) &amp;amp;=e^{-rT}\mathbb{E}_{\mathbb{Q}}\big(S_T\mathbb{1}_{S_T &amp;gt;K}\big) - K e^{-rT}\mathbb{Q}(S_T &amp;gt;K)\\&#xA;&amp;amp;=e^{-rT}\mathbb{E}_{\mathbb{Q}}\big(S_T\mathbb{1}_{S_T &amp;gt;K}\big) - K e^{-rT}N(d_2).&#xA;\end{align*}&#xA;To compute the expectation $\mathbb{E}_{\mathbb{Q}}\big(S_T\mathbb{1}_{S_T &amp;gt;K}\big)$, we define the probability measure $\widetilde{\mathbb{Q}}$, so that we have the Radon-Nikodym derivative of the form&#xA;\begin{align*}&#xA;\frac{d\widetilde{\mathbb{Q}}}{d\mathbb{Q}}\big|_t &amp;amp;= \frac{S_t}{B_t S_0}\\&#xA;&amp;amp;=\exp\left(-\frac{\sigma^2}{2} t + \sigma W_t \right).&#xA;\end{align*}&#xA;By Girsanov theorem, $\{\widetilde{W}_t \mid t \geq 0\}$, where&#xA;\begin{align*}&#xA;\widetilde{W}_t = W_t - \sigma t,&#xA;\end{align*}&#xA;is a standard Brownian motion under the probability measure $\widetilde{\mathbb{Q}}$. Moreover, under $\widetilde{\mathbb{Q}}$,&#xA;\begin{align*}&#xA;\frac{dS_t}{S_t} = \left(r+ \sigma^2 \right) dt + \sigma d\widetilde{W}_t.&#xA;\end{align*}&#xA;Note also that&#xA;\begin{align*}&#xA;\frac{d\mathbb{Q}}{d\widetilde{\mathbb{Q}}}\big|_t &amp;amp;= \frac{B_tS_0}{S_t}.&#xA;\end{align*}&#xA;Therefore,&#xA;\begin{align*}&#xA;e^{-rT}\mathbb{E}_{\mathbb{Q}}\big(S_T\mathbb{1}_{S_T &amp;gt;K}\big) &amp;amp;=e^{-rT}\mathbb{E}_{\widetilde{\mathbb{Q}}}\left(\frac{d\mathbb{Q}}{d\widetilde{\mathbb{Q}}}\big|_T S_T\mathbb{1}_{S_T &amp;gt;K}\right)\\&#xA;&amp;amp;=S_0 \widetilde{\mathbb{Q}}(S_T &amp;gt;K)\\&#xA;&amp;amp;=S_0 N(d_1).&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;e^{-rT} \mathbb{E}_{\mathbb{Q}}\big((S_T-K)^+ \big)&#xA;&amp;amp;= S_0 \widetilde{\mathbb{Q}}(S_T &amp;gt;K) - K e^{-rT}\mathbb{Q}(S_T &amp;gt;K) \\&#xA;&amp;amp;= S_0 N(d_1) - K e^{-rT}N(d_2),&#xA;\end{align*}&#xA;which is the Black-Scholes formula.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-10-28T15:36:13.950" LastActivityDate="2015-10-28T15:36:13.950" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21487" PostTypeId="2" ParentId="21462" CreationDate="2015-10-28T16:40:11.333" Score="1" Body="&lt;p&gt;one of my friend recently wrote about SABR model and calibration. I highly recommend you to read it to get your answers&#xA;&lt;a href=&quot;http://janroman.dhis.org/stud/EXJOBB/SABR.pdf&quot; rel=&quot;nofollow&quot;&gt;http://janroman.dhis.org/stud/EXJOBB/SABR.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13329" LastActivityDate="2015-10-28T16:40:11.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21488" PostTypeId="2" ParentId="21443" CreationDate="2015-10-28T16:55:48.263" Score="0" Body="&lt;p&gt;I guess your question is more about model risk and model valuation. well you already mention all the ways that you can adjust your price. from my humble opinion, you should use implied volatility to get the correct value or do some calibrations on your parameters to get exact same price as market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Think of swaption for example. you can use either use black 76 model (log normal vol) or bachelier model (normal vol) and both works fine so It does not matter which model you use, you should always get the same exact price. in both models everything is identical such as K, S_0, T, r except volatilities. then you can say you have one to one relationship between price of option and volatility. right? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;what I mean and I hope that I did not confuse more is that, adjust your model (volatility) to market price.&lt;/p&gt;&#xA;" OwnerUserId="13329" LastActivityDate="2015-10-28T16:55:48.263" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21489" PostTypeId="2" ParentId="21046" CreationDate="2015-10-28T17:37:42.513" Score="-1" Body="&lt;p&gt;You should also use &lt;code&gt;make_shared()&lt;/code&gt; instead of calling &lt;code&gt;new&lt;/code&gt;.  See&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/20895648/difference-in-make-shared-and-normal-shared-ptr-in-c&quot;&gt;https://stackoverflow.com/questions/20895648/difference-in-make-shared-and-normal-shared-ptr-in-c&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3188" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2015-10-28T17:37:42.513" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21490" PostTypeId="2" ParentId="21464" CreationDate="2015-10-28T19:44:18.447" Score="0" Body="&lt;p&gt;Just came up with the thought that if I supply my expected return &lt;em&gt;vector&lt;/em&gt; instead of entire return series matrix to &lt;code&gt;portfolio.optim&lt;/code&gt;, and also provide my own covariance matrix using argument covmat=.., then this might work. &lt;/p&gt;&#xA;" OwnerUserId="18057" LastActivityDate="2015-10-28T19:44:18.447" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21492" PostTypeId="2" ParentId="19493" CreationDate="2015-10-28T20:33:13.330" Score="0" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;One last question, if i have a short position, i should just add a&#xA;  minus in front my position right for the VaR calculation right?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;When calculating VaR and expressing as a notional amount (as opposed to a percentage), you always use the absolute value of the position. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if your portfolio consists of short 100 EUR and long 150 EUR you do not calculate VaR against 50 EUR, but 150. &lt;/p&gt;&#xA;" OwnerUserId="9265" LastActivityDate="2015-10-28T20:33:13.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21493" PostTypeId="1" CreationDate="2015-10-28T20:43:43.277" Score="4" ViewCount="316" Body="&lt;p&gt;I am studying the ARCH(2) process given by &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X_t = \sqrt{h_t} \varepsilon_t$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$h_t = \alpha_0 + \alpha_1 X_{t-1} ^2 + \alpha_2 X_{t-2} ^2$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and $\varepsilon_t$ follows $N(0,1)$. Assuming the process is stationary both in variance and the fourth moment, such that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E(X_t ^2) = E(X_{t-1}^2) = E(X_{t-2} ^2),$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;how can I work on the term $E( X_{t-1} ^2 X_{t-2} ^2)$ in the $E(X_t ^4)$ expression? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I have done so far is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align*}&#xA;E(X_t ^4 ) &amp;amp;= E (E(X_t ^4 | \mathcal{F}_{t-1}))= E(\varepsilon_t ^4 | \mathcal{F}_{t-1}) E [(\alpha_0  + \alpha_1 X_{t-1} ^2 + \alpha_2 X_{t-2} ^2 ) ^2]\\&#xA;  &amp;amp;= E(\varepsilon_t ^4 | \mathcal{F}_{t-1}) E[(\alpha_0 ^2 + \alpha_1 ^2 X_{t-1} ^4 + \alpha_2 ^2 X_{t-2} ^4 + 2 \alpha_0 \alpha_1 X_{t-1} ^2 + 2 \alpha_0 \alpha_2 X_{t-2} ^2 \\ &#xA;  &amp;amp;+ 2 \alpha_1 \alpha_2 X_{t-1} ^2 X_{t-2} ^2 ] \\&#xA;  &amp;amp;= E(\varepsilon_t ^4 | \mathcal{F}_{t-1}) (\alpha_0 ^2 + \alpha_1 ^2 E(X_{t-1} ^4 )+ \alpha_2 ^2 E(X_{t-2} ^4) + 2 \alpha_0 \alpha_1 E(X_{t-1} ^2) + 2 \alpha_0 \alpha_2 E(X_{t-2} ^2) \\&#xA;  &amp;amp; + 2 \alpha_1 \alpha_2E( X_{t-1} ^2 X_{t-2} ^2)) \\&#xA;  &amp;amp;= E(\varepsilon_t ^4 | \mathcal{F}_{t-1}) (\alpha_0 ^2 + \alpha_1 ^2 E(X_{t-1} ^4 )+ \alpha_2 ^2 E(X_{t-2} ^4)) \\&#xA;  &amp;amp; \left(+ 2 \alpha_0 \alpha_1 \frac{\alpha_0}{1- \alpha_1 - \alpha_2 } + 2 \alpha_0 \alpha_2 \frac{\alpha_0}{1- \alpha_1 - \alpha_2 } + 2 \alpha_1 \alpha_2E( X_{t-1} ^2 X_{t-2} ^2)\right)&#xA;\end{align*}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;since $E(X_t ^2 ) = \frac{\alpha_0}{1- \alpha_1 - \alpha_2}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I treat the treat $E(X_{t-1} ^2 X_{t-2} ^2)$?&lt;/p&gt;&#xA;" OwnerUserId="15726" LastEditorUserId="19645" LastEditDate="2016-02-26T16:53:29.303" LastActivityDate="2016-02-26T16:53:29.303" Title="Fourth moment of ARCH(2)" Tags="&lt;time-series&gt;&lt;econometrics&gt;&lt;moments&gt;&lt;arch&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21494" PostTypeId="1" CreationDate="2015-10-28T20:45:57.210" Score="1" ViewCount="501" Body="&lt;p&gt;I am using &lt;code&gt;python&lt;/code&gt;, &lt;code&gt;pandas&lt;/code&gt;, &lt;code&gt;matplotlib&lt;/code&gt; to do the following: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have plotted some stock data with it's &lt;a href=&quot;https://en.wikipedia.org/wiki/Bollinger_Bands&quot; rel=&quot;nofollow&quot;&gt;Bollinger bands&lt;/a&gt;. The data plotted is &lt;code&gt;lower_BB&lt;/code&gt;, &lt;code&gt;upper_bb&lt;/code&gt;, and &lt;code&gt;df_data&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;lower_bb&lt;/code&gt; is a data frame containing the lower Bollinger band data&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;upper_bb&lt;/code&gt; is a data frame containing the upper Bollinger band data. &lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;df_data&lt;/code&gt; is a data frame containing data for one stock. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The plot is coming out correctly, but now I want to add vertical lines on my graph where I go long or short a stock. I am slightly confused as how I should do this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to long a stock if the df_data goes upward through the lower bollinger band and I want to short a stock if the df_data drops below the upper bollinger band. Any suggestions on how to do this?   &lt;/p&gt;&#xA;" OwnerUserId="18075" LastEditorUserId="467" LastEditDate="2015-10-29T02:08:01.607" LastActivityDate="2016-01-22T20:32:23.497" Title="How to add buy/sell market on a long/short Bollinger Bands graph in python?" Tags="&lt;programming&gt;&lt;quant-trading-strategies&gt;&lt;technical-analysis&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ClosedDate="2019-04-11T17:23:36.203" ContentLicense="CC BY-SA 3.0" />
  <row Id="21495" PostTypeId="1" AcceptedAnswerId="31583" CreationDate="2015-10-29T00:37:36.297" Score="3" ViewCount="89" Body="&lt;p&gt;Suppose we are in the BS framework.  If we replace the Brownian Motion with a more general fractional Brownian motion therein, how can it be interpreted?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is what is a financial interpretation of fractional brownian motion, what can it be understood to represent?&lt;/p&gt;&#xA;" OwnerUserId="11582" LastActivityDate="2016-12-20T18:41:46.697" Title="Soft: Interpretation Fractional BM in finance" Tags="&lt;stochastic-processes&gt;&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21496" PostTypeId="1" CreationDate="2015-10-29T04:07:14.897" Score="4" ViewCount="758" Body="&lt;p&gt;From what I am reading arrears swap are paid on the same day(actually, +2 business days for JPY and USD) as the reset date. To me then, a week before the reset date the floating rate is not known. Which means it is like predicting the rate a week ahead using nothing but ${\sigma}$ - volatility. The arrears swap rates are swap rates + convexity adjustment. Surely, there is no prediction here, just correcting yield to account for non linear price to yield relationship. Apparently price is linear with time but yield has to go through convexity correction. I hope someone will explain. I have read Hull's chapters several times, read literature on the internet etc, I have not found a clear description. I can add more details if it is not clear. Thanks. &lt;/p&gt;&#xA;" OwnerUserId="7867" LastActivityDate="2016-02-08T19:24:11.770" Title="If floating leg in an arrears swap is paid on the date then valuing them is like predicting future" Tags="&lt;swaps&gt;&lt;interest-rate-swap&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21497" PostTypeId="1" CreationDate="2015-10-29T04:11:28.840" Score="4" ViewCount="522" Body="&lt;p&gt;How do you compute the following integral:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\int_0^t e^{\mu s + \sigma W_s} ds$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\int_0^t e^{\mu s + \sigma W_s} dW_s$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are those integrals stochastic processes of some well-know type (log-normal, for instance)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since they are interrelated through Ito's integral, if we compute one of those we will immediately get the other one, so It doesn't matter which integral to consider:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ito's integral for $e^{\mu t + \sigma W_t}$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$e^{\mu t + \sigma W_t} = e^{W_0} + \int\limits_0^t (\mu + \frac{\sigma^2}{2})e^{\mu s + \sigma W_s} ds + &#xA;\int\limits_0^t \sigma e^{\mu s + \sigma W_s} d W_s&#xA;$&lt;/p&gt;&#xA;" OwnerUserId="17976" LastEditorUserId="17976" LastEditDate="2015-10-29T19:04:31.677" LastActivityDate="2015-10-29T19:04:31.677" Title="How to compute the stochastic integral of log-normal process?" Tags="&lt;stochastic-calculus&gt;&lt;lognormal&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21498" PostTypeId="2" ParentId="21483" CreationDate="2015-10-29T09:28:41.070" Score="3" Body="&lt;p&gt;Interest rate options (swaptions, caps, floors, spread options, mid-curves, etc) that are traded over-the-counter (OTC), as well as those listed on the Liffe/CME exchanges, have been quoted using Normal volatility (basis points, annualised) for quite some time for several reasons, not least of which is the lack of a real zero-bound in yields that you mentioned, as we've seen in Switzerland, Sweden, etc. Bond options (cash bond options, as well as sometimes those listed on Eurex) have historically used Lognormal vol, as have Equities and Commodities. I can tell you though that the big desks that make markets in Bond volatility think in terms of Normal vol as well because they are often traded/hedged with instruments on the swap curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's &lt;strong&gt;not&lt;/strong&gt; strictly correct to say &quot;it should not matter which model we use, we should always get the same price&quot;, which is of course related to why your greeks can be entirely different in various models. That is, you can't calibrate a model to the price of a negative yield receiver swaption (for instance) when that model (e.g. Lognormal) does not allow for negative yields. If you tried to do so, your model would &quot;blow up.&quot; In Europe this year as forward rates on the long end of the curve decreased significantly, 10 year expiry swaptions to receive 0% fixed for 10 years traded around 0.50% running, and some banks didn't have models which allowed for this type of pricing and therefore, as you suggested, were running the wrong hedges. When they adjusted their models, they had to take large write-downs and adjust their hedges accordingly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice in interest rates, dealers use some variation of the SABR model which allows for varying behaviour between strictly Lognormal and strictly normal via tweaking the model Backbone/Blend, sometimes in combination with a &quot;shifted zero&quot; which is really just an arithmetic hack for what 0% means in the model. This is because different parts of the interest rate curve tend to behave slightly differently.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally speaking though the quotes you're looking at should be easy to put in context and identify -- rarely would you find the annualised volatility of interest rates (maybe 50-100bpv) to be numerically close to that of a stock (maybe 15-30%), for instance.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2015-10-29T09:28:41.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21499" PostTypeId="1" CreationDate="2015-10-29T10:56:21.617" Score="0" ViewCount="1113" Body="&lt;p&gt;I recently received the following exercise:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Construct a &lt;span class=&quot;math-container&quot;&gt;$n=10$&lt;/span&gt;-period binomial model for the short-rate, &lt;span class=&quot;math-container&quot;&gt;$r_{i,j}$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;The lattice parameters are:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$r_{0,0}=5\%$&lt;/span&gt;,&lt;/li&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$u=1.1$&lt;/span&gt;,&lt;/li&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$d=0.9$&lt;/span&gt; and;&lt;/li&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$q=1−q=1/2$&lt;/span&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;This I did do at this point without any problems.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Assume that the 1-step hazard rate in node &lt;span class=&quot;math-container&quot;&gt;$(i,j)$&lt;/span&gt; is given by &lt;span class=&quot;math-container&quot;&gt;$H_{i,j}=ab^{j-i/2}$&lt;/span&gt; where &lt;span class=&quot;math-container&quot;&gt;$a=0.01$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$b=1.01$&lt;/span&gt;. Compute the price of a zero-coupon bond with face value &lt;span class=&quot;math-container&quot;&gt;$F=100$&lt;/span&gt; and recovery &lt;span class=&quot;math-container&quot;&gt;$R=20%$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Now this is a novel part for me as I till now did not price zero-coupon bonds with a default risk.&lt;/p&gt;&#xA;&lt;p&gt;My question from here is how do I, incorporate the values of the hazard lattice as well as the recovery rate into a zero-coupon bond pricing lattice. (Thus what formula would I use in order to do so correctly)?&lt;/p&gt;&#xA;" OwnerUserId="17688" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2015-11-02T07:44:47.377" Title="How to price a credit-risky zero-coupon bond?" Tags="&lt;zero-coupon&gt;&lt;default-risk&gt;" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="21501" PostTypeId="1" CreationDate="2015-10-29T15:38:33.130" Score="2" ViewCount="1521" Body="&lt;p&gt;I’ve been looking around for a R-package that will allow me to track my stock portfolio - basically I would like to enter stocks that I own, track the trades I make, calculate my open position &amp;amp; average cost, unrealized &amp;amp; realized P/L, etc… but I have not seen a package that does this.  Has anyone read about/use one with these sorts of functions?&#xA;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="18085" LastActivityDate="2019-07-03T09:57:12.000" Title="Portfolio Management in R" Tags="&lt;r&gt;&lt;finance&gt;&lt;portfolio&gt;&lt;quants&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21502" PostTypeId="1" CreationDate="2015-10-29T19:18:07.570" Score="1" ViewCount="130" Body="&lt;p&gt;I'm studying statistics for finance at university. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Last week i read the working paper on &lt;strong&gt;&quot;The Affine Arbitrage-Free Class of Nelson-Siegel Term Structure Models&quot;&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to reproduce in R this work but i'm not able to understand the state space form of equations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can i estimate term adjustment? &lt;/p&gt;&#xA;" OwnerUserId="18087" LastEditorUserId="743" LastEditDate="2015-10-31T03:38:24.827" LastActivityDate="2015-10-31T03:38:24.827" Title="affine arbitrage free class of nelson siegel yield curve" Tags="&lt;fixed-income&gt;&lt;yield-curve&gt;&lt;term-structure&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21503" PostTypeId="1" CreationDate="2015-10-29T21:33:43.807" Score="3" ViewCount="100" Body="&lt;p&gt;Is there a way to analitycally compute expectation of log-GARCH process? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The GARCH(1,1) process:&#xA;$dU_t = \theta(\omega - U_t) dt +  \xi U_t d W_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The log-GARCH(1,1) process:&#xA;$e^{U_t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The expectation I'm interested in:&#xA;$m(t) = E[e^{U_t}]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't find any explicit form (or any) of the GARCH process distribution, not to mention log-GARCH. Nethertheless, I have simulated $E[e^{U_t}]$ and it seems exponential, so I suspect, there migth be an explicit formula for $E[e^{U_t}]$. Is there?&lt;/p&gt;&#xA;" OwnerUserId="17976" LastEditorUserId="17976" LastEditDate="2015-11-01T10:42:46.783" LastActivityDate="2015-11-01T10:42:46.783" Title="Expected value of log-GARCH process" Tags="&lt;stochastic-processes&gt;&lt;garch&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21505" PostTypeId="2" ParentId="21501" CreationDate="2015-10-29T22:54:07.807" Score="1" Body="&lt;p&gt;You can do that with the &lt;a href=&quot;https://r-forge.r-project.org/projects/blotter&quot; rel=&quot;nofollow noreferrer&quot;&gt;blotter&lt;/a&gt; package. We use it to reconcile our trades.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's only available on R-Forge, so see &lt;a href=&quot;https://stackoverflow.com/q/11105131/271616&quot;&gt;this stackoverflow question&lt;/a&gt; for how to install it. Run the &quot;amzn_test&quot; demo for an example of how to use it:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(blotter)&#xA;demo(amzn_test)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="56" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2015-10-29T22:54:07.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21506" PostTypeId="1" CreationDate="2015-10-29T23:42:19.517" Score="1" ViewCount="166" Body="&lt;p&gt;Given that the implied volatility follows volatility skew, which one has higher implied volatility? At-the-money put 40 (spot = strike = 40) or at-the-money call 160 (spot = strike = 160)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure how relevant the volatility skew thing is but still, this question is confusing me so much. &lt;/p&gt;&#xA;" OwnerUserId="18088" LastEditorUserId="18088" LastEditDate="2015-10-30T00:15:48.613" LastActivityDate="2015-10-30T00:15:48.613" Title="Volatility Skew for Put and Call options" Tags="&lt;implied-volatility&gt;&lt;derivatives&gt;&lt;call&gt;&lt;put&gt;" AnswerCount="0" CommentCount="5" ClosedDate="2015-10-30T08:07:53.440" ContentLicense="CC BY-SA 3.0" />
  <row Id="21507" PostTypeId="2" ParentId="21503" CreationDate="2015-10-30T00:02:51.510" Score="3" Body="&lt;p&gt;To solve for $U_t$, we can proceed as follows. First, note that&#xA;\begin{align*}&#xA;d\left(e^{(\theta + \frac{1}{2}\xi^2)t - \xi W_t} U_t \right) &amp;amp;= e^{(\theta + \frac{1}{2}\xi^2)t - \xi W_t} U_t \left((\theta+\xi^2) dt -\xi dW_t\right) \\&#xA;&amp;amp;\qquad+ e^{(\theta + \frac{1}{2}\xi^2)t - \xi W_t} dU_t -\xi^2e^{(\theta + \frac{1}{2}\xi^2)t - \xi W_t} U_t dt\\&#xA;&amp;amp;=\theta \omega e^{(\theta + \frac{1}{2}\xi^2)t - \xi W_t} dt.&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;U_t &amp;amp;= U_0 e^{-(\theta + \frac{1}{2}\xi^2)t + \xi W_t } + \theta \omega \int_0^t e^{-(\theta + \frac{1}{2}\xi^2)(t-s) + \xi (W_t-W_s)} ds.&#xA;\end{align*}&#xA;From here, we can compute $E(U_t)$ analytically. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, for Expectation $E(e^{U_t})$, we note the following. Let $\eta$ be a standard normal random variable. Then&#xA;\begin{align*}&#xA;E\left(e^{(e^{\eta})} \right) &amp;amp;= \frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}e^{(e^x-1/2x^2)}dx \\&#xA;&amp;amp;=\infty,&#xA;\end{align*}&#xA;as &#xA;\begin{align*}&#xA;\lim_{x \rightarrow \infty}e^{(e^x-1/2x^2)} = \infty.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, we consider $E\left(e^{U_t}\right)$. Note that, for $\theta \omega \geq 0$ and $U_0&amp;gt;0$,&#xA;\begin{align*}&#xA;U_t &amp;amp;= U_0 e^{-(\theta + \frac{1}{2}\xi^2)t + \xi W_t } + \theta \omega \int_0^t e^{-(\theta + \frac{1}{2}\xi^2)(t-s) + \xi (W_t-W_s)} ds\\&#xA;&amp;amp;\geq U_0 e^{-(\theta + \frac{1}{2}\xi^2)t + \xi W_t }.&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;E(e^{U_t}) &amp;amp;\geq E\left(e^{U_0 e^{-(\theta + \frac{1}{2}\xi^2)t + \xi W_t }} \right)\\&#xA;&amp;amp;=\frac{1}{\sqrt{2\pi}} \int_{-\infty}^{\infty} e^{U_0 e^{-(\theta + \frac{1}{2}\xi^2)t + \xi \sqrt{t} x-\frac{1}{2}x^2}}dx\\&#xA;&amp;amp;= \infty.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NOTE: If $\omega =0$, then $U_t$ is log-normal. Related information: In the interest rate world, if the short rate $r_t$ is log-normal, then the money market account value $B_t = e^{\int_0^t r_s ds}$ has infinite expectation; see Page 63 of the book &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/3540221492&quot; rel=&quot;nofollow&quot;&gt;Interest Rate Models&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-11-01T00:38:33.430" LastActivityDate="2015-11-01T00:38:33.430" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="21509" PostTypeId="1" CreationDate="2015-10-30T07:33:35.427" Score="4" ViewCount="1175" Body="&lt;p&gt;In a binomial option model, if we take the uptick as 6%, downtick as 5% (assume equally probable), and RFR of 6% (continuous compounding), then we have a violation of $0 &amp;lt; d &amp;lt; 1 + r &amp;lt; u$.  Does this mean we cannot proceed with the pricing model at all?  Is no-arbitrage one of the required assumptions?&lt;/p&gt;&#xA;" OwnerUserId="18091" LastActivityDate="2018-06-13T12:32:48.223" Title="Does the Binomial Pricing Model require a no-arbitrage assumption?" Tags="&lt;option-pricing&gt;&lt;binomial-tree&gt;&lt;binomial&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21510" PostTypeId="2" ParentId="21496" CreationDate="2015-10-30T10:10:31.527" Score="0" Body="&lt;p&gt;lets take it as simple that all payment are at the same time. When you want to calculate the floating, you always look at the previous period. But to calculate the first payment, we do not have forward rate at time t=0. But when you want to calculate between two periods, you have forward rates and you can always fix the rate for next period (floating one). So you can always calculate how much will be the floating one,one period before it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you are discounting and you have a floating at time T and you have another t  , if you want to discount and see how much does it dost today, you can either discount it back with D(T) or you discount first to time t with D(t,T) and then D(t). you know the rate D(T) and D(t ) but you don’t know the rate D(t,T). but if we discount in either way, we  should get the same result, then we should have&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;$$D(T)=D(t).D(t,T)$$&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Think that you want to calculate the Forward rate between $[T_{i-1}, T_i]$ which will be :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ D(T_i)=D(T_{i-1}).D(T_{i-1},T_i)$$&#xA;Since $D(T_{i-1},T_i)$ is less than a year, we can put simple compounding formula and get:&#xA;$$D(T_i)= D(T_{i-1}).D(T_{i-1},T_i)=\frac{D(T_{i-1})}{1+\Delta_i.F_i}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and now u can solve for $F_i$:&#xA;$$F_i=\frac{D(T_{i-1})-D(T_i)}{\Delta_i .D(T_i)}$$&lt;/p&gt;&#xA;" OwnerUserId="13329" LastActivityDate="2015-10-30T10:10:31.527" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21512" PostTypeId="1" CreationDate="2015-10-30T15:09:34.653" Score="1" ViewCount="36" Body="&lt;p&gt;What do you think is the correct way to calculate expected return for this example?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think Method4 below is correct. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Method1 35.4% = AVERAGE(1.0, 0.5^(1/2)-1)&lt;/strong&gt;&#xA;Incorrect, but some will argue that you have a 50% chance of a 100% annualised rate of return (if you received 2 in year 1), and a 50% chance of a -29.3% annualised rate of return (if you received 0.5 in year 2)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Method2 16.0% = 1.25^(1/1.5)-1&lt;/strong&gt;&#xA;Better - you expect to receive an average of 1.25 after an average of 1.5 years&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Method3 20.7% = IRR({-2,2,0.5}) in Excel&lt;/strong&gt;&#xA;Maybe - you repeat the experiment and find the IRR of the resulting accumulated cashflows (the numbers in the IRR formula should be scaled up for the number of experiments...assumed to be just 2 here for clarity).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Method4 0%&lt;/strong&gt;&#xA;Correct, I think. You repeatedly reinvest in the bet so that you are forever doubling and halving your money. So for a sequence of say 1000 such bets your cumulative money is expected to be 100 = 100*(2.0^500 * 0.5^500) after 1500 = (1*500 + 2*500) years, so your annualised expected return is 0%&lt;/p&gt;&#xA;" OwnerUserId="18095" LastEditorUserId="18097" LastEditDate="2015-11-06T15:01:40.747" LastActivityDate="2015-11-06T15:01:40.747" Title="What is the expected rate of return from paying 1 today for a 50/50 bet receiving either 2 in year 1 or 0.5 in year 2?" Tags="&lt;return&gt;" AnswerCount="0" CommentCount="1" ClosedDate="2015-10-30T16:16:56.323" ContentLicense="CC BY-SA 3.0" />
  <row Id="21513" PostTypeId="1" AcceptedAnswerId="21516" CreationDate="2015-10-30T16:11:14.010" Score="6" ViewCount="4423" Body="&lt;p&gt;Let's take the following three SDEs:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dr=u(r,t)dt + w(r,t)dX$$&#xA;$$u(r,t)=a(t)-br$$&#xA;$$w(r,t)=c$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $b$ and $c$ are constants and  $a(t)$ an arbitrary function of time $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If Zero Coupon Bond $Z(r,T,T)=1$ for this model has the form&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Z(r,t,T)=e^{(A(t,T)-B(t,T)r)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do you find $A$ and $B$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have derived the PDE for this model using no arbitrage condition. Substituting this in the PDE is not giving the right answers.&lt;/p&gt;&#xA;" OwnerUserId="18059" LastEditorUserId="6686" LastEditDate="2018-04-22T17:42:22.383" LastActivityDate="2018-04-22T17:42:22.383" Title="Extended Hull White Interest Rate Model for Zero Coupon Bond" Tags="&lt;stochastic-calculus&gt;&lt;hullwhite&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="21514" PostTypeId="1" AcceptedAnswerId="21515" CreationDate="2015-10-30T18:21:51.607" Score="1" ViewCount="243" Body="&lt;p&gt;How to interpolate PDF(Probability Distribution Functions) from CDF (without root finding method) ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please tell the steps to do so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="18059" LastActivityDate="2015-10-30T19:38:43.017" Title="Interpolation for PDF from Cumulative Distribution" Tags="&lt;interpolation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21515" PostTypeId="2" ParentId="21514" CreationDate="2015-10-30T19:38:43.017" Score="1" Body="&lt;p&gt;If you have an analytical form of the CDF, you can simply take the first derivative to obtain the PDF (for a continuous distribution). If you have numerical data points representing a CDF, you can construct a numerical approximation to the first derivative by using a finite difference method. If you're going the numerical route, you should use at least a symmetric second-order finite difference, since it's just as easy as the first-order methods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;PDF(x) = \frac{CDF(x+\delta x) - CDF(x-\delta x)}{2 \,\delta x} + O(\delta x^2)&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="8097" LastActivityDate="2015-10-30T19:38:43.017" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21516" PostTypeId="2" ParentId="21513" CreationDate="2015-10-30T20:54:03.520" Score="8" Body="&lt;p&gt;Here is a solution without using the PDE technique, which is preferred as we do not need to assume the affine form of a zero-coupon price from the start.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;we assume that, under the risk-neutral measure,&#xA;\begin{align*}&#xA;dr_t = (\theta(t)-a r_t) dt + \sigma dW_t,&#xA;\end{align*}&#xA;where $a$ and $\sigma$ are constants, $a(t)$ is a deterministic function, and $W_t$ is a standard Brownian motion. We seek to compute the zero-coupon bond price defined by&#xA;\begin{align*}&#xA;P(t, T) &amp;amp;=  E\left(e^{-\int_t^T r_s ds} \mid \mathcal{F}_t \right),&#xA;\end{align*}&#xA;where $\mathcal{F}_t$ is the information set up to time $t$.&#xA;Note that&#xA;\begin{align*}&#xA;d\left(e^{at} r_t\right) &amp;amp;= be^{at}r_t dt + e^{at} dr_t\\&#xA;&amp;amp;=\theta(t)e^{at} dt + \sigma e^{at} dW_t.&#xA;\end{align*}&#xA;Then, for $s \geq t \geq 0$,&#xA;\begin{align*}&#xA;e^{as} r_s = e^{at} r_t + \int_t^s \theta(u)e^{au} du + \int_t^s \sigma e^{au} dW_u.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;r_s = e^{-a(s-t)} r_t + \int_t^s  \theta(u)e^{-a(s-u)} du + \int_t^s \sigma e^{-a(s-u)} dW_u.&#xA;\end{align*}&#xA;We then have the integral&#xA;\begin{align*}&#xA;&amp;amp;\ \int_t^T r_s ds \\&#xA;=&amp;amp;\  r_t \int_t^T e^{-a(s-t)} ds + \int_t^T\!\!\!\!\int_t^s \theta(u)e^{-a(s-u)} du ds + \int_t^T\!\!\!\!\int_t^s\sigma e^{-a(s-u)} dW_u ds\\&#xA;=&amp;amp;\ \frac{1}{a}\Big(1-e^{-a(T-t)} \Big) r_t + \int_t^T\!\!\!\!\int_u^T \theta(u)e^{-a(s-u)} ds du + \int_t^T\!\!\!\!\int_u^T \sigma e^{-a(s-u)} ds dW_u\\&#xA;=&amp;amp;\ \frac{1}{a}\Big(1-e^{-a(T-t)} \Big) r_t + \int_t^T\!\! \frac{\theta(u)}{a}\Big(1-e^{-a(T-u)} \Big)du + \int_t^T \!\!\frac{\sigma}{a}\Big(1-e^{-a(T-u)} \Big)dW_u.&#xA;\end{align*}&#xA;Let &#xA;\begin{align*}&#xA;B(t, T) = \frac{1}{a}\Big(1-e^{-a(T-t)} \Big).&#xA;\end{align*}&#xA;Then, &#xA;\begin{align*}&#xA;\int_t^T r_s ds &amp;amp;= B(t, T) r_t + \int_t^T  \theta(u) B(u, T) du + \int_t^T \sigma B(u, T) dW_u.&#xA;\end{align*}&#xA;Moreover, the zero-coupon bond price is then given by&#xA;\begin{align*}&#xA;P(t, T) &amp;amp;=  E\left(e^{-\int_t^T r_s ds} \mid \mathcal{F}_t \right)\\&#xA;&amp;amp;=\exp\left(-B(t, T) r_t - \int_t^T  \theta(u) B(u, T) du + \frac{1}{2}\int_t^T \sigma^2 B(u, T)^2 du\right).&#xA;\end{align*}&#xA;Note that&#xA;\begin{align*}&#xA;\int_t^T \sigma^2 B(u, T)^2 du &amp;amp;= \frac{\sigma^2}{a^2}\int_t^T \left(1 - 2e^{-a(T-u)} + e^{-2a(T-u)}\right) du\\&#xA;&amp;amp;=\frac{\sigma^2}{a^2}\left(T-t-\frac{2}{a}\Big(1-e^{-a(T-t)}\Big) +\frac{1}{2a} \Big(1-e^{-2a(T-t)}\Big) \right)\\&#xA;&amp;amp;= \frac{\sigma^2}{a^2}\left(T-t -\frac{1}{2a}\Big(1-e^{-a(T-t)}\Big)^2-\frac{1}{a}\Big(1-e^{-a(T-t)}\Big)\right)\\&#xA;&amp;amp;= -\frac{\sigma^2}{a^2}\big(B(t, T) -T+t\big)-\frac{\sigma^2}{2a}B(t, T)^2.&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;P(t, T) &amp;amp;= A(t, T) e^{-B(t, T) r_t},&#xA;\end{align*}&#xA;where &#xA;\begin{align*}&#xA;A(t, T) &amp;amp;= \exp\left(- \int_t^T  \theta(u) B(u, T) du -\frac{\sigma^2}{2a^2}\big(B(t, T) -T+t\big)-\frac{\sigma^2}{4a}B(t, T)^2\right).&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://www.math.nyu.edu/~benartzi/Slides10.3.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.math.nyu.edu/~benartzi/Slides10.3.pdf&lt;/a&gt; for another derivation using the PDE approach.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-10-30T21:02:33.357" LastActivityDate="2015-10-30T21:02:33.357" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21517" PostTypeId="2" ParentId="4944" CreationDate="2015-10-30T23:11:54.500" Score="0" Body="&lt;p&gt;Just read some papers recently. Hope it is helpful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some model I know with such &lt;em&gt;Bang&lt;/em&gt; phenomena is called: &lt;em&gt;Jump-Diffusion Model&lt;/em&gt;. The idea is a little different. We add Poisson counter term into the equation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other side, there is lots of work on test of such &lt;em&gt;Bang&lt;/em&gt; phenomena, which is called &quot;structural break&quot;. One early reference is the following:&#xA;&lt;em&gt;&quot;Estimating and Testing Linear Models with Multiple Structural Changes.&quot;&lt;/em&gt; Jushan Bai and Pierre Perron, 1998. &lt;/p&gt;&#xA;" OwnerUserId="18099" LastActivityDate="2015-10-30T23:11:54.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21518" PostTypeId="1" CreationDate="2015-10-31T01:54:58.827" Score="3" ViewCount="398" Body="&lt;p&gt;In practice, even without maturity and underlying mismatch, hedging using futures does not always require a one-to-one hedge ratio. Tailing factor needs to be considered. Suppose the current spot price is $3. With 50 percent of the probability, the spot price will increase or decrease by 1 dollar for each year as shown in the graph below. If the annual discrete compounding risk-free rate is 10%, and the cost of carry offsets the convenience yield exactly, then what is your hedging strategy?&lt;/p&gt;&#xA;" OwnerUserId="18101" LastEditorUserId="467" LastEditDate="2015-11-02T05:02:22.760" LastActivityDate="2015-11-02T05:02:22.760" Title="What is the correct hedging strategy using futures?" Tags="&lt;hedging&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21519" PostTypeId="1" CreationDate="2015-10-31T11:53:52.613" Score="2" ViewCount="1570" Body="&lt;p&gt;Is it possible to run BEKK-GARCH in Stata? mgarch is of a different model type and google provide me with no good hints.&lt;/p&gt;&#xA;" OwnerUserId="17286" LastActivityDate="2017-08-28T08:55:57.347" Title="BEKK - GARCH model in Stata" Tags="&lt;volatility&gt;&lt;garch&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21521" PostTypeId="1" AcceptedAnswerId="21527" CreationDate="2015-10-31T16:57:04.010" Score="2" ViewCount="975" Body="&lt;p&gt;Let's consider a simple European option in the Black-Scholes framework.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is it about the maths of $SN(d_1) - KN(d_2)$ that makes its value always greater than $S-K$, when $S&amp;gt;K$? (I assume zero interest rate throughout).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By time value I mean the difference between the value of the option and the intrinsic value, where intrinsic value is $\max(S-K,0)$.&lt;/p&gt;&#xA;" OwnerUserId="7220" LastEditorUserId="467" LastEditDate="2015-11-02T04:41:30.303" LastActivityDate="2015-11-02T04:41:30.303" Title="Why is the time value of an option mathematically always positive?" Tags="&lt;black-scholes&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21524" PostTypeId="1" CreationDate="2015-10-31T20:55:06.963" Score="4" ViewCount="4486" Body="&lt;p&gt;I am a final year student in quantitative finance. To get my degree, I need to write a research paper (approx. 50 pages) about any quantitative financial topic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After getting my degree I would like to work as a structurer in an investment bank, on any product (with maybe a slight preference for the interest rate industry).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, still being a student, I am not really aware of the current (or near future) big issues or debates that exist in that field, and to which I could make a contribution. Could you give me ideas of subjects of this kind, that I could use?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, I would like these topics to be useful for the industry, in the sense that I would like to use my expertise to get a job. Ideally, it should not be too abstract and could be applied in a structurer job.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for your help&lt;/p&gt;&#xA;" OwnerUserId="15650" LastActivityDate="2015-10-31T20:55:06.963" Title="Current big topics in quantitative finance for a research paper?" Tags="&lt;research&gt;&lt;structured-finance&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ClosedDate="2015-11-01T12:52:08.003" ContentLicense="CC BY-SA 3.0" />
  <row Id="21525" PostTypeId="2" ParentId="21521" CreationDate="2015-11-01T08:48:29.920" Score="0" Body="&lt;p&gt;I think I have part of it. Assume zero interest rate and T = 1. Then the call price C is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C  =  S.N(d1) – K.N(d2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where S is underlying price, K is strike, and &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;d1 = ln(S/K)/V+V/2&#xA;d2 = d1 – V/2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;d1 and d2 roughly represent the moneyness in terms of standard deviation, including the term V/2 which is added in d1, and subtracted in d2. Nd1 and Nd2 represent the moneyness in terms of probability. Note that the deeper in the money, the closer the probability gets to 1. &#xA;Now when S &gt; K, it is easy to show that time value must be positive. Let X = 1-Nd1, and Y = 1-Nd2. Then&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C = S(1-x) – K(1-Y) = S-K +Y-X = intrinsic value + Y – X&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since d1 is always a bit greater than d2 because of the V/2 term, it follows that Nd1 is closer to 1, and so Y&gt;X.&lt;/p&gt;&#xA;" OwnerUserId="7220" LastActivityDate="2015-11-01T08:48:29.920" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21526" PostTypeId="1" CreationDate="2015-11-01T09:31:02.347" Score="1" ViewCount="40" Body="&lt;p&gt;I am unable to derive the correct result eq2 all my answers seem circular, any help would be much appreciated. It should basically end up saying that shocks that affect all securities compress betas towards 1. In this case a funding shock, i.e. increase in borrowing constraints. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Equation 1&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P_t^s=\frac{E_t (P_{t+1}+\delta_{t+1} )-\gamma \Omega x^*}{1+r^f+\psi_t }$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Equation 2&lt;/strong&gt;&#xA;$$\frac{\frac{\partial P_t^s}{\partial \psi_t}}{P_t^s}: \frac{-1}{1+r^f+\psi_t} =E_t (P_{t+1}+\delta_{t+1} )-\gamma \Omega x^*$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$\psi$ is the Lagrange multiplier, proxying funding constraints&lt;/li&gt;&#xA;&lt;li&gt;$\Omega$ is the covariance matrix&lt;/li&gt;&#xA;&lt;li&gt;$\gamma$ represents risk aversion&lt;/li&gt;&#xA;&lt;li&gt;$x^*$ vector of shares&lt;/li&gt;&#xA;&lt;li&gt;$P_{t+1}+\delta_{t+1}$ is expected future payoff&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The price $P_t$ is derived from the equation below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Eq3:$ $x^*=1/γ$ $Ω^{-1}$ $(E_t (P_{t+1}+δ_{t+1} )$$-$$(1+r^f+ψ_t ) P_t )$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The optimal portfolio of shares $x^*$ is derived from&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Eq4:$ $max$⁡$〖x'(E_t (P_{t+1}+δ_{t+1} )$$-$$(1+r^f ) P_t)-γ^{i/2}〗$$ x'Ωx$ &lt;/p&gt;&#xA;" OwnerUserId="15171" LastEditorUserId="15171" LastEditDate="2015-11-03T07:47:40.067" LastActivityDate="2015-11-03T07:47:40.067" Title="How to derive what effect funding shocks have on conditional market betas?" Tags="&lt;asset-pricing&gt;&lt;beta&gt;" AnswerCount="0" CommentCount="3" ClosedDate="2015-11-03T07:57:57.027" ContentLicense="CC BY-SA 3.0" />
  <row Id="21527" PostTypeId="2" ParentId="21521" CreationDate="2015-11-01T13:33:27.797" Score="5" Body="&lt;p&gt;We consider the case $S\leq K$ only. In this case, the intrinsic value is zero. Note that,&#xA;\begin{align*}&#xA;\frac{\partial C}{\partial S} = N(d_1) &amp;gt;0.&#xA;\end{align*}&#xA;That is, $C$ is a strictly increasing function of the spot level $S$. Moreover, &#xA;\begin{align*}&#xA;\lim_{S\rightarrow 0} d_{1, 2} = -\infty.&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;\lim_{S\rightarrow 0} C = 0.&#xA;\end{align*}&#xA;Therefore, $C&amp;gt;0$ holds.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-11-01T13:45:50.990" LastActivityDate="2015-11-01T13:45:50.990" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21528" PostTypeId="1" AcceptedAnswerId="21531" CreationDate="2015-11-01T20:05:35.040" Score="2" ViewCount="174" Body="&lt;p&gt;If we have $N$ assets which are uncorrelated, but have the same mean return of $\mu$ but the &lt;strong&gt;variances are different&lt;/strong&gt; where $\sigma_i^2$ is the variance of each asset $i = 1, 2,...,N$ how can you write a formula for the minimum-variance point? Write the result in terms of $\sigma_p^2=\sum_{i=1}^N{1/\sigma_i^2}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried solving the minimization problem by minimizing the portfolio variance subject to the weights summing to one, however when taking the inverse of the matrix to get the weights I cannot seem to write an elegant solution. Any help would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="9501" LastEditorUserId="467" LastEditDate="2015-11-02T01:19:20.183" LastActivityDate="2015-11-02T01:20:52.863" Title="How to calculate a hypothetical minimum-variance point?" Tags="&lt;portfolio-management&gt;&lt;optimization&gt;&lt;modern-portfolio-theory&gt;&lt;minimum-variance&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21529" PostTypeId="1" CreationDate="2015-11-01T20:25:22.610" Score="2" ViewCount="219" Body="&lt;p&gt;Is there an R package which can estimate a covariance matrix using OHLC (Open/High/Low/Close) share prices for upwards of 40 shares using the Yang &amp;amp; Zhang method using daily data? I google searched and have yet to find anything to this extent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am aware that the package 'TTR' can estimate volatility using this method (and several others).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there is not a package which can create a covariance matrix using OHLC prices, is it possible to create a covariance matrix from the volatility estimates using the TTR package? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alex&lt;/p&gt;&#xA;" OwnerUserId="18116" LastActivityDate="2015-11-01T20:25:22.610" Title="OHLC Covarianc Estimation" Tags="&lt;volatility&gt;&lt;portfolio-management&gt;&lt;portfolio-optimization&gt;&lt;covariance-estimation&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21531" PostTypeId="2" ParentId="21528" CreationDate="2015-11-01T21:38:17.063" Score="2" Body="&lt;p&gt;The general formula for the global minimum variance portfolio is $w=\frac{C^{-1} 1}{1^T C^{-1} 1}$ where C is the covariance matrix and 1 is a vector of 1's. In this case the covariance matrix is diagonal with $\sigma_i^2$ in the ith diagonal element. Its inverse is also diagonal and has $\frac{1}{\sigma_i^2}$ in the ith diagonal element.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Evaluating the expression above we get that the weight for asset $i$ is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{1/\sigma_i^2}{\sum_k 1/\sigma_k^2}$$&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="467" LastEditDate="2015-11-02T01:20:52.863" LastActivityDate="2015-11-02T01:20:52.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21532" PostTypeId="1" CreationDate="2015-11-02T00:35:04.150" Score="7" ViewCount="202" Body="&lt;p&gt;Hull (9 ed.) states on p 707,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;Equilibrium models usually start with assumptions about economic variables and derive a process for the short rate...&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;He then states the usual short rate models such as Vasicek's, given by&#xA;$$&#xA;dr = a(b - r)dt + \sigma dW.&#xA;$$&#xA;The &quot;economic&quot; variables to be calibrated are&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$a$ = mean reversion speed&lt;/li&gt;&#xA;&lt;li&gt;$b$ = long term mean&lt;/li&gt;&#xA;&lt;li&gt;$\sigma$ = volatility.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;What exactly is &quot;economic&quot; about these parameters?  These seem like purely mechanical parameters, something to be tuned to the happenings of a time series.  In fact, here's a time series of the 1-week LIBOR with daily observations - how is a diffusion model supposed to capture these stair step patterns, and then the puttering around zero for the last 6 years?  &lt;a href=&quot;https://i.stack.imgur.com/SqdQe.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/SqdQe.jpg&quot; alt=&quot;LIBOR&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems dubious to attempt to calibrate a diffusion model in the hopes of capturing this observed behavior.  Rather, I suppose a short rate modeler may decide on &quot;regimes&quot; in the data, and calibrate to only the data he feels best fits the current regime.  But again - what &quot;economic&quot; assumptions am I making?  Would a prudent modeler not calibrate to the data, and let that speak for itself?  Is some senior manager with a PhD in economics supposed to have some insight into the values of the parameters and we use those instead?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2018-11-05T13:32:30.653" Title="&quot;Economic&quot; Variables in Short Rate Models" Tags="&lt;interest-rates&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21533" PostTypeId="1" CreationDate="2015-11-02T09:33:54.217" Score="-3" ViewCount="1811" Body="&lt;p&gt;I am looking for more details to perform simple and log returns for an entire portfolio. However, I've only been able to find the following semi-reliable &lt;a href=&quot;http://faculty.washington.edu/ezivot/econ424/returnCalculations.pdf&quot; rel=&quot;nofollow&quot;&gt;source&lt;/a&gt; (see Page 9 and Page 19):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are my questions&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Are the details for calculating portfolio returns described in the PDF correct? I understand the math but don't trust the source.&lt;/li&gt;&#xA;&lt;li&gt;Are there better resources that can confirm these calculations?&lt;/li&gt;&#xA;&lt;li&gt;What do I need to do/alter in the calculation if there is a rebalancing of the portfolio (or a set of assets are removed/added/replaced) in between the start and end dates?&lt;/li&gt;&#xA;&lt;li&gt;When using portfolio log returns, is there a way to attribute increases/decreases in returns to specific assets within the portfolio (i.e., to say that assets A, B, and C increased by 3%, 4%, and 10%, respectively which resulted in an overall portfolio return of +5%)? &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="18124" LastEditorUserId="18124" LastEditDate="2015-11-02T14:12:49.357" LastActivityDate="2019-06-11T10:35:14.693" Title="How to compute simple and log portfolio returns?" Tags="&lt;returns&gt;&lt;portfolio&gt;&lt;log-returns&gt;" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="21536" PostTypeId="1" CreationDate="2015-11-02T12:24:11.413" Score="1" ViewCount="274" Body="&lt;p&gt;The Kelly Ratio maximises the expected cumulative return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it has been criticised for leading to excessive volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a version of the kelly formula that maximises the risk adjusted return?&lt;/p&gt;&#xA;" OwnerUserId="6392" LastActivityDate="2016-01-04T22:38:33.810" Title="Risk Adjusted Kelly Ratio?" Tags="&lt;kelly-criterion&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21537" PostTypeId="1" AcceptedAnswerId="21546" CreationDate="2015-11-02T13:18:46.460" Score="2" ViewCount="463" Body="&lt;p&gt;I am new to &lt;a href=&quot;http://quantlib.org/index.shtml&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;quantlib&lt;/code&gt;&lt;/a&gt; and I want use it to to price a touch option (single/double).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I searched on google for example code but I could not find anything. Hence, I am not sure if &lt;code&gt;quantlib&lt;/code&gt; supports touch option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you please give me some pointers? &lt;/p&gt;&#xA;" OwnerUserId="11777" LastEditorUserId="15650" LastEditDate="2015-11-03T21:13:00.107" LastActivityDate="2015-11-03T21:13:00.107" Title="How to price touch options using quantlib?" Tags="&lt;option-pricing&gt;&lt;programming&gt;&lt;quantlib&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21538" PostTypeId="1" AcceptedAnswerId="21974" CreationDate="2015-11-02T13:27:48.237" Score="1" ViewCount="464" Body="&lt;p&gt;I'm struggling to find VaR &amp;amp; ES data for ETF's on websites such yahoo finance &amp;amp; Morningstar. Where can I find this data?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks, &lt;/p&gt;&#xA;" OwnerUserId="18094" LastActivityDate="2015-11-28T19:22:57.907" Title="Where can I find Value at Risk &amp; Expected shortfall for ETF's?" Tags="&lt;etf&gt;&lt;value-at-risk&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21539" PostTypeId="1" AcceptedAnswerId="21573" CreationDate="2015-11-02T17:06:03.303" Score="3" ViewCount="309" Body="&lt;p&gt;If the VXX is simply a constant maturity weighted average of the 1st and 2nd month VIX futures prices, then why is its market price always larger than the maximum of the two? (the larger of the two is the 2nd month if in contango). I would expect it to always sit somewhere between the 1st and 2nd month prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, today at time of writing I observe the following prices:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nov 17th VIX future (15 days to expiry) : 16.10&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dec 15th VIX future (43 days to expiry) : 17.00&lt;/p&gt;&#xA;&#xA;&lt;p&gt;VXX                                     : 18.49&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would expect the VXX right now to be roughly the average of the two, i.e 16.55. What is wrong with my reasoning here?&lt;/p&gt;&#xA;" OwnerUserId="1133" LastEditorUserId="1133" LastEditDate="2015-11-02T17:34:03.647" LastActivityDate="2015-11-04T16:46:52.200" Title="Why is the value of the VXX ETN always above short-term VIX futures prices?" Tags="&lt;equities&gt;&lt;market-data&gt;&lt;futures&gt;&lt;vix&gt;&lt;etf&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21546" PostTypeId="2" ParentId="21537" CreationDate="2015-11-03T00:08:04.430" Score="3" Body="&lt;p&gt;Touch option is simply a barrier option in QuantLib. You could create one like a down-in barrier type. You can also set the payoff to a binary payoff. The payoff is represented by the StrikePayOff class. A comprehensible example is available on github &lt;a href=&quot;https://github.com/lballabio/quantlib/blob/master/QuantLib/test-suite/barrieroption.cpp&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="467" LastEditDate="2015-11-03T08:02:41.610" LastActivityDate="2015-11-03T08:02:41.610" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21548" PostTypeId="2" ParentId="21533" CreationDate="2015-11-03T02:45:52.323" Score="2" Body="&lt;p&gt;Computing returns is one of the first things you learn when you start studying finance but I believe it's one the trickiest one once you get to complicated cases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://faculty.washington.edu/ezivot/econ424/returnCalculations.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;source&lt;/a&gt; you mentioned seems actually very good to me and it already takes into account different approaches and different subtleties like dividend payment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this is in fact only the top of the iceberg, because there are many things that make computing returns of portfolios complicated. For example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Transaction costs&lt;/strong&gt; which can happened at trade or portfolio level and which can be expressed as a percentage of flat fees.&lt;/li&gt;&#xA;&lt;li&gt;For funds, having &lt;strong&gt;investors buying or selling shares&lt;/strong&gt; makes it more difficult for you to express your portfolio returns.&lt;/li&gt;&#xA;&lt;li&gt;You have might be very &lt;strong&gt;illiquid assets&lt;/strong&gt; for which there are no bid (nobody wants to by it), what the price then?&lt;/li&gt;&#xA;&lt;li&gt;Many more examples I'm sure more experienced community members could be able to highlight.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For examples on how to compute portfolio returns on some these more advanced cases, I'd suggest you to look at the &lt;a href=&quot;https://www.cfainstitute.org/pages/index.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;CFA Institute&lt;/a&gt; and their material. To be fair it might even be possible that the best book for this would not actually be finance book but some sort of accounting book.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, note that computing returns is something that somehow depends on interpretation. There are many different ways to compute and present past performance and that has be used many times in the past to make products look better than they really are (or at least, has helped to hide some products' weaknesses). This is why some organization exist now to kind of audit the way performance is reported, such as &lt;a href=&quot;http://www.gipsstandards.org/Pages/index.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;GIPS&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer your questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The source seems fine to me, although I didn't read it completely so if you have something &lt;strong&gt;specific&lt;/strong&gt; you're worried about you can enhance your question.&lt;/li&gt;&#xA;&lt;li&gt;Better I'm not sure. But you can have a look at the &lt;a href=&quot;https://www.cfainstitute.org/pages/index.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;CFA curriculum&lt;/a&gt; books.&lt;/li&gt;&#xA;&lt;li&gt;You need to take this into account to make sure your comparison &quot;ending price vs initial prices&quot; is apple-to-apple.&lt;/li&gt;&#xA;&lt;li&gt;This is &lt;a href=&quot;https://en.wikipedia.org/wiki/Performance_attribution&quot; rel=&quot;nofollow noreferrer&quot;&gt;performance attribution&lt;/a&gt; and it's a whole topic on its own.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="467" LastEditorUserId="16595" LastEditDate="2019-06-11T10:35:14.693" LastActivityDate="2019-06-11T10:35:14.693" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="21549" PostTypeId="2" ParentId="19464" CreationDate="2015-11-03T06:07:33.150" Score="0" Body="&lt;p&gt;The best book i can think of are from FRM Quant program. The concepts for which you are seeking answers could be easily found in FRM part 1 books (Initial chapters). These are pretty expensive, but if you could get your hands on any older versions, that should be fine. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any MBS book would have these topics. But the reader must have keen intent to extract the information. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;All Interest rates and MBS primarily depend on few formula &quot;KE to the power of RT&quot; and &quot;P(1 + r/n)to the power of n*t&quot;. Most formula's are based on the above two. These could be slightly tweaked to customize as per requirements to include constant costs, recurring costs and any special costs. &lt;/p&gt;&#xA;" OwnerUserId="6799" LastActivityDate="2015-11-03T06:07:33.150" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21550" PostTypeId="2" ParentId="10108" CreationDate="2015-11-03T06:14:53.903" Score="0" Body="&lt;p&gt;Please note, I am not from US market, so providing based on my views. MBS is a security and Bonds are also a security in our market. Both are backed by a type of mortgage. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The price movement action is primarily based on Demand Supply Ratio. I have seen bonds (as per your market, its MBS) below their Face value. &lt;/li&gt;&#xA;&lt;li&gt;If the markets anticipates an interest rates rise, people invest in stocks of banks anticipating more profits for bank because of interest rate hikes. But money in a market is constant. In order to invest in one asset, holding assets should be sold. Bonds are sold, and the proceeds often gets invested into stocks. &lt;/li&gt;&#xA;&lt;li&gt;Did we consider the Ratings/tranche(as per your market) of these? How secured are they? If markets anticipate risk in one sector, the corresponding MBS for these might go down. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="6799" LastActivityDate="2015-11-03T06:14:53.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21552" PostTypeId="1" AcceptedAnswerId="21557" CreationDate="2015-11-03T12:49:09.800" Score="0" ViewCount="80" Body="&lt;p&gt;Here is a problem in Hull's book and the given solution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/wMSv1.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/wMSv1.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;My approach was to compute the profit $\pi = \pi_{SP} + \pi_{LC}$ (short put, long call).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;One can show that $\pi = \pi_{SP} + \pi_{LC} = S_T - K + p_{SP} - p_{LC}$, where $p_{SP}, p_{LC}$ are the prices of the options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if we want $p_{SP} = p_{LC}$, then we must have $\pi = S_T - K$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is that right?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;I'm not quite sure I understand the last two sentences of the answer in the solutions manual. What is the difference between forward price and delivery price? What I think the answer means:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Because the payoff from LC and SP (long call and short put) is $S_T - K$, because the payoff from a fwd contract is $S_T - F$ and because a fwd contract is LC and SP combined, $p_{SP} = p_{LC}$ when $K = F$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I understanding right? How exactly does the conclusion follow if so? If not, what exactly does the solutions manual mean to say?&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="7788" LastEditDate="2015-11-03T19:57:16.053" LastActivityDate="2015-11-03T23:08:27.970" Title="Finding circumstances for price of call = price of put" Tags="&lt;option-pricing&gt;&lt;pricing&gt;&lt;forward&gt;&lt;price&gt;&lt;european&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21553" PostTypeId="1" CreationDate="2015-11-03T14:12:08.633" Score="14" ViewCount="1595" Body="&lt;p&gt;I wonder whether there are or we can collect cheat-sheets for the various international regulations of the financial markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is e.g. &lt;a href=&quot;http://media.mofo.com/files/uploads/images/summarydoddfrankact.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;the Dodd-Frank act&lt;/a&gt; for the US. Can we gather cheat sheets for all the other international regulations such as: Basel II/III (with the directives), Solvency II, EMIR, and all those out there?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Being a (quantitative) risk manager it is hard for me to follow all of them and soemtimes speaking with customers it looks good to know the basic facts about these regulations - apart from the advantage of knowing them for oneself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe we can gather blog series as well. Then it is easier to stay up-to-date and collect the entries in appropriate software and make it searchable and so on. An example in the Basel world is this &lt;a href=&quot;http://www.value3-advisory.com/rr-6-basel-iv-deconstructed/&quot; rel=&quot;nofollow noreferrer&quot;&gt;blog&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;EMIR: &lt;a href=&quot;http://www.emissions-euets.com/risk-mitigation-techniques-emir/collateral&quot; rel=&quot;nofollow noreferrer&quot;&gt;This is one of the best summaries of the Collateral requirements under EMIR &lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.thierry-roncalli.com/RiskManagement.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Thierry Roncalli&lt;/a&gt; wrote lecture notes on risk management and financial regulation. They cover many things (more or less &quot;everything&quot;) on more than 700 pages. The lecture notes will not be updated for the next year as then a book will be published. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2017-05-11T07:37:27.813" LastActivityDate="2017-05-11T07:37:27.813" Title="Cheatsheet/summary of financial laws and regulations" Tags="&lt;banking-regulations&gt;&lt;financial-markets&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="21554" PostTypeId="2" ParentId="21553" CreationDate="2015-11-03T16:40:31.457" Score="15" Body="&lt;p&gt;Here's a few. The categories are not mutually exclusive (e.g. since most investment advisors are obviously affected by tax and short-selling).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Investment advisors&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Investment Advisers Act of 1940&lt;/li&gt;&#xA;&lt;li&gt;Investment Company Act of 1940&lt;/li&gt;&#xA;&lt;li&gt;SIPA of 1970&lt;/li&gt;&#xA;&lt;li&gt;ERISA of 1974&lt;/li&gt;&#xA;&lt;li&gt;JOBS Act of 2012&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Europe&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Criminal Justice Act 1993&lt;/li&gt;&#xA;&lt;li&gt;Financial Services Act 1986&lt;/li&gt;&#xA;&lt;li&gt;Financial Services Act 2012&lt;/li&gt;&#xA;&lt;li&gt;FSMA 2000&lt;/li&gt;&#xA;&lt;li&gt;AIFMD&lt;/li&gt;&#xA;&lt;li&gt;EMIR&lt;/li&gt;&#xA;&lt;li&gt;MiFID I/II&lt;/li&gt;&#xA;&lt;li&gt;Solvency I/II&lt;/li&gt;&#xA;&lt;li&gt;ESMA MAD I/II and MAR&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Commodities&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Commodities Exchange Act of 1936&lt;/li&gt;&#xA;&lt;li&gt;CFMA of 2000&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;AML&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;BSA of 1970&lt;/li&gt;&#xA;&lt;li&gt;FCPA of 1977&lt;/li&gt;&#xA;&lt;li&gt;PATRIOT Act of 2001&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Taxation&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;FIRPTA of 1980&lt;/li&gt;&#xA;&lt;li&gt;Taxpayer Relief Act 1997&lt;/li&gt;&#xA;&lt;li&gt;Sarbanes-Oxley Act of 2002&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Broker-dealers and securities exchanges&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Securities Exchange Act of 1934&lt;/li&gt;&#xA;&lt;li&gt;Basel I/II/III&lt;/li&gt;&#xA;&lt;li&gt;Dodd-Frank&lt;/li&gt;&#xA;&lt;li&gt;FRB Reg D Reserve requirements&lt;/li&gt;&#xA;&lt;li&gt;FRB Reg M Short selling rules&lt;/li&gt;&#xA;&lt;li&gt;FRB Reg S Reimbursement for providing financial records&lt;/li&gt;&#xA;&lt;li&gt;FRB Reg SHO Short selling practices&lt;/li&gt;&#xA;&lt;li&gt;FRB Reg T Margin requirements&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2015-11-03T16:40:31.457" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="21555" PostTypeId="1" CreationDate="2015-11-03T16:52:40.217" Score="1" ViewCount="52" Body="&lt;p&gt;I am using Mathematica to price options (built in functions, no need to reinvent the wheel, right?). In the documentation, the Binomial method is used as an example of specifying a non-standard method. I wanted to try other methods like Finite Difference and MonteCarlo, however, these do not work when I specify them, and I cannot find a list anywhere of the different methods available. Does anyone have any resources that I can use to better understand what is going on under the hood here?&lt;/p&gt;&#xA;" OwnerUserId="18144" LastActivityDate="2015-11-03T16:52:40.217" Title="Methods Available for Derivative Pricing in Mathematica?" Tags="&lt;options&gt;&lt;monte-carlo&gt;&lt;pricing&gt;&lt;finite-difference-method&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ClosedDate="2015-11-03T17:32:55.913" ContentLicense="CC BY-SA 3.0" />
  <row Id="21556" PostTypeId="2" ParentId="18714" CreationDate="2015-11-03T17:43:22.037" Score="1" Body="&lt;p&gt;It is not a direct answer to your question, but if the real problem is the lack of data, you can check &lt;a href=&quot;https://www.datagrapple.com/&quot; rel=&quot;nofollow&quot;&gt;www.datagrapple.com&lt;/a&gt; for spreads on the tenors 1, 3, 5, 7 and 10 years for coporate, financial, sovereign CDS and iTraxx / CDX indices.&lt;/p&gt;&#xA;" OwnerUserId="16457" LastActivityDate="2015-11-03T17:43:22.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21557" PostTypeId="2" ParentId="21552" CreationDate="2015-11-03T19:50:46.477" Score="1" Body="&lt;p&gt;You are mostly right, I don't really get what you don't understand. The answer in the book is quite clear, but let me put it that way :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Selling a put and buying a call on the same underlying $S$ with same maturity and same stike $K$ is always equivalent to a long position in a forward contract on $S$ with delivery price $K$. The easiest way to see that is to draw the payoff of such a strategy in a simple graph, you should get a 45° line crossing the $x$-axis at $K$. Then we know that a forward contract with delivery price $F$ (the forward rate) costs nothing. Then if you want your strategy to cost nothing, you should set $K=F$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that it's the beginning of the book, but you may want to look at the Put-Call parity. Without details, it is a relation that links the price of a call with the price of a put on the same underlying, same maturity and same strike. The Put-Call parity can be expressed as follows (with $r$ the risk-free rate) :&#xA;\begin{equation}&#xA;C-P=S-Ke^{-rt}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With $F = Se^{rt}$ you can see that :&#xA;\begin{equation}&#xA;C-P=e^{-rt}(F-K)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So we have $F=K$ $\iff$ $C=P$. The demonstration should be in the Hull's book.&lt;/p&gt;&#xA;" OwnerUserId="18053" LastEditorUserId="18053" LastEditDate="2015-11-03T23:08:27.970" LastActivityDate="2015-11-03T23:08:27.970" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="21558" PostTypeId="1" CreationDate="2015-11-03T20:38:26.173" Score="1" ViewCount="419" Body="&lt;p&gt;I'm trying to solidify my understanding of options pricing and risk neutral distributions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the assumptions of the Black-Scholes option pricing were true for an underlying (namely that the future stock price would be described by a lognormal distribution) and one were always able to find an option where the underlying price, the IV, and strike were exactly the same, would the expected return of purchasing (or selling) this option over and over again, be equal to zero? (Maybe if not exactly zero, it is the forward price of the option adjusted by the risk-free rate.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, let's say I buy a weekly call one week to expiration.  Every week, I can find some stock that is trading at 100 and has an IV of 15%.  Every week I buy the 100 strike option.  If the risk free rate is zero, we can say that 50% of the time the call expires OTM and 50% ITM.  What is the expected returned (within the assumptions of BS) of this strategy?  I think the answer is zero.  Is that correct?  In other words, the times we make money exactly balances the times the call expires worthless. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; So I thought I'd try to  approach the question with a simulation.  What I did was perform a Monte Carlo simulation.  My understanding is that &lt;a href=&quot;https://en.wikipedia.org/wiki/Geometric_Brownian_motion&quot; rel=&quot;nofollow&quot;&gt;BS assumes the future price will follow&lt;/a&gt;:&#xA;$$ S = S_0 \exp\left(\mu t - \frac{\sigma^2}{2} t + \sigma \sqrt{t} u \right) $$&#xA;where $u$ is a draw from a standard normal distribution.  If I set $\mu=0$ and calculate $S$ for 50,000 different $u$'s, I can then calculate the value of the call at expiry by $\max(S-K,0)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following the hypothetical above:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Initial price S0 = 100&lt;/li&gt;&#xA;&lt;li&gt;Strike K = 100&lt;/li&gt;&#xA;&lt;li&gt;Risk free rate r = 0&lt;/li&gt;&#xA;&lt;li&gt;Time to expiry T = 7/365&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The BS equations will value this call at 0.829.  The Monte Carlo simulation agrees to within two decimals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What about the risk free rate?  If we set it to 3%, BS value will increase to 0.857.  I can make the Monte Carlo match if I set $\mu$ in the equation above to $r$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still interested in comments as to whether I'm approaching this correctly.&lt;/p&gt;&#xA;" OwnerUserId="17412" LastEditorUserId="17412" LastEditDate="2015-11-04T23:48:59.267" LastActivityDate="2015-11-05T09:26:52.243" Title="Assuming Black-Scholes assumptions are correct, would the expected return from buying/selling options be 0?" Tags="&lt;black-scholes&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21559" PostTypeId="2" ParentId="18822" CreationDate="2015-11-03T22:48:47.883" Score="2" Body="&lt;p&gt;@user788171: I checked the 20140721,911-914 prices above and they also don't match with TickData.com's minute quotes &amp;amp; trades history. TickData is the premier data feed used by the exchanges themselves to archive their history.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The QuantQuote volume appears larger than TickData and the prices offset. Maybe QuantQuote doesn't remove bad ticks expunged by the exchange.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or, it could be that QuantQuote corrected their data since the original post and the poster just got a bad order. I wouldn't be surprised, it is not the first time they have done a bait and switch with their price data. As other posters have reported, QuantQuote has run multiple forks of their data in the past to conceal errors.&lt;/p&gt;&#xA;" OwnerUserId="18147" LastActivityDate="2015-11-03T22:48:47.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21560" PostTypeId="2" ParentId="21539" CreationDate="2015-11-03T22:59:17.047" Score="-2" Body="&lt;p&gt;The reason is known as &quot;Contango&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See this article for a more detailed explanation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.minyanville.com/mvpremium/2014/02/06/volatility-trades/&quot; rel=&quot;nofollow&quot;&gt;VXX: Contango and Cash&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11932" LastActivityDate="2015-11-03T22:59:17.047" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21561" PostTypeId="2" ParentId="8196" CreationDate="2015-11-03T23:21:45.037" Score="1" Body="&lt;p&gt;I actually discuss this question at length in chapter 1 of More Mathematical Finance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The essential point is that if you can write&#xA;$$&#xA;X=YZ&#xA;$$&#xA;with $Y,Z$ independent $E(Z)=1$ and $Z&amp;gt;0$ then $X$ is more uncertain than $Y.$ It then follows from Jensen's inequality that the price of an option on $X$ that has a convex pay-off will be at least as high as the same option on $Y.$&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-11-03T23:21:45.037" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21562" PostTypeId="2" ParentId="15828" CreationDate="2015-11-03T23:26:24.720" Score="1" Body="&lt;p&gt;Volume should never be negative. Period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Volume can be zero (0) on rare occasions. Usually related to an ECN.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most likely cause is during processing, the cumulative volume exceeded the int size of a variable (32-bit) and rolled over. Some programming languages will use -1 (0xFFFFFFFF) to designate an integer overflow.&lt;/p&gt;&#xA;" OwnerUserId="11932" LastActivityDate="2015-11-03T23:26:24.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21563" PostTypeId="2" ParentId="21558" CreationDate="2015-11-03T23:29:46.410" Score="3" Body="&lt;p&gt;BS does not require this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The real-world drift of the stock can be greater than the risk-free rate so on average you make money.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this seems weird, forget the option and consider the stock. If you buy it and hold it for a week then you ought to make money on average about the risk-free rate since you get a risk compensation for the fact you can lose money.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-11-03T23:29:46.410" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21564" PostTypeId="2" ParentId="21558" CreationDate="2015-11-03T23:38:58.130" Score="1" Body="&lt;p&gt;This is entirely true. The basic pricing formula that is intended to work for all assets (including options) is&#xA;\begin{equation}&#xA;P=E[m*X]&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $P$ is the price, $m$ the discount factor, and $X$ the payoff. This can also be rewrite &#xA;\begin{equation}&#xA;1=E[m*R]&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $R$ the return. This is know as the Euler Equation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the Black and Scholes world the Stochastic Discount Factor is the risk-neutral probability. So, in the &#xA;Black and Scholes world, this is true that if you buy any option (paying the Black and Scholes price), you will not make any money on average. Of course, the relation holds on average, this means that you can make (or loose) money for a given option, but if you repeat your strategy an infinite number of time, you will make exactly nothing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can indeed think about that by saying that realizations in which you win exactly balance the realizations in which you loose (loose the price you paid for the option).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In real life, volatility is not constant (unlike in Black and Scholes world) so the global payoff of following your strategy will depend on the difference between the realized volatility and the volatility used to price your option, that is the implied volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keep in mind that this is true only if you pay the Black Scholes price, in general there is a cost of trading option, that is the implied volatility used to price the option you're going to buy/sell is different from the market's one (sort of bid/ask spread). So in this case, if we assume no time-varying volatility, you will basically loose money on average with your strategy.&lt;/p&gt;&#xA;" OwnerUserId="18053" LastActivityDate="2015-11-03T23:38:58.130" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21565" PostTypeId="2" ParentId="18852" CreationDate="2015-11-03T23:39:01.447" Score="1" Body="&lt;p&gt;Native support is very limited. TradeStation's WebAPI pretty much works with any language because it is wrapped in HTTP calls using RESTful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If a platform has an API that supports std C/C++ interfaces, you can write a wrapper to extend the API to python. Search for &quot;Calling C from Python&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is more work to code, but otherwise your choices are very limited. I worked on a project that used this method to link python with the now defunct TAL/RealTick platform.&lt;/p&gt;&#xA;" OwnerUserId="11932" LastActivityDate="2015-11-03T23:39:01.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21566" PostTypeId="1" AcceptedAnswerId="21578" CreationDate="2015-11-04T00:58:25.077" Score="3" ViewCount="435" Body="&lt;p&gt;I have a basic understanding of the principles behind Geometric Brownian Motion and how it can be used to model stock prices, however I am confused as to how it is used in practice. In particular, how can the fundamental analysis of a company be incorporated into the GBM model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it the case that information such as financial reports, social media, company news etc. is analysed to generate values for the volatility and/or drift to be then plugged into the GBM equation? Or is it the case that Geometric Brownian Motion is purely based on statistical data obtained from historical information?  &lt;/p&gt;&#xA;" OwnerUserId="18001" LastEditorUserId="467" LastEditDate="2015-11-04T01:52:34.703" LastActivityDate="2015-11-05T08:34:41.307" Title="How is fundamental data taken into account when modelling stock prices with a Geometric Brownian Motion?" Tags="&lt;modeling&gt;&lt;brownian-motion&gt;&lt;fundamentals&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21567" PostTypeId="2" ParentId="21566" CreationDate="2015-11-04T02:08:14.377" Score="0" Body="&lt;p&gt;It does not necessarily have to be using historical data (you could use implied volatilities for example), but indeed fundamental analysis is not taken into account in geometric Brownian motions: you just assume returns are normally distributed with some mean and volatility and it does not change in time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you want to &quot;incorporate&quot; fundamental analysis in a GBM, you'd need to come up with a way of translating your &quot;findings&quot; in terms of $\mu$ and $\sigma$.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2015-11-04T02:08:14.377" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21568" PostTypeId="2" ParentId="21558" CreationDate="2015-11-04T02:13:11.583" Score="1" Body="&lt;p&gt;To get the answer, you should know the difference between forward and futures. If all options in your strategy will not be really settled, instead, just an P&amp;amp;L is marked, then you will find in the long run your return is 0. This is similar to a forward contract. However, if these options are settled, you will get a realized P&amp;amp;L which is MtM weekly. This is like a futures contract. The difference should be your realized return.&lt;/p&gt;&#xA;" OwnerUserId="18148" LastActivityDate="2015-11-04T02:13:11.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21570" PostTypeId="1" CreationDate="2015-11-04T09:03:26.227" Score="1" ViewCount="78" Body="&lt;p&gt;i would like to reproduce in R the working paper &quot; Affine free arbitrage class of Nelson Siegel term structure&quot;. The authors considering the equation of nelson siegel plus an adjustment term(C(t,T)) fits and estimates a state space form of this equations with Kalman filter. The measurement equations is :$y_{t}=A+BX{t}+\epsilon_{t}$ and state equation is $ X_{t} = (I - exp(-K^{p} \Delta t))\theta^{p} + exp(-K^{P} \Delta t)X_{t-1} + \eta_{t}$; where $K^p$ is a matrix 3x3 of parameters to estimate and $\theta$ is a vector Nx1 of parameters to estimate.&#xA;A is a vector Nx1 of adjustment term of this form: (where $\tau$ is the maturity) &#xA;\begin{bmatrix}&#xA; \frac{C_t}{\tau_1}&#xA; \\ &#xA; \vdots \\ &#xA; \frac{C_N}{\tau_n}&#xA;\end{bmatrix}&#xA;and B is the coefficients matrix Nx3 of state variables:&#xA;\begin{bmatrix}&#xA;1 &amp;amp; \frac{1-e^{-\lambda \tau_1}}{\lambda \tau_1} &amp;amp; \frac{1-e^{-\lambda \tau_1}}{\lambda \tau_1}-e^{-\lambda \tau_1}&#xA;\\&#xA;\vdots &amp;amp; \vdots&amp;amp; \vdots \\&#xA;1 &amp;amp; \frac{1-e^{-\lambda \tau_N}}{\lambda \tau_N} &amp;amp; \frac{1-e^{-\lambda \tau_N}}{\lambda \tau_1}-e^{-\lambda \tau_N}&#xA;\end{bmatrix}and X is the vector of state variables:&#xA;\begin{bmatrix}&#xA;X{^1}{_t} \\&#xA;X{^2}{_t} \\&#xA;X{^3}{_t}&#xA;\end{bmatrix}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;furthermore the adjustment term C(t,T) has this analytical form:&#xA;$= a \biggr[\frac{(T-t)^2}{6}\biggr] + b \biggr[\frac{1}{2 \lambda^2} - \frac{1}{\lambda^3} \frac{1-e^{-\lambda(T-t)}}{T-t)}+\frac{1}{4{\lambda^3}}\frac{1-e{-2\lambda(T-t)}}{T-t}\biggr]  &#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$&#xA;+ c \biggr[\frac{1}{2\lambda^2}+\frac{1}{\lambda^2}*e^ {-\lambda (T-t) } - \frac{1}{4 \lambda} (T-t) e^{-2\lambda(T-t)} - \frac{3}{4 \lambda^2}e^{-2\lambda(T-t)}-\frac{2}{\lambda^3} \frac{1-e^{-\lambda (T-t)}}{(T-t)} + \frac{5}{8\lambda^3} \frac{1-e^{-2\lambda(T-t)}}{T-t)}\biggr] +&#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$&#xA;+ d \biggr[\frac{1}{2\lambda}(T-t)+\frac{1}{\lambda^2} e^{-\lambda(T-t)} - \frac{1}{\lambda^3} \frac{1-e^{-\lambda(T-t)}}{(T-t)}\biggr]&#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$&#xA;+e\biggr[\frac{3}{\lambda^2} e^{-\lambda(T-t)} + \frac{1}{2\lambda}(T-t)+\frac{1}{\lambda}(T-t) e^{-\lambda(Y-t)} - \frac{3}{\lambda^3}\frac{1-e^{-\lambda(T-t)}}{(T-t)}\biggr]&#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$&#xA;+f \biggr[\frac{1}{\lambda^2}+\frac{1}{\lambda^2} e^{-\lambda(t-t)} - \frac{1}{2\lambda^2}e^{-2\lambda(T-t)} -\frac{1-e^{-\lambda(T-t)}}{(T-t)} + \frac{1}{4{\lambda^3}}\frac{1-e{-2\lambda(T-t)}}{T-t}\biggr]  &#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$a=\sigma{^2_{11}}+\sigma{^2_{12}+\sigma{^2}_{13}}$;$b=\sigma{^2_{22}}+\sigma{^2_{21}+\sigma{^2}_{23}}$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$c=\sigma{^2_{31}}+\sigma{^2_{32}+\sigma{^2}_{33}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d=\sigma_{11} \sigma_{21}+\sigma_{12}\sigma_{22}+\sigma_{13}\sigma_{23}$;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$e=\sigma_{11} \sigma_{31}+\sigma_{12}\sigma_{32}+\sigma_{13}\sigma_{33}$;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$f=\sigma_{21} \sigma_{31}+\sigma_{22}\sigma_{32}+\sigma_{23}\sigma_{33}$; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;the value of $\sigma_{ii}$ and ($\sigma_{ij}$) are unknown and they are respectively the volatility and correlation of state variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thank you for your time.&lt;/p&gt;&#xA;" OwnerUserId="18087" LastEditorUserId="18087" LastEditDate="2015-11-05T11:32:56.553" LastActivityDate="2015-11-05T11:32:56.553" Title="state space for affine yield curve" Tags="&lt;time-series&gt;&lt;fixed-income&gt;&lt;statistics&gt;&lt;bond&gt;&lt;yield-curve&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21572" PostTypeId="1" CreationDate="2015-11-04T11:29:47.793" Score="0" ViewCount="5851" Body="&lt;p&gt;I want to calculate the risk of a portfolio with the following.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to calculate the following formula: &lt;a href=&quot;https://i.stack.imgur.com/vlPJd.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/vlPJd.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I am not sure if I have to use log returns or simple returns to calculate the assets returns. I need the asset returns to calculate the standard deviation as well as the variance-covariance of the assets included in the portfolio.&lt;/p&gt;&#xA;" OwnerUserId="17450" LastActivityDate="2015-11-05T14:05:21.243" Title="Calculating portfolio risk" Tags="&lt;standard-deviation&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21573" PostTypeId="2" ParentId="21539" CreationDate="2015-11-04T11:54:47.597" Score="3" Body="&lt;p&gt;The price of VXX ETF should not be the price of the mentioned basket of VIX futures. It is the change in price of VXX (the return) what should be equivalent to the change of price of the futures basket with 1 month average maturity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is because the VXX ETF works as an open end fund, so its price is just the price of a share of that fund, which has an arbitrary value set at the inception of the fund. When you buy a share of the fund, the change in value of that share will be representative of the change of value of the basket that is inside the fund. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Look to the historical prices of VXX for a very long term and you will see that it doesn't match the futures. But look to the returns and you will see they match.&lt;/p&gt;&#xA;" OwnerUserId="15285" LastActivityDate="2015-11-04T11:54:47.597" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21575" PostTypeId="2" ParentId="21572" CreationDate="2015-11-04T15:47:24.743" Score="1" Body="&lt;p&gt;The logarithmic method of calculating returns is frequently preferred to the&#xA;obvious alternative of using the return calculated on the basis of simple interest over the period in question which, of course, is the monetary return which would actually be achieved by an investment over that period.&#xA;In some cases this is due to the assumptions that prices are distributed log normally (which, in practice, may or may not be true for any given price series), then log(1 + r_i) is conveniently normally distributed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quantivity.wordpress.com/2011/02/21/why-log-returns/&quot; rel=&quot;nofollow&quot;&gt;Why Log Returns&lt;/a&gt; Benefits and Downsides&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1549328&quot; rel=&quot;nofollow&quot;&gt;A Comparison between Logarithmic and Simple Returns&lt;/a&gt; Calculating and Comparing Security Returns&lt;/p&gt;&#xA;" OwnerUserId="13533" LastActivityDate="2015-11-04T15:47:24.743" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21576" PostTypeId="2" ParentId="21539" CreationDate="2015-11-04T16:46:52.200" Score="0" Body="&lt;p&gt;I'll write it up as a separate answer, though it may be what AlexC actually meant in his comment. VXX is an &lt;strong&gt;ETN&lt;/strong&gt;, not an ETF, so when you buy a share of VXX, you are not buying a share in its holdings, like it is the case for ETFs (from VXX prospectus: &quot;Owning the ETNs is not the same as owning interests in the index components included in the Index or a security directly linked to the performance of the Index&quot;). It's more like buying a bond from Barclays, though they put it differently - again, VXX prospectus: &quot;the ETNs are unsecured debt obligations of the issuer, Barclays Bank PLC&quot;. This has implications for tracking the corresponding index (defined by VIX futures). The main one is that you cannot create new shares of VXX, only Barclays can. Therefore, there is no &quot;index arbitrage&quot;, that would keep VXX price same as the weighted sum of the futures contract. (prospectus: &lt;a href=&quot;http://www.ipathetn.com/US/16/en/details.app?instrumentId=259118&quot; rel=&quot;nofollow&quot;&gt;http://www.ipathetn.com/US/16/en/details.app?instrumentId=259118&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2015-11-04T16:46:52.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21577" PostTypeId="2" ParentId="21572" CreationDate="2015-11-04T20:25:36.080" Score="1" Body="&lt;p&gt;In Markowitz's famous paper he writes that the return on the portfolio is a weighted average of the returns on the individual assets. For the two asset case: $R_p = w r_1 + (1-w) r_2$. From this we can derive the equation you gave above, using a theorem in Statistics for the standard deviation of a weighted average. This formula for $R$ makes sense only if the returns being used are simple returns, not logarithmic returns. So that is what I would use.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2015-11-05T14:05:21.243" LastActivityDate="2015-11-05T14:05:21.243" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21578" PostTypeId="2" ParentId="21566" CreationDate="2015-11-04T21:48:01.680" Score="3" Body="&lt;p&gt;It turns out that GBM with constant drift and constant volatility is not really used in real life. It is well known that volatility as well as drift may vary over time. Hence, if you want to use a model with time-varying parameters, you need to come up with a model to define $\mu_t$ and $\sigma_t$. There are classic models that use some mean-reverting process for $\sigma_t$, but then the estimation and calibration of parameters becomes really challenging and is often more related to some sort of art rather than economics. Finding a process for conditional drift is even more challenging. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way, and whether, you use GBM differs depending on what you want to do. Indeed, vanilla option pricing for instance relies on GBM but you will actually reverse the pricing formula and back out the volatility (which is then called implied volatility) because you observe option prices. The drift used depends on how do you price the option. For instance, in the Black-Sholes framework, that is using risk-neutral probability, the drift is going to be the risk-free rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For investment decision purpose, like asset management, it is another story. If you are interested in pricing future stock returns (not a single stock but rather the S&amp;amp;P500 or any large index), there are other methods much more reliable than pure normal shocks to price. These models often relies on macroeconomic variables, and in particular consumption, that helps gives a better view of stock prices (although there are also some problems with these methods). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to price a single stock, you won't use GBM neither. Indeed, as you suggested the fundamentals will be too important in that case to simply use basic GBM. Again here, you will try to use alternative methods that relies also on macro data, like some sort of variation of CAPM model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding your initial question, yes, in theory you could be able to infer some GBM calibrations with company fundamentals but I guess this is rarely used in that way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Overall, I would say that GBM is not that used by anybody because it is the most basic model you can come up with, and have several large limitations in its &quot;usual&quot; form : constant mean and variance. There are strong evidence that the mean and the variance are not constant over time. &lt;/p&gt;&#xA;" OwnerUserId="18053" LastActivityDate="2015-11-04T21:48:01.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21580" PostTypeId="1" CreationDate="2015-11-05T04:43:23.297" Score="0" ViewCount="1042" Body="&lt;p&gt;I always find myself in the unknown charted territory when it comes to non-Linear Instruments. I come across the scenario,  How to value the option using Delta Vol surface?&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Example&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I have CME traded Soybean option(900 strikes, Underlying traded future (spot) trading at 880 USD-cents/BU)  with dec maturity and delta surface from the Bloomberg. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) I need to plug out implied volatility from  the delta surface and Plug back into the same vol into  Black-76.Ho should I go about it. Delta greeks need Implied vol. as input. It is chicken and egg story.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) If for the same option I need to work it out the historical VaR. How should I calibrate my delta surface to calculate the historical VaR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your responses on the concern will be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="12126" LastEditorUserId="12126" LastEditDate="2015-11-07T10:22:23.087" LastActivityDate="2015-11-07T10:22:23.087" Title="Delta Volatility Surface Usage to value the option" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;var&gt;&lt;delta&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21581" PostTypeId="1" CreationDate="2015-11-05T05:15:35.863" Score="1" ViewCount="77" Body="&lt;p&gt;Please forgive me if this is a dumb question. I know only the basics of options and their valuation, and this is a question I've wondered for some time without being able to find a satisfactory answer on my own.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Owing to the nature of options contracts, given two contracts for the same security and at the same strike price, one strictly prefers a contract that expires later to one that expires earlier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is, I think trivially, true even if it is known that the underlying security will become worthless between the two expiration dates. But it is even more true if there is just a high probability of such a drop.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general I wonder if it possible to construct a &quot;best fit&quot; of a stock's price between now and a particular expiration at a certain confidence interval (say, 50 percent) by assessing options trades - or if such a best fit is only possible if you make certain assumptions about the shape of the graph of the security price in question (for instance, maybe you can only say, &lt;em&gt;if the price is strictly not decreasing below X between this and that date,&lt;/em&gt; then this is the line of best fit).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But my specific question in this case is: is it possible, by analyzing the publicly-available options trading information (prices, volatility, Greeks, volume, spreads, whatever), to make a statement like: &quot;assuming efficient pricing, with 50 percent confidence, security XYZ will be priced at least X on this date, but priced Y &amp;lt; X on this later date.&quot; If so, how? If not, what kind of similar statement, if any, can be made?&lt;/p&gt;&#xA;" OwnerUserId="18160" LastEditorUserId="18160" LastEditDate="2015-11-05T09:02:50.250" LastActivityDate="2015-11-05T14:34:29.787" Title="Is it possible to detect a belief that a security will peak and then decline by analyzing American options pricing?" Tags="&lt;options&gt;&lt;greeks&gt;&lt;option-strategies&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21582" PostTypeId="2" ParentId="21566" CreationDate="2015-11-05T08:34:41.307" Score="0" Body="&lt;p&gt;Fundamentals usually do not enter the parameters of GBM. But it depends on the purpose:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;if you want to price options, then the drift is the risk-less rate and volatility is implied from other traded derivatives.&lt;/li&gt;&#xA;&lt;li&gt;if you want to use GBM for risk management then you usually apply statistical methods for $\sigma^2$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-11-05T08:34:41.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21583" PostTypeId="2" ParentId="21572" CreationDate="2015-11-05T08:52:09.693" Score="1" Body="&lt;p&gt;Severals thoughts:&#xA;First: this topic is already covered here - mabye you have to collect parts. YOu can start &lt;a href=&quot;https://quant.stackexchange.com/questions/4160/discrete-returns-versus-log-returns-of-assets&quot;&gt;here&lt;/a&gt;. A very good overview is given &lt;a href=&quot;http://faculty.washington.edu/ezivot/econ424/introductionPortfolioTheory.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us define the following notions. Let $P_t^1$ and $P_t^2$ denote the prices of zwo assets at time $t$. Then&#xA;$$&#xA;	r_t = \frac{P_t^1-P_{t-1}^1}{P_{t-1}^1} = \frac{P_t^1}{P_{t-1}^1} -1&#xA;$$&#xA;denotes the simple return whereas&#xA;$$&#xA;	r_t^l = \log\left(\frac{P_t^1}{P_{t-1}^1} \right),&#xA;$$&#xA;where $\log$ is the natural logarithm, denotes the log-return.&#xA;Note that $r_t \in [-1,\infty)$ and $r_t^l \in (-\infty,\infty).$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then for a portfolio where we have $q^i$ pieces of each stock we have&#xA;$$&#xA;w_i = \frac{q^i P^i_t}{q^1 P^1_t+q^2 P^2_t},&#xA;$$&#xA;the fraction of asset $i$.&#xA;Then the portfolio returns is given by&#xA;$$&#xA;\frac{P_{t+1}}{P_t}-1 = \frac{q^1 P^1_{t+1} + q^2 P^2_{t+1}}{q^1 P^1_t+q^2 P^2_t}-1,&#xA;$$&#xA;which equals&#xA;$$&#xA;w_1 r^1_t + (1-w_1) r^2_t.&#xA;$$&#xA;Thus the portfolio returns is the a linear combination of the asset returns.&#xA;This is not true for log returns (take the log-returns and you see that the above expansion of terms does not work).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The aggregation of (portfolio) returns over time is easier:&#xA;$$&#xA;\begin{eqnarray} &#xA;\log(P_T/P_0) &amp;amp;=&amp;amp; \log(P_T/P_1 \cdot   P_1/P_0)  \\&#xA;&amp;amp;=&amp;amp; \log(P_T/P_{T-1}\cdot P_{T-1}/P_{T-2} \cdots   P_1/P_0)\\&#xA;&amp;amp;=&amp;amp; \log(P_T/P_{T-1}) + \cdots + \log(P_1/P_0)\\&#xA;&amp;amp;=&amp;amp; \sum_{t=1}^T r_t^l&#xA;\end{eqnarray} &#xA;$$&#xA;where $r_t^l$ denotes the log-return over one period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is much more complicated for simple returns:&#xA;For simple returns we get&#xA;$$&#xA;\begin{eqnarray}&#xA;\frac{P_T}{P_0}-1 &amp;amp;=&amp;amp; \frac{P_T}{P_{T-1}} \cdot \frac{P_{T-1}}{P_{T-2}} \cdots \frac{P_1}{P_{0}} - 1\\&#xA;&amp;amp;=&amp;amp; \prod_{t=1}^T (1+r_t) - 1.&#xA;\end{eqnarray}&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-11-05T09:04:07.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21584" PostTypeId="2" ParentId="21558" CreationDate="2015-11-05T09:26:52.243" Score="1" Body="&lt;p&gt;No. Under BS you get rewarded for the risk you bear, and the risk premium (ie the instantaneous excess return over the risk free rate) is $\frac{\mu-r}{\sigma}\ \sigma^*_t\ dt$ where $\sigma^*_t$ is the instantaneous vol of your position. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a simple stock position the instantaneous vol is constant, $\sigma^*_t=\sigma$ therefore you have a constant excess return of $(\mu-r)\ dt$ at all times. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For an option the instanteneous vol is not constant, as the option moves in and out of the money, therefore you need to integrate over all paths/ensemble. However it is always positive. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2015-11-05T09:26:52.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21585" PostTypeId="2" ParentId="21572" CreationDate="2015-11-05T09:46:51.553" Score="0" Body="&lt;p&gt;I would say that one should differenciate between what the formula means, how the inputs are calculated, and how one would use it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is means: As noob2 points out it makes sense for simple returns' aggregation. For log returns it only holds at the limit where the time step is zero. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to calculate input variances/covariances: I would take logs before calculating statistics, because only under this transformation my series become homogeneous in time and additive through time. Ponder on the fact that simple returns are bounded by -1 to understand how it works. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to use: If I were to simulate, I would first draw log returns, then convert them to simple returns, and then apply the weighting as noob2 highlights. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2015-11-05T09:46:51.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21586" PostTypeId="1" AcceptedAnswerId="21588" CreationDate="2015-11-05T11:01:49.320" Score="0" ViewCount="657" Body="&lt;p&gt;I used Extreme Value Theory to separate extreme negative returns from extreme positive returns, then, I calculated the VaR for both. &#xA;I need to know what could be the interpretation of VaR for positive returns?&#xA;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="17810" LastActivityDate="2015-11-05T14:06:51.627" Title="VaR interpretation for positive returns" Tags="&lt;returns&gt;&lt;value-at-risk&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21587" PostTypeId="1" CreationDate="2015-11-05T13:09:15.530" Score="3" ViewCount="882" Body="&lt;p&gt;I wanted to figure how how much faster the Sobol quasi random numbers convergence to the B&amp;amp;S call price compared with pseudo random numbers. To generate the Sobol numbers I used the randtoolbox in R to generate these numbers. When using just one step, so from t=0 to t=T, it’s easy. I used the following formula to go from s(0) to s(T).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;S_t= S_0*exp⁡((μ- σ^2/2)*t+ σW_t,   where W_t  is a Sobol Random Number&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use the Sobol numbers and therefore the convergence is much faster because these numbers are better normal distributed when using pseudo random numbers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem is the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I need to generate these numbers if I use intermediate steps in my simulation, do I need to use more dimensions or just generate more Sobol numbers from the same numbers. I’m already stuck for a long time on this. Hopefully somebody can help me, especially using the randtoolbox package from R to generate these numbers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="16788" LastActivityDate="2015-12-07T15:22:58.480" Title="Sobol numbers in monte Carlo simulation" Tags="&lt;options&gt;&lt;r&gt;&lt;monte-carlo&gt;&lt;simulations&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21588" PostTypeId="2" ParentId="21586" CreationDate="2015-11-05T14:06:51.627" Score="0" Body="&lt;p&gt;What do you model? If negative returns are losses, then what is your interest in the &quot;risk&quot; of the positive ones. Most naturally you could look at quantiles of your distribution. &#xA;The 1%-quantile is the negative of $VaR_{99\%}$. The $99\%$-quanile could be of interest if you want to know about the right end of the distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The concept of &lt;a href=&quot;https://en.wikipedia.org/wiki/Omega_ratio&quot; rel=&quot;nofollow&quot;&gt;Oemga ration&lt;/a&gt; compares losses and gains in the tails.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-11-05T14:06:51.627" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21590" PostTypeId="2" ParentId="18740" CreationDate="2015-11-05T14:27:36.527" Score="2" Body="&lt;p&gt;In fact there is at least one application, namely in the pricing of reversions. The simplest case of a reversion is where there is no ground rent, and where exclusive possession (including the right to sell the property, or to rent it out) is deferred to some future date. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Practically, this means foregoing any income from the property until the reversion date. There is some dispute about how to price reversions, and, weirdly, the discount from spot is set by expert witnesses and judges. Google 'Sportelli judgment' for an insight. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Logic suggests that the rate should be determined by the present value of the expected foregone rent.  More difficult than it sounds, since 'voids' (periods where property not let) and expected depreciation have to be taken into account. Short term rental is effectively a floating rate that can be reset periodically, with legal permission, whereas a lease (the opposite of a reversion) effectively fixes the long term rental value, analogous to the way that we can fix interest rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that reversions are settled in cash, rather than deferred settlement, unlike a forward, so everything is present value.&lt;/p&gt;&#xA;" OwnerUserId="7220" LastActivityDate="2015-11-05T14:27:36.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21591" PostTypeId="2" ParentId="21581" CreationDate="2015-11-05T14:34:29.787" Score="1" Body="&lt;p&gt;If you have many strikes of &lt;em&gt;european&lt;/em&gt;-exercise options for two dates $T_1$ and $T_2$, then the option skew $\sigma_{1,2}(x)$ &lt;a href=&quot;https://quant.stackexchange.com/questions/1621/how-to-derive-the-implied-probability-distribution-from-b-s-volatilities/1676#1676&quot;&gt;implies model-free risk-neutral probability distributions&lt;/a&gt; $p_1, p_2$ for each of these dates,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;p_i(x) = {\left. \frac{\partial^2 }{\partial x^2}\right|}   BS_{\text{Call}}(S_0, x, \sigma_i(x), r, T_i, q)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can therefore assign confidence intervals to the stock, say exceeding $B_1$ at $T_1$ and to being below $B_2$ at $T_2$.  However, in order to link them to get the &lt;em&gt;joint&lt;/em&gt; probability of passing both barriers it is necessary to assume a model, perhaps a local vol or stochastic vol model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You would calibrate the model to available data, and then compute the probability via the usual methods (in this case, PDE schemes would be most efficient and Monte Carlo would likely be quickest to code).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;American-exercise options do not make any part of this process simpler, and of course they lack the nice implied probability distribution.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2015-11-05T14:34:29.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21592" PostTypeId="2" ParentId="21587" CreationDate="2015-11-05T14:43:49.557" Score="2" Body="&lt;p&gt;First let me say that in the Black-Scholes model as you have it, there is of course no need for intermediate steps when pricing vanilla calls, since the SDE has the closed-form solution you included.  Intermediate steps would be required for complicated payoffs or other SDEs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer your question though, you &lt;em&gt;do&lt;/em&gt; need to use additional dimensions.  Think of the option pricing algorithm as an integration over the probability space of stock price paths.  Each intermediate tenor introduces a new dimension to that probability space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;em&gt;point&lt;/em&gt; of these quasirandom sequences is that, in multiple dimensions, they provide more evenly-distributed coverage of the probability space than pseudorandom numbers would give us.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Quasirandom&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/xnNYw.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/xnNYw.png&quot; alt=&quot;Quasirandom sampling in 2D&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we don't make multidimensional draws from the Sobol sequence, we would not benefit from that extra regularity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Pseudorandom&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/gOtQH.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/gOtQH.png&quot; alt=&quot;Pseudorandom sampling in 2D&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note how these pseudorandom draws have multiple spots where samples are right next to each other, along with some very big &quot;holes&quot;.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2015-12-07T15:22:58.480" LastActivityDate="2015-12-07T15:22:58.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21593" PostTypeId="1" CreationDate="2015-11-05T14:58:38.993" Score="0" ViewCount="1141" Body="&lt;p&gt;A reversion is the right to exclusive possession of a property after a specified date (‘reversion date’).  Assume no ground rent is payable.  Its complement is a leasehold, the right to exclusive possession before the reversion date.  Both rights together add up to total rights to the property, hence the sum of leasehold and reversion = vacant value of property (approximately, since there is something called ‘marriage value’, which I shall ignore).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How should we price the reversion?  It’s a controversial issue in real estate appraisal.  One method is to estimate the present value of the foregone rent on the property, but even this is not simple. The problem is that the corresponding leasehold is like a long term rental for the property.  Short term rentals are a guide, but with short term rentals (a) there is the problem of void periods between tenancies, which will reduce the effective rental, and importantly (b) short term rentals can be re-fixed upwards after the short term rental expires. Also (c) when a leasehold approaches expiry, and where the lessee chooses not to apply for an extension, the lessee may have little interest in maintaining the property. They may choose to rent to people who will wreck the property, and they certainly will not pay for structural repairs if not in the terms of the lease.  And (d) the owner of the reversion has comparatively few management costs, particularly in the case of long dates greater than 99 years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas appreciated. (I have my own, but sitting on them for now). &lt;/p&gt;&#xA;" OwnerUserId="7220" LastActivityDate="2016-07-26T20:42:47.127" Title="How to price a reversion?" Tags="&lt;valuation&gt;&lt;real-estate&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21594" PostTypeId="2" ParentId="21587" CreationDate="2015-11-05T15:22:32.673" Score="1" Body="&lt;p&gt;You need to use more dimensions. If the number of dimensions (i.e. steps) is large, you may also have to use a Brownian bridge as described in the book by &lt;a href=&quot;http://www.markjoshi.com/more/&quot; rel=&quot;nofollow&quot;&gt;Joshi&lt;/a&gt; or &lt;a href=&quot;http://eu.wiley.com/WileyCDA/WileyTitle/productCd-047149741X.html&quot; rel=&quot;nofollow&quot;&gt;Jäckel&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1739" LastActivityDate="2015-11-05T15:22:32.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21597" PostTypeId="1" AcceptedAnswerId="21602" CreationDate="2015-11-05T16:05:31.050" Score="1" ViewCount="1062" Body="&lt;p&gt;I'm currently working on the Coursera Financial Engineering and Risk Management course. In one of the questions I was asked to build a binomial pricing model for fixed-income securities. Specifically a 10-period model with 5% initial short rate, u=1.1, d=0.9, q=1-q=0.5. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the questions asked for the bond forward price with maturity at t=4. And the forward price I got was exactly the same as the bond price. Is that correct for zero coupon bonds? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's my spreadsheet: &lt;a href=&quot;https://goo.gl/5e7JSp&quot; rel=&quot;nofollow&quot;&gt;https://goo.gl/5e7JSp&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15284" LastActivityDate="2016-10-23T17:24:29.537" Title="Zero Coupon Bond Forward Price" Tags="&lt;fixed-income&gt;&lt;forward&gt;&lt;binomial&gt;&lt;short-rate&gt;&lt;zero-coupon&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21598" PostTypeId="1" CreationDate="2015-11-05T16:21:44.777" Score="4" ViewCount="796" Body="&lt;p&gt;Various exchanges allow for the trading of Bitcoins. The price of Bitcoin was very volatile since the inception of the system, today it is 391.76 USD:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/kD3wW.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/kD3wW.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder whether time series analysis tools from established financial markets can be applied to this market. Obviously the Bitcoin market is different - but maybe we see parallels.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This questions asks for personal experiences and mainly quant/math articles on the trading of Bitcoins.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="16249" LastEditDate="2017-08-19T20:51:55.327" LastActivityDate="2017-08-19T20:51:55.327" Title="Application of time series analysis to Bitcoin prices" Tags="&lt;time-series&gt;&lt;market-data&gt;&lt;trading&gt;&lt;bitcoin&gt;&lt;blockchain&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="3" ClosedDate="2019-08-13T20:25:37.370" ContentLicense="CC BY-SA 3.0" />
  <row Id="21602" PostTypeId="2" ParentId="21597" CreationDate="2015-11-05T20:38:20.603" Score="1" Body="&lt;p&gt;Look at slide 3 of Mod 4: Fixed Income Derivatives: Bond Forwards, that's the relevant equation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;G_0 = \frac{E_0^\mathbb{Q}[Z^j_t/B_t]}{E_0^\mathbb{Q}[1/B_t]}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $G_0$ denotes the price of the forward at $t=0$, $E_0^\mathbb{Q}$ is the risk-neutral price at $t=0$, $Z^j_t$ denotes the ex-coupon price of the bond at time $t$ and state $j$, and $B_t$ is the value of the cash account at time $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to divide by the risk-neutral price of the reciprocal of the cash account at t=4, which is equal to the t=0 price of a zero-coupon bond with face value of 1 that matures at t=4&lt;/p&gt;&#xA;&#xA;&lt;p&gt;*edited for a more complete answer&lt;/p&gt;&#xA;" OwnerUserId="18171" LastEditorUserId="18171" LastEditDate="2015-11-05T23:11:37.413" LastActivityDate="2015-11-05T23:11:37.413" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21603" PostTypeId="1" AcceptedAnswerId="21604" CreationDate="2015-11-05T21:06:10.027" Score="2" ViewCount="2710" Body="&lt;p&gt;I wanted to know the difference between a caplet and a call.&#xA;In my course (Interest rate models and curves) , we said that a caplet is a call option. Is it really true?&#xA;Thanks&lt;/p&gt;&#xA;" OwnerUserId="17490" LastActivityDate="2015-11-06T02:21:17.683" Title="difference between caplet and call" Tags="&lt;interest-rates&gt;&lt;call&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21604" PostTypeId="2" ParentId="21603" CreationDate="2015-11-05T21:14:58.417" Score="2" Body="&lt;p&gt;A caplet is a call, as the payoff is given by $(L-K)^+$, where $L$ is the libor rate for a given calculation period and $K$ is the pre-agreed rate. However, in practice, the volatilities for a strip of caps are usually provided, and then a bootstrapping algorithm is needed to back out the volatility for each caplet.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-11-05T21:14:58.417" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21607" PostTypeId="2" ParentId="21603" CreationDate="2015-11-06T01:51:20.613" Score="1" Body="&lt;p&gt;Call option gives the exercise strategy, but it doesn't actually tell you anything about the underlying. It could be a stock, a LIBOR interest rate, a bond or any tradable asset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The simplest call option would be an equity call option, where the underlying is a stock. In a caplet, the underlying is the forward interest rate (eg: LIBOR), you would exercise a caplet if the interest rate at maturity is more than than the rate specified in the option contract.&lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="601" LastEditDate="2015-11-06T02:21:17.683" LastActivityDate="2015-11-06T02:21:17.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21608" PostTypeId="1" AcceptedAnswerId="21689" CreationDate="2015-11-06T02:51:11.163" Score="7" ViewCount="3015" Body="&lt;p&gt;I'm looking at Shannon entropy, and generaly at ways to tell noise from signal when observing intraday returns (at the minute level for now). In python, e.g. I've implemented the fomula (sum of P(xi)*logP(xi) using a numpy histogram.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def rolling_entropy(window):&#xA;    cx = np.histogram(window, bins)[0]&#xA;    c_normalized = cx/float(np.sum(cx))&#xA;    c_normalized = c_normalized[np.nonzero(c_normalized)]&#xA;    h = -sum(c_normalized * np.log(c_normalized))  &#xA;    return h&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The question remains: how to determine the best bin size to digitize the signal? I've assumed the bin size should probably be the tick, and that the number of bins should therefore be variable (max(return)-min(return))/tick size. However, if the number of bins is variable, can the return value be comparable from one time to another (since max and min are likely variable)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone has a view on this?&lt;/p&gt;&#xA;" OwnerUserId="18174" LastActivityDate="2017-12-01T08:28:39.463" Title="Shannon's entropy for financial times-series (return)" Tags="&lt;time-series&gt;&lt;research&gt;&lt;python&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="21610" PostTypeId="1" CreationDate="2015-11-06T07:50:40.983" Score="2" ViewCount="2838" Body="&lt;p&gt;I know that each individual option has it's own implied volatility, but how do you go about calculating the overall implied volatility for an underlying?&lt;/p&gt;&#xA;&lt;p&gt;For example when someone sais the IV of a certain underlying is 40%, they are not referring to a specific option/strike. They mean that the option market as a whole is implying a volatility of 40%. How is that 40% calculated? Im guessing it is something along the lines of calculating the IV for every option available and taking some sort of average?&lt;/p&gt;&#xA;&lt;p&gt;Secondly, how do you go about calculating the historical IV over a given time period. For example in most options trading platforms (eg: TWS, ThinkOrSwim, etc) you can pull up a chart of a specific underlying along with it's IV over a given time period. How would you go about recreating that?&lt;/p&gt;&#xA;&lt;p&gt;Again I presume you do something like:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;One day at a time, get the closing price for every active option&lt;/li&gt;&#xA;&lt;li&gt;Calculate the IV for all the options at every strike&lt;/li&gt;&#xA;&lt;li&gt;Perform some sort of average&lt;/li&gt;&#xA;&lt;li&gt;Move to the next day&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;It seems impractical to calculate the IV of every single active option. Is it perhaps only done using the front month? (and if so, does that include weeklies and monthlies?)&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/hR2Wf.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/hR2Wf.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16304" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-06-26T10:17:17.310" Title="Calculating historical implied volatility" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;implied-volatility&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21611" PostTypeId="2" ParentId="15549" CreationDate="2015-11-06T09:37:34.930" Score="2" Body="&lt;p&gt;I calculate duration in Python using numpy, it's nice and simple:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def durations(cfs, rates, price, ytm, no_coupons, payments_per_year=2):&#xA;    import numpy as np &#xA;    mac_dur = np.sum([cfs[i]*((i+1)/payments_per_year)/np.power(1+rates[i],i+1) for i in range(len(cfs))])/price&#xA;    mod_dur = mac_dur/(1+ytm/no_coupons)&#xA;    return mac_dur, mod_dur&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="18178" LastEditorUserId="43542" LastEditDate="2019-12-04T06:15:17.833" LastActivityDate="2019-12-04T06:15:17.833" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="21612" PostTypeId="1" AcceptedAnswerId="21619" CreationDate="2015-11-06T12:16:36.520" Score="1" ViewCount="540" Body="&lt;p&gt;Bear with me. Related (very good) question: &lt;a href=&quot;https://quant.stackexchange.com/questions/19344/how-to-calibrate-a-volatility-surface-using-svi&quot;&gt;How to calibrate a volatility surface using SVI&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From this paper &lt;a href=&quot;http://arxiv.org/pdf/1204.0646.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://arxiv.org/pdf/1204.0646.pdf&lt;/a&gt;, page 21.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why does the recipe suggest fitting to option prices rather than simply working with implied total variance?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there actually any (numerical?) point in working with option prices rather than impl vols or total implied variance?&lt;/p&gt;&#xA;" OwnerUserId="5888" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2015-11-06T23:46:39.613" Title="SVI calibration, why fit to option prices and not implied volatilities" Tags="&lt;stochastic-volatility&gt;&lt;calibration&gt;&lt;volatility-smile&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21613" PostTypeId="2" ParentId="18693" CreationDate="2015-11-06T14:44:31.667" Score="0" Body="&lt;p&gt;In my opnion you should you the Full revaluation historical VaR. Please readmy thread . If you need more help on the same  i can gudie you .&lt;a href=&quot;https://quant.stackexchange.com/questions/14833/historical-value-at-risk-on-option-portfolio&quot;&gt;Historical Value At Risk on option portfolio&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12126" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2015-11-06T14:44:31.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21614" PostTypeId="1" CreationDate="2015-11-06T15:41:17.983" Score="3" ViewCount="447" Body="&lt;p&gt;Let $\{X_i\}$ be an i.i.d. sample of $X$ with $E(X) = \mu$ and $Var(X) = \sigma^2$.  We know a MC estimate converges to the true value almost surely by the SLLN.  That is,&#xA;$$&#xA;\bar{X}_n \to \mu,   \text{ a.s.}&#xA;$$&#xA;This doesn't tell us anything about the convergence rate.  To get that, it seems we consider the CLT, for which we have&#xA;$$&#xA;\bar{X}_n - \mu \to^d \mathcal{N}\left(0, \frac{\sigma^2}{n}\right),&#xA;$$&#xA;where &quot;$\to^d$&quot; is convergence in distribution.  Thus, an &lt;em&gt;approximate&lt;/em&gt; 95% confidence interval for $\mu$ is&#xA;$$&#xA;\bar{X}_n \pm 1.96\frac{\sigma}{\sqrt{n}},&#xA;$$&#xA;and I suppose now I can see where the statement, &quot;Monte Carlo converges at the rate $\frac{1}{\sqrt{n}}$&quot; comes from.  What people mean by this is, &lt;em&gt;the half-width of the approximate confidence interval decreases at the rate $\frac{1}{\sqrt{n}}$.&lt;/em&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this correct?  If so, this seems like a very different notion of convergence than I'm used to.  For example, look at the $L^2$ norm, which gives&#xA;$$&#xA;E((\bar{X}_n - \mu)^2) = Var(\bar{X}_n) = \frac{\sigma^2}{n} \to 0 \text{ as } n \to \infty,&#xA;$$&#xA;so we &lt;em&gt;also&lt;/em&gt; get that $\bar{X}_n \to \mu$ in $L^2$, which is not expected in general solely from the a.s. convergence.  However, I don't see how this implies a convergence rate of $\frac{1}{\sqrt{n}}$ as advertised; rather, it says $\bar{X}_n \to \mu$ in $L^2$ at a rate $\frac{1}{n}$.  Now &lt;em&gt;this&lt;/em&gt; seems like a rigorous notion of the &lt;em&gt;convergence rate&lt;/em&gt; - we've shown the sense of convergence, and know exactly the rate at which it does so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So why do we insist on using the CLT-implied &quot;convergence&quot; rate of $\frac{1}{\sqrt{n}}$, when it is just an approximation to begin with, and the weakest form of convergence to boot?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2015-11-07T09:27:48.833" Title="Monte Carlo Convergence" Tags="&lt;statistics&gt;&lt;monte-carlo&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21618" PostTypeId="2" ParentId="21047" CreationDate="2015-11-06T21:30:53.933" Score="1" Body="&lt;p&gt;The built in data does not seem go quite 5 years back, but you can access dividend data within Mathematica / WolframCloud as well:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;FinancialData[&quot;NASDAQ:AAPL&quot;, &quot;Dividend&quot;, {&quot;Jan. 1, 2010,&quot;, &quot;Nov. 4, 2015&quot;}]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To get a list of all symbols on the NASDAQ:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;list = FinancialData[&quot;NASDAQ:*&quot;, &quot;Lookup&quot;]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To get/organize data for several symbols on this list (first 5 shown for example):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Transpose[{Take[list,{1,5}],Table[FinancialData[list[[i]], &quot;Dividend&quot;, {&quot;Jan. 1, 2010,&quot;, &quot;Nov. 4, 2015&quot;}], {i,1, 5}]}]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="18144" LastActivityDate="2015-11-06T21:30:53.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21619" PostTypeId="2" ParentId="21612" CreationDate="2015-11-06T23:46:39.613" Score="1" Body="&lt;p&gt;Different methods exists to compute implied vol from the same option prices, eventually it's prices that matters to calibration. But if you can reproduce same option prices accurate to the cent by fitting implied vol, I think it doesn't matter.&lt;/p&gt;&#xA;" OwnerUserId="5861" LastActivityDate="2015-11-06T23:46:39.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21620" PostTypeId="1" CreationDate="2015-11-07T01:22:54.317" Score="4" ViewCount="120" Body="&lt;p&gt;Is it possible to see if a big order was executed in smaller chunks, and at what prices and times? &lt;/p&gt;&#xA;" OwnerUserId="18188" LastEditorUserId="2299" LastEditDate="2016-03-06T12:34:26.730" LastActivityDate="2016-12-01T17:26:17.770" Title="Order ID or Broker information from TAQ or Limit Order book?" Tags="&lt;high-frequency&gt;&lt;market-microstructure&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21621" PostTypeId="2" ParentId="21620" CreationDate="2015-11-07T01:31:27.467" Score="1" Body="&lt;p&gt;No, it is not possible. Order IDs are not created in any particular pattern that associate it to the specific party. On the other hand, while one can attribute a market participant ID (MPID), many participants use the same broker so the details are abstracted away.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2015-11-07T01:31:27.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21622" PostTypeId="2" ParentId="21614" CreationDate="2015-11-07T09:27:48.833" Score="1" Body="&lt;p&gt;for the L2 norm you have to take a square root and then you get $1/\sqrt{n}$ convergence as before. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-11-07T09:27:48.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21624" PostTypeId="2" ParentId="21443" CreationDate="2015-11-07T17:57:45.630" Score="0" Body="&lt;p&gt;you are confusing too much with the future state of the market. It is easy to confuse. NO one can price totally uncertain future. Future or forward prices are arbitrage free projection of the current prices. No magic. It means you can buy a forward product and hedge it using products that defined the forward curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fair price is model price, meaning it is not based on bid and ask or market price. The fair is not fair as in fair dealing.&lt;/p&gt;&#xA;" OwnerUserId="7867" LastActivityDate="2015-11-07T17:57:45.630" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21625" PostTypeId="1" CreationDate="2015-11-07T19:01:34.340" Score="8" ViewCount="6657" Body="&lt;p&gt;Let's say I'm using CAPM to estimate the cost of equity, so I need expected market returns for the calculations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The standard approach is simply to compute arithmetic mean of an index (or rather its returns) that represents the market well. There is no problem in doing so when the returns trend is upward (like with S&amp;amp;P 500), but for some indexes (like MICEX) it's downward or roughly horizontal, and then the calculations make no sense since we get the market returns lower than the riskfree rate (returns on government bonds). How should I go about that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm thinking about weighting techniques but not sure which one to implement, the literature review got me nowhere in particular.&lt;/p&gt;&#xA;" OwnerUserId="18195" LastEditorUserId="467" LastEditDate="2017-01-05T05:08:55.513" LastActivityDate="2017-01-05T05:10:06.040" Title="Under the CAPM, how do I deal with market returns being below the risk-free rate?" Tags="&lt;returns&gt;&lt;capm&gt;&lt;market&gt;" AnswerCount="5" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21627" PostTypeId="1" AcceptedAnswerId="21629" CreationDate="2015-11-07T20:08:18.067" Score="0" ViewCount="125" Body="&lt;p&gt;I am self-studying for an actuarial exam on financial economics. I encountered this problem, and I am having difficulty seeing why the statement underlined is true:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/L3Pcj.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/L3Pcj.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do we know that $P(60) - C(60) + P(50) - C(50) = 110e^{-rT} - 2Se^{-\delta T} = (2/3)(15)$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The part with (2/3) confuses me. We are using 2 out of the 3 equations, but I don't see why that would necessarily imply that the value of adding 2 of the 3 equations is (2/3) the value of adding the three equations together.&lt;/p&gt;&#xA;" OwnerUserId="5641" LastActivityDate="2015-11-07T21:56:37.203" Title="Problem solving using the put-call parity" Tags="&lt;put-call-parity&gt;&lt;self-study&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21628" PostTypeId="1" AcceptedAnswerId="32575" CreationDate="2015-11-07T20:55:23.847" Score="0" ViewCount="703" Body="&lt;p&gt;My understanding is that Turnbull &amp;amp; Wakeman derived an approximation formula for continous arithmetic Asian option using Edgeworth series by matching the first two moments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in the book &lt;a href=&quot;http://www.springer.com/us/book/9783540422884&quot; rel=&quot;nofollow noreferrer&quot;&gt;Mathematical Models of Financial Derivatives&lt;/a&gt;, after a few pages of proof on the approximation, it writes &quot;Besides the Edgeworth expansion method, .... Turnbull and Wakeman (1991) ...&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the idea of Edgeworth approximation didn't come from Turnbull and Wakeman and possibly somebody else?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/nO34B.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/nO34B.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="19645" LastEditDate="2021-03-29T12:19:46.417" LastActivityDate="2021-03-29T12:19:46.417" Title="Turnbull &amp; Wakeman Asian - not Edgeworth?" Tags="&lt;options&gt;&lt;pricing&gt;&lt;asian-option&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21629" PostTypeId="2" ParentId="21627" CreationDate="2015-11-07T21:56:37.203" Score="2" Body="&lt;p&gt;What a difficult problem. The first line gave $165 e^{-rt} -3 S e^{-dt} = 15$ [since 50+55+60 = 165]. In the second line we want to evaluate $110 e^{-rt} -2 S e^{-dt} $. We notice that this is exactly two thirds of the left side of the above, because 110 is two thirds of 165 and 2 is two thirds of 3. So we take two thirds of the right hand side of the first eqn. i.e. (2/3)*15, which is 10.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-11-07T21:56:37.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21631" PostTypeId="2" ParentId="15340" CreationDate="2015-11-08T04:54:54.300" Score="0" Body="&lt;p&gt;the negative and positives in the same series are a result of negative convexity.  stated differently, the asymmetry in the series is a result of negative convexity.  These relationships, however, are not permanent and may flip.&lt;/p&gt;&#xA;" OwnerUserId="18199" LastActivityDate="2015-11-08T04:54:54.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21634" PostTypeId="2" ParentId="21625" CreationDate="2015-11-08T12:11:44.513" Score="2" Body="&lt;p&gt;If I understand you properly you’re wondering if it is possible to have negative beta’s or a negative market factor (Rm-Rf&amp;lt;0) in the context of CAPM. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One could consider buying such assets as buying insurance against macroeconomic risk that adversely relates to the rest of your portfolio. A common example is gold, since the could be seen as an insurance against inflation. The cost of that insurance in therefore (Rf-Rm if Rm-Rf&amp;lt;0). So indeed, you might find Rm&#xA;&#xA;&lt;p&gt;Regarding weighing techniques, value weighting is most common since it limits the effect of small stock on your index.  &lt;/p&gt;&#xA;" OwnerUserId="18070" LastActivityDate="2015-11-08T12:11:44.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21637" PostTypeId="2" ParentId="21625" CreationDate="2015-11-08T17:04:31.120" Score="2" Body="&lt;p&gt;Russia is a difficult case to analyze. According to Dimson, Staunton and Marsh the real annualized return on Russian equities from 1995 to the end of 2014 is 3.5% a year. &lt;a href=&quot;http://www.valuewalk.com/wp-content/uploads/2015/02/global-investment-returns-yearbook-2015-v2.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Source: 2015 Global Investment Return Yearbook page 52&lt;/a&gt;. This is the longest and best continuous estimate that I am aware of. After subtracting a real return on Tbills in this period of approx -2.2%, they arrive at an Equity Premium (i.e. $R_m-R_f$) of 5.8% per year. In a case like this, with  relatively short stock  market history, there is a lot of uncertainty associated with this estimate.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="467" LastEditDate="2017-01-05T05:10:06.040" LastActivityDate="2017-01-05T05:10:06.040" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21638" PostTypeId="1" AcceptedAnswerId="21653" CreationDate="2015-11-08T18:41:42.680" Score="2" ViewCount="295" Body="&lt;p&gt;I'm reading the book &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470029781&quot; rel=&quot;nofollow&quot;&gt;Risk Management and Shareholders Value in Banking&lt;/a&gt; by Resti &amp;amp; Sironi. I quote a paragraph from the book (Chapter 5, appendix):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The derivative of an option’s value with respect to the interest rate is the rho ($\rho$)&#xA;  coefficient. From a logical point of view, the relation between these two quantities is&#xA;  dual. On the one hand, a higher interest rate decreases the present value of the option’s&#xA;  expected final value (payoff at maturity): this means that a higher interest rate has a&#xA;  negative effect on the value of any option. On the other hand, a higher interest rate&#xA;  implies a higher forward price of the underlying asset, so a higher value for call options&#xA;  and a lower value for put options. The two effects therefore act in the same direction in the&#xA;  case of put options (making the total effect negative), while they act in a conflicting way&#xA;  in the case of call options, for which, in any case, the first effect usually predominates. So, in brief:&lt;br&gt;&#xA;  $$\rho_{c}=XTe^{-iT}N(d_2)&amp;lt;0$$&#xA;  $$\rho_{p}=XTe^{-iT}N(d_2)&amp;lt;0$$.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I think the formulae are wrong. They should be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\rho_{c}=XTe^{-iT}N(d_2)&amp;gt;0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\rho_{p}=-XTe^{-iT}N(-d_2)&amp;lt;0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, even the explanation they give for the sign of $\rho_c$ is wrong: they say the negative effect predominates, which is not true.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to know if the formulae and the signs are correct, and I would also like to have more detail on the statement &quot;a higher interest rate implies a higher forward price of the underlying asset&quot;. I don't understand how this comes into play.&lt;/p&gt;&#xA;" OwnerUserId="12214" LastEditorUserId="467" LastEditDate="2015-11-09T03:52:36.797" LastActivityDate="2015-11-09T22:18:54.417" Title="What should be the sign of greek letter $\rho$?" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;greeks&gt;&lt;sensitivities&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21640" PostTypeId="1" CreationDate="2015-11-08T22:51:17.383" Score="-1" ViewCount="239" Body="&lt;p&gt;What is the price C of a European call option on a dividend paying stock? I believe it is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;C  =  U. N(d1)  - exp(-rt).K.N(d2)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;d1 = [  ln(U/K) + (r + v^2/2).t  ]/[ v.sqrt(t) ]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;d2 = d1 - v.sqrt(t)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;U = S.exp(-qt)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where S is the spot price of the stock, q the dividend yield, K the strike, r the risk free rate, t time to expiry, v implied vol, and N the cumulative normal distribution function. All yields/rates continuous basis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I have been told that because there is no long-dated forward price for stocks, the no arbitrage principle fails to apply, and so in this case the correct formula for U is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;U = S.exp( (g – r)t )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where g is the forecast growth rate of the stock. Since q is typically 2-3%, and since g is assumed  to be 5%, this leads to a considerable difference in the two methods. Which is correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[Edit] In the interests of clarity (see the first answer below, which claims the formulas are really the same) note the inconsistent assumptions about growth in the original question. If q = 3%, and r = 2.5%, this would imply a negative growth rate g of -0.5% in a no arbitrage world. However, it has been argued that where no arbitrage does not apply, we can use a forecasting model that predicts 5% growth in equities in the long term, and so g-r &amp;lt;&gt; -q.&lt;/p&gt;&#xA;" OwnerUserId="7220" LastEditorUserId="7220" LastEditDate="2015-11-09T08:58:48.860" LastActivityDate="2015-11-09T08:58:48.860" Title="European option on a dividend paying stock, limits to arbitrage?" Tags="&lt;equities&gt;&lt;no-arbitrage-theory&gt;&lt;european-options&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21641" PostTypeId="1" CreationDate="2015-11-09T01:31:52.820" Score="0" ViewCount="111" Body="&lt;p&gt;How does one create a benchmark for a portfolio?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I realize if I were using strategic asset allocation, I could just look at the already existing benchmarks associated with the various asset classes in my portfolio and create my benchmark from some weighted average of those.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, what if I am only considering some stocks in the S&amp;amp;P and am not using strategic asset allocation exactly? Would I just take the benchmark to be the weighted average of these stocks where the weights would be their market capitalizations? &lt;/p&gt;&#xA;" OwnerUserId="11917" LastEditorUserId="467" LastEditDate="2015-11-09T08:19:17.543" LastActivityDate="2015-11-09T08:19:17.543" Title="Hwo to create a benchmark for a portfolio?" Tags="&lt;portfolio-management&gt;&lt;benchmark&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21642" PostTypeId="2" ParentId="21640" CreationDate="2015-11-09T02:03:25.993" Score="-1" Body="&lt;p&gt;Both formulas (generalised Black Scholes) are correct. In the first one, you have the BS model with dividend. In the second, you have a non-zero cost of carry. It's really the same formula. Note that cost of carry = risk free rate - dividend. You can think cost of carry like the negative growth rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/c3EsK.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/c3EsK.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="601" LastEditDate="2015-11-09T03:39:03.480" LastActivityDate="2015-11-09T03:39:03.480" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21643" PostTypeId="2" ParentId="21402" CreationDate="2015-11-09T02:34:58.993" Score="3" Body="&lt;p&gt;You understand that forward curve can replicate the payment on FL at the next reset date. Therefore, the vanilla swap can be valued as a series of FRA - meaning, you assume that the forward rate will be realized and the resulting cash flow can be discounted to the present using the zero swap curve. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you have a non-standard situation, like for an arrears swap the payment is at the time of the reset, then this scheme fails, rather than the next reset date. It fails because the payment is not following the FRA convention. This is in effect, as if a wrong measure has been applied. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you walk the zero curve on time, the forward rate changes. The relationship between the bond price is yield is a convex function. As the yield changes the price changes in a non-linear manner. This causes convexity effect. Longer the maturity the greater is the convexity effect, hence the convexity adjustment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For arrears swap, if the frequency of the payment is annual, and it is paid a year earlier, the convexity adjustment is for every year of the swap until maturity. It is difficult for many to get an intuition on because it is usually wrapped up in elaborate mathematical expressions.&lt;/p&gt;&#xA;" OwnerUserId="7867" LastEditorUserId="7867" LastEditDate="2015-11-09T02:44:51.623" LastActivityDate="2015-11-09T02:44:51.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21644" PostTypeId="1" CreationDate="2015-11-09T03:56:20.767" Score="3" ViewCount="219" Body="&lt;p&gt;In vanilla swap, the FL payments is fixed on one date and paid on the next reset date. So the next payment is known. However, the payment after that is not known. What would be the best estimate of that, mathematically? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Applying Markov property to bond price,  expected price will not change. Calculate next to next payment from the next known payment along with forward rate at the next reset period. It seems to be simple. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for a more mathematically correct way to approach this, if any.&lt;/p&gt;&#xA;" OwnerUserId="7867" LastActivityDate="2016-10-30T07:42:55.413" Title="What is mathematically rigorous way to estimate floating swap cash flow in the future?" Tags="&lt;swaps&gt;&lt;interest-rate-swap&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21646" PostTypeId="1" CreationDate="2015-11-09T06:25:08.763" Score="0" ViewCount="128" Body="&lt;p&gt;Is there a source (preferably free :) that provides a list of large intraday (versus pre market) movers for the day you look?  I don't mind getting the list on market close.  I don't need historical data, just data for the day I'm looking.&lt;/p&gt;&#xA;" OwnerUserId="17088" LastActivityDate="2016-01-13T18:07:33.750" Title="How to get list of large intraday movers for that day?" Tags="&lt;equities&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21648" PostTypeId="1" CreationDate="2015-11-09T13:51:19.237" Score="0" ViewCount="1456" Body="&lt;p&gt;I'm trying to calculate the expected shortfall for the below scenario. I don't understand why the 1.04% probability of 0 bonds defaulting is used as a weight when calculating ES, since the binomial probability was 96.04%. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;﻿Assume a two-bond portfolio where the probability of bond default is 2% for each and independent (i.i.d). The face value of each bond is $100 and recovery is zero. What is the 95% expected shortfall?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Solution Given&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Calculate the binomial probabilities of both bonds defaulting, only one defaulting and 0 bonds defaulting which are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P (0 defaults) = 96.04% P (1 defaults) = 3.92% P (2 defaults) = 0.04%&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The 5% tail therefore contains the following:&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;0.04% probability of 2 defaults&#xA;3.92% probability of 1 default&#xA;1.04% probability of 0 defaults&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The 95% ES is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;((0.04% * 2) + (3.92% * 1) + (1.04% * 0))/5% = 0.8 * 100 = 80.00&#xA;The average loss in the 5% tail (of the binomial) is 0.8 defaults or \$80.&lt;/p&gt;&#xA;" OwnerUserId="9265" LastActivityDate="2017-03-12T16:53:52.503" Title="Calculating expected shortfall" Tags="&lt;risk&gt;&lt;binomial&gt;" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="21649" PostTypeId="2" ParentId="21648" CreationDate="2015-11-09T14:22:30.830" Score="4" Body="&lt;p&gt;The 1.04% are used in the calculation because it is 95% expected shortfall so you want to calculate the expectation on the 5% worst loss.&#xA;In your problem there is 3 possible outcomes: loss of 200, 100 or 0.&#xA;As the probability of loss of 200 or 100 is 0.04+3.92 = 3.96% &amp;lt; 5%, you need to take account of the loss of 0$ for 1.04% part to reach the 5%. &lt;/p&gt;&#xA;" OwnerUserId="17733" LastActivityDate="2015-11-09T14:22:30.830" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21650" PostTypeId="1" CreationDate="2015-11-09T14:27:11.440" Score="1" ViewCount="110" Body="&lt;p&gt;Markit publishes investable basket CDS indices. These are indices intended to track the credit risk of a basket of issuers (e.g. in the case of iTraxx Europe Series 24 these are 125 names) in an investable way. &#xA;The weight of each name in the index in this case is 0.8%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I construct a bond portfolio that has a similar credit exposure.&#xA;How do I choose the weights? Is it correct to invest the same notional into bonds of each issuer? Then notional*traded price gives me weights for each bond that differ from 0.8%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say as a toy example I have an index with 2 issuers. Then they are weighted 50%/50% in the index.&#xA;For issuer 1 I have a bond A with a matching maturity that trades at 90. For issuer 2 I have a bond B that trades at 110. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the equivalent of investing  1 Mio EUR in the basket? In the basket case I have an exposure of 500K EUR to issuer 1 and the same for issuer 2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the portfolio case I can invest a notional of 500K in bond A which costs 450K and a notional of 500K in bond B at a price of 550K which gives a weighting of 45% to 55% in the portfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand if I invest a notional of approx 555 555 into A (at a price of 90) and 454545 in B (at a price 110) then I get a 50%/50% weighting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which one corresponds better to what a basket CDS represents?&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-11-09T14:55:25.703" LastActivityDate="2015-11-09T14:55:25.703" Title="Construction of bond portfolio represented by a CDS-Index" Tags="&lt;cds&gt;&lt;basket&gt;&lt;bond-portfolio&gt;&lt;credit-derivatives&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21651" PostTypeId="1" CreationDate="2015-11-09T15:21:34.040" Score="1" ViewCount="99" Body="&lt;p&gt;I have the following problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the 5 year investment strategy and given the yearly portfolio returns $S_{t+1}/S_t$ and dividends $D_{t+1}$ paid at $t+1$ which are modeled as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{S_{t+1}}{S_t}=e^{\mu+0.2X_{t+1}}$ and $\frac{D_{t+1}}{S_t}=0.05e^{-0.05^2/2+0.05Y_{t+1}}$ where both $X_i$'s and $Y_i$'s are independent and standard normally distributed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The task is to determina a function $f$ for a investion of 1000000 dollars in a portfolio of stocks and reinsvesting the dividends in the portfolio of stocks such that the value of the portfolio in 5 years can be expressed as some function $V_5=f(\mu,X_i,Y_i)$ for $i=1,2,3,4,5$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I basically think this is just by using the given models for returns and dividends: $V_5 = 1000000e^{\mu+0.2X_{t+1}}+0.05e^{-0.05^2/2+0.05Y_{t+1}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I am not sure if I have done this right?&#xA;Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="18211" LastEditorUserId="18211" LastEditDate="2015-11-09T17:48:45.880" LastActivityDate="2015-11-11T19:34:22.430" Title="Determining the investment strategy" Tags="&lt;portfolio-management&gt;&lt;returns&gt;&lt;portfolio&gt;" AnswerCount="0" CommentCount="7" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21652" PostTypeId="1" CreationDate="2015-11-09T15:35:49.760" Score="1" ViewCount="252" Body="&lt;p&gt;The paper by Longstaff-Schwatz on Least Square Monte Carlo offers very little proof. The only proof they have given assumed the option can only be exercised at two different time point and the price dynamics is supported on $(0,\infty)$ and is Markovian.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have two questions&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Are there further numerical studies on LSM for multiple variables?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Has people proven made any more progress proof-wise? (or do practitioners simply not care and cross their fingers?)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3334" LastEditorUserId="3334" LastEditDate="2015-11-10T13:16:51.873" LastActivityDate="2018-10-21T16:57:08.480" Title="Least-Square Monte Carlo in multiple variable" Tags="&lt;monte-carlo&gt;&lt;american-options&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21653" PostTypeId="2" ParentId="21638" CreationDate="2015-11-09T16:03:49.003" Score="1" Body="&lt;p&gt;Yes, you are right. It appears to be a trivial typographical error in the book. I checked the formulas on Wikipedia &lt;a href=&quot;https://en.wikipedia.org/wiki/Greeks_%28finance%29&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Greeks_%28finance%29&lt;/a&gt; and they agree with yours. The signs are obvious also since N(.) is between 0 and 1, i.e. non-negative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, about the reasoning starting with &quot;from a logical point of view&quot;. Are you familiar with the binomial model? Imagine running it twice, once with a low interest rate, once with a high one (all other things the same). In the model the stock price grows at the rate r. So in the high interest rate case $S_T$ (what he calls the forward price of the stock) will have a higher expected value, which will increase $E(S_T-K)^+$ and decrease $E(K-S_T)^+$. But then we have to discount these two values to the present to find the call value and the put value, and with high interest rate that lowers both values. So for calls the total effect seems ambiguous, for puts there is an overall decrease in value (negative $\rho_P$).&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2015-11-09T22:18:54.417" LastActivityDate="2015-11-09T22:18:54.417" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21654" PostTypeId="1" CreationDate="2015-11-09T16:21:29.903" Score="1" ViewCount="603" Body="&lt;p&gt;I had a question regarding the existence of the volatility skew. I've tried researching it a fair bit and I come across a few different explanations: 1. Market participants like buying downside puts and selling upside calls and as a function of supply and demand implied vols are skewed, 2. stock returns are not lognormally distributed (fat tails) so options that are far away from ATM are priced at a higher volatility, 3. volatility is not constant and when stocks decline vol ticks up and vice versa when the market rallies. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand why the first 2 contribute to skew, but I don't understand the third. Why does the fact that volatility can change imply the existence of a skew, why doesn't that imply a flat skew that simply shifts levels vertically? So what if when markets drop vol increases, why does this imply a skew? I hope this question makes sense, I've read a few explanations on skew but I still don't quite understand why the third causes it (the other 2 make sense). &lt;/p&gt;&#xA;" OwnerUserId="18212" LastActivityDate="2015-11-10T01:33:11.407" Title="Does the fact that volatility is not constant imply existence of skew?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;skew&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21655" PostTypeId="2" ParentId="21654" CreationDate="2015-11-09T17:00:44.670" Score="4" Body="&lt;p&gt;It is not the fact that volatility is time varying that creates the skew per se, but the fact that volatility is negatively correlated with the spot. That is to say, as the stock/index price declines volatility will tend on average to increase, and vice versa. Time varying volatility itself would create a more symmetric 'smile'. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose that you have a very simple case where volatility can take only two values $(\sigma_L,\sigma_H) = (0.10,0.50)$ with 50-50 probability. Also say that the drift is zero under both regimes. This is the simplest case of 'stochastic volatility,' if you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, the price of the option will just be the 50-50 weighted average of the two Black-Scholes prices&#xA;$$ C = 0.5\ BS(S,X,r,\sigma_L,T)+0.5\ BS(S,X,r,\sigma_H,T) $$&#xA;Equivalently, the risk neutral distribution of the log-price will be the 50-50 mixture of two Gaussians with different volatilities which exhibits fat tails.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuitively, when you are at the money both parts of the weighted sum contribute to the uncertainty, and the implied vol is roughly the average of the two vols, around 0.30. A Gaussian with this volatility will exhibit practically zero probability mass beyond $\pm 1.8$ which is the 6-sigma event point. However, the 50-50 mixture still has some considerable mass, since for the high volatility regime this is only a 3.5-sigma event. To mimic this mass a higher implied vol  is required. This is symmetric, hence a 'smile'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see that graphically below, where I have calculated the implied volatility for this example.&#xA;&lt;a href=&quot;https://i.stack.imgur.com/xbPmZ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/xbPmZ.png&quot; alt=&quot;Symmetric case&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now suppose that we have a 'negative correlation', that is to say we still have a 50-50 mixture but now when vol takes the 'low' value 0.10 then the drift is +0.10 positive, but when vol takes the 'high' value of 0.50 then the drift is -0.10 negative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In that case the +6-sigma event is not symmetric to the -6-sigma event. In fact, implied vol on one side will converge to the 'high' vol of 0.50 while the other side will converge to the 'low' vol of 0.10, following the drifts. Hence we are presented with a 'skew' rather than a 'smile'&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/g3w7B.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/g3w7B.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ok, this picture looks a bit odd! This is due to the extreme parameter values in the example, and reflects the 'weight' each distribution has in the mixture at each point. In any case, here is the Python code that created the pics to play with.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# parameters&#xA;sH = 0.50 # High vol regime&#xA;mH =-0.10 # Drift in high vol regime&#xA;sL = 0.10 # Low vol regime&#xA;mL =+0.10 # Drift in low vol regime&#xA;wH = 0.50 # Mixing weight&#xA;&#xA;# code&#xA;import numpy as np&#xA;from scipy.stats import norm&#xA;from scipy.optimize import root&#xA;import matplotlib.pyplot as plt&#xA;&#xA;N = norm(0,1).cdf&#xA;n = norm(0,1).pdf&#xA;&#xA;def bs(S, X, r, sigma, T):&#xA;    d1 = np.log(S/X)+(r+0.5*sigma*sigma)*T&#xA;    d1 = d1/sigma/np.sqrt(T+1E-10)&#xA;    d2 = d1 -sigma*np.sqrt(T)&#xA;    return S*N(d1) -X*np.exp(r*T)*N(d2)&#xA;def iv(S, X, r, T, C):&#xA;    return root(lambda s: bs(S, X, r, s, T)-C, 0.50*np.ones(C.shape)).x&#xA;&#xA;L = 2.5&#xA;X = 100.*np.exp(np.linspace(-L, L, 101))&#xA;cH = bs(100., X, mH, sH, 1.)&#xA;cL = bs(100., X, mL, sL, 1.)&#xA;c = wH*cH+(1-wH)*cL&#xA;&#xA;m =np.log1p(wH*(np.exp(mH)-1)+(1-wH)*(np.exp(mL)-1))&#xA;v = iv(100., X, m, 1., c)&#xA;&#xA;fg = plt.figure()&#xA;ax = fg.add_subplot(111)&#xA;ax.plot(np.log(100./X), v)&#xA;ax.set_xlim(-L, L)&#xA;ax.set_xlabel('log[spot/strike]')&#xA;ax.set_ylabel('implied volatility')&#xA;ax.grid()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2015-11-10T01:33:11.407" LastActivityDate="2015-11-10T01:33:11.407" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21656" PostTypeId="1" CreationDate="2015-11-09T22:06:41.680" Score="2" ViewCount="621" Body="&lt;p&gt;I recently came across a Paper by a paper of Rubinstein and Jackwerth (1997): &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.441.5214&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow&quot;&gt;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.441.5214&amp;amp;rep=rep1&amp;amp;type=pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where they assume that you can describe risk-neutral distribution = subjective probability $\times$ risk-aversion adjustment. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you know of any papers that use other approaches or go into that relationship in more detail?&lt;/p&gt;&#xA;" OwnerUserId="6276" LastActivityDate="2015-11-10T15:03:42.783" Title="Relationship between risk-neutral probability and subjective probability" Tags="&lt;risk-neutral-measure&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21657" PostTypeId="2" ParentId="21496" CreationDate="2015-11-09T22:34:25.760" Score="2" Body="&lt;p&gt;We consider a single Libor rate. The application to a swap is straightforward.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the Libor calculation period $[T_1, \, T_2]$ and the Libor payment made at $T_1$. We denote by $\Delta = T_2-T_1$ the length in years of the calculation period. Here, we ignore the two-day payment delay as its impact to pricing is immaterial. We assume that, under the $T_2$-forward measure $P_{T_2}$, the Libor rate process $\{L(t, T_1, T_2) \mid 0 \le t \le T_1\}$, where&#xA;\begin{align*}&#xA;L(t, T_1, T_2) = \frac{1}{\Delta} \left(\frac{P(t, T_1)}{P(t, T_2)}-1\right),&#xA;\end{align*}&#xA;is a martingale and satisfies an SDE of the form&#xA;\begin{align*}&#xA;dL(t, T_1, T_2) = \sigma L(t, T_1, T_2) d W_t,&#xA;\end{align*}&#xA;where $\{W_t \mid t \ge 0\}$ is a standard Brownian motion.  Then, for $0 \le t \le T \le T_1$,&#xA;\begin{align*}&#xA;L(T, T_1, T_2) = L(t, T_1, T_2) e^{-\frac{1}{2}\sigma^2 (T-t) + \sigma \int_{t}^{T} dW_s}.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $B_t$ be the money -market account value at time $t$. &#xA;Then, for $ 0 \le t \le T_2$,&#xA;\begin{align*}&#xA;\frac{dP}{dP_{T_2}} \big|t = \frac{B_t P(0, T_2)}{P(t, T_2)} \equiv \eta_t.&#xA;\end{align*}&#xA;Moreover, let $E$ and $E_{T_2}$ be the respective expectation operators under the risk-neutral measure and the $T_2$-forward measures. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the value, at time $t\le T_1$, of the Libor rate $L(T_1, T_1, T_2)$, both set and paid at $T_1$, is given by&#xA;\begin{align*}&#xA;B_t E\left(\frac{L(T_1, T_1, T_2)}{B_{T_1}}\mid \mathcal{F}_t \right) &amp;amp;= B_t E_{T_2}\left(\frac{\eta_{T_1}}{\eta_t}\frac{L(T_1, T_1, T_2)}{B_{T_1}}\mid \mathcal{F}_t \right)\\&#xA;&amp;amp;=P(t, T_2) E_{T_2}\left(\frac{1}{P(T_1, T_2)}L(T_1, T_1, T_2)\mid \mathcal{F}_t \right)\\&#xA;&amp;amp;= P(t, T_2) E_{T_2}\left(\left(\Delta L(T_1, T_1, T_2) + 1 \right)L(T_1, T_1, T_2)\mid \mathcal{F}_t \right)\\&#xA;&amp;amp;= P(t, T_2)E_{T_2}\left(L(T_1, T_1, T_2) + \Delta L(T_1, T_1, T_2)^2\mid \mathcal{F}_t \right)\\&#xA;&amp;amp;= P(t, T_2) \left(L(t, T_1, T_2) + \Delta L(t, T_1, T_2)^2 e^{\sigma^2 (T_1-t)}\right)\\&#xA;&amp;amp;=P(t, T_1) \frac{L(t, T_1, T_2) + \Delta L(t, T_1, T_2)^2 e^{\sigma^2 (T_1-t)}}{\Delta L(t, T_1, T_2) + 1} \\&#xA;&amp;amp;= P(t, T_1)\left(c_t + L(t, T_1, T_2) \right),&#xA;\end{align*}&#xA;where &#xA;\begin{align*}&#xA;c_t = \frac{\Delta L(t, T_1, T_2)^2}{\Delta L(t, T_1, T_2) + 1}\big(e^{\sigma^2 (T_1-t)} -1 \big)&#xA;\end{align*}&#xA;is the convexity adjustment. Note that, there is no approximation needed, as long as we can estimate the volatility.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-11-10T18:17:55.603" LastActivityDate="2015-11-10T18:17:55.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21658" PostTypeId="2" ParentId="21652" CreationDate="2015-11-09T23:54:48.047" Score="2" Body="&lt;p&gt;there has been a huge amount of work on this. In terms of numerical studies, see my paper &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Beveridge, Christopher and Joshi, Mark S. and Tang, Robert, Practical Policy Iteration: Generic Methods for Obtaining Rapid and Tight Bounds for Bermudan Exotic Derivatives Using Monte Carlo Simulation (January 23, 2009). Available at SSRN: &lt;a href=&quot;http://ssrn.com/abstract=1331904&quot; rel=&quot;nofollow&quot;&gt;http://ssrn.com/abstract=1331904&lt;/a&gt; or &lt;a href=&quot;http://dx.doi.org/10.2139/ssrn.1331904&quot; rel=&quot;nofollow&quot;&gt;http://dx.doi.org/10.2139/ssrn.1331904&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a proof &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://ecommons.cornell.edu/bitstream/handle/1813/9176/TR001296.pdf&quot; rel=&quot;nofollow&quot;&gt;https://ecommons.cornell.edu/bitstream/handle/1813/9176/TR001296.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Carriere's work preceded Longstaff Schwartz and it is probably better to call it least-squares.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-11-09T23:54:48.047" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21659" PostTypeId="2" ParentId="21646" CreationDate="2015-11-10T05:52:52.407" Score="1" Body="&lt;p&gt;No Such source which provides you this information. &#xA;You could write a script which periodically downloads the data from source pages/website and which could give you the required information. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most indices let you download data in excel format. Custom configuration of excel could help you here.&lt;/p&gt;&#xA;" OwnerUserId="6799" LastEditorUserId="6799" LastEditDate="2015-11-14T16:51:15.143" LastActivityDate="2015-11-14T16:51:15.143" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21660" PostTypeId="2" ParentId="21625" CreationDate="2015-11-10T06:09:15.547" Score="2" Body="&lt;p&gt;I have to agree with Tim as Most books also suggest the same. But, realistically, considering the cost of Insurance and there being no significant returns from the underlying asset, the investor should question himself whether &quot;Is the asset Worth investing?&quot; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Considering the huge risk of invested amount &amp;amp; current macro economic events, the underlying isn't worth the price. Insurance is depreciating. If you opt for futures, you end up loosing your returns on underlying in case of a upward movement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For such cases, there exists debt markets, which often guarantee risk free rate and a slight premium over risk free rates.&lt;/p&gt;&#xA;" OwnerUserId="6799" LastActivityDate="2015-11-10T06:09:15.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21661" PostTypeId="2" ParentId="2205" CreationDate="2015-11-10T06:37:24.307" Score="1" Body="&lt;p&gt;the simple answer is to make an adjustment to the beta of company.&#xA;let me give you an example &#xA;say,&#xA;beta is 1.0 &amp;amp; correlation of the company with market is 0.5 (which is 50% of the &#xA;movement in the prices is explained by the market and rest is because of some other reason). so, now one thing is clear that if we some how make this correlation equals to 1 (i.e 100% of the movement is explained by market it self) we can get the total risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so, total beta=total risk=Beta/Correlation(r)&#xA;    =1/.5  = 2&#xA;total beta = 2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks&lt;/p&gt;&#xA;" OwnerUserId="18217" LastActivityDate="2015-11-10T06:37:24.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21665" PostTypeId="1" CreationDate="2015-11-10T10:34:45.177" Score="0" ViewCount="227" Body="&lt;p&gt;Imagine a trading house that trades options in a modest way, and is looking for simple but effective metrics over which trading option limits will be set.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some random thoughts:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) VaR is not ideal, since the biggest concern is what happens 1% of the time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Because the focus is to keep it simple, one should focus on gamma and vega risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Stress Test is an alternative but if applied in a simple way, something like limit up/limit down scenarios. Any ideas on how to calculate a stress test gamma and vega?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) Would it be logical to set gamma and vega limits per product? I mean just the add the gammas and vegas and set the limit.&lt;/p&gt;&#xA;" OwnerUserId="18210" LastActivityDate="2015-12-12T16:46:14.517" Title="Basic Metrics for Option Trading Limits" Tags="&lt;options&gt;&lt;risk-management&gt;&lt;optionmetrics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21666" PostTypeId="1" CreationDate="2015-11-10T10:53:59.517" Score="0" ViewCount="1811" Body="&lt;p&gt;Consider you have 4 assets &lt;code&gt;A&lt;/code&gt;, &lt;code&gt;B&lt;/code&gt;, &lt;code&gt;C&lt;/code&gt; and &lt;code&gt;D&lt;/code&gt;, where&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Asset &lt;code&gt;A&lt;/code&gt; started trading on 2 Jan &lt;strong&gt;1990&lt;/strong&gt; (i.e. data is available since that point in time for every trading day until today)&lt;/li&gt;&#xA;&lt;li&gt;Asset &lt;code&gt;B&lt;/code&gt; started trading on 2 Jan &lt;strong&gt;1995&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;Asset &lt;code&gt;C&lt;/code&gt; also started trading on 2 Jan &lt;strong&gt;1995&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;Asset &lt;code&gt;D&lt;/code&gt; started trading on 2 Jan &lt;strong&gt;2010&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In the simplest method, you would just use the joint history of all assets beginning on 2 Jan 2010, maybe fill missing data due to different holidays on different exchanges and compute the sample variance-covariance (VCV) matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this way you would throw away the longer history of the assets &lt;code&gt;A&lt;/code&gt;, &lt;code&gt;B&lt;/code&gt; and &lt;code&gt;C&lt;/code&gt; resulting in a less stable VCV matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there another way to come around the problem of estimating the VCV matrix for differing length financial time series? Can you e.g. construct the VCV matrix from pairwise covariance?&lt;/p&gt;&#xA;" OwnerUserId="18221" LastActivityDate="2015-11-12T13:03:06.520" Title="How to estimate variance-covariance matrix of assets with different length of historical data?" Tags="&lt;time-series&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio&gt;&lt;historical-data&gt;&lt;covariance&gt;" AnswerCount="3" CommentCount="0" ClosedDate="2015-11-12T20:01:46.540" ContentLicense="CC BY-SA 3.0" />
  <row Id="21668" PostTypeId="2" ParentId="21666" CreationDate="2015-11-10T11:47:02.950" Score="2" Body="&lt;p&gt;The short answer: Take all time series starting from 2010 (at most).&#xA;The covarianc-matrix tells you something about the assets for a certain amount of time.&#xA;E.g. if I estiamte the covaraince matrix of those 4 assets taking into account data from the last year (!) then I can expect that this matrix remains valid for the coming 1-3 months - if the markets don't change too much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It pretty much depends on the purpose but e.g. in &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2606884&quot; rel=&quot;nofollow&quot;&gt;Momentum and Markowitz: A Golden Combination&lt;/a&gt;&#xA; the authors argue that the seconds moments exhibit some momentum if estimate over a year and held for 1 month (quote: &quot;In this paper we apply short lookback periods (maximum of 12 months) to estimate MVO parameters in order to best harvest the momentum factor.&quot;) . Note that all those numbers are just estimates - and if there are market slides or rallies they are possibly worth nothing anymore.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-11-10T11:47:02.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21669" PostTypeId="2" ParentId="21656" CreationDate="2015-11-10T11:52:40.560" Score="3" Body="&lt;p&gt;Standard Finance/Utility theory dictates that all future cash-flows are priced via the marginal rate of substitution. For example, say that $X_T$ is the random variable that represents this cash-flow at a future time. Then, the value of this cash-flow today will be valued as&#xA;$$ X_0 = E \left[ \frac{e^{-\rho T}\ U'(W_T)}{U'(W_0)} X_T \right] $$&#xA;where $U$ is the utility function, and $W$ is the 'wealth' that serves as an argument to the utility function. $\rho$ is a rate that discount utilities (a dollar today is worth more than a dollar tomorrow.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now typically a utility function is upward sloping (more wealth is better) but is also concave (that is to say it increases at a decreasing rate; the millionth dollar is not as valuable as the first one). This  reflects the 'risk aversion' in the following way: a loss of a dollar will cost in utility terms more than a gain of a dollar, therefore to become indifferent the odds should be better than 50-50, or equivalently I would demand a positive expected return to play a zero-sum random game.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now back to pricing, note that a bond is just a constant cash flow $X_T=1$, which effectively gives us the bond price/ risk free rate in terms of the expected marginal rate of substitution&#xA;$$B = e^{-rT} = e^{-\rho T} \frac{E[U'(W_T)]}{U'(W_0)} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two interesting cases:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;If the utility function is linear, then $U'(W)=const$ and we are 'risk neutral'. In that case the discount rate for dollars is the same as the discount rate for utilities, $r=\rho$. The value of a random payoff is just its discounted expected value $X_0 = e^{-rT} E[X_T]$.&lt;/li&gt;&#xA;&lt;li&gt;If the random payoff is practically independent of our future wealth, then the expectation of the product is the product of expectations, and its value today is again its discounted expected value $X_0 = e^{-rT} E[X_T]$. A market index which correlates with wealth has a higher premium than a small stock.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In general though, the random quantity $\mathcal{M}_T(X_T)=e^{-\rho T} \frac{U'(W_T(X_T))}{U'(W_0(X_0))}$ which has various names (pricing kernel, state price density, marginal rate of substitution, etc) summarizes risk aversion. I also put an explicit dependence of wealth on $X$ to remember that they are in general correlated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the distribution of this future payoff at time $T$ has a density $f_T(x)$, then the expectation that gives its price today is actually written as&#xA;$$&#xA;X_0 = &#xA;\int \mathcal{M}_T(x)\ x\ f_T(x)\ dx  = &#xA;E [\mathcal{M}_T(X_T)] \int x\ \frac{\mathcal{M}_T(x)}{E [\mathcal{M}_T(X_T)]}\ f_T(x)\ dx &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Look at the function&#xA;$$ &#xA;g_T(x) = \frac{\mathcal{M}_T(x)}{E [\mathcal{M}_T(X_T)]}\ f_T(x)&#xA;$$&#xA;This is actually always positive (because utility slopes upwards) and it also integrates to one (that's why I normalized with $E[\mathcal{M}]$). Therefore is is a valid probability density function, which is the original (real one) times a risk aversion adjustment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The price of the claim is written as&#xA;$$&#xA;X_0 = e^{-rT} \int x\ g_T(x)\ dx = e^{-rT} E^g[X_T]&#xA;$$&#xA;that is to say the value of the claim is the discounted expected payoff, where expectations are taken not under the real distribution $f_T$ but under the 'risk neutral' (or as I prefer to call it 'risk adjusted') one $g_T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(&lt;em&gt;Note: The 'risk neutral' distribution is called 'risk neutral' exactly because the pricing formula above is the same as the one in the risk neutral case above.&lt;/em&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(&lt;em&gt;Edit: Added intertemporal discount factor as OP suggested&lt;/em&gt;)&lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2015-11-10T15:03:42.783" LastActivityDate="2015-11-10T15:03:42.783" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21670" PostTypeId="1" AcceptedAnswerId="21676" CreationDate="2015-11-10T14:19:04.787" Score="1" ViewCount="4144" Body="&lt;p&gt;What is the difference between DV01 and IR DV01? As far as I can see DV01 is at point on the yield curve and IR DV01 represents a parallel shift of the entire yield curve? My understanding is still shaky so some clarification would be greatful as I cannot find this on the internet.&lt;/p&gt;&#xA;" OwnerUserId="11723" LastActivityDate="2015-11-10T15:39:49.627" Title="Difference between DV01 and IR DV01" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;duration&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21671" PostTypeId="2" ParentId="19111" CreationDate="2015-11-10T14:23:42.597" Score="3" Body="&lt;p&gt;Migration will be hard. You can check &lt;a href=&quot;http://www.cmegroup.com/confluence/display/EPICSANDBOX/CME+Globex+Legacy+Market+Data+to+MDP+3.0+Market+Data+Conversion#CMEGlobexLegacyMarketDatatoMDP3.0MarketDataConversion-MDP3Overview-FIX/FASTtoMDP3.0&quot; rel=&quot;nofollow&quot;&gt;MDP3 Overview - FIX/FAST to MDP 3.0&lt;/a&gt; for more details.&lt;/p&gt;&#xA;" OwnerUserId="18182" LastActivityDate="2015-11-10T14:23:42.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21672" PostTypeId="2" ParentId="19074" CreationDate="2015-11-10T14:42:08.067" Score="8" Body="&lt;p&gt;You will find a tutorial of QuantLib using python with simple examples here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://gouthamanbalaraman.com/blog/quantlib-python-tutorials-with-examples.html&quot; rel=&quot;noreferrer&quot;&gt;http://gouthamanbalaraman.com/blog/quantlib-python-tutorials-with-examples.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been writing these as a means to be instructive to others going through the process of learning and working with QuantLib. If you have suggestions on what topics you would like to read, please post a comment.&lt;/p&gt;&#xA;" OwnerUserId="15749" LastActivityDate="2015-11-10T14:42:08.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21673" PostTypeId="2" ParentId="21240" CreationDate="2015-11-10T14:45:54.073" Score="0" Body="&lt;p&gt;Noir : I'm studying the same coursera course as you and wonder why you used a multiplier &quot;q&quot; = 0.7483 in calculating the futures lattice eg first row of second column from left 175.42 = 0.7483 * 178.77 + (1-0.7483) * 165.45 and not the calculated value of q equal to 0.4925.&lt;/p&gt;&#xA;" OwnerUserId="18226" LastActivityDate="2015-11-10T14:45:54.073" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21674" PostTypeId="1" AcceptedAnswerId="21683" CreationDate="2015-11-10T14:50:15.350" Score="1" ViewCount="78" Body="&lt;p&gt;Where can I find a list of listed companies on NASDAQ from 2000 to 2014? &lt;/p&gt;&#xA;" OwnerUserId="18227" LastEditorUserId="848" LastEditDate="2015-11-10T17:24:48.930" LastActivityDate="2015-11-11T02:02:32.663" Title="Listed companies on NASDAQ" Tags="&lt;equities&gt;&lt;nasdaq&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21676" PostTypeId="2" ParentId="21670" CreationDate="2015-11-10T15:33:09.347" Score="2" Body="&lt;p&gt;DV01 is the dollar variation in a bond's value per unit change in the yield.&#xA;&lt;a href=&quot;https://en.wikipedia.org/wiki/Bond_duration&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Bond_duration&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IR DV01 is the dollar value change for a 1bp upward parallel shift in interest rates.&#xA;&lt;a href=&quot;http://dataforthoughts.blogspot.it/2009/09/economics-of-negative-bond-cds-basis.html&quot; rel=&quot;nofollow&quot;&gt;http://dataforthoughts.blogspot.it/2009/09/economics-of-negative-bond-cds-basis.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12214" LastEditorUserId="12214" LastEditDate="2015-11-10T15:39:49.627" LastActivityDate="2015-11-10T15:39:49.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21677" PostTypeId="1" CreationDate="2015-11-10T15:59:50.720" Score="1" ViewCount="450" Body="&lt;p&gt;I'm trying to implement an Exponential Moving Average indicator, but I'm sort of stuck on the smoothing factor. What I've come up with: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{1}{N}\sum\limits_{k=0}^N \alpha^{k} P_k$$&#xA;Where &lt;strong&gt;N&lt;/strong&gt; is the window of days in consideration, &lt;strong&gt;k&lt;/strong&gt; loops through the days, &lt;strong&gt;$ \alpha $&lt;/strong&gt; is a smoothing factor and &lt;strong&gt;P&lt;/strong&gt; is the price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What should I use for a smoothing factor? Is there any general guidelines? And am I even near the final product?&lt;/p&gt;&#xA;" OwnerUserId="18231" LastEditorUserId="9265" LastEditDate="2015-11-11T06:08:17.607" LastActivityDate="2015-11-11T09:31:22.967" Title="Smoothing factor of Exponential Moving Average" Tags="&lt;volatility&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21678" PostTypeId="2" ParentId="21666" CreationDate="2015-11-10T17:48:07.607" Score="2" Body="&lt;p&gt;You can consider old prices for Stocks B, C and D to be &quot;missing data&quot; and apply techniques used by Statisticians to deal with such missing data. One approach, the EM algorithm, suggests you estimate the covariance for the common period, use that covariance matrix and the available data to generate pseudo data for the back period for the third stock and re-estimate the covariance matrix using the combined real/faked data. With more than 3 stocks it would take multiple iterations of backfilling.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2015-11-10T18:04:23.397" LastActivityDate="2015-11-10T18:04:23.397" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21679" PostTypeId="1" CreationDate="2015-11-10T19:38:49.013" Score="1" ViewCount="187" Body="&lt;p&gt;In Bruno Remillard's text, &quot;Statistical Methods for Financial Engineering,&quot; he states the following on p 148 after giving the general form of a bond price $P(t,T)$ under Vasicek's model:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Note that $P(t,T)$ depends only on $r(t)$ and the parameters of the model; however, the spot rate $r(t)$ is not observable.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Firstly, isn't Vasicek a type of &lt;em&gt;short rate&lt;/em&gt; model, not the &lt;em&gt;spot rate&lt;/em&gt;?  If so, as I understand it the short rate is just the rate for short term borrowing.  In that case, why can't we use, say, 1-week LIBOR rates as the short rate?  Are those not observed?  &lt;a href=&quot;https://research.stlouisfed.org/fred2/series/USD1WKD156N&quot; rel=&quot;nofollow&quot;&gt;FRED&lt;/a&gt; actually offers a time series of such rates, so it seems that they are observable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've seen this mentioned elsewhere, too; that the short rate is not observable.  What exactly does this mean?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2015-11-10T19:38:49.013" Title="&quot;Spot rate is not observable&quot; meaning" Tags="&lt;interest-rates&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21681" PostTypeId="2" ParentId="21677" CreationDate="2015-11-11T01:45:11.967" Score="0" Body="&lt;p&gt;In the proprietary/branded Risk Metrics implementation of EWMA, I believe a smoothing factor of .97 is used. Here is a paper that discusses different smoothing factors for EWMA &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.tandfonline.com/doi/abs/10.1080/00036846.2014.982853?journalCode=raec20&quot; rel=&quot;nofollow&quot;&gt;http://www.tandfonline.com/doi/abs/10.1080/00036846.2014.982853?journalCode=raec20&lt;/a&gt;  &lt;/p&gt;&#xA;" OwnerUserId="9265" LastActivityDate="2015-11-11T01:45:11.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21682" PostTypeId="2" ParentId="15489" CreationDate="2015-11-11T01:49:03.057" Score="2" Body="&lt;p&gt;The value of an cash-or-nothing option is just the discounted expected payoff of the option. So the value of such a call should be $e^{-r (T - t)} N \mathbb{P} \left\{ S_T &amp;gt; K \right\}$, where $\mathbb{P} \left\{ S_T &amp;gt; K \right\} = \mathcal{N} \left( d_2 \right)$, and $N$ is the cash agreed to be paid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The asset-or-nothing is a bit more complicated since it is $e^{-r (T - t)} \mathbb{E} \left[ \left. S_T \right| S_T &amp;gt; K \right]$. The last term is the expected value of stock price given that $S_T &amp;gt; K$. So you would need to use the lognormal stock price and integrate it with pdf of standard normal and &quot;complete the square&quot;. You would end up with $e^{(r - q) (T - t)} S_0 \mathcal{N} \left( d_1 \right)$ for that, and the final formula would be $e^{-q (T - t)} S_0 \mathcal{N} \left( d_1 \right)$.&lt;/p&gt;&#xA;" OwnerUserId="17835" LastEditorUserId="24222" LastEditDate="2016-12-05T10:18:38.333" LastActivityDate="2016-12-05T10:18:38.333" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21683" PostTypeId="2" ParentId="21674" CreationDate="2015-11-11T02:02:32.663" Score="2" Body="&lt;p&gt;As suggested by @Bob Jansen:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;QA Direct - it is quite expensive though. I've used it in past in the form MS SQL database. It has good enough documentation and query like the one in the question are quite possible to implement in single SQL statement.&lt;/p&gt;&#xA;" OwnerUserId="5978" LastActivityDate="2015-11-11T02:02:32.663" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21684" PostTypeId="2" ParentId="19342" CreationDate="2015-11-11T02:07:56.247" Score="4" Body="&lt;p&gt;If $\log{(|R_t|)}$ is your first term, I'm not sure why this is a matrix. Modulus (determinant herein) applied to a matrix $R_t$ gives a scalar. If your implementation in python produces a matrix, that's likely because modulus is treated as an element-wise abs() function for each element of a matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It may be easier and faster to use &lt;code&gt;rugarch&lt;/code&gt; (univariate GARCH) and &lt;code&gt;rmgarch&lt;/code&gt; (multivariate GARCH) packages in R to fit DCC model parameters. You can access these from within Python. These packages allow an easy speed up with clustered processing. Alternatively, there is a &lt;code&gt;ccgarch&lt;/code&gt; package in R allowing DCC fitting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Calling R from Python is numerously discussed &lt;a href=&quot;https://stackoverflow.com/questions/11716923/python-interface-for-r-programming-language&quot;&gt;here&lt;/a&gt;, &lt;a href=&quot;https://stackoverflow.com/questions/14213517/how-to-call-ltm-function-using-rpy-package-in-python&quot;&gt;here&lt;/a&gt;, and in many other posts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://unstarched.net/r-examples/rmgarch/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Unstarched website&lt;/a&gt; has many helpful DCC GARCH examples.&lt;/p&gt;&#xA;" OwnerUserId="17137" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2015-11-11T02:07:56.247" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21685" PostTypeId="1" AcceptedAnswerId="21688" CreationDate="2015-11-11T04:09:43.143" Score="0" ViewCount="326" Body="&lt;p&gt;A lower coupon bond exhibits higher duration, which means higher price volatility with changing YTM. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A lower coupon bond also exhibits higher convexity. However, with higher convexity, bond prices rise more and fall less.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, a low coupon bond has higher duration and higher convexity, yet has higher and lower price volatility at the same time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is someone able to help with this contradiction? &lt;/p&gt;&#xA;" OwnerUserId="16532" LastActivityDate="2017-12-13T21:06:09.000" Title="Duration vs. Convexity Contradiction" Tags="&lt;fixed-income&gt;&lt;finance&gt;&lt;duration&gt;&lt;convexity&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21686" PostTypeId="1" AcceptedAnswerId="21687" CreationDate="2015-11-11T06:13:17.180" Score="2" ViewCount="275" Body="&lt;p&gt;I'm building a Monte Carlo option pricing model in Python/SciPy. I want to test the results produced by the Python code by building the model independently in Excel and then comparing the results. Off course the values won't match exactly, but what is close enough?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My idea is to calculate the standard error and then calculate the range on a 95% confidence level where the true mean lies for both implementation. If these two ranges overlap then it is close enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll also do enough simulations so that the standard error is less than 2% of the estimated mean.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively I can generate the random numbers in Python and feed that into Excel for a type of quasi Monte Carlo. Or I might be able to to give it the same seed (but I'm not sure if this will work).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is my approach described above sound or what other options are there?&lt;/p&gt;&#xA;" OwnerUserId="18065" LastActivityDate="2015-11-11T07:04:24.897" Title="Testing a Monte Carlo simulation independently" Tags="&lt;monte-carlo&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21687" PostTypeId="2" ParentId="21686" CreationDate="2015-11-11T06:58:23.323" Score="5" Body="&lt;p&gt;I wouldn't repeat the same algorithm on Excel, because if you make a mistake in your Python code, it's likely that you'll also make the same mistake in your Excel code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quants usually test an implementation with an analytical formula (not always possible). You should start off with something easy by pricing an European option with your MC algorithm. You should compare your MC price with Black-Scholes. Note that you don't have to code the formula yourself, google &quot;online black scholes calculator&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do some runs, plot the standard errors against N where N is the number of iterations. Make sure the standard errors from your MC drop by an inverse square root of N (central limit theorem).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Data visualisation is your friend. Plot the distribution of the spot price against time. Do they have a trend? You should see a trend unless your drift is zero. Now, change the drift to zero, do you see a normal distribution? Does the plot look symmetric? The key to model validation is a deep understanding of the underlying distribution and what would it look like if you change the parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also compare your MC with an MC implementation from somebody else. Generally, you should validate your results with an implementation that is done independently (i.e.: not you).&lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="601" LastEditDate="2015-11-11T07:04:24.897" LastActivityDate="2015-11-11T07:04:24.897" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21688" PostTypeId="2" ParentId="21685" CreationDate="2015-11-11T08:29:23.070" Score="5" Body="&lt;p&gt;The change of the price $P(y)$ if the yield changes from $y$ to $y+\Delta y$ is &#xA;$$&#xA;\frac{P(y+\Delta y) - P(y)}{P(y)} = - D \Delta y + \frac12 C \Delta y^2,&#xA;$$&#xA;where $D$ is the duration and $C$ is convexity.&#xA;For small $\Delta y$ the square is much smaller. Thus the duration component dominates.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-11-11T08:29:23.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21689" PostTypeId="2" ParentId="21608" CreationDate="2015-11-11T08:49:53.310" Score="7" Body="&lt;p&gt;What you need is more &lt;strong&gt;mutual information&lt;/strong&gt; rather than Shannon entropy. It is dedicated to capture the influence of one variable on another (you can think about it as a non linear version of Pearson correlations).&#xA;They are closely related since the mutual information $I$ between two variables $X$ and $Y$ reads:&#xA;$$I(X;Y) = H(X,Y) - H(X|Y) - H(Y|X)$$&#xA;where $H$ is entropy. You have to normalize it (divide by its maximum), see &lt;a href=&quot;https://en.wikipedia.org/wiki/Mutual_information&quot; rel=&quot;noreferrer&quot;&gt;wikipedia&lt;/a&gt; for more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But your question is about &lt;strong&gt;binning&lt;/strong&gt;. You have two solutions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;keep it discrete (you really want to bin and you think it is a good idea). Hence you need bins to be &lt;em&gt;statistically reliables&lt;/em&gt;: use a $\chi^2$ test (it is dedicated to capture the quality of discretization, see for instance &lt;a href=&quot;https://stats.stackexchange.com/questions/71871/impact-of-data-based-bin-boundaries-on-a-chi-square-goodness-of-fit-test&quot;&gt;this discussion on stats.stackexchange&lt;/a&gt;).&lt;/li&gt;&#xA;&lt;li&gt;you would like a continuous counterpart of all that: have a look at &lt;strong&gt;Kullback–Leibler divergence&lt;/strong&gt;, it is made for that.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Just have a look at the KL formula between two distributions:&#xA;$$D_{\mathrm{KL}}(P\|Q) = \int_{-\infty}^\infty p(x) \, \log\frac{p(x)}{q(x)} \, {\rm d}x $$&#xA;and compare to Shannon's entropy:&#xA;$$H_S(X) = -\sum_{i} {\mathrm{P}(x_i) \log_b \mathrm{P}(x_i)}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A last remarks: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;with entropy of discrete variables you have to face numerically bad situation with atoms of small mass (i.e. close to zero, since $\ln(0)$ is not that easy to obtain from a computer). For KL, you will have similar issues to solve when the (empirical) supports of the two distributions are not the same (have a look at the equation).&lt;/li&gt;&#xA;&lt;li&gt;there are papers about using such methods on financial time series, like &lt;a href=&quot;http://www.cs.cas.cz/mp/papers07/causality-IT-final.pdf&quot; rel=&quot;noreferrer&quot;&gt;Causality detection based on information-theoretic approaches in time series analysis&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="3163" LastEditDate="2017-12-01T08:28:39.463" LastActivityDate="2017-12-01T08:28:39.463" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21690" PostTypeId="2" ParentId="21677" CreationDate="2015-11-11T09:31:22.967" Score="1" Body="&lt;p&gt;The smoothing factor is a way to specify the &lt;strong&gt;memory&lt;/strong&gt; of your estimator. This view provides a simple and natural way to tune $a$. Say you want the $k$th term in the past to weight for 1% in your estimation. It gives you&#xA;$$\frac{\alpha^k}{ A} = \frac{1}{100},$$ with $A$ your normalizing factor (see @Gordon's remark).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course you can do better than that. For instance if you assume a model on $P(t)$ dynamics, plug it into the moving average and try to control the variance of the sliding estimator.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2015-11-11T09:31:22.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21692" PostTypeId="1" AcceptedAnswerId="21742" CreationDate="2015-11-11T11:07:14.373" Score="7" ViewCount="577" Body="&lt;p&gt;Fernholz and Karatzas have published various papers about so called stochastic portfolio theory. &#xA;Basically they say that the return to be expected from a portfolio on the long run is rather the growth rate&#xA;$$&#xA;\gamma = \mu - \frac12 \sigma^2&#xA;$$&#xA;than $\mu$, where $\mu$ is the drift coefficient of the price process $S_t$ which solves the following SDE:&#xA;$$&#xA;dS_t = \mu S_t dt + \sigma S_t dB_t.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One can argue with Ito's lemma, with the geometric mean of a lognormal random variable and similar - but what is the intuition behind this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As references see &lt;a href=&quot;https://17eb94422c7de298ec1b-8601c126654e9663374c173ae837a562.ssl.cf1.rackcdn.com/Documents/INTECH/White%20Papers/StochasticPortfolioTheoryandStockMarketEqualibrium.pdf&quot; rel=&quot;nofollow&quot;&gt;Stochastic Portfolio Theory and Stock Market Equilibrium&lt;/a&gt; by Fernholz and Shay for the first paper on this and &lt;a href=&quot;https://e4e43573badd25bed685-7a10e944c8faa70584d10c32e352d6fb.ssl.cf1.rackcdn.com/Market%20Perspectives/Does%20a%20Low%20Volatility%20Portfolio%20Need%20a%20Low%20Volatility%20Anomaly_DM_EAMexp0914.pdf&quot; rel=&quot;nofollow&quot;&gt;Does a Low Volatility Portfolio Need a “Low Volatility Anomaly?”&lt;/a&gt; by Meidan as a more recent reference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I am not mistaken then the above SDE would look like this&#xA;$$&#xA;dS_t = (\mu-\sigma^2/2) S_t dt + \sigma S_t  \circ dB_t&#xA;$$&#xA;in Stratonovich form and one sees the &quot;correct&quot; growth rate... which is another link. But what is the big picture of all this?&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-11-12T16:57:21.113" LastActivityDate="2015-11-30T13:01:33.483" Title="Intuitive explanation of stochastic portfolio theory" Tags="&lt;modern-portfolio-theory&gt;&lt;expected-return&gt;&lt;portfolio-theory&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21693" PostTypeId="1" AcceptedAnswerId="21700" CreationDate="2015-11-11T16:20:10.053" Score="1" ViewCount="330" Body="&lt;p&gt;I have to come up with a measure of diversification for trade (this can tie in closely to diversification as regards portfolios).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any well known measures of portfolio diversification?&lt;/p&gt;&#xA;" OwnerUserId="17782" LastEditorUserId="467" LastEditDate="2015-11-12T01:00:48.600" LastActivityDate="2020-11-10T23:25:48.650" Title="What can I use to measure of diversification?" Tags="&lt;portfolio-management&gt;&lt;portfolio-selection&gt;&lt;diversification&gt;" AnswerCount="5" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21694" PostTypeId="1" AcceptedAnswerId="21707" CreationDate="2015-11-11T16:27:36.990" Score="0" ViewCount="90" Body="&lt;p&gt;I have a very basic question about finance. I know that for an asset,&#xA;the price is inversly related to the yield to maturity, or the interest&#xA;rate. However, I have three ways of thinking about this relationship. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, think of a discount bond. The interest rate is given as:&#xA;$$&#xA;i=\frac{F-P}{P}&#xA;$$&#xA;Holding the face-value fixed, $\frac{\partial i}{\partial P}&amp;lt;0$ .&#xA;This is quite obvious- holding the face value fixed, the more you&#xA;have to pay now, the lesser interest you make off the bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second way I think about this is that if the interest rates rise,&#xA;then in equilibrium, prices of bonds will have to adjust downwards&#xA;because the opportunity cost of holding that specific bond increases&#xA;(\emph{i.e. }one can make more off other assets and as a result, the&#xA;bond in question will have to reduce in price to make it relatively&#xA;attractive). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The last way I think about this is that if interest rates rise, then&#xA;we discount future payments more. Think of a coupon bond:&#xA;$$&#xA;P=C+\frac{C}{1+i}+...+\frac{F}{(1+i)^{n}}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The maturity is at time period $n.$ Here, we discount payments more&#xA;because $i$ increases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, which one of these is the correct way to think about the relationship?&#xA;The first and third one are mathematical definitions. The second is&#xA;an intuitive one. Are these explanations even mutually exclusive?&lt;/p&gt;&#xA;" OwnerUserId="17782" LastActivityDate="2015-11-12T01:38:19.470" Title="Interest Rate and Price of Assets" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21696" PostTypeId="1" AcceptedAnswerId="21740" CreationDate="2015-11-11T17:55:30.470" Score="5" ViewCount="3816" Body="&lt;p&gt;I am self-studying for an actuarial exam on models for financial economics. I am having difficulty thinking about the put-call parity for currency options, specifically how use the notation. Here is the problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/legeR.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/legeR.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My book uses the notation $C(x_0, K, T)$ to mean a call option on currency with a spot exchange rate $x_0$ to purchase it at exchange rate $K$ at time $T$, and $P(x_0, K, T)$ the corresponding put option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please tell me if my interpretation is correct:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I interpreted (iv) to mean $P(1 £, 1.5\frac{\$}{£}, 0.5) = \$0.03.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I interpreted that the problem is asking us to find $C(1\$, \frac{1}{1.5} \frac{£}{\$}, 0.5)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that the first argument of those options do not appear to be rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This may not help, but by duality, $P(1 £, 1.5\frac{\$}{£}, 0.5) = C(1.5\frac{\$}{£}, 1 £, 0.5)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't see how to take what we're given, and convert to what the problem is asking us to find. &lt;/p&gt;&#xA;" OwnerUserId="5641" LastActivityDate="2016-02-20T04:21:36.480" Title="Difficulty understanding put-call parity for currency options" Tags="&lt;currency&gt;&lt;put-call-parity&gt;&lt;self-study&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21697" PostTypeId="2" ParentId="21696" CreationDate="2015-11-11T19:01:25.810" Score="0" Body="&lt;p&gt;In foreign exchange a contract can equally be seen as a put or a call, depending on the point of view: a call on dollars or a put on sterling. This is not Put-call-parity, which is not needed for this problem, it is just two names for the same thing. All you need to do is to invert the strike and convert the price to the other currency: 0.03 usd is 0.02 gbp.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-11-11T19:01:25.810" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21698" PostTypeId="2" ParentId="21693" CreationDate="2015-11-11T19:05:02.823" Score="0" Body="&lt;p&gt;The correlation between the assets in the portfolio will give you a measure of the diversification in the portfolio.&lt;/p&gt;&#xA;" OwnerUserId="18065" LastActivityDate="2015-11-11T19:05:02.823" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21700" PostTypeId="2" ParentId="21693" CreationDate="2015-11-11T20:08:27.053" Score="4" Body="&lt;p&gt;In 2006 Choueifaty proposed  a  measure  of  portfolio diversification,  called the Diversification  Ratio  (DR),  which  he  defined  as  the  ratio  of  the  weighted average of the volatilities of the assets in the portfolio, to the portfolios overall volatility. The DR of a long only portfolio is greater than or equal to one, and  equals  unity  for a  single  asset portfolio. In essence, the DR of a portfolio measures the diversification gained from holding assets that are not perfectly correlated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source: Choueifaty et al. : Properties of the most diversified portfolio, 2011 &lt;a href=&quot;http://www.qminitiative.org/UserFiles/files/FroidureSSRN-id1895459.pdf%20link&quot; rel=&quot;nofollow&quot;&gt;link&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More details in Choueifaty et al. Towards Maximum Diversification, JPM 2008 &lt;a href=&quot;http://www.tobam.fr/wp-content/uploads/2014/12/TOBAM-JoPM-Maximum-Div-2008.pdf&quot; rel=&quot;nofollow&quot;&gt;link&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2015-11-12T13:59:05.133" LastActivityDate="2015-11-12T13:59:05.133" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21701" PostTypeId="1" CreationDate="2015-11-11T20:55:23.713" Score="1" ViewCount="1094" Body="&lt;p&gt;Wondering how you would think about the following thought experiment - suppose you sell an OTM call option and plan to implement a delta hedging strategy whereby if the price of the stock were to increase and reach the strike, you hedge 100% by buying the shares at the strike price, and then subsequently if it were to come back down you take off the hedge - i.e. the hedge is always 100% or 0%. Assuming you could do this without any transaction costs, then you could just collect the premium from selling the option and guarantee you will be hedged at expiry. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There must be a flaw in this logic as it would imply a free collection of premium, so I am wondering where that flaw is and how it might relate to discrete vs. continuous time hedging. &lt;/p&gt;&#xA;" OwnerUserId="18246" LastActivityDate="2017-03-15T11:55:31.360" Title="delta hedging strategy for OTM option" Tags="&lt;options&gt;&lt;option-strategies&gt;&lt;delta-hedging&gt;" AnswerCount="5" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21702" PostTypeId="2" ParentId="21693" CreationDate="2015-11-11T21:15:32.100" Score="3" Body="&lt;p&gt;I use the 'implied correlation' defined as&#xA;$$&#xA;\rho = \frac{V^2_P-\sum V^2_j}{(\sum V_j)^2-\sum V^2_j}&#xA;$$&#xA;for $V_p$ the VaR (or volatility) of the portfolio, and $V_j$ the VaRs (or volatilities) of the individual components. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially it shows what would be the common correlation that I would need to use in order to aggregate the stand-alone risks to the risk of the portfolio.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2015-11-11T21:15:32.100" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21704" PostTypeId="2" ParentId="20687" CreationDate="2015-11-12T00:27:32.600" Score="1" Body="&lt;p&gt;Slight correction: the package in R is called &lt;code&gt;rmgarch&lt;/code&gt;, not &lt;code&gt;mgarch&lt;/code&gt;. It works well with &lt;code&gt;rugarch&lt;/code&gt;, which provides a variety of univariate GARCH models. Both packages allow for parallelized computation on local cluster and return a nice and full set of fitted parameters, model specs, etc. I provided some additional links in &lt;a href=&quot;https://quant.stackexchange.com/questions/19342/2-step-estimation-of-dcc-garch-model-in-python&quot;&gt;this&lt;/a&gt; post.&lt;/p&gt;&#xA;" OwnerUserId="17137" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2015-11-12T00:27:32.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21706" PostTypeId="2" ParentId="21701" CreationDate="2015-11-12T01:20:34.433" Score="-1" Body="&lt;p&gt;Delta hedging implies, loosely speaking, buying a proportion (delta) such that small movements in underlying have no net impact.&#xA;What you have done with 100% and 0% is, in effect, bought the shares to COVER your position, if the deal goes south.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's work this out with an example.&#xA;Say you have a stock trading at \$1 and you WRITE a call with strike \$10.&#xA;Let's be generous and get 50 cents premium on this call.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if the price of the stock hits \$10 (or more), we will buy the stock at \$10. At this point, assuming the stock is above \$10 and this is American, the BUYER of the call will exercise and you will give him the stocks.&#xA;NET: +\$0.50 - \$10 = -\$9.50&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if the share never hits \$10 (or is European and expires OTM) we make \$0.50.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;here, \$9.50 is your loss if the call is exercised and \$0.50 is your fee for the risk of your loss.&lt;/p&gt;&#xA;" OwnerUserId="13610" LastActivityDate="2015-11-12T01:20:34.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21707" PostTypeId="2" ParentId="21694" CreationDate="2015-11-12T01:38:19.470" Score="2" Body="&lt;p&gt;As @Alex C mentioned, they are all equivalent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, 1 and 3 are the exact same thing. (1 is missing an n - unless it's a one year bond).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2 is the intuitively the equivalent of putting a smaller amount of money today in the bank (whatever rf inst. guarantees the $i$ rate of interest) to have same payments as the bond in the future. Since this amount becomes lesser as the interest rate $i$ gets higher, the price of the equivalent bond goes low in the same measure. 1 and 3 are just saying this exact same thing in formulas.&lt;/p&gt;&#xA;" OwnerUserId="13610" LastActivityDate="2015-11-12T01:38:19.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21708" PostTypeId="2" ParentId="21696" CreationDate="2015-11-12T01:56:25.460" Score="1" Body="&lt;p&gt;A call lets to purchase one unit of underlying for some strike price x.&#xA;So a call on GBP in USD lets us buy 1 unit of GBP for price x. However, since this is FX, lets clarify this to be USD x and USD 1 gets us GBP 1/x.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A put lets you sell one unit of underlying for some strike price y (= 1/x).&#xA;So a put on USD in GBP lets us sell 1 unit of USD for price 1/x. Again, to be specifc, this is GBP 1/x. so, for x units of USD, we get 1 GBP&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both cases above are the same transaction (outflow USD for inflow GBP with options). Based on the base currency, we can view it as a call (USD base) or a put (GBP base). This is what @Alex C mentioned in his answer.&lt;/p&gt;&#xA;" OwnerUserId="13610" LastActivityDate="2015-11-12T01:56:25.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21714" PostTypeId="1" CreationDate="2015-11-12T12:35:37.403" Score="3" ViewCount="1552" Body="&lt;p&gt;I have the following function $V=V(S,t)$, $V^- = V(vS,t+\delta t)$, $V^+ = V(uS, t +\delta t)$. The book proceeds to explain that if we use Taylor series expansion on the above we will confirm that $\frac{\partial V}{\partial S} \sim \Delta$ by substituting the results into $\Delta = \frac{V^+ - V^-}{S(u-v)}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get the following results for the expansion:&#xA;$V^- = V^- (vS,t)+ \frac{\partial V^-}{\partial t} \delta t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V^+ = V^+ (uS,t)+\frac{\partial V^+}{\partial t} \delta t$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not sure how I proceed, subbing right now does not yield any sensible result. Not sure where we get partial derivative of $V$ with respect to $S$ either.. Is that from expanding $V(S,t)$, in that case, how do expand it. Basically, how do I arrive at the result that shows that partial derivative of $V$ with respect to $S$ is delta?&lt;/p&gt;&#xA;" OwnerUserId="18251" LastActivityDate="2016-07-09T19:42:06.897" Title="Delta of an option derived from the binomial model" Tags="&lt;option-pricing&gt;&lt;binomial&gt;&lt;delta&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21715" PostTypeId="2" ParentId="21693" CreationDate="2015-11-12T12:55:52.763" Score="1" Body="&lt;p&gt;Alex C's and Kiwiakos' answers are definitely the most realistic approaches.&#xA;If you are open to consider also other kinds of risk measures, further alternatives might be thought of. Variance / correlation based approaches interprete &quot;diversification&quot; as how much your assets are heterogeneous from the point of view of deviations from the historical mean.&#xA;In case that you want to protect your portfolio against events in the tail, you might erhaps be interested in approaches like &quot;co-downside risk&quot; etc.&#xA;The literature on risk measures is vast, many alternatives to covariance exist. The oint would be to apply the implicity trick from the implied correlation.&lt;/p&gt;&#xA;" OwnerUserId="18253" LastActivityDate="2015-11-12T12:55:52.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21716" PostTypeId="2" ParentId="21666" CreationDate="2015-11-12T13:03:06.520" Score="1" Body="&lt;p&gt;I agree on Richard. the simpler you choose, the better it is so as to get reliable estimates. What's your data frequency? purpose? For model construction as far as I am concerned, daily data from 2010 is enough. Otherwise, you could use a proxy asset for asset &lt;code&gt;D&lt;/code&gt; depending on its nature. To clarify, if &lt;code&gt;D&lt;/code&gt; is an &lt;code&gt;ETF&lt;/code&gt; let's say &lt;code&gt;CAC 40 ETF&lt;/code&gt;, concatenate its return series up to the last available data point with the return series of its underlying - here &lt;code&gt;CAC 40&lt;/code&gt; - since your starting date. Same process if &lt;code&gt;D&lt;/code&gt; is a derivatives. By, using this approach (&lt;strong&gt;concatenating return series&lt;/strong&gt;) always make sure that the asset and its underlying are strongly correlated. Hope it helps. Cheers.&lt;/p&gt;&#xA;" OwnerUserId="18252" LastActivityDate="2015-11-12T13:03:06.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21717" PostTypeId="1" CreationDate="2015-11-12T14:25:12.920" Score="3" ViewCount="826" Body="&lt;p&gt;Seeking input on hedging risk on USD to Euro with a 3rd component of payroll issued in Egyptian Pounds. We are a US corp invoicing a Germany entity in Euro with massive payroll being paid in Egyptian pounds for the next 2 years plus. Our profit is tied to the margins between Pay and Bill rates. USD will be transferred and then converted in Cairo to issue payroll. Client will pay us in Euro. We will invoice in Euro. Our bank will tie everything back to conversion of USD to Euro to USD upon payment of invoices net 30.&lt;/p&gt;&#xA;" OwnerUserId="18255" LastActivityDate="2019-08-25T01:00:29.700" Title="Currency risk USD&gt;EUR&gt;EGP" Tags="&lt;risk-management&gt;&lt;hedging&gt;&lt;value-at-risk&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21719" PostTypeId="2" ParentId="21714" CreationDate="2015-11-12T15:23:10.143" Score="1" Body="&lt;p&gt;This is not the Taylor expansion with respect to $t$, instead, it is the Taylor expansion with respect to $S$. Moreover, the prices at time $t+\delta t$ is used for approximation. That is,&#xA;\begin{align*}&#xA;\frac{\partial V}{\partial S}\big|_t &amp;amp;\approx \frac{V(uS, t) - V(vS, t)}{uS - vS}\\&#xA;&amp;amp;\approx \frac{V(uS, t+\delta t) - V(vS, t+\delta t)}{S(u-v)}\\&#xA;&amp;amp;= \frac{V^+-V^-}{S(u-v)}.&#xA;\end{align*}&#xA;The reason is that, at time $t=0$, there is only a single price available, and, to compute the delta and gamma respective hedge ratios, other trees are needed. For computational efficiency, we use the prices at time $0+\delta t$, where multiple prices are available.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-11-12T15:37:53.920" LastActivityDate="2015-11-12T15:37:53.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21720" PostTypeId="1" CreationDate="2015-11-12T15:56:54.333" Score="1" ViewCount="25" Body="&lt;p&gt;In a recent discussion about the implementation of the calculation of derivative sensitivities, the notion 'scalar' and 'vectorial sensitivities' were used. I am not familiar with this notion and could not find any information about it. Apparently, 'Theta' is a scalar one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone shed some light on it?&lt;/p&gt;&#xA;" OwnerUserId="18258" LastActivityDate="2015-11-12T15:56:54.333" Title="Scalar and vectorial sensitivities" Tags="&lt;sensitivities&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21721" PostTypeId="2" ParentId="21665" CreationDate="2015-11-12T16:34:05.233" Score="1" Body="&lt;p&gt;What is wrong with your broker watching your risk for you? I assume the &quot;modest trading house&quot; has portfolio margin in which case you already have limit up/down calculations done for you implicitly. So the output from your broker is your margin equity and you can make that your metric. Implementing a simple rule like - not to exceed 70% of total margin equity. Unfortunately with options it is difficult to spread margin risk equally among the positions. Your short trades will consume a disproportinal amount.&lt;/p&gt;&#xA;" OwnerUserId="7973" LastActivityDate="2015-11-12T16:34:05.233" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21722" PostTypeId="2" ParentId="21692" CreationDate="2015-11-12T16:59:15.403" Score="4" Body="&lt;p&gt;Trying to shed some light here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What we also see using &lt;a href=&quot;https://en.wikipedia.org/wiki/Log-normal_distribution&quot; rel=&quot;nofollow&quot;&gt;this here&lt;/a&gt;, is that if returns are log-normally distributed, ie.&#xA;$$&#xA;1 + r = \exp(\mu + \sigma Z),&#xA;$$&#xA;with $Z$ standard-normal, then &#xA;$$&#xA;E[1+r] = \exp(\mu + \frac 12 \sigma^2)&#xA;$$&#xA;holds. But the geometric mean $GM$ is given by  $\exp(\mu)$ and&#xA;we&#xA;have&#xA;$$&#xA;\log(GM) = \mu = \log(E[1+r]) - \sigma^2&#xA;/2&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the average annual return $aan$ over $n$ years&#xA;$$&#xA; 1 + aan = (\prod_{i=1}^n (1+r_i))^{1/n}&#xA;$$&#xA;is just the same as the geometric mean. Finally after $n$ years we have&#xA;$$&#xA;\prod_{i=1}^n (1+r_i) = (1 + aan)^n&#xA;$$&#xA;we should care about the geometric mean most.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One more observation:&#xA;One cans show that for $x$ close to zero it holds that&#xA;$$&#xA;\log(1+x) \approx x - \frac{x^2}{2}.&#xA;$$&#xA;Then taking the expecation we get&#xA;$$&#xA;E\log(1+x) \approx \mu - \frac{\sigma^2}{2}.&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-11-30T13:01:33.483" LastActivityDate="2015-11-30T13:01:33.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21723" PostTypeId="1" CreationDate="2015-11-12T18:15:23.747" Score="2" ViewCount="114" Body="&lt;p&gt;Suppose I have a stochastic process i.e. a Vasicek process with parameteres estimated with monthly (RW measure) data and want simulate the process using a daily timestep. Is this a good practice? &lt;/p&gt;&#xA;" OwnerUserId="17254" LastActivityDate="2016-01-12T10:54:43.383" Title="simulation and timestep" Tags="&lt;simulations&gt;&lt;vasicek&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21726" PostTypeId="2" ParentId="21717" CreationDate="2015-11-12T23:54:41.413" Score="2" Body="&lt;p&gt;If I were in your place I would always keep my funds in USD till the last moments, USD tends to be overvaluated in Egypt and since Egyptian economy is constantly deteriorating specially after the recent events regarding the russian plane crash and the mexican toursit shooting which could kill the tourism industry and its supporting ecosystem industries like real estate, catering and transportation this will eventually lead to the EGP having very bad exchange rates against USD and with the recent payments of Swiss canal bonds and their high rf rates this will also lead to the inflation of EGP. In short hedge on EGP it's not expected to rise any soon even by a miracle.&lt;/p&gt;&#xA;" OwnerUserId="18263" LastActivityDate="2015-11-12T23:54:41.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21727" PostTypeId="1" CreationDate="2015-11-13T07:00:15.787" Score="2" ViewCount="252" Body="&lt;p&gt;I am comparing the efficient frontier of a set of portfolios that are in and out of sample. The first period is from 1991-01-03 until  1992-10-03&#xA;and the second one from 1992-10-03 until 1994-03-03. I used historical data from yahoo finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used the empirical covariance matrix from the first period and constructed my in sample efficient frontier. And used the same weights but the parameters from the second period to get the out of sample efficient frontier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may find my R code here:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;require(zoo)&#xA;require(quantmod)&#xA;require(tseries)&#xA;&#xA;load(&quot;~/Desktop/SE q/2periods.RData&quot;)&#xA;&#xA;&#xA;cov.mat1 &amp;lt;- cov(logret1)&#xA;mu2 &amp;lt;- colMeans(logret2)&#xA;cov.mat2 &amp;lt;- cov(logret2)&#xA;&#xA;## efficient frontier of portfolios in sample&#xA;pf1s &amp;lt;- list()&#xA;t &amp;lt;-  seq(0,.25,length.out = 20)&#xA;for ( i in 1:20){&#xA;        pf1s&amp;lt;- c(pf1s,list(portfolio.optim(x=logret1,pm=t[i],covmat = cov.mat1)))&#xA;}&#xA;&#xA;## get frontiers&#xA;pf1&amp;lt;-NULL&#xA;for( i in 1:20){&#xA;        temp &amp;lt;- pf1s[[i]]&#xA;        pf1 &amp;lt;-rbind(pf1,c(temp$pw,temp$pm,temp$ps))&#xA;}&#xA;&#xA;&#xA;pf1.weights &amp;lt;- pf1[,1:ncol(logret1)]&#xA;pf1.ret &amp;lt;- pf1[,ncol(logret1)+1]&#xA;pf1.risk&amp;lt;- pf1[,ncol(logret1)+2]&#xA;&#xA;## efficient frontier of portfolios out of sample&#xA;&#xA;pf2 &amp;lt;- NULL&#xA;for( i in 1:20){&#xA;        pf2 &amp;lt;- rbind(pf2,c( pf1.weights[i,]%*%mu2,sqrt(t(pf1.weights[i,])%*%cov.mat2%*%(pf1.weights[i,]))))&#xA;}&#xA;pf2.ret &amp;lt;- pf2[,1]&#xA;pf2.risk&amp;lt;- pf2[,2]&#xA;&#xA;# plot efficient frontiers&#xA;plot(pf1.risk,pf1.ret,type=&quot;l&quot;,col=&quot;red&quot;)&#xA;lines(pf2.risk,pf2.ret,type=&quot;l&quot;,col=&quot;blue&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Ns8JW.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Ns8JW.png&quot; alt=&quot;red : in sample. blue: out of sample&quot;&gt;&lt;/a&gt;&#xA;Red is in sample and blue out of sample.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a R.data file with my data set&#xA;&lt;a href=&quot;https://www.dropbox.com/s/d1pdwvwh4c5r893/2periods.RData?dl=0&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.dropbox.com/s/d1pdwvwh4c5r893/2periods.RData?dl=0&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is if there is an explanation on the strange behaviour of the out of sample portfolio?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best,&#xA;J.&lt;/p&gt;&#xA;" OwnerUserId="15767" LastActivityDate="2015-11-13T07:00:15.787" Title="Behaviour of out of sample efficient frontier" Tags="&lt;r&gt;&lt;portfolio&gt;&lt;markowitz&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21729" PostTypeId="2" ParentId="21723" CreationDate="2015-11-13T09:50:32.733" Score="1" Body="&lt;p&gt;By estimating the model parameters using monthly data, you will get monthly estimates. Thus, you will need to multiply them by $12$ (or by $\sqrt{12}$ for the volatility) in order to get annual estimates. Once you have done this, you can simulate the model using the timestep $\Delta t=\frac{1}{252}$.&lt;/p&gt;&#xA;" OwnerUserId="12214" LastActivityDate="2015-11-13T09:50:32.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21733" PostTypeId="1" CreationDate="2015-11-13T15:04:23.650" Score="3" ViewCount="93" Body="&lt;p&gt;We use full valuation of derivatives portfolios using scenarios from historical data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For simple contracts, this is relatively fast.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For contracts requiring monte carlo simulation, this becomes painfully slow for large portfolios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am thinking about ways of improving the current situation. Most likely, in my mind, this would involve a full valuation done over night, resulting in PnL vectors per contract and possibly other results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;During intraday, as market data changes, these &quot;base PnLs&quot; could probably be used along with any other previously calculated result to get a decent approximation without having to perform a full valuation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for some existing work making these ideas concrete (or possibly suggesting a different approach entirely...).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A basic idea would be to compute sensitivities alongside the full valuation. In this way, the PnLs will be accompanied by, say, delta and gamma sensitivities, and these could be used in combination with the new market data to get an updated PnL vector.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is if this is feasible or indeed if it's any better than simply using a delta-gamma approximation to begin with?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another idea could be to rely on sensitivities implicitly by simply valuing the contract under a discrete set of price points with the current price in the middle, say [-3%, -2%, -1%, -0.5%, 0, ...], and performing interpolation for finding a fair value intraday.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any feedback is welcome.&lt;/p&gt;&#xA;" OwnerUserId="5888" LastActivityDate="2015-11-13T15:04:23.650" Title="Intraday Value at Risk approximations" Tags="&lt;monte-carlo&gt;&lt;value-at-risk&gt;&lt;delta&gt;&lt;gamma&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21734" PostTypeId="1" CreationDate="2015-11-13T17:21:03.460" Score="1" ViewCount="2412" Body="&lt;p&gt;Consider a European call and put with values $C_t$ and $P_t$, respectively, under the Black-Scholes model.  By put-call parity,&#xA;$$&#xA;C_t - P_t = S_t - Ke^{-r(T-t)}&#xA;$$&#xA;for expiration time $T$.  Note if $K = S_te^{r(T-t)}$ we get&#xA;$$&#xA;C_t = P_t. \qquad (1)&#xA;$$&#xA;Of course, $S_te^{r(T-t)}$ is the time $T$-forward price of the stock at time $t$, which is arrived at from a &lt;em&gt;no arbitrage argument&lt;/em&gt; and not just taking expectations.  That is,&#xA;$$&#xA;S_te^{r(T-t)} \neq E_P(S_T \mid S_t) = S_te^{\mu(T-t)},&#xA;$$&#xA;where $P$ is the physical measure and $\mu$ the drift rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see that (1) holds simply by put-call parity, but I'm seeking a deeper understanding.  Is it that, the call and put prices are equal because, &lt;em&gt;under the risk-neutral measure&lt;/em&gt; $Q$, the expected value of the stock is the strike price (which is the forward price in this case)?  That is,&#xA;$$&#xA;S_te^{r(T-t)} = E_Q(S_T \mid S_t) = K,&#xA;$$&#xA;and hence the stock is equally likely to finish above or below the strike?  Or, is there something deeper going on, like a no arbitrage argument?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2019-04-22T13:10:20.230" Title="Call and Put Prices Equal at Forward Price - Why?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21735" PostTypeId="2" ParentId="21734" CreationDate="2015-11-13T18:45:51.397" Score="4" Body="&lt;p&gt;Certainly, you must agree that&#xA;$$&#xA;C_{T}-P_{T}=\left(S_{T}-K\right)^{+}-\left(K-S_{T}\right)^{+}=S_{T}-K.&#xA;$$&#xA;Therefore, since&#xA;$$&#xA;C_{t}=e^{-r\left(T-t\right)}E_{Q}\left[C_{T}\right]\text{ and }P_{t}=e^{-r\left(T-t\right)}E_{Q}\left[P_{T}\right]&#xA;$$&#xA;it follows by the linearity of $E$ that &#xA;$$&#xA;C_{t}-P_{t}=e^{-r\left(T-t\right)}E_{Q}\left[C_{T}-P_{T}\mid \mathcal{F}_{t}\right]=e^{-r\left(T-t\right)}E_{Q}\left[S_{T}-K\mid \mathcal{F}_{t}\right]=e^{-r\left(T-t\right)}\left(e^{r(T-t)}S_{t}-K\right).&#xA;$$&#xA;The put-call parity follows.&lt;/p&gt;&#xA;" OwnerUserId="18272" LastActivityDate="2015-11-13T18:45:51.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21736" PostTypeId="1" CreationDate="2015-11-13T18:52:46.197" Score="3" ViewCount="84" Body="&lt;p&gt;I wondered what the motivation for professional investors could be to trade in VIX ETNs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why would they even think about trading this kind of product? (They normally should have access to VIX options, futures or variance swaps.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And if they do, has anyone a reasonable explanation? (Besides tight spreads, etc...)&lt;/p&gt;&#xA;" OwnerUserId="18271" LastEditorUserId="8164" LastEditDate="2020-03-08T13:48:22.080" LastActivityDate="2020-03-08T13:48:22.080" Title="Motivation for hedging volatility using VIX ETNs" Tags="&lt;volatility&gt;&lt;hedging&gt;&lt;vix&gt;&lt;etf&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="21737" PostTypeId="1" CreationDate="2015-11-13T19:16:06.643" Score="7" ViewCount="665" Body="&lt;p&gt;My advance apologies, if this question is too naive or basic. Please be patient with my first experiences with SE; ask for clarification, if needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recognize there are many (often-criticized) flavors in the univariate (and multivariate) GARCH methods. Univariate GARCH varies from standard GARCH to GJR, AP-GARCH, etc. Multivariate world offers natural generalization (hundreds of parameters to estimate) to GO-GARCH, DCC-GARCH, and alike simplifications.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet, I want to know what the industry actually uses for bond, stock, and derivative analysis. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It'd be great to see concrete references, personal employment experiences, and practical work examples that I can follow, instead of opinions and speculations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE: I still monitor this post for answers...&lt;/p&gt;&#xA;" OwnerUserId="17137" LastEditorUserId="17137" LastEditDate="2015-11-30T15:50:01.597" LastActivityDate="2015-12-01T15:37:35.330" Title="What is the preferred GARCH method in practice?" Tags="&lt;correlation&gt;&lt;garch&gt;&lt;covariance&gt;&lt;estimation&gt;&lt;multivariate&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21738" PostTypeId="2" ParentId="21737" CreationDate="2015-11-13T19:26:26.380" Score="7" Body="&lt;p&gt;I personally use the simple Garch(1,1) for volatility filtering in the risk management area. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact in most cases I don't even estimate the parameters, I stick 0.94 for mean reversion, 0.04 for the squared error and I get the constant by matching the series variance. My experience is that there is no point pretending to finetune parameters when vol is unobserved anyway. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To add some more color here are some actual examples, without going into details as these are proprietary models:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Calculate risk for a portfolio under historical simulation. Used for regulatory and economic capital calculations. Fix portfolio positions, calculate P&amp;amp;L based on one-day shocks over the last couple of years, then use Garch to forecast tomorrow's VaR. I have used parametric (Gaussian/ StudentT) and empirical versions, using fixed parameters as above. Although is outperforms other methods, it does not go down well with business as it gives VaR which is too volatile for limit setting etc.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Produce vol time series when none can be sourced. Say that you want to build a historical time series for implied vols. I have used Garch, among other techniques, to do that. As Garch filters 'true vol' these have to be converted to 'implied vol'. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Produce long term simulations (say 10 or 20 years) of volatilities for IMM/ counterparty risk calculations. As volatilities are globally integrated, we do not want them to move out of sync as horizons increase. Therefore used multivariate versions where one vol (say US) enters the propagation mechanisms of others (say UK, Germany, etc). &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Derivative pricing: I have never used Garch for option pricing outside academic work, and would never do so. I don't know of anyone that does neither. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Hope that this helps&lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2015-11-15T18:14:04.803" LastActivityDate="2015-11-15T18:14:04.803" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21739" PostTypeId="1" CreationDate="2015-11-13T20:05:36.920" Score="1" ViewCount="620" Body="&lt;p&gt;I cannot understand how the &lt;a href=&quot;https://en.wikipedia.org/wiki/Triangular_arbitrage&quot; rel=&quot;nofollow&quot;&gt;triangular arbitrage&lt;/a&gt; fits with CFD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming there is an arbitrage opportunity: EUR/USD &amp;lt; USD/GBP * GBP/EUR&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I do this strategy:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;1 Long on EUR/USD at Ask price&lt;/li&gt;&#xA;&lt;li&gt;1 Long on USD/GBP at Ask price&lt;/li&gt;&#xA;&lt;li&gt;1 Long on GBP/EUR at Ask price&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I get a &gt; 0 profit, but I have still 3 positions open. If I close all these three positions i get the amount converted in my Currency-based trading account (Eur).&#xA;How should I adapt the &quot;triangular arbitrage&quot; with CFD when I have to Open and Close Position? &lt;/p&gt;&#xA;" OwnerUserId="7827" LastEditorUserId="7827" LastEditDate="2015-11-14T13:44:12.323" LastActivityDate="2015-11-14T13:44:12.323" Title="Triangular Arbitrage with CFD" Tags="&lt;fx&gt;&lt;arbitrage&gt;&lt;cfd&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21740" PostTypeId="2" ParentId="21696" CreationDate="2015-11-13T20:47:08.607" Score="2" Body="&lt;p&gt;Let $\{X_t \mid t \ge 0\}$ be the foreign exchange rate rate from $£$ to $\$$. Moreover, let $C(X_0, K, T)$ and $P(X_0, K, T)$ be the prices of the respective call and put options with strike $K$ and maturity $T$. Then&#xA;\begin{align*}&#xA;\frac{1}{X_0}P(X_0,\, K,\, T) = K C\left(\frac{1}{X_0},\, \frac{1}{K},\, T \right).&#xA;\end{align*}&#xA;Based on the given condition, &#xA;\begin{align*}&#xA;P\left(1.5 \$/£, \, 1.5 \$/£,\, 0.5 \right) = 0.03.&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;C\left(\frac{1}{1.5} £/\$, \, \frac{1}{1.5} £/\$,\, 0.5 \right) &amp;amp;= \frac{1}{1.5\times 1.5}\times P\left(1.5 \$/£, \, 1.5 \$/£,\, 0.5 \right)\\&#xA;&amp;amp;\approx 0.01333.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ $$&#xA;The above duality formula can be derived as follows. Note that, for the put option payoff at maturity $T$,&#xA;\begin{align*}&#xA;(K-X_T)^+ = KX_T\left(\frac{1}{X_T} - \frac{1}{K} \right)^+.&#xA;\end{align*}&#xA;Let $P_d$ and $P_f$ denote, respectively, the USD and GBP risk-neutral measures. Moreover, let $E_d$ and $E_f$ denote the expectation operators corresponding to $P_d$ and $P_f$. Note that,&#xA;\begin{align*}&#xA;\frac{dP_d}{dP_f}\big|_T=\frac{X_0 e^{r_d T}}{X_T e^{r_f T}},&#xA;\end{align*}&#xA;where $r_d$ and $r_f$ are the respective USD and GBP interest rates.&#xA;Then,&#xA;\begin{align*}&#xA;P(X_0, K, T) &amp;amp;= E_d\left(\frac{1}{e^{r_d T}} (K-X_T)^+\right)\\&#xA;&amp;amp;=E_d\left(\frac{KX_T}{e^{r_d T}} \left(\frac{1}{X_T} - \frac{1}{K} \right)^+\right)\\&#xA;&amp;amp;= E_f\left(\frac{dP_d}{dP_f}\big|_T\frac{KX_T}{e^{r_d T}} \left(\frac{1}{X_T} - \frac{1}{K} \right)^+\right)\\&#xA;&amp;amp;= X_0 K E_f\left(\frac{1}{e^{r_f T}} \left(\frac{1}{X_T} - \frac{1}{K} \right)^+\right)\\&#xA;&amp;amp;= X_0 K C\left(\frac{1}{X_0},\, \frac{1}{K},\, T \right).&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;\frac{1}{X_0}P(X_0,\, K,\, T) = K C\left(\frac{1}{X_0},\, \frac{1}{K},\, T \right).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-11-13T21:24:45.100" LastActivityDate="2015-11-13T21:24:45.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21741" PostTypeId="2" ParentId="21701" CreationDate="2015-11-13T20:56:38.070" Score="2" Body="&lt;p&gt;suppose you sell a K = 105 call. When the stock reaches exacty 105 you buy 1 stock at 105. Now suppose the stock moves to 104.99, using your logic you sell 1 share at 104. You lost $0.01.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Again, after a while stock reaches 105 you buy 1 stock. After some time it goes up, but eventually it goes down again below 105. Thus you sell 1 share below 105. Again realizing a loss.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;rinse repeat. You bought high and sold low. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2015-11-13T20:56:38.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21742" PostTypeId="2" ParentId="21692" CreationDate="2015-11-13T21:39:51.887" Score="3" Body="&lt;p&gt;This will depend on the definition of &quot;return on the long run&quot;. If we define the annualized return on the long run by $\frac{1}{T}\ln \frac{S_T}{S_0}$ for a certain time $T$ in the future, then&#xA;\begin{align*}&#xA;E\left( \frac{1}{T}\ln \frac{S_T}{S_0} \right) = \mu-\frac{1}{2}\sigma^2,&#xA;\end{align*}&#xA;as claimed. Note that $\mu$ is the instant, or instantaneous, return.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-11-13T21:39:51.887" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21744" PostTypeId="1" CreationDate="2015-11-13T23:06:21.153" Score="1" ViewCount="1888" Body="&lt;p&gt;I noted that implied volatility (IV field) from &lt;a href=&quot;http://pandas.pydata.org/pandas-docs/stable/remote_data.html#yahoo-finance-options&quot; rel=&quot;nofollow noreferrer&quot;&gt;pandas.Options&lt;/a&gt; class is very different (especially, for out of money options) than what I compute with Black-Scholes model. (risk free rate is pulled from FRED and matches the time to expiry on the option).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone describe or provide references on how &lt;code&gt;pandas.Options()&lt;/code&gt; computes its IV? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;An example&lt;/strong&gt;. as of 11/13/15: MSFT's close is 52.84, call's close 5.80, expiry 12/04/2015 (0.0575 year), K=48.5, r=0.0001 (rate). pandas IV = 0.3569, my BS-implied IV=0.6712. Difference is 0.3143 (mine is greater).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Another example&lt;/strong&gt;. &#xA;Without getting into code (unless someone asks for it), here is a visual for the context background. This is for educational purpose, not live trading.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Left-most image is my BS-implied IV. &lt;/li&gt;&#xA;&lt;li&gt;Center image is IV from &lt;code&gt;pandas.Options()&lt;/code&gt; &lt;/li&gt;&#xA;&lt;li&gt;Right-most image is the difference between the two.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;My calculations match pandas, but only for in the money and at the money, not out of money, where my IV values are very high (while pandas are nearly zero).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below are These are computed for MSFT call options using 10/28/15 Yahoo data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please let me know, if further clarification is needed. Thanks in advance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/qTaZm.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/qTaZm.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17137" LastEditorUserId="17137" LastEditDate="2015-11-14T15:11:20.473" LastActivityDate="2017-03-20T21:18:17.970" Title="Formula behind pandas.Options() implied volatility" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;implied-volatility&gt;&lt;python&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="21745" PostTypeId="1" CreationDate="2015-11-14T01:40:15.673" Score="1" ViewCount="2488" Body="&lt;p&gt;An increase in default correlation ceteris paribus increases the value of the equity tranche of a CDO. This I get.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How then, do I make sense of the statement that as default correlation in the underlying credits increases, the spread &lt;strong&gt;&lt;em&gt;decreases&lt;/em&gt;&lt;/strong&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Isn't the value of the tranche the spread it earns over LIBOR when there is enough funds to pass to the equity tranche?&lt;/p&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="9265" LastEditDate="2015-11-14T15:01:48.163" LastActivityDate="2015-11-16T00:23:35.840" Title="CDO tranche spread" Tags="&lt;spread&gt;&lt;cdo&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21746" PostTypeId="2" ParentId="21745" CreationDate="2015-11-14T11:43:39.823" Score="1" Body="&lt;p&gt;for synthetic cdo you could have a look at this paper -  &lt;a href=&quot;http://home.gwu.edu/~sagca/JAI.pdf&quot; rel=&quot;nofollow&quot;&gt;http://home.gwu.edu/~sagca/JAI.pdf&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;as for equity tranche, i understand that it receives residual cashflow i.e. remainings after paying all senior tranches.&lt;/p&gt;&#xA;" OwnerUserId="18275" LastEditorUserId="18275" LastEditDate="2015-11-15T10:54:50.800" LastActivityDate="2015-11-15T10:54:50.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21747" PostTypeId="1" CreationDate="2015-11-14T12:35:32.983" Score="0" ViewCount="333" Body="&lt;p&gt;Hi guys i really hope you can help as i've been pulling out my hair for days on this!!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OK so basically i understand the dollar neutral ratio, simply stocka/stockb = dollar neutral ratio. Works great because i can chart it and do a daily p/l update and it perfectly tracks the p/l of my whole long short position. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions is how do i get the ratio when the spread is weighted differently due to differing beta values? For example stocka is very volatile and stockb is not. So i will for arguments sake weight 80% of my capital on stocka and 20% of my capital on stock. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now to get my ratio i can not simply divide the stocka by stockb as i did before because i get the same daily p/l swings. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So guys how do i get a beta hedged ratio which i can chart and also track a daily p/l which perfectly represents my whole long short position. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Appreciate all your time and energy, thank you!&lt;/p&gt;&#xA;" OwnerUserId="18276" LastActivityDate="2016-10-13T19:49:39.727" Title="dollar neutral ratio vs beta hedged ratio" Tags="&lt;beta&gt;&lt;ratio&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21749" PostTypeId="1" CreationDate="2015-11-14T18:16:17.907" Score="1" ViewCount="932" Body="&lt;p&gt;I think there is an error in the &lt;a href=&quot;http://ca.wiley.com/WileyCDA/WileyTitle/productCd-111879690X.html&quot; rel=&quot;nofollow&quot;&gt;Meissner text&lt;/a&gt; - Correlation Risk Modeling and Management and can't find an errata for this text to verify. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On page 19 the foot note reads:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ol start=&quot;10&quot;&gt;&#xA;  &lt;li&gt;Shorting the equity tranche means being short credit protection or selling credit protection, which means receiving the (high) equity&#xA;  tranche contract spread&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In the context, he is talking about CDOs, which makes me think this is incorrect. In a CDO, doesn't being &lt;strong&gt;&lt;em&gt;short&lt;/em&gt;&lt;/strong&gt; a tranche &lt;strong&gt;&lt;em&gt;buy credit protection&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;investing&lt;/em&gt;&lt;/strong&gt; in the tranche (long) is to &lt;strong&gt;&lt;em&gt;sell credit protection&lt;/em&gt;&lt;/strong&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you invest in one of the tranches of a CDO, you are exposed to credit risk which is why you are compensated by a spread right ? &lt;/p&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="9265" LastEditDate="2015-11-14T18:21:59.423" LastActivityDate="2015-12-15T10:21:45.280" Title="CDO selling or buying credit protection?" Tags="&lt;credit-risk&gt;&lt;cdo&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21750" PostTypeId="1" CreationDate="2015-11-14T18:51:19.480" Score="0" ViewCount="5410" Body="&lt;p&gt;Yahoo offers an API to download historical intraday data, but I am unable to understand the timestamps on the data. The URL request is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Format : http://chartapi.finance.yahoo.com/instrument/1.0/[TICKER]/chartdata;type=quote;range=[days]d/csv&#xA;&#xA;Example: http://chartapi.finance.yahoo.com/instrument/1.0/GOOG/chartdata;type=quote;range=1d/csv&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which returns data like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;uri:/instrument/1.0/GOOG/chartdata;type=quote;range=1d/csv&#xA;ticker:goog&#xA;Company-Name:Alphabet Inc.&#xA;Exchange-Name:NMS&#xA;unit:MIN&#xA;timezone:EST&#xA;currency:USD&#xA;gmtoffset:-18000&#xA;previous_close:731.2300&#xA;Timestamp:1447425000,1447448400&#xA;labels:1447426800,1447430400,1447434000,1447437600,1447441200,1447444800,1447448400&#xA;values:Timestamp,close,high,low,open,volume&#xA;close:717.0000,730.7000&#xA;high:717.0000,731.1500&#xA;low:716.7300,729.7850&#xA;open:717.0000,731.0000&#xA;volume:0,104700&#xA;1447425030,727.2000,728.8550,727.2000,728.7500,48300&#xA;1447425096,727.8440,728.2200,727.8440,727.8850,0&#xA;1447425120,728.7300,729.0000,727.2900,728.4800,25100&#xA;1447425183,729.3100,729.8900,728.1550,729.2465,20000&#xA;1447425247,729.4500,731.1500,729.4500,730.4893,8900&#xA;1447425301,729.4500,730.4000,729.0600,729.3200,4500&#xA;1447425418,730.4250,730.7000,729.0200,730.0500,5100&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The data it in each row is in the form: Timestamp, close, high, low, open, volume.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The timestamp appears to be a Unix timestamp (seconds since 1970). That is confirmed by this web post: &lt;a href=&quot;https://www.daniweb.com/programming/software-development/threads/260694/how-to-process-timestamp-in-chartapi-finance-yahoo-com&quot; rel=&quot;nofollow&quot;&gt;https://www.daniweb.com/programming/software-development/threads/260694/how-to-process-timestamp-in-chartapi-finance-yahoo-com&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is on the values I get when converting from Unix timestamps, they look very close to timestamps I would expect, every one minute, but are off by random amounts.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;2015-11-13 09:30:58&#xA;2015-11-13 09:31:15&#xA;2015-11-13 09:32:06&#xA;2015-11-13 09:33:00&#xA;2015-11-13 09:34:03&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My question is if anyone else has been successful in figuring how to properly convert the timestamps to the correct values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-----------Update based on R code suggestion-------------------&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried the R code below and got similar results of timestamps on odd non-even minutes. Here is the output using this getYahoo.intraday() function and GOOG ticker:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; p &amp;lt;- getYahoo.intraday('goog','1')&#xA;&amp;gt; head(p)&#xA;                       Open    High      Low   Close Volume&#xA;2015-11-13 09:31:02 728.410 728.420 727.1601 727.830  18300&#xA;2015-11-13 09:32:06 728.960 729.000 727.2900 728.450  11200&#xA;2015-11-13 09:33:00 729.240 729.890 728.1550 728.460  15300&#xA;2015-11-13 09:34:03 729.450 730.820 729.4500 729.846  15300&#xA;2015-11-13 09:35:14 729.450 729.588 729.0600 729.070   3900&#xA;2015-11-13 09:36:58 730.425 730.700 729.0200 730.050   5100&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="18278" LastEditorUserId="18278" LastEditDate="2015-11-16T01:07:09.603" LastActivityDate="2015-11-16T01:07:09.603" Title="Yahoo intraday historical download Timestamp" Tags="&lt;data-source&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21752" PostTypeId="2" ParentId="21750" CreationDate="2015-11-14T23:08:47.063" Score="1" Body="&lt;p&gt;Your answers seem to be slightly off. Here is a previous thread that answers your question;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/3682748/converting-unix-timestamp-string-to-readable-date-in-python&quot;&gt;https://stackoverflow.com/questions/3682748/converting-unix-timestamp-string-to-readable-date-in-python&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, you can cross verify using this tool; &lt;a href=&quot;http://www.epochconverter.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.epochconverter.com/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18280" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2015-11-14T23:08:47.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21753" PostTypeId="1" AcceptedAnswerId="21756" CreationDate="2015-11-15T00:18:53.200" Score="2" ViewCount="76" Body="&lt;p&gt;I am self-studying for an actuarial exam, and I encountered the following in my text:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/FSYka.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/FSYka.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The author states that if $PV_{t, T}\text{(Divs)} &amp;lt; K(1 - e^{-r(T - t)})$, early exercise is not rational.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That made me wonder if the converse is true: If $PV_{t, T}\text{(Divs)} \geq K(1 - e^{-r(T - t)})$, then early exercise may be rational.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in an exercise, the author seems to suggest that there is more to it than that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/IKgi7.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/IKgi7.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The author seems to suggest that we have to also consider the value of the put. I don't understand why we have to consider the value of the put in this example, yet we did not consider the value of the put in the statement underlined in red.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for clarification on this.&lt;/p&gt;&#xA;" OwnerUserId="5641" LastActivityDate="2015-11-15T16:53:43.907" Title="Understanding the necessary and sufficient conditions for rational early exercise of a call option" Tags="&lt;call&gt;&lt;put-call-parity&gt;&lt;self-study&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21755" PostTypeId="2" ParentId="21749" CreationDate="2015-11-15T09:57:51.657" Score="1" Body="&lt;p&gt;investor interest in cash cdo tranches is driven by gaining [leveraged] credit exposure; in cash cdo investor goes long credit exposure and statement &quot;going long tranche implies short exposure (i.e. buy credit protection)&quot; is questionable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;synthetic: Entity which issues cdo may sell cds and collect premiums; these premiums are further distributed to pay investors in cdo tranches - effectively investors are going short cds (long credit exposure) and collect coupons for doing so. Going long the tranche is effectively long credit exposure (short cds); and going short the tranche is effectively short credit exposure (buy cds).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;credit protection = short credit exposure&lt;/p&gt;&#xA;&#xA;&lt;p&gt;short (credit protection) = short (short credit exposure) = long credit exposure&lt;/p&gt;&#xA;&#xA;&lt;p&gt;hope this helps&lt;/p&gt;&#xA;" OwnerUserId="18275" LastEditorUserId="18275" LastEditDate="2015-11-15T10:15:13.377" LastActivityDate="2015-11-15T10:15:13.377" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21756" PostTypeId="2" ParentId="21753" CreationDate="2015-11-15T15:14:46.387" Score="2" Body="&lt;p&gt;If $PV_{t, T}(\text{Divs}) \ge K\big(1-e^{-r(T-t)}\big)$, since $P_{Eur}(S_t, K, T-t) &amp;gt;0$, the identity&#xA;\begin{align*}&#xA;C_{Eur}(S_t, K, T-t) = P_{Eur}(S_t, K, T-t) + (S_t-K) -PV_{t, T}(\text{Divs}) +K\big(1-e^{-r(T-t)}\big),&#xA;\end{align*}&#xA;implies that&#xA;\begin{align*}&#xA;C_{Eur}(S_t, K, T-t) &amp;gt; (S_t-K).&#xA;\end{align*}&#xA;That is, it is not rationale to exercise the option at time $t$ in this case. Note that the conclusion also depends on the statement that &quot;The put must be worth at least zero&quot;, which you should also highlight.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ $$&#xA;Note that, it may be rationale to exercise the option at $t$, instead of the maturity $T$, only if &#xA;\begin{align*}&#xA;C_{Eur}(S_t, K, T-t) \le (S_t-K).&#xA;\end{align*}&#xA;From the above identity, this is equivalent to&#xA;\begin{align*}&#xA;P_{Eur}(S_t, K, T-t) -PV_{t, T}(\text{Divs}) +K\big(1-e^{-r(T-t)}\big) \le 0.&#xA;\end{align*}&#xA;That is, the put option price is indeed taking into consideration. For the Quiz you provided, since&#xA;\begin{align*}&#xA;P_{Eur}(S_t, K, T-t) -PV_{t, T}(\text{Divs}) +K\big(1-e^{-r(T-t)}\big) &amp;amp;=&#xA;0.82 -2.9851 +1.4049 \\&#xA;&amp;amp;&amp;lt; 0,&#xA;\end{align*}&#xA;it may be rationale to exercise this option early.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$$$&#xA;Here, we say that it may be rationale to exercise early. However, this does not mean it is optimal to exercise at time $t$, as we only considered two possible exercise times $t$ and $T$. In general, we need to take all possible stopping times, $\tau$, ranged from $t$ to $T$ into consideration. That is, we need to solve an optimal stopping problem.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-11-15T16:53:43.907" LastActivityDate="2015-11-15T16:53:43.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21757" PostTypeId="2" ParentId="21236" CreationDate="2015-11-15T15:27:58.417" Score="2" Body="&lt;p&gt;In general, the implied volatility is based on vanilla European or American options. In your case, since the positions depend on only a single underlier, if you can have an analytical formula, or approximation, for each individual position, then, in principle, you can compute an implied volatility based on the market price of your portfolio. However, note that, in general, there is no liquid market price quote for such &quot;complex&quot; options. &lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-11-15T15:49:00.193" LastActivityDate="2015-11-15T15:49:00.193" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21758" PostTypeId="2" ParentId="21750" CreationDate="2015-11-15T15:53:55.933" Score="0" Body="&lt;p&gt;with R (tiker: yahoo tiker, nDays: max 15):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;getYahoo.intraday &amp;lt;- function(tiker,nDays){&#xA;url &amp;lt;- paste(&quot;http://chartapi.finance.yahoo.com/instrument/1.0/&quot;,tiker,&quot;/chartdata;type=quote;range=&quot;,nDays,&quot;d/csv&quot;,sep=&quot;&quot;)&#xA;nskip &amp;lt;- as.numeric(nDays)+17&#xA;data &amp;lt;- read.csv(url, skip=nskip, header=F, stringsAsFactors=F)&#xA;data.xts &amp;lt;- xts(data[,-1],as.POSIXct(data$V1,origin=&quot;1970-01-01&quot;,tz=&quot;GMT&quot;))&#xA;indexTZ(data.xts) &amp;lt;- &quot;America/New_York&quot;&#xA;colnames(data.xts) &amp;lt;- c(&quot;Open&quot;, &quot;High&quot;, &quot;Low&quot;, &quot;Close&quot;, &quot;Volume&quot;)&#xA;options(warn=-1)&#xA;data.xts&#xA;}&#xA;&#xA;&#xA;library(quantmod)&#xA;p &amp;lt;- getYahoo.intraday(&quot;SPY&quot;,&quot;15&quot;)&#xA;tail(p)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="18289" LastActivityDate="2015-11-15T15:53:55.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21759" PostTypeId="2" ParentId="11032" CreationDate="2015-11-15T16:45:13.970" Score="2" Body="&lt;p&gt;The payoff can be decomposed as&#xA;\begin{align*}&#xA;\phi(S) &amp;amp;= 100 \, I_{50 \le S_T &amp;lt; 100}\\&#xA;&amp;amp;= 100 \, \big(I_{S_T \ge 50} - I_{S_T \geq 100}\big).&#xA;\end{align*}&#xA;Note that, under the risk-neutral measure $P$,&#xA;\begin{align*}&#xA;E(I_{S_T \ge K} \mid \mathcal{F}_t) &amp;amp;= P(S_T \ge K \mid \mathcal{F}_t)\\&#xA;&amp;amp;= N(d_2),&#xA;\end{align*}&#xA;where&#xA;\begin{align*}&#xA;d_2 = \frac{\ln \frac{S_t}{K} + \big(r-\frac{1}{2}\sigma^2\big) (T-t)}{\sigma\sqrt{T-t}}.&#xA;\end{align*}&#xA;The valuation of the above option payoff is now straightforward.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-11-15T22:54:43.137" LastActivityDate="2015-11-15T22:54:43.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21760" PostTypeId="1" CreationDate="2015-11-15T22:12:32.380" Score="0" ViewCount="2323" Body="&lt;p&gt;I'm not a quant practitioner, but a student so this may be a very simple question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was of the understanding corporate US bonds were quoted 1/8 increments and US treasuries in 1/32 increments. Such that a quote of 99 1/8 represents 99.125%. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I came across some study notes, from a fairly reputable source that equated a Nominal 3 5/8 bond to a yield of 3.275% (but 5/8 = 0.625) and a TIPS which was quoted as 1 7/8 to a yield of 1.237% (7/8 = .875)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;... am I missing something?&lt;/p&gt;&#xA;" OwnerUserId="9265" LastActivityDate="2015-12-01T21:33:09.363" Title="Corporate bond quote convention" Tags="&lt;fixed-income&gt;&lt;quote&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21761" PostTypeId="2" ParentId="21745" CreationDate="2015-11-16T00:23:35.840" Score="2" Body="&lt;p&gt;The intuition behind the statement &quot;if correlation increases, the spread of a CDO junior tranche decreases&quot; is as follows:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If correlation increases, more probability mass of the default distribution is moving to the tails.&lt;/li&gt;&#xA;&lt;li&gt;The risk of joint default increases, but at the same time the chance of joint survivals increases.&lt;/li&gt;&#xA;&lt;li&gt;So the higher correlation, the higher the likelihood that there are no defaults.&lt;/li&gt;&#xA;&lt;li&gt;The junior tranche becomes less risky and the spread decreases.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="18221" LastActivityDate="2015-11-16T00:23:35.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21762" PostTypeId="2" ParentId="21693" CreationDate="2015-11-16T00:56:32.777" Score="4" Body="&lt;p&gt;You can also use the &lt;a href=&quot;https://en.wikipedia.org/wiki/Herfindahl%E2%80%93Hirschman_Index#Effective_assets_in_a_portfolio&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;Herfindahl-Hirschmann-Index&quot;&gt;Herfindahl-Hirschman-Index&lt;/a&gt; (HHI) as a measure for concentration.&lt;/p&gt;&#xA;&lt;p&gt;In portfolio analysis, you can calculate it as &lt;span class=&quot;math-container&quot;&gt;$$\frac{1}{N} \leq HHI(x) = \sum_{i=1}^N x_i^2 \leq 1$$&lt;/span&gt; where &lt;span class=&quot;math-container&quot;&gt;$x$&lt;/span&gt; is a vector of &lt;span class=&quot;math-container&quot;&gt;$N$&lt;/span&gt; portfolio asset weights.&lt;/p&gt;&#xA;&lt;p&gt;One can easily see that &lt;span class=&quot;math-container&quot;&gt;$HHI(x) = 1$&lt;/span&gt; if 100% is invested in a single asset, and &lt;span class=&quot;math-container&quot;&gt;$HHI(x) = 1/N$&lt;/span&gt; if the portfolio is perfectly diversified (equally-weighted portfolio).&lt;/p&gt;&#xA;&lt;p&gt;In contrast to Diversification Ratio or Diversification Index, the HHI works directly on portfolio weights.&lt;/p&gt;&#xA;&lt;p&gt;The Herfindahl-Index can be normalized between 0 and 1 by&#xA;&lt;span class=&quot;math-container&quot;&gt;$$NHHI(x) = \frac{N \times HHI(x) - 1}{N-1}$$&lt;/span&gt;&lt;/p&gt;&#xA;" OwnerUserId="18221" LastEditorUserId="41390" LastEditDate="2020-11-10T23:25:48.650" LastActivityDate="2020-11-10T23:25:48.650" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="21763" PostTypeId="1" AcceptedAnswerId="21765" CreationDate="2015-11-16T07:19:39.640" Score="1" ViewCount="279" Body="&lt;p&gt;When using the Black-Scholes-Merton method for option valuation which takes into account dividends, does the dividend only get included into the calculation of options whose lifetime straddles the dividend exdiv date?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example today is 16Nov2015. Lets say stock xyz has an upcoming exdiv date on 16Jan2016. If im valuing an option whose expiration is in either November or December, do I include January's dividend into that calculation because they expire before the exdiv date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or do I only include options whose expiration is after the exdiv date?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or do I simply always include the stocks current dividend yield into the calculation,...regardless of whether the options expiration falls before or after the next exdiv?&lt;/p&gt;&#xA;" OwnerUserId="16304" LastActivityDate="2015-11-16T08:45:32.803" Title="When to include dividends in option valuation" Tags="&lt;option-pricing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21764" PostTypeId="1" AcceptedAnswerId="21767" CreationDate="2015-11-16T08:27:31.640" Score="4" ViewCount="2731" Body="&lt;p&gt;I'm creating a Monte Carlo simulation model which I use to price an European option with various pay-off conditions, hence I can't use Black Scholes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to stop the simulation once I am 95% sure I am within 1% of the true value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To do this, I calculate the relative error (correct naming?) every 10 000 sims using:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Relative Error = \frac{(\sigma/\sqrt{n}) Z_{\delta/2}}{\mu} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where &#xA;$$\sigma/\sqrt{n}$$&#xA;represent the standard error and&#xA;$$Z_{\delta/2}$$&#xA;my confidence level, so 1.96 for 95%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;μ is the mean (fair value) of the simulation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the relative error is less than let's say 1%, then I stop the simulation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this the correct way of solving my problem?&lt;/p&gt;&#xA;" OwnerUserId="18065" LastActivityDate="2016-03-15T23:01:56.583" Title="Stopping Monte Carlo simulation once certain convergence level is reached" Tags="&lt;monte-carlo&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21765" PostTypeId="2" ParentId="21763" CreationDate="2015-11-16T08:45:32.803" Score="2" Body="&lt;p&gt;The dividend adjustment in the option formula represents compensation for dividend income that an ordinary stockholder will have entitlement to before expiry, but which you the option owner will not be entitled to. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If at expiry you exercise into a stock that has not gone exdiv, then you are entitled to the dividend, and so should not include it in your calculation. But you should include any dividends that were announced and went exdiv before expiry, and which you will thus never receive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is more complicated if expiry date is the same as exdiv date. From memory, it goes exdiv at a certain time of day.  Typically options also have a specific time of expiry.  Note also some european contracts go american on expiry day. &lt;/p&gt;&#xA;" OwnerUserId="7220" LastActivityDate="2015-11-16T08:45:32.803" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21766" PostTypeId="1" CreationDate="2015-11-16T13:54:34.537" Score="0" ViewCount="75" Body="&lt;p&gt;I need to do symbology translations between two financial systems. One part of this is to identify a symbol that is an index in one system so that I can prepend a character to it when I send it to the other. The first system does not use any special formatting to indicate that a symbol is an index. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To do this I need to find a list of all US Indices so I can classify a symbol via a lookup. At minimum I need an index's symbol but I would also like to have its CUSIP and Name. Ideally it would be a data source that is updated on a regular basis that I can programmatically pull from.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Does anyone know a good data source for US Indices?&lt;/strong&gt; Free is always good!&lt;/p&gt;&#xA;" OwnerUserId="18300" LastEditorUserId="18300" LastEditDate="2015-11-16T14:04:50.813" LastActivityDate="2015-11-17T09:23:07.010" Title="List of US Indices" Tags="&lt;data&gt;&lt;market-data&gt;" AnswerCount="1" CommentCount="2" ClosedDate="2015-11-17T15:45:14.307" ContentLicense="CC BY-SA 3.0" />
  <row Id="21767" PostTypeId="2" ParentId="21764" CreationDate="2015-11-16T14:56:06.123" Score="1" Body="&lt;p&gt;Yes, that's an excellent approach.  The only time it might go wrong is if, say, you are integrating on some extreme tail event without using importance sampling.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, let's say you were simulating expected loss on a portfolio of five bonds issued by the USA, Germany, Norway, Sweden and the Netherlands.  After 10,000 simulations, there's a chance you might still not have generated any paths with defaults, in which case $\sigma=0$ and your algorithm would halt.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2015-11-16T14:56:06.123" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21768" PostTypeId="1" CreationDate="2015-11-16T15:06:40.403" Score="4" ViewCount="1048" Body="&lt;p&gt;I recently came across a chart of Fama-French's (FF) HML factor cumulative performance. I first saw this in an article by AQR's Cliff Asness: &lt;a href=&quot;http://www.institutionalinvestor.com/Article/3315202/Asset-Management-Equities/The-Great-Divide-over-Market-Efficiency.html#/.VkntwZ0o5Ms&quot; rel=&quot;noreferrer&quot;&gt;http://www.institutionalinvestor.com/Article/3315202/Asset-Management-Equities/The-Great-Divide-over-Market-Efficiency.html#/.VkntwZ0o5Ms&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I went to Ken French's data library in an attempt to replicate it. I was simply compounding the growth of $100, by doing a straightforward time series of 100*(1+r). After no success on such a deceptively simple task, I eventually found that Asness was showing the cumulative performance, as the cumulative sum. See figure 9.1 Quantitative Equity Investing by Lasse Heje Pedersen (on google books). Here's the footnote to that chart:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;blockquote&gt;&#xA;    &lt;p&gt;Cumulative performance of the value factor HML, 1926—2012. The figure shows the cumulative sum (i.e., without compounding) of the long–short value factor HML constructed based on stocks' book-to-market ratios.&lt;/p&gt;&#xA;  &lt;/blockquote&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My specific question is why use this &quot;cumulative sum&quot; instead of the compounded wealth growth? What is the use of this data presentation? To me this does not say much about the true cumulative performance of the factor, one needs to see this in terms of compounding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks. &lt;/p&gt;&#xA;" OwnerUserId="18301" LastActivityDate="2016-09-12T01:55:23.877" Title="Back to Basics -- Cumulative Returns" Tags="&lt;factor-models&gt;&lt;asset-returns&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21769" PostTypeId="2" ParentId="21764" CreationDate="2015-11-16T16:20:35.397" Score="8" Body="&lt;p&gt;You have the right idea, but it seems you don't know $\mu$, so using it in your error check doesn't seem correct.  Also, checking the result every 10,000 iterations may not be optimal for deciding when to stop.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be clear, let $E(X) = \mu$ and $Var(X) = \sigma$.  We're invoking the CLT when we write&#xA;$$&#xA;P\left( \left|\frac{\bar{X}_n - \mu}{\sigma/\sqrt{n}}\right| &amp;gt; 1.96 \right) \approx P(|Z| &amp;gt; 1.96) = 0.05.&#xA;$$&#xA;In words, there is approximately a 95% probability that the sample mean $\bar{X}_n$ is within $1.96\frac{\sigma}{\sqrt{n}}$ units of the true mean $\mu$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do we use this in simulation?  First, note&#xA;$$&#xA;S_n^2 := \frac{1}{n-1}\sum_{i=1}^n (X_i - \bar{X})^2&#xA;$$&#xA;is an unbiased estimator of $\sigma^2$.  Thus if we want an approximate 95% probability that $\bar{X}_n$ is within $0.01$ units of $\mu$, we continue simulation until&#xA;$$&#xA;1.96\frac{S_n}{\sqrt{n}} &amp;lt; 0.01.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two important items to note:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;We should have $n \geq 30$ to use this error check since this is a result of the CLT, and&lt;/li&gt;&#xA;&lt;li&gt;An online implementation of $\bar{X}_n$ and $S_n^2$ would be much more efficient, so that we don't recompute them every time.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For item 2, we may use&#xA;\begin{align}&#xA;\bar{X}_{n+1} &amp;amp; = \bar{X}_n + \frac{X_{n+1} - \bar{X}_n}{n+1}, \\&#xA;S^2_{n+1} &amp;amp; = \left(1 - \frac{1}{n}\right)S_n^2 + (n+1)(\bar{X}_{n+1} - \bar{X}_n)^2&#xA;\end{align}&#xA;Now we may simply use a &lt;code&gt;while&lt;/code&gt;($1.96\frac{S_n}{\sqrt{n}} &amp;gt; 0.01$) loop, stopping at exactly the iteration this error is met.&lt;/p&gt;&#xA;" OwnerUserId="6866" LastEditorUserId="6866" LastEditDate="2016-03-15T23:01:56.583" LastActivityDate="2016-03-15T23:01:56.583" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21771" PostTypeId="2" ParentId="21760" CreationDate="2015-11-16T17:17:38.690" Score="0" Body="&lt;p&gt;US bond prices are routinely quoted at much finer intervals. For example, you may see a quote of 99-103, which translates into $99+10/32 + 3/256$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Further, although there may be a minimum tick size for &quot;prices,&quot; so such constraints are imposed on &quot;yields&quot; (at least in the US). In fact, yields are frequently computed up to 15-20 decimal places. &lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2015-11-16T17:17:38.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21772" PostTypeId="2" ParentId="21768" CreationDate="2015-11-16T19:12:36.220" Score="1" Body="&lt;p&gt;The cumulative return tells you how much 1€ grew over the investment horizon, whereas the compound return is typically annualized.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider you invest 100€ for 2 years. At the end of year two, your investment grew to 110€. the cumulative return is then (110-100)/100=10%. What is the compound return? Obviously, it must be lower than the 10% as we have a two-year investment and the compound return is expressed annualy. The compound return is obtained from 110=100(1+r)^2 which results in r=sqrt(110/100)-1=4.88%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now image the other way round: If somebody tells you he made 10% cumulative return over the last two years, you can easily calculate without a computer that his 1€ investment grew to 1.1€ during that period.&#xA;If he would tell you he made 10% compound return (annually), you would have to calculate 1€x1.1x1.1 to come up with the value of the 1€ investment after two years. This calculation is more &quot;difficult&quot; the longer the period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To summarize, for humans it may be more easy to think in terms of cumulative returns as a return over the whole investment horizon. To compare two investments with differing investment horizons, you would go for compound rates.&lt;/p&gt;&#xA;" OwnerUserId="18221" LastActivityDate="2015-11-16T19:12:36.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21773" PostTypeId="1" CreationDate="2015-11-16T21:05:47.710" Score="1" ViewCount="219" Body="&lt;p&gt;Can someone clarify for me the notation of the nodes in a binomial tree with more than 1 step? Is this notation correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/7dTle.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/7dTle.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9265" LastActivityDate="2016-01-09T15:50:58.430" Title="Binomial tree notation" Tags="&lt;binomial-tree&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21780" PostTypeId="1" CreationDate="2015-11-17T08:35:47.950" Score="3" ViewCount="586" Body="&lt;p&gt;I am trying to get some advice or direction (brainstorm) as to the best way to summarise/cluster/etc. the equity fund universe (which for my purposes consists of about 150 funds).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some of my ideas at current:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-I have access to a Value and Growth Index so could perhaps try segregate funds into value/momentum/growth groups by looking at their betas to these indices. Could also do the same to estimate the funds' exposures to certain sectors: Large Cap, Mid Cap, Small Cap; Resources, Financials, Industrials; etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-regression on index to see which funds are closet benchmark trackers (or look at tracking error)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-maybe PCA on the equity fund universe to see which funds are more dissimilar to universe...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am really just looking for several ways of analysing the funds and try to get some groupings or measures of similarity between the funds. Any pointers of what to read up on or suggestions would be appreciated  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: I would be using R for this work so if there are any R-specific libraries to look at then please notify&lt;/p&gt;&#xA;" OwnerUserId="17048" LastActivityDate="2018-03-08T08:09:33.420" Title="Clever ways of &quot;summarising&quot; the equity fund universe" Tags="&lt;equities&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21781" PostTypeId="2" ParentId="21766" CreationDate="2015-11-17T09:23:07.010" Score="0" Body="&lt;p&gt;I found a good lis of indices from &lt;a href=&quot;https://www.quandl.com/collections/markets/us-stock-indexes&quot; rel=&quot;nofollow&quot;&gt;QUANDL&lt;/a&gt; . They have a nice list of indices which you can pull from by ticker/symbol. I am not aware they provide by CUSIP&lt;/p&gt;&#xA;" OwnerUserId="13428" LastActivityDate="2015-11-17T09:23:07.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21784" PostTypeId="2" ParentId="21279" CreationDate="2015-11-17T17:42:05.207" Score="1" Body="&lt;p&gt;Let $P&amp;gt;K$ and $r=0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you can short the put and receive $P$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At maturity, the maximum payoff you have to pay from the put is $K$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore you have a sure profit of at least $P-K&amp;gt;0$, which is an arbitrage.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2015-11-17T17:42:05.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21785" PostTypeId="1" CreationDate="2015-11-17T19:33:40.570" Score="0" ViewCount="105" Body="&lt;p&gt;I'm reading on Investopedia that one should buy a stock if short term moving average is ABOVE the long term moving average, since this &quot;indicates an upward trend&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, this is not intuitive to me. Wouldn't it be more beneficial to buy when the opposite is true? I.e when the short term trend is below the long term trend, since you can expect the market to correct itself and there make a profit. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's obviously a matter of personal preference, but the latter makes more sense to me. What's the general consensus? &lt;/p&gt;&#xA;" OwnerUserId="18316" LastActivityDate="2015-11-17T20:12:52.300" Title="Moving Averages Crossover question" Tags="&lt;moving-average&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21786" PostTypeId="1" CreationDate="2015-11-17T19:45:26.743" Score="0" ViewCount="91" Body="&lt;p&gt;Basically I am trying to price CoCo-Bond with the AT1P from Brigo. But in the end this isn´t a two factor model. Is there any concret research about this topic? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kind regards,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;WLS&lt;/p&gt;&#xA;" OwnerUserId="18317" LastActivityDate="2016-06-03T19:31:00.677" Title="Is there any research for CoCo-Bond in a two factor model?" Tags="&lt;bond&gt;&lt;pricing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21787" PostTypeId="2" ParentId="21785" CreationDate="2015-11-17T20:12:52.300" Score="1" Body="&lt;p&gt;Under weak-form efficient markets neither situation is more profitable to buy in. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Contrarily, under technical analysis, the answer depends on whether you adhere to a mean-reverting or a momentum theory of the market. Under the former, your supposition is correct. Under the latter, certain shorter-term MAs crossing certain longer-term MAs from below are deemed to be breakouts. Exact cases vary in the literature. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best thing is, all of these theories are easily testable. &lt;/p&gt;&#xA;" OwnerUserId="13902" LastActivityDate="2015-11-17T20:12:52.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21788" PostTypeId="1" CreationDate="2015-11-17T20:28:16.663" Score="1" ViewCount="438" Body="&lt;p&gt;I asked this question &lt;a href=&quot;https://stats.stackexchange.com/questions/182266/best-performance-of-stock-prediction-algorithms&quot;&gt;here&lt;/a&gt; and was directed to answer it on this stack exchange.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;My question is very simple. What is the best [known] performance of a stock prediction algorithm?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've seen papers with up to 76% accuracy. Has anyone [publicly] done better?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS. Here's one paper that I'm talking about &lt;a href=&quot;http://cs229.stanford.edu/proj2012/ShenJiangZhang-StockMarketForecastingusingMachineLearningAlgorithms.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://cs229.stanford.edu/proj2012/ShenJiangZhang-StockMarketForecastingusingMachineLearningAlgorithms.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18318" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2015-11-27T12:16:12.303" Title="Best known performance of stock prediction algorithms" Tags="&lt;equities&gt;&lt;finance&gt;&lt;futures&gt;&lt;algorithmic-trading&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21789" PostTypeId="1" CreationDate="2015-11-17T20:51:44.950" Score="1" ViewCount="512" Body="&lt;p&gt;I am looking to create a Monte Carlo generator in Excel to plot correlated asset paths for a portfolio containing 1 to 10 assets. I have the correlation matrix for all 10 assets and have performed the Cholesky Decomposition to obtain the lower NXN matrix output using some VBA code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for some guidance on when/how to incorporate the asset weights of the portfolio into my path generation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example for a three asset portfolio I generate three separate series of random variables using the NORMSINV(RAND()) = RN function to return the sigma. Then multiply each random variable by the corresponding cholesky output and sum the series to get a correlated random variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CRV (correlated ran. variables) = =RN1*chol1 + RN2*chol2 + RN3*chol3&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then found instruction on setting up your drift and volatility terms to generate a series of the log of prices factoring in the above input.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Log of Prices=LN(Starting Price)+(Drift-0.5*volatility * volatility) + volatility*CRV&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where do I factor in my asset weights? Let's say 20/30/50 for a three asset portfolio?&lt;/p&gt;&#xA;" OwnerUserId="17407" LastEditorUserId="17407" LastEditDate="2015-11-23T19:15:12.553" LastActivityDate="2015-11-23T19:15:12.553" Title="Adding Asset Weights To Cholesky Output - Monte Carlo in VBA" Tags="&lt;monte-carlo&gt;&lt;cholesky&gt;&lt;vba&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21790" PostTypeId="1" CreationDate="2015-11-17T21:34:04.663" Score="1" ViewCount="474" Body="&lt;p&gt;Can you explain why the answer to the following question is &lt;em&gt;approximately 4.5%&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;An investor buys a bond that has a Macaulay duration of 3.0 and a&#xA;  yield to maturity of 4.5%. The investor plans to sell the bond after&#xA;  three years. If the yield curve has a parallel downward shift of 100&#xA;  basis points immediately after the investor buys the bond, her&#xA;  annualized horizon return is most likely to be:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;Answer: approximately 4.5%&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="18320" LastEditorUserId="467" LastEditDate="2015-11-18T08:47:41.503" LastActivityDate="2015-11-18T15:25:36.307" Title="How to get to this answer on Macauley duration?" Tags="&lt;fixed-income&gt;&lt;duration&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21791" PostTypeId="2" ParentId="21790" CreationDate="2015-11-17T22:05:16.980" Score="1" Body="&lt;p&gt;Duration (of which Macaualy is one type) is only a linear &lt;strong&gt;approximation&lt;/strong&gt; of how the bond value will change with a small change in yield. &lt;/p&gt;&#xA;" OwnerUserId="9265" LastActivityDate="2015-11-17T22:05:16.980" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21792" PostTypeId="1" CreationDate="2015-11-17T22:35:39.693" Score="2" ViewCount="531" Body="&lt;p&gt;Of course, a pure discount bond price $P(t,T)$ may be stated in terms of its yield $R(t,T)$ as&#xA;$$&#xA;P(t,T) = e^{-R(t,T)(T-t)}.&#xA;$$&#xA;Let's assume both the (instantaneous) short rate $r(t)$ and (instantaneous) forward rate $f(t,T)$ are deterministic functions.  The relationships to discount bond prices are&#xA;\begin{align}&#xA;r(t) &amp;amp; = -\frac{\partial}{\partial T} \log P(t,t), \\&#xA;f(t,T) &amp;amp; = -\frac{\partial}{\partial T} \log P(t,T).&#xA;\end{align}&#xA;From this, it is clear that&#xA;$$&#xA;P(t,T) = \exp\left(-\int_t^T f(t,u) \, du\right) \qquad (1).&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, the bond price is often stated in terms of risk-neutral expectations &lt;em&gt;using the short rate&lt;/em&gt;, such as&#xA;$$&#xA;P(t,T) = E_Q\left(\exp\left(-\int_t^T r(u) \, du\right) \mid \mathcal{F}_t\right),&#xA;$$&#xA;and since I am assuming $r(t)$ is deterministic, it should be that&#xA;$$&#xA;P(t,T) = \exp\left(-\int_t^T r(u) \, du\right) \qquad (2).&#xA;$$&#xA;Comparing Eqns (1) and (2), it seems like&#xA;$$&#xA;\int_t^T r(u) \, du = \int_t^T f(t,u) \, du.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this even make sense?  Furthermore, since $P(t,T) = e^{-R(t,T)(T,t)}$, we would get&#xA;$$&#xA;R(t,T) = \frac{1}{T-t}\int_t^T f(t,u) \, du = \frac{1}{T-t}\int_t^T r(u) \, du.&#xA;$$&#xA;That is, the yield is both the average of the instantaneous forward rate (this is true), &lt;em&gt;and&lt;/em&gt; the average of the instantaneous spot rate.  Is this latter statement true?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2015-11-23T23:30:43.540" Title="Bond Prices in terms of short and forward rates" Tags="&lt;interest-rates&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21793" PostTypeId="2" ParentId="21780" CreationDate="2015-11-17T23:27:57.327" Score="0" Body="&lt;p&gt;for model construction purposes, I would suggest factor analysis or PCA.  Have a look at &lt;a href=&quot;https://cran.r-project.org/web/packages/EMCluster/EMCluster.pdf&quot; rel=&quot;nofollow&quot;&gt;EM algorithm&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18252" LastActivityDate="2015-11-17T23:27:57.327" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21794" PostTypeId="2" ParentId="18945" CreationDate="2015-11-17T23:37:28.617" Score="1" Body="&lt;p&gt;When the adjusted strike goes to zero or negative, it can be proven that the call option will always be exercised, therefore the price of a call is given by the discounted of the underlying and strike (as also mentioned by Gordon). This is like a forward therefore there is no need to compute d1 and d2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/BpRJp.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/BpRJp.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="601" LastEditDate="2015-11-17T23:43:28.487" LastActivityDate="2015-11-17T23:43:28.487" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21797" PostTypeId="2" ParentId="21788" CreationDate="2015-11-18T07:26:37.290" Score="1" Body="&lt;p&gt;All of these papers involve some kind of bias. @Alex pointed out rightly, they assume data is known in advance. Further model is tested on the same data on which it is being run. In reality, there is no such algorithm and strategy exist that can consistently outperform the market. Market is always very close to efficient. If someone able to find algorithm to predict the stock market very closely, even then this algorithm would become redundant the moment it gets disclosed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note for cautious : Donot put your money into stock market based on the any published work claim to predict the market accurately(even for 90%). &lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2015-11-18T07:26:37.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21799" PostTypeId="1" CreationDate="2015-11-18T09:27:58.333" Score="2" ViewCount="139" Body="&lt;p&gt;The goal is to build a $n$ step binomial tree knowing the end nodal probabibilities $p_1, \dots, p_m$, which correspond to the time $T$ states $S_1, \dots, S_m$. We assume that all paths ending in the same nodes have the same probabibilities and that todays state $S_0$ is known.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some efficient algo out there, which encorporates dividends?&lt;/p&gt;&#xA;" OwnerUserId="6640" LastActivityDate="2015-11-18T09:27:58.333" Title="Efficient construction of binomial tree" Tags="&lt;binomial-tree&gt;&lt;algorithm&gt;" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="21800" PostTypeId="2" ParentId="12638" CreationDate="2015-11-18T12:41:08.287" Score="7" Body="&lt;p&gt;The price difference is so large -- that the only possible reason is that you have spot and strike confused between the two functions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And indeed:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;R&amp;gt; fOptions.BAW &amp;lt;- BAWAmericanApproxOption(TypeFlag, S, X, Time,&#xA;+                       r, b, sigma, title = NULL, description = NULL)&#xA;R&amp;gt; quantlib.BAW &amp;lt;- AmericanOption(&quot;call&quot;, X, S, b, r, Time, &#xA;+                       sigma, timeSteps=150, gridPoints=149,&#xA;+                       engine=&quot;BaroneAdesiWhaley&quot;)&#xA;R&amp;gt; result &amp;lt;- c(&quot;fOptions&quot;=fOptions.BAW@price,&#xA;+             &quot;RQL&quot;=quantlib.BAW$value)&#xA;R&amp;gt; result&#xA;fOptions      RQL &#xA; 47.7631  47.5193 &#xA;R&amp;gt; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="69" LastActivityDate="2015-11-18T12:41:08.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21802" PostTypeId="2" ParentId="21792" CreationDate="2015-11-18T13:43:38.887" Score="1" Body="&lt;p&gt;Since the interest rate is deterministic, for $t&amp;lt; u \le T$,&#xA;\begin{align*}&#xA;f(t, u) &amp;amp;= -\frac{\partial}{\partial u} \ln P(t, u)\\&#xA;&amp;amp;=-\frac{\partial}{\partial u} \ln \left(E\left(\exp\left(-\int_t^u r(s)\, ds \right) \mid \mathcal{F}_t\right) \right)\\&#xA;&amp;amp;=-\frac{\partial}{\partial u} \ln \left(\exp\left(-\int_t^u r(s)\, ds\right)  \right)\\&#xA;&amp;amp;=\frac{\partial}{\partial u}\int_t^u r(s)\, ds \\&#xA;&amp;amp;= r(u).&#xA;\end{align*}&#xA;Consequently, &#xA;\begin{align*}&#xA;\frac{1}{T-t}\int_t^T f(t, u)\, du = \frac{1}{T-t}\int_t^T r(u)\, du.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-11-18T14:13:33.447" LastActivityDate="2015-11-18T14:13:33.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21804" PostTypeId="2" ParentId="21790" CreationDate="2015-11-18T14:47:14.263" Score="1" Body="&lt;p&gt;If the bonds yield goes down by $100 \text{bps}$ and the duration is $3$, the bond price will increase by &lt;em&gt;approximately&lt;/em&gt; $3\%$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without any subsequent movement over the next three years, the bond should yield 3.5% p.a. after the yield rate movement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The return during the total holding period of three years would be &lt;em&gt;approximately&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ 3\% \text{(yield rate shift)} + 3\cdot 3.5\% \text{(annual bond yield)} = 13.5\%. $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets approximate again and divide that by three to get the annual value: $4.5\%$.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Please be aware that there are several assumptions and simplifications made here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all, the Macaulay Duration is only a linear approximation of the bonds price sensitivity to yield price changes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other is that we simply assume all given interest rates to be continuously compounded values when we add, multiply and divide them to scale the returns over time. This is only a good approximation for small rates $r$, where $\ln (1+r) \approx r$. In particular, this definitely an approximation for the duration impact term because the duration formula gives us the price impact in terms of discrete returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We also assume that there either are no coupons at all or they can be reinvested at exactly the yield of the bond (without transaction costs or even market impact). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The third assumption whe have to make is that after the initial yield movement, the bonds yield will remain constant during the holding period.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2015-11-18T14:47:14.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21805" PostTypeId="2" ParentId="21790" CreationDate="2015-11-18T15:25:36.307" Score="0" Body="&lt;p&gt;I went on a rant below, but this is actually a trick question. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the time to maturity of the bond is 3 years, if its current yield to maturity is 4.5%, and if you hold the bond to maturity, then the annualized horizon return will be 4.5%, &lt;strong&gt;assuming all interim cash flows can be reinvested at the 4.5% yield&lt;/strong&gt;. If cash flows cannot be reinvested at 4.5%, then the holding period return will drift away from 4.5% somewhat. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given that the position is held to maturity, the instantaneous 100 bp change in yield is irrelevant, since any unrealized losses/gains because of the yield shift will be subsequently offset. Consider the simpler scenario of a zero coupon bond which has no coupon payments and only a principal payment on the maturity date. If yield increases substantially, you may encounter a substantial unrealized loss initially. But at maturity, if the bond doesn't default, you'll still get back the full principal amount, and that's the only quantity relevant for computing the total return over this time period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the question uses a &quot;Macauley duration&quot; of 3. The only case where mac duration equals time to maturity is for zero coupon bonds and when yields are continuously compounded. In other cases, this 4.5% annualized return is a further approximation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the approximation comes from two fronts: 1) cash flows may not be reinvested at 4.5%, and 2) the time to maturity may not be the same as the mac duration.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Original rant below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is in my mind an extremely misleading question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all, Macauley duration as a concept has historical value, but virtually no value in practical applications. By contrast, modified duration describes the percentage change in price for a small change in yield. Modified duration can be computed easily given Macauley duration and yield to maturity:&#xA;$$ \text{modified duration} = \frac{\text{Macauley duration}}{1 + \text{yield} / \text{compounding frequency}}. $$&#xA;In this case, assuming compounding frequency is semiannual (as is the case for virtually all bonds issued int he US), then the modified duration is&#xA;$$ D_\text{mod} = \frac{3.0}{1 + 4.5\% / 2} = 2.93 $$.&#xA;So if yield changes by 100 bp, the linear approximation of percentage change in bond price should be 2.93% -- not approximately 4.5% and not 3%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to the &quot;approximately&quot; part, this is because bond price is not a linear function of yield, rather a convex function. A better approximation requires &quot;convexity&quot;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \text{percentage change in price} = -\text{mod duration}\times \Delta y + \frac{1}{2} \times \text{convexity} \times (\Delta y)^2. $$&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2015-11-18T15:25:36.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21806" PostTypeId="1" CreationDate="2015-11-18T17:43:14.833" Score="2" ViewCount="530" Body="&lt;p&gt;What's exercise frontier in option pricing? &#xA;It kept popping up but I was never fully introduced to the concept. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Follow up question: &#xA;And is the optimal exercise time the first time the option is in-the-money or is it the time where (value_exercise_now - value_continue) is at its largest?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Someone please shed some light thanks! &lt;/p&gt;&#xA;" OwnerUserId="18332" LastEditorUserId="18332" LastEditDate="2015-11-18T22:23:58.053" LastActivityDate="2016-04-17T01:53:21.800" Title="what is exercise frontier in option pricing" Tags="&lt;options&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21808" PostTypeId="1" AcceptedAnswerId="21809" CreationDate="2015-11-18T18:58:10.383" Score="3" ViewCount="820" Body="&lt;p&gt;Given two methods to calculate the 1 year conditional probability of default of a zero coupon bond, I've come up with slightly different but close results. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From my approaches below, is it reasonable for the results to be off? Is the amount they are off considered large? Am I missing something?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Given:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 year zero coupon bond with a face value of 1 million trading at 80% of face value. Assuming 0 recovery and a risk free rate of 5%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 year conditional (on no prior defaults) probability of default:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Method 1&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obtain the probability of default from a hazard rate (instantaneous conditional probability of default)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Bond Return = (\frac{Face}{Price})^{1/maturity} -1 = 25\%$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Spread = 25\% - 5\% = 5\%$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\lambda = \frac{spread}{1-Recovery} = 20\%$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;$\pi_{1 year} = 1 - e^{-\lambda} = 18.13%$&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Method 2&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equate the future value of a risky bond with yield (y) and default probability ($\pi$) to a risk free asset with yield ($R_f$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$1 + R_f = (1-\pi)*(1+R_f+z)+\pi*Recovery$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where z is the spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the above (sourced from a GARP FRM practice exam), the result is 16%.&lt;/p&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="9265" LastEditDate="2015-11-18T19:32:27.497" LastActivityDate="2015-11-18T20:37:07.837" Title="Calculating probability of default with no recovery" Tags="&lt;risk&gt;&lt;default-probability&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21809" PostTypeId="2" ParentId="21808" CreationDate="2015-11-18T20:18:54.080" Score="4" Body="&lt;p&gt;Let $\tau$ be the default time, $\lambda$ be the constant hazard rate, and $T=1.0$ be the bond maturity. The value of the defaultable zero-coupon bond is given by&#xA;\begin{align*}&#xA;D(0, T) &amp;amp;= e^{-rT}P(\tau &amp;gt; T).&#xA;\end{align*}&#xA;Then the default probability is given by&#xA;\begin{align*}&#xA;P(\tau \le T) &amp;amp;= 1- P(\tau &amp;gt; T)\\&#xA;&amp;amp;=1-D(0, T) \times e^{rT}\\&#xA;&amp;amp;=1-0.8 \times e^{0.05}\\&#xA;&amp;amp;=0.158983.&#xA;\end{align*}&#xA;The &lt;strong&gt;Method 2&lt;/strong&gt; result appears much closer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$$$&#xA;The mismacth in your &lt;strong&gt;Method 1&lt;/strong&gt; is caused by the inconsistency of the bond return and the hazard rate, that is, one is simple compound, while the other is continuous. If you define your bond reurn by&#xA;\begin{align*}&#xA;BondReturn &amp;amp;= -\frac{1}{maturity} \ln \frac{price}{face}\\&#xA;&amp;amp;= -\ln (0.8) = 0.22314,&#xA;\end{align*}&#xA;then you have hazard rate&#xA;\begin{align*}&#xA;\lambda = spread= 0.22314 -0.05 = 0.17314.&#xA;\end{align*}&#xA;and the default probability&#xA;\begin{align*}&#xA;1-e^{-\lambda} = 0.158983.&#xA;\end{align*}&#xA;In &lt;strong&gt;Method 2&lt;/strong&gt;, both the spread and bond return are assumed to be simple, which may not be accurate, but, at least, consistent.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-11-18T20:37:07.837" LastActivityDate="2015-11-18T20:37:07.837" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21810" PostTypeId="2" ParentId="21806" CreationDate="2015-11-18T20:25:41.477" Score="0" Body="&lt;p&gt;The early exercise boundary (or frontier) for American puts is the level $S^*(t)$ where it is optimal to exercise the put if $S(t)&amp;lt;S^*(t)$. There is no known analytical formula for it, but it can be approximated in various ways.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2015-11-18T20:25:41.477" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21811" PostTypeId="2" ParentId="21788" CreationDate="2015-11-18T20:52:06.297" Score="1" Body="&lt;p&gt;It's worth noting that prediction algorithms in the Machine Learning literature, if stated formally, usually come with the assumption that the data points are sampled i.i.d. from some distribution.  This distribution is badly violated when the predictions are used to take actions in the real world that affect future data.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, one might observe an arbitrage in currency prices, then trade on that opportunity, which then removes the opportunity for arbitrage.  So the model will perform well, then the distribution will change, and it will stop performing well.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this doesn't apply to say image classification or speech recognition.  Predicting that an image is of a cat won't change whether the image is or is not a cat.  This is probably a big part of why Machine Learning is so successful here.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, there are lots of domains which exhibit the i.i.d. breaking feedback property.  Recommendations are one such example.  After Netflix recommends a movie to customers, they become more likely to see that movie, which changes the distribution of the observed data.  &lt;/p&gt;&#xA;" OwnerUserId="18334" LastActivityDate="2015-11-18T20:52:06.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21812" PostTypeId="1" AcceptedAnswerId="21823" CreationDate="2015-11-18T20:52:24.683" Score="0" ViewCount="546" Body="&lt;p&gt;What is snell intuitively? And what is its use in quantitative finance?&lt;br&gt;&#xA;Please explain to me as intuitive as possible! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I explained in the comments, I am new to this field and I was hoping someone can explain this concept in a more intuitive way, like how you are going to explain this concept to someone without the background knowledge? Doesn't have to be long or detailed, just on the very high level what does it do... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks. &lt;/p&gt;&#xA;" OwnerUserId="18332" LastEditorUserId="18332" LastEditDate="2015-11-18T22:16:04.620" LastActivityDate="2015-11-19T12:47:54.620" Title="Can someone explain to me what's snell envelope?" Tags="&lt;option-pricing&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21813" PostTypeId="1" CreationDate="2015-11-18T22:22:05.940" Score="1" ViewCount="70" Body="&lt;p&gt;I need to compute the expected growth rate of a stock given the data:&#xA;financial leverage 2.0&#xA;return on assets 16%&#xA;dividend payout ratio 60%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know how to compute it nor where to start, could you please help me?&lt;/p&gt;&#xA;" OwnerUserId="18338" LastActivityDate="2016-01-22T13:48:25.660" Title="Computing the expected stock growth rate" Tags="&lt;equities&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21814" PostTypeId="1" AcceptedAnswerId="21865" CreationDate="2015-11-18T22:41:23.847" Score="2" ViewCount="384" Body="&lt;p&gt;In order to run strategy simulations, I am trying to build a database of historical equity data using Bloomberg. I can pull the ticker symbols corresponding to the components of an index at any point in time, but since ticker symbols get reused, I am concerned that I won't be able to create an exhaustive list of all the stocks that have ever been in an index (Russell 2000 for example). I want to pull the FIGIs &lt;a href=&quot;https://en.wikipedia.org/wiki/Financial_Instrument_Global_Identifier&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Financial_Instrument_Global_Identifier&lt;/a&gt;&#xA;Of the index components. Does anyone know how to do this?&lt;/p&gt;&#xA;" OwnerUserId="7769" LastActivityDate="2015-11-22T02:23:19.030" Title="Historical index components (FIGIs) from bloomberg?" Tags="&lt;market-data&gt;&lt;backtesting&gt;&lt;index&gt;&lt;bloomberg&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21815" PostTypeId="1" AcceptedAnswerId="21817" CreationDate="2015-11-18T22:49:02.367" Score="-1" ViewCount="278" Body="&lt;p&gt;I am working on a 1 Factor Libor Market Model (LMM) in C++ and I working my implementation of the formula to find my Discount Bond matrix via the following formula:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/ykdaG.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ykdaG.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of my model alpha is constant at .25 and my matrix L is 20 x 20. Here is my code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#include &amp;lt;random&amp;gt;&#xA;#include &amp;lt;iostream&amp;gt;&#xA;#include &amp;lt;sstream&amp;gt;&#xA;#include &amp;lt;string&amp;gt;&#xA;#include &amp;lt;fstream&amp;gt;&#xA;#include &amp;lt;vector&amp;gt;&#xA;#include &amp;lt;cmath&amp;gt;&#xA;#include &amp;lt;limits&amp;gt;&#xA;#include &amp;lt;cstdlib&amp;gt;&#xA;#include &amp;lt;chrono&amp;gt;&#xA;#include &amp;lt;iterator&amp;gt;&#xA;#include &amp;lt;algorithm&amp;gt;&#xA;#include &amp;lt;boost/accumulators/statistics/stats.hpp&amp;gt;&#xA;#include &amp;lt;boost/accumulators/accumulators.hpp&amp;gt;&#xA;#include &amp;lt;boost/accumulators/statistics/mean.hpp&amp;gt;&#xA;#include &amp;lt;boost/accumulators/statistics/kurtosis.hpp&amp;gt;&#xA;#include &amp;lt;boost/accumulators/statistics/variance.hpp&amp;gt;&#xA;#include &amp;lt;boost/accumulators/statistics/skewness.hpp&amp;gt;&#xA;#include &amp;lt;dlib/optimization.h&amp;gt;&#xA;#include &amp;lt;dlib/matrix.h&amp;gt;&#xA;#include &quot;mleFunctor.h&quot;&#xA;#include &quot;mleDerFunctor.h&quot;&#xA;&#xA;&#xA;&#xA;using namespace boost::accumulators;&#xA;using namespace dlib;&#xA;&#xA;typedef matrix&amp;lt;double, 0, 1&amp;gt; column_vector;&#xA;&#xA;//Generate Gaussian via Box-Muller from Mark Joshi's C++ Design Patterns and Derivatives Pricing&#xA;double GetOneGaussianByBoxMuller()&#xA;{&#xA;    double result;&#xA;&#xA;    double x;&#xA;    double y;&#xA;&#xA;    double sizeSquared;&#xA;    do&#xA;    {&#xA;        x = 2.0*std::rand() / static_cast&amp;lt;double&amp;gt;(RAND_MAX) - 1;&#xA;        y = 2.0*std::rand() / static_cast&amp;lt;double&amp;gt;(RAND_MAX) - 1;&#xA;        sizeSquared = x*x + y*y;&#xA;    } while (sizeSquared &amp;gt;= 1.0);&#xA;&#xA;    result = x*sqrt(-2 * log(sizeSquared) / sizeSquared);&#xA;&#xA;    return result;&#xA;}&#xA;&#xA;double libSum(matrix&amp;lt;double,20,20&amp;gt; v, matrix&amp;lt;double, 20, 20&amp;gt; lib, int r,int c , double d, int index,std::vector&amp;lt;double&amp;gt; W)&#xA;{&#xA;    double sum = 0.0;&#xA;    for (auto k = index + 1; k &amp;lt; lib.nr()-1; ++k)&#xA;    {&#xA;        sum += ((d*v(k,c-1)*lib(k,c-1))/(1+d*lib(k,c-1)))*v(k,c-1) * lib(r, c-1)*(W[c] - W[c-1]);&#xA;    }&#xA;&#xA;    return sum;&#xA;}&#xA;&#xA;matrix&amp;lt;double&amp;gt; findDF(matrix&amp;lt;double&amp;gt; ell)&#xA;{&#xA;    matrix&amp;lt;double,20,20&amp;gt; Df;&#xA;    set_all_elements(Df, 0);&#xA;    double prod = 1.0;&#xA;&#xA;    //Need to execute the formula in the question&#xA;    for (auto c = 0;c &amp;lt; ell.nc(); ++c) &#xA;    {&#xA;        for (auto r = 0; r &amp;lt; ell.nr(); ++r)&#xA;        {&#xA;            //formula for D goes here&#xA;        }&#xA;    }&#xA;&#xA;&#xA;    return Df;&#xA;}&#xA;&#xA;void lmm()&#xA;{&#xA;    double dt = .25;&#xA;    std::vector&amp;lt;double&amp;gt; W(20);&#xA;    std::vector&amp;lt;double&amp;gt; T;&#xA;    matrix&amp;lt;double, 20, 20&amp;gt; L;&#xA;    W[0] = 0;&#xA;    for (auto c = 1; c &amp;lt; W.size(); ++c)&#xA;    {&#xA;        W[c] = W[c - 1] + sqrt(dt)*GetOneGaussianByBoxMuller();&#xA;    }&#xA;    for (auto i = 0; i &amp;lt; 20; ++i)&#xA;    {&#xA;        T.push_back(i*.25);&#xA;    }&#xA;&#xA;    set_all_elements(L, 0);&#xA;    set_colm(L, 0) = .003641; //3M Libor Rate on November 16,2015&#xA;    matrix&amp;lt;double,20,20&amp;gt; vol;&#xA;    set_all_elements(vol,.15);&#xA;&#xA;    for (auto c = 1; c &amp;lt; L.nc(); ++c)&#xA;    {&#xA;        for (auto r = c; r &amp;lt; L.nc()-1; ++r)&#xA;        {&#xA;            L(r, c) = L(r, c-1) - libSum(vol, L,r,c, .25, c,W) + vol(r,c-1) * L(r, c-1 )*(W[c] - W[c-1]);&#xA;        }&#xA;    }&#xA;&#xA;    for (auto c = 1; c &amp;lt; L.nc(); ++c)&#xA;    {&#xA;&#xA;        L(19, c) = L(19, c - 1)  + vol(19, c - 1) * L(19, c - 1)*(W[c] - W[c - 1]);&#xA;&#xA;    }&#xA;    std::ofstream outfile(&quot;LMMFlatVol.csv&quot;);&#xA;    outfile &amp;lt;&amp;lt; L &amp;lt;&amp;lt; std::endl;&#xA;    matrix&amp;lt;double&amp;gt; df = findDF(L);&#xA;}&#xA;&#xA;int main()&#xA;{&#xA;    lmm();&#xA;    return 0;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any help related to building the loop structure in the function findDf() is much appreciated.&lt;/p&gt;&#xA;" OwnerUserId="18159" LastActivityDate="2015-11-18T23:56:38.047" Title="Finding Discount Bond Matrix in LMM Model C++" Tags="&lt;fixed-income&gt;&lt;programming&gt;&lt;lmm&gt;&lt;discounting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21816" PostTypeId="1" AcceptedAnswerId="21820" CreationDate="2015-11-18T23:13:31.120" Score="1" ViewCount="17852" Body="&lt;p&gt;I understood the cumulative (aka unconditional) probability of default to be the probability of defaulting in a given period eg: between years 1 and 5. Further $\pi_{cumulative} = 1-e^{-\lambda*t}$ where lambda is a hazard rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understood the marginal (aka conditional) probability of default to be the probability of defaulting at time $T$ given survival up to that point. Further $\pi_{marginal} = \lambda e^{-\lambda*t}$ where lambda is a hazard rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Attempting to solve the following problem, I came up with a close but off value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Problem&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;1 year hazard rate = 0.1. What is the probability of surviving in the&#xA;  first year followed by defaulting in the second?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My solution was to calculate the marginal probability of default &#xA;= $0.1\lambda e^{0.1*2}$ = 8.19%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the given answer was 8.61% arrived at by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 year cumulative (also called unconditional) PD = 1 - e^(- hazard*time) = 9.516%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2 year cumulative (also called unconditional) PD = 1 - e^(- hazard*time) = 18.127% &lt;/p&gt;&#xA;&#xA;&lt;p&gt;solution - 18.127% - 9.516% = 8.611%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Is my approach incorrect or merely an approximation?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="9265" LastEditDate="2015-11-18T23:19:04.447" LastActivityDate="2019-09-05T10:07:28.667" Title="Cumulative vs marginal probability of default" Tags="&lt;risk&gt;&lt;default-probability&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21817" PostTypeId="2" ParentId="21815" CreationDate="2015-11-18T23:56:38.047" Score="0" Body="&lt;p&gt;I have every reason to believe this is a homework so I won't code it for you. In fact, your question is not totally clear, you haven't told us what are the rows and what are the columns. We know it's a 20x20 matrix, but what it's that supposed to be?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A common implementation is illustrated below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/t57iy.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/t57iy.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you can have a diagonal matrix where the columns are the times. Each column specifies a term structure. Note that this is not the only representation, but it makes perfect sense to me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To price a discounted bond, you would need the forward rates for each successive period up to the maturity of the bond. You will do it by the forward rates in the diagonal of the matrix. For example, L1(T(0)) is the LIBOR spot rate from today to T(1). L2(T(1)) is the LIBOR forward rate from T(1) to T(2).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To do it in C++, you will simply need to iterate the diagonal entries. This shouldn't be a problem for someone learning quantitative finance. Ask stack overflow.com if you're having issues.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2015-11-18T23:56:38.047" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="21818" PostTypeId="2" ParentId="18972" CreationDate="2015-11-19T00:04:14.687" Score="0" Body="&lt;p&gt;The whole machinery is needed to interchange the integral sign and the derivative. &lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2015-11-19T00:04:14.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21819" PostTypeId="2" ParentId="21806" CreationDate="2015-11-19T00:07:19.900" Score="1" Body="&lt;p&gt;Exercise frontier represents the decision boundary when you would exercise an option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what a exercise frontier would look like in American option. A more common name is &quot;exercise region&quot;. This is the region where it's optimal your option. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;L is the optimal exercise price. It's a convex function of maturity. Far away from maturity, the optimal price is significantly lower than K because we'd expect a deep in-the-money intrinsic value to compensate giving up the option rights early. The price approaches to the strike price as shown in the plot because you would have to be less selective for exercising (i.e: you don't have much time to wait).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The concept of exercise region is closely related to optimal stopping time, I recommend Sheve's Stochastic Calculus book if you're interested to learn more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/rZwZ3.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/rZwZ3.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="601" LastEditDate="2016-03-18T01:48:33.823" LastActivityDate="2016-03-18T01:48:33.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21820" PostTypeId="2" ParentId="21816" CreationDate="2015-11-19T00:47:16.770" Score="3" Body="&lt;p&gt;The question sounds like a conditional probability problem. However, note that, for conditional probability, people will generally say &lt;strong&gt;if survived to&lt;/strong&gt; or &lt;strong&gt;conditional on&lt;/strong&gt;. Here it says that &lt;strong&gt;survived in year one&lt;/strong&gt; and (i.e., followed by) &lt;strong&gt;will default in year two&lt;/strong&gt;. Then we should not treat this as a conditional or marginal probability.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on the above understanding, the probability can be computed as follows:&#xA;\begin{align*}&#xA;P(\tau &amp;gt;1 \ and \ \tau \le 2) &amp;amp;= P(1 &amp;lt; \tau \le 2)\\&#xA;&amp;amp;=P\big((\tau \le 2) \setminus(\tau \le 1) \big)\\&#xA;&amp;amp;=P(\tau \le 2) - P(\tau \le 1)\\&#xA;&amp;amp;= \big(1- e^{-2\lambda}\big) - \big(1- e^{-\lambda}\big)\\&#xA;&amp;amp;= 18.127\,\% - 9.516\,\% \\&#xA;&amp;amp;= 8.611\,\%.&#xA;\end{align*}&#xA;Here, $\tau$ is the default time. &lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-11-19T00:47:16.770" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="21821" PostTypeId="2" ParentId="8896" CreationDate="2015-11-19T02:14:06.367" Score="1" Body="&lt;p&gt;Take a look at pinkfish.  Disclaimer, I am the author.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://fja05680.github.io/pinkfish/&quot; rel=&quot;nofollow&quot;&gt;http://fja05680.github.io/pinkfish/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18341" LastActivityDate="2015-11-19T02:14:06.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21822" PostTypeId="1" CreationDate="2015-11-19T05:20:21.390" Score="1" ViewCount="59" Body="&lt;p&gt;I'm a Physicist but I'd like to know if there are some methods or models to predict the activity of the clients of a bank. I heard that banks are interested in this sort of analysis so I got curious about it. The thing is I don't know where to find information about this. Is there a name for such type of analysis? Can you recommend any good book to learn such methods?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT (19/11/15)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular I'm interested in methods to predict the activity of the clients, say we know their banking movements and we want to know &lt;em&gt;who of them&lt;/em&gt; will no longer be active the next month/year, for example.&lt;/p&gt;&#xA;" OwnerUserId="18340" LastEditorUserId="18340" LastEditDate="2015-11-19T18:02:56.000" LastActivityDate="2015-11-30T21:55:33.287" Title="Methods or models to predict activity of clients of a bank" Tags="&lt;modeling&gt;&lt;prediction&gt;&lt;banks&gt;&lt;methods&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21823" PostTypeId="2" ParentId="21812" CreationDate="2015-11-19T06:00:42.103" Score="3" Body="&lt;p&gt;At 5pm you get in your car and drive down a highway that has multiple exits: exit 1, exit 2, exit 3 etc. The objective is to get home a quickly as possible, i.e to Maximize -T, where T is the time you arrive home.. Let's say if you take Exit 1 you can be home at 6:30, if you take exit 2 you can be home at 6:15, if you take exit 3 6pm and if you take exit 4 at 6:45pm. Clearly the optimal solution is to take exit 3. The Snell function tells you the best you can do as you approach each exit, assuming you make the best choice from now on. So the Snell function for exits 1,2, and 3 has value 6pm, since you can make this time. However, if you miss exit 3 for some reason then the Snell function deteriorates and it will be 6:45 as you approach exit 4. If you miss that exit also it deteriorates again. So it is giving you an upper bound on how well you can do from now on (how quickly you can get home), assuming you do the best thing possible, i.e not make any further mistakes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Snell function is a supermartingale because it never improves, it either stays constant or gets worse, when you can no longer achieve a solution as good as you could have chosen previously. That's inherent in the sequential nature of the decisions and the fact that &quot;you can never go back&quot; to an earlier time.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2015-11-19T12:47:54.620" LastActivityDate="2015-11-19T12:47:54.620" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21824" PostTypeId="1" CreationDate="2015-11-19T06:09:59.000" Score="1" ViewCount="424" Body="&lt;p&gt;Fama-Macbeth does a two-step regression i.e a time-series and cross-sectional regression and we estimate betas and lambdas, so how does one predict based on these parameters, which one to choose?&lt;/p&gt;&#xA;" OwnerUserId="15145" LastActivityDate="2015-11-19T10:13:46.843" Title="For a Fama-Macbeth regression , How does one predict the returns based on the model?" Tags="&lt;regression&gt;&lt;factor-models&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21827" PostTypeId="2" ParentId="21824" CreationDate="2015-11-19T10:13:46.843" Score="3" Body="&lt;p&gt;Those are not predictive models. Fama-MacBeth just checks whether the model is valid unconditionally. &#xA;Chapter 12 from Cochrane book is a good reference.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-11-19T10:13:46.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21828" PostTypeId="2" ParentId="4924" CreationDate="2015-11-19T13:14:31.920" Score="3" Body="&lt;p&gt;Let's talk about your first equation: If you exercised your option early, you got this payoff. But if you are a rational investor you'd realize that this is less than what you would get if you would just sell your option itself. i.e. the payoff at time t will be more than S(t)-K because the option is worth more than that as it also has some time value. so you would not exercise it. The payoff at maturity is uncertain. It is true that it can be less than what it would be if you exercised the option early but the only argument is that the payoff from exercising early in itself is not the optimal payoff. you can get a better payoff by selling the option. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The argument is not that because it is not optimal to exercise early you should hold it to maturity. it just says if you want to do something about it before the maturity, instead of exercising just sell the option. &lt;/p&gt;&#xA;" OwnerUserId="18348" LastActivityDate="2015-11-19T13:14:31.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21829" PostTypeId="1" AcceptedAnswerId="21856" CreationDate="2015-11-19T13:41:50.647" Score="11" ViewCount="3881" Body="&lt;p&gt;What are open problems in mathematical finance that use fundamental concepts of mathematics (functional analysis, geometry and topology, algebra and number theory etc.) and not data-driven.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have read online and some answers include:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Stefan's problem for American Options&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The lack of an analog of Clark-Haussmann formula in deterministic calculus&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Explicit formulas for replicating strategies&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;among others. Could you suggest some really nice mathematical (and not statistical) ideas?&lt;/p&gt;&#xA;" OwnerUserId="18349" LastEditorUserId="848" LastEditDate="2015-11-19T17:22:36.013" LastActivityDate="2021-05-24T19:10:57.730" Title="open problems in mathematical finance" Tags="&lt;stochastic-processes&gt;&lt;research&gt;&lt;probability&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="10" CommunityOwnedDate="2015-11-19T17:21:10.670" ContentLicense="CC BY-SA 3.0" />
  <row Id="21830" PostTypeId="1" CreationDate="2015-11-19T15:00:08.553" Score="4" ViewCount="606" Body="&lt;p&gt;Foresight bias means we tend to over estimate the American option value. This we observe in other areas of statistics - e.g. in sample test almost always gives better prediction than out of sample tests in linear regression models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: is it known (theoretically or empirically) such bias is reduced by increasing sample size in least square monte carlo algorithm? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have done some simulation myself. From my simulation, at least for the models I have worked on, the answer seems to be yes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Presumably this is simply because bigger sample tends to mean the sampling distribution of the estimator has smaller variance blah blah blah?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any theoretical results or empirical studies on this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: foresight bias is also known as look-ahead bias&lt;/p&gt;&#xA;" OwnerUserId="3334" LastEditorUserId="26559" LastEditDate="2018-10-23T05:07:17.653" LastActivityDate="2018-10-23T05:07:17.653" Title="Foresight bias in least square monte carlo" Tags="&lt;monte-carlo&gt;&lt;american-options&gt;&lt;longstaff-schwartz&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="21833" PostTypeId="1" AcceptedAnswerId="21834" CreationDate="2015-11-19T17:13:47.173" Score="-1" ViewCount="206" Body="&lt;p&gt;The following problem is from the book by Hull. I did it but I am not sure it is right. I am hoping that somebody here can tell me if I did it right and if not where I went wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&#xA;Bob&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose that observations on a stock price(in dollars) at the end of each&#xA;of $15$ consecutive weeks are as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ 30.2, \,\,\, 32, \,\,\, 31.1, \,\,\, 30.1, \,\,\, 30.2, \,\,\, 30.3,$&#xA;$30.6, \,\,\, 33.0, \,\,\, 32.9, \,\,\, 33.0, \,\,\, 33.5,$&#xA;$ \,\,\, 33.5, \,\,\,   33.7, \,\,\, 33.5, \,\,\, 33.2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Estimate the stock price volatility. What is the standard error of your&#xA;estimate?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Answer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$n + 1$ is the number of observations. $S_i$ is the value of the stock at&#xA;the end of the ith interval, $\tau$ is the length of the intervals&#xA;in years and $\hat{ {\sigma} }$ is a good estimate of the&#xA;standard deviation of $u_i$. The standard error of this estimate is about&#xA;$\frac{ \hat{ \sigma} }{ \sqrt{2n} }$.  The relevant formulas are:&#xA;\begin{eqnarray*}&#xA;u_i &amp;amp;=&amp;amp; \ln{( \frac{u_i}{u_{i-1}} )} \\&#xA;s &amp;amp;=&amp;amp;&#xA;    \sqrt{ \frac{1}{n-1} \sum_{i=1}^{i=n} {(u_i - \bar u)^2} } \\&#xA;\hat { \sigma } &amp;amp;=&amp;amp; \frac{s}{\sqrt{\tau} } \\&#xA;\end{eqnarray*}&#xA;Note: $\bar u$ is the mean of the $u_i$ variables.&#xA;\newline&#xA;In this case, we have:&#xA;\begin{eqnarray*}&#xA;n &amp;amp;=&amp;amp; 14 \\&#xA;u_1 &amp;amp;=&amp;amp; \ln {(\frac{32} {30.2} )} = 0.057894 \\&#xA;u_2 &amp;amp;=&amp;amp; \ln {(\frac{31.1} {32} )} = -0.02852 \\&#xA;u_3 &amp;amp;=&amp;amp; \ln {(\frac{30.1} {31.1} )} = -0.0326826 \\&#xA;u_4 &amp;amp;=&amp;amp; \ln {(\frac{30.2} {30.1} )} = 0.003316 \\&#xA;u_5 &amp;amp;=&amp;amp; \ln {(\frac{30.3} {30.2} )} = 0.003305 \\&#xA;u_6 &amp;amp;=&amp;amp; \ln {(\frac{30.6} {30.3} )} = 0.009852 \\&#xA;u_7 &amp;amp;=&amp;amp; \ln {(\frac{33 } {30.6} )} = 0.075507 \\&#xA;u_8 &amp;amp;=&amp;amp; \ln {(\frac{32.9} {33} )} = -0.003034 \\&#xA;u_9 &amp;amp;=&amp;amp; \ln {(\frac{33 } {32.9} )} = 0.003034 \\&#xA;u_{10} &amp;amp;=&amp;amp; \ln {(\frac{33.5 } {33} )} = 0.0150379 \\&#xA;u_{11} &amp;amp;=&amp;amp; \ln {(\frac{ 33.5 } {33.5} )} = 0 \\&#xA;u_{12} &amp;amp;=&amp;amp; \ln {(\frac{33.7 } {33.5} )} = 0.005952 \\&#xA;u_{13} &amp;amp;=&amp;amp; \ln {(\frac{33.5} {33.7} )} = - 0.0059524 \\&#xA;u_{14} &amp;amp;=&amp;amp; \ln {(\frac{33.2 } {33.5} )} = - 0.008995 \\&#xA;\end{eqnarray*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray*}&#xA;\sum_{i=1}^{i=5} {u_i} &amp;amp;=&amp;amp; 0.003312 \\&#xA;\sum_{i=6}^{i=10} {u_i} &amp;amp;=&amp;amp; 0.1064649 \\&#xA;\sum_{i=11}^{i=14} {u_i} &amp;amp;=&amp;amp; -0.0089954 \\&#xA;\sum_{i=0}^{i=14} {u_i} &amp;amp;=&amp;amp; 0.003312 + 0.1064649 -0.0089954 = 0.100781 \\&#xA;\bar u &amp;amp;=&amp;amp; \frac{1}{n} \sum_{i=1}^{i=n} { u_i } =&#xA;    \frac{1}{14} { \sum_{i=1}^{i=14} { u_i } } = \frac{0.100781}{14} \\&#xA;\bar u &amp;amp;=&amp;amp; 0.007198 \\&#xA;s &amp;amp;=&amp;amp; \sqrt{ \frac{1}{14-1} \sum_{i=1}^{i=14} {(u_i - 0.007198)^2} } \\&#xA;(u_1 - 0.007198)^2 &amp;amp;=&amp;amp; 0.002570 \\&#xA;(u_2 - 0.007198)^2 &amp;amp;=&amp;amp; 0.001275 \\&#xA;(u_3 - 0.007198)^2 &amp;amp;=&amp;amp; 0.001590 \\&#xA;(u_4 - 0.007198)^2 &amp;amp;=&amp;amp; 0.0000151 \\&#xA;(u_5 - 0.007198)^2 &amp;amp;=&amp;amp; 0.0000152 \\&#xA;(u_6 - 0.007198)^2 &amp;amp;=&amp;amp; 0.0000070  \\&#xA;(u_7 - 0.007198)^2 &amp;amp;=&amp;amp;  0.0046661 \\&#xA;(u_8 - 0.007198)^2 &amp;amp;=&amp;amp; 0.0001047  \\&#xA;(u_9 - 0.007198)^2 &amp;amp;=&amp;amp; 0.0000173 \\&#xA;(u_{10} - 0.007198)^2 &amp;amp;=&amp;amp; 0.0000615 \\&#xA;(u_{11} - 0.007198)^2 &amp;amp;=&amp;amp; 0.0000518 \\&#xA;(u_{12} - 0.007198)^2 &amp;amp;=&amp;amp; 0.0000016  \\&#xA;(u_{13} - 0.007198)^2 &amp;amp;=&amp;amp; 0.0001729 \\&#xA;(u_{14} - 0.007198)^2 &amp;amp;=&amp;amp; 0.0002622  \\&#xA;\end{eqnarray*}&#xA;\begin{eqnarray*}&#xA;\sum_{i=1}^{i=5} {(u_i - 0.007198)^2} &amp;amp;=&amp;amp; 0.0054653 \\&#xA;\sum_{i=6}^{i=10} {(u_i - 0.007198)^2} &amp;amp;=&amp;amp; 0.0048566 \\&#xA;\sum_{i=11}^{i=14} {(u_i - 0.007198)^2} &amp;amp;=&amp;amp; 0.0004885 \\&#xA;\sum_{i=1}^{i=14} {(u_i - 0.007198)^2} &amp;amp;=&amp;amp;&#xA;    0.0054653 + 0.0048566 + 0.0004885 = 0.0108104 \\&#xA;s &amp;amp;=&amp;amp; \sqrt{ \frac{1}{14-1} (0.0108104) } =&#xA;    \sqrt{ 0.0108104 } \\&#xA;s &amp;amp;=&amp;amp; 0.1039731 \\&#xA;\end{eqnarray*}&#xA;I am figuring that there are $52.1$ weeks in a year.&#xA;\begin{eqnarray*}&#xA;\tau &amp;amp;=&amp;amp; \frac{14}{52.1} = 0.268714 \\&#xA;\hat { \sigma } &amp;amp;=&amp;amp; \frac{s}{\sqrt{\tau} } =&#xA;    \frac{  0.1039731 } { \sqrt{  0.268714 } } = 0.200 \\&#xA;\end{eqnarray*}&#xA;My estimate of the volatility is $0.200$ and the standard error of this&#xA;estimate is $\frac{.200}{\sqrt{2(14)}} = 0.377$.&lt;/p&gt;&#xA;" OwnerUserId="18353" LastActivityDate="2015-11-19T17:40:03.130" Title="Calculating the volatility for Black Scholes" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;time-series&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21834" PostTypeId="2" ParentId="21833" CreationDate="2015-11-19T17:40:03.130" Score="0" Body="&lt;p&gt;Thr second sum should be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sum_{i=6}^{10}u_i = 0.10039773$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This gives a mean of $0.0067648$ and a standard deviation of $\sigma=.028836$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To avoid these errors you should use something to automate your calculations. Something like a spreadsheet.&lt;/p&gt;&#xA;" OwnerUserId="3371" LastActivityDate="2015-11-19T17:40:03.130" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21836" PostTypeId="1" CreationDate="2015-11-19T18:53:15.870" Score="2" ViewCount="611" Body="&lt;p&gt;I'm interested in estimating what my profit/loss would be for continuously gamma scalping a delta hedged option over the course of one day, using historical intra-day price data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found an equation for calculating the profit and loss for a delta hedged option from. &quot;option Trading Volatility: Trading Volatility, Correlation, Term Structure and Skew&quot;Apr 24 2014&#xA;by Colin Bennett&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the equation is  P/L = 1/2 * GAMMA * (REALIZED^2 - IMPLIED^2)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For use in this equation, I am interested in calculating realized volatility over the course of a day, I have historical intra-day tick data mined from bloomberg to help obtain it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have read that traditional/classical standard deviation formulas are not accurate measures of intra-day realized volatility, because volatility changes significantly over the course of day.  How can you take changing intra-day volatility into an account to get a more accurate calculation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once I have the intra-day historical volatility from a more advanced method, can the number I obtain still be used in the equation at the start of my post? Can I compare it to the Implied Vol. for an option, obtained from bloomberg?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am new to these ideas, so I'd appreciate answers given low assumptions about my knowledge base. Read a couple options books + bachelors level knowledge in mathematics/stats. Links/Books recommendations are also appreciated.&lt;/p&gt;&#xA;" OwnerUserId="18357" LastActivityDate="2018-12-23T13:02:20.493" Title="Comparing Implied Vol. to Historical Vol. using intraday data" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;intraday&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21839" PostTypeId="1" CreationDate="2015-11-19T23:30:37.967" Score="-1" ViewCount="460" Body="&lt;p&gt;Any ideas on valuation of IRS swaption on a swap with 0 year tenor?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, we have a 5 year swaption, on expiration it is cash settled; the underlying swap tenor is 0 years with excercise and maturity set on the same day.&lt;/p&gt;&#xA;" OwnerUserId="18360" LastActivityDate="2015-11-22T14:44:00.440" Title="Swaption on a swap with 0 year tenor" Tags="&lt;option-pricing&gt;&lt;interest-rates&gt;&lt;swaps&gt;&lt;swaption&gt;&lt;irs&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21840" PostTypeId="2" ParentId="18605" CreationDate="2015-11-20T01:38:26.240" Score="2" Body="&lt;p&gt;A similar problem arises in comparing private equity investments (which involve cash inflows and outflows) to the performance of a benchmark such as the S&amp;amp;P500.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The simplest method available, the Long Nickels PME, does what you say, it assumes that the same cash flows that occur in the PE investment are also made in the benchmark. The problem with this method is exactly what you mention: the amount theoretically invested in the benchmark can go negative if you withdraw a large amount of cash from your portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several solutions available in the literature, the one I would recommend is called the Kaplan Schoar PME. It is a ratio of discounted cash flows, such that if greater than 1 you are outperforming the benchmark, and if less than 1 you are underperforming. In the numerator you discount (using the rates of return of the benchmark) the cash outflows from your portfolio, and in the denominator you discount the cash inflows into your portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These methods are described in the Wikipedia article Public Market Equivalent PME &lt;a href=&quot;https://en.wikipedia.org/wiki/Public_Market_Equivalent&quot; rel=&quot;nofollow&quot;&gt;link&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A theoretical justification of the Kaplan Schoar PME method can be found in a recent article by Sorensen and Jagannathan &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2347972&quot; rel=&quot;nofollow&quot;&gt;SSRN link&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2015-11-20T02:34:34.967" LastActivityDate="2015-11-20T02:34:34.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21842" PostTypeId="1" CreationDate="2015-11-20T04:08:03.833" Score="6" ViewCount="1346" Body="&lt;p&gt;For &lt;a href=&quot;https://en.wikipedia.org/wiki/Stochastic_volatility&quot; rel=&quot;noreferrer&quot;&gt;stochastic volatility&lt;/a&gt; models like Heston, it seems like the standard approach is to calibrate the models from option prices.  This seems a bit like a chicken and an egg problem -- wouldn't we prefer a model, based only on historical data, that we can use to price options?  I don't see that as frequently.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the Heston model, I see the method of maximum liklihood used to calibrate against historical data.  However, this requires that the conditional probability distribution be derived (which for the Heston model is widely available).  For other more complicated models, this seems to get more complicated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there other approaches, other than maximum likelihood or fit to observed options prices, used to calibrate stochastic volatility models?  &lt;/p&gt;&#xA;" OwnerUserId="17412" LastActivityDate="2015-11-24T22:10:39.730" Title="Calibrating stochastic volatility model from price history (not option prices)" Tags="&lt;volatility&gt;&lt;stochastic-volatility&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21843" PostTypeId="2" ParentId="18537" CreationDate="2015-11-20T06:41:57.263" Score="4" Body="&lt;p&gt;The state of the art is &lt;a href=&quot;http://arxiv.org/abs/1510.04295&quot; rel=&quot;nofollow noreferrer&quot;&gt;Asymptotic Lower Bounds for Optimal Tracking: a Linear Programming Approach&lt;/a&gt; by Jiatu Cai, Mathieu Rosenbaum, Peter Tankov. Hence the references of this paper are the ones to read.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the paper, they explain how you have to consider the prefactors (your $\lambda$ and $\Theta$) to be able to stay close to a target portfolio trajectory. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;They also explain how most control problems can be (in this scope) redefined as a target following one. It means you can define an equivalent ideal portfolio, and try to follow it according to their results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[EDIT] Following a comment, I agree this paper is reasonably complex. You can go back to &lt;a href=&quot;http://faculty.haas.berkeley.edu/garleanu/DynTrad.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Dynamic Trading with Predictable Returns and Transaction Costs&lt;/a&gt;, by Nicolae Garleanu and Lasse Pedersen. They show a simple version of this very generic problem. In terms of rewriting the problem, you will read that an important step is to express the maximization not in terms of weights $w$ but in terms of &lt;em&gt;trades&lt;/em&gt; $\Delta w$ that will lead to a transition from $w_0$ to $w_0 + \Delta w$, then you can write quite easily the transaction costs (related to $\Delta w$ and not to $w$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For you first example $\max_w r^T w - \lambda w^T \Sigma w$ u.c. $l_b\leq A w\leq u_b$ should for instance (following Garleanu-Pederson approach) be rewritten as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\max_{\Delta w} r^T (w_0+\Delta w) - T_\mbox{costs}(\Delta w)- \lambda (w_0+\Delta w)^T \Sigma (w_0+\Delta w),$$&#xA;$$\mbox{u.c.}\quad l_b - A w_0\leq A \Delta w\leq u_b - A w_0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When the ''&lt;em&gt;transaction costs&lt;/em&gt;'' term is non linear (i.e. when it includes a &lt;em&gt;market impact term&lt;/em&gt;), this is a different optimization program.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2018-06-24T21:34:48.083" LastActivityDate="2018-06-24T21:34:48.083" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="21844" PostTypeId="1" AcceptedAnswerId="24361" CreationDate="2015-11-20T08:52:36.163" Score="3" ViewCount="1718" Body="&lt;p&gt;I know that when it comes to delta, you would calculate your position delta (of a stock position) as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;option delta * position size * 100&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For example if I am short 15 calls with a delta of 0.2, my position delta would be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-0.2 * 15 * 100 = -300&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That figure of -300 shows how my position is impacted by directional movements in the underlying. That is why I don't just look at the 0.2 delta, I need to change it to my position delta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;reference: &lt;a href=&quot;http://www.optionsplaybook.com/managing-positions/position-delta/&quot; rel=&quot;nofollow&quot;&gt;http://www.optionsplaybook.com/managing-positions/position-delta/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, do you do the same thing with vega, theta and gamma? I presume you do,...but I am new enough to options such that I need to ask.&lt;/p&gt;&#xA;" OwnerUserId="16304" LastActivityDate="2016-07-20T06:41:05.353" Title="Option greeks vs Position greeks" Tags="&lt;options&gt;&lt;greeks&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21847" PostTypeId="1" AcceptedAnswerId="21855" CreationDate="2015-11-20T14:37:09.783" Score="0" ViewCount="438" Body="&lt;p&gt;If I use mean variance optimisation to create an efficient portfolio with a target expected return of 20% in a year's time and find that the actual return at the end of the year was 24%, what explains the deviation from the target? Is it just a matter of rebalancing?&lt;/p&gt;&#xA;" OwnerUserId="3351" LastActivityDate="2015-11-21T00:53:17.877" Title="Mean variance efficient portfolios and target returns" Tags="&lt;modern-portfolio-theory&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21849" PostTypeId="1" AcceptedAnswerId="21850" CreationDate="2015-11-20T17:34:29.900" Score="5" ViewCount="5473" Body="&lt;p&gt;I'm thrown off by the term marginal probability of default. I've seen it defined by some authors as synonymous term for conditional probability of default&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;conditional probability of default:&lt;/strong&gt; probability of defaulting given no default yet. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which is solved for as such:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$PD_{conditional} = \frac{P(default\_anytime\_before\_period\_t1) - P(default\_in\_period\_t0)}{1-P(default\_in\_period\_t0)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've also seen it defined as:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The default time density function or marginal default probability is&#xA;  the derivative of the default time distribution w.r.t. t:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$\frac{\partial}{\partial t}P[t^*&amp;lt;t]=F'(t) = \lambda e^{-\lambda t}$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Where &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$t^*$ is the time of default&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$t$ is the point in time we are observing from&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\lambda$ is the hazard rate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$F(t)$ = cumulative default time distribution = $P[t^* &amp;lt;t] = 1-e^{-\lambda}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this mean that $\lambda e^{-\lambda t}$ is an approximation of the conditional probability of default?&lt;/p&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="9265" LastEditDate="2015-11-20T17:49:56.307" LastActivityDate="2015-11-20T21:04:12.480" Title="Is marginal probability of default the same as conditional probability of default?" Tags="&lt;risk&gt;&lt;default-probability&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21850" PostTypeId="2" ParentId="21849" CreationDate="2015-11-20T18:18:45.267" Score="4" Body="&lt;p&gt;Based on your definition, they are certainly not the same. Generally, the marginal default probability is the probability that the default happens in a given time period, such as $[t, t+\Delta]$, that is, $P(t &amp;lt; \tau \le t+\Delta)$. Here, $\tau$ is the default time. See Chapter 10 of the book &lt;a href=&quot;http://www.amazon.ca/Counterparty-Credit-Risk-Value-Adjustment/dp/1118316673&quot; rel=&quot;nofollow&quot;&gt;Counterparty Credit Risk and Credit Value Adjustment&lt;/a&gt; for definitions.&#xA;Note that&#xA;\begin{align*}&#xA;P(t &amp;lt; \tau \le t+\Delta) &amp;amp;=P(\tau \le t+\Delta) - P(\tau \le t) \\&#xA;&amp;amp;\approx \Delta \frac{\partial P(\tau \le t)}{\partial t}.&#xA;\end{align*}&#xA;Then, people treat the marginal default probability, over a small time period, as the density $\frac{\partial P(\tau \le t)}{\partial t}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the conditional default probability is defined by&#xA;\begin{align*}&#xA;P(\tau \le t_1 \mid \tau &amp;gt; t) &amp;amp;= \frac{P\big((\tau \le t_1) \cap (\tau &amp;gt;t)\big) }{P(\tau &amp;gt;t)}\\&#xA;&amp;amp;=\frac{P(\tau \le t_1) - P(\tau \le t) }{1-P(\tau \le t)},&#xA;\end{align*}&#xA;for $t_1 &amp;gt; t \ge 0$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $t_1 = t + \Delta$, for $\Delta$ sufficiently small. Then&#xA;\begin{align*}&#xA;\frac{1}{\Delta} P(\tau \le t + \Delta \mid \tau &amp;gt; t) &amp;amp;= \frac{P(\tau \le t + \Delta) - P(\tau \le t) }{\Delta \big (1-P(\tau \le t)\big)}\\&#xA;&amp;amp;\approx \frac{1}{1-P(\tau \le t)} \frac{\partial P(\tau \le t)}{\partial t}\\&#xA;&amp;amp;=-\frac{\partial \ln \big[1-P(\tau \le t)\big]}{\partial t}\\&#xA;&amp;amp;=\lambda.&#xA;\end{align*}&#xA;In fact, the hazard rate is formally defined by&#xA;\begin{align*}&#xA;\lambda = \lim_{\Delta \rightarrow 0} \frac{1}{\Delta} P(\tau \le t + \Delta \mid \tau &amp;gt; t).&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In literatures, the terms may be misused. Then, we need to pay attention to the specific definitions.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-11-20T21:04:12.480" LastActivityDate="2015-11-20T21:04:12.480" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="21851" PostTypeId="1" CreationDate="2015-11-20T18:21:27.257" Score="4" ViewCount="170" Body="&lt;p&gt;Assume you have two stocks $S$ and $P$ so that at initial time $t = 0$: $S_0 &amp;gt; P_0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You bought an option which pays off $S_T - P_T$ as long as $S_t &amp;gt; P_t$ through the time $0 &amp;lt; t &amp;lt; T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What would the price of such option be?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;*I am looking for a non-arbitrage argument avoiding any specific distribution assumptions (log-normal, normal etc) if possible.&lt;/p&gt;&#xA;" OwnerUserId="18370" LastEditorUserId="467" LastEditDate="2015-11-22T11:37:35.780" LastActivityDate="2015-11-23T16:55:29.347" Title="How to price a path dependent exchange option using?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21852" PostTypeId="1" CreationDate="2015-11-20T19:10:34.693" Score="13" ViewCount="1110" Body="&lt;p&gt;Fellow Quants,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose you have a credit scoring model that is developed without the aid of statistics, because (unfortunately) there is no historical default/loss data in your portfolio. The independent variables and weights of those variables are selected based entirely on expert judgment, and the final scores are determined as the weighted sum of the variables for each loan. i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Score_j =\sum_{i=1}^n w_i x_{ij} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a very simple model, and seemingly a quite popular framework to use in the absence of loss/default data required to perform statistically-driven model development.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OSFI outlines some general principles for validating a risk rating system &lt;a href=&quot;http://www.osfi-bsif.gc.ca/eng/docs/val_risk_ja06.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;, however, many of the tests require sufficient loss/default to assess the model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would you approach model validation for an expert judgment model in the absence of default/loss history? What type of testing can be performed when there are no &quot;high credit risk&quot;(e.g. defaults or losses) observations in your dataset?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Related question on developing a credit scoring model:&#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/18811/expert-system-for-credit-scoring&quot;&gt;Expert System for Credit Scoring&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Related question on model validation criteria: &lt;a href=&quot;https://quant.stackexchange.com/questions/176/model-validation-criteria&quot;&gt;Model Validation Criteria&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;EDIT: The scope of validation I have been able to come up with is (for the most part) qualitative. This would include a methodology review, assessment of the assumptions and limitations, and benchmarking (e.g. comparison of final variables against industry standard variables). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an obvious component of validation that I am omitting?&lt;/p&gt;&#xA;" OwnerUserId="6437" LastEditorUserId="36636" LastEditDate="2020-06-15T18:52:08.467" LastActivityDate="2020-06-15T18:52:08.467" Title="Validating a Credit Scoring Model without Data" Tags="&lt;models&gt;&lt;credit&gt;&lt;credit-scoring&gt;&lt;validation&gt;&lt;model-validation&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="21853" PostTypeId="1" CreationDate="2015-11-20T21:22:15.357" Score="3" ViewCount="558" Body="&lt;p&gt;The approximation to calculate CVA as a spread is $CVA = Spread * Expected$  $Exposure$. I assume this means the counterparty's spread over a proxy for the risk free rate such as LIBOR or OIS. Is this an incorrect understanding?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I came across an FRM exam practice question created by GARP (the entity that runs the exam) which gave a scenario where both the bank and its counterparty experienced spread widenings due to rating downgrades. Where the banks spread went from 20bps to 150bps and its counterparty's spread went from 130bps to 170bps. The CVA a was given by (170-150)*Expected Exposure and was a reduction from the previous CVA of (130-20)*Expected Exposure. (Note, there is an assumption to ignore DVA)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This doesn't make sense to me. The counterparty to the bank suffered a downgrade and a resulting spread widening yet the CVA charge decreases?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't share the exact question, but here is essentially what it was&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;This was the question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Foo Company is a frequent user of swaps with Acme Bank. Acme bank was&#xA;  recently downgraded from a rating of AA- to A+ and at the same time,&#xA;  Foo Company was downgraded from A to A-. As a result of the&#xA;  downgrades, the credit spread for Acme bank increased from 20bps to&#xA;  150bps, and the credit spread for  Foo Company increased from 130bps&#xA;  to 170 bps.   The question asks what realistic changes the&#xA;  counterparties can request to their CVA charge, given a set of&#xA;  multiple choice.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The given answer was:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Because Foo Company has a lower credit rating than the bank, it would&#xA;  typically &lt;strong&gt;&lt;em&gt;pay a CVA charge which would be a function of the&#xA;  relative credit spreads between the two entities&lt;/em&gt;&lt;/strong&gt;. As the the credit&#xA;  spread between the two has narrowed after the downgrade to only 20bps, Foo Company&#xA;  can request a reduction in their CVA charge.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="9265" LastEditDate="2015-11-22T16:00:35.610" LastActivityDate="2017-01-24T14:00:05.087" Title="CVA using difference between 2 counterparty's spreads" Tags="&lt;risk&gt;&lt;credit-risk&gt;&lt;cva&gt;" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21854" PostTypeId="2" ParentId="21851" CreationDate="2015-11-20T21:36:52.563" Score="1" Body="&lt;p&gt;The option payoff at maturity $T$ is defined by&#xA;\begin{align*}&#xA;(S_T-P_T)1_{\left(\inf_{0 \le t &amp;lt;T}\frac{S_t}{P_t}\right) &amp;gt; 1}.&#xA;\end{align*}&#xA;Let $Q$ be the risk-neutral probability measure and $E$ be the corresponding expectation operator. Let $Q_p$ be a probability measure defined by&#xA;\begin{align*}&#xA;\frac{dQ_p}{dQ}\big|_t = \frac{P_t}{e^{rt} P_0}.&#xA;\end{align*}&#xA;Moreover, let $E_p$ be the corresponding expectation operator.&#xA;Then the option value can be computed by&#xA;\begin{align*}&#xA;e^{-rT}E\left((S_T-P_T)1_{\left(\inf_{0 \le t &amp;lt;T}\frac{S_t}{P_t}\right) &amp;gt; 1} \right) &amp;amp;= e^{-rT}E_p\left(\left(\frac{dQ_p}{dQ}\big|_T\right)^{-1}(S_T-P_T)1_{\left(\inf_{0 \le t &amp;lt;T}\frac{S_t}{P_t}\right) &amp;gt; 1} \right)\\&#xA;&amp;amp;=P_0 E_p\left(\left(\frac{S_T}{P_T}-1\right)1_{\left(\inf_{0 \le t &amp;lt;T}\frac{S_t}{P_t}\right) &amp;gt; 1} \right),&#xA;\end{align*}&#xA;which can be treated as a down-and-out barrier call option, assuming that $S_t/P_t$ is log-normally distributed under the measure $Q_p$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that, under $Q_p$, the process $\{S_t/P_t \mid t \geq 0\}$ is a martingale, that is, we can treat $S_t/P_t$ as an asset process with zero interest and zero dividend. Using the down-and-out barrier call option formula in &lt;a href=&quot;http://www.amazon.ca/Options-Futures-Other-Derivatives-9th/dp/0133456315&quot; rel=&quot;nofollow&quot;&gt;John Hull&lt;/a&gt;, we obtain that&#xA;\begin{align*}&#xA;E_p\left(\left(\frac{S_T}{P_T}-1\right)1_{\left(\inf_{0 \le t &amp;lt;T}\frac{S_t}{P_t}\right) &amp;gt; 1} \right) = \frac{S_0}{P_0}-1.&#xA;\end{align*}&#xA;That is, the option price is $S_0-P_0$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-11-23T15:12:05.453" LastActivityDate="2015-11-23T15:12:05.453" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21855" PostTypeId="2" ParentId="21847" CreationDate="2015-11-21T00:47:14.373" Score="0" Body="&lt;p&gt;If you form a portfolio at time $t$, in which the weights are chosen to get an expected return of 20%, you will certainly not get exactly 20% at $t+1$. If that was the case, you would not bear any risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you do is that you form a portfolio that will get a 20% return in expectation (on average if you want), you may end-up with more or less than that in the end.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is just a matter of expected value and realized value of a random variable.&lt;/p&gt;&#xA;" OwnerUserId="18053" LastEditorUserId="18053" LastEditDate="2015-11-21T00:53:17.877" LastActivityDate="2015-11-21T00:53:17.877" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21856" PostTypeId="2" ParentId="21829" CreationDate="2015-11-21T08:00:32.143" Score="13" Body="&lt;p&gt;If you want to address interesting problems that are interesting for financial mathematics, I do not believe you have the good list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Pricing.&lt;/strong&gt;&#xA;For instance, most of explicit formulas for pricing that are not available yet will never be. In this direction, you should have a look at &lt;strong&gt;simulation techniques&lt;/strong&gt;. See for instance &lt;a href=&quot;https://books.google.fr/books?id=sIfNBQAAQBAJ&amp;amp;lpg=PA431&amp;amp;ots=i6TZ-wp7-b&amp;amp;dq=monte%20carlo%20particles%20simulation%20non%20linear%20finance%20touzi&amp;amp;hl=fr&amp;amp;pg=PP1#v=onepage&amp;amp;q&amp;amp;f=false&quot;&gt;Nonlinear Option Pricing&lt;/a&gt;. Interesting convergences remains to be proved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Stochastic Calculus.&lt;/strong&gt; &#xA;In terms of extending the reach of stochastic calculus (like Malliavin did some years ago), you can have a look at the &lt;strong&gt;Ito-Tanaka Trick&lt;/strong&gt; and its extensions. It gives deep clues about the regularity of stochastic functions. See for instance &lt;a href=&quot;http://arxiv.org/abs/1507.05579&quot;&gt;Stochastic regularization effects of semi-martingales on random functions&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Mean-Field Games.&lt;/strong&gt;&#xA;It you like PDE and / or probabilities, you should definitely read papers on MFG. They are great. Then have been mainly introduced by two great mathematicians (PL Lions and JM Lasry). See their seminal &lt;a href=&quot;http://www.math.uni-muenster.de/u/burger/teaching/seminarkollektiv/lasrylions.pdf&quot;&gt;Mean Filed Game&lt;/a&gt; paper. If you want to read a &quot;simple&quot; paper (restricted on 1st orders PDE), have a look at &lt;a href=&quot;http://arxiv.org/abs/1401.1789&quot;&gt;Mean field games systems of first order&lt;/a&gt;. &#xA;For a probabilistic viewpoint, see &lt;a href=&quot;http://arxiv.org/abs/1210.5780&quot;&gt;Probabilistic Analysis of Mean-Field Games&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Optimal Transport.&lt;/strong&gt;&#xA;For BSDE and transport big fans, &lt;em&gt;martingale transport&lt;/em&gt; is your topic. Have a look at &lt;a href=&quot;http://arxiv.org/abs/1507.00671&quot;&gt;Complete Duality for Martingale Optimal Transport on the Line&lt;/a&gt;. &lt;a href=&quot;http://arxiv.org/find/math/1/au:+Touzi_N/0/1/0/all/0/1&quot;&gt;Nizar Touzi&lt;/a&gt; wrote a lot of papers in the area.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Transaction Costs.&lt;/strong&gt;&#xA;Solving investment problems with transaction costs give birth to interesting situations. It is the less generic topic of my list, but I like it a lot. The bibliography of &lt;a href=&quot;http://arxiv.org/abs/1510.04295&quot;&gt;Asymptotic Lower Bounds for Optimal Tracking: a Linear Programming Approach&lt;/a&gt; will give you an good overview of papers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;More Details.&lt;/em&gt;&#xA;If you want to find yourself interesting topics, you can have a look at the program of the &lt;a href=&quot;https://sites.google.com/site/seminairebachelierparis/programme-2015-2016&quot;&gt;Louis Bachelier seminar&lt;/a&gt; (a reference in math finance for reasearchers).&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2015-11-21T08:00:32.143" CommentCount="0" CommunityOwnedDate="2015-11-21T08:00:32.143" ContentLicense="CC BY-SA 3.0" />
  <row Id="21857" PostTypeId="2" ParentId="2205" CreationDate="2015-11-21T10:46:25.473" Score="0" Body="&lt;p&gt;Systematic risk and unsystematic risk&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) when total risk assume to be equal to standard deviation of portfolio&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Systematic risk= B × standard deviation of market portfolio&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And unsystematic risk = standard deviation of portfolio - syetamatic risk&#xA;( i.e total risk - systamatic risk)&lt;/p&gt;&#xA;" OwnerUserId="18374" LastEditorUserId="16472" LastEditDate="2015-11-22T18:17:12.857" LastActivityDate="2015-11-22T18:17:12.857" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21858" PostTypeId="1" CreationDate="2015-11-21T11:59:09.120" Score="2" ViewCount="72" Body="&lt;p&gt;Is there a formula to derive an efficient portfolio to maximise the return, x'mu, for a given risk, x'S x (where x are the portfolio coefficients, mu is the mean return for each asset and S is the var-cov matrix of the assets) ?&lt;/p&gt;&#xA;" OwnerUserId="18226" LastActivityDate="2015-11-21T12:39:56.017" Title="efficient portfolio with given risk" Tags="&lt;risk&gt;&lt;portfolio&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21859" PostTypeId="1" AcceptedAnswerId="21861" CreationDate="2015-11-21T12:12:21.903" Score="1" ViewCount="117" Body="&lt;p&gt;I am trying to computing the price of an option at time $t$, with payoff $X = \frac{S_{T_2}}{S_{T_1}}$, at time $T_2$, where $t &amp;lt; T_1 &amp;lt; T_2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here how I compute it:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the forward measure $Q_{T_2}$ with settlement date $T_2$, price at $t$ is&#xA;$$P_{t,T_2}E_{Q_{T_2}}\left(\frac{S_{T_2}}{S_{T_1}}| \mathcal{F}_t\right),$$&#xA;where $P_{t,T_2}$ is the price of a discount bond at $t$ maturing at $T_2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the law of iterated expectation, and using the fact that price process $h_t/P_{t,T2}$ is a martingale for any contingent claim with payoff $H$ at $T_2$, I get,&#xA;$$P_t = P_{t,T_2}E_{Q_{T_2}}\left(\frac{1}{S_{T_1}} \frac{S_{T_1}}{P_{T_1,T2}}| \mathcal{F}_t\right) = P_{t,T_2} E_{Q_{T_2}}\left(\frac{1}{P_{T_1,T2}}| \mathcal{F}_t\right) =P_{t,T_2} \frac{1}{P_{t,T2}} =1 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I find this result rather surprising (maybe because it is wrong?). If anybody has another answer or can come up with an intuitive justification of such result. I would be glad to get some insight.&lt;/p&gt;&#xA;" OwnerUserId="16981" LastEditorUserId="16981" LastEditDate="2015-11-21T12:34:28.043" LastActivityDate="2015-11-21T15:56:44.970" Title="How to Calculate Return Option with Forward Measure" Tags="&lt;option-pricing&gt;&lt;risk-neutral-measure&gt;&lt;forward&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21860" PostTypeId="2" ParentId="21858" CreationDate="2015-11-21T12:39:56.017" Score="2" Body="&lt;p&gt;Yes, this is the simple markowitz optimization. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Denote $\Sigma$ as the variance-covariance matrix of returns and $\bar{R}$ as a vector of expected returns.  The tangency portfolio weights are given by $\omega_{tan}=\frac{\textbf{{1}'}\Sigma^{-1}}{\textbf{{1}'}\Sigma^{-1}\textbf{1}}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The minimum-variance portfolio is $\omega_{mv}=\frac{\Sigma^{-1}\bar{R}}{\textbf{{1}'}\Sigma^{-1}\bar{R}}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the two mutual fund theorem one can span the entire efficient frontier without a risk-free asset by linearly combining this two portfolios. Letting $\alpha \in [-\infty	, +\infty]$, the efficient   weights of any frontier portolio can be obtained as:  $\alpha \times (\omega_{tan}) + (1-\alpha) \times (\omega_{MV})$ .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the risk-free asset, the mean-variance efficient frontier becomes a straight line starting from the risk-free rate and with slope equal to the sharpe ratio.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-11-21T12:39:56.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21861" PostTypeId="2" ParentId="21859" CreationDate="2015-11-21T14:28:19.853" Score="1" Body="&lt;p&gt;There is a problem in your last step. Note that&#xA;\begin{align*}&#xA;P_{t, T_2}E_{Q_{T_2}}\left(\frac{1}{P_{T_1, T_2}} \mid \mathcal{F}_t \right) &amp;amp;= P_{t, T_2}E_{Q_{T_2}}\left(\frac{P_{T_1, T_1}}{P_{T_1, T_2}} \mid \mathcal{F}_t \right)\\&#xA;&amp;amp;=P_{t, T_2} \times \frac{P_{t, T_1}}{P_{t, T_2}}\\&#xA;&amp;amp;=P_{t, T_1}.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-11-21T15:56:44.970" LastActivityDate="2015-11-21T15:56:44.970" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21865" PostTypeId="2" ParentId="21814" CreationDate="2015-11-22T01:28:07.167" Score="1" Body="&lt;p&gt;If you do MEMB you will see a button near the upper right labeled &quot;4) FIELDS&quot;. If you press this button you can add columns to the display. For example you can select Descriptive / Identification / Identifiers / Bloomberg / Financial Instrument Global Identifier. When I do it the column unfortunately shows ERROR(5) whatever that means. However I can select CUSIP or ISIN and shows those identifiers, which might also solve your uniqueness problem. Might be good to call Bloomberg on this. It is possible that I am not authorized to access the FIGI, you might be.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2015-11-22T02:23:19.030" LastActivityDate="2015-11-22T02:23:19.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21866" PostTypeId="1" CreationDate="2015-11-22T08:02:25.367" Score="12" ViewCount="1779" Body="&lt;p&gt;can somebody please explain to me why volatility and correlation increase in times of crisis? It is connected somehow to the herding effect. But I cannot really explain it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And also why are negative returns stronger correlated than positive ones?&lt;/p&gt;&#xA;" OwnerUserId="18386" LastActivityDate="2015-12-07T15:25:43.553" Title="Why do volatility and correlation increase in times of crisis?" Tags="&lt;volatility&gt;&lt;correlation&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21867" PostTypeId="2" ParentId="21851" CreationDate="2015-11-22T10:00:03.003" Score="3" Body="&lt;p&gt;I solved it the following way, just want make sure I'm not missing something obvious.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Set up a portfolio $PF$ consisting of long $S$ and short $P$ at time $t = 0$. Choose arbitrary time $0 &amp;lt; t &amp;lt; T$. If $S_t &amp;gt; P_t$ then $PF_t = S_t - P_t$ which coincides with the value of the option. If $S_t$ hits $P_t$ from above, then dissolve the portfolio by selling $S$ and buying $P$. Again both the portfolio $PF$ and the option have the same value 0 in this case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So we have a self-financing portfolio which has the same payoff at time $T$ as the option. So the option value at $t=0$ must be the same as the portfolio value in the absence of arbitrage, i.e. option value is $S_0 - P_0$.&lt;/p&gt;&#xA;" OwnerUserId="18379" LastEditorUserId="467" LastEditDate="2015-11-23T01:12:49.753" LastActivityDate="2015-11-23T01:12:49.753" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21869" PostTypeId="2" ParentId="21866" CreationDate="2015-11-22T13:48:33.440" Score="2" Body="&lt;p&gt;It is hard to give a definite answer to that question. Let me focus on  the volatility for now (the answer for correlation is even harder).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Schwert (1989) tries to determine the Economic Determinants of Stock Market Volatility. He finds that only lagged ex-post volatilities have strong&#xA;forecasting power.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Macro volatility, Industrial production and Monetary growth do not explain volatility in times of crisis;&lt;/li&gt;&#xA;&lt;li&gt;Interest rate volatility, state of the economy and recession indicators also do not predict increase in stock market volatility&lt;/li&gt;&#xA;&lt;li&gt;The leverage effect (i.e. that when return are negative firms get more distress as their market value decreases in relation to book value) also does not predict stock market volatility spikes in crisis.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;More recently Corradi, Distaso, and Melo (2013, JME) also study the determinants&#xA;of stock market volatility. Again same conclusion as before: Volatility increases when stock prices fall but, no strong evidence of a tight link between stock return volatility and leverage ratios&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-11-22T13:48:33.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21870" PostTypeId="2" ParentId="21839" CreationDate="2015-11-22T14:44:00.440" Score="1" Body="&lt;p&gt;from a practitioner perspective, i can say there's no such thing as a 0 year swap (obviously).  The shortest tenor that you could trade would be a contract on one month LIBOR or more likely 3 month LIBOR.  Then the instrument you are asking about is a 5 year expiration caplet (payoff in 5 years = max (0, LIBOR- strike).)&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2015-11-22T14:44:00.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21871" PostTypeId="2" ParentId="9226" CreationDate="2015-11-22T15:19:22.623" Score="5" Body="&lt;p&gt;You are asking about the term structure of lognormal implied volatilities for European swaptions, which is a two dimensional function (expiration and tenor).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First expiration:  typically (but not always), implied volatilities are increasing in the 0 to 6 month sector, because the immediate future is often more predictable than the medium term.  At some point, volatilities max out and they always start decreasing for very long dated swaptions.  One hypothesis for this effect is that interest rates are fundamentally bounded (they very rarely go below 0 or above 15%, say), so the annual implied vol of long dated swaptions has to decrease approximately at 1/sqrt(expiration).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tenor:  empirically, one finds that the most volatile rates over time are those in the 2yr-5yr sector of the curve.  The long end (30yrs and above) tends to be less volatile.  Presumably that's because new information affects long dated forward rates less than shorter dated forward rates, but that's a hypothesis.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is also a model effect in lognormal volatilities.  When rates get very low (as is now the case at the front end of many yield curves), the actual behavior of forward rates tends to be more volatile than the lognormal model would predict.  Hence implied lognormal volatilities are quite high for very short expitation, short tenor options&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2015-11-22T15:19:22.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21872" PostTypeId="2" ParentId="11577" CreationDate="2015-11-22T15:31:14.373" Score="9" Body="&lt;p&gt;Let $P$ be the risk-neutral measure. We define the measure $P_S$ such that&#xA;\begin{align*}&#xA;\frac{dP_S}{dP}\big|_t &amp;amp;=\frac{S_t}{e^{rt}S_0}\\&#xA;&amp;amp;=e^{-\frac{1}{2}\sigma^2 t+\sigma W_t}.&#xA;\end{align*}&#xA;Then $\{\widehat{W}_t \mid t \ge 0\}$,  where&#xA;\begin{align*}&#xA;\widehat{W}_t = W_t -\sigma t,&#xA;\end{align*}&#xA;is a standard Brownian motion under the measure $P_S$. Moreover, under $P_S$, &#xA;\begin{align*}&#xA;\frac{dS}{S} &amp;amp;= rdt + \sigma dW_t\\&#xA;&amp;amp;=\big(r+\sigma^2\big)dt + \sigma d \widehat{W}_t.&#xA;\end{align*}&#xA;That is, the stock price process $S$ is still log-normal. The option price is then given by&#xA;\begin{align*}&#xA;e^{-rT}E\Big(\big(S_Tf(S_T) \big)^+\Big) &amp;amp;= e^{-rT}E_S\bigg(\Big(\frac{dP_S}{dP}\big|_T\Big)^{-1}\big(S_Tf(S_T) \big)^+\bigg)\\&#xA;&amp;amp;=S_0E_S\left(\big(f(S_T) \big)^+\right),&#xA;\end{align*}&#xA;where $E$ and $E_S$ are respectively the expectation operators under the measures $P$ and $P_S$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-11-22T15:31:14.373" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="21873" PostTypeId="1" AcceptedAnswerId="21880" CreationDate="2015-11-22T16:43:05.887" Score="2" ViewCount="206" Body="&lt;p&gt;For example in the Black_scholes case the delta N(d1) does appear to be equal to the expectation (under the stock measure) of the delta at expiration, which is the expectation of I(S(T)&gt;K).   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a fundamental reason to believe that the delta will always be a martingale under the stock numeraire?&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2015-11-22T19:37:57.453" Title="Is the delta of a call option a martingale using the stock numeraire?" Tags="&lt;numerairechange&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21874" PostTypeId="1" CreationDate="2015-11-22T16:59:52.560" Score="2" ViewCount="427" Body="&lt;p&gt;I'm trying to understand the CAPM model and how we can use it to understand efficient portfolios. Specfically, I'm trying to use the CML line (mapping expected returns and standard deviations of portfolios) to value proposed portfolios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this scenario: risk free rate = 2%. Expected excess return on market portfolio is 8% (so, I'm assuming, the expected return on the the market portfolio is 10%). The last given value is that the standard deviation of the market portfolio is 20.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have to analyze 3 portfolios:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A: E(r) = 8%, SD = 10%&#xA;B: E(r) = 12% SD = 25%&#xA;C: E(r) = 13% SD = 30%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on the Sharpe Ratio (ie: the slope of the CML), I deduced that portfolio A is unfeasible and C is inefficient, whereas B falls on the CML and must therefore be efficient for the level of risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The next question I'm posed with is &quot;How can the expected return of the wining portfolio be achieved? Specify the amount&#xA;invested in each asset/portfolio of assets?&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is given that I have some number X to invest, but I'm not quite sure how to approach this problem. The question does not seem too clear to me. &lt;/p&gt;&#xA;" OwnerUserId="18391" LastActivityDate="2016-03-21T19:31:10.627" Title="Understanding CAPM, CML, and efficient portfolios" Tags="&lt;portfolio-optimization&gt;&lt;capm&gt;&lt;expected-return&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21875" PostTypeId="2" ParentId="21874" CreationDate="2015-11-22T17:07:18.700" Score="1" Body="&lt;p&gt;It is really simple and probably not a question for this forum.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You just need: $\alpha * .08 + (1-\alpha) * .02 = .12$. Solve for alpha and then check the standard deviation that should be .25.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-11-22T17:07:18.700" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21877" PostTypeId="1" AcceptedAnswerId="22137" CreationDate="2015-11-22T18:49:55.393" Score="2" ViewCount="498" Body="&lt;p&gt;I've been given some data (it's financial tick data) and I want to predict based on some observed variables whether the next move will be up, down or unchanged.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I have been trying to use multinomial logistic regression, this is my first time doing logistic regression so I want to check that I have done this correctly and that my results look reasonable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now I am doing 3 bi-variate logistic regressions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I code the data such that I have three new time series labelled up, down and unchanged. These are generated by testing whether the move n steps ahead was up, down or unchanged in the original series and adding a one to the appropriate array and making all other entries zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then do a bi-variate logistic regression of these up, down and unchanged arrays against the regressors individually.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can then calculate the probability of each using the transformation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\textrm{prob} = 1/(1+\exp[-Bx])$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\beta$ are the betas from the bi-variate logistic regressions. And $x$ is the value of the regressors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This gives me the probability of up, down and unchanged.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then simply compare if $\textrm{probability of UP} &amp;gt; \textrm{probability of Down}$ if so the model predicts up and vice versa.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q.1) Is my methodology correct?  Right now I am doing all calculations on the price series (not the returns series)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q.2) When I test this accuracy in sample I am getting 70% accuracy in sample (for both up and down moves)? Is that a reasonable test score in sample?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q.3) The model probability for unchanged is very low typically around 14%. So unchanged is never selected (because the probabilities of up down moves are always much larger). However unchanged is the most commonly observed change with an unconditional probability of 91%. Is there a way I can correct the model so that unchanged is forecast accurately by the model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update:&#xA;Here is the code unfortunately I am getting differences between 2 variable regression results and the 3 variable results!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Possible error between two: 2 variable regression run using mnrfit() and an equivalent 3 variable version on asset returns. &#xA;The returns have been classified as positive, negative or flat. The logistic regression is then run on the rtns vs the classified returns (this is a simple test to check that the regression functions as intended).&#xA;When I do this for the 2 variable version i.e. Up rtns v everything else, the regression gives an estimate of the probability that a 0 return is not an up return of 88%. As the return size is increased the probability that it is positive increases eventually converging to 1 (as you would expect). Also as increasingly negative rtns are put into the logistic regression model the probability that the rtn is positive goes to zero. &#xA;The same is true for the 2 Variable estimate of Down returns v everything else. The figures are similar to those above but with the signs of the returns reversed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now when I run the 3 variable version. Things initially look OK: when given a return of zero it estimates the probability that it is zero to be 86% with a prob of a down move =6.4% and an  up move =7.6% so very similar to the 2 variable case. Moreover when larger and larger returns are entered the probability that it is a positive return converges to 1 as you would expect but when you put in larger and larger negative returns the probability that the return is negative converges to zero while the probability it is equal to zero increases to 1!!! Which is clearly wrong.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Data1 = LoadMat_SHFE_Range(Contract1, StartDate, EndDate);&#xA;&#xA;rtn=(Data1.Mid(2:end)-Data1.Mid(1:end-1))./(Data1.Mid(1:end-1));&#xA;&#xA;NStep=0;&#xA;&#xA;Up=nan(length(rtn),1);&#xA;Down=nan(length(rtn),1);&#xA;Flat=nan(length(rtn),1);&#xA;RtnClass=nan(length(rtn),1);&#xA;&#xA;for i=1:length(rtn)-NStep&#xA;&#xA;if(rtn(i+NStep)&amp;gt;0)&#xA;    Up(i)=2;&#xA;    Down(i)=1;&#xA;    Flat(i)=1;&#xA;elseif(rtn(i+NStep)&amp;lt;0)&#xA;    Up(i)=1;&#xA;    Down(i)=2;&#xA;    Flat(i)=1;&#xA;elseif(rtn(i+NStep)==0)&#xA;    Up(i)=1;&#xA;    Down(i)=1;&#xA;    Flat(i)=2;&#xA;end&#xA;&#xA;end&#xA;&#xA;[BUp,dev,stats] = mnrfit(rtn,Up);&#xA;MatProbUp = mnrval(BUp,0.1);&#xA;&#xA;[BDown,dev,stats] = mnrfit(rtn,Down);&#xA;MatProbDown = mnrval(BDown,0.1);&#xA;&#xA;&#xA;for i=1:length(rtn)&#xA;&#xA;if(rtn(i)&amp;gt;0)&#xA;    RtnClass(i)=3;&#xA;elseif(rtn(i)&amp;lt;0)&#xA;    RtnClass(i)=2;&#xA;elseif(rtn(i)==0)&#xA;    RtnClass(i)=1;&#xA;end&#xA;&#xA;end&#xA;&#xA;[BM,dev,stats] = mnrfit(rtn,RtnClass,'model','ordinal');&#xA;[pihat,dlow,hi] = mnrval(BM,0,stats,'model','ordinal');&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7077" LastEditorUserId="3188" LastEditDate="2015-11-24T08:17:58.493" LastActivityDate="2015-12-06T23:02:39.760" Title="Logistic Regression of tick data" Tags="&lt;time-series&gt;&lt;high-frequency&gt;&lt;tick-data&gt;&lt;high-frequency-estimators&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21878" PostTypeId="1" AcceptedAnswerId="21882" CreationDate="2015-11-22T18:56:34.960" Score="1" ViewCount="153" Body="&lt;p&gt;In a notes on &quot;Option Pricing using Fourier Transform&quot;: Price of plain vanila call is given by $$ C(t, S_t) = e^{-rT}\mathbb{E}^{\mathbb{Q}}[(S_T -K)^+|\mathcal{F}_0] = e^{-rT} \int_K^{\infty} (S_T -K)\mathbb{Q}(S_T|\mathcal{F}_0) dS_T$$&#xA;It is a standard formula. In the next step the author claims to use, a change of variable from $S_T$ to $\ln S_T$ and writes $$ C(T, K) =  e^{-rT} \int_{\ln K}^{\infty} (e^{\ln S_T} -e^{\ln K})\mathbb{Q}(\ln S_T|\mathcal{F}_0) d \ln S_T$$&#xA;which needs some explanation. To be precise, I think it should be $\ln S_T$ in place of $e^{\ln S_T}$ in the integral and the rest is fine.&lt;/p&gt;&#xA;" OwnerUserId="18396" LastActivityDate="2015-11-22T19:50:35.437" Title="Fourier Transform" Tags="&lt;option-pricing&gt;&lt;risk-neutral-measure&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21879" PostTypeId="2" ParentId="21878" CreationDate="2015-11-22T19:32:35.870" Score="1" Body="&lt;p&gt;I think it's ok&#xA;$$&#xA;S_T = e^{\ln S_T}&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-11-22T19:32:35.870" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="21880" PostTypeId="2" ParentId="21873" CreationDate="2015-11-22T19:37:57.453" Score="2" Body="&lt;p&gt;for a large class of models that is ones where $\log S_T - \log S_0$ has distribution independent of level, it is possible to show that the delta is &#xA;$$&#xA;\mathbb{P}_S(S_T&amp;gt;K)&#xA;$$&#xA;and this is a martingale in the stock measure. (For a proof see More Mathematical Finance by me)&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2015-11-22T19:37:57.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21881" PostTypeId="1" CreationDate="2015-11-22T19:42:52.260" Score="1" ViewCount="70" Body="&lt;p&gt;I'm trying to program an ADX calculator in python, however I don't know if it is correct since I'm still a bit shaky on the financial side of things. I haven't found an ADX calculator online (surprisingly) so I can't compare it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should the following datasets generate the following ADX-values? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;[1,2,3,4,5,6,7,8,9,10] --&gt; 100&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[10,9,8,7,6,5,4,3,2,1] --&gt; 100&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[2,4,8,16,32,64,128,256,512] --&gt; 100&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[5,5,5,5,5,5,5,5,5,5,5,5,5,5] --&gt; 0&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[1,2,3,3,2,1,1,2,3,3,2,1,1,2,3,3,2,1,1,2,3] --&gt; 94.50548937857359&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anyone with sufficient knowledge tell me if something seems off?&lt;/p&gt;&#xA;" OwnerUserId="18394" LastActivityDate="2015-11-22T21:43:00.780" Title="Testing out ADX calculator" Tags="&lt;automated-trading&gt;&lt;indicator&gt;" AnswerCount="0" CommentCount="3" ClosedDate="2015-11-22T22:13:12.787" ContentLicense="CC BY-SA 3.0" />
  <row Id="21882" PostTypeId="2" ParentId="21878" CreationDate="2015-11-22T19:44:37.973" Score="1" Body="&lt;p&gt;Note that the second expression is not based on a substitution of the first expression; it is a different view:&#xA;\begin{align*}&#xA;e^{-rT}E\left((S_T-K)^+\right) &amp;amp;= e^{-rT}E\left(\left(e^{\ln S_T}-e^{\ln K}\right)^+\right)\\&#xA;&amp;amp;=e^{-rT}\int_{-\infty}^{\infty}\left(e^{\ln S_T}-e^{\ln K}\right)^+Q(\ln S_T\mid \mathcal{F}_0)\, d\ln S_T\\&#xA;&amp;amp;=e^{-rT}\int_{\ln K}^{\infty}\left(e^{\ln S_T}-e^{\ln K}\right)Q(\ln S_T\mid \mathcal{F}_0)\, d\ln S_T.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-11-22T19:44:37.973" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="21885" PostTypeId="1" AcceptedAnswerId="21898" CreationDate="2015-11-22T20:23:28.920" Score="6" ViewCount="402" Body="&lt;p&gt;The title says it all, but let me expand on it. Algorithmic differentiation seems to be a method that allows a program / compiler to determine what the derivative is of a function. I imagine it's a great tool for things like optimization, since many of these algorithms work better if we know the cost function and its derivative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that algorithmic differentiation is not the same as numerical differentiation, since the derivative is not exact. But is it then the same as symbolic differentiation, as implemented in e.g. SymPy, Matlab or Mathematica? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, where can it actually be used in quantitative finance? I mentioned optimization, so calibration comes to mind. Greeks are also a natural application, since these are derivatives by definition, but how does that work in the case of Monte Carlo? And are there any other applications?&lt;/p&gt;&#xA;" OwnerUserId="3371" LastActivityDate="2017-02-16T00:17:09.350" Title="How does Algorithmic Differentiation work and where can it be applied?" Tags="&lt;greeks&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="21887" PostTypeId="2" ParentId="21853" CreationDate="2015-11-23T04:02:30.193" Score="3" Body="&lt;p&gt;This is an oft-debated topic among CVA/DVA professionals at banks.  The key question, as pointed out by one of the comments, is whether a bank can derive some type of benefit from the increase in its own credit spread (and thereby make less of a CVA charge on the proposed transaction).  The two sides to the argument are (a) on the one hand, surely by symmetry there should be a zero CVA charge on a transaction between two counterparties of identical credit (assuming a transaction that is itself symmetric).  This side would argue for the 20bp charge since both spreads should be taken into account  (b) on the other hand, the only way that a counterparty can benefit from its own credit spread is by defaulting, which is not worth paying for.  Hence one should price simply off the other side's credit spread.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally I prefer the former approach from a theoretical standpoint, but as I said there is considerable variation among banks as to the approach taken.   Overall I would concur that a counterparty should request the reduction in CVA charge-after all, they have increased exposure to the bank defaulting.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2015-11-23T04:02:30.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21888" PostTypeId="1" CreationDate="2015-11-23T10:00:08.820" Score="1" ViewCount="293" Body="&lt;p&gt;We know of plenty ways to extract risk neutral distirbutions from option prices (for example Breeden Litzberger) but there is no real analysis on how to interpret negative state prices (Haug 2007 for example). State prices are Arrow Debreu securities, so it is the price an agent is willing to pay to get $1\$$ in a particular state and $0$ else. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Doing equilibirum and utility maximization we know that the agents smoothen their consumption by marginal rate of substitution which describes their risk-aversion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Coming back to the negative probabilties: Could it not be possible there exist actual economic states where the agent is receiving money for the contract?&lt;/p&gt;&#xA;" OwnerUserId="6276" LastActivityDate="2015-11-23T11:44:28.650" Title="Negative risk neutral probabilities economic argument" Tags="&lt;finance&gt;&lt;probability&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21889" PostTypeId="2" ParentId="21888" CreationDate="2015-11-23T11:44:28.650" Score="1" Body="&lt;p&gt;Negative state prices in equilibrium can only occur if the utility of wealth is not always strictly positive. A natural assumption on utility is that it is strictly increasing in wealth in all states of nature (more money is always preferred to less money). Thus, unless you can come up with a situation in which an agent would prefer to be less wealthy and everything else equal there should not be negative state prices.&lt;/p&gt;&#xA;" OwnerUserId="7396" LastActivityDate="2015-11-23T11:44:28.650" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21890" PostTypeId="1" CreationDate="2015-11-23T15:24:48.317" Score="12" ViewCount="197" Body="&lt;p&gt;I'm playing around with different portfolio optimization techniques. Amongst others I was also looking at the resampling method, especially the one described in &lt;a href=&quot;http://www.amazon.de/Risk-Asset-Allocation-Springer-Finance/dp/3642009646&quot; rel=&quot;nofollow noreferrer&quot;&gt;Meucci&lt;/a&gt;. I have two general questions regarding this technique. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt; I would like to know what more expierenced people think about resampling methods? I've noticed that there is a controversial discussion on this site, see this &lt;a href=&quot;https://quant.stackexchange.com/questions/4208/comparing-mvo-with-resampled-efficient-frontier&quot;&gt;question&lt;/a&gt;, as well as in the research area. For example, &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=377503&quot; rel=&quot;nofollow noreferrer&quot;&gt;Scherer&lt;/a&gt; critique. On the other Meucci also points out some advantages and mentions the wide usage of this technique in industry. In my opinion, or what I've seen running some expirements, there is no additional gain regarding return but weights are much more stable when you have to recalibrate them. Often it is argued that there is no statistical justification for doing it. There is also a newer &lt;a href=&quot;http://www.google.ch/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=3&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0ahUKEwin0dCmyK3JAhXD1hQKHahZCEMQFggvMAI&amp;amp;url=http%3A%2F%2Fwww.hsu-hh.de%2Fdownload-1.5.1.php%3Fbrick_id%3Dy4ovjH1bpydBj98A&amp;amp;usg=AFQjCNE-QNL5ztKPN2slyALzzv_1RE-XIA&amp;amp;bvm=bv.108194040,d.bGQ&quot; rel=&quot;nofollow noreferrer&quot;&gt;paper&lt;/a&gt; which gives a justification depending on the &quot;traders style&quot;. As you can see there is a variety of articles and I would like to hear from somone with a better overview his / her opinion on the topic. &lt;/p&gt;&#xA;" OwnerUserId="17133" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2017-06-15T20:24:55.657" Title="portfolio optimization averaging weights, what are benefits?" Tags="&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21891" PostTypeId="2" ParentId="21877" CreationDate="2015-11-23T15:44:15.110" Score="2" Body="&lt;p&gt;The code you posted is wrong since you do not model the time series behavior of the up/down process (ie if you have 10 up move and consequently 10 down move it is not the same as the opposite ie 10 down  and after 10 up..). I would recommend you to use standards Arma Garch models apply on returns instead of modeling the process of up/down. These are (at least) the main reasons:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;if you use your binary process you'll have problems to take into account volatility clustering and so on (the conditional variance part.).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;since you use tick data, you 'll have consistency problems since you may get 1 move in 5 seconds and after 100 moves in 5 seconds.  If you use standards models such as Arma Garch models, you can deal with this fact by resampling the midquote every x seconds (or any other aggregation methods). &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With standards models you 'll be able to achieve your aims by choosing a simple rule: let's say if the one step ahead forecasted conditional mean return is positive with 0.05 confidence level you could assume the next move will be up. Additionally you can add explanatory variables in both the conditional mean and variance processes.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;it is likely that you are also interested in the magnitude of the move , and it is easier to obtain it via box-Jenkins class of models. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;You also need to consider the move in the bid-ask spread ! if you use returns it is implicitly considered.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2015-11-23T15:44:15.110" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21892" PostTypeId="2" ParentId="21851" CreationDate="2015-11-23T16:55:29.347" Score="1" Body="&lt;p&gt;The option payoff is equivalent to $Z_{\tau \wedge T}-1$ where $\tau=\inf\{t | Z_t = 1\}$ provided that $Z_t$ is assumed to be continuous. Since $Z_t=S_t/P_t$ is a martingale under $Q_P$, we have $E_P[Z_{\tau \wedge T}]=Z_0$ and the option value is $P_0 (Z_0 - 1)=S_0-P_0$ regardless of the model. &lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2015-11-23T16:55:29.347" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21893" PostTypeId="1" CreationDate="2015-11-23T21:10:10.197" Score="1" ViewCount="109" Body="&lt;p&gt;I am looking to incorporate weather data into my algorithmic models. What is a good source to find historical + real time weather data by zipcode or region? Any help will be appreciated! Preferably an API&lt;/p&gt;&#xA;" OwnerUserId="2777" LastEditorUserId="18481" LastEditDate="2015-12-02T07:50:30.127" LastActivityDate="2015-12-02T07:50:30.127" Title="Real Time/Historical weather data" Tags="&lt;programming&gt;&lt;quant-trading-strategies&gt;&lt;historical-data&gt;&lt;historical&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21894" PostTypeId="2" ParentId="7006" CreationDate="2015-11-23T21:20:10.457" Score="2" Body="&lt;p&gt;I think you fail to understand Multivariate Garch model such as DCC models since they &lt;em&gt;do&lt;/em&gt; take into account non linearity. They are interested in jointly modeling the time series behavior of multiple conditional variance processes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each &lt;em&gt;couple&lt;/em&gt; of series has its own particular conditional correlation process evolving trough time in a non-linear way. In fact they are devoted to this understanding of co-movement. I recommend you to have a look to this excellent survey:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Bauwens, L., Laurent, S., &amp;amp; Rombouts, J. V. K. (2006). Multivariate&#xA;  GARCH models: a survey. Journal of Applied Econometrics, 21(1),&#xA;  79–109. &lt;a href=&quot;http://doi.org/10.1002/jae.842&quot; rel=&quot;nofollow&quot;&gt;http://doi.org/10.1002/jae.842&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;ex : the conditional correlation of serie A and B may be modeled as autoregressive process  while each of one having its own different conditional variance process. The conditional correlation of serie A and C is a different autoregressive process. Both processes have square terms allowing no-linear relationship. Also, They  can have explanatory variable and feedback to the conditional mean process (Arch-in- mean models). Don't see them as simple &quot;Pearson estimator&quot; processes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However another interesting class of models you can have a look are Unobserved Components Models (which can be estimated via state space models). They are recents and you can model the joint behavior of multiple series. A good starting point is the following book :&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;An Introduction to State Space Time Series Analysis by Jacques J.F.&#xA;  Commandeur,Siem Jan Koopman (2007).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Finally, you can also have a look to multivariate stochastic volatility models, which you can also estimate with state space models and kalman filter.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2015-11-23T21:26:02.277" LastActivityDate="2015-11-23T21:26:02.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21895" PostTypeId="2" ParentId="15378" CreationDate="2015-11-23T23:26:48.600" Score="2" Body="&lt;p&gt;There's no best method.  The question is :  what is the behavior of the volatility structure (atm and skew) when the underlying moves?  Each method assumes something different.  In the real market, one method might work well for a period of time (in the sense that it minimizes residual p/l), but then another method might take over as best.  Practitioners tend to experiment with different methods until they get comfortable which is best (as they see it).  However, there's no accepted best method.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2015-11-23T23:26:48.600" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21896" PostTypeId="2" ParentId="21792" CreationDate="2015-11-23T23:30:43.540" Score="0" Body="&lt;p&gt;This says that if rates are deterministic, the spot rate follows the forward rates that are initially observed.  Makes sense.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2015-11-23T23:30:43.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21897" PostTypeId="1" CreationDate="2015-11-24T01:52:23.887" Score="0" ViewCount="57" Body="&lt;p&gt;Putting aside operational/reputational/business risks for a minute, a financial institution is concerned with the risk of losing money on their positions. What about an exchange ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can only think of the case where a multiple counterparties with huge exposures default simultaneously or close to each other totaling more than the clearing members can cover. What other risks (other than operational/reputational) might they face?&lt;/p&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="9265" LastEditDate="2015-11-24T14:13:21.240" LastActivityDate="2015-11-24T14:13:21.240" Title="What risks is an exchange exposed to?" Tags="&lt;risk&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21898" PostTypeId="2" ParentId="21885" CreationDate="2015-11-24T04:00:25.843" Score="8" Body="&lt;p&gt;Automatic Differentiation (aka AD) is a family of methods that are used to evaluate the derivative of a coded function. These methods are far more accurate than finite differences, since they are theoretically exact in the absence of floating point roundoff error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;AD is, however, subtly different than symbolic differentiation. The key difference here is that computer algebra systems (like Mathematica) will return a function that can be evaluated for a derivative. In many implementations of Automatic differentiation, however, the derivative is computed as a side-effect of evaluating the original function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a number of different ways to implement AD, and they are outlined in a reasonable amount of detail on the wikipedia page.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Automatic_differentiation&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Automatic_differentiation&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Simple Implementation Method&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps the most straightforward method to implement AD is using &quot;Dual Numbers&quot; and operator overloading. The key idea is to introduce a new type of scalar number, called a Dual Number. The dual number augments the algebra of real numbers by replacing every number $x$ with $x + x' \epsilon$, where $\epsilon$ has the property $\epsilon^2 = 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using this, you can define the algebra of dual numbers as you might expect:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;(u+u'\epsilon) + (v + v'\epsilon) &amp;amp;= (u+v) + (u' + v')\epsilon \\&#xA;(u+u'\epsilon) - (v + v'\epsilon) &amp;amp;= (u-v) + (u' - v')\epsilon \\&#xA;(u+u'\epsilon) * (v+v'\epsilon) &amp;amp;= (uv) + (uv' + vu')\epsilon \\&#xA;(u + u'\epsilon) / (v+v'\epsilon) &amp;amp;= (u/v) + \frac{u'v - uv'}{v^2}\epsilon&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the wikipedia page for extensions of this to other functions ($\sin$, $\cos$, $\exp$, ...)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The astute reader will notice that the $\epsilon$ component of the result of any operation between dual numbers implements the chain rule for that operation. Due to this, any sequence of operations (i.e. a coded function) will simultaneously compute the function value and its derivative. The only loss of accuracy that one incurs using this method is floating-point roundoff errors (so you still need to use numerically stable algorithms).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the software side, the primary burden is the implementation of a Dual Number class and to overload any operators/functions that you want to use. &#xA;In addition, any functions that you wish to differentiate should be (in C++ parlance) templated on the input type. Eg, rather than:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;double f(double x) { ... }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;you would write&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;template&amp;lt;typename T&amp;gt;&#xA;T f(T x) {...}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Doing so will allow you to re-use the same code to do normal function calls or to do the AD function calls.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example Code&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a link to my C++ implementation of the method that I use in my finite element library. The code is free to take/use/modify if you'd like.&#xA;You'll have to strip out the non-standard header and the namespace open/close lines, but it shouldn't have any dependencies to the rest of the library.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/tjolsen/YAFEL/blob/master/include/utils/DualNumber.hpp&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/tjolsen/YAFEL/blob/master/include/utils/DualNumber.hpp&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Final Thoughts&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The ideas described here can be generalized to vector-valued inputs/outputs. By doing so, you can compute Jacobians without having to derive what each partial derivative should be. Depending on the dimension of the inputs and outputs, other methods than the Dual Number method described here may be more efficient, so it's worth reading about in more detail.&lt;/p&gt;&#xA;" OwnerUserId="8097" LastEditorUserId="8097" LastEditDate="2017-02-16T00:17:09.350" LastActivityDate="2017-02-16T00:17:09.350" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21899" PostTypeId="2" ParentId="21897" CreationDate="2015-11-24T08:43:03.147" Score="1" Body="&lt;p&gt;One of the risks that an exchange (i.e. the clearing corporation associated with it) faces is 'last-trade' risk. When an order from a trading member hits an exchange, the exchange does not verify the trade against the trading member's remaining exposure limit before-hand. This is because it takes some time to cross-verify from the risk system, and since orders are stacked on 'price + time' priority basis, exchange wants to offer fast access to its client. This is, however, checked subsequently.&lt;/p&gt;&#xA;" OwnerUserId="17405" LastActivityDate="2015-11-24T08:43:03.147" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21900" PostTypeId="1" CreationDate="2015-11-24T09:10:18.570" Score="1" ViewCount="72" Body="&lt;p&gt;I am researching the question, what happens during a crisis situation to the money market. Can it break? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In 2007-08 there is evidence that liquity hoarding from banks became a rather common problem. (See f.ex. &lt;a href=&quot;http://www.bis.org/bcbs/events/bhbibe/berrospide.pdf&quot; rel=&quot;nofollow&quot;&gt;Berrospide 2012&lt;/a&gt;) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I in a risk statement(which I cannot find anymore) that the ECB does not see the money market as a secure way to fund a bank in a crisis situation and somehow I interprete from this that it only sees itself as the real constant during a financial crisis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does the money market hold in a severe crisis situation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I appreciate your experienced answers!&lt;/p&gt;&#xA;" OwnerUserId="5414" LastActivityDate="2015-11-26T13:49:19.017" Title="Can the money market break in a crisis situation?" Tags="&lt;economics&gt;&lt;macro-economics&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21901" PostTypeId="1" CreationDate="2015-11-24T09:36:03.653" Score="7" ViewCount="324" Body="&lt;p&gt;I'm aware that one way to do significance testing on a strategy is based on the sampling distribution of its Sharpe (see, e.g., &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=377260&quot; rel=&quot;noreferrer&quot;&gt;Lo, 2002&lt;/a&gt; and &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=886728&quot; rel=&quot;noreferrer&quot;&gt;Opdyke, 2008&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it appears to me that there's another very simple way to do inference directly on the average return and standard deviation implied by the Sharpe. I'm wondering (1) if this approach is valid, or whether I'm overlooking something; (2) if there's some literature on this and similar approaches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given a strategy with (required / targeted / IS-based) daily Sharpe ratio $SR = \frac{\mu}{\sigma}$, with returns statistics $\mu$ (mean) and $\sigma$ (standard deviation).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is how long of an OS period the strategy needs at minimum to establish statistically significant returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming iid returns (big assumption), the sample mean of the daily returns in the OS period after $n$ days can be modelled with (probably more appropriate to use t distribution though) $$\hat\mu \sim \mathcal{N}\left(\mu, \frac{\sigma^2}{n}\right)$$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We define statistical significance at level $\alpha$ as the $z_{1-\alpha}$ score (one-sided test) from zero (i.e., the null is that $\mu=0$): $$\hat\mu \geq z_{1-\alpha} \frac{\sigma}{\sqrt{n}}$$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the definition of the daily Sharpe $SR = \frac{\mu}{\sigma}$ and substituting $\mu=\hat\mu$ this becomes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$n \geq \left(\frac{z_{1-\alpha}}{SR}\right)^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuitively this makes sense: A lower Sharpe, or higher significance level increases the minimum sampling period. For instance, at $\alpha=90\%$ significance we obtain for a strategy with an annual Sharpe of 1: $n \geq (1.28 * \sqrt{252} / 1)^2 \approx 413$ days, but at $\alpha=95\%$ already $n \geq 682$ days.&lt;/p&gt;&#xA;" OwnerUserId="7192" LastEditorUserId="7192" LastEditDate="2015-11-24T11:28:10.137" LastActivityDate="2018-11-16T01:02:50.613" Title="Significance testing of average returns from Sharpe ratio" Tags="&lt;backtesting&gt;&lt;sharpe-ratio&gt;&lt;statistical-significance&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21902" PostTypeId="1" AcceptedAnswerId="21909" CreationDate="2015-11-24T09:56:22.120" Score="3" ViewCount="290" Body="&lt;p&gt;Consider a multi-period model with $t=0,...,T$. Suppose there is a bond with $B_0=1$ and $B_t=(1+R)^t$ and a stock with $S_0=s_0$ and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;S_{t+1}=S_t\,\xi_{t+1},&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $\xi_t$ iid random variables. I indicate with $(\alpha_t,\beta_t)$ the predicable components of the portfolio. &#xA;I have found two different definitions&#xA;of self-financing portfolio that I would like to re-conciliate. In the book by Tomas Bjork (&quot;Arbitrage Theory in Continuous Time&quot;) it is said that the value of the portfolio at time $t$ is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;V_t^{(\alpha,\beta)} = \alpha_t\,S_t+\beta_t\,(1+R)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the self-financing condition is expressed as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\alpha_t\,S_t+\beta_t\,(1+R) = \alpha_{t+1}\,S_t+\beta_{t+1}.&#xA;$$&#xA;This is quite intuitive form me since, in Bjork, $\alpha_t$ (resp. $\beta_t$) is, by definition, the amount of money &lt;strong&gt;we invest in the stock&lt;/strong&gt; (resp. in the bond) at time $t-1$ and keep up to time $t$. So if I buy $\beta_t$ unit of the bond at time $t-1$ then I gain $\beta_t\,(1+R)$ at time $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nevertheless, in the book by Andrea Pascucci (&quot;PDE and Martingale Methods in Option Pricing&quot;) it is said that the value of the portfolio is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;V_t^{(\alpha,\beta)} = \alpha_t\,S_t+\beta_t\,B_t = \alpha_t\,S_t+\beta_t\,(1+R)^t&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the self-financing condition is expressed as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;V_t^{(\alpha,\beta)} =\alpha_t\,S_t+\beta_t\,(1+R)^t = \alpha_{t+1}\,S_t+\beta_{t+1}\,(1+R)^t.&#xA;$$&#xA;Pascucci define $\alpha_t$ (resp. $\beta_t$) as the amount of the asset $S$ (resp. of the bond $B$) &lt;strong&gt;held in the portfolio during the period $[t-1,t]$&lt;/strong&gt;. Are the two definitions equivalent? I am pretty sure that the the solution is in the fact that in Bjork it is defined as the amount &lt;strong&gt;invested&lt;/strong&gt; while in Pascucci as the amount &lt;strong&gt;held&lt;/strong&gt;. Nevertheless I miss which kind of relationship is in between the two.&lt;/p&gt;&#xA;" OwnerUserId="18063" LastActivityDate="2015-11-24T14:56:48.393" Title="Equivalent Definitions of Self-Financing Portfolio" Tags="&lt;portfolio&gt;&lt;no-arbitrage-theory&gt;&lt;self-study&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21903" PostTypeId="1" CreationDate="2015-11-24T11:19:17.963" Score="2" ViewCount="492" Body="&lt;p&gt;I am thinking about whether there exists a relationship between the delta of an option (or any structured derivative) and it's expected positive/negative exposure?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/QB1Ms.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/QB1Ms.png&quot; alt=&quot;PFE of a Forward&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An intuitive question would be the following:&#xA;A Foward has a Delta of 1 and given the above exposure profile and the Delta of an Option with the same underlying, can I deduce that the exposure profile of the Option equals Delta * Forward_Exposure?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, after running some simulations I see that this is not the case, part of the reason being (I think) that for exposure generation one simulates values for all relevant risk parameters and not just the one which corresponds to the Delta/sensitivity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there are any questions on Definitions of terms I used, I am happy to clarify. Image taken from Jon Gregory's book on CVA. &lt;/p&gt;&#xA;" OwnerUserId="18411" LastActivityDate="2017-11-18T19:53:01.347" Title="Deduce expected exposure profile from option/structure delta?" Tags="&lt;monte-carlo&gt;&lt;simulations&gt;&lt;delta&gt;&lt;sensitivities&gt;&lt;exposure&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21904" PostTypeId="2" ParentId="8548" CreationDate="2015-11-24T13:10:40.507" Score="3" Body="&lt;p&gt;The answer can be found in the following paper (&lt;em&gt;section 2.3 Distribution and quantile functions of a skewed distribution&lt;/em&gt;):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Lambert and Laurent, 2002&#xA;  Lambert, P., Laurent, S., 2002. Modeling skewness dynamics in series of financial data using skewed location-scale distributions. Working Paper, Université Catholique de Louvain and Université de Liège.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And I summarize it in the following :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The quantile function $skst_{\alpha,v,\xi}$ of a &lt;em&gt;non standardized&lt;/em&gt; skewed-Student density (Fernandez and Steel&#xA;(1998)) is given by :&#xA;$$&#xA;skst_{\alpha,v,\xi}= \frac{1}{\xi}st_{\alpha,v}\left[ \frac{\alpha}{2}(1+\xi^2)\right]  \qquad \text{if} \qquad \alpha &amp;lt; \frac{1}{1+\xi^2}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;skst_{\alpha,v,\xi}= -\xi st_{\alpha,v}\left[ \frac{1-\alpha}{2}(1+\xi^{-2})\right]  \qquad \text{if} \qquad \alpha \geq \frac{1}{1+\xi^2}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\xi$ is the asymmetry coefficient, $v$ the degree of freedom and $\alpha $ is the quantile probability. $st_{\alpha,v}$ is the quantile function of the (unit variance) Student-t density.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Then the VaR for long position is given by $μ_{t} +&#xA;&amp;gt; skst_{\alpha,v,\xi}\sigma_{t}$ with $skst_{\alpha,v,\xi}$ being the&#xA;  left quantile at $\alpha$% for the skewed-Student distribution with&#xA;  $v$ degrees of freedom and asymmetry coefficient $\xi$;$μ_{t}$ is the conditional  mean process.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you are interested in application, the g@rch package by S.Laurent in Ox programming language implements this computation (this answer is also based on its documentation).&lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2015-11-24T13:18:57.077" LastActivityDate="2015-11-24T13:18:57.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21905" PostTypeId="5" CreationDate="2015-11-24T13:15:37.787" Score="0" Body="&lt;p&gt;It has been designed for econometric programming and developed by Jurgen Doornik. It is available for Windows, macOS and Linux platforms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The downloadable console version of Ox is free for Academic use. A commercial version is available for non-academic use. According to its documentation, it should be cited whenever results are published.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.doornik.com/ox/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Documentation&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="16595" LastEditDate="2018-12-20T15:01:02.233" LastActivityDate="2018-12-20T15:01:02.233" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="21906" PostTypeId="4" CreationDate="2015-11-24T13:15:37.787" Score="0" Body="Ox is an object-oriented matrix programming language with a mathematical and statistical function library." OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2015-11-24T14:59:18.503" LastActivityDate="2015-11-24T14:59:18.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21907" PostTypeId="2" ParentId="21897" CreationDate="2015-11-24T13:17:07.130" Score="1" Body="&lt;p&gt;Markets can disappear or go elsewhere. An example from Wikipedia: &quot;LIFFE's most-traded product was a futures contract on Bunds, the 10-year German Government Bond. The DTB offered an identical product but, as an electronic exchange, it had a lower cost base. The progress of DTB can be gauged from the fact that in mid-1997 the DTB had less than 25% of the market. By October, it had more than 50%, and a couple of months later LIFFE was left with only 10%. The Bund represented about a third of LIFFE's business. The exchange, which had turned in a profit of £57m in 1997, reported a loss of £64m in 1998.&quot; Source: &lt;a href=&quot;https://en.wikipedia.org/wiki/London_International_Financial_Futures_and_Options_Exchange&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/London_International_Financial_Futures_and_Options_Exchange&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2015-11-24T13:17:07.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21908" PostTypeId="2" ParentId="15101" CreationDate="2015-11-24T14:32:08.807" Score="1" Body="&lt;p&gt;This error message indicates you are not using the correct Ox console release. Every oxo is compiled for a particular ox console version/release. So you need to install the Ox console wich fit with your oxo.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2015-11-24T14:32:08.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21909" PostTypeId="2" ParentId="21902" CreationDate="2015-11-24T14:46:19.913" Score="1" Body="&lt;p&gt;You have already answered your question. In Bjork, the $\beta$ terms represent the value in the money market, or deposit, account, while the $\beta$ terms in Andrea Pascucci represent the units in the money market account. Then, the two definitions are basically the same. More specifically, &#xA;\begin{align*}&#xA;\beta^{Bjork}_{t+1} = \beta^{Andrea\, Pascucci}_{t+1} (1+R)^t.&#xA;\end{align*}&#xA;We assume that the initial face money market account value is 1. Then the initial money market account value, in Bjork, and the initial units of the money market account, in Andrea Pascucci, are the same.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-11-24T14:56:48.393" LastActivityDate="2015-11-24T14:56:48.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21910" PostTypeId="1" CreationDate="2015-11-24T15:19:19.470" Score="1" ViewCount="86" Body="&lt;p&gt;I have been using CreditGrades to calculate fair one year CDS spreads for firms. However, the authors of the model explicitly say that the model does not hold for banks or financial firms. If I need to price a thereotical one year CDS spread for a financial firm, what are some suggestions or starting points for an alternative model for accomplishing this? Could I potentially modify the assumptions of the CreditGrades model to hold for banks?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the creditgrades technical document: &lt;a href=&quot;http://www.creditrisk.ru/publications/files_attached/cgtechdoc.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.creditrisk.ru/publications/files_attached/cgtechdoc.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17712" LastActivityDate="2015-11-24T15:19:19.470" Title="Fair Price CDS Spread for a Bank" Tags="&lt;derivatives&gt;&lt;cds&gt;&lt;default&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21911" PostTypeId="2" ParentId="20656" CreationDate="2015-11-24T15:47:43.980" Score="4" Body="&lt;p&gt;&lt;strong&gt;EDIT :&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I read more about it and I get some help with someone else, here is the correct answer :&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The density forecast is the predictive likelihood value of the process&#xA;  estimated at the realized value computed in a one step ahead way.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Thus for instance for a standard arma garch process with normal errors:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You forecast the mean $u^{f}_{t|t-1}$ and variance $v^{f}_{t|t-1}$ process at time t-1 for time t&lt;/li&gt;&#xA;&lt;li&gt;the predictive density forecast for time t of the &lt;em&gt;realized&lt;/em&gt; value $u_{t}$ is $N(u^{f}_{t|t-1},v^{f}_{t|t-1})$&lt;/li&gt;&#xA;&lt;li&gt;the predictive density forecast $u_{t}\sim N(u^{f}_{t|t-1},v^{f}_{t|t-1}) $ is equivalent to the predictive residuals density forecast : $r_{t} = u_{t}-u^{f}_{t|t-1}\sim N(0,v^{f}_{t|t-1}) $&lt;/li&gt;&#xA;&lt;li&gt;the density forecast is the density of $r_{t}$ with respect to a $N(0,v^{f}_{t|t-1}) $&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note that it is very similar to the &quot;usual&quot; likelihood except you are estimating the model in a one step ahead way (the parameters are re-estimated at every step)&lt;/em&gt; &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Previous Post :&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is not a &quot;basic question&quot;, If I am correct :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First you estimate your model on the return series and obtains parameters. You must estimate your model in such a way you obtain one-step ahead errors (that I will call computed errors in what follow) and associated &lt;strong&gt;time-serie&lt;/strong&gt; of the predictive errors distributions parameters: $\hat{\mu_{t}}$ and $ \hat{\sigma_{t}^{2}}$ (note : these are not the parameters of the mean and variance processes but parameters of the error distribution).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would take the original return serie minus the fitted returns to obtain the computed errors :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\hat{e_{t}} = r_{t} - \hat{r_{t}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These computed errors should behave accordingly your  &lt;strong&gt;predictive&lt;/strong&gt;  (errors) density which is defined by parameters you obtain in the first step ($\hat{\mu_{t}}, \hat{\sigma_{t}}$) : Note the subscript  $_{t}$ for parameters !&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I would compute the &lt;strong&gt;predictive&lt;/strong&gt; density of these residuals &lt;em&gt;using parameters obtained in the first step estimation&lt;/em&gt;, indeed  if your forecasts are accurate the&#xA;density of $\hat{e_{t}}$ should ideally be equal to the predictive density defined as:  normal($\hat{\mu_{t}}, \hat{\sigma_{t}}$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it fit perfectly (they have the same mean, variance) then the density forecast will returns a high mass . If the model is misspecified, the errors $\hat{e_{t}}$ will fall outside of the range implied by your predictive error density and then it will assign very small probability.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in your case I will use the following function (again note the time subscript)&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Density forecast ($\hat{e_{t}}$) = normpdf($\hat{e_{t}}, \hat{\mu_{t}}, \hat{\sigma_{t}}$)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2015-12-03T14:45:20.073" LastActivityDate="2015-12-03T14:45:20.073" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="21912" PostTypeId="2" ParentId="15409" CreationDate="2015-11-24T16:02:07.563" Score="1" Body="&lt;p&gt;I would keep the model with p=1 and q=1 even those the null hypothesis that ARCH-term's coefficient equals 0 was not rejected. The reason is that (generally) the less autocorrelations there are in the resulting serie, the more accurate your forecast will be. Indeed if you estimate a model and leaves some autocorrelation it means it is still possible to improve your model by taking benefit of these autocorrelations to produce more accurate forecast. SIC and AIC may be sometime misleading since they only care on specific statistical properties (likelihood, number of parameters...).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally to be sure, I would recommend you to produce forecasts and to keep the &quot;best&quot; model based on a bunch of loss functions.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2015-11-24T16:02:07.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21913" PostTypeId="2" ParentId="16778" CreationDate="2015-11-24T16:19:21.310" Score="1" Body="&lt;p&gt;A good rule of thumb is to &quot;test&quot; your models by doing forecasts and to choose the best one. Note however that your choice will be based upon the loss function you selected. If you are concerned about outliers you should (for instance) use Median Squared Errors, if you don't you can use Mean Square Errors. In your particular case the Information Criteria Statistics highly advocates for the use of the Student distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So as general answer it depends of your aim, the choice will differs if you’re estimating for 1) forecasting, 2) parameters calibration, 3) hedging 4) research …  I don’t think that a formal answer covering all case can be given. The essential is to understand the implication of (not) choosing a model. (ex: if you are particularly concerned with extreme events, the QQ Plot warns you that the Gaussian hypothesis underestimate these events.)&lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2015-11-24T17:52:07.817" LastActivityDate="2015-11-24T17:52:07.817" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21914" PostTypeId="1" AcceptedAnswerId="21931" CreationDate="2015-11-24T16:29:48.450" Score="4" ViewCount="365" Body="&lt;p&gt;I am looking for help in understanding the algebraic derivation to go in between some of the lines in &lt;a href=&quot;http://www.javaquant.net/papers/ConvexityConundrum.pdf&quot; rel=&quot;nofollow&quot;&gt;Pat Hagan's famous Convexity Conundrums paper&lt;/a&gt;&#xA;e.g. how he goes from 3.4a to 3.5a. &lt;/p&gt;&#xA;" OwnerUserId="17348" LastEditorUserId="848" LastEditDate="2015-11-24T21:17:52.207" LastActivityDate="2015-11-25T22:05:26.667" Title="Clarify a derivation in Pat Hagan's Convexity Conundrums" Tags="&lt;mathematics&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21915" PostTypeId="2" ParentId="21900" CreationDate="2015-11-24T17:30:27.520" Score="1" Body="&lt;p&gt;The money market fund could suffer principle loss during crisis and one of them publicly did during the crisis of 2008. I say publicly because there are funds that suffered large loss that would have had them 'break the buck' except their sponsoring organizations bailed them out. I urge you you check out this New York Fed research for a comprehensive look at this topic.&#xA;&lt;a href=&quot;http://libertystreeteconomics.newyorkfed.org/2013/10/twenty-eight-money-market-funds-that-could-have-broken-the-buck-new-data-on-losses-during-the-2008-c.html#.VlSeC7__wWA&quot; rel=&quot;nofollow&quot;&gt;http://libertystreeteconomics.newyorkfed.org/2013/10/twenty-eight-money-market-funds-that-could-have-broken-the-buck-new-data-on-losses-during-the-2008-c.html#.VlSeC7__wWA&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17552" LastActivityDate="2015-11-24T17:30:27.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21916" PostTypeId="2" ParentId="16778" CreationDate="2015-11-24T18:09:05.863" Score="2" Body="&lt;p&gt;To get it out the way: you cannot ask 'what model is better' without a reference to what its use is. Do you want to test for the mean or the AR parameter to trade it? Do you want to calculate VaR? Do you want to forecast volatility over one period? Or over 1000 periods? Or higher moments? Do you want to simulate volatility over one period? Or longer?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For some of these your first model can be perfectly adequate, while for other is will not be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general I do not take 'statistical significance' at face value. It does not mean much. The (very small) standard errors you get are not reliable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having said that, you can look at the qualitative differences that your models reveal. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;They agree on their point estimates of mu and ar1&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The Gaussian model gives very high persistence, alpha1+beta is actually above one. It tries to capture an extremely heavy tail and produces a volatility unit root to achieve that. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you were to simulate vols over longer horizons with the Gaussian model, they would be all over the place. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The Student model gives more stable volatility, the sum is .96. Perhaps it reverts too fast. To achieve that it estimated a very heavy tail, if 'shape' means 'degrees of freedom'. So heave that it barely has a variance. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is that mean reverting though? When the error is that fat tailed volatility will look very choppy. A large jump and then exponential decay. Is that how the world looks like?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What shocks me is the increase in log-likelihood. If you see the second model as an extension of the first by one parameter, then you have a gigantic improvement. Big enough to make me suspicious.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;To me it looks like a process with some Garch perhaps, but with structural changes superimposed. Something very bad happens occasionally, which Garch is trying to mimic. Jump diffusion, regime switching, multi fractal, exponential vol, anything that gives rapid structural changes. If you could give us a plot of the time series (before and after differencing) then we could speculate on that. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;But as I said, it all depends on what you want your model to do. Simple Gaussian Garch(1,1) is hard to beat out of sample consistently.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2015-11-24T18:09:05.863" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21917" PostTypeId="1" CreationDate="2015-11-24T19:35:42.260" Score="2" ViewCount="251" Body="&lt;p&gt;I have a specific framework in mind and I would like to value options under this framework. I am not sure whether a closed form solution exists or Monte Carlo methods would work. &#xA;The framework I have in mind is the one from Lettau and Wachter 2007 (&lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/j.1540-6261.2007.01201.x/abstract&quot; rel=&quot;nofollow&quot;&gt;paper here&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In summary this is the framework:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\epsilon_{t+1}$ denote a 3 × 1 vector of independent standard normal shocks that are independent of variables observed at time t.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $D_t$ denote the aggregate dividend in the economy at time t, and $d_t = ln D_t$. The aggregate dividend is assumed to evolve according to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Delta d_{t+1} = g + z_t + \sigma_d \epsilon_{t+1}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where:&#xA;$z_{t+1} = \phi_z +\sigma_z \epsilon_{t+1}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also assume that the stochastic discount factor is driven by a single state variable $x_t$ where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$x_{t+1} = (1-\phi_x) \bar{x} + \phi_x x_t + \sigma_x \epsilon_{t+1}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma_d, \sigma_x, \sigma_z$ are all 1x3 vectors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The stochastic discount factor is exogenously defined as: &#xA;$M_{t+1} = exp ( -r^f - \frac{1}{2} x_t^2 - x_t \epsilon_{d,t+1})$ where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where: $\epsilon_{d,t+1} = \frac{sigma_d}{\lVert \sigma_d \rVert} \epsilon_{t+1}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is quite straight forward to show that the price-dividend ratio of the equity claim the sum of all the claims to future dividends:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{P_t^m}{D_t} = \sum_{n=1}^\infty \frac{P_{nt}}{D_t} = \sum_{n=1}^\infty exp(A(n) + B_x(n) x_t + B_z(n) z_t)$&#xA;where $A,B_x,B_z$ are solved in closed form solution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now what I am looking is a method to calculate the value of a call option, with strike $K$ and maturity $\tau$ under this framework, meaning:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C(t,\tau,K) = E_t[M_{t,\tau}max(P^m_t-K,0)]  $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not sure whether a closed form solution exists... if not would Monte Carlo, work?&lt;/p&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="16472" LastEditDate="2015-11-27T08:34:43.800" LastActivityDate="2015-12-03T12:18:44.567" Title="Pricing options under a specific framework" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;asset-pricing&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21918" PostTypeId="1" AcceptedAnswerId="21919" CreationDate="2015-11-24T20:35:23.107" Score="1" ViewCount="951" Body="&lt;p&gt;I am looking for references (books and papers) or suggestions on how to price forward starting calls using a PDE approach typically in the Heston model (In the BS world, the computation is trivial), with forward payoff&#xA;$$\left(\frac{S_{t+\tau}}{S_t}-K\right)^{+},$$&#xA;where $t$ and $\tau$ are positive numbers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I feel like the only way to use a PDE approach would be to identify the fundamental solution of the PDE in order to be able to apply the tower property on the expectation of the payoff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All I have read up to know focus computing the characteristic function, and the martingale approach.&lt;/p&gt;&#xA;" OwnerUserId="16981" LastEditorUserId="16981" LastEditDate="2015-11-24T22:17:37.650" LastActivityDate="2015-11-27T05:40:40.313" Title="Pricing Forward Start Option with PDE" Tags="&lt;option-pricing&gt;&lt;forward&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21919" PostTypeId="2" ParentId="21918" CreationDate="2015-11-24T20:58:57.897" Score="0" Body="&lt;p&gt;Here's an approach that's easy to code (&lt;strong&gt;but &lt;em&gt;FAR&lt;/em&gt; from the fastest&lt;/strong&gt;). Let&#xA;$&#xA;f(T,S,v,K)&#xA;$&#xA;denote the price of a European call in the Heston model with time-to-expire&#xA;$T$, initial price $S$, initial volatility $v$, strike $K$. First,&#xA;use the tower property to transform the pricing problem:&#xA;\begin{align*}&#xA;V_{0} &amp;amp; =\mathbb{E}\left[e^{-r\left(t+\tau\right)}\left(S_{t+\tau}/S_{t}-K\right)^{+}\right]\\&#xA; &amp;amp; =\mathbb{E}\left[\frac{e^{-rt}}{S_{t}}\mathbb{E}\left[e^{-r\tau}\left(S_{t+\tau}-KS_{t}\right)^{+}\mid\mathcal{F}_{t}\right]\right]\\&#xA; &amp;amp; =\mathbb{E}\left[\frac{e^{-rt}}{S_{t}}f(\tau,S_{t},v_{t},KS_{t})\right].&#xA;\end{align*}&#xA;Now perform a Monte-Carlo simulation to approximate the above (the advantage here is that you can use existing procedures to compute $f$).&lt;/p&gt;&#xA;" OwnerUserId="18272" LastEditorUserId="18272" LastEditDate="2015-11-27T05:40:40.313" LastActivityDate="2015-11-27T05:40:40.313" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21920" PostTypeId="2" ParentId="21842" CreationDate="2015-11-24T21:50:10.213" Score="1" Body="&lt;h1&gt;On the historical vs implied calibration:&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;First, we model prices have to be &lt;strong&gt;arbitrate free&lt;/strong&gt;. If you estimate the parameters based on history they do not necessarily have to agree with the current market prices. But then that's arbitrage. Or is it your historic estimation wrong? Instead of pondering whichever it is you can just fit your model to the market and voila - the market prices are consistent with the model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly, there is a story of &lt;strong&gt;two worlds&lt;/strong&gt; - risk free and real world. When you're calibrating to the current prices your model is a tool that gives you a way to price other options using the risk neutral methodology. On the other hand, when you're estimating it from historical perspective you have to make sure that history repeats and that real world is still the same. But that model is NOT a tool, its an possibility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking these two into account I think the answer is - it depends. If you are a large firm (ie. bank or some other market maker ) that makes commission bucks over large volumes of derivatives it might be extremely pricey to believe in your historical model and provide quotes that are not consistent with the market. On the other hand, a fund or another trading firm that makes money from longing the rising assets and shorting the plummeting ones - then you might have the bankroll to believe in the right model. &lt;/p&gt;&#xA;&#xA;&lt;h1&gt;On the historical vs implied calibration:&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Have no experience on historical calibration, so can't say much. Just that I would try calibrating the Heston model to the option prices for each day that you have and then somehow average (maybe moving-average) the parameters?&lt;/p&gt;&#xA;" OwnerUserId="2644" LastActivityDate="2015-11-24T21:50:10.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21921" PostTypeId="1" AcceptedAnswerId="21927" CreationDate="2015-11-24T22:08:09.567" Score="1" ViewCount="176" Body="&lt;ol&gt;&#xA;&lt;li&gt;Implied volatility&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The way I understand it, traders often think of implied volatility as a transformed price. So in a way, the Black Scholes model is considered a 'model-free' blackbox that takes a market price and returns an 'implied volatility'. A trader might very well say 'I bought AstraZeneca at 20 vol'. &#xA;Why is that they prefer implied vol as a price?&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;Implied vol surface&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;When you devise a new stochastic volatility model, you want it to match the empirical volatility surface as closely as possible (thereby matching the price surface as closely as possible because there is this one to one relationship between implied volatility and price). Why do quants prefer the implied vol surface instead of bespoke price surface?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="18415" LastActivityDate="2015-11-25T12:13:40.357" Title="Implied volatility as price transform" Tags="&lt;implied-volatility&gt;&lt;stochastic-volatility&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21922" PostTypeId="2" ParentId="21842" CreationDate="2015-11-24T22:10:39.730" Score="2" Body="&lt;p&gt;I suggest taking a look at optimal hedge Monte Carlo and by extension the garam model from &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1428555&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1428555&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The basic issue is that a risk premium exists in option markets which is like Vol also unobserved. The better your guess of the future realized vol distribution, the better your guess of the risk premium currently implied by option markets. Then the basic question is does your forecast of option pnl relative to the risk compensate you enough to trade?&lt;/p&gt;&#xA;" OwnerUserId="1105" LastActivityDate="2015-11-24T22:10:39.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21923" PostTypeId="1" CreationDate="2015-11-25T00:10:33.257" Score="4" ViewCount="185" Body="&lt;p&gt;I downloaded the “E-mini S&amp;amp;P 500 (Dollar) Options for 1/10/11” Top-of-Book (BBO) data. If you are interested you may download the data from the following link (approx. 80MB zipped and 1GB unzipped)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cmegroup.com/market-data/datamine-historical-data/files/XCME_ES_OPT_110110.zip&quot; rel=&quot;nofollow&quot;&gt;http://www.cmegroup.com/market-data/datamine-historical-data/files/XCME_ES_OPT_110110.zip&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The data fields are described in the Best Bid Best Offer ASCII Layout table which can be found in the following link&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cmegroup.com/confluence/display/EPICSANDBOX/Best+Bid+Best+Offer+ASCII+Layout&quot; rel=&quot;nofollow&quot;&gt;http://www.cmegroup.com/confluence/display/EPICSANDBOX/Best+Bid+Best+Offer+ASCII+Layout&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The basic idea is that each observation contains information about the Best Bid (highest buying quote) or Best Offer (Ask – the lowest selling quote) or the last trade.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don’t understand the meaning of some of the Data Fields. I extensively searched the CME website but couldn’t find any answer. The data fields that puzzle me are the following&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Close/Open Type: Indicator for Open ( O ) / Close ( C )&lt;/li&gt;&#xA;&lt;li&gt;Valid Open Exception: Indicator for Special Open ( O )&lt;/li&gt;&#xA;&lt;li&gt;Post Close: Indicator for prices traded after the market close ( P )&lt;/li&gt;&#xA;&lt;li&gt;Insert Code Type: Indicator for  Inserted prices ( I )&lt;/li&gt;&#xA;&lt;li&gt;Fast/Late Indicator: Indicator for Fast/Late Market ( F )&lt;/li&gt;&#xA;&lt;li&gt;Cabinet Indicator: Indicator for cabinet trades ( $ )&lt;/li&gt;&#xA;&lt;li&gt;Book Indicator: Indicator for Book quotes ( B )&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The reason I want to understand these fields is because I am trying to match this database with similar database provided by the Options Price Reporting Authority (OPRA). The data were obtained by TickData. The documentation may be found in the following link&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://s3-us-west-2.amazonaws.com/tick-data-s3/pdf/TickData_File_Format_Overview_US_Options.pdf&quot; rel=&quot;nofollow&quot;&gt;https://s3-us-west-2.amazonaws.com/tick-data-s3/pdf/TickData_File_Format_Overview_US_Options.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The basic idea about the TickData data is that each observation contains for each time the best bid/best offer or trade. In addition it provides the OPRA Condition Code for Quote and Trade Records. I hope that if I understand the above data field indicators I will be able to match them with the OPRA Condition Codes. &lt;/p&gt;&#xA;" OwnerUserId="11958" LastEditorUserId="2299" LastEditDate="2018-06-24T12:50:14.940" LastActivityDate="2018-06-24T12:50:14.940" Title="Match different option high frequency databases" Tags="&lt;options&gt;&lt;data&gt;&lt;trading&gt;&lt;high-frequency&gt;&lt;market-microstructure&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21924" PostTypeId="2" ParentId="15976" CreationDate="2015-11-25T07:05:26.590" Score="5" Body="&lt;p&gt;Interactive Brokers offers historical data for VIX options. You need to have an account , other than that - historical data downloads are available for no extra charge. You have to write some code to download the data and deal with pacing violations and API request restrictions (no more than 2000 bars returned per request), so you'd have to split time duration into several smaller ones, if you need to download more data than fits in that limit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can look a tool like this one, I decided that it is much easier than spending time to code my own solution...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.tradinggeeks.net/downloads/ib-data-downloader/&quot; rel=&quot;noreferrer&quot;&gt;http://www.tradinggeeks.net/downloads/ib-data-downloader/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18421" LastActivityDate="2015-11-25T07:05:26.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21925" PostTypeId="2" ParentId="17993" CreationDate="2015-11-25T10:08:16.967" Score="2" Body="&lt;p&gt;To say a curve is arbitrage-free, you need to pick an arbitrage path; a series of trades which, when followed, yield a net profit without creating exposure. We neglect counterparty exposure here, since you are presumably using market-neutral rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One arbitrage is to buy a swap from your curve, and sell at the market price. This is a test of your curve construction. If your curve is not an exact bootstrap (e.g. you've done some Excel optimisations to find solutions etc), then you might be able to price one of the inbound swaps outside the bid/ask spread of the input rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The majority of curve bootstrap methods are arbitrage-free by construction - by constructing a curve that re-prices your inputs exactly, there is no certain arbitrage. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There may be better or worse properties of the curve, however; do the overnight rates of the OIS curve turn unrealistically positive or negative? Are there sharp changes to the forward expected fixings implied by FRA rates calculated from the curve? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes there is more information available, which you are not using. For example, in the short term OIS curves only generally shift on central bank meeting dates, so often we can use the available market data to work out what the market thinks will happen on that date. If you ignore those dates, you could be asked for OIS quotes (or other prices that depend on the OIS rates) around those dates, where you will be too high or low. But that falls into the category of information that is available but you are ignoring; to construct an arbitrage argument you would implicitly have to construct a better curve and show how it is better, which is not less difficult than making the better curve in the first place.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As @MattBecker82 points out, people used to assume rates could not go negative without an implied arbitrage (they can and currently are for EUR), just like they used to assume that cross currency basis was an arbitrage, or 3s6s basis for 0x6, or a difference between swap prices on LCH and CME, ad nauseam.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2015-11-25T10:08:16.967" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21926" PostTypeId="2" ParentId="21918" CreationDate="2015-11-25T10:50:18.493" Score="1" Body="&lt;p&gt;You introduce a discretized auxiliary variable which represents $S_t$ to solve $N$ PDEs on $[t, t+\tau]$ using finite differences which will give you the present value of the option at time $t$ conditional on $S_t$. Then you solve one PDE using finite differences on $[0, t]$ to obtain the the present value at time $0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the same methodology than that used for pricing path dependent options using finite differences. The general idea is to transform a non markovian problem into a markovian problem of higher dimension by adding auxiliary variables that capture the past.  &lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2015-11-25T10:50:18.493" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21927" PostTypeId="2" ParentId="21921" CreationDate="2015-11-25T12:13:40.357" Score="2" Body="&lt;p&gt;It is difficult to gain intuition by just looking at the price surface, and it is also easier to calibrate models on the volatility surface rather than on the price surface because with the later you are dealing with numbers of very different sizes (depending on the moneyness and maturity) which is not good for minimization algorithms. However low and high strikes extrapolation of the volatility surface are often specified in terms of parametric functions for the price.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A useful quantity directly related to the price surface is its second derivative w.r.t strike because it gives you the (discounted) implied density of the underlying asset. &lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2015-11-25T12:13:40.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21928" PostTypeId="2" ParentId="8251" CreationDate="2015-11-25T12:38:27.793" Score="13" Body="&lt;p&gt;Let’s take a simple example to answer a broad but interesting question:&lt;/p&gt;&#xA;&lt;p&gt;Imagine that we have a daily return serie denoted &lt;span class=&quot;math-container&quot;&gt;$r_{t}$&lt;/span&gt; ( which is assumed to be stationary) and let's take a little time to define main concepts :&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Mean Process (First moment process)&lt;/em&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The &lt;strong&gt;unconditional&lt;/strong&gt; mean of &lt;span class=&quot;math-container&quot;&gt;$r_{t}$&lt;/span&gt; denoted &lt;span class=&quot;math-container&quot;&gt;$u$&lt;/span&gt; is just its expectation &lt;span class=&quot;math-container&quot;&gt;$E(r_{t})$&lt;/span&gt;. &lt;em&gt;It is not time varying&lt;/em&gt;. You can compute it directly using the expectation formula.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The &lt;strong&gt;conditional mean process&lt;/strong&gt; refers to the expectation of the serie at time &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt; given previous information: &lt;span class=&quot;math-container&quot;&gt;$E_{t}(y_{t}|\Omega_{t-1})$&lt;/span&gt;. &lt;em&gt;It is time varying&lt;/em&gt; and that is the reason way we write it using a time subscript: &lt;span class=&quot;math-container&quot;&gt;$u_{t}$&lt;/span&gt;. This process is usually estimated using autoregressive–moving-average (ARMA) models. The intuition is that we can detect some autocorrelations in the returns series (ex: if day one is up, the day after has more probability to be down...it is an example)&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;So far so good, we may assume that we can compute a simple &amp;quot;average&amp;quot; return (unconditional mean) or a time-varying (i.e conditional) &amp;quot;average&amp;quot; return.&lt;/p&gt;&#xA;&lt;p&gt;However usually people are also concerned with risk. If you know that your returns in average follow a process, you are likely also interested in uncertainty/risk. In finance, risk is usually approximated using the second moment (ie the variance).&lt;/p&gt;&#xA;&lt;p&gt;Now let's jump to the variance part:&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Conditional variance Process (Second moment)&lt;/em&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Similarly that for the mean process, we are able to estimate the &lt;strong&gt;unconditional&lt;/strong&gt; variance of our return serie using a simple variance formula &lt;span class=&quot;math-container&quot;&gt;$\sigma^{2} = Var(r_{t}) $&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Now imagine our return series exhibits &amp;quot;large changes followed by large changes...&amp;quot; during few days and goes back to its original unconditional variance level. We may realize that the variance is in fact time varying : we observe some &amp;quot;volatility clustering&amp;quot;. In a same way that for the conditional mean process we can build a &lt;strong&gt;conditional variance&lt;/strong&gt; process. To this end we use different tools : the Garch family models which allows us to model a time-varying variance : &lt;span class=&quot;math-container&quot;&gt;$\sigma_{t}^{2} = Var_{t}(r_{t}|\Omega_{t-1}) $&lt;/span&gt;. (Others models exist such as Stochastic volatility models).&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;Now we have defined the main concepts we can jump to your question :&lt;/p&gt;&#xA;&lt;h2&gt;How to calculate the conditional variance of a time series?&lt;/h2&gt;&#xA;&lt;p&gt;&lt;strong&gt;Intuition&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Firstly we model the conditional mean process (using a ARMA,ARFIMA...) and subtract it from the original returns series to obtain the &amp;quot;return residuals&amp;quot; : &lt;span class=&quot;math-container&quot;&gt;$r_{t}-\mu_{t} =\epsilon_{t} = \sigma_{t} z_{t}$&lt;/span&gt; where &lt;span class=&quot;math-container&quot;&gt;$z_{t}$&lt;/span&gt; is an i.i.d process with  &lt;span class=&quot;math-container&quot;&gt;$E_{t}(z_{t}) = 0$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$Var_{t}(z_{t}) =1$&lt;/span&gt;. Note that the conditional variance of  &lt;span class=&quot;math-container&quot;&gt;$\epsilon_{t}$&lt;/span&gt;  is equal to &lt;span class=&quot;math-container&quot;&gt;$\sigma_{t}^{2}$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;However since we know that the variance is time varying we also know that &lt;span class=&quot;math-container&quot;&gt;$\sigma_{t}^{2}$&lt;/span&gt; has a time dependent structure and exhibits autocorrelations (so do the squares returns residuals). We can model it using GARCH class of models which can (very roughly) be seen as ARMA models for the conditional variance process.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Example of a Garch(1,1)  : &lt;span class=&quot;math-container&quot;&gt;$\sigma_{t}^{2} = a + \alpha \epsilon_{t-1}^{2}  + \beta \sigma_{t-1}^{2} $&lt;/span&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Once we fit our conditional variance models we will be left with the conditional variance process &lt;span class=&quot;math-container&quot;&gt;$\sigma_{t}^{2} $&lt;/span&gt;.At this point we know the conditional variance process &lt;span class=&quot;math-container&quot;&gt;$\sigma_{t}^{2} $&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$\epsilon_{t}^{2}$&lt;/span&gt;. This allow us to obtain the final &lt;em&gt;standardized&lt;/em&gt; residuals series &lt;span class=&quot;math-container&quot;&gt;$z_{t}$&lt;/span&gt; which is i.i.d and equal to  &lt;span class=&quot;math-container&quot;&gt;$\epsilon_{t}/\sigma_{t} =  z_{t}$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Estimation&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;How do we estimate it ?&lt;/p&gt;&#xA;&lt;p&gt;The simplest way is to rely on  the Maximum Likelihood Estimation (MLE) method. We need to assume a distribution for the &lt;span class=&quot;math-container&quot;&gt;$z_{t}$&lt;/span&gt; (the final residuals). Since we know that these residuals are i.i.d it is easy to compute the  log-likelihood for a given &lt;span class=&quot;math-container&quot;&gt;$z_{t}$&lt;/span&gt; serie.  (to be more precise the typical arguments for the likelihood function are &lt;span class=&quot;math-container&quot;&gt;$\epsilon_{t}^{2}$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$\sigma_{t}^{2}$&lt;/span&gt;)&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Example : If we assume a normal distribution for &lt;span class=&quot;math-container&quot;&gt;$z_{t}$&lt;/span&gt; the log likelihood (assuming no  constant) is given by : &lt;span class=&quot;math-container&quot;&gt;$LogLik =  -\frac{1}{2}  \sum_{1}^{T} \left[ \log(2 \pi) + \log(\sigma_{t}^{2}) + z_{t}^{2} \right] \qquad (= -\frac{1}{2}  \sum_{1}^{T} \left[ \log(2 \pi) + \log(\sigma_{t}^{2}) + \frac{\epsilon_{t}^{2}}{\sigma_{t}^{2}} \right])$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;But how can we practically obtain  &lt;span class=&quot;math-container&quot;&gt;$z_{t}$&lt;/span&gt;   ? A solution is to use what we called &amp;quot;filters&amp;quot; takings as input the returns series and, based on a particular specifications (ex: arma(1,1)-garch(1,1)), returning  &lt;span class=&quot;math-container&quot;&gt;$\sigma_{t}^{2}$&lt;/span&gt;. By &amp;quot;filtering&amp;quot; we mean that we applied the autoregressive framework (recursive algorithm on both the mean and variance) on the input serie (the return serie) to obtain as output the &lt;span class=&quot;math-container&quot;&gt;$ z_{t}$&lt;/span&gt; .&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;An example ? : see this very nice post (see Solution added by the author) :  &lt;a href=&quot;https://quant.stackexchange.com/questions/9351/algorithm-to-fit-ar1-garch1-1-model-of-log-returns&quot;&gt;Algorithm to fit AR(1)/GARCH(1,1) model of log-returns&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Next we can use some maximization algorithms to find the parameters producing a &lt;span class=&quot;math-container&quot;&gt;$z_{t}$&lt;/span&gt; serie which maximize the likelihood.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Ex: we run the filter with AR parameter = 0.1 ; next we try another value, and so on with all parameters to obtain the final parameters maximizing the likelihood.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Finally to obtain the standards errors of the estimated parameters we may use the Hessian.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Ok, but in practice ?&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;You can use &amp;quot;click to run&amp;quot; softwares to estimate (and much more) the conditional variance/mean processes. Matlab, R ,  and Ox (among others) have packages devoted to this estimation.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Example of packages :&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.mathworks.com/products/matlab&quot; rel=&quot;noreferrer&quot;&gt;Matlab&lt;/a&gt;: Financial Toolbox, kevin sheppard Toolbox.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.r-project.org/&quot; rel=&quot;noreferrer&quot;&gt;R&lt;/a&gt;:    arfima,rugarch, packages - see also &lt;a href=&quot;https://www.rmetrics.org/&quot; rel=&quot;noreferrer&quot;&gt;Rmetrics&lt;/a&gt; – see    &lt;a href=&quot;https://quant.stackexchange.com/questions/4948/how-to-fit-armagarch-model-in-r&quot;&gt;How to fit ARMA+GARCH Model In R?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.doornik.com/ox/&quot; rel=&quot;noreferrer&quot;&gt;Ox&lt;/a&gt;: G@rch package of S. Laurent .&lt;/li&gt;&#xA;&lt;li&gt;Others : see comments.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;&lt;em&gt;Remarks&lt;/em&gt;&lt;/p&gt;&#xA;&lt;p&gt;-This is a simplification example:  models currently used in the literature are much more advanced, for instance the Arch-in-mean class of models add the conditional variance as an explanatory variable in the conditional mean process.&lt;/p&gt;&#xA;&lt;p&gt;-You are not forced to use filters if you can compute directly the likelihood based on the parameters.&lt;/p&gt;&#xA;&lt;p&gt;-In reality, the estimation part is far more difficult to do, as illustration the choice of starting values is a tricky part.&lt;/p&gt;&#xA;&lt;p&gt;-If you want to recommend another software/package just add it in the comments.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2018-12-06T08:06:21.713" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="21929" PostTypeId="2" ParentId="19440" CreationDate="2015-11-25T13:29:13.880" Score="2" Body="&lt;p&gt;The presence of a mandatory break in a swap contract should reduce the CVA charge.  That's because the CVA calculation models the default probability* swap market value while the swap is alive, so the calculation stops at the break date.   There is one caveat:  if a bank has a history of &quot;waiving&quot; mandatory breaks (i.e. In practice they never get exercised ) then the regulators can challenge his treatment. That would be a bank by bank discussion. So if you put one in, be prepared to execute it.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To clear up any confusion, a mandatory break is satisfied at the then market value, typically as determined by s panel of banks ( this needs to be specified in the confirm). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Optional breaks:  if a counterparty grants a bank an optional break then then theoretically it should reduce the cva charge as for the mandatory breaks.  However the implication is that on the break date either the break is exercised or the bank must demand a further cva charge to continue the swap (even if client credit is not impaired in any way).  The cva desk may believe it will be unable to collect this value or even to execute the break against a valuable client.  Hence the optional break may not achieve the full cva charge reduction at many banks.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastEditorUserId="18388" LastEditDate="2015-11-26T13:30:05.823" LastActivityDate="2015-11-26T13:30:05.823" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21930" PostTypeId="2" ParentId="549" CreationDate="2015-11-25T15:23:49.757" Score="10" Body="&lt;p&gt;Although quite simple connected scatterplots can give interesting new insights on how time series perform together:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://steveharoz.com/research/connected_scatterplot/&quot; rel=&quot;noreferrer&quot;&gt;http://steveharoz.com/research/connected_scatterplot/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example: Gold vs. S&amp;amp;P 500 from 1970 till today:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/zBAk0.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/zBAk0.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The green point marks 1970, the red point is today. Every point is a year, moving vertically upwards means rise in the S&amp;amp;P 500 without gold changing, moving horizontally to the right vice versa. The diagonal line would be perfect correlation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the given website are many example to play with and there is an accompanying paper which can be downloaded (pdf) free of charge.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2015-11-25T15:23:49.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21931" PostTypeId="2" ParentId="21914" CreationDate="2015-11-25T15:52:30.423" Score="5" Body="&lt;h2&gt;Swap&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Just to be clear, (3.4c) leads to (3.5a) when we assume lognormal $R(\tau)$. Lognormal $R(\tau)$ means we can write&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R(\tau) = R_0 e^{-\frac{1}{2}\sigma^2 \tau + \sigma \sqrt{\tau} Z}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $Z$ normal, and I'm assuming a zero mean -- which I think is required. Then for (3.4c) we have for the expectation value:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ E\left[(R(\tau) - R_0)^2 \right] = (R_0)^2 E\left[(e^{-\frac{1}{2}\sigma^2 \tau +  \sigma \sqrt{\tau} Z} - 1)^2 \right] = &#xA;(R_0)^2 E\left[e^{-\sigma^2 \tau + 2 \sigma \sqrt{\tau} Z} - 2 e^{-\frac{1}{2}\sigma^2 \tau + \sigma \sqrt{\tau} Z} + 1\right] $$ &#xA;Now, recall that:&#xA;$$E[e^{a Z}] =\int_{-\infty}^{\infty} e^{a Z} \frac{e^{-Z^2/2}}{\sqrt{2\pi}} dZ = &#xA;e^{\frac{a^2}{2} }\int_{-\infty}^{\infty}  \frac{e^{-(Z-a)^2/2}}{\sqrt{2\pi}} dZ = e^{\frac{a^2}{2} } $$&#xA;So&#xA;$$ (R_0)^2 E\left[e^{-\sigma^2 \tau + 2 \sigma \sqrt{\tau} Z} - 2 e^{-\frac{1}{2}\sigma^2 \tau + \sigma \sqrt{\tau} Z} + 1\right] = (R_0)^2  (e^{-\sigma^2 \tau +2\sigma^2\tau }- 2 e^{-\frac{1}{2}\sigma^2 \tau +\frac{1}{2}\sigma^2\tau} +1)=(R_0)^2 (e^{\sigma^2 \tau}-1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this explains how (3.5a) follows from (3.4c) (you can fill in the remaining factors yourself).&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Cap&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Next I'll look at (3.4a) which, after assuming lognormality of $R$, results in (3.5b). The expectation value of interest is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E[(R(\tau) − RR_0)[R(\tau) − K]^+] = E[R(\tau) [R(\tau) − K]^+] - R_0 E[[R(\tau) − K]^+]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second term is the usual expression for a call option, so in the Black scholes framework this is simply given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R_0 E[[R(\tau) − K]^+] =R_0(R_0 \mathcal{N}(d_{1/2}) - K\mathcal{N}(d_{-1/2}))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can already spot these terms in expression (3.5b). The other expectation value is a bit trickier, as we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E[R(\tau) [R(\tau) − K]^+] = R_0 E[e^{-\frac{1}{2}\sigma^2 \tau + \sigma \sqrt{\tau} Z} [R_0e^{-\frac{1}{2}\sigma^2 \tau + \sigma \sqrt{\tau} Z} − K]^+]  $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is of the form&#xA;$$ E[ S e^{aZ} [S e^aZ - K]^+] = S\int_{-\infty}^{\infty} e^{a Z} [S e^{aZ} - K]^+\frac{e^{-Z^2/2}}{\sqrt{2\pi}} dZ  $$ &#xA;$$=Se^{\frac{a^2}{2}}\int_{-\infty}^{\infty}  [S e^{aZ} - K]^+\frac{e^{-(Z-a)^2/2}}{\sqrt{2\pi}}  dZ $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next we sub $Z\rightarrow W = Z-a$, giving&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Se^{\frac{a^2}{2}}\int_{-\infty}^{\infty}  [S e^{a(W+a)} - K]^+\frac{e^{-W^2/2}}{\sqrt{2\pi}}  dW = Se^{\frac{a^2}{2}} E[S e^{a^2 + aW} - K]^+]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now recall that $a=\sigma\sqrt{\tau}$ and $S=R_0 e^{-\frac{1}{2}\sigma^2 \tau}$. Then this expectation value becomes&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ R_0 E[R_0 e^{\frac{1}{2}\sigma^2 \tau + aW} - K]^+] = R_0 E[e^{\sigma^2 \tau} R(\tau)  - K]^+]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That was a lot of effort just to show that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E[R(\tau) [R(\tau) − K]^+] = R_0 E[e^{\sigma^2 \tau} R(\tau)  - K]^+]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;provided $R(\tau)$ is lognormal with zero mean. The right hand side is just a call option, but with spot equal to $R_0 e^{\sigma^2 \tau}$. This gives&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E[R(\tau) [R(\tau) − K]^+] = (R_0)^2 e^{\sigma^2 \tau}\mathcal{N}(e_{1/2}) - R_0 K\mathcal{N}(e_{-1/2})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&#xA;$$ e_{1/2} = \frac{\log(\frac{R_0 e^{\sigma^2 \tau}}{K}) + \frac{1}{2}\sigma^2 \tau}{\sigma \sqrt{\tau}} =\frac{\log(\frac{R_0}{K}) +\frac{3}{2}\sigma^2 \tau}{\sigma \sqrt\tau} = d_{3/2}$$&#xA;$$ e_{-1/2}=\frac{\log(\frac{R_0 e^{\sigma^2 \tau}}{K}) -\frac{1}{2}\sigma^2 \tau}{\sigma \sqrt{\tau}} =\frac{\log(\frac{R_0}{K}) +\frac{1}{2}\sigma^2 \tau}{\sigma \sqrt\tau} = d_{1/2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E[R(\tau) [R(\tau) − K]^+] = (R_0)^2 e^{\sigma^2 \tau}\mathcal{N}(d_{3/2}) - R_0 K\mathcal{N}(d_{1/2})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{equation}&#xA;E[(R(\tau) − R_0)[R(\tau) − K]^+]= (R_0)^2 e^{\sigma^2 \tau}\mathcal{N}(d_{3/2}) - R_0 K\mathcal{N}(d_{1/2}) -  R_0(R_0 \mathcal{N}(d_{1/2}) - K\mathcal{N}(d_{-1/2})) \\&#xA;= (R_0)^2 e^{\sigma^2 \tau}\mathcal{N}(d_{3/2})  - R_0(R_0+K)\mathcal{N}(d_{1/2}) + R_0 K\mathcal{N}(d_{-1/2}) &#xA;\end{equation}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is (part of) equation (3.5b). This should convince you that (3.5b) follows from (3.4a).&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Floor&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I'll leave you this one.&lt;/p&gt;&#xA;" OwnerUserId="3371" LastEditorUserId="3371" LastEditDate="2015-11-25T22:05:26.667" LastActivityDate="2015-11-25T22:05:26.667" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21932" PostTypeId="1" CreationDate="2015-11-25T16:14:14.653" Score="3" ViewCount="145" Body="&lt;p&gt;There is a paper &lt;a href=&quot;http://www.math.ethz.ch/~hmsoner/pdfs/38-Soner-FS-98.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Option pricing with transaction costs and a nonlinear black-scholes equation&lt;/a&gt; by Guy Barles and Halil Mete Soner. And there is a section about optimal (delta) hedging, which I do not fully understand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The conclusion of optimal hedge section states that:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/N3nSD.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/N3nSD.png&quot; alt=&quot;part of pdf&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what is g() here? I couldn't find it's definition previously. Can someone give a real (numeric) example of calculations according to this model? I mean something like: we sell a call/put with strike S, it's delta is d, T days to expiration, etc. And after calculation we get the interval [y1, y2].&lt;/p&gt;&#xA;" OwnerUserId="18428" LastEditorUserId="18428" LastEditDate="2015-11-26T07:56:23.587" LastActivityDate="2015-11-26T07:56:23.587" Title="Example of optimal delta hedging in G. Barles, H.M. Soner option pricing paper" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;hedging&gt;&lt;delta-hedging&gt;&lt;delta-neutral&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21933" PostTypeId="2" ParentId="11026" CreationDate="2015-11-25T23:40:37.417" Score="3" Body="&lt;p&gt;&lt;em&gt;What is the mathematical basis to say that $u^{2}_{t}/\sigma_{t}^{2}$ will exhibit little auto-correlation in the series?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's $r_{t}$ be a series of returns and let's assume (Assumption I) it follows a covariance stationary process defined as :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_{t}=\sigma_{t} z_{t}$  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $z_{t}$ is i.i.d with $E_{t}(z_{t})=0$ and $Var_{t}(z_{t})=1$ ;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Then $ Var_{t}(r_{t}) =\sigma_{t}^{2}$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Next if we assume (Assumption II) that the conditional variance process of $r_{t}$ follows a GARCH(1,1), it means (Bollerslev (1986)) :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma_{t}^{2} = w + \alpha r_{t-1}^{2} + \beta \sigma_{t-1}^2 $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can be shown that the precedent equation can be rewritten using an ARMA(1,1) representation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_{t}^{2} = w + (\alpha +\beta) r_{t-1}^{2} +  v_{t} - \beta v_{t-1} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $ v_{t} = r_{t}^{2} - \sigma_{t}^{2}$&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;without going into the math you see that $r_{t}^{2} $ has some autocorrelations since it has an autoregressive structure.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_{t}^{2}=\sigma_{t}^{2} z_{t}^{2}$  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$z_{t}^{2}=r_{t}^{2} /\sigma_{t}^{2}$  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But we know that $z_{t}$ is IID(0,1),then its squares will also be IID.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;So if assumptions I and II are respected the series $z_{t}^{2}=r_{t}^{2} /\sigma_{t}^{2}$ (the standardized residuals) will be IID and will exhibit no autocorrelations at all. If the DGP is not perfectly in line with our assumptions (but still close enough), the series will exhibit little autocorrelation since $z_{t}$ will be &lt;em&gt;almost&lt;/em&gt; IID.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2015-11-26T00:13:42.677" LastActivityDate="2015-11-26T00:13:42.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21934" PostTypeId="1" CreationDate="2015-11-25T23:45:57.883" Score="1" ViewCount="229" Body="&lt;p&gt;I'm currently working on the requirements phase of a software project, and need get an overview of the industry regarding the tools available for Algo Trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first idea was to look for Gartner's Magic Quadrant for Trading Platforms. But I wonder if there is abetter document out there.&lt;/p&gt;&#xA;" OwnerUserId="18431" LastActivityDate="2015-11-25T23:45:57.883" Title="Good state of the art document about Algo Trading systems" Tags="&lt;automated-trading&gt;&lt;algorithmic-trading&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21935" PostTypeId="1" AcceptedAnswerId="22145" CreationDate="2015-11-26T08:18:47.537" Score="1" ViewCount="313" Body="&lt;p&gt;I want to compare the performance of various volatility models like GARCH, eGARCH, and gjrGARCH from actual volatility(computed using high frequency data). I found 3 common performance evaluation measures used profoundly in literature ie Root Mean Square Error(RMSE), Mean Absolute Error(MAE), and Mean Absolute Percentage Error(MAPE). But I found conflicting results from above 3 criteria, like I found RMSE is minimum for GARCH model, MAE is minimum for eGARCH model, and MAPE is minimum for gjrGARCH model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to know which one is the best measures for evaluating performance and which results should I report?If all three are equally valid then how can I interpret the results? Is there any other way to compare the performance of various volatility models other than performance measures ?&lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2015-12-07T19:36:49.120" Title="Which one is best Performance evaluation measures?" Tags="&lt;volatility&gt;&lt;performance-evaluation&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21936" PostTypeId="2" ParentId="21935" CreationDate="2015-11-26T13:00:26.437" Score="1" Body="&lt;p&gt;If you are interested in evaluating forecasts accuracy, you could compare Value-at-risk forecasts. It has the advantage to take into account the forecast density (via quantile). Then you can compare easily their forecast accuracy via the Kupiec test for instance. Because if you just use points forecasts as it seems you are doing your results won't take the uncertainty of your point forecasts into account. In this case the ranking of your models will highly depends of the loss function specified and of actual realizations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally you can also have a look to the Mincer-Zarnowitz regression, which is easy to implement (&lt;em&gt;Mincer, J., and V. Zarnowitz (1969): The Evaluation of Economic Forecasts Economic Forecasts and Expectations. in J.Mincer, New York: National Bureau of Economic Research.&lt;/em&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I think you'll get more stable results if you stick to VaR forecasts (ie point forecasts + the confidence interval) instead of comparing point forecasts.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2015-11-26T19:49:33.313" LastActivityDate="2015-11-26T19:49:33.313" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21937" PostTypeId="1" AcceptedAnswerId="22598" CreationDate="2015-11-26T13:24:42.550" Score="1" ViewCount="249" Body="&lt;p&gt;The derived class is a &lt;strong&gt;Vanilla Option on a Future&lt;/strong&gt; and I need to specify the expiry of the underlying future which is in general different (later) than the expiry of the Vanilla Option. I have implemented a couple of &lt;code&gt;PricingEngine&lt;/code&gt; that derive from &lt;code&gt;VanillaOption::engine&lt;/code&gt; and for the moment their respective &lt;code&gt;calculate()&lt;/code&gt; methods assume that the expiry of the future coincides with the expiry of the option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I plan to proceed as follows:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Declare the derived class &lt;strong&gt;VanillaOptionFuture&lt;/strong&gt; as follows: &lt;code&gt;class VanillaOptionFuture : public VanillaOption&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Define a new type of argument for this class as follows: &lt;code&gt;class VanillaOptionFuture::arguments : public VanillaOption::arguments&lt;/code&gt; and add a new field called &lt;code&gt;futureExpiry_&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Redefine the method &lt;code&gt;setupArguments&lt;/code&gt; for class &lt;code&gt;VanillaOptionFuture&lt;/code&gt; in order to call the homonymous method of class &lt;code&gt;VanillaOption&lt;/code&gt; plus setting the &lt;code&gt;futureExpiry_&lt;/code&gt; field of the arguments class, which will be passed to the constructor of the class.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; I would like to keep my pricing engines working for the general case of a &lt;code&gt;VanillaOption&lt;/code&gt; with the default behavior &lt;code&gt;futureExpiry_ = arguments_.exercise-&amp;gt;lastDate()&lt;/code&gt;. I was thinking on leaving the declarations of my pricing engines as they are and just deal with the two cases directly in the &lt;code&gt;calculate()&lt;/code&gt; methods by using &lt;code&gt;boost::dynamic_pointer_cast&lt;/code&gt;. Do you think this is the right way to proceed? Thanks for any advice.&lt;/p&gt;&#xA;" OwnerUserId="17408" LastActivityDate="2016-01-05T14:29:24.430" Title="QuantLib: New Instrument derived from VanillaOption + PricingEngine that must work for both VanillaOption and the derived class" Tags="&lt;options&gt;&lt;programming&gt;&lt;futures&gt;&lt;quantlib&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21938" PostTypeId="2" ParentId="21900" CreationDate="2015-11-26T13:49:19.017" Score="3" Body="&lt;p&gt;Clearly the money markets are likely to freeze up in a crisis situation.  They did exactly that in 2008.   Specifically:&#xA;A) people don't want to lend money unsecured to banks, so bank commercial paper goes below par in the market. &#xA;B) understanding this , people try to liquidate money market funds containing bank cp at par, so a run develops on money market funds. &#xA;C). Banks are then unable to roll their cp funding into new cp, so they must find other sources of funding when the cp matures. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There have been some changes which hopefully will decrease these effects next time there is s crisis:   Banks have reduced their reliance on commercial paper and other short term funding.  Also , there is legislation being considered that would require money market funds containing bank and corporate paper to maintain a nav instead of always being at par.  However there isn't much doubt that the money market will be under pressure whenever there's a credit crisis.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2015-11-26T13:49:19.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21939" PostTypeId="2" ParentId="21415" CreationDate="2015-11-26T14:45:28.987" Score="1" Body="&lt;p&gt;Conservatism depends on your &lt;em&gt;frame of reference&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To address your question specifically, conservatism refers to the concept of a quantity being marginally higher (or lower) with respect to a relative quantity. I realize this is quite general, but the definition itself is general and depends on what you're describing. Stating a quantity is conservative does not give you a indication of whether it is 'comparatively small', it does not tell you anything about the magnitude of the conservatism. It only indicates direction.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;For example, if one applies a conservative haircut to a counterparty's&#xA;  collateral, is this a small haircut?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;A conservatism haircut in this case means that you (not the counterparty) will reduce the collateral you post. So if the collateral is assessed at 100, you may use an estimate of 90. You may also use 50. Both are conservative estimates. In terms of best practices, you should apply a haircut that is commensurate to the risks/uncertainties. This is the standard practice. What is riskier: cash or commodity? The common practice is to apply a higher haircut for the commodity. In fact, there are guidelines on how much of a haircut to apply to different product types (see Basel II) if you want to see the relationship yourself. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the Fed stress testing, conservative assumptions are exactly as they sound. Don't understate your losses, defaults, exposures, risks...and don't overstate the market factors or economic scenarios relevant to your portfolio.&lt;/p&gt;&#xA;" OwnerUserId="6437" LastActivityDate="2015-11-26T14:45:28.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21940" PostTypeId="2" ParentId="8595" CreationDate="2015-11-26T15:26:52.533" Score="2" Body="&lt;p&gt;Yes, you can get the opening print and closing print prices for NASDAQ stocks (and NYSE stocks for that matter) fairly reliably with MOO (market on open) and MOC (market on close) orders. There are some occasional discrepancies, but it tends to be fairly solid for backtesting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As @ast4 points out, you won't actually know what price you're getting when you place the order -- you'll have to place it several minutes in advance. Where this gets a bit tricky is you won't know precisely how many shares to buy if you want to allocate say, exactly $1000, on a stock. You'll have to make an estimation. But since the variation can be in either direction, it shouldn't introduce a systematic bias over a large number of trades (assuming e.g. that your model places MOC orders independent of any price action near the market close).&lt;/p&gt;&#xA;" OwnerUserId="18438" LastActivityDate="2015-11-26T15:26:52.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21941" PostTypeId="1" AcceptedAnswerId="28019" CreationDate="2015-11-26T15:28:37.143" Score="1" ViewCount="727" Body="&lt;p&gt;I'm trying to estimate parameters for Mixed Dynamic Copulas (Clayton-Gumbel and Joe-Clayton)&#xA;Is there any code in MATLAB?&#xA;Thanks for any help.&lt;/p&gt;&#xA;" OwnerUserId="17810" LastActivityDate="2016-07-11T12:44:31.060" Title="Clayton-Gumbel (BB1) and Joe-Clayton (BB7) time-varying copulas" Tags="&lt;matlab&gt;&lt;copula&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21942" PostTypeId="1" CreationDate="2015-11-26T16:30:48.793" Score="1" ViewCount="512" Body="&lt;p&gt;I see that a lot of quants work on high frequency strategies. Mostly used data are prices, volumes. &#xA;I wonder, is anybody using data on funds positions, which they have to disclosure quarterly under Securities Exchange Act? I mean 13F-HR and 13F-HR/A forms. &lt;/p&gt;&#xA;" OwnerUserId="18439" LastEditorUserId="24222" LastEditDate="2017-10-12T17:01:18.367" LastActivityDate="2020-05-16T05:21:36.867" Title="Is anybody using 13F-HR data for making strategies?" Tags="&lt;quant-trading-strategies&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21943" PostTypeId="2" ParentId="21852" CreationDate="2015-11-26T17:37:25.723" Score="4" Body="&lt;p&gt;If you don't have a significant amount of losses in your portfolio to validate the model, you should be able to obtain external loss data and adjust it where necessary to better fit your organization. This is very common with operational loss models where operational losses are quite scarce.   &lt;/p&gt;&#xA;" OwnerUserId="9265" LastActivityDate="2015-11-26T17:37:25.723" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="21944" PostTypeId="1" CreationDate="2015-11-26T18:16:59.927" Score="4" ViewCount="330" Body="&lt;p&gt;These are two follow up questions to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/21921/implied-volatility-as-price-transform?noredirect=1#comment31173_21921&quot;&gt;Implied volatility as price transform&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I understand that the BS model is used as a 'Blackbox' that takes a market price and maps it in a 1to1 fashion to a  'BS implied volatility'. What I don't understand is how there is any actionable information in that IV number given that everybody knows that most assumptions of BS do not hold. Yes, I know it is well understood and a bad model is better than no model. But let's say in a different universe somebody might have come up with a different model $\phi$ that shares the characteristics that make BS so popular. Now $\phi$ gives different IVs and hence also different actionable information. So how come traders actually use that information in trading if itstems from an 'arbitrary' Blackbox?&lt;/li&gt;&#xA;&lt;li&gt;The second question is based on the following slide of a talk given by P. Staneski, an MD quant at Credit Suisse:&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In the world of Black-Scholes, implied volatility is the expected value of future realized volatility because they are both constants!&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;• Even if we allow for stochastic volatility, given the other assumptions implied volatility is the expected value of future realized volatility.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;In the real world, none of the assumptions are true (some being more false than others, particularly the constancy of vol and GBM).&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;• The market gives us the price of an option, which “embeds” all the imperfections traders must deal with.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;• There is only one degree of freedom in the B-S model, namely, the volatility input, which must be “forced” to match the model to the market.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;Implied volatility is thus a lot more than expected volatility!&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If as he claims IV is a lot more than expected volatility, how can a trader sensibly use that information in trading? Very often, I saw things like (in summary) &quot;If the implied vol is 20 and you think volatility is gonna realise at 18, you just go short vol by selling a call/put and delta hedge it, thereby making money if you are right&quot;. Well, what if 5 of my 20 implied vol actually stems from the inaccuracy of the BS  model and is not 'priced in expected realised variance'?&lt;/p&gt;&#xA;" OwnerUserId="18415" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-07-29T19:22:51.017" Title="Tradable information from BS Implied volatility" Tags="&lt;black-scholes&gt;&lt;implied-volatility&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21945" PostTypeId="1" AcceptedAnswerId="21958" CreationDate="2015-11-26T21:00:00.387" Score="5" ViewCount="416" Body="&lt;p&gt;Let $X \sim \mathcal{N}(\mu,\sigma^2)$ under the probability measure $P$ on the measurable space $(\Omega, \mathcal{F})$.  We may define a Radon-Nikodym derivative $Z$, also defined on $(\Omega, \mathcal{F})$, by&#xA;$$&#xA;Z(\omega) := \frac{e^{\alpha X(\omega)}}{M_X(\alpha)} = \exp\left(\alpha X(\omega) - \alpha\mu - \frac{1}{2}\alpha^2\sigma^2\right)&#xA;$$&#xA;for $\alpha \in \mathbb{R}$, where $M_X(\alpha) = \exp(\alpha\mu + \frac{1}{2}\alpha^2\sigma^2)$ is the MGF of $X$.  The random variable $Z$ indeed qualifies as a Radon-Nikodym derivative, so let's use it to define a new probability measure $\tilde{P}$ on $(\Omega, \mathcal{F})$ by&#xA;$$&#xA;\tilde{P}(A) := \int_A Z(\omega) \, dP(\omega) \qquad \text{for all } A \in \mathcal{F}.&#xA;$$&#xA;It can be shown that, under $\tilde{P}$, $X \sim \mathcal{N}(\mu + \sigma^2\alpha, \sigma^2)$.  In words, I've often seen this described (e.g. Shreve II, p. 37) as &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We changed the distribution of the random variable without changing the random variable itself.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However, computing probabilities of $X$ under $\tilde{P}$ is then equivalent to computing probabilities of $X + \sigma^2\alpha$ under $P$, in which we &lt;em&gt;do&lt;/em&gt; change the random variable; we add $\sigma^2\alpha$ to it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even more, for option pricing, Shreve gives Grisanov's theorem on the bottom of p. 212, and &lt;em&gt;defines a new random variable&lt;/em&gt;&#xA;$$&#xA;\tilde{W}(t) = W(t) + \int_0^t \theta(u) \, du,&#xA;$$&#xA;which is then substituted into the stock price model.  So here, in its most applied context in quant finance, we are blatantly changing the random variable!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, although the above quote about changing only the distribution is technically valid in one sense, in the other sense we really &lt;em&gt;are&lt;/em&gt; changing the random variable.  Am I missing something?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastEditorUserId="6866" LastEditDate="2015-11-27T05:59:19.257" LastActivityDate="2015-11-27T14:39:05.620" Title="Radon-Nikodym: Changing Distribution vs Changing Random Variable" Tags="&lt;probability&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21946" PostTypeId="2" ParentId="21942" CreationDate="2015-11-26T22:29:45.603" Score="1" Body="&lt;p&gt;Yes, there are plenty of people looking at 13F information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are even &lt;a href=&quot;http://alphaclonefunds.com/&quot; rel=&quot;nofollow&quot;&gt;ETF's with strategies&lt;/a&gt; following 13F information for top funds. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are also &lt;a href=&quot;http://whalewisdom.com/&quot; rel=&quot;nofollow&quot;&gt;websites&lt;/a&gt; that parse and display this information as well.&lt;/p&gt;&#xA;" OwnerUserId="1764" LastActivityDate="2015-11-26T22:29:45.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21947" PostTypeId="2" ParentId="17869" CreationDate="2015-11-27T03:14:39.203" Score="1" Body="&lt;p&gt;HF data have a lot of auto correlation so common models to deal with this problems are ARFIMA, FIGARCH, Fractional Integrated GARCH. Engle recently propose the multiplicative components GARCH for high frequency data, which can include a mean model like and ARMA. In this post they explain how to implement it in R with the &lt;code&gt;rugarch&lt;/code&gt; package, it takes some time to run but it works. &lt;a href=&quot;http://unstarched.net/2013/03/20/high-frequency-garch-the-multiplicative-component-garch-mcsgarch-model/#comment-8309&quot; rel=&quot;nofollow&quot;&gt;http://unstarched.net/2013/03/20/high-frequency-garch-the-multiplicative-component-garch-mcsgarch-model/#comment-8309&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18443" LastActivityDate="2015-11-27T03:14:39.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21948" PostTypeId="2" ParentId="21644" CreationDate="2015-11-27T03:29:49.593" Score="-1" Body="&lt;p&gt;You could model the forward Libor Rates using Libor Market Model in a Monte Carlo setting to get the Libor behavior in the future.&lt;/p&gt;&#xA;" OwnerUserId="18159" LastActivityDate="2015-11-27T03:29:49.593" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21950" PostTypeId="1" CreationDate="2015-11-27T09:28:24.973" Score="1" ViewCount="91" Body="&lt;p&gt;I am trying to compute the present value of a continuous cash flow that lasts until a random time. The rate of the cash flow is denoted by $c$ and the random time is denoted by $\tau$. Then my claim is that the present value of this cash flow is given by&#xA;$$V_0 = E\left[\int_0^{\tau}P(t)c\,dt\right]$$&#xA;where $P(t)$ is the discount factor for time $t$. I am pretty certain that the expectation needs to be computed under the real-world measure. But the problem is that I know the distribution of $\tau$ only under the risk-neutral measure and not under the real-world measure. I do not know the market price of risk either. Can someone confirm whether my approach is correct and if not, point out the error(s) in it? It is of course possible, though not very likely, that there is an error in this exercise.&lt;/p&gt;&#xA;" OwnerUserId="11597" LastActivityDate="2015-11-27T14:13:27.213" Title="Value of a continuous cash flow until a random time" Tags="&lt;valuation&gt;&lt;present-value&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21951" PostTypeId="1" AcceptedAnswerId="36744" CreationDate="2015-11-27T09:46:33.810" Score="5" ViewCount="7363" Body="&lt;p&gt;For educational purposes, I'm looking for a source for now's &lt;strong&gt;real-time tick data for stock prices, or FOREX,&lt;/strong&gt; etc., with a 1 second precision.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there such free data feed?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, could such data be &lt;strong&gt;scraped&lt;/strong&gt; on some website that displays it in realtime (updated every second) ?&lt;/p&gt;&#xA;" OwnerUserId="18444" LastActivityDate="2020-06-17T22:31:22.413" Title="Source for real-time tick data (stock price, etc.) updated every second?" Tags="&lt;data&gt;&lt;market-data&gt;&lt;historical-data&gt;&lt;tick-data&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21954" PostTypeId="2" ParentId="21788" CreationDate="2015-11-27T12:16:12.303" Score="0" Body="&lt;p&gt;Taking into account how markets works is almost imposible to predict their evolution by using any kind of algorithm...&#xA;but you can use a machine learning algorithm to get positive statistical expectancy over the game so controling your capital &#xA;and exposure by using using money management and risk management algorithms is possible to design a profitable trading strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My opinion is that there´s no good algorithms, ther´re good strategies combining prediction, money management, risk exposure, timeframes and differente exchanges.&lt;/p&gt;&#xA;" OwnerUserId="18446" LastActivityDate="2015-11-27T12:16:12.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21955" PostTypeId="2" ParentId="21950" CreationDate="2015-11-27T12:38:27.770" Score="3" Body="&lt;p&gt;As long as your market is complete and $\tau$ is measurable w.r.t. the filtration generated by the market the continuous cash flow paid until $\tau$ is a hedgeable contingent claim and you have to work under the risk neutral measure.&lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2015-11-27T12:38:27.770" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21956" PostTypeId="2" ParentId="21866" CreationDate="2015-11-27T12:56:23.720" Score="0" Body="&lt;p&gt;If one defines a crisis as a major unexpected event (ie. increases volatility) and also has a broad impact (ie affects more than one company or asset class), then I think the answer to your first question should be obvious... As for why the downside is usually more demonstrative of this affect, I think there are probably a number of factors involved including; 1) the tendency for unexpected major news events to be negative for growth and/or inflation outlook, rather than positive, and 2) the reaction of investors to news events, whereby sharp market declines are more likely to trigger stop-loss sales, than are rises to trigger buying. &lt;/p&gt;&#xA;" OwnerUserId="3297" LastActivityDate="2015-11-27T12:56:23.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21957" PostTypeId="2" ParentId="21950" CreationDate="2015-11-27T14:13:27.213" Score="2" Body="&lt;p&gt;Pricing always takes place under the risk neutral probability measure. In fact, this would make the price more conservative (i.e. lower) with respect to risk; if you priced it under the true measure you would be putting a smaller hazard rate for this random time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Completeness make the risk neutral probability measure unique. In your case you might have infinite admissible risk neutral probability measures  since jumps might not be hedgeable. You need to choose one of them. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, you say that you are given one of them for the distribution of $\tau$. Who has given it to you? Did you calibrate it on instruments that depend on $\tau$? Then these instruments might complete the market, and the jump might be hedgeable. Then this is the measure you want to use. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2015-11-27T14:13:27.213" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="21958" PostTypeId="2" ParentId="21945" CreationDate="2015-11-27T14:39:05.620" Score="2" Body="&lt;p&gt;When the measure is changed, the distribution of the same random variable is also changed. That is, under the new measure, you obtain a new distribution for the same random variable. However, while you hold the new distribution fixed and go back to the original measure, then the random variable has to be changed. If you do not take the new distribution, then you do not have to change the random variable. In other words, to have a new distribution, you can either change the measure or change the random variable.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-11-27T14:39:05.620" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21959" PostTypeId="1" CreationDate="2015-11-27T16:18:48.203" Score="2" ViewCount="331" Body="&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Yield_curve&quot; rel=&quot;nofollow&quot;&gt;Yield curves&lt;/a&gt; are a valuable tool for economic analysis. It is particularly interesting to analyse the difference between Government Debt yields and Corporate Debt yields (credit spreads). This gives insight into confidence within the financial markets and economic health in general.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The government yield curve is easily accessible &lt;a href=&quot;https://www.treasury.gov/resource-center/data-chart-center/interest-rates/Pages/TextView.aspx?data=yield&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; but corporate yields are more difficult. I need a curve built from an index which gives an indication of the whole market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are some datasets available on &lt;a href=&quot;https://www.quandl.com/search?query=corporate%20bond%20yields&quot; rel=&quot;nofollow&quot;&gt;quandl&lt;/a&gt; which give yields for different types of bonds. The &lt;a href=&quot;http://us.spindices.com/indices/fixed-income/sp-500-bond-index&quot; rel=&quot;nofollow&quot;&gt;S&amp;amp;P 500 Bond Index&lt;/a&gt; provides some good perspective on S&amp;amp;P 500 bonds. I can't find anything though that gives an indication of either corporate bond prices or yields at different maturities. The maturity breakdown is needed to build a yield curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know where corporate bond yield curve data (corporate bond index yields/prices by maturity) is published for free? I'm particularly interested in XML/JSON resources.&lt;/p&gt;&#xA;" OwnerUserId="18448" LastActivityDate="2015-11-27T16:18:48.203" Title="Data source for a corporate bond yield curve?" Tags="&lt;interest-rates&gt;&lt;data&gt;&lt;market-data&gt;&lt;yield-curve&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21960" PostTypeId="2" ParentId="21866" CreationDate="2015-11-27T16:29:20.547" Score="6" Body="&lt;p&gt;Extra market volatility alone will cause correlations and stock volatilities to spike as you describe, even when overall market structure remains unchanged.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's a minor variation of the very simple CAPM model that captures precisely this behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be specific, let's say every security $S_A, S_B, \dots$ (or yield, if you want bonds in this) has a value linked by some constant beta $\beta_A, \beta_B, \dots$ between its return $r_A, r_B, \dots$ and some (potentially unobservable) overall market return $r$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume also an &lt;em&gt;unvarying&lt;/em&gt; idiosyncratic variability $\sigma_A, \sigma_B, \dots$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;r_i = \sigma_i \epsilon_i + \beta_i r&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with independent gaussian $\epsilon_i$ for $i=A,B,\dots$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, rather than assuming overall market return $r$ follows the usual gaussian process, let's assume market return has &lt;em&gt;two&lt;/em&gt; regimes, namely a serene regime in which&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;r(t) \sim r_0 + N\left(\nu t, s \sqrt{t}\right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and a crisis regime in which &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;r(t) \sim r_0 + N\left(\nu t, c \sqrt{t}\right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $c\gg s$.  From now on, for convenience, we'll take $t=1, \nu=0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Increased Crisis Volatility&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In serene regimes we will measure, for example, a relatively small volatility for $S_A$ of&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;s_A = \sqrt{\beta_A^2 s^2 + \sigma_A^2}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and in crisis regimes a much larger volatility of &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;c_A = \sqrt{\beta_A^2 c^2 + \sigma_A^2}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where in particular we have that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$c_A^2 = s_A^2 + \beta_A^2(c^2-s^2) \gg s_A^2.&#xA;$$  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, the crisis regime has increased the volatility of $S_A$ &lt;em&gt;even without any change to the idiosyncratic variability&lt;/em&gt; $\sigma_A$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Increased Crisis Correlation&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using slightly more complicated math, we can compute the observed correlations between $S_A$ and $S_B$ in serene or crisis times, and show they increase.  For convenience let's think in terms of $\rho^2$ and try to show it increases.  Begin by noting the covariance&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\text{Cov}(S_A,S_B) = s^2\beta_A \beta_B&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;will obviously increase when we start measuring it in crisis as&#xA;$$&#xA;\text{Cov}(S_A,S_B) = c^2\beta_A \beta_B.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\rho_{AB}^2 = \frac{\text{Cov}^2(S_A,S_B)}{(s^2\beta_A^2+ \sigma_A^2)(s^2\beta_B^2+ \sigma_B^2)} = \frac{(s^2\beta_A \beta_B)^2}{(s^2\beta_A^2+ \sigma_A^2)(s^2\beta_B^2+ \sigma_B^2)} .&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To see that this is increasing in market volatility $s$, we define&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;x = s^2\beta_A \beta_B \\&#xA;\eta = \sigma_A^2\sigma_B^2\\&#xA;\mu = \frac{\beta_A^2\sigma_B^2 +  \beta_B^2\sigma_A^2}{\beta_A \beta_B} &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and note that both constants $\eta,\mu &amp;gt; 0$ if the $\sigma_i$ and $\beta_i$ are strictly positive, and that $s \propto \sqrt{x}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This allows us to write&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\rho_{AB}^2 = \frac{x^2}{x^2+\eta+\mu x}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, if we take the derivative with respect to $x$ we find&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{\partial \, \rho_{AB}^2}{\partial x} = \frac{2x(x^2+\eta+\mu x)-x^2(2x+\mu)}{(x^2+\eta+\mu x)^2} \\&#xA;= \frac{2\eta x}{(x^2+\eta+\mu x)^2} &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is always positive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We conclude that if the betas are strictly positive, then we will observe a strictly larger correlation $\rho_{AB}$ in times of crisis than in serene times &lt;em&gt;even without any change to betas&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2015-12-07T15:25:43.553" LastActivityDate="2015-12-07T15:25:43.553" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21962" PostTypeId="1" AcceptedAnswerId="21963" CreationDate="2015-11-27T19:50:34.317" Score="0" ViewCount="92" Body="&lt;p&gt;I would like to calculate with R the inverse return of Bitcoin. My objective is to simulate the historical price and return of a short position opened in Bitcoin.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first method is to cumulate the &lt;code&gt;1-dailyReturn&lt;/code&gt; of the Bitcoin price and the second option is to calculate the return of &lt;code&gt;1/(BTC/USD)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both give slighty different result and I'm not sure which one I must use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are the two options written in R and the results:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; dailyReturn(cumprod(1-dailyReturn(BTC_USD)))[&quot;2015-11-23::&quot;]&#xA;           daily.returns&#xA;2015-11-23   0.007114063&#xA;2015-11-24   0.004140197&#xA;2015-11-25  -0.046087480&#xA;2015-11-26  -0.024507073&#xA;&#xA;&amp;gt; dailyReturn(1/BTC_USD)[&quot;2015-11-23::&quot;]&#xA;           daily.returns&#xA;2015-11-23   0.007165035&#xA;2015-11-24   0.004157409&#xA;2015-11-25  -0.044057004&#xA;2015-11-26  -0.023920843&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="15328" LastActivityDate="2015-11-27T21:10:40.730" Title="How to simulate historical performance of a short position of a security?" Tags="&lt;short-selling&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21963" PostTypeId="2" ParentId="21962" CreationDate="2015-11-27T21:10:40.730" Score="1" Body="&lt;p&gt;The first method gives the performance when rebalancing the position every day so you have a constant dollar exposure, the second is the result of shorting USD 1 and then keeping the position open, i.e. a short-and-hold return. They can be quite different in the long run and if there is high volatility. I recommend the short-and-hold with, possibly, rebalancing once a quarter or once a year only. Daily rebalancing is not very realistic unless you can trade very cheaply (I am not an expert in Bitcoin but I thought it was difficult to short). Inverse ETFs use daily rebalancing, but they are designed for short term holding only and oare not recommended for long term hold.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-11-27T21:10:40.730" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21966" PostTypeId="1" AcceptedAnswerId="24536" CreationDate="2015-11-27T23:27:59.790" Score="0" ViewCount="870" Body="&lt;p&gt;So I'm trying to measure the VaR of 2 stock with a multivariate GARCH model, so im using the CCC model. I need to predict the standard-diviation and the mean but the &lt;code&gt;ccgarch&lt;/code&gt; package doesn't have a command for that. Is the a way in R for doing it? &lt;/p&gt;&#xA;" OwnerUserId="18443" LastActivityDate="2016-02-25T20:16:36.360" Title="CCC-Garch predict" Tags="&lt;volatility&gt;&lt;time-series&gt;&lt;r&gt;&lt;garch&gt;&lt;multivariate&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21967" PostTypeId="1" CreationDate="2015-11-28T08:40:25.440" Score="-1" ViewCount="150" Body="&lt;p&gt;I want to fit multivariate GH distribution on my data, and then generate simulations for that distribution. Using the instructions given in &lt;a href=&quot;https://cran.r-project.org/web/packages/ghyp/ghyp.pdf&quot; rel=&quot;nofollow&quot;&gt;ghyp package&lt;/a&gt;, I wrote following lines of code in R.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; data(smi.stocks)&#xA;&amp;gt; fitted &amp;lt;- fit.ghypmv(data = smi.stocks, silent=TRUE)&#xA;&amp;gt; rghyp(n = 100, fitted)&#xA;Error in ghypCheckPars(param) : &#xA;  (list) object cannot be coerced to type 'double'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, it gives me the error as shown above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any thoughts on why is it happening?&lt;/p&gt;&#xA;" OwnerUserId="18057" LastEditorUserId="467" LastEditDate="2016-12-23T02:34:32.613" LastActivityDate="2017-03-23T04:22:42.773" Title="Why do I get this error using ghyp-distribution function?" Tags="&lt;distribution&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="21968" PostTypeId="1" CreationDate="2015-11-28T16:22:28.497" Score="0" ViewCount="2166" Body="&lt;p&gt;I was trying to find the parameters of GBM but could not find a python code for the same.&lt;/p&gt;&#xA;" OwnerUserId="18460" LastActivityDate="2015-11-28T22:48:51.157" Title="Is there a python code for estimating the parameters of geometric brownian motion?" Tags="&lt;brownian-motion&gt;&lt;python&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21969" PostTypeId="2" ParentId="21968" CreationDate="2015-11-28T16:35:57.777" Score="0" Body="&lt;p&gt;If you want to use GBM in the physical measure then just calculate the standard deviation of log returns to get $\sigma$. For $\mu$ there are many choices. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to calibrate GBM to get option prices then you need the implied volatility and there is a &lt;a href=&quot;https://pypi.python.org/pypi/vollib&quot; rel=&quot;nofollow&quot;&gt;package&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The OP said that he/she wants to simulate paths. If you don't want to price derivatives then you work in the &quot;real world&quot; measure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then $\sigma$ can be estimated as mentioned. $\mu$ is hard to assume (for the future). If you look at the literature of momentum strategies then some of them take the expectation of the last 3 to 6 months for the coming 3 to 6 months. I say this in the sense that there is the stylized fact that winners tend to win and losers tend to lose. &lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-11-28T16:48:23.847" LastActivityDate="2015-11-28T16:48:23.847" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21970" PostTypeId="2" ParentId="21967" CreationDate="2015-11-28T18:07:01.117" Score="0" Body="&lt;p&gt;I typed your code (after a fresh installation of all (!) packages necessary) and it just worked ...&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="467" LastEditDate="2016-12-23T02:33:50.450" LastActivityDate="2016-12-23T02:33:50.450" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21971" PostTypeId="2" ParentId="21968" CreationDate="2015-11-28T18:08:24.670" Score="3" Body="&lt;p&gt;The code below pulls AAPL time series from Yahoo Finance, computes mean/std and simulates 100 paths that are 20 days long.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Input:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import pandas as pd&#xA;import numpy as np&#xA;from numpy.random import normal&#xA;&#xA;# bring data&#xA;ticker = 'AAPL'&#xA;url = 'http://real-chart.finance.yahoo.com/table.csv?s=%s' % ticker&#xA;data = pd.read_csv(url, index_col='Date', parse_dates=True)&#xA;data.sort_index(inplace=True)&#xA;r = np.log(data['Adj Close']).diff().as_matrix()[1:]&#xA;&#xA;# estimate parameters&#xA;sigma = np.std(r)&#xA;mu = np.mean(r) +0.5*sigma*sigma&#xA;&#xA;# simulate paths&#xA;T = 20 # number of periods to simulate&#xA;N = 100 # number of scenarios&#xA;epsilon = normal(size=[T, N])&#xA;paths = data['Adj Close'][-1]*np.exp(np.cumsum(mu-0.5*sigma*sigma +sigma*epsilon, axis=0))&#xA;&#xA;# output&#xA;print 'data from %s to %s' % (data.index[0].date(), data.index[-1].date())&#xA;print '%d scenarios of %d periods' % (N, T)&#xA;print paths[-1]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;data from 1980-12-12 to 2015-11-27&#xA;100 scenarios of 20 periods&#xA;[ 110.05103396  115.22220256  102.15942834  137.8933195   128.98220659&#xA;  123.78995167  119.78760965  111.55081804  101.28873804  150.01698323&#xA;  118.17378031  129.26568517  116.89831894  120.14299291  100.92602175&#xA;  129.08661341  126.11134726  131.05832164  105.40035237  148.56201625&#xA;  117.6589326   135.80459977  116.3256132   118.11022374  138.24069944&#xA;  130.23096841  121.44359248   93.36990366  120.40376295  113.86096665&#xA;  112.79238568  104.29584358  154.99719687  133.25955192  108.20838712&#xA;  120.11125973  104.21453197  112.78981396  108.77688605  118.40240356&#xA;  156.99140878  130.91871886  111.0078855   139.71865207  145.2893878&#xA;  135.05797455  122.57696229   93.85711338  148.3231574   105.5308185&#xA;   98.42940505  106.28268823   99.49360753  118.41985903  152.10864408&#xA;  100.48435239   96.49837802  124.98286066  112.95868168  134.59980791&#xA;  132.01882861  109.43251849  151.64664262  116.37618346  112.04417492&#xA;  119.18353134  120.73513746   96.41828595  107.16867675  121.18435982&#xA;   90.45490766  110.88758748  126.11216937  106.48179123  147.52005583&#xA;  121.25689013  118.6405851   103.84301241  120.88770293  110.99499809&#xA;  119.6822996   112.84273236  131.80224893  124.77742484  135.99716652&#xA;  141.02784531  117.44045644  110.02261302  128.75145159  115.82045737&#xA;  129.60995183  115.7623887   133.83373679  116.89180599  103.1893998&#xA;  138.25279665  106.56185885  138.59835512  101.29356076  152.75506114]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2015-11-28T22:48:51.157" LastActivityDate="2015-11-28T22:48:51.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21973" PostTypeId="2" ParentId="21903" CreationDate="2015-11-28T18:56:11.067" Score="1" Body="&lt;p&gt;Based on the &lt;code&gt;UCITS directives&lt;/code&gt;: &lt;code&gt;E = n * c * UL * delta&lt;/code&gt; where &lt;code&gt;E&lt;/code&gt; denotes &lt;code&gt;Exposure&lt;/code&gt;, &lt;code&gt;n = contract size&lt;/code&gt;, &lt;code&gt;c= contract sie&lt;/code&gt;, &lt;code&gt;UL= underlying price&lt;/code&gt;. As you're probably aware from &lt;code&gt;BS&lt;/code&gt;model, &lt;code&gt;call&lt;/code&gt; has &lt;code&gt;&amp;gt;0 delta&lt;/code&gt; &lt;code&gt;vs&lt;/code&gt; &lt;code&gt;&amp;lt;0&lt;/code&gt; for &lt;code&gt;puts&lt;/code&gt;. Hope the explanation merely helps you to grasp the direct correlation between &lt;code&gt;E&lt;/code&gt; and &lt;code&gt;delta&lt;/code&gt; in a &lt;code&gt;UCITS&lt;/code&gt; framework.&lt;/p&gt;&#xA;" OwnerUserId="18252" LastActivityDate="2015-11-28T18:56:11.067" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21974" PostTypeId="2" ParentId="21538" CreationDate="2015-11-28T19:22:57.907" Score="2" Body="&lt;p&gt;Better to compute it by yourself either using &lt;code&gt;Historical simmulation&lt;/code&gt;, &lt;code&gt;Monte Carlo&lt;/code&gt;, or simple parametric method such as &lt;code&gt;variance-covariance&lt;/code&gt;. Alternatively subscribe to&lt;a href=&quot;http://www.bloomberg.com/professional/portfolio-risk-analytics/&quot; rel=&quot;nofollow&quot;&gt;Bloomberg Risk Analytics&lt;/a&gt;, populate the ISIN(s) for your ETF(s) and get the relevant metrics.&lt;/p&gt;&#xA;" OwnerUserId="18252" LastActivityDate="2015-11-28T19:22:57.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21975" PostTypeId="1" AcceptedAnswerId="21978" CreationDate="2015-11-28T21:13:07.727" Score="9" ViewCount="829" Body="&lt;p&gt;A recruiter asked me this question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose you have the following contract:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a call option with maturity $T$ = 2 years&lt;/li&gt;&#xA;&lt;li&gt;the possibility to change this call into a put at $t$ = 1 year&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What is the price of such contract ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I begin with $E[\left((-1)^{\tau}(S_{T}-K)\right)^{+}e^{-rT}]$ with $\tau$ a random variable that equals $+1$ if we change the call into a put and $-1$ if we don't change it, but i'm stuck with this...&lt;/p&gt;&#xA;" OwnerUserId="15738" LastEditorUserId="26595" LastEditDate="2017-08-10T18:56:08.583" LastActivityDate="2017-08-10T18:56:08.583" Title="How to price an option allowing to change a call into a put?" Tags="&lt;options&gt;&lt;option-pricing&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="21976" PostTypeId="1" AcceptedAnswerId="22094" CreationDate="2015-11-28T22:28:05.497" Score="3" ViewCount="4016" Body="&lt;p&gt;Suppose I have two cash flows:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;CF1&lt;/strong&gt;: &lt;kbd&gt;-1000&lt;/kbd&gt;&lt;kbd&gt;100&lt;/kbd&gt;&lt;kbd&gt;100&lt;/kbd&gt;&lt;kbd&gt;1100&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;CF2&lt;/strong&gt;: &lt;kbd&gt;-200&lt;/kbd&gt;&lt;kbd&gt;20&lt;/kbd&gt;&lt;kbd&gt;30&lt;/kbd&gt;&lt;kbd&gt;1&lt;/kbd&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I can compute now:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;IRR(CF1) = 10%&lt;/li&gt;&#xA;&lt;li&gt;IRR(CF2) =-55%&lt;/li&gt;&#xA;&lt;li&gt;IRR(CF1+CF2) = 4.46%&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Is there a way to compute (or at least get a fair estimate) of the pooled IRR (i.e. 4.46%) by only knowing the two original IRRs along with, say, the initial investment values (or some additional partial metrics of the CFs)?&lt;/p&gt;&#xA;" OwnerUserId="18464" LastActivityDate="2015-12-05T13:16:45.783" Title="Computing Pooled IRR from the IRRs of parts" Tags="&lt;returns&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21977" PostTypeId="1" CreationDate="2015-11-28T23:37:16.403" Score="4" ViewCount="228" Body="&lt;p&gt;We are just learning about binomial option pricing, and how the up-factor and the down-factor must match the risk-neutral price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;p * u + (1 - p) * d = continuous risk free rate compounded&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CRR proposed that u = 1/d as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What happens if that risk-neutral pricing does not hold? How would you exploit this type of arbitrage? Would you invest in an instrument that grows at the risk-free rate and short/long whatever instrument if u or d is higher?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also might as well ask this question: Which options are most liquid? OTM, ATM, or &lt;em&gt;right outside&lt;/em&gt; the money?&lt;/p&gt;&#xA;" OwnerUserId="18466" LastActivityDate="2016-01-11T13:54:52.890" Title="How would I exploit arbitrage if risk-neutral pricing doesn't hold? (Option Pricing)" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;pricing&gt;&lt;risk-neutral-measure&gt;&lt;binomial-tree&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21978" PostTypeId="2" ParentId="21975" CreationDate="2015-11-28T23:39:22.760" Score="4" Body="&lt;p&gt;Let $t=1$ and $T=2$. The value at time $t$ is given by&#xA;\begin{align*}&#xA;&amp;amp;\ e^{-r(T-t)}\max\left(E\left((S_T-K)^+\mid \mathcal{F}_{t}\right), \, E\left((K-S_T)^+\mid \mathcal{F}_{t}\right)\right) \\&#xA;=&amp;amp;\ e^{-r(T-t)}E\left((K-S_T)^+\mid \mathcal{F}_{t}\right) +e^{-r(T-t)}\max\left(E\left((S_T-K)\mid \mathcal{F}_{t}\right), \, 0\right)\\&#xA;=&amp;amp;\ e^{-r(T-t)}E\left((K-S_T)^+\mid \mathcal{F}_{t}\right) +\max\left(S_{t}-Ke^{-r(T-t)}, \, 0\right).&#xA;\end{align*}&#xA;That is, the value is for a portfolio with a put at $T$ and a call at $t$, and can be computed using formulas of Black-Scholes type.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-11-29T12:43:56.123" LastActivityDate="2015-11-29T12:43:56.123" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="21979" PostTypeId="2" ParentId="21977" CreationDate="2015-11-29T01:19:08.453" Score="1" Body="&lt;p&gt;ATM options are always more liquid. Options with shorter maturities are also more liquid. Best way to learn more is to open a brokerage account that doesn't have any minimum amounts or monthly fees and you can watch some delayed live option quotes across a whole chain of strikes and maturities . &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first question you are asking is really how to profit if the actual drift is considerably different from the risk-free rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's one good vanilla way - buy  call (put) if the actual drift is considerably higher (lower) with the following properties : long maturity (e.g. Leaps) so that the theta decay is small, always either deep OTM or deep ITM so that the option is minimally affected by vega. The choice of deep OTM vs deep ITM is a personal one, because in deep OTM the break even profit may not be reached and you can lose 100% of premium, while in deep ITM, the leverage (gearing) you can get is low and the profits can be much subdued. In practice, since this strategy will be operating at longer maturities and away from the ATM - you will be operating in the illiquid part of the option surface. So to minimize the option bid-ask, from practical experience, you really have to limit yourself to underlying that trade &gt; 5 millions shares / day and the price of underlying should be &gt; 20 if you want to buy puts or &amp;lt;40 if you want to buy calls . &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a vanilla trade construction. You can always explore more complicated structures. The best structures I have found are OTC options on multiple equity indices (max/min of 3 asset returns, etc.,) if you have a drift view on 3 similar equity indices and a lot of big brokers will quote you max/min of N asset options on super liquid underlyings, or OTC average price options (TAPOs) in the case of commodities which are usually not that liquid. &lt;/p&gt;&#xA;" OwnerUserId="5948" LastEditorUserId="5948" LastEditDate="2015-11-29T01:26:39.547" LastActivityDate="2015-11-29T01:26:39.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21981" PostTypeId="1" CreationDate="2015-11-29T02:56:53.767" Score="3" ViewCount="245" Body="&lt;p&gt;From the textbook, sharpe ratio is (return-riskfree rate)/risk&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I wonder if I can use (return-index return)/risk, where the index acts as the benchmark, to calculate the sharpe ratio?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am quite confused about the difference between these two.. Thanks&lt;/p&gt;&#xA;" OwnerUserId="18468" LastActivityDate="2016-01-28T11:48:31.653" Title="Proper way to calculate the realized indiviual stock sharpe ratio" Tags="&lt;sharpe-ratio&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21982" PostTypeId="1" AcceptedAnswerId="22122" CreationDate="2015-11-29T05:03:59.323" Score="2" ViewCount="125" Body="&lt;p&gt;I'm doing a simulation of a CRR model and I'm trying to find parameters in order for the successive $S_t$s (stock prices) to be martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm assuming that if I'd create a function (and picked the right parameter values) that's equivalent to the martingale condition $\mathbb{E}(\frac{S_{t+1}}{S_t})=1$ and then plot it over $t=1,...,T$ (time), then I'd see &quot;martingale&quot;?&lt;/p&gt;&#xA;" OwnerUserId="18467" LastActivityDate="2015-12-06T02:39:21.363" Title="What does martingale look like?" Tags="&lt;martingale&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="21983" PostTypeId="1" CreationDate="2015-11-29T05:45:38.120" Score="3" ViewCount="172" Body="&lt;p&gt;How many PHD (economics+finance) level quants are work here in US market?&lt;/p&gt;&#xA;" OwnerUserId="2744" LastEditorUserId="2744" LastEditDate="2015-11-29T06:41:06.907" LastActivityDate="2015-11-29T06:41:06.907" Title="How many PHD level quant are there in US market?" Tags="&lt;market&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ClosedDate="2015-12-02T21:12:42.233" ContentLicense="CC BY-SA 3.0" />
  <row Id="21985" PostTypeId="2" ParentId="21981" CreationDate="2015-11-29T08:21:24.913" Score="0" Body="&lt;p&gt;Sure you could use this formula so-called &lt;code&gt;Ex-post Sharpe ratio&lt;/code&gt; in which you consider in &lt;code&gt;the numerator&lt;/code&gt;of the formula the differential between the realized asset return and its benchmark. Using this approach always disclose for transparency purposes the benchmark under consideration, in particular if you're doing some comparison analyses. You'll consequently avoid some biases than resorting to the problematic selection of an adequate &lt;code&gt;risk-free rate&lt;/code&gt; ( flat &lt;code&gt;yields&lt;/code&gt; on &lt;code&gt;T-bills&lt;/code&gt; or &lt;code&gt;adhoc rates&lt;/code&gt; on money market instruments). Hope it helps.&lt;/p&gt;&#xA;" OwnerUserId="18252" LastEditorUserId="18252" LastEditDate="2015-11-29T08:34:39.187" LastActivityDate="2015-11-29T08:34:39.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21989" PostTypeId="1" AcceptedAnswerId="21991" CreationDate="2015-11-29T17:59:44.167" Score="1" ViewCount="247" Body="&lt;p&gt;Why does this&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Se^{-D(T-t)}e^{-d_1^2/2} - Ee^{-r(T-t)}e^{-d_2^2/2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;equal to $0$? (Where $E$ is a strike)&lt;/p&gt;&#xA;" OwnerUserId="18251" LastActivityDate="2015-11-29T18:52:51.770" Title="Result linked to Black-Scholes evaluation" Tags="&lt;black-scholes&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21991" PostTypeId="2" ParentId="21989" CreationDate="2015-11-29T18:45:11.100" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Note that this question is similar to &lt;a href=&quot;https://quant.stackexchange.com/questions/21372/verifying-an-identity-of-an-equation-for-black-scholes-formula/21395#21395&quot;&gt;Verifying an identity of an equation for Black Scholes formula&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You need to use the fact that&#xA;\begin{align*}&#xA;d_1 &amp;amp;= \frac{\ln (S/E) + (r-D)(T-t) + \frac{\sigma^2}{2}(T-t)}{\sigma \sqrt{T-t}}, \\&#xA;d_2 &amp;amp;= d_1 - \sigma \sqrt{T-t}.&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;E e^{-r(T-t)} e^{-d_2^2/2} &amp;amp;=E e^{-r(T-t)} e^{-d_1^2/2 - \frac{\sigma^2}{2}(T-t)+d_1 \sigma \sqrt{T-t}}\\&#xA;&amp;amp;=E e^{-r(T-t)} e^{-d_1^2/2 - \frac{\sigma^2}{2}(T-t)+\ln (S/E) + (r-D)(T-t) + \frac{\sigma^2}{2}(T-t)}\\&#xA;&amp;amp;=Se^{-D(T-t)} e^{-d_1^2/2}.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-11-29T18:52:51.770" LastActivityDate="2015-11-29T18:52:51.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21993" PostTypeId="1" CreationDate="2015-11-29T21:08:35.643" Score="2" ViewCount="45" Body="&lt;p&gt;I'm trying to calculate the expected value, at time $0$, of a cashflow paid at time $T$, resetting at time $t$. The coupon is of the form:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V_0=\mathbb{E}^{T_2}\left[\frac{A_t^y(T_1,T_2)}{B_t^x(T_1,T_2)}C^y_t(T_1,T_2)\right]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in which:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$A^y_t(T_1,T_2)$ is the price of a discount bond from $T_1$ paying at $T_2$, observed at $t$, in currency $y$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$B^x_t(T_1,T_2)$ is the price of a discount bond from $T_1$ paying at $T_2$, observed at $t$, in currency $x$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C^y_t(T_1,T_2)$ is a floating rate for the period $T_1$ to $T_2$, observed at $t$ and paying at $T_2$, in currency $y$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb{E}^{T_2}$ represents the expectation taken in the $T_2$ forward measure in currency $y$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have that the processes $A$ and $C$ are martingale in the chosen measure. Assuming that the prcesses $A$, $B$ and $C$ are log-normal, how can we calculate the expectation taking account of the fact that $B$ is denominated in the currency $x$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any pointers or suggestions would be very much appreciated!&lt;/p&gt;&#xA;" OwnerUserId="18472" LastActivityDate="2015-11-29T21:08:35.643" Title="Expectation of expression with two currencies under forward measure" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;numerairechange&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21994" PostTypeId="1" AcceptedAnswerId="24818" CreationDate="2015-11-30T00:56:57.953" Score="1" ViewCount="1193" Body="&lt;p&gt;I am currently working on a research project for a pairs trading strategy and would like to know the correct positions to take when a signal has been triggered.&lt;br&gt;&#xA;Say we are using this equation to generate signals:&lt;br&gt;&#xA;\begin{equation}&#xA;z = y - \beta x&#xA;\end{equation}&#xA;$\mu_z$ = 0, $\sigma_z$ = 0.5, and $\beta$ = 1, for simplicity.&lt;br&gt;&#xA;And our signals to open are: (z &gt;= $\mu_z$+$\sigma_z$ &amp;amp; z &amp;lt;= $\mu_z$-$\sigma_z$) &lt;br&gt;&#xA;Then a signal will be triggered when :&lt;br&gt;1) y = 10, x = 9.5&lt;br&gt; 2) y = 10.5, x = 10&lt;br&gt;3) y = 10, x = 10.5&lt;br&gt; 4) y = 9.5, x = 10&lt;br&gt;&lt;br&gt;&#xA;Should the positions taken in these scenarios be different? Should we short 1 share y and go long $\beta$ shares of x for 1 and 2? Should we go long 1 share y and short $\beta$ shares of x for 3 and 4?&lt;br&gt;&#xA;Or should we actually be calculating pct change in y and $\beta$x and then short which ever had the greatest pct change and go long the other? &lt;/p&gt;&#xA;" OwnerUserId="18477" LastActivityDate="2016-04-10T17:25:47.353" Title="Pairs Trading Signals and Positioning" Tags="&lt;pairs-trading&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="21995" PostTypeId="1" AcceptedAnswerId="21996" CreationDate="2015-11-30T02:18:41.517" Score="2" ViewCount="284" Body="&lt;p&gt;I'm performing a simple Portfolio attribution with the Brinson 1985 model where returns are decomposed into both an &lt;strong&gt;allocation&lt;/strong&gt; component and a &lt;strong&gt;selection&lt;/strong&gt;.  Using the formula, I first did the attribution with all assets denominated in my local currency (CAD) and I noted that a lot of my assets are in USD.  My question is, if I want to extract out the currency effect and only decompose the returns based on equity moves.  How would I go about calculating the correct weight? I should also note that I am doing this on a multi-period basis so any help on that would be appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, If Stock A is in US Dollar and Stock B is in CAD in a two-asset portfolio, the non-equity return for A is simply just the stock return in US dollar.  However, the Weight of the stock $W_A$ is dependent on the exchange rate $W_A = \frac{Val_{A}*USDCAD}{(Val_{A}*USDCAD + Val_{B})}$.  Would it still be correct that I use the weight given there or do I need to calculate it from a different perspective?&lt;/p&gt;&#xA;" OwnerUserId="11888" LastActivityDate="2015-11-30T07:49:19.280" Title="Weights in Portfolio Attribution when considering Currency" Tags="&lt;currency&gt;&lt;performance-evaluation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21996" PostTypeId="2" ParentId="21995" CreationDate="2015-11-30T07:49:19.280" Score="1" Body="&lt;p&gt;If the base &lt;code&gt;ccy&lt;/code&gt; of the your portfolio is &lt;code&gt;CAD&lt;/code&gt;, then it makes sense to use the asset weights in &lt;code&gt;base&lt;/code&gt; too (&lt;code&gt;= CAD&lt;/code&gt;) according to your described formula.&lt;/p&gt;&#xA;" OwnerUserId="18252" LastActivityDate="2015-11-30T07:49:19.280" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="21997" PostTypeId="1" CreationDate="2015-11-30T09:59:11.890" Score="1" ViewCount="51" Body="&lt;p&gt;An average citizen's life can be seen as an investment project: the State starts investing into prenatal care, the child's education etc., a young man starts making money and paying taxes (breaks even here), the overall balance goes positive but declines slightly in the end of life (a pension from the State).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I see stats on &quot;closing balance&quot; figures at least for US citizens? I bet such figures do exist. Can't google them out though, probably because of my not-so-good English.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you please point me to some info on this topic?&lt;/p&gt;&#xA;" OwnerUserId="18483" LastActivityDate="2015-11-30T19:37:40.563" Title="A citizen's life as an investment project (from the State's PoV)" Tags="&lt;investment&gt;&lt;macro-economics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="21998" PostTypeId="1" CreationDate="2015-11-30T11:17:55.590" Score="2" ViewCount="301" Body="&lt;p&gt;Lets assume for the sake of the example that we are talking about a Total Return Swap. The flow diagram is something like this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/zKVta.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/zKVta.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets assume the &lt;em&gt;Payer&lt;/em&gt; in this instance is a Hedge Fund, and the &lt;em&gt;Receiver&lt;/em&gt; another Hedge Fund. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the assets are never sold, but rather remain in possession of the &lt;em&gt;Payer&lt;/em&gt; how does the &quot;accountability&quot; process take place. In other words, how does the total receiver know that the &lt;em&gt;reference asset gains&lt;/em&gt; that he is receiving are in fact accurate, or, that in the case of a credit event, he can verify that the spread he gets requested to pay-out is also accurate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be massively helpful to have a breakdown of the various stakeholders and interactions when executing in practice a TRS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apologies if the question is quite broad, i am new to all of this. &lt;/p&gt;&#xA;" OwnerUserId="18484" LastActivityDate="2015-12-09T22:45:01.480" Title="How are referenced asset gains routed in a credit derivative?" Tags="&lt;derivatives&gt;&lt;accounting&gt;&lt;structured-credit&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22001" PostTypeId="1" CreationDate="2015-11-30T14:26:36.290" Score="1" ViewCount="72" Body="&lt;p&gt;Why was ISO (Intermarket Sweep Order) introduced? I read that it was introduced to help fill large orders. Some explanation is here: &lt;a href=&quot;http://tabbforum.com/opinions/why-hfts-have-an-advantage-part-3-intermarket-sweep-orders&quot; rel=&quot;nofollow&quot;&gt;http://tabbforum.com/opinions/why-hfts-have-an-advantage-part-3-intermarket-sweep-orders&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you have any more information?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="18488" LastActivityDate="2016-01-11T08:52:40.223" Title="Purpose of ISOs" Tags="&lt;market-microstructure&gt;&lt;exchange&gt;&lt;order-handling&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22002" PostTypeId="1" AcceptedAnswerId="22004" CreationDate="2015-11-30T16:44:21.740" Score="2" ViewCount="1098" Body="&lt;p&gt;If beta is additive i.e. ${\beta}_P =\sum w_i \beta_i$, shouldn't the two methods below yield the same number? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Method 1: Estimate beta for each asset in the portfolio. Then ${\beta}_P =\sum w_i \beta_i$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Method 2: Estimate portfolio returns $r_P =\sum w_i r_i$. Then estimate beta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The two results though close are not identical. Why is that? Is there an implicit assumption wrt the error terms in the regressions (i.e. uncorrelated, zero mean etc.)? &lt;/p&gt;&#xA;" OwnerDisplayName="user18489" LastEditorUserId="16249" LastEditDate="2015-12-01T11:48:43.477" LastActivityDate="2015-12-01T16:41:07.287" Title="Is portfolio beta additive under all return distributions?" Tags="&lt;beta&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22003" PostTypeId="1" CreationDate="2015-11-30T18:02:21.767" Score="1" ViewCount="545" Body="&lt;p&gt;I am using R to analyse stock data, using the &lt;a href=&quot;https://cran.r-project.org/web/packages/quantmod/index.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;quantmod&lt;/code&gt;&lt;/a&gt; package to get all sorts of data, but here specifically FX data using the function &lt;code&gt;getFX()&lt;/code&gt;. This uses the &lt;a href=&quot;http://www.oanda.com/currency/historical-rates/&quot; rel=&quot;nofollow&quot;&gt;Oanda database&lt;/a&gt; as its source.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This works great, however it returns weekend values - i.e. values for days on which no trading takes place. These values must therefore have somehow been exptrapolated, for example by taking the average over the surrounding period, using a spline...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the problem, I can't find out how it is done on the website nor in the quantmod documentation. I can actually just use the &lt;code&gt;Quandl&lt;/code&gt; package to get around this, but I would like to know what I am avoiding or potentially missing out on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I say that I may be missing out on something here because I may myself need to deal with data imputation, filling in the weekends, so if Oanda has done something half-sensible, I could just swipe there gap-filling skills. Just to make it super clear, compare the two outputs below, first from Quandl {package: Quandl} and then from Oanda {package: quantmod}. Notice the dates and the 'filled values' **&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; head(x, n=10)&#xA;               Rate High (est) Low (est)&#xA;2013-01-14 0.749652    0.75838   0.74102&#xA;2013-01-15 0.748650    0.75799   0.73942&#xA;2013-01-16 0.751178    0.76022   0.74225&#xA;2013-01-17 0.751165    0.00000   0.00000&#xA;2013-01-18 0.749440    0.75843   0.74056&#xA;2013-01-21 0.750220    0.75880   0.74174&#xA;2013-01-22 0.750742    0.75993   0.74167&#xA;2013-01-23 0.750851    0.75944   0.74236&#xA;2013-01-24 0.750387    0.00000   0.00000&#xA;2013-01-25 0.747175    0.00000   0.00000&#xA;&#xA;&amp;gt; head(y, n=10)&#xA;           USD.EUR&#xA;2013-01-14  0.7480&#xA;2013-01-15  0.7490&#xA;2013-01-16  0.7524&#xA;2013-01-17  0.7504&#xA;2013-01-18  0.7489&#xA;2013-01-19  0.7508 ** Saturday&#xA;2013-01-20  0.7508 ** Sunday&#xA;2013-01-21  0.7510&#xA;2013-01-22  0.7506&#xA;2013-01-23  0.7510&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;--&gt; I would have added more links to documentation etc., but I can only add two with my current rep:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;www dot quandl dot com/help/r&lt;/p&gt;&#xA;" OwnerUserId="7440" LastActivityDate="2015-12-02T02:30:31.440" Title="Anomaly or feature from Quantmod in R regarding getFX - currency data" Tags="&lt;r&gt;&lt;quantmod&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22004" PostTypeId="2" ParentId="22002" CreationDate="2015-11-30T18:22:09.133" Score="2" Body="&lt;p&gt;Mathematically they must be the same: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{Cov(Portfolio_{returns},r^m)}{Var(r^m)} = \frac{Cov(\sum w_i r_i,r^m)}{{Var(r^m)}} = \frac{\sum w_i Cov(r_i,r_m)}{Var(r^m)} = \sum w_i \beta_i = Portfolio_{beta}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is just math and has nothing to do with finance. They must yield the same. &lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-11-30T18:22:09.133" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22005" PostTypeId="2" ParentId="22001" CreationDate="2015-11-30T19:31:22.723" Score="2" Body="&lt;p&gt;For most traders they wouldn't have a need to use ISO orders. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It tells the exchange to fill the order completely at the exchange, assuming the required volume and price are met without routing the order to another exchange.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It was introduced when RegNMS came in as otherwise once an exchange filled the order at the top price level it would have to send the order to the other exchanges showing that particular price level before it could fill the order at a lower price level.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you happened to be a shop who knows the current NBBO is  stale, you can issue an ISO order(typically Immediate or Cancel) that tells the exchange to fill your order entirely at the exchange without trying to source liquidity at other exchanges.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Exchanges like it as they get the entire fill at their exchange and the user takes the liability of telling them that they have done the diligence to know that they are getting the NBBO.&lt;/p&gt;&#xA;" OwnerUserId="743" LastActivityDate="2015-11-30T19:31:22.723" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22006" PostTypeId="2" ParentId="21997" CreationDate="2015-11-30T19:37:40.563" Score="2" Body="&lt;p&gt;I do not think such figure exist in its per-canned form. However, for the most part, any pension/social security/annuity provider needs to have an idea of that, since it is their current and future liability that we are talking about. A quick and dirty way would be to look at US Social Security's funds, and get an estimate of how underfunded they are (so you can get an idea of the true size of liability). Now if you divided that by current US population, then you will get perhaps the closest answer to your 'closing balance' figure. There are too many devils in the details to cover here, so if you want more granularity than this, you should first get comfortable with some life/pension actuarial concepts, which would be outside the scope of this answer.&lt;/p&gt;&#xA;" OwnerUserId="17552" LastActivityDate="2015-11-30T19:37:40.563" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22007" PostTypeId="2" ParentId="21944" CreationDate="2015-11-30T19:43:31.587" Score="0" Body="&lt;p&gt;Actually my interpretation of the quote is that implied vol is DISCONNECTED from realized vol, because of the different information it contains, hence his reference to the market, and all the imperfections. Implied vol can be considered a consensus expectation of future volatility AS OF any given time, but in practices consensus expectation and fair estimator are two different things.&lt;/p&gt;&#xA;" OwnerUserId="17552" LastActivityDate="2015-11-30T19:43:31.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22008" PostTypeId="1" AcceptedAnswerId="22009" CreationDate="2015-11-30T20:43:58.603" Score="1" ViewCount="236" Body="&lt;p&gt;What are the R packages that let you estimate Multi Scale Realized Volatility (MSRV)? So far I've only found highfrequency (which comes with Realized Kernel as well), but from what I understand it only has Two Scale Realized Volatility (TSRV) estimator.&lt;/p&gt;&#xA;" OwnerUserId="18195" LastActivityDate="2015-11-30T21:03:09.433" Title="MSRV estimation in R" Tags="&lt;volatility&gt;&lt;r&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22009" PostTypeId="2" ParentId="22008" CreationDate="2015-11-30T21:03:09.433" Score="2" Body="&lt;p&gt;I'm not aware of a R package implementing the MSRV, however you can find its implementation in the Kevin Sheppard MFE Toolbox (Matlab). You’ll have to translate it for R . (the source code is available)&lt;/p&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2015-11-30T21:03:09.433" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22010" PostTypeId="1" CreationDate="2015-11-30T21:34:24.957" Score="2" ViewCount="235" Body="&lt;p&gt;We are trying to see latency from our server to different LPs&#xA;. &#xA;For that we are checking sendingtime value (from them) and current clock in our server. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What we saw is difference of +-20ms between them and us.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BTW, We are syncing our server with a SNTP.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this normal? can anyone tell his/her experience on this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="13990" LastEditorUserId="13990" LastEditDate="2016-01-31T22:50:26.583" LastActivityDate="2017-01-04T22:07:53.363" Title="FIX latency and clock syncronization" Tags="&lt;fx&gt;&lt;exchange&gt;&lt;fix&gt;&lt;latency&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22011" PostTypeId="1" CreationDate="2015-11-30T21:37:27.170" Score="-1" ViewCount="53" Body="&lt;p&gt;What is the result if the liquidity effect is grater than other effects in case of decreased money supply?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I got this question on the exam,&#xA;In case of an increase in the money supply by the central bank what will happen if the liquidity effect is greater than the other effect (price level inflation... Effects) and the economy adjust slowly&#xA;The answer would be that the interest rate will fall and rise slowly&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The next question was what if the liquidity effect is greater than other effect and the economy adjust slowly in can of decreased money supply?&lt;/p&gt;&#xA;" OwnerUserId="18493" LastEditorUserId="18493" LastEditDate="2015-12-01T06:53:24.743" LastActivityDate="2015-12-01T11:22:09.480" Title="Liquidity effect in case MS decrease" Tags="&lt;liquidity&gt;&lt;macro-economics&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22012" PostTypeId="2" ParentId="21822" CreationDate="2015-11-30T21:55:33.287" Score="1" Body="&lt;p&gt;I would recommend you the following econometrics textbook &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0070597936&quot; rel=&quot;nofollow&quot;&gt;Basics Econometrics&lt;/a&gt;, with a particular focus on &lt;code&gt;multinomial logit / probit&lt;/code&gt; models. I guess the challenging part in your case will consist of specifying  the &lt;code&gt;exogenous&lt;/code&gt; variables, collecting data, before doing the computations. The latter being quick to perform. As far as I am concerned it's better to design your own model based on the suggested statistical techniques rather than hoping to find on Internet existing bank models which deals &lt;code&gt;stricto sensu&lt;/code&gt; with this specific task. Hope it helps&lt;/p&gt;&#xA;" OwnerUserId="18252" LastActivityDate="2015-11-30T21:55:33.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22015" PostTypeId="1" CreationDate="2015-11-30T23:06:02.663" Score="1" ViewCount="171" Body="&lt;p&gt;I am estimating realized variance and covariance by the estimator described in &lt;a href=&quot;http://arxiv.org/pdf/0908.1890.pdf&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; paper, and relying on Fourier Transform.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, as my data is one day of data in ultra high frequency, so that the estimation takes time, I sample the data every minute but still use that estimator, cutting the frequencies after 100.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have some confusion : can you confirm that by applying that paper I am calculating the daily realized variance, and that the result should be comparable to what I find if I simply sum the squared minute returns for the day?&lt;/p&gt;&#xA;" OwnerUserId="8128" LastActivityDate="2016-01-30T12:13:38.700" Title="Fourier transform covariance estimator" Tags="&lt;covariance&gt;&lt;variance&gt;&lt;covariance-estimation&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22016" PostTypeId="2" ParentId="21975" CreationDate="2015-12-01T02:23:58.073" Score="5" Body="&lt;p&gt;Let's define $t=0$, $T_1 = 1$ and $T_2 = 2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe the interviewer is looking for the price of the &quot;global&quot; option $V_t$ for $t \leq T_1 \leq T_2 $.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's define the payoff at time $T_1$: it is the maximum between the value of a call or a put on the same underlying with maturity at $T_2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Payoff}_{T_1} = \max( c_{T_1}, p_{T_1} )$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $c_{T_1}$ and $p_{T_1}$ are respectively the price at time $T_1$ of a call and a put under the same underlying with expiry at time $T_2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As noted by Gordon, we know that $\max( a, b ) = b + ( a - b )^+$, hence:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Payoff}_{T_1} =  p_{T_1} + ( c_{T_1} - p_{T_1} )^+$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the put call parity, we know that $c_{T_1} - p_{T_1} = S_{T_1} - e^{-r(T_2-T_1)}K$ and therefore we get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Payoff}_{T_1} =  p_{T_1} + ( S_{T_1} - e^{-r(T_2-T_1)}K )^+$$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's write the general statement:&#xA;$$V_t = \mathbb{E}_Q \left[ e^{-r(T_1 - t)} \text{Payoff}_{T_1} | \mathcal{F}_t \right] = \mathbb{E}_Q \left[ e^{-r(T_1 - t)} \left( p_{T_1} + ( S_{T_1} - e^{-r(T_2-T_1)}K )^+ \right) | \mathcal{F}_t \right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can split the value into two main terms:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V_t = \mathbb{E}_Q \left[ e^{-r(T_1 - t)} p_{T_1} | \mathcal{F}_t \right] + \mathbb{E}_Q \left[ e^{-r(T_1 - t)} ( S_{T_1} - e^{-r(T_2-T_1)}K )^+ | \mathcal{F}_t \right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We see that the second term is simply the price at time $t$ of a call option on $S$ expiring at $T_1$ with strike $K' = e^{-r(T_2-T_1)}K$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, we know that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ p_{T_1} = \mathbb{E}_Q \left[ e^{-r(T_2 - T_1)} (K - S_{T_2}) | \mathcal{F}_{T_1} \right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the first term can be seen as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}_Q \left[ e^{-r(T_1 - t)} \mathbb{E}_Q \left[ e^{-r(T_2 - T_1)} (K - S_{T_2})^+ | \mathcal{F}_{T_1} \right] | \mathcal{F}_t \right] = \mathbb{E}_Q \left[ e^{-r(T_1 - t)}  e^{-r(T_2 - T_1)} (K - S_{T_2})^+ | \mathcal{F}_t \right] = \mathbb{E}_Q \left[ e^{-r(T_2 - t)}  (K - S_{T_2})^+ | \mathcal{F}_t \right] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;because of the iterated conditoning rule and since $\mathcal{F}_t \subseteq \mathcal{F}_{T_1}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This second term is the value at time $t$ of a put expiring at time $T_2$ with strike $K$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the answer is that at time $t$ the value of the option is the value of the put plus the value of a call expiring at $T_1$ with strike $K' = e^{-r(T_2-T_1)}K$.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="19887" LastEditDate="2016-05-04T13:28:05.063" LastActivityDate="2016-05-04T13:28:05.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22017" PostTypeId="1" CreationDate="2015-12-01T03:04:09.970" Score="1" ViewCount="198" Body="&lt;p&gt;Assume you have a vanilla call on an underlying $S$ with strike price $K$ and expiry at time $T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say that $S$ follows a &lt;a href=&quot;https://en.wikipedia.org/wiki/Geometric_Brownian_motion&quot; rel=&quot;nofollow&quot;&gt;GBM&lt;/a&gt; with volatility $\sigma$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, one would use the Black-Scholes &lt;a href=&quot;https://en.wikipedia.org/wiki/Black%E2%80%93Scholes_model&quot; rel=&quot;nofollow&quot;&gt;formula&lt;/a&gt; to price this option, but this relies on many assumptions and in particular that one can buy/sell the stock in continuous time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What if we cannot trade the stock (for example, we're not allowed to). What are the different ways of valuing this options?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only way I see is to estimate your own utility function given an expected payoff and a volatility, which is really hard, but I wanted to know if there was any other well-known approach?&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2015-12-01T08:15:48.327" Title="How to estimate the price of a European call when the underlying is not tradable?" Tags="&lt;options&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22018" PostTypeId="2" ParentId="22017" CreationDate="2015-12-01T07:02:51.607" Score="2" Body="&lt;p&gt;1 - Try &lt;em&gt;real options valuation&lt;/em&gt; methods if &lt;em&gt;underlying&lt;/em&gt; is not &lt;em&gt;tradable&lt;/em&gt;, and use the volatility of a &lt;em&gt;proxy / peer or comparable&lt;/em&gt; asset as an estimate. None of the approaches would be &lt;em&gt;perfect&lt;/em&gt; with unlisted stocks (in general), so you'll surely end up in using own judgement to gauge the &lt;em&gt;fair value&lt;/em&gt; of the option under study.&lt;/p&gt;&#xA;&lt;p&gt;Here is an interesting &lt;a href=&quot;http://people.stern.nyu.edu/adamodar/pdfiles/execval/optval.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;link&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;2 -  Alternatively, I would have valued this company using &lt;em&gt;DCF methods&lt;/em&gt; to get an e&lt;em&gt;xpected firm value&lt;/em&gt;, then &lt;em&gt;expected price&lt;/em&gt;. Once &lt;em&gt;expected S&lt;/em&gt; is known, use &lt;em&gt;volatility of the firm peers&lt;/em&gt;, then plug those info to the BS formula. Otherwise in case of &lt;strong&gt;IPO&lt;/strong&gt;, use e&lt;em&gt;stimated share price from brokers&lt;/em&gt;, as it might be quicker than valuing the firm by your own&lt;/p&gt;&#xA;&lt;p&gt;3 - Finally (&lt;em&gt;might be least favourable&lt;/em&gt;), &lt;em&gt;use numerical methods&lt;/em&gt; (like &lt;em&gt;trinomial trees&lt;/em&gt;, etc.) if you're stuck with the &lt;em&gt;maths&lt;/em&gt; as you seem to have mentioned in the initial post. Although you're dealing European options, as long as nodes get bigger prices from tree and BS methods do converge (&lt;em&gt;undeniable fact&lt;/em&gt;). Once again: use &lt;em&gt;estimated share price&lt;/em&gt; (from brokers in case of &lt;em&gt;IPOs&lt;/em&gt; or use own company valuation &lt;em&gt;via&lt;/em&gt; &lt;em&gt;DCF methods&lt;/em&gt;, &lt;em&gt;Multiples&lt;/em&gt;...) and &lt;em&gt;volatility&lt;/em&gt; (from peers / industry..) to work out the payoffs up to the end, before discounting them back.&lt;/p&gt;&#xA;" OwnerUserId="18252" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2015-12-01T08:15:48.327" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22019" PostTypeId="1" CreationDate="2015-12-01T07:51:03.663" Score="3" ViewCount="202" Body="&lt;p&gt;To boost the economy, the central bank can do it either by lowering down the interest rate nor carry out QE. But QE objective is to lowered the interest rate also so banks can give out more loan. This seem to be similar.But i believe it's different. So what are the differences here. I am really confused.&lt;/p&gt;&#xA;" OwnerUserId="18497" LastActivityDate="2015-12-01T12:48:50.893" Title="Why Central Bank carry out Qe when they can directly force banks to lower down the interest rate?" Tags="&lt;interest-rates&gt;&lt;quantitative&gt;&lt;economics&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22020" PostTypeId="2" ParentId="22019" CreationDate="2015-12-01T08:54:12.457" Score="1" Body="&lt;p&gt;Good question. to make it short: same Aim, but &lt;em&gt;just&lt;/em&gt; different ways to fullfill &lt;strong&gt;a goal&lt;/strong&gt;. if you (or &lt;em&gt;Lender of last resort&lt;/em&gt;) create(s) an &lt;em&gt;exogenous&lt;/em&gt; shock by lowering directly rates, the cost of interbank money is &lt;strong&gt;&lt;em&gt;de facto&lt;/em&gt;&lt;/strong&gt; reduced and you expect a positive &lt;em&gt;externality&lt;/em&gt; in real economy by providing more loans towards economic agents (companies, etc.). However with &lt;em&gt;QE&lt;/em&gt;, you or Central bank increase(s) balance sheets by buying more Treasury assets (for instance, government bonds, etc.) and therefore increasing the money supply for different purposes: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 - Sustain economic growth with a willingness to generate inflation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2 - Ensure financial stability by putting a downward pressure on yields (impacting yield curves). This affects financial futures markets too&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3 - Rescuing banks or any other financial institutions by providing them with more money (cash) in an attempt to mitigate the consequences of a severe crisis. This could be embodied by taking &lt;em&gt;toxic assets&lt;/em&gt; as collateral for some time in the wake of &lt;em&gt;repurchase agreements&lt;/em&gt; (&lt;strong&gt;repo&lt;/strong&gt; or &lt;strong&gt;reverse repo&lt;/strong&gt;), as we've seen recently.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope it helps&lt;/p&gt;&#xA;" OwnerUserId="18252" LastEditorUserId="18252" LastEditDate="2015-12-01T10:21:47.970" LastActivityDate="2015-12-01T10:21:47.970" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22022" PostTypeId="1" CreationDate="2015-12-01T09:04:38.237" Score="2" ViewCount="73" Body="&lt;p&gt;When QE is carried out, the Federal Reserve prints money and buy government bonds in an effort to pour extra money into the economy. This causes financial institutions for instance banks to lowered their cost of borrowing. Why do these institutions decide to lowered down their interested rate just because they gain more money from the FED? From my reading, when the FED bought bonds, the price of the bonds become higher and the yield become less.&#xA;How bonds yield and its price affect the interest rates of banks is what I don't understand?&lt;/p&gt;&#xA;" OwnerUserId="18497" LastActivityDate="2015-12-03T07:34:18.847" Title="Why financial instistution for instance banks lowered down their interest rate during QE?" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;economics&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22023" PostTypeId="2" ParentId="12718" CreationDate="2015-12-01T09:12:00.903" Score="0" Body="&lt;p&gt;By convention, a negative number indicates loss. Value at risk gives you the loss at the specific quantile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, this number depends entirely on the scenarios on which you run VaR. If your portfolio is a single long position in a stock, and all your scenarios shift the price of the stock upwards different amounts, then you will get a negative number - indicating that the alfa:th quantile worst loss is actually a profit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Needless to say, this is an indication that your scenarios are poor (or that you hold an incredible portfolio).&lt;/p&gt;&#xA;" OwnerUserId="5888" LastActivityDate="2015-12-01T09:12:00.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22024" PostTypeId="2" ParentId="22022" CreationDate="2015-12-01T09:24:47.353" Score="3" Body="&lt;p&gt;Put it simply, the interest rate depends on the forces of demand and supply of money. When the Fed buy bond, it increases the money supply into the economy. To induce the people to borrow more money bank reduces their own interest rate, otherwise, people won't have any incentives to borrow more. The interest rate is reduce to such level again equilibrium is reached in the market ( or demand gets equal to the supply). &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/A8yts.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/A8yts.jpg&quot; alt=&quot;Interest Rate Determination&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Further, increase liquidity in the market also reduces the cost of borrowing money in the money market. A good example is LIBOR (London Interbank Offered Rate). It not only reduces bank own borrowing cost but many loans and contracts are directly tied to LIBOR. Any change in LIBOR has direct impact on the trillions of contract tied to it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similar to opposite happen when Fed reduces the money supply via selling bonds.  &lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="16991" LastEditDate="2015-12-03T07:34:18.847" LastActivityDate="2015-12-03T07:34:18.847" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22025" PostTypeId="2" ParentId="22010" CreationDate="2015-12-01T10:44:37.367" Score="0" Body="&lt;p&gt;Have you tried installing the ntp daemon ntpd (which calculates the drift of your system clock and continuously adjusts it)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so check&lt;/p&gt;&#xA;&#xA;&lt;p&gt;sudo ntpd -qgddd&lt;/p&gt;&#xA;" OwnerUserId="18399" LastActivityDate="2015-12-01T10:44:37.367" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22026" PostTypeId="2" ParentId="22011" CreationDate="2015-12-01T11:22:09.480" Score="1" Body="&lt;p&gt;Your question is quite confusing, and obviously not straighforward if you don't give more context. &#xA;In fact, considering the simpler New Keynesian model several answers are possible depending on calibration. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The liquidity effect impact to an exogenous money supply shock can have several directions. Check the figures below from Gali (2001):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ds48C.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ds48C.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-12-01T11:22:09.480" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22028" PostTypeId="2" ParentId="22019" CreationDate="2015-12-01T11:50:16.060" Score="1" Body="&lt;p&gt;The traditional tool of central banks is the direct control of interest rates.  The interest rate being controlled is usually the short dated interbank rate ( federal funds rate in the US).   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If, in a severe recession, the short rates have already been reduced to zero, we have seen central banks turn to QE.   Under QE, the central bank typically buys government bonds in the open markets. This has the effect of influencing longer term rates such as bond yields and mortgage rates to be lower.  Hence the major difference is that QE affects long dated rates whereas traditional Fed policy is directed at short rates only.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2015-12-01T11:50:16.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22029" PostTypeId="1" AcceptedAnswerId="22035" CreationDate="2015-12-01T11:54:05.010" Score="5" ViewCount="3082" Body="&lt;p&gt;I'm working on the Black-Scholes equation, but I'm pretty new to financial modeling. Right now, I am trying to understand the Black-Scholes PDE. I understand that the Black-Scholes equation is given by&#xA;\begin{equation*}&#xA;\frac{\partial C}{\partial t} + \frac{1}{2}\sigma^2 S^2\frac{\partial^2 C}{\partial S^2} + rS \frac{\partial C}{\partial S} - rC = 0&#xA;\end{equation*}&#xA;with initial condition&#xA;\begin{equation*}&#xA;C(S,T) = \max (S-K, 0)&#xA;\end{equation*}&#xA;and boundary conditions&#xA;\begin{equation*}&#xA;C(0,t) = 0 \hspace{35pt} C(S,t) \rightarrow S \text{ as } S \rightarrow \infty&#xA;\end{equation*}&#xA;and $C(S,t)$ is defined over $0 &amp;lt; S &amp;lt; \infty$, $0 \leq t \leq T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The transformed equation is &#xA;\begin{equation*}&#xA;\frac{\partial u}{\partial \tau} = \frac{\partial^2 u}{\partial x^2} + (k-1)\frac{\partial u}{\partial x} - ku&#xA;\end{equation*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://www.math.uwaterloo.ca/~hwolkowi//henry/reports/talks.d/t09talks.d/09waterloomatlab.d/mfileshigham.d/bs.m&quot; rel=&quot;nofollow noreferrer&quot;&gt;following matlab code&lt;/a&gt; implements this. &lt;strong&gt;My question is, what exactly is the form of the boundary conditions for the the transformed equation?&lt;/strong&gt; I can't seem to understand the parameters (related to the boundary conditions) given in the Matlab code. Any related literature would be highly appreciated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And as an additional question, for the following graph &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/UEjf0.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/UEjf0.jpg&quot; alt=&quot;plot&quot;&gt;&lt;/a&gt;, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;you get the most payoff when you wait until t = 4 and S = $e^{0.5}$. Is this insight correct? Additionally, in the graph above, what is the implication? Since the payoff is greatest when time to go, $t$ is maximum, does this mean we should exercise the option early? &lt;/p&gt;&#xA;" OwnerUserId="18501" LastEditorUserId="848" LastEditDate="2015-12-02T18:30:06.780" LastActivityDate="2015-12-02T18:30:06.780" Title="Black-Scholes PDE: what is the form of the boundary conditions" Tags="&lt;black-scholes&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22030" PostTypeId="2" ParentId="22019" CreationDate="2015-12-01T12:48:50.893" Score="4" Body="&lt;p&gt;There is not a single 'interest-rate' to reduce, there are various interest rates in play.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The central bank mandate is usually to control CPI or a similar measure of inflation (e.g. Bank of England's 2% inflation target for GBP). There are various tools for them to do this, including QE and setting the central bank rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, at the moment, the central bank interest rate (i.e. the rate at which banklike institutions can borrow from the central bank) is very low, so this tool has limited use, and lowering it further reduces future opportunities to use it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;QE pushes to increase price inflation by increasing general monetary inflation; this is not a direct relationship, as prices for many everyday items are much more related to the disposable incomes of the population than to the inflation of the currency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rates at which retail banks offer loans and savings account, which you are suggesting the central bank could alter, are to do with the default risk of the customer and the investment rates the bank can achieve. You don't want to intervene in bank's estimations of customer credit risk, so that just leaves the savings rates which the bank offers. These could only be increased if the bank could invest at higher rates, which are largely governed by that central bank rate. Given that these rates are already close to zero, it would be hard to justify forcing a bank to lower them either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is an economic argument that the purpose of the central bank is to corner the money supply so that it can then manipulate it as needed. Arguably this has been achieved by the US, UK and EU central banks at least, in that their overnight funding rates and rate targets strongly determine the interbank overnight rates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the moment, central bank rates are low to stimulate investment and spending; higher interest rates penalise borrowers and reward savers, whereas lower rates reward spending and penalise saving. With central bank rates low, there is a risk of inflation running too low and possibly entering deflation which strongly disincentivizes spending (you could wait and pay less). So QE is the tool that central banks have opted for to drive inflation higher without raising central bank rates. It is not the only tool left, as we have seen other measures designed to temper for example mortgage borrowing by adding limits to how banks can lend, etc.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2015-12-01T12:48:50.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22031" PostTypeId="2" ParentId="19088" CreationDate="2015-12-01T14:22:05.547" Score="2" Body="&lt;p&gt;The following paper builds a multi-agent model where agents have asymmetric risk attitudes consistent with behavioural finance. The gain/loss asymmetry can be reproduced by this model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S0378437111000197&quot; rel=&quot;nofollow&quot;&gt;Investors’ risk attitudes and stock price fluctuation asymmetry (2011)&lt;/a&gt; by Yu Zhang, Honggang Li&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Abstract&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Price rise/fall asymmetry, which indicates enduring but modest rises&#xA;  and sudden short-term falls, is a ubiquitous phenomenon in stock&#xA;  markets throughout the world. Instead of the widely used time series&#xA;  method, we adopt inverse statistics from turbulence to analyze this&#xA;  asymmetry. To explore its underlying mechanism, we build a multi-agent&#xA;  model with two kinds of investors, which are specifically referred to&#xA;  as fundamentalists and chartists. Inspired by Kahneman and Tversky’s&#xA;  claim regarding peoples’ asymmetric psychological responses to the&#xA;  equivalent levels of gains and losses, we assume that investors take&#xA;  different risk attitudes to gains and losses and adopt different&#xA;  trading strategies. The simulation results of the model developed&#xA;  herein are consistent with empirical work, which may support our&#xA;  conjecture that investors’ asymmetric risk attitudes might be one&#xA;  origin of rise/fall asymmetry.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Unfortunately the paper is behind a paywall and I haven't found a freely available version. When you find one I will add the link to it here.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2015-12-01T14:22:05.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22032" PostTypeId="1" CreationDate="2015-12-01T14:35:46.093" Score="1" ViewCount="391" Body="&lt;p&gt;Does anyone know why the volatility skew for lognormal model, such as BK, should be a flat line, meaning that implied black volatility for options will be same for those with different strike prices?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why volatility skew for normal mode, such as Hull White, should not be flat? I assume that normal model assumes volatility is independent of rate level.&lt;/p&gt;&#xA;" OwnerUserId="18503" LastActivityDate="2015-12-01T20:06:47.783" Title="volatility skew for lognormal model is flat?" Tags="&lt;volatility&gt;&lt;skew&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22033" PostTypeId="2" ParentId="21737" CreationDate="2015-12-01T15:37:35.330" Score="3" Body="&lt;p&gt;&lt;strong&gt;Interesting question&lt;/strong&gt;, as All the answers (&lt;em&gt;including mine&lt;/em&gt;) could not be generalized &lt;em&gt;unfortunately&lt;/em&gt;. As far as I am concerned, I use a &lt;em&gt;univariate EGARCH&lt;/em&gt; for risk modelling purposes (&lt;em&gt;Filtered Historical Simulation&lt;/em&gt; (FHS), etc.). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 - &lt;em&gt;EGARCH&lt;/em&gt;, merely because GARCH models do not take into account so-called &lt;strong&gt;leverage effects&lt;/strong&gt;, which is crucial to me for &lt;em&gt;skewed&lt;/em&gt; and &lt;em&gt;leptokurtic&lt;/em&gt; data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2- &lt;em&gt;Univariate&lt;/em&gt; rather than &lt;em&gt;multivariate&lt;/em&gt; processes, for simplicity purposes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;** I am not generally in favor of using &lt;em&gt;static parameter&lt;/em&gt; estimates (such as the notorious &lt;code&gt;lambda = 0.94&lt;/code&gt;), but it's fine to me if the people resorting to these approaches obtain reliable estimates while &lt;em&gt;backtesting&lt;/em&gt; their models. I prefer sticking with the &lt;code&gt;mle&lt;/code&gt; estimates which are nowadays quick to perform.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;PS:&lt;/strong&gt; I &lt;strong&gt;only&lt;/strong&gt; use &lt;em&gt;univariate GARCH&lt;/em&gt; in conjunction with &lt;em&gt;Alpha - Stable distributions&lt;/em&gt; for my risk metrics, when I think the outlook is highly stressed. It's just for safety measures :). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope it helps&lt;/p&gt;&#xA;" OwnerUserId="18252" LastActivityDate="2015-12-01T15:37:35.330" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22034" PostTypeId="1" AcceptedAnswerId="22038" CreationDate="2015-12-01T16:29:32.527" Score="1" ViewCount="188" Body="&lt;p&gt;a paylater option has the folowing payoff: $(S_{T}-K)_{+}-P1_{S_{T}&amp;gt;K}$.&#xA;To determine the fee P that the option holder must pay, we must write the non arbitrage condition. Why is it this: &#xA;$E_{Q}[(S_{T}-K)_{+}-P1_{S_{T}&amp;gt;K}]=0$ ? I mean it would say the no arbitrage condition consists to write that the price of a paylater option is 0 ??&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="15738" LastActivityDate="2015-12-01T18:20:54.267" Title="no arbitrage condition for paylater option" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;finance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22035" PostTypeId="2" ParentId="22029" CreationDate="2015-12-01T16:36:32.440" Score="1" Body="&lt;p&gt;You seem to be quite in to PDEs and less into finance.&#xA;A call option gives at a future time $T$ the payoff&#xA;$$&#xA;max(S_T-K,0),&#xA;$$&#xA;thus if $S_T$ is bigger than $K$ then this is what you get, else nothing.&#xA;The PDE tells you how the value changes with respect to changes in $S$ and $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Theory tells us that the price of this option today (at $t=0$) is given as the discounted expected pay-off.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You solve the PDE on a mesh. There the value must be biggest, when $S$ is biggest. In reallity (and in theory on the whole real line) the value is unbounded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&#xA;Note that the equation above is the terminal value. This one is triavial, the task is to calculate the price of this option at time $t$, $0 &amp;lt; t &amp;lt; T$. Furthermore mathematical finance deals with hedging of such a position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not that much into PDEs but the one that you state is the PDE of the Europena style call -right? In this case you can only exercise the option at $T$. For so called American type options you can exercise at any point in time $u, 0 &amp;lt; u \le T$. If the stock is not paying dividens then you will never exercise early as the price of holding the option is always bigger(&lt;a href=&quot;https://www.quora.com/For-a-non-dividend-paying-stock-why-does-an-american-call-option-have-the-same-value-as-an-european-call-option&quot; rel=&quot;nofollow&quot;&gt;see here&lt;/a&gt;). In this case the price of the American style option is the same as of the European. Read about these two styles first. The basic reference is John Hull: OPTIONS, FUTURES, AND OTHER DERIVATIVES. You find slides on the web.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2015-12-02T07:36:03.687" LastActivityDate="2015-12-02T07:36:03.687" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22036" PostTypeId="2" ParentId="22002" CreationDate="2015-12-01T16:41:07.287" Score="1" Body="&lt;p&gt;In your method 2: if you say that you regress the portfolio return $r = \sum w_i r_i$ on the asset returns $r_i$ then you do &lt;strong&gt;multivariate&lt;/strong&gt; regression and all covariances between the assets will be incorporated in the solution (the vector $\beta$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using method 1 then you first calculate &lt;strong&gt;univariate&lt;/strong&gt; regressions and weigt them - this is something different.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-12-01T16:41:07.287" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22037" PostTypeId="2" ParentId="2172" CreationDate="2015-12-01T17:25:40.033" Score="2" Body="&lt;p&gt;I believe this can be solved using the reflection theorem:&#xA;$$P(\max S_t &amp;gt; x) = 2 P (S_T &amp;gt; x)$$&#xA;Hence the required densities can be obtained solely from the distribution of $S_T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a one to one correspondence between $\max P_t$ and $\max S_t$, so that&#xA;$$P (\max P_t &amp;lt; y) = P (\max S_t &amp;lt; g(y) )$$&#xA; where the function $g$ is the inverse of the function for $P_t$ in terms of $S_t$ given in the OP.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Continuing that logic I get for the final answer&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P (\max P_t &amp;lt; y) = 1 - 2 N \left[ \frac{\ln(S_0/K)}{ \sigma \sqrt{T}} - InvN(y) - \sigma \sqrt{T}\right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $N[]$ is the cumulative normal distribution, $InvN[]$ is its inverse, $S_0$ is the stock price today.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have to say I'm not 100pct confident of the algebra.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastEditorDisplayName="user13444" LastEditDate="2016-12-23T17:49:44.717" LastActivityDate="2016-12-23T17:49:44.717" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22038" PostTypeId="2" ParentId="22034" CreationDate="2015-12-01T18:20:54.267" Score="1" Body="&lt;p&gt;The value of an option is the premium that is paid to own this option. For this paylater option, since nothing is paid upfront, the value of the option is zero. That is,&#xA;\begin{align*}&#xA;e^{-rT}E\big((S_{T}-K)^{+}-P1_{S_{T}&amp;gt;K}\big)=0,&#xA;\end{align*}&#xA;or&#xA;\begin{align*}&#xA;E\big((S_{T}-K)^{+}-P1_{S_{T}&amp;gt;K}\big)=0.&#xA;\end{align*} &lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-12-01T18:20:54.267" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22039" PostTypeId="1" CreationDate="2015-12-01T18:22:12.907" Score="0" ViewCount="88" Body="&lt;p&gt;I'm interested in researching the effects of a stock ranking at extremes on a certain date, and was wondering if anyone can help me find a tool/site which allows to easily retrieve the best/worst performing stock on a given (historical) date. I'm interested in US stocks and the performance criteria should be % change.&lt;/p&gt;&#xA;" OwnerUserId="18505" LastEditorUserId="18505" LastEditDate="2015-12-02T17:25:32.787" LastActivityDate="2015-12-03T17:35:14.210" Title="Where can I find the best and worst performing US stocks on a given date?" Tags="&lt;equities&gt;" AnswerCount="2" CommentCount="3" ClosedDate="2015-12-04T06:14:02.030" ContentLicense="CC BY-SA 3.0" />
  <row Id="22041" PostTypeId="1" AcceptedAnswerId="22049" CreationDate="2015-12-01T20:03:00.257" Score="1" ViewCount="119" Body="&lt;p&gt;I have been told that these two expressions of Itô's Lemma are the same, but written in different ways :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ f(t,X_t) = f(0, X_0) + \int_{0}^{t} \frac{\partial f}{\partial s} ds + \int_{0}^{t} \frac{\partial f}{\partial X_s} dX_s + \frac{1}{2}\int_{0}^{t} \frac{\partial^2 f}{\partial {X_s}^2}{\sigma_s}^2 ds$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$df(X_t, Y_t) = \frac{\partial f}{\partial X_t}dX_t + \frac{\partial f}{\partial Y_t}dY_t + \frac{1}{2} \frac{\partial^2 f}{\partial {X_t}^2}d&amp;lt;X_t&amp;gt;_t&#xA;+ \frac{1}{2} \frac{\partial^2 f}{\partial {Y_t}^2}d&amp;lt;Y&amp;gt;_t&#xA;+ \frac{\partial^2 f}{\partial X_t \partial Y_t}d&amp;lt;X, Y&amp;gt;_t&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $&amp;lt;X, Y&amp;gt;_t$ is the quadratic variation operator (and $&amp;lt;X&amp;gt;_t = &amp;lt;X,X&amp;gt;_t$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I cannot figure out why they are similar. In my eyes, they seem pretty different. How can I pass from the first one to the second one? Actually I don't really understand how the second one can be interpreted and applied.&lt;/p&gt;&#xA;" OwnerUserId="15650" LastActivityDate="2015-12-02T15:31:15.113" Title="Link between two Itô's Lemma written in different ways" Tags="&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22042" PostTypeId="2" ParentId="22032" CreationDate="2015-12-01T20:06:47.783" Score="3" Body="&lt;p&gt;The answer is that by definition, if the underlying stock obeys a lognormal distribution with std deviation parameter sigma, then the implied vol of options priced using this model will be sigma.   Of course in the market we observe that options of different strikes have different vols - this just means that the underlying distribution is not perfectly lognormal.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2015-12-01T20:06:47.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22045" PostTypeId="2" ParentId="21760" CreationDate="2015-12-01T21:33:09.363" Score="1" Body="&lt;p&gt;Your confusion is certainly coming from a distinction between &lt;strong&gt;Price&lt;/strong&gt; and &lt;strong&gt;Yield&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 - You're definitely right in regards to &lt;strong&gt;&lt;em&gt;Bond Price&lt;/em&gt;&lt;/strong&gt; &lt;code&gt;as 99 1/8 = 99.125&lt;/code&gt;. Likewise &lt;code&gt;99 1/32 = 99.0313&lt;/code&gt; (&lt;em&gt;assuming 100 PAR&lt;/em&gt;). It's worth highlighting on the fact that this convention is &lt;strong&gt;only&lt;/strong&gt; applicable to US bond prices, as far as I am concerned.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2 - By contrast, &lt;strong&gt;&lt;em&gt;Bond Yield&lt;/em&gt;&lt;/strong&gt;  is the &lt;em&gt;discount rate&lt;/em&gt; at which the present value of all future cash flows from the bond (&lt;em&gt;coupons and principal included&lt;/em&gt;) is equal to its price (see the below).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/mKJ96.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/mKJ96.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Where:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; P = Bond price (Clean)&#xA; C = Coupon payments, derived from Coupon frequency as well as Coupon Rate&#xA; F = Face value of the bond&#xA; t = Time to maturity&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;For simplicity purposes, let's assume a &lt;em&gt;flat term structure of interest rates&lt;/em&gt;, thus &lt;code&gt;r&lt;/code&gt; is &lt;em&gt;constant&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Refer to &lt;em&gt;Excel&lt;/em&gt; &lt;strong&gt;YIELD()&lt;/strong&gt; or &lt;em&gt;Matlab&lt;/em&gt; &lt;strong&gt;YLDMAT()&lt;/strong&gt; functions to sort &lt;code&gt;r&lt;/code&gt; out from the above equation (excluding &lt;em&gt;day count convention&lt;/em&gt; for simplicity purposes.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Hope it helps&lt;/p&gt;&#xA;" OwnerUserId="18252" LastActivityDate="2015-12-01T21:33:09.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22046" PostTypeId="1" CreationDate="2015-12-01T22:11:08.530" Score="-2" ViewCount="105" Body="&lt;p&gt;Here is 1 tick:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Timestamp,Bid price,Ask price,Bid volume,Ask volume&lt;/p&gt;&#xA;&lt;p&gt;20151127 00:05:00:592,1.06057,1.06061,1,1.5&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Does &lt;code&gt;ask volume&lt;/code&gt; 1.5 mean 1.5 million were actually sold or is it just an offer&lt;/p&gt;&#xA;&lt;p&gt;Another question. Here is some more tickdata:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;20151127 00:10:35:292,1.06056,1.06058,1.12000000476837,1.5&lt;/p&gt;&#xA;&lt;p&gt;20151127 00:10:35:821,1.06056,1.06058,1.12000000476837,1.5&lt;/p&gt;&#xA;&lt;p&gt;20151127 00:10:37:284,1.06056,1.06058,1.12000000476837,1.5&lt;/p&gt;&#xA;&lt;p&gt;20151127 00:10:37:785,1.06056,1.06058,1.12000000476837,1.5&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;You can see that the time changes but the best offers do not change. I thought it's supposed to &amp;quot;tick&amp;quot; when there is an update.&lt;/p&gt;&#xA;" OwnerUserId="18485" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2015-12-02T18:35:25.273" Title="How to understand this tickdata `askvolume` and `bidvolume` fields?" Tags="&lt;tick-data&gt;" AnswerCount="1" CommentCount="3" ClosedDate="2015-12-03T16:09:55.317" ContentLicense="CC BY-SA 3.0" />
  <row Id="22047" PostTypeId="2" ParentId="22046" CreationDate="2015-12-02T00:09:18.717" Score="1" Body="&lt;p&gt;Since this row of data reflects both bid and ask state simultaneously, this row of data represents a quote, not a trade. So the latter is true: it is just an offer.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2015-12-02T00:09:18.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22048" PostTypeId="1" CreationDate="2015-12-02T00:22:26.737" Score="15" ViewCount="3411" Body="&lt;p&gt;The Vasicek model for the short rate $r_t$ is given by the SDE&#xA;$$&#xA;dr_t = \alpha(\beta - r_t)dt + \sigma dW_t,&#xA;$$&#xA;where $W_t$ is a Brownian motion under the physical measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to compute bond prices under this model, so I need to estimate the three parameters $\alpha$, $\beta$ and $\sigma$.  Of course, $r_t$ isn't observable, but the yields $R(t,T)$ are, which are computed from actual bond prices and so we should be using the risk-neutral measure.  The Vasicek model after this change of measure is&#xA;$$&#xA;dr_t = (\alpha(\beta - r_t) - \lambda\sigma)dt + \sigma d\tilde{W}_t,&#xA;$$&#xA;where $\tilde{W}_t$ is a Brownian motion under the risk-neutral measure and $\lambda$ is the market price of risk.  However, we may write this as&#xA;$$&#xA;dr_t = a(b - r_t)dt + \sigma dW_t,&#xA;$$&#xA;where&#xA;$$&#xA;a = \alpha, \qquad b = \frac{\alpha\beta - \lambda\sigma}{\alpha}.&#xA;$$&#xA;Thus we still have only three parameters to estimate, $a,b$ and $\sigma$, while the market price of risk $\lambda$ is simply implicit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, recall the bond price $P(t,T)$ may be written in two ways as&#xA;$$&#xA;P(t,T) = e^{-R(t,T)(T-t)} = e^{A_t(a,b,\sigma) - B_t(a,b,\sigma) r_t(a,b,\sigma)},&#xA;$$&#xA;where $A_t$ and $B_t$ are deterministic functions of the &lt;em&gt;risk-neutral&lt;/em&gt; parameters $a$, $b$ and $\sigma$ &lt;strong&gt;(is this right?)&lt;/strong&gt;.  Thus given a bond yield $R(t,T)$, the short rate may be recovered through the affine function&#xA;$$&#xA;r_t(a,b,\sigma) = \frac{R(t,T)(T-t) + A_t(a,b,\sigma)}{B_t(a,b,\sigma)}.&#xA;$$&#xA;We may then use some fancy estimation procedure to estimate the parameters $a,b$ and $\sigma$ through the observed yields.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, &lt;strong&gt;is it indeed the risk-neutral parameters we would be estimating?&lt;/strong&gt;  That is, would we be estimating the $a,b,$ and $\sigma$, or would we need to include $\lambda$ and estimate $\alpha, \beta, \sigma$ and $\lambda$?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2019-09-20T20:01:20.150" Title="Estimating Parameters - Vasicek" Tags="&lt;interest-rates&gt;&lt;risk-neutral-measure&gt;&lt;estimation&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="22049" PostTypeId="2" ParentId="22041" CreationDate="2015-12-02T00:49:40.280" Score="3" Body="&lt;p&gt;I assume you're confused between the integral and SDE writings of Ito's lemma, since the two equations you have are indeed different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $X_t$ be an Ito process defined by &#xA;$$&#xA;X_t = X_0 + \int_0^t \alpha_s \, ds + \int_0^t \sigma_s \, dW_s&#xA;$$&#xA;for adapted processes $\alpha_s$ and $\sigma_s$ (and assuming some technical boundedness condition on the integrals).  This equation may be written &lt;em&gt;in shorthand&lt;/em&gt; as an &lt;em&gt;SDE&lt;/em&gt; as&#xA;$$&#xA;dX_t = \alpha_t dt + \sigma_t dW_t.&#xA;$$&#xA;The SDE is not rigorous - it is simply a shortcut way of writing down the integrals above, and provides a bit of intuition behind the evolution of $X$ over &quot;infinitesimally small&quot; time intervals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now consider a measurable function $f: [0,T] \times \mathbb{R} \to \mathbb{R}$ such that &#xA;$$&#xA;f(\cdot,x)\in C^1([0,T]) \quad \forall x \in \mathbb{R},&#xA;$$&#xA;and&#xA;$$&#xA;f(t,\cdot) \in C^2(\mathbb{R}) \quad \forall t \in [0,T].&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would argue the correct (mathematically rigorous) way of stating Ito's lemma is&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$$ f(T,X_T) = f(0,X_0) + \int_0^T \frac{\partial}{\partial t}f(s,X_s)&#xA; \, ds + \int_0^T \frac{\partial}{\partial x}f(s,X_s) \, dX_s \\ &#xA;\qquad&#xA; + \frac{1}{2}\int_0^T \frac{\partial^2}{\partial x^2}f(s,X_s) \, d&amp;lt;X,X&amp;gt;_s $$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The quantity $&amp;lt;X,X&amp;gt;_s$ is the quadratic variation accumulated by the Ito process $X$ up until time $s$.  You can show (Shreve II, page 143-144, e.g.) that this is given by&#xA;$$&#xA;&amp;lt;X,X&amp;gt;_s = \int_0^s \sigma^2_u \, du,&#xA;$$&#xA;or, in differential (shorthand) form as&#xA;$$&#xA;d&amp;lt;X,X&amp;gt;_s = \sigma^2_s \, ds.&#xA;$$&#xA;Plugging this into Ito's lemma gives your first equation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, just like the Ito process $X$ was written in shorthand as an SDE, so may $f$, since it, too, is an Ito process.  That is, we also have&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$$ df(t,X_t) = \frac{\partial}{\partial t}f(t,X_t)dt +&#xA; \frac{\partial}{\partial x}f(t,X_t) dX_t +&#xA; \frac{1}{2}\frac{\partial^2}{\partial x^2}f(t,X_t) d&amp;lt;X,X&amp;gt;_t. $$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The first boxed equation had precise mathematical meaning.  The second boxed equation is just shorthand for the first.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; Your second equation is often called Ito's product rule.  Ito's lemma is &quot;usually&quot; stated for functions of one Ito process as it was for my answer above.  If you have a function of two Ito processes then both processes' quadratic variation and cross variation appear in Ito's lemma, aka Ito's product rule.  See Shreve II, page 168, e.g. for a decent explanation&lt;/p&gt;&#xA;" OwnerUserId="6866" LastEditorUserId="6866" LastEditDate="2015-12-02T15:31:15.113" LastActivityDate="2015-12-02T15:31:15.113" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22050" PostTypeId="2" ParentId="22003" CreationDate="2015-12-02T02:30:31.440" Score="1" Body="&lt;p&gt;Your premise that there should be no data is incorrect. The foreign exchange market is an over-the-counter market, so there is no official definition of a trading day and the market never officially closes. The fact that you see some data on weekends is because OANDA never stops collecting data. There is nothing to prevent any of the parties who report trades to OANDA from trading on weekends or holidays.&lt;/p&gt;&#xA;" OwnerUserId="56" LastActivityDate="2015-12-02T02:30:31.440" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22051" PostTypeId="1" CreationDate="2015-12-02T04:15:01.353" Score="-1" ViewCount="29" Body="&lt;p&gt;From my research, Fed's Qe should encourage house sales, however the graph shows houses price in the state seem to gradually go down after 2009. Isn't that contradicting itself? Ain't the increase in demand suppose to push the price of houses to go up? or am I wrong. Is the Fed Qe effective at inducing the house sales in the US? And if so why does it happens to be that way?&lt;/p&gt;&#xA;" OwnerUserId="18497" LastActivityDate="2015-12-10T03:43:14.447" Title="How does Fed Qe affect the housing sales in the US? Why does it happen to be that way?" Tags="&lt;finance&gt;&lt;price&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22054" PostTypeId="2" ParentId="21917" CreationDate="2015-12-02T09:52:23.163" Score="-3" Body="&lt;p&gt;Unless I am mistaken, the solution is &lt;em&gt;embedded&lt;/em&gt; within the post. In a nutshell, I would have used &lt;strong&gt;numerical methods&lt;/strong&gt; such as a mere &lt;em&gt;binomial tree&lt;/em&gt; to the extent that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 - The &lt;em&gt;Payoff function&lt;/em&gt; up to &lt;em&gt;Maturity&lt;/em&gt; is known  &lt;code&gt;= max(P_t_m - K, 0)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2 - The stochastic &lt;em&gt;Discount factor&lt;/em&gt; has also been explicitly stated &lt;code&gt;(M_t_tau)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consequently, from &lt;em&gt;expiry (if not open-ended)&lt;/em&gt; going backward at each node, check whether or not it's worth exercising the option (depending on its &lt;em&gt;Style&lt;/em&gt;) and &lt;em&gt;discount&lt;/em&gt; it back to finally end up with a &lt;em&gt;fair value&lt;/em&gt; (price).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope it helps&lt;/p&gt;&#xA;" OwnerUserId="18252" LastActivityDate="2015-12-02T09:52:23.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22055" PostTypeId="1" AcceptedAnswerId="22065" CreationDate="2015-12-02T14:37:50.033" Score="6" ViewCount="465" Body="&lt;p&gt;In his paper &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2033323&quot;&gt;Gatheral&lt;/a&gt;  presents the following parametrization of the implied total variance $w(k,T) = \sigma_{BS}(k,T)^2T$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ w(k) = a + b\{\rho (k-m) + \sqrt{(k-m)^2 + \sigma^2} \}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming that we only have a few market prices e.g. 6 or 7 which are close to at-the-money. &#xA;I wanted to know if there are any common techniques to extrapolate the implied volatility for Strikes that are far out-of-the-money.&lt;/p&gt;&#xA;" OwnerUserId="15767" LastActivityDate="2016-05-30T23:38:59.957" Title="Extrapolating SVI" Tags="&lt;option-pricing&gt;&lt;implied-volatility&gt;&lt;stochastic-volatility&gt;&lt;best-practices&gt;&lt;extrapolation&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22057" PostTypeId="1" AcceptedAnswerId="24650" CreationDate="2015-12-02T15:15:10.963" Score="0" ViewCount="110" Body="&lt;p&gt;For many probability of defaults models in credit risk it is needed to use data observed from a &quot;full&quot; business cycles. Usually a business cycle is defined as a recurring (not necessarily periodic) economic cycle of recession and expansion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question now is pretty general but maybe there is some knowledge of it. Are there any available methods to compensate if not a full business cycle is observed? And how can one tell if a full business cycle is observed? Thanks for any help!&lt;/p&gt;&#xA;" OwnerDisplayName="user18514" LastActivityDate="2016-03-02T00:02:52.323" Title="Business cycles and missing data" Tags="&lt;credit-risk&gt;&lt;default-probability&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22058" PostTypeId="1" CreationDate="2015-12-02T15:28:16.130" Score="1" ViewCount="245" Body="&lt;p&gt;Here is a table that I found in one of the accounting book:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;| Account Type | Debits   | Credits  |&#xA;|--------------|----------|----------|&#xA;| Assets       | Increase | Decrease |&#xA;| Liabilities  | Decrease | Increase |&#xA;| Income       | Decrease | Increase |&#xA;| Expenses     | Increase | Decrease |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; What is the &lt;strong&gt;logic&lt;/strong&gt; behind that debit and credit impact differently on different type of accounts in double-entry accounting?&lt;/p&gt;&#xA;" OwnerUserId="18515" LastActivityDate="2015-12-02T19:43:54.740" Title="Why debit and credit impact differently on different type of accounts?" Tags="&lt;accounting&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22059" PostTypeId="1" CreationDate="2015-12-02T15:29:08.243" Score="1" ViewCount="123" Body="&lt;p&gt;What is the delta of a short position in 1,000 European call options on silver futures? The options mature in eight months, and the futures contract underlying the option matures in nine months. The current nine-month futures price is $8 per ounce, the exercise price of the options is $8, the risk-free interest rate is 12% per annum, and the volatility of silver is 18% per annum. &lt;/p&gt;&#xA;" OwnerUserId="18517" LastActivityDate="2015-12-02T15:29:08.243" Title="Delta hedging Question" Tags="&lt;delta-hedging&gt;" AnswerCount="0" CommentCount="1" ClosedDate="2015-12-02T16:08:43.313" ContentLicense="CC BY-SA 3.0" />
  <row Id="22060" PostTypeId="2" ParentId="22057" CreationDate="2015-12-02T15:29:37.137" Score="0" Body="&lt;p&gt;I am not clear with what you mean. You usually have data on business cycle up until two quarters before the actual date. &#xA;Check the NBER: &lt;a href=&quot;https://research.stlouisfed.org/fred2/series/USRECM&quot; rel=&quot;nofollow&quot;&gt;https://research.stlouisfed.org/fred2/series/USRECM&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to know the current business cycle you can just extrapolate it from the last data point, or you can compute a probability transition matrix.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-12-02T15:29:37.137" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22061" PostTypeId="2" ParentId="22058" CreationDate="2015-12-02T16:08:26.250" Score="2" Body="&lt;p&gt;In the late middle ages when Accounting was invented in Italy (approx mid 1300s), they did not have the modern notation for negative numbers (which was introduced about 1481). They represented positive quantities by entering them on the left side of a T account (a process called a debit) and negative by entering them (without a negative sign, which I repeat had not been invented yet!) on the right side of the T account (called a credit).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since Assets are (normally) positive, they are increased by making a debit (that is a left side entry). And of course for that reason they are shown on the left side of the balance sheet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Liabilities on the other hand are on the right side of the balance sheet (in modern terms they are negative quantity) so they are increased in absolute value by making a credit (you have to hit the T account on the right hand side).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Income is a part of owners equity (a liability) so it is also a &quot;right side&quot; quantity that increases by crediting&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Expense is opposite to this and therefore increases by debiting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is an explanation suitable for a mathematics historian, but for an accountant the rules are simply a matter of convention and of remembering &quot;right&quot; vs &quot;left&quot;.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2015-12-02T19:43:54.740" LastActivityDate="2015-12-02T19:43:54.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22062" PostTypeId="2" ParentId="22029" CreationDate="2015-12-02T16:17:10.503" Score="3" Body="&lt;p&gt;The form of the boundary conditions comes from the transformation.  If my transformation maps $t \to\tau$, $S \to x$ then the boundary conditions are mapped by $\tau \to t$ and $x \to S$.  So if $x=log(S)$, then my terminal condition will be $(e^x-K)^+$&lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2015-12-02T16:17:10.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22063" PostTypeId="2" ParentId="22058" CreationDate="2015-12-02T16:45:10.857" Score="1" Body="&lt;p&gt;Apart from the answer above, which gives you the historic context, the usual way accountants think about it:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fundamental accounting equation is:&#xA;Assets = Liabilities + Equity&#xA;Or equivalently&#xA;Assets = Liabilities + Retained Earnings + Net Income&#xA;Assets = Liabilities + RE + Income/Sales/Revenue – Expenses&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;You increase LHS with debits and RHS with credits&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the expense has the negative sign, you need to have an opposite treatment. (Or think like Assets + Expenses = Liabilities + RE + Revenue)&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-12-02T16:45:10.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22065" PostTypeId="2" ParentId="22055" CreationDate="2015-12-02T20:19:10.833" Score="0" Body="&lt;p&gt;The parametrization, such as this and the SABR volatility, is for an easier looking up of the volatility on a volatility surface. When you have 6 or 7 market quotes, you can calibrate the parameters $a$, $b$, $\rho$, $m$, and $\sigma$. Once this is done and assuming that this parametrization is a bona fide representation of the volatility surface, you are then able to look up implied volatilities for deep out-of-the-money strikes.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-12-02T20:19:10.833" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22066" PostTypeId="1" AcceptedAnswerId="22073" CreationDate="2015-12-02T20:44:06.340" Score="2" ViewCount="237" Body="&lt;p&gt;I'm pretty new to finances, but I'm heavily into scientific computation. For my scientific computations class, I need to have at least a basic understanding of finances for the presentation I'm going to give.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the Black-Scholes equation, &#xA;\begin{equation*}&#xA;\frac{\partial C}{\partial t} + \frac{1}{2}\sigma^2 S^2\frac{\partial^2 C}{\partial S^2} + rS \frac{\partial C}{\partial S} - rC = 0&#xA;\end{equation*}&#xA;I was able to plot the following graph where the volatility $\sigma = 0.08$, risk-free interest $r = 0.05$, strike price K = 10, C is the payoff, S is the current market price, and t is the time to expiry. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/gjYOt.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/gjYOt.png&quot; alt=&quot;thisgraph&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I am at loss at how I can interpret this. Can anyone give me any  insight about the meaning of this graph and its implications? Any help would be highly appreciated. &lt;/p&gt;&#xA;" OwnerUserId="18501" LastEditorUserId="18501" LastEditDate="2015-12-03T03:15:31.593" LastActivityDate="2017-05-02T22:14:50.753" Title="Implications of Black Scholes Plot" Tags="&lt;interest-rates&gt;&lt;black-scholes-pde&gt;&lt;graphs&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22068" PostTypeId="1" CreationDate="2015-12-02T21:15:29.160" Score="1" ViewCount="801" Body="&lt;p&gt;I am investigating some &lt;strong&gt;asset allocation strategies&lt;/strong&gt; and I am wondering about the results I obtain. I am working on &lt;strong&gt;monthly and weekly data&lt;/strong&gt; of the same stock indices (SP500, FTSE 100 etc). And when I compute the &lt;strong&gt;summary statistics&lt;/strong&gt; of the realized returns I observe that for the very same strategy those statistics vary greatly between weekly and monthly data. For the monthly f.e. I obtain &lt;strong&gt;skewness&lt;/strong&gt; = 0.4 and &lt;strong&gt;kurtosis&lt;/strong&gt; = 5, while for the weekly frequency &lt;strong&gt;skewness&lt;/strong&gt;  = 1.5 and &lt;strong&gt;kurtosis&lt;/strong&gt; = 25. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are the results for the weekly data plausible? And is it possible that the difference in the frequency of data results in such differences in the summary statistics? All computations are identical, the only difference is the data frequency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope the question is not too general and it is possible to give some insight based on my description.&lt;/p&gt;&#xA;" OwnerUserId="17464" LastActivityDate="2015-12-05T20:09:52.153" Title="High values of skewness and kurtosis of realized protfolio returns" Tags="&lt;statistics&gt;&lt;asset-allocation&gt;&lt;skewness&gt;&lt;kurtosis&gt;" AnswerCount="2" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="22069" PostTypeId="2" ParentId="21976" CreationDate="2015-12-02T23:43:12.243" Score="4" Body="&lt;p&gt;No there is no way since the calculated internal&#xA;rate of return $r$  is &lt;em&gt;by definition&lt;/em&gt; defined as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$0 = \sum_{i=0}^{I}  \frac{C_{i}}{(1+r)^{i}}  $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to know the entire cash flow distribution and its timing if you want to compute the Pooled IRR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One advantage of IRR is that it takes the irregular timings of cash flows into account, logically its disadvantage is that you need to know the timing and the associated amount.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2015-12-03T00:08:57.527" LastActivityDate="2015-12-03T00:08:57.527" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22070" PostTypeId="2" ParentId="21976" CreationDate="2015-12-03T00:14:27.523" Score="4" Body="&lt;p&gt;&lt;strong&gt;Exact solution:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume we agree that for &#xA;$y_1:=IRR(CF1)$, $y_2:=IRR(CF2)$, $y:=IRR(CF1+CF2)$, the following equations hold by definition:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$-1000+\frac{100}{1+y_1}+\frac{100}{(1+y_1)^2}+\frac{1100}{(1+y_1)^3}=0$$&#xA;$$-200+\frac{20}{1+y_2}+\frac{30}{(1+y_2)^2}+\frac{1}{(1+y_2)^3}=0$$&#xA;$$-1200+\frac{120}{1+y}+\frac{130}{(1+y)^2}+\frac{1001}{(1+y)^3}=0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These equations represent the definition of IRR and must hold. It is known that a system of equations can be solved by adding the equations, so it follows:&#xA;$$-1000-200+\frac{100}{1+y_1}+\frac{20}{1+y_2}+\frac{100}{(1+y_1)^2}+\frac{30}{(1+y_2)^2}+\frac{1100}{(1+y_1)^3}+\frac{1}{(1+y_2)^3}\stackrel{!}{=}-1200+\frac{120}{1+y}+\frac{130}{(1+y)^2}+\frac{1001}{(1+y)^3}$$&#xA;So we need to solve&#xA;$$\frac{100}{1+y_1}+\frac{20}{1+y_2}+\frac{100}{(1+y_1)^2}+\frac{30}{(1+y_2)^2}+\frac{1100}{(1+y_1)^3}+\frac{1}{(1+y_2)^3}=\frac{120}{1+y}+\frac{130}{(1+y)^2}+\frac{1001}{(1+y)^3}$$&#xA;Call the left hand side &quot;$X$&quot; and multiply the equation by $(1+y)^3$:&#xA;$$X(1+y)^3=120(1+y)^2+130(1+y)+1001$$&#xA;This is a cubic equation:&#xA;$$X(1+y)^3-120(1+y)^2-130(1+y)-1001=0$$&#xA;The real-valued solution to such equation given by &lt;a href=&quot;https://en.wikipedia.org/wiki/Cubic_function#General_formula_for_roots&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; is:&#xA;$$1+y= - \frac{1}{3a}\left(b\ +\ C\ +\ \frac{\Delta_0}{C}\right)$$&#xA;where $C = \sqrt[3]{\frac{\Delta_1 + \sqrt{\Delta_1^2 - 4 \Delta_0^3}}{2}}$, $\Delta_0 = b^2-3 a c $, $\Delta_1 = 2 b^3-9 a b c+27 a^2 d$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It follows:&#xA;$$y= - \frac{1}{3a}\left(b\ +\ C\ +\ \frac{\Delta_0}{C}\right)-1$$&#xA;with $a=X$, $b=-120$, $c=-130$, $d=1001$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This solution incorporates the two IRRs $y_1,y_2$. It happens to have the same expression as when calculating the &quot;normal&quot; IRR based on the cashflows since $X=1200$ by definition. Note that this &lt;strong&gt;must&lt;/strong&gt; be the case, because we are looking for the same $y$ that solves both equations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As requested by the OP and moderator, I will write out this solution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$y= - \frac{1}{3X}\left(-120\ +\ \sqrt[3]{\frac{\Delta_1 + \sqrt{\Delta_1^2 - 4 \Delta_0^3}}{2}}\ +\ \frac{\Delta_0}{\sqrt[3]{\frac{\Delta_1 + \sqrt{\Delta_1^2 - 4 \Delta_0^3}}{2}}}\right)-1$$&#xA;$$= - \frac{1}{3\left(\frac{100}{1+y_1}+\frac{20}{1+y_2}+\frac{100}{(1+y_1)^2}+\frac{30}{(1+y_2)^2}+\frac{1100}{(1+y_1)^3}+\frac{1}{(1+y_2)^3}\right)}\left(-120\ +\ \sqrt[3]{\frac{2 b^3-9 a b c+27 a^2 d + \sqrt{\left(2 b^3-9 a b c+27 a^2 d\right)^2 - 4 \Delta_0^3}}{2}}\ +\ \frac{\Delta_0}{\sqrt[3]{\frac{2 b^3-9 a b c+27 a^2 d + \sqrt{\Delta_1^2 - 4 \Delta_0^3}}{2}}}\right)-1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I stop writing out the solution here as it would not add more information. This equation infers the PIRR from the IRRs, all other values are constants. It is the exact solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it shows that the solution must incorporate the cashflows, it is not possible to separate out the solution to depend only on $y_1,y_2$. The third root term in the equation immediately implies that the cashflows cannot be canceled out.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Approximate Solution:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The IRR $y$ of the sum of the cashflows must lie withing the range $[y_1,y_2]$ where $y_1\leq y_2$. If $y$ is higher than $y_1$ and $y_2$, then the above equation has no solution since all cash flows on the right were discounted at a higher rate than the left such that the equation could not hold. By the same argument it follows that $y$ must be larger than the minimum of $y_1,y_2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A natural guess would be to take the average of the two:&#xA;$$y\approx (y_1+y_2)/2=-0.225$$&#xA;Since we have a sum of CF1 and CF2, we may further weight the average by the absolute sum of cash flows to get:&#xA;$$y\approx \frac{2200}{2200+251}0.1+\frac{251}{2200+251}\cdot(-0.55)=0.03345$$&#xA;This estimate is very close to the exact value of $0.046$.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2015-12-03T23:32:08.250" LastActivityDate="2015-12-03T23:32:08.250" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22071" PostTypeId="2" ParentId="22039" CreationDate="2015-12-03T00:49:27.787" Score="0" Body="&lt;p&gt;This links shows the S&amp;amp;P500 stocks. You can sort them by clicking on the column &quot;change&quot;: &lt;a href=&quot;http://www.barchart.com/stocks/sp500.php&quot; rel=&quot;nofollow&quot;&gt;http://www.barchart.com/stocks/sp500.php&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2015-12-03T00:49:27.787" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22072" PostTypeId="1" AcceptedAnswerId="22083" CreationDate="2015-12-03T02:35:53.873" Score="4" ViewCount="3031" Body="&lt;p&gt;I've been learning about &lt;a href=&quot;https://en.wikipedia.org/wiki/Feynman%E2%80%93Kac_formula&quot; rel=&quot;nofollow&quot;&gt;Feynman-Kac&lt;/a&gt; recently and I understand the underlying ideas. I am stuck however in actually computing explicit solutions for specific problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, suppose I have the following terminal value problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$F_t + \frac{1}{2}\sigma^2x^2F_{xx}=1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$F(x,T) = \ln(x)^4,~x&amp;gt;0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would I compute $F(x,t)$ in closed form, given the closed form of the right hand side $(ln(x))^4$ using Feynman-Kac?&lt;/p&gt;&#xA;" OwnerUserId="18524" LastEditorUserId="467" LastEditDate="2015-12-03T06:57:29.467" LastActivityDate="2020-03-28T20:26:41.390" Title="How to apply the Feynman-Kac formula?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22073" PostTypeId="2" ParentId="22066" CreationDate="2015-12-03T02:56:04.957" Score="3" Body="&lt;p&gt;Something is off in your plot.  The value of a call should be very near zero with a strike price $10$ for the stock prices and times you have plotted.  At first I thought you may have plotted &quot;moneyness&quot; defined as $S/K$ instead of $S$, but then your values are too low for that.  May want to check your implementation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Besides that, the plot is telling you just what any other two-variable plot is: the value of the function for a given pair of variables.  In this case, e.g. the (supposed, but not correct) price of a European call option at which $S = 1.4$ and $t = 5$ is about 2.5 (peak of your graph).  (Note the correct price, assuming the stock price is actually 14, is about 4.48 - see &lt;a href=&quot;http://www.cboe.com/framed/IVolframed.aspx?content=http%3A%2F%2Fcboe.ivolatility.com%2Fcalc%2Findex.j%3Fcontract%3D15AC3D8C-B75B-4931-BC6F-E1B57497DCA9&amp;amp;sectionName=SEC_TRADING_TOOLS&amp;amp;title=CBOE%20-%20IVolatility%20Services&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; and plug in &quot;8&quot; for volatility and &quot;5&quot; for interest rate, leave dividends blank).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The behavior of you plot does seem correct, though.  You can observe that, for fixed $t$, the price of the option increases as the stock price increases.  This makes sense, since it is increasingly more likely to expire with a positive value.  Also, for fixed $S$ and &lt;em&gt;decreasing&lt;/em&gt; $t$, meaning as we approach maturity (note this is actually moving forward in time), the call becomes worth less and less, since its value at expiration is become more and more certain (for fixed $S$).  This is always true for calls, but in some extreme situations puts do increase in the value as a function of $-t$.&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2015-12-03T02:56:04.957" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22074" PostTypeId="1" CreationDate="2015-12-03T03:46:34.687" Score="0" ViewCount="92" Body="&lt;p&gt;How does one calculate the return on a portfolio if the assets in that portfolio were held for varying periods of time?&lt;br&gt;&#xA;For Example:&#xA;&lt;li&gt;$t_0$ Buy AAPL at 100&lt;br&gt;&#xA;&lt;li&gt;$t_5$ Buy MSFT at 20&lt;br&gt;&#xA;&lt;li&gt;$t_1$$_0$ Sell MSFT at 30&lt;br&gt;&#xA;&lt;li&gt;$t_2$$_0$ Sell AAPL at 110&lt;br&gt;&#xA;&lt;li&gt;$t_2$$_5$ Buy MSFT at 40&lt;br&gt;&#xA;&lt;li&gt;$t_3$$_0$ Buy AAPL at 150&lt;br&gt;&#xA;&lt;li&gt;$t_5$$_0$ Sell AAPL at 160&lt;br&gt;&#xA;&lt;li&gt;$t_7$$_0$ Sell MSFT at 50&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can we simply find the sum of annualized returns for each trade to find out what the annualized portfolio return was at $t_7$$_0$? Could we then do the same for another portfolio to compare the two portfolios from $t_0$ to $t_7$$_0$?&lt;br&gt;&lt;/p&gt;&#xA;" OwnerUserId="18477" LastActivityDate="2016-04-27T21:48:44.417" Title="Portfolio return for assets held for different lengths of time" Tags="&lt;returns&gt;&lt;portfolio&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22076" PostTypeId="1" AcceptedAnswerId="22082" CreationDate="2015-12-03T06:20:48.523" Score="0" ViewCount="341" Body="&lt;p&gt;I am a newbee in Quantive finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;supposing I calibrate a smoothing implied volatility surface with cubic spline now. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A minute later I want to price K=100,t=1 option, can I just find the point on the volatility surface which K=100 and t=(1-1/24*60*360)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks.&lt;/p&gt;&#xA;" OwnerUserId="18526" LastEditorUserId="18526" LastEditDate="2015-12-03T14:11:18.847" LastActivityDate="2015-12-03T14:11:18.847" Title="pricing with implied volatility surface" Tags="&lt;options&gt;&lt;volatility&gt;&lt;implied-volatility&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22077" PostTypeId="2" ParentId="22066" CreationDate="2015-12-03T09:11:47.757" Score="1" Body="&lt;p&gt;I'd want to add what @bcf has already mentioned:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer your comment, as your option approach to maturity, your likelihood of your final position being different to your current value decrease. This is related to volatility. The more volatility your option has, the more expensive it is. What does this have to do with investors? An investor with a long term expectation would go for a longer maturity, but the investor must be prepared to pay for more for the option. A short-term investor might not want a short-term option (because it doesn't have enough risk). The short term investor might prefer a forward contract where no option premium is required (easier accounting).&lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="601" LastEditDate="2015-12-04T12:59:31.520" LastActivityDate="2015-12-04T12:59:31.520" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22078" PostTypeId="1" AcceptedAnswerId="22086" CreationDate="2015-12-03T11:06:35.503" Score="1" ViewCount="743" Body="&lt;p&gt;I am new in this area so all help is much appreciated!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say a 3-year floating rate note pays a coupon of LIBOR+100 bps, and is issued at a premium with price = 100.5.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that this must mean that the total yield for the investor is lower than LIBOR+100 bps. But how would you calculate what the yield is? &#xA;I assume you must make guesses about the future LIBOR fixings?&lt;/p&gt;&#xA;" OwnerUserId="5549" LastEditorUserId="5549" LastEditDate="2015-12-03T12:03:45.793" LastActivityDate="2016-02-14T03:51:57.667" Title="What is the yield when a floating-rate note is issued above/below par?" Tags="&lt;fixed-income&gt;&lt;floating-rate&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22079" PostTypeId="2" ParentId="21917" CreationDate="2015-12-03T12:18:44.567" Score="-1" Body="&lt;p&gt;You can always estimate the expectation by simulating the distribution. In your case if it is a European option, you can just calculate the average simulated payoff. If it is an American option you can use a tree model to determine at each point whether exercising or not based on the maximum of exercise and continuation value.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2015-12-03T12:18:44.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22080" PostTypeId="2" ParentId="22074" CreationDate="2015-12-03T13:15:45.733" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://www.investopedia.com/terms/i/irr.asp&quot; rel=&quot;nofollow&quot;&gt;IRR&lt;/a&gt; and &lt;a href=&quot;http://www.investopedia.com/terms/m/mirr.asp&quot; rel=&quot;nofollow&quot;&gt;MIRR&lt;/a&gt; are probably the two textbook answers to your question.&lt;/p&gt;&#xA;" OwnerUserId="18464" LastActivityDate="2015-12-03T13:15:45.733" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22081" PostTypeId="2" ParentId="15360" CreationDate="2015-12-03T13:53:43.360" Score="1" Body="&lt;p&gt;As an additional (simple) solution I would use the probability integral transform (PIT)&#xA; of the returns with respect to the  generalized pareto distribution. Under the null hypothesis that the distribution is correctly specified, outcomes of the PIT should be independent uniform U[0; 1] random variables. Then you can use traditional independence tests.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2015-12-03T13:53:43.360" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22082" PostTypeId="2" ParentId="22076" CreationDate="2015-12-03T14:06:19.807" Score="0" Body="&lt;p&gt;If you have 2-dimensional model (spline or otherwise) of vol surface vol = f(t,K), and assuming that vol is sticky-strike, that is changes in moneyness have no effect on strike vol, then you can use your function with K=100 and t=1-1/(24*60*360) - note the parenthesis. &lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2015-12-03T14:06:19.807" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22083" PostTypeId="2" ParentId="22072" CreationDate="2015-12-03T14:14:01.207" Score="2" Body="&lt;p&gt;Based on the form of your equation, we can consider the SDE&#xA;\begin{align*}&#xA;dX_t = \sigma X_t dW_t, &#xA;\end{align*}&#xA;where $W$  is a standard Brownian motion under the measure $Q$. Since, for $0 \leq t \leq T$,&#xA;\begin{align*}&#xA;X_T = X_t \exp\left(-\frac{1}{2}\sigma^2 (T-t) + \sigma \int_t^T dW_s \right),&#xA;\end{align*}&#xA;based on Feynman–Kac formula, the solution is given by&#xA;\begin{align*}&#xA;F(t, x) &amp;amp;= E^Q\left(\int_t^T ds + (\ln X_T)^4 \mid X_t = x\right)\\&#xA;&amp;amp;=(T-t) + E^Q\left[\left(\ln x  -\frac{1}{2}\sigma^2 (T-t) + \sigma \int_t^T dW_s\right)^4\right].&#xA;\end{align*}&#xA;The remaining is now simple and is omitted.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-12-03T14:14:01.207" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22084" PostTypeId="2" ParentId="16370" CreationDate="2015-12-03T14:22:34.503" Score="4" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Would it be OK to mix put/call prices such that I only ever calculate implied volatility for in-the-money options?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;No. Use OTM options because they usually have narrower bid-ask spread. Ideally you calculate all IVs, and then use highest bid IV, smallest ask IV. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If so, I assume this surface can then immediately be used to calculate ...&#xA;  Yes, then you can calculate all puts and calls.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Does it make sense to price American options ...&#xA;  Yes.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now, the last 3 questions - yes, you can mix European-style, and American-style IVs, or use one IV surface to price the other. But I doubt its usefulness from practical point - AFAIK the only options that trade both styles are SPX (European on CBOE and American/futures on CME) and liquidity on both is among the highest in the world. You are unlikely to see any tradable mispricings in one product vs another.  &lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2015-12-03T14:22:34.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22085" PostTypeId="2" ParentId="15931" CreationDate="2015-12-03T14:33:55.330" Score="2" Body="&lt;p&gt;Basically there are three steps to accomplish this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 - collect time series of options for several expirations and strikes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2 - calculate implied volatility surface for every time period, and use model-based or model-free interpolation to create continuum of strikes / expirations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3 - from the continuous surfaces you can calculate series of any specific points of interest (e.g. 10-delta 3-month IV)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To do this manually is complicated for a beginner, and you should probably use some existing professional service.&lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2015-12-03T14:33:55.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22086" PostTypeId="2" ParentId="22078" CreationDate="2015-12-03T15:33:00.457" Score="1" Body="&lt;p&gt;Yes, you would make &quot;guesses&quot;, but fortunately these guesses are derived from market-observed rates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming a semi-annual coupon rate and discrete compounding, the price of a bond ($P$) is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ P=\sum_{i=1}^{2T} \frac{CF_i}{(1+\frac{Y}{2})^i} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $CF_i$ is the cashflow at time $i$, $Y$ is the annual yield, and $T$ is the number of years. The cashflows are linked to LIBOR such that for all cashflows (except maturity):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$CF_i = N(LIBOR_i +0.01)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $N$ is the notional of the bond, and $LIBOR_i$ is the zero-coupon LIBOR rate at tenor $i$. Recall that LIBOR is a combination of rates that generate a curve at a variety of tenors. In order to determine the yield ($Y$), we must first determine the coupon payments that are based off of this curve. For example, a cashflow payment 1.5 years from now will be determined by the LIBOR zero-curve for the 1.5 year tenor. Once we solve for all of the cashflows ($CF_i$), the only remaining variable is $Y$.&lt;/p&gt;&#xA;" OwnerUserId="6437" LastEditorUserId="6437" LastEditDate="2016-02-14T03:51:57.667" LastActivityDate="2016-02-14T03:51:57.667" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22087" PostTypeId="2" ParentId="22039" CreationDate="2015-12-03T16:52:12.817" Score="0" Body="&lt;p&gt;&lt;strong&gt;Quickest way&lt;/strong&gt; : Have a look at Bloomberg &lt;code&gt;EQS&lt;/code&gt; (&lt;em&gt;Equity Screening&lt;/em&gt;) function:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 - Type &lt;code&gt;EQS&lt;/code&gt; and hit &lt;code&gt;GO&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2 - Add criteria under section, &lt;code&gt;Screening Criteria&lt;/code&gt;; select More Options to view all screening criteria. Hoping you find or define your &lt;em&gt;Performance criteria&lt;/em&gt; there;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3 - Click &lt;code&gt;Results&lt;/code&gt; located in right corner of screen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4 - Click &lt;code&gt;Output&lt;/code&gt; to save to Excel, PDF or print.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Alternatively&lt;/strong&gt; : Resort to &lt;code&gt;FREE Quandl API&lt;/code&gt; to query a list of your specified data over a defined time period. This could be done in putting all the data into a &lt;code&gt;financial time series object&lt;/code&gt; in Matlab for instance, compute the return on those data and use &lt;code&gt;min()&lt;/code&gt; or &lt;code&gt;max()&lt;/code&gt; to retrieve the best/worst performing asset. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: It takes a little bit more time to program than using Bloomberg &lt;code&gt;EQS&lt;/code&gt; function, but it also worth doing it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's know if you need further assistance on this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best,&lt;/p&gt;&#xA;" OwnerUserId="18252" LastEditorUserId="18252" LastEditDate="2015-12-03T17:35:14.210" LastActivityDate="2015-12-03T17:35:14.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22088" PostTypeId="1" CreationDate="2015-12-03T19:43:41.747" Score="1" ViewCount="61" Body="&lt;p&gt;Suppose a person A has the following game:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;there are 2 red balls, 2 green balls and 1 white ball in a bag&lt;/li&gt;&#xA;&lt;li&gt;you take 1 ball (don't put it again in the bag) and then a second ball&lt;/li&gt;&#xA;&lt;li&gt;if you take the white ball, you win 10$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The question is : what is the price of this game ?&#xA;Suppose this is $c$ , then one can find that : $E[X] = 4-c$, with $X=10-c$ or $X=-c$. So in order to have a fair game : $c=4$.&#xA;Is it the good answer to find the $fair$ price of this game ?  I think there is the notion of martingale for the &quot;fair&quot; price. Fair price would mean that A, and the person who plays have equal chances in this game. And because it's &quot;fair&quot; we would have $E[Wealth_{t}|F_{s}]=Wealth_{s}$ with $Wealth=X$ actually. So we have to write $E[X]=0$ in order to find c, right ? I would like an intuitive answer (I know the numerical part is right ^^) by using some concepts of the option pricing theory (?).&lt;/p&gt;&#xA;" OwnerUserId="15738" LastActivityDate="2015-12-03T19:43:41.747" Title="simple game - fair value" Tags="&lt;price&gt;&lt;game&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22089" PostTypeId="2" ParentId="21852" CreationDate="2015-12-03T20:37:12.523" Score="3" Body="&lt;p&gt;I do not know the regulatory rules for this case, but methodologically you could take another similar dataset &quot;peer data&quot; and then check how correctly your model predicts the losses of this dataset.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2015-12-03T20:37:12.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22090" PostTypeId="1" CreationDate="2015-12-03T20:52:06.367" Score="0" ViewCount="599" Body="&lt;p&gt;I keep reading that floating rate notes trade on par on coupon reset days. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this always true, regardless of changes in the issuer's credit quality since the FRN was issued? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems probably that a change in the issuer's perceived credit quality should be visible in the price, but I am a novice in this area...&lt;/p&gt;&#xA;" OwnerUserId="5549" LastEditorUserId="5549" LastEditDate="2015-12-03T21:11:51.960" LastActivityDate="2019-01-23T15:00:38.163" Title="Do FRN's *always* trade on par on reset days, regardless if the issuer's credit quality has changed?" Tags="&lt;fixed-income&gt;&lt;pricing&gt;&lt;floating-rate&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22091" PostTypeId="1" AcceptedAnswerId="31277" CreationDate="2015-12-03T22:03:45.277" Score="0" ViewCount="479" Body="&lt;p&gt;I would need a quick help with Impulse response function interpretation which I have done after Vector autoregression model in stata. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need to understand &lt;strong&gt;how to interpret IRF graph or table values correctly&lt;/strong&gt;. What does the value on y axis mean? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In am trying to understand &lt;strong&gt;response of Exchange rate volatility to Interest rate&lt;/strong&gt; (both values are in log differences). Possible interpretations when there is &lt;strong&gt;0.001 spike&lt;/strong&gt; visible:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;1 standard deviation shock in IR cause 0.001 change to ER volatility value&lt;/li&gt;&#xA;&lt;li&gt;1 standard deviation shock in IR cause 0.1% change to ER volatility&lt;/li&gt;&#xA;&lt;li&gt;1 standard deviation shock in IR cause change to ER volatility of 0.001 of shock size&lt;/li&gt;&#xA;&lt;li&gt;any other explation... &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="17286" LastActivityDate="2016-12-01T01:00:21.483" Title="Impulse response function interpretation" Tags="&lt;volatility&gt;&lt;statistics&gt;&lt;standard-deviation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22092" PostTypeId="1" AcceptedAnswerId="22100" CreationDate="2015-12-03T22:18:31.530" Score="13" ViewCount="1356" Body="&lt;p&gt;In the CAPM theory Beta of asset $i$ are estimated in this way:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \beta_i = \frac{\sigma_{im}}{\sigma^2_m} $&#xA;where $\sigma_{im} = \rho_{im} \sigma_i \sigma_m$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But all these data are historical data. So, I'm wondering what if I use &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;$\sigma^2_m$ &amp;lt;- &lt;strong&gt;Implied volatility&lt;/strong&gt; of SP500 (VIX)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$\sigma_{im}$ &amp;lt;- &lt;strong&gt;implied volatility&lt;/strong&gt; for the asset $i$ using the at-the-money call option with a 1-month maturity.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;$\rho_{im}$ will be statistically estimated.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This way is a better estimation of the $\beta_{i}$ for the next month?  &lt;/p&gt;&#xA;" OwnerUserId="7827" LastEditorUserId="16472" LastEditDate="2015-12-04T16:00:21.730" LastActivityDate="2015-12-04T16:00:21.730" Title="Estimate Beta of CAPM from Implied Volatility?" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;correlation&gt;&lt;beta&gt;&lt;capm&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22093" PostTypeId="2" ParentId="22090" CreationDate="2015-12-03T22:30:57.867" Score="1" Body="&lt;p&gt;your concern about issuer's credit quality deterioration is valid. price would be par when a spread over reference index for the purpose of coupon determination is the same as a spread used for discounting (subject reference curve and discount curves are the same) - i.e. reset margin equals discount margin.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;have a look at seminal paper &lt;a href=&quot;http://www.bondweb.co.kr/download/downloadPage.asp?number=27345&amp;amp;gn=1&quot; rel=&quot;nofollow&quot;&gt;Salomon Brothers - An Investor's guide to FRNs&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18275" LastActivityDate="2015-12-03T22:30:57.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22094" PostTypeId="2" ParentId="21976" CreationDate="2015-12-03T23:27:57.993" Score="1" Body="&lt;p&gt;You could roughly estimate it by approximating the cash flows (which you do not know in full) using some &quot;reasonable&quot; simplified model. One example of such a model would be a cash flow of the form &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$-\mathrm{investment}, 0, 0, \dots{\small (n-1 \text{ zeros})}\dots, 0, \mathrm{returns}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Such a simple cash flow has IRR $r$ iff &#xA;$$&#xA;  \mathrm{returns} = \mathrm{investment}\cdot(1+r)^n.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if you only knew the IRRs $r_1$, $r_2$ and investment amounts $a_1$, $a_2$ for the two cash flows, you could approximate the PIRR by constructing the corresponding &quot;model&quot; cash flows and computing their pooled IRR:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\hat{\mathrm{PIRR}} = \left(\frac{a_1(1+r_1)^n + a_2(1+r_2)^n}{a_1 + a_2}\right)^{\frac{1}{n}} - 1&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your particular example, taking $n=3, a_1 = 1000, a_2 = 200, r_1 = 0.1, r_2 = -0.55$ you would obtain $\hat{\mathrm{PIRR}} = 3.98\%$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that when $n=1$ this approximation corresponds to the weighted average of the two rates (with investment amounts being the weights). As $n\to \infty$ the approximation converges towards $\max(r_1, r_2)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The latter observation also illustrates why PIRR is not uniquely defined. In fact, if we used different real-valued lengths $n_1$, $n_2$ in the model representations of the two cash flows, we could have obtained almost any* desired resulting value of PIRR within $(\min(r_1, r_2), \max(r_1, r_2))$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;sub&gt;* It is always the case when both rates are positive. When one or both rates are negative this claim is not as obvious and might require proof.&lt;/sub&gt;&lt;/p&gt;&#xA;" OwnerUserId="18275" LastEditorUserId="18464" LastEditDate="2015-12-05T13:16:45.783" LastActivityDate="2015-12-05T13:16:45.783" CommentCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="22096" PostTypeId="1" AcceptedAnswerId="22101" CreationDate="2015-12-04T00:24:08.000" Score="6" ViewCount="5187" Body="&lt;p&gt;How to derive an analytic formula of greeks for binary option?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know a vanilla option can be constructed by an asset-or-nothing call and a cash-or-nothing call, does that help us?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wikipedia states&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Since a binary call is a mathematical derivative of a vanilla call&#xA;  with respect to strike, the price of a binary call has the same shape&#xA;  as the delta of a vanilla call, and the delta of a binary call has the&#xA;  same shape as the gamma of a vanilla call.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Does that mean the delta of a binary call is also the gamma of a vanilla call? Can we use the analytical formula for gamma of vanilla call for binary option?&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2018-08-24T23:09:14.500" Title="Greeks for binary option?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;binary&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22098" PostTypeId="2" ParentId="22096" CreationDate="2015-12-04T07:04:42.917" Score="1" Body="&lt;p&gt;&lt;strong&gt;Detla (European binary call) = Gamma (European vanilla Call)&lt;/strong&gt;, Indeed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the derivation, have a look at:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1- &lt;a href=&quot;http://www.wilmottwiki.com/wiki/index.php?title=Binary_call_option&quot; rel=&quot;nofollow&quot;&gt;Greeks Binary Call&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2 -&lt;a href=&quot;https://en.wikipedia.org/wiki/Greeks_(finance)&quot; rel=&quot;nofollow&quot;&gt;European Option Greek&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;****Ps: Thus, the answer speaks from itself (&lt;em&gt;cateris paribus&lt;/em&gt;)****&lt;/p&gt;&#xA;" OwnerUserId="18252" LastActivityDate="2015-12-04T07:04:42.917" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22099" PostTypeId="1" CreationDate="2015-12-04T07:14:22.263" Score="2" ViewCount="346" Body="&lt;p&gt;In general, as the option moves towards expiry, its vega is decreasing. Are there circumstances where the veta, i.e. the sensitivity of vega with respect to time, is positive, that is when vega is higher closer to maturity?&lt;/p&gt;&#xA;" OwnerUserId="8028" LastEditorUserId="3371" LastEditDate="2015-12-04T16:24:06.253" LastActivityDate="2015-12-04T16:37:01.043" Title="Under what circumstances Veta is positive?" Tags="&lt;options&gt;&lt;greeks&gt;&lt;vega&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22100" PostTypeId="2" ParentId="22092" CreationDate="2015-12-04T09:44:34.893" Score="13" Body="&lt;p&gt;Yes it is a better way. &#xA;Just take a look to figure 3, from Buss and Vilkov (2012, RFS):&#xA;&lt;a href=&quot;https://i.stack.imgur.com/B05JO.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/B05JO.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-12-04T09:44:34.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22101" PostTypeId="2" ParentId="22096" CreationDate="2015-12-04T13:57:23.473" Score="4" Body="&lt;p&gt;For a digital option with payoff $1_{S_T &amp;gt; K}$, note that, for $\varepsilon &amp;gt; 0$ sufficiently small,&#xA;\begin{align}&#xA;1_{S_T &amp;gt; K} &amp;amp;\approx \frac{(S_T-(K-\varepsilon))^+ - (S_T-K)^+}{-\varepsilon}.\tag{1}&#xA;\end{align}&#xA;That is,&#xA;The value of the digital option&#xA;\begin{align*}&#xA;D(S_0, T, K, \sigma) &amp;amp;= -\frac{d C(S_0, T, K, \sigma)}{d K},&#xA;\end{align*}&#xA;where $C(S_0, T, K, \sigma)$ is the call option price with payoff $(S_T-K)^+$. Here, we use $d$ rather than $\partial$ to emphasize the full derivative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we ignore the skew or smile, that is, the volatility $\sigma$ does not depend on the strike $K$, then&#xA;\begin{align*}&#xA;D(S_0, T, K, \sigma) &amp;amp;= -\frac{d C(S_0, T, K, \sigma)}{d K}\\&#xA;&amp;amp;= N(d_2)\\&#xA;&amp;amp;= N\big(d_1-\sigma \sqrt{T}\big). \tag{2}&#xA;\end{align*}&#xA;That is, the digital option price has the same shape as the corresponding call option delta $N(d_1)$. Similarly, the digital option delta $\frac{\partial N(d_1-\sigma \sqrt{T})}{\partial S_0}$ has the same shape as the call option gamma $\frac{\partial N(d_1)}{\partial S_0}$. Here, we note that they have the same shape, but &lt;strong&gt;they are not the same&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if we take the volatility skew into consideration, the above conclusion does not hold. Specifically, &#xA;\begin{align*}&#xA;D(S_0, T, K, \sigma) &amp;amp;= -\frac{d C(S_0, T, K, \sigma)}{d K}\\&#xA;&amp;amp;= -\frac{\partial C(S_0, T, K, \sigma)}{\partial K} - \frac{\partial C(S_0, T, K, \sigma)}{\partial \sigma} \frac{\partial \sigma}{\partial K}\\&#xA;&amp;amp;= N(d_2) - \frac{\partial C(S_0, T, K, \sigma)}{\partial \sigma} \frac{\partial \sigma}{\partial K},\tag{3}&#xA;\end{align*}&#xA;which may not have the same shape as $N(d_2)=N(d_1-\sigma \sqrt{T})$. In this case, we prefer to value the digital option using the call-spread approximation given by (1) above instead of the analytical formula (2) or (3).&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-12-04T14:27:45.887" LastActivityDate="2015-12-04T14:27:45.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22102" PostTypeId="2" ParentId="22068" CreationDate="2015-12-04T14:05:21.457" Score="2" Body="&lt;p&gt;The skewness and kurtosis values you obtain appear to be of realistic magnitude.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general higher frequencies are more non-normal, i.e. have higher skewness and kurtosis. If non-normal returns are aggregated the central limit theorem starts working and the return distribution coverges to a normal. Convergence can be quite slow under fat tails. &#xA;You can try yearly returns, skewness will be closer to 0 and kurtosis closer to 3.&#xA;If you form portfolios of stocks with skewed returns, skewness and kurtosis will diversify away to some extent. Co-skewness and co-kurtosis, similar to covariance, are relevant in this case. There is quite a lot of academic literature on the asset pricing implications of skewness and co-skewness, most notably &lt;a href=&quot;https://faculty.fuqua.duke.edu/~charvey/Research/Published_Papers/P56_Conditional_skewness_in.pdf&quot; rel=&quot;nofollow&quot;&gt;Harvey and Siddique (2000)&lt;/a&gt;. Portfolio selection under skewness is explored, for example, by &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1474212&quot; rel=&quot;nofollow&quot;&gt;De Miguel et.al (2012)&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9283" LastEditorUserId="9283" LastEditDate="2015-12-05T18:53:02.723" LastActivityDate="2015-12-05T18:53:02.723" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22104" PostTypeId="2" ParentId="22096" CreationDate="2015-12-04T15:27:48.367" Score="1" Body="&lt;p&gt;You can look at the relationship between vanilla and digital options in a model free setting: Let $C$ be the vanilla call, $D$ be the digital call, $E[]$ the expectation under the $T$-forward measure, and assume that the maturity $T$ discount factor is 1 to keep things simple. Then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray*}&#xA;C&amp;amp;=&amp;amp; E[(S_T - K)^+] \\&#xA;D &amp;amp;=&amp;amp; E[1_{S_T &amp;gt; K}] \\&#xA;\frac{\partial C}{\partial S_0} &amp;amp;=&amp;amp;  E[\frac{\partial S_T}{\partial S_0} 1_{S_T &amp;gt; K}] \\&#xA;\frac{\partial^2 C}{\partial S_0^2} &amp;amp;=&amp;amp;  E[\frac{\partial^2 S_T}{\partial S_0^2} 1_{S_T &amp;gt; K}] &#xA;+  E[(\frac{\partial S_T}{\partial S_0})^2 \delta_{S_T = K}] \\&#xA;\frac{\partial D}{\partial S_0} &amp;amp;=&amp;amp;  E[\frac{\partial S_T}{\partial S_0} \delta_{S_T = K}] \\&#xA;\end{eqnarray*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Further, under the $T$-forward measure you have $S_T = S_0 M_T$ where $M_t$ is a martingale with value 1 at origin. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if you assume that $M_T$ does not depend on $S_0$, such as in the Black &amp;amp; Scholes model, or any homogeneous model, you get &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray*}&#xA;\frac{\partial C}{\partial S_0} &amp;amp;=&amp;amp;  E[M_T 1_{S_T &amp;gt; K}] \\&#xA;\frac{\partial^2 C}{\partial S_0^2} &amp;amp;=&amp;amp;  E[M_T^2 \delta_{S_T = K}] \\&#xA;\frac{\partial D}{\partial S_0} &amp;amp;=&amp;amp;  E[M_T \delta_{S_T = K}] \\&#xA;\end{eqnarray*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $M_T$ can be used as a Radon-Nikodym derivative, you see that $D$ and $\frac{\partial C}{\partial S_0}$ are expectations of the same quantity under different measures, hence they have the same shape but are not equal, and likewise for $\frac{\partial D}{\partial S_0}$ and $\frac{\partial^2 C}{\partial S_0^2}$. &lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2015-12-04T15:27:48.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22105" PostTypeId="2" ParentId="22099" CreationDate="2015-12-04T16:37:01.043" Score="-2" Body="&lt;p&gt;This question is somewhat vague - for example, vega could increase despite decay because the strike is closer to underlying (spot or forward) now. On top of that,  if you look at a binary option, you do have cases where underlying hugs the strike, then you have some pretty funny vega profile. For the same strike and same underlying price, because the total variance to maturity decreases with time, vega at that point actually increases pretty close to expiry.&lt;/p&gt;&#xA;" OwnerUserId="17552" LastActivityDate="2015-12-04T16:37:01.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22106" PostTypeId="1" AcceptedAnswerId="24760" CreationDate="2015-12-04T18:36:01.547" Score="2" ViewCount="444" Body="&lt;p&gt;I am looking to compare the returns of a sector rotation strategy between the various &lt;code&gt;SPDR&lt;/code&gt; sector ETFs&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;XLY,&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;XLP,&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;XLE,&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;XLF,&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;XLV,&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;XLI,&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;XLB,&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;XLK,&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;XLU&lt;/p&gt;&#xA;&lt;p&gt;vs. the returns of just investing in the SPY overall S&amp;amp;P 500 ETF.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;I am using the price data of the 9 ETFs vs. the price data of the SPY ETFs and would like to normalize based on a fixed notional. The sector ETF prices are between 24.75-81.11. The SPY ETF sits at around 200.&lt;/p&gt;&#xA;&lt;p&gt;How do I best compare their returns?&lt;/p&gt;&#xA;&lt;p&gt;Ways I've heard of are:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;a'(i) := [ a(i) - mean( a ) ] / std_dev( a )&#xA;a'(i) := [ a(i) - min( a ) ] / [ max ( a ) - min ( a ) ]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;I also see a number of suggestions at: &lt;a href=&quot;https://quant.stackexchange.com/questions/9192/how-to-normalize-stock-data&quot;&gt;How to normalize stock data&lt;/a&gt; but am not sure which one would be most appropriate for this purpose.&lt;/p&gt;&#xA;&lt;p&gt;I suppose moving averages can also be used. I'm working with 5 years of daily close price data.&lt;/p&gt;&#xA;" OwnerUserId="18544" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-03-08T15:56:29.757" Title="Normalizing SPY ETF time series data with its sector ETFs?" Tags="&lt;time-series&gt;&lt;equities&gt;&lt;price&gt;&lt;normalization&gt;&lt;time-scale&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22107" PostTypeId="2" ParentId="10146" CreationDate="2015-12-04T20:26:15.430" Score="0" Body="&lt;p&gt;Free? I'm still looking myself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Paid? Equifax, Moody's, S&amp;amp;P.&lt;/p&gt;&#xA;" OwnerUserId="6437" LastActivityDate="2015-12-04T20:26:15.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22108" PostTypeId="1" CreationDate="2015-12-04T20:59:57.093" Score="9" ViewCount="2122" Body="&lt;p&gt;While looking up on quants, I came across many sources that cited 'pricing quants' as one of the biggest chunks among all quant positions. But then I also came across many software companies providing tools that they claim can price even exotic derivatives with exotic underlying.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Are there really such ready made modeling tools or at least a library of such tools that can be easily put together even by a trader?&lt;/li&gt;&#xA;&lt;li&gt;If yes, what exactly is (or will be) the role of pricing quants, with advanced training in stochastic calculus etc? &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;PS: There may be some overlap with the question &lt;a href=&quot;https://quant.stackexchange.com/questions/12782/does-pricing-quant-still-have-bright-future&quot;&gt;Does pricing quant still have bright future?&lt;/a&gt; but that comes from an unrelated view point that exotic derivatives are shrinking, although the only answer there did mention 'software vendors' as one of the futures.&lt;/p&gt;&#xA;" OwnerUserId="13798" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2015-12-07T22:23:03.693" Title="Present and future role of pricing quants" Tags="&lt;derivatives&gt;&lt;software&gt;&lt;career&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22109" PostTypeId="2" ParentId="22108" CreationDate="2015-12-05T06:52:43.980" Score="1" Body="&lt;p&gt;I do not know about name of specific software that is being used by trader but you must have heard about &lt;strong&gt;Algorithm Trading&lt;/strong&gt;. It involve use of advance techniques to identify trend and price differences in the securities through automated computer software. No human being is involved in execution of such trade. It rely entirely on use of software rather than human wisdom. Such software are expensive and beyond the reach of common investors but very common among big investment houses. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, comes to your second question about role of &lt;strong&gt;Pricing Quants&lt;/strong&gt; in future. Would computer eliminate the Qunats Experts in future? Answer is absolutely &lt;strong&gt;NO&lt;/strong&gt;. Software are static but the market and the products traded in the market are dynamic. You always need some Quants Experts to price new evolving products, to understand and model the behavior of investors(which now has become important part of investment strategy) and for managing risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Software are not entire solution to the problem. At the end you still need Quant Expert to code these algorithm in the software. &lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2015-12-05T06:52:43.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22110" PostTypeId="2" ParentId="22108" CreationDate="2015-12-05T08:35:36.070" Score="5" Body="&lt;p&gt;There is absolutely bright future being a pricing quant, so don't make it a reason for you not doing a degree in financial engineering.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Being able to buy a relative cheap (still not that cheap, eg: Numerix charges like a million...) solution for quantitative pricing doesn't mean you don't need a quant. This is like saying we don't need a bus driver because we can simply start off the engine and let it go. Pricing quants &lt;strong&gt;are needed&lt;/strong&gt; to use those softwares, someone must be able to interpret the outputs. A pure software engineer wouldn't be able to interpret a volatility surface generated by a software. This is like we need a bus driver who understands how to control a bus. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I know, most of the quants spent most of the time on model validation and make sure they work comply with functional specification. They wouldn't spend all their time on stochastic calculus, they would learn and interact with other stakeholders in the business. There is indeed not much opportunity for pricing new derivatives. But we'd still need them for any quantitative task. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nowadays, most of the actual pricing code is done by external software vendors. But you'd still need a quant to be able to talk to the vendor!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used to work in a quantitative pricing vendor firm. It wasn't as advanced as you might have thought. We spent most of our pricing efforts in copying formulas from &quot;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0071389970&quot; rel=&quot;nofollow&quot;&gt;The Complete Guide To Option Formulas&lt;/a&gt;&quot;. We actually spent most of our time on consultation, not actual pricing.&lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="601" LastEditDate="2015-12-07T22:23:03.693" LastActivityDate="2015-12-07T22:23:03.693" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22111" PostTypeId="1" CreationDate="2015-12-05T09:06:49.410" Score="0" ViewCount="94" Body="&lt;p&gt;I want to calculate by-myself 5 year return &amp;amp; STD for SPY ETF.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What I did:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Downloaded to Excel from yahoo finance historical data for the ETF (daily Adj. Close) from &lt;code&gt;1/1/start_year to 1/1/start_year+5&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;(A) Calculated for each year in Excel &lt;code&gt;STDEV.P&lt;/code&gt; based on daily closed prices. (B) Calculated for each year return by &lt;code&gt;end_year_price/start_year_price&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;(A) Simple Arithmetic &lt;code&gt;Average&lt;/code&gt; for the STD based on yearly STD's I have from above. (B) &lt;code&gt;Geomean&lt;/code&gt; for the return based on yearly returns I have from above (compound average).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; The numbers far away from the figures we can find in Morningstar, yahoo finance etc. (Assume I work correct from the perspective of using numbers, percentages, +/-1, *100 etc...)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; This is a Math exercise not a real world finance one. Does from pure mathematical point of view I have mistakes? Which means that the deviations from the figures published in yahoo finance can be explained with taxes, dividends etc. real economic world. OR: I have mathematical mistakes and this is not the way how to compute this figures (in such case - I would like to know how what are the mistakes).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;" OwnerUserId="18094" LastActivityDate="2015-12-05T14:29:38.223" Title="How to calculate 5 years return &amp; STD for ETF?" Tags="&lt;statistics&gt;&lt;returns&gt;&lt;mathematics&gt;&lt;etf&gt;&lt;standard-deviation&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22112" PostTypeId="2" ParentId="22108" CreationDate="2015-12-05T10:09:54.007" Score="10" Body="&lt;p&gt;FO is shrinking across the large investment banks. The market is not developing new products that will need new pricing formulas, if anything it is reverting to more vanilla structures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nowdays FO quants typically hack existing models around the corners to manage new market conditions (change Sabr a bit to deal with negative rates, refine the treatment of Fed meeting dates, deal with many curves, etc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also there are new regulatory requirements that affect the FO and engage FO quants. In addition the FO needs to provide tools/functionality for traders and desk risk managers to manage regulation. Things like better P&amp;amp;L attribution for FRTB, better treatment of shocks used for stress testing and stressed VaR, better alignment of sources for BCBS239, initial margins, 'what if'/ capital impacts, and more. This is again dev/db work but not pricing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;FO quants are expensive, and good ones are hard to find. Therefore banks would not easily fire them in large numbers, however they can stop hiring new talent and recycle existing headcount. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fresh quants are hired in Risk to my knowledge. Actually, in many banks the FO has attempted to take over risk functionality. But this does not require pricing knowledge (actually the FO frame of mind might make things worse). For Risk you need good grasp of time series/ econometrics, statistics, economics, and a decent all-round understanding of FO models and market structure. You also need to be a good communicator. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quants are also hired in hedge funds. Again this does not require pricing, but stats, machine learning, basic finance and databases. Unless you work at a very particular place. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is obviously my personal experience (I am heading a team of quants in London). You can see that others here have a different perspective.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2015-12-05T11:41:45.057" LastActivityDate="2015-12-05T11:41:45.057" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22113" PostTypeId="1" CreationDate="2015-12-05T12:20:19.533" Score="0" ViewCount="207" Body="&lt;p&gt;We have 2 underlying $S^{1}$ and $S^{2}$ with BS dynamic under the risk-neutral measure (r constant...)&#xA;I found the (big) PDE satisfied by the price function $u(t,x,y)$ of a call spread whose payoff is $(S_{T}^{1}-S_{T}^{2}-K)_{+}]$&#xA;Then I have deduced the number of shares of $S^{1}$ and $S^{1}$ and the amount of cash to hedge this option (to hold $du/dx$ shares $S^{1}$ ...)&#xA;My question is: how to hedge this spread option with only a call written on $S^{1}$, a call written on $S^{2}$ and cash ?&lt;/p&gt;&#xA;" OwnerUserId="15738" LastActivityDate="2015-12-05T12:20:19.533" Title="hedging of a spread option with call" Tags="&lt;options&gt;&lt;pricing&gt;&lt;hedging&gt;&lt;spread-options&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22114" PostTypeId="1" AcceptedAnswerId="22497" CreationDate="2015-12-05T12:47:34.313" Score="0" ViewCount="58" Body="&lt;p&gt;I am doing some &lt;strong&gt;Maximum Likelihood Estimation&lt;/strong&gt; with a density that has &lt;strong&gt;time-varying parameters&lt;/strong&gt;. I am using the &lt;code&gt;fmincon&lt;/code&gt; function in &lt;strong&gt;Matlab&lt;/strong&gt;, but I do not know how to impose restrictions on a vector of parameters. To be clear, I have a vector of parameters (that do not change over time) and I know how to impose restrictions on them. However I want to make two parameters time-varying and I do not know how to impose restrictions on vectors containing those time-varying parameters. Summing up, I have a vector of a few time-invariant parameters and two vectors of time-varying parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found a paper that suggests using &lt;strong&gt;logistic mapping&lt;/strong&gt; of the form $ \Theta_{t, restricted} = L + \frac{(U-L)}{1+exp(-\Theta_t)}$ where $\Theta_t = (x_1, x_2)$ and U and L are the upper and lower bounds respectively, for the restricted parameter. $x_1, x_2$ are the time-varying parameters on which I want to impose restrictions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would be grateful for any help regarding implementing this logistic mapping into my optimization problem.&lt;/p&gt;&#xA;" OwnerUserId="17464" LastActivityDate="2016-01-27T08:21:28.327" Title="Imposing MLE restrictions by logistic mapping" Tags="&lt;optimization&gt;&lt;matlab&gt;&lt;estimation&gt;&lt;parameter-estimation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22115" PostTypeId="2" ParentId="22111" CreationDate="2015-12-05T14:29:38.223" Score="1" Body="&lt;p&gt;I believe a few things need to be said here. First, returns are usually calculated (END_VALUE-BEGIN_VALUE)/BEGIN_VALE. There are other ways, but this is what is usually used, and much arguments can be had on what &quot;value&quot; actual is. &#xA;Second, data frequency should be aligned so daily standard deviation should be aligned to daily expected returns.&#xA;Third, the periods for the measures should be aligned so that a 5 year return is matched by a 5 year standard deviation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now that should get you on the right track. However, since in these three decisions alone much discretion has to be applied it is expected that your calculations do not match what you see on a web site, unless you are able to infer their choice.&lt;/p&gt;&#xA;" OwnerUserId="7186" LastActivityDate="2015-12-05T14:29:38.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22117" PostTypeId="1" AcceptedAnswerId="22345" CreationDate="2015-12-05T17:10:49.583" Score="3" ViewCount="160" Body="&lt;p&gt;Given random variables $Y_1, Y_2, ... \stackrel{iid}{\sim} P(Y_i = 1) = p = 1 - q = 1 - P(Y_i = -1)$ where $p &amp;gt; q$ in a filtered probability space $(\Omega, \mathscr F, \{\mathscr F_n\}_{n \in \mathbb N}, \mathbb P)$ where $\mathscr F_n = \mathscr F_n^Y$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;define $X = (X_n)_{n \ge 0}$ where $X_0 = 0$ and $X_n = \sum_{i=1}^{n} Y_i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can be shown that the stochastic process $M = (M_n)_{n \ge 0}$ where $M_n = X_n - n(p-q)$ is a $(\{\mathscr F_n\}_{n \in \mathbb N}, \mathbb P)$-martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $b$ be a positive integer and $T:= \inf\{n: X_n = b\}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can be shown that $T$ is a $\{\mathscr F_n\}_{n \in \mathbb N}$-stopping time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Prove that $E[T] &amp;lt; \infty$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One proposition to use is '&lt;a href=&quot;https://books.google.com.hk/books?id=e9saZ0YSi-AC&amp;amp;pg=PA233&amp;amp;lpg=PA233&amp;amp;dq=%22what%20always%20stands%22%20%22probability%22&amp;amp;source=bl&amp;amp;ots=AWEio5s6Xq&amp;amp;sig=6kAyfQZorHRSFhYEVjQ83V7XGU4&amp;amp;hl=en&amp;amp;sa=X&amp;amp;ved=0ahUKEwje6t-I0MTJAhUleaYKHUa7AfIQ6AEIGjAA#v=onepage&amp;amp;q=%22what%20always%20stands%22%20%22probability%22&amp;amp;f=false&quot; rel=&quot;nofollow noreferrer&quot;&gt;What always stands a reasonable chance of happening will (almost surely) happen - sooner rather than later&lt;/a&gt;' or &lt;a href=&quot;https://math.stackexchange.com/a/1468800/140308&quot;&gt;here&lt;/a&gt; (proof &lt;a href=&quot;http://www.statslab.cam.ac.uk/~ps422/Solution_1_Vittoria.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So let us show either that $\exists N \in \mathbb N, \epsilon &amp;gt; 0$ s.t. $\forall n \in \mathbb N$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P(T \le n + N | \mathscr F_n) &amp;gt; \epsilon$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or the weaker condition that $\exists N \in \mathbb N, \epsilon &amp;gt; 0$ s.t. $\forall n \in \mathbb N$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P(T &amp;gt; kN) \le (1 - \epsilon)^k$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I tried the first one:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P(T \le \infty | \mathscr F_n) = E(1_{T \le \infty} | \mathscr F_n) = \sum_{i=1}^{n} 1_{T=i} + \sum_{i=n+1}^{\infty} E[1_{T=i} | \mathscr F_n]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, we must find and integer N and a positive number $\epsilon$ s.t.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P(T \le n + N | \mathscr F_n) = E(1_{T \le n + N} | \mathscr F_n) = \sum_{i=1}^{n} 1_{T=i} + \sum_{i=n+1}^{n+N} E[1_{T=i} | \mathscr F_n] &amp;gt; \epsilon$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\forall i &amp;gt; n$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E[1_{T=i} | \mathscr F_n] = P(T=i | \mathscr F_n)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$= P(X_i = b, X_1 \ne b, X_2 \ne b, ..., X_n \ne b, ..., X_{i-1} \ne b | \mathscr F_n)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$= \prod_{j=1}^{n} 1_{X_j \ne b} E[1_{X_i = b} \prod_{j=n+1}^{i-1} 1_{X_j \ne b} | \mathscr F_n]$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;That's all I got. How can I approach this problem?&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2015-12-15T20:19:15.300" Title="Asymmetric Random Walk / Prove that $E[T:= \inf\{n: X_n = b\}] &lt; \infty$" Tags="&lt;stochastic-processes&gt;&lt;probability&gt;&lt;martingale&gt;&lt;random-walk&gt;&lt;stopping&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22119" PostTypeId="2" ParentId="22068" CreationDate="2015-12-05T20:09:52.153" Score="1" Body="&lt;p&gt;The only thing weird is skewness not being lower for the weekly vs daily. &#xA;In any case, take a look at table 1.1 from Campbell, Lo and Mackinlay, and check that your values are not far off the ballpark. Actually, with annual data, you should have nearly zero skewness and zero excess kurtosis (on the market). &#xA;However, asset allocation might lead to severe skewness and kurtosis even at low frequencies. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/gYuHs.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/gYuHs.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-12-05T20:09:52.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22120" PostTypeId="1" CreationDate="2015-12-05T22:37:55.593" Score="2" ViewCount="372" Body="&lt;p&gt;I am trying to understand Quantlib's finite-difference pricer using Eclipse with GDB debugger.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code shown below prices an American put option using the Crank-Nicholson finite-difference scheme.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;I inserted a breakpoint on the line &lt;code&gt;americanOption.NPV();&lt;/code&gt; and&#xA;attempted to step inside the associated function call, but found&#xA;that the debugger simply steps over to the next line. Why is that?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I was eventually able to catch a breakpoint in &lt;code&gt;void&#xA;TridiagonalOperator::solveFor(const Array&amp;amp; rhs, Array&amp;amp; result)&#xA;const&lt;/code&gt; located in &lt;code&gt;tridiagonaloperator.cpp&lt;/code&gt;. When I investigate the&#xA;call stack, however, I get an incomprehensible list of function&#xA;calls (screenshot: &lt;a href=&quot;https://www.dropbox.com/s/bid7gae87zzx7tv/Screenshot%202015-12-05%2017.33.48.png?dl=0&quot; rel=&quot;nofollow&quot;&gt;https://www.dropbox.com/s/bid7gae87zzx7tv/Screenshot%202015-12-05%2017.33.48.png?dl=0&lt;/a&gt;). How can I interpret this?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Can anyone suggest any strategies to more efficiently debug Quantlib?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#include &amp;lt;ql/quantlib.hpp&amp;gt;&#xA;using namespace QuantLib;&#xA;&#xA;int main()&#xA;{&#xA;    Calendar calendar = UnitedStates();&#xA;    DayCounter dayCounter = Business252();&#xA;    Date t(1, Jan, 2014);&#xA;    Settings::instance().evaluationDate() = t;&#xA;    Date T(31, Dec, 2016);&#xA;    Option::Type type(Option::Put);&#xA;    Real S0 = 100;&#xA;    Real K = 100;&#xA;    Real delta = 0.00;&#xA;    Real r = 0.01;&#xA;    Real sigma = 0.2;&#xA;&#xA;    Handle&amp;lt;Quote&amp;gt; underlying(&#xA;            boost::shared_ptr&amp;lt;Quote&amp;gt;(boost::make_shared&amp;lt;SimpleQuote&amp;gt;(S0)));&#xA;    Handle&amp;lt;YieldTermStructure&amp;gt; TS(&#xA;            boost::shared_ptr&amp;lt;YieldTermStructure&amp;gt;(boost::make_shared&amp;lt;FlatForward&amp;gt;(t, r, dayCounter)));&#xA;    Handle&amp;lt;YieldTermStructure&amp;gt; dividendTS(&#xA;            boost::shared_ptr&amp;lt;YieldTermStructure&amp;gt;(boost::make_shared&amp;lt;FlatForward&amp;gt;(t, delta, dayCounter)));&#xA;    Handle&amp;lt;BlackVolTermStructure&amp;gt; volTS(&#xA;            boost::shared_ptr&amp;lt;BlackVolTermStructure&amp;gt;(boost::make_shared&amp;lt;BlackConstantVol&amp;gt;(t, calendar, sigma, dayCounter)));&#xA;    boost::shared_ptr&amp;lt;BlackScholesMertonProcess&amp;gt; bsmProcess(&#xA;            boost::make_shared&amp;lt;BlackScholesMertonProcess&amp;gt;(underlying, dividendTS,TS, volTS));&#xA;    boost::shared_ptr&amp;lt;Exercise&amp;gt; americanExercise(&#xA;            boost::make_shared&amp;lt;AmericanExercise&amp;gt;(T));&#xA;    boost::shared_ptr&amp;lt;StrikedTypePayoff&amp;gt; payoff(&#xA;            boost::make_shared&amp;lt;PlainVanillaPayoff&amp;gt;(type, K));&#xA;    VanillaOption americanOption(payoff, americanExercise);&#xA;    int timeSteps = 100;&#xA;    int gridPoints = 100;&#xA;    boost::shared_ptr&amp;lt;PricingEngine&amp;gt; engineFD(&#xA;            boost::make_shared&amp;lt;FDAmericanEngine&amp;lt;CrankNicolson&amp;gt;&amp;gt;(bsmProcess, timeSteps,gridPoints));&#xA;    americanOption.setPricingEngine(engineFD);&#xA;    americanOption.NPV();&#xA;    std::cout &amp;lt;&amp;lt; &quot;PV = &quot; &amp;lt;&amp;lt; americanOption.NPV() &amp;lt;&amp;lt; std::endl;    &#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="15782" LastActivityDate="2015-12-06T22:27:56.597" Title="Debugging Quantlib" Tags="&lt;quantlib&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22122" PostTypeId="2" ParentId="21982" CreationDate="2015-12-06T02:39:21.363" Score="2" Body="&lt;p&gt;When you plot a martingale you might see some random movements up and down, but no overall tendency to increase (or decrease) over time, in other words no clear upward or downward trend. On the other hand a strong increase over time (such as a graph of world population over the last century) is a sign of a submartingale and a tendency to go down a supermartingale. Of course the visual impression is not enough, these are abstract properties that have to be investigated mathematically. HTH&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-12-06T02:39:21.363" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22123" PostTypeId="1" CreationDate="2015-12-06T09:58:24.127" Score="4" ViewCount="15968" Body="&lt;p&gt;I'm working on an assignment in which I need to calculate excess returns for six stocks plus the S&amp;amp;P 500. I have computed &lt;strong&gt;daily&lt;/strong&gt; logarithmic returns for every stock and for the market, I now need to calculate the risk free interest rate in order to be able to compute the excess return for every stock and the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The interest rate on three months T-Bills is a good proxy for the risk-free rate of return, but I have a lot of doubts on how to use data provided by Yahoo! Finance in order to compute the &lt;strong&gt;daily&lt;/strong&gt; risk-free. Here are my assumptions and procedures:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I use the 13 weeks treasury bill (ticker: ^IRX) historical quotes provided by Yahoo! Finance;&lt;/li&gt;&#xA;&lt;li&gt;Under the assumption that on Yahoo! Finance bond yields are quoted as Effective Annual Rate (EAR), the daily risk-free interest rate at time &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt; (&lt;span class=&quot;math-container&quot;&gt;$r_{f,t}^{daily}$&lt;/span&gt;) is computed as:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$r_{f,t}^{daily}=(1+r_t)^{1/365}-1$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;span class=&quot;math-container&quot;&gt;$r_t$&lt;/span&gt; is the EAR rate at time &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt; provided by Yahoo.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once computations are done, the excess return of stock &lt;span class=&quot;math-container&quot;&gt;$i$&lt;/span&gt; at time &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt; is defined as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\text{Excess Return}=r_{i,t}-r_{f,t}^{daily}$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Questions&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Is this procedure correct? Note that I do not need it to be exceptionally precise, it is just a basic exercise, but I would like it to be at least conceptually correct.&lt;/li&gt;&#xA;&lt;li&gt;The Federal Reserve also provides &lt;a href=&quot;https://research.stlouisfed.org/fred2/series/DTB3&quot; rel=&quot;nofollow noreferrer&quot;&gt;data for three months T-Bills&lt;/a&gt;. Are these rates also provided as EAR?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="13439" LastEditorUserId="13439" LastEditDate="2019-08-14T23:07:44.587" LastActivityDate="2019-08-14T23:07:44.587" Title="How to calculate daily risk free interest rates" Tags="&lt;equities&gt;&lt;interest-rates&gt;&lt;analysis&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="22124" PostTypeId="2" ParentId="22123" CreationDate="2015-12-06T10:36:18.793" Score="3" Body="&lt;p&gt;Just use the what most finance research papers use, i.e. the risk-free rate from the Kenneth French data library. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html&quot; rel=&quot;nofollow&quot;&gt;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rates are annual. So if you want log returns just take the log of $1+r^f_t$ and divide by 365.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-12-06T10:36:18.793" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22125" PostTypeId="1" CreationDate="2015-12-06T11:45:58.747" Score="10" ViewCount="1342" Body="&lt;p&gt;Since Hedge Funds/Fund of Funds report on a monthly basis usually within 10 days after the month end, monitoring and managing (hedging) potential risks is quite a difficult task. Having done some research, there seems to be some solutions to this problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's just say that there is a FoF, under which there are around 50 HFs with different strategies. Managing risk can be done on a FoF level as well as on each HF level. The latter is more tedious but offers better understanding (as in if a particular HF is a Long/Short Equity fund, its obvious that they are exposed to equity risk).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus far I have looked at HFRI Equity Hedge Index and regressed it against Fama-French factors. The result is not perfect (24 months rolling regression), but is alright. However, this exact approach is not yielding anything meaningful for Credit, Multi-strat, Fixed Income funds (maybe I am not using correct factors). I will probably keep trying for a while.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two more options - PCA and Factor Analysis. So I thought maybe there is somebody who have taken a look at this problem and is willing to share his/her experience. Any input is appreciated.&lt;/p&gt;&#xA;" OwnerUserId="18563" LastEditorUserId="743" LastEditDate="2016-03-10T21:00:01.653" LastActivityDate="2019-04-26T20:02:31.430" Title="Hedge Fund risk management on a daily basis" Tags="&lt;risk-management&gt;&lt;regression&gt;&lt;factor-models&gt;&lt;pca&gt;&lt;hedge-fund&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="22127" PostTypeId="1" AcceptedAnswerId="22129" CreationDate="2015-12-06T15:54:18.743" Score="2" ViewCount="71" Body="&lt;p&gt;Given random variables $Y_1, Y_2, ... \stackrel{iid}{\sim} P(Y_i = 1) = p = 1 - q = 1 - P(Y_i = -1)$ where $p &amp;gt; q$ in a filtered probability space $(\Omega, \mathscr F, \{\mathscr F_n\}_{n \in \mathbb N}, \mathbb P)$ where $\mathscr F_n = \mathscr F_n^Y$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;define $X = (X_n)_{n \ge 0}$ where $X_0 = 0$ and $X_n = \sum_{i=1}^{n} Y_i$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $b$ be a positive integer and $T:= \inf\{n: X_n = b\}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can be shown that the stochastic process $M = (M_n)_{n \ge 0}$ where $M_n = X_n - n(p-q)$ is a $(\{\mathscr F_n\}_{n \in \mathbb N}, \mathbb P)$-martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Prove that $T$ is a $\{\mathscr F_n\}_{n \in \mathbb N}$-stopping time.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;What I tried based on my previous &lt;a href=&quot;https://math.stackexchange.com/questions/1560115/symmetric-random-walk-prove-s-inf-n-x-n-7-and-t-1012-wedge&quot;&gt;question&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Case 1: b is odd&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\emptyset = \{T = 0\} = \{T = 1\} = ... = \{T = b-1\} = \{T = b+1\} = ... = \{T = 2n\} = ... \in \mathscr F_0 \subseteq \mathscr  F_i \ (i = 0, 1, ..., b-1, b+1, ..., 2n, ...)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\{T = b\} = \{Y_1 = ... = Y_b = 1 \} \in \mathscr F_b$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\{T = b+2\} = \{Y_1 + ... = Y_{b+2} = b \} \setminus \{T = b\} \in \mathscr F_{b+2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\vdots$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\{T = 2n+1\} = \{Y_1 + ... = Y_{2n+1} = b \} \setminus (\{T = b\} \cup \{T = b+1\} \cup \{T = 2n - 1\})\in \mathscr F_{2n+1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Case 2: b is even&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\emptyset = \{T = 0\} = \{T = 1\} = ... = \{T = b-1\} = \{T = b+1\} = ... = \{T = 2n+1\} = ... \in \mathscr F_0 \subseteq \mathscr  F_i \ (i = 0, 1, ..., b-1, b+1, ..., 2n+1, ...)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\{T = b\} = \{Y_1 = ... = Y_b = 1 \} \in \mathscr F_b$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\{T = b+2\} = \{Y_1 + ... = Y_{b+2} = b \} \setminus \{T = b\} \in \mathscr F_{b+2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\vdots$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\{T = 2n\} = \{Y_1 + ... = Y_{2n} = b \} \setminus (\{T = b\} \cup \{T = b+1\} \cup \{T = 2n - 2\})\in \mathscr F_{2n}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;QED&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is that right?&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2015-12-07T11:19:21.303" Title="Asymmetric Random Walk / Prove that $T:= \inf\{n: X_n = b\}$ is a $\{\mathscr F_n\}_{n \in \mathbb N}$-stopping time" Tags="&lt;stochastic-processes&gt;&lt;probability&gt;&lt;martingale&gt;&lt;random-walk&gt;&lt;stopping&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22128" PostTypeId="1" AcceptedAnswerId="22149" CreationDate="2015-12-06T17:54:57.610" Score="2" ViewCount="80" Body="&lt;p&gt;If $X_t$ is an Ito process, such that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dX_t = \mu(t, X_t)dt + \sigma(t, Xt)dW_t$ where $W_t$ is a standard brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then we can say that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E(dX_t) = \mu(t, X_t)dt$ and that $Var(dX_t) = \sigma^2(t, Xt)dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this equivalent to saying that (I removed the differential operator): &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E(X_t) = \mu(t, X_t)\times t$ and that $Var(X_t) = \sigma^2(t, Xt)\times t$&lt;/p&gt;&#xA;" OwnerUserId="15650" LastEditorUserId="15650" LastEditDate="2015-12-08T18:16:31.810" LastActivityDate="2015-12-08T18:16:31.810" Title="Can the differential operator be removed to get the mean/variance of an Ito process?" Tags="&lt;stochastic-processes&gt;&lt;brownian-motion&gt;&lt;mean-variance&gt;&lt;wienerprocess&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22129" PostTypeId="2" ParentId="22127" CreationDate="2015-12-06T18:02:58.063" Score="2" Body="&lt;p&gt;For positive integer $n$,&#xA;\begin{align*}&#xA;\{T=n\} &amp;amp;= \Big(\cap_{k=1}^{n-1} \{X_k \ne b\}\Big) \cap \{X_n = b\} \in \mathscr{F}_n.&#xA;\end{align*}&#xA;That is, $T$ is a stopping time.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-12-06T18:02:58.063" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="22130" PostTypeId="1" AcceptedAnswerId="22131" CreationDate="2015-12-06T18:58:03.303" Score="0" ViewCount="157" Body="&lt;p&gt;Please help me with this problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ZE6oi.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZE6oi.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18567" LastEditorUserId="467" LastEditDate="2015-12-16T01:24:13.970" LastActivityDate="2015-12-16T14:39:52.307" Title="How to prove $\int_0^t W_s^2dWs = \frac{1}{3}W_s^3 - \int_0^t W_s ds$ using Ito's formula?" Tags="&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2015-12-07T16:23:35.270" ContentLicense="CC BY-SA 3.0" />
  <row Id="22131" PostTypeId="2" ParentId="22130" CreationDate="2015-12-06T19:15:01.013" Score="6" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;As @SRKX suggested, full answers are provided below.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;(a). Using Ito's lemma&#xA;\begin{align*}&#xA;d\left(W_t^3\right) &amp;amp;= 3W_t^2 dW_t +3W_t dt.&#xA;\end{align*}&#xA;Integrating on both sides, we obtain that&#xA;\begin{align*}&#xA;W_t^3 = 3\int_0^t W_s^2 dW_s +3\int_0^t W_s ds.&#xA;\end{align*}&#xA;Consequently,&#xA;\begin{align*}&#xA;\int_0^t W_s^2 dW_s = \frac{1}{3}W_t^3 -\int_0^t W_s ds.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(b). Note that &#xA;\begin{align*}&#xA;df(t, W_t) = \frac{\partial f}{\partial t} dt + \frac{\partial f}{\partial W_t} dW_t + \frac{1}{2}\frac{\partial^2 f}{\partial W_t^2} dt.&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;dX_t &amp;amp;=-\frac{1}{(t+W_t)^2}dt -\frac{1}{(t+W_t)^2}dW_t +\frac{1}{(t+W_t)^3}dt\\&#xA;&amp;amp;=(-X_t^2+X_t^3)dt -X_t^2 dW_t.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-12-16T14:39:52.307" LastActivityDate="2015-12-16T14:39:52.307" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22133" PostTypeId="1" CreationDate="2015-12-06T19:47:26.153" Score="1" ViewCount="125" Body="&lt;p&gt;Can anbody explain how Copulas are used to describe the dependency between, for example, the return on two different stocks?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand how Copulas are the &quot;glue&quot; that binds the two marginals together, from Sklar's theorem:&#xA;$F(x,y) = C(G_{x}(x),G_{y}(y))$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where X and Y are iid distributed. But in time series data X and Y are not iid. One has volatility change, dependence on yesterdays return etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does one overcome this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I understand it has got something to do with modelling the residuals, correct? I'm looking for an idea, here.&lt;/p&gt;&#xA;" OwnerUserId="18569" LastEditorUserId="18569" LastEditDate="2015-12-06T20:02:00.713" LastActivityDate="2015-12-06T20:02:00.713" Title="copulas and time series" Tags="&lt;time-series&gt;&lt;copula&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22135" PostTypeId="1" AcceptedAnswerId="22299" CreationDate="2015-12-06T22:25:40.473" Score="9" ViewCount="1077" Body="&lt;p&gt;For a pure equity process (with interest rate, dividend, etc., being zero) not necessarily the geometric Brownian motion, is the delta of a European call option always no higher than $1$? I am NOT asking for the Black-Scholes delta, but a model free general property of the European call delta. We can consider this question with and without the martingale property that the expected underlying price should be the current price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have also formulated this question a more formal fashion &lt;a href=&quot;https://math.stackexchange.com/q/1563154/64809&quot;&gt;here&lt;/a&gt; as a calculus of variation or linear programming problem.&lt;/p&gt;&#xA;" OwnerUserId="6686" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2018-11-21T21:17:46.407" Title="European Call Option Delta Upper Bound" Tags="&lt;options&gt;&lt;delta&gt;" AnswerCount="4" CommentCount="7" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22136" PostTypeId="2" ParentId="22120" CreationDate="2015-12-06T22:27:56.597" Score="1" Body="&lt;p&gt;Without a lot more information, it's difficult to say. Some explanations include (but are not limited to):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;debugging symbols are not present; your system might be missing the &lt;code&gt;libquant-dbg&lt;/code&gt; (or similar) package. If you compile your own libquant, enable debugging symbols by adding &lt;code&gt;-g&lt;/code&gt; to your &lt;code&gt;CFLAGS&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Eclipse is not configured correctly; this is a rather large rabbit hole, but if you're absolutely sure that debugging symbols are present, then you might be forced to troubleshoot the IDE. Sometimes an IDE will need to be told explicitly where to find headers and libraries.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Try compiling &lt;code&gt;quantlib&lt;/code&gt; from source with &lt;code&gt;CFLAGS=-g&lt;/code&gt; and directly invoke &lt;code&gt;gdb&lt;/code&gt; on one of the &lt;a href=&quot;https://github.com/lballabio/quantlib/tree/master/QuantLib/Examples&quot; rel=&quot;nofollow&quot;&gt;example executables&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="18570" LastActivityDate="2015-12-06T22:27:56.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22137" PostTypeId="2" ParentId="21877" CreationDate="2015-12-06T23:02:39.760" Score="1" Body="&lt;p&gt;I agree with Malick in the sense that an ARMA-GARCH is a better model but I would improve the model by doing a ARFIMA-FIGARCH, the FI stands for Fractional Integrated that are used to deal for long memory processes like HF data. When trying to fit the ARMA the normal approach would be to see the ACF and the PACF which will show a lot of dependency (almost all lags would be significant) and the same with the GARCH model, so a common way to deal with is with FI models. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, don't discard the logistic regression. Sure you are going to have some problems with the Volatility clusters, but information is useful. I would suggest that instead a 1,0 model try to perform an order Probit or Logit so you can have a probability for the magnitude of the increase, (it is a great complement to the ARFIMA-FIGARH model). In this model the dependent variable is going to be an integer form 1 to 5 lets say and each number represents an interval of increase or decrease in the price. Lets say 1 if the price is going to be down between 0 and 5, 2 if the price is going up between 0 to 5 and so on. &lt;/p&gt;&#xA;" OwnerUserId="18443" LastActivityDate="2015-12-06T23:02:39.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22138" PostTypeId="2" ParentId="21519" CreationDate="2015-12-06T23:05:54.840" Score="1" Body="&lt;p&gt;I don't think that it is posible to fit a BEKK in Stata, i'm not sure if you are familiar with R but with the package &lt;code&gt;MTS&lt;/code&gt; you can fit a BEKK(1,1), it takes some time to run, i would suggest that you consider a CC-GARCH wich can be estimated in Stata and in R with &lt;code&gt;ccgarch&lt;/code&gt; or a DCC that is also posible in both programs &lt;/p&gt;&#xA;" OwnerUserId="18443" LastActivityDate="2015-12-06T23:05:54.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22139" PostTypeId="1" CreationDate="2015-12-06T23:11:30.947" Score="1" ViewCount="68" Body="&lt;p&gt;Suppose that the average one year implied at-the-money volatility of the sub sector indices making up the BCOM is at 20% and that the sub sectors are uncorrelated. Bearing in mind the effect of correlation in tail risk scenarios, would you expect the one-year at-the-money volatility of the BCOM to be higher or lower than the average of the sub sector volatilities (20%)?&lt;/p&gt;&#xA;" OwnerUserId="18572" LastActivityDate="2015-12-06T23:11:30.947" Title="commodities index volatility" Tags="&lt;implied-volatility&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22140" PostTypeId="2" ParentId="22117" CreationDate="2015-12-07T00:15:41.450" Score="1" Body="&lt;p&gt;Let $b=1$, $p=1/3$, $q=2/3$. It is &lt;a href=&quot;https://math.stackexchange.com/questions/153123/biased-random-walk-on-line&quot;&gt;not hard to show&lt;/a&gt; that in this case $T$ is finite with probability exactly $1/2$. Consequently, $E[T] = \infty$ and your claim does not hold in general. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The claim would hold if $p\geq q$ (in which case you could, for example, address it by first showing that it holds for $b=1$ and proceeding inductively from there on).&lt;/p&gt;&#xA;" OwnerUserId="18464" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2015-12-07T00:15:41.450" CommentCount="18" ContentLicense="CC BY-SA 3.0" />
  <row Id="22141" PostTypeId="1" CreationDate="2015-12-07T01:20:35.040" Score="0" ViewCount="251" Body="&lt;p&gt;By using the Fama and MacBeth methodology, I have identified the significant factors that explain the returns of my stocks. &#xA;Now, I want to build a portfolio and backtest it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For that, I am trying to use the Mean(factor loadings) and the respective betas. However, to calculate the expected return, should I take only the SIGNIFICANT factors or ALL THE FACTORS? &#xA;P.S. : I only have one significant factor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance,&#xA;Vaibhav&lt;/p&gt;&#xA;" OwnerUserId="18533" LastActivityDate="2016-01-06T04:13:03.720" Title="Factor model to Portfolio optimization" Tags="&lt;factor-models&gt;&lt;factor-loading&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22143" PostTypeId="2" ParentId="22141" CreationDate="2015-12-07T03:14:26.360" Score="1" Body="&lt;p&gt;Statistically speaking you should not include the factor that aren't significant. Economically speaking you should take all the factors because intuitively they explain the returns of the assets, and if you don't do it will  incur in specification bias by omit the factors and will cause the the estimates aren't efficient, unbiased and consistent&lt;/p&gt;&#xA;" OwnerUserId="18443" LastActivityDate="2015-12-07T03:14:26.360" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22145" PostTypeId="2" ParentId="21935" CreationDate="2015-12-07T05:00:46.283" Score="1" Body="&lt;p&gt;Before prediction you should see which models fit better your data. First before choosing a GARCH model or a GARCH type model with leverage efect you shoud perform the Engle-Ng sign bias test to see if the asset that your are modelling is affected by it, if yes a simple GARCH model won't be a good model. After the estimation and given that all parameters are significant compere the information criteria; for example the Akaike, Bayes or Hannan-Quinn and see which model has the smallest one. With this you should select the model and then perform a prediction, and you can evaluate the performance of it with a back test. I have personally done this and usually an APARCH with generalize hyperbolic distribution is the best if the data present leverage erect. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sure this is what I did with &lt;code&gt;r&lt;/code&gt; and the package &lt;code&gt;rugarch&lt;/code&gt; for the stock of EXITO a Colombian company:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) fit a GARCH(1,1): &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;garch11Spec=ugarchspec(variance.model = list(model='sGARCH',garchOrder=c(1,1)),mean.model=list(armaOrder=c(0,0)))&#xA;garch11Fit=ugarchfit(garch11Spec,rtn) ## rtn is the date which is daily last price&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;2) Engle-Ng sign bias for leverage effect:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;signbias(garch11Fit) &#xA; t-value               prob      sig&#xA;Sign Bias          0.19343098 0.8466364    &#xA;Negative Sign Bias 0.15413313 0.8775166    &#xA;Positive Sign Bias 0.02615509 0.9791356    &#xA;Joint Effect       0.06291070 0.9958816 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;see that all p-values are higher than 0.1 son you don't reject the null hypothesis so there is no leverage effect &lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Look at the coefficients (the robust version) and there p-value, you will expect that all of theme to be statistically significant &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;garch11Fit@fit$robust.matcoef&#xA;       Estimate   Std. Error     t value     Pr(&amp;gt;|t|)&#xA;mu     3.735730e-05 1.237313e-04   0.3019229 7.627109e-01&#xA;omega  1.238605e-05 5.156212e-08 240.2160962 0.000000e+00&#xA;alpha1 2.517465e-01 5.271207e-02   4.7758795 1.789235e-06&#xA;beta1  5.822453e-01 3.733553e-02  15.5949369 0.000000e+00&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;4) Information criteria:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;infocriteria(garch11Fit)&#xA;Akaike       -6.941621&#xA;Bayes        -6.932700&#xA;Shibata      -6.941626&#xA;Hannan-Quinn -6.938391&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;you want the smallest value possible&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are the 4 steps together for the aparch:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;signbias(aparchFit)&#xA;                      t-value      prob sig&#xA;Sign Bias          0.17982812 0.8573014    &#xA;Negative Sign Bias 0.05186043 0.9586438    &#xA;Positive Sign Bias 0.57709943 0.5639217    &#xA;Joint Effect       0.35736070 0.9489028 &#xA;&#xA;aparchFit@fit$robust.matcoef&#xA;           Estimate   Std. Error   t value     Pr(&amp;gt;|t|)&#xA;mu     0.0000186132 0.0001385818 0.1343120 8.931558e-01&#xA;omega  0.0019649457 0.0004959927 3.9616428 7.443584e-05&#xA;alpha1 0.2521930795 0.0433561290 5.8167804 5.999189e-09&#xA;beta1  0.5734338681 0.0809929461 7.0800470 1.441069e-12&#xA;**gamma1 0.0482664316 0.0886992553 0.5441583 5.863326e-01**&#xA;delta  1.0000000000           NA        NA           NA&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;you can see, gamma1 which is the leverage effect parameter is not significant, p-value = 0.58 as expected, so not a good model &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;infocriteria(aparchFit)&#xA;&#xA;Akaike       -6.942806&#xA;Bayes        -6.931655&#xA;Shibata      -6.942813&#xA;Hannan-Quinn -6.938769&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;if you compera the criteria with the GARCH(1,1) you can se that the Bayes and the Hannan-Quinn  are smaller in the first model, the other 2 smaller for the aparch but YOU KNOW that the aparch isn't the right model because there is NO leverage effect, can't just trust the information criteria you have to understand the models to select one. With this stock is easy because it has no leverage effect so you have to stick with a GARCH(1,1) if you get leverage effect should perform this with the different model that you want to use to find the best. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If after doing this with the differnt models you don't have a clear winner do a back test on the prediction and compere the RMSE, MSE or MAE and also do a VaR backtest as the other comment says&lt;/p&gt;&#xA;" OwnerUserId="18443" LastEditorUserId="18443" LastEditDate="2015-12-07T19:36:49.120" LastActivityDate="2015-12-07T19:36:49.120" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22146" PostTypeId="2" ParentId="18687" CreationDate="2015-12-07T05:10:19.453" Score="0" Body="&lt;p&gt;The &lt;code&gt;MTS&lt;/code&gt; package has the fucntion to fit a &lt;code&gt;BEKK(1,1)&lt;/code&gt; but i would recommend that you use a &lt;code&gt;dcc-garch&lt;/code&gt; which has less problems that the BEKK approach an it is faster to run &lt;/p&gt;&#xA;" OwnerUserId="18443" LastActivityDate="2015-12-07T05:10:19.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22147" PostTypeId="1" CreationDate="2015-12-07T05:14:19.190" Score="3" ViewCount="226" Body="&lt;p&gt;So i have been searching for this answer for a question if there is a rule or something that would say when to use  GARCH type model or use an stochastic volatility model to predict the volatility of an asset. I know the main difference between this models which is that the first one models the volatility like and autoregresive processes and the second does it with an stochastic processes but i don't know when should I use a GARCH or when do I use a SV. &lt;/p&gt;&#xA;" OwnerUserId="18443" LastEditorUserId="18443" LastEditDate="2016-10-10T03:09:28.803" LastActivityDate="2016-10-10T03:09:28.803" Title="When to use SV or a GARCH model" Tags="&lt;volatility&gt;&lt;time-series&gt;&lt;garch&gt;&lt;stochastic-volatility&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22149" PostTypeId="2" ParentId="22128" CreationDate="2015-12-07T07:26:37.267" Score="4" Body="&lt;p&gt;This is wrong! Notice that $dX_t=\mu(t,X_t)dt + \sigma(t,X_t)dW$ is a shorthand for &#xA;$$\int_0^tdX_s = \int_0^t \mu(s,X_s)ds + \int_0^t\sigma(s,X_s)dW_s$$ &#xA;Integrating:&#xA;$$X_t-X_0 = \int_0^t \mu(s,X_s)ds + \int_0^t\sigma(s,X_s)dW_s    \text{  (eq.1)} $$ &#xA;If we take expectations, remembering that $\mathbb{E}[\int_0^t\sigma(s,X_s)dW_s]=0$, we have&#xA;$$\mathbb{E}[X_t]=X_0 + \int_0^t \mu(s,X_s)ds$$&#xA;To have your result, we need $X_0=0$ and constant drift $\mu(t,X_t)=\mu$. You compute the second moment of (eq.1) to check what happens to the variance&lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2015-12-07T07:26:37.267" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22150" PostTypeId="1" CreationDate="2015-12-07T08:59:06.450" Score="13" ViewCount="623" Body="&lt;p&gt;I am working with the stochastic volatility model with jumps in both the price and volatility dynamics, ie. the risk neutral dynamics are of the form:&#xA;$$\mathrm{d}V_t = \kappa(\theta - V_t)\mathrm{d}t + \sigma \sqrt{V_t} \mathrm{d}B_t^v + J^v \mathrm{d} N_t&#xA;\\&#xA;\mathrm{d}S_t = (r_t-d_t-\lambda m^j)S_t\mathrm{d}t + \sqrt{V_t} S\mathrm{d}B_t^s + (e^{J^s}-1)S_t \mathrm{d}N_t,$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\text{Corr}(B_t^v,B_t^s) = \rho$, and the jump distributions are $J^v\sim \exp(\mu_v)$ and $J^s \sim \mathcal{N}(\mu_s,\sigma^2)$. I have calibrated the model to a data set with European Call and Put options on SPX, and now I want to derive at a closed form expression of the expected value of the annualized realized variance, that is $\mathbb{E}[1/T \int_0^Tv_t \mathrm{d}t]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first thought was simply that it is equal to the calibrated value of $V_0$ but this is based on a martingale assumption of the integral which I am not sure is correct. How would I compute the expectation if it is not a martingale? If it indeed is a martingale, how would I prove it?&lt;/p&gt;&#xA;" OwnerUserId="18576" LastEditorDisplayName="user16651" LastEditDate="2016-11-21T17:57:22.923" LastActivityDate="2020-06-07T20:38:35.857" Title="Realized variance in SVJJ (Heston with jumps) model" Tags="&lt;stochastic-volatility&gt;&lt;martingale&gt;&lt;variance&gt;&lt;heston&gt;&lt;jump&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22152" PostTypeId="1" AcceptedAnswerId="22157" CreationDate="2015-12-07T09:56:03.937" Score="2" ViewCount="258" Body="&lt;p&gt;I want to show that following statement is true by using Ito's lemma to solve stochastic integrals:&lt;a href=&quot;https://i.stack.imgur.com/yPftE.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/yPftE.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I define the functions in Ito's model: a(&lt;em&gt;)=0, b(&lt;/em&gt;)= (2wt-2)^2. f(t)=Integrate[(2wt-2)^2]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then df=(b^2/2)&lt;em&gt;(d^2/dwt^2)+(b&lt;/em&gt;df/dst). But it doesn’t add up. How do I show it by using Ito's lemma?&lt;/p&gt;&#xA;" OwnerUserId="18555" LastActivityDate="2015-12-08T13:41:34.820" Title="Brownian motion. Solve stoc. integral by using Ito's lemma" Tags="&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22153" PostTypeId="1" AcceptedAnswerId="22161" CreationDate="2015-12-07T10:07:17.950" Score="4" ViewCount="1461" Body="&lt;p&gt;I have to price several calls using Monte Carlo. Obviously, there is a huge tradeoff between the number of runs and the fair price of the call option. &#xA;I know I can check how the approximation changes has I decrease the number of simulations, but I was wondering whether there is a ballpark value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the moment I am running 1000 simulations. But perhaps 500 is enough? &lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2016-05-04T14:15:11.200" Title="How many monte carlo runs do I need for pricing a Call?" Tags="&lt;monte-carlo&gt;&lt;call&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22155" PostTypeId="2" ParentId="17655" CreationDate="2015-12-07T13:16:20.753" Score="2" Body="&lt;p&gt;Do these work for you?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P34 of &lt;a href=&quot;http://web.mit.edu/junpan/www/SVJ.pdf&quot; rel=&quot;nofollow&quot;&gt;http://web.mit.edu/junpan/www/SVJ.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P1360 of &lt;a href=&quot;http://www.darrellduffie.com/uploads/pubs/DuffiePanSingleton2000.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.darrellduffie.com/uploads/pubs/DuffiePanSingleton2000.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P2045 of &lt;a href=&quot;http://www.math.ku.dk/~rolf/bakshi.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.math.ku.dk/~rolf/bakshi.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2015-12-07T13:16:20.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22156" PostTypeId="2" ParentId="22153" CreationDate="2015-12-07T13:21:24.907" Score="2" Body="&lt;p&gt;This will depend on the nature of the problem. You already mention a perfectly good strategy - observe your current estimate after N samples - did it change significantly? If you have a grasp of the scale of the answer to the problem then you may be able to set a convergence criteria on the basis of this change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However let's say you have a far out of the money option, then to get good coverage of the area you are interested in (a small part of the total space) you will need a lot of samples. In such a tail-case you should exercise caution even if the estimate appears to settle down quickly. Sometimes a problem can benefit from sampling using a Quasi-random sequence that more &quot;evenly&quot; samples the available space (&lt;a href=&quot;https://quant.stackexchange.com/questions/18697/how-to-use-halton-sequence-in-monte-carlo-simulation?rq=1&quot;&gt;here is a related question&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might be able to get away with 500, but some problems might require 1,000,000.&lt;/p&gt;&#xA;" OwnerUserId="12020" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2015-12-07T13:21:24.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22157" PostTypeId="2" ParentId="22152" CreationDate="2015-12-07T14:01:51.330" Score="2" Body="&lt;p&gt;Try Ito's formula for $(2W_t+1)^3$, and then integrate. More specifically, note that&#xA;\begin{align*}&#xA;d\left( (2W_t+1)^3 \right) &amp;amp;= 6(2W_t+1)^2 dW_t + 12 (2W_t+1) dt,&#xA;\end{align*}&#xA;then&#xA;\begin{align*}&#xA;(2W_T+1)^3 - 1 = \int_0^T 6(2W_t+1)^2 dW_t + 12 \int_0^T (2W_t+1) dt.&#xA;\end{align*}&#xA;The remaining is obvious.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-12-08T13:41:34.820" LastActivityDate="2015-12-08T13:41:34.820" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22158" PostTypeId="1" CreationDate="2015-12-07T14:24:38.973" Score="1" ViewCount="55" Body="&lt;p&gt;First, I should state that I built a Java program that uses HTTP Components to keep in sync with server time for my broker.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once &lt;code&gt;7:29:59&lt;/code&gt; comes around the program begins sending requests to the &lt;code&gt;bureau of labor statistics v2 API&lt;/code&gt; so that when the data for non farm payrolls gets published I can immediately hedge and adjust my portfolio before to significant of a move in the market occurs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However last Friday it took over twenty minutes of return no value before the data was finally updated and my orders where filled. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wanted to know if there are any alternative sources I can receive immediate data from?&lt;/p&gt;&#xA;" OwnerUserId="18578" LastEditorUserId="743" LastEditDate="2015-12-07T18:12:10.457" LastActivityDate="2015-12-07T18:12:10.457" Title="BLS v2 API took 20+ minutes to publish data where is immediate data available?" Tags="&lt;data&gt;&lt;programming&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22159" PostTypeId="1" CreationDate="2015-12-07T14:27:07.310" Score="1" ViewCount="249" Body="&lt;p&gt;My current understanding:&#xA;(a) changing the probability measure of a diffusion process does not change the variance.&#xA;(b) for a general stochastic process the variance may change.&#xA;Please confirm whether this is correct.&#xA;Secondly, for (a) why isn't it important that there may be covariance between the asset being diffused and the value of the numeraire? (or the ratio of numeraires)?&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2015-12-07T14:27:07.310" Title="Effect on variance of change of measure" Tags="&lt;risk-neutral-measure&gt;&lt;numerairechange&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22160" PostTypeId="2" ParentId="21998" CreationDate="2015-12-07T14:38:56.547" Score="0" Body="&lt;p&gt;&lt;strong&gt;Interesting question&lt;/strong&gt;, and let's briefly start with a conventional definition of &lt;em&gt;Total Return Swap&lt;/em&gt; (assuming the &lt;strong&gt;reference asset&lt;/strong&gt; is a &lt;strong&gt;stock index&lt;/strong&gt;). As a matter of fact a &lt;em&gt;TRS&lt;/em&gt; is an agreement to exchange the total return (&lt;em&gt;dividends + capital gains&lt;/em&gt;) realized on a stock index for either a &lt;em&gt;fixed&lt;/em&gt; or a &lt;em&gt;floating rate of interest&lt;/em&gt; (e.g &lt;em&gt;LIBOR, LIBBOR + spread (in basis points)&lt;/em&gt;) as very-well summarized in your picture. &#xA;Both exchange of cash flows between the &lt;em&gt;Fixed-leg Payer&lt;/em&gt; and the &lt;em&gt;Floating-leg Payer&lt;/em&gt; being applied on the swap notional amount.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;*For concreteness purposes, it's worth adding an additional stakeholder (&lt;em&gt;Broker&lt;/em&gt;), thus the parties in a TRS generally involve:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1- &lt;strong&gt;Hedge Fund_1&lt;/strong&gt; (as requested)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2- &lt;strong&gt;Hedge Fund_2&lt;/strong&gt; (idem)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3- &lt;strong&gt;Prime Broker&lt;/strong&gt; , holding the reference asset (e.g &lt;em&gt;proprietary index&lt;/em&gt;, etc.) and also generally acting as a &lt;strong&gt;Counterparty&lt;/strong&gt; of the trade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;**In an attempt to avoid any &lt;em&gt;Informational Asymmetry&lt;/em&gt;, &lt;em&gt;Moral Hazard&lt;/em&gt;, etc., the &lt;em&gt;Broker&lt;/em&gt; (e.g &lt;em&gt;Custodian Bank&lt;/em&gt;) is performing the computations (compute &lt;em&gt;Index levels&lt;/em&gt;, &lt;em&gt;Returns&lt;/em&gt;, at &lt;code&gt;time t&lt;/code&gt;, mostly for proprietary indexes) and disclose it (on its website or on request) for &lt;em&gt;transparency purposes&lt;/em&gt; while valuing the swap (&lt;em&gt;Mark-To-Market&lt;/em&gt;) in accordance with the terms of the contract/agreement stipulated in the &lt;em&gt;Swap Term Sheet&lt;/em&gt;. For instance it could be stated in the &lt;em&gt;Term Sheet&lt;/em&gt; that &lt;code&gt;Hedge Fund_1&lt;/code&gt; pays &lt;em&gt;15 basis points&lt;/em&gt; or &lt;em&gt;LIBOR + 10 bp&lt;/em&gt; to &lt;code&gt;Hedge Fund_2&lt;/code&gt; if: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;Index level is &amp;gt; a defined threshlod&lt;/code&gt; (yesetrday's value),&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise receive from &lt;code&gt;Hedge Fund_2&lt;/code&gt; the return at &lt;code&gt;t&lt;/code&gt; on the index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The latter document could be obtained on request from the &lt;code&gt;Counterparty&lt;/code&gt; of the trade, if neither &lt;code&gt;Hedge Fund_1&lt;/code&gt; nor &lt;code&gt;Hedge Fund_2&lt;/code&gt; has their own copy internally. It's worth stating that these agreements have &lt;em&gt;legal&lt;/em&gt; implications, thus are generally signed by all the parties. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ps: &lt;em&gt;Mark-to-Mark value&lt;/em&gt; of the swap is also disclosed in the &lt;em&gt;Net Asset Value (NAV)&lt;/em&gt; file sent frequently by the &lt;em&gt;Fund Administrator&lt;/em&gt; to the Hedge Fund Managers (&lt;code&gt;Hedge Fund_1&lt;/code&gt; or &lt;code&gt;Hedge Fund_2&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;**In the case of &lt;em&gt;Credit Derivatives&lt;/em&gt;, the &lt;em&gt;Reference Asset&lt;/em&gt; is usually &lt;code&gt;iTraxx&lt;/code&gt;, but the above logic applies as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope it helps&lt;/p&gt;&#xA;" OwnerUserId="18252" LastEditorUserId="18252" LastEditDate="2015-12-07T19:02:56.417" LastActivityDate="2015-12-07T19:02:56.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22161" PostTypeId="2" ParentId="22153" CreationDate="2015-12-07T14:47:51.510" Score="6" Body="&lt;p&gt;It really, really, really depends on your parameters, i.e. $r$, $\sigma$, $K$, $T$, $S_0$.  For example, here are some results from implementing the stopping criteria I explain in my answer &lt;a href=&quot;https://quant.stackexchange.com/questions/21764/stopping-monte-carlo-simulation-once-certain-convergence-level-is-reached/21769#21769&quot;&gt;here&lt;/a&gt;.  These are the number of iterations requires in order for there to be an approximate 0.95 probability that the MC call price differs from the exact call price by less than 0.01 (one penny, e.g.):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r = 0.02$, $\sigma = 0.2$, $K = 10$, $T = 1$, $S_0 = 10$: 72,382 iterations&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r = 0.02$, $\sigma = 0.2$, $K = 10$, $T = 10$, $S_0 = 10$: 1,391,379 iterations&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r = 0.02$, $\sigma = 0.5$, $K = 10$, $T = 1$, $S_0 = 10$: 625,365 iterations&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's my MATLAB implementation of the stopping criteria, if you'd like try for yourself:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%%% Estimates the price of a European call option using MC.&#xA;% Continues MC estimation until we reach a 0.05 probability that&#xA;% MC call price differs by more than &quot;tol&quot; units from exact &#xA;% call price.&#xA;&#xA;function C = CallPricePointEstimate()&#xA;%%% BS parameters  - Try varying these to see how number of iters (n)&#xA;% changes %%%&#xA;K = 10;&#xA;S = 10;&#xA;r = 0.02;&#xA;T = 1;&#xA;sigma = 0.5;&#xA;&#xA;%%% MC parameters %%%&#xA;% number of stock prices to generate, may need more, which are&#xA;% generated in the MC loop below if idx &amp;gt; N_MC&#xA;N_MC = 1000000;&#xA;tol = 0.01;  % price within $tol&#xA;bound = 5;  % something larger than tol&#xA;n = 1;  % current iteration number&#xA;&#xA;%%% generate normal RVs and price paths %%%&#xA;Z = normrnd((r-sigma^2/2)*T, sigma*sqrt(T), N_MC, 1);&#xA;ST = S*exp(Z);&#xA;&#xA;%%% init MC accumulators %%%&#xA;sampleMean = 0;&#xA;sampleVar = 0;&#xA;oldMean = 0;&#xA;&#xA;idx = 1;  % will reset to 1 if idx &amp;gt; N_MC&#xA;%%% MC loop %%%&#xA;while ((bound &amp;gt; tol) || (n &amp;lt; 30))&#xA;    % if idx &amp;gt; N_MC, need to generate more normals&#xA;    if (idx &amp;gt; N_MC)&#xA;        Z = normrnd((r-sigma^2/2)*T, sigma*sqrt(T), N_MC, 1);&#xA;        ST = S*exp(Z);&#xA;        idx = 1;&#xA;    end&#xA;    payoff = exp(-r*T)*max((ST(idx) - K),0);&#xA;&#xA;    % update mean and var&#xA;    sampleMean = oldMean + (payoff - oldMean)/n;&#xA;    if (n&amp;gt;1)&#xA;        sampleVar = (1-(1/(n-1)))*sampleVar + n*(sampleMean - oldMean)^2;&#xA;    end&#xA;    oldMean = sampleMean;&#xA;&#xA;    bound = 1.96*sqrt(sampleVar/n);  %%% updated this line %%%&#xA;    n = n+1;&#xA;    idx = idx+1;&#xA;end&#xA;&#xA;%%% Display num samples, statistics and vfy bound = tol %%%&#xA;n&#xA;sampleMean;&#xA;sampleVar;&#xA;bound;&#xA;&#xA;C = sampleMean;  % call price&#xA;&#xA;%%% exact BS price using BS formula %%%&#xA;d1 = 1/(sigma*sqrt(T)) * (log(S/K) + (r + sigma^2/2)*T);&#xA;d2 = d1 - sigma*sqrt(T);&#xA;exact = S*normcdf(d1) - K*exp(-r*T)*normcdf(d2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; I realized an error in my code: where &lt;code&gt;bound&lt;/code&gt; updated, &lt;code&gt;sampleVar/sqrt(n)&lt;/code&gt; should be &lt;code&gt;sqrt(sampleVar/n)&lt;/code&gt;.  This results in faster convergence for given parameters.  The number of iterations required has been updated.&lt;/p&gt;&#xA;" OwnerUserId="6866" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-05-04T14:15:11.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22162" PostTypeId="2" ParentId="16595" CreationDate="2015-12-07T15:33:50.540" Score="1" Body="&lt;p&gt;The first thing that occurs to me is that Party B controls the exercise of both Option 2 and Option 1, so it is equivalent to Party B owning 2* the notional of Option 2.  Have I misunderstood something?&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2015-12-07T15:33:50.540" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22163" PostTypeId="2" ParentId="22106" CreationDate="2015-12-07T16:34:40.553" Score="0" Body="&lt;p&gt;Perhaps I don't understand what you mean by &quot;normalizing time series data&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To compare the two strategies, I would simply compute the Sharpe ratio of the two: holding the SPY vs the rotation strategy. This is a &quot;normalized&quot; comparison in that it takes into account both the mean return and the standard deviation of return.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2015-12-07T16:34:40.553" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22164" PostTypeId="1" AcceptedAnswerId="22166" CreationDate="2015-12-07T17:34:23.080" Score="1" ViewCount="292" Body="&lt;p&gt;According to Cost of Capital approach to optimal financing mix we can calculate Cost-of-Capital-minimizing $\frac{D}{E}$ ratio as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{D}{E}_{opt} = argmin_{\frac{D}{E}}WACC$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$WACC = \frac{E}{D+E}r_{e} + \frac{D}{D+E}r_{d}(1-T)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cost of Equity ($r_{e}$) is determined by CAPM model (with given levels of riskfree rate $r_{f}$ and market premium $r_{m}$):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_{e} = r_{f} + \beta_{L}r_{m}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Levered value of $\beta$ is determined by Hamada's equation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\beta_{L} = \beta_{UL}(1+ \frac{D}{E}(1-T))$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cost of Debt ($r_{d}$) is determined using bond rating approach, where each interval of $\frac{D}{D+E}$ (in this case 0%-10%, 10%-20% and so on) is assigned with a certain interest rate on debt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This gives us:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$WACC = \frac{E}{D+E}(r_{f} + \beta_{UL}(1+ \frac{D}{E}(1-T))r_{m}) + \frac{D}{D+E}r_{d}(1-T)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume $\frac{D}{E} = X$&#xA;After all simplifications we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$WACC = \frac{1}{X+1}(r_{f} + \beta_{UL}r_{m}) + \frac{X}{X+1}(1-T)(r_{d} + \beta_{UL}r_{m})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now all we have to do to minimize is $\frac{\text{d}WACC}{\text{d}X} = 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $r_{d}$ is a function of $X$ and we would have to take $\frac{\text{d}r_{d}}{\text{d}X}$, we will instead seach the minimum on each interval (0%-10%, 10%-20% and so on), where $r_{d}$ will be constant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking the derivative:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{\text{d}WACC}{\text{d}X} = \frac{(1-T)(r_{d} + \beta_{UL}r_{m}) - (r_{f} + \beta_{UL}r_{m})}{(X+1)^{2}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming X is nonnegative, the only solution to &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{(1-T)(r_{d} + \beta_{UL}r_{m}) - (r_{f} + \beta_{UL}r_{m})}{(X+1)^{2}} = 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(1-T)(r_{d} + \beta_{UL}r_{m}) - (r_{f} + \beta_{UL}r_{m}) = 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All the variables here are constant and independent of $X$, which gives us no answer about the optimal $\frac{D}{E}$ ratio. Am I missing something here?&lt;/p&gt;&#xA;" OwnerUserId="18195" LastActivityDate="2015-12-07T19:40:58.997" Title="Optimal Financing Mix: Cost of Capital Approach" Tags="&lt;capital-structure&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22165" PostTypeId="2" ParentId="18563" CreationDate="2015-12-07T17:55:58.410" Score="2" Body="&lt;p&gt;You're confusing two different issues - your &quot;pricing&quot; can be accurate to a fraction of a penny, but it does not mean that your hedging (replicating) strategy is. Let's say that options is theoretically worth 0.1  and you sold it for 0.3. You still have not locked in any gain. Market may immediately wise up, and come in agreement with your valuation so you would be able to repurchase your option for 0.1, and lock in your gains, but that is very, very unlikely. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise you would be hedging, that is attempting to replicate option payoff, and mitigate the risk, by dynamically trading in the underlying. But your trading is discrete (let's say twice per day) and in discrete units ( 100 shares ), and underlying may move discontinuously (jump) . That means that your replicating strategy may result in a loss of more or less than 0.2 of theoretical difference you were hoping for. To summarize, your hedging error is not your pricing error. &lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2015-12-07T17:55:58.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22166" PostTypeId="2" ParentId="22164" CreationDate="2015-12-07T18:18:53.767" Score="1" Body="&lt;p&gt;The point is exactly that, $r_d$ depends on $X$, meaning that: $r_d(X)$. So in practice you will have an answer $X=f(r_d)$. Where X is a function of $r_d$. &#xA;Also, if you change your capital structure, given your Hamada's equation, $r_m$ will also be a function of $X$ and therefore in fact your optimal $X$ should be : $X=f(r_d,r_e)$.&#xA;You cannot solve this problem analytically given your assumptions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best way is to use a minimization algorithm (solver in excel should do the trick) where you minimize:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$WACC = \frac{E}{D+E}(r_{f} + \beta_{UL}(1+ \frac{D}{E}(1-T))r_{m}) + \frac{D}{D+E}r_{d}(1-T)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;subject to the constraints:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) $r_{e} = r_{f} + \beta_{L}r_{m}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) $\beta_{L} = \beta_{UL}(1+ \frac{D}{E}(1-T))$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(3) $r_d$ as a function of the buckets you defined&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This should be very straightforward to compute.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="16472" LastEditDate="2015-12-07T19:40:58.997" LastActivityDate="2015-12-07T19:40:58.997" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22167" PostTypeId="2" ParentId="12696" CreationDate="2015-12-07T18:19:59.223" Score="3" Body="&lt;p&gt;Accounting for derivatives varies by jurisdiction and by user type, so let's not get bogged down in that.  Let's focus on the economics:   derivatives are usually legally pari passu with senior debt (have the same seniority in bankruptcy).  However, they may in effect get paid earlier- for example, derivatives are usually subject to a CSA (credit support annex) which causes any mark to market losses to be paid on a daily basis.  Hence if an entity is heading towards bankruptcy, the derivatives liabilities may get paid before the senior debtholders.  In addition, there is new proposed legislation for US banks that would force banks to issue debt that is subject to a &quot;bail-in&quot; provision (this means that debtholders in the event of an insolvency), making this debt specifically junior to derivative liabilities.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2015-12-07T18:19:59.223" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22168" PostTypeId="2" ParentId="21998" CreationDate="2015-12-07T19:15:01.883" Score="2" Body="&lt;p&gt;A TRS is very rarely between Hedge fund 1 and Hedge fund 2 (how would they find each other?).  Much more likely that it is between Hedge Fund 1 and a Dealer.  In the latter case, one of the counterparties must act as Calculation Agent, and it is almost always the Dealer.  The Calculation Agent has the responsibility of marking to market the asset, for the purposes of determining the cashflows that you have described.  Often , the Hedge Fund has &quot;dispute rights&quot; that enable it to challenge the actions of the Calculation Agent.  These Dispute Rights might specify that the Hedge Fund can appeal to a panel of 5 banks to determine the asset value, for example.  The result of this poll would be legally binding.   &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2015-12-07T19:15:01.883" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22169" PostTypeId="2" ParentId="22150" CreationDate="2015-12-07T19:42:18.493" Score="2" Body="&lt;p&gt;Try &#xA;$$\mathbb{E}\frac{1}{T} \int_0^T V_t dt = \frac{1}{T} \int_0^T \mathbb{E} V_t dt$$ and use  $$\frac{1}{dt}\mathbb{E} V_t  = \kappa\theta - \kappa \mathbb{E}V_t + (\lambda_0 + \lambda_1\mathbb{E} V_t)\mu_V, $$&#xA;which is in fact a simple ODE.&lt;/p&gt;&#xA;" OwnerUserId="6640" LastActivityDate="2015-12-07T19:42:18.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22171" PostTypeId="2" ParentId="21441" CreationDate="2015-12-07T20:35:41.897" Score="0" Body="&lt;p&gt;If for VAR-EGARCH you mean a BEKK model the &lt;code&gt;MTS&lt;/code&gt;package in R can implement a BEKK(1,1)&lt;/p&gt;&#xA;" OwnerUserId="18443" LastActivityDate="2015-12-07T20:35:41.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22172" PostTypeId="1" AcceptedAnswerId="22201" CreationDate="2015-12-07T21:46:50.253" Score="2" ViewCount="248" Body="&lt;p&gt;I am very new to R, and particularly to the &lt;code&gt;yuima&lt;/code&gt; package, so I was hoping someone would be able to help me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have some data (daily prices) that I wish to fit to a Carma(2,1) model by estimating the parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose I have&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;d &amp;lt;- read.csv(&quot;http://chart.yahoo.com/table.csv?s=IBM&amp;amp;g=d&amp;amp;x=.csv&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I then thought I should do is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;y &amp;lt;- setYuima(data = setData(d$Close), model = setCarma(2,1))&#xA;x &amp;lt;- qmle(y, start = list(a1 = 1, a2 = 1, b0 = 1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(but with some other parameters).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However when I do this, I get the following error in the first (&lt;code&gt;y &amp;lt;- ...&lt;/code&gt;) line:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error in if (dim(data@original.data)[2] == 1) { : &#xA;  argument is of length zero&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have no idea why this is, and what the &lt;code&gt;setYuima&lt;/code&gt; function expects. Can anyone tell me how to do this?&lt;/p&gt;&#xA;" OwnerUserId="15244" LastActivityDate="2015-12-08T18:19:22.700" Title="Estimating Carma(2,1) parameters (using yuima package)" Tags="&lt;time-series&gt;&lt;r&gt;&lt;arma&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22173" PostTypeId="1" AcceptedAnswerId="22196" CreationDate="2015-12-07T23:54:16.263" Score="3" ViewCount="166" Body="&lt;p&gt;How to compute  $ \mathop{\mathbb{E^{}}}\left\lbrace 1_{S_T &amp;gt; K} \; S_T \right\rbrace $ ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ dS_t = S_t r dt + \sigma dW_t $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ 1_{S_T &amp;gt; K} $ is the indicator function being one when the condition is satisfied.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would try &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \mathop{\mathbb{E^{}}}\left\lbrace 1_{S_T &amp;gt; K} \; S_T \right\rbrace = \int_{S_T &amp;gt; K}^{\infty} n(\varepsilon) S_T d\varepsilon $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ S_T = S_t e^{r(T-t)} + \sigma e^{rT} \int_t^T e^{-rs} dW_s $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but I cannot handle the `expectation-integral' because $S_T$ is a sum --- and of course a lack of knowledge in general. My experience is only with making a GBM into a standard normal .&lt;/p&gt;&#xA;" OwnerUserId="18584" LastEditorUserId="18584" LastEditDate="2015-12-10T14:52:34.443" LastActivityDate="2015-12-10T14:52:34.443" Title="$ \mathop{\mathbb{E^{}}}\left\lbrace 1_{S_T &gt; K} \; S_T \right\rbrace $ ? Exp. of an indicator funct and a diffusion with non-proportional vol" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22176" PostTypeId="1" CreationDate="2015-12-08T02:08:27.457" Score="0" ViewCount="145" Body="&lt;p&gt;Why is the forward rate suitable for being used as the underlying in Black's model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="18587" LastActivityDate="2015-12-08T04:49:44.853" Title="Why is the forward rate used for the underlying in Black's model?" Tags="&lt;models&gt;&lt;forward&gt;&lt;forward-rate&gt;&lt;black&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22178" PostTypeId="1" CreationDate="2015-12-08T02:24:59.470" Score="1" ViewCount="202" Body="&lt;p&gt;If the value of an option at Maturity is &#xA;&lt;a href=&quot;https://i.stack.imgur.com/Y3E08.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Y3E08.png&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;what is the off-setting position you take for X and Y, if you are&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i)Long Call of the option&#xA;ii)Short Call of the option&#xA;iii)Long Put of the option&#xA;iv)Short Put of the option&lt;/p&gt;&#xA;&#xA;&lt;p&gt;when the correlation between X &amp;amp; Y &gt;1, &amp;amp; it's a European option&lt;/p&gt;&#xA;" OwnerUserId="18587" LastActivityDate="2016-04-06T16:32:18.237" Title="Delta Hedging for 2 Factor Models" Tags="&lt;options&gt;&lt;option-strategies&gt;&lt;delta-hedging&gt;&lt;delta&gt;&lt;european-options&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22179" PostTypeId="1" AcceptedAnswerId="22187" CreationDate="2015-12-08T02:32:08.463" Score="4" ViewCount="304" Body="&lt;p&gt;What are the well known methods for forecasting (daily - weekly - monthly) volatility of a stock price? How about a bond price?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say I have in my disposition the price time series at a very high frequency. How should I avoid dealing with the micro structure of the market? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="18589" LastActivityDate="2016-02-07T03:04:50.597" Title="Forecast of volatility" Tags="&lt;volatility&gt;&lt;high-frequency&gt;&lt;garch&gt;&lt;forecast&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22182" PostTypeId="1" CreationDate="2015-12-08T03:17:58.873" Score="1" ViewCount="124" Body="&lt;p&gt;*S follows a process $dS= mSdt + oSdz$ where m and o are constant. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the probability followed by $ Y=(Se)^{(r-t)}  $. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If S follows a process $ dS= k (b-S) dt + oSdz $ where k, b, o are constant. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What’s the process followed by $Y =S^2$ ?&lt;/p&gt;&#xA;" OwnerUserId="18590" LastEditorUserId="16160" LastEditDate="2015-12-10T01:34:59.607" LastActivityDate="2016-02-08T08:47:52.557" Title="Stochastic process theory question" Tags="&lt;r&gt;&lt;risk-management&gt;&lt;stochastic-calculus&gt;&lt;itos-lemma&gt;&lt;wienerprocess&gt;" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22184" PostTypeId="2" ParentId="22182" CreationDate="2015-12-08T04:23:13.697" Score="1" Body="&lt;p&gt;Not sure I fully understand your question. However, I'd suggest using the Ito's lemma (second equation on wikipedia page &lt;a href=&quot;https://en.wikipedia.org/wiki/It%C3%B4%27s_lemma&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/It%C3%B4%27s_lemma&lt;/a&gt;) to solve for dY. In both cases, dY will have both a drift term and a stochastic term. The coefficient of the stochastic term will indicate what sort of probability process Y follows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g., in the first case, you'll get something like dY = [ (m-1)Y ]dt + [ rY ]dW, implying log-normal distribution for Y.&lt;/p&gt;&#xA;" OwnerUserId="17405" LastActivityDate="2015-12-08T04:23:13.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22186" PostTypeId="2" ParentId="22176" CreationDate="2015-12-08T04:49:44.853" Score="3" Body="&lt;p&gt;As a trader I used Black model (amongst others) to value swaptions, where the forward swap rate is the key observable underlying rate.   Any market where the forward is the traded instrument would lend itself to Black.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2015-12-08T04:49:44.853" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22187" PostTypeId="2" ParentId="22179" CreationDate="2015-12-08T05:44:03.043" Score="0" Body="&lt;p&gt;For your first question there a 2 types of models: stochastic volatility and GARCH which need as an imput the return of asset. For HF data this models can be modified, I am not familiar with SV models but GARCH type would be a fractional integraded GARCH (FIGARCH) or a multiplicación componentes GARCH (mcsGARCH). There are some stailized fact od HF data that you have to take into acount like diurnal seasonality and a lot of autocorrelation, there are more that you could search un google or search note un this page bacause there are tons of cuestiona about thia topic &lt;/p&gt;&#xA;" OwnerUserId="18443" LastActivityDate="2015-12-08T05:44:03.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22188" PostTypeId="2" ParentId="22173" CreationDate="2015-12-08T06:06:56.887" Score="1" Body="&lt;p&gt;To solve this, you need to use the property of Radon-Nikodym derivative $(L)$, which states:&lt;br&gt;&#xA;$E[L.X] = E[X]$ under the new measure (where X can be your indicator function).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next, to convert S(t) to RN derivative, do:&lt;br&gt;&#xA;$S(t) = S(0) * exp(rt) * E\left(\frac{S(T)}{exp(rt)S(0)}\right)$&lt;br&gt;&#xA;$S(t) = S(0) * exp(rt) * L$&lt;br&gt;&#xA;as $E\left(\frac{S(T)}{exp(rt)S(0)}\right)$ can be used as a RN derivative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;RN derivative helps you move into the new measure, with expectation of just the indicator function (which is nothing but the probability of S(T) &gt; K). To get this probability you need to find the process of S(t) under this new measure, which can be obtained by replacing $dW$ with $\sigma dt + dW$ (this comes from Girsanov theorem). This will give you the answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Watch this video for a more complete explanation (&lt;a href=&quot;https://www.youtube.com/watch?v=W8YG5O1GGjE&quot; rel=&quot;nofollow&quot;&gt;https://www.youtube.com/watch?v=W8YG5O1GGjE&lt;/a&gt; from 30min mark)&lt;/p&gt;&#xA;" OwnerUserId="17405" LastActivityDate="2015-12-08T06:06:56.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22189" PostTypeId="1" CreationDate="2015-12-08T10:40:07.543" Score="1" ViewCount="598" Body="&lt;p&gt;For example, in the Ornstein-Uhlenbeck process do I just replace the drift term with the risk free rate, like in the GBM case? &lt;/p&gt;&#xA;" OwnerUserId="13477" LastActivityDate="2015-12-08T12:26:34.837" Title="How to change to risk neutral measure in a mean reversion process?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;risk-neutral-measure&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22190" PostTypeId="1" CreationDate="2015-12-08T11:32:51.763" Score="4" ViewCount="10581" Body="&lt;p&gt;The current price of a stock is USD400 per share and it pays no dividends. Assuming a constant interest rate of $8% $ compounded quarterly, what is the stock's theoretical forward price for delivery in $9$ months ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am taking the Financial Engineering and risk management course on Coursera. The above question was in the quiz and I got a wrong answer on it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Shouldn't the answer be: $$400\times\left(1+\frac{0.08}{4}\right)^3 = 424.48\, ?$$&lt;/p&gt;&#xA;" OwnerUserId="18594" LastEditorDisplayName="user16651" LastEditDate="2016-09-23T15:49:03.073" LastActivityDate="2020-03-13T12:59:20.460" Title="Calculate theoretical forward price of a stock" Tags="&lt;forward&gt;" AnswerCount="5" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22191" PostTypeId="2" ParentId="22190" CreationDate="2015-12-08T11:41:33.770" Score="-1" Body="&lt;p&gt;Assuming 8% is the quartely interest rate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think it's: $400*(1+0.08)^3 = 503.8$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$0.08$ is the quarter interest rate and you compound for 3 quarters&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Or&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ r_{year} = (1+0.08)^4 - 1 = 0.36 $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$400*(1+0.36)^(9/12) = 503.8$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because there are 9 months in a 12-month year.&lt;/p&gt;&#xA;" OwnerUserId="7827" LastEditorUserId="18677" LastEditDate="2015-12-16T21:29:17.833" LastActivityDate="2015-12-16T21:29:17.833" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22193" PostTypeId="2" ParentId="22189" CreationDate="2015-12-08T12:26:34.837" Score="2" Body="&lt;p&gt;Risk neutral version of O-U process is apparently a simple GBM.&#xA;See explanation here, &lt;a href=&quot;http://web.mit.edu/wangj/www/pap/LoWang95.pdf&quot; rel=&quot;nofollow&quot;&gt;http://web.mit.edu/wangj/www/pap/LoWang95.pdf&lt;/a&gt;&#xA;specifically section II.&lt;/p&gt;&#xA;" OwnerUserId="3120" LastActivityDate="2015-12-08T12:26:34.837" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22194" PostTypeId="1" CreationDate="2015-12-08T12:50:31.373" Score="3" ViewCount="339" Body="&lt;p&gt;What are the products, concepts, and models a risk manager must know? I'm not looking for an exhaustive list, but rather a general list as the one in &lt;em&gt;Paul &amp;amp; Dominic's Guide To Quant Careers&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Products: Fixed income, bonds, swaps; Equity, dividends, derivatives;&#xA;  Currencies, role of foreign and domestic interest rates; Commodities,&#xA;  convinience yield et.; Exotics, main types; Credit derivatives.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Concepts: Risk, return and efficient frontiers; Delta hedging; Risk&#xA;  neutrality; The no-arbitrage argument; Market price of risk for&#xA;  non-traded quantities; Calibration; Static hedging using&#xA;  exchange-traded vanillas.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Models: Binomial model; Lognormal; Jump diffusion; Stochastic&#xA;  volatility; Interest rate model (single, multi-factor, HJM, BGM);&#xA;  Credit models (hazard rate, structural); Transition matrices;&#xA;  Numerical methods; Monte Carlo simulation techniques; Binomial scheme;&#xA;  Finite-difference methods; Numerical quadrature; Which method to use&#xA;  for which type of contract.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;A list that &quot;will ensure that you don't make an idiot of yourself by having major gaps in your knowledge&quot;.&lt;/p&gt;&#xA;" OwnerUserId="12214" LastEditorUserId="12214" LastEditDate="2015-12-08T15:30:33.373" LastActivityDate="2015-12-08T15:30:33.373" Title="Risk Manager must-know list" Tags="&lt;risk-management&gt;&lt;self-study&gt;&lt;career&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22195" PostTypeId="1" CreationDate="2015-12-08T13:36:41.323" Score="0" ViewCount="134" Body="&lt;p&gt;what is a reason that someone might be interested in a stochastic-interest model such as the Chen model?&lt;br&gt;&#xA;Also can you provide me with a link to an easy to read motivational paper/part of a paper on the subject?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="11582" LastActivityDate="2015-12-08T16:27:39.930" Title="Motivation: Stochastic Interest rate model" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;stochastic-volatility&gt;&lt;models&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22196" PostTypeId="2" ParentId="22173" CreationDate="2015-12-08T14:02:47.130" Score="1" Body="&lt;p&gt;Since&#xA;\begin{align*}&#xA;S_T = S_0 e^{rT} + \sigma e^{rT} \int_0^T e^{-rs} dW_s,&#xA;\end{align*}&#xA;$S_T$ is normal with mean&#xA;\begin{align*}&#xA;a &amp;amp;=S_0 e^{rT},&#xA;\end{align*}&#xA;and variance&#xA;\begin{align*}&#xA;b^2 &amp;amp;= \sigma^2 e^{2rT} \int_0^T e^{-2rs} ds\\&#xA;&amp;amp;=\frac{\sigma^2}{2r} \left(e^{2rT} - 1 \right).&#xA;\end{align*}&#xA;That is, $S_T = a + b\, \xi$, where $\xi$ is a standard normal random variable. Consequently,&#xA;\begin{align*}&#xA;\mathbb{E}\left(1_{S_T &amp;gt; K} S_T \right) &amp;amp;= \int_{-\infty}^{\infty} 1_{a + b\, x&amp;gt; K} (a + b \, x)  \frac{1}{\sqrt{2\pi}}e^{-\frac{1}{2}x^2}dx\\&#xA;&amp;amp;=\int_{\frac{K-a}{b}}^{\infty}(a + b \, x)  \frac{1}{\sqrt{2\pi}}e^{-\frac{1}{2}x^2}dx\\&#xA;&amp;amp;= a N\left(\frac{a-K}{b}\right) + b \int_{\frac{K-a}{b}}^{\infty} x\frac{1}{\sqrt{2\pi}}e^{-\frac{1}{2}x^2}dx\\&#xA;&amp;amp;=a N\left(\frac{a-K}{b}\right) + \frac{b}{\sqrt{2\pi}} e^{-\frac{1}{2}\left(\frac{K-a}{b} \right)^2},&#xA;\end{align*}&#xA;where $N$ is the cumulative distribution function of a standard normal random variable.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-12-08T14:02:47.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22198" PostTypeId="2" ParentId="22194" CreationDate="2015-12-08T15:05:37.433" Score="1" Body="&lt;p&gt;Assuming that you are totally new to the field, Columbia's Risk Management and Financial Engineering course on Coursera is an excellent introduction.  It focuses on discrete time models and you will need only a bare minimum knowledge of the revel ant mathematics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise, I've never seen a useful intro RM text. &lt;/p&gt;&#xA;" OwnerUserId="12203" LastActivityDate="2015-12-08T15:05:37.433" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22199" PostTypeId="2" ParentId="21852" CreationDate="2015-12-08T16:09:09.220" Score="2" Body="&lt;p&gt;If you do have some positive examples to estimate your model from, then, technically, you are dealing with the task of &lt;a href=&quot;https://en.wikipedia.org/wiki/One-class_classification&quot; rel=&quot;nofollow&quot;&gt;one-class classification&lt;/a&gt; (a.k.a &lt;a href=&quot;https://en.wikipedia.org/wiki/Anomaly_detection&quot; rel=&quot;nofollow&quot;&gt;anomaly detection&lt;/a&gt;, also directly related to &lt;a href=&quot;https://en.wikipedia.org/wiki/Density_estimation&quot; rel=&quot;nofollow&quot;&gt;density estimation&lt;/a&gt;). In your case the &quot;anomalies&quot; are high-risk customers, not present in the data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Various methods exist for anomaly detection and density estimation, including those based on linear models. One example would be a linear &lt;a href=&quot;https://dx.doi.org/10.1162%2F089976601750264965&quot; rel=&quot;nofollow&quot;&gt;one-class SVM&lt;/a&gt;. Another straightforward approach would be something like a Naive-Bayes-like density estimator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that all &quot;one-class&quot; approaches assume that your dataset is reasonably representative of the positive examples and essentially aim to discover a certain boundary around them, considering anything outside this boundary as an outlier. Consequently, blind application of this approach in your case might lead to a situation where the model would regard both &quot;extra safe&quot; as well as &quot;risky&quot; customers as &quot;outliers&quot;. However, if you take sufficient precautions (generate additional examples which would cover the space of potentially &quot;safe&quot; customers, study model parameters as you do now, etc), you might get a useful model out of it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, note that if you could come up with some (real-valued) &quot;measure of riskiness&quot; for your current data (perhaps some of the customers in your dataset are more late in their payments than others? perhaps you have external bureau credit scores for them?), you could estimate a regression model for predicting this measure and rely on it for identifying higher risk customers as well.&lt;/p&gt;&#xA;" OwnerUserId="18464" LastActivityDate="2015-12-08T16:09:09.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22200" PostTypeId="2" ParentId="22195" CreationDate="2015-12-08T16:27:39.930" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://personal.anderson.ucla.edu/francis.longstaff/empiricalcomparison.pdf&quot; rel=&quot;nofollow&quot;&gt;Chan, Karolyi, Longstaff, and Sanders (1992)&lt;/a&gt; compares empirically the performance of the main interest rates model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first page also provides the main references on those models.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-12-08T16:27:39.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22201" PostTypeId="2" ParentId="22172" CreationDate="2015-12-08T18:19:22.700" Score="2" Body="&lt;p&gt;It is just a problem of how you pass times series to yuima. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just one more thing, if you want to estimate a CARMA driven by a Brownian motion, it is better to work with log-prices instead of prices. Indeed, in the considered model, we have a non zero probability assigned to negative values of the process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try the following code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;require(yuima)&#xA;library(xts)&#xA;d &amp;lt;- read.csv(&quot;http://chart.yahoo.com/table.csv?s=IBM&amp;amp;g=d&amp;amp;x=.csv&quot;)&#xA;head(d)&#xA;tail(d) # data are reversed !!! take care, you need to handle data&#xA;ibm &amp;lt;- xts(d$Close, order.by=as.Date(d$Date, &quot;%Y-%m-%d&quot;)) # this is too long&#xA;ibm &amp;lt;- ibm[time(ibm)&amp;gt;=as.Date(&quot;2007-01-03&quot;,&quot;%Y-%m-%d&quot;),] # cut as above&#xA;# delta is very important in estimation set always to 1/252 for daily data&#xA;mydata3 &amp;lt;- setData(log(ibm)-rep(log(ibm[1]), dim(ibm)[1]),delta=1/252)&#xA;y3 &amp;lt;- setYuima(data = mydata3, model = setCarma(2,1))&#xA;x3 &amp;lt;- qmle(y3, start = list(a1 = 0.1, a2 = 0.1, b0 = 0.1,b1=0.1))&#xA;coef(x3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="18600" LastActivityDate="2015-12-08T18:19:22.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22202" PostTypeId="1" CreationDate="2015-12-08T19:01:44.400" Score="0" ViewCount="47" Body="&lt;p&gt;Say you have 3 closing prices...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;101&#xA;100&#xA;102&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would one calculate the standard volatility parameter using these values? I am quite confused, it seems simple enough though.&lt;/p&gt;&#xA;" OwnerUserId="17928" LastActivityDate="2015-12-08T19:17:58.270" Title="Calculating Volatility Parameter using Closing Prices" Tags="&lt;volatility&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2015-12-09T08:34:41.000" ContentLicense="CC BY-SA 3.0" />
  <row Id="22203" PostTypeId="2" ParentId="22202" CreationDate="2015-12-08T19:17:58.270" Score="1" Body="&lt;p&gt;With 3 closing prices you have 2 returns. You can compute standard deviation of those two returns as a proxy of historical volatility. However, with that number of observations there is nothing you can conclude as for sure the you will not be able to reject the null of 0 volatility. &lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-12-08T19:17:58.270" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22204" PostTypeId="2" ParentId="10300" CreationDate="2015-12-08T19:36:05.490" Score="2" Body="&lt;p&gt;Here is a list of model attributes that are necessary for a derivatives model to qualify for use in pricing and hedging:&#xA;1) exact fit to liquid yield curve inputs and good interpolation scheme in between&#xA;2) good fit to relevant volatility inputs.  (if a product has exposure to volatility points all through the grid, then the model needs to fit well everywhere)&#xA;3) good fit to the market skew, if relevant for the product&#xA;4) computation time is important if the portfolio is large&#xA;5) generates reasonable hedges - note that the choice for the skew dynamic heavily inputs what hedges are generated&#xA;6) the implementation is user friendly&#xA;That's just a few&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2015-12-08T19:36:05.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22208" PostTypeId="1" CreationDate="2015-12-08T21:52:42.610" Score="1" ViewCount="409" Body="&lt;p&gt;I have a data frame of bets, with 1 being a win and 0 being a loss. These bets are correlated so I cannot just pick the highest winning percentage.  Goal is to get 2 optimizations, 1 for max sharpe ration, and 1 for minMAD for a given return.  This is similar to any portfolio questions, but with the unique constraint that each bet can only be placed once and some bets are correlated with one another&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; df&#xA;  X1 X2 X3 X4 X5 X6 X7 X8 X9 X10&#xA;A  0  1  0  1  0  0  0  1  1   0&#xA;B  0  1  0  0  1  1  1  1  1   1&#xA;C  1  0  0  0  0  0  0  1  1   0&#xA;D  1  0  1  1  1  0  0  1  0   1&#xA;E  0  0  1  0  1  0  1  1  1   0&#xA;F  0  1  0  1  0  1  1  0  1   1&#xA;G  1  0  0  0  0  1  1  1  1   0&#xA;H  0  0  1  1  0  0  1  1  0   1&#xA;I  1  0  0  0  0  1  1  1  1   0&#xA;J  0  1  1  0  0  1  0  1  0   0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Bets can either be included or excluded, but each bet can only be placed 1 time. I posted a questions over the weekend Optimization with Binary decision variable and simulated database thinking an equal weighted quadratic optimization could solve the problem but I could not figure out how to program binary variables. After doing so research today, I saw an example of a GLPK program that used mean absolute deviation and transformed it for a LP.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to tweak this for a binary variable, but have no experience with optimizations. What are some good resource to learn how to program the matrix. Here is the goal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Minimize - Mean Absolute Deviation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;S.T.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Number of bets = 4&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bets are a binary variable&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Winning percentage &gt;= 0.52&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maximize winning percentage / MAD&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ST&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Weights are equal (1/n) or 0.25, and sum to 1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone help point me in the right direction. I am new to R and never set up a LP before. Some resource to help learn, and advice on set up will be much appreciated. I spend this weekend trying to figure it out spinning circles. Also I plan on playing around with the constraints and objective function once I get a base model going so please pass along good resources on R optimizations so I can learn. S.O. has been a great resource helping me learn R, right now I am using excel as a stop gap but the read data set is too big for the standard excel solve so I have to make several adjustments to get any usable results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for all of your help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this is what I have so far, but the output is not correct.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; nAssets = nrow(df)&#xA;&amp;gt; nScenarios = ncol(df)&#xA;&amp;gt; Mean = rowMeans(df)&#xA;&amp;gt; data = as.matrix(df)&#xA;&amp;gt; sucessRate = .52&#xA;&amp;gt;   vec &amp;lt;- c(weights=rep(0, nAssets), scenarios=rep(1/nScenarios, nScenarios))&#xA;&amp;gt; mat &amp;lt;- rbind(&#xA;+       MAD.LE = cbind(data, -diag(nScenarios)),&#xA;+       MAD.GE = cbind(data, +diag(nScenarios)),&#xA;+       RETURN = t(c(Mean, rep(0, nScenarios))),&#xA;+       BUDGET = t(c(rep(1, nAssets), rep(0, nScenarios))),&#xA;+       X = cbind(matrix(rep(0, nAssets*nScenarios),ncol=nAssets), diag(nScenarios)),&#xA;+       WEIGHTS = cbind(diag(nAssets), matrix(rep(0, nScenarios*nAssets), nrow=nAssets)))&#xA;&amp;gt; mat &amp;lt;- rbind(&#xA;+       MAD.LE = cbind(data, -diag(nScenarios)),&#xA;+       MAD.GE = cbind(data, +diag(nScenarios)),&#xA;+       RETURN = t(c(Mean, rep(0, nScenarios))),&#xA;+       BUDGET = t(c(rep(1, nAssets), rep(0, nScenarios))),&#xA;+       X = cbind(matrix(rep(0, nAssets*nScenarios),ncol=nAssets), diag(nScenarios)),&#xA;+       WEIGHTS = cbind(diag(nAssets), matrix(rep(0, nScenarios*nAssets), nrow=nAssets)))&#xA;&amp;gt; rhs &amp;lt;- c(&#xA;+       MAD.LE = rep(0, nScenarios),&#xA;+       MAD.GE = rep(0, nScenarios),&#xA;+       RETURN = sucessRate,&#xA;+       BUDGET = 1,&#xA;+       X = rep(0, nScenarios),&#xA;+       WEIGHTS = rep(0, nAssets))&#xA;&amp;gt;  dir &amp;lt;- c(&#xA;+       MAD.LE = rep(&quot;&amp;lt;=&quot;, nScenarios),&#xA;+       MAS.GE = rep(&quot;&amp;gt;=&quot;, nScenarios),&#xA;+       RETURN = &quot;==&quot;,&#xA;+       BUDGET = &quot;==&quot;,&#xA;+       X = rep(&quot;&amp;gt;=&quot;, nScenarios),&#xA;+       WEIGHTS = rep(&quot;&amp;gt;=&quot;, nAssets))&#xA;&amp;gt;  Rglpk::Rglpk_solve_LP(vec, mat, dir, rhs)&#xA;$optimum&#xA;[1] 0.31&#xA;&#xA;$solution&#xA; [1] 0.000000e+00 1.000000e-01 0.000000e+00 0.000000e+00 9.000000e-01 0.000000e+00 0.000000e+00&#xA; [8] 0.000000e+00 0.000000e+00 9.860761e-32 1.000000e-01 1.000000e+00 0.000000e+00 9.000000e-01&#xA;[15] 9.000000e-01 1.000000e-01 0.000000e+00 9.860761e-32 0.000000e+00 1.000000e-01&#xA;&#xA;$status&#xA;[1] 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What mistake did I make that is yielding more than 10 weights, and how do I get the weights equal and only 4 bets selected. Here is MatLab code for almost exactly what I am looking for, can someone help translate what is missing to R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.mathworks.com/help/optim/examples/mixed-integer-quadratic-programming-portfolio-optimization.html&quot; rel=&quot;nofollow&quot;&gt;http://www.mathworks.com/help/optim/examples/mixed-integer-quadratic-programming-portfolio-optimization.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18603" LastActivityDate="2015-12-08T21:52:42.610" Title="Portfolio Optimization with equal weight for assets selected" Tags="&lt;r&gt;&lt;portfolio-optimization&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22209" PostTypeId="2" ParentId="22135" CreationDate="2015-12-08T22:37:47.403" Score="4" Body="&lt;p&gt;In any arbitrage free model, you can define the BS implied volatility $\sigma_{BS}(S;T,K)$ of the model by writing call prices as &#xA;$$&#xA;  C_{Mdl}(S;T,K) = C_{BS}(S;T,K;\sigma_{BS}(S;T,K))&#xA;$$&#xA;So the model's Delta is &#xA;$$&#xA;  \Delta_{Mdl}(S;T,K) = \partial_S  C_{Mdl}(S;T,K) = \Delta_{BS} + Vega_{BS} \times \partial_S\sigma_{BS}&#xA;$$&#xA;The second term is a corrective term that corresponds to the dynamic of the implied vol surface in your model. If $\partial_S\sigma_{BS}$ is positive (resp. negative) enough, the model delta of your calls (resp. puts) will be greater than 1 (resp. lower than -1). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The quantity $\partial_S\sigma_{BS}$ is sometimes called the backbone of the model. The regimes of volatility introduced by Derman can be seen as an out-of-model specification of this quantity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: If you want a concrete example, I would suggest looking at a stochastic volatility model with very high/low correlation between spot and instantaneous volatility. In a Heston model, you have a semi-closed form for call prices so you should be able to compute the model delta somewhat explictly and show that is it not bounded by 1.&lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2015-12-08T22:45:13.667" LastActivityDate="2015-12-08T22:45:13.667" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="22210" PostTypeId="1" CreationDate="2015-12-09T01:35:44.133" Score="1" ViewCount="225" Body="&lt;p&gt;I'm struggling to find much information about yield curve interpolation for sub-yearly horizons. Say, one-two months. It seems to be the area where the curvature is usually nontrivial, while after that it's not that different from a straight line, oftentimes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some method quants use for this task by default, as a simple yet effective estimate? Some industry standard? Or if it's more complicated than that, what literature should I read to get a good overview of existing methodologies?&lt;/p&gt;&#xA;" OwnerUserId="5086" LastActivityDate="2015-12-09T08:39:42.000" Title="Yield curve interpolation at (very) short horizons" Tags="&lt;yield-curve&gt;&lt;curve-fitting&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22211" PostTypeId="2" ParentId="22179" CreationDate="2015-12-09T01:41:26.447" Score="1" Body="&lt;p&gt;My favorite model of volatility is the HAR RV model by Fulvio Corsi.  Good combination of simplicity and accuracy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://jfec.oxfordjournals.org/content/7/2/174.short?rss=1&amp;amp;ssource=mfc&quot; rel=&quot;nofollow&quot;&gt;http://jfec.oxfordjournals.org/content/7/2/174.short?rss=1&amp;amp;ssource=mfc&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;About the microstructure issue: you cannot avoid dealing with it, it is important if you are computing volatility from  very high frequency.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-12-09T01:41:26.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22212" PostTypeId="2" ParentId="22210" CreationDate="2015-12-09T02:03:04.457" Score="2" Body="&lt;p&gt;It depends on the market you're interested in and what the curve is used for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To build the USD swap curve, for example, you've got a ton of information available from actively traded market instruments – fed funds futures (monthly), OIS (even finer details at the front end), Eurodollar futures (quarterly), basis swap, etc. All of these should be incorporated into your curve building procedure. A lot of curve builders will fit most if not all of these available market instruments perfectly and simultaneously.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the government curve, it's a different story. In the US, most curve builders are not particularly concerned about fitting the front end of the Treasury curve all that well. In fact, 1) most of us are likely to fit the &amp;lt;1y sector by itself as a separate curve, 2) some of us use repo rates rather than Treasuries at the front end, since this gives more accurate forward rates (Treasuries are financed at repo rates).&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2015-12-09T08:39:42.000" LastActivityDate="2015-12-09T08:39:42.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22213" PostTypeId="1" AcceptedAnswerId="22979" CreationDate="2015-12-09T03:16:08.790" Score="2" ViewCount="2029" Body="&lt;p&gt;In Graham's &lt;em&gt;Intelligent Investor&lt;/em&gt;, he calculates a metric Earning/book value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to calculate the same ratio in modern times (1960-2015) but am having trouble finding this data. I have found an open source for the price and earnings information at &lt;a href=&quot;http://data.okfn.org/data/core/s-and-p-500&quot; rel=&quot;nofollow&quot;&gt;http://data.okfn.org/data/core/s-and-p-500&lt;/a&gt; but cannot find book value over this time period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this information publicly available?&lt;/p&gt;&#xA;" OwnerUserId="18606" LastActivityDate="2016-01-28T11:16:17.167" Title="Historical book value data for S&amp;P 500" Tags="&lt;data&gt;&lt;index&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22214" PostTypeId="2" ParentId="22190" CreationDate="2015-12-09T04:13:48.130" Score="0" Body="&lt;p&gt;It should be just $400*(1+0.02)^3$&#xA;Where $0.02$ is quarterly compounded rate for a quarter, and&#xA;$n$ is 3 quarters, hence the exponent 3&lt;/p&gt;&#xA;" OwnerUserId="17973" LastActivityDate="2015-12-09T04:13:48.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22215" PostTypeId="1" AcceptedAnswerId="22241" CreationDate="2015-12-09T05:22:55.680" Score="2" ViewCount="105" Body="&lt;p&gt;I am very green when it comes to programming. I am doing a market microstructure study where I need to investigate how certain stock characteristics affect their liquidity. I have Nasdaq OMX ITCH Feed available, but in order to be able to analyze this data set, I need to figure out a way to turn this data into bid/ask quotes and get the volumes of executed trades.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that Python is the way to go, and I need to build a code that constructs the limit order book from the feed. I have some familiarity with Python, and should be able to build the code that updates the book line by line, but being that the daily files are rather large (1-3gb), I understand that finding a way to efficiently do this is the main concern - I am going to need data for 100+ stocks, and would obviously prefer to have as long time window as possible. The final data doesn't have to be high frequency, minute frequency will be fine if it significantly reduces the processing time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I was wondering if any of you guys could nudge me in the right direction, i.e. how should I approach this problem and where should I start in figuring this thing out?&lt;/p&gt;&#xA;" OwnerUserId="18607" LastActivityDate="2016-08-06T09:11:50.977" Title="Bid/ask and volumes from ITCH feed, what is the most efficient way to do this?" Tags="&lt;intraday&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22216" PostTypeId="2" ParentId="22210" CreationDate="2015-12-09T08:07:01.893" Score="0" Body="&lt;p&gt;I assume that with 'yield curve' you mean US Treasury curve. The very short end is determined by the Fed rate, therefore one uses flat forward interpolation between Fed meeting dates (which are every 1.5 months). Same thing happens with OIS.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2015-12-09T08:07:01.893" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22218" PostTypeId="1" CreationDate="2015-12-09T12:33:56.573" Score="2" ViewCount="57" Body="&lt;p&gt;this is my first question so I hope I express myself clearly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to implement an Implicit and a Crank Nicolson algorithm for the generic PDE&#xA;$\partial_\tau u(\tau,x)+a \partial_x^2 u(\tau,x) +d \partial_x u(\tau,x)+ c u(\tau,x)+d(\tau,x)=0$,&#xA;where a,b,c are constants, x is the log-spot of an asset with black scholes dyanmics, that is $x=\log(S/S_0)$ and $\tau=T-t$ is the time to expiry. I solve the PDE forward from time 0 to expiry T.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually implementing both algorithms is quite straight forward, but my solution heavily depends on the choice of my spatial grid, namely left and right end points $x_\min$ and $x_\max$ appearing in&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$x_\min &amp;lt; x_1 &amp;lt; \dots &amp;lt; x_N &amp;lt; x_\max $. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That means if I vary both values the solution variies, whereas if I fix both values and vary the discretization parameters in time $\Delta \tau$ and space $\Delta x$ the solution remains nearly unaffected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does someone know how to interpret this bevahiour? May it be possible that this is a direct consequence of the choice of my boundary conditions? They are probably not the best choice, but unfortunately the best I have. The solution of the PDE is the difference of a risk free OTC-derivative to that where counterparty credit risk, DVA and a funding cost adjustment is included.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simon&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Algorithm in full detail&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ok here are some details about the algorithm, but now in terms of &#xA;Let us denote the values of the function at the grid points by $u_n^m= u(\tau_m,x_n)$. Then I approximate the spatial derivatives with central differences as usual and arrive at &#xA;$ \partial_\tau u(\tau_m,x_n) = -a\frac{u_{n+1}^m-2u_n^m+u_{n-1}^m }{\delta x^2} - b \frac{u_{n+1}^m-u_{n-1}^m}{2\delta x}-cu_n^m -d_n^m\\[0.8em]&#xA;=\left(-\frac{a}{\delta x^2}+\frac{b}{2\delta  x}\right)u_{n-1}^m+\left(\frac{2a}{\delta x^2}-c\right)u_n^m+\left(-\frac{a}{\delta x^2}-\frac{b}{2 \delta x}\right) u_{n+1}^m-d_n^m $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or in more compact form&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\partial_\tau u(\tau_m,x_n)=\alpha_1 u_{n-1}^m+\alpha_2 u_n^m +\alpha_3 u_{n+1}^m -d_n^m :=g(u^m,d^m) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Crank Nicholson algorithm averages the forward time difference at point $(\tau_m,x_n)$ with the backward difference at $(\tau_{m+1},x_n)$&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$\partial_\tau u(\tau_m,x_n) \approx \frac{u_n^{m+1}-u_n^m}{\delta t}$ forward difference at $(\tau_m,x_n)$&lt;/li&gt;&#xA;&lt;li&gt;$\partial_t u(\tau_{m+1},x_n) \approx \frac{u_n^{m+1}-u_n^m}{\delta t}$ backward difference at $(\tau_{m+1},x_n)$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;But values coincide and we average the spatial derivatives for both points&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{u_n^{m+1}-u_n^m}{\delta t} = \frac{1}{2} g(u^m,d^m) +\frac{1}{2}g(u^{m+1},d^{m+1})$ &#xA;or &#xA;$u_n^{m+1} -\frac{\delta t }{2} g(u^{m+1},d^{m+1}) = u_n^m+\frac{\delta t }{2} g(u^m,d^m) $.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can write the right hand side in matrix notation &#xA;$\begin{pmatrix} u_1^m\\u_2^m \\ \vdots \\ \vdots \\ u^m_N&#xA;\end{pmatrix}  &#xA;+ \frac{\delta t }{2} \begin{pmatrix}&#xA;    \alpha_2 &amp;amp; \alpha_3 &amp;amp; 0 &amp;amp; \dots  &amp;amp; 0 \\&#xA;    \alpha_1 &amp;amp; \alpha_2 &amp;amp; \alpha_3 &amp;amp;   &amp;amp; \vdots \\&#xA;    0 &amp;amp; \alpha_1 &amp;amp; \alpha_2 &amp;amp; \ddots &amp;amp; 0 \\&#xA;    \vdots &amp;amp; 0 &amp;amp; \ddots &amp;amp; \ddots &amp;amp; \alpha_3 \\&#xA;    0 &amp;amp; 0 &amp;amp;  &amp;amp; \alpha_1  &amp;amp; \alpha_2&#xA;\end{pmatrix}&#xA;\begin{pmatrix} u_1^m\\u_2^m \\ \vdots \\ \vdots \\ u^m_N&#xA;\end{pmatrix} &#xA;+ \frac{\delta t}{2} &#xA;\begin{pmatrix} \alpha_1 u_0^m\\0 \\ \vdots \\ 0 \\ \alpha_3 u^m_{N+1}&#xA;\end{pmatrix} &#xA;- \frac{\delta t}{2} &#xA;\begin{pmatrix} d_1^m\\d_2^m \\ \vdots \\ \vdots \\ d^m_N&#xA;\end{pmatrix}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Doing the same for the left hand side analogously and by defining &#xA;By defining&#xA;\begin{gather*}&#xA;\boldsymbol{u}^m=\left(u_1^m,\dots,u_N^m\right)^T, \quad \boldsymbol{b}^m=\left(\alpha_1 u_0^m,0,\dots,0,\alpha_3 u_{N+1}^m\right)^T, \quad \boldsymbol{d}^m=\left(d_1^m,\dots,d_N^m\right)^T, \\&#xA;\eta= \frac{\delta t}{2}&#xA;\end{gather*}&#xA;we arrive at the Crank Nicholson algorithm.&#xA;\begin{align*}&#xA;\left(\mathbf{I}-\eta \mathbf{A}\right) \boldsymbol{u}^{m+1}-   \eta \left(\boldsymbol{b}^{m+1}-\boldsymbol{d}^{m+1} \right)= \left(\boldsymbol{I}+\eta \mathbf{A}\right)\boldsymbol{u}^m + \lambda \left(\boldsymbol{b}^m-\boldsymbol{d}^m\right)&#xA;\end{align*}&#xA;Which can be written more compactly by&#xA;\begin{align*}&#xA;\mathbf{C}=&amp;amp;\mathbf{I}-\eta \mathbf{A} \qquad \text{and} \qquad&#xA;\mathbf{D}=\mathbf{I}+\eta \mathbf{A},\\[0.6em]&#xA;\boldsymbol{e}^m &amp;amp;=\eta` \left(\boldsymbol{b}^m+\boldsymbol{b}^{m+1}-\boldsymbol{d}^m-\boldsymbol{d}^{m+1}\right)&#xA;\end{align*}&#xA;the \textbf{Crank Nicolson Scheme} in matrix notation can be written in compact form &#xA;\begin{align*}&#xA;\mathbf{C} \boldsymbol{u}^{m+1} = \mathbf{D} \boldsymbol{u}^{m} +\boldsymbol{e}^m&#xA;\end{align*}.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Boundary Conditions&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The generic PDE is the result of a transformed PDE with coefficients depending on $S$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know by Feynman Kac theorem that the solution $U$ of the untransformed PDE satisfies &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$U(t,S_t) =-c_1\int_t^T e^{-(r+\lambda_B+\lambda_C)(u-t)} \mathbb{E}_t \left[V^+(u,S(u))\right]du - c_2\int_t^T e^{-(r+\lambda_B+\lambda_C)(u-t)} \mathbb{E}_t \left[V^-(u,S(u))\right]du$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for some constants $\lambda_B,\lambda_C,c_1,c_2$. As I said $U$ is the difference from a risk free derivative $V$ and the same derivative but including counterparty credit risk. The derivative for which I want to determine the adjustment for the moment is a simple forward contract with value $V(t,S_t) = S_t - Ke^{-r(T-t)}$. I argue as follow: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We see that $V(t,S_t) \gg 0$ if $S_t \gg 0$. We assume then that &#xA;\begin{align*}&#xA;V(u,S_u) \gg 0 \quad \text{for all} \quad u\geq t&#xA;\end{align*}&#xA;Thus we can determine the upperboundary condition for $U$ by&#xA;\begin{align*}&#xA;U(t,S)&amp;amp;=  -c_1\int_t^T D_{r+\lambda_B+\lambda_C}(t,u) \mathbb{E}_t \left[V(u,S(u)\right]du \\[0.8em]&#xA;&amp;amp;= -c_1V(t,S_t)\int_t^T e^{-(\lambda_B+\lambda_C)(u-t)} du \\[0.8em] &#xA;&amp;amp;= c_1\frac{1}{\lambda_B+\lambda_C} \left(1-e^{-(\lambda_B+\lambda_C)(T-t)}\right) \left(S_t - Ke^{-r(T-t)}\right).&#xA;\end{align*}&#xA;Analogously we can determine the lower boundary condition. We assume that if $S_t \to 0$ then $S_u \approx 0$ for all $u\geq t$. Therefore &#xA;\begin{align*}&#xA;V(u,S_u) = -Ke^{-r(T-t)} \quad \text{for all} \quad u\geq t \quad \text{as}  \quad S_t \to 0&#xA;\end{align*}&#xA;holds and therefore we can deduce&#xA;\begin{align*}&#xA;U(t,S)&amp;amp;=  -c_2\int_t^T D_{r+\lambda_B+\lambda_C}(t,u) \mathbb{E}_t \left[V(u,S(u)\right]du \\[0.8em]&#xA;&amp;amp;=- c_2V(t,S_t)\int_t^T e^{-(\lambda_B+\lambda_C)(u-t)} du \\[0.8em] &#xA;&amp;amp;= c_2\frac{1 }{\lambda_B+\lambda_C} \left(1-e^{-(\lambda_B+\lambda_C)(T-t)}\right)  Ke^{-r(T-t)}&#xA;\end{align*}&#xA;These considerations result in the boundary conditions.&#xA;\begin{align*}&#xA;u(\tau_m,x_{\text{max}} ) &amp;amp;=\frac{c_1}{\lambda_B+\lambda_C} \left(1-e^{-(\lambda_B+\lambda_C)\tau}\right) \left(x_0e^{x_{\text{max} } } - Ke^{-r\tau_m }\right) \\[0.8em]&#xA;u(\tau_m,x_{\text{min}} )&amp;amp;= \frac{c_2}{\lambda_B+\lambda_C} \left(1-e^{-(\lambda_B+\lambda_C)\tau_m}\right)  Ke^{-r\tau_m}&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="18611" LastEditorUserId="18611" LastEditDate="2015-12-09T21:05:48.487" LastActivityDate="2015-12-09T21:05:48.487" Title="How does the diameter of the spatial grid affects the solution of a Crank Nicholson algorithm?" Tags="&lt;black-scholes-pde&gt;&lt;finite-difference-method&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22219" PostTypeId="1" CreationDate="2015-12-09T13:28:24.737" Score="0" ViewCount="3061" Body="&lt;p&gt;I have to calculate the NPV for Capital Budgeting in a project with annual cash flows discounted by a risk - free interest rates&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1.Instead of using a constant interest rate, should it better to use different interest rate for each period?&#xA;2. Should I use the Forward interest rate or the Spot interest rate?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;eg. $CF_3$ should be discounted by $ (1+ f(3,4))^3 $ where f(3,4) is the forward rate in period=3 for the period=4 ?&lt;/p&gt;&#xA;" OwnerUserId="7827" LastEditorUserId="7827" LastEditDate="2015-12-09T14:42:26.307" LastActivityDate="2016-07-03T12:24:46.543" Title="Using Forward or Spot rates for NPV?" Tags="&lt;yield-curve&gt;&lt;forward-rate&gt;&lt;capital-budget&gt;" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="22220" PostTypeId="1" AcceptedAnswerId="22221" CreationDate="2015-12-09T14:36:31.157" Score="2" ViewCount="104" Body="&lt;p&gt;Reading the book by Andrea Pascucci &quot;PDE and Martingale Method in Option Pricing&quot; I am struggling with a very simple issue. Suppose we want to find the price of an American derivative $X$ in an arbitrage-free and complete market. Let $\mathbb{Q}$ be then the (unique) equivalent martingale measure with numeraire $B$ (the deterministic bond) and let $X_t$ be the value of the American derivative a time $t$ ($X_t$ is thus, in the most general formulation, a $\mathcal{F}_t$-adapted stochastic process). Let $H$ be the no-arbitrage price of $X$. Clearly it must be $H_T=X_T$. At time $t=T-1$ the price is determined as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;H_{T-1} = \max\left(X_{T-1},\frac{1}{1+r}\,\mathbb{E}^{\mathbb{Q}}\left[ X_T\mid\mathcal{F}_{T-1}\right]\right). \quad(1)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I clearly understand that $\frac{1}{1+r}\,\mathbb{E}^{\mathbb{Q}}\left[ X_T\mid\mathcal{F}_{T-1}\right]$ is the no-arbitrage price at time $T-1$ of an European derivative with maturity $T$ and payoff $X_T$, but which is the no-arbitrage argument behind equation (1) ? &lt;/p&gt;&#xA;" OwnerUserId="18063" LastActivityDate="2015-12-09T15:11:49.487" Title="Pricing of American Deriviatives" Tags="&lt;american-options&gt;&lt;no-arbitrage-theory&gt;&lt;pricing-formulae&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22221" PostTypeId="2" ParentId="22220" CreationDate="2015-12-09T15:11:49.487" Score="2" Body="&lt;p&gt;For an American option, you have the right to exercise at any intermediate time. Then, at time $T-1$, if you exercise your option, you obtain the payoff $X_{T-1}$. However, if you wait to exercise at the maturity $T$, your value is &#xA;$\frac{1}{1+r}\mathbb{E}^Q\left(X_T \mid \mathscr{F}_{T-1} \right)$. Your option value at time $T-1$ is the maximum of these two values, that is, &#xA;\begin{align*}&#xA;\max\left(X_{T-1}, \, \frac{1}{1+r}\mathbb{E}^Q\left(X_T \mid \mathscr{F}_{T-1} \right) \right).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-12-09T15:11:49.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22226" PostTypeId="2" ParentId="22219" CreationDate="2015-12-09T17:47:42.100" Score="2" Body="&lt;p&gt;If you want to discount the CF3 from 3 years in the future to today you should use (1 + 3yr spot rate)^3.   There's no reason to use forward rates for that purpose.   The forward rates should only be used for period-by-period discounting - for example, if you wanted to find the value after 3 years of a CF4 which occurs after 4 years, you would use (1+ 1yr Forward rate from 3yr to 4yr).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(addressing the comment):  I really cant think why you would need forward rates in a capital budgeting type problem where everything is discounted from year n to today.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastEditorUserId="18388" LastEditDate="2015-12-10T13:06:11.467" LastActivityDate="2015-12-10T13:06:11.467" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22227" PostTypeId="1" AcceptedAnswerId="29851" CreationDate="2015-12-09T18:07:45.510" Score="3" ViewCount="324" Body="&lt;p&gt;In the Black-Scholes' setting, the delta hedge ratio of a European call option is given by $N(d_1)$, which is an increasing function of the underlying equity spot $S_0$. Does this property hold generally, that is, for general cases where the volatility may be stochastic and may depend on the spot $S_0$? &lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-08-26T20:59:46.203" Title="Is the European call option delta an increasing function of the spot?" Tags="&lt;black-scholes&gt;&lt;delta&gt;&lt;local-volatility&gt;&lt;european-options&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22228" PostTypeId="1" AcceptedAnswerId="22401" CreationDate="2015-12-09T18:12:14.680" Score="5" ViewCount="740" Body="&lt;p&gt;Assume that we have a general one-period market model consisting of $d+1$ assets and $N$ states.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using a replicating portfolio $\phi$, determine $\Pi(0;X)$, the price of a European call option, with payoff $X$,  on the asset $S_1^2$ with strike price $K = 1$ given that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S_0 =\begin{bmatrix}&#xA;2 \\ &#xA;3\\ &#xA;1&#xA;\end{bmatrix}, S_1 = \begin{bmatrix}&#xA;S_1^0\\ &#xA;S_1^1\\ &#xA;S_1^2&#xA;\end{bmatrix}, D = \begin{bmatrix}&#xA;1 &amp;amp; 2 &amp;amp; 3\\ &#xA;2 &amp;amp; 2 &amp;amp; 4\\ &#xA;0.8 &amp;amp; 1.2 &amp;amp; 1.6&#xA;\end{bmatrix}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the columns of $D$ represent the states for each asset and the rows of D represent the assets for each state&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;What I tried:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We compute that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X = \begin{bmatrix}&#xA;0\\ &#xA;0.2\\ &#xA;0.6&#xA;\end{bmatrix}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we solve $D'\phi = X$, we get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\phi = \begin{bmatrix}&#xA;0.6\\ &#xA;0.1\\ &#xA;-1&#xA;\end{bmatrix}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would seem that the price of the European call option $\Pi(0;X)$ is given by the value of the replicating portfolio&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S_0'\phi = 0.5$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;On one hand, if we were to try to see if there is arbitrage in this market by seeing if a state price vector $\psi$ exists by solving $S_0 = D \psi$, we get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\psi = \begin{bmatrix}&#xA;0\\ &#xA;-0.5\\ &#xA;1&#xA;\end{bmatrix}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence there is no strictly positive state price vector $\psi$ s.t. $S_0 = D \psi$. By &lt;a href=&quot;http://dybfin.wustl.edu/research/papers/arbetc7.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;'the fundamental theorem of asset pricing'&lt;/a&gt; (or &lt;a href=&quot;http://www.nuff.ox.ac.uk/users/murphya/Teaching/Arbitrage.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;'the fundamental theorem of finance'&lt;/a&gt; or &lt;a href=&quot;http://www.jhqian.org/apt/apbook.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;'1.3.1' here&lt;/a&gt;), there exists arbitrage in this market.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;On the other hand the price of $0.5$ seems to be confirmed by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Pi(0;X) = \beta E^{\mathbb Q}[X]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\beta = \sum_{i=1}^{3} \psi_i = 0.5$ (sum of elements of $\psi$) and $\mathbb Q$ is supposed to be the equivalent martingale measure given by $q_i = \frac{\psi_i}{\beta}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E^{\mathbb Q}[X] = q_1X(\omega_1) + q_2X(\omega_2) + q_3X(\omega_3)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ = 0 + \color{red}{-1} \times 0.2 + 2 \times 0.6 = 1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\to \Pi(0;X) = 0.5$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I guess $\therefore$ that we cannot determine the price of the European call using $\Pi(0;X) = \beta E^{Q}[X]$ because there is no equivalent martingale measure $\mathbb Q$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what's the verdict? Can we say the price is 0.5? How can we price even if there is arbitrage? What's the interpretation of 0.5?&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="7788" LastEditDate="2017-10-04T10:26:23.823" LastActivityDate="2017-10-04T10:26:23.823" Title="Pricing when arbitrage is possible through Negative Probabilities or something else" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;probability&gt;&lt;arbitrage&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22229" PostTypeId="1" CreationDate="2015-12-09T19:32:03.257" Score="2" ViewCount="167" Body="&lt;p&gt;From Ch 12 in &lt;a href=&quot;http://workofark.com/pdf/options.PDF&quot; rel=&quot;nofollow noreferrer&quot;&gt;Hull's OFOD&lt;/a&gt;, we compute the risk-neutral probabilities for a futures contract:&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/cr6e0.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/cr6e0.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Later in Ch 17, futures options are valued, and we have the same result:&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/aWPPm.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/aWPPm.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In relation to Chapter 16 and 17, my Derivatives Pricing prof gave us this exercise:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Show that, in the Risk-Neutral World, $E[F_T] = F_0$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I guess, $F_T$ is the random variable s.t.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$F_T = 1_{A}F_0u + 1_{A^C}F_0d$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $A$ is the event corresponding to case 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$$E[F_T] = pF_0u + (1-p)F_0d$$&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$$= \frac{1-d}{u-d}F_0u + \frac{u-1}{u-d}F_0d = F_0$$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That seems strange. To me it seems that the reason why we know that $p = \frac{1-d}{u-d}$ is because $E[F_T] = F_0$ based on 'If $F_0$ is the initial futures price, the expected futures price at the end of one time step of length $\Delta t$ should also be $F_0$' from Ch 12.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Iirc, my prof said that the reason why we have 'If $F_0$ is the initial futures price, the expected futures price at the end of one time step of length $\Delta t$ should also be $F_0$' is because of said exercise which comes from $p = \frac{1-d}{u-d}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how do we get $p = \frac{1-d}{u-d}$ without $E[F_T] = F_0$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In both texts from Ch 12 and 17, it seems that $E[F_T] = F_0$ is an assumption. Am I wrong? Is $E[F_T] = F_0$ not an assumption in Ch 17? So $E[F_T] = F_0$ comes from Ch 17? That seems very inconsistent of Hull:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ch 12 proposition: $E[F_T] = F_0 \to p = \frac{1-d}{u-d}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ch 17 proposition: $p = \frac{1-d}{u-d} \to E[F_T] = F_0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;?&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="7788" LastEditDate="2016-02-23T19:01:33.223" LastActivityDate="2016-02-25T18:11:16.697" Title="$E[F_T] = F_0 \ \rightarrow \ \text{or} \ \leftarrow \ p = \frac{1-d}{u-d}$?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;futures&gt;&lt;risk-neutral-measure&gt;&lt;delta-hedging&gt;" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="22230" PostTypeId="1" CreationDate="2015-12-09T19:36:50.577" Score="3" ViewCount="139" Body="&lt;p&gt;How do one solve $ \int_t^T  \exp[\int_0^u-\left( r-\delta_s\right)ds] dW_u $ ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\delta(t)$ is a general deterministic function. $r$ is constant.&lt;/p&gt;&#xA;" OwnerUserId="18584" LastEditorUserId="18584" LastEditDate="2015-12-13T15:05:54.020" LastActivityDate="2015-12-13T15:05:54.020" Title="How do one solve $ \int_t^T \exp[\int_0^u-( r-\delta_s)ds] dW_u $? Double integral with general deterministic function $\delta(t)$" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22231" PostTypeId="1" CreationDate="2015-12-09T19:41:51.420" Score="4" ViewCount="83" Body="&lt;p&gt;From &lt;a href=&quot;https://quant.stackexchange.com/questions/22135/european-call-option-delta-upper-bound/22209?noredirect=1#comment31627_22209&quot;&gt;comments&lt;/a&gt;, the maximum principle for parabolic PDE can be used to show that the European call option delta cannot be greater than 1. I am looking forward to such derivations.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2015-12-09T19:41:51.420" Title="European call option delta and maximum principle" Tags="&lt;delta&gt;&lt;european-options&gt;&lt;parabolic-pde&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22232" PostTypeId="1" CreationDate="2015-12-09T20:44:40.413" Score="0" ViewCount="1255" Body="&lt;p&gt;Can anyone explain to me exactly what a state variable is in a Bellman equation??&#xA;$$ V(x,y)=max\space u(c)+\beta V(x',y')$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In some models with capital savings it's the capital $k_t$ you walk into period $t$ in others where there are many future states its all aggregate $S$ in the past. In some models it's dividends $d_t$ of a stochastic asset. It's obviously relevant variables that influence your decision making but I can't seem to find a consistent way to be able to identify state equations in a lot of the problem I am solving.&lt;/p&gt;&#xA;" OwnerUserId="4729" LastActivityDate="2017-01-04T06:50:58.873" Title="State Variables in a Bellman Equation" Tags="&lt;asset-pricing&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22234" PostTypeId="1" CreationDate="2015-12-09T21:05:43.110" Score="2" ViewCount="137" Body="&lt;p&gt;I'm attempting to model operating margins and a time plot indicated that the series may follow an autoregressive process. I initially fitted data to an AR(1) model and it appeared that residual correlation was present in the 4th lag term. I added an additional 4th lag and while the AC in the fourth residual did decrease, the t-stat is still slightly greater than 2. Additionally, the second (4th lagged regressor) appears to be highly insignificant. I'm looking for suggestions as to how to improve on the model specification. &lt;/p&gt;&#xA;" OwnerUserId="18614" LastActivityDate="2017-01-06T13:39:46.190" Title="residual correlation remains after seasonal lag added" Tags="&lt;auto-correlation&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22235" PostTypeId="2" ParentId="22230" CreationDate="2015-12-09T21:18:28.353" Score="1" Body="&lt;p&gt;There is no analytical solutions to this integral. The conclusions we can draw about this integral are that, if $r$ and $\delta$ are deterministic, it is normal and is independent of the information set $\mathscr{F}_t$. These are probably the most needed properties, for example, in the computation of a zero-coupon bond price under the Hull-White interest rate model, as demonstrated in &lt;a href=&quot;https://quant.stackexchange.com/questions/21513/extended-hull-white-interest-rate-model-for-zero-coupon-bond/21516#21516&quot;&gt;question&lt;/a&gt;. What else are you looking for?&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2015-12-09T21:18:28.353" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22236" PostTypeId="2" ParentId="21998" CreationDate="2015-12-09T22:45:01.480" Score="2" Body="&lt;p&gt;In general any OTC trade (in your case total return swap) between two parties (i.e. buyer - Party A and dealer - Party B) shall and would be driven off a legal document which sets out transaction details. In most of the cases such legal document would be ISDA Master agreement and it's annexes (if any). There should be a notion/definition of a &quot;Calculation Agent&quot; who would compute and determine amounts. Usually Calculation Agent would be Party B (dealer). As for the actual amounts itself - it would depend on the underlying asset, i.e. if it's a listed security then Party A (buyer) could easily verify amounts and question Party B if unable to reconcile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have a look at a template &lt;a href=&quot;http://www.isda.org/cgi-bin/_isdadocsdownload/download.asp?DownloadID=307&quot; rel=&quot;nofollow&quot;&gt;Master Bond Total Return Swap Derivatives Confirmation Agreement&lt;/a&gt; and you'll grasp an idea on who and how computes the amounts. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps&lt;/p&gt;&#xA;" OwnerUserId="18275" LastActivityDate="2015-12-09T22:45:01.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22237" PostTypeId="1" CreationDate="2015-12-09T23:03:51.983" Score="1" ViewCount="151" Body="&lt;p&gt;I got this questions which is quite interesting, &#xA;I am in a museum, there are 100 rooms (numbered from 1 to 100) in this museum and each room has a picture in it. I go visit each room in the increasing order, but I can't go back in a room that I have already visited. When I am in a room I can steal the picture, earn his value and I have to go out of the museum (meaning that I only can steal one picture and when I am in the room 100 I am forced to steal the picture) or I can leave the picture here and move to the other room. &#xA;What is your strategy in order to optimize the money you will earn.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hint : I have assume that the price of the picture follows a uniform distribution from 1 to to 100.&#xA;Enjoy &lt;/p&gt;&#xA;" OwnerUserId="18615" LastActivityDate="2015-12-09T23:03:51.983" Title="Interview questions pictures" Tags="&lt;soft-question&gt;" AnswerCount="0" CommentCount="2" ClosedDate="2015-12-10T05:59:08.860" ContentLicense="CC BY-SA 3.0" />
  <row Id="22239" PostTypeId="2" ParentId="22135" CreationDate="2015-12-10T03:15:25.233" Score="2" Body="&lt;p&gt;It seems fairly simple to demonstrate an example in discrete space where delta&gt;1.  Consider a 2 step binomial tree on a dividend free stock, with interest rates at zero.  Let the initial stock price be 100, and each step on the tree have risk neutral p(up)=p(down)=0.5.  Let the tree be as follows:&lt;br&gt;&#xA;100-(101,99)-(200,2,99,99)&lt;br&gt;&#xA;meaning that on the first step it goes up or down a dollar.  On the second step the 101 goes to either 200 or 2, and the 99 stays at 99 for certain.  On this tree, consider a 100 call.  On the 101 node it is worth 50, and on the 99 node it is worth 0.  Hence the delta on the initial node must be (50-0)/(101-99) = 25 !&lt;br&gt;&#xA;Consider now a second tree with the same notation:&lt;br&gt;&#xA;100-(149.5,50.5)-(200,99,99,2) &#xA;This tree has the same terminal distribution as the first one, but the delta at the initial node is totally different (close to 0.5).&#xA;So the delta is a function of the local dynamics and not just the terminal distribution.  Sufficiently toxic local dynamics can exist that make it &gt;1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ps this was motivated by the below post about Heston.  In the first tree above, implied vol goes ballistic if stock goes up and goes to zero if stock goes down.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2015-12-10T03:15:25.233" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22240" PostTypeId="2" ParentId="22051" CreationDate="2015-12-10T03:43:14.447" Score="0" Body="&lt;p&gt;There is a contradiction in your statement.  If QE supposedly motivates house sales, then the price should indeed go down.  I think you are trying to say that QE should motivate house &lt;strong&gt;purchases&lt;/strong&gt;.  Well, QE is designed to make long term interest rates (including mortgage rates) go down, so yes it should help housing prices, ceteris paribus.  If you observe, housing prices have indeed recovered substantially since QE was initiated.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2015-12-10T03:43:14.447" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22241" PostTypeId="2" ParentId="22215" CreationDate="2015-12-10T05:31:48.117" Score="1" Body="&lt;p&gt;Not sure if I understand your question, but the approach will be different if you are dealing with real time data, or if you want to study past data (simulation) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the first case, you should keep the incoming quotes in an array (or dictionary) and then do your analysis. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the other case, you need to simulate the incoming feed, and based on that do process the data. &lt;/p&gt;&#xA;" OwnerUserId="13990" LastActivityDate="2015-12-10T05:31:48.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22242" PostTypeId="2" ParentId="18739" CreationDate="2015-12-10T05:34:56.290" Score="1" Body="&lt;p&gt;There is virtually no way to get tick data from yahoo/Google. &#xA;You only can get up to 1-minute and is not real time. It's delayed by 20 min &lt;/p&gt;&#xA;" OwnerUserId="13990" LastActivityDate="2015-12-10T05:34:56.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22243" PostTypeId="2" ParentId="22125" CreationDate="2015-12-10T07:12:56.273" Score="2" Body="&lt;p&gt;Have a look at the following discussion between &lt;strong&gt;PCA versus FA&lt;/strong&gt; : &#xA;&lt;a href=&quot;https://stats.stackexchange.com/questions/1576/what-are-the-differences-between-factor-analysis-and-principal-component-analysi&quot;&gt;https://stats.stackexchange.com/questions/1576/what-are-the-differences-between-factor-analysis-and-principal-component-analysi&lt;/a&gt;, and choose what you think is theoretically adequate to your case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[EDIT]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In regards to &lt;em&gt;Risk Monitoring&lt;/em&gt;, &lt;strong&gt;EM Algorithm FA&lt;/strong&gt; could be used to build &lt;em&gt;Latent Factor Models&lt;/em&gt; on &lt;em&gt;Alternative Indexes&lt;/em&gt;. My advice is to access some databases such as : &lt;a href=&quot;http://www.indexiq.com/indexes.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;indexiq&lt;/a&gt;, &lt;a href=&quot;http://ucitsindex.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;alternativeucits&lt;/a&gt;, etc. to obtain sufficient time series (returns) on the different strategies adopted or tracked by your funds. This might be relatively less costly (&lt;em&gt;in terms of Time&lt;/em&gt;) than replicating those third-party index methodologies. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ps: Few data (index strategies) could also be found on Bloomberg such as &lt;em&gt;Newedge CTA Trend&lt;/em&gt;..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once your &lt;em&gt;Multi-Factor Model&lt;/em&gt; is built using &lt;em&gt;EM algorithm&lt;/em&gt; (e.g &lt;em&gt;loading, Score..&lt;/em&gt;), you could derive your &lt;em&gt;Ex-Ante Sigma&lt;/em&gt;, and also easily apply Monte Carlo simulations on your Factors to derive &lt;em&gt;VaR&lt;/em&gt;...&lt;/p&gt;&#xA;" OwnerUserId="18252" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2017-01-05T07:03:36.950" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22244" PostTypeId="1" CreationDate="2015-12-10T07:17:30.617" Score="-2" ViewCount="109" Body="&lt;p&gt;I have only taken one introduction class in finance. However we came along opinions, their pricing, etc. &#xA;We only contemplated being the buyer of a option. If everything works for you apparently you can earn a high yield.&#xA;Thus I'm wondering why a bank (or another institution) would offer options. Say there's a stock which costs \$100. The bank offers a (European) call with a striking price of \$95, so you'll pay \$5 for the option (I know there're other factors which determine the price but want to neglect them here to keep it simple). &#xA;After a certain amount of time the option matures while the stock is at \$110. The bank owes you \$15 (in case of cash settlement which should be the default case in the real world). They sold it for only $5 though and lost money. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;So, why would a bank issue the option at all?&lt;/strong&gt;&#xA;One may argue because they expect the stock to fall but often they do offer both put and call options and on the put option they would only earn what they can sell it for in this case.&lt;/p&gt;&#xA;" OwnerUserId="15773" LastEditorUserId="15773" LastEditDate="2015-12-10T07:29:31.430" LastActivityDate="2015-12-10T11:31:41.987" Title="Why do banks offer options?" Tags="&lt;options&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ClosedDate="2015-12-10T17:01:38.993" ContentLicense="CC BY-SA 3.0" />
  <row Id="22245" PostTypeId="2" ParentId="22244" CreationDate="2015-12-10T09:49:50.930" Score="5" Body="&lt;p&gt;You are neglecting several other things. (1) That deep in the money option is worth far more than 5 USD. (2) The fair price will actually take into account the probability that the stock will rise to $110 at maturity. (3) Also the bank might be hedging some other positions, such as a short call with that long call.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="16472" LastEditDate="2015-12-10T11:31:41.987" LastActivityDate="2015-12-10T11:31:41.987" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22246" PostTypeId="2" ParentId="21773" CreationDate="2015-12-10T12:02:04.720" Score="2" Body="&lt;p&gt;It's &lt;em&gt;more likely&lt;/em&gt; that people are &lt;em&gt;familiar&lt;/em&gt; with the below representation - &lt;a href=&quot;http://www.prenhall.com/behindthebook/0132242265/pdf/Hull-Feature5_Whats_New.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;John Hull&lt;/a&gt; - of a &lt;strong&gt;2-step binomial tree&lt;/strong&gt; that you described. However, by analogy, your representation (&lt;em&gt;although not conventional&lt;/em&gt;) is fine too, as long as &lt;code&gt;S&lt;/code&gt;,&lt;code&gt;u&lt;/code&gt;,&lt;code&gt;d&lt;/code&gt; are materialized by the index increments &lt;code&gt;[i,j]&lt;/code&gt; at each node. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;i++&lt;/code&gt;  for each &lt;code&gt;upward / downward trend&lt;/code&gt; (&lt;em&gt;1 increment&lt;/em&gt;)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;j++&lt;/code&gt; for each &lt;code&gt;uptrend trend&lt;/code&gt; (&lt;em&gt;idem&lt;/em&gt;), whereas &lt;code&gt;j=0&lt;/code&gt; in case of &lt;code&gt;downtrend&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/zg6Jk.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/zg6Jk.png&quot; alt=&quot;Hull 2-step Binomial Tree&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18252" LastActivityDate="2015-12-10T12:02:04.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22247" PostTypeId="2" ParentId="22125" CreationDate="2015-12-10T12:16:41.343" Score="0" Body="&lt;p&gt;Stumbled upon IndexIQ's methodology here: &lt;a href=&quot;http://www.indexiq.com/docs/iqhgms/iiqhedgeiqindexes.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.indexiq.com/docs/iqhgms/iiqhedgeiqindexes.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Might be another alternative to replicate HF returns/risk and risk manage accordingly on a daily basis. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Feel free to comment/discuss.&lt;/p&gt;&#xA;" OwnerUserId="18563" LastActivityDate="2015-12-10T12:16:41.343" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22248" PostTypeId="1" CreationDate="2015-12-10T12:39:45.003" Score="4" ViewCount="1770" Body="&lt;p&gt;recently I started reading the interesting book about option pricing in the stochastic volatility world from Lewis. He gives very interesting and detailed insights about this topic in general.&#xA;However the book does not cover the implied volatility topic. That's why I am interested of how I get implied volatility out of the Heston Model. &#xA;Do I have to calculate an european call price with Heston's formula and then reverse it by the help of Black Scholes to get the implied volatility?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="18620" LastActivityDate="2015-12-10T19:52:27.083" Title="Implied Volatility in Heston Model" Tags="&lt;options&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22250" PostTypeId="2" ParentId="22248" CreationDate="2015-12-10T19:09:26.113" Score="5" Body="&lt;p&gt;The option price with a Heston volatility model depends on the Heston parameters only. That is, the implied volatility parameters does not enter into the Heston option price formula. Unless there is an analytical formula to compute the implied volatility for a given option price, it is impossible to compute the implied volatility directly from the Heston parameters. What people usually do is to first compute the European option, from the Heston volatility process, using either Fourier transformation or Monte Carlo, and then compute the implied volatility using the Newton's method or the bi-section method.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-12-10T19:29:18.963" LastActivityDate="2015-12-10T19:29:18.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22256" PostTypeId="1" CreationDate="2015-12-10T23:32:01.680" Score="2" ViewCount="492" Body="&lt;p&gt;I have many doubts about Which roll date and price adjustment should I use. I need to backtest like 50 diferents futures.&#xA;6 index(mini sp500, Nikkei 225…), 10 Agriculture (soybean, Oat, Corn….),3 Meats (live Cattle, Lean Hog, Feeder Cattle), 8 Currencies (yen , Australian Dollar, Pound, Swiss Franc…), 5 Metals (Silver, Gold, Palladium…), Treasury Notes (10 years, 5 years…), Us Bond 30 year and some more…&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My backtest is for 15 years from 2000 to 2015. I have choosen the backward Panama canal method, rolling with the open interest switch and with a depth #1 in all of then.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is…Is that correct? Or I should use differents kind of methods for the differents kinds of futures(agricultures, metals, currencies…)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another question is that the SCF FUTURES  of some futures have gaps in the graphics. There are severals with this gaps between 2009 until 2012 (the mayority of the currencies and the agricultures futures) . &#xA;The example below is the yen future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/huAbE.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/huAbE.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don’t know why produce this gaps or undiscontinuous bars.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much for your time .&lt;/p&gt;&#xA;" OwnerUserId="18628" LastActivityDate="2021-05-07T14:04:05.413" Title="how to choose a price adjustment, a roll date and a data center for my trading strategy?" Tags="&lt;backtesting&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22257" PostTypeId="2" ParentId="22232" CreationDate="2015-12-11T00:00:01.350" Score="2" Body="&lt;p&gt;State variables are simply variables that matter for the value function, the variable on which the value function depends on if you want. Conceptually, you could think of a state vector containing &lt;em&gt;all&lt;/em&gt; the variables and then removing the variables that don't matter from your state vector.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, the state variables choice really depends on the problem you're trying to solve. For physicist it could be the position of an object, the atmospheric pressure or whatever. For economist it could be the wealth of an agent, the level of capital of a firm, etc. It could be anything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're having hard time figuring out what could it be in your model, try to ask yourself question like : &quot;On what does the decision that I'm trying to understand depend?&quot; or &quot;What could influence the choice of an agent in this economy?&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can provide more details on the problem you're trying to solve if you want a more detailed answer.&lt;/p&gt;&#xA;" OwnerUserId="18053" LastEditorUserId="16160" LastEditDate="2015-12-11T00:32:58.323" LastActivityDate="2015-12-11T00:32:58.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22258" PostTypeId="1" AcceptedAnswerId="22263" CreationDate="2015-12-11T06:27:27.630" Score="2" ViewCount="4607" Body="&lt;p&gt;everyone~ I am a newbee in the quantitative finance and I meet a problem in working out an equity option volatility surface.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We use the reasonable market data to derive the implied volatility, then we use natural cubic spline to build the skew,but we do not know use which method to build the curve of term structure when we want to have a complete volatility surface?&lt;/p&gt;&#xA;" OwnerUserId="18526" LastActivityDate="2015-12-11T10:19:26.777" Title="how to do interpolation in the term structure of volatility surface?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;implied-volatility&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22259" PostTypeId="2" ParentId="22229" CreationDate="2015-12-11T08:09:21.293" Score="2" Body="&lt;p&gt;As I commented, I think this is simply a way to prove that both statements are equivalents, that is when the implication goes in both directions. There are no such things as a definition, it's all about the assumption that you make.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually, a more general point could be the following: $u$ and $d$ are define such that after one period the asset gets $u$ with probability $\hat{p}$ and $d$ with probability $(1-\hat{p})$. Then the following proposition holds :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation} \forall \hat{p}\hspace{0.5cm}\exists&#xA; p\in\mathbf{R}\hspace{0.2cm};\hspace{0.2cm}puF_0 + (1-p)dF_0 = F_0 &#xA; \end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is called change of measure in mathematical term. Then risk neutral measure is then obtained by setting $\hat{p}=\frac{1}{2}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should view that as a tool rather than something that is &quot;true&quot; because actually this is a change of measure like any other, there are no risk-neutral probability in the &quot;real&quot; world, it's artificial.&lt;/p&gt;&#xA;" OwnerUserId="18053" LastEditorUserId="848" LastEditDate="2015-12-11T11:38:45.910" LastActivityDate="2015-12-11T11:38:45.910" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="22260" PostTypeId="1" CreationDate="2015-12-11T09:20:06.667" Score="1" ViewCount="837" Body="&lt;p&gt;The theory says that the put and call with the same maturity and strike have the same volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been resolving the Black Scholes equation after IV using equity and fx market data and I can see that the price for the same maturity with the same strike does not match. Does the difference result from the spread or how is this explainable. How many times do the put/call prices allow for arbitrage in reality?&lt;/p&gt;&#xA;" OwnerUserId="18631" LastEditorUserId="2183" LastEditDate="2017-06-26T09:36:08.887" LastActivityDate="2017-06-26T09:36:08.887" Title="Black Scholes Implied Volatility -&gt; Put call parity" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;implied&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22261" PostTypeId="1" AcceptedAnswerId="22271" CreationDate="2015-12-11T09:28:32.347" Score="4" ViewCount="574" Body="&lt;p&gt;Given the PDE&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\partial F}{\partial t} + \frac{1}{2}\sigma^2 \frac{\partial^2 F}{\partial x^2} = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with condition $F(T,x) = x^2$, one can use the &lt;a href=&quot;https://en.wikipedia.org/wiki/Feynman%E2%80%93Kac_formula&quot; rel=&quot;nofollow noreferrer&quot;&gt;Feynman-Kac formula&lt;/a&gt; to arrive at&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$F(t,x) = E[X_T^2 | X_t = x] = E[ (X_t \pm \sigma(W_T - W_t))^2 |X_t = x] = x^2 + (T-t)\sigma^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W_t$ is standard Brownian motion and $X_t$ is the stochastic process satisfying either:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dX_t = \pm \sigma dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the $X_t$'s and $W_t$'s are in the filtered probability space $(\Omega, \mathscr F, \{\mathscr F_t\}_{t \in [0,t]}, \mathbb P)$ where $\mathscr F_t = \mathscr F_t^W$.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I am supposed to evaluate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E[ (X_t \pm \sigma(W_T - W_t))^2 |X_t]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and then later plug in $X_t = x$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apparently, in evaluating such, I am to use the Markov property to say that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E[ (X_t \pm \sigma(W_T - W_t))^2 |X_t] = E[ (X_t \pm \sigma(W_T - W_t))^2 | \mathscr{F_t}]$$&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;&lt;strong&gt;Why exactly do we need to use the Markov property?&lt;/strong&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I know that $W_T - W_t$ is independent of $\mathscr{F_t}$. I think that $\because X_t \in m \mathscr F_t$, $W_T - W_t$ is independent also of $X_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I am wrong, why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I am right, why is the Markov property needed?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The problem seems to be taken from Bjork's Arbitrage Theory in Continuous Time. I got the problem from my class notes. Neither Bjork nor Wikipedia seems to use the Markov property&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/oDUWc.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/oDUWc.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/fKskL.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/fKskL.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/xSHoU.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/xSHoU.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/izmLr.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/izmLr.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="7788" LastEditDate="2015-12-13T15:05:52.680" LastActivityDate="2015-12-13T21:26:58.487" Title="Solving a backwards heat equation using stochastic calculus" Tags="&lt;brownian-motion&gt;&lt;differential-equations&gt;&lt;wienerprocess&gt;&lt;markov&gt;&lt;parabolic-pde&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22262" PostTypeId="2" ParentId="22260" CreationDate="2015-12-11T09:59:29.597" Score="1" Body="&lt;p&gt;European Call/Put parity (Call - Put = Discount x (Forward - Strike)), which is a consequence of the nor arbitrage condition, implies that they should be priced using the same implied volatility. &lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2015-12-11T09:59:29.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22263" PostTypeId="2" ParentId="22258" CreationDate="2015-12-11T10:19:26.777" Score="3" Body="&lt;p&gt;A simple linear interpolation on implied variance along iso-moneyness lines is enough to garantee that there is no arbitrage between maturities as long as the inputted market data is arbitrage free. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically just do a linear interpolation on &#xA;$$&#xA;T \mapsto \sigma(m F(T), T)^2 T &#xA;$$&#xA;where $\sigma(K, T)$ is the implied volatility for strike $K$ and maturity $T$, $F(T)$ is the forward for maturity $T$, and $m$ is the option moneyness. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there are discrete &lt;strong&gt;fixed&lt;/strong&gt; dividends then start by working out the resulting affine relationship &#xA;$$&#xA;F(T) = a(T) S_0 + b(T) &#xA;$$&#xA;then do the linear interpolation on &#xA;$$&#xA;T \mapsto \sigma(b(T) + m (F(T) - b(T)), T)^2 T . &#xA;$$&#xA;This will garantee that there is no arbitrage between volatilities before and after ex-dividend dates. &lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2015-12-11T10:19:26.777" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22265" PostTypeId="2" ParentId="22260" CreationDate="2015-12-11T11:35:11.473" Score="2" Body="&lt;p&gt;I agree to the above answer. The implied volatility should be the same. However if you record the traded option price and derive the implied volatility then these trades should be at the same point in time.&#xA;For example some rarely traded option could be traded at noon - say a call. Then the put is traded some hours later an you take the last traded price of the underlying. &#xA;Then your implied vol could differ.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-12-11T11:35:11.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22266" PostTypeId="1" CreationDate="2015-12-11T11:54:45.240" Score="1" ViewCount="223" Body="&lt;p&gt;Suppose we are given a filtered probability space $(\Omega, \mathscr{F}, \{\mathscr{F}_t\}_{t \in [0,T]}, \mathbb{P})$, where $\{\mathscr{F}_t\}_{t \in [0,T]}$ is the filtration generated by standard $\mathbb P$-Brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $dX_t = \theta_tdt +dW_t$ be an Ito process where $(\theta_t)_{t \in [0,T]}$ is $\mathscr{F}_t$-adapated and $E[\int_0^T \theta_s^2 ds] &amp;lt; \infty$ and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Y_t := X_tL_t, \ \  L_t = \exp Z_t, \ \  Z_t = -\int_0^t \theta_s dW_s - \frac{1}{2}\int_0^t\theta_s^2ds$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose Novikov's condition holds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Prove $Y_t$ is a $(\mathscr{F}_t, \mathbb{P})$-martingale.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I was able to show that $dY_t = (L_t - \theta_tY_t)dW_t$ from deriving that $dZ_t = -\theta_tdW_t -\frac 1 2 \theta_t^2 dt$ and $dL_t = e^{Z_t}(-\theta_tdW_t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming that this is right, does the fact that there is no drift term in $dY_t$ already establish that $Y_t$ is a $(\mathscr{F}_t, \mathbb{P})$-martingale and not merely that it is a local martingale or merely that $E[Y_t | \mathscr{F}_u] = Y_u$?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Edit: It seems that according to &lt;a href=&quot;https://books.google.com.hk/books?id=USvrCAAAQBAJ&amp;amp;pg=PA473&amp;amp;lpg=PA473&amp;amp;dq=when%20is%20a%20driftless%20diffusion%20process%20a%20martingale?&amp;amp;source=bl&amp;amp;ots=_GJ5tkDqdL&amp;amp;sig=lmh0PNXL6TJ19LjZ-Ml6zKiqzjQ&amp;amp;hl=en&amp;amp;sa=X&amp;amp;ved=0ahUKEwjF15aR29TJAhVjL6YKHbw7CdwQ6AEIHzAB#v=onepage&amp;amp;q=when%20is%20a%20driftless%20diffusion%20process%20a%20martingale%3F&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt;, a solution of an SDE is a martingale if it is unique.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;$E[Y_0^2] = E[X_0^2]&amp;lt; \infty$, I guess? No initial condition is given for $X_t$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Show $\exists K \in \mathbb R$ s.t.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;$|L_t - \theta_tx| \le K(1+|x|)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$|(L_t - \theta_tx) - (L_t - \theta_ty)| \le K|x-y|$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$|L_t - \theta_tx| \le |L_t| + |\theta_t||x| \le |\theta_t|(1+|x|)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$|(L_t - \theta_tx) - (L_t - \theta_ty)| \le |\theta_t||x-y|$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't suppose $E[\int_0^T \theta_s^2 ds] &amp;lt; \infty$ means that $\theta_t$ is bounded, does it?&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="7788" LastEditDate="2016-02-23T18:59:59.577" LastActivityDate="2016-02-23T18:59:59.577" Title="Prove uniqueness, and prove $Y_t$ is a martingale by considering $dZ_t$ and $dL_t$" Tags="&lt;stochastic-calculus&gt;&lt;probability&gt;&lt;martingale&gt;&lt;differential-equations&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22268" PostTypeId="1" AcceptedAnswerId="22275" CreationDate="2015-12-11T12:18:20.157" Score="4" ViewCount="281" Body="&lt;p&gt;We are given a filtered probability space $(\Omega, \mathscr{F}, \{\mathscr{F}_t\}_{t \in [0,T]}, \mathbb{P})$, where $\{\mathscr{F}_t\}_{t \in [0,T]}$ is the filtration generated by standard $\mathbb P$-Brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $dX_t = \theta_tdt +dW_t$ be an Ito process where $(\theta_t)_{t \in [0,T]}$ is $\mathscr{F}_t$-adapated and $E[\int_0^T \theta_s^2 ds] &amp;lt; \infty$ and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Y_t := X_tL_t, \ \  L_t = \exp Z_t, \ \  Z_t = -\int_0^t \theta_s dW_s - \frac{1}{2}\int_0^t\theta_s^2ds$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can be shown that &lt;a href=&quot;https://quant.stackexchange.com/questions/22266/prove-y-t-is-a-martingale-by-considering-dz-t-and-dl-t&quot;&gt;$Y_t$ is a $(\mathscr{F}_t, \mathbb{P})$-martingale&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Oh also, Novikov's condition holds. Not sure if that's relevant?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $\frac{d \mathbb Q}{d \mathbb P} = L_T$, prove $E_{\mathbb Q}[X_t | \mathscr F_u] = X_u$.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;What I tried:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By Novikov's $L_t$ is a $(\mathscr{F}_t, \mathbb{P})$-martingale. Then we have that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E[X_tL_t | \mathscr F_u] = X_uE[L_t | \mathscr F_u]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \to E[(X_t - X_u) L_t | \mathscr F_u] = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \to E_{\mathbb Q}[(X_t - X_u) \frac{L_t}{L_T} | \mathscr F_u] = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \to E_{\mathbb Q}[(X_t - X_u) \frac{L_t}{L_T} | \mathscr F_u] = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \to E_{\mathbb Q}[(X_t - X_u) \exp(-Z_T + Z_t) | \mathscr F_u] = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now what? I don't suppose $\exp(-Z_T + Z_t) = 1$...or is it?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Another thing:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E[Y_t | \mathscr F_u] = Y_u$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\to E[X_t L_t | \mathscr F_u] = X_u L_u$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\to E_{\mathbb P}[X_t L_t | \mathscr F_u] = X_u L_u$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\to E_{\mathbb Q}[X_t \frac {L_t}{L_T} | \mathscr F_u] = X_u L_u$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\to ? E_{\mathbb Q}[X_t | \mathscr F_u] E[\frac {L_t}{L_T} | \mathscr F_u] = X_u L_u$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so, I think we have $E[\frac {L_t}{L_T}| \mathscr F_u] = L_u \times$ some integral that will turn out to be 1 probably by mgf, but I don't think mgf applies as $\theta_t$ is not necessarily deterministic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What to do?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Something else I tried:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E_{\mathbb Q}[X_t | \mathscr F_u] = E_{\mathbb Q}[\frac{Y_t}{L_t} | \mathscr F_u] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$= E_{\mathbb P}[\frac{Y_t}{L_t L_T} | \mathscr F_u]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$= E[\frac{Y_t}{L_t L_T} | \mathscr F_u]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$= E[\frac{Y_t}{\exp Z_t \exp Z_T} | \mathscr F_u]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$= \frac{1}{L_u^2} E[Y_t\exp (-Z_T+Z_t) | \mathscr F_u]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like $\exp (-Z_T+Z_t)$ is independent of $\mathscr F_u$, but I don't think&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E[Y_t\exp (-Z_T+Z_t) | \mathscr F_u] = E[Y_t| \mathscr F_u] E[\exp (-Z_T+Z_t) | \mathscr F_u]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or is it? If so, why? If not, what to do?&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2021-01-31T08:50:03.347" Title="Prove $E_{\mathbb Q}[X_t | \mathscr F_u] = X_u$ given $Y_t$ is a martingale" Tags="&lt;stochastic-calculus&gt;&lt;probability&gt;&lt;martingale&gt;&lt;differential-equations&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22269" PostTypeId="1" CreationDate="2015-12-11T12:55:50.370" Score="3" ViewCount="1525" Body="&lt;p&gt;I have a large dataset, 10,000 investments I am trying to create an optimized portfolio for.  The portfolio has 3 restrictions. Long Only, Only 50 assets can be selected and every invested asset has the same weight.  I would like to find the max sharpe portfolio and the minSD portfolio for a given return.    &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; funds = colnames(dfxts)&#xA;&amp;gt; returns = dfxts&#xA;&amp;gt; df.con = portfolio.spec(assets = funds)&#xA;&amp;gt; df.con = add.constraint(portfolio = df.con, type = &quot;long_only&quot;)&#xA;&amp;gt; df.con = add.constraint(portfolio = df.con, type = &quot;box&quot;, min = (1/n - .01/n), max = (1/n + .01/n))&#xA;&amp;gt; &#xA;&amp;gt; df.con = add.constraint(portfolio = df.con, type = &quot;position_limit&quot;, max_pos = n)&#xA;&amp;gt; &#xA;&amp;gt; df.con = add.constraint(portfolio = df.con, type = &quot;return&quot;, return_targe = r)&#xA;&amp;gt; &#xA;&amp;gt; df.con = add.constraint(portfolio = df.con, type = &quot;weight_sum_constraint&quot;, min_sum = .99, max_sum = 1.01)&#xA;&amp;gt; minSDdf &amp;lt;- add.objective(portfolio=df.con, &#xA;+                                  type=&quot;risk&quot;, &#xA;+                                  name=&quot;StdDev&quot;)&#xA;&#xA;opt = optimize.portfolio(R = returns, portfolio = df.con, optimize_method = &quot;DEoptim&quot;, trace = TRUE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is taking over 10 hours to optimize.  How can I change the constraints or optimizer to make this faster?  I would like it to be under 10 minutes if possible.  Thanks,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not sure if this is working correctly.  I edited the objective function in the vignette,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   &amp;gt; OF2 &amp;lt;- function(x, Data) {&#xA;    +  w &amp;lt;- 1/sum(x)&#xA;    +  -(sum(r*w))/(sum(w * w * Data$Sigma[x, x]))&#xA;    +  }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The objective function should return a negative value, but it keeps giving me a positive value?  Why is this happending&lt;/p&gt;&#xA;" OwnerUserId="18603" LastEditorUserId="18603" LastEditDate="2015-12-18T12:26:03.920" LastActivityDate="2015-12-18T12:26:03.920" Title="Portfolio Analytics Optimization" Tags="&lt;r&gt;&lt;portfolio-optimization&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22270" PostTypeId="2" ParentId="22266" CreationDate="2015-12-11T14:10:21.407" Score="4" Body="&lt;p&gt;We consider the case where the Novikov condition is satisfied, that is,&#xA;\begin{align*}&#xA;E\left[\exp\left(\frac{1}{2}\int_0^T \theta^2_s ds \right)\right] &amp;lt; \infty.&#xA;\end{align*}&#xA;Then $\{L_t \mid t \ge 0\}$ is a $(\mathscr{F}_t, \mathbb{P})$-martingale.&#xA;On $\mathscr{F}_T$, we define the probability measure $Q$ by&#xA;\begin{align*}&#xA;\frac{dQ}{dP}\big|_{\mathscr{F}_T} &amp;amp;= L_T\\&#xA;&amp;amp;= \exp\left(-\frac{1}{2}\int_0^T \theta_s^2 ds - \int_0^T \theta_s dW_s \right).&#xA;\end{align*}&#xA;By Girsanov theorem, $X=\{X_t \mid t \ge 0\}$, where&#xA;\begin{align*}&#xA;X_t = \int_0^t \theta_s ds + W_t,&#xA;\end{align*}&#xA;is standard Brownian motion with respect to the measure $Q$, and then it is a $(\mathscr{F}_t, \mathbb{Q})$-martingale. That is, for $0\leq u \leq t \leq T$,&#xA;\begin{align*}&#xA;E_Q(X_t \mid \mathscr{F}_u) = X_u.\tag{1}&#xA;\end{align*}&#xA;On the other hand, by the abstract Bayes formula, &#xA;\begin{align*}&#xA;E_Q(X_t \mid \mathscr{F}_u) &amp;amp;= E_P\left(\frac{L_t}{L_u} X_t \mid \mathscr{F}_u\right)\\&#xA;&amp;amp;= \frac{1}{L_u}E_P\left(L_t X_t \mid \mathscr{F}_u\right).\tag{2}&#xA;\end{align*}&#xA;Combining (1) and (2), we have that&#xA;\begin{align*}&#xA;E_P\left(L_t X_t \mid \mathscr{F}_u\right) = L_u X_u.&#xA;\end{align*}&#xA;That is, $Y=LX$ is a martingale with respect to the measure $P$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-12-11T17:53:32.613" LastActivityDate="2015-12-11T17:53:32.613" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="22271" PostTypeId="2" ParentId="22261" CreationDate="2015-12-11T14:38:26.607" Score="1" Body="&lt;p&gt;Based on the form of your equation, we can consider the SDE&#xA;\begin{align*}&#xA;dX_t = \sigma dW_t, &#xA;\end{align*}&#xA;where $W$  is a standard Brownian motion. Since, for $0 \leq t \leq T$,&#xA;\begin{align*}&#xA;X_T = X_t + \sigma (W_T-W_t),&#xA;\end{align*}&#xA;based on Feynman–Kac formula, the solution is given by&#xA;\begin{align*}&#xA;F(t, x) &amp;amp;= E\left(X_T^2 \mid X_t = x\right)\\&#xA;&amp;amp;=E\Big(\big[x + \sigma (W_T-W_t)\big]^2 \Big)\\&#xA;&amp;amp;=x^2 + (T-t)\sigma^2.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Copied from comment:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Here, the Markov property is not explicitly employed. However, only with the Markov property, we can convert the conditional expectation w.r.t. $\mathscr F_t$ as the conditional expectation w.r.t. $X_t$, and can express the expectation as a function of $X_t$, which can then lead the solution by the Feyman-Kac formula. See the proof in Section 6.4 of the book Stochastic Calculus for Finance II by Shreve.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="7788" LastEditDate="2015-12-13T21:26:58.487" LastActivityDate="2015-12-13T21:26:58.487" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="22275" PostTypeId="2" ParentId="22268" CreationDate="2015-12-11T20:54:59.863" Score="4" Body="&lt;p&gt;By &lt;a href=&quot;https://quant.stackexchange.com/questions/10689/bayes-rule-for-conditional-expectations-proof-review&quot;&gt;Bayes' rule for conditional expectation&lt;/a&gt; (or &lt;a href=&quot;https://books.google.com/books?id=Wk9Ih3uWM10C&amp;amp;pg=PA72&amp;amp;lpg=PA72&amp;amp;dq=%22Bayes%20rule%20for%20conditional%20expectations%22&amp;amp;source=bl&amp;amp;ots=3um4aySsly&amp;amp;sig=rMutqq1wqS6jgylXPTIAPtt64iU&amp;amp;hl=en&amp;amp;sa=X&amp;amp;ved=0ahUKEwjPw7iV19TJAhXjGKYKHcDtArYQ6AEIIjAB#v=onepage&amp;amp;q=%22Bayes%20rule%20for%20conditional%20expectations%22&amp;amp;f=false&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;),&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$E_{\mathbb Q}[X_t | \mathscr F_u] E[L_T| \mathscr F_u] = E[X_tL_T| \mathscr F_u]$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ \to E_{\mathbb Q}[X_t | \mathscr F_u] L_u = E[X_tL_T| \mathscr F_u]$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\to E_{\mathbb Q}[X_t | \mathscr F_u] = E[\frac{X_tL_t}{L_u}| \mathscr F_u]$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$= \frac{1}{L_u} E[ \frac{X_tL_t}{1} | \mathscr F_u]$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$= \frac{1}{L_u} E[ Y_t | \mathscr F_u]$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$= \frac{1}{L_u} Y_u$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$= \frac{1}{L_u} X_u L_u$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$=  X_u $$&lt;/span&gt;&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="7788" LastEditDate="2021-01-31T08:50:03.347" LastActivityDate="2021-01-31T08:50:03.347" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="22276" PostTypeId="1" CreationDate="2015-12-11T21:19:47.530" Score="1" ViewCount="221" Body="&lt;p&gt;Most options traders sell their call options early instead of exercising them, as you would make a bigger profit this way due to being able to salvage some remaining extrinsic value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You bought one contract of $\$10$ strike price call options on $XYZ$ stock for $\$1.00$ when $XYZ$ was trading at $\$10$. Assuming $XYZ$ rises to $\$12$ prior to expiration of the $\$10$ strike price call options and the call options are now worth $\$2.10$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Scenario 1: Exercise the Call Options&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By exercising the call options, the call options cease to exist and you bought $XYZ$ stock at $\$10$. You can now sell those $XYZ$ stocks immediately for its market price of $\$12$ to make a gain of $\$2 - \$1.00$ (price you paid the call options for) = $\$1.00$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Scenario 2: Selling the Call Options&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You simply sell your call options at its market price of $\$2.10$ and make a profit of $\$1.10$.&#xA;As you can see above, selling the call options allows you to salvage that remaining $\$0.10$ of extrinsic value while exercising the call options won't.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have one follow up question based on this scenario: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By selling (writing) the call before expiration and salvaging the remaining $\$0.10$ of extrinsic value, would you not be exposing yourself to risk?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Imagine if the underlying stock were to continue to rise above $\$12$ prior to expiration of the $\$10$ strike price. Then you (as the call writer) would be obligated to sell the underlying at $\$10$ if the buyer of the call were to exercise the option. If the underlying has now risen to $\$14$ prior to expiration then you would be loosing $\$14-\$10=\$4$ upon the buyer exercising. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems to be a reason that you may desire to exercise early and take a guaranteed profit rather than expose yourself to risk if the stock continues to rise before expiration. What would be the best way to mitigate this risk? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me know if my logic is flawed on this conclusion. &lt;/p&gt;&#xA;" OwnerUserId="18638" LastEditorUserId="18638" LastEditDate="2015-12-11T22:57:24.280" LastActivityDate="2016-02-10T07:13:17.197" Title="Analysis of exercising a call option early" Tags="&lt;options&gt;&lt;derivatives&gt;&lt;option-strategies&gt;&lt;american-options&gt;&lt;call&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22277" PostTypeId="2" ParentId="18646" CreationDate="2015-12-11T21:22:44.870" Score="1" Body="&lt;p&gt;Since $\mathbb{E}\left[ \int_0^t f(\tau) \; dW_\tau \right] = \int_0^t f(\tau) \; \mathbb{E}\left[dW_\tau \right] = 0$, $\int_0^t f(\tau) \; dW_\tau$ has zero mean.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\text{var}\left( \int_0^t f(\tau) \; dW_\tau \right) = \mathbb{E}\left[\left( \int_0^t f(\tau) \; dW_\tau \right)^2 \right]-\mathbb{E}\left[ \int_0^t f(\tau) \; dW_\tau \right] = \int_0^t f(\tau)^2  d\tau$ using Ito's isometry as stated by others.&lt;/p&gt;&#xA;" OwnerUserId="3188" LastEditorUserId="3188" LastEditDate="2015-12-13T15:43:55.917" LastActivityDate="2015-12-13T15:43:55.917" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22278" PostTypeId="2" ParentId="22276" CreationDate="2015-12-11T23:09:23.193" Score="1" Body="&lt;p&gt;I don't understand.  You are selling the call option you currently own, so you are left with nothing.  At no point are you naked short the call option.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2015-12-11T23:09:23.193" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22279" PostTypeId="1" AcceptedAnswerId="22282" CreationDate="2015-12-11T23:30:06.403" Score="0" ViewCount="2071" Body="&lt;p&gt;I'm taking a quiz, and trying to calculate the annualized Sharpe ratio of 11 years' worth of SPY fund monthly returns vs. a risk free investment return of 1.5%. When I write the function in Excel as &lt;code&gt;=(AVERAGE(G3:G145)-0.015)/(STDEV(G3:G145)*Sqrt(12))&lt;/code&gt;, I'm getting -0.16. In my spreadsheet, G3:G145 is the range of monthly returns for the SPY fund. The possible answers for the question on the quiz are .56, .53, .50, and .48, so clearly I'm far off. What would be the correct way to write this formula in Excel?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, here are the exact instructions given by the quiz:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The annual Sharpe Ratio calculates the difference between the annual return of a stock and the annual return of a risk-free investment in government bonds - then divides that difference by the annualized standard deviation of returns of the stock.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Estimate the annualized standard deviation of returns by multiplying&#xA;  the monthly population standard deviation of returns by the square&#xA;  root of 12.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="18640" LastActivityDate="2015-12-12T05:13:49.727" Title="Multi-year annualized Sharpe Ratio" Tags="&lt;sharpe-ratio&gt;&lt;investment&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22280" PostTypeId="2" ParentId="2366" CreationDate="2015-12-11T23:31:13.073" Score="1" Body="&lt;p&gt;I have a different take on this.  Listed options such as options on the 10yr Treasury future, are NOT subject to daily variation margin.  That is different to the underlying futures contract, which IS subject to daily variation margin.  Let's say a listed option is 10 points in the money, with a month to go.  If you do not exercise, you have an asset worth 10 points at expiration which you have to fund for a month at the short rate, so it's worth slightly less than 10 points.  If you exercise early, you get a futures contract and then the next day you get 10 points of variation margin delivered to your account, so it's better.  The only thing you have given up is the 10 point out of the money put due to your early exercise.  So the rule of thumb is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Exercise early if :     (short rate * daycount * intrinsic)  &gt; put option given up&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2015-12-11T23:31:13.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22281" PostTypeId="2" ParentId="22135" CreationDate="2015-12-11T23:37:44.313" Score="0" Body="&lt;p&gt;@dm63 has demonstrated in his answer that without additional constraint, the delta in discrete setting can exceed $1$. Analogously, in the continuous time and stock price setting, assume the volatility of stock price below a positive threshold vanishes and is a positive constant above that threshold. Set the European call strike at the threshold. We see that the current European call price is zero when the current price is right below the threshold and positive right above the threshold. So the delta at the threshold is infinity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With additional smoothness and dependency constraints on the volatility, however, the European call delta will be no greater than $1$. I shall supply such a condition and the associated proof.&lt;/p&gt;&#xA;" OwnerUserId="6686" LastEditorUserId="6686" LastEditDate="2015-12-12T03:07:36.083" LastActivityDate="2015-12-12T03:07:36.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22282" PostTypeId="2" ParentId="22279" CreationDate="2015-12-12T05:13:49.727" Score="1" Body="&lt;p&gt;You have to annualize the monthly avg return also: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;=(12*AVERAGE(G3:G145)-0.015)/(STDEV(G3:G145)*Sqrt(12))&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-12-12T05:13:49.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22284" PostTypeId="2" ParentId="22276" CreationDate="2015-12-12T06:08:17.463" Score="1" Body="&lt;p&gt;Just think like this : &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You bought one call option at $\$1$ (Long Position)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You sold one call option at $\$2.10$ (short Position)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both contracts have same maturity and strike price. In this case, gain from Long Position will be cancel out from the loss in short position at the maturity or vice versa such that total pay-off from  both the contract would be zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this way by selling a call option(already having long position in call) you would left with nothing. &lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2015-12-12T06:08:17.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22285" PostTypeId="1" CreationDate="2015-12-12T07:32:08.600" Score="-2" ViewCount="91" Body="&lt;p&gt;I am having a bit of trouble disseminating the true meaning behind VaR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say you have two V Values, prior to taking ABS value. Both values are negative, the first value being -10 and the second value being -20. After taking the ABS Value, the Var answer becomes 10 and 20, respectively. Both values have an 99% Confidence interval.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What value is better? Convention would say, prior to taking ABS, -20 is better, since its further from zero, hence less loss.  But after you take the ABS Value, you are now have a higher degree of loss?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="17928" LastActivityDate="2015-12-12T11:52:47.470" Title="Value at Risk Theory" Tags="&lt;value-at-risk&gt;" AnswerCount="1" CommentCount="2" ClosedDate="2015-12-12T17:48:15.587" ContentLicense="CC BY-SA 3.0" />
  <row Id="22287" PostTypeId="2" ParentId="22285" CreationDate="2015-12-12T11:52:47.470" Score="2" Body="&lt;p&gt;I won't base my answer on your example as i couldn't understand what you mean. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Firstly, when you ask a question &quot;what is better?&quot; you should address this question to the model and not the output values. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly, model is good only when it as accurately as possible explains the reality (with a degree of confidence). The model is useless if it overestimates the risk i.e. there are no overshoots - actual losses never exceed VaR levels. The model is still useless if it underestimates the risk i.e. too many overshoots - actually losses frequently exceed VaR levels. Reasonable model is expected to produce a limited number of overshoots (consistent with a degree of confidence). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tool used to analyse the performance of VaR model is called backtesting.&lt;/p&gt;&#xA;" OwnerUserId="18275" LastActivityDate="2015-12-12T11:52:47.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22288" PostTypeId="1" AcceptedAnswerId="22289" CreationDate="2015-12-12T11:59:53.907" Score="1" ViewCount="17418" Body="&lt;p&gt;I am trying to derive the duration of a perpetual bond with coupon $c$ in two ways:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$D=-\frac{\frac{\partial P}{\partial r}}{P},$$&#xA;$$P=\frac{c}{r}$$&#xA;$$\Rightarrow D = -\frac{-\frac{c}{r^2}}{\frac{c}{r}}=\frac{1}{r}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the second approach, I want to derive the duration using the Macauley Duration (average PV-weighted time to maturity):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$D=\sum_{t=1}^T \frac{c_t}{(1+r)^tP}\cdot t$$&#xA;$$\Rightarrow D=\sum_{t=1}^\infty\frac{ c\cdot t}{(1+r)^t\frac{c}{r}}=\sum_{t=1}^\infty\frac{ r\cdot t}{(1+r)^t}=r\sum_{t=1}^\infty\left(\frac{1}{1+r}\right)^t\cdot t$$&#xA;However, I am unable to show the convergence of this sum to $1/y$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I came as far as to rewriting the sum as:&#xA;$$S_m=\sum_{k=1}^mkx^k=\sum_{k=0}^{m-1}(k+1)x^{k+1}=x+x\sum_{k=1}^{m-1}kx^k+x\sum_{k=1}^{m-1}x^k.$$&#xA;$$\Rightarrow (1-x)S_m=x\frac {1-x^m}{1-x}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For $y&amp;gt;0$ we have $x=\dfrac1{1+r}&amp;lt;1$ and so the sum converges to&#xA;$$\Rightarrow S_m=\frac {x}{(1-x)^2}=\frac {\dfrac1{1+r}}{(1-\dfrac1{1+r})^2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Rightarrow D=\frac {\dfrac{r}{1+r}}{(1-\dfrac1{1+r})^2}$$&#xA;However, I was unable to show the desired result $D=\frac{1}{r}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone show the correct solution?&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2015-12-12T12:05:55.673" LastActivityDate="2017-06-23T05:14:36.013" Title="Duration of perpetual bond" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;duration&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22289" PostTypeId="2" ParentId="22288" CreationDate="2015-12-12T13:49:58.280" Score="3" Body="&lt;p&gt;You were on a right track. In the first approach you've shown Modified Duration of perpetuity is $ModDur=\frac{1}{r}$. In your second approach keep in mind that $ModDur=\frac{MacDur}{(1+y_k/k)}$ so for annual compounding your second approach should converge to $MacDur=ModDur \cdot (1+r) = \frac{1+r}{r}$, which should be the case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S_m=\sum_{k=1}^mkx^k=x+2x^2+3x^3+4x^4+...$$&#xA;now &#xA;$$xS_m=x\sum_{k=1}^mkx^k=x^2+2x^3+3x^4+4x^5+...$$&#xA;subtracting $S_m-xS_m$ we get&#xA;$$S_m-xS_m=x+x^2+x^3+x^4+...+:=A$$&#xA;now we note that $A-xA=x$ which yields $A=\frac{x}{1-x}$ and from &#xA;$S_m-xS_m=\frac{x}{1-x}$ we find $S_m$ which is $S_m=\frac{x}{(1-x)^2}=$ and in your notions $x=\frac{1}{1+r}$ so $S_m=\frac{1}{1+r}\cdot(1-\frac{1}{1+r})^{-2}=\frac{r+1}{r^2}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;now we substitute the result into your formula&#xA;$$MacDur=r\sum_{t=1}^\infty\left(\frac{1}{1+r}\right)^t\cdot t = r \cdot\frac{r+1}{r^2}=\frac{r+1}{r}$$&lt;/p&gt;&#xA;" OwnerUserId="18275" LastEditorUserId="18275" LastEditDate="2015-12-12T19:52:59.797" LastActivityDate="2015-12-12T19:52:59.797" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22290" PostTypeId="1" CreationDate="2015-12-12T17:20:55.747" Score="1" ViewCount="83" Body="&lt;p&gt;I encounter a problem: do we have the following equality : &#xA;$B(0,T_{i})e^{\int_{0}^{t}r_{s}ds}=B(t,T_{i})$ and if yes why because I am stuck with this ... I try to use that : $B(t,T_{i}) = B(0,T_{i})e^{\int_{0}^{t}r_{s}ds-0.5\int_{0}^{t}vol^{2}ds+\int_{0}^{t}voldW_{s}}$&#xA;Thanks !&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question revised:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually my question is the following : the forward price at t is defined by :$F_{t,T}=Price(t)/B(t,T)$. Let be $Price(t)=E_{Q}[e^{-\int_{t}^{T}r_{s}ds}Payoff|F_{t}]$. By using the forward measure defined by : $dQ^{T}=(e^{-\int_{0}^{T}r_{s}ds}/B(0,T) )dQ$ we have that : $Price(t)=E_{Q^{T}}[e^{-\int_{t}^{T}r_{s}ds}Payoff*B(0,T)/e^{-\int_{0}^{T}r_{s}ds}|F_{t}]$. I need to prove that this last equality is $E_{Q^{T}}[Payoff|F_{t}]*B(t,T)$ so that $Price(t)/B(t,T)=E_{QT}[Payoff|F_{t}]$ which is a &quot;formula&quot; I know.&lt;/p&gt;&#xA;" OwnerUserId="15738" LastEditorUserId="15738" LastEditDate="2015-12-13T18:04:30.197" LastActivityDate="2015-12-13T18:32:14.883" Title="zero coupon problem calculus" Tags="&lt;options&gt;&lt;stochastic-calculus&gt;&lt;pricing&gt;&lt;zero-coupon&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22291" PostTypeId="2" ParentId="22290" CreationDate="2015-12-12T17:56:59.783" Score="1" Body="&lt;p&gt;The first equation looks correct if B(t,T(i)) is a &lt;strong&gt;forward price&lt;/strong&gt; of an instrument paying no dividends.  The second equation looks correct if B(t,T(i)) is a &lt;strong&gt;random variable&lt;/strong&gt; being projected by a lognormal process&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2015-12-12T17:56:59.783" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22292" PostTypeId="1" AcceptedAnswerId="22296" CreationDate="2015-12-12T19:27:17.980" Score="3" ViewCount="150" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Consider a basket with $K=10$ names. Default times of the names,&#xA;  $\tau_k$, are i.i.d. random variables with distribution $P(\tau_k \leq&#xA;t) = 1 - e^{-\lambda t}$. Suppose that each name in the basket has a&#xA;  notional $N_k = N$, the basket notional, $N=KN$, the discount factors,&#xA;  $D(t) = exp(-rt)$. Denote by $s$ the payment rate (also called the&#xA;  spread). Denote by $T$ the maturity of the &lt;strong&gt;$m$-to-default&lt;/strong&gt; BDS written on&#xA;  this basket. Assume that the number of payment dates in $M$.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Find the value of the default and premium legs for $m=1$ and $m=2$.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My attempt: &#xA;For $m=1$: Let the random variable $\tau^* = \min_{i\in \{1,...,K \}}\tau_i$ denote the first order statistic. The distribution of $\tau^*$ is easily calculated:&#xA;$$ f_{\tau_1^*}(t) = {K \choose 1} f_{\tau}(t) F_{\tau}(t)(1-F_{\tau}(t))^{k-1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $T_1,...T_M$ denote the term structure of payment dates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The event {$\tau^*&amp;lt;T_i$} implies that the first default occurred before $T_i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the default leg, I think:&#xA;$$V_0^{Def} =  E_0^{Q}[\sum_{i=1}^Me^{-rT_i} s *N*\mathbb{1}_{{0&amp;lt;\tau ^* &amp;lt;T_i}}]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I unsure about this logic. I have little background with these financial terms. &lt;/p&gt;&#xA;" OwnerUserId="20156" LastActivityDate="2016-01-23T18:47:10.787" Title="Pricing homogeneous Basket Default Swap" Tags="&lt;option-pricing&gt;&lt;pricing&gt;&lt;swaps&gt;&lt;default-probability&gt;&lt;basket&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22293" PostTypeId="2" ParentId="22290" CreationDate="2015-12-12T20:38:26.153" Score="1" Body="&lt;p&gt;Let $r_t$ be the interest rate. Then &#xA;\begin{align*}&#xA;B(t, T_i) &amp;amp;= E\Big[e^{\big(-\int_t^{T_i} r_s ds\big)} \mid \mathscr{F}_t\Big]\\&#xA;&amp;amp;= e^{\int_0^t r_s ds} E\Big[e^{\big(-\int_0^{T_i} r_s ds\big)} \mid \mathscr{F}_t\Big].&#xA;\end{align*}&#xA;Note that, for $t&amp;gt;0$, unless $r_t$ is deterministic,&#xA;\begin{align*}&#xA; E\Big[e^{\big(-\int_0^{T_i} r_s ds\big)} \mid \mathscr{F}_t\Big] &amp;amp;\ne  E\Big[e^{\big(-\int_0^{T_i} r_s ds\big)}\Big]\\&#xA;&amp;amp;= B(0, T_i),&#xA;\end{align*}&#xA;as $$E\Big[e^{\big(-\int_0^{T_i} r_s ds\big)} \mid \mathscr{F}_t\Big]$$ is an $\mathscr{F}_t$ measurable random variable, while $$E\Big[e^{\big(-\int_0^{T_i} r_s ds\big)}\Big]$$ is a constant. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In conclusion, the identity $B(0,T_{i})e^{\int_{0}^{t}r_{s}ds}=B(t,T_{i})$ is &lt;strong&gt;incorrect&lt;/strong&gt;, unless the interest rate is deterministic.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Addition based on the revision.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Consider the payoff $Payoff_T$ at time $T$. Then the value at time $t$, where $0 \le t \le T$, under the risk-neutral probability measure $Q$, is given by&#xA;\begin{align*}&#xA;Price(t) = E_Q\left(e^{-\int_t^T r_s ds} Payoff_T \mid \mathscr{F}_t\right).&#xA;\end{align*}&#xA;Let $Q_T$ be the $T$-forward probability measure. Then,&#xA;\begin{align*}&#xA;\eta_t &amp;amp;\equiv \frac{dQ}{dQ_T}\big|_{\mathscr{F}_t}\\&#xA;&amp;amp;=\frac{e^{\int_0^t r_s ds} B(0, T)}{B(t, T)}.&#xA;\end{align*}&#xA;Using the abstract Bayes formula, &#xA;\begin{align*}&#xA;E_Q\left(e^{-\int_t^T r_s ds} Payoff_T \mid \mathscr{F}_t\right) &amp;amp;= E_{Q_T}\left(\frac{\eta_T}{\eta_t}e^{-\int_t^T r_s ds} Payoff_T \mid \mathscr{F}_t\right)\\&#xA;&amp;amp;=B(t, T) E_{Q_T}\left( Payoff_T \mid \mathscr{F}_t\right).&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;E_{Q_T}\left( Payoff_T \mid \mathscr{F}_t\right) = \frac{Price(t)}{B(t, T)}.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-12-13T18:32:14.883" LastActivityDate="2015-12-13T18:32:14.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22294" PostTypeId="1" AcceptedAnswerId="22297" CreationDate="2015-12-12T20:53:17.407" Score="3" ViewCount="3241" Body="&lt;p&gt;It is known that a perpetual bond with coupon $c$ has price&#xA;$$P=\frac{c}{r}$$&#xA;How do you get to this price? Is $r$ stated in discrete or continuous compounding?&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2019-05-15T14:13:15.130" Title="Derive Perpetual Bond Price" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;bond-yields&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22296" PostTypeId="2" ParentId="22292" CreationDate="2015-12-12T21:54:13.763" Score="4" Body="&lt;p&gt;Let $\tau_{(1)} = \min(\tau_1, \ldots, \tau_K)$ be the first-to-default time. Moreover, for $1&amp;lt; m \le K$, let&#xA;\begin{align*}&#xA;\tau_{(m)} = \min\left(\tau_k: k=1, \ldots, K, \tau_{k} &amp;gt; \tau_{(m-1)}\right).&#xA;\end{align*}&#xA;be the $m^{\rm th}$-to-default time. In particular, $\tau_{(K)} = \max(\tau_1, \ldots, \tau_K)$.&#xA;Note that, for $t \ge 0$,&#xA;\begin{align*}&#xA;P\left(\tau_{(1)} &amp;gt; t\right) &amp;amp;= \prod_{i=1}^K P(\tau_i &amp;gt; t)\\&#xA;&amp;amp;=e^{-K \lambda t}.&#xA;\end{align*}&#xA;Then, the density function is of the form&#xA;\begin{align*}&#xA;\frac{d P\left(\tau_{(1)} \le t\right)}{dt} &amp;amp;= K \lambda\, e^{-K \lambda t}.&#xA;\end{align*}&#xA;Generally, for $1 \le m \le K$, the event $\left(\tau_{(m)} &amp;gt; t\right)$ happens as long as there are $K-m+1$ defaults happen later than time $t$, while the remaining $m-1$ defaults happens earlier than $t$.&#xA;That is,&#xA;\begin{align*}&#xA;P\left(\tau_{(m)} &amp;gt; t\right) &amp;amp;= \sum_{j=K-m+1}^K&#xA;\sum_{\pi \in \Pi_j}\prod_{i_k \in \pi}P(\tau_{i_k} &amp;gt; t) \prod_{i_l \not\in \pi}P(\tau_{i_l} \le t)\\&#xA;&amp;amp;=\sum_{j=K-m+1}^K {K \choose j} e^{-j\lambda t} \Big(1-e^{-(K-j)\lambda t} \Big),&#xA;\end{align*}&#xA;where $\Pi_j$ denotes the family of subsets of $(1, \ldots, K)$ consisting of $j$ elements. Here, $ \prod_{i_l \not\in \pi}P(\tau_{i_l} \le t)=1$, if $j=K$.&#xA;The density function is then  given by&#xA;\begin{align*}&#xA;\sum_{j=K-m+1}^K {K \choose j} \lambda\, e^{-j\lambda t}\Big(j-Ke^{-(K-j)\lambda t} \Big).&#xA;\end{align*}&#xA;We consider the first-to-default case below, that is, $m=1$. The general $m^{\rm th}$-to-default case is similar based on the density function above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $R$ be the recovery rate (e.g., R = 40 %). Note that the &lt;em&gt;default leg&lt;/em&gt; is also called the &lt;em&gt;protection leg&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Default Leg.&lt;/strong&gt; &#xA;The value of the default leg, if we assume that the default payment is made at the default time, is given by&#xA;\begin{align*}&#xA;(1-R)N \, E\Big( D\big(\tau_{(1)}\big) 1_{0 &amp;lt; \tau_{(1)} \le T} \Big) &amp;amp;= (1-R)N K \lambda \int_0^T e^{-(r+K \lambda)t}dt\\&#xA;&amp;amp;=\frac{(1-R)N K \lambda}{r+K \lambda}\left(1- e^{-(r+K \lambda)T}\right).&#xA;\end{align*}&#xA;However, if we assume that the default payment is made at the next premium payment date, then the value of the default leg is given by&#xA;\begin{align*}&#xA;(1-R)N \, E\left(\sum_{j=1}^M D(T_j) 1_{T_{j-1} &amp;lt; \tau_{(1)} \le T_j} \right) &amp;amp;= (1-R)N K \lambda\sum_{j=1}^M e^{-rT_j} \int_{T_{j-1}}^{T_j} e^{-K \lambda t}dt\\&#xA;&amp;amp;=(1-R)N \sum_{j=1}^M e^{-rT_j} \left(e^{-K \lambda T_{j-1}} - e^{-K \lambda T_j}\right).&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Premium Leg.&lt;/strong&gt;&#xA;For $j=1, \ldots, M$, let $\Delta T_j = T_j - T_{j-1}$. We assume that the premium $s$, for the payment period $(T_{j-1}, \, T_j]$ $(j=1, \ldots, M)$, is paid at the end date $T_j$. Moreover, the &lt;em&gt;accrued interest to default&lt;/em&gt;, $s(\tau_{(1)}-T_{j-1}) 1_{T_{j-1} &amp;lt; \tau_{(1)} \le T_j}$, is also paid at $T_j$. Then value of the premium leg is then given by&#xA;\begin{align*}&#xA;&amp;amp;\ N s E\left(\sum_{j=1}^M D(T_j) \Big[\Delta T_j 1_{\tau_{(1)} &amp;gt; T_j} + \big(\tau_{(1)}-T_{j-1}\big) 1_{T_{j-1} &amp;lt; \tau^* \le T_j} \Big] \right) \\&#xA;=&amp;amp; \ N s\sum_{j=1}^M e^{-r T_j} \bigg[\Delta T_j e^{-K \lambda T_j} + K \lambda \int_{T_{j-1}}^{T_j}(t-T_{j-1})e^{-K \lambda t} dt \bigg]\\&#xA;\approx&amp;amp; \ N s\sum_{j=1}^M e^{-r T_j} \bigg[\Delta T_j e^{-K \lambda T_j} +\frac{\Delta T_j}{2} \left(e^{-K \lambda T_{j-1}} - e^{-K \lambda T_j}\right) \bigg].&#xA;\end{align*}&#xA;For the last step, we basically assume that, if the default happens, it happens in the middle of the payment period.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-01-23T18:47:10.787" LastActivityDate="2016-01-23T18:47:10.787" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22297" PostTypeId="2" ParentId="22294" CreationDate="2015-12-12T22:50:23.640" Score="5" Body="&lt;p&gt;A Consol Bond is a bond that pays an annual coupon of c every year. Therefore its price is $P=\frac{c}{1+r}+\frac{c}{(1+r)^2}+\cdots$.  Factoring out the c and using the known formula for a geometric series, namely $u+u^2+u^3+\cdots = \frac{u}{1-u}$ we get $P=c[\frac{1}{1+r}/(1-\frac{1}{1+r})]=\frac{c}{r}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly this is a discrete compounding, not continous compounding formula.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-12-12T22:50:23.640" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22298" PostTypeId="1" CreationDate="2015-12-13T08:18:07.173" Score="2" ViewCount="1448" Body="&lt;p&gt;In an NBIM paper I read the following: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;... one can break down the total equity return into the dividend&#xA;  yield (the starting valuation), the change in the P/E ratio (the&#xA;  change in valuation) and the growth in dividends (or earnings) per&#xA;  share.&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This breakdown is claimed to be an accounting exercise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not see how these three components together form the equity return. In additon, how does this breakdown relates to this formula capturing equity return: $\frac{P_{1}-P_{0} + D}{P_0}$, with $P_1 - P_0$ the stock price increase and $D$ the dividend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.nbim.no/en/transparency/discussion-notes/2012/economic-growth-and-equity-returns/&quot; rel=&quot;nofollow&quot;&gt;http://www.nbim.no/en/transparency/discussion-notes/2012/economic-growth-and-equity-returns/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18653" LastActivityDate="2015-12-14T10:10:47.347" Title="Drivers of equity returns: dividend yield, change in P/E and dividend (or earnings) growth" Tags="&lt;equities&gt;&lt;returns&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22299" PostTypeId="2" ParentId="22135" CreationDate="2015-12-13T09:45:56.613" Score="6" Body="&lt;p&gt;It is false. Here is an example. Let&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;dS_t = rS_t dt + f(S_0) S_t dW_t,&#xA;$$&lt;/span&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;dB_t = r dt. &#xA;$$&lt;/span&gt;&#xA;The price is then the Black-Scholes price with volatility &lt;span class=&quot;math-container&quot;&gt;$f(S_0).$&lt;/span&gt; The delta is the BS delta plus&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;f'(S_0) \times \operatorname{BS Vega}.&#xA;$$&lt;/span&gt;&#xA;Picking &lt;span class=&quot;math-container&quot;&gt;$f$&lt;/span&gt; appropriately, we can make the Delta as big as we like. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the example is highly artificial in that volatility is a function of &lt;span class=&quot;math-container&quot;&gt;$S_0$&lt;/span&gt; rather than &lt;span class=&quot;math-container&quot;&gt;$S_t.$&lt;/span&gt;&lt;/p&gt;&#xA;" OwnerUserId="1809" LastEditorUserId="20454" LastEditDate="2018-11-21T21:17:46.407" LastActivityDate="2018-11-21T21:17:46.407" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="22300" PostTypeId="2" ParentId="16688" CreationDate="2015-12-13T11:39:44.000" Score="0" Body="&lt;p&gt;ki3i:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A less heuristic proof is the following. Define the function $Y(t,T,\mathcal{P})$ such that, for each partition $\mathcal{P}$ (of size $n$) of the interval $[t,T]$, we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;Y(t,T,\mathcal{P}) := -\sum\limits_{i=1}^{n} f(t,s_{i})(s_{i + 1} - s_{i}) = -\sum\limits_{i=1}^{n} f(t,s_{i})\Delta s_i\,.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Observe that,&#xA;$$&#xA;\begin{eqnarray*}&#xA;\sum\limits_{j=1}^{n}\frac{\partial}{\partial f_{t, s_{j}}} Y(t,T,\mathcal{P}) ~\mathrm df(t,s_{j}) = -\sum\limits_{i=1}^{n} 1\cdot\mathrm df(t,s_{i})\Delta s_i\,.\tag{1}\newline&#xA;\sum\limits_{j=1}^{n}\frac{1}{2}\frac{\partial^2}{\partial f^2_{t, s_{j}}} Y(t,T,\mathcal{P}) ~\mathrm d\langle f\rangle_{t,s_{j}} = -\sum\limits_{i=1}^{n} 0\cdot \mathrm d\langle f\rangle_{t,s_{t_i}}\Delta s_i = 0\,.\tag{2}\newline&#xA;\sum\limits_{j&amp;lt;r=1}^{n}\frac{\partial^2}{\partial f_{t, s_{j}}\partial f_{t, s_{r}}} Y(t,T,\mathcal{P}) ~\mathrm d\langle f, f\rangle_{t,s_{j},s_{r}} = -\sum\limits_{i&amp;lt;r=1}^{n} 0\cdot ~\mathrm d\langle f, f\rangle_{t,s_{i},s_{r}}\Delta s_i = 0\,.\tag{3}&#xA;\end{eqnarray*}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, by &lt;a href=&quot;http://en.wikipedia.org/wiki/It%C5%8D%27s_lemma#Mathematical_formulation_of_It.C5.8D.27s_lemma&quot; rel=&quot;nofollow&quot;&gt;Ito's Lemma&lt;/a&gt;, $(1)$, $(2)$ and $(3)$ imply that&#xA;$$&#xA;\mathrm dY(t,T,\mathcal{P}) = \frac{\partial}{\partial t}Y(t,T,\mathcal{P})~\mathrm dt - \sum\limits_{i=1}^{n} \mathrm df(t,s_{t_i})\Delta s_i\,.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means that, for each partition $\mathcal{P}^{'}$ (of size $m$) of the interval $[0,t]$, we have&#xA;$$&#xA;\begin{array}{rcl}&#xA;\displaystyle \sum\limits_{k=0}^{m} \Delta Y_{k}(s_k, T, \mathcal{P}) &amp;amp;=&amp;amp; \displaystyle \sum\limits_{k=0}^{m}\left(\frac{\partial}{\partial t}Y(s_k, T, \mathcal{P})\right)\Delta s_k - \sum\limits_{i=1}^{n} \left(\sum\limits_{k=0}^{m} \Delta f_k(s_k,s_{i})\right)\Delta s_i\,. \\&#xA;&amp;amp;&amp;amp;\\&#xA;\mbox{So, }\displaystyle \,\,\lim\limits_{\|\mathcal{P}\|\rightarrow 0}\sum\limits_{k=0}^{m} \Delta Y_{k} &amp;amp;=&amp;amp;\displaystyle  \lim\limits_{\|\mathcal{P}\|\rightarrow 0} \sum\limits_{k=0}^{m}\left(\frac{\partial}{\partial t} Y(s_k, T, \mathcal{P})\right)\Delta s_k - \lim\limits_{\|\mathcal{P}\|\rightarrow 0}\sum\limits_{i=1}^{n} \left(\sum\limits_{k=0}^{m} \Delta f_k(s_k,s_{i})\right)\Delta s_i \\&#xA; &amp;amp;=&amp;amp;\displaystyle  \sum\limits_{k=0}^{m}\frac{\partial}{\partial t} \left(\lim\limits_{\|\mathcal{P}\|\rightarrow 0} Y(s_k, T, \mathcal{P})\right)\Delta s_k - \sum\limits_{k=0}^{m} \Big(\int\limits_{t}^{T}\Delta f_k(s_k,s)~\mathrm ds\Big)_k \\&#xA;&amp;amp;=&amp;amp;\displaystyle  \sum\limits_{k=0}^{m}\left(\frac{\partial}{\partial t} Y(s_k, T)\right)\Delta s_k -  \int\limits_{t}^{T}\sum\limits_{k=0}^{m} \Big(\Delta f_k(s_k,s)\Big)_k~\mathrm ds \\&#xA;&amp;amp;=&amp;amp;\displaystyle \sum\limits_{k=0}^{m} \left(\frac{\partial}{\partial t} Y(s_k, T)\right)\Delta s_k -  \int\limits_{t}^{T}\Big( f(t, s) -f(0, s) \Big)~\mathrm ds\,. \\&#xA;\therefore\,\, \sum\limits_{k=0}^{m} \Delta Y_{k}(s_k, T)  &amp;amp;=&amp;amp;\displaystyle  \sum\limits_{k=0}^{m} \left(\frac{\partial}{\partial t} Y(s_k, T)\right)\Delta s_k -  \int\limits_{t}^{T}\Big( f(t, s) -f(0, s) \Big)~\mathrm ds \\&#xA;&amp;amp;&amp;amp;\\&#xA;\mbox{Consequently, }\quad\quad&amp;amp;&amp;amp; \\&#xA;Y(t,T) -Y(0,T)&amp;amp;=&amp;amp;\displaystyle \lim\limits_{\|\mathcal{P^{'}}\|\rightarrow 0}\sum\limits_{k=0}^{m} \Delta Y_{k}(s_k, T) \\&#xA;&amp;amp;=&amp;amp;\displaystyle  \lim\limits_{\|\mathcal{P^{'}}\|\rightarrow 0}\sum\limits_{k=0}^{m}\left(\frac{\partial}{\partial t} Y(s_k, T)\right)\Delta s_k - \int\limits_{t}^{T}\Big( f(t, s) -f(0, s) \Big)~\mathrm ds \\&#xA;  &amp;amp;=&amp;amp;\displaystyle  \int\limits_{0}^{t} \left(\frac{\partial}{\partial t}Y(s,T)\right)\mathrm ds - \int\limits_{t}^{T}\Big( f(t, s) -f(0, s) \Big)~\mathrm ds\,.&#xA;\end{array}&#xA;$$&#xA;Or, if you prefer the SDE form,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;$$&#xA; \mathrm dY(t,T) = \Big(\frac{\partial}{\partial t} Y(t,T)\Big)\mathrm dt - \int\limits_{t}^{T} \Big(\mathrm df(t, s)\Big) ~\mathrm ds\,.&#xA;$$&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Admittedly, this is not as &quot;air tight&quot; as it can be. For instance, above, I &lt;strong&gt;assumed&lt;/strong&gt; that as a differentiable function of $t$ and $s$ (not a process), $f(t,s)$ is sufficiently smooth to allow the interchange of the limiting operations &quot;$\frac{\partial}{\partial t}$&quot; and &quot;$\|{\mathcal{P}}\|\rightarrow 0$&quot;, and that this is sufficient for the pertinent Ito-integrals to be well-defined and agree.&lt;/p&gt;&#xA;" OwnerUserId="7788" LastActivityDate="2015-12-13T11:39:44.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22301" PostTypeId="1" CreationDate="2015-12-13T11:55:33.690" Score="1" ViewCount="33" Body="&lt;p&gt;I'm working on a model in which there are two processes, $H$ and $L$, and the final variable to model starts as $H$ and then whenever a jump occurs, an instance of the $L$ processes starts and replaces the previous process. The $L$ processes can be reset themselves by the jumps to become a new $L$ process.&#xA;Both $H$ and $L$ have processes with local drift and coefficients, which we can assume to be $\mu_{H/L}(x,t) \in \mathcal{C}^{\infty}(\mathbb{R}^2)$ and $\sigma_{H/L}(x,t) \in \mathcal{C}^{\infty}(\mathbb{R}^2)$ &lt;br/&gt;.&#xA;I wrote down the set of SDE's for the model. I need advice on how to solve them to evaluate the expected value and an european payoff. &lt;br/&gt; &lt;br/&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is Feynman Kac applicable here? Notice that $\tau$ is reset to zero whenever a jump occurs, so a subordinator / stochastic clock method might be useful. &lt;br/&gt;&lt;br/&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The final variable is $x_{B,t}$ . &lt;br/&gt;&#xA;$N_t$ is a counting process, whose jump intensity $\lambda$ is a local function of $x_{B,t}$&#xA;$Y_t$ is an indicator variable denoting whether the first jump has occurred or not.&#xA;$\tau$ is the time that has passed since the last jump.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E\left[dN_t\right] = \lambda(x_{B,t}) \,\,\, ; \,\,\, \lambda \in \mathcal{C}^{\infty}(\mathbb{R}) $ &lt;br/&gt; &lt;br/&gt;&#xA;$dY_t= (1-Y_t) \cdot dN_t \,\,\, ; \,\,\, Y_0= 0$  &lt;br/&gt; &lt;br/&gt;&#xA;$dx_{H,t} = \mu_{H}(x_{H,t},t)\cdot dt + \sigma_{H}(x_{H,t},t) \cdot dW_{1,t}$  &lt;br/&gt; &lt;br/&gt;&#xA;$d\tau = dt + dN_{t} \cdot (-\tau) \,\,\, ; \,\,\, \tau(0) = 0 $  &lt;br/&gt; &lt;br/&gt;&#xA;$dx_{LR,t} =  Y_t \cdot \left[ dN_{t} \cdot (x_{L,0}-x_{LR,t}) + (1-dN_{t}) \cdot \mu_{L}(x_{LR,t},\tau) \cdot dt  +\sigma_{L}(x_{LR,t},\tau) \cdot dW_{2,t} \right]\\ dx_{B,t} = (1-Y_t) \cdot dx_{H,t} +dY_t \cdot (x_{L,0}-x_{B,t}) +d x_{LR,t}$  &lt;br/&gt; &lt;br/&gt;&#xA;$E\left[dW_{1,t} \cdot dW_{2,t}\right]=0$  &lt;br/&gt; &lt;br/&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="18655" LastActivityDate="2015-12-13T11:55:33.690" Title="jump-resetted diffusion process" Tags="&lt;sde&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22302" PostTypeId="1" CreationDate="2015-12-13T12:11:24.393" Score="1" ViewCount="282" Body="&lt;p&gt;I'm a student of financial engineering and am very new to all of this stuff. Now, I'm trying to make an &quot;example of a beginners exercise&quot;, but alas, I don't have any clue on how to solve or even on how to begin this one. The exercise goes like this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Suppose you have a PPPN where the invester recieves at maturity date $80&#xA; \%$ of his investment plus a premium, defined by:  \begin{equation} p&#xA;\cdot N/S_0 \cdot (S_T - S_0)^{+}, \end{equation} where $(S_T -&#xA; S_0)^{+} = \max(S_T - S_0,0)$ is the positive stock return over the&#xA;  period $[0,T]$ ($t=T$ is the time to the Maturity date), an investment $N$ and where $p$&#xA;  is the participation rate. Now, set $p$ such that the product is attractive for investors and you have a certain margin.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In order for this exercise to get more real, I've chosen a stock at random, say Facebook, and assumed a maturity date of 13/12/2016. Here is the information of the stock found today, credits to yahoo finance: &lt;a href=&quot;https://i.stack.imgur.com/XETnb.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/XETnb.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought it would be wise to choose $N= S_0= 102.12$, so that the equation of the premium simplifies to: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation} p \cdot (S_T-102.12)^{+}. \end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, that's where my insights end. I don't have any clue on how to make further progress on this problem. Personally, I would just set $p =100 \%$, so you get the maximum possible return, but that can't be right. Any ideas/pointers/solutions? &lt;/p&gt;&#xA;" OwnerUserId="18656" LastEditorUserId="18656" LastEditDate="2015-12-14T15:32:25.773" LastActivityDate="2015-12-14T15:32:25.773" Title="PPPN: participation rate, stocks and premium" Tags="&lt;equities&gt;&lt;investment&gt;&lt;risk-premium&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22303" PostTypeId="1" CreationDate="2015-12-13T12:41:02.660" Score="1" ViewCount="581" Body="&lt;p&gt;I have the &lt;a href=&quot;https://www.ecb.europa.eu/stats/money/yc/html/index.en.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;nominal spot rate&lt;/a&gt;s. Based on the &lt;a href=&quot;https://en.wikipedia.org/wiki/Fisher_equation&quot; rel=&quot;nofollow noreferrer&quot;&gt;Fisher equation&lt;/a&gt; , how to get the real interest rate ($r$) and the &quot;expected inflation&quot; ($\pi$) ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/UJ38W.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/UJ38W.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Cnlp7.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Cnlp7.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7827" LastEditorUserId="2587" LastEditDate="2015-12-13T16:02:53.213" LastActivityDate="2015-12-13T16:02:53.213" Title="How to get real interest rate from Nominal spot rates?" Tags="&lt;interest-rates&gt;&lt;yield-curve&gt;&lt;inflation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22304" PostTypeId="2" ParentId="22269" CreationDate="2015-12-13T13:36:53.570" Score="2" Body="&lt;p&gt;A problem very similar to yours is described -- including R code -- in a vignette of the NMOF package:&#xA;&lt;a href=&quot;http://cran.r-project.org/web/packages/NMOF/vignettes/LSselect.pdf&quot; rel=&quot;nofollow&quot;&gt;http://cran.r-project.org/web/packages/NMOF/vignettes/LSselect.pdf&lt;/a&gt; &#xA;For the Sharpe ratio, you simply need to write a new objective function.&lt;/p&gt;&#xA;" OwnerUserId="6857" LastActivityDate="2015-12-13T13:36:53.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22305" PostTypeId="2" ParentId="22303" CreationDate="2015-12-13T15:36:18.640" Score="2" Body="&lt;p&gt;There is a market for inflation linked government bonds (some countries e.g. US,CA,UK,FR,Germany,...). There are various prices quoted. The price with inflation lift (the inflation that has accumulated since the inception of the bond) and the price without the lift reflecting future nominal interest and inflation. &#xA;You can calculate the real yield to maturity of inflation linked bonds (using the price without the lift) you get a coupon/yield curve. If you bootstrap this curve then you get a real zero curve. You can subtract nominal rates to get some kind of implied inflation expectation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But note that for example Germany and France issue bonds linked to EMU inflation and I would be surprised if you get the same expected inflation for both bond markets (although they are linked to one and the same).&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-12-13T15:36:18.640" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22306" PostTypeId="2" ParentId="22302" CreationDate="2015-12-13T16:09:46.850" Score="2" Body="&lt;p&gt;In general, PPN is the short form for &lt;em&gt;principal protected notes&lt;/em&gt;. Here, the principal, or notional, $N$ is generally return in full. I am a little confused why only 80 % is returned. It may be a contractual specification, and it is also called a PPN. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the variable interest, or  &lt;em&gt;premium&lt;/em&gt; in your term, is the return that the investor will achieve. In your specification, the variable interest is defined by&#xA;\begin{align*}&#xA;p N/S_0 (S_T-S_0)^+ &amp;amp;= pN \left(\frac{S_T}{S_0} -1 \right)^+.&#xA;\end{align*}&#xA;Note that $\left(\frac{S_T}{S_0} -1 \right)^+$ is the positive part of the return. Here, $p$ is usually called the participation rate, and $N$ is the notional. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In summary, this PPN will return 80 % of the notional $N$ to the investor, and will pay the investor a ratio of $p$ of the final equity return if it is positive. The value of this PPN is the sum of the value of a zero-coupon bond plus a ratio of a European option. The participation rate $p$ can be determined so that the PPN value is higher than the value for a direct deposit into a banking account.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-12-13T16:24:02.560" LastActivityDate="2015-12-13T16:24:02.560" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="22307" PostTypeId="1" CreationDate="2015-12-13T16:55:56.590" Score="2" ViewCount="148" Body="&lt;p&gt;I'm looking at charts of bitcoin here: &lt;a href=&quot;https://bitcoinwisdom.com/markets/kraken/btceur&quot; rel=&quot;nofollow&quot;&gt;https://bitcoinwisdom.com/markets/kraken/btceur&lt;/a&gt; with the option of displaying a short term as well as a long term EMA.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems to me that if I were to buy bitcoin each time the short term EMA raises above the long term EMA, I would make money. I know this is obviously not the case since if it were, everyone would do it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in reality, what actually is the problem with these kind of simplistic strategies? The &quot;strategy&quot; seems to cover every relevant change in market price.&lt;/p&gt;&#xA;" OwnerUserId="18659" LastActivityDate="2017-12-02T09:46:14.533" Title="What's the problem with simple EMA-crossover strategies?" Tags="&lt;fx&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22308" PostTypeId="1" AcceptedAnswerId="22309" CreationDate="2015-12-13T18:02:31.460" Score="1" ViewCount="260" Body="&lt;p&gt;I am a newbie for Libor rates and all these questions...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let be : $L(t,\delta)$ the Libor rate and $L_{t}(T,\delta)$ the forward Libor rate.&#xA;Let's define :&#xA;$Lb(T,\delta):=1+\delta L(T,\delta)=1/B(T,T+\delta)$ and&#xA;$Lb_{t}(T,\delta):=1+\delta L_{t}(T,\delta)=B(t,T)/B(t,T+\delta)$.&#xA;The question is to prove that under the forward measure of maturity $T+\delta$  that both $Lb_{t}(T,\delta)$ and $L_{t}(T,\delta)$ are local martingales.&#xA;I began to define the forward measure of maturity $T+\delta$ (under which the numeraire is $B(T,T+\delta)$ ) :$Q^{T+\delta}$ but it's a lot of calculus. So how can we solve this ? Do we have to start from the model $dB(t,T)/B(t,T)=r_{t}dt+\Gamma (t,T)dW_{t}$ in order to define $dQ(t,T+\delta)=...dQ$ ?&lt;/p&gt;&#xA;" OwnerUserId="15738" LastActivityDate="2015-12-13T18:53:09.297" Title="libor rate - local martingale" Tags="&lt;martingale&gt;&lt;numerairechange&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22309" PostTypeId="2" ParentId="22308" CreationDate="2015-12-13T18:39:24.883" Score="3" Body="&lt;p&gt;By definition, under the $T+\delta$-forward measure, the price of any tradable asset relative to the bond price $B(t, T+\delta)$ is a martingale. Since&#xA;\begin{align*}&#xA;Lb_t(T, \delta) = \frac{B(t, T)}{B(t, T+\delta)},&#xA;\end{align*}&#xA;it is a martingale by definition. Regarding $L_t(T, \delta)$, since&#xA;\begin{align*}&#xA;L_t(T, \delta) = \frac{1}{\delta}\left(\frac{B(t, T)}{B(t, T+\delta)} -1 \right)&#xA;\end{align*}&#xA;is a linear combination of martingales, it is also a martingale. &lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-12-13T18:53:09.297" LastActivityDate="2015-12-13T18:53:09.297" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22310" PostTypeId="1" AcceptedAnswerId="22311" CreationDate="2015-12-13T19:51:11.320" Score="7" ViewCount="321" Body="&lt;p&gt;Various news articles state that next Wednesday a rate hike by the FED was expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet when I look at fed-rate futures, nobody seems to expect that: &lt;a href=&quot;http://www.cmegroup.com/trading/interest-rates/stir/30-day-federal-fund.html&quot; rel=&quot;nofollow&quot;&gt;http://www.cmegroup.com/trading/interest-rates/stir/30-day-federal-fund.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone with industry insight elaborate on what traders expect?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Verbal answers on what is currently expected regarding the FED's rate hike are also accepted.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2015-12-14T18:15:22.880" LastActivityDate="2015-12-14T18:15:22.880" Title="Dec 16: FED rate hike?" Tags="&lt;interest-rates&gt;&lt;banks&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22311" PostTypeId="2" ParentId="22310" CreationDate="2015-12-13T20:36:21.387" Score="12" Body="&lt;p&gt;Fed funds futures settle into the average &lt;a href=&quot;https://apps.newyorkfed.org/markets/autorates/fed%20funds&quot;&gt;daily Fed Funds effective rates&lt;/a&gt; over the month. The December 2015 futures contract therefore covers the current Fed funds target rate (0-25bp) for 16 days, and then the new rate range (expected to be 25-50bp) for 15 days.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To compute the exact probability of a rate hike involves some assumptions. For simplicity, let's ignore the difference between Fed funds target rate and Fed funds effective rate. Further, let's use the mid-point of the Fed funds target &lt;em&gt;range&lt;/em&gt; as the target &lt;em&gt;rate&lt;/em&gt;. For the first 16 days of December then, we are talking about an average realized rate of 12.5 bp (mid point between 0 and 25 bp). As of last Friday, Dec FF contract settled at 99.78, implying a rate of 22bp. To get to this settlement price, the target &quot;rate&quot; for the final 15 days must satisfy&#xA;$$ 22 = \frac{12.5 \times 16 + r \times 15}{31}.$$&#xA;This suggests $r = 32.133333333 \text{ bp}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the only thing left is to compute the probability of a hike. Let $p$ be the probability of a 25 bp hike (from 12.5 to 37.5), and $1-p$ be the probability of being on hold (staying at 12.5). Then we have&#xA;$$ 37.5 p + 12.5\times (1 - p) = 32.1333. $$&#xA;This implies that the market is pricing in a $(32.13 - 12.5)/25 = 79\%$ probability of a rate hike in December.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2015-12-13T23:05:27.377" LastActivityDate="2015-12-13T23:05:27.377" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="22312" PostTypeId="1" CreationDate="2015-12-13T21:24:20.270" Score="2" ViewCount="114" Body="&lt;p&gt;I understand the basics of &quot;Turn of the year&quot; effect. But I am wondering why does this effect sometimes cause overnight rates around year end to dip below normal overnight rate levels (i.e. negative term premium). I can understand the reason of overnight rates showing a spike due to balance sheet dressing/reserve requirements etc. but it is the dip in rates that I cant understand. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;May be it is because of overly aggressive liquidity arrangements by central banks? Appreciate any help.&lt;/p&gt;&#xA;" OwnerUserId="7117" LastEditorUserId="7117" LastEditDate="2015-12-15T23:37:18.727" LastActivityDate="2015-12-15T23:37:18.727" Title="Turn of the year" Tags="&lt;yield-curve&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22314" PostTypeId="1" CreationDate="2015-12-13T22:21:51.283" Score="2" ViewCount="504" Body="&lt;p&gt;We know that issued shares = outstanding shares + treasury shares. So issued shares must be greater than treasury shares by definition. However, Starbucks' fiscal 2014 From 10-K reports &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Common stock ($0.001 par value) — authorized, 1,200.0 shares; issued and outstanding, 749.5 and 753.2 shares, respectively,&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which clearly contradicts with the concept. What is happening here?&lt;/p&gt;&#xA;" OwnerUserId="18661" LastEditorUserId="848" LastEditDate="2015-12-14T10:35:22.630" LastActivityDate="2015-12-14T10:38:49.533" Title="Why is issued shares less than outstanding shares" Tags="&lt;accounting&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22315" PostTypeId="1" CreationDate="2015-12-13T22:25:55.277" Score="1" ViewCount="367" Body="&lt;p&gt;Let $T &amp;gt; 0$. Let $(\Omega, \mathscr F, \{\mathscr F_t\}_{t \in [0,T]}, \mathbb P)$ be a filtered probability space where $\mathscr F_t = \sigma(W_u, u \in [0,t])$ where $W_t$ is standard Brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let the stochastic process $X=(X_t)_{t \in [0,T]}$ solve the SDE&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dX_t = \beta(t,X_t)dt + \sigma(t, X_t)dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with initial condition $X_t = x$ where $x \in \mathbb R$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Prove that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E[g(X_T)|\mathscr F_t] = E[g(X_T)|X_t]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $g$ is a Borel-measurable function and $E[|g(X_T)||X_t=x] &amp;lt; \infty$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;What I tried: $\forall t \in [0,T]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X_t = X_0 + \int_0^t \beta du + \int_0^t \sigma dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Choose $t=T$ to get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X_T = X_0 + \int_0^T \beta du + \int_0^T \sigma dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\to X_T = X_t + \int_t^T \beta du + \int_t^T \sigma dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Define another Borel-measurable function $h(x,y)$ s.t.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$h(X_t, W_t) := g(X_t + \int_t^T \beta du + \int_t^T \sigma dW_t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\to g(X_T) = h(X_t, W_t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\because X_t \in m\mathscr F_t$ and $W_t$ is independent of $\mathscr F_t$, we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E[h(X_t, W_t)|\mathscr F_t] = E[h(x, W_t)]|_{x=X_t} \tag{*}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, $\because X_t \in m\mathscr F_t$, $W_t$ is independent of $X_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\because X_t \in mX_t$ and $W_t$ is independent of $X_t$, we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E[h(X_t, W_t)|X_t] = E[h(x, W_t)]|_{x=X_t} \tag{**}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Combining $(*)$ and $(**)$ gives us what we want. QED&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is that right? Any other assumptions to make such as continuity, integrability or boundedness?&lt;/p&gt;&#xA;" OwnerUserId="7788" LastActivityDate="2017-06-13T21:16:48.310" Title="Prove that $E[g(X_T)|\mathscr F_t] = E[g(X_T)|X_t]$" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;differential-equations&gt;&lt;sde&gt;&lt;markov&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22316" PostTypeId="1" CreationDate="2015-12-14T01:52:27.417" Score="0" ViewCount="99" Body="&lt;p&gt;can someone explain me the usage of local volatility? details will be appreciated. Is it of any importance when I now are doing market-making? Please do not laugh at me as I am totally new in this field. &lt;/p&gt;&#xA;" OwnerUserId="18526" LastActivityDate="2015-12-14T08:40:58.693" Title="does local volatility make any sense when I only focus on vanilla option?" Tags="&lt;options&gt;&lt;local-volatility&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22317" PostTypeId="2" ParentId="22316" CreationDate="2015-12-14T08:40:58.693" Score="1" Body="&lt;p&gt;Local volatility trats volatility as a function of price (St) and time (t), considering volatility constant. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It means that you are building a volatility surface depending on price and time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you are doing is given a certain value of volatility, what will be the price in Xdays long, or viceversa. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are dong market making with plain vanilla options, I will advice you to use Stochastic Volatility models. &lt;/p&gt;&#xA;" OwnerUserId="12089" LastActivityDate="2015-12-14T08:40:58.693" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="22318" PostTypeId="2" ParentId="22298" CreationDate="2015-12-14T10:10:47.347" Score="2" Body="&lt;p&gt;This is really the &lt;a href=&quot;http://scholar.harvard.edu/files/campbell/files/campbellshiller_jf1988.pdf&quot; rel=&quot;nofollow&quot;&gt;Campbell-Shiller (1988)&lt;/a&gt; decomposition: one of the key contributions leading to the 2013 Nobel Prize. The idea is very simple.&#xA;&lt;strong&gt;By definition&lt;/strong&gt;, the return between today and tomorrow is&#xA;$$R_{t+1}=\frac{P_{t+1}+D_t}{P_t}$$&#xA;You can invert this:&#xA;$$P_t = \frac{P_{t+1}+D_t}{R_{t+1}}$$&#xA;Take logs ($log P_t = p_t$ , $logR_{t+1}=r_{t+1}$ , $log D_t=d_t$, $\Delta d_{t+1}=d_{t+1}-d_t$ , $\rho$ is just a constant), take a first order Taylor expansion (details &lt;a href=&quot;http://people.bu.edu/sgilchri/teaching/EC%20745%20Fall%202013/Lecture%20Slides/lecture4_campbell_shiller_decomp.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;):&#xA;$$r_{t+1}= \rho(p_{t+1}-d_{t+1}) - (p_t - d_t) + \Delta d_{t+1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So $-(p_t - d_t)=log \left(\frac{D_t}{P_t} \right)$ is related to the dividend yield, $\rho(p_{t+1}-d_{t+1}) - (p_t - d_t)= log \left(\frac{P_{t+1}}{D_{t+1}}\right)^{\rho} - log \left(\frac{P_{t}}{D_{t}}\right)$ is related to the change price-earnings (proxied by price-dividends ratios), and  $\Delta d_{t+1}$ the growth in dividends. Notice that there is zero economic assumption here (just accounting) and that the only bit of math is the Taylor approximation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, this is very similar to &lt;a href=&quot;https://en.wikipedia.org/wiki/Dividend_discount_model&quot; rel=&quot;nofollow&quot;&gt;Gordon’s growth model&lt;/a&gt; where $P_0 = \frac{D_1}{r-g}$ and therefore&#xA;$$r=\frac{D_1}{P_0} + g $$&#xA;i.e. the return is dividend yield plus its growth&lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2015-12-14T10:10:47.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22319" PostTypeId="2" ParentId="22314" CreationDate="2015-12-14T10:38:49.533" Score="1" Body="&lt;p&gt;Your accounting identity: &quot; issued shares = outstanding shares + treasury shares&quot; is correct, however you are forgetting that treasury shares are registered with a negative sign on balance sheet. So that's why issued shares are lower than outstanding shares.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2015-12-14T10:38:49.533" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="22320" PostTypeId="1" CreationDate="2015-12-14T11:03:50.447" Score="0" ViewCount="124" Body="&lt;p&gt;Reading the book by Andrea Pascucci &quot;PDE and Martingale Methods in Option Pricing&quot;, pp. 84, I found something that appears inconsistent to me. It concerns the construction of the optimal portfolio for an American derivative, whose pay-off a time $t_n$ is indicated by $X_n$. I resume here the main steps. Let $H_n^*$ be the discounted price of the derivative, that is $H_n^*=H_n/(1+r)^n$. No-arbitrage arguments &#xA;define the discounted price as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;H_n^*=\left\{\begin{array}{ll}&#xA;X_N^* &amp;amp; \text{ if }n=N\\&#xA;\max\left(X_n^*,\mathbb{E}^{\mathbb{Q}}\left[H_{n+1}^*\mid\mathcal{F}_n\right]\right)&amp;amp; \text{ if }n=0,...,N-1&#xA;\end{array}&#xA;\right.,&#xA;$$&#xA;so let $E_n$ be defined as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;E_n=\left\{\begin{array}{ll}&#xA;-1 &amp;amp; \text{ if }n=N\\&#xA;\frac{1}{1+r}\,\mathbb{E}^{\mathbb{Q}}\left[H_{n+1}\mid\mathcal{F}_n\right]&amp;amp; \text{ if }n=0,...,N-1&#xA;\end{array}&#xA;\right.,&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;whence $H_n=\max\left(X_n,E_n\right)$. Using the Dobb's decomposition theorem we can write &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;H_n^*=M_n+A_n,&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $M$ is a martingale such that $H_0=H_0^*=M_0$ and $A$ is a predictable decreasing process. Let $\nu_M$ be defined as the maximal time in which it is still optimal to execute the option. It can be shown that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\nu_M=\min\left\{n\mid X_n&amp;gt;E_n\right\}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;H_n^*=M_n\text{ in }\left\{n\leq\nu_M\right\}.\quad (1)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The hedging strategy is defined as the replicating strategy for the European derivative with pay-off $M_N$. It is not need to calculate it for $n&amp;gt;\nu_M$ since it is not optimal to exercise the option after $\nu_M$. &#xA;So it is enough to replicate $M_n$ for $\left\{n\leq\nu_M\right\}$ and hence, thanks to equation (1), it is enough to replicate $H_n^*$ for $\left\{n\leq\nu_M\right\}$. Nevertheless in the book it is said that the&lt;br&gt;&#xA;the components of the replicating portfolio are determined by &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\alpha_{n,k}=\frac{H_{n,k+1}-H_{n,k}}{(u-d)\,S_{n-1,k}},\quad\beta_{n,k}=\frac{u\,H_{n,k}-d\,H_{n,k+1}}{(1+r)^n\,(u-d)}&#xA;$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(which are equations (2.168) of the book at page 84), &#xA;where $S_{n,k}$ is the price of the process at time $n$ when there have been $k$ upward jumps and $n-k$ downward jumps, $u$ and $d$ are the amplitude of the upward and downward jumps respectively, $H_{n,k}$ is the price of the option in the scenario with $k$ upward jumps and $r$ is the risk-free rate.&#xA;The inconsistency comes from the fact that $H_n^*=M_n$ for $n\leq\nu_M$, but $\alpha_n$ and $\beta_n$ are computed replicating $H_n$, while I expected that they should replicate $H_n^*$. So I expected to find&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\alpha_{n,k}=\frac{H^*_{n,k+1}-H^*_{n,k}}{(u-d)\,S_{n-1,k}},\quad\beta_{n,k}=\frac{u\,H^*_{n,k}-d\,H^*_{n,k+1}}{(1+r)^n\,(u-d)}&#xA;$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where is the flaw in my logic? &lt;/p&gt;&#xA;" OwnerUserId="18063" LastEditorUserId="18063" LastEditDate="2015-12-16T10:57:03.297" LastActivityDate="2015-12-16T10:57:03.297" Title="Hedging American Derivative" Tags="&lt;american-options&gt;&lt;replication&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22321" PostTypeId="1" CreationDate="2015-12-14T11:12:12.790" Score="1" ViewCount="31" Body="&lt;p&gt;I've been looking at the currency reserves (COFER) data on the IMF site:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://data.imf.org/?sk=E6A5F467-C14B-4AA8-9F6D-5A09EC4E62A4&amp;amp;ss=1408202647052&quot; rel=&quot;nofollow&quot;&gt;http://data.imf.org/?sk=E6A5F467-C14B-4AA8-9F6D-5A09EC4E62A4&amp;amp;ss=1408202647052&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What caught my eye was the 5% drop in Unallocated Reserves between 2015 Q1 and Q2, from 46.99% to 41.83%. (Previously, since at least 2008, the trend has been a gradual climb upwards.) The claims in all major currencies went up; GBP in particular. I've been trying to understand why, and if this has any relation to economy fundamentals, or if it is just accounting noise?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &quot;About COFER&quot; page tells me &quot;FX reserves do not include holdings of currency by the issuing country&quot;. So that burst the bubble of my first guess of what &quot;unallocated reserves&quot; meant. It goes on to say: &quot;Unallocated Reserves is the difference between the total FX reserves in the IFS (world table on foreign exchange) and the total allocated reserves in COFER. It includes FX holdings of those places that report to IFS but not to COFER.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone explain what that means? (BTW, I've not been able to find the IFS table they are referring to, yet.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A footnote to the COFER reporters page says &quot;China has reported a representative portfolio on a partial basis, and will gradually increase the reported portfolio to full coverage of FX reserve assets within a period of around two to three years.&quot;  (I have to assume they mean 2-3 years from 2015.) Could the jump in allocated reserves be due to that?&lt;/p&gt;&#xA;" OwnerUserId="1587" LastActivityDate="2015-12-14T11:12:12.790" Title="Are COFER unallocated resource changes meaningful?" Tags="&lt;fx&gt;&lt;macro-economics&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22324" PostTypeId="1" CreationDate="2015-12-14T14:14:00.463" Score="2" ViewCount="80" Body="&lt;p&gt;I would like to read something about the cost of risk. Could anyone recommend some reference about how it is calculated or modelled?&lt;/p&gt;&#xA;" OwnerUserId="12214" LastEditorUserId="12214" LastEditDate="2015-12-14T15:51:05.120" LastActivityDate="2015-12-14T15:51:05.120" Title="Modelling the Cost of Risk" Tags="&lt;risk-management&gt;&lt;credit-risk&gt;&lt;self-study&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22325" PostTypeId="2" ParentId="10731" CreationDate="2015-12-14T16:17:56.250" Score="1" Body="&lt;p&gt;For historical data they are the latest bid and ask prices (ie the closing bid/ask prices):&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Source : From bloomberg documentation :&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;PX_BID&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also available as Historical field&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Highest price an investor will accept to pay for a security.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fixed Income: &#xA;   This will return the last available bid price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Loans:&#xA;   The price at which an investor offers to pay to purchase all or part of a loan.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equities: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;If the market is closed, this will return the last bid from the last day the market was open. If the market is open, and there is not a bid in the market, this will return 'N.A.'&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;PX_ASK&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also available as Historical field&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lowest price a dealer will accept to sell a security.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fixed Income: &#xA;   This will return the last available ask price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equities:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;If the market is closed, this will return the last ask from the last day the market was open. If the market is open, and there is not an ask in the market, this will return 'N.A.'&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Economic Statistics:&#xA;   Provides the current release of statistic.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2015-12-14T16:17:56.250" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22328" PostTypeId="1" AcceptedAnswerId="22329" CreationDate="2015-12-14T20:56:03.163" Score="10" ViewCount="3700" Body="&lt;p&gt;I have seen this interview question mentioned in a couple of places:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;There are three call options on the market, with the same expiry and with strikes 10, 20, and 30. Suppose the call option with strike 10 costs \$12, the call option with strike 20 costs \$7, and the call option with strike 30 costs \$1. Is there an arbitrage opportunity?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answer apparently is to buy two of the call options priced at \$20, and sell one of each of the call options priced at \$10 and \$30.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does one arrive at this answer and is it unique?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="18667" LastActivityDate="2015-12-15T13:42:39.870" Title="Arbitrage opportunity interview question" Tags="&lt;options&gt;&lt;arbitrage&gt;&lt;european-options&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="21" ContentLicense="CC BY-SA 3.0" />
  <row Id="22329" PostTypeId="2" ParentId="22328" CreationDate="2015-12-14T21:28:34.643" Score="25" Body="&lt;p&gt;A similar question for put option has been discussed in this question: &lt;a href=&quot;https://quant.stackexchange.com/questions/20771/finding-arbitrage-in-two-puts/20773#20773&quot;&gt;Finding Arbitrage in two Puts&lt;/a&gt;. Basically, the call option payoff is a convex function of the strike. Then the call option price is also a convex function of the strike. Specifically, let $C(K)$ denote the call option price with strike $K$. Then for $ 0 &amp;lt; K_1 &amp;lt; K_2$, &#xA;\begin{align*}&#xA;C\left(\frac{K_1 + K_2}{2}\right) \le \frac{1}{2}\big(C(K_1) + C(K_2) \big).&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the example, let $K_1 = 10$ and $K_2 = 30$. Then&#xA;\begin{align*}&#xA;C(20) &amp;amp;= C\left(\frac{K_1 + K_2}{2}\right)\\&#xA;&amp;amp;\le \frac{1}{2}\big(C(K_1) + C(K_2) \big)\\&#xA;&amp;amp;= \frac{1}{2} (12 + 1) = 6.5.&#xA;\end{align*}&#xA;However, $C(20) = 7$, which contradicts to the above. Therefore, there is an arbitrage opportunity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For an arbitrage strategy, we should short (i.e., sell) the option that is over-priced, and long (i.e., buy) the option that is under-priced. &#xA;Specifically, we short two options with strike 20, and long one option with strike 10 and long another option with strike 30. At the start, we have the profit&#xA;\begin{align*}&#xA;2 \times 7 - 12 - 1 = 1 $.&#xA;\end{align*}&#xA;At the option maturity, the payoff to us is&#xA;\begin{align*}&#xA;(S_T-10)^+ + (S_T-30)^+ - 2 (S_T-20)^+ = &#xA;\begin{cases}&#xA; 0, &amp;amp; \mbox{if } S_T \leq 10,\\&#xA;S_T-10, &amp;amp; \mbox{if } 10 \le S_T \le 20, \\&#xA;30-S_T, &amp;amp; \mbox{if } 20\le S_T \le 30,\\&#xA;0 , &amp;amp; \mbox{if } S_T \ge 30,&#xA;\end{cases}&#xA;\end{align*}&#xA;which is always non-negative. Then, we have a guaranteed profit at the start and potential further profit at the option maturity, while without any liabilities.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2015-12-15T13:42:39.870" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22332" PostTypeId="1" CreationDate="2015-12-15T00:24:40.637" Score="0" ViewCount="140" Body="&lt;p&gt;It is often stated that eurodollar borrowing is clost substitute for Fed funds borrowing. In other words, when US banks cannot fund themselves domestically, they might go to the eurodollar market and borrow some money to satisfy thier reserve requirment. Although it seems intuitive that in eurodollar borrowing you are borrowing from banks in other countries, I believe it implicitly involve a loss of reserve in a US bank. This is because since foreign banks cannot hold reserve at Fed and the borrower wish to borrow reserve, the only way this can happen is for the foreign bank to demand its US correspondant (the US bank where it deposits its dollar) to transfer the amount of reserve to the borrower. So implicity, a US bank is losing its reserve. Am I correct?&lt;/p&gt;&#xA;" OwnerUserId="18661" LastActivityDate="2015-12-15T14:54:00.623" Title="Is Eurodollar borrowing close substitute for Fed funds borrowing?" Tags="&lt;eurodollars&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22333" PostTypeId="2" ParentId="8091" CreationDate="2015-12-15T03:55:38.467" Score="1" Body="&lt;p&gt;About your conclusions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think you're right. Please see this book:&lt;a href=&quot;https://i.stack.imgur.com/pdCEQ.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/pdCEQ.jpg&quot; alt=&quot;Risk Budgeting: Portfolio &quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And this other article by Roncalli:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/tHddz.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/tHddz.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18672" LastActivityDate="2015-12-15T03:55:38.467" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22334" PostTypeId="1" AcceptedAnswerId="22347" CreationDate="2015-12-15T04:55:39.487" Score="0" ViewCount="76" Body="&lt;p&gt;please help me with this problem of double exponential distribution&lt;a href=&quot;https://i.stack.imgur.com/2Yc4e.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/2Yc4e.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18567" LastActivityDate="2015-12-15T21:00:55.370" Title="Please help me with this problem of double exponential distribution" Tags="&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22336" PostTypeId="1" CreationDate="2015-12-15T07:32:43.833" Score="1" ViewCount="402" Body="&lt;p&gt;I recently had a trading interview, and they asked this question. However, I had no idea how to answer it, and I was wondering if you could help me undersatnd it.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Say you have a set of returns applied to an asset value, such as: {5%, -5%, 10%, -10%, 15%, -15%}. What sequence of returns would maximize the final asset value?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I wasn't sure, because wouldn't you end up with the same amount at the end? aka gaining 5% and losing 5% would put you less than you began with, how would you go about this?&lt;/p&gt;&#xA;" OwnerUserId="18674" LastEditorUserId="18677" LastEditDate="2015-12-16T00:16:46.220" LastActivityDate="2016-02-16T23:18:29.547" Title="Trading Interview Question (Bullish, Bearish)?" Tags="&lt;trading&gt;&lt;soft-question&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22337" PostTypeId="2" ParentId="22336" CreationDate="2015-12-15T08:50:38.607" Score="5" Body="&lt;p&gt;It doesn't matter since multiplication is &lt;a href=&quot;https://en.wikipedia.org/wiki/Commutative_property&quot; rel=&quot;nofollow&quot;&gt;commutative&lt;/a&gt; (in $\mathbb{R}$); you will always end up losing the same.&lt;/p&gt;&#xA;" OwnerUserId="16351" LastEditorUserId="467" LastEditDate="2015-12-16T01:03:58.600" LastActivityDate="2015-12-16T01:03:58.600" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22338" PostTypeId="1" CreationDate="2015-12-15T10:29:31.447" Score="2" ViewCount="109" Body="&lt;p&gt;A few days ago, I posted a question about PPPN's (partially principal protected notes), which can be found here:&lt;a href=&quot;https://quant.stackexchange.com/questions/22302/pppn-participation-rate-stocks-and-premium&quot;&gt;PPPN: participation rate, stocks and premium&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A PPPN in short is a structured product where you get for example 80% of your investment plus a premium.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm still trying to understand how this all works, so I'm trying to make some of the example questions, like this one: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\text{premium} = \begin{cases}&#xA;30 &amp;amp;\mbox{if } S_T &amp;gt; K \\&#xA;0 &amp;amp;\mbox{otherwise.}&#xA;\end{cases}&#xA;\end{equation}&#xA;The question is now to determine $K$ using real market data such that the product is attrictive for investors.&#xA;So in order for this exercise to get more real, I've chosen a random stock, say facebook, credits to Yahoo Finance: &#xA;&lt;a href=&quot;https://i.stack.imgur.com/O088N.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/O088N.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But now, since this is a digital option which is not traded in the market, we don't have any prices. I thought maybe I could construct a digital option myself, from call/put options, where the digital option pays 1 if $S_T \geq K$ or 0 if $S_T &amp;lt; K$, but I can't seem to finish that line of thought.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So... Any ideas/hints/solutions?&lt;/p&gt;&#xA;" OwnerUserId="18656" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2015-12-16T16:13:39.607" Title="PPPN: premium with real market data" Tags="&lt;options&gt;&lt;equities&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22339" PostTypeId="1" CreationDate="2015-12-15T13:15:03.200" Score="7" ViewCount="4478" Body="&lt;p&gt;I'm looking for reliable data on US equity fundamentals, but not sure which vendor provides these features:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Unlimited data export&lt;/li&gt;&#xA;&lt;li&gt;Coverage of disbanded entities (bankruptcies, M&amp;amp;A)&lt;/li&gt;&#xA;&lt;li&gt;Financial statements, including values initially stated by the company&lt;/li&gt;&#xA;&lt;li&gt;Historical data prior to 1990&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Does any of the vendors have a comprehensive list of variables available for each company through its platform? Or a sample profile exported from its dataset?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found &lt;a href=&quot;https://wrds-web.wharton.upenn.edu/wrds/demo/demoform_compustat.cfm?&quot;&gt;one for Compustat&lt;/a&gt; and &lt;a href=&quot;https://www.quandl.com/data/ZFB&quot;&gt;Zacks&lt;/a&gt;, but not for the others. Basic financials (earnings, net margin, price) are freely available, but vendors like Capital IQ have a more comprehensive coverage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or maybe some vendor sells all historical data on US public companies as a single dataset?&lt;/p&gt;&#xA;" OwnerUserId="11701" LastEditorUserId="11701" LastEditDate="2015-12-15T13:21:10.407" LastActivityDate="2021-02-01T15:35:29.837" Title="Data exported from Capital IQ, FactSet, Bloomberg, Compustat" Tags="&lt;equities&gt;&lt;data&gt;&lt;historical-data&gt;&lt;fundamentals&gt;&lt;investing&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22340" PostTypeId="2" ParentId="3766" CreationDate="2015-12-15T14:41:48.587" Score="0" Body="&lt;p&gt;In my experience, put dates always fall on coupon dates.  However, exercising the put should still entitle you to the coupon, since you have held the bond for the whole coupon period (or somebody has).  Check the prospectus carefully on that point.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the payment day falls on a non business day, the payment is usually made on the next good business day.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2015-12-15T14:41:48.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22341" PostTypeId="2" ParentId="22332" CreationDate="2015-12-15T14:54:00.623" Score="1" Body="&lt;p&gt;I think you are right that ultimately all dollar movements are reflected in reserve accounts at the Federal Reserve.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;May I make a couple of additional points:  Eurodollar borrowing is really not a close substitute for Fed Funds.  First of all, not much volume goes through the term eurodollar markets, so it doesn't have the capacity to replace Fed Funds borrowing.  In a dire situation where a bank cannot obtain overnight loans in the Fed Funds market, I would think there's no chance it could borrow in the eurodollar market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would add that right now all this is moot, because we are in a situation of massive excess reserves due to Quantitative Easing.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2015-12-15T14:54:00.623" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22344" PostTypeId="2" ParentId="22338" CreationDate="2015-12-15T18:41:47.243" Score="3" Body="&lt;p&gt;To determine the value of $K$, you should have some target in mind, for example, to find the $K$ so that the value of the structured note is at par. Regarding the value of the digital option, there is an analytical formula if you have the volatility and interest rate data, or approximate it by a call spread. See discussions in &lt;a href=&quot;https://quant.stackexchange.com/questions/22096/greeks-for-binary-option/22101#22101&quot;&gt;this question&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2015-12-15T18:41:47.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22345" PostTypeId="2" ParentId="22117" CreationDate="2015-12-15T20:11:49.327" Score="1" Body="&lt;p&gt;$\because M_n$ is a martingale and $T \wedge k$ is bounded, by Doob's optional stopping theorem, we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E[M_{T \wedge k}] = E[M_0] = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\to E[T \wedge k] = \frac{1}{p-q} E[X_{T \wedge k}]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By monotone convergence theorem, we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E[T] = \lim_{k \to \infty} E[T \wedge k]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, by definition of $T$, we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X_{T \wedge k} \le \frac{b}{p-q}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\to E[T] \le \frac{b}{p-q} &amp;lt; \infty \ QED$$&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="7788" LastEditDate="2015-12-15T20:19:15.300" LastActivityDate="2015-12-15T20:19:15.300" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22346" PostTypeId="1" AcceptedAnswerId="22362" CreationDate="2015-12-15T20:17:21.907" Score="0" ViewCount="4426" Body="&lt;p&gt;I am trying to transform &lt;strong&gt;daily simple returns&lt;/strong&gt; into &lt;strong&gt;weekly returns&lt;/strong&gt;. I am using the following R code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(zoo)&#xA;tt &amp;lt;- seq(Sys.Date(), by='day', length=365)&#xA;vals &amp;lt;- data.frame(A=runif(365), B=rnorm(365), C=1:365)&#xA;z &amp;lt;- zoo(vals, tt)&#xA;week &amp;lt;- function(x)format(x, '%Y.%W')&#xA;dailytoweekly &amp;lt;- function(x) (prod(x+1)-1)&#xA;aggregate(z, by=week, FUN=dailytoweekly)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;based on this post: &lt;a href=&quot;https://stackoverflow.com/questions/16442396/convert-daily-to-weekly-monthly-data-with-r&quot;&gt;https://stackoverflow.com/questions/16442396/convert-daily-to-weekly-monthly-data-with-r&lt;/a&gt; .&lt;br&gt;&#xA;The function &lt;code&gt;dailytoweekly&lt;/code&gt; is written on the basis of simple return's time-additive properties. What puzzles me is the result:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&lt;pre&gt;&lt;code&gt;2015.50 19.7687016 -0.88561787 5.039000e+03&#xA;2015.51 19.8390703 -1.21981217 1.729728e+07&#xA;2015.52  4.9931289 -1.76381705 7.343900e+04&#xA;2016.00  2.2251422  2.98725821 7.979000e+03&#xA;2016.01 15.9745238 -1.33997280 5.967562e+09&#xA;2016.02 15.3588303 -0.91805535 3.389158e+10&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Why there is a week 0 in the results and what is it supposed to represent? As there are 53 weeks in total, with indices from 0 to 52 inclusive. Any help on this issue would be appreciated :)&lt;/p&gt;&#xA;" OwnerUserId="17464" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2015-12-16T14:31:18.387" Title="Transforming daily simple returns into weekly" Tags="&lt;time-series&gt;&lt;data&gt;&lt;r&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22347" PostTypeId="2" ParentId="22334" CreationDate="2015-12-15T21:00:55.370" Score="1" Body="&lt;p&gt;Since $f_X(x) &amp;gt; 0$ and &#xA;\begin{align*}&#xA;\int_{-\infty}^{\infty} f_X(x) dx = 1,&#xA;\end{align*}&#xA;$f_X(x)$ is a valid density function. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let&#xA;\begin{align*}&#xA;\varphi(x) =\frac{1}{\sqrt{2\pi}}e^{-\frac{x^2}{2}}&#xA;\end{align*}&#xA;be the density function of a standard normal random variable. We define the measure $\widetilde{P}$ using the Randon-Nykodim derivative&#xA;\begin{align*}&#xA;\frac{d\widetilde{P}}{dP} = \frac{\varphi(X)}{f_X(X)}.&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;\widetilde{P}(X \leq x) &amp;amp;= E_{\widetilde{P}}(1_{X \le x})\\&#xA;&amp;amp;=E_P\left(\frac{d\widetilde{P}}{dP} 1_{X \le x} \right)\\&#xA;&amp;amp;=E_P\left(\frac{\varphi(X)}{f_X(X)} 1_{X \le x} \right)\\&#xA;&amp;amp;=\int_{-\infty}^x \frac{\varphi(x)}{f_X(x)} f_X(x) dx\\&#xA;&amp;amp;=\int_{-\infty}^x \varphi(x) dx.&#xA;\end{align*}&#xA;That is, $X$ is standard normal w.r.t. the measure $\widetilde{P}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The equivalence follows, since&#xA;\begin{align*}&#xA;\frac{dP}{d\widetilde{P}} = \frac{f_X(X)}{\varphi(X)}.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2015-12-15T21:00:55.370" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22349" PostTypeId="1" CreationDate="2015-12-15T22:15:10.177" Score="0" ViewCount="187" Body="&lt;p&gt;My limited understanding of stock prices is that according to theoretical arguments, the price of an asset is generally given as:$$P_{A}=E_{0}\,\sum_{t=0}^{\infty}\frac{C_{t}}{(1+r)^{t}}$$&#xA; whereby $C_{t}$&#xA;  is the coupon promised by the asset and r&#xA;  is our discount rate. The way I have written this above expression corresponds to a consol/perpetuity, but it can (I think) be conceptually extended to stocks and bonds as well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess what I am trying to get at is the fact that asset pricing theory suggests that the price of an asset is the Net Present Value of the future income stream from that asset.To some extent, this is applicable to stocks. The Gordon Growth model is based on this idea. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is how does this relate to the market cap? I mean, the market cap is the stock prices times the number of shares. However, given that the the market cap (under perfect information and only tangible assets) would coincide with the book value, how is the net present value of the income stream related to owner's equity ?&lt;/p&gt;&#xA;" OwnerUserId="17782" LastEditorUserId="17782" LastEditDate="2015-12-15T22:51:30.627" LastActivityDate="2018-01-02T00:31:32.373" Title="Price of a Stock: What is it?" Tags="&lt;equities&gt;&lt;asset-pricing&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22350" PostTypeId="1" CreationDate="2015-12-15T22:37:03.010" Score="0" ViewCount="454" Body="&lt;p&gt;How do you show that being long a caplet and short a floorlet (both with strike K) is equivalent to a Forward Rate Agreement where you pay the fixed rate K?&lt;/p&gt;&#xA;" OwnerUserId="18587" LastActivityDate="2015-12-15T23:24:04.233" Title="Show that being Long a caplet &amp; short floorlet (both with strike price K) is equivalent to a FRA where you pay the fixed rate K" Tags="&lt;libor&gt;&lt;forward-rate&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22351" PostTypeId="2" ParentId="22350" CreationDate="2015-12-15T23:24:04.233" Score="1" Body="&lt;p&gt;yes it is put-call parity:&lt;br&gt;&#xA;long the caplet pays max(0; libor - K)&lt;br&gt;&#xA;short the floorlet pays -max(0; K-libor)&lt;br&gt;&#xA;add them up you always receive libor and pay K&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2015-12-15T23:24:04.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22353" PostTypeId="1" AcceptedAnswerId="31224" CreationDate="2015-12-16T00:15:11.560" Score="6" ViewCount="2487" Body="&lt;p&gt;I am running Monte Carlo simulations for a European Call using &lt;a href=&quot;https://en.wikipedia.org/wiki/Heston_model&quot; rel=&quot;nofollow&quot;&gt;Heston&lt;/a&gt; Model and I am trying to compare them with prices calculated using Black-Scholes formula. I am not quite sure if the prices I get from the Heston model are correct.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Is there any regularity here?&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;What should be the relation between the prices?&lt;/strong&gt; (should a price of a European call from Heston be greater or smaller than from Black-Scholes?)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;br&gt;&#xA;Can anyone explain what the relation should be?&lt;/p&gt;&#xA;" OwnerUserId="18670" LastEditorUserId="18670" LastEditDate="2015-12-17T02:22:43.520" LastActivityDate="2017-01-28T11:33:05.050" Title="How should option prices differ when using the Heston versus the Black-Scholes model?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;heston&gt;" AnswerCount="2" CommentCount="10" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22357" PostTypeId="1" CreationDate="2015-12-16T10:26:58.050" Score="1" ViewCount="150" Body="&lt;p&gt;I am confused as 2 methods give different answers. The difference lies in the &quot;to the power&quot; numbers for discounting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example: 2 year semi annual bond (4 periods), $1m annual Coupon Payment, 5% Yield&#xA;(forget about repayment of principal for simplicity)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Standard formula for discounting coupon payments:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[0.5 * $1m / (1.025)^1]  +  [0.5 * $1m / (1.025)^2]  +  [0.5 * $1m / (1.025)^3]  +  [0.5 * $1m / (1.025)^4] $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ie 4 payments, all discounted with n going from 1 to 4, and cash flow and yield have been halved to £0.5m and 2.5%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BUT&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See Erik Banks' book: &quot;Finance the basics&quot; bottom of page 70 under formula 3.7. It is in Googlebooks: type &quot;time horizon divided by fractional period&quot; into Google&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Everything is the same except the values of n (the power that 1.025 is raised).&#xA;In his version, instead of being 1 to 4 respectively, &lt;code&gt;n&lt;/code&gt; is 1/2, 2/2, 3/2, 4/2&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So each &lt;code&gt;n&lt;/code&gt; is divided by 2, because there are 2 payments each year.&lt;/p&gt;&#xA;" OwnerUserId="18679" LastEditorUserId="18679" LastEditDate="2015-12-16T16:01:18.227" LastActivityDate="2015-12-16T19:38:28.717" Title="Why to 2 methods to calculate bond price with semi annual return give different answers?" Tags="&lt;discounting&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22360" PostTypeId="1" AcceptedAnswerId="22361" CreationDate="2015-12-16T13:50:30.603" Score="3" ViewCount="2052" Body="&lt;p&gt;I've looked through the Bloomberg website, but haven't found any information about available license plans. I'm curious whether it provides any license that allows you to re-distribute data requested from Bloomberg terminal to third-party customers? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or maybe you can provide any link to documents which regulate re-distribution of their data? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="18682" LastEditorUserId="18677" LastEditDate="2015-12-16T14:44:02.477" LastActivityDate="2015-12-16T15:17:42.007" Title="Bloomberg data redistribution policy" Tags="&lt;bloomberg&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22361" PostTypeId="2" ParentId="22360" CreationDate="2015-12-16T14:05:39.963" Score="7" Body="&lt;p&gt;Hit &lt;code&gt;&amp;lt;BREP&amp;gt; GO&lt;/code&gt; on your terminal and ask.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Though if you have just the terminal then the answer is most likely no.  They allow you to publish charts but they consider using an excel sheet that was populated with data from a terminal on another machine to be a violation of the terminal agreement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use their &lt;a href=&quot;http://www.bloomberg.com/enterprise/content-data/market-data/&quot; rel=&quot;nofollow&quot;&gt;B-PIPE,&lt;/a&gt; then the license is  a bit more liberal, data can leave the terminal machine but is still only eligible for use within the firm and you can't store it in a database or other storage mechanism.  Though I think this is probably the most broken rule in finance.  Just slightly above, make sure you have borrow before you issue a short order:)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Market data especially won't be redistrubutable as you have a contract with both Bloomberg and the exchange for market data, and exchanges aren't really known for their &quot;liberal&quot; distribution policies:)&lt;/p&gt;&#xA;" OwnerUserId="743" LastEditorUserId="743" LastEditDate="2015-12-16T15:17:42.007" LastActivityDate="2015-12-16T15:17:42.007" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22362" PostTypeId="2" ParentId="22346" CreationDate="2015-12-16T14:31:18.387" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Why there is a week 0 in the results and what is it supposed to represent?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The answer is found in &lt;code&gt;?strptime&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;'%W' Week of the year as decimal number (00-53) using Monday as&#xA;       the first day of week (and typically with the first Monday of&#xA;       the year as day 1 of week 1).  The UK convention.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Perhaps you were expecting the output from one of the other formats?&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;'%U' Week of the year as decimal number (00-53) using Sunday as&#xA;       the first day 1 of the week (and typically with the first&#xA;       Sunday of the year as day 1 of week 1).  The US convention.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;'%V' Week of the year as decimal number (01-53) as defined in ISO&#xA;       8601.  If the week (starting on Monday) containing 1 January&#xA;       has four or more days in the new year, then it is considered&#xA;       week 1.  Otherwise, it is the last week of the previous year,&#xA;       and the next week is week 1.  (Accepted but ignored on&#xA;       input.)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;You might try see if &lt;code&gt;xts::apply.weekly&lt;/code&gt; solves your problem. Using it will avoid the problem in your question.&lt;/p&gt;&#xA;" OwnerUserId="56" LastActivityDate="2015-12-16T14:31:18.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22364" PostTypeId="1" CreationDate="2015-12-16T15:16:46.067" Score="3" ViewCount="280" Body="&lt;p&gt;Sorry for the newbie inquiry but I'm having a little trouble making sense of stationarity and how a the presence of a time trend impacts this. I'm working on a model for operating margins and as a first step I want to determine if the original series is stationary before proceeding. I first fitted a simple linear trend line to the data and the time regressor, while small in magnitude, registered as highly significant. I was always under the impression that this implied a non constant mean, thus non-stationary and may require a transform or differencing. I decided to regress the first differenced time series on the lag of the original time series and found the regressor of the lagged value to be negative and highly significant (t-stat greater than 9). This is where I got a little confused as these two seem to contradict my understanding of the subject. I thought a rejection of the null: g =0 (Dickey Fuller test) indicated no unit root, thus mean reverting and stationary. This seems to conflict with my initial assessment based on the deterministic time trend component. Thanks in advance! &lt;/p&gt;&#xA;" OwnerUserId="18614" LastActivityDate="2016-12-13T09:27:48.513" Title="Confusion on stationarity vs deterministic trend" Tags="&lt;stationarity&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22365" PostTypeId="2" ParentId="22364" CreationDate="2015-12-16T16:30:55.783" Score="0" Body="&lt;p&gt;A difference-stationary series will not be stationary if it is detrended (regression) and a trend-stationary series will not be stationary if differenced. Trend is deterministic, drift is non-zero expectation of the change. I recommend Enders, Applied Econometric Time Series.&lt;/p&gt;&#xA;" OwnerUserId="18584" LastActivityDate="2015-12-16T16:30:55.783" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22366" PostTypeId="2" ParentId="22228" CreationDate="2015-12-16T17:42:20.847" Score="5" Body="&lt;ol&gt;&#xA;&lt;li&gt;You cannot use negative probabilities in this context. When there is no unique probability measure, there can be no unique price. You only know that it is in [0, 0.6] range, if you want to tighten this interval you need to make further assumptions/tweak inputs&lt;/li&gt;&#xA;&lt;li&gt;I agree with your conclusion that there no suitable probability measure. But I am not sure about your computation. In 3 state world, you only have 2 variables (probabilities of 2 states of your choice), the probability of the third state can be determined from the fact that the sum of probabilities is $1$ - you do not seem to be using this fact! In your case, you have 3 assets, thus no arbitrage 3 equations. Solving 3 equations with 2 variables almost always fail! It would make sense to introduce the third variable, the interest rate. Let the probability of state $1$ be $p$, the probability of state $3$ be q and the interest rate be $r$. Thus for assets $1$ and $3$ we have&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;$p + 2(1 - p - q) + 3q = 2(1+ r)$ and $0.8 p + 1.2(1-p-q) + 1.6 q = 1+r$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is equavalent to $q-p=2r$ and $0.8(q-p) +0.4 = 2r$; this implies that $q-p=2$, which is not solvable if $p,q \in [0;1]$!&lt;/p&gt;&#xA;" OwnerUserId="8051" LastActivityDate="2015-12-16T17:42:20.847" CommentCount="21" ContentLicense="CC BY-SA 3.0" />
  <row Id="22367" PostTypeId="2" ParentId="22357" CreationDate="2015-12-16T17:53:06.843" Score="0" Body="&lt;p&gt;The method for computing yields/prices for US Treasury bonds is highly standardized in the marketplace. It uses semi-annual compounding, like your formula does (as well as specific day count conventions, etc). For the book, annual interest rates are apparently being used; resulting in an unacceptable (wrong) answer as far as bond trading is concerned. (However, for one's own analysis of a problem everyone can of course use the method they prefer, or even make up a new one). For trading the standards of the Securities Industry Association should be followed.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2015-12-16T18:13:02.343" LastActivityDate="2015-12-16T18:13:02.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22368" PostTypeId="1" CreationDate="2015-12-16T18:55:39.453" Score="1" ViewCount="119" Body="&lt;p&gt;I want to study dependence and correlation between bonds and CDS. I have already found &lt;a href=&quot;http://www.datagrapple.com&quot; rel=&quot;nofollow&quot;&gt;a large CDS database of time series there: www.datagrapple.com&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for such a similar database (with an important intersection on the single names) for bonds. Somebody is aware of such free-access database?&lt;/p&gt;&#xA;" OwnerUserId="16457" LastActivityDate="2015-12-16T18:55:39.453" Title="Where can I find bonds time series?" Tags="&lt;fixed-income&gt;&lt;data&gt;&lt;bond&gt;&lt;historical-data&gt;&lt;cds&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22369" PostTypeId="2" ParentId="22357" CreationDate="2015-12-16T19:38:28.717" Score="1" Body="&lt;p&gt;TL;DR: Looks like the book is crap. Switching from annual to semi-annual compounding should give a rather small change in PV.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A payment of 1 at time T, with an annually compounded rate r, is worth $1/(1+r)^T$. With a semi-annual compounded rate s, it is $1/(1+s/2)^{2T}$, which incidentally is $1/(1+s+s^2/4)^T$, so the same as annually compounded to first order (which is just what we want). (While continuously compounded would give you $1/(1+c+c^2/2 + c^3/6 + c^4/24 + \cdots)^T$, again the same to first order).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, you have $s = 0.05$ and 4 payments at times $T = 1/2, 1, 3/2, 2$; thus it is $1/1.025^1 + 1/1.025^2 + 1/1.025^3 + 1/1.025^4$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, with an annual compounded rate of 5% and an annual coupon of \$1m the PV is \$1,849,510; with a semi-annually compounded rate of 5% and a semi-annual coupon of \$0.5m the PV should be \$1,880,987, and not \$1,939,394 as the book appears to be claiming. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(FWIW, what the book actually computed was a semi-annual coupon of \$0.5m discounted with an annually compounded rate of 2.5%, which is perfectly fine per se, but probably not what the author had in mind.)&lt;/p&gt;&#xA;" OwnerUserId="7715" LastActivityDate="2015-12-16T19:38:28.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22370" PostTypeId="2" ParentId="22349" CreationDate="2015-12-16T19:57:57.263" Score="3" Body="&lt;p&gt;I'll attempt an answer here --- but really, this is a relatively straightforward corporate finance question, and indeed, I'd argue this is effectively an accounting question. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have the accounting identity that, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ Assets = Equity + Debt $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At this point, I don't want to get into tax shields, financial distress costs and things of that sort (it's effectively Modigliani and Miller theorems). So to keep things simple, suppose there are no corporate taxes and hence there are no tax shields. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And to furthermore keep things simple, suppose the number of shares outstanding is $N$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the simple discounted cashflow idea, the value of the assets / value of the unlevered firm $U_A$ (note my change in notations to make things clearer) is what you wrote, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ U_A = E_0 \sum_{t = 0}^{\infty} \frac{C_t}{(1 + r)^t} $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the discount rate $r$ is some appropriate cost of capital for discounting the assets. If we invoke the Modigliani and Miller theorems, we can even link this to the weighted average cost of capital (WACC). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose you have outstanding market value of debt as $D$. Then the value of equity for the firm --- again, from the accounting identity --- is, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ E = U_A - D $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The equity price per share (again, another accounting identity) is simply, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ P = \frac{E}{N} $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note the special case when there is no debt, so $D = 0$, the value of the assets would equal to the value of equity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, the key point of my response: Your question is nothing more than playing around with accounting. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Some remarks:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You mention in your comments that you allow for stochastic cash&#xA;flows and stochastic discount rate. The equation that you wrote is&#xA;simply impossible to have any meaningful stochastic discounting. The&#xA;discount rate $r$, as you write it now, is clearly known at $t = 0$.&#xA;Thus, you can pull the entire discount factor $1 / (1 + r)^t$&#xA;outside of the expectation, and indeed, move the expectation&#xA;operator under the summation to just consider $E_0 C_t$. I'm not&#xA;going to be so worried here about integrability issues of doing&#xA;this.&lt;/li&gt;&#xA;&lt;li&gt;There honestly isn't any &quot;asset pricing theory&quot; in this question (at least to me). Your equation is simply a discounted cash flow equation --- this is just a basic concept of &quot;time value of money&quot;, which everybody will understand and accept as long as you agree that &quot;\$1 today is not the same \$1 tomorrow&quot;. The key asset pricing problems are really the determination of the expectation $E_0$ and also the discount rate $r$ (and it's vastly more interesting if you allow the discount rate to be time-varying and stochastic --- which again, you do don't have as you'd written it). The most interesting part is really &lt;em&gt;what drives&lt;/em&gt; the potential time-varying and stochastic behavior of the discount rates --- this is the true study of &quot;asset pricing&quot;. Another highly important study in asset pricing is also how investors form expectation $E_t$ based on their time $t$ information sets of a firm's cash flows. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="17332" LastEditorUserId="17332" LastEditDate="2015-12-16T20:07:05.410" LastActivityDate="2015-12-16T20:07:05.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22371" PostTypeId="1" CreationDate="2015-12-16T20:20:51.143" Score="1" ViewCount="586" Body="&lt;p&gt;I'm trying to calculate VaR for overall option positions. Currently I do a MC simulation for the underlying, and derive the theoretical value of the option from those theoretically. Then I calculate what the position is worth in relationship to the simulated underlying price. Can I then say what the VaR is from the theoretical options prices? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is where I am now, but my VaR numbers don't seem as understandable as the plain underlying calculations. The distribution is my value of the ATM call option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/yV2mw.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/yV2mw.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18688" LastActivityDate="2015-12-16T20:20:51.143" Title="Simulating Option Positions VaR with Monte Carlo in Python" Tags="&lt;monte-carlo&gt;&lt;value-at-risk&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22372" PostTypeId="1" CreationDate="2015-12-16T20:42:46.900" Score="1" ViewCount="1435" Body="&lt;p&gt;I have a quick question about this remark in Tsay's book &quot;Analysis of Financial Time Series&quot; (3rd edition).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/EMsBn.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/EMsBn.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;He says that&#xA;$$ \text{dollar VaR} = \text{Value} \times \text{log return VaR} $$&#xA;and that&#xA;$$ \text{Value} \times [\exp(\text{log return VaR}) - 1] $$&#xA;is an approximation to that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on how quantiles transform, it seems to me that it should be the other way around!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Eq (7.1) for completeness&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/L8xaG.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/L8xaG.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your help!&lt;/p&gt;&#xA;" OwnerDisplayName="user16469" LastEditorDisplayName="user16469" LastEditDate="2015-12-16T22:35:20.187" LastActivityDate="2015-12-16T23:51:55.133" Title="Value at risk in dollars vs. log returns" Tags="&lt;value-at-risk&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22373" PostTypeId="1" AcceptedAnswerId="22383" CreationDate="2015-12-16T23:01:07.857" Score="3" ViewCount="1012" Body="&lt;p&gt;I am trying to estimate &lt;strong&gt;GARCH models&lt;/strong&gt; with the use of Hansen's (1994) skew-t distribution. I am using matlab's &lt;strong&gt;ARMAX-GARCH-K toolbox&lt;/strong&gt;, where the &lt;strong&gt;log-likelihood&lt;/strong&gt; is calculated as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; lamda = parameters(end-1);&#xA; nu = parameters(end);&#xA; c = gamma((nu+1)/2)/(sqrt(pi*(nu-2))*gamma(nu/2));&#xA; a = 4*lamda*c*((nu-2)/(nu-1));&#xA; b = 1 + 3*lamda^2 - a^2;&#xA; indicator1 = ((data(t)-mu(t))./sqrt(h(t))&amp;lt;-a./b);&#xA; indicator2 = ((data(t)-mu(t))./sqrt(h(t))&amp;gt;=-a./b);&#xA; likelihoods1 = log(b) + log(c) - ((nu+1)./2).*log(1+1./(nu-2).*((b.*indicator1.*((data(t)-mu(t))./sqrt(h(t)))+a)./(1-lamda)).^2);&#xA; likelihoods2 = log(b) + log(c) - ((nu+1)./2).*log(1+1./(nu-2).*((b.*indicator2.*((data(t)-mu(t))./sqrt(h(t)))+a)./(1+lamda)).^2); &#xA; likelihoods = - 0.5*log(h(t)) + indicator1.*likelihoods1 + indicator2.*likelihoods2;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;data(t)&lt;/code&gt; stands for returns, &lt;code&gt;mu(t)&lt;/code&gt; is the mean from the GARCH model, &lt;code&gt;h(t)&lt;/code&gt; is the variance from the GARCH model and &lt;code&gt;parameters&lt;/code&gt; are the parameters of the GARCH model. The whole function for calculating the log-likelihood can be found here (viewing without opening matlab): &lt;a href=&quot;https://www.mathworks.com/matlabcentral/fileexchange/32882-armax-garch-k-toolbox--estimation--forecasting--simulation-and-value-at-risk-applications-/content/garchlik.m&quot; rel=&quot;nofollow&quot;&gt;https://www.mathworks.com/matlabcentral/fileexchange/32882-armax-garch-k-toolbox--estimation--forecasting--simulation-and-value-at-risk-applications-/content/garchlik.m&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And the distribution is defined as in the following paper on page 6: &lt;a href=&quot;http://www.ssc.wisc.edu/~bhansen/papers/ier_94.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.ssc.wisc.edu/~bhansen/papers/ier_94.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have two questions:&#xA;1. The square by the b parameter seems to be missing, so after defining b i should take values equal to sqrt(b). Is that right?&#xA;2.Where does the term &lt;code&gt;- 0.5*log(h(t))&lt;/code&gt; in &lt;code&gt;likelihoods&lt;/code&gt; come from? As it does not appear in the pdf function of the skew-t distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would be grateful for any help :)&lt;/p&gt;&#xA;" OwnerUserId="17464" LastActivityDate="2016-11-04T00:22:32.733" Title="Log-likelihood of skew-t distribution" Tags="&lt;garch&gt;&lt;matlab&gt;&lt;estimation&gt;&lt;distribution&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22374" PostTypeId="2" ParentId="22372" CreationDate="2015-12-16T23:51:55.133" Score="1" Body="&lt;p&gt;I think you are right. What he calls the approximation is the correct amount, the other is an approximation.  &lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2015-12-16T23:51:55.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22375" PostTypeId="2" ParentId="22190" CreationDate="2015-12-17T05:22:54.483" Score="4" Body="&lt;p&gt;Let's use a no-arbitrage argument.  Assume that the (continuously compounding) dividend yield is $q$ while the interest rate is $r$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For portfolio 1, we go long 1 forward contract with maturity $T$ and delivery price $K$.  The payoff at time $T$ is $S_T - K$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For portfolio 2, we go long $e^{-qT}$ unit of a stock (while reinvest all dividends) and short $K e^{-rT}$ unit of a bond.  The payoff at time $T$ is also $S_T - K$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At time $t = 0$, the present value (PV) of portfolio 1 is 0, because we just entered the trade.  The PV of portfolio 2 at time $t = 0$ is $S_0 e^{-qT} - K e^{-rT}$.  Assuming that there is no arbitrage, we conclude that the PV at time $t = 0$ of portfolios 1 and 2 must be the same: $ S_0 e^{-qT} - K e^{-rT} = 0$.  Hence $\boxed{K = S_0 e^{(r-q)T}}$.  Your answer of $400 (1+0.08/4)^3=424.48$ is correct.&lt;/p&gt;&#xA;" OwnerUserId="3188" LastEditorUserId="3188" LastEditDate="2016-09-23T15:08:03.337" LastActivityDate="2016-09-23T15:08:03.337" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22376" PostTypeId="1" AcceptedAnswerId="22380" CreationDate="2015-12-17T06:48:53.323" Score="1" ViewCount="1033" Body="&lt;p&gt;For this question&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If you are long a FRA and short a ED future with the same fixing&#xA;  dates, do you have positive convexity or negative convexity?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The answer is positive convexity, because a Eurodollar future has no convexity and the FRA has positive convexity. What are the implications of this from a trading perspective? Specifically, under what conditions does this lead to an opportunity for arbitrage?&lt;/p&gt;&#xA;" OwnerUserId="11854" LastActivityDate="2015-12-17T10:29:35.107" Title="Long Forward Rate Agreement, short Eurodollar futures" Tags="&lt;forward-rate&gt;&lt;eurodollars&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22377" PostTypeId="1" AcceptedAnswerId="31173" CreationDate="2015-12-17T09:17:56.390" Score="5" ViewCount="250" Body="&lt;p&gt;Low volatility investing became somewhat fashionable in recent years. In general there are two approaches to this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Ranking stocks of a certain universe by either stand-alone volatility or by beta and forming portfolios of these. In this case correlation are not directly addressed, which could be an advantage if they are unstable.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Applying an optimization $ w^T \Sigma w \rightarrow \text{Min} $ under constraints (max weights absolute, relative to index and so forth). An example for this approach is &lt;a href=&quot;https://www.msci.com/resources/factsheets/index_fact_sheet/msci-europe-minimum-volatility-index-eur-gross.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;MSCI Europe Minimum Volatility&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For quite a while research by investment banks warns that low vol stocks are too expensive already (looking at P/E), that the low vol market is too crowded and that the draw down reduction property has weakened.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my mind this can be true in the case (1) but too much less extent in case (2). Case (2) for me still makes sense in the spirit of &lt;a href=&quot;https://quant.stackexchange.com/questions/21692/intuitive-explanation-of-stochastic-portfolio-theory&quot;&gt;stochastic portfolio theory&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there openly available sources to check whether low vol indices constructed in the sense of (2) are expensive? Can we find data to check it for indices, funds, ETFs? How do you think about (2) as a general strategy that does not need a low vol anomaly to work well (improve average annual return by reducing risk)?&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-11-24T21:29:05.217" Title="Is Low-Volatility expensive these days? How can we analyze this?" Tags="&lt;equities&gt;&lt;portfolio-management&gt;&lt;low-volatility&gt;&lt;factor-investing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22380" PostTypeId="2" ParentId="22376" CreationDate="2015-12-17T10:29:35.107" Score="2" Body="&lt;p&gt;hypothetically if we assume that $R_{fra}=R_{fut}-\frac{1}{2} \cdot \sigma^2\cdot T^2$ holds (convexity adjustment) and you are able to observe $R_{fra}$, $R_{fut}$ and $T$ then you can extract implied volatility of reference interest rate. If your view on volatility is different then you can make a bet: long convexity position (if you expect volatility should be higher); or short convexity position (if you expect volatility should be lower).&lt;/p&gt;&#xA;" OwnerUserId="18275" LastActivityDate="2015-12-17T10:29:35.107" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22381" PostTypeId="1" CreationDate="2015-12-17T11:34:15.447" Score="10" ViewCount="3188" Body="&lt;p&gt;I am analyzing FTSE 100 series, from 2007-01-01 to 2010-12-31 (university exam homework).&#xA;I have to use the data 'til 2010-11-30 as sample, and the remaining (23) observations as in-sample forecast (to check the predictive performances of my model).&#xA;The model fitted is an ARMA(3,2) with GARCH(1,1) disturbances on the differenced sample (actually, the model is an ARIMA one):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;model.spec.final = ugarchspec(variance.model=list(model=&quot;fGARCH&quot;, submodel=&quot;GARCH&quot;, garchOrder=c(2,1)), mean.model = list(armaOrder=c(3,2), include.mean=F,arfima = FALSE), distribution.model=&quot;std&quot;, fixed.pars=list(alpha1=0))&#xA;&#xA;model.fit.final = ugarchfit(spec=model.spec.final, data=d_FTSE, out.sample=23, solver.control=list(trace=0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The forecast problem&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;model.forecast = ugarchforecast(model.fit.final, n.ahead=23, n.roll=23, out.sample = 23)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;gives me this output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; model.forecast&#xA;&#xA;*------------------------------------*&#xA;*       GARCH Model Forecast         *&#xA;*------------------------------------*&#xA;Model: fGARCH&#xA;fGARCH Sub-Model: GARCH&#xA;&#xA;Horizon: 23&#xA;Roll Steps: 23&#xA;Out of Sample: 23&#xA;&#xA;0-roll forecast [T0=2010-11-30]:&#xA;      Series Sigma&#xA;T+1  -8.4391 82.56&#xA;T+2   7.2799 79.80&#xA;T+3   2.7655    NA&#xA;T+4  -9.5286    NA&#xA;T+5   5.8482    NA&#xA;T+6   3.9431    NA&#xA;T+7  -9.1431    NA&#xA;T+8   4.3687    NA&#xA;T+9   4.8931    NA&#xA;T+10 -8.5682    NA&#xA;T+11  2.9420    NA&#xA;T+12  5.6136    NA&#xA;T+13 -7.8394    NA&#xA;T+14  1.5987    NA&#xA;T+15  6.1117    NA&#xA;T+16 -6.9922    NA&#xA;T+17  0.3636    NA&#xA;T+18  6.3994    NA&#xA;T+19 -6.0613    NA&#xA;T+20 -0.7440    NA&#xA;T+21  6.4927    NA&#xA;T+22 -5.0795    NA&#xA;T+23 -1.7100    NA&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the result is the same if I remove the specification on the out of sample obs (since it is specified also in the model fitting) and if I modify the &lt;em&gt;n.roll&lt;/em&gt; parameter. why all those NA? how can i solve the problem? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;trying with this code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;spec=getspec(model.fit.final)&#xA;setfixed(spec) &amp;lt;- as.list(coef(model.fit.final))&#xA;model.forecast.2= ugarchforecast(spec, n.ahead=1, n.roll=23, data=d_FTSE[1:length(d_FTSE), ,drop=F],out.sample=23)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;that comes from the answer to another question (&lt;a href=&quot;https://quant.stackexchange.com/questions/7932/forecasting-using-rugarch-package?rq=1&quot;&gt;Forecasting using rugarch package&lt;/a&gt;) it seems to work, but when I plot the results:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; plot(model.forecast.2,which=&quot;all&quot;)&#xA;Error in rect(fdates[i - 1], Zdn[i - 1], fdates[i], Zup[i], col = colors()[142],  : &#xA;  cannot mix zero-length and non-zero-length coordinates&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It is very frustrating. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;basic stats:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; stat.desc(d_FTSE)&#xA;             FTSE.Adjusted&#xA;nbr.val       1044.0000000&#xA;nbr.null        33.0000000&#xA;nbr.na           0.0000000&#xA;min           -391.0996100&#xA;max            431.2998050&#xA;range          822.3994150&#xA;sum           -320.8999030&#xA;median           0.0000000&#xA;mean            -0.3073754&#xA;SE.mean          2.4136309&#xA;CI.mean.0.95     4.7361256&#xA;var           6081.9409506&#xA;std.dev         77.9867998&#xA;coef.var      -253.7184283&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;thank you in advance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been able to succesfully use the function &lt;em&gt;ugarchroll&lt;/em&gt;: does it a similar work as &lt;em&gt;ugarchforecast&lt;/em&gt;? here is a part of the output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; model.forecast3&#xA;&#xA;*-------------------------------------*&#xA;*              GARCH Roll             *&#xA;*-------------------------------------*&#xA;No.Refits       : 2&#xA;Refit Horizon   : 22&#xA;No.Forecasts    : 23&#xA;GARCH Model     : fGARCH(2,1)&#xA;&#xA;fGARCH SubModel : GARCH&#xA;Distribution    : std &#xA;&#xA;Forecast Density:&#xA;                 Mu   Sigma Skew   Shape Shape(GIG) Realized&#xA;2010-12-01  -8.4391 82.5557    0 10.8735          0 114.2002&#xA;2010-12-02   4.3050 79.8021    0 10.8735          0 125.1001&#xA;2010-12-03   0.6100 68.5355    0 10.8735          0 -22.3003&#xA;2010-12-06 -12.0731 59.4221    0 10.8735          0  25.0000&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(...)&lt;/p&gt;&#xA;" OwnerUserId="18694" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2019-01-02T06:01:55.390" Title="ARMA+GARCH prediction with package rugarch (R)" Tags="&lt;time-series&gt;&lt;r&gt;&lt;garch&gt;&lt;prediction&gt;&lt;arma&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22382" PostTypeId="1" CreationDate="2015-12-17T13:55:03.910" Score="1" ViewCount="20" Body="&lt;p&gt;I do have a netting structure consisting of four companies (A,B,C,D) and a netting center. The center also takes place in the netting process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The netting center uses the EUR as currency.&#xA;Company A uses the EUR as currency, while Company B uses CHF as currency.&#xA;Company C uses USD as currency, while Company D uses CAD as currency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case the same currency is used, no rate have to be considered.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example I have to send 1000 USD from company C (considered all amounts are the amounts which will be sent to or will be received from the netting center) via the netting center to company D. Therefore company D will receive the amount in CAD. From my point of view the netting center should &quot;buy&quot; the 1000 USD from company C using the bid rate. Then the netting center has this amount in EUR. The amount must be transfered into CAD by using the ask rate to transfer it to company D. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Company C 1000 USD --&gt; bid rate --&gt; 1100EUR Netting Center&#xA;Netting Center 1100 EUR --&gt; ask rate --&gt; 900 CAD Company D.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the usage of the rates correct? In case the usage of the rates is not correct which rate has to be used and why?&lt;/p&gt;&#xA;" OwnerUserId="18696" LastActivityDate="2015-12-17T13:55:03.910" Title="Which rate have to be considered by using multiliteral netting?" Tags="&lt;price&gt;&lt;bid&gt;&lt;ask&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22383" PostTypeId="2" ParentId="22373" CreationDate="2015-12-17T14:17:58.420" Score="1" Body="&lt;p&gt;1- It seems to me there is a problem in the original code the variable b should be defined as   &lt;code&gt;b= sqrt(1 + 3*lamda^2 - a^2)&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2- The likelihood is defined just after equation 8. in the paper. You have to take into account the $ \frac{1}{\sigma}$ term  (in $ \frac{1}{\sigma} \times g(..)  $ , ie to scale the densitie) . So the &lt;code&gt;- 0.5*log(h(t))&lt;/code&gt; refers to this part.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Explanation :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Likelihood:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$=   \frac{1}{\sigma} \times g(..) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Log-Likelihood :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$  = log(\frac{1}{\sigma})+log(   g(..)) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ =  log(1)-log(\sigma) +log(   g(..)) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ = 0 - log( \sqrt{ \sigma^{2}}) +log(   g(..))$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ =  - log\left(  (\sigma^{2})^{0.5}\right) +log(   g(..))$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$= -0.5 \times  log(\sigma^{2}) +log(   g(..))$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first terms of the precedent equation refer to the &lt;code&gt;- 0.5*log(h(t))&lt;/code&gt; part.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2015-12-17T14:25:15.033" LastActivityDate="2015-12-17T14:25:15.033" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22384" PostTypeId="1" CreationDate="2015-12-17T16:48:41.070" Score="1" ViewCount="588" Body="&lt;p&gt;The double no touch (also known as a range binary) is an option with two American barriers. You define one barrier above the underlying asset and one below it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If during the option's lifetime the underlying asset:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remains within the defined range (i.e., neither of the barriers is hit), the payout is activated. That is, the buyer of the option receives the fixed payout specified in the option on the option's delivery date in the base currency.&#xA;Hits either of the two barriers, there is be no payout.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone explain about double no touch option with two barriers above the underlying asset and two below it and the assumptions. I'm very new to this field. TQ&lt;/p&gt;&#xA;" OwnerUserId="9341" LastActivityDate="2015-12-17T22:05:12.010" Title="Double no touch option with four barriers" Tags="&lt;options&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22385" PostTypeId="1" CreationDate="2015-12-17T17:43:55.793" Score="0" ViewCount="293" Body="&lt;p&gt;I know it's a broad question, but I'm curious as to the current state of microstructure analysis, specifically whether there's anything 'actionable' that people have discovered. Would also be interested in relevant literature on the subject.&lt;/p&gt;&#xA;" OwnerUserId="1217" LastActivityDate="2015-12-18T01:47:21.593" Title="What is the current state of microstructure/order book analysis?" Tags="&lt;market-microstructure&gt;&lt;limit-order-book&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22387" PostTypeId="2" ParentId="22381" CreationDate="2015-12-17T19:38:39.517" Score="1" Body="&lt;p&gt;Your summarize statistics are really strange ( median = 0.0000  , max 431 ...).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Compute the returns as follow : $log(p_{t+1}/p_{t}) *100 $ and run the Arma-Garch on it.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit : &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As explanation : you need to use a stationnary time serie : see @Neeraj &lt;a href=&quot;https://quant.stackexchange.com/questions/22381/armagarch-prediction-with-package-rugarch-r#comment31965_22381&quot;&gt;comment&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2015-12-18T07:36:15.157" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="22389" PostTypeId="2" ParentId="22384" CreationDate="2015-12-17T22:05:12.010" Score="1" Body="&lt;p&gt;You could have four barriers by using an &lt;a href=&quot;http://www.binaryoptions.com/trading-nested-tunnel-options/&quot; rel=&quot;nofollow&quot;&gt;Eachway Tunnel&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your first three paragraphs are describing a down-and-out plus an up-and-out exotic option with two barriers. Let's call this the inner option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now add a layer with an outer option (with a higher and lower barrier, perhaps with the same center as the inner option).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here you would have a full payout if the price never touches the first barrier, half payout if it touches either inner barrier, and no payout if it touches either outer barrier. &lt;/p&gt;&#xA;" OwnerUserId="343" LastActivityDate="2015-12-17T22:05:12.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22390" PostTypeId="2" ParentId="22385" CreationDate="2015-12-18T01:47:21.593" Score="2" Body="&lt;p&gt;A lot of people are working on this and at this time a lot of money and investment is chasing this. As a result market microstructure is changing a lot. Liquidity is becoming much less visible. You have stocks that might trade a 100 million shares a day but the sizes you will see in the book at any time in a lit exchange like Nasdaq might not be more than 1000! Almost everything learnt about microstructure two years ago is irrelevant now!&lt;/p&gt;&#xA;" OwnerUserId="491" LastActivityDate="2015-12-18T01:47:21.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22393" PostTypeId="2" ParentId="22364" CreationDate="2015-12-18T10:10:56.393" Score="0" Body="&lt;p&gt;If there is time trend in your data then it is better to take demean data and then test for stationarity.   If&#xA;$$Y_t=\alpha + \beta t +e_t $$&#xA;$$e_t=Y_t-\alpha-\beta t \sim N(0,\sigma^2)$$  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;such that $e_t$ is independent and identical distributed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $e_t$ is not stationary then also try for log difference.  &lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2015-12-18T10:10:56.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22394" PostTypeId="2" ParentId="1379" CreationDate="2015-12-18T11:06:37.990" Score="3" Body="&lt;p&gt;I am not familiar with F#.&#xA;I have implemented this many times in C++. I would go with fixed length arrays. Fr me performance is paramount. In C++, one is better off handling holes than allocating memory on the heap and add the complexity of a cache miss.&lt;/p&gt;&#xA;" OwnerUserId="491" LastActivityDate="2015-12-18T11:06:37.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22395" PostTypeId="1" CreationDate="2015-12-18T11:38:50.820" Score="5" ViewCount="4746" Body="&lt;p&gt;After a little research on interest rates of different countries I figured out that they are more complicated than I thought and the meaning of them varies country by country.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the U.S. rate, that has just been rised to 0.5%.&#xA;Global-rates.com states:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;When reference is made to the US interest rate this often refers to the Federal Funds Rate. The Federal Funds Rate is the interest rate which banks charge one another for 1 day (overnight) lending. This American base rate is set by the market and is not explicitly laid down by the FED. By withdrawing or adding funds to the money supply the FED tries to bring the effective federal funds rate into line with the interest rate that it is striving for. If the FED’s monetary policy alters the base rate, that usually affects the interest rate on various products such as mortgages, loans and savings.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, the U. S. interest rate is the &lt;strong&gt;FED Funds Rate&lt;/strong&gt;, which is not an actual (effective) rate, but rather a target rate, set by The Federal Open Market Committee (FOMC).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wikipedia defines federal funds rate as following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;In the United States, the federal funds rate is the interest rate at which depository institutions (banks and credit unions) lend reserve balances to other depository institutions overnight.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, FED Funds rate is also an &lt;strong&gt;overnight rate&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What does it really mean mathematically for FED Funds rate to be 0.5 %? If it is annualized (overnight -&gt; annual), in what way exactly? Is the simple interests formula (R = i * t) used, meaning that FED really wants an actual overnight rate to be 0.5% / 365 (365 days in a year)?&#xA;Or maybe the compound interest – R = (1+ i / n)n – is used? If so and if compounding period would be one day (is it in this case?), we'd find an an actual interest rate that FED wants to be by solving equation 0.5 = (1*x/365)^365.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance.&lt;/p&gt;&#xA;" OwnerUserId="18705" LastActivityDate="2015-12-18T14:26:18.283" Title="Central bank interest rates: are they quoted annualized?" Tags="&lt;interest&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22396" PostTypeId="1" CreationDate="2015-12-18T11:58:33.740" Score="5" ViewCount="1171" Body="&lt;p&gt;Leveraged ETFs (LETFs) are known to lose value over time due to the &quot;volatility decay&quot; effect. What're the most common strategies for trading LETFs to take advantage of this volatility effect? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, are there trading strategies for LETF options? are there arbitrage opportunities among LETF options with different leverage ratios?&lt;/p&gt;&#xA;" OwnerUserId="18707" LastActivityDate="2015-12-18T20:06:08.667" Title="How to trade leveraged ETFs" Tags="&lt;options&gt;&lt;option-strategies&gt;&lt;etf&gt;&lt;leverage&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22397" PostTypeId="1" CreationDate="2015-12-18T12:00:19.057" Score="6" ViewCount="1373" Body="&lt;p&gt;I try to understand why a $\sqrt{252}$ normalization factor is useful for Sharpe Ratio:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/o4zEW.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/o4zEW.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's compute the Sharpe Ratio for this imaginary portfolio, for various sampling periods:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import numpy as np&#xA;import matplotlib.pyplot as plt&#xA;&#xA;T = 252                       # 252 days ~ 52 weeks of 5 days ~ 12 months of 21 days&#xA;for period in [1, 5, 21]:     # sample every 1 day, 1 week, or 1 month&#xA;    x = np.arange(0, T, period)&#xA;    y = 100 + x + 3 * np.sin(x)&#xA;    returns = (y[1:] / y[:-1] - 1)     # will be daily, weekly, monthly returns&#xA;    plt.plot(x, y)&#xA;    plt.show()&#xA;    plt.plot(returns)&#xA;    plt.show()    &#xA;    print 'Sharpe Ratio: %.5f' % (np.sqrt(T/period) * returns.mean() / returns.std())    &#xA;    # sqrt(T/period) is sqrt(252), ~ sqrt(52), sqrt(12)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h1&gt;Results&lt;/h1&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;I get something nearly constant :  &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Sharpe Ratio: 7.24790&lt;br&gt;&#xA;  Sharpe Ratio: 10.49590&lt;br&gt;&#xA;  Sharpe Ratio: 7.84525  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;I find this really coherent and good&lt;/strong&gt; because for these 3 sampling rates, the ratio is similar: it doesn't depend on the sampling rate** but is &lt;em&gt;intrinsic to the portfolio itself&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h1&gt;Question :&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;I see this is coherent. But why this normalization factor in Sharpe Ratio?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="18444" LastEditorUserId="18444" LastEditDate="2015-12-18T22:18:12.407" LastActivityDate="2018-01-19T17:44:21.940" Title="Sharpe Ratio : why the normalization factor?" Tags="&lt;portfolio-management&gt;&lt;sharpe-ratio&gt;&lt;standard-deviation&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22398" PostTypeId="2" ParentId="22397" CreationDate="2015-12-18T12:15:50.897" Score="5" Body="&lt;p&gt;If you're annualising your data with &lt;code&gt;T&lt;/code&gt; it should always be the same, not changing with the length of your data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To demonstrate, annualising monthly returns, the Sharpe ratios turn out fairly similar:-&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/iIrWa.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/iIrWa.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason for multiplying by root 12 is that the mean return is annualised by multiplying by 12 and volatility is annualised by &lt;code&gt;m = 12&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/FV4Mc.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/FV4Mc.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;12 on the Sharpe ratio numerator and root 12 on the denominator is equivalent to multiplying by root 12.&lt;/p&gt;&#xA;" OwnerUserId="7178" LastEditorUserId="7178" LastEditDate="2015-12-18T12:46:23.933" LastActivityDate="2015-12-18T12:46:23.933" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22399" PostTypeId="1" AcceptedAnswerId="22404" CreationDate="2015-12-18T12:37:23.333" Score="1" ViewCount="505" Body="&lt;p&gt;Can someone please help elaborate/clarify the below statements? I've heard about them from people but would like to know some more detail behind these statements..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) SABR is not useful in pricing path dependent options like bermudan swaptions, because it only models the terminal distribution of forward rates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;(does that just mean the model is &lt;strong&gt;SIMPLY not descriptive enough&lt;/strong&gt;, because it does not have a mean reversion parameter to describe conditional expected forward rates?)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Local Vol models are useful to price path dependent options because it provides the conditional (local) volatilities at each projected node on the tree, this is aside from the fact that the model is easier to calibrate and hit vanilla market prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;(again since a local vol model is just a simpler version of a stochastic vol model, can't a stoch vol model like SABR also build up a lattice/tree of projected rates used to price them?)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Davide&lt;/p&gt;&#xA;" OwnerUserId="18708" LastActivityDate="2015-12-18T17:40:08.550" Title="Path Dependent Options - Which choice of model?" Tags="&lt;option-pricing&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22401" PostTypeId="2" ParentId="22228" CreationDate="2015-12-18T13:37:35.193" Score="5" Body="&lt;p&gt;I believe there is not a unique price if you can't short. Say, instead of buying the option  you spent 0.5 on a half a unit of the asset $S^2_1$ This asset pays out $[0.4, 0.6, 0.8]$ which first order stochastically dominates the option. So, no matter your probability beliefs about the states,  in that setting you'd never pay $0.5$ for the option which pays less in every state. This suggests the right price is less than $0.5$. Similarly, buying $0.25$ units of the $S^0_1$ asset or $0.167$ units of the $S^1_1$ asset would likewise stochastically dominate the option. In fact, because for $0.375$ units of asset $S^1_2$, which costs on $0.375$, you can still have an asset that pays out $[0.3, 0.45, 0.6]$, it seems unlikely that the price could even be as high as $0.375$. Asset 0 implies a price below $0.4$ and asset 1 below $0.45$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some python code to solve:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import numpy as np&#xA;S0 = np.array([[2],[3],[1]])&#xA;D = np.array([[1,2,3], [2,2,4], [0.8, 1.2, 1.6]])&#xA;X = np.array([[0.0],[0.2],[0.6]])&#xA;phi = np.dot(np.linalg.inv(D.transpose()), X)&#xA;print('The weights of the portfolio that replicates payoff X are: \n', phi)&#xA;P_X = np.dot(S0.transpose(), phi)&#xA;print('With a price: ', P_X)&#xA;print('Normalizing to pay a fixed price P_X for each of the three assets, what payoffs can you get?')&#xA;D_norm = D/(2*S0)&#xA;print(D_norm)&#xA;print('Notice that all three first order stochastically dominate the option for a price of: ', P_X)&#xA;print(D_norm - X.transpose())&#xA;print('Using each of the base assets, what\'s the minimum quantity that dominates?')&#xA;D_relative = X.transpose() / D&#xA;print(D_relative)&#xA;Min_dominating_fraction = np.max(D_relative,axis=1)&#xA;print('Minimum fraction of each of the assets that dominates X\n', Min_dominating_fraction)&#xA;P_Min_dominating_fraction = S0.transpose() * Min_dominating_fraction &#xA;print('At prices of: ', P_Min_dominating_fraction)&#xA;print('Therefore the option price should be less than: ', np.min(P_Min_dominating_fraction))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This code doesn't spell out the price of the option, it just show my calculations for the paragraph above. I believe the real price of this option would actually be zero if shorting is permitted. If you buy three units of asset $S^2_0$  and short one unit of $S^1_0$ you get an asset with payouts $[ 0.4,  1.6,  0.8]$. This position costs nothing to take, has positive payouts for all states, and first order stochastically dominates the option itself. Since it is possible to make a better than replicating portfolio at zero cost the price should be zero. Oh the insanity at work when arbitrages are present!&lt;/p&gt;&#xA;" OwnerUserId="3331" LastActivityDate="2015-12-18T13:37:35.193" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22402" PostTypeId="2" ParentId="22395" CreationDate="2015-12-18T14:26:18.283" Score="8" Body="&lt;p&gt;Fed Funds are quoted on an annual basis so 0.5% means half a percent per year. The day count convention used is Actual/360 (note the use of 360, not 365 or 365.25. This old convention is common to many US money market instruments). So if you borrow 1 USD for a single day you would pay 0.005/360 in interest. &lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2015-12-18T14:26:18.283" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22403" PostTypeId="2" ParentId="22396" CreationDate="2015-12-18T15:08:48.627" Score="2" Body="&lt;p&gt;One standard strategy is to short both &quot;bull&quot; and &quot;bear&quot; ETFs (usually called &quot;double short&quot;). A bit naive heuristics is that if you're loosing money holding a long position due to volatility, you can at the same time make money holding short positions.&lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2015-12-18T15:08:48.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22404" PostTypeId="2" ParentId="22399" CreationDate="2015-12-18T17:34:55.083" Score="2" Body="&lt;p&gt;The SABR framework is really two things&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;A stochastic vol model of forward rates, which is most certainly amenable to Monte Carlo simulation&lt;/li&gt;&#xA;&lt;li&gt;Reasonably accurate high-speed approximations of the terminal distribution and therefore european swaption prices&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;There's no problem (in theory) applying Monte Carlo to a SABR model: you just need to simulate the two-dimensional process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;dF = \sigma F^\beta dZ_1 \\&#xA;d\sigma = \alpha \sigma dZ_2 \\&#xA;&amp;lt;dZ_1,dZ_2&amp;gt; = \rho&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with the usual caveats about bias in Euler integration, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main trouble with this in practice is that users of SABR employ different values of $\alpha, \beta, \rho$ at different time horizons, calibrated to observed swaption prices for the corresponding tenor.  That's not a problem for vanilla options, but for path-dependent cases you no longer know what parameters to use at tenors beyond the shortest horizon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say you have such a set of calibrations $$\alpha_{\tau_i}, \beta_{\tau_i}, \rho_{\tau_i}$$ for $i=1,\dots,N$ and some path dependent option of tenor $\tau_N$.  When your path simulation is at time $t=\tau_1$ should it be using $\alpha_{\tau_1}$ or $\alpha_{\tau_N}$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The former makes the path dynamics consistent with market information observed around that time, but will then disagree about the terminal distribution for the latter, meaning european swaptions will be mispriced.&#xA;The latter is inconsistent with the market information at $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you would like is something consistent with all market observations at every tenor.  That way all european swaption prices will be recovered, and yet path dependent options can be priced as well.   A local vol model is the (stochastically) simplest way to achieve that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bermudan swaptions are usually priced on grids rather than via Monte Carlo simulations but the consistency principles remain the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It &lt;em&gt;is&lt;/em&gt; possible to choose a &lt;em&gt;single&lt;/em&gt; set of $\alpha, \beta, \rho$ to describe the market as closely as possible, which then makes consistent simulations and grids feasible, but you will find that it does not match market prices all that well.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2015-12-18T17:40:08.550" LastActivityDate="2015-12-18T17:40:08.550" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22405" PostTypeId="2" ParentId="22396" CreationDate="2015-12-18T20:06:08.667" Score="3" Body="&lt;p&gt;Quite a good article can be found here: &lt;a href=&quot;http://seekingalpha.com/article/3140956-investing-in-leveraged-etfs-theory-and-practice&quot; rel=&quot;nofollow&quot;&gt;http://seekingalpha.com/article/3140956-investing-in-leveraged-etfs-theory-and-practice&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just selling a pair of leveraged ETFs to harvest the &quot;volatility decay&quot; is comparable to a short straddle... highly skewed and therefore quite dangerous (from the article):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;There are no free lunches in the market. The apparent high performance&#xA;  of strategies that engage systematically in shorting leveraged ETFs is&#xA;  an illusion, based on a failure to quantify the full costs of&#xA;  portfolio rebalancing.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The payoff from a short leveraged ETF pair strategy will be comparable&#xA;  to that of a short straddle position, with positive decay (Theta) and&#xA;  negative Gamma (exposure to market moves). Such a strategy will&#xA;  produce positive returns most of the time, punctuated by very large&#xA;  drawdowns.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The short Gamma exposure can be mitigated by continuously rebalancing&#xA;  the portfolio to maintain dollar neutrality. However, this will entail&#xA;  repeatedly buying ETFs as they trade up and selling them as they&#xA;  decline in value. The transaction costs and trading losses involved in&#xA;  continually buying high and selling low will eat up most, if not all,&#xA;  of the value of the decay in the ETF legs.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Concerning your idea of arbitrage the article gives some ideas on &quot;relative value arbitrage&quot; but although the author claims to be successful with it he gives no details, adding: &quot;If that sounds rather complicated, I'm afraid it is&quot;, probably to attract some potential customers (but that is speculation).&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2015-12-18T20:06:08.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22406" PostTypeId="2" ParentId="22397" CreationDate="2015-12-18T22:38:30.733" Score="4" Body="&lt;p&gt;I'll try to answer according to what I've read (and I hope mostly understood).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's assume the mean of daily returns is 1%, and the standard deviation of daily returns is 1%. Then:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ Sharpe = \sqrt{252} \frac{mean(daily\ return)}{stddev(daily\ return)} \approx \sqrt{252} \frac{1 \%}{1 \%} = \sqrt{252}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let's assume we work with &lt;em&gt;monthly returns&lt;/em&gt;. In one month, the return will be ~21 times greater than before on average, and the &lt;strong&gt;standard deviation will be ~$\sqrt{21}$ times greater than before on average (why? see note below...)&lt;/strong&gt;, i.e. :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ Sharpe = \sqrt{12} \frac{mean(daily\ return)}{stddev(daily\ return)} \approx \sqrt{12} \frac{21 \%}{\sqrt{21} \%} \approx \sqrt{12} \sqrt{21} = \sqrt{252}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This shows than the Sharpe ratio is independant to sampling rate; we just have to pay attention to multiply by $\sqrt{252}$ when using daily returns, or $\sqrt{12}$ when using monthly returns.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note: since the variance has $V(a X) = a^2 V(X)$, standard deviation has $\sigma_{a X} = |a| \sigma_X$, so I don't see why multiplying returns by 21 makes its standard deviation been multiplied by $\sqrt{21}$. This needs to be explained.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="18444" LastActivityDate="2015-12-18T22:38:30.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22409" PostTypeId="1" AcceptedAnswerId="22445" CreationDate="2015-12-19T04:57:56.343" Score="7" ViewCount="1276" Body="&lt;p&gt;Let $T &amp;gt; 0$, and let $(\Omega, \mathscr F, \{\mathscr F_t\}_{t \in [0,T]}, \mathbb P)$ be a filtered probability space where $\mathbb P = \tilde{\mathbb P}$ (risk-neutral measure) and $\mathscr F_t = \mathscr F_t^{{W}} = \mathscr F_t^{\tilde{W}}$ where $W = \tilde{W} = (\tilde{W_t})_{t \in [0,T]} = ({W_t})_{t \in [0,T]}$ is standard $\mathbb P=\tilde{\mathbb P}$-Brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Define forward measure $\hat{\mathbb P}$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$A_T := \frac{d \hat{\mathbb P}}{d \mathbb P} = \frac{\exp(-\int_0^T r_s ds)}{P(0,T)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can be shown that $\exp(-\int_0^t r_s ds)P(t,T)$ is a $(\mathscr F_t, \mathbb P)-$martingale where $r_t$ is short rate process and $P(t,T)$ is bond price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We are given that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{dP(t,T)}{P(t,T)} = r_t dt + \zeta_t dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $r_t$ and $\zeta_t$ are $\mathscr F_t$-adapted and $\zeta_t$ satisfies Novikov's condition. I don't think $\zeta_t$ is supposed to represent anything in particular.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Define the stochastic process $\hat{W} = (\hat{W_t})_{t\in[0,T]}$ s.t.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\hat{W_t} := W_t + \int_0^t -\zeta_s ds$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use Girsanov Theorem to prove $\hat{W_t}$ is standard $\hat{\mathbb P}$-Brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;What I tried:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $\zeta_t$ satisfies Novikov's condition, $\int_0^T -\zeta_t dt &amp;lt; \infty$ a.s. and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$L_t := \exp(-\int_0^t (-\zeta_s dW_s) - \frac{1}{2} \int_0^t \zeta_s^2 ds)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is a $(\mathscr F_t, \mathbb P)-$martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By Girsanov Theorem, $\hat{W_t}$ is standard $\mathbb P^{*}$-Brownian Motion where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{d \mathbb P^{*}}{d \mathbb P} = L_T$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess we have that $\hat{W_t}$ is standard $\hat{\mathbb P}$-Brownian Motion if we can show that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$L_T = \frac{d \hat{\mathbb P}}{d \mathbb P}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think I was able to show (lost my notes) that $dL_t = L_t \zeta_t dW_t$, $dA_t = A_t \zeta_t dW_t$ and then $d(\ln L_t) = d(\ln A_t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From $d(\ln L_t) = d(\ln A_t)$, I infer that $L_t = A_t$ and hence $L_T = A_T$ QED.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is that right?&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="7788" LastEditDate="2016-01-01T21:45:16.643" LastActivityDate="2016-01-01T21:45:16.643" Title="How to use the Girsanov theorem to prove $\hat{W_t}$ is a $\hat{\mathbb P}$-Brownian motion?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;risk-neutral-measure&gt;&lt;girsanov&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22412" PostTypeId="1" AcceptedAnswerId="34637" CreationDate="2015-12-19T23:13:49.323" Score="15" ViewCount="2178" Body="&lt;p&gt;I have been following this paper:&#xA;&lt;a href=&quot;http://arxiv.org/pdf/1104.4596.pdf&quot; rel=&quot;noreferrer&quot;&gt;Price dynamics in a Markovian limit order market, by Rama Cont and Adrien De Larrard&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The model is especially pertinent as I only have access to L1 data.&#xA;The model is clear and intuitive and I have implemented the analytical model. &#xA;Also it (and the related paper &lt;a href=&quot;http://www.columbia.edu/~ww2040/orderbook.pdf&quot; rel=&quot;noreferrer&quot;&gt;A stochastic model for order book dynamics&#xA;Rama Cont, Sasha Stoikov, Rishi Talreja&lt;/a&gt;) have solutions to key questions like:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The probability that next move will be an up move.&lt;/li&gt;&#xA;&lt;li&gt;The time till the next move.&lt;/li&gt;&#xA;&lt;li&gt;Probability of executing an order before the market moves.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Which are precisely the questions I need answers to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However when I calculate the empirical conditional probabilities of a price movement based on the current book shape (as shown on p12 of the paper), I find that the empirical surface is almost flat (this is based on a months worth of data), suggesting that &lt;strong&gt;the current book shape has very little influence on the next tick move?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To calculate the empirical conditional probabilities I simply count up how often each bid/ask size combination occurs and in addition what proportion of these initial bid/ask combinations lead to an up move. (I assume this is correct it should be very simple).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems counter-intuitive to me that &lt;strong&gt;the book shape shouldn't hold any information regarding the future book movement?&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there other models that might be better suited to my situation (but that can still allow me to answer the questions shown above?&lt;/p&gt;&#xA;" OwnerUserId="7077" LastEditorUserId="2299" LastEditDate="2017-06-10T15:23:19.797" LastActivityDate="2018-04-24T04:08:36.363" Title="Order Book Dynamics" Tags="&lt;high-frequency&gt;&lt;market-microstructure&gt;&lt;limit-order-book&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="16" ContentLicense="CC BY-SA 3.0" />
  <row Id="22414" PostTypeId="1" AcceptedAnswerId="22426" CreationDate="2015-12-20T04:55:49.230" Score="1" ViewCount="1523" Body="&lt;p&gt;I model option prices for European call using Monte Carlo method. &lt;strong&gt;What is the proper way to calculate the confidence interval?&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;A.&lt;/strong&gt; &#xA;-&gt; Calculate the payoffs (there will be number of zeros as some prices go below strike) &lt;br&gt;&#xA;-&gt; calculate mean and st.dev. of the payoffs &lt;br&gt;&#xA;-&gt; apply the formula for the confidence interval:   &lt;strong&gt;mean option payoff +/- z*(st.dev option payoff / sqrt(number of simulation) )&lt;/strong&gt;  &lt;br&gt;&#xA;-&gt; discount&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or  &lt;br&gt; &lt;br&gt;&#xA;&lt;strong&gt;B.&lt;/strong&gt; &lt;br&gt;&#xA;-&gt; Calculate the mean and st.dev. of all the prices at maturity &#xA;-&gt; apply the formula for the confidence interval:   &lt;strong&gt;mean underlying priceT +/- z*(st.dev underlying priceT / sqrt(number of simulation) )&lt;/strong&gt;  &lt;br&gt;&#xA;-&gt;  calculate upper and lower band of the payoffs  &lt;br&gt;&#xA;-&gt;  discount &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where payoff is max(underlying asset priceT - option strike price,0)&lt;/p&gt;&#xA;" OwnerUserId="18670" LastEditorUserId="18670" LastEditDate="2015-12-20T19:43:18.763" LastActivityDate="2015-12-21T09:20:45.693" Title="How to calculate confidence interval for option price?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;statistics&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22416" PostTypeId="2" ParentId="18201" CreationDate="2015-12-20T15:10:49.623" Score="-3" Body="&lt;p&gt;^GSPC must be a total return index. The difference between it and spy is so small over time that dividends must be included.&lt;/p&gt;&#xA;" OwnerUserId="18722" LastActivityDate="2015-12-20T15:10:49.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22417" PostTypeId="2" ParentId="3783" CreationDate="2015-12-20T15:56:36.280" Score="2" Body="&lt;p&gt;Why not just implement it with two price-amount maps, as shown &lt;a href=&quot;http://www.youtube.com/watch?v=fxN4xEZvrxI&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;? &lt;/p&gt;&#xA;" OwnerUserId="1217" LastActivityDate="2015-12-20T15:56:36.280" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22418" PostTypeId="1" AcceptedAnswerId="22419" CreationDate="2015-12-20T17:56:44.523" Score="0" ViewCount="61" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;The reduction seen in US government debt in the late 1990s has led to a redution in the supply of intermediate and long-term government bonds, and some concern has arisen over this fact. In the United States, some efforts have been made to promote the long-term debt of Fannie Mae and Freddie Mac as substitute benchmark bonds.&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This comes from a passage connected to US treasury bond futures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I cannot understand why Freddie Mac and Fannie Mae have been chosen as closest to government debt? Didnt one of them go bust in the recession making them not quite default free (as one usually assumes in US debt)?&lt;/p&gt;&#xA;" OwnerUserId="11723" LastActivityDate="2015-12-21T18:23:56.553" Title="Fannie Mae and Freddie Mac as substitute benchmark bonds" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;economics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22419" PostTypeId="2" ParentId="22418" CreationDate="2015-12-20T19:48:09.910" Score="2" Body="&lt;p&gt;Since Freddie Mac and Fannie Mae are government sponsored enterprises (GSEs), the government guarantee was considered &quot;implicit&quot; before the financial crisis. As such, the credit quality of their papers was believed to be &lt;em&gt;almost&lt;/em&gt; as high as US Treasuries. This assumption pretty much turned out to be true. Both Fannie and Freddie were taken into conservatorship during the financial crisis, and now their debts are explicitly guaranteed by the US government.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason why people were so excited about agencies back in the early 2000s was because of the Treasury buyback, which was reducing Treasury supplies. In fact, the US Treasury didn't issue any 30-year bonds between 2002 and 2006. By early 2006, the longest Treasury bond had only 24 years to maturity. By contrast, there was a steady supply of agency debt, providing more pricing information at the long end of the yield curve. So agencies got a lot of attention as a potential benchmark. Dealers began to build agency curves. CBOT even had futures contracts on agencies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, agency papers never really reached the benchmark status. The US government soon began to run deficits again and Treasury issuance grew substantially in the ensuing years. Today, agency debt is a shell of its former self....&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2015-12-21T18:23:56.553" LastActivityDate="2015-12-21T18:23:56.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22422" PostTypeId="1" AcceptedAnswerId="22423" CreationDate="2015-12-21T02:05:21.107" Score="1" ViewCount="649" Body="&lt;p&gt;I have difficulty to solve attached question. The question asks me to find new weight of stocks by just changing standard deviation of the portfolio. I really do not have any idea how to solve it. Maybe the key point is the risk-free asset but I am not sure, can somebody give me a hint?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Ieitn.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Ieitn.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18730" LastEditorUserId="848" LastEditDate="2015-12-21T06:46:19.640" LastActivityDate="2015-12-21T06:46:19.640" Title="How to calculate weight of two stocks without knowing their correlation?" Tags="&lt;equities&gt;&lt;risk-free&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22423" PostTypeId="2" ParentId="22422" CreationDate="2015-12-21T02:28:09.723" Score="3" Body="&lt;p&gt;You are supposed to create a new portfolio using the tangency portfolio $P_t$ and the risk-free rate $r$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You know that the volatility of the tangency portfolio $\sigma_{P_t}=0.20$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You also know that the risk-free asset has:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;No risk: $\sigma_r=0$&lt;/li&gt;&#xA;&lt;li&gt;Is not correlated with anything $\rho_{P_t,r} = 0$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So you're asked to create a portfolio with a higher risk, which means you are going to need to borrow some money to buy more of the tangency portfolio (you &lt;em&gt;leverage&lt;/em&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You know that, by definition of volatility, the volatility of a portfolio $P$ formed of the tangency portfolio with weight $w$ and the risk-free asset with weight $1-w$ is :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma_P^2 = w^2 \sigma_{P_t}^2 + (1-w)^2 \sigma_r^2 + 2w(1-w)\sigma_{P_t}\sigma_r\rho_{P_t,r} = w^2 \sigma_{P_t}^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You hence get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$w = \frac{\sigma_P}{\sigma_{P_t}} = \frac{0.24}{0.20} = 1.2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the overall weight of the tangency portfolio will be $w=1.2$, the weight of the risk-free asset will be $1-w = -0.2$ (short). Within tangency portfolio, nothing has change in terms of weighting so you just multiply the 1.2 by the original weights which yields $w_A = 0.60 \cdot 1.2 =0.72$ and $w_B = 0.40 \cdot 1.2 =0.48$.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2015-12-21T02:28:09.723" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22425" PostTypeId="1" AcceptedAnswerId="22429" CreationDate="2015-12-21T04:04:39.857" Score="1" ViewCount="541" Body="&lt;p&gt;In one of the videos in Youtube which explained about stock buy backs, it was told that companies can achieve higher Return on Assets by doing stock buy backs. The explanation went like this :- When a company does a share buy back, its assets decrease whereas earnings remain constant. Since RoA is (Earnings / Assets) * 100%, RoA gets boosted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I do not understand is the fact that how the assets decrease? Company is using the cash to be converted into its own stocks, which is also an asset. If the share price goes up then assets increase else it goes down. Then how can we claim that assets definitely decrease when a share buy back is done?&lt;/p&gt;&#xA;" OwnerUserId="18731" LastActivityDate="2015-12-23T20:04:55.073" Title="How does stock buy back increase RoA of a company?" Tags="&lt;equities&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22426" PostTypeId="2" ParentId="22414" CreationDate="2015-12-21T09:20:45.693" Score="2" Body="&lt;p&gt;The right way is approach A. Approach B does not work because of the &lt;a href=&quot;https://en.wikipedia.org/wiki/Jensen&amp;#39;s_inequality&quot; rel=&quot;nofollow&quot; title=&quot;Jensen inequality&quot;&gt;Jensen inequality&lt;/a&gt;. Take note that your confidence intervals are only asymptotically correct. Depending on the number of scenarios, your options and their parameters these might provide bad coverage. &lt;/p&gt;&#xA;" OwnerUserId="482" LastActivityDate="2015-12-21T09:20:45.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22428" PostTypeId="1" AcceptedAnswerId="22465" CreationDate="2015-12-21T16:12:20.287" Score="2" ViewCount="1045" Body="&lt;p&gt;HELP! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to find how much the underlying price of a gold futures option must move in order to breakeven on owning an option for a day. &#xA;I was hoping someone versed in pricing options could identify a flaw in my reasoning?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using an equation for calculating the profit and loss for a delta hedged option from. &quot;option Trading Volatility: Trading Volatility, Correlation, Term Structure and Skew&quot;Apr 24 2014 by Colin Bennett&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;P/L = 1/2 * GAMMA * S^2 - TIMEDECAY&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;S == the change in market price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume P/L = 0&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;S = SQRT(2*TIMEDECAY/GAMMA)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here are some relevant variables I pulled from BLOOMBERG Option Valuation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Option expiry = Feb 16th&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Current Date = December 21st&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ImpliedVol = 13.579%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Theta = -25.62 (sensitivity in option price to a decrease in 1 day of time to epxpiry)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gamma = 9.342 (sensitivity of delta to a change in spot)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Price of GCH6 (Gold Future Underlying) = 1078.2 units &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Contract Unit = 100 Troy Ounces&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Price Quotation = U.S. Dollars and Cents per troy ounce&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Minimum Price Fluctuation = .10$ per troy ounce&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;S = SQUAREROOT(2*THETA/GAMMA)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;S = SQUAREROOT(2*25.62/9.342)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;S = 2.34 = (2.34/1078.2)*100 = 0.21% , The market must move 0.21% during one day to breakeven&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, this number is much smaller than the numbers I am getting using the MARS model on bloomberg, or than a number that would make sense given the history of the option. Each day I do the calculation its off by a factor of 3-5.&#xA;I'm expecting a number in the 0.7% to 1.0% range.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas? I'm assuming the problem is units related, but I worry it could be equation related. Completely stumped.&lt;/p&gt;&#xA;" OwnerUserId="18357" LastActivityDate="2015-12-28T20:10:32.587" Title="Estimating profit/loss of a Gold Futures option using Theta and Gamma" Tags="&lt;options&gt;&lt;gamma&gt;&lt;theta&gt;" AnswerCount="1" CommentCount="14" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22429" PostTypeId="2" ParentId="22425" CreationDate="2015-12-21T19:25:26.023" Score="1" Body="&lt;p&gt;The definition of RoA is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;RoA = Net Income / Avg Total Assets&lt;/em&gt;&lt;/strong&gt;, where &lt;strong&gt;&lt;em&gt;Net income = Total Revenue - Total Expenses&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note the basic accounting formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Assets = Equity + Liabilities&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assets can be current (e.g cash in the bank, inventory, accounts receivable, etc) or long term (e.g. machinery, property,etc) and are defined as 'economic resources'  i.e. they can create/generate value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A company is buying back shares either with cash it holds or 'borrows' the cash to do it. In the former case, its cash (an asset) is decreasing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In both cases the (outstanding) equity is decreasing. The shares that the company bought back are now 'treasury shares' BUT are not an asset (cant create value in their form). Many times these treasury shares are retired or held and sold on later. They are not classed as asset, and their market value is not used as part of a company valuation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suggest searching for a description of the accounting formula first followed by further searches on shares outstanding/treasury and then share repurchases, CFA institute material (public or otherwise) is always good to read.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope the above helps, sorry if I didnt expand my answer enough as its a very wide and deep topic I am still trying to learn about &lt;/p&gt;&#xA;" OwnerUserId="18522" LastEditorUserId="18522" LastEditDate="2015-12-23T20:04:55.073" LastActivityDate="2015-12-23T20:04:55.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22430" PostTypeId="1" CreationDate="2015-12-21T21:01:50.653" Score="2" ViewCount="140" Body="&lt;p&gt;Let's say we have a Binary Options 5-minute trading strategy that relies on multiple indicators and exploits price reversals in currency pairs. Now let's say there is a combination of inputs for the strategy's indicators that work really well together and produce a 65% average win rate when backtested against three years of minute-by-minute tick data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In theory, can we expect this strategy continue to produce a 65% average win rate?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For one of the indicators, we use a &lt;a href=&quot;https://c.mql5.com/2/12/fig4_1.gif&quot; rel=&quot;nofollow&quot;&gt;Polynomial Regression Channel&lt;/a&gt; of length 250. This tells us when the price spikes outside the recent average price range and thus offers a clue as to when the price will likely reverse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In testing such a strategy, I have noticed that some days it performs extremely well (sometimes yielding a 75% win rate with 12/14 trades winning) whereas others it bombs (20% win rate with only 2/10 trades winning).&lt;/p&gt;&#xA;" OwnerUserId="18734" LastActivityDate="2015-12-21T22:58:19.050" Title="Should a strategy backtested against three years of tick data continue to produce positive results?" Tags="&lt;trading&gt;&lt;fx&gt;&lt;automated-trading&gt;&lt;algorithmic-trading&gt;&lt;technical-analysis&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22431" PostTypeId="2" ParentId="22425" CreationDate="2015-12-21T22:16:48.920" Score="0" Body="&lt;p&gt;RoA = Net Income / Avg Total Assets&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a stock buy back, &lt;strong&gt;cash (an asset)&lt;/strong&gt; is used purchase equity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The purchased stock &lt;strong&gt;does not become an asset&lt;/strong&gt; but rather forms a Debit account on Shareholders Equity and a Credit to Cash &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus Assets decrease while income stays the same. &lt;/p&gt;&#xA;" OwnerUserId="18735" LastEditorUserId="18735" LastEditDate="2015-12-21T22:27:52.127" LastActivityDate="2015-12-21T22:27:52.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22432" PostTypeId="2" ParentId="22430" CreationDate="2015-12-21T22:58:19.050" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;In testing such a strategy, I have noticed that some days it performs extremely well (sometimes yielding a 75% win rate with 12/14 trades winning) whereas others it bombs (20% win rate with only 2/10 trades winning).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is the key. From the information you provided it would appear that you have failed to consider the effects of draw-down. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The strategy will most likely fail when you factor in capital draw-down&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example: You have $100 and invest it in this strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;DAY:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You hit jackpot, yielding you 12 trades that make you 10% each and you now have &lt;code&gt;$314&lt;/code&gt;!&lt;/li&gt;&#xA;&lt;li&gt;You hit a wall and have 10 trades that loose about 20% each today you now have &lt;code&gt;$27&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Now with &lt;code&gt;$27&lt;/code&gt; even if you make 20% off of every trade it will take you more than 13 trades to make back what you lost in just 10 trades&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The market can move against you longer than you can stay liquid. &lt;/p&gt;&#xA;" OwnerUserId="18735" LastActivityDate="2015-12-21T22:58:19.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22433" PostTypeId="1" AcceptedAnswerId="22480" CreationDate="2015-12-21T23:58:23.920" Score="5" ViewCount="322" Body="&lt;p&gt;On the paper &lt;a href=&quot;http://public.econ.duke.edu/~boller/Published_Papers/rfs_09.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bollerslev, Tauchen and Zhou (2009 RFS)&lt;/a&gt; the authors say about equation (15):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The corresponding model implied risk-neutral conditional expectation&#xA;  $$E^Q_t(\sigma^2_{r,t+1})=E_t(\sigma^2_{r,t+1}M_{t+1})E_t(M_{t+1})^{-1}$$&#xA;  cannot easily be computed in a closed form.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;However it is possible to&#xA;  calculate the following close log-linear approximation:&#xA;  $$E^Q_t(\sigma^2_{r,t+1}) \approx \log[e^{-r_{f,t}}&#xA;E_t[e^{m_{t+1}+\sigma^2_{r,t+1}}]]  &#xA;-\frac{1}{2}Var_t(\sigma_{r,t+1}^2) = E_t(\sigma^2_{r,t+1})+(\theta - 1)\kappa_1 [A_\sigma + A_q  \kappa_1^2(A_\sigma^2 + A_q^2&#xA;\varphi_q^2)\varphi_q^2]q_t$$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I perfectly understand how to get from the first equality to the second. But the last equality, I have no idea where it comes from.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, I imagine that the terms: $\log[e^{-r_{f,t}} E_t[e^{m_{t+1}}]]$ cancel out. But then how does he get rid of the $E_t[e^{\sigma^2_{r,t+1}}]$?&lt;/p&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="848" LastEditDate="2017-10-31T05:14:47.293" LastActivityDate="2017-10-31T05:14:47.293" Title="How to derive this approximation of the risk-neutral expectation of the variance?" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;risk-neutral-measure&gt;&lt;models&gt;&lt;variance&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22434" PostTypeId="2" ParentId="22433" CreationDate="2015-12-22T08:30:28.283" Score="3" Body="&lt;p&gt;Directly from the paper:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We assume that the representative agent in the economy is equipped&#xA;  with Epstein–Zin–Weil recursive preferences. Consequently, the&#xA;  logarithm of the intertemporal marginal rate of substitution, $m_{t+1} \equiv log(M_{t+1})$, may be expressed as &#xA;  $$m_{t+1} =\theta log\delta−\theta\psi^{-1}g_{t+1}+(\theta−1)r_{t+1}, (4)$$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;[…]&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Let $w_t$ denote the logarithm of the price–dividend ratio, or equivalently the price–consumption or wealth–consumption ratio, of the asset that pays the&#xA;  consumption endowment, $\{C_{t +i} \}_{i=1}^\infty$ . The standard solution method for finding the equilibrium in a model like the one defined above then consists in conjecturing a solution for $w_t$ as an affine function of the state variables, $σ^2_{g,t}$ and $q_t$ ,&#xA;  $$w_t = A_0 + A_σσ^2_{g,t} + A_qq_t, (6)$$&#xA;  solving for the coefficients $A_0$, $A_σ$, and $A_q$, using the standard Campbell and Shiller (1988) approximation $r_{t+1} = κ_0 + κ_1w_{t+1} − w_t + g_{t+1}$. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;[…]&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;From the solution for the A’s, it is now relatively straightforward to&#xA;  deduce the reduced form expressions for other variables of interest.&#xA;  In particular, the time $t$ to $t + 1$ return must satisfy the following&#xA;  relation:&#xA;  $$r_{t+1} =−log\delta+ \psi^{-1}\mu_g − \frac{(1-\gamma)^2}{2\theta}\sigma^2_{g,t}+(k_1\rho_q-1)A_qq_t+\sigma_{g,t}z_{g,t+1}+(10)$$&#xA;  $$k_1\sqrt{q_t}[A_qz_{\sigma,t+1}+A_q\varphi_qz_{q,t+1}]$$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;[…]&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;To formally establish this result, denote the conditional variance of&#xA;  the time t to t + 1 return as $σ^2_{r,t} \equiv Var_t (r_{t+1} )$. It follows from Equation (10) that&#xA;  $$\sigma^2_{r,t}=\sigma^2_{g,t} + k_1^2(A_\sigma^2+A^2_q\varphi_q^2)q_t , (12)$$&#xA;  […]Consider instead the one-period ahead conditional variance, &#xA;  $$\sigma^2_{r,t+1}=\sigma^2_{g,t+1} + k_1^2(A_\sigma^2+A^2_q\varphi_q^2)q_{t+1} , (13)$$&#xA;  which is unknown or stochastic at time t.[…] It follows readily that the time t objective conditional expectation equals&#xA;  $$E_t[\sigma^2_{r,t+1}]=a_\sigma + k^2_1(A_\sigma^2+A_q^2\varphi^2_q)a_q+\rho_\sigma\sigma^2_{g,t}+k_1^2(A_\sigma^2+\varphi^2_q)\rho_qq_t , (14)$$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you use (4) and (14) into the second part of the equality you can recover the third part. &lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2015-12-22T08:30:28.283" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22435" PostTypeId="1" CreationDate="2015-12-22T12:01:10.443" Score="3" ViewCount="431" Body="&lt;p&gt;I would like to share with you what I am doing to get your point of view, and to make a better trading system in collaboration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am working on EURUSD forex, and I am trying to find a way to place order based on ARMA modelling.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Collecting Data, Data transformation, and Model fitting:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am collecting each EOD Close of EURUSD instrument, and I calculate the log differencing to transform this time series in a stationary process. Then, using Box Jenkins, I fit the parameters of the ARMA Model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Residuals Analysis:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After the model fitted, I analyze the residuals of the model. The process of the model residuals is a stationary process and follows a normal distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/cb2iH.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/cb2iH.png&quot; alt=&quot;ADF Test for the model residuals&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Trading Strategy:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like the model residuals is a normal distribution, I calculate the cumulative probability.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I am able to display on the chart with a minor timeframe H4 or H1 what will be the tomorrow position with their respecting probability based on volatility max of 2 standards deviations:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/p92Da.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/p92Da.png&quot; alt=&quot;Chart with the Probability for the next day&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is that a good way to work with the ARMA model? What do you think about this strategy? Can we improve it together?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;&#xA;&lt;p&gt;David&lt;/p&gt;&#xA;" OwnerUserId="17798" LastActivityDate="2015-12-23T08:28:30.087" Title="Is that a good way to work with the ARMA model?" Tags="&lt;time-series&gt;&lt;quant-trading-strategies&gt;&lt;fx&gt;&lt;arma&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22441" PostTypeId="1" CreationDate="2015-12-22T15:23:23.053" Score="0" ViewCount="162" Body="&lt;p&gt;I'm using a procedure as described in the interactive brokers article here (&lt;a href=&quot;https://www.interactivebrokers.com/en/index.php?f=5910&amp;amp;ns=T&quot; rel=&quot;nofollow&quot;&gt;https://www.interactivebrokers.com/en/index.php?f=5910&amp;amp;ns=T&lt;/a&gt;) to compute a probability distribution from option (call) prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In essence you solve a very simple system of two linear equations at each strike.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The issue is I get negative probabilities coming out of it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for a simple and robust procedure to do this estimation. Thoughts?&lt;/p&gt;&#xA;" OwnerUserId="2186" LastActivityDate="2015-12-22T15:23:23.053" Title="Compute stock price probability distribution from option data (IB method &amp; negative probabilities issue)" Tags="&lt;options&gt;&lt;probability&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22442" PostTypeId="2" ParentId="22339" CreationDate="2015-12-22T15:58:47.897" Score="5" Body="&lt;h1&gt;Compustat&lt;/h1&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;supports unlimited data export&lt;/li&gt;&#xA;&lt;li&gt;keeps the history of disbanded entities&lt;/li&gt;&#xA;&lt;li&gt;provides restatements since 1950 + point-in-time data since 1986&lt;/li&gt;&#xA;&lt;li&gt;coverage since 1950&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://finance.fbv.kit.edu/rd_download/NorthAmerica_DataGuide.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;list of variables&lt;/a&gt; (data guide)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Compustat is a S&amp;amp;P subsidiary. It goes as a plugin for CapitalIQ (also S&amp;amp;P), &lt;a href=&quot;https://wrds-web.wharton.upenn.edu/&quot; rel=&quot;nofollow noreferrer&quot;&gt;WRDS&lt;/a&gt;, &lt;a href=&quot;http://crsp.org/files/ccm_data_guide_0.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;CRSP&lt;/a&gt;, and other platforms. Pricing starts from \$3k. A platform typically costs another \$10-20k and provides additional data (deals, management, macro). Access via data feed costs \$15k+. The prices depend on your region.&lt;/p&gt;&#xA;&lt;p&gt;Example of the variables available in Compustat via WRDS:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://wrds-web.wharton.upenn.edu/wrds/demo/demoform_compustat.cfm&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://wrds-web.wharton.upenn.edu/wrds/demo/demoform_compustat.cfm&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Compustat + CRSP:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://crsp.org/files/ccm_data_guide_0.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://crsp.org/files/ccm_data_guide_0.pdf&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="11701" LastEditorUserId="1599" LastEditDate="2021-02-01T15:35:29.837" LastActivityDate="2021-02-01T15:35:29.837" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="22443" PostTypeId="1" AcceptedAnswerId="28343" CreationDate="2015-12-22T16:30:32.837" Score="0" ViewCount="1571" Body="&lt;p&gt;This is probably an older topic but I don't seem to find any related threads on this forum.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the best way to value, let's say, a vanilla IR swap (you receive fixed) that you trade against a sovereign, where you are on a 1-way cash CSA agreement? (i.e. you post collateral when PV is negative but not vice versa).&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;How good an approximation to fair value is when you just discount the swap at your cost of funds?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;a) Or is it better to discount it at some other &lt;strong&gt;reference rate&lt;/strong&gt; (whats a good reference rate?) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) calculate and include a seperate valuation adjustment, where the positive and negative PV paths are simulated seperately and the former discounted with the &lt;strong&gt;reference rate&lt;/strong&gt;, the negative MTMs discounted with cost of funds?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;To the purpose of 2), is it better to value a swap synthetically as short caplets discounted at OIS, and long floorlets discounted at your cost of funds? Can you think of any issues when done this way? This obviously won't work for exotics derivatives.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Many thanks!&lt;/p&gt;&#xA;" OwnerUserId="18708" LastEditorUserId="20454" LastEditDate="2017-10-09T15:54:45.340" LastActivityDate="2017-10-09T15:54:45.340" Title="One Way CSA Agreements" Tags="&lt;interest-rate-swap&gt;&lt;ois-discounting&gt;&lt;collateral&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22444" PostTypeId="1" AcceptedAnswerId="22447" CreationDate="2015-12-22T16:32:38.913" Score="2" ViewCount="78" Body="&lt;p&gt;I am using Act/365 day-count convention. How do I compute the time offset between 2/28/2015 and 3/1/2016? 3/1/2017&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some ideas:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Direct day count: count number of days between the dates, and divide by 365. In my 2 examples, yields $1 \frac{2}{365}$ and $2 \frac{2}{365}$, respectively.&lt;/li&gt;&#xA;&lt;li&gt;Add whole years, and only apply day count convention to the fraction of dates less than a year. Then we end up with $1 \frac{2}{365}$ and $2 \frac{1}{365}$.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Does anyone know which of the 2 approaches is correct? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="3029" LastActivityDate="2015-12-22T18:47:36.607" Title="Translating dates to times" Tags="&lt;daycounting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22445" PostTypeId="2" ParentId="22409" CreationDate="2015-12-22T18:11:54.000" Score="6" Body="&lt;p&gt;Your notations are really hard to follow as you define $\mathbb{P}$ twice at the beginning. The notation $\mathbb{P} = \mathbb{\hat{P}}$ and $\mathbb{P} =\mathbb{\tilde{P}}$ is not meaningful as the probability measure $\mathbb{P}$ is already fixed and used for the real world probability measure. I think that this is the reason why you are getting confused. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the solution. I am using standard notations here. Under $\mathbb{Q}$ the risk neutral probability &#xA;$$\frac{d P_{tT}}{P_{tT}} = r_t dt + \xi_t dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now consider the process $\displaystyle Z_t = \exp(-\int_{0}^t r_s ds)\frac{P_{tT}}{P_{0T}}$. Note that with your notation $Z_T = A_T$, since $P_{TT} = 1$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we show that is a $Z_t$ is a $\mathbb{Q}$-martingale, with $Z_0 = 1$, then we can apply a change of measure to define $\mathbb{Q}_{T}$, the forward measure, as &#xA;$$\mathbb{Q}_{T}(B) = \mathbb{E}_{\mathbb{Q}}(Z_T \cdot I_{B}),$$ &#xA;for $B \in \mathcal{F}_T$. Then, by Girsanov theorem, $\hat{W}_t = W_t -\int_0^t \xi_s ds$ is a B.M under $\mathbb{Q}_T$. Note the minus sign and not the plus sign as in question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Proof that $Z_t$ is a martingale with $Z_0 = 1$: The fact that $Z_0 = 1$ is clear. For the martingale property, we have that from the dynamics of $P_{tT}$ under $\mathbb{Q}$,&#xA;\begin{align*} &#xA;d(\exp(-\int_{0}^t r_s ds)P_{tT}) = \exp(-\int_{0}^t r_s ds)P_{tT} \xi_t dW_t&#xA;\end{align*}&#xA;Hence, $dZ_t = Z_t \xi_t dW_t$ or equivalently by taking the log and apply Ito's formula, &#xA;$$Z_t = \exp\left( \int_{0}^{t} \xi_s dW_s - \frac{1}{2} \int_{0}^{t} \xi^2_s ds\right)$$&#xA;Note that here $Z_t = L_t$. As we are told that it verifies Novikov condition, this ensures that it is a martingale and that we can apply Girsanov.&lt;/p&gt;&#xA;" OwnerUserId="16981" LastEditorUserId="16981" LastEditDate="2015-12-28T19:14:12.653" LastActivityDate="2015-12-28T19:14:12.653" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="22446" PostTypeId="1" AcceptedAnswerId="31562" CreationDate="2015-12-22T18:13:03.523" Score="3" ViewCount="315" Body="&lt;p&gt;The characteristic function of the VGSA model is defined as a specific parameterization of the characteristic function of the CIR (Cox-Ingersol-Ross mean reverting process) time-change:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \mathbb{E}e^{iuY(t)} = \varphi_{VGSA}(u,t,y(0),\kappa, \eta, \lambda) = A(u,t,\kappa,\eta,\lambda)e^{B(u,t,\kappa,\lambda)y(0)} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where&#xA;    \begin{align*}&#xA;	A(u,t,\kappa,\eta,\lambda) &amp;amp;= \frac{\exp\Big( \frac{\kappa^2\eta t}{\lambda^2} \Big) }{\Big( \cosh(\gamma t/2) + \frac{\kappa}{\gamma}\sinh(\gamma t/2) \Big)^{\frac{2\kappa\eta}{\lambda^2}}}\\&#xA;	B(u,t,\kappa,\lambda) &amp;amp;= \frac{2iu}{\kappa + \gamma\coth(\gamma t/2)}\\&#xA;	\gamma &amp;amp;= \sqrt{\kappa^2-2\lambda^2iu}&#xA;	\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The VGSA characteristic function is given by: &#xA;$ \mathbb{E}e^{iuZ_{VGSA}(t)} = \varphi_{VGSA}(-i\Psi_{VG}(u), t, \nu^{-1}, \kappa, \eta, \lambda) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $\Psi_{VG}(u)$ is the log characteristic function of Variance Gamma at unit time:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \Psi_{VG}(u) = -\frac{1}{\nu}\log(1-iu\nu\theta + \sigma^2\nu u^2/2) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The cumulant generating function satisfies:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ G(w) = \ln \mathbb{E}e^{wX} = \ln(\varphi_{VGSA}(-iw)) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Its $n$-th cumulant is the $n$-th derivative of the cumulant generating function evaluated at zero:&#xA;$ c_n = G^{(n)}(0) = \frac{-i\varphi_{VGSA}^{(n)}(0)}{\varphi_{VGSA}(0)} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need the first, second, and fourth cumulants in order to price VGSA using the Fourier-cosine method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have these cumulants or know if they even exist in closed form?&lt;/p&gt;&#xA;" OwnerUserId="18112" LastActivityDate="2017-02-16T00:42:47.710" Title="Cumulants of variance gamma with stochastic arrival (VGSA) model" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;variance-gamma&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22447" PostTypeId="2" ParentId="22444" CreationDate="2015-12-22T18:47:36.607" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I am using Act/365 day-count convention. How do I compute the time offset between 2/28/2015 and 3/1/2016? 3/1/2017&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So it is not clear whether you are referring to the Act/365F (Fixed) or the Act/365A (Actual). &lt;em&gt;I think you are trying to us Act/365A as it is much more commonly used in the USA. Where as the Act/365F is more used in the UK from what I know.&lt;/em&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I am wrong and you are trying to use Act/365F then answer 1 is correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Under both Act/365A &amp;amp; Act/365F&lt;/strong&gt; The numerator is the actual number of days in the accrual period. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Under Act/365A&lt;/strong&gt; The denominator is 366 Feb 29 falls within the accrual period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Thus:&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;For 3/1/2016 the accrual would be 367/366&lt;/li&gt;&#xA;&lt;li&gt;For 3/1/2017 the accrual would be 732/366&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Under Act/365F&lt;/strong&gt; The denominator is always 365.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Thus:&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;For 3/1/2016 the accrual would be 367/365&lt;/li&gt;&#xA;&lt;li&gt;For 3/1/2017 the accrual would be 732/365&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="18735" LastActivityDate="2015-12-22T18:47:36.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22448" PostTypeId="1" CreationDate="2015-12-22T19:15:46.760" Score="0" ViewCount="54" Body="&lt;p&gt;I solved attached question but I am not sure whether I did part a and c correctly. Is there a way to calculate weights of A and B by just knowing their standard deviation and correlation's value?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/OTAAJ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/OTAAJ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/cVsL2.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/cVsL2.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18730" LastEditorUserId="18730" LastEditDate="2015-12-23T01:02:51.470" LastActivityDate="2015-12-23T01:02:51.470" Title="Do I calculate weights of assets correctly?" Tags="&lt;portfolio&gt;&lt;sharpe-ratio&gt;&lt;market&gt;&lt;asset&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22449" PostTypeId="1" AcceptedAnswerId="22489" CreationDate="2015-12-22T19:38:21.517" Score="0" ViewCount="2612" Body="&lt;p&gt;I have calculated the NPV of an Equity option and need to account the notional for it and have issues understanding the NPV &amp;lt;-&gt; notional relation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&#xA;Strike price 100&#xA;Spot rate: 107.41&#xA;NPV is 20.0344 using Black Scholes&#xA;The notional is 900000&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it correct to account the current spot rate for the amount of contracts:&#xA;900000 / 107.41 = 8379.109 times the NPV?&lt;/p&gt;&#xA;" OwnerUserId="18631" LastActivityDate="2015-12-26T22:47:07.867" Title="Notional Value in Equity Options" Tags="&lt;options&gt;&lt;equities&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22451" PostTypeId="1" AcceptedAnswerId="22461" CreationDate="2015-12-22T23:05:57.197" Score="1" ViewCount="149" Body="&lt;p&gt;I'm working on interday trading algorithm and I have a basic question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I estimate today's closing price? I need it to predict tomorrow closing price. Should I use the price few moments before market close? However this could be too late to place orders and use my prediction of tomorrow price. Is my logic incorrect somehow? What is the common practice?&lt;/p&gt;&#xA;" OwnerUserId="13379" LastActivityDate="2015-12-23T15:54:03.707" Title="How to estimate today's closing price?" Tags="&lt;estimation&gt;&lt;price&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22453" PostTypeId="1" CreationDate="2015-12-23T00:43:11.430" Score="1" ViewCount="119" Body="&lt;p&gt;Suppose I have 3 stocks. Their historical returns and some variables like RSI, ATR, EMAs for all 3 of them. The goal is to compute the weights each stock should have in a portfolio. If I do something as simple as markowitz portfolio, it would mean I am only using the historical returns of the 3 stocks and ignoring other factors like RSI, ATR, EMAs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is , how do I incorporate the historical stock returns and other factors and come up with a model that predicts the weights of the stocks in the portfolio? &lt;/p&gt;&#xA;" OwnerUserId="3482" LastEditorUserId="17043" LastEditDate="2015-12-28T14:23:26.357" LastActivityDate="2015-12-28T14:23:26.357" Title="Portfolio construction" Tags="&lt;portfolio&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22454" PostTypeId="2" ParentId="22448" CreationDate="2015-12-23T00:51:52.670" Score="1" Body="&lt;p&gt;To find the weights in the question (a) you should write your portfolio expected excess return and variance as:&#xA;$$&#xA;E[R_p^e] = w_A R_A + w_b R_B - R_f \\ &#xA;\sigma^2[R_p^e] = \sigma^2[w_A R_A + w_b R_B - R_f] = w_A^2\sigma_A^2 + w_B^2 \sigma_B^2 + 2 \rho_{AB}\sigma_A\sigma_B&#xA;$$&#xA;The sharpe ratio is given by:&#xA;$$&#xA;S(w_A,w_B) = \frac{E[R_p^e]}{\sigma[R_p^e]}&#xA;$$&#xA;So, to find the weights which maximize Sharpe ratio, you should solve the equation:&#xA;$$&#xA;\nabla S |_{w_A+w_B=1} = 0&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="13379" LastEditorUserId="13379" LastEditDate="2015-12-23T00:58:02.503" LastActivityDate="2015-12-23T00:58:02.503" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22455" PostTypeId="2" ParentId="22453" CreationDate="2015-12-23T01:55:06.187" Score="3" Body="&lt;p&gt;Markowitz portfolio optimization and variations of it usually boil down to maximizing expected returns while constraining the aggregate of your preferred measure for the portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The expected return does not have to be equal to the historical return in your model. You can feed in the factors of your choice within a model that outputs the expected return for each asset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In literature, it is usually an alternative measure of variance that is used to feed into portfolio optimization. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This publicly available paper has a good overview of developments in this area in its introduction, if you want to read more: &lt;a href=&quot;http://www.ima.umn.edu/~santosa/wiki/images/4/4b/Cvar_2.pdf&quot; rel=&quot;nofollow&quot;&gt;Porfolio Optimization with conditional VaR objective and constraints&lt;/a&gt; by Pavlo Krokhmal, Jonas Palmquist, and Stanislav Uryasev. &lt;/p&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2015-12-23T01:55:06.187" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22456" PostTypeId="2" ParentId="22435" CreationDate="2015-12-23T08:28:30.087" Score="1" Body="&lt;p&gt;To improve your model I would recommend you to take into acount the intraday periodicity : ie the fluctuation of the exchange rate over the daily cycle.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance we observe strong increase on the volatility around 07:00 GMT  (opening of European Market.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following image taken from   &lt;a href=&quot;http://doi.org/10.1016/S0927-5398(97)00004-2&quot; rel=&quot;nofollow noreferrer&quot;&gt;Andersen, T. G., &amp;amp; Bollerslev, T. (1997)&lt;/a&gt; illustrates it. It is the average (across several days) absolute returns of the 5 min interval for DM-$ . The drop between intervals 40 and 60 corresponds to the lunch hour in the Tokyo and Hong Kong markets. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/IWRy2.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/IWRy2.png&quot; alt=&quot;Avg Absolute Return&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So we know that at some periodic time of day the volatility will decrease or increase &lt;em&gt;for sure&lt;/em&gt;. You need to take it into account to improve your model. If you do not your forecast will be poor because in some way you are assuming a constant volatility over the day which is not true. Obviously the observed periodicity will depends of your timeframe. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a basic strategy to tackle this fact, you can apply your ARMA model on a &quot;de-periodicitized &quot; returns serie...&lt;/p&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2015-12-23T08:28:30.087" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22457" PostTypeId="2" ParentId="21813" CreationDate="2015-12-23T12:52:39.763" Score="2" Body="&lt;p&gt;Lets start with the Return on Equity (RoE) formula as you already have some of the information given: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;RoE = (Net Income/Sales)x(Sales/ Total Assets)x(Total Assets/Shareholders' equity)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the first two terms describe the Return on Assets (take out the Sales from the denominator of the first fraction and from the numerator of the second fraction): &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;RoA = Net Income/Total Assets&lt;/strong&gt; and we know &lt;strong&gt;RoA = 0.16&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your financial leverage ratio is &lt;strong&gt;Total Assets/Shareholders' equity = 2.0&lt;/strong&gt;.&#xA;Your retention rate is  &lt;strong&gt;b= 1-payout ratio = 1-0.60 =0.40&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The last equation we need is the one for the growth rate:&#xA;&lt;strong&gt;g = b x ROE =0.40 x 2.0 x 0.16 =0.128&lt;/strong&gt; or &lt;strong&gt;12.8%&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope it helps, if you can get access to CFA material (paid or publicly available) go through it as it explains it all well (any and all mistakes here are  solely mine of course :-) ...) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note also that some sources talk about Average Total Assets and Average shareholders equity etc which is the complete and correct way of calculations as they can and do change in the course of a financial year. I kept above formulas simple but one still gets the gist I hope... &lt;/p&gt;&#xA;" OwnerUserId="18522" LastActivityDate="2015-12-23T12:52:39.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22458" PostTypeId="2" ParentId="9166" CreationDate="2015-12-23T13:56:05.677" Score="8" Body="&lt;p&gt;The Strata project is the new pure Java market risk quant library from OpenGamma. For more information, see the &lt;a href=&quot;http://strata.opengamma.io/&quot; rel=&quot;noreferrer&quot;&gt;documentation&lt;/a&gt; and &lt;a href=&quot;https://github.com/OpenGamma/Strata&quot; rel=&quot;noreferrer&quot;&gt;GitHub&lt;/a&gt;. It is Apache v2 licensed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Strata takes the experience of the OG-Platform codebase referenced in the question and turns it into a library - no need for databases, servers or similar. Ease of use is a big focus and there are examples to allow easy evaluation. See this link for &lt;a href=&quot;http://strata.opengamma.io/product_coverage/&quot; rel=&quot;noreferrer&quot;&gt;asset class coverage&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Disclaimer: I work for OpenGamma, who develop Strata.&lt;/p&gt;&#xA;" OwnerUserId="18748" LastEditorUserId="18748" LastEditDate="2017-10-23T10:38:54.040" LastActivityDate="2017-10-23T10:38:54.040" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22459" PostTypeId="2" ParentId="16119" CreationDate="2015-12-23T14:16:11.903" Score="0" Body="&lt;p&gt;You can take a look at this paper:&#xA;Yifeng Li, Chih-Yu Chen, Wyeth W. Wasserman: Deep Feature Selection: Theory and Application to Identify Enhancers and Promoters. RECOMB 2015: 205-217. Input features can be selected in the deep neural network by this deep feature selection model / deep lasso.&lt;/p&gt;&#xA;" OwnerUserId="18749" LastActivityDate="2015-12-23T14:16:11.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22460" PostTypeId="2" ParentId="20853" CreationDate="2015-12-23T15:38:31.077" Score="1" Body="&lt;p&gt;The real world scenario you are describing as far as I understand it is a trader writing an OTC call option. His price has to reflect the current and expected future price/movement/volatility of the underlying, namely the commodity future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets first assume that the likely buyer of that option is interested in a a) ATM/ITM option or at least not too OTM, otherwise the premium will be likely too low for the writer to even bother going ahead with the transaction, and b) in an expiry on or near enough an underlying future's maturity (that should not be a problem as most commodities future markets offer maturities for days/weeks or at least monthly ones if they are traded 3 years into the future).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since there is no daily implied volatility published by a body like an exchange (e.g. LME, SGX, CBOE, etc) one could use as a substitute the historical (aka realised) volatility plus a (il)liquidity reserve. There are several ways to calculate historical volatility using the underlying future prices (Close on Close, OHLC, look up Parkinson, Garman-Klass, volatility cones, etc). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, addressing b) above again: what if the option's maturity can't 'fit' against any liquid traded future (i.e. you dont have an exact/near enough underlying price or time to maturity) ? Not a scenario I have read about or experienced but my guess would be that the underlying future price would be interpolated linearly from known points of the forward curve. Not sure if we are talking contango/backwardation (or even if we are talking perishable or storable commodities here...) but I guess the curve shape (spot out to 3 years) should allow linear interpolation somehow. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please note that I am also assuming from the question that we are talking 'vanilla' call option, therefore any 'standard' BS or Black76 or similar pricing method could apply assuming you have the necessary inputs described above.    &lt;/p&gt;&#xA;" OwnerUserId="18522" LastActivityDate="2015-12-23T15:38:31.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22461" PostTypeId="2" ParentId="22451" CreationDate="2015-12-23T15:54:03.707" Score="4" Body="&lt;p&gt;Since you're asking on a quant finance forum, the mathematical approach would be&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Decide on a model that the stock price follows, and&lt;/li&gt;&#xA;&lt;li&gt;Compute the expected value of the price, conditional on the most recent price.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;A famous model, made ubiquitous by Black, Scholes and Merton, is a geometric Brownian motion.  Under this model, the stock price $S_T$ at time $T$ given the price $S_0$ at time $0$ is&#xA;$$&#xA;S_T = S_0e^{\left(\mu - \frac{\sigma^2}{2}\right)T + \sigma \sqrt{T}Z},&#xA;$$&#xA;where $Z$ is a standard normal random variable.  The expected value of the stock price under this model is&#xA;$$&#xA;E(S_T) = S_0e^{\mu T}.&#xA;$$&#xA;You may use standard parameter estimation techniques to estimate the parameter $\mu$, such as maximum likelihood estimation (MLE).  But, I should warn you that estimating the drift rate $\mu$ is notoriously inaccurate.  Perhaps a user with more time series experience could suggest more robust models based on time series models, if that interests you.&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2015-12-23T15:54:03.707" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22462" PostTypeId="1" CreationDate="2015-12-23T18:50:45.157" Score="1" ViewCount="143" Body="&lt;p&gt;The Fed publishes Moody's seasoned corporate bond yields &lt;a href=&quot;http://www.federalreserve.gov/releases/h15/data.htm&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These yields are not broken out by maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to &lt;a href=&quot;https://www.economy.com/support/blog/buffet.aspx?did=06CB74FA-CBB9-4732-BC63-AE9B63AF8DF6&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; website, the yields represent &quot;long-term&quot; bonds, with minimum and average maturities of 20 and 28 years, respectively. First of all, can anyone validate this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second - are there short/medium term 'Moody's seasoned corporate bond yields' published for free anywhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not - where can I find a free data source for short term, medium and long term corporate bond yields?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to compare corporate bond yields against the treasury yield curve to assess credit spreads. Unfortunately, if the above is true, I only have data for the long end.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;" OwnerUserId="18448" LastActivityDate="2015-12-23T18:50:45.157" Title="Moody's seasoned corporate bond yields" Tags="&lt;yield-curve&gt;&lt;yield&gt;&lt;rates&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22463" PostTypeId="1" AcceptedAnswerId="22470" CreationDate="2015-12-23T20:29:45.207" Score="3" ViewCount="158" Body="&lt;p&gt;I'm trying to figure out if stochastic calculus is the right approach for this problem... but I only vaguely understand it and I am trying to gauge if I need to spend the time learning measure theory etc etc for something that could be much more trivial.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am going to make some simplifications here (e.g. normal instead of lognormal), so please bear with me.  I'm just trying to get my bearings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say I have two stocks, X and Y.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Stock X is worth 100 and the price is normally distributed with $\sigma_X = 1$ per period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Stock Y is worth 99 and the price is normally distributed with $\sigma_Y = 3.3333$ per period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The two stocks are 90% correlated and the beta is $0.9 \cdot 3.333/1 = 3$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what if I said to you, in one period, I'll give you stock X or stock Y, whichever has a greater value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the question is... what's the expected value of the max of the two stocks?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can, of course, simulate this scenario, but is there a way to get the answer closed form?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using Cholesky decomposition, I simulate two correlated random normals and give them the appropriate mean and standard deviation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I approximate the value of $\max(X,Y) \approx 100.6$&lt;/p&gt;&#xA;" OwnerUserId="18744" LastEditorUserId="3029" LastEditDate="2015-12-29T07:33:45.933" LastActivityDate="2015-12-29T07:33:45.933" Title="How much would one pay for the max of two stocks?" Tags="&lt;probability&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22464" PostTypeId="2" ParentId="22463" CreationDate="2015-12-23T21:26:24.740" Score="1" Body="&lt;p&gt;This took a 5 second Google search: &lt;a href=&quot;https://stats.stackexchange.com/questions/139072/distribution-of-the-maximum-of-two-correlated-normal-variables&quot;&gt;https://stats.stackexchange.com/questions/139072/distribution-of-the-maximum-of-two-correlated-normal-variables&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All you're really looking is simply to compute $E[\max\{X, Y\}]$, where $X, Y$ are two correlated normal random variables. The link there tells you the pdf of the random variable $W = \max\{X,Y\}$. From there, you can integrate and compute $E[W]$ &lt;s&gt; --- although most likely you can only numerically integrate in this case. &lt;/s&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Remark&lt;/em&gt;: Furthermore, if I may add, there's nothing &quot;stochastic calculus&quot; in your problem (at least the way that you phrase it). And also, measure theory is also unnecessary for this problem.&lt;/p&gt;&#xA;" OwnerUserId="17332" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2015-12-23T22:29:11.457" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22465" PostTypeId="2" ParentId="22428" CreationDate="2015-12-23T21:46:54.237" Score="2" Body="&lt;p&gt;I don't understand why you think the numbers dont match up.&#xA;In my opinion it all works out. Perhaps best if you first convert all numbers to percentages and for 1 underlying instead of 100 multiplier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From OVML you have&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;multiplier = 1 troy ounce &lt;/li&gt;&#xA;&lt;li&gt;S = 1075&lt;/li&gt;&#xA;&lt;li&gt;K = 1075&lt;/li&gt;&#xA;&lt;li&gt;r = 0.0033 &lt;/li&gt;&#xA;&lt;li&gt;T = 2/12 &lt;/li&gt;&#xA;&lt;li&gt;sig = 0.12&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Convert all into percentages:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;S = 100&lt;/li&gt;&#xA;&lt;li&gt;K = 100&lt;/li&gt;&#xA;&lt;li&gt;r = 0.0033&lt;/li&gt;&#xA;&lt;li&gt;T = 2/12&lt;/li&gt;&#xA;&lt;li&gt;sig = 0.12&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Stick into &lt;strong&gt;BLS pricer&lt;/strong&gt; &lt;a href=&quot;http://www.soarcorp.com/black_scholes_calculator.jsp&quot; rel=&quot;nofollow&quot;&gt;http://www.soarcorp.com/black_scholes_calculator.jsp&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Call = 2.06&lt;/li&gt;&#xA;&lt;li&gt;delta = 51%&lt;/li&gt;&#xA;&lt;li&gt;theta (daily) = -0.025&lt;/li&gt;&#xA;&lt;li&gt;gamma = 0.0781&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Stick into your formula: dS = sqrt( 2 * 0.025/0.071) = 0.7979&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Convert into percentage move = dS/S = 0.007979 = 0.8% (on daily basis)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Convert to annual move: dS/S * sqrt(252) = 0.8% * sqrt(252) = 12.6%&#xA;(which is very close to the implied vol you started out with, so it all makes sense).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; I went over your original email and now see why the bloomberg pricer ovml might be confusing you. In your original email you gave the following numbers&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Strike: 1074.7 (ATM) Spot: 1074.7 delta: 50.8044% Gamma: 9.7177% or&#xA;  9.71 Theta: -25.28&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Notice how you say that a gamma of 9.71 equals 9.71%? Your spot was 1075, therefore a gamma of 9.71 does not equal 9.71% but about 0.97%. This is were you went wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, it looks to me that the bloomberg pricer scales the theta  25.28 by the number of contracts (100 in your case) but that it does not scale the delta or gamma. The pricer simply gives you a delta of 51% and gamma 0.97%. So the theta of 1 contract is 25.28/100 = 0.2528&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sticking the number into your formula gives you $sqrt(2* 0.2528 / 0.0097) = 7.4$ (in USD). This converts into a percentage move of about $7.4 / 1075 = 0.7%. This daily percentage move of 0.7% you can convert into an annual move by multiplying with Sqrt(252). This should give you an annualized vol number of about 11%.&lt;/p&gt;&#xA;" OwnerUserId="17316" LastEditorUserId="17316" LastEditDate="2015-12-28T20:10:32.587" LastActivityDate="2015-12-28T20:10:32.587" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22469" PostTypeId="1" AcceptedAnswerId="22472" CreationDate="2015-12-24T01:54:32.393" Score="1" ViewCount="71" Body="&lt;p&gt;This may be a silly question on futures trading, but I haven't found a clear answer on the CME website. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the &lt;a href=&quot;http://www.cmegroup.com/trading/equity-index/international-index/nikkei-225-yen.html&quot; rel=&quot;nofollow&quot;&gt;Nikkei 225 Yen contract on the CME&lt;/a&gt;, which is denominated in Yen, the margin is also given in terms of Yen, e.g. currently it is &lt;a href=&quot;http://www.cmegroup.com/trading/equity-index/international-index/nikkei-225-yen_performance_bonds.html&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;450,000 JPY&lt;/code&gt;&lt;/a&gt; . &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I trade this contract via a broker, for example Interactive Brokers (IB) or etrade or any broker offering futures, and also suppose I have a USD base account. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do a brokers in the US (such as IB or etrade, etc.) take the margin paid my account? Do they convert some of the USD into JPY and then retain it as margin? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Subsequently, if I had a profit, will they give me back JPY or will they convert it into USD?&lt;/p&gt;&#xA;" OwnerUserId="5948" LastActivityDate="2015-12-24T17:16:57.620" Title="nikkei 225 yen contract on the CME" Tags="&lt;futures&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22470" PostTypeId="2" ParentId="22463" CreationDate="2015-12-24T02:01:17.140" Score="6" Body="&lt;p&gt;Consider two jointly normal random variables $X_1 \sim N(u_1, \sigma_1^2)$ and $X_2 \sim N(u_2, \sigma_2^2)$.&#xA;Note that,&#xA;\begin{align*}&#xA;\max(X_1, X_2) = X_2 + \max(X_1-X_2, \ 0).&#xA;\end{align*}&#xA;Moreover, $X_1-X_2$ is a normal random variable with mean $\mu=\mu_1-\mu_2$ and variance&#xA;\begin{align*}&#xA;\sigma^2 = \sigma_1^2+\sigma_2^2 - 2 \rho\sigma_1\sigma_2,&#xA;\end{align*}&#xA;where $\rho$ is the correlation. That is,&#xA;\begin{align*}&#xA;X_1-X_2 = \mu + \sigma \xi,&#xA;\end{align*}&#xA;where $\xi$ is a standard normal random variable.&#xA;Therefore,&#xA;\begin{align*}&#xA;E\left(\max((X_1, X_2) \right) &amp;amp;= E(X_2) + E\left(\max(\mu + \sigma \xi, \ 0)\right)\\&#xA;&amp;amp;=\mu_2 + \frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}\max(\mu + \sigma x, \ 0)\,e^{-\frac{x^2}{2}}\,dx\\&#xA;&amp;amp;=\mu_2 +  \frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}(\mu + \sigma x) \,\mathbb{I}_{\mu + \sigma x\geq 0}\,e^{-\frac{x^2}{2}}\, dx\\&#xA;&amp;amp;=\mu_2 +  \frac{1}{\sqrt{2\pi}}\int_{-\frac{\mu}{\sigma}}^{\infty}(\mu + \sigma x)\,e^{-\frac{x^2}{2}} dx\\&#xA;&amp;amp;=\mu_2 + \mu \,N\Big(\frac{\mu}{\sigma}\Big) +\frac{\sigma}{\sqrt{2\pi}}\,e^{-\frac{\mu^2}{2\sigma^2}},&#xA;\end{align*}&#xA;where $N$ is the cumulative distribution function of a standard normal random variable.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-12-28T17:35:33.860" LastActivityDate="2015-12-28T17:35:33.860" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22471" PostTypeId="1" AcceptedAnswerId="22586" CreationDate="2015-12-24T16:28:41.010" Score="2" ViewCount="515" Body="&lt;p&gt;There is somewhere summary of methods that can be used to estimate parameters of SDE?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I currently using MLE and regression due to linear dependence between samples. I searching for something different due to many problems with maintainability of this SDE when using calibration method like this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think it should be exist some method that works similar to downhill-simplex algorithm, since I want avoid hassle with math, but I can't find any.&lt;/p&gt;&#xA;" OwnerUserId="6175" LastActivityDate="2016-01-04T19:35:34.823" Title="Methods of SDE Calibration" Tags="&lt;stochastic-calculus&gt;&lt;sde&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22472" PostTypeId="2" ParentId="22469" CreationDate="2015-12-24T17:16:57.620" Score="2" Body="&lt;p&gt;I cannot say how every broker will do it, but from personal experience:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They will ask you for an amount in USD, that its to be calculated using their fx pricing and future valuation. Any margin requirement will be asked in USD and payed in USD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best Regards &lt;/p&gt;&#xA;" OwnerUserId="17043" LastActivityDate="2015-12-24T17:16:57.620" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22473" PostTypeId="2" ParentId="22463" CreationDate="2015-12-24T18:15:43.603" Score="1" Body="&lt;p&gt;I'd recommend following Margrabe's formula, which is a closed form Black-Scholes type formula for valuing european call option whose payoff at time T = max[0, S2(T) - S1(T)]. If you create a portfolio of S1 and such a call option, your payoff will be higher of the two stock prices - which is what you want. Plus this has a more general assumption of prices being log-normally distributed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Margrabe's call option formula: &#xA;C = S2.N(d1) - S1.k.N(d2)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For d1, d2 and other details please refer to the paper: &lt;a href=&quot;http://www.stat.nus.edu.sg/~stalimtw/MFE5010/PDF/margrabe1978.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.stat.nus.edu.sg/~stalimtw/MFE5010/PDF/margrabe1978.pdf&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="17405" LastActivityDate="2015-12-24T18:15:43.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22474" PostTypeId="1" CreationDate="2015-12-24T18:16:21.010" Score="3" ViewCount="86" Body="&lt;p&gt;How do we include inflation in our compound interest calculations? &#xA;E.g. if we have current principal of &lt;code&gt;1000$&lt;/code&gt; and the interest rate is 3% after 10 years we have &lt;code&gt;1344$&lt;/code&gt; (used this &lt;a href=&quot;http://www.moneychimp.com/calculator/compound_interest_calculator.htm&quot; rel=&quot;nofollow&quot;&gt;calculator&lt;/a&gt;)&lt;br&gt;&#xA;But if for this exercise we wanted to take inflation into account let's say 2% how would that be part of our formula?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;br&gt;&#xA;I know that the number including the inflation is &lt;code&gt;1102$&lt;/code&gt;.&lt;br&gt;&#xA;I don't know exactly how to do the calculations to get the &lt;code&gt;1102$&lt;/code&gt;. Getting the &lt;code&gt;1334$&lt;/code&gt; is straightforward but I am confused on how to include inflation to get the &lt;code&gt;1102$&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="18756" LastEditorUserId="18756" LastEditDate="2015-12-25T11:39:40.680" LastActivityDate="2015-12-25T11:39:40.680" Title="How do we include inflation in our calculations?" Tags="&lt;interest-rates&gt;&lt;inflation&gt;&lt;interest&gt;&lt;accrued-interest&gt;" AnswerCount="2" CommentCount="3" ClosedDate="2015-12-25T17:04:33.770" ContentLicense="CC BY-SA 3.0" />
  <row Id="22475" PostTypeId="1" CreationDate="2015-12-24T18:37:49.183" Score="13" ViewCount="9339" Body="&lt;p&gt;I'm looking for a time series database that can be easily used with Python and Pandas objects such as DataFrame, Panel...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But these objects will always contains time series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally I'm looking for an open source database.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want this TSDB able to manage ticks data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2 millions rows should be processed (stored and retrieved) in less than 30 seconds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What do you suggest? What are the pros and cons of each?&lt;/p&gt;&#xA;" OwnerUserId="2838" LastActivityDate="2016-01-07T15:58:50.327" Title="What time series database can be used with Python and Pandas?" Tags="&lt;time-series&gt;&lt;python&gt;&lt;tick-data&gt;&lt;database&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22476" PostTypeId="2" ParentId="22474" CreationDate="2015-12-24T18:56:47.873" Score="1" Body="&lt;p&gt;This calculator does not include inflation in whatever interest rate you specify (I checked). Usually, the rate quoted by banks is the nominal interest rate, which is simply how much your capital will appreciate with inflation (e.g. higher inflation would yield higher returns). It does not take into account purchasing power and is calculated as follows: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Nominal Rate = (1 + Real Interest Rate)(1 + Inflation Rate) - 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In terms of trying to &quot;take inflation into account&quot; I'm not totally sure what you mean. If you mean factor inflation into the equation so that the purchasing power of the future value is quoted in today's dollar amount, the simplest way would be to lower the rate you entered into the calculator by expected future inflation (assuming you're using the commonly cited nominal rate or using the interest rate as a proxy for total return). You could also divide the future value from the calculator by: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(1 + expected inflation)^n&lt;/code&gt; &lt;/p&gt;&#xA;" OwnerUserId="17742" LastActivityDate="2015-12-24T18:56:47.873" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="22477" PostTypeId="2" ParentId="22474" CreationDate="2015-12-24T20:32:32.047" Score="1" Body="&lt;p&gt;Further to a post &lt;a href=&quot;https://money.stackexchange.com/a/56847/11768&quot;&gt;here&lt;/a&gt;, you can appreciate by the interest rate and depreciate by the inflation rate at the same time like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;principal       p = 1000&#xA;interest rate   r = 0.03&#xA;inflation       i = 0.02&#xA;number of years n = 10&#xA;&#xA;p (1 + r)^n (1 + i)^-n = 1102.48&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The calculation can be simplified with a factor &lt;code&gt;x&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x = i (1 + r)/(1 + i) = 0.0201961&#xA;&#xA;p (1 + (r - x))^n = 1102.48&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;These calculations give the future value in 10 years appreciated by interest at 3% but depreciated by inflation at 2%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it differs from the example &lt;a href=&quot;https://en.wikipedia.org/wiki/Fisher_equation#Example&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;, which - like Brumder's initial answer - counts inflation as a appreciating factor.&lt;/p&gt;&#xA;" OwnerUserId="7178" LastEditorUserId="-1" LastEditDate="2017-04-13T12:25:30.743" LastActivityDate="2015-12-24T22:32:43.240" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22478" PostTypeId="1" CreationDate="2015-12-25T08:22:52.037" Score="4" ViewCount="253" Body="&lt;p&gt;There has been a discussion about how leverage affects Sharpe Ratios, but not in the context of leveraged ETFs (such as 2x or 3x).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm just wondering how leveraged ETFs, if at all, change the conclusions reached.&lt;/p&gt;&#xA;" OwnerUserId="18759" LastActivityDate="2015-12-25T13:20:18.177" Title="Sharpe ratio with leveraged ETFs" Tags="&lt;sharpe-ratio&gt;&lt;etf&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22479" PostTypeId="2" ParentId="22478" CreationDate="2015-12-25T13:20:18.177" Score="5" Body="&lt;p&gt;Probably missing something here but if $X$ has $E(X) = \mu$ and $variance(X) = \sigma^2$ then $2X$ has $E(2X) = 2 \mu, variance(2X) = 4\sigma^2$. Thus the sharp ratio defined as $\frac{\mu}{\sigma}$ stays the same for the 2x leveraged and the regular index. &lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2015-12-25T13:20:18.177" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22480" PostTypeId="2" ParentId="22433" CreationDate="2015-12-25T13:47:42.570" Score="5" Body="&lt;p&gt;We first list the assumptions.&#xA;\begin{align*}&#xA;g_{t+1} &amp;amp;= \mu_g + \sigma_{g, t} z_{g, t+1}, \tag{1}\\&#xA;\sigma_{g, t+1}^2 &amp;amp;= a_{\sigma} + \rho_{\sigma} \sigma_{g, t}^2 + \sqrt{q_t} z_{\sigma, t+1}, \tag{2} \\&#xA;q_{t+1} &amp;amp;= a_{q} + \rho_q q_t + \varphi_q \sqrt{q_t} z_{q, t+1}. \tag{3} &#xA;\end{align*}&#xA;Moreover,&#xA;\begin{align*}&#xA;r_{t+1} &amp;amp;= -\ln \delta +\psi^{-1} \mu_g - \frac{(1-\gamma)^2}{2\theta} \sigma_{g, t}^2 + (\kappa_1 \rho_q-1)A_q q_t \\&#xA;&amp;amp; \quad +\sigma_{g, t}z_{g, t+1} +\kappa_1\sqrt{q_t} (A_{\sigma}z_{\sigma, t+1} + A_q \varphi_q z_{q, t+1}). \tag{10} &#xA;%\sigma_{r, t}^2 &amp;amp;= \sigma_{g, t}^2 + \kappa_1^2(A_{\sigma}^2 + A_q^2 \varphi_q^2)q_t, \tag{12}&#xA;\end{align*}&#xA;From (2) and (3), &#xA;\begin{align*}&#xA;\sigma_{r, t+1}^2 &amp;amp;= \sigma_{g, t+1}^2 + \kappa_1^2(A_{\sigma}^2 + A_q^2 \varphi_q^2)q_{t+1}, \tag{13}\\&#xA;&amp;amp;=a_{\sigma} + \rho_{\sigma} \sigma_{g, t}^2 + \sqrt{q_t} z_{\sigma, t+1} \\&#xA;&amp;amp;\quad + \kappa_1^2(A_{\sigma}^2 + A_q^2 \varphi_q^2)(a_{q} + \rho_q q_t + \varphi_q \sqrt{q_t} z_{q, t+1}).&#xA;\end{align*}&#xA;From (1) and (10),&#xA;\begin{align*}&#xA;m_{t+1} &amp;amp;= \theta \ln \delta - \theta \psi^{-1}g_{t+1}+(\theta-1)r_{t+1} \tag{4}\\&#xA;&amp;amp;=\theta \ln \delta - \theta \psi^{-1}(\mu_g + \sigma_{g, t} z_{g, t+1})\\&#xA;&amp;amp;\quad +(\theta-1)\bigg[-\ln \delta +\psi^{-1} \mu_g - \frac{(1-\gamma)^2}{2\theta} \sigma_{g, t}^2 + (\kappa_1 \rho_q-1)A_q q_t\\&#xA;&amp;amp;\quad +\sigma_{g, t}z_{g, t+1} +\kappa_1\sqrt{q_t} (A_{\sigma}z_{\sigma, t+1} + A_q \varphi_q z_{q, t+1})\bigg].&#xA;\end{align*}&#xA;Therefore,&#xA;\begin{align*}&#xA;%E_t(m_{t+1}) &amp;amp;= \theta \ln \delta - \theta \psi^{-1}\mu_g + (\theta-1)\bigg[-\ln \delta +\psi^{-1} \mu_g - \frac{(1-\gamma)^2}{2\theta} \sigma_{g, t}^2 + (\kappa_1 \rho_q-1)A_q q_t\bigg],\\&#xA;%{\rm Cov}_t(m_{t+1}, r_{t+1}) &amp;amp;= -\gamma \sigma_{g, t}^2 + (\theta -1) \kappa_1^2 q_t\big(A_{\sigma}^2 + A_q^2 \varphi_q^2\big),\tag{11}\\&#xA;{\rm Cov}_t(m_{t+1}, \sigma_{r, t+1}^2) &amp;amp;=(\theta -1)\kappa_1 \Big[A_{\sigma}+A_q\kappa_1^2\big(A_{\sigma}^2 + A_q^2 \varphi_q^2\big) \varphi_q^2 \Big]q_t .&#xA;\end{align*}&#xA;Furthermore, from the conditional normality of $m_{t+1}$ and $\sigma_{r, t+1}^2$,&#xA;\begin{align*}&#xA;E_t^Q\left(\sigma_{r, t+1}^2\right) &amp;amp;=E_t\left(\sigma_{r, t+1}^2M_{t+1}\right)/E_t(M_{t+1})\\&#xA;&amp;amp;\approx \ln\left(e^{-r_{f, t}} E_t\left(e^{m_{t+1}+\sigma_{r, t+1}^2} \right) \right) - \frac{1}{2} {\rm Var}_t\left(\sigma_{r, t+1}^2\right) \tag{*}\\&#xA;&amp;amp;=\ln\left(e^{-r_{f, t}} e^{E_t(m_{t+1}) + \frac{1}{2}{\rm Var}_t(m_{t+1})+E_t(\sigma_{r, t+1}^2)+ \frac{1}{2} {\rm Var}_t\left(\sigma_{r, t+1}^2\right) + {\rm Cov}_t(m_{t+1}, \sigma_{r, t+1}^2)} \right) \\&#xA;&amp;amp;\quad- \frac{1}{2} {\rm Var}_t\left(\sigma_{r, t+1}^2\right)\\&#xA;&amp;amp;=\ln\left(e^{-r_{f, t}} E_t\left(e^{m_{t+1}}\right)  e^{E_t(\sigma_{r, t+1}^2)+ \frac{1}{2} {\rm Var}_t\left(\sigma_{r, t+1}^2\right) + {\rm Cov}_t(m_{t+1}, \sigma_{r, t+1}^2)} \right) - \frac{1}{2} {\rm Var}_t\left(\sigma_{r, t+1}^2\right)\\&#xA;&amp;amp;=E_t\left(\sigma_{r, t+1}^2\right) + {\rm Cov}_t(m_{t+1}, \sigma_{r, t+1}^2) \\&#xA;&amp;amp;=E_t\left(\sigma_{r, t+1}^2\right) + (\theta-1)\kappa_1\Big[A_{\sigma} + A_q \kappa_1^2 \big(A_{\sigma}^2 + A_q^2 \varphi_q^2\big)\varphi_q^2 \Big]q_t.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Interpretation of Log-linear approximation (*).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Regarding Log-linear approximation (*), as the paper did not supply an explanation, we provide one possible interpretation below. Specifically, note that &#xA;\begin{align*}&#xA;e^{\sigma_{r, t+1}^2} &amp;amp;\approx 1+ \sigma_{r, t+1}^2 + \frac{1}{2} \left(\sigma_{r, t+1}^2\right)^2\\&#xA;&amp;amp;\approx 1+ \sigma_{r, t+1}^2 + \frac{1}{2} \Big[\big(\sigma_{r, t+1}^2\big)^2 - \left(E_t\big(\sigma_{r, t+1}^2\big)\right)^2\Big]\\&#xA;&amp;amp;\approx 1+ \sigma_{r, t+1}^2 + \frac{1}{2}{\rm Var}_t \big(\sigma_{r, t+1}^2\big).&#xA;\end{align*}&#xA;Then, &#xA;\begin{align*}&#xA;\ln\left(e^{-r_{f, t}} E_t\left(e^{m_{t+1}+\sigma_{r, t+1}^2} \right) \right) &amp;amp;\approx \ln\left(e^{-r_{f, t}} E_t\left(e^{m_{t+1}}\left(1+ \sigma_{r, t+1}^2 + \frac{1}{2}{\rm Var}_t \big(\sigma_{r, t+1}^2\big) \right) \right) \right)\\&#xA;&amp;amp;\approx \ln \left(1 +e^{-r_{f, t}} E_t\left(\sigma_{r, t+1}^2M_{t+1}\right) + \frac{1}{2}{\rm Var}_t \big(\sigma_{r, t+1}^2\big) \right)\\&#xA;&amp;amp;\approx e^{-r_{f, t}} E_t\left(\sigma_{r, t+1}^2M_{t+1}\right) + \frac{1}{2}{\rm Var}_t \big(\sigma_{r, t+1}^2\big)\\&#xA;&amp;amp;= E_t\left(\sigma_{r, t+1}^2M_{t+1}\right)/E_t(M_{t+1}) + \frac{1}{2}{\rm Var}_t \big(\sigma_{r, t+1}^2\big).&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;E_t\left(\sigma_{r, t+1}^2M_{t+1}\right)/E_t(M_{t+1}) &amp;amp;\approx \ln\left(e^{-r_{f, t}} E_t\left(e^{m_{t+1}+\sigma_{r, t+1}^2} \right) \right) -\frac{1}{2}{\rm Var}_t \big(\sigma_{r, t+1}^2\big).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2015-12-27T18:36:06.087" LastActivityDate="2015-12-27T18:36:06.087" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="22482" PostTypeId="1" CreationDate="2015-12-26T08:13:24.880" Score="6" ViewCount="164" Body="&lt;p&gt;I am doing a research on communication protocol design. &#xA;A file of $n$ blocks is transferred in several rounds and&#xA;$R_i$ denotes the number of blocks received in the $i$-th round.&#xA;The sender sends $n-R_1-R_2-\cdots-R_{i-1}$ blocks in the $i$-th round and&#xA;$X_i$ denotes the state of the channel in the $i$-th round.&#xA;Actually, I would like to know the expected value of $\sum_{m=0}^l R_m$ to estimate the transmission rounds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume that $X_i$ satisfies a first-order discrete time-homogeneous Markov chain with two states, thus I can obtain the random variables $R_i\mid R_1,R_2, \ldots, R_{i-1}, X_i$ conditioned on the previous states and the state of the $i$-th step of the Markov process $X$, i.e.,&#xA;$$&#xA;R_i \sim Bin(n-R_1-R_2-\cdots-R_{i-1},p(X_i)).&#xA;$$&#xA;By induction on $i$, we have $R_1+R_2+\cdots+R_i \mid X_1,X_2,\ldots,X_i$, i.e.,&#xA;$$&#xA;R_1+R_2+\cdots+R_i \sim Bin(n,1-\prod_{m=1}^{i} (1-p(X_i))).&#xA;$$&#xA;I would like to evaluate the expected value of $\sum_{m=1}^l R_m$, and deduce as follows.&#xA;$$&#xA;\begin{aligned}&#xA;  &amp;amp; \mathbb{E}\left[\sum_{m=1}^l R_m \right] \\&#xA;= &amp;amp; \mathbb{E}\left[\mathbb{E}\left[\sum_{m=1}^l R_m \Bigg|  X_1,X_2,\ldots,X_l \right] \right]\\&#xA;= &amp;amp; \mathop{\mathbb{E}}_{\text{over } X_1,X_2,\ldots,X_l} \left[ n\times (1-\prod_{m=1}^{l} (1-p(X_m))) \right]\\&#xA;= &amp;amp; n \times \left( 1- \mathop{\mathbb{E}}_{\text{over } X_1,X_2,\ldots,X_l} \left[  \prod_{m=1}^{l}1-p(X_m) \right] \right).&#xA;\end{aligned}&#xA;$$&#xA;I stuck here because if I carry out the evaluation of the expectations, the number of terms would be $2^l$, which is too large for computation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An alternative approach is to evaluate the random variable $\sum_{m=1}^l R_m$ using discrete Ito integral, hoping this will simply the formula of the expectation. But I lack the knowledge of real analysis and measure theory, self studying stochastic calculus is difficult for me. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions or hints? Thanks in advance!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question has been posed in the Math Stackexchange &lt;a href=&quot;https://math.stackexchange.com/posts/1588403&quot;&gt;Expectation over Markov Process and discrete Ito integral&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="18765" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2015-12-29T06:09:19.857" Title="Expectation over Markov Process and discrete Ito integral (discrete stochastic calculus)" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="22483" PostTypeId="1" CreationDate="2015-12-26T16:29:26.030" Score="1" ViewCount="1621" Body="&lt;p&gt;I want to use the SGED distribution of Theodossiou for GARCH estimation, however, I am struggling to understand which is the correct pdf function of the distribution. Let me just say that the &lt;code&gt;rugarch&lt;/code&gt; package cannot help me, as it estimates the GARCH with the SGED of Fernandez and Steel. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The distribution is introduced in the following paper in equation (10):&#xA;&lt;a href=&quot;https://www.researchgate.net/profile/Panayiotis_Theodossiou/publication/228262554_Skewed_Generalized_Error_Distribution_of_Financial_Assets_and_Option_Pricing/links/546a5d070cf2397f783017af.pdf&quot; rel=&quot;nofollow&quot;&gt;https://www.researchgate.net/profile/Panayiotis_Theodossiou/publication/228262554_Skewed_Generalized_Error_Distribution_of_Financial_Assets_and_Option_Pricing/links/546a5d070cf2397f783017af.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the latest paper by Theodossiou and also has the pdf of the SGED distribution described as in equation (49): &lt;a href=&quot;http://www.mfsociety.org/modules/modDashboard/uploadFiles/journals/MJ~0~p1a4fjq38m1k2p45t6481fob7rp4.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.mfsociety.org/modules/modDashboard/uploadFiles/journals/MJ~0~p1a4fjq38m1k2p45t6481fob7rp4.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a bit different definition of the SGED distribution, but the results are almost identical for the case I am considering.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is one more specification in this paper on page 16: &lt;a href=&quot;https://www.researchgate.net/profile/J_Mcdonald4/publication/227347472_Robust_estimation_with_flexible_parametric_distributions_estimation_of_utility_stock_betas/links/00b495225f8fe3511c000000.pdf&quot; rel=&quot;nofollow&quot;&gt;https://www.researchgate.net/profile/J_Mcdonald4/publication/227347472_Robust_estimation_with_flexible_parametric_distributions_estimation_of_utility_stock_betas/links/00b495225f8fe3511c000000.pdf&lt;/a&gt;&#xA;The A parameter is defined differently than in the first paper and the density looks differently.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you please advise me which pdf should I use as I am confused by such a number of definitions for the same thing and Theodossiou is the author or co-author of all the above-mentioned papers. If you know where I can find the definition of SGED by Fernandez and Steel I would also be grateful, as I am unable to find the pdf of the function. The help files for &lt;code&gt;rugarch&lt;/code&gt; are not helpful on this matter.&lt;/p&gt;&#xA;" OwnerUserId="17464" LastActivityDate="2015-12-26T16:29:26.030" Title="Skewed Generalized Error Distribution's (SGED) pdf" Tags="&lt;r&gt;&lt;garch&gt;&lt;matlab&gt;&lt;estimation&gt;&lt;distribution&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22485" PostTypeId="1" AcceptedAnswerId="22488" CreationDate="2015-12-26T19:33:37.463" Score="17" ViewCount="4914" Body="&lt;p&gt;There are lot of questions on this website related to the replication of the empirical part of financial papers. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I noticed that some (honest) authors provide on their personal website some replication code in order to reproduce their model/simulations. I found &lt;strong&gt;&lt;em&gt;very&lt;/em&gt;&lt;/strong&gt; useful theses sites but they are rare.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So do you know a website that lists some replications codes (or list the links to these codes) ?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or a website devoted to this end (finance-oriented) that allow us to upload our personal replication code for well-known papers?&#xA;I googled with no success but I can't imagine it does not exist.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2015-12-26T23:59:13.140" LastActivityDate="2016-02-12T14:42:03.367" Title="Is there a website that lists replication code of financial papers?" Tags="&lt;r&gt;&lt;research&gt;&lt;matlab&gt;&lt;codes&gt;&lt;ox&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="18" ContentLicense="CC BY-SA 3.0" />
  <row Id="22486" PostTypeId="2" ParentId="9745" CreationDate="2015-12-26T21:03:43.720" Score="0" Body="&lt;p&gt;BS is a purely mathematical construction, not based on economic fundamentals. For the SPX to fall to zero or close to it would require a lower probably than stipulate by BS (extinction event might do it, in which case both parties would fail, as well as all humans so it wouldn't matter anyway), hence BS is overestimating the probability. Setting a hypothetical reflecting barrier at, say, p=300 (the SPX is at 2050 now) and then taking the time to 100 years when pricing the option can have great ramifications. This is can also explain why selling put cash covered options tends to be a superior strategy  &lt;/p&gt;&#xA;" OwnerUserId="15081" LastActivityDate="2015-12-26T21:03:43.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22487" PostTypeId="2" ParentId="25" CreationDate="2015-12-26T21:35:57.630" Score="2" Body="&lt;p&gt;If markets are largely efficient, then it's logical that options prices should be, too. Hence, over time, options will be priced correctly, even in the absence of an official formula. Having an official formula helps when computers update thousands of options continuously throughout the day &lt;/p&gt;&#xA;" OwnerUserId="15081" LastActivityDate="2015-12-26T21:35:57.630" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22488" PostTypeId="2" ParentId="22485" CreationDate="2015-12-26T22:33:36.487" Score="8" Body="&lt;p&gt;&lt;a href=&quot;http://replication.uni-goettingen.de/&quot; rel=&quot;noreferrer&quot;&gt;http://replication.uni-goettingen.de/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(The below text was added by Jan Höffler who founded the wiki.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This site is a replication project for papers, so far mainly in economics but open to any field. It serves as a database of empirical studies, the availability of replication material for them and of replication studies. It can help teaching replication to students.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can &lt;a href=&quot;http://tinyurl.com/ReplicationWiki-financial-econ&quot; rel=&quot;noreferrer&quot;&gt;search by codes of the Journal of Economic Literature and find more than 200 studies&lt;/a&gt; with &lt;a href=&quot;http://replication.uni-goettingen.de/wiki/index.php/Category:G_-_Financial_Economics&quot; rel=&quot;noreferrer&quot;&gt;code G for financial economics&lt;/a&gt;. You will see many of them have program code, and it is indicated &lt;a href=&quot;http://replication.uni-goettingen.de/wiki/index.php/Category:Article_software_used&quot; rel=&quot;noreferrer&quot;&gt;which software was used&lt;/a&gt;. As you tagged &lt;a href=&quot;http://replication.uni-goettingen.de/wiki/index.php/R&quot; rel=&quot;noreferrer&quot;&gt;r&lt;/a&gt; (&lt;a href=&quot;http://tinyurl.com/ReplicationWiki-Finance-R&quot; rel=&quot;noreferrer&quot;&gt;2&lt;/a&gt;), &lt;a href=&quot;http://replication.uni-goettingen.de/wiki/index.php/MATLAB&quot; rel=&quot;noreferrer&quot;&gt;MATLAB&lt;/a&gt; (&lt;a href=&quot;http://tinyurl.com/ReplicationWiki-Finance-MATLAB&quot; rel=&quot;noreferrer&quot;&gt;54&lt;/a&gt;) and &lt;a href=&quot;http://replication.uni-goettingen.de/wiki/index.php/Ox&quot; rel=&quot;noreferrer&quot;&gt;Ox&lt;/a&gt; (&lt;a href=&quot;http://tinyurl.com/ReplicationWiki-Finance-Ox&quot; rel=&quot;noreferrer&quot;&gt;1&lt;/a&gt;), click on them to get all studies for which these packages were used. The numbers indicate how many of them currently have JEL code G and clicking on them brings you to the combined searches. Note that not all publications use JEL codes, so you will be able to find more finance studies with a &lt;a href=&quot;http://replication.uni-goettingen.de/wiki/index.php?search=&amp;amp;fulltext=Search&amp;amp;title=Special%3ASearch&quot; rel=&quot;noreferrer&quot;&gt;full text search&lt;/a&gt;, &lt;a href=&quot;http://replication.uni-goettingen.de/wiki/index.php/Category:Article_keywords&quot; rel=&quot;noreferrer&quot;&gt;search by keyword&lt;/a&gt;, or maybe by &lt;a href=&quot;http://replication.uni-goettingen.de/wiki/index.php/Category:Article_data_source&quot; rel=&quot;noreferrer&quot;&gt;data source&lt;/a&gt;. The list of data sources so far is very incomplete, but it's a wiki, anyone can expand it in any direction. You can also &lt;a href=&quot;http://replication.uni-goettingen.de/wiki/index.php/ReplicationWiki:Community_portal&quot; rel=&quot;noreferrer&quot;&gt;make suggestions&lt;/a&gt;. And you can &lt;a href=&quot;http://replication.uni-goettingen.de/wiki/index.php/Help:Replication_relevance_ranking&quot; rel=&quot;noreferrer&quot;&gt;vote (anonymously) which studies should be replicated&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the &lt;a href=&quot;http://cfr.ivo-welch.info/&quot; rel=&quot;noreferrer&quot;&gt;Critical Finance Review&lt;/a&gt; has a &lt;a href=&quot;http://cfr.ivo-welch.info/RFP.htm&quot; rel=&quot;noreferrer&quot;&gt;special focus on replications&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Uploading code is also possible at repositories like &lt;a href=&quot;https://github.com/&quot; rel=&quot;noreferrer&quot;&gt;GitHub&lt;/a&gt; or the &lt;a href=&quot;https://osf.io/&quot; rel=&quot;noreferrer&quot;&gt;Open Science Framework&lt;/a&gt; but so far there is no focus on finance there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.runmycode.org/&quot; rel=&quot;noreferrer&quot;&gt;runmycode.org&lt;/a&gt; has data and code for a number of published finance papers but it is meant to be the authors' own material. &lt;/p&gt;&#xA;" OwnerUserId="17332" LastEditorUserId="848" LastEditDate="2016-02-12T14:42:03.367" LastActivityDate="2016-02-12T14:42:03.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22489" PostTypeId="2" ParentId="22449" CreationDate="2015-12-26T22:47:07.867" Score="0" Body="&lt;p&gt;Not sure what the exact market convention is for equity options and notional value. To my knowledge people use it in 2 different ways, of which what you described is one way:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;notional = number contracts * spot * multiplier (what you said)&lt;/li&gt;&#xA;&lt;li&gt;notional = number contracts * strike * multiplier (other convention)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Both conventions make sense in their own right. So to answer your question, Yes what you proposed is correct. though the other solution using strike is also correct.&lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2015-12-26T22:47:07.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22490" PostTypeId="1" AcceptedAnswerId="22492" CreationDate="2015-12-27T00:52:55.443" Score="2" ViewCount="179" Body="&lt;p&gt;For my research I need to obtain a series of densities, however, I am encountering some problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first problem is perhaps very simple, but the answer eludes me. Let's say I have an observation from a time series, $x=0.001$ together with estimated mean $\mu=0.0001$ and standard deviation $\sigma=0.4$. Using R:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dnorm(0.001, 0.0001, 0.4)&#xA;z=(0.001-0.0001)/0.4&#xA;dnorm(z, 0, 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where z is the standardized variable. Why are the result different? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second issue is connected to Hansen's Skew-t distribution. Let's add the skew $\lambda=0.1$ and shape $\eta=5$ parameters. When plugging in the all the parameters into the pdf (I take z which takes $\mu$ and $\sigma$ into account) I obtain $0.4832$, but when I use the &lt;code&gt;sgt&lt;/code&gt; package in R:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dsgt(0.001, 0.0001, 0.4, 0.1, p = 2, 5, mean.cent=TRUE, var.adj=TRUE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Iobtain $1.075749$. Inputting the standardized variable z and $\mu = 0$ and $\sigma = 1$ into the above yields $0.5425881$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you please explain the reason why the values are different?&lt;/p&gt;&#xA;" OwnerUserId="17464" LastActivityDate="2015-12-27T14:37:12.967" Title="Problem with obtaining densities" Tags="&lt;r&gt;&lt;distribution&gt;&lt;normal-distribution&gt;&lt;standard-deviation&gt;&lt;density&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22492" PostTypeId="2" ParentId="22490" CreationDate="2015-12-27T12:44:34.440" Score="3" Body="&lt;p&gt;You know that :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X \sim N(\mu,\sigma^2)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Z = \large\frac{X-\mu}{\sigma}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\text{Var}(Z) = \large\frac{1}{\sigma^2}\text{Var}(X) = \large\frac{1}{\sigma^2}\sigma^2 = 1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So that $Z \sim N(0,1)$. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;However note that the pdf evaluated for X and Z  have &lt;strong&gt;different&#xA;  domains&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The following figure illustrate it  :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/uniBR.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/uniBR.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$X$ is plotted in a) and $Z$ in b)&lt;/li&gt;&#xA;&lt;li&gt;Their respective normal pdf are plotted in c) and d). Note that their integrals equals 1.&lt;/li&gt;&#xA;&lt;li&gt;In e) I applied the pdf of Z on the (wrong) original domain , notice that the integral is different of 1.&lt;/li&gt;&#xA;&lt;li&gt;To obtain the correct pdf on the original domain we need to scale the pdf(Z) by ($1/ \sigma$), this is done in f). The integral is ok and equal to 1.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The vertical line is evaluated at X= 1.5, you see that the density differs accordingly the domain. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in your example you also need to scale the density by ($1/\sigma$) :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(1/sigma)*dnorm(z, 0, 1) = dnorm(0.001, 0.0001, 0.4)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To summarize when you use a normal transformation you need to scale the density by  ($1/ \sigma$) to get the correct density in the original domain.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;You can find the matlab code used in this answer &lt;a href=&quot;http://pastebin.com/jHdR4igj&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I think you second issue  and some of your others questions  are related to this problem.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2015-12-27T12:44:34.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22493" PostTypeId="2" ParentId="22490" CreationDate="2015-12-27T13:21:27.013" Score="1" Body="&lt;p&gt;Have a look at &lt;code&gt;?dnorm&lt;/code&gt;, and rather use the &lt;code&gt;standardized value&lt;/code&gt; as argument in your function, in addition to &lt;code&gt;mean&lt;/code&gt; and &lt;code&gt;sd&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;a_&amp;lt;-dnorm((0.001-0.0001)/0.4, mean=0, sd=1)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope it helps&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[EDIT]&lt;/strong&gt; Likewise from &lt;code&gt;?dsgt&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;st&amp;lt;-(0.001-0.0001)/0.4&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;skewt&amp;lt;-dsgt(st, mu=0, sigma=1, lambda=0.1, p = 2, q=5, mean.cent=TRUE, var.adj=TRUE)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;results in &lt;code&gt;skewt=0.4302996&lt;/code&gt; (&lt;em&gt;close to your value&lt;/em&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For an explanation of the differences between &lt;code&gt;Hansen(1994)&lt;/code&gt; and the &lt;code&gt;recent references&lt;/code&gt; used in &lt;code&gt;dsgt&lt;/code&gt; maybe it's worth posting a thread to &lt;a href=&quot;https://stats.stackexchange.com/questions/27474/is-hansens-skewed-t-distribution-the-same-as-the-skewed-t-distribution-whic&quot;&gt;Cross Validated&lt;/a&gt; (&lt;em&gt;see link for related discussions&lt;/em&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope it helps&lt;/p&gt;&#xA;" OwnerUserId="18252" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2015-12-27T14:37:12.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22494" PostTypeId="1" AcceptedAnswerId="22506" CreationDate="2015-12-27T21:05:45.347" Score="1" ViewCount="845" Body="&lt;p&gt;I am using a &lt;strong&gt;Matlab&lt;/strong&gt; toolbox for obtaining &lt;strong&gt;one-step ahead forecasts&lt;/strong&gt; of the &lt;strong&gt;conditional mean&lt;/strong&gt; from the &lt;strong&gt;ARMA(1,0)-GARCH(1,1)&lt;/strong&gt; process and I have encountered a piece of code that contains, in my opinion, a mistake. The full code of the forecasting function is available for viewing at: &lt;a href=&quot;http://uk.mathworks.com/matlabcentral/fileexchange/32882-armax-garch-k-toolbox--estimation--forecasting--simulation-and-value-at-risk-applications-/content/garchfor.m&quot; rel=&quot;nofollow&quot;&gt;http://uk.mathworks.com/matlabcentral/fileexchange/32882-armax-garch-k-toolbox--estimation--forecasting--simulation-and-value-at-risk-applications-/content/garchfor.m&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fragment that I was referring to is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% Forecasting the Mean&#xA;MF = parameters(1:1+z)'*[1; data(end-(1:ar)); resids(end-(0:ma-1))]; % 1-period ahead forecast&#xA; for i = 2:max_forecast&#xA;     MF(i,1) = sum([parameters(1); ones(1,ar)*parameters(2:2+ar)*MF(i-1,1); ones(1,ma)*parameters(3+ar:2+ar+ma)*resids(end-(0:ma-1-i))]);&#xA; end&#xA; clear i&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From this code it seems that when I am considering &lt;strong&gt;ARMA(1,0)&lt;/strong&gt; the function takes the one before last observation for the forecast. In other words, when the data spans time points $1,...,t$ and I want to obtain a forecast for period $t+1$ I multiply the AR(1) coefficient by the $t-1$ observation.In my opinion, for time $t+1$ AR(1) forecast I should be taking the last observation ($t$) from the data-set and multiply it by the AR(1) coefficient. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you please confirm my suspicions about this piece of code?&lt;/p&gt;&#xA;" OwnerUserId="17464" LastActivityDate="2015-12-29T00:01:07.797" Title="One-step ahead forecast of a AR(1) process (GARCH context)" Tags="&lt;garch&gt;&lt;forecasting&gt;&lt;matlab&gt;&lt;arma&gt;&lt;mean&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22495" PostTypeId="2" ParentId="7474" CreationDate="2015-12-27T21:56:33.477" Score="1" Body="&lt;p&gt;I would fit an AR(1)-GARCH(1,1) with arch in mean effect and with the square  of the serie at lag 1 as explanatory variable in the mean process :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The AR(1)-GARCH(1,1) component for :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;y_{t}=\alpha_{0}+\alpha_{1}y_{t-1}+\varepsilon_{t}&#xA;$$&#xA;$$&#xA;h_{t}=\beta_{0}+\beta_{1}\varepsilon_{t-1}^{2}+\beta_{2}h_{t-1}&#xA;$$&#xA;+ the arch in mean effect  ($\lambda h_{t}$ ):&#xA;$$&#xA;y_{t}=\alpha_{0}+\alpha_{1}y_{t-1} +\lambda h_{t}+\varepsilon_{t}&#xA;$$&#xA;$$&#xA;h_{t}=\beta_{0}+\beta_{1}\varepsilon_{t-1}^{2}+\beta_{2}h_{t-1}&#xA;$$&#xA;+ the explanatory variable in the mean process ($ y_{t-1}^{2} $):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;y_{t}=\alpha_{0}+\alpha_{1}y_{t-1}+\alpha_{2}y_{t-1}^{2}+\lambda h_{t}+\varepsilon_{t}&#xA;$$&#xA;$$&#xA;h_{t}=\beta_{0}+\beta_{1}\varepsilon_{t-1}^{2}+\beta_{2}h_{t-1}&#xA;$$&#xA;All econometrical packages allowing to add 1)an arch in mean effect and 2) an explanatory variable can be used (the G@rch package (Ox) for example).&lt;/p&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2015-12-27T21:56:33.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22497" PostTypeId="2" ParentId="22114" CreationDate="2015-12-28T01:01:15.150" Score="1" Body="&lt;p&gt;Here is an MLE I built that uses logistic mapping.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%MLE iterator:&#xA;for cxm = 1:cxmax&#xA;    for cxth = 1:wx; %thx &#xA;        %Incr. theta within asymptotic min and max.&#xA;            thi1 = thA1(cxth,1); mint = thA1(cxth,2); maxt = thA1(cxth,3);&#xA;            thix = -log((maxt - mint)/(thi1 - mint) - 1); %Logistic inverse.&#xA;            if rand &amp;gt; 0.5; signx = -1; else signx = 1; end&#xA;            expn = thix + 0.25 * signx / cxm; &#xA;            thi2 = mint + ((maxt - mint)/(1 + exp(-expn))); %Logistic.&#xA;         %Calc. change in log likelihood.&#xA;            thA2 = thA1; &#xA;            thA2(cxth,1) = thi2;&#xA;            %Constraint(s):&#xA;                thA2(wx+1:wx*2,1) = min(1,thA2(wx+1:wx*2,1) / sum(thA2(wx+1:wx*2,1))); &#xA;            [llk1] = llkF(rC,thA1,tx,wx);&#xA;            [llk2] = llkF(rC,thA2,tx,wx);&#xA;        %Calc. update.&#xA;            thA3 = thA1;&#xA;            expn = thix + 1 * ((llk2 - llk1) / (expn - thix)) / cxm; &#xA;            thA3(cxth,1) = mint + ((maxt - mint)/(1 + exp(-expn))); %Logistic.&#xA;            %Constraint(s):&#xA;                thA3(wx+1:wx*2,1) = min(1,thA3(wx+1:wx*2,1) / sum(thA3(wx+1:wx*2,1))); &#xA;            [llk3] = llkF(rC,thA3,tx,wx);&#xA;        %Update thA1 only if thA2 or thA3 is better.&#xA;            disp([llk1 llk2 llk3]); %&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&#xA;            if llk2 &amp;gt; llk1 &amp;amp;&amp;amp; llk2 &amp;gt; llk3; thA1 = thA2; llk1 = llk2; end&#xA;            if llk3 &amp;gt; llk1 &amp;amp;&amp;amp; llk3 &amp;gt; llk2; thA1 = thA3; llk1 = llk3; end&#xA;    end%theta loop.&#xA;    llkV(cxm) = llk1;&#xA;    %disp(['     MLE: ', num2str(cxm),', ll = ',num2str(llk1)])&#xA;    %Test for MLE convergence.&#xA;        if cxm &amp;gt; 5;&#xA;            d5llk = (llkV(cxm) - llkV(cxm - 5)); %Calc. change in llk, lag 5.&#xA;            if d5llk &amp;lt; 0.0001; llkV(cxm + 1:cxmax) = llkV(1); &#xA;                break; end; &#xA;        end%test&#xA;end%MLE loop.&#xA;llkV = llkV(1:cxm); %Truncate away the zeros.&#xA;thA = thA1; %Reset theta array.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="18772" LastEditorUserId="848" LastEditDate="2015-12-28T08:15:58.777" LastActivityDate="2015-12-28T08:15:58.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22498" PostTypeId="2" ParentId="22485" CreationDate="2015-12-28T01:36:00.870" Score="2" Body="&lt;p&gt;You could consider he fairly-recently started &lt;a href=&quot;https://rescience.github.io/&quot; rel=&quot;nofollow&quot;&gt;ReScience&lt;/a&gt; initiative which has exactly this in mind:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;ReScience is a peer-reviewed journal that targets computational research and encourages the explicit &lt;a href=&quot;https://rescience.github.io/faq&quot; rel=&quot;nofollow&quot;&gt;replication&lt;/a&gt; of already published research, promoting new and open-source implementations in order to ensure that the original research is &lt;a href=&quot;https://rescience.github.io/faq&quot; rel=&quot;nofollow&quot;&gt;reproducible&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;As far as I know there have not been any finance/quant submissions.&lt;/p&gt;&#xA;" OwnerUserId="69" LastActivityDate="2015-12-28T01:36:00.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22499" PostTypeId="1" CreationDate="2015-12-28T02:05:14.703" Score="2" ViewCount="609" Body="&lt;p&gt;I am estimating a GJR-GARCH(1,1) model with variance targeting in R. As data I am using returns on some stock indices. While calculating the GARCH models I obtain $\alpha=0$ for some indices. From what I understand this means that volatility is constant. The code I am using for GJR-GARCH estimation is as follows and is based on the &lt;code&gt;rugarch&lt;/code&gt; package:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;garch.spec &amp;lt;- ugarchspec(&#xA;    variance.model = list(model=&quot;gjrGARCH&quot;, &#xA;                          garchOrder=c(1,1), &#xA;                          variance.targeting=TRUE), &#xA;    mean.model = list(armaOrder=c(0,0)))&#xA;garch.fit &amp;lt;- ugarchfit(&#xA;    spec=garch.spec, &#xA;    data=data, &#xA;    solver=&quot;nlminb&quot;, &#xA;    solver.control=list(trace=0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And an example of my results:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;           mu        alpha1         beta1        gamma1         omega &#xA;-0.0057893647  0.0000000000  0.8666747910  0.1641368776  0.0002181445&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Could you please give some advice whether such results are plausible or should I be worried? Of course I can provide the data that causes problems. And obviously I am running univariate estimations so I am taking only one series of index returns at a time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;edit&lt;/strong&gt;: using a different solver algorithm I was able to obtain different results, however, $\alpha$ still seems to be extremely low for this model.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;      mu       alpha1        beta1       gamma1        omega &#xA;3.432135e-04 8.508012e-08 8.607153e-01 2.113815e-01 1.727337e-05 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is the reasoning behind such low values of $\alpha$, since I am obtaining very similar results in R and in Matlab, so I doubt there is a mistake in the coefficient estimation.&lt;/p&gt;&#xA;" OwnerUserId="17464" LastEditorUserId="848" LastEditDate="2016-03-13T13:01:46.023" LastActivityDate="2016-03-13T13:02:24.057" Title="GJR-GARCH with $\alpha = 0$ as parameter estimate" Tags="&lt;volatility&gt;&lt;r&gt;&lt;garch&gt;&lt;estimation&gt;&lt;parameter-estimation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22500" PostTypeId="2" ParentId="22499" CreationDate="2015-12-28T02:25:56.377" Score="3" Body="&lt;p&gt;$\alpha=0$ does not imply constant volatility. &#xA;Consider just a simple Garch(1,1):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma^2_t = \omega + \alpha \eta_t^2 + \beta \sigma^2_{t-1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma^2_t = \omega + (\alpha + \beta)  \eta_t^2 - \beta (\eta_t^2- \sigma^2_{t-1})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now add $\eta_{t+1}^2$ to both sides:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\eta_{t+1}^2 = \omega + (\alpha + \beta)  \eta_t^2 - \beta (\eta_t^2- \sigma^2_{t-1})  + (\eta_{t+1}^2 - \sigma^2_t).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this is an ARMA(1,1) for $\eta_{t+1}^2$ with shocks: $\eta_{t+1}^2 - \sigma^2_t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So even if $\alpha=0$ volatility is not constant.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="848" LastEditDate="2016-03-13T13:02:24.057" LastActivityDate="2016-03-13T13:02:24.057" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="22501" PostTypeId="1" CreationDate="2015-12-28T04:38:52.243" Score="3" ViewCount="216" Body="&lt;p&gt;How does the NY Fed's trading desk use this process as a tool to adjust bond prices?&lt;/p&gt;&#xA;" OwnerUserId="18774" LastActivityDate="2015-12-30T13:50:16.443" Title="Reverse Repos as a means to adjust interest rates" Tags="&lt;interest-rates&gt;&lt;bond-yields&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22502" PostTypeId="2" ParentId="22501" CreationDate="2015-12-28T10:35:35.987" Score="3" Body="&lt;p&gt;Investors other than banks (especially Money Market Mutual Funds and some GSE's (Government Sponsored Enterprises)) have cash they want to invest. The Desk offers reverse repos at an attractive rate, so these investors put their cash to work by lending it to the Fed, receiving government securities as collateral in return. ( As everyone knows the Fed has plenty of government securities on hand these days, over 2000 billion worth!). The market for short term finance is competitive so if a company (say General Electric) wants to raise money from MMF by issuing Commercial Paper they will have to offer a higher interest rate than heretofore, so other interest rates (in the  case the CP rate) rise also. As we all know a higher yield on CP goes with a lower price for CP, that's just Finance 101.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the NYFRB Desk is basically competing with securities issuers in raising short term money. In doing this they affect they yields/prices of short term investments and short term securities.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2015-12-28T10:42:39.727" LastActivityDate="2015-12-28T10:42:39.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22504" PostTypeId="2" ParentId="21410" CreationDate="2015-12-28T17:25:56.817" Score="0" Body="&lt;p&gt;There is a very simple elementary derivation of a normal distribution version of an option pricing formula using the concept of the fundamental interaction between buy and sell orders (or up and down operators).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea is to establish a relationship between 'steps' and price displacement. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a hypothetical stock chart where a stock has moved some amount $a$ (usually a small percentage) over some time duration $t_1$ (often measured in years). It can be visualized as a triangle, with the vertices being $t_1$ and $p_1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$p_1$ is the present price of the stock and the displacement is $a*p_1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Denote $t_2$ as the time until expiration &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a discrete sum of up $u$ and down $d$ stock orders denoted by  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$u+d=t_2/t_1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each 'up' and 'down' represents a 'time unit'. Adding the 'ups' and 'downs' gives the sum of units.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second part of the fundamental interaction is the difference between 'ups' and 'downs':&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$u-d=f(p_2-p_1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means that the difference between 'ups' and 'downs' gives a function in terms of a new displacement, $p_2-p_1$ where $p_2 \ge p_1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The pair of linear equations solves for $u$ and $d$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$u=\frac{1}{2}\left(\frac{t_2}{t_1}+f(p_2-p_1)\right)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d=\frac{1}{2}\left(\frac{t_2}{t_1}-f(p_2-p_1)\right)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the proportional relation between two displacements, the base one with  $t_1$ and our new one, $p_2-p_1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{a*p}{t_1}=\frac{p_2-p_1}{x}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solving for $x$ gives the needed function in terms $p_2-p_1$, which is plugged into $u$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$u=\frac{1}{2}\left(\frac{t_2}{t_1}+\frac{t_1(p_2-p_1)}{a*p_1}\right)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When $p_2=p_1$, the stock is unchanged, meaning that the number of 'up' units is equal to the 'down' ones.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What we've done is establish a relationship between displacement of price and 'up' and 'down' units. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;'Up' and 'down' units, analogous to tossing a coin, also obey a normal distribution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mu_1 +\sigma_1 = \frac{t_2}{2t_1}+\frac{1}{2}\sqrt{\frac{t_2}{t_1}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is also $\mu_2,\sigma_2$ for the price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mu_2 = p_1 e^{r*t} $ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(this is because if $p_2=p_1$ the stock is unchanged, hence $\mu_1 = \frac{t_2}{2t_1}$ meaning that the number of 'up' units is the same as 'down', resulting in no displacement. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have to find $\sigma_2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because of the equivalence between units and price displacement, the $\sigma_2$  can be solved by setting $p_2=p_1+\sigma_2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the equivalence:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mu_1 +\sigma_1=u$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sqrt{\frac{t_2}{t_1}}=\frac{t_1 \sigma_2}{a p_1}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rearranging gives the classic result: $\sigma_2=a p_1 \sqrt{t_2}$ setting $t_1=1$ (for a single year and $t_2$ is the fraction of the year)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This helped me understand random walk better&lt;/p&gt;&#xA;" OwnerUserId="15081" LastEditorUserId="15081" LastEditDate="2015-12-28T17:34:15.340" LastActivityDate="2015-12-28T17:34:15.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22505" PostTypeId="1" CreationDate="2015-12-28T18:07:21.427" Score="2" ViewCount="773" Body="&lt;p&gt;I am trying to estimate daily Hurst exponent values of a stock returns (e.g. for each day to have also Hurst exponent - something like that: &lt;a href=&quot;https://www.quandl.com/data/PE/CKEC_HURST-Hurst-Exponent-of-Carmike-Cinemas-Inc-Common-Stock-CKEC-NASDAQ&quot; rel=&quot;nofollow&quot;&gt;https://www.quandl.com/data/PE/CKEC_HURST-Hurst-Exponent-of-Carmike-Cinemas-Inc-Common-Stock-CKEC-NASDAQ&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using tis Python code (taken from &lt;a href=&quot;https://www.quantstart.com/articles/Basics-of-Statistical-Mean-Reversion-Testing&quot; rel=&quot;nofollow&quot;&gt;https://www.quantstart.com/articles/Basics-of-Statistical-Mean-Reversion-Testing&lt;/a&gt;), but I do not how to accomodate it for daily Hurst values instead of just one value:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;from numpy import cumsum, log, polyfit, sqrt, std, subtract&#xA;&#xA;from numpy.random import randn&#xA;&#xA;def hurst(ts):&#xA;&#xA;    &quot;&quot;&quot;Returns the Hurst Exponent of the time series vector ts&quot;&quot;&quot;&#xA;    # Create the range of lag values&#xA;    lags = range(2, 100)&#xA;&#xA;    # Calculate the array of the variances of the lagged differences&#xA;    tau = [sqrt(std(subtract(ts[lag:], ts[:-lag]))) for lag in lags]&#xA;&#xA;    # Use a linear fit to estimate the Hurst Exponent&#xA;    poly = polyfit(log(lags), log(tau), 1)&#xA;&#xA;    # Return the Hurst exponent from the polyfit output&#xA;    return poly[0]*2.0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="18499" LastEditorUserId="848" LastEditDate="2015-12-29T07:34:57.683" LastActivityDate="2015-12-29T07:34:57.683" Title="Daily Hurst Exponent" Tags="&lt;equities&gt;&lt;hurst-exponent&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22506" PostTypeId="2" ParentId="22494" CreationDate="2015-12-28T21:18:55.723" Score="1" Body="&lt;p&gt;The code is correct regarding your question (and only for an AR(1) ), you made a mistake because the last observation of the data set is $t-1$ and not $t$ since you are forecasting the point at time $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the code : &lt;code&gt;MF(i,1)&lt;/code&gt; is the current point forecast ($t$) and lag one observation ( &lt;code&gt;MF(i-1,1)&lt;/code&gt;  which is  $t-1$  ) is correctly related to the AR part.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However it seems to me that there is an error in the following part :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ones(1,ar)*parameters(2:2+ar)*MF(i-1,1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It is only correct if you are estimating an AR(1) , for a higher order the &lt;code&gt;MF(i-1,1)&lt;/code&gt; part is wrong because you apply different coefficients to the same  observation ( ex : $ \alpha_{1} y_{t-1} + \alpha_{2} y_{t-1} $ instead of  $\alpha_{1} y_{t-1} + \alpha_{2} y_{t-2} $ ). I would recommend you to use more reliable codes such as functions you can find in the &lt;a href=&quot;https://www.kevinsheppard.com/MFE_Toolbox&quot; rel=&quot;nofollow&quot;&gt;MFE Toolbox&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2015-12-29T00:01:07.797" LastActivityDate="2015-12-29T00:01:07.797" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22507" PostTypeId="2" ParentId="21977" CreationDate="2015-12-29T03:12:36.177" Score="3" Body="&lt;p&gt;To rule out arbitrage in the one-period model, we must assume&#xA;$$&#xA;0 &amp;lt; d &amp;lt; 1+r &amp;lt; u,&#xA;$$&#xA;where $u$ is the up-factor, $d$ is the down-factor and $r$ is the risk-free interest rate.  This chain of inequalities is the no-arbitrage condition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To see what happens if it doesn't hold, consider the case in which&#xA;$$&#xA;0 &amp;lt; 1+r &amp;lt; d &amp;lt; u.&#xA;$$&#xA;Let $S$ denote the initial stock price.  To exploit this situation, borrow $\$S$ from a risk-free money market account and buy the stock for $\$S$.  Note the initial cost of this portfolio is $0$.  At the final time:&#xA;$$&#xA;\begin{array}{c|c|c|}&#xA;\text{up state} \\&#xA;\hline&#xA; &amp;amp; \text{receive:} &amp;amp; $uS \\&#xA; &amp;amp; \text{pay:} &amp;amp; $(1+r)S \\&#xA; &amp;amp; \text{profit:} &amp;amp; $(u - (1+r))S &amp;gt; 0\\&#xA;\text{down state} \\&#xA;\hline&#xA; &amp;amp; \text{receive:} &amp;amp; $dS \\&#xA; &amp;amp; \text{pay:} &amp;amp; $(1+r)S \\&#xA; &amp;amp; \text{profit:} &amp;amp; $(d - (1+r))S &amp;gt; 0\\&#xA;\end{array}&#xA;$$&#xA;Thus you've started with $\$0$ and profited in every state of the world - arbitrage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we instead have&#xA;$$&#xA;0 &amp;lt; d &amp;lt; u &amp;lt; 1+r,&#xA;$$&#xA;long the money market account and short the stock.  Can you work out the sure profit in this case?  This is the standard argument for exploiting the arbitrage condition, and can be found in Shreve I, page 2.&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2015-12-29T03:12:36.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22508" PostTypeId="1" CreationDate="2015-12-29T13:37:22.243" Score="5" ViewCount="322" Body="&lt;p&gt;U. S. Securities and Exchange Commission (SEC) defines market maker as: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&quot;A &lt;strong&gt;market maker&lt;/strong&gt; is a firm that stands ready to buy and sell a particular stock on a regular and continuous basis at a publicly quoted price. You'll most often hear about market makers in the context of the NASDAQ or other &quot;over the counter&quot; (OTC) markets [...] &#xA;Market-makers generally must be ready to buy and sell at least 100 shares of a stock they make a market in. As a result, a large order from an investor may have to be filled by a number of market-makers at potentially different prices.&quot;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like when a broker receives order from their clients, they might route an order to a market maker in the NASDAQ market (or to several of them if the have agreements with them?)&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;What makes me confused is the price quoted by market makers. To who exactly they quote ask/bid prices. Are those prices at which a market maker is willing to buy to / sell from other market makers (if market markets trade with each other) or the prices at which they would accept orders from their clients -- brokers?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What orders (for example, when deciding the price of the last order) are seen publically? The order between two market makers? If one market maker just matches two opposite orders (one broker buys x stocks at y price, the other sells x stocks at y price), will it be seen for NASDAQ? What if the broker does not route the order to market maker, but do the same matching/cancelling out procedure for its clients - individual traders?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;ECNs seem to be another type on participants in NASDAQ. Who does ECN trade with? Brokers? Market Makers?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="18705" LastEditorUserId="-1" LastEditDate="2016-01-03T18:21:48.017" LastActivityDate="2016-02-02T19:07:22.423" Title="Nasdaq trading under the scenes: market makers, ECNs, brokers. Who buys from and sells to whom?" Tags="&lt;equities&gt;&lt;nasdaq&gt;&lt;broker&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22509" PostTypeId="1" AcceptedAnswerId="22511" CreationDate="2015-12-29T15:56:51.963" Score="1" ViewCount="3247" Body="&lt;p&gt;I have dataset containing daily closing prices of 5413 companies from 2000 to 2014. I want to calculate daily log returns for the stocks as according to dates as log(Price today/Price yesterday). I illustrate the dataset as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Date       A G L    ABA    ABB ABBEY &#xA;2000-1-3    NA      NA      NA  NA&#xA;2000-1-4    79.5    325     NA  961  &#xA;2000-1-5    79.5    322.5   NA  945&#xA;2000-1-6    79.5    327.5   NA  952&#xA;2000-1-7    NA      327.5   NA  941  &#xA;2000-1-10   79.5    327.5   NA  946&#xA;2000-1-11   79.5    327.5   NA  888&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How could calculate the the daily log returns and additionally tackle the NA. My sample period is from 2000 to 2014 so there are some companies who were listed in year 2001,so, for the whole year 2000 they have NA, how should this be handled. Your help is highly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="18786" LastEditorUserId="18786" LastEditDate="2016-01-23T19:35:57.537" LastActivityDate="2016-01-23T19:35:57.537" Title="Log daily returns of multiple securities for multiple time period in R" Tags="&lt;equities&gt;&lt;r&gt;&lt;log-returns&gt;&lt;quantmod&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22510" PostTypeId="2" ParentId="22508" CreationDate="2015-12-29T16:23:22.687" Score="0" Body="&lt;p&gt;The status if a &quot;market maker&quot; is usually tied with an exchange. Like there are market makers on NASDAQ, NYSE, etc. As such they receive certain privileges from the exchanges for taking certain obligations to keep quotes on stocks on those exchanges. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for the first two questions - they quote on the trading venues, their trades are reported on the venues and SIP, and there is no particular way to differentiate their activity from the rest of the market activity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is completely independent from the way a broker's routing is set up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the last question ECN doesn't trade by itself, it provides a place where participants' orders are matched.&lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2015-12-29T16:23:22.687" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="22511" PostTypeId="2" ParentId="22509" CreationDate="2015-12-29T20:21:34.927" Score="3" Body="&lt;p&gt;Well, it wasn't easy because you didn't mentioned how your data is formatted. I create my own &lt;code&gt;data.frame()&lt;/code&gt; basing on data you provided. &#xA;You can skip this part if your data.frame is ready. Here's code I used to create a dataframe:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; #given dates&#xA;&amp;gt; dates=c(&quot;2000-1-3&quot;,&quot;2000-1-4&quot;,&quot;2000-1-5&quot;,&quot;2000-1-6&quot;,&quot;2000-1-7&quot;,&quot;2000-1-10&quot;,&quot;2000-1-11&quot;)&#xA;&amp;gt; #formating from string to dates&#xA;&amp;gt; newdates=as.Date(dates,&quot;%Y-%m-%d&quot;)&#xA;&amp;gt; #given stock prices&#xA;&amp;gt; stock1prices=c(&quot;NA&quot;,&quot;79.5&quot;,&quot;79.5&quot;,&quot;79.5&quot;,&quot;NA&quot;,&quot;79.5&quot;, &quot;79.5&quot;)&#xA;&amp;gt; stock2prices=c(&quot;NA&quot;, &quot;325&quot;, &quot;322.5&quot;, &quot;327.5&quot;, &quot;327.5&quot;, &quot;327.5&quot;, &quot;327.5&quot;)&#xA;&amp;gt; stock3prices=c(&quot;NA&quot;,&quot;NA&quot;,&quot;NA&quot;,&quot;NA&quot;,&quot;NA&quot;,&quot;NA&quot;,&quot;NA&quot;)&#xA;&amp;gt; stock4prices=c(&quot;NA&quot;,&quot;961&quot;,&quot;945&quot;,&quot;952&quot;,&quot;941&quot;,&quot;946&quot;,&quot;888&quot;)&#xA;&amp;gt; #NewStockPrces - converting from string to numbers&#xA;&amp;gt; nsp1=as.numeric(stock1prices)&#xA;&amp;gt; nsp2=as.numeric(stock2prices)&#xA;&amp;gt; nsp3=as.numeric(stock3prices)&#xA;&amp;gt; nsp4=as.numeric(stock4prices)&#xA;&amp;gt; #creating dataframe of prices&#xA;&amp;gt; prices=data.frame(newdates,nsp1,nsp2,nsp3,nsp4)&#xA;&amp;gt; prices&#xA;    newdates nsp1  nsp2 nsp3 nsp4&#xA;1 2000-01-03   NA    NA   NA   NA&#xA;2 2000-01-04 79.5 325.0   NA  961&#xA;3 2000-01-05 79.5 322.5   NA  945&#xA;4 2000-01-06 79.5 327.5   NA  952&#xA;5 2000-01-07   NA 327.5   NA  941&#xA;6 2000-01-10 79.5 327.5   NA  946&#xA;7 2000-01-11 79.5 327.5   NA  888&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There was just 4 stocks, so I used very simple method to create my dataframe &lt;em&gt;prices&lt;/em&gt;. &lt;strong&gt;Here's what is more important for you.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;logs=data.frame(&#xA;+   cbind.data.frame(&#xA;+     newdates[-1],&#xA;+     diff(as.matrix(log(prices[,-1])))&#xA;+     )&#xA;+   )&#xA;&amp;gt; logs&#xA;  newdates..1. nsp1         nsp2 nsp3         nsp4&#xA;1   2000-01-04   NA           NA   NA           NA&#xA;2   2000-01-05    0 -0.007722046   NA -0.016789481&#xA;3   2000-01-06    0  0.015384919   NA  0.007380107&#xA;4   2000-01-07   NA  0.000000000   NA -0.011621895&#xA;5   2000-01-10   NA  0.000000000   NA  0.005299429&#xA;6   2000-01-11    0  0.000000000   NA -0.063270826&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To clarify what is going on in this code lets analyze it from the inside out:&lt;br&gt;&lt;br&gt;&#xA;&lt;strong&gt;Step 1: Calculating log-returns&lt;/strong&gt;&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You know that &lt;code&gt;log(a/b) = log(a)-log(b)&lt;/code&gt;, so we can calculate&#xA;differences of logarithms. Funcition &lt;code&gt;diff(x,lag=1)&lt;/code&gt; calculates&#xA;differences with given lag. Here it is &lt;code&gt;lag=1&lt;/code&gt; so it gives first&#xA;differences.&lt;/li&gt;&#xA;&lt;li&gt;Our &lt;code&gt;x&lt;/code&gt; are prices in dataframe. Do pick from a&#xA;&lt;code&gt;data.frame&lt;/code&gt; every columns without the first (there are dates) we use&#xA;&lt;code&gt;prices[,-1]&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;We need logarithms, so &lt;code&gt;log(prices[,-1])&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Function &lt;code&gt;diff()&lt;/code&gt; works with vector or matrix, so we need to treat&#xA;calculated logarithms as matrix, thus&#xA;`as.matrix(log(prices[,-1]))&lt;/li&gt;&#xA;&lt;li&gt;Now we can use &lt;code&gt;diff()&lt;/code&gt; with &lt;code&gt;lag=1&lt;/code&gt;, so &lt;code&gt;diff(as.matrix(log(prices[,-1])))&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step 2: Creating dataframe of log-returns and dates&lt;/strong&gt;&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;We can't use just &lt;code&gt;cbind()&lt;/code&gt;. Firstly, because lengths are different (returns are shorter by 1 record). We need to remove first date, so &lt;code&gt;newdates[-1]&lt;/code&gt; &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Secondly, using cbind() dates will be transformed into numeric values such 160027 or other. &lt;br&gt; Here we have to use &lt;code&gt;cbind.data.frame(x,y)&lt;/code&gt;, as seen above.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Now data is ready and we can create use a &lt;code&gt;data.frame()&lt;/code&gt; and name it as logs so &lt;code&gt;logs=data.frame(...)&lt;/code&gt; as above.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Once again I don't know how your database looks like, so I can't give you exact solution. Most important thing is to use &lt;code&gt;diff(log(x))&lt;/code&gt; to easily calculate log-returns.&lt;/p&gt;&#xA;" OwnerUserId="18793" LastActivityDate="2015-12-29T20:21:34.927" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22513" PostTypeId="1" AcceptedAnswerId="22540" CreationDate="2015-12-30T01:28:14.850" Score="3" ViewCount="2367" Body="&lt;p&gt;I was a bit hesitant to post this question because it seems so basic...but I wasn't able to figure it out on my own.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say we setup a one-step binomial tree with $S_0=100$, $S_u=110$ and $S_d=90$, where $S_u$ and $S_d$ are the up and down possibilities for the stock price at time $T=1$. Let $K=100$ be the strike price of a call, and $r=10%$ be the continuously compounded risk-free interest rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using a replicating portfolio (with some quantity $\Delta$ of the stock and borrowed money), I find the price of the call to be $c_0 = 9.28\$$ ($\Delta=0.5$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I understand that I don't need to know what the real-world probabilities are (of $S_u$ and $S_d$), since the replicating portfolio...replicates the option payoff no matter the outcome.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But just for fun, let's say $Pr(S_1=S_u)=1\%$ and $Pr(S_1=S_d)=99\%$, in which case, on average, the call at time 1 would be worth 0.01*10 = 0.1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would anyone be willing to pay 9.28$ for that ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm pretty sure I'm missing something very basic, I hope someone can explain what it is.&lt;/p&gt;&#xA;" OwnerUserId="18800" LastEditorUserId="467" LastEditDate="2015-12-31T07:53:10.870" LastActivityDate="2016-10-12T12:34:34.223" Title="Why don't real-world probabilities affect the price of a call in a 1-step binomial model?" Tags="&lt;options&gt;&lt;binomial-tree&gt;" AnswerCount="6" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22514" PostTypeId="1" CreationDate="2015-12-30T01:46:53.903" Score="1" ViewCount="256" Body="&lt;p&gt;I have a question regarding Value-at-Risk and diversification?&#xA;When one says that VaR &quot;hides the risk in the tail&quot;, does one mean that if we for instance look at VaR at level p=0.05 say, we might get a value of 1000 say. But now if we look at level p=0.01, we might get a much higher value say 5000?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, how does VaR have a problem with diversifiation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="18211" LastActivityDate="2015-12-30T11:55:13.043" Title="Value-at-Risk &quot;hiding risk in the tail&quot; and diversification?" Tags="&lt;value-at-risk&gt;&lt;diversification&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22515" PostTypeId="2" ParentId="22514" CreationDate="2015-12-30T02:12:33.607" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Exactly, VaR is nothing more than a threshold loss value. But it does not tell you how big your loss can be (no information about the shape of the tail). To get more information about it you can use the Expected shortfall which is the expected loss given that a loss occurs in the tails.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Diversification decreases the VaR, however extreme events may be, loosely speaking, correlated across stocks (and especially during a systemic crisis). Here again some tools have been developed to take into account this contagion effect. You can have a look to the CoVaR measure of Adrian and Brunnermeier.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2015-12-30T11:55:13.043" LastActivityDate="2015-12-30T11:55:13.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22517" PostTypeId="2" ParentId="22514" CreationDate="2015-12-30T04:41:15.613" Score="2" Body="&lt;p&gt;As you and @Malick noted, VaR only gives a certain threshold given a certain confidence but says nothing about what happens beyond that point (tail risk). For loss distributions with long tails, this would underestimate the risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding VaR having a problem with diversification - VaR is technically not a coherent risk measure. In simple terms, we would expect a risk measure to show decreased risk as we increase diversification (to a point). However, VaR as a risk measure can sometimes increase with diversification.&#xA;An easy and to-the-point example is found in wikipedia (&lt;a href=&quot;https://en.wikipedia.org/wiki/Coherent_risk_measure#Value_at_risk&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Coherent_risk_measure#Value_at_risk&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="13610" LastActivityDate="2015-12-30T04:41:15.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22519" PostTypeId="1" AcceptedAnswerId="22582" CreationDate="2015-12-30T10:10:04.583" Score="2" ViewCount="2657" Body="&lt;p&gt;I have a dataset/dataframe in which I have calculated the daily log returns of five thousand companies and these companies are as column as well. I want carry out ADF test on this dataframe. I have found how to estimate ADF test on vector but could not find how to calculate it on dataframe or matrix structure. Additionally how can I leave out the date column when estimating ADF test on the companies.&lt;a href=&quot;https://i.stack.imgur.com/uFEqO.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/uFEqO.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The picture illustrates some portion of my dataset.&#xA;The code I ran and error I received are as follows&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(tseries)&#xA;adf.test(logs, alternative = c(&quot;stationary&quot;, &quot;explosive&quot;),&#xA;     k = trunc((length(1)-1)^(1/3)))&#xA;&#xA;&#xA;Error in adf.test(logs, alternative = c(&quot;stationary&quot;, &quot;explosive&quot;), k = trunc((length(1) -  :  x is not a vector or univariate time series&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="18786" LastEditorUserId="743" LastEditDate="2016-01-04T20:47:02.080" LastActivityDate="2020-08-02T01:14:09.837" Title="Augmented Dickey-Fuller Test/ Unit Root test on multiple time series dataframe in R" Tags="&lt;time-series&gt;&lt;equities&gt;&lt;r&gt;&lt;multivariate&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22521" PostTypeId="2" ParentId="22501" CreationDate="2015-12-30T13:39:32.903" Score="0" Body="&lt;p&gt;Reverse repo is a process whereby the FED sells their securities in the money market where only some institutions (e.g. big banks  money market mutual funds) are able to purchase the securities off from FED. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;FED sells their securities to remove liquidity in the money system, by reducing the amount of money supply, people will require to pay higher interest rate to get the lesser money supply from bank and other financial institutions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bonds are eventually debt securities, which pays out interest yielding. Treat it as an instrument form out of loans, therefore when interest rate hike due to lesser money supply, the bond interest rate (borrowing cost) goes up. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To decrease the increase rate, FED can purchase repo by purchasing securities from banks, which increases the liability and assets of the bank; thereby creating more liquidity through more money supply. When the supply is higher, banks will want to lend out by, which can be done by lending at a lower interest rate.  &lt;/p&gt;&#xA;" OwnerUserId="18806" LastEditorUserId="18807" LastEditDate="2015-12-30T13:50:16.443" LastActivityDate="2015-12-30T13:50:16.443" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22523" PostTypeId="1" CreationDate="2015-12-30T13:51:27.860" Score="0" ViewCount="1013" Body="&lt;p&gt;A coherent risk measure is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\rho(\lambda X_1+(1-\lambda X_2))$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can it be shown that everey convex risk measure is indeed a coherent risk measure?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume that it is enough to show that a convex risk measure is coherent by using, subadditivity, positive homogeniety. So we get: $\rho(\lambda X_1+(1-\lambda X_2))=\rho(\lambda X_1)+\rho((1-\lambda)X_2)=\lambda \rho(X_1)+(1-\lambda)\rho(X_2))$ right?&lt;/p&gt;&#xA;" OwnerUserId="18211" LastActivityDate="2015-12-30T14:35:04.843" Title="Convex risk measure and a coherent risk measure?" Tags="&lt;risk&gt;&lt;coherent-risk-measure&gt;&lt;convexity&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22524" PostTypeId="2" ParentId="22523" CreationDate="2015-12-30T14:35:04.843" Score="2" Body="&lt;p&gt;We define a convex risk measure as &#xA;$$&#xA;\rho( \lambda X_1 + (1-\lambda) X_2) \le \lambda \rho(  X_1 ) + (1-\lambda) \rho(X_2),&#xA;$$&#xA;for $\lambda  \in(0,1) $.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A coherent risk measure is subadditive and homogeneous thus for coherent $\rho$ we get:&#xA;$$&#xA;\rho( \lambda X_1 + (1-\lambda) X_2) \le \rho( \lambda X_1) + \rho( (1-\lambda) X_2) &#xA;$$&#xA;by subadditivity and&#xA;$$&#xA;\rho( \lambda X_1) + \rho( (1-\lambda) = \lambda \rho(X_1) + (1-\lambda)\rho(X_2)&#xA;$$&#xA;by homogeneity. Thus a coherent risk measure is convex. The reverse is not true in general.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2015-12-30T14:35:04.843" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22525" PostTypeId="1" CreationDate="2015-12-30T15:23:02.440" Score="3" ViewCount="128" Body="&lt;p&gt;Given an $n\times 1$ vector of asset returns $r$, and a $n\times k$ matrix of factor loadings $X$, we can express the asset returns in terms of as-yet-unknown factors $f$ using&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;r = Xf + \epsilon&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and then estimate the factor returns with a cross-sectional regression&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\hat{f} = (X^TX)^{-1} X^Tr&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is equivalent to minimizing the cross-sectional stock-specific return $\|{\epsilon} \|^2$.  However, this relies on the loading matrix having linearly independent columns, so that $X^TX$ is invertible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are sensible reasons for choosing $X$ to not have linearly independent columns. For example, with 4 stocks from two distinct industries, we may want to consider an overall market factor, and two industry factors -&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;X = \left[\matrix{1 &amp;amp; 1 &amp;amp; 0 \\ 1 &amp;amp; 1 &amp;amp; 0 \\ 1 &amp;amp; 0 &amp;amp; 1 \\ 1 &amp;amp; 0 &amp;amp; 1}\right]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whilst any one of these columns can be expressed in terms of the others, it seems undesirable to remove the market factor, and unsymmetric to remove either of the industry factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking a cue from &lt;a href=&quot;https://en.wikipedia.org/wiki/Tikhonov_regularization&quot; rel=&quot;nofollow&quot;&gt;ridge regression&lt;/a&gt; we could consider minimizing a combination of the idiosyncratic return variance, and the factor return variance -&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;L(\epsilon,f) = \|\epsilon\|^2 + \lambda \|f\|^2&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;leading to factor returns&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\hat{f} = ( X^T X + \lambda I )^{-1} X^T r&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the inverse is defined for all $\lambda &amp;gt; 0$. My questions are -&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is there any theoretical basis for this approach (beyond the fact that it allows you to solve the problem)&lt;/li&gt;&#xA;&lt;li&gt;What is the effect of $\lambda$ on the estimated factor returns? Clearly, increasing $\lambda$ reduces the explained idiosyncratic return, but can we say more than this?&lt;/li&gt;&#xA;&lt;li&gt;Is there an obvious &quot;best&quot; choice for $\lambda$ or does it need to be chosen in an ad-hoc manner?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="924" LastActivityDate="2015-12-30T15:23:02.440" Title="Estimating factor returns with linearly dependent loadings" Tags="&lt;equities&gt;&lt;factor-models&gt;&lt;factor-loading&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22526" PostTypeId="2" ParentId="22513" CreationDate="2015-12-30T15:48:06.410" Score="0" Body="&lt;p&gt;To use this method of valuing options, we assume risk neutral probability for calculating expectation of payoff and discount it with the risk free rate to arrive at the final value. &#xA;If real world probability is used for expectation, we need to discount using real world (unknown) discount rate. &#xA;In either case, we can't mix real world and risk neutral measures. So, you can't take real probabilities to calculate a 0.1 payoff expectation and discount with a risk free rate. &#xA;Since we will be using risk free rate almost always for discounting purposes, we don't care about the real world probability (unless it is 0)&lt;/p&gt;&#xA;" OwnerUserId="13610" LastActivityDate="2015-12-30T15:48:06.410" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22527" PostTypeId="1" CreationDate="2015-12-30T18:58:54.630" Score="2" ViewCount="100" Body="&lt;p&gt;Do stocks change in value or in proportion to how much they cost? If a stock costs 100 dollar will it generally change value at the same rate as a 700 dollar stock (IE: both will move about 2 dollars in a day) or will they both change at the same proportion as each other(IE: both move about 2% each day)? Thank you for your time and help!&lt;/p&gt;&#xA;" OwnerUserId="15940" LastEditorUserId="7008" LastEditDate="2015-12-30T20:38:34.093" LastActivityDate="2015-12-30T22:23:23.660" Title="Do stocks move up and down in value or in proportion to how much they cost?" Tags="&lt;volatility&gt;&lt;equities&gt;" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22528" PostTypeId="2" ParentId="22527" CreationDate="2015-12-30T19:25:01.460" Score="0" Body="&lt;p&gt;When analyzing stock price movements mathematically it is generally assumed that each stock has a specific 'volatility' (expressed in percent) that measures the tendency of that particular stock to move. So if Stock A has a volatility of 25% and Stock B of 20%, then Stock A has a tendency to make bigger moves in percentage terms than B. However, if we know nothing about Stock A and Stock B, we might, to keep things simple, assume that they have the same volatility. In that case the situation would be as you first described: the stocks would change in proportion to the original price (for example they would have the same probability of being up more than 2% on any day).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second hypothesis you described: that the stocks would tend too move by the same dollar amount, is not taken seriously by anyone as far as I know.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2015-12-30T21:02:58.707" LastActivityDate="2015-12-30T21:02:58.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22529" PostTypeId="2" ParentId="22527" CreationDate="2015-12-30T19:27:14.967" Score="0" Body="&lt;p&gt;Theoretically in proportion : the classical Geometric Brownian motion (GBM) for stock price is defined as follow :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS_{t} = \mu S_{t}dt + \sigma S_{t}dW_{t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $S_{t}$ is the stock price, $W_{t}$ a wiener process and $\mu$ and $\sigma$ are &lt;strong&gt;percentage&lt;/strong&gt; drift and volatility term.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then a infinitesimal change in price ($dS_{t}$) is proportional to the stock price :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS_{t} = S_{t} (\mu dt + \sigma  dW_{t})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that it is also why the stock price can never go bellow zero.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2015-12-30T19:34:54.820" LastActivityDate="2015-12-30T19:34:54.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22530" PostTypeId="1" CreationDate="2015-12-30T20:33:23.730" Score="2" ViewCount="478" Body="&lt;p&gt;I am looking for some literature devoted to optimization methods in finance (portfolio optimization, asset pricing etc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you please recommend some books (perhaps, essentially non elementary: I have a master's degree in applied mathematics)?&lt;/p&gt;&#xA;" OwnerUserId="18809" LastEditorUserId="467" LastEditDate="2016-01-01T09:24:28.400" LastActivityDate="2016-01-02T09:17:04.257" Title="What are the canonical books on optimization methods?" Tags="&lt;optimization&gt;&lt;reference-request&gt;&lt;books&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22531" PostTypeId="2" ParentId="14263" CreationDate="2015-12-30T21:02:03.073" Score="-1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Simulated Historical Data?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;YES!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use this definition to simulate historical closing price data so that I can&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;backtest against multiple, statistically generated historical data&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;in python:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def sim_data():&#xA;&#xA;    for n in range(10): # datasets to generate&#xA;        sine = 'sine_' + str(n)&#xA;        log_periodic = 'log_periodic' + str(n)&#xA;&#xA;        v = 7           # number of harmonics&#xA;        w = 0.0000004   # base acceleration&#xA;        x = 0.0000032   # cyclic acceleration&#xA;        z = 0.08        # random walk amplitude&#xA;        y = 0.0023      # frequency&#xA;&#xA;        storage[sine] = 1 + x - w&#xA;        for a in range(1,v):&#xA;            storage[sine] += (x/a)*math.sin(y*a*info.tick)&#xA;        storage[log_periodic] = storage.get(log_periodic, &#xA;            float(data.btc_usd.price)) #begin at same price as first tick&#xA;        storage[log_periodic] *= math.pow(storage[sine], info.tick)&#xA;        storage[log_periodic] = ((1-z)+2*z*random.random()&#xA;            )*storage[log_periodic]   &#xA;&#xA;        plot(('log_periodic'+str(n)), storage[log_periodic], secondary=True)  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/3nvJo.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/3nvJo.png&quot; alt=&quot;https://tradewave-discourse-uploads.s3.amazonaws.com/1592154d07d578f4fa75231a0e1b47464bd30ba713b8_690x462.png&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The yellow line is the price of bitcoin.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other lines are simulated completely independently of closing price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can adjust the parameters to change the nature of the growth/decay&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;        v = 7           # number of harmonics&#xA;        w = 0.0000004   # base acceleration&#xA;        x = 0.0000032   # cyclic acceleration&#xA;        z = 0.08        # random walk amplitude&#xA;        y = 0.0023      # frequency&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I call this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Log Harmonic Random Walk&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm developing this definition here:&#xA;&lt;a href=&quot;https://discuss.tradewave.net/t/simulated-hlocv-for-overfit-testing/497/16&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://discuss.tradewave.net/t/simulated-hlocv-for-overfit-testing/497/16&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15468" LastEditorUserId="15468" LastEditDate="2015-12-30T21:54:03.187" LastActivityDate="2015-12-30T21:54:03.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22532" PostTypeId="2" ParentId="22527" CreationDate="2015-12-30T21:03:30.843" Score="0" Body="&lt;p&gt;option pricing scale invariant times a constant, meaning that percentages matter, not absolute price . &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you multiply the strike and spot price in the black sholes equation by the same constant, you'll see.&lt;/p&gt;&#xA;" OwnerUserId="15081" LastActivityDate="2015-12-30T21:03:30.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22533" PostTypeId="2" ParentId="14263" CreationDate="2015-12-30T22:10:05.890" Score="0" Body="&lt;p&gt;According to me, backtesting resumes to &lt;strong&gt;a validation process of the optimization method&lt;/strong&gt; employed to fix parameters of your model.&lt;/p&gt;&#xA;&lt;p&gt;In such case you can perform multiple out of sample backtests, each of one having a different out of sample-period devoted to the optimization of the parameters and a second period to test the strategy.For each testing period you input new (optimized) parameters in your trading strategy. Then by observing results you can see if your optimization (and your model) is stable and correct over a long horizon.&#xA;Additionally, in doing so, your backtests are never based on &amp;quot;in sample&amp;quot; data and you eliminate the bias. It allows you to evaluate the stability of the optimization method and not of a particular scenario.&lt;/p&gt;&#xA;&lt;p&gt;This methodology is called &lt;strong&gt;Walk forward optimization&lt;/strong&gt;, you can read the following book to know more about it :&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;The Evaluation and Optimization of Trading Strategies&lt;/em&gt;, 2nd Edition by Robert Pardo&#xA;ISBN: 978-0-470-12801-5&#xA;Wiley trading.&lt;/p&gt;&#xA;&lt;p&gt;For a quick overview : &lt;a href=&quot;https://en.wikipedia.org/wiki/Walk_forward_optimization&quot; rel=&quot;nofollow noreferrer&quot;&gt;Wiki link&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Ps : I will not use simulated data based on another statistical model because it will add another uncertainty in the evaluation (i.e : is your statistical model correct ?)&lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2015-12-30T22:29:19.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22534" PostTypeId="2" ParentId="22527" CreationDate="2015-12-30T22:23:23.660" Score="2" Body="&lt;p&gt;I'm a beginner like you, but i would like to take my shot at this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically I think there are three ways to answer your question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First way is represented by Malick's answer above: you try to come up with a model that seems to fit reality well enough, you apply the question to the model, and whatever answer the model gives you, you say it applies to reality.&#xA;In this case the model says the change in the stock price is percentage based.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second way in my opinion is to look at data, a lot of it, without using a model. You just look at hundreds of thousands of stocks, maybe group them by price range, and you test your hypothesis. The drawback of this approach is it's a lot of work everytime you ask a new question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The third way I see would be to ask: &quot;What makes a stock price change ?&quot;. This is more of a behavioral approach. If I am an investor and I see a stock that I want to buy at price P, what would be my bid if P=10 and if P=100 ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I realize I'm not really answering your question (because I don't actually know the answer), just food for thought...&lt;/p&gt;&#xA;" OwnerUserId="18800" LastActivityDate="2015-12-30T22:23:23.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22535" PostTypeId="2" ParentId="22513" CreationDate="2015-12-30T23:14:11.257" Score="-1" Body="&lt;p&gt;Real probability has its use in deriving the stochastic discount factor. The fundamental equation in asset pricing is $p = E[mX]$. In the two-period discrete time world, we have $p = \sum_{s \in S} Pr(s) m(s) X(s)$ for all possible states. Now consider the binomial tree world, we have a stock, a bond and a call option. We want to find a $m$ that prices all three assets. Let's first consider pricing stock and bonds. For the stock, $100=S_0 = p_um(u)S_1(u) + p_dm(d)S_1(d) = 0.99m(u)110+0.01m(d)90$, and for the bond $1/(1+0.1)=B_0 = p_um(u)1 + p_dm(d)1 = 0.99m(u)+0.01m(d)$. With two equations and two unknowns, you can solve for $m$. Now you can use this $m$ to price the call option payoff as $C_0 = p_um(u)(110-100)+p_dm(d)(100-100) = p_um(u) \cdot 10$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More explicitly, the link between risk-neutral and the SDF approach is to consider the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align*}&#xA;p &amp;amp;= \sum_{s \in S} Pr(s) m(s) X(s)\\&#xA;  &amp;amp;= \sum_{s \in S}Pr(s) m(s) \cdot \sum_{s \in S} \frac{Pr(s)m(s)}{\sum_{s \in S} &#xA;m(s)} X(s)\\&#xA;  &amp;amp;= \frac{1}{r} \cdot \sum_{s \in S} \frac{Pr(s)m(s)}{\sum_{s \in S} Pr(s)m(s)} X(s)\\&#xA;  &amp;amp;= \frac{1}{r} \cdot \sum_{s \in S} q(s) X(s)\\&#xA;  &amp;amp;= \frac{1}{r} E^*[X]\\&#xA;\end{align*}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $\sum_{s \in S}Pr(s) m(s) = 1/r$ and $q(s) =\frac{Pr(s)m(s)}{\sum_{s \in S} Pr(s) m(s)}$. You can check for yourself that $q(s)$ is indeed the risk-neutral probability. In a general equilibrium pricing context, $m$ is a measure of risk aversion. Referring back to the calculation of $m$, the price of the stock and bond reflects how high/low $m$, i.e. people's risk aversions are. So a set of real probability reflects the set of risk aversion, or $m$ in mind. &lt;/p&gt;&#xA;" OwnerUserId="6804" LastEditorUserId="6804" LastEditDate="2015-12-31T00:07:24.243" LastActivityDate="2015-12-31T00:07:24.243" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22536" PostTypeId="1" AcceptedAnswerId="22538" CreationDate="2015-12-31T03:14:03.273" Score="-1" ViewCount="3265" Body="&lt;p&gt;Hi I was reading about book value of a company and the book value per share and couldn't figure out the difference between book value per share and earning per share.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are the two even related?&lt;/p&gt;&#xA;" OwnerUserId="18810" LastEditorUserId="467" LastEditDate="2015-12-31T05:13:03.183" LastActivityDate="2015-12-31T05:13:03.183" Title="What is the difference between book value per share (BVPS) and earning per share(EPS)?" Tags="&lt;finance&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2015-12-31T05:09:18.533" ContentLicense="CC BY-SA 3.0" />
  <row Id="22538" PostTypeId="2" ParentId="22536" CreationDate="2015-12-31T04:22:27.663" Score="2" Body="&lt;p&gt;The two are not comparable.&#xA;Book value per share is the shareholder's equity divided by the number of commons shares. You can think of it as what would be left were the company to liquidate, after all debts have been paid.&#xA;Earnings per share is the net income that goes to common shareholders.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The former is a state, the latter is a flow. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that earnings per share contributes to book value.&lt;/p&gt;&#xA;" OwnerUserId="18800" LastActivityDate="2015-12-31T04:22:27.663" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22539" PostTypeId="1" CreationDate="2015-12-31T05:36:28.930" Score="0" ViewCount="106" Body="&lt;p&gt;Spin-off from: &lt;a href=&quot;https://quant.stackexchange.com/questions/22228/pricing-when-arbitrage-is-possible-through-negative-probabilities-or-something-e&quot;&gt;Pricing when arbitrage is possible through Negative Probabilities or something else&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I mean in a theoretical sense: If we have a particular market model with some fancy assumptions such as completeness, frictionlessness, permission of shorting and fractional purchases, etc, does presence of arbitrage necessarily make all kinds of derivatives have zero value?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that in the previous question, such market models might make all European call options have zero value, but what about Eur puts? Am calls/puts? Forwards? Options? Futures? Other Derivatives? Even if the answer is yes to all those, what about in other kinds of market models?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I mean in a theoretical sense: If we have a particular market model (which I guess we may assume is complete or frictionless if need be) where shorting and fractional purchases are allowed, does presence of arbitrage necessarily make all kinds of derivatives have zero value? It seems that in the previous question, such market models might make all European call option&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-01-01T23:04:24.433" Title="Does presence of arbitrage necessarily make all derivatives have zero value?" Tags="&lt;option-pricing&gt;&lt;arbitrage&gt;&lt;derivatives&gt;&lt;pricing&gt;&lt;market-model&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22540" PostTypeId="2" ParentId="22513" CreationDate="2015-12-31T07:22:10.850" Score="4" Body="&lt;p&gt;It's a pitty that you don't show in your question how you get to your value for $c_0$ but the idea is that you build a portfolio $X_0 = \Delta S_0 - \lambda$ and you infer the values for $\Delta$ and $\lambda$ so that $X_1 = c_1$ both in the up and down scenario. Then, because of the law of one price, $X_0 = c_0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for us $X_1 = \Delta S_1 + (1+r) \lambda$ and we want it to be equal to $\max(S_1 - K, 0 )$ in both up and down case :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \Delta S_u + (1+r)\lambda = \max(S_u - K, 0 )$$&#xA;$$ \Delta S_d + (1+r)\lambda = \max(S_d - K, 0 )$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This yields (using you values for $S_d$, $S_0 = K$ and $S_u$):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \Delta S_u - \Delta S_d = \max(S_u - K, 0 ) - \max(S_d - K, 0 ) = S_u - K$$&#xA;$$ \Delta = \frac{ S_u - K }{S_u - S_d} = \frac{ 10}{20}=50\% $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Plugging this back into the second equation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ 50\% \cdot S_d + (1+r)\lambda = \max(S_d - K, 0 ) = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\lambda = 50\% \cdot -\frac{S_d}{1+r} =  -40.91$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means that, by buying 50% of the share at time zero and borrowing $40.91 in the money market at time, you will replicate exactly the payoff of a call option at time 1. You did not mention probabilities at all here, they are completely irrelevant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value of the replication portfolio at time 0 is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X_0 = \Delta S_0 - \lambda = 50\% \cdot S_0 - 40.91 = 50-40.91 = 9.09 =c_0$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and hence because holding $X$ is exactly the same as holding the call itself, both should have the same value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If some option trader agrees to sell that call for less that \$9.09, say \$2.00, buy the call and sell $X$, you know that whatever you make with the call you will lose on $X$, but the time 0 profit of 9.09 - 2.00 = 7.09 is locked and will not change whatever the market does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of probability, the only thing you need is to agree that $\mathbb{P}(S_1=S_u) &amp;gt; 0$, $\mathbb{P}(S_1=S_u) &amp;gt; 0$ and $\mathbb{P}(S_1 \in \{S_u, S_d\} ) = 1$.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2015-12-31T07:54:00.387" LastActivityDate="2015-12-31T07:54:00.387" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22541" PostTypeId="2" ParentId="22513" CreationDate="2015-12-31T10:30:16.153" Score="4" Body="&lt;p&gt;&quot;But just for fun, let's say Pr(S1=Su)=1% and Pr(S1=Sd)=99%, in which case, on average, the call at time 1 would be worth 0.01*10 = 0.1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would anyone be willing to pay 9.28$ for that ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm pretty sure I'm missing something very basic, I hope someone can explain what it is.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would anyone pay 100 for the stock given these probabilities? You don't seem to question that. And this is the 'basic' link that you are missing. Real world probabilities have been already incorporated in the pricing of the spot (loosely speaking). Derivatives are priced in relation to the stock: if the stock is unintuitive, as per your example, then derivatives will also appear stupid. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2015-12-31T10:30:16.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22542" PostTypeId="2" ParentId="22530" CreationDate="2015-12-31T10:42:05.950" Score="1" Body="&lt;p&gt;Some suggestions:-&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.amazon.co.uk/Modern-Portfolio-Investment-Analysis/dp/1118469941/ref=sr_1_1?ie=UTF8&amp;amp;qid=1451556249&amp;amp;sr=8-1&amp;amp;keywords=modern+portfolio+theory&quot; rel=&quot;nofollow&quot;&gt;Modern Portfolio Theory and Investment Analysis, Ch. 6 Techniques for Calculating the Efficient Frontier&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Original 1970 paper&#xA;&lt;a href=&quot;http://dspace.mit.edu/bitstream/handle/1721.1/46832/analyticderivati00mert.pdf?s&quot; rel=&quot;nofollow&quot;&gt;An analytic derivation of the efficient portfolio frontier&#xA;by Merton, Robert C&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.amazon.co.uk/Handbook-Portfolio-Construction-Contemporary-Applications/dp/0387774386&quot; rel=&quot;nofollow&quot;&gt;Handbook of Portfolio Construction: Contemporary Applications of Markowitz Techniques&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7178" LastActivityDate="2015-12-31T10:42:05.950" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22543" PostTypeId="1" AcceptedAnswerId="22544" CreationDate="2015-12-31T10:45:41.277" Score="0" ViewCount="65" Body="&lt;p&gt;An example:&#xA;I have 1000 dollars, the leverage is 10x, and one stock is 10$. In casual situation I could buy 100 stocks, because I have 1000 dollars, but if I use the leverage I can buy 1000 stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see the mechanism, how it works, but I don't know how do that +9000 dollars come from. Because in deed I do not have that 9000 dollars, so I will pay 'non-existent' money, but when I sell, I get it back existent money. Furthermore the person/company who sell their stocks will get existent money too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where does it come that plus 9000? Or who pays off that plus amount?&lt;/p&gt;&#xA;" OwnerUserId="6975" LastEditorUserId="6975" LastEditDate="2015-12-31T11:31:43.030" LastActivityDate="2015-12-31T11:31:43.030" Title="What is the source of the money in a leverage transaction?" Tags="&lt;equities&gt;&lt;leverage&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22544" PostTypeId="2" ParentId="22543" CreationDate="2015-12-31T11:28:15.320" Score="3" Body="&lt;p&gt;You borrow that money from your broker. If you are retail client with for example IG they will offer this service to you. They will charge you some interest for the lending.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There will be a margin account into which you need to deposit your cash. If the leveraged position you have loses money on the M2M and amount in margin account goes below a threshold, they will call you and ask to deposit more cash in the margin account. Else they will liquidate your positions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By having this system, where you need to replenish the margin account. In theory if losses are small and continuous (no jumps), the broker in theory never loses money. Losses are all paid for by the amount in your margin account, and positions will be liquidated before it eats up the brokers money. In reality this does not hold due to jumps in prices etc.&lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2015-12-31T11:28:15.320" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22545" PostTypeId="2" ParentId="22513" CreationDate="2015-12-31T12:32:40.290" Score="0" Body="&lt;p&gt;Your scenario is impossible because you are missing the no-arbitrage hypothesis (no free lunch).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Replication Portfolio:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Buy 0.5 Shares and short 1 call :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Payoff Up : $ 0.5*110-10 = 45$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Payoff Down : $ 0.5*90=45 $  (call is not exercised)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Present value Portfolio = 45 / (1.1) = 40.91&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the call price is 9.09  (see @SRKX answer).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Initial cost of portfolio  : $ 50 -  9.09 = 40.91 $&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;How would anyone be willing to pay 9.09$ for that?&lt;/em&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because, no matters the real probabilities, at a different price there are free lunch possibilities.  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;If the price of the call is superior to 9.09 $, let's say 10 dollars the investor can create the replication portfolio for less than 40.91 at 40 (50-10=40) by borrowing 40. At maturity the portfolio worth 45 and he pays back only 44 dollars(40*1.1). He will receive a free lunch of 1 dollar. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If the price of the call is inferior to 9.09 $, let's say 9 dollars the investor short sell the portfolio at its initial cost 41 dollars (50-9) and can invest 40.91 at the risk free rate. At maturity he will receive 45 dollars (40.91*1.1), this will cover the price of the portfolio and he will make an initial free benefit (41-40.91=0.09).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In both cases there is no risk and no initial investment so you are violating the no-arbitrage hypothesis. The real probabilities play no role.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2015-12-31T12:48:06.370" LastActivityDate="2015-12-31T12:48:06.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22546" PostTypeId="1" AcceptedAnswerId="22547" CreationDate="2015-12-31T12:46:16.433" Score="1" ViewCount="129" Body="&lt;p&gt;Suppose you construct a portfolio of two stocks, whose values $A$ and $B$ are modelled as a Bachelier process: $$dA = \sigma_A dW_A(t) \text{ and } dB = \sigma_B d W_B(t).$$&#xA;Each of the stock prices is driven by a different Brownian motion with correlation $\rho$. The value of the portfolio is $P = A + B$. I want to model this portfolio; so I started like this: &#xA;$$dP =dA + dB = \sigma_A dW_A(t) + \sigma_B d W_B(t),$$ &#xA;however, I feel like you can include the correlation somehow, but I don't know how. Any ideas? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="18656" LastActivityDate="2015-12-31T12:58:01.137" Title="Portfolio of sum of two Bachelier processes" Tags="&lt;equities&gt;&lt;portfolio-management&gt;&lt;modeling&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22547" PostTypeId="2" ParentId="22546" CreationDate="2015-12-31T12:58:01.137" Score="5" Body="&lt;p&gt;Since $dW_A$ and $dW_B$ are already correlated as per the way you construct it, your portfolio being the sum of the two is already correlated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want it very explicitity written out, then you could rewrite $dW_B = \rho dW_A + \sqrt{1-\rho^2}dW_Z$ where $dW_Z$ is independent of $dW_A$. More generally (higher dimensions) you can use Cholesky.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now with this decomp your portfolio dynamics are:&#xA;$dP = \sigma_A dW_A + \sigma_B(\rho dW_A + \sqrt{1-\rho^2}dW_Z)$&lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2015-12-31T12:58:01.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22548" PostTypeId="1" CreationDate="2015-12-31T15:29:52.280" Score="8" ViewCount="3843" Body="&lt;p&gt;What is a good reading list for Global Macro investing? What does Bridgewater, Bervan Howard, Soros, AQR etc. use to teach their staff about macroeconomic investing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us assume a top-class education at the undergraduate level in economics, maths, and economic history so as to avoid the common recommendations of not very useful introductory texts. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: Global Macro Investing involves expressing views on commodities, rates, FX, Real Estate, Equities and other asset classes using ownership, futures, or options to find relative value and generate alpha on a global basis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example: Short USDTRY on asset outflows from turkey due to geo-political risk and US tightening cycle compared to TRY printing/easing.&lt;/p&gt;&#xA;" OwnerUserId="16138" LastEditorUserId="467" LastEditDate="2016-01-01T09:20:32.120" LastActivityDate="2018-05-30T16:42:18.970" Title="What are the canonical global-macro investing books?" Tags="&lt;reference-request&gt;&lt;macro-economics&gt;" AnswerCount="4" CommentCount="6" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="22549" PostTypeId="1" CreationDate="2015-12-31T15:57:45.660" Score="1" ViewCount="497" Body="&lt;p&gt;I saw this question as an interview, and to be honest, I have no idea what it's even asking for:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Write a function (in R or Python) that finds the stock drawdown which&#xA;will trigger a rebalance, if given:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;an X% stock (vs bond) target&#xA;allocation; and&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;a Y% drift threshold from target allocation.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Do I pick a drawdown figure (20%?) and then calculate how much stocks need to fall to hit 20% portfolio DD given x% in stocks?&lt;/p&gt;&#xA;&lt;p&gt;Do bond returns stay constant?&lt;/p&gt;&#xA;&lt;p&gt;Same thing with the 2nd question, I just don't seem to understand what they are asking?&lt;/p&gt;&#xA;&lt;p&gt;Any help appreciated!&lt;/p&gt;&#xA;" OwnerUserId="18818" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-01-01T09:08:43.080" Title="How to answer this interview programming question about drawdowns?" Tags="&lt;portfolio-management&gt;&lt;programming&gt;&lt;asset-allocation&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22550" PostTypeId="2" ParentId="22549" CreationDate="2015-12-31T17:26:16.753" Score="1" Body="&lt;p&gt;Say X&lt;sub&gt;0&lt;/sub&gt; is the % of stock at the peek&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For 1), assuming the bond return stays constant, we will trigger a rebalance when:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{X_0(1 - DD)}{X_0(1-DD) + (1 - X_0)} = \frac{X_0(1-DD)}{1-X0.DD} = X$, and solving for DD gives $ DD = \frac{X_0 - X}{X_0(1 - X)} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For 2), I would say same answer replacing $X$ by $ X(1 - Y) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not sure if this the correct answer, question formulation is weird.&lt;/p&gt;&#xA;" OwnerUserId="18800" LastEditorUserId="18800" LastEditDate="2015-12-31T17:31:43.237" LastActivityDate="2015-12-31T17:31:43.237" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22553" PostTypeId="2" ParentId="7112" CreationDate="2016-01-01T01:08:32.383" Score="1" Body="&lt;p&gt;You might want to check into Python Mapper, a Python module written by some of the founders of Ayasdi. It can be used to generate simplicial complexes which can be used to construct visualizations like those at Ayasdi.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ended using Gephi, a network visualization software, to visualize the 1-simplexes generated from Mapper. As an example, the image below is the result of running mapper on a point cloud of data sampled from a torus.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/XU12k.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/XU12k.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18821" LastActivityDate="2016-01-01T01:08:32.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22554" PostTypeId="2" ParentId="22475" CreationDate="2016-01-01T02:50:50.967" Score="8" Body="&lt;p&gt;&lt;a href=&quot;http://opentsdb.net/&quot;&gt;OpenTSDB&lt;/a&gt; is good for large-scale time series storage. &lt;a href=&quot;https://github.com/metrilyx/opentsdb-pandas&quot;&gt;metrilyx/opentsdb-pandas&lt;/a&gt; and &lt;a href=&quot;https://github.com/wiktorski/opentsdb_pandas&quot;&gt;wiktorski/opentsdb_pandas&lt;/a&gt; seems to provide the interface with pandas. &lt;a href=&quot;http://www.moredevs.com/opentsdb-and-hbase-rough-performance-test/&quot;&gt;OpenTSDB and HBase rough performance test | MoreDevs&lt;/a&gt; provides a benchmark, may not exactly match your requirements but you can try.&lt;/p&gt;&#xA;" OwnerUserId="5427" LastActivityDate="2016-01-01T02:50:50.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22555" PostTypeId="2" ParentId="22548" CreationDate="2016-01-01T09:09:50.830" Score="1" Body="&lt;p&gt;Expected Returns by Antti ilmanen is a good one.   It examines the long term profitability of various strategies.   &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-01-01T09:09:50.830" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22556" PostTypeId="2" ParentId="22530" CreationDate="2016-01-01T09:29:33.077" Score="1" Body="&lt;p&gt;I used &lt;a href=&quot;http://www.amazon.co.uk/Optimization-Methods-Finance-Mathematics-Risk/dp/0521861705/ref=sr_1_1?ie=UTF8&amp;amp;qid=1451640318&amp;amp;sr=8-1&amp;amp;keywords=optimisation%20methods%20in%20finance&quot; rel=&quot;nofollow&quot;&gt;Optimisation Methods in Finance&lt;/a&gt;, it covers:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Linear Programming&lt;/li&gt;&#xA;&lt;li&gt;Nonlinear Programming&lt;/li&gt;&#xA;&lt;li&gt;Quadratic Pogramming&lt;/li&gt;&#xA;&lt;li&gt;Conic Programming&lt;/li&gt;&#xA;&lt;li&gt;Integer Programming&lt;/li&gt;&#xA;&lt;li&gt;Dynamic Programming&lt;/li&gt;&#xA;&lt;li&gt;Stochastic Programming&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I haven't come across another book with such coverage or wider yet, although I've not been actively looking though.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2016-01-01T09:29:33.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22557" PostTypeId="2" ParentId="7049" CreationDate="2016-01-01T11:03:45.693" Score="0" Body="&lt;p&gt;The constant factor should be a proportional to the current price. A stock with a high price per share would have a higher absolute spread cost. The volatility and volume ratio parameters are invariant &lt;/p&gt;&#xA;" OwnerUserId="15081" LastActivityDate="2016-01-01T11:03:45.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22558" PostTypeId="2" ParentId="22339" CreationDate="2016-01-01T14:14:09.160" Score="6" Body="&lt;h2&gt;Morningstar&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Morningstar partnered with Quantopian, and the latter published the structure of Morningstar's equity fundamentals database:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.quantopian.com/help/fundamentals&quot; rel=&quot;noreferrer&quot;&gt;https://www.quantopian.com/help/fundamentals&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Quantopian users can use this data for free.&lt;/p&gt;&#xA;" OwnerUserId="11701" LastActivityDate="2016-01-01T14:14:09.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22559" PostTypeId="2" ParentId="22539" CreationDate="2016-01-01T23:04:24.433" Score="3" Body="&lt;p&gt;To answer your question:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I mean in a theoretical sense: If we have a particular market model (which I guess we may assume is complete or frictionless if need be) where shorting and fractional purchases are allowed, &lt;strong&gt;does presence of arbitrage necessarily make all kinds of derivatives have zero value?&lt;/strong&gt; &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The answer is &lt;strong&gt;no&lt;/strong&gt;. See example below. Went over your &lt;a href=&quot;https://quant.stackexchange.com/questions/22228/pricing-when-arbitrage-is-possible-through-negative-probabilities-or-something-e&quot;&gt;original link&lt;/a&gt; and I took the model you constructed from there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;S_0 =\begin{bmatrix}&#xA;2 \\ &#xA;3\\ &#xA;1&#xA;\end{bmatrix}, S_1 = \begin{bmatrix}&#xA;S_1^0\\ &#xA;S_1^1\\ &#xA;S_1^2&#xA;\end{bmatrix}, D = \begin{bmatrix}&#xA;1 &amp;amp; 2 &amp;amp; 3\\ &#xA;2 &amp;amp; 2 &amp;amp; 4\\ &#xA;0.8 &amp;amp; 1.2 &amp;amp; 1.6&#xA;\end{bmatrix}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all, consider the the trivial derivatives. The trivial call option with strike K = 0 are the ones with the same payoff as the stocks. In your model the stocks have positive price:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;S_0 =\begin{bmatrix}&#xA;2 \\ &#xA;3\\ &#xA;1&#xA;\end{bmatrix}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore the K=0 calls have the same price and therefore the price are bigger than zero (answering your question).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want an example that is less trivial consider the option that pays out the $max(S_1^0,S_1^1,S_1^2 )$. This derivative is worth more than each of the original products, which had positive price. Thus this derivative also has positive price.&lt;/p&gt;&#xA;" OwnerUserId="17316" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-01-01T23:04:24.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22561" PostTypeId="2" ParentId="22530" CreationDate="2016-01-02T09:17:04.257" Score="0" Body="&lt;p&gt;I really like a lot &lt;a href=&quot;http://www.thierry-roncalli.com/RiskParityBook.html&quot; rel=&quot;nofollow&quot;&gt;Introduction to Risk Parity and Budgeting&lt;/a&gt;, by Thierry Roncalli. It covers a lot of aspect of portfolio construction, including portfolios of bonds, and provides a focus on risk management.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Table of Contents is&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Part I. From Portfolio Optimization to Risk Parity&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Modern Portfolio Theory&lt;/li&gt;&#xA;&lt;li&gt;Risk Budgeting Approach&lt;/li&gt;&#xA;&lt;/ol&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Part II. Applications of the Risk Parity Approach&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;Risk-Based Indexation&lt;/li&gt;&#xA;&lt;li&gt;Application to Bond Portfolios&lt;/li&gt;&#xA;&lt;li&gt;Risk Parity Applied to Alternative Investments&lt;/li&gt;&#xA;&lt;li&gt;Portfolio Allocation with Multi-Asset Classes&lt;/li&gt;&#xA;&lt;/ol&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Appendix&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A. Technical Appendix&lt;/p&gt;&#xA;&#xA;&lt;p&gt;B. Tutorial Exercises&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2016-01-02T09:17:04.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22562" PostTypeId="2" ParentId="22508" CreationDate="2016-01-02T09:45:50.707" Score="3" Body="&lt;p&gt;First, have a look at Market &lt;a href=&quot;http://www.worldscientific.com/worldscibooks/10.1142/8967&quot; rel=&quot;nofollow&quot;&gt;Microstructure in Practice&lt;/a&gt; (Laruelle et L) to have generic explanations about all this. In short:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Equity markets are &lt;strong&gt;fragmented&lt;/strong&gt;: it means to buy or sell shares, you connect (via a broker) to a server on which you send a message with a side (buy or sell), a max/min price and a quantity. &lt;/li&gt;&#xA;&lt;li&gt;these servers are technically &lt;strong&gt;matching engine&lt;/strong&gt;: they check if they have a resting compatible message (selling/buying message with a lower/higher price than yours), they generate a &lt;strong&gt;transaction&lt;/strong&gt;. NASDAQ, Nyse, BATS, etc (ie &lt;em&gt;market operators&lt;/em&gt;) are running such servers. In the US, depending on the regulatory status they choose, they will be called an Exchange, an ATS, or an ECN. In Europe they will be called Regulated Markets or MTF.&lt;/li&gt;&#xA;&lt;li&gt;In the US the regulation demand the server you are connect to to check if there is a better price elsewhere (this is called the &lt;strong&gt;trade through rule&lt;/strong&gt;) and have to route your message there in such a case. The market operator has to check the &lt;strong&gt;NBBO&lt;/strong&gt; (national best bid and offer) to know if there is a better quote, compatible with your message, elsewhere. In Europe brokers are in charge of this re-routing task via their &lt;strong&gt;best execution policy&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In such a landscape, from the viewpoint of a &lt;em&gt;market operator&lt;/em&gt;, the more resting orders you have, the largest market share you will have (ie the more transactions you will generate), because you take fees on trades you generate. That is why you make agreements with &lt;strong&gt;market makers&lt;/strong&gt; so that they will post resting orders. &lt;em&gt;Agreements&lt;/em&gt; can mean: pay less fees, have optional orders or special priority schemes (for instance about &lt;a href=&quot;https://www.nyse.com/publicdocs/nyse/markets/nyse/Parity_and_Priority_Fact_Sheet.pdf&quot; rel=&quot;nofollow&quot;&gt;parity on the Nyse&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note it means the broker does not choose that much with whom you trade. He can have agreements with other brokers to match your message inside the NBBO, but cannot worsen your price.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2016-01-02T09:45:50.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22564" PostTypeId="1" AcceptedAnswerId="22566" CreationDate="2016-01-02T19:25:27.650" Score="0" ViewCount="1882" Body="&lt;p&gt;I'm trying to compute an implied volatility -- I am trying to match real data I see in Yahoo finance which shows an IV of about 27%. My call in 'R' for the same params returns a root not bracketed error -- can anyone help pls?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sample:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; AmericanOptionImpliedVolatility(type=&quot;put&quot;, value=2.7, &#xA;      underlying=55.0, strike=60, dividendYield=0.02, riskFreeRate=0.03, &#xA;      maturity=0.02, volatility=0.2)&#xA;&#xA;RESULT:&#xA;Error in americanOptionImpliedVolatilityEngine(type, value, underlying,  &#xA;: root not bracketed: f[1e-07,4] -&amp;gt; [2.300000e+00,1.256782e+01]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2186" LastEditorUserId="848" LastEditDate="2016-01-03T09:49:21.563" LastActivityDate="2016-01-03T09:49:21.563" Title="AmericanOptionImpliedVolatility - root not bracketed issue in QuantLib/R" Tags="&lt;options&gt;&lt;quantlib&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22565" PostTypeId="1" CreationDate="2016-01-02T22:01:57.237" Score="1" ViewCount="455" Body="&lt;p&gt;I am quoting from &quot;Tools for Computational Finance, 5th Edition&quot; [Seydel].&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;I wonder whether the histogram of simulations of the first (yellow) SDE makes sense...&lt;/strong&gt; especially given that Seydel (correctly) states that the resulting percentage changes are normally distributed (i.e. can go below -100%).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Shouldn't the histogram much rather correspond to asset prices simulated from the second (red) SDE, as the second SDE would produce log-prices which are normally distributed, i.e. prices which are log-normally distributed?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Mn1Gw.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Mn1Gw.png&quot; alt=&quot;Seydel, Tools for Computational Finance&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The related question &lt;a href=&quot;https://quant.stackexchange.com/questions/4589/how-to-simulate-stock-prices-with-a-geometric-brownian-motion&quot;&gt;How to simulate stock prices with a Geometric Brownian Motion?&lt;/a&gt; does not quite cover this.&lt;/p&gt;&#xA;" OwnerUserId="18832" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-03-03T00:06:25.237" Title="Geometric Brownian Motion: d(S) vs. d(ln(S))" Tags="&lt;monte-carlo&gt;&lt;brownian-motion&gt;&lt;sde&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22566" PostTypeId="2" ParentId="22564" CreationDate="2016-01-02T22:02:58.177" Score="6" Body="&lt;p&gt;It is a simple root finder, and if you give it impossible starting values... well then it fails.  Here, you can play with the values and it seems bounded at USD 5 whereas you start from USD 2.7:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;R&amp;gt; AmericanOption(type=&quot;put&quot;, underlying = 55, strike = 60, &#xA;+                 dividendYield = 0.02, riskFreeRate = 0.03, &#xA;+                 maturity = 0.02, volatility = 0.2)&#xA;Concise summary of valuation for AmericanOption &#xA; value  delta  gamma   vega  theta    rho divRho &#xA;     5     NA     NA     NA     NA     NA     NA &#xA;R&amp;gt; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Maybe you had strike and underlying mixed up?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;R&amp;gt; AmericanOptionImpliedVolatility(type=&quot;put&quot;, value=2.7, &#xA;+              underlying=60.0, strike=55.0, dividendYield=0.02, &#xA;+              riskFreeRate=0.03, maturity=0.02, volatility=0.2)&#xA;[1] 1.48203&#xA;attr(,&quot;class&quot;)&#xA;[1] &quot;AmericanOptionImpliedVolatility&quot; &quot;ImpliedVolatility&quot;  &#xA;R&amp;gt; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="69" LastEditorUserId="69" LastEditDate="2016-01-02T22:05:01.380" LastActivityDate="2016-01-02T22:05:01.380" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22567" PostTypeId="2" ParentId="22565" CreationDate="2016-01-02T22:27:37.260" Score="1" Body="&lt;p&gt;Equation 1.33 results in lognormally distributed prices. The price can't go below zero, because the equation is being integrated over infinitesimally short periods of time.  The discrete approximation 1.34a could go negative if $\Delta t$ is big, if it is reasonably small that is unlikely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, although Equations 1.33 and 1.46 look completely different, they are atually intimately related (through a change of variables), as you will soon find out.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-01-02T22:50:46.480" LastActivityDate="2016-01-02T22:50:46.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22569" PostTypeId="1" AcceptedAnswerId="22570" CreationDate="2016-01-03T10:39:19.957" Score="2" ViewCount="193" Body="&lt;p&gt;I'm trying to solve the following problem. Given a process $X_t$ and a process $Z_t$, with the dynamics of $X_t$ as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;dX_t = (\alpha + \beta X_t)dt + (\gamma + \sigma X_t)dW_t&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and $Z_t$ defined as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Z_t = \exp(\sigma W_t + (\beta-\frac{1}{2} \sigma^2)t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W_t$ is a standard brownian motion, $\alpha$, $\beta$, $\gamma$ and $\sigma$ constants in $R$, i have to find the dynamics of the process $X_t / Z_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, i've tried the following. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) I treat the process $X_t / Z_t$ as a function of $X_t$ and $t$, and derive the dynamics of $d(X_t/Z_t)$ using Itô's formula. The solution i arrive at is somewhat complicated, and after i've derived the dynamics of $X_t / Z_t$ i also have to find an explicit solution to the stochastic differential equation, that is $d(X_t / Z_T)$ where $X(0)=0$ (i assume in that case, $Z(0) = 1$ such that $X(0)/Z(0) = 0$ is well-defined). Based on my result, i don't think this is the way to go since deriving an explicit formular afterwards seems very complicated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) I've tried to derive a solution for $X_t$ by using the &quot;geometric brownian motion trick&quot; of dividing either side of the equation for $dX_t$ by $X_t$, integrating on both sides, recognizing that the solution &quot;looks like&quot; $ln X_t$ and then moved forward, but i don't end up with something remotely nice (probably since $X(t)$ is not a geometric brownian motion).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) $Z(t)$ is clearly a geometric brownian motion. I've been wondering if that is the key to solve the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone give any tips or tricks that might aid me in solving this problem? Thank you for your time.&lt;/p&gt;&#xA;" OwnerUserId="16088" LastActivityDate="2016-01-03T16:00:01.927" Title="Problem with deriving the dynamics of a process" Tags="&lt;stochastic-calculus&gt;&lt;itos-lemma&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22570" PostTypeId="2" ParentId="22569" CreationDate="2016-01-03T12:34:51.903" Score="2" Body="&lt;p&gt;Use the 2D version of Ito on $d (\frac{X}{Z})$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ito on 2 variables gives $d f(X,Z) = f_x dX + f_z dZ + 0.5*(f_{xx} dX^2 + f_{zz} dZ^2 + 2 f_{xz} dX dZ)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in your case $f(x,z) = \frac{X}{Z}$. You know what $dX$ is, thus just plug in. You have what Z is. To find $dZ$ apply Ito on Z and &quot;ito differentiate&quot;. Plug in dZ this gives you the dynamics you re looking for.&lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2016-01-03T12:34:51.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22571" PostTypeId="2" ParentId="22569" CreationDate="2016-01-03T13:38:32.870" Score="2" Body="&lt;p&gt;This is basically the integral factor technique for finding the solution of $X_t$; see also &lt;a href=&quot;https://quant.stackexchange.com/questions/21503/expected-value-of-log-garch-process/21507#21507&quot;&gt;this question&lt;/a&gt;. Note that $$d\left(\frac{1}{Z_t}\right) = \frac{1}{Z_t}\left[(\sigma^2-\beta) dt - \sigma dW_t\right].$$&#xA;Then,&#xA;\begin{align*}&#xA;d\left(\frac{X_t}{Z_t}\right) &amp;amp;= X_t d\left(\frac{1}{Z_t}\right) +\frac{1}{Z_t} dX_t + d\Big\langle X, \, \frac{1}{Z}\Big\rangle_t\\&#xA;&amp;amp;=\frac{X_t}{Z_t}\Big[(\sigma^2-\beta) dt - \sigma dW_t\Big]\\&#xA;&amp;amp;\quad +\frac{1}{Z_t}\Big[(\alpha + \beta X_t)dt + (\gamma + \sigma X_t) dW_t \Big]-\sigma^2\frac{X_t}{Z_t}dt\\&#xA;&amp;amp;=\frac{1}{Z_t}(\alpha\, dt + \gamma\, dW_t).&#xA;\end{align*}&#xA;Therefore,&#xA;\begin{align*}&#xA;\frac{X_t}{Z_t} = \alpha \int_0^t \frac{1}{Z_s} ds +\gamma\int_0^t \frac{1}{Z_s} dW_s.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;X_t &amp;amp;= Z_t\left[ \alpha \int_0^t \frac{1}{Z_s} ds +\gamma\int_0^t \frac{1}{Z_s} dW_s\right] \\&#xA;&amp;amp;= \alpha\int_0^t e^{-\big(\frac{1}{2}\sigma^2 -\beta\big)(t-s) +\sigma(W_t-W_s)}ds +\gamma \int_0^t e^{-\big(\frac{1}{2}\sigma^2 -\beta\big)(t-s) +\sigma(W_t-W_s)}dW_s.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-01-03T16:00:01.927" LastActivityDate="2016-01-03T16:00:01.927" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22573" PostTypeId="1" AcceptedAnswerId="22581" CreationDate="2016-01-03T21:51:20.393" Score="1" ViewCount="1468" Body="&lt;p&gt;I have the following EOD options data for the SPY containing IV data for each strike.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Date        Symbol  Exp         Strike  P/C  ImpVol&#xA;2015-07-01, SPY,    2015-07-10, 185.5,  C,   0.272986&#xA;2015-07-01, SPY,    2015-07-10, 186,    C,   0.267097&#xA;2015-07-01, SPY,    2015-07-10, 186.5,  C,   0.261214&#xA;2015-07-01, SPY,    2015-07-10, 187,    C,   0.255573&#xA;.&#xA;.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to calculate the IV for the SPY Option Chain using this data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe the Option Chain IV is related to the ATM strike IV, but I'm not 100% sure how ThinkOrSwim calculates it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a formula I can use to calculate the Option Chain IV?&lt;/p&gt;&#xA;" OwnerUserId="18842" LastActivityDate="2016-01-04T11:59:58.943" Title="Option Chain Implied Volatility Calculation" Tags="&lt;options&gt;&lt;implied-volatility&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22574" PostTypeId="2" ParentId="4237" CreationDate="2016-01-03T21:57:56.940" Score="1" Body="&lt;p&gt;I guess the best way to test herding using intraday data is to use Hawkes modelling. Hawkes processes capture the fact an event is a consequence of a previous one (endogenous) or totally new (exogenous). A good start is Chapter V of Thibault Jaisson's PhD thesis: &lt;a href=&quot;https://tel.archives-ouvertes.fr/tel-01212087/&quot; rel=&quot;nofollow&quot;&gt;Market activity and price impact throughout time scales&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is of course related to market impact. I would advice to read &lt;a href=&quot;http://www.worldscientific.com/doi/abs/10.1142/S2382626615500094&quot; rel=&quot;nofollow&quot;&gt;Market Impacts and the Life Cycle of Investors Orders&lt;/a&gt; by Bacry, Iuga, Lasnier and L (a preprint is available &lt;a href=&quot;http://arxiv.org/abs/1412.0217&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;).&#xA;When you study market impact you often have a database with split metaorders, hence you know part of the herding.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2016-01-03T21:57:56.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22577" PostTypeId="1" CreationDate="2016-01-04T05:36:32.693" Score="1" ViewCount="102" Body="&lt;p&gt;My data provider includes the greeks. I tried to compute the IV's myself using RQuantLib and see if they match -- for Puts it's generally close, for Calls however certain values are way way off -- any ideas?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sample data:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;X                 30824 30824&#xA;underlying        MSFT&#xA;underlying_last   29.91&#xA;exchange          * &#xA;optionroot        MSQ071020C00022500&#xA;optionext         NA &#xA;type              call &#xA;expiration        2007-10-20&#xA;quotedate         2007-10-11&#xA;strike            22.5 &#xA;last              7.80 &#xA;bid               7.35 &#xA;ask               7.50&#xA;volume            33         &#xA;openinterest      4983   &#xA;impliedvol        0.010000 &#xA;delta             1.000000 &#xA;gamma             0.000000 &#xA;theta             -0.246377 &#xA;vega              0.000000&#xA;optionalias       MSQJX &#xA;my.iv             1.0892231   &#xA;maturityfrac      0.024657533&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Impliedvol is from my data provider, my.iv is my calculation.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    &amp;gt; AmericanOptionImpliedVolatility(&quot;call&quot;, 7.8, 29.91, 22.5, 0.01, 0.01, 0.024, 0.01)&#xA;[1] 1.559311&#xA;attr(,&quot;class&quot;)&#xA;[1] &quot;AmericanOptionImpliedVolatility&quot; &quot;ImpliedVolatility&quot;  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Notice the RQuantLib value is 1.5, my data provider gets 0.01 -- what gives? &lt;/p&gt;&#xA;" OwnerUserId="2186" LastEditorUserId="13428" LastEditDate="2016-01-04T10:52:41.620" LastActivityDate="2016-01-04T12:47:27.990" Title="AmericanOptionImpliedVolatility strange answers for calls IV's" Tags="&lt;options&gt;&lt;quantlib&gt;&lt;rquantlib&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22580" PostTypeId="2" ParentId="22519" CreationDate="2016-01-04T11:31:05.087" Score="1" Body="&lt;p&gt;There a to ways that you can performe the ADF test to a data frame, first write a loop for applying the test to all the columns or use the apply function to your data. For leaving out the first column just create an other data frame like this: &lt;code&gt;da=yourDataName[,-1]&lt;/code&gt;. the code for the ADF would be something like &lt;code&gt;apply(da,2,adfTest,lags=0,type=&quot;c&quot;)&lt;/code&gt;. The 2 is saying that the function adfTest should be apply to the columns, the &lt;code&gt;adfTest&lt;/code&gt; is from the package &lt;code&gt;fUnitRoots&lt;/code&gt;, &lt;code&gt;lags=0&lt;/code&gt; so it does not perform the test lagging the series and &lt;code&gt;type=&quot;c&quot;&lt;/code&gt; so it includes a constant. I don't like the test from timeSeries package because it will lag the series automatically so you will get &quot;always&quot; a stationary series. &lt;/p&gt;&#xA;" OwnerUserId="18443" LastActivityDate="2016-01-04T11:31:05.087" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22581" PostTypeId="2" ParentId="22573" CreationDate="2016-01-04T11:59:58.943" Score="2" Body="&lt;p&gt;Using that data the best way to compute implied volatility is tho use the methodology to approximate the variance swap rate closely following the model-free&#xA;estimate proposed by Demeter et al. (1999) and Carr and Madan (1998) who show that&#xA;if one owns a portfolio of options across all strikes inversely weighted by the squared strike&#xA;then one gets a variance exposure that does not depend on the price. The variance&#xA;swap rate or implied volatility is approximated by:&#xA;\begin{equation}&#xA;\sigma_{i,t,\tau}^2=\int_{S_i(t)}^{\infty}\frac{2\Big(1-\log[\frac{K}{S_i(t)}]\Big)}{K^2}C_i(t,\tau,K)dK+\int_{0}^{S_i(t)}\frac{2\Big(1-\log[\frac{K}{S_i(t)}]\Big)}{K^2}P_i(t,\tau,K)dK&#xA;\end{equation}&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2016-01-04T11:59:58.943" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22582" PostTypeId="2" ParentId="22519" CreationDate="2016-01-04T12:34:09.590" Score="1" Body="&lt;p&gt;It is not clear from the post if you are querying for the mechanics/code for looping over the series or the appropriate critical values. I here make a comment on the latter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the main pitfalls when testing multiple hypotheses is the fact that a certain percentage would fail under the null (as this xkcd strip nicely illustrates &lt;a href=&quot;https://xkcd.com/882/&quot; rel=&quot;nofollow&quot;&gt;https://xkcd.com/882/&lt;/a&gt; ). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you run a DF test on 10,000 stocks you would expect 500 to show up as mean reverting at 5% confidence, even if they are all independent random walks. One needs to account for this feature by lowering the confidence level. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your tests are independent, then you could have a Bonferroni-type adjustment of the confidence level to incorporate myltiple testing (&lt;a href=&quot;https://en.m.wikipedia.org/wiki/Bonferroni_correction&quot; rel=&quot;nofollow&quot;&gt;https://en.m.wikipedia.org/wiki/Bonferroni_correction&lt;/a&gt;). But stocks are not independent, and therefore your t-statistics are not independent neither. To account for their correlation I would use bootstrapped critical values on the vector of t-stats. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-01-04T12:34:09.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22583" PostTypeId="2" ParentId="22577" CreationDate="2016-01-04T12:47:27.990" Score="3" Body="&lt;p&gt;The 0.01 from your provider is likely wrong, or it could be some kind of default value that gets displayed when the option expires.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to the data you posted, you're just 9 days from expiration, and your underlying price is just about 3/4 of the strike price; that is, you're pretty out of the money. You're going to need a &lt;em&gt;lot&lt;/em&gt; of volatility to get a price of 7.8, and in fact, online calculators (just google for &quot;implied volatility calculator&quot;) agree with QuantLib that you're in the neighbourhood of 150%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, your provider's value is suspiciously accurate. 0.010000 exactly? No non-zero decimals from root-solving? Hmm. Not to mention a delta of exactly 1 and a gamma and vega of 0. The delta, in particular, makes no sense; it can't be 1 for an option out of the money.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short: I'd check with your provider.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2016-01-04T12:47:27.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22584" PostTypeId="1" CreationDate="2016-01-04T17:40:45.910" Score="4" ViewCount="1445" Body="&lt;p&gt;I am running Monte Carlo simulations to estimate future share prices of some stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For stock A, I need 1 share price exactly one year from now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For stock B, I need daily prices for each trading day for the coming year.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both models are simulated, lets say, 1000 times.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As dt is smaller for B, this increases the accurateness on the share price on the date one year from now.&#xA;But how to prove this? &#xA;And, what is the relation between the number of simulations and the time step size?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit:&lt;/em&gt;&#xA;I am using 3 year lognormal daily returns to estimate volatility; drift is based on a zero-coupon bond with the term equal to the term of the option/share (in this case 1 year). Both remain constant during the simulation year. Random numbers are generated using Mersenne Twister algorithm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Stock price at time t is being calculated by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For A, dt = 1&#xA;$$&#xA;S_{t}= S_0 \cdot exp((r-\frac{1}{2}\sigma^2)dt+\sigma\sqrt{dt}Z)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For B, I am using Euler's discretization,  dt = 1/255&#xA;$$&#xA;S_{t+dt}= S_t \cdot exp((r-\frac{1}{2}\sigma^2)dt+\sigma\sqrt{dt}Z)&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="18851" LastEditorUserId="18851" LastEditDate="2016-01-06T17:02:14.153" LastActivityDate="2016-01-06T17:02:14.153" Title="Geometric Brownian Motion - increasing simulations or smaller step size" Tags="&lt;monte-carlo&gt;&lt;brownian-motion&gt;&lt;simulations&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22586" PostTypeId="2" ParentId="22471" CreationDate="2016-01-04T19:35:34.823" Score="4" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;There is somewhere summary of methods that can be used to estimate parameters of SDE?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you'd like a brief survey, consider the following packages as well as the accompanying papers (note: you may want to follow the citations listed therein):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://cran.r-project.org/web/packages/Sim.DiffProc/&quot; rel=&quot;nofollow&quot;&gt;https://cran.r-project.org/web/packages/Sim.DiffProc/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&quot;Estimation of Stochastic Differential Equations with&#xA;Sim.DiffProc Package&quot;: &lt;a href=&quot;https://cran.r-project.org/web/packages/Sim.DiffProc/vignettes/FitSDE.pdf&quot; rel=&quot;nofollow&quot;&gt;https://cran.r-project.org/web/packages/Sim.DiffProc/vignettes/FitSDE.pdf&lt;/a&gt; -- in particular, take note of the literature referenced in Section 1.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://cran.r-project.org/web/packages/yuima/&quot; rel=&quot;nofollow&quot;&gt;https://cran.r-project.org/web/packages/yuima/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&quot;The YUIMA Project: A Computational Framework for Simulation and Inference of Stochastic Differential Equations&quot;: &lt;a href=&quot;http://www.jstatsoft.org/article/view/v057i04&quot; rel=&quot;nofollow&quot;&gt;http://www.jstatsoft.org/article/view/v057i04&lt;/a&gt; -- in particular, take a look at Section 6, &quot;Inference for stochastic processes.&quot;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="893" LastActivityDate="2016-01-04T19:35:34.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22587" PostTypeId="1" CreationDate="2016-01-04T19:57:47.293" Score="3" ViewCount="984" Body="&lt;p&gt;I am doing the momentum analysis and am trying to see, what strategy (based on trading frequency) yields the highest Sharpe ratio for different investment amounts. The trading frequencies I use are yearly, bi-yearly, tri-yearly .. to monthly. I always hold the portfolio for 12 months, thus, I have overlapping portfolios.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;When I calculate Sharpe for each of this strategies, I get Sharpe Ratios based on different periodicities. Are such ratios safe to compare, or should I always calculate lets say &quot;Annual Sharpe Ratio&quot; and compare those?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is it possible to get monthly Sharpe Ratios from a vector of yearly returns? Lets say, I have 12-month returns for 15 years, each year. How can I calculate a monthly sharpe ratio from that?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thank you for your help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Miha&lt;/p&gt;&#xA;" OwnerUserId="18853" LastActivityDate="2016-01-04T22:06:18.747" Title="How to compare Sharpe Ratios of different investment strategies (holding periods)" Tags="&lt;sharpe-ratio&gt;&lt;analysis&gt;&lt;momentum&gt;&lt;sharpe&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22588" PostTypeId="2" ParentId="22584" CreationDate="2016-01-04T20:02:35.027" Score="1" Body="&lt;p&gt;a) there is no point to make any simulations between NOW and 1 YEAR. simulate 1 year stock price directly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) here you concern about PATH of stoch process, so simulate each day, but do not simulate &quot;between&quot; or &quot;inside&quot; days. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;effectively procedure b uses algo from procedure a with appropriate adjustments for drift and vol&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to measure &quot;accuracy&quot; calculate confidence intervals. your estimates have normal distribution, sample variance is proportional to SQRT (N), where N - number of simulations. so if you make 4 times more simulation you get twice more accurate estimate SQRT(4)=2. increase of N is very costly, better use Variance reduction techniques (see wiki). &lt;/p&gt;&#xA;" OwnerUserId="18855" LastActivityDate="2016-01-04T20:02:35.027" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22589" PostTypeId="2" ParentId="22584" CreationDate="2016-01-04T20:48:14.177" Score="2" Body="&lt;p&gt;Since you are using geometric brownian motion (GBM) as your model, there is a strong (and therefore weak) solution to the SDE.  That is to say, your simulation that presumably looks like&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;S^A_T \sim S^A_0 \exp\left( \left(r-q-\frac12 \sigma^2\right) T + z \sigma \sqrt{T} \right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for standard gaussian $z$ has precisely the correct distribution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because sums of gaussian variables are themselves gaussian, your chained simulation for stock B follows the formula&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;S^B_{t_i} \sim S^B_{t_{i-1}} \exp\left( \left(r-q-\frac12 \sigma^2\right) (t_{i}-t_{i-1}) + z \sigma \sqrt{t_{i}-t_{i-1}} \right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which telescopes into&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;S^B_{t_N} \sim S^B_0 \prod_{i=1}^N \exp\left( \left(r-q-\frac12 \sigma^2\right) (t_{i}-t_{i-1}) + z \sigma \sqrt{t_{i}-t_{i-1}} \right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;S^B_{t_N} \sim S^B_0  \exp\left( \sum_{i=1}^N \left(r-q-\frac12 \sigma^2\right) (t_{i}-t_{i-1}) + z \sigma \sqrt{t_{i}-t_{i-1}} \right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and also is precisely correct in distributional terms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore the simulation for stock A with a 1 year time interval is no less &quot;accurate&quot; than the simulation for stock B.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if you were using an Euler or Milstein discretization of the GBM of the stock B SDE, then you would have cause to worry about the relative accuracy.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2016-01-04T20:53:15.800" LastActivityDate="2016-01-04T20:53:15.800" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22591" PostTypeId="2" ParentId="22587" CreationDate="2016-01-04T22:06:18.747" Score="3" Body="&lt;p&gt;To answer your first question: You need to make all sharpe ratios annual, or quartely, or monthly to be comparable. All of them must have the same periodicity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer your second question: From the year returns, you can compute the monthly returns by making $(1+R_{t+2})/(1+R_{t+1})$ and then compute the monthly sharpe ratio, or alternatively, just compute the annual sharpe ratio and divide by $\sqrt{12}$. Should yield the same.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2016-01-04T22:06:18.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22592" PostTypeId="2" ParentId="21536" CreationDate="2016-01-04T22:38:33.810" Score="1" Body="&lt;p&gt;Kelly calculates optimal leverage for maximising &lt;strong&gt;geometric growth&lt;/strong&gt;. At the same time, any change in leverage does not lead to a change in a risk-adjusted return (i.e. Sharpe). Therefore Kelly cannot be used to improve risk-adjusted return. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Talking about the excess vola, in practive one rarely applies Kelly. The bet is usually Kelly/2, Kelly/4 or even less. &lt;/p&gt;&#xA;" OwnerUserId="18857" LastActivityDate="2016-01-04T22:38:33.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22593" PostTypeId="1" AcceptedAnswerId="32112" CreationDate="2016-01-04T23:16:30.603" Score="3" ViewCount="387" Body="&lt;p&gt;I am trying to understand the relationship between two methods of pricing callable bonds in the risk-neutral pricing framework.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Problem statement&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Let's consider zero-coupon bond with face value 1, expiring in 1 year and callable at 6 months  with strike $K =0.4$. I am going to work in the Ho-Lee model in which the spot rate follows the generalized Brownian motion&#xA;$$ dr(t) = \theta(t) dt + \sigma d\hat{w}(t). $$&#xA;For the purposes of obtaining a numerical result, I will assume $\sigma = 0.16$ and $r(0) = 0.3$ and choose the fitting function to be $\theta(t) = 0$ (unrealistic values in practice).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can show numerically that the price obtained from the finite-difference method (Method 2) converges to the analytical price (Method 1). &lt;strong&gt;I would like to obtain the analytical result directly from the PDE in Method 2&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Method 1&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The zero-coupon discount curve is given by&#xA;$ P(t,T) = e^{-r(t) (T-t) + \frac{\sigma^2}{6}(T-t)^3} $.&#xA;Applying Ito's lemma we obtain&#xA;$$ dP(t,T) = P(t,T) r(t) dt - P(t,T)(T-t)\sigma d\hat{w}(t). $$&#xA;It follows that a European call option with expiration $T_i$ on the ZCB with maturity $T_j&amp;gt;T_i$ can be priced using the Black pricing formula using a time-depedent volatility,&#xA;\begin{align}&#xA;	\mathbf{CZCB}(t,T_i,T_j,K)&#xA;		&amp;amp; = P(t,T_i)\mathbb{E}^{Q_i}_t\left[\max(G(T_i)-K,0)\right] \\&#xA;		&amp;amp; = P(t,T_i)\left[G(t)N(y+\bar{\sigma}\sqrt{T_i-t})-KN(y)\right]&#xA;\end{align}&#xA;where&#xA;\begin{equation}&#xA;G(t) = \frac{P(t,T_j)}{P(t,T_i)}, \quad \quad	y = \frac{\log\left(\frac{G(0)}{K}\right)-\frac{1}{2}\bar{\sigma}^2(T_i-t)}{\bar{\sigma}\sqrt{T_i-t}}, \quad \quad&#xA;	\bar{\sigma} =\sigma(T_j-T_i).&#xA;\end{equation}&#xA;Thinking of the callable bond as a straight bond minus the call option we obtain&#xA;\begin{equation}&#xA;	P(0,T_e)-\mathbf{CZCB}(0,T_c,T_e,K) = \$ \, 0.344467,&#xA;\end{equation}&#xA;where I have set $T_e = 1$, $T_c = 0.5$, and $K = 0.4$&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Method 2&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Thinking of the callable bond as a spot-rate contingent claim we see that the bond price satisfies the PDE,&#xA;\begin{equation}&#xA;	\frac{\partial g}{\partial t} + \frac{1}{2}\sigma^2 \frac{\partial^2 g}{\partial r^2} - rg(r,t) = 0.&#xA;\end{equation}&#xA;In a fully explicitly discretization with $t_n = n \Delta t$ ($0 \leq n \leq N$) we have&#xA;\begin{equation}&#xA;	g_n^j = h_n^j , \quad \quad h_n^j =  \frac{1}{1+r_j\Delta t} \bigl[p g_{n+1}^{j+1}+(1-2p) g_{n+1}^{j} + p g_{n+1}^{j-1}\bigr], \quad \quad p = \frac{\sigma^2\Delta t}{2\Delta r^2}.&#xA;\end{equation}&#xA;with the following boundary conditions in the $t$-direction (assuming $N$ is even)&#xA;\begin{align}&#xA;g^j_N &amp;amp; = 1 \\&#xA;g^j_{N/2+1} &amp;amp; = \max(K,h^j_{N/2+1})&#xA;\end{align}&#xA;where the second condition accounts for the possibility of exercise at the 6 month mark.&lt;/p&gt;&#xA;" OwnerUserId="15782" LastEditorUserId="15782" LastEditDate="2016-01-13T19:19:05.830" LastActivityDate="2017-07-25T19:49:19.807" Title="Duality of callable bond price" Tags="&lt;fixed-income&gt;&lt;bond&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22595" PostTypeId="1" AcceptedAnswerId="22606" CreationDate="2016-01-05T06:18:41.087" Score="2" ViewCount="848" Body="&lt;p&gt;If we want to calculate VAR of a portfolio using variance covariance matrix (delta normal method), containing equities, forwards and options, how do we treat each asset class for making the variance covariance matrix:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Equities - Take closing prices (I know)&lt;/li&gt;&#xA;&lt;li&gt;Forwards - Do we take spot prices orporated with interest rates or the forward rates calculated with Interest rate parity ? &lt;/li&gt;&#xA;&lt;li&gt;Options - No idea at all (please help me out)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="18663" LastEditorUserId="7008" LastEditDate="2016-01-05T12:13:10.860" LastActivityDate="2016-01-05T23:12:54.090" Title="VAR of portfolio containing options, equities and forwards" Tags="&lt;options&gt;&lt;equities&gt;&lt;portfolio&gt;&lt;var&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22596" PostTypeId="1" CreationDate="2016-01-05T12:08:20.180" Score="22" ViewCount="9058" Body="&lt;p&gt;I am starting to do Algorithmic trading in cryptocurrencies using Python libraries. Most exchanges have RESTful API that make it easy to write you own code and get started. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I would like to benefit from the analytical features of established libraries such as zipline and others. However these do not support the trading of cryptocurrencies (yet).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should I just try to write a backend for my favorite cryptocurrency exchange, or are there other options out there?&lt;/p&gt;&#xA;" OwnerUserId="18864" LastActivityDate="2020-06-05T03:19:07.697" Title="Which Algorithmic trading library would you recommend for trading Bitcoin?" Tags="&lt;python&gt;&lt;bitcoin&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="23" ContentLicense="CC BY-SA 3.0" />
  <row Id="22597" PostTypeId="1" AcceptedAnswerId="22618" CreationDate="2016-01-05T12:27:19.710" Score="3" ViewCount="976" Body="&lt;p&gt;I'm currently valuing swaptions using an implied volatility surface and Black's formula. This formula is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$A (S\Phi(d_+) - K \Phi(d_-))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &#xA;$$ d_{\pm} = \frac{\log\left(S/K\right) \pm \frac{1}{2}\sigma_{\text{impl}}^2 T_{\text{exc}}}{\sigma_{\text{impl}} \sqrt{T_{\text{exc}}}}\\&#xA;A = N\sum_{i}\alpha_i P(0, T_i)\\&#xA;S = \frac{P(0, T_{\text{exc}}) - P(0, T_{\text{final}})}{\sum_{i}\alpha_i P(0, T_i)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The different symbols represent: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$A$ = annuity&lt;/li&gt;&#xA;&lt;li&gt;$N$ = notional&lt;/li&gt;&#xA;&lt;li&gt;$T_{\text{start}}$ = exercise date of the swaption&lt;/li&gt;&#xA;&lt;li&gt;$T_{\text{final}}$ = date of final payment of the underlying swap&lt;/li&gt;&#xA;&lt;li&gt;$S$ = swap rate of the underlying swap&lt;/li&gt;&#xA;&lt;li&gt;$K$ = strike / accrual rate of fixed leg of underlying swap&lt;/li&gt;&#xA;&lt;li&gt;$\alpha_i$ = accrual length of each leg&lt;/li&gt;&#xA;&lt;li&gt;$P(0, T)$ = discount factor.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Finally, the volatility $\sigma_{\text{impl}}$ is provided by market data of swaption prices. For this I use some interpolation technique. This interpolation technique uses the exercise date of the swaption and the tenor of the underlying swap (tenor = time between first and final payment). For simplicity I only consider the ATM volatility (which is still different for swaptions with different maturities / tenors).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to use this formula (or something similar) to price options on swaps with an amortizing profile. For an amortizing swap the notional decreases over time (i.e. for each leg we have a different notional). You can define a swap rate by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ S^{\text{amort}} = \frac{\sum_i N_i \alpha_i P(0, T_i)F(0, T_{i-1}, T_i)}{\sum_i \alpha_i N_i P(0, T_i)}$$ and similarly for the annuity. Here $F$ are the forward rates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But now the problem is that there is no volatility surface for swaptions on amortizing swaps. So what implied volatility should I use? Ideally I would like to extract the volatility from the implied volatility surface that I already have (based on non-amortizing swaptions). &lt;/p&gt;&#xA;" OwnerUserId="3371" LastActivityDate="2016-01-06T19:55:39.877" Title="Valuation of option on amortized IR swap" Tags="&lt;implied-volatility&gt;&lt;interest-rate-swap&gt;&lt;swaption&gt;&lt;black76&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22598" PostTypeId="2" ParentId="21937" CreationDate="2016-01-05T14:29:24.430" Score="1" Body="&lt;p&gt;It's kind of complicated. I'm afraid QuantLib doesn't have a &quot;right&quot; way to do this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The short answer is that the way you sketched (inheriting from &lt;code&gt;VanillaOptionFuture::engine&lt;/code&gt;) should work. You might not even need a &lt;code&gt;dynamic_cast&lt;/code&gt;; if you're passing the engine to a &lt;code&gt;VanillaOptionFuture&lt;/code&gt;, it will set the &lt;code&gt;futureExpiry&lt;/code&gt; data member, whereas if you're passing the engine to a &lt;code&gt;VanillaOption&lt;/code&gt; it will ignore it. Inside &lt;code&gt;calculate&lt;/code&gt;, you can just check whether &lt;code&gt;futureExpiry&lt;/code&gt; is a null &lt;code&gt;Date()&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The longer answer is that the class diagram you're building is a bit shaky. You're starting from &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;class VanillaOptionFuture : public VanillaOption&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which lets you avoid duplication of all the code around data members but, in C++ idioms, is saying &quot;a vanilla option on a future is a particular kind of vanilla option&quot;.  This lets you avoid a lot of code duplication, so let's go with it, but it can take a reader aback a bit if she's thinking that a vanilla option is an &lt;em&gt;asset&lt;/em&gt; option. Anyway, as I said, let's go with it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The relationship between the corresponding engines, and it is going to be tricky.  You didn't say how you plan to implement it, but you need a new argument class, so you also need to define a new &lt;code&gt;VanillaOptionFuture::engine&lt;/code&gt; class; you can't just reuse &lt;code&gt;VanillaOption::engine&lt;/code&gt;, whose argument class is fixed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Possibility 1: if you inherit &lt;code&gt;VanillaOptionFuture::engine&lt;/code&gt; from &lt;code&gt;VanillaOption::engine&lt;/code&gt;, you're saying that an engine for a future option is an engine for an option, which in your case looks right&amp;mdash;your engine can price both&amp;mdash;but it's not guaranteed in general, since a given engine for futures option might rely on futures data which are not available from plain options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Possibility 2 is to define &lt;code&gt;VanillaOptionFuture::engine&lt;/code&gt; as independent of &lt;code&gt;VanillaOption::engine&lt;/code&gt; and sidestep the semantic problem. You can also sidestep the semantic problem by going for possibility 1 and simply not thinking about it. :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In both cases, the compiler won't complain; &lt;code&gt;VanillaOption&lt;/code&gt; checks the type of the engine only indirectly, through the type of its arguments class, and that one will be correct since you inherit &lt;code&gt;VanillaOptionFuture::arguments&lt;/code&gt; from &lt;code&gt;VanillaOption::arguments&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both possibilities will work, but the relationships between classes are not very well defined, which might make the code confusing to readers. As I said, though, QuantLib doesn't have a right way to do this, so the way you're proposing looks good to me.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2016-01-05T14:29:24.430" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22599" PostTypeId="1" CreationDate="2016-01-05T14:41:16.423" Score="11" ViewCount="1436" Body="&lt;p&gt;I am confused whether the factors in a multi-factor model should be orthogonal or not. &lt;a href=&quot;https://www.google.com/webhp?sourceid=chrome-instant&amp;amp;ion=1&amp;amp;espv=2&amp;amp;es_th=1&amp;amp;ie=UTF-8#q=three%20factor%20model%20orthogonality%20asset%20pricing&quot;&gt;Google searches&lt;/a&gt; do not give a well documented answer and I couldn't find one in our library's limited catalog either.&#xA;Intuition says they should. &#xA;Moreover, the covariance of &lt;code&gt;Mkt-RF&lt;/code&gt; with &lt;code&gt;SMB&lt;/code&gt; and &lt;code&gt;HML&lt;/code&gt; (on  yearly data as obtained fron &lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/ftp/F-F_Research_Data_Factors_CSV.zip&quot;&gt;K. French's data library&lt;/a&gt;) is about 116 and 34 respectively, far from 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="8215" LastEditorUserId="8215" LastEditDate="2016-01-05T16:03:15.000" LastActivityDate="2016-01-05T20:05:34.417" Title="Why aren't the Fama-French 3 factors orthogonal to each other?" Tags="&lt;asset-pricing&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22600" PostTypeId="1" CreationDate="2016-01-05T16:06:44.443" Score="1" ViewCount="335" Body="&lt;p&gt;I am trying to solve an asset allocation problem and I am having some troubles grasping the concept. I am working with excess returns on 4 stock indices and I am obtaining the excess returns forecasts for period $t+1$ as the conditional mean forecasts from ARMA(1,0)-GARCH(1,1). For each excess returns series I am using a different distribution, one that suits best. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally I would like to use an asset allocation strategy that is taking the expected mean and the second, third and fourth co-moment matrices into consideration. And here is my problem, since I am building the strategy at time $t$ how can I obtain the co-moment matrices of innovations necessary for my asset allocation strategy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the covariance matrix my idea was to bind my univariate GARCH models in to a CCC-GARCH model and obtain the covariance matrix for time $t+1$ as $H_{t+1}=D_{t+1}RD_{t+1}$ where $H$ is the covariance matrix, $R$ is the unconditional correlation matrix of standardized residuals up to time $t+1$ and $D$ is a matrix with conditional standard deviation forecasts at the diagonal. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, all the times I am encountering the same problem: how to obtain the standardized residuals for period $t+1$, which are necessary for calculating the 2nd, 3rd and 4th co-moment matrices? I need to choose the weights for each index at time $t$ and therefore cannot obtain the residuals as observed returns minus the forecast, as I do not yet know the observed return. Could you give me some advice on how to develop such a strategy? Some papers are obtaining the co-moment matrices directly from the parameters of various multivariate distributions, however, I would like to use different ones for each series. Any help on this matter would be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="17464" LastActivityDate="2016-01-05T16:06:44.443" Title="Asset allocation and GARCH models" Tags="&lt;portfolio-management&gt;&lt;garch&gt;&lt;forecasting&gt;&lt;asset-allocation&gt;&lt;tactical-asset-allocation&gt;" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="22601" PostTypeId="1" CreationDate="2016-01-05T16:07:19.720" Score="1" ViewCount="516" Body="&lt;p&gt;I'm doing a past paper for one of my masters modules and I'm stuck on this &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.imgur.com/sdoOTau.png&quot; alt=&quot;This&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and I have no idea how to tackle such a thing. It's worth 30% of the exam so would be great if anyone here has any suggestions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="18866" LastActivityDate="2016-01-06T14:55:28.913" Title="Black Scholes Geometric Brownian Motion Option Pricing" Tags="&lt;option-pricing&gt;&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22603" PostTypeId="2" ParentId="22599" CreationDate="2016-01-05T16:29:42.527" Score="1" Body="&lt;p&gt;Using covariance to imply an inappropriate level of multicollinearity  in a model can be very misleading, especially when the factors are measured in differing units or lack linear relationships. There will almost always be some level of collinearity in a multi-factor model (otherwise you run the risk of overfitting), especially one with a relatively small amount of explanatory variables like the FF equation. Remember, the FF model was really just an improvement on the CAPM to give a &lt;em&gt;better&lt;/em&gt; ex-post fit to stock returns.&lt;/p&gt;&#xA;" OwnerUserId="17742" LastActivityDate="2016-01-05T16:29:42.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22604" PostTypeId="2" ParentId="22599" CreationDate="2016-01-05T20:05:34.417" Score="8" Body="&lt;p&gt;A factor model has the form&#xA;$$r_{j,t}=\sum_n \beta_{j,n} f_{n,t}+\epsilon_{j,t}$$&#xA;Where $r_{j,t}$ is the return of stock $j$ at time $t$, $\beta_{j,n}$ is the sensitivity (factor loading) of stock $j$ to factor $n$, $f_{n,t}$ is the return of factor $n$ at time $t$, and $\epsilon_{j,t}$ is the idiosyncratic non-factor return. One factor can be the constant. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are three ways to specify and/or estimate:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The classical Capm/ Fama-French where you explicitly specify the factor series $f_{n,t}$ and use time series regressions, one per stock, to estimate the betas $\beta_{j,n}$. There is no reason for the factor time series to be orthogonal, although it is useful as a risk decomposition if they are close to orthogonal (as factor variances become additive).  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The Barra approach where you explicitly specify the loadings $\beta_{j,n}$ and use cross-sectional regressions, one per date, to estimate the corresponding factor moves $f_{n,t}$. There is no reason, again, for these estimated moves to be orthogonal, but being close to orthogonal is, again, desirable. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The black box PCA approach, where both factor loadings and time series are estimated simultaneously. Then we have time series that are orthogonal by construction (because we have too many degrees of freedom we put orthogonality as a constraint). However, they do not map directly to an intutive set of macro factors, although they often resemble them. Also different time windows would give rise to different factors, which might not be desirable. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-01-05T20:05:34.417" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22605" PostTypeId="2" ParentId="22601" CreationDate="2016-01-05T21:19:26.923" Score="2" Body="&lt;p&gt;For Question (1), the payoff is given by&#xA;\begin{align*}&#xA;(S_T-S_{T_0})^+.&#xA;\end{align*}&#xA;Note that&#xA;\begin{align*}&#xA;E\left(e^{-r(T-T_0)} (S_T-S_{T_0})^+ \mid \mathscr{F}_{T_0}\right) &amp;amp;=S_{T_0}N(d_1)-e^{-r(T-T_0)}S_{T_0}N(d_2),&#xA;\end{align*}&#xA;where&#xA;\begin{align*}&#xA;d_1 &amp;amp;= \frac{(r+\frac{1}{2}\sigma^2)(T-T_0)}{\sigma \sqrt{T-T_0}}\\&#xA;&amp;amp;=(r+\frac{1}{2}\sigma^2)\sqrt{T-T_0}/\sigma,&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;d_2 = d_1 - \sigma \sqrt{T-T_0}.&#xA;\end{align*}&#xA;The option price is then given by&#xA;\begin{align*}&#xA;C_0 &amp;amp;\equiv e^{-rT}E\left( (S_T-S_{T_0})^+ \right)\\&#xA;&amp;amp;=e^{-rT_0}E\left(E\left(e^{-r(T-T_0)} (S_T-S_{T_0})^+ \mid \mathscr{F}_{T_0}\right)\right)\\&#xA;&amp;amp;=e^{-rT_0}E\left(S_{T_0}N(d_1)-e^{-r(T-T_0)}S_{T_0}N(d_2) \right)\\&#xA;&amp;amp;=S_0 \big[N(d_1) - e^{-r(T-T_0)} N(d_2)\big].\tag{*}&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Question (2), note that&#xA;\begin{align*}&#xA;\max(S_T,\, S_{T_0}) = S_{T_0} + (S_T-S_{T_0})^+.&#xA;\end{align*}&#xA;Then, from (*), the contingent price is given by&#xA;\begin{align*}&#xA;P_0 &amp;amp;\equiv e^{-rT}E\left( S_{T_0} + (S_T-S_{T_0})^+ \right)\\&#xA;&amp;amp;=e^{-r(T-T_0)}S_0 + S_0 \big[N(d_1) - e^{-r(T-T_0)} N(d_2)\big]\\&#xA;&amp;amp;=S_0 \big[N(d_1) + e^{-r(T-T_0)} (1-N(d_2))\big]\\&#xA;&amp;amp;=S_0 \big[N(d_1) + e^{-r(T-T_0)} N(-d_2)\big].&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-01-06T14:55:28.913" LastActivityDate="2016-01-06T14:55:28.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22606" PostTypeId="2" ParentId="22595" CreationDate="2016-01-05T23:12:54.090" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://www.msci.com/documents/10199/5915b101-4206-4ba0-aee2-3449d5c7e95a&quot; rel=&quot;nofollow&quot;&gt;RiskMetrics Technical Document. Chapter 6&lt;/a&gt; - may help to grasp an idea of mapping instruments to relevant risk factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;equity position can be mapped to EQ Risk (factor = issuerticker) and if equity_ccy is different from portfolio_ccy also FX Risk (factor = fxspotrate);&lt;/li&gt;&#xA;&lt;li&gt;fx forward can be mapped to FX Risk (factor = fxspotrate) and IR Risk (factors = rate_ccy1, rate_ccy2);&lt;/li&gt;&#xA;&lt;li&gt;for options you may approximate with delta-gamma position and map to EQ Risk (factor = issuerticker), IR Risk, Vega risk and if applicable FX Risk. Also be careful with details here (payoff type, quanto payoff, etc..) &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Be aware that &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;method is less accurate for options and other non-linear derivatives.&#xA;  It also becomes less accurate at longer horizons. Therefore not&#xA;  recommended for long horizons, for portfolios with many options, or&#xA;  for assets with skewed distributions.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="18275" LastActivityDate="2016-01-05T23:12:54.090" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22607" PostTypeId="2" ParentId="15823" CreationDate="2016-01-05T23:45:26.440" Score="0" Body="&lt;p&gt;Hope this illustration helps to understand fx effect:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/aZM9I.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/aZM9I.png&quot; alt=&quot;Picture&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Examples: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;if px_0 = 100; px_1 = 100; fx_0=1.3; fx_1=1.4 then your total p&amp;amp;l would be only due to Fx: TotalP&amp;amp;L = Px_0 * (Fx_1 - Fx_0) = 100 * (1.4-1.3) = 10&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;if px_0 = 100; px_1 = 110; fx_0=1.3; fx_1=1.3 then your total p&amp;amp;l would be only due to Px: TotalP&amp;amp;L = (Px_1-Px_0) * Fx_0 = (110 - 100) * 1.3 = 13&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;if px_0 = 100; px_1 = 110; fx_0=1.3; fx_1=1.4 then your total p&amp;amp;l would be both due to Px, Fx and cross-effect: TotalP&amp;amp;L = (Px_1-Px_0) * Fx_0 + P_0 * (Fx_1-Fx_0) + (Px_1-Px_0)*(Fx_1-Fx_0)= (110 - 100) * 1.3 + 100 * (1.4-1.3) + (110-100)*(1.4-1.3)= 13 + 10 + 1 = 26&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="18275" LastActivityDate="2016-01-05T23:45:26.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22608" PostTypeId="1" CreationDate="2016-01-06T01:59:49.403" Score="2" ViewCount="1116" Body="&lt;p&gt;I have a table of asset (mutual fund) returns and the percentage that each asset is in a particular stock sector:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Asset   Return  Tech %  Tech Returns  Energy %  Energy Returns  Other %  Other Returns&#xA;A       1.1     100     1.1           0         0               0        0&#xA;B       1.05    50      0.525         50        0.525           0        0&#xA;C       1.025   0       0             100       1.025           0        0&#xA;D       0.935   33      0.30855       33        0.30855         34       0.3179&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know how to calculate the overall portfolio return:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Overall Return = ((1+0.011)*(1+0.0105)*(1+0.01025)*(1+0.00935)-1.0)*100&#xA;               = 4.1737 %&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, I'd like to calculate the returns coming from each sector but I can't seem to figure out how to get the sector returns to accumulate up to the overall return above. I can see that for a given asset, the returns aggregate across the sectors by summing them up. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I thought I could aggregate each sector vertically and then sum them up accordingly:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Tech Return = ((1+0.011)*(1+0.00525)*(1+0.0)*(1+0.003085)-1.0)*100&#xA;            = 1.9443 %&#xA;Energy Return = ((1+0.0)*(1+0.00525)*(1+0.01025)*(1+0.003085)-1.0)*100&#xA;              = 1.8687 %&#xA;Other Return = ((1+0.0)*(1+0.0)*(1+0.0)*(1+0.003179)-1.0)*100&#xA;             = 0.3179 %&#xA;&#xA;Expect Overall Return = Tech Return + Energy Return + Other Return&#xA;                      = 4.1309 %&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would appreciate any help on identifying where I may be going wrong&lt;/p&gt;&#xA;" OwnerUserId="18124" LastActivityDate="2016-06-07T09:22:02.040" Title="Calculating Portfolio Returns Across Sectors" Tags="&lt;returns&gt;&lt;portfolio&gt;" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22609" PostTypeId="2" ParentId="17253" CreationDate="2016-01-06T06:30:29.200" Score="1" Body="&lt;p&gt;I assume you're doing interest rate parity or currency carry research. The proper interest rates to use in this context are the local deposit rates, preferably OIS (overnight indexed swap) rates. These are readily available for all major currencies nowadays.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2016-01-06T06:30:29.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22610" PostTypeId="1" AcceptedAnswerId="22623" CreationDate="2016-01-06T10:47:56.117" Score="2" ViewCount="702" Body="&lt;p&gt;Can you please tell me some good books to learn in detail about all financial instruments available in the market today ?&lt;/p&gt;&#xA;" OwnerUserId="18871" LastActivityDate="2016-01-07T09:45:34.593" Title="Books on financial instruments?" Tags="&lt;financial-engineering&gt;&lt;finance-mathematics&gt;&lt;financial-markets&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22613" PostTypeId="1" CreationDate="2016-01-06T18:00:03.343" Score="2" ViewCount="133" Body="&lt;p&gt;I have price volume data of five stocks, sampled at 1 minute interval for six months. The data is quite noisy, lots of missing data and also some weired spikes. Can someone suggest me how to clean this dataset? The main objective is to estimate the volatility for the next month following the end of samples, what is the best method for this? Also how do I verify whether the volatility is dependent on market liquidity, based on this data. Can someone point me to easy tutorials/books that allows this kinds of data analysis. I have a good background on statistical data analysis but I am a complete noob to financial data. Any help will be much appreciated&lt;/p&gt;&#xA;" OwnerUserId="15629" LastActivityDate="2016-01-06T18:30:21.943" Title="Estimating volatility from high frequency price volume data of multiple stocks" Tags="&lt;volatility&gt;&lt;equities&gt;&lt;time&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22614" PostTypeId="1" AcceptedAnswerId="22617" CreationDate="2016-01-06T18:17:08.513" Score="10" ViewCount="2134" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/gcZkN.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/gcZkN.png&quot; alt=&quot;Intraday scatterplot of DAX-future against the DAX volatility index VDAX&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fig.1 shows an intraday scatterplot of the DAX future against its volatility index VDAX on 6-Jan-2016. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The data suggest a strong negative correlation between the two. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are various models available that &quot;describe&quot; this effect: For example stochastic vol-models such as the Heston model. However these models only describe but do not explain the effect. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since prices are the result of trading and market-making, a plausible explanation could be that market participants are buying put-option when the market goes down in order to protect their (long) position thereby driving the vol up; and re-selling them when the market goes up (driving the vol down). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However it is easy to convince oneself that the correlation persists at time-scales that correspond to vol moves that make it difficult to trade out of the bid-offer spread of the option (at the ODAX-exchange). If it was only to reduce the downside risk (in a down move) it would be much cheaper to reduce ones long-position temporarily instead. Clearly options exhibit &quot;gamma&quot;, but (as mentioned above) the cost of gamma seems too high given the bid-offer spread of the options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I do not really understand which market factors cause this intraday phenomenon of negative correlation between vol and spot moves.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone suggest an answer?&lt;/p&gt;&#xA;" OwnerUserId="18879" LastEditorUserId="743" LastEditDate="2016-01-06T21:06:38.880" LastActivityDate="2016-01-10T18:31:54.973" Title="Why is there a stong intraday-correlation between spot and vol?" Tags="&lt;volatility&gt;&lt;quant-trading-strategies&gt;&lt;trading&gt;&lt;stochastic-volatility&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22615" PostTypeId="2" ParentId="22613" CreationDate="2016-01-06T18:30:21.943" Score="1" Body="&lt;p&gt;If you are familiar with programming (which is required to deal with HF data), I would strongly recommend you to use the &lt;a href=&quot;https://cran.r-project.org/web/packages/highfrequency/highfrequency.pdf&quot; rel=&quot;nofollow&quot;&gt;&quot;HighFrequency&quot;&lt;/a&gt; R package.&#xA;It includes a lot of procedures to clean HF data and to estimate volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find &lt;a href=&quot;http://highfrequency.herokuapp.com/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; a very good tutorial about the package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If needed you can find &lt;a href=&quot;https://www.datacamp.com/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; some good tutorials for R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Credits: The package has been developed by Kris Boudt , Jonathan Cornelissen , Scott Payseur,Giang Nguyen and Maarten Schermer .&lt;/p&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2016-01-06T18:30:21.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22616" PostTypeId="2" ParentId="21443" CreationDate="2016-01-06T19:23:32.823" Score="2" Body="&lt;p&gt;If the market prices the option at USD5 and your model says the price is USD4.9. Assuming all parameters between model and market, then the difference comes from the vol you have and the implied.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you sell the option at USD5 and you delta hedge &quot;continuously&quot;, then you will scalp the difference between realized and implied vol. You will realize a pnl that depends on the difference between daily realized and the IV and the gamma of your option. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are many threads on this forum that discuss gamma scalping.&lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2016-01-06T19:23:32.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22617" PostTypeId="2" ParentId="22614" CreationDate="2016-01-06T19:28:03.300" Score="6" Body="&lt;p&gt;This effect is coming from the supply and demand in the options markets.  Many portfolio managers want (or need) to buy out of the money put options, and many are willing to sell out of the money call options (thereby funding the purchase of put options).  Now, when the market goes down, dealers find themselves short vol and they need to buy options to cover (hence vol goes up).  Likewise, when the market goes up, dealers find themselves long vol and they need to sell (thus vol goes down).  That's the effect you observe.  The timeframe for this effect is almost continuous - many dealers recalculate their positions multiple times intraday.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yes, there is a skew whereby out of the money puts are more expensive than ATMs and out of the money calls are cheaper.   You can think of this as compensation for the expected hedging loss if you are using a simple Black Scholes model.  However, many dealers would use a model that anticipates the vol change for the given market move.  This model would price the puts and calls closer to the market skew.  It would also reduce the losses from flattening the vol position after a market move.  As for the question about bid-offers, it is an issue, but in practice a dealer won't just lift and hit in the market.  They will rather work to buy and sell close to mid market, which they can probably do using their network of clients.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastEditorUserId="18388" LastEditDate="2016-01-07T11:30:00.410" LastActivityDate="2016-01-07T11:30:00.410" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22618" PostTypeId="2" ParentId="22597" CreationDate="2016-01-06T19:55:39.877" Score="3" Body="&lt;p&gt;I have traded swaptions for many years.   The answer is that it is not possible to calculate exactly the implied volatility for a European option on an amortizing swap from the matrix of non-amortizing swaption volatilities.  This is because there is a dependence on the correlation structure in addition to the volatility structure.  Depending on the nature of the amortization, the correlation effect can be large or small.  For example, a 1yr option on a swap whose notional amortizes 50% after year 3 and 50% after year 4, will be very closely approximated by taking the average of the 1yr-3yr and 1yr-4yr European swaption volatilities.  However a 5 year option on a swap which amortizes by 5% every year from year 6 to year 26, will need to take into account the correlation surface.  This correlation effect should reduce the implied volatility of the amortizing swap rate, relative to the naive calculation, since it is similar to an option on a basket.  Quantifying this would require some study of the intracurve correlation structure.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-01-06T19:55:39.877" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22619" PostTypeId="1" CreationDate="2016-01-06T20:06:26.983" Score="2" ViewCount="137" Body="&lt;p&gt;The model given in the following paper by Avellaneda et al&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://people.stern.nyu.edu/jreed/Papers/limitorder.pdf&quot; rel=&quot;nofollow&quot;&gt;http://people.stern.nyu.edu/jreed/Papers/limitorder.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On page 7 he explains that the initial Bid and Ask size should be normalised by their median size. This leads to equation 3.8 on p10.    &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same equation was also derived by Cont and de LARRARD eqn 36 p30&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://arxiv.org/pdf/1202.6412v1.pdf&quot; rel=&quot;nofollow&quot;&gt;http://arxiv.org/pdf/1202.6412v1.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However when he normalises the initial Bid and Ask sizes he uses the sqrt of n see eqn 12 on p20?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How are these normalisations equivalent? They seem quite different yet lead to the same solution?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More confusingly when Avellaneda et al calculate the analytical probs on p14 only the decile values are used (e.g 0.1) which is different again from the two normalisations mentioned above? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q1. Are the three normalisations equivalent?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly what is the correct interpretation of the eqn shown in Proposition 2 on p27 of Cont and de LARRARD? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q2.) Are the Bessel functions of the first or second kind? (First I think).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q3.) Is the infinite sum shown an example of an infinite Bessel series?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the answer to Q3 is yes can these be evaluated numerically for example in Matlab? &lt;/p&gt;&#xA;" OwnerUserId="7077" LastEditorUserId="743" LastEditDate="2016-01-06T20:27:10.890" LastActivityDate="2016-01-06T20:27:10.890" Title="Avellaneda/Cont model Order Book Model" Tags="&lt;stochastic-processes&gt;&lt;limit-order-book&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22620" PostTypeId="1" AcceptedAnswerId="22628" CreationDate="2016-01-06T20:27:46.890" Score="1" ViewCount="1752" Body="&lt;p&gt;An insurance company faces the liability loss off&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$L = \begin{cases} 0, &amp;amp; \mbox{with probability } 0.75 \\ Z, &amp;amp; \mbox{with probability } 0.25\end{cases}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Z\sim Exp(\mu)$. I want to calculate $\mbox{VaR}_{\alpha}$ for any $\alpha\in(0,1)$ when $R_0=1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that $\mbox{VaR}_{\alpha}(X)=F_L^{-1}(1-\alpha)$ (with $L=-X/R_0)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I really don't know how I should intepret the liability since $Z$ is a random variable. Anyone who could help me out?&lt;/p&gt;&#xA;" OwnerUserId="18211" LastActivityDate="2016-01-07T09:28:31.767" Title="Calculate VaR for a liabilty taking a exponential distribution?" Tags="&lt;risk&gt;&lt;distribution&gt;&lt;value-at-risk&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22621" PostTypeId="1" AcceptedAnswerId="22668" CreationDate="2016-01-06T21:19:45.377" Score="1" ViewCount="4981" Body="&lt;p&gt;I am trying to price a Down-and-Out Call using Monte Carlo simulation. The problem is that I get the right price for the vanilla option (same price as the analytic formula of Black and Scholes) but I do not get the right price for the down-and-out Call.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;S0 = 105   % Price of underlying&#xA;sig = 0.28;      % vol&#xA;mu = 0.0025;   % drift&#xA;B = 101       % Barrier&#xA;K = 100       % Strike&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In particular, the right price is 4.14 while I get around 5 with Monte carlo simulation. Can you help me ?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;nbrsim = 10000;&#xA;S = zeros(nbrsim,nbre_step+1);&#xA;&#xA;for j = 1:nbrsim&#xA;S(j,1)=S0;&#xA;for i = 1:nbrstep&#xA;    t(i+1)=t(i)+dt;   &#xA;    Z = normrnd(0,1);&#xA;    S(j,i+1)=S(j,i) + mu*S(j,i)*dt + S(j,i) * sig * sqrt(dt) * Z;&#xA;end&#xA;ST(j)=S(j,nbrstep+1);&#xA;end&#xA;&#xA;K=100&#xA;B = 101&#xA;&#xA;for j = 1:nbrsim&#xA;if min(S(j,:)) &amp;lt;= B&#xA;   l(j) = 0;&#xA;else&#xA;    l(j) = 1;&#xA;end&#xA;vectpayoffs(j) = l(j)*max(ST(j) - K,0);&#xA;end&#xA;&#xA;r= 0.0025&#xA;DF = exp(- r * T);&#xA;Downout = DF * 1/nbrsim * sum(vectpayoffs)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I don't understand why I don't get the right price. Is there a mistake here?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you !&lt;/p&gt;&#xA;" OwnerUserId="18880" LastEditorUserId="18880" LastEditDate="2016-01-08T10:50:32.500" LastActivityDate="2016-01-08T19:10:43.837" Title="Barrier option : Monte carlo simulation" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;barrier&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22622" PostTypeId="2" ParentId="22614" CreationDate="2016-01-06T21:24:53.897" Score="0" Body="&lt;p&gt;A large part of this comes from the simple combination of:&#xA;1. A downward sloping volatility skew (which corresponds to a skewed risk neutral distribution)&#xA;2. Sticky strike behaviour&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The vol that you plot is not for a fixed strike but ATM, which has a strike that follows the spot. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You would observe this pattern even if there was no spot/vol correlation, just by the way you read off bol numbers from a skew. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="17281" LastEditDate="2016-01-08T08:17:44.057" LastActivityDate="2016-01-08T08:17:44.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22623" PostTypeId="2" ParentId="22610" CreationDate="2016-01-07T00:52:35.463" Score="3" Body="&lt;p&gt;It depends on your knowledge and skills. Any book that attempts to cover a wide range of financial product is most likely not very technical. You should choose a book that suits your purpose. For example, if you're interested in interest rates modelling, you should consider something like &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/3540221492&quot; rel=&quot;nofollow&quot;&gt;Interest Rate Models - Theory and Practice: With Smile, Inflation and Credit&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll briefly describe some of the books that covers a wide range of financial products. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Hull's book&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Simple and easy to read. But probably not enough details for quantitative finance.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Paul Wilmott's book&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Simple mathematics, easy but not enough details. Ideal for someone who just wants to learn about the topics.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470821663&quot; rel=&quot;nofollow&quot;&gt;Structured Products Volume 1-3&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I think this is the book you are looking for. It covers essentially all the common financial products. The book also gives application and pricing model for every product. The book focus on financial products and risk management. Highly recommended. &lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="601" LastEditDate="2016-01-07T09:45:34.593" LastActivityDate="2016-01-07T09:45:34.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22624" PostTypeId="1" AcceptedAnswerId="22664" CreationDate="2016-01-07T00:56:58.277" Score="4" ViewCount="131" Body="&lt;p&gt;&lt;a href=&quot;http://www.bloomberg.com/news/articles/2016-01-06/if-options-traders-are-right-the-yuan-s-slump-is-far-from-over&quot;&gt;http://www.bloomberg.com/news/articles/2016-01-06/if-options-traders-are-right-the-yuan-s-slump-is-far-from-over&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Contract prices indicate a 79 percent probability that the currency&#xA;  will weaken this year and 33 percent odds that it will drop beyond 7&#xA;  per dollar, a level last seen in 2008, according to Bloomberg&#xA;  calculations.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The article was published on 7 Jan 2016. How was the probabilities regarding Yuan's slump calculated from the options market?&lt;/p&gt;&#xA;" OwnerUserId="6190" LastActivityDate="2016-01-08T18:55:32.310" Title="Calculating probability of Yuan's slump from options market" Tags="&lt;options&gt;&lt;fx&gt;&lt;probability&gt;&lt;currency&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22625" PostTypeId="1" CreationDate="2016-01-07T02:04:07.740" Score="5" ViewCount="2685" Body="&lt;p&gt;I was wondering if someone could give me an intuitive explanation as to why the vega of at the money options doesn't increase with volatility. I've seen some mathematical explanations showing the derivative of vega with respect to vol when strike=fwd price to be 0, but I didn't follow intuitively why that would be. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Volga: change in vega/change in vol&lt;/p&gt;&#xA;" OwnerUserId="18884" LastEditorUserId="18884" LastEditDate="2016-01-07T03:41:51.430" LastActivityDate="2016-01-12T13:41:22.530" Title="Intuitively speaking, why do at the money options have no volga/convexity?" Tags="&lt;volatility&gt;&lt;greeks&gt;" AnswerCount="6" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22626" PostTypeId="2" ParentId="22596" CreationDate="2016-01-07T04:48:15.300" Score="11" Body="&lt;p&gt;QuantConnect has had users work on contributing REST bitcoin brokerages - its fully open source and has complete modeling support for currencies. It also has python support in beta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.quantconnect.com/forum/discussion/958/bitfinex-brokerage&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.quantconnect.com/forum/discussion/958/bitfinex-brokerage&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I'm the founder of QuantConnect)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Fully support python and cryptocurrencies now. We've pushed GDAX brokerage into production!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit (12/2017): A community user has contributed a Bitfinex implementation. It is in the PR phase now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit (7/2019): Bitfinex has been in production for about 6 months and is stable. We have installed full quote-trade tick data from both GDAX and Bitfinex available for free backtesting on the website.&lt;/p&gt;&#xA;" OwnerUserId="16443" LastEditorUserId="16443" LastEditDate="2019-07-18T00:35:15.443" LastActivityDate="2019-07-18T00:35:15.443" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="22627" PostTypeId="2" ParentId="22475" CreationDate="2016-01-07T09:08:08.263" Score="2" Body="&lt;p&gt;There is a times series DBMS (&lt;a href=&quot;http://www.infiniflux.com&quot; rel=&quot;nofollow&quot;&gt;InfiniFlux&lt;/a&gt;) that can be easily used with Python. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The database is not open source but it does provide a free version for evaluation, too. So you can try whether the DBMS is suitable for your project. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are asking 2M rows should be processed in less than 30 seconds, InfiniFlux can store and retrieve more than 500,000 data within a second. In addition, it provide standard SQL and interface.&lt;/p&gt;&#xA;" OwnerUserId="18886" LastEditorUserId="743" LastEditDate="2016-01-07T15:58:50.327" LastActivityDate="2016-01-07T15:58:50.327" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22628" PostTypeId="2" ParentId="22620" CreationDate="2016-01-07T09:28:31.767" Score="4" Body="&lt;p&gt;The VaR of  level $\alpha$ a loss random variable (the bigger the worse) is the quantity $q$ such that the loss is bigger with probability $1-\alpha$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus we need a $q$ such that &#xA;$$&#xA;P[L&amp;gt;q] = 1-\alpha,&#xA;$$ &#xA;where we can imagine $\alpha=99\%$ and thus we need the starting point of the $1\%$ tail. Because we have a probability of a loss of size $0$ of $75\%$ we have a discontinuity of the cdf there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have to analyze the cdf of $L$ in detail: Recalling that the density of an exponential rv is given by $\mu \exp(-\mu x)$ we get&#xA;$$&#xA;P[L \le q] = 0.75+0.25 \int_0^q \mu \exp(-\mu x) dx = 0.75  + 0.25(1- \exp(-\mu q)).&#xA;$$&#xA;For a given level $\alpha$ we can then solve&#xA;$$&#xA;\alpha = 0.75  + 0.25(1- \exp(-\mu q))&#xA;$$&#xA;by rearranging terms and get&#xA;$$&#xA;(\alpha-0.75)/0.25 = 1 - \exp(-\mu q)&#xA;$$&#xA;and finally &#xA;$$&#xA;q = -\frac{1}{\mu} \ln\left(1- (\alpha-0.75)/0.25 \right).&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example for $\mu=1$ and $\alpha=0.99$ we get a VaR of $3.2189$ in the mixed case, whereas in the exponential case without the mass at zero it would be $-\ln(1-\alpha) = 4.6052$.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-01-07T09:28:31.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22630" PostTypeId="1" AcceptedAnswerId="22633" CreationDate="2016-01-07T14:55:10.207" Score="0" ViewCount="425" Body="&lt;p&gt;Let &lt;code&gt;x&lt;/code&gt; be the &lt;code&gt;closeBid&lt;/code&gt; price of EUR/USD, sampled every 5 minutes during year 2015 (historical data). This is the variation (is it correct to call it &lt;em&gt;5-minutes returns&lt;/em&gt;?) for each 5-minutes period:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;r = x[1:] / x[:-1] - 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What's the formula to have the (moving) &lt;strong&gt;volatility&lt;/strong&gt; over 1 year?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried this way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;rolling_stddev(r, 288*10)     # 10 days, since 288 periods of 5 minutes in 1 day&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The results is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/aQhni.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/aQhni.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is it a correct measure of volatility?&lt;/strong&gt; (i.e. standard deviation of the returns)&lt;/p&gt;&#xA;" OwnerUserId="18444" LastEditorUserId="18444" LastEditDate="2016-01-07T16:43:36.977" LastActivityDate="2016-01-07T16:43:36.977" Title="Volatility of EUR/USD: is this correct?" Tags="&lt;volatility&gt;&lt;returns&gt;&lt;fx&gt;&lt;analysis&gt;&lt;technical-analysis&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22631" PostTypeId="2" ParentId="22178" CreationDate="2016-01-07T15:04:36.880" Score="1" Body="&lt;p&gt;We assume that&#xA;\begin{align*}&#xA;dX_t &amp;amp;= X_t(rdt + \sigma_x dW^x_t)\\&#xA;dY_t &amp;amp;= Y_t\Big[rdt + \sigma_y\Big(\rho dW^x_t + \sqrt{1-\rho^2} dW^y_t \Big)\Big],&#xA;\end{align*}&#xA;where $\rho$ is the correlation, which we assume to be less than 1, and $W^x$ and $W^y$ are two independent standard Brownian motions. Then&#xA;\begin{align*}&#xA;d(X_t/Y_t) &amp;amp;= \frac{1}{Y_t}dX_t - \frac{X_t}{Y_t^2}dY_t +\frac{X_t}{Y_t^3}d\langle Y, \, Y\rangle_t - \frac{1}{Y_t^2}d\langle X, \, Y\rangle_t\\&#xA;&amp;amp;=\frac{X_t}{Y_t}\Big[\sigma_x dW^x_t - \sigma_y\Big(\rho dW^x_t + \sqrt{1-\rho^2} dW^y_t \Big) +\big(\sigma_y^2-\rho\sigma_x\sigma_y\big)dt\Big]\\&#xA;&amp;amp;=\frac{X_t}{Y_t}\Big[ \big(\sigma_y^2-\rho\sigma_x\sigma_y\big)dt +\sigma dW_t\Big],&#xA;\end{align*}&#xA;where&#xA;$$\sigma = \sqrt{\sigma_x^2+\sigma^2_y-2\rho\sigma_x\sigma_y},$$ and $W$ is standard Brownian motion.&#xA;The option payoff $$(X_T/Y_T-K)^+$$ at maturity $T$ has the value given by&#xA;\begin{align*}&#xA;C &amp;amp;\equiv e^{-rT}E\big((X_T/Y_T-K)^+ \big)\\&#xA;&amp;amp;=e^{-rT}\left(e^{(\sigma_y^2-\rho\sigma_x\sigma_y)T} \frac{X_0}{Y_0}N(d_1)-KN(d_2)\right)\\&#xA;&amp;amp;= e^{-rT +(\sigma_y^2-\rho\sigma_x\sigma_y)T}\left(\frac{X_0}{Y_0}N(d_1)-e^{-(\sigma_y^2-\rho\sigma_x\sigma_y)T} KN(d_2)\right),&#xA;\end{align*}&#xA;where&#xA;\begin{align*}&#xA;d_1 &amp;amp;=\frac{\ln (X_0/Y_0) + (\sigma_y^2-\rho\sigma_x\sigma_y)T + \frac{1}{2}\sigma^2 T }{\sigma \sqrt{T}},&#xA;\end{align*}&#xA;and&#xA;$$d_2 = d_1 - \sigma \sqrt{T}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consequently, the delta hedge ratios with respect to $X_0$ and $Y_0$ can be computed correspondingly. Specifically,&#xA;\begin{align*}&#xA;\frac{\partial C}{\partial X_0} &amp;amp;= \frac{1}{Y_0}\frac{\partial C}{\partial (X_0/Y_0)}\\&#xA;&amp;amp;=\frac{1}{Y_0}e^{-rT +(\sigma_y^2-\rho\sigma_x\sigma_y)T}N(d_1),&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;\frac{\partial C}{\partial Y_0} &amp;amp;= -\frac{X_0}{Y_0^2}\frac{\partial C}{\partial (X_0/Y_0)}\\&#xA;&amp;amp;=-\frac{X_0}{Y_0^2}e^{-rT +(\sigma_y^2-\rho\sigma_x\sigma_y)T}N(d_1).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-01-07T15:34:03.543" LastActivityDate="2016-01-07T15:34:03.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22632" PostTypeId="2" ParentId="22625" CreationDate="2016-01-07T15:05:22.343" Score="0" Body="&lt;p&gt;This is probably the mathematical explanation you are referring to... &lt;a href=&quot;https://quant.stackexchange.com/questions/16368/why-is-the-vega-of-an-at-the-money-option-so-insensitive-to-movements-in-volatil&quot;&gt;LINK&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tend to think of this problem semi-mathematically with remembering the whole formula. Say the time value of the option comes from sigma*sqrt(T). So ATM option is approximately linear in volatility. Similar conclusion can be drawn in terms of the trend of time decay of an option, which is approximately a square root function.&lt;/p&gt;&#xA;" OwnerUserId="17835" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-01-07T15:05:22.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22633" PostTypeId="2" ParentId="22630" CreationDate="2016-01-07T15:08:45.823" Score="2" Body="&lt;p&gt;First I thought about voting to close this question as it deals with Matlab synthax a lot.&#xA;I ignore the Matlab stuff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have 5-minutes data. So an estmator of volatility over any sample of size $N$ (e.g. 100) will be an estimator of the vol of your 5-min returns. Usually volatility is quotes as &quot;per annum&quot; or &quot;pa&quot;. This means that using the square root of time rule you can multiply your estimate by the number of 5-minute intervals in a year. Thus if you want to quote vola pa then&#xA;$$&#xA;T = 12*24*260 = 288*260&#xA;$$&#xA;assuming 260 banking days and you multiply your estimate by $\sqrt{T}$.&#xA;If you do the calculation for 10 days then $T=288*10$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The $T$, the holding period, is independent from the number of returns that you use in order to estimate the 5-minutes vol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Doing the things rolling does not change anything of the things above. You just push a window forward by 1 return each time.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-01-07T15:08:45.823" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22634" PostTypeId="1" CreationDate="2016-01-07T16:11:18.190" Score="8" ViewCount="1505" Body="&lt;p&gt;I am pondering on the existence/impossibility of a trading system (or algorithm) that ALWAYS ends up winning money, no matter how the price of a futures moves. In a context where one can go long or short at will to make a profit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the trader has infinite funds, it's possible. He can setup some kind of martingale system and cancel every loss by making an opposite trade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the trader has limited funds, there's an intuitive &quot;proof&quot; that no system can win: if it existed, someone would have figured it out by now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I'm looking for a formal treatment of the question. Lots of papers deal with trading in a model in which prices movements are associated with probabilities, such as brownian motions and the like. But really, what I'm looking for is a proof that there's no algorithm that can beat ANY price movement. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Meaning, for every trading algorithm that has limited capital, there exists a price movement in which the algorithm incurs a loss - i.e. the trader cannot close all his positions with a positive outcome.  This sounds obivous, but I can't find a formal proof.  Any references on the topic is appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[EDIT]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wish to thank everyone for their answers.  I helped me think about how to formalize the question better, as some go to overly complicated answers for what I really wanted to ask.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Think of it as a turn-based game played between two independent entities, the trader and the price.  On his turn, the trader takes some positions and closes others (positions might be forcefully closed if trader's balance can't cover his positions, like a margin call).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On its turn, the price makes a tick movement, up or down.  Then turns alternate in this manner.  The game ends when the trader has no open positions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The trader aims to make a profit, the price aims to make the trader lose money.  In other words, assume that the price is kind of sentient, decides on its own movements, plotting against the trader.  Who wins this game if both sides play optimally ?&lt;/p&gt;&#xA;" OwnerUserId="18889" LastEditorUserId="18889" LastEditDate="2016-01-08T16:09:01.860" LastActivityDate="2016-01-08T22:16:37.903" Title="Proof that no trading system always wins" Tags="&lt;mathematics&gt;&lt;algorithmic-trading&gt;&lt;proof&gt;" AnswerCount="7" CommentCount="9" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22635" PostTypeId="1" AcceptedAnswerId="22640" CreationDate="2016-01-07T16:12:53.190" Score="1" ViewCount="107" Body="&lt;p&gt;Assume zero dividend and that the strike price for a European call option on a stock at a fixed  maturity &lt;strong&gt;T&lt;/strong&gt; and strike price &lt;strong&gt;K&lt;/strong&gt; is given by &lt;strong&gt;C(K)&lt;/strong&gt;.Suppose that $C(K)=e^{-k}$ for all $K\geq 0$ ,then, I want to find out the following&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1.What must the present value of stock be?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2.What is the risk neutral probability that the stock price will lie in the interval [5,10] at maturity&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3.What is the present value of contract that pays $X^2$ at maturity if the stock price at maturity is &lt;strong&gt;X&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solution:&#xA; I don't know answer to this question. I know  Black-Scholes formula, binomial option pricing,VaR, mean-variance portfolio optimisation and black-litterman model.How should I proceed to answer these questions? &lt;/p&gt;&#xA;" OwnerUserId="15605" LastActivityDate="2016-01-07T18:21:46.860" Title="Option analysis" Tags="&lt;options&gt;&lt;risk&gt;&lt;risk-neutral-measure&gt;&lt;self-study&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22636" PostTypeId="2" ParentId="22630" CreationDate="2016-01-07T16:21:02.770" Score="0" Body="&lt;p&gt;It's better to use an exponentially weighted moving average.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's a nice tutorial video by the Bionic Turtle &lt;a href=&quot;https://www.youtube.com/watch?v=P_tr9_Ue220&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7178" LastActivityDate="2016-01-07T16:21:02.770" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22637" PostTypeId="2" ParentId="22634" CreationDate="2016-01-07T16:51:00.493" Score="7" Body="&lt;p&gt;At the first glance, what you are asking for is a model admitting arbitrage, so there is a zero chance of losing money and positive chance of yielding profits. Well, many equilibrium models start with assuming arbitrage is not possible (otherwise it would be trivial wouldn't it).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, in my opinion, what you actually seek is the &lt;a href=&quot;https://en.wikipedia.org/wiki/Efficient-market_hypothesis&quot;&gt;Efficient Markets Hypothesis&lt;/a&gt;. It basically says there is not way to consistently beat the market while covering for all the risks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Start with &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/j.1540-6261.1970.tb00518.x/full&quot;&gt;Fama (1970)&lt;/a&gt; and &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/0304405X78900259&quot;&gt;Jensen(1978)&lt;/a&gt;. There are certainly many attempts to test and disprove EMH since it kinda sounds stringent. But then Joint Hypothesis Problem (or Bad Model Problem) is coined in late '70s or early '80s, making EMH fairly hard to prove/disprove. It roughly says &quot;Your model can say it can make sustainable risk adjusted profits but perhaps it did not cover for all risks in the market? How would you know?&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you are implicitly referring is the strong form of efficiency. But here is not the matter of funds but informational power. Strong form of efficiency dictates even if you have information privileged to you or a small group (e.g. insider trading) in the market, you cannot make sustainable profits. This part is usually criticised and never had too many supporters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.jstor.org/stable/pdf/1805228.pdf?acceptTC=true&quot;&gt;Grossman and Stiglitz (1980)&lt;/a&gt; have a nice view on the EMH by the way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ps. Just for fun, I know it is not what you intended or it is not possible. Assumed you have infinite funds it is possible to make profitable trades infinitely. Just keep buying assets continuously. Since you have infinite funds you will never be short of money and your asset value will increase continuously since you continuously buy from the higher value. You can keep doing this till you own the market.&lt;/p&gt;&#xA;" OwnerUserId="8147" LastActivityDate="2016-01-07T16:51:00.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22638" PostTypeId="2" ParentId="22608" CreationDate="2016-01-07T17:06:51.237" Score="1" Body="&lt;p&gt;I think you mixed up two aspects here: returns over time and returns over sectors (your columns). Your citation refers to a smoothing technique for portfolio returns over &lt;strong&gt;more than one time period&lt;/strong&gt; where the portfolio consists of several sectors (might be even single stocks). That would be your rows (funds) but I cannot see the time periods here (which should be your columns). Instead you have broken down further into sectors which in my humble opinion does not fit to the smoothing I assume you have applied.&lt;/p&gt;&#xA;" OwnerUserId="17281" LastActivityDate="2016-01-07T17:06:51.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22640" PostTypeId="2" ParentId="22635" CreationDate="2016-01-07T18:03:26.673" Score="1" Body="&lt;p&gt;&lt;strong&gt;(1)&lt;/strong&gt;. We consider a call option with strike $K=0$. Then $S_0=C(0)=1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;(2)&lt;/strong&gt;. We assume zero interest rate. Then, for any $K\ge 0$,&#xA;\begin{align*}&#xA;1_{S_T \ge K} &amp;amp;=\lim_{\varepsilon \rightarrow 0}\frac{(S_T-K)^+ - (S_T-K-\varepsilon)^+}{\varepsilon}.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;P(S_T \ge K) &amp;amp;= -\frac{\partial C(K)}{\partial K}\\&#xA;&amp;amp;= e^{-K}.&#xA;\end{align*}&#xA;Therefore,&#xA;\begin{align*}&#xA;P(5 \le S_T &amp;lt; 10) &amp;amp;= P(S_T \ge 5) - P(S_T \ge 10)\\&#xA;&amp;amp;= e^{-5}-e^{-10}.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;(3)&lt;/strong&gt;. Note that &#xA;\begin{align*}&#xA;S_T^2 = 2\int_0^{\infty}(S_T-K)^+ dK.&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;e^{-rT} E\big(S_T^2\big) &amp;amp;= 2\int_0^{\infty}e^{-rT}E\big((S_T-K)^+\big) dK\\&#xA;&amp;amp;=2\int_0^{\infty} C(K) dK\\&#xA;&amp;amp;=2\int_0^{\infty} e^{-K} dK\\&#xA;&amp;amp;=2.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-01-07T18:21:46.860" LastActivityDate="2016-01-07T18:21:46.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22643" PostTypeId="2" ParentId="22634" CreationDate="2016-01-07T19:36:08.523" Score="2" Body="&lt;p&gt;Why do you think such a theorem would exist? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will give you a counterexample: You have two assets A and B. Both are completely identical in every respect, except price: The price of A is USD 1 the price of B is USD 2. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your strategy is simple: You (short) sell B for a gain of 2 and buy A for 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This strategy requires no capital and leaves you with an initial profit of 1. But since you are perfectly hedged by definition no future price movement will take this profit away.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The existence of an algorithm which makes money with certainty is called arbitrage. Market models assume there is no arbitrage, not because it is not possible (see counterexample), but because it makes no sense, i.e. is not a good approximation of reality.     &lt;/p&gt;&#xA;" OwnerUserId="482" LastEditorUserId="482" LastEditDate="2016-01-07T20:07:13.847" LastActivityDate="2016-01-07T20:07:13.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22645" PostTypeId="1" CreationDate="2016-01-07T20:08:07.157" Score="1" ViewCount="411" Body="&lt;p&gt;It has been correctly stated that the Sharpe ratio of a strategy does not change when it is leveraged. I understand &lt;a href=&quot;https://quant.stackexchange.com/questions/18413/sharpe-ratio-and-leverage&quot;&gt;Eric's&lt;/a&gt; point that leveraging by $n$ multiplies both the return $x$ and volatility $\sigma$ by $n$. I also understand that we fund the leverage at risk free rate, and hence subtract $r(n-1)$ from the return. However, I cannot understand why this would not change the Sharpe ratio (sr) since $$sr = \frac{nx - (n-1)r}{n\sigma} = \frac{n(x-r)}{n\sigma} + \frac{r}{n\sigma} = \frac{(x-r)}{\sigma} + \frac{r}{n\sigma}$$&#xA;The sr is different, where am I going wrong?&lt;/p&gt;&#xA;" OwnerUserId="18890" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-01-07T23:20:41.317" Title="Why does the Sharpe ratio not change when the strategy is leveraged?" Tags="&lt;sharpe-ratio&gt;&lt;leverage&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="22646" PostTypeId="2" ParentId="21443" CreationDate="2016-01-07T20:12:34.777" Score="2" Body="&lt;p&gt;I think after spending some time on the topic with research papers, I can come up with a satisfying answer. I will list them item by item so (I hope) it would be more clear. Starting from the most obvious.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Theoretically, adjusting your model to the market price has no benefit except to calibrate your greeks (prominently Delta and Gamma). It literally says &quot;I believe the market has the fairest price of all.&quot; Otherwise any divergence from the market would not be labeled as &quot;error&quot;.&lt;/li&gt;&#xA;&lt;li&gt;If you use implied volatility per contract, you literally say &quot;I believe market movement is best represented by Geometric Brownian Motion and Black Scholes model&quot;. Because what you do is basically inverting BS formula (unless you are using another model to calculate volatilities, then you are bound by that model)&lt;/li&gt;&#xA;&lt;li&gt;If you are somehow logically using the volatility smile in order not to fall for different volatility estimates for the same maturity but different strike values; congratulations, now you have your own opinion about the contract price. No matter how small, your model disagrees with the market (at least part of it). That's OK, since volatility smile itself is an argument against the BS.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.maths.tcd.ie/~dmcgowan/Merton.pdf&quot; rel=&quot;nofollow&quot;&gt;Merton (1973)&lt;/a&gt; claims if you can continuously delta hedge your position, you will be protected from small changes in the underlying. So if your model is true and the market is wrong. You will be scalping the price difference (as @mbison said) and be protected from all other influences.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Efficient Markets Hypothesis&lt;/strong&gt; dictates that you cannot make risk adjusted excess profits (or in other terms, beat the market). &lt;a href=&quot;http://jmhommet.free.fr/jmhommet.free.fr/NEWS/Entrees/2013/10/14_M2_EGRF__MESSAGE_9_files/Samuelson-Proof.pdf&quot; rel=&quot;nofollow&quot;&gt;Samuelson (1965)&lt;/a&gt; and &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/j.1540-6261.1970.tb00518.x/full&quot; rel=&quot;nofollow&quot;&gt;Fama (1970)&lt;/a&gt; started this discussion and it became a hot topic. (side note: &lt;a href=&quot;http://www.jstor.org/stable/pdf/1805228.pdf?acceptTC=true&quot; rel=&quot;nofollow&quot;&gt;Grossman and Stiglitz (1980)&lt;/a&gt; roughy asked if 'we cannot make an extra buck, why bother trading?'.)&lt;/li&gt;&#xA;&lt;li&gt;EMH has three different types based on the information level (past price changes, public info such as earnings/splits/etc and private information such as insider trading/access to limit order books) and the definitions changed later. &lt;/li&gt;&#xA;&lt;li&gt;Of course it didn't stop there. Many researchers either tested or attacked EMH. There was much bread to be made from academic articles on this discussion. Many tests and surveys were written (some of us had to read most of that stuff, it becomes unfortunate sometimes). The general attack method was: &quot;I found a model/trading strategy, made lots of paper profits with it. Your hypothesis is wrong!&quot;. Many also said: &quot;I tried models, tested and saw that even if there are a few bucks to be made with the models, the gains are all wiped out by transaction costs. So don't bother, market is efficient.&quot; See &lt;a href=&quot;http://www.e-m-h.org/Jens78.pdf&quot; rel=&quot;nofollow&quot;&gt;Jensen (1978)&lt;/a&gt; &lt;a href=&quot;http://efinance.org.cn/cn/fm/Efficient%20markets%20II.pdf&quot; rel=&quot;nofollow&quot;&gt;Fama (1991)&lt;/a&gt;, &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S0304405X98000269&quot; rel=&quot;nofollow&quot;&gt;Fama (1998)&lt;/a&gt;, &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=991509&quot; rel=&quot;nofollow&quot;&gt;Lo (2007)&lt;/a&gt; and &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1781091&quot; rel=&quot;nofollow&quot;&gt;Jarrow and Larsson (2012)&lt;/a&gt; for detailed surveys and overviews. There are also some points about rationality and behavioral finance if you like.&lt;/li&gt;&#xA;&lt;li&gt;I managed to find some studies theoretically extending EMH to options markets, albeit few. &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2007112&quot; rel=&quot;nofollow&quot;&gt;Jarrow (2012)&lt;/a&gt; and &lt;a href=&quot;http://www.bfjlaward.com/pdf/25919/88-94_Jarrow_JPM_1021w.pdf&quot; rel=&quot;nofollow&quot;&gt;Jarrow (2013)&lt;/a&gt; combine option theory with market efficiency. Apart from loads of mathematical symbols, what I understand is market efficiency is strongly tied to no arbitrage condition (unsurprisingly). Also, there might be times of &quot;asset bubbles&quot; temporarily disrupting the efficiency. Surely there were efficiency tests on options markets. See &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/j.1540-6261.1972.tb00969.x/abstract&quot; rel=&quot;nofollow&quot;&gt;Black and Scholes (1972)&lt;/a&gt; and &lt;a href=&quot;http://www.jstor.org/stable/pdf/2352152.pdf&quot; rel=&quot;nofollow&quot;&gt;Galai (1978)&lt;/a&gt; for instance.&lt;/li&gt;&#xA;&lt;li&gt;Long story short, at some point &lt;strong&gt;Joint Hypothesis Problem&lt;/strong&gt; term is coined. The situation is also called Bad Model Problem. It says that &quot;In order to disprove EMH, you need to bring an equilibrium model which allegedly covers market risks. But there is no guarantee that your model covers all the risks in the market. Any excess profits you made during your trades might be attributed to the uncovered risks.&quot; In other words, it says &quot;You might not be hedging properly. Reality will be different from your model.&quot;&lt;/li&gt;&#xA;&lt;li&gt;To sum up: Your models trying to approximate to option market already assumes that markets are efficient. Good luck to other models, because they have informationally efficient markets ahead; at least in theory. In practice, however, things are not that different. See &lt;a href=&quot;http://money.cnn.com/2015/03/12/investing/investing-active-versus-passive-funds/&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; and &lt;a href=&quot;http://www.businessinsider.com/large-cap-equity-funds-underperform-the-sp-500-2015-6&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt;. Not very heartening.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8147" LastActivityDate="2016-01-07T20:12:34.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22647" PostTypeId="2" ParentId="22634" CreationDate="2016-01-07T20:19:04.417" Score="1" Body="&lt;p&gt;The practical problem would be that you yourself would own larger and larger parts of the market and influence the market prices with your buying and selling decisions in an unfavourable way. There will be fewer and fewer counterparties from which you can earn your money so your system would automatically stop working.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So &lt;em&gt;you&lt;/em&gt; don't have to have infinite funds for the proof because &lt;em&gt;the whole market&lt;/em&gt; has no infinite funds either. The whole system is closed, meaning for every stock you sell somebody has to buy it and vice versa.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The point when those unfavourable feedback effects kick in will come faster than one might think due to compounding effects (I was trying to find an article that conducted a similar thought experiment as a kind of a benchmark, but I cannot find it right now - when I find it, I will add the link).&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2016-01-07T20:19:04.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22648" PostTypeId="2" ParentId="22634" CreationDate="2016-01-07T20:55:56.280" Score="2" Body="&lt;p&gt;This is where one needs the concept of no free lunch with vanishing risk (NFLVR), whose proof you can find in: &lt;a href=&quot;http://link.springer.com/article/10.1007%2FBF01450498&quot; rel=&quot;nofollow&quot;&gt;Delbaen &amp;amp; Schachermayer (1994)&lt;/a&gt;. Though, as a warning, I should mention it is pretty involved.&lt;/p&gt;&#xA;" OwnerUserId="15336" LastActivityDate="2016-01-07T20:55:56.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22651" PostTypeId="2" ParentId="22645" CreationDate="2016-01-07T23:15:39.613" Score="2" Body="&lt;p&gt;Sharpe ratio = $\frac{r_p - r_f}{\sigma_p}$, where:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$r_p$ is the expected portfolio return &lt;/li&gt;&#xA;&lt;li&gt;$\sigma_p$ is the portfolio's standard deviation&lt;/li&gt;&#xA;&lt;li&gt;$r_f$ is the risk free rate.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;When you leverage '$n$' times:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The leveraged portfolio return is $n r_p - (n-1) r_f$ (subtracting the cost of borrowing the money)&lt;/li&gt;&#xA;&lt;li&gt;The standard deviation increases to $n\sigma$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Hence:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Leveraged Sharpe ratio&quot; = $\frac{n r_p - (n-1) r_f - r_f}{n\sigma}=\frac{n(r_p-r_f)}{n\sigma}$ = $\frac{r_p - r_f}{\sigma_p}$ = Sharpe ratio.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Given any risky asset, one can generate an infinite expected return at the cost of added risk (by leveraging the investment). The Sharpe ratio mitigates &quot;false advertising&quot;.&lt;/p&gt;&#xA;" OwnerUserId="16351" LastEditorUserId="16351" LastEditDate="2016-01-07T23:20:41.317" LastActivityDate="2016-01-07T23:20:41.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22652" PostTypeId="2" ParentId="22621" CreationDate="2016-01-07T23:32:16.953" Score="1" Body="&lt;p&gt;why do you have &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;vectpayoffs(j) = l(j)*(ST(j) - K);&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;if it is a knockout &lt;strong&gt;call&lt;/strong&gt;, it should be l(j)*max(ST(j, maturityDate) -K, 0).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assumed that j indicates which simulation it is, and you have columnwise the dates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However you have stated before that for ordinary vanilla calls you get the correct solution which is odd. If adding the max does not help, why not post all of your matlab code. We can have a quick look at how all your variables and stuff are really defined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Code&lt;/strong&gt;&#xA;i went over your code. and with the modification of max(ST -K,0) it seems to me that your code produces the correct results (although you coded it up quite inefficient in matlab with your double for loop).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The output of the code below is Downout =  4.9797 and call_vanilla =   14.2127. &#xA;You can compare that against a barrier option pricer on the web.  for example&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The webpricer gave me 4.94 which might be explainable by daycount conventions, rounding etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.fintools.com/resources/online-calculators/exotics-calculators/exoticscalc-barrier/&quot; rel=&quot;nofollow&quot;&gt;http://www.fintools.com/resources/online-calculators/exotics-calculators/exoticscalc-barrier/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;S0 = 105   % Price of underlying&#xA;sig = 0.28;      % vol&#xA;&#xA;K=100&#xA;B = 101 %&#xA;%B = 0.001 %set very low B to pretend to be vanilla.&#xA;r= 0.0025&#xA;mu = r % you are simulating the risk neutral process. not the real world&#xA;T = 1&#xA;&#xA;nbrsim = 10000;&#xA;nbre_step = 256&#xA;S = zeros(nbrsim,nbre_step+1);&#xA;&#xA;dt = 1 / nbre_step&#xA;for j = 1:nbrsim&#xA;    S(j,1)=S0;&#xA;    for i = 1:nbre_step&#xA;        %not needed t(i+1)=t(i)+dt;&#xA;        Z = normrnd(0,1);&#xA;        S(j,i+1)=S(j,i) + mu*S(j,i)*dt + S(j,i) * sig * sqrt(dt) * Z;&#xA;    end&#xA;    ST(j)=S(j,nbre_step+1);&#xA;end&#xA;&#xA;for j = 1:nbrsim&#xA;if min(S(j,:)) &amp;lt;= B&#xA;   l(j) = 0;&#xA;else&#xA;    l(j) = 1;&#xA;end&#xA;vectpayoffs(j) = l(j)*max(ST(j) - K,0);&#xA;end&#xA;&#xA;&#xA;DF = exp(- r * T);&#xA;Downout = DF * 1/nbrsim * sum(vectpayoffs)&#xA;&#xA;%sanity check against black scholes&#xA;call_vanilla = blsprice(105, 100, r, T, sig)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="17316" LastEditorUserId="17316" LastEditDate="2016-01-08T19:10:43.837" LastActivityDate="2016-01-08T19:10:43.837" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="22655" PostTypeId="2" ParentId="10749" CreationDate="2016-01-08T06:10:29.613" Score="1" Body="&lt;p&gt;Unless the option value is exactly 50, yes, there is an &#xA;implied volatility. I wrote a program to compute it, and &#xA;even used to post NADEX implied volatility regularly for a &#xA;couple of years. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the subroutine in Perl (from &#xA;&lt;a href=&quot;https://github.com/barrycarter/bcapps/blob/master/bclib.pl#L1525&quot; rel=&quot;nofollow&quot;&gt;https://github.com/barrycarter/bcapps/blob/master/bclib.pl#L1525&lt;/a&gt;) &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; &#xA;&#xA;=item bin_volt($price, $strike, $exp, $under) &#xA;&#xA;Computes the volatility of a binary option, given its current $price, &#xA;the $strike price, the years to expiration $exp, and the price of the &#xA;underlying instrument $under &#xA;&#xA;=cut &#xA;&#xA;sub bin_volt { &#xA; my($price, $strike, $exp, $under) = @_; &#xA; if ($price == 50 || $price == 100 || $price ==0) {return 0;} &#xA; return log($strike/$under)/udistr($price/100)/sqrt($exp); &#xA;} &#xA;&lt;/code&gt;&lt;/pre&gt; &#xA;&#xA;&lt;p&gt;where 'udistr' is the inverse of the cumulative &#xA;distribution function for the normal distribution. The &#xA;derivation: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The value of the option is the percentage chance that &#xA;the underlying will be worth more than the strike price &#xA;at expiration. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If the underlying has yearly volatility &lt;code&gt;vol&lt;/code&gt;, the &#xA;standard deviation of the log of its price over one year &#xA;is &lt;code&gt;vol&lt;/code&gt;, by definition. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;For &lt;code&gt;exp&lt;/code&gt; years, the standard deviation of &lt;code&gt;log(price)&lt;/code&gt; is &lt;code&gt;sqrt(exp)*vol&lt;/code&gt; &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;We now compute the number of standard deviations &#xA;between the log of the strike price and the log of the &#xA;underlying's current price. This calculation is: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(log(strike)-log(under))/(sqrt(exp)*vol)&lt;/code&gt; (note that I &#xA;use &lt;code&gt;log(strike/under)&lt;/code&gt; in my code, which is equivalent) &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Once we know this value, we can use the cumulative &#xA;distribution function of the normal distribution &#xA;to calculate how likely it is that the underlying will &#xA;exceed the strike price at expiration: &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;price = 1-CDF[(log(strike)-log(under))/(sqrt(exp)*vol)]&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;We can then unravel this equation (and make some &#xA;simplifications) to find the implied volatility, as given above. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Note that I am assuming these are short-term options, &#xA;and that the risk-free interest rate can safely be &#xA;ignored. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerDisplayName="user59" LastActivityDate="2016-01-08T06:10:29.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22656" PostTypeId="2" ParentId="2770" CreationDate="2016-01-08T10:00:33.310" Score="2" Body="&lt;p&gt;Just wanted to add one more library that may be of interest: &lt;a href=&quot;http://www.yeppp.info/&quot; rel=&quot;nofollow&quot;&gt;http://www.yeppp.info/&lt;/a&gt;. It's not strictly a quant library but a:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;SIMD-optimized mathematical library for x86, ARM, and MIPS processors&#xA;  on Windows, Android, Mac OS X, and GNU/Linux systems.&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="18030" LastActivityDate="2016-01-08T10:00:33.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22657" PostTypeId="2" ParentId="4202" CreationDate="2016-01-08T11:03:13.867" Score="0" Body="&lt;p&gt;I had the problem of creating a portfolio from 10000 time series.&#xA;So I used greedy optimisation principle.&#xA;1. select best Sharpe ratio time series&#xA;2. select next time series that in combination creates best Sharpe ratio&#xA;3. add one more time series that creates best portfolio Sharpe ratio&#xA;4. continue adding one by one till you reach 100 or so&#xA;5. divide weights by 100 and you get weights to sum up to 1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you can add restrictions inside the main loop - i.e. do not add more than 10% of the same type.&#xA;results are similar to quadprog but much faster.&lt;/p&gt;&#xA;" OwnerUserId="18909" LastActivityDate="2016-01-08T11:03:13.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22658" PostTypeId="2" ParentId="9436" CreationDate="2016-01-08T11:44:09.320" Score="1" Body="&lt;p&gt;The peak-load wiki page is pretty poor. Public transit may not be the best example, especially since at most times it's close to zero marginal cost but tends not to be free. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The bottom line up front difference is price discrimination is specifically intended to avoid charging an efficient price (in the basic microeconomic sense of market efficiency), whereas peak-load pricing is specifically intended to create an efficient price at all times. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Price discrimination explicitly segments customers by their personal demand curve, so that instead of offering the market price based upon aggregate supply and demand, thus admitting quite a bit of consumer surplus, a seller is able to offer exactly what each customer is individually willing to pay by charging a different price to each customer. Clearly, it's nearly impossible to do this in practice except by individual negotiation and secret prices, so you'll see segmentation into sub-markets rather than by individual customer, hence the airline example trying to use a fairly hacky means of capturing at least a little more producer surplus if not all of it. The point is to not charge a single market-clearing price, which inherently benefits customers who would be willing to pay more but don't have to. The producer itself is still willing to charge the lowest market-clearing price, but of course would prefer not to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Peak-load pricing, on the other hand, has nothing to do with producers trying to optimize their own welfare surplus. A better example than public transit, sticking with public goods, is utilities pricing. A line can only sustain so much transmission bandwidth at a time and prices act as a rationing mechanism to induce usage to stay balanced over the course of an entire day so the line will always work. Charging more during the day is not intended to take advantage of customers who absolutely need the power at noon. It's intended to reduce peak usage so the line doesn't break. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, it can work in the opposite way for goods that have short-term supply flexibility. Uber is the obvious private sector example. Peak-load pricing there is also not intended to gouge customers (in spite of the headlines). They do that so they can send bulk text messages to all their drivers who are not currently on the road telling them 'hey, sign on right now and you can earn ten times your normal fare.' It's intended to increase the system capacity to meet the level of current demand, while at the same time discouraging riders who are not willing to pay that much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In both cases, the purpose of the price change is to always maintain a single price that actually clears the market. It's not that the producer is willing to accept a lower price but prefers not to in order to change the balance of producer's versus consumer's surplus. Instead, the price rises to prevent or remedy a supply shortage, and then drops again later to prevent or remedy a supply surplus.&lt;/p&gt;&#xA;" OwnerUserId="18669" LastActivityDate="2016-01-08T11:44:09.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22659" PostTypeId="1" CreationDate="2016-01-08T11:55:19.070" Score="1" ViewCount="312" Body="&lt;p&gt;I have a dataframe with over 4000 companies data (as column) and have calculted their daily Quoted spread measure ( measures liquidity for each stock) for 15 years. And then from the daily have estimated the monthly average Quoted spread for each company( for 180 months). Now, I want is to form equally wieghted decile portfolios of these companies specifically at the beginning of each year in my sample period meaning I want to form 10 portfolios at the beginning of each year based on the liquidity measured. Below I illustrate small portion of my data&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Month   A        B      C   D       E   F        G      H   I   J&#xA;Jan-00  0.05    0.02    NA  0.00    NA  0.04    0.04    NA  NA  0.03&#xA;Feb-00  0.07    0.02    NA  0.01    NA  0.04    0.08    NA  NA  0.02&#xA;Mar-00  0.09    0.02    NA  0.00    NA  0.04    0.07    NA  NA  0.03&#xA;Apr-00  0.11    0.02    NA  0.00    NA  0.03    0.08    NA  NA  0.03&#xA;May-00  0.14    0.02    NA  0.00    NA  0.03    0.06    NA  NA  0.02&#xA;Jun-00  0.15    0.01    NA  0.01    NA  0.04    0.05    NA  NA  0.02&#xA;Jul-00  0.10    0.02    NA  0.01    NA  0.03    0.05    NA  NA  0.04&#xA;Aug-00  0.11    0.02    NA  0.00    NA  0.03    0.03    NA  NA  0.03&#xA;Sep-00  0.08    0.02    NA  0.01    NA  0.04    0.03    NA  NA  0.02&#xA;Oct-00  0.11    0.02    NA  0.01    NA  0.03    0.04    NA  NA  0.02&#xA;Nov-00  0.17    0.02    NA  0.01    NA  0.04    0.04    NA  0.01 0.05&#xA;Dec-00  0.18    0.02    NA  0.01    NA  0.04    0.03    NA  0.01 0.01&#xA;Jan-01  0.25    0.02    NA  0.00    NA  0.04    0.03    NA  0.01 0.01&#xA;Feb-01  0.23    0.02    NA  0.01    NA  0.04    0.03    NA  0.01 0.01&#xA;Mar-01  0.13    0.03    NA  0.01    NA  0.04    0.03    NA  0.01 0.01&#xA;Apr-01  0.19    0.03    NA  0.01    NA  0.06    0.03    NA  0.01    NA&#xA;May-01  0.15    0.03    NA  0.01    NA  0.04    0.03    NA  0.01    NA&#xA;Jun-01  0.33    0.03    NA  0.01    NA  0.05    0.03    NA  0.01    NA&#xA;Jul-01  0.24    0.04    NA  0.00    NA  0.05    0.03    NA  0.00    NA&#xA;Aug-01  0.29    0.04    NA  0.00    NA  0.03    0.02    NA  0.00    NA&#xA;Sep-01  0.25    0.04    NA  0.00    NA  0.05    0.03    NA  0.01    NA&#xA;Oct-01  0.20    0.05    NA  0.00    NA  0.05    0.02    NA  0.01    NA&#xA;Nov-01  0.24    0.03    NA  0.01    NA  0.04    0.02    NA  0.01    NA&#xA;Dec-01  0.33    0.02    NA  0.00    NA  0.04    0.03    NA  0.01    NA&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It is hard to provide a reproduciable data.So,I want is that to form 10 portfolios at the beginning of year 2001 based the 2000. And then form decile portfolio at the beginning of 2002 based on 2001. I want to sort the stocks based on their liquidity. I would really appreciate your help even if you give me an idea how to go about this portfolio formation.&lt;/p&gt;&#xA;" OwnerUserId="18786" LastEditorUserId="18786" LastEditDate="2016-01-08T13:16:25.723" LastActivityDate="2016-01-08T13:16:25.723" Title="How to form Decile Portfolios based on Liquidity measure with missing data in R" Tags="&lt;equities&gt;&lt;r&gt;&lt;portfolio&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22660" PostTypeId="1" AcceptedAnswerId="22764" CreationDate="2016-01-08T11:59:03.913" Score="3" ViewCount="266" Body="&lt;p&gt;I am trying to calculate the mean variance portfolio using the plug-in approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First I generate some artificial data:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x &amp;lt;- replicate(10,rnorm(1000))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I apply the plug-in principle:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#count number of columns in the datasets&#xA;N &amp;lt;- ncol(x)&#xA;&#xA;#create vector of ones&#xA;In &amp;lt;- rep(1,N)&#xA;&#xA;#calculate covariance&#xA;covariance &amp;lt;- cov(x)&#xA;&#xA;#calculate mean returns&#xA;mu &amp;lt;- colMeans(x)&#xA;mu &amp;lt;- t(t(mu))&#xA;&#xA;#use the plug-in principle&#xA;&#xA;xt &amp;lt;- solve(covariance) %*% mu&#xA;mean.var &amp;lt;- as.vector(xt) / abs(In %*% xt)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to know: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Is this the correct way to implement the mean variance strategy?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How can I incorporate a risk-aversion parameter in this framework?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="18609" LastActivityDate="2016-01-15T16:03:47.313" Title="Calculate mean variance portfolio" Tags="&lt;r&gt;&lt;modern-portfolio-theory&gt;&lt;mean-variance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22661" PostTypeId="2" ParentId="22634" CreationDate="2016-01-08T12:20:43.603" Score="2" Body="&lt;p&gt;This doesn't really suffice as an existence proof, but you can start with a series of mathematical results collectively known as &lt;a href=&quot;http://ti.arc.nasa.gov/m/profile/dhw/papers/78.pdf&quot; rel=&quot;nofollow&quot;&gt;no free lunch theorems&lt;/a&gt;. The linked paper proves the average performance of any optimization algorithm over arbitrary problem domains is independent of the algorithm. That is, no single algorithm can ever be better than others on any problem, meaning optimal performance over any single problem domain requires some level of domain knowledge, and knowledge has to be learned. Learning requires inference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From there, you can look into &lt;a href=&quot;http://users.cms.caltech.edu/~venkatc/csh_compinf_preprint10.pdf&quot; rel=&quot;nofollow&quot;&gt;Complexity of Inference in Graphical Models&lt;/a&gt;, which gets at the intractability of inference. The linked paper expands upon an earlier result from 2007 reducing maximum a posteriori estimation on graphical models with unbounded treewidth to a general constraint satisfaction problem that cannot be solved in polynomial time unless P = NP, in this case proving that even an efficient approximate inference scheme does not exist, by reduction to graph partitioning. This does not mean no such algorithm exists, of course. Exact Bayesian inference is computable. It's just not efficiently computable. This applies to any non-parametric discrete distribution with more than pairwise conditional dependencies, which covers any true empirical sampling distribution, which is to say, you can efficiently compute MAP estimators if you assume the market movements you're trying to beat take on a particular parametric form, but since they don't in reality, you can't. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this is at least close to what you're looking for. It seems like what you're getting at is the intuitive result that beating any possible movement requires you to perfectly predict the future. Nothing in this answer applies in a situation like what g g posted where you know the price generating process, so you can predict the future (you don't need an infinite-bankroll Martingale strategy if the coin is biased). It just proves you can't efficiently approximate the most likely future over any real-world price generating process. Not to say you can't try and get a good enough estimator over a sufficiently inefficient market, of course, which is what I try to do every single day.&lt;/p&gt;&#xA;" OwnerUserId="18669" LastActivityDate="2016-01-08T12:20:43.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22662" PostTypeId="2" ParentId="22634" CreationDate="2016-01-08T13:37:28.037" Score="1" Body="&lt;p&gt;I would consider analyzing the wins of a sample of trading systems over random intervals of time (i.e. minutes, hours, days, months, years). It could be theorized that each trading system has a “win rate” between 0 and 1. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is expected that your sample of trading systems and their “win rates” would follow a logit function with the “win rate” coming close to, but never approaching, 0 or 1. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/zjGup.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/zjGup.png&quot; alt=&quot;Logit Function&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: A large amount of data over an extended period of time would be needed to control for trading systems achieving a 100% win rate by chance.&lt;/p&gt;&#xA;" OwnerUserId="18911" LastActivityDate="2016-01-08T13:37:28.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22663" PostTypeId="2" ParentId="22625" CreationDate="2016-01-08T13:51:43.440" Score="0" Body="&lt;p&gt;Suppose you have two stocks, perfectly correlated, both initially at 100, but one has exactly twice the dollar standard deviation of the other.  Then the payouts of a $100 call are exactly in a 2:1 ratio for every possible path.   Notes: (1) I've assumed both spot and forward price are 100   (2) this doesn't strictly hold if the distribution is not Normal, but I think the intuition is ok.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-01-08T13:51:43.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22664" PostTypeId="2" ParentId="22624" CreationDate="2016-01-08T14:00:59.793" Score="2" Body="&lt;p&gt;Most traders have no idea what N(d2) is.  I see two possibilities (a) they're using the delta of the option for the relevant strike, as seen by whatever model they're using, or (b) they are pricing a digital put on the yuan, using the full skew structure (as a former trader, that's the way I'd do it).&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-01-08T14:00:59.793" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22666" PostTypeId="1" CreationDate="2016-01-08T17:58:25.913" Score="1" ViewCount="38" Body="&lt;p&gt;I'm wondering whether there would be a change to my answer of the change in portfolio when there is a new stock introduced.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My investment strategy is to maximise expected return such that my standard deviation is not more than 15%. Suppose I believe in CAPM (so I should hold a combination of the market portfolio and the riskless asset). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The original expected return of the market is 0.10, standard deviation is 0.20.&#xA;The expected return of the riskless asset is 0.03. The new stock that was introduced has an expected return of 0.168 and a standard deviation of 0.30. The correlation of this stock with the market is 0.20.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming the new stock now gives a higher rate of return ($r=0.168$) than the required rate of return that was calculated from CAPM. How would this change my existing strategy in allocating my portfolio. My existing portfolio is a combination of the original market portfolio ($w_1=0.75$) and the riskless asset ($w_2=0.25$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think that this would change my strategy as I would consider recalculating my market portfolio. This is suggesting that the original market portfolio is now considered as &quot;risky asset 1&quot; and the new stock is &quot;risky asset 2&quot;. Using the two-fund separation approach, a new tangency portfolio is calculated and is different from the existing portfolio. I am concerned that the strategy would not change because the change in price in the new stock may not affect the existing market portfolio.&lt;/p&gt;&#xA;" OwnerUserId="18916" LastActivityDate="2016-01-08T17:58:25.913" Title="Change in portfolio when IPO announced" Tags="&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;&lt;capm&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22667" PostTypeId="2" ParentId="22624" CreationDate="2016-01-08T18:55:32.310" Score="1" Body="&lt;p&gt;there is nothing to do with implied distribution from option prices calculated with Breeden-Litzenberer approach. this distribution is &quot;risk-neutral&quot; not &quot;real&quot;. consider this as a sort of theoretical and artificial, regarding to real disribution, idea. in the article the author wrote about demand for puts. so they/she calculated these probabilities from outstanding notional of different options with respect to each other. put/call ratio, open interest for given strike / total open interest etc. these &quot;probabilities&quot; are just a proxy. for example, you see OI for puts for strike=7 jumped significantly, does it mean that someone bets on exchange rate decline? well, no. there are several possible reasons for this to happen. for example someone hedges his position in calls, or someone buys risk reversals (buy call, sell put). so you buy puts, market makers sells them to you and delta-hedges at same moment... no bets on downside.&lt;/p&gt;&#xA;" OwnerUserId="18855" LastActivityDate="2016-01-08T18:55:32.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22668" PostTypeId="2" ParentId="22621" CreationDate="2016-01-08T19:09:45.937" Score="1" Body="&lt;p&gt;first question, are you talking about continuous or discrete barrier? they difference is very important. when you price cont barrier with MC you actually cannot observe stock continuously you observe it discretely. the latter cause mispricing. so you have to make adjustment to your price. or you can price your barrier with simulation brownian bridge: you simulate terminal stock price then calculate probability that random variable (process) crosses barrier given initial and terminal stock prices, time and vol. there is some nice research paper on this topic, but i dont remember its name and authors. just google pricing barriers with brownian bridge, or the problem continuous vs dicrete&lt;/p&gt;&#xA;" OwnerUserId="18855" LastActivityDate="2016-01-08T19:09:45.937" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22669" PostTypeId="2" ParentId="22625" CreationDate="2016-01-08T19:20:24.177" Score="4" Body="&lt;p&gt;Suppose S = 100, and K = 100. Imagine it is 1 second prior to expiry. And only two outcomes are possible UP or Down. Sup = 101 and Sdow = 99. Your call will pay either 1 or 0 with 50% probability. Thus price of option is 0.50&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, imagine same situation but with higher vol. Sup = 102 and Sdow = 98. Same proba, thus price of call is 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Repeat with higher vol: Sup = 104, Sd = 96. Call is 2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see it increases linearly with vol, cause the down leg always gives you zero. &lt;strong&gt;And the payout on the upside is linearly increasing with vol.&lt;/strong&gt;&#xA;(clearly not a mathematically sophisticated answer, but at least paints the picture)&lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2016-01-08T19:20:24.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22670" PostTypeId="2" ParentId="22625" CreationDate="2016-01-08T20:58:46.810" Score="0" Body="&lt;p&gt;For an ATM call option, the vega is given by&#xA;\begin{align*}&#xA;\frac{\partial C}{\partial \sigma} &amp;amp;= SN'(d_1)\sqrt{T}\\&#xA;&amp;amp;=\frac{1}{\sqrt{2\pi}}S\,e^{-\frac{d_1^2}{2}}\sqrt{T}\\&#xA;&amp;amp;=\frac{1}{\sqrt{2\pi}}S\,e^{-\frac{\sigma^2}{8}T}\sqrt{T}.&#xA;\end{align*}&#xA;Then, the volga is given by&#xA;\begin{align*}&#xA;\frac{\partial^2 C}{\partial \sigma^2} &amp;amp;=-\frac{1}{4\sqrt{2\pi}}S\,e^{-\frac{\sigma^2}{8}T} \sigma\, T^{3/2},&#xA;\end{align*}&#xA;which is negative. That is, the vega does not increase with the volatility. Depending on the magnitude of $S$, $\sigma$, and $T$, the volga does not have to be insignificant. For example, for $S=100$, $\sigma=0.35$, and $T=5$,&#xA;\begin{align*}&#xA;\frac{\partial^2 C}{\partial \sigma^2} \approx -36.15,&#xA;\end{align*}&#xA;which does not appear small.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-01-08T20:58:46.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22671" PostTypeId="2" ParentId="22634" CreationDate="2016-01-08T22:16:37.903" Score="1" Body="&lt;p&gt;Possibly a misunderstanding from my side. I understood that a formal proof of the not-existence of a &quot;blameless&quot; algorithm was asked. My approach was first to create a bitstream from price data for ex. if(price_n &gt; price_n-1 ) then bit_n=1 else bit_n=0. Then it obvious that a formal proof is only possible if the bitstream is &quot;Kolmogorov-compressible&quot;. Thus i did not make any assumptions such as inefficient market. As for real markets i think that with the end of QE and with the implementation of funds rate hike by shifting excess liquidity to money market funds the stock market will enter efficient market. &lt;/p&gt;&#xA;" OwnerUserId="18891" LastActivityDate="2016-01-08T22:16:37.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22673" PostTypeId="1" CreationDate="2016-01-09T06:00:54.353" Score="1" ViewCount="368" Body="&lt;p&gt;I've been doing market making on forex using the last look feature so far. &#xA;Now we are moving to do on firm making, but I'm kind of lost. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To do firm making we need to post resting orders (currenex or integral), how does it work exactly? &#xA;Anyone with experience in this area? Any additional information? &lt;/p&gt;&#xA;" OwnerUserId="13990" LastEditorUserId="13990" LastEditDate="2016-01-31T22:51:18.693" LastActivityDate="2016-01-31T22:51:18.693" Title="Fx Firm market making" Tags="&lt;market-data&gt;&lt;fx&gt;&lt;market-microstructure&gt;&lt;market-making&gt;&lt;market-model&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22675" PostTypeId="1" AcceptedAnswerId="22678" CreationDate="2016-01-09T13:24:10.730" Score="1" ViewCount="740" Body="&lt;p&gt;I am working on something to analyze European stocks and I need some historical data on bid and ask prices. Ideally I would like something like CRSP database for US stocks. Is there some similar source or database for European stocks? I spent hours on google but didn't find anything useful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="15219" LastActivityDate="2016-01-09T15:20:19.437" Title="Bid and Ask Data for european stocks" Tags="&lt;data&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22676" PostTypeId="1" AcceptedAnswerId="22708" CreationDate="2016-01-09T13:48:21.450" Score="3" ViewCount="2437" Body="&lt;h1&gt;Hello everybody,&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I was already searching a lot of forums and read a huge amount of different papers. But I guess I am to stupid or I am at a loss. Hopefully some of you are able to help me out. Here is the description.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;What I have so far&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The aim is to perform a volatility analysis on daily stock prices by incorporating possible structural breaks into a GARCH(1,1) model This is already performed several times in the past (see e.g. &lt;a href=&quot;http://www.jstor.org/stable/2676245?seq=1#page_scan_tab_contents&quot; rel=&quot;nofollow&quot; title=&quot;Volatility in Emerging Stock Markets&quot;&gt;Volatility in Emerging Stock Markets&lt;/a&gt; or &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S1042444X0200052X&quot; rel=&quot;nofollow&quot;&gt;Sudden changes in variance and volatility persistence in foreign exchange markets&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The approach is identical and as follows:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;At first the log returns are calculated from the daily stock prices (no problem)&lt;/li&gt;&#xA;&lt;li&gt;Then the ICSS approach from Inclan[I am not able to post more than two links - ] is applied to find structural break points. (Implementation from Matlab is used, is there a faster way or other program to use? Matlab is on daily data so slow that some series are not able to be completely calculated.)&lt;/li&gt;&#xA;&lt;li&gt;The next step would be the integration into the GARCH model, but I do not know how:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;GARCH(1,1)&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The combined model with GARCH(1,1) and dummy variables is given by&#xA;$ Y_t= \mu +e_t, e_t|I_{t-1} approx. N(0,h_t)\\$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ h_t=\omega +d_1D_1+\cdots+d_nD_n+\alpha e_{t-1}^2+\beta h_{t-1}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $D_1,\cdots,D_n $ are the dummy variables taking a value of one from each point&#xA;of sudden change of variance onwards, zero elsewhere&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do understand what $D_1$ is but I habe no idea what $d_1$ is? Further I want to incorporate different return series to analyse the dependance  (like precious metal returns to oil and stock indices (Volatility Analysis of Precious Metals Returns and Oil Returns - Lucia Morales 2011).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I would have $ Y_t = \mu +\delta_1X_{t-1}+\delta_2 Z_{t-1}+e_t $ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $ Y_t = $ Precious Metals Returns (Gold, Silver and Platinum), &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_t=$ Stock Markets Returns and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Z_t=$ Crude Oil Brent. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I am right, this is a multiple regression which must be performed in first place, no? But how do I do this?&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;So can anybody help me?&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;I calculated the normal GARCH(1,1) with one return series already in Matlab, but have no idea how to continue.&#xA;Can anybody help me? Because I am not able to incorporate my breakpoint results into the GARCH model. I really appreciate any help. Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="17194" LastActivityDate="2016-02-10T19:23:14.220" Title="How to implement dummy variables into GARCH(1,1) model from structural breaks (ICSS)" Tags="&lt;garch&gt;&lt;econometrics&gt;&lt;matlab&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22678" PostTypeId="2" ParentId="22675" CreationDate="2016-01-09T14:52:02.863" Score="1" Body="&lt;p&gt;You can get historical end-of-day European Bid Ask Data with Datastream ( Symbol BID, ASK) and also with Bloomberg ( Symbols: PX_BID, PX_ASK).These are daily closing bid and ask prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that Bloomberg also offers &lt;strong&gt;intraday&lt;/strong&gt; bid ask data for the last 140 days. &lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2016-01-09T15:20:19.437" LastActivityDate="2016-01-09T15:20:19.437" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22684" PostTypeId="2" ParentId="22673" CreationDate="2016-01-10T13:27:10.020" Score="3" Body="&lt;p&gt;Whereas when you marketmake on a last-look basis:&#xA;- You, the marketmaker, are sending indicative prices to the ECN&#xA;- The &lt;strong&gt;ECN&lt;/strong&gt;  sends orders to you and is at risk (since you have the option to reject, hopefully rarely)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you marketmake on a no-last-look (NLL) basis:&#xA;- the ECN is sending indicative prices &#xA;- You, the &lt;strong&gt;marketmaker&lt;/strong&gt;, send orders to the ECN and you are at risk unless you cancel such orders (and your ability to do so depends on the reaction time of your model, latency between you and the ECN and the ECN reaction time). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some ECNs provide only one API both for taking and NLL marketmaking. On those you are using their standard API that allows aggressive orders (IOCs) and passive, resting orders (e.g. GTCs). You, as an NLL marketmaker are just using the GTC order types and sending cancels every time you wish to change or cancel your price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other ECNs do provide a separate API for NLL marketmaking, a significant feature being that you will not match with other marketmakers.  If you contact me directly (my contacts should be visible in my profile) I can explain which are which. &lt;/p&gt;&#xA;" OwnerUserId="5161" LastActivityDate="2016-01-10T13:27:10.020" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22685" PostTypeId="1" AcceptedAnswerId="24707" CreationDate="2016-01-10T14:03:09.980" Score="4" ViewCount="1919" Body="&lt;p&gt;I want to obtain a simulation of one-step ahead forecasts of stock returns process governed by &lt;strong&gt;ARMA(1,0)-GARCH(1,1)&lt;/strong&gt; process. The returns are of form:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$x_t = \mu + \delta x_{t-1} + \sigma_t z_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From my GARCH model I can forecast the conditional mean $\mu + \delta x_{t-1}$ and the conditional standard deviation $\sigma_t$. Let's assume that the distribution of $z_t$ is Gaussian.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So now I am wondering how to obtain the simulation of the stock returns using the above-described approach. My initial solution would be to simulate a number of random variables from the Gaussian distribution $N(0,1)$ and then create my one-step ahead forecast simulations as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;conditional mean (from time $t+1$) + $N(0,1)$ random variable * conditional standard deviation (from time $t+1$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;edit&lt;/strong&gt;: what is in case of the Gaussian distribution equivalent to:&#xA; $x_{t+1} \sim N((\mu + \delta x_{t}) ,\sigma_{t+1})$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this approach for simulating one-step ahead forecasts of stock returns appropriate? I need those simulations to create asset allocation strategies.&lt;/p&gt;&#xA;" OwnerUserId="17464" LastEditorUserId="17464" LastEditDate="2016-03-05T16:41:12.387" LastActivityDate="2016-03-05T17:17:07.777" Title="Simulating returns from ARMA(1,0)-GARCH(1,1) model" Tags="&lt;monte-carlo&gt;&lt;garch&gt;&lt;forecasting&gt;&lt;simulations&gt;&lt;asset-allocation&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22686" PostTypeId="1" AcceptedAnswerId="22687" CreationDate="2016-01-10T16:57:22.320" Score="-1" ViewCount="71" Body="&lt;p&gt;Does the divergence from MACD is the same well known from &lt;a href=&quot;https://en.wikipedia.org/wiki/Divergence&quot; rel=&quot;nofollow&quot;&gt;Math&lt;/a&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the connection?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;" OwnerUserId="18094" LastActivityDate="2016-01-10T17:28:02.147" Title="Technical indicator MACD - Does the D stands for the Math divergence?" Tags="&lt;technical-analysis&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2016-01-11T17:55:13.813" ContentLicense="CC BY-SA 3.0" />
  <row Id="22687" PostTypeId="2" ParentId="22686" CreationDate="2016-01-10T17:28:02.147" Score="2" Body="&lt;p&gt;divergence as in &quot;moving away from&quot;, alternatively &quot;difference between X and Y getting bigger&quot;.&lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2016-01-10T17:28:02.147" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22688" PostTypeId="2" ParentId="22614" CreationDate="2016-01-10T18:31:54.973" Score="0" Body="&lt;p&gt;I think there is something that has not been mentioned.&#xA;&quot;price&quot; is used as the x variable instead of &quot;change in price&quot; or return. This could be a problem, as price itself is non stationary, causing problem to statistical properties. With that being said, correlation is an inflated indicator here, exaggerating their relations. In Heston's model, indeed, the correlation is between return and volatility change.&lt;/p&gt;&#xA;" OwnerUserId="16167" LastActivityDate="2016-01-10T18:31:54.973" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22690" PostTypeId="1" AcceptedAnswerId="22710" CreationDate="2016-01-10T19:13:27.513" Score="0" ViewCount="201" Body="&lt;p&gt;I built a trading strategy that is based on a pool of all the symbols available on NYSE, Nasdaq, and AMEX. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't like the idea of trading symbols that are ETFs. For example, the symbol TVIX, which is some velocity shares 2x leveraged bull****, is not something that I want to trade. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a list maintained somewhere of the symbols on these exchanges, and which ones represent ETFs or other funds? I've looked all over the place and can't seem to find anything that differentiates symbols in this way.&lt;/p&gt;&#xA;" OwnerUserId="17221" LastActivityDate="2016-01-14T01:48:26.680" Title="Stock Symbols: ETFs vs Real Companies" Tags="&lt;equities&gt;&lt;automated-trading&gt;&lt;etf&gt;" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="22691" PostTypeId="2" ParentId="22690" CreationDate="2016-01-10T21:59:38.833" Score="0" Body="&lt;p&gt;I use &lt;a href=&quot;http://etfdb.com/etfs/&quot; rel=&quot;nofollow&quot;&gt;http://etfdb.com/etfs/&lt;/a&gt; the ETF Database.  It gives a large amount of data including: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a rating of the ETF, &lt;/li&gt;&#xA;&lt;li&gt;Alternatives, &lt;/li&gt;&#xA;&lt;li&gt;Holdings, Expenses &amp;amp; Fees, &lt;/li&gt;&#xA;&lt;li&gt;Performance, &lt;/li&gt;&#xA;&lt;li&gt;Charts, &lt;/li&gt;&#xA;&lt;li&gt;Valuation, &lt;/li&gt;&#xA;&lt;li&gt;Dividend, &lt;/li&gt;&#xA;&lt;li&gt;Technicals, &lt;/li&gt;&#xA;&lt;li&gt;Fact Sheet, &lt;/li&gt;&#xA;&lt;li&gt;Read Next, and more. &#xA;You can go through ETFs on this website by category.  Also after initial worked of creating a &quot;master list&quot; that you want to follow, you should be able create software for getting data from this site... &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You can also download a file the screening results on the website -- see &quot;use our ETF sceener&quot;.  There it also allows you to pick 1) types of ETFs of interest (e.g. bonds, commodities, equities, etc) 2) Size and type of companies can be specified. 3) specify the &quot;attributes &quot; (e.g. commission free, leveraged, inverse, etc).  You just have sign up to download a .csv file the results of your screening and that is free! &lt;/p&gt;&#xA;" OwnerUserId="18937" LastEditorUserId="18937" LastEditDate="2016-01-14T01:48:26.680" LastActivityDate="2016-01-14T01:48:26.680" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="22692" PostTypeId="1" CreationDate="2016-01-10T23:06:38.470" Score="-1" ViewCount="1279" Body="&lt;p&gt;I've looked all over and can't seem to get a clear idea of how to do this; I have ts data with quarterly frequencies. I simply want to add a dummy variable only for the data corresponding to Q4 but I can't seem to make this work. I thought subset may be correct however I get an error that datasets are of different length when I try and regress data~trend+subset. I ran into a similar problem when trying to use the as.factor approach. I'm a newbie to R so any help would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="18557" LastActivityDate="2017-09-05T00:50:29.963" Title="adding dummy variable to ts object in r for particular quarter" Tags="&lt;time-series&gt;&lt;dummy&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22693" PostTypeId="1" CreationDate="2016-01-11T00:00:48.157" Score="2" ViewCount="313" Body="&lt;p&gt;given&#xA; $S^1$ satifying the SDE $\quad dS_{t}^{1}=S_{t}^{1}((r+\mu)dt + \sigma dW_t), \quad S_{0}^{1}=1 $ &#xA;&lt;br&gt;&#xA;and the safe asset $S_{t}^{0}$  $\quad S_{t}^{0}:=e^{rt} \quad for \quad r\geq 0$&#xA;&lt;br&gt; &#xA;&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q1.&lt;/strong&gt;&lt;br&gt; how to show that  $\quad Y_t:=log(S_{t}^{1})$ &lt;br&gt; satisfies &#xA;$\quad dY_t=(r+\mu-\sigma^2/2)dt+\sigma d W_t \quad Y=0$,  &lt;br&gt; &lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q2.&lt;/strong&gt; &lt;br&gt;&#xA;how to find a measure Q equivalent to P (using Girsanov Theorem) such that &lt;br&gt;&#xA;$dS_{t}^{1}=S_{t}^{1}(rt+\sigma d W_{t}^{*})$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried the fist part, is the derivation correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{ d S_{t}^{1}}{S_{t}^{1}}=(r+\mu)dt+\sigma dW_t$&#xA;&lt;br&gt;&#xA;$dY=d log(S_{t}^{1})$ &lt;br&gt;&#xA;by Ito &lt;br&gt;&#xA;$d log(S_{t}^{1})=\ \frac{ d S_{t}^{1}}{S_{t}^{1}} + \frac{1}{2}(-\frac{1}{(S_{t}^{1})^2})(d S_{t}^{1})^2)=$&#xA;$=\ \frac{ d S_{t}^{1}}{S_{t}^{1}} + (- \frac{1}{2}  \frac{(\sigma S_{t}^{1})^2)dt}{(S_{t}^{1})^2 }) = &#xA;(r+\mu)dt + \sigma dW_t + (- \frac{1}{2} \sigma^2 dt)  =(r+\mu-\sigma^2/2)dt+\sigma dW_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am struggling with the measure change, could anybody help and explain the idea and the next steps?&lt;/p&gt;&#xA;" OwnerUserId="18670" LastEditorUserId="18670" LastEditDate="2016-01-11T15:32:26.760" LastActivityDate="2016-05-13T17:22:37.967" Title="Ito calculus problem" Tags="&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;&lt;itos-lemma&gt;" AnswerCount="2" CommentCount="8" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22694" PostTypeId="1" AcceptedAnswerId="22697" CreationDate="2016-01-11T08:34:59.277" Score="0" ViewCount="1343" Body="&lt;p&gt;From my understanding, the annualized standard deviation of daily returns is generally higher than of annualized standard deviation of weekly returns is generally higher than.... monthly...quarterly... year standard deviation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is... when is this general rule not true? What would need to happen? or what would the portfolio look like where the longer time frame annualized has a higher standard deviation than the shorter term annualized standard deviation? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could people give some examples and explanations please&lt;/p&gt;&#xA;" OwnerUserId="15482" LastEditorUserId="2587" LastEditDate="2016-01-11T12:43:29.667" LastActivityDate="2016-05-11T10:09:15.113" Title="Estimation of annualized volatility depending on data frequency - exceptions to the general rule?" Tags="&lt;volatility&gt;&lt;returns&gt;&lt;standard-deviation&gt;&lt;time&gt;" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22696" PostTypeId="2" ParentId="22694" CreationDate="2016-01-11T08:55:25.660" Score="1" Body="&lt;p&gt;It is most common to use the &quot;square root of time&quot; method to scale volatility (i.e. standard deviation of returns) to a year (annualize it) if needed, i.e. if the estimate is based on a sample with higher frequency (daily, weekly,..).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mathematically this requires the underlying stochastic process $(X_t)_{t\in T}$ (I've omitted some technical prerequisites here) to be i.i.d., meaning the random variables $X_t$ have the same distribution and are independent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far for the theory but in practice this is quite often not the case meaning stochastic independence cannot be assumed. For example the empirical time series exhibit autocorrelation which is a hint for some kind of dependence.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would suggest the paper of Diebold as a starting point for further reading:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Converting 1-Day Volatility to h-Day Volatility: Scaling by $\sqrt t$ is Worse than You Think.&lt;/em&gt; Wharton Financial Institutions Center, Working Paper 97-34.&lt;/p&gt;&#xA;" OwnerUserId="17281" LastActivityDate="2016-01-11T08:55:25.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22697" PostTypeId="2" ParentId="22694" CreationDate="2016-01-11T12:19:40.197" Score="1" Body="&lt;p&gt;In the set of an index where all insturments are traded in the same time zone I would agree that vola pa from say weekly returns is lower than from daily returns. &#xA;Besides this, the distribution of weekly returns should look &quot;more&quot; Gaussian than the one of daily returns. This is called aggregational Gaussianity e.g. in the paper by &lt;a href=&quot;http://www.skokholm.co.uk/wp-content/uploads/2013/02/UAR.pdf&quot; rel=&quot;nofollow&quot;&gt;Rogers and Zhang&lt;/a&gt;. The term &quot;more Gaussian&quot; can be concretized that excess-kurtosis tends to decrease.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However if you can assume that the assets traded have closing prices taken at some quite different point in time (e.g. US and JP) then correlations will be underestimated. Thus in a long-only portfolio (or an index) volatility will increase if you use weekly returns as this mismatch does not matter that much with weekly returns.&#xA;On the other hand a short position could hedge more effectively observing weekly returns.&#xA;Finally if you have to convert foreign stocks to your home currency you have to take the &quot;closing price&quot; of the currency. Again the choice of the point in time matters less with weekly returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at ADR/GDRs and the local stocks also show weak correlations on a daily basis whereas on a weekly basis they show a correlation close to one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These phenomena lead to auto-correlation in portfolio/index return time series.&#xA;These auto-correlations are reduced if one passes to lower-frequency time series (e.g. weekly) or they should be adressed as we do it in our &lt;a href=&quot;http://de.arxiv.org/abs/1009.3638&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2016-01-12T08:11:47.883" LastActivityDate="2016-01-12T08:11:47.883" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22698" PostTypeId="2" ParentId="21977" CreationDate="2016-01-11T13:54:52.890" Score="0" Body="&lt;p&gt;You ask what to do &quot;if risk-neutral pricing does not hold&quot;.  By this I assume you mean that the price of an option is not equal to its expected value under the risk neutral probabilities (these are the probabilities that are calculated by enforcing the condition tha the expected return on the stock is the risk free rate, which can only exist if d &amp;lt;1+r&amp;lt; u).   So the answer is that there is a combination of one option and k stocks, where k is a number to be calculated, which produces a guaranteed return different from the risk free rate.  If the option price is too high you would sell the option versus the stock hedge, and if the option price is too low you would buy it versus a stock hedge.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-01-11T13:54:52.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22699" PostTypeId="1" CreationDate="2016-01-11T14:12:22.983" Score="1" ViewCount="332" Body="&lt;p&gt;I would like to implement Andersen scheme for Heston simulation. On the following snipped is my code for generating asset path:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;double dt = option-&amp;gt;T / static_cast&amp;lt;double&amp;gt;(size);&#xA;&#xA;double k0, k1, k2, k3, k4, gamma1, gamma2;&#xA;&#xA;gamma1 = 0.5;&#xA;gamma2 = 0.5;&#xA;&#xA;k0 = -dt * (rho * kappa * theta) / (epsilon);&#xA;k1 = gamma1 * dt * (((kappa * rho) / epsilon) - 0.5) - (rho / epsilon);&#xA;k2 = gamma2 * dt * (((kappa * rho) / epsilon) - 0.5) + (rho / epsilon);&#xA;k3 = gamma1 * dt * (1 - pow(rho,2));&#xA;k4 = gamma2 * dt * (1 - pow(rho,2));&#xA;&#xA;for (int i = 1; i &amp;lt; size; i++) {&#xA;&#xA;    double normalRandom = normalDist(generator);&#xA;    spotPath[i] = spotPath[i - 1] * exp(option-&amp;gt;r * dt + k0 + k1 * volPath[i - 1] + k2 * volPath[i] +&#xA;                                                (sqrt(k3 * volPath[i - 1] + k4 * volPath[i]) * normalRandom));&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, when I simulate this and compare to Euler scheme I got around 20% lower option value. I think that mistake is here (not in simulating volatility path), because when I make Euler scheme for asset and Andersen scheme for volatility, the option value is more less correct.&#xA;Do you see any mistake in my code?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&#xA;My Heston model:&#xA;$$dS(t)  = r S(t) dt + \sqrt{v(t)} S(t) dW^S(t)$$&#xA;$$dv(t)  = \kappa (\theta - v(t))dt + \varepsilon \sqrt{v(t)} dW^v(t)  $$&#xA;$$Cov[dW^S(t), dW^v(t)] = \rho dt $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Andersen scheme (asset path):&#xA;$$\hat{S}(t + \Delta) = \hat{S}(t) * exp(r \Delta + K_0 + K_1 \hat{v}(t) +  K_2 \hat{v}(t+\Delta)&#xA;                    + \sqrt{K_3 \hat{v}(t) +  K_4 \hat{v}(t+\Delta)} \cdot Z)$$&#xA;where: &#xA;    $$K_0 = - \frac{\rho \kappa \theta}{\varepsilon} \Delta$$&#xA; $$K_1 = \gamma_1 \Delta \left(  \frac{\kappa \rho}{\varepsilon}  - \frac{1}{2}  \right) - \frac{\rho}{\varepsilon}$$&#xA;  $$K_2 = \gamma_2 \Delta \left(  \frac{\kappa \rho}{\varepsilon}  - \frac{1}{2}  \right) + \frac{\rho}{\varepsilon}$$&#xA;   $$K_3 = \gamma_1 \Delta (1 - \rho^2)$$&#xA;   $$K_4 = \gamma_2 \Delta (1 - \rho^2)$$&lt;/p&gt;&#xA;" OwnerUserId="5079" LastEditorUserId="5079" LastEditDate="2016-01-11T22:29:51.590" LastActivityDate="2016-01-11T22:29:51.590" Title="Heston model - Andersen scheme implementation" Tags="&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;stochastic-volatility&gt;&lt;heston&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22702" PostTypeId="1" CreationDate="2016-01-11T15:46:15.530" Score="3" ViewCount="1074" Body="&lt;p&gt;I am studying a textbook of statistics / econometrics, using Python for my computational needs. I have encountered GARCH models and my understanding is that this is a commonly used model.&#xA;In an exercise, I need to fit a time series to some exogenous variables, and allow for GARCH effects. I looked but found no package in Python to do it. I found &lt;a href=&quot;https://pypi.python.org/pypi/arch/3.0&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; but I think it only supports 1 exogenous variable - I have a bunch of them. This surprises me because I thought this would be something that some quants do every other day... Have I been looking in the wrong places?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much&lt;/p&gt;&#xA;" OwnerUserId="18947" LastActivityDate="2021-02-02T16:01:45.210" Title="How to fit exogenous + GARCH Model In Python?" Tags="&lt;time-series&gt;&lt;garch&gt;&lt;econometrics&gt;&lt;estimation&gt;&lt;python&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22703" PostTypeId="1" CreationDate="2016-01-11T15:58:08.150" Score="2" ViewCount="111" Body="&lt;p&gt;I am looking for references, information, backtests etc. about &lt;a href=&quot;https://en.wikipedia.org/wiki/Market_neutral&quot; rel=&quot;nofollow noreferrer&quot;&gt;market neutral&lt;/a&gt; portfolios that go &lt;em&gt;long the index&lt;/em&gt; and &lt;em&gt;short stocks of that index with high unsystematic (idiosyncratic) risk&lt;/em&gt;. The idea is to isolate and profit from the unsystematic risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interestingly enough I couldn't find anything on this specific strategy but it might be that I have been looking in the wrong places or that this strategy doesn't make any sense whatsoever.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; See my answer here how the unsystematic risk of a single stock can be calculated: &lt;a href=&quot;https://quant.stackexchange.com/a/31497/12&quot;&gt;https://quant.stackexchange.com/a/31497/12&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-12-14T20:47:45.187" Title="References about market neutral portfolios that isolate unsystematic risk" Tags="&lt;quant-trading-strategies&gt;&lt;hedging&gt;&lt;reference-request&gt;&lt;longshort&gt;&lt;market-neutral&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22705" PostTypeId="2" ParentId="22625" CreationDate="2016-01-11T16:30:45.707" Score="1" Body="&lt;p&gt;Consider the graph of price vs implied volatility of an at-the-money call option.  At 0 volatility, the price is zero, as with zero vol the spot remains constant and finishes at the strike for zero payoff.  For low volatilities, there is a famous approximation that call value is about $0.4 S \sigma \sqrt T.$  That gives the graph initially increasing linearly with a slope $0.4 S \sqrt T.$  But for very high vol, there is a no-arbitrage limit that the price of the call cannot be higher than the price of the underlying.  So the graph must asymptote to being flat at $S$ as volatility goes to infinity.  The slope of this graph is vega.  So vega is positive (about $0.4 S \sqrt T$) for low vol but decreases to $0$ in the limit as vol goes to infinity.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2016-01-11T16:30:45.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22706" PostTypeId="1" CreationDate="2016-01-11T17:19:13.050" Score="1" ViewCount="452" Body="&lt;p&gt;I'll enter into details of both, sooner or later, but for the moment I'm concerned about the differences (and relationships, if any) between these two theories. Can someone give me a brief, but still a little technical, explanation of the divergences (common points) of these theories? &#xA;Thank you all.&lt;/p&gt;&#xA;" OwnerUserId="18694" LastEditorUserId="18694" LastEditDate="2016-01-11T20:29:35.290" LastActivityDate="2016-01-11T20:29:35.290" Title="Large deviations theory and extreme value theory" Tags="&lt;risk-management&gt;&lt;probability&gt;&lt;distribution&gt;&lt;value-at-risk&gt;&lt;finance-mathematics&gt;" AnswerCount="0" CommentCount="11" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22707" PostTypeId="1" CreationDate="2016-01-11T18:55:32.610" Score="1" ViewCount="114" Body="&lt;p&gt;&lt;strong&gt;The Setup:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Suppose I know the yield curve of a Bond satisfies:&#xA;f (0, t) = 0.04 for t ≥ 0 and&#xA;f (ω, 1, t) = 0.06, t ≥ 1, ω = ω 1 ,&#xA;0.02, t ≥ 1, ω = ω 2 ,&#xA;where Ω = {ω 1 , ω 2 } with P[ω i ] &gt; 0, i = 1, 2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And suppose that I know the matrix:&#xA;$\begin{pmatrix}&#xA;P (0, 1) &amp;amp; P (0, 2) &amp;amp; P (0, 3)\\&#xA;P (ω_1 , 1, 1) &amp;amp; P (ω_1 , 1, 2)&amp;amp;  P (ω_1 , 1, 3) \\&#xA;P (ω_2 , 1, 1) &amp;amp; P (ω_2 , 1, 2) &amp;amp; P (ω_2 , 1, 3)&#xA;\end{pmatrix}&#xA;=&#xA;\begin{pmatrix}&#xA;e^{-0.04}&amp;amp;e^{-0.04}&amp;amp;e^{-0.04}\\&#xA;1&amp;amp;e^{-0.06}&amp;amp;e^{-0.12} \\&#xA;1&amp;amp;e^{-0.02}&amp;amp;e^{-0.04}&#xA;\end{pmatrix}&#xA;$ is invertible (for example, I have shown that it's determinant is roughly equal t$0.0004258212$).  &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The Question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I show that there exists an arbitrage opportunity using the above matrix and the following value process:\&#xA;\begin{align}&#xA;V (ω_1 , 1) = &amp;amp; 1 = V (ω_2 , 1)\\&#xA;V(ω_1 ,0) = &amp;amp; 0 = V(ω_2 ,0).  &#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Context:&lt;/strong&gt;&#xA;This example is supposed to help motivate why parallel shifts along yield curves yields arbitrage opportunities.  &lt;/p&gt;&#xA;" OwnerUserId="11582" LastEditorUserId="11582" LastEditDate="2016-01-11T20:00:04.547" LastActivityDate="2017-03-21T23:45:13.563" Title="HJM model, existence of arbitrage:" Tags="&lt;bond&gt;&lt;arbitrage&gt;&lt;yield-curve&gt;&lt;no-arbitrage-theory&gt;&lt;heath-jarrow-morton&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22708" PostTypeId="2" ParentId="22676" CreationDate="2016-01-11T19:13:08.887" Score="1" Body="&lt;p&gt;$D_{n}$ are the dummy variables taking a value of one from each point of sudden change of variance &lt;strong&gt;onwards&lt;/strong&gt;, and $d_{n}$ are the estimated coefficients in relation to these breaks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So to apply your model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1- Find the breaks using the ICSS algorithm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2- Apply a garch model to your data by including dummy variables obtained in (1) in the conditional variance process and by including explanatory variables in the mean process regarding the precious metal returns (no need to perform a multiple regression).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: Note that the dummies should look like 00001111 and not like 00001000.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Practically, you should probably use R or a similar programming language because I don't think you'll find a package in matlab allowing to incorporate exogenous variable in both the mean and variance processes.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2016-01-11T19:13:08.887" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22710" PostTypeId="2" ParentId="22690" CreationDate="2016-01-12T03:49:17.530" Score="2" Body="&lt;p&gt;I found what I was looking for at Nasdaq.com. This information wasn't available months ago when I initially built my trading strategy. Basically Nasdaq.com provides a CSV file of all symbols that are ETFs. And its free.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.nasdaq.com/investing/etfs/etf-finder-results.aspx?download=Yes&quot; rel=&quot;nofollow&quot;&gt;http://www.nasdaq.com/investing/etfs/etf-finder-results.aspx?download=Yes&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17221" LastActivityDate="2016-01-12T03:49:17.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22711" PostTypeId="1" AcceptedAnswerId="22712" CreationDate="2016-01-12T09:19:58.787" Score="1" ViewCount="247" Body="&lt;p&gt;I see a lot of examples, like &quot;We hold long position during whole year, then we calculate daily sharpe ratio and multiply it by SQRT(252) to get the annual one&quot;. This example makes sense for me.&#xA;However, it is not clear, what to do with gaps. Let's say the stock was hold first quarter of the year and the last one, so there is a gap in half of year and, to be fair, there we no losses or gains, we just didn't trade.&#xA;How to calculate Sharpe Ration in this case. AFAIK, Sharpe Ration should consider this period and the result should degrade, right? I think that daily Sharpe Ratio should be calculated on observations only (2 quarters of a year) and then the multiplier still has to be SQRT(252).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would you agree?&#xA;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="18959" LastActivityDate="2016-01-12T12:57:07.373" Title="How to calculate Sharpe Ratio if there are gaps in returns?" Tags="&lt;sharpe-ratio&gt;&lt;performance&gt;&lt;sharpe&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22712" PostTypeId="2" ParentId="22711" CreationDate="2016-01-12T12:53:05.003" Score="2" Body="&lt;p&gt;You actually need to consider a 0 return on the periods with no holdings (during that period volatility is 0 and you have a negative return due to the opportunity cost of not holding risk free debt). From that you can compute your daily sharpe ratio and then multiply by $252^{0.5}$ as you mention.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="16472" LastEditDate="2016-01-12T12:57:07.373" LastActivityDate="2016-01-12T12:57:07.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22713" PostTypeId="2" ParentId="22625" CreationDate="2016-01-12T13:41:22.530" Score="0" Body="&lt;p&gt;For an ease of argument assume there are no discrete dividends and interest rates are non-stochastic and identically zero. Consider a delta-hedged log-contract, which is essentially equivalent to a variance swap in this case. Since this contract can statically be replicated by traded options, you can think of variance itself as a traded asset. This means the variance process has to be a martingale with the expected value being the current price of the contract.&#xA;Because the price is observed, a change in implied vol-of-vol cannot change the market price of the contract. ( assume you price the contract with the Heston model increasing the vol-of-vol thereby leaving the total-variance constant). However we know that out-of-the money options have positive vol convexity (which is intuitive) so there must be options with negative vol-convexity that render the total expected variance invariant under a change of vol-of-vol. These options cannot be out-of-the money.Hence options around at-the-money must have negative vol-convexity.&lt;/p&gt;&#xA;" OwnerUserId="18879" LastActivityDate="2016-01-12T13:41:22.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22714" PostTypeId="1" CreationDate="2016-01-12T13:41:56.190" Score="1" ViewCount="120" Body="&lt;p&gt;I am trying to generate monthly stock data using a one-factor model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R_{a,t} = \alpha + BR_{b,t}+\epsilon_{t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The description says:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$R_{a,t}$ is the excess asset returns vector, $\alpha$ is the mispricing coefficients vector, $B$ is the factor loadings matrix, $R_{b,t}$ is the vector of excess returns on the factor portfolios, $R_{b}-N(\mu_{b},\sigma_{b})$, and $\epsilon_{t}$ is the vector of noise, $\epsilon - N(0,\sum_{e})$, which is independent with respect to the factor portfolios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For our simulations, we assume that the risk-free rate follows a normal distribution, with an annual average of 2% and a standard deviation of 2%. We assume that there is only one factor (K=1), whose annual excess return has an annual average of 8% and a standard deviation of 16%. The mispricing $\alpha$ is set to zero and the factor loadings, B, are evenly spread between 0.5 and 1.5. Finally, the variance-covariance matrix of noise, $\sum_{\epsilon}$, is assumed to be diagonal, with elements drawn from a uniform distribution with support [0.10,0.30], so that the cross-sectional average annual idiosyncratic volatility is 20%. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the information provided here I try to generate the data:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alpha &amp;lt;- 0 #mispricing index is set to 0&#xA;&#xA;B &amp;lt;- matrix(runif(1000,min=0.5,max=1),100,10) #factor loadings matrix is evenly spread between 0.5 and 1.5&#xA;&#xA;R &amp;lt;- rnorm(100,mean=8/12,sd=16/sqrt(12)) #factor with annual excess return of 8% and standard deviation of 16%&#xA;&#xA;epsilon &amp;lt;- rnorm(100, mean=0,sd=runif(10,min=0.1,max=0.30)) #error term with mean 0 and standard deviation drawn from a uniform distribtion&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I generate the data: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;data &amp;lt;- alpha + B*R + epsilon&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My question is: is this the correct way to do it or am I missing something?&lt;/p&gt;&#xA;" OwnerUserId="18609" LastEditorUserId="18609" LastEditDate="2016-01-15T11:18:41.177" LastActivityDate="2016-01-15T11:18:41.177" Title="Generating financial data" Tags="&lt;r&gt;&lt;finance&gt;&lt;simulations&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22715" PostTypeId="2" ParentId="22692" CreationDate="2016-01-12T15:48:24.523" Score="0" Body="&lt;p&gt;Time series of 4 years of quarterly data with &lt;code&gt;1&lt;/code&gt; for 4th quarter:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ts(rep(c(0,0,0,1),4), f=4)&#xA;  Qtr1 Qtr2 Qtr3 Qtr4&#xA;1    0    0    0    1&#xA;2    0    0    0    1&#xA;3    0    0    0    1&#xA;4    0    0    0    1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this what you want?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That was a dummy series of &lt;code&gt;ts&lt;/code&gt; class. Actually, depending on your needs simple &lt;code&gt;rep(c(0,0,0,1),4)&lt;/code&gt; may suffice, e.g. for ARIMA regression as exog dummy (w/o coercion to &lt;code&gt;ts&lt;/code&gt;)&lt;/p&gt;&#xA;" OwnerUserId="13718" LastEditorUserId="13718" LastEditDate="2016-01-12T16:41:45.017" LastActivityDate="2016-01-12T16:41:45.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22716" PostTypeId="2" ParentId="22693" CreationDate="2016-01-12T17:33:47.640" Score="1" Body="&lt;p&gt;For &lt;strong&gt;Q2&lt;/strong&gt;, let $\lambda = \mu/\sigma$. Moreover, we define the measure $Q$ on $(\Omega, \mathcal{F})$ such that&#xA;\begin{align*}&#xA;\frac{dQ}{dP}\big|_{\mathcal{F}_t} = \exp\Big(-\frac{1}{2}\lambda^2 t - \lambda W_t\Big), \mbox{ for } t \ge 0.&#xA;\end{align*}&#xA;Then, by Girsanov theorem, $W^*$, where&#xA;\begin{align*}&#xA;W_t^* = \lambda t + W_t,&#xA;\end{align*}&#xA;is a standard Brownian motion under the measure $Q$. Furthermore,&#xA;under $Q$,&#xA;\begin{align*}&#xA;dS_t^1 &amp;amp;= S_t^1\big[(r+\mu)dt + \sigma dW_t \big]\\&#xA;&amp;amp;= S_t^1(rdt + \sigma dW_t^*).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-05-13T17:22:37.967" LastActivityDate="2016-05-13T17:22:37.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22717" PostTypeId="1" CreationDate="2016-01-12T17:40:00.997" Score="7" ViewCount="1912" Body="&lt;p&gt;What kind of deals do high frequency traders have with brokers or exchanges regarding commissions for stock trading? For an individual, it is nowadays possible to get to as low as 10 basis points per a round-trip trade. However, if one is buying and selling throughout the day, this quickly accumulates to enormous amounts. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are hedge funds engaging in high frequency trading immune to this, i.e. are we talking about trading costs that are in a completely different ballpark? Or is it that even after considerable trading costs, the trading strategies are still profitable? Any studies or surveys published about this?&lt;/p&gt;&#xA;" OwnerUserId="18962" LastEditorUserId="2299" LastEditDate="2016-01-13T14:30:22.663" LastActivityDate="2016-01-13T14:30:22.663" Title="High frequency trading and trading costs" Tags="&lt;quant-trading-strategies&gt;&lt;high-frequency&gt;&lt;market-microstructure&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22719" PostTypeId="1" CreationDate="2016-01-12T18:43:36.120" Score="10" ViewCount="2734" Body="&lt;p&gt;I just finished my undergraduate (BSc) degree in Pure Mathematics &amp;amp; Applied Mathematics. I am starting my postgraduate degree in Pure Mathematics in a month's time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am considering pursuing a career in Quantitative Finance when I have finished my studies, but I will have to self-study a lot of the work myself since my Mathematical education will be mostly purely theoretically based.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any recommendations of books that I can obtain to self-study some of the necessary mathematics and statistics/applications that I will be required to know as a quant?&lt;/p&gt;&#xA;" OwnerUserId="13468" LastActivityDate="2016-01-28T18:46:38.380" Title="Self study references for a Mathematician" Tags="&lt;reference-request&gt;&lt;books&gt;&lt;self-study&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="22720" PostTypeId="1" CreationDate="2016-01-12T19:08:30.137" Score="1" ViewCount="96" Body="&lt;p&gt;Let's say that I want to find stocks that have moved +-20% within a 10 day period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;ABC&lt;/code&gt; would match if at &lt;code&gt;t&lt;/code&gt;, &lt;code&gt;ABC&lt;/code&gt; is \$1 and at &lt;code&gt;t+8&lt;/code&gt;, &lt;code&gt;ABC&lt;/code&gt; is \$1.20.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;XYZ&lt;/code&gt; would &lt;strong&gt;not&lt;/strong&gt; match if at &lt;code&gt;t&lt;/code&gt;, &lt;code&gt;XYZ&lt;/code&gt; is \$1 and at &lt;code&gt;t+10&lt;/code&gt;, &lt;code&gt;XYZ&lt;/code&gt; is \$1.10, because it did not move 20% within 10 days.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe that I'm looking for some kind of volatility indicator that will also allow for a time range.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I also sort by how recently this indicator occurred?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any help.&lt;/p&gt;&#xA;" OwnerUserId="18963" LastEditorUserId="13718" LastEditDate="2016-01-14T06:58:41.857" LastActivityDate="2016-01-14T06:58:41.857" Title="How can I find stocks that have had a X% price swing within Y days, sorted by recency of said swing?" Tags="&lt;equities&gt;&lt;python&gt;&lt;technical-analysis&gt;" AnswerCount="2" CommentCount="2" ClosedDate="2016-01-14T06:59:33.977" ContentLicense="CC BY-SA 3.0" />
  <row Id="22721" PostTypeId="2" ParentId="22717" CreationDate="2016-01-12T20:06:24.920" Score="3" Body="&lt;p&gt;Well you have a few alternatives to lower your commissions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can get your own broker number in which case you don't go through anyone, you go direct to the exchange so you just pay/get the active/passive rebate.  If you are really HFT then this is often the route you take. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the case where you pay a commission to your broker, they are eating/taking the active/passive fee, SEC fee, other assorted per trade fees on your behalf and betting that the commission you pay lets them eeek out a profit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most brokers will let their clients trade through them and get the active/passive rebate and be responsible for the exchange fees for a very minimal per trade commission or a monthly flat fee.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other brokers take a holistic approach to fees and take into account how much you pay in prime broker fees per month. If its enough you won't pay any per trade commissions with the broker and just pass on the fees/rebates directly to you.&lt;/p&gt;&#xA;" OwnerUserId="743" LastActivityDate="2016-01-12T20:06:24.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22722" PostTypeId="2" ParentId="21169" CreationDate="2016-01-12T20:40:01.583" Score="1" Body="&lt;p&gt;S&amp;amp;P Compustat is the standard for most academic research.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2016-01-12T20:40:01.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22723" PostTypeId="1" AcceptedAnswerId="22730" CreationDate="2016-01-13T01:05:35.483" Score="1" ViewCount="2237" Body="&lt;p&gt;Let: $X=V_1-V_0R_0$ where $R_0$ is the interest rate. Then, is it so that this risk measure is Translation Invariant as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\textit{VaR}_{\alpha}(X)=\textit{VaR}_{\alpha}(V_1-V_0R_0)=V_0+\textit{VaR}_{\alpha}(V_1)=V_0+g(F^{-1}_{V_{1}}(\alpha))$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Appreciate for anyone clarifying this.&#xA;Thanks&lt;/p&gt;&#xA;" OwnerUserId="18211" LastActivityDate="2017-04-20T19:42:19.333" Title="Is Value-at-Risk translation invariant?" Tags="&lt;risk&gt;&lt;value-at-risk&gt;&lt;coherent-risk-measure&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22724" PostTypeId="2" ParentId="2770" CreationDate="2016-01-13T01:56:09.423" Score="2" Body="&lt;p&gt;On my capstone project on Extreme Value Theory, LMM and Swap Pricing I used &lt;a href=&quot;http://www.dlib.net&quot; rel=&quot;nofollow&quot;&gt;dlib &lt;/a&gt;. It has a lot of various mathematical capabilities. My use focused on vector and optimization calculations.&lt;/p&gt;&#xA;" OwnerUserId="18159" LastActivityDate="2016-01-13T01:56:09.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22725" PostTypeId="1" AcceptedAnswerId="22726" CreationDate="2016-01-13T02:53:54.263" Score="0" ViewCount="102" Body="&lt;p&gt;I work in finance but do not have any formal education in the subject (I do have a PhD, but not in finance). I've picked up a lot of the jargon but there's one thing that I haven't figured out, and it seems too basic to ask. Hence I ask here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What do people mean when they say they are &quot;modeling risk&quot; or &quot;risk numbers?&quot; The term &quot;risk&quot; here seems to have a very specific meaning, and it doesn't seem to coincide with the way the word is used in everyday speech. I'm not sure if it has anything to do with the risk-neutral measure, which is something I do understand.&lt;/p&gt;&#xA;" OwnerUserId="16684" LastActivityDate="2016-01-13T07:37:42.023" Title="What are &quot;risk&quot; or &quot;risk numbers?&quot;" Tags="&lt;risk&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22726" PostTypeId="2" ParentId="22725" CreationDate="2016-01-13T07:37:42.023" Score="2" Body="&lt;p&gt;Very hard to tell from the given context but I would assume that &quot;risk numbers&quot; refers to the risk of a position (e.g. trading desk) which is typically measured in terms of a VaR (value-at-risk) or a similar measure (ES - expected shortfall).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Modeling risk&quot; is the task of identifying your sources of risk (risk types like e.g. interest rate risk, volatility risk) and then choosing an adequate model (e.g. VaR using delta-normal approach) in order to calculate the aforementioned risk numbers.&lt;/p&gt;&#xA;" OwnerUserId="17281" LastActivityDate="2016-01-13T07:37:42.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22727" PostTypeId="2" ParentId="22720" CreationDate="2016-01-13T07:40:42.533" Score="0" Body="&lt;p&gt;You're not looking for volatility, at least not that measure alone. Imagine two stocks A and B, A is gaining a constant 2% every day whereas B is gaining 1% one day and -1% the other day. Then look at the return over the 10 days and the volatility of the two stocks.&lt;/p&gt;&#xA;" OwnerUserId="17281" LastActivityDate="2016-01-13T07:40:42.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22728" PostTypeId="1" CreationDate="2016-01-13T10:13:46.603" Score="3" ViewCount="256" Body="&lt;p&gt;I can calculate the &quot;Implied Beta&quot; using implied volatility for the option stock, and implied volatility for the market (VIX). &#xA;Is there any way to calculate also the correlation without performing a statistical analysis on historical data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\beta = ({\rho \sigma_{aapl}\ \sigma_{sp500}})/{\sigma_{sp500}} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know about the &lt;a href=&quot;https://www.cboe.com/micro/impliedcorrelation/&quot; rel=&quot;nofollow&quot;&gt;&quot;Implied correlation&quot;&lt;/a&gt; but this is the &lt;strong&gt;average correlation&lt;/strong&gt; for all the stocks with the S&amp;amp;P500. I would the correlation for that particular stock&lt;/p&gt;&#xA;" OwnerUserId="7827" LastActivityDate="2016-01-13T15:38:47.430" Title="How to get Correlation using Options data?" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;beta&gt;&lt;capm&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22729" PostTypeId="2" ParentId="22728" CreationDate="2016-01-13T12:39:22.393" Score="2" Body="&lt;p&gt;The simple answer is no. You need historical data to backuo the implied correlation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A smart way to do it is to use Buss and Vilkov (2009) methodology. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Denote the risk-neutral correlation between each pair of stocks: $\rho_{ij,t}^Q$. The presence of the correlation premia led Buss and Vilkov (2009) to estimate the risk-neutral correlation by making:&#xA;\begin{equation}&#xA;\rho_{ij,t}^Q=\rho_{ij,t}^P-\alpha_t(1-\rho_{ij,t}^P)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Combining the above equation with the identifying restriction that equates the the observed implied variance of the market index $(\sigma_{i,t}^Q)^2$ with the calculated implied variance of a portfolio of all market index constituents $i =1,...,N$:&#xA;\begin{equation}&#xA;(\sigma_{i,t}^Q)^2=\sum_{i=1}^{N}\sum_{j=1}^{N}w_iw_j\sigma^Q_{i,t}\sigma^Q_{j,t}\rho^Q_{ij,t}&#xA;\end{equation}&#xA;one can solve for $\alpha$ and consequently get $\rho_{ij,t}^Q$.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="16472" LastEditDate="2016-01-13T15:38:47.430" LastActivityDate="2016-01-13T15:38:47.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22730" PostTypeId="2" ParentId="22723" CreationDate="2016-01-13T12:46:17.577" Score="1" Body="&lt;p&gt;Translation invariance of a risk measure $\rho$ is &lt;a href=&quot;https://en.wikipedia.org/wiki/Coherent_risk_measure&quot; rel=&quot;nofollow noreferrer&quot;&gt;defined&lt;/a&gt; as&#xA;$$&#xA;\rho(X+k) =  \rho(X)-k,&#xA;$$&#xA;where $X$ is a random variable such that $\rho(X)$ exists and $k$ is a constant.&#xA;The meaning is that if I add an amount $k$ to my risky positions then the risk is reduced by this amount.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For VaR we consider the case that $X$ has a continuous distribution and that it is a profit and loss random varibale. Then&#xA;$$&#xA;VaR_\alpha(X) = -F^{-1}_{1-\alpha}(X)&#xA;$$&#xA;and&#xA;$$&#xA;P[-VaR_\alpha(X) \le X] = 1-\alpha.&#xA;$$&#xA;Note that $VaR$ is a posive number and e.g. for $\alpha=99\%$ the quantile $F^{-1}_{1-\alpha}(X)$ is a negative number.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It also holds that &#xA;$$&#xA;P[-VaR_\alpha(X)+k \le X+k] = P[-VaR_\alpha(X) \le X] = 1-\alpha,&#xA;$$&#xA;and thus $VaR_\alpha(X+k) =  VaR_\alpha(X)-k$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is only true for elliptical distributions&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="-1" LastEditDate="2017-04-20T19:42:19.333" LastActivityDate="2017-04-20T19:42:19.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22731" PostTypeId="1" AcceptedAnswerId="22738" CreationDate="2016-01-13T13:13:58.210" Score="1" ViewCount="142" Body="&lt;p&gt;I have implemented martingale correction to my Andersen scheme for Heston model, &#xA;as it is in the paper (page 19-22):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.ressources-actuarielles.net/EXT/ISFA/1226.nsf/0/1826b88b152e65a7c12574b000347c74/&quot; rel=&quot;nofollow&quot;&gt;http://www.ressources-actuarielles.net/EXT/ISFA/1226.nsf/0/1826b88b152e65a7c12574b000347c74/&lt;/a&gt;$FILE/LeifAndersenHeston.pdf&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, Andersen derived martingale correction for asset process without interest rate, but I have interest rate in my model and implementation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think that implementing martingale correction for Andersen scheme with non-zero interest rate like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\hat{X}(t + \Delta) = \hat{X}(t) * exp(r \Delta + K_0 + K_1 \hat{v}(t) +  K_2 \hat{v}(t+\Delta)&#xA;                    + \sqrt{K_3 \hat{v}(t) +  K_4 \hat{v}(t+\Delta)} \cdot Z)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;should be fine, since interest rate is constant, but I'm not 100% sure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anyone advice on this?&lt;/p&gt;&#xA;" OwnerUserId="5079" LastEditorUserId="5079" LastEditDate="2016-01-13T17:27:06.600" LastActivityDate="2016-01-13T21:24:45.813" Title="Martingale correction for Andersen scheme with Interest Rate" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;stochastic-volatility&gt;&lt;heston&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22732" PostTypeId="1" CreationDate="2016-01-13T14:00:37.820" Score="5" ViewCount="858" Body="&lt;p&gt;At a first glance, VXV and VIX futures should not be compared at all: VXV is an underlying index, whilst VIX futures are derivatives written on a different underlying index, that is, VIX.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As instance, from a fixed income point of view, using VIX futures to seek opportunities on VXV seems like using EURIBOR 3M IRS to seek opportunities on EURIBOR 6M spot price: complete nonsense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, there's a point I am missing which puzzles me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Follow my way of thinking:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;if I buy 2M VIX futures, two months later my contract will expire and&#xA;converge to VIX spot price;&lt;/li&gt;&#xA;&lt;li&gt;if I replicate a VXV spot exposure&#xA;through a carefully strike weighted straddle (see very famous &lt;a href=&quot;http://wwwf.imperial.ac.uk/~ajacquie/IC_Volatility/IC_Volatility_Docs/Literature/Goldman_VarSwaps.pdf&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;More&#xA;Than You Ever Wanted To Know About Volatility Swaps&lt;/strong&gt;&lt;/a&gt; by Goldman&#xA;Sachs' guys), two months later my exposure will converge to a VIX&#xA;exposure, because my strike weighted options chain is not anymore&#xA;centered on 3M tenor but on 1M ~ 30D tenor.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Therefore I have two positions which deliver the same payoff at some point: no-arbitrage rules would say that they should price the same, which is not true.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;VXV vs. generic 2nd CBOE VIX futures spread:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/6lxyU.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/6lxyU.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If VXV is worth 22.5 and VIX 2M futures is slightly above 20.5, could you explain why shorting VXV and long such futures would not return me $2$ points of risk free volatility earnings?&lt;/p&gt;&#xA;" OwnerUserId="3058" LastActivityDate="2016-03-18T18:25:50.437" Title="VXV vs. VIX futures: arbitrage opportunities?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;futures&gt;&lt;vix&gt;&lt;term-structure&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22733" PostTypeId="1" AcceptedAnswerId="22737" CreationDate="2016-01-13T17:02:55.577" Score="1" ViewCount="603" Body="&lt;p&gt;I have computed an efficient frontier using quadratic optimization algorithm for some stock data and then plotted it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I have troubles understanding how to interpret standard deviation of portfolio returns.&#xA;For example, if you look at the plot, you can see that for daily return of 0.0006, the standard deviation is roughly 0.017.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What does that mean? Does it mean that on average daily return of my portfolio is going to be $0.0006\pm0.017$? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, should I expect daily return to be in the interval from $-0.0164$ to $0.0176$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. Also, how do I go from daily values to yearly in terms of returns and standard deviation, knowing that there are 250 trading days? Is the following way correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_{yearly} = (1 + r_{daily})^{250} - 1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$SD_{yearly} = SD_{daily} \times \sqrt{250}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/C7Z12.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/C7Z12.png&quot; alt=&quot;Efficient frontier&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8046" LastActivityDate="2016-01-14T09:22:10.207" Title="Interpretation of portfolio standard deviation" Tags="&lt;modern-portfolio-theory&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22737" PostTypeId="2" ParentId="22733" CreationDate="2016-01-13T19:21:01.897" Score="5" Body="&lt;p&gt;It depends on the distribution of the returns. If you &lt;em&gt;assume&lt;/em&gt; that it's roughly &lt;a href=&quot;https://en.wikipedia.org/wiki/Normal_distribution&quot; rel=&quot;noreferrer&quot;&gt;normally distributed&lt;/a&gt;, then you have a ~68% chance for a return in the range of 1 standard deviation, ~95% chance for 2 standard deviations, and so on.&lt;/p&gt;&#xA;" OwnerUserId="16351" LastActivityDate="2016-01-13T19:21:01.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22738" PostTypeId="2" ParentId="22731" CreationDate="2016-01-13T19:29:45.570" Score="1" Body="&lt;p&gt;Your adjusted scheme is correct. Basically, taking a maturity $T$, you can consider the forward price process $F_t^T = S_t e^{r(T-t)}$. You apply the Andersen scheme to $F_t^T$ and then note that&#xA;\begin{align*}&#xA;S_{t+\Delta} &amp;amp;= F_{t+\Delta}^T e^{-r(T-(t+\Delta))}\\&#xA;&amp;amp;=F_t^T \exp(\ \Box \ ) e^{-r(T-(t+\Delta))}\\&#xA;&amp;amp;=S_t e^{r(T-t)}\exp(\ \Box \ ) e^{-r(T-(t+\Delta))}\\&#xA;&amp;amp;=S_t \exp(r\Delta + \ \Box \ ),&#xA;\end{align*}&#xA;where the terms included in $\ \Box \ $ are the terms in the Andersen scheme with zero interest rate.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-01-13T21:24:45.813" LastActivityDate="2016-01-13T21:24:45.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22742" PostTypeId="2" ParentId="22720" CreationDate="2016-01-14T00:28:41.593" Score="1" Body="&lt;p&gt;As soon as you're comfortable with Python, let's do this exercise in three steps:  &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Download data and calculate cumulative returns (or value of your position as if you invested $1 in each of the stocks)&lt;/li&gt;&#xA;&lt;li&gt;Define function that will capture stock movements in excess of predefined threshold, 10% in this case. This function is going to be the &quot;indicator&quot; you asked for.&lt;/li&gt;&#xA;&lt;li&gt;Plot &quot;indicator&quot; on top of the stock data.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step 1.&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Imports  &#xA;import matplotlib.pyplot as plt&#xA;import numpy as np&#xA;import pandas as pd&#xA;from pandas_datareader import data&#xA;%matplotlib inline&#xA;plt.rcParams['figure.figsize']=(12,5)&#xA;&#xA;# Definitions of global variables&#xA;N = 10&#xA;change = .1&#xA;stocks = ['GOOG','YHOO','AAPL','IBM','MSFT']&#xA;&#xA;# Download of prices&#xA;price = pd.DataFrame()&#xA;for st in stocks:&#xA;    price[st] = data.DataReader(st, 'yahoo')['Adj Close']&#xA;&#xA;&#xA;# Calculation of cumulative returns&#xA;return_cum = (1+price.pct_change()).cumprod()&#xA;return_cum.plot();&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/dEVAR.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/dEVAR.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step 2.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, we need to define the indicator itself that will capture any movements, positive or negative, in excess of predefined &lt;code&gt;change&lt;/code&gt;. The idea here is that I roll window &lt;code&gt;N&lt;/code&gt; times, each time decreasing it by 1, and put at the right end of the window 1 if absolute cumulative change is more than change required. Finally, if for any window of changing length I have 1 on a certain day, the indicator returns SINGLE &lt;code&gt;1&lt;/code&gt; for that day.  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def change_within_NDays(x,N):&#xA;    ret = pd.DataFrame()&#xA;    for days in range(N+1):&#xA;        ret[days] = pd.rolling_apply(x, days, func=lambda x: abs((x[-1]/x[0]-1)) &amp;gt; change)&#xA;    return ret.any(1)&#xA;&#xA;indicator = return_cum.apply(lambda x: change_within_NDays(x,N))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step 3.&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, we can visualize the indicator by drawing it over stock prices:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;_, ax = plt.subplots()&#xA;return_cum.plot(ax=ax)&#xA;indicator.plot(ax=ax, legend=0);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/oIt2X.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/oIt2X.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13718" LastEditorUserId="13718" LastEditDate="2016-01-14T00:33:49.170" LastActivityDate="2016-01-14T00:33:49.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22743" PostTypeId="1" CreationDate="2016-01-14T02:09:21.767" Score="2" ViewCount="553" Body="&lt;p&gt;I've been searching in bibliography about this test applied to an AR(p) model.&#xA;$$Q(L)(Y_{t})=c+\epsilon_{t}$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where L represent the Lag Operator and $Q=1-\phi_{1}x-.....-\phi_{p}x^{p}$ is the polynomial expression associated to the model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that if $Q(r)=0$ implies $|r|&amp;gt;1$, then the process is stationary (at least in weak sense). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: Why the Null Hypothesis of Augmented Dickey-Fuller test is stated as: &quot;$r=1$ is a root of the polynomial&quot;?&#xA;Rejecting that hypothesis implies that every single root of Q lies outside the unit circle??&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm new at this area so every recommendation or suggestion will be useful. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="18991" LastEditorUserId="13718" LastEditDate="2016-01-14T09:18:11.910" LastActivityDate="2017-12-23T22:09:19.873" Title="Augmented Dickey-Fuller Questions" Tags="&lt;time-series&gt;&lt;statistics&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22744" PostTypeId="2" ParentId="22733" CreationDate="2016-01-14T07:16:32.970" Score="0" Body="&lt;p&gt;The first part of the question is correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second is wrong:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you model daily log returns:&#xA;$$&#xA;r_t = \log(P_t)-\log(P_{t-1}&#xA;$$&#xA;then your yearly return $r_y$ is just&#xA;$$&#xA;\sum_{t=0}^{250} r_t,&#xA;$$&#xA;assuming $250$ days. Then &#xA;$$&#xA;E[r_y] = 250 E[r_t],&#xA;$$&#xA;and &#xA;$$&#xA;V[r_y] = 250 V[r_t]&#xA;$$&#xA;if we assume that returns are uncorrelated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of arithmetic returns&#xA;$$&#xA;r_t = P_t/P_{t-1}-1.&#xA;$$&#xA;The exact expressions for passing from daily mean to yearly are not that easy. The same holds for variance.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-01-14T07:16:32.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22745" PostTypeId="2" ParentId="22733" CreationDate="2016-01-14T09:22:10.207" Score="1" Body="&lt;p&gt;@Richard I assume your $V$ stands for variance so that your formula is correct. The question was about standard deviation, though, and there the square root needs to be taken.&lt;/p&gt;&#xA;" OwnerUserId="17281" LastActivityDate="2016-01-14T09:22:10.207" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22746" PostTypeId="1" CreationDate="2016-01-14T10:00:58.543" Score="2" ViewCount="309" Body="&lt;p&gt;I was wondering how to calculate the forward rates based on OIS discounting for the half year terms. I know how to do this for the full year terms -&gt; just making sure that the two legs are equal to each other. &#xA;The problem is that I don't have fixed payments on the half year terms. For example when one wants to calculate the 1,5 OIS discounted forward rate you only have 1 fixed payment versus 3 floating payments. How to deal with this? &#xA;One method which can be used is just calculating the full year rates and then interpolate between these rates, but I wonder if there is a method which can calculate these rates without using interpolation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next to that what does a 1,5 swap rate exactly mean, is this just an interpolated rate because you will have the same problem here when there isn't a payment on the half years.&lt;/p&gt;&#xA;" OwnerUserId="16788" LastActivityDate="2016-07-28T13:53:22.793" Title="Dual discounted forward curve" Tags="&lt;swaps&gt;&lt;forward-rate&gt;&lt;ois-discounting&gt;&lt;discount-factor-curve&gt;&lt;discounting&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22747" PostTypeId="1" CreationDate="2016-01-14T15:25:21.480" Score="1" ViewCount="2991" Body="&lt;p&gt;Using &lt;code&gt;bdh()&lt;/code&gt;, I am trying to download historic weekday prices regardless if the weekday is a holiday or not. The default does not return weekday bank holidays. The only option is to return all calendar days. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The override should be Days=W, but I get an error. It would be great if someone could point me into the right direction. Many thanks!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;blpConnect()&#xA;&#xA;startdate &amp;lt;- as.Date(&quot;1999-01-29&quot;)&#xA;&#xA;&#xA;tickers &amp;lt;-  c(&quot;SPX Index&quot;,&quot;VIX Index&quot;)&#xA;&#xA;opt &amp;lt;- c(&quot;periodicitySelection&quot;=&quot;DAILY&quot;,&quot;currency&quot;=&quot;USD&quot;)&#xA;overrides.week &amp;lt;- &quot;Days&quot;&#xA;names(overrides.week) = &quot;W&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;overrride.week &amp;lt;- c(&quot;Days&quot;=&quot;W&quot;)&#xA;&#xA;p.d.raw &amp;lt;- bdh(tickers, &#xA;               fields=&quot;LAST PRICE&quot;,&#xA;               start = startdate, &#xA;               end=Sys.Date(), &#xA;               options=opt, &#xA;               override=overrides.week)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;gives the error &lt;strong&gt;Choice sub-element not found for name 'securityData'.&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="18994" LastEditorUserId="848" LastEditDate="2016-01-14T17:22:52.657" LastActivityDate="2016-11-16T19:43:32.027" Title="Rblpapi / bdh - how to download prices for all weekdays - regardless if it is a bank holiday" Tags="&lt;bloomberg&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22748" PostTypeId="1" AcceptedAnswerId="22751" CreationDate="2016-01-14T15:33:37.547" Score="1" ViewCount="279" Body="&lt;p&gt;For an exercise I need to calculate $\mathbb{E}[X]$ with a Monte Carlo simulation. I need to use control variate $Y$ with $\text{Var}(Y)=2$ and $\text{Cov}(X,Y)=1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am asked to give the optimale choice for $\theta$ in the following formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Z_{\theta}=X+\theta(\mathbb{E}[Y]-Y)$ by making the variance of the stochast $Z_{\theta}$ as small as possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume you start by rewriting $\text{Var}(Z_{\theta})$, this is what I did:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\text{Var}(X+\theta(\mathbb{E}[Y]-Y))$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$=\text{Var}(X)+\text{Var}(\theta(\mathbb{E}[Y]-Y)) &#xA;+ 2\text{Cov}(X,\theta(\mathbb{E}[Y]-Y))$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$= \text{Var}(X)&#xA;+\theta^2\text{Var}(\mathbb{E}[Y]-Y)&#xA;+2\theta \text{Cov}(X,\mathbb{E}[Y])&#xA;-2\theta\text{Cov}(X,Y) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$= &#xA;\text{Var}(X)&#xA;+\theta^2\text{Var}(\mathbb{E}[Y])&#xA;+\theta^2\text{Var}(Y)&#xA;-\theta^2\text{Cov}(\mathbb{E}[Y], Y)&#xA;+2\theta \text{Cov}(X,\mathbb{E}[Y])&#xA;-2\theta\text{Cov}(X,Y) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I can't rewrite the formula any further, I inserted the variables. This gave:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$= &#xA;\text{Var}(X)&#xA;+\theta^2\text{Var}(\mathbb{E}[Y])&#xA;+2 \theta^2&#xA;-\theta^2\text{Cov}(\mathbb{E}[Y], Y)&#xA;+2\theta \text{Cov}(X,\mathbb{E}[Y])&#xA;-2\theta $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know however how to go on from here, without the value of $\mathbb{E}[X]$. Am I doing something wrong?&lt;/p&gt;&#xA;" OwnerUserId="17778" LastActivityDate="2016-01-14T16:37:45.147" Title="Calculate control variate for monte carlo simulation" Tags="&lt;monte-carlo&gt;&lt;covariance&gt;&lt;variance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22749" PostTypeId="2" ParentId="22747" CreationDate="2016-01-14T15:36:50.367" Score="2" Body="&lt;p&gt;This was one solution:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;option.fields &amp;lt;- c(&quot;periodicitySelection&quot;, &quot;nonTradingDayFillOption&quot;,&#xA;                   &quot;nonTradingDayFillMethod&quot;, &quot;periodicityAdjustment&quot;,&#xA;                   &quot;adjustmentFollowDPDF&quot;, &quot;currency&quot;)&#xA;&#xA;option.values &amp;lt;- c(&quot;DAILY&quot;, &quot;NON_TRADING_WEEKDAYS&quot;, &quot;NIL_VALUE&quot;, &#xA;                   &quot;CALENDAR&quot;, &quot;TRUE&quot;, &quot;USD&quot;)&#xA;&#xA;opt &amp;lt;- structure(option.values, names = option.fields)&#xA;&#xA;p.d.raw &amp;lt;- bdh(tickers, &#xA;               fields=&quot;LAST PRICE&quot;, &#xA;               start=startdate, &#xA;               end=Sys.Date(), &#xA;               options=opt) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="18994" LastEditorUserId="848" LastEditDate="2016-11-16T19:43:32.027" LastActivityDate="2016-11-16T19:43:32.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22750" PostTypeId="1" AcceptedAnswerId="22752" CreationDate="2016-01-14T15:44:47.867" Score="1" ViewCount="629" Body="&lt;p&gt;I am making use of the &lt;a href=&quot;https://en.wikipedia.org/wiki/Normal-inverse_Gaussian_distribution&quot; rel=&quot;nofollow&quot;&gt;Normal Inverse Gaussian&lt;/a&gt; distribution in my work to model underlying interest rate implied volatility risk drivers. What is particularly nice about this distribution for my purpose is the fact it is much more parsimonious than other alternatives, and closed under convolution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That being said, I have not been capable of finding a reasonably &quot;verifiable&quot; quantile function implementation. There does not appear to be one in Excel, in R we have the function &lt;code&gt;qnig&lt;/code&gt; from the package &lt;code&gt;fBasics&lt;/code&gt; that I am unsure about accuracy for, and in MatLab there is &lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/10934-normal-inverse-gaussian--nig--distribution-updated-version&quot; rel=&quot;nofollow&quot;&gt;this package&lt;/a&gt; which mentions having issues with the inverse CDF due to numerical computation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is whether there exists a reasonably accurate quantile function for my purposes. I am coding in C# and attempted to implement my own Normal Inverse Gaussian function, however comparing with R's &lt;code&gt;qnig&lt;/code&gt; I only consistently have around 5 digits of accuracy. I am not even sure if R's implementation is to be trusted as a baseline for many digits of accuracy, however. &lt;/p&gt;&#xA;" OwnerUserId="16064" LastActivityDate="2018-10-21T17:17:38.157" Title="Normal Inverse Gaussian distribution - any consensus on an accurate quantile function?" Tags="&lt;programming&gt;&lt;distribution&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22751" PostTypeId="2" ParentId="22748" CreationDate="2016-01-14T16:20:51.680" Score="1" Body="&lt;p&gt;The first objective is to minimize the variance by choosing a proper control variate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First note that an expectation value is just a constant, so the covariance between an expectation value and a random variable is zero:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Cov}\left(\mathbb{E}[Y], X\right) = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly for the variance of an expectation value, $\text{Var}(\mathbb{E}[Y])=0$. The variance of $Z_{{\theta}}$ is therefore given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Var}(\mathbb{E}[Z_{{\theta}}]) = \text{Var}(\mathbb{E}[X])+2\theta^2 - 2\theta$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You don't need to know what this variance is. What you are interested in is picking a $\theta$ such that this variance is as low as possible. Put differently, you want to minimize this variance which is accomplished by setting the derivative with respect to $\theta$ equal to zero. The derivative is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{d\text{Var}(\mathbb{E}[Z_{\theta}])}{d\theta} = 4\theta -2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Setting this to zero gives $\theta = \frac{1}{2}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So now you have determined the optimal $\theta$. Next, you need to run a Monte Carlo simulation and simulate $X$ and $Y$ consistently. From these simulations you can estimate $\mathbb{E}[Y]$ using the sample mean of $Y$ (or, better, the true mean if you happen to know this analytically). With this expectation you can construct the variable $Z_{\theta}$ with $\theta = 1/2$ for each of your $N$ simulations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, you compute the sample mean of $Z_{\theta}$, which is an estimate of the expectation value of $X$.&lt;/p&gt;&#xA;" OwnerUserId="3371" LastEditorUserId="3371" LastEditDate="2016-01-14T16:37:45.147" LastActivityDate="2016-01-14T16:37:45.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22752" PostTypeId="2" ParentId="22750" CreationDate="2016-01-14T16:26:50.067" Score="3" Body="&lt;p&gt;When possible, I look at implementations in &lt;a href=&quot;http://docs.roguewave.com/imsl/c/8.5/html/cnlstat/index.html#page/CNLStat/csch11.14.01.html&quot; rel=&quot;nofollow&quot;&gt;IMSL&lt;/a&gt; and the &lt;a href=&quot;https://www.gnu.org/software/gsl/manual/html_node/Random-Number-Distributions.html&quot; rel=&quot;nofollow&quot;&gt;GSL&lt;/a&gt; for really good accuracy.  Neither one appears to implement the Wald (inverse gaussian) or its quantile function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Matlab does have the distribution (as inversegaussian) so you could roll your own with &lt;code&gt;fzero()&lt;/code&gt; or another root-finder based on that if you are unhappy with the accuracy, or for testing &lt;code&gt;qnig&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since there is no closed-form formula for the quantile function, essentially every implementation will be running a root-finder.  It's simply a question of the halting criteria settings for the root-finder involved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an aside, I have trouble thinking of a quant research project where accuracy to better than 5 (significant) digits would be important.  Perhaps you just need to scale your variables?&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2016-01-14T16:26:50.067" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22753" PostTypeId="2" ParentId="22750" CreationDate="2016-01-14T17:29:55.233" Score="2" Body="&lt;p&gt;You might also look at the boost package which should (I'm no expert for this) be usable within C#. It comes with an implementation of the inverse normal distribution which is explained in the online documentation &lt;a href=&quot;http://www.boost.org/doc/libs/master/libs/math/doc/html/math_toolkit/dist_ref/dists/inverse_gaussian_dist.html&quot; rel=&quot;nofollow&quot;&gt;http://www.boost.org/doc/libs/master/libs/math/doc/html/math_toolkit/dist_ref/dists/inverse_gaussian_dist.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here they claim quite a high numerical accuracy of more then 10 digits.&lt;/p&gt;&#xA;" OwnerUserId="17281" LastActivityDate="2016-01-14T17:29:55.233" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22754" PostTypeId="1" CreationDate="2016-01-14T20:20:38.737" Score="3" ViewCount="364" Body="&lt;p&gt;I have developed a low frequency equity trading strategy that seems to work well with stocks in the S&amp;amp;P 500.  Someone asked me about the maximum capacity of the strategy (how much AUM I could handle), and that led me to think about how best to determine how much of each stock I could trade, with the considerations of slippage, market impact, and creating a footprint in the market with a large order in mind.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My initial thought was to assume that I could safely trade (that is avoid undue cost and visibility) a small percentage of each stock's ADV, so the maximum capacity of the strategy would be the dollar value of the sum of x % of ADV of all of the stocks. If each order was then roughly say &amp;lt;1% of the stock's ADV, I would probably enter these orders as limit orders with a minimum display size and the rest in reserve, with the expectation that the market will work its way through my limit.  While this would minimize slippage, I am concerned that predatory systems could pick up on the reserve quantity, and that that will provide information.  I could layer the order in at different price levels, but that could be expensive.  Any thoughts on this are appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am also thinking about adding money management considerations to each order size (Kelly Consideration or Fixed Ratio), which may only further complicate the question of max capacity. Is there a general rule of thumb for determining capacity at a high level?  Cheers&lt;/p&gt;&#xA;" OwnerUserId="19000" LastEditorUserId="19000" LastEditDate="2016-01-15T17:18:21.760" LastActivityDate="2016-08-23T04:11:57.320" Title="Determining maximum strategy capacity and optimal order size for low frequency equity strategy" Tags="&lt;equities&gt;&lt;optimization&gt;&lt;automated-trading&gt;&lt;market-microstructure&gt;&lt;algorithmic-trading&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22755" PostTypeId="1" AcceptedAnswerId="22756" CreationDate="2016-01-14T21:38:03.730" Score="2" ViewCount="233" Body="&lt;p&gt;Show that American call and put prices are increasing in maturity $T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this mean I need to show that as $T$ increases than the American call and put prices increase as well? If so, how do I go about showing this?&lt;/p&gt;&#xA;" OwnerUserId="19002" LastActivityDate="2016-01-15T15:28:33.110" Title="American call and put prices, increasing in maturity" Tags="&lt;finance&gt;&lt;american-options&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22756" PostTypeId="2" ParentId="22755" CreationDate="2016-01-14T21:57:57.553" Score="4" Body="&lt;p&gt;For American options, the longer the maturity, the more choices for the optimal exercises time, then the option value is bigger. For example, consider maturities $T_1$ and $T_2$, for the same option except for different maturities. Any optimal exercise time within $[0, T_1]$ is a possible exercise time within $[0, T_2]$, with a better time possibly falls in $(T_1, T_2]$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Formally, the value of an American option, with maturity $T$, is given by&#xA;\begin{align*}&#xA;\sup_{\tau\in \mathcal{T}_{[0,T]}}E\Big(e^{-r\tau}\max\big(\phi(S_{\tau}-K, 0) \big)\Big),&#xA;\end{align*}&#xA;where $\mathcal{T}_{[0,T]}$ is the set of stopping times with values in $[0, T]$. Here, $\phi=1$ for a call and $-1$ for a put. Note that, for $0 &amp;lt; T_1 &amp;lt; T_2$, $\mathcal{T}_{[0, T_1]} \subset \mathcal{T}_{[0,T_2]}$. Therefore,&#xA;\begin{align*}&#xA;\sup_{\tau\in \mathcal{T}_{[0,T_1]}}E\Big(e^{-r\tau}\max\big(\phi(S_{\tau}-K, 0) \big)\Big) \le \sup_{\tau\in \mathcal{T}_{[0,T_2]}}E\Big(e^{-r\tau}\max\big(\phi(S_{\tau}-K, 0) \big)\Big).&#xA;\end{align*}&#xA;That is, American call and put prices are increasing in maturity $T$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-01-15T13:38:06.310" LastActivityDate="2016-01-15T13:38:06.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22761" PostTypeId="2" ParentId="22755" CreationDate="2016-01-15T15:28:33.110" Score="0" Body="&lt;p&gt;american options are at least as expensive as their european counterparts. So it's enough to argue that european options increase in value as time to expiry prolongs, given other metrics remain the same. This is because of the &quot;time value&quot; of options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, longer time give you more opportunity to early exercise, which adds in zero or positive addition values. Thus, the options have more value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Two factors come together, the american options increase in value as time to expiry increases.&lt;/p&gt;&#xA;" OwnerUserId="17835" LastActivityDate="2016-01-15T15:28:33.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22762" PostTypeId="1" CreationDate="2016-01-15T15:45:07.210" Score="1" ViewCount="343" Body="&lt;p&gt;Looking to build a real time data feed, stock monitor window. &#xA;Pretty much the same as equityfeed.com market viewer window, just with a few addedfeatures and or different filter columns with more up to date, current technologies. &#xA;Any body know what API equity feed uses or an API be a better fit for more real time data than them?&lt;/p&gt;&#xA;" OwnerUserId="19016" LastEditorUserId="19016" LastEditDate="2016-01-15T15:50:17.080" LastActivityDate="2018-12-14T07:03:15.663" Title="Looking for most current Financial API that is fast and accurate for NYSE NASDAQ AMEX OTC and PINKs" Tags="&lt;equities&gt;&lt;programming&gt;&lt;automated-trading&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22763" PostTypeId="1" AcceptedAnswerId="23009" CreationDate="2016-01-15T15:51:33.480" Score="2" ViewCount="2341" Body="&lt;p&gt;I'm downloading intraday bar data using  Bloomberg API and C#.&lt;/p&gt;&#xA;&lt;p&gt;I have adapted the official Bloomberg c# &amp;quot;IntradayBarExample” to suit my needs.&lt;/p&gt;&#xA;&lt;p&gt;However downloads are &lt;em&gt;really&lt;/em&gt; slow, I found &lt;a href=&quot;https://stackoverflow.com/a/6127236/3205529&quot;&gt;this post&lt;/a&gt; recommending  to use a dedicated &lt;code&gt;EventQueue&lt;/code&gt; instead of calling &lt;code&gt;NextEvent()&lt;/code&gt; on a &lt;code&gt;Session&lt;/code&gt; object. But the improvement is not really detectable.&lt;/p&gt;&#xA;&lt;p&gt;As illustration, you can download the 5Min Bar – Best Bid Event- of the last 100 days for AAL UW Equity ticker, it takes very long time to obtain at the end not so much data (&amp;lt; 1Mo).&lt;/p&gt;&#xA;&lt;p&gt;Did you face the same problem ?&lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-01-29T17:13:43.783" Title="How to download efficiently intraday data with Bloomberg API?" Tags="&lt;programming&gt;&lt;bloomberg&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22764" PostTypeId="2" ParentId="22660" CreationDate="2016-01-15T16:03:47.313" Score="3" Body="&lt;p&gt;There is one minor mistake: If you compute sum(mean.var) you'll obtain $-1$ instead of $1$. So it should be &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; mean.var&amp;lt;-xt/sum(xt)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in order to ensure that the weights sum up to one. The remainder is correct. Incorporating a risk aversion parameter into the framework requires the solution to the minVar problem (See for example &lt;a href=&quot;https://quant.stackexchange.com/questions/16440/on-a-source-for-a-mean-variance-portfolio-optimization-result/17988#17988&quot;&gt;here&lt;/a&gt;). Therefore, dividing your result with the risk aversion parameter $\gamma$ is sufficient to solve your problem.&lt;/p&gt;&#xA;" OwnerUserId="16249" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-01-15T16:03:47.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22766" PostTypeId="2" ParentId="15672" CreationDate="2016-01-15T17:00:33.553" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://www.tickdata.com/&quot; rel=&quot;nofollow&quot;&gt;https://www.tickdata.com/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They provide trade and quote and there is also an API.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2016-01-15T17:00:33.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22767" PostTypeId="1" CreationDate="2016-01-15T17:06:47.927" Score="2" ViewCount="195" Body="&lt;p&gt;Investopedia says:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The following are two types of futures traders:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;hedgers&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;speculators&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;An example of a hedger would be an airline buying oil futures to guard against potential rising prices. An example of a speculator would be someone who is just guessing the price direction and has no intention of actually buying the product. According to the Chicago Mercantile Exchange (CME), the majority of futures trading is done by speculators as less than 3% of transactions actually result in the purchaser of a futures contract taking possession of the commodity being traded.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Since most of the future contracts are never settled physically (therefore, no actual trades occour), why would the rest (actual buyers and sellers) even agree to participate in this speculative price action game?&lt;/p&gt;&#xA;&lt;p&gt;Why futures contract price of commodity is considered to be some kind of approximant of commodity price if all it is is ~97% speculation of traders who never bought/sold, never does and never will be involved in the commodity trade?&lt;/p&gt;&#xA;" OwnerUserId="18705" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-05-15T14:13:26.473" Title="Commodity market. Why would actual sellers / buyers bother about speculative price?" Tags="&lt;price&gt;&lt;speculation&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22768" PostTypeId="1" AcceptedAnswerId="22770" CreationDate="2016-01-15T17:41:38.840" Score="0" ViewCount="3234" Body="&lt;p&gt;Let $\lambda\in(0,1)$. Then $$C(T, \lambda K_1 + (1 - \lambda)K_2, S, t) \leq \lambda C(T, K_1, S, t) + (1 - \lambda)C(T, K_2, S, t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$T$ - the maturity&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$K_1$,$K_2$ - Strike prices&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S$ - stock price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$t$ - current time&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, the price of the call/put option in convex in $K$. Show the same claim for the price of put options, American call options, and American put options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think you need to just apply the triangle inequality, but I am not sure. Any suggestions is greatly appreciated. &lt;/p&gt;&#xA;" OwnerUserId="19002" LastActivityDate="2016-01-15T18:30:30.570" Title="Price of call/put is convex in $K$ (strike price)" Tags="&lt;options&gt;&lt;finance&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22769" PostTypeId="2" ParentId="22767" CreationDate="2016-01-15T17:47:59.100" Score="0" Body="&lt;p&gt;&lt;em&gt;why would the rest (actual buyers and sellers) even agree to participate in this speculative price action game?&lt;/em&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would say because market liquidity increases thanks to speculators. Liquidity has benefits for both types of players by decreasing transactions costs and by smoothing price changes.  In your example, the airline company may wish to exit its contract for risk management reasons and it will be easier if the market is liquid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit :&#xA;See also &lt;a href=&quot;http://www.foa.co.uk/admin/tiny_mce/jscripts/tiny_mce/plugins/filemanager/files/Regulation/Position_Papers/FTI_Impact_of_Speculative_Trading_in_Commodity_Markets.pdf&quot; rel=&quot;nofollow&quot;&gt;The impact of speculative trading in commodity markets - –&#xA;a review of the evidence&lt;/a&gt; (note it is probably not impartial...)&lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2016-01-15T19:08:04.477" LastActivityDate="2016-01-15T19:08:04.477" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22770" PostTypeId="2" ParentId="22768" CreationDate="2016-01-15T18:30:30.570" Score="3" Body="&lt;p&gt;Using the answer from: Chris Taylor, on math stackexchange (&lt;a href=&quot;https://math.stackexchange.com/questions/112063/price-of-a-european-call-option-is-a-convex-function-of-strike-price-k&quot;&gt;link&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let the price of an option at strike $K$ be given by $V(K)$. To say that the price is convex in the strike means that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V(K-\delta) + V(K+\delta) &amp;gt; 2 V(K)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for all $K&amp;gt;0$ and $\delta&amp;gt;0$. Let's assume that the opposite is true, i.e. that there exist tradeable option contracts expiring on the same date such that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V(K-\delta) + V(K+\delta) \leq 2 V(K)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I therefore buy a contract at $K+\delta$ and one at $K-\delta$, and finance my purchase by selling two of the options at $K$ (which I can do, because the two options struck at $K$ are at least as expensive as the other two combined).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At expiry the price of the stock is $S$, and my total payout is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P = (S-(K-\delta))^+ + (S-(K+\delta))^+ - 2(S-K)^+$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now there are four regimes:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$S&amp;lt;K-\delta$, which means $P=0$&lt;/li&gt;&#xA;&lt;li&gt;$K-\delta &amp;lt; S &amp;lt; K$, which means $P=S-(K-\delta) &amp;gt; 0$&lt;/li&gt;&#xA;&lt;li&gt;$K &amp;lt; S &amp;lt; K+\delta$, which means $P=S-K+\delta - 2(S-K)=K+\delta-S&amp;gt;0$&lt;/li&gt;&#xA;&lt;li&gt;$S&amp;gt;K+\delta$, which means $P = S-K+\delta + S-K-\delta - 2(S-K) = 0$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So I have the possibility of making a profit, but no possibility of making a loss - which is an arbitrage. Since no arbitrages exist, the option price must be convex in the strike price.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2016-01-15T18:30:30.570" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="22771" PostTypeId="1" AcceptedAnswerId="23083" CreationDate="2016-01-15T18:39:19.187" Score="1" ViewCount="135" Body="&lt;p&gt;Relevant definition:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assumption 2.1 (No dominance). If the payoff $P$ of a financial instrument is nonnegative, then the price $p$ of the financial instrument is nonnegative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$T$ - the maturity&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$K_1$,$K_2$ - Strike prices&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S$ - stock price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$t$ - current time&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$B_t(T)$ - price of bond&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is well known that a convex function has right and left derivatives at all points. From the above exercise it follows that (&lt;a href=&quot;https://quant.stackexchange.com/questions/22768/price-of-call-put-is-convex-in-k-strike-price?noredirect=1#comment32536_22768&quot;&gt;exercise&lt;/a&gt;) $\delta_{K_{\pm}}C(T,K,S,t)$ exists. Use no dominance to show $$-B_t(T) \leq \delta_{K_{\pm}}C(T,K,S,t)\leq 0$$.&#xA;(hint: Consider a portfolio made of a long position in a call with strike $K_2$ and short positions in a call option with strike $K_1$ and $K_2 - K_1$ bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Attempted solution: Suppose we have a portfolio made up of a long position in a call with strike $K_2$ and a short position in a call with strike $K_1$ and $K_2 - K_1$ bonds. The price of the long call is defined by $$C(T,K_2,S,t)$$ the price of the short position in the call is defined by $$-C(T,K_1,S,t)$$ and the price of the $K_2 - K_1$ bonds is defines as $$B_t(T)$$ The portfolio value is thus $$P_v = C(T,K_2,S,t) - C(T,K_1,S,t) + (K_2 - K_1)B_t(T)$$ (Taking the hint provided by the user: barrycarter) Suppose the return on $P_v$ is less than the risk-free rate, then one would have to be compensated to take this position. Therefore by the no dominance assumption the price of this position would be negative which is a contradiction. Does the result follow from exercise 2.2? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure where to go from here, any suggestions is greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-02-03T21:52:28.557" Title="Options and bond related to convexity" Tags="&lt;options&gt;&lt;finance&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22772" PostTypeId="1" AcceptedAnswerId="22774" CreationDate="2016-01-15T18:50:29.500" Score="1" ViewCount="833" Body="&lt;p&gt;In order to solve an exercise, I need data from real European Call Options (on the same underlying). It sounds definitely trivial, but actually I feel a bit lost...do you mind giving a link/suggestion on where can I search, please?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, this link (&lt;a href=&quot;http://www.nasdaq.com/symbol/amzn/option-chain?callput=call&amp;amp;expir=stan&quot; rel=&quot;nofollow&quot; title=&quot;link&quot;&gt;http://www.nasdaq.com/symbol/amzn/option-chain?callput=call&amp;amp;expir=stan)&lt;/a&gt; seems perfect.&#xA;There are clearly listed all the usual informations I need (maturity time, strike price,...) but I don't understand the type of the option.&#xA;It says &quot;call&quot; but...European Call? American Call? ...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yahoo Finance seems a great source too, but I found the same problem.&#xA;For instance, here (&lt;a href=&quot;https://finance.yahoo.com/q/op?s=IBM&amp;amp;m=2016-02?s=IBM160219C00135000+Options&quot; rel=&quot;nofollow&quot;&gt;https://finance.yahoo.com/q/op?s=IBM&amp;amp;m=2016-02?s=IBM160219C00135000+Options&lt;/a&gt;) there are the &quot;Call options from IBM&quot; (right?) but again..are they call of which type?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks very much in advance.&#xA;Regards&lt;/p&gt;&#xA;" OwnerDisplayName="user19019" LastActivityDate="2016-01-15T19:14:54.303" Title="Where are the prices of real European Call options listed?" Tags="&lt;options&gt;&lt;european-options&gt;&lt;data-source&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22773" PostTypeId="1" CreationDate="2016-01-15T19:09:20.840" Score="3" ViewCount="197" Body="&lt;p&gt;Firstly I am a newbie so I will apologise in advance if this is in the wrong forum. My question concerns testing for an equity trading strategy and I would appreciate any comments as to whether my approach is sensible or an alternative methodology would be more appropriate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(a) Since I have a limited amount of historical data, circa 10 years, for test purposes and to reduce data snooping I have selected to use a stationary bootstrap technique to resample the returns data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(b) I then evaluate the various strategies based on the resampled data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(c) Based on repeating steps (a) and (b) for say 100 iterations I then determine the modal value of the test metric.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(d) Thereafter I carry out a paired 'T' test on the modal value to identify whether any variation is significant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would very much appreciate guidance as to whether the above approach is sensible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Chris &lt;/p&gt;&#xA;" OwnerUserId="18926" LastActivityDate="2016-01-15T19:09:20.840" Title="Strategy Testing" Tags="&lt;backtesting&gt;&lt;testing&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22774" PostTypeId="2" ParentId="22772" CreationDate="2016-01-15T19:14:54.303" Score="2" Body="&lt;p&gt;For the US market nearly all options on securities are american whereas the options on indexes are european. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you can do is to use a database such as OptionMetrics which adjusts the stock american options to european options by taking into account the early exercise premium.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2016-01-15T19:14:54.303" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="22775" PostTypeId="2" ParentId="21236" CreationDate="2016-01-15T21:39:26.683" Score="7" Body="&lt;p&gt;You can guesstimate by vega weighted implied vol. This is why:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say that you have a portfolio of options with prices $P_j$. Each one of them has a different pricing function $f_j$ (as function of vol) and a different implied vol $\sigma_j$. For each option $f_j(\sigma_j)=P_j$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you put them together in a single product. If the implied vol of the product is $\sigma$ then $\sum f_j(\sigma)=\sum P_j$. Now, approximately each pricing function will satisfy $f_j(\sigma)\approx P_j+V_j (\sigma-\sigma_j)$ as a linear expansion around its price, with $V_j$ the Vega.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you substitute and solve you end up with the vega weigted vol&#xA;$$\sigma \approx \frac{\sum V_j\sigma_j}{\sum V_j}$$&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-01-15T21:39:26.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22776" PostTypeId="1" AcceptedAnswerId="23082" CreationDate="2016-01-16T01:42:15.313" Score="3" ViewCount="149" Body="&lt;p&gt;A portfolio of long positions in call options with the same maturity and strikes on different assets is worth more than a call option on a portfolio of the same assets with the same weight; i.e. $$\sum_{i=1}^{n}\lambda_i C(T,K,S^{(t)},t) \geq C(T,K,\hat{S},t),$$ where $\lambda_i\geq 0$ and $S^{(i)}$ for $i = 1,\ldots,n$ are assets and $\hat{S} = \sum_{i=1}^{n}\lambda_i S^{(i)}$ is a value of a portfolio which has $\lambda_i$ units of asset $S^{(i)}$ for each $i = 1,\ldots,n$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems like an application of the triangle inequality, but I am not sure how to formally write it. Any suggestions is greatly appreciated. &lt;/p&gt;&#xA;" OwnerUserId="19002" LastActivityDate="2016-02-03T21:37:40.160" Title="Call options and portfolio of the same options worth less?" Tags="&lt;options&gt;&lt;finance&gt;" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="22777" PostTypeId="1" CreationDate="2016-01-16T10:50:07.313" Score="2" ViewCount="3647" Body="&lt;p&gt;I'm doing some analysis on log returns and I notice that returns can exceed 100%. For example, if a security's close price \$1 today and \$10 yesterday, the log return is $ln(1) - ln(10) = -230\%$! Under arithmetic computation, returns for a long position cannot exceed 100% (i.e. the initial investment). So how would i interpret a log return of -230%?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alex&lt;/p&gt;&#xA;" OwnerUserId="19023" LastActivityDate="2016-01-16T20:56:09.620" Title="How to interpret negative log return more than -100%?" Tags="&lt;log-returns&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="1" ClosedDate="2016-01-17T07:49:02.153" ContentLicense="CC BY-SA 3.0" />
  <row Id="22778" PostTypeId="2" ParentId="22777" CreationDate="2016-01-16T11:57:04.853" Score="4" Body="&lt;p&gt;Large?                                                  ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The relationship between normal and log returns is&#xA;$$(normal return) = exp(log return)-1$$&#xA;Therefore log-returns can be from $-\infty$ to $+\infty$ while normal ones can only be between $-1$ and $+\infty$.                               &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-01-16T11:57:04.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22779" PostTypeId="2" ParentId="22777" CreationDate="2016-01-16T14:13:16.673" Score="2" Body="&lt;p&gt;The result is: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ e^{(-230%)} - 1 = -89% $&lt;/p&gt;&#xA;" OwnerUserId="7827" LastActivityDate="2016-01-16T14:13:16.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22780" PostTypeId="1" AcceptedAnswerId="26334" CreationDate="2016-01-16T15:28:37.443" Score="2" ViewCount="94" Body="&lt;p&gt;Let us have two random variables $A$ and $B$ representing lifetimes of two elements of a system, where $A$ has cdf $F_A(x)$, $A \sim Exp(\lambda_1 + \lambda_{12})$ and $B$ has cdf $F_B(y)$, $B \sim Exp(\lambda_2 + \lambda_{12})$, with joint cdf $H(x,y)$ .  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Marshall-Olkin copula is defined as survival copula&lt;br&gt;&#xA;$$\bar{H}(x,y) = C_{\theta_A, \theta_B}(u,v) = \min (u^{1-\theta_A}v, uv^{1-\theta_B})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $$\theta_A = \frac{\lambda_{12}}{\lambda_1+\lambda_{12}} \text{  and   } \theta_B = \frac{\lambda_{12}}{\lambda_2+\lambda_{12}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$u = \bar{F_A}(x) = 1 - F_A(x)  \text{  and  }v = \bar{F_B}(y) = 1- F_B(y)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the formula for non-survival Marshall-Olkin copula that would have $u = F_A(x)$ and $v=F_B(y)$?&lt;/p&gt;&#xA;" OwnerUserId="11585" LastActivityDate="2016-05-30T14:40:18.167" Title="Relation of survival and non-survival Marshall-Olkin copula" Tags="&lt;copula&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22781" PostTypeId="1" AcceptedAnswerId="23063" CreationDate="2016-01-16T16:31:38.907" Score="3" ViewCount="363" Body="&lt;p&gt;An account manager has $N$ distinct, equally-sized pots of money, which will be used to make $N$ distinct subportfolios, each of which is drawn from a slightly different (but potentially overlapping) set of potential assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rates of return from all of the assets in the whole problem are contained in the vector $\textbf{R}$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\textbf{R}= \begin{pmatrix}&#xA;R_1 \\&#xA;R_2 \\&#xA;\vdots \\&#xA;R_I &#xA;\end{pmatrix}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rates of return for each asset are normally distributed random variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each subportfolio $n=1,2,...,N$ allocates investment weights, represented in the vector $x_n$, to the different assets in its particular set of $K$ potential assets, which are found at scattered positions inside the vector $\textbf{R}$. (The 'investable universe' for each subportfolio is not random. The assets available to each subportfolio are very specific, but they are not necessarily clustered in the same region of the vector $\textbf{R}$.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\textbf{x}_n= \begin{pmatrix}&#xA;x_1 \\&#xA;x_2 \\&#xA;\vdots \\&#xA;x_K &#xA;\end{pmatrix}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The weights &lt;em&gt;within&lt;/em&gt; each subportfolio must sum to 1. i.e., where $\textbf{1}$ is a K-by-1 vector of 1s:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\textbf{x}_n\textbf{1}=x_1+x_2+...+x_K=1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rates of returns from the specific assets belonging to subportfolio $n$ could be listed in another vector, $\textbf{R}_n$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A variance-covariance matrix $\textbf{C}$ contains all the variances associated with each asset and the covariances in returns between them.&#xA;The manager is interested only in the expected return and variance of the whole portfolio. If some subportfolios suffer for the greater good of the whole portfolio, so be it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you could put all the subportfolio vectors $\textbf{x}_n$ into a single vector of weights $\textbf{X}$ (containing all the investments made across the whole suite of subportfolios), the variance of the whole portfolio would, I presume, be $\sigma^2_p=\textbf{X}'\textbf{C}\textbf{X}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to know how you would work out the optimization problem for the account manager as to how to distribute its investment within each subportfolio, given the covariances etc between the different assets. Putting all their investments on the asset with the single highest expected return within each subportfolio is presumably a bad move if these assets are all very highly correlated!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would you simply set this up as a Lagrange multiplier problem with loads of constraints, each one specifying the 'investable universe' available to each subportfolio? I'm unsure where to begin, so any advice about this kind of question would be really appreciated. Thanks!&lt;/p&gt;&#xA;" OwnerUserId="18979" LastEditorUserId="18979" LastEditDate="2016-01-16T19:26:46.610" LastActivityDate="2016-02-11T07:59:07.427" Title="Portfolio with lots of subportfolios" Tags="&lt;portfolio-management&gt;&lt;optimization&gt;&lt;modern-portfolio-theory&gt;&lt;covariance-matrix&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22782" PostTypeId="2" ParentId="22743" CreationDate="2016-01-16T19:16:32.507" Score="1" Body="&lt;p&gt;&lt;strong&gt;EDITED&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your interpretation is wrong. If r&gt;1 (not in absolute value) the series follows and explosive and therefore is not stationary. If you reject the unit root it means that the series does not have a unit root, because as it is stated in the comments the hypothesis is h0: r=1 H1: r&amp;lt;1. so rejecting means that all every single root of Q  lies inside the unit circle. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks Richard Hardy for the correction&lt;/p&gt;&#xA;" OwnerUserId="18443" LastEditorUserId="18443" LastEditDate="2016-03-03T09:49:03.627" LastActivityDate="2016-03-03T09:49:03.627" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22783" PostTypeId="2" ParentId="22777" CreationDate="2016-01-16T20:31:55.293" Score="1" Body="&lt;p&gt;If the value is &lt;code&gt;$1&lt;/code&gt; today and was &lt;code&gt;$10&lt;/code&gt; yesterday&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;return = today/yesterday - 1 = 1/10 - 1 = -0.9 = -90%&#xA;&#xA;log return  = ln(1 - 0.9) = -2.302585&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;check :&lt;/em&gt; &lt;a href=&quot;http://www.mathwarehouse.com/compound-interest/continuously-compounded-interest.php&quot; rel=&quot;nofollow noreferrer&quot;&gt;A = P e^rt&lt;/a&gt; = &lt;code&gt;$10 * e^-2.302585 = $1&lt;/code&gt; (i.e. today's value) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since investments &lt;em&gt;can&lt;/em&gt; end up in the red it's interesting to consider a return that exceeds -100%, for instance if today's value is &lt;code&gt;-$1&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;return = today/yesterday - 1 = -1/10 - 1 = -1.1 = -110%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now the log return method breaks down since the natural log cannot be taken for a negative number (unless imaginary numbers are used)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;log return  = ln(1 - 1.1) = -2.30259 + 3.14159 i&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The curve for ln(x) is only in the positive domain of x.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/mYH2f.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/mYH2f.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://hotmath.com/hotmath_help/topics/logarithmic-functions.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;image source&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7178" LastEditorUserId="7178" LastEditDate="2016-01-16T20:56:09.620" LastActivityDate="2016-01-16T20:56:09.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22789" PostTypeId="1" AcceptedAnswerId="22792" CreationDate="2016-01-17T08:03:22.470" Score="1" ViewCount="541" Body="&lt;p&gt;I am working on a project which requires volatility estimation using range based volatility. Is there any package in R which helps me in estimating the CARR model proposed by Chou (2005). &lt;/p&gt;&#xA;" OwnerUserId="19037" LastActivityDate="2016-01-17T13:01:48.663" Title="Is there any package in R for conditional autoregressive range model (CARR)?" Tags="&lt;volatility&gt;&lt;time-series&gt;&lt;econometrics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22790" PostTypeId="1" CreationDate="2016-01-17T09:52:01.573" Score="2" ViewCount="249" Body="&lt;p&gt;So I am not sure whether the following pricing of the bond is possible. Given the stochastic interest rate, one wants to price the bond with the floating coupon rate or the coupon rate being unknown. How should one price this bond if both forward interest rate and coupon rate are not known in the sense that both are random. &lt;/p&gt;&#xA;" OwnerUserId="19038" LastActivityDate="2016-01-18T20:00:48.297" Title="Pricing bonds of float coupon rate by stochastic interest rate" Tags="&lt;bond&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22792" PostTypeId="2" ParentId="22789" CreationDate="2016-01-17T13:01:48.663" Score="1" Body="&lt;p&gt;Welcome to quant.SE! I do not have specific experience with the CARR Model, however, I had a short look in the paper you mentioned: As far as I understand the model specification you just implement a GARCH(p,q) estimation for the range $R_t:=\max{P_\tau}-\min{P_\tau}$ where $\tau=t-1,t-1+\frac{1}{n},\dots,t$ where $n$ is the number of intervals used in measuring the price. Instead of implementing GARCH for the returns $r_t$ you just compute the same for &#xA;$$R_t=\lambda_t\varepsilon_t\\\lambda_t=\omega+\sum\alpha_iR_{t-1}+\sum\beta_i\lambda_{t-1}$$.&#xA;This is in line with Section 1.2 of the original paper, stating: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A convenient property for CARR is the ease of estimation. Specifically, the QMLE&#xA;  estimation of the CARR model can be obtained by estimating a GARCH model&#xA;  with a particular specification: specifying a GARCH model for the square root of&#xA;  range without a constant term in the mean equation&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Therefore, to answer your question: Just compute a time-series $R_t$ of ranges and then run any package computing GARCH for you, for example &lt;a href=&quot;https://www.google.at/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;sqi=2&amp;amp;ved=0ahUKEwjj5q7P87DKAhWHORQKHSorANgQFgggMAA&amp;amp;url=https%3A%2F%2Fcran.r-project.org%2Fweb%2Fpackages%2FfGarch%2FfGarch.pdf&amp;amp;usg=AFQjCNEqTbcYmyqVKDiXeXkM4M6SD2ozBg&amp;amp;bvm=bv.112064104,d.d24&amp;amp;cad=rja&quot; rel=&quot;nofollow&quot;&gt;fGarch&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="16249" LastActivityDate="2016-01-17T13:01:48.663" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22793" PostTypeId="1" CreationDate="2016-01-17T15:01:32.770" Score="1" ViewCount="40" Body="&lt;p&gt;For an exercise I am asked to calculate an integral with a monte carlo simulation, after that I need to optimize the results with a control variate. This was the given integral:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\int_0^1 \! \frac{\sin(1-x)}{\sqrt[3]{x}} \, \mathrm{d}x.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I understand, this isn't that hard. Especially since this is an integral with domain [0,1]. I basically only need to generate a U(0,1) variable, insert this in the follwing formula and in the end take the average result as my solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{\sin(1-x)}{\sqrt[3]{x}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I am now asked to introduce a control variate to optimize my result. In my understanding, a control variate is another stochastic variable of which the expected value is known. I don't know however what the criteria are when you are searching for a control variate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example: in the example of control variates of wikipedia they chose $g(x)=1+x$ as a control variate for $f(x)=\frac{1}{1+x}$. Is this a good control variate because it is a simplified version of the original integral?&lt;/p&gt;&#xA;" OwnerUserId="17778" LastActivityDate="2016-01-17T15:01:32.770" Title="Optimizing Monte Carl integral calculation with control variate" Tags="&lt;monte-carlo&gt;&lt;simulations&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22796" PostTypeId="2" ParentId="22754" CreationDate="2016-01-17T18:31:06.243" Score="1" Body="&lt;p&gt;First it would help to know some more details about what you mean by maximum capacity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However here are a few things to consider.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Do you have a simulator you use to simulate your strategy with market data?&lt;/li&gt;&#xA;&lt;li&gt;If answer to above is yes then you can clearly see the linear impact due to market liquidity constraints for your increased size.&lt;/li&gt;&#xA;&lt;li&gt;Now 2 is easy only if you take liquidity. If you actually provide liquidity it is more difficult.&lt;/li&gt;&#xA;&lt;li&gt;That said 2 will atleast give you an estimate of the lower bound ( by lower I mean minimum friction).&lt;/li&gt;&#xA;&lt;li&gt;you then also have to consider the market impact, adverse selection and all these are far more complicated. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So to summarize you need to know the edge you have and how much of the edge gets eaten up by each of the successive steps above. Hope this was helpful.&lt;/p&gt;&#xA;" OwnerUserId="19043" LastActivityDate="2016-01-17T18:31:06.243" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22797" PostTypeId="2" ParentId="7761" CreationDate="2016-01-17T18:57:17.510" Score="2" Body="&lt;p&gt;To get IV I do the following:&#xA;1) change sig many times and calculate C in BS formula every time. &#xA;That can be done with OIC calculator &#xA;All other parameters are kept constant in BS call price calculations. The sig that corresponds to C value closest to the call market value is probably right. &#xA;2) without OIC calculator for every chosen sig I am using old approach: calculate d1, d2, Nd1, Nd2 and BS option value. Again calculated BS value closest to the market value probably correspond to correct IV.&lt;/p&gt;&#xA;" OwnerUserId="19044" LastActivityDate="2016-01-17T18:57:17.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22798" PostTypeId="1" AcceptedAnswerId="22805" CreationDate="2016-01-17T19:41:29.503" Score="2" ViewCount="586" Body="&lt;p&gt;For a Variance swap we can split the pnl into a realized part and a &quot;forward going&quot; part. To be more precise:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume we enter the trade at t0, and the variance swap has tenor T and a strike $Kvar$. At time $t0&amp;lt; t &amp;lt; T$ we look at the value of variance swap. We will see that: $V (t_0; t) = \lambda ( Var_{realized}    - Kvar ) + (1-\lambda)(Knew - Kvar )$ where $\lambda$ is the fraction of time that has passed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks to me that such a decomposition is not possible for correlation swaps but only for covariance swaps. Since the correlation swap depends on realized volatility. And realized volatility can not be decomposed in this fashion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be more precise I will define what I mean with correlation swap.&#xA;The correlation swap is on N stocks. The swap starts at $t_0$ and ends on $T$ assume that between t0 and T there are exactly M trading days.&#xA;At maturity $T$ the payout will be $\hat{\rho} - K$, where $\hat{\rho}$ is the realized correlation (to be defined below).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For $i=1,..,N$ we have the daily realized return $R_i(t_k) = ln\left(\frac{S_i(t_{k+1})}{S_i(t_k)} \right)$. The realized correlation $\hat{\rho}$ over time interval $[t_0, T]$ is defined to be $\hat{\rho} = \frac{1}{n(n-1)}\sum_{i,j} \frac{COV(i,j)}{\sigma_i \sigma_j}$. In this equation we define $COV(i,j) = \frac{1}{m-1}\sum_{k = 1}^{M} (R_i(t_k) - \bar{R_i}) (R_j(t_k) - \bar{R_j})$. So COV(i,j) measures the realized correlation between stocks i and j over the time interval [t0, T]. The realized vols $\sigma_i$ and $\sigma_j$ are defined similarly in terms of $R_i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore the realized correlation measures for each pair i,j for every trading day what the correlation was. The swap pays out the difference between what was realized (as defined above) and the fixed strike.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What would happen with the pnl if we would look at the trade at time $t0 &amp;lt; t &amp;lt; T$? If the swap linear in time $t_k$ then we could split the price up in a piece that was realized up to t and replace the remainder with a new swap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my questions are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Do you agree that this decomp can not be done for correlation swap?&lt;/li&gt;&#xA;&lt;li&gt;If one would do this decomp, how bad is the error?&lt;/li&gt;&#xA;&lt;li&gt;Any alternative ways that are better than the decomp discussed above?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="17316" LastEditorUserId="17316" LastEditDate="2016-01-18T18:53:18.950" LastActivityDate="2016-01-18T18:53:18.950" Title="decompose correlation swap pnl" Tags="&lt;correlation&gt;&lt;derivatives&gt;&lt;swaps&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22801" PostTypeId="2" ParentId="18215" CreationDate="2016-01-18T03:31:24.613" Score="38" Body="&lt;p&gt;You are not clear if you want the S&amp;amp;P500 index (SPY), OPRA Options or the Futures.  Having spent a lot of time exploring vendors, here is a summary to help you (in alphabetical order):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.algoseek.com&quot; rel=&quot;noreferrer&quot;&gt;AlgoSeek.com&lt;/a&gt; : Intraday data back to 2007 for US Equities, Futures and Options. So you can get S&amp;amp;P 500 data. Intraday they have tick, 1 sec, 1 min and 5 min OHLC bars. Institutional data and well priced.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.barchartmarketdata.com&quot; rel=&quot;noreferrer&quot;&gt;BarChartMarketData.com&lt;/a&gt; : Been collecting Futures data for 50+ years. Also have Options and some Equity. For Futures data they have a great reputation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bloomberg : All the data you ever need BUT you are limited in the amount of intraday data you can export from your Bloomberg and upto about 250 days historically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reuters: Great historical dataset but difficult to work with for an individual. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.quantgo.com&quot; rel=&quot;noreferrer&quot;&gt;QuantGo.com&lt;/a&gt; : New firm where clients rent access to data by the month from multiple data vendors but have to use Amazon AWS cloud computers on QuantGo's platform.  Very affordable if you are can/willing to work with virtual cloud computers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.tickdata.com&quot; rel=&quot;noreferrer&quot;&gt;Tickdata.com&lt;/a&gt; : Global Equities, Futures and Options. Intraday bar data from 2004. Consolidated tape since 1993.  Have tick and bar data with 1 sec/1 min/5 min OHLC.  Institutional quality data but very expensive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://datashop.cboe.com&quot; rel=&quot;noreferrer&quot;&gt;CBOE Datashop&lt;/a&gt;: &#xA;Somewhat pricey, but you can get 1 minute data for every strike and every expiration.&lt;br&gt;&#xA;Probably more than you need.  &lt;/p&gt;&#xA;" OwnerUserId="19051" LastEditorUserId="26556" LastEditDate="2019-09-02T14:22:46.513" LastActivityDate="2019-09-02T14:22:46.513" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="22802" PostTypeId="2" ParentId="3078" CreationDate="2016-01-18T04:07:29.620" Score="1" Body="&lt;p&gt;You are not clear if you mean Level 2 data as in top-of-book for each exchange showing the Bid/Ask from exchange or each exchange's direct feed with full depth.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The exchange full depth direct feeds have become very expensive in last few years as exchanges increase revenue from them, for example NYSE OpenBook is now approx 6,000 per month and Nasdaq Itch is $3,500 per month.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are some vendors (in alphabetical order) who can help:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;AlgoSeek.com : Has years of consolidated feed (aka the TAQ, Consolidated feed) showing Bid/Ask from each exchange.  Also has direct feed full depth from ARCA, BATS, EDGEX/A, Nasdaq. Reasonably priced as these things go.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;dxFeed.com : See posting above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interactive Brokers. As mentioned above, you can collect data through IB but be aware that it is snapshot data taken every 100 milliseconds (every 1/10th of a second) so you do not get a real accurate dataset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nanex.net : Has been collecting and analyzing data for many years now and they will sell it.  Published pricing is about $600 to buy one month of data, but will negioate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;QuantGo.com : A clould platform where clients can rent access to years of historical tickd data from multiple data vendors. Most affordable solution (eg. $275 per month to access all 6 years of Equities trades and quotes) BUT you have to use your own comptuer instance in the Amazon AWS cloud.  You get your own computer in the cloud...it is how they ensure the data can be rented.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;TickData.com : Have all the consolidated data with Bid/Ask from each exchange.  Great data quality.  You can buy just the symbols you need or the whole universe. Do not have full depth data. More expensive than other vendors but great quality.&lt;/p&gt;&#xA;" OwnerUserId="19051" LastActivityDate="2016-01-18T04:07:29.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22803" PostTypeId="2" ParentId="8735" CreationDate="2016-01-18T04:19:36.813" Score="0" Body="&lt;p&gt;Check out BarchartOnDemand. They have CME EOD data as an API...it may not be advertised but I know is available via their API (&lt;a href=&quot;http://www.barchartondemand.com/api.php&quot; rel=&quot;nofollow&quot;&gt;http://www.barchartondemand.com/api.php&lt;/a&gt; ). Pricing is not published but should be reasonable for an individual just looking for EOD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also get the same data through QuantGo.com but have to use it on your own computer instance in their Amazon cloud.&lt;/p&gt;&#xA;" OwnerUserId="19051" LastActivityDate="2016-01-18T04:19:36.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22804" PostTypeId="2" ParentId="21441" CreationDate="2016-01-18T06:47:57.090" Score="1" Body="&lt;p&gt;You can use RATS software in which VAR GARCH is inbuilt function with CCC, DCC VECH and BEKK for co-variance estimation.&lt;/p&gt;&#xA;" OwnerUserId="19037" LastActivityDate="2016-01-18T06:47:57.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22805" PostTypeId="2" ParentId="22798" CreationDate="2016-01-18T07:05:56.313" Score="0" Body="&lt;p&gt;I assume that this decomposition is possible in the case of a variance swap as variance is decomposable in the sense that &#xA;$$&#xA;V = VAR(R_1+ \cdots + R_N) \approx \frac1N \sum_{i=1}^N R_i^2 .&#xA;$$&#xA;This for any $n \le N$ we can write&#xA;$$&#xA;V \approx  \frac1N \sum_{i=1}^n  R_i^2 + \frac1N \sum_{i=n+1}^N  R_i^2 = \frac n N \frac1n \sum_{i=1}^n  R_i^2 +  \frac{N-n}{N} \frac{1}{N-n} \sum_{i=n+1}^N  R_i^2.&#xA;$$ &#xA;In the formulas above you see the weights depending on the time that has passed relative to the total period and the variance terms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not assume that this is possible for a correlation swap. For realized correlation as well as for implied correlation you get not interpretable terms in the denominator.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-01-18T07:05:56.313" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22806" PostTypeId="1" CreationDate="2016-01-18T09:46:31.050" Score="1" ViewCount="271" Body="&lt;p&gt;The interest rate risk of a bond price $P$ is measured by its Duration:&#xA;$$D=-\frac{\frac{dP}{P}}{dr}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the explicit formula for the Duration given a function $P$ is different if $r$ is expressed in continuous or discrete compounding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $r$ is calculated in discrete compounding, the modified Duration should be used:&#xA;$$D^{Mod}=\frac{D}{1+r}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there also an expression for the relationship of Convexity under discrete vs. continuous compounding?&#xA;The convexity of a bond is defined as the second derivative of the bond price:&#xA;$$C=\frac{\frac{d^2P}{P}}{dr^2}$$&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2016-01-18T09:46:31.050" Title="Bond Convexity: Relationship between discrete and continuous interest rate" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;bond&gt;&lt;duration&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22807" PostTypeId="1" AcceptedAnswerId="22818" CreationDate="2016-01-18T11:37:18.303" Score="1" ViewCount="182" Body="&lt;p&gt;When reading an article about banking industry I came up with two questions. I'd be very pleased If somebody could clarify them:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;How concepts of unrecovered debt and NPL are related? &lt;/li&gt;&#xA;&lt;li&gt;When banks write off debt (remove from balance sheet)? Only when they sell them to Asset Management Companies or when it became unrecovered?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="19053" LastActivityDate="2018-09-05T07:52:07.070" Title="Unrecovered debt" Tags="&lt;banks&gt;&lt;debt&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22809" PostTypeId="2" ParentId="22807" CreationDate="2016-01-18T13:38:56.047" Score="1" Body="&lt;p&gt;You can think of it as a 3 state Markov Chain: when a loan is made it is considered GOOD. As long as it is good, the bank automatically accrues earnings on this loan. When the bank notices that a payment from the customer has been missed for a certain time (usually 90 days) the loan becomes NPL or non performing loan; the bank stops recognizing income on this loan, but it is still on the books as an asset and the bank still hopes to recover something. If the customer is able to resume payments, the loan becomes good again. If some time passes, with no progress made, they can sell it to another company, in which case it goes off the books, or they can declare it UNRECOVERABLE and write it off (again it disappears from the books) (partially or totally). Declaring the loan unrecoverable is a judgement the bank has to make and like many painful decisions in life banks often delay this step as much as possible. Ultimately it is the central bank or the bank supervisor that insists that action be taken and perhaps defines criteria for this step. Procedures vary widely by country and situation.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-01-18T22:49:02.970" LastActivityDate="2016-01-18T22:49:02.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22810" PostTypeId="1" AcceptedAnswerId="22812" CreationDate="2016-01-18T14:37:52.077" Score="2" ViewCount="316" Body="&lt;p&gt;I intend to thoroughly prepare for an internship that I will start in a couple of months, and therefore wanted to clarify what topics I need to study and some recommended references for them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The description for the internship is as follows: the intern will be a part of research for quant trading strategies, will be given a live project and will learn how to develop and backtest trading strategies for equities, forex, commodities, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for my existing background, I once did a project in mathematical finance on option pricing in Markov modulated markets (which I think may not be related a whole lot to the internship) and I also learned a bit of C and Python programming languages earlier. I have absolutely no prior experience in the area of quant trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd be grateful for any advice regarding what to study, and for suggestions on what book(s) or papers (e.g. which among the quant papers on sites like arxiv.org) to read, or if there are any websites/software that simulate the kind of work I will need to undertake.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="19057" LastActivityDate="2016-01-18T16:27:59.457" Title="Reference request: Quantitative Trading Strategies" Tags="&lt;quant-trading-strategies&gt;&lt;reference-request&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ClosedDate="2016-01-18T21:52:52.020" ContentLicense="CC BY-SA 3.0" />
  <row Id="22811" PostTypeId="1" CreationDate="2016-01-18T14:48:30.943" Score="2" ViewCount="596" Body="&lt;p&gt;I want to use the Cubic spline interpolation technique so I can interpolate yield curve points. Now I wonder if I can use the standard matlab function interpl1 (and then using the 'spline' method) or does this yield totally different interpolated points? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this function is not suitable for my purpose where can I can find some code or references to a cubic spline method so I can create a cubic spline function in matlab myself?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="16788" LastActivityDate="2016-01-19T13:42:36.343" Title="Cubic spline interpolation function within Matlab" Tags="&lt;yield-curve&gt;&lt;matlab&gt;&lt;interpolation&gt;&lt;curve-fitting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22812" PostTypeId="2" ParentId="22810" CreationDate="2016-01-18T16:27:59.457" Score="3" Body="&lt;p&gt;I did a similar internship at a quant equity shop and based on my experience, I think there are a few common aspects to such work, which you can try and work on, to have a more productive internship experience:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) handle on programming language - check with the firm what programming language they'd want you to work in. And in case, you have never worked in it, spend some time getting used to it. Some firms can be flexible on this but some want you to work in specific language only (e.g in my case I learnt SAS, since the firm mostly used SAS)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) broader understanding of 'quant trading' and what you are after - incase you have had a coursework on this, revise that. Or pick a book to get a general idea about the discipline. e.g. Inside the black box by Rishi Narang, could be a useful read&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) experience with data - its good if you have had some prior experience with the dataset you'd be using over the internship, but in your case, since you don't know what you'd be working on - equity, forex, commodities or something else, don't worry about it&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) experience with backtesting - you could practice by running a backtest of a simple well documented strategy (such as value/ momentum/ Fama- French factors etc). This will give you a better hold on some of the things that you should look out for, such as avoiding 'look ahead' bias, selecting relevant securities etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, you should check with your guide at the company, if there are any relevant research papers/ background reading material, that they would like you to read in the meantime.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All the best.&lt;/p&gt;&#xA;" OwnerUserId="17405" LastActivityDate="2016-01-18T16:27:59.457" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22814" PostTypeId="1" AcceptedAnswerId="22815" CreationDate="2016-01-18T17:25:57.863" Score="0" ViewCount="62" Body="&lt;p&gt;An investor has a £40,000 portfolio, 40% of which is invested in bonds.The investor wishes to add funds to the portfolio by purchasing bonds so that 52% of the entire portfolio is invested in bonds. What value of bonds should the investor purchase? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My solution is as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;40% of the portfolio is £16,000, and 52% of the portfolio is £20,800. Thus in order for the portfolio to be consist of 52% bonds, the investor must purchase £20,800 - £16,000 = £4,800 worth of bonds. Once the investor has spent an extra £4,800 on bonds, this brings the total amount spent on bonds to £20,800, which is 52% of the portfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The actual answer is £10,000. How is my solution wrong and where am I misunderstanding?&lt;/p&gt;&#xA;" OwnerUserId="8010" LastActivityDate="2016-01-18T17:32:37.170" Title="Reshuffling the weighting of assets in an investment portfolio" Tags="&lt;portfolio-management&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22815" PostTypeId="2" ParentId="22814" CreationDate="2016-01-18T17:32:37.170" Score="1" Body="&lt;p&gt;The portfolio is worth 40000, after adding to it it will be worth 40000+X. The portfolio now has 16000 in bonds, after adding it will have 16000+X in bonds. Find X such that (16000+X)/(40000+X) = 0.52&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answer is 10000.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2016-01-18T17:32:37.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22816" PostTypeId="2" ParentId="22790" CreationDate="2016-01-18T18:13:54.353" Score="2" Body="&lt;p&gt;Consider the calculation period $[T_1, T_2]$ and the floating coupon rate &#xA;\begin{align*}&#xA;L(T_1; T_1, T_2) = \frac{1}{T_2-T_1}\left(\frac{1}{P(T_1, T_2)} -1 \right)&#xA;\end{align*}&#xA;set at $T_1$ and  paid at $T_2$, where $P(t, u)$ is the price at time $t$ of a zero-coupon bond with maturity $u$ and unit face amount.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $B_t= \exp\left(\int_0^t r_s ds \right)$ the money market account value to time $t$. Moreover, let $Q$ be the risk-neutral measure and $Q_{T_2}$ be the $T_2$-forward measure. Then&#xA;\begin{align*}&#xA;\frac{dQ}{dQ_{T_2}}\big|_{\mathcal{F}_t} = \frac{P(0, T_2)B_{t}}{P(t, T_2)}.&#xA;\end{align*}&#xA;Moreover, the value of the floating coupon payment is given by&#xA;\begin{align*}&#xA;E_Q\left(\frac{L(T_1; T_1, T_2) \times (T_2-T_1)}{B_{T_2}} \right)&amp;amp;=E_{Q_{T_2}}\left( \frac{dQ}{dQ_{T_2}}\big|_{\mathcal{F}_{T_2}}\frac{L(T_1; T_1, T_2) \times (T_2-T_1)}{B_{T_2}}\right)\\&#xA;&amp;amp;=P(0, T_2) E_{Q_{T_2}}\left( L(T_1; T_1, T_2) \times (T_2-T_1)\right)\\&#xA;&amp;amp;=P(0, T_2) E_{Q_{T_2}}\left( \frac{1}{P(T_1, T_2)} -1 \right)\\&#xA;&amp;amp;=P(0, T_2) E_{Q_{T_2}}\left( \frac{P(T_1, T_1)}{P(T_1, T_2)} -1 \right)\\&#xA;&amp;amp;=P(0, T_2)\left( \frac{P(0, T_1)}{P(0, T_2)} -1 \right)\\&#xA;&amp;amp;=P(0, T_1) - P(0, T_2).&#xA;\end{align*}&#xA;For a floating rate note, or bond, the value is the sum of the values of all coupon payments and the value of the notional payment at maturity. Here the valuation is model-free, no matter the interest rate is deterministic or stochastic.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-01-18T20:00:48.297" LastActivityDate="2016-01-18T20:00:48.297" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22817" PostTypeId="1" CreationDate="2016-01-18T20:44:11.227" Score="2" ViewCount="77" Body="&lt;p&gt;If you need to estimate the fair price of a credit default swap on a financial institution, can it be done? Typical structural models tend to break down for the complex debt and asset characteristics of a financial institution. How do traders value CDSs for firms like JP Morgan?&lt;/p&gt;&#xA;" OwnerUserId="17712" LastActivityDate="2016-01-18T20:44:11.227" Title="How are CDS prices calculated for financial institutions?" Tags="&lt;credit-risk&gt;&lt;cds&gt;&lt;default&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22818" PostTypeId="2" ParentId="22807" CreationDate="2016-01-18T21:43:42.963" Score="1" Body="&lt;p&gt;debt/loan lifecycle could be described as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) origination&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) debt is outstanding; borrower makes regular interest payments and prepays (scheduled or unscheduled) if any. debt/loan is considered performing&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2.1) if borrower misses interest payment, debt/loan becomes delinquent, grace period starts&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2.2) grace period expires, still no payment - debt becomes distressed. negotiation between borrower and creditors kicks-off. possible resolutions (credit events):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2.3a) debt is restructured and haircut applied (if any); &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2.3b) borrower files for bankruptcy and seeks protection from creditors. trustee in bankruptcy is appointed; company assets are sold off - recovered funds go to creditors. remaining debt (defaulted balance - recoveries) is considered liquidated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) debt/loan is fully repaid on or before maturity date&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so to answer your first question - non-performing-loan starts from 2.2) grace period expiry and up until 2.3b) when debt becomes liquidated (unrecovered)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to answer your second question - debt holder has two options handling (writing off) bad debt: 1) sell it to distressed debt investors and get money back asap; 2) participate in bankruptcy 2.3b) and seek proceeds from company liquidation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;please be aware the above is just to give you a flavor/direction and the devil is in legal details&lt;/p&gt;&#xA;" OwnerUserId="18275" LastActivityDate="2016-01-18T21:43:42.963" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22819" PostTypeId="1" AcceptedAnswerId="22820" CreationDate="2016-01-19T01:08:00.130" Score="5" ViewCount="32515" Body="&lt;p&gt;I trust market-driven CDS more than credit ratings. Where can one get the CDS of corporate bonds of major companies? Are there any good internet links? If charts on the historical end-of-day prices can be shown, it will be nice. Even better if the data can be downloaded.&lt;/p&gt;&#xA;" OwnerUserId="6190" LastActivityDate="2020-05-01T22:17:14.373" Title="Where to get price data on Credit Default Swaps?" Tags="&lt;market-data&gt;&lt;historical-data&gt;&lt;cds&gt;" AnswerCount="5" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22820" PostTypeId="2" ParentId="22819" CreationDate="2016-01-19T01:31:47.490" Score="9" Body="&lt;p&gt;&lt;a href=&quot;http://www.markit.com/Product/Pricing-Data-CDS&quot;&gt;Markit Pricing Data&lt;/a&gt; is a prime source for cds data (not free).&lt;/p&gt;&#xA;" OwnerUserId="18275" LastActivityDate="2016-01-19T01:31:47.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22821" PostTypeId="1" AcceptedAnswerId="22825" CreationDate="2016-01-19T02:30:15.513" Score="0" ViewCount="352" Body="&lt;p&gt;I'm running some simulations with a leveraged ETF to investigate that notorious leveraged-ETF decay effect I keep hearing about. When I put in a typical Black-Scholes lognormal model of returns on the underlying, I run into the following issue: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is theoretically possible for an ETF to lose half its value in a day. E.g. ITOT can go from a price of 100 dollar to a price of 50 dollars in the next day, for a -50 percent daily return. Now suppose I have a 3x leveraged ETF whose underlying is ITOT. In theory, my return should be 3*(-50)=-150 percent. But this would mean that a 100 dollar investment in the leveraged fund turns into a 50 dollar LIABILITY overnight!! I have not only lost all my money, I now owe 50 dollars! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do any of you know what would &lt;em&gt;actually&lt;/em&gt; happen in this scenario? Would the price just drop to zero? Or would it drop to negative 50 dollars? Do the leveraged-ETF prospectuses address this?&lt;/p&gt;&#xA;" OwnerUserId="19066" LastActivityDate="2016-01-19T11:25:11.913" Title="Leveraged ETF calculation - dropping below zero?" Tags="&lt;black-scholes&gt;&lt;etf&gt;&lt;leverage&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22822" PostTypeId="1" AcceptedAnswerId="22826" CreationDate="2016-01-19T04:41:15.810" Score="0" ViewCount="293" Body="&lt;p&gt;I am reviewing the steps of proof that the binomial model is complete and don't understand the marked in red transition. Could anybody explain this step?&#xA;&lt;br&gt;&#xA;&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $P^{**}$ is a risk-neutral measure, so that &lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E^{**}[\bar{S}_{n+1} | \ F_n] = \bar{S}_n \ \ $ for all n &lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So given the structure of the model,  &lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{1}{(1 + r)^{n+1}}E^{**}[S_{n+1} | \ F_n]=\frac{1}{(1 + r)^{n+1}}(uS_nP^{**}[R_{n+1}=u \ | \ F_n]+dS_nP^{**}[R_{n+1}=d \ | \ F_n])=$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$=\color{red}{\bar{S}_{n} \{ d+(u-d)\ P^{**}[R_{n+1}=u \ | \ F_n] \} }$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;br&gt;&#xA;by martingale condition &lt;br&gt;&#xA;$\frac{1}{1+r} \{ d+(u-d)\ P^{**}[R_{n+1}=u \ | \ F_n] \}=1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so &#xA;$P^{**}[R_{n+1}=u \ | \ F_n]=\frac{1+r-d}{u-d}=p^*$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P^{**}=P^{*}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore the binomial model is complete.&lt;/p&gt;&#xA;" OwnerUserId="18670" LastEditorUserId="18670" LastEditDate="2016-01-19T14:38:58.940" LastActivityDate="2016-01-20T06:50:27.353" Title="completeness of the binomial model - proof" Tags="&lt;option-pricing&gt;&lt;risk-neutral-measure&gt;&lt;no-arbitrage-theory&gt;&lt;binomial&gt;&lt;market-model&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22823" PostTypeId="1" CreationDate="2016-01-19T05:42:20.370" Score="3" ViewCount="221" Body="&lt;p&gt;I am exploring how to determine an &quot;optimal&quot; portfolio in the context of real life data and systems. Specifically, I want to calculate a Kelly Optimal Portfolio (see &lt;a href=&quot;http://edwardothorp.com/sitebuildercontent/sitebuilderfiles/KellyCriterion2007.pdf&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;this paper&quot;&gt;this paper&lt;/a&gt;, especially section 8.4 for the multi-variate case). Calculating fractional allocations between strategies introduces questions the strength and stability of correlations between strategies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[all code in mathematica]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have two lists of daily log returns (truncated for illustration): &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;backret = {{0.0977634,-0.0247598,-0.00951279,.......,.412994,-0.421786,0,-0.0267264,0},{&#xA;-0.0450008,0.0460733,0.073524,0,-0.0794881,.....,.-0.0450008,0.0460733,0.073524,0,-0.0794881}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I use the following function to calculate kelly fractions at regular windows using an unanchored lookback window:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;thorpeMA[listOfReturnVectors_,riskFreeRateAnnualized_,windowsize_,stepsize_]:=&#xA;Module[{stratNumb,retLength,avgreturns,covm,fvector,riskfreevector,fres},&#xA;stratNumb = Length[listOfReturnVectors];&#xA;retLength=Length[Transpose[listOfReturnVectors]];&#xA;riskfreevector = Table[riskFreeRateAnnualized/Sqrt[360],{stratNumb}];&#xA;avgreturns=Partition[Flatten[Table[Last[MovingAverage[Take[Transpose[listOfReturnVectors],i],Min[i,windowsize]]],{i,stepsize, retLength,stepsize}]],stratNumb];&#xA;covm = Table[Covariance[Take[Transpose[listOfReturnVectors],{Max[1,i-windowsize],i}]],{i,stepsize,retLength,stepsize}];&#xA;fvector = Table[Inverse[covm[[i]]].Transpose[{avgreturns[[i]]-riskfreevector}],{i,1,Length[avgreturns]}];&#xA;fres = Partition[Flatten[fvector],stratNumb]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This returns a list of fractions for each, which change through time:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/6MV0T.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/6MV0T.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(In practice, this calculation may needed added constraint of being &gt;= 0 for any given strategy).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More out of curiosity than anything, I decided to explore similar calculations based on randomized (but similarly distributed) data, to see what changes and what stays the same.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;eps =SmoothKernelDistribution[Transpose[backret]]; &#xA;Plot3D[PDF[eps,{ x,y}], {x,-4,4},{y,-4,4} ,PlotRange-&amp;gt;All,ImageSize-&amp;gt;Large]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/hjZbP.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/hjZbP.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, the autocorrelation of each return stream is small:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;AutocorrelationTest/@backret&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;{0.0679951,0.0303144}&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However, the autocorrelation of randomly generated return streams from single-variate return stream distribution vary widely:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alph =KernelMixtureDistribution[mojr]&#xA;vauto=AutocorrelationTest/@Table[RandomVariate[alph, 10^5],200];     &#xA;ListLinePlot[vauto, ImageSize-&amp;gt;Large]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/p9qQl.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/p9qQl.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I apply fraction-determining algorithm to several randomly generated return streams:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;monte = Table[Transpose[RandomVariate[eps, 300]], 500];&#xA;monteF=thorpeMA[#, 0,200,30] &amp;amp; /@ monte;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I calculate the cumulative growth curve for each of these generated return streams and corresponding allocation fractions:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;growthList[fstarvecs_,returnvecs_,stepsize_]:=Module[{fracpairs,returnmatch,growthstream,res},&#xA;fracpairs = Partition[Flatten[Table[Table[fstarvecs[[i]],stepsize],{i,Length[fstarvecs]}]],Length[returnvecs]];&#xA;returnmatch=Take[Transpose@returnvecs,Length@fracpairs];&#xA;growthstream  =Total[#]&amp;amp;/@(fracpairs*returnmatch);&#xA;res=FoldList[#1*(1+#2)&amp;amp;,1,growthstream]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And plotting the results:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;res=Table[growthList[monteF[[i]], monte[[i]],30],{i,Length[monteF]}];&#xA;ListLogPlot[Take[res,100], ImageSize-&amp;gt;Full, Joined-&amp;gt;True]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/40zLW.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/40zLW.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These results vary widely;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#[Last[Transpose[res]]]&amp;amp;/@{Mean, Min, Max,StandardDeviation}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;{133362., -310297., 6.09435×10^7, 2.72618×10^6}&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So after all this, I am left wondering if the random data is really doing anything; it seems to be randomizing the one of the key inputs to the allocation fraction, the correlation/covariance, and thus not really providing useful information. Examining the sampled distribution properties of the correlation across the random sample:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; Apply[#,{Correlation[#[[1]], #[[2]]] &amp;amp; /@ monte}] &amp;amp; /@ {Mean, Min, Max,StandardDeviation, Skewness}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;{0.0265798,-0.123224,0.177558,0.0576346,0.0177617}&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This compares closely to the data for the original distribution:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Correlation[backret[[1]],backret[[2]]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;0.028274&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The mean correlation among random data of .0266 is small but (perhaps) not negligible. This is what I am questioning:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Is it possible that the correlation between the two original data distributions is being modeled somehow? How is this done?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is using randomized return data in this way a useful exercise for portfolio optimization?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What are some approaches to modeling changing correlations throughout time?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I recognize this is a &quot;messy&quot; question. I have provided a lot of background to help describe what is motivating my questions. This is really more about implementation than it is concept; trying to make reasonable assumptions about real world application. I also realize that I may very well be barking up the wrong tree in this whole exercise; I am hoping that if I am, someone may be able to point out a better approach.&lt;/p&gt;&#xA;" OwnerUserId="18144" LastActivityDate="2016-01-19T05:42:20.370" Title="Implementation of Kelly in multivariate case using modeled distributions" Tags="&lt;portfolio-optimization&gt;&lt;kelly-criterion&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22824" PostTypeId="2" ParentId="115" CreationDate="2016-01-19T09:14:25.323" Score="3" Body="&lt;p&gt;I think, the use of stable distributions in Finance (and, probably, in Economics) is a big mistake. It is essential that the intuitive fact that the stable distributed observations possess a large number of big deviations from empirical mean is not true (see, Lev B. Klebanov, Irina Volchenkova (2015) &quot;Heavy Tailed Distributions in Finance: Reality or Mith? Amateurs Viewpoint&quot;, arXiv:1507.07735v1, 1-17  and Lev B Klebanov (2016) &quot;No Stable Distributions in Finance, please!&quot;, arXiv:1601.00566v2, 1-9. ) In financial data one observes many large deviations (in terms of empirical variance) from empirical mean value. It is impossible for Gaussian distributed observations. However, it is impossible for observations with stable distribution, too. &lt;/p&gt;&#xA;" OwnerUserId="19070" LastActivityDate="2016-01-19T09:14:25.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22825" PostTypeId="2" ParentId="22821" CreationDate="2016-01-19T11:25:11.913" Score="1" Body="&lt;p&gt;A 3x leveraged fund that experiences a drop of more than 33% will lose all its money and close down when the value hits 0. Most funds, however, set a lower loss limit, usually around 5%, 10% or 20%, and will try to exit the market if those values are triggered. Of course, it is not that easy to exit efficiently in a day where the market drops that much. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, usually you will not end up with a liability, but most likely lose your investment or retain a small part of it. &lt;/p&gt;&#xA;" OwnerUserId="13808" LastActivityDate="2016-01-19T11:25:11.913" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22826" PostTypeId="2" ParentId="22822" CreationDate="2016-01-19T11:45:07.977" Score="1" Body="&lt;p&gt;What if you write&#xA;$$&#xA;P[R_{n+1} = d|F_n] = 1 - P[R_{n+1} = u|F_n] ?&#xA;$$&#xA;Let us write $P(u) = P[R_{n+1} = u|F_n]$&#xA;Then the part to show is&#xA;$$&#xA;u \bar{S}_n P(u) + d \bar{S}_n (1-P(u))&#xA;$$&#xA;and this &#xA;$$&#xA;\bar{S}_n \left(d +(u-d)P(u)  \right),&#xA;$$&#xA;where we just expanded terms and then extracted the coefficients.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2016-01-20T06:50:27.353" LastActivityDate="2016-01-20T06:50:27.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22827" PostTypeId="2" ParentId="115" CreationDate="2016-01-19T12:11:18.600" Score="2" Body="&lt;p&gt;If certain broad assumptions are correct (eg, asset prices are continuous in time, markets are efficient) then asset returns must follow a Levy process.  Both the Gaussian and Stable distributions are subsets of Levy processes. The question should not be whether Gaussian or Stable is better.  Neither are adequate (in fact, many Stable distributions imply infinite call prices; since call prices are finite we can safely say that these Stable distributions are not the process that generates asset returns).  Instead choose a more general Levy process (eg, &lt;a href=&quot;http://www.math.nyu.edu/research/carrp/papers/pdf/jbarticle.pdf&quot; rel=&quot;nofollow&quot;&gt;CGMY&lt;/a&gt;) and build models from there.&lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2016-01-19T12:11:18.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22828" PostTypeId="2" ParentId="22811" CreationDate="2016-01-19T13:42:36.343" Score="1" Body="&lt;p&gt;Why do you think this is not apropriate? Matlabs documentation for 1-D Data interpolation states that &lt;strong&gt;interpl1&lt;/strong&gt; using method &lt;strong&gt;spline&lt;/strong&gt; is the right way to go:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Spline interpolation using not-a-knot end conditions. The interpolated value at a query point is based on a &lt;strong&gt;cubic interpolation&lt;/strong&gt; of the values at neighboring grid points in each respective dimension.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Therefore just use &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;interp1($x$,$v$,$xq$,'spline');&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;where Vector $x$ contains the sample points, and $v$ contains the corresponding values, $v(x)$. Vector $xq$ contains the coordinates of the query points.&lt;/p&gt;&#xA;" OwnerUserId="16249" LastActivityDate="2016-01-19T13:42:36.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22829" PostTypeId="1" CreationDate="2016-01-19T14:46:01.767" Score="0" ViewCount="171" Body="&lt;p&gt;Good day, &#xA;Please, consult me about Forex Forward Swap (Ex. pair USD/RUB). I am trying to calculate and cant understand, how it works. &#xA;For example:&#xA;I have:&#xA;USD/RUB&#xA;Fwd points 3M - 19650/19950&#xA;IR - 10.63/10.78&#xA;outright price -80.4318/80.4610&#xA; How in works and what formulas shell I use.&#xA;Thank you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update.&#xA;just to clarify. I have: &#xA;FWD points 6M USDRUB 38485/38985&lt;br&gt;&#xA;Interest Rates RUB 6M 10.47/10.58&#xA;Outright price USDRUB 82.7630/82.8130.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is how it was calculated and where can I receive data about this issue?&lt;/p&gt;&#xA;" OwnerUserId="17967" LastEditorUserId="17967" LastEditDate="2016-01-26T16:29:41.700" LastActivityDate="2016-01-26T16:29:41.700" Title="Derivatives (Forex Forward)" Tags="&lt;fx&gt;&lt;derivatives&gt;&lt;forward&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ClosedDate="2016-01-20T06:52:22.620" ContentLicense="CC BY-SA 3.0" />
  <row Id="22830" PostTypeId="1" CreationDate="2016-01-19T15:35:30.483" Score="4" ViewCount="1196" Body="&lt;p&gt;I've looked into many books at my academic library, and very often it goes like this:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Brownian motion&lt;/li&gt;&#xA;&lt;li&gt;Then, stochastic integration (Itô's formula etc.)&lt;/li&gt;&#xA;&lt;li&gt;Application: Black-Scholes formula for price of a call option&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;However, I've seen a proof that &lt;strong&gt;doesn't require stochastic integration at all&lt;/strong&gt;, it goes like this:&lt;/p&gt;&#xA;&lt;p&gt;Let &lt;span class=&quot;math-container&quot;&gt;$Y(t) = Y(0) e^{X(t)}$&lt;/span&gt; be the price of an asset, as a &lt;strong&gt;geometric brownian motion&lt;/strong&gt;, i.e. &lt;span class=&quot;math-container&quot;&gt;$X(t) = \mu t + \sigma B(t)$&lt;/span&gt; where &lt;span class=&quot;math-container&quot;&gt;$B$&lt;/span&gt; is a standard brownian. We also assume that &lt;span class=&quot;math-container&quot;&gt;$\mu + \sigma^2 / 2 = 0$&lt;/span&gt; so that the trend is neutral.&lt;/p&gt;&#xA;&lt;p&gt;Now the price for a European call option (maturity &lt;span class=&quot;math-container&quot;&gt;$t=T$&lt;/span&gt;, strike price &lt;span class=&quot;math-container&quot;&gt;$Y(0) A$&lt;/span&gt;) is:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$C = E\big( (Y(T)-Y(0) A)^+ \big) = Y(0) \cdot E\big( (e^{X(T)}-A)^+ \big).$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;But since &lt;span class=&quot;math-container&quot;&gt;$X(T)$&lt;/span&gt; has a law &lt;span class=&quot;math-container&quot;&gt;$\mathcal{N}(\mu T, \sigma^2 T)$&lt;/span&gt; (brownian), it's easy to see that&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$E\big( (e^{X(T)}-A)^+ \big) = \int_{\ln A}^\infty (e^x-A)\frac{1}{\sqrt{2\pi \sigma^2 T}} e^{-\frac{(x-\mu T)^2}{2 \sigma^2 T} } d x$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;and then (it's just standard integration), we get:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$C = Y(0) (\Phi(\sigma \sqrt{T} - \alpha_T) - A \Phi(-\alpha_T))$$&lt;/span&gt; with &lt;span class=&quot;math-container&quot;&gt;$\alpha_T := \ln(A)/(\sigma\sqrt T)+\sigma\sqrt T/2$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$\Phi(x) = (1/\sqrt{2 \pi}) \int_{-\infty}^x e^{-t^2/2} d t$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;This proves the Black-Scholes formula for a call option, without needing any stochastic integration / Itô.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;h1&gt;Question:&lt;/h1&gt;&#xA;&lt;p&gt;&lt;strong&gt;Why do all textbooks use stochastic integration to prove this, when it seems we don't need it?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="18444" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2017-07-12T20:53:02.653" Title="Black-Scholes formula proof, without stochastic integration" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;stochastic-processes&gt;&lt;call&gt;" AnswerCount="5" CommentCount="9" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22834" PostTypeId="2" ParentId="22829" CreationDate="2016-01-19T18:03:57.047" Score="2" Body="&lt;p&gt;You wrote:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;outright price -80.4318/80.4610&lt;/p&gt;&#xA;&#xA;&lt;p&gt;this is the quote in the spot market. With 80.4610 rubles you can buy 1 USD and with 1 USD you can buy 80.4318 rubles&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fwd points 3M - 19650/19950&lt;/p&gt;&#xA;&#xA;&lt;p&gt;this is for the forward contract (to receive/pay rubles in 3 months time).&#xA;These are &quot;points&quot;, that have to be added or subtracted from the spot rate to get the actual price of the forward. So if we take 80.4318+1.9650 we get a price of 82.3968. On the other side, if we take 80.4610+1.9950 we get 82.4560. So to summarize the ruble 3 months from now is quoted 82.3968/82.4560&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IR - 10.63/10.78&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These I think (not 100% sure) are the interest rates that are implied by the forward contract. They are annual interest rates applicable to a 3 month inter-bank deposit. In theory there is a relationship between the spot, the forward  and the difference between Russian and US interest rates, according to the Covered Interest Parity theorem.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-01-19T18:30:48.297" LastActivityDate="2016-01-19T18:30:48.297" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22835" PostTypeId="1" CreationDate="2016-01-20T00:05:04.453" Score="1" ViewCount="145" Body="&lt;p&gt;option price = intrinsic value + time value where intrinsic value (in other words payoff at N) is defined generally as difference between the underlying asset price and strike price (order depending on the type of the option of course). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the quantitative pricing models only the difference between the underlying price and strike seem to be modeled. For example the price of a call assuming no arbitrage possible is presented as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V_{(0)}=\bar{V_n}=E^*[\bar{V_n}]=E^*[\frac{(S_n^j-K)}{S_n^0}]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;how the time value is defined/reflected here? &lt;/p&gt;&#xA;" OwnerUserId="18670" LastEditorUserId="18670" LastEditDate="2016-01-20T01:19:46.663" LastActivityDate="2016-03-22T17:48:47.153" Title="option time value in the pricing models" Tags="&lt;option-pricing&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22837" PostTypeId="1" AcceptedAnswerId="22839" CreationDate="2016-01-20T13:02:47.573" Score="10" ViewCount="9487" Body="&lt;p&gt;I'm struggling to understand the meaning of US treasury total return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is easily available to get is yield data.&#xA;Yield can be directly translated to the bond price at that time.&#xA;In other words, even if yield uses % unit, this represents the percentage of discount from the principal. (&lt;a href=&quot;https://quant.stackexchange.com/questions/16198/how-can-i-interpret-us-treasury&quot;&gt;here&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I don't think it means any sort of return.&#xA;I found that there are some sources (e.g. &lt;a href=&quot;http://www.mlindex.ml.com/gispublic/bin/GISFTP.asp?fn=MUS%20High%20Grade.pdf&quot; rel=&quot;noreferrer&quot;&gt;Merrill&lt;/a&gt;) which report US treasury index value, price return, and total return. (I think what 'total' means is that they take account of coupons and everything.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to know how to translate [yield ---&gt; index ---&gt; return].&#xA;If possible, I want to know deep level technical (mathematical) details, as well as intuition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;p.s. @haginile commented on a similar question &lt;a href=&quot;https://quant.stackexchange.com/a/15021/19082&quot;&gt;here&lt;/a&gt;, but he didn't explain why it is hard to calculate return from yield. Also his blog link is broken.&lt;/p&gt;&#xA;" OwnerUserId="19082" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2020-08-16T22:16:25.403" Title="How to calculate US treasury total return from yield?" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;bond-yields&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="22839" PostTypeId="2" ParentId="22837" CreationDate="2016-01-20T15:53:15.997" Score="6" Body="&lt;p&gt;Let's start with a single bond. The total return from time $t_0$ to time $t_1$ can be easily calculated as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ R = \frac{\text{ending price} + \text{ending accrued interest} + \text{coupon payments between $t_0$ and $t_1$}}{\text{starting price} + \text{starting accrued interest}} - 1. $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(This is no different from how you'd calculate the total return on a stock or any other assets: $(P_1 + \text{dividend}) / P_0 - 1$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you know exactly who the bond is (i.e., if you know the coupon and maturity), then given the yields to maturity at both $t_0$, and $t_1$, it is trivial to calculate the corresponding prices and accrued interests. From there, computing total return is also trivial.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is, what if you don't know the coupon and maturity of the bond? In that case, approximations or assumptions are involved. Fortunately, a bond's total return can be (well) approximated from:&#xA;$$ R = \text{yield income} - \text{duration}\cdot \Delta y + \frac{1}{2} \cdot \text{convexity} \cdot (\Delta y)^2, $$&#xA;where yield income can be approximated by $\text{yield}_0 \times \Delta t$. For instance, if yield is 5%, then yield income for a month is simply $5\% / 12$. If you have duration and convexity statistics, then you can approximate the total returns pretty well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let's go to the index level. For an index, you basically repeat the total return calculation above for every single bond included in the index. The total return of the overall index is simply the market-value weighted average of the constituents' returns:&#xA;$$ R_\text{index} = \sum_{i=1}^N w_i R_i. $$&#xA;(This is also similar to how an equity index total return is calculated.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At this point, we may have several problems:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Do we have all the constituents of the index?&lt;/li&gt;&#xA;&lt;li&gt;Do we know their market values?&lt;/li&gt;&#xA;&lt;li&gt;Do we have each bond's pricing information?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For the US Treasury index, these are probably not issues. But for most other indices, you probably don't have the underlying data. In these cases, approximations are required. Fortunately, most index vendors do publish an index's yield, effective duration, and convexity, so the approximation formula above can be applied at the index level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a lot of intricacies involved if you want &lt;em&gt;accurate&lt;/em&gt; total returns, but that's why these index vendors exist. The last edition of the Lehman Brothers Global Index Guide (2008) was 336 pages...&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2016-01-21T14:34:30.810" LastActivityDate="2016-01-21T14:34:30.810" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22840" PostTypeId="1" CreationDate="2016-01-20T16:59:01.903" Score="4" ViewCount="455" Body="&lt;p&gt;For market making in front month vanilla commodity options we need a volatility curve that updates every second or so as the underlying and the options change prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If all the strikes have a good two-way market then a simple smoothing spline produces a usable curve.  But when the bids disappear in a few strikes, how should we preserve the shape of the curve and fit it to the new market data?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should we be working with strikes or in log(strike) space?&lt;/p&gt;&#xA;" OwnerUserId="77" LastActivityDate="2016-02-22T21:20:36.410" Title="Constructing a minute-by-minute volatility curve" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;market-making&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22841" PostTypeId="1" AcceptedAnswerId="22842" CreationDate="2016-01-20T18:35:42.363" Score="3" ViewCount="912" Body="&lt;p&gt;Let $W_{t}$ be a Wiener process, and let&#xA;$$X_{t} = \int^{t}_{0}W_{\tau}d\tau$$&#xA;Is $X_{t}$ a martingale? We can rewrite in differential form as&#xA;$$dX_{t} = W_{t}dt$$&#xA;,which means $X_{t}$ is a diffusion process with only drift part $W_{t}$ and therefore $X_{t}$ is not a martingale. &#xA;However, by integration by parts, we have&#xA;\begin{align}&#xA;X_{t} &amp;amp;= t W_{t} - \int^{t}_{0}\tau dW_{\tau}\\&#xA;&amp;amp;=t \int^{t}_{0}dW_{\tau} - \int^{t}_{0}\tau dW_{\tau}\\&#xA;&amp;amp;= \int^{t}_{0}(t-\tau)dW_{\tau}&#xA;\end{align}&#xA;$t-\tau$ is a deterministic, square integrable function, according to the martingale property of stochastic integral, $X_{t}$ is a martingale.&#xA;Now my question is which analysis above is the right one? Thanks in advanced. &lt;/p&gt;&#xA;" OwnerUserId="16126" LastActivityDate="2016-01-22T10:36:24.480" Title="Question about the martingale property of stochastic integral" Tags="&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22842" PostTypeId="2" ParentId="22841" CreationDate="2016-01-20T18:59:57.223" Score="3" Body="&lt;p&gt;If $X_t$ is square integrable, then the integral&#xA;\begin{align*}&#xA;\int_0^t X_{\tau} dW_{\tau}&#xA;\end{align*}&#xA;is a martingale. Here, the integrand $X_{\tau}$ does not depend on the integral limit $t$. However, in your case, the integrand, $t-\tau$, depends on $t$, then the condition for the martingality of the integral fails.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-01-20T18:59:57.223" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="22844" PostTypeId="1" CreationDate="2016-01-21T02:35:46.370" Score="3" ViewCount="610" Body="&lt;p&gt;I am not sure if this is the correct site to ask this, if not I apologize.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have noticed some markets that lack in liquidity, and wonder why market makers in these markets cannot provide liquidity on the same scale as in other markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would appreciate some links to academic literature, general market making books etc...So I can learn ways to provide liquidity to illiquid markets and various general market making techniques.&lt;/p&gt;&#xA;" OwnerUserId="19090" LastActivityDate="2016-01-21T02:35:46.370" Title="Market Making Literature" Tags="&lt;market-making&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22846" PostTypeId="1" CreationDate="2016-01-21T03:20:45.083" Score="0" ViewCount="49" Body="&lt;p&gt;I am looking for a set of parameters (d,u,r,So,K, N=?) for pricing an american call using binomial where the call hits the early exercise possibility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you have any exemplary set?&lt;/p&gt;&#xA;" OwnerUserId="18670" LastActivityDate="2016-01-22T03:57:53.673" Title="binomial - parameters at which american option hits early exercise possibility" Tags="&lt;option-pricing&gt;&lt;no-arbitrage-theory&gt;&lt;binomial-tree&gt;&lt;binomial&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22847" PostTypeId="1" AcceptedAnswerId="22859" CreationDate="2016-01-21T04:46:54.013" Score="0" ViewCount="53" Body="&lt;p&gt;If a US entity borrows in EUR and I need to perform a DCF valuation on that borrowing, should I use USD based curve (for the appropriate rating) or EUR based curves? In other words do I use the domicile (US) or the currency (EU) of the entity/loan to determine fair value? I believe in derivatives we discount based on currency and the use spot rate to convert to USD.&lt;/p&gt;&#xA;" OwnerUserId="2685" LastEditorUserId="2685" LastEditDate="2016-01-21T05:13:40.373" LastActivityDate="2016-01-21T21:00:55.903" Title="Valuing corporate EUR loan of US entity? Which discount rate to use? US or EU?" Tags="&lt;fixed-income&gt;&lt;discount-factor-curve&gt;&lt;dcf&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22848" PostTypeId="1" CreationDate="2016-01-21T13:01:52.470" Score="0" ViewCount="293" Body="&lt;p&gt;I have started a finance course few months ago and am looking for a way to compute the price of a 1-year call option with a fixed dividend paid after 6 months.&#xA;Using Black and Scholes I know how to compute the price of the option with a continuous dividend q but not for a fixed dividend D.&#xA;My initial guess was to use a binomial tree, but I am not sure it is the optimal approach.&#xA;If some of you are familiar with the topic, I would gladly read what they have to say.&#xA;Thank you! :D&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sophie&lt;/p&gt;&#xA;" OwnerUserId="17926" LastActivityDate="2016-01-21T18:09:19.513" Title="Pricing a vanilla call option with a fixed dividend" Tags="&lt;option-pricing&gt;&lt;dividends&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22851" PostTypeId="2" ParentId="22840" CreationDate="2016-01-21T16:38:37.823" Score="1" Body="&lt;p&gt;For the first question there are two approaches, the first is you can simply backfill and use the last minutes tick if it exists. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there is no liquidity, the second way is you can try cubic or other interpolations to see if it creates a better curve.&lt;/p&gt;&#xA;" OwnerUserId="1764" LastActivityDate="2016-01-21T16:38:37.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22853" PostTypeId="2" ParentId="22848" CreationDate="2016-01-21T18:09:19.513" Score="1" Body="&lt;p&gt;There are a couple of options that you can use to account for dollar amount dividends. Firstly, if dividends are expected to increase or decrease in proportion to the stock price, you can convert the dividends into a percentage by dividing the latest dividend by the last stock price on the day the dividend was declared and multiply by the number of dividends in a given year. For example, if the stock price is \$100 and the company issues a \$1 dividend quarterly, then the annualized yield is 4% (1/100*4). The continuously compounded yield for Black Scholes would be $ln(1+0.04)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, the reason that dividends are important in Black Scholes is because dividends would not be paid to the holders of the options. If you think about it, then, you could remove the present value of all dividends in the term of the option (discounted at a risk adjusted cost of equity) from the present value of the stock price. This would account for the future dividends paid and treat the company as a company that does not pay dividends.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because you are looking at one fixed dividend in 6 months, I would use the latter method because you do not know what the stock price will be at that time.&lt;/p&gt;&#xA;" OwnerUserId="19089" LastActivityDate="2016-01-21T18:09:19.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22855" PostTypeId="1" CreationDate="2016-01-21T19:19:33.583" Score="4" ViewCount="2016" Body="&lt;p&gt;Does anyone know how to request historical data for futures contracts that have already expired in IbPy?&lt;br&gt;&#xA;There are plenty of examples for requesting historical data for &lt;a href=&quot;https://quant.stackexchange.com/questions/17516/ibpy-download-historical-price-data&quot;&gt;example this post&lt;/a&gt;, however these fail if you put in a contract expiration date that is in the past.  &lt;/p&gt;&#xA;" OwnerUserId="18978" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-01-21T19:19:33.583" Title="How to get historical data for expired futures contracts in IbPy?" Tags="&lt;futures&gt;&lt;interactive-brokers&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22856" PostTypeId="2" ParentId="22855" CreationDate="2016-01-21T19:19:33.583" Score="4" Body="&lt;p&gt;After some research and &lt;a href=&quot;https://github.com/blampe/IbPy/blob/master/ib/ext/Contract.py&quot; rel=&quot;nofollow&quot;&gt;reading the source&lt;/a&gt;, I found there is a field in the Contract class called: m_includeExpired.  Set this to True and you can get data for expired contracts.  &lt;/p&gt;&#xA;" OwnerUserId="18978" LastActivityDate="2016-01-21T19:19:33.583" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22857" PostTypeId="2" ParentId="20812" CreationDate="2016-01-21T19:28:42.107" Score="0" Body="&lt;p&gt;if you have all options same strike then you have no vol smile risk (at the first glance). vol smile is about different IVs for different strikes in series. the only possible effect on you from vol smile is how vol surface evolves when underlying moves (read about sticky strike and sticky delta). if IV surface behaves according to sticky delta rule then movements of underlying cause your smile shift to the right or to the left, and it results in change in IV for you strike. but I think this effect is not so important for simple position like yours.&lt;/p&gt;&#xA;" OwnerUserId="18855" LastActivityDate="2016-01-21T19:28:42.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22858" PostTypeId="2" ParentId="22841" CreationDate="2016-01-21T20:51:30.100" Score="1" Body="&lt;p&gt;The two processes are not pathwise equal.  Here is a simulation (sample path) of the two processes $(t-\tau)dW_{\tau}$ and $W_\tau d\tau$: &lt;a href=&quot;https://i.stack.imgur.com/GXWBg.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/GXWBg.png&quot; alt=&quot;Martingale and BM Average&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that both processes have the same value at the final time.&lt;/p&gt;&#xA;" OwnerUserId="9403" LastEditorUserId="9403" LastEditDate="2016-01-22T10:36:24.480" LastActivityDate="2016-01-22T10:36:24.480" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22859" PostTypeId="2" ParentId="22847" CreationDate="2016-01-21T21:00:55.903" Score="1" Body="&lt;p&gt;You should use whatever currency in which the debt is denominated. Specifically, since it is the EUR currency and interest rate risk associated with the debt, some sort of EUR curve should be used. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Theoretically, if you are looking for the present value in USD, although the debt is denominated in EUR, you could convert future payments at the forward currency exchange rates and then discount at the USD curve, but it would be more simple to just discount using the EUR curve and then convert at the spot exchange rate.&lt;/p&gt;&#xA;" OwnerUserId="19089" LastActivityDate="2016-01-21T21:00:55.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22860" PostTypeId="2" ParentId="325" CreationDate="2016-01-21T22:16:59.200" Score="0" Body="&lt;p&gt;Interactive Brokers does not offer execution or even a market data feed with speeds required for HFT. With HFT trading systems now competing for micro-seconds, as opposed to milliseconds 4-5 years ago - a typical retail trader connecting over the Internet is out of league, even with dedicated lines just the network round-trip time will render any HFT attempt impossible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That having said - Interactive Brokers provides one of the best platforms for automated trading available to retail traders and small financial advisor firms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example there are third party tools such as this Excel spreadsheet that I started using recently, that make automated trading easy with just basic knowledge of Excel, without any special programming skills:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.tradinggeeks.net/downloads/interactive-brokers-excel-trader/&quot; rel=&quot;nofollow&quot;&gt;http://www.tradinggeeks.net/downloads/interactive-brokers-excel-trader/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19102" LastActivityDate="2016-01-21T22:16:59.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22861" PostTypeId="1" CreationDate="2016-01-22T00:20:14.213" Score="5" ViewCount="3039" Body="&lt;p&gt;I'm looking at the SDE of &lt;strong&gt;Geometric brownian motion&lt;/strong&gt;(*):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d X(t) = \sigma X(t) d B(t) + \mu X(t) d t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(with analytic solution $X(t) = X(0) e^{(\mu - \sigma^2 / 2) t + \sigma B(t)}$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the SDE of &lt;strong&gt;Ornstein-Uhlenbeck process&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d X(t) = \sigma d B(t)    + \theta (\mu -  X(t)) d t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;In which case the one or the other is better suited for modelling financial data?&lt;/strong&gt;&#xA;I read that currrency price data can be well modelled by O-U process. Is there a heuristic/empirical argument for that ?&lt;/p&gt;&#xA;" OwnerUserId="18444" LastActivityDate="2016-01-22T16:15:10.380" Title="Geometric brownian motion vs. Ornstein Uhlenbeck" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;modeling&gt;&lt;brownian-motion&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22862" PostTypeId="1" CreationDate="2016-01-22T02:07:38.527" Score="1" ViewCount="209" Body="&lt;p&gt;I am self-studying for an actuarial exam and I encountered this example. The books shows one method of solving using a replicating portfolio, and then shows this solution involving risk-neutral probabilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is - I do not understand where the equations highlighted in red come from.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/nE76w.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/nE76w.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5641" LastActivityDate="2016-01-22T02:51:16.507" Title="Calculating the price of a call and put using multinomial trees and risk-neutral probabilities" Tags="&lt;binomial-tree&gt;&lt;self-study&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22863" PostTypeId="2" ParentId="22862" CreationDate="2016-01-22T02:51:16.507" Score="2" Body="&lt;p&gt;I think they have expanded the third term on the LHS and simplified. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2016-01-22T02:51:16.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22864" PostTypeId="2" ParentId="22846" CreationDate="2016-01-22T03:57:53.673" Score="1" Body="&lt;p&gt;you need a positive dividend rate or a negative interest rate. Without these, it is a model-free result that early exercise is never optimal for a call option.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2016-01-22T03:57:53.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22865" PostTypeId="1" CreationDate="2016-01-22T11:04:14.583" Score="0" ViewCount="68" Body="&lt;p&gt;I'd like to calculate the vol of a return series of, say, 25 months. However, the last of those months is not completed yet. The last data point only refers to the first 21 days of the month (say, January). (All the others refer to whole months.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it as simple as $\text{Vol}=\text{StDev}(\text{Ln}(1+R))\times \sqrt(12 \times 25 / (24 + 21/31) )$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I'm guessing not.)&lt;/p&gt;&#xA;" OwnerUserId="13924" LastEditorUserId="13924" LastEditDate="2016-01-22T12:42:19.083" LastActivityDate="2016-01-27T07:45:56.660" Title="Volatility of monthly performances, where the last month is short" Tags="&lt;volatility&gt;&lt;performance-evaluation&gt;&lt;standard-deviation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22866" PostTypeId="2" ParentId="22861" CreationDate="2016-01-22T11:12:55.193" Score="2" Body="&lt;p&gt;Given efficient markets, asset prices should be unpredictable in the sense that any upcoming returns are uncorrelated with current or past returns.  Hence for traded assets the price should follow something more similar to a GBM than an O-U process. However, many financial metrics are not prices; for example interest rates or volatility.  O-U processes may describe these processes better than GBM.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A simple (and simplistic) heuristic is: given a price, model with GBM (at least for a first approximation).  Given a metric, model with O-U (at least for a first approximation).  &lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2016-01-22T11:12:55.193" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22869" PostTypeId="2" ParentId="22835" CreationDate="2016-01-22T16:12:11.710" Score="1" Body="&lt;p&gt;time value &quot;appears&quot; from two sources a) convexity of payoff function max(S-K,0) b) settlement of stock in future (at option expiry). if u recall put-call parity: C-P=Forward and consider statement max(S-K,0) [this is call]-max(K-S,0)[this is put]=S-K. you see that call has time value (convexity), put has time value (convexity), but C-P does not have time value (no convexity), payoff of forward is S-K. the only &quot;time value&quot; of forward is &quot;cost of carry&quot; (interest rate and dividends). but nobody names it as time value, it is cost of carry. so, in sum, time value of option comes from payoff function which is convex.&lt;/p&gt;&#xA;" OwnerUserId="18855" LastActivityDate="2016-01-22T16:12:11.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22870" PostTypeId="2" ParentId="22861" CreationDate="2016-01-22T16:15:10.380" Score="-1" Body="&lt;p&gt;the answer is simple: look at key differences between these two models. GBM is diffusion, OU is mean-reversion&lt;/p&gt;&#xA;" OwnerUserId="18855" LastActivityDate="2016-01-22T16:15:10.380" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22871" PostTypeId="1" AcceptedAnswerId="22873" CreationDate="2016-01-22T18:06:16.323" Score="1" ViewCount="253" Body="&lt;p&gt;For calculating the greeks&#xA;&lt;a href=&quot;http://www.vollib.org/html/apidoc/vollib.black.greeks.html&quot; rel=&quot;nofollow&quot;&gt;http://www.vollib.org/html/apidoc/vollib.black.greeks.html&lt;/a&gt;&#xA;Should I use historical volatility or implied volatility? &lt;/p&gt;&#xA;" OwnerUserId="17063" LastActivityDate="2016-02-12T22:17:04.070" Title="Which volatility to use?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;greeks&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22873" PostTypeId="2" ParentId="22871" CreationDate="2016-01-22T19:19:44.767" Score="5" Body="&lt;p&gt;If you want to know what Greeks the market assigns to an option, i.e. the market implied Greeks, then you would use the implied volatility. And that is what traders like to look at.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-01-22T19:27:38.537" LastActivityDate="2016-01-22T19:27:38.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22877" PostTypeId="1" CreationDate="2016-01-23T09:14:49.223" Score="2" ViewCount="159" Body="&lt;p&gt;I was working on the definition of the self-financing portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say $V=\phi_tS_t+\psi_t A_t$ where $S_t$ and $A_t$ are the stock price and the money market price at time $t$, resp, and $\phi_t$ and $\psi_t$ are the shares that are invested in stock and money market at time $t$, resp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I came across the formula like this: &#xA;$dV_t$=$\phi_t dS_t$+$\psi_t dA_t$+ $S_t d\phi_t$+$A_t d\psi_t$+$dS_t d\phi_t$+$dA_t d\psi_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have no idea what the last four terms mean. Precisely speaking, I don't know what does $d\phi_t$ or $d\psi_t$ mean. They are just some adapted random process and nothing more I know about them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, most of reference book or lecture notes (like &lt;a href=&quot;http://www.columbia.edu/~mh2078/stochastic_calculus.pdf&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt;, page 16), claim the above formula is based on the Ito lemma. Doesn't Ito Lemma/formula only apply to Ito process?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many Thanks,&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I should clarify my confusion a little bit.&#xA;If I understand correctly, the differential notations don't have mathematical meaning. However, for $dS_t$ and $dA_t$, their integrals do. So I understand $dS_t$ and $dA_t$. But then $d\phi_t$ or $d\psi_t$ makes no sense to me. Because neither themselves or the integrals are defined. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, the approach of @Neeraj in the equation $3$ is more like a discrete approach, which is great and I can follow the logic. &#xA;On the other hand, the note says the equation follows from Ito's lemma. In fact, I even saw some notes say $dA_t d\psi_t=0$ because of Ito's lemma. Those remarks really puzzle me a lot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope I illustrate my confusion a little bit better. &#xA;Thanks,&lt;/p&gt;&#xA;" OwnerUserId="19122" LastEditorUserId="19122" LastEditDate="2016-01-23T22:22:39.973" LastActivityDate="2017-04-18T13:05:12.170" Title="what is the meaning of the differential of an arbitrary adapted random process?" Tags="&lt;itos-lemma&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22878" PostTypeId="1" CreationDate="2016-01-23T12:24:32.277" Score="2" ViewCount="195" Body="&lt;p&gt;I have a data set  with 4000 companies and I have calculated a liquidity measure of each of the company in the dataset as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/DzNe5.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/DzNe5.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where, Turnover is the monthly average ratio of daily volume to shares outstanding for a given stock. Liquidity (measured by this ratio) Liquidity is highly persistent. And my analysis shows that in these indiviual companies in my dataset depict strong first order autocorrelation. So, as suggested by literature I should transform this liquidity measure of each indiviual company by AR(2). By following AR(2) process equation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/85Jzx.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/85Jzx.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where, Ct i is a measure of liquidity for stock i at month t, x is the number of lags included in the autoregressive process, and ut i is the residuals in liquidity for stock i at month t. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Part where is need help most.&lt;/strong&gt; &lt;a href=&quot;https://i.stack.imgur.com/tJCVJ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/tJCVJ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;Where,β1 is similar to the market beta of the CAPM except for additional term that is realted to the trading cost in the denominator. The remaining systematic risk components are associated with liquidity. β2 represents liquidity commonality, that is, the co-movement between individual stock liquidity and market liquidity.β3 measures the co-movement between stock returns and market liquidity.β4 captures the co-movement between individual liquidity and market returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Calculating liquidity betas for indiviual betas for indiviual stocks based on eqs. 3 to 6 could increase the power of test by providing ample observations but cost of doing so is that betas estimated at indiviual stock level have higher level of noise. &#xA;To mitigate the measurement error problem calcute betas at portfolio level and then assign these portfolio betas to indiviual stocks to cross sectional regressions at the indiviual stock level (Fama and French,1992). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, beginning of each year in our sample period ten portfolios are formed according to their level of liquidity(measured by ratio mentioned above). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would really appreciate if you help me understand this decile portfolio formation part. I'm using R.&#xA;Link to the paper that presented this model &lt;a href=&quot;http://pages.stern.nyu.edu/~lpederse/papers/liquidity_risk.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://pages.stern.nyu.edu/~lpederse/papers/liquidity_risk.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18786" LastEditorUserId="18786" LastEditDate="2016-01-28T20:42:16.273" LastActivityDate="2016-01-28T20:42:16.273" Title="Liquidity Adjusted Asset Pricing Model" Tags="&lt;equities&gt;&lt;r&gt;&lt;portfolio&gt;&lt;capm&gt;" AnswerCount="0" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22879" PostTypeId="1" AcceptedAnswerId="22880" CreationDate="2016-01-23T13:52:09.420" Score="1" ViewCount="391" Body="&lt;p&gt;Given log returns for some stocks $A$ and $B$, which are the constituents of our hypothetical portfolio in equal weights, how does one actually come up with a distribution of the log returns of the portfolio?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have read somewhere that log returns are not linear in the portfolio return calculation sense. So that if I have log returns for stock $A$ and stock $B$ at time $t$, then the portfolio log return is not $0.5$*log return of stock $A$ at $t$ + $0.5$*log return of stock $B$ at $t$, in such a case, it would be incorrect to do this calculation and then create a histogram. What is then a correct way to go about this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&#xA;I can describe a method that I have in mind. But it would be computationally ineffective. So let's denote the log return as $r^*$ and simple relative return as $r$. We can establish the relationship between the two with: $e^{r^*}-1=r$. Therefore I can do the following, at each time $t$, convert the log returns into simple returns, apply the portfolio weights of each stock and then convert this new simple return into the log return (this is the correct log return). Now plot the histogram with these values. Actually, I may end up doing this...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually I would take a $\log(1+\text{simple portfolio return})$ and not just a log of simple portfolio return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT EDIT:&#xA;I believe since I am looking at daily prices, I can apply the weights directly onto the log returns and I will not obtain much of a discrepancy, since log and simple returns are virtually the same for the small values.&lt;/p&gt;&#xA;" OwnerUserId="18251" LastEditorUserId="18251" LastEditDate="2016-01-23T15:12:27.897" LastActivityDate="2016-01-23T15:17:31.780" Title="Creating the histogram for the distribution of the portfolio returns" Tags="&lt;probability&gt;&lt;distribution&gt;&lt;normal-distribution&gt;&lt;log-returns&gt;&lt;lognormal&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22880" PostTypeId="2" ParentId="22879" CreationDate="2016-01-23T15:17:31.780" Score="0" Body="&lt;p&gt;The most correct way if you want to do it with log returns is the way you stated on your first edit, but indeed for daily data the approximation error is negligible.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2016-01-23T15:17:31.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22881" PostTypeId="1" CreationDate="2016-01-23T18:21:49.437" Score="0" ViewCount="77" Body="&lt;p&gt;Given a histogram and the probability mass function values for each observation, when plotting the histogram and the curve (this is bell curve since the data is assumed to be normal) on the same figure, the two will not be of the same scaling. How does one actually scale the probability mass/density function so that it is 'equivalent' to the histogram?&lt;/p&gt;&#xA;" OwnerUserId="18251" LastActivityDate="2016-04-22T20:13:46.040" Title="Scaling of probability mass function" Tags="&lt;probability&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22882" PostTypeId="2" ParentId="22877" CreationDate="2016-01-23T18:30:55.367" Score="1" Body="&lt;p&gt;You have given the value of portfolio at time $t$ is &#xA;\begin{equation}&#xA;V_t=\phi_t S_t + \psi_t A_t \quad \cdots \cdots (1)&#xA;\end{equation}&#xA;where $\phi_t$and $\psi_t$ denote the number of units of the security and cash account respectively that is held in a portfolio at time t.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, the value of portfolio at time $t+dt$ would be&#xA;$$V_{t+dt}=(\phi_t + d\phi_t)(S_t + dS_t) + (\psi_t + d\psi_t)(A_t+dA_t)\quad \cdots \cdots (2)$$&#xA;where $d\phi_t$ and $d\psi_t$ are additional units bought or sold.  Solved equation (2) and subtract equation (1) from equation (2), you will get&#xA;$$V_{t+dt}-V_t = dVt = \phi_t dS_t+\psi_t dA_t+ S_t d\phi_t+A_t d\psi_t+dS_t d\phi_t+dA_t d\psi_t \quad\cdots (3)$$&#xA;Remember, in self-financing portfolio, there is no exogenous infusion or withdrawal of money; the purchase of a new asset must be financed by the sale of an old one. So, $d\phi_t$ and $d\psi_t$ must be zero. So last four term in equation will vanish and it lead to $$dV_t= \phi_t dS_t+\psi_t dA_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is exactly what given in your lecture notes. &lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2016-01-23T18:30:55.367" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22883" PostTypeId="2" ParentId="22881" CreationDate="2016-01-23T19:05:34.010" Score="1" Body="&lt;p&gt;This is pretty simple. Let's assume that $F_X(x)$ is cummulative density function, such that&#xA;$$F_X(x) = \int_{-\infty}^{x} f_X(x) dx \quad \cdots \cdots (1)$$&#xA;where $f_X(x)$ is density function. Differentiating on the both side (ignoring subscript X), we get&#xA;$$\frac{d}{dx}\, F(x) = f(x)  $$&#xA;It can be written as;&#xA;$$dF(x)=f(x) \,d(x)$$&#xA;$$F(x+h) - F(x) = f(x)dx$$&#xA;so, more precisely your density $f(x)$ is: &#xA;$$f(x) = \frac{F(x+h)-F(x)}{dx}\quad \cdots \cdots (2)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, you can use identity 2, to scale your histogram into density. But your degree of accuracy depend upon the width of class interval. To scale your histogram into density:  &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Convert your frequency for each class into probability by dividing total number of observations{ensure that your class interval is sufficiently small}. This represent your $dF(x)$. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Now, divide your probability from  $dx$ is size of class interval and you will get $f(x)$. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You can reverse the procedure to get the frequency from the density and vice-versa.  &lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2016-01-23T19:05:34.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22886" PostTypeId="1" CreationDate="2016-01-24T01:09:14.617" Score="6" ViewCount="195" Body="&lt;p&gt;1) Does the following algorithm (my question is math, not programming-related):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;n = 1000000&#xA;dt = 0.01&#xA;B = zeros(n)        # [0, 0, 0, ..., 0]&#xA;for i in range(1,n):&#xA;    B[i] = B[i-1] + random.normal(0, sqrt(dt)) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;simulate a &lt;strong&gt;standard brownian motion&lt;/strong&gt;, since we have $B(t+dt) - B(t) \sim \mathcal{N}(0, \sqrt{dt}^2)$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to my tests, I would say yes, but I wanted to be sure.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;2) What's the name of the process obtained by doing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;B[i] = B[i-1] + random.normal(0, dt ** 0.3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$B(t+h) - B(t) \sim \mathcal{N}(0, \sigma^2)$$ with, for example, $\sigma = h^{0.3}$ instead of $\sigma = h^{0.5}$ for the standard brownian.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems it would be not far from a &lt;a href=&quot;https://en.wikipedia.org/wiki/Fractional_Brownian_motion&quot; rel=&quot;noreferrer&quot;&gt;fractional brownian motion&lt;/a&gt; with Hurst exponent $H = 0.3$ (but the covariance formula - first formula of this page - would apply &lt;em&gt;only&lt;/em&gt; for $t = s$ or am I wrong?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What's the name of such a stochastic process, for which increments are gaussian with standard deviation $(dt)^{0.3}$ instead of $(dt)^{0.5}$?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="18444" LastActivityDate="2016-01-26T18:13:59.410" Title="What's the name of this nearly-brownian stochastic process?" Tags="&lt;stochastic-processes&gt;&lt;brownian-motion&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22891" PostTypeId="1" CreationDate="2016-01-24T10:04:13.410" Score="2" ViewCount="65" Body="&lt;p&gt;I am currently doing a master program project regarding tracking errors. My assignment is to evaluate following question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to find out the correlation structure of the passive (=second order/sub-classes tracking errors) tracking error? Research and summarize possible ways to analyze the correlation structure of tracking errors (Idea: Especially focus on the relationship between returns and tracking errors)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I found very limited literature regarding the question, I would appreciate any suggestions, literature, tips etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance.&lt;/p&gt;&#xA;" OwnerUserId="19134" LastActivityDate="2016-01-24T10:04:13.410" Title="Subclass Tracking Error" Tags="&lt;portfolio-management&gt;&lt;tactical-asset-allocation&gt;&lt;tracking-error&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22892" PostTypeId="1" CreationDate="2016-01-24T10:20:42.473" Score="2" ViewCount="155" Body="&lt;p&gt;I'm looking to compile a list of all stocks/symbols &lt;strong&gt;ever&lt;/strong&gt; listed on the NASDAQ, not just the currently listed stocks. Alternatively, a list of all delisted stocks would also suffice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Preferably, I'm looking for a free solution but am certainly also interested in any paid suggestions ya'll might have.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not fussy about the format.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas and help would be greatly appreciated, cheers!&lt;/p&gt;&#xA;" OwnerUserId="19135" LastActivityDate="2016-01-24T10:20:42.473" Title="Get list of all stocks ever listed on NASDAQ" Tags="&lt;market-data&gt;&lt;trading&gt;&lt;nasdaq&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22894" PostTypeId="1" CreationDate="2016-01-24T19:17:50.897" Score="1" ViewCount="644" Body="&lt;p&gt;When simulating stocks one can easily use GBM with only one random variable per simulation to create a new stock price in say 5 years, you don't need to create the whole asset paths if you don't need that. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I wonder if that is also the case for the Vasicek model. Can I use the Vasicek short rate model with only one random variable per simulation to create a new short rate in 5 years (without constructing the whole path to the short rate in 5 years?). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so, how do you go from the new simulated short rate to the whole new yield curve?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="16788" LastActivityDate="2016-01-24T19:35:19.753" Title="Timesteps in Vasicek model" Tags="&lt;interest-rates&gt;&lt;monte-carlo&gt;&lt;short-rate&gt;&lt;vasicek&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22895" PostTypeId="2" ParentId="22894" CreationDate="2016-01-24T19:35:19.753" Score="3" Body="&lt;p&gt;Yes you can!  Any SDE that has an analytic solution can be simulated exactly.  The vasicek model has dynamics $dr=a(b-r)dt+\sigma dW_t$.  By Ito's lemma, $$d\left(e^{at}r\right)=e^{at}\left(a(b-r)dt+\sigma dW_t\right) +a e^{at} r dt$$  Simplifying, $$d\left(e^{at}r\right)=e^{at} ab +e^{at}\sigma dW_t$$  Integrating, $$e^{aT} r_T=r_0+b(e^{aT}-1)+\sigma \int_0 ^ T e^{at} dW_t$$  Solving for $r_T$, $$r_T=r_0 e^{-aT} +b(1-e^{-aT})+\sigma \int_0 ^ T e^{-a(T-t)} dW_t $$  Since the Ito integrand is deterministic, the distribution of the Ito integral is normal with mean zero and variance $$\sigma^2\int_0 ^ T e^{-2a(T-t)} dt =\frac{\sigma^2}{2a}\left(1-e^{-2aT}\right) $$  The distribution of $r_T$ is thus normal with expectation $$r_0 e^{-aT} +b(1-e^{-aT})$$&lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2016-01-24T19:35:19.753" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22897" PostTypeId="1" CreationDate="2016-01-25T00:58:12.580" Score="3" ViewCount="1131" Body="&lt;p&gt;I have come across a risk measure called &quot;Potential Future Exposure&quot; and I have not really understood the meaning of it. Knowing that this has to do with counterparty credit risk, I read different pages, for example here: &lt;a href=&quot;http://www.thetaris.com/wiki/PFE&quot; rel=&quot;nofollow&quot;&gt;http://www.thetaris.com/wiki/PFE&lt;/a&gt; that for in continious time PFE is defined by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$PFE(t)=\int_{-\infty}^{+\infty}max(x,0)f(x)ds$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How should I intrepate this? Is $x$ an underlying asset and $f(x)$ its probability distribution? Also I heard that PFE's are usually simulated by monte carlo methods. Are the assumptions to use standard geometric brownian motions? &#xA;Also, I have really tried to find som literature on the topic covering PFE, but it seems that it is very limited. Is there anyone who knows or have recommendations on literature/articles in this topic? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="18211" LastActivityDate="2016-01-25T02:13:25.953" Title="Mathematical definitioln of Potential Future Exposure" Tags="&lt;risk&gt;&lt;credit-risk&gt;&lt;counterparty-risk&gt;&lt;finance-mathematics&gt;&lt;exposure&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22898" PostTypeId="1" CreationDate="2016-01-25T01:28:02.303" Score="2" ViewCount="439" Body="&lt;p&gt;&lt;strong&gt;Reference&lt;/strong&gt;: &quot;Computational Methods in Finance&quot; by Ali Hirsa - Chapter 2: Derivatives Pricing via Transform Techniques&quot; - Page 37*&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Background&lt;/strong&gt;: The author prices call option using the Fourier Transform.&#xA;Let $X_T$ be time-T price of the underlying security; $f(X_T)$ be pdf of $X_T$ under some e.m.m; $q(x_T)$ be pdf of $x_T=ln(X_T)$; $k=ln(K)$ be the log of the strike price; $C_T(k)$ be price of a strike $K=e^k$ and maturity $T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Phi(v) = \int_{-\infty}^{\infty}e^{ivx_T}q(x_T)dx_T$ is the characteristic function of the log of the underlying security $x_T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C_T(k)$ can be expressed as: $C_T(k)=CE[(X_T-K)^{+}]=C\int_{K}^{\infty}(X_T-K)f(X_T)dX_T=C\int_{k}^{\infty}(e^{x_T}-e^{k})q(x_T)dx_T$ where $C$ is constant coefficient which depends on the e.m.m. chosen. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then define $\Psi_T(v)=\int_{-\infty}^{\infty}e^{ivk}C_T(k)dx_T$ as the Fourier transform of $C_T(k)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; The author continues to derive an explicit form of $\Psi_T(v)$ which goes as follows: $\Psi_T(v) = \int_{-\infty}^{\infty}e^{ivk}(C\int_{k}^{\infty}(e^{x}-e^{k})q(x)dx)dk = C\int_{-\infty}^{\infty}\int_{-\infty}^{x}e^{ivk}(e^{x}-e^{k})q(x)dkdx$. The latter equality seems to be derived from Fubini's Theorem, but I could not understand the change to $\int_{-\infty}^{x}$ from $\int_{k}^{\infty}$ in the previous equation when the double integral places the $e^{ivk}$ inside and swapped the order of integration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could someone kindly explain how Fubini's theorem is applied here?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot. &lt;/p&gt;&#xA;" OwnerUserId="6765" LastActivityDate="2016-01-27T10:00:13.800" Title="Question in &quot;Computational Methods in Finance&quot; by Ali Hirsa - Chapter 2: Derivatives Pricing via Transform Techniques&quot;" Tags="&lt;option-pricing&gt;&lt;derivatives&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22899" PostTypeId="2" ParentId="22897" CreationDate="2016-01-25T01:31:20.700" Score="2" Body="&lt;p&gt;When you enter into a derivative trade, such as a swap, the intial value is zero; as interest rates change the value may become positive or negative. If it is positive and the counterparty defaults you could be out a big sum of money (imagine that you are trading with Lehman Brothers in 2008). The idea of PFE is to estimate at some time in the future the typical positive value (hence max(x,0) ) to estimate how big is this risk: that the trade has gone in your favor but the counterparty can't pay. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way PFE is found is to simulate the derivative (swap) value by MonteCarlo methods over all possible future interest rate paths.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PFE is a hot topic with a lot of discussion currently; it is mentioned in almost any treatment of credit risk under Basel III and Dodd Frank.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-01-25T01:38:45.967" LastActivityDate="2016-01-25T01:38:45.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22900" PostTypeId="2" ParentId="22897" CreationDate="2016-01-25T02:07:02.190" Score="0" Body="&lt;p&gt;Let's discuss what a PFE is before looking at the equation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PFE is a common statistical measure for the amount of money you'll lose if your counterparty defaults. Let's give an example, say if you were to long 1000 far-in-the-money call options with a bank. Those options worth a lot to you because they're all in-the-money, it's something that you want to exercise upon maturity. However, what if the bank defaults (assume zero recovery)? You'd lose everything! In this example, your future exposure would be the value of your options, discounted back to today.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, what if you were to short those 1000 call options? Your portfolio would be negative. Now if the bank defaulted, you shouldn't be unhappy because you weren't supposed to get anything from the bank anyway. In credit risk, we say there is &lt;code&gt;zero exposure&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, counterparty exposure can be defined mathematically as: &lt;code&gt;max(x, 0)&lt;/code&gt;. We'll also need a probability distribution for the future. &lt;code&gt;f(x)&lt;/code&gt; in your equitation defines the probability distribution. The integration gives you the average. You can think of the equation like: &lt;em&gt;&quot;average all the possible future exposure&quot;&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;PFE is indeed commonly estimated by Monte-Carlo methods. How it's simulated depends on what it's simulated. For example, if I'm interested in how the interest rate would affect my portfolio. I would simulate the interest rates (eg: LIBOR) by modelling the change in basis points. I would set the time horizon to say, 2 years. Too short horizon would give unrealistic PFE as the default probability is usually quite low. Then I would take the 95% quartile of the simulated distribution as my PFE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should read this book to learn more. I've personally read it and I've found it very useful for understanding credit risks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/iJLE1.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/iJLE1.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="601" LastEditDate="2016-01-25T02:13:25.953" LastActivityDate="2016-01-25T02:13:25.953" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22901" PostTypeId="1" CreationDate="2016-01-25T05:47:30.427" Score="2" ViewCount="376" Body="&lt;p&gt;I never have programmed before in my life but I wouldn't mind learning if I knew&#xA;what i needed to do in order to solve my problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use neuroshell for day trading and use it extensively for trading futures with IB&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use this program &lt;a href=&quot;https://www.bowfort.com/Products/cartViewItem?sku=NSIBF&quot; rel=&quot;nofollow&quot;&gt;https://www.bowfort.com/Products/cartViewItem?sku=NSIBF&lt;/a&gt;&#xA;to feed data from IB to neuroshell so I can use neuroshell in real time.&#xA;I want to see if I can make this program myself so I do not hve to pay 39.99 a month&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Neuroshell has a programmable option to make use of a datapump that is built into it.&#xA;If you knew how use IB's API you could download the data you need and feed it yourself to neuroshell in real time. AndI only want to use 5 minutes bars.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is neuroshell's quote in its documentation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NeuroShell Trader includes a feature called the Data Pump Server (DP, or Data Pump) that acts as an intermediary to feed an external data stream into the NST and makes your application or DLL the primary data source. For software developers the DP is available through calls to eight API functions located in the NSTFEED.DLL, distributed with NST.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The DataPump requires the user to build his/her own external application or DLL, which will act as a data feed server. The user’s application collects data from the desired source(s) and sends the data to the NSTFEED.DLL. On the other end, NST is switched to receive the data through the Data Pump interface. This is done by selecting the name of your server application or DLL from the Tools -&gt; Data Sources -&gt; Server tab (NST scans the Servers directory beneath its location and adds the available EXEs and DLLs to the Server list).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is possible to transmit not just one, but a number of data streams simultaneously. The user’s application or DLL puts an identification mark on each data stream by assigning it a ticker and category. Tickers, transmitted through the DP, always appear in the data category (in NST) specified by the API call. NST receives data and uses it just as if it were Quote.com, or E-signal, a text file, or any other data source.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NST backs up all data received from the DP and other data sources (Quote.com, eSignal, etc.) on the hard disk.  Therefore, NST will try to merge previously downloaded data with current requests to minimize data requested.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Data Pump can transmit any kind of data: historical end-of-day (such as daily, weekly, monthly), historical intraday (such as 1-min, 2-min, 5-min, etc.), and historical and real-time tick data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering how I could setup such a program or dll for neuroshell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I myself was thinking of using Interactive Brokers API addon for NodeJS&#xA;&lt;a href=&quot;https://www.npmjs.com/package/ibapi&quot; rel=&quot;nofollow&quot;&gt;https://www.npmjs.com/package/ibapi&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then. getting node.js to write the 5 minute futures bar to a txt file in a readable format to neuroshell&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then making a dll that calls the txt file and sends it to neuroshell&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but as you can see I am such a beginner in this thinking process and wondering about expertise&#xA;in this development.&lt;/p&gt;&#xA;" OwnerUserId="19145" LastActivityDate="2020-07-23T00:05:49.793" Title="Downloading IB futures data and then making a datapump to another program" Tags="&lt;programming&gt;&lt;automated-trading&gt;&lt;interactive-brokers&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22902" PostTypeId="1" AcceptedAnswerId="22938" CreationDate="2016-01-25T06:30:41.053" Score="11" ViewCount="4669" Body="&lt;p&gt;I am learning R, and want to start using a backtester.  I have spent about a day reading all I can about R backtesters, and it seems there are 2 main contenders: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://r-forge.r-project.org/projects/blotter&quot; rel=&quot;noreferrer&quot;&gt;quantstrat&lt;/a&gt;, which uses the packages blotter and FinancialInstrument, and&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://systematicinvestor.wordpress.com/systematic-investor-toolbox/&quot; rel=&quot;noreferrer&quot;&gt;Systematic Investor Toolbox&lt;/a&gt; by Michael Kapler.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For anyone who has experience with either of these, can you tell me if they have done everything you expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[Edit]&#xA;To clarify: I am writing some R code that needs to use a backtester, and from my research quantstrat and SIT are the 2 main contenders.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not looking for a religious debate a la Python/R :)  but rather whether there is a general consensus as to  which is more widely used, which is richer feature-wise, or whether both are worthy contenders.&lt;/p&gt;&#xA;" OwnerUserId="19084" LastEditorUserId="19084" LastEditDate="2016-01-26T11:42:01.187" LastActivityDate="2016-07-09T14:43:24.757" Title="R Backtesters: Quantstrat vs SIT" Tags="&lt;r&gt;&lt;quant-trading-strategies&gt;&lt;backtesting&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="22903" PostTypeId="1" AcceptedAnswerId="22904" CreationDate="2016-01-25T07:17:00.233" Score="2" ViewCount="4405" Body="&lt;p&gt;I was looking at different methods of calculating delta for Interest Rate Swaps(IRS) and came across the words par delta and zero delta. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure of the difference between the both and when to use a particular delta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Need some guidance on this.&lt;/p&gt;&#xA;" OwnerUserId="5839" LastActivityDate="2016-01-25T07:53:11.190" Title="What is the difference between par delta and zero delta?" Tags="&lt;delta&gt;&lt;irs&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22904" PostTypeId="2" ParentId="22903" CreationDate="2016-01-25T07:53:11.190" Score="3" Body="&lt;p&gt;Delta is a linear approximation of the change in price due to a small move of the relevant interest rate. Typically a parallel move of the whole interest curve is assumed here. This applies to all kind of fixed income instruments, in particular IRS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interest rates can be given as coupon rates (these are the so called par rates, based on prices observable in the market) or zero rates (as a result of a so called bootstrapping process). Both can be used to calculate the price of an instrument so for both types a delta can be calculated. So, if you use zero rates for your linear approximation the result is a zero delta. Same is true for coupon/spot rates.&lt;/p&gt;&#xA;" OwnerUserId="17281" LastActivityDate="2016-01-25T07:53:11.190" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22905" PostTypeId="2" ParentId="22886" CreationDate="2016-01-25T08:07:10.963" Score="3" Body="&lt;p&gt;The first process&#xA;$$&#xA;B_{t+dt} = B_t + Z&#xA;$$&#xA;where $Z$ is independent of $(B_s)_{s \le t}$ and follows a Gaussian distribution with mean $0$ and varince $dt$ is a standard Brownian motion (thus the variance of $B_t$ is $t$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the second process let us recall the definition from your link:&#xA;$$&#xA;E[B^H_t B^H_s] = \frac12 ( t^{2H} + s^{2H} - |t-s|^{2H}),&#xA;$$&#xA;thus for $t=s$ this is $\frac12 ( t^{2H} + t^{2H} - |0|^{2H}) = t^{2H}$.&#xA;Note that for $H=\frac12$ this equals $t$ as in the Brownian motion case above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For such a process the increment after $t$ is &lt;strong&gt;not&lt;/strong&gt; independent of the process at time $t$. Look at the case $s&amp;gt;t$:&#xA;$$&#xA;E[B^H_t (B^H_s-B^H_t)] = E[B^H_t B^H_s] - E[B^H_t B^H_t],&#xA;$$&#xA;and this is, using the formulae above&#xA;$$&#xA;\frac12 ( t^{2H} + s^{2H} - (s-t)^{2H}) - t^{2H}.&#xA;$$&#xA;The above expression equals 0 for $H = \frac12$:&#xA;$$&#xA;\frac12 ( t + s - (s-t)) - t = \frac12 ( t + s - s + t) - t = 0.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally to answer you question: You got the variance term right, but sampling the increment you have to take the correlation/dependence of the increment to the process into account. So as you say the process is &lt;strong&gt;not&lt;/strong&gt; fractional Brownian motion. &#xA;Finally I wonder whether this process exists in continuous time. &lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2016-01-25T15:25:14.690" LastActivityDate="2016-01-25T15:25:14.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22906" PostTypeId="1" CreationDate="2016-01-25T10:06:36.640" Score="1" ViewCount="576" Body="&lt;p&gt;I have a simulation task at hand with ~1e6 time series to be clustered on the basis of statistical measures every few days in the simulation. Most clustering methods I'm aware of require an affinity matrix to be constructed. Given that I've limited memory, I would like to work with a solution that is preferably linear in memory requirements, even if it takes longer to compute.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have not had much success figuring out a good set of algorithms I can start looking into. k-means is one algo I'm looking at but it requires the number of partitions to be specified a-priori which is not available in my problem. So, it is not the best algo for my purposes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have any advice on this topic which could help me get started, I'd really appreciate it.&lt;/p&gt;&#xA;" OwnerUserId="1926" LastActivityDate="2016-01-25T18:56:31.190" Title="Memory-efficient clustering algorithm for large time-series datasets" Tags="&lt;time-series&gt;&lt;algorithm&gt;&lt;cluster&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22908" PostTypeId="2" ParentId="22886" CreationDate="2016-01-25T12:49:51.610" Score="7" Body="&lt;p&gt;The first process is a BM. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second does not exist in continuous time. The variance goes down too slowly with dt and the process blows up at the limit. You can break the (0,1) interval into 1, 100, 1000, 1000000 steps and see that happening. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Variance of a martingale has to scale with dt: if it is too fast then the process dies, if it is too slow then the process blows up. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&#xA;Suppose that you partition the $(0,1)$ interval into $N$ steps of length $1/N$, and define the process $X_n$ over these points. Now say that each step has variance that scales as &#xA;$$var(X_{n+1}-X_n) \sim (1/N)^\alpha$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the process is a random walk, then the variance of the process at $t=1$ (that is to say $X_N$) would be&#xA;$$var(X_n) \sim \sum_{n=1}^N (1/N)^\alpha = N^{1-\alpha}$$&#xA;You can see that as $N\rightarrow \infty$ this goes to zero ($\alpha&amp;gt;0$), blows up ($\alpha&amp;lt;1$) or just balances at one for $\alpha=1$ that corresponds to the standard BM. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2016-01-26T18:13:59.410" LastActivityDate="2016-01-26T18:13:59.410" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22911" PostTypeId="1" CreationDate="2016-01-25T17:14:14.143" Score="0" ViewCount="352" Body="&lt;p&gt;I have Level 1 data that has already been aggregated into 0.5s buckets by the exchange.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to further aggregate the data into hourly and daily buckets. I plan to do this by simply taking a snapshot on each time interval i.e. at market open then market open plus one hour etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q1.) Is there anything wrong in principle with this simple sampling strategy?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As always the devil is in the detail with these things. Some of the less liquid contacts may not trade for up to a couple of hours at a time what should I so in this situation? There will be several other issues I'm sure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q2.) Is there a set of benchmarks/best practice that someone can point me to for bucketing data where some points may be missing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q3.) Does it ever make sense to average some of the values (say over the last hour to estimate the daily close value? Is so are there any rules of thumb I can use to select the appropriate averaging period?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks &lt;/p&gt;&#xA;" OwnerUserId="7077" LastActivityDate="2016-01-25T20:04:13.817" Title="Aggregating Tick Data" Tags="&lt;time-series&gt;&lt;high-frequency&gt;&lt;high-frequency-estimators&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22912" PostTypeId="1" CreationDate="2016-01-25T17:33:44.063" Score="0" ViewCount="521" Body="&lt;p&gt;For an out of the money option the time value is entirely positive, then if it moves into the money the time value has a negative impact on the new intrinsic value, ok, but it looks like the negative impact is disproportionate to the positive value there was when the option was out of the money... what is this effect?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for example EURUSD is @ 1.0950 and the 1.0900 1 week put option is 50 / 55. A few hours later that day EURUSD moves to 1.0850 but the 1.0900 1 week put option price only moves to 70 / 75&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words the put option price isn't the 50 pips of intrinsic value plus the earlier 50 / 55 pips of time value, or a value more like 100 / 105 (or for a small adjustment for time something like 98 / 103) instead it's often quite a lot less: like 70 / 75... what is that effect and why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something in the time value has changed from positive to negative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we break down the time value in terms of greeks, in this example the theta and rho are negligible because the underlying market price moves take place over a matter of hours and the option has 1 week more to run... We can see the option delta is clearly less than 1, but the delta doesn't change sign, right? I mean in this example the market moved 100 pips which took the option 50 pips into the money. Even with a delta effect you'd expect the 50 pips intrinsic value to be reflected in the price... correct me if I am wrong. The gamma peaked at the money and then decreased as the option's intrinsic value moved into the money.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I missing here? Does the gamma change sign? Is this some positive / negative vega effect?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apologies if this is a newbie question :)&lt;/p&gt;&#xA;" OwnerUserId="7369" LastEditorUserId="7369" LastEditDate="2016-01-26T09:31:03.593" LastActivityDate="2016-01-26T11:08:52.153" Title="out of the money time value versus in the money time value" Tags="&lt;options&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22913" PostTypeId="1" AcceptedAnswerId="22916" CreationDate="2016-01-25T17:34:42.333" Score="0" ViewCount="3600" Body="&lt;p&gt;What would be a formula for calculating the annualized continuous dividend yield of a stock? &#xA;Given the quarterly or annual dividend&lt;/p&gt;&#xA;" OwnerUserId="17063" LastActivityDate="2016-01-25T18:58:55.007" Title="Calculating annualized continuous dividend yield" Tags="&lt;dividends&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22914" PostTypeId="1" CreationDate="2016-01-25T18:28:54.417" Score="1" ViewCount="102" Body="&lt;p&gt;This article gives a nice outline of how daily data can be used to estimate cointegration on a monthly horizon. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1404905&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1404905&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to use the same method to use hourly data to estimate mean reversion on a horizon of a few days. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The scaling seems to be the same one month=approx 22 working days and, one day =24 hours.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I spoke to the author and he seemed to think that using hourly data to estimate the daily dynamics would not work but didn't explain why.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q1.) I respect the author so I assume he's correct, but I'd still like to understand why you can't use the hourly data to estimate daily dynamics? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q2.) Assuming he is is correct is there any way I can estimate cointegrating relationships that occurs over the period of days from higher frequency data?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="7077" LastActivityDate="2016-01-25T18:28:54.417" Title="Estimating Daily Dynamics using Hourly Data" Tags="&lt;time-series&gt;&lt;high-frequency&gt;&lt;cointegration&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22915" PostTypeId="2" ParentId="22906" CreationDate="2016-01-25T18:56:31.190" Score="1" Body="&lt;p&gt;You may have a look at a list of clustering algos available in &lt;code&gt;sklearn&lt;/code&gt; &lt;a href=&quot;http://scikit-learn.org/stable/modules/clustering.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;, but I think all of them are of $O(n^2$) complexity. As well, have a look at the TSNE clustering algo, which is supposed to be $O(log(n)*n)$, but this may not be the fact depending on a particular implementation. A particular case in point is again Python &lt;code&gt;sklearn&lt;/code&gt; implementation of TSNE, the memory problems with which are discussed &lt;a href=&quot;http://scikit-learn-general.narkive.com/F1vBHdsg/tsne-memory-error&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13718" LastActivityDate="2016-01-25T18:56:31.190" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22916" PostTypeId="2" ParentId="22913" CreationDate="2016-01-25T18:58:55.007" Score="0" Body="&lt;p&gt;$r=\ln(1+\frac{D}{S_o})$ where D is the annual dividend and $S_0$ is the current stock price$&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2016-01-25T18:58:55.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22917" PostTypeId="2" ParentId="22911" CreationDate="2016-01-25T20:04:13.817" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Q1.) Is there anything wrong in principle with this simple sampling strategy?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I mean sampling is a valid strategy, it just may not be the best.  WOuld a VWAP style price be better?  Would just an average be better?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typically when no trade has happened you can model the price as the last, average of the bid/ask spread, etc.  The price you want depends on what you plan on using it for.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Q2.) Is there a set of benchmarks/best practice that someone can point me to for bucketing data where some points may be missing.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Again this can't be answered until we know what you want to use the data for.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Q3.) Does it ever make sense to average some of the values (say over the last hour to estimate the daily close value? Is so are there any rules of thumb I can use to select the appropriate averaging period?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I don't understand this question.  You already have a closing price included with your data, why try to estimate it?&lt;/p&gt;&#xA;" OwnerUserId="743" LastActivityDate="2016-01-25T20:04:13.817" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22918" PostTypeId="2" ParentId="22865" CreationDate="2016-01-25T20:24:45.080" Score="4" Body="&lt;p&gt;Ideally you'd want to use daily returns and just annualise it, but if you only have monthly returns then calculating the weighted variance in the following way might do it:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;Var = \frac{\sum_{i=0}^{24}(R_i - \mu)^2}{24 + \frac{21}{31}} + \frac{\frac{21}{31} (R_{25}' - \mu)^2}{24 + \frac{21}{31}}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;Vol = \sqrt{Var}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $R_i$ is the returns of your $i^{th}$ month, and $R_{25}'$ is the returns of the 25th month (only up to its 21st day), compounded to a month (as you wrote in your comment):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;R_{25}' = (1 + R_{25}) ^ {\frac{31}{21}} - 1&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mu$ is the weighted mean:&#xA;$$&#xA;\mu = \frac{\sum_{i=0}^{24} R_i }{24 + \frac{21}{31}} + \frac{\frac{21}{31} R_{25}'}{24 + \frac{21}{31}}&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="19150" LastEditorUserId="19150" LastEditDate="2016-01-27T07:45:56.660" LastActivityDate="2016-01-27T07:45:56.660" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22919" PostTypeId="1" CreationDate="2016-01-25T22:39:47.273" Score="0" ViewCount="356" Body="&lt;p&gt;My current calculations using the &lt;a href=&quot;https://pypi.python.org/pypi/vollib/&quot; rel=&quot;nofollow&quot;&gt;vollib&lt;/a&gt; library averages 0.5 seconds. Is there any way to get it faster? Any tips/best practice notes will be helpful. &#xA;This is for a scripting language such as python. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See documentation here: &lt;a href=&quot;http://vollib.org/html/apidoc/vollib.black_scholes_merton.greeks.html#module-vollib.black_scholes_merton.greeks.numerical&quot; rel=&quot;nofollow&quot;&gt;http://vollib.org/html/apidoc/vollib.black_scholes_merton.greeks.html#module-vollib.black_scholes_merton.greeks.numerical&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17063" LastEditorUserId="17063" LastEditDate="2016-01-27T15:14:06.900" LastActivityDate="2016-01-27T15:14:06.900" Title="Ideas for speeding up greek calculations" Tags="&lt;option-pricing&gt;&lt;greeks&gt;&lt;python&gt;&lt;calculation&gt;&lt;time&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22920" PostTypeId="1" CreationDate="2016-01-25T23:12:28.867" Score="0" ViewCount="1699" Body="&lt;p&gt;I'm looking for a way to get the entire options chain (All options expiries) for a particular stock in excel without manually copy pasting anything. It does not have to be real time and I will only be searching for 1 stocks options at a time. A free method would be ideal.&lt;/p&gt;&#xA;" OwnerUserId="19151" LastActivityDate="2016-09-23T02:24:50.237" Title="How to automatically get all options data for a particular stock into microsoft excel?" Tags="&lt;options&gt;&lt;option-strategies&gt;&lt;excel&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22922" PostTypeId="1" AcceptedAnswerId="22923" CreationDate="2016-01-26T01:49:05.167" Score="8" ViewCount="2628" Body="&lt;p&gt;I stumbled onto a bit of a mystery. A strange financial blip in a historical database crossed my path and I was wondering if anyone could explain its meaning/cause for me? If this is not the right forum please advise. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The database blip is &lt;strong&gt;&lt;a href=&quot;http://fxtop.com/en/historical-exchange-rates-graph-zoom.php?C1=FRF&amp;amp;C2=USD&amp;amp;A=20000&amp;amp;DD1=01&amp;amp;MM1=01&amp;amp;YYYY1=1969&amp;amp;DD2=01&amp;amp;MM2=01&amp;amp;YYYY2=1970&amp;amp;LARGE=1&amp;amp;LANG=en&amp;amp;VAR=0&amp;amp;MM1M=0&amp;amp;MM3M=0&amp;amp;MM1Y=0&quot;&gt;here&lt;/a&gt;&lt;/strong&gt;. I was researching the 1969 exchange rate between the French franc and the US dollar and saw the chart below. As you can see there was a sharp drop (approx 11%) in the exchange value of the franc &lt;strong&gt;in a single day&lt;/strong&gt; somewhere in the first half of August 1969. What was the exact date and what happened on that date to cause such a dramatic drop? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Or was it the other way around and something happened to skyrocket the exchange value of the dollar?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/qPYGg.jpg&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/qPYGg.jpg&quot; alt=&quot;Exchange Rate Chart c.1969, from fxtop.com&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the record, I am not a financial specialist, I was researching the data in the context of the use of money in an old film from that era.&lt;/p&gt;&#xA;" OwnerUserId="19152" LastActivityDate="2019-02-18T10:08:54.390" Title="What happened to the French franc value in August 1969?" Tags="&lt;historical-data&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22923" PostTypeId="2" ParentId="22922" CreationDate="2016-01-26T02:12:30.890" Score="19" Body="&lt;p&gt;That was the devaluation of the French franc on 8 August, 1969 (by 12.5% in terms of par value), decided by President Pompidou and his finance minister Giscard d'Estaing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In those days, exchange rates were &lt;em&gt;quasi-fixed&lt;/em&gt;, but subject to periodic realignments (the so-called Bretton Woods system of exchange rates, which was replaced by today's &lt;em&gt;floating rate&lt;/em&gt; system in 1973).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In 1968, under President De Gaulle, there had been social unrest and large wage increases in France. His successor Pompidou thought the country had lost competitiveness and decided to devalue early in his first term to get a head start on the problem.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="38578" LastEditDate="2019-02-18T10:08:54.390" LastActivityDate="2019-02-18T10:08:54.390" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="22924" PostTypeId="1" AcceptedAnswerId="22925" CreationDate="2016-01-26T05:17:36.817" Score="5" ViewCount="214" Body="&lt;p&gt;I'm trying to learn Backtesting 101. I found this &lt;a href=&quot;https://s3.amazonaws.com/quantstart/media/powerpoint/an-introduction-to-backtesting.pdf&quot;&gt;example&lt;/a&gt; which is very simple but I do not quite understand some of the terms. I understand Moving Average algorithm which is to measure trends or to smooth the graph. But it the code, the author said &lt;code&gt;# Take the difference of the signals in order to generate actual trading orders&lt;/code&gt; which I don't quiet understand what this means? Because from the code the &lt;code&gt;signals&lt;/code&gt; is going to be between &lt;code&gt;0&lt;/code&gt; and &lt;code&gt;1&lt;/code&gt; why does it need o be diff again?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the code in Python Pandas&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def generate_signals(self):&#xA;  # Create DataFrame and initialise signal series to zero&#xA;  signals = pd.DataFrame(index=self.bars.index)&#xA;  signals['signal'] = 0&#xA;&#xA;  # Create the short/long simple moving averages&#xA;  signals['short_mavg'] = pd.rolling_mean(bars['Adj Close'], self.short_window, min_periods=1)&#xA;  signals['long_mavg'] = pd.rolling_mean(bars['Adj Close'], self.long_window, min_periods=1)&#xA;&#xA;  # When the short SMA exceeds the long SMA, set the ‘signals’ Series to 1 (else 0)&#xA;  signals['signal'][self.short_window:] = np.where(signals['short_mavg' [self.short_window:] &amp;gt; signals['long_mavg'][self.short_window:], 1, 0)&#xA;&#xA;  # Take the difference of the signals in order to generate actual trading orders&#xA;  signals['positions'] = signals['signal'].diff()&#xA;  return signals&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Becuase that &lt;code&gt;positions&lt;/code&gt; is going to be used in the actual backtesting. &lt;/p&gt;&#xA;" OwnerUserId="19154" LastActivityDate="2016-01-26T07:32:26.737" Title="Why the diff of signal is called positions and what does it mean in backtesting?" Tags="&lt;quant-trading-strategies&gt;&lt;backtesting&gt;&lt;moving-average&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22925" PostTypeId="2" ParentId="22924" CreationDate="2016-01-26T07:32:26.737" Score="5" Body="&lt;p&gt;My understanding, in that context, is that signal indicates that you want to hold a share (signal is 1) or hold no shares (signal is zero). Therefore taking the diff will tell you if you want to buy (signal zero to 1, diff is 1), sell (signal 1 to zero, diff is -1) or do nothing (signal stays at zero or stays at 1, diff is zero). &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-01-26T07:32:26.737" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22926" PostTypeId="2" ParentId="22920" CreationDate="2016-01-26T08:31:05.593" Score="0" Body="&lt;p&gt;From e.g. the CBOE web site you are able to download a full table of option quotes (delayed) for a specific stock (menu quotes - delayed quotes). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take it from there, appply data manipulation (Excel VBA, R, Python..) to the extent needed and then you should be be able to end up with the desired result. This wouldn't be a simple copy &amp;amp; paste procedure; it requires some effort on your side but - there's no free lunch.&lt;/p&gt;&#xA;" OwnerUserId="17281" LastActivityDate="2016-01-26T08:31:05.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22927" PostTypeId="2" ParentId="22912" CreationDate="2016-01-26T11:08:52.153" Score="2" Body="&lt;p&gt;it is not a &quot;newbie question&quot;. actually it is very deep question, especially if you are trying to trade options in some way. all Greeks are about change in premium of the option. Premium consists of two components: time value + intrinsic. Greeks cannot tell you anything about this decomposition, they deal only with total sum (i.e. with overall premium). So The effect that you observe can be explained as follows: when you move into the money zone your premium rises AND at the same time the composition of premium changes - the farther you go in the money the more time value &quot;converts&quot; into intrinsic. This means if you, for example, want to sell an option and collect premium then any movement out of ATM strike (up or down) is negative for you (i assume you are delta-hedged). Time value is a result of convexity, convexity is at maximum at ATM strike. &lt;/p&gt;&#xA;" OwnerUserId="18855" LastActivityDate="2016-01-26T11:08:52.153" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="22928" PostTypeId="1" CreationDate="2016-01-26T15:07:37.233" Score="1" ViewCount="288" Body="&lt;p&gt;&lt;a href=&quot;http://rady.ucsd.edu/faculty/directory/valkanov/pub/classes/mfe/docs/fama_french_jfe_1993.pdf&quot; rel=&quot;nofollow&quot;&gt;Fama and French (1993)&lt;/a&gt; three factors are available in &lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html#Research&quot; rel=&quot;nofollow&quot;&gt;Kenneth French's data library&lt;/a&gt;. Some papers use them as they are provided there and others calculate them again. If &lt;a href=&quot;http://rady.ucsd.edu/faculty/directory/valkanov/pub/classes/mfe/docs/fama_french_jfe_1993.pdf&quot; rel=&quot;nofollow&quot;&gt;Fama and French (1993)&lt;/a&gt; used some different data screening, for example by excluding more or less stocks, this would produce different factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: is using these factors data screening dependent? &#xA;In estimating multi-factor models, do I have to use exactly the same data screening as they do? Moreover, if I form industry portfolios, (calculating the industry portfolio excess return instead of the stock excess return) can I use the same factors or should I create new ones and why?&lt;/p&gt;&#xA;" OwnerUserId="8215" LastActivityDate="2016-01-27T18:57:49.570" Title="Is using Fama and French factors data screening dependent?" Tags="&lt;factor-models&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22930" PostTypeId="1" CreationDate="2016-01-26T16:10:20.867" Score="1" ViewCount="247" Body="&lt;p&gt;The way I compute historical volatility is that I take two parameters $dt$ and $T$, get a list of stock prices with the step of $dt$ over the window $T$ (so $T/dt+1$ samples in total), compute $T/dt$ returns from this prices, compute their sample standard deviation, and scale using $\sqrt{dt}$ to annualize it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case I have non-uniformly sampled data, i.e. $dt_1\neq dt_2 \neq \dots$ I wondered whether I can compute annualized historical volatility without resampling?&lt;/p&gt;&#xA;" OwnerUserId="13480" LastActivityDate="2016-05-25T19:32:35.310" Title="Historical volatility from non-uniform samples" Tags="&lt;volatility&gt;&lt;statistics&gt;&lt;historical-data&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22931" PostTypeId="2" ParentId="22930" CreationDate="2016-01-26T17:36:24.377" Score="1" Body="&lt;p&gt;What I would do :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Step 1. Calculate $V=\sum_i \frac{\Delta P_i^2}{dt_i}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Step 2. Annualize V. $V_a=\frac{V}{T}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Step 3. Find $\sigma = \sqrt{V_a}$&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-01-26T17:51:16.120" LastActivityDate="2016-01-26T17:51:16.120" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22932" PostTypeId="1" CreationDate="2016-01-26T17:51:36.463" Score="0" ViewCount="146" Body="&lt;p&gt;Stochastic volatility models assume that volatility follow a random process.In the emerging market the volatility tend to be high. &#xA;why is it that the wishart stochastic volatility model fit well the emerging market&lt;/p&gt;&#xA;" OwnerUserId="19165" LastEditorDisplayName="user16651" LastEditDate="2016-05-29T18:02:42.733" LastActivityDate="2016-05-29T18:02:42.733" Title="wishart stochastic volatility models" Tags="&lt;stochastic-volatility&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22933" PostTypeId="2" ParentId="22920" CreationDate="2016-01-26T18:06:04.923" Score="1" Body="&lt;p&gt;There was a recent thread discussing this &lt;a href=&quot;http://optionsforum.net/topic/232/where-to-download-historical-iv-for-free&quot; rel=&quot;nofollow&quot;&gt;historic options data&lt;/a&gt;&#xA;That data source mentioned there is commercial, though reasonably priced. Their  data in CSV format readily ingestible by Excel. One note of caution is options' daily closing quotes are not always accurate.&lt;/p&gt;&#xA;" OwnerUserId="7973" LastActivityDate="2016-01-26T18:06:04.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22934" PostTypeId="1" CreationDate="2016-01-26T19:42:31.700" Score="2" ViewCount="122" Body="&lt;p&gt;I just came across this stochastic process (&lt;a href=&quot;http://www.risklatte.com/Articles/QuantitativeFinance/QF171.php&quot; rel=&quot;nofollow&quot;&gt;link&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dY_t = (a-bY_t)dt + c \sqrt{Y_t(1-Y_t)}dW_t$, where $dW_t$ is a Wiener Process. According to the author under certain conditions this process is bounded between zero and one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any discrete time analog of this process?&#xA;I tried:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Y_{t+1} = (a-bY_t) + c \sqrt{Y_t(1-Y_t)}w_{t+1}$, where $w_t$ is a normal random variable with mean zero and variance 1, but I guess this process might jump of bounds...&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2016-02-26T22:38:36.720" Title="Bounded Stochastic discrete process" Tags="&lt;stochastic-processes&gt;&lt;correlation&gt;&lt;wienerprocess&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22935" PostTypeId="1" AcceptedAnswerId="22937" CreationDate="2016-01-26T20:57:24.037" Score="4" ViewCount="1191" Body="&lt;p&gt;I'm learning how to do backtesting in Python using Pandas. I'm learning how to use Moving Average Crossover. I've generated signals to buy or to sell already. But I'm not sure where to go from there? Let's say if I have the initial capital of &lt;code&gt;$100,000&lt;/code&gt; what would be my final % return&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I realise that this is a very basic question but I can't seem to wrap my head around it yet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what I have it so far. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import datetime&#xA;import pandas as pd&#xA;from pandas_datareader import data, wb&#xA;import numpy as np&#xA;import Quandl&#xA;import matplotlib.pylab as pylab&#xA;%matplotlib inline&#xA;&#xA;start_date = datetime.datetime(2009,1,1)&#xA;end_date = datetime.datetime(2014,1,1)&#xA;amzn = data.DataReader(&quot;AMZN&quot;, &quot;yahoo&quot;, start_date, end_date)&#xA;&#xA;def generate_signals(self):&#xA;    # Create DataFrame and initialise signal series to zero&#xA;    signals = pd.DataFrame(index=amzn.index)&#xA;    signals['signal'] = 0&#xA;&#xA;    # Create the short/long simple moving averages&#xA;    signals['short_mavg'] = pd.rolling_mean(amzn['Adj Close'], 40, min_periods=1)&#xA;    signals['long_mavg'] = pd.rolling_mean(amzn['Adj Close'], 100, min_periods=1)&#xA;&#xA;    # When the short SMA exceeds the long SMA, set the ‘signals’ Series to 1 (else 0)&#xA;    signals['signal'][40:] = np.where(signals['short_mavg'][40:] &amp;gt;&#xA;        signals['long_mavg'][100:], 1, 0)&#xA;&#xA;    # Take the difference of the signals in order to generate actual trading orders&#xA;    signals['positions'] = signals['signal'].diff()&#xA;    return signals&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I've taken the code from &lt;a href=&quot;https://s3.amazonaws.com/quantstart/media/powerpoint/an-introduction-to-backtesting.pdf&quot; rel=&quot;nofollow&quot;&gt;https://s3.amazonaws.com/quantstart/media/powerpoint/an-introduction-to-backtesting.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;Portfolio&lt;/code&gt; part doesn't run for me so I'm trying to figure out what's supposed to happen in the actual backtesting.&lt;/p&gt;&#xA;" OwnerUserId="19154" LastActivityDate="2016-01-27T00:14:32.997" Title="How to get the the final % return in backtesting?" Tags="&lt;backtesting&gt;&lt;moving-average&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22936" PostTypeId="2" ParentId="22898" CreationDate="2016-01-27T00:02:51.260" Score="3" Body="&lt;p&gt;Fubini's theorem is only used to reverse the order of integration. We have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\int_{-\infty}^{\infty}{e^{i\nu k} \left( C \int_k^{\infty} \left( e^x - e^k \right) q(x) dx \right) dk} = \int_{-\infty}^{\infty}{\int_k^{\infty}{C e^{i\nu k} \left( e^x - e^k \right) q(x) dx} dk} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, let $f(x, k) = C e^{i\nu k} \left( e^x - e^k \right) q(x)$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\int_{-\infty}^{\infty}{\int_k^{\infty}{f(x, k) dx} dk} = \int_{-\infty}^{\infty}{\int_{-\infty}^{\infty}{f(x, k) \mathbb{I}_{x &amp;gt; k} dx} dk}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Switching the order of integration (and using the fact that the indicator function will not affect the integrability of $f(x, k)$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\int_{- \infty}^{\infty}{\int_{-\infty}^{\infty}{f(x, k) \mathbb{I}_{x &amp;gt; k} dk} dx} = \int_{-\infty}^{\infty}{\int_{-\infty}^{\infty}{f(x, k) \mathbb{I}_{k &amp;lt; x} dk} dx} \\&#xA;= \int_{-\infty}^{\infty}{\int_{-\infty}^{x}{f(x, k) dk} dx}\\&#xA;=\int_{-\infty}^{\infty}{\int_{-\infty}^{x}{C e^{i\nu k} \left( e^x - e^k \right) q(x) dk} dx}$&lt;/p&gt;&#xA;" OwnerUserId="15336" LastEditorUserId="15336" LastEditDate="2016-01-27T10:00:13.800" LastActivityDate="2016-01-27T10:00:13.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22937" PostTypeId="2" ParentId="22935" CreationDate="2016-01-27T00:14:32.997" Score="4" Body="&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Assuming you're a bit of a beginner trying to learn the ropes of how this whole process works at a high level, I can definitely make a couple recommendations (if I'm interpreting that wrong then I apologize if the explanation below isn't what you're after).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're trying to learn some basic backtesting fundamentals, while QuantStart is an amazing educational resource, I might recommend writing a similar signal generation function outside of a &lt;code&gt;Portfolio&lt;/code&gt; class (so no &lt;code&gt;self&lt;/code&gt; function argument), just to get your feet wet with how the trading logic works. The presentation you're citing takes a much more rigorous object-oriented approach to whole thing that might not click contextually for someone just learning the basics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next, I think it's worth mentioning you'll want to make sure you &lt;em&gt;lag your signals&lt;/em&gt;. Failing to do so is a common backtesting pitfall that can yield artificially good results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you have a given signal at each time step you can calculate some returns. Let's say your signals are 1 for being long, -1 for being short, and 0 for being out of the market. Then you can compute the differences in price and multiply by your signals, so that a price increase will be favorable if your signal is 1 and a fall in price will be favorable if your signal is -1. That multiplication step will yield a gross (ie dollar amount) P&amp;amp;L for any given day assuming each trade is only 1 share.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you have that vector of daily P&amp;amp;L's, you can take a cumulative summation (&lt;code&gt;cumsum&lt;/code&gt; function) to yield a total running P&amp;amp;L vector, to which you can add your initial portfolio equity of $100,000. Once you've done all that you can start doing some returns calculations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a small example similar to the code that you have above that works outside of a Portfolio class for doing a very simply &amp;amp; straightforward backtest.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import pandas as pd&#xA;from pandas.io.data import DataReader&#xA;import numpy as np&#xA;&#xA;ticker = 'amzn'&#xA;px = DataReader(ticker, 'yahoo')&#xA;&#xA;def generate_signals(px):&#xA;    signals = pd.DataFrame(index=px.index)&#xA;    signals['signal'] = 0&#xA;    short_ma = pd.rolling_mean(px['Adj Close'], 40, min_periods=1)&#xA;    long_ma = pd.rolling_mean(px['Adj Close'], 100, min_periods=1)&#xA;    signals['signal'] = np.where(short_ma &amp;gt; long_ma, 1, 0)&#xA;    return signals['signal'].shift(1)  # remember to lag your signals :)&#xA;&#xA;px['Signals'] = generate_signals(px)&#xA;px['Daily P&amp;amp;L'] = px['Adj Close'].diff() * px['Signals']&#xA;px['Total P&amp;amp;L'] = px['Daily P&amp;amp;L'].cumsum()&#xA;print px&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7385" LastActivityDate="2016-01-27T00:14:32.997" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22938" PostTypeId="2" ParentId="22902" CreationDate="2016-01-27T00:47:35.737" Score="6" Body="&lt;p&gt;While I've never used SIT, I have used quantstrat quite a bit and can attest to its strength. It has a solid developer community backing it (7 contributors on Github), is part of the TradeAnalytics project on R-Forge, and while it's still technically in beta, it should provide plenty of functionality. There is admittedly a pretty steep learning curve when you're first learning how to use it, but once you learn how to set things up it will manage portfolios and handle accounting rather gracefully. It has good documentation surrounding it with some solid examples to help get you going (see the &lt;a href=&quot;https://quantstrattrader.wordpress.com/&quot; rel=&quot;noreferrer&quot;&gt;QuantStrat TradeR&lt;/a&gt; blog). If speed is a priority, quantstrat can also make use of parallel processing functionality, though your mileage may vary depending on operating system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking a look into SIT, it appears that it's mostly a tool built around a specific developer's needs/preferences, and might be slightly less mature at this stage. The documentation seems mostly limited to the SIT blog, and the author looks like the only project contributor on Github. Having not used it in practice, I can't speak directly to its strengths/weaknesses, but I get the subjective impression that quantstrat might currently be the more robust option of the two.&lt;/p&gt;&#xA;" OwnerUserId="7385" LastActivityDate="2016-01-27T00:47:35.737" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22939" PostTypeId="1" CreationDate="2016-01-27T01:20:20.453" Score="1" ViewCount="74" Body="&lt;p&gt;&lt;a href=&quot;http://www.bloomberg.com/news/articles/2016-01-26/bets-on-negative-u-s-rates-by-end-2017-jump-above-10-chance&quot; rel=&quot;nofollow&quot;&gt;http://www.bloomberg.com/news/articles/2016-01-26/bets-on-negative-u-s-rates-by-end-2017-jump-above-10-chance&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Options markets show some investors are taking out protection in case&#xA;  rates instead go negative. The implied probability of U.S. interest&#xA;  rates sinking below zero next year has risen above 10 percent, data&#xA;  compiled by Bloomberg show.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The bloomberg article was published on 27Jan2016.&lt;/p&gt;&#xA;" OwnerUserId="6190" LastActivityDate="2016-01-27T01:20:20.453" Title="How was this probability of negative U.S rates by end 2017 calculated?" Tags="&lt;options&gt;&lt;interest-rates&gt;&lt;yield&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22940" PostTypeId="1" CreationDate="2016-01-27T03:20:40.690" Score="4" ViewCount="172" Body="&lt;p&gt;I'm familiar with the historical full revaluation, VcV, and Delta-gamma methods, but a client keeps talking about a heat-map method and I'm not sure what he's talking about. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="19174" LastActivityDate="2016-06-08T19:52:59.897" Title="What is the heat-map method of calculating VaR?" Tags="&lt;var&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22941" PostTypeId="1" CreationDate="2016-01-27T07:21:07.070" Score="-1" ViewCount="36" Body="&lt;p&gt;Assuming I borrow $50000 from the bank where the details are as follow&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Loan amount : 50000&#xA;Annual interest rate : 6%&#xA;Repayment mode : At then end of the month&#xA;Loan repayment period : 60 months&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using MS Excel whereby I utilise the &lt;a href=&quot;http://www.excelfunctions.net/Excel-Pmt-Function.html&quot; rel=&quot;nofollow&quot;&gt;PMT&lt;/a&gt; method : &lt;code&gt;=PMT(6%/12,60,50000,0,1)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have to make a monthly repayment of $966.64 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However if repayment mode is at the start of the month utilising the PMT method : &lt;code&gt;=PMT(6%/12,60,50000,0,1)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have to make a lower monthly repayment of $961.83&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Can any kind soul explain to me why it is cheaper to repay the loan at the start of the month??&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="6874" LastActivityDate="2016-01-27T07:31:55.603" Title="Why is it cheaper to repay monthly loan at the start of the month" Tags="&lt;excel&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2016-01-27T12:32:03.017" ContentLicense="CC BY-SA 3.0" />
  <row Id="22942" PostTypeId="2" ParentId="22941" CreationDate="2016-01-27T07:31:55.603" Score="2" Body="&lt;p&gt;If you make your repayment at the beginning of the month you do not have to pay accrued interest of the amount for the month. &#xA;So, paying already 961.83$ at the first of each month makes a subtle difference to paying the same amount at the end of the month as you have to pay interest on this open position during those 30 days. &lt;/p&gt;&#xA;" OwnerUserId="16249" LastActivityDate="2016-01-27T07:31:55.603" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22943" PostTypeId="2" ParentId="22934" CreationDate="2016-01-27T08:28:27.500" Score="0" Body="&lt;p&gt;You are not going to get a process which stays within bounds if your increments are normal random variables, which have an unbounded distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You probably want to look at some kind of random walk, where the increment is a discrete distribution. In other words you have a finite list of values which you add or subtract, each with a positive probability. The distribution could change based on $t$ and the previous value of $Y_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One approach which I think is very promising is to add some fraction of the difference between $Y_t$ and either 0 or 1, depending on the direction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Eg $Y_{t+1} = (a' - b'Y_t) + c'(1 - Y_t)$ with probability $p(t, Y_t)$, and $Y_{t+1} = (a' - b'Y_t) - c'Y_t$ with probability $1 - p(t, Y_t)$. It should be easy to find a function $p(t, Y_t)$ such that the variance of $Y_{t+1} - Y_t$ is exactly what you want, and then to adjust $a'$ and $b'$ to make the mean of $Y_{t+1} - Y_t$ the same or similar to the continuous case.&lt;/p&gt;&#xA;" OwnerUserId="4963" LastActivityDate="2016-01-27T08:28:27.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22945" PostTypeId="2" ParentId="22934" CreationDate="2016-01-27T09:13:21.953" Score="2" Body="&lt;p&gt;I believe that the process you postulate has a Beta conditional distribution. If my memory serves me well, I have encountered it in the book by Liptser and Shiryayev &quot;Statistics of Random Processes&quot; as the evolution of the conditional probability in a HMM. This was 10+ years ago, therefore I might be well off. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In that case you should be sampling from Beta to discretize &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My mistake, the stationary distribution is Beta, not the conditional one. Therefore you will not be able to evolve from Beta exactly. The diffusion you postulate is called 'Jacobi diffusion', see Forman and Sørensen, case 6, at &#xA;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1150110&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1150110&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suspect that you might be able to use the stationary PDF to produce an approximate scheme to discretize. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update 2:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually, let me change the notation slightly and write&#xA;$$d Y_t = \theta (\mu-Y_t)\ dt + \sqrt{2\alpha\theta Y_t(1-Y_t)}\ dB_t$$&#xA;which we know has a stationary distribution $Y_\infty\sim B\left(\frac{\mu}{\alpha}, \frac{1-\mu}{\alpha}\right)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, use the change of variable $X_t = f(Y_t) = 2 \arcsin\sqrt{Y_t}$, which leads to the diffusion&#xA;$$dX_t = \frac{\theta (\mu -\alpha/2) - (\alpha-1) \theta \sin^2 (X_t/2)}{|\sin X_t|}\ dt + \sqrt{2\alpha\theta}\ dB_t$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can simulate this as &#xA;$$x_{t+\delta} = x_t + \frac{\theta (\mu -\alpha/2) - (\alpha-1) \theta \sin^2 (x_t/2)}{|\sin x_t|}\ \delta + \sqrt{2\alpha\theta\delta}\ \epsilon_t,\quad \epsilon_t\sim N(0,1)$$&#xA;and then transform back to produce the paths&#xA;$$y_t = \sin^2 (x_t/2)$$&lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2016-01-27T22:08:11.443" LastActivityDate="2016-01-27T22:08:11.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22946" PostTypeId="1" CreationDate="2016-01-27T11:35:29.013" Score="1" ViewCount="105" Body="&lt;p&gt;I am studying American options and inquisitive on why they lack an analytic pricing formula. I found a paper by Kim,1990 on analytic valuation of these options and then Byun,2005 paper which studies Kim,1990 analytic valuation properties.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am afraid I have not found anything apart from that ever since 2005. Could this be the last document about the analytic pricing of American options. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Perhaps I am mistaken or didn't do a thorough search). Could anyone suggest me some links to recent work on this area of Pricing American options using analytic formulae?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I appreciate in advance&lt;/p&gt;&#xA;" OwnerUserId="19178" LastActivityDate="2016-09-16T06:41:02.290" Title="Most recent work on American option **ANALYTIC** pricing" Tags="&lt;options&gt;&lt;reference-request&gt;&lt;american-options&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22947" PostTypeId="1" CreationDate="2016-01-27T13:49:49.653" Score="2" ViewCount="123" Body="&lt;p&gt;Does anyone know of a data source that provides announcements of future index events (adds/drops/re-balances), specifically for equity indexes? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know these are mostly available somewhere on each index's website (&lt;a href=&quot;https://www.msci.com/index-announcements&quot; rel=&quot;nofollow&quot;&gt;MSCI&lt;/a&gt;, &lt;a href=&quot;http://www.spindices.com/search/?ContentType=Announcement&quot; rel=&quot;nofollow&quot;&gt;S&amp;amp;P&lt;/a&gt;), but I'd really like to get at the information in a more reliable way than scraping a website.&lt;/p&gt;&#xA;" OwnerUserId="117" LastEditorUserId="743" LastEditDate="2016-01-27T14:58:33.220" LastActivityDate="2016-02-02T17:46:54.867" Title="Equity Index Announcement Data" Tags="&lt;equities&gt;&lt;data&gt;&lt;index&gt;&lt;data-source&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22949" PostTypeId="2" ParentId="22928" CreationDate="2016-01-27T14:10:43.157" Score="1" Body="&lt;p&gt;In general, it is always better to determine how the FF93 risk exposures are for your data. FF93 use a very comprehensive (read expensive) dataset, therefore it is very likely that your investable universe is different. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case you're investigating a large stock universe such as the SP500 I would feel comfortable using the FF factors on Ken French's website. If this is not the case, say you also examine small stocks or other countries then the US I would determine the risk exposures for your dataset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The risk premiums of the FF factors tend to be stronger among small stocks, thus indeed filtering and determining a minimum size does matter. For example, the UK (FTSE 1000) exhibits a large portion of small stock. I believe that FF08 exclude companies with a value of market equity less than $12.5 dollar. &#xA;Best way to overcome this is to use proper break-points (equivalent of the NYSE breakpoint used by FF) and to employ value weighting instead of equal weighting. &lt;/p&gt;&#xA;" OwnerUserId="18070" LastActivityDate="2016-01-27T14:10:43.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22950" PostTypeId="2" ParentId="22719" CreationDate="2016-01-27T14:22:33.093" Score="1" Body="&lt;p&gt;In the case you're interested in asset management, Robbert Shiller's open fiance course is definitely a good introduction to finance, although not quantitative. In addition to that, John Cochrane's course on Coursera is a very good. Here portfolio theory and option pricing is approached from a quantitative perspective. &lt;/p&gt;&#xA;" OwnerUserId="18070" LastEditorUserId="18070" LastEditDate="2016-01-28T11:17:03.560" LastActivityDate="2016-01-28T11:17:03.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22951" PostTypeId="1" CreationDate="2016-01-27T15:13:05.423" Score="2" ViewCount="1776" Body="&lt;p&gt;Generally the price of a future is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$&#xA;F(t,T) = S(t)e^{r(T-t)},&#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and it's delta is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$&#xA;\frac{\partial F}{\partial S} = e^{r(T-t)}.&#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(As opposed to the delta of a forward which is always one.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In some explanations this is proven by taking the derivative of the pricing equation above see RRGs response in this link:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/11261/are-futures-exactly-delta-one&quot;&gt;Are Futures exactly Delta One?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However for commodity futures the pricing can incorporate a convenience yield (c) that can give rise to backwardation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$&#xA;F(t,T) = S(t)e^{(r+c)(T-t)},&#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However what should the delta of a commodity future be? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we take the derivative of the pricing equation it would be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$&#xA;\frac{\partial F}{\partial S} = e^{(r+c)(T-t)}.&#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or....&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the difference in the delta of the futures and forward prices are purely down to the way that futures are settled each day (and nothing else), and so the delta should be that shown below, the same as any other future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$&#xA;\frac{\partial F}{\partial S} = e^{(r)(T-t)}.&#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q1.) Is it correct that the delta of a commodity future is the same as any other future?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q2.) Is this the delta I should use when hedging? i.e. hedging 1 1m futures contract with 1 12m contract will not be completely delta neutral instead I should apply the discount shown above to get the correct hedge? &lt;/p&gt;&#xA;" OwnerUserId="7077" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-01-27T17:54:44.610" Title="Delta of a Commodity Future" Tags="&lt;futures&gt;&lt;forward&gt;&lt;commodities&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22952" PostTypeId="1" AcceptedAnswerId="22958" CreationDate="2016-01-27T15:48:31.563" Score="0" ViewCount="363" Body="&lt;p&gt;I am preparing for F&amp;lt; exam but I am unable to understand the meaning of continuously payable annuity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What does it mean?  An example would be great.&lt;/p&gt;&#xA;" OwnerUserId="19036" LastActivityDate="2016-01-27T18:44:00.240" Title="What does continuously payable annuity mean?" Tags="&lt;interest-rates&gt;&lt;annualized&gt;&lt;principal-components&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22953" PostTypeId="2" ParentId="180" CreationDate="2016-01-27T15:56:23.273" Score="1" Body="&lt;p&gt;I can't comment yet on the topic due to my reputation level (so I will throw an answer up) but having just done my MFE capstone research on EVT implementation for VaR. According to my advisor who was a director of a quant research group at Citi before returning to academia, not many people are doing this. My research was to start collecting data comparing EVT to various numerical methods for VaR/CVaR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When one does a Monte Carlo or something to generate returns or looks at an empirical distribution they are throwing away all the points not in the tail when a VaR is calculated so why not just start with the tail by using EVT techniques. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From my research, it is somewhat arbitrary where to set the threshold. I am posting my research bibliography but one of the papers I cannot remember which) stated that most will shift the threshold arbitrarily into the tail until a GPD is achieved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is my bibliography. There are entries that aren't relevant but quite a few that may be of value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/dRM7T.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/dRM7T.jpg&quot; alt=&quot;Bibliography Page 1&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/eAytL.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/eAytL.jpg&quot; alt=&quot;Bibliography Page 2&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18159" LastEditorUserId="18159" LastEditDate="2016-01-29T04:11:24.493" LastActivityDate="2016-01-29T04:11:24.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22954" PostTypeId="1" CreationDate="2016-01-27T16:09:25.093" Score="2" ViewCount="147" Body="&lt;p&gt;As I understand it, the Fed has 3 tools for moving interest rates to combat inflation/unemployment: the discount rate, Fed Funds rate and open market operations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to understand how the yield curve is affected:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Fed Fund rate is the overnight rate at which reserve balances, held by banks at the fed can be lent to each other. The shortest maturity that &lt;a href=&quot;https://www.treasury.gov/resource-center/data-chart-center/interest-rates/Pages/TextView.aspx?data=yield&quot; rel=&quot;nofollow noreferrer&quot;&gt; this treasury yield curve&lt;/a&gt; has is 1 month (no overnight). Are expectations regarding overnight fed funds rates reflected in the 1 month yields? I would suppose so, because if the government raises fed funds, their intentions are to influence and increase interest rates in general. Thoughts?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The discount rate is the interest the Fed charges other banks to borrow money. Does the 'discount rate' relate to the commercial paper listed &lt;a href=&quot;http://www.federalreserve.gov/releases/h15/current/&quot; rel=&quot;nofollow noreferrer&quot;&gt;here?&lt;/a&gt;. Am I correct in thinking that the discount rate refers to short term borrowing &amp;lt; 1year and that changes in the yield curve at maturities greater than 1 year may not be directly correlated to changes in fed funds or discount rates? (because these are not tools for influencing long term rates)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally I understand that changes in the curve at longer maturities may reflect the governments 'open market operations' and their buying and selling of US securities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help solidifying this understanding would be much appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PART 2 TO THIS QUESTION &lt;a href=&quot;https://quant.stackexchange.com/questions/22993/monetary-policy-and-the-yield-curve-part-two&quot;&gt;HERE&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18448" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-01-28T18:25:37.027" Title="Monetary Policy and the Yield Curve PART ONE" Tags="&lt;interest-rates&gt;&lt;yield-curve&gt;" AnswerCount="0" CommentCount="7" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22955" PostTypeId="1" CreationDate="2016-01-27T17:00:41.643" Score="3" ViewCount="3774" Body="&lt;p&gt;In trying to find VaR for 5 financial assets with prices over a long period of time(2000 days worth of data) how would I do the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Carry out monte-carlo simulation in order to find a VaR value, assuming all 5 assets are standard normally distributed.&lt;/li&gt;&#xA;&lt;li&gt;Carry out monte-carlo simulation for all 5 assets to find a VaR value, assuming they follow a student-t distribution with 10 degrees of freedom?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I am trying to do this at both the 95% and 90% confidence levels, and simulate the data with 10,000 replications. Any help would be greatly appreciated. I have already created a Cholesky Decomposition Matrix but not sure how to use the data in it to get the VaR figure.&lt;/p&gt;&#xA;" OwnerUserId="19181" LastActivityDate="2017-10-19T17:43:41.573" Title="Step By Step method to calculating VaR using MonteCarlo Simulations" Tags="&lt;finance&gt;&lt;modeling&gt;&lt;value-at-risk&gt;&lt;excel&gt;&lt;asset&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22956" PostTypeId="2" ParentId="22951" CreationDate="2016-01-27T17:54:44.610" Score="2" Body="&lt;p&gt;Since all futures are linear instruments you can achieve a perfect hedge by going short or long into the same future depending on your position. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If however there are no available futures you can use cross-hedging as explained by Hull (2007) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/FYbBZ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/FYbBZ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i get an error bellow I'm not sure why so I'll put it in code format: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; To answer your question the delta of a future is not perfectly 1&#xA;&amp;gt; because in order to for example hedge $10 exposure today for 2 periods&#xA;&amp;gt; you would pay  $10*e^(0.02*2) for the future. Assuming 0.02r. so the&#xA;&amp;gt; delta is 10/10.41&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="17895" LastActivityDate="2016-01-27T17:54:44.610" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="22957" PostTypeId="2" ParentId="22955" CreationDate="2016-01-27T18:28:38.900" Score="0" Body="&lt;p&gt;Have you looked at the PerformanceAnalytics R package functions? It should allow you to calculate delta normal Var quite easily. I recommend you look at the instructions manual but here is the code for it: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;VaR(R = NULL, p = 0.95, ..., method = c(&quot;modified&quot;, &quot;gaussian&quot;,&#xA;&quot;historical&quot;, &quot;kernel&quot;), clean = c(&quot;none&quot;, &quot;boudt&quot;, &quot;geltner&quot;),&#xA;portfolio_method = c(&quot;single&quot;, &quot;component&quot;, &quot;marginal&quot;), weights = NULL,&#xA;mu = NULL, sigma = NULL, m3 = NULL, m4 = NULL, invert = TRUE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;what you need to look at is the &lt;code&gt;method&lt;/code&gt;, gaussian being the n-distribution.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;to go across your assets (columns) you can use a &lt;code&gt;for&lt;/code&gt; loop or &lt;code&gt;apply&lt;/code&gt; functions &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    setwd( enter file name)&#xA;    data &amp;lt;- read.csv(&quot;namefile&quot;)&#xA;&#xA;    for (i in ncol(data)) {&#xA;&#xA;&#xA;      stock_var &amp;lt;-  VaR(R = NULL, p = 0.95, ..., method = c(&quot;modified&quot;, &quot;gaussian&quot;,&#xA;        &quot;historical&quot;, &quot;kernel&quot;), clean = c(&quot;none&quot;, &quot;boudt&quot;, &quot;geltner&quot;),&#xA;        portfolio_method = c(&quot;single&quot;, &quot;component&quot;, &quot;marginal&quot;), weights = NULL,&#xA;        mu = NULL, sigma = NULL, m3 = NULL, m4 = NULL, invert = TRUE)&#xA;&#xA;print(stock_var)&#xA;    }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;i recommend you look at the individual functions separately to understand their format &lt;/p&gt;&#xA;" OwnerUserId="17895" LastEditorUserId="17895" LastEditDate="2016-01-27T18:47:36.187" LastActivityDate="2016-01-27T18:47:36.187" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22958" PostTypeId="2" ParentId="22952" CreationDate="2016-01-27T18:38:39.987" Score="0" Body="&lt;p&gt;in the context of bonds / fixed income an annuity is a payment which is made at regular time intervals - a cupon. A continuous one is simply being paid for an unlimited amount of time. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;PV = Cupon/ (1+r)^1 + ...... Cupon/ (1+r)^t &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;just to add to Bob's comment above, a &quot;continuously compounding&quot; annuity is re-invested at the same rate every month on top of your principal value and previous annuity payments - gaining interest on interest. the formula is this: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/3MwQN.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/3MwQN.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17895" LastEditorUserId="17895" LastEditDate="2016-01-27T18:44:00.240" LastActivityDate="2016-01-27T18:44:00.240" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22959" PostTypeId="2" ParentId="22928" CreationDate="2016-01-27T18:57:49.570" Score="0" Body="&lt;p&gt;The fama and french database is updated monthly relative to the asset universe available in the market at that point in time. The asset universe used in 1973 will not be the same as the one used in December of last year. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would recommend using the five factor model FF(2014) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;since portfolio theory assumes a linear positive relationship between CAPM beta of any stock and the market the answer to your question is no, it is not dependent. Keep in mind that the factor variables available are for US stocks only and will not work effectively for others. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you wish to analyze the EU markets you can form regional based portfolios by using the average return of the largest EU indexes as the market portfolio, then long small cap and short large cap for SMB and long high B/M and short low B/M for the HML factor. &lt;/p&gt;&#xA;" OwnerUserId="17895" LastActivityDate="2016-01-27T18:57:49.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22963" PostTypeId="1" AcceptedAnswerId="22988" CreationDate="2016-01-27T19:30:51.270" Score="0" ViewCount="106" Body="&lt;p&gt;What is meant by $\frac {\Phi (d_2)}{\Phi (d_1)}$ in the Black Scholes call option price?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found it in a solution as $\frac{\text{short position in cash}}{(\text{number of shares})(\text{strike price discounted to time zero})}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.actuaries.org.uk/documents/subject-ct8-financial-economics-exam-papers-and-examiners-reports-2005-2009&quot; rel=&quot;nofollow&quot;&gt;Reference can be found here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q. Number 4 on page number 19, and Its solution on page number 26&lt;/p&gt;&#xA;" OwnerUserId="18878" LastEditorUserId="848" LastEditDate="2016-01-28T08:08:05.940" LastActivityDate="2016-01-28T15:36:58.277" Title="Ratio of gaussian CDFs in Black-scholes option pricing formula" Tags="&lt;black-scholes&gt;" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="22964" PostTypeId="2" ParentId="18096" CreationDate="2016-01-27T21:34:10.123" Score="2" Body="&lt;p&gt;Google uses the 1 factor CAPM model developed by Fama French (1974). Its a simple linear regression with the stock as dependent variable and the market portfolio as independent &lt;/p&gt;&#xA;" OwnerUserId="17895" LastActivityDate="2016-01-27T21:34:10.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22967" PostTypeId="1" CreationDate="2016-01-27T22:41:06.547" Score="3" ViewCount="2476" Body="&lt;p&gt;As thebonnotgang(1) stopped updating their database, I was wondering if there are some other free sources of high-frequency data available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found a proper tick data api (ca. 25 day history) hosted by onvista which is however undocumented. As some one might be interested I will add a short howto:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;urlscheme: &lt;code&gt;http://www.onvista.de/aktien/boxes/times+sales/export.csv?assetId=[ISIN]&amp;amp;assetType=[AssetType]&amp;amp;notation=[exchangeID]&amp;amp;tradingDay=[TradingDay]&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;[TradingDay]&lt;/code&gt;: Can be calculated by fixing a date e.g. 26-01-2016 as 1453791600 and subtracting the number of days multiplied by 86400. You can find the current trading day here[2]. Just klick on 'Anzeigen' as soon as the page loaded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;[ISIN]&lt;/code&gt;: self-explanatory I guess&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;[AssetType]&lt;/code&gt;: Up to know I was only downloading stocks so I used 'Aktie'&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;[ExchangeID]&lt;/code&gt;: I'm not able to offer a full list of all exchanges however '1937897' refers to Xetra and '9385907' refers to Tradegate. You can find more by playing around with the stock exchange dropdown menu [here][3] and looking at &lt;code&gt;&amp;amp;notation=[***]&lt;/code&gt; within the url.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example Allianz 06.01.2016: &lt;code&gt;http://www.onvista.de/aktien/boxes/times+sales/export.csv?assetId=DE0008404005&amp;amp;assetType=Aktie&amp;amp;notation=1937897&amp;amp;tradingDay=1452063600&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I am afraid this link will be broken in a few days due to the time horizon. So it should serve just as an example)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As onvista is restructuring their homepage &lt;code&gt;http://www.onvista.de/index/DAX-Index-20735?&lt;/code&gt;&lt;strong&gt;&lt;em&gt;&lt;code&gt;beta=off&lt;/code&gt;&lt;/em&gt;&lt;/strong&gt; I assume they will take this service down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So did someone discover something similar?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A similar question[4] has been asked several years ago and provides more trivial/googled results.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://thebonnotgang.com/tbg/historical-data/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://thebonnotgang.com/tbg/historical-data/&lt;/a&gt;`&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.onvista.de/aktien/times+sales/popup/Allianz-Aktie-DE0008404005&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.onvista.de/aktien/times+sales/popup/Allianz-Aktie-DE0008404005&lt;/a&gt;`&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.onvista.de/aktien/times+sales/Allianz-Aktie-DE0008404005?notation=32810950&amp;amp;activeType=line&amp;amp;activeTab=J1&amp;amp;displayVolume=false&amp;amp;min=0&amp;amp;max=1453935599999&amp;amp;zoom=false&amp;amp;scaling=linear&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.onvista.de/aktien/times+sales/Allianz-Aktie-DE0008404005?notation=32810950&amp;amp;activeType=line&amp;amp;activeTab=J1&amp;amp;displayVolume=false&amp;amp;min=0&amp;amp;max=1453935599999&amp;amp;zoom=false&amp;amp;scaling=linear&lt;/a&gt;`&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/6225902/where-can-i-find-high-resolution-financial-data/6226589#6226589&quot;&gt;https://stackoverflow.com/questions/6225902/where-can-i-find-high-resolution-financial-data/6226589#6226589&lt;/a&gt;`&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I didn't have 'sufficient reputation to post the links in correct mode.&lt;/p&gt;&#xA;" OwnerUserId="18990" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2016-05-26T09:22:14.170" Title="Free high resolution financial data" Tags="&lt;market-data&gt;&lt;high-frequency&gt;&lt;historical-data&gt;&lt;database&gt;&lt;data-source&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22968" PostTypeId="2" ParentId="22940" CreationDate="2016-01-27T23:18:07.537" Score="0" Body="&lt;p&gt;Not sure whether your client wants &quot;method&quot; or &quot;visualisation&quot;. I might be guessing that he expects you to present results similar to what's shown here &lt;a href=&quot;https://msci.com/resources/research/articles/2015/Research_Insight_Backtesting_Risk_Models_2014_YearInReview.pdf&quot; rel=&quot;nofollow&quot;&gt;https://msci.com/resources/research/articles/2015/Research_Insight_Backtesting_Risk_Models_2014_YearInReview.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18275" LastActivityDate="2016-01-27T23:18:07.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22970" PostTypeId="1" CreationDate="2016-01-28T01:20:52.560" Score="1" ViewCount="191" Body="&lt;p&gt;In a university project I am looking at Black Scholes model with a stochastic volatility. I’m still not quite sure about my focus (I am in the beginning 'Idea phase'). I want to explain the theory behind stochastic differential equation and then implement some numerical methods too solve pricing models. I haven’t worked much with idea.&#xA;Please make some suggestions/comments?&#xA;How can I analyze some data from from the real world? I want to include simulations of real options prices or similar in my project. Thanks&lt;/p&gt;&#xA;" OwnerUserId="18555" LastEditorUserId="601" LastEditDate="2016-01-28T06:54:58.013" LastActivityDate="2016-01-28T06:54:58.013" Title="School project about Black Scholes with stochastic volatility" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;stochastic-volatility&gt;&lt;numerical-methods&gt;&lt;homework&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22972" PostTypeId="1" AcceptedAnswerId="22974" CreationDate="2016-01-28T07:15:15.287" Score="2" ViewCount="1220" Body="&lt;p&gt;Can someone give me an explanation of what integrated volatility is (and possibly why it is preferred) versus a standard measure of volatility eg variance?&lt;/p&gt;&#xA;" OwnerUserId="15434" LastActivityDate="2016-01-28T07:39:01.463" Title="Integrated volatility" Tags="&lt;volatility&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22974" PostTypeId="2" ParentId="22972" CreationDate="2016-01-28T07:39:01.463" Score="4" Body="&lt;p&gt;In a standard approach you would think about the evolution of a return process in the following form:&#xA;$$dr_t=\mu dt+\sigma dW_t,$$ where for the sake of simplicity I assumed constant volatility and drift ($\mu$ and $\sigma$ can also depend on the time parameter $t$). Often you will be interested into the variance of your stock returns (for example to hedge your risks, quantify your exposure to risk or for portfolio optimization) during a certain time period $[\tau,\tau-h]$. Standard Itô Calculus gives you that the 'aggregated' volatility over this time interval is just $$\int_\tau ^{\tau-h}\sigma^2 dt.$$ This term is called integrated variance and can be estimated via the sum of squared returns during this period (this gives you the close connection to realized volatility.  &lt;/p&gt;&#xA;" OwnerUserId="16249" LastActivityDate="2016-01-28T07:39:01.463" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22975" PostTypeId="2" ParentId="22967" CreationDate="2016-01-28T08:51:55.537" Score="2" Body="&lt;p&gt;For what concerns Forex data which is, however financial data after all, I often use &lt;a href=&quot;http://www.histdata.com/&quot; rel=&quot;nofollow&quot;&gt;http://www.histdata.com/&lt;/a&gt;.  Their data is delivered in .CSV format. For timeframes, I quote the website:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We can only deliver you time ordered Tick and M1 (1 minute) data.&#xA;  The data that we have available is organized by forex-pair/year/month.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;They also provide data for some commodities and indexes. &lt;/p&gt;&#xA;" OwnerUserId="9424" LastActivityDate="2016-01-28T08:51:55.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22976" PostTypeId="1" AcceptedAnswerId="22978" CreationDate="2016-01-28T09:01:58.043" Score="0" ViewCount="1166" Body="&lt;p&gt;What should we take for a bond or a zero coupon bond in order to make a variance covariance matrix?&#xA;For example:-&#xA;Equities - we take the market price &#xA;Cash - we take the spot rates &#xA;Bonds - Do we take yield points from bloomberg or cash flows or simply the traded price of the bond ?????&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S - I had initially taken the yield points for which I got the feedback as &quot;yield points are taken as proxy mapping while not considering the inverse relationship with the bond prices&quot;. What does this statement means??? Please help me out in this regard as I am very much confused what to do with bonds in order to make variance covariance matrix?&lt;/p&gt;&#xA;" OwnerUserId="18663" LastEditorUserId="18663" LastEditDate="2016-01-28T09:40:14.920" LastActivityDate="2016-01-28T09:40:14.920" Title="Variance covariance matrix for a portfolio containing bonds also with other asset classes" Tags="&lt;fixed-income&gt;&lt;var&gt;&lt;covariance&gt;&lt;variance&gt;&lt;covariance-matrix&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22978" PostTypeId="2" ParentId="22976" CreationDate="2016-01-28T09:18:00.617" Score="1" Body="&lt;p&gt;You most probably don't want to estimate the covariance of prices but rather the covariance of returns.&#xA;Thus for equities you can take the return of the traded price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For bonds:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;if the maturity is long enough (say bigger than 2 years), then you can take the returns of traded prices. The pull to par should not be too relevant here.&lt;/li&gt;&#xA;&lt;li&gt;if the maturity is short or in any case for better modelling: if you do historical simulation then you reprice the bond (with current characteristic, especially current time to maturity) in historical scenarios of the yield curve (applying historical deltas to today's curve). Then you can calculate returns of these scenario prices to the current price. This will give you returns.&lt;/li&gt;&#xA;&lt;li&gt;as approximation you can calculte each bonds duration and approximate returns by &#xA;$$&#xA;r_i = -D \Delta y_i&#xA;$$&#xA;where $D$ is the duration and $\Delta y_i$ is the change at time $i$ of the corresponding yield.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;One could (and some people did) fill books with this. You could have a look at Meucci's &lt;a href=&quot;http://symmys.com/sites/default/files/4%20_%20Attilio%20Meucci%20-%20Risk%20and%20Asset%20Allocation%20-%20Quest%20for%20Invariance.pdf&quot; rel=&quot;nofollow&quot;&gt;The quest for invariance&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-01-28T09:18:00.617" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="22979" PostTypeId="2" ParentId="22213" CreationDate="2016-01-28T11:16:17.167" Score="2" Body="&lt;p&gt;Have a look at Ken French's data library. &lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html&quot; rel=&quot;nofollow&quot;&gt;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it may also be interesting to consider some 'modern' version of Graham's ratios. Recently Fama and French (2015) and Novy-Marx prove that more profitable firms yield higher returns. NM sorts companies on gross profits-to-total-asstes, FF rank companies on operating profit to market equity. &lt;/p&gt;&#xA;" OwnerUserId="18070" LastActivityDate="2016-01-28T11:16:17.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22980" PostTypeId="2" ParentId="21981" CreationDate="2016-01-28T11:23:00.450" Score="3" Body="&lt;p&gt;Indeed, the Sharpe ratio utilises the risk-free rate. When you're using another benchmark then the risk-free rate, say the market, the ratio is often referred to as the Information Ratio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, the denominator becomes the standard deviation of the difference between the market return with your portfolio returns instead of standard deviation of the difference between the risk-free rate and your portfolio return&lt;/p&gt;&#xA;" OwnerUserId="18070" LastEditorUserId="18070" LastEditDate="2016-01-28T11:48:31.653" LastActivityDate="2016-01-28T11:48:31.653" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="22981" PostTypeId="2" ParentId="18096" CreationDate="2016-01-28T11:44:18.780" Score="0" Body="&lt;p&gt;Being a Google Finance user myself I was not able to figure out how it computes the beta. However, my best guess is that it's done in a way that is very similar to the methods used by Yahoo and Bloomberg. I.e. SP500 and 36 or 60 monthly observations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, I would say that it does not really matter how the beta is computed since the betas on Google and Yahoo are only used as a quick scan. For a closer examination, it always better to create your own definition of beta. For example, if you want to figure out how risky apple is compared to other tech companies it makes more sense to regress against the NASDAQ than the SP500.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yahoo: monthly 3 year observations (36 in total) against S&amp;amp;P 500&#xA;Bloomberg: monthly 5 year observations (60 in total) against S&amp;amp;P 500&lt;/p&gt;&#xA;" OwnerUserId="18070" LastEditorUserId="-1" LastEditDate="2017-11-04T14:21:15.553" LastActivityDate="2017-11-04T14:21:15.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22982" PostTypeId="1" AcceptedAnswerId="22983" CreationDate="2016-01-28T12:49:19.673" Score="3" ViewCount="1320" Body="&lt;p&gt;I have noticed when reading (many) articles about Heston Calibration that not all (few actually) do care about the Feller condition. Below is a compilation of calibration results from some different authors (&lt;a href=&quot;http://eu.wiley.com/WileyCDA/WileyTitle/productCd-1118548256.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;source&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/K2EXf.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/K2EXf.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we calculate the Feller condition $2 \kappa \theta - \sigma^2$ for the above we can see that in all cases it is extremely close to 0. For row 1, 3 and 6 it is in fact negative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;So the Question is basically:&lt;/strong&gt; In my own calibration code, should I use the Feller condition as a calibration constraint (e.g. as a penalty function) or should I skip the constraint since it doesn't always hold in the market?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking forward to your input!&lt;/p&gt;&#xA;" OwnerUserId="2376" LastActivityDate="2016-09-24T12:02:41.773" Title="About the Feller Condition in Heston Calibration" Tags="&lt;options&gt;&lt;calibration&gt;&lt;heston&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22983" PostTypeId="2" ParentId="22982" CreationDate="2016-01-28T13:39:36.257" Score="3" Body="&lt;p&gt;You should not use the Feller condition as a constraint.  In many cases its violation will be required for a good fit to the market data.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2016-01-28T13:39:36.257" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22984" PostTypeId="1" CreationDate="2016-01-28T14:05:26.153" Score="1" ViewCount="1330" Body="&lt;p&gt;I am trying to carry out backtesting on a number of Value at Risk figures i obtained using var/covar, historical, and monte carlo simulation. The two methods im using are the Kupiec test (unconditional test) and the Christoffersen test (conditional test). The Value at Risk figures are based on 5 financial assets with two short positions, and i have 250 data entries to be used for the backtesting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a step by step method to backtest my VaR figures, in excel, using both the the Kupiec test (unconditional test) and the Christoffersen test (conditional test)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;any help would be greeatly appreciated&lt;/p&gt;&#xA;" OwnerUserId="19199" LastEditorUserId="19199" LastEditDate="2016-01-28T15:20:03.910" LastActivityDate="2016-01-28T16:31:56.507" Title="How to backtest Value at Risk Models using Conditional and Unconditional tests?" Tags="&lt;finance&gt;&lt;backtesting&gt;&lt;value-at-risk&gt;&lt;excel&gt;&lt;modelling&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="22985" PostTypeId="1" CreationDate="2016-01-28T14:10:32.503" Score="0" ViewCount="38" Body="&lt;p&gt;This questions borders on the actuarial side of things but the general solution should have relevance in several situations. Suppose we have a set of $k$ people who will retire in $\{n_1,...,n_k\}$ years respectively. We say an allocation of $M$ is equitable if each person receives an equivalent lump sum value at retirement. Let's assume the rate of return is constant and equal to $r$ and we will denote each persons allocation as $m_i$ respectively. We then have the following system,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$M=m_1+...+m_k$&#xA;$m_i(1+r)^{n_i}=m_j(1+r)^{n_j}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For all values of $i$ and $j$. It is not clear to me that we can guarantee a solution for general values of k and n_i. Especially as the number of people grow. Any help is greatly appreciated!&lt;/p&gt;&#xA;" OwnerUserId="15832" LastActivityDate="2016-01-28T19:00:02.670" Title="Equitable Allocation" Tags="&lt;interest-rates&gt;&lt;optimization&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22988" PostTypeId="2" ParentId="22963" CreationDate="2016-01-28T15:36:58.277" Score="2" Body="&lt;p&gt;For a call option with price given by&#xA;\begin{align*}&#xA;c = S_0 \Phi(d_1) - K e^{-rT}\Phi(d_2),&#xA;\end{align*}&#xA;the delta hedge ratio $\Phi(d_1)$ is the number of shares to hold. That is, $S_0 \Phi(d_1)$ is the total holding share value for hedging, while $K e^{-rT}\Phi(d_2)$ is the total cash amount in short. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the question, it says that, for $N$ options, 250,000 shares of the stock are hold, and the amount of $ £413,057$ is in short. The strike price is $K=2.0$. Therefore,&#xA;\begin{align*}&#xA;N \Phi(d_1) = 250000, \mbox{ and } N K e^{-rT}\Phi(d_2) =  £413057.&#xA;\end{align*}&#xA;Consequently,&#xA;\begin{align*}&#xA;\frac{\Phi(d_2)}{\Phi(d_1)} &amp;amp;= \frac{N K e^{-rT}\Phi(d_2)}{N\Phi(d_1)}\frac{N}{N K e^{-rT}}\\&#xA;&amp;amp;=\frac{N K e^{-rT}\Phi(d_2)}{N\Phi(d_1) K e^{-rT}} \\&#xA;&amp;amp;=\frac{413057}{250000 \times 2.0 \times e^{-0.03 \times 0.5}}\\&#xA;&amp;amp;= 0.8386.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-01-28T15:36:58.277" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22989" PostTypeId="2" ParentId="22719" CreationDate="2016-01-28T16:16:27.733" Score="2" Body="&lt;p&gt;For general mathematical finance, you may start with the book &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0387401016&quot; rel=&quot;nofollow&quot;&gt;Stochastic Calculus for Finance&lt;/a&gt;, and then the books &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/3643458983&quot; rel=&quot;nofollow&quot;&gt;Martingale Methods in Financial Modelling&lt;/a&gt; and &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1852333766&quot; rel=&quot;nofollow&quot;&gt;Mathematical Methods for Financial Markets&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After those preparations, you can start with some books in specialized areas such as the books &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/B00BTM5UR6&quot; rel=&quot;nofollow&quot;&gt;Interest Rate Models&lt;/a&gt; by Brigo and Mercurio, &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/3540675930&quot; rel=&quot;nofollow&quot;&gt;Credit Risk&lt;/a&gt; by Bielecki and Rutkowski, and &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/047074846X&quot; rel=&quot;nofollow&quot;&gt;Counterparty Credit Risk&lt;/a&gt; by Brigo et al. Some other numerical computation and programming skills are also needed.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-01-28T16:16:27.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22991" PostTypeId="2" ParentId="22719" CreationDate="2016-01-28T17:45:13.803" Score="0" Body="&lt;p&gt;As you don't have any background in finance. I would recommend you following book : &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0073530700&quot; rel=&quot;nofollow&quot;&gt;Investment by Bodie&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0133456315&quot; rel=&quot;nofollow&quot;&gt;Options, Futures, and Other Derivatives by Hull&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/012384682X&quot; rel=&quot;nofollow&quot;&gt;An Introduction to the Mathematics of Financial Derivatives by Neftci&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0521552893&quot; rel=&quot;nofollow&quot;&gt;Financial calculus: an introduction to derivative pricing by Baxter and Rennie&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;After reading these books you can easily move to high level books as pointed by Gordon. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some auxiliary book that might help you to get better understanding are : &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470414359&quot; rel=&quot;nofollow&quot;&gt;Analysis of Financial Time Series by Tsay&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.amazon.com/s/ref=a9_sc_1?rh=i%3Astripbooks%2Ck%3Aintroduction%20to%20econometrics%20by%20gujarati&amp;amp;keywords=introduction%20to%20econometrics%20by%20gujarati&amp;amp;ie=UTF8&amp;amp;qid=1454002944&quot; rel=&quot;nofollow&quot;&gt;Essentials of Econometrics&lt;/a&gt; by Damodar Gujarati and Dawn Porter&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2016-01-28T17:45:13.803" CommentCount="0" CommunityOwnedDate="2016-02-09T20:01:31.273" ContentLicense="CC BY-SA 3.0" />
  <row Id="22993" PostTypeId="1" CreationDate="2016-01-28T18:20:51.743" Score="4" ViewCount="261" Body="&lt;p&gt;The Fed has a number of tools/targets with which they manage monetary policy. I'm looking to refine a concise summary of them and looking for guidance/correction/validation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Think I understand these first three. Please correct me if I'm wrong:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Open Market Operations: The Federal Open Market Committee (FOMC)&#xA;will    often instruct the Federal Reserve Bank of New York to&#xA;engage in open    market operations (buying and selling of US&#xA;securities) to influence    interest rates. Movement at all&#xA;maturities on the yield curve can    reflect such operations; the&#xA;Fed has been known to try and alter the    shape/slope of the curve.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The Discount Window: offers various types of credit at the discount    rate; designed for times of stress; rates are high (penalty rates - see &lt;a href=&quot;http://www.federalreserve.gov/newsevents/speech/madigan20090821a.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bagehot's Dictum&lt;/a&gt;); use of discount window&#xA;    credit may spark regulator investigation. Discount Window credit is typically overnight (primary/secondary) or less than 9 months in the case of seasonal loans. Changes in discount rate only affects the short end of the yield curve.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The Fed Fund rate: overnight rate at which reserve balances, held by banks at the fed can be lent to each other. This rate is&#xA;    calculated from market transactions. The Fed determines their FF&#xA;    rate target and use open market operations to move the Fed Funds&#xA;    rate toward a particular level. Whilst the Fed Fund rate is an&#xA;    overnight rate, it can be related to longer term movements on the&#xA;    yield curve (1-month treasury bill for example) but there are&#xA;    differences; notably the Fed Funds rate, being a market rate, does&#xA;    vary, while the yield on a 1-month Treasury is effectively fixed at&#xA;    the time of purchase. The relationship between the expected values&#xA;    of a fixed rate and a floating rate is expressed through Overnight&#xA;    Indexed Swap values, and 1-month OIS on the Fed Funds rate is the&#xA;    best direct indication of the expected value of compounded overnight&#xA;    borrowing in the Fed Funds market.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;I'm looking for further confirmation/understanding no the next two:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The &lt;a href=&quot;https://www.newyorkfed.org/markets/rrp_faq.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;reverse repo program&lt;/a&gt;, which enables it to set a floor under&#xA;short-term secured borrowing rates. This makes sense: reverse repo =&#xA;sell security, collect payment from bank, reduce their fed reserve&#xA;balance, decrease supply of money in the system and put upwards&#xA;pressure on the federal funds rate for example. Is this logic&#xA;correct?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The interest rate on excess reserves (IOER); from comments on my prior question, I understand that this rate sets the ceiling for fed&#xA;funds. IOER = interest paid on balances above the required level;&#xA;how does that set a ceiling? Sounds more like a floor; for a bank to&#xA;lend its excess reserves, they would want a higher rate than the&#xA;IOER?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This is a follow on from part one which was posted &lt;a href=&quot;https://quant.stackexchange.com/questions/22954/federal-reserve-interest-rates-and-yield-curves&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="18448" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-08-26T05:18:43.437" Title="Monetary Policy and the Yield Curve PART TWO" Tags="&lt;interest-rates&gt;&lt;yield-curve&gt;&lt;fomc&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22994" PostTypeId="2" ParentId="22719" CreationDate="2016-01-28T18:46:38.380" Score="10" Body="&lt;p&gt;In general, quantitative finance requires mathematics, finance, and numerical programming.  The mix of the three and the areas of focus within the three will depend on the particular area you intend to work in.  For example, option pricing, risk, and asset management are all related but derivative modeling would draw more on stochastic processes and martingales, whereas risk and asset management would draw more on statistics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the programming side, it's good to be familiar with numerical libraries like Lapack, numerical programming languages like Matlab, and source control (git).  Programming in Python, C and C++ is a good idea too, as well as some reasonable level of computer science &amp;amp; software engineering (data structures, algorithms, software design, etc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To start, one should at least have some familiarity with numerical methods, such as from:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0521880688&quot; rel=&quot;noreferrer&quot;&gt;Press, Teukolsky, Vetterling &amp;amp; Flannery, Numerical Recipes&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;but be warned that Numerical Recipes can be simplistic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For option pricing and the mathematically sophisticated, it helps to have a strong background in probability and measure theory.  For that, the following texts would be useful:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1118122372&quot; rel=&quot;noreferrer&quot;&gt;Billingsley, Probability and Measure&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0521406056&quot; rel=&quot;noreferrer&quot;&gt;Williams, Probability and Martingales&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0387900888&quot; rel=&quot;noreferrer&quot;&gt;Halmos, Measure Theory&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For the basics of options, everyone uses:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0132777428&quot; rel=&quot;noreferrer&quot;&gt;Hull, Options, Futures and Other Derivatives&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;but I preferred:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/B000KWTAD6&quot; rel=&quot;noreferrer&quot;&gt;Cox &amp;amp; Rubinstein, Options Markets&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;when I was first learning the subject.  But, Cox &amp;amp; Rubinstein is old, and Hull is regularly updated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That will give you the basics on the finance side in an intuitive way but not in a mathematically rigorous way.  For the mathematical rigor, I recommend:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0387950168&quot; rel=&quot;noreferrer&quot;&gt;Steele, Stochastic Calculus and Financial Applications&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Steele rigorously develops stochastic processes, martingales, Ito&#xA;   integration in a financial context but includes the intuition, so&#xA;   he's also being very down to earth and concrete.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other general, texts a little more sophisticated than Hull, but less rigorous than Steele that people commonly like would include:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0521552893&quot; rel=&quot;noreferrer&quot;&gt;Baxter &amp;amp; Rennie, Financial Calculus: An Introduction to Derivative Pricing&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0387249680&quot; rel=&quot;noreferrer&quot;&gt;Shreve, Stochastic Calculus for Finance I: The Binomial Asset Pricing Model&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/144192311X&quot; rel=&quot;noreferrer&quot;&gt;Shreve, Stochastic Calculus for Finance II: Continuous-Time Models&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;After that, there are lots of different places to go.  It will depend on the numerical methods needed, the asset class being worked on, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, for more on the numerical methods and the PDE approaches, there's:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0952208202&quot; rel=&quot;noreferrer&quot;&gt;Wilmott, Dewynne &amp;amp; Howison, Option Pricing: Mathematical models and computation&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Every interest rate derivative quant needs to be familiar with:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/3540221492&quot; rel=&quot;noreferrer&quot;&gt;Brigo &amp;amp; Mercurio, Interest Rate models - Theory and Practice&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For other areas, the list would be different.&lt;/p&gt;&#xA;" OwnerUserId="7470" LastActivityDate="2016-01-28T18:46:38.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22995" PostTypeId="2" ParentId="22985" CreationDate="2016-01-28T19:00:02.670" Score="2" Body="&lt;p&gt;You're writing it in terms of the growth factors and annual compounding.  You want to split up $M$ so that as each piece grows over time, the $i$th person at time $n_i$ gets paid the same amount as the $j$th person gets at time $n_j$. So simply scale by the corresponding discount factors.  Let&#xA;$$&#xA;\alpha_i = \frac{(1+r)^{-n_i}}{\sum_j (1+r)^{-n_j}}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then&#xA;$$&#xA;\sum \alpha_i = 1&#xA;$$&#xA;and&#xA;$$&#xA;\alpha_i (1+r)^{n_i} = \alpha_j (1+r)^{n_j}&#xA;$$&#xA;so you can define&#xA;$$&#xA;m_i = M \alpha_i&#xA;$$&#xA;and then&#xA;$$&#xA;\sum_i m_i = M&#xA;$$&#xA;and&#xA;$$&#xA;m_i (1+r)^{n_i} = m_j (1+r)^{n_j},&#xA;$$&#xA;as desired.&lt;/p&gt;&#xA;" OwnerUserId="7470" LastActivityDate="2016-01-28T19:00:02.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22997" PostTypeId="1" CreationDate="2016-01-28T22:30:36.207" Score="-1" ViewCount="484" Body="&lt;p&gt;I'm wondering if I can apply Black-Scholes formula to value a butterfly option, i.e: $$B(T)=V_\text{call}(S(T)-K,0)+V_\text{call}(S(T)-K',0)-2V_\text{call}(S(T)-K'',0)$$ with $K&amp;lt;K''&amp;lt;K'$, just evaluating each call with B-S formula and operating independently. I think so but I don't know how to explain it with a theoretical basis.&lt;/p&gt;&#xA;" OwnerUserId="19212" LastEditorUserId="467" LastEditDate="2016-12-13T08:57:26.247" LastActivityDate="2016-12-13T08:57:26.247" Title="How to use Black-Scholes' formula for a butterfly option?" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;option-strategies&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="22998" PostTypeId="2" ParentId="22993" CreationDate="2016-01-29T00:55:25.663" Score="1" Body="&lt;p&gt;According to money market expert Scott Skyrm:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;quote&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The FRRP provides a floor to the market because as overnight rates approach the FRRP rate, more volume is executed at the facility and more collateral is added to the market, removing cash.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The IOER acts as a ceiling in the overnight market by adding cash, though indirectly. When market rates like fed funds and GC Repo trade above the IOER, banks will move cash out of Excess Reserves and into fed funds or GC Repo to maximize their overnight investments, effectively driving those rates lower. Therefore, it’s important to note, the IOER is an effective upper rate band, but only while banks have significant Excess Reserves stored at the Fed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;End quote&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2016-01-29T00:55:25.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="22999" PostTypeId="1" CreationDate="2016-01-29T04:45:41.283" Score="1" ViewCount="33" Body="&lt;p&gt;My hesitation, as I look at getting into forecasting based on observed variances, is the nagging question - if variances are not constant per-instrument, is it any good to use the last month or year's variance to predict this year's ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If variances are constant(ish), then my follow-up is - what is the causal model that predicts why this is so? I'm uncomfortable without a mental model of why one stock should have variance distinct from another one, and I want to have some sense of how to know the likeliness of a sudden increase of variance, which would be very bad news indeed!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="19103" LastActivityDate="2016-01-29T08:26:27.737" Title="Are Variances generally stable for any given instrument?" Tags="&lt;variance&gt;&lt;mean-variance&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23000" PostTypeId="1" CreationDate="2016-01-29T05:29:43.000" Score="1" ViewCount="1523" Body="&lt;p&gt;If I had a set of 6M Libor instruments and another set of 3M-6M basis swap instruments, how would I derive the 3M Libor curve?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just bootstrap the 6M curve and the basis curve and add up the zero rates at the matching tenors, to give me the 3M zeros? Does this make sense?&lt;/p&gt;&#xA;" OwnerUserId="19208" LastActivityDate="2016-02-24T21:24:33.263" Title="Deriving a 3M libor curve from 6M libor swaps and 3M-6M libor basis swaps" Tags="&lt;yield-curve&gt;&lt;bootstrapping&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23002" PostTypeId="2" ParentId="22999" CreationDate="2016-01-29T08:26:27.737" Score="1" Body="&lt;p&gt;I am not sure what you are exactly asking. But usually even a simple Garch(1,1) would be the naive approach of forecasting variance using last period's variance.&lt;br&gt;&#xA;A very good survey of volatility modelling on the Arch/garch family is the &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1002/jae.800/abstract&quot; rel=&quot;nofollow&quot;&gt;Hansen and Lunde 2005&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They show that hardly one can beat a garch(1,1), so that is a good first guess.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2016-01-29T08:26:27.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23003" PostTypeId="2" ParentId="23000" CreationDate="2016-01-29T10:00:44.793" Score="2" Body="&lt;p&gt;Let $\delta$ be 3 month and consider points of interest $\{T_i\}_i$ evenly spaced with $T_{i+1} -T_i = 3 month$. The Forward Rate $F_m^n(t)$ from period m to n at time $t$ is defined by $$(1 + \delta (n-m) F_m^n(t)) = \frac{B(t,T_m)}{B(t,T_n)},$$ where   $B(t,T_i)$ is the time $t$ value of a zero coupon bond that matures in $T_i$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A swap rate $S_m^n(t)$ a time $t$ of a swap starting in $T_m$ and ending in $T_n$ can be written as &#xA;$$ S_m^n(t)=\sum_{i=m}^{n-1} \frac{\delta B(t,T_{i+1})}{\sum_{j=m}^{n-1}\delta B(t,T_{j+1})}F_i^{i+1}(t) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;It holds&lt;/strong&gt;&#xA;$$F_0^1(0) = (S_0^2(0) - \frac{1}{2+\delta F_1^2(0)}F_1^2(0))(1+1\frac{1}{1+\delta F_1^2(0)})  $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Derivation&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use definition for Swap Rate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{B(0,T_1)}{B(0,T_1)+B(0,T_2)}F_0^1(0)  + \frac{B(0,T_2)}{B(0,T_1)+B(0,T_2)}F_1^2(0) = S_0^2(0)$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now use&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ (1 + \delta F_0^1(0))(1+\delta F_1^2(0)) = \frac{1}{B(0,T_2)}  $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ (1 + \delta F_0^1(0)) = \frac{1}{B(0,T_1)}$$ &#xA;which leads to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{\frac{1}{(1 + \delta F_0^1(0))}}{\frac{1}{(1 + \delta F_0^1(0))} + \frac{1}{(1 + \delta F_0^1(0))(1+\delta F_1^2(0))}}F_0^1(0) +  \frac{\frac{1}{(1 + \delta F_0^1(0))(1+\delta F_1^2(0))}}{\frac{1}{(1 + \delta F_0^1(0))} + \frac{1}{(1 + \delta F_0^1(0))(1+\delta F_1^2(0))}}F_1^2(0) = S_0^2(0)\\ \Leftrightarrow \frac{1}{1+\delta F_1^2(0)} F_0^1(0) + \frac{1}{2+\delta F_1^2(0)}F_1^2(0) = S_0^2(0) $$&#xA;which is equivalent to my the expression above.&lt;/p&gt;&#xA;" OwnerUserId="6640" LastEditorUserId="6640" LastEditDate="2016-02-24T21:24:33.263" LastActivityDate="2016-02-24T21:24:33.263" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23004" PostTypeId="2" ParentId="16442" CreationDate="2016-01-29T13:00:02.147" Score="4" Body="&lt;p&gt;It depends on if you are trying to do a Dollar neutral hedge or a beta neutral hedge. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Method 1 is a Dollar neutral hedge and Method 2 is the Beta neutral hedge ratio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remember that even if you find a cointegrated pair, share A can have a higher beta than share B. &lt;/p&gt;&#xA;" OwnerUserId="19222" LastActivityDate="2016-01-29T13:00:02.147" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23005" PostTypeId="1" CreationDate="2016-01-29T13:38:33.893" Score="0" ViewCount="37" Body="&lt;p&gt;If I have trade prices of 10Y futures contract (ZNH6) is it possible to derive the interest rate from it? Or is there a better way to obtain historical 10 year rates?&lt;/p&gt;&#xA;" OwnerUserId="16145" LastActivityDate="2016-01-29T13:38:33.893" Title="Determining rate of interest" Tags="&lt;rates&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="23006" PostTypeId="1" AcceptedAnswerId="23008" CreationDate="2016-01-29T14:23:18.477" Score="4" ViewCount="833" Body="&lt;p&gt;Suppose that I know that the normality assumption about my data is unrealistic (as it is very frequently): is it possible to apply any distribution that I judge the right one to the Black-Litterman model? Does it make sense, or does it lose some of its usefulness?&lt;/p&gt;&#xA;" OwnerUserId="18694" LastActivityDate="2016-02-03T17:55:05.183" Title="Is it possible to deal with non-normal distribution in Black-Litterman model?" Tags="&lt;portfolio-optimization&gt;&lt;distribution&gt;&lt;black-litterman&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="23007" PostTypeId="2" ParentId="18493" CreationDate="2016-01-29T14:34:07.430" Score="1" Body="&lt;p&gt;The Black-Scholes PDE holds in the continuation region : &#xA;$$ u_t = - \frac{1}{2} \sigma^2 u_{ss} $$ (ignoring interest rate).  This says that theta is as smooth as gamma.  The &quot;smooth pasting&quot; literature you mention shows that delta is continuous at the exercise boundary, but gamma has a jump.  So theta has a jump as well.  In other words, in the time direction price is continuous but its derivative is not.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2016-01-29T14:34:07.430" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23008" PostTypeId="2" ParentId="23006" CreationDate="2016-01-29T14:55:19.787" Score="7" Body="&lt;p&gt;Well there are two main things to consider here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many implementation of Black-Litterman use the market portfolio and the ex post volatility and correlation structure to back out &lt;em&gt;implied returns&lt;/em&gt; to use as prior. As far as I know, there is no standard way to reverse-engineer the optimization problem in the presence of nonnormal markets. (the first guess is that it could be possible for elliptical markets)&#xA;So in that respect its probably at least hard (maybe not possible).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you think of Black-Litterman as a &lt;em&gt;Bayesian method&lt;/em&gt;, there is no reason why you shouldn't do it for nonnormal markets. You will lose the closed form posterior though. Check out Meucci's work on this. (&quot;The Black Litterman approach: Original Model and Extensions&quot; on SSRN or maybe you find something in his book., Also check out &quot;Bayesian Portfolio Analysis&quot; by Avramov and Zhou)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the final question is: &quot;Does it make sense?&quot; &#xA;Well, it depends how you proceed from there. If you want to do an optimization there is the topic: either the market is normal (then, in theory, you have an optimal solution with mean-variance optimization) or you have a quadratic utility function (which says that higher moments dont matter for you as an investor). You have to think about the &lt;em&gt;utility function&lt;/em&gt; you use.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Just to sum this up the things to think about are: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;What are &quot;implied returns&quot; in a nonnormal market? (or do you want to use a different prior)&lt;/li&gt;&#xA;&lt;li&gt;How to calculate the posterior distrubution (Bayes' formula)&lt;/li&gt;&#xA;&lt;li&gt;If optimizing afterwards: What about the utility function? (Full-scale optimization)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2016-01-29T14:55:19.787" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="23009" PostTypeId="2" ParentId="22763" CreationDate="2016-01-29T17:13:43.783" Score="0" Body="&lt;p&gt;As suggested by assylias I have modified my code to run requests in several threads. In case you need to do so, these are some valuable informations :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1- Create a thread-safe request procedure and assign differents &lt;code&gt;requestID&lt;/code&gt; to your requests. Pass these arguments to &lt;code&gt;processResponseEvent&lt;/code&gt; via the &lt;code&gt;eventloop&lt;/code&gt; function. This will allow you to make a check regarding the message you are receiving by using a simple condition:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;            if (msg.CorrelationID != requestID)&#xA;            {&#xA;                System.Console.WriteLine(&quot;WRONG ID &quot;);&#xA;                return;&#xA;            }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;2- Make your request in parallel, meaning you enclosed the aforementioned  request in a loop such as :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;     WaitHandle[] waitHandles = new WaitHandle[numOfThreads];&#xA;        for (int i = 0; i &amp;lt; numOfThreads; i++)&#xA;        {&#xA;            var j = i;&#xA;            var handle = new EventWaitHandle(false, EventResetMode.ManualReset);&#xA;            var thread = new Thread(() =&amp;gt;&#xA;            {&#xA;                 /// CALL HERE YOU REQUEST PROCEDURE FROM STEP 1&#xA;&#xA;                handle.Set();&#xA;            });&#xA;            waitHandles[j] = handle;&#xA;            thread.Start();&#xA;        }&#xA;        foreach (var ee in waitHandles)&#xA;            ee.WaitOne();&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;At the end it won't increase the waiting time for each request but since your are performing a bunch of them together you'll still save a LOT of time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ps: you can use the variable &lt;code&gt;i&lt;/code&gt; (from  &lt;code&gt;for (int i = 0; i &amp;lt; numOfThreads; i++)&lt;/code&gt;) as  &lt;code&gt;requestID&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2016-01-29T17:13:43.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23012" PostTypeId="1" CreationDate="2016-01-30T01:00:40.987" Score="7" ViewCount="559" Body="&lt;p&gt;I'm trying to simulate a process as close as possible to EUR/USD of the ten past years.&lt;/p&gt;&#xA;&lt;p&gt;I've used a Ornstein-Uhlenbeck process:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$d X_t = -\theta (X_t - \mu) d t + \sigma d B_t$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;with the parameters &lt;span class=&quot;math-container&quot;&gt;$\mu$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$X_0$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$\theta$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$\sigma$&lt;/span&gt; being calibrated such that mean, standard deviation, total absolute variation (i.e. &lt;span class=&quot;math-container&quot;&gt;$\sum_i |X_{t_{i+1}} - X_{t_i}|$&lt;/span&gt; for a given sampling rate) are as close as possible to the &lt;em&gt;real historical data&lt;/em&gt;. For example I used &lt;span class=&quot;math-container&quot;&gt;$\mu \approx$&lt;/span&gt; 1.3 $ / 1 €.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;The only thing that fails is that the created process doesn't have big spikes&lt;/strong&gt; whereas the real historical data sometimes shows such jumps.&lt;/p&gt;&#xA;&lt;p&gt;More precisely, here is the histogram of the &lt;strong&gt;range over 2 hours&lt;/strong&gt; (each &lt;span class=&quot;math-container&quot;&gt;$X_t$&lt;/span&gt; represents one minute, so 120 means 2 hours):&#xA;&lt;span class=&quot;math-container&quot;&gt;$$range_t = \max_{k \leq 120} X_{t-k} - \min_{k \leq 120} X_{t-k}$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/f5gC2.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/f5gC2.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h1&gt;Question:&lt;/h1&gt;&#xA;&lt;p&gt;&lt;strong&gt;The simulated O-U process I did is too &amp;quot;nice and gentle&amp;quot;: the range in 2 hours never exceeds 100 pips, whereas in real-life, the range in 2 hours can exceed 100 pips. How to make it more like the real data?&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;How should I improve the model (i.e. the Stochastic Differential Equation) to have more &amp;quot;big ranges&amp;quot;? Add some &amp;quot;jump diffusion&amp;quot; (with which method)? Make &lt;span class=&quot;math-container&quot;&gt;$\sigma$&lt;/span&gt; vary, and how?&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: I tried to add a &amp;quot;jump&amp;quot; term &lt;span class=&quot;math-container&quot;&gt;$d\, q_t$&lt;/span&gt; to the SDE, i.e. very rarely we have a &amp;quot;jump&amp;quot; of height &lt;span class=&quot;math-container&quot;&gt;$h$&lt;/span&gt; pips, with &lt;span class=&quot;math-container&quot;&gt;$h \sim \pm 0.0060 \cdot Log\mathcal{N}(0,1)$&lt;/span&gt;, i.e. a &amp;quot;jump&amp;quot; of average height 60 pips (with random sign + or -).&lt;/p&gt;&#xA;&lt;p&gt;This has an effect of having a heavier tail for the &amp;quot;2hours range&amp;quot; distribution:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/lPYCA.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/lPYCA.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;but even by choosing the right parameters, the &amp;quot;heavier tail&amp;quot; still doesn't look like the real EURUSD &amp;quot;2 hours range&amp;quot; histogram tail...&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;Another option: Should I replace &lt;span class=&quot;math-container&quot;&gt;$d\, B_t$&lt;/span&gt;, which is a &lt;span class=&quot;math-container&quot;&gt;$\mathcal{N}(0, \sigma)$&lt;/span&gt; by another random variable with a higher kurtosis? Which one?&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="18444" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-01-30T19:38:22.860" Title="Modelling EUR/USD with Ornstein-Uhlenbeck + jumps?" Tags="&lt;stochastic-processes&gt;&lt;modeling&gt;&lt;brownian-motion&gt;&lt;sde&gt;&lt;differential-equations&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23013" PostTypeId="2" ParentId="14899" CreationDate="2016-01-30T01:07:33.153" Score="0" Body="&lt;p&gt;The DataTools product from Norgate covers 13 futures exchanges and about 100 markets.  The &quot;Close&quot; price is the daily settlement value for all markets except where indicated (a handful of them shown are &quot;Last&quot; / &quot;Official Close&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.premiumdata.net/products/datatools&quot; rel=&quot;nofollow&quot;&gt;http://www.premiumdata.net/products/datatools&lt;/a&gt;&#xA;&lt;a href=&quot;http://www.premiumdata.net/products/datatools/futures-coverage.php&quot; rel=&quot;nofollow&quot;&gt;http://www.premiumdata.net/products/datatools/futures-coverage.php&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The coverage is not comprehensive; it covers markets that are liquid and in demand by traders.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Data is available in MetaStock and ASCII/CSV formats and is downloadable via a Windows-based app.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Full disclosure: I am a co-owner of Norgate.&lt;/p&gt;&#xA;" OwnerUserId="13859" LastActivityDate="2016-01-30T01:07:33.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23014" PostTypeId="1" CreationDate="2016-01-30T12:02:54.637" Score="1" ViewCount="64" Body="&lt;p&gt;My question is related to &lt;a href=&quot;https://quant.stackexchange.com/questions/21693/what-can-i-use-to-measure-of-diversification&quot;&gt;this question&lt;/a&gt; but it is not the same.&#xA;Consider the US stock market. How can I tell if people trading in this market hold properly diversified portfolios?&#xA;Is there some literature on this? I cannot find anything.&lt;/p&gt;&#xA;" OwnerUserId="13274" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2016-01-30T14:55:29.460" Title="How to measure if investors are diversified in a stock market?" Tags="&lt;diversification&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23015" PostTypeId="2" ParentId="23014" CreationDate="2016-01-30T14:55:29.460" Score="2" Body="&lt;p&gt;I think the first step is to define what you mean by &quot;properly diversified&quot;. A traditional/fundamental standpoint would be that the portfolio is comprised of many different sectors, industries, ect. The more &quot;quant-like&quot; approach and in my opinion, a more realistic approach, is to understand correlation between portfolio assets and the dynamics of said correlation. A key observation would be that correlation between assets tends to increase when the market falls. In a practical sense, one might look towards beta-weighted delta (perhaps to the SP500 or to the predominant index in the market being modeled) as a proxy for correlation. Now that we are comparing apple to apples (all our delta is weighted towards a single index), we know what our exposure is vs. the &quot;market&quot; (our index). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for determining what other people are doing, the answer is not clear and a very quick search seems to yield few results. Here's a little exercise, if you will, that might help:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Assume we have an index like the SPY to beta weight. &lt;/li&gt;&#xA;&lt;li&gt;Assume the beta-weighted delta of a participant's portfolio is a proxy for diversification.&lt;/li&gt;&#xA;&lt;li&gt;Assume that participant's only hold assets within the index.&lt;/li&gt;&#xA;&lt;li&gt;As the market goes up, it is natural that long-delta participants will lose delta (sell for profit) and short-delta participants will gain delta (buy to cover losses). The opposite is true for a down market. Participants who are delta neutral stay neutral. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Depending on the initial distribution of long and short portfolios, the amount of selling for profit/buying to cover losses or vice versa may or may not be evenly distributed. Therefore, the lack of uniformity in the distribution would create more pressure to the long or short side of the market as a whole (again this is a strong supply and demand-like assumption). One could potentially develop a metric of sorts that takes a guess at the initial distribution of portfolio deltas via the buy/selling levels as the market moves (one would need to define &quot;buying/selling levels). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Overall, going through a process like this can't hurt and maybe it would produce something useful if certain constraints can be relaxed. The method I have outlined is naive and I hope someone can point out some terse work on this question. &lt;/p&gt;&#xA;" OwnerUserId="15832" LastActivityDate="2016-01-30T14:55:29.460" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23016" PostTypeId="1" AcceptedAnswerId="23068" CreationDate="2016-01-30T19:23:27.677" Score="3" ViewCount="358" Body="&lt;p&gt;Is there any difference between the spectral and distortion risk measure? Or is it just a different name for the same kind of risk measure? &lt;/p&gt;&#xA;" OwnerUserId="11585" LastActivityDate="2016-11-21T14:08:46.923" Title="Spectral and distortion risk measures" Tags="&lt;risk&gt;&lt;risk-management&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23017" PostTypeId="2" ParentId="23012" CreationDate="2016-01-30T19:38:22.860" Score="1" Body="&lt;p&gt;Try modelling samples every 20,000 ticks, instead of 2 hours (or any such number like that).  Markets are often less fat tailed in terms of the trade- or volume-clock.  See &lt;a href=&quot;http://www.amazon.ca/Introduction-High-Frequency-Finance-Ramazan-Gen%C3%A7ay/dp/0122796713&quot; rel=&quot;nofollow&quot;&gt;http://www.amazon.ca/Introduction-High-Frequency-Finance-Ramazan-Gen%C3%A7ay/dp/0122796713&lt;/a&gt; and &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2034858&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2034858&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3491" LastActivityDate="2016-01-30T19:38:22.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23018" PostTypeId="1" CreationDate="2016-01-30T20:46:33.507" Score="2" ViewCount="62" Body="&lt;p&gt;Is it possible to find out how a OTC Broker-Dealer in thinly-traded equities lends shares for short-sales to other Broker-Dealers. Which platform or process is involved? &lt;/p&gt;&#xA;" OwnerUserId="19235" LastActivityDate="2016-01-30T20:46:33.507" Title="How does a Broker-Dealer lend shares to other Broker-Dealers?" Tags="&lt;market-data&gt;&lt;market-microstructure&gt;&lt;market-making&gt;&lt;short-selling&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23020" PostTypeId="1" CreationDate="2016-01-31T08:26:59.923" Score="2" ViewCount="474" Body="&lt;p&gt;...in other words, why would a person want to have the right to exercise an option early? What advantage does that really give you? Are Euro-style options not good enough for some people? Who are these people and what kinds of risks are they trying to hedge?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Google turns up no results about this; everything is either &quot;Definition of American Option&quot; or &quot;Here's a model for pricing American options.&quot; Nothing about the practical uses of the derivative.&lt;/p&gt;&#xA;" OwnerUserId="19066" LastActivityDate="2016-11-23T04:44:15.190" Title="Who Uses American Options?" Tags="&lt;options&gt;&lt;trading&gt;&lt;hedging&gt;&lt;american-options&gt;" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23022" PostTypeId="1" CreationDate="2016-01-31T14:16:30.863" Score="0" ViewCount="124" Body="&lt;p&gt;Open interest of SPY: &lt;a href=&quot;https://finance.yahoo.com/q/op?s=SPY+Options&quot; rel=&quot;nofollow&quot;&gt;https://finance.yahoo.com/q/op?s=SPY+Options&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If someone sell short a contract the open interest adds up or down?&#xA;The open interest on yahoo finance is a reliable Information of how many contracts are really opened or they misses someone? &lt;/p&gt;&#xA;" OwnerUserId="7827" LastActivityDate="2016-02-01T11:28:57.710" Title="Open interest and short selling" Tags="&lt;options&gt;&lt;open-interest&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23023" PostTypeId="2" ParentId="22548" CreationDate="2016-01-31T14:20:01.480" Score="4" Body="&lt;p&gt;A good starting point&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Macroeconomics by Blanchard&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.amazon.co.uk/Macroeconomics-MyEconLab-Pearson-Access-Package/dp/0133103064/ref=dp_ob_title_bk&quot; rel=&quot;nofollow&quot;&gt;http://www.amazon.co.uk/Macroeconomics-MyEconLab-Pearson-Access-Package/dp/0133103064/ref=dp_ob_title_bk&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7827" LastActivityDate="2016-01-31T14:20:01.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23024" PostTypeId="2" ParentId="21944" CreationDate="2016-01-31T16:37:21.417" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&quot;So how come traders actually use that information in trading if itstems from an 'arbitrary' Blackbox?&quot;. You make a bet on realized vol via delta-neutral option position. if you believe that realized vol will be different from IV of BS (or your another model) than do exactly what you mention in question 2. if IV is too high: sell option, delta-hedge with underlying and collect difference either from IV change or from delta-rehedging (gamma trade).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;CS guy is right and you should think about his statement in broader sense. Say, real distribution of returns is leptokurtic with fat tails. What does it mean? it means that at some of time may occur some event that is extremely rare from point of view of normal distrib. and such extreme events may occur much more frequently than normal distrib suggests. So how can you incorporate this observation in option price? only through one input - IV. you simple increase IV. and if for example your you price your option as realized vol=20% + fat tails events fears=2% total IV=22% it does not matter if fat tail event happens or not, any case you have difference IV=22% vs realized=20% right before the trade and if you sell the option you will earn you 2% of difference if gamma let you. once again - it does not matter why IV is so high (you should not care about what imperfections seller input into IV), the only thing that matters is difference between IV and realized vol&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="18855" LastActivityDate="2016-01-31T16:37:21.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23027" PostTypeId="2" ParentId="23022" CreationDate="2016-01-31T19:08:08.283" Score="2" Body="&lt;p&gt;Options are in zero net supply (like futures and other derivatives), so for evry long there is a short and for every short there is a long. The open interest is the sum of the longs which also equals the sum of the short positions.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2016-01-31T19:08:08.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23028" PostTypeId="1" CreationDate="2016-01-31T21:01:13.257" Score="3" ViewCount="588" Body="&lt;p&gt;Has anyone played with the parameters of the Vasicek model and observed the sometimes ridiculous bond prices it implies?  E.g. with the right parameters, a 30-year zero is priced at $147,327.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be specific, the SDE is&#xA;$$&#xA;dr_t = a(b - r_t)dt + \sigma dW_t.&#xA;$$&#xA;The $T$-bond price is given by&#xA;$$&#xA;P = e^{A - rB}&#xA;$$&#xA;where $r$ is the current short rate,&#xA;$$&#xA;B = \frac{1 - e^{-aT}}{a}, \\&#xA;A = -\left(b - \frac{\sigma^2}{2a^2}\right)\left(T - B\right) - \frac{\sigma^2}{4a} B^2.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try setting $r = 0.02$, $a = 0.3$, $b = 0.02$, $\sigma = 0.3$ and $T = 30$ in the C++ implementation below.  I get a price of \$147,327.  Of course, it should be less than \$1, and I know the Vasicek may imply prices larger than \$1 due to the possibility of negative rates, but this price is a bit ridiculous.  After searching for a while I can't seem to find anything like the &quot;Feller conditions&quot; for the Heston model requiring some relationship among the parameters to avoid outputs like this.  Has anyone had experience with this issue?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#include &amp;lt;iostream&amp;gt;&#xA;#include &amp;lt;cmath&amp;gt;&#xA;&#xA;double BondPrice(double r, double a, double b, double sigma,&#xA;                 double tau)&#xA;{&#xA;  double B = ( 1 - exp(-a*tau)) / a;&#xA;  double A = -( b - pow(sigma,2.0)/(2*pow(a,2.0))) * (tau - B)&#xA;    - pow(sigma,2.0)/(4*a) * pow(B,2.0);&#xA;&#xA;  double price = exp(A - r*B);&#xA;&#xA;  return price;&#xA;}&#xA;&#xA;int main()&#xA;{&#xA;  double r = 0.02;  // initial short rate                              &#xA;  double a = 0.3;  // mean reversion speed                              &#xA;  double b = 0.02;  // long term mean                                  &#xA;  double sigma = 0.3;  // volatility&#xA;  double tau = 30;  // time to maturity&#xA;&#xA;  std::cout &amp;lt;&amp;lt; &quot;price = &quot; &amp;lt;&amp;lt; BondPrice(r,a,b,sigma,tau) &amp;lt;&amp;lt; &quot;\n&quot;;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2016-01-31T21:01:13.257" Title="Ridiculous Bond Prices under Vasicek Model" Tags="&lt;interest-rates&gt;" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="23029" PostTypeId="2" ParentId="23020" CreationDate="2016-01-31T22:43:11.683" Score="1" Body="&lt;p&gt;One example could be someone using option strategies and its underlying dividends. In these cases, the trader could use early excersise to capture the dividend value. Google it for more information. &lt;/p&gt;&#xA;" OwnerUserId="13990" LastActivityDate="2016-01-31T22:43:11.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23030" PostTypeId="2" ParentId="15634" CreationDate="2016-02-01T00:21:13.653" Score="0" Body="&lt;p&gt;Wow, this is the 1 million question. No answer available to that. &#xA;From what I saw is that that question varies from ecn to ecn. You will be very depending on each ecn and how they connect you to liquidity takers. &lt;/p&gt;&#xA;" OwnerUserId="13990" LastActivityDate="2016-02-01T00:21:13.653" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23031" PostTypeId="2" ParentId="1832" CreationDate="2016-02-01T00:24:44.080" Score="0" Body="&lt;p&gt;You can avoid cancel/replace using pegged orders. Depending on your model that could be very useful. &lt;/p&gt;&#xA;" OwnerUserId="13990" LastActivityDate="2016-02-01T00:24:44.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23034" PostTypeId="1" CreationDate="2016-02-01T14:31:20.277" Score="2" ViewCount="885" Body="&lt;p&gt;I have to estimate a VEC GARCH(1,1) model in R. I already tried rmgarch, fGarch, ccgarch, mgarch, tsDyn. Has somebody estimated a model like that?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quantmod)&#xA;library(fBasics)&#xA;library(rmgarch)&#xA;library(fGarch)&#xA;library(parallel)&#xA;library(ccgarch)&#xA;library(mgarch) #from github vst/mgarch&#xA;library(tsDyn)&#xA;library(ggplot2)&#xA;#load data, time series closing prices, 10 year sample&#xA;#DAX 30&#xA;getSymbols('^GDAXI', src='yahoo', return.class='ts',from=&quot;2005-01-01&quot;,    to=&quot;2015-01-31&quot;)&#xA;GDAXI.DE=GDAXI[ , &quot;GDAXI.Close&quot;]&#xA;#S&amp;amp;P 500&#xA;getSymbols('^GSPC', src='yahoo', return.class='ts',from=&quot;2005-01-01&quot;, to=&quot;2015-01-31&quot;)&#xA;GSPC=GSPC[ , &quot;GSPC.Close&quot;]&#xA;#Credit Suisse Commodity Return Strat I&#xA;getSymbols('CRSOX', src='yahoo', return.class='ts',from=&quot;2005-01-01&quot;, to=&quot;2015-01-31&quot;)&#xA;CRSOX=CRSOX[ , &quot;CRSOX.Close&quot;]&#xA;#iShares MSCI Emerging Markets&#xA;getSymbols('EEM', src='yahoo', return.class='ts',from=&quot;2005-01-01&quot;, to=&quot;2015-01-31&quot;)&#xA;EEM=EEM[ , &quot;EEM.Close&quot;]&#xA;#calculating log returns of the time series&#xA;log_r1=diff(log(GDAXI.DE[39:2575]))&#xA;log_r2=diff(log(GSPC))&#xA;log_r3=diff(log(CRSOX))&#xA;log_r4=diff(log(EEM))&#xA;#return matrix&#xA;r_t=data.frame(log_r1, log_r2,log_r3, log_r4)&#xA;#GARCH estimation&#xA;#eGarch(1,1), not multivariate&#xA;&#xA;#Vec Garch(1,1)&#xA;Est1=VECM(r_t,lag=1, estim=&quot;ML&quot; )&#xA;print(Est1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think the VECM operator isn't useful for my purpose since I need a martrix of 4x4 for alpha and one 4x4 for beta plus 4x1 vector for omega. &#xA;Can somebody help with a package or code?&lt;/p&gt;&#xA;" OwnerUserId="18848" LastActivityDate="2017-02-16T21:41:31.810" Title="VEC GARCH (1,1) for 4 time series" Tags="&lt;volatility&gt;&lt;time-series&gt;&lt;r&gt;&lt;garch&gt;&lt;multivariate&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23035" PostTypeId="1" CreationDate="2016-02-01T16:05:57.220" Score="9" ViewCount="1747" Body="&lt;p&gt;Many have told me that it is a good idea to look at the third principal component (PC) of yield curve movements, as well as third and fourth PC of G10 currencies. They claim these PCs represent &quot;pricing noise&quot;, and thus should mean-revert. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you have experience with these strategies? Are there relevant papers I should read? &lt;/p&gt;&#xA;" OwnerUserId="5667" LastActivityDate="2016-02-01T22:52:12.840" Title="Is trading mean reversion of small principal components of prices profitable?" Tags="&lt;quant-trading-strategies&gt;&lt;yield-curve&gt;&lt;currency&gt;&lt;mean-reversion&gt;&lt;term-structure&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="23036" PostTypeId="1" AcceptedAnswerId="23038" CreationDate="2016-02-01T16:10:49.357" Score="3" ViewCount="1004" Body="&lt;p&gt;I need some help in understanding the Black-Scholes option pricing model. &#xA;In my data there are several deep itm European index put options that have an ask price below the  intrinsic value. Calculating the implied volatility using a built-in function in matlab leaves me with NaN as a result. &#xA;I suspect there is an economic explanation for this, but since I do not fully understand the way option valuation works, I wonder if anyone could help me out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To give you an example: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose the Nasdaq 100 quotes 563.48, the strike price of the European put option is 670, an annualized interest rate of 5%, days to maturity is 44 and an option ask price of 101.375. Why would a calculation with the Black-Scholes model not result in a value for the implied volatility?&#xA;Is my guess correct that it has to do with the option price being lower than the intrinsic value? &#xA;If yes, why couldn't the intrinsic value of a European option be higher than the option price when there is still quite some time left until maturity?&lt;/p&gt;&#xA;" OwnerUserId="19250" LastActivityDate="2016-02-01T16:49:28.657" Title="Determining the implied volatility for options with bid/ask prices below the intrinsic value" Tags="&lt;black-scholes&gt;&lt;implied-volatility&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23037" PostTypeId="1" CreationDate="2016-02-01T16:30:24.927" Score="0" ViewCount="1260" Body="&lt;p&gt;I have daily returns of 10 stocks. I need to construct an equally weighted portfolio that goes long in the 3 highest returns and short in the 3 lowest returns. The portfolio needs to be re-balanced every month.&#xA;How to tell Matlab about this constraint?&#xA;I started like following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) data=load('mydata'); #loading my data that contains 10 stock market returns&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) port=Portfolio(); # create the portfolio&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) port=port.estimateAssetMoments(R);# calculate the average return for each index&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) I ignore the command that tell Matlab to be short in the 3 lowest returns and long in the 3 long returns. I just find the default command : port=port.setDefaultConstraints();&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't use it because it doesn't allow short positions... Could you please help me?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="17810" LastEditorUserId="17810" LastEditDate="2016-02-02T08:24:46.823" LastActivityDate="2016-02-02T11:16:08.177" Title="Matlab code for equally weighted portfolio" Tags="&lt;portfolio&gt;&lt;matlab&gt;&lt;codes&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23038" PostTypeId="2" ParentId="23036" CreationDate="2016-02-01T16:42:28.683" Score="3" Body="&lt;p&gt;Note that&#xA;\begin{align*}&#xA;(K-S_T)^+ \ge K-S_T.&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;p &amp;amp;\equiv  E\Big(e^{-rT} (K-S_T)^+ \Big)\\&#xA;&amp;amp;\ge E\Big(e^{-rT} (K-S_T) \Big)\\&#xA;&amp;amp;=K\, e^{-rT} - S_0\\&#xA;&amp;amp;= 670 \times e^{-0.05 \times 55/365} - 563.48\\&#xA;&amp;amp;=102.49.&#xA;\end{align*}&#xA;However, the option price is 101.375, which is smaller. This is the reason that you have difficulty to obtain an implied volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that $K\, e^{-rT} \approx K$ for a short maturity $T$. You basically need to have option value greater the intrinsic value.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-02-01T16:49:28.657" LastActivityDate="2016-02-01T16:49:28.657" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23041" PostTypeId="1" CreationDate="2016-02-01T20:50:38.707" Score="0" ViewCount="168" Body="&lt;p&gt;In the Black-Scholes world, the risk-neutral probability of expiring in-the-money is given by N(d2). Can I just replace the risk-free rate by the drift rate to obtain real world probabilities? Thank you for your help.&lt;/p&gt;&#xA;" OwnerUserId="19254" LastActivityDate="2016-02-01T21:00:15.980" Title="For a call option, what is the real-world probability of expiring in-the-money?" Tags="&lt;black-scholes&gt;&lt;martingale&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23043" PostTypeId="2" ParentId="23041" CreationDate="2016-02-01T21:00:15.980" Score="1" Body="&lt;p&gt;Yes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you know what the drift is. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-02-01T21:00:15.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23044" PostTypeId="1" AcceptedAnswerId="23071" CreationDate="2016-02-01T21:22:11.867" Score="2" ViewCount="220" Body="&lt;p&gt;Can you give some example of options that cannot be priced with least-square Monte Carlo?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuitively, this is any option for which a payoff depends on a previous exercise decision.&lt;br&gt;&#xA;It's relatively easy to cook-up some example by hand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a name for such class of option?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you give the name of such options that are sold in financial market?&lt;/p&gt;&#xA;" OwnerDisplayName="user2688" LastActivityDate="2016-02-03T02:16:51.660" Title="Example of options that cannot be priced with least-square Monte Carlo" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;monte-carlo&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23045" PostTypeId="2" ParentId="23035" CreationDate="2016-02-01T22:45:02.600" Score="8" Body="&lt;p&gt;Within the fixed income space, there's a lot of literature on PCA trading. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first 2-3 principal component factors (PCs) can typically explain 90-99% of the total variances in yield curve movement. It's also nice, because the first PC looks like a change in the overall &lt;strong&gt;level&lt;/strong&gt; of the yield curve, the second PC looks like a &lt;strong&gt;slope&lt;/strong&gt; change, while the third factor corresponds to change in the overall &lt;strong&gt;curvature&lt;/strong&gt; of the yield curve. So if you neutralize the first 2-3 PCs, you can indeed trade on the mean-reverting behavior of the residuals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PCA is most commonly used for structuring so-called &quot;butterfly trades.&quot; In this, you're neutralizing the first two PCs (level and slope) and trade on the third PC (curvature). For example, after running a PCA on 2y, 5y, and 10y yields, you may conclude that 5y yields are too high relative to 2- and 10-year yields (i.e., 5-year bonds are &quot;cheap&quot;). In this case, you'd buy 5-year bonds, while simultaneously shorting 2- and 10-year bonds. PCA comes into play, because for each unit of 5-year bonds, you have to choose appropriate units of 2- and 10-year bonds (&quot;risk weights&quot;) so that the the first two principal components are neutralized, allowing you to trade any abnormalities in the third principle component.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best literature I've come across is Salmon's &lt;em&gt;Principles of Principal&#xA;Components&lt;/em&gt;, which is easily available by Googling. It also includes extensive backtesting results from butterfly trading. Another (not as good but still pretty good) one is Morgan Stanley's &quot;PCA for Interest Rates.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would point out that trading on PCA mechanically is usually &lt;strong&gt;not&lt;/strong&gt; a great idea. A lot of macro-factors can disrupt &quot;well established&quot; patterns in truly splendid ways. After the financial crisis, 5- and 7-year bonds looked rich based on many statistical methods, PCA included, but they just kept getting richer...&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2016-02-01T22:52:12.840" LastActivityDate="2016-02-01T22:52:12.840" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="23046" PostTypeId="2" ParentId="17245" CreationDate="2016-02-01T22:51:58.753" Score="2" Body="&lt;p&gt;Possibly she is referring to the fact that classical PCA is not robust in the sense that its asymptotic properties depend on the distribution of the data. Large deviations from normality will result in sub-optimal estimates, or estimates that are &lt;em&gt;distorted&lt;/em&gt;.  If this is what she has in mind, then you can use robust PCA instead (cf. &lt;a href=&quot;http://statweb.stanford.edu/~candes/papers/RobustPCA.pdf&quot; rel=&quot;nofollow&quot;&gt;Candes et. al.&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="19258" LastActivityDate="2016-02-01T22:51:58.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23047" PostTypeId="1" CreationDate="2016-02-01T22:58:22.097" Score="0" ViewCount="161" Body="&lt;p&gt;I will use this theorem 3.2 from the book &quot;Quantitative modeling of Derivative Securities&quot; by Marco Avellandea:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Theorem 3.2 - Assume that there is no arbitrage, i.e. there exists a risk neutral probability $\pi$. Then, the market is complete if and only if there is a unique risk-neutral probability, i.e. the system of linear equation $$p = D\pi$$ has a unique solution where $D$ is are the different future scenarios in the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Show that in any model if there are two distinct risk-neutral probabilities, then there are infinite number of them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Attempted solution: Consider a one-period binomial model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;State 1: $S_0 u$ with risk-neutral probability $\pi_u$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;State 2: $S_0 l$ with risk-neutral probability $\pi_l$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume $\pi_u,\pi_l$ are two distinct risk-neutral probabilities, i.e., $\pi_u + \pi_l \neq 1$. Then, this violates theorem 3.2, the market is not complete since there cannot exist a unique risk-neutral probability, i.e. the system of linear equations $$p = D\pi$$ does not have a unique solution. Thus if there is not a unique solution then there are an infinite number under our example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure if this suffices, any suggestions is greatly appreciated. &lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="19002" LastEditDate="2016-02-02T01:05:24.197" LastActivityDate="2016-02-02T01:05:24.197" Title="Risk-neutral probabilities" Tags="&lt;finance&gt;&lt;risk-models&gt;&lt;quantitative&gt;" AnswerCount="0" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="23049" PostTypeId="1" CreationDate="2016-02-01T23:54:50.610" Score="1" ViewCount="142" Body="&lt;p&gt;first I just hope that this question is in the right place. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have started working on portfolio optimization and the formulation of the problem and their solution : For example in the Markowitz problem lowest variance of the portfolio for a certain level of return can be express as for n risky assets&lt;/p&gt;&#xA;&#xA;&lt;p&gt;min $\ \frac{1}{2} \theta^TQ\theta$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;s.t. $\ \mu^{T}\theta = \mu^{*}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;br&gt;&#xA;     $\ \mathbb{1}^{T}\theta = 1$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\ \theta \in \mathbb{R}^{n} $ is the the weight of the risky asset in our portfolio $\ \mu \in \mathbb{R}^{n}$ is the expected return of the risky asset and &#xA;$\ \mu^{*} \in \mathbb{R}^{+} $ is the objective function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now and it is my problem, I would like to formulate in terms of optimization problem the following problem/ let's say I have initial wealth X, I still want to determine the portfolio with the lowest variance for a certain expected return $\ \mu^{*} $, I allow short selling but I also want that the money raised by short selling stay under a certain level that depends on X for example that the level of money raised by short selling be inferior than X/5.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for any hints or suggestions, I hope I did not forget some hypothesis and I made myself clear.&lt;/p&gt;&#xA;" OwnerUserId="18616" LastEditorUserId="2587" LastEditDate="2016-02-02T12:38:54.530" LastActivityDate="2016-02-02T12:42:21.567" Title="Portfolio optimization" Tags="&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23050" PostTypeId="2" ParentId="17910" CreationDate="2016-02-02T03:08:56.177" Score="1" Body="&lt;p&gt;I can share how a pricing application (eg: QuantLib) calculates the VaR with Monte-Carlo.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Generate a vector of independent Gaussian random numbers. A typical (and simple) implementation is Box-Muller. I prefer the inverse transform method, and I think this is also the default for QuantLib.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Now, we will need to generate correlated returns. We will need a correlation matrix. Decompose the matrix by Cholesky or Singular Value Decomposition. SVD is a stable version but slower. Personally, I have used both of them and found both satisfactory.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use the corrected returns to apply for a simulation scheme. I mean, substitue the random correlated numbers into the diffusion terms. Usually, we use the Eurler scheme, but you can also use the Milstein scheme. The Eurler scheme approximates up to the second-orders.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use the scheme to generate a list of independent simulation paths. Price each path upon maturity.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Now you should have a list of payoffs, one for each path. Discount them back and calculate the quartile. This will be your VaR.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;When you report your VaR, you will always need to include your significance level and time horizon. The estimate by itself is meaningless.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2016-02-02T03:08:56.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23051" PostTypeId="1" CreationDate="2016-02-02T04:37:41.140" Score="1" ViewCount="2033" Body="&lt;p&gt;I try to use Monte-Carlo Simulation to price a 10-year call option. Based on below parameter,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;S = 1, X = 1, volatility = 80%, T = 10, risk-free rate = 0.22%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The option value based on Monte-Carlo Simluation (Longstaff and Schwartz regression) is &lt;strong&gt;0.4634&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But using Binomial model, the value is 0.7943, while using Black-Scholes model, the value is 0.7965. Is there any reason of large discrepancy using Monte-Carlo Simulation model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I consider to value short-maturity option by consider similar parameter&lt;/p&gt;&#xA;&#xA;&lt;p&gt;S = 1, X = 1, volatility = 80%, T = 1, risk-free rate = 0.22%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Option value based on Monte-Carlo Simluation is 0.2938. Based on binomial model, the value is 0.3112 while the value based on Black-Scholes model is 0.3116.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the reason of large discrepancy when using Monte-Carlo Simulation to value long-maturity option? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="6119" LastEditorUserId="2587" LastEditDate="2016-02-02T11:17:56.860" LastActivityDate="2016-02-03T12:11:37.500" Title="Discrepancy between binomial model, Black-Scholes and Monte-Carlo Simulation" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;monte-carlo&gt;&lt;binomial&gt;" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="23054" PostTypeId="2" ParentId="23051" CreationDate="2016-02-02T08:34:16.337" Score="1" Body="&lt;p&gt;Increase the number of paths in your simulation for the getting the terminal prices, and at some point your monte carlo option price will finally converge to Black scholes option price as you are using a very longer maturity call option i.e. 10 year call option.&lt;/p&gt;&#xA;" OwnerUserId="18663" LastActivityDate="2016-02-02T08:34:16.337" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23056" PostTypeId="2" ParentId="23037" CreationDate="2016-02-02T11:16:08.177" Score="1" Body="&lt;p&gt;Your question is not clear enough. &#xA;Go long on 3 highest returns... since when? During the past month?&#xA;If so, at the end of each month you need to compute the average return on each index, and then find the minimum and maximum returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As simple dummy example, I will generate a matrix of 10 stocks and 30 daily returns. Then I will average those and find the 3 lowest and 3 largest.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;rng(0,'twister');&#xA;a = -1;&#xA;b = 1;&#xA;r = (b-a).*rand(1000,10,30) + a; %Generate a 10x30 matrix of returns&#xA;average = mean(r,2);&#xA;[~,index] = sort(average);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then you should be short 1/3 on the stocks which index is (1,2,3) and long 1/3 on the stocks in which index is (8,9,10).&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2016-02-02T11:16:08.177" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23057" PostTypeId="2" ParentId="23051" CreationDate="2016-02-02T11:31:55.027" Score="3" Body="&lt;p&gt;As your code works for the short maturity case, I assume that it is correct. The volatility of $80 \%$ is simply huge. Thus the area covered by the paths is huge too. &#xA;As you can read e.g. &lt;a href=&quot;https://en.wikipedia.org/wiki/Monte_Carlo_integration&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; the sampling error is proportional to the variance of the process, which is huge in your case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a brute force solution you can just enlarge the number of samples. If your option is path dependent then you could reduce the step size. In any case MC will take long.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The OP just added the fact that the call is American. As there are no dividends mentioned we can assume that the stock does not pay any.&#xA;Therefore (see &lt;a href=&quot;https://quant.stackexchange.com/questions/4924/early-execise-of-american-call-on-non-dividend-paying-stock&quot;&gt;here&lt;/a&gt;) the American option will never be exercies eary. Thus is has the same value as the European option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Finally you don't need MC at all.&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you still want to apply MC then you should take care for your time-stepsize.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Thinking again about it: your American call is in fact European. You apply LS-algo to it and get a price that much off - is your code ok? Any MC pricer should have an if-statment where it says that if dividends=0 then price it analytically. However, you can use the code to check the implementation of LS in order to price the American options where it is needed correctly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What about increasing the time-to-maturity 1,2,4,6,8 to 10 years. How do the prices behave?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should see:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;1 years:  0.3116&lt;/li&gt;&#xA;&lt;li&gt;2 years:  0.42965 &lt;/li&gt;&#xA;&lt;li&gt;4 years: 0.57815 &lt;/li&gt;&#xA;&lt;li&gt;6 years: 0.67497&lt;/li&gt;&#xA;&lt;li&gt;8 years:  0.74436&lt;/li&gt;&#xA;&lt;li&gt;10 years: 0.79635 &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-02-03T12:11:37.500" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="23058" PostTypeId="1" AcceptedAnswerId="23060" CreationDate="2016-02-02T09:24:27.790" Score="1" ViewCount="101" Body="&lt;p&gt;Is there an easy-ish way I can generate &quot;dummy&quot; share price data for the purposes of data visualisation techniques etc.? Essentially I want to have something like the &quot;Adventure Works&quot; of price data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't want to use actual price data of a real company due to issues over ownership/distribution of the data. But something that looks similar to a &quot;typical&quot; history of share prices (over 1 year, say) in terms of its data points is what I'm after.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I considered random deviations from a &quot;start&quot; price, is there a better way?&lt;/p&gt;&#xA;" OwnerUserId="19266" OwnerDisplayName="seventyeightist" LastEditorUserId="16595" LastEditDate="2018-07-28T19:20:37.837" LastActivityDate="2018-07-28T19:20:37.837" Title="Looking for an algorithm to generate &quot;dummy&quot; share price data" Tags="&lt;equities&gt;&lt;dummy&gt;" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="23059" PostTypeId="2" ParentId="23058" CreationDate="2016-02-02T12:05:24.363" Score="2" Body="&lt;p&gt;I don't know enough about share prices to answer your question, but the &lt;a href=&quot;http://archive.ics.uci.edu/ml/index.html&quot; rel=&quot;nofollow&quot;&gt;UCI Machine Learning Repository&lt;/a&gt; is an good resource for real data that you'll likely be able to use for any purpose, as long as you cite them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From their website:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The UCI Machine Learning Repository is a collection of databases, domain theories, and data generators that are used by the machine learning community for the empirical analysis of machine learning algorithms. The archive was created as an ftp archive in 1987 by David Aha and fellow graduate students at UC Irvine. Since that time, it has been widely used by students, educators, and researchers all over the world as a primary source of machine learning data sets. As an indication of the impact of the archive, it has been cited over 1000 times, making it one of the top 100 most cited &quot;papers&quot; in all of computer science.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://archive.ics.uci.edu/ml/citation_policy.html&quot; rel=&quot;nofollow&quot;&gt;citation policy&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If you publish material based on databases obtained from this repository, then, in your acknowledgements, please note the assistance you received by using this repository. This will help others to obtain the same data sets and replicate your experiments.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A few data sets have additional citation requests. These requests can be found on the bottom of each data set's web page.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you filter by &quot;business&quot; there are few datasets which look like they might contain the right type of information. It might be worth the cost of citing them in order to use them (only necessary if making your public, I believe) because they are free to use for any purpose otherwise, as far as I can see.&lt;/p&gt;&#xA;" OwnerDisplayName="Ogaday" LastActivityDate="2016-02-02T12:05:24.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23060" PostTypeId="2" ParentId="23058" CreationDate="2016-02-02T12:37:07.683" Score="2" Body="&lt;p&gt;So you want to simulate a price path, right? Googeling this you will find code in the programming language of your choice. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The usual starting point for share price simulation is the Geometric Brownian motion (GBM) model. It assumes log-normal prices. It turns out that models with jumps often relfect reality closer. Such models are called Lévy models and the GBM is a special case. That's where you should start.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking for similar questions here, you find a lot too. E.g. &lt;a href=&quot;https://quant.stackexchange.com/questions/7125/simulation-of-gbm&quot;&gt;This one&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-02-02T12:37:07.683" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23061" PostTypeId="2" ParentId="23049" CreationDate="2016-02-02T12:42:21.567" Score="3" Body="&lt;p&gt;The problem as you formulate it above already allows for short-selling.&#xA;You just have to add the constraint:&#xA;$$&#xA;\theta_i \ge l&#xA;$$&#xA;where $l$ is the lower bound. This is equivalent to&#xA;$$&#xA;-\theta_i \le -l&#xA;$$&#xA;which if often the way linear constraints are formulated. &#xA;Any solver that is able to work with box-constaints can solve this.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-02-02T12:42:21.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23062" PostTypeId="2" ParentId="19127" CreationDate="2016-02-02T14:36:10.897" Score="2" Body="&lt;p&gt;The easiest way to think of this is as follows:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Settlement Price - Price at which the exchange margins all accounts for those options. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Closing Price - Mid/Bid/Ask of Active Market at the exchanges last trade time. E.g. for TY Contracts this is at 5pm EST vs. a Settle Time of 3pm EST.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Last Trade Price - Not all options trade every day. This is the price the last actual execution was at. E.g. SPY 250 Mar 18 2016 Calls Traded at 0.3 on 1/27/16, it is now 2/2/16 there has been no trades since 1/27 thus 0.3 will remain the last traded price, even if the market is 0.1/0.2&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="19268" LastActivityDate="2016-02-02T14:36:10.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23063" PostTypeId="2" ParentId="22781" CreationDate="2016-02-02T16:03:47.140" Score="4" Body="&lt;p&gt;One way to this is the following (you can code all these constraints if you use the right software, I am doing such things using mathematica)&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You define $w_{i,j}$ which is the weight of asset $j$ in subportfolio $i$, furthermore you define $w =(w_j)_{j=1}^{\text{no of assets}}$ the total weight of the portfolio in asset $j$.&lt;/li&gt;&#xA;&lt;li&gt;the objects for the optimization then are the total portfolio variance&#xA;$w^T \Sigma w $ and the total expected return $w^T \mu$.&lt;/li&gt;&#xA;&lt;li&gt;you define a bunch of constraints. The ones that you need and the universe constraints&#xA;$$&#xA;w_{i,j} = 0&#xA; $$&#xA;if asset $j$ is not allowed in subportfolio $i$, the total weight constraint for each asset $j$:&#xA;$$&#xA;\sum_{i=1}^{\text{no of portfolios}} w_{i,j} - w_j = 0&#xA;$$&#xA;which is just a linear constraint. &#xA;The budget for each subportfolio $i$&#xA;$$&#xA;\sum_{j=1}^{\text{no of assets}} w_{i,j} = \text{total fraction of subportfolio}.&#xA;$$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thus you have a lot of varables: number assets times number subportfolio + number assets. Only the total weights in the assets enter the objective function. Everything else is done in clever constraints.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2016-02-11T07:59:07.427" LastActivityDate="2016-02-11T07:59:07.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23066" PostTypeId="1" AcceptedAnswerId="23070" CreationDate="2016-02-02T19:12:15.837" Score="3" ViewCount="584" Body="&lt;p&gt;A little confused, I consulted the Wilmott forums for guidance on how I can interpret vega/vomma. Another user's post reminded me that the Black-Scholes model assumes that the underlying has constant volatility, so vega is an out-of-model concept. If Black-Scholes assumes that volatility does not change, then would this not render vega/vomma calculations useless since they are based from the Black-Scholes formula? The vega calculation seems odd because one gauges how the option value changes with volatility, but then Black-Scholes assumes volatility does not change. Going a step further, the idea of vomma in a Black-Scholes world seems odd because if volatility does not change, then surely vega would not change?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that Black-Scholes makes some questionable assumptions, but if we price options in a Black-Scholes world, then it seems peculiar that these metrics have come about as a result of the Black-Scholes formula. I would really appreciate any insight. &lt;/p&gt;&#xA;" OwnerUserId="19270" LastActivityDate="2021-04-29T03:09:22.843" Title="Vega in a &quot;constant volatility&quot; Black-Scholes world?" Tags="&lt;black-scholes&gt;&lt;greeks&gt;&lt;vega&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23068" PostTypeId="2" ParentId="23016" CreationDate="2016-02-02T19:35:28.870" Score="2" Body="&lt;p&gt;Compare these two links:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Distortion_risk_measure&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Distortion_risk_measure&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Spectral_risk_measure&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Spectral_risk_measure&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Then these risk measures are only different by their assumptions on the distortion function:&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$\tilde{g}$&lt;/span&gt; is the dual distortion function &lt;span class=&quot;math-container&quot;&gt;$\tilde{g}(u) = 1 - g(1-u)$&lt;/span&gt; with  &lt;span class=&quot;math-container&quot;&gt;$g: [0,1] \to [0,1]$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$\phi$&lt;/span&gt; is non-negative, non-increasing, right-continuous, integrable function defined on &lt;span class=&quot;math-container&quot;&gt;$[0,1]$&lt;/span&gt; such that &lt;span class=&quot;math-container&quot;&gt;$\int_0^1 \phi(p)dp = 1$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$\phi\in\mathbb{R}^S $&lt;/span&gt; satisfies the conditions&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Nonnegativity: &lt;span class=&quot;math-container&quot;&gt;$ \phi_s\geq$&lt;/span&gt;  for all &lt;span class=&quot;math-container&quot;&gt;$s=1, \dots, S$&lt;/span&gt;,&lt;/li&gt;&#xA;&lt;li&gt;Normalization: &lt;span class=&quot;math-container&quot;&gt;$\sum_{s=1}^S\phi_s=1$&lt;/span&gt;,&lt;/li&gt;&#xA;&lt;li&gt;Monotonicity : &lt;span class=&quot;math-container&quot;&gt;$\phi_s$&lt;/span&gt; is non-increasing, that is &lt;span class=&quot;math-container&quot;&gt;$\phi_{s_1}\geq\phi_{s_2}$&lt;/span&gt; if &lt;span class=&quot;math-container&quot;&gt;${s_1}&amp;lt;{s_2}$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;${s_1}, {s_2}\in\{1,\dots,S\}$&lt;/span&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;Then distortion risk measures are Law-Invariant and Monotone, but not coherent.&lt;/p&gt;&#xA;&lt;p&gt;Spectral risk measures are fully coherent (Positive Homogeneity, Translation-Invariance, Monotonicity, Sub-additivity, Law-Invariance).&lt;/p&gt;&#xA;&lt;p&gt;I think that would be the main difference.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-02-02T23:13:31.897" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="23069" PostTypeId="1" AcceptedAnswerId="23081" CreationDate="2016-02-03T00:34:26.393" Score="2" ViewCount="153" Body="&lt;p&gt;Let $\tilde{W}_t := (1+R)^{-t}W_t$ and $\tilde{S}_t := (1+R)^{-t}S_t$ be respectively discounted wealth process and discounted asset price. Then, show that $$\tilde{W}_t = w_0 + \sum_{i=1}^{t}\Delta_i(\tilde{S}_{i+1} - \tilde{S}_i)$$ For simplicity, we fix the notation $(\delta\cdot S)_t$ for $\sum_{i=1}^{t}(S_{i+1} - S_i)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Background information: Consider a discrete-time market with time horizon $T$ in which trading occurs at only at time $t = 0,\ldots,T$. We consider a risky asset for which the price at time $t$ is given by a random variable $S_t$ and a risk-free asset (bond) with interest rate $R$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A self-financing portfolio strategy consists of an initial wealth $w_0$ and a vector $\Delta = (\Delta_0,\ldots,\Delta_{T-1})$ such that $\Delta_t$ shows the units of risky asset held in the portfolio at time $t$. At time $t = 0$, the initial wealth $W_0 := w_0$ is split in $\Delta_0 S_0$ dollars in risky asset and $W_0 -\Delta_0 S_0$ is risk-free asset. Then, at time $t = 1$, the dollar value of risky investment will change to $\Delta_0 S_1$  when the market price of risky asset changes to $S_1$, and the dollar value of risk-free investment will be affected by the interest rate and changes to $(1 + R)(W_0 - \Delta_0 S_0)$ . At this, point we want to follow the portfolio strategy and adjust the risky portion of the portfolio to $\Delta_1 S_1$ . To do so, we change the position of the portfolio by transferring dollar between risky and risk-free portions, i.e. to make the risky portion of portfolio $\Delta_1 S_1$, we have to withdraw/deposit $\Delta_0 S_1 - \Delta_1 S_1$ dollars from/into the risk-fee portion to buy/sell the required amount of risky assets. To generalize this process, let $Y_t$ be the risk-free portion of the portfolio at time $t$. The risky portion is always rebalanced to be $\Delta_t$ number of risky assets, equivalently dollar value of $\Delta_t S_t$, at time $t$; i.e. $W_t = \Delta_t S_t + Y_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is easy to see that $$Y_{t+1} = (1+R)Y_t + \Delta_t S_{t+1} - \Delta_{t+1}S_{t+1}$$ where the term $\Delta_t S_{t+1} - \Delta_{t+1}S_{t+1}$ is the amount required to rebalance the portfolio for the strategt $\Delta$. Then, the total wealth $W_t$ satifies&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$W_t = w_0 + R\sum_{i=0}^{t-1}Y_i + \sum_{i=0}^{t-1}\Delta_i(S_{i+1} - S_i)$$&#xA;If desired, I can provide a paragraph that led to this recursive formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Attempted solution: $$\tilde{W}_t = \frac{1}{(1+R)^t}\left[w_0 + R\sum_{i=0}^{t-1}Y_i + \sum_{i=0}^{t-1}\Delta_i(S_{i+1} - S_i)\right]$$ $$=\frac{w_0}{(1+R)^t} + \frac{R\sum_{i=0}^{t-1}Y_i}{(1+R)^t} + \frac{\sum_{i=0}^{t-1}\Delta_i(S_{i+1} - S_i)}{(1+R)^t}$$ We know that $\tilde{S}_t := (1+R)^{-t}S_t$ so then $S_t = \tilde{S}_t(1+R)^t$. Changing the last sum from $i = 0$ to $i = 1$ and substituting in for $S_t$ we get $$\frac{w_0}{(1+R)^t} + \frac{R\sum_{i=0}^{t-1}Y_i}{(1+R)^t} + \sum_{i=1}^{t}\Delta_i(\tilde{S}_{i+1} - \tilde{S}_i)$$ I feel like I may be doing something wrong here and/or I am not sure where to proceed from here any suggestions is greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="19002" LastEditDate="2016-02-03T19:03:48.460" LastActivityDate="2016-02-03T21:22:50.940" Title="Modeling Financial Assets" Tags="&lt;finance&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23070" PostTypeId="2" ParentId="23066" CreationDate="2016-02-03T01:42:11.257" Score="0" Body="&lt;p&gt;On the topic of your second paragraph, the author below is the authority on precisely that topic.  Start at page 19 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www8.gsb.columbia.edu/leadership/sites/leadership/files/Is%20economics.pdf&quot; rel=&quot;nofollow&quot;&gt;https://www8.gsb.columbia.edu/leadership/sites/leadership/files/Is%20economics.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12203" LastActivityDate="2016-02-03T01:42:11.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23071" PostTypeId="2" ParentId="23044" CreationDate="2016-02-03T02:16:51.660" Score="1" Body="&lt;p&gt;you just add in any auxiliary variables accumulated along the path that determine the pay-off to the regression variables. So path-dependence is not a problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have previous decisions, you may need to do different regressions based on their possible values or make them into a continuous variables that can be used for regression.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2016-02-03T02:16:51.660" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23072" PostTypeId="1" AcceptedAnswerId="25276" CreationDate="2016-02-03T12:22:25.863" Score="4" ViewCount="3663" Body="&lt;p&gt;I hope someone can clarify my ideas about the constant implied volatility in the classical Black Scholes framework.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As well known, market practitioners quote the prices of vanilla call and put options in terms of implied volatilities. For inputs $K$, $S$, $r$, $T$ and the price of the option $V$, one can determine the implied volatility $σ$ such that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V=BS(K,S,r,T,σ)$ (1)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When the market quoted implied volatilities are plotted against different strike prices for a fixed maturity $T$, the graph would tipically exhibit a 'smile' shape and hence the name volatility smile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Theory says that this implies a deficiency in the Black Scholes model since it assumes a constant volatility parameter, not depending on $K$ nor $T$. Hence the volatility smile would be flat.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here my ideas get confused. Assuming that $S$, $r$ and $T$ remain constant, for a fixed market price $V$ of a vanilla option the implied volatility will vary depending on the value of strike $K$ under the Black Scholes model (1). Hence, if the implied volatility is plotted against different strikes for a fixed $V$ it will indeed show a smile behaviour, which is in contrast to what theory states.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, do the market quoted implied volatilities that form the volatility smile according to the theory correspond to a fixed vanilla option price $V$ and with varying $K$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think I am making a mistake in my reasoning but I do not understand where. I would be glad if someone can point me in the right thinking direction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="19279" LastActivityDate="2016-05-01T16:46:10.353" Title="Black Scholes Constant Implied Volatility" Tags="&lt;finance-mathematics&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="23074" PostTypeId="2" ParentId="23072" CreationDate="2016-02-03T13:59:30.013" Score="0" Body="&lt;p&gt;&lt;em&gt;Hence, if the implied volatility is plotted against different strikes for a fixed $V$ it will indeed show a smile behaviour, which is in contrast to what theory states.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Black-Scholes theory says that price $V$ of a vanilla varies with strike according to the Black-Scholes formula.  Where you go wrong is assuming $V$ constant as a function of strike.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2016-02-03T13:59:30.013" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="23075" PostTypeId="1" AcceptedAnswerId="23096" CreationDate="2016-02-03T15:42:30.463" Score="1" ViewCount="411" Body="&lt;p&gt;As per the &lt;a href=&quot;http://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX%3A32015R2450&quot; rel=&quot;nofollow&quot;&gt;COMMISSION IMPLEMENTING REGULATION (EU) 2015/2450&lt;/a&gt; (published 31DEC2015) I can see that S.06.02.01 QRT relates to &lt;em&gt;Quarterly&lt;/em&gt; (or annual if exempt) quantitative templates for &lt;em&gt;individual&lt;/em&gt; undertakings, and that S.06.02.04 relates to &lt;em&gt;Quarterly&lt;/em&gt; (or annual if exempt) quantitative templates for &lt;em&gt;groups&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is.. What do the S.06.02.02 and S.06.02.03 QRTs relate to?&lt;/p&gt;&#xA;" OwnerUserId="5883" LastActivityDate="2016-02-04T15:04:46.243" Title="Differences in EIOPA S.06.02.0x QRTs (Assets D1 in 2016)" Tags="&lt;solvency-ii&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23076" PostTypeId="1" AcceptedAnswerId="23086" CreationDate="2016-02-03T16:09:02.097" Score="0" ViewCount="2515" Body="&lt;p&gt;What is the difference between asset-backed securities(ABS), covered bonds and collateralized debt obligations (CDO)? &lt;/p&gt;&#xA;" OwnerUserId="11585" LastActivityDate="2016-02-04T05:44:28.687" Title="ABS vs covered bonds vs CDO" Tags="&lt;bond&gt;&lt;investment&gt;&lt;asset&gt;&lt;debt&gt;&lt;cdo&gt;" AnswerCount="1" CommentCount="2" ClosedDate="2016-02-04T09:05:13.470" ContentLicense="CC BY-SA 3.0" />
  <row Id="23077" PostTypeId="2" ParentId="23075" CreationDate="2016-02-03T17:33:58.093" Score="1" Body="&lt;p&gt;I looked at the ITS, and can't find any reference to those templates. I suppose they got lost in some reshuffling.&lt;/p&gt;&#xA;" OwnerUserId="357" LastActivityDate="2016-02-03T17:33:58.093" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23078" PostTypeId="2" ParentId="23006" CreationDate="2016-02-03T17:55:05.183" Score="0" Body="&lt;p&gt;Yes there is a method to deal with non-normal market distributions in Black Litterman optimization. It is call Black Litterman Copula Opinion Pooling which uses copulas to model the market returns and therefore solve the non-normality problem. It was propose by Attilio Meucci and it can be implemented in R or Matlab. Never the less there is an other problem with the model and it is that it assumes that the priors are independent between them which in some cases it is not realistic. &lt;/p&gt;&#xA;" OwnerUserId="18443" LastActivityDate="2016-02-03T17:55:05.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23079" PostTypeId="1" AcceptedAnswerId="23115" CreationDate="2016-02-03T20:12:12.090" Score="0" ViewCount="107" Body="&lt;p&gt;An equity has a value of 100 Euros, and pay a dividend of 5 Euros in 6 months. The interest rate  of 6 months is 5% and the interest rate for 1 year is 6%.&#xA;I would like to compute the value of the price of this equity after 1 year ? &lt;/p&gt;&#xA;" OwnerUserId="17490" LastActivityDate="2016-02-05T14:00:03.990" Title="Price of an equity" Tags="&lt;option-pricing&gt;&lt;equities&gt;&lt;interest-rates&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23080" PostTypeId="1" AcceptedAnswerId="23084" CreationDate="2016-02-03T20:52:00.143" Score="1" ViewCount="1797" Body="&lt;p&gt;RiskMetrics calculates volatility using an exponentially weighted moving average. For a decay factor of 0.94, they advise a sample size of 74 past returns. Does this mean the entire calculation should have a total of 74 days of data, including today, or a total of 75 days of data (today and the previous 74 days)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Realistically this won't affect the calculation very much but I would like to be as precise as possible and faithful to the document's method. &lt;/p&gt;&#xA;" OwnerUserId="17712" LastActivityDate="2016-02-03T23:01:31.327" Title="RiskMetrics VaR Volatility Sample Size" Tags="&lt;volatility&gt;&lt;var&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23081" PostTypeId="2" ParentId="23069" CreationDate="2016-02-03T21:17:32.980" Score="1" Body="&lt;p&gt;Let $B_t$ be the value of the risk-free asset at time $t$. Then $B_0=1$ and $B_{t+1} = (1+R) B_t$. Moreover, let $\beta_t$ be units invested in the risk-free asset at time $t$. It is clear that $\beta_0 = w_0 - \Delta_0 S_0$. Since the strategy is self-financing, &#xA;\begin{align*}&#xA;\Delta_{t-1} S_{t-1} + \beta_{t-1} B_{t-1} = \Delta_t S_{t-1} + \beta_t B_{t-1},\tag{1}&#xA;\end{align*}&#xA;that is, the value will not change after the re-balance at time $t-1$, which will be held until time $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From (1), &#xA;\begin{align*}&#xA;\beta_t &amp;amp;= \beta_{t-1} -(\Delta_t - \Delta_{t-1}) \frac{S_{t-1}}{B_{t-1}}\\&#xA;&amp;amp;=\beta_{t-1} -(\Delta_t - \Delta_{t-1}) \widetilde{S}_{t-1}.&#xA;\end{align*}&#xA;Then, for the normalized wealth process $\widetilde{W}_t=W_t/B_t$, &#xA;\begin{align*}&#xA;\widetilde{W}_t &amp;amp;= \Delta_t \widetilde{S}_t + \beta_t\\&#xA;&amp;amp;= \widetilde{W}_{t-1} + \Delta_t \widetilde{S}_t - \Delta_{t-1} \widetilde{S}_{t-1}+ \beta_t-\beta_{t-1}\\&#xA;&amp;amp;=\widetilde{W}_{t-1} + \Delta_t (\widetilde{S}_t -\widetilde{S}_{t-1})\\&#xA;&amp;amp; \qquad \cdots\cdots \\&#xA;&amp;amp;=\widetilde{W}_0 + \sum_{i=1}^t \Delta_i (\widetilde{S}_i -\widetilde{S}_{i-1})\\&#xA;&amp;amp;= w_0 + \sum_{i=1}^t \Delta_i (\widetilde{S}_i -\widetilde{S}_{i-1}).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-02-03T21:22:50.940" LastActivityDate="2016-02-03T21:22:50.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23082" PostTypeId="2" ParentId="22776" CreationDate="2016-02-03T21:37:40.160" Score="2" Body="&lt;p&gt;For the case where $\sum_{i=1}^n \lambda_i =1$, you need only note that the payoff &#xA;\begin{align*}&#xA;(x-K)^+&#xA;\end{align*}&#xA;is a convex function in $x$. That is, &#xA;\begin{align*}&#xA;\Big(\sum_{i=1}^n \lambda_i S_i -K\Big)^+ \le \sum_{i=1}^n\lambda_i(S_i-K)^+.&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;e^{-rT}E\left(\Big(\sum_{i=1}^n \lambda_i S_i -K\Big)^+\right) \le \sum_{i=1}^n\lambda_ie^{-rT}E\left((S_i-K)^+\right).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-02-03T21:37:40.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23083" PostTypeId="2" ParentId="22771" CreationDate="2016-02-03T21:52:28.557" Score="1" Body="&lt;p&gt;Note that, for $K_1 &amp;lt; K &amp;lt; K_2$,&#xA;\begin{align*}&#xA;-(K_2-K_1) \le (S_T-K_2)^+ - (S_T-K_1)^+ \le 0.&#xA;\end{align*}&#xA;Taking the conditional expectation with respect to information set $\mathcal{F}_t$, &#xA;\begin{align*}&#xA;-(K_2-K_1)B_t(T) \le C(T, K_2, S, t) - C(T, K_1, S, t) \le 0.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;-B_t(T) \le \frac{C(T, K_2, S, t) - C(T, K_1, S, t)}{K_2-K_1} \le 0.&#xA;\end{align*}&#xA;Since&#xA;\begin{align*}&#xA;\lim_{K_2-K_1\rightarrow 0}\frac{C(T, K_2, S, t) - C(T, K_1, S, t)}{K_2-K_1} = \frac{\partial C(T, K, S, t)}{\partial K}.&#xA;\end{align*}&#xA;The result follows immediately.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-02-03T21:52:28.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23084" PostTypeId="2" ParentId="23080" CreationDate="2016-02-03T23:01:31.327" Score="5" Body="&lt;p&gt;Depending of $\lambda$, pasts observations will be weighted differently, if you compute the volatility at time $t$ , the $t-1$ observation will be weighted by $(1-\lambda)*\lambda^{0}$, the $t-2$ observation by $(1-\lambda)*\lambda^{1}$ and so on so forth.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For $\lambda= 0.94 $ :&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The first observation is weighted by = $(1-0.94) * 0.94^0 =0.06%$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The second observation is weighted by = $(1-0.94) * 0.94^1 = 0,0564%$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;...&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;74&quot;&gt;&#xA;&lt;li&gt;&lt;p&gt;The 74 observation is weighted by = $(1-0.94) * 0.94^{73} = 0,00065537%$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The 75 observation is weighted by = $(1-0.94) * 0.94^{74} = 0,00061604%$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For each observations taken into account you may compute the cumulative weights , and thus the weights not assigned :&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Cumulative weights:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;cumulative first observation=  $0.06$     $\implies$ left $0.94\%$ of weights to assign (ie   $1- 0.06 = 0.94$)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;cumulative second observation = $(0.06+ 0.564 )= 0.1164$ $\implies$ left  $0.8836 \%$ of weights to assign  (ie $1- (0.1164 ) = 0.8836$ )&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;....&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;74&quot;&gt;&#xA;&lt;li&gt;cumulative 74th observation =   $(0.06+0.564+….) = 0,98973258 $  $\implies$ left $0,01026742 \%$ to assign&lt;/li&gt;&#xA;&lt;li&gt;cumulative 75th observation =  $(0.06+0.564+….) = 0,99034863$   $\implies$ left $0,00965137 \%$ to assign&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So if you truncate your computation at the 74 th observations (if you compute EWMA over 74 total observations), with lambda of 0.94, you lose &lt;strong&gt;more&lt;/strong&gt; than 1% of weights. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your tolerance rate is 1% this is not acceptable and you will need to truncate at the 75 th day (because with this number of observation you lose &lt;strong&gt;less&lt;/strong&gt; than 1% of weights). &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;So for a 1% tolerance rate you need at least 75 past days to compute&#xA;  today volatility.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;From Riskmetrics document : the formula wich returns the number of observations needed is given by :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$K = \frac{\ln(to)}{\ln(\lambda)}   $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $to$ is the tolerance level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus for $\lambda = 0.94$ and tolerance $=0.01$ we indeed found a value lightly superior to 74 days (indicating we need 75 days):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{\ln(0.01)}{\ln(0.94)}  =  74,4265073$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rismetrics in their documents round this value to 74 but in doing so they violate their tolerance rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For details : See page 93 and 94   &lt;em&gt;RiskMetrics — Technical Document.(1996)&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2016-02-03T23:01:31.327" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23085" PostTypeId="1" CreationDate="2016-02-04T00:07:30.767" Score="2" ViewCount="3667" Body="&lt;p&gt;Given the definition: &lt;code&gt;Market capitalization (market cap) is the total market value of the shares outstanding of a publicly traded company; it is equal to the share price times the number of shares outstanding.&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I find it quite puzzling to find different numbers everywhere for Google's (now renamed Alphabet) market capitalisation.&#xA;I have summarised my findings in this Google sheet (&lt;a href=&quot;https://docs.google.com/spreadsheets/d/1C8sSp7Kf3wdiiYFHCGM2I3qvjESbLjZR04OCFZHBDi0/edit?usp=sharing&quot; rel=&quot;nofollow&quot;&gt;https://docs.google.com/spreadsheets/d/1C8sSp7Kf3wdiiYFHCGM2I3qvjESbLjZR04OCFZHBDi0/edit?usp=sharing&lt;/a&gt;) hope you can all access it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It ranges from the totally wrong for Market Cap (see CNBC), to inconsistent (see Nasdaq, WSJ and Yahoo finance) to differences in number of shares (Google finance and Bloomberg.com don't seem to agree on the number of outstanding shares).&#xA;My aim is first to understand what is the right number for outstanding shares and market cap and second what is the right &quot;price&quot; for the Class B shares that are unlisted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Data in the sheet is as of Feb 4th, 2016 11AM Sydney time (so based on closing prices, way after market closes).&lt;/p&gt;&#xA;" OwnerUserId="7629" LastActivityDate="2016-09-24T16:44:25.743" Title="Correct Alphabet (Google) market cap calculation?" Tags="&lt;equities&gt;&lt;market-data&gt;&lt;fundamentals&gt;" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="23086" PostTypeId="2" ParentId="23076" CreationDate="2016-02-04T05:24:03.983" Score="2" Body="&lt;p&gt;MBS are securities which represent ownership in a pool of mortgages&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ABS are securities which represent ownership in a pool of assets other than mortgages (for example auto loans or credit card loans)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Collateralized Debt Obligation are complex entities which issue tranches of securities to investors and use the proceeds to buy MBS, ABS or other assets. The highest tranches have priority in receiving cash flows from the owned securities, and thus are less risky and less leveraged than the lower tranches. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Covered bonds is the English name for Pfandbriefe, a German invention. They are debt instruments issued by a bank, and are part of the capital structure of that bank (unlike the above which are independent securities). The pfandbriefe are backed by a pool of mortgages, which serve as a kind of second level guarantee (or &quot;cover&quot;) if the bank is unable to repay. In addition the bank is required to put up new mortgages if the old ones expire or default. &lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-02-04T05:44:28.687" LastActivityDate="2016-02-04T05:44:28.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23087" PostTypeId="2" ParentId="23058" CreationDate="2016-02-04T08:32:19.620" Score="1" Body="&lt;p&gt;Another fascinating option: the so-called &lt;em&gt;random walk&lt;/em&gt; which is, in layman's terms the simulation of a random and unpredictable path. More information on &lt;a href=&quot;https://en.wikipedia.org/wiki/Random_walk&quot; rel=&quot;nofollow&quot;&gt;Wikipedia&lt;/a&gt; and an &lt;a href=&quot;http://www.inference.phy.cam.ac.uk/teaching/comput/C++/python/randomwalk6.shtml&quot; rel=&quot;nofollow&quot;&gt;implementation experiment in Python&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="9424" LastActivityDate="2016-02-04T08:32:19.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23089" PostTypeId="1" CreationDate="2016-02-04T09:19:59.383" Score="7" ViewCount="1230" Body="&lt;p&gt;Currently I am doing a research on the plain vanilla multi-curve framework Libor Market Model meaning that no stochastic volatility is involved. I had the idea to calibrate to the swaption market. In the volatility calibration procedure I minimize the error between the market quoted swaption volatilities and the volatilities obtained by Rebonato's swaption volatility approximation formula. Which minimization method would be convenient for this particular problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the following parametrizations for the instantaneous correlation and instantaneous volatility, respectively:&#xA;$\rho_{i,j} = e^{-\beta |T_i - T_j |}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma_i(t) = (a+b(T_i - t))e^{-c(T_i-t)}+d$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to include the correlation parameter $\beta$ in the calibration. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have a suggestion on how I can calibrate the correlation? I suppose this has to be done before calibrating the volatility parameters $a,b,c,d$ since the Rebonato's approximation formula requires the instataneous correlation as input. To which target value do I have to compare it to since no instantaneous correlation can directly be deduced from the market quoted volatilities and which error do I have to minimize?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, after having calibrated the model I can use the calibrated parameters in a Monte Carlo routing where the forward Libor rates are simulated under the spot measure to price a swaption. Can anyone advise me on how I can test the accuracy of the calibrated parameters by comparing the swaption prices obtained by Monte Carlo, by Rebonato's approximation formula and the market quoted volatilities? (side question: Do I retrieve the price of swaption obtained throught Monte Carlo in terms of volatility by taking the volatility inserted in the simulation?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would it make sense to compare these results in a graph where different strikes are plotted (ATM + x) against the three different types of volatilities described above for a given set of calibrated parameters? Or is this only relevant when the volatility in the model is stochastic?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance.&lt;/p&gt;&#xA;" OwnerUserId="19279" LastEditorUserId="19279" LastEditDate="2016-02-04T10:10:40.693" LastActivityDate="2020-05-20T14:27:45.567" Title="Libor Market Model Calibration" Tags="&lt;volatility&gt;&lt;interest-rates&gt;&lt;monte-carlo&gt;&lt;calibration&gt;&lt;swaption&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23090" PostTypeId="1" CreationDate="2016-02-04T09:31:05.987" Score="2" ViewCount="250" Body="&lt;p&gt;I am looking for relevant information on the organization of the Weather Derivatives market. How is it organized? How information is shared? Where can we find historical database?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am aware of the &lt;a href=&quot;http://www.cmegroup.com/trading/weather/&quot; rel=&quot;nofollow&quot;&gt;CMEgroup ressource&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="16457" LastEditorUserId="16457" LastEditDate="2016-02-04T09:49:35.100" LastActivityDate="2016-02-09T04:50:25.260" Title="Information on Weather Derivatives" Tags="&lt;data&gt;&lt;market-data&gt;&lt;historical-data&gt;&lt;derivatives&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23094" PostTypeId="2" ParentId="23079" CreationDate="2016-02-04T14:35:10.487" Score="1" Body="&lt;p&gt;The relationship between interest rates and equity prices being at best unstable and weak, I'll assume that the level of interest rate is irrelevant here. So the answer to your question (price of the equity in a year) is 95, everything else being equal. Of course it's unlikely that the equity will actually price at 95 in a year due to market movements, but that's a different story.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you ask for the forward value of the equity, you need to discount that future value with the relevant interest rates.&lt;/p&gt;&#xA;" OwnerUserId="2393" LastActivityDate="2016-02-04T14:35:10.487" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23096" PostTypeId="2" ParentId="23075" CreationDate="2016-02-04T15:04:46.243" Score="3" Body="&lt;p&gt;-S.06.02.02 does not exits because the anual code S.06.02.01 is reused for the quarterly reporting. Note that there are not changes in comparison with anual table structure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-S.06.02.03 does not exits for day 1. Note that this last &quot;.03&quot; means Day 1 Solo.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea of the codification is to reuse (when possible) the same codes as far as the table structure is the same. This helps to easily see the commonalities or to highlight that there are differences in the templates without needing to compare the business logs. Also it may also help on the database mappings and to reduce the number of worksheets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find more information &lt;a href=&quot;https://dev.eiopa.europa.eu/Taxonomy/Full/2.0.1/EIOPA_DPM_Documentation_2.0.1.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; in point IV.3.2.1 and &lt;a href=&quot;https://eiopa.europa.eu/Publications/Reports/EIOPA-BoS-15-115_Final_report_ITS_Regular_Supervisory_Reporting_rev_08092015.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; at the bottom of page 5. The entry points matrix available in the EIOPA reporting formats page helps to see how the logic is been applied.&lt;/p&gt;&#xA;" OwnerUserId="19293" LastActivityDate="2016-02-04T15:04:46.243" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23097" PostTypeId="1" CreationDate="2016-02-04T15:44:33.873" Score="0" ViewCount="218" Body="&lt;p&gt;Believe that the yield curve is going to steepen very soon. It may be fall in short-term rates, a rise in long-term rates, or some combination of these. What strategy should we pursue in the bond market to position ourselves to profit from our beliefs?&lt;/p&gt;&#xA;" OwnerUserId="19295" LastActivityDate="2016-03-08T13:45:03.587" Title="Strategies on steepen yield curve" Tags="&lt;finance&gt;&lt;yield-curve&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23098" PostTypeId="2" ParentId="23097" CreationDate="2016-02-04T16:39:36.470" Score="1" Body="&lt;p&gt;Translate your forecast of yields into a forecast of bond prices: you believe long term bonds will fall in price rel. to short term bonds. So, what to do? Shorten the duration of your portfolio, i.e. sell long term bonds and/or buy short term bonds. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you don't like long term bonds (and the fixed payments they make to you), you may also enter into (long tenor) swaps where you receive floating and pay fixed. A situation known as &quot;being short the swap&quot; (you can think of it as another way of getting rid of the risk from your long term bonds).&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-03-08T13:45:03.587" LastActivityDate="2016-03-08T13:45:03.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23099" PostTypeId="1" CreationDate="2016-02-04T17:29:24.113" Score="1" ViewCount="60" Body="&lt;p&gt;I'm looking for data on (inner country) interest rate differentials between lending in own and foreign currency. Is there any data publicly available? If yes, where? If not, which non-free sources are available?&lt;/p&gt;&#xA;" OwnerUserId="19298" LastActivityDate="2016-02-04T17:29:24.113" Title="Data on interest rate differentials (lending on own vs. foreign currency)" Tags="&lt;interest-rates&gt;&lt;data&gt;&lt;fx&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23104" PostTypeId="1" AcceptedAnswerId="23105" CreationDate="2016-02-04T20:44:51.903" Score="2" ViewCount="235" Body="&lt;p&gt;The value of an option in the money is 11.50 Euros. The parameters of the market are: &#xA;-The price of the underlying stock: 81.4 Euros.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-The volatility ofthe underlying is : 34.65 % &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The sensitivities are: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Delta = 58%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gamma = 2 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to approximate the price of this option if the price of the underlying increase by 1/2 Euros (volatility not changed) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you &lt;/p&gt;&#xA;" OwnerUserId="17490" LastActivityDate="2016-02-04T21:10:01.580" Title="Approximation of an option price" Tags="&lt;option-pricing&gt;&lt;volatility&gt;&lt;greeks&gt;&lt;delta&gt;&lt;gamma&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23105" PostTypeId="2" ParentId="23104" CreationDate="2016-02-04T21:10:01.580" Score="4" Body="&lt;p&gt;Since the volatility is not changing, we can assume that the only change is the underlying asset price $S$. Then&#xA;\begin{align*}&#xA;C(S+\Delta) &amp;amp;\approx C(S) + Delta \times\Delta +\frac{1}{2} Gamma \times \Delta^2 \\&#xA;&amp;amp;=11.50 + 0.58 \times 0.5 + \frac{1}{2}\times 2 \times (0.5)^2\\&#xA;&amp;amp;=12.04.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-02-04T21:10:01.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23106" PostTypeId="2" ParentId="23085" CreationDate="2016-02-04T23:04:42.500" Score="1" Body="&lt;p&gt;This has been driving me nuts as well!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for providing the spreadsheet.  Looking at MSN Money there is a discrepancy of over 11B in market cap between viewing GOOG and GOOGL shares!  GOOGL has a market cap associated with 537B and GOOG has a market cap of 526B.  I don't understand how one site can list two different market caps based on the class of shares being viewed.  I thought it would be Class A Price x Class A Shares Outstanding, + Class B... + Class C...  I would think that these should add up to the same amount regardless of which class of shares you are viewing, but apparently not. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/hDjzM.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/hDjzM.png&quot; alt=&quot;GOOG vs. GOOGL market cap&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19307" LastActivityDate="2016-02-04T23:04:42.500" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23108" PostTypeId="2" ParentId="23066" CreationDate="2016-02-05T00:43:23.310" Score="1" Body="&lt;p&gt;You are onto something, it is inconsistent to be calculating vega with Black-Scholes considering it assumes that volatility is constant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Black-Scholes is not a good for modeling option prices/implied volatility. It's a very good intuitive model (like the CAPM), and a good way of organizing thoughts, but it is not an accurate depiction of reality. If it were, you wouldn't be seeing volatility smiles (it would be a noisy horizontal line instead).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're looking into modeling implied volatility, you should look into model free implied volatility which is based on risk neutral densities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2220067&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2220067&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is about implied volatility. Modeling realized volatility is another story.&lt;/p&gt;&#xA;" OwnerUserId="19309" LastActivityDate="2016-02-05T00:43:23.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23109" PostTypeId="1" AcceptedAnswerId="23156" CreationDate="2016-02-05T02:01:06.713" Score="0" ViewCount="83" Body="&lt;p&gt;I'm trying to find free historical charts of the S&amp;amp;P 500.  I don't need the raw data, I just need to access a simple chart showing the movement of the index over the course of the day (for an arbitrary day).  It would be fantastic if the source could generate charts for several years back, but even just a few months back would be acceptable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where can I find charts like this?&lt;/p&gt;&#xA;" OwnerUserId="19310" LastActivityDate="2016-02-09T08:46:28.447" Title="Where can I find free single-day charts for the S&amp;P 500?" Tags="&lt;historical-data&gt;&lt;intraday&gt;&lt;charts&gt;&lt;historical&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23110" PostTypeId="1" CreationDate="2016-02-05T04:04:18.973" Score="0" ViewCount="2644" Body="&lt;p&gt;Looking for accurate end of day option data. Preferably with Greeks. Any recommendations? &lt;/p&gt;&#xA;" OwnerUserId="19311" LastActivityDate="2016-06-10T00:35:22.323" Title="Where can I find best end of day option data?" Tags="&lt;options&gt;&lt;data&gt;&lt;historical-data&gt;&lt;historical&gt;" AnswerCount="2" CommentCount="1" ClosedDate="2016-06-10T13:54:11.020" ContentLicense="CC BY-SA 3.0" />
  <row Id="23111" PostTypeId="1" CreationDate="2016-02-05T07:09:28.770" Score="2" ViewCount="645" Body="&lt;p&gt;I'm using Rblapi to get tick data, using the nice getTicks function. Much to my dismay the index is rounded to the second, while milliseconds time stamp could be provided. Tried returnsAs xts, fts(?) or matrix, but no luck.&#xA;Anyone has an idea about how to make it work?&lt;/p&gt;&#xA;" OwnerUserId="18174" LastActivityDate="2019-09-15T10:01:40.230" Title="Rblpapi millisecond resolution" Tags="&lt;r&gt;&lt;bloomberg&gt;&lt;tick-data&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23112" PostTypeId="1" CreationDate="2016-02-05T08:02:16.350" Score="3" ViewCount="2513" Body="&lt;p&gt;As the title states, I am basically wanting to know the applications of real/complex analysis in finance. How important are such high levels of math ? I can obviously see how things such as differential equation/Stochastic calculus are very important but it might also be that my mathematical maturity is not yet at such high levels but I am hoping someone can shed some light as well as on complex analysis at the hedge fund/quantitative trading level (not really talking about global macros but hopefully I am not being too ambiguous)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Will appreciate some advice. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="18862" LastActivityDate="2016-02-16T23:46:59.773" Title="How necessary is real analysis and complex analysis for trading at hedge fund levels?" Tags="&lt;quant-trading-strategies&gt;&lt;trading&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23113" PostTypeId="2" ParentId="23110" CreationDate="2016-02-05T09:11:46.020" Score="0" Body="&lt;p&gt;Probably Option Metrics which you can find on WRDS is what you are looking for.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2016-02-05T09:11:46.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23115" PostTypeId="2" ParentId="23079" CreationDate="2016-02-05T13:51:10.340" Score="1" Body="&lt;p&gt;We consider the forward value, which can be employed to estimate the equity value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $T_1=0.5$ be the dividend payment time, and $T=1$. Moreover, let $r_1=5\,\%$ be the annualized interest rate to $T_1$, $r=6\,\%$ be the interest rate to $T$, and $d=5$ be the dividend payment. Then, the forward value, under the risk-neutral measure with the deterministic interest rate assumption, is given by&#xA;\begin{align*}&#xA;F &amp;amp;= E(S_T)\\&#xA;&amp;amp;=E\big( E(S_T\mid\mathcal{F}_{T_1})\big)\\&#xA;&amp;amp;=E\left( e^{rT} E\left(\frac{S_T}{e^{rT}}\mid\mathcal{F}_{T_1}\right)\right)\\&#xA;&amp;amp;=E\left(\frac{e^{rT}}{e^{r_1T_1}} S_{T_1} \right)\\&#xA;&amp;amp;=E\left(\frac{e^{rT}}{e^{r_1T_1}} (S_{T_1-} -d)\right)\\&#xA;&amp;amp;=\frac{e^{rT}}{e^{r_1T_1}} E(S_{T_1-}) - \frac{e^{rT}}{e^{r_1T_1}}\,d\\&#xA;&amp;amp;=S_0\,e^{rT} - \frac{e^{rT}}{e^{r_1T_1}}\,d\\&#xA;&amp;amp;=101.01.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-02-05T14:00:03.990" LastActivityDate="2016-02-05T14:00:03.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23116" PostTypeId="2" ParentId="22997" CreationDate="2016-02-05T14:36:42.470" Score="2" Body="&lt;p&gt;As barrycarter stated in the comment - the value of a set of [European!] options is the sum of the values of the individual options. This is simply follows from integral of a sum being a sum of integrals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$butterfly\,option\,price = \\&#xA;\int_0^\infty butterfly\,payoff(S) dS =  \\&#xA;\int_0^\infty (call\,payoff(S,K)+call\,payoff(S,K')+call\,payoff(S,K''))  dS  = \\&#xA;\int_0^\infty call\,payoff(S,K) dS + \int_0^\infty call\,payoff(S,K') dS + \int_0^\infty call\,payoff(S,K'') dS = \\&#xA;call(K)+call(K')+call(K'')&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2016-02-05T14:36:42.470" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23117" PostTypeId="1" CreationDate="2016-02-05T17:19:36.483" Score="3" ViewCount="8518" Body="&lt;p&gt;Is there a way to obtain the historical volatility of a stock from the bloomberg API? I would be looking for the data in the HVT table. Actually 3-months historical volatility from now would be enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know there are functions to get the implied volatility for options (using IVOL_LAST_RT for example) but that is not what I am looking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could also just get the day opening and closing ticks from the terminal and then calculate the historical volatility, but I am trying to avoid this step.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&#xA;Honza&lt;/p&gt;&#xA;" OwnerUserId="19323" LastActivityDate="2020-09-27T13:58:44.507" Title="Historical volatility on bloomberg API" Tags="&lt;volatility&gt;&lt;programming&gt;&lt;bloomberg&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23119" PostTypeId="2" ParentId="10585" CreationDate="2016-02-05T18:43:37.330" Score="0" Body="&lt;p&gt;volopta.com was suggested in the thread on a page for replication code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once your study is published you can add it to the &lt;a href=&quot;http://replication.uni-goettingen.de&quot; rel=&quot;nofollow&quot;&gt;ReplicationWiki&lt;/a&gt; (that I founded) and give a link to where the code can be accessed. If the publication is covered by RePEc that page then links back to the wiki.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.runmycode.org/&quot; rel=&quot;nofollow&quot;&gt;Runmycode&lt;/a&gt; is a page that can be used to share the code and data that underlie research publications. Several finance papers are already listed.&lt;/p&gt;&#xA;" OwnerUserId="19321" LastEditorUserId="19321" LastEditDate="2016-02-12T14:12:02.963" LastActivityDate="2016-02-12T14:12:02.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23120" PostTypeId="1" CreationDate="2016-02-05T18:46:09.640" Score="2" ViewCount="257" Body="&lt;p&gt;As documented in &lt;a href=&quot;https://www.google.com/urlhttps://www.google.com/url?sa=t&amp;amp;source=web&amp;amp;rct=j&amp;amp;url=http://www.di.ens.fr/~aspremon/PDF/MeanRevVec.pdf&amp;amp;ved=0ahUKEwivv7ujo-HKAhUUzWMKHe-0CU8QFggbMAA&amp;amp;usg=AFQjCNHOfTtNTAnTaiZS0wZF7YDhuq41-A&quot; rel=&quot;nofollow&quot;&gt;this paper,&lt;/a&gt; Box-Tiao decomposition (a way to decompose multiple time series into components with different speeds of mean reversion) can be used to identify mean reverting portfolios. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there alternative methods? &lt;/p&gt;&#xA;" OwnerUserId="5667" LastActivityDate="2016-02-05T18:46:09.640" Title="Are there alternatives to the Box-Tiao decomposition in identifying mean reverting portfolios?" Tags="&lt;time-series&gt;&lt;arbitrage&gt;&lt;mean-reversion&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23121" PostTypeId="1" CreationDate="2016-02-05T19:17:33.717" Score="2" ViewCount="264" Body="&lt;p&gt;&lt;a href=&quot;http://psychfiledrawer.org/top-20/&quot; rel=&quot;nofollow noreferrer&quot;&gt;In psychology voting on which studies should be replicated is established on a website&lt;/a&gt;. For economics, including financial economics, the &lt;a href=&quot;http://replication.uni-goettingen.de&quot; rel=&quot;nofollow noreferrer&quot;&gt;ReplicationWiki&lt;/a&gt; (that I founded) &lt;a href=&quot;http://replication.uni-goettingen.de/wiki/index.php/Help:Replication_relevance_ranking&quot; rel=&quot;nofollow noreferrer&quot;&gt;offers a voting option&lt;/a&gt; but it is not yet used much. I already saw &lt;a href=&quot;https://quant.stackexchange.com/questions/706/how-do-i-reproduce-the-cross-sectional-regression-in-intraday-patterns-in-the-c&quot;&gt;a question here on a specific paper&lt;/a&gt; as well as several at the cross validated stack for statistics (&lt;a href=&quot;https://stats.stackexchange.com/questions/142511/svar-with-taylor-rule&quot;&gt;a&lt;/a&gt;, &lt;a href=&quot;https://stats.stackexchange.com/questions/52527/unable-to-fit-negative-binomial-regression-in-r-attempting-to-replicate-publish&quot;&gt;b&lt;/a&gt;, &lt;a href=&quot;https://stats.stackexchange.com/questions/95243/current-population-survey-cps-data-in-bertrand-duflo-mullainathan&quot;&gt;c&lt;/a&gt;) and &lt;a href=&quot;https://academia.stackexchange.com/questions/1401/how-to-get-the-data-to-reproduce-a-published-result/1402&quot;&gt;at the academia stack&lt;/a&gt; where I then asked the same question as here (&lt;a href=&quot;https://stats.stackexchange.com/questions/196584/how-to-identify-studies-that-should-be-replicated&quot;&gt;cross validated&lt;/a&gt;,&lt;a href=&quot;https://academia.stackexchange.com/questions/64253/how-to-identify-studies-that-should-be-replicated&quot;&gt;academia&lt;/a&gt;). I added the papers to the wiki (e.g., &lt;a href=&quot;http://replication.uni-goettingen.de/wiki/index.php/Intraday_Patterns_in_the_Cross-section_of_Stock_Returns_(JF_2010)&quot; rel=&quot;nofollow noreferrer&quot;&gt;Intraday Patterns in the Cross-section of Stock Returns, Journal of Finance 2010, Steven L. Heston, Robert A. Korajczyk, and Ronnie Sadka&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are many other places where such questions on replication of specific studies can be found, e.g., in the forums for specialized software (e.g., &lt;a href=&quot;http://www.statalist.org/forums/forum/general-stata-discussion/general/1305520-xtabond2-replication-exercise-what-am-i-doing-wrong&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;). To get further suggestions I would like to know if you have already replicated studies yourself or with your students. What would you think would be a mechanism that motivates to share such experience and help to identify the studies that should be replicated? And the replications that are already available somewhere but not yet listed in the wiki? Where would be the right place to ask?&lt;/p&gt;&#xA;" OwnerUserId="19321" LastEditorUserId="-1" LastEditDate="2017-04-13T12:49:59.090" LastActivityDate="2016-02-29T20:51:54.497" Title="Which studies should be replicated?" Tags="&lt;research&gt;&lt;economics&gt;&lt;replication&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23123" PostTypeId="1" CreationDate="2016-02-05T19:33:29.653" Score="2" ViewCount="232" Body="&lt;p&gt;I've been using &lt;a href=&quot;http://www.vollib.org/html/apidoc/vollib.black_scholes_merton.html#vollib.black_scholes_merton.black_scholes_merton&quot; rel=&quot;nofollow noreferrer&quot;&gt;vollib&lt;/a&gt; to calculate IV, but my answers have been different by tenths from other sources like NASDAQ and Yahoo. The answers range +- 0.5, sometimes even more.&lt;br /&gt;&#xA;The inputs are:&#xA;&lt;span class=&quot;math-container&quot;&gt;$S$&lt;/span&gt; (float) – underlying asset price&#xA;&lt;span class=&quot;math-container&quot;&gt;$K$&lt;/span&gt; (float) – strike price&#xA;&lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt; (float) – time to expiration in years&#xA;&lt;span class=&quot;math-container&quot;&gt;$r$&lt;/span&gt; (float) – risk-free interest rate&#xA;&lt;span class=&quot;math-container&quot;&gt;$q$&lt;/span&gt; (float) – annualized continuous dividend rate&lt;/p&gt;&#xA;&lt;p&gt;For &lt;span class=&quot;math-container&quot;&gt;$q$&lt;/span&gt; I use &lt;span class=&quot;math-container&quot;&gt;$r=ln(1+\frac{D}{S})$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$D$&lt;/span&gt; = annual dividend &lt;span class=&quot;math-container&quot;&gt;$S$&lt;/span&gt; = spot price.&lt;/p&gt;&#xA;&lt;p&gt;Any idea why this may happen?&lt;/p&gt;&#xA;" OwnerUserId="17063" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-02-06T12:48:54.193" Title="Difference in implied volatility calculation" Tags="&lt;option-pricing&gt;&lt;implied-volatility&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23124" PostTypeId="1" AcceptedAnswerId="23127" CreationDate="2016-02-05T19:57:21.933" Score="1" ViewCount="87" Body="&lt;p&gt;How many paths are there in a binomial model from time $t = 0$ to time $t = n$? How many nodes (states) are there?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intutively it seems that there are $2^n$ paths and $2n - 1$ nodes. But I am not sure exactly, any suggestions or hints is greatly appreciated. &lt;/p&gt;&#xA;" OwnerUserId="19002" LastActivityDate="2016-02-05T21:43:22.783" Title="Binomial Model, Number of nodes from $t = 0$ to $t = n$" Tags="&lt;finance&gt;&lt;mathematics&gt;&lt;quantitative&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23127" PostTypeId="2" ParentId="23124" CreationDate="2016-02-05T21:43:22.783" Score="2" Body="&lt;p&gt;This will depend on the nature of your tree. For a re-combining binomial tree, the number of nodes, including the initial one, will be&#xA;\begin{align*}&#xA;\sum_{i=1}^n i = \frac{n(n+1)}{2}.&#xA;\end{align*}&#xA;For the paths, as at each time $j$, there are two possibilities from each node, the total path number is $2^n$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-02-05T21:43:22.783" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23128" PostTypeId="1" CreationDate="2016-02-05T22:24:26.797" Score="2" ViewCount="1088" Body="&lt;p&gt;I have a question regarding &lt;code&gt;Bank Discount Yield&lt;/code&gt; and &lt;code&gt;Money Market Yield&lt;/code&gt; for US TBill.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some books mentioned that &lt;code&gt;Bank Discount Yield&lt;/code&gt; is not a meaningful measure of the return for the TBill because:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The yield is calculated based on face value, not purchase price.&lt;/li&gt;&#xA;&lt;li&gt;The yield is annualized into 360 days, not 365 days.&lt;/li&gt;&#xA;&lt;li&gt;The yield is based on simple interest and ignores compouding.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The book also suggests that &lt;code&gt;Money Market Yield&lt;/code&gt; is superior to the &lt;code&gt;Bank Discount Yield&lt;/code&gt; because it is computed relative to the purchase price, not the face value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't understand this because the equation of calculating &lt;code&gt;Money Market Yield&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (360 x R) / (360 - t x R)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;R&lt;/code&gt; is the &lt;code&gt;Bank Discount Yield&lt;/code&gt;, &lt;code&gt;t&lt;/code&gt; is the holding period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the &lt;code&gt;Money Market Yield&lt;/code&gt; is solely calculated from &lt;code&gt;Bank Discount Yield&lt;/code&gt;. It is not calculated from the actual purchase price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If &lt;code&gt;Bank Discount Yield&lt;/code&gt; cannot be used to measure the return, why the &lt;code&gt;Money Market Yield&lt;/code&gt; can?&lt;/p&gt;&#xA;" OwnerUserId="19325" LastActivityDate="2018-12-25T01:02:25.517" Title="Bank discount yield and money market yield" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;bond-yields&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23129" PostTypeId="1" CreationDate="2016-02-05T22:37:19.060" Score="1" ViewCount="383" Body="&lt;p&gt;As an example:&#xA;Trade date: 1/1/16&#xA;Maturity date: 2/29/16&#xA;Settlement (exchange of currencies) 3/31/16&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the instrument between 2/29 and 3/31 still deemed a forward? The forward rate is determined so that the fair value is zero at 1/1/16 with expiry date 2/29/16.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit (2/7/16):&lt;/strong&gt; Would the answer be different for the following cases:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Forward is gross settled - i.e. two cash flows occur, each in their respective currencies&lt;/li&gt;&#xA;&lt;li&gt;Forward is net settled - only one cash flow occurs in USD determined as gain or loss on maturity using 2/19 fx rates. The cash flow itself occurs on 3/31.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2685" LastEditorUserId="2685" LastEditDate="2016-02-06T22:21:28.163" LastActivityDate="2016-02-06T22:21:28.163" Title="Is an FX forward with delayed settlement still a derivative?" Tags="&lt;fx&gt;&lt;derivatives&gt;&lt;forward&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23130" PostTypeId="1" AcceptedAnswerId="23139" CreationDate="2016-02-06T10:15:04.023" Score="1" ViewCount="815" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/lballabio/QuantLib/blob/0ec43027834220baf0a554d68de79a159a2c5489/ql/termstructures/yield/zeroyieldstructure.hpp&quot; rel=&quot;nofollow&quot;&gt;https://github.com/lballabio/QuantLib/blob/0ec43027834220baf0a554d68de79a159a2c5489/ql/termstructures/yield/zeroyieldstructure.hpp&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;inline DiscountFactor ZeroYieldStructure::discountImpl(Time t) const {&#xA;    if (t == 0.0)     // this acts as a safe guard in cases where&#xA;        return 1.0;   // zeroYieldImpl(0.0) would throw.&#xA;&#xA;    Rate r = zeroYieldImpl(t);&#xA;    return DiscountFactor(std::exp(-r*t));&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The code is an adapter for zero rates because QuantLib does everything by discount factor. It converts a zero rate to a discount factor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I don't understand is why we always assume everything is continuously compounded? For example, if I have a bond I'd probably prefer semi-annual compounding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q: Is there a reason why when given zero rates, we can always assume it's continuous compounded? Does that mean if we have a set of zero rates for discounting, anything other than continuous compounded is invalid?&lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="601" LastEditDate="2016-02-06T10:26:40.930" LastActivityDate="2016-02-06T18:00:22.677" Title="Why QuantLib assumes zero rates to discount factor is continuous?" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;quantlib&gt;&lt;interest&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23131" PostTypeId="2" ParentId="23123" CreationDate="2016-02-06T12:40:20.420" Score="2" Body="&lt;p&gt;A possible reason may be your computation of maturity period. Exchange compute the maturity in minute till expiry and then divide it by total trading minute in a year to arrive at maturity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An another possible reason may be your choice of risk free interest rate. There are various proxy for risk free interest rate like Treasury rate and LIBOR of different maturities. Make sure your choice of risk free interest rate match by what is being used by NASDAQ.&lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2016-02-06T12:40:20.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23132" PostTypeId="2" ParentId="23123" CreationDate="2016-02-06T12:48:54.193" Score="0" Body="&lt;p&gt;Probably because volib assumes that the Black-Scholes holds which as we not is not true. A better way to compute implied volatility is to use a Moment-Free-Implied-Measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One possibility is to closely following the model-free&#xA;estimate proposed by Demeter et al. (1999) and Carr and Madan (1998) who show that&#xA;if one owns a portfolio of options across all strikes inversely weighted by the squared strike&#xA;then one gets a variance exposure that does not depend on the price. The variance&#xA;swap rate or implied volatility is approximated by:&#xA;\begin{equation}&#xA;\sigma_{i,t,\tau}^2=\int_{S_i(t)}^{\infty}\frac{2\Big(1-\log[\frac{K}{S_i(t)}]\Big)}{K^2}C_i(t,\tau,K)dK+\int_{0}^{S_i(t)}\frac{2\Big(1-\log[\frac{K}{S_i(t)}]\Big)}{K^2}P_i(t,\tau,K)dK&#xA;\end{equation}&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2016-02-06T12:48:54.193" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="23133" PostTypeId="2" ParentId="23121" CreationDate="2016-02-06T12:54:15.363" Score="1" Body="&lt;p&gt;I think one should start with the basic Asset Pricing papers such as:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.academicwebpages.com/preview/mehra/pdf/The%20Equity%20Premium%20A%20Puzzle.pdf&quot; rel=&quot;nofollow&quot;&gt;Mehra and Prescott 1985&lt;/a&gt;;    &lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://dx.doi.org/10.1111/0022-1082.00310&quot; rel=&quot;nofollow&quot;&gt;Campbell and Cochrane&#xA;1999&lt;/a&gt;;   &lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://dx.doi.org/10.1111/j.1540-6261.2004.00670.x&quot; rel=&quot;nofollow&quot;&gt;Bansal and Yaron&#xA;    2004&lt;/a&gt;;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Most of the models are then variations of these in one way or another. &#xA;Some other more complex but potentially interesting are on intermediation.&#xA;Some authors provide codes. Take a look for instance at&#xA;He and Krishnamurthy (&lt;a href=&quot;http://dx.doi.org/10.1257/aer.103.2.732&quot; rel=&quot;nofollow&quot;&gt;2013&lt;/a&gt;, &lt;a href=&quot;http://www.nber.org/papers/w19885.pdf&quot; rel=&quot;nofollow&quot;&gt;2014&lt;/a&gt;, &lt;a href=&quot;https://www.gsb.stanford.edu/faculty-research/working-papers/model-reserve-asset&quot; rel=&quot;nofollow&quot;&gt;2015 with Milbradt&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="19321" LastEditDate="2016-02-06T16:45:03.177" LastActivityDate="2016-02-06T16:45:03.177" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="23134" PostTypeId="2" ParentId="23129" CreationDate="2016-02-06T14:50:27.817" Score="1" Body="&lt;p&gt;This is a non standard instrument. In most cases maturity date = settlement date otherwise, yes, you get this 1 month of interest between the forward maturity date used for the interest rate calculations to get the price of the forward, and thus the cash amounts required for settlement. Then you get 1 month waiting to settle those cash amounts. So there's another implied forward due to NPV of the cash amounts during that month according to the 1 month interest rates until the maturity date cash amounts become due on the settlement date...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't really understand why such an instrument would exist, but it is a kind of implied forward.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2016-02-06T14:50:27.817" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23135" PostTypeId="1" CreationDate="2016-02-06T15:52:57.403" Score="4" ViewCount="75" Body="&lt;p&gt;Assuming the short rate $r_t$ follows the risk-neutral (so $W_t$ is a $Q$-Brownian motion) process&#xA;$$&#xA;dr_t = ar_t dt + \sigma r_t dW_t,&#xA;$$&#xA;does anyone know of an analytical bond price formula?  We know that the time $t$ price of a pure discount $T$-bond $P(t,T)$ is&#xA;$$&#xA;P(t,T) = E_Q\left(e^{-\int_t^T r_s \, ds}\right).&#xA;$$&#xA;We also know that&#xA;$$&#xA;r_t \mid r_0 \sim \log \mathcal{N}\left(\log r_0 + \left(a + \frac{\sigma^2}{2}\right)t, \sigma^2 t\right).&#xA;$$&#xA;Now let $R := \int_t^T r_s ds$.  The bond pricing equation becomes&#xA;$$&#xA;P(t,T) = E_Q(e^{-R}),&#xA;$$&#xA;so the questions is really, &quot;what is the MGF for $-R$?&quot;  I'm having some trouble working this out for myself, in particular, what is the distribution of $R$?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2016-04-19T10:25:48.507" Title="Analytical Bond Price under Rendlemen-Bartter?" Tags="&lt;interest-rates&gt;&lt;stochastic-processes&gt;&lt;probability&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23136" PostTypeId="2" ParentId="4715" CreationDate="2016-02-06T17:08:28.450" Score="1" Body="&lt;p&gt;Perhaps there is another way to arrive at the &quot;weighted average maturity of cash flows&quot;. Suppose that we have a coupon paying bond with a continuously-compounded yield $y$ which pays a coupon of value $C_i$ at time $t_i$ for $1 \leq i \leq n$. What would be the maturity of a zero-coupon bond with the same yield $y$ which has the same present value as the coupon-paying bond?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $X$ be the face-value of such a zero-coupon bond and let $t$ be its maturity date so that the zero-coupon bond has present value $Xe^{-yt}$. It follows that $Xe^{-yt} = \sum_{i=1}^n C_ie^{-y t_i}$. If one differentiates with respect to $y$ one sees that $t = \frac{\sum_{i=1}^n t_iC_ie^{-rt_i}}{\sum_{i=1}^n C_ie^{-y t_i}} = \sum_{i=1}^n \omega_i t_i$ which is the weighted weighted average maturity of cash flows with $\omega_i$ equal to the proportion of the present value of the coupon-paying bond associated to the cash flow at time $t_i$.&lt;/p&gt;&#xA;" OwnerDisplayName="user19338" LastActivityDate="2016-02-06T17:08:28.450" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23137" PostTypeId="1" CreationDate="2016-02-06T17:41:48.413" Score="0" ViewCount="256" Body="&lt;p&gt;Suppose I define order flow imbalance as volume(aggress buy)/volume(aggress sell), or some variant of that. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this variable more, or less, correlated with price movements when I sample less frequently: 1 minute, 1 hour, 1 day...?&lt;/p&gt;&#xA;" OwnerUserId="5667" LastActivityDate="2016-02-06T17:41:48.413" Title="Is order flow imbalance more or less correlated with price movements at slower frequency?" Tags="&lt;high-frequency&gt;&lt;market-microstructure&gt;&lt;algorithmic-trading&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="23139" PostTypeId="2" ParentId="23130" CreationDate="2016-02-06T18:00:22.677" Score="2" Body="&lt;p&gt;It's not an assumption; it's a requirement.  The base class &lt;code&gt;ZeroYieldStructure&lt;/code&gt; requires derived classes to implement a &lt;code&gt;zeroYieldImpl&lt;/code&gt; method that returns continuously compounded rates, because that's what it uses in the implementation of &lt;code&gt;discountImpl&lt;/code&gt;.  I don't remember the discussion at the time we implemented this&amp;mdash;it was quite a few years ago&amp;mdash;but I assume (pun not intended) that we wanted to keep it simple, so we only covered the most usual case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The constraint is not financial; it's simply due to the implementation.  It's ok if you have a set of zero rates with some other compounding convention. But in that case, you'll have to calculate the discounts with some other formula (and in the context of the library, write your own adapter class or extend the existing one to manage different conventions).&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2016-02-06T18:00:22.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23140" PostTypeId="1" CreationDate="2016-02-06T18:12:58.280" Score="1" ViewCount="1420" Body="&lt;p&gt;Normally standard deviation of an assets is used as an proxy for the risk in the financial market. In reality distribution of return is more peaked at the center and higher mass in the tail as predicted by the normal distribution. If this is true than extreme observations will occur more frequently than predicted by normal distribution. So my questions are : &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;If return are not normally distributed still then standard deviation can be used as an proxy for risk? &lt;/li&gt;&#xA;&lt;li&gt;Alternative measure of risk if returns are not normally distributed ?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="19340" LastActivityDate="2016-02-12T10:27:32.960" Title="Appropriate measure of risk if return are not normally distributed" Tags="&lt;volatility&gt;&lt;risk&gt;&lt;standard-deviation&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23141" PostTypeId="2" ParentId="23140" CreationDate="2016-02-06T19:16:02.067" Score="2" Body="&lt;p&gt;What is risk?  If one defines risk heuristically as deviation from expectation, then (assuming returns have finite variance) standard deviation can be considered a first approximation for risk.  For most distributions the mean and variance do not fully parameterize the distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some standard measures of risk for general distributions include Value at risk and Expected shortfall.  Value at risk in particular has come under scrutiny for lacking &quot;coherence&quot; but it has the benefit of being easy to understand and backtest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in general the &quot;appropriate&quot; measure of risk will be an individual decision since everyone has unique utility functions and aversions to risk.  The industry infatuation with the &quot;best&quot; risk measure is, when seen in this light, rather Sisyphean.  &lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2016-02-06T19:16:02.067" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23142" PostTypeId="2" ParentId="23128" CreationDate="2016-02-06T21:42:20.013" Score="1" Body="&lt;p&gt;The money market yield can be computed directly from the purchase price as $Y_{mm}= \frac{100-P_0}{P_0}\frac{360}{t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See for example equation 9.3 here &lt;a href=&quot;http://www.icmagroup.org/assets/documents/Media/Bondmarketsbook/Bond%20markets_structures%20and%20yield%20calculations.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.icmagroup.org/assets/documents/Media/Bondmarketsbook/Bond%20markets_structures%20and%20yield%20calculations.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The calculation of the BDY first and then conversion to MMY with your conversion formula is not necessary. The BDY, as your textbook indicates, is fairly useless in any case. Might as well calculate MMY directly.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2018-04-28T20:58:02.613" LastActivityDate="2018-04-28T20:58:02.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23143" PostTypeId="1" CreationDate="2016-02-06T22:31:23.790" Score="5" ViewCount="347" Body="&lt;p&gt;I am encountering two approaches for valuation of FX swaps (fixed for fixed, e.g. fixed USD payments for fixed EUR payments) which seem to result into different values although in theory they should be the same.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Bloomberg's SWPM&lt;/p&gt;&#xA;&lt;p&gt;Bloomberg's SWPM takes EUR cash flows, discounts them at USD discount curve adjusted by EURUSD basis curve and then converts the EUR NPV into USD using EURUSD spot.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Using FX forwards&#xA;some choose to convert EUR cash flows into USD cash flows using EURUSD forward rates. Then discount the converted USD cash flows using a USD curve and this gives the NPV of the EUR leg in USD. Subtracting the other leg (USD) gives the NPV of the entire swap.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;I always thought these two approaches should result into the same value, but they don't. Is there a reason for this? Is one better than the other?&lt;/p&gt;&#xA;" OwnerUserId="2685" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-06-07T19:27:55.410" Title="Equivalency of FX forwards and FX fixed for fixed swaps? Are they still the same under multiple curves environment?" Tags="&lt;fx&gt;&lt;derivatives&gt;&lt;swaps&gt;&lt;bloomberg&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23146" PostTypeId="2" ParentId="8490" CreationDate="2016-02-07T15:56:42.983" Score="5" Body="&lt;p&gt;I have traded those convexity adjustments for many years.  Any decent model of these adjustments allows the user to vary the correlation as they please, rather than assuming something.  If it is of interest, the implied correlations usually trade significantly under 1, especially in periods when the curve is volatile.  ie when forward rates might be going in different direction to the short end.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-02-07T15:56:42.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23147" PostTypeId="1" AcceptedAnswerId="23148" CreationDate="2016-02-07T16:51:33.380" Score="3" ViewCount="360" Body="&lt;p&gt;Let's take 4 assets, whose values are known during a period of time of 2 years.&#xA;Then I calculate the expected returns for each of these 4 assets thanks to these 2 years - historical data.&#xA;I deduce the optimal weights that maximizes the expected return of the entire portfolio under a given risk (so I calculated the Makowitz's portfolio).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I want to test my algorithm dynamically. I want that the algorithm readjusts the optimal weights for each trading day (because until now I calculated my Markowitz's portfolio for a single period of time)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question is : if I am a trader who wants to calculate these optimal weights day after day, how to calculate the expected returns for each of these assets dynamically, day after day ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose I know their expected returns for the period [1:n], if I take into account the new datas at time n+1 to calculate the new expected return, is is the good procedure ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks !&lt;/p&gt;&#xA;" OwnerUserId="15738" LastActivityDate="2016-02-07T17:15:08.983" Title="dynamic Markowitz portfolio" Tags="&lt;optimization&gt;&lt;markowitz&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23148" PostTypeId="2" ParentId="23147" CreationDate="2016-02-07T17:15:08.983" Score="2" Body="&lt;p&gt;Out-of-sample is basically impossible to predict means. Second moments are much easier. You can take a look at this post: &lt;a href=&quot;https://quant.stackexchange.com/questions/18751/estimating-mu-only-increasing-t-improves-estimate/18915#18915&quot;&gt;Estimating $\mu$ - only increasing $T$ improves estimate?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Only with infinite $T$ you would be able to correctly estimate $\mu$. So theoretically your procedure could be correct if means are time-varying, but out of sample I bet your Markowitz strategy will perform poorly.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2016-02-07T17:15:08.983" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="23149" PostTypeId="1" AcceptedAnswerId="23162" CreationDate="2016-02-07T17:31:58.700" Score="2" ViewCount="173" Body="&lt;p&gt;Say an option with five years left before maturity has a value of $x$ today. Theoretically, under the B/S framework, what is its expected value in five years (upon maturity)? Do we assume it will simply grow in line with the five-year risk free rate? Can you please also provide any reference I can cite for this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E(v)_{t=5}=x(1+R_f)^5$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;or&#xA;$E(v)_{t=5}=xe^{5R_f}$ using a continuously compounded $R_f$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this right? If so, is it only correct under a risk-neutral framework? And can we say $R_f$ is the drift in this case (is it proper semantics)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for your help!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: on second thought, this seems somewhat flawed if you're deep out-of-the-money... Really not sure how to proceed. Basically my question is what is the expected value of the option at maturity when you're at time t?&lt;/p&gt;&#xA;" OwnerUserId="19351" LastEditorUserId="19351" LastEditDate="2016-02-07T18:33:55.497" LastActivityDate="2016-02-21T19:13:22.400" Title="What is the theoretical expected growth in an option's value over a given period of time?" Tags="&lt;options&gt;&lt;black-scholes&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23150" PostTypeId="1" CreationDate="2016-02-07T21:24:20.743" Score="3" ViewCount="263" Body="&lt;p&gt;I was able to solve the following problem and find the arbitrage but only after spending a long time on it and trying out different possibilites. Is there a method or technique that can help me find the arbitrage faster and in a more efficient way rather than just trying out different possibilites?&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Dealers &lt;span class=&quot;math-container&quot;&gt;$A$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$B$&lt;/span&gt; use the following exchange rates:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ \begin{array}{l|l|l}&#xA;        \text{dealer } A &amp;amp; \text{Buy}         &amp;amp; \text{Sell} \\\hline&#xA;        \text{EUR }    1 &amp;amp; \text{USD } 1.018  &amp;amp; \text{USD } 1.0284 \\&#xA;        \text{GBP }    1 &amp;amp; \text{USD } 1.5718 &amp;amp; \text{USD } 1.5944 \\&#xA;        \end{array} $$&lt;/span&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ \begin{array}{l|l|l}&#xA;        \text{dealer } B &amp;amp; \text{Buy}         &amp;amp; \text{Sell} \\\hline&#xA;        \text{EUR }    1 &amp;amp; \text{GBP } 0.6354 &amp;amp; \text{GBP } 0.6401 \\&#xA;        \text{USD }    1 &amp;amp; \text{GBP } 0.6309 &amp;amp; \text{GBP } 0.6375 \\&#xA;        \end{array} $$&lt;/span&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Find an arbitrage opportunity.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;My answer:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Borrow 1 British pound (GBP)  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Go to dealer B and exchange your pounds for euros (1.5623 euros)  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Go to dealer A and exchange euros for dollars (1.5904)  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Go to dealer B and exchange dollars to pounds (1.0034 pounds)  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Return the 1 pound you borrowed and you just made 0.0034 pounds&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;There is an arbitrage of 0.0034 pounds.&lt;/p&gt;&#xA;" OwnerUserId="19355" LastEditorUserId="20795" LastEditDate="2019-09-22T10:13:40.613" LastActivityDate="2019-09-22T10:13:40.613" Title="Is there an efficient method or technique to find an arbitrage between two FX dealers?" Tags="&lt;fx&gt;&lt;arbitrage&gt;&lt;modeling&gt;&lt;homework&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="23151" PostTypeId="2" ParentId="23150" CreationDate="2016-02-07T23:45:14.663" Score="1" Body="&lt;p&gt;Can't wait to see you implement it in real life... You will experience so many uncontrolled variables and scenarios... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One common scenario is: you see what you think is a good price... Then you aggress on it... By the time you are filled, your entire great arbitrage formula is gone. (It is not enough for you to be fast - in nanoseconds - you would also have to interact with all the players) &lt;/p&gt;&#xA;" OwnerUserId="13990" LastEditorUserId="467" LastEditDate="2016-12-04T15:04:11.350" LastActivityDate="2016-12-04T15:04:11.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23156" PostTypeId="2" ParentId="23109" CreationDate="2016-02-08T04:52:55.640" Score="1" Body="&lt;p&gt;If you really just want the charts, you can get this on the TD Ameritrade platform.  You do need a funded account, so it is not exactly &quot;free&quot; but there aren't any fees associated with it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In their desktop client, you can select &quot;On Demand&quot; mode.  This gives you the ability to rewind to earlier points in history for sim trading purposes.  Just rewind back to a date shortly after the day you want to examine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, I just went to January, 2010 and the 1-minute data for SPX (their symbol for the index) came up fine.&lt;/p&gt;&#xA;" OwnerUserId="19363" LastActivityDate="2016-02-08T04:52:55.640" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="23158" PostTypeId="1" AcceptedAnswerId="23163" CreationDate="2016-02-08T05:37:48.317" Score="2" ViewCount="407" Body="&lt;p&gt;Suppose I have $$dS_t  = \mu(S_t,t) dt + \sigma(S_t,t)dW_t$$&#xA;What would be the process satisfying the following process of $y_t$? &#xA;$$y_t = \int_0^t S_u du + \int_0^t S_u dW_u$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not quite sure about differentiating $y_t$. The following is what I did&#xA;$$\frac{\partial y_t}{\partial S_t} =dt +dW_t $$&#xA;and &#xA;$$\frac{\partial^2 dy_t}{\partial dS_t^2} = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are these right? Then Ito's Formula gives&#xA;$$dy_t = (dt+dW_t)dS_t = \sigma(S_t,t)dt $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this feels wrong. &lt;/p&gt;&#xA;" OwnerUserId="6016" LastActivityDate="2016-02-09T15:19:25.337" Title="Ito Formula for Stochastic Integral" Tags="&lt;stochastic-calculus&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23159" PostTypeId="1" CreationDate="2016-02-08T05:49:02.447" Score="1" ViewCount="208" Body="&lt;p&gt;I was watching this &lt;a href=&quot;https://www.youtube.com/watch?v=o-Kf6Y419hU&quot; rel=&quot;nofollow&quot;&gt;Youtube Video&lt;/a&gt;. He used a exchange rates of Euro to Dollar for a few days and apply GARCH(1,1) to get the predicted price. However, I didnt understand variance that he calculates from the table. WHat is the formula? &lt;/p&gt;&#xA;" OwnerUserId="19364" LastActivityDate="2016-02-10T18:17:46.240" Title="What is the formula for variance in estimating exchange rate?" Tags="&lt;garch&gt;&lt;variance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23160" PostTypeId="2" ParentId="23159" CreationDate="2016-02-08T07:57:00.603" Score="2" Body="&lt;p&gt;GARCH model is used to model persistence in volatility. If you square demean exchange rate and calculate autocorrelation you will find significant autocorrelation  upto many lags that indicates the clustering of volatility in data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A simple ARMA(1,0)-GARCH(1,1) model can be written as : &#xA;$$y_t=\mu + \phi y_{t-1}+e_t $$&#xA;$$e_t \sim N(0, \sigma^2_t)$$&#xA;$$\sigma_t^2=\gamma + \beta e_{t-1}^2+ \eta\sigma_{t-1}^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After calibrating the above model, you can use the first equation to forecast one day ahead exchange rate(expected exchange rate). For example: &#xA;$$\mathbb{E}(y_t|\mathscr{F_{t-1}})=\mu_t+\phi y_{t-1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, using last equation you can get conditional standard deviation. To get unconditional variance take expectation one more time:$$\mathbb{E[\sigma_t^2|\mathscr{F}_{t-1}}]=\gamma + \beta \, \mathbb{E}[e^2_{t-1}]+\eta \,\mathbb{E}[\sigma^2_{t-1}]$$&#xA;solving above equation, you will get&#xA;$$\sigma_t^2=\frac{\gamma}{1-\beta -\eta}$$&lt;/p&gt;&#xA;" OwnerUserId="19340" LastEditorUserId="19340" LastEditDate="2016-02-10T18:17:46.240" LastActivityDate="2016-02-10T18:17:46.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23161" PostTypeId="2" ParentId="22182" CreationDate="2016-02-08T08:47:52.557" Score="1" Body="&lt;p&gt;The first part has already been answer by @Uditg_ucla, so I am only providing answer of your 2nd part. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rewriting your SDE in more sophisticated way: &#xA;$$dS=k(b-S)dt+\sigma S dz$$&#xA;You want SDE for $S^2$. Using Taylor series, it can be written as: &#xA;$$df(S)=f'(S)dS + \frac{1}{2!}f''(S)(dS)^2+\cdots$$&#xA;$$df(S)=2SdS+(dS)^2$$&#xA;$$df(S)=2S[k(b-S)dt+\sigma S dz]+\sigma^2 S^2 dt$$&#xA;$$df(S)=\bigg(2Sk(b-S)+\sigma^2S^2\bigg)dt+2\sigma S^2dz$$&#xA;since $Y=S^2$, so replacing $S^2$ from $Y$,&#xA;$$dY=\bigg(2k(b\sqrt{Y}-Y)+\sigma^2Y\bigg)dt+2\sigma Y dz$$&#xA;desired SDE...&lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2016-02-08T08:47:52.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23162" PostTypeId="2" ParentId="23149" CreationDate="2016-02-08T09:00:42.573" Score="2" Body="&lt;p&gt;OP is absolutely right in his approach and this is the underlying idea behind risk neutral valuation or even BS model. If Black-Scholes model assumptions hold, then a &lt;strong&gt;derivative payoff can always be replicated in such a way it would never provide return more than risk free interest rate&lt;/strong&gt;, &lt;strong&gt;otherwise it will lead to arbitrage opportunities&lt;/strong&gt;. But assumption never holds in reality and we find deviation in actual price from BS price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But theoretically, you are right. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt; : The OP has asked about the expected change in option price not the actual change. Under the risk neutral measure$(\mathbb{Q})$, the price of option $v_t$ at time $t$ is given by &#xA;$$v_t= e^{-r(T-t)}\mathbb{E}_{\mathbb{Q}}\big[(S_T-K)^+\big]$$&#xA;where, $\mathbb{E}_{\mathbb{Q}}\big[(S_T-K)^+\big]$ is expected payoff at maturity and can be written as &#xA;$$\mathbb{E}_{\mathbb{Q}}\big[(S_T-K)^+\big]=v_te^{r(T-t)}$$&#xA;which show that option price is &lt;strong&gt;expected&lt;/strong&gt; to increase at risk free rate as pointed out in OP. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Formal Derivation&lt;/strong&gt;&#xA;$$v_t= e^{-r(T-t)}\mathbb{E}_{\mathbb{Q}}\big[(S_T-K)^+|\mathscr{F_t}\big]\quad  \tag{1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's suppose $t_1 \in (t,T]$, so option price at $t_1$&#xA;$$v_{t_1}= e^{-r(T-t_1)}\mathbb{E}_{\mathbb{Q}}\big[(S_T-K)^+|\mathscr{F_{t_1}}\big]\quad \tag{2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But we don't have history of an process upto time $t_1$ and we are still at time $t$, so $v_{t_1}$ at time $t$ is &#xA;$$v_{t_1}|\mathscr{F}_t= e^{-r(T-t_1)}\mathbb{E}_{\mathbb{Q}}\big[(S_T-K)^+|\mathscr{F_t}\big] \quad \tag{3}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dividing equation 3 from equation 1, we get&#xA;$$\frac{v_{t_1}}{v_t}=\frac{e^{-r(T-t_1)}}{e^{-r(T-t)}}$$&#xA;$$v_{t_1}=v_te^{r(t_1-t)}$$&#xA;where $v_{t_1}$ is expected option price at time $t_1$ given at time $t$. &lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="16991" LastEditDate="2016-02-21T19:13:22.400" LastActivityDate="2016-02-21T19:13:22.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23163" PostTypeId="2" ParentId="23158" CreationDate="2016-02-08T09:39:07.007" Score="8" Body="&lt;p&gt;A stochastic differential equation is nothing more than a short-hand notation for a corresponding integral equation. So the initial SDE you provided &lt;em&gt;actually&lt;/em&gt; means&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \int_0^t d S_u = \int_0^t \mu(S_u, u) du + \int_0^t\sigma(S_u, u) dW_u$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is how the SDE is &lt;em&gt;defined&lt;/em&gt; (see e.g. &lt;a href=&quot;https://en.wikipedia.org/wiki/Stochastic_differential_equation#Use_in_probability_and_mathematical_finance&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;). The reason is that you cannot differentiate a Brownian motion. It does not have a derivative according to the usual definition of calculus (taking limits etc). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Things like $\frac{\partial y}{\partial S_t}$ just don't make sense in the world of stochastic calculus.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OK, so, back to your equation. Note that it can be written as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \int_0^t dy_u = \int_0^t S_u du + \int_0^t S_u dW_u$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $y_0 = 0$. Then the corresponding SDE is simply obtained by removing the integration signs:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dy_t = S_t dt + S_t dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's it! And why? Well, again, because this SDE is actually &lt;em&gt;defined&lt;/em&gt; as the corresponding integral equation. There is no corresponding differential equation which involves actual derivatives. &lt;/p&gt;&#xA;" OwnerUserId="3371" LastEditorUserId="3371" LastEditDate="2016-02-08T15:14:13.280" LastActivityDate="2016-02-08T15:14:13.280" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23165" PostTypeId="2" ParentId="23149" CreationDate="2016-02-08T10:02:40.797" Score="0" Body="&lt;p&gt;The &quot;best&quot; approximation comes from the one of the greeks: $\Theta$. This is the derivative of the option value with respect to time-to-maturity. For a call option it is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Theta(\tau) = -\frac{\sigma}{2\sqrt{\tau}}S\phi(d_+) - r K e^{-r\tau} \Phi(d_+)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\tau = T - t$ is the time to maturity, $t$ is the current time, $T$ is the maturity and you are probably familiar with the other symbols (if not check the wiki).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The approximate change in value of the call option is then &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ C(t+\delta t) \approx C(t) + \delta t \frac{\partial C}{\partial t} = C(t) - \delta t \Theta(\tau)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the first order approximation and it neglects the change of the underlying spot price. So if we assume that the stock price does not change, then this is a good approximation to the change in option value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In reality we cannot actually ignore the underlying. The stock price will fluctuate up and down, and this will be reflected by time dependency of the option value.&lt;/p&gt;&#xA;" OwnerUserId="3371" LastEditorUserId="3371" LastEditDate="2016-02-08T10:12:58.460" LastActivityDate="2016-02-08T10:12:58.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23166" PostTypeId="2" ParentId="23149" CreationDate="2016-02-08T10:43:38.233" Score="1" Body="&lt;p&gt;The expected value of the option at maturity is simply $$\mathbb{E}[(S_T-K)^+]$$&#xA;Note that this is under the real world measure.  In a B-S framework this value is given by &#xA;$$e^{rT}C(\alpha;S_0, K, \sigma, T)$$&#xA;Where $C(r; S_0, K, \sigma, T)$ is the B-S call option price.  Hence the expected growth rate (using a simple return) is &#xA;$$\frac{e^{rT}C(\alpha;S_0, K, \sigma, T)-C(r; S_0, K, \sigma, T)}{C(r; S_0, K, \sigma, T)T}$$&#xA;However the expected continuously compounded return cannot be so easily solved since the option price is non-linear in the growth rate and Jensen's inequality comes into play.&lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2016-02-08T10:43:38.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23167" PostTypeId="2" ParentId="17622" CreationDate="2016-02-08T10:58:39.063" Score="1" Body="&lt;p&gt;You can think about them as noise traders in the sense of Glostem and Milgrom (1985). It it is a fairly wide used assumption that there is someone out there that soaks up residual supply/demand. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually one thinks about this guys as large mutual funds or pension funds. &lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2016-02-08T10:58:39.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23168" PostTypeId="1" AcceptedAnswerId="23171" CreationDate="2016-02-08T13:21:07.913" Score="0" ViewCount="55" Body="&lt;p&gt;&lt;a href=&quot;http://www.bloomberg.com/news/articles/2016-02-08/goldman-sachs-says-defy-mr-market-as-recession-risk-still-low&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.bloomberg.com/news/articles/2016-02-08/goldman-sachs-says-defy-mr-market-as-recession-risk-still-low&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/dlRha.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/dlRha.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The probability of a slump in the U.S. is just 18 percent and 23&#xA;  percent over the two timeframes respectively, while the euro-area&#xA;  threat is greater at 24 percent and 38 percent, according to Goldman&#xA;  Sachs.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Article was published on 8Feb2016.&lt;/p&gt;&#xA;" OwnerUserId="6190" LastActivityDate="2016-02-08T16:51:24.240" Title="How were the probabilities of recession over the next four quarters calculated in this table?" Tags="&lt;probability&gt;&lt;economics&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23170" PostTypeId="2" ParentId="21830" CreationDate="2016-02-08T16:05:17.843" Score="2" Body="&lt;p&gt;This study seems to be on point:&#xA;&lt;a href=&quot;http://christian-fries.de/finmath/foresightbias/Fries_ForesightBias.pdf&quot; rel=&quot;nofollow&quot;&gt;http://christian-fries.de/finmath/foresightbias/Fries_ForesightBias.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19373" LastActivityDate="2016-02-08T16:05:17.843" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23171" PostTypeId="2" ParentId="23168" CreationDate="2016-02-08T16:51:24.240" Score="1" Body="&lt;p&gt;There are quite a few ways to compute this. Refer to &lt;a href=&quot;https://www.newyorkfed.org/research/capital_markets/ycfaq.html&quot; rel=&quot;nofollow&quot;&gt;The Yield Curve as a Leading Indicator&lt;/a&gt;, &lt;a href=&quot;http://faculty.ucr.edu/~chauvet/ier.pdf&quot; rel=&quot;nofollow&quot;&gt;An Economic Characterization of Business Cycle Dynamics with Factor Structure and Regime Switching&lt;/a&gt;, and &lt;a href=&quot;https://research.stlouisfed.org/fred2/series/RECPROUSM156N&quot; rel=&quot;nofollow&quot;&gt;Smoothed U.S. Recession Probabilities&lt;/a&gt;. These are used in academic and by practitioners alike.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2016-02-08T16:51:24.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23172" PostTypeId="1" AcceptedAnswerId="23177" CreationDate="2016-02-08T17:08:24.403" Score="1" ViewCount="382" Body="&lt;p&gt;In my texts of swap valuation, the fixed leg is decided by calculating the following equation, say for a swap agreement where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fixed Leg : $s(1)=s(t)$&lt;br&gt;&#xA;Floating Leg : 1 year LIBOR - 25bps&lt;br&gt;&#xA;Term = 2 years&lt;/p&gt;&#xA;&#xA;&lt;p&gt;s(t) is calculated as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{s(1)}{[1+r(1)]} + \frac{1+ s(1)}{[1+r(2)]^{2}} = 1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in effect, s(1) is independent of LIBOR plus/minus X.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kindly explain, what is the real life implications of it?&#xA;Does it imply that the payer of the SWAP( one who gives fixed leg) can arrange another cash flow stream with X% yield?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&#xA;Soham&lt;/p&gt;&#xA;" OwnerUserId="1118" LastEditorUserId="1118" LastEditDate="2016-02-08T19:33:28.563" LastActivityDate="2016-02-08T19:53:28.833" Title="Is the value of fixed swap leg independent of X, where the Floating Rate is say, LIBOR minus X%?" Tags="&lt;swaps&gt;&lt;interest-rate-swap&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23173" PostTypeId="2" ParentId="23143" CreationDate="2016-02-08T18:38:25.033" Score="1" Body="&lt;p&gt;Yes I guess in theory they should be the same value, but only because in practise there is no arbitrage between the 2 approaches presuming you end up with the same instrument. I guess you mean that.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;getting a EUR net present value from USD curves adjusted for EURUSD basis is perhaps 1 way of calculating interest rate differentials. Presumably it gives a correct differential for EUR NPV which you then convert to USD at spot.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Alternatively, getting a USD net present value from FX forward prices that have the interest rate differential already calculated, and then calculating an NPV from a USD curve.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Yeah, so the use of the different curves is like, priced under competition, and should be non arbitrageable otherwise we'd all be working that trade. So how much difference are you seeing in the values? Can you give 2 worked examples?&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2016-02-08T18:38:25.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23175" PostTypeId="2" ParentId="23110" CreationDate="2016-02-08T19:00:30.007" Score="0" Body="&lt;p&gt;A very decent place to get options data is &lt;a href=&quot;https://www.historicaloptiondata.com&quot; rel=&quot;nofollow&quot;&gt;https://www.historicaloptiondata.com&lt;/a&gt;. It is not free and I do not know anywhere you would be able to download such data for free. &#xA;Re: options greeks there was discussion recently &lt;a href=&quot;http://optionsforum.net/topic/232/where-to-download-historical-iv-for-free&quot; rel=&quot;nofollow&quot; title=&quot;historical options data&quot;&gt;historical options data&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7973" LastActivityDate="2016-02-08T19:00:30.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23177" PostTypeId="2" ParentId="23172" CreationDate="2016-02-08T19:53:28.833" Score="1" Body="&lt;p&gt;No. $s_1$ is dependent on $X$ in the sense that the value of the swap at inception must equal zero (or close to it). This is what your equation is actually showing.&#xA;$$ \frac{s_1}{1+r_1} + \frac{s_1}{(1+r_1)^2} = 1$$&#xA;The $1$ is also the NPV of the floating leg assuming no spread. Banks calibrate $s_1$ so that the NPVs of the floating and fixed legs are equal or close to equal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your swap is receiving $Libor - X$, then $s_1$ will by adjusted to make the initial fair value zero or close to zero so that:&#xA;$$NPV_{floating \space leg} \approx NPV_{fixed \space leg} $$&lt;/p&gt;&#xA;" OwnerUserId="2685" LastActivityDate="2016-02-08T19:53:28.833" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="23178" PostTypeId="1" CreationDate="2016-02-08T20:02:48.583" Score="2" ViewCount="685" Body="&lt;p&gt;how can i prove that the value at some future time $t'$, $x_{t'}$, of the Square-root process at current time $t$, $x_t$, is Chi-squared distributed?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dx_t = k(\theta - x_t)dt + \beta \sqrt{x_t}dz_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;explicitely:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$x_{t'} = x_t e^{-k(t'-t)} + \theta (1 - e^{-k(t'-t)}) + \beta \int_t^{t'} e^{-k(t'-u)}\sqrt{x_u}dz_u$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just got to mean and variance by Ito's isometry:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E_t[x_{t'}] = \theta + (x_t - \theta) e^{-k(t'-t)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Var_t[x_{t'}] = \frac{\beta^2 x_t}{k} (e^{-k(t'-t)} - e^{-2k(t'-t)}) + \frac{\beta^2 \theta}{2k} (1 - e^{-k(t'-t})^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in the Ornstein-Uhlenbeck case there's no $\sqrt{x_t}$ in the volatility and therefore the stochastic integral is Normally distributed and everything is fine&lt;/p&gt;&#xA;&#xA;&lt;p&gt;unfortunately, I've never met the Non-central Chi-squared distribution before, so I'm not able to understand how to get to it (also because it seems itself pretty a mess to me)&lt;/p&gt;&#xA;" OwnerUserId="19280" LastEditorUserId="19280" LastEditDate="2016-02-09T22:58:12.313" LastActivityDate="2016-06-19T10:13:29.793" Title="demonstrate that a Square-root process is Non-central Chi-squared distributed" Tags="&lt;stochastic-processes&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23179" PostTypeId="2" ParentId="23178" CreationDate="2016-02-08T20:41:18.433" Score="0" Body="&lt;p&gt;Proof in the paper by Feller:&#xA; &lt;a href=&quot;http://www.jstor.org/stable/1969318&quot; rel=&quot;nofollow&quot;&gt;http://www.jstor.org/stable/1969318&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-02-08T20:41:18.433" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23180" PostTypeId="1" AcceptedAnswerId="23181" CreationDate="2016-02-09T03:48:07.593" Score="0" ViewCount="1651" Body="&lt;p&gt;I'm thinking of getting End of Day stock prices from Metastock, but was wondering if it would be possible to have Python to automatically extract the stock prices and store it in a SQL.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would that be possible? To use Python to interact with Metastock and collect data?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any other recommendations for End of Day stock prices? (Asian Equities)&lt;/p&gt;&#xA;" OwnerUserId="19377" LastActivityDate="2016-02-09T04:16:08.893" Title="Metastock end of day data to Python" Tags="&lt;equities&gt;&lt;python&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23181" PostTypeId="2" ParentId="23180" CreationDate="2016-02-09T04:16:08.893" Score="1" Body="&lt;p&gt;Metastock uses a binary format that you would have to convert to text before exporting it to a SQL table. Also, there is no Python library that could extract data directly from Metastock's end-of-day servers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may consider &lt;strong&gt;quandl&lt;/strong&gt; which allows Python developers to download pricing data as well as economic indicators. You can download CSV, JSON, or XML. If you use their Python library, you can easily retrieve data into a pandas DataFrame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.quandl.com/&quot; rel=&quot;nofollow&quot;&gt;https://www.quandl.com/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19379" LastActivityDate="2016-02-09T04:16:08.893" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23182" PostTypeId="2" ParentId="23090" CreationDate="2016-02-09T04:50:25.260" Score="1" Body="&lt;p&gt;Most of the information is not publicly available, nor are the data free of charge. One of the better sources is Kenny Tang's book,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Tang, K., Ed. (2010). &lt;em&gt;Weather Risk Management: A guide for&#xA;  corporations, hedge funds and investors&lt;/em&gt;, Risk Books. ISBN-13:&#xA;  9781904339687&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="19379" LastActivityDate="2016-02-09T04:50:25.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23184" PostTypeId="2" ParentId="23158" CreationDate="2016-02-09T07:09:53.903" Score="1" Body="&lt;p&gt;@Olaf gave a clear answer. Another way to see this is as system of 2 SDEs:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{cases}&#xA;dS_u &amp;amp;= \mu(S_u,u) du + \sigma(S_u,u) dW_u \\&#xA;dy_u &amp;amp;= S_u du + S_u dW_u.&#xA;\end{cases}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. if we want to simulate this system using Euler discretuzation then we perform&#xA;\begin{cases}&#xA;S_u + \Delta S_u &amp;amp;= S_u + \mu(S_u,u) \Delta t + \sigma(S_u,u) \epsilon \sqrt{\Delta t}  \\&#xA;y_u + \Delta y_u  &amp;amp;=y_u +  S_u \Delta t + S_u \epsilon \sqrt{\Delta t}&#xA;\end{cases}&#xA;for a chosen time step $\Delta t$ and where $\epsilon$ is standard normal and sampled in each iteration. &lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2016-02-09T15:19:25.337" LastActivityDate="2016-02-09T15:19:25.337" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23186" PostTypeId="2" ParentId="23109" CreationDate="2016-02-09T08:46:28.447" Score="0" Body="&lt;p&gt;If you are a programmer, you could just download the CSV data from yahoo finance or google or any other source. As you are not expecting real time data, and you seem to be more interested in long term data, it should be very easy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;once you have the CSV data, you could generate the required reports in excel, as you like, which is just a 1 min configuration in CSV files. &lt;/p&gt;&#xA;" OwnerUserId="6799" LastActivityDate="2016-02-09T08:46:28.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23187" PostTypeId="1" AcceptedAnswerId="23189" CreationDate="2016-02-09T13:53:51.410" Score="5" ViewCount="7402" Body="&lt;p&gt;Here is an excerpt from E. Chan's book Quantitative Trading, &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;However, if the strategy is a long-short dollar-neutral strategy&#xA;  (i.e., the portfolio holds long and short positions with equal&#xA;  capital), then 10 percent is quite a good return, because then the&#xA;  benchmark of comparison is not the market index, but a riskless asset&#xA;  such as the yield of the three-month U.S.  Treasury bill (which at the&#xA;  time of this writing is about 4 percent).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I do not understand why a long-short strategy is riskless - AFAIK in a  short-long position with equal dollar amount in each, the short would pay for the long, but how does that translate into risklessness?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;" OwnerUserId="616" LastActivityDate="2016-02-10T03:56:33.850" Title="Dollar-Neutral Strategy" Tags="&lt;risk&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23189" PostTypeId="2" ParentId="23187" CreationDate="2016-02-09T14:43:34.233" Score="5" Body="&lt;p&gt;Long-short strategy is generally used by hedge funds. In simple words, an equity long-short strategy means buying an undervalued stock and selling(shorting) an overvalued stock. In normal circumstances, the long position will increase in value and the short position will decline in value. In this situation, the hedge fund will benefit. This strategy would work even if the long position declines in value but provided that the long position outperforms the short position. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Thus, the goal of any equity long-short strategy is to minimize market exposure, and get profit from a change in the difference between two stocks.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's take a simple example. A hedge fund takes a \$10 million long position in General Motors and a \$10 million short position in Volkswagen, both large automobile companies. With these positions, any event that causes all automobile stocks to fall will lead to a loss on the General Motors position and a profit on the Volkswagen position. Similarly, an event that causes both stocks to rise will have little effect, since the positions balance each other out. &lt;strong&gt;So, the market risk is minimal&lt;/strong&gt;. But question arise, Why would a portfolio manager take such a position? Because he or she thinks General Motors will perform better than Volkswagen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equity long-short strategies which hold equal dollar amounts of long and short positions, are called &lt;strong&gt;market neutral strategies&lt;/strong&gt; or &lt;strong&gt;long-short dollar neutral strategy&lt;/strong&gt; (as described above).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since, &lt;em&gt;portfolio is immune to both upside and downside market risk&lt;/em&gt;, like risk free security, its performance must be measure from similar security ie riskless assets such as U.S. Treasury bill etc. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;You can read more about market neutral strategy from &lt;a href=&quot;http://www.quant-shares.com/DOWNLOADS/What_is_Market_Neutral_Investing.pdf&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2016-02-09T14:43:34.233" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23190" PostTypeId="1" CreationDate="2016-02-09T15:08:23.923" Score="1" ViewCount="2831" Body="&lt;p&gt;I am trying to determine the volatility to use Black-Scholes to value some warrants for a private company. Very few comps are public or they are large diversified businesses.  Any thoughts on how to do this or ranges to start from?&#xA;Thanks&#xA;Connie Dubois&lt;/p&gt;&#xA;" OwnerUserId="19387" LastActivityDate="2016-02-09T16:34:10.043" Title="How to determine volatility for private company for Black-Scholes" Tags="&lt;volatility&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23191" PostTypeId="1" CreationDate="2016-02-09T15:09:14.660" Score="1" ViewCount="82" Body="&lt;p&gt;Let C be the prime of a call in fi=unction of the price  in term F, Strike K, volatilité $\sigma$ and maturity t: &#xA;$C(F,K,\sigma,t,r) $&#xA;We assume that we know $\delta$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\delta=\frac{\partial}{\partial F}C(F,K,\sigma,t,r)$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to compute $\delta$ the variation of C in function of F in two cases : &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1-If $\sigma=f(F,K)$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2-If $\sigma=g(\delta)$ &#xA;Thanks everyone&lt;/p&gt;&#xA;" OwnerUserId="17490" LastActivityDate="2016-02-09T15:09:14.660" Title="Delta of an option in two cases" Tags="&lt;options&gt;&lt;volatility&gt;&lt;greeks&gt;&lt;delta&gt;&lt;call&gt;" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="23192" PostTypeId="2" ParentId="23190" CreationDate="2016-02-09T16:34:10.043" Score="-4" Body="&lt;p&gt;There is an easy method to calculate volatility if you have a historic time series of price data. First, obtain the standard deviation of the log returns.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Imagine you have these observed prices,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;{30.00, 31.70, 27.38, 27.50, 23.96, 23.30, 30.63, 24.04}&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Calculate the log return,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;ln&lt;/em&gt;(31.70/30.00), &lt;em&gt;ln&lt;/em&gt;(27.38/31.70), . . . &lt;em&gt;ln&lt;/em&gt;(24.04/30.63).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Calculate the standard deviation of the series,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;sd&lt;/em&gt; = 0.07325&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Keep in mind that this is a simple method, and it does not allow for &lt;em&gt;skewness&lt;/em&gt; or &lt;em&gt;kurtosis&lt;/em&gt; in the frequency distribution of returns, but neither does the Black-Scholes option pricing model.&lt;/p&gt;&#xA;" OwnerUserId="19379" LastActivityDate="2016-02-09T16:34:10.043" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23193" PostTypeId="1" CreationDate="2016-02-09T19:02:48.453" Score="1" ViewCount="124" Body="&lt;p&gt;I am currently using Ninja Trader to program and test my strategies and the forward testing in very time intensive. I am thinking of writing my own code in either c++ or c#. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question I have is my logic correct in what I would need to programme? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am thinking I would need code to :- &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) read my comma separated tick data and put it into an array.&#xA;2) code that then reads through the data in order and applies my model to it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;any input would be appreciated. &lt;/p&gt;&#xA;" OwnerUserId="19388" LastActivityDate="2016-03-13T00:14:22.483" Title="Faster way to backtest/Walkforward" Tags="&lt;forward&gt;&lt;testing&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23194" PostTypeId="1" CreationDate="2016-02-09T19:34:35.510" Score="2" ViewCount="414" Body="&lt;p&gt;If you were valuing a stock (say to pitch a stock for the buy side), you are looking for stocks that the market has mispriced. Your aim is to have a profitable long or short strategy. Can you use the Capital Asset Pricing Model to value your stock? Two problems come to mind:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;CAPM assumes an efficient market. Your whole point is to spot inefficient pricing in the market.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;CAPM says $R_i = R_f + \beta(R_M - R_f)$. Now say we will value our stock based on the rate of return and discount future gains. We need to estimate $\beta$, which is calculated based on historical variance and correlation with the market of the return. But this return is based on market pricing. If the market pricing is wrong, then our estimate of $\beta$ will be wrong.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So we should not use CAPM while valuing stocks or doing stock pitches. Am I wrong?&lt;/p&gt;&#xA;" OwnerUserId="1236" LastActivityDate="2019-06-12T04:06:09.907" Title="Stock valuation/stock pitch and CAPM" Tags="&lt;equities&gt;&lt;capm&gt;&lt;valuation&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23195" PostTypeId="2" ParentId="23187" CreationDate="2016-02-09T23:15:24.293" Score="1" Body="&lt;p&gt;They are not riskless and a TBill is not the right benchmark comparison.  While a dollar neutral long/short portfolio does provide enhanced risk management, the extent is dependant upon the composition of the portfolio.  For example, if long 10M IBM and short 10M XOM, what have you hedged ? What is the relationship between IBM and XOM ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this example you are hedging broad market (Beta) changes but nothing specfic to the sector or stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a benchmark you cannot use the TBill.  For this imaginary portfolio to fail, all that is needed is bad news from IBM (or technology sector) and Oil issues (oversupply anyone ?).  My point is that long/short does reduce risk and is a great strategy but you have to understand the portfolio to understand its risks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To see how Long/Short hedge funds are performing overall, look at the Barclay Equity Long/Short Index (www.barclayhedge.com/research/indices/ghs/Equity_Long_Short_Index.html)&lt;/p&gt;&#xA;" OwnerUserId="19052" LastEditorUserId="19052" LastEditDate="2016-02-10T03:56:33.850" LastActivityDate="2016-02-10T03:56:33.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23196" PostTypeId="1" AcceptedAnswerId="23237" CreationDate="2016-02-09T23:23:13.790" Score="2" ViewCount="2913" Body="&lt;p&gt;My professor has many grammatical mistakes and errors in his questions, so apologies ahead of time. I am just trying to understand what he wants for this question, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In trinomial model, let $S_0 = 1$, $R = 0$, $u = 2$, $m = 1$, and $l = 1/2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a.) Find all risk-neutral probabilities and the range of prices generated by them for a call option with strike $K = 1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b.) Find the super-replication price and sub-replication price for this call option and compare them to the lowest and highest prices in part (a).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's assume the call option is a European call option. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Attempted solution for a.): We have two conditions &#xA;$$\begin{cases}&#xA;\pi_l\times1/2 + \pi_m\times1 + \pi_u\times2 = 1\\&#xA;\pi_l + \pi_m + \pi_u = \frac{1}{1+R} = 1 &#xA;\end{cases}$$&#xA;Since we have 2 equations and 3 unknowns we have an infinite number of risk-neutral probabilities. Hence, we can set one as the free variable and then solve for the other two. So, assume $\pi_m = \pi_u$, then we have $$1/2\pi_l + 3\pi_u = 1 \ \text{and}$$ $$\pi_l + 2\pi_u = 1$$ multiplying the first equation by 2 and solving we get $\pi_u = 1/4$, $\pi_l = 1/2$, and $\pi_m = 1/4$. Therefore in the up state we have $C = \pi_u(u - K)^+ = 1/4$ and for the down state we have $C = \pi_l(l-K)^+ = 0$, and lastly for the middle state we have $C = \pi_m(m - K)^+ = 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure if this is correct, any suggestions is greatly appreciated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: There is nothing in my professors notes or book that even mentions sub-replication so I would ignore it. Super-replication of a contingent claim is to find the smallest value of a portfolio which has a payoff equal to or greater than the payoff of the contingent claim.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Attempted solution for b.): We cannot replicate precisely but we can find a portfolio that dominates the payoff. Since there is nothing in notes nor book that mentions sub-replication I will just focus on super=replication. Hence we have three conditions &#xA;$$V_0 = aS_0 + b = \begin{cases}&#xA;aS_u + b(1+R) \geq D_1\\&#xA;aS_m + b(1+R) \geq D_2\\&#xA;aS_l + b(1+R) \geq D_3&#xA;\end{cases}$$&#xA;We know that $S_0 = 1$, $R = 0$, $u = 2$, $m = 1$, and $l = 1/2$, hence &#xA;$$V_0 = a + b = \begin{cases}&#xA;2a + b \geq D_1 = (2 - K)_+ = (2 - 1)_+ = 1\\&#xA;a + b \geq D_2 = (1 - K)_+ = 0\\&#xA;\frac{1}{2}a + b \geq D_3 = (\frac{1}{2} - K )_+ = (\frac{1}{2} - 1)_+ = 0&#xA;\end{cases}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe this dominates the pay off of a.) hence we are done... not sure? any suggestions is greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="19002" LastEditDate="2016-02-11T18:59:12.030" LastActivityDate="2016-02-11T21:41:05.577" Title="Risk-Neutral Probabilities, Trinomial Model" Tags="&lt;options&gt;&lt;finance&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;" AnswerCount="2" CommentCount="22" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23197" PostTypeId="1" CreationDate="2016-02-10T00:17:22.260" Score="3" ViewCount="140" Body="&lt;p&gt;I'm self-studying for an actuarial exam and I encountered the following problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/8Ctx6.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/8Ctx6.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The true probability of an up move, $p$, must satisfy: $$p = \frac{e^{{(\alpha - \delta})h} - d}{u - d},$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\alpha$ is the continuously compounded annual expected return of the stock and $\delta$ is the continuous dividend rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But with $\alpha = 0.10$, $\delta = 0.03$, $u = 1.04$, and $d = 0.91$, we have $$p = \frac{e^{{(0.10 - 0.03})1} - d}{1.04 - 0.91} = 1.25,$$ which doesn't seem possible since I thought $0 \leq p \leq 1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How should I interpret this value of $p$ in terms of a probability, since $p &amp;gt; 1$?&lt;/p&gt;&#xA;" OwnerUserId="5641" LastEditorUserId="5641" LastEditDate="2016-02-10T00:22:46.200" LastActivityDate="2016-02-11T17:20:41.883" Title="Is there an error in this problem on pricing an asset using the true probability of an up move?" Tags="&lt;binomial-tree&gt;&lt;self-study&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23198" PostTypeId="2" ParentId="23196" CreationDate="2016-02-10T00:48:38.820" Score="4" Body="&lt;p&gt;Trinomial trees give incomplete markets so there is a range of possible risk neutral prices. So you have to find the possible probabilities that make the tree risk-neutral and see what prices you get. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have the correct expressions. Now just have to parametrize the set of solutions. It is one-dimensional and all the probabilities are positive so you need find them all. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the second part, you can't replicate precisely but you can find a portfolio that dominates the pay-off. What is the cheapest such portfolio? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(see my book Concepts and Practice etc for extensive discussion and worked solutions of similar examples.)&lt;/p&gt;&#xA;" OwnerUserId="1809" LastEditorUserId="1809" LastEditDate="2016-02-10T02:01:20.413" LastActivityDate="2016-02-10T02:01:20.413" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="23201" PostTypeId="2" ParentId="23194" CreationDate="2016-02-10T04:31:21.547" Score="-1" Body="&lt;p&gt;CAPM is a model that assumes an efficient market and that the market prices securities based  on the preferences of highly diversified investors. With regards to stock valuation, the usual approach is that we use some estimate of $\beta$ (the market correlated risk) to arrive at the $R_i$, which is the return on equity expected of this stock. This is the &quot;cost of capital&quot; on equity. This $R_i$ is weighted by the fraction of capital raised by the firm using common stock and added as a term in the WACC. i.e.,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;WACC = $R_{\text{equity}}w_{\text{equity}}+(R_{\text{debt}}-T)w_{\text{debt}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $T$ is the tax rate and we are ignoring preferred stock.&lt;/p&gt;&#xA;" OwnerUserId="1236" LastActivityDate="2016-02-10T04:31:21.547" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23202" PostTypeId="2" ParentId="23178" CreationDate="2016-02-10T07:02:31.093" Score="1" Body="&lt;p&gt;To answer this I sum up a paragraph of &quot;Interest rate models - An Introduction&quot; by A.Cairns:&#xA;For $i=1,\ldots,d$ consider the OU-processes&#xA;$$&#xA;dX^i_t = -\frac 12 \alpha X^i_t dt + \sqrt{\alpha} dW^i_t.&#xA;$$&#xA;Looking at the squared radius $R_t = \sum_{i=1}^d (X^i_t)^2 $ (in $\mathbb{R}^d$) of this process we get by Ito:&#xA;$$&#xA;dR_t = \sum_{i=1}^d  (2 X^i_t dX^i_t) + d \alpha dt.&#xA;$$&#xA;Using the definition of $R_t$ introducing a new Brownian motion $B_t$ we get in distribution that that&#xA;$$&#xA;dR_t =  \alpha (d - R_t) dt + \sqrt{4 \alpha R_t} dB_t.&#xA;$$&#xA;Defining $r_t = R_t/\theta$ with $\theta = 4\alpha/\sigma^2$ this is the CIR model.&#xA;This gives a nice geometric interpretation.&#xA;I am aware that not all details are covered here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recall the definition of the non central chi-squared distribution. Let &#xA;$$&#xA;R = \sum_{i=1}^d (W_i + \delta_i)^2&#xA;$$&#xA;and $\lambda = \sum_{i=1}^d \delta_i^2$, then $R$ has a non-central chi-squared distribution with $d$ degrees of freedom and non-centrality parameter $\lambda$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the $X_i^t$ above are all normally distributed with variance $1- e^{-\alpha t}$ we see that $R_t/(1- e^{-\alpha t})$ has non-central chi-squared distribution. Finally we have that for $d = 4 \alpha \mu/\sigma^2$ that $4 \alpha r_t/(\sigma^2 (1- e^{-\alpha t}))$ has a non-central chi-squared distribution with $d$ degrees of freedom and non-centrality parameter $\lambda = 4 \alpha r_0/(\sigma^2 (1- e^{-\alpha t}))$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Conditionally on $r_t$ replace $r_0$ by $r_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answers then are:&#xA;i) Yes, the variable that has non-central chi-squared distribution is the complicated expression that you mention.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ii) Only this complicated expression is non-central chi-squared distributed - $r_s$ itself is not. As you see in the link the non-central chi-squared distribution relates to standardized Gaussians (variance equals 1). Maybe the &lt;a href=&quot;http://en.wikipedia.org/wiki/Generalized_chi-squared_distribution&quot; rel=&quot;nofollow&quot;&gt;Generalized chi-squared distribution&lt;/a&gt; could be of help. But I don't know this.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-02-10T07:02:31.093" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23203" PostTypeId="1" AcceptedAnswerId="23219" CreationDate="2016-02-10T08:12:08.743" Score="1" ViewCount="117" Body="&lt;p&gt;I am currently reading John C. Hulls' &quot;Risk Management and Financial Institutions&quot; and came across the following passage related to the efficient frontier and combinations of risky and risk-free assets:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;It is a short step from here to argue that the portfolio of risky investments represented by M must be the portfolio of &lt;strong&gt;all&lt;/strong&gt; risky investments. Suppose a particular investment is not in the portfolio. No investors would hold it and its price would have to go down so that its expected return increased and it became part of portfolio M. In fact, we can go further than this. To ensure a balance between the supply and demand for each investment, the price of each risky investment must adjust so that the amount of that investment in portfolio M is proportional to the amount of that investment available in the economy. The investment represented by point M is therefore usually referred to as the market portfolio.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The following part confuses me:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;No investor would hold it and its price would have to go down so that its expected return increased and became part of portfolio M.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This makes little sense to me at the moment. I understand that by excluding a particular investment (say $I$) in $M$, its demand will decrease as all risk-adverse investors will purchase portions of $M$ to produce a linear efficient frontier. This will decrease the price of $I$ but I am not sure why this will &lt;strong&gt;increase its expected value&lt;/strong&gt;, and thereafter be inserted into the market portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am also confused about the proportions part of the passage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be truly appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="13726" LastActivityDate="2016-02-10T16:50:19.860" Title="Clarification of The Market Portfolio" Tags="&lt;risk-management&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="23204" PostTypeId="1" AcceptedAnswerId="39101" CreationDate="2016-02-10T08:37:45.440" Score="9" ViewCount="885" Body="&lt;p&gt;I'm searching for information on the best way to generate scenarios to be used in VaR or ES calculations, for CDS spreads.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given that we need significant historical data in order to achieve a decent empirical probability distribution, I wonder what problems could exist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For single name entities.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is it a problem if the company profile has changed a lot during the past 5-10 years?&lt;/li&gt;&#xA;&lt;li&gt;Do we somehow need to care about the underlying reference obligations? (Is this connected to 1) ?)&lt;/li&gt;&#xA;&lt;li&gt;Would it be proper to apply a PCA technique to reduce dimensionality, given that we probably want to take into consideration the entire term structure?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For indices.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;For, say, iTraxx, we get new constituents every 6 months (from Markit homepage), however. I imagine this may cause something of a bump in prices. How can we handle this?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Lastly, is it even possible to use historical simulation for CDS spreads, or is better to apply some Monte Carlo simulation?  &lt;/p&gt;&#xA;" OwnerUserId="5888" LastActivityDate="2018-04-01T19:58:52.147" Title="CDS spread scenarios from historical market data" Tags="&lt;risk-management&gt;&lt;historical-data&gt;&lt;simulations&gt;&lt;value-at-risk&gt;&lt;cds&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="23205" PostTypeId="1" AcceptedAnswerId="23206" CreationDate="2016-02-10T08:59:02.893" Score="0" ViewCount="303" Body="&lt;p&gt;I wrote a piece of code to get option chains with volatility and greeks from IB market data. After testing yesteday, it seems to work, but I am surprised of seeing bid and ask for impliedVolatility and every greek.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am guessing that bid_IV and bid_greeks are those associated to the option if priced at the bid value, and the same for ask. When bid or ask is not available, its IV and greeks data are empty.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, if my intention is plotting the volatility surface for diferent strikes and expiration dates:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Shall I get the midpoint between bid_IV and ask_IV?&lt;/li&gt;&#xA;&lt;li&gt;Whenever bid_IV or ask_IV is not available, should I use the one which is available, or not plotting it?&lt;/li&gt;&#xA;&lt;li&gt;I am afraid of getting the data with a wrong format. I supposed that IV was a percentile, and therefore would be represented between 0 and 1. But if I go too deep ITM, this value is greater than 1 (specially if I still consider IV when its bid or ask is not available). I know that those options with IV greater than 1 are too deep ITM/OTM, so maybe I could just ignore them since they have little use. But, does this make sense? Is the data right and well formatted, or is this a hint of an error in the data representation when saved to Excel?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="15068" LastActivityDate="2016-02-10T09:19:48.740" Title="Extracting IB market data: bid and ask for greeks and IV" Tags="&lt;greeks&gt;&lt;interactive-brokers&gt;&lt;bid&gt;&lt;ask&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23206" PostTypeId="2" ParentId="23205" CreationDate="2016-02-10T09:19:48.740" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;It depends on what are you going to use the IV for. Are you selling or buying? If doing both, taking volume/quote into account is sensible&lt;/li&gt;&#xA;&lt;li&gt;Extrapolate if doing only bid or only ask curve&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/10210/lower-bound-of-itm-calls-when-computing-implied-volatility&quot;&gt;For deep ITM/OTM&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1215" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-02-10T09:19:48.740" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="23208" PostTypeId="2" ParentId="23204" CreationDate="2016-02-10T10:46:03.180" Score="0" Body="&lt;ol&gt;&#xA;&lt;li&gt;Market Risk VaR takes one year of history. Thus you wouldn't look 5-10 years of history. &lt;/li&gt;&#xA;&lt;li&gt;If you are using CDS prices only for pricing CDSs you don't need to, but if you have another model that takes CDS prices and links them to bonds, yes&lt;/li&gt;&#xA;&lt;li&gt;You don't need PCA. You can take quotes on CDSs closest to each term node, but you need to roll them to adjust for fixed term nodes.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;iTraxx, you need to give more information about the exposure you have related to iTraxx&lt;/p&gt;&#xA;" OwnerUserId="1215" LastActivityDate="2016-02-10T10:46:03.180" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="23209" PostTypeId="1" CreationDate="2016-02-10T12:22:53.570" Score="0" ViewCount="409" Body="&lt;p&gt;i am building a platform for portfolio analytics, part of which is a performance attribution module. Given that most individual portfolio's can never have the same number of stocks as say, a mutual fund, i was wondering how do i perform a stock weighting attribution for a portfolio. For instance if my portfolio had 6 stocks from 3 sectors  (Energy , Utilities  and Telecom) which have a split of 30-40-30 in my portfolio how do i compare it to the market weightage? These sectors have a weight of 8%, 3% and 2.4% in the S&amp;amp;P 500 ..i don't get anything by comparing 30-40-30 with 8-3-2.4 instantly ..but if i normalize 8-3-2.4 into 60-22-18 i can tell that my pf did better / worse because i was over/under weight one of the sectors. Can i use a normalized method for comparison ? most online sources and papers give a plain vanila approach assuming this can only be used by fund managers et al .. kindly correct me if i am wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards,&#xA;vikram&lt;/p&gt;&#xA;" OwnerUserId="19398" LastActivityDate="2016-03-16T22:22:27.260" Title="Performance attribution for personal portfolio - weight attribution" Tags="&lt;performance-evaluation&gt;&lt;performance&gt;&lt;performanceanalytics&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="23210" PostTypeId="1" CreationDate="2016-02-10T13:47:22.453" Score="8" ViewCount="10191" Body="&lt;p&gt;I'm planing to store stock market data in realtime and aggregate ticks for draw volume based cluster graph. Something like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/1bt3f.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/1bt3f.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Every tick (or second) data will be grouped by period (1,5,10 minutes; 1,4,24 hours), type (buy, sell) and price; calculated sum of volumes. Result will be something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[&#xA;  {timestamp: &quot;2016/01/30 15:04:00&quot;, period: &quot;1m&quot;, price: 123.45, buy: 2345, sell: 1998},&#xA;  {timestamp: &quot;2016/01/30 15:04:00&quot;, period: &quot;1m&quot;, price: 123.46, buy: 3111, sell: 1040},&#xA;  {timestamp: &quot;2016/01/30 15:05:00&quot;, period: &quot;1m&quot;, price: 123.46, buy: 1421, sell: 3475},&#xA;  {timestamp: &quot;2016/01/30 15:05:00&quot;, period: &quot;1m&quot;, price: 123.47, buy: 6056, sell: 9138},&#xA;]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For delivery ticks from stocks to db I will use nats (&lt;a href=&quot;https://github.com/nats-io/gnatsd&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/nats-io/gnatsd&lt;/a&gt;). Which database I can use for store and aggregate in realtime?&lt;/p&gt;&#xA;" OwnerUserId="19399" LastEditorUserId="19399" LastEditDate="2016-02-10T13:59:09.690" LastActivityDate="2016-06-25T21:08:37.007" Title="Which database to choose for storing and aggregating finance data?" Tags="&lt;tick-data&gt;&lt;database&gt;&lt;volume&gt;&lt;cluster&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23211" PostTypeId="1" CreationDate="2016-02-10T14:07:13.913" Score="7" ViewCount="602" Body="&lt;p&gt;What is smart beta, alternative index, factor investing? Are they basically the same thing? Construct a benchmark index using schema other than market cap?&lt;/p&gt;&#xA;" OwnerUserId="19188" LastActivityDate="2017-05-26T18:47:23.443" Title="What is smart beta, alternative index, factor investing?" Tags="&lt;quant-trading-strategies&gt;&lt;portfolio&gt;&lt;asset-allocation&gt;&lt;tactical-asset-allocation&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23212" PostTypeId="2" ParentId="23210" CreationDate="2016-02-10T14:20:56.577" Score="5" Body="&lt;p&gt;check this out &lt;a href=&quot;https://github.com/manahl/arctic/commit/31021e7728a077100857bcf01f139cd937e0bb82&quot; rel=&quot;noreferrer&quot;&gt;Arctic&lt;/a&gt;. It's a Man AHL developed Mango DB for store their financial time series. Claimed to be really good. But i haven't try myself.&lt;/p&gt;&#xA;" OwnerUserId="19188" LastActivityDate="2016-02-10T14:20:56.577" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23213" PostTypeId="2" ParentId="23211" CreationDate="2016-02-10T14:47:46.833" Score="6" Body="&lt;p&gt;In recent years there has been much attention given to defining indexes other than market-cap based indices. While market-cap based indices approximate the theoretical Market Portfolio enshrined in textbooks, some people believe we could do better than that. One popular idea is that &quot;market indexes overweight the most overvalued stocks&quot;, though this is controversial. Thus a desire for Alternative Indexes. (Note: an alternative index will have higher trading costs than a market index, so it is not clear which is better).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several kinds of Alternative Indexes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some indexes overweight certain factors (such as Momentum, Value, Small Cap, Low Vol, etc.) separately or in combination&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some indexes called Fundamental indexes are based on objective company characteristics such as Sales or Aggregate dividends, that don't take market price into account.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A clever marketing name Smart Beta has become popular. This is somewhat disliked by academics such as William Sharpe, who find it misleading or outright silly (and I agree). These funds are generally based on multiple factors. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Investment firms that have created products along these lines include: Research Affiliates, Invesco, iShares, TOBAM, Wisdom Tree, AQR, GSAM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally it should be noted that Factor Investing is an older and more general idea than this. It goes back to the APT (Arbitrage Pricing Theory) of Ross (1976) and has been used in many different applications, not just building better indexes.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-02-10T15:10:44.200" LastActivityDate="2016-02-10T15:10:44.200" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23214" PostTypeId="1" CreationDate="2016-02-10T14:53:13.427" Score="3" ViewCount="2037" Body="&lt;p&gt;I was studying about the interest rate term structures and i came across term structure model with (and without) drift.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am really unsure about what this drift is in this equation for term structure model. &#xA;$$dr=\lambda dt + \sigma dw$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the equation above $\lambda$ is the drift factor and $\lambda dt$ is the drift. I have a very confusing explanation of drift which is along the lines of interest rates are moved in the future by some factor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone give me an explanation of drift. An example associated with it would be ideal. Thanks!&lt;/p&gt;&#xA;" OwnerUserId="19401" LastEditorUserId="16991" LastEditDate="2016-02-10T20:04:43.123" LastActivityDate="2016-02-10T20:04:43.123" Title="What is drift in interest rate term structure model" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;term-structure&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23215" PostTypeId="2" ParentId="23214" CreationDate="2016-02-10T15:45:25.797" Score="2" Body="&lt;p&gt;Many term structure models-both single-factor and multifactor imply dynamics&#xA;for the short-term riskless rate $r$ that can be nested within the following&#xA;stochastic differential equation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dr = (\alpha + \beta r)dt + \sigma r^\gamma dZ. $ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;These dynamics imply that the conditional mean and variance of changes in&#xA;the short-term rate depend on the level of $r$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On your case we have $\alpha = \lambda$ and $\beta=\gamma=0$, and the model simplifies to the one on Merton (1973). So $\lambda$ is just capturing the growth over time of the interest rate.  If there was no uncertainty, it would mean that interest rates would grow forever. Usually we don't see this in the data that's why most models haave a $\beta &amp;lt; 0$ which implies that interest rates are mean reverting.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2016-02-10T15:45:25.797" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23216" PostTypeId="2" ParentId="23197" CreationDate="2016-02-10T16:04:18.107" Score="3" Body="&lt;p&gt;Your formula for $p$ is $$p = \frac{e^{{(\alpha - \delta})h} - d}{u - d},$$&#xA;where &lt;strong&gt;$\alpha$ is&lt;/strong&gt; &lt;strong&gt;not expected return on stock but continuous risk free rate&lt;/strong&gt;, i.e. 1%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use $\alpha$ as 1%, you will get $p=0.009125828 $ which is within $[0,1]$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; With the information given in the question, it must satisfy following equality: &#xA;$$S_0e^{\alpha - \delta}=uS_0p+dS_0(1-p)$$&#xA;where $S_0$ is initial price. Solving above equation provide $p$=1.25. This indicate that information provided in the question is incorrect. Either, your expected price after 1 year($S_0e^{\alpha - \delta}$) must be within $[S_0u,S_0d]$, so require change in $\alpha$ or $u$ must be sufficiently large such that $uS_0 &amp;gt; S_0e^{\alpha - \delta}$. &lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="16991" LastEditDate="2016-02-11T17:20:41.883" LastActivityDate="2016-02-11T17:20:41.883" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23218" PostTypeId="1" AcceptedAnswerId="23225" CreationDate="2016-02-10T16:36:42.383" Score="1" ViewCount="98" Body="&lt;p&gt;I'm currently working on the Quantitative Finance course offered on &lt;a href=&quot;https://www.coursera.org/learn/wharton-quantitative-modeling&quot; rel=&quot;nofollow noreferrer&quot;&gt;Coursera&lt;/a&gt; by Wharton and in one example it states that &quot;through calculus, one can obtain the optimal value of price when p(opt)=(c*b)/(1+b) where c is the production cost and b is the exponent in the power function.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it fails to explain how that is so? Could someone here please enlighten me? My logic below didn't work out...&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;in my understanding profit max is when MR-MC=0, &lt;/li&gt;&#xA;&lt;li&gt;R=QP=(60000P^(-2.5))*P&lt;/li&gt;&#xA;&lt;li&gt;Pmax=MR-2=(dR/dQ)-2=(-90000P^(-2.5))-2&lt;/li&gt;&#xA;&lt;li&gt;so Pmax = (-1/45000)^(-2/5) but it doesn't :( -- answer given is 3.33&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(Apologies for poor formatting, I tried to LaTeX but I don't think it works here? Or maybe I just didn't do it correctly...)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[edit: for the sake of clarity, I thought I'd just include print screens]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/T4oti.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/T4oti.png&quot; alt=&quot;print screen&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19403" LastEditorUserId="19403" LastEditDate="2016-02-10T17:09:58.170" LastActivityDate="2017-03-07T12:55:03.350" Title="General Equation for price optimisation where cost is constant" Tags="&lt;pricing&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23219" PostTypeId="2" ParentId="23203" CreationDate="2016-02-10T16:50:19.860" Score="2" Body="&lt;p&gt;&lt;strong&gt;First understand that following &lt;em&gt;proposition are based on CAPM&lt;/em&gt;.&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To understand how price and expected returns are related you can read following &lt;a href=&quot;https://quant.stackexchange.com/questions/19200/how-is-implied-volatility-derived/19201#19201&quot;&gt;&lt;strong&gt;answer&lt;/strong&gt;&lt;/a&gt;. It answer to different question but example describe in this answer will let you to understand how both are related to each other. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now come to your second confusion&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;.....that the amount of that investment in portfolio M is proportional to&#xA;  the amount of that investment&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;First focus what is market portfolio under CAPM?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Market portfolio is sum over, or aggregate, of the portfolios held by each individual in the economy&lt;/strong&gt;. Lending and borrowing will cancel out (because each lender has a corresponding borrower), and market portfolio will comprise only the value of the aggregate risky portfolio, equal to the entire wealth of the economy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;CAPM assumes each investor hold similar portfolio i.e. market portfolio. So each investor hold same proportion of every security in their portfolio. This means that if the weight of Wipro stock in each common risky portfolio is 1%, then Wipro also will constitute 1% of the market portfolio (common sense). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the same thing that author want to convey from his statement. &lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-02-10T16:50:19.860" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23220" PostTypeId="1" CreationDate="2016-02-10T20:14:11.967" Score="0" ViewCount="364" Body="&lt;p&gt;Or a source that will allow me to just get the list of dates into a program, I'm trying to do this in python but I want it to be able to figure out the next expiration automatically, or something like Quandl where it can just pull the data.&lt;/p&gt;&#xA;" OwnerUserId="17944" LastActivityDate="2016-02-11T14:18:12.247" Title="What is the formula that determines when VIX futures expire?" Tags="&lt;volatility&gt;&lt;programming&gt;&lt;implied-volatility&gt;&lt;python&gt;&lt;vix&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23221" PostTypeId="2" ParentId="23220" CreationDate="2016-02-10T21:37:03.630" Score="3" Body="&lt;p&gt;They expire 30 days before the expiration of the S&amp;amp;P monthly options. The latter usually expire on the third Friday of the month (however, in rare cases the S&amp;amp;P opts. expire on Thursday because the Friday is a holiday; the last time it happened was April 17, 2014 since April 18 2014 was a NYSE holiday).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Neglecting the holiday thing, the expiration dates can easily be found with excel. (Given a month, you find the date of the third friday and then you subtract 30). To do the calculation perfectly you would need a table of NYSE holidays, which is available on the nyse web site.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For weekly vix futures (which started trading recently), it is the same logic, but where you look at all Fridays except the third, which was already used for the monthlies; and you subtract 30. Again the holiday thing applies; for example March 25, 2016 (4th Friday of March) will be a holiday so you use Thursday March 24, subtract 30 and get February 23, 2016 as the next &quot;week4&quot; expiration&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-02-11T14:18:12.247" LastActivityDate="2016-02-11T14:18:12.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23222" PostTypeId="1" AcceptedAnswerId="23223" CreationDate="2016-02-11T01:27:30.217" Score="1" ViewCount="589" Body="&lt;p&gt;In the binomial model, how that the Delta of a call option $\Delta^{call}$ and the Delta of a put option $\Delta^{put}$ with the same maturity and strike satisfy &#xA;$$\Delta^{call}_t - \Delta^{put}_t = 1, \ \ \text{for all} \ \ t = 0,\ldots, T-1$$ &#xA;Is this result model-independent? Hint: put-call parity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Excuse the grammatical mistakes of the question, English is not my professors first language. I don't understand what he means in asking if the model is independent? Any suggestions is greatly appreciated.  &lt;/p&gt;&#xA;" OwnerUserId="19002" LastActivityDate="2016-02-20T04:03:45.923" Title="Put-Call Parity Application" Tags="&lt;options&gt;&lt;mathematics&gt;&lt;put-call-parity&gt;&lt;finance-mathematics&gt;" AnswerCount="3" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="23223" PostTypeId="2" ParentId="23222" CreationDate="2016-02-11T03:40:47.037" Score="5" Body="&lt;p&gt;First, we have $P(t)+S(t)=C(t)+B(t,T)\cdot K$, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, $\frac{\partial P(t)}{\partial S(t)} + \frac{\partial S(t)}{\partial S(t)} = \Delta^{\text{put}}_{t}+1$ and $\frac{\partial C(t)}{\partial S(t)} + \frac{\partial [B(t,T)\cdot K]}{\partial S(t)} = \Delta^{\text{call}}_{t}+0$. Finaly, $\Delta^{\text{call}}_{t}-\Delta^{\text{put}}_{t}=1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This relationship is model-free, in sense, to derive this result we didn't use that we are in binomial model :) So the result is model-idependant.&lt;/p&gt;&#xA;" OwnerUserId="3571" LastActivityDate="2016-02-11T03:40:47.037" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23224" PostTypeId="2" ParentId="10905" CreationDate="2016-02-11T03:53:26.680" Score="4" Body="&lt;p&gt;QuantConnect and Quantopian were the first algorithmic trading platforms that became available and they are the most advanced (even though they need a lot more work for a professional trader, they are a good starting point).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is an emerging market, lots of startups are rising. Nowadays new platforms are available, for example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;www.cloud9trader.com&lt;/li&gt;&#xA;&lt;li&gt;alta5.com&lt;/li&gt;&#xA;&lt;li&gt;quantiacs.com&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Every platform has is own characteristics, but all in all they are all work in progress. it will take few more years before being able to have a stable trading platform that you can rely on and that offers all you need for professional trading.&lt;/p&gt;&#xA;" OwnerUserId="16907" LastActivityDate="2016-02-11T03:53:26.680" CommentCount="0" CommunityOwnedDate="2016-02-11T03:53:26.680" ContentLicense="CC BY-SA 3.0" />
  <row Id="23225" PostTypeId="2" ParentId="23218" CreationDate="2016-02-11T04:50:23.783" Score="0" Body="&lt;p&gt;OK solved my own problem! The issue was assuming MC = 2... instead, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/9oPjs.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/9oPjs.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/kUMUe.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/kUMUe.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and when you set that equal to zero you get... p = 10/3 :)&lt;/p&gt;&#xA;" OwnerUserId="19403" LastActivityDate="2016-02-11T04:50:23.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23228" PostTypeId="2" ParentId="22967" CreationDate="2016-02-11T12:00:56.650" Score="2" Body="&lt;p&gt;Stock / ETF at 5-minute intervals can be downloaded from Yahoo Finance. See the code below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;from urllib import urlretrieve&#xA;import numpy as np, pandas as pd, sys&#xA;import datetime as dt, requests&#xA;import datetime, re, StringIO&#xA;&#xA;symbol = sys.argv[1]&#xA;&#xA;url='http://chartapi.finance.yahoo.com/instrument/1.0/%s/chartdata;type=quote;range=3d/csv' % symbol&#xA;response = requests.get(url)&#xA;response_body = response.content&#xA;content = StringIO.StringIO(response_body)&#xA;&#xA;res = []&#xA;for x in content.readlines():&#xA;    if &quot;:&quot; in x: continue&#xA;    res.append(x.strip().split(','))&#xA;&#xA;df = pd.DataFrame(res, columns=['Timestamp','close','high','low','open','volume'])&#xA;df.Timestamp = df.Timestamp.map(lambda x: datetime.datetime.fromtimestamp(float(x)))&#xA;&#xA;df.to_csv(&quot;/tmp/%s-3d.csv&quot; % symbol,index=None)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The complete script can be found in my &lt;a href=&quot;https://github.com/burakbayramli/quant_at&quot; rel=&quot;nofollow&quot;&gt;quant_at&lt;/a&gt; project at Github, see &lt;code&gt;data/hft.py&lt;/code&gt;. There are download scripts for equities, futures, ETFs as well.  &lt;/p&gt;&#xA;" OwnerUserId="616" LastEditorUserId="616" LastEditDate="2016-05-26T09:22:14.170" LastActivityDate="2016-05-26T09:22:14.170" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23229" PostTypeId="2" ParentId="1557" CreationDate="2016-02-11T12:07:32.357" Score="2" Body="&lt;p&gt;Maybe you like working with coskewness. But it is not needed if you just want to estimate the skewness of the portfolio.&#xA;If you have retunr times serise $(r^i_t)_{t=1}^T$ for each asset $i$ and the weights $w_i$ that these assets have in your portfolio then you can form&#xA;$$&#xA;r_t = \sum_{i=1}^6 w_i r^i_t \quad \text{for each }  t,&#xA;$$&#xA;and you simple estimate all moments on $(r_t)_{t_1}^T$. The solution will be the same as any matrix operation. Eg the variance is either&#xA;$$&#xA;VAR(r_t)&#xA;$$&#xA;or equivalently (!)&#xA;$$&#xA;w^T \Sigma w&#xA;$$&#xA;where $\Sigma$ is the covariance matrix of those 6 assets. The numbers will be the same. If you need comoments then you do so by using expressions of the form&#xA;$$&#xA;E[r_t^k*(r_t^i)^m],&#xA;$$&#xA;for some integer $k$ and $m$.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2016-02-12T06:52:06.157" LastActivityDate="2016-02-12T06:52:06.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23230" PostTypeId="1" CreationDate="2016-02-11T13:28:19.833" Score="0" ViewCount="3465" Body="&lt;p&gt;Good day, I gave following inputs of Libor rates :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ON  0.3731&#xA;1W  0.3939&#xA;1M  0.4265&#xA;2M  0.5148&#xA;3M  0.6176&#xA;6M  0.8655&#xA;1Y  1.1336&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I build zero-rate curve ? &lt;/p&gt;&#xA;" OwnerUserId="17967" LastActivityDate="2017-05-19T05:04:18.920" Title="Zero rate curve USD Libor" Tags="&lt;yield-curve&gt;&lt;zero-coupon&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23233" PostTypeId="5" CreationDate="2016-02-11T17:56:35.597" Score="0" Body="&lt;p&gt;Discounted cash flow (DCF) is a valuation method used to estimate the attractiveness of an investment opportunity. DCF analysis uses future free cash flow projections and discounts them to arrive at a present value estimate, which is used to evaluate the potential for investment. If the value arrived at through DCF analysis is higher than the current cost of the investment, the opportunity may be a good one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Discounted cash flow models are powerful, but they are only as good as their imports. As the axiom goes, &quot;garbage in, garbage out&quot;. Small changes in inputs can result in large changes in the estimated value of a company, and every assumption has the potential to erode the estimate's accuracy.&lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="16991" LastEditDate="2016-02-12T06:49:08.760" LastActivityDate="2016-02-12T06:49:08.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23234" PostTypeId="4" CreationDate="2016-02-11T17:56:35.597" Score="0" Body="In finance, discounted cash flow (DCF) analysis is a method of valuing a project, company, or asset using the concepts of the time value of money. All future cash flows are estimated and discounted by using cost of capital to give their present values (PVs)." OwnerUserId="16991" LastEditorUserId="16991" LastEditDate="2016-02-12T06:49:13.207" LastActivityDate="2016-02-12T06:49:13.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23235" PostTypeId="1" AcceptedAnswerId="23257" CreationDate="2016-02-11T18:46:54.190" Score="0" ViewCount="285" Body="&lt;p&gt;Consider one period Arrow-Debreu model with $N = 2$ and $M = 4$ shown in Figure 3.5 and take $R = 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a.) Show that any risk neutral probability $\hat{\pi} = (\hat{\pi}_1, \hat{\pi}_2, \hat{\pi}_3, \hat{\pi}_4)$ satisfies &#xA;$$\begin{cases}&#xA;\hat{\pi}_1 + \hat{\pi}_2 = \frac{1}{2}\\&#xA;\hat{\pi}_3 + \hat{\pi}_4 = \frac{1}{2}\\&#xA;\hat{\pi}_1 + \hat{\pi}_3 = \frac{1}{2}\\&#xA;\end{cases}$$&#xA;b.) Recall the notion of independent random variables. Find a risk neutral probability that makes the random variables of the price of two assets independent. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Figure: &lt;a href=&quot;https://i.stack.imgur.com/3OUBP.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/3OUBP.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Attempted solution for a.) $$p_1 = \frac{D_1 + D_2}{2} = D_1\pi_1 + D_2\pi_2 + D_1\pi_3 + D_2\pi_4$$ So, $$p_1 = \frac{D_1 + D_2}{2} = D_1(\pi_1 + \pi_3) + D_2(\pi_2 + \pi_4)$$ Now for $p_2$ we have $$p_2 = \frac{D_1 + D_2}{2} = D_1\pi_1 + D_1\pi_2 + D_2\pi_3 + D_2\pi_4$$ and so $$p_2 = \frac{D_1 + D_2}{2} = D_1(\pi_1 + \pi_2) + D_2(\pi_3 + \pi_4)$$ by comparing the coefficients for $D_1$ and $D_2$ and given that $R = 0$ implies that $\hat{\pi} = \pi$ we can deduce that $$\begin{cases}&#xA;\hat{\pi}_1 + \hat{\pi}_2 = \frac{1}{2}\\&#xA;\hat{\pi}_3 + \hat{\pi}_4 = \frac{1}{2}\\&#xA;\hat{\pi}_1 + \hat{\pi}_3 = \frac{1}{2}\\&#xA;\end{cases}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not sure if this is rigorous enough, any suggestions is greatly appreciated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Attempt for b.) Assume $p_1$ and $p_2$ are dependent. Then the vector set $D_1$ and $D_2$ contains only the zero vector by definition of dependence. But this is a contradiction to the fact that &#xA; $$\begin{cases}&#xA;\hat{\pi}_1 + \hat{\pi}_2 = \frac{1}{2}\\&#xA;\hat{\pi}_3 + \hat{\pi}_4 = \frac{1}{2}\\&#xA;\hat{\pi}_1 + \hat{\pi}_3 = \frac{1}{2}\\&#xA;\end{cases}$$&#xA;Hence $p_1$ and $p_2$ must be independent.&lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="19002" LastEditDate="2016-02-12T20:48:21.430" LastActivityDate="2016-02-12T20:48:21.430" Title="Arrow-Debreu Model and Risk-Neutral Probabilities" Tags="&lt;mathematics&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23236" PostTypeId="2" ParentId="7568" CreationDate="2016-02-11T18:49:07.363" Score="5" Body="&lt;p&gt;Each vendor has their own symbology universe and each exchange, market, or country may have their own standard identifiers.  To date the majority of identifiers have also been dynamic, i.e. when a company renames, merges, relocates, the identifier may change.  Some symbology systems operate on different levels of granularity whereby prices can be filtered to the exchange rather than just the market.  This means you may need a tuple of date, exchange, and identifier to maintain a symbology master.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Standard practice in the U.S. has been to maintain symbology master using agnostic identifiers such as ISIN, SEDOL and CUSIP.  Each market data vendor has some form of service for which these identifiers can be converted to their own form.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Continuing the example of Apple Inc,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Ticker:   AAPL&#xA;Exchange: &amp;lt;US Composite&amp;gt;&#xA;RIC:      AAPL.O&#xA;PermID:   4295905573&#xA;ISIN:     US0378331005&#xA;CUSIP:    037833100&#xA;SEDOL:    2046251&#xA;&#xA;Exchange: Nasdaq (US primary)&#xA;RIC:      AAPL.OQ&#xA;PermID:   55835312773&#xA;SEDOL:    2046251 (same)&#xA;&#xA;Exchange: Arca&#xA;RIC:      AAPL.P&#xA;PermID:   55837087061&#xA;SEDOL:    2046251 (same)&#xA;&#xA;Exchange: &amp;lt;German Composite&amp;gt;&#xA;RIC:      AAPL.DEU&#xA;PermID:   21474884975&#xA;SEDOL:    4033819&#xA;&#xA;Exchange: Berlin&#xA;RIC:      AAPL.BE&#xA;PermID:   55836323023&#xA;SEDOL:    4033819 (same as German composite)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Both Bloomberg and Reuters are making attempts at permanent identifiers with &lt;a href=&quot;http://bsym.bloomberg.com/sym/&quot; rel=&quot;noreferrer&quot;&gt;Bloomberg Open Symbology&lt;/a&gt; and &lt;a href=&quot;https://permid.org&quot; rel=&quot;noreferrer&quot;&gt;Open PermID&lt;/a&gt; respectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Programmatically you have options with Bloomberg as listed in the comments by @assylias and similarly Thomson Reuters has new features with Eikon.  For larger apps one would have to look at developing a dedicated symbology service that can be updated and managed independently.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have written an &lt;a href=&quot;https://github.com/steve-o/Kigoron&quot; rel=&quot;noreferrer&quot;&gt;example service&lt;/a&gt; for Thomson Reuters TREP that uses Tick History or the Data Scope Select service for sourcing the Reuters universe.  One re-uses any existing TREP API to resolve the symbology then can pull in the underlying instrument, example viewing of the data:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/AKRvg.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/AKRvg.jpg&quot; alt=&quot;example mapping ISIN code and pulling in additional meta-data&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19419" LastEditorUserId="19419" LastEditDate="2016-02-11T19:04:02.817" LastActivityDate="2016-02-11T19:04:02.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23237" PostTypeId="2" ParentId="23196" CreationDate="2016-02-11T19:08:21.340" Score="3" Body="&lt;p&gt;For question a). From the assumptions, in particular, that $R=0$, &#xA;\begin{align*}&#xA;\pi_l + \pi_m + \pi_u &amp;amp;=1\\&#xA;\frac{1}{2}\pi_l + \pi_m + 2\pi_u&amp;amp;=1.&#xA;\end{align*}&#xA;Set $\pi_m=x$, and solve for $\pi_l$ and $\pi_u$,&#xA;\begin{align*}&#xA;\pi_l &amp;amp;= \frac{2}{3}(1-x)\\&#xA;\pi_m &amp;amp;= x\\&#xA;\pi_u &amp;amp;= \frac{1}{3}(1-x),&#xA;\end{align*}&#xA;where $0&amp;lt;x&amp;lt;1$. The option price is then given by&#xA;\begin{align*}&#xA;C &amp;amp;= \pi_l (l-K)^+ + \pi_m (m-K)^+ + \pi_u (u-K)^+\\&#xA;&amp;amp;=\frac{1}{3}(1-x),&#xA;\end{align*}&#xA;which is in the range of $(0,\, 1/3)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For question b). Consider a super-replicating portfolio with $a$ units share and $b$ units cash. Then&#xA;\begin{align*}&#xA;a\, l + b &amp;amp;\ge (l-K)^+\\&#xA;a\, m + b &amp;amp;\ge (m-K)^+\\&#xA;a\, u + b &amp;amp;\ge (u-K)^+.&#xA;\end{align*}&#xA;That is, &#xA;\begin{align*}&#xA;a\, l + b &amp;amp;\ge 0\\&#xA;a\, m + b &amp;amp;\ge 0\\&#xA;a\, u + b &amp;amp;\ge 1.&#xA;\end{align*}&#xA;Since $m &amp;gt; l$, we can assume that&#xA;\begin{align*}&#xA;a\, l + b &amp;amp;= 0\\&#xA;a\, u + b &amp;amp;= 1.&#xA;\end{align*}&#xA;That is, $a = 2/3$ and $b=-1/3$. This is the smallest portfolio that dominates the option payoff, and has the value&#xA;\begin{align*}&#xA;\pi_l(a\, l+b) + \pi_m(a\, m+b)+ \pi_u(a\, u+b) &amp;amp;=\frac{1}{3}.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the sub-replication, we find the largest portfolio dominated by the option payoff. That is,&#xA;\begin{align*}&#xA;a\, l + b &amp;amp;\le (l-K)^+\\&#xA;a\, m + b &amp;amp;\le (m-K)^+\\&#xA;a\, u + b &amp;amp;\le (u-K)^+,&#xA;\end{align*}&#xA;or&#xA;\begin{align*}&#xA;a\, l + b &amp;amp;\le 0\\&#xA;a\, m + b &amp;amp;\le 0\\&#xA;a\, u + b &amp;amp;\le 1.&#xA;\end{align*}&#xA;Since $l &amp;lt; m$, we assume that&#xA;\begin{align*}&#xA;a\, m + b &amp;amp;= 0\\&#xA;a\, u + b &amp;amp;= 1.&#xA;\end{align*}&#xA;Then $a=1$ and $b=-1$. This is the largest portfolio that is dominated by the option payoff, and has the value&#xA;\begin{align*}&#xA;\pi_l(a\, l+b) + \pi_m(a\, m+b)+ \pi_u(a\, u+b) &amp;amp;=0.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Proof of the dominating property for the super-replication. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Assume that there is another portfolio such that&#xA;\begin{align*}&#xA;a'\, l + b' &amp;amp;\ge (l-K)^+=0\\&#xA;a'\, m + b' &amp;amp;\ge (m-K)^+=0\\&#xA;a'\, u + b' &amp;amp;\ge (u-K)^+=1.&#xA;\end{align*}&#xA;Then, by our choice,&#xA;\begin{align*}&#xA;\frac{1}{2}a' + b' &amp;amp;\ge \frac{1}{2}a + b=0 \tag{1}\\&#xA;2a' + b' &amp;amp;\ge 2a + b=1.\tag{2}&#xA;\end{align*}&#xA;We show that &#xA;\begin{align*}&#xA;a'+b' \ge a+b = \frac{1}{3}.\tag{3}&#xA;\end{align*}&#xA;Assuming that  $a'+b' &amp;lt; \frac{1}{3}.$ Then, from (2), &#xA;\begin{align*}&#xA; \frac{2}{3} -b' &amp;gt; 2(a'+b')-b' \ge 1.&#xA;\end{align*}&#xA;That is, $b'&amp;lt;-1/3$. Consequently,&#xA;\begin{align*}&#xA;\frac{1}{2}a' + b' &amp;amp;= \frac{1}{2}(a' + b') + \frac{1}{2} b' \\&#xA;&amp;amp;&amp;lt;0,&#xA;\end{align*}&#xA;which is contradictory to (1) above.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-02-11T21:41:05.577" LastActivityDate="2016-02-11T21:41:05.577" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23238" PostTypeId="2" ParentId="23230" CreationDate="2016-02-11T19:20:19.550" Score="1" Body="&lt;p&gt;The short answer is - you need more data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to build a full zero-rate swap curve, typically these curves go out to 30 years. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, the front of the curve is made from LIBOR rates, which you have. Typically you don't see practitioners use anything past the 3M point but some will use up to the 6M point. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the 2nd part of the curve, from 6M to at least 2-years, you will need to imply rates from Eurodollar futures. There are a few places to get contract prices for these (&lt;a href=&quot;http://www.cmegroup.com/trading/interest-rates/stir/eurodollar.html&quot; rel=&quot;nofollow&quot;&gt;CME&lt;/a&gt; and &lt;a href=&quot;https://www.quandl.com&quot; rel=&quot;nofollow&quot;&gt;Quandl&lt;/a&gt; being two of them).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The the final part of the curve you will need to imply zero rates using par (at the money) fixed-float swaps. I don't know of a great place to get these rates other than bloomberg, although Quandl (mentioned above) may have a datasource.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you have data, there are many answers to curve-building questions such as this. &lt;/p&gt;&#xA;" OwnerUserId="16600" LastActivityDate="2016-02-11T19:20:19.550" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="23239" PostTypeId="2" ParentId="16935" CreationDate="2016-02-11T19:23:53.110" Score="0" Body="&lt;p&gt;Generally the symbology should be &lt;code&gt;&amp;lt;exchange mnemonic&amp;gt;:&amp;lt;ticker symbol&amp;gt;&lt;/code&gt; for Google and &lt;code&gt;&amp;lt;ticker symbol&amp;gt;.&amp;lt;exchange letter&amp;gt;&lt;/code&gt; for Reuters.  You will have to manually find the list of exchange mnemonics for each.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that till recently NYSE and NASDAQ had an agreement for one to use 3-letter tickers and the other 4-letter tickers to help distinguish the markets apart.  Today this means the same ticker symbol may appear on each exchange but represent a different company, Reuters uses the mnemonic &lt;code&gt;.K&lt;/code&gt; for when NYSE tickers would overlap.&lt;/p&gt;&#xA;" OwnerUserId="19419" LastActivityDate="2016-02-11T19:23:53.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23240" PostTypeId="1" AcceptedAnswerId="24460" CreationDate="2016-02-11T19:30:38.523" Score="4" ViewCount="541" Body="&lt;p&gt;I have only basic limited knowledge about financial derivatives and I did not find exactly what I was searching for. I found open end turbo call, knock outs, but I am searching for this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Underlying should be a regular &quot;famous&quot; stock e.g. in German DAX, let's consider BMW.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on this underlying I am searching for a derivative which does the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;In a long position I want to have a leverage factor of about 5 to 20.&#xA;So if the stock increases by one unit (percent) the the value of my&#xA;position should increase by factor 5 resp. factor 20 (percent). If it&#xA;decreases of course I loose by this factor.&lt;/li&gt;&#xA;&lt;li&gt;Second I want to have a constant factor. This factor should not&#xA;change and stay stable over the complete investment time.&lt;/li&gt;&#xA;&lt;li&gt;Third I want to have it open end. So I want to hold it for quite a&#xA;long time and stay flexible to be able to sell whenever I want, lets say quite long means 2-5 years.&lt;/li&gt;&#xA;&lt;li&gt;It should have no knock-out.&lt;/li&gt;&#xA;&lt;li&gt;Ideally there shouldn't be any payments in between. So I buy and I&#xA;sell, but no dividend or so. But this is not so important.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;How is this called? Can you give me a tradeable example for BMW?&lt;/p&gt;&#xA;" OwnerUserId="5078" LastEditorUserId="5078" LastEditDate="2016-02-11T19:35:59.597" LastActivityDate="2016-02-22T20:04:22.267" Title="How is this financial product called?" Tags="&lt;equities&gt;&lt;derivatives&gt;" AnswerCount="7" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23241" PostTypeId="1" AcceptedAnswerId="23243" CreationDate="2016-02-11T19:53:06.463" Score="-1" ViewCount="304" Body="&lt;p&gt;I would like to price options (call, put,, butterfly) with monte-carlo method, but actually I need the expression of the butterflay payoff;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you ^please help me !&lt;/p&gt;&#xA;" OwnerUserId="17490" LastActivityDate="2016-02-11T20:08:16.497" Title="Payoff of a butterfly c++" Tags="&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;call&gt;&lt;put&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23242" PostTypeId="1" CreationDate="2016-02-11T19:58:28.687" Score="2" ViewCount="903" Body="&lt;h2&gt;Is it possible to download stock-data countrywise with quantmod package for R ?&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Hi, I'm wondering if it's possible to download equities countrywise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say i want all data from the Finnish market. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;All Finnish stock symbols ends with .HE, so what I want is &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;getSymbols(&quot;all stocks that ends with .HE&quot;, ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks !&lt;/p&gt;&#xA;" OwnerUserId="19265" LastActivityDate="2016-11-05T14:25:54.983" Title="Is it possible to download stock-data countrywise with quantmod package for R?" Tags="&lt;equities&gt;&lt;r&gt;&lt;finance&gt;&lt;quantmod&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23243" PostTypeId="2" ParentId="23241" CreationDate="2016-02-11T20:08:16.497" Score="3" Body="&lt;p&gt;A butterfly in general has a payoff of the form&#xA;\begin{align*}&#xA;(X_T-K_c)^+ + (K_p-X_T)^+-(X_T-K_{atm})^+-(K_{atm}-X_T)^+,&#xA;\end{align*}&#xA;where $X_T$ is the asset value at maturity $T$, while $K_c$, $K_p$, and $K_{atm}$ are strike levels.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-02-11T20:08:16.497" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23244" PostTypeId="1" AcceptedAnswerId="23265" CreationDate="2016-02-11T21:13:40.537" Score="0" ViewCount="89" Body="&lt;p&gt;Background information: Consider a European contingent claim with payoff $V(S_T)$, where $V: \mathbb{R}_+\rightarrow \mathbb{R}$ is a function which assigns a value to the payoff based on the price of the asset at terminal time $T$. Such European contingent claims are called Markovian claims. The claim is that the price $V_0$ of the European contingent claim $V(S_T)$ at time 0 is given by $$V_) = \frac{1}{(1+R)^T}\hat{\mathbb{E}}[V(S_T)]$$ provided that there is no arbitrage. Here $\hat{\mathbb{E}}$ is the expectation with respect to the (unique) risk neutral probability. As a free bonus we construct a replicating portfolio through a backward recursive scheme and show that at state $i$ at time $t$, the price $V_t^{i}$ of the European contingent claim is a function of the price of the underlying asset $S_t(i)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First notice that the price of the contingent claim at maturity time $T$ is equal $V(S_T(i))$ if the state $i$ occurs. Then, assume that the price of contingent claim $V_{t+1}^j$ is known at time $t+1$ for all states $j = 0,\ldots,t + 1 $ and is a function $V_{t+1}$ of $S_{t+1}(j)$, i.e. $V_{t+1}(S_{t+1}(j))$. Conditional on the state $i$ at time $t$, the state of the market at time $t+1$ is either $i+1$ or $i$. Therefore, we can use the result of the single period binomial tree to conclude that $$V_t^i = \frac{1}{1+R}(V_{t+1}^{i+1}\hat{\pi}_u + V_{t+1}^{i}\hat{\pi}_l) = \frac{1}{1+R}\hat{\mathbb{E}}[V_{t+1}|S_t = S_t(i)]$$ Here we used the fact the no arbitrage implies the existence of risk neutral probabilities with conditional probabilities $\hat{\pi}_u = \frac{1+R-l}{u-l}$ and $\hat{\pi}_l = \frac{u-1-R}{u-l}$ given state $i$ at time $t$. Notice that the above expression also suggests that $V_t^j$ is a function of $S_t(j)$, $$V_t(S);= \frac{1}{1+R}\hat{\mathbb{E}}[V_{t+1}|S_t = S] \ \ \ \ \ (1.6)$$ To replicate the payoff at time $t+1$, one needs to keep $$\frac{V_{t+1}^{i+1} - V_{t+1}^{i}}{S_{t+1}(i+1) - S_{t+1}(i)} = \frac{V_{t+1}(S_t(i)u) - V_{t+1}(S_t(i)l)}{S_t(i)(u-l)}$$&#xA;units of risky asset and $$\frac{uV_{t+1}^i - lV_{t+1}^{i+1}}{(u-l)(1+R)} = \frac{uV_{t+1}(S_t(i)l) - lV_{t+1}(S_t(i)l)}{(u-l)(1+R)}$$ risk free bonds in the replicating portfolio. In other words, the replicating portfolio is a self-financing portfolio by (1.1) with $w_0 = V_0$ and portfolio strategy given by $\Delta_0(S_0),\ldots,\Delta_{T-1}(S_{T-1})$ $$\Delta_t(S):= \frac{V_{t+1}(Su) - V_{t+1}(Sl)}{S(u-l)} \ \ \ \ \ \ (1.7)$$ The number of units of risky asset in replicating portfolio, given by (1.7), is called the Delta of the contingent claim at time $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the replicating portfolio for a European Markovian option with payoff $V(S_T)$, let $Y_t := S_T\Delta_t(S_t)$ be the amount of investment on the underlying asset. Then, use (1.6) and (1.7) to show $$Y_t = \frac{1}{1 + R}\hat{\mathbb{E}}[Y_{t+1}|S_t], \ \ \text{for} \ t = 0,\ldots, T-1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Attempted solution: Assume we have a replicating portfolio for a European Markovian option with pay off $V(S_T)$, let $$Y_t := S_t\Delta_t(S_t)$$&#xA;Now we know that $$\Delta_t(S_t) = \frac{V_{t+1}(S_tu) - V_{t+1}(S_tl)}{S_t(u-l)}$$ which represents the quantity of units of the risky asset we need to replicate. Also, we need  $$\frac{uV_{t+1} - lV_{t+1}}{(u-l)(1+R)} = \frac{uV_{t+1}(S_tl) - lV_{t+1}(S_tl)}{(u-l)(1+R)}$$ risk free bonds in the replicating portfolio as well. These two quantities represent the replication of the pay off the investment defined by 1.6 in the book $$V_t(S) = \frac{1}{1+R}\hat{\mathbb{E}}[V_{t+1}|S_t = S]$$ Then given the fact the $Y_t = S_t\Delta_t$ then clearly $$Y_t = \frac{1}{1 + R}\hat{\mathbb{E}}[Y_{t+1}|S_t], \ \ \text{for} \ t = 0,\ldots, T-1$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure if this is correct in any way,shape, or form. Any suggestions is greatly appreciated. &lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="19002" LastEditDate="2016-02-12T03:25:52.180" LastActivityDate="2016-02-12T21:50:50.273" Title="European Markovian option" Tags="&lt;mathematics&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23245" PostTypeId="2" ParentId="23240" CreationDate="2016-02-11T21:37:17.397" Score="3" Body="&lt;p&gt;structure a bespoke total return swap where you explicitly specify the reference index, it's calculation (i.e. stock price * factor etc..), payoffs, margins etc... an example of such swap could be contract for difference (CFD).&lt;/p&gt;&#xA;" OwnerUserId="18275" LastActivityDate="2016-02-11T21:37:17.397" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23246" PostTypeId="2" ParentId="23193" CreationDate="2016-02-11T23:53:00.180" Score="1" Body="&lt;p&gt;Don't need to re-invent the wheel, I suggest you to isolate the time-consuming part of your algorithm in a c++ dll and to call it directly from Ninja trader or whatever platforms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the data here three advices:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Identify exactly the data you need (ex: if your strategy is based on bar data, you may not need higher/lower prices...) &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Always keep a large data buffer that you update at every events you are susceptible to trade.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;The most important trick&lt;/strong&gt;: if your algorithm is going through the same data several times, &lt;strong&gt;try to separate the estimation part from the decision part of your algorithm&lt;/strong&gt;. In doing so, you only need to estimate your model once (during the first test), and then you can base your next backtests on the first estimation. If it is not clear a simple example:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;First test: you have a very complex model you estimate every 5 minutes. Run it once and save the outputs in a txt file.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Next tests, you do not need to re-estimate your models, just take the outputs of the first test (from the .txt file) and apply your new parameters on it (ex: new confidence interval...). Obviously you'll save a lot of time but you need to design your algorithm in such a way you are obtaining all the relevant parameters during the first loop. This is not so easy to obtain but it worth to do it because you will be able to run a bunch of backtests in a few seconds (just require to read a txt file). Also in doing so you only need to read the data once (during the first test). In summary, your first estimation should produce outputs wich are not linked to a particular scenario but some kinds of &quot;pre-inputs&quot; to a decision model.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2016-02-12T00:04:03.057" LastActivityDate="2016-02-12T00:04:03.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23250" PostTypeId="1" AcceptedAnswerId="23264" CreationDate="2016-02-12T09:08:54.813" Score="7" ViewCount="3523" Body="&lt;p&gt;In the &lt;a href=&quot;https://en.wikipedia.org/wiki/Fama%E2%80%93French_three-factor_model&quot; rel=&quot;noreferrer&quot;&gt;Fama-French 3-factor model&lt;/a&gt; the portfolio returns are explained by &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the market&lt;/li&gt;&#xA;&lt;li&gt;the SMB factor (Small [market capitalization] Minus Big) and&lt;/li&gt;&#xA;&lt;li&gt;the HML factor (High [book-to-market ratio] Minus Low) thus &quot;value&quot; minus &quot;growth&quot; stocks.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I know that the factor world has grown by much more factors but for some reason Fama and French have started with these&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the intuition to use exactly those factors? Which behaviour do we usually expect from these factor? Doesn't small often go hand in hand with growth - would this mean that SMB and HML are (sometimes) negatively correlated?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In (some) booming markets (dot.com bubble) we can expect small companies to outperform large ones - thus SMB should perform positive.&#xA;In difficult markets companies with a sound basis (high book to market - value) could outperform those with rather high price compared to its book assets (growth) then HML could outperform. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do these thoughts make sense?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: 1) Note that factor-investing where portfolios are invested trying to track the factors became popular in recent years.&#xA;2) What about the FF-model is true after 2008?&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="12" LastEditDate="2016-02-12T20:25:08.593" LastActivityDate="2018-01-31T20:13:42.540" Title="Intuition behind Fama-French factors" Tags="&lt;capm&gt;&lt;asset-returns&gt;&lt;fama-french&gt;&lt;intuition&gt;&lt;factor-investing&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="23251" PostTypeId="2" ParentId="23250" CreationDate="2016-02-12T09:15:18.520" Score="3" Body="&lt;p&gt;Your intuition is not exactly right. &#xA;To start with often the facts that small minus big or high minus low explain the cross-section of returns is called a puzzle. It is called a puzzle precisely because there is no unifying explanation for them. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is fairly agreed among academics that the Size effect is most likely a January effect, or probably it even disappeared. &#xA;On the other hand there have been several explanations for the HML: most of them rely on supply side frictions. An example is Lettau and Wachter (2007) and another example is Zhang (2005).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit after comment below: if you are looking for factor investment strategies, there are better factors to use such as the one on Adrian, Etula, and Muir (2014), among many others. Take a look at figure 1 of their paper and Table III (where you can also check that the size factor is insignificant).&lt;/p&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="16472" LastEditDate="2016-02-12T09:34:22.817" LastActivityDate="2016-02-12T09:34:22.817" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="23253" PostTypeId="2" ParentId="23140" CreationDate="2016-02-12T10:20:43.817" Score="0" Body="&lt;p&gt;According to literature ADEH(1999) standard deviation (&amp;amp; VaR aswell) do not respect &quot;properties&quot; for coherent risk measures. (Sub-additivity etc.)&#xA;An appropriate and easy risk measure could be the Expected Shortfall (CVaR) which instead do respect these properties.&#xA;An alternative could be using the so called Spectral risk measures, which similarly to CVar are a weighted average of the worst losses (CVAr weights all them equally, instead here you can choose different weights. And like user9403 said you can relate these measures to your utility function or your risk aversion).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sorry for my english, hope it helps. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lorenz&lt;/p&gt;&#xA;" OwnerUserId="19432" LastEditorUserId="19432" LastEditDate="2016-02-12T10:26:18.880" LastActivityDate="2016-02-12T10:26:18.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23254" PostTypeId="2" ParentId="23140" CreationDate="2016-02-12T10:27:32.960" Score="0" Body="&lt;p&gt;You should take a look at this paper: &quot;&lt;a href=&quot;http://file:///C:/Users/nunoclara/Downloads/SharperRatio2-3-2014%20(1).pdf&quot; rel=&quot;nofollow&quot;&gt;A Sharper Ratio: A General Measure for Correctly Ranking Non-Normal Investment Risks&lt;/a&gt;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The authors prove closed form solution to rank alternative investments even when the underlying is not normally distributed under a very general utility specification.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In their own words, they derive&#xA;a generalized ranking measure that correctly ranks risks relative to the original investor problem&#xA;for a broad utility-and-probability space. Like the Sharpe ratio, the generalized measure maintains&#xA;wealth separation for the broad HARA utility class. The generalized measure can also correctly&#xA;rank risks following different probability distributions, making it a foundation for multi-asset class&#xA;optimization. This paper also explores the theoretical foundations of risk ranking, including proving&#xA;a key impossibility theorem: any ranking measure that is valid for non-Normal distributions cannot&#xA;generically be free from investor preferences.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2016-02-12T10:27:32.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23257" PostTypeId="2" ParentId="23235" CreationDate="2016-02-12T13:51:58.597" Score="1" Body="&lt;p&gt;For part a). As you posted,&#xA;\begin{align*}&#xA;(\pi_1+\pi_2)D_1 + (\pi_3+\pi_4)D_2 = \frac{D_1+D_2}{2}.\tag{1}&#xA;\end{align*}&#xA;Moreover, &#xA;\begin{align*}&#xA;\pi_3+\pi_4 = 1 - (\pi_1+\pi_2).\tag{2}&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;(\pi_1+\pi_2)(D_1-D_2)=\frac{D_1-D_2}{2}.&#xA;\end{align*}&#xA;That is, $\pi_1+\pi_2=1/2$. Similarly, $\pi_1+\pi_3=1/2$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-02-12T13:51:58.597" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23258" PostTypeId="2" ParentId="8738" CreationDate="2016-02-12T14:33:17.473" Score="2" Body="&lt;p&gt;What you are doing in the formula is just linear interpolation. This is probably fine, if there was some hindrance such as a seasonality effect, the market would probably contain a contract at that tenor.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Just convert to fractions of a year by some day count convention. Say ACT/365&lt;/li&gt;&#xA;&lt;li&gt;I don't see why. The futures price should just approach the spot.&lt;/li&gt;&#xA;&lt;li&gt;It it is very crude, and does not take any financial assumptions or market specific characteristics into consideration. Limitation would be if there's nothing traded at 4.3M but every institution in the world knows that something significant happens at that time which they account for, but which you completely ignore in your simple interpolation.&lt;/li&gt;&#xA;&lt;li&gt;Use any frequency you like. Depends on your application. For risk management purposes, probably you are looking at daily data and create daily closing prices of your constant maturity futures nodes.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5888" LastActivityDate="2016-02-12T14:33:17.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23259" PostTypeId="2" ParentId="21701" CreationDate="2016-02-12T16:58:03.913" Score="0" Body="&lt;p&gt;While implementing this strategy , you're taking risk of downside movement of your long equity position, as others have pointed out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your market is quite volatile , and you can use the stop losses effectively , you can have minimal profit.&lt;/p&gt;&#xA;" OwnerUserId="19434" LastActivityDate="2016-02-12T16:58:03.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23260" PostTypeId="1" CreationDate="2016-02-12T17:34:15.390" Score="3" ViewCount="244" Body="&lt;p&gt;Is the estimation of the CVaR using known non-parametric methods (histogram, kernels) different than the estimation of any other R.V.?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the answer is yes, I am interested to know whether there are some non-parametric methods for CVaR estimation which are also consistent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="19436" LastEditorUserId="26556" LastEditDate="2019-05-07T13:04:10.927" LastActivityDate="2019-05-07T13:04:10.927" Title="Non-parametric estimator - CVaR / Expected shortfall" Tags="&lt;risk&gt;&lt;portfolio-management&gt;&lt;risk-management&gt;&lt;cvar&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="23261" PostTypeId="1" CreationDate="2016-02-12T17:57:51.367" Score="7" ViewCount="794" Body="&lt;p&gt;Just wondering how to calculate duration when take credit risk into consideration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think if duration is calculated as weighted average of cashflow time, and weights are calculated using present values of cashflows, then Invest Grade Bond would have larger duration than Junk Bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is that the truth???&lt;/p&gt;&#xA;" OwnerUserId="19407" LastEditorUserId="19407" LastEditDate="2016-02-13T01:20:13.080" LastActivityDate="2019-06-09T00:04:16.143" Title="Investment Grade Bond vs Junk Bond, whose duration is larger?" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;credit-risk&gt;&lt;duration&gt;" AnswerCount="7" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23264" PostTypeId="2" ParentId="23250" CreationDate="2016-02-12T20:17:30.037" Score="2" Body="&lt;p&gt;It is just partial answer to your question.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://faculty.chicagobooth.edu/john.cochrane/teaching/empirical_asset_pricing/Fama_French_multifactor_explanations.pdf&quot; rel=&quot;nofollow&quot;&gt;The Fama and French three factor model&lt;/a&gt; can be written as: &#xA;$$R_{it}=\beta_{im}R_{Mt}+ \beta_{iSMB}SMB_t+\beta_{iHML}HML_t + e_{it}$$&#xA;In this model the market index is supposed to capture systematic risk originating from macroeconomic factors. Whereas, SMB and HML are firm specific variables and are chosen because of empirical findings that firm size and book to market ratio predict deviations of average stock returns from levels predicted by CAPM. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fama and French justified their model on empirical grounds. FF found historical-average returns on stocks of small firms and on stocks with high ratios of book equity to market equity (B/M) are higher than predicted by the security market line of the CAPM. The reason pointed out by FF that firms with high ratios of book-to-market value are more likely to be in financial distress and small stocks may be more sensitive to changes in business conditions and thus provide higher historical-average return than predicted by CAPM. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Beside this you can read paper of &lt;a href=&quot;http://www.hec.unil.ch/agoyal/docs/Survey_FMPM.pdf&quot; rel=&quot;nofollow&quot;&gt;Goyal(2012)&lt;/a&gt; where author compare the performance of CAPM from FF model. Goyal found clear improvement of FF model over CAPM. &lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2016-02-12T20:17:30.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23265" PostTypeId="2" ParentId="23244" CreationDate="2016-02-12T21:50:50.273" Score="1" Body="&lt;p&gt;We show that&#xA;\begin{align*}&#xA;Y_t^i = \frac{1}{1+R}E\big( Y_{t+1} \mid S_t = S_t(i)\big).\tag{1}&#xA;\end{align*}&#xA;Note that&#xA;\begin{align*}&#xA;Y_{t+1} &amp;amp;= S_{t+1} \Delta_{t+1}(S_{t+1})\\&#xA;&amp;amp;=\frac{V_{t+2}(S_{t+1}u) - V_{t+2}(S_{t+1}l)}{u-l}.&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA; \frac{1}{1+R}E\big( Y_{t+1} \mid S_t = S_t(i)\big) &amp;amp;= \frac{1}{1+R}E\left(\frac{V_{t+2}(S_{t+1}u) - V_{t+2}(S_{t+1}l)}{u-l} \mid S_t = S_t(i)\right)\\&#xA;&amp;amp;= \frac{1}{1+R}E\bigg(\pi_u\frac{V_{t+2}(S_{t+1}(i+1)u) - V_{t+2}(S_{t+1}(i+1)l)}{u-l}\\&#xA;&amp;amp;\qquad\qquad +\pi_l\frac{V_{t+2}(S_{t+1}(i)u) - V_{t+2}(S_{t+1}(i)l)}{u-l} \mid S_t = S_t(i)\bigg)\\&#xA;&amp;amp;= \frac{1}{1+R}E\bigg(\pi_u\frac{V_{t+2}(S_{t+2}(i+2)) - V_{t+2}(S_{t+2}(i+1))}{u-l}\\&#xA;&amp;amp;\qquad\qquad +\pi_l\frac{V_{t+2}(S_{t+2}(i+1)) - V_{t+2}(S_{t+2}(i))}{u-l} \mid S_t = S_t(i)\bigg)\\&#xA;&amp;amp;=E\left(\frac{V_{t+1}^{i+1}-V_{t+1}^{i}}{u-l}\mid S_t = S_t(i) \right)\\&#xA;&amp;amp;=E\left(Y_t^i\mid S_t = S_t(i) \right)\\&#xA;&amp;amp;=Y_t^i.&#xA;\end{align*}&#xA;The identity (1) is thus proved.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-02-12T21:50:50.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23266" PostTypeId="2" ParentId="22871" CreationDate="2016-02-12T22:17:04.070" Score="0" Body="&lt;p&gt;If you're using greeks for your past trading session's analysis , you should use historical Vol&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you intend to make trading decisions in future and want to have a future outlook of greeks, you should use implied Vol.&lt;/p&gt;&#xA;" OwnerUserId="19434" LastActivityDate="2016-02-12T22:17:04.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23267" PostTypeId="1" AcceptedAnswerId="23273" CreationDate="2016-02-12T22:54:08.533" Score="12" ViewCount="17053" Body="&lt;p&gt;What is the Delta of an at-the-money binary option with a payoout $0$ at $&amp;lt;100$ dollars, and payout $1$ at $&amp;gt;100$ dollars, as it approaches expiry?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is from a sample interview exam. I understand that Delta essentially measures the change in the derivative price relative to the change in the asset price, as trading on the open market. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I actually go about computing Delta for a particular situation like the one above? I've been unable to find a formula for it on Google which is a bit weird? My naive guess is that the answer should be 0.5 but I'm not sure why?&lt;/p&gt;&#xA;" OwnerUserId="19439" LastActivityDate="2019-07-29T20:39:35.233" Title="Delta of binary option" Tags="&lt;delta-hedging&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="23268" PostTypeId="2" ParentId="141" CreationDate="2016-02-13T01:20:35.520" Score="2" Body="&lt;p&gt;There is also a related question on the economics stack:&#xA;&lt;a href=&quot;https://economics.stackexchange.com/questions/4679/what-are-some-good-repositories-for-economic-data&quot;&gt;https://economics.stackexchange.com/questions/4679/what-are-some-good-repositories-for-economic-data&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Answers from there: The &lt;a href=&quot;http://rfe.org/showCat.php?cat_id=2&quot; rel=&quot;nofollow noreferrer&quot;&gt;American Economic Association has a list of resources for Economists, including a page for data&lt;/a&gt;. There you find links to many institutions that offer all kinds of data, as well as further journals with data archives for the studies they publish.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the &lt;a href=&quot;http://replication.uni-goettingen.de&quot; rel=&quot;nofollow noreferrer&quot;&gt;ReplicationWiki&lt;/a&gt; (that I work on) we have information on more than 2000 empirical studies and you can search for which one what kind of &lt;a href=&quot;http://preview.tinyurl.com/Replication-Wiki-Data&quot; rel=&quot;nofollow noreferrer&quot;&gt;data&lt;/a&gt;, &lt;a href=&quot;http://replication.uni-goettingen.de/wiki/index.php/Category:Article_software_used&quot; rel=&quot;nofollow noreferrer&quot;&gt;software&lt;/a&gt;, and &lt;a href=&quot;http://replication.uni-goettingen.de/wiki/index.php/Category:Article_methods_and_estimation&quot; rel=&quot;nofollow noreferrer&quot;&gt;methods&lt;/a&gt; were used, if the material is available, and if replications are known. Many studies can be browsed by &lt;a href=&quot;http://replication.uni-goettingen.de/wiki/index.php/Category:Article_JEL_codes&quot; rel=&quot;nofollow noreferrer&quot;&gt;JEL codes&lt;/a&gt; or &lt;a href=&quot;http://replication.uni-goettingen.de/wiki/index.php/Category:Article_keywords&quot; rel=&quot;nofollow noreferrer&quot;&gt;keywords&lt;/a&gt;. The categorization of &lt;a href=&quot;http://replication.uni-goettingen.de/wiki/index.php/Category:Geographical_origin_of_data&quot; rel=&quot;nofollow noreferrer&quot;&gt;data sources&lt;/a&gt; and &lt;a href=&quot;http://replication.uni-goettingen.de/wiki/index.php/Category:Article_data_source&quot; rel=&quot;nofollow noreferrer&quot;&gt;geographical origin of data&lt;/a&gt; remains very incomplete but it is a wiki, so everyone can contribute and make suggestions.&lt;/p&gt;&#xA;" OwnerUserId="19321" LastEditorUserId="-1" LastEditDate="2017-04-13T12:51:38.530" LastActivityDate="2016-02-13T01:20:35.520" CommentCount="0" CommunityOwnedDate="2016-02-13T01:20:35.520" ContentLicense="CC BY-SA 3.0" />
  <row Id="23269" PostTypeId="1" CreationDate="2016-02-13T04:06:50.497" Score="6" ViewCount="509" Body="&lt;p&gt;I avoid short selling in my strategies. Losing more than invested is not attractive. But at times the implied volatility is too high, I am worried about buying at all and I am trying to filter the effects of Vega so I can peacefully focus on my techniques without worrying about the fall of IV that brings down the option price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Option A: &#xA;Price 100&#xA;Vega: 5&#xA;Delta: .5&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Option B&#xA;Price: 10&#xA;Vega:1&#xA;Delta: .05&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought Buying 1 lot of Option A and selling 5 lots of Option B would nullify the effect of Vega but leaving more delta in option A. But the trade gave some weird results(Option B lost more than A earned even when market moved in right direction). I know, I need to experiemnt it more. Before that, &quot;Is Complete Vega elimination possible?&#xA;Are there any popular techniques used?&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="19441" LastEditorUserId="19441" LastEditDate="2016-02-13T04:17:27.747" LastActivityDate="2016-02-15T09:01:33.880" Title="Is Complete Vega Elimination Possible?" Tags="&lt;implied-volatility&gt;&lt;vega&gt;" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23270" PostTypeId="2" ParentId="22693" CreationDate="2016-02-13T04:45:36.630" Score="2" Body="&lt;p&gt;For a time interval $[0,T]$, Girsanov theorem states that given a process $\lambda$ such that process $U$, defined by&#xA;$$dU_t = -\lambda_tU_tdW_t, \; U_0=1,$$&#xA;is a $P$-martingale, then one can define a new measure $Q$ equivalent to $P$ by&#xA;$$\frac{dQ}{dP} = U_T,$$&#xA;and a standard Brownian motion under $Q$, $W^\star$, by&#xA;$$ dW^\star_t = dW_t + \lambda_tdt.$$&#xA;In your case, if we take&#xA;$$ \lambda_t = \mu/\sigma \; \forall t \in [0,T],$$&#xA;then $U$ is indeed $P$-martingale (no drift)&#xA;  and $W^\star$ defined  by&#xA;$$ dW^\star_t = dW_t + \mu/\sigma dt$$&#xA;is standard Brownian motion under $Q$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can now re-write $S^1$ as follows (no Ito):&#xA;$$ dS^1_t = (r+\mu)S^1_tdt + \sigma S_t^1 dW_t $$&#xA;$$ = rS^1_tdt + \sigma S^1_tdW^\star_t. $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, note that $Q$ is an interesting measure, a so-called EMM (equivalent martingale measure) with numeraire $S^0$, as it is equivalent to $P$ &lt;em&gt;and&lt;/em&gt; $S^1/S^0$ (deflated $S^1$) is a $Q$-martingale. Indeed, using Ito-Leibniz, we see that $S^1/S^0$ has no drift under $Q$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ d(S^1_t/S^0_t) = \sigma S^1_t/S^0_t dW^\star_t. $$&lt;/p&gt;&#xA;" OwnerUserId="6858" LastEditorUserId="6858" LastEditDate="2016-02-15T20:15:17.893" LastActivityDate="2016-02-15T20:15:17.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23271" PostTypeId="2" ParentId="23267" CreationDate="2016-02-13T07:25:40.423" Score="16" Body="&lt;p&gt;The value of European binary call, paying \$1 if $S_T &amp;gt; K$ or nothing otherwise,  is&#xA;$$c_t=e^{-r(T-t)}N(d_2)$$&#xA;where, $d_2=\frac{ln(S_t/K)+(r-\sigma^2/2)(T-t)}{\sigma \sqrt{T-t}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Delta of your binary call option is $$\Delta_t=\frac{\partial c_t}{\partial S_t}=\frac{e^{-r(T-t)}N'(d_2)}{\sigma S_t \sqrt{T-t}}$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Derivation&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We need to compute&#xA;$$\Delta_t=\frac{\partial c_t}{\partial S_t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\partial c_t}{\partial S_t}=\frac{\partial}{\partial S_t}\bigg(e^{-r(T-t)}N(d_2)\bigg)=e^{-r(T-t)}\frac{\partial}{\partial S_t}N(d_2)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\partial}{\partial S_t}N(d_2)=\frac{\partial}{\partial S_t} \int_{-\infty}^{d_2} \frac{1}{\sqrt{2\pi}}e^{-\frac{1}{2}x^2}dx$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $d_2=f(S_t)$. Using Leibniz integral rule&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{\mathrm{d}}{\mathrm{d}x} \left (\int_{a(x)}^{b(x)}f(x,t)\,\mathrm{d}t \right) = f(x,b(x))\cdot b'(x) - f(x,a(x))\cdot a'(x) + \int_{a(x)}^{b(x)} \frac{\partial}{\partial x}f(x,t)\; \mathrm{d}t. $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, $$\frac{\partial}{\partial S_t} \int_{-\infty}^{d_2} \frac{1}{\sqrt{2\pi}}e^{-\frac{1}{2}x^2}dx=\frac{1}{\sqrt{2\pi}}e^{-\frac{1}{2}d_2^2} \frac{\partial}{\partial S_t} (d_2)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may check it yourself that $$\frac{\partial d_2}{\partial S_t}=\frac{1}{S_t \sigma \sqrt{T-t}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Putting all the results together&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\partial c_t}{\partial S_t}=\frac{e^{-r(T-t)}N'(d_2)}{\sigma S_t \sqrt{T-t}}$$&#xA;where $N'(d_2)$ denote the standard normal probability density function,&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Relationship between Binary option delta and Time to expiry&lt;/strong&gt;&#xA;@dm63 already provided a brief answer to your question how delta will respond as option will approach its expiry, below I have shown more accurate relationship&#xA;&lt;a href=&quot;https://i.stack.imgur.com/cBZb0.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/cBZb0.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;br&gt;&#xA;Ref: &lt;a href=&quot;http://www.binaryoptions.com/binary-option-greeks/binary-call-option-delta&quot; rel=&quot;noreferrer&quot;&gt;http://www.binaryoptions.com/binary-option-greeks/binary-call-option-delta&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see as the time to expiry decrease the delta of an at-the-money option approaches to infinity. Because a small change in stock price ($\epsilon$), assume $S_t=K$ and option is near maturity, will cause the option payoff to change its value by \$1 (as information provided in OP). So, option delta $\Delta_t= \frac{1}{\epsilon} \to \infty$. You may also check this result from formula derived above. &lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="16991" LastEditDate="2016-02-13T18:45:27.210" LastActivityDate="2016-02-13T18:45:27.210" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="23272" PostTypeId="2" ParentId="23267" CreationDate="2016-02-13T10:55:12.780" Score="3" Body="&lt;p&gt;Delta of a digital (or binary) option is like the normal distribution probability function , approaching 0 at far OTM / ITM conditions and representing a very high peak at ATM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The peak at ATM approaches infinity as we approach the maturity. This is never 0.5 like a vanilla option since the payoff never simulates the payoff of the underlying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to have an approximation for delta at ATM , I'd suggest you to either use longer dated options , or to use a spread to smoothen out the delta at ATM.&#xA;That's how the traders smoothen out the deltas of digital products while hedging. That structure may be slightly costly though !&lt;/p&gt;&#xA;" OwnerUserId="19434" LastActivityDate="2016-02-13T10:55:12.780" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23273" PostTypeId="2" ParentId="23267" CreationDate="2016-02-13T13:52:40.073" Score="5" Body="&lt;p&gt;If it wasn't clear from the previous answers, the answer they want is that the delta becomes infinite.   That's because a tiny move in the stock will change the payout by $100 so your delta hedge must be enormous.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-02-13T13:52:40.073" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23274" PostTypeId="1" AcceptedAnswerId="36988" CreationDate="2016-02-13T16:42:58.163" Score="2" ViewCount="1957" Body="&lt;p&gt;I know mutual fund data can easily be found on CRSP or Thomson Reuters, but where can I find solid ETF data, specifically their flows?&lt;/p&gt;&#xA;" OwnerUserId="6804" LastActivityDate="2017-12-20T21:31:30.007" Title="Where can I find ETF fund flow data?" Tags="&lt;data&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23275" PostTypeId="2" ParentId="23250" CreationDate="2016-02-13T17:54:16.770" Score="3" Body="&lt;p&gt;&lt;a href=&quot;https://www.winton.com/research/value-size-and-momentum-a-likely-example-of-selection-bias&quot; rel=&quot;nofollow noreferrer&quot;&gt;Evans and Schmitz (2015)&lt;/a&gt; might give an answer to your question if the Fama-French factors are indeed working or not.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Value, size and momentum have a long history as stock price predictors, and similar indicators have been applied to stock indices in order to predict the performance of one national index against another. Published back tests of trading systems based on these ideas have shown impressive performance, but in this paper we find that this performance does not continue past the publication dates.&lt;/p&gt;&#xA;&lt;p&gt;We argue that selection bias at the time of publication has a part to play in the disappointing out‐of‐sample performance of these indicators. We show how the&#xA;combination of estimation uncertainty and selective reporting can readily explain the observed deterioration in performance. Importantly, with a fuller understanding of these effects, the long‐term poor performance of the indicators could have been anticipated at the time.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="5656" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2018-01-31T09:07:49.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23277" PostTypeId="1" CreationDate="2016-02-13T18:22:31.277" Score="1" ViewCount="72" Body="&lt;p&gt;I've come across couple of different ways to discretize the forward rate equation in HJM. If somebody could please help me understand why is it possible to have multiple ways here and how to pick up which one to use?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, Glasserman's monte carlo book and the fixed income book from Jarrow have completely different ways to discretize.&lt;/p&gt;&#xA;" OwnerUserId="7117" LastActivityDate="2016-02-13T18:22:31.277" Title="Different ways to discretize forward rate in HJM" Tags="&lt;interest-rates&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23278" PostTypeId="1" CreationDate="2016-02-13T19:37:50.063" Score="0" ViewCount="13941" Body="&lt;p&gt;It is known that the price $p_t$ of a floating rate bond can be calculated discounting $(L+k)$ the sum of the next coupon payment $k$ and the face value $L$ at the relevant risk-free rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, with continuous compounding the price of such a bond would be $$p_t=(L+k)e^{-rt}$$&#xA;where $r$ is the annual continuous risk-free rate for the period of time that divides us from the first payment and $t$ is its length.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we want to know how the price changes when $r$ changes we just derive the price to get&#xA;$$\frac{\partial p_t}{\partial r}=-p_t\cdot t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, does it make sense talking about duration of a floating rate bond? Isn't it enough to refer to the derivative computed above? How could the notion of duration be applied in such a situation where we do not know future cash flows?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance.&lt;/p&gt;&#xA;" OwnerUserId="13707" LastActivityDate="2016-02-13T21:03:32.350" Title="Duration of a floating rate bond" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;duration&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23281" PostTypeId="1" CreationDate="2016-02-13T21:03:18.090" Score="3" ViewCount="1546" Body="&lt;p&gt;Is Sharpe ratio always the best way to evaluate a portfolio? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not really sure what this potential interview question wants me to answer. I have read that Sharpe ratio essentially explains how much the return on our asset will change with a change in its volatility (i.e. becoming more or less certain about the price at maturity) and is defined as&#xA;$S(X) = \frac{r_X-R_f}{\sigma}$ where $r_X$ is average return, $R_f$ is risk free (volatility=0) return and $\sigma$ is the standard deviation (measure of volatility).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only thing I can think about saying is that $\sigma$ isn't the only measure of volatility. There is also e.g. $\beta$ which measures volatility relative to overall market (in contrast to $\sigma$ which just compares with previous performance of $X$ and nothing else). Therefore there might be a better way that uses $\beta$ instead of $\sigma$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an alternative to Sharpe ratio? Why is it better? How should one approach a question like this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="19439" LastEditorUserId="2587" LastEditDate="2016-02-15T08:42:49.470" LastActivityDate="2019-04-15T21:39:54.117" Title="Evaluation of portfolio other than Sharpe Ratio" Tags="&lt;volatility&gt;&lt;sharpe-ratio&gt;" AnswerCount="4" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23282" PostTypeId="2" ParentId="23278" CreationDate="2016-02-13T21:03:32.350" Score="3" Body="&lt;p&gt;Yes. the duration of a floating rate bond is the time t until the next coupon payment, as your equation shows. The payments that come after are not known yet and will be determined based on interest rates then prevailing, so they carry no &#xA;duration risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general floating rate bonds are what people buy when they want the smallest duration possible. Long term ZCB are what people buy when they want the longest possible duration. &lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2016-02-13T21:03:32.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23283" PostTypeId="2" ParentId="23281" CreationDate="2016-02-14T05:26:22.913" Score="1" Body="&lt;p&gt;Go through the research paper by &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2691268.&quot; rel=&quot;nofollow&quot;&gt;Tripathi &amp;amp; Bhandari(2015)&lt;/a&gt;. In this paper, authors compared the performance of various funds using various risk adjusted measure like Sharpe Ratio, Treynor ratio, Jensen's Alpha, and information ratio. Authors have carefully examined the limitation of each and every ratio and also suggested for an alternatives measures. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Beside this you can use other measures like VaR, expected shortfall etc. &lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2016-02-14T05:26:22.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="23284" PostTypeId="1" CreationDate="2016-02-14T09:55:50.207" Score="0" ViewCount="683" Body="&lt;p&gt;I'm trying scraping SEC filings using open source xbrl platform  Arelle(arelle.org). Using their docs I have managed scraping from SEC rss and storing them in postgresql database. What I am struggling about is for querying any information about fundamentals item of any company I need knowing the corresponding exact us-gaap XBRL tag like one I've highlighted in the image.&#xA;So for example I'm trying querying all items listed on an example site : &lt;a href=&quot;https://github.com/altova/SECDB/blob/master/docs/DB-SCHEMA.md&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/altova/SECDB/blob/master/docs/DB-SCHEMA.md&lt;/a&gt; which is a proprietory software and I dont intend using. So is there any sites available that can help me get all us-gaap xbrl tags with all their corresponding meanings and many names?&#xA;&lt;a href=&quot;https://i.stack.imgur.com/XdWB1.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/XdWB1.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15882" LastActivityDate="2016-07-31T17:44:26.910" Title="Where can I get all XBRL tags with descriptions and details" Tags="&lt;sec&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23285" PostTypeId="2" ParentId="23269" CreationDate="2016-02-14T10:38:08.260" Score="4" Body="&lt;p&gt;Constant Vega Requires Options Weighted Inversely Proportional to the Square of the Strike. &#xA;E.g. if you have the following portfolio of options:&#xA;\begin{equation}&#xA;\int_{S_i(t)}^{\infty}\frac{2\Big(1-\log[\frac{K}{S_i(t)}]\Big)}{K^2}C_i(t,\tau,K)dK+\int_{0}^{S_i(t)}\frac{2\Big(1-\log[\frac{K}{S_i(t)}]\Big)}{K^2}P_i(t,\tau,K)dK&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have a portfolio with a constant vega. You can find the proof on the appendix A of &lt;a href=&quot;http://www.emanuelderman.com/media/gs-volatility_swaps.pdf&quot; rel=&quot;noreferrer&quot;&gt;Demeterfi et al&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2016-02-14T10:38:08.260" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="23286" PostTypeId="1" AcceptedAnswerId="24296" CreationDate="2016-02-14T10:45:03.060" Score="4" ViewCount="1824" Body="&lt;p&gt;I'm working on a R project, trying to calibrate a GARCH (so far, (1,1) ) model to the yields of the STOXX50 index over the last 2 years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried the garch function of the tseries package, but it gave me a &quot;false convergence&quot; result.&#xA;I tried then the ruGARCH package, and no false convergence so far, but I would like to know if my model is a good fit for the data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I do that ? How can I interpret the results of all the tests done (Box-Liung, etc..)&lt;/p&gt;&#xA;" OwnerUserId="19457" LastActivityDate="2016-02-26T16:31:26.920" Title="ruGarch - Interpret test results" Tags="&lt;time-series&gt;&lt;r&gt;&lt;garch&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23288" PostTypeId="1" CreationDate="2016-02-14T11:38:29.107" Score="3" ViewCount="172" Body="&lt;p&gt;I couldn't find good resources on how to simulate a stock price data sequence including some basic effects.&#xA;The basis might be a Brownian motion model; but in real stock prices, there are additional effects like support and resistances etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found the book by Paul Glassermann 'Monte Carlo Methods in financial engineering'. But it couldn't find e.g. something about resistance in it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&#xA;The work by Lo and MacKinlay made me belive that there could be some work on modelling the non-random effects apparently present in stock data:&#xA;Lo, Andrew W., and A. Craig MacKinlay. &quot;Stock market prices do not follow random walks: Evidence from a simple specification test.&quot; Review of financial studies 1.1 (1988): 41-66.&lt;/p&gt;&#xA;" OwnerUserId="19458" LastEditorUserId="19458" LastEditDate="2016-02-20T07:12:05.783" LastActivityDate="2016-02-20T07:12:05.783" Title="How to simulate stock price with support and resistance level" Tags="&lt;finance&gt;&lt;simulations&gt;&lt;finance-mathematics&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23291" PostTypeId="1" CreationDate="2016-02-14T15:31:04.807" Score="6" ViewCount="2371" Body="&lt;p&gt;When working with a stochastic process based on brownian motion, the increments have normal (gaussian) distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, &lt;strong&gt;it seems that a Laplace distribution&lt;/strong&gt;, with density:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f(t) = \frac{\lambda}{2} e^{-\lambda |t|} \qquad (t \in \mathbb R)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;would fit &lt;em&gt;much more&lt;/em&gt; returns of EUR/USD for example than a normal distribution.&lt;/strong&gt; (Especially, it has fatter tails than normal distribution, as required).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Here in blue is the density of returns, based on 10 years of historical data of 5-minutes chart of EUR/USD. In green, the density of a Laplace distribution.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/jgdDT.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/jgdDT.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Question:&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Are there some financial models, in which the stochastic process used is:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d \, X_t = ... + c \, d \, W_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $d\, W_t$ has a &lt;strong&gt;Laplace distribution&lt;/strong&gt; instead of a normal distribution?&lt;/p&gt;&#xA;" OwnerUserId="18444" LastActivityDate="2018-03-08T06:03:26.990" Title="Why do we usually use normal distribution and not Laplace distribution to generate stochastic process?" Tags="&lt;stochastic-processes&gt;&lt;fx&gt;&lt;modeling&gt;&lt;brownian-motion&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="23292" PostTypeId="1" CreationDate="2016-02-14T15:54:06.907" Score="0" ViewCount="92" Body="&lt;p&gt;I had the understanding that leverage always helped improve cash on cash returns so long as the interest paid was less than the unlevered rate of return/cap rate. doing a quick back of the envelope calculation in excel on first year returns seems to suggest otherwise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;my quick calculations show that there is a spread required from interest rate to cap rate in order to achieve positive first year leverage. It also shows that as amortization tightens the necessary spread increases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm only considering year one one returns with and without leverage, so not taking into account any NOI growth&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is my analysis correct here? what am I missing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;my example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;purchase: $7,100,000&#xA;cap rate/ unlevered return: 6.99%&#xA;cash flow: 496,310&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if using 80% leverage 30 year debt at 5.75%:&#xA;payment: 397,763&#xA;cash flow: 98,547&#xA;cash on cash: 6.94% &lt;/p&gt;&#xA;&#xA;&lt;p&gt;if using 80% leverage 25 year debt at 5.75%&#xA;payment: 428,799&#xA;cash flow: 67,511&#xA;cash on cash: 4.75%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in both of the examples above I'm using debt that is less expensive than the unlevered return that I'm getting, so why does year one cash on cash suffer?&lt;/p&gt;&#xA;" OwnerUserId="19464" LastActivityDate="2016-07-18T14:43:57.163" Title="positive financial leverage in real estate" Tags="&lt;interest-rates&gt;&lt;leverage&gt;&lt;real-estate&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23294" PostTypeId="2" ParentId="16057" CreationDate="2016-02-14T17:38:17.617" Score="1" Body="&lt;p&gt;Stock Analyser is a Stock Charting, Portfolio Optimization, Pairs Trade, Technical and Quantitative Analyzer. It is a free software. &#xA;I am coding it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://emerlytics.com/?page_id=47&quot; rel=&quot;nofollow&quot;&gt;Stock Analyst&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19465" LastActivityDate="2016-02-14T17:38:17.617" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="23295" PostTypeId="2" ParentId="23291" CreationDate="2016-02-14T19:08:47.540" Score="4" Body="&lt;p&gt;It is very natural to think that why assumption of Normal distribution is made for stochastic process $W_t$ when other more appropriate and valid distribution is available specially for modelling stock price. Before writing answer to your question explicitly, first look at definition of Wiener process:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Wiener Process&lt;/strong&gt;: A Wiener process $W_t$, relative to family of information set {$\mathscr{F}_t$}, is a stochastic process such that:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$W_t$ is square integrable martingale with $W_0=0$ and &#xA;$$\mathbb{E}\big[(W_t-W_s)^2 \big]=t-s, \quad s\leq t$$&lt;/li&gt;&#xA;&lt;li&gt;The path of $W_t$ is continuous over $t$. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The following definition lead to following characteristics of Wiener process:  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;$W_t$ has independent increments because it is martingale. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$W_t$ has zero mean and and mean of every increment equals zero. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$W_t$ has variance $t$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$W_t$ has continuous paths.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Note that, in the above definition nothing is said about the distribution of increments. &lt;strong&gt;Normal distribution follows from the   assumption stated in the definition&lt;/strong&gt;. This is known as famous &lt;strong&gt;Levy Theorem&lt;/strong&gt;. If assumptions under Wiener process are  satisfied then Levy theorem prove that Wiener increments, $W_t - W_s$, are normally distributed with mean zero and variance $|t-s|$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short, for a stochastic process having continuous path and independent increments (natural properties of stock price), normality is not an assumption but gets derived  from the basics assumption of Wiener process. And this is the reason no other assumption about the distribution of $dW_t$is made in literature because normality is not an assumption at all.  &lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2016-02-14T19:08:47.540" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="24295" PostTypeId="2" ParentId="23269" CreationDate="2016-02-14T20:49:02.370" Score="4" Body="&lt;p&gt;Well , complete elimination of even Delta is not possible, forget about Vega. When I say this , I'm talking about the trouble you'd face if you keep dynamically hedging your position from time to time. I mean it's not practical , however theoretically feasible it may seem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But anyway if you're interested, below ways could be of your help.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;You might want to utilize Vol-Indices ( VIX - CBOE and others ) and take appropriate exposure suiting your existing positions&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You could reach out to fund houses and IBs to enter into client-taylored structured products like Vol/Var Swaps etc.. but that maybe a barrier as well in case you're a retail trader. You could have a very rough replicated structure as well for this - as mentioned by 'volcompt' but that may be tough to maintain dynamically.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Well there could be more ways to go about this, but that's all what I could think of.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gud luck with that !&lt;/p&gt;&#xA;" OwnerUserId="19434" LastActivityDate="2016-02-14T20:49:02.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24296" PostTypeId="2" ParentId="23286" CreationDate="2016-02-14T20:59:12.870" Score="5" Body="&lt;p&gt;To test for model misspeicfication:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;First ensure that auto correlation  of  standardized residuals resulted from the ARMA-GARCH model are not significant. Further, you can use Box-Ljung test. It test joint significance of auto correlation upto lag $K$. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Leverage effect is tested by sign bias test. If $p$ value is less than .05 (assumed significance level) then it indicate presence of leverage effect in the data. In this case, try models that capture leverage effects like TGARCH, EGARCH etc. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The chi-squared goodness of fit test compares the empirical distribution of the standardized residuals with the theoretical ones from the chosen density.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;But before fitting GARCH model, check for ARCH effects in your data. If there is no ARCH effect then GARCH model is not required at all. &lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2016-02-14T20:59:12.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24298" PostTypeId="2" ParentId="23269" CreationDate="2016-02-15T08:42:07.910" Score="3" Body="&lt;p&gt;In general only non-linear instruments, like options, posses vega. Vega is always positive, no matter the directional component. So when you are long either a call or a put option you are long vega and when you are short either a call or a put option you are short vega.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thereby it becomes clear that you can go long and short different option positions to offset vega. You cannot offset vega with linear instruments (underlying), i.e. stocks or indices (why? because their vega is zero!)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Two strategies come to mind: Risk-reversals and synthetics. A synthetic is a risk-reversal (simultaneous buying and selling of a call and a put) with the same strike which results in something similar to a futures contract. So basically by combining two non-linear instruments to replicate a linear one you eliminate vega.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also this nice explanation: &lt;a href=&quot;http://www.option-trading-guide.com/synthetics.html&quot; rel=&quot;nofollow&quot;&gt;http://www.option-trading-guide.com/synthetics.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some general things to bear in mind:&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The more sources of risk you hedge away the fewer potential revenue streams remain. When you hedge &lt;em&gt;all&lt;/em&gt; greeks you will loose the spread of all those positions -&gt; so turning this around, this makes sense only for market-makers (and even they don't hedge &lt;em&gt;all&lt;/em&gt; greeks completely).&lt;/li&gt;&#xA;&lt;li&gt;You still have to deal with model risk, e.g. when you use BS to calculate your hedges you will certainly be surprised by the outcome because of the non-normality of markets.&lt;/li&gt;&#xA;&lt;li&gt;Most hedges only work dynamically, i.e. when the market moves, you have to re-adjust which can be quite costly.&lt;/li&gt;&#xA;&lt;li&gt;Beware of ops-risk: You most certainly will not be able to establish all positions simultaneously with the limits you would like to have. Especially not in your example (high IV)!&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2016-02-15T09:01:33.880" LastActivityDate="2016-02-15T09:01:33.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24299" PostTypeId="1" CreationDate="2016-02-15T10:57:05.620" Score="3" ViewCount="924" Body="&lt;p&gt;I have implemented a class in C# that will calculate P&amp;amp;L based on &lt;a href=&quot;https://www.tradingtechnologies.com/help/fix-adapter-reference/pl-calculation-algorithm/understanding-pl-calculations/&quot; rel=&quot;nofollow&quot;&gt;this description&lt;/a&gt; from TT. However it worries me that it gives different results for the same fills, if you apply the &quot;fill download&quot; calculations vs if you simply add fills (example below).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a clear reference resource for P&amp;amp;L calculation? Google has failed me significantly on this one. I am including the code in case this can give an insight to a bug.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;public sealed class ProfitLoss&#xA;{&#xA;    public double Realized { get; private set; }&#xA;&#xA;    public int Net { get; private set; }&#xA;&#xA;    public double AverageOpenPrice { get; private set; }&#xA;&#xA;    public ProfitLoss()&#xA;    {&#xA;&#xA;    }&#xA;&#xA;    public ProfitLoss(IEnumerable&amp;lt;Tuple&amp;lt;int, double&amp;gt;&amp;gt; initial)&#xA;    {&#xA;        int buyQuantity = 0, sellQuantity = 0;&#xA;        double averageBuyPrice = 0, averageSellPrice = 0;&#xA;        foreach (var fill in initial)&#xA;        {&#xA;            if (fill.Item1 &amp;gt; 0)&#xA;            {&#xA;                buyQuantity += fill.Item1;&#xA;                averageBuyPrice += fill.Item1 * fill.Item2;&#xA;            }&#xA;            else if (fill.Item1 &amp;lt; 0)&#xA;            {&#xA;                int absQuantity = Math.Abs(fill.Item1);&#xA;                sellQuantity += absQuantity;&#xA;                averageSellPrice += absQuantity * fill.Item2;&#xA;            }&#xA;        }&#xA;&#xA;        if (buyQuantity &amp;gt; 0)&#xA;            averageBuyPrice /= buyQuantity;&#xA;        if (sellQuantity &amp;gt; 0)&#xA;            averageSellPrice /= sellQuantity;&#xA;&#xA;        Net = buyQuantity - sellQuantity;&#xA;        AverageOpenPrice = Net &amp;gt; 0 ? averageBuyPrice : averageSellPrice;&#xA;        Realized = (averageSellPrice - averageBuyPrice) * Math.Min(buyQuantity, sellQuantity);&#xA;    }&#xA;&#xA;    public void AddFill(int quantity, double price)&#xA;    {&#xA;        if (quantity == 0)&#xA;            throw new ArgumentOutOfRangeException(nameof(quantity), &quot;Quantity must be non-zero.&quot;);&#xA;&#xA;        if (Math.Sign(Net) != Math.Sign(quantity))&#xA;        {&#xA;            int absNet = Math.Abs(Net);&#xA;            int absQuantity = Math.Abs(quantity);&#xA;&#xA;            if (absNet == absQuantity) // flat&#xA;            {&#xA;                Realized += (price - AverageOpenPrice) * Net;&#xA;                AverageOpenPrice = 0;&#xA;            }&#xA;            else if (absNet &amp;gt; absQuantity) // decrease&#xA;            {&#xA;                Realized += (price - AverageOpenPrice) * -quantity;&#xA;            }&#xA;            else // reverse&#xA;            {&#xA;                Realized += (price - AverageOpenPrice) * Net;&#xA;                AverageOpenPrice = price;&#xA;            }&#xA;        }&#xA;        else // increase position&#xA;        {&#xA;            AverageOpenPrice = (Net * AverageOpenPrice + quantity * price) / (Net + quantity);&#xA;        }&#xA;&#xA;        Net += quantity;&#xA;    }&#xA;&#xA;    public double FloatingForTheoriticalExit(double exitPrice)&#xA;    {&#xA;        return (exitPrice - AverageOpenPrice) * Net;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Example of difference in calculation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;new ProfitLoss(new[] {&#xA;    Tuple.Create(12, 100.0),&#xA;    Tuple.Create(17, 99.0),&#xA;    Tuple.Create(-9, 101.0),&#xA;    Tuple.Create(-4, 105.0),&#xA;    Tuple.Create(3, 103.0)&#xA;}).Dump();&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Yields:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Realized 32.2499999999999 &#xA;Net 19 &#xA;AverageOpenPrice 99.75 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;var calc = new ProfitLoss();&#xA;calc.AddFill(12, 100);&#xA;calc.AddFill(17, 99);&#xA;calc.AddFill(-9, 101);&#xA;calc.AddFill(-4, 105);&#xA;calc.AddFill(3, 103);&#xA;calc.Dump();&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Yields:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Realized 36.6206896551725 &#xA;Net 19 &#xA;AverageOpenPrice 99.9800362976407 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11631" LastEditorUserId="11631" LastEditDate="2016-02-15T12:47:43.640" LastActivityDate="2018-06-07T11:48:18.687" Title="Robust way to calculate P&amp;L for stocks/futures trading" Tags="&lt;equities&gt;&lt;futures&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24300" PostTypeId="2" ParentId="23281" CreationDate="2016-02-15T11:43:47.137" Score="1" Body="&lt;p&gt;For a more theoretical view, you could also check out the Gibbons, Ross and Shanken paper (1989). In short, sharpe ratio is a measure of absolute performance. Choosing the portfolio with the maximum sharpe ratio is equivalent to maximizing end of period wealth. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In contrast, Jensen's alpha is a measure of relative performance. It measures the marginal contribution of an asset if this asset is added to a portfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, consider a classical mean-variance diagram with the usual tangency line. The slope of the tangency line determines the maximum achievable sharpe ratio. Now suppose you add an additional asset. That will increase the slope of the tangency line. GRS point out, besides other stuff, that the relationship between Jensen's alpha and the sharpe ratio is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;SR_old^2 + A^2 = SR_new^2 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where A is called the appraisal ratio and is defined as (alpha/sigma_e)^2. Alpha is the intercept from a time-series regression of excess returns on the market, sigma_e is the standard deviation of the residuals from that regression. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't think this is a proper answer but I cannot comment (no rep), so I just wanted to give you that reference. Maybe it helps. &lt;/p&gt;&#xA;" OwnerUserId="19468" LastActivityDate="2016-02-15T11:43:47.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24301" PostTypeId="1" CreationDate="2016-02-15T11:55:48.003" Score="4" ViewCount="1371" Body="&lt;p&gt;I am having a bit of a problem with currency conversion issues. What I do: I sort European stocks based on their book-to-market ratio, each year I form a portfolio (equal-weight) with the 10 stocks that have the highest book-to-market ratio. I calculate the return on that porfolio in Euros. So basically I am constructing a factor-mimicking portfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I download the Fama-French Factors from Kenneth French's website. I am planning to run a time-series regression of my portfolio returns on the factors to see whether my portfolio indeed has a exposure to the value factor (I hope so) and/or whether it has exposure to other factors as well. However, the FF factors are generally calculated in USD as far as I understand, so I converted the returns of the factors into € using:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;return in € = (1+return in $)*(1+currency_return) - 1 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where currency return is E/USD in t divided by E/USD in t-1, minus 1. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I then run the time-series regression, I get no (significant) exposure to the value factor but significant exposures to the market (positiv), size (negativ, but that's because I filtered out a lot of small stocks I guess), momentum (negativ). So that's weird?! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I run the time-series regressions with the original factor returns calculated in USD, everything works -- significant positive exposure to HML. No exposure to WML or SMB. But I am pretty sure it's technically incorrect because of the currency issue... &lt;/p&gt;&#xA;" OwnerUserId="19468" LastActivityDate="2020-09-22T12:55:25.703" Title="Fama-French Factors in €" Tags="&lt;factor-models&gt;&lt;currency&gt;&lt;fama-french&gt;&lt;factor-investing&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24302" PostTypeId="2" ParentId="22190" CreationDate="2016-02-15T15:41:59.223" Score="0" Body="&lt;p&gt;It is correct. J.Hull's book explains it clearly in Chapter 3, paragraph 3.5 &quot;Forward price for an investment asset&quot;. It is also shows the arbitrage strategy if the price does not match.&lt;/p&gt;&#xA;" OwnerUserId="19432" LastEditorUserId="848" LastEditDate="2016-02-17T20:37:05.670" LastActivityDate="2016-02-17T20:37:05.670" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24304" PostTypeId="1" AcceptedAnswerId="24376" CreationDate="2016-02-15T16:37:34.397" Score="0" ViewCount="47" Body="&lt;p&gt;I'm trying to figure out the concepts &amp;quot;compound and continuous interest&amp;quot;. &lt;a href=&quot;http://betterexplained.com/articles/a-visual-guide-to-simple-compound-and-continuous-interest-rates/&quot; rel=&quot;nofollow noreferrer&quot;&gt;This article&lt;/a&gt; explains the material very well in the context of a savings account. However, I find it difficult to transfer my understanding to the realm of debt. For instance, in the end of said article the following applications are presented.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Should I pay my mortgage at the end of the month, or the beginning?&lt;/strong&gt; The beginning, for sure. This way you knock out a chunk of debt early, preventing that “debt factory” from earning interest for 30 days. Suppose your loan APY is 6% and your monthly payment is \$2000. By paying at the start of the month, you’d save \$2000 * 6% = \$120/year, or \$3600 throughout a 30-year mortgage. And a few grand is nothing to sneeze at.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Should I use several small payments, or one large payment?.&lt;/strong&gt; You want to pay debt off as early as possible. \$500/week for 4 weeks is better than \$2000 at the end of the month. Each payment stops a few weeks’ worth of interest. The math is a bit tricker, but think of it as 4 \$500 investments, each getting different return. In a month, the first payment saves 3 week’s worth of interest: 500 · (1 + daily rate)21. The next saves 2 weeks: 500 · (1 + daily rate)14. The third saves a week 500 · (1 + daily rate)7 and the last payment doesn’t save any interest. Regardless of the details, prepayment will save you money.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I don't understand the answers. Help would be appreciated. (Again, you may assume that I understand the concepts of compound and continuous interest in the context of savings accounts.)&lt;/p&gt;&#xA;" OwnerUserId="15619" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-02-18T02:55:07.927" Title="Compound and continuous interest in the context of debt" Tags="&lt;interest&gt;&lt;debt&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24305" PostTypeId="1" AcceptedAnswerId="24307" CreationDate="2016-02-15T17:36:10.003" Score="2" ViewCount="37" Body="&lt;p&gt;Compute the risk measured by the standard deviations $\sigma K_1, \sigma K_2, \sigma K_3$ for each of the investment projects, where the returns $K_1, K_2$, and $K_3$ depend on the market scenario:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;        \begin{matrix}&#xA;        Scenario &amp;amp; Probability &amp;amp; Return K_1 &amp;amp; Return K_2 &amp;amp; Return K_3 \\&#xA;        \omega_1 &amp;amp; 0.3 &amp;amp; 12\% &amp;amp; 11\% &amp;amp; 2\% \\&#xA;        \omega_2 &amp;amp; 0.7 &amp;amp; 12\% &amp;amp; 15\% &amp;amp; 22\% \\&#xA;        \end{matrix}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure what this question is asking me to do, I think it has something to do with weights?&lt;/p&gt;&#xA;" OwnerUserId="19355" LastActivityDate="2016-02-15T18:10:08.527" Title="Compute the risk measured by the standard deviations $\sigma K_1, \sigma K_2, \sigma K_3$, does this have to do with weights?" Tags="&lt;finance&gt;&lt;returns&gt;&lt;standard-deviation&gt;&lt;financial-engineering&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24306" PostTypeId="1" AcceptedAnswerId="24308" CreationDate="2016-02-15T18:01:08.767" Score="2" ViewCount="241" Body="&lt;p&gt;The three year bond has face value USD 100, and pays USD 5 coupons annually, the last one at maturity. Assume that the continuously compounding rate is 7%.&lt;br&gt;&#xA;(a) Find the price of this bond.&lt;br&gt;&#xA;(b) Consider the investor who invests 1000 in these bonds. Each year after the coupon payments are issued, the investor buys the bonds from that money. What is the amount of money that the investor receives at the maturity of the bonds?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this correct for part a?&#xA;in class I learned bond price = $\frac{C}{1+r}+\frac{C}{(1+r)^2}+...+\frac{C+FaceValue}{(1+r)^2}$&lt;br&gt;&#xA;where c = coupon payment and r = interest rate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{5}{1+0.07}+\frac{5}{(1+0.07)^2}+\frac{105}{(1+0.07)^3} = 94.75$$&lt;br&gt;&#xA;Is the correct price of the bond $\$94.75$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am having trouble with part b, from what I understand and investor is able to buy 10 bonds at 100 USD face value with his 1000 USD, then after one year he wants to buy more bonds from his coupon payments. After one year he will get $\frac{5}{1+0.07}=4.67$ from each bond he bought, since he bought 10 bonds he will have 46.73, this is not enough to reinvest for another bond since hte face value is 100 USD, even if he waits after year 2 it still won't be enough. What am I doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="19355" LastEditorUserId="848" LastEditDate="2016-02-15T21:15:03.517" LastActivityDate="2016-02-15T21:15:03.517" Title="Coupon bond pricing problem with reinvestment" Tags="&lt;finance&gt;&lt;finance-mathematics&gt;&lt;zero-coupon&gt;&lt;homework&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24307" PostTypeId="2" ParentId="24305" CreationDate="2016-02-15T18:10:08.527" Score="1" Body="&lt;p&gt;This is very basic question. You just need to compute the standard deviation of three projects $K_1$, $K_2$ and $K_3$.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;$$\text{Standard deviation}= \sqrt{E[(X-\mu)^2]}$$&lt;/h1&gt;&#xA;&#xA;&lt;h1&gt;For the first project $K_1$:&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Expected return ($\mu_{K_1}$) =  $.3*.12 + .7*.12 = .12$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Standard Deviation ($\sigma K_1$) = $\sqrt{.3*(.12-.12)^2+.7*(.12-.12)^2}=0&#xA;$&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;For the second project $K_2$:&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Expected return ($\mu_{K_2}$) =  $.3*.11 + .7*.15 = .138$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Standard Deviation ($\sigma K_1$) = $\sqrt{.3*(.11-.138)^2+.7*(.15-.138)^2}=0.018330=1.83\% $&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;You may follow the same procedure for the third project.&lt;/h1&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2016-02-15T18:10:08.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24308" PostTypeId="2" ParentId="24306" CreationDate="2016-02-15T18:29:18.757" Score="3" Body="&lt;p&gt;In part (a) use discount rate $e^.07 -1 = .072508181$ to get the right answer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For part (b) I am just giving you hint: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Calculate bond price at the end of 1st year and 2nd year in the same way as you did in part (a). &lt;/li&gt;&#xA;&lt;li&gt;Use the above calculated price to buy bond from the dividend at the end of first and second year. You may assume bond can be purchased in fraction. &lt;/li&gt;&#xA;&lt;li&gt;At the end of 2nd year donot forget to consider the dividend received on the bond purchased in the first year. &lt;/li&gt;&#xA;&lt;li&gt;Calculate the maturity value at the end of 3rd year. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2016-02-15T18:29:18.757" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="24309" PostTypeId="1" CreationDate="2016-02-15T19:29:43.110" Score="9" ViewCount="1317" Body="&lt;p&gt;I am writing a blackbox model that will react to each market data update (tick) by placing a new order in the market. Without using FPGA, what is the fastest tick-to-trade time that I can expect to achieve with the most modern CPUs?&lt;/p&gt;&#xA;" OwnerUserId="15964" LastActivityDate="2018-11-10T23:47:38.520" Title="What is the fastest tick-to-trade possible time without FPGAs?" Tags="&lt;latency&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24310" PostTypeId="2" ParentId="24301" CreationDate="2016-02-15T20:40:37.567" Score="2" Body="&lt;p&gt;There are a couple of things that I'd like to highlight in your approach to forming a factor-mimicking portfolio:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(a) Fama-French (FF) construct a long-short portfolio of stocks, and not just a long portfolio, as you have indicated. Here is the formula from Kenneth French's website &lt;em&gt;HML = 1/2 (Small Value + Big Value) - 1/2 (Small Growth + Big Growth)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(b) To put stocks into 'small' 'big' / 'value' 'growth' ' neutral' buckets - they use yearly breakpoints calculated from the data itself (again, you can read up more on this on their website).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(c) Including just '10' stocks may not be the right approach, since you're aiming for a diversified portfolio, which serves as a proxy for value factor. However, with such a small number of stocks, you're likely to pick up (in your return series), stock specific idiosyncrasies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you've followed these steps, you'll essentially have a value factor mimicking portfolio for Europe (constructed in was similar to FF's).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next, if you are interested in learning whether the value factor in Europe covaries/ moves together with that in the US - you could plot/ regress/ calculate correlation/ calculate moving correlation etc. on the two return time series, to get better insights. Its not obviously clear to me why you'd want to convert return series to another currency for this sort of analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if you want to check whether European portfolio has exposure to US factors, you should be mindful that you might implicitly be assuming a much stricter relationship - a certain lock-step between the two economies and common underlying risk factors (that investors get compensation for). Also, this might imply that exchange rate is just a by-product of these two equity markets (while in reality, it has independent drivers of its own). Whatever your hypothesis, if you need to convert both time series to the same currency, your formula is correct. I'm just trying to highlight that going into your analysis, you should not expect a one-to-one relationship. Hope it helps.&lt;/p&gt;&#xA;" OwnerUserId="17405" LastActivityDate="2016-02-15T20:40:37.567" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24311" PostTypeId="2" ParentId="23209" CreationDate="2016-02-15T20:59:36.357" Score="1" Body="&lt;p&gt;Effective PA is dependent on the correct description of the investment process. I am not sure, from what you say, what exactly is your investment process. But let me presume that it is the following:&#xA;You have chosen the S&amp;amp;P500 as your benchmark.&#xA;You first distributed your money among sectors. (That you gave many sectors zero weight is not relevant to the methodology, only to the resulting evaluations.)&#xA;Then you distributed your money within each of the Sectors, making one decision for each sector. In sectors that you put no money, it is assumed that the zero value was distributed as the BM did.&#xA;Thus, a PA model should rightly only evaluate your four decisions. &#xA;A straightforward application of a single period PA would provide these results.&#xA;Of course, if there were any trading during the period, you would need a multi-period PA in order to fairly evaluate your decisions.&lt;/p&gt;&#xA;" OwnerUserId="19474" LastActivityDate="2016-02-15T20:59:36.357" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24312" PostTypeId="1" CreationDate="2016-02-15T21:02:31.523" Score="2" ViewCount="1680" Body="&lt;p&gt;How can I download exchange data for only common stocks (excl mutual funds, ETF, etc) on the NYSE, NASDAQ, and AMEX?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't find a list of tickers or anything. Does anyone know a method? And does anyone know how to get around the CRSP NAICS labeling being so incomplete? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone have any experience in using CRSP daily stock data and downloading it in the most usable format? I'm trying to download all publicly listed stocks and it doesn't make any sense because only about 70% of these companies by ticker/name/PERMNO/PERMCO have their last trading date on 12/31/2015, but if they're publicly listed, then they should all trade until the end. &lt;/p&gt;&#xA;" OwnerUserId="19473" LastActivityDate="2017-11-11T11:26:53.380" Title="CRSP common stock only" Tags="&lt;data&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24313" PostTypeId="2" ParentId="24312" CreationDate="2016-02-15T21:28:27.227" Score="-2" Body="&lt;p&gt;I figured out a solution. You can sort the CSV data from NASDAQ.com and filter out anything in the n/a sector&lt;/p&gt;&#xA;" OwnerUserId="19473" LastActivityDate="2016-02-15T21:28:27.227" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24314" PostTypeId="2" ParentId="24309" CreationDate="2016-02-16T05:23:39.787" Score="0" Body="&lt;p&gt;I would say something around 1/5 milliseconds. &#xA;Are you connecting through fix? Any specific engine? &lt;/p&gt;&#xA;" OwnerUserId="13990" LastActivityDate="2016-02-16T05:23:39.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24316" PostTypeId="2" ParentId="24309" CreationDate="2016-02-16T06:42:44.817" Score="1" Body="&lt;p&gt;I do not understant your question. In terms of latency, you have&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;your distance to the exchange&lt;/li&gt;&#xA;&lt;li&gt;the network latency&lt;/li&gt;&#xA;&lt;li&gt;the tcp/ip layer&lt;/li&gt;&#xA;&lt;li&gt;your operation system&lt;/li&gt;&#xA;&lt;li&gt;the speed of your code&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you just talk about the last step (do not forget you have to count the other steps twice) and you want to go as fast as possible, just write in assembly. In most assembly manuals you will find the execution time for each instruction (for generic considerations about how to count speed, you can have a look at &lt;a href=&quot;http://www.pcbheaven.com/picpages/Instruction_Cycle_Duration_and_Programmable_Delays/&quot; rel=&quot;nofollow&quot;&gt;this link&lt;/a&gt;). If you write in C, you can have a rough idea of the exec speed if you keep in mind how the compiler translate your code in assembly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But frankly, this last step is from far the fastest of the five steps... Using fpga is about to go fast at tcp/ip and os steps mainly.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2016-02-16T06:49:07.417" LastActivityDate="2016-02-16T06:49:07.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24318" PostTypeId="1" CreationDate="2016-02-16T11:23:53.943" Score="5" ViewCount="238" Body="&lt;p&gt;Why do people use &quot;Single-Counted&quot; turnover ratio when modeling for transaction cost. I read a &lt;a href=&quot;http://www.efmaefm.org/0EFMAMEETINGS/EFMA%20ANNUAL%20MEETINGS/2015-Amsterdam/papers/EFMA2015_0283_fullpaper.pdf&quot; rel=&quot;nofollow&quot;&gt;paper (Factor Investing in the Corporate Bond Market)&lt;/a&gt; which uses only the purchase side as turnover measure multiplied by a spread assumption.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems to assume that the sell side does not cost anything.&lt;/p&gt;&#xA;" OwnerUserId="6131" LastEditorUserId="848" LastEditDate="2016-02-16T20:24:30.747" LastActivityDate="2016-12-13T12:31:07.903" Title="Modeling transaction cost with single-counted turnover ratio" Tags="&lt;factor-models&gt;&lt;transaction-costs&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24319" PostTypeId="2" ParentId="23250" CreationDate="2016-02-16T11:57:25.513" Score="-3" Body="&lt;p&gt;I can't tell your intuition is right or wrong, but i can give you a partial answer to your question: What is the intuition to use exactly those factors?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, Fama-French Three-Factor Model is just one kind of &lt;a href=&quot;https://en.wikipedia.org/wiki/Principal_component_analysis&quot; rel=&quot;nofollow&quot;&gt;The Principal Component Analysis&lt;/a&gt;(PCA). In PCA analysis, you can choose any explaining variables, say 10 or 50 variables of regression. Each of the selected variables may explain the dependent variable well or not. Next, you choose Principal component among the variables which explain best(which has the largest variance). Selecting Top 3 PCs is known to be sufficient. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It depends on the data that Which of the variables are best. But Fama French Model is well known because this model's 3 Principal factors-market return, SMB and HML- have been found significant for many statistical research.&lt;/p&gt;&#xA;" OwnerUserId="19483" LastEditorUserId="2587" LastEditDate="2016-02-16T13:19:39.853" LastActivityDate="2016-02-16T13:19:39.853" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24320" PostTypeId="2" ParentId="24309" CreationDate="2016-02-16T12:24:13.417" Score="7" Body="&lt;p&gt;That will depend on the protocol you are using for market data (UDP, FAST, MDP, ITCH, etc.) and order routing (FIX, OUCH, etc.). For example, the latency to parse a UDP tick and to place a FIX order was &lt;a href=&quot;http://www.coralblocks.com/index.php/2015/08/tick-to-trade-latency-numbers-using-coralfix-and-coralreactor/&quot; rel=&quot;noreferrer&quot;&gt;around 8 micros&lt;/a&gt; as measured by tcpdump, using CoralFIX and CoralReactor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt; I'm one of the developers of CoralFIX&lt;/p&gt;&#xA;" OwnerUserId="11804" LastActivityDate="2016-02-16T12:24:13.417" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24321" PostTypeId="1" CreationDate="2016-02-16T12:29:36.507" Score="3" ViewCount="135" Body="&lt;p&gt;I'm in the Europe/Berlin Timezone and I need to calculate a global volatility indication Monday to Friday at 12:00. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My portfolio can somewhat accurately represented by 60/30/10 S&amp;amp;P500, EuroStoxx50, and Nikkei225, and I need my volatility indicator to resemble that approximately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These markets trade in entirely different time zones, and I want to combine the most up-to-date information at 12:00 in the Berlin timezone. So this info is intraday and near-realtime, but I could just use historical daily returns over 24h periods starting at 12:00:00. Basically use 12:00-prices instead of closing prices. I can either use historical daily prices, option implied volatilities, futures, it really doesn't matter. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any 'best practices' to do this? I fear that my only choice will be to provide the latest vol index by timezone/market, and not combine them at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bonus: How to treat dividends? Usually I use NET TR hedged in EUR, but I could work with anything else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for your input.&lt;/p&gt;&#xA;" OwnerUserId="1976" LastActivityDate="2016-02-17T12:54:20.210" Title="Intraday Volatility over multiple timezones" Tags="&lt;volatility&gt;&lt;intraday&gt;&lt;timezone&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24323" PostTypeId="1" CreationDate="2016-02-16T12:39:06.190" Score="3" ViewCount="157" Body="&lt;p&gt;Consider the stock price process satisfies the following SDE:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS_t=\mu_t S_tdt + \sigma S_t dW_t ,  S_0=s $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the appreciation rate process $\mu_t$ satisfies the following SDE:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d\mu_t=(a-\mu_t)dt +dB_t, \mu_0=\mu$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W_t, B_t$ are two independent Brownian motions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, there are two sources of uncertainty in the model, but only one stock available for investment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: Is this market complete?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And, is it similar to the stock consist of two independent Brownian motions?&lt;/p&gt;&#xA;" OwnerUserId="19485" LastEditorUserId="19485" LastEditDate="2016-02-16T15:20:09.500" LastActivityDate="2016-04-16T18:50:46.567" Title="Is complete market or not if appreciation rate is random?" Tags="&lt;option-pricing&gt;&lt;market&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24324" PostTypeId="1" CreationDate="2016-02-16T12:48:23.063" Score="5" ViewCount="890" Body="&lt;p&gt;I want to estimate delta, vega and gamma for a basket option.&#xA;This option is a European Call option. &#xA;The underlying is $S=\omega_1 S_1 +\omega_2 S_2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S1$ = stock price of asset 1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S2$ = stock price of asset 2&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\omega_1 $ and $\omega_2$ are the weights&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is easy to compute $\nu_{S_1} $ and $\nu_{S_2}$ but my question is about the definition of $\nu_{S}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I started computing $\nu_{S}$ as $\omega_1 \nu_{S_1} +\omega_2 \nu_{S_2}$ but then I realized that maybe this is not the correct way to compute it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My second option was to estimate a number $\theta$ with the following property: &quot;A variation on $\theta$ of each of the stock's volatilities produces a variation on the SD of S of magnitude $\epsilon$&quot;, then, compute vega as $\nu= (V(\sigma_1+\theta, \sigma_2 +\theta)-V(\sigma_1, \sigma_2))/ \epsilon$ for  a small $\epsilon$ value&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where V represent the option price and $\sigma_i$ the volatlity of the ith asset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to know if one of these methods is correct. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am new at pricing options so every information or recomendation will be useful for me.&lt;/p&gt;&#xA;" OwnerUserId="19486" LastEditorUserId="19486" LastEditDate="2016-02-16T14:19:35.843" LastActivityDate="2016-02-16T14:19:35.843" Title="Greeks of a Basket Option" Tags="&lt;greeks&gt;&lt;call&gt;&lt;basket&gt;&lt;vega&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24325" PostTypeId="2" ParentId="24323" CreationDate="2016-02-16T13:12:28.467" Score="0" Body="&lt;p&gt;In your model, you assumed drift ($\mu$) of the process is stochastic. You can better write your model like this: &#xA;$$dS_t=\mu_t S_t dt + \sigma S_t dW_t$$&#xA;$$d\mu_t=\theta(\gamma-\mu_t)dt + \eta dB_t$$&#xA;where, we used Ornstein–Uhlenbeck process to model drift. Statistically your model is complete but behind every model there must be some theoretical base or some observed behavior from the reality. In finance, there are similar model that assume volatility is stochastic (&lt;a href=&quot;http://pure.au.dk/portal-asb-student/files/47809027/Dessislava_Koleva_MSc_thesis.pdf&quot; rel=&quot;nofollow&quot;&gt;stochastic volatility model&lt;/a&gt;) and such model is used to price various derivative products. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Further, There is sufficient empirical evidence that suggest drift is not constant. &lt;strong&gt;Drift of the stock price gets influenced by risk free rate which in itself is stochastic&lt;/strong&gt;. So, You may &lt;strong&gt;reconsider your model which incorporates risk free rate into your model&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;There are numerous studies that  assume interest rate as stochastic and price derivative contract. &lt;strong&gt;The assumption of constant interest rate in Black-Scholes was first relaxed by &lt;a href=&quot;http://www.people.hbs.edu/rmerton/Theory%20of%20Rational%20Option%20Pricing.pdf&quot; rel=&quot;nofollow&quot;&gt;Merton(1973)&lt;/a&gt; [&lt;em&gt;highly technical paper&lt;/em&gt;]&lt;/strong&gt;. After that various author tested Black-Scholes model efficiency under stochastic interest rate model framework. For example &lt;a href=&quot;http://file:///C:/Users/Amit%20Jain/Desktop/Dissertation%20files/Research%20Paper/Additional/2663-3513-2-PB.pdf&quot; rel=&quot;nofollow&quot;&gt;Haowen(2012)&lt;/a&gt; used Vasicek Model for interest rate. You may check other studies too. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="16991" LastEditDate="2016-02-16T18:15:30.307" LastActivityDate="2016-02-16T18:15:30.307" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24326" PostTypeId="2" ParentId="24323" CreationDate="2016-02-16T14:04:43.517" Score="1" Body="&lt;p&gt;@Neeraj I think he meant: is the market complete considering that i have two sources of risk and only one asset? This market is incomplete. Stochastic drift isn't really used in derivative pricing because under risk neutral proability the drift is given by the rf rate. Depends on what you need to do.&lt;/p&gt;&#xA;" OwnerUserId="19432" LastActivityDate="2016-02-16T14:04:43.517" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24327" PostTypeId="1" CreationDate="2016-02-16T15:43:56.253" Score="2" ViewCount="63" Body="&lt;p&gt;I am reading &quot;Power Failure: The Inside Story of The Collapse of Enron&quot;&#xA;By Mimi Swartz, Sherron Watkins.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the book, the &lt;a href=&quot;https://books.google.ch/books?id=zxDC1AysCqkC&amp;amp;pg=PT226&amp;amp;lpg=PT226&amp;amp;dq=%22rhythmsnet%22%20put%20exaplained&amp;amp;source=bl&amp;amp;ots=RlJZ9WPSXu&amp;amp;sig=DpEeLmw8OZM6Hg8DE50WKshcCeA&amp;amp;hl=en&amp;amp;sa=X&amp;amp;ved=0ahUKEwiZm8-hyfzKAhUKt4MKHY41A5sQ6AEIHjAA#v=onepage&amp;amp;q=%22rhythmsnet%22%20put%20exaplained&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;following transaction&lt;/a&gt; is described:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Enron had USD200mn worth of futures on its own stock. The gain could not be booked as profit due to accounting restrictions.&#xA;Enron had booked a USD300mn profit booking as mark-to-market some shares in a company called RhythmsNet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I understand, their goal was to hedge their profit gain on RhythmsNet. Therefore they decided to buy a put on the RhythmsNet exposure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They set up a separate, off balance sheet, entity where they parked the forwards (by selling the forwards to the SPV at book value). The entity would have sold the put for &quot;as much as possible&quot; so that the SPV assets would have matched as close as possible the USD300mn liability without the need of additional capital injections in the SPV.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I still fail to understand why it would have made sense for Enron, however, to buy an overpriced put. My point is that the difference between the price and the fair value would have hit anyway the bottom line at some point in time.&lt;/p&gt;&#xA;" OwnerUserId="6781" LastEditorUserId="6781" LastEditDate="2016-02-17T13:51:22.320" LastActivityDate="2016-02-17T13:51:22.320" Title="Enron - RhythmsNet hedge" Tags="&lt;accounting&gt;&lt;put&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24331" PostTypeId="5" CreationDate="2016-02-16T19:32:36.183" Score="0" Body="&lt;p&gt;Quantlib is a free library for modeling, trading, and risk management in real-life providing a comprehensive software framework for quantitative finance, it is written in C++, which might be inconvenient for some users. JQuantLib aiming at Java-fans is naturally developed, correspondently, RQuantlib connects GNU R software with QuantLib.&lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="16991" LastEditDate="2016-02-16T19:57:10.677" LastActivityDate="2016-02-16T19:57:10.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24332" PostTypeId="4" CreationDate="2016-02-16T19:32:36.183" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2016-02-16T19:32:36.183" LastActivityDate="2016-02-16T19:32:36.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24333" PostTypeId="5" CreationDate="2016-02-16T19:36:37.383" Score="0" Body="&lt;p&gt;Under this approach the banks are allowed to develop their own empirical model to quantify required capital for credit risk. Banks can use this approach only subject to approval from their local regulators. For more background on the types of models banks have applied, see the Jarrow-Turnbull model.&lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="16991" LastEditDate="2016-02-16T19:57:48.253" LastActivityDate="2016-02-16T19:57:48.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24334" PostTypeId="4" CreationDate="2016-02-16T19:36:37.383" Score="0" Body="AIRB is an abbreviation of advanced internal ratings-based approach, and it refers to a set of credit risk measurement techniques proposed under Basel II capital adequacy rules for banking institutions." OwnerUserId="16991" LastEditorUserId="16991" LastEditDate="2016-02-16T19:57:39.600" LastActivityDate="2016-02-16T19:57:39.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24335" PostTypeId="5" CreationDate="2016-02-16T19:38:15.510" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2016-02-16T19:38:15.510" LastActivityDate="2016-02-16T19:38:15.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24336" PostTypeId="4" CreationDate="2016-02-16T19:38:15.510" Score="0" Body="A time zone is a region that observes a uniform standard time for legal, commercial, and social purposes." OwnerUserId="16991" LastEditorUserId="16991" LastEditDate="2016-02-16T19:57:53.773" LastActivityDate="2016-02-16T19:57:53.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24337" PostTypeId="1" AcceptedAnswerId="24353" CreationDate="2016-02-16T19:49:08.673" Score="2" ViewCount="456" Body="&lt;p&gt;hi i have a confusion about what conclusion I can draw regarding the pricing from the Capital market line and security market line. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I know, if an asset that is lying below the SML is overpriced while above the SML is underpriced, which makes sense to me. However, why can't I draw such conclusion from the CML?? I guess it may because one is measuring beta while the other concerns standard deviation... What does &quot;fairly-priced&quot; mean??? Do we only need to concentrate on systematic risk (since it reflects from SML) on pricing??&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="18468" LastActivityDate="2018-11-26T17:47:58.063" Title="CML, SML and Pricing" Tags="&lt;pricing&gt;&lt;capm&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24338" PostTypeId="2" ParentId="4299" CreationDate="2016-02-16T20:51:08.460" Score="0" Body="&lt;p&gt;I would not go into the feasibility of construction for this type of structure since this has already been discussed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming this is done , your linear greeks could be zero at one point in time ( like a delta hedge portfolio at a specific time ) but these could drift as the prices and correlations move.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For higher order greeks , they would not be zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And yes , it's possible to expose yourself to just greeks without premium , example butterfly  , risk reversals etc...&lt;/p&gt;&#xA;" OwnerUserId="19434" LastActivityDate="2016-02-16T20:51:08.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24339" PostTypeId="2" ParentId="21844" CreationDate="2016-02-16T20:53:42.737" Score="2" Body="&lt;p&gt;Yes but only with delta and gamma and speed ( if you're using speed).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for vega , it's scaled simply by vol points , i.e a factor of 100.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for Theta , it's scaled by appropriate time period ( done by *sqrt(t) )&lt;/p&gt;&#xA;" OwnerUserId="19434" LastEditorUserId="19434" LastEditDate="2016-02-17T11:10:50.873" LastActivityDate="2016-02-17T11:10:50.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24340" PostTypeId="2" ParentId="21277" CreationDate="2016-02-16T21:09:47.850" Score="0" Body="&lt;p&gt;Let's say the exercise time is T , and you bought the stock at time t &amp;lt; T. p would be your premium&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for the transaction you just mentioned , your PNL at the exercise time depends on following 2 cases :-&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;if not exercised ( ie ST &amp;lt; X )   :  p - St + ST , i.e. you closed your long position at exercise time.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;if exercised ( ie ST &gt; X ) :  p - St + X&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Assuming that you sold an OTM option (which would be a fair consideration ) ,then St &amp;lt; X , meaning payoff for Case 2 is always&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence , if you sold an OTM option , your loss would be capped at ( from Case 1 ) : St - ST&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and if you sold an ITM option , your loss would be capped at ( from both cases )&#xA;MAX ( St - ST , St - X - p )&lt;/p&gt;&#xA;" OwnerUserId="19434" LastActivityDate="2016-02-16T21:09:47.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24341" PostTypeId="2" ParentId="24318" CreationDate="2016-02-16T21:28:44.587" Score="1" Body="&lt;p&gt;I couldn't find a definitive reference of this term and it doesn't seem to be widely used. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I think I can follow the logic: In their set-up the portfolio is rebalanced monthly. So, at the start positions are taken and costs incurred, since the positions are not liquidated at the end the costs for this month are only one way. After the first month position weights are updated incurring new costs but again one way because liquidation of these positions does not take place, so only one way. This process will continue so there is never a need to liquidate and only one trip will be made per month.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2016-02-16T21:28:44.587" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24342" PostTypeId="2" ParentId="22336" CreationDate="2016-02-16T23:07:06.533" Score="3" Body="&lt;p&gt;While amsh's answer definitely gives you what you need for interview purposes, for any visual learners like me, here's what running through all possible paths ends up looking like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/jaW1V.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/jaW1V.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another thing I might consider bringing up in an interview context would be the intuitive reasoning behind why it works out this way. In other words, just explaining that a 15% loss on \$130 has a larger gross impact than a 15% gain on \$70. Then you can talk about geometric returns, high water marks, etc. to demonstrate that you understand the financial/business relevance of what's going on mathematically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;--&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For reference, the R code I threw together to make the graph above:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;r = c(5, -5, 10, -10, 15, -15) * 0.01&#xA;x0 = 100&#xA;&#xA;k = length(r)&#xA;n = factorial(k)&#xA;r = sort(r)&#xA;permList = combinat::permn(r)&#xA;results = matrix(NA, n, k+1)&#xA;results[,1] = x0&#xA;if (n != length(permList)) stop(&quot;factorial(length(r)) != length([permutations])&quot;)&#xA;for (i in 1:n)&#xA;    for (j in 2:(k+1))&#xA;        results[i,j] = results[i,j-1] + results[i,j-1]*permList[[i]][j-1]&#xA;&#xA;if (!(&quot;Euclid&quot; %in% names(windowsFonts())))&#xA;    windowsFonts(Euclid=windowsFont(&quot;Euclid&quot;))&#xA;par(family=&quot;Euclid&quot;, mar=c(2.5,2.5,0.5,0.5), mgp=c(1.5,0.5,0), cex=0.75)&#xA;matplot(t(results), pch=19, type='o', col=rgb(1:n/n,0,n:1/n,n/(k*n)), xlab='', ylab='', main='')&#xA;grid(lty=1, col=rgb(0,0,0,0.2))&#xA;abline(h=x0, lty=2)&#xA;title(xlab=expression(t), ylab=expression(X[t]), font=3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7385" LastEditorUserId="7385" LastEditDate="2016-02-16T23:18:29.547" LastActivityDate="2016-02-16T23:18:29.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24343" PostTypeId="1" AcceptedAnswerId="24415" CreationDate="2016-02-16T23:09:27.533" Score="18" ViewCount="19064" Body="&lt;p&gt;I am confused on how to run the second step of the &lt;a href=&quot;https://en.wikipedia.org/wiki/Fama%E2%80%93MacBeth_regression&quot; rel=&quot;noreferrer&quot;&gt;Fama Macbeth (1973)&lt;/a&gt; two step procedure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have monthly stock returns and monthly Fama-French factors, for around 10,000 stocks. This creates an unbalanced panel, mainly because stocks start and stop trading within the period I examine (1991-2015, 25 years, 300 months).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the first step I regress each stock's excess return on the Fama-French factors:&#xA;$$ R_{i,t} = \alpha_i + \beta_{i, MktRf} MktRf_t + \beta_{i, SMB} SMB_t + \beta_{i, HML} HML_t + \epsilon_{i, t} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I get 10,000 &quot;quadruplets&quot; $\alpha_i, \text{ } \beta_{i, MktRf}, \text{ } \beta_{i, SMB}, \text{ } \beta_{i, HML}$ for each stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But how exactly do I proceed for the second step, which requires me to run 300 (number of months in sample) regressions??&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What exactly are the dependent and the independent variables for each time period (month)?&lt;/p&gt;&#xA;" OwnerUserId="8215" LastEditorUserId="16472" LastEditDate="2016-02-20T13:42:10.870" LastActivityDate="2016-02-20T14:15:15.073" Title="Fama-Macbeth second step confusion" Tags="&lt;regression&gt;&lt;asset-pricing&gt;&lt;fama-french&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="24344" PostTypeId="2" ParentId="23112" CreationDate="2016-02-16T23:46:59.773" Score="3" Body="&lt;p&gt;&lt;em&gt;Disclaimer: &quot;soft&quot; answer.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While Gordon's comment is very true, I think it's worth adding that it also depends heavily on the fund, its approach, and its strategies. Maybe you find a place that does some signal processing stuff, in which case complex definitely helps. But there are a lot of places where you could get by without being well-versed in real/complex analysis as long as you're intellectually disciplined enough to understand and think critically about any assumptions underlying the stuff you're doing, which will likely mean learning some math at some point (be it reviewing lecture notes or reading a journal article).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Experience with mathematical analysis will definitely help with that, but it's probably worth keeping in perspective for the simple reason that you can't &lt;em&gt;prove&lt;/em&gt; a trading strategy will work as planned in the same way you can prove Euler's Identity. It's a matter of doing the proper research, which could well entail a good deal more probability/statistics than math. You could easily understand all the math under the hood and still fail to stress-test a model with out-of-sample data or with relaxed assumptions and end up losing a lot of money. Hence why I feel it's worth at least mentioning that ultimately the ability to think critically matters about as much as &lt;em&gt;what&lt;/em&gt; you're thinking about.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;TLDR&lt;/strong&gt;: Intellectual discipline matters, regardless of subject matter.&lt;/p&gt;&#xA;" OwnerUserId="7385" LastActivityDate="2016-02-16T23:46:59.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24345" PostTypeId="1" CreationDate="2016-02-16T23:53:48.447" Score="7" ViewCount="1470" Body="&lt;p&gt;All stochastic process I see always have independent increments. It is true for:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;standard brownian motion&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;geometric brownian motion (?)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Ornstein Uhlenbeck (?)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;in general, Levy process&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the most common stochastic process used in quant finance that have &lt;strong&gt;dependent&lt;/strong&gt; increments, i.e. $X(t+h) - X(t)$ &lt;strong&gt;not independent&lt;/strong&gt; from $X(t)$ ?&lt;/p&gt;&#xA;" OwnerUserId="19491" LastActivityDate="2016-02-17T14:18:50.323" Title="Stochastic process with non-independent increments" Tags="&lt;stochastic-processes&gt;&lt;brownian-motion&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24346" PostTypeId="1" CreationDate="2016-02-17T00:39:31.413" Score="11" ViewCount="985" Body="&lt;p&gt;I have been hacking around with algorithmic trading as a hobby project to build my data analysis skills, coding skills, and learn more about financial markets. As part of this project I am interested in developing a web interface to monitor my portfolio. I have done some homework but would like to hear the community's thoughts, as there seems to be much more focus on backtesting and other analysis in the open-source community (for good reason).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am hoping to build something (in python) that could be used to monitor a real-money portfolio, as well as be used as a project on my CV that would not be laughed out of a reasonably sophisticated trading shop. My general timeframe per trade will be 5 minutes or longer, so nothing most folks would refer to as HFT.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What features* should an investment-grade algo dashboard include? Are there any examples of note?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Clarification&lt;/strong&gt;: I am not just looking for visualizations, but also standard/key metrics. For instance, I would expect to see some measures of value at risk, returns over key periods, etc.&lt;/p&gt;&#xA;" OwnerUserId="15699" LastEditorUserId="15699" LastEditDate="2016-02-25T06:31:07.217" LastActivityDate="2017-06-04T17:11:22.373" Title="Which features to include in an algorithmic trading dashboard?" Tags="&lt;algorithmic-trading&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24347" PostTypeId="2" ParentId="24346" CreationDate="2016-02-17T03:49:18.810" Score="7" Body="&lt;p&gt;Unfortunately, the answer is: it depends. People care about different metrics and visualizations depending on the type of strategy that they are running. It is a very bad idea to spend time creating visualizations without knowing what you are using those visualizations for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A common feature is a 'table-oriented' layout of data about your orders and executions. This is the lowest-level information on which most of your other metrics and visualizations are derived. Every commercial trading system with a UI that I've come across has this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should play around with a few free trial or open source trading systems and get ideas from there.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="4660" LastEditDate="2016-02-17T05:22:09.603" LastActivityDate="2016-02-17T05:22:09.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24348" PostTypeId="2" ParentId="24321" CreationDate="2016-02-17T06:27:34.493" Score="1" Body="&lt;p&gt;(I don't have enough community points to comment, but this is not a proper answer) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you mean implied volatility or realised? If the latter I would suggest using futures prices as each of those indices have futures that are trading live at 12:00 Berlin time. Futures tend to be what practitioners look to for the most up-to-date valuation of an underlying anyway, as they are (usually) more liquid and easy to trade than the cash product.  &lt;/p&gt;&#xA;" OwnerUserId="5498" LastActivityDate="2016-02-17T06:27:34.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24349" PostTypeId="2" ParentId="24345" CreationDate="2016-02-17T07:03:44.633" Score="2" Body="&lt;p&gt;One of the most famous processes with correlated (thus dependent) increments is &lt;a href=&quot;https://en.wikipedia.org/wiki/Fractional_Brownian_motion&quot; rel=&quot;nofollow&quot;&gt;Fractional Brownian motion&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case&#xA;$$&#xA;E[B_H(t) B_H (s)]=\frac{1}{2} (|t|^{2H}+|s|^{2H}-|t-s|^{2H}),&#xA;$$&#xA;where $H$ is a parameter. For $H=1/2$ we get back at uncorrelated increments, thus Brownian motion.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-02-17T07:03:44.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24350" PostTypeId="2" ParentId="24345" CreationDate="2016-02-17T07:14:47.337" Score="4" Body="&lt;p&gt;Geometric Brownian Motion has independent increments but Ornstein-Uhlenbeck doesn't have this property. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://math.stackexchange.com/questions/795797/ornstein-uhlenbeck-process-increments&quot;&gt;For more details you can look here.&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19494" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2016-02-17T14:18:50.323" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24351" PostTypeId="2" ParentId="19450" CreationDate="2016-02-17T07:39:47.380" Score="1" Body="&lt;p&gt;First, you need to derive the distribution of $S_T$. You have given&#xA;$$dS_u=\sigma dW_u$$&#xA;Integrate both side: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\int_t^T dS_u=\int_t^T dW_u$$&#xA;$$S_T-S_t=\sigma\big(W_T-W_t\big)$$&#xA;We know that $W_t-W_t \sim N(0, T-t)$, so &#xA;$$S_T-S_t \sim N(0, \sigma^2 (T-t))$$&#xA;$$S_T|S_t\sim N(S_t, \sigma^2(T-t))$$&#xA;It is given that initial value of $S_t$ is $s$, so we have&#xA;$$S_T|S_t\sim N(s, \sigma^2(T-t))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, comes to main problem, You want $\mathbb{E}[-e^{-\gamma(x+qS_{T})}]$. Everything except $S_T$ is constant and get them out of expectation expression. So, &#xA;$$\mathbb{E}[-e^{-\gamma(x+qS_{T})}]=-e^{\gamma x}\mathbb{E}[e^{-\gamma qS_{T}}]$$&#xA;The expectation of the RHS is just like moment generating function. If random variable $X$ follows normal distribution, with mean $\mu$ and variance $\sigma^2$,   its MGF is: &#xA;$$\mathbb{E}[e^{kX}]=e^{\mu k + \frac12 \sigma^2 k^2 }$$ &#xA;Assuming $k=-\gamma q$, your last equation will result into &#xA;\begin{align}&#xA;\mathbb{E}[-e^{-\gamma(x+qS_{T})}]&amp;amp;=-e^{\gamma x}\mathbb{E}[e^{-\gamma qS_{T}}]\\&#xA;&amp;amp;=-e^{\gamma x} e^{-s\gamma q+ \frac12 \sigma^2 (T-t)^2 \gamma^2 q^2} &#xA;\end{align}&#xA;This is exactly what you wanted. So, to solve this neither you required Taylor series nor any Log normal distribution.&lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2016-02-17T07:39:47.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24352" PostTypeId="2" ParentId="24345" CreationDate="2016-02-17T08:31:19.963" Score="6" Body="&lt;p&gt;First thing, &lt;strong&gt;Geometric Brownian motion do not have independent increments&lt;/strong&gt;. It is only Wiener process or Brownian motion that have independent increment. Under GBM, the &lt;strong&gt;increments of process (assume stock prices) show markovian property&lt;/strong&gt;. It means that changes in the process depend on the current price level. &lt;strong&gt;In layman terms&lt;/strong&gt;, the magnitude of change in stock price atleast depend upon existing price level. The probability that stock price will change by \$5 will be different when stock price is \$100, and  when stock price is just \$20. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Same argument also hold true with Ornstein Uhlenbeck. The detail answer of why increments under Ornstein Uhlenbeck are not random is given on &lt;a href=&quot;https://math.stackexchange.com/questions/795797/ornstein-uhlenbeck-process-increments&quot;&gt;Math S.E&lt;/a&gt;. (Note: The link was first cited by Leon in his answer.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, your question is:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;What are the most common stochastic process used in quant finance that&#xA;  have dependent increments, i.e. $X(t+h)−X(t)$ not independent&#xA;  from $X(t)$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;To model such stochastic process where increments are not random, you can use &lt;strong&gt;ARMA class of models&lt;/strong&gt;. They are very common in finance and used extensively to &lt;strong&gt;model stock return&lt;/strong&gt; and other process(like &lt;strong&gt;interest rate, GDP&lt;/strong&gt;, etc.) too.  &lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2016-02-17T11:31:05.510" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24353" PostTypeId="2" ParentId="24337" CreationDate="2016-02-17T09:19:02.950" Score="1" Body="&lt;p&gt;First understand that &lt;strong&gt;CML&lt;/strong&gt; shows relationship between &lt;strong&gt;portfolio&lt;/strong&gt; expected return and standard deviation, while &lt;strong&gt;SML&lt;/strong&gt; shows relationship between &lt;strong&gt;a stock&lt;/strong&gt; expected return and beta. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any portfolio above CML is not achievable. It means you can not create portfolio that will provide you higher return for a given risk than what is available on CML. And investor will never choose any portfolio below the CML because he can always get higher return by choosing portfolio on CML for a given risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Further, CAPM only provide risk premium for systematic risk only because it  assumes idiosyncratic risk can be eliminated through diversification and hence place no premium for idiosyncratic risk.  &lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="16991" LastEditDate="2016-02-22T08:48:20.413" LastActivityDate="2016-02-22T08:48:20.413" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24354" PostTypeId="2" ParentId="21844" CreationDate="2016-02-17T12:11:27.317" Score="3" Body="&lt;p&gt;Depending on the Greek that you are calculating. You need to consider if they are additive or not, and how they take into account timing. In some cases you need to take into account that time is scaled or not, and so on..  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming Black-Scholes, and that they are correctly scaled, you can considere that Delta, Gamma, Theta, Vega and Rho are additive. &lt;/p&gt;&#xA;" OwnerUserId="12089" LastActivityDate="2016-02-17T12:11:27.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24355" PostTypeId="2" ParentId="24345" CreationDate="2016-02-17T12:15:37.827" Score="2" Body="&lt;p&gt;Stochastic time-changed levy processes have uncorrelated increments (which is consistent with &quot;rational&quot; markets) but not independent.  In such a model, volatility is (heuristically) mean reverting while returns are uncorrelated.  The simplest such model is &lt;a href=&quot;https://en.wikipedia.org/wiki/Heston_model&quot; rel=&quot;nofollow&quot; title=&quot;Heston&amp;#39;s Model&quot;&gt;Heston's model&lt;/a&gt;.  For a more comprehensive view, see &lt;a href=&quot;http://faculty.baruch.cuny.edu/lwu/papers/timechangeLevy_JFE2004.pdf&quot; rel=&quot;nofollow&quot;&gt;Carr and Wu's paper&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2016-02-17T12:15:37.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24356" PostTypeId="2" ParentId="24321" CreationDate="2016-02-17T12:54:20.210" Score="1" Body="&lt;p&gt;I gather from your question that you are looking for an accurate measure for your portfolio volatility. Keep in mind that the portfolio volatility is not equal to the weighted sum of its components and you have to estimate the correlation / covariance structure of your portfolio components. The volatility part is much easier to estimate than the covariance. You basically have three options:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Use daily historical returns to proxy for the volatility and estimate the covariance. Here you have a lag and information will be incorporated much more slowly. However, your measure will be less volatile. There is some literature on how to estimate volatility and covariance’s correctly from daily data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Use intraday returns (e.g. last 24 trading hours) to compute volatility and covariance. The lag is much smaller here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Use option implied volatilities (from at-the-money options). The problem with implied volatilities is that you cannot estimate the covariance structure. You can either ignore this (and underestimate the true volatility) or you could use an historic measure as a proxy. Both options are not optimal. However, you have no problem with trading times as the implied volatility can be estimated instantaneously.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given that you are looking for daily updates I would go with option 2. If you care only about the volatilities of the portfolio components take option 3.&lt;/p&gt;&#xA;" OwnerUserId="9283" LastActivityDate="2016-02-17T12:54:20.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24357" PostTypeId="2" ParentId="23240" CreationDate="2016-02-17T13:44:36.137" Score="2" Body="&lt;p&gt;You may want to consider &lt;a href=&quot;http://www.eurexchange.com/exchange-en/products/equ/fut&quot; rel=&quot;nofollow&quot;&gt;Single Stock Futures in Eurex&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BMW: &lt;a href=&quot;http://www.eurexchange.com/exchange-en/products/equ/fut/BMW/25544&quot; rel=&quot;nofollow&quot;&gt;http://www.eurexchange.com/exchange-en/products/equ/fut/BMW/25544&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16351" LastActivityDate="2016-02-17T13:44:36.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24358" PostTypeId="2" ParentId="23240" CreationDate="2016-02-17T13:47:28.480" Score="1" Body="&lt;p&gt;Is much simpler, what he really want's is an exotic option. Therefore OTC. So it's name may depend on the counterparty and the condition he imposes. But regarding my comment, he needs to have clear what he wants to buy and sell. As all the conditions can be considered in the model, as long as they are determined with his counterparty. &lt;/p&gt;&#xA;" OwnerUserId="12089" LastActivityDate="2016-02-17T13:47:28.480" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24359" PostTypeId="2" ParentId="23240" CreationDate="2016-02-17T14:52:03.623" Score="2" Body="&lt;p&gt;There is no product which truly matches your requirement. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As mentioned in other answers and comments you can structure the product by using a future or a swap. However, in both cases you have an indirect knock-out which is when you receive a margin call requiring you to provide additional funds. You will always have this problem as you essentially borrow money. In addition, a future will have to be rolled into the next contract. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you choose to buy options, as suggested by some, you do not have a constant leverage. Moreover, your exposure is not symmetric and you will loose the time value of the option over time which makes this type of investment expensive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think you get closest to your desired product by taking out a bank loan and buying 5 or 20 shares instead of 1. If you prefer to not receive dividends you can buy zero-calls instead. However, I do not recommend to use this strategy. Also keep in mind that you will need to pay interest on the bank loan during the investment period. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are a retail investor, you are likely best off with an ETF. If you must, you can also buy a leveraged ETF. Leveraged ETFs do not require a margin, have no knock-out do not have a fixed maturity. However, ETFs are usually not available for single stocks.&lt;/p&gt;&#xA;" OwnerUserId="9283" LastEditorUserId="9283" LastEditDate="2016-02-20T13:29:25.087" LastActivityDate="2016-02-20T13:29:25.087" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24360" PostTypeId="2" ParentId="23240" CreationDate="2016-02-17T15:29:56.977" Score="3" Body="&lt;p&gt;It could be done as a kind of Structured Product. I don't know of a specific name for this type of instrument. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From what you describe, it doesn't actually involve any optionality, just leveraged exposure to an underlying. You also mention participating in downside risk, so it's not an option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But you do mention a 'constant factor', which you need to explain a bit more, but sounds like some kind of 'coupon'. Depending on what you mean by this, you could come up with a Structured Product that is basically a Total Return Equity Swap, plus some extra (possibly contingent) payout component. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The payoff &quot;index&quot; of the swap component would be defined as 5x of your underlying. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;While relatively simple to price and mark to market, any reasonable dealer would probably charge a large fee to take on this risk. (Since they would have to go out and hedge this extremely leveraged position, probably using options and/or futures)&lt;/p&gt;&#xA;" OwnerUserId="16600" LastActivityDate="2016-02-17T15:29:56.977" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="24361" PostTypeId="2" ParentId="21844" CreationDate="2016-02-17T15:38:29.667" Score="3" Body="&lt;p&gt;Both answers above are correct - you can simply add the greek exposures assuming you are using &quot;simple&quot; greeks like delta, gamma, vega, theta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, two important points:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Make sure your underlying increments are the same (e.g. same 1pt vol move for vega calc, same price move for delta)&lt;/li&gt;&#xA;&lt;li&gt;Be careful when adding greeks from different underlyings:&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Especially for delta and gamma, you can't add them from different stocks and expect good/usable results, especially if you are talking about single names. &lt;/li&gt;&#xA;&lt;li&gt;For Vega, you might be able to get away with a simplifying assumption that the underlying equity vol is correlated (depending on the names). &lt;/li&gt;&#xA;&lt;li&gt;For theta, you are fine summing everything since the underlying (time) is the same for all calculations.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="16600" LastActivityDate="2016-02-17T15:38:29.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24362" PostTypeId="2" ParentId="24346" CreationDate="2016-02-17T16:19:42.883" Score="0" Body="&lt;p&gt;Pick a strategy that &quot;works&quot; for the given time period. Maybe correlation/pairs trading? Bare minimum here are intraday levels, intraday divergence, price ratio, correlations for different time periods, standard deviation (or some other such measure) bands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keep in mind you don't need to necessarily &quot;buy in&quot; to the strategy for a first version. Don't spend too much time on this part (for now) and focus on the underlying mechanics. Once you have a working dashboard for a given strategy, you'll find the work for adapting it to some other strategy is a lot easier. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll spend way more time than you think on &quot;plumbing&quot; and infrastructure, so your goal should be to take the current enthusiasm you have and use it to get to a finished/usable product as quickly as possible. Good luck!&lt;/p&gt;&#xA;" OwnerUserId="16600" LastActivityDate="2016-02-17T16:19:42.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24363" PostTypeId="1" CreationDate="2016-02-17T17:09:42.603" Score="1" ViewCount="62" Body="&lt;p&gt;Have trouble understanding this question, seems quite open ended. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume that $S(0)$ is the current rate of exchange for foreign currency. Assume that and $K_n$ and $K_f$ are rates of return on home and foreign currency if it is invested over a period $T$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume that the forward rate of exchange $F &amp;gt; S(0)\frac{1+K_n}{1+K_f}$. Construct a portfolio that offers a risk free profit. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not quite sure what I'm asked to do here...&lt;/p&gt;&#xA;" OwnerUserId="17063" LastActivityDate="2016-02-17T17:35:49.887" Title="construct portfolio offering risk free profit" Tags="&lt;fx&gt;&lt;forward-rate&gt;&lt;homework&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24364" PostTypeId="1" CreationDate="2016-02-17T17:16:51.857" Score="1" ViewCount="47" Body="&lt;h2&gt;Basic question&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I am familiar with the data returned from Yahoo. For indices and the like (e.g. ETFs) there are seven columns of data: Date, Open, High, Low, Close, Volume, Adjusted. We only need consider Close and Adjusted here.&#xA;Here is &lt;a href=&quot;http://www.investopedia.com/terms/a/adjusted_closing_price.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;a brief definition of Adusted-Prices&lt;/a&gt;, which states that they are used when examining historical prices (without any references).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;I would like to know what the relative merits are for using the market closing prices for any given asset, versus the adjusted prices, which take events such as dividend-payouts into account.&lt;/strong&gt;&#xA;As &lt;a href=&quot;https://money.stackexchange.com/questions/21780/should-i-use-regular-or-adjusted-close-for-backtesting&quot;&gt;the accepted answer in this thread states&lt;/a&gt; (in the personal finance SO), which of the two you should select depends on what you want to use it for. This is where I am unsure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I feel like the adjusted prices would perhaps be more telling of the market sentiment towards and actual asset, as a dividend payout for example would likely improve investor confidence towards that stock.&#xA;On the other hand, I am looking at predicting number based on other numbers, which are those actually displaying what was most recently paid for that asset, so it feels more concrete to use the closing prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any references to literature on this topic would be greatly appreciated.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;More detailed example&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I am using a wide variety of data in a model that predicts the return of the Dow Jones. This includes the returns of other indices as well as commoodities and currencies etc.&#xA;Specifically for the indices that I am looking at, I had a look to see what the difference was between the Close and Adjusted prices. Here is the code (in R using &lt;code&gt;quantmod&lt;/code&gt;to get the relevant data) and the results&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quantmod)     # to get market data&#xA;library(data.table)   # my preferred way to manipulate the data&#xA;&#xA;myDAX &amp;lt;- getSymbols(Symbols =  c(&quot;^GDAXI&quot;), auto.assign = FALSE)&#xA;myDOW &amp;lt;- getSymbols(Symbols = c(&quot;^DJI&quot;), auto.assign = FALSE)&#xA;myEEM &amp;lt;- getSymbols(Symbols = c(&quot;EEM&quot;), auto.assign = FALSE)&#xA;myFTSE &amp;lt;- getSymbols(Symbols = c(&quot;^FTSE&quot;), auto.assign = FALSE)&#xA;myGSPC &amp;lt;- getSymbols(Symbols = c(&quot;^GSPC&quot;), auto.assign = FALSE)&#xA;myN225 &amp;lt;- getSymbols(Symbols = c(&quot;^N225&quot;), auto.assign = FALSE)&#xA;&#xA;## Create data tables&#xA;dax &amp;lt;- as.data.table(myDAX)&#xA;dow &amp;lt;- as.data.table(myDOW)&#xA;eem &amp;lt;- as.data.table(myEEM)&#xA;ftse &amp;lt;- as.data.table(myFTSE)&#xA;sp500 &amp;lt;- as.data.table(myGSPC)&#xA;n225 &amp;lt;- as.data.table(myN225)&#xA;&#xA;## create new column 'delta' - the difference between adjusted and closing prices&#xA;dax[, delta := GDAXI.Adjusted - GDAXI.Close]&#xA;dow[, delta := DJI.Adjusted - DJI.Close]&#xA;eem[, delta := EEM.Adjusted - EEM.Close]&#xA;ftse[, delta := FTSE.Adjusted - FTSE.Close]&#xA;sp500[, delta := GSPC.Adjusted - GSPC.Close]&#xA;n225[, delta := N225.Adjusted - N225.Close]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here we get a results printed out, saying how many of the values for &lt;code&gt;delta&lt;/code&gt; were zero.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;print(paste0(sum(dax$delta == 0) / nrow(dax) * 100, &quot;% zero delta&quot;))&#xA;[1] &quot;100% zero delta&quot;&#xA;&#xA;print(paste0(sum(dow$delta == 0) / nrow(dow) * 100, &quot;% zero delta&quot;))&#xA;[1] &quot;100 % zero delta&quot;&#xA;&#xA;print(paste0(sum(eem$delta == 0) / nrow(eem) * 100, &quot;% zero delta&quot;))&#xA;[1] &quot;1.66 % zero delta&quot;&#xA;&#xA;print(paste0(sum(ftse$delta == 0) / nrow(ftse) * 100, &quot;% zero delta&quot;))&#xA;[1] &quot;100 % zero delta&quot;&#xA;&#xA;print(paste0(sum(sp500$delta == 0) / nrow(sp500) * 100, &quot;% zero delta&quot;))&#xA;[1] &quot;100% zero delta&quot;&#xA;&#xA;print(paste0(sum(n225$delta == 0) / nrow(n225) * 100, &quot;% zero delta&quot;))&#xA;[1] &quot;100% zero delta&quot;&#xA;&#xA;print(paste0(sum(sse$delta == 0) / nrow(sse) * 100, &quot;% zero delta&quot;))&#xA;[1] &quot;100% zero delta&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We can see that only in the case of the ETF &lt;code&gt;EEM&lt;/code&gt; did we get any differences in the prices, only 1.66% of the delta values being zero.&#xA;Looking at the data for individual stocks (for example: &lt;a href=&quot;http://finance.yahoo.com/q/hp?s=AAPL%20Historical%20Prices&quot; rel=&quot;nofollow noreferrer&quot;&gt;Apple&lt;/a&gt;, I wouldn't expect hardly any delta values to be equal to zero!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A final question remains: &lt;strong&gt;Why are the prices of the indices above not adjusted at all, considering their constituents &lt;em&gt;are&lt;/em&gt; adjusted?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="7440" LastEditorUserId="-1" LastEditDate="2017-04-13T12:25:30.743" LastActivityDate="2016-02-17T22:15:38.737" Title="Relative merits of Adjusted versus Closing prices for market predictions" Tags="&lt;forecasting&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24365" PostTypeId="2" ParentId="24363" CreationDate="2016-02-17T17:35:49.887" Score="2" Body="&lt;p&gt;The question is asking if there is a way to create arbitrage by borrowing in one currency, exchanging at the current spot rate, lending in another currency and converting the future payments back to the original currency at the forward exchange rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, given the assumption above, if there were no arbitrage the inequality above could not hold. However, given the inequality, it would be optimal to borrow in the foreign currency at rate of $K_f$, convert that cash flow into the local currency at the spot rate, lend the local cash flow at $K_n$ and enter into a forward contract to convert the future local cash flows into the foreign currency to pay off the initial debt. This is because the true forward price (converting local currency into foreign currency) is more expensive than the synthetic forward price. Therefore, it is optimal to be on the side that is converting the foreign currency into local currency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more information, see: &lt;a href=&quot;http://www.investopedia.com/terms/t/triangulararbitrage.asp&quot; rel=&quot;nofollow&quot;&gt;http://www.investopedia.com/terms/t/triangulararbitrage.asp&lt;/a&gt;  &lt;/p&gt;&#xA;" OwnerUserId="19089" LastActivityDate="2016-02-17T17:35:49.887" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24366" PostTypeId="1" CreationDate="2016-02-17T18:01:57.830" Score="2" ViewCount="601" Body="&lt;p&gt;How does one answer this potential interview question? It's not a very clear question since there are clearly many factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first guess would be to talk about looking at the expected (mean) return of the stock - is it increasing or decreasing in recent years. Could also then examine the volatility of this stock - using variance/standard deviation, we can see how reliable these returns have been over previous years. We could also use something like the Sharpe ratio to see how sensitive it is to fluctuations in volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We could also look at its beta (or Treynor ratio) to see how sensitive it is to market risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We wouldn't want to look at things like Delta since this is to do with derivatives and not the underlying stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are my ideas above correct? Is there anything important I have overlooked?&lt;/p&gt;&#xA;" OwnerUserId="19439" LastActivityDate="2018-01-16T22:05:16.987" Title="How would you try to predict the future behaviour of a stock price?" Tags="&lt;equities&gt;" AnswerCount="5" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24367" PostTypeId="2" ParentId="3750" CreationDate="2016-02-17T18:52:59.090" Score="0" Body="&lt;p&gt;Most funds/houses with sales businesses ( including IBs ) usually sell structured exotic options to their clients and as a result are left with numerous &quot;Short&quot; uncovered positions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since they'd not be able to find buyers for these all short positions , what they do is delta hedge them in their books.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as retail investor is concerned , he/she might anticipate very less or no volatility in the concerned underlying , hence would be incentivized to short OTM options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Briefly saying, that's how it works !&lt;/p&gt;&#xA;" OwnerUserId="19434" LastActivityDate="2016-02-17T18:52:59.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24368" PostTypeId="2" ParentId="24366" CreationDate="2016-02-17T18:54:10.377" Score="6" Body="&lt;p&gt;The real answer is that you should never try to predict the future behavior of anything. Instead, ask yourself what sorts of risk you are comfortable taking and work back from there. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That being said, the quantitative finance textbook approach would look something like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Come up with a model for equity movement - this is typically some sort of brownian motion-based model, with a component for mean (drift) as you mentioned. You will also need assumptions/calculations for other things you mention such as volatility and/or beta (depending on your portfolio).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simulate a whole bunch of these over your chosen time period. Price your portfolio (simple if you just want one equity) in each simulation. Use your method of choice (Value at Risk, Expected Shortfall, Worst-case scenario) to measure your loss against your risk appetite (first question).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, finally, realize that all of these models are technically 'wrong' but still potentially useful for answering interview questions!&lt;/p&gt;&#xA;" OwnerUserId="16600" LastEditorUserId="16600" LastEditDate="2018-01-16T20:54:25.943" LastActivityDate="2018-01-16T20:54:25.943" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24369" PostTypeId="2" ParentId="9239" CreationDate="2016-02-17T19:01:15.660" Score="0" Body="&lt;p&gt;In Finance, a Position , or a Greek ( delta , gamma , vega , etc... ) or any other quantity is said to be &quot;long&quot; if the holder benefits when that position / greek increases with time ahead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope it clarifies your doubt !&lt;/p&gt;&#xA;" OwnerUserId="19434" LastActivityDate="2016-02-17T19:01:15.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24370" PostTypeId="2" ParentId="23240" CreationDate="2016-02-17T19:42:46.653" Score="1" Body="&lt;p&gt;I would suggest you two ways to have such exposure :-&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;LEAPS ( Long term equity anticipation securities ) are basically long-dated options for terms like 2-3 years. They're pretty much available in form of calls and puts on common equity ticks. Options in general , as you know , provide huge leverage. Hence this satisfies all your conditions. &#xA;An additional bonus feature is downside risk protection&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Find a broker who provides you such leverage on your investments. AFAIK , you'd have to maintain a very high margin for such condition to be in place. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Personally , I'd suggest that Option 1 would be the good way to go !&lt;/p&gt;&#xA;" OwnerUserId="19434" LastActivityDate="2016-02-17T19:42:46.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24371" PostTypeId="2" ParentId="24299" CreationDate="2016-02-17T20:17:55.063" Score="1" Body="&lt;p&gt;After @AlexC's suggestion I tried adding fills to flatten the net positioning and the two calculations do indeed return the same output in terms of Realized PnL:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;new ProfitLoss(new[] {&#xA;    new Fill(12, 100.0),&#xA;    new Fill(17, 99.0),&#xA;    new Fill(-9, 101.0),&#xA;    new Fill(-4, 105.0),&#xA;    new Fill(3, 103.0),&#xA;    new Fill(-19, 100)&#xA;}).Dump();&#xA;&#xA;var calc = new ProfitLoss();&#xA;calc.AddFill(12, 100);&#xA;calc.AddFill(17, 99);&#xA;calc.AddFill(-9, 101);&#xA;calc.AddFill(-4, 105);&#xA;calc.AddFill(3, 103);&#xA;calc.AddFill(-19, 100);&#xA;calc.Dump();&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Both of the above yield a Realized PnL of 37.&lt;/p&gt;&#xA;" OwnerUserId="11631" LastActivityDate="2016-02-17T20:17:55.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24372" PostTypeId="1" AcceptedAnswerId="24389" CreationDate="2016-02-17T21:18:36.523" Score="1" ViewCount="119" Body="&lt;p&gt;I specifically want to know how to model a jump condition while valuing a derivative.Example :- the jumps which are observed in digital product payoffs, or barriers and knockouts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although a mathematical explanation for this would be fairly easy to provide , I'd be more interested in practical aspect of this condition.&lt;/p&gt;&#xA;" OwnerUserId="19434" LastActivityDate="2016-02-18T21:13:34.423" Title="How to price jumps in payoffs" Tags="&lt;option-pricing&gt;&lt;derivatives&gt;&lt;jump&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24373" PostTypeId="1" CreationDate="2016-02-17T22:49:56.877" Score="1" ViewCount="823" Body="&lt;p&gt;Question, pretty much says it.  Is there a reliable place where this data can be found or, if not, is there a reliable place where the underlying data needed to &lt;em&gt;calculate&lt;/em&gt; the constant maturity price could be found?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks.&lt;/p&gt;&#xA;" OwnerUserId="19504" LastActivityDate="2016-02-17T22:49:56.877" Title="How to find or calculate 30-day constant maturity price of a future?" Tags="&lt;futures&gt;&lt;vix&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24374" PostTypeId="1" CreationDate="2016-02-17T23:13:06.610" Score="3" ViewCount="1203" Body="&lt;p&gt;I'm doing some Fixed Income analytics work and wanted to know if there where any opensource C# libraries that I could use in order to avoid writing functions for generic calculations like YTM and Duration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for the help,&#xA;Rafael&lt;/p&gt;&#xA;" OwnerUserId="19505" LastActivityDate="2016-02-18T17:56:53.743" Title="Are there any opensource C# libraries for calculating bond duration and other FI Analytics?" Tags="&lt;fixed-income&gt;&lt;programming&gt;&lt;duration&gt;&lt;yield&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24375" PostTypeId="1" CreationDate="2016-02-18T02:23:11.800" Score="1" ViewCount="1984" Body="&lt;p&gt;IR Delta and Gamma. Can someone please explain if my understanding is accurate as relates to a 2yr interest rate swap? You are considered to be long Delta  in an interest rate swap if you are receiving the fixed rate. As for gamma, which is the rate of change of your delta, suppose the short end of the curve rallies and you are receiving the fixed rate, would this mean you are long gamma? If the curve rallies, bond prices go up and yields go down, therefore receiving a fixed rate is good for you, therefore long gamma?&lt;/p&gt;&#xA;" OwnerUserId="19506" LastEditorUserId="19506" LastEditDate="2016-02-20T01:27:12.580" LastActivityDate="2018-11-10T15:30:38.997" Title="Interest Rate Risk - The Greeks" Tags="&lt;interest-rates&gt;&lt;greeks&gt;&lt;delta&gt;&lt;interest&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24376" PostTypeId="2" ParentId="24304" CreationDate="2016-02-18T02:43:26.580" Score="1" Body="&lt;p&gt;As a saver you are happy to receive interest but as a borrower the tables are turned and you have to &lt;em&gt;pay&lt;/em&gt; interest on the outstanding balance.  It is a different perspective that you may not thought about before.  Basically you should try to reduce the interest you are paying to the minimum necessary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example to buy a house you may need to get a mortgage, i.e. a large loan from a bank. You repay the bank by making equal monthly payments. These payments include both a loan repayment and a certain amount of interest calculated based on the remaining outstanding balance. You also (in the USA) have an option to repay early, which will decrease the outstanding debt and thus future interest payments. Vice versa, in those cases were the bank allows you to postpone a payment, you will literally pay the price by having a larger loan balance and having to make greater payments in the future. The bank loves it (as long as real estate prices hold steady), but during the financial crisis of 2008 many borrowers hurt themselves by making use if this kind of &quot;feature&quot; that they perhaps didn't fully understand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The passage you quoted is giving some numerical examples to illustrate this rather simple idea. A borrower gains by making more or quicker payments on a loan.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-02-18T02:55:07.927" LastActivityDate="2016-02-18T02:55:07.927" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24377" PostTypeId="2" ParentId="3750" CreationDate="2016-02-18T03:51:29.993" Score="2" Body="&lt;p&gt;I see a lot of complicated answers here to a very simple question. A real-world example of using short options is to simply sell puts in order to buy the underlying stock at discounted prices. If used in this manner, short puts are actually less risky than simply buying the stock outright and consequently have the same risk graph as the covered call, which is considered an extremely conservative strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say the stock market has a 15% correction. Nobody knows when the correction is going to end and buying the SPY ETF at any point during the correction is like trying to catch a falling knife. So assuming you see value in the stock market, instead of buying a couple of hundred shares right now, you can short 2 put options on the SPY with a strike price about 5% below the current price and 20 days away. You can keep doing this month after month until you finally get assigned the 200 shares of SPY. So you bought lower and got paid for waiting until it got lower.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously, if the stock crashes big after you sold the puts, then this strategy will be catastrophic. BUT, it will be less catastrophic than if you had bought the 200 shares outright or averaged down without a stop (which a lot of &quot;risk-averse&quot; people like to do). One way to mitigate this unlimited risk is to not let the strategy get out of control and buy back the short puts as soon as they go in-the-money for example. Option prices can move very fast, so even though shorting puts is a simple strategy, you have to watch your position very carefully.&lt;/p&gt;&#xA;" OwnerUserId="19508" LastActivityDate="2016-02-18T03:51:29.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24378" PostTypeId="2" ParentId="24366" CreationDate="2016-02-18T04:40:19.177" Score="1" Body="&lt;p&gt;Everyone tries to predict the future in an endless variety of ways ranging from tarot cards and crystal balls, to elliot wave theory and neural networks. But, since this is a forum about quantitative finance, I think an appropriate answer to your question is historical backtesting of stock prices against a variety of indicators. These indicators could be economic indicators (ex: unemployment reports, interest rates), behavior indicators (ex: VIX, Put Call Ratio, COT, AAII Bull Bear ratio), or technical indicators (ex: broad indexes, linear regression, standard deviation, ATR). Some options players also try to predict moves by looking for signs of potential insider trading by looking for sudden spikes on a stock's historical implied volatility of options. So yes, in all of these cases, you merely try to predict the future by looking at the past.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The things you mentioned like sharpe ratio, beta, and delta are more for evaluating portfolio risk and are not useful for predicting the future.&lt;/p&gt;&#xA;" OwnerUserId="19508" LastActivityDate="2016-02-18T04:40:19.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24379" PostTypeId="2" ParentId="24346" CreationDate="2016-02-18T05:43:44.200" Score="4" Body="&lt;p&gt;Believe me, you won't find anything out there. I've been in the same position as you several years ago. &#xA;So, I decided to design the dashboard myself. &#xA;Below a link of what I did (html5) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.slideshare.net/silahian/visualoptions-dashboard&quot; rel=&quot;nofollow noreferrer&quot;&gt;trading dashboard &lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13990" LastEditorUserId="2183" LastEditDate="2017-06-04T17:11:22.373" LastActivityDate="2017-06-04T17:11:22.373" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24380" PostTypeId="2" ParentId="21355" CreationDate="2016-02-18T11:31:20.100" Score="3" Body="&lt;p&gt;I wouldn't say it is not a derivative, CFD is for sure a derivative, you don't need any secondary market to be traded with CFDs to make it a derivative. So it is a derivative, only problem is, there are many companies issuing them and if they go bankrupt, you can lose your money. Most companies offer just a few of CFDs though, but some like ETX Capital for example (&lt;a href=&quot;http://trade-test.com/etx-capital-review&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://trade-test.com/etx-capital-review&lt;/a&gt;) offers around 6000 of CFDs, biggest offer that I am aware of.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An advantage of CFDs is that it can be much cheaper than its base asset as spread is made by the issuing company that can be any broker like that ETX Capita, or Plus500 or Oanda or whatever. And they can sell you CFD with a fraction of spread you would normally pay on a regular market. So conclusion:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Risky:  yes, somewhat. &lt;/li&gt;&#xA;&lt;li&gt;Cheaper: yes. &lt;/li&gt;&#xA;&lt;li&gt;Do you own asset: no. &lt;/li&gt;&#xA;&lt;li&gt;Do you get dividends: yes.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="19512" LastEditorDisplayName="user13444" LastEditDate="2016-12-25T08:59:02.867" LastActivityDate="2016-12-25T08:59:02.867" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24382" PostTypeId="1" AcceptedAnswerId="24390" CreationDate="2016-02-18T13:39:42.320" Score="3" ViewCount="222" Body="&lt;p&gt;Trying to imply Black76 (where the forward swap rate is log-normal) volatilities as Bloomberg does in their VCUB screen we see holes at two regions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;at short maturities due to negative rates which can not be captured in a log-normal model - that is clear&lt;/li&gt;&#xA;&lt;li&gt;and also at high maturities - which is suprising for me.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The documentation says that in the Black76 model there is an upper bound for ATM-call prices on swap-rates. If the premium is higher, then one can not imply the volatility. But how can there be an upper bound?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Is the upper bound just the discounted rate?&#xA;If we recall B76 &#xA;$$&#xA;C= \exp(-r T)[F N(d_1) - K N(d_2)],&#xA;$$&#xA;then ATM means $F=K$ and thus&#xA;$$&#xA;C= \exp(-r T)F [N(d_1) - N(d_2)],&#xA;$$&#xA;which is&#xA;$$&#xA;\exp(-r T)F [N(\sigma \sqrt{T}/2) - N(-\sigma \sqrt{T}/2)],&#xA;$$&#xA;and using symmetry we arrive at&#xA;$$&#xA;\exp(-r T)F [1-2N(-\sigma \sqrt{T}/2)] \le \exp(-r T)F,&#xA;$$&#xA;which would be a rather high bound ....&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2016-02-18T14:16:55.143" LastActivityDate="2016-02-18T22:50:52.987" Title="Why is there an upper limit on the premium of an ATM (!) call swaption in the Black76 model?" Tags="&lt;implied-volatility&gt;&lt;interest-rate-swap&gt;&lt;swaption&gt;&lt;black76&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24383" PostTypeId="1" CreationDate="2016-02-18T14:19:15.127" Score="1" ViewCount="145" Body="&lt;p&gt;Extract from the latest &lt;a href=&quot;http://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX%3A32015R2450&quot; rel=&quot;nofollow&quot;&gt;spec&lt;/a&gt; for C0150 (Valuation Method) of S.06.02:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Identify the valuation method used when valuing assets. One of the&#xA;  options in the following closed list shall be used:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;1 — quoted market price in active markets for the same assets&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;2 — quoted market price in active markets for similar assets&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;3 — alternative valuation methods&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;4 — adjusted equity methods (applicable for the valuation of&#xA;  participations)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;5 — IFRS equity methods (applicable for the valuation of&#xA;  participations)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;6 — Market valuation according to Article 9(4) of Delegated Regulation&#xA;  (EU) 2015/35&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My question is - which value applies to cash holdings / &lt;a href=&quot;http://rawfocus.blogspot.co.uk/2016/06/eiopa-cic-codes.html&quot; rel=&quot;nofollow&quot;&gt;CIC&lt;/a&gt; category 7?  &lt;/p&gt;&#xA;" OwnerUserId="5883" LastEditorUserId="5883" LastEditDate="2016-06-24T16:01:58.017" LastActivityDate="2016-06-24T16:01:58.017" Title="Valuation Method for CASH in S.06.02 QRTs" Tags="&lt;solvency-ii&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24384" PostTypeId="2" ParentId="24366" CreationDate="2016-02-18T16:57:20.273" Score="1" Body="&lt;p&gt;I don't know how technical the job spec is but in quantitative finance:&lt;/p&gt;&#xA;&lt;p&gt;You cannot use models to predict prices. You can however use &lt;em&gt;simulations&lt;/em&gt; to predict the expected pay off of a certain scenario ASSUMING the underlying distributions of your model are correct....&lt;/p&gt;&#xA;&lt;p&gt;...in the most conventional models (such as Black-Scholes) equity prices are assumed to evolve according to geometric brownian motion, including a drift term + some random noise component which is proportional to the volatility of the stock. This implies a number of assumptions, a large one being that prices are log-normally distributed.&lt;/p&gt;&#xA;&lt;h1&gt;Central limit theory&lt;/h1&gt;&#xA;&lt;p&gt;The reasoning behind this is due to the central limit theorem, which states that if you take the mean of a very large number of independent random variables (which may have any distribution) is normally distributed. Given that daily returns are a function of a large number of intra-day returns, daily returns are normally distributed. A basic property states that if Returns0~Norm and S(t)=S(0)*exp(Returns) then S(t)~LogNorm.&lt;/p&gt;&#xA;&lt;h1&gt;For simulations&lt;/h1&gt;&#xA;&lt;p&gt;Now you know how to simulate prices, but you can never actually take the expectations of simulations, because that's not exactly how they are used in real life. Simulation can be used for option valuation, but not very good at predicting an explicit price. The general idea is that if the underlying distributions are correct, then you can use it to model non-linear pay off functions. This is due to the Jensen Inequality, which states that E[f(x)] &amp;gt;= f(E[x]). You can do an example where the current price of 100 can go to either 50 or 200 with equal probability. The average expected price is 125. The pay off of an option with K=100 would be 25. If you now use prices models as they should be, you get a pay off of 0 of the option when S=50, and a pay-off of 100 when S goes to 200. The real expected value of the option is (0 + 100)/2 = 50. There is a fine line in how you apply price models, but it cannot be used to forecast an explicit price.&lt;/p&gt;&#xA;" OwnerUserId="19365" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-02-18T16:57:20.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24385" PostTypeId="2" ParentId="24372" CreationDate="2016-02-18T16:59:13.063" Score="0" Body="&lt;p&gt;There are sufficient literature that deals with jump process. You may look at these papers: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://zulfahmed.files.wordpress.com/2015/08/financialmodellingjumps1.pdf&quot; rel=&quot;nofollow&quot;&gt;Financial modelling with jump processes, by Cont and Tankov (1975)&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.people.hbs.edu/rmerton/optionpricingwhenunderlingstock.pdf&quot; rel=&quot;nofollow&quot;&gt;Option pricing when underlying stock returns are discontinuous by Merton (1976)&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2016-02-18T16:59:13.063" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24386" PostTypeId="2" ParentId="24374" CreationDate="2016-02-18T17:56:53.743" Score="2" Body="&lt;p&gt;Have you looked at &lt;a href=&quot;https://sourceforge.net/projects/qlnet/&quot; rel=&quot;nofollow&quot;&gt;Quantlib.net&lt;/a&gt;?  We use it both in the back office and some soft realtime trading system for pricing bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a few questions on this site that deal with using it for pricing bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/tagged/quantlib+bond&quot;&gt;https://quant.stackexchange.com/questions/tagged/quantlib+bond&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="743" LastActivityDate="2016-02-18T17:56:53.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24387" PostTypeId="1" CreationDate="2016-02-18T20:38:38.683" Score="8" ViewCount="927" Body="&lt;p&gt;What do you think would be the theoretical limit for contango? What about backwardation? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This was asked in an interview. I am still not so sure about the answer.&lt;/p&gt;&#xA;" OwnerUserId="19518" LastEditorUserId="20795" LastEditDate="2018-01-26T22:01:47.907" LastActivityDate="2018-01-26T22:01:47.907" Title="Theoretical limits for contango and backwardation" Tags="&lt;futures&gt;&lt;derivatives&gt;&lt;quantitative&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24389" PostTypeId="2" ParentId="24372" CreationDate="2016-02-18T21:13:34.423" Score="1" Body="&lt;p&gt;There is nothing to model in the payoff. A payoff is a collection of cash flows. A cash flow is a function of market observables. Your function just happens to be discontinuous.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a risk point of view this means that you are exposed to the volatility skew. So any model used for valuation should be calibrated to the volatility smile (you cannot simply value a digital striked at K by looking at the implied volatility at K, you also need the derivative at K of the implied vol wrt to the strike). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where real work on the payoff needs to be done is when you try to apply standard numerical methods to value it. For example when using Monte Carlo and finite difference to compute Greeks, the discontinuity will generate a lot of noise. The most common solution is to smooth the payoff: replace it with a continuous function. Typically you replace a digital by a call spread but things get a lot more complicated when you have several types of digitals interacting and you want to your smoothing to be conservative (i.e. subreplicate your payoff).&lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2016-02-18T21:13:34.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24390" PostTypeId="2" ParentId="24382" CreationDate="2016-02-18T22:50:52.987" Score="2" Body="&lt;p&gt;In the BS model there is the upper bound of the stock price, which can be proven by the fact the stock price bounds the call option pay-off. Here we are seeing a similar effect: the discounted rate corresponds to the stock price. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2016-02-18T22:50:52.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24391" PostTypeId="2" ParentId="24387" CreationDate="2016-02-19T01:41:59.113" Score="13" Body="&lt;p&gt;This is a basic fact about futures trading and the storage of commodities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The phrase that was used by futures traders in the old days (and probably still today) was &quot;the contango is limited by the carrying cost, there is no limit to the backwardation&quot;. This means that for example if spot gold is at 1200, gold dated one  year from now cannot possibly sell for 2400 (a huge contango), because I could buy gold now, store it and insure it and deliver it one year from now for let's say 1275 when interest rates, insurance, storage costs are taken into account. By what is called &quot;cash and carry arbitrage&quot; the future price would be brought down toward 1275.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When there is backwardation, the opposite arbitrage is not possible. If a commodity for delivery 1 year from now is very very cheap compared to the spot, I cannot buy cheap barrels of oil in the future &quot;ship them to the present&quot; and deliver them now. The time-travel machine has not been invented yet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So there is a basic asymmetry: storage works in one direction only (from the present to the future); I cannot use a glut of the commodity in the future to relieve a shortage of the commodity now. So the contango for a storable commodity is limited, while the backwardation is not.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-02-19T01:52:53.760" LastActivityDate="2016-02-19T01:52:53.760" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24392" PostTypeId="1" AcceptedAnswerId="24401" CreationDate="2016-02-19T01:55:23.860" Score="4" ViewCount="7945" Body="&lt;p&gt;I have to plot the implied volatility surface for EUR/USD.&lt;/p&gt;&#xA;&lt;p&gt;So, my goal is to produce something like that, from put delta 10 to call delta 10:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/KlkMG.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/KlkMG.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Searching for informations, I found that I could find call et put volatilities using&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Strangle(∆) = 0,5[Call Vol(∆) + Put Vol(∆)] - ATM Vol&lt;/p&gt;&#xA;&lt;p&gt;Risk Reversal(∆) = Call Vol(∆) - Put Vol(∆)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Hence,&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Call Vol(∆) = Strangle(∆) + 0,5RR(∆) + ATM Vol&lt;/p&gt;&#xA;&lt;p&gt;Put Vol(∆) = Call Vol(∆) - RR(∆)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;However, in my exercise, I have only ATM, 25∆ risk reversal, 10∆ risk reversal, 25∆ butterfly and 10∆ butterfly volatility quotations. So absolutely no strangle data.&lt;/p&gt;&#xA;&lt;p&gt;With the data I have, is there any way to find the volatilities for both call et put?&lt;/p&gt;&#xA;" OwnerUserId="19526" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-02-19T15:14:30.093" Title="Find call and put volatilities using ATM, Risk reversal and Butterflies volatilities" Tags="&lt;options&gt;&lt;volatility&gt;&lt;black-scholes&gt;&lt;delta&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24393" PostTypeId="1" CreationDate="2016-02-19T05:42:54.627" Score="2" ViewCount="43" Body="&lt;p&gt;To my knowledge, FX implied volatility can only be obtained from the market for time horizons up to about 5 years due to liquidity limitations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how would we obtain volatility estimates for longer time horizons? Is it up to the trader to decide? Or are we free to pick an extrapolation method?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;" OwnerUserId="19529" LastActivityDate="2016-02-19T05:42:54.627" Title="FX Implied Volatility for Longer Term Maturities" Tags="&lt;implied-volatility&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24394" PostTypeId="1" CreationDate="2016-02-19T07:29:50.293" Score="2" ViewCount="286" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/pO8El.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/pO8El.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;      &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like a custom C++ Automated Trading Platform for Futures like Multicharts, or similar automated trading platform that I can put on my servers so its secure and fast.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have found this so far, &lt;a href=&quot;http://quantlib.org/index.shtml&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://quantlib.org/index.shtml&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand the Hedge Funds build their own, but what's available open source?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&#xA;Alex&lt;/p&gt;&#xA;" OwnerUserId="19532" LastEditorUserId="19532" LastEditDate="2016-02-19T13:42:27.367" LastActivityDate="2016-02-19T13:42:27.367" Title="What is the best open source automated trading platform or options?" Tags="&lt;programming&gt;&lt;futures&gt;&lt;automated-trading&gt;&lt;algorithmic-trading&gt;&lt;python&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24396" PostTypeId="1" CreationDate="2016-02-19T11:27:32.130" Score="3" ViewCount="2409" Body="&lt;p&gt;I understand how to hedge delta and gamma risk. Could someone explain to me how cross gamma hedging is done by the trading desk. In particular I am interested in hedging for interest rate exotics. So lets just take cross gamma of rates and vols.&lt;/p&gt;&#xA;" OwnerUserId="19148" LastActivityDate="2016-02-19T11:27:32.130" Title="Hedging cross gamma" Tags="&lt;hedging&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24397" PostTypeId="2" ParentId="9728" CreationDate="2016-02-19T13:03:11.097" Score="2" Body="&lt;p&gt;Yahoo Finance current quote API still does not work for SS stocks as of Feb 2016.  I ended up scraping data from the UI:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Login to Yahoo Finance&lt;/li&gt;&#xA;&lt;li&gt;Create view (in my case v3) with fields you'll need &#xA;&lt;a href=&quot;http://finance.yahoo.com/quotes/view/new?symbols=000001.SS&amp;amp;from_view_id=v3&quot; rel=&quot;nofollow&quot;&gt;http://finance.yahoo.com/quotes/view/new?symbols=000001.SS&amp;amp;from_view_id=v3&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Construct URL with your comma separated symbols (200 max) and new view version, such as &#xA;&lt;a href=&quot;http://finance.yahoo.com/quotes/000001.SS,600000.SS,600004.SS,600005.SS/view/v3&quot; rel=&quot;nofollow&quot;&gt;http://finance.yahoo.com/quotes/000001.SS,600000.SS,600004.SS,600005.SS/view/v3&lt;/a&gt; &lt;/li&gt;&#xA;&lt;li&gt;I'm using ruby watir to get the data I need into a csv file..&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="19535" LastActivityDate="2016-02-19T13:03:11.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24398" PostTypeId="1" CreationDate="2016-02-19T13:03:52.763" Score="3" ViewCount="229" Body="&lt;p&gt;Consider the following two proposed simulations of paths of standard, one-dimensional Brownian motion between time $0$ and time $1$.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Normal Increments&lt;/em&gt;&lt;/strong&gt; Roll out a large sequence of, say $M$, independent Gaussian variables $X_1, X_2, X_3, \dots, X_M$ such that $X_n \sim N\left(\mu=0, \sigma^2=\frac{1}{M}\right)$, and plot a scatter plot of the points $(0.001n, \sum_{i = 1}^n X_i)$ with straight lines connecting consecutive points.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Random Walk&lt;/em&gt;&lt;/strong&gt; Trace out the path of a one-dimensional random walk that starts at $0$ and progresses by steps of $\pm \sqrt{\frac{1}{M}}$ every $\frac{1}{M}$th of a second.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Does any of these methods converge to a Brownian motion path? If so, what type of convergence is it?&lt;/p&gt;&#xA;" OwnerUserId="15619" LastEditorUserId="15619" LastEditDate="2016-02-19T14:00:59.170" LastActivityDate="2016-02-19T14:07:07.687" Title="Simulations of (standard, one-dimensional) Brownian motion" Tags="&lt;brownian-motion&gt;&lt;simulations&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24399" PostTypeId="2" ParentId="24398" CreationDate="2016-02-19T14:07:07.687" Score="3" Body="&lt;p&gt;Your first case is nothing but simulation of Brownian motion process. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your second case is just an alternative view of your first case and hence also Brownian motion. Under Brownian motion, $dX_t \sim N(0, dt)$. So, your increments must follow $N(0, \frac1M)$. &#xA;You have not stated probability of your increment, but for this process to be Brwonian motion, the probability of up and down step must be $0.5$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The variance of your increment in $\frac1M$ second is: &#xA;$$0.5 \left(\sqrt\frac1M-0 \right)^2 + 0.5\left(-\sqrt\frac1M-0\right)^2 = 0.5\frac1M + 0.5 \frac1M = \frac1M$$ &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt; : Your both case is discretized form of standard Brownian motion and they both are equivalent. Your second case only converge to Brownian motion only if $lim_{m \to \infty}$ &lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2016-02-19T14:07:07.687" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24400" PostTypeId="1" CreationDate="2016-02-19T14:09:30.183" Score="3" ViewCount="1897" Body="&lt;p&gt;Recently I would like to look for excel template of hull white one-factor calibration model using swaption data for my urgent task? However, it seems that I cannot find suitable one in the web.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please kindly advise whether there are hull white one-factor calibration excel template in the web. Is there any implementation note of hull white one-factor calibration excel template downloaded in the web?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks...&lt;/p&gt;&#xA;" OwnerUserId="6119" LastActivityDate="2016-02-20T03:37:21.573" Title="Is there any template of hull white one-factor calibration model?" Tags="&lt;calibration&gt;&lt;swaption&gt;&lt;interest&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24401" PostTypeId="2" ParentId="24392" CreationDate="2016-02-19T14:35:06.437" Score="5" Body="&lt;p&gt;The strangle vol defined in your formula &#xA;\begin{align*}&#xA;Strangle(∆) = 0.5[Call Vol(∆) + Put Vol(∆)] - ATM Vol&#xA;\end{align*}&#xA;is the smile butterfly volatility. Then you have the volatility quote. Your confusion is caused by the misuse of notations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that, other treatments are also available. See for example,&#xA;&lt;a href=&quot;http://docplayer.net/905215-Cpqf-working-paper-series-no-20-fx-volatility-smile-construction-dimitri-reiswich-uwe-wystup.html.&quot; rel=&quot;noreferrer&quot;&gt;FX Volatility Smile Construction&lt;/a&gt; by UWe Wystup (this link may not work directly, but it can be searched.) Another good source is the book &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470683686&quot; rel=&quot;noreferrer&quot;&gt;Foreign Exchange Option Pricing&lt;/a&gt; by Iain J. Clark.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-02-19T15:14:30.093" LastActivityDate="2016-02-19T15:14:30.093" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24403" PostTypeId="1" AcceptedAnswerId="24418" CreationDate="2016-02-19T18:00:46.910" Score="12" ViewCount="855" Body="&lt;p&gt;There are various models for portfolio selection in literature, like, &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Harry Markowitz (HM) model ( Mean-Variance Model) [well known model]&lt;/li&gt;&#xA;&lt;li&gt;Konno and Yamazaki (1991) model:  minimizes the sum of absolute deviations &lt;/li&gt;&#xA;&lt;li&gt;Markowitz- semi-variance model (1959)&lt;/li&gt;&#xA;&lt;li&gt;Speranza- mean-absolute semi-deviation (1993)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;There are many more such variants. I just want to know what kind of models are used by practitioners in reality to construct portfolio? How they takes into account the assumption of various model when constructing portfolio (You may assume assumption of HM model)? &lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2016-02-28T12:18:07.187" Title="Portfolio construction in reality?" Tags="&lt;portfolio&gt;&lt;modern-portfolio-theory&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24404" PostTypeId="2" ParentId="24403" CreationDate="2016-02-19T18:44:54.580" Score="0" Body="&lt;p&gt;I doubt anyone in practice uses Markowitz or similar things. &#xA;My guess is that industry are moving towards stuff in the line of Parametric Portfolio Policies (e.g. Brandt, Santa-Clara and Valkanov 2009). &lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2016-02-19T18:44:54.580" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24405" PostTypeId="2" ParentId="24400" CreationDate="2016-02-19T20:25:31.230" Score="3" Body="&lt;p&gt;I'm giving no assurance that this model is rigorous/functional. It also appears that time steps are severely limited. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, though, the only way to ensure that something is created well is to create it yourself. I have been burned by canned functions/models in the past, so I avoid them whenever able or if I'm doing anything that is actually important.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.anandgoel.org/Interest%20Rate%20Trees%20and%20Valuation.xlsm&quot; rel=&quot;nofollow&quot;&gt;http://www.anandgoel.org/Interest%20Rate%20Trees%20and%20Valuation.xlsm&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19089" LastActivityDate="2016-02-19T20:25:31.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24406" PostTypeId="1" CreationDate="2016-02-19T20:34:12.260" Score="2" ViewCount="69" Body="&lt;p&gt;What is a good source of literature to learn about the specifics of various instruments that are traded?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, suppose I wanted to know more about MBS's, i.e. how exactly they are securitized, how exactly they are tranched, what different types of strategies traders might look at to price the tranches, and how they trade across this asset class. Is there a good book for that? Now, is there a book that does that for several more assets (like currencies, bonds, options, credit swaps, etc.)&lt;/p&gt;&#xA;" OwnerUserId="19539" LastActivityDate="2016-02-19T20:34:12.260" Title="Literature to Learn about Different Instruments" Tags="&lt;quant-trading-strategies&gt;&lt;derivatives&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24407" PostTypeId="2" ParentId="23222" CreationDate="2016-02-19T20:53:32.667" Score="0" Body="&lt;p&gt;I use only the fact that &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$S(t)\cdot B^{-1}(t)$ is a $\mathbb{Q}-$ martingale and we are considering the European options.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Indeed, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have that : $(x-K)_{+}-(K-x)_{+}=x-K$ $\forall x,K \in \mathbb{R}$ ($\diamond$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But we know also that the price of a European Call/Put is given by :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C(t) = \mathbb{E}^{\mathbb{Q}}\left[\left(S_T-K\right)_{+}\cdot \frac{B(t)}{B(T)}\, \mid \, \mathcal{F}_{t}\right]$  ,  $P(t) = \mathbb{E}^{\mathbb{Q}}\left[\left(K-S_T\right)_{+}\cdot \frac{B(t)}{B(T)}\, \mid \, \mathcal{F}_{t}\right]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the ($\diamond$), we have&#xA;$C(t)-P(t) = \mathbb{E}^{\mathbb{Q}}\left[\left(S_T-K\right)\cdot \frac{B(t)}{B(T)}\, \mid \, \mathcal{F}_{t}\right]=B(t)\cdot \mathbb{E}^{\mathbb{Q}}\left[ \frac{S_T}{B(T)}\, \mid\,\mathcal{F}_{t}\right]-\frac{B(t)}{B(T)}\cdot K$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the assumption, we have $B(t)\cdot \mathbb{E}^{\mathbb{Q}}\left[ \frac{S_T}{B(T)}\, \mid\,\mathcal{F}_{t}\right]=B(t)\times \frac{S_{T}}{B(t)} = S_{t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We also know that $\frac{B(t)}{B(T)}=B(t,T)$ (I think if not, there's arbitrage)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the end, we get the result :)&lt;/p&gt;&#xA;" OwnerUserId="3571" LastActivityDate="2016-02-19T20:53:32.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24408" PostTypeId="1" CreationDate="2016-02-19T21:21:43.170" Score="1" ViewCount="40" Body="&lt;p&gt;Is there a major article or even better a comprehensive recent review article showing quantitative evidence for the existence of the business cycle and measuring the trending and mean reversion on that longer time scale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something on how to build portfolios around the cycle would be interesting as well, but I'm more interested currently if the cycle is a quantifiable (semi-) predictable effect.&lt;/p&gt;&#xA;" OwnerUserId="5689" LastActivityDate="2016-02-19T21:21:43.170" Title="Quantitative Business Cycle Investing" Tags="&lt;research&gt;&lt;mean-reversion&gt;&lt;macro&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24411" PostTypeId="2" ParentId="23222" CreationDate="2016-02-20T04:03:45.923" Score="0" Body="&lt;p&gt;In the binomial model suppose the stock can go to either U or D.  Suppose the option strike is K where D &amp;lt; K &amp;lt; U.&lt;br&gt;&#xA;If stock goes to U, call payout is (U-K) and put payout is 0.&#xA;If stock goes to D, call payout is 0 and put payout is (K-D).&#xA;Now consider a portfolio of Call - Put.&#xA;If stock goes to U, portfolio payout is U-K.&#xA;If stock goes to D, portfolio payout is D-K.&#xA;Therefore, portfolio is the same as stock - K (ie a forward on the stock).&#xA;Therefore its delta is one, in the binomial model.&#xA;Of course its delta is one in any model, as others have pointed out.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-02-20T04:03:45.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24412" PostTypeId="2" ParentId="21696" CreationDate="2016-02-20T04:21:36.480" Score="3" Body="&lt;p&gt;It costs 0.03 dollars for the option to (sell 1 pound/buy 1.5 dollars.  Now divide everything by 1.5:&lt;br&gt;&#xA;It costs 0.02 dollars for the option to (sell 2/3 pound / buy 1 dollar).   Now convert to pounds at spot rate:&lt;br&gt;&#xA;It costs 0.0133 pounds for the option to (sell 2/3 pound / buy 1 dollar).   Done&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-02-20T04:21:36.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24413" PostTypeId="1" CreationDate="2016-02-20T05:54:05.597" Score="3" ViewCount="3741" Body="&lt;p&gt;I need to understand once CVA Desk has CVA number(Bilateral or Unilateral) for a Counterparty, how does it take hedge position. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;for Eg: if CVA charge for my bank to JPM is 100K Dollars. What does that imply and how can CVA Trader use this number to hedge CVA risk of $100K to JPM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please include any variable if I have missed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks &lt;/p&gt;&#xA;" OwnerUserId="11661" LastEditorUserId="11661" LastEditDate="2016-02-24T04:31:30.213" LastActivityDate="2017-03-25T20:44:54.873" Title="Credit Valuation adjustment (CVA) Hedges" Tags="&lt;cds&gt;&lt;cva&gt;&lt;hedge&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24414" PostTypeId="1" CreationDate="2016-02-20T13:14:02.290" Score="4" ViewCount="1892" Body="&lt;p&gt;I want to price an FX option using the Black-Scholes model, but I don't know the risk free rate, nor the volatility. I only know the LIBOR rates, the strike, and that the expiration day is 87 days from today. I  also know the historical values of the exchange rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure how to use the LIBOR rate and how to calculate the volatility. Do I use the 3 months LIBOR as a risk free rate? Do I have to convert the LIBOR to countinously compounded rate?&lt;/p&gt;&#xA;" OwnerUserId="19548" LastActivityDate="2017-03-12T02:56:56.983" Title="How to use the Black-Scholes formula with LIBOR rates?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;fx&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24415" PostTypeId="2" ParentId="24343" CreationDate="2016-02-20T13:36:57.107" Score="20" Body="&lt;p&gt;Then for each month $t$, you run a cross-section regression:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_{i,t} = \lambda_0 + \hat{\beta}_i {\lambda}_t + \alpha_{i,t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where: $\hat{\beta}_i \equiv [\beta_{i, MktRf}, \beta_{i, SMB}, \beta_{i, HML}]'$, is a vector of the coefficients estimated on the first step. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you are looking for is to estimate the vector of $\hat{\lambda}_t \equiv [\lambda_{t, MktRf}, \lambda_{y, SMB}, \lambda_{t, HML}]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So after the second step you will have $T$ estimates for each $\lambda$ (price of risk). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you just need to average those $\lambda$'s:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\hat{\lambda} = \frac{1}{T} \sum^{T}_{t=1} \hat{\lambda}_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And you can test their statistical significance using as a variance estimate the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Est.Asy.Var(\hat{\lambda}) = \frac{1}{T^2} \sum^{T}_{t=1} (\hat{\lambda}_t - \hat{\lambda} )(\hat{\lambda}_t - \hat{\lambda} )'$&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2016-02-20T13:36:57.107" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="24416" PostTypeId="2" ParentId="24343" CreationDate="2016-02-20T14:15:15.073" Score="12" Body="&lt;p&gt;The two step Fama-Macbeth regression works as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, run a cross sectional regression in each period. I believe that you want to estimate risk premia for each of the Fama and French factors. Therefore you run:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_{i,t} = \lambda_{t,MKT} \hat{\beta}_{i,MKT}+\lambda_{t,HML} \hat{\beta}_{i,HML}+\lambda_{t,SMB} \hat{\beta}_{i,SMB}+ \alpha_{i,t} \quad \forall t \in [t_0,t_T]  $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The independent variables are the estimates from your times series regressions. They are the same for each cross-sectional regression. You run thus cross-sectional regression for each of your 300 months in the sample. This gives you 300 estimates for each risk premium, one for each period. Note that some people prefer to run the cross-sectional regressions also with intercept. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, to find the risk premium for each risk factor you average each premium over time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\hat{\lambda_{RP}} =\frac{1}{T}  \sum_{t = 0}^T \lambda_{t,RP}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To obtain standard errors:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\hat{\sigma}^2(\hat{\lambda}_{RP}) =\frac{1}{T^2}  \sum_{t = 0}^T (\lambda_{t,RP}-\hat{\lambda}_{RP})^2&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where RP is either MKT, HML or SMB. With the standard error and the estimate you can perform a t-test.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few comments on the procedure:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Please note that the Fama-Machbeth regression only corrects for cross sectional correlation.  &lt;a href=&quot;http://rfs.oxfordjournals.org/content/22/1/435.abstract&quot;&gt;Petersen (2009)&lt;/a&gt; recommends to estimate standard errors with the Newey-West procedure to correct for autocorrelation. John Cochrane recommends to use GMM in his book Asset Pricing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) The time series regressions you mention in your post as a first step are actually not part of the Fama-Macbeth regression and the only purpose of those regressions is to find the betas. However, they are often called first step in many academic papers. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) There is an excellent summary by &lt;a href=&quot;http://www.jasonhsu.org/uploads/1/0/0/7/10075125/two_stage_fama_macbeth.pdf&quot;&gt;Jason Hsu&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="9283" LastActivityDate="2016-02-20T14:15:15.073" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24417" PostTypeId="2" ParentId="24414" CreationDate="2016-02-20T14:54:33.273" Score="4" Body="&lt;p&gt;You simply required 2 things: 1) Risk free rate, and 2) Standard Deviation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the interest rate you can use LIBOR of nearest maturity. Convert your LIBOR rate into continuous compound rate by taking log. &lt;strong&gt;Additional&lt;/strong&gt;: VIX also uses LIBOR as an proxy for risk free interest rate and they also select LIBOR of nearest maturity of option contract. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Standard deviation  can be easily computed from past historical data. You can also use GARCH model to forecast volatility for next 87 days and then take it average. &lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="16991" LastEditDate="2016-02-20T16:39:15.057" LastActivityDate="2016-02-20T16:39:15.057" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="24418" PostTypeId="2" ParentId="24403" CreationDate="2016-02-20T18:45:06.003" Score="8" Body="&lt;p&gt;Portfolio optimalisation depends heavily on the estimation of the moments (and therefore has HUGE estimation uncertainty). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even though it's useful for comparing and analysing different existing strategies, I think practitioners are moving more towards the usage of factor portfolios for the strategies themselves (e.g. Fama-French). Also because the exploitation of such anomalies have been proven to be quite persistent and relatively profitable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To give you an example of the estimation uncertainty that goes together with portfolio optimalisation, a simple plug-in Markowitz regression on the S&amp;amp;P 500 (1997-2006) using the delta method yields a weight of w=0.5 and a standard error of 0.4! So the estimation says that we should invest half our portfolio in the risky asset (S&amp;amp;P 500), with a standard deviation of 0.4. You can imagine that a 95% confidence interval would range all the way from investing nothing in the market to investing everything. So what is &lt;em&gt;really&lt;/em&gt; optimal? The estimation uncertainty can be improved using shrinkage methods but you get the picture. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another disadvantage of such portfolio optimalisation is that it doesn't really capture anomalies like factor models can. It's of course possible to combine the optimalisation of weights with the results from factor models to sort of 'get the best of both worlds'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Besides, most portfolio optimalisation models can't beat the 1/N portfolio out of sample. Even if they do beat the benchmark, they often still have transaction costs which need to be corrected for. After correction, you will find again that the models are quite useless and you're better off investing in the 1/N portfolio instead. Like I said before, this is not true for cross-sectional anomalies. It has been shown numerous times that various factor models and predictive variables perform quite well. See for example Fama and French (2008), Campbell and Thompson (2008) and Goyal and Welch (2008).&lt;/p&gt;&#xA;" OwnerUserId="5447" LastEditorUserId="5447" LastEditDate="2016-02-22T20:28:00.043" LastActivityDate="2016-02-22T20:28:00.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24419" PostTypeId="1" AcceptedAnswerId="24455" CreationDate="2016-02-20T19:58:52.507" Score="0" ViewCount="362" Body="&lt;p&gt;Consider the following regressions, with the common factor $x$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$y_1 = \beta_1 \cdot x + \gamma_1 \cdot \epsilon_1 $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$y_2 = \beta_2 \cdot x + \gamma_2 \cdot \epsilon_2 $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With $\epsilon_1$, $\epsilon_2 \tilde{} N(0,1) $ as usual, and $Cov(x, \epsilon_j) = 0$, for all $i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How do you derive the single factor model below?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$y_1 = \sqrt{\rho} \cdot x + \sqrt{1 - \rho} \cdot \epsilon_1 $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$y_2 = \sqrt{\rho} \cdot x + \sqrt{1 - \rho} \cdot \epsilon_2 $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\rho$ is the correlation between $y_1$ and $y_2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've looked for a proof of this, but haven't been able to find it anywhere...&lt;/p&gt;&#xA;" OwnerUserId="17284" LastActivityDate="2016-02-24T09:29:35.233" Title="Deriving the single factor model" Tags="&lt;correlation&gt;&lt;regression&gt;&lt;factor-models&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24420" PostTypeId="1" CreationDate="2016-02-20T20:05:27.710" Score="1" ViewCount="76" Body="&lt;p&gt;Say I have three data sets of size $n$ each: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$y_1$ = heights of people from the US only&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$y_2$ = heights of men from the whole world&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$y_3$ = heights of women from the whole world&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And I build a linear model for each with factors $x_i$, $i = 1,..., k$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\hat{y}_{j} = \beta_{0} + \beta_{1}x_{1} + \beta_{2}x_{2}  + \epsilon_{j}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $\epsilon$ having the usual properties for OLS. And I may use a factor $x_i$ in more than one regression.&#xA;&lt;hr/&gt;&#xA;&lt;strong&gt;My question is:&lt;/strong&gt; How could I combine the regressions such that I can obtain estimates for:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$y_{12}$ = height of men from the US only&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$y_{13}$ = height of women from the US only&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;for which I do not have data&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr/&gt;&#xA;&#xA;&lt;p&gt;I thought of perhaps some sort of weighting:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \hat{y}_{12} = w_{1} \hat{y}_{1} + (1 - w_{1}) \hat{y}_{2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but then I wouldn't know what to use for $w_1$.&lt;/p&gt;&#xA;" OwnerUserId="17284" LastActivityDate="2016-02-20T20:05:27.710" Title="How to combine regression models?" Tags="&lt;regression&gt;&lt;factor-models&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24422" PostTypeId="1" CreationDate="2016-02-20T22:33:58.440" Score="19" ViewCount="946" Body="&lt;p&gt;Over the years I met a couple of dozen of (human) traders who I'd consider good (being in the business for several years, generating a reasonably steady income). I had chances to chat with some of them regarding their trading strategies. All of them admitted they are not doing anything &quot;out of the ordinary&quot;, whether it's some sort of pairs trading, trend following, curve fitting, and such.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since these techniques are well known, I'm wondering why are they (still) able to generate profits? Is trading some sort of a CAPTCHA, one that machine-learning or other algorithms unable to crack?&lt;/p&gt;&#xA;" OwnerUserId="19550" LastActivityDate="2019-08-26T12:24:30.283" Title="Why do Human traders make money?" Tags="&lt;trading&gt;&lt;algorithmic-trading&gt;" AnswerCount="4" CommentCount="4" FavoriteCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="24423" PostTypeId="1" CreationDate="2016-02-20T22:49:21.453" Score="2" ViewCount="126" Body="&lt;p&gt;I am trying to fit a Gaussian Copula with t margins to my data (log returns of two stocks). It has already worked for a Gaussian Copula with normal margins with:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;normcopula_dist = mvdc(copula=normalCopula(normrho,dim=2), margins=c(&quot;norm&quot;,&quot;norm&quot;),&#xA;                    paramMargins=list(list(mean=db_mu, sd=db_sd),&#xA;                                      list(mean=cb_mu, sd=cb_sd)))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, how can I simulate my data with t margins? Here I can only set a parameter for df, but I need a t distribution also with mean and standard deviation matching my copula. Any help here? My idea was to create multivariate normal pseudo observations and then to transform them into t distribution and use their df for the estimation, but I am not quite sure, if it worksfine.&lt;/p&gt;&#xA;" OwnerUserId="19555" LastActivityDate="2016-02-20T22:49:21.453" Title="Gaussian Copula with t margins" Tags="&lt;distribution&gt;&lt;copula&gt;&lt;margin&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24424" PostTypeId="2" ParentId="24422" CreationDate="2016-02-21T00:45:00.237" Score="4" Body="&lt;p&gt;This might not be a suitable answer, but I refer to the book &quot;The Black Swan&quot; by N.N. Taleb.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you start with 1000 equity traders, that base their investments on dice throwing, most &lt;em&gt;will&lt;/em&gt; make profit when the market goes up. &#xA;When it goes down, surely, some traders will make a loss and leave the game, but even after a long time, people with no strategy at all will have made consistent profits just by sheer luck. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It might be that you only know the lucky traders, and that traders who failed usually do not mention this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On another note: Humans can probably also assess how CEO's will change companies, and see higher-level patterns. Remember, computers cannot even deal well with sarcasm yet. &#xA;Computers are good at analyzing data, but humans are still needed to select which data to analyze. &lt;/p&gt;&#xA;" OwnerUserId="19357" LastActivityDate="2016-02-21T00:45:00.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24425" PostTypeId="1" CreationDate="2016-02-21T10:11:13.603" Score="5" ViewCount="2133" Body="&lt;p&gt;When we calculate the implied volatility, we would need to give the solver a range to start with. For example, QuantLib uses [0,4.0] for the range, which is another way of saying try all possible values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any theory on the best guess? Can we derive the theoretical best guess? The smaller the range we can give to the root solver, the quicker we get our results (less iterations required).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if the implied volatility is 0.07 (we don't know that in advance). Can we give a range like [0.01,0.10]? which would make the solver converge quicker than if we give a range like [0,4.0].&lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="601" LastEditDate="2016-02-21T14:03:29.780" LastActivityDate="2020-03-01T21:14:11.183" Title="How to select the initial guess for implied volatility?" Tags="&lt;implied-volatility&gt;&lt;quantlib&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24426" PostTypeId="2" ParentId="24422" CreationDate="2016-02-21T11:01:50.393" Score="9" Body="&lt;p&gt;First we have to clarify what we mean by &lt;em&gt;profits&lt;/em&gt;: I think your question can only address the fact that some human traders beat the market (because you also make &lt;em&gt;profit&lt;/em&gt; by just buying the market, e.g. through an ETF).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think there are two, perhaps even three main sources:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Randomness, luck (as @PerAlexandersson) correctly pointed out - financial markets are highly stochastic environments!&lt;/li&gt;&#xA;&lt;li&gt;From a systemic point of view the diversity of trading strategies: The more people follow a certain strategy - no matter how clever - the less profitable it will be (and vice versa)&lt;/li&gt;&#xA;&lt;li&gt;Level of fundamental research (all the way up to insider knowledge) (I know that this is still a matter of intense debate!)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For 2. see e.g. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1015987&quot;&gt;Khandani, Lo: What Happened to the Quants in August 2007 (2007)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://web.stanford.edu/class/msande348/papers/PeroldSharpe.pdf&quot;&gt;Perold, Sharpe: Dynamic Strategies for Asset Allocation (1995)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www-personal.umich.edu/~samoore/bit885w2012/EvolutionOfTradingStrategies-Hauser.pdf&quot;&gt;Hauser, Kaempff: Evolution of trading strategies in a market with heterogeneously informed agents (2011)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;N.B.: In this point is also factor investing included (e.g. value investing) - which when you look at it is nothing else but some sort of trading strategy!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For 3. see e.g.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://link.springer.com/chapter/10.1007/978-1-4615-4589-7_8&quot;&gt;Schredelseker: Is the Usefulness Approach Useful? Some Reflections on the Utility of Public Information (2001)&lt;/a&gt; (I have found no publicly available version)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(Just for your information: If you know some German the last two papers are very well explained in &lt;a href=&quot;http://www.springer.com/de/book/9783658087029&quot;&gt;Schredelseker: Den Finanzmarkt verstehen (2015))&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2016-02-21T11:18:40.953" LastActivityDate="2016-02-21T11:18:40.953" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24427" PostTypeId="1" CreationDate="2016-02-21T12:09:40.170" Score="2" ViewCount="202" Body="&lt;p&gt;I want to find a swap rate, for an IRS where the floating is Libor+x bp where x is a constant. I have a risk free curve which is not the libor curve. I also have the libor rates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I calculate the swap rate and x ? &lt;/p&gt;&#xA;" OwnerUserId="13477" LastEditorUserId="13477" LastEditDate="2016-02-21T17:28:03.557" LastActivityDate="2016-02-22T02:41:39.750" Title="Swap rate calculation if reference rate differs from risk free rates" Tags="&lt;swaps&gt;&lt;valuation&gt;&lt;interest-rate-swap&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24428" PostTypeId="2" ParentId="24425" CreationDate="2016-02-21T16:10:12.887" Score="2" Body="&lt;p&gt;&lt;strong&gt;1. When you are using not-so-easily-converging method for convergence&lt;/strong&gt; :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using simplest case of ATMF option , we can assume that&#xA;S = X * exp(-rT)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This gives a closed form solution for implied volatility as follows, which can be safely used as your initial estimator&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ImpliedVol =   (C/S) *  sqrt ( 2*pi / T)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;C = Market price of call option&lt;/p&gt;&#xA;&#xA;&lt;p&gt;S = Underlying asset price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reference :- This was presented by Brenner and Subrahmanyam (1988) in one of the papers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2. When you're using a better converging method , like Newton's or the similar league&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Calculate your historical vol , and then the option price. Then using linear interpolation,  scale up or down your historical vol w.r.t ratio/difference between your your option price ( BS ) and the market price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IV =  histVol *  (C / Cbs) * (Optional constant by intuition , default = 1.0)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;C = Market price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cbs = black scholes price of option&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would say that's a quite rough estimate and won't be very close to the actual value. But since you're using Newton Ralphson's approach which is quite good at convergence, I'd say this could be pretty smart one for an initial guess. Please feel free to use your own value for 'optional constant' here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reference : My thoughts.&lt;/p&gt;&#xA;" OwnerUserId="19434" LastEditorUserId="44603" LastEditDate="2020-03-01T21:14:11.183" LastActivityDate="2020-03-01T21:14:11.183" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="24429" PostTypeId="2" ParentId="20812" CreationDate="2016-02-21T16:10:34.623" Score="0" Body="&lt;p&gt;Also, I think the you might be scalping. What I mean is that if the underlying goes up, you accumulate delta on the call options and thus would need to short the underlying for a zero delta position. Once the underlying falls, your position becomes delta short and you would need to buy. Since you buy the underlying when low and sell when high, you scalp on the underlying and make money to offset the theta bleed and/or the drop in IV.&lt;/p&gt;&#xA;" OwnerUserId="15428" LastActivityDate="2016-02-21T16:10:34.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24430" PostTypeId="2" ParentId="24425" CreationDate="2016-02-21T16:55:05.283" Score="1" Body="&lt;p&gt;&quot;Which is another way of saying try all possible values&quot; - this is not quite correct, nether in general sense or in QuantLib implementation. QuantLib uses &lt;a href=&quot;https://en.wikipedia.org/wiki/Brent%27s_method&quot; rel=&quot;nofollow&quot;&gt;Brent's method&lt;/a&gt; (I assume for robustness) which requires a range as input, but it definitely does not calculate option values for all inputs in the range.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But just like HyperVol explained - that there are really two steps - 1 choose a good starting point, 2 - run few iterations of solver of your choice until convergence. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To calculate starting value (or range), I would recommend this simple formula &lt;a href=&quot;http://ssrn.com/abstract=567721&quot; rel=&quot;nofollow&quot;&gt;An Improved Estimator for Black-Scholes-Merton Implied Volatility&lt;/a&gt;, or more complicated (but more accurate) &lt;a href=&quot;http://www.pjaeckel.webspace.virginmedia.com/ByImplication.pdf&quot; rel=&quot;nofollow&quot;&gt;By Implication&lt;/a&gt;, or if you're working with ABM &lt;a href=&quot;http://ssrn.com/abstract=990747&quot; rel=&quot;nofollow&quot;&gt;Numerical approximation of the implied volatility under arithmetic Brownian motion&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.pjaeckel.webspace.virginmedia.com/ByImplication.pdf&quot; rel=&quot;nofollow&quot;&gt;By Implication&lt;/a&gt; approximation is much better that Corrado-Miller's formula&lt;/p&gt;&#xA;" OwnerUserId="185" LastEditorUserId="185" LastEditDate="2016-02-22T01:21:13.810" LastActivityDate="2016-02-22T01:21:13.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24431" PostTypeId="1" CreationDate="2016-02-21T16:58:06.117" Score="7" ViewCount="299" Body="&lt;p&gt;Let's say I have the following regression setup, which I am using for portfolio return attribution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$R = 1*\beta(1) + A*\beta(2) + B*\beta(3) + C*\beta(4) + \epsilon $ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where A is dummy matrix of country ,&#xA;      B is a dummy matrix of Industries,&#xA;      C is a matrix of factor exposures,&#xA;      1 is a vector of ones &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see in this setup, there is multicollinearity between A and B. The rank of (AB) &amp;lt; rank of (A) + rank of (B). In Matlab code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;rank([dummyvar(ceil(abs(rand(20,1))*5)'),dummyvar(ceil(abs(rand(20,1))*4)')])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I go about computing all these betas without dropping one of the Columns from A or B matrix, as is typically done to address this issue. I know there is a trick to solve this, but I can't remember how it's done. &lt;/p&gt;&#xA;" OwnerUserId="1696" LastEditorUserId="12" LastEditDate="2016-02-26T08:04:17.423" LastActivityDate="2016-02-26T18:39:47.677" Title="Return Attribution: Possible remedies for multicollinearity" Tags="&lt;regression&gt;&lt;matlab&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24432" PostTypeId="1" AcceptedAnswerId="24437" CreationDate="2016-02-21T17:23:15.687" Score="1" ViewCount="41" Body="&lt;p&gt;I have 2 numbers:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Average monthly sales volume for 2015 (Jan to Dec): 1,000&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Average monthly sales volume for 2016 YTD (Jan and Feb): 1,200&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I want to compare these 2 numbers with a % change, is it a YOY comparison?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or, is it a 2015 year-end average compared to 2016 year-to-date average?&lt;/p&gt;&#xA;" OwnerUserId="19565" LastActivityDate="2016-02-21T18:51:04.953" Title="YOY Comparison?" Tags="&lt;data&gt;&lt;finance&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24433" PostTypeId="1" CreationDate="2016-02-21T17:26:05.577" Score="0" ViewCount="121" Body="&lt;p&gt;Compute the weights in a portfolio consisting of two kinds of stocks if the expected return on the portfolio is to be $E(K_v)=10\%$, given the following information on the returns on stock 1 and 2:&#xA;$$&#xA;\begin{matrix}&#xA;Scenerio &amp;amp; probability &amp;amp; return K_1 &amp;amp; return K_2 \\&#xA;\omega_1 &amp;amp; 0.1 &amp;amp; -10\% &amp;amp; 10\% \\&#xA;\omega_2 &amp;amp; 0.3 &amp;amp; 0\% &amp;amp; -5\% \\&#xA;\omega_3 &amp;amp; 0.6 &amp;amp; 15\% &amp;amp; 20\% \\&#xA;\end{matrix}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found $E(K_1)=8\%$ and $(E_2)=11.5\%$ so $0.08\omega_1 + 0.115\omega_2 = 0.1$&lt;br&gt;&#xA;But I don't know how to find the weights? I think the covariance will help me so I found that to equal $0.0109$ but I am not sure if it is correct and I don't know how to find the weights?&lt;/p&gt;&#xA;" OwnerUserId="19355" LastActivityDate="2016-02-21T18:22:35.117" Title="how to find the weights in a portfolio?" Tags="&lt;portfolio-management&gt;&lt;risk-management&gt;&lt;covariance&gt;&lt;expected-return&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="1" ClosedDate="2016-02-21T19:08:20.657" ContentLicense="CC BY-SA 3.0" />
  <row Id="24434" PostTypeId="2" ParentId="24425" CreationDate="2016-02-21T17:56:10.080" Score="7" Body="&lt;p&gt;It is always better to use some closed form approximation first to get initial guess. &lt;strong&gt;Corrado and Miller (1996)&lt;/strong&gt; produced a solution that is quite accurate across a range of moneyness ( though it can be applied to BS model only and can’t be used for plain vanilla options or exotic options). The formula for implied volatility $\sigma$ is : &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma = \frac{1}{\sqrt{t}} \left[ \frac{\sqrt{2\pi}}{S+Xe^{-rt}}+  \left\{C - \frac{S-Xe^{-rt}}{2} +  \sqrt{\bigg(C- \frac{S-Xe^{-rt}}{2} \bigg)^2    - \frac{(S-Xe^{-rt})^2}{\pi}} \,  \, \right\}    \right] $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where, $C$ is actual market price, $X$ is strike price, and $t$ is time to maturity. &lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="16991" LastEditDate="2016-02-21T18:07:33.793" LastActivityDate="2016-02-21T18:07:33.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24435" PostTypeId="1" CreationDate="2016-02-21T18:14:42.280" Score="1" ViewCount="197" Body="&lt;p&gt;I am currently searching for an optimal approach for finding profitable forex trading strategies to automate. Currently, I just try to combine various indicators and build an automated trading system based on a mere idea. Although I know that nobody wants to share profitable trading strategies for free, I hope somebody can give me a couple of tips on how to develop own trading strategies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, basically I want to know if there is a simple process I can follow.&lt;/p&gt;&#xA;" OwnerUserId="19566" LastActivityDate="2016-02-21T18:14:42.280" Title="Optimal approach for finding a profitable trading strategy to automate?" Tags="&lt;quant-trading-strategies&gt;&lt;fx&gt;&lt;automated-trading&gt;&lt;algorithmic-trading&gt;&lt;trading-systems&gt;" AnswerCount="0" CommentCount="1" ClosedDate="2016-02-22T06:45:31.030" ContentLicense="CC BY-SA 3.0" />
  <row Id="24436" PostTypeId="2" ParentId="24433" CreationDate="2016-02-21T18:22:35.117" Score="1" Body="&lt;p&gt;&lt;strong&gt;In case of 2 securities, each and every combination of portfolio lies on efficient frontier&lt;/strong&gt;. In your question, you have given to achieve expected return of exactly 10%. So, we have&#xA;$$E(R_p)=w_1E(K_1) + w_2E(K_2)=0.10 \tag{1}$$&#xA;subject to: $$w_1 + w_2=1 \tag{2}$$&#xA;Solve your equation 1 and 2 to get $w_1$ and $w_2$. &lt;strong&gt;Resulting weights would lead to minimum variance for given expected return&lt;/strong&gt;. Variance of portfolio: &#xA;$$var(R_p)= w_1^2 \sigma_{K_1}^2 + w_2^2 \sigma_{K_2}^2 + 2 w_1 w_2\, cov(K_1, K_2) $$&#xA;where, $\sigma_{K_1}$ and $\sigma_{K_2}$ are standard deviation of $K_1$ and $K_2$ respectively. &lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2016-02-21T18:22:35.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24437" PostTypeId="2" ParentId="24432" CreationDate="2016-02-21T18:51:04.953" Score="0" Body="&lt;p&gt;You can compute a variation by making assumptions. The simplest way is to assume that the last known figure (here, your monthly sales volume for jan-feb 2016) is going to stay constant until the end of the period. This calculation is often used to compute GDP variations and is called carry-over. However, you should consider that this figure is not really significant: a lot can happen until the end of the year.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The result will not be a Year on Year calculation, and I do not believe that a year average vs 2 months average makes much sense as you compared potentially volatile figures observed over periods with different lengths.&lt;/p&gt;&#xA;" OwnerUserId="18780" LastActivityDate="2016-02-21T18:51:04.953" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24439" PostTypeId="1" CreationDate="2016-02-21T20:44:45.343" Score="2" ViewCount="66" Body="&lt;p&gt;In portfolio optimization, it is insufficient to just note the size of price deviation - that only tells the amount of profit if held to maturity. One also needs to take into account reversion speed - faster reversion means more profits per unit of time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How is this implemented in practice?&lt;/p&gt;&#xA;" OwnerUserId="5667" LastActivityDate="2016-02-21T20:44:45.343" Title="How to optimize an arbitrage portfolio when taking into account different speeds of mean reversion?" Tags="&lt;arbitrage&gt;&lt;portfolio-optimization&gt;&lt;mean-reversion&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24440" PostTypeId="1" CreationDate="2016-02-21T20:46:26.327" Score="2" ViewCount="98" Body="&lt;p&gt;I am trying to understand whether or not there is a standard model of convergence in the arbitrage scenario of negative stub models, i.e. when the market value of a company is valued less than its ownership stake in a publicly traded subsidiary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, let's say Company A has 10,000,000 shares worth \$5 each, and organizes an IPO spin-off for a subsidiary asset, Company B. The IPO will sell 20% of the shares and Company A will redistribute the remaining 80% to their own shareholders. Company B IPOs with 7,500,000 shares worth \$15 each, and Company A's share price increases to \$8. In this case, Company A's holding in Company B is worth \$90mm (80% of 7.5mm shares * \$15), while their implied valuation is only \$80mm (the original 10mm shares times the new price of \$8). This creates a stub value of -\$10,000,000.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ok, I'm clear so far. But my question is, how does the convergence of these two assets proceed over time? Do both share prices converge to the mean? Does the value of Company A increase over time to account for the new assets? Does Company B lose value because the Company A holdings are a better representation of value? Is there no consistent pattern of convergence and it completely depends on the individual case?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance for any insight on this!&lt;/p&gt;&#xA;" OwnerUserId="19353" LastEditorUserId="848" LastEditDate="2016-02-22T21:43:33.483" LastActivityDate="2016-02-22T21:43:33.483" Title="What is a standard model of convergence when looking at negative stub values?" Tags="&lt;equities&gt;&lt;arbitrage&gt;&lt;hedge-fund&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24441" PostTypeId="1" AcceptedAnswerId="24442" CreationDate="2016-02-21T20:47:36.253" Score="1" ViewCount="546" Body="&lt;p&gt;Compute the expected return $\mu_V$ and standard deviation $\sigma_V$ of a portfolio consisting of three securities with weights $\omega_1=40\%$, $\omega_2=-20\%$, $\omega_3=80\%$, given that the securities have expected reuturns $\mu_1=8\%$, $\mu_2=10\%$, $\mu_3=6\%$, standard deviations $\sigma_1=0.15$, $\sigma_2=0.05$, $\sigma_3=0.12$, and correlations $\rho_{12}=0.3$, $\rho_{23}=0$, $\rho_{31}=-0.2$.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know how to compute the expected return of the portfolio, I got $\mu_V=0.06$, but I don't know how to calculate the standard deviation of a portfolio? What is the formula I need to use given the information? Do I need to find the variances given the standard deviations?&lt;/p&gt;&#xA;" OwnerUserId="19355" LastActivityDate="2019-02-17T13:09:52.923" Title="How do I find the standard deviation of a portfolio?" Tags="&lt;portfolio-management&gt;&lt;standard-deviation&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2016-02-22T06:27:31.180" ContentLicense="CC BY-SA 3.0" />
  <row Id="24442" PostTypeId="2" ParentId="24441" CreationDate="2016-02-21T21:32:23.183" Score="2" Body="&lt;p&gt;You can calculate variance of a portfolio/basket by taking direct weighed averages of the components and then adding the relevant correlation terms * weights for each pair.&lt;/p&gt;&#xA;&lt;p&gt;Can take sqrt of the expression obtained to have Standard deviation.&lt;/p&gt;&#xA;&lt;p&gt;Exact formula for calculation goes like this :&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/KXygo.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/KXygo.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&#xA;&lt;sub&gt;(source: &lt;a href=&quot;http://www.benetzkorn.com/wp-content/uploads/2011/07/Markowitz-3-Asset.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;benetzkorn.com&lt;/a&gt;)&lt;/sub&gt;&lt;/p&gt;&#xA;" OwnerUserId="19434" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2019-02-17T13:09:52.923" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="24443" PostTypeId="2" ParentId="24427" CreationDate="2016-02-22T01:58:47.527" Score="1" Body="&lt;p&gt;You can't calculate the term swap rate from that information.  The problem is that the swap spread (ie difference between swap rate and government bond yield) has a term structure determined by supply and demand, that cannot be calculated.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-02-22T01:58:47.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24445" PostTypeId="2" ParentId="24427" CreationDate="2016-02-22T02:41:39.750" Score="2" Body="&lt;p&gt;This is actually no different from pricing a &quot;standard&quot; swap.  The par swap rate is the &quot;c&quot; solved from&#xA;$$ \sum_{i=1}^n c \cdot \delta_i \cdot d(t_i) = \sum_{j=1}^N \Delta_j \cdot (l_j + x) \cdot d(t_j). $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The left hand side is the present value of the fixed payments, where $n$ is the number of fixed leg payments, $\delta_i$ is the day count fraction for each period, $d(t_i)$ is the discount factor (taken from the risk free discount curve, usually the OIS curve).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The right hand side is the present value of the floating payments. Here $\Delta_j$ is the day count fraction corresponding to each payment period, $l_j$ is the LIBOR forward rate for each period, $x$ is the agreed-upon spread, and $d(t_j)$ is once again the risk-free discount factor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The risk-free curve not being LIBOR is not an issue. In fact, LIBOR is NOT risk-free and shouldn't be used as the discount curve even for a standard swap.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2016-02-22T02:41:39.750" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24446" PostTypeId="1" CreationDate="2016-02-22T04:32:57.427" Score="2" ViewCount="226" Body="&lt;p&gt;I am looking to solely make use of the theta decay and trying to overcome the effects of delta and Vega.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;​​If,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I sell ABC Feb OTM (strike price X) with 3 x 10 = Rs. 30 credit and buy ABC Mar OTM (strike price X) with 1 x 30 = Rs. 30 debit.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is Calendar spread Vega neutral? &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Now, both the values are simply extrinsic values. How would calendar spread pair react to any change in Implied volatility?&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;Is Calendar spread Delta neutral? &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This is my biggest concern. I could imagine that when spot price moves, the neutrality may be disturbed, but the sell and buy at same strike price should somehow diminish the losses/profits made on underlying price movements. Will they do it?&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;What are the factors that work solely to create losses? What are the factors that can work in both favorable and unfavorable ways?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="19441" LastActivityDate="2021-03-27T20:03:45.327" Title="Calendar spread: What are the worst cases?" Tags="&lt;option-strategies&gt;&lt;spread-options&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24447" PostTypeId="1" CreationDate="2016-02-22T09:09:40.420" Score="2" ViewCount="60" Body="&lt;p&gt;I have calculated forward rates like this:&#xA; $r_{t_1,t_2} = \left(\frac{(1+r_2)^{d_2}}{(1+r_1)^{d_1}}\right)^{\frac{1}{d_2-d_1}} - 1 $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to find the discount factors for these forward, with ACT/360, with this formula: $ DF(T) = \frac{1}{( 1 + \frac{r}{360} )^{ 360T } } $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I use the above for the ACT/360 discounting, or I have to calculate the forward prices with ACT/360?&lt;/p&gt;&#xA;" OwnerUserId="19574" LastActivityDate="2016-02-22T09:09:40.420" Title="Can I use these rates for ACT/360 discounting?" Tags="&lt;interest-rates&gt;&lt;discounting&gt;&lt;daycounting&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24448" PostTypeId="1" AcceptedAnswerId="24454" CreationDate="2016-02-22T09:10:47.733" Score="2" ViewCount="696" Body="&lt;p&gt;I'm trying to calculate the probability of a calendar spread resulting in a profit at expiration, when estimating it is modeled as a lognormal distribution, by getting:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;P(a &amp;lt;= x &amp;lt;= b) = CDF(b) - CFA(a)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where a and b are the breakevens at expiration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But there is something that I don't understand:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Which value shall I use as variance? The IV of the ATM option for near expiration? The IV of the stock/index underneath?&lt;/li&gt;&#xA;&lt;li&gt;Does time really matter? I mean, since lognormal distribution (as defined in &lt;code&gt;scipy&lt;/code&gt;/&lt;code&gt;numpy&lt;/code&gt; libraries) only requires mean and variance values, time does not matter unless you consider that volatility depends on t. If I get mean and variance for 2 calendars, one with front mont expiring in a week and another one expiring in a year, time should matter somehow, making the distribution PDF wider, and therefore affecting the results of the CDF. What am I missing here?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="15068" LastActivityDate="2016-02-22T16:57:09.860" Title="Calculating probability of options with normal/lognormal distribution: does time make a difference?" Tags="&lt;options&gt;&lt;probability&gt;&lt;lognormal&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24449" PostTypeId="1" CreationDate="2016-02-22T09:17:57.197" Score="2" ViewCount="20" Body="&lt;p&gt;I'm playing a game in which you can buy and sell items (it's an mmorpg). Now, after certain events, there is a huge drop in the price of certain items (there is a seasonal double experience weekend in which many people grind a lot, causing the market to overflow with certain items). Now, I want to decide which items I could buy right after that double experience weekend to sell a month after. &#xA;I have the average price of the item per day readily available (I downloaded all the data to my computer) and it can look for example like this:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/ZnKxa.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZnKxa.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see, there is a huge drop around the beginning of october after which it will steadily raise again. I only have the data of one of those double experience weekends though...&#xA;Now, my question is: how can I decide whether an item is a good one to buy in a (semi-)automatic way. Are there any good criteria? I want to calculate a 'score' of an item to decide whether it's a good one or not (let's say that every item is always traded and there is always a sufficient amount of offer and demand).&#xA;At the moment, I'm looking if a price of an items drops during the days after the double experience weekend and compare it to the price a month later. This still has some errors though, because some items do not respond as fast as other (in their drop).&#xA;Any theories I should be looking at? Any criteria to investigate? Keep in mine I want to buy DURING the double experience weekend and sell about a month after. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your time already!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: I also don't know if this is the correct section for my question...&lt;/p&gt;&#xA;" OwnerUserId="19575" LastActivityDate="2016-02-22T09:17:57.197" Title="Decision criteria after seasonal drop (GAME)" Tags="&lt;financial&gt;&lt;trends&gt;&lt;seasonal-effects&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24450" PostTypeId="1" CreationDate="2016-02-22T09:40:08.180" Score="8" ViewCount="225" Body="&lt;p&gt;Where can I get two to four years worth of historic data news for companies included in DJ and S&amp;amp;P? I mean not just prices historic data but also news.&#xA;Preferably for free and in CSV or any similar form.&lt;/p&gt;&#xA;" OwnerUserId="19577" LastEditorUserId="19577" LastEditDate="2016-02-24T16:01:01.333" LastActivityDate="2017-03-24T21:18:38.993" Title="Where can I get two to four years worth of historic data news for companies included in DJ and S&amp;P?" Tags="&lt;historical-data&gt;&lt;news&gt;&lt;data-source&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24451" PostTypeId="1" CreationDate="2016-02-22T11:45:16.203" Score="2" ViewCount="1205" Body="&lt;p&gt;I should create a VAR model with Garch error in R but i don't know how to do it and which package to use. The Vector Autoregressive model (or VECM) should also have covariates in it. Then I should perform a gaussian quasi-likelihood estimation. Anyone who could help me? Thank you&lt;/p&gt;&#xA;" OwnerUserId="19578" LastActivityDate="2018-08-12T11:37:56.637" Title="How to fit a VAR + GARCH in R" Tags="&lt;r&gt;&lt;garch&gt;&lt;var&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24452" PostTypeId="1" AcceptedAnswerId="24457" CreationDate="2016-02-22T15:07:46.163" Score="2" ViewCount="273" Body="&lt;p&gt;I'm using the Bloomberg API to subscribe to market data changes. While I manage to retrieve fields such as &lt;code&gt;OPT_GAMMA_MID_RT&lt;/code&gt; or &lt;code&gt;OPT_DELTA_ASK_RT&lt;/code&gt;, it seems I cannot retrieve the iNav for a given ETF (the code would be &lt;code&gt;ETF_INAV_VALUE&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can send a &lt;code&gt;ReferenceDataRequest&lt;/code&gt; directly (using the ticker and the code &lt;code&gt;ETF_INAV_VALUE&lt;/code&gt;) and correctly get the value, but I don't receive any feed regarding changes to the iNav value. I would like to avoid polling with &lt;code&gt;ReferenceDataRequest&lt;/code&gt;...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The field is updated in my terminal but I am not made aware of it in my code even though I did subscribe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this field need special handling compared to regular &lt;code&gt;ASK&lt;/code&gt; / &lt;code&gt;BID&lt;/code&gt; fields?&lt;/p&gt;&#xA;" OwnerUserId="19581" LastActivityDate="2016-02-22T17:46:29.420" Title="Subscribe to iNav changes via ETF_INAV_VALUE key" Tags="&lt;bloomberg&gt;&lt;etf&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24453" PostTypeId="1" CreationDate="2016-02-22T15:20:19.683" Score="6" ViewCount="239" Body="&lt;p&gt;I need to carry a non-contractual accounts behavoiural study for a bank. The objective is to estimate core/non core ratios and then bucket and ftp them. Any recipe where to start? I have 3yrs of historical data, daily closing balances. From what I googled I understand that I need some kind of seasonal vs growth trend segregation. But only guidelines, nothing in particular. Visually represented my data has (e.g. current accounts) very heavy seasonal bias with highs in shoulder seasons and lows in the festive seasons ;)). How to isolate it? How do I then calculate the true core/volatile ratio?&lt;/p&gt;&#xA;" OwnerUserId="19582" LastActivityDate="2021-04-01T10:06:50.630" Title="Non-contractual accounts behavioural study" Tags="&lt;risk&gt;&lt;market-data&gt;&lt;valuation&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24454" PostTypeId="2" ParentId="24448" CreationDate="2016-02-22T16:57:09.860" Score="3" Body="&lt;p&gt;If $S_t$ is stochastic process and follow geometric Brownian motion with following SDE: &#xA;$$dS_t=\mu S_t dt + \sigma S_t dW_t$$&#xA;then $S_T$ follows lognormal distribution, such that: &#xA;$$S_T|S_t \sim logN\left(lnS_t+ (\mu - \frac{\sigma^2}{2})(T-t), \quad \sigma^2(T-t)\right)$$&#xA;or&#xA;$$lnS_T|S_t \sim N\left(lnS_t+ (\mu - \frac{\sigma^2}{2})(T-t), \quad \sigma^2(T-t)\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you may see, more you will go into the future, both the drift and volatility increase directly in proportionate to $(T-t)$ for log of stock price. This is natural phenomenon. You may think like this, the variability shown by stock price in one year(ie $T-t=1$) is much more than variability shown in one minute or one day(ie $T-t=\frac{1}{365}$).  &lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2016-02-22T16:57:09.860" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24455" PostTypeId="2" ParentId="24419" CreationDate="2016-02-22T17:17:36.630" Score="0" Body="&lt;p&gt;After some digging arround, I found that you can derive the single factor model under the following assumptions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\beta_1 = \beta_2$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\gamma_1 = \gamma_2$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, we require $Cov(\epsilon_1, \epsilon_2) = 0$ and $Cov(\epsilon_i, x) = 0$ for $i = 1, 2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, we would require $y_1$ and $y_2$ to be normalized $\tilde{} N(0, 1)$ for the correlation to be equal to the co-variance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This way:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma_i^2 = \beta^2 + \gamma^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma_{i,j} = \beta^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and we can derive the above.&lt;/p&gt;&#xA;" OwnerUserId="17284" LastEditorUserId="17284" LastEditDate="2016-02-24T09:29:35.233" LastActivityDate="2016-02-24T09:29:35.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24456" PostTypeId="1" CreationDate="2016-02-22T17:24:18.267" Score="1" ViewCount="1718" Body="&lt;p&gt;If I treat the 2 legs as bonds, and I want to calculate the present value somewhere between 2 payment date, should I calculate accrued interest? &lt;/p&gt;&#xA;" OwnerUserId="17775" LastActivityDate="2016-03-23T19:02:22.337" Title="By swap valuation, is accrued interest calculated?" Tags="&lt;fixed-income&gt;&lt;swaps&gt;&lt;interest-rate-swap&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24457" PostTypeId="2" ParentId="24452" CreationDate="2016-02-22T17:46:29.420" Score="1" Body="&lt;p&gt;&lt;code&gt;ETF_INAV_VALUE&lt;/code&gt; is not a real time field so it won't work (HELP HELP may have a workaround on this).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can query the &lt;code&gt;EXCHANGE_TRADED_FUNDS_NAV_TKR_RT&lt;/code&gt; field which will give you a ticker for the NAV. Then subscribing to the last price on that ticker should give you what you want (note that I haven't tried).&lt;/p&gt;&#xA;" OwnerUserId="2393" LastActivityDate="2016-02-22T17:46:29.420" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24458" PostTypeId="1" CreationDate="2016-02-22T18:23:19.103" Score="4" ViewCount="1296" Body="&lt;p&gt;I was asked this question in an interview some years ago. It struck me as a poorly formed question. I thought I would put it out there to the community to see if I just simply missed something.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Problem Statement&lt;/strong&gt;&#xA;For n assets, you are given expected returns (ER), variances (V) and covariances. Your task is to write Monte Carlo based mean variance optimization that will: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Produce a set of efficient portfolios with increasing volatility / return.&lt;/li&gt;&#xA;&lt;li&gt;Find the minimum variance portfolio&lt;/li&gt;&#xA;&lt;li&gt;Find the highest sharpe ratio portfolio.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Portfolios should be subject to the following constraints:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;No shorting (all weights &gt;= 0)&lt;/li&gt;&#xA;&lt;li&gt;No leverage (sum of all weights = 100%).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Why I think this is poorly stated problem&lt;/strong&gt;&#xA;I understand MVO and MC. The only context I have seen MC in a MVO concept is where MC is utilized to make random draws from a chosen distribution to arrive at an ER and Covariance Matrix. Those however are given here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;If I am wrong here&lt;/strong&gt; then what is the MC random draws in this case - the asset weights?&lt;/p&gt;&#xA;" OwnerUserId="19584" LastActivityDate="2018-09-13T20:44:57.697" Title="Monte Carlo based mean variance optimization" Tags="&lt;monte-carlo&gt;&lt;asset-allocation&gt;&lt;mean-variance&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24459" PostTypeId="2" ParentId="24456" CreationDate="2016-02-22T18:26:37.113" Score="1" Body="&lt;p&gt;When you sum up all the discounted cash flows, you effectively a &quot;dirty price&quot; (i.e., inclusive of &quot;accrued interest&quot;). This quantity is used for marking to market or unwinding. You don't need to worry about &quot;accrued interest&quot; separately.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2016-02-22T18:26:37.113" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24460" PostTypeId="2" ParentId="23240" CreationDate="2016-02-22T18:27:17.420" Score="5" Body="&lt;p&gt;Here is an example of such a product in Europe. (I don't personally own or recommend them., there are also other such issuers.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Commerzbank Faktor certificates:&lt;/strong&gt; &#xA;These should meet all your requirements, range of -10x to +10x constant leverage, open ended, no dividends, no knock-out's as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.certificats.commerzbank.ch/SiteContent/11/5/2/725/41/Faktor_QuickGuide_A4_Eng.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.certificats.commerzbank.ch/SiteContent/11/5/2/725/41/Faktor_QuickGuide_A4_Eng.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Index Example:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://zertifikate.finanztreff.de/dvt_einzelkurs_uebersicht.htn?seite=zertifikate&amp;amp;i=35002894&quot; rel=&quot;nofollow&quot;&gt;http://zertifikate.finanztreff.de/dvt_einzelkurs_uebersicht.htn?seite=zertifikate&amp;amp;i=35002894&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Single Name Example's:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BMW:&#xA;&lt;a href=&quot;http://zertifikate.commerzbank.de/Products/ProductDetailsDownloadPIB.aspx?type=pib&amp;amp;isin=DE000CZ6RQ37&quot; rel=&quot;nofollow&quot;&gt;http://zertifikate.commerzbank.de/Products/ProductDetailsDownloadPIB.aspx?type=pib&amp;amp;isin=DE000CZ6RQ37&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;DB:&#xA;&lt;a href=&quot;http://zertifikat.finanzen.net/optionsscheine/Auf-Deutsche-Bank-AG/CZ0VVR&quot; rel=&quot;nofollow&quot;&gt;http://zertifikat.finanzen.net/optionsscheine/Auf-Deutsche-Bank-AG/CZ0VVR&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="12" LastEditDate="2016-02-22T20:04:22.267" LastActivityDate="2016-02-22T20:04:22.267" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="24462" PostTypeId="1" CreationDate="2016-02-22T20:58:36.587" Score="2" ViewCount="358" Body="&lt;p&gt;I am in the process of creating a program that generates status-quo variance-free portfolio (at least theoretically), and my question is pretty fundamental, which may just mean dumb. I am sorry if that is the case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, since most of the formulas I have seen for a &quot;risk-free&quot; portfolio say that you are basically replicating the return of the archetypal risk-free asset (treasury bonds, in the case of my textbook), why would we want to replicate that if they are readily available?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Again, sorry if that is a dumb question.&lt;/p&gt;&#xA;" OwnerUserId="19586" LastActivityDate="2016-02-23T18:03:04.420" Title="Why is a risk-free portfolio desirable?" Tags="&lt;risk-free&gt;&lt;portfolio-theory&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24463" PostTypeId="2" ParentId="22840" CreationDate="2016-02-22T21:20:36.410" Score="3" Body="&lt;p&gt;For simple interpolation, implied variance (i.e. implied vol squared times maturity) vs. log moneyness (i.e. log of strike over forward) is probably the best choice.  In these coordinates, Roger Lee results on the asymptotics imply the curve flattens to linear in the high and low moneyness limits, which fits with natural spline boundary conditions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no canonical solution for the full problem you face of interpolating/extrapolating missing data across strikes and time.  You can make modelling approaches as complicated as you want; it just is a hard problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would suggest to do the simplest thing you can tolerate.  Complex solutions have a way of causing more problems than they solve.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2016-02-22T21:20:36.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24464" PostTypeId="2" ParentId="24425" CreationDate="2016-02-22T21:32:54.903" Score="6" Body="&lt;p&gt;Do you really need to do this yourself?   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The absolute state of the art is Peter Jaeckel's work, where he makes an implied vol function as good as exp, cos, and log special functions.  And he pulished source code and algorithm details with careful numerical analysis of errors and convergence.  This is a wheel you don't have to reinvent, any more than you need to write your own cosine function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.pjaeckel.webspace.virginmedia.com/LetsBeRational.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.pjaeckel.webspace.virginmedia.com/LetsBeRational.pdf&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2016-02-22T21:32:54.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24465" PostTypeId="1" AcceptedAnswerId="24466" CreationDate="2016-02-22T21:48:25.230" Score="11" ViewCount="822" Body="&lt;p&gt;What are the &lt;strong&gt;main stochastic processes&lt;/strong&gt; (and their SDE) used in quant finance?&lt;br&gt;&#xA;For example to model currency prices, stock prices, etc.&lt;/p&gt;&#xA;" OwnerUserId="18444" LastEditorUserId="18444" LastEditDate="2016-02-22T21:53:40.780" LastActivityDate="2016-02-23T08:20:52.330" Title="Processes used in quant finance" Tags="&lt;stochastic-processes&gt;&lt;fx&gt;&lt;brownian-motion&gt;&lt;sde&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="24466" PostTypeId="2" ParentId="24465" CreationDate="2016-02-22T21:48:25.230" Score="18" Body="&lt;p&gt;Here is a short list &lt;em&gt;(to be edited and improved - community wiki)&lt;/em&gt; :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Brownian_motion&quot;&gt;Standard brownian motion&lt;/a&gt; (also called Wiener process) for which:&lt;br&gt;&#xA;$d\, W_t \sim  \mathcal N(0, \sqrt{d t})$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Geometric_Brownian_motion&quot;&gt;Geometric brownian motion&lt;/a&gt;, used in the &lt;a href=&quot;https://en.wikipedia.org/wiki/Black%E2%80%93Scholes_model&quot;&gt;Black-Scholes model (1973)&lt;/a&gt;:&lt;br&gt;&#xA;$d\,X_t = \mu X_t\,dt + \sigma X_t\,dW_t$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Constant_elasticity_of_variance_model&quot;&gt;Constant elasticity of variance (&quot;CEV&quot;) model (1975)&lt;/a&gt;:&lt;br&gt;&#xA;$d\,X_t=\mu X_t dt + \sigma X_t\,^\gamma\, d W_t$, with $\gamma \geq 0$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Ornstein%E2%80%93Uhlenbeck_process&quot;&gt;Orstein-Uhlenbeck process&lt;/a&gt;, with mean reversion property, used e.g. in &lt;a href=&quot;https://en.wikipedia.org/wiki/Vasicek_model&quot;&gt;Vasicek model (1977)&lt;/a&gt;:&lt;br&gt;&#xA;$d\, X_t = \theta(\mu - X_t) dt + \sigma\,dW_t$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Merton jump diffusion process (1976), used for options pricing:&lt;br&gt;&#xA;$d\, X_t = \mu X_t\, dt + \sigma X_t\, d W_t + y_t\, d N_t$, with $N_t$ a Poisson process, and $y_t$ the jump size as a random process&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Cox%E2%80%93Ingersoll%E2%80%93Ross_model&quot;&gt;Cox–Ingersoll–Ross (&quot;CIR&quot;) process (1985)&lt;/a&gt;, used for interest rates model:&lt;br&gt;&#xA;$d\, X_t = \kappa (\theta - X_t) dt + \sigma \sqrt{X_t} dW_t$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Heston_model&quot;&gt;Heston model (1993)&lt;/a&gt;, in which the volatility of the asset is not constant but follows a random process:&lt;br&gt;&#xA;$d\, X_t = \mu X_t dt + \sqrt{\nu_t}\, X_t\, dW_t^X$&lt;br&gt;&#xA;$d\, \nu_t = \kappa (\theta - \nu_t) dt + \xi \sqrt{\nu_t} dW_t^\nu$ (i.e. $\nu_t$ is a CIR process),&#xA;with $W_t^X$, $W_t^\nu$ two Wiener processes with correlation $\rho$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Other processes that use a random process for volatility: $\nu_t$ follows a geometric brownian motion (Hull and White, 1987), $\nu_t$ follows a Orstein-Uhlenbeck process (Stein and Stein, 1991).&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;See also &lt;a href=&quot;http://fedc.wiwi.hu-berlin.de/fedc_homepage/xplore/tutorials/stfhtmlnode52.html&quot;&gt;Modern Pricing Models&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="18444" LastEditorUserId="18444" LastEditDate="2016-02-23T08:20:52.330" LastActivityDate="2016-02-23T08:20:52.330" CommentCount="4" CommunityOwnedDate="2016-02-22T21:48:25.230" ContentLicense="CC BY-SA 3.0" />
  <row Id="24467" PostTypeId="2" ParentId="24462" CreationDate="2016-02-22T22:09:28.517" Score="1" Body="&lt;p&gt;I think the goal of the exercise is to create some sort of risk-free portfolio with a positive return after borrowing costs. Then, theoretically, you can lever it up. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And of course, at 10x leverage, you should be pretty sure that is really is risk-free. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2016-02-22T22:09:28.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24468" PostTypeId="2" ParentId="24458" CreationDate="2016-02-22T22:10:17.997" Score="3" Body="&lt;p&gt;I believe the question to be too vague to be a good interview question. If you want to do Mean Variance Optimization (MVO) it's hard to see the point of Monte Carlo simulation. One of the good thing of MVO is its analytic tractability. Clearly, the topic is not widely discussed as this &lt;a href=&quot;https://www.google.nl/search?client=ubuntu&amp;amp;channel=fs&amp;amp;q=mean%20variance%20optimization%20monte%20carlo%20finance%20portfolio&quot; rel=&quot;nofollow&quot;&gt;Google Search&lt;/a&gt; has this question as the first result (I was in incognito mode). The &lt;a href=&quot;http://link.springer.com/article/10.1007%2Fs10287-010-0123-6&quot; rel=&quot;nofollow&quot;&gt;first linked paper by Xu&lt;/a&gt; would not be appropriate for any interview. &lt;a href=&quot;https://en.wikipedia.org/wiki/Portfolio_optimization#Improving_portfolio_optimization&quot; rel=&quot;nofollow&quot;&gt;Wikipedia&lt;/a&gt; mentions the usage of Monte Carlo for extensions of MVO but not for classical MVO itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To conclude: I don't believe you're wrong. They could have meant other things but then there is much to choose from, e.g. Michaud resampling as suggested by John and the above.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2016-02-22T22:10:17.997" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24469" PostTypeId="1" CreationDate="2016-02-23T01:44:12.073" Score="1" ViewCount="352" Body="&lt;p&gt;(I've been downgraded on this question, and it's because most people don't understand what I mean. If you ever did hft arb, you will understand what I mean. If not, please do not answer) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Everybody has heard that when you do arb between different venues (ie: currenex and fxall) they can call you &quot;sharp&quot; &#xA;Your provider will start to complain saying that you are being sharp, and may start taking out some liquidity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, how they know you are doing arb and why you are being sharp. &#xA;And if anything, how to avoid it. &lt;/p&gt;&#xA;" OwnerUserId="13990" LastEditorUserId="13990" LastEditDate="2016-02-24T03:42:52.580" LastActivityDate="2016-02-24T03:42:52.580" Title="Latency Arbitrage in forex" Tags="&lt;fx&gt;&lt;arbitrage&gt;&lt;latency&gt;" AnswerCount="0" CommentCount="3" ClosedDate="2016-02-23T06:30:14.987" ContentLicense="CC BY-SA 3.0" />
  <row Id="24470" PostTypeId="1" AcceptedAnswerId="24482" CreationDate="2016-02-23T03:12:06.167" Score="3" ViewCount="2015" Body="&lt;p&gt;I am using the &lt;code&gt;sgt&lt;/code&gt; package in R to recreate the plot from Hansen's paper ( available here &lt;a href=&quot;http://www.ssc.wisc.edu/~bhansen/papers/ier_94.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.ssc.wisc.edu/~bhansen/papers/ier_94.pdf&lt;/a&gt; on page 8) using random draws from the skew-t distribution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I begin with $\eta=30$ using the following code:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;x = rsgt(1000000, mu = 0, sigma = 1, lambda = 0.5, p = 2, q=30, mean.cent=TRUE, var.adj=TRUE)&lt;br&gt;&#xA;  t=density(x)&lt;br&gt;&#xA;  plot(t, xlim=c(-2, 2))&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And I obtain a plot that is analogycal to the one given in the paper. However, using $\eta = 3$ or $\eta = 2.1$ (replace q with one of those values) results in much different plots, which look weird. Do you have any suggestions to how to solve this matter?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: I include the plots I want to obtain and the ones I can obtain.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/QAPk0.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/QAPk0.png&quot; alt=&quot;Plot from Hansen&amp;#39;s paper&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The one for $\eta=30$:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/SJKdf.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/SJKdf.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The one for $\eta=2.1$:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/eqGLK.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/eqGLK.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17464" LastEditorUserId="17464" LastEditDate="2016-02-23T10:27:28.997" LastActivityDate="2016-02-23T17:30:25.697" Title="Density plot of the skew-t distribution" Tags="&lt;r&gt;&lt;probability&gt;&lt;distribution&gt;&lt;density&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24472" PostTypeId="1" AcceptedAnswerId="24474" CreationDate="2016-02-23T08:25:30.127" Score="9" ViewCount="15922" Body="&lt;p&gt;Is it true &lt;em&gt;(&lt;a href=&quot;https://www.nada.kth.se/utbildning/grukth/exjobb/rapportlistor/2009/rapporter09/odelman_torbjorn_09020.pdf&quot; rel=&quot;noreferrer&quot;&gt;see here&lt;/a&gt;, footnote 2, p.22 / p.14, without proof)&lt;/em&gt; that we can obtain two discretized brownian motions $W_t^1, W_t^2$ &lt;strong&gt;with correlation $\rho$&lt;/strong&gt; by doing &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d W_t^1 \sim \mathcal N(0,\sqrt{dt})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d W_t^2 = \rho\, d W_t^1 + \sqrt{1-\rho^2} dZ_t$$ with $dZ_t \sim \mathcal N(0,\sqrt{dt})$ ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this is true, we could easily simulate them in Python by doing:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Gxjl3.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Gxjl3.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import numpy as np&#xA;import matplotlib.pyplot as plt&#xA;&#xA;n = 1000000; dt = 0.01; rho = 0.8&#xA;dW1 = np.random.normal(0, np.sqrt(dt), n)&#xA;dW2 = rho * dW1 + np.sqrt(1 - rho **2) * np.random.normal(0, np.sqrt(dt), n)&#xA;W1 = np.cumsum(dW1)&#xA;W2 = np.cumsum(dW2)&#xA;plt.plot(W1)&#xA;plt.plot(W2)&#xA;plt.show()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is this correct?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="18444" LastEditorUserId="18444" LastEditDate="2016-02-24T10:42:08.020" LastActivityDate="2019-03-15T15:21:50.937" Title="Two correlated brownian motions" Tags="&lt;monte-carlo&gt;&lt;correlation&gt;&lt;brownian-motion&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="24473" PostTypeId="2" ParentId="85" CreationDate="2016-02-23T09:20:23.160" Score="2" Body="&lt;p&gt;To the best of my knowledge, progress has been made in making pricing models more accurate, accounting for additional variables (stochastic vol. &amp;amp; GARCH, local vol., jumps, etc), but the option pricing equations fundamentally involve the same GBM framework, albeit they are much more complicated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Off the top of my head, the only example I can think of something completely original is &lt;a href=&quot;http://papers.ssrn.com/abstract=2412761&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/abstract=2412761&lt;/a&gt; Here, option prices grow at $t^{1/4}$ instead of $t^{1/2}$ &lt;/p&gt;&#xA;" OwnerUserId="15081" LastEditorUserId="15081" LastEditDate="2016-02-23T09:29:50.377" LastActivityDate="2016-02-23T09:29:50.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24474" PostTypeId="2" ParentId="24472" CreationDate="2016-02-23T09:32:42.787" Score="9" Body="&lt;p&gt;First you need to correct the formula to:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;W_t^2 = \rho W_t^1 + \sqrt{1-\rho^2} Z_t, &#xA;$$&lt;/span&gt;&#xA;where &lt;span class=&quot;math-container&quot;&gt;$Z_t$&lt;/span&gt; is a BM independent of &lt;span class=&quot;math-container&quot;&gt;$W_t^1$&lt;/span&gt;&#xA;If you calculate the variance and the covariance, then you see that it is true:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;V[W_t^1] = t&#xA;$$&lt;/span&gt;&#xA;and&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;V[W_t^2] = \rho^2 V[W_t^1] + (1-\rho^2) V[Z_t] = \rho^2 t + (1-\rho^2) t = t,&#xA;$$&lt;/span&gt;&#xA;which is the desired variance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the covariance you get&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;Cov[W_t^1,W_t^2] =  \rho Cov[W_t^1, W_t^1] + \sqrt{1-\rho^2} Cov[W_t^1, Z_t] &#xA;$$&lt;/span&gt;&#xA;which gives (because &lt;span class=&quot;math-container&quot;&gt;$Cov[W_t^1, W_t^1] = V[W_t^1]$&lt;/span&gt; and by indpenence of &lt;span class=&quot;math-container&quot;&gt;$W_t^1$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$Z_t$&lt;/span&gt;:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;Cov[W_t^1,W_t^2] =  \rho t + 0,&#xA;$$&lt;/span&gt;&#xA;and noting that &lt;span class=&quot;math-container&quot;&gt;$\sqrt{V[W_t^1]} = \sqrt{V[W_t^2]}  = \sqrt{t}$&lt;/span&gt; we get&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;Cor[W_t^1,W_t^2] = \frac{Cov[W_t^1,W_t^2]}{\sqrt{V[W_t^1]} \sqrt{V[W_t^2]} } = \frac{\rho t}{t} = \rho.&#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="27374" LastEditDate="2019-03-15T15:21:50.937" LastActivityDate="2019-03-15T15:21:50.937" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="24475" PostTypeId="2" ParentId="18090" CreationDate="2016-02-23T10:38:49.653" Score="1" Body="&lt;p&gt;The FilingSummary.xml has a kind of &quot;Table of contents&quot;. I use this to find the balance sheet, income statement and statement of cash flow. &#xA;But this is not trivial, as companies has different ways of naming these. But when you find them, they are often among the first Rx.html files. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So i suggest you build something that can find variations of keywords like &quot;consolidated balance sheet&quot; to find the balance sheet, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also notice the FilingSummary.xml does not exist on EDGAR before spring 2011, so going this way will mean you wont have data before this date.&lt;/p&gt;&#xA;" OwnerUserId="19592" LastActivityDate="2016-02-23T10:38:49.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24476" PostTypeId="1" CreationDate="2016-02-23T12:33:41.630" Score="3" ViewCount="365" Body="&lt;p&gt;What is the Reset Date standard for ICP (Indice Camara Promedio) trade? Trade Currencies are USD v/s CLP. Please provide the ISDA link if there are any amendments to ISDA standards.&lt;/p&gt;&#xA;" OwnerUserId="19370" LastActivityDate="2016-02-23T12:33:41.630" Title="Reset Date standard for ICP (Indice Camara Promedio) trade" Tags="&lt;interest-rates&gt;&lt;interest-rate-swap&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24477" PostTypeId="1" CreationDate="2016-02-23T13:30:16.237" Score="3" ViewCount="740" Body="&lt;p&gt;A bit of background. I know that the forward price of a stock (or its expected price) is given by $\mathbb{E}[S_T]=S_te^{(r-q)(T-t)}$. Here, $r$ and $q$ are not constant, but follow a curve. I was wondering whether the following is true: $\mathbb{Var}[S_T]=S_t^2e^{\sigma^2(T-t)}$, where $\sigma^2$ is the Black-Scholes volatility. I believe this to be true, but I cannot convince myself. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anyone help me out on this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit. Thanks for the help guys. I was also wondering whether it was possible to determine this value. $\mathbb{Var}[e^{(r-q)(T-t)}]$. Just that value without the stock price?&lt;/p&gt;&#xA;" OwnerUserId="19596" LastEditorUserId="16148" LastEditDate="2016-02-24T19:05:18.467" LastActivityDate="2016-02-24T19:05:18.467" Title="Variance of a Stock price and relationship with volatility" Tags="&lt;equities&gt;&lt;variance&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24478" PostTypeId="2" ParentId="24477" CreationDate="2016-02-23T13:59:21.433" Score="3" Body="&lt;p&gt;This is not true. In the Black-Scholes setting,&#xA;\begin{align*}&#xA;S_T = S_t e^{(r-q-\frac{1}{2}\sigma^2)(T-t)+\sigma (W_T-W_t)}.&#xA;\end{align*}&#xA;Then &#xA;$$E_t(S_T) = S_te^{(r-q)(T-t)}, $$&#xA;and&#xA;\begin{align*}&#xA;Var_t(S_T) &amp;amp;= E_t(S_T^2) - (E_t(S_T))^2\\&#xA;&amp;amp;=S_t^2e^{(2(r-q)+\sigma^2)(T-t)}-S_t^2e^{2(r-q)(T-t)}\\&#xA;&amp;amp;=S_t^2e^{2(r-q)(T-t)}\big[e^{\sigma^2(T-t)} -1\big].&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-02-23T13:59:21.433" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24479" PostTypeId="1" CreationDate="2016-02-23T16:09:03.357" Score="2" ViewCount="161" Body="&lt;p&gt;I would like to connect to Nasdaq to execute some simple automated strategies. I am &lt;strong&gt;NOT&lt;/strong&gt; a big bank or hedge fund, so paying a high monthly fee is impractical. Is there a way for a small startup or individual to get connectivity to the Nasdaq markets without having to pay a high monthly fee?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please don't worry about latencies as I understand that the less I pay the more will be the latency. Our strategies will not be latency-sensitive. &lt;/p&gt;&#xA;" OwnerUserId="15964" LastActivityDate="2016-02-23T17:23:58.397" Title="What is the cheapest way to connect to Nasdaq for market data and trading *electronically*?" Tags="&lt;market-data&gt;&lt;nasdaq&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24480" PostTypeId="2" ParentId="24472" CreationDate="2016-02-23T17:05:22.193" Score="9" Body="&lt;p&gt;Here is the &lt;strong&gt;general approach&lt;/strong&gt; you can follow to generate two correlated random variables. Let's suppose, X and Y are two random variable, such that: &#xA;$$X \sim N(\mu_1, \sigma_1^2)$$&#xA;$$Y \sim N(\mu_2, \sigma_2^2)$$&#xA;and $$cor(X,Y)=\rho$$&#xA;Now consider: $y=bx + e_i$, where $x$ $(=\frac{X-\mu_1}{\sigma_1}$) and $y$  $(=\frac{Y-\mu_2}{\sigma_2}$) both follow standard normal distribution , such that $cor(x,y)=\rho. $ For standard normal variate, $b= \rho$. So we have: &lt;/p&gt;&#xA;&#xA;&lt;h1&gt;$$y=\rho x + e_i$$&lt;/h1&gt;&#xA;&#xA;&lt;h1&gt;Now, here is the algorithm, you can follow:&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;1) Generate $n$ standard normal variate for $x$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Since, $e_i \sim N(0, 1-\rho^2)$. So generates $n$ normal variate as $e_i$ from normal distribution with mean 0 and variance $1-\rho^2$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Get $y=\rho x + e_i$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) Convert your standard normal numbers back to Normal (remember correlation is independent of change of origin and scale)&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;R code for simulating correlated GBM:&lt;/h1&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;corGBM &amp;lt;- function(n, r, t=1/365, plot=TRUE) {&#xA;#n is number of samples &#xA;#r is correlation&#xA;#t is tick step&#xA;x &amp;lt;- rnorm(n, mean=0, sd= 1)&#xA;se &amp;lt;- sqrt(1 - r^2) #standard deviation of error&#xA;e &amp;lt;- rnorm(n, mean=0, sd=se)&#xA;y &amp;lt;- r*x + e&#xA;&#xA;X &amp;lt;- cumsum(x* sqrt(t))&#xA;Y &amp;lt;- cumsum(y* sqrt(t))&#xA;Max &amp;lt;- max(c(X,Y))&#xA;Min &amp;lt;- min(c(X,Y))&#xA;&#xA;if(plot) {&#xA;plot(X, type=&quot;l&quot;, ylim=c(Min, Max))&#xA;lines(Y, col=&quot;blue&quot;)&#xA;}&#xA;return(cor(x,y))&#xA;}&#xA;&#xA;#sample result&#xA;corGBM(10000,.85)&#xA;[1] 0.8523341&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/uDPLo.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/uDPLo.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="16991" LastEditDate="2016-02-24T15:22:45.897" LastActivityDate="2016-02-24T15:22:45.897" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24481" PostTypeId="2" ParentId="24479" CreationDate="2016-02-23T17:23:58.397" Score="1" Body="&lt;p&gt;First consider if you really need to be connected to just the Nasdaq or should you be using a broker that can connect you to all exchanges.  Almost certainly the answer is the later.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that is the case then &lt;a href=&quot;https://www.interactivebrokers.com/en/home.php&quot; rel=&quot;nofollow&quot;&gt;Interactive Brokers&lt;/a&gt; is probably the way you want to go.  I've setup several &lt;a href=&quot;http://www.investopedia.com/terms/c/cta.asp&quot; rel=&quot;nofollow&quot;&gt;CTAs&lt;/a&gt; to get started with IB and its probably the best 3rd party to get setup with when you don't have the assets to get a big Sell side firm to look at you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you are huge then you can spend to setup a  full hedge fund structure and prime with one of the typical sell side firms:)&lt;/p&gt;&#xA;" OwnerUserId="743" LastActivityDate="2016-02-23T17:23:58.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24482" PostTypeId="2" ParentId="24470" CreationDate="2016-02-23T17:30:25.697" Score="3" Body="&lt;p&gt;The &lt;code&gt;rsgt&lt;/code&gt; is a skewed generalized t distribution, whereas your picture is a skewed student-t distribution. Try using &lt;code&gt;fGarch&lt;/code&gt; package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Plot reproduced:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(fGarch)&#xA;x&amp;lt;-seq(-2.5, +2.5, by=0.001)&#xA;plot(x,&#xA;     fGarch::dsstd(x, mean = 0, sd = 1, nu = 30, xi = 1 + 0.5),&#xA;     type = &quot;l&quot;,&#xA;     ylim=c(0, 2.4), lty = 1,&#xA;     xlab=&quot;z&quot;,&#xA;     ylab=expression(paste(&quot;g(z|&quot;,nu,&quot;,&quot;,lambda,&quot;)&quot;)),&#xA;     main=&quot;CONDITIONAL DENSITY ESTIMATION&quot;)&#xA;&#xA;lines(x,&#xA;      fGarch::dsstd(x, mean = 0, sd = 1, nu = 3.0, xi = 1 + 0.5),&#xA;      type = &quot;l&quot;,&#xA;      ylim=c(0, 2.4),&#xA;      lty = 2)&#xA;&#xA;lines(x,&#xA;      fGarch::dsstd(x, mean = 0, sd = 1, nu = 2.1, xi = 1 + 0.5),&#xA;      type = &quot;l&quot;,&#xA;      ylim=c(0, 2.4),&#xA;      lty = 5)&#xA;&#xA;legend(x=&quot;topleft&quot;, legend = c(expression(paste(eta,&quot;=2.1&quot;)),&#xA;                               expression(paste(eta,&quot;=3.0&quot;)),&#xA;                               expression(paste(eta,&quot;=30&quot;))),&#xA;       lty=c(5,2,1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/kN4OR.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/kN4OR.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18030" LastActivityDate="2016-02-23T17:30:25.697" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24483" PostTypeId="2" ParentId="24477" CreationDate="2016-02-23T17:34:33.620" Score="0" Body="&lt;p&gt;It is hard to digest how you arrive at your result. @Gordon has already provided the answer in risk neutral framework. So Here is answer in real world probabilities because you are interested in expected  price and variance of stock price, not of any derivative contract.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume $S_t$ is stochastic process and follow geometric Brownian motion with following SDE: &#xA;$$dS_t=\mu S_t dt + \sigma S_t dW_t$$&#xA;then $S_T$ follows lognormal distribution, such that: &#xA;$$S_T|S_t \sim logN\left(lnS_t+ (\mu - \frac{\sigma^2}{2})(T-t), \quad \sigma^2(T-t)\right)$$&#xA;So, $$\mathbb{E}[S_T|S_t]=S_te^{\mu (T-t)},$$&#xA;and &#xA;$$Var[S_T|S_t]=S_t^2 e^{2\mu (T-t)}[e^{\sigma^2(T-t)} -1]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case of dividend, just subtract dividend rate ($q$) from $\mu$.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Here we used the fact that for log normally distributed random&#xA;  variable $X$, such that $X \sim logN(\mu, \sigma^2)$, the mean and&#xA;  variance is given by:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;\begin{align}    \mathbb{E}[X] &amp;amp;= e^{\mu + \tfrac{1}{2}\sigma^2}, \\  &#xA;\operatorname{Var}[X] &amp;amp;= (e^{\sigma^2} - 1) e^{2\mu + \sigma^2}\\ &amp;amp;=&#xA; (e^{\sigma^2} - 1)(\mathbb{E}[X])^2     \end{align}&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2016-02-23T17:34:33.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24484" PostTypeId="2" ParentId="24462" CreationDate="2016-02-23T18:03:04.420" Score="3" Body="&lt;p&gt;You are absolutely right that no one would like to replicate return of risk free assets when such instrument is easily available in the market and can be bought directly. So, &lt;em&gt;why financial managers put their time and energy in creating such risk free portfolio&lt;/em&gt;? &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The application of creating risk free portfolio is mostly used in pricing derivative securities. This is done to ensure that model price does not provide arbitrage opportunities. This concept emerge from the fact that if a portfolio consists of 2 risky securities but risk of the portfolio is zero, then it must provide risk free return (irrespective of composition of portfolio). This is base on the premise that you can always buy the cheaper  assets (or portfolio) and sell the overpriced portfolio (or assets). &lt;/li&gt;&#xA;&lt;li&gt;Just think of a situation when investors face &lt;a href=&quot;http://www.stat.ucla.edu/~nchristo/statistics_c183_c283/black_1972_article.pdf&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;restrictions on borrowing&lt;/strong&gt;&lt;/a&gt;. In such scenario, &lt;strong&gt;zero-beta portfolio&lt;/strong&gt; come at handy. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2016-02-23T18:03:04.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24485" PostTypeId="1" AcceptedAnswerId="24496" CreationDate="2016-02-23T20:38:40.343" Score="1" ViewCount="941" Body="&lt;p&gt;I already asked this yesterday at &quot;Economics Stack Exchange&quot; but think this question might be better suited here. In the meantime i really tried to solve it by myself, but couldn't find anything what might help me. It's not just about the solutions, i do really want to understand how to solve problems like this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;I am currently studying for my upcomming exams. There is an exercise i can't solve or even understand properly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The full exercise is:&#xA;&quot;&lt;em&gt;You bought 100 shares of company A and 200 shares of company B. The shares of A are bid \$50 and ask \$60, while the shares of B are bid \$25 and ask \$35. The bid-ask spreads of both A and B are normally distributed with mean \$10 and standard deviation \$3.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Determine the distributions of the proportional bid-ask spreads for A and B.&lt;/strong&gt;&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I already got the proportional bid-ask-spread for A and B by the formula $s_{p}(X) = \frac{ASK - BID}{MEAN}$. Therefore $s_{p}(A) \approx 0.18$ and $s_{p}(B) \approx 0.33$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now i need to calculate the distributions of those spreads. (The actual aim of this exercise is to calculate the cost of liquidation in a stressed market.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not quite sure what is meant by &quot;distribution&quot;, so i assume it's the mean and standard deviation of those spreads. I just can't get my head around the standard deviation, since i need at least two values to calculate the standard deviation. (as far as i undersand) But i don't have more than one value for each spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do i have to solve this exercise? Like, is there a general way of doing it?&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE:&#xA;I need these results to calculate the &quot;cost of liquidation in a stressed market&quot;. I read that one needs to use the following formula for this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sum_{i=1}^{n} \frac{1}{2}(\mu_i + \lambda_i \sigma_i)\alpha_i$, where &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$n=2$, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mu_i = s_p(X_i)$, so in my case $\mu_1 = 0.18$ and $\mu_2 = 0.33$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\alpha_i = \text{volume } X_i$, in my case $\alpha_1 = 100$ and $\alpha_2 = 200$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\lambda_i = \text{confidence-level}$, like $\lambda_1 = \lambda_2 = 2.33$ for $99\%$ confidence-level&#xA;and finally &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma_i = \text{that &quot;distribution&quot; (standard-deviation?) value i can't calculate}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe this can describe my problem in more detail.&lt;/p&gt;&#xA;" OwnerUserId="19605" LastEditorUserId="16249" LastEditDate="2016-03-01T13:42:29.857" LastActivityDate="2016-03-01T13:42:29.857" Title="Distribution of proportional bid-ask-spreads" Tags="&lt;spread&gt;&lt;normal-distribution&gt;&lt;bid&gt;&lt;ask&gt;&lt;liquidity-risk&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24486" PostTypeId="1" CreationDate="2016-02-23T23:12:07.027" Score="1" ViewCount="91" Body="&lt;p&gt;Is there a standard model (or way of modelling) different types of mortgages and different interest rates to find the optimal mortgage structure for home loans?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g. a loan of $800k structure across 20, 25 or 30 years at varying interest rates&lt;/p&gt;&#xA;" OwnerUserId="19608" LastActivityDate="2016-02-23T23:12:07.027" Title="Is there a standard mortgage model available?" Tags="&lt;mbs&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24487" PostTypeId="1" CreationDate="2016-02-24T01:04:08.320" Score="6" ViewCount="2603" Body="&lt;p&gt;I tried to calibrate the data for hull-white one-factor model. Sometimes, I get negative estimate of mean reversion factor after the calibration process. When I plug the negative mean reversion factor into the hull-white one factor model, the interest rate tree cannot be generated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just wonder the theoretical consequence of hull-white one-factor model. Can anyone provide the meaning of negative mean reversion of hull-white one-factor model. If the mean reversion factor is negative, can the model be implemented properly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="6119" LastActivityDate="2016-05-31T12:44:52.270" Title="Consequence of negative mean reversion of hull white one factor model" Tags="&lt;interest-rates&gt;&lt;mean-reversion&gt;&lt;hullwhite&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24488" PostTypeId="1" AcceptedAnswerId="46036" CreationDate="2016-02-24T01:55:50.207" Score="3" ViewCount="694" Body="&lt;p&gt;I have heard that a Poisson process &quot;converges&quot; to an Ito (diffusion) process in long term. However I do not see how the characteristic function of the form morphs into that of the latter. In what measure could this convergence be defined at all?&lt;/p&gt;&#xA;" OwnerUserId="6686" LastEditorUserId="2587" LastEditDate="2016-02-24T07:06:57.927" LastActivityDate="2019-06-12T21:49:54.380" Title="Does a Poisson process converge to an Ito process in long term?" Tags="&lt;poisson&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24489" PostTypeId="2" ParentId="24488" CreationDate="2016-02-24T03:26:40.547" Score="1" Body="&lt;p&gt;If $X_t$ is a Poisson Counting Process with intensity $\lambda$ then the Martingale $M_t=X_t−\lambda t$ is called a Compensated Poisson Process. As $\lambda$ becomes large $M_t$ does converge to a Brownian motion with variance rate $\lambda$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be seen by using the &quot;heavy arrivals&quot; approximation of the Poisson Distribution: when the arrival rate is large the number of events per second is approximately Normal with mean $\lambda$ and variance $\lambda$, therefore the increase in the compensated process per second is N(0,λ). &lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2016-02-24T03:26:40.547" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24491" PostTypeId="1" CreationDate="2016-02-24T10:29:03.830" Score="2" ViewCount="301" Body="&lt;p&gt;I am wondering if Vector Autoregression (and other autoregressive models) is a sound modelling for the daily (not high-frequency!) log-returns of time series from liquid financial markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One can find through google scholar or in many books on &lt;a href=&quot;http://faculty.chicagobooth.edu/ruey.tsay/research/paper/ftsbk.pdf&quot; rel=&quot;nofollow&quot;&gt;financial time series analysis&lt;/a&gt; this kind of approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, partly from my practitioner experience, I am dubious about the relevance of such modelling.&#xA;One can also read in &lt;a href=&quot;http://personal.fmipa.itb.ac.id/khreshna/files/2011/02/cont2001.pdf&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;Empirical properties of asset returns: stylized facts and statistical issues&lt;/em&gt;&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Mandelbrot [85]&#xA;  expressed this property by stating that ‘arbitrage tends to&#xA;  whiten the spectrum of price changes’. This property implies&#xA;  that traditional tools of signal processing which are based on&#xA;  second-order properties, in the time domain—autocovariance&#xA;  analysis, ARMA modelling—or in the spectral domain—&#xA;  Fourier analysis, linear filtering—cannot distinguish between&#xA;  asset returns and white noise. This points out the need for&#xA;  nonlinear measures of dependence in order to characterize the&#xA;  dependence properties of asset returns.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I am thus looking for personal experience of (un)success with such autoregressive modelling, and authoritative paper with in-depth experimental analysis on real market data.&lt;/p&gt;&#xA;" OwnerUserId="16457" LastActivityDate="2016-02-24T10:29:03.830" Title="VAR models for log-returns?" Tags="&lt;time-series&gt;&lt;returns&gt;&lt;modeling&gt;&lt;auto-correlation&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24492" PostTypeId="2" ParentId="24488" CreationDate="2016-02-24T10:39:06.933" Score="0" Body="&lt;p&gt;It is straightforward to show a weaker result:  That a Poisson process becomes normally distributed as $T$ becomes large.  A Poisson process has independent increments.  Let $X_T-X_0$ be Poisson process.  Take an arbitrary time step $\Delta t$.  Then $X_T-X_0=\sum \left(X_{(i+1)\Delta t}-X_{i\Delta t}\right)$.  By the Central Limit Theorem, the sum of IID random variables drawn from a distribution with finite variance converges to a normal random variable as the number of terms approaches infinity.  Hence as $T \to \infty$, $X_T-X_0 \to \mathcal{N}(\cdot, \cdot)$.&lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2016-02-24T10:39:06.933" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24493" PostTypeId="2" ParentId="15830" CreationDate="2016-02-24T12:33:16.043" Score="3" Body="&lt;p&gt;You can also try &lt;a href=&quot;https://github.com/quantopian/zipline&quot; rel=&quot;nofollow&quot;&gt;Zipline&lt;/a&gt;, it's the library used in &lt;a href=&quot;https://www.quantopian.com/&quot; rel=&quot;nofollow&quot;&gt;Quantopian&lt;/a&gt; platform. It is opensource and written in python, you can use your own .csv data or built-in yahoo finance data feed. You can of course use any python library you want with it.&lt;/p&gt;&#xA;" OwnerUserId="19615" LastActivityDate="2016-02-24T12:33:16.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24494" PostTypeId="1" CreationDate="2016-02-24T15:20:30.820" Score="2" ViewCount="926" Body="&lt;p&gt;HJM describes the behavior of instantaneous forward rates while BGM describes the behavior of forward Libor rates. From concept perspective, I understand forward libor rate are like forward Libor rate with different tenor, e.g 3M. They are directly tradable in the market with quotes? But what is the instantenous forward rates? &lt;/p&gt;&#xA;" OwnerUserId="18503" LastActivityDate="2016-02-24T16:24:34.180" Title="instantaneous forward rates vs forward LIBOR rates" Tags="&lt;lmm&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24495" PostTypeId="2" ParentId="24494" CreationDate="2016-02-24T16:24:34.180" Score="3" Body="&lt;p&gt;The forward Libor rate at time $t$ is the forward rate over a certain accrual period $[T, T+\Delta]$, where $\Delta$, in years, can be 3 months or 6 months, and is defined by&#xA;\begin{align*}&#xA;L(t, T, T+\Delta) = \frac{1}{\Delta}\left(\frac{P(t, T)}{P(t, T+\Delta)}-1 \right),&#xA;\end{align*}&#xA;where $P(t, u)$ is the price at time $t$ of a zero coupon bond with unit face value and maturity $u$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The instantaneous forward rate is the forward Libor rate over an infinitesimal accrual period. That is,&#xA;\begin{align*}&#xA;f(t, T) &amp;amp;=\lim_{\Delta\rightarrow 0}L(t, T, T+\Delta)\\&#xA;&amp;amp;=\lim_{\Delta\rightarrow 0}\frac{P(t, T) - P(t, T+\Delta)}{\Delta}\frac{1}{P(t, T+\Delta)}\\&#xA;&amp;amp;=-\frac{\partial P(t, T)}{\partial T}\frac{1}{P(t, T)}\\&#xA;&amp;amp;=-\frac{\partial }{\partial T}\ln P(t, T).&#xA;\end{align*} &lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-02-24T16:24:34.180" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24496" PostTypeId="2" ParentId="24485" CreationDate="2016-02-24T17:08:01.373" Score="0" Body="&lt;p&gt;&lt;strong&gt;You can not derive the distribution of proportional spread with the information given in your question.&lt;/strong&gt; You have given $S_p{(A)}$ and $S_p (B)$. By assuming equal probabilities for both, you can simply calculate standard deviation of proportional spread as: &#xA;$$Var(S_p)=E[(S_p-\mu)^2]$$&#xA;So, $\mu = 0.5*0.18 + .5*.33 = 0.255$, and &#xA;$$Var(S_p)=.5(0.18-.255)^2 + 0.5(.33-.255)^2=0.005625$$&#xA;$$\sigma=\sqrt{Var(S_p)}=0.075$$&lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2016-02-24T17:08:01.373" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24497" PostTypeId="1" CreationDate="2016-02-24T17:41:19.147" Score="1" ViewCount="1384" Body="&lt;p&gt;If $\rho_{12} &amp;lt; 1$ or $\sigma_1 \not= \sigma_2$ then $\sigma_v^2$ representing the variance of the portfolio with weights $(w_1, w_2) = (s, 1-s)$ as a function of $s$ attains its minimum value at: &#xA;$$&#xA;s_0 = \frac{\sigma_2^2 - \sigma_1\sigma_2\rho_{12}}{\sigma_1^2+\sigma_2^2-2\sigma_1\sigma_2\rho_{12}}&#xA;$$&#xA;Under which conditions on $\sigma_1$, $\sigma_2$, and $\rho_{12}$ does the minimum variance portfolio involve no short selling? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\rho$ is correlation coefficient and $\sigma$ is standard deviation. Squared is variance. &#xA;I'm not sure what this question means. &lt;/p&gt;&#xA;" OwnerUserId="17063" LastActivityDate="2017-02-26T21:50:56.703" Title="Under which conditions the minimum variance portfolio involves no short selling?" Tags="&lt;portfolio-management&gt;&lt;portfolio&gt;&lt;short-selling&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24499" PostTypeId="2" ParentId="22229" CreationDate="2016-02-24T18:03:17.387" Score="1" Body="&lt;p&gt;Let's first make your problem more rigorous. Suppose, $F_t$ is the future price of underlying security $S_t$, maturing at time $T$. Now you need to prove that, &#xA;$$\mathbb{E}(F_\tau)=F_t, \quad \forall \tau \in [t, T]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By using no arbitrage principle (creating replicating portfolio), it can be easily prove that: &#xA;$$F_t = S_t e^{r(T-t)}=\mathbb{E}_\mathbb{Q}[S_T|S_t]$$&#xA;where, $\mathbb{Q}$ represent risk neutral measure. We can write, future price at time $\tau \in [t,T]$ as, &#xA;$$F_\tau=S_\tau e^{r(T-\tau)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above future price $F_\tau$ represents actual future price at time $\tau$. We want expression for $\mathbb{E}(F_\tau|\mathscr{F}_t)$. Just take expectation on both side in the last equation assuming we are still at time $t$, so both $F_\tau$ and $S_\tau$ is random variable. We have; &#xA;\begin{align}&#xA;\mathbb{E}(F_\tau)&amp;amp;=e^{r(T-\tau)}\mathbb{E}_\mathbb{Q}(S_\tau)\\&#xA;&amp;amp;=e^{r(T-\tau)}S_te^{r(\tau -t)}\\&#xA;&amp;amp;=S_te^{r(T-t)}\\&#xA;&amp;amp;=F_t&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;NB: $\mathbb{E}(F_\tau)$ is conditional on the filtration upto time&#xA;  $t$. It must be written as $\mathbb{E}(F_\tau|\mathscr{F}_t)$, instead&#xA;  of $\mathbb{E}(F_\tau)$.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="16991" LastEditDate="2016-02-25T18:11:16.697" LastActivityDate="2016-02-25T18:11:16.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24500" PostTypeId="1" CreationDate="2016-02-24T18:08:21.260" Score="2" ViewCount="628" Body="&lt;p&gt;I'm doing intraday analysis on low volume stocks. There are just a few trades every day, but a whole host of bids and offers. In order to reduce the sparsity of the time series data I'd like to incorporate the trade, bid and offer price into a single price which I will apply standard time series analysis on. What are some good ways of doing this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've time segmented the measures into the standard open, high, low, close price measures. As a first approach I'm going to do analysis only on closing values from each time segment, meaning the last measured value for each measure. Thus I have &lt;code&gt;close_bid&lt;/code&gt;, &lt;code&gt;close_offer&lt;/code&gt; and &lt;code&gt;close_trade&lt;/code&gt;. I'm going to omit the &lt;code&gt;close_&lt;/code&gt; part from now on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Due to the sparsity any of the prices can be missing (or &lt;code&gt;None&lt;/code&gt; is python speak).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following (in Python code) is kind of what I'm thinking of doing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def segment_and_merge_price_tics(price_tics, granularity)&#xA;    previous_price = None&#xA;    for t, bid, offer, trade in segment_price_tics(price_tics, granularity):&#xA;        if trade is not None:&#xA;            yield t, trade&#xA;        elif (trade is not None) and (bid is not None):&#xA;            yield t, (bid + offer)/2&#xA;        else:&#xA;            yield t, previous_price&#xA;        previous_price = price&#xA;&#xA;def segment_price_tics(price_tics, granularity):&#xA;    # yields t, bid, offer and trade segmented based on granularity&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In words: I am suggesting to simply use the average of the closing &lt;code&gt;bid&lt;/code&gt; and &lt;code&gt;offer&lt;/code&gt; price at time &lt;code&gt;t&lt;/code&gt; when there were no trades. I also give preference to actual trades versus bids and offers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What other strategies are there? I also have access to the depth of the bids and offers. Meaning I know how many give the lowest offer and highest bid for each tic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another thing that just occurred to me is that I might want to give preference to latest close price, not categorically the trade price. What if a trade comes in early in the time segment, is it really right to give it preference if there came bid and ask prices in just at the end of the time segment?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any thoughts are welcomed.&lt;/p&gt;&#xA;" OwnerUserId="2792" LastActivityDate="2016-03-25T21:31:31.430" Title="Strategies to merge bid, offer and trade price time series into a single price time series?" Tags="&lt;time-series&gt;&lt;programming&gt;&lt;python&gt;&lt;price&gt;&lt;time&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24501" PostTypeId="1" CreationDate="2016-02-24T18:42:11.663" Score="1" ViewCount="103" Body="&lt;p&gt;In my case non-overlapping data would represent the scenario where futures prices (3 months) do not correspond to the futures spot prices in terms of delivery date. For example, futures settlement price (with 3 months delivery) on 01/01/2016 would represent the futures spot price on 01/04/2016 or should I just make 84 days horizon? Since various months consistent of different amount of days. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Chowdhury, A. R. (1991), Futures market efficiency: Evidence from cointegration tests. J. Fut. Mark., 11: 577–589. doi: 10.1002/fut.3990110506&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to replicate this study, btw. So how exactly I should work out non-overlapping data?&lt;/p&gt;&#xA;" OwnerUserId="19621" LastActivityDate="2016-02-24T18:42:11.663" Title="Problem with overlapping data when testing futures market efficiency" Tags="&lt;time-series&gt;&lt;data&gt;&lt;futures&gt;&lt;cointegration&gt;&lt;market-efficiency&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24503" PostTypeId="2" ParentId="15986" CreationDate="2016-02-24T19:02:54.167" Score="14" Body="&lt;p&gt;Risk-neutral default probability implied from CDS is approximately $P=1-e^\frac{-S * t}{1-R}$, where $S$ is the flat CDS spread and $R$ is the recovery rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The CDS Spread can be solved using the inverse:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S=\ln(1-P) \frac{R-1}{t}$$&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$S$ is the spread expressed in percentage terms (not basis points)&lt;/li&gt;&#xA;&lt;li&gt;$t$ are the years to maturity&lt;/li&gt;&#xA;&lt;li&gt;$R$ is the recovery rate in percentage terms&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Hulls equation is a gross simplification. This equation is not perfect, but is far more accurate and works for all tenor points. It generally works well except when approaching boundary conditions (distressed credits).&lt;/p&gt;&#xA;" OwnerUserId="19622" LastEditorUserId="467" LastEditDate="2016-12-29T02:09:57.853" LastActivityDate="2016-12-29T02:09:57.853" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24504" PostTypeId="2" ParentId="21610" CreationDate="2016-02-24T19:05:02.883" Score="1" Body="&lt;p&gt;Most software vendors use ATM implied volatility (usually interpolated to 30 days) which is how the old VIX index was calculated. AFAIK no vendor provides new VIX/MFIV as default - it is simply not as robust. &lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2016-02-24T19:05:02.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24505" PostTypeId="1" AcceptedAnswerId="24509" CreationDate="2016-02-24T19:45:47.537" Score="-3" ViewCount="130" Body="&lt;p&gt;Is there any good idea that combines low volatility, risk aversion level of investors and prediction of financial crash ?&#xA;Is there any literature? &lt;/p&gt;&#xA;" OwnerUserId="19623" LastActivityDate="2016-02-24T20:19:20.197" Title="Master thesis in Finance in search of topic concerning investor sentiment and financial crash" Tags="&lt;volatility&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24506" PostTypeId="1" CreationDate="2016-02-24T19:51:57.683" Score="-2" ViewCount="287" Body="&lt;p&gt;We are building a new system where latency is key.&#xA;Either commercial or opensource, our goal is to have an easy to implement fix engine where low latency is key.&lt;/p&gt;&#xA;" OwnerUserId="13990" LastActivityDate="2016-06-05T15:20:08.390" Title="FIX engine for very low latency" Tags="&lt;market-data&gt;&lt;market-making&gt;&lt;fix&gt;&lt;latency&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24508" PostTypeId="1" CreationDate="2016-02-24T20:14:13.480" Score="2" ViewCount="429" Body="&lt;p&gt;We market make in highly liquid, near term options markets.  I want to build a risk report that tells us how our portfolio's greeks will change as the underlying moves.  This is for risk management in the face of unusually large moves, such as 2, 5 and 10% moves in the underlying.  We are only trading vanilla options.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My starting vol curve takes IVs from the current market at every strike and lightly smooths them.  I want to 'shock' the underlying &amp;amp; the vol curve in several different directions.  Obviously, it is easy to shock vol up by 30% of current vol, but how do I predict how the curve moves when I shock the underlying up 5%? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given that I am modeling large moves, I'm leaning towards using the &quot;sticky delta&quot; approach where the options with a given delta keep their volatility.  &lt;/p&gt;&#xA;" OwnerUserId="77" LastActivityDate="2016-02-24T20:14:13.480" Title="Vol surface changes as underlying moves" Tags="&lt;implied-volatility&gt;&lt;risk-management&gt;&lt;volatility-smile&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24509" PostTypeId="2" ParentId="24505" CreationDate="2016-02-24T20:19:20.197" Score="2" Body="&lt;p&gt;The most applicable framework is Hyman Minsky's Financial Instability Hypothesis available as a paper at levyinstitute.org .  That author also has at least two excellent books on the subject. Briefly, stability is destabilizing because it encourages leverage that makes the system increasingly fragile.   &lt;/p&gt;&#xA;" OwnerUserId="19627" LastActivityDate="2016-02-24T20:19:20.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24510" PostTypeId="2" ParentId="24500" CreationDate="2016-02-24T21:06:01.000" Score="2" Body="&lt;p&gt;The average would be called the mid-price, not the best in my opinion, but that depends on your modeling.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another strategy is to weight the bid and offer prices according to size, also called the micro-price or bid-offer weighted price. This has the advantage of moving your calculated price closer to where it is traded as volume is depleted from whatever side is more traded if the book is not replenished.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;p_{micro} = p_{offer}*v_{bid} + p_{bid}*v_{offer} / (v_{bid}+v_{offer})&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="7544" LastActivityDate="2016-02-24T21:06:01.000" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24511" PostTypeId="1" CreationDate="2016-02-24T21:17:55.570" Score="2" ViewCount="492" Body="&lt;p&gt;I am using Option Metrics to study a couple of things related to options. &#xA;However, Option Metrics is quite limited in terms of scope (mainly it's US equities). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering two things:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Are there any options traded on the MSCI World?&#xA;2) If yes, then is there any database with data on MSCI World options, as well as options on all MSCI World Constituents?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2016-10-03T08:45:16.730" Title="Options Data Sources" Tags="&lt;options&gt;&lt;data&gt;&lt;database&gt;" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24512" PostTypeId="1" CreationDate="2016-02-24T21:39:11.777" Score="2" ViewCount="1728" Body="&lt;p&gt;Is there anyone who knows a good guide to get quantlib working for python om mac?&#xA;I have tried to search online and have not found any good guidance. I need to use quantlib for a project on python.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that there is no quantlib for python for mac available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="18211" LastActivityDate="2016-12-30T23:20:11.397" Title="Quantlib with python on mac?" Tags="&lt;python&gt;&lt;quantlib&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24513" PostTypeId="2" ParentId="8621" CreationDate="2016-02-24T23:11:21.223" Score="1" Body="&lt;p&gt;In Equity or FX, you are modelling the dynamic of a single number $S_t$ the stock price or fx spot rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In interest rate, you are modelling the dynamic of a curve $(f(t,t+\theta))$ all the forward rates (equivalently all the discount factors) for all tenors $\theta$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So mean reversion, in the context of rates should be mean reversion around a mean curve. This mean curve is the forward curve built from the prices of deposits, futures and swaps observed in the market. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the Vasiceck model the short rate mean reverts to a long term mean $r_\infty$. This means that you are mean reverting to a flat curve. But curves observed in the market are never flat and the model cannot even fit the forward curve observed at time 0. The Hull-White model improves on this by allowing you to fit the current expectation of the rates curve and mean revert to it. This requires replacing two of your parameters (the initial and long term short rates) by a whole curve (the initial forward curve which appears in the model in the form of the tenor dependent mean $\varphi(t)$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps&lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2016-02-24T23:11:21.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24514" PostTypeId="1" AcceptedAnswerId="24537" CreationDate="2016-02-25T00:22:22.723" Score="1" ViewCount="109" Body="&lt;p&gt;Background information:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Proposition 4.1 - For a European Markovian contingent claim, the Black-Scholes price satisfies $$\Theta(\tau,S) = -\frac{\sigma^2 S^2}{2}\Gamma(\tau,S) - rS\Delta(\tau,S) + rV(\tau,S)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Problem - Use Proposition 4.1, to show the above equality. That is let $\tilde{S}_t = e^{-rt}S_t$ and $\tilde{V}(t,\tilde{S}_t) = e^{-rt}V(t,S_t)$ be respectively the discounted underlying price and discounted option price. Then, we can show that $$\partial_t\tilde{V}(t,\tilde{S}) = -\frac{\sigma^2\tilde{S}^2}{2}\partial_{\tilde{S}\tilde{S}}V(t,\tilde{S})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am confused where to begin, I think I can manage showing this if I have a formula or just a set up to work from, any suggestions is greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="19002" LastActivityDate="2016-02-25T21:05:05.510" Title="Black-Scholes and Markovian contingent claim" Tags="&lt;options&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24515" PostTypeId="2" ParentId="24512" CreationDate="2016-02-25T00:28:37.133" Score="0" Body="&lt;p&gt;I believe &lt;a href=&quot;https://github.com/enthought/pyql&quot; rel=&quot;nofollow&quot;&gt;Enthought&lt;/a&gt; has Python wrappers that are limited in scope.&#xA;Ensure you have QuantLib and its dependencies installed:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;git clone https://github.com/enthought/pyql.git&#xA;cd pyql&#xA;python setup.py build&#xA;python setup.py test&#xA;python setup.py install&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Otherwise, the canonical way is to use the &lt;a href=&quot;http://quantlib.referata.com/wiki/Python_QuantLib_tutorial&quot; rel=&quot;nofollow&quot;&gt;SWIG bindings&lt;/a&gt; &lt;a href=&quot;http://www.swig.org/Doc3.0/Preface.html#Preface_osx_installation&quot; rel=&quot;nofollow&quot;&gt;for OS X&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2016-02-25T00:28:37.133" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24516" PostTypeId="1" AcceptedAnswerId="24539" CreationDate="2016-02-25T03:11:02.817" Score="0" ViewCount="64" Body="&lt;p&gt;Background information:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe we can use Jensen's Inequality &lt;a href=&quot;http://mathworld.wolfram.com/JensensInequality.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Show that if the payoff function $V(S_T)$ is a convex function on $S_T$, then the Markovian European contingent claim with payoff $V(S_T)$ has non-negative $\Gamma$, i.e. $V(\tau,S)$ is convex on $S$ for all $\tau$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Attempted proof: Suppose we have a function $V(S_T)$ that is convex on $S_T$, then if $p_1,\ldots,p_n$ are positive numbers that sum to 1, then $$V\left(\sum_{i=1}^{T}p_i S_i\right) \leq \sum_{i=1}^{T}p_i V(S_i)$$ Now, let $p_i = 1/n$, then $\ln S$ gives, $$\ln\left(\frac{1}{T}\sum_{i=1}^{T} S_i\right) \geq \frac{1}{T}\sum_{i=1}^{T}\ln S_i$$ Through exponentiation we have the arithmetic mean-geometric mean inequality, $$\frac{S_1 + S_2 +\ldots + S_T}{T} \geq \sqrt[T]{S_1 S_2,\ldots S_T}$$ Which is non-negative, thus the result follows.&lt;/p&gt;&#xA;" OwnerUserId="19002" LastActivityDate="2016-02-25T21:34:08.170" Title="Convexity in Markovian contingent claim" Tags="&lt;mathematics&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24518" PostTypeId="1" AcceptedAnswerId="24582" CreationDate="2016-02-25T06:25:08.067" Score="1" ViewCount="376" Body="&lt;p&gt;I read about hedging with options and think i got it. However there is a case  am not sure how to handle.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any exception in the delta-gamma-hedging-(calculaton-)technique? - say: solve an set of equations to get the needed stock -and options-amount.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All examples i have seen so far were using options with the same maturity. Will the procedure change if i consider using options with different maturity dates? &lt;/p&gt;&#xA;" OwnerUserId="19605" LastActivityDate="2016-02-27T01:22:57.547" Title="Effect of different maturity options in delta-gamma-hedging" Tags="&lt;options&gt;&lt;portfolio-optimization&gt;&lt;hedging&gt;&lt;option-strategies&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24519" PostTypeId="1" CreationDate="2016-02-25T08:44:02.520" Score="1" ViewCount="680" Body="&lt;p&gt;What is a best-practice example on how to model callable bonds in a risk model - I focus on historical simulation (HS).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For plain-vanilla bonds the input factors for historical simulation could be&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the zero curve of the market (the currency)&lt;/li&gt;&#xA;&lt;li&gt;spread history &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Then HS would model changes in interst rates of the currency (as systematic risk) and spreads either in issuer level (idiosyncratic) or rating level (rather systematic risk). Then we could reprice the bond in these scenarios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at callable bonds on the other hand we have to simulate/estimate the chance that the bond is called and when. To do this we could use an interest rate model which we would have to calibrate on future interest rate uncertainty. Then we can simulate the future and price the bond in these scenarios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Market data that reflect this that I know are swaptions and captions.&#xA;But these are instruments for the money market/capital market of a currency. However, the decisin of the issuer to call the bonds will depend on the interest rate level of the currency &lt;strong&gt;and&lt;/strong&gt; the issuers spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can we find a risk model that can be calibrated to readily available market data &lt;strong&gt;and&lt;/strong&gt; that models the systematic as well as the idiosyncratic part of the call risk? How do industry solutions look like?&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-02-25T17:33:26.953" Title="Modelling callable bonds in a risk model (historical simulation)" Tags="&lt;fixed-income&gt;&lt;risk-models&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24520" PostTypeId="2" ParentId="24512" CreationDate="2016-02-25T09:22:42.833" Score="4" Body="&lt;p&gt;The installation process should be the same as on Linux.  Once you have the C++ QuantLib library installed (instructions for that are on the QuantLib site, at &lt;a href=&quot;http://quantlib.org/install/macosx.shtml&quot; rel=&quot;nofollow&quot;&gt;http://quantlib.org/install/macosx.shtml&lt;/a&gt;) you can download the latest QuantLib-SWIG release, uncompress it and run:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;./configure&#xA;make -C Python&#xA;sudo make -C Python install&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that the above work with a &lt;em&gt;release&lt;/em&gt; (as in, the files you get from &lt;a href=&quot;https://sourceforge.net/projects/quantlib/files/&quot; rel=&quot;nofollow&quot;&gt;https://sourceforge.net/projects/quantlib/files/&lt;/a&gt;) and contrary to popular belief, don't require you to have SWIG installed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, if you want to work from a checkout of the git repository (either because you want to modify the interfaces, or because you want a new feature which is not yet available in a release) you'll need SWIG&amp;mdash;but not a separate command, as &lt;code&gt;make&lt;/code&gt; takes care of it&amp;mdash;and you'll also need to run&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;./autogen.sh&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;before the other commands; this will require automake and autoconf to be installed. (End of note.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two or three caveats I can think of.  The first is that the &lt;code&gt;./configure&lt;/code&gt; step will need to invoke &lt;code&gt;quantlib-config&lt;/code&gt; to find out what flags should be passed to the compiler and linker (they will also include the additional include directories you might have specified when you built QuantLib, so you'll be covered even if you have, say, Boost in a non-standard place).&#xA;This means that &lt;code&gt;quantlib-config&lt;/code&gt; must be in your path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second is that, unfortunately, at this time &lt;code&gt;make&lt;/code&gt; ignores any prefix you might pass to &lt;code&gt;./configure&lt;/code&gt; and always installs to the default location, which requires you to use &lt;code&gt;sudo&lt;/code&gt; as I wrote above. If you don't have admin rights, you'll have to look into the Makefile and pass your prefix to &lt;code&gt;setup.py&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The third is that you'll need the Python development files (&lt;code&gt;python.h&lt;/code&gt; and so on). They might be available by default (and if they are, &lt;code&gt;make&lt;/code&gt; calls &lt;code&gt;setup.py&lt;/code&gt; which should find them for you); but if not, you'll have to figure out how to get them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, if you use Docker, you can pull an Ubuntu image with an installation of quantlib-python from &lt;a href=&quot;https://hub.docker.com/r/lballabio/quantlib-python/&quot; rel=&quot;nofollow&quot;&gt;https://hub.docker.com/r/lballabio/quantlib-python/&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2016-02-25T09:22:42.833" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="24521" PostTypeId="2" ParentId="24519" CreationDate="2016-02-25T10:18:29.810" Score="1" Body="&lt;p&gt;Callable bond, will be exposed to interest rates, and spreads, and your interest rate model. You can also link your spreads to interest rates, but then you will need a systematic spread model. In most pricing models, that I have seen spreads are not evolving through time (which is not correct). The problem is you don't have any market instrument to calibrate the evolution of spreads in a risk neutral manner, and pricing is done in risk neutral world. For rates, rate evolution is calibrated are on other instruments like swaptions or futures, which are market instruments, thus rate evolution model can be made risk neutral. &lt;/p&gt;&#xA;" OwnerUserId="1215" LastActivityDate="2016-02-25T10:18:29.810" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24522" PostTypeId="2" ParentId="24514" CreationDate="2016-02-25T12:25:50.943" Score="0" Body="&lt;p&gt;A good place to start is to calculate the $\Delta$ for your option $\tilde{V}$.&#xA;Once you calc your delta, plug it back into the black scholes PDE. Now check which terms cancel each other out. After you remove the terms that cancel each other out you have the desired result.&lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2016-02-25T12:25:50.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24523" PostTypeId="1" CreationDate="2016-02-25T13:54:03.503" Score="0" ViewCount="2638" Body="&lt;p&gt;I just wrote two functions in Matlab which calculates the swaption prices based on the Lognormal model and on the Normal model, although I have the idea that the Normal model is wrong because the swaption price is (I think) too high.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hereby the Lognormal function in Matlab:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; function [Receiver, Payer] = BlackSwaptionModel(K,S,Bvol,Time,Reonia,TenorSwap)&#xA;        d1 = (log(S/K) + 1/2*Bvol^2*Time) / (Bvol*sqrt(Time));&#xA;        d2 = d1 - (Bvol * sqrt(Time));&#xA;&#xA;        Receiver = ((1-1/(1+S)^(TenorSwap)) / S) * exp(-Reonia*Time) * (S*normcdf(d1) - K*normcdf(d2)); %Value receiver swaption Black Model&#xA;        Payer = ((1-1/(1+S)^(TenorSwap)) / S) * exp(-Reonia*Time) * (K*normcdf(-d2) - S*normcdf(-d1)); % Value payer swaption Black Model&#xA;      end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Plus the Normal model function in Matlab:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function [Receiver, Payer] = NormalSwaptionModel(K,S,Nvol,Time,Reonia,TenorSwap)&#xA;&#xA;    d1 = (S-K) / (Nvol * sqrt(Time));&#xA;    d2 = -(S-K) / (Nvol * sqrt(Time));&#xA;&#xA;    Receiver = Nvol * sqrt(Time) * (d1*normcdf(d1) + normpdf(d1)) * ((1-1/(1+S)^(TenorSwap)) / S) * exp(-Reonia*Time);&#xA;&#xA;    Payer = Nvol * sqrt(Time) * (d2*normcdf(d2) + normpdf(d2)) * ((1-1/(1+S)^(TenorSwap)) / S) * exp(-Reonia*Time);&#xA;&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Could anybody see what's going wrong here. Thanks. &lt;/p&gt;&#xA;" OwnerUserId="16788" LastEditorUserId="2587" LastEditDate="2017-02-17T08:57:29.013" LastActivityDate="2017-02-17T08:57:29.013" Title="Normal Black-Scholes model for swaptions isn't working properly" Tags="&lt;black-scholes&gt;&lt;fixed-income&gt;&lt;normal-distribution&gt;&lt;swaption&gt;&lt;lognormal&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24524" PostTypeId="1" AcceptedAnswerId="24532" CreationDate="2016-02-25T14:09:19.770" Score="0" ViewCount="58" Body="&lt;p&gt;Suppose that I buy a call option at \$10 for a stock $S_0 = \$100$, $K = \$110$, expiry date $T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In $T$, $S_T = \$140$, so that I exercise the option to buy and then sell the assets (buy at $\$110$ and sell at $\$140$), thus obtaining a net profit equal to $\$140 - \$110 - \$10 = \$20$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, can I just directly take the profit or do I have to buy (at $\$110$) and then sell?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, do I need the $\$110$ to obtain the $\$20$ profit? Or to directly take the profit should I buy a call option on the future of the asset (and thus exercise the call and then sell the future on the asset)?&lt;/p&gt;&#xA;" OwnerUserId="19515" LastActivityDate="2016-02-25T17:56:03.100" Title="buy asset after exercising call options" Tags="&lt;options&gt;&lt;call&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24525" PostTypeId="2" ParentId="24524" CreationDate="2016-02-25T14:17:43.183" Score="1" Body="&lt;p&gt;You can start by shorting the stock at \$140, you get paid \$140. Then with that \$140 you pay the strike \$110, you get the share and you have a long position and a short position on a stock (which cancel out).&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2016-02-25T14:17:43.183" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24526" PostTypeId="2" ParentId="24512" CreationDate="2016-02-25T14:28:39.690" Score="1" Body="&lt;p&gt;Probably the easiest way to get it is through MacPorts, which will take care of the Python dependencies, et cetera, for you.  If you have not already done so, you can get started with MacPorts using &lt;a href=&quot;http://www.macports.org/install.php&quot; rel=&quot;nofollow&quot;&gt;these instructions&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After MacPorts is installed, you can simply invoke&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sudo port install QuantLib&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which pretty much just follows the &lt;a href=&quot;http://quantlib.org/install/macosx.shtml&quot; rel=&quot;nofollow&quot;&gt;official recommendations&lt;/a&gt; from the QuantLib people with the &lt;a href=&quot;https://trac.macports.org/browser/trunk/dports/finance/QuantLib/Portfile&quot; rel=&quot;nofollow&quot;&gt;right library pointers&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2016-02-25T14:28:39.690" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24528" PostTypeId="2" ParentId="24524" CreationDate="2016-02-25T14:55:31.847" Score="2" Body="&lt;p&gt;Usually the need to pay 110 in order to receive a stock worth 140 is not an obstacle in this kind of operation. There are some clever ways to get around it, as volcompt said. Or you can just borrow 110 against collateral for a few hours from your broker or from a friend and reimburse them immediately. So I wouldn't worry about it, it is a non issue.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-02-25T16:47:44.373" LastActivityDate="2016-02-25T16:47:44.373" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24529" PostTypeId="1" CreationDate="2016-02-25T17:24:23.067" Score="1" ViewCount="73" Body="&lt;p&gt;Sorry if this seems stupid. I was wondering what the difference between a group and inequality constraint is in Matlab. As far as I can tell they are the same:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From Matlab (&lt;a href=&quot;http://uk.mathworks.com/help/finance/setgroups.html&quot; rel=&quot;nofollow&quot;&gt;http://uk.mathworks.com/help/finance/setgroups.html&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Set Group Constraints for a Portfolio Object&#xA;Suppose you have a portfolio of five assets and you want to ensure that the first three assets constitute at most 30% of your portfolio. Given a Portfolio object p, set the group constraints with the following.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;G = [ true true true false false ];&#xA;p = Portfolio;&#xA;p = setGroups(p, G, [], 0.3);&lt;/p&gt;&#xA;&#xA;&lt;p&gt;disp(p.NumAssets);&#xA;disp(p.GroupMatrix);&#xA;disp(p.UpperGroup);&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; 5&#xA;&#xA; 1     1     1     0     0&#xA;&#xA;0.3000&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also from Matlab (&lt;a href=&quot;http://uk.mathworks.com/help/finance/setinequality.html&quot; rel=&quot;nofollow&quot;&gt;http://uk.mathworks.com/help/finance/setinequality.html&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Set Linear Inequality Constraints for a Portfolio Object&#xA;Suppose you have a portfolio of five assets and you want to ensure that the first three assets are no more than 50% of your portfolio. Given a Portfolio object p, set the linear inequality constraints with the following.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A = [ 1 1 1 0 0 ];&#xA;b = 0.5;&#xA;p = Portfolio;&#xA;p = setInequality(p, A, b);&lt;/p&gt;&#xA;&#xA;&lt;p&gt;disp(p.NumAssets);&#xA;disp(p.AInequality);&#xA;disp(p.bInequality);&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; 5&#xA;&#xA; 1     1     1     0     0&#xA;&#xA;0.5000&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Am I misunderstanding something here?&lt;/p&gt;&#xA;" OwnerUserId="19640" LastActivityDate="2016-02-26T20:52:58.177" Title="What is the difference between group and inequality constraints in Matlab?" Tags="&lt;portfolio-management&gt;&lt;portfolio&gt;&lt;matlab&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24530" PostTypeId="2" ParentId="24519" CreationDate="2016-02-25T17:33:26.953" Score="0" Body="&lt;p&gt;It says I have to have 50 reputations points to comment, and I don't, and actually don't even know what that means so here is my &quot;Answer.&quot;  I think you're getting into apples and oranges.  There is no risk neutral anything here.  For historical simulation, you already have all of the rates to apply to your prospective cash flows, and in your simulation you have the amounts and dates of those cash flows from the bond description.  Fine.  Now the only addition is to add a decision function that terminates the cash flows to principal plus call spread if the bond qualifies under certain conditions:  price justifies call and call date is far enough in the future to justify being triggered, etc.  You are making this way more difficult than it should be. &lt;/p&gt;&#xA;" OwnerUserId="19627" LastActivityDate="2016-02-25T17:33:26.953" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24531" PostTypeId="1" CreationDate="2016-02-25T17:36:09.560" Score="1" ViewCount="124" Body="&lt;p&gt;I was trying to price options with the extendedBinomialTree class of quantlib. I actually tried at some point to modify this class in order to optimize it. Normally the drift and diffusion of the underlying asset are changing but i want to add new data members so that i won't have to compute them between two times if they remain constant between them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance for your answers ! &lt;/p&gt;&#xA;" OwnerUserId="19641" LastEditorUserId="16991" LastEditDate="2016-02-25T18:14:11.677" LastActivityDate="2016-02-25T18:14:11.677" Title="Quantlib binomial tree" Tags="&lt;quantlib&gt;&lt;binomial-tree&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24532" PostTypeId="2" ParentId="24524" CreationDate="2016-02-25T17:56:03.100" Score="2" Body="&lt;p&gt;I would just sell the option (assuming there is sufficient liquidity). As @noob2 correctly states there will be transaction costs but there is no way around that. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If both the option and the underlying are not liquid you might have a problem as there may be insufficient demand for either the option or the stock. In such a case it might be good to talk to a bank to see what's possible. Maybe you can buy the stock, create a hedge and borrow money with your position as a collateral to get cash and slowly decrease the long stock position.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2016-02-25T17:56:03.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24533" PostTypeId="1" CreationDate="2016-02-25T18:09:30.383" Score="1" ViewCount="47" Body="&lt;p&gt;I am at the beginning of writing a back testing engine and wanted to get some Feed back on considerations I should take into account , design ideas etc. &lt;/p&gt;&#xA;" OwnerUserId="19643" LastActivityDate="2016-02-25T18:09:30.383" Title="Considerations when programming back testing engine" Tags="&lt;testing&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24534" PostTypeId="2" ParentId="17053" CreationDate="2016-02-25T19:29:33.960" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;How can I change this to implement FULL ARCH and GARCH parameter matrices, to capture the spillover effects?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You cannot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The original paper by &lt;a href=&quot;http://www.tandfonline.com/doi/abs/10.1198/073500102288618487&quot; rel=&quot;nofollow&quot;&gt;Engle (2002)&lt;/a&gt; as well as the &lt;a href=&quot;http://www.stata.com/manuals13/tsmgarchdcc.pdf&quot; rel=&quot;nofollow&quot;&gt;Stata manual&lt;/a&gt; for the DCC-GARCH model reveal that the model admits a &lt;em&gt;different&lt;/em&gt; form than the one represented in the equation in your question. (What you have there is a special case of a restricted VECH-GARCH model -- but the error terms in your formula should be squared.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A DCC-GARCH model starts out by modelling the conditional variances of the individual assets as univariate GARCH processes. The fitted cond. variances are used to scale the residuals from the cond. mean model (if any; otherwise the residuals coincide with the raw data). Then the scaled residuals are used for modelling the cond. correlation matrices; the model used in this step is sort of a GARCH model but this time it considers cond. correlation matrices instead of scalar cond. variances. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is roughly the logic of the DCC model. For more details and formulas you may refer to the &lt;a href=&quot;http://www.tandfonline.com/doi/abs/10.1198/073500102288618487&quot; rel=&quot;nofollow&quot;&gt;original paper&lt;/a&gt; or the &lt;a href=&quot;http://www.stata.com/manuals13/tsmgarchdcc.pdf&quot; rel=&quot;nofollow&quot;&gt;Stata manual&lt;/a&gt;. The &lt;strong&gt;takeaway&lt;/strong&gt; in your case is that the spillover effects cannot be modelled explicitly using the DCC-GARCH model -- because there is no explicit dependence of the cond. variance $h_{1,t}$ of the component series $x_{1,t}$ on the lagged cond. variance $h_{2,t-1}$ or the lagged squared error $\varepsilon^2_{2,t-1}$ from the component series $x_{2,t}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For spillover effects you could use BEKK-GARCH model, but I have not seen it implemented in Stata.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Engle, Robert. &lt;a href=&quot;http://www.tandfonline.com/doi/abs/10.1198/073500102288618487&quot; rel=&quot;nofollow&quot;&gt;&quot;Dynamic conditional correlation: A simple class of multivariate generalized autoregressive conditional heteroskedasticity models.&quot;&lt;/a&gt; &lt;em&gt;Journal of Business &amp;amp; Economic Statistics&lt;/em&gt; 20.3 (2002): 339-350.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="19645" LastEditorUserId="19645" LastEditDate="2016-02-25T19:34:43.953" LastActivityDate="2016-02-25T19:34:43.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24535" PostTypeId="2" ParentId="23034" CreationDate="2016-02-25T20:00:41.867" Score="2" Body="&lt;p&gt;VECM-GARCH models do not seem to be implemented in R as of now. However, if you are willing to accept some simplifications, you could perhaps be fine with the existing functionality. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take, for example, the &quot;rmgarch&quot; package in R. It allows combining univariate conditional mean-conditional variance models with several multivariate GARCH models that take individual component models as inputs (DCC, GOGARCH, copula GARCH). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a bivariate system $(x_{1,t},x_{2,t})$. You could use the functions &lt;code&gt;ugarchspec&lt;/code&gt; and &lt;code&gt;ugarchfit&lt;/code&gt; from the &quot;rugarch&quot; package to specify and fit individual models for $x_{1,t}$ and $x_{2,t}$ separately. These models would have &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a conditional mean part that would include own lags, lags of the other series and an error correction term via the argument &lt;code&gt;external.regressors&lt;/code&gt; and&lt;/li&gt;&#xA;&lt;li&gt;a conditional variance part that would be the GARCH model of your choice.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You would have to estimate the error correction term in advance using, say, the Johansen procedure (function &lt;code&gt;ca.jo&lt;/code&gt; in &quot;vars&quot; package).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far you would in effect have specified and estimated a VEC model equation by equation, paying attention to the conditional heteroskedasticity via the univariate GARCH models (although the off-diagonal element of the conditional variance matrices would be neglected).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the specified component models, you would supply them to the relevant function in the &quot;rmgarch&quot; package to build the multivariate GARCH model of your choice (DCC, GOGARCH or copula GARCH).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One unpleasant aspect of this procedure is that it is not clear how you would select the autoregressive order incorporating the information from the conditional variance part. You could still select the autoregressive order by just neglecting the conditional variance part, though.&lt;/p&gt;&#xA;" OwnerUserId="19645" LastEditorUserId="19645" LastEditDate="2016-02-25T20:07:16.517" LastActivityDate="2016-02-25T20:07:16.517" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24536" PostTypeId="2" ParentId="21966" CreationDate="2016-02-25T20:16:36.360" Score="0" Body="&lt;p&gt;A bivariate CCC-GARCH model consists of two univariate GARCH models and a scalar conditional correlation. You would predict the individual conditional variances $\hat\sigma^2_{1,t+1}$ and $\hat\sigma^2_{2,t+1}$ from the individual univariate GARCH models (which is straightforward for one step ahead, and you iterate beyond that): &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \hat\sigma^2_{i,t+1} = \omega + \alpha_{i,1} \hat\varepsilon^2_{i,t} + \beta_{i,1} \hat\sigma^2_{i,t} $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;for $i=1,2$. You would predict the conditional covariance $\hat\sigma_{ij,t+1}$ by multiplying the square roots of the predicted conditional variances to the estimated conditional correlation: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \hat\sigma_{ij,t+1} = \sqrt{\hat\sigma^2_{i,t+1}} \cdot \sqrt{\hat\sigma^2_{j,t+1}} \cdot \hat\rho. $$&lt;/p&gt;&#xA;" OwnerUserId="19645" LastActivityDate="2016-02-25T20:16:36.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24537" PostTypeId="2" ParentId="24514" CreationDate="2016-02-25T21:05:05.510" Score="1" Body="&lt;p&gt;We assume the following Black-Scholes equation:&#xA;\begin{align}&#xA;\frac{\partial V}{\partial t} = -\frac{\sigma^2 S_t^2}{2}\frac{\partial^2 V}{\partial S_t^2} -r S_t \frac{\partial V}{\partial S_t} +r V.\tag{1}&#xA;\end{align}&#xA;From the assumption,&#xA;\begin{align}&#xA;V(t,\, S_t) = e^{rt}\tilde{V}(t,\, \tilde{S}_t).\tag{2}&#xA;\end{align}&#xA;Then&#xA;\begin{align*}&#xA;\frac{\partial V}{\partial t} &amp;amp;= re^{rt}\tilde{V}+e^{rt}\frac{\partial \tilde{V}}{\partial t} + e^{rt}\frac{\partial \tilde{V}}{\partial \tilde{S}_t}\frac{\partial \tilde{S}_t}{\partial t}\\&#xA;&amp;amp;= re^{rt}\tilde{V}+e^{rt}\frac{\partial \tilde{V}}{\partial t} -rS_t \frac{\partial \tilde{V}}{\partial \tilde{S}_t},\tag{3}\\&#xA;\frac{\partial V}{\partial S_t} &amp;amp;= e^{rt}\frac{\partial \tilde{V}}{\partial S_t}\\&#xA;&amp;amp;=e^{rt}\frac{\partial \tilde{V}}{\partial \tilde{S}_t}\frac{\partial \tilde{S}_t}{\partial S_t}\\&#xA;&amp;amp;=\frac{\partial \tilde{V}}{\partial \tilde{S}_t},\tag{4}\\&#xA;\frac{\partial^2 V}{\partial S_t^2} &amp;amp;=\frac{\partial^2 \tilde{V}}{\partial \tilde{S}_t^2}\frac{\partial \tilde{S}_t}{\partial S_t}\\&#xA;&amp;amp;=e^{-rt}\frac{\partial^2 \tilde{V}}{\partial \tilde{S}_t^2}.\tag{5}&#xA;\end{align*}&#xA;Now, plugin (2)-(5) into (1), we obtain that&#xA;\begin{align*}&#xA;\frac{\partial \tilde{V}}{\partial t} = -\frac{\sigma^2 \tilde{S}_t^2}{2} \frac{\partial^2 \tilde{V}}{\partial \tilde{S}_t^2}.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-02-25T21:05:05.510" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24538" PostTypeId="1" AcceptedAnswerId="24571" CreationDate="2016-02-25T21:20:56.823" Score="1" ViewCount="1411" Body="&lt;p&gt;Given S&amp;amp;P500 returns for the past 20 years I fitted an ARMA(1,1)-GARCH(1,1) model using the rugarch package, so using ugarchspec() and the ugarchfit(), with different innovations distributions, i.e. norm, std, ged. My task would be to evaluate and compare the forecasting performance of the different models but I have problem to figure out how to do it.&#xA;I then used the ugarchforecast as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;spec &amp;lt;- ugarchspec(variance.model = list(&quot;sGARCH&quot;, garch0rder = c(1,1), &#xA;submodel = NULL, external.regressors = NULL, variance.targeting = F),     &#xA;mean.model = list(arma0rder = c(1,1), include.mean = T, archm = F,     &#xA;archpow=1, arfima = F, external.regressors = NULL, archex = FALSE),  &#xA;distribution.model = &quot;norm&quot;, fixed.pars = list(ar1 = 0.6170, ma1 =    &#xA;-0.6824,  mu = 2e-04))&#xA;garch &amp;lt;- ugarchfit(spec, ret, out.sample = 100, solver = &quot;solnp&quot;,     &#xA;fit.control = list(stationarity = 1, fixed.se = 0, rec.init = &quot;all&quot;))&#xA;fore &amp;lt;- ugarchforecast(garch, n.ahead = 100, n.roll = 100)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is that procedure correct? what should I do now to evaluate the forecast performance by comparing MSE, RMSE, MAE?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thank you!&lt;/p&gt;&#xA;" OwnerUserId="19647" LastEditorUserId="16249" LastEditDate="2016-03-01T13:42:17.453" LastActivityDate="2016-03-01T13:42:17.453" Title="how to calculate RMSE, MAE, given ugarchforecast results?" Tags="&lt;r&gt;&lt;garch&gt;&lt;forecasting&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24539" PostTypeId="2" ParentId="24516" CreationDate="2016-02-25T21:34:08.170" Score="1" Body="&lt;p&gt;Form a smooth convex function, the second derivative is always non-negative. In particular, for any $\varepsilon &amp;gt;0$, &#xA;\begin{align*}&#xA;V(S) &amp;amp;= V\Big(\frac{1}{2}(S+\varepsilon ) + \frac{1}{2}(S-\varepsilon )\Big)\\&#xA;&amp;amp;\le \frac{1}{2}\Big(V(S+\varepsilon )+ V(S-\varepsilon)  \Big).&#xA;\end{align*}&#xA;That is,&#xA;$$V(S+\varepsilon )+ V(S-\varepsilon) - 2 V(S) \ge 0 $$&#xA;Then&#xA;\begin{align*}&#xA;\frac{\partial^2 V}{\partial S^2} = \lim_{\varepsilon \rightarrow 0}\frac{V(S+\varepsilon )+ V(S-\varepsilon) - 2 V(S)}{\varepsilon^2} \ge 0.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-02-25T21:34:08.170" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24540" PostTypeId="1" CreationDate="2016-02-25T23:06:44.483" Score="1" ViewCount="213" Body="&lt;p&gt;How is it possible to simulate one million of tick data for, say EUR-USD price, using a &lt;a href=&quot;https://en.wikipedia.org/wiki/Autoregressive_conditional_heteroskedasticity#GARCH&quot; rel=&quot;nofollow&quot;&gt;GARCH&lt;/a&gt; model? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, how do I simulate $X_i$ for $i = 1 \dots 1000000$, with &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$\text{mean}(X)=X_0 \approx 1.1042$&lt;/li&gt;&#xA;&lt;li&gt;$\text{stddev}(X) \approx 0.10$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Even if it's possible with ready to use libraries, I'd like to be able to write it from scratch (Python or R).&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="18444" LastEditorUserId="467" LastEditDate="2016-02-26T01:52:51.753" LastActivityDate="2016-02-26T01:52:51.753" Title="How to perofrm a simple GARCH simulation example?" Tags="&lt;stochastic-processes&gt;&lt;garch&gt;&lt;models&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24541" PostTypeId="1" CreationDate="2016-02-26T01:22:36.007" Score="3" ViewCount="1211" Body="&lt;p&gt;I have followed the guidlines for installing QuantLib for mac from here &lt;a href=&quot;http://quantlib.org/install/macosx.shtml&quot; rel=&quot;nofollow&quot;&gt;http://quantlib.org/install/macosx.shtml&lt;/a&gt; and also fixed the flags using the commands:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;export CXXFLAGS = -stdlib=libstdc++&lt;/p&gt;&#xA;&#xA;&lt;p&gt;export LDFLAGS = -mmacosx-version-min=10.6&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I try to compile the examples as told in the guidlines, I get the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;In file included from BermudanSwaption.cpp:22:&#xA;In file included from /opt/local/include/ql/quantlib.hpp:43:&#xA;In file included from /opt/local/include/ql/experimental/all.hpp:25:&#xA;In file included from /opt/local/include/ql/experimental/volatility/all.hpp:21:&#xA;In file included from /opt/local/include/ql/experimental/volatility/zabr.hpp:31:&#xA;In file included from /opt/local/include/ql/math/statistics/incrementalstatistics.hpp:35:&#xA;In file included from /opt/local/include/boost/accumulators/statistics/stats.hpp:14:&#xA;In file included from /opt/local/include/boost/accumulators/statistics_fwd.hpp:12:&#xA;/opt/local/include/boost/mpl/print.hpp:50:19: warning: in-class initialization of non-static data member is a&#xA;      C++11 extension [-Wc++11-extensions]&#xA;    const int m_x = 1 / (sizeof(T) - sizeof(T));&#xA;                  ^&#xA;1 warning generated.&#xA;Undefined symbols for architecture x86_64:&#xA;  &quot;QuantLib::MultiStepSwap::nextTimeStep(QuantLib::CurveState const&amp;amp;, std::__1::vector&amp;lt;unsigned long, std::__1::allocator&amp;lt;unsigned long&amp;gt; &amp;gt;&amp;amp;, std::__1::vector&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt;, std::__1::allocator&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt; &amp;gt; &amp;gt;&amp;amp;)&quot;, referenced from:&#xA;      vtable for QuantLib::MultiStepSwap in BermudanSwaption-a6bf28.o&#xA;  &quot;QuantLib::ExerciseAdapter::nextTimeStep(QuantLib::CurveState const&amp;amp;, std::__1::vector&amp;lt;unsigned long, std::__1::allocator&amp;lt;unsigned long&amp;gt; &amp;gt;&amp;amp;, std::__1::vector&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt;, std::__1::allocator&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt; &amp;gt; &amp;gt;&amp;amp;)&quot;, referenced from:&#xA;      vtable for QuantLib::ExerciseAdapter in BermudanSwaption-a6bf28.o&#xA;  &quot;QuantLib::OneStepForwards::nextTimeStep(QuantLib::CurveState const&amp;amp;, std::__1::vector&amp;lt;unsigned long, std::__1::allocator&amp;lt;unsigned long&amp;gt; &amp;gt;&amp;amp;, std::__1::vector&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt;, std::__1::allocator&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt; &amp;gt; &amp;gt;&amp;amp;)&quot;, referenced from:&#xA;      vtable for QuantLib::OneStepForwards in BermudanSwaption-a6bf28.o&#xA;  &quot;QuantLib::BermudanExercise::BermudanExercise(std::__1::vector&amp;lt;QuantLib::Date, std::__1::allocator&amp;lt;QuantLib::Date&amp;gt; &amp;gt; const&amp;amp;, bool)&quot;, referenced from:&#xA;      _main in BermudanSwaption-a6bf28.o&#xA;  &quot;QuantLib::MultiStepNothing::nextTimeStep(QuantLib::CurveState const&amp;amp;, std::__1::vector&amp;lt;unsigned long, std::__1::allocator&amp;lt;unsigned long&amp;gt; &amp;gt;&amp;amp;, std::__1::vector&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt;, std::__1::allocator&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt; &amp;gt; &amp;gt;&amp;amp;)&quot;, referenced from:&#xA;      vtable for QuantLib::MultiStepNothing in BermudanSwaption-a6bf28.o&#xA;  &quot;QuantLib::MultiStepRatchet::nextTimeStep(QuantLib::CurveState const&amp;amp;, std::__1::vector&amp;lt;unsigned long, std::__1::allocator&amp;lt;unsigned long&amp;gt; &amp;gt;&amp;amp;, std::__1::vector&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt;, std::__1::allocator&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt; &amp;gt; &amp;gt;&amp;amp;)&quot;, referenced from:&#xA;      vtable for QuantLib::MultiStepRatchet in BermudanSwaption-a6bf28.o&#xA;  &quot;QuantLib::MultiStepForwards::nextTimeStep(QuantLib::CurveState const&amp;amp;, std::__1::vector&amp;lt;unsigned long, std::__1::allocator&amp;lt;unsigned long&amp;gt; &amp;gt;&amp;amp;, std::__1::vector&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt;, std::__1::allocator&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt; &amp;gt; &amp;gt;&amp;amp;)&quot;, referenced from:&#xA;      vtable for QuantLib::MultiStepForwards in BermudanSwaption-a6bf28.o&#xA;  &quot;QuantLib::MultiStepSwaption::nextTimeStep(QuantLib::CurveState const&amp;amp;, std::__1::vector&amp;lt;unsigned long, std::__1::allocator&amp;lt;unsigned long&amp;gt; &amp;gt;&amp;amp;, std::__1::vector&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt;, std::__1::allocator&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt; &amp;gt; &amp;gt;&amp;amp;)&quot;, referenced from:&#xA;      vtable for QuantLib::MultiStepSwaption in BermudanSwaption-a6bf28.o&#xA;  &quot;QuantLib::OneStepOptionlets::nextTimeStep(QuantLib::CurveState const&amp;amp;, std::__1::vector&amp;lt;unsigned long, std::__1::allocator&amp;lt;unsigned long&amp;gt; &amp;gt;&amp;amp;, std::__1::vector&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt;, std::__1::allocator&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt; &amp;gt; &amp;gt;&amp;amp;)&quot;, referenced from:&#xA;      vtable for QuantLib::OneStepOptionlets in BermudanSwaption-a6bf28.o&#xA;  &quot;QuantLib::MultiStepOptionlets::nextTimeStep(QuantLib::CurveState const&amp;amp;, std::__1::vector&amp;lt;unsigned long, std::__1::allocator&amp;lt;unsigned long&amp;gt; &amp;gt;&amp;amp;, std::__1::vector&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt;, std::__1::allocator&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt; &amp;gt; &amp;gt;&amp;amp;)&quot;, referenced from:&#xA;      vtable for QuantLib::MultiStepOptionlets in BermudanSwaption-a6bf28.o&#xA;  &quot;QuantLib::OneStepCoinitialSwaps::nextTimeStep(QuantLib::CurveState const&amp;amp;, std::__1::vector&amp;lt;unsigned long, std::__1::allocator&amp;lt;unsigned long&amp;gt; &amp;gt;&amp;amp;, std::__1::vector&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt;, std::__1::allocator&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt; &amp;gt; &amp;gt;&amp;amp;)&quot;, referenced from:&#xA;      vtable for QuantLib::OneStepCoinitialSwaps in BermudanSwaption-a6bf28.o&#xA;  &quot;QuantLib::OneStepCoterminalSwaps::nextTimeStep(QuantLib::CurveState const&amp;amp;, std::__1::vector&amp;lt;unsigned long, std::__1::allocator&amp;lt;unsigned long&amp;gt; &amp;gt;&amp;amp;, std::__1::vector&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt;, std::__1::allocator&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt; &amp;gt; &amp;gt;&amp;amp;)&quot;, referenced from:&#xA;      vtable for QuantLib::OneStepCoterminalSwaps in BermudanSwaption-a6bf28.o&#xA;  &quot;QuantLib::MultiStepCoinitialSwaps::nextTimeStep(QuantLib::CurveState const&amp;amp;, std::__1::vector&amp;lt;unsigned long, std::__1::allocator&amp;lt;unsigned long&amp;gt; &amp;gt;&amp;amp;, std::__1::vector&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt;, std::__1::allocator&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt; &amp;gt; &amp;gt;&amp;amp;)&quot;, referenced from:&#xA;      vtable for QuantLib::MultiStepCoinitialSwaps in BermudanSwaption-a6bf28.o&#xA;  &quot;QuantLib::MultiStepInverseFloater::nextTimeStep(QuantLib::CurveState const&amp;amp;, std::__1::vector&amp;lt;unsigned long, std::__1::allocator&amp;lt;unsigned long&amp;gt; &amp;gt;&amp;amp;, std::__1::vector&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt;, std::__1::allocator&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt; &amp;gt; &amp;gt;&amp;amp;)&quot;, referenced from:&#xA;      vtable for QuantLib::MultiStepInverseFloater in BermudanSwaption-a6bf28.o&#xA;  &quot;QuantLib::MultiStepCoterminalSwaps::nextTimeStep(QuantLib::CurveState const&amp;amp;, std::__1::vector&amp;lt;unsigned long, std::__1::allocator&amp;lt;unsigned long&amp;gt; &amp;gt;&amp;amp;, std::__1::vector&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt;, std::__1::allocator&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt; &amp;gt; &amp;gt;&amp;amp;)&quot;, referenced from:&#xA;      vtable for QuantLib::MultiStepCoterminalSwaps in BermudanSwaption-a6bf28.o&#xA;  &quot;QuantLib::MultiStepCoterminalSwaptions::nextTimeStep(QuantLib::CurveState const&amp;amp;, std::__1::vector&amp;lt;unsigned long, std::__1::allocator&amp;lt;unsigned long&amp;gt; &amp;gt;&amp;amp;, std::__1::vector&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt;, std::__1::allocator&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt; &amp;gt; &amp;gt;&amp;amp;)&quot;, referenced from:&#xA;      vtable for QuantLib::MultiStepCoterminalSwaptions in BermudanSwaption-a6bf28.o&#xA;  &quot;QuantLib::MultiStepPeriodCapletSwaptions::nextTimeStep(QuantLib::CurveState const&amp;amp;, std::__1::vector&amp;lt;unsigned long, std::__1::allocator&amp;lt;unsigned long&amp;gt; &amp;gt;&amp;amp;, std::__1::vector&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt;, std::__1::allocator&amp;lt;std::__1::vector&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator&amp;lt;QuantLib::MarketModelMultiProduct::CashFlow&amp;gt; &amp;gt; &amp;gt; &amp;gt;&amp;amp;)&quot;, referenced from:&#xA;      vtable for QuantLib::MultiStepPeriodCapletSwaptions in BermudanSwaption-a6bf28.o&#xA;  &quot;QuantLib::Error::Error(std::__1::basic_string&amp;lt;char, std::__1::char_traits&amp;lt;char&amp;gt;, std::__1::allocator&amp;lt;char&amp;gt; &amp;gt; const&amp;amp;, long, std::__1::basic_string&amp;lt;char, std::__1::char_traits&amp;lt;char&amp;gt;, std::__1::allocator&amp;lt;char&amp;gt; &amp;gt; const&amp;amp;, std::__1::basic_string&amp;lt;char, std::__1::char_traits&amp;lt;char&amp;gt;, std::__1::allocator&amp;lt;char&amp;gt; &amp;gt; const&amp;amp;)&quot;, referenced from:&#xA;      QuantLib::DiscretizedOption::reset(unsigned long) in BermudanSwaption-a6bf28.o&#xA;      QuantLib::Instrument::setupArguments(QuantLib::PricingEngine::arguments*) const in BermudanSwaption-a6bf28.o&#xA;      QuantLib::Option::setupArguments(QuantLib::PricingEngine::arguments*) const in BermudanSwaption-a6bf28.o&#xA;      QuantLib::Payoff::accept(QuantLib::AcyclicVisitor&amp;amp;) in BermudanSwaption-a6bf28.o&#xA;      QuantLib::BlackVolTermStructure::accept(QuantLib::AcyclicVisitor&amp;amp;) in BermudanSwaption-a6bf28.o&#xA;      QuantLib::SimpleQuote::value() const in BermudanSwaption-a6bf28.o&#xA;      QuantLib::Handle&amp;lt;QuantLib::Quote&amp;gt;::operator-&amp;gt;() const in BermudanSwaption-a6bf28.o&#xA;      ...&#xA;  &quot;QuantLib::detail::operator&amp;lt;&amp;lt;(std::__1::basic_ostream&amp;lt;char, std::__1::char_traits&amp;lt;char&amp;gt; &amp;gt;&amp;amp;, QuantLib::detail::percent_holder const&amp;amp;)&quot;, referenced from:&#xA;      calibrateModel(boost::shared_ptr&amp;lt;QuantLib::ShortRateModel&amp;gt; const&amp;amp;, std::__1::vector&amp;lt;boost::shared_ptr&amp;lt;QuantLib::CalibrationHelper&amp;gt;, std::__1::allocator&amp;lt;boost::shared_ptr&amp;lt;QuantLib::CalibrationHelper&amp;gt; &amp;gt; &amp;gt; const&amp;amp;) in BermudanSwaption-a6bf28.o&#xA;      _main in BermudanSwaption-a6bf28.o&#xA;  &quot;QuantLib::operator&amp;lt;&amp;lt;(std::__1::basic_ostream&amp;lt;char, std::__1::char_traits&amp;lt;char&amp;gt; &amp;gt;&amp;amp;, QuantLib::Date const&amp;amp;)&quot;, referenced from:&#xA;      QuantLib::InterestRateIndex::valueDate(QuantLib::Date const&amp;amp;) const in BermudanSwaption-a6bf28.o&#xA;ld: symbol(s) not found for architecture x86_64&#xA;clang: error: linker command failed with exit code 1 (use -v to see invocation)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there something wrong I have done? What is the problem with the &quot;linker&quot; here?&#xA;I would really appreciate for help since I have been trying to get this to work for a very long time now.&lt;/p&gt;&#xA;" OwnerUserId="18211" LastActivityDate="2018-10-20T05:40:31.440" Title="Compiling QuantLib example" Tags="&lt;quantlib&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24542" PostTypeId="2" ParentId="24541" CreationDate="2016-02-26T01:38:13.907" Score="2" Body="&lt;p&gt;You can't just compile BermudanSwaption.cpp and hope everything would be fine. You have to compile the entire QuantLib library and link with the generated library files. Please google &quot;compiling and linking C++&quot; for more information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By far, the easiest way to make it happen on Mac is to do it with Xcode. You will need to create a new Xcode project, and import the entire Quantlib project files into it. Next, you will need to create a main() function. Xcode does the compiling and linking for your automatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my screenshot, I have QuantLib working in Xcode and was trying the OU process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/J0VYJ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/J0VYJ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2016-02-26T01:38:13.907" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24544" PostTypeId="1" CreationDate="2016-02-26T03:50:25.160" Score="3" ViewCount="306" Body="&lt;p&gt;I have been reading Chapter 4 of Shreve's Stochastic Calculus for Finance II.&#xA;It is easy to understand the simple process, $\Delta(t)$, defined on Page 126, which is just a constant inside a given subinterval.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Later in the Exercise 4.2 and 4.3, it is mentioned again.&#xA;The process $\Delta(t)$ is simple and nonrandom in 4.2 while it is simple but random in 4.3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How should I understand the randomness of such process?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am just a beginner of financial math.&#xA;Thanks in advance! Good reference will also be appreciated!&lt;/p&gt;&#xA;" OwnerUserId="19653" LastActivityDate="2017-02-11T23:13:30.553" Title="How to understand nonrandom/random process in Shreve book?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;finance-mathematics&gt;&lt;financial-engineering&gt;" AnswerCount="3" CommentCount="2" ClosedDate="2017-02-16T13:21:42.567" ContentLicense="CC BY-SA 3.0" />
  <row Id="24545" PostTypeId="1" CreationDate="2016-02-26T03:54:47.927" Score="6" ViewCount="1291" Body="&lt;p&gt;I am looking for an advanced introduction to statistics. I am currently interviewing for hedge fund positions, and a solid base in statistics would be quite helpful. As a math major I have significant (graduate level) background in analysis and probability, but somehow statistics has always evaded my course schedule. An ideal book would include several proofs in the exposition and a multitude of computational exercises. &lt;/p&gt;&#xA;" OwnerUserId="19654" LastActivityDate="2016-04-14T07:55:10.613" Title="Statistics for quantitative finance" Tags="&lt;reference-request&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24547" PostTypeId="2" ParentId="24453" CreationDate="2016-02-26T05:53:26.233" Score="0" Body="&lt;p&gt;Here is &lt;em&gt;one of the easier&lt;/em&gt; ways to value a non-contractual book. &#xA;1.Get your trend line. Using moving averages smooth the data to remove the seasonal bias. Select n that gives the straightest line but still shows the growth trend.&#xA;2.Find your percentile extreme value (EV) based on chosen conf. interval. &#xA;3.Calculate the ratio of EV to your trend line for each data point. This is essentially your volatile ratio. &#xA;4.Put the volatile portion into the shortest bucket, the core into the longer selected tractor. &#xA;Points: The higher the conf. interval the higher the volatile ratio will be. It will also shorted the duration of the book. For rates sensitivity must use the two components separately. &#xA;Hope that helps&lt;/p&gt;&#xA;" OwnerUserId="19582" LastActivityDate="2016-02-26T05:53:26.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24548" PostTypeId="1" CreationDate="2016-02-26T07:28:22.947" Score="3" ViewCount="1133" Body="&lt;p&gt;In Hull's book 'Options, Futures and Other derivatives', author said that&#xA;when price of underlying asset &lt;em&gt;S&lt;/em&gt; is strongly positively correlated with the interest rate, future price is slightly larger than forward price for same contract.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand his description under that assumption.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, in a real world, Is forward price for stock or bond larger than future price for the same underlying asset if two contracts are equal?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's because as far as I know, bond price or stock price both are in general negatively correlated with interest rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Actually, I think most investment assets are negatively correlated with interest rate, because people will take more risk to get an extra income when interest rate is low.)&lt;/p&gt;&#xA;" OwnerUserId="19656" LastActivityDate="2016-02-27T16:18:32.703" Title="the difference between forward price and future price" Tags="&lt;forward&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24549" PostTypeId="1" CreationDate="2016-02-26T07:42:57.883" Score="1" ViewCount="2827" Body="&lt;p&gt;I'm reading the book 'Options, Futures and Other derivatives' an having a hard time to understand Conversion factor and CTD bond.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Conversion factor&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I understand this as a factor to adjust the price of the bond delivered to the hypothetical bond(with yield = 6% in my case)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ex. maturity = 20 years. Coupon rate = 10% with semiannual payment. Face value = $100&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then in the book, after discounting future cash flow with annual rate = 6%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sum_{i=1}^{40} \dfrac5{1.03^i} +\dfrac{100}{1.03^{40}} = $146.23&lt;/p&gt;&#xA;&#xA;&lt;p&gt;author says conversion factor is $\dfrac{$146.23}{$100}$ = 1.4623&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(If I'm wrong, please tell me. )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder why we deal with only yield. I think the calculation must reflect the difference in maturities of each bonds. &lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;CTD Bond.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In the book, author said &lt;em&gt;'when bond yields are in excess of 6%, the conversion factor system tends to favor the delivery of low-coupon, long-maturity bonds.&lt;/em&gt;'&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think, this means that under that circumstance, conversion factor increases as coupon rate decreases and maturity increases. However, I can't show that mathematically. I guess I misunderstood or there must be more variables that needs to be considered from the words &lt;em&gt;'tends to'&lt;/em&gt;. How can I understand that description both intuitively and mathematically.&lt;/p&gt;&#xA;" OwnerUserId="19656" LastEditorUserId="19656" LastEditDate="2016-02-26T08:25:43.020" LastActivityDate="2019-03-28T07:38:13.553" Title="Conversion factor and CTD Bond" Tags="&lt;bond&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24550" PostTypeId="2" ParentId="24431" CreationDate="2016-02-26T07:58:42.187" Score="2" Body="&lt;p&gt;To address the issue of &lt;a href=&quot;https://en.wikipedia.org/wiki/Multicollinearity&quot; rel=&quot;nofollow noreferrer&quot;&gt;multicollinearity&lt;/a&gt; you can basically do the following (&lt;a href=&quot;https://stats.stackexchange.com/a/38095/230&quot;&gt;source&lt;/a&gt;, the author wrote his PhD thesis about multicollinearity diagnostics):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Getting more data &lt;/li&gt;&#xA;&lt;li&gt;Dropping one variable &lt;/li&gt;&#xA;&lt;li&gt;Combining the variables (e.g. with partial least squares regression or principal component regression) and &lt;/li&gt;&#xA;&lt;li&gt;Performing ridge regression, which gives biased results but reduces the variance on the estimates. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I don't know whether 1. is feasible but it is always a good idea (one of the learnings of data science is that getting more and better data is preferable to more sophisticated algorithms).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Concerning 2. you said that you don't want that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3. doesn't seem practical either since the new variable won't be interpretable any more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So 4. seems to be the best candidate. Mathematically this is also known as &lt;a href=&quot;https://en.wikipedia.org/wiki/Tikhonov_regularization&quot; rel=&quot;nofollow noreferrer&quot;&gt;Tikhonov regularization&lt;/a&gt;. In matlab a good starting point seems to be this one:&lt;br&gt; &lt;a href=&quot;http://www.mathworks.com/help/stats/ridge-regression.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.mathworks.com/help/stats/ridge-regression.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The command is &lt;code&gt;ridge()&lt;/code&gt;, see also here:&lt;br&gt;&#xA;&lt;a href=&quot;http://www.mathworks.com/help/stats/ridge.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.mathworks.com/help/stats/ridge.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2016-02-26T09:44:56.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24551" PostTypeId="2" ParentId="23281" CreationDate="2016-02-26T08:20:56.163" Score="1" Body="&lt;p&gt;The Sharpe ratio is only useful to the extent that variance is an appropriate measure of risk. However, even if that condition is fulfilled, the Sharpe ratio remains hard to interpret.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, portfolios that realized a negative return in the past period have a negative Sharpe ratio. Possibly even inflated (when the standard deviation is very low). So even when the portfolio in itself may have a good risk-return profile, it may not look such a good portfolio based on the Sharpe ratio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One alternative measure, developed specifically to tackle this issue of interpretation, is the &lt;a href=&quot;http://breakingdownfinance.com/finance-topics/performance-measurement/m2-measure/&quot; rel=&quot;nofollow&quot;&gt;M2-measure&lt;/a&gt; of Modigliani &amp;amp; Modigliani. It is closely related to the Sharpe ratio but offers the advantage being able to rank the portfolios relatively based on this metric. &lt;/p&gt;&#xA;" OwnerUserId="13950" LastActivityDate="2016-02-26T08:20:56.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24552" PostTypeId="2" ParentId="24545" CreationDate="2016-02-26T09:06:53.240" Score="3" Body="&lt;p&gt;You could try this one:&#xA;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1461471370&quot; rel=&quot;nofollow&quot;&gt;An Introduction to Statistical Learning: with Applications in R (Springer Texts in Statistics)&lt;/a&gt;.&#xA;Or maybe take a stats course on coursera/edx&lt;/p&gt;&#xA;" OwnerUserId="19615" LastActivityDate="2016-02-26T09:06:53.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24553" PostTypeId="2" ParentId="24545" CreationDate="2016-02-26T09:26:26.953" Score="6" Body="&lt;p&gt;I think that &quot;An Introduction to Statistical Learning: with Applications in R (Springer Texts in Statistics)&quot; suggested by KarolisR could be useful but too much machine learning oriented. Moreover, such a book is for beginners.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a thorough book (PhD level) on statistics, I suggest &quot;Statistical Inference&quot; by Casella and Berger.&lt;/p&gt;&#xA;" OwnerUserId="19515" LastActivityDate="2016-02-26T09:26:26.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24554" PostTypeId="2" ParentId="24431" CreationDate="2016-02-26T09:37:07.703" Score="0" Body="&lt;p&gt;You can use Principal Component analysis which will divide the variable into non-correlated factors and the use the factor summary scores as an input in the model instead of variable scores.&lt;/p&gt;&#xA;" OwnerUserId="17921" LastActivityDate="2016-02-26T09:37:07.703" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24557" PostTypeId="1" CreationDate="2016-02-26T12:32:41.180" Score="1" ViewCount="801" Body="&lt;p&gt;I have a huge data frame with over 1000 column, which are companies(column headers) and in each column I have their estimated return(monthly). The sample period of the data frame in 11 years. I want to  calculate cumulative returns over the past 12 months with with one month lag. Meaning cumulative returns of January 2005 are estimated on the basis of Jan-04 to Dec.04 and February 2005 are estimated on the basis of Feb-04 to Jan-05.&#xA;I present my data as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;df&#xA;Month    A       B      C     D      E&#xA;Jan-00  0.01    0.00    NA  -0.01   NA&#xA;Feb-00  0.01    0.00    NA  0.00    NA&#xA;Mar-00  -0.02   0.00    NA  0.01    NA&#xA;Apr-00  -0.01   0.00    NA  -0.01   NA&#xA;May-00  -0.01   0.00    NA  0.01    NA&#xA;Jun-00  0.00    0.01    NA  -0.01   NA&#xA;Jul-00  0.00    -0.01   NA  0.00    NA&#xA;Aug-00  0.00    0.01    NA  0.00    NA&#xA;Sep-00  0.00    0.00    NA  0.00    NA&#xA;Oct-00  -0.01   0.00    NA  0.00    NA&#xA;Nov-00  -0.01   -0.01   NA  0.01    NA&#xA;Dec-00  -0.01   0.00    NA  0.01    NA&#xA;Jan-01  -0.01   0.00    NA  0.00    NA&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There also NAs within the data which cannot be removed due to the nature of data. I appreciate your help in this regard.&lt;/p&gt;&#xA;" OwnerUserId="18786" LastActivityDate="2016-02-26T12:32:41.180" Title="How to calculate cumulative returns with one lag in R" Tags="&lt;r&gt;&lt;returns&gt;&lt;performanceanalytics&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24558" PostTypeId="2" ParentId="24549" CreationDate="2016-02-26T13:30:43.453" Score="3" Body="&lt;p&gt;First of all, the idea that bond futures track a hypothetical 6% coupon bond with 20 years to maturity is a false one (although it frequently appears in textbooks).  In reality, the &quot;classic&quot; bond futures contract tracks a basket of bonds between 15 and 25 years to maturity. Currently, the classic bond futures contract does behave similarly to a 20-year bond (because its CTD has 19.97 years to maturity), but until recently, it behaved more like a 15-year bond over the past few years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Back to your question, conversion factor is (approximately) the price (divided by 100) of a bond assuming its yield to maturity as of the first delivery date is 6%. So it &lt;em&gt;does&lt;/em&gt; depend on the maturity of the bond in question. For example, the 4.75s of 02-15-2041 are deliverable into USH6 (the March 2016 expiry bond futures contract). To calculate its conversion factor involves these steps: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;calculate its time to maturity as of first delivery date; since the first delivery date for USH6 is 3/1/2016, the time to maturity is 24 years, 11 months, 14 days; &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;round time to maturity to the nearest whole quarter, which is 24 years and 9 months; &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;price a 4.75% coupon bond with 24 years and 9 months to maturity at 6% yield, which get you 83.9809. Hence the conversion factor is 0.8398. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;With regard to CTD and yield curve environment, here are some intuitions. First of all, remember that the purpose of conversion factor is to make bonds approximately equally deliverable when the yield curve is flat at 6%. Now think about what happens when yields increase – high duration bonds, with higher sensitivity to yields, will see their prices decline faster, making them more likely to be cheaper to deliver. Conversely, when yields decline, low duration bonds will see their prices increase less, making them more likely to be cheaper.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="26595" LastEditDate="2019-03-28T07:38:13.553" LastActivityDate="2019-03-28T07:38:13.553" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="24560" PostTypeId="1" CreationDate="2016-02-26T16:18:52.833" Score="2" ViewCount="315" Body="&lt;p&gt;A standard &lt;a href=&quot;http://www.investopedia.com/walkthrough/corporate-finance/4/return-risk/security-market-line.aspx&quot; rel=&quot;nofollow&quot;&gt;definition&lt;/a&gt; of the Security Market Line is as follows:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The security market line (&quot;SML&quot; or &quot;characteristic line&quot;) graphs the&#xA;  systematic (or market) risk versus the return of the whole market at a&#xA;  certain time and shows all risky marketable securities.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And an application of the SML for investment decision is as follows (according to my Corporate Finance &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0078034639&quot; rel=&quot;nofollow&quot;&gt;Book&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;to determine whether an investment has a positive NPV, we essentially&#xA;  compare the expected return on that new investment to what the&#xA;  financial market offers on an investment with the same beta. This is&#xA;  why the SML is so important: It tells us the “going rate” for bearing&#xA;  risk in the economy.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If one were to use these pieces of information, among many others, one would conclude that when choosing to invest in bonds, stocks at a certain risk one would at least expect returns that a similar investment would provide. However, the SML is not only applicable for such decisions but also for deciding the cost of capital or required rate of return for projects that a company may undertake. There are even &lt;a href=&quot;http://web.mit.edu/15.415d/www/pp12.pdf&quot; rel=&quot;nofollow&quot;&gt;maths&lt;/a&gt; in Finance books where they provide Beta, Expected Return and other variables for opening a new product line or some project.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, In these events how would one find similar investment from SML? Opening a new product line, or running some project is different from stock or bond investments! How can they be comparable?&lt;/p&gt;&#xA;" OwnerUserId="19660" LastEditorUserId="16991" LastEditDate="2016-02-26T17:53:12.650" LastActivityDate="2016-02-26T20:17:00.350" Title="Security Market Line &amp; Required Rate of Return for Projects" Tags="&lt;capm&gt;&lt;investing&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24561" PostTypeId="1" CreationDate="2016-02-26T16:25:27.120" Score="1" ViewCount="161" Body="&lt;p&gt;CME, 10 year Note Call&#xA;Strike 1300 &#xA;How to convert this strike to future price? (today's open at 131'100)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example we can take current prices EOD data&#xA;for example chart on CMEgroup:&#xA;&lt;a href=&quot;http://www.cmegroup.com/trading/interest-rates/us-treasury/10-year-us-treasury-note.html&quot; rel=&quot;nofollow&quot;&gt;http://www.cmegroup.com/trading/interest-rates/us-treasury/10-year-us-treasury-note.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yesterday Close: 130'24'0&#xA;The nearest Option strike for this price will be: Link : &lt;a href=&quot;http://www.cmegroup.com/daily_bulletin/current/Section42_10YrNote_5yrNote_2yrNote_30YrBond_Options.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.cmegroup.com/daily_bulletin/current/Section42_10YrNote_5yrNote_2yrNote_30YrBond_Options.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;May Strike: 1300?&lt;/p&gt;&#xA;" OwnerUserId="3092" LastEditorUserId="3092" LastEditDate="2016-02-29T15:53:47.953" LastActivityDate="2016-02-29T15:53:47.953" Title="How to convert bond options strikes to future prices" Tags="&lt;fixed-income&gt;&lt;futures&gt;&lt;cme&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24562" PostTypeId="2" ParentId="23286" CreationDate="2016-02-26T16:31:26.920" Score="2" Body="&lt;p&gt;First of all I would examine whether the model performs the task it is supposed to perform, i.e. account for the conditional heteroskedasticity in the data. That would amount to testing for remaining ARCH effects in the standardized model residuals by the &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/j.1467-9892.1994.tb00217.x/abstract&quot; rel=&quot;nofollow&quot;&gt;Li-Mak test&lt;/a&gt;. If the model fails the test, there is evidence that it does not do its main task well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Testing for autocorrelations of the standardized residuals, leverage effects and distributional goodness of fit as suggested by @Neeraj also makes sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, be aware that a model that passes all test may be an overfitted model. That is, it describes the sample data well (actually, too well) but it is not likely to generalize successfully, e.g. it would not fit a new sample from the sample underlying population (or data generating process) well. Therefore, use of information criteria (which penalize overfitting) for selecting a model may be justified.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Li, W. K., and T. K. Mak. &quot;On the squared residual autocorrelations in non-linear time series with conditional heteroskedasticity.&quot; &lt;em&gt;Journal of Time Series Analysis&lt;/em&gt; 15.6 (1994): 627-636.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="19645" LastActivityDate="2016-02-26T16:31:26.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24564" PostTypeId="2" ParentId="24431" CreationDate="2016-02-26T16:42:47.110" Score="1" Body="&lt;p&gt;You can use a constrained regression. This will address exactly your problem. It is afaik the industry standard way of addressing this problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will want to set up a constraint for each of the group of dummy variables you have such that the sum of the coefficients for that group is 0. In this case for A and B. You can leave C without constraint (you should actually !)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the co-linearity is coming from C (factors). Then it's another issue and advices in other answers are then very useful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to do this as long as you have more than 2 groups, or one group and the intersect. It's pretty standard as a risk modelling technique. See for example how MSCI deals with it in their US model  msci.com/documents/10199/ed6e42a3-c1fa-4430-89ba-efd5a5b52558 (middle of page 1)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On a side note, you should also consider using a robust regression technique.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are using Matlab (it seems from your snippet) you can read about constrained and robust regression in this excellent tutorial: &lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/8553-optimization-tips-and-tricks&quot; rel=&quot;nofollow&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/8553-optimization-tips-and-tricks&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And use the following function: &lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/13835-lse&quot; rel=&quot;nofollow&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/13835-lse&lt;/a&gt;&#xA;Although Matlab also has some regression functions but are more limited IMO.&lt;/p&gt;&#xA;" OwnerUserId="19661" LastEditorUserId="19661" LastEditDate="2016-02-26T18:39:47.677" LastActivityDate="2016-02-26T18:39:47.677" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="24566" PostTypeId="2" ParentId="18756" CreationDate="2016-02-26T16:58:05.093" Score="1" Body="&lt;p&gt;Use package &quot;vars&quot; function &lt;code&gt;ca.jo&lt;/code&gt; for cointegration analysis (the Johansen procedure) of a multivariate time series. Here is a code snippet from the functions' help file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;data(denmark)&#xA;sjd &amp;lt;- denmark[, c(&quot;LRM&quot;, &quot;LRY&quot;, &quot;IBO&quot;, &quot;IDE&quot;)]&#xA;sjd.vecm &amp;lt;- ca.jo(sjd, ecdet = &quot;const&quot;, type=&quot;eigen&quot;, K=2, spec=&quot;longrun&quot;,&#xA;season=4)&#xA;summary(sjd.vecm)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It loads a dataset &lt;code&gt;denmark&lt;/code&gt;, extracts four times series into a matrix &lt;code&gt;sjd&lt;/code&gt;, conducts the Johansen procedure by the function &lt;code&gt;ca.jo&lt;/code&gt; and prints its summary. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can extract the &lt;strong&gt;cointegrating vectors&lt;/strong&gt; by addressing the slot &lt;code&gt;V&lt;/code&gt; by &lt;code&gt;@V&lt;/code&gt; like &lt;code&gt;sjd.vecm@V&lt;/code&gt;. This will be a matrix where each column is a cointegrating vector. You can multiply the original multivariate series (like &lt;code&gt;sjd&lt;/code&gt;) to the &lt;code&gt;V&lt;/code&gt; matrix to get the error correction terms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A good introduction is the &lt;a href=&quot;https://cran.r-project.org/web/packages/vars/vignettes/vars.pdf&quot; rel=&quot;nofollow&quot;&gt;&quot;vignette&quot;&lt;/a&gt; of the &quot;vars&quot; package and Pfaff &quot;Analysis of Integrated and Cointegrated Time Series with R&quot; (a textbook).&lt;/p&gt;&#xA;" OwnerUserId="19645" LastEditorUserId="19645" LastEditDate="2016-02-26T17:08:58.093" LastActivityDate="2016-02-26T17:08:58.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24567" PostTypeId="2" ParentId="24366" CreationDate="2016-02-26T17:37:01.073" Score="1" Body="&lt;p&gt;Interesting that no one provides an answer with more of an &quot;active investment&quot; take.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A lot of people think they can predict the future price of a stock (and hence its simplest behavior: up or down) by looking at the valuation of a company. A very simplistic way of looking at it is buying undervalued stocks and selling overvalue stocks (relative to ones opinion of that value).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is how do you form an opinion about the real value of the company :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Fundamental analysis: specific knowledge/view about the industry or the company, management of the company, macro trends. etc.. (this list could go on forever)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Behavioral Analysis, what behavioral bias are investors expressing in general and how to exploit them. (Value, Size, Momentum for example). Those are often linked to risk factors and links nicely to Todd Page answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why, and whether this works is a big debate. I obviously oversimplify here and don't want to get into any debates whether the markets are efficient etc. Just want to give a different take to the answers you already have.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be applied each on their own or combined, applied to one stock or to a full cross-section of stocks. If this is an interview question I guess it might get asked in a form or another in a Quant Equity Shop (L/S Quant Hedge Funds and Active Equity Quant Managers which are all about doing cross sectional analysis of stocks fundamentals and behavioral factors). &lt;/p&gt;&#xA;" OwnerUserId="19661" LastActivityDate="2016-02-26T17:37:01.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24568" PostTypeId="2" ParentId="24560" CreationDate="2016-02-26T17:56:09.857" Score="1" Body="&lt;p&gt;Your question holds some water, but it is all about &lt;strong&gt;&lt;em&gt;providing return atleast expected by the shareholders&lt;/em&gt;&lt;/strong&gt; (cost of capital). Remember, it is shareholders money that gets invested in such project (if not borrowed). If project does not provide return that is being expected by the shareholders (cost of their capital or risk adjusted return) then why would they continue to hold share of such company. Managers require to select only those projects that could provide return atleast expected by the shareholders. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short, &lt;strong&gt;CAPM provide a benchmark return&lt;/strong&gt; which help the managers to decide which projects to choose or reject for investment decision. &lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2016-02-26T17:56:09.857" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24569" PostTypeId="2" ParentId="7849" CreationDate="2016-02-26T18:15:30.167" Score="1" Body="&lt;p&gt;The standardized error in a GARCH model has unit variance (which is needed for identification) and a zero mean. Whatever the conditional distribution, it is scaled and shifted so as to fit those requirements. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answers to your questions are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;No.&lt;/li&gt;&#xA;&lt;li&gt;No, they don't drop the assumption of mean zero and variance one; and Yes, they are using something like a &quot;standardized&quot; version.&lt;/li&gt;&#xA;&lt;li&gt;Yes, &quot;rugarch&quot; is doing a joint parameter estimation; hence, in the final output you get the parameters of the GARCH process and the parameters of the generalized hyperbolic distribution.&lt;/li&gt;&#xA;&lt;li&gt;&quot;How can I implement this?&quot; You can implement this using the function &lt;code&gt;ugarchspec&lt;/code&gt; just as you wrote.&lt;/li&gt;&#xA;&lt;li&gt;&quot;Is this assuming a mean of zero and a variance of one?&quot; Yes, the standardized model error are assumed to have these properties.&lt;/li&gt;&#xA;&lt;li&gt;&quot;How can I use the hyperbolic distribution for &lt;code&gt;distribution.model&lt;/code&gt;?&quot; I don't know, but see below.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For more details, consult the &lt;a href=&quot;https://cran.r-project.org/web/packages/rugarch/vignettes/Introduction_to_the_rugarch_package.pdf&quot; rel=&quot;nofollow&quot;&gt;&quot;vignette&quot;&lt;/a&gt; for the &quot;rugarch&quot; package in R, especially section 2.3 &quot;Conditional distributions&quot;.&lt;/p&gt;&#xA;" OwnerUserId="19645" LastActivityDate="2016-02-26T18:15:30.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24570" PostTypeId="2" ParentId="24544" CreationDate="2016-02-26T18:16:34.310" Score="0" Body="&lt;p&gt;$\Delta(t)$ simply represents change in process value over the interval $t$ to $t+1$. If change in process value over this interval is deterministic, then you can call process $\Delta(t)$ as nonrandom. Let's suppose, the change in bond price $(B_t)$ governed by following equation: &#xA;$$dB_t=rB_t dt$$&#xA;&lt;strong&gt;If $r$ is constant, then there is no uncertainty in the change in bond price.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, suppose stock price $(S_t)$ follows geometric Brownian motion and satisfy following SDE: &#xA;$$dS_t = \mu S_t dt + \sigma S_t dW_t$$ &#xA;where, $W_t$ is Wiener process. Here, change in stock price is not constant but a random unit.  &lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2016-02-26T18:16:34.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24571" PostTypeId="2" ParentId="24538" CreationDate="2016-02-26T18:35:26.423" Score="1" Body="&lt;p&gt;To compare the performance among various model, you require &lt;strong&gt;realized volatility&lt;/strong&gt; or proxy of actual volatility (actual volatility is always unobservable). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Go through this paper (link provided below) where authors have explained how previous authors constructed realized volatility or actual volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Paper&lt;/strong&gt;: &lt;a href=&quot;http://faculty.washington.edu/ezivot/econ589/PoonGrangerJELsurvey.pdf&quot; rel=&quot;nofollow&quot;&gt;Forecasting Volatility in Financial Markets: A Review by Poon and Granger&lt;/a&gt;. This is one of &lt;strong&gt;&lt;em&gt;most finest paper&lt;/em&gt;&lt;/strong&gt;, where authors reviewed 93 papers related to volatility forecasting and cover each and every aspects in details. &lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2016-02-26T18:35:26.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24572" PostTypeId="2" ParentId="24545" CreationDate="2016-02-26T18:50:38.807" Score="7" Body="&lt;p&gt;Tsay's Analysis of Financial Time Series should be what you're looking for.  &lt;/p&gt;&#xA;" OwnerUserId="12203" LastActivityDate="2016-02-26T18:50:38.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24573" PostTypeId="2" ParentId="24561" CreationDate="2016-02-26T19:04:06.663" Score="1" Body="&lt;p&gt;Look at the CMEgroup web site. 1300 means 130.0, 1305 would mean 130.5, etc. The decimal point is implicit. The minimum increment in the strike is 0.5.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2016-02-26T19:04:06.663" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24574" PostTypeId="1" CreationDate="2016-02-26T19:57:31.470" Score="1" ViewCount="431" Body="&lt;p&gt;&lt;strong&gt;I tried this as a simulation for a GARCH(1,1) model. Is it correct?&lt;/strong&gt; (I'm not speaking about the code itself, which works, but the underlying idea).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is plot (of &lt;code&gt;sigma&lt;/code&gt;, &lt;code&gt;r&lt;/code&gt; the returns, and the simulated asset price &lt;code&gt;x&lt;/code&gt;) and Python code:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/09vDn.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/09vDn.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import numpy as np&#xA;import matplotlib.pylab as plt&#xA;&#xA;n = 1000 * 100&#xA;eps = np.random.normal(0, 1, n)&#xA;sigma0, a, b, c = 0.0002, 0.0000002, 0.5, 0.4&#xA;sigma = np.ones(n) * sigma0&#xA;r = np.zeros(n)&#xA;&#xA;for i in range(1,n):&#xA;    sigma[i] = np.sqrt(a + b * r[i-1] ** 2 + c * sigma[i-1] ** 2)&#xA;    r[i] = sigma[i] * eps[i]&#xA;&#xA;x = np.cumsum(r) + 1.2       # summing the returns; starts at 1.20, see EUR/USD&#xA;&#xA;f, ax = plt.subplots(3)&#xA;&#xA;ax[0].plot(sigma)&#xA;ax[1].plot(r)&#xA;ax[2].plot(x)&#xA;plt.show()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="18444" LastActivityDate="2016-02-26T19:57:31.470" Title="Is this a GARCH Monte-Carlo simulation?" Tags="&lt;monte-carlo&gt;&lt;garch&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24575" PostTypeId="1" AcceptedAnswerId="24580" CreationDate="2016-02-26T20:09:04.550" Score="6" ViewCount="1355" Body="&lt;p&gt;I was wondering if someone could provide some guidance to me. I would like to &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Combine various financial data of mixed frequencies (some daily,&#xA;weekly, some quarterly) to  a composite index. I have been reading&#xA;about MIDAS, but that seems to be high frequency to low frequency. &#xA;Maybe I am missing something there. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Predict monthly forecasts of a time series using mixed frequency data&#xA;(similar to the above).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="13527" LastEditorUserId="19645" LastEditDate="2016-03-02T14:59:17.663" LastActivityDate="2019-09-25T22:11:34.290" Title="Modelling and forecasting mixed frequency financial data" Tags="&lt;modeling&gt;&lt;regression&gt;&lt;forecasting&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24576" PostTypeId="2" ParentId="24529" CreationDate="2016-02-26T20:09:42.647" Score="1" Body="&lt;p&gt;This is a subtle point in Mathematical Optimization. The point is: in a &quot;group constraint&quot; the coefficients in the constraint are (implicitly) all equal to 1. In a linear inequality constraint the coefficients can be anything, although in the specific example given they are equal to one (nevertheless in general you can set them to anything you wish by assigning to the variable A).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Internally group constraints are handled specially, which makes the implementation more efficient (the program don't have to store the coefficients for one thing), especially if you have large numbers of them. The general linear constraints are handled as any linear inequality is in LP or QP.  If you are not concerned about maximum program efficiency this does not matter to you and you could use the general type constraints always.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The special fast programming techniques that are used internally to deal with Group Constraints are called GUB (Generalized Upper Bound) and VUB (Variable Upper Bound). As you can see from the manual Group Constraints are a new feature that was added to MATLAB in 2011.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-02-26T20:52:58.177" LastActivityDate="2016-02-26T20:52:58.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24577" PostTypeId="2" ParentId="24560" CreationDate="2016-02-26T20:17:00.350" Score="0" Body="&lt;p&gt;I think the answer needs to address why the question is being asked.  Some industries such as utilities obsess over this model.  Utilities are highly regulated and will use this framework to argue for rate increases to regulators.  Other industries, not so such. It would likely be a severely career limiting move to use the SML to suggest a purchase at a buy side fixed income shop.  Systemic risk is very important, but the SML framework is based on some very strict efficient markets assumptions which are fictional.  Remember, this is a textbook you are referring to and not the real world. To answer your last point, I know someone who sold his company to a much larger company, and part of the pricing was to look at the amount and variability of his cash flows and compare it to what the market was requiring at the time. &lt;/p&gt;&#xA;" OwnerUserId="19627" LastActivityDate="2016-02-26T20:17:00.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24578" PostTypeId="2" ParentId="24575" CreationDate="2016-02-26T20:36:39.983" Score="1" Body="&lt;p&gt;To address the second question: I've done a couple of different things. When I did not care much about the result, I just took a straight line interpolation or fit a curve to make, for example quarterly into monthly.  When I did care, and it was a lot of work, I found a monthly or weekly series similar to the lower frequency series, and used the changes in the higher frequency data to generate the lower.  For example, although it's not what I did, but just for an example you could generate a weekly unemployment rate out of the monthly number by using the changes in the weekly claims numbers.  &lt;/p&gt;&#xA;" OwnerUserId="19627" LastEditorUserId="19627" LastEditDate="2016-02-26T21:14:43.843" LastActivityDate="2016-02-26T21:14:43.843" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24580" PostTypeId="2" ParentId="24575" CreationDate="2016-02-26T20:55:21.000" Score="6" Body="&lt;p&gt;MIDAS is useful when you have a low frequency series and you want to include high frequency data in the regression. So for instance, if you want to forecast quarterly GDP data and want to include daily S&amp;amp;P 500 data as a regressor instead of just using the quarter end value of S&amp;amp;P 500. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually we assume that the causality runs from S&amp;amp;P 500 to GDP. It becomes trickier when you start thinking about the impact of lagged GDP on S&amp;amp;P 500. You can usually get away with some kind of ad hoc adjustment like filling in the GDP growth rate for each daily period as equal to the quarterly growth rate, but it won't necessarily capture the relationship properly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;State space methods, such as Kalman Filters, are another common approach to handling mixed data series. The Philly Fed's ADS business conditions index and the literature on Nowcasting use this. It's a large, complicated literature that is probably beyond a small post to summarize. To get a general sense of the approach, they assume that the data is missing and then use Kalman Filters to estimate parameters given the missing data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another approach is to use a combination of forecasting models. In the above S&amp;amp;P 500 and GDP example, you could use a daily forecasting model that includes GDP and a quarterly forecasting model that includes it. You can use the daily model to forecast iteratively out for the remainder of the quarter and then use the quarterly model thereafter. This approach could be made significantly richer with monthly models, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With respect to your second question, the hard part is estimating the model. Once you have the model set up and estimate the parameters of it, forecasting is usually straightforward.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2016-02-26T20:55:21.000" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24581" PostTypeId="2" ParentId="22955" CreationDate="2016-02-26T21:39:16.433" Score="0" Body="&lt;p&gt;You should be also keep in mind that you are not constrained only to normal and t.  The framework you have would go well with a copula function in which you could choose a very wide variety of distributions and relationships between the variables.  However, if your project is for compliance or regulators then you might be creating a lot of work for yourself to educate them on what that method does.    &lt;/p&gt;&#xA;" OwnerUserId="19627" LastActivityDate="2016-02-26T21:39:16.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24582" PostTypeId="2" ParentId="24518" CreationDate="2016-02-27T01:22:57.547" Score="1" Body="&lt;p&gt;In a Black-Scholes world a portfolio of options (some calls, some puts) of different maturities and strikes on the same underlying still has one delta and one gamma, which can be calculated by summing over the deltas and gammas. So you still have the same setup as with a single option situation.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2016-02-27T01:22:57.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24584" PostTypeId="2" ParentId="24544" CreationDate="2016-02-27T06:55:38.777" Score="0" Body="&lt;p&gt;To put it simply, $\Delta(t)$ is the change in your stock price in a very small interval. Say, if you measure your stock every minute. The value of your stock is a random variable because you don't know where it will end up with. The randomness every minute you can observe would be $\Delta(t)$.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2016-02-27T06:55:38.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24585" PostTypeId="1" CreationDate="2016-02-27T07:57:19.867" Score="3" ViewCount="319" Body="&lt;p&gt;How should I determine what frequency should I use for doing microstructure research using intraday data? For some reason, there seems to be general consensus of using 5 minute interval, but is there any advantage to this over higher frequencies if e.g. 1 minute data is available?&lt;/p&gt;&#xA;" OwnerUserId="18607" LastActivityDate="2019-08-08T16:02:39.983" Title="Intraday data frequency" Tags="&lt;research&gt;&lt;market-microstructure&gt;&lt;intraday&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24586" PostTypeId="2" ParentId="567" CreationDate="2016-02-27T08:47:43.440" Score="2" Body="&lt;p&gt;I see the question and answers are rather old here but I just ran across &lt;a href=&quot;https://www.quandl.com&quot; rel=&quot;nofollow&quot;&gt;quandl&lt;/a&gt; which provides access to a variety of &lt;a href=&quot;https://www.quandl.com/data/SEC/documentation/documentation&quot; rel=&quot;nofollow&quot;&gt;SEC data&lt;/a&gt; with a free API key.&lt;/p&gt;&#xA;" OwnerUserId="19667" LastActivityDate="2016-02-27T08:47:43.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24587" PostTypeId="2" ParentId="23085" CreationDate="2016-02-27T09:03:09.270" Score="0" Body="&lt;p&gt;There are many definitions of market cap and it is likely that depending on specific views and goals of different platforms or investment teams, one or several might get used.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are some variants I have been exposed to :&#xA;1) Definition given by Fenix. This is the most intuitive. A few questions asked frequently around that : &#xA;a) What if a class is dual listed and has different prices ? &#xA;b) What if a class is not listed ? &#xA;c) Do you want the full market cap or the free float ? &#xA;d) Also for some countries you might ask what part of this market cap is available to foreign investors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Market Cap equivalent for a specific security... will be useful to have a Price to Earnings metrics for example. So each security has an equivalent market cap which is then used for ratios computations. Be aware that this number might need to be different depending on share structure (sometimes preferred have different attribution of earnings, so PE would need to be adjusted while BM wouldn't)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in conclusion, I would ask myself : WHY do I want to use this market cap for ? And from there build my own formula and accept that there can be variations to what others think,compute and report.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good luck !&lt;/p&gt;&#xA;" OwnerUserId="19661" LastActivityDate="2016-02-27T09:03:09.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24588" PostTypeId="2" ParentId="24585" CreationDate="2016-02-27T09:30:16.883" Score="4" Body="&lt;p&gt;I think the answer is driven by asking yourself a few questions : &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If you are a practitioner at what frequency are you able to trade and want to trade ? (you are limited by this so no need to go to higher frequencies than that in any case)&lt;/li&gt;&#xA;&lt;li&gt;What effect(s) do you want to study ? &lt;/li&gt;&#xA;&lt;li&gt;What is a common frequency used by practitioners or academics for the question you have. Maybe which frequency is best becomes the question you want to study. You can form an opinion/intuition ex-ante as well.&lt;/li&gt;&#xA;&lt;li&gt;Potentially computing time and resources (tick by tick can grow to a lot of data very quickly)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I have seen people use from a 1 hour aggregation to the tick by tick full book level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few examples of academic paper with different aggregations :&#xA;&lt;a href=&quot;https://www.scheller.gatech.edu/directory/faculty/lee_s/pubs/Jump2-1-12.pdf&quot; rel=&quot;nofollow&quot;&gt;https://www.scheller.gatech.edu/directory/faculty/lee_s/pubs/Jump2-1-12.pdf&lt;/a&gt; (analyst estimates impact on price, done at 30 min intervals)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.researchgate.net/profile/Paresh_Narayan/publication/281200352_Intraday_volatility_interaction_between_the_crude_oil_and_equity_markets/links/55dabe1f08aed6a199aaf80c.pdf&quot; rel=&quot;nofollow&quot;&gt;https://www.researchgate.net/profile/Paresh_Narayan/publication/281200352_Intraday_volatility_interaction_between_the_crude_oil_and_equity_markets/links/55dabe1f08aed6a199aaf80c.pdf&lt;/a&gt; (oil price impact done at 5 min intervals)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.researchgate.net/profile/Shaojun_Zhang3/publication/228302398_An_Improved_Estimation_Method_and_Empirical_Properties_of_the_Probability_of_Informed_Trading/links/00b495368bafd7961a000000.pdf&quot; rel=&quot;nofollow&quot;&gt;https://www.researchgate.net/profile/Shaojun_Zhang3/publication/228302398_An_Improved_Estimation_Method_and_Empirical_Properties_of_the_Probability_of_Informed_Trading/links/00b495368bafd7961a000000.pdf&lt;/a&gt; (probability of informed trading on a tick by tick level)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you specify which type of questions you want to answer, others might have more specific suggestions on which interval to use.&lt;/p&gt;&#xA;" OwnerUserId="19661" LastActivityDate="2016-02-27T09:30:16.883" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24589" PostTypeId="1" CreationDate="2016-02-27T11:21:38.147" Score="4" ViewCount="125" Body="&lt;p&gt;ES futures price data is easy to find, e.g. on &lt;a href=&quot;https://finance.yahoo.com/echarts?s=ESH16.CME%20Interactive#%7B%22range%22:%221d%22,%22allowChartStacking%22:true%7D&quot;&gt;Yahoo finance&lt;/a&gt; or with a free NinjaTrader demo account. I'm looking for the same for options on that futures contract.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best I could find is the current price, e.g. at &lt;a href=&quot;http://www.barchart.com/commodityfutures/E-Mini_S%26P_500_Futures/options/ES?view=split&quot;&gt;BarChart&lt;/a&gt; and &#xA;&lt;a href=&quot;http://www.commoditycharts.com/options/E-Mini_S&amp;amp;P_500/ESH16/&amp;amp;mode=i&amp;amp;view=&quot;&gt;CommodityCharts&lt;/a&gt;, but I'd like to see the price movement, at least over the last day. It doesn't need to be very precise - something like the Yahoo chart would be just fine.&lt;/p&gt;&#xA;" OwnerUserId="19587" LastActivityDate="2016-03-08T22:51:34.080" Title="Where to find E-mini S&amp;P options price data or chart?" Tags="&lt;options&gt;&lt;market-data&gt;&lt;futures&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24590" PostTypeId="2" ParentId="24548" CreationDate="2016-02-27T16:18:32.703" Score="2" Body="&lt;p&gt;For equities, the futures contracts are so short dated that there is no significant correction between futures and forwards.  In any case, the corrleation between equities and rates averages fairly close to zero over the long term.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For bonds, there is obviously a large negative correlation with rates.  However once again, the futures contracts that are traded are so short dated that the correction is still negligible.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Eurodollar contract is the futures contract where the convexity correction is highly significant.  That's because the contracts are long dated, with a high negative correlation with rates.   &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-02-27T16:18:32.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24591" PostTypeId="1" AcceptedAnswerId="24900" CreationDate="2016-02-27T17:37:07.013" Score="2" ViewCount="342" Body="&lt;p&gt;I came up with the idea of dealing with investor's sentiment effect in stock market in my thesis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to know which proxies you would suggest to use as sentiment index and from which source I can get data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next to that I would like to find data on certain industries performance so I'm looking for &lt;em&gt;industry&lt;/em&gt; performance index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where can i have access to that given that my university doesn't have access to Bloomberg?&lt;/p&gt;&#xA;" OwnerUserId="19623" LastEditorUserId="467" LastEditDate="2016-04-15T03:13:38.273" LastActivityDate="2016-06-14T04:51:34.187" Title="Which proxies to user for investor sentiment and industry performance, and where to find the data?" Tags="&lt;equities&gt;&lt;market-data&gt;&lt;investing&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24592" PostTypeId="1" CreationDate="2016-02-27T18:10:09.777" Score="1" ViewCount="487" Body="&lt;p&gt;I am interested in how to calculate order flow intensity. I got access to high frequency data and can simulate a limit order book. What is the best approach if I want to calculate order flow intensity?&lt;/p&gt;&#xA;" OwnerUserId="19673" LastActivityDate="2016-02-29T06:34:15.963" Title="Order flow intensity" Tags="&lt;limit-order-book&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24595" PostTypeId="1" AcceptedAnswerId="24598" CreationDate="2016-02-28T04:02:56.407" Score="4" ViewCount="3381" Body="&lt;p&gt;In CAPM, we assume people are risk-averse and people get compensated for the systematic risk they suffer. The assumption that most people are risk-averse makes sense, but why are the rational investors also risk-averse? Consider the following example, suppose investment $i$ has an expected return of $10\%$ and beta coefficient $2$ while another safer investment offers $5\%$ but is virtually risk free. By the weak law of large numbers, investment $i$'s average return rate will be close to $10\%$ if many years passes. In fact, if invested for many years, this investment can be seen as an investment with $10\%$ return but less risky because the distribution for the average return rate has less and less varaince as the number of years increases. So a &lt;em&gt;rational&lt;/em&gt; investor should understand it and simply choose the investment with the risk premium. The idea is in the long run, yearly varaince on return diminishes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions or criticisms are appreciated.&lt;/p&gt;&#xA;" OwnerUserId="18661" LastEditorUserId="18661" LastEditDate="2016-03-04T05:17:08.873" LastActivityDate="2016-03-04T05:17:08.873" Title="Why are investors risk-averse?" Tags="&lt;risk&gt;&lt;capm&gt;" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24597" PostTypeId="1" CreationDate="2016-02-28T09:51:18.433" Score="2" ViewCount="141" Body="&lt;p&gt;I have a stock process which I have decided to model as $$S_T=S_t\exp((r-q-\frac{1}{2}\sigma^2)(T-t)+\sigma(W_T-Wt))-D_T$$ where $D_T$ is a cash dividend at time $T$. This dividend is known. I then calculated its second moment as $$\mathbb{E}(S_T^2)=[S_t\exp((r-q)(T-t))]^2\exp(\sigma^2(T-t))-2D_TS_t\exp((r-q)(T-t))+D_T^2$$ My questions is, how would this expression change if there were say $n$ dividends (all different) between times 0 and T. &lt;/p&gt;&#xA;" OwnerUserId="19606" LastEditorUserId="16991" LastEditDate="2016-02-28T18:13:32.007" LastActivityDate="2016-05-28T20:11:55.443" Title="Second Moment of Stock Process" Tags="&lt;stochastic-calculus&gt;&lt;moments&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24598" PostTypeId="2" ParentId="24595" CreationDate="2016-02-28T11:16:09.893" Score="5" Body="&lt;p&gt;Below you find some observations...&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In CAPM, we assume people are risk-averse and people get compensated&#xA;  for the systematic risk they suffer.&#xA;  The assumption that most people are risk-averse makes sense, but why&#xA;  are the rational investors also risk-averse?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The &quot;rational investors&quot; prefer high (expected) returns and low volatity. In this sense, the rational investors are risk-averse and ask premiums (higher returns) to take more risks (more volatile investments). &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Consider the following example, suppose investment $i$ as an&#xA;  expected return of 10% and beta coefficient 2 while another&#xA;  safer investment offers 5% but is virtually risk free. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Ok...&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;By the weak law of large numbers, investment $i$'s average return rate will&#xA;  be close to 5% if many years passes.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;No. Investment $i$'s annual expected return is $10\%$, with an unspecified annual volatility $\sigma &amp;gt; 0$. Theoretically speaking, after many years the annual return rate is still $10\%$. Indeed $10\%$ is the &lt;strong&gt;expected&lt;/strong&gt; annual return rate.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In fact, if invested for many years, this investment can be seen as&#xA;  an investment with 10% return but less risky because the distribution&#xA;  for the average return rate has less and less varaince as the number&#xA;  of years increases.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Actually, the volatility increases in $\sqrt{T}$ where $T$ is the time. So if the annual volatility for investment $i$ is $\sigma = 2$, the volatility for $T = 4$ (years) is $\sigma_{T=4} = \sigma * \sqrt{4} = 2 * 2 = 4$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Conversely, the (virtually) risk-free asset has a $5\%$ annual return rate and zero volatility.&lt;/p&gt;&#xA;" OwnerUserId="19515" LastActivityDate="2016-02-28T11:16:09.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24599" PostTypeId="2" ParentId="24403" CreationDate="2016-02-28T12:18:07.187" Score="1" Body="&lt;p&gt;Many pension funds and mutual funds acquire small positions in many stocks, therefore just banking on the main results of the Markowitz framework: diversification. This could also just be seen as a plain 1/N rule: &lt;a href=&quot;http://breakingdownfinance.com/finance-topics/modern-portfolio-theory/naive-diversification/&quot; rel=&quot;nofollow noreferrer&quot;&gt;naive diversification&lt;/a&gt;. In the limit, this just equals the market portfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, to overcome the sensitivity in changes in the return/ variance-covariance matrix, you could apply &lt;a href=&quot;https://quant.stackexchange.com/questions/4228/michauds-resampled-efficient-frontier-out-of-sample-simulation-testing&quot;&gt;Michaud's method&lt;/a&gt; (resampled efficient frontier) method to portoflio construction.  &lt;/p&gt;&#xA;" OwnerUserId="13950" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-02-28T12:18:07.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24600" PostTypeId="2" ParentId="24595" CreationDate="2016-02-28T12:26:27.453" Score="2" Body="&lt;p&gt;I am not sure i follow your question but there are a few points worth making&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Investors can and do (based on their utility function) chose the highest return/highest risk investment. The assumption in CAPM about risk adversity is that for the same level of expected return, investors will always choose the investment with less risk.&lt;/li&gt;&#xA;&lt;li&gt;On the long run your point is correct and is included in the definition of expected return. &lt;strong&gt;However&lt;/strong&gt; some investors prefer different level of risk based on their constraints and marginal use for more or less money (utility function). Imagine someone who is retired that needs to pay a fixed amount every year for his expenses. He would rather choose an investment that brings an almost certain (or certain) amount every year that match his expenses rather than one that has a chance of bringing 0 returns or worse :) Even if the expected return is higher. If you have an unlimited or very long investment horizon with no constraints on what you use the returns for and you can sleep at night not worrying about your money then obviously you would prefer a higher risk/higher return proposition. It's all about the investor preference and constraints.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Two final notes on that last point : &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;This is in no way contradicting CAPM (see my first point above)&lt;/li&gt;&#xA;&lt;li&gt;In real life though, you never know the real expected return of an investment nor the exact level of risk so people act on perception of those... Food for thoughts.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="19661" LastActivityDate="2016-02-28T12:26:27.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24601" PostTypeId="1" CreationDate="2016-02-28T14:25:17.643" Score="5" ViewCount="6772" Body="&lt;p&gt;I've got a question about 1976 Black Model and Bachelier model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that a geometric brownian motion in the P measure $dS_{t}=\mu S_{t}dt+\sigma S_{t} dW_{t}^{P}$ for a stock price $S_{t}$ leads (after a change of measure) to the Black-Scholes formula for a Call:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C= S_{0} N(d_{1}) − Ke^{−rT} N(d_{2})$$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $d_{1} = \frac{ln(\frac{S_{0}}{K})+(r+\frac{1}{2}\sigma^{2})T}{\sigma\sqrt{T}}$ and $d_{2}=d_{1}-\sigma \sqrt{T}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I actually don't know how's possible to get the famous black formula on a forward contract: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C= e^{−rT}(F N(d_{1}) − KN(d_{2}))$$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where now &#xA;$d_{1} = \frac{ln(\frac{F}{K})+\frac{1}{2}\sigma^{2}T}{\sigma\sqrt{T}}$&#xA;and $d_{2}=d_{1}-\sigma \sqrt{T}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should I simply insert $F(0,T)=S_{0}e^{rT}$ in the first BS formula to get the second one? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm asking this because I've tried to derive the BS formula using an arithmetic brownian motion like $dS_{t}=\mu dt+\sigma dW_{t}^{P}$, and I get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C= S_{0} N(d) + e^{−rT}[v n(d)-K N(d)]$$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &#xA;$d=\frac{S_{0}e^{rT}-K}{v}$ and $v=e^{rT}\sigma\sqrt{\frac{1-e^{−2rT}}{2r}}$ and remembering that $N(d)$ and $n(d)$ are the CDF and PDF.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but the previous substitution $F(0,T)=S_{0}e^{rT}$ doesn't seems to lead to the known result $C= e^{−rT}[(F-K)N(d)-\sigma\sqrt{T}n(d)]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where now $d=\frac{F-K}{\sigma\sqrt{T}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think I could reach the equations on forward both in the geometric brownian motion and arithmetic brownian motion using the equations&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dF=F\sigma dW_{t}^{Q}$ and $dF=\sigma dW_{t}^{Q}$ but I don't know how justify the use of them.&lt;/p&gt;&#xA;" OwnerUserId="19683" LastEditorUserId="467" LastEditDate="2016-03-03T06:29:45.850" LastActivityDate="2019-08-20T21:42:16.887" Title="How to derive Black's formula for the valuation of an option on a future?" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;pricing&gt;&lt;forward&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24602" PostTypeId="1" CreationDate="2016-02-28T17:23:57.453" Score="1" ViewCount="972" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/y7D63.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/y7D63.jpg&quot; alt=&quot;Exercise&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/9PByb.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/9PByb.jpg&quot; alt=&quot;Results&quot;&gt;&lt;/a&gt;&#xA;I have a question regarding how the risk is calculated, if I have only the returns. I think the risk premium (rp) is just the average of the returns and the sharpe ratio is the risk premium divided by the total risk. Let me know if I am mistaken.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But how do they calculate the risk? Thanks in advance!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS:The exercise is in the attached pictures.&lt;/p&gt;&#xA;" OwnerUserId="19685" LastActivityDate="2016-02-28T17:52:25.497" Title="Calculate total risk" Tags="&lt;risk&gt;&lt;returns&gt;&lt;sharpe-ratio&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2016-02-29T07:27:49.820" ContentLicense="CC BY-SA 3.0" />
  <row Id="24603" PostTypeId="2" ParentId="24602" CreationDate="2016-02-28T17:52:25.497" Score="1" Body="&lt;p&gt;Notice that the problem does not give you a risk-free investment, so the computation of the Sharpe ratio becomes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$SR = \frac{E(r)}{\sqrt{VAR(r)}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Year 1:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_{p} = E(r) = \frac{1}{n}\sum_{i = 1}^{n}{r_{i}} = \frac{1}{4}(-2 + 6 - 2 + 6) = \frac{1}{4}(8) = 2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma(r_{p}) = \sqrt{VAR(r)} = \sqrt{\frac{1}{n}\sum_{i = 1}^{n}{(r_{i} - r_{p})^{2}}} = \sqrt{\frac{1}{4}((-4)^{2} + 4^{2} + (-4)^{2} + 4^{2})} = \sqrt{\frac{1}{4}(16 + 16 + 16 + 16)} = \sqrt{\frac{1}{4}(64)} = \sqrt{16} = 4$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$SR = \frac{2}{4} = 0.5$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Year 2:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_{p} = E(r) = \frac{1}{n}\sum_{i = 1}^{n}{r_{i}} = \frac{1}{4}(-6 + 18 - 6 + 18) = \frac{1}{4}(24) = 6$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma(r_{p}) = \sqrt{VAR(r)} = \sqrt{\frac{1}{n}\sum_{i = 1}^{n}{(r_{i} - r_{p})^{2}}} = \sqrt{\frac{1}{4}((-12)^{2} + 12^{2} + (-12)^{2} + 12^{2})} = \sqrt{\frac{1}{4}(144 + 144 + 144 + 144)} = \sqrt{\frac{1}{4}(576)} = \sqrt{144} = 12$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$SR = \frac{6}{12} = 0.5$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Year 1+2:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_{p} = E(r) = \frac{1}{n}\sum_{i = 1}^{n}{r_{i}} = \frac{1}{8}(-2 + 6 - 2 + 6 - 6 + 18 - 6 + 18) = \frac{1}{8}(32) = 4$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma(r_{p}) = \sqrt{VAR(r)} = \sqrt{\frac{1}{n}\sum_{i = 1}^{n}{(r_{i} - r_{p})^{2}}} = \sqrt{\frac{1}{2}((-6)^{2} + (-2)^{2} + (-6)^{2} + (-2)^{2} + (-10)^{2} + 14^{2} + (-10)^{2} + 14^{2})} = \sqrt{\frac{1}{8}(36 + 4 + 36 + 4 + 100 + 196 + 100 + 196)} = \sqrt{\frac{1}{8}(672)} = \sqrt{84} = 9.165$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$SR = \frac{4}{9.165} = 0.436$&lt;/p&gt;&#xA;" OwnerUserId="19515" LastActivityDate="2016-02-28T17:52:25.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24604" PostTypeId="1" CreationDate="2016-02-28T18:19:00.627" Score="1" ViewCount="84" Body="&lt;p&gt;Let's take an example : Hewlett Packard. The company is listed on both Nasdaq and Nyse. Correct me if I am wrong but as we can trade it on 2 different stock exchanges the price of the stock may diverge slightly between them. Therefore I don't understand why my broker proposes HP only on Nyse and not Nasdaq. It seem to be the case everywhere : for instance, Google finance exposes HP only on Nyse.&lt;/p&gt;&#xA;" OwnerUserId="19015" LastEditorUserId="19015" LastEditDate="2016-02-28T19:15:17.063" LastActivityDate="2016-02-28T19:15:17.063" Title="How to choose the stock exchange to trade a stock?" Tags="&lt;equities&gt;&lt;nasdaq&gt;&lt;nyse&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24605" PostTypeId="2" ParentId="24597" CreationDate="2016-02-28T18:22:05.720" Score="2" Body="&lt;p&gt;If $D_i$ is dividend paid at time $t_i \in [t, T]$ , then future value of all dividends payments (assuming payments are known in advance), $D$, is:&#xA;$$D= \sum_{i=i}^{n} D_i e^{r(T-t_i)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since all payments are known in advance, $D$ is constant like $D_T$ ( in your example). So, just &lt;strong&gt;replace&lt;/strong&gt; $D$ with $D_T$ in your expression of $\mathbb{E}(S_t^2)$, you will get desired result.  &lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="16991" LastEditDate="2016-02-28T18:28:35.910" LastActivityDate="2016-02-28T18:28:35.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24606" PostTypeId="1" AcceptedAnswerId="24607" CreationDate="2016-02-28T18:28:59.863" Score="4" ViewCount="203" Body="&lt;p&gt;I'm trying to understand delta hedging. If I sell a plain vanilla call option, in order to delta hedge it, I have to buy delta amount of stocks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I don't understand is that the BS price of the call is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C = SN(d_1) - e^{-rT}XN(d_2)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to construct the hedge portfolio which has the same value as the option price at any time. But the option price consists of 2 terms, not just the delta term.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What about the second term? Why don't I need it for hedging?&lt;/p&gt;&#xA;" OwnerUserId="13477" LastEditorUserId="467" LastEditDate="2016-02-29T04:24:33.463" LastActivityDate="2016-02-29T07:01:23.103" Title="Why is $N(d_2)$ not needed for hedging?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;hedging&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24607" PostTypeId="2" ParentId="24606" CreationDate="2016-02-28T19:24:31.930" Score="8" Body="&lt;p&gt;The point is the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Delta, $\Delta$, is defined as $\frac{\partial C}{\partial S}$, where $C$ is the value of the call option, and $S$ is the price of the underlying asset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, given that the value of a call option for a non-dividend-paying underlying stock in terms of the Black–Scholes parameters is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C = N(d_{1})S - N(d_{2})Ke^{-rT},$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta = \frac{\partial C}{\partial S} = N(d_{1}).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, Delta is just the first partial derivative of $C$ with respect to $S$.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How to derive $\Delta$&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$N(x)$ is the cumulative probability that a variable with a standardized normal distribution will be less than x;&lt;/li&gt;&#xA;&lt;li&gt;$N'(x)$ is the probability density function for a standardized normal distribution:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$$N'(X) = \frac{1}{\sqrt{2\pi}}e^{\frac{x^2}{2}}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, defining $\tau = T - t$, we have&#xA;$$ d_{1} = \frac{\ln(\frac{S}{K}) + (r + \frac{\sigma^2}{2})\tau}{\sigma\sqrt{\tau}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ d_{2} = \frac{\ln(\frac{S}{K}) + (r - \frac{\sigma^2}{2})\tau}{\sigma\sqrt{\tau}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It follows that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ N'(d_{1}) = N'(d_{2} + \sigma\sqrt{\tau}) = \frac{1}{\sqrt{2\pi}}e^{-\frac{(d_{2} + \sigma\sqrt{\tau})^2}{2}} = N'(d_{2})e^{-d_{2}\sigma\sqrt{\tau} - \frac{\sigma^2\tau}{2}} = N'(d_{2})\frac{Ke^{-r\tau}}{S}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$N'(d_{1})S = N'(d_{2})Ke^{-r\tau}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{\partial d_{1}}{\partial S} =  \frac{\partial d_{2}}{\partial S} = \frac{1}{S\sigma\sqrt{\tau}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since there is an $S$ in $N(d_{1})$ and $N(d_{2})$, we use the chain-rule:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{\partial C}{\partial S} = N(d_{1}) + \frac{\partial d_{1}}{\partial S} N'(d_{1})S - \frac{\partial d_{2}}{\partial S} N'(d_{2})Ke^{-r\tau} = N(d_{1}) + \frac{\partial d_{1}}{\partial S} N'(d_{1})S - \frac{\partial d_{2}}{\partial S} N'(d_{1})S = N(d_{1}) + \frac{1}{S\sigma\sqrt{\tau}} N'(d_{1})S - \frac{1}{S\sigma\sqrt{\tau}} N'(d_{1})S = N(d_{1}).$$&lt;/p&gt;&#xA;" OwnerUserId="19515" LastEditorUserId="19515" LastEditDate="2016-02-29T07:01:23.103" LastActivityDate="2016-02-29T07:01:23.103" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24608" PostTypeId="1" AcceptedAnswerId="24622" CreationDate="2016-02-28T23:23:32.387" Score="8" ViewCount="736" Body="&lt;p&gt;I see that institutions still use backtesting by computing P&amp;amp;Ls over historical data and then compute some aggregating ratios to see whether a trading strategy is &lt;em&gt;good&lt;/em&gt; or not even though it is not a rigourous approach at all. I mean, how can a trading strategy that happened to perform well in one sample path be guaranteed to perform as well out of sample ?&lt;/p&gt;&#xA;" OwnerUserId="19693" LastActivityDate="2016-02-29T15:14:31.863" Title="Why do institutions backtest?" Tags="&lt;backtesting&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24609" PostTypeId="2" ParentId="24608" CreationDate="2016-02-29T00:45:14.397" Score="9" Body="&lt;p&gt;Mostly because of &lt;strong&gt;convention and tradition&lt;/strong&gt;. As Student T mentioned earlier, part of this is that it is common practice. You report to your clients or managers how well something performed in the past; you cannot report to them how well it performed in the future. You may have thought of some useful forward-looking measures, but unfortunately the adoption rate in finance for these things is extremely slow. We still teach CAPM as the forefront in the leading business schools, even though this was introduced in the 1960s. We still credit novelists like Taleb for &quot;discovering&quot; non-Gaussian and black swan behavior in 2000s, even though the authors of the models that he critiques had themselves introduced jump diffusion models in the 1970s.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, I think you are making the implicit assumption here that regime shifts prevent you from applying your models out-of-sample:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;How can a trading strategy that happened to perform well in one sample&#xA;  path be guaranteed to perform as well out of sample ?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;There are &lt;em&gt;persistent&lt;/em&gt; phenomena across all time horizons: The low volatility anomaly, the strong dominance of certain factors in explaining returns, volatility clustering, sector correlations, arbitrage between specific symbols, order book properties. It's the presence of these persistent behaviors that motivate people to attempt to extract insight from past data.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2016-02-29T00:45:14.397" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24610" PostTypeId="2" ParentId="450" CreationDate="2016-02-29T01:38:04.757" Score="2" Body="&lt;p&gt;Intraday data can be downloaded at Yahoo Finance or Google Finance. Or use third party apps that already do that HQD &lt;a href=&quot;http://www.ashkon.com/downloader.html&quot; rel=&quot;nofollow&quot;&gt;http://www.ashkon.com/downloader.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19694" LastActivityDate="2016-02-29T01:38:04.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24611" PostTypeId="2" ParentId="18215" CreationDate="2016-02-29T01:42:09.747" Score="2" Body="&lt;p&gt;If 15 trading days 1-min data is enough for you, try HQD software&#xA;&lt;a href=&quot;http://www.ashkon.com/downloader.html&quot; rel=&quot;nofollow&quot;&gt;http://www.ashkon.com/downloader.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19695" LastActivityDate="2016-02-29T01:42:09.747" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24612" PostTypeId="2" ParentId="15672" CreationDate="2016-02-29T01:44:48.023" Score="1" Body="&lt;p&gt;You may try HQD software, downloads 1-min interval data from Yahoo or Google Finance &lt;a href=&quot;http://www.ashkon.com/downloader.html&quot; rel=&quot;nofollow&quot;&gt;http://www.ashkon.com/downloader.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19695" LastActivityDate="2016-02-29T01:44:48.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24613" PostTypeId="2" ParentId="18215" CreationDate="2016-02-29T04:56:22.210" Score="2" Body="&lt;p&gt;I would second Colin's proposal of Reuters Tick History or perhaps BB B-PIPE. The pricing model is especially attractive in your case since you are mainly interested in a finite subset of tickers, i.e. the S&amp;amp;P 500 composite, and they cover a very large set of exchanges.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The choice between exchange and data vendor is largely a matter of cost-to-symbols desired tradeoff. For a small number of symbols, a vendor package that gives you say, 1000 stock tickers and 50 options roots etc. is usually priced more competitively than the exchanges. On the other hand, buying directly from the exchange is useful if your goal is to acquire all the symbols. There's other trade-offs if you care about the cleanliness of the data &lt;em&gt;a lot&lt;/em&gt;, but I will reserve that for another time since I think it's unlikely conditioned that you're only interested in the S&amp;amp;P 500 composite.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2016-02-29T04:56:22.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24614" PostTypeId="2" ParentId="24592" CreationDate="2016-02-29T06:34:15.963" Score="2" Body="&lt;p&gt;Have a look to this paper, the methodology is well defined: &lt;a href=&quot;http://arxiv.org/abs/1312.0563&quot; rel=&quot;nofollow&quot;&gt;Simulating and analyzing order book data: The queue-reactive model, by Huang, L and Rosenbaum&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need first to define properly the events of which you want to estimate the intensity. I would suggest&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;insert&lt;/li&gt;&#xA;&lt;li&gt;cancel&lt;/li&gt;&#xA;&lt;li&gt;trade.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Then for each available tick of price $p$ (not each limit):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;normalize its size $Q_p$, for instance dividing it by the average limit order size, and rounding: $N_p:=[Q_p/L]$&lt;/li&gt;&#xA;&lt;li&gt;take $dt$ as the time to the next event affecting this queue $p$&lt;/li&gt;&#xA;&lt;li&gt;record the type of the event ${\cal T}\in\{$ insert, cancel, market$\}$&lt;/li&gt;&#xA;&lt;li&gt;just compute as estimate of $\lambda(p,{\cal T})=\mathbb{E}(dM(p,{\cal T})/dt)$:&#xA;$$\hat\lambda(p,{\cal T}):=\frac{\#\{e(\omega)={\cal T}, N_p(\omega)=N \}}{\#\{N_p(\omega)=N \}}\cdot\frac{1}{{\rm mean}(dt(\omega)|N_p(\omega)=N )}$$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;See the paper for exact definitions, but they are quite obvious: $\omega$ is &quot;&lt;em&gt;any event&lt;/em&gt;&quot;, and $\#\{ \cdot\}$ is the cardinal of a set. &#xA;Since the paper has been published in the &lt;em&gt;Journal of the American Statistical Association&lt;/em&gt; (110.509 (2015): 107-122), the statistical aspects are quite well defined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, there are questions about &lt;strong&gt;should you count time in seconds, or in &quot;events&quot;?&lt;/strong&gt; My opinion is seconds (i.e. physical time) is the best because for orderbook dynamics, the time to really take into account may be in events of all instruments related to the one you are looking at (ETFs, Futures, stocks of the same index, options, bonds, etc). Hence there is always something happening: take seconds, it is a good proxy of &quot;anything happened&quot;.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2016-02-29T06:34:15.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24615" PostTypeId="1" AcceptedAnswerId="24616" CreationDate="2016-02-29T09:38:04.760" Score="1" ViewCount="203" Body="&lt;p&gt;In the Black and Scholes model, when it is needed to immunize the portfolio from variations in the stock the argument given is the following. If $\alpha_t$ is the amount of invested in the stock, $\beta_t$ the amount in the bond, we construct a portfolio whose value is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;V_t = -C_t+\alpha_t\,S_t+\beta_t\,B_t,&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $C_t=f\left(t,S_t\right)$ is the price of a Call option and where $S_t$ and $B_t$ are, respectively, the price of the stock and the price of the bond at time $t$. So we are short selling one unit of the call and buying the portfolio whose $\alpha_t\,S_t+\beta_t\,B_t$. Now one chooses $x$ such that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{\partial V_t}{\partial S_t} = 0\Leftrightarrow -\frac{\partial C_t}{\partial S_t}+\alpha_t=0\Leftrightarrow \alpha_t = \frac{\partial C_t}{\partial S_t}\equiv \Delta_t.  &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What puzzles me is the fact that when deriving the value of the portfolio&#xA;we assume that $\alpha_t$ does not depend from  $S_t$ whereas the final solution does depend. So in principle one should do this computation &#xA;(assuming that $\beta_t$ does not depend on $S_t$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{\partial V_t}{\partial S_t} = -\frac{\partial C_t}{\partial S_t}+\alpha_t+\frac{\partial \alpha_t}{\partial S_t}\,S_t = 0&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;whose solution is of course different from $\alpha_t=\Delta_t$. Where am I wrong?&lt;/p&gt;&#xA;" OwnerUserId="18063" LastActivityDate="2016-02-29T10:44:26.403" Title="A simple question on Delta hedging" Tags="&lt;black-scholes&gt;&lt;hedging&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24616" PostTypeId="2" ParentId="24615" CreationDate="2016-02-29T10:44:26.403" Score="2" Body="&lt;p&gt;$\alpha_t$ must be chosen prior to stock price movements so the expression $S_t d\alpha $ does not make sense: we can't take a position in a stock based off information that we don't know yet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The missing step is that the replicating portfolio is required to be self financing: that is, for all $t$ the following equations hold: &#xA;$$X_t=\Delta S_t+\Gamma M_t$$ $$dX=\Delta dS+\Gamma dM$$ Where $X$ is the portfolio value and $S$ and $M$ are the stock and riskless asset.  The first equation states that no external asset is injected or removed at any time.  The second states that we cannot take a position in an asset based off information that is not available at time $t$ (since naively applying Ito's lemma to $X_t$ would yield a $d\Delta$ and $d\Gamma$ term).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Combining the two equations yields &#xA;$$dX=\Delta dS +r(X_t-\Delta S_t)dt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Matching this equation with $df(S, t)$ yields the correct PDE.  &lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2016-02-29T10:44:26.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24617" PostTypeId="1" AcceptedAnswerId="24639" CreationDate="2016-02-29T13:28:50.550" Score="11" ViewCount="1714" Body="&lt;p&gt;Persistence in volatility of stock returns is one of the common 'stylized facts' when it comes to analyzing time series. However, I am wondering for theoretical arguments why (estimated) volatility should have a long memory. One of the ideas I came across is to assume that information flow is slow and therefore news coming into the markets are not absorbed immediately but with some latency, leading to 'long-term-adjustments'. This explanation does not satisfy me completely, as the speed of trading and information processing should be much faster nowadays. &#xA;In my eyes, the picture has also changes with the financial crisis. Using the publicly available data from &lt;a href=&quot;http://realized.oxford-man.ox.ac.uk/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Oxford-Man Institute&lt;/a&gt;  I computed the auto-correlations of daily RV as proxies for volatility for 21 assets, divided into the period before the Lehman Crash and afterwards. &lt;a href=&quot;https://i.stack.imgur.com/ihuBV.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ihuBV.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt; Clearly, the persistence in the Realized Volatility decreased a lot, giving me a hard time to accept the persistence of volatility as something given...&#xA;So, what are different channels driving persistence in volatility, that can also explain such changes over time? &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Edit after 2.5 years (thanks for your comment @Jared:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A list of used assets is provided &lt;a href=&quot;https://realized.oxford-man.ox.ac.uk/data/assets&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;. For the sake of brevity I used the estimates based on &#xA;Realized Variance (10-min Sub-sampled). The figures can be replicated by running the following R-code (I updated it so it now also contains data until 2018 but the figures did not change at all). The code directly downloads the data from the realized library (thanks to Heber, Gerd, Asger Lunde, Neil Shephard and Kevin Sheppard (2009) to provide this rich database!).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;url &amp;lt;- &quot;https://realized.oxford-man.ox.ac.uk/images/oxfordmanrealizedvolatilityindices-0.2-final.zip&quot;&#xA;temp &amp;lt;- tempfile()&#xA;download.file(url, temp)&#xA;unzip(temp, &quot;OxfordManRealizedVolatilityIndices.csv&quot;)&#xA;&#xA;library(tidyverse)&#xA;data &amp;lt;- read_csv(&quot;OxfordManRealizedVolatilityIndices.csv&quot;, skip=2)&#xA;data &amp;lt;- data%&amp;gt;%select(matches('.rv10ss|DateID')) %&amp;gt;% na.omit()&#xA;&#xA;fit_before &amp;lt;- apply(data%&amp;gt;%filter(DateID&amp;lt;20060917)%&amp;gt;%select(-DateID),2 ,function(x) fit &amp;lt;- acf(x, lag=30))&#xA;fit_after &amp;lt;- apply(data%&amp;gt;%filter(DateID&amp;gt;=20060917)%&amp;gt;%select(-DateID),2 ,function(x) fit &amp;lt;- acf(x, lag=30))&#xA;&#xA;fit_before%&amp;gt;%&#xA;    map(function(x)x$acf) %&amp;gt;%&#xA;    bind_rows() %&amp;gt;% &#xA;    mutate(lag = 0:30) %&amp;gt;% &#xA;    gather(Asset, Autocorrelation, -lag) %&amp;gt;%&#xA;    ggplot(aes(x=lag, y = Autocorrelation, group=Asset)) + geom_line() + theme_bw()&#xA;&#xA;fit_after%&amp;gt;%&#xA;    map(function(x)x$acf) %&amp;gt;%&#xA;    bind_rows() %&amp;gt;% &#xA;    mutate(lag = 0:30) %&amp;gt;% &#xA;    gather(Asset, Autocorrelation, -lag) %&amp;gt;%&#xA;    ggplot(aes(x=lag, y = Autocorrelation, group=Asset)) + geom_line() + theme_bw()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="16249" LastEditorUserId="16249" LastEditDate="2018-08-30T13:08:07.827" LastActivityDate="2018-08-30T13:08:07.827" Title="Why is volatility said to be persistent?" Tags="&lt;volatility&gt;&lt;equities&gt;&lt;forecasting&gt;&lt;reference-request&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="24618" PostTypeId="2" ParentId="24617" CreationDate="2016-02-29T14:11:23.170" Score="-3" Body="&lt;p&gt;There are many models that do not assume constant volatility. For example, GARCH, OU, COX.&lt;/p&gt;&#xA;" OwnerUserId="19188" LastActivityDate="2016-02-29T14:11:23.170" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24619" PostTypeId="2" ParentId="24601" CreationDate="2016-02-29T14:28:26.067" Score="1" Body="&lt;h2&gt;European option on future&lt;/h2&gt;&#xA;&lt;p&gt;To price European Option on Future, you just need to replace &lt;span class=&quot;math-container&quot;&gt;$S_0$&lt;/span&gt; with &lt;span class=&quot;math-container&quot;&gt;$Fe^{-rT}$&lt;/span&gt; in your original BS formula or you can use risk neutral approach. Both will lead to same Valuation formula.&lt;/p&gt;&#xA;&lt;h2&gt;American option on future&lt;/h2&gt;&#xA;&lt;p&gt;Above procedure can not be used to price American option on future. In a paper, &lt;a href=&quot;https://www0.gsb.columbia.edu/mygsb/faculty/research/pubfiles/465/options_on_futures_contracts.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;The valuation of options on future contracts by  Ramaswamy&lt;/a&gt;, stated that&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;There are no known analytical solution to the valuation of American option on future contract.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Authors used implicit finite difference method to price American option on future contract.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h1&gt;Edit: Derivation of price of European option on future contract&lt;/h1&gt;&#xA;&lt;p&gt;Under risk neutral measure, future price, &lt;span class=&quot;math-container&quot;&gt;$F_t$&lt;/span&gt; satisfy following SDE:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$dF_t = \sigma F_t dW_t$$&lt;/span&gt;&#xA;where, &lt;span class=&quot;math-container&quot;&gt;$W_t$&lt;/span&gt; is a Wiener process. It can be easily shown that:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$F_T|F_t= F_t e^{-\frac{1}{2}\sigma^2 (T-t) + \sigma (W_T- W_t)} $$&lt;/span&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$$F_T|F_t \sim logN \left( ln(F_t) - \frac{1}{2}\sigma^2 (T-t), \sigma^2(T-t)\right) $$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;The price of option on future contract &lt;span class=&quot;math-container&quot;&gt;$(C_t)$&lt;/span&gt; under risk neutral measure is:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$C_t = e^{-r(T-t)}E_\mathbb{Q} [(F_T - K)^+]$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;You can easily solve the above expression to get the price of option written  on future. The distribution of &lt;span class=&quot;math-container&quot;&gt;$F_T$&lt;/span&gt; is very similar to &lt;span class=&quot;math-container&quot;&gt;$S_T$&lt;/span&gt; &lt;a href=&quot;https://quant.stackexchange.com/a/24454/16991&quot;&gt;(see this answer)&lt;/a&gt;. If you replace  &lt;span class=&quot;math-container&quot;&gt;$$ln(F_t) =ln(S_t) + r(T-t) $$&lt;/span&gt; then you will get the same distribution of &lt;span class=&quot;math-container&quot;&gt;$S_T$&lt;/span&gt; as under risk neutral measure. This is the reason, to get the price of option on future, we replace &lt;span class=&quot;math-container&quot;&gt;$S_t$&lt;/span&gt; with &lt;span class=&quot;math-container&quot;&gt;$F_t e^{-r(T-t)}$&lt;/span&gt; in BS model of European call option price.&lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-02-29T18:12:09.113" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24620" PostTypeId="1" CreationDate="2016-02-29T15:06:49.670" Score="1" ViewCount="582" Body="&lt;p&gt;I am currently switching from Java dev to quant and for my self-study I want to code a few auto-trading algorithms to get my hands on the subject. Are there any must know platforms/libs that I should use? Any that might be useful to know for employment as quant dev?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks &lt;/p&gt;&#xA;" OwnerUserId="19704" LastActivityDate="2020-05-19T13:02:00.603" Title="Java platform/lib widely use in industry" Tags="&lt;programming&gt;&lt;quantitative&gt;&lt;quants&gt;&lt;library&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24622" PostTypeId="2" ParentId="24608" CreationDate="2016-02-29T15:14:31.863" Score="6" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;How can a trading strategy that happened to perform well in one sample&#xA;  path be guaranteed to perform as well out of sample?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I think you are having it backwards - this is how I do it:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Intuition about some economic, psychological, behavioral, technical etc. phenomenon.&lt;/li&gt;&#xA;&lt;li&gt;Trying to make my intuition precise in the form of a hypothesis.&lt;/li&gt;&#xA;&lt;li&gt;Trying to translate my hypothesis into a trading strategy.&lt;/li&gt;&#xA;&lt;li&gt;Backtesting the trading strategy.&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;In case it does not work: Falsification of my intuition&lt;/li&gt;&#xA;&lt;li&gt;in case it does work: More tests (robustness), and with some refined intuition back to step 1.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Basically this is how the &lt;a href=&quot;https://en.wikipedia.org/wiki/Scientific_method#Elements_of_the_scientific_method&quot; rel=&quot;noreferrer&quot;&gt;scientific method&lt;/a&gt; works when doing research on the stock market. At least this is how it should be, so I somewhat agree with your insinuation that just data mining stock market data to find &lt;em&gt;something&lt;/em&gt; is bad science (&quot;Torture the data until they confess&quot; ;-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, yes, it is not perfect - but it is the best we have to try to find the signal in the noise (and there is a lot of noise...)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A good starting point to understand more about this approach is this book:&lt;br&gt;&#xA;&lt;a href=&quot;http://books.google.de/books?id=jbD47VkOHAEC&amp;amp;lpg=PP1&amp;amp;dq=evidence%20based%20technical%20analysis&amp;amp;hl=en&amp;amp;pg=PP1#v=onepage&amp;amp;q&amp;amp;f=false&quot; rel=&quot;noreferrer&quot;&gt;Evidence-based technical analysis by David Aronson&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It explains the whole process (including the complete statistical background).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See for a short summary of important points here: &lt;a href=&quot;http://www.cxoadvisory.com/2526/technical-trading/evidence-based-technical-analysis-applying-the-scientific-method-and-statistical-inference-to-trading-signals-chapter-by-chapter-review/&quot; rel=&quot;noreferrer&quot;&gt;CXO Advisory&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See for a comprehensive review here: &lt;a href=&quot;http://www.automated-trading-system.com/evidence-based-technical-analysis-aronson-book/&quot; rel=&quot;noreferrer&quot;&gt;Automated trading system&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2016-02-29T15:14:31.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24623" PostTypeId="2" ParentId="24620" CreationDate="2016-02-29T15:19:18.997" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://strata.opengamma.io/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Strata&lt;/a&gt;  seems like a fairly well designed library, which is an open source library designed by OpenGamma. From their docs&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Strata allows financial systems developers to build or enhance&#xA;  existing  applications with standardized, off-the-shelf market risk&#xA;  components.  It provides all the core concepts and market risk&#xA;  functionality at the heart of the OpenGamma Platform, including:&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;Pricing, financial analytics and curve calibration&lt;/li&gt;&#xA;  &lt;li&gt;Reporting&lt;/li&gt;&#xA;  &lt;li&gt;Scenario evaluation&lt;/li&gt;&#xA;  &lt;li&gt;Trade modelling&lt;/li&gt;&#xA;  &lt;li&gt;Market data representation&lt;/li&gt;&#xA;  &lt;li&gt;Financial foundations - currencies, indices, holidays, date adjustments,    schedules, time-series&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;While I haven't actually used the library, it seems to be under active development from checking out their github page and the fact that it is backed by a large company and is being actively developed is always comforting if you are going to invest the time learning a library. I am unsure on its adoption in industry so can't comment on job prospects related to knowing the library.&lt;/p&gt;&#xA;" OwnerUserId="5420" LastEditorUserId="18748" LastEditDate="2020-05-19T13:02:00.603" LastActivityDate="2020-05-19T13:02:00.603" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="24624" PostTypeId="1" CreationDate="2016-02-29T15:35:41.943" Score="1" ViewCount="129" Body="&lt;p&gt;I have got a database with balance sheet and income statement data of 150.000 firms for the period 1995-2014. I need to get a good forecast of each firm's sales. As exogenous variables I can use the industrial production index of the relative industrial sector and the lagged other balance sheet variables. I would be grateful if you could suggest me the best methodology to use. I was thinking to try ARIMA, ARIMAX and exponential smoothing.&lt;/p&gt;&#xA;" OwnerUserId="19705" LastEditorUserId="19645" LastEditDate="2016-03-01T23:04:22.797" LastActivityDate="2016-03-02T17:38:50.777" Title="Forecasting sales from balance sheet data" Tags="&lt;forecast&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24625" PostTypeId="2" ParentId="24620" CreationDate="2016-02-29T16:56:52.977" Score="2" Body="&lt;p&gt;I suppose it will be difficult to provide a precise response as it is a fairly vague question and the reality is quite diverse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &lt;em&gt;my personal&lt;/em&gt; experience, the Quant I used to work with are using techno as &lt;em&gt;R&lt;/em&gt;, &lt;em&gt;Matlab&lt;/em&gt; combined with &lt;em&gt;Visual Basic&lt;/em&gt;. Regarding more sophisticated tool coded in &lt;em&gt;Java&lt;/em&gt; or &lt;em&gt;C#&lt;/em&gt;, they are most of the cases inhouse frameworks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the only advice is to play with framework that allows probabilistic computation, and read a lot about &lt;em&gt;Risk computation and Financial analysis&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As &lt;em&gt;mgilbert&lt;/em&gt; said, &lt;a href=&quot;http://strata.opengamma.io/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Strata&lt;/a&gt; is a nice approach if you want to learn how an inhouse framework may look like. It seems quite complete and it is a good way to get familiar with the architecture of inhouse frameworks you may found in Asset Management companies.&lt;/p&gt;&#xA;" OwnerUserId="19700" LastEditorUserId="18748" LastEditDate="2020-05-19T10:02:19.550" LastActivityDate="2020-05-19T10:02:19.550" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="24626" PostTypeId="2" ParentId="18110" CreationDate="2016-02-29T17:53:06.880" Score="0" Body="&lt;p&gt;As was hinted at in the comments but not stated explicitly, there are multiple  issues here.  I would focus on the error term.  The regression as stated violated many of the conditions for least squares.  There is obviously going to be autocorrelated errors and heteroscedasticity. For the second, most volatility and trading happens at the start and toward the close of the trading day, so treating these intervals as equal is not appropriate. Additionally, depending on the security, with 10 minute intervals there may be a huge number of periods with no change in price, so you also have been blessed with missing observations.  Since this is a test question, and not for real, pointing out these issues show that you know your way around the assumptions and weaknesses of least squares.  I also really cannot make out your notation and cannot understand how much data you really have. So, without understanding your dataset, I'll just suggest that I would break up the days into parts and estimate the periods independently and graph the betas and regression statistics over the day to look for a pattern.         &lt;/p&gt;&#xA;" OwnerUserId="19627" LastActivityDate="2016-02-29T17:53:06.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24627" PostTypeId="1" CreationDate="2016-02-29T18:12:06.840" Score="0" ViewCount="289" Body="&lt;p&gt;I've attached the data set I'm working with to this post. I'm trying to calculate the WACC using this data. I found a formula here: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.investopedia.com/ask/answers/063014/what-formula-calculating-weighted-average-cost-capital-wacc.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.investopedia.com/ask/answers/063014/what-formula-calculating-weighted-average-cost-capital-wacc.asp&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess my problem is figuring out what the variables actually stand for, and how I can use the formula across the different Financial statement forecast's. For instance there are 4 different values for Tax rate so I'm not sure which one to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question I'm working on just tells me to calculate the WACC. Any ideas on where to start? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/d4dVO.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/d4dVO.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;Appreciate any help.&lt;/p&gt;&#xA;" OwnerUserId="19708" LastActivityDate="2017-04-01T19:27:53.467" Title="Trying to calculate WACC (Weighted Average Cost of Capital) for this (small) data set" Tags="&lt;equities&gt;&lt;wacc&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24628" PostTypeId="2" ParentId="18215" CreationDate="2016-02-29T19:04:45.513" Score="10" Body="&lt;p&gt;You can get minutely as-traded prices for all US securities on Quantopian, for free.  You can't download the original data, but you can query it, analyze it, and do your research within a hosted IPython notebook on the website.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you register, go to &lt;a href=&quot;https://www.quantopian.com/research&quot; rel=&quot;noreferrer&quot;&gt;https://www.quantopian.com/research&lt;/a&gt; and check the get_pricing() demo notebook.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Disclosure: I work at Quantopian.  I use the minutely data every day!&lt;/p&gt;&#xA;" OwnerUserId="2605" LastActivityDate="2016-02-29T19:04:45.513" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24635" PostTypeId="2" ParentId="10905" CreationDate="2016-03-01T02:23:20.557" Score="1" Body="&lt;p&gt;There's this one written by me a few years back called autoStock. Worth taking a look.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/expresspotato/autoStock&quot; rel=&quot;nofollow&quot;&gt;https://github.com/expresspotato/autoStock&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13940" LastActivityDate="2016-03-01T02:23:20.557" CommentCount="0" CommunityOwnedDate="2016-03-01T02:23:20.557" ContentLicense="CC BY-SA 3.0" />
  <row Id="24636" PostTypeId="2" ParentId="24627" CreationDate="2016-03-01T04:27:16.237" Score="1" Body="&lt;p&gt;As you can see, the tax rates are listed (from L - R) as 31.0%, 38.5%, 38.5%, and 38.5%, and because your valuations should be forward looking, you should use what is expected, meaning the 38.5% tax rate. Does that make sense?&lt;/p&gt;&#xA;" OwnerUserId="19721" LastActivityDate="2016-03-01T04:27:16.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24637" PostTypeId="1" CreationDate="2016-03-01T08:30:15.687" Score="1" ViewCount="520" Body="&lt;p&gt;I am doing historical scenario analysis in order to calculate stressed VAR for which I have taken 2007-2008 US crisis. I have two question in this regard:-&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) As we have to take prices for stocks with higher volatility during 2008 crisis, what if one of the stocks in my portfolio was not available or the prices were not available during that crisis? What we have to do in that case? Do we have to ignore that stock? Please suggest me for the other asset classes also like for bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) What market exposure I need to take for the respective asset class. I mean do I have to take calculated exposure during the 2008 crisis or the the today's market exposure?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S - I am using variance covariance matrix model for my calculation of VAR as well as stressed VAR. &lt;/p&gt;&#xA;" OwnerUserId="18663" LastActivityDate="2016-03-01T14:18:50.733" Title="Historical Scenario analysis for stress testing" Tags="&lt;var&gt;&lt;covariance-matrix&gt;&lt;testing&gt;&lt;stress&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24638" PostTypeId="1" CreationDate="2016-03-01T09:21:58.010" Score="2" ViewCount="112" Body="&lt;p&gt;Morning,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I use a package called Ninja Trader that has a linear regression method, I have also written my own method and compared the results to excels linear regression method. All three are giving different results and I an trying to understand why.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we look at one example maybe someone will be able to shed some light one why this is. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;EXAMPLE&#xA;&#xA;Y vals 165.05 165.02 165.03 165.07 165.02 165.07 165.04 165.03 165.02 165.01 165 165.02 165.03 165.02 165.02 165.01 165.03 165.04 165.04 165.07&#xA;&#xA;x vals 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1&#xA;&#xA;The results I have from the three different methods are:&#xA;&#xA;Ninja Trader method : 165.034571428572&#xA;My own method:        165.036842105263&#xA;Excels method:        165.025578947368000&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is My linea regression method, in C#:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;public static double LinearRegression(double[] xVals, double[] yVals, int inclusiveStart, int inclusiveEnd)&#xA;        {&#xA;&#xA;                double sumOfX = 0;&#xA;                double sumOfY = 0;&#xA;                double sumOfXSq = 0;&#xA;                double sumOfYSq = 0;&#xA;                double ssX = 0;&#xA;                double ssY = 0;&#xA;                double sumCodeviates = 0;&#xA;                double sCo = 0;&#xA;                double count = xVals.Length;&#xA;                double x;&#xA;                double y;&#xA;&#xA;                for (int ctr = inclusiveStart; ctr &amp;lt; count; ctr++)&#xA;                {&#xA;                    x = xVals[ctr];&#xA;                    y = yVals[ctr];&#xA;                    sumCodeviates += x * y;&#xA;                    sumOfX += x;&#xA;                    sumOfY += y;&#xA;                    sumOfXSq += x * x;&#xA;                    sumOfYSq += y * y;&#xA;                }&#xA;&#xA;            double slope = ((count * sumCodeviates) - (sumOfX * sumOfY)) / ( (count * sumOfXSq) - (sumOfX * sumOfX));&#xA;            double yIntercept = ((sumOfXSq * sumOfY) - (sumOfX * sumCodeviates)) / ((count * sumOfXSq) - (sumOfX * sumOfX));&#xA;&#xA;            return yIntercept + slope * (xVals.Length + 1);&#xA;        }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I hope that someone can help me out getting to the bottom of this. Thx ; )&lt;/p&gt;&#xA;" OwnerUserId="19388" LastActivityDate="2016-03-01T10:05:16.610" Title="Linear Regession 3 methods different results" Tags="&lt;regression&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24639" PostTypeId="2" ParentId="24617" CreationDate="2016-03-01T09:51:14.990" Score="5" Body="&lt;p&gt;Two theoretical explanations regarding the long memory are given by:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The &lt;strong&gt;mixture of distributions hypothesis&lt;/strong&gt; of Tauchen and Pitts (1983). Essentially this hypothesis states that trading volume and return are driven by the same information flow process, therefore trading volume and return volatility should share the same long range dependence.  ( see &lt;strong&gt;Bollerslev and Jubinski, 1999&lt;/strong&gt;; Fleming and Kirby, 2011).&lt;/li&gt;&#xA;&lt;li&gt;A more general (statistic oriented) approach (not only valid for volatility): which has been firstly developed by Granger (1980) (see also Zaffaroni (2004)) ,  explains long memory as the result of the &lt;strong&gt;aggregation of micro-economic linear dynamic models&lt;/strong&gt;.  As a simple example, if we assume that a serie S corresponds to the aggregation of several AR(1) processes, this serie (S) may exhibit long memory even those if the AR(1) are short memory processes. Now there is still some room to explain why volatility can be seen as an aggregated process…&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Regarding the sudden change in persistence I think it is still an ongoing research issue but the two aformentioned theories can give you some ideas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ref :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Granger, C., 1980. Long memory relationships and the aggregation of  dynamic models. Journal of econometrics 14, 227 .&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Zaffaroni, P., 2004. Contemporaneous aggregation of linear dynamic models  in large economies. Journal of Econometrics 120, 75 .&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Tauchen, G. E., Pitts, M., Mar. 1983. The Price Variability-Volume Relationship on Speculative Markets. Econometrica 51 (2),&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Bollerslev, T., Jubinski, D., 1999. Equity Trading Volume and Volatility: Latent Information Arrivals and Common Long-Run Dependencies. Journal of business and economic statistics &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Fleming, J., Kirby, C., Jul. 2011. Long memory in volatility and trading volume. Journal of Banking &amp;amp; Finance 35&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT :&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A very recent paper entitled “&lt;em&gt;Long Memory Through Marginalization of Large Systems and Hidden Cross-Section Dependence&lt;/em&gt;” -Revise/Resubmit to the Journal of Econometrics. (Guillaume Chevillon, Alain Hecq, and Sébastien Laurent) propose another econometric reason based on the marginalization of a large dimensional multivariate system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover they list five reasons to explain long memory:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Aggregation across series&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Linear modeling of a nonlinear underlying process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Structural change&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Learning (bounded rationality) by economic agents in forward looking models of expectations &lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Network effects&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For details see &lt;a href=&quot;http://guillaume-chevillon.faculty.essec.edu/research#TOC-Empirical-Macro-Forecasts-at-OFCE-2003-6-&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; the paper. &lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2016-03-05T11:50:58.920" LastActivityDate="2016-03-05T11:50:58.920" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24640" PostTypeId="2" ParentId="24638" CreationDate="2016-03-01T10:05:16.610" Score="3" Body="&lt;p&gt;It is a common problem due to floating point arithmetics. For example you cast variables to double type, whereas Excel uses a limited precision.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here you can find more info about the numeric precision in Excel: &lt;a href=&quot;https://en.wikipedia.org/wiki/Numeric_precision_in_Microsoft_Excel&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Numeric_precision_in_Microsoft_Excel&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know anything about NinjaTrader, but I think the results are slightly different from your implementation because of the precision used.&lt;/p&gt;&#xA;" OwnerUserId="19515" LastActivityDate="2016-03-01T10:05:16.610" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24641" PostTypeId="2" ParentId="24595" CreationDate="2016-03-01T12:06:36.107" Score="2" Body="&lt;p&gt;It is a big question. You may be interested in an article by Andrew Lo &quot;The Origin of Risk Aversion&quot; (2014) in which he proposes &quot;an evolutionary explanation of risk aversion&quot; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://alo.mit.edu/wp-content/uploads/2015/06/The_Origin_of_Risk_Aversion_Final.pdf&quot; rel=&quot;nofollow&quot;&gt;http://alo.mit.edu/wp-content/uploads/2015/06/The_Origin_of_Risk_Aversion_Final.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2016-03-01T12:06:36.107" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24642" PostTypeId="2" ParentId="24637" CreationDate="2016-03-01T14:18:50.733" Score="3" Body="&lt;p&gt;For stocks that do not have enough data during a historical period one approach would be to use a proxy (i.e. beta * proxy returns - in case that proxy returns = 0, then your proxy is cash). Depending on the weight of the asset in you portfolio, excluding the asset from the analysis may not be a good idea even if there isn't a perfect proxy for the particular asset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the market exposure that you should use this is the current one (i.e. current weight of your assets rather than current # of shares). In portfolio construction you think of $$$ allocation rather than shares.&lt;/p&gt;&#xA;" OwnerDisplayName="user18489" LastActivityDate="2016-03-01T14:18:50.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24643" PostTypeId="1" AcceptedAnswerId="24712" CreationDate="2016-03-01T15:26:23.487" Score="2" ViewCount="540" Body="&lt;p&gt;In the original legacy RiskMetrics documentation from 1996, volatility is calculated using a simple exponentially weighted moving average with some decay factor to determine the weights. This would be used in the calculation of volatility for variance-covariance VaR for example. In RM2006, is volatility still calculated this way? If not, how does it differ and can the 1996 method be substituted?&lt;/p&gt;&#xA;" OwnerUserId="17712" LastActivityDate="2016-03-05T18:15:34.490" Title="Difference in Volatility Calculation from RiskMetrics 1996 to RiskMetrics 2006 VaR" Tags="&lt;var&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24644" PostTypeId="2" ParentId="20744" CreationDate="2016-03-01T17:51:59.853" Score="2" Body="&lt;p&gt;Let me use a notation that I am more used to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \sigma^2_{i,t} = \omega_i + \alpha_i\varepsilon^2_{i,t-1} + \beta_i\sigma^2_{i,t-1} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $i=1,2$. Since &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \text{Var}(X+Y) = \text{Var}(X) + \text{Var}(Y) + \text{Corr}(X,Y)\sqrt{\text{Var}(X)}\sqrt{\text{Var}(Y)} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ &#xA;\text{Var}(x_{1,t})=\sigma_{1,t}^2, &#xA;\ \ \ \text{Var}(x_{2,t})=\sigma_{2,t}^2 &#xA;\ \ \ \text{and} &#xA;\ \ \ \text{Corr}(x_{1,t},x_{2,t})=\rho, &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;we have &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align}&#xA;\text{Var}(x_{1,t}+x_{2,t}) &amp;amp;= \sigma_{1,t}^2 + \sigma_{2,t}^2 + \rho \sigma_{1,t} \sigma_{2,t} \\&#xA;&amp;amp;= (\omega_1 + \alpha_1\varepsilon^2_{1,t-1} + \beta_1\sigma^2_{1,t-1}) &#xA;+ (\omega_2 + \alpha_2\varepsilon^2_{2,t-1} + \beta_2\sigma^2_{2,t-1}) \\&#xA;&amp;amp;+ (\rho\sqrt{\omega_1 + \alpha_1\varepsilon^2_{1,t-1} + \beta_1\sigma^2_{1,t-1}}&#xA;\sqrt{\omega_2 + \alpha_2\varepsilon^2_{2,t-1} + \beta_2\sigma^2_{2,t-1}})&#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which &lt;strong&gt;does not seem coercible&lt;/strong&gt; to the shape of &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \sigma^2_{t} = \omega + \alpha\varepsilon^2_{t-1} + \beta\sigma^2_{t-1} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for any $(\omega,\alpha,\beta)$. Therefore, generally a sum of two GARCH(1,1) processes is &lt;strong&gt;not&lt;/strong&gt; a GARCH(1,1) process. (I say this without a formal proof.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A very special case that &lt;strong&gt;is&lt;/strong&gt; coercible is when $\alpha_1=\alpha_2, \beta_1=\beta_2$ and $\rho=0$; then $\omega=\omega_1+\omega_2,\alpha=\alpha_1=\alpha_2,\beta=\beta_1=\beta_2$. This is the case when the conditional variance dynamics is the same for both series and the only potential difference in the two GARCH models is the potentially different base level $\omega_1$ versus $\omega_2$.&lt;/p&gt;&#xA;" OwnerUserId="19645" LastActivityDate="2016-03-01T17:51:59.853" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24645" PostTypeId="2" ParentId="22548" CreationDate="2016-03-01T18:25:47.973" Score="2" Body="&lt;p&gt;List of books:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Romer’s book on Advanced Macro, whatever John Taylor’s latest macro book is,  Minsky’s Keynes book and his Stabilizing an Unstable Economy book, Cassidy’s How Markets Fail,  Shillers’ Animal Spirits, Debunking Economics by Keen, Meltdown by Woods, General Theory by Keynes, and (probably) Post-Keynesian Economics by Lavoie.  That is only a start.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The before mentioned Romer book (and/or Blanchard’s mentioned in another comment here) is not provided because it is correct, it is provided to show the framework of the wrong model.  But you still need to understand the wrong way, to appreciate the correct ways.    &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may be severely underestimating the work involved.  This is not qualitatively or quantitatively like giving someone John Hull’s book and telling him or her to program a Black-Scholes equation. To develop a world view on economics is a rather large amount of effort. I choose my words carefully.  I did not say to learn someone like Soro’s world view is a lot of effort. To develop your own world view is a lot of effort.  The reality is that most people’s macro views are based upon reading Business Week and perhaps some JPM or other research papers, deciding they are a bit more optimistic or pessimistic than that, and presenting that as if it is a real researched view.      &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should familiarize yourself with the different schools of thought. Take Keynesian economics. Within the sphere of economists claiming the Keynesian title, there are old style Keynesians, neo-Keynesians, new Keynesians, post-Keynesians and more.  The classicals have similar breakdowns, while there are also Austrian and Marxist schools and so on.  You should be able to look at the current and past economic indicators and generate a different conclusion of what is going on and forecast what will happen in the economy based upon the views of each of those different schools.  The school of economics called New Keynesian has an extremely different view of economics than the post-Keynesian, and this later group correctly says New Keynesians do not follow what John Maynard Keynes believed in.  The difference between the two is why the dominate school of economics in December of 2007 had no clue a recession was about to happen, while it was incredibly obvious to many post-Keynesians. &lt;/p&gt;&#xA;" OwnerUserId="19627" LastActivityDate="2016-03-01T18:25:47.973" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24646" PostTypeId="2" ParentId="24545" CreationDate="2016-03-01T19:08:16.880" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://www.quantstart.com/advanced-algorithmic-trading-ebook&quot; rel=&quot;nofollow&quot;&gt;Advanced Algorithmic Trading&lt;/a&gt;,  Mike Halls-Moore. &lt;/p&gt;&#xA;" OwnerUserId="16937" LastEditorUserId="848" LastEditDate="2016-04-14T07:55:10.613" LastActivityDate="2016-04-14T07:55:10.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24647" PostTypeId="1" CreationDate="2016-03-01T19:13:45.660" Score="1" ViewCount="36" Body="&lt;p&gt;I've developed/patented a metadata extraction methodology, which we've used to build a variety of alternative datasets for funds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the more difficult issues in this field, is getting useful feedback from funds and how the data is actually being used once licensed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd genuinely appreciate feedback on the JSON/metadata we return, the easiest way to review the JSON is via a GUI built from the JSON.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Our key data can be used to minesignals based on combinations of ASR, object detection and concept extraction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If possible I'd love to hear feedback on usefulness or types of alternative datasets you'd like to see.  Thanks much, feedback is invaluable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Keep in mind we have access to mainstream financial audio and video streams going back nearly 10 years/365000 minutes)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a analyzed video for demonstration purposes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.datascription.com/videogui/&quot; rel=&quot;nofollow&quot;&gt;http://www.datascription.com/videogui/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19620" LastActivityDate="2016-03-01T19:13:45.660" Title="Feedback on Video Metadata Extraction" Tags="&lt;data&gt;&lt;market-data&gt;&lt;historical-data&gt;&lt;data-mining&gt;&lt;digital-signal-processing&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24648" PostTypeId="2" ParentId="848" CreationDate="2016-03-01T20:33:59.053" Score="0" Body="&lt;p&gt;You may consider cross correlations of logarithmic returns on the two assets' prices, $\text{Corr}(x_t,y_{t-h})$, where $x_t$ and $y_t$ are the returns series and $h$ is the time lag. Cross correlation is the same as ordinary correlation but one series of returns is lagged by $h$ periods with respect to the other series. However, its use may be limited as information dissemination in liquid markets is quick and prices react to shocks without considerable delays.&lt;/p&gt;&#xA;" OwnerUserId="19645" LastActivityDate="2016-03-01T20:33:59.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24649" PostTypeId="1" CreationDate="2016-03-01T21:57:19.767" Score="1" ViewCount="62" Body="&lt;p&gt;The ETF in question is VDC &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It pays about $2.5 a year in dividends, but the payout dates are very erratic&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I were to go long VDC with options, what would be the best way of doing this to avoid dividend risk and to keep transaction fees minimal?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Shorting a deep in the money put would be a bad idea if the dividend is announced because it would cause the put to gain value in anticipation the dividend, assuming the ex-dividend date is before the option expires.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Buying a deep in the money call would probably work, but I would have to be very careful to exercise it before the ex-dividend date .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dividends can be quite problematic&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any other ideas?&lt;/p&gt;&#xA;" OwnerUserId="15081" LastActivityDate="2016-03-01T21:57:19.767" Title="Effect of surprise dividends on options" Tags="&lt;options&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24650" PostTypeId="2" ParentId="22057" CreationDate="2016-03-02T00:02:52.323" Score="1" Body="&lt;p&gt;General questions beget general answers but hopefully mine offers some additional insight. If you do  not have full business cycles, how about different phases in the business cycle (generally one could say there are 4)? Recovery, Expansion, Slowdown, Recession. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are missing recession data you can generally fill those in using comparable industry/sector data. There has to be SOMETHING that exists in SOME shape or form for the Great Recession of 08, Dot Com bubble of 01-02... and you can always look at smaller downturns that affect sector specific spreads. The judgement call here would be how much do you tweak that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are missing &quot;the good times&quot; that is not so important. One could always be conservative and retain upside (especially in the case of default assumption).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Again, really not sure what you are looking at, so specific cases might require specific techniques.&lt;/p&gt;&#xA;" OwnerUserId="17552" LastActivityDate="2016-03-02T00:02:52.323" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24653" PostTypeId="1" AcceptedAnswerId="24656" CreationDate="2016-03-02T09:39:02.577" Score="4" ViewCount="304" Body="&lt;p&gt;Given a set of $N$ assets, the amount of strategies proposed in literature to diversify the investors wealth in order to find the 'optimal' portfolio is overwhelming. However, for example &lt;a href=&quot;https://www.google.at/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0ahUKEwjF4aDX16HLAhUBvXIKHTY5A2AQFggcMAA&amp;amp;url=http%3A%2F%2Ffaculty.london.edu%2Favmiguel%2FDeMiguel-Garlappi-Uppal-RFS.pdf&amp;amp;usg=AFQjCNH_jV6Gdnk4vRjnSTf4KssSOUfBZg&amp;amp;sig2=TxCDrYIqG0uD3BiqQ5Vd2Q&quot; rel=&quot;nofollow&quot;&gt;DeMiguel et al&lt;/a&gt; point out that estimation error is large in general, leading to bad out-of-sample returns for many sophisticated portfolio strategies. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my mind it should be a straightforward idea to combine several promising allocation candidates such that the estimation risk is 'diversified' as well. In other words, given a set of portfolio weights proposed by $k$ distinct strategies $\{\omega_1,\ldots,\omega_k\}$, it could be beneficial to compute a vector $c\in\mathbb{R}^k, \left( \sum\limits_{i=1}^{k} c_i =1\right)$ based on some criteria and then investing into $\omega^*:=c_1\omega_1+\ldots +c_k\omega_k$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am aware of some ideas combining two portfolios via shrinkage approaches (see for example &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2730571&quot; rel=&quot;nofollow&quot;&gt;&#xA;Posterior Inference for Portfolio Weights&#xA;&lt;/a&gt; and the appendix of &lt;a href=&quot;https://www.google.at/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0ahUKEwjF4aDX16HLAhUBvXIKHTY5A2AQFggcMAA&amp;amp;url=http%3A%2F%2Ffaculty.london.edu%2Favmiguel%2FDeMiguel-Garlappi-Uppal-RFS.pdf&amp;amp;usg=AFQjCNH_jV6Gdnk4vRjnSTf4KssSOUfBZg&amp;amp;sig2=TxCDrYIqG0uD3BiqQ5Vd2Q&quot; rel=&quot;nofollow&quot;&gt;Optimal Versus Naive Diversification: How Inefficient is the 1/N Portfolio Strategy?&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but I am would like to learn more about those ideas. Any reference or further comment directing in this direction is welcome to answer my question:&#xA;What are the benefits and gains from combining several allocation strategies?&lt;/p&gt;&#xA;" OwnerUserId="16249" LastActivityDate="2016-03-02T11:00:01.043" Title="Mixing Portfolio Strategies" Tags="&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;&lt;reference-request&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24655" PostTypeId="2" ParentId="24487" CreationDate="2016-03-02T10:54:47.643" Score="4" Body="&lt;p&gt;A negative mean reversion makes the dynamics of the asset explode. If the model is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dr=[\theta-\alpha r]dt+\sigma dW $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The expected value in this model is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}(r)= r(0) e^{-\alpha t} + \frac{\theta}{\alpha} (1-e^{-\alpha t} )$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $\alpha&amp;lt;0$ $\mathbb{E}(r)$ goes to $\infty$ or $-\infty$, depending on if $r(0)$ is above or below the &quot;long term mean&quot;   $\frac{\theta}{\alpha}$ (so our long term mean is not the long term mean here).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you get $\alpha&amp;lt;0$ when calibrating your model, it is a sign that there is not a mean reversion in your data, and that the Hull-White model is not the right one here.&lt;/p&gt;&#xA;" OwnerUserId="6356" LastActivityDate="2016-03-02T10:54:47.643" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24656" PostTypeId="2" ParentId="24653" CreationDate="2016-03-02T11:00:01.043" Score="1" Body="&lt;p&gt;Not many benefits actually. As you combine different strategies you abstract yourself from what you are trying to reach. E.g. What would you get if you combine a strategy that tries to maximize Sharpe Ratio, with a strategy that maximizes Certain Equivalent? You have no idea on what that would get you. Probably it might even get you a portfolio with high turnover and so high transaction costs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even DeMiguel, seems to be moving towards simpler strategies. The 1/N strategy is on example. Another example is to use Parametric Portfolio Policies of Brandt, Santa-Clara and Valkanov. Even DeMiguel on one of his last papers seems to favour this approach: &lt;a href=&quot;https://workspace.imperial.ac.uk/business-school/Public/research/f_agroup/DeMiguel%20abstract.pdf&quot; rel=&quot;nofollow&quot;&gt;Fifty Ways to Beat the Market?&#xA;A Portfolio Perspective on Investment Anomalies&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All in all there is no right answer to your question. You should try to mixture several strategies and see out of sample what would you get net of transaction fees. Also, you should clearly define as an investor what is your objective, either by defining that you want the maximum sharpe ratio, or maximum utility given some risk-aversion. Without a clear objective in mind is hard to define what would be the optimal strategy.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2016-03-02T11:00:01.043" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24657" PostTypeId="1" CreationDate="2016-03-02T11:35:54.527" Score="3" ViewCount="985" Body="&lt;p&gt;I'm trying to estimate a &lt;em&gt;Markov-switching&lt;/em&gt; &lt;em&gt;VAR&lt;/em&gt; in &lt;em&gt;R&lt;/em&gt; using the command &lt;em&gt;msvar&lt;/em&gt;. These are the first 10 entries of my two time series. I have &lt;em&gt;798&lt;/em&gt;. When I try to run this I get an Error message&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a &amp;lt;- c(1.998513, 1.995302, 2.030693, 2.122130, 2.236770, 2.314639, 2.365214, 2.455784, 2.530696, 2.596537)&#xA;b &amp;lt;- c(0.6421369, 0.6341437, 0.6494933, 0.6760939, 0.7113511, 0.7173038, 0.7250545, 0.7812490, 0.7874657, 0.8275209)&#xA;x &amp;lt;- matrix (NA,10,2)&#xA;x[,1] &amp;lt;- a&#xA;x[,2] &amp;lt;- b&#xA;time.seriesx &amp;lt;- ts(x)&#xA;markov.switchingx &amp;lt;- msvar(time.seriesx, p = 2, h = 2, niterblkopt = 10)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The error message I get is the following:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Error in optim(par = c(beta0.it), fn = llf.msar, Y = Yregmat, X =&#xA;  Xregmat,  : initial value in 'vmmin' is not finite&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Anyone who could help me? Thanks&lt;/p&gt;&#xA;" OwnerUserId="19636" LastActivityDate="2017-03-25T16:37:59.613" Title="Error when trying to estimate a Markov-switching Var model in R" Tags="&lt;time-series&gt;&lt;r&gt;&lt;markov-switching&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24658" PostTypeId="2" ParentId="24617" CreationDate="2016-03-02T14:05:57.553" Score="3" Body="&lt;p&gt;Check out the book of &lt;a href=&quot;http://www.springer.com/de/book/9783540226949&quot; rel=&quot;nofollow&quot;&gt;Teyssière &amp;amp; Kirman (2007)&lt;/a&gt; entitled &quot;Long Memory in Economics&quot;. For instance, the model of &lt;a href=&quot;http://homepage.univie.ac.at/andrea.gaunersdorfer/papers/gh_vol_clust.pdf&quot; rel=&quot;nofollow&quot;&gt;Gaunersdorfer &amp;amp; Hommes&lt;/a&gt; features heterogeneous agents: fundamentalists believe that prices move to their fundamental rational expectations value, while chartists simply look at deviations of actual traded prices. The latter thus feature a simple trend following trading rule. If the ratio of chartists is high, then the reinforcement of price movements is stronger and volatility more persistent. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One possible explanation for your observation might therefore be a decline in &quot;uneducated traders&quot; after the crisis.&lt;/p&gt;&#xA;" OwnerUserId="19745" LastActivityDate="2016-03-02T14:05:57.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24659" PostTypeId="2" ParentId="14569" CreationDate="2016-03-02T14:11:41.023" Score="1" Body="&lt;p&gt;You can try &lt;a href=&quot;http://timel.vleo.net&quot; rel=&quot;nofollow&quot; title=&quot;TimEL&quot;&gt;TimEL&lt;/a&gt;, a Java library I've been writing to evaluate expressions for time-series data.&lt;/p&gt;&#xA;" OwnerUserId="19746" LastActivityDate="2016-03-02T14:11:41.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24660" PostTypeId="2" ParentId="24657" CreationDate="2016-03-02T14:56:06.570" Score="1" Body="&lt;p&gt;I think your time series is too short. Yours has lenght 10 and you estimate with parameter &lt;code&gt;niterblkopt = 10&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. if you have a time series twice as long then it works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(MSBVAR)&#xA;&#xA;a &amp;lt;- c(1.998513, 1.995302, 2.030693, 2.122130, 2.236770, 2.314639, 2.365214, 2.455784, 2.530696, 2.596537)&#xA;b &amp;lt;- c(0.6421369, 0.6341437, 0.6494933, 0.6760939, 0.7113511, 0.7173038, 0.7250545, 0.7812490, 0.7874657, 0.8275209)&#xA;x &amp;lt;- matrix (NA,10,2)&#xA;x[,1] &amp;lt;- a&#xA;x[,2] &amp;lt;- b&#xA;x = rbind(x,x)&#xA;time.seriesx &amp;lt;- ts(x)&#xA;markov.switchingx &amp;lt;- msvar(time.seriesx, p = 2, h = 2, niterblkopt = 10)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can you use more data? It seems that there is too little data for the model - or at least for the algorithm.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-03-02T14:56:06.570" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24661" PostTypeId="2" ParentId="24624" CreationDate="2016-03-02T17:38:50.777" Score="2" Body="&lt;p&gt;[Sorry, I'm new here and accidently posted this as an answer and its just meant as a comment responding to a question, but it does not let me delete answers to put it under comments. If I last long enough, I'm sure I'll figure out how to edit things.]   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;PCA is an eigenvalue/eigenvector decomposition of the data frequently applied in risk management to look for systemic factors effecting a large portfolio.  My favorite introduction to the concept is an excellent efficient and very focused chapter in Carol Alexander's Market Risk Analysis vol 2 (and the volume number is critical since there are 4 books). This can give you factors that explain the majority of the variability in your series and it reduces your problem from 150,000 series down to a few factors.  There are lots of articles on this if you search.  Alternatively, and less techy, you could create your own capital weighted indexes and use those to predict the 150,000 individual series, using betas estimated off that index for each firm. Your IP index could influence these indexes.  &lt;/p&gt;&#xA;" OwnerUserId="19627" LastActivityDate="2016-03-02T17:38:50.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24662" PostTypeId="1" AcceptedAnswerId="24675" CreationDate="2016-03-02T18:22:06.467" Score="5" ViewCount="488" Body="&lt;p&gt;The continuously compounded interest rate is $r$. The current price of the underlying asset is $S(0)$ and the forward price with delivery time in 1 year is $F(0,1)$. Short selling of the stock requires a security deposit in the amount of $fS(0)$ for some $f \in (0,1)$. Assume that the security deposit incurs an interest $d$ that is compounded continuously. Prove there is an arbitrage opportunity if the following is satisfied. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;d &amp;gt; ln(e^r - \frac{e^rS(0)-F(0,1)}{fS(0)})&#xA;$$&#xA;My intuition is to simplify this inequality somehow to reflect a necessary and sufficient condition for an arbitrage opportunity.&#xA;To do this, I think I need to set some of the quantities to the boundaries of their domains, but I don't know what they are. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I only know for sure $fS(0) \in (0,1)$ (please let me know if this is wrong!)&#xA;can I assume $r &amp;gt;= 0$ and/or $d &amp;gt;= 0$? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any other ideas on how to approach this problem?&lt;/p&gt;&#xA;" OwnerUserId="17063" LastEditorUserId="17063" LastEditDate="2016-03-02T18:36:38.467" LastActivityDate="2016-03-03T14:21:23.150" Title="Prove arbitrage opportunity" Tags="&lt;arbitrage&gt;&lt;forward&gt;&lt;no-arbitrage-theory&gt;&lt;short-selling&gt;&lt;proof&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24663" PostTypeId="2" ParentId="22548" CreationDate="2016-03-02T18:22:26.853" Score="1" Body="&lt;p&gt;Take a look at &lt;a href=&quot;http://alephblog.com&quot; rel=&quot;nofollow&quot;&gt;http://alephblog.com&lt;/a&gt;. &#xA;There is a section with book reviews and a subcategory called &quot;Macro Investing&quot;. &#xA;I haven't read any of the books but the blog itself is recommendable. The reviews contain a full disclosure. &lt;/p&gt;&#xA;" OwnerUserId="16067" LastActivityDate="2016-03-02T18:22:26.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24664" PostTypeId="2" ParentId="19464" CreationDate="2016-03-02T18:27:26.653" Score="0" Body="&lt;p&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=aEnjFFFVhGs&quot; rel=&quot;nofollow&quot;&gt;https://www.youtube.com/watch?v=aEnjFFFVhGs&lt;/a&gt; Credit goes to the CFA institute.&lt;/p&gt;&#xA;" OwnerUserId="17552" LastActivityDate="2016-03-02T18:27:26.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24665" PostTypeId="1" AcceptedAnswerId="24667" CreationDate="2016-03-02T18:46:56.097" Score="2" ViewCount="149" Body="&lt;p&gt;In this &lt;a href=&quot;http://ocw.mit.edu/courses/mathematics/18-s096-topics-in-mathematics-with-applications-in-finance-fall-2013/case-studies/MIT18_S096F13_CaseStudy3.pdf&quot; rel=&quot;nofollow&quot;&gt;case study on treasury yeilds&lt;/a&gt; from MIT, I have a question on page 11-12. He uses this data&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;getYahooData(&quot;^TNX&quot;, start=20000101, end=20130531)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;His logic on page 11 is this &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&quot;only daily is close to being stationary&quot; (I get this)&lt;/li&gt;&#xA;&lt;li&gt;&quot;we observe lower p value when higher freq frequency&quot; (I see this since p-value daily &amp;lt; p-value monthly)&lt;/li&gt;&#xA;&lt;li&gt;&quot;so stronger time series structure at higher freq, hence we diffrence the data&quot;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;for that data, we reject H0: non-stationary. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to understand how he can go from seeing the p-values are lower for daily (closer to stationary) into knowing that differenced data will reject H0. &lt;/p&gt;&#xA;" OwnerUserId="12002" LastActivityDate="2016-03-02T20:58:32.207" Title="Dickey Fuller test of stationarity differenced data" Tags="&lt;time-series&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24666" PostTypeId="2" ParentId="848" CreationDate="2016-03-02T20:18:48.713" Score="0" Body="&lt;p&gt;You could use wavelet cross correlation and phase analysis coherence between the two series. By analyzing the the series at multiple frequencies you can establish if there is causality (one causing the other and such even if not direct and thus if one can be used to precict another). Cross correlation will indicate at what frequencies the two series are related.    &lt;/p&gt;&#xA;" OwnerUserId="7616" LastActivityDate="2016-03-02T20:18:48.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24667" PostTypeId="2" ParentId="24665" CreationDate="2016-03-02T20:58:32.207" Score="1" Body="&lt;p&gt;As far as I know, it's impossible to &lt;em&gt;know&lt;/em&gt; that the differenced data will stationary (reject H0). That being said, when we have a time series that is non-stationary, the first thing a lot of econometricians do is difference the data. Still stationary? Difference it again!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After skimming the reference you gave, I don't think he's making the assumption that the first-differenced series will be stationary. My guess is that he knows that to be the case beforehand and is simply demonstrating it. Unless I'm missing something, it's not possible to know a non-stationary time series will become stationary after differencing it once without performing the unit root test on the differenced data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(FYR: How many times you have to difference something until it's stationary gives you the order to which the series is said to be &lt;strong&gt;integrated&lt;/strong&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the risk of editorializing, I once had a statistics professor whose biggest complaint about time series &amp;amp; econometrics was an apparent obsession with differencing data just to make the math work.&lt;/p&gt;&#xA;" OwnerUserId="7385" LastActivityDate="2016-03-02T20:58:32.207" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24669" PostTypeId="2" ParentId="24643" CreationDate="2016-03-03T01:36:14.417" Score="1" Body="&lt;p&gt;No.  Vol in the 2006 is computed using scaled 1 year daily returns.&lt;/p&gt;&#xA;" OwnerUserId="12203" LastActivityDate="2016-03-03T01:36:14.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24671" PostTypeId="1" AcceptedAnswerId="24672" CreationDate="2016-03-03T08:07:18.227" Score="3" ViewCount="259" Body="&lt;p&gt;I was reading Trading Commodities and Financial Futures by Kleinman, I saw this excerpt:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When you buy or sell a futures contract, you don’t actually sign a&#xA;  contract drawn up by a lawyer. Instead, you enter into a contractual&#xA;  obligation that can be met in only one of two ways. The first method&#xA;  is by making or taking delivery of the actual commodity. This is by&#xA;  far the exception, not the rule. Fewer than 1% of all futures&#xA;  contracts are concluded with an actual delivery. The other way to meet&#xA;  this obligation, which is the method you will be using, is termed&#xA;  offset. Very simply, offset is making the opposite (or offsetting)&#xA;  sale or purchase of the same number of contracts bought or sold&#xA;  sometime prior to the expiration date of the contract. Because futures&#xA;  contracts are standardized, this is accomplished easily.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My question is if 1% of contracts are fullfilled, how does this market work? Why would producers create contracts that they would not fullfill? &lt;/p&gt;&#xA;" OwnerUserId="616" LastActivityDate="2016-03-03T17:22:10.243" Title="Futures Contracts, Rollover, Offsets" Tags="&lt;futures&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24672" PostTypeId="2" ParentId="24671" CreationDate="2016-03-03T08:37:48.770" Score="3" Body="&lt;p&gt;Because they are hedging their commodity price exposure, not their ability to deliver/receive said commodity.&lt;/p&gt;&#xA;" OwnerUserId="19615" LastActivityDate="2016-03-03T08:37:48.770" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24673" PostTypeId="1" CreationDate="2016-03-03T09:45:00.267" Score="1" ViewCount="470" Body="&lt;p&gt;I'm creating a predictive model for closing price of stocks (using neural network and support vector machines.). Is it appropriate to use adjusted prices or unadjusted prices for this prediction purpose? my inputs are technical indicators (+ lags of price) and my output is trend deterministic (1 if we have increase in price and down if we have decrease in price).&lt;/p&gt;&#xA;" OwnerUserId="8234" LastActivityDate="2016-05-02T16:52:09.040" Title="Design models using adjusted or unadjusted stock prices (time series prediction)?" Tags="&lt;price&gt;&lt;prediction&gt;&lt;neural-networks&gt;&lt;adjusted&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24674" PostTypeId="1" CreationDate="2016-03-03T10:27:43.413" Score="3" ViewCount="49" Body="&lt;p&gt;Let $S_t$ be follow Black Scholes, then I am interesting in simulating the process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\int ^t _0 e^{-rt}1_{\{S_t\leq K\}}dS_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is like a naive hedge of a European put, which does not work in practice.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Am I correct to say no Milstein Type scheme exists due to discontinuous derivative&lt;/li&gt;&#xA;&lt;li&gt;Does the Euler scheme produce a process which approximate this stochastic integral?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="3334" LastActivityDate="2016-03-03T10:27:43.413" Title="Regularity requirement for convergence of Euler scheme for stochastic integral?" Tags="&lt;stochastic-calculus&gt;&lt;simulations&gt;&lt;euler&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24675" PostTypeId="2" ParentId="24662" CreationDate="2016-03-03T14:21:23.150" Score="5" Body="&lt;p&gt;Suppose that the given condition is true. You want to construct an arbitrage portfolio to take advantage of this. Now, $d$ is an interest rate, and the condition suggests that $d$ is too high. So you will want to receive $d$ in order to profit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you could, you would borrow money at $r$ and lend it to the stock broker or exchange to collect the interest rate differential (assuming that $d &amp;gt; r$). But you can't just lend money at $d$, it is available only to someone shorting the stock. So let us build the simplest portfolio which allows us to be paid that rate of interest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Short one unit of stock, obtaining $S(0)$ in cash. Of that cash, exactly $fS(0)$ has to be lent to the broker as a deposit. The rest, $(1-f)S(0)$, gets put in the money market account at interest rate $r$. So far, the portfolio is self-funding until time $t=1$. At that point we will be short one stock and have &#xA;$$ e^d fS(0) + e^r (1-f)S(0)$$&#xA;in cash. Now, we don't want the short stock position, so we should buy that stock forward immediately. This doesn't change the self-funding nature since no cash is paid upfront for a forward sale. Now, at $t=1$ we will be flat the stock and have &#xA;$$ e^d fS(0) + e^r (1-f)S(0) - F(0,1) $$&#xA;cash (with certainty).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is positive exactly when&#xA;$$ e^d fS(0) &amp;gt; F(0,1) - e^r (1-f)S(0) $$&#xA;or when &#xA;$$ d &amp;gt; \log\left(\frac{F(0,1) - e^r (1-f)S(0)}{fS(0)} \right)$$&#xA;which simplifies to your inequality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that if it is negative, there is not necessarily an arbitrage by taking the exact opposite portfolio, since presumably buying the stock doesn't mean that you are lent money at the same rate of interest which shorts receive on their deposit.&lt;/p&gt;&#xA;" OwnerUserId="4963" LastActivityDate="2016-03-03T14:21:23.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24676" PostTypeId="2" ParentId="24673" CreationDate="2016-03-03T15:18:08.017" Score="1" Body="&lt;p&gt;Whenever you are looking to estimate total return, you would use adjusted closing prices. If you are strictly looking for the future stock price, you would use unadjusted closing price. I assume, though, that you are looking to predict the value of holding a stock during a given period, so you would want to use adjusted prices. The only time I've used actual closing prices in a model was when a security's value is strictly based on the closing price as of a certain day and ignorant of any dividend payments made. Historical correlation/volatility and estimates of return use adjusted prices.&lt;/p&gt;&#xA;" OwnerUserId="19089" LastActivityDate="2016-03-03T15:18:08.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24677" PostTypeId="2" ParentId="22256" CreationDate="2016-03-03T16:29:48.873" Score="0" Body="&lt;p&gt;I would first take a look at &lt;a href=&quot;https://www.quandl.com/data/SCF/documentation/roll-methodology&quot; rel=&quot;nofollow&quot;&gt;Quandl SCF Roll Methodology&lt;/a&gt; (if you haven't done so already). In my own personal backtests I have used weighted rolls based on either the last trading day or the first day of the month, simply because I prefer the determinism of when the roll takes place and how it is to take place. The other advantage of this weighted roll is that it &lt;em&gt;can&lt;/em&gt; smooth the price gaps between months, just because if the spread between first and second month is big, this approach eases into the second month over a couple of days.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, the guy that wrote &lt;a href=&quot;http://econintersect.com/b2evolution/blog3.php/2012/11/09/lessons-from-the-pros&quot; rel=&quot;nofollow&quot;&gt;this post&lt;/a&gt; prefers no adjustment, because the &quot;rollover gaps are treated just like traditional gaps and have a very high probability of being filled at some point in the future.&quot; That's a common belief in the world of technical analysis, and if you agree then you might also prefer an unadjusted roll methodology.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;TLDR:&lt;/strong&gt; At the end of the day, it depends on a combination of what you're trying to do and your personal preference. Just make sure you know what's going on with your chosen roll methodology.&lt;/p&gt;&#xA;" OwnerUserId="7385" LastActivityDate="2016-03-03T16:29:48.873" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24678" PostTypeId="1" CreationDate="2016-03-03T16:55:45.083" Score="3" ViewCount="833" Body="&lt;p&gt;I am new to quantitative finance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know that in the CIR model the short rate can't go negative. My question then concerns calibration of CIR to a ZCB yield curve. Is it (and why?) possible to calibrate the CIR model to a yield curve with negative yields in the short end? Why (or why not) is this possible, when the short rate can't go negative?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is probably something conceptual I have missed about the relationship short rates and yields.   &lt;/p&gt;&#xA;" OwnerUserId="19761" LastEditorUserId="11936" LastEditDate="2016-03-03T20:21:55.090" LastActivityDate="2016-03-05T12:06:25.280" Title="CIR model and calibration" Tags="&lt;interest&gt;&lt;modelling&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24679" PostTypeId="2" ParentId="24671" CreationDate="2016-03-03T17:22:10.243" Score="3" Body="&lt;p&gt;Lets say we have 3 kind of players/trades: Hedge, arbitrage and speculative.&#xA;In theory just hedges would be interest in delivery/receive in some case. But as the name say usually it's for hedge market only. When producers go to futures market it's not to sell/buy products it's only to protection this prices. You have other kind of instruments to sell/buy physical. And of course arbitrage and speculative traders is usually the great majority of players and sure they don't want delivery/receive nothing.&lt;/p&gt;&#xA;" OwnerUserId="19762" LastActivityDate="2016-03-03T17:22:10.243" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24680" PostTypeId="2" ParentId="21444" CreationDate="2016-03-03T17:30:58.620" Score="1" Body="&lt;p&gt;Use HV to get the volatility of the HV. extrapolate it to the current IV in order to build scenarios for different deltas and you have a good resource.&#xA;So HV is a good indicative to see the probable oscillation of your IV and the IV itself gives you the market risk sentiment. You can see also how your volatility behaviors in different levels, usually the Vol of HV is higher in the HV high-band.&lt;/p&gt;&#xA;" OwnerUserId="19762" LastActivityDate="2016-03-03T17:30:58.620" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24681" PostTypeId="1" CreationDate="2016-03-03T17:45:20.347" Score="0" ViewCount="198" Body="&lt;p&gt;Assume I have a &lt;code&gt;1M&lt;/code&gt;spread option. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would you say that was &lt;code&gt;1M notional&lt;/code&gt; (for IM purposes) or &lt;code&gt;1M pay + 1M rec i.e. 2M&lt;/code&gt; notional?&lt;/p&gt;&#xA;" OwnerUserId="19764" LastEditorUserId="743" LastEditDate="2016-10-31T19:41:00.917" LastActivityDate="2016-11-30T20:18:49.343" Title="if I had a 1M spread option. Would you say that was 1m notional (for IM purposes) or 1m pay + 1m rec i.e. 2m notional?" Tags="&lt;options&gt;&lt;margin&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24682" PostTypeId="1" AcceptedAnswerId="24687" CreationDate="2016-03-03T19:36:41.123" Score="2" ViewCount="106" Body="&lt;p&gt;Assumption 2.1 - If the payoff $P$ of a financial instrument is non negative, then the price $p$ of the financial instrument is non negative.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume $C$ is just the price of the call option, and $C^{*}$ is also the price of a different call option with the same parameters as $C$ except that $\tau = T - t$ where $T$ is the maturity and $t$ is current time&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume no dominance, Assumption 2.1. Show that the price of call option should satisfy $$(S - B_t(T)K)_+ \leq C(T,K,S)\leq C^{*}(T,K,S)\leq S$$ Therefore, for any price quote $C^{*}(\tau,K,S)$ of a call option with strike $K$ and time to maturity $\tau$, there exists a unique $\sigma^{imp}(\tau,K,S)$ such that $$C(\tau,K,S,\sigma^{imp},r) = C^{*}(\tau,K,S)$$ $\sigma^{imp}(\tau,K,S)$ is called implied volatility. See figure below&lt;a href=&quot;https://i.stack.imgur.com/Alzj8.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Alzj8.jpg&quot; alt=&quot;figure&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Attempted proof: Let the price of a call option with strike $K$ be denoted $C(K)$. Assume when we purchase a call option the stock price $S$ is equal to the strike price $K$. Hence we have $$C(T,K,S)\leq S$$ at time $T$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not really sure where to go from here, any suggestions is greatly appreciated. &lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="19002" LastEditDate="2016-03-03T20:35:12.217" LastActivityDate="2016-03-04T17:21:59.683" Title="Use no dominance to show that the price of the call option satisfies the inequality" Tags="&lt;finance&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24683" PostTypeId="2" ParentId="24678" CreationDate="2016-03-03T19:47:27.943" Score="1" Body="&lt;p&gt;As you say, in the CIR model with usual assumptions the short rate cannot go negative.  This means that yields in the model are always poaitive, so it will not be a good fit to a yield curve which is negative for short maturities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you really do want the CIR model, there is a weird extension you could try:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dr_t = \kappa (\theta - r_t) dt + \sigma \sqrt{|r_t|} dW_t,$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where as usual $\kappa&amp;gt;0$ and $\theta&amp;gt;0$ but now we relax and allow $r_0&amp;lt;0.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this extended model, the short rate starts negative, but eventually goes positive and thereafter can never go negative again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think (but haven't checked!) that the usual bond pricing formulas extended to a negative initial rate are correct for this extended model.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2016-03-03T19:47:27.943" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24684" PostTypeId="1" CreationDate="2016-03-03T19:50:43.500" Score="1" ViewCount="78" Body="&lt;p&gt;I am creating a portfolio tracking model in Excel and have run into difficulty on how to track the overall performance of a single asset, given that over time more and less capital (shares) has been allocated to that asset. I want to determine the most fundamentally sound way to calculate this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think an example is best to illustrate this.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;At t=0, 100 shares of ABC stock are purchased for \$100 per share.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;At t=1, 50 shares of ABC stock, which now trades at (costs) \$200, are purchased.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;At t=2, 50 shares of ABC stock, which now trades at (costs) \$300, are purchased.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;At t=3, the portfolio holds 200 shares of ABC stock and ABC's current&#xA;price is \$400 per share.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So clearly the price change is (400/100–1) = 300%, but this needs to be adjusted for the fact that additional shares were added at a higher price, and so the total return for the portfolio's ownership of ABC stock is lower.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How is this figure calculated in practice? Is it sound to split up the asset into three (original purchase, add 1, and add 2), calculated each's return since purchase, and weight those returns by the number of shares?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, how would I handle selling shares? Say at t=3 I sold 50 shares at \$ 400 each and at t=5 each share (150 in total now) is worth \$ 500.  &lt;/p&gt;&#xA;" OwnerUserId="19763" LastEditorUserId="308" LastEditDate="2016-03-03T21:25:02.960" LastActivityDate="2016-03-03T21:25:02.960" Title="Computing Overall Return for A Single Asset Given Inflows &amp; Outflows" Tags="&lt;returns&gt;&lt;asset-returns&gt;" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="24685" PostTypeId="1" AcceptedAnswerId="24688" CreationDate="2016-03-03T19:53:30.720" Score="6" ViewCount="1113" Body="&lt;p&gt;I want to price Binary Option in Black-Scholes model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The payoff is of the form $f(S_{T})=I_{\{S_{T}-K&amp;gt;0\}}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we assume that $t=0$ this is easy, because then we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C_{0}=\mathbb{E}^{*}\left[e^{-rT}I_{\{S_{T}-K&amp;gt;0\}}|F_{0}\right]=e^{-rT}\mathbb{E}^{*}\left[I_{\{S_{T}-K&amp;gt;0\}}\right]=e^{-rT}Q(S_{T}&amp;gt;K)=\ldots$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But how to derive a price at any time $t\in[0,T]$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For any $t\in[0,T]$ we have something like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C_{t}=\mathbb{E}^{*}\left[e^{-r(T-t)}I_{\{S_{T}-K&amp;gt;0\}}|F_{t}\right]=e^{-r(T-t)}\mathbb{E}^{*}\left[I_{\{S_{T}-K&amp;gt;0\}}|F_{t}\right]=?$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to compute $\mathbb{E}^{*}\left[I_{\{S_{T}-K&amp;gt;0\}}|F_{t}\right]$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My attempt: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_{T}=S_{t}e^{(r-\frac{1}{2}\sigma^{2})(T-t)+\sigma(W^{*}_{T}-W^{*}_{t})}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that $W^{*}_{T}-W^{*}_{t}$ is independent with respect to $F_{t}$ (generated by Brownian Motion).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does $I_{\{S_{T}-K&amp;gt;0\}}$ is independent with respect to $F_{t}$? Why (if yes)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If yes $\mathbb{E}^{*}\left[I_{\{S_{T}-K&amp;gt;0\}}|F_{t}\right]=\mathbb{E}^{*}\left[I_{\{S_{T}-K&amp;gt;0\}}\right]=Q(S_{T}-K&amp;gt;0)=\ldots$&lt;/p&gt;&#xA;" OwnerUserId="19494" LastActivityDate="2016-03-13T11:41:37.990" Title="Binary Option in B-S model - technical question" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;binary-options&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24686" PostTypeId="2" ParentId="24681" CreationDate="2016-03-03T20:54:52.460" Score="1" Body="&lt;p&gt;Since you own a spread option, you are altering the payoff of a single 1M underlying. Therefore, the notional would be 1M. Personally, as long as the slope of the payoff is bounded by -1 &amp;lt;= slope &amp;lt;= 1, I would say the notional was 1M. &lt;/p&gt;&#xA;" OwnerUserId="19089" LastActivityDate="2016-03-03T20:54:52.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24687" PostTypeId="2" ParentId="24682" CreationDate="2016-03-03T21:15:47.237" Score="2" Body="&lt;p&gt;Note that $(S_T-K)^+ -S_T  \le 0$, By the dominance principle,&#xA;\begin{align*}&#xA;0 &amp;amp;\ge E\left(\frac{S_T-K)^+ -S_T}{e^{rT}}\right)\\&#xA;&amp;amp;= E\left(\frac{S_T-K)^+}{e^{rT}}\right) -  E\left(\frac{S_T}{e^{rT}}\right)\\&#xA;&amp;amp;=C(T, K, S)-S.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;C(T, K, S) \le S. \tag{1}&#xA;\end{align*}&#xA;On the other hand, since &#xA;\begin{align*}&#xA;(S_T-K)^+ -(S_T-K)\ge 0,&#xA;\end{align*}&#xA;by the dominance principle, &#xA;\begin{align*}&#xA;E\left(\frac{(S_T-K)^+ -(S_T-K)}{e^{rT}}\right) \ge 0.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;C(T, K, S) &amp;amp;\ge S-e^{-rT}K.\tag{2}&#xA;\end{align*}&#xA;Moreover, since &#xA;\begin{align*}&#xA;(S_T-K)^+ \ge 0,&#xA;\end{align*}&#xA;by the dominance principle again,&#xA;\begin{align*}&#xA;C(T, K, S) &amp;amp;\ge 0.\tag{3}&#xA;\end{align*}&#xA;In summary, from (1)-(3),&#xA;\begin{align*}&#xA;\big(S-e^{-rT}K\big)^+ \le C(T, K, S) \le S.&#xA;\end{align*}&#xA;Here, for a given volatility $\sigma$,&#xA;\begin{align*}&#xA;C(T, K, S)(\sigma) &amp;amp;= S\Phi(d_1)-e^{-rT} K \Phi(d_2),&#xA;\end{align*}&#xA;where &#xA;\begin{align*}&#xA;d_1= \frac{\ln\frac{S}{e^{-rT}K }+\frac{1}{2}\sigma^2T}{\sigma\sqrt{T}},&#xA;\end{align*} &#xA;and &#xA;\begin{align*}&#xA;d_2= \frac{\ln\frac{S}{e^{-rT}K}-\frac{1}{2}\sigma^2T}{\sigma\sqrt{T}},&#xA;\end{align*}&#xA;is a continuous function of $\sigma$. It is easy to see that&#xA;\begin{align*}&#xA;\lim_{\sigma \rightarrow +\infty}C(T, K, S)(\sigma) = S,&#xA;\end{align*} &#xA;and&#xA;\begin{align*}&#xA;\lim_{\sigma \rightarrow 0+}C(T, K, S)(\sigma) = \big(S-e^{-rT}K\big)^+.&#xA;\end{align*}&#xA;Therefore, for any value $C^*$ that satisfies&#xA;\begin{align*}&#xA;\big(S-e^{-rT}K\big)^+ &amp;lt; C^* &amp;lt; S,&#xA;\end{align*}&#xA;there is a volatility, which we denote by $\sigma^{imp}$, such that&#xA;\begin{align*}&#xA;C(T, K, S)(\sigma^{imp}) = C^*.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-03-04T17:21:59.683" LastActivityDate="2016-03-04T17:21:59.683" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24688" PostTypeId="2" ParentId="24685" CreationDate="2016-03-03T21:26:05.653" Score="6" Body="&lt;p&gt;$I_{\{S_{T}-K&amp;gt;0\}}$ is NOT independent of $\mathcal{F}_{t}$, since &#xA;\begin{align*}&#xA;S_T=S_t \, e^{(r-\frac{1}{2}\sigma^2)(T-t) + \sigma (W_T^*-W_t^*)},&#xA;\end{align*}&#xA;where $S_t \in \mathcal{F}_t$, though $e^{(r-\frac{1}{2}\sigma^2)(T-t) + \sigma (W_T^*-W_t^*)}$ is independent of $\mathcal{F}_t$.&#xA;However, since $W_T^*-W_t^*$ is independent of $\mathcal{F}_t$, you are able to compute&#xA;\begin{align*}&#xA;\mathbb{E}^{*}\left(I_{\{S_{T}-K&amp;gt;0\}}|F_{t}\right) &amp;amp;= Q(S_{T}-K&amp;gt;0 \mid \mathcal{F}_t)\\&#xA;&amp;amp;=Q\left(\sigma (W_T^*-W_t^*) \ge \ln\frac{K}{S_t} -(r-\frac{1}{2}\sigma^2)(T-t) \mid \mathcal{F}_t\right)\\&#xA;&amp;amp;=Q\left(\frac{W_T^*-W_t^*}{\sqrt{T-t}} \ge \frac{\ln\frac{K}{S_t} -(r-\frac{1}{2}\sigma^2)(T-t)}{\sigma \sqrt{T-t}} \mid \mathcal{F}_t\right)\\&#xA;&amp;amp;=1-N\left( \frac{\ln\frac{K}{S_t} -(r-\frac{1}{2}\sigma^2)(T-t)}{\sigma \sqrt{T-t}}\right)\\&#xA;&amp;amp;=N(d_2),&#xA;\end{align*}&#xA;since $\frac{W_T^*-W_t^*}{\sqrt{T-t}}\sim N(0, 1)$ is independent of $\mathcal{F}_t$, while $\frac{\ln\frac{K}{S_t} -(r-\frac{1}{2}\sigma^2)(T-t)}{\sigma \sqrt{T-t}}$ is $\mathcal{F}_t$ measurable. Here,&#xA;$$d_2 = \frac{\ln\frac{S_t}{K} + (r-\frac{1}{2}\sigma^2) (T-t)}{\sigma \sqrt{T-t}}$$&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-03-04T13:47:29.907" LastActivityDate="2016-03-04T13:47:29.907" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24689" PostTypeId="2" ParentId="24678" CreationDate="2016-03-03T21:58:07.293" Score="1" Body="&lt;p&gt;t.f thanks for the answer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You say that yields can't go negative in CIR. But if r0 (say 1d rate) is negative (which is the case in many govies today), I guess yields can be negative? And you will in this case be able to actually calibrate a CIR, which gives negative yields in the short end? My question might seem a bid odd, but I was just wondering?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But otherwise than that, the thing is i am investigating a displaced version so that $r_t+\alpha$, where $\alpha$ is a positive constant, has a CIR distribution. This models allows $r_t$ to be negative, and I can use the features from CIR. So I think that will work :-)    &lt;/p&gt;&#xA;" OwnerUserId="19761" LastEditorUserId="16991" LastEditDate="2016-03-05T09:27:09.470" LastActivityDate="2016-03-05T09:27:09.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24691" PostTypeId="1" CreationDate="2016-03-04T02:19:33.823" Score="2" ViewCount="58" Body="&lt;p&gt;A friend of mine insists that that the following is a sound method to calculate the performance of a &lt;em&gt;single&lt;/em&gt; holding in a portfolio, given that over time more capital has been allocated to that holding. My questions are these&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is this a theoretically sound way to calculate performance?&lt;/li&gt;&#xA;&lt;li&gt;Is there a name for this?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The method is exemplified as follows with shares in a security being held. As additional shares are bought, their total return since purchase is calculated, weighted by the number of shares as a percentage of the total, and summed. No dates are used in the calculation.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;                    Shares    Price    Return to Today  Weight   Return x Weight&#xA;Original purchase   117       $260.91   177.82%         32.14%    57.16%&#xA;Add 1               +37       $379.88    90.81%         10.16%     9.23%&#xA;Add 2              +172       $541.33    33.90%         47.25%    16.02%&#xA;Add 3               +38       $568.56    27.49%         10.44%     2.87%&#xA;                                                                  -------&#xA;Today             364 total   $724.86                        Sum: 85.28%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And thus my friend says it is most appropriate to say that the overall return of this holding, given the additional shares bought at a higher price, is 85.28%. He says a cost basis method, which implies a 66% return, is incorrect because it assumes all shares were bought at $438 at the same time. He also says that the total return since the original purchase (178%) is not representative because the shares purchased later did not return this much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I am afraid I posted a question earlier that lent itself more to discussion than an actual answer. I hope this is not considered duplicate posting.)&lt;/p&gt;&#xA;" OwnerUserId="19763" LastEditorUserId="19763" LastEditDate="2016-03-04T02:25:34.870" LastActivityDate="2016-03-04T02:25:34.870" Title="Is a position-weighted sum of nominal returns for a single asset a mathematically sound calculation?" Tags="&lt;asset-returns&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24692" PostTypeId="1" CreationDate="2016-03-04T10:00:12.993" Score="1" ViewCount="180" Body="&lt;p&gt;Is there concrete evidence that statistical arbitrage (historical vs. implied) on higher moments, specifically skewness and kurtosis, can be (significantly) done?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Working from &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0471733873&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; source, the author finds clear evidence on volatility arbitrage. Which is mainstream, very well understood, and heavily done (e.g. VIX trading). But, to take the discussion further, &lt;a href=&quot;http://imcs.dvfu.ru/lib.int/docs/Non-tech/Management/Applied%20Quantitative%20Finance.pdf&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; research (Chapter 9 - Trading on Deviations of Implied and Historical Distributions) is specifically addressing this question, applied on DAX data, which is not a as liquid as the equivalent US options markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, my main question is: has anyone done any empirical work on this topic and could relate to it?&lt;/p&gt;&#xA;" OwnerUserId="1352" LastActivityDate="2016-11-30T16:32:47.613" Title="Higher moments arbitrage" Tags="&lt;volatility&gt;&lt;arbitrage&gt;&lt;skewness&gt;&lt;kurtosis&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24693" PostTypeId="1" CreationDate="2016-03-04T10:37:05.600" Score="2" ViewCount="254" Body="&lt;p&gt;I am trying to mimimize the following function in order to calibrate the Libor Market Model&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sum_{i=1}^{n} \left(\sigma_i^{market}-\sigma_i^{Reb}\left(a,b,c,d,\beta\right)/\sqrt{T_i}\right)^2,$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\sigma_i^{market}$ is given and $\sigma_i^{Reb}\left(a,b,c,d,\beta\right)$ is a nonlinear function in the unknown parameters $a,b,c,d,\beta$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The parameters should have the following constraints:&#xA;$$a+d&amp;gt;0$$&#xA;$$d&amp;gt;0$$&#xA;$$c&amp;gt;0$$&#xA;$$\beta \geq 0$$&#xA;Which numerical optimizer method in Matlab would be a good candidate such that the constraints are satisfied?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to implement the calibration with the unconstraint local optimizer fminsearch based on the Downhill-simplex algorithm. Nevertheless, with different choices of initial values of the parameters, the algorithm converges to parameters that do not respect the constraints. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I decided to try a constrained numerical optimizer, the non linear least squares method (lsqnonlin) in Matlab with as lowerbounds 0 for the last three constraints. However, I do not know how to impose constraint number 1 with this method. Does someone have any suggestions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would the (unconstrained?) Levenberg Marquardt be a good candidate? Other ideas?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance.&lt;/p&gt;&#xA;" OwnerUserId="19279" LastEditorUserId="19279" LastEditDate="2016-03-04T10:44:13.340" LastActivityDate="2016-03-04T12:12:38.640" Title="Numerical Optimizer Matlab Calibration LMM" Tags="&lt;optimization&gt;&lt;matlab&gt;&lt;calibration&gt;&lt;numerical-methods&gt;&lt;lmm&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24694" PostTypeId="1" AcceptedAnswerId="24736" CreationDate="2016-03-04T11:47:03.183" Score="7" ViewCount="3497" Body="&lt;p&gt;I have a question regarding the application of a shift to the Black-Scholes formula for negative forward rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am reading in the Brigo book that &quot;&lt;strong&gt;increasing the shift $\alpha$ shifts the volatility curve down, whereas decreasing $\alpha$ shifts the curve up&lt;/strong&gt;&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this not imply then that the probability distribution will consequently change and thus prices will be affected? If that is the case, then isn't applying a shift to the distribution causing misprices for e.g. caps/floors/swaptions ?&lt;/p&gt;&#xA;" OwnerUserId="13457" LastActivityDate="2016-03-07T17:31:17.753" Title="Implications of shifting the lognormal model for forward rates from a probability perspective" Tags="&lt;black-scholes&gt;&lt;implied-volatility&gt;&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24695" PostTypeId="2" ParentId="24693" CreationDate="2016-03-04T12:12:38.640" Score="2" Body="&lt;p&gt;You might want to set $a= \epsilon - d$ and write $\epsilon&amp;gt;0$ as a constraint.&#xA;I guess $\textbf{lsqnonlin}$ is the suitable fonction for what you intend to do. I personnally like to use and play around with $\textbf{fmincon}$, which allows more flexibility and performs well, if you are willing to provide Jacobian and/or Hessian in algorithms options&lt;/p&gt;&#xA;" OwnerUserId="17986" LastActivityDate="2016-03-04T12:12:38.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24696" PostTypeId="1" AcceptedAnswerId="24700" CreationDate="2016-03-04T12:38:35.817" Score="13" ViewCount="4219" Body="&lt;p&gt;Several machine learning algorithms have been applied in finance/trading. Focusing on clustering (k-means, k-medoids) what are useful and successful applications in quantitative finance? What is used by practitioners? Are there references or reports available?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: After those very good remarks and answers I wanted to insert this &lt;a href=&quot;https://systematicinvestor.wordpress.com/2013/01/12/examples-of-current-major-market-clusters/&quot; rel=&quot;nofollow&quot;&gt;link&lt;/a&gt; where clustering and the development of clusters of asset classes (gold, stocks, bonds and much more) is presented.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="185" LastEditDate="2016-08-31T04:56:41.843" LastActivityDate="2016-08-31T04:56:41.843" Title="Which are useful applications of clustering in quantitative finance?" Tags="&lt;machine-learning&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24697" PostTypeId="1" CreationDate="2016-03-04T13:25:15.417" Score="7" ViewCount="135" Body="&lt;p&gt;I have read the paper written by Egloff (2005) using machine learning techniques to solve the optimal stopping problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any development in pricing American options during 2005-2016? (based on Monte Carlo)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I appreciate it if you can offer me some clues!&lt;/p&gt;&#xA;" OwnerUserId="15232" LastActivityDate="2016-03-04T13:25:15.417" Title="recent developments in American options?" Tags="&lt;option-pricing&gt;&lt;reference-request&gt;&lt;american-options&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24698" PostTypeId="1" CreationDate="2016-03-04T18:40:04.743" Score="1" ViewCount="22" Body="&lt;p&gt;I am still struggling to estimate my model on Eviews. I know it should be really simplistic to do it,but without in depth Eviews knowledge it can be rather tricky. For instance, looking at the highlighted bit in the file , how would you estimate in Eviews? I will be really grateful if any of you could help me on that as it is basically the only thing holding me back. For some reason I could not upload the picture , however, here is the link for the model : &lt;a href=&quot;http://s8.postimg.org/o4z6ln8f9/Untitled.png&quot; rel=&quot;nofollow&quot;&gt;http://s8.postimg.org/o4z6ln8f9/Untitled.png&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="19621" LastActivityDate="2016-03-04T18:40:04.743" Title="how to specify given model on Eviews?" Tags="&lt;software&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24699" PostTypeId="1" AcceptedAnswerId="24702" CreationDate="2016-03-05T01:18:37.773" Score="3" ViewCount="73" Body="&lt;p&gt;I have this process:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dx_t = -\frac{k}{2}x_tdt + \frac{\beta}{2}dz_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and must prove it's normally distributed with first two moments:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mu = e^{-\frac{1}{2}kt}x_0$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma^2 = \frac{\beta^2}{4k}(1-e^{-kt})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to multiply $x_t$ by $e^{kt}$ and apply Ito's Lemma to this 'product process' in order to eventually recover back $x_t$ by taking exponentials.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The normality is straightfoward; the variance is ok but the mean isn't since I'm left with an integral whose integrand includes $x_t$ and I'm stuck.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know whether I made some mistakes or adopted the wrong approach since the beginning.&lt;/p&gt;&#xA;" OwnerUserId="19280" LastActivityDate="2016-03-05T09:02:05.957" Title="prove the normality, with given moments, of this process:" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24700" PostTypeId="2" ParentId="24696" CreationDate="2016-03-05T02:49:13.593" Score="8" Body="&lt;p&gt;One potential use I could imagine would be identifying paradigm shifts / regime change. Just as a quick toy example, maybe you're interested in how gold is often considered a hedge against downturns in the stock market. Say you are building a trading strategy based on that intuition, but want your model to be more flexible by identifying different regimes for which different approaches might work better. Clustering methods might help in that analysis. Here's a quick example of how one might visualize that type of thing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/UIekH.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/UIekH.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also found a few resources on the web after a quick search that you might find interesting.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.lorentzcenter.nl/lc/web/2013/566/presentations/Contributed%20talk_Musmeci.pdf&quot; rel=&quot;noreferrer&quot;&gt;Dynamical analysis of clustering on financial market data&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://itg.com/news_events/papers/Cluster-Analysis.pdf&quot; rel=&quot;noreferrer&quot;&gt;Cluster Analysis for Evaluating Trading Strategies&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://gregharris.info/a-survey-of-deep-learning-techniques-applied-to-trading/&quot; rel=&quot;noreferrer&quot;&gt;Survey of Deep Learning Techniques Applied to Trading&lt;/a&gt; (more general ML but still a good read)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;R code used to make the plot:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(Quandl)&#xA;syms = c(SP500=&quot;YAHOO/INDEX_GSPC.4&quot;, Gold=&quot;CHRIS/CME_GC1.6&quot;)&#xA;nmeans = 3&#xA;prices = na.omit(Quandl(syms, type='xts'))&#xA;df = as.data.frame(prices)&#xA;clusters = kmeans(df, centers=nmeans)$cluster&#xA;par(mar=c(2.5,2.5,0.5,0.5), mgp=c(1.5,0.5,0), family='mono', cex=0.7)&#xA;x = as.numeric(prices[,1])&#xA;y = as.numeric(prices[,2])&#xA;plot(x, y, pch=-1, xlab=names(syms)[1], ylab=names(syms)[2])&#xA;for (i in 1:nmeans){&#xA;    xx = df[clusters==i,1]&#xA;    yy = df[clusters==i,2]&#xA;    points(xx, yy, pch=19, col=rgb(t(col2rgb(i)/255), alpha=0.2))&#xA;    f = lm(yy~poly(xx, 3))&#xA;    lines(x=xx, y=predict.lm(f, data.frame(x=xx)), col=i, lwd=2)&#xA;}&#xA;grid(lty=1, col=rgb(0,0,0,0.2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7385" LastEditorUserId="7385" LastEditDate="2016-05-31T14:25:07.610" LastActivityDate="2016-05-31T14:25:07.610" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24702" PostTypeId="2" ParentId="24699" CreationDate="2016-03-05T08:13:32.257" Score="1" Body="&lt;p&gt;You have following SDE&#xA;$$dx_t=-\frac{k}{2}x_t dt+ \frac{\beta}{2}dz_t \tag{1}$$&#xA;Consider,  $f=e^{\frac{k}{2}t}x_t$. Using Ito:&#xA;$$df= \frac{k}{2}e^{\frac{k}{2}t}x_t\, dt+ e^{\frac{k}{2}t} \,dx_t \tag{2} $$&#xA;So, we have&#xA;\begin{align}&#xA;d\left(e^{\frac{k}{2}t}x_t\right)&amp;amp;= \frac{k}{2}e^{\frac{k}{2}t}x_t\, dt + e^{\frac{k}{2}t} \left(-\frac{k}{2}x_t dt+ \frac{\beta}{2}dz_t \right)\\&#xA;&amp;amp;= \frac{\beta}{2}e^{\frac{k}{2}t}dz_t&#xA;\end{align}&#xA;Note: &lt;strong&gt;RHS does not involve $x_t$&lt;/strong&gt;. Now integrate both side to get your answer. &lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="16991" LastEditDate="2016-03-05T09:02:05.957" LastActivityDate="2016-03-05T09:02:05.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24703" PostTypeId="2" ParentId="24678" CreationDate="2016-03-05T12:06:25.280" Score="1" Body="&lt;p&gt;In the industry the model I have used is the 'shifted Sabr' where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dx(t) = \sigma(t) [x(t)-c]^\beta dW(t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d\sigma(t) = \alpha \sigma(t) dZ(t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dW(t)\ dZ(t) = \rho\ dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This allows for rates down to the parameter $c$. If you set, for example, $c=-200bp$ then you can have negative rates. You can define a CIR variant in an analogous way. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have used this model both for pricing and for risk scenario/ path generation. The rule of thumb I used to set $c$ around 'current rate minus 2 normal implied ATM vols'. Obviously I cannot give proprietory details on the implementation here, but you should be able to work them out yourself. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ps: There is always the option of the CIR++ models in Brigo and Mercurio, where you have a normal CIR and add a deterministic shift $\theta(t)$. It is a relatively simple and well documented alternative. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-03-05T12:06:25.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24704" PostTypeId="2" ParentId="9587" CreationDate="2016-03-05T12:11:29.090" Score="1" Body="&lt;p&gt;To the best of my knowledge there is no public implementation in matlab. However both R and Ox have some packages devoted to this end :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Ox - see &lt;a href=&quot;http://www.oxmetrics.net/&quot; rel=&quot;nofollow&quot;&gt;G@rch&lt;/a&gt; package&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-R  - see &lt;a href=&quot;https://cran.r-project.org/web/packages/rugarch/index.html&quot; rel=&quot;nofollow&quot;&gt;rugarch&lt;/a&gt; package&lt;/p&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2016-03-05T12:11:29.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24705" PostTypeId="1" CreationDate="2016-03-05T12:27:59.630" Score="2" ViewCount="115" Body="&lt;p&gt;I was analysing ibex implied volatility and when I draw it I found it was reversed:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/bIotJ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/bIotJ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;X axis are the strikes and Y axis implied volatilities calculated by BS. The blue line is the spot price. Data (option price and strike) is gotten from MEFF daily info (&lt;a href=&quot;http://www.meff.com/docs/Ficheros/boletin/esp/boletinpfri.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.meff.com/docs/Ficheros/boletin/esp/boletinpfri.htm&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I first thought I made a mistake but I checked with SP500 and I obtained a normal smile volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you have any idea why it has this shape? Hull says that it’s possible when a single large jump is anticipated but he talks about a stock not an index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot&lt;/p&gt;&#xA;" OwnerUserId="19785" LastEditorUserId="19645" LastEditDate="2021-05-05T08:44:27.963" LastActivityDate="2021-05-05T08:44:27.963" Title="Inverse Smile Volatility Ibex35" Tags="&lt;implied-volatility&gt;&lt;volatility-smile&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24706" PostTypeId="1" AcceptedAnswerId="24714" CreationDate="2016-03-05T15:52:21.467" Score="1" ViewCount="81" Body="&lt;p&gt;I have daily currency returns. For each month, I have to find the return associated to the 5% lower tail quantile for each currency (the lowest return or the second lowest return).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you please tell me how to do it using Excel?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="17810" LastActivityDate="2016-03-05T19:06:08.560" Title="find the qth lower tail quantile" Tags="&lt;returns&gt;&lt;distribution&gt;&lt;excel&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24707" PostTypeId="2" ParentId="22685" CreationDate="2016-03-05T17:05:30.970" Score="3" Body="&lt;p&gt;This question has already been answered on &lt;a href=&quot;https://stackoverflow.com/a/9970180&quot;&gt;Stack Overflow&lt;/a&gt;. As  it is important to  Quant Finance, so I have added R code here. Others users may add code of other programming software to simulate ARMA(1,0)-GARCH(1,1) model. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sim.GARCH &amp;lt;- function(&#xA;  horizon=5, N=1e4, &#xA;  h0 = 2e-4, &#xA;  mu = 0, omega=0,&#xA;  alpha1 = 0.027,&#xA;  beta1  = 0.963&#xA;){&#xA;  ret &amp;lt;- zt &amp;lt;- et &amp;lt;- ht &amp;lt;- matrix(NA, nc=horizon, nr=N)&#xA;  ht[,1] &amp;lt;- h0&#xA;  for(j in 1:horizon){&#xA;    zt[,j]   &amp;lt;- rnorm(N,0,1)&#xA;    et[,j]   &amp;lt;- zt[,j]*sqrt(ht[,j])&#xA;    ret[,j]  &amp;lt;- mu + et[,j]&#xA;    if( j &amp;lt; horizon )&#xA;      ht[,j+1] &amp;lt;- omega+ alpha1*et[,j]^2 + beta1*ht[,j]&#xA;  }&#xA;  apply(ret, 1, sum)&#xA;}&#xA;x &amp;lt;- sim.GARCH(N=1e5)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2016-03-05T17:17:07.777" CommentCount="0" CommunityOwnedDate="2016-03-05T17:05:30.970" ContentLicense="CC BY-SA 3.0" />
  <row Id="24708" PostTypeId="2" ParentId="24706" CreationDate="2016-03-05T17:29:45.580" Score="0" Body="&lt;p&gt;Just arrange your data in ascending or descending order using filter tab in Excel.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Data &lt;span class=&quot;math-container&quot;&gt;$&amp;lt;-$&lt;/span&gt; Filter &lt;span class=&quot;math-container&quot;&gt;$&amp;lt;-$&lt;/span&gt; Sort Smallest to Largest&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ayTzl.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ayTzl.jpg&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;If there are 20 days in each month, then select second lowest return for each month.&lt;/p&gt;&#xA;&lt;p&gt;Otherwise, You may use parametric approach to estimate 5% lower quantile for each and every month.&lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-03-05T17:29:45.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24709" PostTypeId="2" ParentId="14779" CreationDate="2016-03-05T17:41:10.587" Score="0" Body="&lt;p&gt;&lt;strong&gt;Intuitive explanation:&lt;/strong&gt; CDS spread goes up which results in an increased uncertainty in credit quality which itself results in the increase in equity volatility. CB is a debt instrument with an embedded call option, when you are long call option you are long gamma (volatility of underlying). Such relationship would generally work for marginal changes in CDS spread, and most likely will break for drastic increase in CDS spread as the CB becomes more out-of-the money and will act more as bond discounted at higher rates.&lt;/p&gt;&#xA;" OwnerUserId="18275" LastActivityDate="2016-03-05T17:41:10.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24710" PostTypeId="1" AcceptedAnswerId="24711" CreationDate="2016-03-05T17:50:33.407" Score="2" ViewCount="30" Body="&lt;p&gt;I've just learned about martingale, but i could not find any reason that we use greater than or equal to sign when we define submartingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In stead of using greater than or equal to symbol, can't we use greater symbol and it seems to be more intuitive &lt;/p&gt;&#xA;&#xA;&lt;p&gt;so&#xA;my question is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;why $E\left( {{M_{n + 1}}|{F_n}} \right) \ge {M_n}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;instead of $E\left( {{M_{n + 1}}|{F_n}} \right) \gt {M_n}$ ?&lt;/p&gt;&#xA;" OwnerUserId="17849" LastActivityDate="2016-03-05T18:03:52.937" Title="why do we use greater than or equal to for submartingale?" Tags="&lt;martingale&gt;&lt;statistical-finance&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24711" PostTypeId="2" ParentId="24710" CreationDate="2016-03-05T18:03:52.937" Score="0" Body="&lt;p&gt;If $M_{n}$ is &lt;strong&gt;discrete random variable&lt;/strong&gt;, then process is submartingale, if it satisfy: &#xA;$$E[M_{t+1}|M_t] &amp;gt; M_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if $M_t$ is &lt;strong&gt;continuous random variable&lt;/strong&gt; (which is assumed here), then both the expression&#xA;$$E[M_{t+1}|M_t] &amp;gt; M_t$$&#xA;$$E[M_{t+1}|M_t] \ge M_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;are equivalent. You may write in either way. For a continuous variable, $X \ge K $ is same as $X &amp;gt;K$.&lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2016-03-05T18:03:52.937" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24712" PostTypeId="2" ParentId="24643" CreationDate="2016-03-05T18:15:34.490" Score="2" Body="&lt;p&gt;&lt;a href=&quot;https://www.msci.com/resources/research/technical_documentation/RM2006.pdf&quot; rel=&quot;nofollow&quot;&gt;The RiskMetrics 2006 methodology&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Therefore, the new RM2006 methodology can be summarized as based&#xA;  on a ARCH-like process with &lt;em&gt;long memory + Student distribution + residuals scale correction&#xA;  + lagged correlations&lt;/em&gt; between returns. All the ingredients contribute to the performances,&#xA;  albeit possibly at different risk horizons or according to different performance measures. At&#xA;  the end, the new RM2006 is clearly a more complicated methodology than the simple exponential&#xA;  moving average of RM1994. This is the price to pay for the increased accuracies and&#xA;  the possibility to reach long risk horizons&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;also:&#xA;&lt;a href=&quot;https://www.msci.com/resources/research/technical_documentation/RM2006_introduction.pdf&quot; rel=&quot;nofollow&quot;&gt;A gentle introduction to the RM 2006 methodology&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="18275" LastActivityDate="2016-03-05T18:15:34.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24713" PostTypeId="2" ParentId="24706" CreationDate="2016-03-05T19:00:43.393" Score="0" Body="&lt;p&gt;Use this R package: Performance Analytics&#xA;Link: &lt;a href=&quot;https://cran.r-project.org/web/packages/PerformanceAnalytics/index.html&quot; rel=&quot;nofollow&quot;&gt;https://cran.r-project.org/web/packages/PerformanceAnalytics/index.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19340" LastActivityDate="2016-03-05T19:00:43.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24714" PostTypeId="2" ParentId="24706" CreationDate="2016-03-05T19:06:08.560" Score="0" Body="&lt;p&gt;Use =PERCENTILE(range, 0.05)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where range refers to the returns in question&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2016-03-05T19:06:08.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24715" PostTypeId="1" CreationDate="2016-03-05T19:17:20.953" Score="2" ViewCount="393" Body="&lt;p&gt;I am performing option pricing using Heston model and Euler discretization. &#xA;I'm getting the following result:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1000    6.81982     &#xA;500     6.85281  &#xA;250     6.81557     &#xA;200     6.78875     &#xA;150     6.79469     &#xA;100     6.77717     &#xA;50      6.72955 &#xA;30      6.68981     &#xA;10      6.42615 &#xA;10      6.41056&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where the first column denotes the number of discretization intervals, and the second one is an option price. &#xA;Number of simulation paths is equal to 100000 and true option price is 6.8061 as in the following link:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.quantstart.com/articles/Heston-Stochastic-Volatility-Model-with-Euler-Discretisation-in-C&quot; rel=&quot;nofollow&quot;&gt;https://www.quantstart.com/articles/Heston-Stochastic-Volatility-Model-with-Euler-Discretisation-in-C&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What can be the reason for the decreasing option price when the number of discretization intervals is decreasing as well?&lt;/p&gt;&#xA;" OwnerUserId="5079" LastEditorUserId="5079" LastEditDate="2016-03-06T12:47:36.840" LastActivityDate="2016-03-06T12:47:36.840" Title="Euler discretization bias, heston model" Tags="&lt;option-pricing&gt;&lt;heston&gt;&lt;euler&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24717" PostTypeId="1" AcceptedAnswerId="24722" CreationDate="2016-03-05T20:46:26.963" Score="2" ViewCount="2457" Body="&lt;p&gt;I originally got the idea from &lt;a href=&quot;http://shop.oreilly.com/product/0636920032441.do&quot; rel=&quot;nofollow&quot;&gt;Python for Finance&lt;/a&gt;. But there are nomerous other examples on how to get high &lt;a href=&quot;http://hopey.netfonds.no/market.php&quot; rel=&quot;nofollow&quot;&gt;Netfonds&lt;/a&gt; (&lt;a href=&quot;https://github.com/hamiltonkibbe/stocks/blob/master/sources/netfonds.py&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;https://github.com/pcawthron/Python/blob/master/TA-Lib/Netfonds%20Example/NetFonds%20Data%20Fetch.py&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They don't seem to work any more:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://hopey.netfonds.no/posdump.php?date=20121130&amp;amp;paper=GOOG.O&amp;amp;csv_format=csv&quot; rel=&quot;nofollow&quot;&gt;http://hopey.netfonds.no/posdump.php?date=20121130&amp;amp;paper=GOOG.O&amp;amp;csv_format=csv&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;seems to yield nothing. Has anyone successfully scraped data from them? Are there other free sources?&lt;/p&gt;&#xA;" OwnerUserId="15763" LastActivityDate="2016-03-06T12:41:13.010" Title="netfonds.no - High Frequency Data" Tags="&lt;high-frequency&gt;&lt;historical-data&gt;&lt;tick-data&gt;&lt;data-source&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24719" PostTypeId="1" CreationDate="2016-03-05T22:59:05.563" Score="7" ViewCount="1377" Body="&lt;p&gt;I am trying to create a database which will hold information for various stock options and will need to be updated daily. The idea is to use this database to keep track of changes in the open interest and use that for trading and research.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using powershell to automatically download the data every morning from the following website: &lt;a href=&quot;http://www.theocc.com/webapps/series-search?symbolType=U&amp;amp;symbol=IBM&quot;&gt;http://www.theocc.com/webapps/series-search?symbolType=U&amp;amp;symbol=IBM&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The downloaded file contains the ticker symbol, strike price, expiration date, call OI and put OI and some other items that I don't care about.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The purpose of this database is to track the OI changes on a daily basis and create reports. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't have much experience with database designing so I am not sure how to proceed. Which database will be best to use? MSSQL, MySQL, NoSQL, etc.? I think I will need the above mentioned columns and a column for the datetime stamp of the record. Am I on the right track?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to automate this as much as possible. If there is something out there that is already able to do this I might use that as well rather than recreating the wheel. I am open to suggestions on how to get the best results out of this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="19793" LastActivityDate="2019-08-11T16:52:58.703" Title="Creating Options Database" Tags="&lt;options&gt;&lt;database&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24720" PostTypeId="1" CreationDate="2016-03-06T02:53:03.810" Score="2" ViewCount="1180" Body="&lt;p&gt;So, basically I want to debate and find out the real reason behind being flag by ECNs and venues as &quot;toxic&quot;.&#xA;How to avoid being flagged?&#xA;What kind of strategies are toxic and why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is an article found by a brokerage firm... so the opinion in that article couldn't be that objective.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.financemagnates.com/forex/bloggers/what-is-toxic-fx-flow/&quot; rel=&quot;nofollow&quot;&gt;Article about toxix FX flow&lt;/a&gt;&#xA;&lt;br /&gt;&#xA;&lt;br /&gt;&#xA;&lt;br /&gt;&#xA;Any thoughts?&lt;/p&gt;&#xA;" OwnerUserId="13990" LastEditorUserId="16160" LastEditDate="2016-08-21T18:14:35.240" LastActivityDate="2016-08-21T23:15:23.573" Title="What is Toxic FX Flow debate?" Tags="&lt;fx&gt;&lt;arbitrage&gt;&lt;market-microstructure&gt;&lt;market-making&gt;&lt;market-model&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24722" PostTypeId="2" ParentId="24717" CreationDate="2016-03-06T12:41:13.010" Score="2" Body="&lt;p&gt;I did not know this provider, but had a look.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;for daily data, the url seems to be &lt;a href=&quot;http://www.netfonds.no/quotes/paperhistory.php?paper=GOOG.O&amp;amp;csv_format=txt&quot; rel=&quot;nofollow&quot;&gt;http://www.netfonds.no/quotes/paperhistory.php?paper=GOOG.O&amp;amp;csv_format=txt&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;for market depth: &lt;a href=&quot;http://www.netfonds.no/quotes/posdump.php?date=20160303&amp;amp;paper=E-SABL.BTSE&amp;amp;csv_format=txt&quot; rel=&quot;nofollow&quot;&gt;http://www.netfonds.no/quotes/posdump.php?date=20160303&amp;amp;paper=E-SABL.BTSE&amp;amp;csv_format=txt&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;for intraday trades: &lt;a href=&quot;http://www.netfonds.no/quotes/tradedump.php?paper=E-SABL.BTSE&amp;amp;csv_format=txt&quot; rel=&quot;nofollow&quot;&gt;http://www.netfonds.no/quotes/tradedump.php?paper=E-SABL.BTSE&amp;amp;csv_format=txt&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;the timestamps seems to be at the second only...&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2016-03-06T12:41:13.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24723" PostTypeId="2" ParentId="17910" CreationDate="2016-03-06T13:18:14.560" Score="0" Body="&lt;p&gt;I would say, the Monte Carlo may be not necessary in your case. You may look through the paper &#xA;&lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S0167715215003247&quot; rel=&quot;nofollow&quot;&gt;http://www.sciencedirect.com/science/article/pii/S0167715215003247&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S0167715215003247&quot; rel=&quot;nofollow&quot;&gt;enter link description here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good Luck!&lt;/p&gt;&#xA;" OwnerUserId="16993" LastActivityDate="2016-03-06T13:18:14.560" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24724" PostTypeId="2" ParentId="24719" CreationDate="2016-03-06T14:47:39.060" Score="1" Body="&lt;p&gt;You are in the right track. &#xA;I've been in the same situation, you won't find anything out there, so I end up to create my own database to track daily stock options. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my case I use ms sql server, but you can use the others you named as well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, keep in mind that the daily data is huge, and your database will grow considerably over time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been collecting daily option for All optionable stocks and the size of the database is more than 6gb&#xA;(I also save all the Greeks and different IV values) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good luck. &lt;/p&gt;&#xA;" OwnerUserId="13990" LastActivityDate="2016-03-06T14:47:39.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24725" PostTypeId="1" CreationDate="2016-03-06T15:50:22.053" Score="2" ViewCount="145" Body="&lt;p&gt;I have an event that takes place over a period of a few days, and I want to estimate the effect it has on market volatility using intraday data with one minute frequency. The problem is, that e.g. GARCH, EGARCH and GJR are not able to account for the asymmetry in the distribution of the observations because there are several observations that lay well outside normal distribution (e.g. many of the stocks have 20+ 5 sigma returns during the sample period, majority of these during the event window).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I am interested in the effect that the aforementioned event has on volatility, I am trying to understand how to deal with these outliers. They obviously carry relevant information, and thus including dummy variables to account for every outlier would seem impractical and not very reasonable? My initial intuition for solving the problem was running whatever ARCH model gives the best fit and include dummy for the event period, but now I am starting to question whether this is the right method with the data I am working with after all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All advice and references to articles I might've missed are greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="18607" LastActivityDate="2016-03-07T17:20:54.180" Title="Events effect on intraday volatility and large outliers" Tags="&lt;volatility&gt;&lt;garch&gt;&lt;intraday&gt;&lt;outliers&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24726" PostTypeId="1" AcceptedAnswerId="24729" CreationDate="2016-03-06T20:26:18.327" Score="2" ViewCount="751" Body="&lt;p&gt;I'm trying to maximize my portfolio, but don't know how to deal with the constraint which is on the form &lt;/p&gt;&#xA;&#xA;&lt;p&gt;max $2u^Tx-x^T \Sigma x$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Subject to &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$e^Tx = 1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$u^Tx - m (x^T \Sigma x)^{1/2} &amp;gt;= c $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $\Sigma$ is the covariance and psd matrix and &#xA;$u$ is the expected return. $e^T$ is a vector consisting of ones (1,...,1). $m$ and $c$ are constants&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know how to deal with the square root. (I'm using R)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers&lt;/p&gt;&#xA;" OwnerUserId="19265" LastActivityDate="2016-03-07T08:59:15.930" Title="Dealing with a constraint which is the square root of a quadratic form" Tags="&lt;programming&gt;&lt;optimization&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24727" PostTypeId="1" CreationDate="2016-03-06T20:58:19.930" Score="4" ViewCount="177" Body="&lt;p&gt;My book says that for a portfolio of two stocks:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma_p = \sqrt{w_A^2 \sigma_A^2 + (1-w_A)^2 \sigma_B^2 + 2 w_A (1 - w_A) \rho_{AB} \sigma_A \sigma_B}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Elsewhere it says that if the correlation is -1, then the standard deviation is 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I substitute $\rho_{AB}$ with $-1$ clearly $\sigma_p \neq 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I missing here?&lt;/p&gt;&#xA;" OwnerUserId="19800" LastActivityDate="2016-03-10T11:32:25.950" Title="Correlation -1 and standard deviation" Tags="&lt;portfolio-management&gt;&lt;capm&gt;&lt;covariance&gt;" AnswerCount="1" CommentCount="5" ClosedDate="2016-03-07T20:13:57.150" ContentLicense="CC BY-SA 3.0" />
  <row Id="24728" PostTypeId="1" AcceptedAnswerId="24745" CreationDate="2016-03-07T02:00:33.430" Score="2" ViewCount="127" Body="&lt;p&gt;An investor deposits USD 300 in a bank account at time 0, reinvests all interest payments and continuously invests USD 300 per annum, until the total value of the deposits reaches USD 3312. At that point the investor stops making additional deposits, but still lets the interest payments accumulate in the account.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The ODE for the value of the deposits, $V$, over time is then, $$\frac{dV}{dt}=r(t)V(t)+I(t),$$ where $I(t)=300$ until $V(t)$ reaches $V$=3312, at which point $I(t)$ instantaneously switched to $I(t)=0.$ Also, $r(t)=\frac{1}{20+\frac{t}{2}}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Derive an expression for the value of the asset as a function of time, $V(t)$, $t\geq 0.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\textbf{My Approach: }$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried the problem by using the formula,&#xA;$$V(t)=e^{-P(T)}\Bigg{(}\int_{0}^{T}e^{P(t)}q(t)dt + c\Bigg{)}, \text{    } c\in \mathbb{R},$$&#xA;where $P(t)=\int_{0}^{t}r(t)dt$. I don't know how to progress any further. Any help will be greatly appreciated. Thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="19698" LastEditorUserId="7385" LastEditDate="2016-03-08T09:14:41.553" LastActivityDate="2016-03-08T14:49:30.590" Title="Derive an expression for the value of the asset as a function of time, V(t), t&gt;=0" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;asset-pricing&gt;&lt;derivation&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24729" PostTypeId="2" ParentId="24726" CreationDate="2016-03-07T02:00:55.910" Score="1" Body="&lt;p&gt;$$u^Tx - m (x^T \Sigma x)^{1/2} \geq c$$&#xA;is the same as&#xA;$$u^Tx-c \geq  m (x^T \Sigma x)^{1/2} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is the same as &#xA;$$(u^Tx-c)^2 \geq  m (x^T \Sigma x)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This has no square roots.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2016-03-07T02:00:55.910" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24730" PostTypeId="1" CreationDate="2016-03-07T07:26:12.360" Score="3" ViewCount="135" Body="&lt;p&gt;In my thesis I want to work with delta hedging with stochastic volatility using Black-Scholes model. How will you suggest I implement numerical solutions using data from the real world? Beside Monte Carlo, which numerical solutions will be useful?&lt;/p&gt;&#xA;" OwnerUserId="19804" LastActivityDate="2016-03-07T07:26:12.360" Title="delta hedging with stochastic volatility" Tags="&lt;stochastic-volatility&gt;&lt;black-scholes-merton&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24731" PostTypeId="2" ParentId="24726" CreationDate="2016-03-07T08:59:15.930" Score="0" Body="&lt;p&gt;I thought of that at first but I was confused how to reformulate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(u^T x)^2 + 2 c u^Tx - c^2$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;but it's the same as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$x^T (u \times u^T) x  + 2 c u^Tx - c^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and now it's solvable. I'm using gurobi and so it needs the constraints on the form &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$x^T Q x + u^Tx &amp;gt;= c$&lt;/p&gt;&#xA;" OwnerUserId="19265" LastActivityDate="2016-03-07T08:59:15.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24732" PostTypeId="1" CreationDate="2016-03-07T09:09:07.260" Score="2" ViewCount="689" Body="&lt;p&gt;I've searched the site but haven't found an easy way to backtest my personal portfolio allocations. Suppose I want to know the total return for the following portfolio from Jan 1, 2009 to Dec 31, 2014:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;25% VINIX&#xA;25% VSMAX&#xA;25% VTMGX&#xA;25% VTRIX&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm interested in total returns (distributions reinvested). It would be useful to model rebalancing strategies based on time (i.e. yearly) or by percentage drift from allocation. I'm agnostic as to programming language (python, R, ruby, etc.) but am looking for a basic library to test returns under a variety of such assumptions, ideally with good documentation/examples.&lt;/p&gt;&#xA;" OwnerUserId="13886" LastActivityDate="2016-03-07T09:09:07.260" Title="backtest asset allocation strategies" Tags="&lt;programming&gt;&lt;backtesting&gt;&lt;asset-allocation&gt;&lt;tactical-asset-allocation&gt;&lt;rebalancing&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24733" PostTypeId="1" CreationDate="2016-03-07T11:01:17.607" Score="3" ViewCount="551" Body="&lt;p&gt;How do I calculate the dollar impact of basis change for a portfolio of cross currency basis swaps which hedged loans/bonds? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am thinking it might have something to do with delta and tenors but I am not quite sure of the concept. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="19805" LastEditorUserId="16991" LastEditDate="2016-03-07T14:38:34.187" LastActivityDate="2017-02-06T03:14:28.290" Title="Deltas and CC Basis Swaps" Tags="&lt;swaps&gt;&lt;delta&gt;&lt;hedge&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24734" PostTypeId="2" ParentId="24727" CreationDate="2016-03-07T11:08:44.127" Score="4" Body="&lt;p&gt;$\sigma_p=\sqrt{\omega_a^2 \sigma_a^2+(1-\omega_a)^2 \sigma_b^2+2 \omega_a (1-\omega_a) \rho_{ab} \sigma_a \sigma_b}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\rho_{ab}=-1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the term under the square root simplifies to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(\omega_a \sigma_a-(1-\omega_a) \sigma_b)^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is equivalent to $(-\omega_a \sigma_a+(1-\omega_a) \sigma_b)^2$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;therefore&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma_p=\omega_a \sigma_a-(1-\omega_a) \sigma_b$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or $\sigma_p=-\omega_a \sigma_a+(1-\omega_a) \sigma_b$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Each equation is only valid when the right-hand side is positive.  Since one is always positive when the other is negative (except when both equations equal zero), there is a unique solution for the risk and return of any combination of securities A and B.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ref. &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470505842&quot; rel=&quot;nofollow noreferrer&quot;&gt;Modern Portfolio Theory &amp;amp; Investment Analysis&lt;/a&gt;, page 72 (Case 2)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Running some test data, with perfect negative correlation the &lt;em&gt;minimum&lt;/em&gt; portfolio s.d. is zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Test data&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a = {0.9624, 1.6462, -0.0378, -4.0397, 0.2045}&#xA;b = {-3.6569, -4.5494, -2.2938, 3.1099, -2.6359}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;$\sigma_a=2.21804$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma_b=2.99359$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\omega_a1=\frac{\sigma_b+\sigma_p}{\sigma_a+\sigma_b}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\omega_a2=\frac{\sigma_b-\sigma_p}{\sigma_a+\sigma_b}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $\sigma_p=0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\omega_a1=\omega_a2=0.574406$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/XkQnd.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/XkQnd.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7178" LastEditorUserId="7178" LastEditDate="2016-03-10T11:32:25.950" LastActivityDate="2016-03-10T11:32:25.950" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24735" PostTypeId="2" ParentId="24728" CreationDate="2016-03-07T14:36:01.957" Score="2" Body="&lt;p&gt;Let's suppose $P$ is total annual deposits made continuously, then the change in value of total deposits $dV_t$ is (&lt;strong&gt;assuming no condition&lt;/strong&gt; on additional deposits) &#xA;$$dV_t= V_t r dt + P dt $$&#xA;where we assumed $r$ is constant. Solving above differential equation, we have: &#xA;$$V_T = V_0 e^{rT} + \frac{P}{r} (e^{rT} -1)$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming $t_1$ is the time period at which $V_T$ reach the limit $(K)$ (which is 3312 in the question), thereafter investor stop making deposits. So, the value of deposits at time $t_1$ is: &#xA;$$V_{t_1} = V_0 e^{r t_1} + \frac{P}{r} (e^{rt_1} -1) = K$$&#xA;You can &lt;strong&gt;solve the above equation numerically to derive $t_1$&lt;/strong&gt;. After $t_1$, there is no fresh deposits, so your account will grow normally and value of portfolio at $T \{T &amp;gt; t_1 \}$ is &#xA;$$V_T = V_{t_1} e^{r(T-t_1)} = K e^{r(T-t_1)} \quad \quad \,T &amp;gt; t_1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, &lt;strong&gt;your expression for the vale of deposits is&lt;/strong&gt;: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;V_T = \begin{cases} V_0 e^{rT} + \frac{P}{r} (e^{rT} -1) \quad &amp;amp; T \leq t_1\\&#xA;Ke^{r(T-t_1)} \quad \quad \quad \quad \quad &amp;amp; T&amp;gt; t_1&#xA;\end{cases} &#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h3&gt;Edit: Assuming interest rate $r$ as a function of time.&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;In this case, the value of deposits at time $T$ is: &#xA;$$V_T = V_0 e^{\int_{0}^{T}r(t)dt} +  \int_{0}^{T} Pe^{\int_{0}^{t}r(s)ds}dt$$&lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="16991" LastEditDate="2016-03-07T19:55:13.270" LastActivityDate="2016-03-07T19:55:13.270" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="24736" PostTypeId="2" ParentId="24694" CreationDate="2016-03-07T16:29:56.350" Score="5" Body="&lt;p&gt;Let&#xA;\begin{align*}&#xA;L(t; T, T + \Delta) = \frac{1}{\Delta} \left[ \frac{P(t,T)}{P(t, T+\Delta)} - 1 \right]&#xA;\end{align*}&#xA;be the forward Libor rate at time $t$ for the period $[T, T+\Delta]$.  Consider a caplet with payoff at $T+\Delta$ of the form&#xA;\begin{align}&#xA;\Delta\max\big(L(T; T, T + \Delta) -K, \, 0 \big) &amp;amp;= \Delta\max\big((L(T; T, T + \Delta)-\alpha) -(K-\alpha), \, 0 \big) \tag{1}&#xA;\end{align}&#xA;We assume that &#xA;\begin{align*}&#xA;L(t; T, T + \Delta)  = \hat{L}(t; T, T + \Delta) + \alpha, \quad 0 &amp;lt; t \le T,&#xA;\end{align*}&#xA;where the process $\hat{L} = \{ \hat{L}(t; T, T + \Delta) \, | \, 0 &amp;lt; t \le T\}$ satisfies an SDE of the form&#xA;\begin{align*}&#xA;d \hat{L}(t; T, T + \Delta) =  \hat{L}(t; T, T + \Delta)\,\beta_t\, dW_t, \quad 0 &amp;lt; t \le T,&#xA;\end{align*}&#xA;under the $T+\Delta$-forward probability measure, where $\beta$ is a deterministic function, and $\{W_t \mid t &amp;gt; 0\}$ is a standard Brownian motion.  The caplet Payoff (1) then has value&#xA;\begin{align}&#xA;C(\alpha, \sigma) = P(0, T+\Delta) \Delta \Big[\big(L(0; T, T + \Delta)-\alpha\big) \Phi(d_1) - (K-\alpha) \Phi(d_2)\Big],\tag{2}&#xA;\end{align}&#xA;where&#xA;\begin{align*}&#xA;d_{1, 2} = \frac{\ln \frac{L(0; T, T + \Delta)-\alpha}{K-\alpha} \pm \frac{1}{2}\sigma^2(0, T) T}{\sigma(0, T) \sqrt{T}},&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;\sigma(0, T) = \sqrt{\frac{1}{T}\int_0^T \beta^2_t dt}.&#xA;\end{align*}&#xA;The implied volatility $\hat{\sigma}$ is a quantity such that&#xA;\begin{align*}&#xA;L(0; T, T + \Delta) \Phi(\hat{d}_1) - K \Phi(\hat{d}_2) = \big(L(0; T, T + \Delta)-\alpha\big) \Phi(d_1) - (K-\alpha) \Phi(d_2),\tag{3}&#xA;\end{align*}&#xA;where&#xA;\begin{align*}&#xA;\hat{d}_{1, 2} = \frac{\ln \frac{L(0; T, T + \Delta)}{K} \pm \frac{1}{2}\hat{\sigma}^2 T}{\hat{\sigma} \sqrt{T}}.&#xA;\end{align*}&#xA;Given $T$ and $K$, the implied volatility $\hat{\sigma}$ is a function of $\alpha$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $f(\alpha)$ be the right hand side of (3), that is,&#xA;\begin{align*}&#xA;f(\alpha) &amp;amp;= \big(L(0; T, T + \Delta)-\alpha\big) \Phi(d_1) - (K-\alpha) \Phi(d_2)\\&#xA;&amp;amp;=(K-\alpha)\bigg[\frac{L(0; T, T + \Delta)-\alpha}{K-\alpha} \Phi(d_1) - \Phi(d_2)\bigg].&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;\frac{df(\alpha)}{d\alpha} &amp;amp;= -\frac{L(0; T, T + \Delta)-\alpha}{K-\alpha} \Phi(d_1) + \Phi(d_2) + \Phi(d_1) \frac{L(0; T, T + \Delta)-K}{K-\alpha}\\&#xA;&amp;amp;=\Phi(d_2) - \Phi(d_1) &amp;lt; 0.&#xA;\end{align*}&#xA;The derivative with respect to $\alpha$ of the left hand side of (3) is given by&#xA;\begin{align*}&#xA;vega \times \frac{d \hat{\sigma}}{d \alpha}.&#xA;\end{align*}&#xA;That is, &#xA;\begin{align*}&#xA;\frac{d \hat{\sigma}}{d \alpha} &amp;lt; 0.&#xA;\end{align*}&#xA;In other words, increasing $\alpha$ shifts the implied volatility curve&#xA;$\hat{\sigma}(K)$ down, while decreasing $\alpha$ shifts the curve up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Applying a shift, the probability distribution has been changed, for example, lognormal distribution has been changed to a shifted lognormal distribution. However, the price will not change, while the implied volatility changes. In the current negative or small interest rate environment, people tend to quote an interest rate product by its price. Then given the price, an implied volatility is computed with a certain shift parameter; otherwise, it may not be feasible to find the implied volatility (e.g., the forward Libor rate $L(0; T, T+\Delta)$ may be negative). See also &lt;a href=&quot;http://www.d-fine.com/fileadmin/d-fine/hochgeladen/Fachartikel/WhitePaper_Vols_NegIR_V1_1_en.pdf&quot; rel=&quot;noreferrer&quot;&gt;this paper&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-03-07T17:31:17.753" LastActivityDate="2016-03-07T17:31:17.753" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24737" PostTypeId="1" AcceptedAnswerId="24740" CreationDate="2016-03-07T17:15:35.167" Score="2" ViewCount="232" Body="&lt;p&gt;I am trying to test a hypothesis of a statistic calculated from portfolio returns. To do so I estimate a model on the original returns series and want to obtain 100 bootstrapped series using parametric bootstrap. I am conflicted about two approaches. But first let me say that I obtain the new returns as a mean plus a series of resampled residuals&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r = \mu + \varepsilon$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the two approaches I am considering:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;ul&gt;&#xA;&lt;li&gt;Estimate the model using the original returns  &lt;/li&gt;&#xA;&lt;li&gt;Obtain a new series of returns by using the mean and resampled residuals from the model  &lt;/li&gt;&#xA;&lt;li&gt;Estimate the model on the new series   &lt;/li&gt;&#xA;&lt;li&gt;Obtain the new series and so on...  &lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In short I am resampling the new returns each time, so I am obtaining a single new series with each iteration.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;&lt;ul&gt;&#xA;&lt;li&gt;Estimate the model on the original returns  &lt;/li&gt;&#xA;&lt;li&gt;Obtain 100 new return series by using the mean and resampled residuals from the model (each resampled series is different of course)   &lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I am wondering which of the approaches is a correct method of parametric bootstrap. I am not including any details on the models and test statistics to keep the post simple, as only the method of obtaining the new return series is important here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;edit:&lt;/strong&gt; To give some more info. The whole process simplified looks like this: I have a series of returns, I estimate a GARCH model, create two asset allocation strategies in-sample, calculate a statistic that shows which strategy is better. And now I want to know if the result is statistically significant. To do so I want to do a parametric bootstrap using the estimated GARCH model. I take the $\mu$ from the model and add resampled standardized residuals to it to obtain $n$ new series of returns. On each of the bootstrapped series I once again estimate the GARCH model, once again solve the asset allocation problem (and obtain different weights for the asset than in the initial run), calculate the statistic and from all $n$ statistics I calculate the final p-value to see, whether the result is statistically significant. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just a follow-up question to be sure: after having solved the initial asset allocation problem and obtained the weights I do the bootstrap to obtain $n$ new series of returns. Do I apply the same weights to those series and see if one asset allocation strategy outperforms the other or do I solve the problem for each bootstrapped series from scratch, thus obtaining different set of weights each time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;edit2:&lt;/strong&gt; I have found a paper that is doing a similar thing to my research, however, it uses a strange bootstrap method, as in some steps it uses the original returns and in some the bootstrapped ones. Equation (1)-(3) mentioned in the fragment are those of a GJR-GARCH model. Is this iterative approach, somehow similar to the one I described as point 1. correct, with taking the original returns in some steps and the new bootstrapped series in other steps?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/4GiTj.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/4GiTj.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17464" LastEditorUserId="17464" LastEditDate="2016-03-09T10:55:37.147" LastActivityDate="2016-03-09T10:55:37.147" Title="Parametric bootstrap in generating returns and hypothesis testing" Tags="&lt;portfolio-management&gt;&lt;returns&gt;&lt;simulations&gt;&lt;bootstrapping&gt;&lt;bootstrap&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24738" PostTypeId="2" ParentId="24725" CreationDate="2016-03-07T17:20:54.180" Score="2" Body="&lt;h3&gt;There are various alternatives to your problem:&lt;/h3&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;If you think that Normal distribution is not appropriate then you can use &lt;strong&gt;other distributions&lt;/strong&gt; like t-distribution, skewed t-distribution, generalized error distribution, skewed GED etc. All these distributions are available in R (rugarch package) and Eviews too.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;As you are interesting in studying the impact of event on the volatility, the best approach is to use &lt;strong&gt;dummy variable for the event&lt;/strong&gt;. You are not required to use dummy variable for the outliers. In this way, you can measure the impact of event on the volatility.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If above two option does not work, You may also use &lt;strong&gt;jump models&lt;/strong&gt;. There are vast literature on the jump models (just google it), but these models are &lt;strong&gt;difficult to calibrate&lt;/strong&gt;. So, keep these models always your last options.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-03-07T17:20:54.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24739" PostTypeId="1" CreationDate="2016-03-07T18:25:29.620" Score="1" ViewCount="173" Body="&lt;p&gt;Obviously this is a rookie question, I'm simply looking to plot the S&amp;amp;P PE ratio moving averages over different periods of time and plot them vs the DOW. Ideally I would love like something that is fed by data and automatically updated, and can be done online rather than a proprietary piece of software. can anyone recommend a tool for helping me do this? I've already made a spread sheet based on historical s&amp;amp;p data, but again I would like to automate this somehow.&lt;/p&gt;&#xA;" OwnerUserId="19814" LastActivityDate="2016-09-04T18:03:18.660" Title="How do I automatically graph S&amp;P PE ratio moving average VS DOW" Tags="&lt;moving-average&gt;&lt;ratio&gt;&lt;graphs&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24740" PostTypeId="2" ParentId="24737" CreationDate="2016-03-07T18:51:12.400" Score="1" Body="&lt;p&gt;The correct procedure for parametric bootstrap is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) fit the data with a distribution of the parametric family (normal, Student's t, etc.; you should choose the one that fits the data in the best way, using some criteria to choose, such as Akaike Information Criteria or others);&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) draw n random samples from the fitted distribution, and estimate the quantity of interest for each sample;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) take the sample mean of these quantities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this what you need?&lt;/p&gt;&#xA;" OwnerUserId="18694" LastActivityDate="2016-03-07T18:51:12.400" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="24741" PostTypeId="1" AcceptedAnswerId="24751" CreationDate="2016-03-07T19:29:11.203" Score="3" ViewCount="320" Body="&lt;p&gt;I want to test a hypothesis about using gamma to predict FX movements. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose that market makers will seek to be delta neutral given their portfolio of FX options. At any given time, market makers in the interbank market will be either long or short gamma in the aggregate for their portfolios of FX options. If they are long gamma, market makers as a whole will delta hedge by engaging in strategies such as continuously buying the spot when it is low and selling it when it rises, meaning the spot range will operate in a relatively tight band. The opposite will hold if market makers are net short gamma, with the spot swinging widely. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I have access only to public information (eg anything on Bloomberg Terminal) how can I identify whether market makers are long or short gamma for FX options in order to test this hypothesis?&lt;/p&gt;&#xA;" OwnerUserId="17712" LastActivityDate="2016-03-08T10:31:38.643" Title="Using Market Gamma to Predict FX Trading Environments" Tags="&lt;quant-trading-strategies&gt;&lt;fx&gt;&lt;derivatives&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24742" PostTypeId="1" CreationDate="2016-03-07T21:03:22.960" Score="6" ViewCount="1037" Body="&lt;p&gt;With equity options, many market makers hedge by buying or selling the underlying asset in correspondence with the option's delta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if the market maker wrote 1 call option with a delta of .7 then they buy 70 shares.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would one delta hedge with VIX options, where there are no underlying shares on the index. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Available options could include a cross-asset weighted portfolio with VIX ETF shares/nav units. Some kind of concoction with different VIX futures at differing margin levels. Or further recreating a leveraged fraction of the VIX term structure with S&amp;amp;P options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any insight appreciated&lt;/p&gt;&#xA;" OwnerUserId="1453" LastActivityDate="2016-12-25T08:59:16.050" Title="How do market makers hedge VIX index options?" Tags="&lt;hedging&gt;&lt;vix&gt;&lt;delta-hedging&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24743" PostTypeId="2" ParentId="24742" CreationDate="2016-03-07T22:00:36.680" Score="6" Body="&lt;p&gt;Due to the lack of a carry arbitrage, VIX futures are actually the direct hedge for VIX Index options&lt;/p&gt;&#xA;" OwnerUserId="16058" LastActivityDate="2016-03-07T22:00:36.680" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24745" PostTypeId="2" ParentId="24728" CreationDate="2016-03-07T22:45:58.413" Score="0" Body="&lt;p&gt;Let be $V_0=300$ the deposit at $t=0$, $V(T)=3312$ the value at $t=T$, and $r(t)=\frac{1}{20+t/2}=\frac{b}{a+t}$ the interest rate with $a=40$ and $b=2$. Denote $$I(t)=\rho\left(1-H(t-T)\right)$$ the rate of payment at any time in the range $[0,T]$ where $\rho=300$ and $H(t)$ is the Heaviside function or step function defined as $$H(t)=\begin{cases} 1 &amp;amp; t&amp;gt; 0\\&#xA;0 &amp;amp;  t\le 0&#xA;\end{cases}$$&#xA;so that &#xA;$$I(t)=\begin{cases} 0 &amp;amp; t&amp;gt; T\\&#xA;\rho &amp;amp;  0\le t\le T&#xA;\end{cases}$$&#xA;So you have to solve&#xA;$$&#xA;\frac{\mathrm d V}{\mathrm d t}=r(t) V(t)+I(t)\tag 1&#xA;$$&#xA;that is a first order non-linear ODE.&#xA;It's better to solve the equation (1) separately in the time intervals $t\le T$ and $t&amp;gt;T$ considering the following two linear ODE&#xA;$$&#xA;\begin{align}&#xA;\frac{\mathrm d V}{\mathrm d t}&amp;amp;=r(t) V(t)+\rho &amp;amp;  0\le t\le T\tag 2\\&#xA;\frac{\mathrm d V}{\mathrm d t}&amp;amp;=r(t) V(t) &amp;amp; t&amp;gt; T\tag 3&#xA;\end{align}&#xA;$$&#xA;The general solution of $\dot x(t)+p(t)x(t)=q(t)$ is&#xA;$$&#xA;x(t)=\frac{1}{u(t)}\left(\int u(t)q(t)\mathrm{d}t+C\right) \qquad \text{where } u(t)=\mathrm{e}^{\int p(t)\mathrm{d}t}&#xA;$$&#xA;Then we have for equation (2)&#xA;$$&#xA;V(t)=\mathrm{e}^{P(t)}\left(\int_0^t \rho \mathrm{e}^{-P(s)}\mathrm{d}s+C\right)\tag 4&#xA;$$&#xA;where $$P(t)=\int_0^t r(s)\mathrm{d}s=b\log\left(1+\frac{t}{a}\right)\tag 5$$&#xA;and $\mathrm{e}^{P(t)}=\left(1+\frac{t}{a}\right)^b$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The condition $V(0)=V_0$ leads to $C=V_0\mathrm{e}^{-P(0)}=V_0$ because $P(0)=0$. &#xA;Then the (4) becomes&#xA;$$&#xA;\begin{align}&#xA;V(t)&amp;amp;=V_0\mathrm{e}^{P(t)}+ \mathrm{e}^{P(t)}\int_0^t \rho \mathrm{e}^{-P(s)}\mathrm{d}s\\&#xA;&amp;amp;=V_0\left(1+\frac{t}{a}\right)^b+\rho\mathrm{e}^{P(t)}\int_0^t \left(1+\frac{s}{a}\right)^{-b}\mathrm{d}s\\&#xA;&amp;amp;=V_0\left(1+\frac{t}{a}\right)^b+\rho\left(1+\frac{t}{a}\right)^b\left[\frac{(a+t)^{1-b}a^b}{(1-b)}-\frac{a}{1-b}\right]\\&#xA;&amp;amp;=V_0\left(1+\frac{t}{a}\right)^b+\rho\left[\frac{a+t}{1-b}-\frac{(a+t)^{b}a^{1-b}}{1-b}\right]\\&#xA;&amp;amp;=V_0\left(1+\frac{t}{a}\right)^b+\frac{\rho a}{1-b}\left[\left(1+\frac{t}{a}\right)-\left(1+\frac{t}{a}\right)^b\right]&#xA;\tag 6&#xA;\end{align}&#xA;$$&#xA;The solution for (3) is &#xA;$$&#xA;V(t)=V(T)\mathrm{e}^{P(t)-P(T)}\tag 7&#xA;$$&#xA;where from (6) $$V(T)=V_0\left(1+\frac{T}{a}\right)^b+\frac{\rho a}{1-b}\left[\left(1+\frac{T}{a}\right)-\left(1+\frac{T}{a}\right)^b\right]\tag 8$$&#xA;Finally the solution is&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$$&#xA;V(t)=&#xA;\begin{cases}&#xA;V_0\left(1+\frac{t}{a}\right)^b+\frac{\rho a}{1-b}\left[\left(1+\frac{t}{a}\right)-\left(1+\frac{t}{a}\right)^b\right] &amp;amp;  0\le t\le T\\&#xA;V(T)\mathrm{e}^{P(t)-P(T)} &amp;amp; t&amp;gt; T&#xA;\end{cases}\tag 9&#xA;$$&#xA;  or&#xA;  $$&#xA;V(t)=&#xA;\begin{cases}&#xA;V_0\mathrm{e}^{P(t)}+\frac{\rho a}{1-b}\left[\mathrm{e}^{P(t)/b}-\mathrm{e}^{P(t)}\right] &amp;amp;  0\le t\le T\\&#xA;V(T)\mathrm{e}^{P(t)-P(T)} &amp;amp; t&amp;gt; T&#xA;\end{cases}\tag {10}&#xA;$$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="19766" LastEditorUserId="19766" LastEditDate="2016-03-08T14:49:30.590" LastActivityDate="2016-03-08T14:49:30.590" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24747" PostTypeId="5" CreationDate="2016-03-08T04:47:01.020" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2016-03-08T04:47:01.020" LastActivityDate="2016-03-08T04:47:01.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24748" PostTypeId="4" CreationDate="2016-03-08T04:47:01.020" Score="0" Body="Panel data is a kind of data table where elements have more than one index." OwnerUserId="15390" LastEditorUserId="15390" LastEditDate="2016-03-08T09:36:21.463" LastActivityDate="2016-03-08T09:36:21.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24749" PostTypeId="1" CreationDate="2016-03-08T07:53:09.053" Score="1" ViewCount="345" Body="&lt;p&gt;I'm working on my master's thesis and I need to extract data from the Bloomberg Terminal. I'm rather inexperienced when it comes to using the Terminals many features. The data I need is for the following stock exchanges Botswana, Cote d'Ivoire, Ghana, Kenya, Mauritius, Namibia, Nigeria and Zambia - these 8 countries constitute the S&amp;amp;P Africa Frontier index. I need the following data: Daily stock closing, bid and ask prices, total number of shares outstanding, traded volumes, dividend per share in local currency and converted into US$. These figures I need for the period of 2000-2015. Do anyone know how to set up this as a template? Any help is much appreaciated. Thanks, Mikkel  &lt;/p&gt;&#xA;" OwnerUserId="19819" LastActivityDate="2016-03-10T07:34:53.670" Title="Template for Bloomberg terminal" Tags="&lt;bloomberg&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2016-03-10T19:55:41.817" ContentLicense="CC BY-SA 3.0" />
  <row Id="24750" PostTypeId="1" CreationDate="2016-03-08T09:18:37.337" Score="2" ViewCount="75" Body="&lt;p&gt;This may be the most stupid question ever asked here, so sorry in advance for asking it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose we have a single period security which gives dividend $D_{t+1}$ and has current price $P_t$. &lt;strong&gt;By definition&lt;/strong&gt; we have:&#xA;$$R_{t+1}\equiv\frac{D_{t+1}}{P_t}\ \ (1)$$&#xA;Here is the first trouble:I believe I’m making no assumption by saying that &lt;strong&gt;by definition it’s still true&lt;/strong&gt; that:&#xA;$$P_{t}\equiv\frac{D_{t+1}}{R_{t+1}} \ \ (2)$$&#xA;So if we take expectations of (1) and (2) we have:&#xA;$$E[R_{t+1}]=E\left[\frac{D_{t+1}}{P_t}\right]= \frac{E[D_{t+1}]}{P_t}\ \ (1^E)$$&#xA;$$E[P_{t}]=P_t=E\left[\frac{D_{t+1}}{R_{t+1}}\right] \ \ (2^E)$$&#xA;So if we solve $(1^E)$ for price we have the following equivalence :&#xA;$$P_t=E\left[\frac{D_{t+1}}{R_{t+1}}\right]=\frac{E[D_{t+1}]}{E[R_{t+1}]} \ \ (3)$$&#xA;The reason why I’m puzzled is that, in general, $E[\frac{X}{Y}]\neq\frac{E[X]}{E[Y]}$. I can’t see my mistake given that I believe I’ve just worked with definitions (which should hold both ex-post and ex-ante) and taken expectations of them.&lt;/p&gt;&#xA;" OwnerUserId="8028" LastEditorUserId="8028" LastEditDate="2016-03-08T09:50:31.400" LastActivityDate="2016-03-08T13:07:14.543" Title="Expected returns vs expected prices?" Tags="&lt;returns&gt;&lt;expected&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24751" PostTypeId="2" ParentId="24741" CreationDate="2016-03-08T10:31:38.643" Score="1" Body="&lt;p&gt;If I understand your question, you are looking to find what is the overall position of each option for all market makers. I don't think this information is available for free in Bloomberg. It may be available in some specific vendors: I remember to purchase this exact information for Apple options, but I don't think it was available for FX options in the vendor that I purchase it to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your hypothesis is that the gamma hedging is having an impact in the underlying, a starting point could be to compare the total notional of the open interests with the daily trading volume (in notional terms) of the underlying. If this ratio is high the probability of market impact of the gamma hedging increases. The initial study can lead you to select the FX pairs with the highest value of this ratio. Once you have it, I recommend you to research different vendors to see if that data is available.&lt;/p&gt;&#xA;" OwnerUserId="15285" LastActivityDate="2016-03-08T10:31:38.643" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24752" PostTypeId="1" CreationDate="2016-03-08T11:10:27.293" Score="1" ViewCount="438" Body="&lt;p&gt;I tried to calculate the shift for CHF interest rates (tenors with negative rates) using MLE, but as the shift is increased the MLE value increases(or decreases depending on whether positive or negative shift used) and hence doesn't converge to any particular value. &#xA;So I wanted to know if there are any other definite ways of calculating shift in the Shifted lognormal approach for Negative Interest Rates.&lt;/p&gt;&#xA;" OwnerUserId="7519" LastActivityDate="2016-03-08T11:10:27.293" Title="To calculate shift in the shifted lognormal model" Tags="&lt;interest-rates&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24753" PostTypeId="1" CreationDate="2016-03-08T11:58:20.607" Score="4" ViewCount="4305" Body="&lt;p&gt;I am trying to determine the condition such that my implied vol surface doesn't have calendar arbitrage. I have done research and found that one such condition is that total variance should increase along the time axis. However, I want to find a different condition using the call option price or forwards, or something to that extent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, I do not want to assume proportional dividends, same forward moneyness, etc. The information I do know is option price and forward prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My approach is something as follows. Let X and Y be unknowns. at t=0, I would need to pay (or receive) $XC(t_1)+YC(t_2)$ where $C(T)=\exp(-rT)BS(F_T,K,T,r,\sigma)$. Note that I am assuming that we are working with the same strike $K$. Let $X=1$ for simplicty. At $t=1$, if $S_{t_1}&amp;lt;K$, then my call expiring at $t_1$ would be worth nothing, and closing out the portfolio position, the payoff would be $-Y\exp(rT_1)C(t_2)$. If $S_{t_1}&amp;gt;K$, then my payoff would be $S_{t_1}-K-Y\exp(rT_1)C(t_2)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure how I would continue my argument from here, though perhaps I want to use the fact that $C(t) \ge \exp(-rt)(F_t-K)$. I know I would first need to find out the quantity of $Y$ first.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be greatly appreciated. Jim&lt;/p&gt;&#xA;" OwnerUserId="19606" LastActivityDate="2016-05-13T09:18:11.823" Title="Calendar Arbitrage in a Vol Surface" Tags="&lt;implied-volatility&gt;&lt;arbitrage&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="24755" PostTypeId="2" ParentId="24750" CreationDate="2016-03-08T13:07:14.543" Score="1" Body="&lt;p&gt;You are right in saying that &#xA;$$E\bigg[\frac{X}{Y}\bigg] \ne \frac{E(X)}{E(Y)}$$&#xA;Here, both $X$ and $Y$ are random variable and &lt;strong&gt;hence their ratio is by definition is random variable&lt;/strong&gt; too. &#xA;If $Z$ is RV such that&#xA;$$Z=\frac{X}{Y} \Rightarrow E[Z] = E[\frac{X}{Y}] \neq \frac{E(X)}{E(Y)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;But in your case, $Z$ is not a random variable but known and constant&lt;/strong&gt;. &lt;strong&gt;See&lt;/strong&gt;, &#xA;$$R_{t+1}= \frac{D_{t+1}}{P_t} \Rightarrow P_t = \frac{D_{t+1}}{R_{t+1}}$$&#xA;where $P_t$ is known at time $t$ or constant. That is why, we have&#xA;$$P_t = E\left[\frac{D_{t+1}}{R_{t+1}}\right] = \frac{E(D_{t+1})}{E(R_{t+1})}=\frac{E(D_{t+1})}{E(D_{t+1})/P_t} = P_t$$&lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2016-03-08T13:07:14.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24757" PostTypeId="2" ParentId="24739" CreationDate="2016-03-08T14:53:59.947" Score="1" Body="&lt;p&gt;I have automated downloading of various price data with simple C# console applications that I write with Visual Studio Express (which is free). You are looking for a very specialized task, so I don't think you can get away from programming. I recommend Microsoft .Net for programming. Just create a new console application and use .Net's WebRequest and WebResponse classes to read data from other websites with very few lines of code. Then you can do string manipulations and create price text files (with the System.IO class) that you can use with any charting program (I recommend Ninjatrader, which is free). If you don't have a charting program, just create csv price files and charts in Excel. Furthermore, just add the console applications to windows tasks so you can have them run automatically at a specific time every day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get Historical PE ratio data from &lt;a href=&quot;http://www.multpl.com/table&quot; rel=&quot;nofollow&quot;&gt;http://www.multpl.com/table&lt;/a&gt;&#xA;and I get historical Dow Prices from Stooq: &lt;a href=&quot;http://stooq.com/q/d/l/?s=&quot; rel=&quot;nofollow&quot;&gt;http://stooq.com/q/d/l/?s=&lt;/a&gt;^dji&amp;amp;i=d&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a piece of code to download data from a website:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    using System;&#xA;    using System.IO;&#xA;    using System.Net;&#xA;    using System.Text;&#xA;&#xA;    namespace Examples.System.Net&#xA;    {&#xA;        public class WebRequestGetExample&#xA;        {&#xA;            public static void Main ()&#xA;            {&#xA;                // Create a request for the URL. &#xA;                WebRequest request = WebRequest.Create (&#xA;                  &quot;http://WEBSITEHERE/PAGEWITHPRICEDATAHERE&quot;);&#xA;                // Get the response.&#xA;                WebResponse response = request.GetResponse ();&#xA;                // Display the status.&#xA;                Console.WriteLine (((HttpWebResponse)response).StatusDescription);&#xA;                // Get the stream containing content returned by the server.&#xA;                Stream dataStream = response.GetResponseStream ();&#xA;                // Open the stream using a StreamReader for easy access.&#xA;                StreamReader reader = new StreamReader (dataStream);&#xA;                // Read the content.&#xA;                string responseFromServer = reader.ReadToEnd ();&#xA;                // Display the content.&#xA;                Console.WriteLine (responseFromServer);&#xA;                // Clean up the streams and the response.&#xA;                reader.Close ();&#xA;                response.Close ();&#xA;            }&#xA;        }&#xA;    }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="19508" LastActivityDate="2016-03-08T14:53:59.947" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24758" PostTypeId="2" ParentId="2589" CreationDate="2016-03-08T15:34:30.810" Score="4" Body="&lt;p&gt;I use Yhang Zhang measure for intraday volatility for timeseries with a rolling 5 or 10 day window. I wrote a C++ and vba implementation which I'm happy to share if you wish. Takes olhc data and gives an 'estimate' of the volatility.&#xA;For intraday trading (gamma hedging), I found it is a fairly good estimator of the days range.&#xA;But I would caution on whether it's a predictor of vol. Day to day intraday vol correlation tends to be small in my opinion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've added the code on request. It's probably not 100% robust, and there's probably some conditions on which it produces odd numbers or plain crashes. No implied guarantees&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;/**&#xA;    Calculate the yzvol from the intraday data using a given window size&#xA;    Note that this window will make the final array (size - window) in length&#xA;    so the first 'window' dates in the dt_ array are to be skipped&#xA;    @open - open prices&#xA;    @high - high prices&#xA;    @low - low prices&#xA;    @close - close prices&#xA;    @window - window size to do a rolling apply over&#xA;*/&#xA;std::vector&amp;lt;float&amp;gt; calculate_yzvol(&#xA;    const std::vector&amp;lt;float&amp;gt;&amp;amp; open,&#xA;    const std::vector&amp;lt;float&amp;gt;&amp;amp; high,&#xA;    const std::vector&amp;lt;float&amp;gt;&amp;amp; low,&#xA;    const std::vector&amp;lt;float&amp;gt;&amp;amp; close,&#xA;    const size_t window) {&#xA;    std::vector&amp;lt;float&amp;gt; yzvol;&#xA;&#xA;    const size_t element_num = open.size();&#xA;    if (element_num - 1 &amp;lt; window) {&#xA;        BOOST_LOG_TRIVIAL(warning) &amp;lt;&amp;lt; &quot;Number of daily prices &quot; &amp;lt;&amp;lt; element_num &amp;lt;&amp;lt; &quot; from DB is smaller than window size&quot;  &amp;lt;&amp;lt; window;&#xA;        return yzvol;&#xA;    }&#xA;&#xA;std::vector&amp;lt;float&amp;gt; log_ho(element_num);&#xA;std::vector&amp;lt;float&amp;gt; log_lo(element_num);&#xA;std::vector&amp;lt;float&amp;gt; log_co(element_num);&#xA;std::vector&amp;lt;float&amp;gt; log_oc_sq(element_num);&#xA;std::vector&amp;lt;float&amp;gt; log_cc_sq(element_num - 1);&#xA;std::vector&amp;lt;float&amp;gt; rs(element_num);&#xA;&#xA;std::transform(open.begin(), open.end(), high.begin(),std::back_inserter&amp;lt;std::vector&amp;lt;float&amp;gt;&amp;gt;(log_ho),[](auto open, auto high) {&#xA;    return ::log(high / dailyopen);&#xA;});&#xA;for (size_t i = 0; i &amp;lt; element_num; i++) {&#xA;    const float dailyopen = static_cast&amp;lt;float&amp;gt;(1.0 / open[i]);&#xA;    log_ho[i] = log(high[i] * dailyopen);&#xA;    log_lo[i] = log(low[i] * dailyopen);&#xA;    log_co[i] = log(close[i] * dailyopen);&#xA;    float oc = log(open[i] / close[i]);&#xA;    log_oc_sq[i] = boost::math::pow&amp;lt;2&amp;gt;(oc);&#xA;    rs[i] = log_ho[i] * (log_ho[i] - log_co[i]) + log_lo[i] * (log_lo[i] - log_co[i]);&#xA;}&#xA;&#xA;for (size_t i = 1; i &amp;lt; element_num; i++) {&#xA;    const float cc = log(close[i] / close[i - 1]);&#xA;    log_cc_sq[i - 1] = boost::math::pow&amp;lt;2&amp;gt;(cc);&#xA;}&#xA;&#xA;// Vol sum function&#xA;auto vol_sum = [](auto begin, auto end, auto window) {&#xA;    const float window_factor = static_cast&amp;lt;float&amp;gt;(1.0 / (window - 1.0));&#xA;    float sum = 0.0f;&#xA;    for (auto i = begin; i != end; i++) {&#xA;        sum += *i;&#xA;    }&#xA;    return sum * window_factor;&#xA;};&#xA;typedef std::vector&amp;lt;float&amp;gt; vf;&#xA;const vf close_vol = rolling_window&amp;lt;vf, vf&amp;gt;(log_cc_sq, window, vol_sum);&#xA;const vf open_vol = rolling_window&amp;lt;vf, vf&amp;gt;(log_oc_sq, window, vol_sum);&#xA;const vf window_rs_vol = rolling_window&amp;lt;vf, vf&amp;gt;(rs, window, vol_sum);&#xA;&#xA;// Note that this window will make the final array (size - window) in length&#xA;boost::range::for_each(close_vol | boost::adaptors::indexed(0),[&amp;amp;](auto i) {&#xA;    const float result = ::sqrt(open_vol[i.index() + 1] + 0.16433 * close_vol[i.index()] + 0.835667 * window_rs_vol[i.index() + 1]);&#xA;    yzvol.emplace_back(result);&#xA;});&#xA;return yzvol;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;}&lt;/p&gt;&#xA;" OwnerUserId="9517" LastEditorUserId="9517" LastEditDate="2016-03-17T13:58:44.900" LastActivityDate="2016-03-17T13:58:44.900" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24759" PostTypeId="2" ParentId="24749" CreationDate="2016-03-08T15:54:34.913" Score="1" Body="&lt;p&gt;I recommend that you use the Bloomberg Excel Addin instead of the terminal. It is rather intuitive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To install the Addin :  Go to &quot;Start Menu&quot;  -&gt; &quot;Bloomberg&quot;  -&gt; &quot;Install Excel Addin&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://guides.library.yale.edu/c.php?g=296285&amp;amp;p=1974285&quot; rel=&quot;nofollow&quot;&gt;Quick Start Guide Here.&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2016-03-08T15:54:34.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24760" PostTypeId="2" ParentId="22106" CreationDate="2016-03-08T15:56:29.757" Score="3" Body="&lt;p&gt;Why not just use Geometric Mean Returns? Each time you buy/sell an ETF calculate the holding period return as a percentage and plug into the formula. The answer is a percentage that you can use to calculate the approximate money appreciation (or loss) against your &quot;fixed notional&quot;&lt;/p&gt;&#xA;" OwnerUserId="19508" LastActivityDate="2016-03-08T15:56:29.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24761" PostTypeId="1" CreationDate="2016-03-08T17:15:01.767" Score="5" ViewCount="1013" Body="&lt;p&gt;I want to contruct an optimized stock portfolio with the restriction of a zero-investment strategy. The portfolio weight in each stock needs to be modeled as a function of state variables (factors that have an effect on stock performance).&#xA;This method for portfolio optimization is colled &amp;quot;parametric portfolio policy&amp;quot; and developed by &lt;a href=&quot;https://rfs.oxfordjournals.org/content/22/9/3411.full.pdf+html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Brandt et al (2009)&lt;/a&gt;,so I need to find the weight for each stock in the optimized portfolio and maximize the investor’s expected utility, like following;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/jKfBn.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/jKfBn.jpg&quot; alt=&quot; here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Here is the expression of the weight of the stock i &lt;code&gt;w (i,t)&lt;/code&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/6ukaJ.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/6ukaJ.jpg&quot; alt=&quot;here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Teta&lt;/code&gt;is a vector of coefficients of state variables and &lt;code&gt;x&lt;/code&gt; presents the state variables.&lt;/p&gt;&#xA;&lt;p&gt;So, the optimization problem becomes;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/jT4OG.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/jT4OG.png&quot; alt=&quot; here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;How to program the problem using Matlab?&#xA;I am not good in modeling and optimization..I would be grateful for any help&lt;/p&gt;&#xA;" OwnerUserId="17810" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2018-03-15T21:18:17.520" Title="Portfolio Optimization using Parametric Portfolio Policy Method in MATLAB" Tags="&lt;portfolio-optimization&gt;&lt;matlab&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24762" PostTypeId="2" ParentId="24761" CreationDate="2016-03-08T17:30:43.127" Score="2" Body="&lt;p&gt;Find below a link for a dummy implementation in excel using VBA, which I did couple of years ago.&#xA;&lt;a href=&quot;http://www.speedyshare.com/xJZJ8/PPPs-Copy.xlsm&quot; rel=&quot;nofollow&quot;&gt;http://www.speedyshare.com/xJZJ8/PPPs-Copy.xlsm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On this implementation I am allocating between Dax returns and a German bond using as state variables the dividend yield, the inflation and the ECB interest rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The implementation is out of sample, and simply uses the solver algorithm to maximize the utility. In matlab you can do exactly the same using the function &lt;code&gt;fminsearch&lt;/code&gt; or something similar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if you are looking to replicate the paper, you should do the analysis in sample and use GMM to maximize equation (11) using equation (12) as the optimal weighting matrix. &#xA;There are several resources online on how to implement GMM on matlab. Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="16472" LastEditDate="2016-03-08T17:39:16.000" LastActivityDate="2016-03-08T17:39:16.000" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="24763" PostTypeId="1" CreationDate="2016-03-08T20:26:15.803" Score="1" ViewCount="6711" Body="&lt;p&gt;If I have log returns for a specific stock, then the weekly log return is the log of Friday's closing price minus the log of Monday's closing price, i.e. $R_{weekly} = log(Price_{Friday}) - log(Price_{Monday})$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, can I also calculate the log return as the sum of the daily log returns?&#xA;$R_{weekly}=[log(Price_{Monday}) - log(Price_{Sunday})] + [log(Price_{Tuesday}) - log(Price_{Monday})] + {...} + [log(Price_{Friday}) - log(Price_{Thursday})]$&lt;/p&gt;&#xA;" OwnerUserId="13812" LastActivityDate="2021-02-14T05:22:28.153" Title="Calculate weekly returns from daily stock prices?" Tags="&lt;returns&gt;" AnswerCount="4" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24764" PostTypeId="2" ParentId="24589" CreationDate="2016-03-08T22:51:34.080" Score="2" Body="&lt;p&gt;Found it! &lt;strong&gt;Interactive Brokers&lt;/strong&gt; provides a &lt;a href=&quot;https://www.interactivebrokers.com/en/index.php?f=1286&quot; rel=&quot;nofollow&quot;&gt;free trial&lt;/a&gt; account, which allows you to use their Web Trader platform (or TWS, the desktop application) to see (delayed) price data for all kinds of instruments, including futures options, both weekly and monthly.&lt;/p&gt;&#xA;" OwnerUserId="19587" LastActivityDate="2016-03-08T22:51:34.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24765" PostTypeId="1" CreationDate="2016-03-09T00:45:42.477" Score="3" ViewCount="111" Body="&lt;p&gt;The ASA (American Statistical Association) has just released a &lt;a href=&quot;http://amstat.tandfonline.com/doi/pdf/10.1080/00031305.2016.1154108&quot; rel=&quot;nofollow&quot;&gt;statement&lt;/a&gt; about the &lt;a href=&quot;http://www.nature.com/news/statisticians-issue-warning-over-misuse-of-p-values-1.19503&quot; rel=&quot;nofollow&quot;&gt;misuse of $p$-value&lt;/a&gt;. Will this action have much effect on the use of $p$-value in finance?&lt;/p&gt;&#xA;" OwnerUserId="6461" LastActivityDate="2016-04-08T08:46:10.253" Title="The use of $p$-value in finance after the recent statement of ASA (American Statistical Association)" Tags="&lt;statistics&gt;&lt;statistical-significance&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24766" PostTypeId="1" AcceptedAnswerId="24937" CreationDate="2016-03-09T00:59:55.347" Score="7" ViewCount="352" Body="&lt;p&gt;Suppose we have 2 strategies :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;strategy A&lt;/strong&gt; : every $N$ days, we short a call option with a time-to-maturity of $N$ days;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;strategy B&lt;/strong&gt; : every day, we short $\frac{1}{N}$ of a call option with a time-to-maturity of $N$ days.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;When would strategy B be considered better than strategy A ?&lt;/p&gt;&#xA;" OwnerUserId="19693" LastEditorUserId="19693" LastEditDate="2016-03-13T23:26:28.940" LastActivityDate="2016-03-19T16:01:21.353" Title="Shorting an option every day vs shorting only at maturity" Tags="&lt;options&gt;&lt;option-strategies&gt;&lt;strategy&gt;" AnswerCount="4" CommentCount="15" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24767" PostTypeId="2" ParentId="22608" CreationDate="2016-03-09T02:01:10.700" Score="0" Body="&lt;p&gt;I think you are complicating this too much. Just add the returns with simple addition. The math works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Total Returns: 1.1 + 1.05 + 1.025 + 0.935 = 4.11&#xA;&#xA;Tech Returns: 1.1 + 0.525 + 0 + 0.30855 = 1.93355&#xA;Energy Returns: 0 + 0.525 + 1.025 + 0.30855 = 1.85855&#xA;Other Returns: 0 + 0 + 0 + 0.3179 = 0.3179&#xA;&#xA;Total Returns = 1.93355 + 1.85855 + 0.3179 = 4.11&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="19508" LastActivityDate="2016-03-09T02:01:10.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24768" PostTypeId="2" ParentId="18674" CreationDate="2016-03-09T03:46:19.923" Score="2" Body="&lt;p&gt;It is unlikely that you could beat the market in the long-term with such a simple strategy. But, since you ask about optimization (not real trading), all you have to do to is run the optimization tests over and over again with different parameters until you find the exact moving average combinations that would predict the past perfectly. The only problem is that the strategy will fall apart completely if you try to use out of sample data!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The sad reality is that beating the averages is not as easy as it is supposed to be, and studies suggest that 86% of all money managers and 99% of active traders cannot beat the S&amp;amp;P500. So, if you could simply beat the Dow or S&amp;amp;P consistently, you would be one of the best traders in the history of the mankind. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having said that, moving averages are indeed the starting ingredients (or at least important filters) to many successful trading systems. A complete trading system needs exits/stops, money management, and diversification to smooth out the equity curve and boost returns. Entries alone don't make a trading system, and losing is a part of the game, so get used to having negative returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recommend the following books for getting ideas on how to come up with a good trading system:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Building Reliable Trading Systems by Keith Fitschen&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Building Winning Algorithmic Trading Systems by Kevin Davey&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Evidence-Based Technical Analysis by David Aronson&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Technical Traders Guide to Computer Analysis of the Futures Market by Charles LeBeau&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-The Ultimate Trading Guide by John Hill and George Pruitt&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good luck&lt;/p&gt;&#xA;" OwnerUserId="19508" LastActivityDate="2016-03-09T03:46:19.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24769" PostTypeId="2" ParentId="24765" CreationDate="2016-03-09T08:37:42.233" Score="2" Body="&lt;p&gt;Deidre McCloskey has been going on about this for as long as I can remember. See for example the aptly titled :&#xA;&quot;The cult of statistical significance: How the standard error costs us jobs, justice and lives&quot;&#xA;&lt;a href=&quot;http://www.press.umich.edu/script/press/186351&quot; rel=&quot;nofollow&quot;&gt;http://www.press.umich.edu/script/press/186351&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;She has raised awareness of the issue in economics and financial economics, but obviously there is a long lag. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In finance practitioners are a motley bunch, with mixed backgrounds. Most are poor statisticians to begin with; then they are asked to compile management information in RAG, where they have to show that they know what they are talking about. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-03-09T08:37:42.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24770" PostTypeId="2" ParentId="22234" CreationDate="2016-03-09T09:33:15.433" Score="-1" Body="&lt;p&gt;you should look arch/garch models&lt;/p&gt;&#xA;" OwnerUserId="19738" LastActivityDate="2016-03-09T09:33:15.433" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24771" PostTypeId="2" ParentId="24763" CreationDate="2016-03-09T10:26:05.743" Score="1" Body="&lt;p&gt;I can't still comment a question, since I've still got low reputation, so I'm going to answer. I think you should calculate weekly returns from friday to friday (close of the week to close of the following week).&lt;/p&gt;&#xA;" OwnerUserId="18694" LastActivityDate="2016-03-09T10:26:05.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24774" PostTypeId="1" CreationDate="2016-03-09T13:23:35.550" Score="1" ViewCount="52" Body="&lt;p&gt;I am trying to investigate some trading strategies based on the Fama French 3-factor model, for which I assumed I need to use adjusted prices to account for dividends and splits. However, my regression give crazy outcomes if I use adjusted prices, and only 'normal' outcomes when I use the unadjusted regular closing prices. Is this normal, since this doesn't reflect 'true' returns? I am totally confused by this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="19829" LastActivityDate="2016-03-09T13:23:35.550" Title="Does the FF 3-Factor model work with unadjusted prices?" Tags="&lt;investment&gt;&lt;fama-french&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24776" PostTypeId="1" AcceptedAnswerId="24777" CreationDate="2016-03-09T14:46:28.877" Score="0" ViewCount="393" Body="&lt;p&gt;When working with Scipy, &lt;a href=&quot;http://docs.scipy.org/doc/scipy-0.17.0/reference/generated/scipy.stats.lognorm.html&quot; rel=&quot;nofollow&quot;&gt;lognomal distribution is defined&lt;/a&gt; by 3 parameters: the median (loc), the scale (standard deviation or, in our case, the implied volatility) and the shape parameter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, which one is the shape parameter used by Black-Scholes to determine option prices?&lt;/p&gt;&#xA;" OwnerUserId="15068" LastActivityDate="2016-03-09T15:53:37.417" Title="Which value to use as shape parameter for Black-Scholes lognormal distribution?" Tags="&lt;black-scholes&gt;&lt;lognormal&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24777" PostTypeId="2" ParentId="24776" CreationDate="2016-03-09T15:53:37.417" Score="1" Body="&lt;p&gt;This is a good question which I got stuck on as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose $X$ is lognormal defined as $X\sim \log \mathcal{N}(\mu, \sigma^2)$. With this notation we mean that if we write $X = e^Z$, then $Z$ follows a normal distribution with mean $\mu$ and variance $\sigma^2$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The mean and variance of $X$ are then $\mu_X = e^{\mu + \frac{1}{2}\sigma^2}$ and $\sigma_X^2 = (e^{\sigma^2} - 1)e^{2\mu + \sigma^2}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For many distributions the location and scale parameters are just the standard mean and variance. This is &lt;em&gt;not&lt;/em&gt; the case for the lognormal distribution. You can look up the details somewhere else (everything follows from the definition of the PDF), but what it comes down to is (see also &lt;a href=&quot;https://stackoverflow.com/questions/8870982/how-do-i-get-a-lognormal-distribution-in-python-with-mu-and-sigma&quot;&gt;here&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The lognormal's &lt;strong&gt;shape&lt;/strong&gt; parameters equals the normal's &lt;strong&gt;scale&lt;/strong&gt; parameter (the standard deviation of $Z$: $\sigma_Z$)&lt;/li&gt;&#xA;&lt;li&gt;The lognormal's &lt;strong&gt;scale&lt;/strong&gt; parameter equals the normal's &lt;strong&gt;exponentiated location&lt;/strong&gt; parameter ($e^{\mu_Z}$)&lt;/li&gt;&#xA;&lt;li&gt;The lognormal's &lt;strong&gt;location&lt;/strong&gt; parameter does not have a counterpart on the normal distribution side. A lognormal distribution with non-zero location parameter cannot be written as the exponential of a normal distribution. The distribution has a lower bound at zero, and with a non-zero location parameter this lower bound is shifted left or right.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;TLDR: On to python. Here's two ways of sampling from the lognormal distribution with $\mu_Z = 5$ and $\sigma_Z=.2$, one of which shows how you instantiate the &lt;code&gt;lognorm&lt;/code&gt; class.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;from scipy.stats import lognorm, norm&#xA;import numpy as np&#xA;import matplotlib.pyplot as plt&#xA;&#xA;mu = 5.&#xA;stdev = .2&#xA;&#xA;&#xA;Z = norm(loc=mu, scale=stdev)&#xA;X = lognorm(s=stdev, scale=np.exp(mu))&#xA;plt.hist(np.exp(Z.rvs(10000)), bins=100)&#xA;plt.hist(X.rvs(10000), bins=100)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;code&gt;loc&lt;/code&gt; defaults to zero for $X$.&lt;/p&gt;&#xA;" OwnerUserId="3371" LastEditorUserId="-1" LastEditDate="2017-05-23T11:33:46.017" LastActivityDate="2016-03-09T15:53:37.417" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24778" PostTypeId="1" CreationDate="2016-03-09T16:14:38.013" Score="1" ViewCount="40" Body="&lt;p&gt;I want to describe the direction of some stock returns, using as predictors several independent variables which are uncorrelated. The relation in which I am interested is between the stock returns and an independent variable which is autocorrelated. To describe the direction I use a binary logistic regression, with a binary independent variable that takes values: 0 if the stock return is negative and 1 if the stock return is positive.&#xA;My question is: what I obtain if I bootstrap a binary logistic regression, in that situation? It could be correct or it does not make any sense? And why?&lt;/p&gt;&#xA;" OwnerUserId="19822" LastActivityDate="2016-03-09T16:14:38.013" Title="What I find if I bootstrap a binary logistic regression?" Tags="&lt;bootstrap&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24779" PostTypeId="2" ParentId="24763" CreationDate="2016-03-09T20:17:39.873" Score="4" Body="&lt;p&gt;Your second formula regarding the sum of day-to-day returns collapses as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ &#xA;\begin{align}&#xA;R_{weekly,2} &amp;amp;= \text{log}(Price_{Mon}) - \text{log}(Price_{Sun}) \\&#xA;&amp;amp;+ \text{log}(Price_{Tue}) - \text{log}(Price_{Mon}) \\&#xA;&amp;amp;+ \dotsc \\&#xA;&amp;amp;+ \text{log}(Price_{Fri}) - \text{log}(Price_{Thu}) \\&#xA;&amp;amp;= \text{log}(Price_{Fri}) - \text{log}(Price_{Sun})&#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Compared to the first formula, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ R_{weekly,1} = \text{log}(Price_{Fri}) - \text{log}(Price_{Mon}), $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the difference is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ R_{weekly,2} - R_{weekly,1} = \text{log}(Price_{Mon}) - \text{log}(Price_{Sun}). $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, you include one extra day-to-day return in the definition of $R_{weekly,2}$ as compared to the definition of $R_{weekly,1}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my understanding, the relevant weekly return is the cumulative return over all seven days of the week (if there are no trades on, say, Sunday, then define the corresponding day-to-day return as zero), which collapses to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ R_{weekly} = \text{log}(Price_{Fri,\ this \ week}) - \text{log}(Price_{Fri, \ last \ week}) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(which is what @SimoneBortolato suggested before). However, depending on what you want to do with those weekly returns, other definitions could make sense as well.&lt;/p&gt;&#xA;" OwnerUserId="19645" LastActivityDate="2016-03-09T20:17:39.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24780" PostTypeId="1" AcceptedAnswerId="31604" CreationDate="2016-03-09T21:39:04.487" Score="6" ViewCount="449" Body="&lt;p&gt;I'm looking to use first few principal components of the US treasury yields for trading, and have choice of using either the data for treasuries themselves, or for the corresponding futures contracts. Would the results be similar, or there are reasons to use one particular instrument?&lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2018-12-30T16:50:17.803" Title="Principal components in treasuries: spot vs futures" Tags="&lt;bond-futures&gt;&lt;principal-components&gt;&lt;treasuries&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24781" PostTypeId="1" AcceptedAnswerId="24782" CreationDate="2016-03-09T22:58:38.470" Score="5" ViewCount="18068" Body="&lt;p&gt;I have been searching in books and on the internet for a basic definition and explanation of CMS rates, but I cannot find anything clear and simple. Can you explain (maybe with an example) what a CMS rate is? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And how is it used in derivatives, such as CMS swaps, CMS caps/floors, CMS spread options?&lt;/p&gt;&#xA;" OwnerUserId="15650" LastActivityDate="2020-06-04T07:55:25.020" Title="What is a Constant Maturity Swap (CMS) rate?" Tags="&lt;derivatives&gt;&lt;swaps&gt;&lt;spread-options&gt;&lt;cms&gt;&lt;credit-derivatives&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="24782" PostTypeId="2" ParentId="24781" CreationDate="2016-03-10T02:03:39.880" Score="6" Body="&lt;p&gt;A constant maturity swap (CMS) rate for a given tenor is referenced as a point on the Swap curve. A swap curve itself is a term structure wherein every point on the curve is the effective par swap rate for that tenor. This is analogous to a 3m LIBOR curve represents 3m forward rates for a given tenor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A swap rate can be considered as a weighted-average of forward rates. &#xA;e.g. a two year par swap rate would be the fixed rate that makes a swap on (assume) LIBOR have NPV zero at inception.&#xA;Usually, a LIBOR curve (or more generically a forward curve) would be bootstrapped using swap rates in the market (usually from 2y on-wards). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For almost all derivatives you mentioned (best of my knowledge) you can liken them to their LIBOR counterpart where the reference curve is the par swap curve (effective swap rates per tenor) in lieu of the 3m LIBOR curve. e.g. a CMS swap's floating leg will (on fixing day) not refer the 3m LIBOR but the swap rate for the tenor instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, one could also have the other leg floating and refer to LIBOR underlying curve. E.g. a 6m LIBOR v/s 2Y CMS swap will have one leg will pay 6m LIBOR for any fixing date v/s the other leg which will pay par 2Y swap rate for the fixing date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Constant_maturity_swap&quot; rel=&quot;noreferrer&quot;&gt;Wikipedia&lt;/a&gt; has an example mentioned as well.&lt;/p&gt;&#xA;" OwnerUserId="13610" LastActivityDate="2016-03-10T02:03:39.880" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24784" PostTypeId="2" ParentId="24781" CreationDate="2016-03-10T03:53:14.227" Score="6" Body="&lt;p&gt;In simple terms: An ordinary swap might be a 10 year swap of Libor vs a fixed rate; this fixed rate is determined in the marketplace every day and is published by Reuters, Bloomberg etc. as the '10 year swap rate'. Once you enter into the swap this rate remains fixed for you, of course, that is why it is called a fixed rate. But every day Reuters publishes a new number for 5 year swaps,  10 year swaps, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A CMS swap is a kind of second order swap where you swap a rate of your choice against the above mentioned '10 year swap rate'. Every once in a while the rate is changed by referencing whatever Reuters says on that date the '10 year swap rate' is. Because it is always the 10 year rate that is referenced, it is called a constant maturity (in this case 10 year maturity) swap. Your payments however vary depending on developments in the market for ordinary swaps.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-03-10T04:15:43.883" LastActivityDate="2016-03-10T04:15:43.883" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24785" PostTypeId="2" ParentId="23242" CreationDate="2016-03-10T04:45:29.427" Score="0" Body="&lt;p&gt;A way is to loop through a list of symbols.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;lisym &amp;lt;- c(&quot;ELI1V.HE&quot;, &quot;KRA1V.HE&quot;)&lt;br&gt;&#xA;getSymbols(lisym)&lt;br&gt;&#xA;ELI1V &amp;lt;- get(&quot;ELI1V.HE&quot;)&lt;br&gt;&#xA;barChart(ELI1V)  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;or prepare the symbol names in csv file n loop thru it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;lisym &amp;lt;- readLines(&quot;stocks.csv&quot;)&lt;/p&gt;&#xA;" OwnerUserId="19836" LastActivityDate="2016-03-10T04:45:29.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24786" PostTypeId="1" AcceptedAnswerId="24788" CreationDate="2016-03-10T05:56:27.497" Score="1" ViewCount="83" Body="&lt;p&gt;Hellow everyone, I'm new here. Please instruct me to do something.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem is when I run FIGARCH(0,d,1), OxEdit still show me a matrix with variable names, coefficient, s.e, t-stat... like this&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/AsUDe.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/AsUDe.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I try FIGARCH(1,d,2) it show nothing but coefficient parameters, like this&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/mgMhE.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/mgMhE.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So please instruct me how to show the other stats.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, please instruct me how to run G@rch6 package in R via function GarchOxFit, because this function is no longer supported but Mr. Brian in &lt;a href=&quot;https://quant.stackexchange.com/questions/8667/garchoxfit-in-r&quot;&gt;this topic&lt;/a&gt; show that R can run G@rch6.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I much appreciate your help. Thank you.&lt;/p&gt;&#xA;" OwnerUserId="19838" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-03-10T10:12:10.617" Title="Disappear Standard Error in OxEdit/G@rch6 package" Tags="&lt;r&gt;&lt;garch&gt;&lt;ox&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24788" PostTypeId="2" ParentId="24786" CreationDate="2016-03-10T07:40:35.330" Score="1" Body="&lt;p&gt;Regarding your first question, as it is written in your example, the FIGARCH(1,d,2) estimation fails due to &quot;&lt;em&gt;no convergence&lt;/em&gt;&quot; : ie the quasi Maximum Likelihood Estimation Method fails to obtain stable parameters via the maximization of the likelihood and so you can't get parameters for this specification (neither other stats). The QMLE method does not always get result.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2016-03-10T10:12:10.617" LastActivityDate="2016-03-10T10:12:10.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24789" PostTypeId="1" AcceptedAnswerId="33143" CreationDate="2016-03-10T08:25:26.613" Score="16" ViewCount="1814" Body="&lt;p&gt;There is a branche of stochastic portfolio theory (see also this &lt;a href=&quot;https://quant.stackexchange.com/questions/21692/intuitive-explanation-of-stochastic-portfolio-theory&quot;&gt;question&lt;/a&gt;).&#xA;Fernholz and Karatzas have published research in this field (e.g. &quot;Diversity and relative arbitrage in equity&#xA;markets&quot;) and just recently I stumbled upon &lt;a href=&quot;http://arxiv.org/pdf/1603.01865v1.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;this new paper&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that one of the main (theoretical) findings is that one can construct a portfolio that outperforms the market (relative arbitrage).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there applied work published about this? Does any (besides I think Fernholz) manager apply this theory?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: today a preprint &lt;a href=&quot;http://arxiv.org/abs/1603.06050&quot; rel=&quot;nofollow noreferrer&quot;&gt;was published&lt;/a&gt; by Philip Ernst, James Thompson, Yinsen Miao where they show that weights proportional to transformations of the markte cap weigth (e.g. $1/x^2$, where $x$ is the market cap weight) deliver portfolios that outperform the market. Is this an example? Isn't this was SPT is about?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: no input for this question with bounty?&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2018-01-29T09:09:23.730" Title="Real world application of stochastic portfolio theory" Tags="&lt;portfolio-management&gt;&lt;stochastic-calculus&gt;&lt;portfolio-optimization&gt;&lt;portfolio-theory&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="24790" PostTypeId="2" ParentId="15761" CreationDate="2016-03-10T08:44:20.237" Score="1" Body="&lt;p&gt;There is special website where you can download or subscribe to historical data &lt;a href=&quot;https://www.cqgdatafactory.com/&quot; rel=&quot;nofollow&quot;&gt;https://www.cqgdatafactory.com/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19839" LastActivityDate="2016-03-10T08:44:20.237" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24791" PostTypeId="2" ParentId="18215" CreationDate="2016-03-10T08:48:53.210" Score="3" Body="&lt;p&gt;&lt;a href=&quot;https://www.cqgdatafactory.com/&quot; rel=&quot;nofollow&quot;&gt;https://www.cqgdatafactory.com/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CQG Data Factory offers decades of historical data online. Order and download accurate, top-quality data from over 60 exchanges worldwide.&#xA;Access over 20 years of End Of Day market data and over 7 years of intraday data, including Time &amp;amp; Sales (tick data), intraday bar data, and trade volume. Additional data going back to the 1930s is also available. &lt;/p&gt;&#xA;" OwnerUserId="19839" LastActivityDate="2016-03-10T08:48:53.210" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24792" PostTypeId="2" ParentId="21951" CreationDate="2016-03-10T08:51:23.097" Score="1" Body="&lt;p&gt;You can get time and sales data from here &lt;a href=&quot;https://www.cqgdatafactory.com/&quot; rel=&quot;nofollow&quot;&gt;https://www.cqgdatafactory.com/&lt;/a&gt; time resolution is 1 min but list all quotes within it.&lt;/p&gt;&#xA;" OwnerUserId="19839" LastActivityDate="2016-03-10T08:51:23.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24793" PostTypeId="2" ParentId="141" CreationDate="2016-03-10T09:07:14.717" Score="2" Body="&lt;p&gt;CQG Inc.&#xA;&lt;a href=&quot;https://www.cqgdatafactory.com/&quot; rel=&quot;nofollow&quot;&gt;https://www.cqgdatafactory.com/&lt;/a&gt; - historical bar and time sales data (ticks)&#xA;&lt;a href=&quot;https://develop.cqg.com/qd/?page=ContinuumDocumentation&quot; rel=&quot;nofollow&quot;&gt;https://develop.cqg.com/qd/?page=ContinuumDocumentation&lt;/a&gt; - api for getting realtime, historical data and trade routing.&lt;/p&gt;&#xA;" OwnerUserId="19839" LastActivityDate="2016-03-10T09:07:14.717" CommentCount="0" CommunityOwnedDate="2016-03-10T09:07:14.717" ContentLicense="CC BY-SA 3.0" />
  <row Id="24794" PostTypeId="1" CreationDate="2016-03-10T11:07:35.340" Score="2" ViewCount="387" Body="&lt;p&gt;I need to calculate parametric Value-at-Risk using a GARCH model assuming a GED distribution. How can calculate it in R?&#xA;thank you&lt;/p&gt;&#xA;" OwnerUserId="19647" LastActivityDate="2016-03-10T13:34:20.173" Title="How do I get Value-at-Risk for a GED distribution in R?" Tags="&lt;garch&gt;&lt;distribution&gt;&lt;kurtosis&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24795" PostTypeId="2" ParentId="24794" CreationDate="2016-03-10T13:34:20.173" Score="1" Body="&lt;h2&gt;VaR for GED in R&lt;/h2&gt;&#xA;&lt;pre&gt;&lt;code&gt;package(fGarch)&#xA;qged(p, mean = 0, sd = 1, nu = 2)&#xA;&#xA;#Example&#xA;qged(.01, mean=1000, sd=2000)&#xA;[1] -3652.696&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;where, &lt;span class=&quot;math-container&quot;&gt;$1-p$&lt;/span&gt; is confidence level.&lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-03-10T13:34:20.173" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24796" PostTypeId="1" CreationDate="2016-03-10T13:54:41.320" Score="3" ViewCount="1647" Body="&lt;p&gt;I need FX data (the most accurate possible) for use in R. &#xA;Right now I have developed a script in Java to download the CSV file (from Oanda) and use this file to read it in R, but I think that is a turn around. &#xA;Someone know a best option to work with R?&lt;/p&gt;&#xA;" OwnerUserId="19841" LastActivityDate="2016-12-19T14:15:41.747" Title="Where and how can I get FX intraday data for use it in R?" Tags="&lt;r&gt;&lt;market-data&gt;&lt;fx&gt;&lt;intraday&gt;" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24799" PostTypeId="1" AcceptedAnswerId="32251" CreationDate="2016-03-10T17:35:43.337" Score="5" ViewCount="13475" Body="&lt;p&gt;Is there a website that offers free download or API where I can get an up-to-date list of all securities listed on the TSX along with their sector/industry? I could scrape individual screens for each stock on the web, but I'd like to find a single source of data for all stocks...Thanks!&lt;/p&gt;&#xA;" OwnerUserId="19847" LastActivityDate="2021-02-13T22:19:22.860" Title="List of TSX stocks with their sector and industry" Tags="&lt;equities&gt;&lt;data&gt;&lt;market-data&gt;" AnswerCount="5" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24802" PostTypeId="1" CreationDate="2016-03-10T21:47:09.747" Score="3" ViewCount="373" Body="&lt;p&gt;I have a model which I use to simulate future yield curves. The model uses some standard concepts, like PCA and ARMA models, and it creates some nice-looking yield curves. The simulated curves are used for risk purposes (VaR, stress testing, etc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem that I'm having is that I am working with 5 years of data of GBP swap rates / GBP yield curve, and during this period the short end of the curve hardly moves. For the short end of the curve we use something like LIBOR. Here's what 3M LIBOR has been doing since 2000:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/kHyRG.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/kHyRG.png&quot; alt=&quot;3M LIBOR since 2005&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My dataset starts right after the big drop in 2009. As you can see, after 2009 the largest move over a year is maybe 50-70 bps, which is small.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a result my model simply doesn't produce large movements on the short end of the yield curve. I'm not producing movements larger than, say, 20-30 bps. This is problematic, since for the purposes of risk I want to be 99% &quot;sure&quot; that I've captured the worst-case scenario. And further back in history rates were much more volatile. It's unlikely, but not out of the question, that LIBOR increases by 100bps or more. (this is all over a time horizon of one year by the way)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To counter this &quot;flatness&quot; I could maybe include GARCH effects and other fat-tailed distributions, but I'm guessing this hardly matters since calibrating to the data just results in, again, a very inert model. Also, the current model works reasonable for the EUR swap curve, which has been a more volatile. The model I'm using can definitely produce large rate movements -- it's just that the calibration to the the 5 year dataset results in relatively static model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what else can I do? How can I &quot;instruct&quot; my model to simulate larger movements? Should I just start tuning the model parameters by hand? Should I look at the option market? Maybe add random interest rate shocks?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I should note that one obvious &quot;solution&quot; to this problem is to include a larger dataset, but let's just assume that I can't increase my dataset (there's a few reasons for this). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's a general problem I suppose: what do you do when your historical dataset does not properly reflect potential future dynamics? &lt;/p&gt;&#xA;" OwnerUserId="3371" LastActivityDate="2016-04-21T02:50:29.433" Title="How do you model yield curves for interest rates that have hardly moved?" Tags="&lt;interest-rates&gt;&lt;historical-data&gt;&lt;factor-models&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24803" PostTypeId="1" AcceptedAnswerId="24813" CreationDate="2016-03-10T23:02:08.190" Score="3" ViewCount="1592" Body="&lt;p&gt;I am trying to determine the significance of coefficients of a GARCH model by calculate the p-values using the following Matlab formula:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;pvalues = 2*(1-tcdf(abs(t),n-v)),&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;where $t$ is the t-stat, $n$ the number of observations and $v$ the degrees of freedom. Should I use $v=2$ as the numbed of degrees of freedom or is it dependent on the number of parameters to estimate, as in linear regression?&lt;/p&gt;&#xA;" OwnerUserId="17464" LastActivityDate="2016-03-11T22:24:28.740" Title="Degrees of freedom in calculating significance of GARCH coefficients" Tags="&lt;statistics&gt;&lt;garch&gt;&lt;regression&gt;&lt;estimation&gt;&lt;parameter-estimation&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24804" PostTypeId="2" ParentId="1814" CreationDate="2016-03-10T23:06:39.627" Score="0" Body="&lt;p&gt;Be very careful when selecting commodity ETFs because many of the most popular and well-established ETFs, such as USO and UNG, suffer from a terrible contango problem, which make these ETFs poor trackers of the indexes they are supposed to represent. So, when the markets go down they lose, and when the markets go up they don't go up as much as they should.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.google.com/search?q=uso+vs+spot+crude+oil&amp;amp;source=lnms&amp;amp;tbm=isch&amp;amp;sa=X&amp;amp;ved=0ahUKEwiq1f3Tv7fLAhXBlB4KHURJBGkQ_AUICCgC&amp;amp;biw=1568&amp;amp;bih=760&quot; rel=&quot;nofollow&quot;&gt;https://www.google.com/search?q=uso+vs+spot+crude+oil&amp;amp;source=lnms&amp;amp;tbm=isch&amp;amp;sa=X&amp;amp;ved=0ahUKEwiq1f3Tv7fLAhXBlB4KHURJBGkQ_AUICCgC&amp;amp;biw=1568&amp;amp;bih=760&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19508" LastEditorUserId="19508" LastEditDate="2016-03-11T01:39:01.997" LastActivityDate="2016-03-11T01:39:01.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24805" PostTypeId="2" ParentId="24803" CreationDate="2016-03-10T23:24:24.657" Score="1" Body="&lt;p&gt;Before you start asking about the number of dof, how do you know that the finite sample distribution of parameters is student-t? I don't think it is. In linear regression they are student-t because of linearity and under assumption for the residual distribution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Garch you can just say that if you estimate using max-likelihood then asymptotically (not finite sample) parameter distributions are Gaussian, with variance proportional to the inverse of the Hessian of the log-lik function. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you go down that route, then you have to resist the shortcut of using the Hessian that the optimizer spits out. Also, you have to remember that p-values in this context are possibly meaningless quantities in the first place (as the ASA recently all but admitted). &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-03-10T23:24:24.657" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24809" PostTypeId="1" CreationDate="2016-03-11T07:40:50.920" Score="1" ViewCount="277" Body="&lt;p&gt;I want to backtest a strategy using K-fold cross validation.  Assume I have a period of 300 days in my backtest.  I divide it into 30 folds of 10 days each.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On day 1 of a fold, I enter a trade, and exit after 6 days.  On day 7 I enter another trade.  But when we hit day 10, the final day in the fold, the trade is still open.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the best way to handle this?  Should I just close the trade at the end of day 10, and record the pnl at that point?  Or just ignore the trade altogether since it was unfinished (ie, still open).&lt;/p&gt;&#xA;" OwnerUserId="2983" LastActivityDate="2019-03-09T11:01:40.327" Title="Kfold cross validation: how to handle hold-out periods" Tags="&lt;quant-trading-strategies&gt;&lt;backtesting&gt;&lt;validation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24811" PostTypeId="1" AcceptedAnswerId="24815" CreationDate="2016-03-11T11:24:44.540" Score="2" ViewCount="682" Body="&lt;p&gt;The floating leg of a USD swap has present value&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;PV = \sum_{i=1}^N \delta_i f_i p^d(t_i)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the $\{t_i\}$ are the floating leg payment dates, $\delta_i$ is the accrual fraction between $t_{i-1}$ and $t_i$, $p^d(t)$ is the curve used for discounting, and $f_i$ are the forward rates determined from the LIBOR curve $p^l(t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;f_i = \frac{1}{\delta_i} \left(\frac{p^l(t_{i-1})} {p^l(t_i)} - 1 \right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The day count convention for the floating leg of a USD swap is ACT/360, so it is clear that when computing the $\delta_i$ we should use the ACT/360 day count function,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\delta_i = \textrm{Days}_{\rm ACT/360}(t_{i-1}, t_i)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what day count convention should we use for discounting? If I also use ACT/360, then the year fraction from $t = 0$ to the final payment on a 10-year swap is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\textrm{Days}_{\rm ACT/360} (0, 10y) \approx \frac{10\times 365}{360} \approx 10.139&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which has the counter-intuitive consequence that the price of a 10-year swap depends on values of the discount curve beyond the 10 year point, which is clearly nonsense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it seems as though we should use some other day count convention for discounting, e.g. ACT/ACT or ACT/365. But this breaks the property that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\sum_{i=1}^n \delta_i = t_n&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which also seems undesirable. Can anyone clear up my confusion?&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2016-03-11T14:46:45.637" Title="ACT/360 day convention in swap pricing" Tags="&lt;swaps&gt;&lt;interest-rate-swap&gt;&lt;daycounting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24812" PostTypeId="2" ParentId="21994" CreationDate="2016-03-11T11:34:11.260" Score="0" Body="&lt;p&gt;This doesn't answer your question directly, but it may be interesting for you to see a visualization of a pair trading strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm the developer of an interactive chart tool for technical analysis that also has a pair strategy function. In my pair trading implementation I'm calculating the mean ratio between the stocks and generating entry signals when the ratio is 2 std. deviations from the mean ratio and exit when 1 stddev. I'm also running cointegration (ADF) and correlation tests that has to pass for the entry signal to be generated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An &quot;random&quot; example of the strategy is shown in the live interactive chart (link below). The white area shows when a trade is active - and &quot;Algo&quot; shows the return for all trades in total. As shown in the chart for the past 9 months the automated strategy generated 6 trades and all of them gave positive returns including the one that is currently open. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://bors.e24.no/?qlyze=j5fPryaPUiS1z5pUj1R52yDygE#!/instrument/OSEBX.OSE/analysis&quot; rel=&quot;nofollow&quot;&gt;https://bors.e24.no/?qlyze=j5fPryaPUiS1z5pUj1R52yDygE#!/instrument/OSEBX.OSE/analysis&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19726" LastActivityDate="2016-03-11T11:34:11.260" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24813" PostTypeId="2" ParentId="24803" CreationDate="2016-03-11T11:50:44.080" Score="1" Body="&lt;p&gt;$v$ should be the total number of parameters (constants + AR + MA + GARCH + ARCH).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I disagree with @kiwiakos, the student t(df) distribution is used because we are using &lt;strong&gt;standard errors&lt;/strong&gt; which are &lt;strong&gt;estimates&lt;/strong&gt; of standard deviations (and not true standard deviations) to compute the statistic. That is the reason why we use student t test eventhose the asymptotically parameter distribution is Gaussian.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The formula for the p-value is then :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Coeff = 0.15 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Std Error = 0.064  (or robust std errors)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The t-statistic  is : 0.15/ 0.064  =   2.3438   (not p-statistic because we use standard error!)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;t-prob = p-value = 2*(1-tcdf( | 2.3438 | ,n-v))    ( p-value with a student dist and not p-value with a normal dist !)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is not specific to GARCH parameters but to the theory of tests statistics. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main idea :&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We should use the z-test only if there is no uncertainty regarding the&#xA;  population variance. However this is rarely the case so the p-value are obtained using the student t distribution. If the sample size is large enough the normal distribution (i.e the z test) can be used.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Let's X to be a gaussian random variable, and let $\bar{X}$ to be the sample mean.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The standardized statistic z is normally distributed ( see the central limit theorem) and is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$z =  (\bar{x} - m_{0} )/ \sigma_{\bar{X}} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\sigma_{\bar{X}} $ is the standard deviation of the sample mean. We can compute this standard deviation based on the &lt;strong&gt;population&lt;/strong&gt; variance $\sigma_{X}^{2}$ and it is given by :&#xA;\begin{equation*}\begin{aligned}&#xA;\sigma_{\bar{X}}^{2} &amp;amp;=&amp;amp; var\{\dfrac{1}{n}(X_{1}+\ldots + X_{n})\}\\&#xA;&amp;amp;=&amp;amp;\dfrac{1}{n^2} var\{( X_{1}+\ldots + X_{n} )\}\\&#xA;&amp;amp;=&amp;amp;\dfrac{1}{n^2} (\sigma_{X}^{2}+ \ldots+ \sigma_{X}^{2})\\&#xA;&amp;amp;=&amp;amp;\dfrac{1}{n^2} (n\sigma_{X}^{2})\\&#xA;&amp;amp;=&amp;amp; \frac{\sigma_{X}^{2}}{n}&#xA;\end{aligned}\end{equation*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However since we don’t know the &lt;strong&gt;population&lt;/strong&gt; variance $\sigma^{2}_{X} $ we need to employ an estimation for it and this introduce some &lt;strong&gt;uncertainty&lt;/strong&gt;. To approximate the population variance $\sigma_{X}^{2}$, (generally) we employ the &lt;strong&gt;sample&lt;/strong&gt; variance given by :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation*}&#xA;s_{X}^{2}=\dfrac{1}{n-1}\sum_{i=1}^{n}(X_{i}-\bar{X})^{2}&#xA;\end{equation*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the variance of the sample mean is approximated as follow :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\widehat{ \sigma^{2}_{\bar{X}}} = \frac{s_{X}^{2} }{ n}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(instead of $ \frac{\sigma_{X}^{2}}{n}$ )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the &lt;strong&gt;standards errors&lt;/strong&gt; (which takes into account this uncertainty) are :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ se = \sqrt{\widehat{ \sigma^{2}_{\bar{X}}} } =  \frac{s_{X}  }{\sqrt{n}}$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;the z test is modified in the following way:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$z =   \frac{ \bar{x} - m_{0} }{ \sigma_{\bar{X}} } $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;becomes :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$t = \frac{ \bar{x} - m_{0} }{ se } $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and $t$ will be student t distributed with (n-number of parameters) degrees of freedom (see &lt;a href=&quot;https://en.wikipedia.org/wiki/Normal_distribution#Combination_of_two_or_more_independent_random_variables&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; ).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fact that we employ the standards errors instead of the standard deviation make the Z test to be a T test . When we use the MLE method, it is the same , we can replace X as the estimated parameters (wich are asymptotically gaussian random variables). We don't employ their true standards deviations but we use an estimation of it. The Hessian gives us the standards errors , not the standards deviations (because there is uncertainty - we don't observe the population but a sample). So we should employ the $t$ test.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that, when $n$  (the number of observation ) increases the student t distribution becomes closer to the normal distribution and then p values obtained with the normal distribution or student t distribution will becomes the same ( cf @John comment). This is logical because the uncertainty decreases as the number of observations increases. &lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2016-03-11T22:24:28.740" LastActivityDate="2016-03-11T22:24:28.740" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="24814" PostTypeId="2" ParentId="22234" CreationDate="2016-03-11T14:41:16.220" Score="1" Body="&lt;p&gt;what you should analyze:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Look at seasonalities as user Horeseless points out. &lt;/li&gt;&#xA;&lt;li&gt;Look at ACF, if it cuts off suddenly then there is something of MA nature, if it decays slowly then it is rather AR.&lt;/li&gt;&#xA;&lt;li&gt;Look at partial ACF to see which lags are relevant.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You find theory and code &lt;a href=&quot;https://www.otexts.org/fpp/8/9&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-03-11T14:41:16.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24815" PostTypeId="2" ParentId="24811" CreationDate="2016-03-11T14:46:45.637" Score="3" Body="&lt;p&gt;The discount curve should be constructed such that there's a one-to-one mapping between a date and a discount factor. It is common practice to use either Actual/365 or Actual/365.25 for the discount curve. Once a convention has been adopted, it should be used for all discount curve construction, regardless of the market convention of the product in question. The final output can always be converted into the proper convention.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2016-03-11T14:46:45.637" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24816" PostTypeId="1" CreationDate="2016-03-11T15:33:30.540" Score="0" ViewCount="864" Body="&lt;p&gt;When taking capital budgeting decisions appropriate cost of capital should depend on the horizon of the investment. So the beta of a stock, i.e. it's covariance with the market should depend on the horizon of the investment. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For some stocks, beta might be declining with maturity. For others, beta might be increasing with maturity. Is there any literature out there that talks about this issues? Why economically and fundamentally, beta for a company at different horizons might differ?&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2016-05-23T14:50:48.073" Title="CAPM betas at different horizons" Tags="&lt;capm&gt;&lt;beta&gt;&lt;capital-budget&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24817" PostTypeId="2" ParentId="23210" CreationDate="2016-03-11T15:34:48.117" Score="2" Body="&lt;p&gt;As @Nicholas said in a comment KX/KDB+ is popular in finance for this purpose. Direct message passing and local aggregation on the machine may be the best method in this case IMO. &lt;/p&gt;&#xA;" OwnerUserId="4910" LastActivityDate="2016-03-11T15:34:48.117" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24818" PostTypeId="2" ParentId="21994" CreationDate="2016-03-11T16:28:44.083" Score="2" Body="&lt;p&gt;It should be consistent with the way you calculate $\beta:$ if you use stock returns to compute it, then you should be using returns to compute the spread and your signal, and aim to be cash neutral: N $\it{dollars}$ long of x and $\beta\times N$ $\it{dollars}$ short of y. If you regress the prices of x and y to obtain $\beta,$ then pretty much, what you wrote - N $\it{shares}$ of x and $\beta\times N$ $\it{shares}$ of y.&lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2016-03-11T16:28:44.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24819" PostTypeId="1" CreationDate="2016-03-11T17:35:44.250" Score="1" ViewCount="116" Body="&lt;p&gt;In one of his winning paper, backward induction for future values, A. Antonov, quant of the year 2016, refer to the American Monte-Carlo method as the Las Vegas method. Is this name used appart from him ?&lt;/p&gt;&#xA;" OwnerUserId="5052" LastActivityDate="2016-03-11T17:35:44.250" Title="Las vegas method?" Tags="&lt;monte-carlo&gt;&lt;american&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24821" PostTypeId="1" CreationDate="2016-03-11T18:13:06.290" Score="1" ViewCount="529" Body="&lt;p&gt;I want to perform a constraint optimization for Maximum Likelihood Estimation in R to forecast volatility of returns. The probleme is that my initial values aren't in the permitted region. Is there something like an EM algorithm which I can use. Somebody an idea how to find the value region?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;my code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quantmod)&#xA;getSymbols('^GDAXI', src='yahoo', return.class='ts',from=&quot;2005-01-01&quot;, to=&quot;2015-01-31&quot;)&#xA;GDAXI.DE=GDAXI[ , &quot;GDAXI.Close&quot;]&#xA;log_r1=diff(log(GDAXI.DE[39:2575]))&#xA;&#xA;sigma=matrix(nrow=length(log_r1)-1, ncol=1)&#xA;for(i in 2:length(log_r1))&#xA;{&#xA;sigma[i-1]=var(log_r1[1:i])&#xA;}&#xA;&#xA;error=matrix(nrow=length(log_r1), ncol=1)&#xA;mu=mean(log_r1)&#xA;for(i in 1:length(log_r1))&#xA;{&#xA;error[i]=log_r1[i]-mu&#xA;}&#xA;&#xA;sig=var(log_r1)&#xA;er=error&#xA;Sigma_garch=matrix(nrow=length(sigma), ncol=1)&#xA;garch=function(th)&#xA;{&#xA;omega.0=th[1]&#xA;alpha.0=th[2]&#xA;beta.0=th[3]&#xA;for(i in 1:length(sigma))&#xA;{&#xA;if(i==1)&#xA;{&#xA;  Sigma_ga=sig&#xA;}else&#xA;{&#xA;  Sigma_ga=Sigma_garch[i-1]&#xA;}&#xA;Sigma_garch[i]=omega.0+alpha.0*er[i]^2+beta.0*Sigma_ga &#xA;}&#xA;return(Sigma_garch)&#xA;}&#xA;&#xA;LogLik=function(th)&#xA;{&#xA;input=garch(th)&#xA;sig=input&#xA;for(i in 1:length(sigma))&#xA;{&#xA;LL=(-1/2)*log(2*pi)-(1/2)*log(sig[i])-(1/2)*er[i]/sig[i]&#xA;}&#xA;}&#xA;&#xA;ui=matrix(c(diag(1,3),c(0,(-1),(-1))),4,3, byrow = T)&#xA;ci=c(0.01,0,0,(-0.99))&#xA;theta=c(0.02,0.01,0.95)&#xA;est=constrOptim(c(0.0000029,0.095,0.0888),LogLik, grad=NULL, ui,ci,hessian=TRUE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="18848" LastEditorUserId="18848" LastEditDate="2016-03-13T14:54:37.417" LastActivityDate="2017-09-05T12:37:44.920" Title="Starting values for constrOptim() in R" Tags="&lt;r&gt;&lt;optimization&gt;&lt;forecasting&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24822" PostTypeId="1" CreationDate="2016-03-11T19:29:15.353" Score="2" ViewCount="142" Body="&lt;h1&gt;Background&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;In Eric Zivot's analysis of factor models he uses three models &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The sample (.sample)&lt;/li&gt;&#xA;&lt;li&gt;Single index model (.si)&lt;/li&gt;&#xA;&lt;li&gt;Barra factor industry model (.ind)&lt;/li&gt;&#xA;&lt;li&gt;PCA model  (.pca) &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You can download his &lt;a href=&quot;http://faculty.washington.edu/ezivot/econ589/estimatingmacrofactormodels.pdf&quot; rel=&quot;nofollow&quot;&gt;theory and notation macro models&lt;/a&gt; and &lt;a href=&quot;http://faculty.washington.edu/ezivot/econ589/estimatingfundamentalfactormodels.pdf&quot; rel=&quot;nofollow&quot;&gt;theory and notation fundamental models&lt;/a&gt; as well as the &lt;a href=&quot;http://faculty.washington.edu/ezivot/econ589/estimatefactorModelsPowerpoint.pdf&quot; rel=&quot;nofollow&quot;&gt;analysis slides&lt;/a&gt;. I have a question on an analysis. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's from a second year PhD course and I'm a BSc student but I have spent this week trying to understand the theory and code and I think I'm on my way. &lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Question&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I want to interpret two things: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The &lt;strong&gt;correlation matrix&lt;/strong&gt; given by code &lt;code&gt;plotcorr()&lt;/code&gt; i.e. in his slides &lt;em&gt;page 7, 17, 36&lt;/em&gt; for &lt;em&gt;sample, .ind, .pca&lt;/em&gt; respectively.&lt;/li&gt;&#xA;&lt;li&gt;The  &lt;strong&gt;portfolio weights&lt;/strong&gt; he has calculated for min variance portfolio, given by code &lt;code&gt;barplot(t(w.gmin.modelnamegoeshere))&lt;/code&gt;  i.e. &lt;em&gt;page 7, 19, 39&lt;/em&gt; for modelnames &lt;em&gt;.sample, .ind, .pca&lt;/em&gt; respectively.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So I wonder: Given these plots 4 correlation plots and 4 portfolio weights plot, are any model preferable to another? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Note that Zivot either forget or deliberately omit the &lt;em&gt;.si models&lt;/em&gt; for plotcorr() and portfolio weights - it's in his code but didn't make it to the powerpoint.)&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;My guess&lt;/h1&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;For the first question, my guess is that you want to be close to the sample. Because we do cor(returns) for &quot;.sample&quot;  &quot;.si model&quot; &quot;.ind model&quot; and &quot;.pca model&quot; and we wish to explain the return data with a model, so being similar to the sample is what we want. Here my eyes tell me .ind looks most like .sample and hence .ind model is better. &lt;/li&gt;&#xA;&lt;li&gt;For the second question, my first guess was that you want to be close to the sample for the same reason as above. But then I hesitaded. What we do here to find - given corr(returns) and returns - a minimum variance portfolio. So the sample is a benchmark and we wish to have better risk adjusted return. Which is better of Zivot's models? I don't know. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="12002" LastActivityDate="2016-03-11T19:29:15.353" Title="Interpreting different factor models w.r.t. correlation matrix and min variance portfolio weights" Tags="&lt;r&gt;&lt;modern-portfolio-theory&gt;&lt;factor-models&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24824" PostTypeId="2" ParentId="24816" CreationDate="2016-03-12T01:52:44.690" Score="-1" Body="&lt;p&gt;Hmm, I guess you're trying to determine the cost of capital using CAPM. Generally speaking, beta should stabilize for mature companies. Personally, I like to use an adjusted beta, eg: 1/3*current_beta + 2/3 to reflect this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Beta of a stock is just a measure of how it's covariance is affected compared to the market's volatility as you pointed out. Here's a link from Investopedia about calculating beta:&#xA;&lt;a href=&quot;http://www.investopedia.com/ask/answers/070615/what-formula-calculating-beta.asp&quot; rel=&quot;nofollow&quot;&gt;http://www.investopedia.com/ask/answers/070615/what-formula-calculating-beta.asp&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since it is clearly a function of market dynamics, beta is often subject to the whims of investors, and sometimes rightfully. Mature companies can go either way -- imagine a major lawsuit that affects a well established public company. A high profile case could cause the volatility of the stock to be extremely volatile for many months in a &quot;serene&quot; market causing its beta to jump. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope that helps.&lt;/p&gt;&#xA;" OwnerUserId="13785" LastActivityDate="2016-03-12T01:52:44.690" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24825" PostTypeId="1" CreationDate="2016-03-12T05:54:16.293" Score="5" ViewCount="869" Body="&lt;p&gt;Online I found the asymptotic behavior property of geometric Brownian Motion &lt;span class=&quot;math-container&quot;&gt;$X_t$&lt;/span&gt;as:&lt;/p&gt;&#xA;&lt;p&gt;If &lt;span class=&quot;math-container&quot;&gt;$\mu$&lt;/span&gt; (drift parameter) is &lt;span class=&quot;math-container&quot;&gt;$\ge$&lt;/span&gt; &lt;span class=&quot;math-container&quot;&gt;$\sigma^2/2$&lt;/span&gt; where &lt;span class=&quot;math-container&quot;&gt;$\sigma$&lt;/span&gt; is the volatility parameter, then &lt;span class=&quot;math-container&quot;&gt;$X_t \rightarrow \infty$&lt;/span&gt; as &lt;span class=&quot;math-container&quot;&gt;$t \rightarrow \infty$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;If &lt;span class=&quot;math-container&quot;&gt;$\mu &amp;lt; \sigma^2/2$&lt;/span&gt;, then &lt;span class=&quot;math-container&quot;&gt;$X_t \rightarrow 0$&lt;/span&gt; as &lt;span class=&quot;math-container&quot;&gt;$t \rightarrow \infty$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;If &lt;span class=&quot;math-container&quot;&gt;$\mu = \sigma^2/2$&lt;/span&gt;, then &lt;span class=&quot;math-container&quot;&gt;$X_t$&lt;/span&gt; has no limit as &lt;span class=&quot;math-container&quot;&gt;$t \rightarrow \infty$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;While this makes sense, how would the proof look like for this property? I'm not really sure how to approach it at the moment. Any help is appreciated.&lt;/p&gt;&#xA;" OwnerUserId="19861" LastEditorUserId="44275" LastEditDate="2021-04-09T10:58:17.067" LastActivityDate="2021-04-09T10:58:17.067" Title="Asymptotic behavior property of geometric Brownian Motion proof" Tags="&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="24826" PostTypeId="1" CreationDate="2016-03-12T08:35:07.590" Score="2" ViewCount="106" Body="&lt;p&gt;These hedge funds were forced into bankruptcy. This was due to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the correct answer is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long Mezzanine and Short Equity Tranche position when correlation of Mezzanine tranche decreased.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone explain the above?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically what is spread and how it affects value of Equity tranche? And why the above situation led to losses?&lt;/p&gt;&#xA;" OwnerUserId="19862" LastActivityDate="2016-03-12T08:35:07.590" Title="In May of 2005, several large hedge funds had speculative positions in CDO tranches" Tags="&lt;risk-management&gt;&lt;correlation&gt;&lt;hedge-fund&gt;&lt;cdo&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24827" PostTypeId="1" CreationDate="2016-03-12T12:26:33.627" Score="3" ViewCount="3800" Body="&lt;p&gt;My company has Bloomberg terminal, but I've heard I shouldn't import any batch of data into Excel using BLP plugin, because it is pricey. They told me that some time ago somebody did this and they paid $ 200 000 invoice. I can only check prices one by one using BBG app. Is this really true?&lt;/p&gt;&#xA;" OwnerUserId="19865" LastEditorDisplayName="user13444" LastEditDate="2016-12-19T10:39:02.387" LastActivityDate="2016-12-19T13:09:15.737" Title="Batch-downloading Bloomberg data into Excel" Tags="&lt;finance&gt;&lt;bloomberg&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24828" PostTypeId="2" ParentId="16909" CreationDate="2016-03-12T14:56:31.410" Score="3" Body="&lt;p&gt;For short maturity SPX option chain, the analytic form of the V-shape volatility smile has been fully worked out in &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2707810&quot; rel=&quot;nofollow&quot;&gt;my latest paper on SSRN&lt;/a&gt;. You can take a look.&lt;/p&gt;&#xA;" OwnerUserId="19835" LastActivityDate="2016-03-12T14:56:31.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24829" PostTypeId="2" ParentId="24825" CreationDate="2016-03-12T15:06:17.063" Score="4" Body="&lt;p&gt;Write $X_t = \exp(\mu B_t + (\mu - \frac {\sigma^2}{2})t )$. &#xA;To prove the statement you can use the law of large numbers for Brownian motion which states that  $\lim_{t \to \infty} \frac {B_t}{t} = 0$. Then rewrite $X_t$ as&#xA;$$X_t = \exp(t (\mu \frac {B_t}{t} + (\mu - \frac{\sigma^2}{2})).$$&#xA;Using these two properties, you can analyze the convergence behaviour of $X_t$.&lt;/p&gt;&#xA;" OwnerUserId="19867" LastActivityDate="2016-03-12T15:06:17.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24830" PostTypeId="2" ParentId="24825" CreationDate="2016-03-12T16:32:17.703" Score="5" Body="&lt;p&gt;For any &lt;span class=&quot;math-container&quot;&gt;$\alpha &amp;gt; 0$&lt;/span&gt;, &#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}&#xA;\lim_{t\rightarrow\infty}P\left(e^{\big(u-\frac{\sigma^2}{2}\big) t +\sigma W_t} &amp;gt; \alpha \right) &amp;amp;= \lim_{t\rightarrow\infty}P\left(\big(u-\frac{\sigma^2}{2}\big) t +\sigma W_t &amp;gt; \ln \alpha \right)\\&#xA;&amp;amp;=\lim_{t\rightarrow\infty}P\left(\frac{W_t}{\sqrt{t}} &amp;gt; \frac{\ln\alpha- \big(u-\frac{\sigma^2}{2}\big) t }{\sigma \sqrt{t}} \right)\\&#xA;&amp;amp;=\lim_{t\rightarrow\infty}\Phi\left(\frac{\big(u-\frac{\sigma^2}{2}\big) t -\ln\alpha}{\sigma \sqrt{t}} \right)\\&#xA;&amp;amp;=&#xA;\begin{cases}&#xA;1, &amp;amp;\mbox{ if } u&amp;gt;\frac{\sigma^2}{2},\\&#xA;\frac{1}{2}, &amp;amp;\mbox{ if } u=\frac{\sigma^2}{2},\\&#xA;0, &amp;amp;\mbox{ if } u &amp;lt; \frac{\sigma^2}{2}.&#xA;\end{cases}&#xA;\end{align*}&lt;/span&gt;&#xA;The conclusion now follows immediately.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Edit based on comments below.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Let &lt;span class=&quot;math-container&quot;&gt;$X_t = e^{\big(u-\frac{\sigma^2}{2}\big) t +\sigma W_t}$&lt;/span&gt;. Note that&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}&#xA;\left(\omega:\, \lim_{t\rightarrow \infty} X_t = \infty \right) &amp;amp;= \cap_{m=1}^{\infty}\cup_{n=1}^{\infty} \cap_{t\ge n}(\omega:\,X_t &amp;gt; m).&#xA;\end{align*}&lt;/span&gt;&#xA;The almost surely convergence, for the case where &lt;span class=&quot;math-container&quot;&gt;$u&amp;gt;\frac{\sigma^2}{2}$&lt;/span&gt;,  follows immediately.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2019-12-05T13:26:51.943" LastActivityDate="2019-12-05T13:26:51.943" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="24831" PostTypeId="2" ParentId="24827" CreationDate="2016-03-12T16:36:45.803" Score="1" Body="&lt;p&gt;You should double check this with your Bloomberg rep, but here's the explanation I received from them:&#xA;The limits are per request per ticker, so a single BDP request for one data point is the same as a BDH request downloading 5y of data. i.e. if you want lots of data with matching dates, never use a date/ticker grid with n*m BDH requests - that will definitely hit your limits.&#xA;I've been downloading lots of bbg data while keeping this in mind and never ran into any problems, including 1min data for hundreds of tickers at a time.&lt;/p&gt;&#xA;" OwnerUserId="19615" LastActivityDate="2016-03-12T16:36:45.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24832" PostTypeId="2" ParentId="24685" CreationDate="2016-03-12T18:27:21.367" Score="3" Body="&lt;p&gt;I think that I found correct answer to my question. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have the following theorem:&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Theorem.&lt;/strong&gt; If $X$ is independent of $\mathcal{G}$, $Y$ is $\mathcal{G}$ - measurable and $\phi(x,y)$ is bounded function then:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E\left[\phi(X,Y)|\mathcal{G}\right]=E\left[\phi(X,y)\right]$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In my problem I want to calculate the following formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C_{t}=\mathbb{E}^{*}\left[e^{-r(T-t)}I_{\{S_{T}-K&amp;gt;0\}}|F_{t}\right]=e^{-r(T-t)}\mathbb{E}^{*}\left[I_{\{S_{T}-K&amp;gt;0\}}|F_{t}\right]=\ldots $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so if i rewrite $S_{T}$ as $S_{T}=S_{t}e^{(r-\frac{1}{2}\sigma^{2})(T-t)+\sigma(W^{*}_{T}-W^{*}_{t})}$ i will get something like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S_{T}=Y\cdot e^{(r-\frac{1}{2}\sigma^{2})(T-t)+\sigma\cdot X}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Y$ is $F_{t}$ - measurable and $X$ is independent of $F_{t}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, we can define $\phi(x,y)=I_{\{y\cdot e^{C+D\cdot x}-K&amp;gt;0\}}$ which is bounded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It means that using the above theorem we get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\ldots=e^{-r(T-t)}\mathbb{E}^{*}\left[I_{\left\{S_{t}e^{(r-\frac{1}{2}\sigma^{2})(T-t)+\sigma(W^{*}_{T}-W^{*}_{t})}-K&amp;gt;0\right\}}|F_{t}\right]$$&#xA;$$=e^{-r(T-t)}\mathbb{E}^{*}\left[I_{\left\{S_{t}e^{(r-\frac{1}{2}\sigma^{2})(T-t)+\sigma(W^{*}_{T}-W^{*}_{t})}-K&amp;gt;0\right\}}\right]$$&#xA;$$=e^{-r(T-t)}Q\left(S_{t}e^{(r-\frac{1}{2}\sigma^{2})(T-t)+\sigma(W^{*}_{T}-W^{*}_{t})}-K&amp;gt;0\right)=\ldots$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and this is what we want.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Comments.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You are basically correct. For any two independent random variables $X$ and $Y$, the theorem says that &#xA;\begin{align*}&#xA;E\big(\phi(X, Y) \mid \mathcal{G} \big) = E\big(\phi(X, y) \,\big)\, |_{y=Y}.&#xA;\end{align*}&#xA;Here, for the conditional expectation, &#xA;\begin{align*}&#xA;\mathbb{E}^*\bigg(I_{\big\{S_{t}e^{(r-\frac{1}{2}\sigma^{2})(T-t)+\sigma(W^*_{T}-W^*_{t})}-K&amp;gt;0\big\}} \mid \mathcal{F}_{t}\bigg)&#xA;&amp;amp;= \mathbb{E}^*\bigg( I_{\big\{s\,e^{(r-\frac{1}{2}\sigma^{2})(T-t)+\sigma(W^*_{T}-W^*_{t})}-K&amp;gt;0\big\}} \bigg)\,\Big|_{s=S_t}\\&#xA;&amp;amp;= N(d_2).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="19494" LastEditorUserId="11678" LastEditDate="2016-03-12T20:04:06.983" LastActivityDate="2016-03-12T20:04:06.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24833" PostTypeId="2" ParentId="24733" CreationDate="2016-03-12T19:06:29.370" Score="1" Body="&lt;p&gt;Take the weighted average tenor of your book. Weights being the notional of the non usd leg. That is very roughly your duration, which gives you your risk !  Ps i assume all the trades are on the same currency pair&lt;/p&gt;&#xA;" OwnerUserId="17348" LastActivityDate="2016-03-12T19:06:29.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24835" PostTypeId="1" CreationDate="2016-03-12T19:40:42.053" Score="0" ViewCount="668" Body="&lt;p&gt;Let's consider a simple European call option. In practice, the way the Black-Scholes formula is used to price it is by injecting all of the parameters and paying special attention to the volatility and the dividends where their implied values are used. This gives then, by definition, the market price of the corresponding call option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, suppose one wants to price a call option with maturity $T$ and strike $K$ that isn't found in the market (and hence has no corresponding implied volatility or dividends). One could either interpolate between the prices of the options with the closest maturities and strikes, or one could interpolate between the implied volatilities and dividends corresponding to the closest maturities and strikes and then inject into the BS formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which one is the best approach ?&lt;/p&gt;&#xA;" OwnerUserId="19693" LastActivityDate="2016-03-14T23:25:12.240" Title="Interpolating on the BS parameters and injecting in the BS formula vs interpolating directly on option prices" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;implied-volatility&gt;&lt;interpolation&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24836" PostTypeId="1" CreationDate="2016-03-12T20:38:26.073" Score="0" ViewCount="159" Body="&lt;p&gt;If I know that my model follows a no-arbitrage HJM model:&#xA;\begin{equation}&#xA;df(\tau)&#xA;= &#xA;\left(\sigma(\tau)\int_0^{\tau}\sigma(u)du\right)dt&#xA; +\sigma(\tau)dW_{\tau}&#xA;\end{equation}&#xA;(where $\tau:=T-t$, the time until maturity $T$ of a Bond and) $\sigma$ a process adapted to $W_{\star}$'s filtration.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do we derive the yield curve for such a model?  That is the models I see all have deterministic yield curve, is this the expectation of the above SDE?&lt;/p&gt;&#xA;" OwnerUserId="11582" LastActivityDate="2016-03-12T20:38:26.073" Title="Deriving the yield curve from the HJM dynamics" Tags="&lt;fixed-income&gt;&lt;yield-curve&gt;&lt;no-arbitrage-theory&gt;&lt;heath-jarrow-morton&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24837" PostTypeId="2" ParentId="24685" CreationDate="2016-03-12T20:46:01.897" Score="5" Body="&lt;p&gt;You can also infer the value of your binary option from the value of a European call option with the same strike and time-to-maturity by going long on a call with strike $K$ and time-to-maturity $\tau$, and short on a call with strike $K+\Delta K$ and the same time-to-maturity. If you hold $\frac{1}{\Delta K}$ of that portfolio, then as $\Delta K$ goes to zero, your total payoff becomes closer to the payoff of the binary option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you denote by $V_t$ the value of your binary option, and $C_t \left(\tau ,K \right)$ the value of a European call option with strike $K$ and expiring at $t+\tau$, then it is easy to see the following :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V_t = \lim_{\Delta K \to 0} \frac{1}{\Delta K} \left( C_t\left(\tau,K\right)-C_t\left(\tau,K+\Delta K\right) \right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically the value of the binary option is the opposite of the partial derivative of the price of a European call option of the same strike and time-to-maturity with respect to the strike, ie :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V_t = - \frac{\partial C_t}{\partial K} \left( \tau, K \right)$$&#xA;$$=-\frac{\partial}{\partial K} \left( e^{-q\tau} S_t \mathcal{N}\left( d_1 \right) - e^{-r \tau} K \mathcal{N}\left( d_2 \right) \right)$$&#xA;$$=e^{-r\tau} \mathcal{N} \left( d_2 \right)$$&lt;/p&gt;&#xA;" OwnerUserId="19693" LastEditorUserId="19693" LastEditDate="2016-03-13T11:41:37.990" LastActivityDate="2016-03-13T11:41:37.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24838" PostTypeId="1" AcceptedAnswerId="24844" CreationDate="2016-03-12T21:54:36.113" Score="2" ViewCount="1539" Body="&lt;p&gt;I am trying to see if momentum strategy has a profitability in a bond market. I have a bond dataset which is a panel data and it is monthly. It looks something like the table below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/3XT3s.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/3XT3s.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For each month t, I am trying to form a 10 portfolio based on their return on t-3 to t-1 period. So each month there will be 10 portfolios p1(the loser) to p10(the winner) and I am going to but the winner and sell the loser and hold it for another 3 months (t+1 to t+3) and see if this gives profit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I just can't think of a good approach to implement this. I think it is complicated because each month I would have different portfolios. I don't know if my explanation was clear enough but any advice?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks kdk.&lt;/p&gt;&#xA;" OwnerUserId="19872" LastActivityDate="2016-03-14T11:45:36.047" Title="How to implement momentum strategy using R" Tags="&lt;r&gt;&lt;momentum&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24839" PostTypeId="1" AcceptedAnswerId="24841" CreationDate="2016-03-12T23:05:36.107" Score="1" ViewCount="295" Body="&lt;p&gt;So the question asks: Consider 4 following European call and put options with the same maturity time:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Call option with strike price $100$ sell for $45$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Call option with strike price $110$ sell for $40$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Put option with strike price $100$ sell for $36$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Put option with strike price $110$ sell for  $42$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Given the continuous compounding interest rate r = 0.05 and the maturity time T = 1. Can you choose a portfolio using some of the options from the table and the Bank account to find an arbitrage profit? If yes, be specic about your arbitrage portfolio. If no, prove your argument. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So so far I got: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First consider the put-call parity: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the market follows &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C^E − P^E = S(0) − X^{e^{−rT}}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;if there is no arbitrary profit. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;If $C^E − P^E&amp;gt; S(0) − X^{e^{−rT}}$&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case an arbitrage strategy can be constructed as follows: At time 0&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• buy one share for S(0);&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• buy one put option for $P^E$;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• write and sell one call option for $C^E$;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• invest the sum $C^E−P^E−S(0)$ (or borrow, if negative) on the money market&#xA;at the interest rate r.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The balance of these transactions is 0. Then, at time T&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• close out the money market position, collecting (or paying, if negative) the&#xA;sum $(C^E − P^E − S(0))e^{rT}$ ;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• sell the share for X either by exercising the put if S(T) ≤ X or settling the&#xA;short position in calls if S(T) &gt; X.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The balance will be $(C^E − P^E − S(0))e^{rT} + X &amp;gt; 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;If $C^E − P^E &amp;lt; S(0) − X^{e^{−rT}}$&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;At time 0&#xA;• sell short one share for S(0);&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• write and sell a put option for $P^E$;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• buy one call option for $C^E$;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• invest the sum $S(0)−C^E+P^E$ (or borrow, if negative) on the money market&#xA;at the interest rate r.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The balance of these transactions is 0. At time T&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• close out the money market position, collecting (or paying, if negative) the&#xA;sum $(S(0) − C^E + P^E)e^{rT}$ ;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• buy one share for X either by exercising the call if S(T) &gt; X or settling the&#xA;short position in puts if S(T) ≤ X, and close the short position in stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The balance will be $(S(0) − C^E + P^E)e^{rT} − X$ &gt; 0&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But how do I suppose to find a specific arbitrary profit without knowing the S(0) which is the current stock price? Or, how to prove if no Arbitrage profit exists without the current stock price? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Update&lt;/em&gt;&lt;/strong&gt;: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;At time 0: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;• sell one share with strike price 110 for S(0);&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• write and sell a put option for PX with strike price 100;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• buy one call option for CE with strike price 100;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• investing the sum $S(0)−C^E+P^X$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;• buy one share with strike price 110 for S(0);&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• buy one put option for $P^E$ with strike price 100;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• write and sell one call option for $C^X$ with strike price 110;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• invest the sum $C^X−P^E−S(0)$ on the money market at the interest rate r.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• investing the balance $( C^E−P^X ) –( C^X-P^E )$ on the money market at the interest rate r.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The balance of these transactions is 0. At time T: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If exercised at time t ≤ T,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• borrow a share and sell it for X to settle the obligation as writer of the call option&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• investing X to buy at option E. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;• Investing E at rate r&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• At time T, use the call to buy a share for E and close your short position in stock. The arbitrage profit will be ($(C^E−P^X) – (C^X-P^E))e^{rT} +(X-E)e^{r(T−t)} –(X –E)&amp;gt;0$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not exercised at all&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• close the short position in stock,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;• End up with the option and an arbitrage profit of $[(C^E−P^X)−(C^X-P^E)] e^{rT} &amp;gt; 0$. &lt;/p&gt;&#xA;" OwnerUserId="19479" LastEditorUserId="19479" LastEditDate="2016-03-13T04:50:35.137" LastActivityDate="2016-03-13T04:50:35.137" Title="Potential Arbitrage profit or proof problem" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;equities&gt;&lt;finance&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24841" PostTypeId="2" ParentId="24839" CreationDate="2016-03-13T01:17:38.763" Score="0" Body="&lt;p&gt;There are two strike prices in this problem $E=100$ and $X=110$. The PCP conditions are $C^E − P^E = S(0) − E^{e^{−rT}}$ and $C^X − P^X = S(0) − X^{e^{−rT}}$. Subtracting the second equation from the first we get $C^E − P^E -C^X + P^X= (X-E)^{e^{−rT}}$. This gets rid of the unknown S(0) term.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's evaluate the right hand side numerically:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C^E − P^E -C^X + P^X = 10 e^{-0.05}= 9.5$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in theory this portfolio of options (long the 100 call and the 110 put, short the 100 put and the 110 call) should be worth 9.5&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the market place though it trades at 45-36-40+42 = 11. So it is overpriced and needs to be sold for an arbitrage profit of 1.5 &lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-03-13T01:58:55.543" LastActivityDate="2016-03-13T01:58:55.543" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24842" PostTypeId="1" CreationDate="2016-03-13T03:36:48.430" Score="1" ViewCount="794" Body="&lt;p&gt;I am a bit confused about the overall CRSP total market return index and the equal weighted index. I know that the value weighted index places a weight on each firm by their respective market values but what is the difference between the equal weighted index and the total market return index ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would greatly appreciate if someone could clarify please.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="18862" LastActivityDate="2017-05-08T17:09:37.523" Title="Difference between CRSP equal weighted and composite index" Tags="&lt;data&gt;&lt;index&gt;&lt;etf&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24843" PostTypeId="1" AcceptedAnswerId="24851" CreationDate="2016-03-13T09:25:00.953" Score="3" ViewCount="467" Body="&lt;p&gt;There are many ways to derive the Black Scholes PDE. The Martingale way would be to demand the option price is driftless according to particular measures. Below I derive the correct PDE using the bank account as the numeraire but fail to get the correct PDE when using the stock as a numeraire. I am hoping someone will be able to point out what I am doing wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Deriving Black Scholes PDE using bank account as numeraire&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the ways to derive the Black-Scholes equation is to take the bank account $B_t$ as a numeraire and then demand that $d\frac{C_t}{B_t}$ be driftless. Below I keep the subscript denoting time implicit. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Concretely, under this numeraire $W_B$ (where $B$ stands for bank account)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;dS=S r dt + S \sigma dW_B \\&#xA;dB=B r dt&#xA;$$&#xA;so we simply get&#xA;$$&#xA;\begin{eqnarray}&#xA;d\frac{C}{B} &amp;amp;=&amp;amp; \frac{\partial_t C dt + \partial_S CdS + \frac{1}{2} \partial_{S,S} CdS^2 }{B}-\frac{CdB}{B^2} \\&#xA;&amp;amp;=&amp;amp; \frac{\partial_t C + r S\partial_S C + \frac{1}{2} \sigma^2 S^2\partial_{S,S} C -rC}{B} dt + \frac{\sigma S \partial_S C}{B} dW_B + \mathcal O({dt}^{3/2})&#xA;\end{eqnarray}&#xA;$$&#xA;and demanding that $\frac{C}{B}$ be a Martingale requires the vanishing of the drift term and we get the Black Scholes PDE:&#xA;$$&#xA;\partial_t C + r S\partial_S C + \frac{1}{2} \sigma^2 S^2\partial_{S,S} C -rC=0&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Trying to derive Black Scholes PDE using stock as numeraire&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I try to do the same while taking the Stock as a numeraire. I will demand, as usual, that $d \frac{C}{S}$ is a Martingale under this measure. Under this measure we have&#xA;$$&#xA;dS = S(r+\sigma^2) dt + S \sigma dW_S&#xA;$$&#xA;so we get&#xA;$$&#xA;\begin{eqnarray}&#xA;d\frac{C}{S} &amp;amp;=&amp;amp; \frac{\partial_t C dt + \partial_S CdS + \frac{1}{2} \partial_{S,S} CdS^2 }{S}-\frac{CdS}{S^2} + \frac{CdS^2}{S^3} \\&#xA;&amp;amp;=&amp;amp; \frac{\partial_t C + (r+\sigma^2) S\partial_S C + \frac{1}{2} \sigma^2 S^2\partial_{S,S} C}{S} dt + \frac{\sigma S\partial_S C dW_S}{S} - \frac{C}{S}\big((r+\sigma^2) dt + \sigma dW_S \big)+\frac{C}{S}\sigma^2 dt +\mathcal O(dt^{3/2}) \\&#xA;&amp;amp;=&amp;amp; \frac{\partial_t C + (r+\sigma^2) S\partial_S C + \frac{1}{2} \sigma^2 S^2\partial_{S,S} C -rC}{S} dt + \frac{\sigma S \partial_S C-C}{S} dW_S +\mathcal O({dt}^{3/2})&#xA;\end{eqnarray}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NOW demanding the drift term to be zero gives me an extra term&#xA;$$&#xA;\partial_t C + (r+\color{red}{\sigma^2}) S\partial_S C + \frac{1}{2} \sigma^2 S^2\partial_{S,S} C -rC=0&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="19878" LastEditorUserId="19878" LastEditDate="2016-03-14T07:51:21.743" LastActivityDate="2016-03-16T10:26:52.073" Title="Deriving Black Scholes PDE under stock as a numeraire" Tags="&lt;black-scholes-pde&gt;&lt;numerairechange&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24844" PostTypeId="2" ParentId="24838" CreationDate="2016-03-13T10:13:22.900" Score="1" Body="&lt;p&gt;I assume that you can do a correct performance calculation for bonds (taking into account coupons, clean and dirty prices).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then for each month you can do the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;extract all live (non matured, already issued) bonds from the dataset together with their performance: past performance for momentum, future performance for evaluation of the method.&lt;/li&gt;&#xA;&lt;li&gt;Calculate their momentum as you have defined it, rank the bonds, define the 10 portfolios&lt;/li&gt;&#xA;&lt;li&gt;Calculate the performance of each of the portfolios for the evaluation period &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;And you do the steps 1 to 3 for each rebalancing month. These are quite clear steps but of course you have to do the book-keeping of performance, ranking/portfolio membership and performance which is cumbersome.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2016-03-14T11:45:36.047" LastActivityDate="2016-03-14T11:45:36.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24845" PostTypeId="2" ParentId="24842" CreationDate="2016-03-13T15:17:51.960" Score="2" Body="&lt;p&gt;I believe the CRSP US Total Market Index is a relatively recent (2011?) index that is value weighted (ie weighted by market capitalization) and has been especially designed for holding by index funds (and there are several index funds that track it): &lt;a href=&quot;http://www.crsp.com/products/investment-products/crsp-us-total-market-index&quot; rel=&quot;nofollow&quot;&gt;http://www.crsp.com/products/investment-products/crsp-us-total-market-index&lt;/a&gt;. The older CRSP VW (value weighted index) is simply the value weighted average of all stocks on the CRSP tape and goes back to 1928. So one is a &quot;live&quot; investable index, the other is a historical statistic. The CRSP EW is another, historical statistic, this time equal weighted.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-03-14T08:46:27.983" LastActivityDate="2016-03-14T08:46:27.983" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24846" PostTypeId="1" CreationDate="2016-03-13T15:35:49.777" Score="2" ViewCount="429" Body="&lt;p&gt;Expected Shortfall is not elicitable as some papers have pointed out. That simply means that there is no scoring function that elicits ES.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, does this imply that Expected Shortfall point forecasts are impossible to backtest? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still, there are backtests available for ES. Second question, how is the ES forecast backtested, that is how is the value of ES used in any backtest. To what is the ES forecast compared to in a backtest.&lt;/p&gt;&#xA;" OwnerUserId="19857" LastEditorUserId="19857" LastEditDate="2016-03-13T22:39:40.320" LastActivityDate="2016-09-10T17:44:50.247" Title="ES not elicitable" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;backtesting&gt;&lt;performance-evaluation&gt;&lt;validation&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24847" PostTypeId="1" CreationDate="2016-03-13T16:32:10.360" Score="2" ViewCount="1068" Body="&lt;p&gt;my code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;from ib.ext.Contract import Contract&#xA;from ib.ext.Order import Order&#xA;from ib.opt import Connection, message&#xA;&#xA;&#xA;def error_handler(msg):&#xA;&#xA;   print &quot;Server Error: %s&quot; % msg&#xA;&#xA;def reply_handler(msg):&#xA;&#xA;   print &quot;Server Response: %s, %s&quot; % (msg.typeName, msg)&#xA;&#xA;&#xA;&#xA;if __name__ == &quot;__main__&quot;:&#xA; tws_conn = Connection.create(port=7496, clientId=100)&#xA; tws_conn.connect()&#xA; tws_conn.register(error_handler, 'Error')&#xA; tws_conn.registerAll(reply_handler)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and the TWS log file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GO 00:27:20:952 JTS-EServerSocket-231: [0:62:76:1:0:0:0:SYS] Starting new conversation with client on /127.0.0.1&#xA;GO 00:27:20:952 JTS-EServerSocketNotifier-232: Starting async queue thread&#xA;GO 00:27:20:952 JTS-EServerSocket-231: [0:62:76:1:0:0:0:SYS] Server version is 76&#xA;GO 00:27:20:953 JTS-EServerSocket-231: [0:62:76:1:0:0:0:SYS] Client version is 62&#xA;GO 00:27:20:953 JTS-EServerSocket-231: [0:62:76:1:0:0:0:SYS] is 3rdParty false&#xA;GO 00:27:20:954 JTS-EServerSocket-231: [100:62:76:1:0:0:0:SYS] Client ID is 100&#xA;GO 00:27:20:958 JTS-EServerSocket-231: [100:62:76:1:0:0:0:ERR] Socket connection for client{100} has closed. &#xA;GO 00:27:20:958 JTS-EServerSocket-231: Connection reset&#xA;GO 00:27:20:959 JTS-EServerSocket-231: ArEServer: Removing 174597970 with id 100&#xA;GO 00:27:20:959 JTS-EServerSocket-231: [100:62:76:1:0:0:0:SYS] Ending conversation with client{100} at /127.0.0.1&#xA;GO 00:27:20:959 JTS-EServerSocketNotifier-232: Terminating async queue thread&#xA;GO 00:27:20:959 JTS-EWriter2-233: [100:62:76:1:0:0:0:SYS] Writer thread terminated for socket client{100}.&#xA;GO 00:27:21:952 JTS-DeadlockMonitor-26: CPU:cur=0.00% avg=0.67% 30 min avg=0.67% 5 min avg=0.22% 1 min avg=1.02%&#xA;GC:called=20 times CPU used=0.09%&#xA;Finalizer:cur=0.00% avg=0.01% 30 min avg=0.01% 5 min avg=0.00% 1 min avg=0.00%&#xA;Threads Count:curr live=88 curr daemon=52&#xA;GO 00:27:47:000 JTS-CCPDispatcherS2-40: Setting time offset to -1282 diff 5579&#xA;GO 00:27:47:000 JTS-CCPDispatcherS2-40: Setting time offset to -1282 diff 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="19883" LastEditorUserId="848" LastEditDate="2016-03-13T18:50:07.563" LastActivityDate="2016-04-20T10:57:04.300" Title="Why does my ibpy connection always close automatically" Tags="&lt;python&gt;&lt;interactive-brokers&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24848" PostTypeId="1" CreationDate="2016-03-13T17:41:43.167" Score="0" ViewCount="92" Body="&lt;p&gt;I've got myself some data on SPX optons which looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;date,exdate,cp_flag,strike_price,best_bid,best_offer,opp_volume,impl_volatility,delta&#xA;04-01-1996,16-03-1996,C,635000,5.25,5.75,250,0.100572,0.318471&#xA;04-01-1996,16-03-1996,C,400000,216.5,217.5,0,,&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I guess, &lt;code&gt;opp_volume&lt;/code&gt; stands for open interest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question regards the rows where &lt;code&gt;opp_volume&lt;/code&gt; is 0. Those rows don't have delta and IV calculated for them. Well, that's reasonable: no trade - no delta and IV.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what do best bid/ask prices stand for?&lt;/p&gt;&#xA;" OwnerUserId="17976" LastEditorUserId="467" LastEditDate="2016-03-14T01:51:52.040" LastActivityDate="2016-03-14T22:16:10.430" Title="What does this options' data mean?" Tags="&lt;options&gt;&lt;data&gt;&lt;spx&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24849" PostTypeId="2" ParentId="24846" CreationDate="2016-03-13T18:09:01.520" Score="0" Body="&lt;p&gt;This is formally correct. However, I am not sure if practically it really makes any difference as Tasche points out:&#xA;&lt;a href=&quot;https://workspace.imperial.ac.uk/mathfin/Public/Seminars%202013-2014/Tasche_November2013_Slides.pdf&quot; rel=&quot;nofollow&quot;&gt;https://workspace.imperial.ac.uk/mathfin/Public/Seminars%202013-2014/Tasche_November2013_Slides.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: ES can be expressed as a weighted average of percentiles, which are backtestable as Bernoulli. Therefore backtest a handful of quantiles and you effectively backtest ES (Tasche says four, I believe FRTB says two). The point is that you don't backtest the ES number directly, but quantiles of the tail that generated your ES number. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Standard Deviation is not elicitable neither, but if you give me a sample I can tell you if the StdDev you gave me is good enough.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2016-03-14T00:38:59.487" LastActivityDate="2016-03-14T00:38:59.487" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24850" PostTypeId="2" ParentId="24821" CreationDate="2016-03-13T21:00:14.090" Score="1" Body="&lt;p&gt;Your Log Likelihood function &lt;code&gt;LogLik&lt;/code&gt; doesn't work: 1) &lt;code&gt;LL&lt;/code&gt; is reset every iteration and 2) the function doesn't return anything, you can try yourself:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; LogLik(c(0.0000029,0.095,0.0888))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is the reason for the error given by &lt;code&gt;constrOptim&lt;/code&gt;, it seems that the function doesn't give a value for the initial vector (or for any value).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I find your code a bit hard to follow and I'm not sure what you're trying to implement so it's hard to give further advice. &lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="848" LastEditDate="2017-09-05T12:37:44.920" LastActivityDate="2017-09-05T12:37:44.920" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24851" PostTypeId="2" ParentId="24843" CreationDate="2016-03-13T21:02:41.607" Score="5" Body="&lt;p&gt;You miss the cross-derivative term in the Ito formula you use to express $d\left ( \frac {C_t}{S_t} \right)$. More specifically (see &lt;strong&gt;[Remark]&lt;/strong&gt; below),&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d\left ( \frac {C_t}{S_t} \right) = \frac {1}{S_t} dC_t - \frac {C_t}{S_t^2} dS_t + \frac {C_t}{S_t^3} d\langle S_t, S_t \rangle&#xA;{\color{green}{- \frac {1}{S_t^2} d\langle C_t, S_t \rangle}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This last term evaluates to&#xA;$$-\partial_S C_t \sigma^2 dt $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Meaning that one can write:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d\left( \frac{C_t}{S_t} \right) = \frac {1}{S_t} (\partial_t C_t dt + \partial_S C_t dS_t + \frac {1}{2} \partial_{SS} C_t \sigma^2 S_t^2 dt) - \frac {1}{S_t} \left( (r+\sigma^2) C_t dt + \sigma C_t dW_t \right) + \frac {1}{S_t} \sigma^2 C_t dt - \frac {1}{S_t} \partial_S C_t \sigma^2 S_t dt$$&#xA;or equivalently after re-arranging some terms&#xA;$$d\left( \frac{C_t}{S_t} \right) = \frac {1}{S_t} (\partial_t C_t + r S_t \partial_S C_t + \frac {1}{2} \partial_{SS} C_t \sigma^2 S_t^2 - rC_t ) dt + (.) dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence the Black-Scholes pde from the martingale representation theorem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Remark]&lt;/strong&gt; This result simply comes from applying the bidimensional version of Ito's lemma&#xA;$$df = (\partial_t f) dt + (\partial_X f) dX_t + \frac {1}{2} (\partial_{XX} f) d\langle X_t \rangle + (\partial_Y f) dY_t + \frac {1}{2} (\partial_{YY} f) d\langle Y_t \rangle + (\partial_{XY} f) d\langle X_t, Y_t \rangle$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To the function  $f (t, X_t,Y_t) = \frac {X_t}{Y_t} $&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-03-16T10:26:52.073" LastActivityDate="2016-03-16T10:26:52.073" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24853" PostTypeId="1" CreationDate="2016-03-13T23:19:26.343" Score="1" ViewCount="91" Body="&lt;p&gt;So, from a conceptual level, arbitrage seems quite forward... buy at one place at one price, and sell somewhere at a higher price. However, after doing some initial digging it appears to be not quite as straightforward as initially appears.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently, I can't seem to get my head wrapped around how to handle tickers just quoting a price, without quoting a volume. Example below:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Assume equal bid/ask price, for simplicity sake.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Asset A, exchange 1 ticker: $100.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Asset A, exchange 2 ticker: $101.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Each exchange has a $10 transaction fee.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So, in the above example, at least 20 units of Asset A need to be purchased from exchange 1 and sold at exchange 2 to cover the cost of the transaction fees and take advantage of the arbitrage opportunity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From my understanding, the volume availability isn't known until a limit/market order is placed on both exchanges, and even if it can be listed at ticker price time it doesn't seem like it would be safe to assume that all conditions will remain the same from the time that the ticker is examined to the time that an order is fulfilled. So in practice, how is this situation handled?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just place a limit/market order and hope that there is sufficient volume? If there isn't sufficient volume, do the losses just get eaten?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For additional context, I am mainly interested in the trading of cryptocurrency.&lt;/p&gt;&#xA;" OwnerUserId="19889" LastEditorUserId="19889" LastEditDate="2016-03-14T01:44:35.213" LastActivityDate="2016-03-14T01:44:35.213" Title="How do most arbitrage opportunities account for unknown volume at a ticker price?" Tags="&lt;arbitrage&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24855" PostTypeId="2" ParentId="24848" CreationDate="2016-03-14T01:55:59.027" Score="2" Body="&lt;p&gt;Best bid is the highest price somebody is willing to pay to buy the option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best off is the lowest price somebody is willing to accept to sell the option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even if there is no trade, there may very well be limit orders in the order book: there is a potential market but offer and demand are still too far away from each other for trades to happen.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2016-03-14T01:55:59.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24856" PostTypeId="2" ParentId="24766" CreationDate="2016-03-14T03:50:17.950" Score="3" Body="&lt;p&gt;This really isn't worth the bounty, but it's too long for a comment. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quoting &#xA;&lt;a href=&quot;https://www.tradeking.com/education/options/option-greeks-explained#theta&quot; rel=&quot;nofollow&quot;&gt;https://www.tradeking.com/education/options/option-greeks-explained#theta&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt; &#xA;At-the-money options move at the square root of time. This means if a &#xA;one-month ATM option is trading for \$1, then a two-month ATM option &#xA;would be trading for 1 x sqrt of 2 or \$1.41. A three-month ATM option &#xA;would be trading for 1 x sqrt of 3 or \$1.73. &#xA;&lt;/blockquote&gt; &#xA;&#xA;&lt;p&gt;As you can see from this example, selling 3 1 month options over 3 &#xA;months would be worth \$3, whereas a single 3 month option would be &#xA;worth only \$1.73. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Formula-wise, this means the price of an at money option expiring in &#xA;$t$ days is $k \sqrt{t}$ (for some value of $k$ that depends on the &#xA;volatility). So, the money you make per day is $\frac{k \sqrt{t}}{t}$ &#xA;or $\frac{k}{\sqrt{t}}$. As t becomes smaller, this number becomes &#xA;larger. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, to maximize your per-day income, sell options as frequently as possible. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, this assumes the underlying's price doesn't change. As I &#xA;noted in the comments, per the rule of arbitrage, there is no &#xA;guaranteed way to make money: this method only works on the assumption &#xA;the underlying's price is relatively stable (ie, more stable than the &#xA;volatility would indicate). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another source re theta decay as a square root: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.optionseducation.org/strategies_advanced_concepts/advanced_concepts/understanding_option_greeks/theta.html&quot; rel=&quot;nofollow&quot;&gt;http://www.optionseducation.org/strategies_advanced_concepts/advanced_concepts/understanding_option_greeks/theta.html&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(you can also derive this directly from the Black-Scholes formula or from first principles [the sum of two normal distributions with standard deviation $s$ is a normal distribution with standard deviation $s\sqrt{2}$, not $2s$])&lt;/p&gt;&#xA;" OwnerDisplayName="user59" LastActivityDate="2016-03-14T03:50:17.950" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24858" PostTypeId="1" CreationDate="2016-03-14T08:42:52.137" Score="3" ViewCount="301" Body="&lt;p&gt;Consider the payoff equation for the lookback option $\psi(T)= max(S_t-S_T)$, where $t\in[0,T]$ and  $S_t$ is modeled by the geometric Brownian motion with constant parameters. Find the price of stock at current time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've done some research and this option seems similar to the floating strike option. But I don't know how to approach this problem yet. Any help would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="19871" LastEditorUserId="19871" LastEditDate="2016-03-15T03:56:57.973" LastActivityDate="2016-03-16T10:39:49.643" Title="Lookback option to find stock price" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24859" PostTypeId="1" CreationDate="2016-03-14T11:26:04.677" Score="1" ViewCount="39" Body="&lt;p&gt;Can someone help me with a code how to bootstrap p values in R using Boot or boot package? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;regCSS30 &amp;lt;- dyn$lm(lag(eval(parse(text=&quot;HV&quot;)),-30) ~ lag((eval(parse(text=&quot;CSS30&quot;))),0), data=window(ts_CM30, 1975, 2015))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My regression is of the following type, how can I bootstrap p-values?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much.&lt;/p&gt;&#xA;" OwnerUserId="19894" LastActivityDate="2016-03-14T11:26:04.677" Title="Bootstrapping p values in linear regression in R" Tags="&lt;bootstrap&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24860" PostTypeId="1" CreationDate="2016-03-14T14:26:50.167" Score="1" ViewCount="85" Body="&lt;p&gt;I have a conceptual question that needs help. Does anyone know whether the short rate model generate discount rate or forward rate?&lt;/p&gt;&#xA;" OwnerUserId="18503" LastActivityDate="2016-03-14T14:55:26.973" Title="Concept Question Regarding Short Rate Model" Tags="&lt;short-rate&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24861" PostTypeId="2" ParentId="24860" CreationDate="2016-03-14T14:55:26.973" Score="2" Body="&lt;p&gt;Which is the paper/book you are reading? It should be noted there. But basically&#xA;in a short-rate model you have&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;a model for the short rate $r_t$&lt;/li&gt;&#xA;&lt;li&gt;you can calculate zero-coupon bond prices from it by $P_T = E[\exp(-\int_{0}^T r_u du)]$&lt;/li&gt;&#xA;&lt;li&gt;from these prices you can calculate the yield-to-maturity $Y_T$&#xA;which fulfills&#xA;$$&#xA;P_T =\exp( - Y_T T)&#xA;$$&#xA;thus $Y_T = - \log(P_T)/T$.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;From the yield-to-maturity of a zero bond you get the spot term structure and then by the usual calculations forward rates.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-03-14T14:55:26.973" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24862" PostTypeId="1" CreationDate="2016-03-14T17:17:08.763" Score="1" ViewCount="51" Body="&lt;p&gt;I've been tracing back through bond.cpp and find the following in FloatingBond() :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;double dayCounter = Rcpp::as&amp;lt;double&amp;gt;(datemisc[&quot;dayCounter&quot;]);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;$\mathrm{datemisc[]}$ is passed (traced back to) from FloatingBond.default in bond.R as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dateparams=list(....&#xA;                dayCounter='Thirty360',&#xA;                ....)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is a string, so I would assume that it would be a pointer to a string in c++. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking downstream to $\mathrm{dayCounter()}$ in util.cpp I see&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;QuantLib::DayCounter getDayCounter(const double n){&#xA;    if (n==0)&#xA;        return QuantLib::Actual360();&#xA;    else if (n==1)&#xA;        return QuantLib::Actual365Fixed();&#xA;    .......&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So downstream agrees with the type passed but the upstream in bond.R seems incorrect. I do not see where the text string is translated into a double. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="19817" LastEditorUserId="8097" LastEditDate="2016-03-14T18:03:23.900" LastActivityDate="2016-05-14T08:01:36.410" Title="type mismatch in Rquantlib Bond.cpp" Tags="&lt;r&gt;&lt;rquantlib&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24863" PostTypeId="1" CreationDate="2016-03-14T17:26:31.090" Score="3" ViewCount="2119" Body="&lt;p&gt;I am struggling with the calculation of the Sharpe ratio. I am wondering whether to calculate the daily excess returns with today's risk free rate of return or the risk free rates corresponding to the date of the return observations?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g., I have the annualized fund returns &lt;code&gt;r_fund&lt;/code&gt; and the risk free rate of return, which is the daily 3-months US treasury bill rates &lt;code&gt;r_f&lt;/code&gt;. Today's risk free rate of return is 0.27% p.a.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;date           r_fund      r_f      excess(r_fund-r_f)&#xA;2016-01-05     0.200       0.25     -0.050&#xA;2016-01-07     0.800       0.26      0.540&#xA;2016-01-08     0.900       0.24      0.660&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thus, should I calculate the excess return as shown in the table above or just subtract today's &lt;code&gt;r_f&lt;/code&gt; (0.27%) from each &lt;code&gt;r_fund&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="13812" LastActivityDate="2016-03-15T16:23:56.587" Title="Calculate excess returns for Sharpe Ratio with today's or past risk free rate of return?" Tags="&lt;sharpe-ratio&gt;&lt;risk-free&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24865" PostTypeId="2" ParentId="24858" CreationDate="2016-03-14T17:54:21.080" Score="3" Body="&lt;p&gt;Below I assume that you meant: $\psi (T) = \max (S_t - S_T, 0) $ which constitutes the payout of a &lt;strong&gt;forward start&lt;/strong&gt; rather than a &lt;strong&gt;lookback&lt;/strong&gt; option. If not please clarify your question...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are looking for the option price $V_0$, assuming a Black-Scholes diffusion (GBM + constant interest rates), you have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;V_0 &amp;amp;= P(0,T) E[ \psi (T) \vert \mathcal {F}_0] \\&#xA;&amp;amp; = P (0,T) E \left[ (S_t - S_T)^+ \vert \mathcal {F}_0 \right] \\&#xA;&amp;amp; = P (0,T) E \left[ E [ (S_t - S_T)^+ \vert \mathcal {F}_t ] \vert \mathcal {F}_0 \right] \\&#xA;&amp;amp; = P (0,t) E \left[ P (t,T) E [ (S_t - S_T)^+ \vert \mathcal {F}_t ] \vert \mathcal {F}_0 \right] \\&#xA;&amp;amp;= P (0,t) E \left[  P_{BS}(S_t; S_t, T-t) \vert \mathcal {F}_0 \right] \\&#xA;&amp;amp;= P (0,t) E [  S_t P_{BS}(1; 1, T-t) \vert \mathcal {F}_0 ] \\&#xA;&amp;amp;= P (0,t) F (0,t) P_{BS}(1; 1, T-t)&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $P(s,t) = e^{-r(t-s)}$ denotes a generic discount factor and each the successive equalities come from:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Option premium as a risk-neutral expectation&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Definition of the option's payout&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Tower property of conditional expectation&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Composition of discount factors&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Price of a put option which, under the modelling assumptions, is given by the BS formula (first argument denotes stock price, second strike level and last time to maturity)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Space homogeneity of BS formula&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Forward price as a risk-neutral expectation ($P_{BS} (1;1,T-t)$ is deterministic)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Note that because the forward price $F (0,t) $ is directly proportional to the spot price $S_0$ you can obviously infer the spot value if you know the option premium $V_0$. Actually assuming no dividends: $V_0 = S_0 &#xA;P_{BS}(1; 1, T-t) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I don't see the point of doing that, except for some pure academic fun.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-03-16T10:39:49.643" LastActivityDate="2016-03-16T10:39:49.643" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24866" PostTypeId="2" ParentId="24862" CreationDate="2016-03-14T18:56:51.043" Score="0" Body="&lt;p&gt;The conversion is performed by matchParams() which is in the bond.R source prior to calling the c++ code. It's confusing as the name is reused in the call (e.g. dateparams&amp;lt;-matchParams(dateparams) ) so when looking at the code above you see the character strings. Would be better if the result was assigned to something more meaningful like &quot;mappedparams&quot;.&lt;/p&gt;&#xA;" OwnerUserId="19817" LastEditorUserId="19817" LastEditDate="2016-03-14T19:09:35.870" LastActivityDate="2016-03-14T19:09:35.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24867" PostTypeId="2" ParentId="24753" CreationDate="2016-03-14T19:04:40.023" Score="7" Body="&lt;p&gt;In a &lt;em&gt;pure diffusion&lt;/em&gt; setting, you can equivalently write no calendar arbitrage constraints:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;In terms of &lt;em&gt;implied volatility&lt;/em&gt;: total implied variance should be non decreasing in time, and that, &lt;em&gt;for any given forward moneyness level&lt;/em&gt;, see &lt;a href=&quot;https://www.google.be/url?sa=t&amp;amp;source=web&amp;amp;rct=j&amp;amp;url=http://arxiv.org/pdf/1204.0646&amp;amp;ved=0ahUKEwiS0ImU7sDLAhXL1xoKHce2Az8QFggaMAA&amp;amp;usg=AFQjCNHfk0i_J9jZI7Mj_5aaQoaHHcQvvA&amp;amp;sig2=6aI0AmRxtCam0-8_V81sxg&quot; rel=&quot;noreferrer&quot;&gt;Gatheral&lt;/a&gt; top of page 4.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In terms of &lt;em&gt;European option prices&lt;/em&gt;: see &lt;a href=&quot;https://www.google.be/url?sa=t&amp;amp;source=web&amp;amp;rct=j&amp;amp;url=http://arxiv.org/pdf/1204.0646&amp;amp;ved=0ahUKEwiS0ImU7sDLAhXL1xoKHce2Az8QFggaMAA&amp;amp;usg=AFQjCNHfk0i_J9jZI7Mj_5aaQoaHHcQvvA&amp;amp;sig2=6aI0AmRxtCam0-8_V81sxg&quot; rel=&quot;noreferrer&quot;&gt;Gatheral&lt;/a&gt; end of page 3.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The price-based constraint builds on the following lemma&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;[Lemma]&lt;/strong&gt; &lt;em&gt;If $X_t$ is a martingale, $L &amp;lt; \infty$ a real constant and $0 &amp;lt; t_1 &amp;lt; t_2$ two future times, then &#xA;  $$E[(X_{t_2}-L)^+] \geq E [(X_{t_1}-L)^+] $$&lt;/em&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;[Proof]&lt;/strong&gt; &#xA;  \begin{align}&#xA;E[(X_{t_2}-L)^+ \vert \mathcal {F}_0 ] &amp;amp;= E[\ E [(X_{t_2}-L)^+ \ \vert \mathcal {F}_1 \ ]\  \vert \mathcal {F}_0 ] \\&#xA;&amp;amp;\geq E[\ \left( E[X_{t_2}-L \ \vert \mathcal {F}_1 \ ] \right)^+ \ \vert \mathcal {F}_0 ] \\&#xA;&amp;amp;\geq E[ (X_{t_1}-L)^+ \ \vert \mathcal {F}_0 ]&#xA;\end{align} &#xA;  where we have used, in respective order:&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;Tower property of conditional expectation&lt;/li&gt;&#xA;  &lt;li&gt;Jensen's inequality ($f : x \rightarrow x^+$ is a convex function)&lt;/li&gt;&#xA;  &lt;li&gt;The fact that $X_t$ is a martingale &lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In a more general setting, one can still &lt;strong&gt;use this lemma to derive price-based constraints&lt;/strong&gt;. The only question is: what martingale $X_t$ should we consider?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Proportional dividends]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a pure diffusion setting, it made sense to use $X_t = S_t/F (0,t) $, because $dS_t/S_t = \mu_t dt + \sigma_t dW_t \Rightarrow S_t = F(0,t)X_t$, where $X_t=\mathcal{E}(\int_0^t \sigma_s dW_s)$ is indeed a martingale (Doléans-Dade exponential). Applying the lemma then gives:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;&amp;amp; E[(X_{t_2}-L)^+] \geq E [(X_{t_1}-L)^+] \\&#xA;\iff &amp;amp; E\left[\left(\frac{S_{t_2}}{F(0,t_2)}-L\right)^+\right] \geq E \left[\left(\frac{S_{t_1}}{F(0,t_1)}-L\right)^+\right] \\&#xA;\iff &amp;amp; \frac{1}{F(0,t_2)} E[(S_{t_2}-LF(0,t_2))^+] \geq \frac{1}{F(0,t_1)} E[(S_{t_1}-LF(0,t_1))^+] \\&#xA;\iff &amp;amp; \frac{\tilde{C}(K_2,t_2)}{F(0,t_2)} \geq \frac{\tilde{C}(K_1,t_1)}{F(0,t_1)} &#xA;\end{align*}&#xA;where $\tilde{C}(K,T)$ denotes an &lt;em&gt;undiscounted&lt;/em&gt; call price and $K_1=LF(0,t_1)$, $K_2=LF(0,t_2)$. This is precisely Gatheral's result:&#xA;$$ \frac{C_2}{K_2} \geq \frac{C_1}{K_1} $$&#xA;(in his paper, he always uses &lt;em&gt;undiscounted&lt;/em&gt; call prices and he chose $L=e^k$), since&#xA;$$ \frac{K_2}{K_1} = \frac{F(0,t_2)}{F(0,t_1)} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Cash &amp;amp; Proportional dividends]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a more elaborate setting, it will depend on how you model dividends. &lt;a href=&quot;http://ssrn.com/abstract=1141877&quot; rel=&quot;noreferrer&quot;&gt;Buehler&lt;/a&gt; for instance suggests a no-arbitrage pricing framework which can accommodate cash dividends, proportional dividends, and/or any mix of the two. In his model, it makes sense to use the martingale $X_t = (S_t-D_t)/(F (0,t) - D_t) $ where $D_t $ is related to the future dividend stream (all divs are assumed to be known in advance). Applying the lemma gives:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;&amp;amp; E[(X_{t_2}-L)^+] \geq E [(X_{t_1}-L)^+] \\&#xA;\iff &amp;amp; E\left[\left(\frac{S_{t_2}-D_{t_2}}{F(0,t_2)-D_{t_2}}-L\right)^+\right] \geq E \left[\left(\frac{S_{t_1}-D_{t_1}}{F(0,t_1)-D_{t_1}}-L\right)^+\right] \\&#xA;\iff &amp;amp; \frac{E[(S_{t_2}-(D_{t_2}+L(F(0,t_2)-D_{t_2})))^+] }{F(0,t_2)-D_{t_2}} \geq \frac{E[(S_{t_1}-(D_{t_1}+L(F(0,t_1)-D_{t_1})))^+]}{F(0,t_1)-D_{t_1}} \\&#xA;\iff &amp;amp; \frac{\tilde{C}(K_2,t_2)}{F(0,t_2)-D_{t_2}} \geq \frac{\tilde{C}(K_1,t_1)}{F(0,t_1)-D_{t_1}}&#xA;\end{align*}&#xA;where $\tilde{C}(K,T)$ denotes an &lt;em&gt;undiscounted&lt;/em&gt; call price and $K_1=D_{t_1}+L(F(0,t_1)-D_{t_1}))$, $K_2=D_{t_2}+L(F(0,t_2)-D_{t_2}))$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Observe that when $(D_t)_{t\geq0} = 0$, we fall-back on Gatheral's result. In &lt;a href=&quot;http://ssrn.com/abstract=1141877&quot; rel=&quot;noreferrer&quot;&gt;Buehler&lt;/a&gt;, $(D_t)_{t\geq0} = 0$ iff there are &lt;em&gt;no cash dividends&lt;/em&gt; (meaning there could be either proportional dividends or no dividends at all). This is completely consistent with what we have said in the pure diffusion case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Arbitrage opportunity]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, note that the above inequalities describe the calendar arbitrage opportunities. In the second situation for instance, a PF where you are long $\tilde{C}(K=K_2,T=t_2)$ and short $(F(0,t_2)-D_{t_2})/(F(0,t_1)-D_{t_1}) $ units of $\tilde{C}(K=K_1,T=t_1)$ should always have a positive value (we just showed that). If not, it is an arbitrage opportunity.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-05-13T09:18:11.823" LastActivityDate="2016-05-13T09:18:11.823" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="24868" PostTypeId="1" CreationDate="2016-03-14T20:02:27.463" Score="2" ViewCount="137" Body="&lt;p&gt;I need the following data and struggles to find it, maybe some of you can help me. Note: I'm a student and in our university ain't Bloomberg nor Reuters. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Investment home bias, e.g in 2012 US investors invested about 76% of their equity investment capital in the US market (This is real data). I need this figure for let's say all years between 1990-2015.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.msci.com/resources/factsheets/index_fact_sheet/msci-world-index.pdf&quot; rel=&quot;nofollow&quot;&gt;Here I can find&lt;/a&gt; for the latest year (They have only the latest PDF - 2015) US country weight out of the world equity market (Second page, 59.33%). This is true because MSCI World index is considered to be the benchmark for this. How can I find this data for all years between 1990-2015?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The purpose: First number minus the second (for same year, for same country) is the real Investment home bias (for same year, for same country). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;" OwnerUserId="18094" LastActivityDate="2016-04-11T02:54:13.243" Title="Where to find Investment home bias data &amp; Historical country weight in World MSCI" Tags="&lt;data&gt;&lt;market-data&gt;&lt;historical-data&gt;&lt;database&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24871" PostTypeId="2" ParentId="24848" CreationDate="2016-03-14T22:16:10.430" Score="2" Body="&lt;p&gt;opp_volume is probably option volume (not sure why it would be shortened to opp with extra p), not open interest. Volume is also more likely to be zero than open interest. The rest is like @SRKX wrote.&lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2016-03-14T22:16:10.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24872" PostTypeId="2" ParentId="24835" CreationDate="2016-03-14T23:25:12.240" Score="2" Body="&lt;p&gt;The best way is to interpolate in volatility space. The reason is because it is closer to the intrinsic pricing of the option, and it is less likely to produce an arbitrage. Like Alex C noted in the comment - prices are nonlinear function of inputs, and interpolating in them does not make sense. Inputs are &quot;free&quot;, and interpolated value of inputs will likely be somewhere in the smoothed area. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Really simple example - consider 3 european options with consecutive equidistant strikes, with the same black-scholes IV. If you don't know the middle option's price, you should interpolate vols, and then price the middle option. If you were to interpolate prices, then your middle option will be the average of the other two, and will create a free butterfly, which will be an arbitrage.&lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2016-03-14T23:25:12.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24873" PostTypeId="1" AcceptedAnswerId="30093" CreationDate="2016-03-15T06:45:02.537" Score="4" ViewCount="608" Body="&lt;p&gt;I am now reading Alternative Characterization of American Put Options by Carr et all (available at &lt;a href=&quot;http://www.math.nyu.edu/research/carrp/papers/pdf/amerput7.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.math.nyu.edu/research/carrp/papers/pdf/amerput7.pdf&lt;/a&gt;). There is a theorem called 'Main Decomposition of the American Put'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Theorem 1 (Main Decomposition of the American Put)&lt;/strong&gt; On the continuation region $\mathcal{C}$, the American put value, $P_0$, can be decomposed into the corresponding European put price, $p_0$, and the early exercise premium, $e_0$:&#xA;$$P_0=p_0+e_0$$&#xA;where&#xA;$$e_0=rK \int_{0}^{T} \exp{(-rt)} N\bigg( \frac{\ln{(B_t / S_0)}-e_2 t}{\sigma \sqrt{t}} \bigg)dt,$$&#xA;$$e_2=r-\frac{\sigma^2}{2}, \,$$&#xA;and&#xA;$$N(x)=\int_{0}^{x} \frac{\exp{(-z^2/2)}}{\sqrt{2\pi}}dz$$&#xA;is the standard normal distribution function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The proof in the appendix starts with:&#xA;We wish to prove that:&#xA;$$P_0=p_0+rK \int_{0}^{T} \exp{(-rt)} N\bigg( \frac{\ln{(B_t / S_0)}-e_2 t}{\sigma \sqrt{t}} \bigg)dt.$$&#xA;Let $Z_t \equiv \exp{(−rt)}P_t$ be the discounted put price, defined in the region $D \equiv \{(S, t) : S ∈ [0, \infty), t ∈ [0, T]\}$.&#xA;In this region, the pricing function $P(S, t)$ is convex in $S$ for all $t$, continuously differentiable in $t$ for&#xA;all $S$, and a.e. twice continuously differentiable in $S$ for all $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is regarding the statement:&#xA;&quot;the pricing function $P(S, t)$ is convex in $S$ for all $t$&quot;. Is it assumed or can we prove it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I read the definition of convex function from &lt;a href=&quot;http://mathworld.wolfram.com/ConvexFunction.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://mathworld.wolfram.com/ConvexFunction.html&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A convex function is a continuous function whose value at the midpoint of every interval in its domain does not exceed the arithmetic mean of its values at the ends of the interval.&#xA;More generally, a function $f(x)$ is convex on an interval $[a,b]$ if for any two points $x_1$ and $x_2$ in $[a,b]$ and any $\lambda$ where $0&amp;lt; \lambda &amp;lt;1$,&#xA;$$f[\lambda x_1 + (1- \lambda x_2)] \leq \lambda f(x_1)+ (1- \lambda) f(x_2)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also have read a question in &lt;a href=&quot;https://math.stackexchange.com/questions/112063/price-of-a-european-call-option-is-a-convex-function-of-strike-price-k&quot;&gt;https://math.stackexchange.com/questions/112063/price-of-a-european-call-option-is-a-convex-function-of-strike-price-k&lt;/a&gt; but I am not sure if it can be applied to my question because &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1). I assume the $P(S,t)$ in my question to be the American put value instead of European one, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2). the question in the link is about convex function of strike price while my question is about convex function in $S$ in all $t$ (or are they the same?), and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(3). the convex function definition I got seems different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone help me to explain why $P(S, t)$ is convex in $S$ for all $t$? Thank you.&lt;/p&gt;&#xA;" OwnerUserId="19902" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2020-06-22T18:02:49.617" Title="Pricing function $P(S,t)$ is convex in $S$ for all $t$" Tags="&lt;option-pricing&gt;&lt;american-options&gt;&lt;convexity&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24874" PostTypeId="1" AcceptedAnswerId="24878" CreationDate="2016-03-15T10:11:17.987" Score="1" ViewCount="91" Body="&lt;p&gt;I'm looking for a security that has some stock dividends. Any suggestion?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are plenty of websites explaining what is a stock dividend or plenty referencing companies with cash dividends but all I find are cash dividends securities.&lt;/p&gt;&#xA;" OwnerUserId="19830" LastActivityDate="2016-03-15T14:44:12.320" Title="Example Security Giving Stock Dividends?" Tags="&lt;data&gt;&lt;dividends&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24875" PostTypeId="1" AcceptedAnswerId="25000" CreationDate="2016-03-15T10:27:18.377" Score="5" ViewCount="452" Body="&lt;p&gt;I have been playing with QuantLib for some time. This is a great framework with amazing design and capabilities. However, one thing that I find hard to understand is the way it handles the price of option on maturity date. As far as I understand, it simply equates option price to zero on maturity date. However, I find this behavior is kind of awkward in some certain situations. Will it be better off if the framework figures out something else, e.g. the intrinsic value of the option on the maturity date, rather than just a zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question is is there any globe settings can be used to override this behavior?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the answer is yes, please kindly instruct how to do it?&#xA;If no, please kindly explain the reason behind this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="19903" LastActivityDate="2018-04-20T08:31:54.090" Title="How many ways can QuantLib handle the price of option on its maturity date?" Tags="&lt;quantlib&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24877" PostTypeId="1" AcceptedAnswerId="24908" CreationDate="2016-03-15T14:09:21.290" Score="0" ViewCount="73" Body="&lt;p&gt;I have started Chapter 1 of Dynamic Hedging by Taleb and it starts by saying&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&amp;quot;Even if traders knew the exact future volatility but hedged themselves (rebalanced the gamma) at discretely spaced increments, they would have difficultly predicting the final P/L&amp;quot;.&lt;/p&gt;&#xA;&lt;p&gt;&amp;quot;If they traded every millionth of a second they would get a P/L with certainty. Increasing the frequency of adjustments would compress the results as shown&amp;quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/cf1q7.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/cf1q7.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&amp;quot;The mean is the Black Scholes Merton value of the security&amp;quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I find this very much starts at the deep end and is fairly poorly explained sentence. Could someone please help me make sense of this.&lt;/p&gt;&#xA;" OwnerUserId="11723" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-03-16T14:12:15.763" Title="Known future volatility and difficulty in predicting final P/L" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;hedging&gt;&lt;gamma&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24878" PostTypeId="2" ParentId="24874" CreationDate="2016-03-15T14:44:12.320" Score="1" Body="&lt;p&gt;Some recent US-listed stocks that have had stock dividends include:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NYSE:TR ex-date 20160304 (3% stock dividend, plus also a cash dividend this day too)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NYSE:EEQ ex-date 20160203 (3.582842% stock dividend)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NASDAQ:SNFCA ex-date 20160113 (5% stock dividend).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A stock dividend is effectively a tiny stock split.  In the case of a 5% stock dividend, it's the same as a 105 for 100 stock split.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source: Internal databases at Norgate Data.&lt;/p&gt;&#xA;" OwnerUserId="13859" LastActivityDate="2016-03-15T14:44:12.320" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24879" PostTypeId="1" AcceptedAnswerId="39719" CreationDate="2016-03-15T14:53:16.847" Score="1" ViewCount="5185" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/epjDS.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/epjDS.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There has been no mention in this text of why this formula uses forward delta not cash delta. Why should have this been obvious to the reader?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can a put be delta neutral at 30%, what does this mean?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why does the Black-Scholes Merton use cash delta and not forward delta?&lt;/p&gt;&#xA;" OwnerUserId="11723" LastEditorUserId="11723" LastEditDate="2018-05-09T17:58:43.770" LastActivityDate="2018-05-10T10:03:12.813" Title="Use of cash delta vs forward delta and the mirror image rule" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;delta&gt;&lt;call&gt;&lt;put&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24880" PostTypeId="1" AcceptedAnswerId="24885" CreationDate="2016-03-15T15:19:53.583" Score="0" ViewCount="80" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;When dealing with a large-size position, dealer, upon exercise, synthetically become short an out-of-the-money option.&quot; &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How does this work, I cannot see why this happens synthetically in particular?&lt;/p&gt;&#xA;" OwnerUserId="11723" LastActivityDate="2016-03-16T15:33:47.937" Title="Dealers becoming synthetically short an out-of-the-money option" Tags="&lt;options&gt;&lt;market-making&gt;&lt;synthetic&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24881" PostTypeId="2" ParentId="24863" CreationDate="2016-03-15T16:16:26.133" Score="2" Body="&lt;p&gt;You can refer to &lt;a href=&quot;http://web.stanford.edu/~wfsharpe/art/sr/sr.htm&quot; rel=&quot;nofollow&quot;&gt;Sharpe's paper&lt;/a&gt;. If you are computing an &lt;em&gt;ex post&lt;/em&gt; Sharpe Ratio, you should calculate the excess return for each period as the return of the fund over the risk free rate return over that same period. Note that if, for example, each period is a month, you need to calculate the monthly risk free rate (and not use the annualised yield).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You then calculate the average excess return divided by the standard deviation of the excess returns.&lt;/p&gt;&#xA;" OwnerUserId="2393" LastEditorUserId="2393" LastEditDate="2016-03-15T16:23:56.587" LastActivityDate="2016-03-15T16:23:56.587" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="24882" PostTypeId="1" AcceptedAnswerId="24886" CreationDate="2016-03-15T17:11:32.003" Score="1" ViewCount="262" Body="&lt;p&gt;I have carefully reconstructed all the computations that lead to the Heston option pricing formula for a call. I end up with this formula for the &quot;adjusted&quot; probabilities&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;P_j\left(x,v,T;\ln K\right) = \int_{-\infty}^{\infty}\frac{d\phi}{2\,\pi}\,\frac{e^{-i\,\phi\,\ln\left(K\right)}\,f_j\left(x,v,T;\phi\right)}{i\,\phi}\,d\phi&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;while in the original paper and all textbooks the final formula is expressed as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;P_j\left(x,v,T;\ln K\right) = \frac{1}{2}+\int_{0}^{\infty}\frac{d\phi}{\pi}\,\text{Re}\left(\frac{e^{-i\,\phi\,\ln\left(K\right)}\,f_j\left(x,v,T;\phi\right)}{i\,\phi}\,\right)d\phi.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that, if $f_j\left(x,v,T;\phi\right)$ is such that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;f_j\left(x,v,T;-\phi\right) = \bar{f_j}\left(x,v,T;\phi\right)\quad(1)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(where a bar indicates the complex conjugate) then we have immediately that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\int_{-\infty}^{\infty}\frac{d\phi}{2\,\pi}\,\frac{e^{-i\,\phi\,\ln\left(K\right)}\,f_j\left(x,v,T;\phi\right)}{i\,\phi}\,d\phi = \int_0^\infty\frac{d\phi}{\pi}\,\text{Re}\left(\frac{e^{-i\,\phi\,\ln\left(K\right)}\,f_j\left(x,v,T;\phi\right)}{i\,\phi}\,\right)d\phi.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem is thus twofold. First I cannot see from the definition of $f_j\left(x,v,T;\phi\right)$ that the property (1) is satisfied (neither I have found any kind of discussion in other textbooks) and, second, even if (1) is proved I miss the $\frac{1}{2}$ that appears in the Heston formula. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be greatly appreciated. &lt;/p&gt;&#xA;" OwnerUserId="18063" LastActivityDate="2016-03-16T10:12:34.227" Title="A clarification on the Heston option pricing formula" Tags="&lt;option-pricing&gt;&lt;heston&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24883" PostTypeId="2" ParentId="22830" CreationDate="2016-03-15T18:19:17.603" Score="0" Body="&lt;p&gt;In Blyth &quot;Introduction to Quantitative Finance&quot;, the Black Scholes formula is derived without explicit use of stochastic calculus as follows: (i) show that on a binomial tree, use of risk-neutral probabilities gives arbitrage free prices (ii) show that a risk-neutral binomial tree, where a stock can go up or down by a fixed percentage at each step, converges to a risk-neutral lognormal distribution as the number of steps tends to infinity  (iii) integrate as you did.   &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-03-15T18:19:17.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24884" PostTypeId="1" AcceptedAnswerId="24888" CreationDate="2016-03-15T18:28:57.870" Score="4" ViewCount="1484" Body="&lt;p&gt;Consider a two-period binomial model for a risky asset with each period equal to a year and take $S_0 = 1$, $u = 1.03$ and $l = 0.98$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a.) If the interest rate for both periods is $R = .01$, find the price of the option with the payoff shown in Figure 2.4 with $K_1 = 1.00$ and $K_2 = 1.05$ at all nodes of the tree.&#xA;&lt;a href=&quot;https://i.stack.imgur.com/l0Izk.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/l0Izk.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b.) Find the replicating portfolio at each nodes of the tree.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solution for a.) First we need to calculate the first period probabilities:&lt;br&gt;&#xA;    $$\hat{\pi}_u = \frac{1 + R - k}{u - l} = .6 \ \ \text{and} \ \ \hat{\pi}_l = \frac{1 + R - k}{u - l} = .4$$ The second-period probabilities are the same since $R = .01$ is constant in both periods. Lastly, the probability at the end nodes are .36 for the $S_0 u^2$, .24 for $S_0 u l$, and .16 at $S_0 l^2$. The payoff we have in the graph is a call spread, so we are long a call $C_1$ at strike $K_1$ and short a call $C_2$ at strike $K_2$. The price of the instrument is thus $V = C_1 - C_2$. Now we can calculate the end nodes: $$V(S_0 u^2) = (S_T - K_1)^{+} - (S_T - K_2)^{+} = .05 \ \ \ V(S_0 u l) = .0094 \ \ \ V(S_0 l^2) = 0$$ Next, we work backwards one period and compute $$V(S_0 u) = \frac{1}{1 + .01}(.6(.05) + .4(.0094)) = .033426 \ \ \ V(S_0 l) = \frac{1}{1 + .01}(.6(.0094) + 0) = .005584$$ Lastly, we can calculate $V_0$ which is $$V_0 = \frac{1}{1+.01}(.6^2 (.05) + 2(.24)(.0094)) = .022289$$&#xA;     Finally we can calculate the expectations of the payoff at each node to get the prices:  $$E(V(S_0 u)) = \frac{1}{1+.01}(.6(.05) + .4(.0094)) = .033426$$ $$E(V(S_0 l)) = 0$$ $$E(V(S_0 u^2)) = \frac{1}{(1.01)^2}(.36(.05)) = .017645$$ $$(V(S_0 u l)) = \frac{1}{(1.01)^2}(.24(.0094)) = .002212$$ $$E(V(S_0 l^2)) = 0$$&lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="467" LastEditDate="2016-03-17T03:39:47.013" LastActivityDate="2016-03-17T03:39:47.013" Title="How to price and find a replicating portfolio for a call spreads using a two-period binomial model?" Tags="&lt;mathematics&gt;&lt;binomial-tree&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="16" ContentLicense="CC BY-SA 3.0" />
  <row Id="24885" PostTypeId="2" ParentId="24880" CreationDate="2016-03-15T18:31:23.663" Score="3" Body="&lt;p&gt;Here's one scenario:  dealer is long a deep in the money American put (say strike is K and the current stock price is S &amp;lt; K ), versus being short a european put with the same strike and final expiration.  If the dealer exercises early the American put, he is now short the European put at K with a short stock hedge against it.  Thus he is synthetically short a European call struck at K.  (&quot;synthetically&quot; via put-call parity).  I'm not sure if that's what is being referred to.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-03-15T18:31:23.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24886" PostTypeId="2" ParentId="24882" CreationDate="2016-03-15T18:55:44.640" Score="2" Body="&lt;p&gt;I do not know what are the exact steps you followed, but here's my 2 cents:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;C(S_t,t) &amp;amp;= P(t,T) E^Q [ (S_T - K)^+ ] \\&#xA;&amp;amp; = P(t,T) E^Q [ S_T 1_{S_T \geq K} ] - K P(t,T) E^Q [ 1_{S_T \geq K} ]&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which can be re-written (using a change of numéraire)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;C(S_t,t) &amp;amp;= S_t E^{Q^S} [ 1_{S_T \geq K} ] - K P(t,T) E^Q [ 1_{S_T \geq K} ] \\&#xA;         &amp;amp;= S_t P_1 - K P(t,T) P_2&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $P_1 = Q^S( S_T \geq K)$ (resp. $P_2 = Q(S_T \geq K)$) are directly related to the cumulative distribution function of the stock price $S_T$ under the measure $Q^S$ (resp. $Q$) where the stock price (resp. the riskless money account) is chosen as numéraire. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because $P_1$ and $P_2$ share very similar interpretations (up to a change of measure), I simply focus on $P_2$ in what follows. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we knew the probability density function $q(s_t,v_t,t;S_T=s)$ in closed-form, we could trivially infer the desired cdf by integrating it and hence deduce $P_2$. This is not the case here. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, we know the characteristic function $f_2$ of the log-stock price $s_T = \ln(S_T)$ under $Q$ (remember that Heston's model is an affine diffusion framework), which by definition writes&#xA;$f_2(s_t,v_t,t;\phi) = E^Q[e^{i\phi s_T}]$. &#xA;&lt;strong&gt;From this definition comes the equality you mention in your original post&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At this point, there exists a general result, known as the &lt;em&gt;Gil-Pelaez inversion theorem&lt;/em&gt;, which tells you how to 'invert' $f_2(\phi)$ (which is basically a Fourier transform) to obtain the desired CDF. Here, the theorem writes &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Q(s_T &amp;lt; \ln(K) ) = \frac{1}{2} - \frac{1}{\pi} \int_0^\infty \Re \left[ \frac{e^{-i \phi \ln(K)}f_2(\phi))}{i\phi} \right] d\phi$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Making the missing 1/2 term appear&lt;/strong&gt;. Noting that $P_2 = 1 - Q(s_T &amp;lt; \ln(K) )$ concludes the demonstration. Similar developments can be applied to obtain $P_1$. You can probably find demonstrations of the Gil-Pelaez inversion theorem in the literature.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-03-16T10:12:34.227" LastActivityDate="2016-03-16T10:12:34.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24887" PostTypeId="2" ParentId="24591" CreationDate="2016-03-15T19:28:21.897" Score="0" Body="&lt;p&gt;A widely used sentiment index is &lt;a href=&quot;http://www.aaii.com/sentimentsurvey&quot; rel=&quot;nofollow&quot;&gt;the AAII Bull/Bear sentiment index&lt;/a&gt; - historical data is available on Bloomberg and probably other data sources.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding industry performance, there are plenty of sector indices - for example in Europe you have the Stoxx sector indices, in the US you have the S&amp;amp;P level 1 sector indices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also find plenty of ETFs, for example &lt;a href=&quot;http://www.sectorspdr.com/sectorspdr/&quot; rel=&quot;nofollow&quot;&gt;the Select Sector Spider funds&lt;/a&gt; which are listed (i.e. you should be able to get data from most free data providers).&lt;/p&gt;&#xA;" OwnerUserId="2393" LastActivityDate="2016-03-15T19:28:21.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24888" PostTypeId="2" ParentId="24884" CreationDate="2016-03-15T19:33:57.797" Score="3" Body="&lt;p&gt;&lt;strong&gt;Quick answer&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The payoff you mention is that of a call spread, i.e. long a call $C_1$ struck at $K_1$ and short a call $C_2$ struck at $K_2$, with $K_2&amp;gt;K_1$. The price of the instrument is therefore: $V = C_1 - C_2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;[First way]&lt;/em&gt; If you are stuck because this payout seems 'unsual' to you, an easy way to reach your goal (assuming you know how to use binomial trees to price standard call options, if you don't please see below), would be to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Use a 2-period binomial tree to price the call $C_1$;&lt;/li&gt;&#xA;&lt;li&gt;Use a 2-period binomial tree to price the call $C_2$;&lt;/li&gt;&#xA;&lt;li&gt;Create a final option tree whose leaves will receive the difference between the leaves' values of the previous ones, since we've established that at all times $V = C_1-C_2$ by absence of arbitrage opportunity.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;[Second way]&lt;/em&gt; It is also possible to do it directly with a single option tree of course (as mentioned in my comments and explained below).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How to use a binomial tree to price (European) options&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Grow a recombining &lt;strong&gt;stock price tree&lt;/strong&gt;. Over each period, the stock price can either evolve upwards or downwards (hence the term binomial). Assuming you start a period with a stock worth $S$, you'll observe either $S_u = u S$ or $S_d = d S$ at the end of that period. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Here you are asked to work with 2 periods, so starting from $S_0$, you'll end up with 6 nodes in total: the first node $S_0$, then the first-period nodes $S_0 u$ and $S_0 d$, and the final period nodes $S_0 u^2$, $S_0 u d$, $S_0 d^2$.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Grow yet another tree with the same structure. Call this the &lt;strong&gt;option price tree&lt;/strong&gt;. As the name indicates, its nodes will figure the &lt;em&gt;option value&lt;/em&gt; for each state of the stock described by the stock price tree. One objective is obviously to determine the value of the option $V_0$ when the stock is worth $S_0$ at inception. Yet, at this stage, you only know the value of the option at expiry. &lt;strong&gt;Indeed, at expiry, by absence of arbitrage opportunity, the option should be worth its payoff&lt;/strong&gt;. This can be used to place values on the terminal nodes of the option price tree. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In your case, the payoff function is represented by a graph. You can use this graph to find what values to attribute to each terminal node of the option price tree. For instance, in the situation where the stock is worth $S_0 u^2 = (1.03)^2$ at expiry, find the corresponding payoff ($f(S_0u^2)$ in the payout graph) and plug it as the option value at the relevant terminal tree node. Repeat for each terminal node.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Finally, work backwards from the terminal tree nodes, by taking &lt;strong&gt;risk-neutral expectations&lt;/strong&gt;. The idea is the opposite of when you grew the stock price tree: instead of moving from 1 stock price node (start of period) to 2 stock price nodes (end of period), you now work in the option price tree and proceed backwards from 2 option price nodes (end of period) to 1 option price node (start of period). &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;For instance, assume you have identified - from the payoff function - the values $V_{uu} = f(S_0u^2)$ and $V_{ud} = f(S_0ud)$ of the option at expiry. You are now looking for the value $V_u$ at the end of the first period, knowing that the stock finished in the upward state. This values is not given by $f(S_0 u)$ because you are not at the option expiry any more: no arbitrage argument cannot be used here. However, one can show that&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$$V_u = \frac{1}{1+R} (q V_{uu} + (1-q) V_{ud})$$&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;where $q$ figures a risk-neutral probability of going in the upwards state over each period. Mathematically, $q$ computes as:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$$q = \frac{(1+R) -d}{u-d}$$&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;You can see that these risk-neutral probabilities are constant provided the interest rates are constant. Now you are done with $V_u$. You can repeat the process to compute $V_d$, the value of the option at the end of the first period knowing that the stock finished in the downward state, from the values of $V_{ud}$ and $V_{dd}$. This writes:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$$V_d = \frac{1}{1+R} (q V_{ud} + (1-q) V_{dd})$$&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Using the same rationale, from the quantities $V_u$ and $V_d$ you just computed, you can further deduce $V$, the option value at inception where the stock price is $S_0$, by once again taking a discounted risk-neutral expectation.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$$V = \frac{1}{1+R} (q V_{u}+ (1-q) V_{d})$$&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;This is how you work your way to the root of the option tree using a 'backwards induction' process.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;To see where this concept of risk-neutral probability comes from, assume you were to build a portfolio of primary assets at the start of a given period, whose objective will be to perfectly mimic the value of the option position in all possible states of the economy. At the start of a period, your portfolio of primary assets is worth&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Pi = \alpha S + \beta$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the end of a period, in the upward state, because we want it to be replicating we need to have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\alpha S_u + \beta (1 + R) = V_u$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, in the downard state:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\alpha S_d + \beta (1 + R) = V_d$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solve these 2 equations for the 2 uknowns $\alpha$ and $\beta$. You end up with:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;\alpha &amp;amp;= \frac{V_u - V_d}{S_u-S_d} \\&#xA;\beta &amp;amp;= \frac{1}{1+R} \frac{u V_d - d V_u}{(u-d)}&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, by construction the portfolio is replicating. Hence by no arbitrage arguments its value at the start of the period should be exactly the same as that of the option:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V = \alpha S + \beta$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the values you have found for $\alpha$ and $\beta$ (functions of $R$, $V_u$ and $V_d$), you can re-write this equation in the form $V = \frac{1}{1+R} (q V_u + (1-q) V_d)$ introduced earlier, hence the concept of risk-neutral probabilities.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If you have correctly understood everything until now, then this also answers the point (b) of your question: on each period, the replicating portfolio corresponds to holding $\alpha$ shares and $\beta$ bonds.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="467" LastEditDate="2016-03-17T01:19:08.180" LastActivityDate="2016-03-17T01:19:08.180" CommentCount="16" ContentLicense="CC BY-SA 3.0" />
  <row Id="24889" PostTypeId="2" ParentId="24799" CreationDate="2016-03-15T19:35:18.057" Score="1" Body="&lt;p&gt;You can use &lt;a href=&quot;http://web.tmxmoney.com/screener.php?locale=EN&quot; rel=&quot;nofollow noreferrer&quot;&gt;the stock screener&lt;/a&gt; provided by the exchange. You can specify your criteria (Exchange = Toronto) and once you get the results, you can click on &quot;Edit columns&quot; and add the Sector.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The results are limited to 400 per run, but you can easily split your search into chunks by your choice of filter. For example you can filter by Market Cap 0-100M, then 100M-200M, and so on. Takes a few minutes but gets you the full list in the end.&lt;/p&gt;&#xA;" OwnerUserId="2393" LastEditorUserId="7390" LastEditDate="2019-12-03T11:20:26.807" LastActivityDate="2019-12-03T11:20:26.807" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="24890" PostTypeId="1" AcceptedAnswerId="24893" CreationDate="2016-03-15T19:54:53.777" Score="3" ViewCount="321" Body="&lt;p&gt;I am new to derivatives pricing and am trying to understand why there are two different expressions for the Black-Scholes hedging portfolio. The first approach, used in books like Hull, stipulates that the hedging portfolio consists of being short one option and long $\frac{\partial V}{\partial S}$ shares at any time $t$, that is:&#xA;$$\Pi_t=-V(t,S_t)+\frac{\partial V}{\partial S}S_t.$$&#xA;In other references such as Shreve, the hedge portfolio is presented via the following tautology:&#xA;$$\Pi_t=\frac{\partial V}{\partial S}S_t+\left(\Pi_t-\frac{\partial V}{\partial S}S_t\right).$$&#xA;This might be a stupid question, but are these two expressions just different ways of expressing the same thing? Is the cash position in the second equation equivalent to reinvesting the price of the option if we are selling it in the first place (i.e. $-V(t,S_t)$)?Any comments or explanations would be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="19912" LastEditorUserId="19912" LastEditDate="2016-03-15T20:04:00.120" LastActivityDate="2016-05-13T07:59:39.920" Title="Why are there two expressions for the Black-Scholes hedging portfolio" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;portfolio&gt;&lt;hedging&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24891" PostTypeId="2" ParentId="22830" CreationDate="2016-03-15T20:09:09.167" Score="1" Body="&lt;p&gt;Stochastic integration is required to prove Girsonav's theorem; which is required to prove that you can use the &quot;risk neutral&quot; expectation instead of the &quot;actual&quot; expectation.  In short, it is required so that the &quot;assumption&quot; that $\mu+\sigma^2/2=0$ is valid.  Though typically this would be $r=\mu$ instead... &lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2016-03-15T20:09:09.167" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24892" PostTypeId="2" ParentId="22732" CreationDate="2016-03-15T20:14:28.623" Score="3" Body="&lt;p&gt;VXV is a 3-month volatility index, and is currently not tradable (there are no futures on it). And since you cannot trade it, you cannot arb it.&lt;/p&gt;&#xA;" OwnerUserId="185" LastEditorUserId="185" LastEditDate="2016-03-18T18:25:50.437" LastActivityDate="2016-03-18T18:25:50.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24893" PostTypeId="2" ParentId="24890" CreationDate="2016-03-15T20:18:48.803" Score="3" Body="&lt;p&gt;The first portfolio $\Pi^{(1)}_t$ is a &lt;strong&gt;self-financing hedging portfolio&lt;/strong&gt;. It is typically what you get when you delta hedge an option position (here short hence the minus sign, but it could be long without loss of generality) with shares of the underlying asset. If the only source of risk comes from the randomness of the underlying asset price $S_t$, then one can claim that $\Pi^{(1)}_t$ evolves at the risk-free rate i.e. $d\Pi^{(1)}_t = r\Pi^{(1)}_t dt$, because applying the self-financing property along with Itô shows that $d\Pi^{(1)}_t$ is a deterministic quantity (the randomness reflected by the $dS_t$ term disappears) and should hence evolve at the risk-free rate under no arbitrage assumptions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second portfolio $\Pi^{(2)}_t$ is a &lt;strong&gt;self-financing replicating portfolio&lt;/strong&gt;. It is composed of shares of the underlying and money placed/withdrawn from a risk-free money market account (or equivalently a position in zero-coupon bonds). Usually, $\Pi^{(2)}_t$ is used to dynamically replicate an option position $V_t$, in the sense that, for any infinitesimal period of time we want to make sure that $d(\Pi^{(2)}_t - V_t) = 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The equations $d\Pi^{(1)}_t = r\Pi^{(1)}_t dt$ and $d\Pi^{(2)}_t - dV_t = 0$ are two &lt;strong&gt;different yet equivalent&lt;/strong&gt; ways of deriving a pricing PDE under no arbitrage assumptions (at least in a complete single factor market).&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-05-13T07:59:39.920" LastActivityDate="2016-05-13T07:59:39.920" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24895" PostTypeId="2" ParentId="24880" CreationDate="2016-03-15T20:29:52.873" Score="2" Body="&lt;p&gt;Here's the example of what is in the quote: dealer is long an ITM call. As a hedge the dealer is also short OTM put (with the same strike) and short stock. This is a &quot;riskless&quot; position, equivalent of a bond. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The underlying pays a dividend, and a day before the ex-date dealer exercises the call. The shares that dealer received from exercise are netted against his existing shorts to zeros, which leaves the dealer short an OTM put.&lt;/p&gt;&#xA;" OwnerUserId="185" LastEditorUserId="185" LastEditDate="2016-03-16T15:33:47.937" LastActivityDate="2016-03-16T15:33:47.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24899" PostTypeId="2" ParentId="22830" CreationDate="2016-03-15T22:59:58.797" Score="2" Body="&lt;p&gt;you can get it as a limit of binomial trees by doing risk-evaluation on the trees and passing to the limit. See eg Baxter and Rennie or my book &quot;Concepts and Practice of mathematical finance.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, one should be careful when talking about &quot;proving&quot; a formula. You prove theorems. Theorems require assumptions. The Black--Scholes-Merton argument shows that given a GBM with any drift then no arbitrage implies that the BS formula holds. This is much stronger than assuming the drift has an unrealistic value for the starting point of the deduction. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2016-03-15T22:59:58.797" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24900" PostTypeId="2" ParentId="24591" CreationDate="2016-03-16T01:38:20.930" Score="0" Body="&lt;p&gt;VIX is probably the first thing you should look at and is probably everyone's favorite sentiment indicator, so you can find it anywhere (usually ^VIX or $VIX).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;COT is my second favorite indicator and it can be used as a sentiment indicator even though all it does is show the hands of the market participants with a big 2 week lag. Like everything else, most of the time COT is just noise, but when the commercials and the small speculators are in complete disagreement and both levels are outside of the 95th percentile, then it becomes an extremely accurate indicator of market tops and bottoms. The theory is that 99% of all active traders (represented by the small speculators) lose money. Compile the COT yourself from raw data here: &lt;a href=&quot;http://www.cftc.gov/MarketReports/CommitmentsofTraders/HistoricalCompressed/index.htm&quot; rel=&quot;nofollow&quot;&gt;http://www.cftc.gov/MarketReports/CommitmentsofTraders/HistoricalCompressed/index.htm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My third favorite contrarian indicator is the NYSE Advance-Decline Index. You can compile a cumulative indicator using free end-of-day data and when the level goes outside the 95th percentile, then it is pretty good at showing the turning points of the market from a contrarian standpoint. One such source is Kinetick from the Ninjatrader platform (^ADV and ^DECL). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried to use the AAII Bull/Bear sentiment index in my trading many times and found it of little value. Perhaps it has become too popular and no longer works?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another fairly obscure sentiment indicator is the magazine-covers indicator. I don't take it too seriously, but I do glance at the covers occasionally. The theory is that if a stock market-related issue appears on a mainstream, non-financial publication, then the issue is already overbought or oversold. I don't think this is reliable enough by itself, and is too subjective to be taken seriously, but it can be used as a confirmation to other indicators. You can get all the Time magazine covers going back to 1923 from here: &lt;a href=&quot;http://search.time.com/results.html?No=315&amp;amp;sid=1537CD7ED1E9&amp;amp;Ns=p_date_range|1&amp;amp;N=46&amp;amp;Nty=1&quot; rel=&quot;nofollow&quot;&gt;http://search.time.com/results.html?No=315&amp;amp;sid=1537CD7ED1E9&amp;amp;Ns=p_date_range|1&amp;amp;N=46&amp;amp;Nty=1&lt;/a&gt;&#xA;The most recent two years are in separate pages:&#xA;&lt;a href=&quot;http://time.com/vault/year/2015/&quot; rel=&quot;nofollow&quot;&gt;http://time.com/vault/year/2015/&lt;/a&gt;&#xA;&lt;a href=&quot;http://time.com/vault/year/2016/&quot; rel=&quot;nofollow&quot;&gt;http://time.com/vault/year/2016/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding sector performance, I also recommend looking at ETFs. I just glance at the lists before making long-term decisions. But, you could compile much more sophisticated performance studies from ETF price data that is freely available everywhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://seekingalpha.com/insight/etf-hub/asset_class_performance/countries&quot; rel=&quot;nofollow&quot;&gt;http://seekingalpha.com/insight/etf-hub/asset_class_performance/countries&lt;/a&gt;&#xA;&lt;a href=&quot;http://seekingalpha.com/insight/etf-hub/asset_class_performance/sectors&quot; rel=&quot;nofollow&quot;&gt;http://seekingalpha.com/insight/etf-hub/asset_class_performance/sectors&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also like to look at sector heatmaps from time to time:&#xA;&lt;a href=&quot;http://www.finviz.com/map.ashx?t=sec&quot; rel=&quot;nofollow&quot;&gt;http://www.finviz.com/map.ashx?t=sec&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19508" LastActivityDate="2016-03-16T01:38:20.930" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24901" PostTypeId="1" CreationDate="2016-03-16T03:11:06.503" Score="2" ViewCount="2342" Body="&lt;p&gt;I have a (hopefully) elementary question about forex swaps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most feeds will have a near and a far leg (or more legs for more exotic swaps).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I appreciate that &quot;buying the swap&quot; involves locking in multiple transactions at different points in time, with different rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a convention for representing these multiple prices as a single price?  After all, spreads/strategies are presented with a single price to buy or sell, based on its legs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it something like (near price - far price), or the inverse?  If so, how does this work for swaps with six legs containing different amounts at each leg?&lt;/p&gt;&#xA;" OwnerUserId="19915" LastActivityDate="2016-03-16T11:10:55.487" Title="Pricing of swaps" Tags="&lt;fx&gt;&lt;swaps&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24902" PostTypeId="2" ParentId="24766" CreationDate="2016-03-16T04:19:01.850" Score="2" Body="&lt;p&gt;Strategy A has fatter tails and should outperform when the volatility surface is convex.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that both strategies have the same average option maturity = N/2 days.  However, for Strategy A option maturity fluctuates between 0 and N days, while for Strategy B the average maturity is always N/2 days (after the initial N day run up to full investment).  For any given vol curve, the expected cost of the two strategies should be the same, however expected returns to Strategy A will have fatter tails while returns to Strategy B will have higher kurtosis. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So long as the volatility curve is smiling convexly (at most maturities) then Strategy A gives exposure to these tails at the same cost as strategy B. &lt;/p&gt;&#xA;" OwnerUserId="3297" LastActivityDate="2016-03-16T04:19:01.850" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24903" PostTypeId="2" ParentId="24901" CreationDate="2016-03-16T10:53:10.720" Score="2" Body="&lt;p&gt;From my &lt;a href=&quot;http://www.webstersystems.co.uk/fxmm.htm&quot; rel=&quot;nofollow&quot;&gt;FX trainer&lt;/a&gt; the swap points reflect the differential in interest rates between the 2 currencies. If the trade was on the RHS the market maker would be giving up the currency with the higher interest rate (points my favour) and receiving the currency with the lower interest rate. The swap provides both parties with an accurate cost of switching such cash flows. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, you're trying to take a differential across 6 value dates. So provided everything is the same way around I don't see why you can't do as you've said and subtract any number of differentials into 1 aggregate, and get a total cost to switch all the cash flows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, from &lt;a href=&quot;http://www.faqs.org/patents/app/20080288308&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; there is something called a single spot portfolio (SSP) being &quot;an FX deal involving one or more legs in a single currency pair on any combination of value dates. The dealt currency should be the same for all legs. SSP price quotes typically have four components: a spot rate, the FX points for each of the non-spot value dates, and the all-in rates for each of the non-spot value dates.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And again &quot;A foreign exchange transaction or &quot;deal&quot; involving multiple value dates for a single currency pair. The Provider quotes a single spot rate (hence the name) together with FX points for each value date.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in a professional implementation of what you're talking about, as a client you'd want to see each differential between spot and the far date(s). So you can see an accurate cost of each cash flow in the deal, I guess. Perhaps compare these costs with other providers.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastEditorUserId="7369" LastEditDate="2016-03-16T11:10:55.487" LastActivityDate="2016-03-16T11:10:55.487" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24904" PostTypeId="1" AcceptedAnswerId="24906" CreationDate="2016-03-16T11:07:14.820" Score="2" ViewCount="300" Body="&lt;p&gt;From Dynamic Hedging by Taleb:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Risk Management Rule: Option trader lore states that when long gamma, use limit orders. When short gamma, use stop orders.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I cannot understand why this is and the book gives no justification.&lt;/p&gt;&#xA;" OwnerUserId="11723" LastActivityDate="2016-03-17T14:33:56.763" Title="Using limit orders or stop orders and gamma" Tags="&lt;options&gt;&lt;greeks&gt;&lt;gamma&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24905" PostTypeId="1" CreationDate="2016-03-16T13:04:56.763" Score="1" ViewCount="76" Body="&lt;p&gt;trying to pricing a simple bond using RQuantLib, but cannot get the right values. &#xA;For example, consider a bond with 2% annual coupon rate and flat interest rate of 3%, a 5 year maturity, and \$100 face value. I can get the $\textrm{NPV} = 95.42029$ by simple calculation: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$2/(1+0.03) + 2/(1+0.03)^2 + 2/(1+0.03)^3 + 2/(1+0.03)^4 + 102/(1+0.03)^5.$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I use RQuantLib:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bond &amp;lt;- list(settlementDays=1,&#xA;               issueDate=as.Date(&quot;2010-02-16&quot;),&#xA;               faceAmount=100,&#xA;               accrualDayCounter='ActualActual.Bond',&#xA;               paymentConvention='Unadjusted')&#xA;  schedule &amp;lt;- list(effectiveDate=as.Date(&quot;2010-02-16&quot;),&#xA;                   maturityDate=as.Date(&quot;2015-02-16&quot;),&#xA;                   period='Annual',&#xA;                   calendar='UnitedStates/GovernmentBond',&#xA;                   businessDayConvention='Unadjusted',&#xA;                   terminationDateConvention='Unadjusted',&#xA;                   dateGeneration='Backward',&#xA;                   endOfMonth=0)&#xA;  calc=list(dayCounter='ActualActual.Bond',&#xA;            compounding='Compounded',&#xA;            freq='Annual',&#xA;            durationType='Modified')&#xA;  coupon.rate &amp;lt;- c(0.02)&#xA;  params &amp;lt;- list(tradeDate=as.Date('2010-02-16'),&#xA;                 settleDate=as.Date('2010-02-17'),&#xA;                 dt=.25,&#xA;                 interpWhat=&quot;discount&quot;,&#xA;                 interpHow=&quot;loglinear&quot;)&#xA;  setEvaluationDate(as.Date(&quot;2010-02-16&quot;))&#xA;  discountCurve.flat &amp;lt;- DiscountCurve(params, list(flat=0.03))&#xA;  FixedRateBond(bond,&#xA;                coupon.rate,&#xA;                schedule,&#xA;                calc,&#xA;                discountCurve=discountCurve.flat)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I got the following results:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Concise summary of valuation for FixedRateBond &#xA; Net present value :  95.22618 &#xA;       clean price :  95.221 &#xA;       dirty price :  95.226 &#xA;    accrued coupon :  0.0055556 &#xA;             yield :  0.030454 &#xA;          duration :  4.6575 &#xA;   settlement date :  2010-02-17 &#xA;        cash flows : &#xA;       Date Amount&#xA; 2011-02-16      2&#xA; 2012-02-16      2&#xA; 2013-02-16      2&#xA; 2014-02-16      2&#xA; 2015-02-16      2&#xA; 2015-02-16    100&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Another strange thing happens when I change the accrualDayCounter = Actual365NoLeap. I should expect the accrued coupon = 2/365 = 0.005479 (because only 1-day accrual). However, RQuantLib still gives 0.0055556 (=2/360). It seems changing the daycounter does not have any effect. What am I doing wrong here? Thank you for your help. &lt;/p&gt;&#xA;" OwnerUserId="19918" LastEditorUserId="848" LastEditDate="2016-03-16T13:32:17.187" LastActivityDate="2016-03-16T13:32:17.187" Title="Issue on pricing bond using RQuantLib" Tags="&lt;bond&gt;&lt;pricing&gt;&lt;rquantlib&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24906" PostTypeId="2" ParentId="24904" CreationDate="2016-03-16T13:33:11.270" Score="2" Body="&lt;p&gt;An important theme in N. Taleb's book(s) is that being short gamma is a dangerous situation, in the sense that you are subject to occasional very sharp losses, losses that could put you out of business or at least be very painful. You do make frequent small gains, but these are of less concern. (Recall that the P&amp;amp;L of an option when the underlying changes by $\Delta S$ can be approximated by a linear term $\delta \Delta S$ plus a quadratic term $\frac{1}{2} \gamma (\Delta S)^2$. This last term is important when $\Delta S$ is large and will be negative when gamma is negative, i.e. you are short the option). The author returns to this theme of dangerous gamma and illustrates it in many different ways.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, because when you are short gamma you are in a dangerous situation, you need to act quickly and decisively. When you put in a limit order [for the underying] it may take some time to execute (if at all), with a stop order you are able to get in/out decisively when the market turns unfavorable to you. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you know, with a limit order you transact if the price becomes more favorable to you (comes in when you are a buyer). With a stop order, it is the opposite, you transact when the price becomes more unfavorable (gets away from you when you are a buyer).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general stop orders are a risk control tool, limit order are a patient accumulation tool that saves money but does not guarantee execution. To give another example [of how these orders can be used for different purposes]: a trend follower would probably use stop orders (he wants to buy once the price begins to rise), a value investor would probably use a series of limit orders (he is trying to buy cheaply, whenever the price dips down). &lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-03-17T14:33:56.763" LastActivityDate="2016-03-17T14:33:56.763" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24907" PostTypeId="2" ParentId="1717" CreationDate="2016-03-16T13:51:57.053" Score="0" Body="&lt;p&gt;In practice a 3s-1s basis swap has negligible gamma.  Imagine putting on the basis swap, then the basis swap market moves.  The resulting profit or loss is the present value of a fixed annuity, whose value depends on outright rates, not basis swaps.  Sometimes there could be a correlation between rates and basis swaps, which could make this covariance feel like a gamma position, but this is relatively rare in my experience.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-03-16T13:51:57.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24908" PostTypeId="2" ParentId="24877" CreationDate="2016-03-16T14:12:15.763" Score="2" Body="&lt;p&gt;He's saying that if you know the volatility, and you hedge continuously, you can lock in the exact Black-Scholes price.   Any deviation from that delta hedging scheme must result in noise.  ie the replicated price must have a distribution with some width around the theoretical value.  This noise does not create systematic profit or loss, because it's just doing market transactions in the underlying stock.  Hence the distribution of the replicated price is still centered around the theoretical value.  The greater the deviation from continuous hedging, the wider the distribution of the replicated price.  Nothing earth shattering.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-03-16T14:12:15.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24909" PostTypeId="1" CreationDate="2016-03-16T14:20:19.700" Score="2" ViewCount="1539" Body="&lt;p&gt;I am trying to download adjusted close prices of different stocks from yahoo finance. I used &quot;Download to Spreadsheet&quot; to download historical prices for each stock and then join these files into one. But it takes a lot of time. I wonder whether there exists a faster way to do it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="19864" LastActivityDate="2016-04-16T04:45:07.517" Title="Yahoo finance: download adjusted close prices of different stocks in one file" Tags="&lt;historical-data&gt;&lt;yahoofinance&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24911" PostTypeId="1" AcceptedAnswerId="24913" CreationDate="2016-03-16T16:21:16.597" Score="7" ViewCount="9133" Body="&lt;blockquote&gt;&#xA;&lt;p&gt;&amp;quot;The vega is the integral of the gamma profits ( ie expected gamma rebalancing P/L) over the duration of the option at one volatility minus the same integral at a different volatility...Mathematically, it is:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\text{Vega} = \sigma t S^2 \text{Gamma}$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;where &lt;span class=&quot;math-container&quot;&gt;$S$&lt;/span&gt; is the asset price, &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt; the time left to expiration and &lt;span class=&quot;math-container&quot;&gt;$\sigma$&lt;/span&gt; the volatility.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;This is again from Dynamic Hedging by Taleb. I cannot understand the first sentence because it gives no indication of which volatilities to pick nor what the integrand of the integral would be.&lt;/p&gt;&#xA;&lt;p&gt;Shortly after Taleb states the formula above, again no justification as to where it came from.&lt;/p&gt;&#xA;&lt;p&gt;Please could someone explain this better.&lt;/p&gt;&#xA;" OwnerUserId="11723" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-03-16T17:07:01.527" Title="Link between Vega and Gamma" Tags="&lt;options&gt;&lt;greeks&gt;&lt;gamma&gt;&lt;vega&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="24912" PostTypeId="2" ParentId="24909" CreationDate="2016-03-16T16:58:46.923" Score="2" Body="&lt;p&gt;Take a look at &lt;a href=&quot;https://pandas-datareader.readthedocs.org/en/latest/&quot; rel=&quot;nofollow&quot;&gt;pandas-datareader&lt;/a&gt;.&lt;br&gt;&#xA;you will need to use python and write something like this:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# import package and notebook setting&#xA;import pandas as pd&#xA;import pandas_datareader.data as web&#xA;import datetime&#xA;pd.set_option('display.max_rows', 999)&#xA;pd.set_option('display.max_columns', 999)&#xA;pd.set_option('precision', 4)&#xA;# load data&#xA;start = datetime.datetime(2010, 1, 1)&#xA;end = datetime.datetime(2015, 5, 9)&#xA;quotes = web.DataReader([&quot;AAPL&quot;, &quot;GOOGL&quot;, &quot;TSLA&quot;], 'yahoo', start, end)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="19188" LastActivityDate="2016-03-16T16:58:46.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24913" PostTypeId="2" ParentId="24911" CreationDate="2016-03-16T17:07:01.527" Score="11" Body="&lt;p&gt;Under the Black-Scholes model, &#xA;\begin{align*}&#xA;Gamma &amp;amp;= \frac{N'(d_1)}{S \sigma \sqrt{T-t}}\\&#xA;Vega &amp;amp;= SN'(d_1) \sqrt{T-t}.&#xA;\end{align*}&#xA;Then, it is easy to see that&#xA;\begin{align*}&#xA;Vega = S^2 \sigma (T-t) Gamma.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-03-16T17:07:01.527" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24914" PostTypeId="1" CreationDate="2016-03-16T17:36:31.730" Score="2" ViewCount="231" Body="&lt;p&gt;The question is regarding the LGD of Agency MBS. Although Agencies never defaulted, the Basel framework requires to calculate the Agency MBS LGD for capital requirement. The closest benchmark I can think of is to take the LGD of non agency Prime RMBS as a proxy. Can anyone think of any other benchmark?&lt;/p&gt;&#xA;" OwnerUserId="19922" LastActivityDate="2021-01-30T14:45:07.260" Title="Loss given default for Agency MBS" Tags="&lt;models&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24915" PostTypeId="1" AcceptedAnswerId="24917" CreationDate="2016-03-16T19:35:36.757" Score="0" ViewCount="213" Body="&lt;p&gt;When using market swap rates to calibrate a discount curve, it seems that the PV of a 1Y swap depends on the zero curve at points beyond the 1Y mark.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, a USD 1Y swap with trade date today (Wed 16th March 2016) and a spot lag of 2 days will have an effective date of Fri 18th March 2016, and the floating leg accrual periods (after adjusting using modified following convention) are&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Period  Start Date    End Date&#xA;---------------------------------&#xA;1       18-Mar-2016   20-Jun-2016&#xA;2       20-Jun-2016   19-Sep-2016&#xA;3       19-Sep-2016   19-Dec-2016&#xA;4       19-Dec-2016   20-Mar-2017&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The final payment clearly depends on today's LIBOR curve for 20th March 2017, which is more than one year after today (in fact it is 1.011 years in ACT/365 day count).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems odd to me that the PV of a 1Y swap would depend on points on the zero curve beyond the one year mark, but that seems to be the case if you correctly compute the start and end dates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it the case? If not, how do institutions normally deal with this?&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2016-03-16T20:13:56.317" Title="Does a 1Y swap depend on zero curve beyond the 1Y point?" Tags="&lt;swaps&gt;&lt;discounting&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24917" PostTypeId="2" ParentId="24915" CreationDate="2016-03-16T19:50:44.480" Score="1" Body="&lt;p&gt;The problem is that the definition of &quot;one year&quot; depends on the market convention:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Roll Day: What's one year after February 28, 2015? Is it February 28, 2016 or February 29, 2016? According to the standard swap roll-day convention, it would be 2/28/16. But in the US government bond market, it would be 2/29/16. Now you can see why it's problematic: the difference from 2/28/15 to both 2/28/16 and 2/29/16 can be considered &quot;1-year,&quot; depending on the convention in question.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Effective Start Date: Is it the trade date, or something else? As you said, the effective start date is usually 2 business days after the trade date for a standard swap. The maturity date is 1-year after the effective date, not the trade date. So whether the swap in question is a &quot;1-year&quot; or &quot;1-year 2-day&quot; swap depends on the perspective.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For pricing, what you need is a unique discount factor for each date. It shouldn't matter how you define &quot;year&quot; internally within your model. In other words, the final cash flow should be discounted with $d(\text{3/20/2017})$. How you convert that 3/20/2017 into a year fraction is entire up to you. In a discount curve setting, Actual/365 is the most prevalent choice.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2016-03-16T20:13:56.317" LastActivityDate="2016-03-16T20:13:56.317" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24918" PostTypeId="1" AcceptedAnswerId="24922" CreationDate="2016-03-16T19:52:47.457" Score="9" ViewCount="1458" Body="&lt;p&gt;Suppose I have the following data (for the current stock and option prices of the Bank of America)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;   Strike Last        IV Probability&#xA;4       8 5.43 0.5813566   0.0000000&#xA;7      11 2.45 0.2868052   0.1571556&#xA;8      12 1.68 0.3611712   0.0000000&#xA;9      13 0.93 0.3149634   0.0000000&#xA;10     14 0.42 0.2906097   0.4216563&#xA;11     15 0.16 0.2827868   0.0000000&#xA;12     16 0.06 0.2894076   0.0000000&#xA;13     17 0.03 0.3147238  12.5000000&#xA;14     18 0.02 0.3498626   0.0000000&#xA;15     19 0.02 0.4019490   0.0000000&#xA;16     20 0.01 0.4093461 100.0000000&#xA;17     21 0.01 0.4513419   0.0000000&#xA;18     22 0.02 0.5374740   0.0000000&#xA;19     23 0.01 0.5280132         Inf&#xA;20     24 0.02 0.6147154   0.0000000&#xA;21     25 0.01 0.5967137   0.0000000&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What I want to do is to obtain risk-neutral probability distribution of stock returns from it. I read &lt;a href=&quot;https://quant.stackexchange.com/questions/1621/how-to-derive-the-implied-probability-distribution-from-b-s-volatilities&quot;&gt;this&lt;/a&gt; question. It is stated that for this purpose I need to take second derivative of option price such as $\frac{\partial^2 c}{\partial K^2}$. Am I right that I cannot  do that analytically from the option formula (I use BSM)? So what is practical solution for this (could you please explain in details and preferably with example using my data)?&lt;br/&gt; In the &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0132777428&quot; rel=&quot;nofollow noreferrer&quot;&gt;Hull's book&lt;/a&gt; it is stated that one can use the following expression to evaluate probability density $g(K)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;g(K) = e^{rT}\frac{c_1+c_3-2c_2}{\delta^2}&#xA;$$&#xA;where $K$ is a strike, $c_1$, $c_2$ and $c_3$ are prices of European call options  with maturity $T$ and strikes $K-\delta$, $K$ and $K+\delta$ respectively. Is it the way I should use in practice to evaluate $g(K)$? I have tried it with my data but I get unrealistic results (e.g. negative probabilities).&lt;br/&gt;&#xA;Appreciate your help&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: according to the @Quantuple answer I calculated probability, $Probability_i$, that the stock price will lie between $Strike_{i-1}$ and $Strike_{i+1}$ (am I interpret it right?). The values that I got seem to be unrealistic (e.g. negative probability). In this case I tried to do the same with another data (Apple current stock and option prices) and I got the following &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;   Strike  Last        IV Probability&#xA;8    85.0 21.41 0.2814728  0.00000000&#xA;10   90.0 16.65 0.2712171  0.04287807&#xA;11   92.5 14.15 0.2350727  0.00000000&#xA;12   95.0 12.10 0.2530275  0.00000000&#xA;13   97.5 10.05 0.2506622  0.01535698&#xA;14  100.0  8.23 0.2525582  0.00000000&#xA;15  105.0  5.01 0.2436027  0.00000000&#xA;16  110.0  2.71 0.2368809  0.07017230&#xA;17  115.0  1.35 0.2363258  0.00000000&#xA;18  120.0  0.61 0.2362289  0.00000000&#xA;19  125.0  0.29 0.2435342  0.85066163&#xA;20  130.0  0.15 0.2548730  0.00000000&#xA;21  135.0  0.08 0.2660732  0.00000000&#xA;22  140.0  0.05 0.2814728  4.00000000&#xA;23  145.0  0.03 0.2935170  0.00000000&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I use the following R code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;chain &amp;lt;- getOptionChain(&quot;BAC&quot;, Exp = &quot;2016-05-20&quot;)&#xA;chain &amp;lt;- chain$calls&#xA;chain &amp;lt;- chain[, 1:2]&#xA;chain$IV &amp;lt;- 0&#xA;time_remain &amp;lt;- as.numeric(as.Date(&quot;2016-05-20&quot;) - as.Date(Sys.time()))&#xA;time &amp;lt;- time_remain/360&#xA;rf &amp;lt;- 0.01&#xA;Spot &amp;lt;- getQuote(&quot;BAC&quot;)&#xA;Spot &amp;lt;- Spot$Last&#xA;chain &amp;lt;- as.data.frame(apply(chain, 2, as.numeric))&#xA;for (i in 1:nrow(chain)) {&#xA;  chain$IV[i] &amp;lt;- iv.opt(S = Spot, K = chain$Strike[i], T = time, riskfree = rf, price = chain$Last[i], type = &quot;Call&quot;)&#xA;}&#xA;chain &amp;lt;- na.omit(chain)&#xA;ggplot(chain, aes(x = Strike, y = IV)) + geom_line(size = 1, color = &quot;red&quot;) + ylab(&quot;Implied volatility&quot;) + theme(axis.text = element_text(size = 18), panel.border = element_rect(fill = NA, colour = &quot;black&quot;, size = 2), axis.title = element_text(size = 20))&#xA;chain$Probability &amp;lt;- 0&#xA;for (i in seq(2, nrow(chain), 3)) {&#xA;  chain$Probability[i] &amp;lt;- (-2*chain$Last[i] + chain$Last[i-1] + chain$Last[i+1])/((chain$Last[i+1] - chain$Last[i-1])^2)&#xA;}&#xA;chain&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For Apple everything looks ok besides that $P\left[S \in (135; 145)\right] = 4$ which is unreal (again). Is it real to get risk-neutral probabilities that I could interpret in a &quot;common&quot; way (e.g. they are not negative or their sum do not exceed $1$)?&lt;/p&gt;&#xA;" OwnerUserId="18345" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-05-09T08:23:08.963" Title="Obtaining risk-neutral probability from option prices" Tags="&lt;r&gt;&lt;risk-neutral-measure&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="24919" PostTypeId="2" ParentId="24915" CreationDate="2016-03-16T19:53:55.860" Score="1" Body="&lt;p&gt;This all depends how you build the swap curve.  If you are using just annual zero rates to build the curve, the answer may be that a one year par rate (paid quarterly or semi annually) is not the same as a one year zero rate. Specifically, it has slightly shorter duration. Therefore the hedge for a one year par rate, in terms of zero rates, should contain a small amount of 2 year swaps (and possibly longer swaps) in the opposite direction to the one year swap.  There's nothing wrong with that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dealers don't use zero swaps to build curves.  They use eurodollar futures and par swap rates to build curves, then imply the zero swaps, just fyi.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-03-16T19:53:55.860" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24920" PostTypeId="2" ParentId="14204" CreationDate="2016-03-16T20:13:22.717" Score="2" Body="&lt;p&gt;Say the bond is at 105.  In a par asset swap, you are not really paying par for the bond.  You are paying 105 for the bond, and receiving 5 on an off-market swap, which is being discounted at Libor flat (or maybe Fed funds) by the dealer.  So you final spread is a sort of average of these two trades.  To contrast, in a proceeds-swap, the swap is on-market to start with, and drifts 5 points off-market by the maturity date, hence you increasingly lend to the dealer.  The different spreads are due to the differing amounts of &quot;investment&quot; in the swap part.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By either method, TIPS are cheap versus nominals on an asset swap basis, due to lower liquidity, and market supply and demand.  The only way to arbitrage it is to do back to back asset swaps, for which you will suffer a significant (say 15-20bp) repo differential on the bonds, hence removing most of the arbitrage in my experience.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-03-16T20:13:22.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24921" PostTypeId="2" ParentId="24914" CreationDate="2016-03-16T20:21:56.560" Score="2" Body="&lt;p&gt;Yes they did, in 2008.   On October 6, 2008 ISDA held a credit default auction with Fannie Mae and Freddie Mac as Reference Entities that defaulted.  The senior securities settled at about 91.5 and 94 respectively, if memory serves.  Hence there was very little loss given default.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-03-16T20:21:56.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24922" PostTypeId="2" ParentId="24918" CreationDate="2016-03-16T21:14:46.167" Score="9" Body="&lt;p&gt;The risk-neutral probability density function $q(.)$ is indeed given by&#xA;$$ q(S_T=s) = \frac{1}{P(0,T)} \frac{ \partial^2 C }{\partial K^2} (K=s,T) $$&#xA;where $P(0,T)$ figures the relevant discount factor. This is known as the Breeden-Litzenberger identity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because you do not observe a &lt;em&gt;continuum&lt;/em&gt; of call prices in practice, you can use a &lt;strong&gt;finite difference approximation&lt;/strong&gt; to estimate the second derivative. In your case, &lt;em&gt;because the strikes lie on a uniform grid&lt;/em&gt; (constant spacing, if not you should use a more general formula, see additional comments below), you can use&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{ \partial^2 C }{\partial K^2} (K=s,T) \approx \frac{ C(K=s-\Delta K,T) - 2 C(K=s,T) + C(K=s+\Delta K,T)}{ (\Delta K)^2 } $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is equivalent to forming a (normalised) butterfly around your target strike $K=s$. Hence if you have no arbitrage in your prices then your pdf should be positive, as you rightfully mention.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem here, is that you might observe some 'fictive' arbitrage opportunities... because you are dealing with &lt;strong&gt;last prices&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, with your data: &#xA;$$ q(S_T=10) = \frac{C(K=9,T)-2C(K=10,T)+C(K=11,T)}{1^2} = (4.75 - 2(3.68) + 2.52) &amp;lt; 0$$&#xA;which does not seem right, as you point out. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually, if you simply look at the call values for $K=\{21,22,23,24\}$, you'll see that the prices are not even monotonically decreasing, hence a clear vertical spread arbitrage opportunity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So yes, you do have the right formula, but you need to either&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Clean your input prices. You can look at techniques such as arbitrage free smoothing, but this goes beyond the scope of your question.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use a more reliable data source (e.g. when working with live prices such blatant arbitrage opportunities rarely persist due to the presence of arbitragers, plus there is usually a bid/ask spread).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Some clarifications required by the OP:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;A &lt;strong&gt;last price&lt;/strong&gt;, as the name indicates, figures the last price at which a certain security has traded before the market closed. Using this kind of prices can be dangerous. For instance, suppose we are a few seconds away from the market close and you observe a bunch of prices $C(K_1)$,...,$C(K_N)$, that allow  for no arbitrage opportunity. Now, someone wishes to trade $C(K_3)$ just before the market closes. Assume that, the price at which the trade is made would imply a butterfly arbitrage opportunity given the values of $C(K_1)$ and $C(K_2)$... well if the market closes just after his trade, no participant can actually do anything about the arbitrage opportunity that last participant created. In the &lt;em&gt;last prices&lt;/em&gt; displayed by the exchange, the arb opportunity will be present, although no one can could benefit from it in practice. This is what I meant by 'fictive' arbitrage.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$q(S_T = K)$ does &lt;strong&gt;not&lt;/strong&gt; represent the probability that $S_T$ will lie between strike $K-\Delta K$ and $K + \Delta K$. Rather, it should be understood in the infenitesimal sense. More specifically:&#xA;$$q(S_T = K) = \lim_{\Delta K\rightarrow 0} Prob[ K - \Delta K \leq S_T \leq K + \Delta K ]$$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In the first part of my answer, I wrote you &lt;strong&gt;could only use the formula I gave&lt;/strong&gt; (which also happens to be the one you mention in your original post), if you had a &lt;em&gt;constant spacing&lt;/em&gt; $\Delta K$ on your strikes grid. Here you don't have it. In that case you should rather use:&#xA;$$ \frac{ \partial^2 C }{\partial K^2} (K=s,T) \approx \frac{2 }{\Delta K^-(\Delta K^- + \Delta K^+)} C(K=s-\Delta K^-,T) - \left( \frac{2}{\Delta K^-(\Delta K^- + \Delta K^+)} + \frac{2}{\Delta K^+(\Delta K^- + \Delta K^+)} \right) C(K=s,T) + \frac{2 }{\Delta K^+(\Delta K^- + \Delta K^+)} C(K=s+\Delta K^+,T)$$&#xA;where $\Delta K^-$ is allowed to be different from $\Delta K^+$ (in case they are the same you fall back on the original formula for a uniform grid). Note that both formula are &lt;strong&gt;approximations&lt;/strong&gt;, the smaller $\Delta K$, the better they work.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Running this formula on your example should give (first column = strike price $K$, second column = last price $C(K,T)$, thrid column = $q(S_T=K)$)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;   85.0000   21.4100       NaN&#xA;   90.0000   16.6500   -0.0128&#xA;   92.5000   14.1500    0.0720&#xA;   95.0000   12.1000    0.0000&#xA;   97.5000   10.0500    0.0368&#xA;  100.0000    8.2300    0.0224&#xA;  105.0000    5.0100    0.0368&#xA;  110.0000    2.7100    0.0376&#xA;  115.0000    1.3500    0.0248&#xA;  120.0000    0.6100    0.0168&#xA;  125.0000    0.2900    0.0072&#xA;  130.0000    0.1500    0.0028&#xA;  135.0000    0.0800    0.0016&#xA;  140.0000    0.0500    0.0004&#xA;  145.0000    0.0300       NaN&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is still not totally satisfying (note that I took a unit discount factor, in the absence of relevant data).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would recommend &lt;strong&gt;using OTMF options only&lt;/strong&gt; for better results. That is, use call options for strikes $K \geq F(0,T)$ (where you see the pdf is relatively well behaved) and put options for strikes $K &amp;lt; F(0,T)$.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-05-09T08:23:08.963" LastActivityDate="2016-05-09T08:23:08.963" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="24923" PostTypeId="1" AcceptedAnswerId="24943" CreationDate="2016-03-16T22:21:21.380" Score="0" ViewCount="1179" Body="&lt;p&gt;Consider a two-period binomial model for a risky asset with each period equal to a year and take $S_0 = 1$, $u = 1.15$ and $l = 0.95$. The interest rate is $R = .05$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a.) If the asset pays 10% of its value as dividend in the first period and 20% in the second period, find the price of the ATM call option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b.) Consider a more complicated dividend strategy which pays 10% dividend only if the price moves up and no dividend if the price moves down at each period. Find the price of the ATM call option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Forgive me my professor can have many errors in his problems. I am not sure how to solve this problem and what ATM call option mean. We have never covered dividends in regards to binomial model. I need some help with this any suggestions is greatly appreciated. &lt;/p&gt;&#xA;" OwnerUserId="19002" LastActivityDate="2016-03-18T12:54:48.787" Title="Two-period binomial model with dividends" Tags="&lt;mathematics&gt;&lt;binomial-tree&gt;&lt;finance-mathematics&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24926" PostTypeId="1" AcceptedAnswerId="24930" CreationDate="2016-03-16T23:54:12.790" Score="0" ViewCount="173" Body="&lt;p&gt;Consider a two-period binomial model for a risky asset with each period equal to a year and take $S_0 = 1$, $u = 1.03$ and $l = 0.98$. How do you price a look-back option with payoff($\max_{t=0,1,2}S_t - 1)_{+}$? Hint: The price is path dependent and each path has a payoff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't understand this question at all, any suggestions is greatly appreciated&lt;/p&gt;&#xA;" OwnerUserId="19002" LastActivityDate="2016-03-17T08:24:55.737" Title="two-period binomial model, with price that is path-dependent" Tags="&lt;mathematics&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24927" PostTypeId="1" AcceptedAnswerId="24932" CreationDate="2016-03-17T01:09:47.407" Score="2" ViewCount="736" Body="&lt;p&gt;Write the payoffs in Figure 3.8 as linear combination of call options and derive a closed form formula for the Black-Scholes price, the Delta, and the Gamma of them. All the Greeks of the option are also linear combination of these call option Greeks. For instance, $$\Delta(t,S) = \Phi(d_1(\tau,K_1,S)) - \Phi(d_1(\tau,K_2,S)) - \Phi(d_1(\tau,K_3,S)) + \Phi(d_1(\tau,K_4,S))$$&lt;a href=&quot;https://i.stack.imgur.com/A8Vrj.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/A8Vrj.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Partial Solution: For the strangle we have a pay off of $$(K - S_T)_{+} + (S_T - K)_{+}$$ Therefore the closed form solution of B-S price of option is $$V(\tau,S) = P(\tau,K,S) + C(\tau,K,S)$$ and the delta of the position is $$\Delta(\tau,S) = -\Phi(-d_1(\tau,K,S)) + \Phi(d_1(\tau,K,S))$$ Finally our gamma for this position is $$\Gamma(\tau,S) = \frac{\Phi'(d_1(\tau,K,S)) + \Phi'(d_1(\tau,K,S))}{S\sigma \sqrt{\tau}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess my professor made a mistake in regards to the B-S closed form price: for the strange it is $$V(\tau,S) = (-S_0\Phi(-d_1) + e^{-rT}K\Phi(-d_2)) + (S_0\Phi(d_1) - e^{-rT}K\Phi(d_2))$$ and similar for the straddle&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\tau = T - t$ not sure why we use $\tau$ any explanation of that would be great. &lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="19002" LastEditDate="2016-04-24T18:34:31.783" LastActivityDate="2016-04-24T18:34:31.783" Title="Linear combination of Payoffs using Black-Scholes" Tags="&lt;black-scholes&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="22" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24928" PostTypeId="1" AcceptedAnswerId="24933" CreationDate="2016-03-17T01:11:35.230" Score="0" ViewCount="609" Body="&lt;p&gt;Write the following payoffs as linear combination of call options&#xA;with different strikes and possibly some cash and give the closed form formula for them.&lt;a href=&quot;https://i.stack.imgur.com/vQPDA.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/vQPDA.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Attempted solution: The payoff for the bear spread is $$(K_2 - S_T)^{+} - (K_1 - S_T)^{+}$$ Therefore our closed form solution for the B-S price is $$V(\tau,S) = P(\tau,K_2,S) - P(\tau,K_1,S) $$ The payoff for the bull spread is $$(S_T - K_1)^{+} - (S_T - K_2)^{+}$$ Therefore our closed form solution for the B-S price is $$V(\tau,S) = C(\tau,K_1,S) - C(\tau,K_2,S)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was told the closed form B-S price is incorrect but my professors lecture notes say otherwise: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/yvJx8.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/yvJx8.jpg&quot; alt=&quot;professors example&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="19002" LastEditDate="2016-03-18T02:37:35.683" LastActivityDate="2016-03-18T12:44:15.850" Title="Linear combination of payoffs of bull and bear spreads" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;" AnswerCount="3" CommentCount="13" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24929" PostTypeId="2" ParentId="24928" CreationDate="2016-03-17T02:04:36.843" Score="0" Body="&lt;p&gt;Think like this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Start with a long call option for K1. This would give you a payoff reflected at K1.&lt;/li&gt;&#xA;&lt;li&gt;Short some cash to move the payoff vertically down.&lt;/li&gt;&#xA;&lt;li&gt;Short a call option for K2. The payoff of this short option will offset the payoff of your long call option for &lt;code&gt;&amp;gt;K2&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You can visualize this portfolio should give you the payoff for bull spread call. The other payoff is similar.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2016-03-17T02:04:36.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24930" PostTypeId="2" ParentId="24926" CreationDate="2016-03-17T08:01:49.233" Score="1" Body="&lt;p&gt;For a standard European option (i.e. non path - dependent payoff):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V_0 = \frac {1}{1+R} E [ V (S_T) ] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because, in a 2 period binomial tree, the terminal stock price $S_T$ can take 3 distinct values: $S_{uu}=S_0u^2$, $S_{ul}=S_0ul$ and $S_{ll}=S_0l^2$, you can write the expectation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V_0 = \frac {1}{1+R} (q_{u}^2 V (S_{uu}) + {\color {red}{2}} q_u q_l V ( S_{ul} )+ q_l^2 V (S_{ll}))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With $q_u $ and $q_l $ figuring risk-neutral probabilities of an up/low move over a period:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$q_u = \frac{(1+R) -l}{u-l}$$&#xA;$$q_l = 1-q_u $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the terminal option values  $V (S_{uu})$, $V (S_{ul})$, $V (S_{ll})$ can be determined through the payoff function, for instance&#xA;$$ V (S_T) = \max ( S_T - K , 0 ) $$ &#xA;for a call option.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For a path dependent option it's almost the same, except $V (.) $ is now a function of the whole path $\{S_0,S_{T-1}, S_T\}$, not just $S_T $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V_0 = \frac {1}{1+R} E [ V (S_0,S_{T-1},S_T) ] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because, in a 2 period binomial tree, you have 4 possible paths: up/up, up/low, low/up, low/low, you can write the expectation as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V_0 = \frac {1}{1+R} (q_{u}^2 V (S_0, S_u,  S_{uu}) + q_u q_l V ( S_0, S_u, S_{ul} ) + q_l q_u V ( S_0, S_l, S_{ul} ) + q_l^2 V (S_0, S_l,  S_{ll}))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With, as given in the text:&#xA;$$ V (S_0, S_{T-1},  S_T) = \max ( \max ( S_0, S_{T-1}, S_T) - K, 0) $$&#xA;for a call with lookback feature.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note how in the non path - dependent case the paths up/low and low/up both finish with the same stock value, hence can be aggregated, hence the factor $ {\color {red}{2}}$.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-03-17T08:24:55.737" LastActivityDate="2016-03-17T08:24:55.737" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24932" PostTypeId="2" ParentId="24927" CreationDate="2016-03-17T15:12:06.047" Score="2" Body="&lt;p&gt;To express such payoff in mathematical form, it is better to use indicator functions. I assume that the bottom of graphs (i.e., the vertex for the left one and the bottom segment for the right side one) represents zero. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the left-hand one, the payoff is given by&#xA;\begin{align*}&#xA;(K-S_T)\pmb{1}_{S_T \le K} + (S_T-K)\pmb{1}_{S_T \ge K} = (K-S_T)^+ + (S_T-K)^+,&#xA;\end{align*}&#xA;that is, a straddle that involves both a European call and put with the same strike price and maturity date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the right-hand one,  the payoff is given by&#xA;\begin{align*}&#xA;(K_1-S_T)\pmb{1}_{S_T \le K_1} + (S_T-K_2)\pmb{1}_{S_T \ge K_2} = (K_1-S_T)^+ + (S_T-K_2)^+,\tag{1}&#xA;\end{align*}&#xA;that is, a strangle that involves both a European call and put with the same  maturity date, but different strikes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For valuation, as an example, let's consider (1). According to the Black-Scholes' formula, the value of Payoff (1) is given by&#xA;\begin{align*}&#xA;V=\Big[K_1 e^{-rT} \Phi(-d_2^1) - S_0 \Phi(-d_1^1)\Big] + \Big[S_0 \Phi(d_1^2) - K_2 e^{-rT} \Phi(d_2^2)\Big],&#xA;\end{align*}&#xA;where the first term is the value of the put option payoff $(K_1-S_T)^+$ and the second is the value of the call option payoff $(S_T-K_2)^+$. Here,&#xA;\begin{align*}&#xA;d_1^1 &amp;amp;= \frac{\ln \frac{S_0}{K_1} + (r+\frac{1}{2}\sigma^2)T}{\sigma \sqrt{T}},\\&#xA;d_2^1 &amp;amp;= d_1^1 - \sigma \sqrt{T},\\&#xA;d_1^2 &amp;amp;= \frac{\ln \frac{S_0}{K_2} + (r+\frac{1}{2}\sigma^2)T}{\sigma \sqrt{T}},\\&#xA;d_2^2 &amp;amp;= d_1^2 - \sigma \sqrt{T}.\\&#xA;\end{align*}&#xA;The delta hedge ratio is the sum of deltas of the first put option and the second call options, that is,&#xA;\begin{align*}&#xA;\frac{\partial V}{\partial S_0} &amp;amp;= -\Phi(-d_1^1) + \Phi(d_1^2)\\&#xA;&amp;amp;=\Phi(d_1^1) + \Phi(d_1^2) - 1,&#xA;\end{align*}&#xA;and the gamma hedge ratio is the sum of gammas of the first put option and the second call options, that is,&#xA;\begin{align*}&#xA;\frac{\partial^2 V}{\partial S_0^2} &amp;amp;= \frac{\Phi'(d_1^1)}{S_0\sigma \sqrt{T}}+ \frac{\Phi'(d_1^2)}{S_0\sigma \sqrt{T}}\\&#xA;&amp;amp;=\frac{\Phi'(d_1^1) + \Phi'(d_1^2)}{S_0\sigma \sqrt{T}}.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-03-17T20:55:19.463" LastActivityDate="2016-03-17T20:55:19.463" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="24933" PostTypeId="2" ParentId="24928" CreationDate="2016-03-17T15:58:57.250" Score="1" Body="&lt;p&gt;Here, we assume that the bottom is zero and the top is $K_2-K_1$. Then, in mathematical form, the ${\color{blue} {blue}}$ option payoff is given by&#xA;\begin{align*}&#xA;&amp;amp; \ (K_2-K_1)\pmb{1}_{S_T \le K_1} + (K_2-S_T)\pmb{1}_{K_1 &amp;lt; S_T \le K_2} \\&#xA;=&amp;amp; \ (K_2-K_1)\pmb{1}_{S_T \le K_1} + (K_2-S_T)\left(\pmb{1}_{S_T \le K_2} - \pmb{1}_{S_T \le K_1}\right)\\&#xA;=&amp;amp; \ (K_2-S_T)\pmb{1}_{S_T \le K_2}+\big[(K_2-K_1) - (K_2-S_T) \big]\pmb{1}_{S_T \le K_1}\\&#xA;=&amp;amp; \ (K_2-S_T)^+ - (K_1-S_T)^+ ,\tag{1}&#xA;\end{align*}&#xA;that is, a put spread. Note that, this option can also be replicated with a zero-coupon bond and a call spread:&#xA;\begin{align*}&#xA;&amp;amp; \ (K_2-K_1)\pmb{1}_{S_T \le K_1} + (K_2-S_T)\pmb{1}_{K_1 &amp;lt; S_T \le K_2} \\&#xA;=&amp;amp; \ (K_2-K_1)\left(1-\pmb{1}_{S_T \ge K_1} \right)+ (K_2-S_T)\left(\pmb{1}_{S_T \ge K_1} - \pmb{1}_{S_T \ge K_2}\right)\\&#xA;=&amp;amp; \ (K_2-K_1) + \big[(K_2-S_T) - (K_2-K_1) \big]\pmb{1}_{S_T \ge K_1} +(S_T-K_2)\pmb{1}_{S_T \ge K_2}\\&#xA;=&amp;amp; \ (K_2-K_1) +(S_T-K_2)^+ - (S_T-K_1)^+.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the ${\color{red} {red}}$ option payoff, the approach is the same.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;EDIT:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The price of Payoff (1) is given by&#xA;\begin{align*}&#xA;put(K_2) - put(K_1).&#xA;\end{align*}&#xA;Note that this price is 'not necessarily the Black-Scholes' price', as Black-Scholes' price has a particular form. In particular, in the Black-Scholes' pricing framework, we assume that the underlying equity price process $\{S_t \mid t \ge 0\}$ satisfies, under the risk-neutral probability measure, an SDE of the form&#xA;\begin{align*}&#xA;dS_t/S_t = rdt + \sigma dW_t,&#xA;\end{align*}&#xA;where $\{W_t \mid t \ge 0\}$ is a standard Brownian motion. Then,&#xA;\begin{align*}&#xA;put(K_1) &amp;amp;= K_1 e^{-rT} \Phi(-d_2^1) - S_0 \Phi(-d_1^1)\\&#xA;put(K_2) &amp;amp;= K_2 e^{-rT} \Phi(-d_2^2) - S_0 \Phi(-d_1^2),&#xA;\end{align*}&#xA;where&#xA;\begin{align*}&#xA;d_1^1 &amp;amp;= \frac{\ln \frac{S_0}{K_1} + (r+\frac{1}{2}\sigma^2)T}{\sigma \sqrt{T}},\\&#xA;d_2^1 &amp;amp;= d_1^1 - \sigma \sqrt{T},\\&#xA;d_1^2 &amp;amp;= \frac{\ln \frac{S_0}{K_2} + (r+\frac{1}{2}\sigma^2)T}{\sigma \sqrt{T}},\\&#xA;d_2^2 &amp;amp;= d_1^2 - \sigma \sqrt{T}.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-03-18T12:44:15.850" LastActivityDate="2016-03-18T12:44:15.850" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24934" PostTypeId="1" CreationDate="2016-03-17T17:46:22.230" Score="1" ViewCount="208" Body="&lt;p&gt;&lt;strong&gt;Delta of an option is defined as ratio of change in price of call option to change in price of underlying securities&lt;/strong&gt;. If, $c_t$ is call option price at time $t$ and $S_t$ is the price of underlying securities, then the delta of call option is: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta(t)=\frac{\partial c_t}{\partial S_t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If &lt;strong&gt;change in $dS_t$ ie $(S_{t+dt} -S_t)$ is random&lt;/strong&gt;, which by definition is true, then &lt;strong&gt;delta ($\Delta (t)$, computed at time t) must be random variable (instead of known constant)&lt;/strong&gt; as it involve $dS_t$ in denominator.  But under the &lt;strong&gt;Black-Scholes model&lt;/strong&gt;, the delta of European of Call option (which is written as $N(d_1)$ or $\Phi (d_2)$) is deterministic variable (ie known with certainty) at time $t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;I want to know why delta of a call option is deterministic quantity, why not it is random variable?&lt;/strong&gt; If possible, please provide both logical reasoning and formal derivation.&lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="16991" LastEditDate="2016-03-18T07:47:47.147" LastActivityDate="2016-03-18T07:47:47.147" Title="Why not delta of Call option is stochastic or random variable?" Tags="&lt;black-scholes&gt;&lt;greeks&gt;&lt;delta&gt;" AnswerCount="2" CommentCount="11" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24935" PostTypeId="2" ParentId="24934" CreationDate="2016-03-17T17:57:58.460" Score="3" Body="&lt;p&gt;Note that, at time $t$,&#xA;\begin{align*}&#xA;d_1(t) = \frac{\ln \frac{S_t}{K} + (r+\frac{\sigma^2}{2}) (T-t)}{\sigma \sqrt{T-t}},&#xA;\end{align*}&#xA;which is a function of $S_t$, and then, it is a random quantity. Consequently, the delta $N(d_1(t))$ is also a random quantity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that, at time $t$, $N(d_1(t))$ is known. However, $\{N(d_1(t)) \mid t \ge 0\}$ is a stochastic process adapted to the filtration of the equity process $\{S_t \mid t \ge 0\}$, that is, $\mathcal{F}_t$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-03-17T20:07:06.443" LastActivityDate="2016-03-17T20:07:06.443" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="24936" PostTypeId="2" ParentId="24934" CreationDate="2016-03-17T18:31:29.410" Score="3" Body="&lt;p&gt;Since we are dealing with the change in the value of the call option in relation to the change in the value of the stock price, we are looking at the simple slope of the function. We do not need to know how much the stock price will change in order to estimate the slope. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the absence of gamma, the stock price could change 2% or 1% and this wouldn't change the delta. Let's say we have a simple equation, y = mx + b. m is the impact that a change in x has on the change in y, which is the same idea behind delta. If we know how y responds to changes in x, we can deterministically define m and it is not a random variable.&lt;/p&gt;&#xA;" OwnerUserId="19089" LastActivityDate="2016-03-17T18:31:29.410" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24937" PostTypeId="2" ParentId="24766" CreationDate="2016-03-17T19:34:25.620" Score="4" Body="&lt;p&gt;Draw a picture. For each scenario, there are obvious circumstances that the payoff for each would be better. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the N day option, the payoff would be better if there was a slow gradual decline in price and a slow gradual increase over the same period, such that the final difference in the price of the underlying was largely unchanged. For multiple options issued over that period, at expiration, there would be several options that would need to pay off, so that would be worse. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the event of quick downward and upward movements, I'm unable to say which would be better. The multiple options would benefit from increased premium from higher implied volatilities, but will be further out of the money. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the event of a slow decreasing or increasing underlying price, the multiple options would benefit from strike prices that are struck at different levels and therefore, the overall volatility of the strategy would be lower than just selling one option. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will find that if you look at these strategies using historical prices, the multiple options will have a lower return, but the decrease in volatility will push the information ratio of the strategy higher than the individual sale. Given you are selling options, and depending on your cash coverage requirements, this could mean that, for the same volatility, you can put on a larger position in the second scenario and have a larger return than the first.&lt;/p&gt;&#xA;" OwnerUserId="19089" LastEditorUserId="19089" LastEditDate="2016-03-17T19:41:40.920" LastActivityDate="2016-03-17T19:41:40.920" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24939" PostTypeId="1" AcceptedAnswerId="24940" CreationDate="2016-03-17T21:44:43.473" Score="0" ViewCount="216" Body="&lt;p&gt;I was curious if there was any references to replicating option strategies i.e. bull spread, bear spread, butterfly, strangle, straddle, etc...? Also what is the insight into replicating of these strategies. I know we would use a zero coupon bond and invest in a risky asset or something of that regard. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions is greatly appreciated. &lt;/p&gt;&#xA;" OwnerUserId="19002" LastActivityDate="2016-03-18T05:30:46.277" Title="Replicating option strategies" Tags="&lt;mathematics&gt;&lt;option-strategies&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24940" PostTypeId="2" ParentId="24939" CreationDate="2016-03-17T21:54:36.800" Score="1" Body="&lt;p&gt;All these strategies can indeed be synthesised using simple instruments such as zero coupon bonds and European vanilla options (such as call and puts).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some info can be found here &lt;a href=&quot;http://www.investopedia.com/slide-show/options-strategies/&quot; rel=&quot;nofollow&quot;&gt;http://www.investopedia.com/slide-show/options-strategies/&lt;/a&gt;... although many other sites can provide relevant information, e.g. this one &#xA;&lt;a href=&quot;http://optioncreator.com/long-butterfly&quot; rel=&quot;nofollow&quot;&gt;http://optioncreator.com/long-butterfly&lt;/a&gt;, which along with providing a definition, lets you analyse the decomposition, payoff and price in a BS framework.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Never forget that Google is your friend.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-03-18T05:30:46.277" LastActivityDate="2016-03-18T05:30:46.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24941" PostTypeId="1" CreationDate="2016-03-17T22:46:37.383" Score="1" ViewCount="110" Body="&lt;p&gt;My current test is to take monthly proportional price changes for stock XYZ and subtract out the proportional changes of the S&amp;amp;P500. Then compare the mean of a sample of XYZ-S&amp;amp;P (e.g. trailing 12 months) to the mean of the population (48 months preceding the sample). The test is too stringent, as I can not show significant difference even when cherry-picking stocks that are going gangbusters. The method described is derived from a book where the author uses a 6-month interval and data spanning decades.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want my test to identify significant changes in stock price on a shorter time scale. Can you give me some guidance? Your insights are greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="19938" LastActivityDate="2016-03-17T22:46:37.383" Title="What is a good statistical test on stock prices to indicate a company's value has changed?" Tags="&lt;equities&gt;&lt;data&gt;&lt;statistical-significance&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="24942" PostTypeId="2" ParentId="24928" CreationDate="2016-03-18T00:32:44.297" Score="0" Body="&lt;p&gt;Let's look at the blue case, bear spread call.&#xA;Since it starts with a constant, then you need some cash.&#xA;Also we need to assume, say bear call spread, the constant parts are $(K_1 + K_2)/2$ and $-(K_1 + K_2)/2$ at both ends (technically makes the slope be 1 in middle of the function).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the call option as following&#xA;$$&#xA;C_{\text{bear}} = \frac{(K_2 - K_1)}{2} - (S_T - K_1)_+ + (S_T - K_2)_+&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The red curve is pretty much the same as blue one, just as following&#xA;$$&#xA;C_{\text{bull}} = -\frac{(K_2 - K_1)}{2} + (S_T - K_1)_+ - (S_T - K_2)_+&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="19653" LastActivityDate="2016-03-18T00:32:44.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24943" PostTypeId="2" ParentId="24923" CreationDate="2016-03-18T01:40:44.503" Score="1" Body="&lt;p&gt;(a)&#xA;First of all, ATM means strike price $K=S_0$.&#xA;By the end of second period, the risky asset has values (from top to down)&#xA;$S_0 u^2 (1-d_1) (1-d_2)=0.95$, $S_0 ul (1-d_1) (1-d_2)=0.79$ and $S_0 l^2 (1-d_1) (1-d_2)=0.65$. The risk neutral probabilities are calculated as&#xA;$\hat{\pi}_u=(1+R-l)/(u-l)=1/2$ and $\hat{\pi}_l=(u-R-1)/(u-l)=1/2$.&#xA;Hence three stages have probabilities 1/4, 1/2 and 1/4 respectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The option is determined by the terminal price&#xA;$$&#xA;V(S_T)=(S_T-K)_+&#xA;$$&#xA;However, if $K=S_0=1$, then $V(S_T)=0$ for sure. Then price of the ATM call will be&#xA;$$&#xA;C=\frac{1}{(1+R)^2} \hat{E}(V(S_T))=0.&#xA;$$&#xA;If you change $K=0.8$, then&#xA;$$&#xA;C=\frac{1}{(1+R)^2} \hat{E}(V(S_T))= \frac{1}{4}(0.95-0.8) + \frac{1}{2}0 + \frac{1}{4}0.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(b)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Terminal stages are&#xA;$S_0 u^2 (1-d)^2=0.93$, $S_0 u l (1-d)=0.98$ and $S_0 l^2=0.9$.&#xA;Neutral probabilities won't change.&#xA;Just repeat steps in part (a) you will get zero for $K=S_0$ and a nonzero price for $K=0.8$.&lt;/p&gt;&#xA;" OwnerUserId="19653" LastActivityDate="2016-03-18T01:40:44.503" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="24944" PostTypeId="1" AcceptedAnswerId="24947" CreationDate="2016-03-18T01:55:41.897" Score="0" ViewCount="407" Body="&lt;p&gt;I am not a quant geek.I always have doubt  what should be the VaR output for portfolio contains long and short of the same maturity @ same traded price. e.g. CME corn future of sept expiry &lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Groundwork&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I was using the full revaluation with PnL approach at 95 percentile. The output was coming as zero.&lt;/p&gt;&#xA;" OwnerUserId="12126" LastActivityDate="2016-03-18T09:09:56.987" Title="Value At Risk for Long and short position with same maturity and same traded price" Tags="&lt;var&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24945" PostTypeId="2" ParentId="24544" CreationDate="2016-03-18T01:56:25.617" Score="1" Body="&lt;p&gt;Thanks for everybody answering my question!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my understanding.&#xA;If a process $\Delta(t)$ is nonrandom, then one could tell what the values will be for all time $t$ when one is standing at $t=0$. On the other hand, if such process is random, then one stands at $t=0$ he cannot see anything in the future. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, the randomness of a simple process are crucial when one takes expectation on it. Say, a simple process $\Delta(t)$ is nonrandom, then one could take out of what is known $E(\Delta(t))=\Delta(t)$. The rule fails if such process is random.&lt;/p&gt;&#xA;" OwnerUserId="19653" LastEditorUserId="19653" LastEditDate="2016-03-18T15:55:17.383" LastActivityDate="2016-03-18T15:55:17.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24947" PostTypeId="2" ParentId="24944" CreationDate="2016-03-18T07:51:27.417" Score="1" Body="&lt;p&gt;If your portfolio has both long and short position, it means it is completely hedge. Under such scenario, VaR would become zero, as there is no risk involve in portfolio. &lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2016-03-18T07:51:27.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24948" PostTypeId="2" ParentId="24944" CreationDate="2016-03-18T09:09:56.987" Score="1" Body="&lt;p&gt;VaR is a method for simulating value of your future portfolio. If your portfolio is always zero, this is like not investing anything. Thus, there's no risk and VaR must always be zero. &lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2016-03-18T09:09:56.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24949" PostTypeId="1" CreationDate="2016-03-18T09:55:50.313" Score="3" ViewCount="1460" Body="&lt;p&gt;It seems there is not a universal rule on how should the timestamps of candlestick data be set. I have the impression that using a timestamp on open is more common (i.e.: a 1-Minute candle with a timestamp at 00:00:00 would be open until a new tick is received at, at least, 00:01:00).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, there seems to be software that generates candlestick data with the timestamp on close. See for instance &lt;a href=&quot;https://ninjatrader.com/support/helpGuides/nt7/?how_bars_are_built.htm&quot; rel=&quot;nofollow&quot;&gt;the NinjaTrader docs&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;NinjaTrader stamps a bar with the closing time of the bar. For&#xA;  example, a minute bar with a time of 9:31:00 AM has data from 9:30:00&#xA;  AM through 9:30:59 AM. Using end of bar time stamps is required in&#xA;  order to be able to plot multiple series of differing time frames&#xA;  within a single chart all accurately synchronized to time.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What are the advantages/disadvantages of each method? Why Ninja considered on-close to be better while it seems that most others are using on-open? What would you recommend?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;References&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Timestamp on open:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.interactivebrokers.com/en/software/api/apiguide/java/historicaldata.htm&quot; rel=&quot;nofollow&quot;&gt;InteractiveBrokers&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://docs.mql4.com/series&quot; rel=&quot;nofollow&quot;&gt;Metatrader&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://developer.oanda.com/&quot; rel=&quot;nofollow&quot;&gt;Oanda&lt;/a&gt; (not documented or I did not find it, but I know from experience)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Timestamp on close:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://ninjatrader.com/support/helpGuides/nt7/?how_bars_are_built.htm&quot; rel=&quot;nofollow&quot;&gt;Ninjatrader&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7997" LastEditorUserId="7997" LastEditDate="2016-03-19T23:26:41.080" LastActivityDate="2016-03-21T13:59:22.110" Title="Candlesticks: timestamp on open versus close" Tags="&lt;data&gt;&lt;market-data&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24950" PostTypeId="2" ParentId="24923" CreationDate="2016-03-18T12:54:48.787" Score="0" Body="&lt;p&gt;I did the calculations, and actually both current answers seem wrong... can someone confirm or point towards any mistake in the following reasoning?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I claim to show is that: you can use a &lt;strong&gt;standard&lt;/strong&gt; stock price tree (i.e. the terminal values of the stock price do not involve the dividend yield and write $S_0 u^2$, $S_0 ul$ and $S_0 l^2$), &lt;strong&gt;but&lt;/strong&gt; your risk-neutral probabilities will depend on the dividend yield $Y$.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In &lt;strong&gt;Exercise A&lt;/strong&gt;, this can be seen by writing the replicating portfolio: $\Pi = \Delta S + B$, which by the end of a period should satisfy&#xA;$$\Pi_u = \Delta S_u + \beta (1 + R) + {\color{red}{\Delta S_u Y}} = V_u$$&#xA;$$\Pi_d = \Delta S_d + \beta (1 + R) + {\color{red}{\Delta S_d Y}} = V_d$$&#xA;Where the additional terms come from the proportional dividend payments that are reinvested in the cash account at the end of each period. These equations are equivalent to&#xA;$$\Delta S_u (1 + Y) + \beta (1 + R) = V_u$$&#xA;$$\Delta S_d (1 + Y)+ \beta (1 + R) = V_d$$&#xA;Solving them yields to (it is as if $u$ and $d$ in the standard formulae were replaced by $u(1+Y)$ and $d(1+Y)$&#xA;$$ q_u = \frac{ \frac{1+R}{1+Y} - d}{u - d} $$&#xA;$$ q_l = 1 - q_u $$&#xA;This result seems consistent with many papers. Even Wikipedia exhibits something similar with&#xA;$$ q_u = \frac{e^{(r-q)\Delta t} - d}{u -d} $$&#xA;Plus, it is straightforward to show that these probabilities provide the right forward price if you evaluate $F(0,t)=E[S(t)]=qS_u+(1-q)S_d=S_0(1+R)/(1+Y)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet, because $(1+R)/(1+Y)$ here is smaller than $d$ on the second period, I doubt that this problem is feasible at all.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In &lt;strong&gt;Exercise B&lt;/strong&gt;, using the same rationale I end up with&#xA;$$\Delta S_u + \beta (1 + R) + {\color{red}{\Delta S_u Y}} = V_u$$&#xA;$$\Delta S_d + \beta (1 + R) = V_d$$&#xA;and &#xA;$$ q_u = \frac{ 1+R - d}{u(1+Y) - d} $$&#xA;$$ q_l = 1 - q_u $$&#xA;and now the problem indeed seems feasible (no negative probabilities). But this is never a question of the strike contrary to what the OP's professor claims.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2016-03-18T12:54:48.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24951" PostTypeId="1" CreationDate="2016-03-18T13:58:08.263" Score="0" ViewCount="179" Body="&lt;p&gt;I am currently working on a paper related to portfolio optimization. As of this moment, I am considering to use a dataset consisting of the following indices:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;MSCI World&lt;/li&gt;&#xA;&lt;li&gt;MSCI Emerging Markets&lt;/li&gt;&#xA;&lt;li&gt;SP GSCI&lt;/li&gt;&#xA;&lt;li&gt;BofA U.S Gov (all maturities)&lt;/li&gt;&#xA;&lt;li&gt;BofA HY 100&lt;/li&gt;&#xA;&lt;li&gt;FTSE REIT&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The challenge that I am against is that I need monthly data of the total market cap of these indices. For some reason, I cannot access this data for e.g. MSCI World and MSCI Emerging markets as my university seems to not have the highest level of subscription to the Datastream-services. As this data is crucial for my work, I am turning to you guys. Do you have any advice or recommendations on how I can access monthly market cap data of these indices? Does this data even exist on services such as Bloomberg?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need it in order to create a benchmark (value-weighted) market portfolio of a multi-asset universe. If you have any other recommendations, e.g. an index that mimics a global market portfolio consisting of various asset classes (bonds, equity, commodity) that I can use as an benchmark: then please feel free to comment on such an index. (I need it for estimating returns via CAPM).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="19949" LastActivityDate="2016-03-18T15:09:00.567" Title="Monthly market value data of indices: where to get?" Tags="&lt;historical-data&gt;&lt;capm&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24952" PostTypeId="1" AcceptedAnswerId="24982" CreationDate="2016-03-18T14:21:28.793" Score="0" ViewCount="299" Body="&lt;p&gt;Markowitz portfolio with L1 norm regularization added L1 norm regularization based on the original model. The constraint equation is as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/p5jPZ.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/p5jPZ.jpg&quot; alt=&quot;The_constraint_equation&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following code is the original Markowitz Mean-Variance model in matlab.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ExpReturn = [0.1 0.2 0.15];&#xA;&#xA;ExpCovariance = [ 0.0100   -0.0061    0.0042&#xA;                 -0.0061    0.0400   -0.0252&#xA;                  0.0042   -0.0252    0.0225];&#xA;NumPorts = 4;&#xA;&#xA;[PortRisk, PortReturn, PortWts] = frontcon(ExpReturn,ExpCovariance, NumPorts)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have just started with Matlab and I don't know how to solve it in matlab.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or is there any matlab code/toolbox to solve it? thank you!&lt;/p&gt;&#xA;" OwnerUserId="19950" LastEditorUserId="19950" LastEditDate="2016-03-19T03:15:30.580" LastActivityDate="2016-03-20T18:45:58.200" Title="L1 norm regularization of Markowitz portfolio in matlab" Tags="&lt;finance&gt;&lt;portfolio&gt;&lt;matlab&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24954" PostTypeId="1" CreationDate="2016-03-18T14:28:40.123" Score="0" ViewCount="477" Body="&lt;p&gt;So I understand that BBSW is the reference rate used in AUD swap transactions since AUD LIBOR has been discontinued. If I want to build a curve out of the reference rates used to price AUD swaps, I can use the BBSW rates for maturities ranging from 1 day to 12 months, but what is the correct reference rate for maturities past 1 year? There is no BBSW rate for a 3 year maturity for example. What is the AUD BBSW analogue to a 5 year LIBOR or 10 year LIBOR rate?&lt;/p&gt;&#xA;" OwnerUserId="17712" LastActivityDate="2016-03-18T16:41:25.713" Title="AUD Swap Reference Rate?" Tags="&lt;interest-rates&gt;&lt;libor&gt;&lt;benchmark&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24955" PostTypeId="2" ParentId="24951" CreationDate="2016-03-18T15:09:00.567" Score="1" Body="&lt;p&gt;If you have Bloomberg (particularly the Excel API), that's my recommendation. You can use the bdh function to look up the historical data points. Particularly, for the MSCI World Index, you would use:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;=BDH(&quot;MXWO INDEX&quot;,&quot;INDX_MARKET_CAP&quot;,&quot;1/31/2001&quot;,&quot;12/31/2015&quot;,&quot;Period&quot;,&quot;M&quot;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For monthly data starting that the beginning of 2001 and going to the end of this past year as an example. I assume you can find the Bloomberg tickers for the other indices. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or, is this the data that your university does not have access to?&lt;/p&gt;&#xA;" OwnerUserId="19089" LastActivityDate="2016-03-18T15:09:00.567" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24956" PostTypeId="1" CreationDate="2016-03-18T15:16:50.390" Score="0" ViewCount="2937" Body="&lt;p&gt;Suppose we have a stock with current price $S(0)=X$ and the interest rate is zero. When the stock reaches level $\$ H$ for the first time ($H&amp;gt;X$), the option can be exercised and its payoff is $\$ X$. What is the current price of such option?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have realized that this is an example of an American binary call option, of the type &quot;cash or nothing&quot;. Furthermore, the interest rate is zero, which should simplify things. However, it seems clear to me that for such American binary option, the rule that European call is worth as American call, valid for vanilla options, is not valid anymore: this American binary option should definitely carry more rights than its European counterpart. Does anybody know how to price such an option? Thanks. PS in the problem it is not specified the time to maturity.  &lt;/p&gt;&#xA;" OwnerUserId="11960" LastActivityDate="2016-03-18T15:16:50.390" Title="Binary American Call Option (Cash or Nothing)" Tags="&lt;option-pricing&gt;&lt;american-options&gt;&lt;binary-options&gt;" AnswerCount="0" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24957" PostTypeId="2" ParentId="24954" CreationDate="2016-03-18T16:41:25.713" Score="2" Body="&lt;p&gt;A 5 year AUD swap, for example, references a short term rate such as 3month BBSW.  There is no such thing as 5 year BBSW or 5 year AUD Libor.   The maturity of an interest rate swap is not the same thing as the maturity of its reference rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is that what you were asking?&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-03-18T16:41:25.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24958" PostTypeId="1" CreationDate="2016-03-18T18:42:15.513" Score="0" ViewCount="714" Body="&lt;p&gt;A couple questions regarding the use of Kalman filtering in estimating parameters of short rate models:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) In &lt;a href=&quot;http://cirano.qc.ca/pdf/publication/95s-44.pdf&quot; rel=&quot;nofollow&quot;&gt;Duan &amp;amp; Simonato (1995)&lt;/a&gt;, which seems to be one of the earliest applications of the Kalman filter to short rate models, they state on page 5,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;To deal with the estimation problem, it is reasonable to assume that the yields for different maturities are observed with errors of unknown magnitudes&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Note yields are the output of the observation equation.  Mathematically, they mean the yield $R$ at time $t$ for a $T$-bond may be written as&#xA;$$&#xA;R_t(r_t, T) = -\frac{1}{T-t} \ln P_t(r_t,T) + \epsilon_t, \qquad (1)&#xA;$$&#xA;where $r_t$ is the short rate value (the output of the state equation) at time $t$ and $\epsilon_t$ is the &quot;error of unknown magnitude.&quot;  &lt;strong&gt;Why is there an error term?&lt;/strong&gt;  The relationship (1) without the $\epsilon_t$ is simply the definition of the yield.  Are we supposed to assume the &quot;error&quot; represents things like illiquidity or quotes with finite decimals?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) With the exception of the Vasicek model, most short rate models are non-Gaussian.  In filtering parlance, the conditional distribution of the current state given the past states is non-Gaussian.  How is Kalman filter justified in this case, given it assumes both the state and the observation equations are Gaussian?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2016-03-18T20:00:18.327" Title="Kalman Filter in Interest Rate Models" Tags="&lt;interest-rates&gt;&lt;parameter-estimation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24959" PostTypeId="2" ParentId="24958" CreationDate="2016-03-18T19:23:18.293" Score="1" Body="&lt;p&gt;There are two cases depending on what P is in your formula. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;P is the market price of the bond: There exists an idealized, true but unobserved yield curve, but we observe bonds that have some measurement error. This can be because of microstructure imperfections (bid/ask spreads, liquidity and other premia, non synchroneity of quotes since bond markets are OTC). This is purely measurement noise. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;P is the theoretical price based on a model and a parameter set: Then the noise stems from the fact that the model is only an approximation of the true DGP. Since here you claim that P is a function of the short rate, I suspect that this is the correct interpretation of the error. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Re the second question: You are right, more sophisticated non-affine models are non linear in the parameters. There are various options. Perhaps use the Extended Kalman Filter where you linearize locally. In non-affine cases you might not even have bonds in closed form, therefore you might employ appriximations for pricing that extend to filtering. Or use non-parametric methods like the paper by Takamizawa (link below). You can also discretize the state space and apply Hamilton's Markov Chain filter (google Hamilton and flexible nonlinear inference, link below for an example). The Unscented Kalman Filter/ Particle Filters which have been used for Stoch Vol filters should also be useful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Takamizawa: &lt;a href=&quot;https://core.ac.uk/download/files/153/7064080.pdf&quot; rel=&quot;nofollow&quot;&gt;https://core.ac.uk/download/files/153/7064080.pdf&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hamilton's nonlinear inference: &lt;a href=&quot;http://www.socialsciences.manchester.ac.uk/medialibrary/economics/discussionpapers/EDP-0401.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.socialsciences.manchester.ac.uk/medialibrary/economics/discussionpapers/EDP-0401.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2016-03-18T20:00:18.327" LastActivityDate="2016-03-18T20:00:18.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24961" PostTypeId="1" AcceptedAnswerId="24966" CreationDate="2016-03-18T20:10:10.873" Score="1" ViewCount="3434" Body="&lt;p&gt;Does this reflect expectations &amp;amp; uncertainty about interest rates (exposure to rho?), event driven concerns about the underlying, or something else?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/5PR8h.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/5PR8h.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19017" LastActivityDate="2016-03-23T23:45:12.033" Title="Why is the term structure of the implied volatility surface non-monotonic?" Tags="&lt;option-pricing&gt;&lt;implied-volatility&gt;&lt;term-structure&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24964" PostTypeId="1" AcceptedAnswerId="24968" CreationDate="2016-03-19T14:02:31.207" Score="2" ViewCount="268" Body="&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; A loan of £12,000 is issued and is repaid in instalments of £300 at the end of each month for 4&#xA;    years. Calculate the effective annual rate of interest for this loan.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I tried-&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/nbtBN.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/nbtBN.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But how to solve this equation for i?&lt;/p&gt;&#xA;" OwnerUserId="19036" LastEditorUserId="16991" LastEditDate="2016-03-19T16:20:32.040" LastActivityDate="2020-11-08T10:53:15.110" Title="How to calculate interest rate in this problem?" Tags="&lt;interest-rates&gt;&lt;inflation&gt;&lt;annualized&gt;&lt;present-value&gt;&lt;annuity&gt;" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24965" PostTypeId="2" ParentId="24964" CreationDate="2016-03-19T15:15:27.580" Score="2" Body="&lt;p&gt;There are 48 monthly payments. You can use the formula for the Present Value of an annuity:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$12000 = 300 \frac{1}{i/12}[ 1-\frac{1}{(1+i/12)^{48}}]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to find the interest rate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However there is no explicit solution for i, it is solved by trial and error. The value I get is 9.2418%&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-03-19T15:30:19.433" LastActivityDate="2016-03-19T15:30:19.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24966" PostTypeId="2" ParentId="24961" CreationDate="2016-03-19T15:48:45.423" Score="1" Body="&lt;p&gt;On many occasions may the ATM volatility term structure implied from option prices exhibit non monotonicity. You could actually turn the question on its head and ask yourself &lt;em&gt;why should it be monotonic&lt;/em&gt;?&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Does this reflect expectations &amp;amp; uncertainty about interest rates (exposure to rho?), event driven concerns about the underlying, or something else?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It could, but not necessarily. Several factors have a role to play: log-returns auto-correlation (or correlation between underlying moves and volatility), volatility of volatility, or simply time-varying instantaneous volatility (even if we assume the latter is deterministic) are just examples.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a matter of fact, &lt;em&gt;any factor which can influence the time evolution of the second and higher moments of the price distribution&lt;/em&gt; will have a role to play (e.g. deterministic time-varying instantaneous volatility = time-varying second moment, correlation and volatility of volatility = time-varying skewness and kurtosis etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I mean is that, even without considering stochastic interest rates, a simple stochastic volatility model such as Heston can already give rise to non-monotonic ATM term structures. This is what I illustrate below. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $v_0$ represent the initial variance, $\theta$ the long run variance, $\kappa$ the mean reversion speed, $\rho$ the correlation between vol/spot moves, $\xi$ the volatility of volatility. The interest rate is set to zero to show that this is not necessarily a determining factor. Without loss of generality let us pick $v_0=0.625$ ($\sqrt{v_0}\approx 25\%$), $\theta=0.0650$  ($\sqrt{\theta}\approx 25.5\%$), $\kappa=3$ and finally $\rho=0$ and $\xi=0.5$ (by default).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea is then to keep $v_0$, $\theta$ and $\kappa$ fixed (so that the term structure of expected realised variance, i.e. the price of variance swaps under Heston $K_{var}(T)=E_0[1/T \int_0^T v_t dt]$, remains unchanged) and let (1) the correlation parameter vary, (2) the vol-of-vol parameter vary. We then price ATM options of growing maturities under Heston, imply their BS volatility and plot the resulting curves.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see from the figure below, both parameters shape the ATM implied volatility terms tructure. In the bottom subplot, I notably show how different values of volatility of volatility lead to either monotonic, or non-monotonic term structures ceteris paribus.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/IAtCJ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/IAtCJ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-03-23T23:45:12.033" LastActivityDate="2016-03-23T23:45:12.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24967" PostTypeId="2" ParentId="24766" CreationDate="2016-03-19T16:01:21.353" Score="1" Body="&lt;p&gt;Given the information provided in the question, expected value of A and B is the same. Simple example: consider this binomial model with stock paths on the left, and call option prices on the right.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ZBMG1.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZBMG1.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you can easily calculate is that expected value of strategy A and strategy B is the same. If we label paths as UU, UD, DU, DD (up &amp;amp; up, up &amp;amp; down, etc ) the payoffs are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A: -15,5,5,5&lt;/p&gt;&#xA;&#xA;&lt;p&gt;B: -12.5,7.5,2.5,2.5&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like @Yugmorf noted &quot;For any given [arbitrage-free] vol curve, the expected cost of the two strategies should be the same&quot;; with A having higher variance and higher kurtosis than B. This statement is correct in general, not only for a two-period model, and for convex or flat vol surface.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practical cases however, if you expect change in volatility, or have an opinion on direction, A or B may be preferable. &lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2016-03-19T16:01:21.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24968" PostTypeId="2" ParentId="24964" CreationDate="2016-03-19T16:17:32.417" Score="2" Body="&lt;p&gt;The annuity expression $a_{4}^{(12)}$is written as: &#xA;$$a_{4}^{(12)}= \frac{1-(1+i)^{-4}}{i^{(12)}} = \frac{i}{i^{(12)}} a_4$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where, $i$ is the effective annual rate of interest and &lt;strong&gt;$i^{(12)}$ is nominal rate of interest convertible monthly&lt;/strong&gt;, which is equal to &#xA;$$i^{(12)}=12((1+i)^{1/12}-1)$$&#xA;There is no closed formula to get the interest rate, you have to used &lt;strong&gt;hit and trial method to get the effective rate of interest.&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get the &lt;strong&gt;initial guess&lt;/strong&gt;, you may use your annuity table at which $\frac{12000}{3600}$ is nearer to $a_4$. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Alternative method:&lt;/strong&gt; Assuming $i'$ as effective monthly interest rate, then solve this equation: &#xA;$$12000 = 300 \left[ \frac{1-(1+i')^{-48}}{i'}\right]$$&#xA;After obtaining monthly rate, convert it to effective annual interest rate using: &#xA;$$i = (1+i')^{12} - 1$$&lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="16991" LastEditDate="2016-03-20T17:17:22.397" LastActivityDate="2016-03-20T17:17:22.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24970" PostTypeId="1" AcceptedAnswerId="25074" CreationDate="2016-03-19T18:59:32.807" Score="8" ViewCount="3114" Body="&lt;p&gt;I have a negligible amount of money (\$5000) that I would like to invest in a stock. I would like to buy the stock at some point in the next year, and get the lowest possible price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to accomplish this by placing a limit order at \$X to buy (&lt;code&gt;5000/$X&lt;/code&gt;) shares of stock A, today, with, say, a 98% chance that the price dips below &lt;code&gt;$X&lt;/code&gt; and the order executes at some point in the next year. I don't need the calculation to be perfect, but I'm new to financial modeling and don't really know where to start looking. I started looking at the prices of out-of-the-money puts, though these are based on the profit you can make from selling the stock at that value, they don't really express the likelihood of the price dipping below that amount.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's a simple model, or existing market/contract somewhere, that I can use to model the probability of a stock dipping or jumping by some amount over a given time period?&lt;/p&gt;&#xA;" OwnerUserId="19960" LastActivityDate="2016-03-30T14:35:06.227" Title="Estimate probability of limit order execution over a large time frame" Tags="&lt;option-pricing&gt;&lt;limit-order-book&gt;" AnswerCount="5" CommentCount="4" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="24971" PostTypeId="1" CreationDate="2016-03-19T21:37:56.523" Score="3" ViewCount="611" Body="&lt;p&gt;Not sure if this is the best site for this question, it's pretty finance specific so I think it fits. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Correlation Risk Modeling and Management, Meissner refers to a study he performed on the daily closing prices of the constituents of the DOW for around 30 years. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea where I can find a similar data set? I've looked on Google and Yahoo but I can only find the closing value of the index and not a data set of the closing prices of all the constituents of it over the years.&lt;/p&gt;&#xA;" OwnerUserId="9265" LastActivityDate="2016-05-10T23:06:32.897" Title="Where can I find historical DJIA closing prices?" Tags="&lt;data&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24974" PostTypeId="1" AcceptedAnswerId="24987" CreationDate="2016-03-20T08:38:09.390" Score="2" ViewCount="192" Body="&lt;p&gt;In the hours before the stock exchanges open for the day, financial news reporters often discuss the latest developments in stock index futures. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm curious how to interpret the developments they are discussing.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Should I interpret it as: the developments of futures are indicative of where the actual stock indices may be going? How strong is the correlation, generally?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If futures contracts on the S&amp;amp;P 500 fall in value, would that imply that the market believes that the market will develop more positively?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Are the stock index futures usually &quot;rolling&quot; or is a future for a certain upcoming contract month commonly used? How much does it matter when the future was issued?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is there any other basic knowledge I should have when it comes to this topic? I am familiar with the concept of what a futures contract &lt;em&gt;is&lt;/em&gt;, but I'm not entirely sure how futures relate to the interest given to the normal markets.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="19964" LastActivityDate="2016-03-21T01:21:42.993" Title="How to interpret the movement of stock index futures, in regards to regular market movements" Tags="&lt;futures&gt;&lt;market&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="24975" PostTypeId="2" ParentId="24974" CreationDate="2016-03-20T13:17:55.893" Score="2" Body="&lt;p&gt;Equities futures markets and equity indices move essentially in lockstep almost all of the time.  Hence when the stock market is not open, the futures provide an excellent indication of where the market is likely to go when it opens.  Yes, they are always talking about the 'front month' futures contract.  Right now that would be the March 2016.  They roll every 3 months in US equity futures, so soon we will be talking about the June contract.  You can consult any decent text of &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-03-20T13:17:55.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24976" PostTypeId="1" AcceptedAnswerId="24978" CreationDate="2016-03-20T14:42:01.780" Score="7" ViewCount="4319" Body="&lt;p&gt;I have just read the following paragraph (in bold) and have a question on the upper bound of an american put option:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;a href=&quot;http://www.sharemarketschool.com/option-valuation-upper-and-lower-bounds-part-iii/&quot;&gt;http://www.sharemarketschool.com/option-valuation-upper-and-lower-bounds-part-iii/&lt;/a&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&quot;Upper bounds of American puts: &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The american put cannot have a value that’s greater than the strike price.So, if the underlying stock is at Rs 70 with strike price at Rs 75, the value of the put cannot be greater than 75. That’s simple to understand. &lt;strong&gt;The existence or non existane of dividends in the underlying stock desn’t make any difference in this case. The upper bound will always be the strike price in the case of american puts.&lt;/strong&gt;&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My question is:  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The lower bound of an american and european put option can be optained by the put-call parity:  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P(S, \tau; X) \geq p(S, \tau; X) \geq \text{max}(XB(\tau)+D-S, 0)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;br&gt;&#xA;$S$ : spot price of the stock,&lt;br&gt;&#xA;$\tau$ : time to maturity&lt;br&gt;&#xA;$X$ : strike price&lt;br&gt;&#xA;$P$ : price of an american put option&lt;br&gt;&#xA;$p$ : price of an european put option&lt;br&gt;&#xA;$B(\tau)$ : zero-coupon discount bond price&lt;br&gt;&#xA;$D$ : present value of multiple deterministic dividend payments  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, with $D$ being sufficiently high and $S$ being sufficiently low, it is possible that  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\text{max}(XB(\tau)+D-S, 0) \gt X$,  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is a contradiction to the statement that the upper bound of an american put option is the strike.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to resolve this contradiction? Thanks for helping!&lt;/p&gt;&#xA;" OwnerUserId="19969" LastActivityDate="2016-04-25T13:50:53.403" Title="The Upper Bound of an American Put Option" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;american-options&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24978" PostTypeId="2" ParentId="24976" CreationDate="2016-03-20T15:20:55.993" Score="6" Body="&lt;p&gt;Dividends do not matter for the determination of the upper bound. Indeed, the maximum profit which the holder of a put option can make (be it through a European or an American exercise feature) is exactly equal to the strike price $X$. This can be seen by simply looking at the payout function: the maximum profit is &lt;em&gt;finite&lt;/em&gt; and located on the &lt;em&gt;downside&lt;/em&gt; when the underlying is worth 0. Consequently, there is no way that the price of a put option with time to maturity $\tau$ can be greater than $X$, the maximum achievable gain (assuming positive discount rates).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That being said, the lower bound for the price of a European put is actually easily derived using &lt;em&gt;Jensen's inequality&lt;/em&gt; (i.e. if $f$ is a convex function then $E[f(X)] \geq f(E[x])$):&#xA;\begin{align}&#xA; P(S_0;\tau,X) &amp;amp;= B(\tau)E_0[ \max(X-S_\tau, 0) ] \\&#xA;             &amp;amp;\geq B(\tau)\max(E_0[X-S_\tau], 0) = \max(B(\tau)X-B(\tau)F(0,\tau), 0)&#xA;\end{align}&#xA;where $F(0,\tau)$ figures the forward price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the above expression, you see that the first argument of the $\max(.,.)$ function is always smaller than $B(\tau)X$ because $F(0,\tau)$ is always positive in the equities world. &lt;strong&gt;There is therefore no conflict between the above result and the theoretical upper bound $X$&lt;/strong&gt; (assuming positive discount rates). &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;Note that your equation gives exactly the same result since in the absence of arbitrage opportunity:&#xA;  $$B (\tau)F (0,\tau) = S_0 -D$$&#xA;  Which can be shown by a simple cash and carry argument. Thus, when I say that $F (0,\tau)$ is positive, it is equivalent to saying $S_0 \geq D $ in your equation. In other words, the current stock price reflects future expected dividend payments: you cannot reasonably have $S_0$ sufficiently small and $D $ sufficiently large at the same time.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Also there is no such thing as call-put parity for American options (because of the early exercise feature). Well, there is, but it becomes an inequality rather than the well-known equality observed for European options.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-04-25T13:50:53.403" LastActivityDate="2016-04-25T13:50:53.403" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="24979" PostTypeId="1" AcceptedAnswerId="31278" CreationDate="2016-03-20T16:06:25.480" Score="0" ViewCount="3128" Body="&lt;p&gt;Suppose I have daily adjusted closing prices for SPY, for example from yahoo finance. How from this calculate annual return? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: It's NOT about issues like 1.2 means 20% or 0.2 means 20%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most trivial solution is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(adj. closing price at 31.12)/(adj. closing price at 1.1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Result is different from the data appears on the web.&lt;/li&gt;&#xA;&lt;li&gt;The data appears on the web is not adequate. For example &lt;a href=&quot;https://en.wikipedia.org/wiki/S%26P_500_Index&quot; rel=&quot;nofollow&quot;&gt;from here&lt;/a&gt; 2014 return was 11.39%, but &lt;a href=&quot;http://www.etfreplay.com/etf/spy.aspx&quot; rel=&quot;nofollow&quot;&gt;from here&lt;/a&gt; it's 13.46% (This first result on Google so I suppose it's reasonable resource). Same one can find clicking other web sites...&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;" OwnerUserId="18094" LastActivityDate="2016-12-01T05:42:01.153" Title="How to calculate annual returns from daily prices?" Tags="&lt;returns&gt;&lt;finance-mathematics&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24980" PostTypeId="2" ParentId="24976" CreationDate="2016-03-20T18:16:35.230" Score="2" Body="&lt;p&gt;Assuming that $max(KB(\tau) + D - S, 0) &amp;gt; K$, and assuming that the strike $K$ is positive, we know that $max(KB(\tau) + D - S, 0) = KB(\tau) + D - S$, since $0$ is less than $K$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given that, we get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$KB(\tau) + D - S &amp;gt; K$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$D - S &amp;gt; K (1 - B(\tau))$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming that $B(\tau) \leq 1$ (non-negative interest rate), we get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$D - S &amp;gt; K (1 - B(\tau)) \geq 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$D &amp;gt; S$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or, in other words, the asset is selling for less than the present value of the dividends, which is an opportunity for arbitrage.&lt;/p&gt;&#xA;" OwnerUserId="15336" LastActivityDate="2016-03-20T18:16:35.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24982" PostTypeId="2" ParentId="24952" CreationDate="2016-03-20T18:45:58.200" Score="1" Body="&lt;p&gt;You can decompose W in W+ and W-&#xA;Where W = W+ + W- and W+&gt;0 and W-&amp;lt;0.&#xA;In that case, abs(W) = W+ - W-.&#xA;That makes a problem 3x bigger but makes it easy to solve.&lt;/p&gt;&#xA;" OwnerUserId="19970" LastActivityDate="2016-03-20T18:45:58.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24983" PostTypeId="2" ParentId="24979" CreationDate="2016-03-20T19:13:28.340" Score="2" Body="&lt;p&gt;You can take the log difference: &#xA;log(price_12-31-2014)-log(price_01-01-2014)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can calculate the simple rate of return as: (price_12-31 - price_01-01)/price_01-01&lt;/p&gt;&#xA;" OwnerUserId="18694" LastActivityDate="2016-03-20T19:13:28.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24984" PostTypeId="2" ParentId="24961" CreationDate="2016-03-20T20:46:28.357" Score="0" Body="&lt;p&gt;Since equity option prices on the &quot;wings&quot; (i.e. deep out of the money puts and calls) often trade at significant volatility premiums to ATM, it's highly unlikely implied vol will be monotonic.  The basic reason for this is that stock price distributions have fat tails relative to a lognormal distribution.  One can get much more complex than that, but that's the basic situation.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-03-20T20:46:28.357" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24985" PostTypeId="2" ParentId="24979" CreationDate="2016-03-20T23:36:44.130" Score="2" Body="&lt;p&gt;Apples and oranges. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;S&amp;amp;P 500 index (your first link) is not the same as SPY (your second link) so the results of course need not be the same. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;S&amp;amp;P 500 is a statistical index published by Standard and Poors, it is generally given as price change only, although as a supplement a total return version is available from Wilshire and others; these TR figures differ slighlty from each other depending on how you assume dividends are reinvested. But if not otherwise specified S&amp;amp;P 500 is a price only (no dividends) figure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;SPY is an actual investable ETF which tracks the S&amp;amp;P 500 stocks. The shareholders of SPY collect both price change and dividends, which are distributed once a quarter. Also some modest fees are subtracted. The return on SPY is a good measure of achievable total return including realistic costs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it is not surprising that your second figure is about 2% higher than the first: the dividend yield on American stocks is about 2%!&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2016-03-20T23:36:44.130" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24987" PostTypeId="2" ParentId="24974" CreationDate="2016-03-21T00:58:38.850" Score="4" Body="&lt;p&gt;When both the spot and futures markets are open, the futures price is related to the spot S&amp;amp;P level via the equation $F = S e^{(r-d)t}$. t is the time (in years) between now and the contract expiration. The March contract is expiring soon, so the most active is actually June. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The difference between S and F is called the 'basis', and with current dividends and interest rates is about 9 S&amp;amp;P points for the June futes. The basis will converge to zero as the expiration date approaches, but on any given day and for small moves in S&amp;amp;P it is approximately constant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At night, when the futures are open and the stock market is closed, the futures do a pretty good job of trading based on &quot;where the stocks would be if they were open&quot; and the two come back in synch the next day.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-03-21T01:21:42.993" LastActivityDate="2016-03-21T01:21:42.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24991" PostTypeId="1" AcceptedAnswerId="25008" CreationDate="2016-03-21T02:47:46.600" Score="3" ViewCount="1109" Body="&lt;p&gt;If a riskless security costs 100 today and will cost 120 at time T, a stock costs 50 today and will either be 70 or 30 at time T, and call options on the stock have strike price 50 expiring at time T, how would you construct a portfolio of stocks and call options such that the final value of the portfolio is 120 no matter the final stock price? &#xA;Also how would you find the price of the call option? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please explain, thanks. &lt;/p&gt;&#xA;" OwnerUserId="17063" LastActivityDate="2016-03-21T22:46:27.647" Title="Construct option and stock portfolio" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;portfolio-management&gt;&lt;forward&gt;&lt;put-call-parity&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24992" PostTypeId="1" AcceptedAnswerId="25007" CreationDate="2016-03-21T04:09:25.690" Score="3" ViewCount="2488" Body="&lt;p&gt;Reading the wikipedia page for derivatives on 00:02 E.S.T March 21 2016, a credit default swap (CDS) is summarized as being &quot;A credit default swap (CDS) is a financial swap agreement that the seller of the CDS will compensate the buyer (the creditor of the reference loan) in the event of a loan default (by the debtor) or other credit event&quot;, and goes on to say &quot;It was invented by Blythe Masters from JP Morgan in 1994&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To a layman like me, this sounds very similar to a bet, and so it seems weird to say this concept was invented in 1994. In what way is a &quot;credit event&quot; distinct from something like a gambling event (like a dice roll or horse race)? Could the credit event be a person losing a bet that party A would win in game X? &lt;/p&gt;&#xA;" OwnerUserId="19974" LastActivityDate="2016-03-21T17:54:03.040" Title="What is the Difference Between a Credit Default Swap and a Bet" Tags="&lt;derivatives&gt;&lt;cds&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24995" PostTypeId="2" ParentId="24991" CreationDate="2016-03-21T06:02:39.763" Score="2" Body="&lt;p&gt;Let's call R the riskless security (100 today, 120 at time T).&lt;br&gt;&#xA;And call S the stock = 50, and either 70 or 30 at time T.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way to look at it is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A] Consider: buy 2 call options (C), short the stock (S), invest 50 (proceeds from S) in R. At time T:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;S=70: 2C=40, buy back S=-70, proceeds from R=60. net: 30&#xA;S=30: 2C=0, buy back S=-30, proceeds from R=60. net: 30&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The value of the portfolio today must be the same as the value of the portfolio at time T, so the value of the 2 calls today must be worth the same as 30 at time T. Now, we can invest $\frac{30}{120}=\frac{1}{4}$ of R (100) today =(~\$25) which will be worth \$30 at time T. Thus each call today is worth \$25 / 2 ~= 12.5.&lt;br&gt;&#xA;[Edit note: Thanks RF - helped me realise the error]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Note: if the calls were cheaper we could make money by buying the above portfolio, or if they were more expensive we could sell calls and buy the stock, either way for more profit than the riskless security)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;B] Also consider: buy the stock and 2 puts. Cost is 50 + 2xP. At time T:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;S=30: 30+2x20=70; or&#xA;S=70: 70+2x0 =70  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is the same as if 58.33 is invested in R, as it will be worth .5833*120=70 at time T. As today's value of the portfolio must be also be 58.33, P must cost ~4.167&lt;/p&gt;&#xA;&#xA;&lt;p&gt;C] To have 120 at time T, you must start with 100, and either:&lt;br&gt;&#xA;1. buy $\frac{120}{70}$ stock (cost=85.72) and $2\times\frac{120}{70}$ puts (cost=14.28).&lt;br&gt;&#xA;OR&lt;br&gt;&#xA;2. buy 8 call options, short 4 stock, invest S*4 in R. 8 call options @12.5 will cost 100.&lt;br&gt;&#xA;OR&lt;br&gt;&#xA;3. As RF pointed out, buy 2.4xS=120, buy 2.4xP=10, sell 2.4 calls at 12.5=30, for a cost of 100.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Either way, all portfolios will be worth 120 at time T, irrespective of what happens to S, just as if you had invested 100 in R.&lt;/p&gt;&#xA;" OwnerUserId="17303" LastEditorUserId="17303" LastEditDate="2016-03-21T22:46:27.647" LastActivityDate="2016-03-21T22:46:27.647" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="24996" PostTypeId="1" AcceptedAnswerId="25003" CreationDate="2016-03-21T06:39:13.827" Score="1" ViewCount="142" Body="&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/w/index.php?title=Futures_contract&amp;amp;oldid=710727199&quot; rel=&quot;nofollow&quot;&gt;According to the opening paragraph of the Wikipedia article for &quot;Futures contract&quot;&lt;/a&gt;, the parties to a futures contract&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;initially agree to buy and sell an asset for a price agreed upon today (the forward price) with delivery and payment occurring at a future point, the delivery date. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However, later in the same article, &lt;a href=&quot;https://en.wikipedia.org/w/index.php?title=Futures_contract&amp;amp;oldid=710727199#Definition_of_futures_contract&quot; rel=&quot;nofollow&quot;&gt;a formal definition of a futures contract&lt;/a&gt; is given, attributed to Björk, which states that, if $F(t, T)$ designates the quoted market price at time $t$ of a futures contract for delivery of $J$ at time $T$, then, in particular,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;At time $T$, the holder pays $F(T,T)$ and is entitled to receive $J$. Note that $F(T,T)$ should be the spot price of $J$ at time $T$.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So, I'm confused: is the amount to be payed on delivery date in exchange of the underlying asset determined on the day that the futures contract is entered, as the opening paragraph indicates, or is it determined by the market quote on the day of delivery, as Björk's definition indicates?&lt;/p&gt;&#xA;" OwnerUserId="15619" LastActivityDate="2016-03-21T14:51:19.607" Title="Definition of Financial Futures: The price to pay for the underlying asset on delivery date" Tags="&lt;futures&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="24997" PostTypeId="2" ParentId="24949" CreationDate="2016-03-21T08:56:30.460" Score="1" Body="&lt;p&gt;There is no particular advantage to either method once everything is aligned to the same methodology, and your systems understand that any particular bar is still &quot;in session&quot; (i.e. HLC represents a snapshot of the High, Low and Last and those are still able to change as new data arrives) or &quot;completed&quot; (i.e. OHLC is static).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Timestamp on close is more consistent across other timeframes other than 1 minute and is the de-facto standard for data vendors since it's more intuitive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;eg. &#xA;Weekly data - the date of the record is the final trading day of the week.&#xA;Yearly data - the date of the record is the final trading day of the year.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are other markets that span multiple periods such as futures/forex sessions that start in an evening and finish some time the next day.  The &quot;session&quot; timestamp is the date when the session closed.  eg. Spot forex starts trading on Sunday New York time and the session closes and settles on Monday at 5pm.  The date for that bar is Monday's date.&lt;/p&gt;&#xA;" OwnerUserId="13859" LastEditorUserId="13859" LastEditDate="2016-03-21T09:02:45.960" LastActivityDate="2016-03-21T09:02:45.960" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="24998" PostTypeId="1" AcceptedAnswerId="24999" CreationDate="2016-03-21T09:09:02.637" Score="1" ViewCount="257" Body="&lt;p&gt;According to the opening paragraph of &lt;a href=&quot;https://en.wikipedia.org/w/index.php?title=Futures_contract&amp;amp;oldid=710727199&quot; rel=&quot;nofollow&quot;&gt;the Wikipedia article for &quot;Futures contract&quot;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In finance, a futures contract (more colloquially, futures) is a standardized forward contract which can be easily traded between parties other than the two initial parties to the contract.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;When a futures contract that has already been established is traded,&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Does the delivery price change?&lt;/li&gt;&#xA;&lt;li&gt;Does the contract have a non-zero value?&lt;/li&gt;&#xA;&lt;li&gt;What happens to the margins accounts?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;To elaborate, suppose at time $0$ I take a long position on a futures contract, $C$, on one unit of an underlying asset $A$ to be delivered on time $T &amp;gt;0$ for the delivery price of $P_0$. Suppose at time $0 &amp;lt; t &amp;lt; T$ I wish to sell $C$. It is my understanding from the quote cited above that it is possible to do so. Assume an arbitrage-free market with a constant zero risk-free interest rate.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Suppose at time $t$ the market quote for futures contracts on one unit of $A$ to be delivered at time $T$ is $P_t$. Which delivery price is the counter-party to whom I sell $C$ committed to? $P_0$ or $P_t$. In other words, suppose the counter party to whom I sell $C$ holds $C$ till the time of delivery. Are they required to pay out $P_0$ or $P_t$ in exchange of the underlying asset?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is the counter party I sell $C$ to required to pay me for $C$? In other words, at time $t$ does $C$ have a non-zero value? We know that at the time of delivery, $C$ has a non-zero value, namely $S_A - P_0$, where $S_A$ is the value of $A$ at time $T$. This must be the case, since otherwise there is an arbitrage opportunity in the market. Indeed, if $C$'s value was naught at time $T$, a trader could buy $C$ for free and immediately parlay it for the underlying asset in exchange of $P_0$ for a net wealth increment of $P_0 - S_A$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;When I sell $C$ to the counter party at time $t$, what happens to my margin account? Does the counter party has to set up their own margin account? Does it matter if the exchange takes place before or after that day's end of trade time?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="15619" LastEditorUserId="15619" LastEditDate="2016-03-21T15:53:50.503" LastActivityDate="2016-03-21T15:53:50.503" Title="Definition of Financial Futures: The value of a futures contract" Tags="&lt;futures&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="24999" PostTypeId="2" ParentId="24998" CreationDate="2016-03-21T10:05:18.553" Score="1" Body="&lt;p&gt;You should read Fisher Black's paper &lt;a href=&quot;http://202.112.126.97/jpkc/jrysgj/files/3%EF%BC%8EThe%20pricing%20of%20commodity%20contracts.pdf&quot; rel=&quot;nofollow&quot;&gt;http://202.112.126.97/jpkc/jrysgj/files/3%EF%BC%8EThe%20pricing%20of%20commodity%20contracts.pdf&lt;/a&gt; it would answer all your questions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Briefly:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The new buyer is responsible for the price he agreed to i.e. $P_t$&lt;/li&gt;&#xA;&lt;li&gt;No payment takes place when you buy the contract, it is just an agreement you enter into, and you will be debited/credited in your margin account from now on accordingly, that's all. No money changes hands when you &quot;buy&quot; or &quot;sell&quot;.&lt;/li&gt;&#xA;&lt;li&gt;Of course the other party has to have a margin account since as above, the futures contract essentially consists not of an &quot;asset&quot; you own but in daily marking to market and exchanging daily cash flows via the machinery of the futures exchange (margin accounts, the clearing house, etc.). The trade is cleared between you and the counterparty at the price $p_t$ you both agreed to (see question 1), the seller's account stops being credited/debited every day with variation margin and the process starts for the new &quot;owner&quot; of the contract.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I would add that because the contract is marked to market every day it's economic value is zero at the moment it is is so marked. Again, it is an agreement between you and the exchange to participate in a process of marking-to-market and possible delivery, not an asset with &quot;value&quot; that you &quot;paid for&quot;. You may owe or be owed some money during the day but is paid out/taken away from you at night during the m2m (In particular I absolutely disagree that at maturity the contract is &quot;worth&quot; $P_A-S_0$ : much of that has already been paid or received by you through daily margin payments).&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-03-21T10:39:34.810" LastActivityDate="2016-03-21T10:39:34.810" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25000" PostTypeId="2" ParentId="24875" CreationDate="2016-03-21T10:17:13.193" Score="5" Body="&lt;p&gt;As you saw, the default behavior is to consider the option expired at the exercise date, so the NPV is null.  You can override this behavior by executing&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Settings::instance().includeReferenceDateEvents() = true;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After the above, the option will be considered alive at exercise date. I'm not sure that all pricing engines will manage the case $T=0$ correctly (they might), but I checked that at least &lt;code&gt;AnalyticEuropeanEngine&lt;/code&gt; does and will return the intrinsic value.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2016-03-21T10:17:13.193" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25001" PostTypeId="2" ParentId="24949" CreationDate="2016-03-21T12:10:13.813" Score="1" Body="&lt;p&gt;For what it is worth Bloomberg (e.g. GIT command) associates the time bar with the closing time of the bar. That does not make it right, but when there are multiple choices available I think being consistent with one reputable source is probably a good idea.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact in the documentation Bbg does not call the fields Open High Low Close, but Open High Low Last, which makes it clear that the fourth value is associated with the time stamp (it is the last price seen as of the time indicated).  &lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-03-21T13:26:12.153" LastActivityDate="2016-03-21T13:26:12.153" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25002" PostTypeId="2" ParentId="24949" CreationDate="2016-03-21T13:59:22.110" Score="2" Body="&lt;p&gt;This is really a question of personal preference, but as others have mentioned, you are less likely to get into trouble with lookahead bias if the timestamp is set to that of the closing moment.  If it is set to the opening moment, it is easier to accidentally observe the closing price at the opening 'time', which is a time at which the closing price could not have been known.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are writing your own candlestick generation code, and have room, you will find it helpful to record all of the open/high/low/close times.&lt;/p&gt;&#xA;" OwnerUserId="3491" LastActivityDate="2016-03-21T13:59:22.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25003" PostTypeId="2" ParentId="24996" CreationDate="2016-03-21T14:51:19.607" Score="3" Body="&lt;p&gt;I think there's confusion here.  If a futures contract whose maturity is T is trading at F(t,T) at time t, then the buyer at time t pays no cash at time t, he just &quot;enters into&quot; the contract.  At time t+1 he receives an amount F(t+1,T) - F(t,T) of variation margin, and this occurs every day until time T when he receives an amount F(T,T) - F(T-1,T) of variation margin.  By definition the value of F(T,T) is the spot price of some asset J at time T.   Thus the total cash received over time is F(T,T)-F(t,T).  (this may be negative of course).   At expiration T, if it is cash settled nothing else happens.   If it is physical settled, the holder pays F(T,T) and receives the asset J, although this settlement does not create any positive or negative value because it is an on-market transaction.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-03-21T14:51:19.607" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="25004" PostTypeId="1" CreationDate="2016-03-21T15:18:49.270" Score="1" ViewCount="405" Body="&lt;p&gt;Hello stackexchange community!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am new to R and econometrics and  and stuck in a step of the fama-macbeth (1973) regression, in which risk premia of stocks are estimated with a two-step regression procedure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first regression looks like the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rit = αi + βiRmt + εit ......(1)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where i = 1,...,20 stocks and Rm is the return of the market index (often referred to as factor in regressions)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The β in here, of which I have 20 (one for each stock), is the coefficient I want to use in the second regression, which is a cross-sectional regression:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rit = γt βˆi + αit .............(2)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where again i = 1,...,20 stocks. I am supposed to get one γt (risk premium) per day(4500) and 20 αit (pricing errors) per day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now to my issue:&#xA;The first regression was no problem. I have one .xts object (stocks.returns) with 20 stocks in the columns and 4500 rows, which are daily returns of each stock. Then I have another .xts object (index.returns) with the same attributes, but just one column which is the market index. With this data I run the following codes in order to get the betas:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;all.betas &amp;lt;- coef(lm(stocks.returns ~ index.returns))&#xA;all.betas &amp;lt;- all.betas[2,1:20]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;now I have a numeric vector with all 20 betas (removed the intercept) per stock and I want to run the second (2) regression and am trying the code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;summary(lm(stocks.returns ~ all.betas))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, R keeps giving me this error: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Error in model.frame.default(formula = stocks.returns ~ all.betas, drop.unused.levels = TRUE) : &#xA;    variable lengths differ (found for 'all.betas')&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I need to run a regression with all 20 stock returns against all 20 betas on each day (4500). I do not know how to structure this regression model/code. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been trying and searching for days now. Please help me. Any hints, errors I made, formulas I could try, literature, links, keywords etc. are highly appreciated!&lt;/p&gt;&#xA;" OwnerUserId="19979" LastActivityDate="2016-03-21T15:18:49.270" Title="Cross-sectional Regression: Using calculated coefficient of first regression for a second regression as dependent variable" Tags="&lt;r&gt;&lt;regression&gt;&lt;expected-return&gt;&lt;statistical-finance&gt;&lt;risk-premium&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25005" PostTypeId="1" AcceptedAnswerId="25011" CreationDate="2016-03-21T17:34:21.797" Score="12" ViewCount="585" Body="&lt;p&gt;I understand that futures exchanges are set up in such a way that traders don't pay cash in order to assume a long position on a futures contract; they simply &quot;enter into&quot; the contract, essentially free of charge. For this reason, futures contracts have no value. However, aren't some futures contracts more desirable than others? And, assuming this is the case, isn't there more demand for some futures than for others? And, since a futures contract is tied up to an underlying asset and assets can become scarce if demand exceeds supply, can't futures contracts become scarce too, resulting in some traders willing to pay cash in order to get them? And even if no futures exchange technically enables futures to be purchased with money, such trades may be carried out informally externally to any exchange thus imbuing the futures contract with value.&lt;/p&gt;&#xA;" OwnerUserId="15619" LastActivityDate="2016-03-29T20:07:25.207" Title="Why are futures valueless?" Tags="&lt;futures&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="25006" PostTypeId="1" CreationDate="2016-03-21T17:48:33.850" Score="1" ViewCount="2026" Body="&lt;p&gt;What is the recommended way to handle scheduled sequence number resets (initiated by the counterparty once per day) ?&lt;/p&gt;&#xA;" OwnerUserId="19982" LastActivityDate="2019-01-02T16:02:10.447" Title="How to schedule a sequence number reset in QuickFIX?" Tags="&lt;fix&gt;&lt;quickfix&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25007" PostTypeId="2" ParentId="24992" CreationDate="2016-03-21T17:54:03.040" Score="4" Body="&lt;p&gt;The basic idea behind the CDS to provide protection from credit risk to the buyers of corporate bond. They are &lt;strong&gt;supposed to be like a insurance product&lt;/strong&gt; where he buyer of the CDS pay the premium to the seller for the repayment of principle amount if company gets defaulted. But &lt;strong&gt;CDS are different from insurance product in two ways&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;As pointed by &lt;a href=&quot;http://fisher.osu.edu/supplements/10/10402/credit-default-swaps-and-the-credit-crisis.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Stulz (2010)&lt;/a&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;However, the parallel between insurance contracts and credit default&#xA;swaps does not hold in two important ways. First, you do not have to&#xA;hold the bonds to buy a credit default swap on that bond, whereas with an&#xA;&lt;strong&gt;insurance contract, you typically  have a direct economic exposure&lt;/strong&gt; to obtain insurance.&lt;/p&gt;&#xA;&lt;p&gt;Second, &lt;strong&gt;insurance contracts (mostly) are not traded&lt;/strong&gt;; in contrast, credit default swap contracts do&#xA;trade over the counter—that is, a market where traders in different&#xA;locations communicate and make deals by phone and  through electronic&#xA;messages. Dealers trade with end users as well as with other dealers.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;So, &lt;strong&gt;buying CDS without having direct exposure to the company bond is like betting on the fortune of the company&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-03-21T17:54:03.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25008" PostTypeId="2" ParentId="24991" CreationDate="2016-03-21T18:26:48.400" Score="3" Body="&lt;p&gt;If the riskless security cost $100$ at time $t=0$ and $120$ at time $T$ then the risk free rate, $r$, is $20\%$. So that, $r=0.2$. Denote the initial stock price as $S_0$ and price of the call option as $c$.&lt;br/&gt;&#xA;Suppose that at time $t=0$ you buy one stock and sell $\Delta$ options. Your portfolio value at time $t=0$ is $$P_0 = -\Delta\times c + S_0$$. &lt;br/&gt;&#xA;At time $t = T$ stock may cost either $S_u = 70$ or $S_d = 30$. At the maturity the price of a call option, $c$, can be calculated as $\max (S_T - K, 0)$. Hence at time $t = T$&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;when stock price goes up your portfolio cost $P_u = S_u - \Delta\times c = 70 - \Delta \times (70-50) = 70- \Delta \times20$;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;when stock price goes down your portfolio costs $P_d = S_d - \Delta\times c = 30 - \Delta\times 0 = 30$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Hence if you want to construct the risk free portfolio (one that does not depend on a stock price) you need to solve for $\Delta$:&#xA;$$70 - 20\Delta = 30$$&#xA;$$\Delta = 2$$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means that if you buy at time $t=0$ one share for $50$ dollars and sell two options, then at time $t=T$ your porfolio value is $30$ no matter if the stock price goes up or down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want your portfolio to cost $120$ at time $T$ you just need to multiply your securities by $4$ (buy $4$ shares and sell $8$ options at time $t=0$). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To find option price in your portfolio remember that it is a riskless portfolio. Hence it yields risk free interest rate $r=0.2$. Thus,&#xA;$$P_0\times (1+r) = P_u = P_d$$&#xA;$$(50-2\times c)(1+0.2) = 30$$&#xA;$$c = 12.5$$&lt;/p&gt;&#xA;" OwnerUserId="18345" LastEditorUserId="18345" LastEditDate="2016-03-21T18:53:41.387" LastActivityDate="2016-03-21T18:53:41.387" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25010" PostTypeId="2" ParentId="24991" CreationDate="2016-03-21T20:22:16.583" Score="3" Body="&lt;p&gt;Put-call parity says that the difference between a call and a put is equivalent to the difference in the current stock price (adjusted down for dividends) and the strike price discounted at the risk-free rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Call - Put = S_0*e^{-div} - K*e^{-rt}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, if you want to have 120 dollars in the future, you would need to need to have $120 worth of &quot;K&quot; or 2.4 shares worth. Accordingly, we adjust the equation as follows: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$2.4*Put - 2.4*Call + 2.4*S_0*e^{-div} = 120/1.2 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, you would need to long 2.4 puts, short 2.4 calls, and long 2.4 shares (or contracts) of the underlying. This is equivalent to holding the risk-free asset and earning the 20% interest.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To value the calls and puts, you would need to use a binomial lattice. See the attached page for details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.investopedia.com/articles/investing/021215/examples-understand-binomial-option-pricing-model.asp&quot; rel=&quot;nofollow&quot;&gt;http://www.investopedia.com/articles/investing/021215/examples-understand-binomial-option-pricing-model.asp&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short, you need to find the probability of an up and a down move in stock price, multiply the payoffs by those probabilities and discount the probability weighted payoff at the risk-free rate of 20%. The probability of an up move is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{rfr - r(down)}{r(up)-r(down)} or \frac{0.20 - -0.40}{0.40 - -0.40} = 75\%$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, the call is worth $\$20 *75\% /1.2 = 12.5$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The put is worth $\$20 *25\%/1.2 = 4.1667$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a check, the outlay today is $2.4*50 = 120$ for the shares. You pay \$10 for the puts and collect \$30 for the calls. Total outlay is $100. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, check any scenario for the price of the shares, you will see that the payment will be \$120. The calls/puts create a synthetic short of the stock and only thing not canceled out is the 2.4 shares of strike at \$50 = \$120.&lt;/p&gt;&#xA;" OwnerUserId="19089" LastEditorUserId="19089" LastEditDate="2016-03-21T21:25:30.130" LastActivityDate="2016-03-21T21:25:30.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25011" PostTypeId="2" ParentId="25005" CreationDate="2016-03-21T22:12:20.460" Score="10" Body="&lt;p&gt;I will talk about &lt;strong&gt;equity futures&lt;/strong&gt;. Commodity futures can be slightly different, as I briefly point out.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Equity futures are &lt;strong&gt;standardised exchange-traded instruments&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Futures on stock indices are especially liquid&lt;/strong&gt;. The reason for that, is that one cannot simply buy/sell an index as he would buy/sell a single stock because an index is merely a reference value, not a real asset. In practice, to go long/short an index (or &lt;em&gt;a fortiori&lt;/em&gt; manage the delta of an option written on such an underlying) futures are the only alternative.&lt;/li&gt;&#xA;&lt;li&gt;I don't think it is right to claim that futures are &quot;valueless&quot; (you could say they are &quot;priceless&quot; though). Indeed, although you don't pay any premium for them (let us ommit the initial margin or deposit for simplicity), when you &quot;enter into&quot; a futures contract you &lt;em&gt;commit yourself&lt;/em&gt; to something. More specifically, if at time $t$ you buy and hold a future up to its expiration date $T$, you &lt;em&gt;know&lt;/em&gt; you will have made/lost $S(T)-F(t,T)$ exactly. Of course you'll experience P&amp;amp;L fluctuations in-between due to the daily variation margins but you will have won/lost this exact amount in total. Thus &lt;strong&gt;the &lt;em&gt;value&lt;/em&gt; of the contract is somehow subjective&lt;/strong&gt;: people who think that $S(T)$ will be greater than $F(t,T)$ will tend to buy and &lt;em&gt;vice versa&lt;/em&gt; (price discovery mechanism). Obviously, if you offset your position prior to expiry you win/lose $F(t^*,T)-F(t,T)$ where $t^*$ denotes the time at which you sell your future to someone else if you were long. &#xA;It is worth noting that only a minority of future contracts are actually held up to their expiration date.&lt;/li&gt;&#xA;&lt;li&gt;The daily margining process increases the liquidity of future contracts because it &lt;strong&gt;reduces counterparty credit risk&lt;/strong&gt;. Indeed, instead of entering a future contract to earn $S(T)-F(t,T)$ at time $T$, you could earn the exact same amount by entering a forward contract. The difference is that, for a forward (which usually trades OTC), there will be no daily margining (because no dedicated clearing house), hence you will win/lose $S(T)-F(t,T)$ as a single cash flow received/paid upon expiry. In other words, if your counterparty defaults before then, you lose everything. With the variation margins mechanism, at least you will have already been paid what the counterparty owes you up to the default date. &lt;/li&gt;&#xA;&lt;li&gt;Finally, the fact that you do not have to pay anything upfront (except for the initial margin), is actually something positive for the various market participants since it offers them &lt;strong&gt;greater leverage&lt;/strong&gt;. Introducing a premium as you suggest would ruin that.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;At the end of the day, between people who buy/sell futures to hedge (usually sell side and natural hedgers), people that buy/sell futures because they find them mispriced (usually buy side and speculators), the daily margining process supervised by the clearing house and the leveraging, it is clear that futures' markets developed well over the years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more background/practical info you can read this &lt;a href=&quot;https://www.google.be/url?sa=t&amp;amp;source=web&amp;amp;rct=j&amp;amp;url=https://www.cmegroup.com/education/files/a-traders-guide-to-futures.pdf&amp;amp;ved=0ahUKEwjlu4mkhdXLAhVHnBoKHQXKBtIQFgggMAE&amp;amp;usg=AFQjCNE426-FJ1fyPAoYWlhNBchsBn-fFQ&amp;amp;sig2=1Ou0QxsCXA6oAEqfWp8ET&quot; rel=&quot;noreferrer&quot;&gt;futures trading guide&lt;/a&gt; from the CME group.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before concluding, note that in commodity markets your remark concerning the scarcity of the underlying can have a profound impact on the shape of the futures' curve $F(t,T), \forall T$. See for instance the recent oil-storage contango (you should definitely read about &lt;strong&gt;contango&lt;/strong&gt; vs. &lt;strong&gt;backwardation&lt;/strong&gt; if you haven't). &lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-03-29T20:07:25.207" LastActivityDate="2016-03-29T20:07:25.207" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="25012" PostTypeId="1" AcceptedAnswerId="35139" CreationDate="2016-03-21T23:55:35.947" Score="6" ViewCount="1369" Body="&lt;p&gt;In a &lt;a href=&quot;https://scholar.google.com/scholar?q=%22spread%20portfolio%22&quot; rel=&quot;noreferrer&quot;&gt;lot of papers&lt;/a&gt; spread portfolios are constructed, like in &lt;a href=&quot;https://faculty.fuqua.duke.edu/~charvey/Research/Working_Papers/HarveySiddique_skew.pdf&quot; rel=&quot;noreferrer&quot;&gt;Harvey and Siddique (1999)&lt;/a&gt;, Table IV, or in &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=686880&amp;amp;download=yes&quot; rel=&quot;noreferrer&quot;&gt;Fama and French (2005 from SSRN)&lt;/a&gt;, page 15.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, why is it important to construct such portfolios and what's their meaning in an analysis.&#xA;Second, how exactly are they constructed? (is there some bibliography, somewhere?)&#xA;Say I have a total of 20 stocks:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I create one portfolio (P-high) with the highest value 10 stocks and calculate it's daily return; then I do the same for the rest of the stocks creating the P-low portfolio.&lt;/li&gt;&#xA;&lt;li&gt;The spread portfolio's return is then calculated subtracting the return of the P-low from P-high? &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="8215" LastActivityDate="2018-08-20T13:59:48.067" Title="What is the intuition of a spread portfolio and how exactly is it constructed?" Tags="&lt;portfolio&gt;&lt;asset-pricing&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25013" PostTypeId="2" ParentId="24802" CreationDate="2016-03-21T23:55:39.440" Score="1" Body="&lt;p&gt;Well you have to be more flexible in your thinking.  If you believe that a spike in libor might occur, you have to manipulate the model to produce that scenario.   How about just moving the yield curve to that scenario and revaluing the portfolio.  Or jack the libor volatilty by a factor of 20.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This reminds me of why some banks blew up in the crisis.  Faced with the situation you describe, they slavishly   stick to some model approved by management, which doesn't probe the  distribution enough,  instead of using common sense!   &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-03-21T23:55:39.440" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25014" PostTypeId="2" ParentId="23089" CreationDate="2016-03-22T00:21:31.793" Score="4" Body="&lt;p&gt;Market practitioners do the following:   Correlation is calibrated most often by looking at historical correlations between liquid par swap rate pairs.  One could look at implied correlations within options on the yield curve (eg 10 yr minus 2yr) also.&lt;br&gt;&#xA;Swaption calibration should be done by comparing straddle prices in the market to prices produced by the simulation model.  Use at least 10 liquid points covering short end and long end of the curve, and a few different expirations.  The last question :  the market skew if very hard to match in a simple Monte Carlo rates model.  unless you're using stochastic vol you're probably not going to produce as much smile as the market.  In addition, the market dynamics tend to be different for short dated forwards versus long dates , and you can't capture that.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-03-22T00:21:31.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25015" PostTypeId="2" ParentId="25012" CreationDate="2016-03-22T01:26:53.680" Score="6" Body="&lt;p&gt;The first step is to divide a very large number of stocks into deciles (groups having 10% of the stocks) based on some ranked measure (for example book to market or liquidity etc.), then you construct a spread of the highest decile vs the lowest decile returns by subtracting average D1 returns from average D10 returns. The idea is simply to understand how long term returns differ between stocks high and low on this measure (including a test of statistical significance of the difference). It is also a way of approximating the returns of a portfolio long the first decile and short the 10th decile, which is a common quant approach to investing. HTH&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2017-07-15T14:48:16.083" LastActivityDate="2017-07-15T14:48:16.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25016" PostTypeId="2" ParentId="24970" CreationDate="2016-03-22T06:30:46.783" Score="1" Body="&lt;p&gt;You would need to use Technical indicators like MacD, AROON, STOCH, etc. There are 100's of technical indicators which could be used to predict the price of the equity based on its past movements. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, these indicators will help you in projecting the future price of an asset. The longer inputs you consider for these technical indicators, The longer future movement could be predicted. These indicators will suggest you on how much momentum in the price could be expected in the short/long run. But identifying the exact direction would be up to you. You would have probability of an asset going up or down. Based on the probability, you could act accordingly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The big risks are. &#xA;- Indicators have their own Limitations. *Evaluate for your positions periodically.&lt;br&gt;&#xA;- You will not be able to consider the current/short term dynamics of the market.&#xA;- Unexpected news and its impact on the asset owned. &#xA;- Indicators doesn't consider any news and its impact to price. they assume everything is factored into the price of the asset. However it might not be true in real world. (Say, Enron or Merrill lynch)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A pessimistic example. &#xA;Say, your indicator says, it would go up and you have plonked your money into the asset. After few days, bad news comes in from somewhere in the market, and the prices start to move in opposite direction. And your indicator will adapt to the recent changes in the price movements and it will adjust accordingly and will give you a different picture. You might argue that when invested, the graph was completely different, But current market dynamics force everything to change. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only thing that's constant is Change. Change impacts everything in this current volatile market. you need to adapt yourself to the upcoming change and act accordingly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would suggest you to read about few technical indicators. Come back and read this question. Again read about few more indicators and come back to this question again. You would see a different picture and you would have few answers in your hand. &lt;/p&gt;&#xA;" OwnerUserId="6799" LastActivityDate="2016-03-22T06:30:46.783" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25017" PostTypeId="1" AcceptedAnswerId="25022" CreationDate="2016-03-22T06:43:49.873" Score="-1" ViewCount="2307" Body="&lt;p&gt;I need the formula to calculate Drawdown recovery percentage showing in this picture.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/9I9dv.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/9I9dv.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you know please share.&#xA;Thank you...&lt;/p&gt;&#xA;" OwnerUserId="19192" LastActivityDate="2016-03-22T07:50:43.200" Title="What is the formula for calculating Draw down recovery percentage?" Tags="&lt;drawdown&gt;&lt;recovery&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25018" PostTypeId="1" AcceptedAnswerId="25023" CreationDate="2016-03-22T06:50:53.843" Score="2" ViewCount="93" Body="&lt;p&gt;Price-to-book is a very well-studied value measure. What research is there on non-P/B value measures? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I came across a handful &lt;a href=&quot;https://www.aqr.com/library/aqr-publications/a-new-core-equity-paradigm&quot; rel=&quot;nofollow&quot;&gt;used by AQR&lt;/a&gt; (Sales/EV, Cash flow/EV, E/P, Forecasted Earnings/Price) but the bibliography doesn't cite any other papers that study these measures.&lt;/p&gt;&#xA;" OwnerUserId="5251" LastEditorUserId="5251" LastEditDate="2016-03-22T08:06:46.850" LastActivityDate="2016-03-22T09:14:16.340" Title="Value measures other than P/B" Tags="&lt;equities&gt;&lt;research&gt;&lt;reference-request&gt;&lt;anomalies&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25019" PostTypeId="1" AcceptedAnswerId="25021" CreationDate="2016-03-22T06:56:45.657" Score="4" ViewCount="3383" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/rJbdd.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/rJbdd.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't understand why  $S$ (highlight on picture), I learned&#xA;$$\int_0^t W(s) dW(s) = \left. \frac{1}{2} (W^2(s)-s) \right \vert_0^t $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;everyone please explain for me. Thank you&lt;/p&gt;&#xA;" OwnerUserId="19988" LastEditorUserId="16991" LastEditDate="2016-03-23T12:53:15.683" LastActivityDate="2016-03-23T23:53:19.513" Title="Intergral of Brownian motion w.r.t. Brownian motion" Tags="&lt;stochastic-calculus&gt;&lt;stochastic&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25020" PostTypeId="1" AcceptedAnswerId="25045" CreationDate="2016-03-22T07:03:03.270" Score="1" ViewCount="70" Body="&lt;p&gt;Consider the following situation. My futures exchange, Futures Inc., is open for business 9AM till 5PM EST. A few days ago I assumed a long position in a futures contract, $C$, on one unit of some underlying asset $A$, to be delivered at time $T$, two months from today. Futures Inc. releases price quotes on futures on $A$ every hour.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, suppose at 9AM the quote on futures on &quot;$A$ with expiry date of $T$&quot; is $1$ USD, and at 10AM the quote on the same kind of futures has risen to $3$ USD. At 10:05AM I decide to sell $C$ and promptly sell it for $3$ USD. At 11AM the quoted price is goes up to $4$ USD and at the end of the day, delivery price of futures on &quot;$A$ with expiry date of $T$&quot; is $5$ USD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now here are my questions, pertaining the changes in my margin account following this trade.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;When do I see a change in my margin account? Just after the sale, at 10:05AM? Just after the next time tick, at 11AM, or just after the end of the day, at 5PM?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What will be the change in my margin account?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(a) $0$ USD - I have sold the contract, so I don't have a margin account any more,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(b) $1$ USD - the difference between the quoted price at the two time ticks between which the sale took place,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(c) $2$ USD - the difference between the last quoted price at the time the sale took place and the quoted price at the beginning of the trade day,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(d) $3$ USD - the difference between the quoted price at the next time tick following the sale and the beginning of the day,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(e) $4$ USD - the difference between the quoted price at the end of the day and the quoted price at the beginning of the day.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Am I eligible to withdraw the funds in my margin account? If so, when can I do it: just after the sale or after the end of the trade day?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What will be the change in the margin account of the person I sold $C$ to at the end of the day,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(a) assuming this person holds on to $C$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(b) if they sold $C$ out prior to 4PM?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="15619" LastEditorUserId="20795" LastEditDate="2019-09-08T08:01:21.943" LastActivityDate="2019-09-08T08:01:21.943" Title="Mechanics of futures contracts: with respect to which time reference is the variational margin calculated?" Tags="&lt;futures&gt;&lt;margin&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25021" PostTypeId="2" ParentId="25019" CreationDate="2016-03-22T07:14:15.300" Score="4" Body="&lt;p&gt;Apply Ito's lemma to $f(W_t) = W_t^2$ then&#xA;$$&#xA;f(W_T) = f(W_0) + \int_0^T f'(W_t) dW_t + \frac{1}{2} \int_0^T f''(W_t) dt. &#xA;$$&#xA;Thus&#xA;$$&#xA;W_T^2 =  2 \int_0^T W_tdW_t + \frac12 2 T =  2 \int_0^T W_tdW_t + T.&#xA;$$&#xA;If we rearrange terms then we get&#xA;$$&#xA;\int_0^T W_tdW_t = (W_T^2-T)/2.&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-03-22T07:14:15.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25022" PostTypeId="2" ParentId="25017" CreationDate="2016-03-22T07:50:43.200" Score="2" Body="&lt;p&gt;Suppose the number in the first column is x, then the y value in the second column should be calculated as;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;y = x / (1 - x)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps&lt;/p&gt;&#xA;" OwnerUserId="19903" LastActivityDate="2016-03-22T07:50:43.200" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25023" PostTypeId="2" ParentId="25018" CreationDate="2016-03-22T09:14:16.340" Score="3" Body="&lt;p&gt;I think a very good paper that summarizes the empirical evidence on other measures of value is the &lt;a href=&quot;http://finance.wharton.upenn.edu/~jwachter/research/LettauWachter2007jf.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Lettau and Wachter (2007)&lt;/a&gt;. Take a look at their tables 1, 2 and 3 for the most standard uses of value measures which indeed match with AQRs measures. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below their table 1, just for completeness:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/cNizM.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/cNizM.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2016-03-22T09:14:16.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25024" PostTypeId="1" AcceptedAnswerId="25026" CreationDate="2016-03-22T09:41:22.320" Score="2" ViewCount="792" Body="&lt;p&gt;I'm a newbie in GARCH models. I tried to realize ARMA(p, q)-GARCH(u, v) model via fGarch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, 2 main questions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Can I use BIC/AIC for selection best model for all (p, q)-(u, v) models? So, is it correct to compare BICs from, for example, ARMA(2, 1)-GARCH(1, 2) and ARMA(1, 3)-GARCH(2, 1)? If not, what should I do in this case (best way)?&#xA;[Added] And is it correct to compare BICs/AICs for different ARMA-GARCH model, based on different distributions (sged vs t-studentm for example)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) I want to use distributions which are not normal. They may be skewed and so on. I know formula for $r_{t}$, that $r_{t} = z_{t}\sigma_{t}$, where $z_{t}$ iid, zero mean and unit variation.&#xA;For example, I have same model, fitted values for $r_{t}$ and $\sigma_{t}$ by the same ARMA-GARCH model I choose as best. And I choose skewed normal distribution when I fitted model. So, how should I calculate quantiles? Is it correct to get quantiles of $z_{t}$ as a skewed normal with 0 mean and unit variation and calculate conf.levels as $r_{t}^{fitted} +- q_{1,2}*\sigma_{t}^{fitted}$, where $q_{1,2}$ are quantiles, which I get by skewed normal distribution (sure, zero mean and unit variance)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="19992" LastEditorUserId="19992" LastEditDate="2016-03-22T10:12:16.440" LastActivityDate="2016-03-23T01:47:12.120" Title="ARMA-GARCH model, bset model selection and confidence levels calculations" Tags="&lt;time-series&gt;&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;garch&gt;&lt;quantitative&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25026" PostTypeId="2" ParentId="25024" CreationDate="2016-03-22T11:42:06.540" Score="2" Body="&lt;p&gt;1) The answer is yes: you can use the AIC/BIC to select the best model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) You can have confidence intervals by:&#xA; $r_t^{fitted} \pm 2* \sigma_t^{fitted}$&#xA;so that you have a confidence interval of $\pm 2$ times the conditional standard deviation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see a plot of this by:&#xA;&lt;code&gt;plot(your_garchFit_object)&lt;/code&gt;&#xA;and typing 3 to select the plot of the series with the confidence bounds.&lt;/p&gt;&#xA;" OwnerUserId="18694" LastActivityDate="2016-03-22T11:42:06.540" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25027" PostTypeId="1" CreationDate="2016-03-22T14:07:49.767" Score="1" ViewCount="59" Body="&lt;p&gt;What approaches exist for calculating a fair price for a credit default swap for a bank? Most of the traditional valuation models are geared towards industrial firms. Are there any theoretical approaches that exist in the literature? I can't seem to find any papers or approaches that explicitly have dealt with this and am not sure how to begin an approach. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say my goal is to find a hypothetical &quot;fairly priced&quot; credit default swap reflecting the default characteristics for a firm such as Royal Bank of Canada, which doesn't actively trade CDSs. &lt;/p&gt;&#xA;" OwnerUserId="17712" LastActivityDate="2016-03-22T14:07:49.767" Title="Valuation Models for Bank Credit Default" Tags="&lt;credit-risk&gt;&lt;default-probability&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25028" PostTypeId="1" AcceptedAnswerId="25037" CreationDate="2016-03-22T14:27:18.620" Score="3" ViewCount="1411" Body="&lt;p&gt;Lately I have been trying to fit a GJR-GARCH(1,1) model to fit against the S&amp;amp;P 500 returns over 1985-2015 but I have ran into some problems I can't quite figure out.&#xA;The GJR-GARCH(1,1) model I am trying to run is specified as follows: &#xA;\begin{align}&#xA; &amp;amp;R_{t} = \mu + \eta_t \\&#xA;        &amp;amp;\eta_t = \sigma_{t-1} \epsilon_t, \epsilon_t \sim (0,\sigma^{2}_{\epsilon}) \nonumber \\&#xA;    \sigma^{2}_{t} &amp;amp;= \alpha_0 + \alpha_1\eta^{2}_{t} + \beta_1 \sigma^{2}_{t-1}  + \gamma_1 \eta^{2}_{t} I_{\eta &amp;lt; 0}(\eta_{t})&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the parameter $\alpha_1$ appears to be negative (-0.058767) and also statistically insignificant (p value of 0.3952), whereas in a normal GARCH(1,1) model the ARCH parameter does not seem to have this problem. It seems to me that the leverage parameter $\gamma_1$ is affecting $\alpha_1$ in a &quot;bad&quot; way. My question now is how do I deal with the $\alpha_1$ parameter? the things I can come up with are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Remove the $\alpha_1$ entirely from the model, as it is statistically insignificant. However, I don't think it can be done that easily...&lt;/li&gt;&#xA;&lt;li&gt;Stick to the GARCH(1,1) model where $\alpha_1$ is statistically significant and also positive and do not deal with leverage effects.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;But yet I can't find a conclusive answer to this problem.&#xA;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="19994" LastActivityDate="2016-03-23T08:18:21.433" Title="How to deal with negative ARCH terms?" Tags="&lt;time-series&gt;&lt;stochastic-processes&gt;&lt;garch&gt;&lt;quantitative&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25029" PostTypeId="1" CreationDate="2016-03-22T17:06:36.567" Score="2" ViewCount="138" Body="&lt;p&gt;I am very certain that the temperature in New York's Central Park plays a super-significant role in stock returns, so I take its daily averages and I want to test it in factor model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://faculty.chicagobooth.edu/john.cochrane/teaching/35150_advanced_investments/Cochrane_asset_pricing_CH12_229-250.pdf&quot; rel=&quot;nofollow&quot;&gt;Cochrane&lt;/a&gt; (section 12.2, p. 235) says I can use cross-sectional regressions to test this whether my &quot;factor&quot; is a return or not. However, to use time-series regressions I must make my new factor a return. How do I make my factor a return?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next, suppose I know each stock's headquarter's building average daily temperature. I sort the stocks every day based on their temperature. I construct the Hot-minus-Cold factor by subtracting the (equally-weighted) averaged return of the 1000 coldest stocks from the 1000 hottest stock. &#xA;This Hot-minus-Cold is a return, right? Is this type of process the only way to construct factors that are returns? In the last case, when is it necessary to use excess returns?&lt;/p&gt;&#xA;" OwnerUserId="8215" LastEditorUserId="8215" LastEditDate="2016-03-22T17:58:31.367" LastActivityDate="2016-09-18T22:08:51.260" Title="When are factors returns in asset pricing and how do we construct them?" Tags="&lt;factor-models&gt;&lt;asset-pricing&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25030" PostTypeId="2" ParentId="25029" CreationDate="2016-03-22T18:23:20.530" Score="2" Body="&lt;p&gt;When he is saying that the factor analysis requires returns, he is considering how the change in one asset would imply a change in another asset. You can model this the same way by modeling a change in temperature day over day, in which the &quot;returns&quot; would be $temp_t - temp_{t-1}$ or $\frac{temp_t}{temp_{t-1}}-1$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if you believe the stock market performs worse at lower temperatures in general, you could just model the temperature and not consider just the change. In this case, you would be predicting stock price movements by looking at the actual temperature. In this case, the explanatory variable would just be $temp$. Finally, you could model the significance of the effect on returns under adverse conditions by using a Boolean for extreme temperatures. For instance, you could use 1 as your explanatory variable if the temperature is above 100 degrees or below 32, and 0 if it's a nice comfortable (32, 100).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The hot minus cold index that you are looking at is interesting, but I believe is unnecessary, and I'm not sure what it would add.&lt;/p&gt;&#xA;" OwnerUserId="19089" LastEditorUserId="19089" LastEditDate="2016-03-22T18:29:23.423" LastActivityDate="2016-03-22T18:29:23.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25031" PostTypeId="2" ParentId="25028" CreationDate="2016-03-22T18:48:26.613" Score="0" Body="&lt;p&gt;I would look at the significance of the overall GARCH model compared to the GJR model. Use whichever provides a better fit.&lt;/p&gt;&#xA;" OwnerUserId="19089" LastEditorUserId="19089" LastEditDate="2016-03-22T19:53:28.350" LastActivityDate="2016-03-22T19:53:28.350" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="25033" PostTypeId="2" ParentId="25024" CreationDate="2016-03-23T01:47:12.120" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Information Criteria estimate the quality of a model based on the likelihood / the numbers of parameters (or degree of freedom) and the number of observations. It is a measure of goodness-of-fit and so it may suffers of overfitting problems. You can use it to compare any models (even with different errors distributions) however you may risk to select the model which fit the best to your past data (&lt;strong&gt;to a specific scenario&lt;/strong&gt;). An additional way is is to select the &quot;best&quot; model based on its predictive power by using out-of-sample forecast.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The confidence interval is given by : conditional mean +/- $\sigma_{t} \times q $ where $\sigma$ is the conditional variance at time $t$ and $q$ is the quantile obtained via the inverse CDF based on the parameters you obtained during the estimation and the confidence interval. So if you use a Skew Normal Dist, the Inverse CDF must &lt;strong&gt;also&lt;/strong&gt; be based on the shape parameter ($\alpha$) you obtained. At the end the $z_{t}$ have a zero mean and unit variance distribution but you need to use the specific estimated shape parameter to obtain the quantile. When we use a density different that the normal one, it is always re-parameterize in such a way that the innovation process has zero mean and unit variance. (For instance if you use the student t distribution the quantile is obtained via the $t(0,1,v)$ student density with $v$ the degree of freedom)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2016-03-23T01:47:12.120" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25034" PostTypeId="2" ParentId="25005" CreationDate="2016-03-23T04:39:27.393" Score="2" Body="&lt;p&gt;If you buy from/sell to a counterparty at a premium/discount vs. the market price, the original value of your contact is not 0 - the typical situation where this can happen is if the size of the trade is too big to go through the market without significant impact and/or in the presence of a forced buyer/seller (e.g. margin call etc.). Not all markets allow trading outside of the current bid/ask spread. Note that accounting standards such as IFRS have specific instructions on how to account for such a &quot;day 1 profit or loss&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However this is a very unusual situation and you seem to mix the concepts of price and market value. The former reflects supply and demand (desirability, scarcity to use your words), the latter is an accounting matter. To clear the potential confusion, here is an example.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Let's say you have $\$1,200$ on your account.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you buy an ounce of gold for $\$1,200$, you end up with an ounce of gold and no cash. The value of your account is still $\$1,200$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If alternatively you buy a gold future, you don't use your cash but you don't have the gold yet. Your account still has the cash + a future contract with a market value of $\$0$ and your account value is also $\$1,200$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the demand for gold rises and the price increases to $\$1,300$ (let's assume that the price of the future also moves to $\$1,300$ for simplicity):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;in the first case, your ounce of gold is now worth $\$1,300$ =&gt; total value of your account: $\$1,300$.&lt;/li&gt;&#xA;&lt;li&gt;in the second example, your cash is still worth $\$1,200$ and your future contract now has a market value of $\$100$ =&gt; total value of your account: $\$1,300$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you then buy a second future, you still have $\$1,200$ of cash, 1 future worth $\$100$ and 1 future worth $\$0$ =&gt; total value of your account: still $\$1,300$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the market value of a future position is not $\$0$ at the moment you initially buy/sell the contract (in other words, if you bought/sold at a price that is not the current market price), you can make an immediate gain or loss. That is not possible if you bought/sold in the market because by construction the market price is the price of the latest transaction: yours.&lt;/p&gt;&#xA;" OwnerUserId="2393" LastEditorUserId="2393" LastEditDate="2016-03-23T11:27:52.243" LastActivityDate="2016-03-23T11:27:52.243" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25035" PostTypeId="1" CreationDate="2016-03-23T06:57:48.830" Score="1" ViewCount="295" Body="&lt;p&gt;How does one go about calculating the modified delta as proposed by Taleb in his book Dynamic hedging?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In his book he says its a change in the call price divided by a change in the underlying and provides the following example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;If the call price picks up 0.05 points when the underlying asset moves from 100 to 100.1 then its delta will be 0.05/10 = 0.5.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does he pick the price to change it at? Does he use the Black Scholes formula to calculate the the resulting option value when we change the price?&lt;/p&gt;&#xA;" OwnerUserId="18585" LastActivityDate="2016-03-23T07:17:17.367" Title="Taleb Modified Delta" Tags="&lt;options&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25036" PostTypeId="2" ParentId="25035" CreationDate="2016-03-23T07:17:17.367" Score="4" Body="&lt;p&gt;What you (and he?) describe is the numerical derivative. The delta of an option is the infinitesimal change in value when the stock moves (infinitesimally) - thus &#xA;$$&#xA;\Delta = \frac{dO}{dS}.&#xA;$$&#xA;If you approximate this quantity be finite differences then you get&#xA;$$&#xA;\Delta \approx \frac{O(S+\Delta S)-O(S)}{\Delta S},&#xA;$$&#xA;where $\Delta S$ is a change in the stock price (10 poins in your case).&#xA;These numerical approaches are applied with duration too - there this is called &lt;em&gt;effective duration&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-03-23T07:17:17.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25037" PostTypeId="2" ParentId="25028" CreationDate="2016-03-23T08:18:21.433" Score="2" Body="&lt;p&gt;Before fitting GJR-GARCH model, first ensure that volatility exhibit sign bias. If there is no sign bias (only ARCH effect), then there is no need of fitting GJR-GARCH model. Also look at this answer: &lt;a href=&quot;https://quant.stackexchange.com/a/24296/16991&quot;&gt;The test for misspecification of GARCH model&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your data has sign bias and parameter of GJR-GARCH model is coming out to be negative, then you can put bound on your parameters as pointed by @Olaf. But such option is not available in E-Views. &lt;strong&gt;As an alternative you can use E-GARCH model (E GARCH is available in E-Views).&lt;/strong&gt; E-GARCH model also considers sign bias in the volatility and at the same time excludes the possibility of negative volatility, irrespective of sing of parameters of the model. &lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-03-23T08:18:21.433" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25038" PostTypeId="1" CreationDate="2016-03-23T12:07:16.740" Score="1" ViewCount="296" Body="&lt;p&gt;I have a question regarding random matrix theory. I've been studying various papers and I found some confusing definitions of Marchenko-Pastur law. The most clear was the one on wiki:&#xA;&lt;a href=&quot;https://en.wikipedia.org/wiki/Marchenko%E2%80%93Pastur_distribution&quot; rel=&quot;nofollow&quot;&gt;wiki-Pastur-Marchenko&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I've checked quite a few papers on connection between financial data, RMT and covariance matrix of returns. I found them to be very confusing. In particluar I've been reading in detail this paper (I would have posted more links but can't):&#xA;&lt;a href=&quot;http://arxiv.org/pdf/0710.0802.pdf&quot; rel=&quot;nofollow&quot;&gt;paper1&lt;/a&gt;.&#xA;As I understand (and wiki also says so) Marchenko-Pastur law holds for matrices H such that: $H=\frac{1}{N}(XX^T)$, where X is $M\times N$ matrix whose entries have zero mean and finite second moment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The paper linked above mentions returns have multivariate Student distribution, are correlated and they go deeper into dissecting the distribution. And than they go on and develop something similar to Marchenko–Pastur law. Shouldn't Marchenko-Pastur also hold for multivariate Student distribution? Or it does not hold because not all entries are distributed by the same marginal distribution? In particluar, I'm interesting in further explanation of eqs. 7 and 8. I think in case when all marginal distributions of multivariate Student are the same, it should converge to Marchenko-Pastur, however I just don't see this happening.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for help.&lt;/p&gt;&#xA;" OwnerUserId="20002" LastEditorUserId="20002" LastEditDate="2016-03-23T14:44:07.950" LastActivityDate="2016-03-23T14:44:07.950" Title="Marchenko–Pastur, Student distribution and returns" Tags="&lt;covariance&gt;&lt;random-matrix-theory&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25039" PostTypeId="1" AcceptedAnswerId="25054" CreationDate="2016-03-23T12:51:17.707" Score="2" ViewCount="72" Body="&lt;p&gt;Suppose I buy a futures contract and later, before expiry date, I sell it out. Is something physically exchanged between myself and the buyer, e.g. a paper certificate specifying the contract's details? If not, what is it that changes to reflect this transaction? Is it the table row that identifies this contract in the futures exchange's database that is updated with the new buyer's name replacing my name in the &quot;buyer&quot; column? Or perhaps it is not actually possible to sell a futures contract or change its details once it is established, and the closest you can get is to emulate the effect of selling it by entering into a completely new futures contract, but this time in the role of the seller?&lt;/p&gt;&#xA;" OwnerUserId="15619" LastActivityDate="2016-03-23T22:22:52.133" Title="What exactly do I sell when I sell a futures contract I have previously bought?" Tags="&lt;futures&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25040" PostTypeId="1" CreationDate="2016-03-23T13:11:04.527" Score="0" ViewCount="557" Body="&lt;p&gt;Good day, I have inputs:&#xA;Libor 1D, 1M, 2m, 3m. &#xA;FRA 3x6, 3x9, 3x12&#xA;IRS 2Y, 30Y.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What formula should I use to construct zero rate curve?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks  &lt;/p&gt;&#xA;" OwnerUserId="17967" LastActivityDate="2016-03-23T15:13:41.007" Title="Zero-rate USD Curve" Tags="&lt;discount-factor-curve&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25042" PostTypeId="2" ParentId="25040" CreationDate="2016-03-23T15:13:41.007" Score="1" Body="&lt;p&gt;You'll need to bootstrap a zero curve from your market data. This process is iterative in the sense that the implied zero rates for your short-term LIBOR rates are calculated before using those rates to bootstrap your zero rates implied by your FRAs. You will need to bootstrap for each time-point defined by your instruments. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A good reference for you would be (no multi-curve) &lt;a href=&quot;http://www.math.ku.dk/~rolf/HaganWest.pdf&quot; rel=&quot;nofollow&quot;&gt;Methods for Constructing a Yield Curve&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no easy formula, you will need a root-solver for the construction. I recommend the QuantLib library.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2016-03-23T15:13:41.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25045" PostTypeId="2" ParentId="25020" CreationDate="2016-03-23T18:05:02.207" Score="1" Body="&lt;p&gt;Without getting into all your detailed questions: when you sell a futures contract that has appreciated you have for all practical purposes made money. The computer systems for your broker, your internal systems (and your boss!) immediately recognize that. However it is true that the money is not going to hit your account immediately. You are owed some money but do not yet have it in hand. The futures industry clears trades once per day, so your money it will not be in your account in a bank in Chicago until the evening of that day. This avoids having to move money all day long between accounts as trades occurred. But this is a minor detail for most purposes, and I would not worry about it unless you are an accountant or government regulator involved in the details of how the system works. Just be confident that by the evening you will receive an amount proportional to the difference between the price you sold and the settlement price the day before. HTH&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2016-03-23T18:05:02.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25046" PostTypeId="2" ParentId="24970" CreationDate="2016-03-23T19:29:16.300" Score="4" Body="&lt;p&gt;One way to do this is a simple Monte-Carlo simulation.&#xA;There are formulae you can use to get the likelihood of a stock being below a price if you know the stock's volatility and time frame - see for example &lt;a href=&quot;https://quant.stackexchange.com/questions/7169/how-to-calculate-stock-move-probability-based-on-option-implied-volatility-and-t&quot;&gt;this question&lt;/a&gt;. For an unknown time frame, the Monte-Carlo method is (IMO) simpler than the mathematics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You would simply run a number of simulations using your expectation of volatility, or the market's (e.g. 1 year put option's implied vol at your given strike) of the stock price's movement over one year. Then &lt;strong&gt;the percentage chance of it moving below a price over a year, is simply the number of series that move below that price (at any point) &lt;em&gt;during&lt;/em&gt; the year / total number of sims&lt;/strong&gt;:  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P(S\ moves\ below\ K)= \frac{Number\ that\ move \ below\ K}{Total\ Number\ of\ Sims}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will converge to the actual percentage for &lt;em&gt;standard Geometric Brownian Motion&lt;/em&gt; or whatever your Monte Carlo does, on the assumption that the stock follows the random walk hypothesis. You can of course tweak it for your beliefs of stock drift, and/or future volatility.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: If you need help with the Monte-Carlo sim, I can probably post or direct you to code in whatever is your preferred language.&lt;/p&gt;&#xA;" OwnerUserId="17303" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-03-23T19:29:16.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25047" PostTypeId="1" AcceptedAnswerId="25055" CreationDate="2016-03-23T20:04:24.147" Score="4" ViewCount="356" Body="&lt;p&gt;Following is an argument demonstrating that the final payoff on a futures contract is twice that on a forward contract, contrary to what I believe is the accepted truth that the two payoffs are the same. I'm sure there's fault in my logic, but I can't see where it is and would appreciate it if someone pointed it out for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming zero interest rate, the final payoff of a long position on a forward contract is $S_T - F_0$, where $S_T$ is the price of the underlying on expiry date, and $F_0$ is the forward price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With futures, on the other hand, the stream of daily payoffs of a long position sums up to&#xA;$$&#xA;\sum_{k = 0}^{N - 1} (F_{t_{k + 1}} - F_{t_k}) = F_{t_N} - F_{t_0}&#xA;$$&#xA;where $t_0 = 0$, $F_{t_0}$ is the forward price, $N$ is the number of days till expiry, $t_N = T$ and $F_{t_N} = S_T$. &lt;strong&gt;&lt;em&gt;In addition&lt;/em&gt;&lt;/strong&gt;, on expiry day the holder of the long position &lt;strong&gt;&lt;em&gt;is committed&lt;/em&gt;&lt;/strong&gt; to pay the forward price $F_{t_0}$ in exchange of the underlying asset, so, in total, the final payoff is&#xA;$$&#xA;\left(F_{t_N} - F_{t_0}\right) + \left(F_{t_N} - F_{t_0}\right) = 2\left(S_T - F_0\right)&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="15619" LastActivityDate="2016-11-09T11:38:58.403" Title="A proof that the final payoff on a futures contract is twice that on a forward contract" Tags="&lt;futures&gt;&lt;forward&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25049" PostTypeId="2" ParentId="25047" CreationDate="2016-03-23T20:34:49.997" Score="2" Body="&lt;p&gt;Given that you have to true up every day, the payoff of the futures contract is already paid off except for that final day on that last day before expiration. There would be no additional amount equal to the difference in the initial and final price. Do you have a certain text that seems to say someone is responsible for both?&lt;/p&gt;&#xA;" OwnerUserId="19089" LastActivityDate="2016-03-23T20:34:49.997" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25050" PostTypeId="1" CreationDate="2016-03-23T20:37:55.413" Score="4" ViewCount="498" Body="&lt;p&gt;I have performed some out-of-sample analysis of mean-variance optimization with monthly rebalancing. Studying the &quot;realized efficient frontier&quot;, I am worried that something is wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the frontier is the &quot;realized outcome&quot;, I am aware that the frontier might not be efficient which can be seen in the figure (we have higher volatility for lower return).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/BHPpB.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/BHPpB.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having read research on out-of-sample performance with MVO, they usually obtain frontiers that are convex and coincide with the theory (i.e. more risk usually implies more return).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need a second opinion regarding the above figure, is it a reasonable shape? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The numbers in the figure are the target volatilities during the portfolio optimization and the difference between the plots is the method I have used to estimated the covariance matrix.&lt;/p&gt;&#xA;" OwnerUserId="19949" LastEditorUserId="467" LastEditDate="2016-11-25T01:47:45.660" LastActivityDate="2016-11-26T02:48:24.650" Title="Is this realized &quot;efficient&quot; frontier reasonable?" Tags="&lt;mean-variance&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25051" PostTypeId="2" ParentId="25019" CreationDate="2016-03-23T20:41:17.107" Score="3" Body="&lt;p&gt;While Richard's answer is technically correct, just saying the result can be obtained using Ito's formula doesn't make the issue much clearer. So let me go into the &lt;em&gt;microscopics&lt;/em&gt; of the issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Ito integral is defined in the following way. Suppose we divide the time interval $[0,t]$ into $n$ pieces with $t_i = i~dt$ where $dt=\frac{t}{n}$ then we define the Ito integral as&#xA;$$&#xA;\int_0^t G(t') dW(t') = {\text{ms-lim}}_{n\to \infty} \sum_{i=1}^n G(t_{i-1}) ( W_{t_i} - W_{t_{i-1}})~,&#xA;$$&#xA;where the mean-square limit is defined in the following way:&#xA;$$&#xA;{\text{ms-lim}}_{n\to \infty} X_n = X \Leftrightarrow \lim_{n \to \infty} \langle (X_n - X)^2 \rangle =0~.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let us evaluate the expression we would get on the RHS when evaluating $\int_0^t W(s) dW(s)$ from the above definition:&#xA;$$&#xA;\begin{eqnarray}&#xA;Y^{(1)}_n &amp;amp;=&amp;amp; \sum_{i=1}^n W_{t_{i-1}} (W_{t_i} - W_{t_{i-1}})~.&#xA;\end{eqnarray}&#xA;$$&#xA;Now noting each increment $(W_{t_i} - W_{t_{i-1}}) = \sqrt{dt} \mathcal N_{i-1}(0,1)$ is an &lt;strong&gt;independent normal&lt;/strong&gt; distribution we get&#xA;$$&#xA;\begin{eqnarray}&#xA;Y^{(1)}_n &amp;amp;=&amp;amp; dt \sum_{i &amp;gt; j} \mathcal N_i(0,1) \mathcal N_j(0,1)~.&#xA;\end{eqnarray}&#xA;$$&#xA;The other expression we get from the discretized version of the RHS of the standard answer $\int_0^t W(s) dW(s)=\frac{1}{2} (W(t)^2 - t)$ is&#xA;$$&#xA;\begin{eqnarray}&#xA;Y^{(2)}_n &amp;amp;=&amp;amp; \frac{1}{2} \left(\sqrt{dt} \sum_{i =1}^n \mathcal N_i(0,1)\right)^2 -  \frac{1}{2} \sum_{i=1}^n dt~.&#xA;\end{eqnarray}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if we can just show that the two expressions are same in the mean-square limit we are done. We see that&#xA;$$\begin{eqnarray}&#xA;&amp;amp;&amp;amp;\lim_{n \to \infty} \langle (Y^{(2)}_n - Y^{(1)}_n)^2 \rangle \\&#xA;&amp;amp;=&amp;amp;\lim_{n \to \infty} \frac{dt^2}{4}  \langle \left(\sum_{i=1}^n \mathcal N_i(0,1)^2 -n\right)^2 \rangle \\&#xA;&amp;amp;=&amp;amp; \lim_{n \to \infty} \frac{dt^2}{4} \langle (\chi_n^2 -n)^2 \rangle \\&#xA;&amp;amp;=&amp;amp; \lim_{n \to \infty} \frac{dt^2}{4} var(\chi_n^2)\\&#xA;&amp;amp;=&amp;amp; \lim_{n \to \infty} \frac{dt^2}{2} n \\&#xA;&amp;amp;=&amp;amp; \lim_{n \to \infty}  \frac{t^2}{2n} \\&#xA;&amp;amp;=&amp;amp; 0&#xA;\end{eqnarray}&#xA;$$&#xA;Here we used the results that the squares of $n$ standard normals is a chi-square with degree $n$ and that the same has mean $n$ and variance $2n$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence we are able to prove in detail why $\int_0^t W(s) dW(s)=\frac{1}{2} (W(t)^2 - t)$.&lt;/p&gt;&#xA;" OwnerUserId="19878" LastEditorUserId="19878" LastEditDate="2016-03-23T23:53:19.513" LastActivityDate="2016-03-23T23:53:19.513" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25053" PostTypeId="2" ParentId="24970" CreationDate="2016-03-23T22:21:33.707" Score="2" Body="&lt;p&gt;This paper is a microstructure paper (&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2185452&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2185452&lt;/a&gt;) that you may be looking at.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We will assume the complex dynamics originated by the interaction&#xA;  between sell- and buy- side (limit and market orders) can be modelled&#xA;  in terms of a continuous stochastic process Mt, the microprice, which&#xA;  we assume to be a Brownian motion,&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$$d M_t = \sigma_t dW_t$$ &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The microprice Mt represents the fair value of the security. Since the&#xA;  security can only trade at the discrete prices ${S_i}$, the microprice&#xA;  itself is not directly observable in the market place. Nonetheless, a&#xA;  commonly used empirical proxy for the microprice as a particular&#xA;  weighted average of the quote prices is inspired by the following&#xA;  argument. Denote by $S_t^+$ and $S_t^−$ the best bid and offer prices&#xA;  at time t, $V_t^+$ and $V_t^−$ the corresponding quantities posted in&#xA;  the order book. Clearly $S_t^+ \leq M_t \leq S_t^−$. As the microprice&#xA;  approaches one side of the market, let’s say St+, more buy-side&#xA;  investors will be willing to pay the reduced price of immediacy, the&#xA;  spread between the bid and the fair value $M_t −S_t^+$, in order to&#xA;  sell the desired amount immediately. In turn, this will result in&#xA;  additional sell market orders hitting the bid. At the same time it&#xA;  becomes more profitable for dealers to sell at the best offer $S_t^−$,&#xA;  so the corresponding offered size $V_t$− will increase. The reverse is&#xA;  true as the microprice goes up: now it looks more attractive for&#xA;  investor to buy at the offered price $S_t^−$ as the cost of immediate&#xA;  execution $S_t^− −M_t$ is reduced, so we can expect additional buy&#xA;  market orders lifting the offer, and more dealers will try to buy at&#xA;  the best bid $S_t^+$ thereby increasing $V_t^+$. Eventually, as the&#xA;  microprice touches a tradeable price, let’s say the bid $M_t = S_t^+$,&#xA;  the demand from investor to sell at prices above $S_t^+$ is exhausted&#xA;  and no additional sell market orders are expected. At the same time,&#xA;  dealers will not be willing to buy any additional units at $S_t^+$&#xA;  because they will not get any compensation for the trade. Therefore&#xA;  $V_t^+$ goes to zero as Mt approaches $S_t^+$ from above and similarly&#xA;  $V_t^−$ goes to zero as $M_t$ approaches $S_t^−$ from below. Of course&#xA;  this instantaneous equilibrium is immediately broken as the microprice&#xA;  drifts away from $S_t^+$ or $S_t^−$, possibly establishing new best&#xA;  bid and offer with non-vanishing size. This argument suggest that we&#xA;  could try to estimate the true value of the microprice from the best&#xA;  market prices and the corresponding posted volumes. A popular choice&#xA;  for estimating $M_t$ is&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$$ M_t = \frac{V_t^- S_t^+ V_t^+ S_t^-}{V_t^+ V_t^-} $$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="7693" LastActivityDate="2016-03-23T22:21:33.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25054" PostTypeId="2" ParentId="25039" CreationDate="2016-03-23T22:22:52.133" Score="2" Body="&lt;p&gt;Ok you should read some basic product information about futures.  When you buy and sell futures, the exchange keeps track of your open position.  If you sell some futures you previously bought, you are flat.  They see no position against your name.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-03-23T22:22:52.133" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25055" PostTypeId="2" ParentId="25047" CreationDate="2016-03-23T23:25:27.770" Score="7" Body="&lt;p&gt;This part of your post&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In addition, on expiry day the holder (...) &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;is wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Short Story]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Due to the daily &lt;strong&gt;variation margins&lt;/strong&gt; calculated by the &lt;em&gt;clearing house&lt;/em&gt; on each market close, you have already received/coughed up what you should upon expiry. If the contract is &lt;em&gt;cash-settled&lt;/em&gt;, the story thus ends here. In case of &lt;em&gt;physical delivery&lt;/em&gt; however, although there will be &lt;em&gt;no additional cash flows&lt;/em&gt;, the underlying needs to change hands (from the seller to the buyer) as legally specified by the contract. Note that &lt;strong&gt;only a minority of future trades are held until expiry anyway&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Long Story]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To better understand, take the situation where you are a producer who wishes to secure a certain price for whatever it is you are producing and planning to deliver at some future time $T &amp;gt; 0$. You find that the value at which the future of expiry $T$ trades on the exchange is honest and decide to lock that price by selling a future today. In other words, you enter a legal agreement with a party $A$ which accepts to pay you a certain amount $F(0,T)$ to receive your goods at $T$. So far so good. But now, what if the counterparty with whom you agreed on initially, decides to sell the future contract to some party $B$ at $t^* &amp;lt; T$? By offsetting his position, $A$ is now free of any obligation. These are transferred to new guy $B$ for whom it is as if he had agreed to buy your goods at $F(t^*,T)$ and not your initial price $F(0,T)$. So are you screwed because the price has changed? Well no, thanks to the margins mechanism this is completely transparent for you. Indeed, since the inception of the trade, the clearing house has regularly credited/debited your margins' account starting from the initial future price of  $F(0,T)$. The only thing left to do for you, is to meet your obligation upon expiry $T$ i.e. deliver the underlying in case of physical settlement. All in all upon expiry:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You will have made $F(0,T) - S_T$ (got rid of your goods for the price you wanted)&lt;/li&gt;&#xA;&lt;li&gt;Party $A$ will have made $F(t^*,T)-F(0,T)$ (probably a gain since he decided to sell early)&lt;/li&gt;&#xA;&lt;li&gt;Party $B$ will have made $S_T - F(t^*,T)$ (received the goods for the price he wanted). &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Thus, everyone is happy and it is a zero sum game, as expected. In conclusion, the payout of buying at $t=0$ and holding a future up to its expiry $t=T$ is indeed $$ S_T - F(0,T)$$, which is exactly the same payoff as that of a forward (if we neglect second order effects)&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-11-09T11:38:58.403" LastActivityDate="2016-11-09T11:38:58.403" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25057" PostTypeId="1" AcceptedAnswerId="28228" CreationDate="2016-03-24T04:17:10.093" Score="9" ViewCount="494" Body="&lt;p&gt;Grisha Perelman once wrote that &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The Ricci-flow equation, a type of heat equation, is a&#xA;  distant relative of the Black-Scholes equation that bond traders&#xA;  around the world use to price stock and bond options.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Wilmot has derived from the BS Equation to the heat equation, but wonder if there is any proof that you can get the BS Equation from the Ricci flow.&lt;/p&gt;&#xA;" OwnerUserId="7693" LastActivityDate="2016-10-21T13:46:21.283" Title="The Relation Between the Ricci flow and the Black-Scholes-Merton Equation" Tags="&lt;finance&gt;&lt;mathematics&gt;" AnswerCount="2" CommentCount="8" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25059" PostTypeId="1" CreationDate="2016-03-24T08:48:54.450" Score="1" ViewCount="448" Body="&lt;p&gt;How is calculate the unrealised profit on Sinkable Bond when 50% of the bond value already been paid?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the following method correct:&#xA;Unrealised P&amp;amp;L = ((Current.Position * Market.Price) - Cost.of.the.Position) * Factor &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Factor is the remaining value of the Bond (100% - Repayments in %).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks  &lt;/p&gt;&#xA;" OwnerUserId="20012" LastActivityDate="2016-03-24T08:48:54.450" Title="How to calculate the unrealised profit on sinkable bond" Tags="&lt;bond&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25062" PostTypeId="1" AcceptedAnswerId="25065" CreationDate="2016-03-24T10:56:07.183" Score="15" ViewCount="3939" Body="&lt;p&gt;In many textbooks and also in the original Merton's paper the solution of the SDE &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;dS_t = S_t\,\mu\,dt+S_t\,\sigma\,dW_t+S_{t^-}\,d\left(\sum_{j=1}^{N_t}V_j-1\right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is written as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;S_t = S_0\,\exp\left(\left(\mu-\frac{1}{2}\,\sigma^2\right)\,t+\sigma\,W_t\right)\,\prod_{j=0}^{N_t}V_j.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone suggest me a textbook or a paper where the solution is explicitly derived? I am pretty confident that this is an application of the Ito lemma for semimartingale. &lt;/p&gt;&#xA;" OwnerUserId="18063" LastActivityDate="2016-04-04T19:46:34.327" Title="Solution of Merton's Jump-Diffusion SDE" Tags="&lt;itos-lemma&gt;&lt;jump&gt;&lt;merton-model&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="25063" PostTypeId="2" ParentId="25062" CreationDate="2016-03-24T11:38:36.497" Score="3" Body="&lt;p&gt;Use Ito for jumps&#xA;$$ dS_t = \frac{\partial S_t}{\partial t} dt + \frac{\partial S_t}{\partial W_t}dW_t + \frac{1}{2}\frac{\partial^2 S_t}{\partial W_t^2} dt + \frac{\partial S_t}{\partial N_t}d N_t  $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first part is pretty straight forward&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{\partial S_t}{\partial t} dt = S_t(\mu - \frac{1}{2}\sigma^2) $$&#xA;$$ \frac{\partial S_t}{\partial W_t}dW_t = S_t \sigma dW_t $$&#xA;$$ \frac{1}{2}\frac{\partial^2 S_t}{\partial W_t^2} dt = \frac{1}{2} S_t\sigma^2 dt. $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we have to calculate the derivative according to the jump process $N_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Denote $ M_k = \prod_{j=1}^{k} V_j$ and write&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ M_t = \prod_{j=1}^{N_t} V_j = \sum_{k=1}^\infty\{N_t = k \} \prod_{j=1}^{k} V_j  = \sum_{k=1}^\infty\{N_t = k \} M_k. $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if $N_t$ is currently $k$ and jumps during the timestep $t$ to $t+dt$ from $k$ to $k+1$ the process $M_t = M_k$ changes to $M_{t+dt} = M_{k+1}$ and the change is&#xA;$$ M_{k+1} - M_k = M_k(V_{k+1} - 1). $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, and since $N_t$ has no influence on $\exp((\mu + \sigma^2)t + \sigma W_t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{\partial S_t}{\partial N_t}  = S_{t-}(V_t - 1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now note that&#xA;$$(V_t - 1)dN_t = d\sum_{j=1}^{N_t} (V_j - 1)$$ &#xA;and you are finished.&lt;/p&gt;&#xA;" OwnerUserId="6640" LastEditorUserId="6640" LastEditDate="2016-03-24T13:50:04.467" LastActivityDate="2016-03-24T13:50:04.467" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25065" PostTypeId="2" ParentId="25062" CreationDate="2016-03-24T12:05:39.990" Score="15" Body="&lt;p&gt;Let&#xA;$$ dS_t = \mu S_t dt + \sigma S_t dW_t + S_{t^-} dJ_t $$&#xA;where &#xA;$$ J_t = \sum_{j=1}^{N_t} (V_j - 1) $$&#xA;is a compound Poisson process, with $V_j$ i.i.d. jump sizes (positive random variables) whose statistical properties are not relevant for what needs to be proven and $N_t$ a standard Poisson process of intensity $\lambda$. The processes $W_t$, $N_t$ and the random jump sizes $V_j$ are all assumed to be independent of each other and defined over the same probability space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Applying Itô's formula for semi-martingales with jumps to the function $f(t,S_t) = \ln(S_t)$ yields (see &lt;a href=&quot;http://www.ntu.edu.sg/home/nprivault/MA5182/stochastic-calculus-jump-processes.pdf&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;)&#xA;$$\ln(S_t) = \ln(S_0) + \left(\mu -  \frac{\sigma^2}{2} \right)t + \sigma W_t +  \int_0^t ( \ln(S_u) - \ln(S_{u^-}) )dN_u $$&#xA;From the SDE we then have that, at a jump time $u$&#xA;$$ S_u - S_{u^-} = S_{u^-} (V_j - 1) \iff S_u = S_{u^-} V_j $$&#xA;such that &#xA;$$ \ln(S_u) - \ln(S_{u^-}) = \ln\left(\frac{S_u}{S_{u^-}}\right) = \ln(V_j) $$&#xA;and therefore&#xA;$$ \ln(S_t) = \ln(S_0) + \left(\mu -  \frac{\sigma^2}{2} \right)t + \sigma W_t + \sum_{j=1}^{N_t} \ln(V_j) $$&#xA;Finally, because &#xA;$$\sum_{j=1}^{N_t} \ln(V_j) = \ln \left( \prod_{j=1}^{N_t} V_j \right) $$&#xA;we get&#xA;\begin{align}&#xA;S_t &amp;amp;= S_0 \exp \left( \left(\mu -  \frac{\sigma^2}{2} \right) t + \sigma W_t \right)  \prod_{j=1}^{N_t} V_j \\&#xA; &amp;amp;= F(0,t) \mathcal{E}(\sigma W_t) \prod_{j=1}^{N_t} V_j &#xA;\end{align}&#xA;with $\mathcal{E}(X_t) := \exp(X_t - 1/2 \langle X \rangle_t)$ denoting the stochastic exponential of a process $X_t$ (Doléans-Dade exponential). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;More info on jump processes (and better mathematical treatment because what I wrote is not always rigorous) in this &lt;a href=&quot;http://www.ntu.edu.sg/home/nprivault/MA5182/stochastic-calculus-jump-processes.pdf&quot; rel=&quot;noreferrer&quot;&gt;excellent document&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Note that because &#xA;\begin{align}&#xA;E_0[S_t] &amp;amp;= F(0,t) E_0\left[\prod_{j=1}^{N_t} V_j\right] \\&#xA; &amp;amp; \ne F(0,t) &#xA;\end{align}&#xA;the above dynamics &lt;em&gt;cannot be used for risk-neutral pricing purpose&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To obtain a proper risk-neutral framework, the compound Poisson process needs to get &lt;em&gt;compensated&lt;/em&gt; by a drift term (so that the whole emerges as a martingale). The resulting SDE writes&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dS_t = (\mu - k) S_t dt + \sigma S_t dW_t + S_{t^-} dJ_t $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where one can show that&#xA;$$ k = \lambda (E(V_1) - 1) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and where the solution in that case reads&#xA;$$ S_t = F(0,t) \mathcal{E}(\sigma W_t) e^{-kt} \prod_{j=1}^{N_t} V_j $$&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-04-04T19:46:34.327" LastActivityDate="2016-04-04T19:46:34.327" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25066" PostTypeId="2" ParentId="18036" CreationDate="2016-03-24T14:42:27.940" Score="2" Body="&lt;p&gt;The Paritech API &lt;a href=&quot;https://www.paritech.com.au/products/pwa.html&quot; rel=&quot;nofollow&quot;&gt;https://www.paritech.com.au/products/pwa.html&lt;/a&gt; which you can get through OpenMarkets is a SOAP API that they provide a .NET SDK for. It can also be used on any platform with a SOAP client. I have tested it with the suds client for Python on linux. There is also Iguana2 &lt;a href=&quot;https://iguana2.com/&quot; rel=&quot;nofollow&quot;&gt;https://iguana2.com/&lt;/a&gt; who provide an API that sits roughly halfway between Paritech and IRESS in terms of functionality and cost. They work with a lot of startups in Australia but last time I contacted them they are no longer signing up retail customers to their API.&lt;/p&gt;&#xA;" OwnerUserId="20019" LastActivityDate="2016-03-24T14:42:27.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25067" PostTypeId="2" ParentId="25057" CreationDate="2016-03-24T18:45:45.840" Score="1" Body="&lt;p&gt;So here is an abrupt try find connections between them. I know this is incomplete and I hope someone else adds more/edits more into this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Ricci flow equation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{dg}{dt} = - 2 Ric(g(t))&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both sides are the same type of object : at each point $p \in M$, a bilinear form on $T_pM$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of local coordinates this becomes&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{\partial g_ij}{\partial t}= - 2 R_{ij} &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Hamilton, 1982).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The heat equation in 3-D is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{\partial f}{\partial t} = \nabla^2 f&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The basic differences are &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the heat flow evolves an initial function $f_0 $ towards a constant&#xA;function&lt;/li&gt;&#xA;&lt;li&gt;Ricci flow evolves a Riemannian metric.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;More on the &lt;a href=&quot;http://web.stanford.edu/~cmad/Papers/RicciFlowNotes.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Ricci flow&lt;/a&gt; by &lt;a href=&quot;https://mathoverflow.net/users/41263/bennett-chow&quot;&gt;Bennett-chow&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here &lt;a href=&quot;https://mathoverflow.net/questions/143144/intuition-behind-the-ricci-flow/149341#149341&quot;&gt;is a similar intuition behind the Ricci flow&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;heat-type equations&lt;/strong&gt;. The full curvature tensor&#xA;$\operatorname{Rm}$ satisfies an equation of the form $\frac{\partial&#xA;}{\partial t}\operatorname{Rm}=\Delta\operatorname{Rm}+q(\operatorname{Rm})$,&#xA;where $q$ is a quadratic polynomial. Since $\operatorname{Rm}$ is a symmetric&#xA;bilinear form on the vector space $\wedge^{2}T_{x}^{\ast}M$ at each point $x$,&#xA;we have the notion of nonnegativity of $\operatorname{Rm}$. Since&#xA;$q(\operatorname{Rm})$ satisfies a property sufficient for the maximum&#xA;principle for systems to be applied, $\operatorname{Rm}\geq0$ is preserved&#xA;under the Ricci flow. Generally, we can analyze the behavior of&#xA;$\operatorname{Rm}$ by the maximum principle under various hypotheses.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Geometric application&lt;/strong&gt;. In particular, when $n=3$ and $\operatorname{Ric}&#xA;_{g_{0}}&amp;gt;0$, we have $\pi_{1}(M)=0$ and hence the universal cover $\tilde{M}$&#xA;is a homotopy $3$-sphere. Encouraged by this, Hamilton proved that the&#xA;solution to the normalized Ricci flow exists for all time and converges to a&#xA;constant positive sectional curvature metric; thus $M$ is diffeomorphic to a&#xA;spherical space form. The main gonzo estimate is $\frac{|\operatorname{Ric}%&#xA;-\frac{R}{3}g|^{2}}{R^{2}}\leq CR^{-\delta}$ for some $C$ and $\delta&amp;gt;0$.&#xA;Intuitively, we expect $R\rightarrow\infty$ and hence $\operatorname{Ric}&#xA;-\frac{R}{3}g\rightarrow0$.&lt;/p&gt;&#xA;" OwnerUserId="7693" LastEditorUserId="-1" LastEditDate="2017-04-13T12:58:47.233" LastActivityDate="2016-03-24T18:45:45.840" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25072" PostTypeId="1" CreationDate="2016-03-25T10:54:54.973" Score="1" ViewCount="271" Body="&lt;p&gt;I saw a question the other day that said &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Assume you have only two assets to build a portfolio. Name and explain three scenarios&#xA;  under which a completely risk-free portfolio can be formed?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I have a few questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Is this poorly worded? Surely there are no assets that are completely risk-free. Should this be written as &quot;virtually risk-free&quot;? If not, how can an asset have absolutely zero risk?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The only assets I can think of that would be virtually risk-free are AAA-rated corporate bonds and low-yield western government bonds, i.e. US treasuries. So from my knowledge of only two asset-types that are virtually risk-free, you could only construct one scenario - a portfolio consisting of both US treasuries and AAA corporate bonds. Where is my knowledge lacking?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What is the correct answer?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8010" LastActivityDate="2021-04-12T08:37:44.720" Title="What assets other than bonds are risk free?" Tags="&lt;fixed-income&gt;&lt;risk&gt;&lt;portfolio-management&gt;" AnswerCount="5" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25073" PostTypeId="2" ParentId="25072" CreationDate="2016-03-25T11:17:56.223" Score="3" Body="&lt;p&gt;Note the words &quot;Assume&quot; and &quot;Scenarios&quot;.  These words imply that you do not need to concern yourself with any assets that actually exist.  A simple model of a market may have only one asset...clearly a vastly simplifying assumption and scenario. In this case we only have two assets.  Again, this is a vastly simplifying scenario.  This is a toy model which can help us understand the messiness that is real life financial markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is one of your three scenarios: you have two assets,one of which is risk free (ie, has deterministic outcome in all states of the world relative to buying power): simply buy the risk free asset and don't buy the other (presumably not risk free) asset.  &lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2016-03-25T11:17:56.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25074" PostTypeId="2" ParentId="24970" CreationDate="2016-03-25T13:26:55.857" Score="9" Body="&lt;h1&gt;My Answer&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;You should set your limit order to: $s (v+1)^{-0.0314192 \sqrt{t}}$&#xA;where $s$ is the current price, $t$ is the time in years you're&#xA;willing to wait, and $v$ is the annual volatility as a percentage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to be $p$ percent sure (instead of 0.98), set your limit&#xA;order to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$s (v+1)^{-\sqrt{\pi } \sqrt{t} \text{erf}^{-1}(1-p)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, this is based on many assumptions and disclaimers later in&#xA;this message.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Other Answers&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;It turns out this question has been studied extensively, and there are&#xA;some papers on it:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://fiquant.mas.ecp.fr/wp-content/uploads/2015/10/Limit-Order-Book-modelling.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://fiquant.mas.ecp.fr/wp-content/uploads/2015/10/Limit-Order-Book-modelling.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://arxiv.org/pdf/1311.5661&quot; rel=&quot;noreferrer&quot;&gt;http://arxiv.org/pdf/1311.5661&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll use a much simpler model (see disclaimers at end of message).&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Example&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;If a stock has a volatility of 15%, that means there's a 68% chance&#xA;it's price after 1 year will be between 87% and 115% of its current&#xA;price. Note that the lower limit is 87% (= 1/1.15), not 85%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Overall, the price probability for a stock with volatility 15% forms&#xA;this bell curve:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/qFyO4.gif&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/qFyO4.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Because volatility is inherently based on logrithms, the tick&#xA;marks aren't evenly numbered, and aren't symmetric. For example, the&#xA;numbers +65% and -39% are symmetric because it takes a 39% loss to&#xA;offset a 65% gain and vice versa. In other words: &lt;code&gt;(1+&#xA;(-39/100))*(1+ (65/100))&lt;/code&gt; is approximately one.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The parenthesized numbers under the x axis (for this and the&#xA;following graphs) refer to change in the logarithm of the security's&#xA;price. These &lt;em&gt;are&lt;/em&gt; evenly numbered and we will use them in the&#xA;&quot;General Case&quot; section.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The labels on the y axis are relative to each other and don't&#xA;refer to percentages.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Of course, this isn't the probability curve you're looking for: I drew&#xA;it just for reference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, let's look at the probability distribution of the &lt;em&gt;minimum&lt;/em&gt;&#xA;value over the next year for our 15% volatility stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/bBxXs.gif&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/bBxXs.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same caveats apply to this graph as the previous one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose you set your limit order at 5% below the current price (ie,&#xA;95% of its current price). There is a ~77% chance your order will be&#xA;filled:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/BIuFF.gif&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/BIuFF.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also see this using the cumulative distribution function (CDF):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Jj5ko.gif&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Jj5ko.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, the y values do represent percentages, namely the&#xA;cumulative percentage change that the stock's lowest value will the&#xA;percentage value on the x axis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For this volatility, if you want be 98% sure you order is filled, you&#xA;could only set your limit order to 0.44% below the current price.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;General Case&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Of course, that was for a specific volatility over a specific period&#xA;of time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, a volatility of v% means the stock is ~68% (1 standard&#xA;deviation) likely to remain within v% of its current price in the next&#xA;year. More conveniently, it means the logarithm of the price is 68%&#xA;likely to remain within (plus/minus) $\log (v+1)$ of its current value&#xA;(within the next year). For example, a volatility of 15% means the log&#xA;of the stock price is 68% likely to remain within .1398 of its current&#xA;value, since $e^{0.1398}$ is approximately $1.15$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally, the $\log (\text{price})$ one year from now has a&#xA;normal distribution with mean $\log (\text{price})$ and standard&#xA;deviation $\log (v+1)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, the &lt;em&gt;change&lt;/em&gt; in the $\log (\text{price})$ for one year is&#xA;normally distributed with a mean of 0 and a standard deviation of&#xA;$\log (v+1)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A standard deviation of $\log (v+1)$ translates to a variance of $\log&#xA;^2(v+1)$. Since the variance of a process like this scales linearlly,&#xA;the variance for $t$ years is given by $t \log ^2(v+1)$ and the&#xA;standard deviation for $t$ years is given by $\sqrt{t} \log (v+1)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, the change in $\log (\text{price})$ for time $t$ has a normal&#xA;distribution with mean 0 and standard deviation $\sqrt{t} \log (v+1)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As noted below in another section, this means the minimum (most&#xA;negative) value of this change has a halfnormal distribution with&#xA;parameter $\frac{1}{\sqrt{t} \log (v+1)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The cumulative distribution of a halfnormal distribution with&#xA;parameter $\frac{1}{\sqrt{t} \log (v+1)}$ evaluted at x&gt;0 (the only&#xA;place the halfnormal distribution is non-zero) is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\text{erf}\left(\frac{x}{\sqrt{\pi } \sqrt{t} \log (v+1)}\right)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where erf() is the standard error function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that when we draw this cumulative distribution for volatility 15%&#xA;above, letting the x axis be &quot;change in $\log (\text{price})$ (instead&#xA;of the percentage change in price), the x axis looks more like we&#xA;expect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If our limit order is $\lambda$% of the current price (meaning it's&#xA;$\lambda s$ where $s$ is the current price), it will only be hit if&#xA;the $\log (\text{price})$ moves more than $\left| \log (\lambda )&#xA;\right|$ (note that we need the absolute values since we're measuring&#xA;the absolute change in $\log (\text{price})$, which is always&#xA;positive). The chance of that happening is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$&#xA;   1-\text{erf}\left(\frac{\left| \log (\lambda ) \right|}{\sqrt{\pi } \sqrt{t}&#xA;    \log (v+1)}\right)&#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that we need the &quot;1-&quot; since we're looking for the probability the&#xA;$\log (\text{price})$ moves &lt;em&gt;more&lt;/em&gt; than the given amount.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, in this case, we're &lt;em&gt;given&lt;/em&gt; the probability and asked to&#xA;solve for the limit price. Using $p$ as the probability we find:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\lambda \to (v+1)^{-\sqrt{\pi } \sqrt{t} \text{erf}^{-1}(1-p)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the price is thus:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$s (v+1)^{-\sqrt{\pi } \sqrt{t} \text{erf}^{-1}(1-p)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;as in the answer section. Substituting 0.98 for p, we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$s (v+1)^{-0.0314192 \sqrt{t}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;as noted for this specific example.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Research and &quot;derivation&quot;&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;It turns out this is a well-known problem and has been studied extensively:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;It's the running maximum/minimum of Brownian motion:&#xA;&lt;a href=&quot;https://en.wikipedia.org/wiki/Brownian_motion&quot; rel=&quot;noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Brownian_motion&lt;/a&gt; also known as a Wiener&#xA;process&#xA;(&lt;a href=&quot;https://en.wikipedia.org/wiki/Wiener_process#Running_maximum&quot; rel=&quot;noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Wiener_process#Running_maximum&lt;/a&gt;)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Item 37 of &lt;a href=&quot;http://www.math.uah.edu/stat/brown/Standard.html&quot; rel=&quot;noreferrer&quot;&gt;http://www.math.uah.edu/stat/brown/Standard.html&lt;/a&gt;&#xA;establishes this maximum is the halfnormal distribution:&#xA;&lt;a href=&quot;https://en.wikipedia.org/wiki/Half-normal_distribution&quot; rel=&quot;noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Half-normal_distribution&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;This stackexchange/google search shows many more results:&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackexchange.com/search?q=brownian+halfnormal&quot;&gt;https://stackexchange.com/search?q=brownian+halfnormal&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It can also be regarded as the running maximum value of a random walk:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackexchange.com/search?q=brownian+halfnormal&quot;&gt;https://stackexchange.com/search?q=brownian+halfnormal&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Or as the fair value of a one-touch option: &lt;a href=&quot;http://www.investopedia.com/terms/o/onetouchoption.asp&quot; rel=&quot;noreferrer&quot;&gt;http://www.investopedia.com/terms/o/onetouchoption.asp&lt;/a&gt;:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/17083&quot;&gt;What is the fair price of this option?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/235&quot;&gt;Probability of touching&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;I myself wrote two questions to help answer this question, one&#xA;asking about a random walk and the other about what turns out to be&#xA;Brownian motion:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://mathematica.stackexchange.com/questions/110565&quot;&gt;https://mathematica.stackexchange.com/questions/110565&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://mathematica.stackexchange.com/questions/110657&quot;&gt;https://mathematica.stackexchange.com/questions/110657&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you use Mathematica (or just want to read even more about this subject),&#xA;you might look at my:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://github.com/barrycarter/bcapps/blob/master/STACK/bc-stock-min.m&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/barrycarter/bcapps/blob/master/STACK/bc-stock-min.m&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://github.com/barrycarter/bcapps/blob/master/box-option-value.m&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/barrycarter/bcapps/blob/master/box-option-value.m&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;the latter of which computes the probability that a stock price will&#xA;be between two given values at two given times (ie, the fair value of&#xA;an O&amp;amp;A &quot;box option&quot;) but can be used to answer your question in the&#xA;limiting case. See also: &lt;a href=&quot;https://money.stackexchange.com/questions/4312&quot;&gt;https://money.stackexchange.com/questions/4312&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Disclaimers and Notices&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I made several simplifying assumptions above:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;As noted in the references given in &quot;Other Answers&quot; above, the&#xA;more a stock's price decreases, the less likely it is to decrease&#xA;further. Why? Other people place limit orders, and the further down&#xA;the stock gets from its starting price, the more limit orders will&#xA;be triggered.  Generally, the &lt;em&gt;volume&lt;/em&gt; of limit orders &lt;em&gt;also&lt;/em&gt;&#xA;increases as the stock price goes down. In other words, the limit&#xA;orders act as a &quot;buffer&quot;, slowing the rate at which a stock's price&#xA;drops. The simple model I use does not account for this.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Conversely, I also ignore the &quot;volatility smile&quot;, which suggests&#xA;the exact opposite: that a larger change in price is &lt;em&gt;more&lt;/em&gt; likely&#xA;than what the normal distribution would yield, which means that&#xA;extreme prices are more likely that those given by the halfnormal&#xA;distribution.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The two points above aren't necessarily contradictory: under&#xA;normal conditions, the &quot;limit order book&quot; buffers price changes, but&#xA;during unusual circumstances (such as major news), the price can&#xA;change dramatically.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I also assume that once a stock reaches your limit price, your&#xA;order will be triggered. However, if there are several orders at&#xA;that price, the larger orders will trigger first, and the stock&#xA;price may rise again before your limit order is triggered at all.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Since this is a limit order and not an option, the risk-free&#xA;interest rate is not an issue: I assume you earn the risk-free&#xA;interest rate until the order is filled.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you don't earn the risk-free interest rate while waiting, note&#xA;that the small gain you get from the limit order may be offset by&#xA;the loss of interest.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h1&gt;Items Not Appearing in This Answer&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Although the inverse error function is well known and &quot;easy&quot; to&#xA;compute, I was going to include an approximation, but felt that might&#xA;exceed the scope of the question.&lt;/p&gt;&#xA;" OwnerDisplayName="user59" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2016-03-25T13:26:55.857" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="25076" PostTypeId="1" CreationDate="2016-03-25T17:07:02.310" Score="2" ViewCount="68" Body="&lt;p&gt;In this &lt;a href=&quot;http://www.nber.org/papers/w21722.pdf&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt;, the authors make a simple model with: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) A global bank, who is risk-neutral but has a Value-at-Risk constraint: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\max_{x_t^B} E_t[x_t^B\prime R_{t+1}]$$ s.t. $$\alpha (Var(x_t^B\prime R_{t+1}))^{\frac{1}{2}} &amp;lt;= 1$$ &#xA;where $R_{t+1}$ is a (n x 1) vector of returns, $x_t^B$ is a (n x 1) vector of weights $\alpha$ is a parameter, and $Var$ is the variance operator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried setting up a lagrangean which should yield:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathcal{L} = E_t[x_t^B\prime R_{t+1}] - \lambda_t (1 - \alpha (Var(x_t^B\prime R_{t+1}))^{\frac{1}{2}}) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first order conditions w.r.t. $x_t^B$ are yielding me:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ E_t(R_{t+1}) - \lambda_t \alpha  Var(x_t^B\prime R_{t+1})^{-\frac{1}{2}}  Var(R_{t+1}) x_t^B = 0 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In comparison with the solution given on the paper it seems that I have an extra term $ Var(x_t^B\prime R_{t+1})^{-\frac{1}{2}}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone help me on this? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="16472" LastEditDate="2016-03-25T18:07:18.577" LastActivityDate="2016-05-25T08:15:17.347" Title="Maximization with risk-neutral investors and VaR constraints" Tags="&lt;value-at-risk&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25077" PostTypeId="2" ParentId="25076" CreationDate="2016-03-25T17:45:53.087" Score="1" Body="&lt;p&gt;Regarding your question, you appear to treat variance as a linear operator, which it is not. But hard to tell as your parantheses don't match. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-03-25T17:45:53.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25078" PostTypeId="2" ParentId="25076" CreationDate="2016-03-25T20:11:22.453" Score="1" Body="&lt;p&gt;Completely agree with @Kiwiakos' remark, this is not a 'VaR' (Value-At-Risk) constraint but rather a 'Var' (Variance) constraint. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's how I would do it, I'll drop the superscript $B$ to keep notations uncluttered.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, square the original constraint to obtain an inequality involving variance instead of standard deviation. Next build the Lagrangian&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathcal{L}(x_t^\prime) = E_t[ x_t^\prime R_{t+1} ] - \lambda \left( 1 - \alpha^2 \text{Var}(x_t^\prime R_{t+1}) \right) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming no further constraints on the portfolio weights, KKT stationary condition writes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{\partial \mathcal{L}}{\partial x_t^\prime}(x_t^\prime) = \frac{\partial}{\partial x_t^\prime} \left( E_t[ x_t^\prime R_{t+1} ] - \lambda \left( 1 - \alpha^2 \left( E_t[\left(x_t^\prime R_{t+1}\right)^2] - E_t[x_t^\prime R_{t+1}]^2 \right) \right) \right) = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By linearity of the expectation operator, the RHS equally writes&#xA;$$ \frac{\partial \mathcal{L}}{\partial x_t^\prime}(x_t^\prime) = E_t[ R_{t+1} ] + \lambda \alpha^2 \left( E_t[2(x_t^\prime R_{t+1})R_{t+1}] - 2 E_t[x_t^\prime R_{t+1}] E_t[R_{t+1}] \right) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, because the portfolio weights $x_t$ are known at time $t$&#xA;\begin{align}&#xA;\frac{\partial \mathcal{L}}{\partial x_t^\prime}(x_t^\prime) &amp;amp;= E_t[ R_{t+1} ] + 2 x_t^\prime \lambda \alpha^2 \left( E_t[R_{t+1}^2] - E_t[R_{t+1}]^2 \right) \\&#xA;&amp;amp;= E_t[ R_{t+1} ] + \tilde{\lambda} x_t^\prime \text{Var}(R_{t+1})&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is that the result given in you referenced paper? I can't quite confirm since it appears to be behind a paywall.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-05-25T08:15:17.347" LastActivityDate="2016-05-25T08:15:17.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25081" PostTypeId="1" CreationDate="2016-03-25T20:54:58.560" Score="1" ViewCount="56" Body="&lt;p&gt;First and foremost thank you for reading my question, I hope all if you have a Happy Holiday this weekend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On to my question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am completing an assignment on global sovereign bonds, I've been provided with a deck of countries followed with data on bond issuance date, maturity, coupon. The deck also includes yield (to maturity, call, worst), spread and et cetera.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am asked to calculate expected total returns over the next 12 months based on target spreads provided. I am to categorize the expected returns into different categories (e.g. 5-10 year maturity sovereigns, credit rating). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On each of these categories I am to calculate expected return from spread and expected return from carry (i.e. yield). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm confused by what the difference between these two are.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks again!&lt;/p&gt;&#xA;" OwnerUserId="20035" LastActivityDate="2016-03-29T02:16:32.307" Title="Indexes and return spreads" Tags="&lt;spread&gt;&lt;yield&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25083" PostTypeId="2" ParentId="25072" CreationDate="2016-03-26T13:24:45.137" Score="1" Body="&lt;p&gt;The trick to this question is that you are asked to build a risk-free &lt;em&gt;portfolio&lt;/em&gt;, so its individual assets can be risky assets.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Imperfect markets - If there are price inconsistencies on different markets, say market A is high and market B is low, you can build a risk-free portfolio which nets to a profit by buying a security on market B for a low price and selling to market A for a higher price.&lt;/li&gt;&#xA;&lt;li&gt;Perfect negative correlations - If two assets have a perfect negative correlations such that any price movement in security A is perfectly offset by price movements in security B, then a portfolio of equals parts A and B is risk-free as it is perfectly hedged.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="20044" LastActivityDate="2016-03-26T13:24:45.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25084" PostTypeId="2" ParentId="24742" CreationDate="2016-03-26T19:33:58.427" Score="1" Body="&lt;p&gt;VIX index options can never be perfectly hedged, given the fact that  VIX futures are traded in lots, not as standalone contracts like equities. Hence we cannot always have 'x' futures to short.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the closest you can achieve here is by using straddles (buying puts against long call positions to hedge).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Besides I'm not aware of VIX ETFs if any, so wouldn't advise on those lines.&lt;/p&gt;&#xA;" OwnerUserId="19434" LastEditorDisplayName="user13444" LastEditDate="2016-12-25T08:59:16.050" LastActivityDate="2016-12-25T08:59:16.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25085" PostTypeId="2" ParentId="25072" CreationDate="2016-03-26T19:41:51.923" Score="0" Body="&lt;p&gt;Many have quoted a delta hedged option to be a risk free asset. However, I totally beg to differ here because by risk free asset , we mean a guaranteed return in future ( which is not the case with dh option). Also , a delta hedged option still has vega risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, In my opinion , other than treasury , you can consider your savings bank account as a risk free asset !&lt;/p&gt;&#xA;" OwnerUserId="19434" LastActivityDate="2016-03-26T19:41:51.923" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="25086" PostTypeId="1" AcceptedAnswerId="25119" CreationDate="2016-03-26T20:53:57.523" Score="8" ViewCount="11759" Body="&lt;p&gt;I am currently attempting to calculate the halflife of a mean reverting series using python programming language and the theory of the Ornstein–Uhlenbeck process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a series which when plotted looks like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.imgur.com/fWims5S.png&quot; alt=&quot;Mean reverting series&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which obviously looks rather mean reverting. I am carrying out the following using python code to find the halflife (FYI the series shown above is held in the variable (z_array):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import numpy as np&#xA;import statsmodels.api as sm&#xA;&#xA;#set up lagged series of z_array and return series of z_array&#xA;z_lag = np.roll(z_array,1)&#xA;z_lag[0] = 0&#xA;z_ret = z - z_lag&#xA;z_ret[0] = 0&#xA;&#xA;#run OLS regression to find regression coefficient to use as &quot;theta&quot;&#xA;model = sm.OLS(z_ret,z_lag)&#xA;res = model.fit()&#xA;&#xA;#calculate halflife&#xA;halflife = -log(2) / res.params[0]&#xA;print  'Halflife = ',halflife&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The code runs fine, however for this series I am getting a halflife of 680.5 days - I can see from the chart that this looks very wrong. Full reversions are happening within a fraction of that time frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could someone please advise me as to where I am going wrong with this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help much appreciated!&lt;/p&gt;&#xA;" OwnerUserId="20049" LastActivityDate="2016-03-28T20:04:19.193" Title="Calculating half life of mean reverting series with python" Tags="&lt;python&gt;&lt;mean-reversion&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25087" PostTypeId="2" ParentId="10681" CreationDate="2016-03-26T21:05:39.927" Score="1" Body="&lt;p&gt;There are a few good answers up there explains the technical differences between Brownian and geometric Brownian motion. I think it may still help to give a binomial model breakdown to get an intuitive feel.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Brownian Motion&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose the underlying moves from $x \to x+s$ with probability $p$ and from $x \to  x-s$ with probability $1-p$. Then the mean and variance are&#xA;$$&#xA;\begin{eqnarray}&#xA;E[x] &amp;amp;=&amp;amp; x+ (2p-1) s \\&#xA;Var(x) &amp;amp;=&amp;amp; 4 s^2 p(1-p)&#xA;\end{eqnarray}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Geometric Brownian Motion&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now suppose the underlying moves instead as $y \to y e^{s}$ with probability $p$ and $y \to y e^{-s}$ with probability $1-p$. Then we get&#xA;$$&#xA;\begin{eqnarray}&#xA;E[y] &amp;amp;=&amp;amp; y( p e^{s} +(1-p)  e^{-s}) \\&#xA;Var(y) &amp;amp;=&amp;amp; y^2 p(1-p)(e^s-e^{-s})^2&#xA;\end{eqnarray}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you can &lt;strong&gt;convince yourself&lt;/strong&gt; (using Martingales or properties of lognormal distributions) &lt;strong&gt;that setting $r=0$ in the original question is the equivalent of demanding $E[y]=y$&lt;/strong&gt;. We find that $p=\frac{1}{1+e^s}$. If we feed this $p$ into $E[x]$ we find that it is &lt;em&gt;not&lt;/em&gt; driftless. In fact taking the small $s$ limit by Taylor expanding we get&#xA;$$&#xA;\begin{eqnarray}&#xA;E[x] &amp;amp;=&amp;amp; x- \frac{1}{2}s^2 \\&#xA;Var(x) &amp;amp;=&amp;amp; 4 s^2&#xA;\end{eqnarray}&#xA;$$&#xA;matching the continuous time results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Punchline:&lt;/strong&gt; Since geometric Brownian motion corresponds to exponentiating a Brownian motion, if the former is driftless, the latter is not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Relation to a puzzle&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well this is not strictly a puzzle but &lt;em&gt;may&lt;/em&gt; seem counterintuitive at first. Suppose we play a game where you have $X$ dollars and toss a fair coin and I pay you $2X$ if you get heads and you pay me $\frac{1}{2}X$ if you get tails. How much is the game worth. Even though the &lt;em&gt;tree is recombining&lt;/em&gt; in that equal number of heads and tails would get you back to $X$ the process is &lt;strong&gt;not&lt;/strong&gt; a Martingale since&#xA;$&#xA;.5~ 2X + .5 ~\frac{1}{2} X = \frac{5}{4} X&#xA;$&#xA;and so the price is $\frac{1}{4} X$.&lt;/p&gt;&#xA;" OwnerUserId="19878" LastActivityDate="2016-03-26T21:05:39.927" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25088" PostTypeId="1" CreationDate="2016-03-26T22:38:10.437" Score="1" ViewCount="31" Body="&lt;p&gt;Imagine a situation where a business negotiates contracts for the maintenance of widgets it sells.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Situation&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Customer buys 20 widgets.&lt;/li&gt;&#xA;&lt;li&gt;Customer negotiates contract for widgets to be serviced/replaced.&lt;/li&gt;&#xA;&lt;li&gt;Business makes money by servicing or replacing widgets at a cost lower than the contract payment. &#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;(Contract Payment - Actual Maintenance Cost &gt; 0 ... profit!)&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Rules&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Each contract is for multiple widgets.&lt;/li&gt;&#xA;&lt;li&gt;Each widget can only be in use for a specified period of time before repair. However, these repair periods can be stretched for a percentage of time with minimal risk to the widget.&lt;/li&gt;&#xA;&lt;li&gt;Each widget has a limited number of repair cycles before it needs to be replaced.&lt;/li&gt;&#xA;&lt;li&gt;Buying widgets is always more expensive than repairing widgets.&lt;/li&gt;&#xA;&lt;li&gt;Widget inspections must accompany every potential repair.&lt;/li&gt;&#xA;&lt;li&gt;Multiple &lt;strong&gt;inspection event types&lt;/strong&gt; exist (Level 1, Level 2). Level 2 is MUCH more expensive.&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Level 1 can occur for a small number of widgets rather cheaply.&lt;/li&gt;&#xA;&lt;li&gt;Level 2 must occur for all widgets&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;A repair event is cheaper if it occurs when multiple widgets can be inspected and repaired at once.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What would be appropriate algorithms to forecast the best possible schedule for inspecting/replacing/repairing widgets on a contract over time to maximize &lt;strong&gt;profit&lt;/strong&gt;? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;They key goal is to stagger inspection events to have the fewest inspection events and fewest new widget purchases over the life of a contract. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example -&lt;/strong&gt; Widget 1 can be in use for 100 hours before repair. Widget 2 can be in use for 110 hours before repair. Stagger Widget 1 forward 10 hours to inspect both at the same time instead of doing an inspection/repair at 100 and 110 hours.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am doing research on &lt;em&gt;branch and bound&lt;/em&gt; ... A* and &lt;em&gt;minimum spanning tree algorithms&lt;/em&gt;, but I am not sure which approach was more appropriate for the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please note that this seems similar to &lt;a href=&quot;https://quant.stackexchange.com/questions/20/what-type-of-analysis-is-appropriate-for-assessing-the-performance-time-series-f&quot;&gt;What type of analysis is appropriate for assessing the performance time-series forecasts?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20050" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-03-26T22:38:10.437" Title="What are appropriate algorithms for forecasting contract schedules to maximize profit?" Tags="&lt;forecasting&gt;&lt;algorithm&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25090" PostTypeId="1" CreationDate="2016-03-27T00:03:48.430" Score="5" ViewCount="481" Body="&lt;p&gt;I have been reading about Least-Squares Monte Carlo (using Longstaff &amp;amp; Schwartz algorithm) for option pricing.&#xA;So far, I have only read examples that uses LSMC for american/bermudan PUT options only.&#xA;Is there any reason for that? Or can LSMC also be used to price American CALLS? If not, then why not?&lt;/p&gt;&#xA;" OwnerUserId="18211" LastActivityDate="2016-04-02T19:26:10.740" Title="Can call options be priced with Least-Squares Monte Carlo?" Tags="&lt;monte-carlo&gt;&lt;american-options&gt;&lt;bermudan&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25091" PostTypeId="2" ParentId="25090" CreationDate="2016-03-27T00:53:13.650" Score="5" Body="&lt;p&gt;American calls on a non-dividend paying stock are worth the same as European ones so there is no point to using least-squares. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2016-03-27T00:53:13.650" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25092" PostTypeId="1" AcceptedAnswerId="25093" CreationDate="2016-03-27T01:36:43.097" Score="2" ViewCount="203" Body="&lt;p&gt;What qualifications do the traders have that quants don't?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that they are not expected to know as much math, but that can't be it, can it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I'm not in finance, nor am I really planning to go there. I'm just curious, so don't get too technical please)&lt;/p&gt;&#xA;" OwnerUserId="20052" LastActivityDate="2016-03-27T02:07:50.587" Title="What qualifications do the traders have that quants don't?" Tags="&lt;trading&gt;&lt;quants&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25093" PostTypeId="2" ParentId="25092" CreationDate="2016-03-27T02:07:50.587" Score="5" Body="&lt;p&gt;The right amount of confidence and courage to take risks with other people's money without shading into overconfidence and bad judgement. Especially coping with the emotional pressure of losses without losing your head and doing the wrong thing. It also helps to do mental arithmetic quickly and accurately and have a good short term memory for figures, all in noisy, chaotic environment. (Notice that not much of this can be learned in a classroom...)&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2016-03-27T02:07:50.587" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25094" PostTypeId="1" AcceptedAnswerId="25100" CreationDate="2016-03-27T02:43:05.993" Score="0" ViewCount="11766" Body="&lt;p&gt;So the question asks: L et $S(0) = 120$ dollars, $u = 0.2$, $d = −0.1$ and $r = 0.1$. Consider a call option with strike price $X = 120$ dollars and exercise time $T = 2$. Find the option price and the replicating strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the solution is: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The option price at time $0$ is $22.92$ dollars. (Yes, I got the same answer)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition to this amount, the option writer should borrow $74.05$(?) dollars and buy $0.8081$ (?) of a share. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;At time 1, if $S(1) = 144$, then the amount of stock held should be increased to 1 share, the purchase being financed by borrowing a further $27.64$ dollars, increasing the total amount of money owed to $109.09$ dollars. (Understood. $144*(1-0.8081) = 27.64$, $27.64+74.05+7.4=109.09$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If, on the other hand, $S(1) = 108$ dollars at time $1$, then some stock should be sold to reduce the number of shares held to $0.2963$(why?), and $55.27$ (?) dollars should be repaid, reducing the amount owed to $26.18$ (what?) dollars. (In either case the amount owed at time 1 includes interest of 7.40 dollars on the amount borrowed at time 0.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So basically, I really can't see why it decides to buy $0.8081$ share at time 0?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, where does the number $0.2963$ come from? Even though the share should be reduced to $29.63%$, how does it come out with the repaid amount, $55.27$ and the amount owned, $26.18$?&lt;/p&gt;&#xA;" OwnerUserId="19479" LastActivityDate="2016-03-27T16:59:25.147" Title="Replication strategy of European call option" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;equities&gt;&lt;quant-trading-strategies&gt;&lt;binomial-tree&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25095" PostTypeId="1" AcceptedAnswerId="25099" CreationDate="2016-03-27T03:14:37.323" Score="1" ViewCount="159" Body="&lt;p&gt;Please explain why put call parity could be compared to the payoff of a long forward contract. &#xA;ie. $C_E-P_E=V_X(0)$ where $C_E,P_E$ are the call/put premiums and $V_X(0)$ is the value of a long forward contract. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also please explain why if strike price $X$is equal to the theoretical forward price $S(0)e^{rT}$ of the asset, then the value of the forward contract is $0$, and so $C_E=P_E$&lt;/p&gt;&#xA;" OwnerUserId="17063" LastActivityDate="2016-03-27T11:11:00.397" Title="Put call parity: when are the premiums the same?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;call&gt;&lt;put-call-parity&gt;&lt;put&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25096" PostTypeId="1" AcceptedAnswerId="25109" CreationDate="2016-03-27T04:29:11.077" Score="1" ViewCount="807" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;A company pays £1,200,000 to purchase a property. The company pays £30,000 at the end of each of the next six months to renovate the property. At the end of the eighth month the company sells the property for £1,500,000. The project’s cost of capital is an annual effective interest rate of 8%. What is the net present value of this project for the company?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What I tried-&lt;/strong&gt;&#xA;I know that NPV= Presnt value of sum of net cash flows-&lt;/p&gt;&#xA;&#xA;&lt;p&gt;below is the timeline for this cash flows&#xA;&lt;a href=&quot;https://i.stack.imgur.com/1KjwJ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/1KjwJ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am having problem in calculating the present value of 30,000.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please help me to solve this.&lt;/p&gt;&#xA;" OwnerUserId="19036" LastEditorUserId="848" LastEditDate="2016-03-28T07:04:22.493" LastActivityDate="2016-03-28T07:04:22.493" Title="How to calculate the NPV (Net present Value) in this question?" Tags="&lt;interest-rates&gt;&lt;present-value&gt;&lt;monthly&gt;&lt;cash-or-nothing&gt;" AnswerCount="1" CommentCount="5" ClosedDate="2016-03-28T07:05:26.743" ContentLicense="CC BY-SA 3.0" />
  <row Id="25097" PostTypeId="1" AcceptedAnswerId="25114" CreationDate="2016-03-27T06:57:05.420" Score="4" ViewCount="402" Body="&lt;p&gt;I have a single period market, and three states, and I have 3 risky assets. I assume no interest. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I have three states $\Omega=\{\omega_1,\omega_2,\omega_3\}$. All assets start with the value 1, and for each n the price of risky asset n, is 2 in $\omega_n$ and the other assets have value 0. That is, the price function is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_1(0)=1,S_2(0)=1,S_3(0)=1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_1(1,\omega_1)=2,S_1(1,\omega_2)=0,S_1(1,\omega_3)=0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_2(1,\omega_1)=0,S_2(1,\omega_2)=2,S_2(1,\omega_3)=0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_3(1,\omega_1)=0,S_3(1,\omega_2)=0,S_3(1,\omega_3)=2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, the theory says that there is no arbitrage iff there exists a risk neutral probability measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From what I see there is no risk neutral probability measure, because then we would have to have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\begin{bmatrix}2 &amp;amp;0 &amp;amp; 0 \\0&amp;amp;2 &amp;amp; 0\\0 &amp;amp;0 &amp;amp;2 \\ 1&amp;amp;1&amp;amp;1\end{bmatrix}\begin{bmatrix}q_1\\ q_2 \\q_3\end{bmatrix}=\begin{bmatrix}1\\1\\1\\1\end{bmatrix}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And this set of equations have no solutions, hence there should exist an arbitrage opportunity?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I can't find a strategy which guarantees money, I have tried to find it numerically, but wasn't able to find one. Do you see the strategy or have I made mistake somewhere?&lt;/p&gt;&#xA;" OwnerUserId="11692" LastEditorUserId="11692" LastEditDate="2016-03-27T07:02:12.767" LastActivityDate="2016-03-28T15:09:02.340" Title="What is the arbitrage opportunity in this simple one-period market?" Tags="&lt;arbitrage&gt;&lt;risk-neutral-measure&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25098" PostTypeId="2" ParentId="25090" CreationDate="2016-03-27T10:35:34.033" Score="1" Body="&lt;p&gt;Mark Joshi's answer is totally correct. But I would appreciate to elaborate a little.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In textbooks you often read the exact same argument he pointed out to you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice however, in the equities world, you almost always have to deal with dividends. So it is rather the American put which becomes similar to its European counterpart, and the American call which starts differing from its European parent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is especially true in the current low/negative rates environment. You can take any single stock option chain to check that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I would say it really depends on the market you are looking at. But anyways,  yes, LSM can be used both for American puts and call (and even more complex payoffs such as Bermudan options).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't forget that it only produces a lower bound though. You can find more info in the brilliant papers of @Mark Joshi.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-03-31T16:40:48.033" LastActivityDate="2016-03-31T16:40:48.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25099" PostTypeId="2" ParentId="25095" CreationDate="2016-03-27T10:59:29.993" Score="2" Body="&lt;p&gt;The intuitive explanation is given in @Alex C's comment. You should stick to that if you understand it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet, if you are more comfortable with a mathematical approach:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Payoff of being long a forward contrat with maturity $T$: $(S_T - X)$. Interpretation: at time $T$, you pay a certain price $X$ in exchange for which you receive the underlying $S_T$&lt;/li&gt;&#xA;&lt;li&gt;Payoff of being long a call option struck at $X$ and with maturity $T$: $(S_T - X)^+$. Interpretation: at time $T$, you exercise if the underlying's value is &lt;em&gt;greater&lt;/em&gt; than the strike price, in which case you earn the difference between the 2, otherwise you do nothing.&lt;/li&gt;&#xA;&lt;li&gt;Payoff of being long a put option  struck at $X$ and with maturity $T$: $(X - S_T)^+$. Interpretation: at time $T$, you exercise if the underlying's value is &lt;em&gt;smaller&lt;/em&gt; than the strike price, in which case you earn the (absolute) difference between the 2, otherwise you do nothing.&lt;/li&gt;&#xA;&lt;li&gt;Payoff of being long (+) call option struck at $X$ and short (-) a put struck at $X$ at maturity $T$, is the difference of the 2 previous ones:&#xA;\begin{align}&#xA;(S_T - X)^+ - (X - S_T)^+ &amp;amp;= (S_T - X)1\{S_T \geq X\} - (X - S_T)1\{S_T \leq X\} \\&#xA;&amp;amp;= (S_T - X)1\{S_T \geq X\} + (S_T - X)1\{S_T \leq X\} \\&#xA;&amp;amp;= (S_T - X)&#xA;\end{align}&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As you can see, being long a forward with 'strike' $X$ and being long a call/short a put with strikes $X$ give the same payoff at $T$: $(S_T-X)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By &lt;strong&gt;absence of arbitrage opportunity&lt;/strong&gt;, &lt;em&gt;these two strategies should therefore have exactly the same value today&lt;/em&gt;, that is:&#xA;$$ C_E(S_0;T,X) - P_E(S_0;T,X) = V_X(0) $$&#xA;which is the famous &lt;strong&gt;put-call parity relationship&lt;/strong&gt;, where $V_X(0)$ represents the value of being long a forward contract struck at $X$ and with maturity $T$ as seen of today, in other words&#xA;$$ V_X(0) = P(0,T)(F(0,T)-X)$$&#xA;with $P(0,T)$ representing the discount factor applying to cash-flows paid at $T$ and $F(0,T)$ the fair forward value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By setting $X$ (strike price) equal to $F(0,T)$ (forward value $S_0e^{rT}$ in the absence of dividends), then you see that $V_X(0) = 0$ and put-call parity re-writes as&#xA;$$ C_E(S_0;T,X) - P_E(S_0;T,X) = V_X(0) = 0 $$&#xA;meaning &#xA;$$ C_E = P_E $$&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-03-27T11:11:00.397" LastActivityDate="2016-03-27T11:11:00.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25100" PostTypeId="2" ParentId="25094" CreationDate="2016-03-27T11:35:04.627" Score="3" Body="&lt;p&gt;You are at the beginning of a period and the stock price, worth $S$, can evolve in either of the 2 states: $S_u = u S$ or $S_d = d S$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The part you don't understand is related to forming so-called &lt;strong&gt;replicating portfolios&lt;/strong&gt;. More specifically, using only the stock and a (risk-less) cash account, the question is 'How can one build a portfolio allowing to perfectly replicate the option's behaviour over a given time frame' (here a period of the binomial tree).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\Pi$ denote such a portfolio. Let $\Pi$ consists of $\alpha$ shares of the stock and $\beta$ in cash. Both $\alpha$ and $\beta$ can be positive or negative depending on if you own/sold shares or borrowed/lent cash.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Pi = \alpha S + \beta$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the moment we don't know $\alpha$ nor $\beta$. But we can determine them easily. Indeed, at the end of a period, suppose that the option is worth $V_u$ in the up state and $V_d$ in the down state. Then, because we want our portfolio to be replicating, we want its value $\Pi$ to evolve to the exact same states i.e. $\Pi_u = V_u$ and $\Pi_d = V_d$. This yields two equations:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Pi_u = \alpha S_u + \beta (1 + R) = V_u$$&#xA;$$\Pi_d = \alpha S_d + \beta (1 + R) = V_d$$&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The shares' component of portfolio $\Pi$ evolved from $\alpha S$ to $\alpha S_u$ or $\alpha S_d$, because the stock price evolved.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The amount of cash $\beta$ borrowed/lent at the beginning of the period, has cost/earned us some interest, hence the factor $1+R$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Solve these 2 equations for the 2 uknowns $\alpha$ and $\beta$ to end up with:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;\alpha &amp;amp;= \frac{V_u - V_d}{S_u-S_d} \\&#xA;\beta &amp;amp;= \frac{1}{1+R} \frac{u V_d - d V_u}{(u-d)}&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This gives you the number of shares ($\alpha$) you need to buy/sell and cash ($\beta$) you need to borrow/lend to perfectly replicate the option. Of course because the portfolio is replicating $\Pi = V$ the option value at the beginning of the period, which is a good way to check whether you made a mistake.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you've built your option tree in the right way (which seems to be the case since you agree on the option premium) then on the first period you can compute $\alpha$ and $\beta$ from the above equations and it should give you the numbers that puzzle you, i.e. $0.8081$ and $-74.05$ respectively. Note that if you do the computations $\Pi = 0.8081\times120 - 74.05 = 22.92 = V$, hence ok. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you can repeat the calculation for any future period to get the amount of shares and cash you should borrow/lend to further replicate the option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A subtle point here: the exercise considers that you are hedging the option. In other words, you are long the option but short the replication portfolio. This is why although you'll find $\alpha = +0.8081$ (buy shares) and $\beta=-74.05$ (lend cash) over the first period, you should actually reverse that position (because you are short the replicating portfolio when hedging a long option  position).&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-03-27T16:59:25.147" LastActivityDate="2016-03-27T16:59:25.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25101" PostTypeId="2" ParentId="25097" CreationDate="2016-03-27T16:50:51.993" Score="0" Body="&lt;p&gt;I have not studied this, but intuitively...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If all of the states had equal probability of occurring, then the expectation of each asset $E[S_n] = \frac{2}{3}$.&lt;br&gt;&#xA;Imagine instead the probability of $\omega_1$ was $0.5$, with the other two $0.25$.&lt;br&gt;&#xA;Now $E[S_1] = 1, E[S_2]=E[S_3]=\frac{1}{3}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems to me, irrespective of the probabilities of the states, the expectation of the equal weighted market as a whole is 2/3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &lt;a href=&quot;https://en.wikipedia.org/wiki/Risk-neutral_measure&quot; rel=&quot;nofollow&quot;&gt;wikipedia for Risk Neutral Measure&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A risk neutral measure is a probability measure Q on the set of states such that there exists an &lt;em&gt;r&lt;/em&gt; (the &quot;discount rate&quot;) with&lt;br&gt;&#xA;  $q_i = rE_Q[D_i]$ for each $i$ where $D_i$  [...] represents the payoff of security $i$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In this case there does exist an $r$, and maybe it equals $\frac{2}{3}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we set if $q_1 = q_2 = q_3 = \frac{1}{2}$ then this all appears to work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With respect to arbitrage, well, given their -ve expectation, presumably you can short the stocks, and have a positive expectation? For example sell 1 share of each of $S_1, S_2, S_3$ and keep the proceeds ($3$) at zero interest. In the second period you can buy back (in all states) for $2$. Making free money. &lt;/p&gt;&#xA;" OwnerUserId="17303" LastActivityDate="2016-03-27T16:50:51.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25102" PostTypeId="1" CreationDate="2016-03-27T17:20:13.403" Score="1" ViewCount="395" Body="&lt;p&gt;So the question asks: Given a 3-steps Binomial Tree model with $S(0) = 50$, $U = 20%,D = 20%$, and $R = 5%$. A European call option has the strike price $X = 40$ and maturity time $T = 3$. Also, a Put-on-Call option is written on this European call option with maturity time T = 2, i.e, the final&#xA;payoff (at T = 2) of PoC option is given by H(T) = max ($K_p -C_E(2), 0)$, where $C_E(2)$ is the value (price) of the underlying European call option at T = 2. The strike price of the outside put option $K_p = 12$. Find out the initial price of this Put-on-Call option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So so far I have: &#xA;&lt;a href=&quot;https://i.stack.imgur.com/5VQiF.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/5VQiF.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/O7cX3.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/O7cX3.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;Where I constructed the binomial tree model for the European call option only ( without the put-on-call option). So I got the European call option price is $16.4669042$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what exactly is the $C_E(2)$, the value (price) of the underlying European call option at T = 2?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it C(2) = max{0, 0.5(S(1)+S(2)) - X}?  If so I then have three C(2)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, what is the final payoff H(T) at T=2? Where should it go on the graph? &lt;/p&gt;&#xA;" OwnerUserId="19479" LastActivityDate="2016-03-28T09:49:15.380" Title="Put-on-call option confusion" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;equities&gt;&lt;finance&gt;&lt;binomial-tree&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25103" PostTypeId="1" CreationDate="2016-03-27T18:45:33.987" Score="2" ViewCount="1344" Body="&lt;p&gt;Exactly, I need balance sheet, income statement, cash flow statement, stock market, bankruptcy situation, fraud situation and corporate governance data of companies in USA.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks beforehand,&lt;/p&gt;&#xA;" OwnerUserId="20054" LastActivityDate="2020-02-03T12:32:57.430" Title="what data sources are useful for obtaining financial statement data of listed companies NYSE and NASDAQ?" Tags="&lt;market-data&gt;&lt;finance&gt;&lt;historical-data&gt;&lt;accounting&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25105" PostTypeId="2" ParentId="25103" CreationDate="2016-03-27T19:50:29.430" Score="2" Body="&lt;p&gt;I am not sure if all companies you are looking for will be listed there but SEC-filing entities must file their reports to EDGAR (Electronic Data Gathering, Analysis, and Retrieval system). This system is available for use by the general public.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.sec.gov/edgar/searchedgar/webusers.htm&quot; rel=&quot;nofollow&quot;&gt;https://www.sec.gov/edgar/searchedgar/webusers.htm&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20044" LastActivityDate="2016-03-27T19:50:29.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25107" PostTypeId="1" AcceptedAnswerId="25110" CreationDate="2016-03-27T20:07:52.170" Score="1" ViewCount="354" Body="&lt;p&gt;Why do counterparty risk pricing adjustments need be considered in a bilateral counterparty risk perspective?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="17490" LastActivityDate="2016-03-28T09:41:51.660" Title="Bilateral Counterparty risk" Tags="&lt;risk&gt;&lt;counterparty-risk&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25108" PostTypeId="2" ParentId="25102" CreationDate="2016-03-27T21:40:36.877" Score="1" Body="&lt;p&gt;Your confusion certainly comes from the fact the underlying on which the put option is written is not the stock anymore but rather another option. We call that a &lt;strong&gt;compound option&lt;/strong&gt; in derivatives lingo.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would you price the option if it were a simple put expiring at $T=2$ and not an obscure put-on-call? Well, you would have started at the end of the period representing the maturity of your option (here the put expiries at $T=2$, so this is the end of the second period) and for each tree node you found there, call them $S_{uu}=S(0)(1+u)^2, S_{ud}=S(0)(1+u)(1+d)$ and $S_{dd}=S(0)(1+d)^2$ for up-up, up-down and down-down states, you would have set the option value as equal to its payoff. For a standard put option, because you know the value which the stock takes on the 3 different tree nodes, this would have given: $P_{uu}=\max(K_p - S_{uu},0)$, $P_{ud}=\max(K_p - S_{ud},0)$ and $P_{dd}=\max(K_p - S_{dd},0)$. Once done, you would have then worked your way up to the root by backwards induction, computing $P_{u}$ and $P_{d}$ and finally inferring $P$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only thing that changes here, is that the underlying consists of a call option rather than the stock. At the end of the second period, your put-on-call option is therefore worth $P_{uu}=\max(K_p - C_{uu},0)$, $P_{ud}=\max(K_p - C_{ud},0)$ and $P_{dd}=\max(K_p - C_{dd},0)$. This is precisely what is meant by the formula&#xA;$$H(T=2) = \max(K_p - C_E(2), 0)$$&#xA;where &lt;strong&gt;$C_E(2)$ represents the value at $T=2$ of a European call option with maturity $T=3$ and strike $X$ as given in your exercise&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now finding $C_E(2)$ (in other words the values $C_{uu}, C_{ud}$ and $C_{dd}$) is a standard binomial tree pricing problem and is exactly what you already did above:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Use a 3-period binomial tree. Start at the end of the tree and set the option value as equal to its payoff, that is: $C_{uuu}=\max(S_{uuu}-X,0)$, $C_{uud}=\max(S_{uud}-X,0)$, $C_{ddu}=\max(S_{ddu}-X,0)$ and $C_{ddd}=\max(S_{ddd}-X,0)$). Then move backwards by one period to obtain the desired values $C_{uu}, C_{ud}$ and $C_{dd}$.&lt;/li&gt;&#xA;&lt;li&gt;Now that you understood how it works, you see that you could also have simply 'extended' the tree on which you were working to price the put(-on-call) option and use the extra part to find the value at $T=2$ of the call option.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Anyway, once you have determined the values $P_{uu}$, $P_{ud}$ and $P_{dd}$ of the put-on-call option at $T=2$ (the values you came up with for $C_{uu}$, $C_{ud}$ and $C_{dd}$ in your tree above i.e. $33.905$, $10.476$ and $0$ are perfectly fine), you can go back to using the standard approach. Simply move backwards computing $P_{u}$ and $P_{d}$ and finally $P$ and you're done!&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-03-28T09:49:15.380" LastActivityDate="2016-03-28T09:49:15.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25109" PostTypeId="2" ParentId="25096" CreationDate="2016-03-28T00:08:35.810" Score="2" Body="&lt;p&gt;I have laid out below one way of solving this kind of problem. You have your timeline right and I have reproduced it with the correct amounts. The way to discount your 30Ks is the same as discounting 1,500K if you do it this way. Basically, you need to compute a discount factor. To calculate this discount factor, you need to de-annualize your interest rate by dividing by 12 months. This amount is then compounded at each period. To help you understand, here is the formula I have in the first cell under Discount factor (C2):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;=(1+0.08/12)^A2-1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see. The annual rate is divided by 12, you add 1 to it and take the power of it in relation with the period. The first period has no discount factor given that no time has elapsed. Finally, note that I have subtracted 1 from the Discount factor so that you could see the relation between annual rate and effective rate but in reality the discount factor does not subtract 1 (see how in period 12 the rate is 8.30% instead of 8.00% ? that's the effective rate (EIR) instead of annual rate (APR)).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, to calculate the discounted amount you need to divide the amount by its discount factor (in this case you would need to add 1 to it).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The final NPV is 46,474$, assuming there is no tax involved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/d26ow.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/d26ow.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20044" LastActivityDate="2016-03-28T00:08:35.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25110" PostTypeId="2" ParentId="25107" CreationDate="2016-03-28T09:41:51.660" Score="2" Body="&lt;p&gt;If each party uses unilateral CCR model, i.e. Only takes into account the other party's probability of default, they are much less likely to agree on a price and actually trade. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, you want to take your own default into account simply because it is market observable through cds and bond spreads. And because it will affect your funding.&lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2016-03-28T09:41:51.660" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25111" PostTypeId="1" AcceptedAnswerId="25115" CreationDate="2016-03-28T12:19:30.180" Score="8" ViewCount="9877" Body="&lt;p&gt;Futures are traded on margin, so that the P&amp;amp;L of any open position is realized on the posted margin. To maintain a constant exposure to the future, an expiring contract needs to be rolled into a new contract. I have read that the cost of doing this (using a calendar spread for example) is just the difference between the prices of the two contracts. I don't see why this is the case - all the P&amp;amp;L on the original position would have been realized at the time of rolling, so why would we need to pay or gain the difference between the two contracts?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, am I correct in understanding that a backadjusted price series does not take into account the cost of rolling? I.e. to get a proper account of a trading strategy backtested on this data, we would need to add in the cost of rolling (plus other costs).&lt;/p&gt;&#xA;" OwnerUserId="20059" LastActivityDate="2018-09-24T09:14:50.600" Title="Cost of rolling futures contracts" Tags="&lt;trading&gt;&lt;futures&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25112" PostTypeId="1" CreationDate="2016-03-28T12:45:34.073" Score="0" ViewCount="508" Body="&lt;p&gt;Why when replicating a call option, the money market position (bond, risk free investment) is negative and when replicating a call option, the money market position is positive? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please explain intuitively and with a simple proof.&lt;/p&gt;&#xA;" OwnerUserId="17063" LastActivityDate="2016-03-28T12:45:34.073" Title="Portfolio replication option pricing: Money market position" Tags="&lt;options&gt;&lt;option-pricing&gt;" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="25114" PostTypeId="2" ParentId="25097" CreationDate="2016-03-28T15:09:02.340" Score="5" Body="&lt;p&gt;Sell 1 unit of S1,2,3 respectively, gain 3; buy 2 units of risk-free asset, cost 2. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;No matter which state appears, the future payoff/loss is 0 for sure, while you will gain 1 at the beginning. &lt;/p&gt;&#xA;" OwnerUserId="13819" LastActivityDate="2016-03-28T15:09:02.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25115" PostTypeId="2" ParentId="25111" CreationDate="2016-03-28T15:09:55.050" Score="7" Body="&lt;p&gt;Personally I hate the term &quot;roll cost&quot; and prefer &quot;roll yield&quot; or &quot;effect of rolling&quot;. It is not really an out of pocket cost (it involves no outlay or receipt of cash).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It has to do with contango and backwardation. When you close the contract that expires soon, it is priced close to Spot, but the new contract that you enter into may be priced above or below Spot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The difference between backadjusted and unadjusted prices is a measure of the roll effect. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example the current S&amp;amp;P future SPM6 was 2028.60 on March 24, 2016 (adjusted and unadjusted); a year ago on March 24, 2015 SPM5 was 2084.90 (Actual) and 2052.60 (Adjusted). Therefore the person who rolled futures experienced a price move of -24.00 points, while the raw unadjusted price of nearby futures dropped -56.3. The difference between these two or +32.30 is the &quot;roll effect&quot;, the - in this case positive - effect of rolling. &lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-04-01T14:38:58.147" LastActivityDate="2016-04-01T14:38:58.147" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="25116" PostTypeId="2" ParentId="16857" CreationDate="2016-03-28T16:12:13.170" Score="2" Body="&lt;p&gt;This site might be useful &lt;a href=&quot;http://www.bankofengland.co.uk/statistics/pages/yieldcurve/default.aspx&quot; rel=&quot;nofollow&quot;&gt;http://www.bankofengland.co.uk/statistics/pages/yieldcurve/default.aspx&lt;/a&gt;. It has the nominal 3 mo LIBOR swap rates&lt;/p&gt;&#xA;" OwnerUserId="7693" LastActivityDate="2016-03-28T16:12:13.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25118" PostTypeId="1" CreationDate="2016-03-28T19:01:16.140" Score="1" ViewCount="138" Body="&lt;p&gt;Consider USD Libor 3M swap curve. There are different maturities:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2d, 1m, 3m, 6m, 9m, 1y, 18m etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The values for 3m, 6m, 9m etc. time buckets are just swap rates for swaps with floating leg equal to 3m libor, settlements every 3 months and maturities 3m,6m, 9m etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder how the values for 2d or 1m are being calculated if the maturity is shorter than the settlement periods?&lt;/p&gt;&#xA;" OwnerUserId="20061" LastActivityDate="2016-03-29T03:50:26.553" Title="Swap curve and short maturities" Tags="&lt;interest-rate-swap&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25119" PostTypeId="2" ParentId="25086" CreationDate="2016-03-28T20:04:19.193" Score="13" Body="&lt;p&gt;I found out what I was doing wrong - the OLS function was regressing with no intercept value - so I had to use the &quot;add_constant&quot; method to add an intercept term to the X series (z_lag) as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;z_lag = np.roll(z_array,1)&#xA;z_lag[0] = 0&#xA;z_ret = z_array - z_lag&#xA;z_ret[0] = 0&#xA;&#xA;#adds intercept terms to X variable for regression&#xA;z_lag2 = sm.add_constant(z_lag)&#xA;&#xA;model = sm.OLS(z_ret,z_lag2)&#xA;res = model.fit()&#xA;&#xA;halflife = -log(2) / res.params[1]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm now getting a more resonable halflife of 15 days!&lt;/p&gt;&#xA;" OwnerUserId="20049" LastActivityDate="2016-03-28T20:04:19.193" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25120" PostTypeId="2" ParentId="25118" CreationDate="2016-03-28T20:54:20.777" Score="1" Body="&lt;p&gt;Hy there, &#xA;Well, the 3M Libor Curve is constructed most of the time with the 3M Ticker as the first point of the curve. Some people may include de O/N quote but it depends.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in this particular case i would say it may be obtained or calculated from an already derived curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is important is that the 1M Libor does not compound into the 3M Libor so i don't think that you can get a quote on the run for that specific tenor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think it's just being interpolated from the 3M Libor Curve.&lt;/p&gt;&#xA;" OwnerUserId="13533" LastActivityDate="2016-03-28T20:54:20.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25121" PostTypeId="2" ParentId="25081" CreationDate="2016-03-28T20:58:18.720" Score="1" Body="&lt;p&gt;Happy holidays to you too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The difference is that in one case you hold the bond to maturity (carry) with the Cupon Rate.&#xA;And the  expected return is the YTM (yield) seen on the secondary market trades + the spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's it.&lt;/p&gt;&#xA;" OwnerUserId="13533" LastEditorUserId="13533" LastEditDate="2016-03-29T02:16:32.307" LastActivityDate="2016-03-29T02:16:32.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25122" PostTypeId="2" ParentId="25118" CreationDate="2016-03-28T21:14:36.123" Score="0" Body="&lt;p&gt;There's clearly no such thing as a one month par swap with a floating index of 3 months.  So you're really just asking what a typical model kicks out of you ask for that rate.  In my view the most likely answer is that it would convert the 3m rate into a monthly payment frequency, and that would be the rate given.  Thus the rate would be slightly lower than the spot 3m rate.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-03-28T21:14:36.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25123" PostTypeId="1" CreationDate="2016-03-28T22:26:32.733" Score="5" ViewCount="753" Body="&lt;p&gt;We have an arithmetic Brownian motion process $X_t$ that follows $dX_t=\mu dt + \sigma dZ_t$ and we define the asset price $S_t=X_t^2$ and we are asked to find the stochastic differential equation that $S_t$ satisfies, as well as the density and distribution functions of $S_t$. The first part I accomplished through a straightforward application of Ito's lemma:&#xA;\begin{align*}&#xA;dS_t&amp;amp;=\left(\frac{\partial S_t}{\partial t}+\mu\frac{\partial S_t}{\partial X_t}+\frac{1}{2}\sigma^2\frac{\partial^2 S_t}{\partial X_t^2}\right)dt+\sigma\frac{\partial S_t}{\partial X_t}dZ_t\\&#xA;&amp;amp;=\left(2\mu X_t+\sigma^2\right)dt+2\sigma X_tdZ_t\\&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but the second part I am having more trouble on. We know that $X_t$ is normally distributed in that $X_t-X_0\sim N(\mu t,\sigma\sqrt{t})$, so I know from other classes that $S_t=X_t^2$ will follow some sort of $\chi^2$ distribution, however because $X_t$ has neither zero mean nor unit variance, $S_t$ ends up being a scaled noncentral $\chi^2$ distribution and the CDF and PDF are ugly at best (not to mention I'm pretty sure that the knowledge that the square of normal is $\chi^2$ is beyond the scope of this class).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there something wrong with my logic in going from $X_t\sim$ Normal to the distribution of $S_t$?&lt;/p&gt;&#xA;" OwnerUserId="20065" LastActivityDate="2016-04-04T19:46:10.600" Title="Square of arithmetic brownian motion process" Tags="&lt;stochastic-calculus&gt;&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25125" PostTypeId="2" ParentId="25118" CreationDate="2016-03-29T03:50:26.553" Score="0" Body="&lt;p&gt;Obviously, you won't have a one-month swap with a 3m index. The shorter maturities are usually constructed by liquid short-term instruments such as: &lt;code&gt;deposits&lt;/code&gt;. If those instruments are not used, you'll need an &lt;code&gt;extrapolation&lt;/code&gt; scheme. This could be anything, like assuming a flat rate or some kind of equations. You'll need to find more from the contract specification.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2016-03-29T03:50:26.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25126" PostTypeId="1" CreationDate="2016-03-29T06:49:14.020" Score="1" ViewCount="192" Body="&lt;p&gt;Consider a single-period, binomial market model with a $r &amp;gt; 0$ interest rate (in USD per period) and a portfolio $(x, y)$ consisting of two assets: a savings/lendings account and a stock, both measured in USD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, both $x$ and $y$ may be positive and negative. If $x$ is positive, the savings account holds $x$ USD; if $x$ is negative - the account holder owes the bank $x$ USD. If $y$ is positive, the account holder has $y$ stocks at his/her possession.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What does it mean for $y$ to be negative?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only idea I have is that a negative $y$ corresponds to short selling $y$ stocks. However, in the real world, short selling a stock is accompanied by setting up an interest-accruing margin account with the broker and possibly depositing an additional collateral, and this is not reflected in the model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that the model is a simplification of the real world, but I don't think ignoring an interest accruing debt is an acceptable simplification, and, in support of this I bring the following quote &lt;a href=&quot;http://www.investopedia.com/university/shortselling/shortselling1.asp&quot; rel=&quot;nofollow&quot;&gt;from Investopedia&lt;/a&gt;: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Most of the time, you can hold a short for as long as you want, although interest is charged on margin accounts, so keeping a short sale open for a long time will cost more.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It also simply doesn't make any economical sense, of the sort that exists even in the most simplified models of economic interactions, that one can borrow something of value without having to pay for it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what &lt;em&gt;does&lt;/em&gt; it mean for $y$ to be negative? How can I wrap my mind around it?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;EDIT: Here's my proposal for an answer, let me know what you think.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The difficulty arises from the fact that the word &quot;stock&quot; is a misnomer: the security referred to as a &quot;stock&quot; does not model a real-life stock, not even in simplified form. Rather, it models some other financial instrument that has no counterpart in real life, which, together with additional financial instruments, can be used to synthesize a simplified model of a real life stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A much better conceptualization of what the model &quot;stock&quot; means is it is a variation on a savings/lending account: whereas the value of a regular savings/lending account increments deterministically with time, the value of the so-called &quot;stock&quot; increments randomly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From this follows the following conclusion: instead of referring to the model &quot;stock&quot; as such, it would be better to call it &quot;a random savings/lending account&quot;, as opposed to &quot;a deterministic savings/lending account&quot;, and save the term &quot;stock&quot; to a different financial instrument that actually models a real-life stock, and that can be synthesized from a combination of a deterministic and a random savings/lending accounts and possibly some other financial instruments.&lt;/p&gt;&#xA;" OwnerUserId="15619" LastEditorUserId="15619" LastEditDate="2016-03-29T07:36:25.830" LastActivityDate="2016-05-30T14:27:08.227" Title="What does a negative stock amount mean in a single-period, binomial market model?" Tags="&lt;equities&gt;&lt;binomial-tree&gt;&lt;short-selling&gt;" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25127" PostTypeId="2" ParentId="25123" CreationDate="2016-03-29T07:49:59.570" Score="5" Body="&lt;p&gt;Your logic is fine&#xA;$$ X_t \sim \mathcal {N}(X_0+\mu t, \sigma^2 t) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, $\left (\frac {X_t}{\sigma\sqrt {t}}\right)^2 $ indeed exhibits a non central chi-squared distribution&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \left (\frac {X_t}{\sigma\sqrt {t}}\right)^2 \sim \chi^2\left(k=1,\lambda=\left (\frac {X_0+\mu t}{\sigma\sqrt {t}}\right)^2\right) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;whence the law of $S_t := X_t^2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As regards the pdf/cdf of $S_t$, the key here is that there is only &lt;em&gt;one degree of freedom&lt;/em&gt;, so no need to know the non central $\chi^2$ pdf/cdf by heart. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Actually, there is no need to know that its a chi-squared distribution to begin with.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed, for any variable $X^2$ with support on $[0,\infty [$, the cumulative distribution function $F_{X^2}$ writes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ F_{X^2}(x) := P [X^2 \leq x] $$&#xA;which is equivalent to writing&#xA;\begin{align}&#xA;F_{X^2}(x) &amp;amp;= P [\vert X \vert \leq \sqrt {x}] \\&#xA;&amp;amp;= P [-\sqrt {x} \leq X \leq +\sqrt {x}] \\&#xA;&amp;amp;= F_X (\sqrt {x}) - F_X (-\sqrt {x}) &#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence the relationship between the &lt;em&gt;cumulative distribution function&lt;/em&gt; of $X^2$ and that of $X $.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now differentiate the above equation with respect to $x$ to obtain the relationship between the &lt;em&gt;probability density functions&lt;/em&gt;.  &lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-04-04T19:46:10.600" LastActivityDate="2016-04-04T19:46:10.600" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25128" PostTypeId="2" ParentId="18613" CreationDate="2016-03-29T08:37:06.680" Score="1" Body="&lt;p&gt;If $\sigma_B &amp;gt; \sigma_A$, $B_t$ is more volatile than $A_t$.&#xA;Now you define $\tilde{B_t}:=\sigma_A^2B_t $. The volatility of $\tilde{B_t}$ is equals to volatility of ${B_t}$ multiplied by $\sigma_A^2$.&#xA;Therefore you can consider that if $\sigma_A^2\sigma_B &amp;gt; \sigma_A$, $\tilde{B_t}$ is more volatile than $A_t$.&#xA;$\sigma_A^2\sigma_B &amp;gt; \sigma_A \leftrightarrow \sigma_A\sigma_B &amp;gt; 1$ &lt;/p&gt;&#xA;" OwnerUserId="17733" LastActivityDate="2016-03-29T08:37:06.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25129" PostTypeId="1" CreationDate="2016-03-29T09:00:42.203" Score="1" ViewCount="255" Body="&lt;p&gt;In Glasserman's &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0387004513&quot; rel=&quot;nofollow&quot;&gt;book&lt;/a&gt;, he computes the price of an option by first computing the average price over &lt;strong&gt;each simulated price path&lt;/strong&gt;. Once all the paths have been simulated, the average of all the payoffs is computed using the average price of each simulated path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the finance courses I have taken, the algorithm I have been taught is to compute all the simulated price paths, work out the payoff of each path and then take the average payoff which is then discounted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Glasserman's algorithm involves more computation steps since for each price path I have to compute this average price. Why does Glasserman take this approach? Also if there is anybody working in the industry, what algorithm is actually taken to pricing vanilla options i.e. does industry follow the textbook approach or do they apply any other optimisation techniques?&lt;/p&gt;&#xA;" OwnerDisplayName="user16556" LastEditorDisplayName="user16556" LastEditDate="2016-03-29T09:12:59.030" LastActivityDate="2016-03-29T18:12:41.840" Title="Monte Carlo Option Pricing: Averaging Price Per Path" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;monte-carlo&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25130" PostTypeId="2" ParentId="25126" CreationDate="2016-03-29T10:58:22.720" Score="0" Body="&lt;p&gt;I'm answering my own question. I don't base the following answer on anything except my opinion.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The only idea I have is that a negative $y$ corresponds to short selling $y$ stocks. [...] The difficulty arises from the fact that the word &quot;stock&quot; is a misnomer: the security referred to as a &quot;stock&quot; does not model a real-life stock, not even in simplified form.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I disagree. In my opinion it is important to differentiate between what a positive and a negative value of a stock represent. A positive value of a stock is indeed a simplified model for holding a real life stock. However, a negative value of a stock is not a simplified model of a short sale. Rather, to use OP's words,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;it models some other financial instrument that has no counterpart in real life, which, together with additional financial instruments, can be used to synthesize a simplified model of a...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;... short sale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will now address OP's comment that it&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;simply doesn't make any economical sense, of the sort that exists even in the most simplified models of economic interactions, that one can borrow something of value without having to pay for it.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is a valid comment. However, the financial instrument represented by a negative stock value is, as mentioned above, not a model of a real-life financial instrument; it is rather a complete mathematical fabrication. It is indeed an instrument that would never be traded in real life markets, however, it is also important to be able to define mathematically financial instruments that are not market efficient if only to be able to rigorously define - by way of differentiation - what it means for a financial instrument to be market efficient. The instrument described by a negative stock value is just such a non-efficient instrument. However, in combination with other financial instruments, some real-life financial instruments, e.g. short sales, may be defined.&lt;/p&gt;&#xA;" OwnerUserId="15619" LastEditorUserId="15619" LastEditDate="2016-03-29T16:43:29.550" LastActivityDate="2016-03-29T16:43:29.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25131" PostTypeId="1" CreationDate="2016-03-29T11:40:30.313" Score="8" ViewCount="669" Body="&lt;p&gt;I have implemented a stripping algorithm to extract forward volatilities from cap/floor flat volatilities for different currencies. I am however struggling a bit when implementing a method to convert the first 2 year 3M flat vols into 6M flat vols for the EUR currency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The information I have available is the forecast curves (1M, 3M, 6M) and discount curve. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have found some papers detailing a solution that involves the calculation of the correlation coefficient between different 3M forward rates, but that is unfortunately information that is not available to me. I have also found a paper from Bloomberg (&quot;Bloomberg Volatility Cube&quot; by Zhang and Wu) with some standard formulas to do the conversion, but they do not take into account the &lt;strong&gt;basis spread&lt;/strong&gt;, which to me it seems key in doing the conversion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help or guidance from professional practitioners would be very helpful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="13457" LastEditorUserId="13457" LastEditDate="2016-05-03T11:10:41.067" LastActivityDate="2019-10-13T21:01:20.133" Title="Transforming 3M volatilities into 6M volatilities in EUR forecast curves" Tags="&lt;implied-volatility&gt;&lt;forward-rate&gt;&lt;volatility-smile&gt;&lt;bootstrapping&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25132" PostTypeId="1" CreationDate="2016-03-29T11:43:30.077" Score="2" ViewCount="2110" Body="&lt;p&gt;I could see that the short-term options' IV raises on earnings announcements when longer-term options' IV does not react too much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I had this doubt, &quot;Is the volatility of short-term options' IV higher than longer-term options' IV&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: The questions in other words,&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Is the graph of short-term options' IV more responsive/sensitive to the &lt;strong&gt;events&lt;/strong&gt; (news/announcements) than the long-term options' IV graph?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Does the &lt;strong&gt;price&lt;/strong&gt; change of the actual underlying impact short-term options IV differently than long term options' IV?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="19441" LastEditorUserId="2587" LastEditDate="2016-03-30T07:00:20.420" LastActivityDate="2016-03-31T15:17:17.657" Title="Sensitivity of short-term vs long term options' IV" Tags="&lt;implied-volatility&gt;&lt;earnings&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25133" PostTypeId="2" ParentId="25132" CreationDate="2016-03-29T12:24:17.150" Score="3" Body="&lt;p&gt;No. Not really. The term-structure of options IV can change shapes through the year. Sometimes short-term options have a higher IV sometimes long-term options have a higher IV. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can take a look at figure 1 from Egloff Leippold Wu (2012). They show for the aggregate market different shapes of the term-structure of IV (measured as the Variance Swap Rate) at different points in time. But the pattern is also true for individual stocks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/63h2z.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/63h2z.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2016-03-29T12:24:17.150" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25134" PostTypeId="2" ParentId="25129" CreationDate="2016-03-29T12:34:39.050" Score="1" Body="&lt;p&gt;Although I don't remember this part of the book explicitly, I guess Glasserman implements Monte Carlo this way to preclude memory-related issues.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed, iteratively updating the average payoff each time you are done with generating a path allows to &lt;em&gt;free most of the memory&lt;/em&gt; after each Monte Carlo simulation: you only need to store the running average.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, the second approach you mention requires simulating and &lt;em&gt;storing all the paths&lt;/em&gt; before you get to compute the average payoff. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, Glasserman's implementation will work even with thousands of millions of Monte Carlo simulations, while on most work stations the second method would fail (not enough memory). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that in certain programming languages, the second approach can benefit from vectorisation (I'm thinking matlab and the likes). Hence you should choose your implementation wisely based on your own constraints (for instance matlab uses a quite limited java heap size by deault).&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-03-29T18:12:41.840" LastActivityDate="2016-03-29T18:12:41.840" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25135" PostTypeId="2" ParentId="25132" CreationDate="2016-03-29T14:32:01.440" Score="3" Body="&lt;p&gt;Yes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Implied vol is (very loosely speaking) the risk neutral expectation of the realized volatility over the life of the option. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A 10Y implied vol is an average over 10 years, and therefore is relatively immune to short term spikes. It is slowly varying, relative to a 1M vol which only captures spikes in short term sentiment. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When the Vix (which is short term) went to over 150% in the crisis of 2008-9, you would not expect it to last for many months. Therefore the longer term vols did not spike in that extent. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is essentially the same logic that applies to yield curves, where the 30Y rate moves in a much less volatile than the 1Y rate. The former reflects long term fundamentals, while the latter assesses the next business cycle and central bank responses. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Re (2) in your edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Implied vol skews are much more pronounced for short term options (when you have moneyness on the x-axis). After all, a 10% move is big over a day or a week, but not a big deal over two years. Also, just due to the law of large numbers distributions become more Gaussian in the long run, and the smile flattens out somewhat. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Every stock/vol surface will have some degree of 'stickiness' associated with it: Say, for example, that the spot is 100, and (strike, vol) pairs look like that (90, 40%), (100 ATM, 30%), (110, 25%). If now the spot moves down to 95, there are three effects in play:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Sticky moneyness: The ATM spot level is now 95, and the whole skew will have the tendency to be carried with the declining spot to the left, in order for the ATM option to keep vol of 30%. When you use time series of ATM implied vols, this is what you implicitly assume. The option with strike 90 will see its implied vol going down to 35%, and so on. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Sticky strike: The skew stays where it is in terms of strikes. Since options are contractually defined in terms of strikes, the implied vols of individual options do not change (even though you now observe the ATM vol to go up, from 30% to 35%). &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In reality every stock, index or FX will exhibit a mix of moneyness and strike strickiness. As a rule of thumb, I would say the sticky strike dominates over short term moves for equities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above move (or not move) the skew left and right. But you also have:&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;Spot/vol correlation: Realised vol is correlated with spot. This does not refer to any particular option, and will move the whole skew up or down. It just says that if the spot drops by 5% the world is more volatile by 2% (and the time value of all options increases, so to speak). &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;As long term skews are much flatter, spot/vol correlation becomes more important over stickiness.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my toy understanding and decomposition: spot/vol correlation (up/down) and stickiness (left/right). It is not uncommon for people to confuse left/right for up/down and conclude that there more negative spot/vol correlation than there really is. Especially when they use short term vols like the Vix. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2016-03-30T12:34:30.367" LastActivityDate="2016-03-30T12:34:30.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25136" PostTypeId="2" ParentId="11101" CreationDate="2016-03-29T14:56:55.990" Score="1" Body="&lt;p&gt;Correlation is not an asset allocation measure and thus should have nothing to do with the weights in the portfolio.  What you want to do is to figure out the correlation between the two portfolios using: &#xA;p = cov(x,y) / stdev(x) * stdev(y)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and depending on the results, you can then run a solver function to find out the weights in each sub portfolio that minimizes the correlation of said portfolio to a benchmark (i.e. S&amp;amp;P)  &lt;/p&gt;&#xA;" OwnerUserId="20071" LastActivityDate="2016-03-29T14:56:55.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25137" PostTypeId="1" CreationDate="2016-03-29T15:43:56.973" Score="1" ViewCount="96" Body="&lt;p&gt;I'm going to build a multi-factor APT model for the Swiss market starting from the work made by Chen, Roll and Ross (to which I will add and test some additional factors). I have some doubts though:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The APT prescribes that each factor should be expressed as its unexpected component:$$\tilde{F_t}=F_{t}-E[F_t \mid t-1]$$ What if it is not the case? Are results highly affected? I was thinking to put for example consumer confidence, changes in oil or electricity prices, etc. for which it is difficult to find forecasts or for which it is not that cleaver to assume that individuals use simple forecasting techniques like the naïve or drift method. Chen, Roll and Ross use for example changes in monthly industrial production, which is not expressed as its unexpected component.&lt;/li&gt;&#xA;&lt;li&gt;Are 10 years of monthly observations enough to make a good estimate or should I use more/less observations?&lt;/li&gt;&#xA;&lt;li&gt;My idea was to apply my model on every stock that is actually registered on the SIX Swiss Exchange. Is it possible? I've read that generally this models are applied to portfolios of stocks. Does this make a huge difference?&lt;/li&gt;&#xA;&lt;li&gt;Once the estimates are done my idea was to build $K$ factors portfolios (with $K$ being the number of factors). The procedure I had in mind was to solve a quadratic programming problem of the type: $$\min_w w'\Sigma w$$ $$s.t. \ B w \leq b$$ where: $w$ is a vector of weights, $\Sigma$ is the variance-covariance matrix, $B$ is a matrix of $K+1$ rows (where the $K+1$th row is filled with ones) and $N$ columns (with $N$ being the number of stocks analyzed), $b$ is a vector of constraints and $\beta_{k, j}$ is the sensitivity of stock $j$ to factor $k$. As an example: to find weights of the portfolio which mimics the 2nd factor (with $K=3$ and $N=4$): $$B =\begin{bmatrix}&#xA;\beta_{1,1} &amp;amp; \beta_{1,2} &amp;amp; \beta_{1,3}  &amp;amp; \beta_{1,4}\\ &#xA;\beta_{2,1} &amp;amp; \beta_{2,2} &amp;amp;\beta_{2,3}  &amp;amp; \beta_{2,4}\\ &#xA;\beta_{3,1} &amp;amp;  \beta_{3,2}&amp;amp; \beta_{3,3} &amp;amp; \beta_{3,4}\\&#xA;1 &amp;amp; 1 &amp;amp; 1 &amp;amp; 1&#xA;\end{bmatrix} \qquad b=\begin{bmatrix}&#xA;0\\ &#xA;1\\ &#xA;0\\ &#xA;1\\ &#xA;\end{bmatrix}$$ Is this the right procedure?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="13439" LastActivityDate="2016-03-29T15:43:56.973" Title="Multi-factor APT model in practice: non-zero mean factors, observations needed and portfolios" Tags="&lt;factor-models&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25138" PostTypeId="2" ParentId="24970" CreationDate="2016-03-29T16:08:42.263" Score="1" Body="&lt;p&gt;I like the maths here. However, I feel that the focus is off. You shouldn't really be wasting time trying to pick a &quot;lowest possible price&quot; or if you must then you should be trying to pick &quot;all lowest possible prices&quot;. That is, a market correction. So why does the whole equity market move? You could have a look &lt;a href=&quot;https://stackoverflow.com/questions/1989992/predict-stock-market-values&quot;&gt;here&lt;/a&gt; or read &lt;a href=&quot;https://en.wikipedia.org/wiki/Reminiscences_of_a_Stock_Operator&quot; rel=&quot;nofollow noreferrer&quot;&gt;reminiscences of a stock operator&lt;/a&gt;, but I think you're really asking for a formula to model the whole market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To take some of the difficulty involved with accurately modelling the whole market, which may be possible &lt;em&gt;some of the time&lt;/em&gt;, what about Warren Buffett's method? Buy into the stock of a company you can easily understand, and that has a nice and profitable business model that is making money, and hold it forever. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ok, according to &lt;a href=&quot;http://www.investopedia.com/articles/01/071801.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;investopedia&lt;/a&gt; on the Buffett method, a key is to find a stock that is trading at a 25% discount to market value. Maybe that's what this question is all about. If so, as it says there, to work that out is all about calculating the intrinsic value of a business (get a value for corporate earnings, revenues, assets, brands, intangibles) and then seeing whether all that is actually reflected in the market capitalization.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then we come back to where we started because to understand (and predict) why investors sometimes drive the market capitalization of a specific business down to levels where it trades at a big discount to its intrinsic value must be all about fears that the whole industry, or even the whole market, is going to crash. ie all about short term volatility... drat it can't be escaped!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, investors sometimes drive the market capitalization of ALL companies down to below their intrinsic values, and you're into things like &lt;a href=&quot;https://en.wikipedia.org/wiki/Tobin%27s_q&quot; rel=&quot;nofollow noreferrer&quot;&gt;Tobin's Q ratio&lt;/a&gt;. That is an impressive theory but I don't think it's useful as a predictive indicator, and further, it's clear that after market corrections where everything is driven down in value, some companies recover their intrinsic value quicker than others... &lt;/p&gt;&#xA;" OwnerUserId="7369" LastEditorUserId="-1" LastEditDate="2017-05-23T11:33:46.017" LastActivityDate="2016-03-30T14:35:06.227" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25139" PostTypeId="2" ParentId="25050" CreationDate="2016-03-29T17:40:01.907" Score="0" Body="&lt;p&gt;What research exactly did you look at?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several papers that look at out-of-sample frontiers when&#xA;parameters need to be estimated or forecast or are noisy. (However, these&#xA;papers typically use Monte-Carlo set-ups, not real data.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The result is always the same: the out-of-sample frontiers typically do&#xA;not show a monotone relationship between risk and return. In other&#xA;words, more risk does not necessarily mean more return. An example of&#xA;such a paper is &lt;a href=&quot;https://www8.gsb.columbia.edu/researcharchive/articles/3970&quot; rel=&quot;nofollow&quot;&gt;Mark Broadie (1993) -- Computing Efficient Frontiers&#xA;Using Estimated Parameters&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6857" LastActivityDate="2016-03-29T17:40:01.907" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25140" PostTypeId="1" CreationDate="2016-03-30T00:51:06.000" Score="7" ViewCount="1515" Body="&lt;p&gt;I'm coming from Java and there we use the EPoll selector implementation that comes with the JDK for non-blocking / asynchronous networking TCP and UDP development. Therefore you don't have to make choices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when it comes to C++ there are dozens of options to choose from according to this answer: &lt;a href=&quot;https://stackoverflow.com/questions/118945/best-c-c-network-library&quot;&gt;https://stackoverflow.com/questions/118945/best-c-c-network-library&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't have experience with C++ so I don't know. Which one should I pick for low-latency, asynchronous, non-blocking, real-time, selector style network programming? Does C++ even have a standard non-blocking network library or are they all external / independent?&lt;/p&gt;&#xA;" OwnerUserId="20078" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2016-05-03T12:55:22.783" Title="What is the best / most used / recommended C++ non-blocking networking library for low-latency / real-time development?" Tags="&lt;programming&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25141" PostTypeId="1" CreationDate="2016-03-30T05:52:05.793" Score="1" ViewCount="35" Body="&lt;p&gt;I'm trying to define which hotel offers the best value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say we have two hotels - A and B.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For A, you pay $10 a night and the rating for the hotel is 9.8.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For B, you pay $8 a night and the rating for the hotel is 9.6.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for A, you pay $2 more and get one with a higher rating of 0.2. But is it the better value?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would you solve this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="20079" LastActivityDate="2016-03-30T18:35:22.560" Title="How to value pricing and ratings? How to quantify best value?" Tags="&lt;valuation&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2016-03-30T08:14:50.660" ContentLicense="CC BY-SA 3.0" />
  <row Id="25142" PostTypeId="2" ParentId="19466" CreationDate="2016-03-30T07:57:48.413" Score="0" Body="&lt;p&gt;The S&amp;amp;P500 is an index so it does not have earnings per se. What you can do is find the earning yield of each constituent of the index and calculate the weighted average yield of the constituents (using their weight in the index). That is one way of estimating the earning yield of the index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the index is market cap weighted (not sure if it's strictly the case for the S&amp;amp;P 500) you can also sum the earnings of all the companies in the index and divide that sum by the total market cap of those companies.&lt;/p&gt;&#xA;" OwnerUserId="2393" LastActivityDate="2016-03-30T07:57:48.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25143" PostTypeId="2" ParentId="25141" CreationDate="2016-03-30T08:16:54.233" Score="0" Body="&lt;p&gt;In order to answer this question you need a 3rd point and then proceed in this way, although it is quite empirical as it is all based on subjective rating assumption. Plot hotel A and B price and rating in a graph, search for a 3rd hotel C whose cost is between 8 and 10 and plot that too. Draw the line AC. If point B is above AC then you might think that hotel B's price is above average for that ratings, and viceversa.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basic concept underlying here: You would have to do a linear regression of all the hotel data, the more your hotel is under that line, the better the deal.&lt;/p&gt;&#xA;" OwnerUserId="20084" LastEditorUserId="20084" LastEditDate="2016-03-30T18:35:22.560" LastActivityDate="2016-03-30T18:35:22.560" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25144" PostTypeId="1" CreationDate="2016-03-30T09:16:30.757" Score="1" ViewCount="273" Body="&lt;p&gt;I know &quot;Time decay accelerates on nearing expiry&quot;. But I want to know the rate of acceleration.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;How curvy is the theta curve? Answers could be like,&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Provided IV is stable, in a 3-month contract,&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Month 1: time value losses 10%&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Month 2: time value losses 30%&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Month 3: time value losses 60%&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;Does theta work following a standard curve every time? Or it has other factors to affect?&lt;/li&gt;&#xA;&lt;li&gt;It works same for all OTM, ATM and ITM? I read OTM options decelerate last month. Is that true?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="19441" LastActivityDate="2016-03-30T18:57:35.097" Title="Rate of Options decay" Tags="&lt;implied-volatility&gt;&lt;theta&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25145" PostTypeId="1" AcceptedAnswerId="25146" CreationDate="2016-03-30T09:33:55.080" Score="4" ViewCount="470" Body="&lt;p&gt;First I have to admit that I have never been really good at thinking about the implications of investments in different currencies. I don't know why but it makes my head spin, this is why I am no FX guy... anyway: Bear with me if this is a silly question!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the following situation: I want to thoroughly analyse different equity investments in the Eurozone. Fama-French regression is of course part of that. Now all &lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html&quot; rel=&quot;nofollow&quot;&gt;Fama-French factors&lt;/a&gt; (there is a whole bunch of them now) are in USD. Another complicating factor is that - while all investments are in Euros - some are heavily investing internationally themselves and are therefore exposed to currency risk too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question&lt;/strong&gt;&lt;br&gt;&#xA;How should I conduct this analysis? Should I&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;leave the investments as is and regress the changes of the Euro denominated investments against the respective USD factors,&lt;/li&gt;&#xA;&lt;li&gt;convert the investments into USD and regress against the respective USD factors or even&lt;/li&gt;&#xA;&lt;li&gt;leave the investments as is and regress the changes of the Euro denominated investments against the respective USD factors + add another currency factor (EUR/USD exchange rate changes)?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What is best practice here? What are the implications? How to interpret the results? Sorry again if this is a silly question.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2016-03-30T09:46:04.327" LastActivityDate="2016-04-01T10:13:54.687" Title="Best practice for international Fama-French analysis" Tags="&lt;factor-models&gt;&lt;currency&gt;&lt;fama-french&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25146" PostTypeId="2" ParentId="25145" CreationDate="2016-03-30T09:45:26.010" Score="2" Body="&lt;p&gt;It depends on the assumptions you are willing to make. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you either assume:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;(i) Complete purchasing power parity (relative prices of goods are the same&#xA;everywhere and an exchange rate is just the ratio of the nominal prices of any good in two countries) or&lt;/li&gt;&#xA;&lt;li&gt;(ii) the assets you consider cannot be used to hedge exchange risk&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;then you are fine by using your the solution outlined in your method 2. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If you don' want to assume neither of those, then you need empirical&#xA;tests that allow for exchange rate risk. Look into Fama and Farber&#xA;(1979) or Zhang (2006).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;One caveat though. The Fama-French factors (built on US porfolios) are not the correct factors to analyze Europe returns. Either you build the same factors for Europe, or if the firms you are considering are international you should build world factors (look into Asness, Moskowitz and Pendersen 2013).&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2016-03-30T09:45:26.010" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25147" PostTypeId="1" CreationDate="2016-03-30T10:05:23.543" Score="7" ViewCount="316" Body="&lt;p&gt;I am looking at the CIR++ model which is described in interest rate models by Brigo et al, and was wondering on how to actually simulate from this model. The model reads &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_t=x_t+\phi(t),$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $x$ follows a CIR model.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To keep it as simple as possible i thought i would simulate the x process according to a 'truncated' Euler scheme, i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$x_{t_i}=x_{t_{i-1}}+\kappa(\theta-x_{t_{i-1}})\Delta t+\sigma \sqrt{x_{t_{i-1}}^+} \Delta t Z_t,$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Z_t$ is $N(0,1)$. My question then is, would it make sense do to so and simply add $\phi(t)$ accordingly, meaning &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_{t_i}=x_{t_{i}}+\phi(t_{i}).$$&lt;/p&gt;&#xA;" OwnerUserId="19761" LastEditorUserId="19887" LastEditDate="2016-03-31T20:36:36.913" LastActivityDate="2016-03-31T20:36:36.913" Title="simulating from the CIR++" Tags="&lt;simulations&gt;&lt;short-rate&gt;&lt;euler&gt;" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="25148" PostTypeId="2" ParentId="8505" CreationDate="2016-03-30T10:11:17.760" Score="3" Body="&lt;p&gt;The best way to answer the question is to look at the data. For example, on H&amp;amp;M in April 2000:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;       Close Price    Div&#xA;31/03      240&#xA;13/04      236&#xA;14/04      225        1.35&#xA;28/04      238&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;ThomsonReuters, Bloomberg and Factset do the following calculation for the return (+/- rounding):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;r = 236/240 * (225 + 1.35)/236 * 238/225 - 1&#xA;  = -0.24%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is the value I get from Bloomberg using the &lt;code&gt;TOT_RETURN_INDEX_GROSS_DVDS&lt;/code&gt; field so I'm not sure how you obtained the -0,27%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may have got your number from using the &lt;code&gt;PX_LAST&lt;/code&gt; field adjusted for dividends. It is calculated based on an adjustment factor for the dividend:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;f = 1 - 1.35/236&#xA;  = 0.9942797&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;They then adjust the return on the ex-date by that factor:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;r = 236/240 * 225/(236*f) * 238/225 - 1&#xA;  = -0.26%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is close to the number you got.&lt;/p&gt;&#xA;" OwnerUserId="2393" LastActivityDate="2016-03-30T10:11:17.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25149" PostTypeId="1" CreationDate="2016-03-30T12:21:48.830" Score="2" ViewCount="233" Body="&lt;p&gt;Suppose we have :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r$ - zero coupon rate, constant over time, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$n$ - a number of years (an integer),&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\theta$ - a fraction of a year $(\theta &amp;lt; 1)$ , calculated with the relevant day count convention.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which discount factor is the correct one ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I'm inclined to think it's $\beta_{2}$ because over a period of time of less than a year, it's a simple interest that is computed).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\beta_{1} = \frac{1}{(1+r)^{(n+\theta)}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\beta_{2} = \frac{1}{(1+r)^n}\cdot \frac{1}{(1 + r\theta)}$&lt;/p&gt;&#xA;" OwnerUserId="20085" LastEditorUserId="19494" LastEditDate="2016-04-02T07:05:11.507" LastActivityDate="2016-04-02T07:05:11.507" Title="Discount factor" Tags="&lt;discount-factor-curve&gt;&lt;discounting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25150" PostTypeId="2" ParentId="25140" CreationDate="2016-03-30T12:44:34.127" Score="3" Body="&lt;p&gt;networking will be available as standard only in c++17, currently boost is an option if you want to abstract the operational system features ( epool, kqueue, io completion ), low latency or realtime try dpdk to bypass operational system kernel.&lt;/p&gt;&#xA;" OwnerUserId="18675" LastActivityDate="2016-03-30T12:44:34.127" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25151" PostTypeId="1" AcceptedAnswerId="25155" CreationDate="2016-03-30T13:54:01.870" Score="3" ViewCount="708" Body="&lt;p&gt;In &lt;a href=&quot;http://www.nber.org/papers/w7313.pdf&quot; rel=&quot;nofollow&quot;&gt;Obstfeld and Rogoff&lt;/a&gt; (2000), formula (12) states the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ W = (\frac{\phi}{\phi-1}) \frac{E\{K(L^\nu)\}}{E\{\frac{L}{P}C^{-\rho}\}} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\phi$, $\rho$ and $\nu$ are parameters, $E$ is the expectation operator, and $K$, $L$, $P$,$C$ are endogenous variables jointly log-normally distributed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They state that given the log-normality it is equivalent to write equation (12) as: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ W = (\frac{\phi}{\phi-1}) \frac{E\{K\}E\{L\}^{\nu-1})}{E\{C\}^{-\rho} E\{ \frac{1}{P} \}     } \exp{\psi} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\psi = \frac{\nu(\nu-1)}{2} \sigma_l^2 - \frac{\rho(\rho+1)}{2} \sigma_c^2  + \nu \sigma_{kl} + \rho \sigma_{cl}  - \rho \sigma_{cp} + \sigma_{lp} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to derive the expression for psi, I get something slightly different: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\psi = \frac{\nu}{2} \sigma_l^2 - \frac{\rho}{2} \sigma_c^2  + \nu \sigma_{kl} + \rho \sigma_{cl}  - \rho \sigma_{cp} + \sigma_{lp} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't understand where those extra terms come from. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help?&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2016-03-30T19:13:27.423" Title="Covariance of Log-Normal Variables" Tags="&lt;lognormal&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25153" PostTypeId="2" ParentId="25111" CreationDate="2016-03-30T15:51:43.390" Score="5" Body="&lt;p&gt;There is a cost for the roll because there is a value to the extended maturity that you are picking up.  There will be dividends and a cost of carry for the hedger who is selling it.  An index arb desk will look at the roll and decide to bid or offer depending on where they can carry the underlying basket.  That dictates the prices of the rolls.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now ESM6/U6 is -8 x -7.95, so that means that you can buy the Sep for a 7.95 discount.  That's because the person selling you that roll is going to expect to collect dividends $\$10.5$ in divs.  The market must be expecting to pay about $\$2.5$ in carry for the stocks to make it all arbitrage-free.&lt;/p&gt;&#xA;" OwnerUserId="20092" LastEditorUserId="2393" LastEditDate="2016-03-30T17:22:58.817" LastActivityDate="2016-03-30T17:22:58.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25154" PostTypeId="2" ParentId="9701" CreationDate="2016-03-30T15:54:31.183" Score="1" Body="&lt;p&gt;Go through the docs, they have something on how they interpolate the curve.  It's definitely not linear.  &lt;em&gt;AND&lt;/em&gt; remember, they have many different types of curves with different underlyings so you could be looking at a swap curve and comparing to a TSY curve and you will be off.  &lt;/p&gt;&#xA;" OwnerUserId="20092" LastActivityDate="2016-03-30T15:54:31.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25155" PostTypeId="2" ParentId="25151" CreationDate="2016-03-30T17:52:25.660" Score="3" Body="&lt;p&gt;Note that&#xA;\begin{align*}&#xA;E(K) &amp;amp;= E\big(\exp(\ln K) \big)\\&#xA;&amp;amp;=\exp\Big(E(\ln K) + \frac{1}{2}\sigma_k^2 \Big),\\&#xA;E(L) &amp;amp;= E\big(\exp(\ln L) \big)\\&#xA;&amp;amp;=\exp\Big(E(\ln L) + \frac{1}{2}\sigma_l^2 \Big),\\&#xA;E\Big(\frac{1}{P}\Big) &amp;amp;= E\big(\exp(-\ln P) \big)\\&#xA;&amp;amp;=\exp\Big(-E(\ln P) + \frac{1}{2}\sigma_p^2 \Big), &#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;E(C) &amp;amp;= E\big(\exp(\ln C) \big)\\&#xA;&amp;amp;=\exp\Big(E(\ln C) + \frac{1}{2}\sigma_c^2 \Big).&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;E(K L^{\nu}) &amp;amp;= E\Big(\exp\big(\ln K + \nu \ln L\big) \Big)\\&#xA;&amp;amp;=\exp\Big(E(\ln K) + v E(\ln L)+ \frac{1}{2}\sigma_k^2 + \frac{1}{2} \nu^2\sigma_l^2 + \nu \sigma_{kl}\Big)\\&#xA;&amp;amp;= \exp\Big(E(\ln K) + \frac{1}{2}\sigma_k^2 + \nu \Big(E(\ln L)+ \frac{1}{2} \sigma_l^2\Big) + \frac{1}{2}(\nu^2-\nu)\sigma_l^2 + \nu \sigma_{kl}\Big)\\&#xA;&amp;amp;= E(K)(E(L))^{\nu}\exp\Big( \frac{1}{2}\nu(\nu-1)\sigma_l^2 + \nu \sigma_{kl} \Big).&#xA;\end{align*}&#xA;Moreover, &#xA;\begin{align*}&#xA;E\left( \frac{L}{P}C^{-\rho} \right) &amp;amp;= E\Big(\exp\big(\ln L - \ln P - \rho \ln C \big) \Big)\\&#xA;&amp;amp;= \exp\Big(E(\ln L) - E(\ln P) - \rho E(\ln C) \\&#xA;&amp;amp;\qquad\qquad\qquad\qquad +\frac{1}{2}\sigma_l^2 + \frac{1}{2}\sigma_p^2 + \frac{1}{2}\rho^2\sigma_c^2 - \sigma_{lp} - \rho \sigma_{cl} +\rho\sigma_{cp}\Big)\\&#xA;&amp;amp;=\exp\Big(E(\ln L) +\frac{1}{2}\sigma_l^2 - E(\ln P) +\frac{1}{2}\sigma_p^2 - \rho E(\ln C) - \rho \frac{1}{2}\sigma_c^2 \\&#xA;&amp;amp;\qquad\qquad\qquad\qquad + \frac{1}{2}\big(\rho^2+\rho\big)\sigma_c^2 - \sigma_{lp} - \rho \sigma_{cl} +\rho\sigma_{cp}\Big)\\&#xA;&amp;amp;= E(L)E\Big(\frac{1}{P}\Big)(E(C))^{-\rho} \exp\Big(\frac{1}{2}\big(\rho^2+\rho\big)\sigma_c^2 - \sigma_{lp} - \rho \sigma_{cl} +\rho\sigma_{cp}\Big).&#xA;\end{align*}&#xA;Consequently,&#xA;\begin{align*}&#xA;\frac{E(K L^{\nu})}{E\Big( \frac{L}{P}C^{-\rho} \Big)}&amp;amp;=\frac{E(K)(E(L))^{\nu-1}}{E\Big(\frac{1}{P}\Big)(E(C))^{-\rho}}\\&#xA;&amp;amp;\qquad\qquad \exp\left(\frac{1}{2}\nu(\nu-1)\sigma_l^2 - \frac{1}{2}\big(\rho^2+\rho\big)\sigma_c^2 + \nu \sigma_{kl} + \rho \sigma_{cl} -\rho\sigma_{cp} +\sigma_{lp}\right).&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;\psi = \frac{1}{2}\nu(\nu-1)\sigma_l^2 - \frac{1}{2}\rho\big(\rho+1\big)\sigma_c^2 + \nu \sigma_{kl} + \rho \sigma_{cl} -\rho\sigma_{cp} +\sigma_{lp}.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-03-30T19:13:27.423" LastActivityDate="2016-03-30T19:13:27.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25156" PostTypeId="2" ParentId="25144" CreationDate="2016-03-30T18:47:09.240" Score="2" Body="&lt;p&gt;The value of a call option that is near ATM can be approximated as $C(S,T)≈ 0.4 \sigma \sqrt T$. Therefore, under the unrealistic assumption that S does not change very much (i.e. the option stays near the money) the value decays as the square root of the remaining time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In words, yes it does speed up considerably as you get close to expiration.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-03-30T18:57:35.097" LastActivityDate="2016-03-30T18:57:35.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25157" PostTypeId="1" AcceptedAnswerId="25164" CreationDate="2016-03-30T21:02:06.330" Score="4" ViewCount="1624" Body="&lt;p&gt;Today VIX is computed based on near- and next- term options series which fall into the time period of [23, 37] days. That is what it is now, when they use SPX weekly, so they have options expiring every week.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is, how was VIX calculated before 2014, when they used traditional SPX options only, expiring every month on the 3rd Friday? Could there be a situation when VIX was computed based on options with maturities of 1 and 31 days, for example?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And why end-of-month series are ignored?&lt;/p&gt;&#xA;" OwnerUserId="17976" LastEditorUserId="12" LastEditDate="2016-03-31T13:45:44.150" LastActivityDate="2018-04-17T14:46:03.900" Title="How was the old VIX calculated?" Tags="&lt;vix&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25158" PostTypeId="2" ParentId="18110" CreationDate="2016-03-30T22:13:56.900" Score="1" Body="&lt;p&gt;The post is quite old, but an interesting question indeed. Here is how I would go about it:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a regression $y_n = \alpha + \beta x_n + u_n$ the estimator of the slope coefficient is $\beta = \text{cov}(x, y)/\text{std}(y)$ To avoid distractions let's assume for a moment that everything is standardized: means are zero and variances are one. Then, the slope coefficient is just estimated by $\beta = (1/N) \sum_n x_n y_n$. I want to focus on this quantity in order to motivate the strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Going back to your notation, where we have $D$ days each split into $T$ slices. In the case where each slice is viewed independently, the slope of each slice is given by&#xA;$$&#xA;\beta_t = \frac{1}{D} \sum_d x_{d,t}y_{d,t}&#xA;$$&#xA;This is one extreme, and can give very volatile estimates if the true dependence is small, as you point out. The noise will swamp the signal and every slice will have a very different estimate to the adjacent ones.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other extreme is to forget about slices, and have a single estimate for all. This would be equal to&#xA;$$&#xA;\beta_\infty = \frac{1}{TD} \sum_t \sum_d x_{d,t} y_{d,t}&#xA;$$&#xA;Obviously this is robust but ignores the intraday variability. The question is then: is there a scheme in-between the two extremes?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we write $\beta_\infty$ in terms of the $\beta_t$s, then we can motivate such a scheme&#xA;$$&#xA;\beta_\infty = \frac{1}{T} \sum_t \left[ \frac{1}{D} \sum_d x_{d,t} y_{d,t} \right] = \frac{1}{T} \sum_t \beta_t&#xA;$$&#xA;The rigid estimator is just the average of the slice estimators. And whenever you have a global average you can put instead a Kernel to average locally. This would in effect pool information from nearby slices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I take a Kernel function $K_h$ with bandwidth $h$, then for each time slice $t$ I can define the weights&#xA;$$&#xA;w_{t,\tau} = \frac{K_h(t-\tau)}{\sum_{t'} K_h(t'-\tau)}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, my estimated slope for the slice $t$ is given by&#xA;$$&#xA;\beta^h_t = \sum_\tau w^h_{t,\tau} \beta_\tau = \frac{1}{D} \sum_\tau \sum_d w^h_{t,\tau} x_{d,\tau} y_{d,\tau}&#xA;$$&#xA;You can confirm that as the bandwidth goes to infinity all weights go to $1/T$ and we end up with $\beta_\infty$; as the bandwidth goes to zero the weights go to zero except for $\tau=t$ and we end up with the single-slice $\beta_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a sketch, which can be made more precise to account for time varying volatility, means etc. I suppose using Kernels is the 'machine learning' bit.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2016-03-30T22:19:10.293" LastActivityDate="2016-03-30T22:19:10.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25159" PostTypeId="2" ParentId="25126" CreationDate="2016-03-31T00:49:56.743" Score="0" Body="&lt;p&gt;I don't have any problem with the short stock position.  In real life, you borrow the stock (costing some pretty small amount), sell it in the market, and receive cash, which you can deposit to earn interest.  The cost of borrowing the stock is not determined by the market rate for short term loans.  It is just a fee paid to whoever owns the stock, as compensation for the inconvenience and risk of lending it out.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-03-31T00:49:56.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25161" PostTypeId="1" CreationDate="2016-03-31T09:51:51.970" Score="1" ViewCount="92" Body="&lt;p&gt;There are different rates curve to compound prices. Since the crisis, regulators tends to favor price compounding with swap curves over IR curves deduced from governments bonds (EU regulators, french bonds for example). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the rationale behind this choice ? Is this to avoid negative rates ? Is this to avoid a risk premium on countries ? To include a risk premium on banks ? A liquidity problem ? An easy solution as swap are directly quoted in Bloomberg / Reuters ? &lt;/p&gt;&#xA;" OwnerUserId="5052" LastEditorUserId="5052" LastEditDate="2016-03-31T09:57:30.543" LastActivityDate="2017-12-23T07:01:02.027" Title="Price compounding: Swap versus Governments Bonds" Tags="&lt;interest-rates&gt;&lt;interest-rate-swap&gt;&lt;compounding&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25162" PostTypeId="2" ParentId="25157" CreationDate="2016-03-31T13:42:29.523" Score="5" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;The old VIX index is based on the Black-Scholes implied volatility of&#xA;  S&amp;amp;P 100 options. To construct the old VIX, two puts and two calls for&#xA;  strikes immediately above and below the current index are chosen. Near&#xA;  maturities (greater than eight days) and second nearby maturities are&#xA;  chosen to achieve a complete set of eight options. By inverting the&#xA;  Black-Scholes pricing formula using current market prices, an implied&#xA;  volatility is found for each of the eight options. These volatilities&#xA;  are then averaged, first the puts and the calls, then the high and low&#xA;  strikes. Finally, an interpolation between maturities is done to&#xA;  compute a 30 calendar day (22 trading day) implied volatility.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;a href=&quot;http://chesnes.com/docs/fed_docs/Hao_NewVix.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://chesnes.com/docs/fed_docs/Hao_NewVix.pdf&lt;/a&gt; &lt;br&gt;&#xA;(see also Appendix within for the exact formulae)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also this exhaustive (and seminal) paper by &lt;a href=&quot;http://www.math.nyu.edu/research/carrp/papers/pdf/JODCarrWu.pdf&quot; rel=&quot;noreferrer&quot;&gt;Carr, P.; Wu, L.: A tale of two indices&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2016-03-31T13:50:24.860" LastActivityDate="2016-03-31T13:50:24.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25163" PostTypeId="1" CreationDate="2016-03-31T14:11:25.160" Score="4" ViewCount="753" Body="&lt;p&gt;How can I exploit an arbitrage by violating the following no-arbitrage condition (taken from the paper &quot;Arbitrage-Free Construction of the Swaption Cube&quot; by Simon Johnson and Bereshad Nonas):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Swptn(K,T1,T2)+Swptn(K,T2,T3) &gt;= Swptn(K,T1,T3)&#xA;with Swptn(A,B,C) being the price of a swaption of strike A, time to option maturity B, time to underlying swap maturity C.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any hints.&#xA;L.&lt;/p&gt;&#xA;" OwnerUserId="20100" LastActivityDate="2016-04-06T16:12:20.317" Title="Swaption Volatility Cube arbitrage" Tags="&lt;volatility&gt;&lt;arbitrage&gt;&lt;swaption&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25164" PostTypeId="2" ParentId="25157" CreationDate="2016-03-31T14:55:54.997" Score="9" Body="&lt;p&gt;There were two changes to the VIX; the first change in 2003 that switched from S&amp;amp;P 100 options to S&amp;amp;P 500, and from implied volatility to variance swap method. The second change was in 2014 when calculation included weekly options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Before 2014 the first series used had to have at least one week to expiration. Then the next series was used without any limit on time to expiration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Month-end options were certainly considered, but are not used probably because historically they have been less liquid than regular 3rd Friday options. It is hard to say why CBOE did not include them when they included weeklys - I have not calculated statistics, but I just checked quotes, and bid-ask spreads, volumes, and open interest on month-end options appear comparable to nearest weekly options. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source: pre-2014 VIX white paper &lt;a href=&quot;http://www.dormantrading.com/uploaded/docs/directory/vixwhite.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.dormantrading.com/uploaded/docs/directory/vixwhite.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternative (reliable) link to white paper:&#xA;&lt;a href=&quot;https://web.archive.org/web/20091231021416/https://www.cboe.com/micro/vix/vixwhite.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://web.archive.org/web/20091231021416/https://www.cboe.com/micro/vix/vixwhite.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="185" LastEditorUserId="24888" LastEditDate="2018-04-17T14:46:03.900" LastActivityDate="2018-04-17T14:46:03.900" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25165" PostTypeId="2" ParentId="25132" CreationDate="2016-03-31T15:17:17.657" Score="1" Body="&lt;p&gt;Just a small addition to excellent responses above - traders' rule of thumb is that vol term structure moves proportional to inverse sqrt of time to expiration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source: Dynamic Hedging by Taleb&lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2016-03-31T15:17:17.657" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25166" PostTypeId="2" ParentId="25149" CreationDate="2016-03-31T15:52:55.927" Score="2" Body="&lt;p&gt;You have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\beta_1=\frac{1}{(1+r)^n}\frac{1}{(1+r)^\theta}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\beta_2=\frac{1}{(1+r)^n}\frac{1}{(1+\theta r)}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both are equal when $\theta=1$. If you consider simple interest then go for $\beta_2$. If you would like compound interest within fraction of year then pick $\beta_1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, because $\theta$ is between 0 and 1 then values $\beta$'s won't be that different.&lt;/p&gt;&#xA;" OwnerUserId="19653" LastActivityDate="2016-03-31T15:52:55.927" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25167" PostTypeId="1" CreationDate="2016-03-31T17:14:01.363" Score="1" ViewCount="126" Body="&lt;p&gt;Trying to think about the right way to hedge a EUR denominated issuance from FX risk only. Say I have an annual pay 20-year EUR bond and I want to hedge the FX risk but take the interest rate risk. I would be hedging using forwards, say 3m. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What value of the bond should I hedge, present value or future value? &lt;/p&gt;&#xA;" OwnerUserId="11806" LastActivityDate="2016-04-02T20:36:40.110" Title="EUR issuance using forwards to hedge FX risk" Tags="&lt;fx&gt;&lt;bond&gt;&lt;hedging&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25168" PostTypeId="1" CreationDate="2016-03-31T19:40:05.127" Score="3" ViewCount="260" Body="&lt;p&gt;I did a test about quantitative finance. One of the question was :&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;What is the probability, in the Black-Scholes world, that the realized volatility is larger the implied volatility ? And why ?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I couldn’t find any answer on the internet. Could you help me please ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much for your help&lt;/p&gt;&#xA;" OwnerUserId="20105" LastActivityDate="2016-04-02T23:26:45.097" Title="Probability that realized volatility is larger than implied volatility" Tags="&lt;black-scholes&gt;&lt;implied-volatility&gt;" AnswerCount="2" CommentCount="7" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25169" PostTypeId="1" CreationDate="2016-04-01T00:00:19.590" Score="1" ViewCount="119" Body="&lt;blockquote&gt;&#xA;&lt;p&gt;Given the SDE, find the PDE for the function &lt;span class=&quot;math-container&quot;&gt;$V(t,x)$&lt;/span&gt; such that &lt;span class=&quot;math-container&quot;&gt;$V(t,S_t)$&lt;/span&gt; is a martingale.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$dS_t = \kappa(m - S_t)dt + \sigma\sqrt{S_t}dB_t$&lt;/span&gt; where &lt;span class=&quot;math-container&quot;&gt;$\kappa$&lt;/span&gt;,&lt;span class=&quot;math-container&quot;&gt;$m$&lt;/span&gt;, and &lt;span class=&quot;math-container&quot;&gt;$\sigma$&lt;/span&gt; are constants.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Attempted solution: The stochastic differential equation or SDE can be written in differential form such that &lt;span class=&quot;math-container&quot;&gt;$$dS_t = \mu(t,S_t)dt + \sigma(t,S_t)dB_t$$&lt;/span&gt; thus from c.) we have &lt;span class=&quot;math-container&quot;&gt;$$\mu(t,S_t) = \kappa(m-S_t) \ \ \ \text{and} \ \ \ \sigma(t,S_t) = \sigma\sqrt{S_t}$$&lt;/span&gt; &lt;span class=&quot;math-container&quot;&gt;$V(t,S_t)$&lt;/span&gt; is martingale if and only if &lt;span class=&quot;math-container&quot;&gt;$V(t,x)$&lt;/span&gt; satisfies &lt;span class=&quot;math-container&quot;&gt;$$\partial_t V(t,x) + \partial_x V(t,x)\mu(t,x) + \frac{1}{2}\partial_{xx}V(t,x)\sigma^2(t,x) = 0$$&lt;/span&gt; therefore the PDE required to satisfy this condition is &lt;span class=&quot;math-container&quot;&gt;$$\partial_t V(t,x) + \partial_x V(t,x)\kappa(m - S_t) + \frac{1}{2}\partial_{xx}V(t,x)\sigma^2 S_t = 0$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Not sure if this is correct any suggestions is greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-04-01T00:18:06.110" Title="Find the PDE for a function that makes it a martingale" Tags="&lt;mathematics&gt;&lt;martingale&gt;&lt;finance-mathematics&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25170" PostTypeId="2" ParentId="24799" CreationDate="2016-04-01T00:21:20.707" Score="-1" Body="&lt;p&gt;Wikipedia has a simple table. &lt;a href=&quot;https://en.wikipedia.org/wiki/S%26P/TSX_Composite_Index&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/S%26P/TSX_Composite_Index&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20108" LastActivityDate="2016-04-01T00:21:20.707" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25171" PostTypeId="1" AcceptedAnswerId="25184" CreationDate="2016-04-01T00:40:56.950" Score="1" ViewCount="386" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Consider the SDE $$dS_t = rS_t dt + \sigma S_t dB_t \ \ \ \text{where} \ r \ \text{and} \ \sigma \ \text{are constants}$$&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;a.) Find the ODE for the function $V(x)$ such that $e^{-rt}V(S_t)$ is martingale.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;b.) Find all the solutions to the ODE in (a).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Attempted solution for a.) $V(t,S_t)$ is martingale if and only if $V(t,x)$ satisfies $$\partial_t V(t,x) + \partial_x V(t,x)\mu(t,x) + \frac{1}{2}\partial_{xx}V(t,x)\sigma^2(t,x) = 0$$ hence set $V(t,x) = V(x)e^{-rt}$ in the equation above, we then have $$V(x)\partial_t e^{-rt} + e^{-rt}\partial_x V(x)\mu + {\color{red}{\frac{1}{2}}} e^{-rt}\partial_{xx}V(x)\sigma^2 = 0$$ where $\mu = r S_t$ and $\sigma = \sigma S_t$. Therefore the ODE for the function $V(x)$ is $$-rV(x)e^{-rt} + re^{-rt}S_t\frac{d V}{dx} + {\color{red}{\frac{1}{2}}}\sigma^2e^{-rt}S_t^2\frac{d^2 V}{dx^2} = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Attempted solution for b.) We have a second order constant coefficent linear differential equation of the form $$aV^{''} + bV' + cV = 0$$ where $a = \sigma^2 S_t^{2}$, $b = rS_t$, and $c = -r$. Thus the solution to this ode is $$V = \begin{cases}&#xA;Ae^{m_1x} + Be^{m_2x}, &amp;amp; \text{if} \ am^2 + bm + c = 0 \ \text{has distinct real roots}\\&#xA;e^{ax}( C cos(\beta x) + Dsin(\beta x), &amp;amp; \text{if} \ am^2 + bm + c = 0 \ \text{has roots equal to} \alpha\pm \beta i \\&#xA;(Ax + B)e^{mx}, &amp;amp; \text{if} \ am^2 + bm + c = 0 \ \text{has 1 repeated root}&#xA;\end{cases}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not sure is this is correct any suggestions is greatly appreciated. &lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="11678" LastEditDate="2016-04-01T18:30:26.920" LastActivityDate="2016-04-01T18:59:28.000" Title="Find the solutions of the ODE from SDE" Tags="&lt;mathematics&gt;&lt;martingale&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25172" PostTypeId="1" CreationDate="2016-04-01T03:34:39.057" Score="1" ViewCount="493" Body="&lt;p&gt;I have had experience creating stat arb strategies for equities and etfs, but haven't dabbled much into FX trading. I was wondering if anyone knew any resources online they would suggest, or could lend their intuition as to how they would go about determining whether a currency is over/undervalued purely from the data alone. Thank you in advance!&lt;/p&gt;&#xA;" OwnerUserId="20109" LastActivityDate="2016-04-01T03:34:39.057" Title="FX Statistical Arbitrage Strategy" Tags="&lt;quant-trading-strategies&gt;&lt;statistics&gt;&lt;fx&gt;&lt;arbitrage&gt;" AnswerCount="0" CommentCount="3" ClosedDate="2016-04-01T07:11:00.700" ContentLicense="CC BY-SA 3.0" />
  <row Id="25173" PostTypeId="1" AcceptedAnswerId="25174" CreationDate="2016-04-01T08:57:45.277" Score="4" ViewCount="706" Body="&lt;p&gt;There is an expression - &quot;Too big to fall.&quot; - which means that if a bank or a financial institution manages a sufficient part of the financial assets than the state can't afford that this bank or institution goes to fall, because it causes a big shock in the market, and can break the economic system of a country.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the question arises: why did american state not save the Lehman Brothers and AIG? Because if these banks didn't fail, the crisis wouldn't have started.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An other question: How can the Rating Institutions has given 'AAA' rating for extremely risk assets (like CDO and CDS)? Nobody realized that (where work a lot of profession workers) if the debaters can't pay back their very risk loans it can be broke the whole system?&lt;/p&gt;&#xA;" OwnerUserId="6975" LastEditorUserId="7117" LastEditDate="2016-04-01T14:30:49.857" LastActivityDate="2016-04-04T03:04:17.410" Title="Could we have prevented the World Economic Crisis in 2008?" Tags="&lt;risk&gt;&lt;economics&gt;&lt;credit-ratings&gt;&lt;banks&gt;&lt;asset&gt;" AnswerCount="4" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25174" PostTypeId="2" ParentId="25173" CreationDate="2016-04-01T09:44:01.413" Score="4" Body="&lt;p&gt;U.S. Government DID save American International Group (AIG) from bankruptcy, since it was considered too big to fail, actually: a lot of financial institutions were insured by AIG. This &lt;a href=&quot;http://www.investopedia.com/articles/economics/09/american-investment-group-aig-bailout.asp&quot; rel=&quot;nofollow&quot;&gt;Investopedia page&lt;/a&gt; is a nice summary on the topic about AIG's bailout. &lt;a href=&quot;http://www.investopedia.com/articles/economics/09/lehman-brothers-collapse.asp&quot; rel=&quot;nofollow&quot;&gt;Here (Investopedia again) about Lehman Brothers&lt;/a&gt;, that became really too much leveraged and exposed to the subprime business.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally, I think that it ALL begun with the deregulation driven by the FED and its chairman Alan Greenspan (&lt;a href=&quot;https://en.wikipedia.org/wiki/Alan_Greenspan#Chairman_of_the_Federal_Reserve&quot; rel=&quot;nofollow&quot;&gt;Wiki&lt;/a&gt;) during the '90s and earlier '00s, who was too much confident about the self-correcting capacity of the markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rating agencies are paid from financial institutions (for example) to give a rating to the firm, the products sold, etc. During the decade before the financial crisis, there were very too much money involved into the business, and it was convenient for everyone to give the highest rating possible also to very bad products, since this led other money in the pockets of financial institutions, without thinking to the consequences. The leaders of that companies are, in any case, safe from the losses: they got millions (even dozens of millions) in &quot;severance pay&quot; after the collapse of the financial markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Probably, sooner or later, the crisis would have started even with the bailout of Lehman Brothers, since the situation was very unsustainable (not only for the questioned bank): you can read in this &lt;a href=&quot;http://www.nytimes.com/2008/10/15/business/economy/15bailout.html?_r=0&quot; rel=&quot;nofollow&quot;&gt;NY Times&lt;/a&gt; article the proportion of the help that U.S. Government gave to both the biggest banks and minor financial institutions. The literature about the topic is very wide and you can find a lot of data (losses, debts, magnitude of subprime mortgages and related derivatives products that financial institutions all over the world bought) and explanations (conspirancy theories appear very plausible to this situation, such as the one explained by @InnocentR on the comments).&lt;/p&gt;&#xA;" OwnerUserId="18694" LastEditorUserId="18694" LastEditDate="2016-04-01T18:11:18.983" LastActivityDate="2016-04-01T18:11:18.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25175" PostTypeId="2" ParentId="25145" CreationDate="2016-04-01T10:13:54.687" Score="2" Body="&lt;p&gt;This is a much discussesd topic in the litrature, I recommend you to read FF2012: &quot;Size, value, and momentum in international stock returns&quot;. Best practice is to create Europe, country or even sector specific factors.&lt;/p&gt;&#xA;" OwnerUserId="18070" LastActivityDate="2016-04-01T10:13:54.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25176" PostTypeId="1" AcceptedAnswerId="25183" CreationDate="2016-04-01T11:47:35.167" Score="11" ViewCount="6643" Body="&lt;p&gt;I'm an engineer doing academic research for my master thesis in the area of quantitative finance, basically the purpose is to study the possibility to create an intraday-trading algorithm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried a regression algorithm (SVR) to predict future prices without success and currently I'm using Boosted Decision Trees (BDT) for a classification problem (Long/Short/Out) where I would take advantage of a daily trend (place an order at the beginning of the day, sell at the end of the day), for example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Long&lt;/strong&gt; when BDT predicts &lt;strong&gt;Close &gt; Open*(1+a)&lt;/strong&gt; &lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Short&lt;/strong&gt; when BDT predicts &lt;strong&gt;Close &amp;lt; Open*(1-a)&lt;/strong&gt;, where 'a' is an error gap;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'm using technical indicators: RSI, MFI, SMA, EMA, MACD, ATR, Bollinger, and linear combinations of them. I think I'm doing everything right, all the indicator values are normalized with the Open price, I'm using cross validated metrics and a grid search to look at different combination of parameters for both the technical indicators and Boosted Decision Trees.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But until now it seems that, at least at the intraday level, the market is just a stochastic process! I have also read a few articles available online and found a couple of errors on them (using lagged data or indicator values, for example), which leads me to believe that most of the literature is just junk, I mean it's impossible if everyone that tries to create a trading algorithm that generates positive returns is successful, right?! I won't even talk about the ridiculous articles using technical analysis with the supports and resistances, I generated a Geometric Brownian Motion plot and I also see those hypothetical supports and resistances, but there is no rational behind them, just people's imagination of things that don't exist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is your opinion on this subject? Do you have knowledge of a successful intraday trading algorithm? With what kind of average daily returns (0.01%,0.1%,1%)?&lt;/p&gt;&#xA;" OwnerUserId="20110" LastActivityDate="2020-04-13T02:18:40.347" Title="Is it really possible to create a robust algorithmic trading strategy for intraday trading?" Tags="&lt;brownian-motion&gt;&lt;algorithmic-trading&gt;&lt;machine-learning&gt;&lt;stochastic&gt;" AnswerCount="4" CommentCount="4" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="25177" PostTypeId="2" ParentId="25176" CreationDate="2016-04-01T12:31:06.270" Score="11" Body="&lt;p&gt;Here's my favorite example of an intraday strategy on S&amp;amp;P500 futures that at least used to work:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2506322&quot;&gt;Intraday Share Price Volatility and Leveraged ETF Rebalancing&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I pull it out whenever people start talking about market efficiency. The strategy is very simple: if S&amp;amp;P500 futures are up or down more than 2% on the day with two hours left until close, follow that direction until close.&#xA;At first sight it looks like a random non-sense strategy, but if you read the paper you can clearly see that there are some very predictable Leveraged ETF rebalancing flows that move the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would say that it's definitely possible to find a profitable intraday trading strategy, but you have to be able to answer this question: &quot;who is losing money on the other end?&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see another entertaining example if you search for news on &quot;Good Harbor Financial&quot;.&lt;/p&gt;&#xA;" OwnerUserId="19615" LastActivityDate="2016-04-01T12:31:06.270" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25178" PostTypeId="2" ParentId="25173" CreationDate="2016-04-01T13:09:36.760" Score="2" Body="&lt;p&gt;Regarding how the rating agencies gave AAA ratings to CDOs and the like that clearly did not deserve those ratings - straightforward answer. The SEC licences all the ratings agencies as &lt;a href=&quot;https://www.sec.gov/answers/nrsro.htm&quot; rel=&quot;nofollow&quot;&gt;&quot;nationally recognized statistical rating organizations&quot; (NRSRO)&lt;/a&gt;. It is blindingly obvious that the SEC was not actually overseeing the rating organizations that it was responsible for overseeing. It was a joke for years about the crap loans that were being loaded into the CDOs and other asset backed securities - the &quot;NINJA&quot; mortgages (no income, no job).  Despite the flurry of commentary in the markets and in the media, the practices of loading junk mortgages into CDOs and the ratings agencies rating this crap AAA continued.  The head of the SEC from when the dot-com bubble burst until the beginning of the mortgage crisis is singularly responsible for the housing crisis. Banks will always take excessive risks just as kids will always reach for the cookie jar. Oversight is there for a reason and DID NOT HAPPEN. And the lack of accountability of the overseers is appalling. Regulation servers a purpose - IF IT IS ACTUALLY DONE.&lt;/p&gt;&#xA;" OwnerUserId="12142" LastActivityDate="2016-04-01T13:09:36.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25179" PostTypeId="1" CreationDate="2016-04-01T13:59:41.153" Score="1" ViewCount="37" Body="&lt;p&gt;so I want to find out, if its possible to find out for any backtest for the Value at Risk(Kupics POF or Christophersen's Markov Test), if it is possible to make apriori Statements on Testing results ( p-value; or power or anything ) using different prediction models (GARCH, or unconditional).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for &lt;strong&gt;apriori&lt;/strong&gt; Statements like: &lt;em&gt;if we'd use the GARCH model to predict the VaR it will be more likely, that the Kupics POF test has a higher p-value then if we'd use the ARCH-model&lt;/em&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If Statements like these exists, are the mathematical proof for these Statments? If nothing like this exists, would it be possible to discover similar apriori Statements ( with mathematical proof)?&lt;/p&gt;&#xA;" OwnerUserId="20113" LastActivityDate="2016-04-01T13:59:41.153" Title="Making apriori Statements on VaR Backtests with a Garch Modelled VaR" Tags="&lt;backtesting&gt;&lt;var&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25180" PostTypeId="2" ParentId="25167" CreationDate="2016-04-01T14:56:38.207" Score="0" Body="&lt;p&gt;To hedge the EUR value without interest rate risk then you'd use the net present value of the EUR face value you receive at maturity, and add the NPV of all the discounted future cash flows, right?&lt;/p&gt;&#xA;" OwnerUserId="7369" LastEditorUserId="7369" LastEditDate="2016-04-01T15:34:00.777" LastActivityDate="2016-04-01T15:34:00.777" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25181" PostTypeId="2" ParentId="16827" CreationDate="2016-04-01T16:22:50.807" Score="0" Body="&lt;p&gt;I recommend you this paper&#xA;Measuring Portfolio Diversification&#xA;Ulrich Kirchner &amp;amp; Caroline Zunckel&#xA;&lt;a href=&quot;http://arxiv.org/pdf/1102.4722.pdf&quot; rel=&quot;nofollow&quot;&gt;http://arxiv.org/pdf/1102.4722.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20114" LastActivityDate="2016-04-01T16:22:50.807" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25182" PostTypeId="2" ParentId="25168" CreationDate="2016-04-01T17:03:55.063" Score="1" Body="&lt;p&gt;I succeeded to have the expected answer, and I was on the right way :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The implied volatility is the ATM IV &#xA;The realised volatility is defined as the absolute value of the log return&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know that a gaussian random variable is in the range +- 1*sigma with a probability of 68%. So, the correct answer is approximately 32%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should you have any comment I am interested &lt;/p&gt;&#xA;" OwnerUserId="20105" LastActivityDate="2016-04-01T17:03:55.063" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25183" PostTypeId="2" ParentId="25176" CreationDate="2016-04-01T17:38:21.723" Score="7" Body="&lt;p&gt;Such a complex question...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Geometric Brownian Motion (GBM) will not typically work to aid one finding strategies based on technicals, as the pursuit of the technical trader is to find market deviations from a random walk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, some strategies, for example a &quot;take profit/stop loss&quot; strategy can work, (or at a minimum one can change the risk/reward profile) using GBM on assumptions of limited slippage (where stop loss is not effective due to jumps in price). This is due to the non-linearity of likelihoods vs risks/rewards.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The typical problem of empirical findings vs real trading involve overfitting of data/models when deciding upon a strategy. And if a strategy is successful, how does one know it's because it's a good strategy or anecdotally worked subsequently?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If one gave 10000 monkeys buy/sell buttons their results might approximate a normal distribution. If one took the top performing monkeys and gave them buy/sell buttons, some of those would perform better than others. Can one say anything about the top of the top performing monkeys?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, if one tests enough strategies on a set of test data, some will work admirably. And if data is split into 2 sets? One to test strategies, and a strategy chosen, a second separate set of data for confirmation? Well, done enough, again some will perform better than others. These are examples of 'data snooping'. It typically proliferates - from articles online, even into literature - books and academic papers. So data rigorous data splicing is required, but this can present its own problems, including correlations of some attributes between data sets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In response to your question:&lt;br&gt;&#xA;&lt;strong&gt;Are successful intraday strategies possible to find?&lt;/strong&gt;&lt;br&gt;&#xA;My belief is yes - based upon my experience working in investment banks, and my own research. Highly dependent upon market, and external factors are usually required to refine strategies to a point where they are profitable. There are a plethora of books and papers suggesting things such as momentum, sentiment, auto-correlation, mean-reversion, trending, and oh so many technicals. How can they work? Because in reality the market is not always random - there are periods of non-randomness. Sometimes these are tiny squeaks obscured by a concerto of noise (particularly short-term). But, if you can find these pockets of non-randomness, you can find successful strategies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't believe me, then listen to the man from Renaissance, one of the most successful Hedge funds of all time: &lt;a href=&quot;https://www.ted.com/talks/jim_simons_a_rare_interview_with_the_mathematician_who_cracked_wall_street?language=en&quot; rel=&quot;noreferrer&quot;&gt;Jim Simons Interview link&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I'm not suggesting they use &quot;technicals&quot; in the typical use of the word. They might, or not. I've no idea what they use, but I believe they use models based on more than just fundamentals.&lt;/p&gt;&#xA;" OwnerUserId="17303" LastActivityDate="2016-04-01T17:38:21.723" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25184" PostTypeId="2" ParentId="25171" CreationDate="2016-04-01T18:48:25.763" Score="0" Body="&lt;p&gt;I will consider (b) only. From part (a), the ODE is of the form&#xA;\begin{align*}&#xA;-r V(x) +rx\frac{dV(x)}{dx} + \frac{1}{2}\sigma^2 x^2 \frac{d^2V(x)}{dx^2} = 0.\tag{1}&#xA;\end{align*}&#xA;Let $x=e^y$. Then,&#xA;\begin{align*}&#xA;\frac{dV(x)}{dx} &amp;amp;= \frac{dV(e^y)}{dy}\frac{dy}{dx}\\&#xA;&amp;amp;=\frac{1}{x}\frac{dV(e^y)}{dy},\\&#xA;\frac{d^2V(x)}{dx^2} &amp;amp;= -\frac{1}{x^2}\frac{dV(e^y)}{dy} + \frac{d^2V(e^y)}{dy^2}\frac{1}{x^2}.&#xA;\end{align*}&#xA;Moreover, Equation (1) is now of the form&#xA;\begin{align*}&#xA;-r V(e^y) +\Big(r-\frac{1}{2}\sigma^2\Big)\frac{dV(e^y)}{dy} + \frac{1}{2}\sigma^2 \frac{d^2V(e^y)}{dy^2} = 0.\tag{2}&#xA;\end{align*}&#xA;The technique you have shown in your question can now be used to solve this equation. Specifically, &#xA;\begin{align*}&#xA;V(e^y)= Ae^{y}+Be^{-\frac{2r}{\sigma^2} y}.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;V(x)= Ax+Bx^{-\frac{2r}{\sigma^2}},&#xA;\end{align*}&#xA;where $A$ and $B$ are constants.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-04-01T18:59:28.000" LastActivityDate="2016-04-01T18:59:28.000" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25185" PostTypeId="2" ParentId="18828" CreationDate="2016-04-01T18:52:20.020" Score="0" Body="&lt;p&gt;To reiterate what has been said, futures are just that, a contract for future delivery. So a person trading or using these futures to hedge may want to trade something way out on the curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Crude Oil Futures for example trade out to December 2024, though the only volume I see today is in December 2020.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way that data is presented is tough to understand because on some days there will be trading and then none and the data doesn't show the synthetic settles for those days it seems or there may not be a settle so that's why you see it going to 0 and &quot;snapping back&quot;. It never really snapped back it's just missing data it looks like.&lt;/p&gt;&#xA;" OwnerUserId="11748" LastActivityDate="2016-04-01T18:52:20.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25186" PostTypeId="1" CreationDate="2016-04-01T20:26:09.360" Score="1" ViewCount="186" Body="&lt;p&gt;Some questions about intraday returns and volatility figures. It is with the objective of sense checking.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Firstly, for Security A, I am calculating the five minute interval return numbers over 29500 intervals. You can see below some of the results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly, for another security, I am calculating the Parkinson volatility numbers using five minute intervals. I use the following Parkinson volatility&#xA;formula&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/c1ftJ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/c1ftJ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I first calculate the parkinson numbers per each day and take the average of the days over 365 days.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Return Numbers&lt;/strong&gt; for Security A at 5 minute intervals&#xA;    R_t(%) x 10^2   R_t(%)     |R_t| (%)    |R_t| (%)   R_t^2(%)    R_t^2(%)&#xA;    Mean    Standard Deviation  Mean    Standard Deviation  Mean    Standard Deviation&#xA;S   -0.0083           0.1166    0.0737     0.0903       0.0001         0.0007&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Volatility Numbers&lt;/strong&gt; for Security B at 5 minute intervals &lt;/p&gt;&#xA;&#xA;&lt;p&gt;*calculated per day&#xA;Average Vol (%) Std Dev   Minimum (%)   Maximum (%)&#xA;0.0737582      0.0312347    0.0290989   0.2561527&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Do these return and volatility numbers make sense from a scale point of view? What source can guide us as to the stylized facts and expected scale of intraday return /volatility figures? Obviously, this will assure whether one's estimations are within reasonable ranges.The volatility numbers seem low to me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) The Parkinson volatility calculation as per the attached formula-what time horizon does it correspond to? daily? what is right frequency convention in the statement of intra-day volatility figures?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) In terms of volatility conversion, how can one convert a 5 minute intraday volatility number into 30-min volatility numbers? Likewise into daily or annualized figures&#xA;Your prompt response will be appreciated&lt;/p&gt;&#xA;" OwnerUserId="20116" LastActivityDate="2016-04-01T20:26:09.360" Title="Intraday return and volatility figures some sense check" Tags="&lt;data&gt;&lt;intraday&gt;&lt;stylized-facts&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="25187" PostTypeId="1" CreationDate="2016-04-01T20:59:01.917" Score="5" ViewCount="529" Body="&lt;p&gt;I am trying to rank countries based on Tobin's Q ratio. US data can be easily gathered from FED's report and is available on multiple website.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want get data on other countries with high Index of Economic Freedom.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone suggest sources that might have this data?&lt;/p&gt;&#xA;" OwnerUserId="20118" LastActivityDate="2016-07-04T17:24:17.460" Title="Where to get Tobin's Q by country" Tags="&lt;equities&gt;&lt;statistics&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25189" PostTypeId="1" CreationDate="2016-04-02T10:42:25.133" Score="1" ViewCount="45" Body="&lt;p&gt;I have the following PDE&#xA;$0 = V_t  - c(t)V_x - \lambda^2 V_x^2/V_{xx} + rxV_x + 1/2\lambda^2x^2V_{xx}$&#xA;where $t\mapsto c(t)$ is some given function and $r,\lambda$ are given constants.&#xA;If necessary, one can impose $V(T,x) = \log(x)$ for some finite $T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I would like to know is whether the quantity $V_x/(xV_{xx})$ depends on $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The short background to this question is that there is an agent who wants to maximize his terminal wealth utility at $T$ and this agent consumes at a rate $c(t)$. Dependence of the quantity above on $t$ would imply dependence of optimal allocation strategy (stocks versus bonds) on $t$ and that is what I would like to find out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The PDE above comes from the HJB equation. Namely,&#xA;$$0 = V_t +\sup_{\delta}\left((\delta(\mu-r)+r)xV_x - cV_x + \frac{1}{2}\delta^2x^2\sigma^2V_{xx}\right)$$&#xA;with $V(T,x) = U_2(x)$ where $\delta$ is the allocation to stock and $c$ is the consumption rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The underlying model is the Merton model and the agent wants to maximize $E[U_2(X_T)]$ where $U_2$ is some utility function and $(X_t)_{t\in[0,T]}$ is the wealth process. I could write more details but this is a very standard problem. The only thing that makes it non-standard is that there is a prescribed consumption. If $c(t) = 0$ for all $t \in [0,T]$, then the optimal $\delta = \frac{\mu -r}{\gamma\sigma^2}$ where $\gamma$ is the risk-aversion coefficient in power utility.&lt;/p&gt;&#xA;" OwnerUserId="11597" LastEditorUserId="11597" LastEditDate="2016-04-02T16:50:35.140" LastActivityDate="2016-04-02T16:50:35.140" Title="Continous-time portfolio allocation optimization for a given consumption rate" Tags="&lt;optimization&gt;" AnswerCount="0" CommentCount="7" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25190" PostTypeId="1" AcceptedAnswerId="25211" CreationDate="2016-04-02T11:20:40.207" Score="3" ViewCount="215" Body="&lt;p&gt;Let a stock price process be $(S_t)_{t\geq 0}$ and let $(K, T)\longrightarrow \sigma^*(K,T)$ be the volatility surface corresponding to vanilla options on the stock. &#xA;What is, for any time $T$ the implied distribution density of $S_T$ corresponding to strike $K$?&#xA;Also, what is $\mathbb P(S_T=K)$ as a function of the call price, for maturity $T$ and strike $K$? And what is its expression as a function of $\sigma^*$ and its derivatives?&lt;/p&gt;&#xA;" OwnerUserId="11960" LastActivityDate="2016-04-04T19:36:45.120" Title="A question on implied volatility surface" Tags="&lt;volatility&gt;&lt;stochastic-volatility&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25191" PostTypeId="1" CreationDate="2016-04-02T14:20:12.773" Score="2" ViewCount="371" Body="&lt;p&gt;I want to apply the knowledge of this &lt;a href=&quot;http://arxiv.org/pdf/1112.5550&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; (Bayesian estimation of probabilities of default for low default portfolios, by Dirk Tasche) in R, but I can't find the right bayesian package and functions to use. Can you help me?&lt;/p&gt;&#xA;" OwnerUserId="18694" LastEditorUserId="16160" LastEditDate="2016-04-02T18:10:47.253" LastActivityDate="2016-04-02T18:10:47.253" Title="Bayesian analysis in R: Probability of default, low default portfolios" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;credit-risk&gt;&lt;bayes-theory&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25192" PostTypeId="2" ParentId="25173" CreationDate="2016-04-02T18:53:19.463" Score="0" Body="&lt;p&gt;The crisis was mostly underway at least two years before Lehman's demise. Saving Lehman would not have been enough to stop the recession, housing market bust, and other problems. &lt;/p&gt;&#xA;" OwnerUserId="15081" LastActivityDate="2016-04-02T18:53:19.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25193" PostTypeId="2" ParentId="25090" CreationDate="2016-04-02T19:14:10.537" Score="0" Body="&lt;p&gt;Of course LSMC can be used in any case where you would benefit from early exercise (and the contract's not too convoluted I guess). So yes, if the Bermudan/American call is on a dividend-paying stock, then L-S could/would be used same way as for a put. But what happens if you try to price a Bermudan call without dividends with L-S? You should in theory get the European price as MJ is saying (even if there's no point doing it since we know this is what we should get anyway). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But has anyone tried that? I have, and in my experience L-S does not work very well in this case, in that it under-prices the option, giving a value markedly lower than the European price! The reason is, I theorise, the following: As we know L-S provides only an estimate of the continuation value and hence the decisions taken based on it will be sub-optimal and the prices low-biased. Now in the case of the American/Bermudan call with no dividends, even the slightest error in the continuation value fit will result in a sub-optimal exercise decision because the early-exercise premium is zero here. So based on the continuation value the algo should never lead to exercising in any of the simulated paths, but it actually does so we lose value...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When the dividend yield is non-zero but still pretty low, L-S also struggles and then as we increase the dividend yield and there's a clear early-exercise benefit, then it starts working better (just like it does with a Bermudan put without dividends), as in the valuations it produces are more accurate, i.e. less low-biased.&lt;/p&gt;&#xA;" OwnerUserId="19373" LastEditorUserId="19373" LastEditDate="2016-04-02T19:26:10.740" LastActivityDate="2016-04-02T19:26:10.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25194" PostTypeId="1" AcceptedAnswerId="25199" CreationDate="2016-04-02T19:41:49.190" Score="3" ViewCount="461" Body="&lt;p&gt;I'm trying to understand yield to maturity of treasury bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I have a 20 year inflation linked treasury bond which pays a inflation linked spread over a given fixed rate, and a 20 year fixed rate treasury bond which matures on the exact same day. The YTM on the bonds are different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What does this difference in YTM represent to investors?&lt;/p&gt;&#xA;" OwnerUserId="17985" LastEditorUserId="21023" LastEditDate="2016-10-01T08:53:39.843" LastActivityDate="2016-10-01T08:53:39.843" Title="What does the yield spread between an inflation linked treasury bond (TIPS) and a comparable treasury bond represent?" Tags="&lt;fixed-income&gt;&lt;bond-yields&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25195" PostTypeId="2" ParentId="25194" CreationDate="2016-04-02T20:11:52.313" Score="1" Body="&lt;p&gt;The difference represents &quot;inflation compensation&quot;, or the amount that fixed bond investors must receive over and above the TIPS rate to make them accept the risk of inflation. The inflation compensation is thought to consist of the expected inflation plus a risk premium which varies over time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.federalreserve.gov/pubs/feds/2008/200805/200805pap.pdf&quot; rel=&quot;nofollow&quot;&gt;https://www.federalreserve.gov/pubs/feds/2008/200805/200805pap.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An older term was &quot;break even inflation&quot; but &quot;inflation compensation&quot; is a better choice and is what Ms. Yellen, for example, refers to. The thinking has evolved. Current thinking is that inflation compensation has 2 parts, only one of which is a forecast of future inflation.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2016-04-02T20:11:52.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25196" PostTypeId="1" CreationDate="2016-04-02T20:16:43.103" Score="2" ViewCount="3850" Body="&lt;p&gt;I am learning various strategies to day trade the emini SP500 futures contract (ES) based largely around order flow principles and price action.  I have been wanting to learn more about market making styles that can be used on a manual basis rather than automated basis.  From what I have read, most market making styles revolve around getting filled on the bid/ask and trying to take one tick and either scratch or take a very small loss if that one tick is not realized.  Is this the case?  I realize the ES is used for a huge number of reasons from stat-arb to position trades/hedging and virtually everything in between.  As a day trader, being risk averse is very important to me and from what I have heard, market making styles tend to be highly risk averse.  Any input on being a market maker in these markets is appreciated.  I know many prop firms hire traders (click traders, not necessarily HFT traders) to scalp or &quot;make a market&quot; in the index futures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="20134" LastActivityDate="2017-09-16T18:21:18.490" Title="Market making in futures" Tags="&lt;futures&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25197" PostTypeId="2" ParentId="25167" CreationDate="2016-04-02T20:36:40.110" Score="1" Body="&lt;p&gt;You need to hedge future cash flows (not future value) using a fixed for fixed currency swap (equivalent to a series of forwards). This translates into a &quot;cash flow hedge&quot;. Hedging present value would be hedging the &quot;fair value&quot; of the bond with a fixed-for-float currency swap. Using a fixed for fixed swap will convert your cash flows into desired currency (e.g. USD or GBP) and will convert EUR interest rate risk into that currency's interest rate risk. Hence you will not &quot;hedge&quot; your interest rate risk, but you will convert it from one currency's interest rates to another. It is impossible to have cash flows in one currency and interest rate risk based off of a different currency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your bond is variable rate you can use a basis swap to achieve the same type of cash flow hedge as before. If you use a float-for-fixed swap you will convert this into a interest rate hedge as well.&lt;/p&gt;&#xA;" OwnerUserId="2685" LastActivityDate="2016-04-02T20:36:40.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25199" PostTypeId="2" ParentId="25194" CreationDate="2016-04-02T22:29:59.583" Score="4" Body="&lt;p&gt;@AlexC has already provided the correct answer, but I thought I'd provide a bit more details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The breakeven inflation (still the mostly widely used practitioner terminology) is defined as follows:&#xA;$$ \text{breakeven inflation} = \text{nominal yield} - \text{TIPS yield}. $$&#xA;It is called the breakeven inflation (&quot;BEI&quot;) because if ex-post realized inflation is identical to the ex-ante BEI, then an investor should be indifferent between investing in TIPS and buying the nominal comparator (both would generate the same returns).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As @AlexC mentioned, TIPS breakeven is closely linked to inflation expectation, but in reality, it is a highly noisy measure of the former. TIPS are much less liquid compared to nominal Treasuries, so investors typically require a HIGHER yield to compensate for the illiquidity risk. Of course, this makes breakeven inflation LOWER than the true inflation expectation. This was a huge problem during the early years of the TIPS program (investors were not familiar with TIPS) and during the 2008 financial crisis. The chart below plots 10-year breakeven inflation against a market-based measure of 10-year inflation expectation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/G0t4b.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/G0t4b.png&quot; alt=&quot;TIPS breakeven vs inflation expectation&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see, during the depth of the financial crisis, 10-year TIPS breakeven traded down to 0, but surely no one expected inflation to average 0% over the next 10-years! At the time, TIPS became so illiquid that their yields are substantially inflated.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2016-04-02T22:37:43.253" LastActivityDate="2016-04-02T22:37:43.253" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25200" PostTypeId="1" AcceptedAnswerId="36484" CreationDate="2016-04-02T23:18:59.397" Score="3" ViewCount="382" Body="&lt;p&gt;What are the risks of deleveraging a leveraged long/short equity portfolio when going into a drawdown at certain drawdown stops, like deleveraging by 30% when breaching a -5% drawdown, deleveraging a further 30% when breaching a -10% drawdown? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is active de/releveraging in and of itself considered to be a risk management tool and are there any academic treatises available on this?&lt;/p&gt;&#xA;" OwnerUserId="5656" LastActivityDate="2017-10-17T07:32:46.440" Title="Leverage and Drawdown" Tags="&lt;risk-management&gt;&lt;drawdown&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25201" PostTypeId="2" ParentId="25168" CreationDate="2016-04-02T23:26:45.097" Score="0" Body="&lt;p&gt;It's clear that over time $t\rightarrow t+dt$ the &lt;strong&gt;(expected)&lt;/strong&gt; implied variance in the BS world (under the risk-neutral measure $\mathbb{Q}$) is $\sigma^2 dt$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The realized variance of an arbitrary single log stock path (under the physical measure $\mathbb{P}$) is $$\sum_{i=1}^\infty \sigma^2(W_{i+1}-W_i)^2 \approx \sum_{i=1}^n \sigma^2(W^{(n)}_{i+1}-W^{(n)}_i)^2 \sim  \sigma^2 \frac{dt}{n}\chi_n$$   for large $n$ and $W^{(n)}_{i+1}-W^{(n)}_i \sim \mathcal{N}(0,\frac{dt}{n})$ i.i.d.. Now $$ \text{Prob}(\sigma^2 \frac{dt}{n}\chi_n &amp;gt; \sigma^2 dt) = \text{Prob}(\chi_n &amp;gt; n) = \text{Prob}(\gamma(\frac{n}{2},\frac{1}{2}) &amp;gt; n),$$ where $\gamma(\frac{n}{2},\frac{1}{2})$ is the gamma distribution. The last expression can be solved numerically.&lt;/p&gt;&#xA;" OwnerUserId="6640" LastActivityDate="2016-04-02T23:26:45.097" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25204" PostTypeId="2" ParentId="23020" CreationDate="2016-04-03T05:40:07.760" Score="2" Body="&lt;p&gt;Well stock prices change all the time when markets are open. American options give you the opportunity to exercise it at any time up until maturity, whereas a European option only allows you to exercise it at a specific date and time. &#xA;A simple example is to compare an American option that matures in 1 day and European option where it matures at the last minute the market is open ie. 3:59:00PM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Stock prices don't always close at their highest level, and sometimes may close at a net loss. &#xA;The benefit of the American option is that whenever you think the stock price is going to be the highest you can exercise it anytime throughout the day. &#xA;While the European option-you have to take the price at exactly 3:59:00PM even if it wasn't the highest price in the day. In this example, the American option gives you an opportunity to reap a higher upside. &lt;/p&gt;&#xA;" OwnerUserId="17063" LastActivityDate="2016-04-03T05:40:07.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25205" PostTypeId="1" AcceptedAnswerId="25208" CreationDate="2016-04-03T05:50:33.877" Score="3" ViewCount="6019" Body="&lt;p&gt;Let $u=1.3$ $d=0.9$ $r=.05$ $S(0)=50, X = \text{strike} = 60$. Assume binomial model&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why &lt;strong&gt;isn't&lt;/strong&gt; the risk neutral probability found by solving the following for $p$: $$E[S(T)]=p65+(1-p)45=S(0)(1+r)^T=60(1.05)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because risk neutral probabilities should be the same in all time steps, I just took $T=1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The correct $p=0.375$&lt;/p&gt;&#xA;" OwnerUserId="17063" LastActivityDate="2016-04-03T12:11:27.550" Title="Option pricing: Risk neutral probability calculation" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;risk-neutral-measure&gt;&lt;binomial-tree&gt;&lt;european-options&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25206" PostTypeId="1" CreationDate="2016-04-03T08:56:15.557" Score="3" ViewCount="332" Body="&lt;p&gt;I want to analyze IV skew under various market conditions but its hard given various expirations. Would it make sense to create a constant maturity IV that say is 60 DTE? Has anyone done this and what are the limitations and things I should look out for? Additionally how do others calculate and compute it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the way I am doing it is really to takes the left and right most closest to expiration. So if I want 60 DTE and the market has only 30DTE and 90 DTE traded options I compute those two IV curves and average them giving them 0.5 weight each. The weight changes as I progress closer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;" OwnerUserId="2318" LastActivityDate="2016-04-04T19:04:42.107" Title="Constant Maturity IV" Tags="&lt;options&gt;&lt;implied-volatility&gt;" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25207" PostTypeId="1" CreationDate="2016-04-03T09:15:38.067" Score="5" ViewCount="273" Body="&lt;p&gt;I could need some advice on extensions of the CIR model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The standard CIR reads &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dr(t)=\kappa(\theta-r(t))dt + \sigma \sqrt{r(t)} dW(t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A possible extension, if we would like the short-rate to also include negative values, could be a displaced version, so that $r(t)+\alpha$, where $\alpha&amp;gt;0$, follows a CIR model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Further, to fit the initial term structure one could also consider the CIR++ (can be seen in Brigo et al) which is that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r(t)=x(t)+\phi(t)$, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $x$ is CIR and $\phi(t)$ is deterministic and chosen to fit the initial term structure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is if it would make sense to consider a displaced CIR++, that is that  $r(t)+\alpha=x(t)+\phi(t)$. My immediate thought is that the $\alpha$ does not provide any additional value for the model, and that the $\phi$-function already makes it possible for the short-rate to be negative? &lt;/p&gt;&#xA;" OwnerUserId="19761" LastActivityDate="2016-04-12T10:02:58.477" Title="Extensions of CIR" Tags="&lt;short-rate&gt;&lt;modelling&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25208" PostTypeId="2" ParentId="25205" CreationDate="2016-04-03T09:32:47.473" Score="2" Body="&lt;p&gt;&lt;strong&gt;[Short Answer]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You write $E [S_T]=S_0(1+r)^T $ but you actually compute the RHS as $X (1+r)^T$ in your numerical application.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Long Answer]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;em&gt;stock price is a martingale in an equivalent measure using the risk-free asset as numeraire&lt;/em&gt; i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ E [S(T)] = (S_0 u) q + (S_0 d) (1-q) = S_0 (1 + r ) \Delta t $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In that case, dividing each member by $S_0$ and re-arranging the terms yields&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ q ( u - d ) + d = (1 + r ) \Delta t  &#xA;$$&#xA;$$ q = \frac {(1 + r ) \Delta t  - d}{u - d} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Doing the computations with your input data (assuming a tree period covers $\Delta t=1$)&#xA;$$ q = \frac {(1+0.05)  - 0.9}{1.3-0.9} = 0.375 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this expression for $q $ is exactly the one given in any textbook provided $u $ (resp. $d $) figures the upward (resp. downward)  growth rate of the stock over a binomial tree period $\Delta t $, while $1 + r $ represents the growth rate of the risk free asset. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that sometimes continuous compounding is used, in which case:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ q = \frac {e^{r \Delta t} - d}{u - d} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Depending on the compounding convention you could also have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ q = \frac {(1 + r)^{ \Delta t} - d}{u - d} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;of course.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-04-03T12:11:27.550" LastActivityDate="2016-04-03T12:11:27.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25209" PostTypeId="1" CreationDate="2016-04-03T11:10:57.933" Score="1" ViewCount="41" Body="&lt;p&gt;Although my question is a general question, I would appreciate your suggestions or help me to find a proper &quot;stack exchange&quot; in order to ask my question: &#xA;I am a Ph.D student in (Pure)Mathematics and for future I intend to find a job in Economic or finance sector,i.e, Insurance companies or other related sectors. I want to know which skills like programming and software and theoretical knowledge should I have?&#xA;Is it possible to deepen my skills during my research activity in math on one side and finance on the other side ? &#xA;Indeed , in my opinion learning some skills are not as perfect as when we are at the real situation, so I suppose my attempts might be useless in advance?&#xA;I would be grateful if you could give me a method as a start point for my plans.&lt;/p&gt;&#xA;" OwnerUserId="11652" LastActivityDate="2016-04-03T11:10:57.933" Title="How to enter to economics/finance sector" Tags="&lt;programming&gt;&lt;econometrics&gt;&lt;quantitative&gt;" AnswerCount="0" CommentCount="1" ClosedDate="2016-04-03T12:31:25.067" ContentLicense="CC BY-SA 3.0" />
  <row Id="25210" PostTypeId="1" CreationDate="2016-04-03T11:12:04.067" Score="1" ViewCount="74" Body="&lt;p&gt;An economy contains these three assets:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Asset A has standard deviation of returns (per annum) of 25% and market capitalisation $600m&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Asset B has standard deviation of 20%, market capitalisation $300m&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Asset C has standard deviation of 10%, maket capitalisation $100m&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The correlation coefficient for the returns on each pair of distinct securities is 0.25. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The risk-free rate of return is 3.3% per annum and the expected return on the market is 8.38% per annum. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The assumptions underlying CAPM are valid and all investors will hold their portfolios for the next year.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I calculate the expected annual returns for each asset?&lt;/p&gt;&#xA;" OwnerUserId="20144" LastActivityDate="2016-04-03T11:12:04.067" Title="Calculating expected annual returns" Tags="&lt;asset-pricing&gt;&lt;expected-return&gt;" AnswerCount="0" CommentCount="1" ClosedDate="2016-04-29T11:47:56.057" ContentLicense="CC BY-SA 3.0" />
  <row Id="25211" PostTypeId="2" ParentId="25190" CreationDate="2016-04-03T11:56:59.060" Score="4" Body="&lt;p&gt;Let &#xA;$$q (S) := \frac{d\mathbb {Q}(S_T \leq S)}{dS} $$&#xA;denote the probability density function of the stock price at time $T&amp;gt;0$ under the risk-neutral measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By definition, the price of a European call then writes&#xA;\begin{align}&#xA; C (K,T) &amp;amp;= P (0,T) E_0^{\mathbb {Q}}[(S_T-K)^+] \\&#xA; &amp;amp;= P (0,T) \int_K^\infty (S - K) q (S) dS &#xA;\end{align}&#xA;with $P (0,T)$ the relevant discount factor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Compute the second derivative of the last equality with respect to $K $ to obtain what is known as the &lt;em&gt;Breeden-Litzenberger identity&lt;/em&gt;, $\forall T&amp;gt;0$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$q (S_T=K) = \frac {1}{P (0,T)}  \frac {\partial^2 C }{\partial K^2} (K,T) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which answers your two first questions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To further express the pdf as a function of the implied volatility smile, just use the fact that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ C(K,T) = BS (P (0,T), F (0,T), \sigma^*(K,T), K, T) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $BS (.) $ represents the Black-Scholes analytical formula,&#xA;then work out the expression of the second derivative $\frac {\partial^2 C }{\partial K^2} (K,T)$ as a function of  $\sigma^*(T,K)$ using standard calculus (chain rule).   &lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-04-04T19:36:45.120" LastActivityDate="2016-04-04T19:36:45.120" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25212" PostTypeId="1" CreationDate="2016-04-03T12:46:52.633" Score="2" ViewCount="751" Body="&lt;p&gt;I want to test my time series for cointegration using the Johansen test in R.&#xA;I got the following result and so I know now that at least 5 out of 9 of my time series are cointegrated. My question is, how to understand which one of them are cointegrated and which one aren't.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it's not possible to answer my question within this particular test, maybe the ADF test (or any other test) will help me with this problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My primary goal was to build up a VAR for this time series. So my next question will be if it's appropriate to use the VECM for these series in order to reach my goal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll appriciate any help and/or advice!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anna.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/vMuR8.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/vMuR8.png&quot; alt=&quot;Test results&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20147" LastActivityDate="2016-04-03T12:46:52.633" Title="Johansen cointegration test interpretation in R" Tags="&lt;time-series&gt;&lt;r&gt;&lt;cointegration&gt;&lt;testing&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25213" PostTypeId="1" CreationDate="2016-04-03T14:23:26.950" Score="2" ViewCount="356" Body="&lt;p&gt;I have been looking for free or paid json data feeds on currencies for long.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have come across:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;currencylayer.com&lt;/li&gt;&#xA;&lt;li&gt;Oanda&lt;/li&gt;&#xA;&lt;li&gt;XE&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The problem is that I really need millisecond based updates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone advice me on the way forward?&lt;/p&gt;&#xA;" OwnerUserId="20149" LastActivityDate="2021-05-10T23:36:02.707" Title="Where can I get json currency data feeds every millisecond?" Tags="&lt;fx&gt;&lt;pairs-trading&gt;&lt;currency&gt;" AnswerCount="5" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25214" PostTypeId="1" AcceptedAnswerId="25215" CreationDate="2016-04-03T14:52:32.137" Score="1" ViewCount="168" Body="&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/LyPvo.png&quot; alt=&quot;Sharpe image&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have begun by using such equations as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/hYxPy.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By finding the $Rp$ and $\sigma p$ with the weighted values, and then I followed the equation using a value of $.02$ for the fixed asset, $rf$, but this comes up with a value that is not correct. The answer apparently is $0.5813$, but I cannot get to this value. My values are in the $0.300$ range.&lt;/p&gt;&#xA;" OwnerUserId="20152" LastActivityDate="2016-04-03T15:44:03.617" Title="Having Difficulty With Sharpe Ratio and Optimal Portfolio" Tags="&lt;portfolio-management&gt;&lt;sharpe-ratio&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25215" PostTypeId="2" ParentId="25214" CreationDate="2016-04-03T15:44:03.617" Score="1" Body="&lt;p&gt;The 0.5813 is correct. I won't post the formulas here given it is to basic. &#xA;I am attaching picture with all the numbers you need. &#xA;If you have a question on how any of those numbers is computed just ask, but should be very straightforward. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/siqV0.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/siqV0.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2016-04-03T15:44:03.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25216" PostTypeId="1" AcceptedAnswerId="25217" CreationDate="2016-04-03T17:42:43.183" Score="1" ViewCount="736" Body="&lt;p&gt;I am calcualting the parametric VaR of a portfolio that includes among other things an IRS swap that begins in the exact same day the valuation is done. Therefore, its NPV is 0 and I do not which weight to assign to it in order to calculate the aggregated VaR of the portfolio. I have calculated every other asset's weight as the total value of the position relative to the total value of the portfolio, however since the NPV of the Swap is exactly 0, I cannot apply this approach. I have tried, and I think is the correct way, using the DV01 of the swap to calculate something as its total exposure, but everything I have tried gives results that are completely unreasonable. Could anybody give me some idea on how to weight this swap in the portfolio?&lt;/p&gt;&#xA;" OwnerUserId="19128" LastEditorUserId="3371" LastEditDate="2016-04-05T12:39:56.147" LastActivityDate="2016-07-06T14:10:10.320" Title="Parametric VaR of a portfolio including a swap" Tags="&lt;var&gt;&lt;value-at-risk&gt;&lt;interest-rate-swap&gt;&lt;irs&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25217" PostTypeId="2" ParentId="25216" CreationDate="2016-04-03T18:16:47.730" Score="0" Body="&lt;p&gt;Treat it like a fixed rate bond with the same maturity date.  The principal amount of the fixed rate bond is equivalent to the notional of the swap.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-04-03T18:16:47.730" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25218" PostTypeId="1" AcceptedAnswerId="25266" CreationDate="2016-04-03T19:48:08.413" Score="2" ViewCount="1286" Body="&lt;p&gt;Consider a European option with payoff $$g(S_T) = S_T^{-5}e^{10S_T}$$ Assume that the interest rate is $r = .1$ and the underlying asset satisfies $S_0 = 2, \sigma = .2$, an pays dividend at continuous rate equal to $q(t,S_t) = qS_t$ and $q = .2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a.) Write the Black-Scholes equation for this problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b.) Solve the problem analytically by the method of separation of variables. Plug into the equation a solution candidate of the form $e^{a\tau}S^{-5}e^{10S}$ and determine $a$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Attempted solution for a.) The Black-Scholes model with dividend is given by the SDE $$dS_t = S_t(r - q(t,S_t))dt + \sigma S_t dB_t$$ and the Black-Scholes equation is given by $$\begin{cases} \partial_\tau V(\tau,S) &amp;amp;= \frac{\sigma^2 S^2}{2}\partial_{SS} V(\tau,S) + (r - q(t,S))S \partial_S V(\tau,S) - rV(\tau,S)\\&#xA;V(\tau,0) &amp;amp;= e^{-r\tau}g(0)\\&#xA;V(0,S) &amp;amp;= g(S)&#xA;\end{cases}$$&#xA;thus with the parameters above we have $$\begin{cases} \partial_{\tau}V(\tau,S) &amp;amp;= \frac{(.2)^2(2)^2}{2}\partial_{S S}V(\tau,S) + (.1 - 2(.2))2V(\tau,S) - .1V(\tau,S)\\&#xA;V(\tau,0) &amp;amp;= e^{-.1\tau}g(0) = 0\\&#xA;V(0,S) &amp;amp;= g(2) = 2^{-5}e^{20}&#xA;\end{cases}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A tad confused about b.). Any suggestions would be greatly appreciated. Also, if anyone can check part a.) solution that would be great. &lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="19002" LastEditDate="2016-04-06T23:42:26.490" LastActivityDate="2016-04-06T23:42:26.490" Title="Black-Scholes Equation with dividend" Tags="&lt;black-scholes&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="25219" PostTypeId="1" CreationDate="2016-04-03T20:50:57.787" Score="8" ViewCount="4452" Body="&lt;p&gt;In response to this question:  &lt;a href=&quot;https://quant.stackexchange.com/questions/7820/how-to-simulate-correlated-geometric-brownian-motion-for-n-assets&quot;&gt;How to simulate correlated Geometric brownian motion for n assets?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the responses provides an implementation in MATLAB: &#xA;&lt;a href=&quot;http://www.goddardconsulting.ca/matlab-monte-carlo-assetpaths-corr.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.goddardconsulting.ca/matlab-monte-carlo-assetpaths-corr.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I attempted to port this code into the R programming language. The implementation is: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Input Params:&#xA;S0 &amp;lt;- c(50, 48)&#xA;mu &amp;lt;- c(0.03, 0.03)&#xA;sig &amp;lt;- c(0.05, 0.05)&#xA;corr &amp;lt;- cbind(c(1,0.1), c(0.1,1))&#xA;dt &amp;lt;- 1/365&#xA;steps &amp;lt;- 10000&#xA;nsims &amp;lt;- 100&#xA;&#xA;# Get the number of assets:&#xA;nAssets &amp;lt;- length(S0)&#xA;&#xA;# Calculate the drift:&#xA;nu &amp;lt;- mu - sig * sig/2&#xA;&#xA;# Do a Cholesky Factorization on the correlation matrix:&#xA;R &amp;lt;- chol(corr)&#xA;&#xA;# pre allocate the output:&#xA;&#xA;S &amp;lt;- array(1, dim=c(steps+1, nsims, nAssets))&#xA;&#xA;# Generate correlated random sequences and paths:&#xA;&#xA;for(idx in 1:nsims)&#xA;{&#xA;  # generate uncorrelated random sequence &#xA;  x &amp;lt;- matrix(rnorm(steps * nAssets), ncol = nAssets, nrow = steps)&#xA;&#xA;  # correlate the sequences &#xA;  ep &amp;lt;- x %*% R&#xA;&#xA;  #generate potential paths &#xA;&#xA;  S[,idx,] &amp;lt;- rbind(rep(1,nAssets), apply(exp(matrix(nu*dt,nrow=steps,ncol=2,byrow=TRUE) + (ep %*% diag(sig)*sqrt(dt))), 2, function(x) cumprod(x)) ) %*% diag(S0)&#xA;}&#xA;&#xA;# TESTING: Compute Average Sample Correlation &#xA;sum = 0&#xA;for(i in 1:nsims) &#xA;{&#xA;  sum = sum + cor(S[,i,1], S[,i,2])&#xA;}&#xA;sampleCorrelation = sum / nsims &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To test if the implementation works as promised, I compute the average sample correlation between two assets across many simulations. By the law of large numbers, the sample correlation should be pretty close to the theoretical correlation matrix provided as an input parameter. In the example provided, the sample correlation between the two assets should be pretty close to 0.1 on average. However, this is not the case. So there must be an issue in the R code provided. I also tested the MATLAB code on a free online MATLAB simulator (&lt;a href=&quot;http://octave-online.net/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://octave-online.net/&lt;/a&gt;): it gave the correct result for the average sample correlation between the assets. Hence, there must be a porting issue, which I can't seem to determine. Can you identify the issue?&lt;/p&gt;&#xA;" OwnerUserId="20156" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2017-05-03T21:02:01.530" Title="Simulate correlated Geometric Brownian Motion in the R programming language" Tags="&lt;r&gt;&lt;monte-carlo&gt;&lt;brownian-motion&gt;&lt;simulations&gt;&lt;matlab&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25220" PostTypeId="2" ParentId="25206" CreationDate="2016-04-03T22:59:50.260" Score="1" Body="&lt;p&gt;You use a form of interpolation(start with linear) between the 30 day to maturity IV and the 90 to get the 60,&lt;/p&gt;&#xA;" OwnerUserId="1764" LastActivityDate="2016-04-03T22:59:50.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25221" PostTypeId="1" AcceptedAnswerId="25235" CreationDate="2016-04-04T01:04:26.903" Score="2" ViewCount="457" Body="&lt;p&gt;I am back testing a strategy in R and I have some questions about testing design. I have a universe of around 500 stocks to test filtered based on liquidity. To test the trading strategy I have implemented a simple in-sample/out-of-sample testing scheme. Before running a full test on the whole universe of stocks I have been running the tests over a random sample of the stocks while designing a generic testing framework. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been dividing the universe into two parts, I have been optimizing over a random sample of different stocks then using the optimized parameters from the training set to test over a random selection of different stocks from the test set. Are there any problems with doing this rather than testing over the total universe?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My other question is to do with using prices vs returns (vs log returns). I am a little confused as to the reasoning to use returns rather than price to find signals. Would you use returns series because you are more able to compare returns series more easily then price series?&lt;/p&gt;&#xA;" OwnerUserId="18382" LastActivityDate="2016-04-04T18:59:57.883" Title="Backtesting Strategies - Sampling and returns types" Tags="&lt;backtesting&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25222" PostTypeId="2" ParentId="25173" CreationDate="2016-04-04T02:58:55.710" Score="0" Body="&lt;p&gt;your 1st question. The GFC did not happen because Lehman was not rescued. Lehman failed because of the GFC. A financial crisis happens because some kind of mismatch accumulates or resp. economic misallocation happens (too much bubble growth).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;your 2nd question. keywords: rating shopping, regulatory arbitrage. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;i am going list some points that might be helpful:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Basel 1 to Basel 2 change. Banks started to calculate  their regulatory capital depending on value at risk models. This triggered a race to the bottom, or resp. regulatory arbitrage, or resp. legal window dressing. (the same happens now with Solvency 2 for european insurance firms)&lt;/li&gt;&#xA;&lt;li&gt;Supervisory models used, and are still using, ratings as input parameters. This is the core of CRAs' business model  - it is the reason for the CRA industry total sales. (there are few new supervisory models without ratings but that are exceptions) &lt;/li&gt;&#xA;&lt;li&gt;Ratings are positive biased because there is selection.  Also called rating shopping. The debt issuer is the customer of a CRA. If a CRA grants a weak rating, the customer simply pulls off, and walks to another CRA. (the big CRAs are judging a little bit more conservative these days but the business model is still the same)&lt;/li&gt;&#xA;&lt;li&gt;Central Bank policies. Before the GFC central bank belived they could control and countermeasure everything by interest rate policies. They simply did not monitored the whole money creation process which is mainly executed by the broader financial sector. You cannot worry about stuff you do not know (it is really funny because the big central banks are still in the process to establish data collection processes regarding debt issuance)&lt;/li&gt;&#xA;&lt;li&gt;Politics. do not forget that the U.S. spend a lot of fiscal (and human) ressources on two wars during the 2000s (and their NATO partners did the same on a smaller scale). Good economic growth, increasing living standards, more ownership, more ... distraction ... makes a population happy. Agency ABS are government programs that were heavily pushed by the Bush government to create a lot happiness.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerDisplayName="user20159" LastEditorDisplayName="user20159" LastEditDate="2016-04-04T03:04:17.410" LastActivityDate="2016-04-04T03:04:17.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25223" PostTypeId="1" CreationDate="2016-04-04T04:11:42.407" Score="1" ViewCount="191" Body="&lt;p&gt;I am trying to solve a question in finance but I am pretty much stuck and would need your help :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose you know the following information about a market:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Future is at 66&#xA;70 strike straddle is trading at 27&#xA;50-60 put spread is at 2.5&#xA;50-60-70 put fly is at .2&#xA;Assume volatility is constant across strikes&#xA;Using the prices given and relationships between options of various strikes, what are the fair values for the 80 Call, 60 Straddle, and 40 Put? Assume we had a volatility smile among the curve, how would this make your markets different?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I started by the following equations: C(70) - P(70) = 66 C(70) + P(70) = 27 P(50) - P(60) = 2.5 P(50) - 2P(60) + P(70) = 0.2&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="20160" LastActivityDate="2016-04-05T05:41:59.987" Title="Relations between Call and Put" Tags="&lt;options&gt;&lt;derivatives&gt;&lt;option-strategies&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25224" PostTypeId="1" AcceptedAnswerId="25307" CreationDate="2016-04-04T05:07:20.997" Score="10" ViewCount="614" Body="&lt;p&gt;I'm trying to start working on a fully automated algorithmic trading system, and I'm a little struggling with the framework to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The requirements I have in my mind are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Needs to support back-testing.&lt;/li&gt;&#xA;&lt;li&gt;Needs to be able to do paper/live trading with Interactive Brokers, without rewriting the code with their API.&lt;/li&gt;&#xA;&lt;li&gt;Needs to support most security types, like stock, option, future, Forex, etc.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For 1 and 2 I know there's quantopian. For 2 and 3 I know there are frameworks like pyalgotrade. But I can't find anything that support all the three.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there is one solution can you give me some recommendations? Or if there's no such thing exists, can you tell me how you handle these problems, with minimum efforts?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot!&lt;/p&gt;&#xA;" OwnerUserId="20161" LastActivityDate="2016-06-20T23:36:41.907" Title="Are there any integrated framework that I can back-test and paper/live trading in one place?" Tags="&lt;programming&gt;&lt;automated-trading&gt;&lt;python&gt;&lt;trading-systems&gt;&lt;interactive-brokers&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25225" PostTypeId="1" CreationDate="2016-04-04T05:53:28.403" Score="2" ViewCount="1808" Body="&lt;p&gt;I am new to this forum. I work in the Market Risk Domain at a leading Investment Bank. I am currently learning Python. And the best way to learn is to experiment with some Real Live Analysis/Project(My way of learning).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will be really grateful if someone can give me some ideas on what kind of Quantitative Finance project I can try out on Python.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was thinking more in the lines of some automated trading algo to start of with. Something that I can do with publicly available data. Suggestions are very much welcome. Don't want to start with something very complicated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you so much in advance.&lt;/p&gt;&#xA;" OwnerUserId="20162" LastEditorUserId="20162" LastEditDate="2016-04-04T19:23:22.203" LastActivityDate="2016-04-04T19:23:22.203" Title="Finance Projects in Python" Tags="&lt;quant-trading-strategies&gt;&lt;trading&gt;&lt;automated-trading&gt;&lt;python&gt;&lt;quantitative&gt;" AnswerCount="0" CommentCount="6" ClosedDate="2016-04-04T10:27:21.723" ContentLicense="CC BY-SA 3.0" />
  <row Id="25226" PostTypeId="2" ParentId="25206" CreationDate="2016-04-04T08:06:26.370" Score="1" Body="&lt;p&gt;You could check at the methodology for &lt;a href=&quot;https://www.cboe.com/micro/vix/vixwhite.pdf&quot; rel=&quot;nofollow&quot;&gt;VIX&lt;/a&gt;.&lt;br&gt;&#xA;The VIX itself yields one number - but you might instead return a set of numbers for your skew analysis.&lt;/p&gt;&#xA;" OwnerUserId="1221" LastActivityDate="2016-04-04T08:06:26.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25228" PostTypeId="2" ParentId="16818" CreationDate="2016-04-04T12:46:16.547" Score="3" Body="&lt;p&gt;This is a standard combined optimal stopping and optimal stochastic control problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are looking for a control $u=(\theta,c)$ and stopping time $\tau$ which maximize the pefrormance functional of the form:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$J^{(u,\tau)}(w):=\mathbb{E}^{w} \bigg[ \int_0^{\tau} e^{- \rho t} u (c_t) dt + e^{-\rho \tau} F(w_{\tau})\chi_{\{\tau&amp;lt;+\infty\}}\bigg]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will not write down the whole theory (HJB verification theorem is rather long) but everything what you need you can find in this book (in even more general form, I mean when dynamics of $w_{t}$ includes jumps. For your problem just ignore the jumps in the below book.):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Authors: Bernt Oksendal, Agnes Sulem&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Title: Applied Stochastic Control of Jump Diffusions&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Chapter: 4. Combined Optimal Stopping and Stochastic Control of Jump Diffusions&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Page: 65&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second Edition&lt;/p&gt;&#xA;" OwnerUserId="19494" LastActivityDate="2016-04-04T12:46:16.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25229" PostTypeId="2" ParentId="25223" CreationDate="2016-04-04T14:13:28.950" Score="1" Body="&lt;p&gt;You haven't written down your equations correctly.  Ignoring discounting, the equations should be:&#xA;C(70)-P(70)= -4 (not 66), from put-call parity.  Also, &#xA;C(70) + P(70)= 27;&lt;br&gt;&#xA;from these two we get C(70)= 11.5 and P(70)=15.5&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also P(60)-P(50)= 2.5 and P(70)-2P(60)+P(50)=0.2&#xA;from which&#xA;P(70)-P(60)=2.7, hence P(60)=12.8 and P(50)=10.3&#xA;so now we know all the option prices for 50, 60, and 70 strikes&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So C(60)-P(60)= 6 from put-call parity, giving C(60) = 18.8, and therefore straddle (60)= 31.6&lt;/p&gt;&#xA;&#xA;&lt;p&gt;we cannot exactly know where the 80 call and 40 put are, without making a distributional assumption.  all we can sa.y is that C(80)&amp;lt;=C(70)= 11.5 and P(40)&amp;lt;=P(50)=10.3&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-04-04T14:13:28.950" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25230" PostTypeId="2" ParentId="25196" CreationDate="2016-04-04T14:41:15.700" Score="4" Body="&lt;p&gt;The idea is to make both sides of the market in some size eg 2000.01-2000.02, 100x100.  If you get lifted you continue to work the bid side for some period of time and then if you don't get hit, you give up and lift the offer.  As long as you get filled on both sides some of the time, you make a small amount of money.  The problem comes when you get lifted and the market becomes 2000.02-2000.03.  Then you are short at 2000.02 and are underwater.  The fact is, this happens more often than not nowadays, due to the increased participation of algorithms.  Hand-scalping is not very easy nowadays.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-04-04T14:41:15.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25231" PostTypeId="1" CreationDate="2016-04-04T15:21:04.710" Score="5" ViewCount="13994" Body="&lt;p&gt;I'm new to Bloomberg terminals (a paper I'm reading uses data from a terminal - my first exposure) and I'm having trouble figuring out how to download a few different time series: (1) daily closing exchange rates for a set of currency pairs for both London and New York, and (2) daily closing government yield data, again for both London and New York.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The paper I'm reading refers to &quot;bloomberg dataseries&quot; in the following formats (using Australia as an example):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Exchange rates:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;AUD/USD for London close: &quot;AUDUSD CMPL Curncy&quot;.&lt;/li&gt;&#xA;&lt;li&gt;AUD/USD for New York close: &quot;AUDUSD CMPN Curncy&quot;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Government yields:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;AUD for London close: &quot;ADSW2 CMPL Curncy&quot;.&lt;/li&gt;&#xA;&lt;li&gt;AUD for London close: &quot;ADSW2 CMPN Curncy&quot;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I know that CMPL and CMPN refers to the pricing source (Composite London, and Composite New York, respectively). However, I'm having trouble finding any reference as to how to download these particular data series, using the Bloomberg Excel add-on or otherwise. Any help would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="5272" LastActivityDate="2019-04-01T20:32:34.733" Title="Bloomberg Currency Exchange Rate Data (London and New York)" Tags="&lt;bloomberg&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25232" PostTypeId="1" CreationDate="2016-04-04T15:55:58.733" Score="2" ViewCount="433" Body="&lt;p&gt;I read the paper &quot;Monte Carlo pricing with local volatility grids&quot; (authors: D.F. Abasto, B. Hientzsch and M.P. Kust) and I would like to know if anyone on this forum had a chance to implement it as I have practical questions related its concrete implementation. Could you please explain me what difference exists between the original paper from Andreasen-Huge and this paper? And what would be the impact in terms of implementation (optimization approach)? Many thanks.&lt;/p&gt;&#xA;" OwnerUserId="20168" LastEditorUserId="20168" LastEditDate="2016-04-05T10:34:47.803" LastActivityDate="2016-04-05T10:34:47.803" Title="Local volatility grids - Monte carlo - Implementation" Tags="&lt;monte-carlo&gt;&lt;local-volatility&gt;" AnswerCount="0" CommentCount="1" ClosedDate="2016-04-04T20:59:36.530" ContentLicense="CC BY-SA 3.0" />
  <row Id="25233" PostTypeId="2" ParentId="19321" CreationDate="2016-04-04T16:01:39.460" Score="1" Body="&lt;p&gt;Just ran into and solved this problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Convert the timeSeries object into an xts object then change the indexClass to &quot;Date&quot;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# returns is a timeSeries object&#xA;r &amp;lt;- as.xts(returns)&#xA;indexClass(r) &amp;lt;- &quot;Date&quot;&#xA;a &amp;lt;- Return.portfolio(r, rebalance_on=&quot;quarters&quot;, verbose=TRUE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm not an R expert or anything so I don't know if changing the indexClass has any other ramifications, but this allows me Return.portfolio to work.&lt;/p&gt;&#xA;" OwnerUserId="20169" LastActivityDate="2016-04-04T16:01:39.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25234" PostTypeId="1" AcceptedAnswerId="25249" CreationDate="2016-04-04T17:34:52.617" Score="1" ViewCount="919" Body="&lt;p&gt;I'm new to FIX api,so far i did following (on QUICKFIX)&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ol&gt;&#xA;  &lt;li&gt;logged on to quote-session&lt;/li&gt;&#xA;  &lt;li&gt;subscribed to market data&lt;/li&gt;&#xA;  &lt;li&gt;sent &quot;single-message&quot; quote-request for an instrument (EUR/USD for example)&lt;/li&gt;&#xA;  &lt;li&gt;Finally i got response from fix-server (with current bid/ask/volume for symbol EUR/USD)&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The problem is, it was a single response. I want to get nonstop ,real-time quote-feed on a blotter/panel(as can be seen in a trading-platform's 'quote-panel').&lt;/p&gt;&#xA;" OwnerUserId="20171" LastEditorUserId="16351" LastEditDate="2016-04-05T09:17:04.970" LastActivityDate="2016-04-05T18:42:22.290" Title="Getting quote stream via fix-api 4.3" Tags="&lt;programming&gt;&lt;market-data&gt;&lt;fx&gt;&lt;fix&gt;&lt;quickfix&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25235" PostTypeId="2" ParentId="25221" CreationDate="2016-04-04T18:59:57.883" Score="0" Body="&lt;p&gt;I think the random sampling has some definite advantages. First and foremost, it reduces the risk that you will be &quot;overfitting&quot; by optimizing your strategy's parameters to a certain sample of assets. Second, with such a large asset universe, it would obviously take tons of time and computational resources to test a strategy over historical data of any meaningful length, so you kind of avoid &quot;punishing&quot; yourself for using a long historical timeframe to test on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That being said, if your end aim is to live trade the strategy on the those 500 assets specifically, maybe you lose something by only optimizing over a random sample of those assets. There's some critical thinking involved here as to how big the random sample should be, how large the parameter space, and so on. So at least part of the answer will depend on your end objectives.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for using prices vs. signals, IMHO using returns can be &lt;em&gt;really&lt;/em&gt; dangerous. Why? When you trade, transactions are done at a given price, not a given return (at least as far as the accounting is concerned). The other thing worth keeping in mind is that a return is dependent on:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;(a)&lt;/strong&gt; What kind of return (simple, geometric, log, etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;(b)&lt;/strong&gt; When the calculation starts (1-year return, 1-day return, etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unless the strategy is contingent upon the calculation of returns, I would prefer the use of price data instead. (Since computational efficiency appears to be of concern to you given your large dataset, this also has the added advantage of requiring marginally fewer computations since you don't have to calculate returns in order to get your signals.)&lt;/p&gt;&#xA;" OwnerUserId="7385" LastActivityDate="2016-04-04T18:59:57.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25236" PostTypeId="2" ParentId="25206" CreationDate="2016-04-04T19:04:42.107" Score="1" Body="&lt;p&gt;What you are trying to do is fit a volatility surface for a given underlying. Once you have a volatility surface you can price an option for an arbitrary expiration and strike. There are numerous approaches to do this and the linear interpolation methods mentioned in the other examples are okay but be careful in the following situations where there is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a steep or curved forward curve&lt;/li&gt;&#xA;&lt;li&gt;you are pricing out of money options&lt;/li&gt;&#xA;&lt;li&gt;interpolating short term options or highly seasonal options since the surface can be complicated. &lt;/li&gt;&#xA;&lt;li&gt;finally watch that the implied forward Vols make sense (above 0 &amp;amp; have reasonable values). This is not guaranteed to be true with simple interpolation methods.  &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As an aside: Please do not trade options if you don't understand forward volatility&lt;/p&gt;&#xA;" OwnerUserId="15338" LastActivityDate="2016-04-04T19:04:42.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25237" PostTypeId="1" AcceptedAnswerId="25239" CreationDate="2016-04-04T20:57:03.897" Score="3" ViewCount="92" Body="&lt;p&gt;When looking at historical data (index or stock), one can find all 1-day differences/movements, all 2-day, all 3-day etc and graph the extremes of each of these. This gives two line graphs forming a channel/fan showing the historically maximum price fluctuations for being in this stock for 1 day, 2 days etc. It is quite an instructive graph showing how risk tends to narrow over time. See example where MSCI World (15 years of monthly closes) are used to show the historical extreme outliers (blue) and also the 90% band (green - which one might think of as a historical confidence interval of sorts). The two lines are just 2% and 7% interest rates for comparison. I thought of this myself, but I have surely not found something new. So what is this graph or method called, where can I read more about it and how can I approach quantifying what it shows?&#xA;&lt;img src=&quot;https://gundersen.net/wp-content/uploads/2016/04/hist_proj.png&quot; alt=&quot;example&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="20173" LastEditorUserId="20173" LastEditDate="2016-04-05T15:49:45.697" LastActivityDate="2016-04-06T17:50:46.783" Title="What is the name of all 1-day movements, 2-day movements etc" Tags="&lt;market-data&gt;&lt;brownian-motion&gt;&lt;charts&gt;&lt;historical&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25238" PostTypeId="2" ParentId="25213" CreationDate="2016-04-04T22:46:21.833" Score="1" Body="&lt;p&gt;You could try &lt;a href=&quot;http://www.truefx.com/&quot; rel=&quot;nofollow&quot;&gt;True FX&lt;/a&gt; or open an account with &lt;a href=&quot;https://www.interactivebrokers.co.uk/en/home.php&quot; rel=&quot;nofollow&quot;&gt;Interactive Brokers&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2016-04-04T22:46:21.833" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25239" PostTypeId="2" ParentId="25237" CreationDate="2016-04-04T23:06:14.253" Score="2" Body="&lt;p&gt;Sounds a little bit similar to variance ratio - the seminal paper of which was &lt;a href=&quot;http://rfs.oxfordjournals.org/content/1/1/41.abstract&quot; rel=&quot;nofollow noreferrer&quot;&gt;Lo, MacKinlay 1988&lt;/a&gt;, however that deals with variance, not differences of extrema.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That you find &quot;risk&quot; narrows over time is odd, given that $Var[x + y] = Var[x] + Var[y]$ for independent variables $x \&amp;amp; y$, and one could look at days as being independent, and similarly distributed (not identical as mean and variance can change) for typical stock time series (at least that is the random walk hypothesis). However, if you were, for example, dealing with a time series that exhibited mean reversion or auto-correlation, this could affect it slightly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think it might also depend on your methodology - am not entirely sure what &quot;graph the extremes of each of these&quot; means. It seems to me that the min and max should be typically moving apart from each other, if slowly. If dividing the differences by the number of days, then yes it will surely converge, as the probability of having found a (relatively random) series with n positive (or negative) days as large (or small) as the max (or min) move becomes negligible quite quickly. ;-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-- Edit --&#xA;It looks like returns - is it? (percentage or log?) I think perhaps you are graphing the min/max of the n-day returns distribution? If that's a correct assumption it seems fair to me to say it's the graph of the best or worst one could have done over each holding period, for the entire data set (the time axis of 2016-2031 is presumably an extrapolation of $1000 from now?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does it compare to what might have happened - or what was likely? Good question. On the basis of some (only 500) Monte Carlo simulations, presuming lognormal returns, similar drift to the stock, and constant volatility similar to the historical, I did this for AAPL over a 15 year period for 1-500 day returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mins &amp;amp; Maxes shows the min &amp;amp; max values that the monte-carlo sims took, Averages shows the average values that the monte-carlo took. One can see that AAPL was within the range of Monte-Carlo sim (min/max), but a little more dispersed than the 'average'. What conclusions can one draw? I think it's a reasonably simple way to show what was described above - the best or worst one would expect to do over a period? Beyond that I don't know. If it were significantly different from monte-carlo, one might wonder, but then it becomes a statistical question about the likelihood of it being within a certain range.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/C4VTR.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/C4VTR.png&quot; alt=&quot;Monte Carlo sim vs AAPL&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17303" LastEditorUserId="17303" LastEditDate="2016-04-06T17:50:46.783" LastActivityDate="2016-04-06T17:50:46.783" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25240" PostTypeId="1" CreationDate="2016-04-05T00:02:33.937" Score="1" ViewCount="113" Body="&lt;p&gt;Assume the path of a certain stock can be modeled using a binomial tree. The initial price of the stock at time $t=0$ is 1024. The upstage factor of the stock price is $x=1.25$ and downstage factor of the stock price is $y=0.8$. Assume that risk is simply compounded with $r=3\%$. Determine the price of the binary option that pays \$1 if the stock price after 50 steps is \$2500 and it never touches the barrier of \$3125. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the random path approach, please explain why the number of paths is ${50\choose24}-{50\choose28}$&lt;/p&gt;&#xA;" OwnerUserId="17063" LastActivityDate="2016-04-07T15:56:44.900" Title="Counting random paths" Tags="&lt;option-pricing&gt;&lt;binomial-tree&gt;&lt;random-walk&gt;&lt;binary-options&gt;&lt;barrier&gt;" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="25241" PostTypeId="1" AcceptedAnswerId="25253" CreationDate="2016-04-05T00:31:39.940" Score="1" ViewCount="319" Body="&lt;p&gt;Consider the payoff $g(S_T)$ shown in the figure below. Consider Black-Scholes model for the price of a risky asset with $T = 1$, $r = .04$, and $\sigma = .02$ and dividends are paid quarterly with dividend yield $10\%$. Take $S_0 = 10$, $K_1 = 9$, and $K_2 = 11$. Find the Black-Scholes price, $\Delta$, $\Gamma$, $\rho$, and $\mathcal{V}$ of this option at time $t = 0$. Find $\Theta$ at time $t = 0$ without taking derivatives with respect to $S$.&lt;a href=&quot;https://i.stack.imgur.com/cMTdn.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/cMTdn.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solution: The payoff is, $$g(S_t) = (S_t - K_1)_{+} - 2(S_t - \frac{(K_1 + K_2)}{2})_{+} + (S_t - K_2)_{+}$$&#xA;The Black-Scholes formula with dividend gives \begin{align*}&#xA;V(t = 0,S) &amp;amp;= e^{-r\tau}\hat{\mathbb{E}}[g(\tilde{d}S_T)]\\&#xA;&amp;amp;= \tilde{d}\left(BS_{call}(\frac{K_1}{\tilde{d}}) - 2BS_{call}(\frac{K_1+K_2}{2\tilde{d}}) + BS_{call}(\frac{K_2}{\tilde{d}})\right)&#xA;\end{align*}&#xA;where $$\tilde{d} = \left(1 - \frac{d}{4} \right)^{4} = .9037$$&#xA;So, $$V(t = 0,S) = e^{-r\tau}\hat{\mathbb{E}}[g(\tilde{d}S_T)] = (.9037)((0) - 2(0) + (0)) \approx 0 $$&#xA;For the Greeks we have $$\Delta = \partial_S V(t = 0,S) = \tilde{d}\left[\Phi(d_1(\frac{K_1}{\tilde{d}})) + \Phi(d_1(\frac{K_1+K_2}{2\tilde{d}})) + N(d_1(\frac{K_2}{\tilde{d}})) \right] \approx 0$$&#xA;$$\Gamma = \partial_{SS}V(t = 0, S) = 0$$&#xA;$$\rho = \partial_r V(t = 0,S) = \left( e^{-rt}(\frac{K_1}{\tilde{d}})(t)\Phi(d_2) + e^{-rt}(\frac{K_1+K_2}{2\tilde{d}})(t)\Phi(d_2) + e^{-rt}(\frac{K_2}{\tilde{d}})(t)\Phi(d_2)\right) \approx 0$$&#xA;$$\mathcal{V} = (S\sqrt{t}\Phi(d_1) + S\sqrt{t}\Phi(d_1) + S\sqrt{t}\Phi(d_1)) \approx 0$$&lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="19002" LastEditDate="2016-04-06T23:11:11.717" LastActivityDate="2016-04-06T23:11:11.717" Title="Pricing of Black-Scholes with dividend" Tags="&lt;black-scholes&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25242" PostTypeId="2" ParentId="25213" CreationDate="2016-04-05T01:01:36.593" Score="1" Body="&lt;p&gt;If you want millisecond updates, you need to use technologies other than json.&lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2016-04-05T01:01:36.593" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25243" PostTypeId="2" ParentId="25213" CreationDate="2016-04-05T03:34:05.793" Score="1" Body="&lt;p&gt;There are so called mid-rate reference price providers who eventually offer newsfeeds, however, the answer will very likely be a commercial service.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The otehr path would be to contact liquidity providers and / or exchanges directly and ask for API / feed access , which again , will most likely be a commercial service.&lt;/p&gt;&#xA;" OwnerUserId="15293" LastActivityDate="2016-04-05T03:34:05.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25244" PostTypeId="1" CreationDate="2016-04-05T03:45:18.387" Score="12" ViewCount="2566" Body="&lt;p&gt;If I trade an option using delta, vega, Prob OTM, etc. these are derived from a model. How do leading models impact valuations in terms of the Greeks?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suppose to form a baseline it would have to be relative to Black-Scholes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Binomial_options_pricing_model&quot;&gt;CRS Process&lt;/a&gt; Model, &lt;a href=&quot;https://en.wikipedia.org/wiki/Heston_model&quot;&gt;Heston&lt;/a&gt; Model, &lt;code&gt;[CGMY][1]&lt;/code&gt; Model. For example, does the Heston model generally depreciate the delta of a call option relative to what BSM would predict? Can any descriptions of the models be learned from these comparisons?&lt;/p&gt;&#xA;" OwnerUserId="20178" LastActivityDate="2017-04-27T14:14:12.950" Title="How do different models impact option Greeks?" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;greeks&gt;&lt;stochastic-volatility&gt;&lt;delta&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="25246" PostTypeId="2" ParentId="25244" CreationDate="2016-04-05T08:26:36.630" Score="17" Body="&lt;p&gt;This is an interesting and not so easy question. Here's my 2 cents:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;First, you should distinguish between &lt;strong&gt;mathematical models&lt;/strong&gt; for the dynamics of an underlying asset (Black-Scholes, Merton, Heston etc.) and &lt;strong&gt;numerical methods&lt;/strong&gt; designed to calculate financial instruments' prices under given modelling assumptions (lattices, Fourier inversion techniques etc.). Typically, the lattice technique you are referring to is a numerical method originally designed to compute prices under Black-Scholes modelling assumptions (of course variants exist). Sticking to the Black-Scholes world, you could also price instruments using totally different methods such as Monte Carlo or Finite Difference. Each numerical method has its own pros and cons in terms of Greeks production and within a single method, there can actually be many variants (e.g. Monte Carlo pathwise / likelihood ratio / vibrato sub-types).&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;For the Delta, loosely speaking, traders tend to think in terms of:&#xA;$$ \Delta = \frac{\partial C(S_0;K,T)}{\partial S_0} + \left. \frac{\partial C(S_0;K,T)}{\partial \sigma(S_0;K,T)} \right\vert_{S_0=\text{cst}} \frac{\partial \sigma(S_0;K,T)}{\partial S_0} $$&#xA;where I have considered a European call option $C(S_0;K,T)$ of implied volatility $\sigma(S_0;K,T)$ without loss of generality. The above equation can be re-expressed as:&#xA;$$ \Delta = \Delta_{BS} + \nu_{BS} \frac{\partial \sigma(S_0;K,T)}{\partial S_0} $$&#xA;where the second term in the RHS is sometimes called &lt;strong&gt;shadow delta&lt;/strong&gt;: it is related to how the implied volatility (surface) is expected to move with the spot. The market often exhibits different such &lt;strong&gt;volatility regimes&lt;/strong&gt; and practitioners have come up with various &lt;strong&gt;stickiness assumptions&lt;/strong&gt; or rules of thumb to capture these, see the seminal paper of &lt;a href=&quot;http://www.emanuelderman.com/writing/entry/regimes-of-volatility-risk-april-1999&quot; rel=&quot;noreferrer&quot;&gt;Emmanuel Derman&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It turns out that making a particular &lt;strong&gt;modelling assumption&lt;/strong&gt; (i.e. picking a certain mathematical model for the dynamics of the underlying), implicitly shapes the spot/implied vol dynamics. In Black-Scholes for instance, you are obviously &lt;em&gt;sticky-strike&lt;/em&gt; because the model theoretically stipulates that the volatility (= IV) is constant:&#xA;$$ \sigma(S_0+\Delta S_0;K,T) = \sigma(S_0;K,T) $$&#xA;such that &#xA;$$\frac{\partial \sigma(S_0;K,T)}{\partial S_0} = 0$$&#xA;and $\Delta = \Delta_{BS}$. &#xA;In more elaborate diffusion frameworks, this term is not zero. Typically, &lt;strong&gt;in equity markets (negatively skewed, i.e. $\partial \sigma/ \partial K &amp;lt; 0$)&lt;/strong&gt; you will have:&#xA;$$\Delta_{LV} \leq \Delta_{BS} \leq \Delta_{SV}$$&#xA;Because, in &lt;strong&gt;inhomogeneous&lt;/strong&gt; local volatility models à la Dupire you can show $\frac{\partial \sigma(S_0;K,T)}{\partial S_0} &amp;lt; 0$ (&lt;em&gt;sticky implied tree/ sticky local delta&lt;/em&gt;). On the other hand, in &lt;strong&gt;space homogenous&lt;/strong&gt; stochastic volatility models (e.g. Heston) you have $\frac{\partial \sigma(S_0;K,T)}{\partial S_0} = -\frac{K}{S_0}\frac{\partial \sigma(S_0;K,T)}{\partial K} &amp;gt; 0$ (&lt;em&gt;sticky moneyness&lt;/em&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Where this can become confusing is that, under given modelling assumptions, you can set up your numerical method to calculate virtually any kind of Delta, i.e. &lt;strong&gt;not necessarily model-consistent Deltas&lt;/strong&gt; (this is well explained in the latest book of &lt;a href=&quot;https://www.crcpress.com/Stochastic-Volatility-Modeling/Bergomi/9781482244069&quot; rel=&quot;noreferrer&quot;&gt;Lorenzo Bergomi&lt;/a&gt;). This can be understood by looking at a simple bump &amp;amp; revalue approach to compute the Delta, e.g. centred finite difference approximation&#xA;$$ \Delta = \frac{V(S_0+\Delta S;\theta) - V(S_0-\Delta S;\theta)}{\Delta S} $$&#xA;Using this approach, you will typically obtain different Delta values depending on what variable(s) amongst the generic model parameters $\theta$ move along with the spot in the pricing function $V(S_0;\theta)$. For instance, in Black-Scholes, along with bumping $S_0$ you can choose to make the implied volatility $\sigma$ evolve according to a certain stickiness assumption (which goes against the theoretical behaviour), or you can leave it unchanged which would consistent with what the model predicts.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The calculation of so-called &lt;strong&gt;minimum variance Deltas&lt;/strong&gt; (under given modelling assumptions) is yet a separate question. In that case, Delta should best be viewed as:&#xA;$$ \Delta^{MV} = \frac{d \langle V,S \rangle_t}{d \langle S,S \rangle_t} $$&#xA;Doing the computations in the BS case, you end up with a regular Delta:&#xA;$$ \Delta^{MV}_{BS} = \frac{\partial V}{\partial S_0} $$&#xA;In LV à la Dupire you have&#xA;$$ \Delta^{MV}_{LV} = \frac{\partial V}{\partial S_0} + \frac{\partial V}{\partial \sigma_{LV}}\frac{\partial \sigma_{LV}}{\partial S_0} $$&#xA;and in SV à la Heston you have&#xA;$$ \Delta^{MV}_{SV} = \frac{\partial V}{\partial S_0} + \frac{\partial V}{\partial v_0}\frac{\xi \rho}{S_0} $$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;To conclude, notice that Vega should be understood as an out-of-model Greek. In other words, the Black-Scholes Vega should be seen as a sensitivity towards a violation of the BS modelling assumptions themselves. In that sense, it can be compared to a sensitivity with respect to Heston parameters in Heston for instance. That being said, if you want the sensitivity to a parallel shift of the full IV surface (which is what the BS Vega represents mathematically), it is still possible to obtain it in Heston and other models, but this can rarely be done analytically. It usually requires some kind of bump the IV surface (! arbitrage opportunities) + re-calibrate the model approach.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2017-04-27T14:14:12.950" LastActivityDate="2017-04-27T14:14:12.950" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="25247" PostTypeId="1" CreationDate="2016-04-05T11:22:33.853" Score="2" ViewCount="709" Body="&lt;p&gt;Trying to evaluate model for pairs trading. Consider classic formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{dP}{P} = adt+b\frac{dQ}{Q}+dX$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $P$ and $Q$ are stock prices, and $X$ is a mean reverting process (MRP) and $a$ is close to zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using real world example I would like to evaluate parameters of MRP. Practically we cannot observe MRP, rather we can derive it from $P$ and $Q$. If we go straightforward and calculate $\hat{b}$ as least squares estimator of $\frac{dP}P$ against $\frac{dQ}Q$, then we have residual estimation &lt;strong&gt;&lt;em&gt;including&lt;/em&gt;&lt;/strong&gt; MRP., i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{dP/P}{dQ/Q} = \hat{b},&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so that our beta $\hat{b}$ captures change in stock prices together with MRP&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{dP/P - dX}{dQ/Q} = \hat{b}.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This gives skewed estimation of $\hat{b}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: how to get estimation of $\hat{b}$ adjusted for MRP?&lt;/p&gt;&#xA;" OwnerUserId="20186" LastActivityDate="2016-04-08T19:37:18.697" Title="Mean reversion and adjusted beta for pairs trading" Tags="&lt;beta&gt;&lt;pairs-trading&gt;&lt;mean-reversion&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25248" PostTypeId="1" CreationDate="2016-04-05T13:16:02.233" Score="1" ViewCount="128" Body="&lt;p&gt;To monitor risk of a client portfolio, does it make sense to accumulate Greeks across different underlying? If yes, how can Greeks be normalized across different underlying?&lt;/p&gt;&#xA;" OwnerUserId="20190" LastActivityDate="2016-04-05T20:56:31.913" Title="Greeks across different underlying" Tags="&lt;risk-management&gt;&lt;greeks&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25249" PostTypeId="2" ParentId="25234" CreationDate="2016-04-05T13:58:09.337" Score="1" Body="&lt;p&gt;ASSUMING your counterparty does stream data (this is not a given), what you got was a Snapshot, requesting the top of the book and the volume. I am assuming you sent a MarketDataRequest message, which is 35=V. The tag 35 in FIX protocol is the Message Type. For help with the protocol, &lt;a href=&quot;http://www.fixtradingcommunity.org/FIXimate/FIXimate3.0/&quot; rel=&quot;nofollow&quot;&gt;FIXIMATE&lt;/a&gt; is your friend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most counterparties should have documentation which tells you how they implement FIX. Look for information on how they handle MarketDataRequest messages. Just as amsh has said in a comment,  in your 35=V message you need to request Snapshot+Updates. This means you need to set the SubscriptionRequestType (tag 263) to the value 1. You probably did not set it at all, and it likely defaulted to 0. &lt;/p&gt;&#xA;" OwnerUserId="16972" LastEditorUserId="16972" LastEditDate="2016-04-05T18:42:22.290" LastActivityDate="2016-04-05T18:42:22.290" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25250" PostTypeId="2" ParentId="25248" CreationDate="2016-04-05T16:24:24.147" Score="1" Body="&lt;p&gt;It depends on what kind of 'Greek' and 'underlying' you are referring to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Aggregating the sensivity of various equity positions (e.g. options, futures) to interest rates could for instance make sense if you want to evaluate the sensitivity to that &lt;em&gt;common risk factor&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, aggregation of underlying-dependent quantities (such as Delta) across distinct underlyings, does not make sense, at least in the equity world.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That being said, aggregation across a different positions/instruments written on a given underlying asset does of course make sense (e.g. macro hedging of the Delta, or bucketed Vegas).&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-04-05T20:56:31.913" LastActivityDate="2016-04-05T20:56:31.913" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25252" PostTypeId="1" AcceptedAnswerId="25258" CreationDate="2016-04-05T18:34:36.017" Score="1" ViewCount="55" Body="&lt;p&gt;Let $\{Z_k\}_{k=1}^{N}$ be a sequence of i.i.d. random variables with the following distribution &#xA;$$Z_k = \begin{cases}&#xA;\alpha &amp;amp;\text{with probability} \ \hat{\pi}\\&#xA;-\beta &amp;amp;\text{with probability} \ 1 - \hat{\pi}&#xA;\end{cases}$$&#xA;Then we have $$\ln(S_T) = ln(S_0) + (r - \frac{\sigma^2}{2})T + \sigma\sqrt{T}\frac{1}{\sqrt{N}}\sum_{k=1}^{N}Z_k$$&#xA;The only criteria for the convergence of binomial model to Black-Scholes model is that the random variables $Z_k$, $k = 1,\ldots,N$ must satisfy $\hat{\mathbb{E}}[Z_1] = o(\delta)$ and $\hat{\mathbb{E}}[Z_1^2] = 1 + o(1)$ i.e. $$\text{If} \ \hat{\mathbb{E}}[Z_1] = o(\delta), \ \text{and} \ \hat{\mathbb{E}}[Z_1^2] = 1+o(1), \ \text{then}$$ $$\frac{1}{\sqrt{N}}\sum_{k=1}^{N}Z_k \ \text{converges to} \ \mathcal{N}(0,1) \ \text{weakly}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Symmetric probability: $$u = \exp(\delta(r - \frac{\sigma^2}{2}) + \sqrt{\delta}\sigma), l = \exp(\delta(r - \frac{\sigma^2}{2}) - \sqrt{\delta}\sigma) , \ \text{and} \ \  R = r\delta$$&#xA;Then; $$\hat{\pi}_u = \hat{\pi}_l = \frac{1}{2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Subjective return: $$u = \exp(\delta\nu + \sqrt{\delta}\sigma), l = \exp(\delta\nu - \sqrt{\delta}\sigma), \ \text{and} \ \  R = r\delta$$&#xA;Then; $$\hat{\pi}_u = \frac{1}{2}\left(1 + \sqrt{\delta}\frac{r - \nu - \frac{1}{2}\sigma^2}{\sigma}\right) \ \ \text{and} \ \ \hat{\pi}_l = \frac{1}{2}\left(1 - \sqrt{\delta}\frac{r - \nu - \frac{1}{2}\sigma^2}{\sigma}\right)$$&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Show $$\hat{\mathbb{E}}[Z_1] = o(\delta), \ \ \text{and} \ \ \hat{\mathbb{E}}[Z_1^2] = 1 + o(1)$$ in the following cases.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;a.) symmetric probability&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;b.) subjective return&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Attempted solution a.) $$E[Z_1] = 1\times \frac{1}{2} - 1\times\frac{1}{2} = 0$$ and $$E[Z_1^2] = 1^2\times\frac{1}{2} + (-1)^2\frac{1}{2} = 1$$&lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="19002" LastEditDate="2016-04-06T18:21:32.227" LastActivityDate="2016-04-06T18:21:32.227" Title="Symmetric probability and subjective return" Tags="&lt;mathematics&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25253" PostTypeId="2" ParentId="25241" CreationDate="2016-04-05T19:14:35.273" Score="2" Body="&lt;p&gt;In your answer, you don't include dividend.&#xA;I am sorry to say it is wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Payoff function is&#xA;$$&#xA;g(S_T) = (S_T - K_1)_+  - 2(S_T - \frac{K_1+K_2}{2})_+ + (S_T - K_2)_+&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BS pricing formula with dividend gives&#xA;$$&#xA;V(t=0,S) = e^{-r}E(g(\tilde{d}S_T)) = \tilde{d} \left(BS_{call}\left(\frac{K_1}{\tilde{d}}\right) - 2BS_{call}\left(\frac{K_1+K_2}{2 \tilde{d}}\right) + BS_{call}\left(\frac{K_2}{\tilde{d}}\right)\right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where&#xA;$$&#xA;\tilde{d} = (1-\frac{d}{4})^4 = 0.9037&#xA;$$&#xA;Plug in all numbers in your question, I get 0.3905 (double check it yourself).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to the greeks,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\Delta = \frac{\partial V(t=0,S)}{\partial S} = \tilde{d} \left[ N(d_1(K_1/\tilde{d})) - 2N(d_1((K_1+K_2)/(2\tilde{d}))) + N(d_1(K_2/\tilde{d})) \right]&#xA;$$&#xA;where $N$ is the normal c.d.f. and $d_1(K)=\frac{log(S/K)+(r+\frac{1}{2}\sigma)\tau}{sigma\sqrt{\tau}}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rest of the problem is pretty trivial because all greeks are just linear combination of original BS greeks. You just need change the strike price in the original BS greeks (I guess?). I won't go through all the calculation here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me know if anything is not clear.&lt;/p&gt;&#xA;" OwnerUserId="19653" LastActivityDate="2016-04-05T19:14:35.273" CommentCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="25254" PostTypeId="2" ParentId="24719" CreationDate="2016-04-05T19:38:26.687" Score="1" Body="&lt;p&gt;Don't use a nosql DB like Mongo. Use an SQL like MySql or MSSQL.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;MSSQL: &lt;a href=&quot;https://www.microsoft.com/en-us/download/details.aspx?id=42299&quot; rel=&quot;nofollow&quot;&gt;https://www.microsoft.com/en-us/download/details.aspx?id=42299&lt;/a&gt;&#xA;MYSql: &lt;a href=&quot;http://dev.mysql.com/downloads/mysql/&quot; rel=&quot;nofollow&quot;&gt;http://dev.mysql.com/downloads/mysql/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sounds like you have structured columns like a spreadsheet. If you are a fiance guy you, intuitively you see data the way it is stored in SQL. Tables and columns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your tech stack uses lots of Microsoft products like VBA, Visual Studio, and Excel, go ahead and use MSSQL. But double check if doing trading violates any commercial licensing type of stuff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there are licencing problems or you don't want the Microsoft ecosystem you can use MySql.&lt;/p&gt;&#xA;" OwnerUserId="20191" LastActivityDate="2016-04-05T19:38:26.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25255" PostTypeId="2" ParentId="25237" CreationDate="2016-04-06T05:38:22.257" Score="2" Body="&lt;p&gt;If you look at longer time returns (monthly or weekly as compared to daily) then these can be seen as the sum of daily (log-)returns:&#xA;$$&#xA;r^w = \sum r_1^d + \cdots r_5^d.&#xA;$$&#xA;It is in general not true that the $r_i$ are iid because they are not independent.&#xA;If they were then $r_i^2$ would be iid too and we know that volatility clusters.&#xA;Even without independence we see that variance roughly scales with time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The thing that you might be seeing here is aggregational Gaussianity (see e.g. here in a paper by &lt;a href=&quot;http://www.statslab.cam.ac.uk/~chris/papers/UAR.pdf&quot; rel=&quot;nofollow&quot;&gt;Rogers and Zhang&lt;/a&gt;. This means that increasing the time scale returns look more and more Gaussian. This implies that excess kurtosis gets smaller and skewness too. This leads too a distribution with less &quot;suprises&quot; and in this definition less risk.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-04-06T05:38:22.257" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="25256" PostTypeId="1" CreationDate="2016-04-06T05:55:11.090" Score="10" ViewCount="9826" Body="&lt;p&gt;I'm re-creating an app for Stockmarket Screening &amp;amp; Realtime charting Display.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The database wireframe which i propose to design is as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;1. Company master -  Where all the information of the company is given:&lt;/strong&gt;&#xA;Vendor Code|Company Full Name|Company Short name|Industry Code|Industry Full Name|Promoter Group Code|Promoter Group|EXCHANGE1 CODE|STOCK CATEGORY|EXCHANGE2 CODE|TYPE|ISIN CODE|STOCK TYPE&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2. ) Intraday Data -  Where every minutes the price of a stock is Stored:&lt;/strong&gt; (This would be overwritten the next trading day)&#xA;EXCHANGE1 CODE | OPEN PRICE | LAST PRICE | DAYHIGH | DAYLOW | Offer Price | Offer Qty | VOLUME |VALUE |Date &amp;amp; Time Stamp&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;3. Historical Data (Day wise):&lt;/strong&gt;&#xA;EXCHANGE1 CODE | OPEN PRICE | CLOSE PRICE | DAYHIGH | DAYLOW | VOLUME | Date&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;4. Fundamental Data (Not Yet given full thought):&lt;/strong&gt;&#xA;This would store  all fundamental data like last 4 qtrly reports, Competitors, Balance sheets, Financial Ratios, P&amp;amp;L Statement, Promoter Details etc..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typical Queries would be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Stock Quote Page:&lt;/strong&gt; &#xA;Time Series Price Charts with user selection, Intraday, 1 week, 1 month, 6months, 1 year, 5 years&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fundamental Data presented in chart form (i.e growth in profits, growth in sales) plus Other fundamental Data &amp;amp; News&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Stock Screening :&lt;/strong&gt; (Example Queries)&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Show me the stock of companies who have grown their sales by 20% per&#xA;year over the last 3 years&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Show me the companies whos PE is less than 10&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Show me the company whose qtrly profit has grown by 15% per year over past 5 years&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;Show me the companies in Automobiles sector whose last 100 day avg price is less than current price&lt;/li&gt;&#xA;&lt;li&gt;Show 50day, 100day, 200day simple moving averages&#xA;etc etc..&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Right now i'm at a stage wherein i've to decide which database to use MySQL or MongoDB (NoSQL Document) or Cassandra (NoSQL Column).&#xA;So in the above case which database should i use? and why? (Advantages/Disadvantages)&#xA;I want fast execution, data integrity, high concurrency, data aggregation &amp;amp; calculations (Analysis).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Plus we have to account that the data tables are being updates every minute and also serving visitor requests from the same DB simultaneously. So consistent &amp;amp; error free read/write is also of importance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any comments/critiques on my DB wireframe also welcome.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards&#xA;Sunny&lt;/p&gt;&#xA;" OwnerUserId="20197" LastEditorUserId="20197" LastEditDate="2016-04-06T06:02:36.500" LastActivityDate="2021-05-26T21:39:54.517" Title="Which Database (MySql or NoSQL) for a Stock market App" Tags="&lt;equities&gt;&lt;database&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="25257" PostTypeId="1" AcceptedAnswerId="25264" CreationDate="2016-04-06T08:40:14.093" Score="2" ViewCount="286" Body="&lt;p&gt;could anyone give me an information about distributions of AR and MA coefficients via estimation?&#xA;So, for example, I have ARMA(1,1)-GARCH(1,1) model with the same AR(1) and MA(1) parameters estimations. So, I know &quot;mean&quot; for it and std, but what's the distribution of each?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope, my question isn't dummy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you. &lt;/p&gt;&#xA;" OwnerUserId="19992" LastActivityDate="2016-04-06T18:11:13.447" Title="distribution of AR, MA coefficients estimation in ARMA-GARCH models" Tags="&lt;time-series&gt;&lt;garch&gt;&lt;arma&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25258" PostTypeId="2" ParentId="25252" CreationDate="2016-04-06T09:54:07.093" Score="1" Body="&lt;p&gt;your statement is quite imprecise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://en.wikipedia.org/wiki/Central_limit_theorem&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Central_limit_theorem&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;$(Z_k)_{k=1\dots n}$ i.i.d with $\mathbb{E}\left[Z_1\right] = \mu$ and $\text{Var}(Z_1)=\mathbb{E}\left[Z_1^2\right] -\mu^2=\sigma^2$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;and by denoting $\mathcal{N}(m,v)$ a normal variance with mean $m$ and variance $v$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;we have :&#xA;$$&#xA;\text{weak}\lim_{N\to\infty}\frac{1}{\sqrt{N}}\sum_{i=1}^n(Z_k-\mu) = \mathcal{N}(0,\sigma^2)&#xA;$$&#xA;or alternatively&#xA;$$&#xA;\text{weak}\lim_{N\to\infty}\frac{1}{\sigma\sqrt{N}}\sum_{i=1}^n(Z_k-\mu) = \mathcal{N}(0,1)&#xA;$$&#xA;you can apply it straightforward to your problem&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-04-06T09:54:07.093" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="25259" PostTypeId="2" ParentId="25247" CreationDate="2016-04-06T10:13:26.067" Score="1" Body="&lt;p&gt;let define&#xA;$$ \text{RP}_t = \sum_{u&amp;lt; t} \frac{dP_u}{P_u}$$&#xA;$$ \text{RQ}_t =\sum_{u&amp;lt;t} \frac{dP_u}{P_u}$$&#xA;$X$ is a mean reverting process so :&#xA;$$ dX = \alpha (\mu - X)dt + \sigma dB $$&#xA;where $B$ is a brownian motion&lt;/p&gt;&#xA;&#xA;&lt;p&gt;meanwhile using your relationship you get :&#xA;$$ X_t =  \text{RP}_t - b \text{RQ}_t - a t $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you use $X$ dynamics with this and you get:&#xA;$$\begin{split}\frac{dP}{P} &amp;amp;= a dt + b \frac{dQ}{Q} + dX \\&#xA;&amp;amp;= (a+\alpha\mu) dt + b \frac{dQ}{Q} - \alpha \text{RP} dt - \alpha b \text{RQ}_t dt - a\alpha t dt + \sigma dB&#xA;\end{split}$$&#xA;you are now in the case of a classical multi dimensionnal linear regression&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-04-06T10:13:26.067" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25260" PostTypeId="2" ParentId="25240" CreationDate="2016-04-06T13:19:24.887" Score="1" Body="&lt;p&gt;Two hints :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The number of paths never going up to $3125$ when starting from $1024$ and stepping up by a multiplicative factor of $5/4$ and down by a multiplicative factor $4/5$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the same as the number of paths starting from $0$ and and stepping up by an additive factor $+1$ and stepping down by an additive factor of $-1$ and never going up to $5$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $E(n,m)$ be the number of paths of length $n$ such that starting from $0$ and stepping up $+1$ and stepping down $-1$, then :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E(n,m) = E(n-1,m-1) + E(n-1,m+1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;it is then easy to think about Pascal triangle and to look for a solution like $E(n,m)=C(n,a \times n + b \times m)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you can verify that $E(n,m) = C(n,\frac{n+m}{2})$ will satisfy the relation ship&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-04-06T13:19:24.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25261" PostTypeId="2" ParentId="15115" CreationDate="2016-04-06T13:40:02.887" Score="-2" Body="&lt;p&gt;Beta is volatility in relation to a benchmark whereas Standard Deviation is volatility in relation to actual returns vs expected returns&lt;/p&gt;&#xA;" OwnerUserId="20205" LastActivityDate="2016-04-06T13:40:02.887" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25262" PostTypeId="1" AcceptedAnswerId="25287" CreationDate="2016-04-06T14:11:56.473" Score="0" ViewCount="251" Body="&lt;p&gt;How to fetch  floating p/l(current) of a &quot;filled&quot; FIX-Order (either buy/sell)?(by its FIX-ID/order ID)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I asked my FIX provider(Integral) &amp;amp; they said, there's no specific tag for that/not a standard FIX practice, but it can be calculated on my side.(via different methods)&#xA;Is there any way to calculate floating p/l of a fix-order?(against current market price)&lt;/p&gt;&#xA;" OwnerUserId="20171" LastActivityDate="2016-04-08T01:05:29.327" Title="Calculating floating P&amp;L of a FIX-order" Tags="&lt;market-data&gt;&lt;fx&gt;&lt;automated-trading&gt;&lt;fix&gt;&lt;quickfix&gt;" AnswerCount="2" CommentCount="2" ClosedDate="2016-04-08T11:41:39.193" ContentLicense="CC BY-SA 3.0" />
  <row Id="25263" PostTypeId="2" ParentId="24506" CreationDate="2016-04-06T14:30:19.220" Score="0" Body="&lt;p&gt;For Forex,swaps,NDFs, most LPs supports &gt;10ms execution time .with default quick-fix we could achieve &amp;lt;170ms latency for whole chain of processes of our application(from sending message to execution on server-side). So basically it depends on your application, how it should work &amp;amp; who's your LP &amp;amp; what latency range is your aim. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can try with Onix instead of Quick-fix, but there won't be much upgrade in that regard.Performance &amp;amp; latency depends on a whole lot of other things.&lt;/p&gt;&#xA;" OwnerUserId="20171" LastActivityDate="2016-04-06T14:30:19.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25264" PostTypeId="2" ParentId="25257" CreationDate="2016-04-06T14:35:07.597" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Normally distributed and that's why the two first moments are sufficient to infer their statistical significance.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Proof are rather technical (and sometimes are not specific to time-series models) and mainly depends of:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The estimation method employed ( QMLE, Least Squares, Moment, Whittle...)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The parameter space&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Moment restrictions &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;...&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;These proofs demonstrate, under assumptions, that estimated parameters are consistent ($\hat{\theta} \rightarrow \theta$) and asymptotic Normal ($\sqrt{n}(\hat{\theta}-\theta)\rightarrow N(0,\sigma)$). This is true even if innovations are not Gaussian distributed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can have a look to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;A Tour in the Asymptotic Theory of GARCH Estimation&lt;/em&gt; by Christian Francq, Jean-Michel Zakoïan (Handbook of Financial Time Series)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2016-04-06T18:11:13.447" LastActivityDate="2016-04-06T18:11:13.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25265" PostTypeId="2" ParentId="25163" CreationDate="2016-04-06T16:12:20.317" Score="1" Body="&lt;p&gt;Exploiting an arbitrage is straightforward. Constructing and noticing one is the hard part. In your case if you know that Swptn(K,T1,T2)+Swptn(K,T2,T3) &gt;= Swptn(K,T1,T3),&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simply sell Swptn(K,T1,T2)+Swptn(K,T2,T3) and buy Swptn(K,T1,T3). Sell the most expensive and buy the cheapest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;L.&lt;/p&gt;&#xA;" OwnerUserId="17291" LastActivityDate="2016-04-06T16:12:20.317" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25266" PostTypeId="2" ParentId="25218" CreationDate="2016-04-06T18:03:51.407" Score="2" Body="&lt;p&gt;Let &#xA;\begin{align*}&#xA;V(t, S_t) = E\Big(e^{-r(T-t)} g(S_T)\mid \mathcal{F}_t \Big)&#xA;\end{align*}&#xA;be the risk-neutral value at time $t$ of the option payoff $g(S_T)$. Then $\{e^{-rt}V(t, S_t), 0 \le t \le T\}$ is a martingale. Consequently,&#xA;\begin{align}&#xA;-rV + \frac{\partial V}{\partial t} + (r-q)S\frac{\partial V}{\partial S_t}+\frac{1}{2}\sigma^2 S_t^2 \frac{\partial^2 V}{\partial S_t^2} = 0,\tag{1}&#xA;\end{align}&#xA;which is the Black-Scholes equation for the solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a solution of the form&#xA;\begin{align*}&#xA;V(t, S_t) = e^{a(T-t)}S_t^{-5}e^{10S_t}.&#xA;\end{align*}&#xA;Note that&#xA;\begin{align*}&#xA;\frac{\partial V}{\partial t} &amp;amp;= -a V, \\&#xA;\frac{\partial V}{\partial S_t} &amp;amp;= \Big(-\frac{5}{S_t}+10\Big) V,\ \mbox{ and}\\&#xA;\frac{\partial V^2}{\partial S_t^2} &amp;amp;= \frac{5}{S_t^2}V + \Big(-\frac{5}{S_t}+10\Big)^2 V\\&#xA;&amp;amp;=\Big(\frac{30}{S_t^2} - \frac{100}{S_t} + 100\Big) V.&#xA;\end{align*}&#xA;Substitute into Equation (1) and evaluate at $t=0$, &#xA;\begin{align*}&#xA;-r-a +(r-q)(-5+10S_0) + \frac{1}{2}\sigma^2 \big(30-100 S_0 + 100 S_0^2\big) = 0.&#xA;\end{align*}&#xA;That is&#xA;\begin{align*}&#xA;a &amp;amp;= -r+(r-q)(-5+10S_0) + \frac{1}{2}\sigma^2 \big(30-100 S_0 + 100 S_0^2\big)\\&#xA;&amp;amp;= -0.1+ (0.1-0.2)\times (-5+10\times 2) + 0.5 \times 0.2^2 \times (30-100 \times 2 + 100 \times 4)\\&#xA;&amp;amp;=3. &#xA;\end{align*}&#xA;Finally, the option value is given by&#xA;\begin{align*}&#xA;V(0, S_0) &amp;amp;= e^{a(T-0)}S_0^{-5}e^{10S_0}\\&#xA;&amp;amp;= \cdots &#xA;\end{align*}&#xA;Please fill-in here. What is $T$?&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-04-06T20:29:21.177" LastActivityDate="2016-04-06T20:29:21.177" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25268" PostTypeId="1" AcceptedAnswerId="25271" CreationDate="2016-04-06T19:17:12.277" Score="2" ViewCount="275" Body="&lt;p&gt;i'm working on options with different maturities. I need to correspond a risk free rate for each maturity. What rate should i consider as risk free rate?&#xA;thank you.&lt;/p&gt;&#xA;" OwnerUserId="20211" LastActivityDate="2016-04-06T20:55:14.070" Title="how to compute the risk free rate for a given maturity of an option contract?" Tags="&lt;options&gt;&lt;interest-rates&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25269" PostTypeId="1" CreationDate="2016-04-06T19:22:02.650" Score="1" ViewCount="55" Body="&lt;p&gt;Can anyone please explain how do I get this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\beta_e = \beta_a +(\beta_a - \beta_d) \times D/E$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;from&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$K_e =K_a +(K_a − K_d) \times D/E.$$&lt;/p&gt;&#xA;" OwnerUserId="20209" LastEditorUserId="848" LastEditDate="2016-04-16T08:41:19.040" LastActivityDate="2016-04-16T08:41:19.040" Title="Beta in Capital Structure" Tags="&lt;beta&gt;&lt;capital-structure&gt;" AnswerCount="0" CommentCount="1" ClosedDate="2016-04-16T08:41:54.653" ContentLicense="CC BY-SA 3.0" />
  <row Id="25270" PostTypeId="2" ParentId="20911" CreationDate="2016-04-06T20:18:41.893" Score="0" Body="&lt;p&gt;As you can tell, there are many ways to estimate volatility (standard deviation, range, etc.). What is better or worse depends on the use-case. What all volatility estimators have in common are that they try to measure variability. If this is for trading strategy development, you'll probably want to backtest a variety of methods to see what works best. Some notes on the approaches you mentioned:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GARCH: You can estimate a GARCH model based on range data: I believe the formal term for this specification is CARR (conditional autoregressive range). Classical GARCH uses squared daily returns data to estimate conditional volatility as variance/standard deviation.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Garman-Klass: This is a static estimate which gives you a volatility estimate in terms of standard deviation (like classic GARCH). It is a stylized fact of financial markets that volatility is time-varying, so assuming volatility is constant is risky here. Using a moving window estimate could be a crude solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moving Average of High-Low range: CARR is a sophisticated version of what you described here. ARMA and GARCH processes are types of exponentially smoothed moving averages, with an additional mean-reversion term.&lt;/p&gt;&#xA;" OwnerUserId="7889" LastActivityDate="2016-04-06T20:18:41.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25271" PostTypeId="2" ParentId="25268" CreationDate="2016-04-06T20:55:14.070" Score="1" Body="&lt;p&gt;The risk free rate is used to get the present value of future payoff, so you should use the rate of a risk-free instrument (e.g. a Treasury note) that has roughly the same maturity of the option you are valuing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you option expires in a time that does not have an exact Treasury instrument, you can get a rough approximation by interpolating between two published rates.  There are more sophisticated methods, but for option valuation the interest rate is generally a small factor, other than for long-dated deep in-the-money options.&lt;/p&gt;&#xA;" OwnerUserId="20213" LastActivityDate="2016-04-06T20:55:14.070" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25272" PostTypeId="2" ParentId="23072" CreationDate="2016-04-06T21:21:30.883" Score="-1" Body="&lt;p&gt;The black-scholes model requires that volatility is constant &lt;em&gt;over time&lt;/em&gt;.  The reason is because the theory assumes a random walk with a constant probability of each change in underlying price.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It makes no assumptions about volatility being the same &lt;em&gt;for all strikes&lt;/em&gt;.  You could argue that since volatility is supposed to be a measurement of the underlying asset, then it &lt;em&gt;should&lt;/em&gt; be constant, but it doesn't invalidate the model.  The real market determines prices of options, and since it tends to place a slightly higher value (all things being equal) for deep in-the-money options and deep out-of-the-money options, the &lt;em&gt;implied&lt;/em&gt; volatility tends to be higher the further away from at-the-money you get.  &lt;/p&gt;&#xA;" OwnerUserId="20213" LastActivityDate="2016-04-06T21:21:30.883" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25275" PostTypeId="1" CreationDate="2016-04-06T22:39:37.307" Score="2" ViewCount="81" Body="&lt;p&gt;What is the joint probability distribution of the maximum of the return between time $0$ and $t$ and the return at $t$, for the Heston model, when the return drift is $0$ and the correlation between the equity factor and the variance factor is &lt;strong&gt;nonzero&lt;/strong&gt;?&lt;/p&gt;&#xA;" OwnerUserId="6686" LastEditorUserId="6686" LastEditDate="2016-04-07T00:09:45.003" LastActivityDate="2016-04-07T00:09:45.003" Title="Heston Model Maximum Return Distribution" Tags="&lt;stochastic-processes&gt;&lt;stochastic-volatility&gt;&lt;heston&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25276" PostTypeId="2" ParentId="23072" CreationDate="2016-04-06T23:37:31.933" Score="3" Body="&lt;p&gt;You seem somewhat lost between theory (the model) and practice (the market)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Theory]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Black-Scholes model postulates that the dynamics of 'the stock' follows a &lt;strong&gt;Geometric Brownian Motion with constant volatility&lt;/strong&gt;, i.e. GBM$(r,\sigma)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mathematically, this writes&#xA;$$ \frac {dS_t}{S_t} = r dt + \sigma dW_t^{\mathbb{Q}} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;European option prices have a closed form expression under this modelling assumption, given by the celebrated &lt;strong&gt;Black-Scholes Formula&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;If you believe the model&lt;/strong&gt;, regardless of the option you will be pricing (in other words, whatever the strike $K $ or time to maturity  $T $), you will therefore always plug the same volatility figure $\sigma $ in the BS formula. This is because all these options are written on the same underlying $S$, which has a unique dynamics, which was postulated to be a GBM with volatility $\sigma $ and &lt;strong&gt;nothing else&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Practice]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, looking at real option quotes and assuming you have identified the relevant discount factors and forward curve, when you try to find the volatility values that need to be plugged in the BS formula to retrieve the observed market prices, you find that these numbers are &lt;strong&gt;not constant&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a fixed maturity, this is what is known as the implied &lt;strong&gt;volatility smile&lt;/strong&gt;. For a fixed strike, this is what is known as the implied &lt;strong&gt;volatility term structure&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because the volatilities are &lt;strong&gt;not constant&lt;/strong&gt;, the assumptions of the Black-Scholes modelling framework are violated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed, using different volatilities would effectively mean using different underlying dynamics (remember that one specific value of volatility = one specific dynamics in BS world) for each option you are trying to price, which does not make any sense since the underlying is unique. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, contrary to what theory predicts, you cannot use a single volatility figure to retrieve all options' market price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quoting options in terms of BS volatility is strictly equivalent to quoting them in terms of price because, through the BS formula, there is a &lt;strong&gt;one-to-one relationship between volatility and price&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is just more practical because: (1) IV  varies less across strikes/maturities than prices would, which makes it easier to compare things on an equal footing (2) if you delta-hedge at the implied volatility your P&amp;amp;L will be proportional to the difference between realised and implied volatility. This is why people claim that buying options is like buying volatility (though this is not a pure volatility bet, because of the path-dependence of your P&amp;amp;L through the Gamma dollar).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To conclude I would say that it is not the &lt;strong&gt;Black-Scholes model&lt;/strong&gt; which is used by market practitioners but rather the Black-Scholes &lt;strong&gt;pricing equation&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-05-01T16:46:10.353" LastActivityDate="2016-05-01T16:46:10.353" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25277" PostTypeId="2" ParentId="25256" CreationDate="2016-04-07T08:14:28.613" Score="6" Body="&lt;p&gt;An SQL database is generally best for structured data, ad-hoc queries and for queries involving joining several entities together to find the results. It will also help you maintain data consistency and integrity by forcing this more structured design. Recent in-memory features of modern database engines offer most of the remaining performance advantages of NoSQL.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the fundamentals part of your database consists of unstructured data (such as file attachments), then NoSQL is a good choice here. But an SQL table with file name references works almost just as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My recommendation for your project is PostgreSQL, but if it has to be one of the mentioned then MySQL.&lt;/p&gt;&#xA;" OwnerUserId="20173" LastActivityDate="2016-04-07T08:14:28.613" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25278" PostTypeId="2" ParentId="21402" CreationDate="2016-04-07T08:31:58.753" Score="1" Body="&lt;p&gt;A convexity adjustment is often applied to fix the difference between the view of the instrument as it is and if it were based on forward rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A simple example is the difference between a futures rate and a forward rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The difference is that the forward pays after the period whereas the futures price has a pnl all the way from the purchase up to expiration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If rates rise the gains on a short position in the futures can be reinvested at a higher rate. Thus the price must be different to a forward where this is not possible. This is the difference between future rate and forward rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess some similar reasoning of reinvesting applies to your setting too.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-04-07T08:31:58.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25280" PostTypeId="2" ParentId="17961" CreationDate="2016-04-07T09:24:56.097" Score="4" Body="&lt;p&gt;I don't think you can have an explicit form.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $Y_t= e^{at}X_t$ then :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ Y_t -Y_0 =\sum_{i=1}^{N_t}e^{aT_i} $$ where $(T_i)_{i=1...N_t}$ are the jump times of your poisson process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then $$P(Y_t\leq x)=\sum_{n\geq 0}\frac{(mt)^n}{n!}e^{-mt}P(\sum_{i=1}^{N_t}e^{aT_i}\leq x|N_t=n)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P(\sum_{i=1}^{N_t}e^{aT_i}\leq x|N_t=n) =\int_{[0,+\infty]^n}\mathbf{1}_{\sum_{i=1}^n e^{at_i}\leq x}\mathbf{1}_{t_1&amp;lt;t_2&amp;lt;...&amp;lt;t_n}m^ne^{-mt_n} dt_1dt_2\dots dt_n$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and then it becomes difficult.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-04-07T09:24:56.097" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25282" PostTypeId="1" CreationDate="2016-04-07T10:13:14.007" Score="1" ViewCount="81" Body="&lt;p&gt;I'm learning order flow.  I would like to differentiate between aggregated dark pool volume and aggregated algo trading volume.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to tell orders coming from a dark pool from algo orders?&lt;/p&gt;&#xA;" OwnerUserId="17759" LastActivityDate="2016-04-07T10:13:14.007" Title="How can I discover dark pool orders in an order book?" Tags="&lt;market-data&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25283" PostTypeId="2" ParentId="25240" CreationDate="2016-04-07T11:22:33.653" Score="2" Body="&lt;p&gt;As I mentioned above, I am not sure what the variable $r$ is. If we ignore that, or assume the questioner wanted to say its the risk free interest rate, then it has no effect on the number of paths.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then it is clear that after 50 steps going from \$1024 to \$2500 requires a net of 4 up movements with the given $x=y^{-1}=1.25$. Thus the number of steps &lt;strong&gt;without&lt;/strong&gt; the barrier constraint is $\phantom{a}^{50} C_{23}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We need to subtract from this the number of paths that cross \$3125 and yet end up on \$2500. For each such path, there is one that passes through \$3125 at the same place but then is reflected across the line \$3125 to end up on \$3906.25. In other words the reflected path has a net 6 up movements. An example of this method is shown below. The numbers used are for a different problem. &lt;a href=&quot;https://i.stack.imgur.com/qeuSG.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/qeuSG.png&quot; alt=&quot;A reflected path is shown below although the values are for a different problem.&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the number of such paths is $\phantom{a}^{50} C_{28}$. However, recall these are the paths we need to exclude as they &lt;strong&gt;crossed&lt;/strong&gt; the barrier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus the number of paths consistent with ending up on \$2500 having never crossed \$3125 is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\phantom{a}^{50} C_{23}- \phantom{a}^{50} C_{28}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is not the same as that asked in the question because of the difference in the first term but I suspect that is a typo.&lt;/p&gt;&#xA;" OwnerUserId="19878" LastEditorUserId="19878" LastEditDate="2016-04-07T15:56:44.900" LastActivityDate="2016-04-07T15:56:44.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25284" PostTypeId="1" CreationDate="2016-04-07T11:55:59.010" Score="1" ViewCount="70" Body="&lt;p&gt;Suppose I have a portfolio of 5 assets.  Assets 1 and 2 have foreign exchange exposures and therefore foreign exchange volatility. How can I calculate the marginal contribution to the total portfolio volatility from the individual foreign exchange exposures?&lt;/p&gt;&#xA;" OwnerUserId="20221" LastActivityDate="2016-04-24T12:20:10.530" Title="How to compute the foreign exchange volatility within a portfolio" Tags="&lt;volatility&gt;&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25285" PostTypeId="1" CreationDate="2016-04-07T12:15:51.333" Score="1" ViewCount="35" Body="&lt;p&gt;Suppose I have a composite index (rebalancing or non-rebalancing) that at present time has some base value $B_{\text{base}}$ in some base economy. I am in the process of shocking the economy on which my composite index is defined ( &lt;em&gt;changing the index values by different factors&lt;/em&gt;) and re-valuating its base value. I went to code the pricing engine for my composite index after shocking and figured the new value should be calculated as &#xA;$$ &#xA;B_{\text{shocked}} = B_{\text{base}} \cdot \frac{\sum{\big(\text{index weight}}_{i} \cdot \text{shocked index value}_{i}\big)}{\sum{\big(\text{index weight}}_{i} \cdot \text{base index value}_{i}\big)}&#xA;$$&#xA;But then it occurred to me that were I to only shock certain underlying indices this methodology doesn't quite look correct, and maybe should be&#xA;$$&#xA;B_{\text{shocked}} = B_{\text{base}} \cdot \sum \bigg(\frac{ \text{shocked index value}_{i}}{\text{base index value}_{i}} \cdot \text{index weight}_{i} \bigg)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My suspicion is that the methodology should depend on how my weights for each underlying index are defined - whether they are set by regressing on a portfolio for instance or otherwise. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering if anyone could shed any light on which of these two methodologies should be used for what purposes or more importantly what exactly is the assumption that distinguishes them? I'm having a hard time conceptualizing the distinction beyond the fact that they're different mathematical formulas. &lt;/p&gt;&#xA;" OwnerUserId="16064" LastEditorUserId="16064" LastEditDate="2016-04-07T12:26:39.467" LastActivityDate="2016-04-07T12:26:39.467" Title="Methodologies behind shocking a composite index instrument, what assumption distinguishes these?" Tags="&lt;risk-management&gt;&lt;pricing&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25286" PostTypeId="1" AcceptedAnswerId="25288" CreationDate="2016-04-07T12:39:52.720" Score="4" ViewCount="452" Body="&lt;p&gt;In the textbook by &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/144192311X&quot; rel=&quot;nofollow noreferrer&quot;&gt;Shreve&lt;/a&gt; in &lt;strong&gt;sec. 11.7.2&lt;/strong&gt; a jump-diffusion process is introduced. More precisely&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;dS_t  =  \alpha\,S_t\,dt+\sigma\,S_t\,dW_t+S_{t-}\,d\left(Q_t-\beta\,\lambda\,t\right)\quad (1)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Q_t = \sum_{i=1}^{N_t}Y_i$ and $N_t$ is Poisson with intensity $\lambda$. The process is re-written as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;dS_t  =  (\alpha-\beta\,\lambda)\,S_t\,dt+\sigma\,S_t\,dW_t+S_{t-}\,dQ_t\quad(2). &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that, a part from time instants in which there is no jump and hence $S_t=S_{t-}$, I cannot go from (1) to (2), because if there is a jump of size $Y_i$ at time $t$ it holds that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{S_t-S_{t-}}{S_{t-}} = Y_i\rightarrow S_t = S_{t-}\,(Y_i+1). &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and so I get &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;dS_t  =  \alpha\,S_t\,dt+\sigma\,S_t\,dW_t+S_{t-}\,dQ_t-S_{t-}\,\beta\,\lambda\,dt\neq  (\alpha-\beta\,\lambda)\,S_t\,dt+\sigma\,S_t\,dW_t+S_{t-}\,dQ_t.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here there is a snapshot of the textbook.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/EtQYY.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/EtQYY.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18063" LastEditorUserId="18063" LastEditDate="2016-04-07T13:18:11.757" LastActivityDate="2016-04-08T14:11:52.807" Title="Simple question on jump-diffusion" Tags="&lt;stochastic-processes&gt;&lt;jump&gt;&lt;merton-model&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25287" PostTypeId="2" ParentId="25262" CreationDate="2016-04-07T12:51:57.777" Score="1" Body="&lt;p&gt;FIX is just the message protocol so the PnL for a filled order (an execution report) on your side by taking the price and volume of the execution report and a reference price when you get the execution report, then calculate your PnL...&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2016-04-07T12:51:57.777" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25288" PostTypeId="2" ParentId="25286" CreationDate="2016-04-07T13:25:44.690" Score="1" Body="&lt;p&gt;Could it be that your problem is only due to the $t^-$ notation convention?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Think of it that way, it is only worth distinguishing $S_{t^-}$ from $S_t$ at a jump time. Elsewhere, knowing that Brownian motion paths are &lt;em&gt;continuous&lt;/em&gt;, you'll always have $S_t = S_{t^-}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus you could also write the SDE:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac {dS_t}{S_{t^-}}  =  \alpha dt+\sigma dW_t+ d\left(Q_t-\beta\,\lambda\,t\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or simply drop the $t^-$ notation altogether if it bothers you. Just remember that we are dealing with processes with càdlàg paths (right continuous $S_t $, left limit $S_{t^-} $)&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-04-08T14:11:52.807" LastActivityDate="2016-04-08T14:11:52.807" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="25289" PostTypeId="1" CreationDate="2016-04-07T13:44:28.087" Score="4" ViewCount="1086" Body="&lt;p&gt;I am interested in pricing a stock under $\mathbb{Q}$ when I assume that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dS(t) = \mu(S(t))dt + \sigma(S(t))dW(t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W(t)$ is a Wiener process under $\mathbb{P}$ and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dr(t) = a(b-r(t))dt + \sigma(r(t))dZ(t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Z(t)$ is a Wiener process under $\mathbb{P}$. So I have real-world observations of interest rates and stock prices and want to use them to price the stock under $\mathbb{Q}$. I found in one of the papers that the differential equation for stock price will look like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dS(t) = r(t)dt + \sigma(S(t))dB(t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dr(t) = a(b-r(t))dt + \sigma(r(t))dZ(t),$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $B(t)$ is a Wiener process under $\mathbb{Q}$. But I don't understand, why the Wiener process for the Interest rate is the same as under $\mathbb{P}$. Does it mean that if I want to price the stock under $\mathbb{Q}$ is doesn't matter if my interest rates are priced under $\mathbb{Q}$ or not? Does it mean that if I price my stock under $\mathbb{Q}$ with real-world interest rates it and it is martingale, it is risk-neutral? Could you please help me?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="20222" LastEditorUserId="-1" LastEditDate="2016-04-07T17:46:21.260" LastActivityDate="2016-08-08T00:34:11.923" Title="How to price a stock under Q and stochastic interest rates?" Tags="&lt;interest-rates&gt;&lt;stochastic-processes&gt;&lt;risk-neutral-measure&gt;&lt;vasicek&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25290" PostTypeId="2" ParentId="25289" CreationDate="2016-04-07T13:59:23.173" Score="1" Body="&lt;p&gt;If you model the &lt;strong&gt;spot&lt;/strong&gt; price of the stock, then it is just the spot price (what else could be more accurate?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you model the forward price of a stock, then you most probably want to apply cost-of-carry (in order to avoid arbitrge).&#xA;If there are no dividends in your spot, then the forward price for time $T$ is&#xA;$$&#xA;F_T = S_0 rT&#xA;$$&#xA;where $r$ is a rate that applies for the time period that you analyze.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have some interest rate model, then this should give the same factor for the same period (if it is calibrated to the rate). Thus it should give the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way: you look at short-rate models. The continuous short rate does not exist - it can not be traded by itself. Just objects similar to&#xA;$$&#xA;E_Q[\exp(\int_0^T r_u du)]&#xA;$$&#xA;can be traded (FRAs). So usually the SDE for $r_t$ the short rate is under Q. And Under Q the stock price grows by the risk-free rate.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-04-07T13:59:23.173" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25291" PostTypeId="1" CreationDate="2016-04-07T15:31:46.733" Score="4" ViewCount="1101" Body="&lt;p&gt;I would like to use maximum likelihood to estimate the parameters of two correlated Ornstein-Uhlenbeck &lt;a href=&quot;https://en.wikipedia.org/wiki/Ornstein%E2%80%93Uhlenbeck_process&quot; rel=&quot;nofollow noreferrer&quot;&gt;processes&lt;/a&gt; from empirical data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you have any good references for this? If you have any hints as to how to code it in Matlab, that would also be great.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suppose I can just use the log-likelihood function for multivariate processes and then I need mean and variance of an Ornstein-Uhlenbeck process, e.g. as described in this &lt;a href=&quot;https://quant.stackexchange.com/a/4932/467&quot;&gt;answer&lt;/a&gt;. Right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, even once I have coded it in Matlab, I would still have to reference where I got the formulas from, and there it would be helpful to have some (academic) papers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am familiar with the &lt;a href=&quot;https://faculty.fuqua.duke.edu/~jes9/bio/Short-term_Long-term_Model.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;paper&lt;/a&gt; by Schwartz and Smith 2000 (Short-term variations and long-term dynamics in commodity prices, Management Science), but this one is on 1 O-U and 1 Brownian Motion.&lt;/p&gt;&#xA;" OwnerUserId="20224" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-12-15T19:26:25.723" Title="How to estimate parameters for 2 correlated Ornstein-Uhlenbeck processes with maximum likelihood?" Tags="&lt;programming&gt;&lt;mean-reversion&gt;&lt;multivariate&gt;&lt;parameter-estimation&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25293" PostTypeId="2" ParentId="25291" CreationDate="2016-04-07T16:27:14.757" Score="-2" Body="&lt;p&gt;I don't know what exactly you want but have a look at the article &lt;a href=&quot;https://www.sitmo.com/?p=134&quot; rel=&quot;nofollow noreferrer&quot;&gt;Calibrating the Ornstein-Uhlenbeck (Vasicek) model&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You calibrate the first one in stand alone, then the second one in stand alone, finally you can compute correlation on the residuals of the increments knowing your parameters.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastEditorDisplayName="user13444" LastEditDate="2016-12-15T19:26:25.723" LastActivityDate="2016-12-15T19:26:25.723" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25295" PostTypeId="1" AcceptedAnswerId="25299" CreationDate="2016-04-08T00:36:01.120" Score="2" ViewCount="124" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Consider risk-neutral trinomial model with $N$ periods presented by $$S_{(k+1)\delta}H_{k+1}, \ \ \text{for} \ \ k=0,\ldots,N-1$$&#xA;  where $\delta:=\frac{T}{N}$ and $\{H_k\}_{1}^{N}$ is a sequence of i.i.d random variables with distribution &#xA;  $$H_k = \begin{cases}&#xA;e^{\delta(r-\sigma^2/2)+\sqrt{3\delta}\sigma} \ &amp;amp;\text{with probability} \ \hat{\pi} = \frac{1}{6}\\&#xA;e^{\delta(r-\sigma^2/2)} \ &amp;amp;\text{with probability} \ 1 - \hat{\pi} = \frac{2}{3}\\&#xA;e^{\delta(r-\sigma^2/2)-\sqrt{3\delta}\sigma} \ &amp;amp;\text{with probability} \ \hat{\pi} = \frac{1}{6}\\&#xA;\end{cases}$$&#xA;  and $\hat{\pi}$ &amp;lt; 1/2. Show that as $\delta\rightarrow 0$, this trinomial model converges to the Black-Scholes model in the weak sense. Hint: Find $Z_k$ such that $\ln(H_k) = (r - \sigma^2/2)\delta + \sigma\sqrt{\delta}Z_k$. Then show (3.6)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;(3.6) states that if $\hat{\mathbb{E}}[Z_1] = o(\delta)$ and $\hat{\mathbb{E}}[Z_1^2] = 1 + o(1)$, then $\frac{1}{\sqrt{N}}\sum_{k=1}^{N}Z_k$ converges weakly to $\mathcal{N}(0,1)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Attempted solution: Let $\{Z_k\}_{1}^{N}$ be a sequence of i.i.d. random variables with the following distribution $$Z_k = \begin{cases} \alpha \ &amp;amp;\text{with probability} \ \hat{\pi}\\&#xA;-\beta \ &amp;amp;\text{with probability} \ 1-\hat{\pi}&#xA;\end{cases}$$&#xA;such that $\ln(H_k) = (r - \sigma^2/2)\delta + \sigma\sqrt{\delta}Z_k$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not really sure what to do from here, any suggestions is greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="2587" LastEditDate="2016-04-08T11:11:21.140" LastActivityDate="2016-04-08T11:11:21.140" Title="Trinomial model converges to Black-Scholes weakly" Tags="&lt;black-scholes&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25296" PostTypeId="2" ParentId="25262" CreationDate="2016-04-08T01:05:29.327" Score="0" Body="&lt;p&gt;So you are asking about what is usually called Unrealized P&amp;amp;L. There are multiple ways to do this. It can be as simple as rupweb points out, but there are some complications, for example when you have previous closed trades, or have multiple open trades at multiple prices. For some detailed information on this, including a formula you can just copy, check out &lt;a href=&quot;https://www.tradingtechnologies.com/help/fix-adapter-reference/pl-calculation-algorithm/understanding-pl-calculations/&quot; rel=&quot;nofollow&quot;&gt;TT's FIX Adapter documentation&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="16972" LastActivityDate="2016-04-08T01:05:29.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25299" PostTypeId="2" ParentId="25295" CreationDate="2016-04-08T08:45:34.777" Score="1" Body="&lt;p&gt;I think you mix up marginal law, and law of the process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your $Z_k$ must have three values, you just have to write the value of $\ln(H_k)$ for each possible value&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $X$ taking values $(x_1,x_2,...,x_n)$ and $p_i=P(X=X_i)$, then $P(f(X)=f(x_i))=\sum_{j=1}^n p_j\mathbf{1}_{f(x_j)=f(x_i)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if $f$ is a one-to-one mapping, you get $f(x_j)=f(x_i)\Rightarrow i=j$ and $P(f(X)=f(x_i))=p_i$.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-04-08T08:45:34.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25304" PostTypeId="1" AcceptedAnswerId="25317" CreationDate="2016-04-08T16:32:16.700" Score="0" ViewCount="45" Body="&lt;p&gt;I was reading an article yesterday that the Aussie/Dollar pair fell due to a sharp fall in oil prices (38.20 down to 36.70) which the market sentiment considers as &quot;Risk off&quot;, and as oil prices recovered today, so did the Aussie/Dollar pair as the market was apparently &quot;Risk on&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What makes small rising oil prices &quot;risk on&quot;? If anything i thought the Dollar would rally as fed Yellen said they are implementing a more cautious approach to rate hikes due to weaker global growth and fallen commodity prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At what point does the recovery in oil prices turn from risk on to risk off? And why is the dollar risk off? Is it still largely considered a safe haven?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;**EDIT If you feel the need to down vote can you please explain why. I'm wanting to learn, if the question or my current understanding is really bad can you please explain what i am doing wrong. Thank you&lt;/p&gt;&#xA;" OwnerUserId="20233" LastEditorUserId="20233" LastEditDate="2016-04-08T17:32:52.093" LastActivityDate="2016-04-09T05:22:00.997" Title="How does a small recovery in oil prices equate to risk appetite?" Tags="&lt;trading&gt;&lt;fundamentals&gt;" AnswerCount="1" CommentCount="3" ClosedDate="2016-04-29T11:45:47.373" ContentLicense="CC BY-SA 3.0" />
  <row Id="25305" PostTypeId="2" ParentId="25256" CreationDate="2016-04-08T17:20:58.487" Score="4" Body="&lt;p&gt;You're going to want different databases for different data. For instance, the company master, historical data, and fundamental data can probably all live in a standard SQL database (MySQL or Postgres are both reasonable choices). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the intraday data is relatively low-frequency (e.g., 1-minute bars or lower), that can probably be put into the SQL DB as well. If it's very large (e.g., tick-by-tick data from multiple exchanges), then SQL might not be a great choice. In that case, you will want to go with something like HDF5 files, or even a custom file format depending on what kind of queries you want to do. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When data gets very large, it's important to think about exactly what kind of queries you're going to be running on it, and then optimize the data structure (backend, file format, column layout, etc) to suit your queries.&lt;/p&gt;&#xA;" OwnerUserId="5251" LastActivityDate="2016-04-08T17:20:58.487" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25307" PostTypeId="2" ParentId="25224" CreationDate="2016-04-08T17:31:20.333" Score="3" Body="&lt;p&gt;Remember that all back testing is full of &lt;del&gt;lies&lt;/del&gt; assumptions. Latency (both line latency and latency internal to the exchanges), adverse selection, market impact (yes, even you have market impact), etc, are all based on assumptions. These assumptions are educated guesses at best, but more often terrible models are used (you always get filled at at mid!) and they're totally hidden from you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best choice, if you have the capability, is to choose your execution platform and then tweak an existing backtesting framework to match the behavior you observe in live trading (or build a backtesting framework from scratch if necessary). If you're worried about API compatibility, use a &lt;a href=&quot;https://www.wikiwand.com/en/Facade_pattern&quot; rel=&quot;nofollow&quot;&gt;facade&lt;/a&gt; or &lt;a href=&quot;https://www.wikiwand.com/en/Adapter_pattern&quot; rel=&quot;nofollow&quot;&gt;adapter&lt;/a&gt; to make the backtesting and execution APIs look the same.. &lt;/p&gt;&#xA;" OwnerUserId="5251" LastActivityDate="2016-04-08T17:31:20.333" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25308" PostTypeId="2" ParentId="675" CreationDate="2016-04-08T17:57:59.127" Score="-2" Body="&lt;p&gt;Say you want to optimize for max sharpe ratio, you could do something like this with scipy:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import scipy.optimize as spopt &#xA;&#xA;allocations = [] #allocations&#xA;&#xA;def Sharpe():  #An  function to compute Sharpe ratio, return negative SR&#xA;&#xA;    compute Sharpe_Ratio&#xA;&#xA;    return -1*Sharpe_Ratio&#xA;&#xA;bnd = [] #bounds&#xA;&#xA;cns [] #constraints&#xA;&#xA;result = spopt.minimize(Sharpe, allocations, method = 'SLSQP',bounds = bnd, constraints = cns)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="20238" LastActivityDate="2016-04-08T17:57:59.127" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25310" PostTypeId="1" AcceptedAnswerId="25314" CreationDate="2016-04-08T20:09:54.670" Score="2" ViewCount="3640" Body="&lt;p&gt;I encounter a problem in one of my project to find the 1 year, 2 year and 3 year Asset volatility. We are given 2015 Bell Canada's financial report and a software to do this. The financial report can be found here &lt;a href=&quot;http://www.bce.ca/investors/financialperformance/annual&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.bce.ca/investors/financialperformance/annual&lt;/a&gt;   where asset=47993M, liability=30664M  equity=17329M, stock volatility= 15%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to my lecture notes, we should do the following steps:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;input data from the financial report into software to find Delta for 1,3,5 year(bottom left section), assuming no dividend &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;using the formula σS&lt;em&gt;S =σV&lt;/em&gt;V*(∂S/∂V), plug in value of delta into ∂S/∂V  and find σV for 1, 3, 5 year.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;However, I do not know what data I should put into the software. In the lecture, I see my prof first uses   # of share outstanding* share price=S(equity), and use equity debt ratio to find B(debt) then he put V=B+S(total asset) into the section 'stock price', the given stock volatility into 'volatility', Ke^(rt) (the future debt) into 'exercise price'. Then he compute delta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't quite understand why he did this. Can anyone explain to me what kind of data I should use(market value of equity/book value of equity, market value of asset/book value of asset, market value of debt/book value of debt)? I am really confused.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much.&#xA;&lt;a href=&quot;https://i.stack.imgur.com/H0GlO.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/H0GlO.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20240" LastActivityDate="2016-04-09T19:55:47.507" Title="How to find volatility of Asset given volatility of Stock in Merton model?" Tags="&lt;merton-model&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25311" PostTypeId="1" AcceptedAnswerId="25695" CreationDate="2016-04-08T20:25:14.250" Score="2" ViewCount="245" Body="&lt;p&gt;I can't figure out the logic behind SPX option data for 2008-2009 years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, all traditional SPX options have exp_date on the third &lt;em&gt;Saturday&lt;/em&gt; of each month. How can it be? Why not Friday?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, I have traditional and end-of-month option series, but not Weeklys. Is my dataset incomplete, or were they not introduced back then?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Third, the list of exp_dates doesn't make any sense to me. For example, on 17-Jun-2008 I have traditional options with expirations in: Jun 08, Jul 08, Aug 08, Sep 08, Dec 08, Mar 09, Jun 09, Dec 09 and Dec 10. And EOM options expiring in Jun 08, Sep 08, Dec 08, Mar 08. How does CBOE decide, which options to list?&lt;/p&gt;&#xA;" OwnerUserId="17976" LastActivityDate="2016-04-28T21:14:49.153" Title="Old CBOE SPX options data: listing and expdate issue" Tags="&lt;options&gt;&lt;data&gt;&lt;spx&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25314" PostTypeId="2" ParentId="25310" CreationDate="2016-04-08T21:45:27.747" Score="1" Body="&lt;p&gt;The delta of an option is the amount the option value will change according to the change in the underlying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Book value of a company is typically it's assets minus liabilities. This can differ from market value (which is the share price * number of shares outstanding).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The picture you provided looks like an option calculator, with inputs:&lt;br&gt;&#xA;Stock price, Volatility, Risk Free Rate, and Dividends (top left)&lt;br&gt;&#xA;Option details - time to expiry, strike, call/put (middle left)&lt;br&gt;&#xA;and outputs of option price, Greeks, and a graph on the right.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I realise now you mean Merton model (credit risk), so...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Equity can be viewed as a European call option on the firm's assets&quot;... and as inputs we need &quot;current value of the company’s assets, the volatility of the company’s assets, the outstanding debt and the debt maturity.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically from &lt;a href=&quot;http://www-2.rotman.utoronto.ca/~hull/downloadablepublications/mertonsmodelandvolatilityskews.pdf&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; paper:&lt;br&gt;&#xA;Let E = value of the firm's Equity, and A = value of assets, and D be debt. Then &#xA;$E_T = max[A_T – D, 0]$&#xA;and we can view equity as a call option on the assets of the firm with strike price equal to the promised debt payment...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think &lt;a href=&quot;https://www.bionicturtle.com/forum/threads/merton-model-a-summary-of-the-issues.5646/&quot; rel=&quot;nofollow&quot;&gt;this summary&lt;/a&gt; will be of most help to you...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;$V(0) = D(0) + E(0)$&quot; - as your professor did. Adding equity and debt to get the firm's asset value.&lt;/p&gt;&#xA;" OwnerUserId="17303" LastEditorUserId="17303" LastEditDate="2016-04-09T03:19:15.903" LastActivityDate="2016-04-09T03:19:15.903" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25316" PostTypeId="1" AcceptedAnswerId="25319" CreationDate="2016-04-09T00:32:45.833" Score="1" ViewCount="356" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/6oEL9.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/6oEL9.jpg&quot; alt=&quot;example graph&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With reference to the figure above, why is it that the price at which the stock closed at on monday not equal to the open price on tuesday?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this discontinuity due to an adjustment in the price to make up for pre/post market volume? If not then why does this occur?&lt;/p&gt;&#xA;" OwnerUserId="20245" LastActivityDate="2016-04-09T03:32:25.657" Title="What causes discontinuities with stock prices" Tags="&lt;time-series&gt;&lt;finance&gt;&lt;pricing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25317" PostTypeId="2" ParentId="25304" CreationDate="2016-04-09T00:42:18.873" Score="0" Body="&lt;p&gt;Although they are often used in the media, there is no precise definition for terms like risk-on/risk-off, market sentiment, risk appetite and so on. Usually a risk-on day is simply a day when the stock market went up, and similarly for a day of &quot;increasing risk appetite&quot;. Generally the possibility of rate hikes raises the dollar, but not always. So the article you read is not very scientific or quantitative and in any case was written AFTER the fact when explanations are always easy. Ask the author what will happen next and he will be baffled...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will have noticed that in recent months stocks and oil have tended to move together so of course that means that oil goes up on &quot;risk-on-days&quot; since that is how risk-on is defined. LOL. But that is not really saying anything. And a few years ago I distinctly recall that oil and stocks used to move in opposite directions; whether that will happen again and at what price level nobody knows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no point in trying to get a deep understanding of all this, it is simply a journalist's opinion and ex-post rationalization using fancy words.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-04-09T05:22:00.997" LastActivityDate="2016-04-09T05:22:00.997" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25319" PostTypeId="2" ParentId="25316" CreationDate="2016-04-09T03:32:25.657" Score="2" Body="&lt;p&gt;Typically due to news overnight, and sometimes, as you suggest, after hours trading. The stock prices you see in the chart are the prices at which trades occurred. Trades are discrete events, at discrete prices. The discontinuities you see in the chart are simply due to the market agreeing a different price on the following day. Those discontinuities occur intraday too, however, they are not as visible simply due to the way the chart is drawn - with connecting lines between the prices.&lt;/p&gt;&#xA;" OwnerUserId="17303" LastActivityDate="2016-04-09T03:32:25.657" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25320" PostTypeId="1" AcceptedAnswerId="25321" CreationDate="2016-04-09T08:04:17.500" Score="2" ViewCount="361" Body="&lt;p&gt;What does the following statement mean: &quot;after accounting for levels of market volatility, we favor receiving outright in 6-month forward-starting 2-year swaps.&quot;? Specifically, what does &quot;receiving outright&quot; mean? Is there a way for you to receive only the forward points? Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="6722" LastActivityDate="2016-04-11T07:22:59.363" Title="What does it mean to 'receive outright'?" Tags="&lt;fx&gt;&lt;terminology&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25321" PostTypeId="2" ParentId="25320" CreationDate="2016-04-09T10:39:21.923" Score="1" Body="&lt;p&gt;Receiving outright simply means receiving the fixed rate versus LIBOR on the 6 month forward starting 2 year swap.  The term 'outright' is unnecessary here - it is probably being used to compare with a potential strategy of receiving the fixed on a 6 month forward starting 2yr swap &lt;em&gt;versus&lt;/em&gt; paying fixed on a spot starting 2yr swap.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-04-09T10:39:21.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25323" PostTypeId="2" ParentId="25284" CreationDate="2016-04-09T10:52:11.817" Score="1" Body="&lt;p&gt;How about letting the FX rates remain fixed, and recalculate the portfolio volatility.  That seems very obvious - am i missing something?&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-04-09T10:52:11.817" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25325" PostTypeId="1" CreationDate="2016-04-09T11:53:59.487" Score="1" ViewCount="20" Body="&lt;p&gt;How we can use adjusted price in combination with price limit in stock market? suppose that we have a price limit in a stock market. For example if yesterday last price is &lt;code&gt;X&lt;/code&gt;, today price range for training is &lt;code&gt;X-a%&lt;/code&gt; and &lt;code&gt;X+a%&lt;/code&gt;. We don't have any problem when we are using non-adjusted prices but when we use adjusted prices (as a time series) and using below formula (for example for today open price):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;today_open_price_change = (P(today_open_price)-P(yesterday_close_price)/P(yesterday_close_price)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In a time series we have values bigger  than &lt;code&gt;a%&lt;/code&gt; (price limit percentage). How we should adjust this percentage (&lt;code&gt;a%&lt;/code&gt;) for adjusted price time series?&lt;/p&gt;&#xA;" OwnerUserId="8234" LastActivityDate="2016-04-09T11:53:59.487" Title="How we can use adjusted price in combination with price limit in a stock market?" Tags="&lt;adjusted&gt;&lt;financial-markets&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25326" PostTypeId="2" ParentId="20704" CreationDate="2016-04-09T12:22:19.210" Score="0" Body="&lt;p&gt;$\alpha$ units of cash and $\beta$ bonds? Presumably you mean 'value' rather than 'return', since the SDF is not a percentage return but a 'discount factor'. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-04-09T12:22:19.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25327" PostTypeId="1" CreationDate="2016-04-09T13:36:25.543" Score="0" ViewCount="94" Body="&lt;p&gt;Would anyone else advise me, how to create time series with lagged in R.&#xA;I would the result is the difference with lagged, there is a function Delt() but the result is the percentage change. Please advise how to do that. Thank you&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;getSymbols(&quot;^GSPC&quot;)&#xA;DeltLagGSPC&amp;lt;-Delt(Cl(GSPC),k=1:5)   &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;update&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would calculate the computed result with the successive difference. The output format of Delt() is same as I expected, but the result is the percentage change with lagged. I would calculate the difference with lagged. Is there any function, same parameters as Delt() but calculate the difference change.&lt;/p&gt;&#xA;" OwnerUserId="17557" LastEditorUserId="17557" LastEditDate="2016-04-10T00:00:23.780" LastActivityDate="2016-04-10T00:00:23.780" Title="How to create time series with lagged in R" Tags="&lt;time-series&gt;&lt;r&gt;" AnswerCount="1" CommentCount="3" ClosedDate="2016-04-09T16:45:49.370" ContentLicense="CC BY-SA 3.0" />
  <row Id="25328" PostTypeId="2" ParentId="25327" CreationDate="2016-04-09T16:18:02.413" Score="1" Body="&lt;p&gt;Look at the function &quot;lag&quot; and if you want a lag function that does not depend on some time series structure of the object then you can use this one:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;shift&amp;lt;-function(x,shift_by){&#xA;  stopifnot(is.numeric(shift_by))&#xA;  stopifnot(is.numeric(x))&#xA;&#xA;  if (length(shift_by)&amp;gt;1)&#xA;    return(sapply(shift_by,shift, x=x))&#xA;&#xA;  out&amp;lt;-NULL&#xA;  abs_shift_by=abs(shift_by)&#xA;  if (shift_by &amp;gt; 0 )&#xA;    out&amp;lt;-c(tail(x,-abs_shift_by),rep(NA,abs_shift_by))&#xA;  else if (shift_by &amp;lt; 0 )&#xA;    out&amp;lt;-c(rep(NA,abs_shift_by), head(x,-abs_shift_by))&#xA;  else&#xA;    out&amp;lt;-x&#xA;  out&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I prefer it in the meanwhile. It was taken from &lt;a href=&quot;https://stackoverflow.com/questions/28432599/lag-in-r-vector-dataframe&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2016-04-09T16:18:02.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25329" PostTypeId="1" AcceptedAnswerId="25330" CreationDate="2016-04-09T17:03:00.693" Score="13" ViewCount="24247" Body="&lt;p&gt;I have a simple (and might be a dumb) question regarding the calculation of a bond's carry. If someone doesn't take into account cost of financing (e.g. the repo rate) then the bond's approximate return over a short time period is carry (coupon return + pull to par) plus roll-down return:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;r\approx C\delta t +(y-C)\delta t -D\delta y&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But on bloomberg and on several forums I frequently stumbled into the following expression for carry:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\text{carry} = \text{forward yield} - \text{spot yield}&#xA;$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could somebody please clarify or derive what's the logic behind this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="4921" LastEditorUserId="11723" LastEditDate="2018-08-23T22:42:16.623" LastActivityDate="2020-04-12T17:52:20.023" Title="question regarding carry &amp; roll of a bond" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;bond&gt;&lt;yield&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="25330" PostTypeId="2" ParentId="25329" CreationDate="2016-04-09T17:19:24.090" Score="6" Body="&lt;p&gt;The formula you quote (forward minus spot) is the yield carry for a &lt;strong&gt;financed&lt;/strong&gt; position. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that different people use the word carry to mean different things. The most commonly used convention, at least when we prepare analytical reports and quote sheets, is to use the word &quot;Carry&quot; to refer to the breakeven measure – it tells us how much yield can increase before a financed position starts to lose money. And of course, if spot yield rises to the forward yield, that's when it happens. (If you write out the math, you'll also see this is basically coupon income + pull-to-par - financing cost, in yield terms).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Rolldown&quot; is typically tabulated separately, and the sum of Carry and Rolldown (usually written as &quot;RD&amp;amp;C&quot;) is the complete measure of how much I expect to make from a financed position, assuming an unchanged yield curve.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2016-04-09T17:19:24.090" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="25332" PostTypeId="2" ParentId="25284" CreationDate="2016-04-09T21:54:40.023" Score="0" Body="&lt;p&gt;If a USD based investor owns shares of Toyota Motor in Japan, the variance of USD based returns is approximately equal to the variance of Toyota in yen, plus the variance of USDJPY plus twice the covariance between Toyota and the exchange rate. The last term could be positive or negative; if I had to guess for a big exporter like Toyota it is probably slightly negative.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-04-09T23:44:54.903" LastActivityDate="2016-04-09T23:44:54.903" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25334" PostTypeId="1" CreationDate="2016-04-10T08:27:41.987" Score="2" ViewCount="81" Body="&lt;p&gt;For an exercise we have to calculate the theoretical value of a scrip / preferential right on its issue day (23 April) in the context of a capital increase. The scrips are issued on 23 April. The closing price of the stock on that day is 4.70 euro, while the closing price of 22 April is 5.35. A dividend of 0.20 is paid on 23 April. The theoretical equilibrium price is 4.2833 based on the ex-dividend price of 22 April, 5.15 euro.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have seen the following formula, to calculate the scrip price based on the price of a call option, which in turn we have to calculate through Black-Scholes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P(scrip)=(\frac{1}{1+q})*P(calloption)$ with q the dilution factor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When calculating P(calloption) through Black-Scholes, which price do you use as the current stock price? 5.15? 4.2833? or 4.70?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(If this is not the right place to ask this question, please refer me to the right website)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance&lt;/p&gt;&#xA;" OwnerUserId="20258" LastEditorUserId="16160" LastEditDate="2016-04-10T18:22:15.737" LastActivityDate="2016-04-10T18:22:15.737" Title="Capital increase: which stock price to use as input to Black-Scholes formula?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;equities&gt;&lt;black-scholes&gt;&lt;corporate-actions&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25336" PostTypeId="1" AcceptedAnswerId="25337" CreationDate="2016-04-10T19:14:55.053" Score="0" ViewCount="54" Body="&lt;p&gt;I am learning the basics of portfolio management. I am confused about different ways to calculate  rate of returns mentioned in the text investment and portfolio analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are three methods to calculate rate of return&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;mean of last n years returns&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Through CAPM and Asset pricing theory&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;Based on stock valuation and forecasting of earnings&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So which one we should use and when, especially while  trying to find optimal portfolio weights&lt;/p&gt;&#xA;" OwnerUserId="15281" LastActivityDate="2016-04-10T21:05:35.000" Title="Which rate of return to use in portfolio weight estimation?" Tags="&lt;portfolio-management&gt;&lt;returns&gt;&lt;expected-return&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25337" PostTypeId="2" ParentId="25336" CreationDate="2016-04-10T20:52:59.713" Score="1" Body="&lt;p&gt;Each of these can be used, but each has serious drawbacks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No. 1 is inaccurate unless you use $N&amp;gt;&amp;gt;10$ years of data. But decades of data may not be available or may no longer be relevant to today's economy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No. 2 is good except that the CAPM has been rejected by empirical tests. More advanced models from Asset Pricing Theory may be helpful (FF3, FF5, HXZ [Hou, Xue, Zhang]) but are controversial.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No. 3 requires forecasts of earnings for 1 or more years and long term growth rates (past the forecast horizon), which are difficult to make with suitable accuracy.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-04-10T21:05:35.000" LastActivityDate="2016-04-10T21:05:35.000" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25339" PostTypeId="2" ParentId="25103" CreationDate="2016-04-10T22:40:14.553" Score="3" Body="&lt;p&gt;I hope this helps - the Core US Fundamentals database on Quandl (&lt;a href=&quot;https://www.quandl.com/data/SF1&quot; rel=&quot;nofollow&quot;&gt;https://www.quandl.com/data/SF1&lt;/a&gt;) covers 6,500+ companies, point-in-time, inc/exc restatements, active/delisted, up to 11 years history, 101 indicators, expanding coverage, daily updates. There's data for balance sheets, income statements, cash flow etc. &lt;/p&gt;&#xA;" OwnerUserId="19252" LastActivityDate="2016-04-10T22:40:14.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25340" PostTypeId="2" ParentId="24971" CreationDate="2016-04-10T22:45:25.770" Score="1" Body="&lt;p&gt;Don't know if this is quite what you're after, but I hope it helps. On Quandl, there's a database called Dow Jones Industrial Average One Minute Bars (&lt;a href=&quot;https://www.quandl.com/data/ASINDU/documentation/overview&quot; rel=&quot;nofollow&quot;&gt;https://www.quandl.com/data/ASINDU/documentation/overview&lt;/a&gt;). It shows intraday quotes for all stocks in the Dow Jones Industrial Average. Trade-based minute bars showing OHLCV for every stock every day. Daily updates plus five years of history. Includes all index changes.&lt;/p&gt;&#xA;" OwnerUserId="19252" LastActivityDate="2016-04-10T22:45:25.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25342" PostTypeId="1" AcceptedAnswerId="25357" CreationDate="2016-04-11T00:45:20.343" Score="1" ViewCount="1431" Body="&lt;p&gt;I'm wondering how can I find PCA hedge ratio for a 3-leg spread? I've taken the simple steps laid out in &lt;a href=&quot;http://quantdevel.com/public/betterHedgeRatios.pdf&quot; rel=&quot;nofollow&quot;&gt;here.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've taken some treasury futures data for 2yr,5yr,10yr and ran the PCA. The first eigenvector correspond to parallel shift hedge, the second to slope hedge, the third to curvature hedge. I'm wondering how would I use the PCA to calculate a hedge ratio that is hedged to parallel shift and slope?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="13375" LastActivityDate="2016-04-11T15:19:06.633" Title="Calculating PCA hedge ratio for 3-leg spread" Tags="&lt;futures&gt;&lt;pca&gt;&lt;hedge&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25343" PostTypeId="2" ParentId="24868" CreationDate="2016-04-11T02:54:13.243" Score="-1" Body="&lt;p&gt;Have you tried searching at Quandl here: &lt;a href=&quot;https://www.quandl.com/search?query=msci&amp;amp;type=all&quot; rel=&quot;nofollow&quot;&gt;https://www.quandl.com/search?query=msci&amp;amp;type=all&lt;/a&gt; (Quandl also has flexible pricing plans for individual users, not just companies)&lt;/p&gt;&#xA;" OwnerUserId="19252" LastActivityDate="2016-04-11T02:54:13.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25344" PostTypeId="2" ParentId="24799" CreationDate="2016-04-11T03:04:53.747" Score="-2" Body="&lt;p&gt;There is a database from Quandl that shows EOD prices for stocks traded in the TSX and if you go to the documentation part of the database here &lt;a href=&quot;https://www.quandl.com/data/XTSE/documentation/documentation&quot; rel=&quot;nofollow&quot;&gt;https://www.quandl.com/data/XTSE/documentation/documentation&lt;/a&gt;, you can click on the link where it says &quot;A full list of all stocks in this database, along with their ticker symbols, can be downloaded here.&quot; This lets you ownload the list of over 4000 companies trading stocks in the TSX. I don't think it shows the sector or industry of each company though...&lt;/p&gt;&#xA;" OwnerUserId="19252" LastActivityDate="2016-04-11T03:04:53.747" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25345" PostTypeId="1" AcceptedAnswerId="25376" CreationDate="2016-04-11T04:59:00.583" Score="0" ViewCount="1016" Body="&lt;p&gt;If you are long a FRA (forward rate agreement) and short a ED　（Eurodollars) future with the same fixing dates, do you have positive convexity or negative convexity? Why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to the following thread a Eurodollar future has no convexity and the FRA has positive convexity.  Why is this true?  Or if it's not true, why is it not true?&#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/22376/long-forward-rate-agreement-short-eurodollar-futures&quot;&gt;Long Forward Rate Agreement, short Eurodollar futures&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think that the answer is you will have a negative convexity because the convexity adjustment would make a long future have a higher convexity than the FRA.  Can anyone tell me if my logic and answer is right? &lt;/p&gt;&#xA;" OwnerUserId="20256" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-05-28T13:34:46.953" Title="long fra and a short ed future with same fixing dates, is convexivity negative or positive?" Tags="&lt;futures&gt;&lt;convexity&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25346" PostTypeId="2" ParentId="25320" CreationDate="2016-04-11T07:22:59.363" Score="0" Body="&lt;p&gt;I've heard this phrase thrown around in the Forex market. There is a locked-in exchange rate and delivery date in these cases. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of companies, large purchases are made from foreign business that utilize outright forward contracts to cover costs. For instance, when a US company buys materials from a Mexican supplier they could be required to make a payment for half of the total value of the payment and the other half in about six months. &#xA;In order to minimize currency risk exposure, a spot trade is used to cover the first payment. An outright forward is then used to lock in the exchange rate and the agreed-upon rate can be used in six months. &lt;/p&gt;&#xA;" OwnerUserId="20269" LastActivityDate="2016-04-11T07:22:59.363" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25347" PostTypeId="1" CreationDate="2016-04-11T09:10:43.010" Score="2" ViewCount="245" Body="&lt;p&gt;Can any assumptions be made about the pay-off of an exotic option? For example, might we say the distribution of the &lt;em&gt;pay-off&lt;/em&gt; a vanilla option would be Normal? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have built a valuation tool that estimates the price of a replicating delta-hedging strategy through Monte Carlo methods by trading the structure of a forward curve. It seems that a histogram of the pay-offs have two relative maximums. Can anyone explain this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are options (/ real options) &lt;strong&gt;prices&lt;/strong&gt; logNormally distributed, or does the standard assumption not hold given convexity?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="19365" LastEditorUserId="19365" LastEditDate="2016-04-11T09:26:55.770" LastActivityDate="2016-12-23T17:49:52.867" Title="Distribution of pay-off of an exotic option" Tags="&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;distribution&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25349" PostTypeId="1" CreationDate="2016-04-11T11:19:03.940" Score="1" ViewCount="419" Body="&lt;p&gt;I am backtesting a number of trading strategies using a feed of unadjusted data from Factset. Before I run the backtest my routines adjust the data for splits and for special dividends.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One question that has come up is should I also be adjusting the data for dividends as well? So far I have seen 3 arguments:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Yes you should adjust.&lt;/li&gt;&#xA;&lt;li&gt;No you shouldn't adjust as technical analysis algorithms will be using incorrect data.&lt;/li&gt;&#xA;&lt;li&gt;You shouldn't adjust while generating opening and closing positions but should adjust for working out total return &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I'd be grateful for any thoughts on the matter.&lt;/p&gt;&#xA;" OwnerUserId="16279" LastActivityDate="2016-04-15T19:41:08.803" Title="Backtesting and dividend adjustments" Tags="&lt;backtesting&gt;&lt;dividends&gt;&lt;adjusted&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25350" PostTypeId="1" CreationDate="2016-04-11T12:05:29.823" Score="0" ViewCount="168" Body="&lt;p&gt;Say that I observe a predictor $w_t \sim N(0,\sigma_1)$ for the returns in a single asset over the next time interval:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ r_t = \alpha w_{t-1} + z_t $$&#xA;where $z_t \sim N(0,\sigma_2)$ is unobserved and independent of $w_{t-1}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to find the function $f$ that maps $w_t$ to a position in the asset which maximizes the expected Sharpe Ratio of the next $n$ trading returns:&#xA;$$\max_f \mathrm{E}\left[\frac{\sqrt{n}\sum_{i=1}^n p_i}{n \sqrt{\sum_{i=1}^n \left(p_i - \overline{p_i}\right)^2}} \right]$$&#xA;where the profit at time step $t$ is&#xA;$$p_t = r_t f(w_{t-1}) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an easy way using something like stochastic control to find the optimal $f$ without any constraints on its structure?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: As pointed out by Chris, I had oversimplified the problem by only looking at a single-step.  I've modified the description to make it n-step. &lt;/p&gt;&#xA;" OwnerUserId="2303" LastEditorUserId="2303" LastEditDate="2016-04-11T15:14:14.853" LastActivityDate="2016-04-11T15:14:14.853" Title="Closed-form solution to optimal single assset position sizing with predicted returns" Tags="&lt;portfolio-optimization&gt;&lt;stochastic-control&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25351" PostTypeId="1" CreationDate="2016-04-11T13:20:52.723" Score="1" ViewCount="1888" Body="&lt;p&gt;I`m new to programming and searching a package for R which inherents the estimation for a Vech Garch(1,1). This is a multivariate Garch model which forms the residuals and the covariance matrix from a NxN matrix to a N(N+1)/2 vector. I can only find DCC and BEKK estimation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does somebody know a package or source of code for this estimation?&lt;/p&gt;&#xA;" OwnerUserId="18848" LastActivityDate="2016-06-09T19:08:20.640" Title="Package for multivariate Garch Vech model for R?" Tags="&lt;r&gt;&lt;garch&gt;&lt;estimation&gt;&lt;multivariate&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="25352" PostTypeId="2" ParentId="25350" CreationDate="2016-04-11T14:03:01.367" Score="2" Body="&lt;p&gt;As you have defined the Sharpe ratio, it is independent of your position. You have&#xA;$$&#xA;\mathrm{E}[rf(z_1)] = \alpha z_1 f(z_1)&#xA;$$&#xA;and&#xA;$$&#xA;\mathrm{Var}[rf(z_1)] = \sigma_2^2f(z_1)^2&#xA;$$&#xA;and hence&#xA;$$&#xA;\frac{\mathrm{E}[rf(z_1)]}{\sqrt{\mathrm{Var}[rf(z_1)]}} = \frac{\alpha z_1}{\sigma_2}&#xA;$$&#xA;independent of the function $f(z_1)$.&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2016-04-11T14:03:01.367" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25353" PostTypeId="2" ParentId="25347" CreationDate="2016-04-11T14:14:47.113" Score="0" Body="&lt;p&gt;Let's take a call option on a stock with exercise price $K$.  What is the risk-neutral probability of a payoff $x$?&lt;br&gt;&#xA;$$P(x=0) = P(\text{stock} \le K)$$&lt;br&gt;&#xA;Also we have $P(\text{payoff} = x &amp;gt; 0) = P(\text{stock}=x+K)$.  Hence the required density function $f$ has two parts,&lt;br&gt;&#xA;(a) an accumulation point at zero representing the probability of being out of the money and&lt;br&gt;&#xA;(b) a truncated part of the stock distribution.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will indeed give a bimodal distribution if the call is out of the money.   &lt;/p&gt;&#xA;" OwnerUserId="18388" LastEditorDisplayName="user13444" LastEditDate="2016-12-23T17:49:52.867" LastActivityDate="2016-12-23T17:49:52.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25354" PostTypeId="1" AcceptedAnswerId="25362" CreationDate="2016-04-11T14:33:39.813" Score="4" ViewCount="1619" Body="&lt;p&gt;I would like to calibrate the Heston model and I am wondering which are the most common approaches used in the literature. Any suggestions (references from the main stream literature, notes or presentations) is greatly appreciated. &lt;/p&gt;&#xA;" OwnerUserId="18063" LastActivityDate="2016-04-11T20:39:02.617" Title="Calibration of Heston model" Tags="&lt;calibration&gt;&lt;heston&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25356" PostTypeId="2" ParentId="25347" CreationDate="2016-04-11T14:36:00.797" Score="1" Body="&lt;p&gt;In general, an option payoff cannot be normal, as the payoff is generally positive, while a normal variable can be negative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a standard call option, the distribution function can be computed from the distribution of the underlying stock. Specifically, consider the vanilla European option payoff $X=(S_T-K)^+$. Then, for $x &amp;lt; 0$,&#xA;\begin{align*}&#xA;P(X \le x) = 0,&#xA;\end{align*}&#xA;while for $x&amp;gt;0$,&#xA;\begin{align*}&#xA;P(X \le x) &amp;amp;= P(S_T \le K+x),&#xA;\end{align*}&#xA;which can be computed, if the distribution of $S_T$ is given. &lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-04-11T14:45:59.743" LastActivityDate="2016-04-11T14:45:59.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25357" PostTypeId="2" ParentId="25342" CreationDate="2016-04-11T15:19:06.633" Score="3" Body="&lt;p&gt;Let's use the following returns matrix, &lt;em&gt;X&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; 2Y        5Y        10Y&#xA; --------------------------&#xA; 0.0143    0.0910    0.1451&#xA; 0.1791    0.3505    0.4588&#xA; 0.0572    0.1358    0.0120&#xA; 0.0357    0.1809    0.2884&#xA;-0.0571   -0.1096   -0.0719&#xA; 0.0286    0.0710    0.1319&#xA; 0.0429    0.1806    0.2754&#xA;-0.0357   -0.0579   -0.1075&#xA; 0.0714    0.2513    0.4304&#xA;-0.0214   -0.0771   -0.1667&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first PCA eigenvector is (0.2, 0.55, 0.8) corresponding to a shift, and the second eigenvector is (0.55, 0.62, -0.56) corresponding to a change in the slope.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The third eigenvector is (0.81, -0.55, 0.17) which by construction is orthogonal to the first two, and is therefore hedged against changes in both the level and slope of the curve - any portfolio with holdings proportional to this eigenvector will be hedged in the way you describe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously if you use more data, you will get a more reliable estimate of the PCA eigenvectors and a more effective hedge.&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2016-04-11T15:19:06.633" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="25358" PostTypeId="1" CreationDate="2016-04-11T18:08:59.707" Score="4" ViewCount="124" Body="&lt;p&gt;I am paid 20 million every time a bond drops to a new low over a 120 month period. I need to know how to find the present value of such an arrangement if there is a continuously compound interest of 5 percent. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additional information:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The bond starts at a A rating and is only paid the first time it reaches any rating lower than A. So A -&gt; AA-&gt; A-&gt; B-&gt;CCC would pay 40 million.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am given the following probability transition matrix (the probability of the rating on the left becoming the rating on the right):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   p[AAA][AAA] = 0.9725; p[AAA][AA] = 0.0275;&#xA;   p[AA][AAA] = 0.0020; p[AA][AA] = 0.9742; p[AA][A] = 0.0238;&#xA;   p[A][AA] = 0.0020; p[A][A] = 0.9825; p[A][BBB] = 0.0155;&#xA;   p[BBB][A] = 0.0073; p[BBB][BBB] = 0.9819; p[BBB][BB] = 0.0108;&#xA;   p[BB][BBB] = 0.0030; p[BB][BB] = 0.9783; p[BB][B] = 0.0187;&#xA;   p[B][BB] = 0.0010; p[B][B] = 0.9751; p[B][C] = 0.0239;&#xA;   p[C][B] = 0.0066; p[C][C] = 0.9852; p[C][D] = 0.0082;&#xA;   p[D][D] = 1.0;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When the bond reaches a rating of D, the bond defaults and cannot recover from that position thus the swap arrangement is closed and we receive the most money possible at $100 million. Otherwise the arrangement continues until the bond matures at 120 months. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need to find a fair monthly premium, which I believe involves finding the present value of this arrangement.&lt;/p&gt;&#xA;" OwnerUserId="17787" LastActivityDate="2016-04-11T18:08:59.707" Title="How do I calculate the present value of a credit default swap?" Tags="&lt;finance&gt;&lt;probability&gt;&lt;finance-mathematics&gt;" AnswerCount="0" CommentCount="6" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25359" PostTypeId="1" CreationDate="2016-04-11T18:15:12.717" Score="2" ViewCount="325" Body="&lt;p&gt;When S&amp;amp;P 500 has a component change is the change made before market open or after the close. For example on March 3rd announement by S&amp;amp;P that UDR replacing GMCR after close of trading on Friday March 4th:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.spice-indices.com/idpfiles/spice-assets/resources/public/documents/313547_gmcrudrhr546prlb.pdf?force_download=true&quot; rel=&quot;nofollow&quot;&gt;https://www.spice-indices.com/idpfiles/spice-assets/resources/public/documents/313547_gmcrudrhr546prlb.pdf?force_download=true&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I am using a list of changes to the S&amp;amp;P 500, can I assume all changes are made after the close of the trading day ?&lt;/p&gt;&#xA;" OwnerUserId="19051" LastActivityDate="2017-05-08T15:30:30.383" Title="Timing of S&amp;P 500 Component Changes - Pre or Post Market?" Tags="&lt;index&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25360" PostTypeId="2" ParentId="25359" CreationDate="2016-04-11T19:09:34.100" Score="0" Body="&lt;p&gt;In general, it depends on your index provider. In the announcements like yours, it's stated explicitly. In practice, ETF Authorized Participants (AP's) just get the updated baskets from their provider between the close and next day open, so it doesn't really matter.&lt;/p&gt;&#xA;" OwnerUserId="1552" LastEditorUserId="16160" LastEditDate="2017-02-06T03:32:35.510" LastActivityDate="2017-02-06T03:32:35.510" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25361" PostTypeId="2" ParentId="18836" CreationDate="2016-04-11T20:38:03.777" Score="2" Body="&lt;p&gt;Johansen test estimates the rank (r) of given matrix of time series with confidence level. &#xA;In your example you have 2 time series, therefore Johansen tests null hypothesis of r=0 &amp;lt; (no cointegration at all), r&amp;lt;1 (till n-1, where n=2 in your example). If r&amp;lt;=1 test value (6.39) was greater than a confidence level's value (say 10%: 7.52), we would assume there is a cointegration of r time series (in this case r&amp;lt;=1). But as you see, none of your test values are greater than than critical values at r&amp;lt;0 and r&amp;lt;=1, therefore there is no cointegration. &lt;/p&gt;&#xA;" OwnerUserId="16814" LastEditorUserId="16814" LastEditDate="2016-04-11T20:53:35.100" LastActivityDate="2016-04-11T20:53:35.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25362" PostTypeId="2" ParentId="25354" CreationDate="2016-04-11T20:39:02.617" Score="3" Body="&lt;p&gt;If you want to calibrate on time series, then you have a 'non linear filtering' problem, since volatility is latent. There have been papers from late 90s/ early 00s that do that: Google for Heston together with Ghysels, Gallant, Renault, Chernov, Tauchen, Pan, Bates, Shephard, MCMC, unscented Kalman filter/ particle filter. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the significant complexity though, you should understand your motivation and requirements. Ask yourself why calibrate Heston on time series? Why a more straightforward Garch variant is not sufficient?&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-04-11T20:39:02.617" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25364" PostTypeId="2" ParentId="25347" CreationDate="2016-04-12T02:32:20.697" Score="0" Body="&lt;p&gt;I think you are confused with what's exactly log-normally distributed. The distribution of option prices can't be normal or log-normal because the prices can't be negative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, we don't model option prices, we model the underlying stochastic processes (i.e: geometric brownian motion, mean-reverting etc). We then use the distribution of those processes to derive the payoff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Exotic option is really not much different to vanilla option. More complicated payoff structure, but similar idea.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2016-04-12T02:32:20.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25365" PostTypeId="1" CreationDate="2016-04-12T06:57:35.730" Score="3" ViewCount="214" Body="&lt;p&gt;can someone please suggest a good book on Monte Carlo Simulation for Pricing Derivatives?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't want a book which is too complicated like a PhD level. A Masters level should be good.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot in advance&lt;/p&gt;&#xA;" OwnerUserId="20162" LastActivityDate="2016-04-13T15:03:16.830" Title="Monte Carlo Methods for Pricing Derivatives" Tags="&lt;monte-carlo&gt;&lt;simulations&gt;&lt;quantitative&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25366" PostTypeId="2" ParentId="25365" CreationDate="2016-04-12T07:25:52.190" Score="2" Body="&lt;p&gt;This is the book from a masters degree.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://perso.telecom-paristech.fr/~bianchi/athens/Proba_Num_11-12.pdf&quot; rel=&quot;nofollow&quot;&gt;http://perso.telecom-paristech.fr/~bianchi/athens/Proba_Num_11-12.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-04-12T07:25:52.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25367" PostTypeId="2" ParentId="25207" CreationDate="2016-04-12T07:49:40.287" Score="3" Body="&lt;p&gt;You are right. In the CIR++, $\alpha$ parameter is absorbed into $\phi$.&#xA;With the CIR++, $\phi(t)$ will allow you to have to have negative rates. You will calibrate your $\phi$ to fit the discount factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The shifted idea is the one used to handle negative rates problem in caplet, swaption...&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-04-12T07:49:40.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25369" PostTypeId="2" ParentId="25207" CreationDate="2016-04-12T10:02:58.477" Score="-1" Body="&lt;p&gt;A simple shifting trick is to put $r(t)-f$ instead of $r(t)$ under the square root in your expression. Then $f$ is the new, possibly negative, interest rate floor. If, for example, $f=-100bp$ then the process is defined for all $r(t)&amp;gt;-100bp$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Same for Sabr, where instead of square root you have another exponent. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-04-12T10:02:58.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25370" PostTypeId="1" AcceptedAnswerId="25650" CreationDate="2016-04-12T10:11:20.823" Score="4" ViewCount="439" Body="&lt;p&gt;&lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html&quot; rel=&quot;nofollow&quot;&gt;Kenneth R. French&lt;/a&gt; website only provides monthly European factor data. I want to track this data daily.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's what I tried: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;MSCI Europe Barra Value Index - it's long short 130/30, not 100/100.&lt;/li&gt;&#xA;&lt;li&gt;Lyxor JP Morgan Europe Value Factor UCITS ETF - long only. Short only version has no data.&lt;/li&gt;&#xA;&lt;li&gt;iShares MSCI Europe Value Factor UCITS ETF - long only.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="19615" LastActivityDate="2017-03-08T21:32:46.690" Title="Where to find daily European value factor data?" Tags="&lt;factor-models&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25371" PostTypeId="1" CreationDate="2016-04-12T10:31:02.043" Score="2" ViewCount="2160" Body="&lt;p&gt;I have 3 related questions:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;a) I've seen formulas for GM and GS which eithier do, or do not, involve taking the exponent. Which is right?&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;i.e. for GM I've seen both &lt;span class=&quot;math-container&quot;&gt;$\text{mean}(\ln(1+r_{t}))$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$\exp(\text{mean}(\ln(1+r_{t})))-1$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;For GS again I've seen both &lt;span class=&quot;math-container&quot;&gt;$\text{std}(\ln(1+r_{t}))$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$\exp(\text{std}(\ln(1+r_{t})))-1$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;I don't know if there's a right answer to this question or it's just a question of preference, but it seems logical to me that we should reverse the log operation by applying an exponent.&lt;/p&gt;&#xA;&lt;p&gt;b) It's a well known approximation that the geometric mean (GM) is roughly equal to the arithmetic mean (AM) minus half the variance (V).&lt;/p&gt;&#xA;&lt;p&gt;(&lt;a href=&quot;http://www.cdiadvisors.com/papers/CDIArithmeticVsGeometric110814.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; is a nice paper discussing this, and other approximations)&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Does anyone know of a simple approximation for GS similar to &lt;span class=&quot;math-container&quot;&gt;$GM = AM - \frac{V}{2}$&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Empirically, based on simulating Gaussian returns and also from real data, the geometric standard deviation (GS) seems to be very close to AS. This does however depend on a number of factors:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Whether we use &lt;span class=&quot;math-container&quot;&gt;$\text{std}(\ldots)$&lt;/span&gt; or &lt;span class=&quot;math-container&quot;&gt;$\exp(\text{std}(\ldots)) -1$&lt;/span&gt; [See below]. Clearly the latter will always be larger.&lt;/li&gt;&#xA;&lt;li&gt;The level of AS. At higher levels of AS, GS will generally be higher than AS.&lt;/li&gt;&#xA;&lt;li&gt;The sharpe ratio of the returns. For Sharpe ratio of 0.25 GS is a little higher than AS. With a sharpe ratio of 1.0 GS is lower than AS.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;c) Given GM less than AM and AS~GS, &lt;strong&gt;I don't understand why it's usually quoted that &amp;quot;geometric Sharpe ratios &lt;span class=&quot;math-container&quot;&gt;$(\frac{GM}{GS})$&lt;/span&gt; are higher than arithmetic &lt;span class=&quot;math-container&quot;&gt;$(\frac{AM}{AS})$&lt;/span&gt;&amp;quot;&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Again with experiments this only seems to hold true for unrealistically high Sharpes. For annualised Sharpes below around 0.7 the Geometric sharpe is lower than the arithmetic. In the real world there aren't many assets with Sharpes above 0.7....&lt;/p&gt;&#xA;&lt;p&gt;It also depends on if what the answer to question (a) is. The exponent version of GS and GM gives a slightly lower sharpe ratio figure than the simple versions do.&lt;/p&gt;&#xA;" OwnerUserId="8019" LastEditorUserId="46305" LastEditDate="2021-02-06T19:51:30.937" LastActivityDate="2021-02-06T19:51:30.937" Title="Geometric means, standard deviation, and sharpe ratios" Tags="&lt;sharpe-ratio&gt;&lt;log-returns&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="25372" PostTypeId="1" AcceptedAnswerId="25373" CreationDate="2016-04-12T12:04:38.840" Score="2" ViewCount="3924" Body="&lt;p&gt;I am learning about neural network and created some small networks in feed forwarding network myself. I was curious about Recurrent Neural Networks (RNN) and read some papers about RNN in trading. The results in those paper using RNN seems promising but I have some general and hypothetical doubts regarding RNN. I learnt that RNN is best used for learning sequential and time series data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets assume I made  two models for predicting future price of stocks, one trained in RNN and other in MLP (Multi Layer Perceptron) using 10 years (OHLC) of data from SPY with good accuracy. I then wants to use these trained models to predict another stock's future price (may or may not be correlated with SPY) eg GOOGLE's tomorrows price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(first question)&#xA;Which algorithm has more chances to give an accurate prediction?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know there is a good chance both models will fail to predict future price of a different product (here GOOG) correctly because the model is trained in SPY data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the question is; because RNN is used for training model for sequential and time series data. Is RNN have more probability of a failure prediction than MLP because it trained explicitly for SPY?&lt;/p&gt;&#xA;" OwnerUserId="16754" LastActivityDate="2016-04-12T12:34:50.170" Title="When and how to use RNN for stock analysis or trading" Tags="&lt;neural-networks&gt;&lt;general&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25373" PostTypeId="2" ParentId="25372" CreationDate="2016-04-12T12:34:50.170" Score="4" Body="&lt;blockquote&gt;&#xA;&lt;p&gt;Lets assume I made two models for predicting future price of stocks, one trained in RNN and other in MLP (Multi Layer Perceptron) using 10 years (OHLC) of data from SPY with good accuracy.&lt;/p&gt;&#xA;&lt;p&gt;Which algorithm has more chances to give an accurate prediction?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;The choice of which model to use for training matters far, far less than the specific parameters used for the training. How many levels do your RNN and perceptron models have? What are the activation functions of the RNN? What algorithm did you use to initialize weights? What is your loss function? What is the training rate? Did you train using monolothic backpropagation or in batches? Did you use stochastic gradient descent?&lt;/p&gt;&#xA;&lt;p&gt;The idea that you can just &amp;quot;train an RNN&amp;quot; or &amp;quot;train a MLP&amp;quot; and expect it to make good out of sample predictions is a fantasy, &lt;em&gt;even when you aren't trying to make predictions for a different asset than the one you trained on&lt;/em&gt;. The fact that you want to train on SPY and predict on GOOG just adds extra complication (and more ways for your model to fail).&lt;/p&gt;&#xA;&lt;p&gt;If you want to learn about neural networks, you should start with a problem them are known to be good at (e.g. text classification). If you want to predict stock prices, use an algorithm known to perform well on predicting stock prices (it's harder to find these, but maybe start with some kind of robust linear model).&lt;/p&gt;&#xA;&lt;p&gt;Just picking a trendy machine learning method and a trendy problem to work on is a recipe for failure.&lt;/p&gt;&#xA;&lt;p&gt;In answer to your question&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;When and how to use RNN for stock analysis or trading?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;The when is &amp;quot;never&amp;quot; and the how is irrelevant.&lt;/p&gt;&#xA;" OwnerUserId="924" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-04-12T12:34:50.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25374" PostTypeId="1" CreationDate="2016-04-12T12:42:19.113" Score="6" ViewCount="2007" Body="&lt;p&gt;I am looking for a service that is able to provide real-time tick data (time&amp;amp;sales) for the contracts traded in the Italian Stock Market (Borsa Italiana). The service should provide data through an API that I can integrate in my own code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what I have tried so far:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;eSignal&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Real-time tick data is shown in the software but is not available through the eSignal Formula Script (EFS). EFS only deals with bars.&#xA;I also used eSignal QLink, that it is claimed to be an enhanced DDE add-on service that makes it quick and simple to download real-time, streaming data into your Excel worksheets (&lt;a href=&quot;http://www.esignal.com/development-tools/esignal_sdk_tools/qlink.aspx&quot; rel=&quot;nofollow&quot;&gt;http://www.esignal.com/development-tools/esignal_sdk_tools/qlink.aspx&lt;/a&gt;). I combined QLink with my own VBA script to intercept excel cell changes and dump ticks to a database. I found that many close-in-time ticks correctly shown in the eSignal time&amp;amp;sales window are not detected by QLink.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Interactive Brokers&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to evaluate the goodness of the data received via &lt;code&gt;reqTopMktData()&lt;/code&gt; (&lt;a href=&quot;https://www.interactivebrokers.com/en/software/api/apiguide/c/reqmktdata.htm&quot; rel=&quot;nofollow&quot;&gt;https://www.interactivebrokers.com/en/software/api/apiguide/c/reqmktdata.htm&lt;/a&gt;) I wrote a simple JAVA class that fires a &lt;code&gt;reqTopMktData()&lt;/code&gt; and handles generated events via callbacks &lt;code&gt;tickPrice()&lt;/code&gt; and &lt;code&gt;tickSize()&lt;/code&gt;. Callbacks simply write received data to file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I let the class run for a day and then checked harvested ticks against the TWS time &amp;amp; sales window. Surprisingly, I found that many ticks that are properly shown in the time &amp;amp; sales window are missing from the harvested data. It looks like not all the ticks are forwarded to &lt;code&gt;tickPrice()&lt;/code&gt; and &lt;code&gt;tickSize()&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So basically I am still unable to find a good, reliable, service provider of real-time tick by tick data for the Italian stock market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: I can provide VBA and JAVA classes upon request.&lt;/p&gt;&#xA;" OwnerUserId="20183" LastEditorUserId="743" LastEditDate="2016-06-13T15:35:35.870" LastActivityDate="2016-10-11T18:13:31.663" Title="Real-time Tick Data API for the Italian Stock Market" Tags="&lt;data&gt;&lt;programming&gt;&lt;market-data&gt;&lt;tick-data&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25375" PostTypeId="2" ParentId="25371" CreationDate="2016-04-12T13:13:08.597" Score="2" Body="&lt;p&gt;The geometric mean of quantities &lt;span class=&quot;math-container&quot;&gt;$\{a_1, \dots, a_n\}$&lt;/span&gt; is&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;\bar{a}_g = \left( \prod_{i=1}^n a_i \right)^{1/n}&#xA;$$&lt;/span&gt;&#xA;Taking the logarithm of both sides gives&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;\log \bar{a}_g = \frac{1}{n} \sum_{i=1}^n \log a_i&#xA;$$&lt;/span&gt;&#xA;so the log of the geometric mean is equal to the arithmetic mean of the logs.&lt;/p&gt;&#xA;&lt;p&gt;In your case, the relevant quantities &lt;span class=&quot;math-container&quot;&gt;$a_i$&lt;/span&gt; are the growth rates over each period,&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;a_i = 1 + r_i&#xA;$$&lt;/span&gt;&#xA;and plugging this into the above equation gives&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;\log(1 + \bar{r}_g) = \frac{1}{n}\sum_{i=1}^n \log(1 + r_i)&#xA;$$&lt;/span&gt;&#xA;which can be rearranged to&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;\bar{r}_g = \exp\left(\frac{1}{n}\sum_{i=1}^n \log(1 + r_i) \right) - 1&#xA;$$&lt;/span&gt;&#xA;so you are correct to exponentiate the arithmetic mean of the logs (and subtract 1) in order to calculate the geometric growth rate. The reason that you sometimes see&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;\bar{r}_g = \frac{1}{n}\sum_{i=1}^n \log(1 + r_i)&#xA;$$&lt;/span&gt;&#xA;is because when the growth rate is small,&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;\log(1 + \bar{r}_g) \approx \bar{r}_g&#xA;$$&lt;/span&gt;&#xA;so it is often an approximation that you can get away with.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;To defined the geometric standard deviation of &lt;span class=&quot;math-container&quot;&gt;$\{a_1,\dots,a_n\}$&lt;/span&gt; we use the idea above that the log of the geometric mean is the arithmetic mean of the logs. Similarly, define the log of the geometric variance &lt;span class=&quot;math-container&quot;&gt;$\sigma_g^2$&lt;/span&gt; to be the arithmetic variance of the logs -&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;\log \sigma_g^2 = \frac{1}{n} \sum_{i=1}^n \left( \log a_i - \log \bar{a}_g \right)^2&#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Again, you can substitute &lt;span class=&quot;math-container&quot;&gt;$a_i = 1 + r_i$&lt;/span&gt; on the right-hand side, and then use the approximation&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\log(1 + x) \approx x - \tfrac{1}{2}x^2&#xA;$$&lt;/span&gt;&#xA;to compute an approximation to &lt;span class=&quot;math-container&quot;&gt;$\sigma_g^2$&lt;/span&gt; in terms of the arithmetic standard deviation &lt;span class=&quot;math-container&quot;&gt;$\sigma_a^2$&lt;/span&gt;, and higher moments of the distribution.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;For the last part of your question &amp;quot;I don't understand why it's quoted that geometric sharpes are higher than arithmetic&amp;quot; - is that true? I have never seen anyone make that claim.&lt;/p&gt;&#xA;" OwnerUserId="924" LastEditorUserId="848" LastEditDate="2021-02-06T19:49:17.757" LastActivityDate="2021-02-06T19:49:17.757" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="25376" PostTypeId="2" ParentId="25345" CreationDate="2016-04-12T13:18:58.787" Score="1" Body="&lt;p&gt;No you are long convexity.  The futures contract has no convexity (since its value is linear as the underlying rate varies, specifically it moves by $25 per bp per contract).  Meanwhile, the FRA has positive convexity (it's like a mini bond).  The fact that you are long convexity overall is consistent with the fact that the rate on the futures contract is slightly higher than the FRA.  That is how you are paying for the convexity.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-04-12T13:18:58.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25377" PostTypeId="1" AcceptedAnswerId="25384" CreationDate="2016-04-12T14:04:25.303" Score="0" ViewCount="573" Body="&lt;p&gt;What sources of data suitable for training approximations to Black-Scholes are freely available to academics?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My understanding is that the parameters to Black-Scholes are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;share price&lt;/li&gt;&#xA;&lt;li&gt;strike price&lt;/li&gt;&#xA;&lt;li&gt;risk-free interest rate&lt;/li&gt;&#xA;&lt;li&gt;volatility (historically- estimated)&lt;/li&gt;&#xA;&lt;li&gt;time until expiration&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;While share price and volatility would appear to be generally available (e.g. via Yahoo APIs) it's not clear to me where to obtain the remaining information.&lt;/p&gt;&#xA;" OwnerUserId="20285" LastEditorUserId="20285" LastEditDate="2016-04-12T14:28:17.757" LastActivityDate="2016-04-12T16:13:27.723" Title="Training data for Black Scholes" Tags="&lt;black-scholes&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25378" PostTypeId="1" CreationDate="2016-04-12T14:22:22.203" Score="1" ViewCount="613" Body="&lt;p&gt;I found this paper on roll rate analysis via a google search. I would post a link, but every page is stamped with &quot;CONFIDENTIAL&quot; at the bottom (humorous since it is easily found).  In a nut-shell, roll rates are used to determine how a company’s portfolio is performing by following accounts/loans over a given time horizon.  To find roll rates (at least how this paper explains it), do the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;determine the delinquent statuses of all of your accounts at a certain point in time&lt;/li&gt;&#xA;&lt;li&gt;after a specified period (6 months in this paper), determine the statuses of the entire portfolio again&lt;/li&gt;&#xA;&lt;li&gt;finally determine the percentages of changes from one delinquent status to another &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For example, let’s say at a given point in time you want to determine the roll rate of all of your current loans and let’s say you have 100 of them.  6 months later, 80 of those loans are still current, 15 are 30 days delinquent, and 5 paid off.  This would translate to an 80% current-current roll rate, a 15% current-30 roll rate, and a 5% current-paid off role rate (this paper uses prepay for this delinquent status).&#xA;It should be noted that the details of the portfolio (they are not even given in the paper) are immaterial as I am simply trying to verify their results. Below is the actual roll rates provided along with a few key statements that will help you interpret this matrix for a 6 month time span. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'''''''''|''Current''|''''30''''|''''60+'''|'''Default'''|'''Prepay&#xA;'Current |   90.4%   |   2.9%   |   2.3%   |     0.1%    |    4.3%  &#xA;'  30    |   20.9%   |  16.4%   |  55.6%   |     6.4%    |    0.8% &#xA;'  60+   |    7.0%   |  10.3%   |  68.5%   |    13.9%    |    0.3% &#xA;&#xA;- Key Observations:&#xA;    − 90.4% of current loans were still current 6 months later; 4.3% paid in full during the period.&#xA;    − Only 20.9% of 30 day loans were current 6 months later.&#xA;    − Only 7.00% of 60+ day loans were current 6 months later.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Aside from the second row not summing to 1 (1.001), everything seems to be okay to this point. The first statement that is a bit mysterious is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- As of six months later, the portfolio is approximately 3.1% 60+ days delinquent.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We are given no further information (i.e. we aren’t given how many loans/accounts were in each status from the outset, nor are we given how many there were 6 months later. We are simply given percentages).  So, to verify any results and to make sense of their claims, I did a little algebra to determine how many loans were in each status at the beginning.  This will give me the percentages of each delinquent status as well as allow me to carry out further analysis on this portfolio moving forward. Below is my setup along with all of my calculations:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x = # of Current accounts at time 0&#xA;y = # of 30 day delinquent accounts at time 0&#xA;z = # of 60+ day accounts at time 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We need to find the number of each of these 6 months from now, so:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x_1 = # of Current accounts 6 months later&#xA;y_1 = # of 30 day delinquent accounts 6 months later&#xA;z_1 = # of 60+ day accounts 6 months later&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note: we are not concerned with the loans that “Defaulted” or “Prepaid” as they have left the portfolio.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x_1 = x(0.904) + y(.209) + z(.07)&#xA;y_1 = x(0.029) + y(.164) + z(.103)&#xA;z_1 = x(0.023) + y(.556) + z(.685)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thus, we must now solve &lt;code&gt;0.031 = z_1 / (x_1 + y_1 + z_1)&lt;/code&gt;. Below is my algebra with many steps left out (easily verified).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x(0.029636) + y(0.028799) + z(0.026598) = x(0.023) + y(.556) + z(.685)&#xA;x(0.006636) - y(0.527201) - z(0.658402) = 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, since the numbers are arbitrary, I set x = 100,000&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;663.6 = y(0.527201) + z(0.658402)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This means that the limits on y and z are, 1258.73 (assuming z = 0) and 1007.89 respectively (assuming y = 0). Again, since the numbers are arbitrary, I let y = 800, which gives z = 367. Also, note that I am rounding up as it doesn't make since to have &quot;part&quot; of an account/loan.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x = 100000, y = 800, and z = 367 gives&#xA;2997 / (90593 + 3070 + 2997) = 0.03100559... approx = 3.1%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now that we have a full set-up, we can move on to the claims I have issues with. They are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- Assuming the 6 month experience repeats itself:&#xA;    − In two years, 13.9% of the portfolio will be 60+ day delinquent.&#xA;    − In three years, 17.9% of the portfolio will be 60+ day delinquent.&#xA;    − In five years, 23.8% of the portfolio will be 60+ day delinquent.&#xA;    − After a lifetime, 40.3% of the portfolio will be 60+ day delinquent.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have written a function in &lt;code&gt;R&lt;/code&gt; to carry out such an experiment.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;RollRate60Analysis &amp;lt;- function(numC, num30, num60, mon6) {&#xA;    ## numC is the number of current accounts at time = 0&#xA;    ## num30 is the number of accounts that are 30 days delinquent at time = 0&#xA;    ## num60 is the number of accounts that are 60+ days delinquent at time = 0&#xA;    ## mon6 is the number of 6 month periods to carry out&#xA;&#xA;    mymat &amp;lt;- matrix(c(0.904,0.029,0.023,0.001,0.043,0.2085,0.164,0.556,&#xA;                  0.064,0.0075,0.07,0.103,0.685,0.139,0.003), nrow = 3, byrow = TRUE)&#xA;    initMat &amp;lt;- matrix(c(numC, num30, num60, 0, 0), ncol = 5)&#xA;    for (j in 1:mon6) {&#xA;        tempMat &amp;lt;- mymat&#xA;        for (i in 1:3) {tempMat[i, ] &amp;lt;- tempMat[i, ] * sum(initMat[,i])}&#xA;        initMat &amp;lt;- ceiling(tempMat)&#xA;    }&#xA;    my60 &amp;lt;- sum(initMat[,3])&#xA;    total &amp;lt;- sum(apply(initMat, 2, sum)[1:3])&#xA;    list(initMat, 100*my60/total)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is where it gets a bit unclear.  I interpret “in two years” as the time after the initial roll rate is determined and therefore I pass the number 5 for the &lt;code&gt;mon6&lt;/code&gt; variable.  This yields &lt;code&gt;RollRate60Analysis(100000, 800, 367, 5) = 12.60881&lt;/code&gt;.  Even if they meant from the very beginning I get the wrong answer (i.e. &lt;code&gt;RollRate60Analysis(100000, 800, 367, 4) = 11.00218&lt;/code&gt;).  My results start to diverge even further as the time increases.  For example, for three years later I get &lt;code&gt;RollRate60Analysis(100000, 800, 367, 7) = 14.88264&lt;/code&gt; and for 5 years later I get &lt;code&gt;RollRate60Analysis(100000, 800, 367, 11) = 17.21863&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the final claim, I obtain &lt;code&gt;27.16%&lt;/code&gt;.  If you let mon6 get larger and larger, the percentages start to approach &lt;code&gt;27.16049%&lt;/code&gt;.  Observe:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mon6 = 100, RollRate60Analysis(100000, 800, 367, 100) = 21.02804&#xA;mon6 = 200, RollRate60Analysis(100000, 800, 367, 200) = 27.16049&#xA;mon6 = 500, RollRate60Analysis(100000, 800, 367, 500) = 27.16049&#xA;mon6 = 1000, RollRate60Analysis(100000, 800, 367, 1000) = 27.16049&#xA;mon6 = 2000, RollRate60Analysis(100000, 800, 367, 2000) = 27.16049&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is far from &lt;code&gt;40.3%&lt;/code&gt;.  Even if you start with absurd numbers at the beginning for numC, num30, and num60, you obtain &lt;code&gt;27.16049%&lt;/code&gt; (e.g. &lt;code&gt;RollRate60Analysis(100000, 100000, 100000, 2000) = 27.16049&lt;/code&gt;). This makes sense as the roll rate matrix should determine everything at infinity, and not the number of a certain delinquent type at the outset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even if you alter the above logic and include &lt;code&gt;Default&lt;/code&gt; as those loans that are 60+ days delinquent, I can't replicate their results. I use the same logic as above to obtain my initial state (I'll spare the algebraic details). Observe:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;RollRateAnalysisAltered &amp;lt;- function(numC, num30, num60, mon6) {&#xA;    mymat &amp;lt;- matrix(c(0.904,0.029,0.023,0.001,0.043,0.2085,0.164,0.556,&#xA;                      0.064,0.0075,0.07,0.103,0.685,0.139,0.003), nrow = 3, byrow = TRUE)&#xA;    initMat &amp;lt;- matrix(c(numC, num30, num60, 0, 0), ncol = 5)&#xA;    for (j in 1:mon6) {&#xA;        tempMat &amp;lt;- mymat&#xA;        for (i in 1:3) {tempMat[i, ] &amp;lt;- tempMat[i, ] * sum(initMat[,i])}&#xA;        initMat &amp;lt;- ceiling(tempMat)&#xA;    }&#xA;    my60 &amp;lt;- sum(initMat[,3]) + sum(initMat[,4])  ## including 4th column i.e. &quot;Default&quot;&#xA;    total &amp;lt;- sum(apply(initMat, 2, sum)[1:4])  ## including 4th column i.e. &quot;Default&quot;&#xA;    100*my60/total&#xA;}&#xA;&#xA;mon6 = 1, RollRateAnalysisAltered (100000, 600, 300, 1) = 3.127362&#xA;mon6 = 5, RollRateAnalysisAltered (100000, 600, 300, 200) = 14.25458&#xA;mon6 = 7, RollRateAnalysisAltered (100000, 600, 300, 500) = 16.87869&#xA;mon6 = 11, RollRateAnalysisAltered (100000, 600, 300, 1000) = 19.54957&#xA;mon6 = 200, RollRateAnalysisAltered (100000, 600, 300, 2000) = 32.18391&#xA;mon6 = 2000, RollRateAnalysisAltered (100000, 600, 300, 2000) = 32.18391&#xA;mon6 = 2000, RollRateAnalysisAltered (100000, 100000, 100000, 2000) = 32.18391&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;br&gt;&#xA;&lt;strong&gt;Question&lt;/strong&gt;:&lt;br&gt;&#xA;Is there an error in their analysis or is my line of reasoning completely off?  Again, we aren't given that much information, but it seems as though we should be able to replicate their results. Thanks!&lt;/p&gt;&#xA;" OwnerUserId="20284" LastEditorUserId="16160" LastEditDate="2016-04-13T00:25:05.020" LastActivityDate="2016-04-15T14:15:41.293" Title="Trouble verifying roll rate model" Tags="&lt;programming&gt;&lt;risk-management&gt;&lt;risk-models&gt;&lt;finance-mathematics&gt;&lt;markov&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25379" PostTypeId="1" AcceptedAnswerId="25381" CreationDate="2016-04-12T14:39:59.130" Score="1" ViewCount="149" Body="&lt;p&gt;Say we have the following binary option $B$ on asset $S$ with strike K and expiration time T, assume also that the following relation holds at time $0$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$B &amp;gt; N*C(K,T)-N*C(K+1/N,T)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $N$ is some natural number and $C(K,T)$ is the call option on asset $S$ with strike K and expiration time T&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How is it possible to find an arbitrage  strategy in that case , under the assumption that we can buy call options at any strike?&lt;/p&gt;&#xA;" OwnerUserId="20287" LastEditorUserId="20287" LastEditDate="2016-04-12T15:12:00.273" LastActivityDate="2016-04-12T15:38:54.477" Title="Arbitrage opportunity in discrete time" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;arbitrage&gt;&lt;binary-options&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="25381" PostTypeId="2" ParentId="25379" CreationDate="2016-04-12T15:33:31.243" Score="0" Body="&lt;p&gt;We assume that the inequality is given by&#xA;\begin{align*}&#xA;B &amp;gt; N C(K-1/N, T) - N  C(K, T).\tag{1}&#xA;\end{align*}&#xA;The argument for the case with the inequality&#xA;\begin{align*}&#xA;B &amp;lt; N C(K, T) - N C(K+1/N, T) &#xA;\end{align*}&#xA;is similar.&#xA; $$$$&#xA;For the binary option,&#xA;\begin{align*}&#xA;\pmb{1}_{\{S_T \ge K\}} = &#xA;\begin{cases}&#xA;1, &amp;amp; \textrm{if } S_T \ge K,\\&#xA;0, &amp;amp; \textrm{otherwise},&#xA;\end{cases}&#xA;\end{align*}&#xA;while for the portfolio with payoff&#xA;\begin{align*}&#xA;X_T &amp;amp;= N\bigg[S_T-\Big(K-\frac{1}{N}\Big)\bigg]^+ - N (S_T-K)^+\\&#xA;&amp;amp;=&#xA;\begin{cases}&#xA;1, &amp;amp; \textrm{if } S_T \ge K,\\&#xA;N\bigg[S_T-\Big(K-\frac{1}{N}\Big)\bigg], &amp;amp; \textrm{if } K-\frac{1}{N} \le S_T \le K,\\&#xA;0, &amp;amp; \textrm{otherwise}.&#xA;\end{cases}&#xA;\end{align*}&#xA;Then, it is obvious that&#xA;\begin{align*}&#xA;\pmb{1}_{\{S_T \ge K\}} \le X_T,\tag{2}&#xA;\end{align*}&#xA;and, consequently,&#xA;\begin{align*}&#xA;B \le N C(K-1/N, T) -N  C(K, T).&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$$$&#xA;However, if (1) holds, we can then short the binary option, short $N$ units call option with strike $K$, and long $N$ units call option with strike $K-1/N$. We have a net profit &#xA;\begin{align*}&#xA;B - \big[N C(K-1/N, T) - N  C(K, T)\big].&#xA;\end{align*} &#xA;Moreover, at maturity $T$, we have the portfolio payoff &#xA;\begin{align*}&#xA;X_T - \pmb{1}_{\{S_T \ge K\}} \ge 0,&#xA;\end{align*}&#xA;as per (2) above.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-04-12T15:38:54.477" LastActivityDate="2016-04-12T15:38:54.477" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25382" PostTypeId="1" AcceptedAnswerId="25439" CreationDate="2016-04-12T15:34:12.993" Score="4" ViewCount="5255" Body="&lt;p&gt;I want to calculate yield of bond having market price and coupons. I try to replicate C++ from (&lt;a href=&quot;https://mhittesdorf.wordpress.com/2013/03/03/introducing-quantlib-internal-rate-of-return/&quot; rel=&quot;nofollow&quot;&gt;https://mhittesdorf.wordpress.com/2013/03/03/introducing-quantlib-internal-rate-of-return/&lt;/a&gt;) in Python but without success. How to use &quot;bisection&quot; solver in quantlib-python?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;solver = ql.Bisection()&#xA;solver_max = 0.5&#xA;solver_min = 0.1&#xA;solver_maxEvaluations = 1000 &#xA;solution = solver.solve(?, solver_maxEvaluations, solver_min, solver_max)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;NotImplementedError: Wrong number or type of arguments for overloaded function 'Bisection_solve'.&lt;br/&gt;&#xA;    Possible C/C++ prototypes are:&lt;br/&gt;&#xA;      Bisection::solve(PyObject *,Real,Real,Real)&lt;br/&gt;&#xA;      Bisection::solve(PyObject *,Real,Real,Real,Real)&lt;br/&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What is the &quot;PyObject*&quot; in this case? &lt;/p&gt;&#xA;" OwnerUserId="20288" LastEditorUserId="20288" LastEditDate="2016-04-15T07:07:04.327" LastActivityDate="2016-04-15T09:40:50.777" Title="How to calculate bond yield in QuantLib - Python" Tags="&lt;python&gt;&lt;quantlib&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25383" PostTypeId="1" AcceptedAnswerId="25386" CreationDate="2016-04-12T15:53:51.587" Score="1" ViewCount="52" Body="&lt;p&gt;As &lt;a href=&quot;http://www.investopedia.com/terms/p/promoter.asp&quot; rel=&quot;nofollow&quot;&gt;Investopedia&lt;/a&gt; defines it:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A promoter is an individual or company that, for a fee, helps raise money for some type of investment activity. Most often, promoters raise money for a company through offering investment vehicles other than traditional stocks and bonds, such as limited partnerships and direct investment activities. Often times, these promoters are paid in company stock or free entrance into the investment activity as compensation for their work in raising funds from others.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What does a high/low promoter's share indicate about the company?&#xA;Also,What is share pledging?&lt;/p&gt;&#xA;" OwnerUserId="19880" LastEditorUserId="19880" LastEditDate="2016-04-12T17:41:30.800" LastActivityDate="2016-04-12T17:41:30.800" Title="Who/What is a promoter of a company?" Tags="&lt;equities&gt;&lt;financial-markets&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="25384" PostTypeId="2" ParentId="25377" CreationDate="2016-04-12T16:13:27.723" Score="1" Body="&lt;p&gt;I guess you could use the following link for data for training approximations:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.scientific-consultants.com/nnbd.html&quot; rel=&quot;nofollow&quot;&gt;http://www.scientific-consultants.com/nnbd.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20269" LastActivityDate="2016-04-12T16:13:27.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25386" PostTypeId="2" ParentId="25383" CreationDate="2016-04-12T16:41:31.263" Score="1" Body="&lt;p&gt;high Promoter share in a company has the following advantages. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Stock price is usually higher as the availability in open market is low. &lt;/li&gt;&#xA;&lt;li&gt;High probability of the company being strong. Cause, they needn't depend on votes to take right decisions. But it could backfire too. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Low promoter share in a company means, &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The volatility is predictable to a greater extent. &lt;/li&gt;&#xA;&lt;li&gt;Decision making is often slow, but need not be true in all cases. If Steve Jobs is running the company, he wouldn't face issues with&#xA;Voting :)&lt;/li&gt;&#xA;&lt;li&gt;PE ratio of the company would often be low.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I hope i have answered your question. &lt;/p&gt;&#xA;" OwnerUserId="6799" LastActivityDate="2016-04-12T16:41:31.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25387" PostTypeId="1" CreationDate="2016-04-12T16:44:27.127" Score="3" ViewCount="291" Body="&lt;p&gt;I have computed a lower bound for an american option through longstaff and schwartz's algorithm. Now I have to compute the upper bound as andersen and broadie does in their article &lt;a href=&quot;http://www.columbia.edu/~mnb2/broadie/Assets/primal_dual_ms_2004.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;linked&lt;/a&gt;. Can anybody help me with a small numerical example? I only have the procedure from the article, which is hard to understand. &lt;/p&gt;&#xA;" OwnerUserId="20291" LastEditorUserId="16148" LastEditDate="2017-05-08T13:51:24.247" LastActivityDate="2017-05-08T13:51:24.247" Title="American option - Upper bound" Tags="&lt;monte-carlo&gt;&lt;american-options&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25389" PostTypeId="1" CreationDate="2016-04-12T18:52:15.667" Score="1" ViewCount="51" Body="&lt;p&gt;This paper by &lt;a href=&quot;http://www-2.rotman.utoronto.ca/~hull/downloadablepublications/mertonsmodelandvolatilityskews.pdf&quot; rel=&quot;nofollow&quot;&gt;Hull, Nelken and White&lt;/a&gt; uses implied volatilities in structural credit risk models to back out a market-implied leverage ratio. CreditGrades  has a similar implementation using equity derivatives as well. My goal is to use these approaches to back out firm leverage. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried to replicate the &lt;a href=&quot;https://www.msci.com/resources/research/working_papers/CGequityOptions.pdf&quot; rel=&quot;nofollow&quot;&gt;CreditGrades Approach&lt;/a&gt; using their Case C Approach. I notice, however, that the leverage ratio derived from the implied put volatilities is extremely volatile, and very small changes in the strike price can produce massive fluctuations in the leverage. The leverage ratio is also occasionally negative. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anybody have any experience in implementing this approach? Are these potentially normal/known issues with the model or is it likely that my implementation is flawed? I can upload my spreadsheet if need be. &lt;/p&gt;&#xA;" OwnerUserId="17712" LastActivityDate="2016-04-12T18:52:15.667" Title="Using Put Volatilities to Estimate Firm Leverage/Credit Risk" Tags="&lt;credit-risk&gt;&lt;default-probability&gt;&lt;credit-derivatives&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25390" PostTypeId="1" AcceptedAnswerId="25391" CreationDate="2016-04-12T19:06:36.307" Score="2" ViewCount="730" Body="&lt;p&gt;From Hull's book when deriving coefficients of up and down movements, $u$ and $d$, of a stock price using binomial tree approach, at some point we get the following equation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$e^{\mu\Delta t}(u+d) - ud - e^{2\mu\Delta t} = \sigma^2\Delta t.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then it is stated that from solving the above equation we obtain that $u = e^{\sigma\sqrt{\Delta t}}$ and $d= e^{-\sigma\sqrt{\Delta t}}$. It is also noted that we use Taylor's formula and throwing $\Delta t^2$ and higher terms:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \dots.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you clarify how do we get to this result?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far I get by using Taylor's formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$e^{\mu\Delta t} \approx 1 + \mu\Delta t,$$&#xA;$$e^{2\mu\Delta t} \approx 1 + 2\mu\Delta t.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the above equation transforms to &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$(1+\mu\Delta t)(u+d) - ud - 1 - 2\mu\Delta t = \sigma^2\Delta t.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am confused how to proceed from here. I tried to do some algebra but it gave no result. For instance, if we assume that $ud=1$ then we get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$(1+\mu\Delta t)(u+d) - 2(1+\mu\Delta t) = \sigma^2\Delta t,$$&#xA;$$(1+\mu\Delta t)(u+d-2) = \sigma^2\Delta t$$&#xA;and &#xA;$$u+d = \frac{\sigma^2\Delta t}{1+\mu\Delta t} + 2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here I am stuck&lt;/p&gt;&#xA;" OwnerUserId="18345" LastActivityDate="2016-04-13T13:00:29.093" Title="Deriving $u$ and $d$ coefficients using binomial tree approach" Tags="&lt;binomial-tree&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25391" PostTypeId="2" ParentId="25390" CreationDate="2016-04-12T19:55:59.707" Score="1" Body="&lt;p&gt;We assume that  $u=e^x$ and $d = e^{-x}$. Note that&#xA;\begin{align*}&#xA;u &amp;amp;\approx 1+ x +\frac{x^2}{2}, \textrm{ and}\\&#xA;d &amp;amp;\approx 1- x +\frac{x^2}{2}.&#xA;\end{align*}&#xA;Substituting these into your last equation,&#xA;\begin{align*}&#xA;u+d = \frac{\sigma^2 \Delta t}{1+\mu\Delta t} + 2,&#xA;\end{align*}&#xA; we obtain that&#xA;\begin{align*}&#xA; x^2 \approx \frac{\sigma^2 \Delta t}{1+\mu\Delta t}.&#xA;\end{align*}&#xA;Note also that&#xA;\begin{align*}&#xA;\frac{1}{\sqrt{1+\mu\Delta t}} \approx 1-\frac{1}{2}\mu\Delta t+\frac{3}{8}(\mu\Delta t)^2.&#xA;\end{align*}&#xA;Consequently,&#xA;\begin{align*}&#xA;x &amp;amp; \approx \frac{\sigma \sqrt{\Delta t}}{\sqrt{1+\mu\Delta t}}\approx \sigma \sqrt{\Delta t} -\frac{1}{2}\mu\sigma (\Delta t)^{3/2} + \frac{3}{8}\sigma \mu^2 (\Delta t)^{5/2} \approx \sigma \sqrt{\Delta t}.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;u &amp;amp;= e^x =e^{\sigma \sqrt{\Delta t}},\\&#xA;d &amp;amp;= e^{-x} =e^{-\sigma \sqrt{\Delta t}}.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-04-13T13:00:29.093" LastActivityDate="2016-04-13T13:00:29.093" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25392" PostTypeId="2" ParentId="25387" CreationDate="2016-04-13T03:55:53.510" Score="1" Body="&lt;p&gt;there is a C++ implemented version in the gold part of the Kooderive open source project. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2016-04-13T03:55:53.510" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25393" PostTypeId="1" CreationDate="2016-04-13T06:47:12.197" Score="2" ViewCount="256" Body="&lt;p&gt;I'm doing some research for my thesis and I was wondering if it is possible to only use monthly stock price data for 22 stocks and construct Fama-French portfolios out of them and then regress?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What worries me is that the portfolios created will not be &quot;diversified&quot;, may this be a problem and what could a potential solution be? I can only access this small amount of stock data as I want to see how well it can describe a particular industry on the Swedish exchange.&lt;/p&gt;&#xA;" OwnerUserId="20296" LastActivityDate="2020-01-07T03:02:25.317" Title="Regressing using Fama-French portfolios with small amount of stocks" Tags="&lt;regression&gt;&lt;capm&gt;&lt;fama-french&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25394" PostTypeId="1" AcceptedAnswerId="25399" CreationDate="2016-04-13T07:40:08.340" Score="1" ViewCount="218" Body="&lt;p&gt;Say I have the daily index levels for the S&amp;amp;P. It is then very simple to calculate the daily returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I however want to calculate the hedged returns into Euros. I have the daily exchange rates for EURUSD however I'm not sure how to hedge the returns into EURs? &lt;/p&gt;&#xA;" OwnerUserId="8170" LastActivityDate="2016-04-13T16:27:06.277" Title="hedge a USD index into EUR" Tags="&lt;fx&gt;&lt;hedging&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25395" PostTypeId="2" ParentId="25374" CreationDate="2016-04-13T09:16:50.910" Score="1" Body="&lt;p&gt;I am not an expert on the subject, actually I'm looking around for more knowledge. If you can open a trading account with &lt;a href=&quot;https://www.fineco.it/it/public&quot; rel=&quot;nofollow&quot;&gt;Fineco&lt;/a&gt;, they provide the so-called PowerCell (&lt;a href=&quot;https://help.fineco.it/it/600/2421.html&quot; rel=&quot;nofollow&quot;&gt;https://help.fineco.it/it/600/2421.html&lt;/a&gt;), a data-exchange platform that gives you the ability to grab real-time data directly from their trading platform (PowerDesk). It's not a free service, though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be honest I've never tried it, I only played with PowerDesk some time ago to get my feet wet.&lt;/p&gt;&#xA;" OwnerUserId="9424" LastActivityDate="2016-04-13T09:16:50.910" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25396" PostTypeId="2" ParentId="25374" CreationDate="2016-04-13T11:07:50.907" Score="1" Body="&lt;p&gt;IB will provide you with tick data only if you have an account with them. min deposit 3k if age &amp;lt;25 otherwise 5k so i'm guessing that's not an option if you only plan to do a study. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other options are the free quant tick downloader but which is very good but you only have major currencies and indexes -&gt;  &lt;a href=&quot;http://www.strategyquant.com/tickdownloader/&quot; rel=&quot;nofollow noreferrer&quot;&gt;here is link&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It also depends on what kind of contracts you are looking for. If you just want currencies then FXCM has API with free currency tick data and a free demo account which you can &lt;a href=&quot;https://www.fxcm.com/forex-trading-demo/&quot; rel=&quot;nofollow noreferrer&quot;&gt;find here&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively you can try find an Italian broker which integrates with MetaTrader4 and can provide historical data. Some joke brokers have min deposits as low as 10-100$ + probably some monthly data fee. MT4 will provide API integration for u. - this is only forex btw. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For other types of securities i'd say your best bet is an italian broker with low fees and deposit requirements.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For easy strategy testing and API integration in fast C++ check &lt;a href=&quot;http://www.zorro-trader.com/download.php&quot; rel=&quot;nofollow noreferrer&quot;&gt;Zorro&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;also check this post &lt;a href=&quot;https://quant.stackexchange.com/questions/3580/what-is-the-best-live-options-data-api?rq=1&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;that's as good as it gets for free. good luck &lt;/p&gt;&#xA;" OwnerUserId="17895" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-04-13T11:21:41.887" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25397" PostTypeId="2" ParentId="21153" CreationDate="2016-04-13T11:23:50.183" Score="0" Body="&lt;p&gt;quant tick downloader. free with the most accurate free tick data u can find. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;click &lt;a href=&quot;http://www.strategyquant.com/tickdownloader/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;also for yahoo finance data in R try the Quantmod package &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;getSymbols(&quot;^GSPC&quot;, from=&quot;1990-01-01&quot; , to =&quot;2000-01-01&quot; )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="17895" LastActivityDate="2016-04-13T11:23:50.183" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25398" PostTypeId="2" ParentId="25393" CreationDate="2016-04-13T11:33:56.090" Score="1" Body="&lt;p&gt;If you want a portfolio to accurately describe an industry you should not perform any kind of optimization on it. You have 2 options:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;equal weighted portfolio &lt;/li&gt;&#xA;&lt;li&gt;market cap weighted portfolio &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Search for S&amp;amp;P Index Methodology for an example &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and yes, you have a small sample bias issue. i am guessing you want to make factor portfolios sorted on size , one on value etc ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you might end up with 1-2 assets in some portfolios. this is a problem you can not solve and it will affect the significance of your findings, whatever you are looking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ALSO very important is FF data is USA only so if you use it in Sweden it would be a very incorrect approach, unless you use global factors but then you are restricted to 4 factors including momentum - that will not be representative of the tiny market that exists in Sweden.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My only suggestion is to look at a bigger market such as USA (you can use FF 5 factor model(2014) or EU market (3 factor + charhart's momentum)  as a whole where you will have  many assets to pick from. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally you need 50-100 assets in each portfolio. I suggest using S&amp;amp;P 400 , S&amp;amp;P500 and S&amp;amp;P600 together. This will cover like 95% of US market cap across a wide range of firm characteristics - and u can use the 5 factor model &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternativelly use the DAX and other EU indexes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;also if i may sugest. there are 2 other factors which i use Bettign Against Beta and Quality Minus Junk. you can find data &lt;a href=&quot;http://www.econ.yale.edu/~af227/data_library.htm&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;  , the papers you can google yourself. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;good luck &lt;/p&gt;&#xA;" OwnerUserId="17895" LastEditorUserId="17895" LastEditDate="2016-04-13T11:45:31.323" LastActivityDate="2016-04-13T11:45:31.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25399" PostTypeId="2" ParentId="25394" CreationDate="2016-04-13T12:07:45.257" Score="2" Body="&lt;p&gt;if you hedge it means that your USD return equals (neglecting hedging cost) your EUR return. You just change the name. If you want to know what the return measured in EUR is, then you either calculate the price of S&amp;amp;P in EUR and then take returns or equivalently you calculate the product of the local return and the return of the USD in EUR in the following sense:&#xA;$$&#xA;1+ r_{ \text{ S&amp;amp;P in EUR}}  = (1+r_{\text{ S&amp;amp;P in USD}})(1+ r_{\text{1 USD = x EUR}}).&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-04-13T12:07:45.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25400" PostTypeId="1" CreationDate="2016-04-13T13:52:51.893" Score="1" ViewCount="79" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/N6kkI.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/N6kkI.jpg&quot; alt=&quot;Please see the questions below&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A term structure is given as follows. The market convention is compound interest, that is, the present value of one unit at time T is... &lt;/p&gt;&#xA;" OwnerUserId="20301" LastActivityDate="2016-04-13T13:52:51.893" Title="A question about spot rate forward rate and swap rate" Tags="&lt;finance&gt;&lt;finance-mathematics&gt;" AnswerCount="0" CommentCount="4" ClosedDate="2016-04-13T14:43:07.747" ContentLicense="CC BY-SA 3.0" />
  <row Id="25401" PostTypeId="2" ParentId="25365" CreationDate="2016-04-13T15:03:16.830" Score="2" Body="&lt;p&gt;Glasserman's book is the book I would recommend on Monte Carlo methods as well.&lt;/p&gt;&#xA;" OwnerUserId="20303" LastActivityDate="2016-04-13T15:03:16.830" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25402" PostTypeId="2" ParentId="25394" CreationDate="2016-04-13T16:27:06.277" Score="1" Body="&lt;p&gt;The EUR is normally quoted as EURUSD, i.e. the value of one euro measured in dollars, currently about 1.1281.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the S&amp;amp;P index is $sp_t$ and the EURUSD rate is $eu_t$ then the S&amp;amp;P converted into Euros is $sp(t)/eu(t)$. The arithmetic 1 day return on this is $-1+\frac{sp_t}{sp_{t-1}}\frac{eu_{t-1}}{eu_t}$. The logarithmic return is $\ln(sp_t)-\ln(sp_{t-1})+\ln(eu_{t-1})-\ln(eu_t)$&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2016-04-13T16:27:06.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25403" PostTypeId="1" CreationDate="2016-04-13T17:04:30.210" Score="1" ViewCount="61" Body="&lt;p&gt;I am looking at VGENX, and this product has first-quarter and three-month returns of 7.8% and 20.3%, respectively, according to zacks.com. I take it as the three month return is calculated taking into account the three months from a given time, (which is now) - so march, feb and jan - which is essentially the same as Q1. How come is it that the difference is so dramatic and how exactly do we calculate these indicators?&lt;/p&gt;&#xA;" OwnerUserId="20271" LastActivityDate="2016-04-13T17:04:30.210" Title="What is the difference between a three month return and a quarterly return?" Tags="&lt;finance&gt;&lt;mutual-fund&gt;&lt;earnings&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25405" PostTypeId="2" ParentId="4948" CreationDate="2016-04-13T17:23:55.727" Score="6" Body="&lt;p&gt;This should walk you through what you are looking for:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.quantstart.com/articles/Generalised-Autoregressive-Conditional-Heteroskedasticity-GARCH-p-q-Models-for-Time-Series-Analysis&quot; rel=&quot;noreferrer&quot;&gt;https://www.quantstart.com/articles/Generalised-Autoregressive-Conditional-Heteroskedasticity-GARCH-p-q-Models-for-Time-Series-Analysis&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.quantstart.com/articles/ARIMA-GARCH-Trading-Strategy-on-the-SP500-Stock-Market-Index-Using-R&quot; rel=&quot;noreferrer&quot;&gt;https://www.quantstart.com/articles/ARIMA-GARCH-Trading-Strategy-on-the-SP500-Stock-Market-Index-Using-R&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16937" LastActivityDate="2016-04-13T17:23:55.727" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25407" PostTypeId="1" CreationDate="2016-04-13T20:01:23.270" Score="9" ViewCount="1267" Body="&lt;p&gt;I'm trying to calculate the implied volatility for out-of-the-money options, and to a lesser extent, in-the-money options. Most of the literature estimations I could find for implied volatility were for at-the-money options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, given $C(s,t)$, $S$, and $Ke^{-r(T-t)}$, related by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C(s,t) = SN(d_1) - N(d_2)Ke^{-r(T-t)}$$&#xA;$$d_1 = \frac{1}{\sigma\sqrt{T-t}}\left(\log(S/K)+\left(r+\frac{\sigma^2}{2}\right)\left(T-t\right)\right)$$&#xA;$$d_2 = d_1 - \sigma\sqrt{T-t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to calculate $\sigma$. My preliminary investigations have revealed no closed-form solution, so I've resolved to a numerical approximation instead, but I haven't found any literature results on this approximation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would be glad if anyone could refer me to any useful approximations or other results. Other comments on this are also welcome as it's a tricky topic.&lt;/p&gt;&#xA;" OwnerUserId="7460" LastEditorUserId="467" LastEditDate="2016-04-15T03:18:06.030" LastActivityDate="2017-02-19T15:24:18.667" Title="How to calculate Implied Volatility for out-of-the-money options?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;implied-volatility&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25408" PostTypeId="1" AcceptedAnswerId="25470" CreationDate="2016-04-13T20:30:13.307" Score="6" ViewCount="2401" Body="&lt;p&gt;Why can a variance swap be perfectly statically hedged whereas a volatility swap requires dynamic hedging?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Possible reference request to the corresponding literature.&lt;/p&gt;&#xA;" OwnerUserId="11723" LastEditorUserId="11723" LastEditDate="2016-04-16T21:04:04.490" LastActivityDate="2016-04-18T01:17:35.290" Title="Static and Dynamic Hedging of Vol/Var Swaps" Tags="&lt;volatility&gt;&lt;hedging&gt;&lt;swaps&gt;&lt;reference-request&gt;&lt;variance&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="25409" PostTypeId="1" CreationDate="2016-04-13T20:53:49.443" Score="4" ViewCount="187" Body="&lt;p&gt;I am looking for a fast to compute, yet plausible risk attribution measure based on the risk measure used to compute overall risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be more specific, assume that my risk measure is the VaR of a portfolio, how could I attribute the total VaR to the portfolio constituents using just the VaR as risk measure? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One approach I have currently found is Shapley Value, but for a portfolio with $d$ assets this would require $2^d$ calculations of the VaR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The risk measures should fulfill the following properties (as the Shapley Value does):  &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Efficiency (risk attribution measure sums to total risk)  &lt;/li&gt;&#xA;&lt;li&gt;Symmetry (labeling of constituents does not matter)  &lt;/li&gt;&#xA;&lt;li&gt;Dummy axiom (zero risk constituent has zero risk attribution measure) and  &lt;/li&gt;&#xA;&lt;li&gt;Linearity (risk attribution measure can be computed as linear combination of different risk measures).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="20304" LastEditorUserId="20304" LastEditDate="2016-06-13T17:56:43.103" LastActivityDate="2016-06-13T23:39:15.080" Title="Do you know fast to compute, yet plausible risk attribution measures?" Tags="&lt;risk-management&gt;&lt;portfolio&gt;&lt;value-at-risk&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25410" PostTypeId="2" ParentId="25374" CreationDate="2016-04-13T21:45:35.023" Score="0" Body="&lt;p&gt;You can use Bloomberg API as well.&lt;/p&gt;&#xA;" OwnerUserId="20303" LastActivityDate="2016-04-13T21:45:35.023" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25412" PostTypeId="2" ParentId="25409" CreationDate="2016-04-13T22:19:07.557" Score="0" Body="&lt;p&gt;You can check the Euler-based risk attribution/ risk allocation, for example here: &lt;a href=&quot;http://arxiv.org/pdf/0708.2542.pdf&quot; rel=&quot;nofollow&quot;&gt;http://arxiv.org/pdf/0708.2542.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-04-13T22:19:07.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25413" PostTypeId="1" AcceptedAnswerId="25446" CreationDate="2016-04-14T00:38:38.957" Score="5" ViewCount="350" Body="&lt;p&gt;I have read that volatility smiles didn't show up for equity options until 1987.  Can some one give me an example(s) of what markets now still don't have volatility smiles and what an explanation for them not having equity smiles would be?&#xA;thanks&lt;/p&gt;&#xA;" OwnerUserId="20256" LastActivityDate="2021-04-29T16:23:45.607" Title="What are some markets that don't have volatility smiles and why don't they?" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;volatility-smile&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25414" PostTypeId="1" AcceptedAnswerId="25416" CreationDate="2016-04-14T01:16:05.403" Score="1" ViewCount="228" Body="&lt;p&gt;Optimize a portfolio such that the exposure to risk factors is zero and the variance is maximized (instead of traditional minimization problem).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so the optimization problem look like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$maximize\;w^T\,\Sigma\,w$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With following constraints:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\beta_0\,w=0$$&#xA;$$\beta_1\,w=0$$&#xA;$$\beta_2\,w=0$$&#xA;$$\beta_3\,w=0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Sigma - covariance\,matrix$$&#xA;$$\beta_0..._3 - factor\,exposure$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am told that this is a non-convex problem. Can I convert this into an SDP with some relaxations? I could convert the objective function into a quadratic constraint such as below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$w^T\,\Sigma\,w &amp;gt; Min$$&#xA;Please advise.&lt;/p&gt;&#xA;" OwnerUserId="20308" LastEditorUserId="20308" LastEditDate="2016-04-14T06:14:05.093" LastActivityDate="2016-04-14T07:15:53.007" Title="Portfolio optimization - maximize variance with exposure to risk factors equal to zero" Tags="&lt;portfolio-management&gt;&lt;optimization&gt;&lt;portfolio-optimization&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25415" PostTypeId="1" AcceptedAnswerId="25418" CreationDate="2016-04-14T05:30:50.313" Score="1" ViewCount="423" Body="&lt;p&gt;Recently came across building Histroical VaR for commodity forward position. Understood from quants guru the best way to calculate VaR is using full re-valuation, Full reval is computationally intensive . Any other alternative approach will be appreciated . On a different note, my forward position has following risk drivers&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Commodity Price &lt;/li&gt;&#xA;&lt;li&gt;Fx Rate &lt;/li&gt;&#xA;&lt;li&gt;IR Rate (To discount the forward cash flows)&lt;/li&gt;&#xA;&lt;li&gt;Commodity Spread. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I need to find a model that can accommodate all the risk drivers without using full reval and parametric approach.&lt;/p&gt;&#xA;" OwnerUserId="12126" LastEditorUserId="924" LastEditDate="2016-04-14T07:52:44.940" LastActivityDate="2020-05-21T12:11:44.483" Title="Historical VaR on Commodity Physical Forward" Tags="&lt;var&gt;&lt;historical&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25416" PostTypeId="2" ParentId="25414" CreationDate="2016-04-14T07:15:53.007" Score="1" Body="&lt;p&gt;There is no solution. If $w$ is a solution to the original problem, then consider $aw$ with $a&amp;gt;1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\beta_i(aw) = a(\beta_i w) = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$(aw)^T\Sigma(aw) = a^2 (w^T\Sigma w) &amp;gt; w^T\Sigma w$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so the original solution $w$ was not a maximum.&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2016-04-14T07:15:53.007" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25417" PostTypeId="2" ParentId="24862" CreationDate="2016-04-14T07:30:44.663" Score="1" Body="&lt;p&gt;You probably have already figured out. It's very common in computer science that all the primary data types get converted into a string for interfacing. Rcpp simply did the conversion for you. You shouldn't worry about the conversion and just focus only on the algorithm.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2016-04-14T07:30:44.663" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25418" PostTypeId="2" ParentId="25415" CreationDate="2016-04-14T07:45:08.697" Score="2" Body="&lt;p&gt;Why is it so expensive to use the full revaluation method? The commodity forward price is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;F = (S + U)e^{rT}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $S$ is the current spot price, $U$ is the cost of storage between $0$ and $T$ and $r$ is the risk-free rate (you may also have an FX rate if the forward is priced in a different currency from the underlying).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have a joint model for the distribution of $(S, U, r)$ you can sample from this distribution (say 10,000 times), compute the forward price (which is fast) and find the 5th percentile (which is also fast). It takes ~2 milliseconds in MATLAB.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't have a joint distribution, you can sample from the historical distribution instead (e.g. over the last 252 days).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to speed it up, notice that for most commodities the primary risk driver is the price of the underlying, so you can either just sample from the distribution of the underlying, or if you have a model for the price moves (e.g. lognormal) you can calculate the VaR exactly by applying the appropriate transofmration to the VaR of the underlying.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Another approach, which will approximate the VaR, is to expand the pricing formula to first order. For example, for the pricing formula above,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;dF = FTdr + e^{rT}dS + e^{rT}dU&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which expresses the change in the futures value as a linear combination of the risk drivers $dr$, $dS$ and $dU$ (you can do the same for the specific risk drivers for your contracts).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can compute the coefficients in front of the risk drivers before historical sampling, and now just compute VaR as the 5th percentile of your approximate P&amp;amp;L $dF$.&lt;/p&gt;&#xA;" OwnerUserId="924" LastEditorUserId="924" LastEditDate="2016-04-14T09:22:46.783" LastActivityDate="2016-04-14T09:22:46.783" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25419" PostTypeId="2" ParentId="25407" CreationDate="2016-04-14T07:59:31.097" Score="3" Body="&lt;p&gt;Look on Google for &lt;strong&gt;Asymptotic behavior of Implied Volatility Near Infinity&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you will find results like :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$I(K) \stackrel{K\to\infty}{=} \sqrt{\frac{2}{T}}\left(\sqrt{\ln \frac{K}{C(K)}}-\sqrt{\ln\frac{1}{C(K)}}\right) +\text{O}_{K\to \infty}\left(\frac{\ln\ln\frac{1}{C(K)}}{\sqrt{\ln\frac{1}{C(K)}}}\right)$$&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-04-14T07:59:31.097" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25420" PostTypeId="1" CreationDate="2016-04-14T08:49:40.433" Score="1" ViewCount="61" Body="&lt;p&gt;I have another noob question. So, for example, I have ARMA(2,2) model:&#xA;$$ x_{t} = \phi_{1}x_{t-1} + \phi_{2}x_{t-2} + e_{t} + \theta_{1} e_{t-1} + \theta_{2} e_{t-2}$$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I have 2 polynoms: $$1 - \phi_{1}z - \phi_{2}z^{2}$$ and $$1+\theta_{1}z+\theta_{2}z^{2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Their roots are: $z^{\phi}_{1}, z^{\phi}_{2}, z^{\theta}_{1}, z^{\theta}_{2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, $\widehat{\phi_{i}}, \widehat{\theta_{j}}$ are random, where $\widehat{\phi_{i}}, \widehat{\theta_{j}}$ are estimations of $\phi_{i}, \theta_{j}$. I know, that all $\widehat{\phi_{i}}, \widehat{\theta_{j}}$ have normal distributions (&lt;a href=&quot;https://quant.stackexchange.com/questions/25257/distribution-of-ar-ma-coefficients-estimation-in-arma-garch-models/25264#25264&quot;&gt;distribution of AR, MA coefficients estimation in ARMA-GARCH models&lt;/a&gt;).&#xA;My question: what's the distributions of AR part and MA part polynoms roots $z^{\widehat{\phi}}_{i}, z^{\widehat{\theta}}_{j}$?&#xA;Does it any difference in root distributions between ARMA and ARMA-GARCH models?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="19992" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-04-14T09:59:20.243" Title="Distribution of AR and MA polynoms roots in ARMA/ARMA-GARCH models" Tags="&lt;time-series&gt;&lt;garch&gt;&lt;quantitative&gt;&lt;arma&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="25421" PostTypeId="2" ParentId="19074" CreationDate="2016-04-14T09:09:30.440" Score="4" Body="&lt;p&gt;I also recommend to see:&lt;br/&gt;&#xA;&lt;a href=&quot;https://ipythonquant.wordpress.com/&quot; rel=&quot;nofollow&quot;&gt;https://ipythonquant.wordpress.com/&lt;/a&gt; &lt;br/&gt;&#xA;There are some good examples.&lt;/p&gt;&#xA;" OwnerUserId="20288" LastActivityDate="2016-04-14T09:09:30.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25422" PostTypeId="1" CreationDate="2016-04-14T10:13:04.420" Score="1" ViewCount="159" Body="&lt;p&gt;Following bids are received in treasury bond auction. Notified amount is Rs.20,000Million. No amount devolves on the RBI/PDs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No. Of bonds/   Price(Rs.)&lt;br&gt;&#xA;46/             110.185&lt;br&gt;&#xA;45/             110.1875&lt;br&gt;&#xA;44/             110.19&lt;br&gt;&#xA;43/             110.1925&lt;br&gt;&#xA;42/             110.195&lt;br&gt;&#xA;41/             110.1975&lt;br&gt;&#xA;40/             110.2&lt;br&gt;&#xA;39/             110.2025&lt;br&gt;&#xA;At what price will non-competitive bidders receive allotments?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Answer of this question is 110.1980. Please tell me how to calcualte this.&lt;/p&gt;&#xA;" OwnerUserId="19471" LastActivityDate="2016-04-14T10:13:04.420" Title="How to calculate price in non-competitive bidding that bidders will receive?" Tags="&lt;fixed-income&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25423" PostTypeId="1" AcceptedAnswerId="25438" CreationDate="2016-04-14T10:31:39.367" Score="8" ViewCount="623" Body="&lt;p&gt;I just read the CBOE's Whitepapers for VIX and VVIX and notice that they are constructed in the same way, i.e. a range of calls and puts on the respective underlyings (S&amp;amp;P500 in case of VIX, and VIX itself in case of VVIX) weighted inversely to their strikes squared. I understand that the motive is to create a constant gamma portfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is, as the underlyings follow different forms of processes (assume GBM for S&amp;amp;P500, CIR for VIX), how come the construction be the same for both indices? I thought that different processes would lead to different greeks, which in turn would affect the way we build the constant gamma portfolio? Or does it not matter at all?&lt;/p&gt;&#xA;" OwnerUserId="20313" LastActivityDate="2016-04-25T15:55:00.250" Title="Construction of VIX and VVIX" Tags="&lt;volatility&gt;&lt;vix&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25424" PostTypeId="2" ParentId="1039" CreationDate="2016-04-14T11:16:42.953" Score="-2" Body="&lt;p&gt;SWIFT messages are expensive where as FIX is totally free.&lt;/p&gt;&#xA;" OwnerUserId="20315" LastActivityDate="2016-04-14T11:16:42.953" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25425" PostTypeId="1" CreationDate="2016-04-14T14:28:06.307" Score="1" ViewCount="72" Body="&lt;p&gt;it's often heard in my daily work as a programmer in an investment bank, supporting mortgage backed securities desks (passthrough, agency cmo, cmbs, etc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My take is that the terms describe the characteristics of the instruments. Is it used in more specific scope? For example, can we call price, coupon rate, duration, DV01, OAS &quot;metrics&quot; or &quot;indicatives&quot; of a bond? and what about those more specific to MBS products such as &quot;prepayment rate&quot;? &lt;/p&gt;&#xA;" OwnerUserId="20317" LastEditorUserId="42108" LastEditDate="2021-03-01T16:17:03.977" LastActivityDate="2021-03-01T16:17:03.977" Title="what do metrics and indicators mean in the finance context? Like trading of MBS products" Tags="&lt;finance&gt;&lt;quantitative&gt;" AnswerCount="1" CommentCount="3" ClosedDate="2021-03-01T18:41:54.970" ContentLicense="CC BY-SA 4.0" />
  <row Id="25427" PostTypeId="2" ParentId="1039" CreationDate="2016-04-14T15:28:37.393" Score="-2" Body="&lt;p&gt;SWIFT are proprietary and easy to use for all the firms as 98%+ world wide coverage they have.&lt;/p&gt;&#xA;" OwnerUserId="20303" LastActivityDate="2016-04-14T15:28:37.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25428" PostTypeId="1" AcceptedAnswerId="25430" CreationDate="2016-04-14T16:47:43.010" Score="3" ViewCount="62" Body="&lt;p&gt;We assume :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;that a CDO on $n$ names, with a maturity $T$&lt;/li&gt;&#xA;&lt;li&gt;that at a time $\tau&amp;lt;T$ before the maturity of the CDO, these $n$ names have defaulted,&lt;/li&gt;&#xA;&lt;li&gt;that we are the protection buyer of the 22-100 tranche,&lt;/li&gt;&#xA;&lt;li&gt;that the full loss of this portfolio is 60,&lt;/li&gt;&#xA;&lt;li&gt;all the preceding quantities are expressed in percentage of the nominal of the underlying debt portfolio of this CDO.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This is where the question comes :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Will we still continue to pay a premium even between $\tau$ and $T$ ?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-04-15T15:07:27.527" Title="STCDO upper tranche still paying coupons even after all default" Tags="&lt;credit&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25429" PostTypeId="1" CreationDate="2016-04-14T17:01:05.790" Score="4" ViewCount="2381" Body="&lt;p&gt;I am learning machine learning to use it for stock market price forecasting. While doing that I got this question. If we take any country with stock exchange they have more than one investment assests for trading and investing such as commodity, stock, futures,option,forex etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets say a quant wants to make a machine learning model for stock price prediction in US market. There are thousands of companies (about 2800) stocks are listed in NYSE. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How a quant will make a ML model for predicting stock price?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently what I am doing is that I teach a ML model using data(OHLC) from a particular stock(eg APPL between 1990-2016) and use this as my standard model.&#xA;Then I use this standard model to predict AAPLs or other 2800's stock price(eg: IBM,F). But this method has many drawbacks and these are the once which comes into my mind 1) survival ship bias 2) trained only in one stock and only have knowledge about its pattern.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so how a quant trains a ML model? In this US stock market example he/she/it instead of creating a general model for 2800 stocks whether they create 2800 individual models for 2800 stocks and use it for prediction of that stock&lt;/p&gt;&#xA;&#xA;&lt;p&gt;example&#xA;for predicting GM future price, a ML model is created for GM called GMmodel and then it is used for prediction GMs future price. am I right?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Here I meant quant as individuals and institutions who use machine learning for trading&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="16754" LastEditorUserId="16160" LastEditDate="2019-04-01T23:04:21.830" LastActivityDate="2019-04-01T23:04:21.830" Title="How quants use ML models for stock market prediction" Tags="&lt;machine-learning&gt;&lt;prediction&gt;&lt;general&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="25430" PostTypeId="2" ParentId="25428" CreationDate="2016-04-14T17:28:25.843" Score="2" Body="&lt;p&gt;This will depend on the contractual specification. In general, &lt;strong&gt;you do not  need to pay any premium between $\tau$ and $T$.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a CDO with attachment and detachment levels $A$ and $D$. Let $L(t)$ be the cumulative loss of the basket, that is,&#xA;\begin{align*}&#xA;L(t) = \sum_{i=1}^n N_i(1-R_i) 1_{\tau_i \le t},&#xA;\end{align*}&#xA;where $\tau_i$ is the default time, $N_i$ is the notional amount, and $R_i$ is the recovery rate, for the $i^{th}$ entity. Moreover, let &#xA;$L_{[A,\, D]}(t)$ be the tranche loss amount, that is,&#xA;\begin{align*}&#xA;L_{[A,\, D]}(t) &amp;amp;= \min\big(\max(L(t)-A, \,0), \, D-A \big)\\&#xA;&amp;amp;=\max\big(L(t)-A, \,0 \big) - \max\big(L(t)-D, \,0 \big).&#xA;\end{align*}&#xA;Then, the premium payment at time $t_j$ is based on the notional amount given by&#xA;\begin{align*}&#xA;\min\bigg(\big(D-A\big) - L_{[A,\, D]}(t_j),\, \sum_{i=1}^n N_i 1_{\tau_i &amp;gt; t_j}\bigg),\tag{1}&#xA;\end{align*}&#xA;which turns to zero on any premium payment date after $\tau = \max_{i=1}^n \tau_i$.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;EDIT after comments.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The second term $\sum_{i=1}^n N_i 1_{\tau_i &amp;gt; t_j}$ in $(1)$ is added so that, for a CDS index, the premium notional is not more than the underlying basket notional. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that, for an index (i.e, whole tranche $[0, 100\,\%]$), $L_{[A,\, D]}(t)=L(t)$. &#xA;Assuming that the first $i_0$ entities, where $1\le i_0 &amp;lt; n$, have defaulted before the premium payment date $t_j$, while the remaining $n-i_0$ entities have not defaulted yet, then the notional for the premium payment on date $t_j$ is given by&#xA;\begin{align*}&#xA;\min\bigg(\sum_{i=1}^n N_i-\sum_{i=1}^{i_0}N_i(1-R_i),\, \sum_{i=i_0+1}^n N_i\bigg) &amp;amp;= \min\bigg(\sum_{i=i_0+1}^n N_i +\sum_{i=1}^{i_0} N_i R_i,\, \sum_{i=i_0+1}^n N_i\bigg)\\&#xA;&amp;amp;=\sum_{i=i_0+1}^n N_i.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-04-15T15:07:27.527" LastActivityDate="2016-04-15T15:07:27.527" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25431" PostTypeId="2" ParentId="25196" CreationDate="2016-04-14T20:54:31.393" Score="1" Body="&lt;p&gt;The most generic paper I know about market making is &lt;a href=&quot;http://arxiv.org/abs/1105.3115&quot; rel=&quot;nofollow&quot;&gt;&quot;Dealing with the Inventory Risk. A solution to the market making problem&quot;, by Olivier Guéant, C.-A. L and Joaquin Fernandez Tapia&lt;/a&gt;.&#xA;Olivier Guéant just issued a book on this topic: &lt;a href=&quot;https://www.crcpress.com/The-Financial-Mathematics-of-Market-Liquidity-From-Optimal-Execution-to/Gueant/9781498725477&quot; rel=&quot;nofollow&quot;&gt;The Financial Mathematics of Market Liquidity: From Optimal Execution to Market Making&lt;/a&gt;. It recommend it; it is practical and can be used by quants to make markets.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2016-04-14T20:54:31.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25432" PostTypeId="2" ParentId="25407" CreationDate="2016-04-14T23:36:45.547" Score="6" Body="&lt;p&gt;Peter Jaeckel has written various papers on this. &quot;by implication&quot; and &quot;Let's be rational&quot; are the most recent ones. He also provides code on his website &lt;a href=&quot;http://www.jaeckel.org&quot; rel=&quot;noreferrer&quot;&gt;www.jaeckel.org&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Note: the question asked for literature.)&lt;/p&gt;&#xA;" OwnerUserId="1809" LastEditorUserId="467" LastEditDate="2016-04-15T03:17:03.557" LastActivityDate="2016-04-15T03:17:03.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25433" PostTypeId="1" CreationDate="2016-04-14T23:41:11.827" Score="1" ViewCount="91" Body="&lt;p&gt;Is it a must to establish &quot;quote-session&quot; &amp;amp; subscribing to quotes/market data before initiating a &quot;New Order-single(Market-GTC)&quot;?&#xA;I actually can't see any use of quote-session for trading activities &amp;amp; my FIX-bridge is opening &quot;single-new orders&quot; using &quot;order-session&quot; only. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason i want to avoid  quote-session:&#xA;1.It can add up to over-all processing time/latency&#xA;2.I can logon to quote-session &amp;amp; use the quote-flow from a different application.&#xA;Any thoughts on these?&lt;/p&gt;&#xA;" OwnerUserId="20171" LastActivityDate="2018-01-23T02:19:39.370" Title="Initiating new orders with active &quot;order-session&quot; only?" Tags="&lt;fx&gt;&lt;automated-trading&gt;&lt;liquidity&gt;&lt;fix&gt;&lt;quickfix&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25434" PostTypeId="2" ParentId="25423" CreationDate="2016-04-15T04:09:08.747" Score="0" Body="&lt;p&gt;Historically, there has been little correlation between the VVIX and the VIX except at extreme values of the VIX. You are correct it will definitely lead to different greeks, but it does not matter at lot as your Portfolio objective would be fulfilled as methodology for both are same.&lt;/p&gt;&#xA;" OwnerUserId="20303" LastActivityDate="2016-04-15T04:09:08.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25435" PostTypeId="2" ParentId="25433" CreationDate="2016-04-15T04:55:47.430" Score="0" Body="&lt;p&gt;No. It is not a requirement to initiate new orders with active &quot;order-session&quot; only. When trading FX you want to try and minimize over-all processing time/latency whenever possible. This will increase your profits and consistency. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yes. It is always possible to log in to the quote-session and use the quote-flow from another application to maintain flexibility. &lt;/p&gt;&#xA;" OwnerUserId="20321" LastActivityDate="2016-04-15T04:55:47.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25436" PostTypeId="2" ParentId="25423" CreationDate="2016-04-15T05:10:30.883" Score="0" Body="&lt;p&gt;The motive is indeed to construct a constant gamma portfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A position in a VVIX portfolio replicates the volatility of VIX forward prices. VVIX portfolio prices have usually been at a premium relative to future realized volatility. The discount is a volatility risk premium. For nearby expirations, these prices have also tended to surge at the same time as VIX.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But anyway, it doesn't really matter much so don't complicate things by fretting about it.  &lt;/p&gt;&#xA;" OwnerUserId="20321" LastActivityDate="2016-04-15T05:10:30.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25437" PostTypeId="2" ParentId="9291" CreationDate="2016-04-15T07:16:24.847" Score="1" Body="&lt;p&gt;Check out this post: &lt;a href=&quot;http://www.macroption.com/option-greeks-excel/&quot; rel=&quot;nofollow&quot;&gt;http://www.macroption.com/option-greeks-excel/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me know if it answers your query. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Excel equations used to calculate Delta, Gamma, Theta and Vega are shown in the above link. &lt;/p&gt;&#xA;" OwnerUserId="20321" LastActivityDate="2016-04-15T07:16:24.847" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25438" PostTypeId="2" ParentId="25423" CreationDate="2016-04-15T09:21:07.553" Score="6" Body="&lt;p&gt;Strictly speaking, indices such as the VIX are built to &lt;em&gt;approximate&lt;/em&gt; the &lt;strong&gt;expected variance (of log-returns) that would effectively realise under a pure diffusion setting&lt;/strong&gt; (i.e. no jumps)&#xA;$$ \frac{dX_t}{X_t} = \mu(t) dt + \sigma(t,.) dW_t^{\mathbb{Q}} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Writing out the equations (*) yields the famous static replication formula in terms of strike-weighted OTMF options that you refer to, along with the constant Gamma portfolio interpretation you mention.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although many people claim that this constitutes a &lt;strong&gt;model-free estimate of future variance&lt;/strong&gt;, this is not completely true since pure diffusion is assumed all the way (but this does not preclude the fact that the diffusion coefficient $\sigma(t,.)$ could exhibit its own source of stochasticity, i.e. that the true diffusion process could be Heston or local volatility or GBM... hence the model-free adjective).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IMHO, you should really see volatility indices such as the VIX as &lt;strong&gt;expected realised variances assuming pure diffusion&lt;/strong&gt;, in a similar way you look at the implied volatility of an option as the figure you should use in a (wrong) GBM setting to retrieve the (right) observed market price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this clears your confusion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(*) This requires approximating the sample variance of the log-returns observed over $[0,t]$ as the quadratic variation $\langle \ln X \rangle_t$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Edit]&lt;/strong&gt; More details on the derivation + constant Vega feature in this excellent &lt;a href=&quot;http://www.frouah.com/finance%20notes/Variance%20Swap.pdf&quot; rel=&quot;nofollow&quot;&gt;note by Fabrice Rouah&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-04-25T15:55:00.250" LastActivityDate="2016-04-25T15:55:00.250" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="25439" PostTypeId="2" ParentId="25382" CreationDate="2016-04-15T09:40:50.777" Score="8" Body="&lt;p&gt;In the call to &lt;code&gt;Bisection.solve&lt;/code&gt;, the question mark must be the Python function whose zero you want to find.  In your case, it should be something reproducing the logic of &lt;code&gt;IRRSolver::operator()&lt;/code&gt; in Mick Hittesdorf's code, i.e., something like this (which I haven't tested):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cashflows = fixedRateBond.cashflows()&#xA;npv = fixedRateBond.NPV()&#xA;def price_error_given_yield(rate):&#xA;    interestRate = InterestRate(rate, ActualActual(ActualActual.Bond),&#xA;                                Compounded, Annual)&#xA;    return CashFlows.npv(cashflows, interestRate, False) - npv&#xA;&#xA;irr = solver.solve(price_error_given_yield, accuracy, guess, min, max)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The idea is that you write a function that takes a yield and tells you how much the corresponding price differs from the target price; the solver takes the function and returns its zero, that is, the value of the input yield for which the result (i.e. the difference from the target price) is zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This said, Mick's approach is useful for educational purposes but it duplicates functionality that is already available from the bond object. All you need is to call&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;fixedRateBond.bondYield(targetPrice, ActualActual(ActualActual.Bond),&#xA;                        Compounded, Annual)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note, though, that the &lt;code&gt;targetPrice&lt;/code&gt; above should be the clean price, so in your case what's returned by &lt;code&gt;fixedRateBond.cleanPrice()&lt;/code&gt; rather than &lt;code&gt;fixedRateBond.NPV()&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2016-04-15T09:40:50.777" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25440" PostTypeId="1" AcceptedAnswerId="26050" CreationDate="2016-04-15T12:58:31.833" Score="4" ViewCount="1506" Body="&lt;p&gt;I am reading a paper for my bachelor thesis, &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2336122&quot; rel=&quot;nofollow&quot;&gt;Queuing Uncertainty in Limit Order Market&lt;/a&gt; by Bart Zhou Yueshen who is the new AP at INSEAD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the abstract, the author said: &quot;Flickering orders manifest in equilibrium: Book depth first overshoots and then immediately reverts to the stable level.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am new to the market microstructure and low latency trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could someone explain to me what a flickering order is?&lt;/p&gt;&#xA;" OwnerUserId="7684" LastEditorUserId="2183" LastEditDate="2017-06-25T21:45:01.423" LastActivityDate="2017-06-25T21:45:01.423" Title="What are flickering orders?" Tags="&lt;high-frequency&gt;&lt;market-microstructure&gt;&lt;limit-order-book&gt;&lt;terminology&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25441" PostTypeId="2" ParentId="25440" CreationDate="2016-04-15T13:33:31.637" Score="1" Body="&lt;p&gt;I couldn't find the paper linked but typically &quot;&lt;a href=&quot;https://en.wikipedia.org/wiki/Quote_stuffing&quot; rel=&quot;nofollow&quot;&gt;flickering&lt;/a&gt;&quot; an order, is a special case of quote stuffing where the trader either puts out and cancels an order as fast as they can or CFO/modifies an order up and down by a penny when it is outside of the top of book quote.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The goal typically is to either slow down competitors quotes by flooding the gateway interface with noise from the constant quote changes that don't really affect the top of book quote.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is typically considered a separate case from &lt;a href=&quot;https://en.wikipedia.org/wiki/Spoofing_(finance)&quot; rel=&quot;nofollow&quot;&gt;order spoofing&lt;/a&gt; where the user shows a large order on one side of the quote, that they have no intention of being filled, in an attempt to make people think the likely next tick is away from that side.&lt;/p&gt;&#xA;" OwnerUserId="743" LastActivityDate="2016-04-15T13:33:31.637" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="25442" PostTypeId="1" CreationDate="2016-04-15T15:21:07.550" Score="8" ViewCount="10020" Body="&lt;p&gt;In the fixed income literature, is the CSA discounting the same as OIS discounting? Seems they're referring to the same thing, but couldn't find an explicit statement confirming it.&lt;/p&gt;&#xA;" OwnerUserId="16518" LastEditorUserId="20454" LastEditDate="2017-10-09T15:57:32.107" LastActivityDate="2017-10-09T15:57:32.107" Title="CSA discounting vs OIS discounting" Tags="&lt;ois-discounting&gt;&lt;collateral&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25444" PostTypeId="2" ParentId="25442" CreationDate="2016-04-15T17:05:47.927" Score="0" Body="&lt;p&gt;It depends on your CSA agreement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there is a clearing house inside the collateral process governed by your CSA, I might suppose that the CSA discounting will be OIS minus a fee.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-04-15T17:05:47.927" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25445" PostTypeId="2" ParentId="25442" CreationDate="2016-04-15T19:24:22.550" Score="3" Body="&lt;p&gt;OIS discounting is a subset of CSA discounting... technically they are not the same thing. CSA actually stands for Credit Support Annex, which is an Annex to your ISDA agreement with your trading counterpart that governs how your derivative trade is collaterallized (or not). Without the CSA agreement, the trade will get priced at the highest level of counterparty risk and the CSA charge will be significant. Often if there is good GC-eligible asset to collateralize the trades (among major firms) then the discounting is off of OIS curve, hence &quot;OIS discounting&quot;.&lt;/p&gt;&#xA;" OwnerUserId="17552" LastActivityDate="2016-04-15T19:24:22.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25446" PostTypeId="2" ParentId="25413" CreationDate="2016-04-15T19:35:38.510" Score="3" Body="&lt;p&gt;There are tons of market where vol smile doesn't exist - either because no one makes a market on the call/put options (private equity, physical real estate comes to mind) or only the ATM option gets traded infrequently.  You can't have volatility smile without a vol market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand (and maybe more relevant to what you are trying to get at), if only ATM option market exists for the underlying asset, and someone wants a bespoke/one-off price on a strike other than ATM, then you can also call transactions like this &quot;not priced off of a vol smile&quot;.  Lets say you want to buy effectively a 25 delta call (keep in mind you are unlikely to have priced delta precisely). Market maker could price this at ATM vol, and tag on an &quot;extra&quot; which expresses his views on what realized vol + friction cost to trade this look like, so that he could hedge himself, and still satisfy your demand as a client.&lt;/p&gt;&#xA;" OwnerUserId="17552" LastActivityDate="2016-04-15T19:35:38.510" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="25447" PostTypeId="2" ParentId="25349" CreationDate="2016-04-15T19:41:08.803" Score="1" Body="&lt;p&gt;Your return calculation should be on total return, i.e. include dividend income. &#xA;Your signal, if it is price only, then you should take the price series and not adjust.&lt;/p&gt;&#xA;" OwnerUserId="17552" LastActivityDate="2016-04-15T19:41:08.803" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25448" PostTypeId="2" ParentId="23261" CreationDate="2016-04-15T19:48:17.003" Score="2" Body="&lt;p&gt;Duration is technically independent of credit risk. ANY bond's duration is just a matter of coupon, price, discount rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, many issued high yield bond ARE typically shorter, because of a. high coupon (all else equal makes duration shorter) b. they can't issue too long: they themselves don't want to finance expensively, and investors don't want to be stuck with crappy name for 10 years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also given material default probability in high yield, there is a concept of &quot;duration to worst&quot; which is even shorter that's not in existence in investment grade market.&lt;/p&gt;&#xA;" OwnerUserId="17552" LastActivityDate="2016-04-15T19:48:17.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25449" PostTypeId="2" ParentId="23261" CreationDate="2016-04-15T23:47:56.013" Score="1" Body="&lt;p&gt;If you have a 0 coupon junk bond with the same time to maturity as a investment grade bond that pays coupons, the junk bond will have higher duration and visa versa.  Calling it a junk or an ig bond doesn't change the duration, the formula is still the same so you can't say a ig bond always has a larger or smaller duration.&lt;/p&gt;&#xA;" OwnerUserId="20256" LastActivityDate="2016-04-15T23:47:56.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25451" PostTypeId="1" AcceptedAnswerId="25462" CreationDate="2016-04-16T03:02:22.930" Score="3" ViewCount="220" Body="&lt;p&gt;Consider a butterfly spread with strikes $K_1, K_2, K_3$. My professor wrote the model price, $V$, was equal to the following:&#xA;$$V = exp(-rT) * P(K_1&amp;lt;S_T&amp;lt;K_3) * (1/2) \Delta K$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\Delta K = K_2-K_1 = K_3 - K_2$.&#xA;I asked after class why this was true. He said it was obvious and that its just the probability times the area of the spread or something like that. I understand that he is discounting the expected payoff of the option. The option only has value when $S_T$ is between $K_1$ and $K_3$, but why multiply by $0.5\Delta k$. What am I not seeing? Can someone provide a rigorous proof with more steps? &lt;/p&gt;&#xA;" OwnerUserId="20156" LastEditorUserId="20156" LastEditDate="2016-04-16T14:45:26.860" LastActivityDate="2016-04-16T19:48:21.097" Title="Butterfly spread model price" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;european&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25452" PostTypeId="1" CreationDate="2016-04-16T03:18:34.653" Score="1" ViewCount="67" Body="&lt;p&gt;I am working on active equity Portfolio. I have total 30 securities in my Portfolio. Can someone please guide me how can I rank those assets in my portfolio.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Should I rank them on their return?&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;If yes,then how to decide the investment exposure to single asset.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="20303" LastActivityDate="2016-04-16T03:18:34.653" Title="How to Rank assets in Portfolio?" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;" AnswerCount="0" CommentCount="6" ClosedDate="2016-04-16T11:03:09.747" ContentLicense="CC BY-SA 3.0" />
  <row Id="25453" PostTypeId="2" ParentId="23261" CreationDate="2016-04-16T04:26:21.413" Score="1" Body="&lt;p&gt;I agree with the assertion in the OP.  If two bonds are identical then the interest rate sensitivity of the one with higher credit risk is lower. That's because the expected cash flows are smaller due to credit risk.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-04-16T04:26:21.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25454" PostTypeId="2" ParentId="24909" CreationDate="2016-04-16T04:45:07.517" Score="0" Body="&lt;p&gt;Best to download in R studio. use below code to download.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quantmod)&#xA;&#xA;tickers = c(&quot;^NSEI&quot;,&quot;ITC.NS&quot;, &quot;SBIN.NS&quot;, &quot;COALINDIA.NS&quot;, &quot;ICICIBANK.NS&quot;, &quot;ADANIPORTS.NS&quot;, &quot;ONGC.NS&quot;, &quot;MOTHERSUMI.NS&quot;, &quot;INFY.NS&quot;, &quot;TCS.NS&quot;, &quot;WIPRO.NS&quot;)&#xA;&#xA;getSymbols(tickers, from = &quot;2015-01-01&quot;, to = &quot;2016-03-31&quot;)&#xA;&#xA;prices.data &amp;lt;- merge(NSEI[,6], ITC.NS[,6], SBIN.NS[,6], COALINDIA.NS[,6], ICICIBANK.NS[,6], ADANIPORTS.NS[,6], ONGC.NS[,6], INFY.NS[,6], TCS.NS[,6], MOTHERSUMI.NS[,6], WIPRO.NS[,6])&#xA;&#xA;head(prices.data)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;you can use head(prices.data) to check the downloaded prices.&lt;/p&gt;&#xA;" OwnerUserId="20303" LastActivityDate="2016-04-16T04:45:07.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25455" PostTypeId="1" CreationDate="2016-04-16T08:36:34.983" Score="3" ViewCount="219" Body="&lt;p&gt;I have &lt;span class=&quot;math-container&quot;&gt;$n$&lt;/span&gt; return series. I fitted AR(1)-GARCH(1,1) to each return series. Then used &lt;strong&gt;probability integral transform&lt;/strong&gt;, PIT(residuals), to transform the residuals to have a uniform distribution. Then I fitted an &lt;span class=&quot;math-container&quot;&gt;$n$&lt;/span&gt;-dimensional copula to the data. I simulated 1000 points from the copula. Now, how can I transform these simulated points in [0,1], marginal &lt;span class=&quot;math-container&quot;&gt;$u$&lt;/span&gt;, back using the &lt;a href=&quot;https://en.wikipedia.org/wiki/Inverse_transform_sampling&quot; rel=&quot;nofollow noreferrer&quot;&gt;inverse probability transform&lt;/a&gt; (inverse of marginal fitted by AR-GARCH), &lt;span class=&quot;math-container&quot;&gt;$F^{-1}(u)$&lt;/span&gt;.&lt;/p&gt;&#xA;" OwnerUserId="20333" LastEditorUserId="41390" LastEditDate="2020-11-05T09:38:59.513" LastActivityDate="2020-11-05T09:38:59.513" Title="Marginal Distribution using GARCH model: How to do inverse probability transform?" Tags="&lt;time-series&gt;&lt;garch&gt;&lt;copula&gt;&lt;asset-returns&gt;&lt;joint-probability&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="25459" PostTypeId="1" CreationDate="2016-04-16T14:04:04.837" Score="4" ViewCount="2483" Body="&lt;p&gt;I want to hedge a barrier option, say a knock-out call with strike K and barrier B out-of-the-money. My idea was to start from the payoff diagram of this option, and try to accomodate it with vanilla options, as it can be done for instance in the (approximate) replication of a digital call by means of vanilla call options. However in this case it seems that this method fails simply because ofr such an option the payoff diagram is simply the same of a vanilla call... so what can be done??&lt;/p&gt;&#xA;" OwnerUserId="11960" LastActivityDate="2016-04-17T23:42:57.370" Title="How to hedge a barrier option with vanilla options?" Tags="&lt;options&gt;&lt;hedging&gt;&lt;barrier&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25460" PostTypeId="1" AcceptedAnswerId="27513" CreationDate="2016-04-16T18:17:18.403" Score="4" ViewCount="870" Body="&lt;p&gt;I have been attempting an exercise in which I have to determine the value of an american perpetual put, $P$ in terms of the asset value $S$. The solution to the exercise says:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When $S&amp;gt;S_f$ (the optimal exercise boundary) P will satisfy&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$\frac{1}{2}{\sigma}^2 S^2 \frac{\partial^2 P}{\partial S^2}-rP+rS\frac{\partial P}{\partial S}=0$&#xA;  (standard BS pde)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;where $r$ is risk free interest rate and $\sigma$ is the volatility of $S$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that part but then it says to &lt;strong&gt;assume a solution of the form $P=S^{\lambda}$&lt;/strong&gt; where $\lambda$ is a real number. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Can anyone explain the idea behind this assumption?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="20337" LastEditorUserId="21016" LastEditDate="2016-06-10T19:43:35.513" LastActivityDate="2016-06-10T19:43:35.513" Title="Solution for american perpetual put" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;american-options&gt;&lt;black-scholes-pde&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25461" PostTypeId="1" CreationDate="2016-04-16T19:37:30.397" Score="2" ViewCount="194" Body="&lt;p&gt;Where can I find a listing of forward swap rates based on libor. E.g. pricing on a  swap of rates floating over 30 day libor for 3 year fixed, one year from now?&lt;/p&gt;&#xA;" OwnerUserId="20338" LastActivityDate="2016-04-18T14:48:11.830" Title="Swap prices (preferably based on 3 month LIBOR)?" Tags="&lt;swaps&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25462" PostTypeId="2" ParentId="25451" CreationDate="2016-04-16T19:48:21.097" Score="0" Body="&lt;p&gt;Under the risk neutral measure, the expected present value of the butterfly payoff is:&#xA;$$V_0 = e^{-rT} * \int_{S_T=K_1}^{K_3}P(T,S_T)f_{S_T}dS_T$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And if we assume that $f_{S_T}$ is constant from $K_1$ to $K_3$, then:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V_0 = e^{-rT} * \dfrac{1}{\Delta K} \int_{S_T=K_1}^{K_3}P(T,S_T)dS_T = e^{-rT} *\dfrac{\delta^2}{\Delta K} $$&lt;/p&gt;&#xA;" OwnerUserId="20156" LastActivityDate="2016-04-16T19:48:21.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25463" PostTypeId="1" CreationDate="2016-04-16T20:19:05.393" Score="6" ViewCount="337" Body="&lt;p&gt;I am wondering if it's mathematically 'correct' to employ a correlation matrix based on Kendall-correlation when constructing a covariance matrix?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e., is it wrong to multiply standard deviations of e.g. returns with the Kendall-correlation-matrix to form a covariance matrix? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, I am only changing the correlation estimates to be based on Kendall's tau instead of the standard Pearson linear correlation coefficient when 'constructing' my covariance matrix.&lt;/p&gt;&#xA;" OwnerUserId="19949" LastActivityDate="2019-09-15T12:01:55.240" Title="Using Kendall rank correlation to construct a covariance matrix?" Tags="&lt;covariance&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25464" PostTypeId="2" ParentId="25459" CreationDate="2016-04-16T20:47:28.660" Score="4" Body="&lt;p&gt;there are a number of ways to do this. You do have to make some modelling assumptions, however. eg continuity, BS model holds, or log stock price process is independent of level. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most common way is to take the pay-off and geometrically reflect in the barrier. (i.e. pass to log coordinates and reflect). i.e. write the function as $f(x)$ where $x= \log S_t,$ now find a function $g$ such that &#xA;$$&#xA;g(x) = f(x) &#xA;$$&#xA;for $x&amp;gt;\log B$&#xA;and&#xA;$$&#xA;g(x) = -f(2B-X)&#xA;$$&#xA;for $x &amp;lt; \log B.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then statically replicate the $g$ behind the barrier at maturity. (Look up put-call symmetry.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The resulting contract has close to zero value at the barrier. You then take contracts wholly paying off behind the barrier with varying maturity eg  puts struck at $B$ and use them to cancel the value on the barrier iteratively starting at the end and stepping back towards 0. Note this is highly model dependent and requires continuity, however.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is extensive discussion of these topics in my book the Concepts and Practice of Mathematical Finance. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastEditorUserId="1809" LastEditDate="2016-04-17T23:42:57.370" LastActivityDate="2016-04-17T23:42:57.370" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25465" PostTypeId="1" CreationDate="2016-04-16T20:47:48.273" Score="1" ViewCount="17" Body="&lt;p&gt;If I have variables x1,x2,x3,and x4 that have correlation coefficients −0.9,−0.5,0.5, and 0.9 to another variable y, what is the effect of choosing different combinations of them in a multivariate regression. Should I not use the negative ones (−0.9−0.9 and −0.5−0.5), or should I only use the most strongly correlated (ie −0.9−0.9 and 0.90.9)?&lt;/p&gt;&#xA;" OwnerDisplayName="user20277" LastActivityDate="2016-04-16T20:47:48.273" Title="Affect of choosing different combinations of variables for multivariate regression" Tags="&lt;statistics&gt;&lt;probability&gt;&lt;regression&gt;&lt;multivariate&gt;" AnswerCount="0" CommentCount="2" ClosedDate="2016-04-17T00:09:45.460" ContentLicense="CC BY-SA 3.0" />
  <row Id="25466" PostTypeId="2" ParentId="675" CreationDate="2016-04-16T23:52:52.337" Score="0" Body="&lt;p&gt;I would suggest the qq-pat library (&lt;a href=&quot;https://github.com/QuriQuant/qq-pat&quot; rel=&quot;nofollow&quot;&gt;https://github.com/QuriQuant/qq-pat&lt;/a&gt;) with this library you can presently do minimum variance portfolio optimization using some simple code. This is a simple example with three assets:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import pandas as pd&#xA;from pandas_datareader import data&#xA;import datetime&#xA;import qqpat&#xA;&#xA;aapl = data.get_data_yahoo('AAPL',&#xA;                                 start=datetime.datetime(2003, 10, 1),&#xA;                                 end=datetime.datetime(2015, 1, 1))&#xA;&#xA;spy = data.get_data_yahoo('TLT',&#xA;                                 start=datetime.datetime(2003, 10, 1),&#xA;                                 end=datetime.datetime(2015, 1, 1))&#xA;&#xA;ibm = data.get_data_yahoo('IBM',&#xA;                                 start=datetime.datetime(2003, 10, 1),&#xA;                                 end=datetime.datetime(2015, 1, 1))                                 &#xA;&#xA;data = pd.concat([aapl['Adj Close'], spy['Adj Close'], ibm['Adj Close']], axis=1)&#xA;&#xA;analyzer = qqpat.Analizer(data, column_type='price', titles=[&quot;APPL&quot;, &quot;TLT&quot;, &quot;IBM&quot;])&#xA;&#xA;analyzer.min_variance_portfolio_optimization(plotWeights=True)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Additionally you can use the parameter covarianceType to select the type of covariance matrix you want to use. For example you can use the following code for a Ledoit-Wolf type of shrinkage:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;analyzer.min_variance_portfolio_optimization(covarianceType =qqpat.LEDOIT_WOLF, plotWeights=True):&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I will be adding mean-variance optimization soon which will work in the same way. The library uses the CVXPY library for the optimization using the SCS solver which provides the fastest execution. &lt;/p&gt;&#xA;" OwnerUserId="20339" LastActivityDate="2016-04-16T23:52:52.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25467" PostTypeId="1" CreationDate="2016-04-17T02:34:58.790" Score="2" ViewCount="124" Body="&lt;p&gt;I have a small program I'm building to interpolate the discount curve from a portfolio of benchmark bonds. If anyone has any guesses as to whether it's my process, or my code that's messed up I would greatly appreciate it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The math behind it is for the most part straight forward compared to most interest rate models:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The market price of a bond is the discounted value of its cash flows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;MPj = Cj1*D1 + Cj2*D2 +… + Cji*Di + Error&#xA;Where&#xA;MPj = Cash price of bond j &#xA;Cji = ith cash flow for bond j&#xA;Di = Discount factor for the ith cash flow&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Use a polynomial to model the discount factor:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Di = B0 + B1*Ti  + B2*Ti^2 + … + Bk*Ti^k&#xA;Where:    &#xA;Di = Discount factor at time = i &#xA;k = The degree of the polynomial&#xA;Ti = Time until the ith cash flow, in years &#xA;Bk = The coefficients of the model which describe how the time to cash flow determines the discount factor &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Substitute the second equation into the first: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;MPj = Cj1 [B0 + B1*T1 + B2*T12 + … + Bk*T1k] +… + Cji [B0 + B1*Ti + B2*Ti2 + … + Bk*Tik ] + Error&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and in matrix form: &lt;a href=&quot;https://i.imgur.com/VUwPZ1q.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://i.imgur.com/VUwPZ1q.png&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From there, take the squared error of this equation, and minimize it by changing the coefficients. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this process make sense?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I try to implement it, I end up with very large squared errors (~73.5 over 15 bonds).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the data I'm using: &lt;a href=&quot;https://www.dropbox.com/s/zeg5xyt5kq4xcpm/Sample%20Data.csv?dl=0&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.dropbox.com/s/zeg5xyt5kq4xcpm/Sample%20Data.csv?dl=0&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the code I'm using. Any comments are appreciated.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(dplyr)&#xA;library(lubridate)&#xA;&#xA;Polynomial_Degree = 3&#xA;Start_Date &amp;lt;- as.Date(ymd(19990122))&#xA;Face_Value &amp;lt;- 100&#xA;Default_Coeffs_Guess &amp;lt;- rep(0,Polynomial_Degree + 1)&#xA;&#xA;Databank &amp;lt;- read.csv(paste(getwd(), &quot;Sample Data.csv&quot;, sep=&quot;/&quot;), stringsAsFactors = F)&#xA;&#xA;Coupon_Values_List &amp;lt;- Databank %&amp;gt;%&#xA;  select(COUPON) %&amp;gt;%&#xA;  data.frame %&amp;gt;%&#xA;  rename(.,Coupon_Values_List = COUPON)&#xA;&#xA;Coupon_Values_List2 &amp;lt;- Databank %&amp;gt;%&#xA;  select(COUPON) %&amp;gt;%&#xA;  transmute(., Coupon_Values_List2 = COUPON +1) %&amp;gt;%&#xA;  data.frame&#xA;&#xA;Maturity_Date_List &amp;lt;- Databank %&amp;gt;% &#xA;  select(MATURITY) %&amp;gt;% &#xA;  lapply(mdy) %&amp;gt;%&#xA;  lapply(as.Date) %&amp;gt;%&#xA;  data.frame&#xA;&#xA;Bond_Midpricing &amp;lt;- Databank %&amp;gt;%&#xA;  transmute(., Bond_Midpricing = (BID.PRICE+ASK.PRICE)/2) %&amp;gt;%&#xA;  as.matrix&#xA;&#xA;#Functions 1:&#xA;Coupon_Count_Function &amp;lt;- function(Maturity_Date, Coupon_Payment_Frequency){&#xA;&#xA;  Coupon_Count &amp;lt;- 0&#xA;  Coupon_Count &amp;lt;- as.double(ceiling(((as.Date(Maturity_Date)-as.Date(Start_Date))*Coupon_Payment_Frequency)/365)-1)&#xA;&#xA;  return(Coupon_Count)&#xA;}&#xA;&#xA;#Function 2: &#xA;Coupon_Dates_Function &amp;lt;- function(Maturity_Date, Coupon_Payment_Frequency){&#xA;&#xA;  Coupon_Payment_Dates &amp;lt;- NULL&#xA;  Coupon_Count=Coupon_Count_Function(Maturity_Date,2)&#xA;&#xA;  for (i in 0:Coupon_Count) &#xA;  {x &amp;lt;- as.numeric(((as.Date(as.Date(Maturity_Date)-i*365/Coupon_Payment_Frequency))-Start_Date)/365)&#xA;  Coupon_Payment_Dates &amp;lt;- rbind(Coupon_Payment_Dates, data.frame(x))}&#xA;&#xA;  return((Coupon_Payment_Dates))&#xA;}&#xA;&#xA;#Function 3:&#xA;Coupon_Time_Func &amp;lt;- function(Maturity_Dates, Coupon_Payment_Frequency) {&#xA;&#xA;  All_Coupon_Time_List &amp;lt;- apply(Maturity_Dates, 1, Coupon_Dates_Function, Coupon_Payment_Frequency = 2)&#xA;&#xA;  return(All_Coupon_Time_List)&#xA;}&#xA;&#xA;&#xA;#Function 4:&#xA;Independent_Variable_Matrix_Func &amp;lt;- function(Maturity_Date_List, Coupon_Payment_Frequency, Coupon_Values_List, &#xA;                                             Polynomial_Degree){&#xA;&#xA;  df &amp;lt;- data.frame(I(Coupon_Time_Func(Maturity_Date_List, Coupon_Payment_Frequency)),Coupon_Values_List)&#xA;  names(df) &amp;lt;- c(&quot;All_Coupon_Time_List&quot;, &quot;Coupon_Values_List&quot;)&#xA;&#xA;  Temp_List &amp;lt;- vector(mode = &quot;list&quot;, Polynomial_Degree+1)&#xA;  for (i in 1:(Polynomial_Degree+1)) {&#xA;&#xA;    Summation_Column_Coupons &amp;lt;- NULL&#xA;    Summation_Column_Coupons &amp;lt;- mapply(FUN = function(x, y) {y* sum(x^(i-1))}, df$All_Coupon_Time_List, &#xA;                                       df$Coupon_Values_List)&#xA;&#xA;    Summation_Column_With_Principle &amp;lt;- NULL&#xA;    Summation_Column_With_Principle &amp;lt;- mapply(Summation_Column_Coupons, df$All_Coupon_Time_List, Face_Value, &#xA;                                              FUN = function(x,y,z) {x+max(y^(i-1))*z})&#xA;&#xA;    Temp_List[[i]] &amp;lt;- Summation_Column_With_Principle&#xA;  }&#xA;&#xA;  Independent_Variable_Matrix &amp;lt;- NULL&#xA;  Independent_Variable_Matrix &amp;lt;- as.matrix(t(rbind(Independent_Variable_Matrix, do.call(rbind, Temp_List))))&#xA;  return(Independent_Variable_Matrix)&#xA;}&#xA;&#xA;Independent_Variable_Matrix &amp;lt;- Independent_Variable_Matrix_Func(Maturity_Date_List, Coupon_Payment_Frequency, Coupon_Values_List, &#xA;                                                                Polynomial_Degree)&#xA;&#xA;#Function 5:&#xA;Sum_Error_Squared_Func &amp;lt;- function(Coeffs){&#xA;&#xA;Estimated_Prices_Vector &amp;lt;-  Independent_Variable_Matrix %*% Coeffs&#xA;&#xA;Sum_Error_Squared &amp;lt;- sum((Bond_Midpricing - Estimated_Prices_Vector)^2)&#xA;&#xA;return(Sum_Error_Squared)&#xA;}&#xA;&#xA;optim (par = Default_Coeffs_Guess,&#xA;       fn = Sum_Error_Squared_Func,&#xA;       gr = NULL,&#xA;       method  = &quot;L-BFGS-B&quot;,&#xA;       lower   = c(-1000,-1000,-1000,-1000),&#xA;       upper   = c(1000,1000,1000,1000))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="20322" LastActivityDate="2016-04-17T02:34:58.790" Title="Using Market Prices of Bonds to Model the Discount Curve with a Polynomial (Math + R)" Tags="&lt;fixed-income&gt;&lt;r&gt;&lt;optimization&gt;&lt;interpolation&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25468" PostTypeId="1" CreationDate="2016-04-17T10:31:20.763" Score="3" ViewCount="117" Body="&lt;p&gt;I have read somewhere that we can show by using &lt;strong&gt;arbitrage argument&lt;/strong&gt; the following relationship for call option : &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\partial{C_t(T,K)}}{\partial{K}}\leq0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\partial^2{C_t(T,K)}}{\partial{K^2}} \geq0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\partial{C_t(T,K)}}{\partial{T}} \geq0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $C_t(T,K)$ is a call price at time t, for a strike K, with maturity T, obviously we can show these relation by taking the derivation for example with respect to the maturity for the last relation, or for showing the second relation (i.e. the butterfly spread relation, we just need to notice that the payoff is a convex function the strike and then the second derivative is always positive or null,but I am looking for arbitrage argument to show these relations. &#xA;If someone has any idea to show them I would be grateful.&lt;/p&gt;&#xA;" OwnerUserId="18616" LastEditorUserId="848" LastEditDate="2016-04-17T11:46:28.600" LastActivityDate="2016-04-18T07:46:20.780" Title="Qualitative properties of call" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;call&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25469" PostTypeId="2" ParentId="675" CreationDate="2016-04-17T11:01:19.577" Score="4" Body="&lt;h2&gt;Convex Optimisation - CVXOpt and CVXPy.  Textbook by Boyd &amp;amp; Vandenberghe&lt;/h2&gt;&#xA;&lt;p&gt;Aside from &lt;strong&gt;CVXOPT&lt;/strong&gt; (known for its cone programming, see &lt;a href=&quot;http://cvxopt.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://cvxopt.org/&lt;/a&gt;) with extensive documentation by the authors, Boyd and Vandenberghe  &lt;a href=&quot;http://stanford.edu/%7Eboyd/cvxbook/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://stanford.edu/~boyd/cvxbook/&lt;/a&gt;, there is &lt;strong&gt;CVXPY&lt;/strong&gt; which provides an easier front end. &lt;strong&gt;CVXPY&lt;/strong&gt; was designed and implemented by Steven Diamond, with input from Stephen Boyd and Eric Chu. &lt;a href=&quot;http://www.cvxpy.org/en/latest/#&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.cvxpy.org/en/latest/#&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Note that Boyd and Vandenberghe is the go-to textbook (freely available at the links I gave above) by many in this area and many in the convex optimisation field consider this to be the current best reference. Of course, there are many innovations and other researchers differentiate themselves from B&amp;amp;V, but this is one of the best references in the area according to some of these cutting-edge researchers I know.&lt;/p&gt;&#xA;" OwnerUserId="15602" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-04-17T11:01:19.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25470" PostTypeId="2" ParentId="25408" CreationDate="2016-04-17T13:00:23.003" Score="4" Body="&lt;p&gt;There has been a lot of work in recent years on the pricing and hedging of volatility derivatives, leading to some non-obvious, even startling results. It is summarized in Mark Joshi's book More Mathematical Finance among other places.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It all started with the work of Anthony Neuberger on the Log Contract in 1994, which seemed to be a theoretical result about a non-existent contract. It led to a solution for Var swaps, the famous Derman paper More Than You &#xA;Ever Wanted To Know About Volatility Swaps 1999 &lt;a href=&quot;http://www.emanuelderman.com/writing/entry/more-than-you-ever-wanted-to-know-about-volatility-swaps-the-journal-of-der&quot; rel=&quot;nofollow&quot;&gt;1&lt;/a&gt;; see also Bossu's Just What you Need to Know about Variance Swaps &lt;a href=&quot;http://sbossu.com/docs/VarSwaps.pdf&quot; rel=&quot;nofollow&quot;&gt;2&lt;/a&gt; for a simpler treatment. Then Peter Carr and Roger Lee wrote Robust Replication of Volatility Derivatives &lt;a href=&quot;https://math.uchicago.edu/~rl/rrvd.pdf&quot; rel=&quot;nofollow&quot; title=&quot;Carr Lee&quot;&gt;3&lt;/a&gt;in 2009 which addressed Vol Swaps. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To summarize:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A Variance swap can be replicated by a static position in options plus a dynamic position in the underlying. This is a beautiful and very practical result. You have to hold options of all strikes at the given maturity, with holdings inversely proportional to the square of the strike.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A Volatility swap can be replicated with a dynamic position in options. This is not very practical as the transaction costs for continuously buying and selling a large number of options will eat you alive. As a result Vol Swaps are not much traded and Var Swaps are preferred.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, the new method for pricing variance swaps was adopted by the CBOE in 2004 as a way of calculating VIX values. Essentially they compute VIX^2 by this method and then publish the square root of this at frequent intraday intervals. So whenever people look at the VIX they are implicitly relying in this method.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-04-18T01:17:35.290" LastActivityDate="2016-04-18T01:17:35.290" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25471" PostTypeId="1" AcceptedAnswerId="25485" CreationDate="2016-04-17T16:24:38.157" Score="5" ViewCount="632" Body="&lt;p&gt;I am attempting to access 1 minute trade data for 50 securities using Bloomberg API (rblpapi). Following is the code I got from the CRAN:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;con &amp;lt;- blpConnect() &#xA;security&amp;lt;- &quot;NIFTY Index&quot; &#xA;field&amp;lt;- &quot;INDX_MEMBERS&quot;sec&amp;lt;- bds( security, field) &#xA;getBars(&quot;XYZ IS EQUITY&quot;, eventType = &quot;TRADE&quot;, barInterval = 01, &#xA;        startTime = Sys.time() - 1360 * 60 * 6, endTime = Sys.time(),&#xA;        options = NULL, verbose = FALSE, returnAs = getOption(&quot;blpType&quot;,&quot;matrix&quot;), &#xA;tz= Sys.getenv(&quot;TZ&quot;, unset = &quot;UTC&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to access all 50 securities without repeating my code. Is there a way to directly call a list of member securities of an index from Bloomberg and use it to access intraday data in one go. Also, when I input specific dates such as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;getBars(&quot;XYZ IS EQUITY&quot;, eventType = &quot;TRADE&quot;, barInterval = 01,&#xA;    startTime = as.Date(&quot;2014-01-01 03:30:00&quot;), endTime = as.Date(&quot; 2014-02-04 09:30:00&quot;),&#xA;    options = NULL, verbose = FALSE, returnAs = getOption(&quot;blpType&quot;,&#xA;                                                          &quot;matrix&quot;), tz = Sys.getenv(&quot;TZ&quot;, unset = &quot;UTC&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;it shows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error: startTime and endTime must be Datetime objects&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="15390" LastEditorUserId="15390" LastEditDate="2016-04-17T16:37:47.437" LastActivityDate="2016-04-18T18:41:04.320" Title="Bloomberg &amp; R: Accessing multiple securities with getBars() in R" Tags="&lt;equities&gt;&lt;r&gt;&lt;programming&gt;&lt;bloomberg&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25472" PostTypeId="1" AcceptedAnswerId="25473" CreationDate="2016-04-17T20:21:25.670" Score="5" ViewCount="1330" Body="&lt;p&gt;I apologize if this is way too basic a question, but I'm an absolute beginner to trading and am in the process of learning the fundamentals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I'm trying to model a (10-day) SMA backtest in Excel, where signals are generated due to crossovers between the closing prices and the 10-day SMA. I calculate the daily and cumulative returns based on closing prices for the asset, and then get the daily returns of the strategy by multiplying the daily asset returns by 1 (if long) or -1 (if short) (this method of getting strategy daily returns has been suggested in a couple of blogs that I'd referred to previously).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally I calculate the cumulative returns for the strategy. The problem is that the cumulative returns grow insanely large (I guess up to the order of $10^{15}$). I can't understand what I'm doing wrong - whether the formulae to compute returns are wrong or if the logic itself is incorrect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would be grateful if someone could check out the excel sheet (google drive link below) and let me know or at least give me a hint of where I'm making a mistake (or mistakes).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://drive.google.com/file/d/0B-2nHF8a0j3XZXZNZ2tNMzJaWTQ/view?usp=sharing&quot;&gt;Link to excel file&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19057" LastActivityDate="2017-10-12T21:07:00.267" Title="Simple Moving Average Backtest: Cumulative Return too high" Tags="&lt;quant-trading-strategies&gt;&lt;backtesting&gt;&lt;moving-average&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25473" PostTypeId="2" ParentId="25472" CreationDate="2016-04-17T20:46:03.870" Score="2" Body="&lt;p&gt;The moving average is determined as of the close of a particular day. Then to calculate the P&amp;amp;L you have to multiply today's state (1 or -1) by TOMORROWs return, instead you are using todays! So for example the formula in H13 needs to be E14/E13-1 and not as you incorrectly have it E13/E12-1.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;HTH&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-04-17T20:52:22.530" LastActivityDate="2016-04-17T20:52:22.530" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25474" PostTypeId="1" CreationDate="2016-04-18T02:33:21.680" Score="1" ViewCount="1425" Body="&lt;p&gt;My professor used this: &#xA;12%, monthly-pmt, 30-yr GPM with 4 annual step-&#xA;ups of 7.5% each, then constant after year 4:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$L=PMT \left[&#xA;PV(0.01,12,1) &#xA;+ \frac{1.075}{1.01^{12}}PV(0.01,12,1)&#xA;+ \frac{1.075^2}{1.01^{24}}PV(0.01,12,1) \\ &#xA;+ \frac{1.075^3}{1.01^{36}}PV(0.01,12,1)&#xA;+ \frac{1.075^4}{1.01^{48}}PV(0.01,312,1)\right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just don't understand why would one multiply the present value of 1$ with the actual present value of the growth of the dollar and so forth.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why isn't this working&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$PMT_1 = L\bigg/\left(\frac{1-((1+g)/(1+r))^N}{r-g}\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This formula is so much more logical but I'm getting something that doesn't make sense at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.financeformulas.net/Growing-Annuity-Payment.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.financeformulas.net/Growing-Annuity-Payment.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's so confusing for me now.&lt;/p&gt;&#xA;" OwnerUserId="20348" LastEditorDisplayName="user13444" LastEditDate="2016-12-14T07:12:48.437" LastActivityDate="2016-12-14T07:12:48.437" Title="How to calculate the initial payment of a graduated payment mortgage (GPM). Real estate Mortgage analysis" Tags="&lt;finance&gt;&lt;mbs&gt;&lt;time&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25475" PostTypeId="1" CreationDate="2016-04-18T07:15:10.260" Score="3" ViewCount="415" Body="&lt;p&gt;I was wondering if any quant guru can help . How to calculate the PnL explained using full reval aka scenario based = &gt; t - (t-1) approach for linear instrument. I am finding difficulty to understand the order for the input and how to move them. My portfolio contains Physical forward and future. &lt;/p&gt;&#xA;" OwnerUserId="12126" LastActivityDate="2020-10-19T16:05:05.410" Title="PnL Explained Using Scenario(Full Reval Model)" Tags="&lt;portfolio&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25476" PostTypeId="2" ParentId="25468" CreationDate="2016-04-18T07:46:20.780" Score="7" Body="&lt;p&gt;$$\begin{array}{rcl}&#xA;(1) &amp;amp;  \partial_KC_t(T,K) &amp;amp; \leq 0 \\&#xA;(2) &amp;amp;  \partial^2_KKC_t(T,K) &amp;amp; &amp;gt; 0 \\&#xA;(3) &amp;amp; \partial_T C_t(T,K) &amp;amp; \geq 0 \\&#xA;\end{array}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $(1)$ doesnot hold, it exists $K_1&amp;lt;K_2$ such that $C_t(T,K_1)&amp;lt;C_t(T,K_2)$. Then as barrycarter said in his comment, you sell $C_t(T,K_2)$ and you buy $C_t(T,K_1)$, so your cash position is $C_t(T,K_2)-C_t(T,K_1)&amp;gt;0$, at maturity you receive $(S_T-K_1)^+-(S_T-K_2)^+\geq 0$. There is an arbitrage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $(2)$ doesnot hold, it exists $\epsilon&amp;gt;0$ and $K&amp;gt;\epsilon$ such that $C_t(T,K-\epsilon)+C_t(T,K+\epsilon)\leq 2 C_t(T,K)$. Then you buy $C_t(T,K-\epsilon)$ and $C_t(T,K+\epsilon)$ and you sell $2C_t(T,K)$, your cash position is $2 C_t(T,K) - C_t(T,K-\epsilon)+C_t(T,K+\epsilon)\geq 0$. at maturity you get $(S_T-(K+\epsilon))^++(S_T-(K-\epsilon))^+-2(S_T-K)^+\geq 0$ which is the butterfly spread you mention. Note that with non-null probability, this payoff is positive. There is again an arbitrage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming you talk about american call options. If $(3)$ doesnot hold, it exists $T_1&amp;lt;T_2$ such that $C_t(T_1,K)&amp;gt;C_t(T_2,K)$. Then you buy $C_t(T_2,K)$, you sell $C_t(T_1,K)$, your cash position is $C_t(T_1,K)-C_t(T_2,K)&amp;gt;0$. At any time $\tau\leq T_1$, the buyer of $C_t(T_1,K)$ can exercise its right, and then you owe him $(S_\tau-K)^+$, but since you buy an american option $C_t(T_2,K)$, you can also exercise your right at time $\tau$ and you net position. Again since you build a positive cash position leading to a non-negative positive (here equal to $0$), you build an arbitrage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this third relationship will hold with any american options. And note that the two first relationships will also work with american calls by adapting the $T$ to $\tau$ being the exercise time of the agent who buys call options.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-04-18T07:46:20.780" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25477" PostTypeId="2" ParentId="14232" CreationDate="2016-04-18T08:49:27.837" Score="0" Body="&lt;p&gt;It seems that uniformly integrable martingales, as described by &lt;em&gt;quasi&lt;/em&gt;, account for a specific class of strict local martingales. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A martingale on $[0,\infty)$ that is not uniformly integrable (like geometric Brownian motion) is a uniformly integrable martingale on $[0,t]$ for every $t\in [0,\infty)$. Consequently, mapping $[0,\infty]$ onto $[0,1]$ as done above creates a local martingale that is a true martingale on every interval $[0,s]$ for $s\in [0,1)$. The local martingale property appears only at $1$ (as the non-uniform integrability appeared at $\infty$). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nevertheless, strict local martingales like $Y$, solution of the CEV model given as example by &lt;em&gt;Kiwiakos&lt;/em&gt;, are strict on every interval $[0,s]$ for $s\in [0,1)$ ($E[Y_s]$ is strictly decreasing in $s$). This suggest that those processes are not associated with a non-uniformly integrable true martingale on $[0,\infty)$. Also, here stopping times will generally be path-dependent (and not deterministic).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know if for such local martingales one can still relate local path behaviour to non-uniformly integrable martingales, however, viewing the local martingale property as appearing at a single &quot;closure point&quot; seems too narrow.&lt;/p&gt;&#xA;" OwnerUserId="20350" LastEditorUserId="20350" LastEditDate="2016-04-18T15:30:41.070" LastActivityDate="2016-04-18T15:30:41.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25478" PostTypeId="1" CreationDate="2016-04-18T09:25:52.443" Score="4" ViewCount="954" Body="&lt;p&gt;Let us assume that each month of the year (up to November) we calculate a VaR (say 99%) with holding period to the end of the year. Thus the holding period starts with 12 months and goes down to 1 month in November. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously the event of a breach of my June VaR is not independent of the event of a breach of my Augus VaR (similar to &lt;a href=&quot;https://quant.stackexchange.com/questions/4210/var-backtesting-with-overlapping-time-intervals&quot;&gt;here&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how can I calculate the significance of the number of breaches? How can I take the dependence into account?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: At first sight it looks a bit artificial but a lot of institutions want to measure their risk in an (accounting) year. The next step is VaR and its backtest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If look at monthly log-returns then in October I estimate&#xA;$$&#xA;P[R_1+ R_2 + R_3 \le VaR_1]&#xA;$$&#xA;and in November I look at&#xA;$$&#xA;P[R_2 + R_3 \le VaR_2].&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another edit:&#xA;Say I estimated my VaR in Jan, Feb, up to Novenber and in December the market drops by 50%. Then I can have a breach in all my VaR estimates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the usual setting I estimate VaR and check on the following period. Then I estimate VaR again and check on the next period. Thus there is no overlap and the above problem can not happen!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could only form series of &quot;estimate yearly loss in Month x&quot; and e.g. look at all January VaRs for the year 2000, 2001, .. 2016. They would be (more or less) independent. Then I could look at Februaries ... this would take away the overlap. But I would only have a few observations.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2021-01-02T10:27:04.310" Title="Backesting VaR on overlapping intervals to year's end" Tags="&lt;risk-management&gt;&lt;backtesting&gt;&lt;var&gt;&lt;value-at-risk&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25479" PostTypeId="2" ParentId="25461" CreationDate="2016-04-18T14:13:06.930" Score="1" Body="&lt;p&gt;If you can get access to a professional bloomberg, the code for a 1yr-3yr forward swap in USd versus 3 month libor is USFS013 .Index Go.    I dont know any other way.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-04-18T14:13:06.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25480" PostTypeId="2" ParentId="25461" CreationDate="2016-04-18T14:48:11.830" Score="0" Body="&lt;p&gt;Are you sure you don't want just to look at ED futures?  For short term swaps they are very easy to use and have listed prices.  The convexity adjustment is negligible.&lt;/p&gt;&#xA;" OwnerUserId="20092" LastActivityDate="2016-04-18T14:48:11.830" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25481" PostTypeId="1" AcceptedAnswerId="25600" CreationDate="2016-04-18T16:16:19.323" Score="3" ViewCount="1108" Body="&lt;p&gt;I am having a hard time to understand the concept of an &lt;a href=&quot;https://en.wikipedia.org/wiki/Adapted_process#Definition&quot; rel=&quot;nofollow noreferrer&quot;&gt;adapted stochastic process&lt;/a&gt;. Using an analogy to finance, I have been told we can think of adaptiveness of a stock price process as having an access to a Bloomberg terminal and be able to check up the price of the stock at time $ t$, i.e. at each point in time the price of the stock is known. I have also learned that a &lt;a href=&quot;https://en.wikipedia.org/wiki/Stochastic_process#Definition&quot; rel=&quot;nofollow noreferrer&quot;&gt;stochastic process&lt;/a&gt; is nothing but a collection of random variables and can thus be interpreted as function-valued random variable. Stochastic processes in general need not be adaptive, but as e.g. Shreve (Stochastic Calculus for Finance vol.2 page 53, 2004) notes it is often safe to assume for finance related stochastic processes to be adapted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let us assume that we are dealing with an adapted stochastic process X and fix $ t$. To me it seems that by doing this we will (at this arbitrary point in time) obtain a random variable $ X(\omega; \text{t fixed})$ by the definition of a stochastic process. But wait a minute, the value of a random variable should not be known, right? On the contrary, it should be random!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How is this seeming puzzle reconciled? To me it is not clear how the definition of an adapted process implies that the value of $ X(\omega; \text{t fixed})$ is known at time $ t$. Rather, it just states that at the fixed $ t$ $ X(\omega; \text{t fixed})$ is $ \mathcal{F}_{t} $-measurable, which is not enough. Just imagine a case of a single random variable (just one point in time) Y on $ (\Omega, \mathcal{F})$ (i.e. Y is a $ \mathcal{F} $-measurable function). Obviously the value of Y is not known but random.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have found some earlier related questions (e.g. &lt;a href=&quot;https://math.stackexchange.com/questions/690531/intuition-for-random-variable-being-sigma-algebra-measurable&quot;&gt;this&lt;/a&gt;) but these have not clarified the matter to me. Thank you in advance for the help!&lt;/p&gt;&#xA;" OwnerUserId="17650" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2016-04-30T12:18:01.263" Title="Why is the value of an adaptive stochastic process known at time t?" Tags="&lt;option-pricing&gt;&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25482" PostTypeId="1" AcceptedAnswerId="38858" CreationDate="2016-04-18T16:18:18.123" Score="3" ViewCount="179" Body="&lt;p&gt;Can we infer a range of future all-in costs for I/O ARMs with current index forward curves?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially, just taking a worksheet like &lt;a href=&quot;http://pistulka.com/Excel_Shared/APR-ARM.xlsx&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; and adding some type of ramping capability after the fixed rate period ends. I'm interested in how quickly ARM rates adjust to changes in indices, and implications for borrowers given market expectations about the future path of monetary policy decisions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On a less quantitative note, loan characteristics are hard to find; all of the premium sources at my disposal focus on capital markets. Margin is likely some function of FICO, LTV etc. Can we reliably infer some of these from publicly available data? Every underwriter has slightly different standards, but I'm sure there are white papers out there somewhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Advanced applications would include rate stressing, i.e. putting Fitch's forward LIBOR curve into a given amortization profile and seeing how much P&amp;amp;I we end up owing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Changes to property values over time would be very interesting to model as well - if I take out an I/O loan, LIBOR rises in lockstep with Fed Funds, and the underlying property appreciates or depreciates ten percent, what does the IRR look like?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First post on this forum - happy to be here. Please give feedback if this is off-topic so I can more meaningfully contribute moving forward. Please let me know if anything is unclear. Thanks!&lt;/p&gt;&#xA;" OwnerUserId="20357" LastEditorUserId="16472" LastEditDate="2018-03-19T12:47:23.163" LastActivityDate="2018-12-14T17:03:35.667" Title="Modeling Interest-only Mortgages" Tags="&lt;interest-rates&gt;&lt;probability&gt;&lt;modeling&gt;&lt;real-estate&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25483" PostTypeId="1" AcceptedAnswerId="25488" CreationDate="2016-04-18T16:26:56.447" Score="3" ViewCount="981" Body="&lt;p&gt;Say, for instance, that you've set up a delta-neutral straddle (i.e. you are long volatility, short time decay) and want to dynamically hedge your gamma in order to offset losses due to theta. Is there a commonly used framework that compares the cost of rebalancing the hedge against the growing theta exposure? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recall reading that a 1 s.d. move represents the break even point between gamma and theta, so that or a slightly larger move that would cover both theoretical loss due to time decay and the real, fixed execution cost associated with rebalancing seems like a reasonable place to start, but I'm not sure why that would be the only place to do it. &lt;/p&gt;&#xA;" OwnerUserId="19017" LastEditorUserId="19017" LastEditDate="2016-04-18T16:51:49.947" LastActivityDate="2016-12-20T08:55:36.813" Title="How frequently do traders rebalance their gamma hedges?" Tags="&lt;hedging&gt;&lt;gamma&gt;&lt;delta-neutral&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25484" PostTypeId="1" CreationDate="2016-04-18T17:52:05.487" Score="5" ViewCount="591" Body="&lt;p&gt;Say I need to predict what the spot rate between USD and CAD will be in 3 months. What will be the most accurate measure or model that I could possibly use? Does the 3 month forward rate necessarily represent the best guess for the future rate, or is there a model or measure that consistently estimates a superior guess for the future price?&lt;/p&gt;&#xA;" OwnerUserId="17712" LastEditorUserId="19645" LastEditDate="2016-04-22T18:01:19.967" LastActivityDate="2017-11-19T18:47:17.187" Title="Predicting the Future FX Spot Rates" Tags="&lt;fx&gt;&lt;trading&gt;&lt;forecasting&gt;&lt;spot-rate&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25485" PostTypeId="2" ParentId="25471" CreationDate="2016-04-18T18:41:04.320" Score="1" Body="&lt;p&gt;Briefly:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Some functions simply are not vectorised.  If you want to loop &lt;code&gt;getBars()&lt;/code&gt; over a vector of symbols, write another wrapper doing the looping.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;As our documentation says: &lt;em&gt;startTime: A Datetime object with the start time, defaults to one hour before current time&lt;/em&gt; (and ditto for endTime) you need to supply a DateTime object, and &lt;code&gt;as.POSIXct()&lt;/code&gt; is one way of doing it.  Sticking date and time into &lt;code&gt;as.Date()&lt;/code&gt; is not.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="69" LastActivityDate="2016-04-18T18:41:04.320" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25486" PostTypeId="2" ParentId="25484" CreationDate="2016-04-18T22:37:58.757" Score="3" Body="&lt;p&gt;It is very difficult to outperform the &quot;random walk without drift&quot; benchmark. The forward rate is not a particularly good predictor as it is often biased.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nevertheless some economists claim it is possible. Here is a literature review (Barbara Rossi: Exchange Rate Predictability, Journal of Economic Literature&#xA;    vol. 51, no. 4, December 2013):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://repositori.upf.edu/bitstream/handle/10230/20816/1369.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://repositori.upf.edu/bitstream/handle/10230/20816/1369.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From reading this it would seem that Taylor Rules and Net Foreign Assets might hold some promise. Since the CAD is a Commodity Currency, commodity prices may be worth investigating.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it looks like a tough job.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2017-11-19T18:47:17.187" LastActivityDate="2017-11-19T18:47:17.187" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25487" PostTypeId="1" CreationDate="2016-04-18T23:19:13.443" Score="1" ViewCount="98" Body="&lt;p&gt;Let $X$ a Gaussian process defined by &#xA;$$&#xA;X_t=\int_{0}^{t}\left(\frac{1}{\sigma}\left(r_s-\frac{\sigma^2}{2}\right)-\rho\sigma_P(s,T)\right)\mathrm{d}s+\sqrt{1-\rho^2}Z_2(t)+\rho Z_1(t);\;\;t\in[0,T]&#xA;$$&#xA;Where $\sigma&amp;gt;0$, $T&amp;gt;0$, $\rho\in]-1,+1[$, $Z_1$ and $Z_2$ two independent Brownian motion defined on the same probability space, $\sigma_P(s,T)$ a deterministic function and $r_t$ a process whose dynamics are described by the Vasicek model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem is to define a new probability measure under which the process $X$ is a Brownian motion. The theorem Girsanov allows this construction when the Novikov condition is checked, namely:&#xA;$$&#xA;E\left(\exp\left(\frac{1}{2}\int_{0}^{T}\left(\frac{1}{\sigma}\left(r_s-\frac{\sigma^2}{2}\right)-\rho\sigma_P(s,T)\right)^2\mathrm{d}s)  \right)\right)&amp;lt;\infty&#xA;$$&#xA;I would like your opinion on this issue, thank you in advance.&lt;/p&gt;&#xA;" OwnerUserId="20360" LastActivityDate="2016-04-18T23:19:13.443" Title="On the construction of a Brownian motion from a Gaussian process" Tags="&lt;stochastic-processes&gt;&lt;probability&gt;&lt;brownian-motion&gt;&lt;girsanov&gt;&lt;vasicek&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25488" PostTypeId="2" ParentId="25483" CreationDate="2016-04-19T00:01:25.047" Score="1" Body="&lt;p&gt;Commonly used procedures are to hedge;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;when a 1 SD move has happened, or &lt;/li&gt;&#xA;&lt;li&gt;when your delta position exceeds some risk limit, or   &lt;/li&gt;&#xA;&lt;li&gt;once a day, or&lt;/li&gt;&#xA;&lt;li&gt;based on your desired delta position.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;All are used. I personally prefer (2).&lt;/p&gt;&#xA;" OwnerUserId="18388" LastEditorUserId="-1" LastEditDate="2016-12-20T08:55:36.813" LastActivityDate="2016-12-20T08:55:36.813" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25490" PostTypeId="1" CreationDate="2016-04-19T01:07:29.447" Score="1" ViewCount="634" Body="&lt;p&gt;I am analysing a problem where I have two correlated stocks described by Brownian motions&#xA; $$ \frac{dS^{1}_{t}}{S^{1}_{t}}=\mu_{1} dt + \sigma_{1} dW^{1}_{t} \quad \quad (1)$$&#xA;$$ \frac{dS^{2}_{t}}{S^{2}_{t}}=\mu_{2} dt + \sigma_{2} dW^{2}_{t}   \quad \quad (2)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the $$ Y_{t} = 2 S^{1}_{t} S^{2}_{t} \quad \quad (3)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for SDE to this equation.&#xA; &lt;br&gt;&#xA; &lt;br&gt;&#xA;I know that given the below two geometric Brownian motions &#xA; $$ dX^{1}_{t} =z_{1} dt + Y_{1} dBt \quad \quad (4)$$&#xA; $$ dX^{2}_{t} =z_{2} dt + Y_{2} dBt\quad \quad (5)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the below equality can be derived &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d(x^{1}_{t} x^{2}_{t})=x^{1}_{t} dx^{2}_{t} + x^{2}_{t} dx^{1}_{t} + Y_1 Y_2 dt \quad \quad (6)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know as well that the two Brownian motions can be presented as &#xA;$$ W_t = \rho W^{1}_{t} + \sqrt{1-\rho^2} W^{2}_{t} \quad \quad (7)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However when I try to apply the properties to the above problem I am getting confused.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The manual says that $$\frac{dY_t}{Y_t} = 2 \big{(} \frac{dS^{1}_{t}}{S^{1}_{t}} + \frac{dS^{2}_{t}}{S^{2}_{t}} + \frac{ &amp;lt;S^{1} S^{2}&amp;gt;_t}{S^{1}_{t} S^{1}_{t}} \big{)} \quad \quad (8)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;br&gt;&#xA;&lt;strong&gt;Can anybody clarify how the $&amp;lt;S^{1} S^{2}&amp;gt;_t$ is derived? &lt;br&gt; &#xA; how this relates to the $Y_1 Y_2 dt$ from the eq.(6) ?  why sigmas were not used analogically ? &lt;br&gt; &#xA;and what it should be substituted for in the further calculation?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="18670" LastActivityDate="2016-04-19T01:07:29.447" Title="SDE for a portfolio of two correlated assets $ Y_{t} = 2 S^{1}_{t} S^{2}_{t}$" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="25491" PostTypeId="1" CreationDate="2016-04-19T01:15:53.860" Score="1" ViewCount="389" Body="&lt;blockquote&gt;&#xA;&lt;p&gt;Consider a two-period binomial model for a risk asset with each period equal to a year and take &lt;span class=&quot;math-container&quot;&gt;$S_0 = 1$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$u = 1.5$&lt;/span&gt;, and &lt;span class=&quot;math-container&quot;&gt;$l = 0.6$&lt;/span&gt;. The interest rate for both periods is &lt;span class=&quot;math-container&quot;&gt;$R = .1$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;a.) Price an American put option with &lt;span class=&quot;math-container&quot;&gt;$K = .8$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;b.) Price an American call option with &lt;span class=&quot;math-container&quot;&gt;$K = .8$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;c.) Price an American option with path dependent payoff which pays the running maximum of the path.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Note: The running maximum at time &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt; is the maximum of the price until or at time &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;To clarify when it says &amp;quot;pays the running maximum&amp;quot;, it means that the payoff is the running maximum, i.e. max(S_0,S_1,S_2).&lt;/p&gt;&#xA;&lt;p&gt;Attempted solution a.) We have &lt;span class=&quot;math-container&quot;&gt;$S_0 = 1$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$S_0u = 1.5$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$S_0l = 0.6$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$S_0u^2 = 2.25$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$S_0ul = .9$&lt;/span&gt;, and &lt;span class=&quot;math-container&quot;&gt;$S_0l^2 = .36$&lt;/span&gt;. The risk neutral probabilities are &lt;span class=&quot;math-container&quot;&gt;$$\hat{\pi}_u = \frac{1+R-l}{u-l} = .5556 \ \ \ \ \ \ \ \hat{\pi}_l = \frac{u-R-1}{u-l} = .4444$$&lt;/span&gt;&#xA;Now we need to calculate the continuation values at nodes &lt;span class=&quot;math-container&quot;&gt;$t = 0, t = 1$&lt;/span&gt; price-down, and &lt;span class=&quot;math-container&quot;&gt;$t = 1$&lt;/span&gt; price up which we denote &lt;span class=&quot;math-container&quot;&gt;$C_0,C_{1,1},C_{1,2}$&lt;/span&gt; respectively. We will then compare the continuation values and exercise value at each node in a backward manner. At time &lt;span class=&quot;math-container&quot;&gt;$t = 1$&lt;/span&gt;, the continuation value is &lt;span class=&quot;math-container&quot;&gt;$$C_{1,2} = \frac{1}{1+R}\hat{\mathbb{E}}\left[(K-S_T)_{+}|S_1 = 1.5\right] = \frac{1}{1.1}\left(.5556(.8 - 2.25)_{+} + .4444(.8-.9)_{+}\right) = 0$$&lt;/span&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$$C_{1,1} = \frac{1}{1+R}\hat{\mathbb{E}}\left[(K-S_T)_{+}|S_1 = 0.6\right] = \frac{1}{1.1}\left(.5556(.8 - .9)_{+} + .4444(.8-..36)_{+}\right) = 0.1778$$&lt;/span&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$$C_{0} = \frac{1}{1+R}\hat{\mathbb{E}}\left[(K-S_T)_{+}|S_0 = 1\right] = \frac{1}{1.1}\left(.5556(.8 - 1.5)_{+} + .4444(.8-.6)_{+}\right) = 0.0808$$&lt;/span&gt;&#xA;Therefore, the price of the option at these nodes are&#xA;&lt;span class=&quot;math-container&quot;&gt;$$V_{1,2} = \max\{\frac{1}{1.1}\left(.5556(.8 - 2.25)_{+} + .4444(.8 - .9)\right),(.8-1.5)_{+}\} = 0$$&lt;/span&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$$V_{1,1} = \max\{\frac{1}{1.1}\left(.5556(.8 - .9)_{+} + .4444(.8 - .36)\right),(.8-.6)_{+}\} = 0.2$$&lt;/span&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$$V_{0} = \max\{\frac{1}{1.1}\left(.5556(.8 - 1.5)_{+} + .4444(.8 - .6)\right),(.8-1)_{+}\} = 0.0808$$&lt;/span&gt;&#xA;At time &lt;span class=&quot;math-container&quot;&gt;$t = 0$&lt;/span&gt;, we need to see if it is optimal to exercise or optimal to continue. Since the the exercise value &lt;span class=&quot;math-container&quot;&gt;$E := (K-1)_{+}$&lt;/span&gt; clearly since &lt;span class=&quot;math-container&quot;&gt;$K = .8$&lt;/span&gt; in this problem it is optimal to continue.&lt;/p&gt;&#xA;&lt;p&gt;If this solution is correct then part b.) will be pretty straight forward. Although I am not totally sure I am right here I may have made some mistakes, and I also have no idea how to do part c.). Any suggestions is greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-04-21T22:57:44.383" Title="Two-period binomial model for American option" Tags="&lt;mathematics&gt;&lt;american-options&gt;&lt;finance-mathematics&gt;&lt;binomial&gt;" AnswerCount="0" CommentCount="9" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25492" PostTypeId="2" ParentId="23135" CreationDate="2016-04-19T08:28:46.260" Score="1" Body="&lt;p&gt;I edit this answer to give more details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The process for $r$ above is the geometric Brownian motion (GBM) used to model stock prices in the Black-Scholes framework. Thus the question is about (the expectation of the) exponetial of the integral of GBM. The intergral of GBM is closely connected to Asian options. Thus one can study the literature about this topic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to this &lt;a href=&quot;https://www.rocq.inria.fr/mathfi/Premia/free-version/doc/premia-doc/pdf_html/asian3_doc.pdf&quot; rel=&quot;nofollow&quot;&gt;https://www.rocq.inria.fr/mathfi/Premia/free-version/doc/premia-doc/pdf_html/asian3_doc.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would answer &lt;strong&gt;No: there is no closed formula for $P$ in your model.&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="20201" LastEditorUserId="2587" LastEditDate="2016-04-19T10:25:48.507" LastActivityDate="2016-04-19T10:25:48.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25494" PostTypeId="1" AcceptedAnswerId="25500" CreationDate="2016-04-19T16:48:52.907" Score="1" ViewCount="206" Body="&lt;p&gt;Actual probability of exercise of put option under BSM model is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;PD = N(-d2(u))&lt;/code&gt;&#xA;(using expected return of stock, u)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Risk-neutral equivalent is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;PD = N(-d2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The latter is always bigger (assuming u &gt; risk free rate), and thus value/price of the put option is greater than the actual expected payoff of put option. Author Allan Malz explains that this is so, because there's compensation to the put writer for taking on the risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I don't get is that it's opposite for call option(underpriced rather than overpriced). Shouldn't the call writer be compensated for the risk like put writer? How come actual expected payoff of call is greater than the price of call?&lt;/p&gt;&#xA;" OwnerUserId="20375" LastActivityDate="2016-04-20T00:11:31.640" Title="BSM Model - Actual probability" Tags="&lt;black-scholes&gt;&lt;probability&gt;&lt;risk-neutral&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25496" PostTypeId="1" CreationDate="2016-04-19T19:12:56.400" Score="4" ViewCount="737" Body="&lt;p&gt;When I buy an ETF, the ETF issuer wants a certain management fee (expense ratio). How is this usually paid? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've read that this might be deducted from dividends - is this the case? How does it work for ETFs where no dividends are applicable (for example, physically backed commodity ETFs)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And specifically, what happens if you short an ETF? Who pays the fees and how does that influence the profit of the short seller?&lt;/p&gt;&#xA;" OwnerUserId="20380" LastActivityDate="2017-11-08T03:34:50.407" Title="How are ETF fees deducted? What happens if you short an ETF?" Tags="&lt;etf&gt;&lt;short-selling&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25499" PostTypeId="2" ParentId="11038" CreationDate="2016-04-19T23:29:05.877" Score="2" Body="&lt;p&gt;A Brownian bridge can be built simply from a forced process. For example, if we define the process $Z$ by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;Z_{t}=\left(\dfrac{T-t}{T-t_0}\right)\left(a-W_{t_0}\right)+\left(\dfrac{t-t_0}{T-t_0}\right)\left(b-W_{T}\right)+W_{t}\;\;\;; t\in[t_0,T]   &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $W$ is a standard Brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The process $Z$ is a Brownian bridge satisfying the following conditions:&#xA;$Z_{t_0}=a$ and $Z_T=b$, in particular, if we put $t_0=0$, Then the process $Z$ becomes&#xA;$$&#xA;Z_{t}=W_{t}+a-\frac{t}{T}\left(W_{T}-b+a\right)&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="20360" LastActivityDate="2016-04-19T23:29:05.877" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25500" PostTypeId="2" ParentId="25494" CreationDate="2016-04-20T00:11:31.640" Score="0" Body="&lt;p&gt;Any position that is long the market. Eg long stocks, short puts on stocks etc, is being compensated for taking risk.   Any position that is bearish eg short the market, or short calls on the market, is being penalized for taking the risk.   There's no contradiction.  Investors overall are long stocks, and they need to get paid to take the risk.  That's what drives the pricing.  Within that there are some longs and shorts, but the overall pricing is determined by the net position (long) of investors.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-04-20T00:11:31.640" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25501" PostTypeId="2" ParentId="16584" CreationDate="2016-04-20T01:56:39.980" Score="0" Body="&lt;p&gt;I know this is an old post, but I just came across it while researching for the same data. As such, I though I might provide another explanation to the above question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The netfonds website provides both a 'tradedump' and a 'posdump'.  The trade dump is simply tick level data that shows the movement of the asset from trade to trade.  The posdump, 'dataB' in your case, provides insights into the market participants. This is important because you can identify irregularities in bid and ask prices and therefore capitalize on the difference in supply and demand.  For further reading, investopedia provides and excellent explanation.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;http://www.investopedia.com/terms/o/order-book.asp&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="20306" LastActivityDate="2016-04-20T01:56:39.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25502" PostTypeId="1" CreationDate="2016-04-20T03:10:11.697" Score="1" ViewCount="200" Body="&lt;p&gt;I've seen a number of measures of risk in my reading:&lt;br&gt;&#xA;Sharpe, Sortino, Calmar, etc. In CAPM there is Beta, and I've seen papers discussing how to modify CAPM for asymmetry. There is Value at Risk and discussion about its failings for distributions with fat tails, and how to compensate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, for options, there are the Greeks - measures of how the price of an option changes w.r.t. factors - underlying (delta), volatility (vega), interest (rho) and of course there are second order Greeks to consider. But, for example &quot;riskier&quot; options - e.g. out-of-the-money (OTM) options that have higher chance of expiring worthless, have a lower delta, than &quot;less risky&quot; options - e.g. in-the-money (ITM) which are less likely to expire worthless. Does it make sense to consider $delta/ option$ $price$? For example, if the underlying moves, an ITM option will move more than an OTM option, but in terms of its return (the percentage or log change of the option), the OTM might be moving dramatically more. Then there is theta... just the risk over time of the option losing value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've read some papers that talk about the 'returns' of various strategies, but few go into detail about the margin requirements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, recently, I've been looking at various option portfolios, but find it difficult to really get a good sense of how to measure their return vs risk. The return part is easy, the risk - not so much. So how do I choose which portfolio is &quot;better&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any good resources where I can find discussion of this issue?&#xA;How do hedge funds, for example, typically measure their risk when it comes to portfolios including options?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apologies for the general question - is it too general/subjective?&lt;/p&gt;&#xA;" OwnerUserId="17303" LastActivityDate="2016-04-20T10:19:52.467" Title="What are the some good measures of risk for options?" Tags="&lt;options&gt;&lt;risk&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25503" PostTypeId="2" ParentId="4886" CreationDate="2016-04-20T07:36:29.313" Score="1" Body="&lt;p&gt;I was looking for someone else's answer to compare with mine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Vectorization is clearly the way to go.  Question is, how do we vectorize this problem.  Below is a commented function that accomplishes this in python using numpy and pandas.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import numpy as np&#xA;import pandas as pd&#xA;&#xA;def max_dd(returns, rolling=None):&#xA;    # make into a DataFrame so that it is a 2-dimensional&#xA;    # matrix such that I can perform an nx1 by 1xn matrix&#xA;    # multiplication and end up with an nxn matrix&#xA;    #&#xA;    # add 1 and produce a series of cumulative products&#xA;    # because the cumulative product acts as a return&#xA;    # index.  We'll use the return index to calculate&#xA;    # returns between two periods.&#xA;    r = pd.DataFrame(returns).add(1).cumprod()&#xA;&#xA;    # r is nx1 and 1 / r.T is 1xn.  x is nxn&#xA;    # I copy r.T to ensure r's index is not the same&#xA;    # object as 1 / r.T's columns object&#xA;    #&#xA;    # x is now a matrix of every combination of one&#xA;    # period's return index divided by another period's&#xA;    # return index then subtract one.  So every element&#xA;    # of this matrix represents the return from the period&#xA;    # specified in the column to the period specified in&#xA;    # the row.&#xA;    x = r.dot(1 / r.T.copy()) - 1&#xA;    x.columns.name, x.index.name = 'start', 'end'&#xA;&#xA;    # let's make sure we only calculate a return when start&#xA;    # is less than end.&#xA;    y = x.stack().reset_index()&#xA;    y = y[y.start &amp;lt; y.end]&#xA;&#xA;    # if rolling isn't None then we care about limiting the&#xA;    # window over which we calculate max draw down&#xA;    if not rolling is None:&#xA;        y = y[y.end - y.start &amp;lt;= rolling]&#xA;&#xA;    # my choice is to return the periods and the actual max&#xA;    # draw down&#xA;    z = y.set_index(['start', 'end']).iloc[:, 0]&#xA;    return z.min(), z.argmin()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For comparison purposes, I've included a looping version (without comments)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def max_dd_loop(returns):&#xA;    max_so_far = None&#xA;    start, end = None, None&#xA;    r = returns.add(1).cumprod()&#xA;    for r_start in r.index:&#xA;        for r_end in r.index:&#xA;            if r_start &amp;lt; r_end:&#xA;                current = r.ix[r_end] / r.ix[r_start] - 1&#xA;                if (max_so_far is None) or (current &amp;lt; max_so_far):&#xA;                    max_so_far = current&#xA;                    start, end = r_start, r_end&#xA;    return max_so_far, (start, end)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Create a random return series&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;returns = pd.Series(np.random.randn(1000) / 100 + 0.001)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;now calculate max draw down and print time it took&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;stamp = pd.Timestamp.now()&#xA;max_dd(returns)&#xA;delta_vector = pd.Timestamp.now() - stamp&#xA;print delta_vector&#xA;&#xA;(-0.13730942629746501, (730, 787))&#xA;0 days 00:00:00.088714&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Do the same for looped version&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;stamp = pd.Timestamp.now()&#xA;max_dd_loop(returns)&#xA;delta_loop = pd.Timestamp.now() - stamp&#xA;print delta_loop&#xA;&#xA;(-0.13730942629746501, (730, 787))&#xA;0 days 00:00:26.465571&#xA;print delta_loop / delta_vector&#xA;&#xA;298.324627455&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is a huge improvement&lt;/p&gt;&#xA;" OwnerUserId="20388" LastActivityDate="2016-04-20T07:36:29.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25505" PostTypeId="1" CreationDate="2016-04-20T08:43:13.833" Score="1" ViewCount="229" Body="&lt;p&gt;I would like to test different methods for fitting a yield curve, like the Nelson-Siegel, cubic splines etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to generate random yield to maturity data, that somehow reflects the common observed yields in the markets. &#xA;I am using R but I appreciate any idea.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance! &lt;/p&gt;&#xA;" OwnerUserId="19548" LastActivityDate="2017-07-14T21:54:02.173" Title="Generating random yields" Tags="&lt;r&gt;&lt;modeling&gt;&lt;yield-curve&gt;&lt;bond-yields&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25506" PostTypeId="1" CreationDate="2016-04-20T09:20:33.450" Score="1" ViewCount="46" Body="&lt;p&gt;How do we calculate IRR if I have an investment that allows me to buy into 10% of a company @1m and the first year is a negative cash flow of 200,000 but the subsequent years till year 10 is a positive cash flow of 300,000. &lt;/p&gt;&#xA;" OwnerUserId="20392" LastActivityDate="2016-04-20T09:20:33.450" Title="Calculation of IRR" Tags="&lt;finance&gt;" AnswerCount="0" CommentCount="3" ClosedDate="2016-04-20T10:28:25.583" ContentLicense="CC BY-SA 3.0" />
  <row Id="25507" PostTypeId="2" ParentId="25502" CreationDate="2016-04-20T10:19:52.467" Score="4" Body="&lt;p&gt;I don't have a reference for you but I have some experience. Risk management departments at hedge funds and banks would primarily look at the Var in order to capture the risk of an options portfolio.   The var indirectly captures all the Greeks in a single measurement , since each Greek generates some exposure. The desk traders would tend to look at all the Greeks individually rather than the var, since they need a more detailed picture.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-04-20T10:19:52.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25508" PostTypeId="2" ParentId="25224" CreationDate="2016-04-20T10:23:52.143" Score="2" Body="&lt;p&gt;&lt;em&gt;Edit (2016-06-21)&lt;/em&gt;: Now with live data/trading integration with Interactive Brokers.  It has taken a while but it has finally arrived.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;backtrader&lt;/code&gt; (&lt;a href=&quot;https://github.com/mementum/backtrader&quot; rel=&quot;nofollow&quot;&gt;https://github.com/mementum/backtrader&lt;/a&gt;) can do &lt;code&gt;1&lt;/code&gt; and &lt;code&gt;3&lt;/code&gt; and is in the process of getting &lt;code&gt;2&lt;/code&gt; ironed out. A live data feed from IB will make it into the next release (due in the next few days) and it will then be down to mapping of orders.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the project page you can see a list of other similar (some more, some less) python projects and may prove to be closer to be your cup of tea, or maybe not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Disclaimer&lt;/em&gt;&lt;/strong&gt;: I am the author of &lt;code&gt;backtrader&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Filling: Quick explanation as Thomas Johnson is right in the need to make assumptions.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Volume is not used. I only trade in markets and assets which are liquid enough&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Pricewise ... it depends on the order type with the following assumption in place: the bar which the system is evaluating is gone ... no match can be done against it&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;Market&lt;/code&gt;: The order gets filled with the opening price of the next bar&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;Close&lt;/code&gt;: meant for intraday systems and gets matched with the last bar of the session at the close price&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;Limit&lt;/code&gt;: starting with next bar the system looks at the open/high/low/close prices to try to give a &quot;better&quot; price (example: open is better than the limit, open is chosen) or limit&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;StopLimit&lt;/code&gt;: similar to limit, but looking again at the 4 prices components to see if the stop trigger price and limit prices can be executed in the same bar.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="17554" LastEditorUserId="17554" LastEditDate="2016-06-20T23:36:41.907" LastActivityDate="2016-06-20T23:36:41.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25509" PostTypeId="2" ParentId="24847" CreationDate="2016-04-20T10:57:04.300" Score="1" Body="&lt;p&gt;Because your python script ends and with it the socket that &lt;code&gt;ibpy&lt;/code&gt; has opened to connect to TWS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The demo samples in the sources of &lt;code&gt;ibpy&lt;/code&gt; use simple &lt;code&gt;time.sleep(x)&lt;/code&gt; to make sure some information has been delivered (for example &lt;code&gt;fancy_marketdata.py&lt;/code&gt;) before the script ends.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try to remove the &lt;code&gt;time.sleep(x)&lt;/code&gt; lines and see how the script also ends instantly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have a look at other ways to do it like here for example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/questions/34561626/ibpy-getting-portfolio-information-interactive-broker-python&quot;&gt;https://stackoverflow.com/questions/34561626/ibpy-getting-portfolio-information-interactive-broker-python&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You may consider running the &lt;code&gt;ibpy&lt;/code&gt; connection in another thread and control the thread over a &lt;code&gt;Queue&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="17554" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2016-04-20T10:57:04.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25510" PostTypeId="1" CreationDate="2016-04-20T14:27:45.003" Score="1" ViewCount="56" Body="&lt;p&gt;I am interested in Tranches on Credit Indexes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $T$ be the trade date, let $t_1&amp;lt;T&amp;lt;t_2$ be the accrual dates surrounding the trade date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to know which option is correct ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A) First coupon normal (so at $t_2$ protection buyer will pay a coupon on $\frac{t_2-t_1}{360}$) and  protection seller pays accrued interest $\frac{T-t_1}{360}$ to protection buyer at trading date. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;B) First coupon is short (so protection buyer will pay a coupon so at $t_2$, protection buyer will pay a coupon on $\frac{t_2-T}{360}$) and protection seller does not pay accrued interest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;C) First coupon is long (so protection buyer will pay a coupon at $t_3&amp;gt;t_2$ being the next accrual date and value is based on $\frac{t_3-T}{360}$) and protection seller does not pay accrued interest&lt;/p&gt;&#xA;&#xA;&lt;p&gt;D) something else I do not know.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-04-20T14:27:45.003" Title="First coupon CDO tranche" Tags="&lt;credit&gt;&lt;credit-derivatives&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25512" PostTypeId="1" AcceptedAnswerId="25517" CreationDate="2016-04-20T15:31:48.397" Score="4" ViewCount="3392" Body="&lt;p&gt;Say I am trying to find the probability of default on JP Morgan implied by the price of their fixed income assets. Can this be done? Are there any pitfalls to this approach? I have heard of this approach being used, but haven't been able to find many clear implementations in the literature. How can I estimate JP Morgan's default probability using their quoted bond prices?&lt;/p&gt;&#xA;" OwnerUserId="17712" LastActivityDate="2016-04-20T18:04:37.800" Title="Default Probability Implied in Bond Prices?" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;credit-risk&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25513" PostTypeId="2" ParentId="25505" CreationDate="2016-04-20T15:40:47.387" Score="1" Body="&lt;p&gt;Challenge with completely randomized yields is that it's hard to ensure the data is arbitrage-free. What you can do is either using the data from another market (say take the UK yield and pretend they are in USD) or use randomized resampling of SETS of data. &lt;/p&gt;&#xA;" OwnerUserId="17552" LastActivityDate="2016-04-20T15:40:47.387" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25515" PostTypeId="2" ParentId="25512" CreationDate="2016-04-20T16:28:47.587" Score="2" Body="&lt;p&gt;I think it depends on your goals and how sophisticated you wish to be.  At the lowest level, one can just take the spread of JPM over some relatively risk free rate (Treasurys or swaps) and declare that is the probability of default.  Others (e.g.  Elton, Gruber, et al in Explaining the Rate Spread on Corporate Bonds) try to measure the components.  While there is a default component, for bonds there is also a tax premium and a risk premium.  They try to measure those components and separate out the remainder as the probability of default if I recall correctly.  If I were asked to do that project, I’d  say that much of the spread movement is due to systemic factors such as macroeconomics that do not reflect JPM risk, and instead use some kind of Stein estimator approach combining the market spread with fundamental factors, maybe a Merton model input, and priors about too big to fail.  I’m sure others would see this differently. Oh, and upon re-reading this of course you would have to make some recovery rate assumptions if you are using a spread model cause not all of the face value is lost upon default.  There was actually a very similar question posted a while ago on this you can look up.  &lt;/p&gt;&#xA;" OwnerUserId="19627" LastEditorUserId="19627" LastEditDate="2016-04-20T17:25:24.237" LastActivityDate="2016-04-20T17:25:24.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25516" PostTypeId="2" ParentId="25512" CreationDate="2016-04-20T17:35:05.603" Score="3" Body="&lt;p&gt;One more thing that must be considered is the expected recovery rate. A model that ignores this rate is not tied to the real world. To estimate the probability of default, you would need to find the rate that needs to be applied to each time step/payment such that risk free discounting of payments yields the price of the bond. Specifically, Price = $\sum{P((}$No default in period $)* PV($payment at risk-free rate$))$. By taking the spread over the risk-free rate, recovery (inherent in the price of the bond) is ignored. You can get an estimate of the probability of default by dividing the spread by $1-recovery rate$. If there is are no coupon payments, these should be the same. &lt;/p&gt;&#xA;" OwnerUserId="19089" LastActivityDate="2016-04-20T17:35:05.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25517" PostTypeId="2" ParentId="25512" CreationDate="2016-04-20T18:04:37.800" Score="5" Body="&lt;p&gt;Assume :&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$R$&lt;/span&gt; a recovery rate,&lt;/li&gt;&#xA;&lt;li&gt;a continuous payment&lt;/li&gt;&#xA;&lt;li&gt;a flat intensity &lt;span class=&quot;math-container&quot;&gt;$\lambda$&lt;/span&gt; i.e &lt;span class=&quot;math-container&quot;&gt;$$\mathbb{P}(\tau&amp;gt;t)=e^{-\lambda t}$$&lt;/span&gt;&lt;/li&gt;&#xA;&lt;li&gt;a flat discount rate &lt;span class=&quot;math-container&quot;&gt;$r$&lt;/span&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2&gt;With bonds prices&lt;/h2&gt;&#xA;&lt;p&gt;Assuming&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;JPM bond pays a coupon rate of &lt;span class=&quot;math-container&quot;&gt;$\kappa$&lt;/span&gt;&lt;/li&gt;&#xA;&lt;li&gt;the risk free bond (being US bonds) pays a coupon rate of &lt;span class=&quot;math-container&quot;&gt;$\kappa^{risk~free}$&lt;/span&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;you have :&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\text{PV}(\text{Bond}_{JPM}) = \int_{0}^T \kappa e^{-(r+\lambda) t} dt + R\int_{0}^T\lambda e^{-(r+\lambda)t}dt + e^{(r+\lambda)T}$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;where as&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\text{PV}(\text{Bond}_{risk~free})=\int_{0}^T \kappa^{risk~free} e^{-rt}dt + e^{-rT}$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;with this, you can find some &lt;span class=&quot;math-container&quot;&gt;$r$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$\lambda$&lt;/span&gt; solving above equations.&lt;/p&gt;&#xA;&lt;h2&gt;With CDS&lt;/h2&gt;&#xA;&lt;p&gt;If you have the CDS of maturity &lt;span class=&quot;math-container&quot;&gt;$T$&lt;/span&gt; on JPM, as a quoted spread &lt;span class=&quot;math-container&quot;&gt;$s$&lt;/span&gt;, you will have the following &lt;span class=&quot;math-container&quot;&gt;$\lambda \approx \frac{s}{1-R}$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;h2&gt;Be careful&lt;/h2&gt;&#xA;&lt;p&gt;As mentionned in other answers, recovery is the key.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-04-20T18:04:37.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25518" PostTypeId="2" ParentId="17315" CreationDate="2016-04-20T21:42:40.067" Score="1" Body="&lt;p&gt;I've spent a fair amount of time with the type of fundamentals data you are looking for, and I am not aware of any site or provider that meets all of your criteria. Specifically, I am not aware of a provider that provides multi-company fundamentals data, in CSV format, retrievable at an ISIN-addressed URL.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the above, if you are willing to build the URL interface you desire, you can acquire all of the raw fundamentals data you are looking for by using &lt;a href=&quot;https://www.spcapitaliq.com/our-capabilities/our-capabilities.html?product=xpressfeed#&quot; rel=&quot;nofollow&quot;&gt;S&amp;amp;P CapitalIQ's Xpressfeed&lt;/a&gt; product with the appropriate data packages. They provide fundamentals on global companies, indexable by the ISIN of an issued security, and there is a package that provides information on index constituents. Some of the data is delivered in CSV format, but other portions are delivered in a custom text format. All of the data can easily be loaded into a database, assuming your familiar with relational databases. If you were willing to go this route, you might find that after loading all of the data in a database, you don't really need the URL interface you described.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Be warned, given it's price, these are not products targeted at individuals (I don't know what you mean by &quot;non-institutionalized&quot;), and you're not going to find all the details you want at the above link; you're going to have to talk to a sales representative.&lt;/p&gt;&#xA;" OwnerUserId="15876" LastActivityDate="2016-04-20T21:42:40.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25519" PostTypeId="1" CreationDate="2016-04-20T22:07:35.363" Score="1" ViewCount="67" Body="&lt;p&gt;Would anyone know where I can find historical forward exchange rate data between germany and US, yen and US to download?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Bank of England website i already found.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks &lt;/p&gt;&#xA;" OwnerUserId="15685" LastActivityDate="2016-04-20T22:07:35.363" Title="Forward Exchange Rate Data: Germany x US" Tags="&lt;interest-rates&gt;&lt;fx&gt;&lt;futures&gt;&lt;forward-rate&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25521" PostTypeId="1" AcceptedAnswerId="25648" CreationDate="2016-04-21T01:10:52.360" Score="2" ViewCount="2472" Body="&lt;p&gt;When there's a 2-for-1 &lt;a href=&quot;http://www.investopedia.com/ask/answers/113.asp&quot; rel=&quot;nofollow&quot;&gt;stock split&lt;/a&gt;,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the number of shares doubles, while&lt;/li&gt;&#xA;&lt;li&gt;the value of the stock halves&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For symbol 2154 on the Tokyo Stock Exchange, there was such a &lt;a href=&quot;https://www.monex.co.jp/AboutUs/00000000/sinyo/kabu_bunkatu/hyji&quot; rel=&quot;nofollow&quot;&gt;2-for-1 split on 2016/3/29&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However when looking at csv data download from Yahoo, I see the &quot;adjusted close&quot; doubling (not halving), while the unadjusted &quot;Close&quot;, as well as Open, High, Low, barely move.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an excerpt:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;       2154     Open     High      Low    Close  Volume  Adj Close &#xA;-------------------------------------------------------------------&#xA; 2016-03-30  1576.00  1602.00  1530.00  1530.00   63600    1503.08 &#xA; 2016-03-29  1455.00  1620.00  1455.00  1551.00   86700    1523.71 &#xA; 2016-03-28  1450.00  1452.50  1425.50  1450.00   29000     712.24 &#xA; 2016-03-25  1469.50  1475.00  1438.50  1442.50   23200     708.56 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How does this all add up? What was the actual price used on 2016/03/28 when 2154 was traded? Somewhere around 1450? Or 700? Or 2900?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just looked at another set of Yahoo data for 2170 on the Tokyo Stock Exchange, which had a &lt;a href=&quot;https://www.monex.co.jp/AboutUs/00000000/sinyo/kabu_bunkatu/hyji?year=2014&quot; rel=&quot;nofollow&quot;&gt;100-for-1 split on 2014/3/27&lt;/a&gt;, and here everything looks as I would have expected.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;       2170        Open        High         Low       Close  Volume  Adj Close &#xA;-------------------------------------------------------------------------------&#xA; 2014-03-28      230.00      230.00      219.00      230.00   74700   190.4468 &#xA; 2014-03-27      224.00      229.00      191.00      225.00  119300   186.3067 &#xA; 2014-03-26    23500.00    23500.00    22000.00  22339.9994  181700   184.2366 &#xA; 2014-03-25  23739.9994  24080.0003  22810.0006  23230.0003  278800   191.5764 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is Yahoo's data for 2154 just wrong? Did they perhaps get already adjusted OHLC data for 2154, used those values as their OHLC values, and then re-adjusted the already adjusted close, which lead to incorrect &quot;Adj Close&quot; values?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That would also mean that the actual share price of symbol 2154 on 2016/3/28 would have been around 2900.&lt;/p&gt;&#xA;" OwnerUserId="20401" LastEditorUserId="20401" LastEditDate="2016-04-21T02:12:20.190" LastActivityDate="2016-04-26T13:25:39.500" Title="Yahoo data meaning of &quot;close&quot; and &quot;adjusted close&quot;" Tags="&lt;yahoo&gt;&lt;yahoofinance&gt;&lt;split&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25524" PostTypeId="1" CreationDate="2016-04-21T04:02:24.117" Score="4" ViewCount="1648" Body="&lt;p&gt;I am trying to find a book for our study group that teaches the bare minimum C++ needed for financial applications.&#xA;I am trying to teach it in a project based manner. In case, I don't settle on one book, I will have to mix different books and online resources eg. quantlib.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions on books and online resources (eg. online course with assignments) of that spirit?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-&gt;Duffy's book &quot;introduction to C++ for financial engineers&quot; could have been a trully great book because in spirit it teaches and implements the bare minimum C++ material needed for financial applications. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, as you may know already it is disappointing: a) code is full of bugs, b) the explanations are confusing for beginners and c)occasionaly the code is bad (eg. using goto).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-&gt;Joshi's OOP book, is very good with smart and neat code; however, one must be already mature in C++ before doing the problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-&gt;Schlogl's OOP book has very neat code and exercises and it is a good precursor to Joshi's. However, it requires knowledge up to C++ templates.&lt;/p&gt;&#xA;" OwnerUserId="20403" LastActivityDate="2018-12-07T13:08:33.360" Title="Online courses or C++ books combined with Finance (alternatives to Duffy and Joshi)" Tags="&lt;programming&gt;&lt;reference-request&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25525" PostTypeId="2" ParentId="14569" CreationDate="2016-04-21T07:34:52.690" Score="1" Body="&lt;p&gt;Here is library for time series modelling. There are exponential smoothing models (simple, double, triple) with maximum likelihood estimation and another time series utility classes:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/hawkular/hawkular-datamining&quot; rel=&quot;nofollow&quot;&gt;https://github.com/hawkular/hawkular-datamining&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.hawkular.org/docs/components/datamining/index.html&quot; rel=&quot;nofollow&quot;&gt;http://www.hawkular.org/docs/components/datamining/index.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="20405" LastActivityDate="2016-04-21T07:34:52.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25526" PostTypeId="1" AcceptedAnswerId="25536" CreationDate="2016-04-21T08:11:39.137" Score="2" ViewCount="1510" Body="&lt;p&gt;What is the covariance of two correlated Ornstein-Uhlenbeck processes? I was trying correlation(1,2)*Var1^(1/2)*Var2^(1/2), but I am not sure! I took Var1=(sigma1^2/(2*speedofmeanreversion1))*(1-exp(-2*speedofmeanreversion1*dt)) and Var2 accordingly.&#xA;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="20224" LastActivityDate="2016-04-21T21:11:22.343" Title="What is the covariance of two correlated Ornstein-Uhlenbeck processes?" Tags="&lt;correlation&gt;&lt;covariance&gt;&lt;mean-reversion&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25529" PostTypeId="1" CreationDate="2016-04-21T10:12:30.183" Score="1" ViewCount="16" Body="&lt;p&gt;Does EMTA guidelines are only for Non-Deliverable trades? IF yes, then why this is applicable for Deliverable Option trades?&#xA;EMTA Site - &lt;a href=&quot;http://www.emta.org/ndftt.aspx&quot; rel=&quot;nofollow&quot;&gt;http://www.emta.org/ndftt.aspx&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="19370" LastActivityDate="2016-04-21T10:12:30.183" Title="EMTA Guidelines" Tags="&lt;options&gt;&lt;interest-rates&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25530" PostTypeId="2" ParentId="25524" CreationDate="2016-04-21T10:17:07.373" Score="3" Body="&lt;p&gt;I don't think there is any good finance book for learning C++. The best C++ books are simply the generalist C++ books that you can see by searching &quot;C++&quot; on Amazon. There are many free C++ online courses, I'm sure you will find something on Coursea. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best C++ book has to be &lt;code&gt;The C++ Programming Language&lt;/code&gt;, by Bjarne Stroustrup. However, it's probably too hard for you learn for a course, although you will need to reach the level if you want to do anything with QuantLib.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't waste too much time on templates. Erik does it because he believes static binding would save some computation time (eg: no virtual function), and indeed this is how the high-frequency trading work. But you really don't need to know.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: You've left out &lt;code&gt;Modelling Derivatives in C++&lt;/code&gt;. This is the most complete C++ finance book you'll find, however, the quality is not very good. I returned the book to the library the next day as there were too many coding errors. Try to borrow it from Library to see if you like it,&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2016-04-21T10:17:07.373" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="25531" PostTypeId="2" ParentId="11458" CreationDate="2016-04-21T10:23:07.250" Score="0" Body="&lt;p&gt;I don't agree with the contention that market prices are &lt;em&gt;always&lt;/em&gt; used as the benchmark upon which to base model performance. I think this is model dependent. Market prices make sense (for example for modelling an underlying predictor), but for example, for a derivatives model, I would argue the values of those derivatives at expiry (or earlier for path dependent derivatives) are the benchmark against which a model's performance is, or should be, compared. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand the paper you cited attempts to match market prices, but a reason for doing that might be to better understand why an existing model fails to match market prices, and thus better understand why a different model might be better suited, or better explain the behaviour of the market, or on the assumption that market prices are closer to observed values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see no particular reason why efficient market hypothesis (EMH) or random walk hypothesis (RWH) &lt;em&gt;must&lt;/em&gt; hold. It is often convenient to assume they do when formulating models of a mathematical nature. There have been many attempts, and continue to be, to disprove RWH/EMH, and I believe the view that these do not hold (strongly) is widely adopted. Black Scholes, for example, is widely recognised as having flaws, but still invaluable - for its insight into pricing, its simple formulae, and its wide use for &quot;implied volatility&quot; - which is after all just the volatility implied by Black Scholes such that Black Scholes would give a particular option price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ways to test models' performance are in my experience typically empirical or statistical, some examples include:&lt;br&gt;&#xA; - accuracy tests: how closely do model values match observed values?&lt;br&gt;&#xA; - empirical tests: how well would this model perform over a given data set?&lt;br&gt;&#xA; - &lt;a href=&quot;https://en.wikipedia.org/wiki/Likelihood-ratio_test&quot; rel=&quot;nofollow&quot;&gt;likelihood ratio test&lt;/a&gt; how likely is this model to be better?&lt;br&gt;&#xA; - &lt;a href=&quot;https://en.wikipedia.org/wiki/Goodness_of_fit&quot; rel=&quot;nofollow&quot;&gt;goodness of fit&lt;/a&gt; tests of a statistical nature, with attempts to find distributions of results&lt;/p&gt;&#xA;" OwnerUserId="17303" LastActivityDate="2016-04-21T10:23:07.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25534" PostTypeId="1" CreationDate="2016-04-21T11:36:26.887" Score="2" ViewCount="1340" Body="&lt;p&gt;I am trying to compute the derivative of this function with respect to V0:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/EhnWs.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/EhnWs.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the price of a down and out call option, &lt;strong&gt;assuming the barrier equal to the level of debt K&lt;/strong&gt;.&#xA;In other terms, I need to compute the Delta of this DOC Option, in the case of Barrier=K (neither Barrier higher than K nor Barrier lower than K) and I cannot find this case anywhere in the literature.&#xA;&lt;strong&gt;Furthermore, the derivative of the first two terms of the equation equals N(d1), the delta of a plain vanilla call option. Therefore, I just need the derivative of what is in the parenthesis [...] with respect to V_0.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone of you help me?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anything will be really appreciated!&lt;/p&gt;&#xA;" OwnerUserId="20409" LastEditorUserId="20409" LastEditDate="2016-04-23T08:50:39.143" LastActivityDate="2016-06-24T17:10:08.310" Title="Derivative: Delta of a Down and Out Call Option with Barrier=Debt(K)" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;derivatives&gt;&lt;delta&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25536" PostTypeId="2" ParentId="25526" CreationDate="2016-04-21T11:58:30.017" Score="3" Body="&lt;p&gt;Using &lt;a href=&quot;https://en.wikipedia.org/wiki/Ornstein%E2%80%93Uhlenbeck_process#Solution&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Ornstein%E2%80%93Uhlenbeck_process#Solution&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X^i_t = (X^i_0 + \int_0^t\sigma_i e^{a_i u} dB^i_u)e^{-a_it} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ X^i_t-\mathbb{E}[X^i_t] = e^{-a_it} \int_0^t\sigma_i e^{a_i u} dB^i_u $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and thus :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Cov}(X^1_t,X^2_t)=\mathbb{E}\left[e^{-a_1t} \int_0^t\sigma_1 e^{a_1 u} dB^1_u e^{-a_2t} \int_0^t\sigma_2 e^{a_2 u} dB^2_u\right] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and if $d\langle B^1_t,B^2_t \rangle=\rho_{12}dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{split}&#xA;\text{Cov}(X^1_t,X^2_t)=&amp;amp; \mathbb{E}\left[e^{-(a_1+a_2)t} \int_0^t \sigma_1\sigma_2 e^{(a_1+a_2) u} \rho_{12} du\right]\\&#xA;&amp;amp;=e^{-(a_1+a_2)t} \int_0^t \sigma_1\sigma_2 e^{(a_1+a_2) u} \rho_{12} du\\&#xA;&amp;amp; =\frac{\sigma_1\sigma_2\rho_{12}}{a_1+a_2}\left(1-e^{-(a_1+a_2)t}\right)&#xA;\end{split}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to prove the last formula, you will need :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the fact $B^2_t = \rho_{12}B^1_t+\sqrt{1-\rho_{12}^2}B^\perp_t$&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Quadratic_variation#Martingales&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Quadratic_variation#Martingales&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;the fact that &#xA;$$2\mathbb{E}[M_tN_t]=\mathbb{E}[(M+N)^2_t]-\mathbb{E}[M^2_t]-\mathbb{E}[N^2_t]$$&#xA;with $M_t=\int_0^t\sigma_1 e^{a_1 u} dB^1_u$ and $N_t=\int_0^t\sigma_2 e^{a_2 u} \rho_{12} dB^1_u$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="20201" LastEditorUserId="4910" LastEditDate="2016-04-21T21:11:22.343" LastActivityDate="2016-04-21T21:11:22.343" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25537" PostTypeId="5" CreationDate="2016-04-21T13:20:15.107" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2016-04-21T13:20:15.107" LastActivityDate="2016-04-21T13:20:15.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25538" PostTypeId="4" CreationDate="2016-04-21T13:20:15.107" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2016-04-21T13:20:15.107" LastActivityDate="2016-04-21T13:20:15.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25539" PostTypeId="1" AcceptedAnswerId="25564" CreationDate="2016-04-21T13:21:48.373" Score="2" ViewCount="245" Body="&lt;p&gt;I want to estimate an ARIMA(1,0,X) model. The MA(X) in the model is selected to minimize BIC. I have the following code employing the function &lt;code&gt;auto.arima&lt;/code&gt; from &quot;forecast&quot; package in R:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; auto.arima(logret$appl, d=0, max.p=1, max.q=10,&#xA; max.order=NA, max.d=0,start.p=1, start.q=0,&#xA; stationary=FALSE, seasonal=FALSE,&#xA; ic=c(&quot;bic&quot;), stepwise=TRUE, trace=TRUE,&#xA; allowdrift=TRUE, allowmean=TRUE, lambda=NULL, parallel=FALSE, num.cores=NULL)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The following is the result of the above code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; ARIMA(1,0,0) with non-zero mean : -6592.886&#xA; ARIMA(0,0,0) with non-zero mean : -6597.561&#xA; ARIMA(1,0,0) with non-zero mean : -6592.886&#xA; ARIMA(0,0,1) with non-zero mean : -6592.48&#xA; ARIMA(0,0,0) with zero mean     : -6604.679&#xA; ARIMA(1,0,1) with non-zero mean : -6586.55&#xA;&#xA;Best model: ARIMA(0,0,0) with non-zero mean &#xA;&#xA;Series: logreturns$REL.CP &#xA;ARIMA(0,0,0) with non-zero mean &#xA;&#xA;Coefficients:&#xA;      intercept&#xA;          0e+00&#xA;s.e.      5e-04&#xA;&#xA;sigma^2 estimated as 0.0002818:  log likelihood=3305.9&#xA;AIC=-6607.81   AICc=-6607.8   BIC=-6597.56&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My problem requires to keep &lt;code&gt;AR(1)&lt;/code&gt; and &lt;code&gt;d=0&lt;/code&gt; in all the models where I test MA lags. Is there a way to fix AR lags? What I really want is MA(1) coefficient out of this arima(1,0, X) model. Thanks &lt;/p&gt;&#xA;" OwnerUserId="15390" LastEditorUserId="15390" LastEditDate="2016-04-24T10:15:15.423" LastActivityDate="2016-04-24T21:38:55.847" Title="Automate selection of BIC-minimizing ARIMA(1,0,X) model" Tags="&lt;time-series&gt;&lt;r&gt;&lt;modeling&gt;&lt;arima&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25540" PostTypeId="1" AcceptedAnswerId="25547" CreationDate="2016-04-21T13:49:28.693" Score="0" ViewCount="101" Body="&lt;p&gt;I am trying to find a dataset (oil prices, S&amp;amp;P index, DAX returns etc.) in order to visualize the high volatility and low volatility periods in a plot.&#xA;So far, I have not found a dataset that has this trend. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the price of a Apple stock has so far only increased with small swings and cannot be modeled as regime specific variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anyone who could advise which economic data should I download to plot it and see how the regimes switch from time to time. &lt;/p&gt;&#xA;" OwnerUserId="18715" LastActivityDate="2016-04-21T19:12:49.990" Title="Regime switching model getting data" Tags="&lt;hidden-markov-model&gt;&lt;market-regimes&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25542" PostTypeId="1" AcceptedAnswerId="25559" CreationDate="2016-04-21T15:31:36.950" Score="1" ViewCount="546" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/hhGBF.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/hhGBF.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;I have only government bond yields with different maturities. How can I obtain sythetic future prices on bonds? After obtained the future prices, I am supposed to compute the return and carry returns.&lt;/p&gt;&#xA;" OwnerUserId="20280" LastEditorUserId="15650" LastEditDate="2016-04-26T06:37:57.037" LastActivityDate="2016-05-01T21:37:43.943" Title="Calculation of Bond Carry from Synthetic future prices" Tags="&lt;fixed-income&gt;&lt;futures&gt;&lt;bond&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="25543" PostTypeId="1" CreationDate="2016-04-21T16:38:16.977" Score="-1" ViewCount="107" Body="&lt;p&gt;There are a variety of different mechanisms and rules used by each fundamentals data provider to standardize and report company fundamentals. For example, the transformation of reported statements to quarterly statements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a study comparing the quality and tradeoffs of the techniques employed by the various fundamentals data providers?&lt;/p&gt;&#xA;" OwnerUserId="15876" LastActivityDate="2016-07-27T15:30:56.350" Title="Comparison of quality across different fundamentals data sources?" Tags="&lt;data&gt;&lt;historical-data&gt;&lt;fundamentals&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25544" PostTypeId="2" ParentId="675" CreationDate="2016-04-21T17:32:54.777" Score="1" Body="&lt;p&gt;I used an example from the paper: An Introduction to Shrinkage Estimation of the&#xA;Covariance Matrix: A Pedagogic Illustration&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was able to get the same Shrinkage matrix. I have provided the same matrix they use in their paper.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import numpy as np&#xA;import pandas&#xA;from math import pow&#xA;&#xA;def get_shrunk_covariance_matrix(obs, c, zeros):&#xA;    w_len=c.shape[0]&#xA;    T=obs.shape[0]&#xA;    print T, w_len&#xA;    w=((T-1.0)/T)*c&#xA;&#xA;    sq_cov=c*c&#xA;    sq_cov=sq_cov.as_matrix()&#xA;    np.fill_diagonal(sq_cov, 0)&#xA;    sq_cov=pandas.DataFrame(sq_cov).dropna()&#xA;    frames =[]&#xA;    for z in range(w_len):&#xA;        LST=[]&#xA;        for cc in range(T):&#xA;            lst=[]&#xA;            for ccc in range(w_len):&#xA;                val = pow(obs.loc[cc][z]*obs.loc[cc][ccc]-w.loc[z][ccc],2)&#xA;                lst.append(val)&#xA;            LST.append(lst)&#xA;&#xA;        df=pandas.DataFrame(LST)&#xA;        df[z]=0&#xA;        frames.append(df)&#xA;    result = pandas.concat(frames)&#xA;&#xA;    Sum_of_All_Estimated_Var=result.values.tolist()&#xA;    sum1=0&#xA;    for s in Sum_of_All_Estimated_Var: sum1+=sum(s)&#xA;    a1=(T/pow((T-1),3))*sum1&#xA;&#xA;    Sum_of_All_S_ij_Squared=sq_cov.values.tolist()&#xA;    a2=0&#xA;    for s in Sum_of_All_S_ij_Squared: a2+=sum(s)&#xA;&#xA;    Optimal_Shrinkage_Intensity = a1/(a1+a2)&#xA;    print Optimal_Shrinkage_Intensity&#xA;&#xA;    Shrinkage=(1-Optimal_Shrinkage_Intensity)*c +  Optimal_Shrinkage_Intensity*zeros&#xA;    print Shrinkage&#xA;&#xA;if __name__==&quot;__main__&quot;:&#xA;    n=np.matrix([[10,12,9,-2,17,8,12],  [-9,-11,2,-5,-7,2,-2],  [16,5,8,5,18,8,9], [6,-3,6,-13,1,4,2], [1,4,-9,5,8,-16,-1], [12,-1,2,22,11,6,10]])&#xA;    mean = n.mean(axis=0)&#xA;    n=n-mean&#xA;    frame = pandas.DataFrame(n).dropna()&#xA;    c=pandas.DataFrame(np.cov(frame,  rowvar=0), index=frame.columns, columns=frame.columns)&#xA;    C=np.cov(frame,  rowvar=0)&#xA;    D=C.diagonal()&#xA;    zeros = np.zeros((C.shape[0], C.shape[0]), float)&#xA;    np.fill_diagonal(zeros, D)&#xA;    get_shrunk_covariance_matrix(frame, c, zeros)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="20413" LastActivityDate="2016-04-21T17:32:54.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25545" PostTypeId="2" ParentId="25540" CreationDate="2016-04-21T19:01:22.357" Score="1" Body="&lt;p&gt;I think the VIX index is a good example of what you are looking for. &lt;/p&gt;&#xA;" OwnerUserId="19627" LastActivityDate="2016-04-21T19:01:22.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25547" PostTypeId="2" ParentId="25540" CreationDate="2016-04-21T19:12:49.990" Score="0" Body="&lt;p&gt;Spx is perfect for that. But for regime switching you need samples that span many years. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-04-21T19:12:49.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25549" PostTypeId="1" CreationDate="2016-04-21T19:21:23.530" Score="8" ViewCount="3722" Body="&lt;p&gt;I believe there are several post on this general topic but I thought I would start my own thread.  I'm a former fundamental hedge fund investor (i.e. modeling a company's financials, forecasting the cashflows and discounting them back at a discount rate to get the valuation) who is interested in learning more about Data Science/AI/Machine learning and how it is used in investing.  First off, let me assure some of the people who have posted on different threads that this Data Science/AI/Machine Learning does work.  The best hedge funds are actually quantitative hedge funds like Renaissance Technologies, DE Shaw, Two Sigma, and I believe they do this type of work. Before the quantitative investors there were the fundamental investors (who spoke with the company, modeled the financials, qualitatively decided if this was a good investment, etc. i.e. like Warren Buffet) and the technical investors/traders who looked at charts and based on certain movements/volumes of the stock chart, they would invest.  Frankly I always thought technical investing was nonsense but a lot of people do it and maybe it works maybe it doesn't.  Then came the quants but I believe they were initially using complex mathematical models like Black-Scholes pricing models.  Now AI/Machine Learning is what the best quantitative hedge funds are using.  For my own edification, I'd like to get people's thoughts on how hedge funds are actually employing AI/Machine Learning to investing.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there certain algorithms that are better for investing in the stock market?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What types of data is most useful?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there different models for predicting short-term movements and long-term price movements?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Being an investor with 10+ years of experience, I have some general high level thoughts but I'm neither a programmer or a data science.  Please correct me if I'm wrong.  Essentially, these quantitative hedge funds are trying to find patterns in the stock/stocks/other asset classes (gold, bonds, currency, etc.) that have yet to be exploited.  As with the other types of investors, they want to know what will make a stock (or any other asset class) go up or down (most hedge funds both long and short stocks).  But while the other types of investors have a particular dogma they are following, these guys just care about the &quot;signal&quot; that will indicate whether the stock will go up or down.  Stocks and any other asset class go up and down based on supply and demand.  Are there more buyers vs. sellers - then the stock goes up.  Are there more sellers vs. buyers, then the stock goes down. So in essence, are these quant funds really just modeling/predicting human behavior and taking advantage of their ability to crunch data are a much large and faster capacity?  If that's the case, then from a fundamental perspective, I can easily hypothesize what type of data might move a stock/asset class.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if a stock has a certain trading pattern that indicates technical investors will likely buy it over a certain time frame, wouldn't that work?  Would there be a certain algorithm that works best for this type of analysis?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another example might be, if companies that exhibit certain revenue growth metrics, or margin improvement, would that signal a potential buy opportunity?  Or perhaps if certain words in their annual report, quarterly filings, press releases indicate this company is likely to do well?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or perhaps the holders list (the type of investor that owns the stock) could provide an indication of how the stock might react in the future. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could go on but I might be totally off base.  I'm essentially just noodling how this actually works and therefore I would like to hear any thoughts that people have.  Specific examples would be great so I could potentially test them out and learn some Data Science/AI/Machine Learning in the process.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have no false perception that I could do anything like these quantitative hedge funds.  That requires significant capital, use of leverage, hundreds of PH.D data scientist and programmers, costly servers, etc.  However, perhaps learning a little bit about their process might improve my fundamental process.  Although I'm not even sure about that since perhaps they might be distinctly different.  For those wanting to learn more about the investing world, happy to share my knowledge.  Also I'm not a data scientist or programmer so while I'd like to learn all these algorithms at the moment this is for my own edification.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alex &lt;/p&gt;&#xA;" OwnerUserId="20416" LastActivityDate="2016-04-28T00:16:24.243" Title="Thoughts on how quantitative hedge funds use machine learning to invest in the stock market (algorithms, examples of data, etc.)" Tags="&lt;equities&gt;&lt;time-series&gt;&lt;algorithm&gt;&lt;investment&gt;&lt;hedge-fund&gt;" AnswerCount="5" CommentCount="1" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="25550" PostTypeId="1" CreationDate="2016-04-21T21:32:06.627" Score="1" ViewCount="60" Body="&lt;p&gt;given someone's past investing history, is there a way to calculate his risk aversion?&lt;br&gt;&#xA;Say, we know this client's investment history for example his past return, is there a way to calculate his risk aversion and use this parameter to portfolio optimization?&lt;/p&gt;&#xA;" OwnerUserId="19188" LastActivityDate="2016-04-22T19:05:59.963" Title="given someone's past investing history, is there a way to calculate his risk aversion?" Tags="&lt;risk&gt;&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25552" PostTypeId="2" ParentId="17315" CreationDate="2016-04-21T22:26:27.533" Score="0" Body="&lt;p&gt;Sage Data Service - &lt;a href=&quot;http://www.sagedataservice.com&quot; rel=&quot;nofollow&quot;&gt;www.sagedataservice.com&lt;/a&gt; can provide the raw fundamental data you are looking for. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;All U.S. stocks are covered with 7 years of quarterly history and an additional 5 years of yearly history. The price of this offering is substantially below that offered by the big vendors. They don't offer ISIN codes. These codes are available at &lt;a href=&quot;http://www.isin.org&quot; rel=&quot;nofollow&quot;&gt;www.isin.org&lt;/a&gt; for a reasonable price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;API's and FTP are offered for downloading at Sage Data Service.&lt;/p&gt;&#xA;" OwnerUserId="20418" LastEditorUserId="743" LastEditDate="2016-04-28T14:54:47.583" LastActivityDate="2016-04-28T14:54:47.583" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25553" PostTypeId="1" AcceptedAnswerId="25562" CreationDate="2016-04-22T02:28:41.020" Score="2" ViewCount="642" Body="&lt;blockquote&gt;&#xA;&lt;p&gt;Formulate and solve the free boundary problem for the perpetual American options with the following payoffs.&lt;/p&gt;&#xA;&lt;p&gt;a.) &lt;span class=&quot;math-container&quot;&gt;$(S - K)_{+} + a$&lt;/span&gt; where &lt;span class=&quot;math-container&quot;&gt;$a &amp;gt; 0$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;b.) &lt;span class=&quot;math-container&quot;&gt;$(K - S)_{+} + a$&lt;/span&gt; where &lt;span class=&quot;math-container&quot;&gt;$a &amp;gt; 0$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;c.) Straddle&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I have no idea how to begin, I have some notes on perpetual American options but I am not sure how to solve these questions. I do not have much ode or pde experience but I am sure I would understand it if I saw the solution.&lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-04-22T16:25:01.030" Title="Perpetual American options" Tags="&lt;mathematics&gt;&lt;american-options&gt;&lt;finance-mathematics&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25554" PostTypeId="1" AcceptedAnswerId="25555" CreationDate="2016-04-22T05:00:08.587" Score="3" ViewCount="3220" Body="&lt;p&gt;I am thoroughly reading my first academic literature and I have found myself overwhelmed by terms that have been generalised in my studies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The extract is from &quot;The Beauty Contest and Short-Term Trading&quot; by Giovanni Cespa and Xavier Vives, and states&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;'Consider a one-period stock market in which a single risky asset (of&#xA;  liquidation value $v$) and a riskless asset are traded by a continuum&#xA;  of risk-adverse, informed investors in the interval $[0,1]$ and also&#xA;  by liquidity traders.'&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Who are liquidity traders? What is their purpose? What's an example of a liquidity trader and how would they contrast with the aforementioned informed trader?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, the paper continues&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;'Liquidity traders submit a random market order $u$, where $u$ is distributed according to $N(0,\tau^{-1})$'&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now I'm curious on the connection between random orders and liquidity traders. In addition, what quantity does $u$ represent?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I apologise for my ignorance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards,&lt;/p&gt;&#xA;" OwnerUserId="13726" LastActivityDate="2016-04-22T10:06:14.160" Title="Liquidity Traders" Tags="&lt;liquidity&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25555" PostTypeId="2" ParentId="25554" CreationDate="2016-04-22T10:06:14.160" Score="3" Body="&lt;p&gt;Liquidity traders have no discretion with regard to the timing of their trades. Their trades are triggered by exogenous (to the financial market) reasons and are not related to information.&lt;/p&gt;&#xA;&lt;p&gt;Then we can not guess/forecast their trades and that's why we can consider the quantity (not the price) they ask/offer as random variables.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;An academic definition :&lt;/p&gt;&#xA;&lt;p&gt;Two motives for trade in financial markets are widely recognized as&#xA;important: information and liquidity. Informed traders trade on the&#xA;basis of private information that is not known to all other traders&#xA;when trade takes place.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Liquidity traders&lt;/strong&gt;, on the other hand, trade&#xA;for reasons that are not related directly to the future payoffs of&#xA;financial assets-their needs arise outside the financial market.&#xA;Included in this category are large traders, such as some financial&#xA;institutions, whose trades reflect the liquidity needs of their&#xA;clients or who trade for portfolio-balancing reasons.&lt;/p&gt;&#xA;&lt;p&gt;Admati, A. R., &amp;amp; Pfleiderer, P. (1988). A Theory of Intraday Patterns: Volume and Price Variability. The Review of Financial Studies, 1(1), 3–40. &lt;a href=&quot;http://doi.org/10.1093/rfs/1.1.3&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://doi.org/10.1093/rfs/1.1.3&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-04-22T10:06:14.160" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25557" PostTypeId="2" ParentId="25478" CreationDate="2016-04-22T11:01:06.207" Score="1" Body="&lt;p&gt;If I'm correct Backtesting VaR usually boils down to two conditions:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The unconditional coverage hypothesis : the probability of an ex-post violation must be equal to the  coverage rate. (ie : if 0.01 confidence level, you should get 1% violation). You can test it with the Kupiec Test .&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The independence hypothesis, your VaR violations should be independent. (ie : you shouldn’t observe violations clustering- past violations should not influence current and future violations.) Engle and Manganelli (2004) develop a test for it.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;So, normally if your model is correctly specified you shouldn’t observe dependence in your series of violations.&lt;/p&gt;&#xA;&lt;p&gt;The point I think you underestimate is that every month you re-estimate your model with new data. It means that your &lt;span class=&quot;math-container&quot;&gt;$VaR_{2}$&lt;/span&gt; forecast will implicitly take into account your past violations. Your &lt;span class=&quot;math-container&quot;&gt;$VaR_{2}$&lt;/span&gt; already integrate your &lt;span class=&quot;math-container&quot;&gt;$VaR_{1}$&lt;/span&gt; violations since your &lt;span class=&quot;math-container&quot;&gt;$VaR_{2}$&lt;/span&gt; is based on a larger sample. So you can not consider a kind of square root of time method to extend your VaR forecast because you need to re-estimate VaR parameters every months.&lt;/p&gt;&#xA;&lt;p&gt;For more details about the independence hypothesis : Christoffersen, Peter, Backtesting (November 19, 2008). Available at SSRN: &lt;a href=&quot;http://ssrn.com/abstract=2044825&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://ssrn.com/abstract=2044825&lt;/a&gt; or &lt;a href=&quot;http://dx.doi.org/10.2139/ssrn.2044825&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://dx.doi.org/10.2139/ssrn.2044825&lt;/a&gt;&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;&lt;strong&gt;Edit :&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;I’m not sure I really got you point but I just clarify my talk :&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If you perform a rolling window VaR approach, ie every month you are estimating the next month VaR : then you perform 1 Month horizon VaR Forecast and not yearly VaR evaluation. There is no overlap. When you evaluate your VaR accuracy your are performing 11 VaR backtesting &lt;strong&gt;on a single period&lt;/strong&gt; (one month) window. In doing so you can not obtain « yearly (calendar) loss estimate »&lt;/li&gt;&#xA;&lt;li&gt;If you perform VaR estimation with different horizon but a fixed ending date (the calendar year), then to evaluate the accuracy of you VaR forecast, for each month the accuracy is evaluated also on a different (decreasing) window. That means that a large drop in December may be classified as a violation in the January VaR estimation, not classified as a violation in February VaR estimation and again as a violation in a March VaR estimation. The accuracy of your backtests should be conducted separately for each horizon , then your are performing 11 VaR backtesting on &lt;strong&gt;11 diffferent periods&lt;/strong&gt;. &lt;em&gt;Edit :  you cannot evaluate the VaR accuracy every month, you have to wait the end of the calendar year to evaluate the 11 VaR.&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-04-22T12:47:55.010" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="25558" PostTypeId="1" AcceptedAnswerId="25572" CreationDate="2016-04-22T12:24:07.373" Score="2" ViewCount="15078" Body="&lt;p&gt;I have reached a confusing dilemma regarding the par and notional values of a bond. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been told that the par value of a coupon bond is $100. However, the notional value of the bond is 1,000,000.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do they not represent the same thing; the face value of the bond? Is there a difference? Through my years in finance I assumed they were equivalent. Google does not provide an answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, if some context helps, I have been told that&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Par Value = 100&lt;/li&gt;&#xA;&lt;li&gt;Market Value = 100&lt;/li&gt;&#xA;&lt;li&gt;Maturity = 5&lt;/li&gt;&#xA;&lt;li&gt;Notional Value = 1,000,000&lt;/li&gt;&#xA;&lt;li&gt;YTM = 2.8% p.a.&lt;/li&gt;&#xA;&lt;li&gt;Mod. Duration = 2.35% p.a.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I am required to find the coupon rate of the bond. Naturally, I would rely on the standard discounting of cash flows to create an equation, thereby allowing to solve for the coupon rate. However, the par/notional values are creating problems&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kind regards,&lt;/p&gt;&#xA;" OwnerUserId="13726" LastEditorUserId="13726" LastEditDate="2016-04-22T12:55:09.917" LastActivityDate="2016-04-22T19:29:55.953" Title="The Difference between Notional and Par Value of a Bond" Tags="&lt;bond&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25559" PostTypeId="2" ParentId="25542" CreationDate="2016-04-22T13:06:11.923" Score="1" Body="&lt;p&gt;This is pretty much impossible to do, but if you must, you'll have to make some assumptions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can assume that the yields given are par yields. In other words, they represent both the yield AND the coupon rates of bonds trading at par. And assuming you also have short-term interest rates, you can compute forward price on this hypothetical par bond and use that as the basis for futures price (you won't need to worry about delivery option, but you still have to account for the conversion factor). Carry is simply the difference between spot price (assumed to be 100) and forward price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To compute returns, you take this bond and reprice at at the next period (i.e., holding coupon rate constant and reducing time to maturity, you reprice it at the new yield). That allows you to compute returns.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2016-04-22T13:06:11.923" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25560" PostTypeId="1" CreationDate="2016-04-22T14:04:32.237" Score="0" ViewCount="91" Body="&lt;p&gt;I am trying to estimate the minimum variance portfolio where the assets are currency derivatives. In the specific case it does not make sense to base correlations or variance on asset returns. I am interested in getting a low variance in the actual value of the portfolio and not the returns. Can I just calculate the variance and correlation on the back of the individual asset value or does it have to be returns for the MVP theory to make sense?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!   &lt;/p&gt;&#xA;" OwnerUserId="20423" LastActivityDate="2016-04-23T03:23:35.917" Title="Portfolio Theory: Must VarCovar Matrix be based on return var/covar?" Tags="&lt;returns&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;&lt;currency&gt;&lt;minimum-variance&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25561" PostTypeId="2" ParentId="25553" CreationDate="2016-04-22T15:56:55.433" Score="3" Body="&lt;ol&gt;&#xA;&lt;li&gt;Use Dynkin's formula to write the expectation: $\mathbb{E}[e^{-r\tau} \phi(S_\tau)]= g(S_0)+\mathbb{E}[\int_ 0 ^ \tau (A g -rg) dt]$ where $\phi$ is the payoff.&lt;/li&gt;&#xA;&lt;li&gt;Use the infinitismal generator $A$ to derive an ODE which describes the solution&lt;/li&gt;&#xA;&lt;li&gt;Use the fact that American options must be equal to or greater than their intrinsic value to derive boundary conditions for the ODE&lt;/li&gt;&#xA;&lt;li&gt;Solve the ODE (its pretty straightforward, but if you don't have any background in ODEs try linear combinations of a power of the stock price)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2016-04-22T15:56:55.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25562" PostTypeId="2" ParentId="25553" CreationDate="2016-04-22T16:25:01.030" Score="2" Body="&lt;p&gt;I assume $r&amp;gt;0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let look at a)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $v$ be the solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$v$ is increasing (easy to prove, take $x&amp;lt;y$ and show that $v(x)&amp;lt;v(y)$ due $(S^x_t-K)^++a&amp;lt;(S^y_t-K)^++a$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;on the continuity region $C$, i.e $x:v(x)&amp;gt;(x-K)^++a$, you have :&#xA;$$\text{Black Scholes PDE perpetual case : }\frac{1}{2}\sigma^2x^2v''(x)+rxv'(x)-rv(x)=0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;solutions are of the form :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C_1x^{\frac{-2r}{\sigma^2}}+C_2x$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you have to find out if $C=[0,x^\star)$ or $(x^\star,+\infty)$ or something more complicated $(x^\star_1,x^\star_2)$...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So study $x\to v(x)-(x-K)^+-a$,&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-04-22T16:25:01.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25563" PostTypeId="1" CreationDate="2016-04-22T16:27:32.117" Score="0" ViewCount="452" Body="&lt;p&gt;I am looking at some sharpe ratio related estimates and have not seen Sharpe stats broken down this way before.  I don't know what is meant by df, t, and p.  Can someone explain that to me?  Thank you!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/O4n5C.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/O4n5C.png&quot; alt=&quot;Here is the picture&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15493" LastActivityDate="2016-04-22T17:51:01.620" Title="What are &quot;df&quot;, &quot;t&quot;, and &quot;p&quot; in these sharpe ratio related estimates?" Tags="&lt;statistics&gt;&lt;risk-management&gt;&lt;sharpe-ratio&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25564" PostTypeId="2" ParentId="25539" CreationDate="2016-04-22T16:33:22.283" Score="1" Body="&lt;p&gt;You can do it manually. Let &lt;code&gt;x&lt;/code&gt; be the data series. The code below considers all moving-average lag orders between &lt;code&gt;0&lt;/code&gt; and &lt;code&gt;max.q&lt;/code&gt; and prints out the BIC-minimizing lag order and the corresponding estimated model:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;m=list() # I will save estimated ARIMA(1,0,q) models here&#xA;BIC=c()  # I will save the corresponding BIC values here&#xA;max.q=10 # the maximum MA order you want to consider&#xA;n=length(x)&#xA;for(q in 0:max.q){&#xA; m[[q+1]]=arima(x,order=c(1,0,q),method=&quot;ML&quot;)&#xA; BIC[q+1]=AIC(m[[q+1]],k=log(n))&#xA;}&#xA;print(paste(&quot;BIC-optimal MA order is&quot;,which.min(BIC)-1)) # info message&#xA;print(m[[which.min(BIC)]]) # print the estimated BIC-optimal model&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To respond to a request in the comments, I am including a function that returns the estimated MA1 coefficient:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;MA1fromARIMA10q=function(x,max.q=10,...){&#xA; # x is a data vector (a time series)&#xA; # max.q is the maximum MA order to be considered&#xA; m=list() # I will save estimated ARIMA(1,0,q) models here&#xA; BIC=c()  # I will save the corresponding BIC values here&#xA; n=length(x)&#xA; for(q in 0:max.q){&#xA;  m[[q+1]]=arima(x,order=c(1,0,q),...)&#xA;  BIC[q+1]=AIC(m[[q+1]],k=log(n))&#xA; }&#xA; q=which.min(BIC)-1&#xA; if(q&amp;gt;0) MA1=coef(m[[q+1]])[2] else(MA1=NA) # if MA order is 0, assign NA&#xA; return(MA1)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="19645" LastEditorUserId="19645" LastEditDate="2016-04-24T10:59:43.843" LastActivityDate="2016-04-24T10:59:43.843" CommentCount="27" ContentLicense="CC BY-SA 3.0" />
  <row Id="25565" PostTypeId="2" ParentId="21394" CreationDate="2016-04-22T16:54:05.457" Score="2" Body="&lt;p&gt;This is a resource you may want to look at. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://personal.vanguard.com/pdf/ISGHC.pdf&quot; rel=&quot;nofollow&quot;&gt;https://personal.vanguard.com/pdf/ISGHC.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, this books seems good for this particular topic:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Risk Without Reward: The Case for Strategic FX Hedging. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, take a look at &lt;a href=&quot;https://books.google.lk/books?id=0UY7Axe5zPgC&amp;amp;pg=PA450&amp;amp;lpg=PA450&amp;amp;dq=currency+risk+hedging+bond+portfolio&amp;amp;source=bl&amp;amp;ots=EmO5MEKj0M&amp;amp;sig=Pu5h6OIkku4BEMO9cuGYaHM6GBc&amp;amp;hl=en&amp;amp;sa=X&amp;amp;ved=0ahUKEwiq35LT2qLMAhXEHZQKHTG7BwU4ChDoAQguMAM#v=onepage&amp;amp;q=currency%20risk%20hedging%20bond%20portfolio&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;Advanced Bond Portfolio Management: Best Practices in Modeling and Strategies edited by Frank J. Fabozzi, Lionel Martellini, Philippe Priaulet&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20321" LastEditorUserId="848" LastEditDate="2016-04-22T18:23:23.547" LastActivityDate="2016-04-22T18:23:23.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25566" PostTypeId="2" ParentId="25563" CreationDate="2016-04-22T17:06:21.853" Score="1" Body="&lt;p&gt;The Sharpe Ratio and the T-Statistic for the hypothesis that returns are equal to the risk free rate, are closely related (occasionally some people mistakenly think they are the same). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact: &quot;The t-statistic will equal the Sharpe Ratio times the square root of N (the number of returns used for the calculation).&quot; &lt;a href=&quot;https://web.stanford.edu/~wfsharpe/art/sr/sr.htm&quot; rel=&quot;nofollow&quot;&gt;1&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it makes sense to show both. Then, by looking up the T-statistic t in a Student-t table with the right degrees of freedom you can come up with p the probability in a one-tailed test under the null. The df (degrees of freedom) is simply the number of (monthly) returns.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-04-22T17:51:01.620" LastActivityDate="2016-04-22T17:51:01.620" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25568" PostTypeId="2" ParentId="25560" CreationDate="2016-04-22T18:44:05.423" Score="1" Body="&lt;p&gt;It doesn't make sense to use the (co)variance(s) of asset values; if you did, by cutting an investment's share of the allocation by half, you would also cut its variance by a factor of 4. In a meaningful portfolio design, the volatility (variance) of an asset, by itself, is the same no matter how much or how little of your portfolio you put in it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why doesn't it make sense to use correlations and variance of RETURNS for currency derivatives?&lt;/p&gt;&#xA;" OwnerUserId="20429" LastActivityDate="2016-04-22T18:44:05.423" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25570" PostTypeId="2" ParentId="25558" CreationDate="2016-04-22T18:56:08.847" Score="4" Body="&lt;p&gt;Using the words the way I have in my old job: Par PRICE of 100, market PRICE of 100, notional value of 1,000,000 - then the par VALUE is also 1,000,000 (and the market value as well). Rephrasing your question: aren't par value and notional value the same thing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Answer: not always. For example, for inflation-index bonds (TIPS), in the United States, you may have a notional value of \$1,000,000. If the inflation index factor is 1.1, then the &quot;par value&quot; of the bond (meaning, at a &quot;bond price&quot; of 100) is \$1,100,000, different from the &quot;notional&quot; value. Similarly, for a mortgage backed security, if the notional value is \$1,000,000, if the factor is 0.3 (meaning only 30% of the original principal is still outstanding), the &quot;par value&quot; of the security, meaning at a bond price of 100, is only \$300,000. &quot;Notional value&quot; is equal to &quot;par value&quot; when a bond or fixed income security is first issued; in most cases (except call events and such), the notional value doesn't change, while the par value can change with an &quot;index&quot; or &quot;factor&quot; like the inflation index for TIPS, or the remaining principal &quot;factor&quot; for MBS's.&lt;/p&gt;&#xA;" OwnerUserId="20429" LastActivityDate="2016-04-22T18:56:08.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25571" PostTypeId="2" ParentId="25550" CreationDate="2016-04-22T19:05:59.963" Score="1" Body="&lt;p&gt;Maybe. Certainly you shouldn't use their realized return (&quot;past return&quot;) because that does not reflect expectations, it reflects events that became known after the client decided on their asset allocation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand: with a lot of (unrealistic?) assumptions, you CAN discern the client's risk aversion from their allocation. Suppose for example that there are just two asset classes, &quot;stocks&quot; and &quot;bonds,&quot; there is agreement on the statistics of future returns, such as expected returns, standard deviations, and correlations of asset class returns, and suppose also that somehow you know a client has power utility of expected wealth. There is a one-to-one correspondence between the possible exponents for the utility function and the corresponding optimal allocation of investment portfolio between &quot;stocks&quot; and &quot;bonds,&quot; at least within some intervals for the exponent and for the optimal allocations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, this is only good to help understand the concepts; anyone trying to apply this in real life should have their head checked.&lt;/p&gt;&#xA;" OwnerUserId="20429" LastActivityDate="2016-04-22T19:05:59.963" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25572" PostTypeId="2" ParentId="25558" CreationDate="2016-04-22T19:29:55.953" Score="3" Body="&lt;p&gt;You are being confused by the convention.  Just using simple treasuries, look at it this way.  The usual size that an institution quotes is for ten thousand \$100 par bonds.  So, if you buy one bond for \$100 you are actually getting 10,000 little bonds and paying \$100 each.  That's \$1mm total (forget about accrued interest to make it simple).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The convention could have been that the standard quote size of one is for 1,000 bonds, but it isn't.  It doesn't matter that much, you can trade .0001  bond.  Beyond that they can't settle in GSCC as far as I know.  Although there might even be a way to do that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you buy .0001 bond for \$100 you are paying \$100 and actually getting one bond. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the $100 is the price per.  That is whatever you agree to with your counterparty.  eg, I offer you one 10 year note for 101.  You lift my offer and now need to give me 101x10,000=\$1,010,000.&lt;/p&gt;&#xA;" OwnerUserId="20092" LastActivityDate="2016-04-22T19:29:55.953" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25573" PostTypeId="1" CreationDate="2016-04-22T22:42:42.450" Score="0" ViewCount="107" Body="&lt;p&gt;Given that the 1 year zero coupon bond interest rate is 5%, 2 year zero coupon bond interest rate is 6% and 3 year zero coupon bond interest rate is 7%. 4 year coupon bond price and interest rate are unknown. How to derive for 5 year zero coupon bond interest rate ?&lt;/p&gt;&#xA;" OwnerUserId="20432" LastActivityDate="2016-04-23T11:05:45.903" Title="Can we derive 5 year zero coupon interest rate by using 1, 2 and 3 year zero coupon interest rate?" Tags="&lt;interest-rates&gt;&lt;zero-coupon&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25574" PostTypeId="2" ParentId="25573" CreationDate="2016-04-23T03:18:28.107" Score="2" Body="&lt;p&gt;Who knows what the 5 year zero coupon rate is in that case, there could be an event 4.5 years out that will have serious interest rate implications that we don't know about. The only thing you can do with these three numbers is extrapolate and say the rate should 9%. You should be aware of what assumptions you're making when you do something like that, but I'll leave that up to you to ponder on.&lt;/p&gt;&#xA;" OwnerUserId="5092" LastActivityDate="2016-04-23T03:18:28.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25575" PostTypeId="2" ParentId="25560" CreationDate="2016-04-23T03:23:35.917" Score="0" Body="&lt;p&gt;You need to model the underlyings, price the derivatives, and then measure risk.&lt;/p&gt;&#xA;" OwnerUserId="5092" LastActivityDate="2016-04-23T03:23:35.917" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25576" PostTypeId="2" ParentId="25549" CreationDate="2016-04-23T03:38:55.853" Score="1" Body="&lt;p&gt;HFT firms are liquidity providers. They post bids and offers at prices around what they believe the fair price of the stock is at the current moment. The distance between those bids and offers can be thought of as a confidence interval. So, to put it quite simply, they can use machine learning to better estimate the fair price of the asset or better estimate the width of their confidence interval.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They are less modeling &quot;human behavior&quot; and more modeling a dynamic system  that has random components to it, and they're doing it both quickly and precisely. If you think an asset is currently worth X and you're 80% confident it's worth between X+a and X-b, then if you make a trade at price X+a or X-b you should be pretty happy about it. Obviously its more complex than this, but this should provide you a framework of how you could employ whatever knowledge of machine learning you have towards trading.&lt;/p&gt;&#xA;" OwnerUserId="5092" LastActivityDate="2016-04-23T03:38:55.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25577" PostTypeId="2" ParentId="25573" CreationDate="2016-04-23T11:05:45.903" Score="0" Body="&lt;p&gt;The result depends on where you see 3y and 4y forward rates.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;1 year forward rate is $7.01\% = (1+6\%)^2/(1+5\%)-1$ &lt;/li&gt;&#xA;&lt;li&gt;2 year forward rate is $9.03\% = (1+7\%)^3/(1+6\%)^2-1$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you assume that forwards are flat after 2nd year: 3yFwd=4yFwd=2yFwd = $9.03\%$ then your 5y spot becomes  $((1+5\%)*(1+7.01\%)*(1+9.03\%)^3)^{1/5} - 1 = 7.81\%$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you assume that forwards are linear then 3yFwd=$11.1\%$, 4yFwd=$13.1\%$ so your 5y spot becomes $((1+5\%)*(1+7.01\%)*(1+9.03\%)*(1+11.1\%)*(1+13.1\%)]^{1/5} - 1 = 9.01\%$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have any other view on 3y and 4y forwards you'll derive 5y spot accordingly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/dExZU.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/dExZU.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18275" LastActivityDate="2016-04-23T11:05:45.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25579" PostTypeId="1" CreationDate="2016-04-23T11:55:23.753" Score="2" ViewCount="2455" Body="&lt;p&gt;I'm trying to retrieve historical stocks fundamental data from Bloomberg to backtest some quant ideas. I'm having trouble to find the correct point in time the data was available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, the EPS time series returns the dates related to the company reporting period, but that's &lt;strong&gt;not&lt;/strong&gt; the day when the information was publicly available. Usually companies announce the results some months later.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the best way to retrieve these fundamental data from Bloomberg for backtesting?&lt;/p&gt;&#xA;" OwnerUserId="20438" LastEditorUserId="467" LastEditDate="2016-06-11T06:30:57.933" LastActivityDate="2016-12-13T15:57:35.047" Title="How to get historical fundamental data in Bloomberg suitable for backtesting?" Tags="&lt;quant-trading-strategies&gt;&lt;backtesting&gt;&lt;historical-data&gt;&lt;bloomberg&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25581" PostTypeId="1" CreationDate="2016-04-23T13:16:01.533" Score="1" ViewCount="373" Body="&lt;p&gt;I have created quite a complex back test in excel spanning 15 years with 17 parameters. I would like to optimize the parameters which would give me maximum return given a maximum draw-down percentage. Is it possible to optimize it without actually coding the strategy in R or similar software that have optimization capabilities?  &lt;/p&gt;&#xA;" OwnerUserId="19380" LastActivityDate="2016-04-23T13:16:01.533" Title="Optimize a trading strategy created in excel with R" Tags="&lt;r&gt;&lt;optimization&gt;&lt;portfolio-optimization&gt;&lt;excel&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25582" PostTypeId="1" AcceptedAnswerId="25632" CreationDate="2016-04-23T15:10:37.567" Score="3" ViewCount="128" Body="&lt;p&gt;In Hagan's paper on valuing CMS swaps (&lt;a href=&quot;http://www.wilmott.com/pdfs/050118_hagan.pdf&quot; rel=&quot;nofollow&quot;&gt;Convexity Conundrums: Pricing CMS Swaps, Caps, and Floors&lt;/a&gt;), there is:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;So the swap rate must also be a Martingale, and &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$$E \big[ R_s(\tau) \big| \mathcal{F}_0 \big]=R_s(0) = R_s^0$$&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;To complete the pricing, one now has to invoke a mathematical model (Black’s model, Heston’s model, the SABR model, . . . ) for how $R_s(\tau)$ is distributed around its mean value $R_s^0$. In Black’s model, for example, the swap rate is distributed according to &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$$R_s(\tau) = R_s(0)e^{\sigma x\sqrt{\tau}-\frac{1}{2}\sigma^2\tau}$$&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;where x is a normal variable with mean zero and unit variance. One completes the pricing by integrating to calculate the expected value.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And he stopped here. So I am trying to &quot;complete the pricing by integrating&quot;, but I am not sure of what he actually meant. I think he just wants to get the swap rate $R_s(0)$, but I am not sure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This integration would lead to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;R_s(0) = E \big[ R_s(\tau) \big| \mathcal{F}_0 \big] = \int_{-\infty}^{+\infty} R_s(\tau) \frac{-\frac{x^2}{2}}{\sqrt{2\pi}}dx = \int_{-\infty}^{+\infty}  R_s(0)e^{\sigma\sqrt{\tau}x-\frac{1}{2}\sigma^2\tau} \frac{-\frac{x^2}{2}}{\sqrt{2\pi}}dx &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This does not make sens, since $R_s(0)$ is on both side of the equation. Maybe I am not looking at it the right way, and he meant something else. Or maybe my integration is wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am a bit lost here. Any help would be appreciated to understand how to &quot;complete this pricing&quot;.&lt;/p&gt;&#xA;" OwnerUserId="15650" LastEditorUserId="848" LastEditDate="2016-04-23T15:21:25.207" LastActivityDate="2016-04-25T18:13:28.243" Title="Integration to calculate expected value of swap rate" Tags="&lt;interest-rates&gt;&lt;fixed-income&gt;&lt;martingale&gt;&lt;expected&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25583" PostTypeId="1" AcceptedAnswerId="25585" CreationDate="2016-04-23T15:25:53.687" Score="6" ViewCount="2140" Body="&lt;p&gt;I have a very basic question around convexity adjustments in swap valuations. I am comfortable with the mathematical derivation of the convexity adjustment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question relates to when and why a convexity adjustment is deemed necessary in some cases and not others.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The general rule seems to be that:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;For a vanilla IRS, or any other variation in which the floating rate applied to a given period $(T_i, T_{i+1})$ is observed at $T_i$, the &quot;correct&quot; approach is to assume that the expected future spot rates are equal to forward rates, and thus a convexity adjustment is not needed.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If on the other hand, the floating rate is set at the end of the period, as in a Libor-in-arrears swap, the &quot;correct&quot; approach is to apply a convexity adjustment to the forward rate to arrive at the expected future swap rate.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Why is the &quot;forward rates will be realized&quot; assumption valid for a simple FRA-based IRS swap, and not for a Libor-in-arrears swap?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Everything I have read seems to simply state this as fact without providing some sort of explanation of why this convention is used?&lt;/p&gt;&#xA;" OwnerUserId="20442" LastActivityDate="2016-04-24T14:16:38.523" Title="Interest Rate Convexity - Fundamental Question" Tags="&lt;interest-rate-swap&gt;&lt;convexity&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25584" PostTypeId="2" ParentId="25582" CreationDate="2016-04-23T15:55:38.203" Score="1" Body="&lt;p&gt;Let's recall the definition of a Martingale first: it is a stochastic process $X(t)$ that has the following property: let $0 \leq t &amp;lt; T$ two real numbers. Let $\mathcal{F}_t$ be a filtration for the process $X$ at time $t$. We have then:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\mathbb{E}[X(T)|\mathcal{F}_t] = X(t)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if you use Black's model, you describe your asset price using a geometric Brownian motion. This is &lt;em&gt;not&lt;/em&gt; a martingale. Let's study it a bit more:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;S(t) = S_0 \exp{(\sigma \sqrt{t} W(t) - \frac{1}{2}\sigma^2 t)}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you consider the logarithm of this process, you'll establish that it follows a normal law of mean $\ln S_0 - \frac{1}{2}\sigma^2t$ and variance $\sigma^2 t$. By going a bit more into calculus you can establish it has the Markov property, but this is not a martingale.&lt;/p&gt;&#xA;" OwnerUserId="20443" LastActivityDate="2016-04-23T15:55:38.203" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25585" PostTypeId="2" ParentId="25583" CreationDate="2016-04-23T16:57:24.460" Score="3" Body="&lt;p&gt;This is indeed just a convention, as you point out.   It comes from the fact that zero coupon bonds, by convention, do not have any volatility exposure.  Rather, it is assumed the prices of ZCBs are given.   Now, you can replicate a regular fra with strike K exactly using ZCBs:    Long one ZCB with maturity T(i) and short (1+alpha K) ZCBs with maturity T(i+1), where alpha is the time between T(i) and T(i+1).   Hence, regular fra's do not have any volatility exposure.   Therefore regular IRS do not either.   Therefore fra's where the payment date is 'unnatural' must have volatility exposure.  Therefore these must have convexity adjustments, depending on volatility.   Does that help ?&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-04-23T16:57:24.460" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25586" PostTypeId="1" AcceptedAnswerId="25587" CreationDate="2016-04-23T18:07:55.090" Score="1" ViewCount="202" Body="&lt;p&gt;I am attempting to solve a compound interest calculation for time given&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Principal = 100&#xA;Time(years) = t&#xA;Rate(per year) = 8%&#xA;Deposit(per month) = 5&#xA;Total = 300&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can find solving for time without regular deposits. Can anyone help me out with a source or a workup of how to do this calculation with a regular monthly deposit?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.mathportal.org/calculators/financial-calculators/compound-interest-calculator.php?formId=0&amp;amp;val1=4500&amp;amp;val2=7&amp;amp;val3=9&amp;amp;combo1=1&amp;amp;combo2=2&quot; rel=&quot;nofollow&quot;&gt;http://www.mathportal.org/calculators/financial-calculators/compound-interest-calculator.php?formId=0&amp;amp;val1=4500&amp;amp;val2=7&amp;amp;val3=9&amp;amp;combo1=1&amp;amp;combo2=2&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm attempting to use this calculator but it does not allow for deposits. That is essentially what i need but with deposits.&lt;/p&gt;&#xA;" OwnerUserId="20446" LastActivityDate="2016-04-23T19:59:40.333" Title="Compound interest calculator solving for time with deposits" Tags="&lt;interest&gt;&lt;investing&gt;&lt;compounding&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ClosedDate="2016-04-30T17:57:38.053" ContentLicense="CC BY-SA 3.0" />
  <row Id="25587" PostTypeId="2" ParentId="25586" CreationDate="2016-04-23T19:59:40.333" Score="2" Body="&lt;p&gt;Look this is just a geometric sum:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume interest is paid monthly at rate $r = 0.08/12$ (you can use the exact monthly equivalent if you want) and let $x_n = $total after $n$ months (including that month's interest and deposit).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So $x_0= 100$ and $x_{n+1} = x_n(1+r) + d$, where $d = 5$ is your deposit amount (added at the end of the month).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Applying the recursion repeatedly you see&#xA;$$&#xA;x_n = x_0(1+r)^n + d(1+r)^{n-1} + \ldots + d = x_0(1+r)^n + d\sum_{j=0}^{n-1}(1+r)^j.&#xA;$$&#xA;After applying the geometric sum formula you get&#xA;$$&#xA;x_n = x_0(1+r)^n + \frac{d}{r}((1+r)^n-1).&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus (assuming my metaphorical back-of-envelope calculation is right):&#xA;$$&#xA;(1+r)^n = \frac{x_n + \gamma}{x_0 + \gamma},&#xA;$$&#xA;where $\gamma = d/r$.  Take log of both sides to get&#xA;$$&#xA;n = \log\left(\frac{x_n + \gamma}{x_0 + \gamma}\right)/\log(1+r).&#xA;$$&#xA;I.e. to get the number of months to reach 300 you would take $x_n =300$ here and round $n$ upto the next integer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is 32 months for your example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could easily modify this so that your deposits increase over time, interest is paid yearly, etc.&lt;/p&gt;&#xA;" OwnerUserId="19547" LastActivityDate="2016-04-23T19:59:40.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25588" PostTypeId="2" ParentId="25583" CreationDate="2016-04-23T20:34:17.100" Score="2" Body="&lt;p&gt;OK, so I think I have this figured out in my head now in terms of martingale measure theory. Thanks dm63 for pointing me in the right direction! Just for my own peace of mind and perhaps to help others in the future, my understanding is as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Vanilla Swap: We observe the LIBOR $L(T_i, T_{i+1})$ at time $T_i$ and payment occurs at $T_{i+1}$. Therefore the correct measure is the classic &quot;forward-risk-neutral&quot; measure with respect to a ZCB expiring at time $T_{i+1}$. In this measure, $L(T_i, T_{i+1})$ is a martingale and therefore $L(t, T_i, T_{i+1})$ = $\mathbb{E}^Q[L(T_i, T_i, T_{i+1})]$ - in other words in this case the forward LIBOR in question is equal to its expected future spot value (in the aforementioned measure) and hence no convexity adjustment is needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;LIBOR-In-Arrears Swap: We observe the same LIBOR, again at $T_i$, but this time payment also occurs at $T_i$. Therefore the appropriate measure is one which is forward risk neutral with respect to a ZCB expiring at time $T_{i}$. However, in this measure, the LIBOR in question $L(T_i, T_{i+1})$ is not a martingale. Hence the forward LIBOR is not equal to the expected future spot rate, hence the need for the convexity adjustment.&lt;/p&gt;&#xA;" OwnerUserId="20442" LastActivityDate="2016-04-23T20:34:17.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25590" PostTypeId="1" CreationDate="2016-04-23T22:44:44.387" Score="1" ViewCount="415" Body="&lt;p&gt;Vanilla Swap question. &#xA;Entered into a 5Y fixed for floating HUF swap. Fixed is annual coupons, Float is semi-annual coupons. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 month later I want to price it. I set up my future values for Fixed coupons for the next 5Y and notional at the end, and my next [coupon + notional] for Float (the coupon is now in 5 months, and a Floating rate is valued at par right after it pays its coupon).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the BUBOR rates. For my discount factors for my PV, do I use straight line interpolation of the rates? Or use the next interest rate? For example, with .39Y to go before the floating rate coupon, do I use the 0.5Y rate, the .25Y rate, or the interpolated (weighted average of rate and time) of both?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also under continuous compounding (e), since my Fixed leg is ACT/365 and BUBOR is ACT/360, do I have to multiply the BUBOR rate by (365/360) before getting my discount rate to make it equivalent?&lt;/p&gt;&#xA;" OwnerUserId="20447" LastActivityDate="2017-10-17T20:33:39.770" Title="Pricing a Vanilla swap between coupons; What rates to use?" Tags="&lt;interest-rates&gt;&lt;swaps&gt;&lt;floating-rate&gt;&lt;fixed&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25591" PostTypeId="1" AcceptedAnswerId="25628" CreationDate="2016-04-23T23:45:29.557" Score="-1" ViewCount="200" Body="&lt;p&gt;Consider the payoff $g(S_T)$ shown the figure:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/57Z3W.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/57Z3W.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe the payoff represented as a linear combination of the payoffs of some options with different strike and same maturity $T$ is $$g(S_T) =   (2K - S_T)_{+} - (K - S_T)_{+}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not exactly sure this is correct, any suggestions is greatly appreciated. &lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="19002" LastEditDate="2016-04-24T14:47:24.763" LastActivityDate="2016-04-25T16:02:38.817" Title="Payoff of option" Tags="&lt;options&gt;&lt;mathematics&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25592" PostTypeId="1" CreationDate="2016-04-24T02:14:31.437" Score="2" ViewCount="797" Body="&lt;p&gt;From what I have been reading online, &lt;em&gt;smart beta&lt;/em&gt; ETFs aim to use a different type of weighting (instead of by market cap as traditional ETFs like SPY do to track an index) to achieve positive performance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would risk-parity be considered a form of smart beta (basically weight investments based on volatility as opposed to market cap?).&lt;/p&gt;&#xA;" OwnerUserId="20450" LastEditorUserId="467" LastEditDate="2018-01-30T04:53:31.787" LastActivityDate="2018-01-30T04:53:31.787" Title="Are smart beta and risk-parity the same?" Tags="&lt;risk&gt;&lt;beta&gt;&lt;etf&gt;&lt;risk-parity&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25596" PostTypeId="1" CreationDate="2016-04-24T08:38:23.830" Score="9" ViewCount="1055" Body="&lt;p&gt;I would greatly appreciate any insights into the problem described below, &#xA;regarding using the data obtained from applying the functions of the &#xA;&lt;code&gt;rugarch&lt;/code&gt; package into those from the &lt;code&gt;copula&lt;/code&gt; package. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I fitted AR(1)-GARCH(1,1) to two return series u,v of length 500 each. &#xA;using &lt;code&gt;rugarchfit&lt;/code&gt;in R. &lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I converted the residuals to uniform using &#xA;&lt;code&gt;pit(residuals(fit,standardize=TRUE))&lt;/code&gt; &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Then, I plugged these residuals (uniform using PIT) to a copula and got the parameters. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;I simulated 100 points (bivariate) from the fitted copula. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Now, I want to convert these 100 points which are uniformly distributed back to the originally distributed series. How can I do this? How can I convert them back to residual form and then applying the fitted AR-GARCH to get the original series form?&lt;/p&gt;&#xA;" OwnerUserId="20333" LastEditorUserId="26595" LastEditDate="2017-10-07T14:19:59.137" LastActivityDate="2019-04-30T23:02:50.563" Title="Fitting Copula and Simulation" Tags="&lt;time-series&gt;&lt;garch&gt;&lt;copula&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25597" PostTypeId="1" AcceptedAnswerId="25607" CreationDate="2016-04-24T09:27:45.773" Score="0" ViewCount="148" Body="&lt;p&gt;I'm currently reading Kathy Lien's 'Day Trading and Swing Trading the Currency Market' and I came across this phrase on risk reversals: &quot;near choice&quot;. What does it mean when risk reversals are near choice? My initial guess is that it means that both OTM calls and puts have roughly the same implied vols?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="6722" LastActivityDate="2016-04-24T16:49:00.787" Title="What does it mean when a risk reversal is near choice?" Tags="&lt;options&gt;&lt;fx&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25598" PostTypeId="2" ParentId="25592" CreationDate="2016-04-24T10:43:02.603" Score="1" Body="&lt;p&gt;They are not the same as in they are equal, but risk parity can be considered a smart beta strategy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Smart beta is this opaque term that covers anything that can be put into a factor, regressed against returns and adjusted for, but also a host of other non-factor strategies that aim to create a mechanical, non-stock index weighting scheme that is rebalanced at some predetermined frequency - this includes risk parity. &lt;/p&gt;&#xA;" OwnerUserId="13808" LastActivityDate="2016-04-24T10:43:02.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25599" PostTypeId="2" ParentId="25284" CreationDate="2016-04-24T12:20:10.530" Score="0" Body="&lt;p&gt;If $R$ and $r$ are the return on the portfolio &lt;strong&gt;after currency hedging&lt;/strong&gt; and on the currency, if I write $V(\cdot)$ for variance, and a fraction of $t$ of the portfolio is exposed to currency risk, then the return of the unhedged portfolio is $R+tr$. Then:&#xA;$$V(R+tr) = V(R) + 2t\mathrm{Cov}(R,r) + t^2 V(r)$$&#xA;so the marginal contribution (derivative with respect to t) is&#xA;$$\frac {\text d} {\text d t}V(R+tr) = 2\mathrm{Cov}(R,r) + 2tV^2(r).$$&lt;/p&gt;&#xA;" OwnerUserId="20429" LastActivityDate="2016-04-24T12:20:10.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25600" PostTypeId="2" ParentId="25481" CreationDate="2016-04-24T12:28:47.270" Score="2" Body="&lt;p&gt;I think you got it. Wrapping up:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually denoted by $(\mathcal {F}_t)_{t \geq 0}$, a filtration is a series of &lt;em&gt;adaptive subsets&lt;/em&gt; of the $\sigma$-algebra $\mathcal{F}$ that keeps track of &lt;em&gt;what really happened as time went by&lt;/em&gt; (i.e. fixed $\omega$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Over the &lt;em&gt;probability space&lt;/em&gt; $(\Omega, \mathcal{F}, \mathbb{P})$, a random variable $X_t $ is measurable iff $\mathbb {P}(X_t)$ can be defined in the usual sense. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $X_t $ is in addition $\mathcal {F}_t$-measurable, over the &lt;em&gt;filtered probability space&lt;/em&gt; $(\Omega, \mathcal {F}, (\mathcal {F}_t)_{t \geq 0}, \mathbb{P})$ we can further claim that $X_t $ is known almost surely given the information available at $t$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{P}(X_t=X(t) \vert \mathcal {F}_t)=1, \forall t \geq 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $X(s), \forall s \leq t$ figures the set of past values which the process $X_t$ has taken up to time $t$.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In financial mathematics, $\mathcal{F}_t$ usually corresponds to the &lt;em&gt;natural filtration&lt;/em&gt; of a 'driving' process (e.g. Brownian motion $B_t$), which - as the name indicates - drives the target Markov process $X_t$ we would like to model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One can then show that claiming that $X_t$ is $\mathcal {F}_t$-measurable is equivalent to saying that there exists a sufficiently well-behaved function $h$ such that $ X_t = h (B_t) $ at time $t$. &lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-04-30T12:18:01.263" LastActivityDate="2016-04-30T12:18:01.263" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25601" PostTypeId="1" AcceptedAnswerId="25604" CreationDate="2016-04-24T12:45:54.573" Score="4" ViewCount="517" Body="&lt;p&gt;I know that one of the methods of solving the black scholes PDE given by :&#xA;$\frac{\partial V}{\partial t} + \frac{\sigma^2 S^2}{2}\frac{\partial^2V}{\partial S^2} + rS\frac{\partial V}{\partial S} -rV = 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is to transform it into the heat equation and then using the explicit euler FTCS scheme.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering if you could directly use the explicit euler scheme on the Black scholes PDE without using any transofrmation, just substitute the approximations of the derivatives.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In that case i realized that i have no initial condition $V(S,0)$ to start solving.&#xA;And one of  the boundary condition works for $S \rightarrow \infty$, will it work if i restrict $S=S_{max}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to solve the Black scholes PDE this way, if it is what is the initial condition and the boundary condition i should take .&lt;/p&gt;&#xA;" OwnerUserId="20451" LastActivityDate="2016-04-24T21:38:40.270" Title="Solve Black scholes PDE without using any transformation" Tags="&lt;black-scholes&gt;&lt;numerical-methods&gt;&lt;black-scholes-pde&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25602" PostTypeId="2" ParentId="25592" CreationDate="2016-04-24T12:58:44.207" Score="5" Body="&lt;p&gt;This is a very good question. It can be argued that risk parity is one example of a smart beta strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet it is important to understand that both are coming from two different directions: risk parity is basically a form of risk management (in the sense of risk-adjustment) because its basic approach lies in diversification - like the alternative methods mean-variance optimization, 1/N, minimum variance and so on. Comparing it with mean-variance it is also an answer to the estimation problem because variances are more robust than covariances and you don't have to estimate means at all (which are notoriously hard to estimate).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Smart beta strategies are more coming from an income generation perspective: You try to find the factors that contribute most and overweight them. In this case one does refer to the low volatility &lt;em&gt;factor&lt;/em&gt; (or &lt;em&gt;anomaly&lt;/em&gt; depending on your school of thought).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in this case both perspectives meet because you see something that results in a risk reduction also as an income generation vehicle and at the end the resulting portfolios could very well be the same, so as I said in the beginning risk parity can be seen as one example of a smart beta strategy.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2016-04-24T15:23:44.607" LastActivityDate="2016-04-24T15:23:44.607" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25603" PostTypeId="2" ParentId="25583" CreationDate="2016-04-24T14:16:38.523" Score="1" Body="&lt;p&gt;You're almost right, I think.  You shouldn't talk about L(Ti,Ti+1) being a martingale, since this is a RV not observed until Ti.  Rather we should talk about LtT, the regular Libor forward rate, and L'tT, the fair rate for an arrears FRA.  We have that LtT is a martingale under the ZCB(Ti+1) measure, as you say.  But also, L'tT is a martingale under the ZCB(Ti) measure.    So the situation is more symmetric than you think.    What we can say is that the convexity adjustment,  L'tT - LtT is not a martingale under either measure, and that this spread is a function of volatility.  However it is arbitrary which one of these has the volatility exposure.  The issue is decided in the end by the decision (in most models) that Z(t,T) are given, and have no volatility exposure by definition.  For example, if volatility is zero, most models say that Libor follows the regular forward rates, not the arrears ones.  But there's no reason why you couldn't write down a model where the arrears FRAs are fundamental.  Then the ZCB would have volatility exposure.  Hope that doesn't confuse things.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-04-24T14:16:38.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25604" PostTypeId="2" ParentId="25601" CreationDate="2016-04-24T14:53:34.060" Score="3" Body="&lt;p&gt;Yes it can be done. However, bear in mind that a naive explicit FD scheme is &lt;strong&gt;not unconditionally stable&lt;/strong&gt; (see CFL stability condition).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as your initial/boundary conditions issue is concerned:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Time domain]&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use &lt;em&gt;terminal condition&lt;/em&gt; $V(S,T)=h(T)$ where $h(T)$ figures the payoff of the target derivative claim at maturity $T$ (e.g. $h(T)=(S-K)^+$ for a European call option struck at $K$ expiring at $T$). This is simply an expression of the absence of arbitrage opportunity. Note that this condition can become an &lt;em&gt;initial condition&lt;/em&gt; if you change variables i.e. replace the variable $t$ (current time) by $\tau = T-t$ (remaining time to expiry).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Space domain]&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Either use claim-dependent Dirichlet conditions. For instance for a European call, $\forall t \in [0,T] $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V(S=0,t)=0$$&#xA;$$\lim_{S \rightarrow \infty} V(S,t) = P(t,T) (F(t,T)-K)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or use more general boundary conditions on the derivatives of the option price, typically like no Gamma when sufficiently OTM, $\forall t \in [0,T] $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \lim_{S\rightarrow 0}\frac {\partial^2 V}{\partial S^2} (S,t) = 0$$&#xA;$$ \lim_{S\rightarrow \infty}\frac {\partial^2 V}{\partial S^2} (S,t) = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because you will truncate the spot price domain to $[S_{min},S_{max}]$ with $0 &amp;lt; S_{min} &amp;lt; S_{max} &amp;lt; \infty$ you obviously need to be careful here: applying a boundary condition such as $V(S_{min},t)=0$ will only be a good approximation of the true boundary condition $V(S=0,t)=0$ if $S_{min}$ is sufficiently small.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-04-24T21:38:40.270" LastActivityDate="2016-04-24T21:38:40.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25605" PostTypeId="1" CreationDate="2016-04-24T15:16:14.940" Score="4" ViewCount="298" Body="&lt;p&gt;Consider a mean-reverting normal model for an underlying&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dX^{(1)}_t=-\kappa X^{(1)}_tdt+\sigma^{(1)} dW^{(1)}_t$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for fixed time-independent constants, $\kappa$ (mean-reversion) and $\sigma^{(1)}$ (volatility) and Brownian motion, $W^{(1)}_t$. Suppose that using this model, I calculate options prices for all $t$, then calibrate the time-dependent local vol, $\sigma_t^{(2)}$, of a second normal model (without mean-reversion)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dX^{(2)}_t=\sigma_t^{(2)} dW^{(2)}_t$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so that the two models give the same prices for vanilla options at all times.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Will a continuous upper barrier knock-out call option be cheaper in the first or second model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For simplicity, take $X_0=Y_0=0$, and assume that the upper barrier, $B$, is larger than the strike, $K$. &lt;/p&gt;&#xA;" OwnerUserId="20455" LastActivityDate="2017-03-23T20:33:12.600" Title="What is the effect of mean-reversion on an upper barrier knock-out call option?" Tags="&lt;modeling&gt;&lt;mean-reversion&gt;&lt;barrier&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25606" PostTypeId="1" AcceptedAnswerId="25610" CreationDate="2016-04-24T15:33:28.607" Score="2" ViewCount="407" Body="&lt;p&gt;I have came across a formula suggested by Fisher Black (&lt;em&gt;Fact and fantasy in the use of options&lt;/em&gt;, FAJ, July–August 1975, pp.36) for approximating the price of an American call written on a dividend-paying stock. See Wikipedia's article &lt;a href=&quot;https://en.wikipedia.org/wiki/Black%27s_approximation&quot; rel=&quot;nofollow noreferrer&quot;&gt;Black's approximation&lt;/a&gt; for further details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a stock with current price $S_0$, which pays a dividend $D$ at date $t_D$; both the dividend amount and the payment date are known at time $t=0$. Consider also an American call option with strike $K$ and maturity date $T$; we can write its Black-Scholes price $C_A$ as a function: $C_A = C_A(S_0,K,T)$. Let $C_E$ be the price of an European call option; then Black's approximation $C_A^{FB}$for $C_A$ is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C_A(S_0,K,T) \approx C_A^{FB}(S_0,K,T) = max[C_E(S_0-De^{-rT},K,T),C_E(S_0,K,t_D-1)]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand the financial logic behind this approximation; however what strikes me is that it is inconsistent with Black-Scholes theory. Indeed, we must have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C_E(S_0-De^{-rT},K,T)&amp;lt;C_E(S_0,K,T)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C_E(S_0,K,t_D-1)&amp;lt;C_E(S_0,K,T)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C_A^{FB}(S_0,K,T)&amp;lt;C_E(S_0,K,T)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the American call Black's approximated price would always be less than its European counterpart, whereas American options are at least as valuable as their European counterparts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anything wrong in my reasoning? Does anyone understand the logic of this approximation, given this inconsistent feature?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[EDIT]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dividends should be discounted using the factor $e^{-rt_D}$, not $e^{-rT}$.&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-03-15T11:45:39.147" LastActivityDate="2017-03-15T11:45:39.147" Title="Isn't Black's approximation for American options inconsistent?" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;american-options&gt;&lt;european-options&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25607" PostTypeId="2" ParentId="25597" CreationDate="2016-04-24T16:26:36.400" Score="2" Body="&lt;p&gt;I think this is related to traders jargon. When a dealer quotes the price of a spread between two securities (such as a risk reversal) as &quot;10 cents your choice&quot; or &quot;ten cents around&quot; it means that the bid-ask midpoint is zero and it will cost you 0.10 USD to enter a position long the first security/short the second, and also 0.10 to short the first/long the second. Obviously you have to tell the dealer which one you want to do. In the more normal situation one security is worth more than the other and then the spread might be quoted as &quot;forty twenty for the call&quot; meaning you pay 40 cents to buy the call and sell the put, or receive twenty for the reverse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By extension (and I have not heard the term before) it would seem the &quot;near choice&quot; would mean close to zero, but maybe not exactly zero. So yes, it would seem to mean that ATM puts and calls are approximately the same price.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-04-24T16:49:00.787" LastActivityDate="2016-04-24T16:49:00.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25608" PostTypeId="2" ParentId="25590" CreationDate="2016-04-24T17:46:18.913" Score="0" Body="&lt;p&gt;The best option would be to bootstrap a curve. But lacking shorter interest rates, this doesn't appear to be possible. Linear interpolation is the next best alternative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the BUBOR rates are all annualized, and so long as you're using the portion of the year for the given leg's day count convention, using the given rate (in this case the bootstrapped rate) should be fine.&lt;/p&gt;&#xA;" OwnerUserId="20447" LastActivityDate="2016-04-24T17:46:18.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25609" PostTypeId="2" ParentId="25592" CreationDate="2016-04-24T20:26:44.420" Score="1" Body="&lt;p&gt;Smart Beta refers a trend in making well known quantitative strategies more accessible to investors. Simple examples for equities include Value, Momentum, Quality, and Low Volatility. Fixed income might include Carry and Credit. Risk parity is a strategy that incorporates several sources of return that may include some of the smart beta strategies mentioned above. I'd consider risk parity less accessible to the broad investor in particular the retail investor. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Short answer for me is &quot;no&quot;. &lt;/p&gt;&#xA;" OwnerUserId="20388" LastActivityDate="2016-04-24T20:26:44.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25610" PostTypeId="2" ParentId="25606" CreationDate="2016-04-24T20:37:03.177" Score="4" Body="&lt;p&gt;There is a logical fallacy in your argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The price of a European call expiring 1 day before a dividend payment may well be greater than that of a call expiring after it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, claiming that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ C_E (S_0,K,t_D-1\text {day}; D, t_D) &amp;lt; C_E (S_0,K,T; D, t_D) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is not necessarily true.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try the above inequality with a huge dividend (e.g. $D = 90\%$ of the current spot price $S_0$) paid at $t_D$ with $T = t_D + 1\text {day} $ to convince yourself.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Edit]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $BS(S_0,K,T)$ denote the standard Black-Scholes formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the value of an American call with one discrete dividend is given by the Black approximation you refer to:&#xA;$$C_A^{FB}(S_0,K,T;D,t_D) = \max(BS(S_0-De^{-rt_D},K,T), BS(S_0,K,t_D-1/252))$$&#xA;then you should compare it to the value of the European call with 1 discrete dividend which is usually given by:&#xA;$$C_E(S_0,K,T;D,t_D) = BS(S_0-De^{-rt_D}, K, T)$$&#xA;(escrowed model assumed) and not simply $C_E(S_0,K,T)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your problem is thus twofold: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;you should use $De^{-r t_D}$ and not $De^{-rT}$ for the present value of the capital distribution&lt;/li&gt;&#xA;&lt;li&gt;you are always using $C_E(S_0,K,T)$ as a reference (no dividend accounted for), while you should really use $C_E(S_0,K,T;D,t_D)$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Using the above notations, it is clear that $C_A^{FB}(S_0,K,T;D,t_D)$ will always be greater than $C_E(S_0,K,T;D,t_D)$, because &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;C_A^{FB}(S_0,K,T;D,t_D) &amp;amp;= \max( C_E(S_0,K,T;D,t_D), BS(S_0,K,t_D-1/252) ) \\&#xA;&amp;amp;\geq  C_E(S_0,K,T;D, t_D)&#xA;\end{align}&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-04-25T11:23:04.740" LastActivityDate="2016-04-25T11:23:04.740" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25611" PostTypeId="2" ParentId="25549" CreationDate="2016-04-24T21:31:46.603" Score="1" Body="&lt;p&gt;Read Max Dama on Automated trading (PDF) - This is the best introduction to algorithmic trading out there:&#xA;&lt;a href=&quot;http://www.decal.org/download/2582&quot; rel=&quot;nofollow&quot;&gt;http://www.decal.org/download/2582&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20458" LastActivityDate="2016-04-24T21:31:46.603" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25616" PostTypeId="1" AcceptedAnswerId="28356" CreationDate="2016-04-25T00:28:32.980" Score="3" ViewCount="2144" Body="&lt;p&gt;You own a fixed rate corporate bond in foreign currency (let's say JPY). Your domestic currency is USD. Which of the these two approaches do you consider theoretically better?&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Discount JPY cash flows using a yield comprised of a) JPY risk free rate + b) CDS spread for corresponding WAL of the security. Convert JPY NPV to USD using spot.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Convert JPY cash flows into USD using USDJPY fx forward rates. Discount using a USD yield for corresponding WAL and rating.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Each approach comes with a different value. Significantly enough that they cannot be considered equivalent. I believe the approach 1. is more sound. What are your thoughts? Any literature out there?&lt;/p&gt;&#xA;" OwnerUserId="2685" LastActivityDate="2016-09-02T09:43:34.473" Title="Pricing foreign currency bonds - which approach is more theoretically &quot;sound&quot;?" Tags="&lt;fixed-income&gt;&lt;fx&gt;&lt;bond&gt;&lt;valuation&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25617" PostTypeId="2" ParentId="25616" CreationDate="2016-04-25T01:04:58.320" Score="0" Body="&lt;p&gt;I think you have to remember that the value is where it's trading.  I know that might not be as deep as what you are looking for.  But when you start to get into CDS you are getting into what the right spread is.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can trade forwards on every point on the curve with JPYUSD, so you can compare it pretty easily to a similar USD denominated bond.  So I guess #2 is more accurate.  Also, the forwards will essentially lock in the respective USD and JPY rates.  That's something that is otherwise difficult to achieve.&lt;/p&gt;&#xA;" OwnerUserId="20092" LastActivityDate="2016-04-25T01:04:58.320" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25618" PostTypeId="1" AcceptedAnswerId="25630" CreationDate="2016-04-25T01:48:38.793" Score="2" ViewCount="882" Body="&lt;p&gt;Why can a swap option be regarded as a type of bond option? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My idea: Suppose the swap rate of the swaption is $s$. Now consider a bond option expiring at $T$ with strike, $(P_K)_t = \dfrac{1}{1+s(T-t)}$. The bond payoff is given by $(P(fl)-P_K)_+$ and the swaption payoff is given as $(fl-s)_+$. There is clearly a relationship between these two payoffs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone provide a mathematical proof of the result? &lt;/p&gt;&#xA;" OwnerUserId="20156" LastActivityDate="2016-04-25T18:39:12.170" Title="Why can a swap option be regarded as a type of Bond option?" Tags="&lt;options&gt;&lt;bond&gt;&lt;interest-rate-swap&gt;&lt;forward-rate&gt;&lt;swaption&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25619" PostTypeId="1" AcceptedAnswerId="25627" CreationDate="2016-04-25T02:58:07.057" Score="4" ViewCount="3830" Body="&lt;p&gt;in CAPM. What's the difference between these different types of returns?  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Active return&lt;/li&gt;&#xA;&lt;li&gt;Excess return&lt;/li&gt;&#xA;&lt;li&gt;Residual return&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="6149" LastActivityDate="2016-04-25T13:24:18.533" Title="Excess, Residual and Active Return" Tags="&lt;capm&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25621" PostTypeId="1" AcceptedAnswerId="25624" CreationDate="2016-04-25T04:13:37.777" Score="1" ViewCount="463" Body="&lt;p&gt;You purchase a bond today for $980; M=$1000, the coupon rate is 4% paid semi-annually, and there are n=7 years to maturity.  If you sell the bond for $1025 in six months time, what is your rate of return?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would I be correct in saying that the rate of return is 1,025 of the sale, plus the 20 dollar coupon divided by the initial sale?&lt;/p&gt;&#xA;" OwnerUserId="17787" LastEditorUserId="17787" LastEditDate="2016-04-25T12:55:39.920" LastActivityDate="2016-04-25T12:55:39.920" Title="Finding rate of return of bond sold before maturity" Tags="&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25622" PostTypeId="2" ParentId="25549" CreationDate="2016-04-25T06:33:12.947" Score="2" Body="&lt;p&gt;This may not directly answer your questions. There's a class offered by Georgia Tech called Machine Learning for Trading, you might find it useful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.udacity.com/course/machine-learning-for-trading--ud501&quot; rel=&quot;nofollow&quot;&gt;https://www.udacity.com/course/machine-learning-for-trading--ud501&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20161" LastActivityDate="2016-04-25T06:33:12.947" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25623" PostTypeId="2" ParentId="25549" CreationDate="2016-04-25T08:04:26.010" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Another example might be, if companies that exhibit certain revenue growth metrics, or margin improvement, would that signal a potential buy opportunity? Or perhaps if certain words in their annual report, quarterly filings, press releases indicate this company is likely to do well?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The keys to quantitative investment are &lt;em&gt;research&lt;/em&gt; and &lt;em&gt;data analysis&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, say you have an idea that companies exhibiting revenue growth will outperform in the future. How do you test that idea? How do you measure the size of the effect (for example, is it large enough to return a profit after trading costs are taken into account?) What are the timescales over which the effect is relevant? How do you ensure that you are measuring a real effect, and not &quot;curve fitting&quot; or &quot;data mining&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking a step back, how do you ensure that your revenue growth data is timely and accurate? How are you measuring outperformance - versus the market as a whole? Versus a sector? Versus a basket of related stocks? Is the effect consistent across sectors, or across countries? Does it hold for both large caps and small caps?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking a step forward - once you have identified an effect that you believe in, how do you exploit it? What stocks should you hold in your portfolio, and what residual risks will that expose you to? Are those risks large enough that you should give up some alpha to hedge them? How does the effect interact with other anomalies you have identified?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quantitative investment firms are not doing anything magical. They are probably looking at a lot of the same data that fundamental investors are looking at (although they have a preference for data that is easy to consume by machines). Indeed, the approach to investment that you said you follow -&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Modeling a company's financials, forecasting the cashflows and discounting them back at a discount rate to get the valuation&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;is essentially a &lt;em&gt;quantitative&lt;/em&gt; process. The biggest differences between this and a quantitative investor are&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;A quant investor consumer a greater range of data, and more of it.&lt;/li&gt;&#xA;&lt;li&gt;A quant investor might have an explicit model of the market in mind (described in the language of probability)&lt;/li&gt;&#xA;&lt;li&gt;A quant investor is more &lt;em&gt;systematic&lt;/em&gt;, i.e. they try to remove discretion from their investment decisions.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;As I said in a comment, I think you have asked a very unfocused question, and as such you will get unfocused answers (like this one). You would do much better to ask a series of shorter, more focused questions if you are really interested in learning more about this area.&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2016-04-25T08:04:26.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25624" PostTypeId="2" ParentId="25621" CreationDate="2016-04-25T08:12:34.133" Score="1" Body="&lt;p&gt;Your approach is correct, but I would check the size of the coupon if I were you.&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2016-04-25T08:12:34.133" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25627" PostTypeId="2" ParentId="25619" CreationDate="2016-04-25T13:14:36.663" Score="9" Body="&lt;p&gt;Active return: $R-R_m$ i.e. your security (or portfolio) compared to the market portfolio.  Used to judge performance before the CAPM was invented&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Excess return: $R-R_f$ the security compared to the risk free rate, appears on the left hand side of the CAPM equation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Excess return on the market: $R_m-R_f$, appears on the right hand side&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In words the CAPM says that &quot;there is a linear relationship between the excess return and the excess return on the market&quot; $R-R_f=\beta(R_m-R_f)+\epsilon_i$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Residual return: $R-R_f-\beta(R_m-R_f)$ i.e. the part of your return which the CAPM does not explain, or your outperformance versus the CAPM; its estimated value over a period of time is called Alpha. This is what is advocated to measure performance under the CAPM.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-04-25T13:24:18.533" LastActivityDate="2016-04-25T13:24:18.533" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25628" PostTypeId="2" ParentId="25591" CreationDate="2016-04-25T15:35:05.737" Score="2" Body="&lt;p&gt;For this type of question, you basically need only to write the payoff with certain indicator functions. In particular, for the above payoff, we have that&#xA;\begin{align*}&#xA;\textrm{Payoff} &amp;amp;= K\, 1_{S_T \le K} + (2K-S_T)\,1_{K &amp;lt; S_T \le 2K}\\&#xA;&amp;amp;=K\, 1_{S_T \le K} + (2K-S_T)\big(1_{S_T \le 2K} - 1_{S_T \le K} \big)\\&#xA;&amp;amp;=(2K-S_T)\,1_{S_T \le 2K} - (K-S_T)1_{S_T \le K}\\&#xA;&amp;amp;=(2K-S_T)^+ - (K-S_T)^+.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-04-25T16:02:38.817" LastActivityDate="2016-04-25T16:02:38.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25629" PostTypeId="2" ParentId="25534" CreationDate="2016-04-25T16:00:35.257" Score="2" Body="&lt;p&gt;Let &#xA;\begin{align*}&#xA;C(S, K, t) = SN(d_1) - e^{-rt}KN(d_2)&#xA;\end{align*}&#xA;denote the Black-Scholes call option price with initial asset value $S$, strike $K$, and maturity $t$. Note that&#xA;\begin{align*}&#xA;\frac{\partial C}{\partial S} = N(d_1).&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the above barrier option, note that&#xA;\begin{align*}&#xA;E_0 &amp;amp;= V_0 N(d_1)-e^{-rt}KN(d_2) -\bigg[V_0 \Big(\frac{K}{V_0}\Big)^{2\lambda}N(d_1^B) -e^{-rt}K \Big(\frac{K}{V_0}\Big)^{2\lambda-2} N(d_2^B) \Big) \bigg]\\&#xA;&amp;amp;=C(V_0, K, t) - \Big(\frac{K}{V_0}\Big)^{2\lambda-2}\bigg[\frac{K^2}{V_0}N(d_1^B) -e^{-rt}K N(d_2^B) \Big) \bigg]\\&#xA;&amp;amp;=C(V_0, K, t) - \Big(\frac{K}{V_0}\Big)^{2\lambda-2} C\Big(\frac{K^2}{V_0}, K, t \Big).&#xA;\end{align*}&#xA;Therefore,&#xA;\begin{align*}&#xA;\frac{\partial E_0}{\partial V_0} &amp;amp;=N(d_1) + (2\lambda-2)\frac{K^{2\lambda-2}}{V_0^{2\lambda-1}}C\Big(\frac{K^2}{V_0}, K, t \Big)-\Big(\frac{K}{V_0}\Big)^{2\lambda-2}\frac{\partial C\Big(\frac{K^2}{V_0}, K, t \Big)}{\partial V_0}\\&#xA;&amp;amp;=N(d_1) + (2\lambda-2)\frac{K^{2\lambda-2}}{V_0^{2\lambda-1}}C\Big(\frac{K^2}{V_0}, K, t \Big)+\Big(\frac{K}{V_0}\Big)^{2\lambda}N(d_1^B),&#xA;\end{align*}&#xA;since&#xA;\begin{align*}&#xA;\frac{\partial C\Big(\frac{K^2}{V_0}, K, t \Big)}{\partial V_0} &amp;amp;= \frac{\partial C\Big(\frac{K^2}{V_0}, K, t \Big)}{\partial \frac{K^2}{V_0}}\frac{\partial \frac{K^2}{V_0}}{\partial V_0}\\&#xA;&amp;amp;=-\Big(\frac{K}{V_0}\Big)^{2}N(d_1^B).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-04-25T16:00:35.257" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25630" PostTypeId="2" ParentId="25618" CreationDate="2016-04-25T17:00:04.653" Score="3" Body="&lt;p&gt;Consider a payer swaption with maturity $T_0$ and strike $K$. Here the strike $K$ is the fixed rate paid on the fixed leg of the underlying fixed-for-floating swap with reset dates $T_0, \ldots, T_{n-1}$ and payment dates&#xA;$T_1, \ldots, T_n$, where $0&amp;lt;T_0 &amp;lt; \cdots &amp;lt; T_n$. We assume that the swap exchanges the payments $L(T_{i-1}; T_{i-1}, T_i)\Delta T_i$ and $K\Delta T_i$, where $\Delta T_i =  T_i -T_{i-1}$, and&#xA;\begin{align*}&#xA;L(t; T_{i-1}, T_i) = \frac{1}{\Delta T_i}\bigg(\frac{P(t, T_{i-1})}{P(t, T_i)}-1 \bigg),&#xA;\end{align*}&#xA;for $i=1, \ldots, n$, is a forward Libor rate. Here, $P(t, u)$ is the price at time $t$ of a zero-coupon bond with maturity $u$ and unit face value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value of the swap at time $t$, where $0 \leq t \le T_0$, is given by&#xA;\begin{align*}&#xA;&amp;amp; \ \sum_{i=1}^n \frac{1}{\Delta T_i}\bigg(\frac{P(t, T_{i-1})}{P(t, T_i)}-1 \bigg) \times \Delta T_i \times P(t, T_i) - K \sum_{i=1}^n P(t, T_i) \times \Delta T_i \\&#xA;= &amp;amp; \ P(t, T_0)-P(t, T_n) - K \sum_{i=1}^n P(t, T_i)  \Delta T_i\\&#xA;= &amp;amp; \  P(t, T_0)- \bigg(\sum_{i=1}^{n-1}K \Delta T_i P(t, T_i) + \big( 1+ K \Delta T_n\big) P(t, T_n) \bigg).&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The swaption payoff at maturity $T_0$ is given by&#xA;\begin{align*}&#xA;&amp;amp; \ \Bigg[\sum_{i=1}^n \frac{1}{\Delta T_i}\bigg(\frac{P(T, T_{i-1})}{P(T, T_i)}-1 \bigg) \times \Delta T_i \times P(T, T_i) - K \sum_{i=1}^n P(T, T_i) \times \Delta T_i\Bigg]^+ \\&#xA;= &amp;amp; \ \Bigg[1- \bigg(\sum_{i=1}^{n-1}K \Delta T_i P(T_0, T_i) + \big( 1+ K \Delta T_n\big) P(T_0, T_n) \bigg)\Bigg]^+.&#xA;\end{align*}&#xA;That is, the swaption payoff is the payoff of a bond option that has a coupon rate the same as the swap fixed rate, while the bond option strike is 1.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-04-25T18:39:12.170" LastActivityDate="2016-04-25T18:39:12.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25631" PostTypeId="1" CreationDate="2016-04-25T17:36:47.400" Score="0" ViewCount="223" Body="&lt;p&gt;How to measure an event driven investment strategy?&lt;br&gt;&#xA;Say I have a strategy which I assume that if a firm has positive momentum and it has a refinance corporate action, it's value will increase.&lt;br&gt;&#xA;For strategies like this? How do I measure it?  &lt;/p&gt;&#xA;" OwnerUserId="19188" LastActivityDate="2016-04-25T22:58:22.493" Title="how to measure a event driven strategy?" Tags="&lt;strategy&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25632" PostTypeId="2" ParentId="25582" CreationDate="2016-04-25T18:13:28.243" Score="2" Body="&lt;p&gt;He meant to compute the swaption price given by (2.4a), that is,&#xA;\begin{align*}&#xA;V_{opt} = L_0 E\left((R_s(\tau)-R_{fix})^+ \mid \mathcal{F}_0 \right).&#xA;\end{align*}&#xA;Under the swap measure (i.e., with $L_t$ as the numeraire), the swap rate process $\{R_s(t), t \ge 0\}$ is a martingale, and is assumed to be of the form&#xA;\begin{align*}&#xA;R_s(\tau) = R_s^0 e^{\sigma X \sqrt{\tau} -\frac{1}{2}\sigma^2\tau },&#xA;\end{align*}&#xA;where $X$ is a standard normal random variable. Then&#xA;\begin{align*}&#xA;V_{opt} &amp;amp;= L_0\int_{-\infty}^{\infty}\left(R_s^0 e^{\sigma x \sqrt{\tau} -\frac{1}{2}\sigma^2\tau }-R_{fix} \right)^+ \frac{1}{\sqrt{2\pi}}e^{-\frac{x^2}{2}}dx\\&#xA;&amp;amp;=L_0\big[R_s^0 N(d_1) - R_{fix} N(d_2) \big],&#xA;\end{align*}&#xA;where &#xA;\begin{align*}&#xA;d_1 = \frac{\ln \frac{R_s^0}{R_{fix}}+\frac{1}{2}\sigma^2 \tau}{\sigma \sqrt{\tau}},&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;d_2 = d_1 -\sigma \sqrt{\tau}.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-04-25T18:13:28.243" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25633" PostTypeId="2" ParentId="25605" CreationDate="2016-04-25T18:20:03.893" Score="0" Body="&lt;h2&gt;First this is not a full answer, but it might help you.&lt;/h2&gt;&#xA;&lt;p&gt;You probably hit &lt;span class=&quot;math-container&quot;&gt;$B$&lt;/span&gt; quickly with &lt;span class=&quot;math-container&quot;&gt;$(1)$&lt;/span&gt; than with &lt;span class=&quot;math-container&quot;&gt;$(2)$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;h2&gt;Hint of previous assertion&lt;/h2&gt;&#xA;&lt;p&gt;I might reformulate your question.&lt;/p&gt;&#xA;&lt;p&gt;I suppose your pricing condition is &lt;span class=&quot;math-container&quot;&gt;$$\left\langle X^{(2)}\right\rangle_t=\left\langle X^{(1)}\right\rangle_t $$&lt;/span&gt; so you get :&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$X^{(1)}_t = \int_0^t\sigma^{(1)}e^{-\kappa(t-u)}dW^{(1)}_u$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$X^{(2)}_t = \int_0^t\sigma^{(1)}e^{-\kappa u} dW^{(2)}_u$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;You want then to study if there exists order between &lt;span class=&quot;math-container&quot;&gt;$\tau^1_B$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$\tau^2_B$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\tau^i_B=\inf\left\{t\geq 0:X^{(i)}_t\geq B\right\}$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Setting &lt;span class=&quot;math-container&quot;&gt;$V(t)=\left\langle X^{(2)}\right\rangle_t=\left\langle X^{(1)}\right\rangle_t$&lt;/span&gt;&#xA;and&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ Y^i_t(\lambda) = e^{\lambda X^i_t -\frac{\lambda^2}{2}V(t)}$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;you get (prove it (I think I have the proof but I am not sure) ) for &lt;span class=&quot;math-container&quot;&gt;$\lambda\geq 0$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\mathbb{E}[Y^2_t(\lambda)|Y^2_s(\lambda)]=Y^2_s(\lambda)$$&lt;/span&gt;&#xA;where as&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\mathbb{E}[Y^1_t(\lambda)|Y^1_s(\lambda)]\geq Y^1_s(\lambda)$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;so you get :&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\mathbb{E}[e^{-\frac{\lambda^2}{2}V(\tau^2_B)}]\leq \mathbb{E}[e^{-\frac{\lambda^2}{2}V(\tau^1_B)}]$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;which invalidates &lt;span class=&quot;math-container&quot;&gt;$\tau^2_B&amp;gt;\tau^1_B$&lt;/span&gt; a.s since &lt;span class=&quot;math-container&quot;&gt;$V$&lt;/span&gt; is increasing.&lt;/p&gt;&#xA;&lt;p&gt;I know this is not a proof of first assertion but I hope it can help you.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-04-25T18:20:03.893" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25634" PostTypeId="1" AcceptedAnswerId="25636" CreationDate="2016-04-25T18:45:53.917" Score="1" ViewCount="366" Body="&lt;p&gt;prove the condition $D&amp;lt;R&amp;lt;U$ is equivalent to the absence of arbitrage: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;R = risk free investment rate of return. U and D are returns corresponding to the upward/downward price movements of a risky security. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The basic idea of arbitrage is to buy low, sell high with no risk or initial investment&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So Assume R &gt;= U or R&amp;lt;=D (contrapositive)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At time 0 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) We short the security with price S (get +S)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) We invest the security into the risk free investment (-S)&#xA;Balance at time 0 = 0 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;At time 1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) We get our risk free investment back (+S(1+R))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) We buy back one share of the stock. &#xA;There are two scenarios&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) Stock price goes up: (-S(1+U))&#xA;Profit = S(1+R)-S(1+U) &gt;= 0 because R&gt;=U (profit is always non negative, there is arbitrage)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) Stock price goes down: (-S(1+D))&#xA;Profit = S(1+R)-S(1+D) &amp;lt;= 0 because R&amp;lt;=D (from assumption), but this shows profit can be negative here-there is no sure risk free profit arbitrage! &#xA;so i'm stuck here. &lt;/p&gt;&#xA;" OwnerUserId="17063" LastActivityDate="2016-04-25T22:26:26.747" Title="arbitrage proof question" Tags="&lt;arbitrage&gt;&lt;no-arbitrage-theory&gt;&lt;proof&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25636" PostTypeId="2" ParentId="25634" CreationDate="2016-04-25T22:01:58.913" Score="1" Body="&lt;p&gt;You're half way there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When $ R &amp;lt; D \  (&amp;lt; U) $, the return of the stock dominates the risk-free return in all states of the world. To benefit from that, just borrow cash and invest in the stock. At $t=0$ this requires no net investment: borrowing cash means your account is credited $S_0$, while subsequently buying the stock suggests it is debited $S_0$. At the end of a period you &lt;strong&gt;owe&lt;/strong&gt; the bank interests on the cash which has been lent to you $S_0 (1+R) $ but being long stock you &lt;strong&gt;have&lt;/strong&gt; a position now worth $S_0 (1+D) $ or $S_0(1+U) $ if you were to sell which is always more than the interests owed, hence positive profit in all states of the world, hence free lunch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When $ (D &amp;lt;) \  U &amp;lt; R $ the risk-free return dominates the stock return in all states of the world. To benefit from that, just short sell the stock and invest in the risk-free money market account. At $t=0$ this requires no net investment (just deposit the proceeds of the short sell on the risk-free account). At the end of the period you &lt;strong&gt;receive&lt;/strong&gt; interests $S_0 (1+R) $ while being short stock &lt;strong&gt;costs&lt;/strong&gt; you $S_0 (1+D) $ or $S_0(1+U) $ (since you sold without possessing the stock before hand, you need to buy to it before you can give it to your counterpaty) which is always less that what you earned, hence positive profit in all states of the world, hence free lunch.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-04-25T22:26:26.747" LastActivityDate="2016-04-25T22:26:26.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25637" PostTypeId="2" ParentId="25631" CreationDate="2016-04-25T22:58:22.493" Score="2" Body="&lt;p&gt;I would do regression analysis with a dummy variable. Take a large sample of companies, and add a 0 - 1 dummy variable where that variable is equal to 1 if it meets the momentum and refi criteria, and 0 otherwise.  The coefficient will indicate the magnitude and the t-statistic the significance.    &lt;/p&gt;&#xA;" OwnerUserId="19627" LastActivityDate="2016-04-25T22:58:22.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25638" PostTypeId="1" AcceptedAnswerId="25646" CreationDate="2016-04-25T23:14:15.333" Score="1" ViewCount="237" Body="&lt;p&gt;Having two Ito processes&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dX_{t} =z_{1} dt + Y_{t} dB_t $ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dX^{'}_{t} =z^{'}_{1} dt + Y^{'}_{t} dB_t $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;br&gt;&#xA;I am analyzing a proof of the product rule &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d(X_t X_t^{'})=X_t dX_t^{'}+ X_t^{'} dX_t + Y_t Y_t^{'}dt$ &#xA;&lt;br&gt;&#xA;&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the equation &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$df(X_t)= \frac{\partial f}{\partial X_t}  \partial  X_t + \frac{1}{2} \frac{\partial^2 f}{\partial X_t^2} (dX_t)^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(dX_t)^2$  was replaced with $Y_t^2 dt$. I don't quite follow this transition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This property was used later in the proof as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d(X_{t} + X^{'}_{t})^2 = (Y_t + Y^{'}_{t})^2 dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Could anybody clarify me the substitution of $(dX_t)^2$  with $Y_t^2 dt$&lt;/strong&gt;?&lt;/p&gt;&#xA;" OwnerUserId="18670" LastEditorUserId="19887" LastEditDate="2016-04-27T11:57:38.333" LastActivityDate="2016-04-27T11:57:38.333" Title="2 Ito processes - $d(X_{t} + X^{'}_{t})^2 = (Y_t + Y^{'}_{t})^2 dt$ why it is true?" Tags="&lt;stochastic-processes&gt;&lt;brownian-motion&gt;&lt;stochastic-volatility&gt;&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25640" PostTypeId="1" AcceptedAnswerId="25642" CreationDate="2016-04-26T02:20:41.027" Score="3" ViewCount="975" Body="&lt;p&gt;Having two correlated Ito processes&#xA;($W_t^1$ and $W_t^2$ are correlated Brownian motions with correlation $\rho$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dX_{t} =\mu_{1} dt + \sigma_1  dWt_1 $ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dY_{t} = \mu_{2} dt + \sigma_2 dWt_2 $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can the below be proven algebraically ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sqrt{\sigma_1^2 + \sigma_2^2 +2 \sigma_1 \sigma_2 \rho} \ \ dW_t = \sigma_1 dW_t^1 + \sigma_2 dW_t^2$&lt;/p&gt;&#xA;" OwnerUserId="18670" LastEditorUserId="19887" LastEditDate="2016-04-26T07:45:08.767" LastActivityDate="2016-04-26T12:32:18.067" Title="How to express the volatility of two correlated Ito processes $Wt_1, Wt_2$ expressed in terms of $W_t$?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25641" PostTypeId="1" CreationDate="2016-04-26T04:52:31.630" Score="1" ViewCount="271" Body="&lt;p&gt;I'm working with the following information trying to work through a valuation exercise and I'm absolutely stuck. How can I find ∆WC and CAPX with this information?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/peS9L.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/peS9L.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20482" LastActivityDate="2019-12-11T15:02:35.367" Title="How can you find change in working capital and capital expenditures without a balance sheet?" Tags="&lt;valuation&gt;&lt;dcf&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25642" PostTypeId="2" ParentId="25640" CreationDate="2016-04-26T07:10:36.290" Score="5" Body="&lt;p&gt;What can be shown is that the above expressions are equal in probability.&#xA;First check the distribution. As any linear combination of a Gaussian is Gaussian the right hand side is Gaussian - the left hand side too. Then we need the 2 moments:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The expected values - it is zero ... easy to see.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next what you did not specify is that the correlation between $dW_t^1$ and $dW_t^2$ is $\rho$ then the variance can be calculated by&#xA;$$&#xA;VAR[\sigma_1dW_t^1+\sigma_2dW_t^2] = \sigma_1^2 VAR[dW_t^1] + 2 \sigma_1 \sigma_2 Covar[dW_t^1,dW_t^2] + \sigma_2^2 VAR[dW_t^2]&#xA;$$&#xA;which equals&#xA;$$&#xA;\sigma_1^2 dt + 2 \sigma_1 \sigma_2 \rho dt + \sigma_2^2 dt.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand the variance of the lhs:&#xA;$$&#xA;VAR[\sqrt{\sigma_1^2 + 2 \sigma_1 \sigma_2 \rho+ \sigma_2^2} dW_t] = (\sigma_1^2 + 2 \sigma_1 \sigma_2 \rho+ \sigma_2^2) VAR[dW_t]&#xA;$$&#xA;and this is &#xA;$$&#xA;(\sigma_1^2  + 2 \sigma_1 \sigma_2 \rho  + \sigma_2^2) dt,&#xA;$$&#xA;exactly what we needed.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2016-04-26T12:32:18.067" LastActivityDate="2016-04-26T12:32:18.067" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="25643" PostTypeId="1" CreationDate="2016-04-26T07:21:24.570" Score="5" ViewCount="1370" Body="&lt;p&gt;I am trying to perform stress testing for VaR and have taken into consideration two methods:-&#xA;1. Sensitivity analysis&#xA;2. Historical scenario analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to the Derivatives Policy group we need to take into consideration 5 factors which are:-&#xA;o Parallel yield curve in ±100 basis points.&#xA;o Yield curve shifts of ±25 basis points.&#xA;o Stock index changes of ±10%.&#xA;o Currency changes of ±6%.&#xA;o Volatility changes of ±20%. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I am trying to perform the stress testing through sensitivity analysis in excel for which I am not able to figure out how to mould the prices for equities,bonds and derivatives by taking into account above factors through the excel function data table. For instance, if I take into account the 3rd factor mentioned above as STOCK INDEX CHANGES OF +- 10% and one of my stock in my portfolio is listed in Dow Jones, so how can I adjust the prices for a particular time period (say 6 months).?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;2.Secondly if I take historical scenario analysis in which I am taking the scenario for instance 1997 Asian crisis, how do I adjust the prices in this scenario also. In this case, for instance, my portfolio contains all the asset class which are issued in the last 10 years and therefore I dont have any data (prices etc.) for them related to the 1997 asian crisis. SO how do I adjust the prices in this case also?.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S :-I am using variance covariance method for calculating VaR.&#xA;Eagerly waiting for valuable suggestions on this.&lt;/p&gt;&#xA;" OwnerUserId="18663" LastActivityDate="2021-05-04T06:06:25.907" Title="Stress Testing for VaR" Tags="&lt;stress-testing&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25645" PostTypeId="1" AcceptedAnswerId="25655" CreationDate="2016-04-26T12:29:44.987" Score="1" ViewCount="65" Body="&lt;p&gt;In his &lt;em&gt;An Elementary Introduction to Mathematical Finance, 3rd Edition&lt;/em&gt; &lt;a href=&quot;http://www.bib.convdocs.org/v28553/?download=1&quot; rel=&quot;nofollow&quot;&gt;book&lt;/a&gt;, pg. 55, Sheldon Ross has a question - &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A company needs a certain type of machine for the next five years.&#xA;  They presently own such a machine, which is now worth 6,000 (dollars)&#xA;  but will lose 2,000 in value in each of the next three years, after&#xA;  which it will be worthless and unuseable. The (beginning-of-the-year)&#xA;  value of its yearly operating cost is 9,000, with this amount expected&#xA;  to increase by 2,000 in each subsequent year that it is used. A new&#xA;  machine can be purchased at the beginning of any year for a fixed cost&#xA;  of 22,000. The lifetime of a new machine is six years, and its value&#xA;  decreases by 3,000 in each of its first two years of use and then by&#xA;  4,000 in each following year. The operating cost of a new machine is&#xA;  6,000, plus an additional 1,000 every following year.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;He does Present Value Analysis on cash flows for alternate scenarios, that is, whether a new machine is bought at year 1, 2, 3.. His cash flow for year 1 purchase seems incorrect though. The flow is (in 1000 dollars)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;22, 7, 8, 9, 10, −4&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It says 22 for year 1 purchase of the new machine - but if the company is buying in the beginning of year 1, shouldn't they pay 22K + 6K = 28K, that is, including the operating costs? The year 2 above shows 7K for operating expense, which looks correct. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="616" LastEditorUserId="19887" LastEditDate="2016-04-26T21:04:16.867" LastActivityDate="2016-04-26T21:41:38.390" Title="Cash Flow for Operating Cost, Sheldon Ross Question" Tags="&lt;present-value&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25646" PostTypeId="2" ParentId="25638" CreationDate="2016-04-26T12:54:46.863" Score="8" Body="&lt;p&gt;$X_t$ being a stochastic process, one &lt;strong&gt;cannot&lt;/strong&gt; use ordinary calculus to express the differential of a (sufficiently well-behaved) function $f$ of $t$ and $X_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead one should turn to &lt;strong&gt;Itô's lemma&lt;/strong&gt;, one of the key results of &lt;strong&gt;stochastic calculus&lt;/strong&gt;, which stipulates (assuming $X_t$ is here a continuous, square integrable stochastic process)&#xA;$$ df(t,X_t) = \frac{\partial f}{\partial t}(t,X_t) dt + \frac{\partial f}{\partial x}(t,X_t) dX_t + \frac{\partial^2 f}{\partial x^2}(t,X_t) d \langle X,X\rangle_t $$&#xA;where the quantity&#xA;$$ \langle X,X \rangle_t $$ &#xA;represents the &lt;strong&gt;quadratic variation&lt;/strong&gt; of the process $X_t$ over $[0,t]$ defined as&#xA;$$ \langle X,X\rangle_t := \lim_{\Vert P \Vert \rightarrow 0} \sum_{i=1}^N (X_{t_{i}}-X_{t_{i-1}})^2 $$&#xA;with $P$ representing a generic partition $\{t_0 = 0 &amp;lt; \dots &amp;lt; t_N = t\}$ of the interval $[0,t]$ and $\lim_{\Vert P \Vert \rightarrow 0}$ suggests the limit (when it exists) is taken in probability as $\max(\{t_{i}-t_{i-1} \vert i=1,\dots,N\}) \rightarrow 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Itô processes, that is, stochastic processes of the form&#xA;$$X_t = X_{0} + \int_0^t \mu(t,X_t) dt + \int_0^t \sigma(t,X_t) dW_t$$&#xA;or equivalently in differential form (this is an abusive notation, essentially used for convenience)&#xA;$$dX_t = \mu(t,X_t) dt + \sigma(t,X_t) dW_t$$&#xA;where $X_t$, $\mu(...)$ and $\sigma(...)$ are adapted (generally to the natural filtration of $W_t$) and the integrands verify the usual integrability conditions, it can be demonstrated (cf. any good stochastic calculus book) that:&#xA;$$ \langle X,X \rangle_t = \int_0^t \sigma^2(t,X_t) dt $$&#xA;or in differential form (this is an abusive notation, essentially used for convenience)&#xA;$$ d\langle X,X \rangle_t = \sigma^2(t,X_t) dt $$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In your case, because $X_t$ is the unique solution of the SDE &#xA;$$ dX_t = z_1 dt + Y_t dW_t $$&#xA;applying the above result with $\mu(t,X_t) = z_1$ and $\sigma(t,X_t) = Y_t$&#xA;$$ d\langle X,X \rangle_t = Y_t^2 dt $$&#xA;assuming the usual conditions are met. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as the second issue is concerned, as @Gordon mentioned, using the &lt;strong&gt;commutativity + bilinearity of quadratic variations&lt;/strong&gt;:&#xA;\begin{align}&#xA;d\langle X + X^{'}  , X + X^{'} \rangle_t  &amp;amp;= d \langle X, X \rangle_t + 2 d \langle X, X^{'}  \rangle_t + d \langle X^{'} , X^{'}  \rangle_t \\&#xA; &amp;amp;= Y_t^2 dt + 2 Y_t Y_t^{'} dt + (Y_t^{'} )^2 dt \\&#xA; &amp;amp;= (Y_t + Y_t^{'})^2 dt&#xA;\end{align}&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-04-27T10:39:53.437" LastActivityDate="2016-04-27T10:39:53.437" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25647" PostTypeId="1" CreationDate="2016-04-26T13:06:06.843" Score="2" ViewCount="267" Body="&lt;p&gt;I have a question regarding the use of the Fama-MacBeth (1973) procedure on panel data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am investigating the cross sectional determinants of expected REIT return following the procedure from: Chui, A. C., Titman, S., &amp;amp; Wei, K. C. (2003a). The cross section of expected REIT returns. Real Estate Economics, 31, 451-479.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The equation I am investigating is as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/MuoBn.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/MuoBn.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am aware that the Fama MacBeth procedure accounts for cross correlation between variables but not for time series/ auto correlation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in my equation I introduce past returns (momentum) as one of the cross sectional determinants:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/mm4yQ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/mm4yQ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Now my question is as follows:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By introducing past returns, should I also account for time series correlation for instance by performing the Newey and West (1987) correction for serial correlation and heteroskedastcity? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance for your help and if anything is unclear I will gladly explain.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kind regards,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Spike Gontscharoff&lt;/p&gt;&#xA;" OwnerUserId="20487" LastEditorUserId="-1" LastEditDate="2016-04-28T14:53:03.683" LastActivityDate="2016-04-28T14:53:03.683" Title="serial correlation, Fama MacBeth (1973) procedure incorporating momentum" Tags="&lt;time-series&gt;&lt;correlation&gt;&lt;momentum&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25648" PostTypeId="2" ParentId="25521" CreationDate="2016-04-26T13:25:39.500" Score="3" Body="&lt;p&gt;I've used various data sources (including Yahoo) and their data is sometimes wrong. You can write code for sniffing out the errors. For all providers I've had to add &quot;cleaners&quot; to look for errors and make adjustments. If you use Google Finance etc you'll have random errors too. If you're making a private database then the adjustments need to be tracked in a table so you know what your program did. And some day later, Yahoo will correct the error and your adjustment needs to be removed. The trigger is comparing the new prices from Yahoo with the previous ones you had. A big change means a split or correction happened and you need to re-assess if the data is messed up or now clean.&lt;/p&gt;&#xA;" OwnerUserId="20460" LastActivityDate="2016-04-26T13:25:39.500" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25650" PostTypeId="2" ParentId="25370" CreationDate="2016-04-26T16:06:35.813" Score="2" Body="&lt;p&gt;Well, there's no absolute thing called a factor.  You can make your own factor, say &quot;stocks that begin with the letter 'A'&quot;.  Or stocks that closed above their previous close.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;MSCI/Barra sells their factor breakdowns and they have so many different models.  USE3L, USE4S, GEM3, US NSTM, etc etc.  And they will have different factor breakdowns entirely. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fama is famous for his factor model.  Which is things like high-low, book value.  If he doesn't distribute it, you will have to make it yourself.  As long as you can get the close prices then it is not hard to generate.  If you are a student you might be able to get free access to CRSP, which will give you some of the fundamentals that you need for book value.&lt;/p&gt;&#xA;" OwnerUserId="20092" LastActivityDate="2016-04-26T16:06:35.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25653" PostTypeId="1" CreationDate="2016-04-26T19:58:25.803" Score="4" ViewCount="514" Body="&lt;p&gt;I have a set of 7 investments in a portfolio and I need to optimize the weightings based on some exposures to various markets/styles/economic factors. I was hoping to do some sort of simple exposure analysis or 'factor analysis' (not actual Factor Analysis, but more just a bunch of regressions), using daily returns of various risk factors (for example, SPX, TBills, MSCI, FamaFrench Factors, etc). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I only have daily returns for 5 of the 7 investments in the portfolio. I have monthly returns for the remaining two. Is there an easy way to do some sort of generation of daily returns from monthly returns, possibly modelling the monthly against the factors' monthly returns, and then generating daily returns based on the model? (I know this is circular, but I am spitballing.) The problem is that I need some way to tie or anchor the modeled daily returns back to the actual monthly returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas? And does this make sense?&lt;/p&gt;&#xA;" OwnerUserId="20494" LastActivityDate="2016-07-26T10:15:09.083" Title="Is there a way to meaningfully generate daily returns from monthly?" Tags="&lt;portfolio&gt;&lt;modeling&gt;&lt;portfolio-optimization&gt;&lt;factor-models&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25654" PostTypeId="2" ParentId="25653" CreationDate="2016-04-26T20:42:26.320" Score="0" Body="&lt;p&gt;There are a few ways to do this.  For example, the FRBNY (google FRBNY and nowcasting) creates a weekly GDP number from monthly and weekly series.  You can sift through that to see how they change the time steps.  In the past I generated weekly unemployment data (which is a monthly series) from the pattern of weekly unemployment claims or something like that, it was a long time ago. Just make sure the changes you estimate get you back to the original monthly data. To do daily, I could have fit these weekly to an Nth degree polynomial. I know that sounds ad-hoc but as long as you know your weaknesses in the model, you can allow for that and judge it appropriately. I used the economic series example cause you mentioned economic indicators, so if your missing series is a financial one there could be a much better fit and approach if there is a similar daily series already.     &lt;/p&gt;&#xA;" OwnerUserId="19627" LastActivityDate="2016-04-26T20:42:26.320" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25655" PostTypeId="2" ParentId="25645" CreationDate="2016-04-26T20:55:33.200" Score="0" Body="&lt;p&gt;22k seems fine to me, assuming a new machine is bought on the first year.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed, you face a cost of 22k (sell price of new machine) plus 6k (operating cost of new machine), but you also earn 6k by selling your current machine at its face value  (since it won't last 5 years as required and it will only lose value from now on, better sell it asap).&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-04-26T21:41:38.390" LastActivityDate="2016-04-26T21:41:38.390" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25656" PostTypeId="1" CreationDate="2016-04-27T00:01:26.343" Score="-2" ViewCount="791" Body="&lt;p&gt;I know bond portfolio immunization includes duration and (if the hedging period is longer) convexity matching. These are equivalent to taking the first and second partial derivatives of the bond portfolio price with respect to the short rate. I wonder whether we should also look at the time value increment of the bond price, which is the time partial derivative of the bond price, just as the theta in option price. For option Greeks, Theta, Delta and Gamma are related through the valuation or in the simple setting the Black-Scholes equation. However, there does not seem to be such a relation in place for bond. Or am I mistaken?&lt;/p&gt;&#xA;" OwnerUserId="6686" LastActivityDate="2017-03-28T18:36:32.020" Title="Why Is Bond Time Value Risk Not Considered in Bond Immunization?" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;duration&gt;&lt;convexity&gt;&lt;bond-portfolio&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25657" PostTypeId="1" AcceptedAnswerId="25667" CreationDate="2016-04-27T01:37:23.650" Score="2" ViewCount="105" Body="&lt;p&gt;I am analyzing a problem where I have two stocks described by the equations&#xA; $$ \frac{dS^{1}_{t}}{S^{1}_{t}}=\mu_{1} dt + \sigma_{1} dW^{1}_{t}$$&#xA;$$ \frac{dS^{2}_{t}}{S^{2}_{t}}=\mu_{2} dt + \sigma_{2} dW^{2}_{t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\rho$ is the correlation between the risky assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An investor starts with some capital x and invests in the $\phi_t^1=S^{2}_{t}, \ \phi_t^2=S^{1}_{t}$ strategy. The safe rate is assumed to be zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to derive the investor wealth $X_t$ in terms of $Y_t$  for two cases &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$1) \ \rho=0$&lt;br&gt;&#xA;$2) \ \rho \neq 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am getting the following equations for the value of portfolio of the risky assets:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ Y_{t} =  (\phi_t^1 )S^{1}_{t} + (\phi_t^2 )S^{2}_{t} = S^{2}_{t} S^{1}_{t} + S^{1}_{t} S^{2}_{t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{dY_t}{Y_t} =  \frac{dS^{1}_{t}}{S^{1}_{t}} + \frac{dS^{2}_{t}}{S^{2}_{t}} + \frac{ &amp;lt;S^{1} S^{2}&amp;gt;_t}{S^{1}_{t} S^{1}_{t}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My intuition here is that self financing property needs to be applied,&#xA;so the Xt would be equal to some capital x + end value of risky assets - beg value investment in risky assets and the change in the portfolio would be somehow represent as $dX_t= S_t^1 dS_t^2 + S_t^1 dS_t^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to use the self financing property equation to derive X_t but don't know how to derive the final formulas given in the solutions. I missing some point here, I am stuck.&#xA;Can anybody explain the how this problem should be analyzed? what should be the starting point and how to proceed further?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;br&gt;&#xA;&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the final equations should look like&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$1) \rho=0$  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_t=Y_t - S_0^1 S_0^2 +x $  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;br&gt;&#xA;$2) \ \rho \neq 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dX_t = d(S_t^1 S_t^2) - d\langle S_1, S_2 \rangle_t = \frac{1}{2} dY_t - \frac{1}{2} \rho \sigma_ 1 \sigma_2 Y_tdt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_t=x+ \frac{1}{2} (Y_t -Y_0 - \rho \sigma_ 1 \sigma_2  \int_0^t Y_s ds)$&lt;/p&gt;&#xA;" OwnerUserId="18670" LastEditorUserId="18670" LastEditDate="2016-04-27T12:28:24.327" LastActivityDate="2016-04-27T14:21:30.913" Title="investor terminal value of portfolio with two risky assets 1) correlated 2)not correlated $\phi_t^1=S^{2}_{t}, \ \phi_t^2=S^{1}_{t}$" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;&lt;stochastic-control&gt;" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="25659" PostTypeId="1" CreationDate="2016-04-27T05:00:51.347" Score="3" ViewCount="196" Body="&lt;p&gt;here are 3 questions I have some trouble dealing with. Your help will be greatly appreciated!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 - We  have a deck card: 26 red, 26 black. we play a game: you draw a card from the deck without putting it back. If it is red I will pay you 1£. If black you will pay me 1£. You can stop whenever you want. what is a fair value of this game, assuming risk-neutral? what if there were infinite red/black cards?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2- assume rates are 0. There is a call option written on coin flips, that is the payoff of the security is the number of heads that comes up after a number of flips. Strike price is 2. Value this option for 4 coin flips. What is its delta?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3 - Given the BS implied volatility are the same for a bunch of calls with different strikes, other things being equal, how could one make an arbitrage if we just know the underlying volatility follows a stochastic process?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;my guess (please correct if you find it wrong):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 - stopping time has all its importance here. Lets say I pick up a black card: I will get 1£ but the proba of getting a red on the next round is higher. I tried to do something like: P(getting red at the nth attempt/s red cards have been picked up) with s&amp;lt;=n compared to P(getting red at the nth attempt/s-1 red cards picked). But this was not really working...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2 - when I flip 4 coins there are 16 possible paths. My understanding is that the strike is the number of flips. Then I break down the payoff:&#xA; - if n_heads=0 then payoff = 0 wp 1/16&#xA; - if n_heads=1 then payoff = 0 wp 4/16&#xA; - if n_heads=2 then payoff = 0 wp 6/16&#xA; - if n_heads=3 then payoff = 1 wp 4/16&#xA; - if n_heads=4 then payoff = 2 wp 1/16&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so the value of my call will be 4/16 + 2/16 = 6/16 = 3/8&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the delta:&#xA; - if n_heads=0 then payoff = 0 wp 1/16 =&gt; delta = 0 (OTM call)&#xA; - if n_heads=1 then payoff = 0 wp 4/16 =&gt; delta = 0 (OTM call)&#xA; - if n_heads=2 then payoff = 0 wp 6/16 =&gt; delta = 0 (OTM call)&#xA; - if n_heads=3 then payoff = 1 wp 4/16 =&gt; delta = 1 (ITM call)&#xA; - if n_heads=4 then payoff = 2 wp 1/16 =&gt; delta = 1 (ITM call)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;=&gt; delta = 4/16*1 + 1/16*1=5/16 so I will short 5/16 of stocks&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3 - if all implied vol are equal for a bunch of calls, low trike calls are underpriced compared to high strike vols. So i will go long low strike calls and short high strike calls for the same maturity (basically being long call spreads). but is there a way to make it more formal?&lt;/p&gt;&#xA;" OwnerUserId="20179" LastEditorUserId="20179" LastEditDate="2016-04-27T05:52:59.757" LastActivityDate="2016-04-27T21:25:45.483" Title="What are the answers to these questions on card deck and option pricing?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;probability&gt;&lt;arbitrage&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25660" PostTypeId="1" AcceptedAnswerId="25663" CreationDate="2016-04-27T07:55:16.557" Score="2" ViewCount="1120" Body="&lt;p&gt;I'm stuck in solving the SDE in Hull-White interest rate model. I do not have a thorough background in math (only Real Analysis during my blissful undergrad years), so I am having trouble understanding the integration process in explicitly solving the Hull-White SDE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, the Hull-White interest model follows the SDE&#xA;$$&#xA;dR(u) = (a(u) - b(u) R(u)) du + \sigma(u) d\tilde{W}(u)&#xA;$$&#xA;It says the explicit solution can be obtained by applying Ito's Lemma to&#xA;$$&#xA;e^{\int_0^u b(v) dv} R(u)&#xA;$$&#xA;and integrating both sides.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is where I am having trouble understanding.&#xA;$$&#xA;\int_t^T d\left(e^{\int_0^u b(v) dv} R(u)\right) = e^{\int_0^T b(v) dv} R(T) - e^{\int_0^t b(v) dv} R(t)&#xA;$$&#xA;It &lt;em&gt;seems&lt;/em&gt; that we are naively replacing $u$ with $T$ in the first term and with $t$ in the second term. Could we simply do this due to the fundamental theorem of Calculus? Or is there some other working mechanism behind the scenes?&lt;/p&gt;&#xA;" OwnerUserId="19502" LastEditorUserId="19502" LastEditDate="2016-04-27T09:30:25.227" LastActivityDate="2016-04-27T10:34:38.653" Title="Integration in the Hull-White SDE" Tags="&lt;stochastic-calculus&gt;&lt;sde&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25662" PostTypeId="2" ParentId="25643" CreationDate="2016-04-27T09:14:33.873" Score="0" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;To replicate a STOCK INDEX CHANGES OF +- 10%, you just have to move the price of each stock by +- 10% (in case of the Dow Jones Index anyway because this index is a simple average of the prices of its components)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can use the 1997 scenario and apply it to your current portfolio by proxying your instruments to the instruments from 1997.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="15435" LastActivityDate="2016-04-27T09:14:33.873" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25663" PostTypeId="2" ParentId="25660" CreationDate="2016-04-27T09:56:08.163" Score="2" Body="&lt;p&gt;Applying Itô's lemma to &#xA;$$ Y_t := e^{\int_0^t b(v) dv} r_t $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You get &#xA;\begin{align}&#xA;dY_t &amp;amp;= b(t) e^{\int_0^t b(v) dv} r_t dt + e^{\int_0^t b(v) dv} dr_t + 0\\&#xA;     &amp;amp;= e^{\int_0^t b(v) dv} (b(t) r_t dt + dr_t) \\&#xA;     &amp;amp;= e^{\int_0^t b(v) dv} (a(t) dt + \sigma(t) dW_t) &#xA;\end{align}&#xA;where the last line is obtained by using the fact that&#xA;$$ dr_t = (a(t)-b(t)r_t) dt + \sigma(t) dW_t $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your question regards the integration of the LHS, well it is simply given by&#xA;\begin{align}&#xA;\int_t^T dY_u &amp;amp;= Y_T - Y_t \\&#xA;              &amp;amp;= e^{\int_0^T b(v) dv} r_T - e^{\int_0^t b(v) dv} r_t&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the RHS, you get&#xA;$$ \int_t^T e^{\int_0^u b(v) dv} (a(u) du + \sigma(u) dW_u) = \int_t^T a(u) e^{\int_0^u b(v) dv} du + \int_t^T \sigma(u) e^{\int_0^u b(v) dv} dW_u $$&#xA;which you cannot really simplify much more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To obtain the solution to the original equation, work from here using the fact that $$r_t := e^{-\int_0^t b(v) dv} Y_t $$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Remark]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \int_0^t dY_u = (Y_t - Y_0) $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;is merely a consequence of how we define &lt;em&gt;stochastic integrals&lt;/em&gt; to begin with (wheter Ito or Stratonovich). Assuming Itô formalism, for a sufficiently well-behaved integrand $\psi_t$ and a semi-martingale $X_t$, the stochastic integral writes&#xA;$$ I_t := \int_0^t \psi_u dX_u = \lim_{\Vert P \Vert \rightarrow 0} \sum_{i=1}^N \psi_{t_{i-1}} (X_{t_i}-X_{t_{i-1}}) $$&#xA;where the limit (when it exists) is taken in the mean square sense, as the partition $P = \{ 0=t_0 &amp;lt; \dots &amp;lt; t_N=t \}$ is refined more and more (the maximum interval $t_{i}-t_{i-1}$ tends towards 0).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your particular case, just replace $\psi_t$ by $1$ to see that:&#xA;$$ I_t = \int_0^t dX_u = \lim_{\Vert P \Vert \rightarrow 0} \sum_{i=1}^N X_{t_i}-X_{t_{i-1}} = X_t - X_0 $$&#xA;due to the telescopic sum, as in ordinary calculus.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-04-27T10:34:38.653" LastActivityDate="2016-04-27T10:34:38.653" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25664" PostTypeId="2" ParentId="4954" CreationDate="2016-04-27T12:29:25.407" Score="0" Body="&lt;p&gt;For a mathematical model you can have a look at this paper:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.453.2801&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow&quot;&gt;The Valuation of Compound Options&lt;/a&gt; by Robert Geske&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where after equation (17) it is shown that $\partial \sigma_s/\partial S&amp;lt;0$. &lt;/p&gt;&#xA;" OwnerUserId="20501" LastEditorUserId="848" LastEditDate="2016-04-27T13:01:20.457" LastActivityDate="2016-04-27T13:01:20.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25666" PostTypeId="2" ParentId="24511" CreationDate="2016-04-27T14:06:45.033" Score="0" Body="&lt;p&gt;I think the above comment about using ACWI is the only way to trade options on the MSCI World.  You can see OTC swaps and futures trade on the index as well but there are no associated options.  But just remember how they are priced.  The ETF will snap it's close at 4pm like any other stock.  The actual index (as well as the ETF NAV) is based on closes from around the world so it will not exactly match.&lt;/p&gt;&#xA;" OwnerUserId="20092" LastActivityDate="2016-04-27T14:06:45.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25667" PostTypeId="2" ParentId="25657" CreationDate="2016-04-27T14:21:30.913" Score="1" Body="&lt;p&gt;Let $Y_t := 2 S_t^1 S_t^2 $. Applying (multivariate) Itô to the function $f(t,S_t^1,S_t^2)=2 S_t^1 S_t^2$ yields a stochastic differential equation for $Y_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{dY_t}{Y_t} = \frac{dS_t^1}{S_t^1} + \frac{dS_t^2}{S_t^2} + \rho \sigma_1 \sigma_2 dt $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Re-applying Itô's lemma to the function $f(t,Y_t) = \ln(Y_t)$ then yields&#xA;$$ d\ln Y_t = (\mu_1 + \mu_2 - \frac{\sigma_1^2 + \sigma_2^2}{2}) dt + \sigma_1 dW_t^1 + \sigma_2 dW_t^2 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which can be integrated over $[0,T]$ to obtain&#xA;$$ Y_T = Y_0 e^{(\mu_1+\mu_2-\frac{\sigma_1^2 + \sigma_2^2}{2})T + \sqrt{(\sigma_1^2 + \sigma_2^2 + 2\rho\sigma_1\sigma_2)}\ W_T} $$&#xA;where $Y_0 = 2 S_0^1 S_0^2$ and we have replaced $\sigma_1 W_t^1 + \sigma_2 W_t^2$ by $\sqrt{\sigma_1^2 + \sigma_2^2 + \rho \sigma_1 \sigma_2} W_t$ which is a random variable with the exact same distribution (cf. &lt;a href=&quot;https://quant.stackexchange.com/questions/25640/how-to-express-the-volatility-of-two-correlated-ito-processes-wt-1-wt-2-expre&quot; title=&quot;here&quot;&gt;proof here&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, assume a &lt;em&gt;self-financing&lt;/em&gt; portfolio consisting of holding $S_t^2$ shares of security 1 at time $t$, along with $S_t^1$ shares of security 2:&#xA;$$X_t := S_t^2 S_t^1 + S_t^1 S_t^2$$&#xA;The self-financing conditions gives, over any infinitesimal period of time&#xA;$$ dX_t = S_t^2 dS_t^1 + S_t^1 dS_t^2$$&#xA;which we can rewrite (simple application of multivariate Itô's lemma)&#xA;$$ dX_t = d(S_t^1 S_t^2) - d\langle S^1 S^2 \rangle_t $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now for $\rho=0$ the quadratic variation part is zero, and integrating &#xA;$$ dX_t = d(S_t^1 S_t^2) $$&#xA;over $[0,T]$ yields a final wealth of:&#xA;\begin{align}&#xA;X_T &amp;amp;= X_0 + S_T^1 S_T^2 - S_0^1 S_0^2 \\&#xA;    &amp;amp;= x + \frac{1}{2}(Y_T - Y_0)&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For $\rho \ne 0$ we write $dX_t = d(S_t^1 S_t^2) - d\langle S^1 S^2 \rangle_t $ as &#xA;$$ dX_t = \frac{1}{2} dY_t - \frac{1}{2} \rho \sigma_1 \sigma_2 Y_t dt $$&#xA;and integrate over $[0,T]$ to obtain&#xA;$$ X_T = x + \frac{1}{2} (Y_T - Y_0) - \frac{1}{2} \rho \sigma_1 \sigma_2 \int_0^T Y_t dt $$&#xA;Note that by setting $\rho = 0$ in the above we fall-back on the previous result.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2016-04-27T14:21:30.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25668" PostTypeId="1" AcceptedAnswerId="25669" CreationDate="2016-04-27T14:23:14.483" Score="0" ViewCount="761" Body="&lt;p&gt;quick question guys.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that for Shifted SABR (or any other Shifted model), we simply model the underlying price process (lets say the forward interest rate F), as F' = F + x, x being the shift.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) To calibrate the alpha (or the ATM vol parameter) of the model, do we calibrate to an option where the strike K is equal to F &lt;strong&gt;or&lt;/strong&gt; K is equal to F + x? (i.e. does the ATM point shift by the shift parameter)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) How do we reconcile this to the fact that in the real world, the actual ATM option is the one whose strike is equal to F? (i.e. its kind of like the shifted model pricing a real world ATM call option as an ITM option..)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="18708" LastActivityDate="2016-04-27T15:12:44.403" Title="shifted SABR - ATM vol" Tags="&lt;option-pricing&gt;&lt;interest-rates&gt;&lt;stochastic-volatility&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25669" PostTypeId="2" ParentId="25668" CreationDate="2016-04-27T15:12:44.403" Score="1" Body="&lt;p&gt;Let $\sigma(F,K)$ be the SABR implied vol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the shifted model, the formula essentially becomes  $\sigma(F+x,K+x)$ (you have to shift the strike as well).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So to answer your question in the ATM vol calibration you take $K=F$ in order to have $F+x=K+x$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no need to &quot;reconcile&quot; anything as it is just a model. Once you have your model, you have to calibrate it and if it matches your smile then you're happy.&lt;/p&gt;&#xA;" OwnerUserId="15435" LastActivityDate="2016-04-27T15:12:44.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25670" PostTypeId="1" CreationDate="2016-04-27T16:08:51.763" Score="0" ViewCount="238" Body="&lt;p&gt;I am wondering if anyone has any information on how combos on close trade. I've been looking at the BTIC (&lt;a href=&quot;http://www.cmegroup.com/trading/equity-index/btic-block-trades.html&quot; rel=&quot;nofollow&quot;&gt;http://www.cmegroup.com/trading/equity-index/btic-block-trades.html&lt;/a&gt;) and was wondering if there was anyway to get something similar on SPX options to actually trade the closing price of the SPX + some offset for forward alignment without doing a jellyroll. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&#xA;Andrew&lt;/p&gt;&#xA;" OwnerUserId="3440" LastActivityDate="2016-04-28T13:19:27.697" Title="Combos on close SPX" Tags="&lt;options&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25671" PostTypeId="1" CreationDate="2016-04-27T16:45:23.893" Score="1" ViewCount="118" Body="&lt;p&gt;I'm sure there are models and they have low and high estimates. But how to do they decide on the percentage growth? A bit of art + science?&lt;/p&gt;&#xA;" OwnerUserId="20079" LastActivityDate="2016-04-28T09:25:32.173" Title="How do companies forecast revenue and earning estimates for a quarter or year in advance?" Tags="&lt;forecasting&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25672" PostTypeId="2" ParentId="25659" CreationDate="2016-04-27T16:57:39.940" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;This question is extremely interesting and not that straightforward. See answer &lt;a href=&quot;http://puzzles.nigelcoldwell.co.uk/fourteen.htm&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. From a financial perspective this is very much like pricing an American call (stopping rule = intrinsic value from exercice (i.e. current cash earned) &gt; continuation value (i.e. what you can expect to gain). Note that you can never win more than 13 nor lose (at worst you play to the end and finish with 0 since there is the same number of red/black cards in the deck).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Its not 4 coins, but 4 flips. So its a simple binomial distribution on the number of heads. The strike is also a number of heads: you only win something when you end up with strictly more than 2 heads over the 4 flips (hence 3 or 4 heads over 4 flips). &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I would use the known stochastic vol process to price and delta hedge the option. Call $V_a $ the price using that &lt;em&gt;actual volatility&lt;/em&gt; and $V_i $ the &lt;em&gt;implied&lt;/em&gt; market price. If $V_a &amp;gt; V_i $ (else do the opposite of what follows), buy the option at its implied price $V_i$ and synthesise a long option position using a replicating portfolio (stocks and cash), using the actual volatility for the $\Delta $ computation. Dynamically rebalancing up to expiry will leave you the difference between the actual option price and the market price as a terminal wealth.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-04-27T21:25:45.483" LastActivityDate="2016-04-27T21:25:45.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25673" PostTypeId="1" CreationDate="2016-04-27T17:18:02.417" Score="0" ViewCount="13230" Body="&lt;p&gt;I'm facing this problem:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Spot AUD/USD is quoted at 0.7634/39;  six-months swaps are&#xA;  112.1/111.1;  at what forward outright rate can a price taker &lt;strong&gt;sell USD value spot/6 months&lt;/strong&gt;?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;On the spot side, the market is willing to buy the base currency (AUD) at 0.7634 (best bid), and it is willing to sell the base currency at 0.07639 (best ask). The spread is 5 pips. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the swap side, the thing is a bit more complicated. From my understanding, in a general swap contract:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The buyer goes short on base currency (AUD) and long on counter currency (USD)&lt;/li&gt;&#xA;&lt;li&gt;The seller goes long on base currency (AUD) and short on counter currency (USD)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So, in our case the agent wants to sell USD, therefore she is the seller of the swap contract, matching the swap market on the buy-side. She will therefore sell a swap contract at 111.1 (best bid).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The formula to compute the forward outright rate is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ FOR = \text{Spot Price} \frac{1+(i_C \frac{\text{Days} }{360 } )}{1+(i_B \frac{\text{Days} }{360 } )} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&#xA;$i_C$ is the counter currency rate&#xA;$i_B$ is the base currency rate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But actually I'm missing many inputs here, or I don't see how I can do it since the quotes I have for the swap don't look like rates. Is there anyone who has an idea on how to proceed? Thank you.&lt;/p&gt;&#xA;" OwnerUserId="20507" LastActivityDate="2016-06-01T07:18:58.223" Title="How to work out the forward outright price from the bid/ask quotes?" Tags="&lt;fx&gt;&lt;swaps&gt;&lt;currency&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25674" PostTypeId="1" CreationDate="2016-04-27T19:36:33.293" Score="2" ViewCount="111" Body="&lt;p&gt;I have a question regarding the optimal shrinkage intensity derived in the Ledoit-Wolf method. Specifically, I'm referring to their version concerned with the target defined as the single index factor model. I comprehend the bulk of the derivations, I think I do anyway, but it isn't entirely apparent to me why the optimal alpha value is inherently equal to K/T. From my understanding, this is related to the fact that the sample CoVar matrix is consistent while the target is not and the fact that the derived optimal alpha value vanishes as N tends towards infinity. I've researched this a bit and it might be that I don't have a good enough understanding of what is meant by optimal alpha being of the &quot;expected order O(1/T)&quot;. In summary - How does dividing the asymptotically optimal shrinkage (K) by T result in an optimal finite-sample alpha? Thanks&lt;/p&gt;&#xA;" OwnerUserId="20512" LastActivityDate="2016-04-27T19:36:33.293" Title="Ledoit-Wolf, expected order of optimal shrinkage intensity" Tags="&lt;covariance&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25675" PostTypeId="2" ParentId="25671" CreationDate="2016-04-27T20:22:39.580" Score="1" Body="&lt;p&gt;Interesting question - Definitely one that is a blend of art and science and doesn't lend itself to a tidy formula however, I think I can give you an idea of a few broad methods and concepts. Whether a firm's sales lend themselves to more quantitative vs qualitative type of models largely depends on their individual characteristics and the particular stage they are in their industry's life cycle as well as unique factors like M&amp;amp;A recent/future activity:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From an analysts perspective and wanting to work from a more macro point of view - a firm in a growth oriented industry a not a ton in the way of M&amp;amp;A activity, one approach is to forecast an expectation of total industry sales and form an expectation of market share to apply&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a firm that sells products that operate on a regular-ish life cycle (think new versions of Ipads, new Windows OS ext...) they might try and forecast organic unit growth based off of customer back log orders, try to get a sense of new product launch demand and how expected cannibalization will impact existing product demand, divide by (1 - anticipated gross margin) and apply an expectation for price inflation) Basically, organic unit growth x pricing power.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For larger, stable firms their growth might be well approximated with regression based models - for instance an AR(1) log linear model might give reliable predictions.&lt;/p&gt;&#xA;" OwnerUserId="20512" LastActivityDate="2016-04-27T20:22:39.580" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25676" PostTypeId="1" AcceptedAnswerId="25682" CreationDate="2016-04-27T20:29:19.400" Score="2" ViewCount="283" Body="&lt;p&gt;Discounted price process of an american put (perpetual) has a $dt$ part in it, which is negative if the price at time $t$ is less than the optimal exercise price. This is the only thing that drags the discounted process down as the time goes on and makes the whole process a supermartingale. So when you don't exercise the option at it's stopping time, it has a tendency to go down. However, I do not seem to be understanding the intuition behind here, as the process goes down only when the price is less than the optimal exercise price and shouldn't having a lower stock price make the option more valuable? So what am I getting wrong? &lt;/p&gt;&#xA;" OwnerUserId="15071" LastActivityDate="2016-04-28T16:40:44.193" Title="Perpetual American Put Supermartingale property" Tags="&lt;stochastic-calculus&gt;&lt;american-options&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25677" PostTypeId="2" ParentId="25641" CreationDate="2016-04-27T20:57:01.850" Score="0" Body="&lt;p&gt;Cap ex can come directly from the CF statement. Looks like you explicitly have it listed as a % of sales. Your change in WC can't be estimated without either corresponding % sales figures of either 1) current asset and current liability accounts or 2) net WC as a % sales. Using #2, you would find the NWC at the end of a year required to support the coming year's sales and calculate the change as the additional investment required to bring the existing WC balance to meet that figure. &lt;/p&gt;&#xA;" OwnerUserId="18557" LastActivityDate="2016-04-27T20:57:01.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25678" PostTypeId="2" ParentId="25676" CreationDate="2016-04-27T21:14:55.477" Score="0" Body="&lt;p&gt;Ok, so I have been thinking about it, and may have found the solution, but please correct me if I'm wrong. I guess the discounted process goes down, because when the holder of the option doesn't exercise it, as long as the price $S(t)$ is less than the optimal exercise price $L^*$ he's loosing cash from not investing into money market?&lt;/p&gt;&#xA;" OwnerUserId="15071" LastActivityDate="2016-04-27T21:14:55.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25679" PostTypeId="2" ParentId="22074" CreationDate="2016-04-27T21:48:44.417" Score="0" Body="&lt;p&gt;You would calculate return for each single position and for each segment of time. Following that you would geometrically link all these separate returns.&lt;/p&gt;&#xA;" OwnerUserId="7186" LastActivityDate="2016-04-27T21:48:44.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25680" PostTypeId="2" ParentId="25549" CreationDate="2016-04-28T00:16:24.243" Score="0" Body="&lt;p&gt;You have general and specific questions, so I'll my best here. I have a forex robot that does 30% p.a. 8 years running. It's technical indicators. It's also using one set of rules that is aware of peoples-patterns. (Target prices that traders would commonly sell at). It must be people-aware because even an HFT (and some have failed in big ways) has human ideas and rules in it. I have a Day Trader app that many people use and it has quant-ish things to spot traders habits. I had to build new math indicators (math with logic) to make that work well. I have a LT stock tool I'm just finishing. On 6000 stocks it made an average of 15% per trade - trades once per month based on signal (all technical indicators). I only mention this because I know the road well. 8,000 hours later I'm almost done. The experience summary I'm sharing here is: must be technical and trader-aware.&#xA;I also have a friend that is a top-hedge fund manager in Switzerland. He used neuroshell (he's not a programmer). That app uses neural network thinking to back-test the best indicators for a given market (any market). However, back-testing isn't a great predictor if done on a single venue (one stock). The forward trades aren't so good (I've done testing intensively for 14 years).&#xA;Market is driven by belief primarily. The belief (per B.Graham and reality) changes quickly. The time frames you use need different things than the day trader, or swing or investor. There are sentiment indicators of various types for the various time frames. They only help give one &quot;belief&quot; model for that time frame. The best tip I have here is need to look at the bigger timeframes to see where your investment lays. The bigger picture is the best help for trend traders. &quot;Reminiscence of a Stock Operator&quot; is great perspective on trading and markets. Many top traders read that book every year to get grounded in simple truths about markets and people. All the best to you.&lt;/p&gt;&#xA;" OwnerUserId="20460" LastActivityDate="2016-04-28T00:16:24.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25681" PostTypeId="2" ParentId="25670" CreationDate="2016-04-28T01:10:43.583" Score="0" Body="&lt;p&gt;Someone asked me similar question last week. No combos never trade at close in spx. Most people trade weekly to Jun {front  fut}or  various weekly rolls in spx . I looked at btic once, it was trading almost same level as roll mkt. If you traded combo you would hedge with future anyway? Btic seems like cool product to trade efp market. I am not sure if this answers you question but if you have more questions about spx rolls let me know.&#xA;John&lt;/p&gt;&#xA;" OwnerUserId="2083" LastActivityDate="2016-04-28T01:10:43.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25682" PostTypeId="2" ParentId="25676" CreationDate="2016-04-28T08:05:45.247" Score="3" Body="&lt;p&gt;I would not say there is no link to what you say but here would be my view.&lt;/p&gt;&#xA;&lt;h2&gt;Intuitive explanation&lt;/h2&gt;&#xA;&lt;p&gt;If you wait for a delay &lt;span class=&quot;math-container&quot;&gt;$h$&lt;/span&gt; before exercising, you lose your exercise right between &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$t+h$&lt;/span&gt;, this leads to a loss in value.&lt;/p&gt;&#xA;&lt;h2&gt;Supermartingale property proof&lt;/h2&gt;&#xA;&lt;p&gt;(to apply it in your case : &lt;span class=&quot;math-container&quot;&gt;$\phi_t=e^{-rt}(L-S_t)^+$&lt;/span&gt;)&lt;/p&gt;&#xA;&lt;p&gt;If we denote &lt;span class=&quot;math-container&quot;&gt;$\phi$&lt;/span&gt; the obstacle, and &lt;span class=&quot;math-container&quot;&gt;$\text{Am}(\phi)$&lt;/span&gt; the American perpetual option on pay-off &lt;span class=&quot;math-container&quot;&gt;$\phi$&lt;/span&gt;, assuming there is a optimal strategy &lt;span class=&quot;math-container&quot;&gt;$\tau^\star(t)$&lt;/span&gt; to exercise the option knowing you buy the option at time &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt;. Allowed strategies are stopping time (meaning you can take your decision only according to what you know at that time) bigger or equal than &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;You get :&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\text{Am}(\phi)_t=\mathbb{E}(\phi_{\tau^{\star}(t)}|\mathcal{F}_t)=\sup_{\tau\geq t}\mathbb{E}(\phi_\tau|\mathcal{F}_t)$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Setting &lt;span class=&quot;math-container&quot;&gt;$\tau=\tau^\star(t+h)$&lt;/span&gt; on the right hand side leads you to :&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\text{Am}(\phi)_t\geq \mathbb{E}(\phi_{\tau^\star(t+h)}|\mathcal{F}_t)$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;using tower property of conditionnal expectation :&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\mathbb{E}(\phi_{\tau^\star(t+h)}|\mathcal{F}_t)=\mathbb{E}(\mathbb{E}(\phi_{\tau^\star(t+h)}|\mathcal{F}_{t+h})|\mathcal{F}_t)$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;using the first equality in &lt;span class=&quot;math-container&quot;&gt;$t+h$&lt;/span&gt; rather in &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt; :&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\mathbb{E}(\phi_{\tau^\star(t+h)}|\mathcal{F}_{t+h})=\text{Am}(\phi)_{t+h}$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;pluggin this into previous inequality leads you to :&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\text{Am}(\phi)_t\geq \mathbb{E}(\text{Am}(\phi)_{t+h}|\mathcal{F}_t)$$&lt;/span&gt;&lt;/p&gt;&#xA;" OwnerUserId="20201" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-04-28T08:05:45.247" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="25683" PostTypeId="2" ParentId="25673" CreationDate="2016-04-28T08:14:29.923" Score="2" Body="&lt;p&gt;You wrote &quot;the quotes I have for the swap don't look like rates&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FX swaps are quoted in terms of &quot;forward points&quot; which have to be added or subtracted from the spot quotation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes the sign of the swap points is given explicitly. More often a quoting convention is followed that suppresses the negative signs if any. The quote you have is 112.1/111.1 which looks very strange, because the left side number (the bid) is larger than the right hand number (the ask), which seems impossible. This is a clue that the actual points are -112.1/-111.1 once the missing minus signs have been restored. Now it all makes sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In conclusion if Spot AUD/USD is quoted at 0.7634/39 and six-months swaps are -112.1/-111.1 it would mean that the 6 month forward is quoted 7634-112.1 pips i.e. 0.75219 on one side and 7639-111.1 i.e. 0.75279 on the other side.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you are a price-taker who wants to sell the counter currency and thus buy the base currency, you can do it at 0.75279.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Another way to tell that the swap points are negative is that interest rates in the base currency (USD) are lower than in the quotation currency (AUD).)&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-06-01T07:18:58.223" LastActivityDate="2016-06-01T07:18:58.223" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25684" PostTypeId="1" CreationDate="2016-04-28T09:08:29.590" Score="1" ViewCount="141" Body="&lt;p&gt;I have calculated the currency exposures of a long short portfolio simply by summing the weights of each stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I was told that I need to incorporate the dollar borrowing (short dollars), I don't really follow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can we assume from this line the portfolio has a negative USD cash balance used to fund the shorts?&lt;/p&gt;&#xA;" OwnerUserId="8170" LastActivityDate="2016-04-28T09:08:29.590" Title="calculating long short portfolios currency exposure" Tags="&lt;risk&gt;&lt;portfolio-management&gt;&lt;currency&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25685" PostTypeId="2" ParentId="25671" CreationDate="2016-04-28T09:25:32.173" Score="1" Body="&lt;p&gt;There are some companies that don't require that much &quot;art&quot; when forecasting their earnings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One example is regulated utilities - they earn the amount that the regulator allows them to earn with not much volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another more volatile example is pure play mining companies (like Antofagasta) - they have two main moving parts - mining volume and commodity prices. Mining volume is relatively easy to forecast and is usually guided by the company. Commodity prices - if you don't have a view you can just take current forward prices in the market. Everything else in the forecast is mostly simple arithmetics.&lt;/p&gt;&#xA;" OwnerUserId="19615" LastActivityDate="2016-04-28T09:25:32.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25686" PostTypeId="2" ParentId="25676" CreationDate="2016-04-28T09:48:52.633" Score="2" Body="&lt;p&gt;Just to add an intuitive argument to @MJ73550's already very nice answer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When holding an American option - or any option callable by the holder for that matter -, the question you ask yourself before exercising it is whether the proceeds from early exercise (i.e. exercise now to get the option's intrinsic value) are greater than what you could expect to earn if you were to exercise your right later (i.e. continuation value). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;At any point in time, the value of your option is thus always the &lt;strong&gt;maximum&lt;/strong&gt; between what you would receive in the 2 above scenarios, since you would like to exercise when it is &lt;strong&gt;optimal&lt;/strong&gt; for you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without loss of generality, assume you can only exercise at fixed dates separated by an interval $h$ (as it would typically be the case for a Bermudan option). Then at any time $t$ you have, for an option expiring at $T$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \text{Am}(t,T) = \max( (S_t - K)^+, \mathbb{E}[\text{Am}(t+h, T)] )  \geq \mathbb{E}[\text{Am}(t+h, T)]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$\text{Am}(t,T)$ - current option value at $t$&lt;/li&gt;&#xA;&lt;li&gt;$(S_t - K)^+$ - intrinsic value = proceeds if you were to exercise at $t$&lt;/li&gt;&#xA;&lt;li&gt;$\mathbb{E}[\text{Am}(t+h, T)]$ - what you can expect to earn if you wait until $t+h$ to make your decision.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;whence the supermartingale idea, or as @MJ73550's answer illustrates: &lt;em&gt;the best early exercise strategy over $[t,T]$ is always at least as good as the best early exercise strategy over $[t+h,T]$ since the former interval includes the latter.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some remarks:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the above holds for any $h&amp;gt;0$, particularly $h \rightarrow 0^+$;&lt;/li&gt;&#xA;&lt;li&gt;at $t=T$, the continuation and exercise value are the same, since there is no choice left;&lt;/li&gt;&#xA;&lt;li&gt;this process of comparing the continuation and intrinsic values is exactly what you do when using trees or Least-Squares Monte Carlo to price callable options.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-04-28T16:40:44.193" LastActivityDate="2016-04-28T16:40:44.193" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25687" PostTypeId="1" CreationDate="2016-04-28T11:02:02.790" Score="5" ViewCount="166" Body="&lt;p&gt;Is there any research done on the interplay between statistical factors (as a result of principle component analysis PCA) and the market factors (especially value, size, low vol, momentum, quality)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think that if I can represent a factor by a portfolio then I can look at the exposures of this portfolio to the factor. This is more or less easy for momentum and other ranking constructions. I have to check how to deal with the changing nature of the PCAs. They change through time and so do the market factors. I will see.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question: who has done analysis on this? Are there posts or papers on the net?&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-04-28T11:02:02.790" Title="Interplay of statistical factors (PCA) and market factors (value, momentum, low vol, ...)" Tags="&lt;pca&gt;&lt;factor-loading&gt;&lt;factor-investing&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25688" PostTypeId="1" AcceptedAnswerId="25689" CreationDate="2016-04-28T12:35:08.670" Score="2" ViewCount="944" Body="&lt;p&gt;I was reading that if we know a portfolios beta we can break the excess return on that portfolio into a market component and a residual component.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; r_p = beta_p * r_m + e_p&#xA;&#xA;&#xA; r_p - portfolio excess return&#xA; r_m - market return&#xA; e_p - residual return&#xA; beta_p - portfolio beta&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It then goes on to so say, the residual return (e_p) will be uncorrelated with the market return (r_m) and so the variance of the portfolio is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  var_p = beta_p^2 * var_m + var_p_residual&#xA;&#xA;  var_p - variance of portfolio&#xA;  beta_p^2 - beta of portfolio squared&#xA;  var_m - variance of market&#xA;  var_p_residual - variance of portfolio residual&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So my question is how can we know the residual return will be uncorrelated with the market return?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've found this &lt;a href=&quot;https://web.stanford.edu/~wfsharpe/mia/fac/mia_fac2.htm&quot; rel=&quot;nofollow&quot;&gt;web page&lt;/a&gt; which near the top it has a section titled The Key Assumption. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Consider, for example, a case in which the residual return is correlated with factor 1.  By adjusting the factor exposure (bi1) appropriately, the correlation of the residual with the factor can be made to equal zero.&lt;/em&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure if this is linked to my question or not but I still don't follow it either&lt;/p&gt;&#xA;" OwnerUserId="8170" LastActivityDate="2016-04-28T12:52:10.150" Title="how can we know the residual return will be uncorrelated with the market return" Tags="&lt;risk&gt;&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;capm&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25689" PostTypeId="2" ParentId="25688" CreationDate="2016-04-28T12:52:10.150" Score="5" Body="&lt;p&gt;Let us ignore the riskless rate for simplicity of the presentation.&#xA;If you have (historical or simulated) return series $r_i$ for the portfolio and $r_i^M$ for the market, then the beta is the OLS regression beta:&#xA;$$&#xA;\beta = cov(r_i,r_i^M)/var(r_i^M).&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then if you write $r_i = \alpha + \beta r_i^M + \epsilon_i$ on the other hand&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\epsilon_i = r_i - ( \alpha + \beta r_i^M).&#xA;$$&#xA;Then the covariance of these erros with the market are given as follows:&#xA;$$&#xA;cov(\epsilon_i, r_i^M) = cov(r_i - ( \alpha + \beta r_i^M),r_i^M)&#xA;$$&#xA;and as $cov(\alpha,r_i^M) = 0$ ($\alpha$ is a constant) we get&#xA;$$&#xA;cov(r_i - ( \alpha + \beta r_i^M),r_i^M) = \\ cov(r_i,r_i^M) - \beta cov(r_i^M,r_i^M) = cov(r_i,r_i^M) - cov(r_i,r_i^M)/var(r_i^M) * var(r_i^M) =0,&#xA;$$&#xA;as $cov(r_i^M,r_i^M)  = var(r_i^M)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a geometric sense Beta tells you the projection on the space spanned by the market. The residual is orthogonal by construction.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-04-28T12:52:10.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25690" PostTypeId="2" ParentId="25670" CreationDate="2016-04-28T13:19:27.697" Score="1" Body="&lt;p&gt;There are &quot;Combo-On-Close&quot; for SPX options but they are OTC.  Can you trade OTC?  The main IDBs set markets in those.  Obviously you would have to hedge your cash somehow.&lt;/p&gt;&#xA;" OwnerUserId="20092" LastActivityDate="2016-04-28T13:19:27.697" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25693" PostTypeId="2" ParentId="25050" CreationDate="2016-04-28T20:36:57.053" Score="0" Body="&lt;p&gt;I would contrast a realized frontier depending on whether you use actual data or not. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for instance, you could create an efficient frontier and then see how it does in the future and plot the results. This likely will deviate from the initial frontier because the assumptions that you use to create the efficient frontier are different from the returns embedded in the ex post history you are using.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternately, you could simulate the performance of the stocks hundreds of times, calculate the performance using each of the portfolios and plot maybe the average of those results as the final frontier.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2016-04-28T20:36:57.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25694" PostTypeId="2" ParentId="24511" CreationDate="2016-04-28T20:48:55.567" Score="0" Body="&lt;p&gt;It seems that you're looking for data for liquid options worldwide. On the global scale most liquid options are typically index / index futures options on the main local index, not MSCI indexes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Outside of index options, you have only few broad exchange-traded stock options markets - Eurex, Osaka, and ASX are probably top three. I'm surprised that Options Metrics was not to your liking. AFAIK it is one of the best single sources for options data, and includes worldwide coverage for all major exchanges. &lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2016-04-28T20:48:55.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25695" PostTypeId="2" ParentId="25311" CreationDate="2016-04-28T21:14:49.153" Score="4" Body="&lt;p&gt;1 - For historical reasons options expire on Saturdays, before noon. This has to do with potential reconciliation issues that are largely gone nowadays because of back-office automation. Practically, you can think of SPX index options as expiring at index settle, which is 4:00 pm EST on Fridays for PM expiring options, or 9:30 am EST on Fridays for serial options. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2 - Weeklys were around since 2006, your dataset is incomplete.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3 - Those are actually quarterlies, the only EOM options before 2014. And the four months you listed are indeed the only months for quarterlies. I assume that the reason for this choice is that they correspond to standard futures expirations months.&lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2016-04-28T21:14:49.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25696" PostTypeId="1" AcceptedAnswerId="28291" CreationDate="2016-04-28T21:49:05.773" Score="0" ViewCount="1638" Body="&lt;p&gt;I am writing a paper about CMS swap. To do so, I'd like to compare different theoretical pricing methods of these instruments to the &quot;real prices&quot; i.e. prices used in the marketplace.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I don't know where I could find such data. I have access to Bloomberg, but I did not find CMS swap there. Maybe I just don't know the right Bloomberg function... Otherwise I also have access to the following databases:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Bloomberg (as previously said)&lt;/li&gt;&#xA;&lt;li&gt;Datastream&lt;/li&gt;&#xA;&lt;li&gt;Thomson One Banker&lt;/li&gt;&#xA;&lt;li&gt;ResearchMonitor&lt;/li&gt;&#xA;&lt;li&gt;Factiva&lt;/li&gt;&#xA;&lt;li&gt;IMF e-library&lt;/li&gt;&#xA;&lt;li&gt;SDC Platinum&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="15650" LastEditorUserId="15650" LastEditDate="2016-04-28T22:24:50.200" LastActivityDate="2019-05-06T05:16:20.083" Title="Where can I find CMS swap trading prices?" Tags="&lt;market-data&gt;&lt;historical-data&gt;&lt;database&gt;&lt;cms&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25698" PostTypeId="1" CreationDate="2016-04-28T23:58:50.597" Score="-2" ViewCount="69" Body="&lt;p&gt;I have a basic question if someone could help me out how would I calculate    the 6 month change in TED spread. I have a monthly time series of TED spreads.&lt;/p&gt;&#xA;" OwnerUserId="13527" LastEditorUserId="13527" LastEditDate="2016-04-29T00:29:00.640" LastActivityDate="2016-05-15T23:32:26.317" Title="calculate 6 month change in TED spread" Tags="&lt;spread&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25699" PostTypeId="1" CreationDate="2016-04-29T00:07:18.727" Score="3" ViewCount="64" Body="&lt;p&gt;Since it's obviously not at their fair value that derivatives are priced, how do investment banks compute the fees that they add on top of the risk neutral price ?&lt;/p&gt;&#xA;" OwnerUserId="19693" LastActivityDate="2016-04-29T11:04:38.633" Title="Fees on derivatives" Tags="&lt;derivatives&gt;&lt;pricing&gt;&lt;risk-neutral&gt;&lt;fees&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25700" PostTypeId="2" ParentId="25699" CreationDate="2016-04-29T00:39:35.787" Score="3" Body="&lt;p&gt;As with everything else it is determined by competition: little or no competition =&gt; very high fees (or more correctly large bid-ask spreads). That is one reason why many IB try to develop new derivatives: they can be very profitable when no one else trades them yet. Then the cost comes down somewhat when competitors come in. Lack of transparency in pricing also helps the IBs (have you ever seen prices of OTC derivatives listed in the Wall Street Journal or any public place? Or an academic study of bid ask spread for i.r. swaps like you can find for listed stocks? I haven't).&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-04-29T11:04:38.633" LastActivityDate="2016-04-29T11:04:38.633" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25701" PostTypeId="1" CreationDate="2016-04-29T02:01:53.080" Score="0" ViewCount="274" Body="&lt;p&gt;I am trying to model a callable range accrual note linked to the EUR CMS spread, 20Y-10Y, with cap and floor. The note is Bermudan, callable starting year 3, every 3 years till maturity at 30 year. We plan on using shifted LMM for the EUR rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We plan to calibrate libor correlations to cms 20-10 spreadoptions 1Y maturity because those are the liquid ones, and vols to vanillas. A colleague told me that we will still overprice the trade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't understand why. I understand that Bermudans in will trade at a discount to europeans but I don't understand why the modeling will generally overprice it. Any help or links to papers or books will be greatly appreciated. Also any links to books and papers that explain how to remedy the issue will also be great. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="6909" LastActivityDate="2016-05-01T14:37:33.067" Title="Overpricing Bermudan swaption using Shifted LMM" Tags="&lt;option-pricing&gt;&lt;bermudan&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25702" PostTypeId="2" ParentId="25656" CreationDate="2016-04-29T02:46:50.927" Score="0" Body="&lt;p&gt;Suppose the short rate $r$ follows the diffusive process&#xA;$$dr=\mu dt+\sigma dB$$&#xA;where $B$ is the standard Brownian motion. The price of a bond portfolio $P(r(t),t,T)$ at time $t$ maturing at time $T$ follows&#xA;$$dP=\frac{\partial P}{\partial t} dt+\frac{\partial P}{\partial r}dr+\frac12\frac{\partial^2 P}{\partial r^2}dr^2=\Big(\frac{\partial P}{\partial t}+ \frac12\frac{\partial^2 P}{\partial r^2}+\mu\frac{\partial P}{\partial r}\Big)dt+\sigma\frac{\partial P}{\partial r}dB.$$&#xA;Note: It is not generally true that $\frac{\partial P}{\partial t}=rP$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using hedging argument similar to that deriving the Black-Scholes equation, we derive the PDE for the bond price&#xA;$$\frac{\partial P}{\partial t}+\frac12\sigma^2\frac{\partial^2 P}{\partial r^2}+(\mu-\lambda\sigma)\frac{\partial P}{\partial r}-rP=0,$$&#xA;where $\lambda$ is the market risk premium. Thus, just like the Greeks for the equity option pricing&#xA;$$\Theta+\sigma^2C-(\mu-\lambda\sigma)D-r=0$$&#xA;where $\Theta=\frac{\partial P}{P\partial t}$, $C$ is the duration and $D$ the convexity of the bond portfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Substituting the bond PDE into that of $dP$, we have&#xA;$$dP=\Big(rP+\lambda\sigma\frac{\partial P}{\partial r}\Big)dt+\sigma\frac{\partial P}{\partial r} dB.$$&#xA;So when the duration of the portfolio $\frac{\partial P}{\partial r}$ is made to vanish, the total derivative $dP=rPdt$, and the portfolio becomes a cash account. Therefore, in other words, for continuous time hedging, the portfolio can be represented by one bond the duration of which matches that of the bond portfolio and a cash account. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P(r(t),t,T)=\mathbf E\big[e^{-\int_t^T r}\big|r(t)\big]$$&#xA;is the solution of the PDE for the zero coupon bond. We will show that the above expression implies the bond PDE.&#xA;$$P(r(t),t,T)=\mathbf E\big[e^{-\int_t^sr}\mathbf E[e^{-\int_s^Tr}|r(s)]\big|r(t)\big]=\mathbf E\big[e^{-\int_t^sr}P(r(s),s,T)\big|r(t)\big]$$&#xA;$u(r(s),s):=e^{-\int_t^sr}P(r(s),s,T)$ is a martingale. Apply Ito's Lemma to $u(r(s),s)$, we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is essentially the derivation of a special case of the Feynman-Kac formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now for discrete time hedging, we will minimize the variance of the price difference of the whole portfolio (original bond portfolio together with the hedging portfolio), we require additionally $\frac{\partial^2 P}{\partial r^2}=0$ --- this statement needs reconsideration, later --- and the bond PDE becomes $\displaystyle\frac{\partial P}{\partial t}=rP$. To that end, we need one more bond for the proxy portfolio.&lt;/p&gt;&#xA;" OwnerUserId="6686" LastEditorUserId="6686" LastEditDate="2017-03-28T18:36:32.020" LastActivityDate="2017-03-28T18:36:32.020" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25703" PostTypeId="1" CreationDate="2016-04-29T03:10:26.953" Score="4" ViewCount="410" Body="&lt;p&gt;I am building a machine learning model using historical prices and I am using data from yahoo finance. Currently &lt;a href=&quot;https://uk.finance.yahoo.com/q/hp?s=STAN.L&quot; rel=&quot;nofollow&quot;&gt;yahoo finance data&lt;/a&gt; have two close prices one normal close price(close) and other adjusted close price(Adj close). My question is which close price should I take for teaching my ML model. Is there any (dis)advantage of using adjusted close price instead of close price?&lt;/p&gt;&#xA;" OwnerUserId="16754" LastActivityDate="2019-04-01T21:43:56.777" Title="Which close price should we use for machine learning?" Tags="&lt;historical-data&gt;&lt;machine-learning&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25704" PostTypeId="1" AcceptedAnswerId="25705" CreationDate="2016-04-29T04:53:26.557" Score="1" ViewCount="280" Body="&lt;p&gt;I am analyzing a problem given in the lecture slides published &lt;a href=&quot;http://ocw.mit.edu/courses/sloan-school-of-management/15-450-analytics-of-finance-fall-2010/recitations/MIT15_450F10_rec03.pdf&quot; rel=&quot;nofollow&quot;&gt;here (Slide 7-8 Example of Multivariate Ito’s Lemma)&lt;/a&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anybody explain how the $M_t$ was calculated out of the Ito formula. I cannot get the same results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Summary of the problem:&#xA;There are two Ito processes given:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{dX_t}{X_t}=\mu_{x} dt + \sigma_{x} dZ^{1}_{t} \quad \quad (1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{dY_t}{Y_t}=\mu_{y} dt + \sigma_{y} dZ^{2}_{t} \quad \quad (2)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so that $M_t=\frac{X_t}{Y_t}$ and the instantaneous volatility of $\frac{dM_t}{M_t}$ needs to be found.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Applying Ito Lemma to the function $M_t = f(X_t,Y_t) = X_t/Y_t$ gives&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dM_t=\frac{\partial f(X_t,Y_t)}{\partial X_t} dX_t + \frac{\partial f(X_t,Y_t)}{\partial Y_t} dY_t + \frac{1}{2} \left(\frac{\partial^2 f(X_t,Y_t)}{\partial X_t^2} (dX_t)^2+ 2 \frac{\partial^2 f(X_t,Y_t)}{\partial X_t \partial Y_t} dX_t \ dY_t + \frac{\partial^2 f(X_t,Y_t)}{\partial Y_t^2}(dY_t)^2 \right) \quad \quad (3)$$ &#xA;&lt;br&gt;&#xA;This should result in something like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dM_t=M_t \big{(} \mu_x + \mu_y  - \rho \sigma_x \sigma_y + \sigma_y^2 \big{)} \ dt + M_t \sigma_x dZ_t^1 - M_t \sigma_y dZ_t^2 \quad \quad (4)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{dM_t}{M_t}= \big{(} \mu_x + \mu_y  - \rho \sigma_x \sigma_y + \sigma_y^2 \big{)} \ dt +  \sigma_x dZ_t^1 -  \sigma_y dZ_t^2 \quad \quad (5)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;br&gt;&#xA;Plugging the partial derivatives into eq(3) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\partial f}{\partial X_t}=\frac{1}{Y_t}, \quad   \frac{\partial^2 f}{\partial X_t^2}=0, \quad  \frac{\partial f}{\partial Y_t}=\frac{-X_t}{Y_t^2}, \quad  \frac{\partial^2 f}{\partial Y_t^2}=\frac{2 X_t}{Y_t^3}, \quad  \frac{\partial^2 f}{\partial X_t \partial Y_t}=\frac{-1}{Y_t^2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and substituting with (1) and (2) should give me the equation (4) or (5), but I cannot get it, I am getting something like &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{dM_t}{M_t} = \frac{dX_t}{X_t} - \frac{1}{2} \frac{dy}{y} X_t  - \frac{1}{2} \frac{dy}{y} X_t dx \quad \quad (6)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;br&gt;&#xA;Can anybody explain the final transition for the $\frac{dM_t}{M_t}$ equation?&lt;/p&gt;&#xA;" OwnerUserId="18670" LastEditorUserId="18670" LastEditDate="2016-04-29T14:04:30.873" LastActivityDate="2016-04-29T15:48:38.320" Title="Multivariate Ito problem $M_t=\frac{X_t}{Y_t}$" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;&lt;itos-lemma&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25705" PostTypeId="2" ParentId="25704" CreationDate="2016-04-29T07:53:58.357" Score="2" Body="&lt;p&gt;What is written in attached slides is correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, what you have written is not correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Setting $M_t=\frac{X_t}{Y_t}$, and applying Ito formula will lead to :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dM_t=\frac{dX_t}{X_t} M_t -\frac{dY_t}{Y_t} M_t + M_t \frac{d&amp;lt;Y&amp;gt;_t}{Y^2_t}-\frac{d&amp;lt;X,Y&amp;gt;_t}{Y^2_t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which gives you in your case :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dM_t = (\mu_x dt+\sigma_x dZ^1_t)M_t - (\mu_y dt+\sigma_y dZ^2_t)M_t+M_t\sigma^2_y dt - \frac{\rho \sigma_x X_t \sigma_y Y_t dt}{Y_t^2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which leads you after simplification to :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{dM_t}{M_t} = (\mu_x -\mu_y -\rho\sigma_x\sigma_y +\sigma_y^2) dt + \sigma_x dZ^1_t - \sigma_y dZ^2_t$$&lt;/p&gt;&#xA;" OwnerUserId="20201" LastEditorUserId="20201" LastEditDate="2016-04-29T12:54:19.877" LastActivityDate="2016-04-29T12:54:19.877" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="25706" PostTypeId="2" ParentId="25701" CreationDate="2016-04-29T08:37:30.343" Score="2" Body="&lt;p&gt;well there are lots of things to get right... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;first you need to the non-callable version right, to get that right requires getting the smile right since a callable range accrual is really just a bunch of digitals with timing effects.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;these days discounting and forwarding are done with different curves so you'll need to get that right too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then you'll need to get covariance between the cms rates right. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;my paper has some &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://ssrn.com/abstract=1461285&quot; rel=&quot;nofollow&quot;&gt;http://ssrn.com/abstract=1461285&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2016-04-29T08:37:30.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25707" PostTypeId="1" CreationDate="2016-04-29T09:12:25.987" Score="2" ViewCount="1108" Body="&lt;p&gt;In many papers and book I have found a reasoning that it is well summarized &lt;a href=&quot;https://www.princeton.edu/~yacine/stochvol.pdf&quot; rel=&quot;nofollow&quot;&gt;in this paper&lt;/a&gt; as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;&lt;em&gt;The first proxy we use is an unadjusted Black-Scholes proxy in which the implied volatility of a short-maturity at-the-money option is used in place of the true instantaneous volatility state variable. The use of this proxy is justified in theory by the fact that &lt;strong&gt;the implied volatility of such an option converges to the instantaneous volatility of the logarithmic stock price as the maturity of the option goes to zero&lt;/strong&gt;.&lt;/em&gt;&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where can I find a formal justification of this assertion? &lt;/p&gt;&#xA;" OwnerUserId="18063" LastActivityDate="2016-04-29T15:23:00.187" Title="Implied Volatility as proxy for instantaneous volatility" Tags="&lt;implied-volatility&gt;&lt;local-volatility&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25708" PostTypeId="2" ParentId="25707" CreationDate="2016-04-29T12:00:59.697" Score="1" Body="&lt;p&gt;This is a result of Ledoit et al&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lemma proof in Appendix of &lt;a href=&quot;http://www.ledoit.net/9-98.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.ledoit.net/9-98.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-04-29T12:00:59.697" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25709" PostTypeId="1" CreationDate="2016-04-29T12:31:27.670" Score="1" ViewCount="248" Body="&lt;p&gt;Reading Asset Pricing by John Cochrane (2005), in his second chapter he defines the risk free rate as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rf = 1 / sum [pc(s)]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where pc(s) are state contingent claims, where s is the state of nature realised from a possible set S.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is quite an elementary question I'm sure, but I just cannot grasp why this is the case. If anyone could enlighten me intuitively that would be most appreciated!&lt;/p&gt;&#xA;" OwnerUserId="20530" LastActivityDate="2016-06-28T13:42:40.937" Title="Why is the Risk Free Rate 1 over Contingent Claim Prices?" Tags="&lt;risk&gt;&lt;risk-free&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25710" PostTypeId="2" ParentId="25709" CreationDate="2016-04-29T12:59:39.183" Score="2" Body="&lt;p&gt;By buying all the state contingent claims you ensure that you will receive 1 USD in the next period (since one of the states will occur), and that is the definition of a risk free security: something that is guaranteed to pay off 1. The price at which it sells today is lower than 1, and that discounting defines the Risk Free rate. If the risk free basket of claims sells for 0.9 then the interest rate is 1/0.9 = 1.11 or 11% in net terms. &lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2016-04-29T12:59:39.183" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25711" PostTypeId="1" AcceptedAnswerId="25713" CreationDate="2016-04-29T14:22:18.263" Score="4" ViewCount="1304" Body="&lt;p&gt;The following integral represents an expected value of a geometric brownian motion for $S_T&amp;gt;K$ (i.e. part of the Black-Scholes call option price):&#xA;$$\int_{z^*} (S_te^{\mu\tau-\frac{1}{2}\sigma^2\tau+\sigma\sqrt{\tau}z})\frac{1}{\sqrt{2\pi}}e^{-\frac{z^2}{2}}dz&#xA;=e^{\mu\tau}S_tN(d_1^*)$$&#xA;with $z^*=\frac{\ln\frac{K}{S_t}-(\mu-\sigma^2/2)\tau}{\sigma\sqrt{\tau}}$,&#xA;$d_1^*=\frac{\ln\frac{S_t}{K}+(\mu+\sigma^2/2)\tau}{\sigma\sqrt{\tau}}$, and $N(\cdot)$ cumulative Standardnormal distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you please explain how this equality is obtained?&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2016-04-29T16:07:09.260" Title="Understanding the solution of this integral" Tags="&lt;black-scholes&gt;&lt;probability&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25713" PostTypeId="2" ParentId="25711" CreationDate="2016-04-29T14:51:41.760" Score="7" Body="&lt;p&gt;Let $\tau = T-t$. Then&#xA;\begin{align*}&#xA;S_T = S_t e^{(\mu - \frac{1}{2}\sigma^2) \tau + \sigma \sqrt{\tau}\, Z},&#xA;\end{align*}&#xA;where $Z$ is a standard normal random variable, independent of $\mathcal{F}_t$. Moreover,&#xA;\begin{align*}&#xA;E\left(S_T 1_{\{S_T &amp;gt;K\}}\mid \mathcal{F}_t \right) &amp;amp;= E\left(S_t e^{(\mu - \frac{1}{2}\sigma^2) \tau + \sigma \sqrt{\tau}\, Z}\, 1_{\left\{S_t e^{(\mu - \frac{1}{2}\sigma^2) \tau + \sigma \sqrt{\tau}\, Z} &amp;gt;K\right\}}\mid \mathcal{F}_t \right)\\&#xA;&amp;amp;=\int_{-\infty}^{\infty}S_t e^{(\mu - \frac{1}{2}\sigma^2) \tau + \sigma \sqrt{\tau}\, z}\, 1_{\left\{S_t e^{(\mu - \frac{1}{2}\sigma^2) \tau + \sigma \sqrt{\tau}\, z} &amp;gt;K\right\}} \frac{1}{\sqrt{2\pi}}e^{-\frac{z^2}{2}} dz\\&#xA;&amp;amp;=\int_{z^*}^{\infty}S_t e^{(\mu - \frac{1}{2}\sigma^2) \tau + \sigma \sqrt{\tau}\, z}\frac{1}{\sqrt{2\pi}}e^{-\frac{z^2}{2}} dz\\&#xA;&amp;amp;=\int_{z^*}^{\infty}\frac{1}{\sqrt{2\pi}} S_t e^{(\mu - \frac{1}{2}\sigma^2) \tau + \sigma \sqrt{\tau}\, z - \frac{z^2}{2}}dz\\&#xA;&amp;amp;=\int_{z^*}^{\infty}\frac{1}{\sqrt{2\pi}} S_t e^{(\mu - \frac{1}{2}\sigma^2) \tau -\frac{1}{2}(z-\sigma \sqrt{\tau})^2 +\frac{1}{2}\sigma^2 \tau }dz\\&#xA;&amp;amp;=S_t e^{u\tau} \int_{z^* - \sigma \sqrt{\tau}}^{\infty} \frac{1}{\sqrt{2\pi}}e^{-\frac{x^2}{2}}dx\\&#xA;&amp;amp;=S_t e^{u\tau}N(\sigma \sqrt{\tau}-z^*)\\&#xA;&amp;amp;=S_t e^{u\tau}N(d_1^*),&#xA;\end{align*}&#xA;where&#xA;\begin{align*}&#xA;d_1^* &amp;amp;= \sigma \sqrt{\tau}-z^*\\&#xA;&amp;amp;=\frac{\ln\frac{S_t}{K}+(\mu+\sigma^2/2)\tau}{\sigma\sqrt{\tau}}.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-04-29T14:51:41.760" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="25715" PostTypeId="2" ParentId="22830" CreationDate="2016-04-29T15:13:59.633" Score="3" Body="&lt;p&gt;A few years ago I asked a similar question on MO:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://mathoverflow.net/questions/22828/big-picture-concerning-ito-integral-stratonovich-integral-and-standard-results&quot;&gt;https://mathoverflow.net/questions/22828/big-picture-concerning-ito-integral-stratonovich-integral-and-standard-results&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My take today is that you really don't need this heavy mathematical machinery for standard BS but as soon as you move on to more sophisticated (and realistic) models you surely do, so it is useful, when you develop the much needed machinery right away and use it on some toy problems instead of switching gears in the middle of your analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Besides stochastic integration is also quite elegant and general and mathematicians like elegant and general solutions.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="-1" LastEditDate="2017-04-13T12:58:47.233" LastActivityDate="2016-04-29T15:13:59.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25716" PostTypeId="2" ParentId="25707" CreationDate="2016-04-29T15:23:00.187" Score="0" Body="&lt;p&gt;See also this dissertation by &lt;a href=&quot;http://www.cmap.polytechnique.fr/~valdo/papers/dissertation.pdf&quot; rel=&quot;nofollow&quot;&gt;Durrleman&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2016-04-29T15:23:00.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25719" PostTypeId="1" AcceptedAnswerId="25722" CreationDate="2016-04-29T15:33:46.113" Score="1" ViewCount="314" Body="&lt;p&gt;I am looking at implied dividend yields to be obtained from the put-call parity and have come across the following answer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/7841/implied-dividend-estimation/7843#7843&quot;&gt;Implied dividend estimation&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It states that&#xA;$$&#xA;PV(div) = P - C + (S - K) + K(e^{rT} - 1),&#xA;$$&#xA;however the put-call parity as I know it states&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;C - P + PV(div) = S-K(e^{-rT})&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have looked at it for a while and cannot match these two expressions. Do you have any input in what I might be missing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&#xA;Diaz&lt;/p&gt;&#xA;" OwnerUserId="20533" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-04-29T16:40:46.130" Title="Is this representation of the put-call parity correct? (Implied dividend estimation)" Tags="&lt;dividends&gt;&lt;put-call-parity&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25720" PostTypeId="2" ParentId="25704" CreationDate="2016-04-29T15:48:38.320" Score="0" Body="&lt;p&gt;I found the problem ,the partial derivatives were incorrectly derived.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dM_t = \frac{1}{Y_t} dX_t - \frac{-X_t}{Y_t^2} dY_t + \frac{-1}{Y_t^2} dX_t dY_t  + \frac{X_t}{Y_t^2} dY_t \quad / : \frac{Y_t}{X_t} \quad \quad (6)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{dM_t}{M_t} = \frac{dX_t}{X_t}  - \frac{dY_t}{Y_t} - \frac{dX_t dY_t}{X_t Y_t} + \frac{(dY_t)^2}{(Y_t)^2} \quad \quad \quad (7)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;after substituting with (1) and (2) and doing all the algebra  I get the correct final equation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{dM_t}{M_t}= \big{(} \mu_x + \mu_y  - \rho \sigma_x \sigma_y + \sigma_y^2 \big{)} \ dt +  \sigma_x dZ_t^1 -  \sigma_y dZ_t^2 \quad \quad (5)$$&lt;/p&gt;&#xA;" OwnerUserId="18670" LastActivityDate="2016-04-29T15:48:38.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25721" PostTypeId="2" ParentId="25711" CreationDate="2016-04-29T16:07:09.260" Score="4" Body="&lt;p&gt;Another take on the question which uses stochastic calculus&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Digression]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume deterministic and constant rates without loss of generality. Also assume the absence of arbitrage opportunities and market completeness&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $B_t$ denote the time-$t$ value of a risk-free money market account in which 1 unit of currency $C$ has been invested at $t=0$:&#xA;\begin{align}&#xA;&amp;amp; dB_t = rB_t dt,\ \ B(0)=1 \\&#xA;\iff&amp;amp; B_t = e^{rt}&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under the risk-neutral measure $\mathbb{Q}_B$ associated to the numéraire $B_t$, for any tradable asset $V_t$&#xA;$$ \frac{V_t}{B_t} \text{ is a } \mathbb{Q}_B\text{-martingale} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, assume that the stock price follows a GBM under $\mathbb{Q}_B$&#xA;\begin{align}&#xA;&amp;amp;\frac{dS_t}{S_t} = r dt + \sigma dW_t^{\mathbb{Q}_B},\ \ S(0)=S_0 &amp;gt; 0 \\&#xA;\iff&amp;amp; S_T = S_0 e^{(r-\frac{\sigma^2}{2})T + \sigma W_T^{\mathbb{Q}_B}}&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Define an EMM $\mathbb{Q}_S$ which uses the stock price $S_t$ as numéraire, then  for any tradable asset $V_t$&#xA;$$ \frac{V_t}{S_t} \text{ is a } \mathbb{Q}_S\text{-martingale} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the 2 EMM definitions we simultaneously have&#xA;$$ \frac{V_0}{B_0} = E^{\mathbb{Q}_B}\left[\frac{V_T}{B_T} \vert \mathcal{F}_0\right] $$&#xA;$$ \frac{V_0}{S_0} = E^{\mathbb{Q}_S}\left[\frac{V_T}{S_T} \vert \mathcal{F}_0\right] $$&#xA;re-arranging we see that&#xA;$$ E^{\mathbb{Q}_B}\left[\frac{V_T B_0}{B_T} \vert \mathcal{F}_0\right] = E^{\mathbb{Q}_S}\left[\frac{V_T S_0}{S_T} \vert \mathcal{F}_0\right] (\ = V_0) $$&#xA;in other words, the Radon-Nikodym derivative of the change of measure writes:&#xA;$$ \left. \frac{d\mathbb{Q}_S}{d\mathbb{Q}_B} \right\vert \mathcal{F}_t = \frac{S_T B_0}{S_0 B_T} = e^{-\frac{\sigma^2}{2}t + \sigma W_t^{\mathbb{Q}_B}} $$&#xA;which is a Doléans-Dade exponential&#xA;$$ \left. \frac{d\mathbb{Q}_S}{d\mathbb{Q}_B} \right\vert \mathcal{F}_t = \mathcal{E}(\sigma W_t^{\mathbb{Q}_B}) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using Girsanov theorem we can write that&#xA;\begin{align}&#xA;W_{t}^{\mathbb{Q}_S} &amp;amp;= W_{t}^{\mathbb{Q}_B} - \langle W_{t}^{\mathbb{Q}_B}, \sigma W_t^{\mathbb{Q}_B} \rangle_t \\&#xA;&amp;amp;= W_{t}^{\mathbb{Q}_B} - \sigma t&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus the dynamics of $S_t$ under $\mathbb{Q}^S$ reads&#xA;\begin{align}&#xA;&amp;amp;\frac{dS_t}{S_t} = (r + \sigma^2) dt + \sigma dW_t^{\mathbb{Q}_S},\ \ S(0)=S_0 &amp;gt; 0 &#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Calculation]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, the expectation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ e^{-rT} E^{\mathbb{Q}_B} \left( S_T 1_{\{S_T &amp;gt;K\}}\mid \mathcal{F}_0 \right) =  E^{\mathbb{Q}_B} \left( \frac{S_T 1_{\{S_T &amp;gt;K\}} B_0}{B_T} \mid \mathcal{F}_0 \right) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;can be written (change of measure)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$  S_0 E^{\mathbb{Q}_S}\left(1_{\{S_T &amp;gt;K\}}\mid \mathcal{F}_0 \right) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and this expectation is easy to compute since we have shown that $S_T$ remains lognormal under $\mathbb{Q}_S$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, it is exactly the same derivation as for $E^{\mathbb{Q}_B}(1_{\{S_T &amp;gt;K\}}) = \mathbb{Q}_B(S_T &amp;gt; K) = N(d_2)$, where one just has to replace $r$ by $r+\sigma^2$, hence the definitin of $d_1$.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2016-04-29T16:07:09.260" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25722" PostTypeId="2" ParentId="25719" CreationDate="2016-04-29T16:40:46.130" Score="2" Body="&lt;p&gt;Call-put parity writes (to see this, notice that $(S_T-K)^+ - (K-S_T)^+ = S_T - K $ and take the discounted risk-neutral expectation $E^{\mathbb {Q}} [. \vert \mathcal {F}_0 ]$ on both sides):&#xA;$$ C(K,T) - P(K,T) = DF  ( F(0,T) - K ) $$&#xA;with $DF = e^{-rT} $ the discount factor, and $F(0,T)$ the fair forward price given by&#xA;$$ F(0,T) = (S_0 - D^*)e^{rT} $$ &#xA;with $D^*$ the net dividends' present value and $S_0$ the spot price. So indeed&#xA;$$ D^* = S_0 - Ke^{-rT} - C(K,T) + P(K,T) $$&#xA;Careful though that this relationship only holds for European options (for American options this does not strictly hold, although close to atm it is not a bad approximation)&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2016-04-29T16:40:46.130" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25724" PostTypeId="2" ParentId="1279" CreationDate="2016-04-29T17:39:06.737" Score="3" Body="&lt;p&gt;The most rigorous approach I have seen so far eliminating the risk premium is this one:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=296401&quot; rel=&quot;nofollow&quot;&gt;Emanuel Derman: The Perception of Time, Risk and Return During Periods of Speculation (2002)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equation 2.23 on page 11 derives $\mu$ ~ $r$ but it only holds in the limit when you hypothesize countless uncorrelated stocks in a diversifiable market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still an interesting approach. &lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2016-04-29T17:39:06.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25725" PostTypeId="2" ParentId="25703" CreationDate="2016-04-29T18:42:27.343" Score="2" Body="&lt;p&gt;You should use Adj close price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using Adj close price gives you the adjusted values of close price, hence the fair picture in case of off-beat events like splits and dividends. Using close price instead of adj close price provides unrealistic and false values of metrics like returns, which could generate false signals in your ML model.&lt;/p&gt;&#xA;" OwnerUserId="19434" LastActivityDate="2016-04-29T18:42:27.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25728" PostTypeId="1" CreationDate="2016-04-30T00:46:46.767" Score="7" ViewCount="9938" Body="&lt;p&gt;In my text (Investments by BKM), the investor's mean-variance utility (given as $U = E[R] - \frac12A\sigma^2$) is stated to be the objective function we wish to maximize. Upon further digging, it seems that this stems from the assumption of quadratic utility functions ($U = aW - bW^2$). This kind of bothers me since I see two unrealistic properties for quadratic utility functions. (1) They exhibit increasing absolute risk aversion, and (2) they achieve a satiation point, beyond which money/return begins to have negative value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So why do we assume quadratic utility? Are there no other simple, more realistic functional forms for utility that would still lead to a reasonably clean portfolio optimization theory? Or are the issues I cited about the quadratic just negligible in practice?&lt;/p&gt;&#xA;" OwnerUserId="20539" LastActivityDate="2016-07-30T19:34:11.173" Title="Why do we assume quadratic utility in portfolio theory?" Tags="&lt;optimization&gt;&lt;portfolio-optimization&gt;&lt;utility-theory&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="25729" PostTypeId="1" AcceptedAnswerId="25734" CreationDate="2016-04-30T01:35:56.777" Score="0" ViewCount="57" Body="&lt;p&gt;I am looking for clarification to the trading strategy problem where the number of stocks is depending on time.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;In the Market with zero safe rate and stock dynamics defined as&#xA;$$\frac{dS_t}{S_t}=\mu_t dt + \sigma_t dW_t \quad \quad (1)$$&#xA;investor with initial capital x buys stock for an interval of time [0,T] at the constant rate of x/T euros per unit of time.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am calculating the number of shares at time t, first by defining the change rate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d \theta_t=\frac{x}{T} \frac{1}{S_t} dt \quad \quad (2)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and then getting the function for $\theta$ by integrating  (2)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\theta_t=\frac{x}{T} \int_0^t \frac{1}{S_t} ds \quad \quad (3)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;is this approach correct?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Further I want to show that the payoff $V_T$ at T equals $\frac{x}{T} \int_0^T R_{t,T} dt$ where  $R_{t,T}$ is the simple return rate between t and T.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solution manual says that this should be calculated as &#xA;$$V_T= \int_0^T \theta_t dS_t  \quad \quad (4)$$&#xA;and integration by parts yields&#xA;$$V_T= \theta_T S_T - \int_0^T S_t d\theta_t = \int_0^T (S_T-S_t) d\theta_t = \int_0^T (\frac{S_T}{S_t}-1)S_t d\theta_t = \frac{x}{T} \int_0^T R_{t,T} dt  \quad (5)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way the payoffs are derived here is unclear to me. My understanding is that the number of shares is different at each time point but only two prices were used here $S_T$ and $S_t$ while integration is with respect to $\theta$. However the price changes over the time interval as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Can anybody explain the reasoning used for the payoffs?&lt;/strong&gt;  &lt;/p&gt;&#xA;" OwnerUserId="18670" LastActivityDate="2016-05-01T09:07:57.770" Title="trading strategy problem - initial capital x buys S over time [0,T] at the constant rate of x/T euros per unit of time" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;stochastic-control&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25730" PostTypeId="1" CreationDate="2016-04-30T04:18:31.767" Score="2" ViewCount="108" Body="&lt;p&gt;I haven't really studied much financial mathematics until about 2 months ago so I'm quite new to this stuff, so I'm sorry if this is a trivial question. At the moment I'm trying to work out what the terms of a modified Black-Scholes equation are equal to, so if someone could help me out I'd appreciate it. The equation is as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$u(0,S_{0}) = \mathbb{E}^{\mathbb{Q}_{BS}}(\Phi) + \frac{\lambda}{2}(\mathbb{E}^{\mathbb{Q}_{BS}}((\Phi*)^2) - (\mathbb{E}^{\mathbb{Q}_{BS}}(\Phi*))^2)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\Phi* = s\partial_s\Phi - \Phi$, $\Phi$ is the payoff, and $\mathbb{Q}_{BS}$ is the risk-neutral probability for the BS equation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, how do I find out what $\Phi*$ is equal to? In particular, what is $\mathbb{E}^{\mathbb{Q}_{BS}}(\Phi*)$ equal to? There is a lot of material on calculating $\mathbb{E}^{\mathbb{Q}_{BS}}(\Phi)$ so I know what that is equal to, but I have no idea how to find what the other term is equal to ($\lambda$ is just an arbitrary value so I don't need to worry about that).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="20543" LastEditorUserId="20543" LastEditDate="2016-04-30T22:25:59.513" LastActivityDate="2016-04-30T22:25:59.513" Title="Problems with a Black-Scholes modified equation" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;stochastic-processes&gt;&lt;modeling&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="25731" PostTypeId="1" CreationDate="2016-04-30T06:04:21.320" Score="1" ViewCount="549" Body="&lt;p&gt;I can retrieve the components But I would like 2 retrieve the Index RIC by the sector scheme Code for Both GCIS and TRBC. I would really like 2 get my hands on the components for the Dow Jones sectors / ICB I have them for NYSE but would like the other exchanges. :)&#xA;This Finds the Components &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;=RSearch(&quot;EQUITY&quot;,A2:B5,&quot;NBROWS:2000&quot;,,C2)  &#xA;RCSIssuerCountryGenealogy   'M:A9/G:6J' &#xA;PriceClose  &amp;gt;5.00&#xA;GicsName    'Financials'&#xA;IsPrimaryRIC    Yes&#xA;Row 1262&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This Finds the Sector Scheme and code for groupings &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;=TR(OFFSET($C2,0,0,B6,1),&quot;TR.GICSSector; TR.GICSSectorCode;&#xA;    TR.GICSIndustryGroup; TR.GICSIndustryGroupCode; TR.GICSIndustry; &#xA;    TR.GICSIndustryCode; TR.GICSSubIndustry; TR.GICSSubIndustryCode&#xA;    &quot;,&quot;CH=Fd RH=IN&quot;,E1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is how do U retrieve the index ric for GICSIndustryGroupCode or GICSIndustryGroup&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found a list of the GCIS symbols broken down by Sectors, Industry Groups, Industries and Sub-Industries But they are EOD symbols :(&lt;/p&gt;&#xA;" OwnerUserId="20546" LastEditorUserId="848" LastEditDate="2016-04-30T16:54:02.900" LastActivityDate="2016-04-30T16:54:02.900" Title="Thompson Reuters TRBC and GICS" Tags="&lt;reuters&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25733" PostTypeId="1" CreationDate="2016-04-30T08:46:28.087" Score="2" ViewCount="117" Body="&lt;p&gt;A slight twist (I hope) on the familiar problem of simulating log returns from a t-distribution. My two questions concern calibration to sample data.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;First, one can infer the &lt;strong&gt;degrees of freedom&lt;/strong&gt;, &lt;span class=&quot;math-container&quot;&gt;$\nu$&lt;/span&gt;, of the t-distribution by equating the kurtosis of a sample of log returns with the &lt;strong&gt;kurtosis&lt;/strong&gt; of the t-distribution, which is &lt;span class=&quot;math-container&quot;&gt;$$k_\nu = \frac{3(\nu-2)}{(\nu-4)}.$$&lt;/span&gt; Alternatively, one could do the same thing with the &lt;strong&gt;variance&lt;/strong&gt;, which is given by &lt;span class=&quot;math-container&quot;&gt;$$\sigma^2_\nu  = \frac{\nu}{(\nu-2)}.$$&lt;/span&gt; In general, the two procedures will not yield the same value for &lt;span class=&quot;math-container&quot;&gt;$\nu$&lt;/span&gt;. Which is better? Or should one take a GMM approach?&lt;/li&gt;&#xA;&lt;li&gt;My second concern involves scaling. It is often suggested that when simulating stock prices using a t-distribution, one should &lt;strong&gt;scale the sample volatility&lt;/strong&gt; by &lt;span class=&quot;math-container&quot;&gt;$\sqrt{\frac{(\nu-2)}{\nu}}$&lt;/span&gt;. I have found that this scaling can produce a density which (although fatter tailed) is more peaked than the normally distributed returns for the same sample. This seems wrong.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="20544" LastEditorUserId="41390" LastEditDate="2020-11-18T00:00:40.903" LastActivityDate="2020-11-18T00:00:40.903" Title="Simulating t-distributed returns by calibrating degrees of freedom $\nu$ from variance or kurtosis" Tags="&lt;statistics&gt;&lt;simulations&gt;&lt;calibration&gt;&lt;distribution&gt;&lt;parameter-estimation&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="25734" PostTypeId="2" ParentId="25729" CreationDate="2016-04-30T08:48:15.067" Score="1" Body="&lt;p&gt;Equations (1) to (3) are correct. Your investment strategy is then, $\forall t &amp;gt; 0$&#xA;$$ X_t = \theta _ t S_t $$&#xA;Provided you use this strategy as part of &lt;strong&gt;self-financing&lt;/strong&gt; portfolio you can write the P&amp;amp;L over an infinitesimal time interval as&#xA;$$ dV_t = \theta_ t dS_t $$&#xA;assuming zero safe rate, i.e. that any cash required to finance your long stock position (resp. cash received when you are short) does not cost you (resp. earn you) anything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So that the total P&amp;amp;L over $[0,T] $ reads $V_T = \int_0^T dV_t $ or equivalently:&#xA;$$ V_T = V_0 + \int_0^T \theta_ t dS_t $$ which is equation (4). As you indicate going from (4) to (5) is simply integration by parts. Apply Ito to $\theta_ t S_t$ to obtain&#xA;$$ d (\theta_ t S_t) = \theta_ t dS_t +  d\theta_ t S_t $$&#xA;because $\theta_ t$ has finite variation. Now integrate on both sides and rearrange terms to end up with&#xA;$$ \int_0^T \theta_ t dS_t = (\theta_T S_T - \theta_0 S_0) + \int_0^T  S_t d\theta_ t$$&#xA;Hence the final wealth &#xA;$$ V_T = V_0 + \int_0^T \theta_ t dS_t $$&#xA;can be re-written (noting that $V_0 = \theta_0 S_0$) &#xA;$$ V_T = \theta_T S_T + \int_0^T  S_t d\theta_ t $$&#xA;thanks to integration by parts. &lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-05-01T09:07:57.770" LastActivityDate="2016-05-01T09:07:57.770" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25735" PostTypeId="2" ParentId="4723" CreationDate="2016-04-30T10:08:08.663" Score="0" Body="&lt;p&gt;For all practical purpose you may want to take a look at the PortfolioAttribution code here: &lt;a href=&quot;https://github.com/R-Finance/PortfolioAttribution&quot; rel=&quot;nofollow&quot;&gt;https://github.com/R-Finance/PortfolioAttribution&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="7186" LastActivityDate="2016-04-30T10:08:08.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25736" PostTypeId="1" CreationDate="2016-04-30T18:01:13.890" Score="0" ViewCount="357" Body="&lt;p&gt;I don't know how the accounting works for short selling with collateral:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example if a stock is \$10 a share and turn out to be $15 a share a week later.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At time 0, you borrow and sell 10 shares and get total proceeds $100 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If collateral requirement is 50%: you have to keep $50 in the bank, and any potential losses are deducted from there first. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A week later, your position is worth 10 * $15 = $150. If you close, you have net loss \$100 + -\$150 = -$50&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically wipe out your collateral account entirely, \$50-$50=0 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you still take home $50 which you got from the original sale but weren't required to put into the collateral account.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Doesn't this show you still take home positive amount of money, where as if there was no collateral accounting: &#xA;very clearly you sold for \$100 and bought for $150, so your loss is very clear. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For shorting with collateral it appears you still have $50... very confused.  &lt;/p&gt;&#xA;" OwnerUserId="20550" LastEditorUserId="20454" LastEditDate="2017-10-09T15:43:00.630" LastActivityDate="2017-10-09T15:43:00.630" Title="short selling with collateral accounting" Tags="&lt;finance&gt;&lt;short-selling&gt;&lt;accounting&gt;&lt;collateral&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25739" PostTypeId="1" CreationDate="2016-04-30T20:42:29.633" Score="2" ViewCount="145" Body="&lt;p&gt;I have a set of economic scenarios simulated with Barrie and Hibbert ESG. The stochastic model for interest rates used is Libor Market Model Shifted. I am facing a problem with zeros-coupons prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed, I have for each maturity: 2,000 forward prices(in 1 year to 30 years) trajectories of zeros-coupons. I have the following maturities (1; 2; 3; 5; 8; 10; 15; 20; 30; 40; 50; 60) for each forward price but I want the maturities of 1 to 30 with an annual pace. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I cannot regenerate the scenarios: I have to work with this simulations and I don't have swaptions prices used to calibrate the model.&#xA;So I have to interpolate the missing maturities throughout 2000 trajectories. Considering that I have to project in risk neutral world, zero coupon prices are martingale seen in $t = 0$: $E[B(t,T)D_t|\mathcal{F}_0]=B(0,t+T)$ with :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$B(t,T)$: the price seen in t of zero-coupon bond with maturity T.&lt;/li&gt;&#xA;&lt;li&gt;$D_t$: the deflator to calculate the present value of a cash-flow in t.&lt;/li&gt;&#xA;&lt;li&gt;$\mathcal{F}_0$: the filtration(the information in $t=0$)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So I can not make cubic interpolation without considering the fact that the price interpolated must be martingale in all trajectories in expectation (the mean). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What can you propose to me in order to interpolate zeros-coupon prices for missing maturities so that the interpolated prices are still martingale.&lt;/p&gt;&#xA;" OwnerUserId="20554" LastEditorUserId="20555" LastEditDate="2016-05-03T05:34:47.747" LastActivityDate="2016-05-03T05:34:47.747" Title="Interpolation of forward zeros-coupons bonds simulations for missing maturities (ESG data)" Tags="&lt;interest-rates&gt;&lt;risk-neutral-measure&gt;&lt;forward-rate&gt;&lt;interpolation&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25740" PostTypeId="2" ParentId="25728" CreationDate="2016-05-01T00:41:19.233" Score="1" Body="&lt;p&gt;What you learn in school are models, meant to illustrate the concepts and methods of the field. Later you will learn about other forms of utility functions (power utility most prominently). With such families of utility functions the computations aren't as clean as with quadratic utility, but by then you will have understood the concepts and methods, and you will understand the approximate methods that you will need to use at that stage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With that said, Markowitz tried, in a few papers, to explain why approximating one's utility function by a quadratic utility function makes sense in some cases. Not very convincing in my opinion, but it's out there.&lt;/p&gt;&#xA;" OwnerUserId="20429" LastActivityDate="2016-05-01T00:41:19.233" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="25742" PostTypeId="1" AcceptedAnswerId="25746" CreationDate="2016-05-01T10:32:49.037" Score="3" ViewCount="759" Body="&lt;p&gt;The exchange rate between a domestic currency money market and a foreign currency money market can be expressed as&#xA;$$&#xA;dQ(t) = (r_d - r_f)Q(t)dt + \sigma Q(t)d\tilde{W}(t)&#xA;$$&#xA;where $r_d$ is the interest rate for the domestic market, and $r_f$ for foreign.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my head, I believe that the exchange rate should decrease when the domestic interest rate goes up, indicating the domestic currency is strengthening. For example if the Fed were to increase rates, then $EUR/USD$ should decrease, given that the ECB doesn't do much. So, if $EUR/USD$ was 1.14 yesterday, it should be below 1.14 today.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To my understanding, the SDE for $Q(t)$ doesn't seem to reflect this fact. It seems that $Q(t)$ would increase if $r_d$ were to go up. I would like to resolve this contradiction, so any help would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="19502" LastActivityDate="2018-11-16T09:31:35.537" Title="The relation between exchange rate SDE and respective interest rates" Tags="&lt;stochastic-processes&gt;&lt;fx&gt;&lt;numerairechange&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25744" PostTypeId="1" CreationDate="2016-05-01T12:16:53.690" Score="0" ViewCount="654" Body="&lt;p&gt;I am having problems with computing zero-coupon bond prices. The question is the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Today is $t$=14.4.2016 and I know dirty and clean prices of coupon bonds expiring at maturities: 4.7.2016, 4.7.2017, 4.7.2018,4.7.2019, 4.7.2020,4.7.2021. Coupons are paid annually on the date of maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can we determine the term structure of zero-coupon bond prices?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My idea is simply to apply the formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ P_{dirty}(t) = \sum_i^n c_i P(t,T_i)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Starting from the bond A expiring on the 4th July 2016, we should have &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P_{dirty}^A (t)=c^A P(t,4.7.2016)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;from which we can compute the first discount factor. Then, considering the other bonds, recursively, we should be able to compute them all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, employing these results and the method of least squares (assuming a parametric form of the term structure) we should be able to estimate the term structure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The issue is that the discount factors $P(t,T_i)$ turn out to be bigger than $1$, which impossible. Can you help me?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the formula above correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can provide you with all the numerical values, if you need them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much for any help you can provide!!&lt;/p&gt;&#xA;" OwnerUserId="18180" LastActivityDate="2016-05-01T14:22:24.843" Title="How can I compute zero coupon bond prices from dirty/clean prices of coupon bonds?" Tags="&lt;fixed-income&gt;&lt;bond&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25745" PostTypeId="2" ParentId="25742" CreationDate="2016-05-01T13:06:45.720" Score="1" Body="&lt;p&gt;The dynamics for the exchange rate $Q$ that converts one unit foreign currency  to units of domestic currency is given by&#xA;\begin{align*}&#xA;dQ(t) = Q(t)\big[(r_d-r_f)dt + \sigma dW_t \big],&#xA;\end{align*}&#xA;where $r_d$ and $r_f$ are, respectively, the domestic and foreign interest rates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your example, the exchange rate EUR/USD is to convert on unit EUR to units of USD. Here, EUR is the foreign currency, and USD is the domestic currency. If the US Fed raises the USD interest rate, $r_d$, while there is no change in ECB for the EUR interest rate $r_f$, then $Q(t)$ will increase. There is no contradiction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You confusion may be caused by the notation EUR/USD, where you might have treated the US Fed rate as $r_f$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-05-01T13:39:10.270" LastActivityDate="2016-05-01T13:39:10.270" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25746" PostTypeId="2" ParentId="25742" CreationDate="2016-05-01T14:18:49.497" Score="2" Body="&lt;p&gt;I think you are right.   The SDE does not attempt to describe the dynamics of the spot exchange rate with respect to random changes in interest rates.  Rather, it describes the evolution of the FX rate as a drift term proportional to the rate differential, plus a random term.  Specifically, it says that if domestic rates go up, the rate at which the foreign currency strengthens in the forward market, &lt;strong&gt;relative to spot&lt;/strong&gt;, goes up.  It doesn't say anything about what happens to the spot FX rate in this situation.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-05-01T14:18:49.497" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25747" PostTypeId="2" ParentId="25744" CreationDate="2016-05-01T14:22:24.843" Score="2" Body="&lt;p&gt;Discount factors&gt;1 is not impossible.  It just means that rates are negative, which is indeed the case in several Government bond markets in Europe.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-05-01T14:22:24.843" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25748" PostTypeId="2" ParentId="25736" CreationDate="2016-05-01T14:32:32.377" Score="1" Body="&lt;p&gt;Surely you have to keep $150 in your account against the short sale, all of which you lose on the close out.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-05-01T14:32:32.377" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="25749" PostTypeId="2" ParentId="25701" CreationDate="2016-05-01T14:37:33.067" Score="1" Body="&lt;p&gt;When you say 'overprice'  I assume you mean model price &gt; market price.  In my experience this is true for all reasonable models.  It's due to excessive supply of the Bermudan structure in the market.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-05-01T14:37:33.067" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25750" PostTypeId="1" AcceptedAnswerId="25756" CreationDate="2016-05-01T17:12:24.147" Score="0" ViewCount="95" Body="&lt;p&gt;As part of an Asset Pricing Module I'm currently taking, whilst looking at APT Ross (1974), we looked at how according to this model, risk originates from both systematic and idiosyncratic asset specific sources.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We first considered an N asset portfolio with &lt;strong&gt;equal weights&lt;/strong&gt; to show how increasing N assets decreases the idiosyncratic (eP - here i am calling it the residual error term e of the portfolio P) residual variances:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Var(e) = (1/N)*(Average Sigma e)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is clear to see that as N increases, the Variance of e decreases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, my question is for the case where N asset are held, &lt;strong&gt;but not in equal proportions&lt;/strong&gt;. We end up with the following expression for the Var(eP):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Var(eP) = [(Summation from i=1 to N) (wi)^2 * (Sigma ei)] + All Covariance Terms&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From our assumptions at the outset, idiosyncratic risks of say asset i don't affect asset j, so all the second terms from the above equation equal 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question, in the below equation where wi is equal to the weight of asset i:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Var(eP) = [(Summation from i=1 to N) (wi)^2 * (Sigma ei)] &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can we see here that increasing N reduces idiosyncratic risk?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="20531" LastActivityDate="2016-05-01T23:34:02.317" Title="Mathematically: How does increasing the number of assets reduce idiosyncratic risk?" Tags="&lt;asset-pricing&gt;&lt;no-arbitrage-theory&gt;&lt;asset&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25753" PostTypeId="1" AcceptedAnswerId="25798" CreationDate="2016-05-01T19:44:15.807" Score="2" ViewCount="225" Body="&lt;p&gt;Probably a newbie question, but what do traders mean when they say that an option strategy is leveraged ? And when can we say that it is the case ?&lt;/p&gt;&#xA;" OwnerUserId="19693" LastActivityDate="2016-10-01T18:05:14.927" Title="What does it mean for an option strategy to be leveraged" Tags="&lt;option-strategies&gt;&lt;leverage&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25754" PostTypeId="1" CreationDate="2016-05-01T21:32:16.553" Score="4" ViewCount="246" Body="&lt;p&gt;Let ${(I_t)}_{t\geq 0}$ be a stochastic integral defined by&#xA;$$&#xA;I_t=\int_{0}^{t}\theta_sdW_t, &#xA;$$&#xA;where $W$ is a standard Brownian motion defined on $(\Omega,\mathcal{F},{(\mathcal{F}_t)}_{t\geq 0},\mathbb{P})$ and $\theta$ a stochastic process adapted to $\mathcal{F}_t$ satisfying the follows condition of integrability&#xA;$$&#xA;E\left(\int_{0}^{t}\theta_s^2 ds\right)&amp;lt;\infty\;\;\  \forall t&amp;gt; 0.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We define the first passage time at $a$ for Brownian motion $W$ by the following random variable&#xA;$$&#xA;\tau_a = \inf\{t\geq 0,W_t\geq a\},&#xA;$$&#xA;where $a&amp;gt;0$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is possible to show that $\tau_a$ is a stopping time. Moreover, By virtue of the reflection principle, we know that the following process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation*}&#xA;Z_t =&#xA;\begin{cases}&#xA;W_t 			 \qquad &amp;amp; if \qquad 0 \leq t \leq \tau_a \\&#xA;2a-W_t           \qquad &amp;amp; if \qquad   t &amp;gt; \tau_a&#xA;\end{cases}&#xA;\end{equation*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;also follows a standard Brownian motion under $\mathbb{P}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is as follows :&#xA;Is it possible to rewrite the process $I$ in relation to the process $Z$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like your opinion on this issue, thank you in advance.&lt;/p&gt;&#xA;" OwnerUserId="20360" LastActivityDate="2016-08-30T13:13:25.427" Title="On the reflection of a stochastic integral" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;&lt;wienerprocess&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25756" PostTypeId="2" ParentId="25750" CreationDate="2016-05-01T23:34:02.317" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;APT assumes that idiosyncratic risk is zero on average: $E[e_i]=0$.&lt;/li&gt;&#xA;&lt;li&gt;The law of large numbers.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;From 1 and 2 it follows that as N increases, the weighted sum of idiosyncratic risks will converge to zero:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\lim\limits_{N\to\infty}\sum\limits_{i=1}^N e_p=\lim\limits_{N\to\infty}\sum\limits_{i=1}^N w_ie_i=0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Strictly speaking some restrictions on the weights would be needed in case the weights are unequal to $\frac{1}{N}$ (see &lt;a href=&quot;https://math.stackexchange.com/questions/474008/law-of-large-numbers-with-weights&quot;&gt;this&lt;/a&gt; for example), but the above is what it comes down to.&lt;/p&gt;&#xA;" OwnerUserId="19775" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2016-05-01T23:34:02.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25757" PostTypeId="1" CreationDate="2016-05-02T02:12:01.583" Score="2" ViewCount="126" Body="&lt;p&gt;Say I have a portfolio of expected return $10\%$ and volatility $20\%$. If I have another asset that is either one of:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Negatively correlated&lt;/li&gt;&#xA;&lt;li&gt;Positively correlated&lt;/li&gt;&#xA;&lt;li&gt;Uncorrelated&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;With negative expected return $\mu &amp;lt; 0$ and volatility $\sigma$. From intuition, I think that if we are allowed to use leverage, we should be adding this to portfolio under scenarios 1 and 3 to reduce risk (and apply leverage to achieve desire rate of return). Is this true? How would I size this position if I want to target $10\%$? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this scenario similar to the case of shorting one asset and buying another that are positively correlated to each other? In both instances (long/short positively correlated or long/long negatively.. or zero correlated), they should be risk reducing. And if we're allowed to use leverage we should be ale to achieve target return at lower risk? Though this also depends on the bounds of expected return and correlation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, is it ever smart to add something with negative expected value to a portfolio depending on its correlation to the portfolio?&lt;/p&gt;&#xA;" OwnerUserId="20450" LastEditorUserId="22237" LastEditDate="2016-09-22T07:56:27.760" LastActivityDate="2016-12-21T11:04:16.597" Title="Adding negative EV position to portfolio for diversification?" Tags="&lt;risk&gt;&lt;correlation&gt;&lt;sharpe-ratio&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25758" PostTypeId="1" CreationDate="2016-05-02T02:26:30.970" Score="0" ViewCount="57" Body="&lt;p&gt;Say I have a portfolio of 3 stocks $A,B,C$ with $\mu_A = 5%$, $\mu_B = 10%$, $\mu_C = 15%$ and volatility $\sigma_A = 10%$, $\sigma_B = 15%$, and $\sigma_C = 25%$. Let us also say that correlations are $\rho_{AC} = 0.7$, $\rho_{AB} = 0.3$, and $\rho_{BC} = -0.1$. Say total portfolio value is 1 and it is composed of $A,B,C$ equally by value. How would I calculate the corresponding risk exposure that I have to each of the three underlying securities?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Portfolio $\mu_{total} = \frac{1}{3} \times \mu_A + \frac{1}{3} \times \mu_B + \frac{1}{3} \times \mu_C$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Portfolio $\sigma_{total} = \sqrt{\frac{1}{9}(\sigma_A^2+\sigma_B^2+\sigma_C^2 + 2\rho_{AC}\sigma_A\sigma_C+2\rho_{AB}\sigma_A\sigma_B+2\rho_{BC}\sigma_B\sigma_C)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would you divide up $\sigma_{total}$ or is it not possible?&lt;/p&gt;&#xA;" OwnerUserId="20450" LastEditorUserId="9501" LastEditDate="2016-05-02T08:05:05.350" LastActivityDate="2016-05-02T08:05:05.350" Title="How to determine portion of portfolio's risks from components?" Tags="&lt;risk&gt;&lt;modern-portfolio-theory&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25759" PostTypeId="1" CreationDate="2016-05-02T02:36:51.437" Score="2" ViewCount="177" Body="&lt;p&gt;We are working under complex enough distributed trading system where several components will run on different physical machines. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, I'm stuck on part backtesting part. Originally we was planning to use tick as synchronization marker. Idea was working till we not added more complicated interaction logic when components started to interact with each other with back loop. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm sure that this problem was solved many times before and dont want to reinvent the wheel... Can anybody share at least basic information about topic?&lt;/p&gt;&#xA;" OwnerUserId="19909" LastActivityDate="2016-05-03T00:09:12.547" Title="Need advice about distributed backtesting architecture" Tags="&lt;backtesting&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2016-05-04T11:01:54.453" ContentLicense="CC BY-SA 3.0" />
  <row Id="25762" PostTypeId="1" AcceptedAnswerId="25764" CreationDate="2016-05-02T07:26:54.213" Score="4" ViewCount="1273" Body="&lt;p&gt;Suppose we have a risk-neutral measure $\tilde{\mathbb{P}}$. The money market account is given as $M(t) = e^{\int^t_0 R(s) ds}$, while the price of the zero-coupon bond at time $t$ that matures at $T$ is denoted $B(t,T)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, the forward measure is defined to be the measure with $B(t,T)$ taken as the numeraire. However, I am curious if taking $M(t)$ will also make the measure into a forward measure. If this is not true in general, does it work when the interest rate is constant as $R(t) = r$? This would imply that $B(t,T) = e^{r(T-t)}$, and $B(0,T) = \frac{1}{M(T)}$ and $B(T,T) = \frac{1}{M(0)}$, which seems to imply somewhat of a connection between the two measures just by looking at the Radon-Nikodym derivative, $\mathbb{Z}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I have an additional question about the usefulness of the forward measure. It seems that forward measures are useful in options pricing because we can take the discount out for the risk-neutral pricing formula so that $V(t) = D(t) \tilde{\mathbb{E}}^F[V(T) | {\cal{F}}(t)]$. But are there any other advantages of using the forward measure?&lt;/p&gt;&#xA;" OwnerUserId="19502" LastActivityDate="2016-05-02T19:44:29.850" Title="Is the money market account (MMA) numeraire and the forward measure equivalent?" Tags="&lt;numerairechange&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25763" PostTypeId="2" ParentId="25758" CreationDate="2016-05-02T08:02:50.680" Score="2" Body="&lt;p&gt;You can do 2 things:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;incremental risk:&#xA;Calculate the volatility with the asset and with the asset replaced by cash. The difference gives you the (non-linear) incremental risk contribution of the asset. They don't sum up to $\sigma$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;contributions to volatility (Euler allocation)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;As $\sigma = \sigma^2/\sigma$ you can define risk contributions by &#xA;$$&#xA;\frac{w_i cov(r_i,r)}{\sigma},&#xA;$$&#xA;where $w_i$ is the weight of asset $i$, $r_i$ is its return (as a random variable) and $r$ is the portfolio return (with the asset $i$ weighted by $w_i$).&#xA;If you add these quantities:&#xA;$$&#xA;\sum_{i=1 }^n \frac{w_i cov(r_i,r)}{\sigma} =  \frac{\sum_{i=1 }^n w_i cov(r_i,r)}{\sigma} = \frac{cov(\sum_{i=1 }^n w_i r_i,r)}{\sigma} = \sigma^2/\sigma = \sigma.&#xA;$$&#xA;This can also be seen as $w_i \frac{\partial \sigma}{\partial w_i}$ where&#xA;$\frac{\partial \sigma}{\partial w_i}$ is called the marginal contribution to volatility.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-05-02T08:02:50.680" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25764" PostTypeId="2" ParentId="25762" CreationDate="2016-05-02T08:30:57.157" Score="3" Body="&lt;p&gt;Your questions are nicely addressed in this short paper by Fabrice Rouah: &lt;a href=&quot;http://www.frouah.com/finance%20notes/The%20T-Forward%20Measure.pdf&quot; rel=&quot;nofollow&quot;&gt;The T-forward measure&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;More specifically, using your notations and noting that $B(T,T)=1$ by definition, the change of measure between the $T$-forward ($\mathbb{Q}^B$) and risk-neutral ($\mathbb{Q}^M$) measures is characterised by the following Radon-Nikodym derivative:&#xA;$$\left. \frac{d \mathbb{Q}^B}{d \mathbb{Q}^M } \right\vert_{\mathcal{F}_t} = \frac{M(t)B(T,T)}{M(T)B(t,T)} = \frac{M_t}{M_T}\frac{1}{B(t,T)} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet, by construction of the martingale measure $\mathbb{Q}^M$, the following relationship for the price of a zero-coupon bond prevails &#xA;\begin{align}&#xA;\frac{B(t,T)}{M_t} &amp;amp;= E^{\mathbb{Q}^M}_t\left[ \frac{B(T,T)}{M_T} \right] \\&#xA;B(t,T) &amp;amp;= E^{\mathbb{Q}^M}_t\left[ \frac{B(T,T) M_t}{M_T} \right] \\&#xA;B(t,T) &amp;amp;= E^{\mathbb{Q}^M}_t\left[ \frac{M_t}{M_T} \right] &#xA;\end{align}&#xA;where I have used the notation $E_t[.]$ to represent $E[.\vert\mathcal{F}_t]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Plugging the above result in the expression of the Radon-Nikodym derivative gives:&#xA;$$ \left. \frac{d \mathbb{Q}^B}{d \mathbb{Q}^M } \right\vert_{\mathcal{F}_t} = \frac{M_t}{M_T}\frac{1}{B(t,T)} = \frac{M_t}{M_T}\frac{1}{E^{\mathbb{Q}^M}_t\left[ M_t/M_T \right]} = \frac{1/M_T}{E^{\mathbb{Q}^M}_t\left[ 1/M_T \right]}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When &lt;strong&gt;interest rates are deterministic&lt;/strong&gt;, then&#xA;$$ E^{\mathbb{Q}^M}_t\left[ \frac{1}{M_T} \right] = \frac{1}{M_T} $$&#xA;and &#xA;$$ \left. \frac{d \mathbb{Q}^B}{d \mathbb{Q}^M } \right\vert_{\mathcal{F}_t}   = 1 $$&#xA;such that the measures $\mathbb{Q}^B$ and $\mathbb{Q}^M$ are perfectly equivalent. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &lt;strong&gt;stochastic interest rates&lt;/strong&gt;, this is not true any more.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-05-02T11:49:14.447" LastActivityDate="2016-05-02T11:49:14.447" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25765" PostTypeId="1" CreationDate="2016-05-02T09:47:00.393" Score="1" ViewCount="1056" Body="&lt;p&gt;Can somebody explain me if the Rebonato swaption volatility approximation formula is accurate for &lt;em&gt;only&lt;/em&gt; ATM strikes, and if yes why? Can it also be used for ITM and OTM strikes?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My foundings:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $0 &amp;lt; T_0 &amp;lt; T_1 &amp;lt; \ldots &amp;lt; T_N$ be a tenor structure. Consider a payer swaption that gives the right to enter into a payer interest rate swap at $T_0$ with payments of both the floating and the fixed leg on $T_1,\ldots,T_N$. The fixed rate is set to $K$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have implemented the Rebonato swaption volatility approximation formula in Matlab as&#xA;$$\upsilon^{REB}= \sqrt{\frac{\sum_{n=0}^{N-1}\sum_{k=0}^{N-1}w_n\left(0\right)w_k\left(0\right)L_n\left(0\right)L_k\left(0\right)\rho_{n,k}\int_0^{T_0}\sigma_n\left(t\right)\sigma_k\left(t\right)dt}{SwapRate\left(0\right)^2}}\\&#xA;=\sqrt{\frac{\sum_{n=0}^{N-1}\sum_{k=0}^{N-1}w_n\left(0\right)w_k\left(0\right)L_n\left(0\right)L_k\left(0\right)\rho_{n,k}\int_0^{T_0}\sigma_n\left(t\right)\sigma_k\left(t\right)dt}{\sum_{n=0}^{N-1}w_n\left(0\right)L_n\left(0\right)}},$$&#xA;where $L_n\left(0\right):=L\left(0;T_n,T_{n+1}\right)$ represent the initial Libor curve and $w_n\left(0\right)$ are the weights defined as&#xA;$$w_n\left(t\right) = \frac{\tau_n P\left(t,T_{n+1}\right)}{\sum_{r=0}^{N-1} \tau_r P\left(t,T_{r+1}\right)},$$&lt;br&gt;&#xA;with $\tau_n =T_{n+1}-T_n$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The instantaneous volatilities $\sigma_n\left(t\right)$ are given by the following parametrization;&#xA;$$\sigma_n\left(t\right) = \phi_n\left(a+b\left(T_n-t\right)\right)e^{-c\left(T_n-t\right)}+d.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get the swaption price at time $0$, I have used this swaption approximation as an input in Black's forumla;&#xA;$$V_{swaption}\left(0\right) = Black\left(K,SwapRate\left(0\right),\upsilon^{REB}\right)\\&#xA;=Black\left(K,\sum_{n=0}^{N-1}w_n\left(0\right)L_n\left(0\right),\upsilon^{REB}\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to access the accuracy of the Rebonato approximation formula I have compared the prices of various swaptions obtained by plugging the approximation volatility in Black (as above) and the prices obtained by a Monte Carlo evaluation doing 1000000 simulations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was particularly interested in the accuracy among different strikes $K$. To illustrate this, consider the 4Y10Y swaption and its corresponding ATM , ATM+1%, ATM+2% and ATM+3% strikes (ATM strike is $K=SwapRate\left(0\right)$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My foundings were that as you move further away from the ATM strike, the approximation gets worse (difference between Monte Carlo price and price with Rebonato swaption approx volatility increases). In concrete numbers, the difference for ATM strike is 9 bp and for ATM+3% 36 bp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have searched in the literature for an explanation, but cannot find any. As far as I have understood, no assumptions evolving the strike are made in deriving the Rebonato formula. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Brigo and Mercurio also perform an accuracy test of the Rebonato formula in their book 'Interest Rate Models - Theory and Practice', namely:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;The results are based on a comparision of Rebonato's formula with the volatilities that plugged into Black's formula lead to the Monte Carlo prices of the corresponding at-the-money swaptions. &quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, Jäckel and Rebonato analyze in their paper 'Linking Caplet and Swaption Volatilities in a BGM/J Framework: Approximate Solutions' how well the approximation performs by comparing the ATM swaption prices obtained by the Rebonato volatility and the Monte Carlo ATM prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it coincidence that I only can find results for ATM swaptions or does Rebonato's swaption volatility approximation formula really not perform well for ITM and OTM swaptions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help is appreciated. Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="19279" LastEditorUserId="19279" LastEditDate="2016-05-02T09:55:13.863" LastActivityDate="2016-05-12T18:27:05.843" Title="Accuracy Rebonato Swaption Approximation Formula among Different Strikes" Tags="&lt;option-pricing&gt;&lt;volatility&gt;&lt;interest-rates&gt;&lt;monte-carlo&gt;&lt;swaption&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25767" PostTypeId="1" AcceptedAnswerId="25771" CreationDate="2016-05-02T11:18:10.343" Score="7" ViewCount="232" Body="&lt;p&gt;I don't know whether this question is in order here. I do a bit of teaching and I am preparing my own notes but I thought that his should not be necessary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In which book/pdf on the web can we find a basic but rigorous treatment of the notions&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;return (log,geometric)&lt;/li&gt;&#xA;&lt;li&gt;expected return (arithmetic/geometric)&lt;/li&gt;&#xA;&lt;li&gt;volatility (annualizing, ...)&lt;/li&gt;&#xA;&lt;li&gt;Sharpe ratio&lt;/li&gt;&#xA;&lt;li&gt;maybe more (e.g. draw down)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;both in the case of one asset and in the portfolio setting (where matrix algebra can be applied).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would love to have this one paper from the net that containes this short intro. It would answer 10% of the questions posted here too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it is not on the web - let us write it ;)&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="467" LastEditDate="2016-05-03T10:03:41.610" LastActivityDate="2018-01-20T05:21:20.217" Title="Where to find good notations to teach investment portfolio maths?" Tags="&lt;risk&gt;&lt;portfolio&gt;&lt;reference-request&gt;&lt;expected-return&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25768" PostTypeId="1" CreationDate="2016-05-02T11:52:20.463" Score="1" ViewCount="592" Body="&lt;p&gt;For my thesis I first need to examine nine financial time series and fit a conditional volatility model such that the obtained standardized residuals ($z_t = \epsilon_t / \sigma_t$) are &lt;em&gt;approximately iid&lt;/em&gt; with mean 0 and variance 1. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whereas GARCH(1,1) succeeds in delivering iid standardized residuals for five of these series, and GJR-GARCH(1,1) achieves iid standardized residuals for other two series, I've not been able to get &lt;em&gt;iid $z_t$&lt;/em&gt; for the remaining two series using GARCH, GJRGARCH, ThresholdGARCH, EGARCH, NAGARCH and CSGARCH.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I shared my results with my thesis supervisor, he said I've probably done something wrong since GARCH, GJRGARCH and ThresholdGARCH usually succeed wrt this goal. The problem is I don't understand what I could have done wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The mentioned series are three SPDR ETFs (XLF and XLU). Closing prices can be found here (this is my first question, so I'm sorry if this isn't the way you're supposed to share data):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;XLF: &lt;a href=&quot;http://real-chart.finance.yahoo.com/table.csv?s=XLF&amp;amp;a=11&amp;amp;b=22&amp;amp;c=1998&amp;amp;d=02&amp;amp;e=31&amp;amp;f=2016&amp;amp;g=d&amp;amp;ignore=.csv&quot; rel=&quot;nofollow&quot;&gt;http://real-chart.finance.yahoo.com/table.csv?s=XLF&amp;amp;a=11&amp;amp;b=22&amp;amp;c=1998&amp;amp;d=02&amp;amp;e=31&amp;amp;f=2016&amp;amp;g=d&amp;amp;ignore=.csv&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;XLU: &lt;a href=&quot;http://real-chart.finance.yahoo.com/table.csv?s=XLU&amp;amp;a=11&amp;amp;b=22&amp;amp;c=1998&amp;amp;d=02&amp;amp;e=31&amp;amp;f=2016&amp;amp;g=d&amp;amp;ignore=.csv&quot; rel=&quot;nofollow&quot;&gt;http://real-chart.finance.yahoo.com/table.csv?s=XLU&amp;amp;a=11&amp;amp;b=22&amp;amp;c=1998&amp;amp;d=02&amp;amp;e=31&amp;amp;f=2016&amp;amp;g=d&amp;amp;ignore=.csv&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After obtaining log returns and demeaning them, I use the first 1766 observations to estimate all parameters and obtain standardized residuals. I then conduct ARCH tests on standardized residuals (at lags 1, 5, and 10), which for these two series reject homoscedasticity. Therefore I don't obtain iid residuals and can't go on with my analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be greatly appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: Is there any other test which is more adequate in testing iid residuals? I think I've read somewhere that, while most people still use ARCH tests on residuals, these are supposed to test raw data and should not be used for residuals.&lt;/p&gt;&#xA;" OwnerUserId="20573" LastActivityDate="2016-05-02T11:52:20.463" Title="How to choose a GARCH model which delivers iid standardized residuals?" Tags="&lt;volatility&gt;&lt;time-series&gt;&lt;garch&gt;&lt;stationarity&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25770" PostTypeId="2" ParentId="25433" CreationDate="2016-05-02T13:32:03.433" Score="1" Body="&lt;p&gt;Actually, it is depends where you want to trade and it is part of trading workflow of concrete counterparty. FIX protocol definition itself does not  force you to subscribe on anything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some brokerages forced you to subscribe on market data streams prior placing any trades. Last one we discovered - FXDD. &lt;/p&gt;&#xA;" OwnerUserId="19909" LastActivityDate="2016-05-02T13:32:03.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25771" PostTypeId="2" ParentId="25767" CreationDate="2016-05-02T13:36:09.270" Score="2" Body="&lt;p&gt;If I had to give only one title this would be it:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://books.google.de/books?id=ra9iAAAAQBAJ&amp;amp;printsec=frontcover#v=onepage&amp;amp;q&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;FT Guide to Understanding Finance by J. Estrada&lt;/a&gt; (Second Edition published 2011)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It explains all of the above concepts (and more) in a very accessible, yet mathematically correct manner.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A sample can be found: &lt;a href=&quot;http://ptgmedia.pearsoncmg.com/images/9780273738022/samplepages/027373802X.pdf&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only thing is that it is not really short (the first part, i.e. up to p. 150, is relevant here) but you can be sure that your students will understand those topics thoroughly afterwards!&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2016-05-02T13:44:41.100" LastActivityDate="2016-05-02T13:44:41.100" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25772" PostTypeId="1" CreationDate="2016-05-02T14:17:09.390" Score="0" ViewCount="151" Body="&lt;p&gt;Suppose I have the following stochastic integral:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\int_a^b f(t)dB_H(t)$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;with the term $dB_H(t)$ a fractional brownian motion with associated $H$ parameter. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it true that for $H \in (1/2,1)$, we have the following result?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\int_a^b f(t)dB_H(t) := \lim_{\Delta t_k \rightarrow0} \sum_k f(t_k)[(B_H(t_{k+1})-B_H(t_k)]$$&lt;/p&gt;&#xA;" OwnerUserId="20548" LastEditorUserId="20548" LastEditDate="2016-05-05T16:49:55.980" LastActivityDate="2016-05-30T09:23:40.317" Title="approximating fBm stochastic integral" Tags="&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25775" PostTypeId="1" AcceptedAnswerId="28422" CreationDate="2016-05-02T19:20:24.597" Score="7" ViewCount="4104" Body="&lt;p&gt;This question is about getting some clarification as to how to understand market quotes for normal &amp;amp; log-normal vols together with certain model assumptions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So let us define&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;$C_{BS}(F_0,K,T,\sigma,\beta)=\mathbb{E}[(F_T-K)^+]\quad \text{with}\quad dF_t=\sigma F_t^\beta dW_t$$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$C_{SABR}(F_0,K,T,\sigma_0,\beta,\nu,\rho)=\mathbb{E}[(F_T-K)^+]$&#xA;$$\text{with}\quad dF_t=\sigma_t F_t^\beta dW_t,\quad \sigma_t=\nu \sigma_t dZ_t,\quad dW_tdZ_t = \rho dt$$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;And for any given combination of $F_0,K,T,\sigma_0,\beta,\nu,\rho$ the SABR-implied vol $v_{SABR}$ is the quantity such that the following relationship holds&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C_{BS}(F_0,K,T,v_{SABR},1) = C_{SABR}(F_0,K,T,\sigma_0,\beta,\nu,\rho)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://www.math.ku.dk/~rolf/SABR.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.math.ku.dk/~rolf/SABR.pdf&lt;/a&gt; right-hand side of page 89.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let us assume that for a fixed expiry/tenor we are given a set of volatility market quotes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/cjvHD.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/cjvHD.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally, I want to calibrate the SABR model to it. So when I set $\beta=1$ and calibrate $\sigma_0,\nu,\rho$ to the log-normal vols, I get a very nice fit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/tPwUP.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/tPwUP.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I set $\beta=0$ and calibrate $\sigma_0,\nu,\rho$ to the normal vols, I get a very poor fit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/0BBvW.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/0BBvW.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;br&gt;&#xA;So I have two questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is my definition of the SABR vol $v_{SABR}$ correct? For example, would&#xA;$$C_{BS}(F_0,K,T,v_{SABR},\beta) = C_{SABR}(F_0,K,T,\sigma_0,\beta,\nu,\rho)$$&#xA;perhaps be more correct? Note that the difference here is the $\beta$ in $C_{BS}$ as opposed to having a 1 there.&lt;/li&gt;&#xA;&lt;li&gt;Is maybe my &lt;em&gt;normal vol&lt;/em&gt; market data of an &lt;em&gt;atypical&lt;/em&gt; shape causing SABR to only find a poor fit? Or is my SABR implementation faulty?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="6621" LastEditorUserId="18555" LastEditDate="2019-07-22T14:53:01.487" LastActivityDate="2019-07-22T14:53:01.487" Title="SABR Calibration: Normal vs Log-Normal Market Data" Tags="&lt;interest-rates&gt;&lt;implied-volatility&gt;&lt;stochastic-volatility&gt;&lt;swaption&gt;&lt;sabr&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="25776" PostTypeId="2" ParentId="25762" CreationDate="2016-05-02T19:44:29.850" Score="1" Body="&lt;p&gt;Maybe a minor detail, but it's not the discount factor that goes in front, but the bond price, so $$V(t)=P(t,T) \, E^{F}[V(T)|\mathcal{F}(t)].$$ &#xA;$P(T,T) = 1$ so this can be written as $$V(t)=P(t,T) \, E^{F}[V(T) / P(T,T)|\mathcal{F}(t)].$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Compare this with $$V(t) = B(t) \, E[V(T)/B(T)|\mathcal{F}(t)]$$ in the measure of the cash account.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have stochastic interest rates, $B(T)$ is a stochastic quantity. In a Monte Carlo simulation for example, you only have to simulate $V(T)$ in the case of the forward measure, but $V(T)$ and $B(T)$ in the cash measure. So replacing $B(T)$ with $P(T,T) = 1$ can be a very attractive thing.&lt;/p&gt;&#xA;" OwnerUserId="1739" LastActivityDate="2016-05-02T19:44:29.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25778" PostTypeId="1" AcceptedAnswerId="25779" CreationDate="2016-05-02T22:29:01.943" Score="1" ViewCount="327" Body="&lt;p&gt;I am using TAQ data to see from which exchanges bids (or asks) are coming.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have got this for AAPL (Apple company, listed in NASDAQ) for a sample day:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  A       B       J       K       M       P       T       X       Y       Z &#xA;11254  182724  235512  677745    250  1122911  948659  122697  334436  835227 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have got this for IBM (listed in NYSE):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  B     J     K      M     N     P     T     X     Y     Z &#xA;45374 29513 13930    73  38834 70716 87207 21052 49831 45161 &#xA;&#xA;# A - NYSE MKT Stock Exchange &#xA;# B - NASDAQ OMX BX Stock Exchange &#xA;# C - National Stock Exchange &#xA;# D - FINRA &#xA;# I - International Securities Exchange &#xA;# J - Direct Edge A Stock Exchange &#xA;# K - Direct Edge X Stock Exchange &#xA;#  M - Chicago Stock Exchange &#xA;#  N - New York Stock Exchange &#xA;#  T - NASDAQ OMX Stock Exchange &#xA;#  P - NYSE Arca SM &#xA;#  S - Consolidated Tape System &#xA;#  T/Q - NASDAQ Stock Exchange &#xA;#  W - CBOE Stock Exchange &#xA;#  X - NASDAQ OMX PSX Stock Exchange &#xA;#  Y - BATS Y-Exchange &#xA;#  Z - BATS Exchange&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is no symbol &lt;code&gt;N:New York Stock Exchange&lt;/code&gt;for Apple or any NASDAQ-listed company. Can't people trade NASDAQ listed at NYSE?&lt;/p&gt;&#xA;" OwnerUserId="20585" LastActivityDate="2017-07-23T19:53:36.423" Title="Why NYSE is not included in TAQ data for NASDAQ listed companies?" Tags="&lt;market-data&gt;&lt;historical-data&gt;&lt;market-microstructure&gt;&lt;tick-data&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25779" PostTypeId="2" ParentId="25778" CreationDate="2016-05-02T23:44:19.903" Score="2" Body="&lt;p&gt;There's a very simple explanation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The NYSE trading floor only deals in NYSE-listed stocks.  NYSE have other venues (such as Arca) that allow you to trade listings from other exchanges.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following site has a very good summary of &quot;tape&quot; versus the volume traded at each venue.&#xA;&lt;a href=&quot;https://www.batstrading.com/market_summary/&quot; rel=&quot;nofollow&quot;&gt;https://www.batstrading.com/market_summary/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that Tape B contains trades for listings on NYSE Mkt (formerly AMEX), NYSE Arca and listings from any other exchange.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your example, AAPL is a NASDAQ listing.  It typically does around 16% of its volume on NASDAQ and the rest across other exchanges/ECNs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By contrast GE is a NYSE listing and 32% of its volume is traded on NYSE.&lt;/p&gt;&#xA;" OwnerUserId="13859" LastActivityDate="2016-05-02T23:44:19.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25780" PostTypeId="2" ParentId="25759" CreationDate="2016-05-03T00:09:12.547" Score="0" Body="&lt;p&gt;In database-speak, this problem has been solved with things like two-phased commit. That's used in transaction (money) processing when the machines are separate and nothing can be lost. That design required a unique token (like your Tick would have) but generic (not a tick but your own creation).&#xA;The process is one machine says &quot;I'm ready to do 'A' if you are.&quot;  Machine B responds with an acknowledgment on that request token. Then an acceptance from A to B defines a Complete. If no answer from A or B along the way, the transaction is incomplete. A retry can happen.&#xA;The medium for making and sending tokens/requests is up to you. This is the conceptual design and helped make Oracle a fortune 500 company.&#xA;With JSON and various other post-SOAP era (REST and all the variations) web-service contracts, you can build a good infrastructure. The development language and tools will make it easy or hard for you. I made an asset/machine-tracking system (with Satellite and Cellular data) all built on similar concept. It supported REST and other formats for sending tokens (from my server to a satellite that talks to a fire-fighting pump). If it's a long chain, you need to build that into your design. You need to know what formats are super fast and survive interruptions at the proper layer: eg TCP vs UDP. Sounds like a fun project.&lt;/p&gt;&#xA;" OwnerUserId="20460" LastActivityDate="2016-05-03T00:09:12.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25781" PostTypeId="2" ParentId="25775" CreationDate="2016-05-03T02:55:34.343" Score="0" Body="&lt;p&gt;I think (1) is the issue.  You need to compare market normal vols to normal vols implied by the sabr model.  (2) is not the issue - these vols look reasonable.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way we express normal vols in bp per annum, not percent!&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-05-03T02:55:34.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25782" PostTypeId="1" CreationDate="2016-05-03T03:17:01.263" Score="0" ViewCount="391" Body="&lt;p&gt;I am trying to create a spreadsheet using the Quantlib xll to convert deposit/swap rates to zero rates. I tried to implement such by referencing to the C++ code listed here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/9397/how-to-sum-interest-rate-curves-in-quantlib&quot;&gt;How to sum interest rate curves in QuantLib&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I am stuck at combining the depositRateHelper and swapRateHelper into RateHelper, as far as I know Quantlib XL does no thave the RateHelper object and trying to create a piecewiseyieldcurve by simply combining all depositRateHelper and SwapRateHelper object would result in an error as PieceWiseYieldCurve fails to take DepositRateHelper object and convert to RateHelper object.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way I can explicitly convert the DespositRateHelper into RateHelper? Or in general, if there is an easier way that would take a range of tenors and rates (one block for deposit rates and one block for swap rates) to give me a PieceWiseYieldCurve object for me to obtain the zero rates? My only requirement is to use the original QuantlibXL and create that on a Excel spreadsheet. Unfortunately I think there is very little documentation online specifically for the XLL.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot!&lt;/p&gt;&#xA;" OwnerUserId="3595" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-05-03T03:17:01.263" Title="Quantlib xll - Converting deposit/swap curve to zero curve" Tags="&lt;quantlib&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25784" PostTypeId="2" ParentId="25767" CreationDate="2016-05-03T07:46:09.193" Score="3" Body="&lt;p&gt;&lt;strong&gt;Financial markets &amp;amp; Corporate Strategy - Grinblatt &amp;amp; Titman&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The book is very intuitive, but as a consequence less comprehensive than ex. Options, Futures, and other Derivatives by Hull (which is seen as the basic foundation of everything quant in some parts of the industry.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A great entry level book to finance, and is publically avaliable here:&#xA;&lt;a href=&quot;http://down.cenet.org.cn/upfile/10/2013410233155145.pdf&quot; rel=&quot;nofollow&quot;&gt;http://down.cenet.org.cn/upfile/10/2013410233155145.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20590" LastActivityDate="2016-05-03T07:46:09.193" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25785" PostTypeId="2" ParentId="25596" CreationDate="2016-05-03T07:59:35.850" Score="2" Body="&lt;p&gt;You need to estimate or assume a marginal distribution of the (u,v). Lets say you assume normality (don't do this), you would be able to perform a rosenblatt-transformation, to perform the task you describe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Inverse_transform_sampling&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Inverse_transform_sampling&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This could be a useful resource.&lt;/p&gt;&#xA;" OwnerUserId="20590" LastActivityDate="2016-05-03T07:59:35.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25787" PostTypeId="1" AcceptedAnswerId="25788" CreationDate="2016-05-03T10:33:00.057" Score="1" ViewCount="1226" Body="&lt;p&gt;Let's say I have two processes&#xA;$X_t =X_0 \exp((a-\frac{1}{2}\sigma_X^2)t +\sigma_X dW_t^1)$ and $Y_t=Y_0 \exp((b-\frac{1}{2}\sigma_Y^2)t +\sigma_Y dW_t^2)$ and I then multiply them together (like converting a foreign asset into domestic currency). I arrive at&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_tY_t = X_0Y_0 \exp((a+b-\frac{1}{2}\sigma_X^2-\frac{1}{2}\sigma_Y^2)t +\sigma_X dW_t^1+\sigma_Y dW_t^2)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I then assume the $W_t$ have a correlation of $\rho$, how would I obtain the expectation of $X_tY_t$. The thing that is troubling me is because I have 2 Brownian motions and I'm not sure how to compute from there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&#xA;I would like to make this question a little bit more general. What would I do if I wanted to compute $E[X_t Y_s]$, where say $s &amp;lt; t$. So something to do with independent increments would play a factor.&lt;/p&gt;&#xA;" OwnerUserId="19606" LastEditorUserId="19606" LastEditDate="2016-05-04T14:35:28.797" LastActivityDate="2016-05-04T14:35:28.797" Title="Quanto/Compo adjustments - Product of two geometric brownian motion" Tags="&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25788" PostTypeId="2" ParentId="25787" CreationDate="2016-05-03T11:14:25.040" Score="1" Body="&lt;p&gt;Just use the fact that &#xA;$$ \sigma_X W_t^1 + \sigma_Y W_t^2 = \sqrt{ \sigma_X^2 + \sigma_Y^2 + 2\rho\sigma_X\sigma_Y } W_t $$&#xA;holds in probability assuming that $W_t^1$ and $W_t^2$ are 2 correlated Brownian motions with&#xA;$$ d\langle W_t^1, W_t^2 \rangle_t = \rho dt $$&#xA;and $W_t$ is a new standard Brownian motion defined over the same probability space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simply put, just replace your sum of two correlated Gaussians (LHS above) by a single Gaussian (RHS above) exhibitting the exact same statistical properties (for a Gaussian identical mean/variance is enough). Doing so, you can now use the formulas you are accustomed to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Applying this shows&#xA;$$ X_t Y_t = X_0Y_0 \exp((a+b-\frac{1}{2}\sigma_X^2-\frac{1}{2}\sigma_Y^2)t +\sqrt{ \sigma_X^2 + \sigma_Y^2 + 2\rho\sigma_X\sigma_Y } W_t) $$&#xA;is lognormally distributed with mean &#xA;$$ \mu = \ln(X_0Y_0)+(a+b-\frac{1}{2}\sigma_X^2-\frac{1}{2}\sigma_Y^2)t $$&#xA;and variance&#xA;$$ \sigma^2 = (\sigma_X^2 + \sigma_Y^2 + 2\rho\sigma_X\sigma_Y)t $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;hence applying the usual formula for the mean of a lognormally distributed variable&#xA;$$ E[X_t Y_t] = e^{\mu + \sigma^2/2} $$&#xA;is a function of $\rho$.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Edit]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think you are completely mixing up two different problems (here two different probability measures).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand from your comment that you define the dynamics of the FOR/DOM instantaneous exchange rate $X_t$ (i.e. $X_t = x$ meaning that, at time $t$, 1 unit of foreign currency = x units of domestic currency) under the &lt;strong&gt;foreign risk-neutral measure $\mathbb{Q}^f$&lt;/strong&gt; (or rather the probability space $(\Omega,\mathcal{F},\mathbb{Q}^f)$ along with the price process of an equity underlying denominated in the foreign currency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In that case, under the &lt;strong&gt;domestic risk-neutral measure $\mathbb{Q}^d$&lt;/strong&gt; (or rather the probability space $(\Omega,\mathcal{F},\mathbb{Q}^d)$), one should have, by absence of arbitrage opportunities and assuming market completeness:&#xA;$$ \frac{Y_t X_t}{B_t^d} \text{ is a } \mathbb{Q}^d \text{- martingale} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $B^d_t$ representing the time-$t$ value of a risk-free money market account in the domestic economy in which 1 unit of currency has been invested at $t=0$. Using the martingale property it then entails that:&#xA;$$ \frac{Y_0 X_0}{B_0^d} = Y_0 X_0 = E^{\mathbb{Q}^d} \left[ \frac{Y_t X_t}{B_t^d} \vert \mathcal{F}_0 \right] $$&#xA;and further assuming deterministic rates:&#xA;$$ E ^{\mathbb{Q}^d} \left[ X_t Y_t \vert \mathcal{F}_0 \right] = e^{-r_d t}  X_0 Y_0 $$&#xA;which is independent of $\rho$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is known as a &lt;strong&gt;compo&lt;/strong&gt; adjustment in deriatives lingo.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That being said, &lt;strong&gt;under the measure $\mathbb{Q}^f$&lt;/strong&gt; where you have originally defined $X_t$ and $Y_t$, the &lt;strong&gt;expectation $E^{\mathbb{Q}^f} [ Y_t X_t ]$ does dependent on $\rho$ as hinted above&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More info on the quanto/compo change of measure technique &lt;a href=&quot;https://quant.stackexchange.com/questions/25797/girsanov-theorem-for-quanto-compo-adjustment&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-05-04T09:33:53.327" CommentCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="25789" PostTypeId="1" AcceptedAnswerId="25790" CreationDate="2016-05-03T11:15:48.317" Score="1" ViewCount="335" Body="&lt;p&gt;Can someone help me interpret this definition of delta? &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Delta is a conditional probability of terminal value (St) being greater than the Strike (X) given that St &gt; X for a call option.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Is the second part of the statement not completely redundant? This may be completely obvious, but I don't see why this is conditional.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The source of the definition is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Initially found here, where three definitions are given:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;a href=&quot;https://financetrainingcourse.com/education/2012/09/sales-trading-interview-guide-understanding-greeks-option-delta-and-gamma/&quot; rel=&quot;nofollow&quot;&gt;https://financetrainingcourse.com/education/2012/09/sales-trading-interview-guide-understanding-greeks-option-delta-and-gamma/&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Also in:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Farid (2015) - An Option Greeks Primer: Building Intuition with Delta Hedging and Monte Carlo Simulation in Excel.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="20592" LastEditorUserId="20592" LastEditDate="2016-05-03T11:34:41.890" LastActivityDate="2016-05-03T15:07:31.473" Title="Option delta - Conditional probability definition?" Tags="&lt;options&gt;&lt;probability&gt;&lt;delta&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25790" PostTypeId="2" ParentId="25789" CreationDate="2016-05-03T11:28:50.127" Score="3" Body="&lt;p&gt;IMHO the 'definition' you mention is not a mathematical definition &lt;em&gt;per se&lt;/em&gt;, but rather an approximation used by some practitioners.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mathematically, it is $N(d_2)$ in the BS formula which figures the conditional probability that the terminal asset price $S_T$ will finish above the strike level $X$ given the information we possess today (represented by $S_t$), and that, &lt;strong&gt;under a risk-neutral measure&lt;/strong&gt; which uses the risk-free money market account as numéraire. Omitting discounting, $N(d_2)$ is indeed the price of a binary or digital option assuming GBM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The delta (omitting dividend payments) is on the other hand given by $N(d_1)$ not $N(d_2)$. Only for extremely short time to maturity or low volatility can $d_1$ be approximated by $d_2$ and hence $\Delta$ be approximated by $N(d_2)$ (again assuming no divs). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still, we could also say that $\Delta$ corresponds to a probability of finishing in the money, but in &lt;strong&gt;an equivalent martingale measure which uses the asset itself as numéraire&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It therefore depends on the probability measure in which you are working/interpreting your results. In the sell-side we like to think in terms of risk-neutral probabilities (or binary options).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the definition of $d_1$ and $d_2$ &lt;a href=&quot;https://en.wikipedia.org/wiki/Greeks_(finance)&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; for instance.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-05-03T15:07:31.473" LastActivityDate="2016-05-03T15:07:31.473" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25793" PostTypeId="2" ParentId="25140" CreationDate="2016-05-03T12:55:22.783" Score="2" Body="&lt;p&gt;Take a look on &lt;a href=&quot;http://pocoproject.org/&quot; rel=&quot;nofollow&quot;&gt;POCO&lt;/a&gt;. This is really good library.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another link I consider you should to check is &lt;a href=&quot;http://www.cs.wustl.edu/~schmidt/ACE.html&quot; rel=&quot;nofollow&quot;&gt;ACE&lt;/a&gt;. You may find it a bit outdated and hard to understand from first try but concept is very close to MINA and NIO. &lt;/p&gt;&#xA;" OwnerUserId="19909" LastActivityDate="2016-05-03T12:55:22.783" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25794" PostTypeId="1" CreationDate="2016-05-03T13:06:56.277" Score="8" ViewCount="3550" Body="&lt;p&gt;According to investopedia efficent market hypothesis is&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The efficient market hypothesis (EMH) is an investment theory that&#xA;  states it is impossible to &quot;beat the market&quot; because stock market&#xA;  efficiency causes existing share prices to always incorporate and&#xA;  reflect all relevant information...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and random walk theory (RWT) is &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Random walk is a stock market theory that&#xA;  states that the past movement or direction of the price of a stock or&#xA;  overall market cannot be used to predict its future movement..&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Does both concepts convey the same message but presented as different way? Or EMH and RWT are entirely different concepts?&lt;/p&gt;&#xA;" OwnerUserId="16754" LastActivityDate="2016-05-03T14:06:36.503" Title="Do efficient market hypothesis and random walk theory convey the same concept?" Tags="&lt;random-walk&gt;&lt;market-efficiency&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25795" PostTypeId="2" ParentId="25794" CreationDate="2016-05-03T13:24:10.453" Score="6" Body="&lt;p&gt;They are different concepts, and the relation between them can be described as a conditional: &quot;if EMH holds (all available information about future price movements is already priced into the market), then future price movements will follow a purely random walk as new and unpredictable information emerges&quot;&lt;/p&gt;&#xA;" OwnerUserId="19017" LastEditorUserId="19017" LastEditDate="2016-05-03T14:06:36.503" LastActivityDate="2016-05-03T14:06:36.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25796" PostTypeId="2" ParentId="25794" CreationDate="2016-05-03T13:36:43.200" Score="5" Body="&lt;p&gt;Historically the RWT (Random Walk Theory) came first, as empirical observations by for example M.F.M. Osborne (1959) and others in the 1960s. The EMH came about as a result of theoretical work by Samuelson in 1965 (&quot;Proof that properly discounted prices...&quot;) and E.Fama (1969) as a general empirical/theoretical hypothesis that guided the field for many decades. The EMH, in addition to this broader scope differs from the RWT as follows: in the RWT the expected return is zero, while in the EMH there is a non-zero expected return &quot;as appropriate compensation the risk being taken&quot;, so as Fama always likes to say &quot;tests of the EMH are conditional on a proper model for expected returns&quot;. In simple language, in the EMH you can still make money by holding stocks for the long run. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The expression Random Walk Theory is not much used nowadays in the literature, it has been pretty much supplanted by the EMH.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-05-03T13:43:41.713" LastActivityDate="2016-05-03T13:43:41.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25797" PostTypeId="1" AcceptedAnswerId="25800" CreationDate="2016-05-03T14:10:56.107" Score="7" ViewCount="4553" Body="&lt;p&gt;Assume that I have a foreign asset &#xA;$$Y_t = Y_0 \exp \left((r_f-\frac{1}{2}\sigma^2_Y)t+\sigma_Y W_t^1\right)$$ and an exchange rate &#xA;$$X_t = X_0 \exp\left((r_d-r_f-\frac{1}{2}\sigma^2_X)t+\sigma_X W_t^2\right)$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to compute the expectation of $Y_tX_t$ under the domestic rsik-neutral market measure. I know I would like to use Girsanov, but am not sure how to approach this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My ultimate goal would then be to extend the workings to $Y_t^2 X_t $ or $X_t^2 Y_t$ or $X_t^2 Y_t^2$ etc. so this change of measure would be useful to me&lt;/p&gt;&#xA;" OwnerUserId="19606" LastEditorUserId="19887" LastEditDate="2016-05-04T07:33:30.310" LastActivityDate="2020-07-17T07:52:08.310" Title="Girsanov Theorem for Quanto/Compo adjustment" Tags="&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="25798" PostTypeId="2" ParentId="25753" CreationDate="2016-05-03T14:13:11.290" Score="2" Body="&lt;p&gt;In general any investment position is said to be leveraged, if it is financed by a debt position. This is with regards to options, stocks or any other security.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say you buy an option with maturity in one year at a premium of 100 USD, hold it to maturity and get a payoff of 120. You will have a profit of 20 USD, or 20% of your invested capital.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead you borrow 50 USD at 2%, and provide the other 50 USD from your own pocket, and buy the option. At a payoff of 120 USD, you will have a profit of 70 - 1 interest = 69 USD. Since you only invested 50 USD of your own capital, you have an effective return of 138% from the geared position, compared to 20% in the case of pure equity.&lt;/p&gt;&#xA;" OwnerUserId="20590" LastActivityDate="2016-05-03T14:13:11.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25799" PostTypeId="1" AcceptedAnswerId="25818" CreationDate="2016-05-03T14:24:13.933" Score="1" ViewCount="152" Body="&lt;p&gt;I'm trying to implement Andersen and Broadie's dual method for an upper bound (&lt;a href=&quot;http://www.columbia.edu/~mnb2/broadie/Assets/primal_dual_ms_2004.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;) of a regular American Put. I understand the process to compute it, but I have a conceptual issue : everything relies on the computation of an approximation of the Doob's martingale.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This approximation can be computed through Monte-carlo sub-simulations using a stopping rule to determine where to start and stop sub paths. So far, so good.&#xA;But when looking for the stopping rule for the American Put (&lt;a href=&quot;http://web.mit.edu/lkogan2/www/Papers/FE_HandBook.pdf&quot; rel=&quot;nofollow&quot;&gt;there&lt;/a&gt;, section 2.3.1), I see that optimal exercises times are defined as the instants when (K-S)+ is above the value of the Put... which seems like going around in circles to me (to compute the put you need the exercise times, to get the exercise times you need the put). So how to concretely proceed ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Others use regression to compute the conditional expectations, but since Andersen and Broadie don't, I was wondering whether we could avoid it in this case)&lt;/p&gt;&#xA;" OwnerUserId="19457" LastActivityDate="2016-05-04T05:13:37.980" Title="Andersen Broadie American/Bermudan Put" Tags="&lt;monte-carlo&gt;&lt;simulations&gt;&lt;american-options&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25800" PostTypeId="2" ParentId="25797" CreationDate="2016-05-03T14:55:10.590" Score="12" Body="&lt;p&gt;Assume deterministic and constant interest rates.&lt;/p&gt;&#xA;&lt;p&gt;For an investor in the foreign economy i.e. a market participant that can only trade assets delivering a payout &lt;em&gt;in the foreign currency&lt;/em&gt;, let us define&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ \tilde{X}_t = \tilde{X}_0 \exp \left(\left(r_f-r_d-\frac{\sigma_\tilde{X}^2}{2}\right)+\sigma_\tilde{X} W_t^{\tilde{X},\mathbb{Q}^f} \right) $$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ Y_t =Y_0\exp \left(\left(r_f-\frac{\sigma_Y^2}{2}\right)t+\sigma_Y W_t^{Y,\mathbb{Q}^f} \right) $$&lt;/span&gt;&#xA;where&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$\mathbb{Q}^f$&lt;/span&gt; figures the foreign risk-neutral measure (risk-free MMA &lt;span class=&quot;math-container&quot;&gt;$B^f_t = \exp(r_f\ t)$&lt;/span&gt; is the numéraire).&lt;/li&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$\tilde{X}_t$&lt;/span&gt; representing the instantaneous DOM/FOR exchange rate. &lt;span class=&quot;math-container&quot;&gt;$\tilde{X}_t = \text{x}$&lt;/span&gt; means that, at time &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt;, 1 unit of domestic currency equals &lt;span class=&quot;math-container&quot;&gt;$\text{x}$&lt;/span&gt; units of foreign currency.&lt;/li&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$Y_t$&lt;/span&gt; an equity underlying denominated in the foreign currency.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Let's further assume that the 2 Brownian motions &lt;span class=&quot;math-container&quot;&gt;$W_t^{\tilde{X},\mathbb{Q}^f}$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$W_t^{Y,\mathbb{Q}^f}$&lt;/span&gt; are correlated&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ d\langle W^{\tilde{X},\mathbb{Q}^f}, W^{Y,\mathbb{Q}^f} \rangle_t = \rho dt $$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Notice how I have used &lt;span class=&quot;math-container&quot;&gt;$\tilde{X}_t$&lt;/span&gt; (DOM/FOR) and not &lt;span class=&quot;math-container&quot;&gt;$X_t$&lt;/span&gt; (FOR/DOM) as you propose, because in the foreign economy, the only tradable assets are: &lt;span class=&quot;math-container&quot;&gt;$Y_t$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$B^f_t$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$B^d_t \tilde{X}_t$&lt;/span&gt; as hinted above (and these should be all &lt;span class=&quot;math-container&quot;&gt;$\mathbb{Q}^f$&lt;/span&gt;-martingales when expressed under the numéraire &lt;span class=&quot;math-container&quot;&gt;$B_t^f$&lt;/span&gt;). We do have the relationship, &lt;span class=&quot;math-container&quot;&gt;$\tilde{X}_t = 1/X_t $&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Thanks to the fundamental theorem of asset pricing, for any tradable asset &lt;span class=&quot;math-container&quot;&gt;$V_t$&lt;/span&gt; &lt;em&gt;denominated in the foreign currency&lt;/em&gt;, we have that, under the foreign risk-neutral measure &lt;span class=&quot;math-container&quot;&gt;$\mathbb{Q}^f$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ \frac{V_t}{B^f_t} \text{ is a } \mathbb{Q}^f \text{- martingale} \iff \frac{V_0}{B^f_0} = E^{\mathbb{Q}^f}_0 \left[ \frac{V_t}{B^f_t} \right] $$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Under the domestic risk-neutral measure &lt;span class=&quot;math-container&quot;&gt;$\mathbb{Q}^d$&lt;/span&gt; (risk-free MMA &lt;span class=&quot;math-container&quot;&gt;$B^d_t = \exp(r_d\ t)$&lt;/span&gt; is the numéraire)&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ \frac{V_t/\tilde{X}_t}{B^d_t} \text{ is a } \mathbb{Q}^d \text{- martingale} \iff  \frac{V_0/\tilde{X}_0}{B^d_0 } = E^{\mathbb{Q}^d}_0 \left[ \frac{V_t /\tilde{X}_t^d}{B^d_t}  \right] $$&lt;/span&gt;&#xA;in words, the foreign asset value converted to domestic currency units is a martingale under the domestic risk-neutral measure.&lt;/p&gt;&#xA;&lt;p&gt;From the above, we see that the Radon-Nikodym derivative writes&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \left. \frac{d\mathbb{Q}^d}{d\mathbb{Q}^f} \right\vert_{\mathcal{F}_0} = \frac{B_0^f B_t^d \tilde{X}_t}{B_t^f B_0^d \tilde{X}_0} $$&lt;/span&gt;&#xA;yet because&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align}&#xA;\tilde{X}_t &amp;amp;= \tilde{X}_0\exp \left(\left(r_f-r_d-\frac{1}{2}\sigma_\tilde{X}^2\right)t+\sigma_\tilde{X} W_t^{\tilde{X},\mathbb{Q}^f} \right)  \\&#xA;    &amp;amp;= \tilde{X}_0 \frac{B^f_t}{B^f_0}\frac{B^d_0}{B^d_t}\exp \left(-\frac{1}{2}\sigma_\tilde{X}^2t+\sigma_\tilde{X} W_t^{\tilde{X},\mathbb{Q}^f} \right)&#xA;\end{align}&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;this deriative also writes&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align}&#xA;\left. \frac{d\mathbb{Q}^d}{d\mathbb{Q}^f} \right\vert_{\mathcal{F}_0} &amp;amp;=  \exp\left(\sigma_\tilde{X} W_t^{\tilde{X},\mathbb{Q}^f}-\frac{1}{2}\sigma_\tilde{X}^2t\right) \\&#xA;&amp;amp;= \mathcal{E}\left(\sigma_\tilde{X} W_t^{\tilde{X},\mathbb{Q}^f} \right)&#xA;\end{align}&lt;/span&gt;&#xA;which is indeed a well-behaved Doléans-Dade exponential where we've used the notation&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\mathcal{E}(M_t) = \exp \left( M_t - \frac{1}{2}\langle M \rangle_t \right)$$&lt;/span&gt;&#xA;to denote the stochastic exponential.&lt;/p&gt;&#xA;&lt;p&gt;Hence Girsanov theorem can be applied to transform Brownian motions under &lt;span class=&quot;math-container&quot;&gt;$\mathbb{Q}^f$&lt;/span&gt; as Brownian motions under &lt;span class=&quot;math-container&quot;&gt;$\mathbb{Q}^d$&lt;/span&gt;. How does it work?&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;Girsanov Theorem&lt;/strong&gt; (non rigourous version) - Let &lt;span class=&quot;math-container&quot;&gt;$W_t^{\mathbb{Q^f}}$&lt;/span&gt; represent a standard Brownian motion under &lt;span class=&quot;math-container&quot;&gt;$\mathbb{Q^f}$&lt;/span&gt; and assume the Radon-Nikodym derivative can be written as:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \left. \frac{d\mathbb{Q}^d}{d\mathbb{Q}^f} \right\vert_{\mathcal{F}_0} = \mathcal{E}(L_t) $$&lt;/span&gt;&#xA;In that case, the process &lt;span class=&quot;math-container&quot;&gt;$W_t^{\mathbb{Q^d}}$&lt;/span&gt; defined as&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ W_t^{\mathbb{Q^d}} = W_t^{\mathbb{Q^f}} - \langle W^{\mathbb{Q^f}}, L \rangle_t $$&lt;/span&gt;&#xA;is a standard a Brownian motion under &lt;span class=&quot;math-container&quot;&gt;$\mathbb{Q^d}$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;In our particular example, we see that&#xA;&lt;span class=&quot;math-container&quot;&gt;$$L_t := \sigma_\tilde{X} W_t^{\tilde{X},\mathbb{Q}^f} $$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Applying Girsanov theorem then allows us to write&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align}&#xA;W_t^{\tilde{X},\mathbb{Q}^d} &amp;amp;= W_t^{\tilde{X},\mathbb{Q}^f} - \langle W^{\tilde{X},\mathbb{Q}^f}, \sigma_\tilde{X} W^{\tilde{X},\mathbb{Q}^f} \rangle_t \\&#xA;&amp;amp;= W_t^{\tilde{X},\mathbb{Q}^f} - \sigma_\tilde{X}t \\&#xA;W_t^{Y,\mathbb{Q}^d} &amp;amp;= W_t^{Y,\mathbb{Q}^f} - \langle W^{Y,\mathbb{Q}^f}, \sigma_\tilde{X} W^{\tilde{X},\mathbb{Q}^f} \rangle_t \\&#xA;&amp;amp;= W_t^{Y,\mathbb{Q}^f} - \rho \sigma_\tilde{X} t&#xA;\end{align}&lt;/span&gt;&#xA;meaning that, to move from &lt;span class=&quot;math-container&quot;&gt;$\mathbb{Q}^f$&lt;/span&gt; to &lt;span class=&quot;math-container&quot;&gt;$\mathbb{Q}^d$&lt;/span&gt; one can just replace&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align}&#xA;W_t^{\tilde{X},\mathbb{Q}^f} = W_t^{\tilde{X},\mathbb{Q}^d} + \sigma_\tilde{X} t \\&#xA;W_t^{Y,\mathbb{Q}^f} = W_t^{Y,\mathbb{Q}^d} + \rho \sigma_\tilde{X} t \\&#xA;\end{align}&lt;/span&gt;&#xA;in the expressions for &lt;span class=&quot;math-container&quot;&gt;$\tilde{X}_t$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$Y_t$&lt;/span&gt; to obtain:&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align}&#xA;\tilde{X}_t = \tilde{X}_0 \exp \left(\left(r_f - r_d + \frac{\sigma_\tilde{X}^2}{2}\right) t + \sigma_\tilde{X} W_t^{\tilde{X},\mathbb{Q}^d} \right) \\&#xA;Y_t = Y_0 \exp \left(\left(r_f + \rho \sigma_\tilde{X} \sigma_Y - \frac{\sigma_Y^2}{2}\right) t + \sigma_Y W_t^{Y,\mathbb{Q}^d} \right)&#xA;\end{align}&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Now assume we want to compute the expectation of &lt;span class=&quot;math-container&quot;&gt;$Y_tX_t = Y_t/\tilde{X}_t$&lt;/span&gt; under &lt;span class=&quot;math-container&quot;&gt;$\mathbb{Q}^d$&lt;/span&gt;. The random variable &lt;span class=&quot;math-container&quot;&gt;$Y_t/\tilde{X}_t$&lt;/span&gt; being lognormally distributed (ratio of two lognormals) with mean&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \mu = \ln(Y_0/\tilde{X}_0) + \left(r_d - \frac{\sigma^2_X - 2\rho\sigma_\tilde{X}\sigma_Y + \sigma_Y^2}{2}\right)t $$&lt;/span&gt;&#xA;and variance&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \sigma^2 = \left(\sigma_\tilde{X}^2 - 2 \rho \sigma_\tilde{X} \sigma_Y + \sigma_Y^2 \right)t $$&lt;/span&gt;&#xA;applying the usual formula gives&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align}&#xA; E^{\mathbb{Q}^d}[Y_t/\tilde{X}_t] &amp;amp;= \exp \left(\mu+\frac{\sigma^2}{2} \right) \\&#xA;&amp;amp;= Y_0/\tilde{X}_0 \exp \left(r_d t \right) \\&#xA;&amp;amp;= Y_0/\tilde{X}_0 B_t^d&#xA;\end{align}&lt;/span&gt;&#xA;hence&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ E^{\mathbb{Q}^d} \left[ \frac{Y_t/\tilde{X}_t}{B_t^d} \right] = \frac{Y_0/\tilde{X}_0}{B_0^d} $$&lt;/span&gt;&#xA;as it should since we already knew that&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \frac{Y_t/\tilde{X}_t}{B^d_t} \text{ was a } \mathbb{Q}^d \text{- martingale} $$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;For &lt;strong&gt;quanto derivatives&lt;/strong&gt; we prefer to express the equity/forex dynamics in terms of &lt;span class=&quot;math-container&quot;&gt;$X_t$&lt;/span&gt; the FOR/DOM exchange rate instead of the DOM/FOR exchange rate &lt;span class=&quot;math-container&quot;&gt;$\tilde{X}_t$&lt;/span&gt;. This can be done through a simple application of Itô's lemma noticing that &lt;span class=&quot;math-container&quot;&gt;$\tilde{X}_t = 1/X_t$&lt;/span&gt;. This would typically yield:&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align}&#xA;\frac{dX_t}{X_t} = (r_d - r_f) dt + \sigma_X dW_t^{X,\mathbb{Q}^d} \\&#xA;\frac{dY_t}{Y_t} = (r_f - \rho_{XY}\sigma_X\sigma_Y) dt + \sigma_Y dW_t^{Y,\mathbb{Q}^d} &#xA;\end{align}&lt;/span&gt;&#xA;where we have introduced&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ W_t^{X,\mathbb{Q}^d} = -W_t^{\tilde{X},\mathbb{Q}^d} $$&lt;/span&gt;&#xA;such that&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \langle W_t^{X,\mathbb{Q}^d}, W_t^{Y,\mathbb{Q}^d} \rangle_t = \rho_{XY} t = -\rho t $$&lt;/span&gt;&#xA;and we used &lt;span class=&quot;math-container&quot;&gt;$\sigma_X = \sigma_{\tilde{X}}$&lt;/span&gt; for clarity.&lt;/p&gt;&#xA;&lt;p&gt;Hence finally, under &lt;span class=&quot;math-container&quot;&gt;$\mathbb{Q}^d$&lt;/span&gt; we can write:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ X_t = X_0 \exp \left(\left(r_d-r_f-\frac{\sigma_X^2}{2}\right)+\sigma_X W_t^{X,\mathbb{Q}^d} \right) $$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ Y_t = Y_0\exp \left(\left(r_f - \rho_{XY}\sigma_X\sigma_Y -\frac{\sigma_Y^2}{2}\right)t + \sigma_Y W_t^{Y,\mathbb{Q}^d} \right) $$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;where the quantity&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ F(0,t) = E^{\mathbb{Q}^d}_0 \left[ Y_t \right] = Y_0\exp \left(\left(r_f - \rho_{XY}\sigma_X\sigma_Y\right)t\right) $$&lt;/span&gt;&#xA;is known as the quanto forward.&lt;/p&gt;&#xA;&lt;p&gt;and it is once again easy to show that&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \frac{Y_tX_t}{B_t^d} \text{ is a } \mathbb{Q}^d \text{- martingale} $$&lt;/span&gt;&#xA;using the fact that &lt;span class=&quot;math-container&quot;&gt;$Z=Y_t X_t$&lt;/span&gt; is a product of lognormals (and not a ratio as before)&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2020-07-17T07:52:08.310" LastActivityDate="2020-07-17T07:52:08.310" CommentCount="8" ContentLicense="CC BY-SA 4.0" />
  <row Id="25801" PostTypeId="1" CreationDate="2016-05-03T15:15:15.957" Score="3" ViewCount="684" Body="&lt;p&gt;I know this might be a trivial question, however, I would be grateful for some clarification. I am working on weekly log-return data, doing volatility-foracasting using GARCH models and then using these forecasts I solve a mean-variance asset allocation problem and obtain weights for each of the considered assets. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having done so, I want to obtain realized portfolio returns. And here is my question: can I simply multiply the weights by the corresponding log-return series? Thus I would obtain a series of realized portfolio log-return which I can later easily transform into simple returns. I was reading this &lt;a href=&quot;http://faculty.washington.edu/ezivot/econ424/returnCalculations.pdf&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; and in formula $1.21$ the author compares the results of portfolio returns obtained from simple and log returns and in this comparison he multiplies the weights by corresponding log-returns. In this &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.113.4003&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; the author works on the log-returns and than in formula $6$ uses the exponential transformation for obtaining simple returns in the asset allocation problem.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question in general is: when modelling the volatility on log-returns using GARCH models and obtaining weights in the log-return framework can I use the log-returns of assets to obtain the realized portfolio return? Or should I solve the asset allocation problem on simple returns, as in the second reference I mentioned.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that for daily data the difference is negligible, so for weekly data it might be the same.&lt;/p&gt;&#xA;" OwnerUserId="17464" LastActivityDate="2016-05-03T15:15:15.957" Title="Modelling log-returns and calculating the portfolio return" Tags="&lt;returns&gt;&lt;garch&gt;&lt;asset-allocation&gt;&lt;mean-variance&gt;&lt;log-returns&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25803" PostTypeId="2" ParentId="15215" CreationDate="2016-05-03T18:02:51.410" Score="7" Body="&lt;p&gt;The answer by @HenriK is certainly correct. However, for justification, technique such as the Jensen inequality is needed. For example, since $x^+$ is a convex function, assuming zero interest and zero divdiend,&#xA;\begin{align*}&#xA;E\big((S_{T_{2}}-K)^+ \mid \mathcal{F}_{T_1} \big) &amp;amp;\ge \big(E(S_{T_{2}} \mid \mathcal{F}_{T_1})-K\big)^+\\&#xA;&amp;amp;=(S_{T_1}-K)^+.&#xA;\end{align*}&#xA;That is, $C(T_2) - (S_{T_1}-K)^+\ge 0$. Then,&#xA;\begin{align*}&#xA;C(T_2) - (S_{T_1}-K)^+ + x &amp;gt; 0.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Alternatively, if we short the option with maturity $T_1$ and long the option with with maturity $T_2$, then we have the initial profit $x= C(T_1)-C(T_2) &amp;gt; 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At time $T_1$, if $S_{T_1}\le K$, the shorted option expires worthless, and then we have the total profit $(S_{T_2}-K)^++x$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, if $S_{T_1} &amp;gt; K$, the option is exercised, then, we short sell the stock (i.e., borrow and sell) and receive $K$. &#xA;At time $T_2$, if $S_{T_2} &amp;gt; K$, we buy the stock by paying the amount $K$ that we had received at $T_1$, and return the stock that we had short sold at $T_1$.  The net profit for our trading strategy is $x$, that is, the initial profit. On the other hand, if $S_{T_2} &amp;lt; K$, we buy the stock by paying $S_{T_2}$ and return the stock that we short sold at $T_1$. Note that, we had received $K$ at time $T_1$, our net profit is then $K-S_{T_2} + x&amp;gt;x&amp;gt;0$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-05-03T18:02:51.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25804" PostTypeId="1" CreationDate="2016-05-03T18:41:20.063" Score="0" ViewCount="259" Body="&lt;p&gt;Obviously, not asking for a trading strategy, but do people successfully use options feed/microstructure data to trade equities intraday? What's the general framework for such strategies?&lt;/p&gt;&#xA;" OwnerUserId="1552" LastEditorUserId="1552" LastEditDate="2016-05-04T14:17:52.897" LastActivityDate="2016-08-02T21:22:38.167" Title="trading equities on options feed/microstructure data" Tags="&lt;options&gt;&lt;equities&gt;&lt;trading&gt;&lt;market-microstructure&gt;&lt;intraday&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25805" PostTypeId="1" AcceptedAnswerId="25807" CreationDate="2016-05-03T18:55:21.353" Score="1" ViewCount="767" Body="&lt;p&gt;I am analyzing a problem where the below is given&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Vasicek model with risk-neutral dynamics&#xA;$$dr_t = \kappa (\theta - r_t)dt + \sqrt{r_t} dW_t \quad \quad (1) $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;bond prices $$P(t,T)=e^{A(t,T)-B(t,T)r_t} \quad \quad (2)$$, &#xA;where&#xA;$$B(t,T)= \frac{1- e^{-\kappa (t-T)}}{\kappa} \quad \quad (3)$$&#xA;$$A(t,T)= (B(t,T)-(T-t))(\theta-\frac{\sigma^2}{2 \kappa^2})-(\frac{\sigma^2 B(t,T)^2}{4 \kappa}) \quad \quad (4)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using Ito formula I am deriving the $r_t(\tau)$ (continuously compounded spot rate with constant maturity $\tau$) where   $\tau$ is constant and  $r_t(\tau)=r(t,t+\tau)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r(t,t+\tau)=\frac{-log(P(t,t+\tau))}{\tau} \quad \quad (5)$$&#xA;substituting A and B yields&#xA;$$r(t,t+\tau)=\frac{-A(\tau)}{\tau}+ \frac{r_t}{\tau} B(\tau) \quad \quad (6)$$ &#xA;applying Ito formula where $\quad f'(r_t)=\frac{B(t,\tau)}{\tau} \quad$ and $\quad f''(r_t)=0$&#xA;$$dr_t(\tau) = f'(r_t)dr_t + \frac{1}{2} f''(r_t) d&amp;lt;r&amp;gt;_t \ = \ \frac{B(t,\tau)}{\tau} dr_t  \quad \quad (7) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;substituting for the $dr_t$ gives me the equation&#xA;$$dr_t(\tau)= \frac{B(t,\tau)}{\tau}(\kappa (\theta - r_t)dt + \sqrt{r_t} dW_t)) \quad \quad (8)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The final answer I got is different from the answere suggested by solution manual $dr_t(\tau)= \frac{B(t,\tau)}{\tau}(\kappa (\theta - r_t)dt + \frac{B(t,\tau)}{\tau} dt \quad$  which is confusing.&#xA;&lt;br&gt;&#xA;&lt;br&gt;&lt;br&gt;&#xA;&lt;strong&gt;My questions&lt;/strong&gt; &lt;br&gt;&#xA;Vasicek model is given in this problem in a different form from the one usually seen in the books $dr_t = \kappa (\theta - r_t)dt + \sigma dW_t $  is this a spoiler here? how should this be analyzed?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;second &lt;br&gt;&#xA;in the final equation does $\sqrt{r_t} dW_t$ translates into $dt$?&lt;/p&gt;&#xA;" OwnerUserId="18670" LastEditorUserId="18670" LastEditDate="2016-05-03T19:01:47.217" LastActivityDate="2016-05-03T20:01:12.420" Title="Vasicek model problem" Tags="&lt;interest-rates&gt;&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;stochastic-volatility&gt;&lt;vasicek&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25806" PostTypeId="1" AcceptedAnswerId="25814" CreationDate="2016-05-03T19:48:00.070" Score="3" ViewCount="1263" Body="&lt;p&gt;From the pricing formula, we know that the value at time $t\in [0,T]$ of a zero coupon bond maturing at time $T$ is &#xA;$$&#xA;B(t,T)=E\left(\exp{\left(-\int_{t}^{T}r_sds\right)}\bigg|\mathcal{F}_t\right).&#xA;$$&#xA;Moreover, we say that $B(t,T)$ has an affine term-structure, if &#xA;$$&#xA;B(t,T)=\exp{\left(A(t,T)-C(t,T)r_t\right)}\;\;\ \text{for} \;\;\ t\in[0,T],&#xA;$$&#xA;where $A$ and $C$ are deterministic functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is the following :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For exponential Vasicek model defined by&#xA;$$&#xA;r_t=\exp{(X_t)}\;\;\ \text{with}\;\;\ dX_t=k(\theta-X_t)dt+\sigma dW_t,&#xA;$$&#xA;where k, $\theta$, $\sigma&amp;gt;0$ and $W$ is a Brownian motion under the risk-neutral measure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to show that this model is not an affine term-structure model?&lt;/p&gt;&#xA;" OwnerUserId="20360" LastEditorUserId="6686" LastEditDate="2016-05-04T10:26:39.807" LastActivityDate="2019-08-01T06:17:08.713" Title="How to show that the exponential Vasicek model is not an affine term-structure model?" Tags="&lt;interest-rates&gt;&lt;risk-neutral-measure&gt;&lt;term-structure&gt;&lt;vasicek&gt;&lt;zero-coupon&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25807" PostTypeId="2" ParentId="25805" CreationDate="2016-05-03T20:01:12.420" Score="2" Body="&lt;p&gt;For starters, the short rate model you mention in equation (1) is Cox-Ingersoll-Ross while the bond price in equations (2)-(4) correspond to the Vacisek model. So there is a problem somewhere, I would go for a typo in (1).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, what you wrote seems fine to me, so there must definitely be yet another typo in your solution manual. Note that if there is no $dW_t$ term in the SDE for the rate $r(t,t+\tau)$ like it seems to be stated in your manual then this quantity would be predictible, which defeats the purpose of establishing a stochastic interest rate model in the first place.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2016-05-03T20:01:12.420" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25808" PostTypeId="1" CreationDate="2016-05-03T21:41:13.233" Score="6" ViewCount="1991" Body="&lt;p&gt;My question comes from this &lt;a href=&quot;http://cs229.stanford.edu/proj2012/ChenRenLu-MachineLearningInPairsTradingStrategies.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;paper&lt;/a&gt;, which is a short version of &lt;a href=&quot;https://www.math.nyu.edu/faculty/avellane/AvellanedaLeeStatArb071108.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Avellaneda's paper&lt;/a&gt; The picture bellow provides a summary of the equations.&lt;/p&gt;&#xA;&lt;p&gt;Do I understand correctly that in order to trade OU process I need to:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Run an OLS on two stocks (presumably cointegrated) with a lookback of 60 days&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Calculate the auxiliary process X(k). (2.5)&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Run AR(1) model on (2.5) series. (2.6)&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Estimate OU parameters, and calculate the s-score which is &lt;em&gt;&lt;strong&gt;-m/sigma&lt;/strong&gt;&lt;/em&gt; since last X(k) = 0&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Now steps 1-4 are in sample, but how do I proceed with the out of sample period? From the Chen's paper I understand that I would hold B0 and B1 constant and estimate next 5 days residuals, for each of those days I would repeat steps 2,3,4,5. Is it correct?&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Previously I tried calculating S-score for every day running steps 1-4, but this approach is not profitable and generates random returns. I also tried holding the OLS beta constant for some time and calculate S-scores based on the residuals obtain with those constants, but with this approach beta becomes &amp;gt; 1 and equilibrium standard deviation is a square root of a negative number. All this was using actual prices instead of returns. If I use daily returns, results get random. Could someone please help?&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/AgrdO.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/AgrdO.jpg&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17921" LastEditorUserId="41390" LastEditDate="2020-11-21T23:25:20.627" LastActivityDate="2020-11-21T23:25:20.627" Title="How to trade the Ornstein-Uhlenbeck process?" Tags="&lt;stochastic-processes&gt;&lt;pairs-trading&gt;&lt;mean-reversion&gt;&lt;ornstein-uhlenbeck&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="25809" PostTypeId="2" ParentId="25804" CreationDate="2016-05-03T22:16:29.660" Score="0" Body="&lt;p&gt;The significant open position at some strike might be treated as a hope of those, who opened it that at expiration market will be there and further, so options will be in the money.&lt;/p&gt;&#xA;" OwnerUserId="20600" LastActivityDate="2016-05-03T22:16:29.660" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25810" PostTypeId="2" ParentId="24511" CreationDate="2016-05-03T22:27:46.513" Score="1" Body="&lt;p&gt;The answer is 'no', no single database for all exchange traded instruments in the world. You can try to use &lt;a href=&quot;https://www.interactivebrokers.com/en/?f=%2Fen%2Fgeneral%2Fcontact%2FtipsContractsDatabaseSearch.php%3Fib_entity%3Dllc&quot; rel=&quot;nofollow noreferrer&quot;&gt;Interactive Brokers symbol search service&lt;/a&gt;. For example, just now I've tried to search &lt;strong&gt;Brazil instruments&lt;/strong&gt; &lt;a href=&quot;https://i.imgur.com/Cx7gYI8.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.imgur.com/Cx7gYI8.png&quot; alt=&quot;Brazil instruments&quot;&gt;&lt;/a&gt; &lt;a href=&quot;https://i.imgur.com/Cx7gYI8.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are another services like this, for example &lt;a href=&quot;http://www.iqfeed.net/symbolguide/?symbolguide=lookup&amp;amp;displayac&quot; rel=&quot;nofollow noreferrer&quot;&gt;IQ Feed symbol lookup&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="20600" LastEditorUserId="20913" LastEditDate="2016-10-03T08:45:16.730" LastActivityDate="2016-10-03T08:45:16.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25811" PostTypeId="2" ParentId="25806" CreationDate="2016-05-03T22:34:45.003" Score="1" Body="&lt;p&gt;We shall prove this by contradiction. Let $\theta=0$ and $\sigma=0$. $X_t=X_0e^{-kt}$ and &#xA;$$B(0,t)=\exp\Big(-\int_0^te^{X_0e^{-ks}}ds\Big).$$&#xA;Suppose the contrary that $B(0,t)$ is affine. We should have &#xA;$$&#xA;B(0,t)=\exp{\left(A(0,t)-C(0,t)e^{X_0}\right)}\;\;\ \forall (t,X_0), \tag{1}&#xA;$$&#xA;Differentiate the logarithm of Equation (1) with respect to $t$  side, &#xA;$$e^{X_0e^{-kt}}=C'(0,t)e^{X_0}.$$&#xA;Take logarithm of the above equation, we get&#xA;$$(1-e^{-kt})X_0=-\ln C'(0,t),\quad \forall X_0$$&#xA;which is only possible for $k=0$.&#xA;Therefore, this model is not affine in general.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Alternatively and more generally, one can write out either the PDE or SPDE for both expressions and compare the coefficients of similar differential terms.&lt;/p&gt;&#xA;" OwnerUserId="6686" LastEditorUserId="6686" LastEditDate="2016-05-03T23:01:37.987" LastActivityDate="2016-05-03T23:01:37.987" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="25812" PostTypeId="2" ParentId="25753" CreationDate="2016-05-03T22:48:21.037" Score="0" Body="&lt;p&gt;Let's say you have 100k USD account and trade some futures, which monetary volume is about 100+/-10k. To trade it you actually need only a ~10 000 for maintenance margin. So on your 100k you can open 10 contracts, it means the leverage will be 10. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same is for options. Options on futures require maintenance margin and it maight be compared to the monetary volume of a position.&lt;/p&gt;&#xA;" OwnerUserId="20600" LastActivityDate="2016-05-03T22:48:21.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25814" PostTypeId="2" ParentId="25806" CreationDate="2016-05-04T02:53:17.693" Score="2" Body="&lt;p&gt;Here is a general proof for all parameters in an open domain.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$dr = adt+bdW:=r\big(k(\theta-x)+\frac12\sigma^2\big)dt+\sigma rdW.$$&lt;/span&gt;&#xA;Let&#xA;&lt;span class=&quot;math-container&quot;&gt;$$u(r(s),s):=e^{-\int_t^sr}B(r(s),s,T)=:\phi(s) B.$$&lt;/span&gt;&#xA;Then&#xA;&lt;span class=&quot;math-container&quot;&gt;$$u(r(t),t)=\mathbf E\big[u(r(s),s)\big|r(t)\big],\, \forall t&amp;lt;s. \tag{1}$$&lt;/span&gt;&#xA;So, by Ito's Lemma, &#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align}&#xA;du(r(s),s) &amp;amp;= Bd\phi +\phi dB \\&#xA;&amp;amp;= \phi \bigg(-rB+\frac{\partial B}{\partial s}ds+\frac{\partial B}{\partial r}dr+\frac12\frac{\partial^2 B}{\partial r^2}(dr)^2\bigg) \\&#xA;&amp;amp;= \phi \bigg[\bigg(-rB+\frac{\partial B}{\partial s}+\frac{\partial B}{\partial r}a+\frac12\frac{\partial^2 B}{\partial r^2}b^2\bigg)ds+\frac{\partial B}{\partial r}bdW\bigg] \\&#xA;&amp;amp;=: \phi\,(fds+gdW_s).&#xA;\end{align}&lt;/span&gt;&#xA;We see from Eq. (1) &lt;span class=&quot;math-container&quot;&gt;$\mathbf E\big[u(r(s),s)\big|r(t)\big]$&lt;/span&gt; is constant with respect to &lt;span class=&quot;math-container&quot;&gt;$s$&lt;/span&gt;. So&#xA;&lt;span class=&quot;math-container&quot;&gt;$$0=\frac{d\mathbf E\big[u(r(s),s)\big|r(t)\big]}{ds}\bigg|_{s=t}=f(r(t),t) \tag{2}$$&lt;/span&gt;&#xA;by Equation (1). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose &lt;span class=&quot;math-container&quot;&gt;$B$&lt;/span&gt; is affine. Substitute into &lt;span class=&quot;math-container&quot;&gt;$\frac{f}{B}$&lt;/span&gt; the affine expression for &lt;span class=&quot;math-container&quot;&gt;$B(r,t,T)$&lt;/span&gt; and the expression of &lt;span class=&quot;math-container&quot;&gt;$a$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$b$&lt;/span&gt;, we have by Equation (2)&#xA;&lt;span class=&quot;math-container&quot;&gt;$$A'-\Big(C'+\Big(k\theta+\frac{\sigma^2}2\Big)C-1\Big)e^{X_t}+kCX_te^{X_t}+\frac{(\sigma C)^2}{2}e^{2X_t}=0,\quad\forall X_t\in R,$$&lt;/span&gt;&#xA;where &lt;span class=&quot;math-container&quot;&gt;$'$&lt;/span&gt; denotes partial derivative with respect to &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt; (denoting the first variable). By taking derivatives with respect to &lt;span class=&quot;math-container&quot;&gt;$X_t$&lt;/span&gt; or Taylor expanding &lt;span class=&quot;math-container&quot;&gt;$e^{X_t}$&lt;/span&gt;, we see &lt;span class=&quot;math-container&quot;&gt;$(1,e^{X_t},X_te^{X_t},e^{2X_t})$&lt;/span&gt; is linearly independent. So all factors in front of those terms vanish. This is possible only when &lt;span class=&quot;math-container&quot;&gt;$k=\sigma=0,\,C(t,s)=s-t$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$A(t,s)=0$&lt;/span&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6686" LastEditorUserId="6686" LastEditDate="2019-08-01T06:17:08.713" LastActivityDate="2019-08-01T06:17:08.713" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="25816" PostTypeId="2" ParentId="16489" CreationDate="2016-05-04T03:56:40.293" Score="0" Body="&lt;p&gt;Most likely you are missing something as any new order can't bypass the existing orders.  The only possibility that comes to mind is if you have anti-internalization set and the broker is trying to hit his own quotes.  Say broker A has two quoting systems running and they would otherwise interact.  Anti-internalization would not allow this broker to trade with himself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, then in the sequence you should see the offending orders get canceled.  Those cancelations might come in after the executions.&lt;/p&gt;&#xA;" OwnerUserId="20092" LastActivityDate="2016-05-04T03:56:40.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25817" PostTypeId="2" ParentId="16927" CreationDate="2016-05-04T03:59:04.930" Score="0" Body="&lt;p&gt;Trades in the US can just go to the tape (the ADF).  This is common with certain block trades and certain trades linked to derivatives.  There is a flag on those trades to let you see that they are &quot;average priced trades&quot; or &quot;derriv linked trades&quot;...&lt;/p&gt;&#xA;" OwnerUserId="20092" LastActivityDate="2016-05-04T03:59:04.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25818" PostTypeId="2" ParentId="25799" CreationDate="2016-05-04T05:13:37.980" Score="1" Body="&lt;p&gt;Andersen--Broadie converts an exercise strategy into an upper bound. The better the exercise strategy the better the upper bound. You can get the exercise strategy by using regression to approximate the continuation value and this is pretty standard -- the LS Method is widely used but does have defects.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you have an exercise strategy you need the value of the product using that strategy at each exercise time on each path. The only effective way to get this is a sub-simulation which gives a noisy estimate of an unbiased estimate. Regression at this point doesn't give an unbiased estimate so you are not guaranteed an upper bound. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Andersen and Broadie prove that the noise in the sub-sims lead to additional upwards bias. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There has been considerable work on the problem of avoiding sub-sims and on reducing the effect of their noise. See, for example, my two papers&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Effective Sub-Simulation-Free Upper Bounds for the Monte Carlo Pricing of Callable Derivatives and Various Improvements to Existing Methodologies&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Joshi and Tang&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Analyzing the Bias in the Primal-Dual Upper Bound Method for Early Exercisable Derivatives: Bounds, Estimation and Removal&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mark S. Joshi &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2016-05-04T05:13:37.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25819" PostTypeId="2" ParentId="25765" CreationDate="2016-05-04T05:34:16.580" Score="4" Body="&lt;p&gt;it certainly works best at the money. Why? I think it comes from the fact that Black's formula is approximately linear at the money. The approximation &#xA;$$&#xA;\frac{1}{\sqrt{2\pi}} \operatorname{SR} \sigma \sqrt{T} A,&#xA;$$&#xA;with $A$ the annuity is remarkably good.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way of deducing these formulas is to do an asymptotic/Taylor expansion about $\sigma=0.$ &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2016-05-04T05:34:16.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25822" PostTypeId="1" AcceptedAnswerId="25825" CreationDate="2016-05-04T12:06:01.710" Score="2" ViewCount="476" Body="&lt;p&gt;I have an FX process $X_t = X_0 \exp((r_d-r_f)t+ \sigma W_t)$. Now clearly $E[X_t] = F_{0,t}^X$. i.e. a forward contract of the process $X$ starting at time 0 and maturing at time $t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What if I want to look at a forward contract at a later date. i.e. $F_{a,b}^X$. Where $0 &amp;lt; a&amp;lt;b&amp;lt;t$. How would I be able to rewrite this in terms of current time? Surely it's not the value $F_{0,b}^X - F_{0,a}^X$. Put it another way, how do I determine $E[F_{a,b}^X]$&lt;/p&gt;&#xA;" OwnerUserId="19606" LastActivityDate="2016-05-04T14:29:20.123" Title="&quot;Expectation&quot; of a FX Forward" Tags="&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25823" PostTypeId="1" AcceptedAnswerId="25828" CreationDate="2016-05-04T12:42:40.743" Score="1" ViewCount="989" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/3P0WX.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/3P0WX.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;Why do the implied volatility curve and the flat curve cross over the ATM volatility (at 100%) ?&#xA;&lt;a href=&quot;https://i.stack.imgur.com/dLZtJ.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/dLZtJ.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tx&lt;/p&gt;&#xA;" OwnerUserId="15738" LastEditorUserId="15738" LastEditDate="2016-05-04T13:47:54.440" LastActivityDate="2016-05-04T13:52:18.507" Title="ATM volatility and flat volatility" Tags="&lt;implied-volatility&gt;&lt;volatility-smile&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25824" PostTypeId="1" AcceptedAnswerId="25929" CreationDate="2016-05-04T13:03:57.660" Score="2" ViewCount="416" Body="&lt;p&gt;I have always been told that the discount factor formula is just:&#xA;$$&#xA;DF(T) = \frac{1}{(1+L_{t_0})^T}&#xA;$$&#xA;where $L_{t_0}$ is the LIBOR rate on one period (the first one I guess) and $T$ the number of periods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But shouldn't we take into account the yield curve shape, and use instead forward rates:&#xA;$$&#xA;DF(T)=\frac{1}{(1+L_{t_0})\times \prod_{i=1}^T[1+F(t_i,t_{i+1})]}&#xA;$$&#xA;where $F(t_i,t_{i+1})$ is the forward LIBOR rate between start of period i $t_i$ and its end $t_{i+1}$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why haven't I encountered this? Is it wrong?&lt;/p&gt;&#xA;" OwnerUserId="15650" LastEditorUserId="15650" LastEditDate="2016-05-05T08:04:47.063" LastActivityDate="2016-05-10T13:59:50.323" Title="Discount factor taking into account yield curve shape" Tags="&lt;yield-curve&gt;&lt;term-structure&gt;&lt;discount-factor-curve&gt;&lt;discounting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25825" PostTypeId="2" ParentId="25822" CreationDate="2016-05-04T13:19:58.377" Score="2" Body="&lt;p&gt;&lt;strong&gt;[Question 1]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us define&#xA;\begin{align}&#xA;X_t &amp;amp;= X_0 \exp((r_d-r_f-\frac{1}{2}\sigma^2)t + \sigma W_t) \\&#xA;&amp;amp;= X_0 \exp((r_d-r_f)t) \mathcal{E}(\sigma W_t)&#xA;\end{align}&#xA;then, in that case&#xA;$$ E(X_t \vert \mathcal{F}_0) = X_0 \exp((r_d-r_f)t) = F^X(0,t) $$&#xA;only because $$ \mathcal{E}(\sigma W_t) $$ is a stochastic exponential (strictly positive martingale with mean 1).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet $E(X_t \vert \mathcal{F}_0) \ne  F^X(0,t)$ for $ X_t = X_0 \exp((r_d-r_f)t + \sigma W_t) $ as you define it in your question.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Question 2]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under the domestic risk-neutral measure, the dynamics of the FOR/DOM (1 unit of foreign currency expressed in domestic currency) exchange rate $X_t$ should write (to preclude arbitrage opportunities)&#xA;$$ \frac{dX_t}{X_t} = (r_d - r_f)dt + \sigma W_t $$&#xA;Applying Itô, to the function $f(t,X_t)=\ln(X_t)$ gives&#xA;$$ d\ln(X_t) = (r_d - r_f - \frac{1}{2}\sigma^2)dt + \sigma W_t $$&#xA;which one can easily integrate e.g. from $t_1$ to $t_2$ (assuming $0 &amp;lt; t_1 &amp;lt; t_2 &amp;lt; T$) to obtain&#xA;$$ \ln(X_{t_2}) - \ln(X_{t_1}) = (r_d - r_f - \frac{1}{2}\sigma^2)(t_2-t_1) + \sigma (W_{t_2}-W_{t_1}) $$&#xA;or equivalently&#xA;$$ X_{t_2} = X_{t_1} \exp \left( (r_d - r_f - \frac{1}{2}\sigma^2)(t_2-t_1) + \sigma (W_{t_2}-W_{t_1}) \right) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the above the forward FOR/DOM exchange rate at $t_1$ with maturity $t_2$ computes as&#xA;\begin{align}&#xA;F^X(t_1,t_2) &amp;amp;= E\left[ X_{t_2} \vert \mathcal{F}_{t_1} \right] \\&#xA;&amp;amp;= X_{t_1} \exp \left( (r_d - r_f)(t_2 - t_1) \right)&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Edit]&lt;/strong&gt;&#xA;\begin{align}&#xA;E_0 \left[ F^X(t_1,t_2) \right] &amp;amp;= E_0 \left[ X_{t_1} \exp \left( (r_d - r_f)(t_2 - t_1) \right) \right] \\&#xA;&amp;amp;= E_0 \left[ X_{t_1} \right] \exp \left( (r_d - r_f)(t_2 - t_1) \right) \\&#xA;&amp;amp;= F(0,t_1) \exp \left( (r_d - r_f)(t_2 - t_1) \right) \\&#xA;&amp;amp;= X_0 \exp \left( (r_d - r_f) t_1 \right) \exp \left( (r_d - r_f)(t_2 - t_1) \right) \\&#xA;&amp;amp;= F(0,t_2)&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;this is only normal since &#xA;$$ E [ X_{t_2} \vert \mathcal{F}_0 ] = F(0,t_2) = E[ E[ X_{t_2} \vert \mathcal{F}_{t_1}] \vert \mathcal{F}_0] $$&#xA;by the tower integral property.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-05-04T14:29:20.123" LastActivityDate="2016-05-04T14:29:20.123" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="25827" PostTypeId="1" CreationDate="2016-05-04T13:47:49.353" Score="14" ViewCount="830" Body="&lt;p&gt;It's been a while that quantum computing is looked as the next step in computational science. I somewhat always tought we were decade aways from it's happening but it appears I was wrong: &lt;a href=&quot;http://www.theverge.com/2016/5/4/11589656/ibm-quantum-computing-cloud&quot; rel=&quot;nofollow noreferrer&quot;&gt;ibm-quantum-computing-cloud&lt;/a&gt;  (well, I am still not sure this is a large scale quantum computer or an efficient quantum computer replication; &lt;strong&gt;edit:&lt;/strong&gt; changed the link; it is a simulator)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quantum mechanics and quantitative finance were already linked by some powerfull tools (ex. &lt;a href=&quot;https://quant.stackexchange.com/questions/522/random-matrix-theory-rmt-in-finance&quot;&gt;Random matrix theory (RMT) in finance&lt;/a&gt;) or shady reasonments (&lt;a href=&quot;https://quant.stackexchange.com/questions/17604/quantum-mechanics-and-economics-what&quot;&gt;Quantum Mechanics and Economics... What&lt;/a&gt;) but I did not really considered quantum mechanics as the next step of QF. For a long time papers I could find on the topic were either quantum mechanics oriented (see &lt;a href=&quot;https://en.wikipedia.org/wiki/Path_integral_formulation&quot; rel=&quot;nofollow noreferrer&quot;&gt;Path_integral_formulation&lt;/a&gt; and links) or 'poor' in term of quantitative finance (see &lt;a href=&quot;https://en.wikipedia.org/wiki/Quantum_finance&quot; rel=&quot;nofollow noreferrer&quot;&gt;Quantum_finance&lt;/a&gt; and links). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I can find more interesting papers (currently at work, will post the relevant paper later) and I am somewhat convinced that quantum computing could be a huge step ahead in both optimization and simulation and so in  quantitative finance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am now looking for some good sources (keep in mind the aim is 3, I don't necessarly need to go trough all quantum mechanics again) on &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;quantum mechanics&lt;/li&gt;&#xA;&lt;li&gt;quantum computing&lt;/li&gt;&#xA;&lt;li&gt;quantum computing applied to  quantitative finance&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5052" LastEditorUserId="848" LastEditDate="2020-03-25T08:42:09.620" LastActivityDate="2020-03-25T08:42:09.620" Title="Quantum Computing for Quantitative Finance" Tags="&lt;optimization&gt;&lt;simulations&gt;&lt;quantitative&gt;&lt;quantum-finance&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="9" ContentLicense="CC BY-SA 4.0" />
  <row Id="25828" PostTypeId="2" ParentId="25823" CreationDate="2016-05-04T13:51:00.000" Score="1" Body="&lt;p&gt;Well... this is simply a picture to illustrate what is written in the text. It is not an absolute truth.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The author just chose 2 implied volatility smiles that share the same ATM volatility level for clarity. One exhibits negative skew (typical of equity markets) and the other one is flat (you'll never observe that in practice, although it is exactly what the theoretical Black-Scholes tends to predict).&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-05-04T13:52:18.507" LastActivityDate="2016-05-04T13:52:18.507" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25829" PostTypeId="2" ParentId="25827" CreationDate="2016-05-04T13:53:57.887" Score="2" Body="&lt;p&gt;For #1 and #2 I really enjoyed this Edx course from UC Berkeley:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.edx.org/course/quantum-mechanics-quantum-computation-uc-berkeleyx-cs-191x&quot; rel=&quot;nofollow&quot;&gt;Quantum Mechanics and Quantum Computation&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And for #3 you seem to have the sources already :)&lt;/p&gt;&#xA;" OwnerUserId="19615" LastActivityDate="2016-05-04T13:53:57.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25830" PostTypeId="1" AcceptedAnswerId="25838" CreationDate="2016-05-04T15:24:28.580" Score="-1" ViewCount="82" Body="&lt;p&gt;With regards to technical analysis, are there ways of determining the confidence level of a directional signal? Taking a relative strength index (RSI) as an example, can the extent to which an asset is oversold or overbought be used to get the percentage likelihood of a movement in either direction?&lt;/p&gt;&#xA;" OwnerUserId="19116" LastEditorUserId="19116" LastEditDate="2016-05-04T19:18:52.320" LastActivityDate="2016-05-04T19:26:56.570" Title="Determining confidence level of directional signals" Tags="&lt;time-series&gt;&lt;probability&gt;&lt;forecasting&gt;&lt;technical-analysis&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25831" PostTypeId="1" AcceptedAnswerId="25833" CreationDate="2016-05-04T16:13:09.807" Score="0" ViewCount="128" Body="&lt;p&gt;It is common knowledge that the greater the expected value, the higher the option value. However, there are surely exceptions, as written by Paul Wilmott's FAQs in Quantitative Finance&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Q: If you increase volatility what happens to the&#xA;  value of an option?&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;A:It depends on the option!&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So &lt;strong&gt;when will an increase in expected value lead to a decrease in option value?&lt;/strong&gt; One of my guesses is an up-and-out call option where higher volatility will make the underlying price to cross the barrier, hence zero payoff. Is there a case when this property also holds for vanilla options?&lt;/p&gt;&#xA;" OwnerUserId="13691" LastActivityDate="2016-05-04T17:48:34.570" Title="When is option value inversely related to expected volatility?" Tags="&lt;options&gt;&lt;volatility&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25832" PostTypeId="2" ParentId="25753" CreationDate="2016-05-04T16:15:24.587" Score="3" Body="&lt;p&gt;There is a little known Greek called &quot;lambda&quot; or leverage which equals Delta times Stock price divided by option price $\lambda=\frac{\Delta . S}{c}$. So if $\lambda&amp;gt;1$ the option could be said to be leveraged, meaning the dollar value of a delta equivalent amount of stock is greater than the market value of the option. &lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2016-05-04T16:15:24.587" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25833" PostTypeId="2" ParentId="25831" CreationDate="2016-05-04T16:34:41.937" Score="1" Body="&lt;p&gt;You are on the right track IMO, except that there are no exceptions to &quot;the greater the expected value, the higher the option value&quot; rule, since an option premium's is precisely the discounted expectation of its payout by absence of arbitrage - at least under the risk-neutral measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as the influence of volatility on the option value is concerned:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The example of a corridor option (or a double knock-out barrier) is even more illuminating I would say. Clearly, as volatility increases, the chances of the option getting knocked out increase (meaning that the chances of the option paying out nothing increase), hence the expected payout decreases, hence the option price decreases.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Yes, for European vanilla options the price is a monotonically increasing function of volatility. Just think in terms of Vega. First, note that the call/put parity does not involve volatility, so the Vega of a call is indeed that of a put and it computes as (&lt;a href=&quot;https://en.wikipedia.org/wiki/Greeks_(finance)#Vega&quot; rel=&quot;nofollow&quot;&gt;using the standard notations&lt;/a&gt;)&#xA;$$ \nu = P(0,t) F(0,t) \phi(d_1) \sqrt{t} $$&#xA;or equivalently&#xA;$$ \nu = P(0,t) K \phi(d_2) \sqrt{t} $$&#xA;where in both cases, all terms : discount factor, forward price, strike, probability density function and (square root of ) time... are all positive, hence the Vega is always positive for European call/put options.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For a knock-out barrier option, you'll indeed observe that Vega becomes negative close to the barrier.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-05-04T17:48:34.570" LastActivityDate="2016-05-04T17:48:34.570" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25834" PostTypeId="1" AcceptedAnswerId="25836" CreationDate="2016-05-04T16:45:17.657" Score="1" ViewCount="578" Body="&lt;p&gt;I am analyzing the transition of the bond prices in the affine models in the form of $P(t,T)=e^{-A(t,T)-B(t,T)r_t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;using the property that the diffusion and the drift of an affine model can be presented as&#xA;$$b(t,r)=b(t)+\beta(t)r_t \quad \quad (1) $$ &#xA;$$\sigma^2(t,r)=a(t)+\alpha(t)r_t \quad \quad (2) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the A and B satisfy the system of the below ordinary differential equations&#xA;$$\partial_t A(t,T) = \frac{1}{2} \ a(t) \ B^2(t,T) - b(t) \ B(t,T), \quad A(T,T)=0 \quad \quad (3)$$&#xA;$$\partial_t B(t,T) = \frac{1}{2} \ \alpha(t) \ B^2(t,T) - \beta(t) \ B(t,T) -1 , \quad B(T,T)=0 \quad \quad (4)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to derive bond price P(t,T) for the &lt;strong&gt;Ho-Lee model. $dr_t=\mu t dt + \sigma dW_t^*$&lt;/strong&gt; &lt;br&gt;&#xA;My understanding is that $b=\mu t, \ \beta=0, \ a=\sigma^2, \alpha=0$ will be the parameters for the eq (3) and (4), which gives&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\partial A(t,T) = \frac{\sigma^2}{2} B^2(t,T) - \mu t \ B(t,T) \quad \quad (5)$$&#xA;$$\partial B(t,T) = -1 \quad \quad (6)$$&#xA;and further it should yield &#xA;$$B(t,T)=T-t \quad \quad (7)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The last step is unclear to me. &lt;br&gt;&#xA;&lt;strong&gt;My questions &lt;br&gt;&#xA;1) why T-t is is substituted for, not t or T &lt;br&gt;&#xA;2) why the integration $\partial B=-1$ results in (T-t)  and not -(T-t)? integrating a function f'(x)=-1 should give f(x)=-x, shouldn't it?&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$A(t,T)=\frac{-\sigma^2}{6}(T-t)^3 + \int_t^T b(s)(T-s)ds \quad \quad (8)$$&#xA;giving the final equation $$P(t,T)=exp \ \big{(}\frac{-\sigma}{6}(T-t)^3  -\frac{\mu}{6} T^3 + \frac{1}{2} \mu T t^2 -\frac{1}{3} \mu t^3 - (T-t)r_t \big{)} \quad \quad (9)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question 3) &lt;br&gt;&#xA;How the integral $\int_t^T b(s)(T-s)ds$ gives $\frac{\mu}{6} T^3 - \frac{1}{2} \mu T t^2 + \frac{1}{3} \mu t^3$. I can't get the algebra here. Is this an ordinary integral?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="18670" LastEditorUserId="18670" LastEditDate="2016-05-04T20:17:17.693" LastActivityDate="2016-05-04T20:17:17.693" Title="Ho-Lee model - A and B derivation for $P(t,T)=e^{-A(t,T)-B(t,T)r_t}$" Tags="&lt;interest-rates&gt;&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;stochastic-volatility&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25835" PostTypeId="2" ParentId="18289" CreationDate="2016-05-04T16:57:11.280" Score="0" Body="&lt;p&gt;In order to define option price we should follow Black Scholes construction to construct riskless portfolio at t then to state that instantaneous rate of return of this portfolio equal risk free rate r ( t ) where r is a random on [ t , t + dt ] interval. We actually then arrive at the problem which could not be embedded in BS pricing world. &lt;/p&gt;&#xA;" OwnerUserId="20610" LastActivityDate="2016-05-04T16:57:11.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25836" PostTypeId="2" ParentId="25834" CreationDate="2016-05-04T17:07:39.943" Score="2" Body="&lt;p&gt;From Equation (6), $B(t,T)=-t+c(T)$ for some function $c(T)$. $1=P(t,t)=e^{-A(t,t)-(c(t)-t)r_t}$ or $A(t,t)+(c(t)-t)r_t=0,\,\forall (r_t,t)$. So $c(t)=t, A(t,t)=0,\forall t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Equation (8) you have missed the square on $\sigma$ and a factor of $\frac13$. Then you just need to substitute in the function for $b(s)$ and integrate the following to get the correct result.&#xA;$$A(t,T) = -\frac{\sigma^2}{2}\int_t^T(T-s)^2ds +\mu\int_t^T s(T-s)ds.$$&lt;/p&gt;&#xA;" OwnerUserId="6686" LastEditorUserId="6686" LastEditDate="2016-05-04T19:47:33.767" LastActivityDate="2016-05-04T19:47:33.767" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="25838" PostTypeId="2" ParentId="25830" CreationDate="2016-05-04T19:26:56.570" Score="0" Body="&lt;p&gt;You need a model which assumes that some intrinsic properties such as true overpricing is taking place but masked by the noise which has some probabilistic distribution around the true signal. The averaging of the observed data then takes advantage of the large number theorem or some version of the central limit theorem to flush out the signal. So you need to build a model first.&lt;/p&gt;&#xA;" OwnerUserId="6686" LastActivityDate="2016-05-04T19:26:56.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25840" PostTypeId="1" CreationDate="2016-05-05T02:56:02.767" Score="2" ViewCount="933" Body="&lt;p&gt;Does anyone know what type of model is used to model the skew and IVs inside Thinkorswim platform for its volatility smile approximation? I am trying to replicate but do not know where to start.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestion as to where to find more information would help too thanks.&lt;/p&gt;&#xA;" OwnerUserId="2318" LastActivityDate="2017-03-16T02:47:33.910" Title="Volatility Smile Approximation" Tags="&lt;options&gt;&lt;implied-volatility&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25841" PostTypeId="1" CreationDate="2016-05-05T07:39:16.453" Score="1" ViewCount="296" Body="&lt;p&gt;For a university project, I have been working on a rather complex automated trading strategy, that levers machine learning techniques.&#xA;I backtested the algorithm, as a result I have daily return data for various time windows (max. two years, it is a relatively new financial asset). I also simulated the performance of the algorithm on three months of test data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I am writing the final report, but my daily supervisor wants more rigour i.e. statistical tests. E.g. he wants me to &lt;em&gt;prove&lt;/em&gt; that the daily return on average is greater than zero or even the S&amp;amp;P500 daily return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe this to be impossible. Let us assume all assumptions for whatever test are satisfied. Proving your average daily return to be higher than zero with an $\alpha = 5\%$, would imply it is statistically impossible to ever have a PERIOD (see EDIT below) with a negative return (which is definitely not the case for my strategy). Or thus, I believe my supervisor is asking me to prove that I have found the holy grail of automated trading strategies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Two questions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Do you agree with my above reasoning: &lt;em&gt;statistically proving an average daily return higher than zero is nonsense&lt;/em&gt;?&lt;/li&gt;&#xA;&lt;li&gt;Do you have any pointers or ideas about how I could somewhat prove or quantify that my algorithm works well, other than simulating over specific time periods and benchmarking my returns and Sharpe ratios against other assets and strategies.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;EDIT: I meant &lt;em&gt;period&lt;/em&gt; instead of &lt;em&gt;day&lt;/em&gt;&#xA;EDIT in response to @Olaf his comment: when I say &lt;em&gt;statistically impossible&lt;/em&gt; I mean very &lt;em&gt;improbable&lt;/em&gt;. Let us assume I would be able to reject ($\alpha=5\%$) the null hypothesis that the average daily return (e.g. calculated over 90 days) is smaller than zero. In case I would invest an equal amount every day, then given the above it is almost guaranteed that I will end up with more after 90 days. I tend to believe this is a very strong guarantee for an automated trading system.&lt;/p&gt;&#xA;" OwnerUserId="20622" LastEditorDisplayName="user20626" LastEditDate="2016-05-05T12:46:38.207" LastActivityDate="2016-05-05T12:46:38.207" Title="How to statistically prove that an automated trading strategy outperforms the market?" Tags="&lt;statistics&gt;&lt;automated-trading&gt;" AnswerCount="1" CommentCount="2" ClosedDate="2016-05-05T12:47:53.557" ContentLicense="CC BY-SA 3.0" />
  <row Id="25842" PostTypeId="1" CreationDate="2016-05-05T08:07:55.963" Score="1" ViewCount="285" Body="&lt;p&gt;I would like to have some sugestions of reference books on FX modeling with strong mathematical approach, preferably combined with market pratictioner quant perspective.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All sugesting are welcome! Many thanks.&lt;/p&gt;&#xA;" OwnerUserId="3534" LastActivityDate="2016-05-06T15:08:39.227" Title="FX Modeling references" Tags="&lt;fx&gt;&lt;reference-request&gt;&lt;best-practices&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25843" PostTypeId="1" CreationDate="2016-05-05T09:10:19.060" Score="1" ViewCount="123" Body="&lt;p&gt;I was wondering how bank calculates in practice the amount of money it earns after granting a credit (I hope margin is the proper word). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Supposing, that the client took 3-year 10000 euros loan (36 equal monthly installments) with nominal rate equal to 10% (for the simplicity I assume no provision, no insurance required). Is the profit on such a product equal to 10000 minus present value of portfolio made from 36 zero-couponed bonds (I also assume for a while, there is no such thing like counterparty default risk)? That sounds like an answer from book, not practical solution since you should calculate PV of such portfolio each time. Moreover, what is more important, it isn't so simple (since bank have access to much cheaper source of funding = deposits, installments might vary, client may default, etc.)&lt;/p&gt;&#xA;" OwnerUserId="15445" LastEditorUserId="15445" LastEditDate="2016-05-05T09:16:22.447" LastActivityDate="2016-09-03T14:56:33.853" Title="Calculation loan's margin from bank perspective" Tags="&lt;fixed-income&gt;&lt;margin&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25845" PostTypeId="1" CreationDate="2016-05-05T10:44:49.317" Score="1" ViewCount="81" Body="&lt;p&gt;Suppose I have two processes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$A_t = A_0 \exp((a-\frac{1}{2}\sigma_A^2)t+\sigma_A W_t^A$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$B_t = B_0 \exp((b-\frac{1}{2}\sigma_B^2)t+\sigma_B W_t^B$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to calculate $E[A_s B_t]$ where s &amp;lt; t.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Attempt:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can rewrite $B_t$ as $B_t = B_s \exp((b-\frac{1}{2}\sigma_B^2)(t-s) + \sigma_B W_{t-s}^B)$. Then, $A_sB_t = A_sB_s\exp((b-\frac{1}{2}\sigma_B^2)(t-s) + \sigma_B W_{t-s}^B)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, $E(A_s B_t) = E(A_s B_s)E(\exp((b-\frac{1}{2}\sigma_B^2)(t-s) + \sigma_B W_{t-s}^B))$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$= A_0 B_0 \exp((a+b+\rho\sigma_A \sigma_B)s)+\sigma(b(t-s))$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anyone confirm whether this approach is correct. How would I then be able do compute $E(A_s B_t B_r)$ where $ s &amp;lt; t &amp;lt; r$. Would I simply do the same thing but use&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$B_r = B_s\exp((b-\frac{1}{2}\sigma_B^2)(r-t)+\sigma_BW_{r-t}^B)\exp((b-\frac{1}{2}\sigma_B^2)(t-s)+\sigma_BW_{t-s}^B)\exp((b-\frac{1}{2}\sigma_B^2)s+\sigma_BW_{s}^B)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My second part of this question relates to the forward. Assume $s&amp;lt;t&amp;lt;r$ and $F_{t,r}^A = E(A_r|A_t)$. How would I be able to compute $E(B_r F_{t,r}^A )$? Am I allowed to do $E(B_r)E( F_{t,r}^A )$ even though the time periods overlap because I am working with a forward?&lt;/p&gt;&#xA;" OwnerUserId="19606" LastActivityDate="2016-05-06T14:28:59.160" Title="Expected Value of Products of Processes" Tags="&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25846" PostTypeId="2" ParentId="25841" CreationDate="2016-05-05T11:51:20.690" Score="0" Body="&lt;p&gt;To have an average that is statistically &gt; 0 does NOT imply that you can NEVER have a negative daily return: it means that, on AVERAGE, you have a positive return! You can have a lot of negative days, but if the positive ones more than compensate for the losses, you end up with an AVERAGE positive return (that can or cannot be statistically significant from zero: your test will answer this question). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Check if your model outperforms S&amp;amp;P500 in terms of cumulative returns over the period of interest, for example. Compare the expected returns and also the volatility (this is not a negligible variable) of your model w.r.t. those of S&amp;amp;P. I also think that simulation methods are useful tools to test a strategy.&lt;/p&gt;&#xA;" OwnerUserId="18694" LastActivityDate="2016-05-05T11:51:20.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25847" PostTypeId="1" CreationDate="2016-05-05T12:12:28.867" Score="0" ViewCount="464" Body="&lt;p&gt;Could you please correct which parts of my reasoning are wrong?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's suppose that I know for sure that my estimate for a stock volatility is right (I have a crystal ball) and that it will be for sure constant until the maturity of the option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I plugged my volatility, the risk free interest rate and the other variables into the Black Scholes equation and got a price of 80. The market price is 100.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same way people derive an implicit volatility by solving for sigma to match the BS with the market price, I solve for r, the risk free interest rate, and I get a value of .6.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My conclusion is that I can take advantage of this mispricing by properly hedging in almost continuous time and having an annualized return on these transactions of .6, ignoring fees and liquidity issues. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this correct? If so, why people give so much value to implied volatility instead of trusting in their volatility estimates and realizing that mispricing should in fact exist in the market as a sort of premium to reward the work of hedging continuously, the fees and liquidity issues and the risk of not seeing the model assumptions working in practice?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ignore issues like transaction problems and fees (I'm a robot, I don't make mistakes and the broker is my friend, there are no fees). The real point is the last paragraph. Why option pricing seems to be so much focused in assuming that arbitrage is absolutely impossible, even considering fees and assumption problems, always trying to find a pricing method that will make the market 'right'. It seems so clear to me that high risk free returns should exist to compensate the million problems involving continuous hedging.&lt;/p&gt;&#xA;" OwnerUserId="20616" LastEditorUserId="20616" LastEditDate="2016-05-05T19:41:15.513" LastActivityDate="2016-05-05T21:30:13.070" Title="Solving for r in the Black Scholes equation" Tags="&lt;black-scholes&gt;&lt;implied-volatility&gt;&lt;arbitrage&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25848" PostTypeId="1" AcceptedAnswerId="25921" CreationDate="2016-05-05T12:44:35.783" Score="3" ViewCount="250" Body="&lt;p&gt;I read a book where it was written :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1/ &quot;implied volatility is the market's consensus on the volatility of the asset between now and the maturity of the option&quot;.&#xA;-&gt; Could someone explain me this sentence ? How can we arrive at this conclusion ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2/ &quot;if an asset drops in price, this is generally accompanied by an increase in it's volatility&quot;&#xA;-&gt; Is this a fact of the market, an observed property ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3/ and further : &quot;this is reflected in the IV of the OTM puts being higher than the OTM calls because puts pay on the downside&quot;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/EpcbB.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/EpcbB.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;This sentence is for me weird. If someone could explain me ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tx a lot !&lt;/p&gt;&#xA;" OwnerUserId="15738" LastEditorUserId="15738" LastEditDate="2016-05-05T13:01:44.140" LastActivityDate="2016-05-11T02:29:56.547" Title="existence of implied volatility" Tags="&lt;implied-volatility&gt;&lt;finance-mathematics&gt;&lt;stochastic&gt;" AnswerCount="3" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="25849" PostTypeId="1" CreationDate="2016-05-05T14:33:47.797" Score="1" ViewCount="594" Body="&lt;p&gt;I would like to discuss my approach toward modelling of interest rates with respect to its downsides and advantages. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem is to forecast daily LIBOR 3M and LIBOR 1M over a particular time horizon, let say 10Y. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was thinking about applying Vasicek interest rate dynamics and treating realized historical LIBORS for 3M and 1M as instaneous rates and calibrating the model to them via regression approach. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This simplified apprach won't be used for any derivative valuations, therefore I am accepting some limitations, like no fit to current interest rate curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you think that my approach is acceptable in the light of the aim of this analysis? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks, &#xA;Bart  &lt;/p&gt;&#xA;" OwnerUserId="20629" LastActivityDate="2016-06-04T22:19:18.590" Title="LIBOR 3M and 1M from Vasicek model" Tags="&lt;interest-rates&gt;&lt;libor&gt;&lt;modelling&gt;&lt;vasicek&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25850" PostTypeId="1" CreationDate="2016-05-05T14:56:40.393" Score="3" ViewCount="374" Body="&lt;p&gt;I am trying to get admitted to a masters in quantitative finance (I come from a computer science background), so next week I will have 3h to solve an exam in statistical computing using my favourite language (they recommended either MATLAB, Python or R). The mock exam I was provided with asks the following:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Generate a 2-year time-series (500 observations) from a stable&#xA;  distribution with parameters $$\alpha = 1.5, \quad \beta = 0.0, \quad  \gamma = 1.0, \quad \delta = 1.0$$&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;a) Find the distribution of the $0.05$ quantiles of 5-day overlapping&#xA;  returns obtained from the 2-year time-series of 1-day returns.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;b) Prove (numerically or theoretically) that enough trials have been&#xA;  considered.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Note: taking $P_i$ as the price on the $i$-th day,&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;1-day returns: $R_{1}^{i} = \frac{P_{i+1} - P_{i}}{P_{i}}, \; i=1,\ldots,499$&lt;/li&gt;&#xA;  &lt;li&gt;n-day returns: $R_{n}^{i} = \frac{P_{i+n} - P_{i}}{P_{i}}$.&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I am a little bit confused about the whole thing, so I would like some help to check if I am approaching this problem correctly. Here is how I would solve it:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;1)&lt;/strong&gt; generate a 500 value time-series using &lt;a href=&quot;https://en.wikipedia.org/wiki/Stable_distribution#Simulation_of_stable_variables&quot; rel=&quot;nofollow&quot;&gt;this technique&lt;/a&gt; (I'm assuming they're referring to the alpha-stable family of distributions);&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2)&lt;/strong&gt; after playing around a bit, I'm able to obtain the 5-day returns time-series from the original 1-day returns time-series:&#xA;$$R^{n}_{i} = (R^{1}_{i} + 1) (R^{1}_{i+1} + 1) \ldots (R^{1}_{i+n-1} + 1) - 1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;3)&lt;/strong&gt; compute the empirical distribution function of the 5-day returns, say $F(x)$;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;4)&lt;/strong&gt; estimate each quantile $q_{\eta}$ by&#xA;$$\hat q_{\eta} = F^{-1}(\eta)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: To invert the empirical distribution function I would order the simulated values by their size and then pick the value at position $k = \min \{ n \in \{ 1, \ldots, N \} | n/N \geq \eta \}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;5)&lt;/strong&gt; save the distribution of $0.05$ quantiles&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;6)&lt;/strong&gt; repeat steps &lt;strong&gt;1)&lt;/strong&gt; through &lt;strong&gt;5)&lt;/strong&gt; a minimum number of times, $K$, that I need to determine through some convergence law or something. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; Any hints on how to determine $K$?&lt;/p&gt;&#xA;" OwnerUserId="20627" LastEditorUserId="20627" LastEditDate="2016-06-02T17:26:13.073" LastActivityDate="2016-06-06T20:36:04.720" Title="Convergence of the distribution of 0.05 quantiles through Monte-Carlo simulation" Tags="&lt;statistics&gt;&lt;monte-carlo&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25851" PostTypeId="1" AcceptedAnswerId="25858" CreationDate="2016-05-05T15:13:56.730" Score="2" ViewCount="1170" Body="&lt;p&gt;I am somehow puzzled by the following problem: &#xA;LIBOR rates are forward rates for an interbank loan for 1M or 3M (let's limit the range of possibilities to these two cases). Assuming that I have estimated the parameters of any short-term model (Vasicek, Hull-White etc.) and simulate the paths of instaneous rates, can I model market-observed LIBOR 3M as integral of instaneous rates over 3M span and similarly LIBOR 1M as integral over 1 month of instaneous rates?&lt;br&gt;&#xA;Or there is no link between market-observed LIBOR rates and instaneous rate that is modelled in the short-rate framework. &#xA;Help me out!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards,&#xA;Bart   &lt;/p&gt;&#xA;" OwnerUserId="20629" LastActivityDate="2020-06-08T11:50:56.883" Title="LIBOR rates from Vasicek/Hull-White model?" Tags="&lt;libor&gt;&lt;hullwhite&gt;&lt;vasicek&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25852" PostTypeId="2" ParentId="25847" CreationDate="2016-05-05T15:38:23.810" Score="1" Body="&lt;p&gt;Well, hopefully your calculations are right.  There are a few things to remember:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The carry can be higher than what you are thinking.  Very often you will get charged if you are long or short.  That can cost a lot depending on the name.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Implied is theoretically always higher than realized.  You are selling insurance.  You should collect a premium more often than not, but when you are losing, you loose a little bigger.  Big gaps will be painful.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Transaction fees, slippage, etc.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="20092" LastActivityDate="2016-05-05T15:38:23.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25853" PostTypeId="2" ParentId="9629" CreationDate="2016-05-05T17:02:35.440" Score="1" Body="&lt;p&gt;From the information I've gathered the volatility smile concept did not exist prior to 1987. Since then it can be seen in foreign exchange markets and various other investments. Equity derivatives show volatility pairs and the smile tends to seen quite easily here. &lt;/p&gt;&#xA;" OwnerUserId="20321" LastActivityDate="2016-05-05T17:02:35.440" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25854" PostTypeId="2" ParentId="25187" CreationDate="2016-05-05T17:14:56.887" Score="1" Body="&lt;p&gt;Data to compute Tobin's Q for most other countries, particularly emerging countries, are not available. As a result, many economists have begun to use the ratio of the stock market capitalization to GDP as an approximation for Tobin's Q.&lt;/p&gt;&#xA;" OwnerUserId="20321" LastActivityDate="2016-05-05T17:14:56.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25855" PostTypeId="2" ParentId="23261" CreationDate="2016-05-05T17:22:57.953" Score="0" Body="&lt;p&gt;Ditto to Larasing. Any bond's duration is just a matter of coupon, price, discount rate. Credit risk does not factor into this equation. &lt;/p&gt;&#xA;" OwnerUserId="20321" LastActivityDate="2016-05-05T17:22:57.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25857" PostTypeId="2" ParentId="23261" CreationDate="2016-05-05T19:09:20.710" Score="5" Body="&lt;p&gt;There are different measures and interpretations of duration. One, as has been pointed out already, has a formula weighting coupons and final contractual cashflow. Other definitions of duration take a broader perspective and relate it to the interest rate sensitivity of the security and not to a particular formula.  These go by names such as effective or risk adjusted duration. Embedded options, for example, can be modeled into an interest rate tree, and the average of a one basis point increase and decrease in those rates and their impact on the price show the impact, or duration, of interest rates. Effective duration models can also incorporate credit risk but there is not an industry standard for that. It is important to not let a formula using the contractual final cash flow bias the results.  For example, interest rate hedging may be done based on duration.  A long term bond teetering on bankruptcy would have little or no effective duration, but using the contractual maturity might result in very inappropriate swap trades hedging risk that does not exist.    &lt;/p&gt;&#xA;" OwnerUserId="19627" LastActivityDate="2016-05-05T19:09:20.710" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25858" PostTypeId="2" ParentId="25851" CreationDate="2016-05-05T20:06:01.783" Score="2" Body="&lt;p&gt;In practice, you can calibrate to either 1 month libor or 3 month libor, but not both.   That's because there's a basis swap between 1 month libor and 3 month libor that can't be explained by your model.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-05-05T20:06:01.783" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="25859" PostTypeId="2" ParentId="25849" CreationDate="2016-05-05T21:16:08.897" Score="-1" Body="&lt;p&gt;&quot;Calibrating the model to them via regression&quot;... Vasicek has just three parameters: $\sigma$ (vol), $r_L$ (long rate) and $a$ (mean reversion) and a time-dependent short rate $r_0$. Can you specify what you are thinking of in terms of a regression model to estimate these? Obviously $r_0$ will not be a stable parameter. If you want to estimate $\sigma$, $r_L$and $a$, you have to contend with the fact that actual yield curves &amp;amp; dynamics are not well explained by a one factor model (here $r_0(t)$ parameterizes the factor), so it's going to be tricky to use regression without having the fact that the model is wrong mess up the estimates. E.g., if you do cross-sectional regressions, the apparent values of $a$ and $\sigma$ will be much larger than the ones that do a good job of describing time-series dynamics. And $r_L$ won't be easy to stably estimate with small values of $a$ and $\sigma$ corresponding to the apparent time-series behavior.&lt;/p&gt;&#xA;" OwnerUserId="1780" LastEditorUserId="1780" LastEditDate="2016-05-05T21:23:31.967" LastActivityDate="2016-05-05T21:23:31.967" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25860" PostTypeId="2" ParentId="25847" CreationDate="2016-05-05T21:30:13.070" Score="1" Body="&lt;p&gt;To my point of view, the answer is hidden in your question. You correctly stated some of the BS assumptions and empirically it is proven that they are not true (volatility is not constant and the assumption regarding the distribution of returns is unrealistic due to fat tails).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The model is as good as its assumptions are. Given that volatility is the unobserved factor of the model, we can solve for it and find its value so that the model holds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case your volatility estimate and model assumptions are correct, you must be able to exploit the arbitrage opportunity leading to the correction of the mispricing. What every equilibrium model says is that arbitrage opportunities do not persist.&lt;/p&gt;&#xA;" OwnerUserId="20637" LastActivityDate="2016-05-05T21:30:13.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25861" PostTypeId="2" ParentId="24719" CreationDate="2016-05-06T02:26:53.703" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I don't have much experience with database designing so I am not sure how to proceed.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Read an introductory database book!&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Which database will be best to use? MSSQL, MySQL, NoSQL, etc.? &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;MySQL and Microsoft SQL Server are database management systems that follow the relational database paradigm. NoSQL is not a database management system, it is a paradigm that is contrasted with relational databases. Examples of NoSQL DBMSes include MongoDB, Redis etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unless you know a handful about database optimizations, there is no strong reason to prefer MySQL, MSFT SQL Server, SQLite, kdb, Redis or any DBMS. You should use what you are comfortable with learning, have reasonable community support and documentation for, and meets your budget and operational requirements:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Is it open source?&lt;/li&gt;&#xA;&lt;li&gt;Is it more suitable for a UNIX or Windows environment?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You should only start worrying about what DBMS you're using if you are making $10^3+ cost trade-off decisions, thinking about servicing &gt;30 (exact number varies depending on your hardware) user requests, or are storing more data than would fit on desktop computer that is heavily spec'ed out, or are hitting the bandwidth limit either at the network, disk or memory layer, because there's very little difference between DBMSes until you start attacking these types of issues.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you would like a specific answer, I would actually recommend something like MySQL. It's commonly used, there's a lot of reading materials available for free on how to use it, and it conforms to the SQL standard so you can extend your knowledge to other DBMSes once you've familiarized yourself with it. It's a bad idea to use a NoSQL DBMS with absolutely no knowledge of the relational paradigm, because NoSQL DBMSes trade-off certain functionality to meet specific needs that are difficult to service with a relational DBMS. However, if you don't know what a relational DBMS is, it's unlikely that you'll understand this trade-off.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;People who first learn to use a DBMS often fall into the trap of thinking that the newest DBMS is the most modern and most powerful all-around - this is completely incorrect. Research into DBMSes is very mature, and even 20-30 year old DBMSes are heavily optimized and suitable for modern use cases. Many elements of the architecture of classical relational, row-oriented DBMSes are still reused in elements of NoSQL/column-oriented DBMS design. The modern DBMSes don't evolve out of a need to outperform older DBMSes, rather, they evolve out of a need to trade-off certain functionality to meet more domain-specific needs (e.g. Hadoop workload, data model flexibility, multi-data center resiliency). Then you also have a plethora of new DBMSes that don't do anything new but are really just created to help their founders pocket venture capital - again, you won't really know this until you are familiar with the basics of database management.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I think I will need the above mentioned columns and a column for the datetime stamp of the record. Am I on the right track?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;No, you will need more than that. You should have constraints to ensure integrity of your data; indexes to speed up your queries; normalization to minimize the redundancy of your data, and so on. You have just identified columns that you will need in 1 table in your database.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="4660" LastEditDate="2016-05-06T02:40:58.910" LastActivityDate="2016-05-06T02:40:58.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25862" PostTypeId="1" AcceptedAnswerId="25867" CreationDate="2016-05-06T03:19:39.583" Score="2" ViewCount="1109" Body="&lt;p&gt;I am reviewing a &lt;strong&gt;CIR model&lt;/strong&gt; problem, where $r_t$ has following dynamics&#xA;$$dr_t=a(b-r_t)dt+\sigma \sqrt{r_t} dW_t^* \quad \quad (1)$$  for  some  constants  $ab&amp;gt;\frac{\sigma^2}{2} \quad$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Letting T be a fixed date and $f_{\lambda}$ a function defined for some constant $\lambda &amp;gt;0$ &#xA;$$f_{\lambda}(t,r)=E^*[e^{-\lambda {r_{T}}}|r_t=r] \quad \quad (2)$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) derive PDE satisfied by the function $f_{\lambda}$ &lt;br&gt;&#xA;b) show that the function $f_{\lambda} (t,r)=e^{-A_{\lambda}(T-t)-B_{\lambda}(T-t)r_t}$ satisfies the PDE&#xA;&lt;br&gt;&#xA;&lt;br&gt;&#xA;I guess the subject function can be expressed as $$f(t,r_t)=e^{- \lambda r} \quad \quad (3)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first thought was just to calculate the $df(t,r_t)$ using Ito formula and substituting for the $dr_t$ which would yield &#xA;$$df(t,r_t)=f_t dt + f_r dr_t+ \frac{1}{2} f_{rr} d&amp;lt;r&amp;gt;_t=$$&#xA;$$=(f_t + a(b-r_t) f_r + \frac{1}{2} r f_{rr})dt+ \sigma  \sqrt{r_t} dW_t^* \quad \quad (4)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wouldn't it be already answer to a?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However the solution presents a different approach which I don't understand. It gives the Feynman-Kac equation as solution to a), &lt;/p&gt;&#xA;&#xA;&lt;p&gt;further the equation $f_{\lambda} (t,r)=e^{-A_{\lambda}(T-t)-B_{\lambda}(T-t)r_t}$ is plugged into the Feynman-Kac equation,  and then using a system of 2 ODE's $A(\tau)$  $B(\tau)$ are derived.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;br&gt;&#xA;&lt;strong&gt;Can anybody explain the proceedings please? I am missing &quot;the big picture&quot; here.&lt;/strong&gt; &lt;br&gt;&#xA;I don't understand why it starts with Feynman-Kac and why only deriving A and B proves already that they satisfy the PDE. &lt;/p&gt;&#xA;" OwnerUserId="18670" LastEditorUserId="18670" LastEditDate="2016-05-06T09:04:53.663" LastActivityDate="2016-05-06T17:48:21.270" Title="CIR model problem - deriving PDE, Feynman-Kac" Tags="&lt;interest-rates&gt;&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;stochastic-volatility&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25864" PostTypeId="2" ParentId="25862" CreationDate="2016-05-06T04:13:33.757" Score="3" Body="&lt;p&gt;Let&#xA;$$&#xA;f_{\lambda}(t,r)=E^{(t,r)}\left[e^{-\lambda r_{T}}\right]&#xA;$$&#xA;where $E^{(t,r)}$ denotes the expectation conditional on $r_{t}=r$.&#xA;We assume $f$ is smooth for the remainder. Let $\theta=T\wedge\inf\left\{ s&amp;gt;t\colon\left|r_{s}-r\right|&amp;gt;1\right\} $.&#xA;By the Markov property of $\{r_{t}\}$,&#xA;$$&#xA;f_{\lambda}(t,r)=E^{(t,r)}\left[f_{\lambda}(\left(t+h\right)\wedge\theta,r_{\left(t+h\right)\wedge\theta})\right].&#xA;$$&#xA;Moving some terms around, we get&#xA;$$&#xA;0=E^{(t,r)}\left[f_{\lambda}(\left(t+h\right)\wedge\theta,r_{\left(t+h\right)\wedge\theta})-f_{\lambda}(t,r)\right].&#xA;$$&#xA;Applying Ito's lemma with $\mathcal{A}$ denoting the infinitesimal&#xA;generator of the process $\{r_{t}\}$,&#xA;\begin{align*}&#xA;0 &amp;amp; =E^{(t,r)}\left[\int_{t}^{\left(t+h\right)\wedge\theta}\left(\frac{\partial f_{\lambda}}{\partial t}+\mathcal{A}f_{\lambda}\right)(u,r_{u})du+\int_{t}^{\left(t+h\right)\wedge\theta}\frac{\partial f_{\lambda}}{\partial r}(u,r_{u})\sigma\sqrt{r_{u}}dW_{u}\right]\\&#xA; &amp;amp; =E^{(t,r)}\left[\int_{t}^{\left(t+h\right)\wedge\theta}\left(\frac{\partial f_{\lambda}}{\partial t}+\mathcal{A}f_{\lambda}\right)(u,r_{u})du\right].&#xA;\end{align*}&#xA;The vanishing Ito integral is due to the boundedness of $r_{u}$ on&#xA;$[t,(t+h)\wedge\theta]$. Multiplying by $1/h$ yields &#xA;$$&#xA;0=E^{(t,r)}\left[\frac{1}{h}\int_{t}^{\left(t+h\right)\wedge\theta}\left(\frac{\partial f_{\lambda}}{\partial t}+\mathcal{A}f_{\lambda}\right)(u,r_{u})du\right].\tag{1}&#xA;$$&#xA;Since for each sample $\omega$ in some set of full measure there&#xA;exists an $h_{0}(\omega)$ for which $\theta(\omega)\geq t+h$ for&#xA;all $h\leq h_{0}(\omega)$, it follows from the mean value theorem&#xA;that $\mathbb{P}$-almost surely,&#xA;\begin{multline*}&#xA;\lim_{h\searrow0}\frac{1}{h}\int_{t}^{\left(t+h\right)\wedge\theta}\left(\frac{\partial f_{\lambda}}{\partial t}+\mathcal{A}f_{\lambda}\right)(u,r_{u})du\\&#xA;=\lim_{h\searrow0}\frac{\left(t+h\right)\wedge\theta}{h}\left(\frac{\partial f_{\lambda}}{\partial t}+\mathcal{A}f_{\lambda}\right)(s(h),r_{s(h)})du=\left(\frac{\partial f_{\lambda}}{\partial t}+\mathcal{A}f_{\lambda}\right)(t,r)&#xA;\end{multline*}&#xA;where $s(h)$ is some number in $(t,(t+h)\wedge\theta)$. The remainder&#xA;of the proof is given by taking $h\searrow0$ and applying the dominated&#xA;convergence theorem in (1) to yield&#xA;$$&#xA;\frac{\partial f_{\lambda}}{\partial t}+\mathcal{A}f_{\lambda}=0\text{ pointwise}.&#xA;$$&#xA;where&#xA;$$&#xA;\mathcal{A}f_{\lambda}\equiv a\left(b-r\right)\frac{\partial f_{\lambda}}{\partial r}+\frac{1}{2}\sigma^{2}r\frac{\partial^{2}f_{\lambda}}{\partial r^{2}}.&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="18272" LastActivityDate="2016-05-06T04:13:33.757" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25865" PostTypeId="1" CreationDate="2016-05-06T05:50:58.913" Score="8" ViewCount="509" Body="&lt;p&gt;One way to value a cashflow is to first calculate the expected return from CAPM, and then use the expected return to discount the future cashflows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem here is that the expected return from CAPM is an average $\mathrm{E}[R]$, and therefore, by Jensen's inequality:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathrm{E}\left[\frac{1}{R}\right] \ge \frac{1}{\mathrm{E}[R]}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I wonder why people use $\frac{1}{\mathrm{E}[R]}$ to discount cashflows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To clarify, I will use an example.Let's assume there is only one cashflow of \$100 a year from now I want to value. According to CAPM, the expected return is &#xA;$$&#xA;\bar{R}_a = R_f + \beta_a (\bar{R}_m - R_f)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the return $R$ is defined as $R=\frac{S_{t+1}}{S_t}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the problem here is that $\bar{R}_a$ represents an average return of the following year. &lt;strong&gt;The actual return $R_a$ is a random variable that is not known right now.&lt;/strong&gt; In other words, $\bar{R}_a=\mathrm{E}[R_a]$, but $R_a$ is random, and will realize different values in different alternative universes.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, what I usually see is that we value the \$100 cashflow a year from now as &#xA;$$\frac{100}{\bar{R}_a}=\frac{100}{\mathrm{E}[R_a]}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But shouldn't it be valued as &#xA;$$\mathrm{E} \left [ \frac{100}{R_a} \right]&#xA;$$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But according to Jensen's inequality:&#xA;$$\mathrm{E} \left [ \frac{100}{R_a} \right] \ge \frac{100}{\mathrm{E}[R_a]}&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="19437" LastEditorUserId="19437" LastEditDate="2016-05-08T03:48:01.693" LastActivityDate="2018-09-27T16:29:56.397" Title="CAPM, DCF, and Jensen's inequality" Tags="&lt;capm&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25867" PostTypeId="2" ParentId="25862" CreationDate="2016-05-06T09:46:34.150" Score="3" Body="&lt;p&gt;Here's my 2 cents:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) &lt;em&gt;Conditional expectations can always be seen as martingales&lt;/em&gt; (this is a direct consequence of the &lt;em&gt;tower property&lt;/em&gt;). Thus, we here have that &#xA;$$ M_t := E^*[e^{-\lambda {r_{T}}}|r_t] $$ &#xA;is a martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Applying Itô's lemma to $M_t = f_{\lambda}(t,r_t)$ as you did is a good starting point. But doing this, leaves you with an SDE, not a PDE. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, because $M_t$ is a martingale, the &lt;em&gt;martingale representation theorem&lt;/em&gt; tells you that its drift should be strictly zero. Working from your application of Ito's lemma, equating the drift to zero gives you the following PDE which needs to be satisfied by $f_{\lambda}(t,r)$:&#xA;$$ \frac{\partial f_{\lambda}}{\partial t}+ a\left(b-r\right)\frac{\partial f_{\lambda}}{\partial r}+\frac{1}{2}\sigma^{2}r\frac{\partial^{2}f_{\lambda}}{\partial r^{2}} = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is precisely Feynman-Kac formula. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that your equation (3) is wrong (and useless).Instead what we could write is:&#xA;$$ M_T = f_{\lambda}(T,r_T) = E^*[e^{-\lambda {r_{T}}}|r_T]=e^{-\lambda {r_{T}}} $$&#xA;which could be seen as the PDE's terminal condition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) To show that the proposed &#xA;$$ f_{\lambda} (t,r_t)=e^{-A_{\lambda}(T-t)-B_{\lambda}(T-t)r_t} $$&#xA;is effectively a solution of the just-derived PDE, you need to plug this particular expression of $f_{\lambda} (t,r_t)$ in the PDE and verify that the resulting RHS indeed equates to zero. Here, this condition can indeed be verified (for unique values for both $A_{\lambda}$ and $B_{\lambda}$ that one can solve for), hence you have indeed found a solution of the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-05-06T17:48:21.270" LastActivityDate="2016-05-06T17:48:21.270" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="25868" PostTypeId="1" CreationDate="2016-05-06T10:15:52.197" Score="1" ViewCount="99" Body="&lt;p&gt;In &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S0304405X10001169&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt; the estimation of Affine Term Structure models via ML is discussed. In the Affine $N$-factors model the price of the bond is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;P(X_t,t,T;\theta) = \exp(-\gamma_0(T-t;\theta)-\gamma(T-t;\theta)^{\prime}X_t)\Rightarrow\\ g(X_t,t,T;\theta)\equiv-\ln(P(X_t,t,T;\theta)) = \gamma_0(T-t;\theta)+\gamma(T-t;\theta)^{\prime}X_t,\quad X_t\in\mathbb{R}^N&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The paper assume to have $N$ observed yields with maturity $\tau_1,...,\tau_N$  and hence &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\left[\begin{array}{c}&#xA;g(X_t,t,t+\tau_1;\theta)\\&#xA;\vdots\\&#xA;g(X_t,t,t+\tau_N;\theta)&#xA;\end{array}&#xA;\right] = \left[\begin{array}{c}&#xA;\gamma_0(\tau_1;\theta)\\&#xA;\vdots\\&#xA;\gamma_0(\tau_N;\theta)&#xA;\end{array}&#xA;\right]+\left[\begin{array}{c}&#xA;\gamma(\tau_1;\theta)^{\prime}\\&#xA;\vdots\\&#xA;\gamma(\tau_N;\theta)^{\prime}&#xA;\end{array}&#xA;\right]\,\left[\begin{array}{c}&#xA;X_{1,t}\\&#xA;\vdots\\&#xA;X_{N,t}&#xA;\end{array}&#xA;\right]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so that $X_t$ can be derived as a function of the vector of yields $(g(X_t,t,t+\tau_1;\theta),..,,g(X_t,t,t+\tau_N;\theta))^{\prime}$ by a proper matrix inversion. The authors says that, in order to identify all the parameters of the model under both the $P$ and $Q$ measures, only $N$ yields are not enough, so one needs $H$ furthers yields. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My problem&lt;/strong&gt;. I do not clearly understand which is the minimum value for $H$ ($H=1$? $H=N$?) and if $H$ can be arbitrarily large. It is said that the additional $H$ yields must be assumed to be observed with errors. I am lost in all these assumptions since I do not find a rigorous treatment in the literature.   &lt;/p&gt;&#xA;" OwnerUserId="18063" LastActivityDate="2016-05-06T10:15:52.197" Title="Estimation of Affine Term Structure Model" Tags="&lt;pricing&gt;&lt;bond-yields&gt;&lt;affine-processes&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25869" PostTypeId="1" AcceptedAnswerId="25870" CreationDate="2016-05-06T13:27:24.927" Score="2" ViewCount="182" Body="&lt;p&gt;I'm working with high frequency FX data. Because the FX market is a decentralized market, different traders often have slightly different prices at the same moment. I can see how this would potentially affect data quality, and I remember reading some work in which the author dismissed the use of ask quotes as being low quality data, so they only used bids. I'm afraid have forgotten who/where this was.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: is it a common perception in literature that high frequency FX ask quotes are no good, and would you have any references for me that make this point?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I've not yet accepted an answer, because I am looking for a reference that makes the point either way.&lt;/p&gt;&#xA;" OwnerDisplayName="user20644" LastEditorDisplayName="user20644" LastEditDate="2016-05-09T18:45:24.760" LastActivityDate="2016-07-03T20:41:49.597" Title="What is the data quality of ask (offer) versus bid quotes in FX markets?" Tags="&lt;fx&gt;&lt;reference-request&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25870" PostTypeId="2" ParentId="25869" CreationDate="2016-05-06T13:47:13.093" Score="0" Body="&lt;p&gt;I think that is coming from the bond market where there in the past has been the idea of &quot;marking to the bid&quot;.  People would usually ask for a two-way-market and most of the time they would be expecting that the bid would be hit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With FX data you are looking at actionable markets so they are all good.&lt;/p&gt;&#xA;" OwnerUserId="20092" LastActivityDate="2016-05-06T13:47:13.093" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25871" PostTypeId="2" ParentId="25845" CreationDate="2016-05-06T13:52:37.397" Score="2" Body="&lt;p&gt;Based on Cholesky decomposition, &#xA;\begin{align*}&#xA;W_t^A &amp;amp;= W_t^1,\\&#xA;W_t^B &amp;amp;= \rho W_t^1 + \sqrt{1-\rho^2}W_t^2,&#xA;\end{align*}&#xA;where $(W_t^1, t \ge 0)$ and $(W_t^2, t \ge 0)$ are two independent standard Brownian motions. Then&#xA;\begin{align*}&#xA;A_t &amp;amp;= A_0\exp\Big(\big(a-\frac{1}{2}\sigma_A^2\big)t + \sigma_A W_t^1 \Big),\\&#xA;B_t &amp;amp;= B_0\exp\Big(\big(b-\frac{1}{2}\sigma_B^2\big)t + \sigma_B\big( \rho W_t^1 + \sqrt{1-\rho^2}W_t^2\big) \Big).&#xA;\end{align*}&#xA;The remaining calculation are based on this decomposition. For example, assuming that $t&amp;lt;r$, note that&#xA;\begin{align*}&#xA;A_r &amp;amp;= A_0\exp\Big(\big(a-\frac{1}{2}\sigma_A^2\big)r + \sigma_A W_r^1 \Big)\\&#xA;&amp;amp;=A_0\exp\Big(\big(a-\frac{1}{2}\sigma_A^2\big)t + \sigma_A W_t^1 + \big(a-\frac{1}{2}\sigma_A^2\big)(r-t) + \sigma_A (W_r^1-W_t^1)\Big)\\&#xA;&amp;amp;= A_t \exp\Big( \big(a-\frac{1}{2}\sigma_A^2\big)(r-t) + \sigma_A (W_r^1-W_t^1)\Big).&#xA;\end{align*}&#xA;Similarly,&#xA;\begin{align*}&#xA;B_r &amp;amp;= B_t \exp\Big( \big(b-\frac{1}{2}\sigma_B^2\big)(r-t) + \sigma_B\big[\rho (W_r^1-W_t^1) + \sqrt{1-\rho^2}(W_r^2-W_t^2)\big]\Big).&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;F_{t, r}^A &amp;amp;= E(A_r\mid A_t)\\&#xA;&amp;amp;= A_t\exp\big(a(r-t)\big).&#xA;\end{align*}&#xA;Consequently,&#xA;\begin{align*}&#xA;E(B_r F_{t, r}^A) &amp;amp;=E(B_r E(A_r\mid A_t))\\&#xA;&amp;amp;=\exp\big(a(r-t)\big) E(B_r A_t)\\&#xA;&amp;amp;=\exp\big(a(r-t)\big) E\big(E(B_r A_t \mid \mathcal{F}_t)\big)\\&#xA;&amp;amp;=\exp\big((a+b)(r-t)\big) E(A_t B_t)\\&#xA;&amp;amp;=A_0B_0\exp\big((a+b)(r-t)\big) \\&#xA;&amp;amp;\quad E\left(\exp\Big(\big(a-\frac{1}{2}\sigma_A^2\big)t + \sigma_A W_t^1  + \big(b-\frac{1}{2}\sigma_B^2\big)t + \sigma_B\big( \rho W_t^1 + \sqrt{1-\rho^2}W_t^2\big)\Big) \right)\\&#xA;&amp;amp;=A_0B_0\exp\big((a+b)\,r + \rho\, \sigma_A\sigma_B\, t\big).&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for $E(A_sB_tB_r)$, where $s&amp;lt;t&amp;lt;r$, you can use the tower law: first consitional on $\mathcal{F}_t$ , and then conditional on $\mathcal{F}_s$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-05-06T14:28:59.160" LastActivityDate="2016-05-06T14:28:59.160" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="25872" PostTypeId="2" ParentId="25843" CreationDate="2016-05-06T14:02:48.160" Score="1" Body="&lt;p&gt;Traditionally, banks did not particularly consider consumer loans as a source of profit, but rather as a source of credit risk to be mitigated &lt;a href=&quot;http://www.yaroslavvb.com/papers/thomas-survey.pdf&quot; rel=&quot;nofollow&quot;&gt;(Thomas, 2000)&lt;/a&gt;. Expected profit simply was (and I would guess, still is) not really something that comes into the loan decision at micro level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to your question as to how the profit is calculated in practice, I think it would be easier to understand my answer if we separate this into calculating the profit before (ex ante) and after (ex post) the contract expires.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The ex post profit is easy to calculate: it is simply the return of the loan minus the cost of capital of the bank over the loan period. The method you refer to would be an ex ante calculation, and it is simply the present value for of these variables. In other words, it's the expected return (adjusted for default risk) of the loan minus the prevailing interest rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course you are right that calculating the ex ante profit for a small individual loan seems unpractical. This is why I highly doubt that banks would do this for individual loans (even though the cited article argues that they should), but I do not know this for certain. It does seem likely that banks monitor the &lt;em&gt;aggregate&lt;/em&gt; ex ante return on their consumer loans by region.&lt;/p&gt;&#xA;" OwnerDisplayName="user20644" LastActivityDate="2016-05-06T14:02:48.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25873" PostTypeId="2" ParentId="11183" CreationDate="2016-05-06T14:20:23.073" Score="1" Body="&lt;p&gt;Neither. &lt;a href=&quot;https://stats.stackexchange.com/questions/96789/whats-the-practical-difference-between-the-johansen-vs-engle-granger-tests-for&quot;&gt;This question&lt;/a&gt; and its references suggest that the Philipis Ouliaris (1990) test is a significant improvement over EG ADF and JCT.  Given the automation, you should probably run all three tests and see if there's any consensus.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It actually surprises me there isn't (at least in Eviews) a function that shows a table of the EG, JCT, and PO results next to each other for comparison.  This is how the lag selection table is presented, which makes it easy to find consensus in the  criteria.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As always, however, I'd like to echo a statement made in the question linked above: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;The main question is whether you use the correct specification of&#xA;  deterministic components and lags. Using a badly specified test will&#xA;  probably be more harmful than using a 'bad' test on the correct&#xA;  model.&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="15571" LastActivityDate="2016-05-06T14:20:23.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25874" PostTypeId="2" ParentId="25842" CreationDate="2016-05-06T15:08:39.227" Score="4" Body="&lt;p&gt;Personally, I prefer the book &lt;a href=&quot;https://www.amazon.ca/Foreign-Exchange-Option-Pricing-Practitioners/dp/0470683686&quot; rel=&quot;nofollow&quot;&gt;Foreign Exchange Option Pricing&lt;/a&gt; by Iain Clark and the book &lt;a href=&quot;https://www.amazon.ca/Options-Smile-Risk-Wiley-Finance-ebook/dp/B003AU7DXO&quot; rel=&quot;nofollow&quot;&gt;FX Options and Smile Risk&lt;/a&gt; by Antonio Castagna. The book &lt;a href=&quot;https://www.amazon.ca/Options-Structured-Products-Uwe-Wystup/dp/0470011459&quot; rel=&quot;nofollow&quot;&gt;FX Options and Structured Products&lt;/a&gt; by Uwe Wystup is also good.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-05-06T15:08:39.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25875" PostTypeId="1" AcceptedAnswerId="25903" CreationDate="2016-05-06T16:50:20.760" Score="2" ViewCount="157" Body="&lt;p&gt;So I've gone over the CBOE VIX white paper a few times and understand it well enough to have written (Ruby) code to produce the correct VIX. I have the older version of the paper where it only used standard/monthly options to produce the number (published in 2009) and I also have the most recent paper published in 2014 that modified the rules to use weekly options. I understand the differences and why they updated their rules.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the white paper: &lt;a href=&quot;http://www.cboe.com/micro/vix/vixwhite.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.cboe.com/micro/vix/vixwhite.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I want to calculate the 60-day VIX. Please confirm that I'm on the correct path in modifying the rules and the formula.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Instead of picking options that expire between 23 and 37 days out, I'd want to grab the series that expire between 53 and 67 days out.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In Step 3 of the formula (as listed in the white paper), use number of minutes in 60-days for N(60).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;As a consequence of 2, we are weighting to a 60-day timeframe. To do a 90, 120, 150, or 180-day VIX I would make similar changes as above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this make sense or have I made a fundamental error?&lt;/p&gt;&#xA;" OwnerUserId="20647" LastEditorUserId="20647" LastEditDate="2016-05-07T19:42:13.960" LastActivityDate="2016-05-09T06:20:08.077" Title="If VIX measures SPX IV 30-days in future, how to modify formula to calc IV 60-days in future?" Tags="&lt;vix&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25876" PostTypeId="1" AcceptedAnswerId="26000" CreationDate="2016-05-06T19:00:19.047" Score="3" ViewCount="224" Body="&lt;p&gt;I have a trading system based on Machine Learning which is trading 8 symbols intraday. From the results I found out that some&#xA;weeks of trading are successful for some symbols, then it usually switches to unsuccessful next week for previously successful&#xA;symbol. At the same time another symbol which was unsuccessful previous week start to be successful this week.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an explanation to this phenomenon it comes to my mind that the underlying symbol series switching from stationary to non stationary&#xA;and vice versa.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question is: did somebody tried intraday (1 min data) stationarity test on FOREX or S&amp;amp;P ??? I believe such test should be'data window based' with sliding window than what would be a size of such window ???&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What method would be the best for such test (DF, ADF, KPSS ) or other ???&lt;/p&gt;&#xA;&#xA;&lt;p&gt;regards, Krzysztof&lt;/p&gt;&#xA;" OwnerUserId="20639" LastActivityDate="2016-05-14T07:51:17.700" Title="Real time stationarity test" Tags="&lt;machine-learning&gt;&lt;stationarity&gt;&lt;testing&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25878" PostTypeId="1" CreationDate="2016-05-06T22:58:16.590" Score="0" ViewCount="166" Body="&lt;p&gt;Why is it more accurate to use stochastic volatility when pricing let's say a forward start option (&lt;em&gt;ie&lt;/em&gt; an option priced today but striked in a future date) ?&lt;/p&gt;&#xA;" OwnerUserId="19693" LastActivityDate="2016-05-06T23:53:20.490" Title="Stochastic volatility and forward start contracts" Tags="&lt;option-pricing&gt;&lt;stochastic-volatility&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25879" PostTypeId="2" ParentId="25878" CreationDate="2016-05-06T23:53:20.490" Score="1" Body="&lt;p&gt;Local vol model gives a &quot;too shallow&quot; forward skew. Derivatives of which the price are depending on the forward skew will be mispriced. If i remember correctly, Hagan's paper &lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2016-05-06T23:53:20.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25880" PostTypeId="1" AcceptedAnswerId="25894" CreationDate="2016-05-07T03:12:26.640" Score="3" ViewCount="578" Body="&lt;p&gt;I am analyzing the nth moment generation process for $r_t$ with dynamics defined by CIR model&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_t$ has following dynamics&#xA;$$dr_t=a(b-r_t)dt+\sigma \sqrt{r_t} dW_t^* \quad \quad (1)$$  for  some  constants  $ab&amp;gt;\frac{\sigma^2}{2} \quad$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Letting T be a fixed date and $f_{\lambda}$ a function defined for some constant $\lambda &amp;gt;0$ is given&#xA;$$f_{\lambda}(t,r)=E^*[e^{-\lambda {r_{T}}}|r_t=r] \quad \quad (2)$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to generate first four moments. The solution manual suggest using the following function&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ E^*[r_T^n]=(-1)^n \ E^* \big{[} \ \frac{d^n}{d \lambda^n}e^{-\lambda r_t}\big{|}_{\lambda=0} \ \big{]}$$&#xA;$$=(-1)^n  \ \frac{d^n}{d \lambda^n}e^{-\lambda r_t}\big{|}_{\lambda=0} \ \quad \quad (3)$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand the general idea of using MGF to derive moments of a function.&#xA;In a standard way it is calculated as&#xA;$$ M_t = E[e^{tX}]=\int e^{tx} \ f(x) dx \quad \quad (4)$$ and then $$ M_t^{(n)}(0) \quad \quad (5)$$ would give the n-th moment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am confused here with couple of things. First the fact that $f_{\lambda}$ looks already like moment generating function, so in this case what is multiplied by what. &lt;br&gt; Second I don't understand how  the suggested function (3) was created. The $-\lambda$ used in (3) confuses me. There is no minus in the standard moment generation function.&lt;br&gt;&#xA;Finally the steps of the of the calculations using this function are unclear to me. Are derivative of $r_t$ taken directly or just of the function $e^{-\lambda}r_t$ where the r_r is substituted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anybody clarify please?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are the first two moments of the $r_t$ I should get &#xA;$$E^*[r_T^1]=b(1-e^{-at})+e^{-at}r_0 $$&#xA;$$E^*[r_T^2]=e^{-2aT}[(b(1-e^{-at})+e^{-at}r_0)^2]+\frac{e^{-2aT}}{2a}[(e^{aT}-1)(b(e^{aT}-1)+2r_0)\sigma^2] $$&lt;/p&gt;&#xA;" OwnerUserId="18670" LastEditorUserId="19887" LastEditDate="2016-05-09T06:02:56.330" LastActivityDate="2016-05-09T06:02:56.330" Title="CIR model - nth moment generation $E^*[r_T^n]$" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;statistics&gt;&lt;probability&gt;&lt;stochastic-volatility&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25881" PostTypeId="1" CreationDate="2016-05-07T06:45:14.893" Score="1" ViewCount="32" Body="&lt;p&gt;I have a list of possible transforms, and I've read some confusing/contradictory stuff about the preferred order in which these operations are performed.  Maybe 1) the order is sometimes amorphous, and 2) some of the transforms are mutually exclusive?  Clarity in those ways would be useful, too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, in my very rough proposed order as I understand it (not meant to be a comprehensive list, and if I am missing something, please let me know):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1) Standardize dates&#xA;2) Categorical variables to multiple binary (dummy)&#xA;3) Discretize any quantitative variables you want&#xA;4) Missing Data Imputation?  Should this go above/below?&#xA;5) Scale and center&#xA;6) PCA/similar dimensionality reduction?&#xA;7) Forward/backwards selection?&#xA;8) Regularizers?  Order for 7) versus 8)?  Does 7) imply 8)?&#xA;9) Sub-sampling rows (should this actually be at/near the top (first)?  could it be either first or last?)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Bonus points if you can point me to a great conceptual explanation of how common econometric tests for robustness and autoregressive functional form fit into the above timeline of operations.  A simple list that gives me a timeline for both ml-style transforms and econometric tests/transforms, integrated in one place, is useful too, but I'd prefer a great explanation/link.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I apologize if I'm asking for something inappropriate.&lt;/p&gt;&#xA;" OwnerUserId="7641" LastActivityDate="2016-05-07T06:45:14.893" Title="Machine Learning Munging - order of transforms? + adding in econometric tests?" Tags="&lt;econometrics&gt;&lt;machine-learning&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25882" PostTypeId="1" AcceptedAnswerId="25883" CreationDate="2016-05-07T11:06:53.300" Score="0" ViewCount="157" Body="&lt;p&gt;I was wondering why someone would go to the trouble to generate random variables in scenarios that are not path dependent. Let me provide a simple (although somewhat contrived) example. Lets say that we want the terminal distribution of a vanilla European call option. We could generate terminal values for the underlying, then plug it into $\mathrm{max}(0;S_T - K)$, and there we have our terminal distribution of the call...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So here's the question. Why not simple do a percentile-to-percentile map from the underlying distribution to the derivatives distribution using equally spaced points? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not know if the following is correct, but someone I know told me that we do this because things occasionally fall apart when we use equally spaced points in a multivariate context... I however do not understand why this would happen?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was hoping someone could shed some light on this issue for me.&lt;/p&gt;&#xA;" OwnerUserId="15457" LastActivityDate="2016-05-10T05:51:50.307" Title="Stochastic Simulation vs percentile-to-percentile map" Tags="&lt;monte-carlo&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25883" PostTypeId="2" ParentId="25882" CreationDate="2016-05-07T12:07:13.520" Score="2" Body="&lt;p&gt;What you describe is a very simple quasi monte carlo, where the 'random' points are equally spaced in probability space. Like numerical integration. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes you can use it, but in general you will need the cumulative distribution to do percentile mapping. This very frequently is not known in closed form, and can be very expensive to compute numerically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, if you have the cdf in closed form then you will also have the option price in closed form and there is no need to evaluate numerically (Baksi and Madan have shown this amongst others).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have the characteristic function in closed form, then it is much more efficient to numerically invert for the option price directly rather than going through probabilities. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-05-07T12:07:13.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25884" PostTypeId="2" ParentId="25865" CreationDate="2016-05-07T12:20:57.160" Score="0" Body="&lt;p&gt;I think that Jensen inequality in this context is relevant to averaging return over time. And that when discounting over multiple periods, convexity needs to be accounted for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is to say that we cannot simply discount over multiple periods by using $$\frac{1}{(1+\sum{R_t})}$$ as a discount factor. We have to really use $$\frac{1}{\prod{(1+R_t)}}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The CAPM is a single period model. So we use it to value a single cash flow, we form an ex-ante estimate of beta that relates to that specific cash flow, and that is commensurate with the risk of that particular cash flow. And this beta applies to a particular horison. The resulting discount rate calculated then relates to that particular time horizon. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When Discounting a stream of cash flows we have to do this for each cash flow in order to be consistent with the single period nature of a model such as the CAPM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we make the simplifying assumption that all cash flow betas are the same then we could get around the problem you mention by consistently working with continuously compounded rates so that $$\frac{1}{\mathrm{exp}(\sum{R_t})}=\frac{1}{\prod{\mathrm{exp}{(R_t)}}}.$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using such a simplifying assumption is problematic however.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When valuing a single cash flow you need an expected return for the market proxy &lt;em&gt;over that particular period&lt;/em&gt;, as well as a risk free rate proxy &lt;em&gt;over a particular period&lt;/em&gt; and an estimated forward looking beta &lt;em&gt;over a particular period&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suppose one could try to use the Macaulay duration of the cash flows as the &quot;average&quot; time period for determining the desired inputs. But then we really are starting to stray significantly from the intended use of the CAPM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another question however is the validity of the CAPM in determining discount rates, but that is a different discussion all together I guess.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure if I answered the question since I am not completely sure what the question is.&lt;/p&gt;&#xA;" OwnerUserId="15457" LastEditorUserId="15457" LastEditDate="2016-05-07T12:35:24.800" LastActivityDate="2016-05-07T12:35:24.800" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25885" PostTypeId="1" AcceptedAnswerId="25892" CreationDate="2016-05-07T13:21:44.783" Score="1" ViewCount="57" Body="&lt;p&gt;I've identified 4 stocks that I think will gain 10 - 20 % when their next quarterly report is released. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you've only got access to a small amount of capital say USD10,000 then by buying USD2,500 worth of each stock and then each gaining 15% you'd only gain around USD1,500 which by itself isn't inconsequential, and if you had a large amount of capital employed 15% would be very welcome, but with a limited amount of capital is there a way to expand the overall profit?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you place a combined offer which would say: each of the 4 stocks will gain at least 14% when the next quarterly reports are released. This way if 3 gained 20%, and one gained 5% you would lose, but if all gained over the specified amount you would profit. Does such a thing exist?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not is there another method of increasing gains (other than borrowing additional funds) with a fixed amount of capital?&lt;/p&gt;&#xA;" OwnerUserId="3489" LastEditorDisplayName="user13444" LastEditDate="2016-12-18T22:02:35.930" LastActivityDate="2016-12-18T22:02:35.930" Title="Getting a better return on multiple combined stocks than individual stock gains (like a sports accumulator)" Tags="&lt;equities&gt;&lt;earnings&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25886" PostTypeId="2" ParentId="25579" CreationDate="2016-05-07T13:43:14.367" Score="-1" Body="&lt;ol&gt;&#xA;&lt;li&gt;Field(DY895) - i think this is what you are looking for.  To lookup the definition of a field use the function:  FLDS  (type that in the blinking terminal line at the top of the screen or type GOOG US FLDS )&lt;/li&gt;&#xA;&lt;li&gt;HELP HELP (green buttons at top to contact support) although based on my experience i try to avoid because hassle  and they are always trying to sell a damn terminal.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;where are you trying to backtest? bloomberg? or trying to export the data (i.e. excel)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&#xA;RE: 1) Field Information for DY895 - List of earnings announcement dates and periods, including estimated, comparable, and actual earnings per share (EPS) information. Returns the period, announcement date, announcement time, actual EPS, comparable EPS, and estimated EPS. &#xA;example in excel might be:  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;=BDP('AAPL US', DY895)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;would pull...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/VEjMj.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/VEjMj.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20323" LastEditorUserId="20323" LastEditDate="2016-12-13T08:07:40.030" LastActivityDate="2016-12-13T08:07:40.030" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25888" PostTypeId="2" ParentId="25869" CreationDate="2016-05-07T22:12:43.570" Score="0" Body="&lt;p&gt;The way the FX market prices is to get a baseline mid price and then apply skew(s) and spread(s). So the answer to your question is no. As for references, the way the FX market works is that liquidity in currency pairs is pushed either to EBS or Reuters. That's so that there isn't a monopoly on prices. For example, the most trading in the EURUSD takes place on EBS. For GBPUSD it's Reuters. And so on.... So actually the market isn't as &quot;decentralised&quot; as it's made out to be...&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2016-05-07T22:12:43.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25889" PostTypeId="1" AcceptedAnswerId="25891" CreationDate="2016-05-07T22:48:57.490" Score="0" ViewCount="215" Body="&lt;p&gt;I have just started reading Options Volatility and Pricing 2nd edition and I'm a little confused on forward contract pricing. The book states &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;F = C * (1+r*t) + (s*t) + (i * t) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where&#xA;    C = commodity price&#xA;    t = time to maturity&#xA;    r = interest rate&#xA;    s = annual storage cost per unit&#xA;    i = annual insurance cost per commodity unit &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most of this makes sense but I don't know why the interest rate is being factored into the forward price. Is this to factor in inflation for when the contract matures or is it from the assumption money will be borrowed to pay for it. The book doesn't make this abundantly clear. &lt;/p&gt;&#xA;" OwnerDisplayName="user20664" LastActivityDate="2016-05-08T01:36:34.700" Title="Pricing a physical commodity forward contract" Tags="&lt;interest-rates&gt;&lt;forward&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25890" PostTypeId="2" ParentId="25889" CreationDate="2016-05-07T23:50:18.587" Score="1" Body="&lt;p&gt;I'm going to try to answer my own question here and hopefully someone can come by and confirm I'm right before I accept my own answer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The key to a forward contract is there is no immediate exchange of goods or money. Just an agreement to do so at a later date. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To incentivize the seller of the contract it's important to remember if the transaction happened immediately the seller could take that money and immediately begin getting interest by investing it. By tying up the asset in a forward he foregoes that opportunity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's the purpose of the interest rate in the above calculation. You're adding to the price the interest of investing that money at an interest rate specified above. This interest rate  could be anything and it's up to the contract parties to agree on but using either the inflation rate or the risk free rate are two options that make sense. &lt;/p&gt;&#xA;" OwnerDisplayName="user20664" LastActivityDate="2016-05-07T23:50:18.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25891" PostTypeId="2" ParentId="25889" CreationDate="2016-05-08T01:36:34.700" Score="1" Body="&lt;p&gt;I think you are partially correct, but here's the way we look at these and we make markets in many of these products.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's a concept called &quot;arbitrage-free pricing&quot;.  Essentially there should no way to trade both sides of this and to make risk-free money.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So let's take the front month gold contract, the June (GCM6).   The first delivery date for it is June 1st.  The last delivery date is near the end of the month, probably about the 28th.  The price of spot gold is 1300/oz.  (I'm estimating since I'm not logged into bberg now).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I buy the contract and sell you spot gold now I will be perfectly hedged.  What does it cost me to repo that gold from now until delivery?  Sometimes it might work out that everyone is long gold and they are looking to lend it so I might want to borrow to the last delivery day and get paid as much as I can.  In that case the contract will trade at a premium since I'm going to get paid to borrow the collateral.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now in the case of most contracts, the seller gets to decide when to deliver.  So the optimal thing to do for the seller will actually be to deliver right away, even though I, as buyer wish that he wouldn't.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The pricing difference between the spot and the contract will reflect the cost of financing to collateral for the best scenario for the contract seller.  In our case, let's say the anual rate is 5%.  Let's say it's 15 days until earliest delivery.  So the financing cost will be 1300 * .05 *15/360=\$2.71.  That's what the holder of the collateral is paying to finance it.  The correct price then would be 1302.71.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the real world no one is going to put on an arbitrage trade for a few cents, so it will trade in a band.  But the main take away that you should have is that the difference between spot and the future is what it costs to hold the collateral.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Look at natural gas contracts.  They get very steep sometimes with an implied rate over 10% sometimes because it's really hard to store natural gas when there is too much of it.  (And you bleed some out in storage also).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope that's helpful.&lt;/p&gt;&#xA;" OwnerUserId="20092" LastActivityDate="2016-05-08T01:36:34.700" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="25892" PostTypeId="2" ParentId="25885" CreationDate="2016-05-08T01:41:08.537" Score="2" Body="&lt;p&gt;It depends on the timing of the expected price movement with respect to the report time, and the timing of the report. If you can say with very high certainty that the prices will move as you suspect, then you don't need to worry about diversification- you only need to buy one at a time, and only hold the stock you expect to be appreciating most quickly at each point in time. For example, suppose each report comes out at even intervals of one hour, and price moves most quickly in the hour directly following a report. Then, you buy stock one right before the report, ride the wave up, liquidate your positions, move into stock 2, then 3, then 4. Similarly, if the reports are all released simultaneously, you can time your trades to first take a position in the stock which will adapt most quickly to the new information, then when that one slows down, on to the next. If executed correctly, the first strategy will yield a compounded return of 46%-107%- supposing, of course that all trends are predicted with perfect accuracy, which in reality is a very hard assumption to make honestly.&#xA;Of course there are somewhat more sophisticated strategies if you could also hold short positions, or are aware of strong correlations of your predicted equities with other stocks.&lt;/p&gt;&#xA;" OwnerUserId="3559" LastActivityDate="2016-05-08T01:41:08.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25893" PostTypeId="1" CreationDate="2016-05-08T06:51:17.347" Score="3" ViewCount="1692" Body="&lt;p&gt;1) What is the difference between Cross Currency Swap and Cross Currency Basis Swap? Appreciate if this can be explained in layman's terms. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Could you advise me which swap rate to be used for the following scenario?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Selangor Bhd, a Malaysian company, would like to tap the Singapore bond market by issuing 10 years SGD100 million bond in Singapore.  The YTM is 3.00% p.a. and currency SGD/MYR exchange is 3.00. The proceeds will be used in Malaysia, hence Selangor Bhd would like to hedge its forex exposure (both the principal and interest). Which swap rate should Selangor Bhd use to calculate the coupon payment in MYR?  Also, which swap rate should Selangor Bhd use to hedge the principal sum, so that it repays the equivalent amount of proceeds it receive in MYR?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Is there a public source where I can find these swap rates?  &lt;/p&gt;&#xA;" OwnerUserId="20665" LastActivityDate="2016-05-10T19:06:12.690" Title="Cross Currency Swap" Tags="&lt;fixed-income&gt;&lt;fx&gt;&lt;interest-rate-swap&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="25894" PostTypeId="2" ParentId="25880" CreationDate="2016-05-08T07:50:13.677" Score="2" Body="&lt;p&gt;Your problem probably comes from the notations used.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let the &lt;em&gt;Moment Generating Function&lt;/em&gt; (MGF) of a random variable $X$ be defined as &#xA;$$ M_X(u) := E[e^{uX}] $$&#xA;From this definition, it entails that&#xA;$$ E(X^n) = M_X^{(n)}(u=0) = \frac{d^{n} M_X}{ d u^{n}}(u=0) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Knowing this, the function&#xA;$$ f_{\lambda}(t,r)=E[e^{-\lambda {r_{T}}}|r_t=r] $$&#xA;can be interpreted as the MGF $M_{X}(\lambda)$ of the random variable $X = (-r_T \vert\ r_t = r)$ (note the minus, and the conditioning).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Applying the definitions, we thus have that&#xA;\begin{align}&#xA; E[(-r_T)^n \vert r_t=r] &amp;amp;= \frac{d^{n} M_X}{ d \lambda^{n}}(\lambda=0)  \\&#xA;&amp;amp;= \left. \frac{d^{n} f_{\lambda}(t,r)}{ d \lambda^{n}} \right\vert_{\lambda=0}&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, noticing that &#xA;$$ (-r_T)^n = (-1)^n\ r_T^n $$&#xA;and that multiplying or dividing a quantity by $(-1)^n$ (deterministic) is strictly equivalent $\forall n\in\mathbb{N}$ gives your manual solution&#xA;$$  E[r_T^n \vert r_t=r] = (-1)^n \left. \frac{d^{n} f_{\lambda}(t,r)}{ d \lambda^{n}} \right\vert_{\lambda=0} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now how do you use that? Simply take the $n$-th derivative of the function $f$ with respect to $\lambda$, evaluate it for $\lambda=0$ and change sign if $n$ is odd to obtain the raw moment of order $n$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the MGF gives you &lt;em&gt;raw moments&lt;/em&gt;, not &lt;em&gt;centred moments&lt;/em&gt;. For centred moments you need some additional algebra. For instance, for the second centred moment ($n=2$), we could write: &#xA;$$ E[(X-E(X))^2] = E(X^2) - E(X)^2 = \mu_2 - \mu_1^2 $$&#xA;where $\mu_i$, $i=1,2$ are the raw moments of order $i$ obtained using the MGF as explained above.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-05-08T09:19:31.393" LastActivityDate="2016-05-08T09:19:31.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25895" PostTypeId="2" ParentId="22608" CreationDate="2016-05-08T08:23:33.817" Score="1" Body="&lt;p&gt;Portfolio return is simply weighted return of parts (and NOT the formula mentioned in your post) - e.g. if you invested \$100 total equally among the four funds (\$25 each), and each of those funds earned 1% on average, then on aggregate you made 1% return on \$100 and not 4%. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The trick (and the answer to your Q) lies in how you calculate these weights!! If you want to calculate 'sector' returns to your portfolio, say for Tech, your individual returns are 1.1%, 0.525% and so on; your respective weights would be calculated as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Weight of 1.1% = (proportion of 'A' in your fund)*(proportion of tech in A) / total weight of tech sector in your portfolio&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where,&#xA;total weight of tech sector in your portfolio = sum of term in numerator for all 4 cases (A, B, C &amp;amp; D)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you have these four weights (they'll add to 1 by construction) - you can calculate the weighted return for tech sector (specific to the tech sector's composition in your portfolio)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Overall portfolio return can now be written as (weight in sector 'i')*('blended' return of sector 'i', as calculated above).&lt;/p&gt;&#xA;" OwnerUserId="17405" LastActivityDate="2016-05-08T08:23:33.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25896" PostTypeId="2" ParentId="25865" CreationDate="2016-05-08T09:41:59.590" Score="2" Body="&lt;p&gt;What you are missing is that the cashflow itself is also a random variable. We assess the risk related to that cashflow by relating it to a linear measure of risk that is expressed in terms of variance and covariance... by happy accident this turns out to be beta, and if the CAPM actually works, turns out making our lives easier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you rewrite the CAPM in terms of prices instead of returns you get something that looks like&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Capital_asset_pricing_model#Asset_pricing&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Capital_asset_pricing_model#Asset_pricing&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P_0=\frac{1}{1+r_f}\left[\mathrm{E}(P_T) - \frac{ \mathrm{Cov}(P_T;R_M)(\mathrm{E}(R_M)-r_f)}{\mathrm{Var}(R_m)}\right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you are not discounting with an expected value...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What this formula tells us is that the expected present value of the cashflow is not the right price for a risk averse investor. The Risk averse investor requires an additional risk premium...&lt;/p&gt;&#xA;" OwnerUserId="15457" LastEditorUserId="15457" LastEditDate="2016-05-08T09:54:34.690" LastActivityDate="2016-05-08T09:54:34.690" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25897" PostTypeId="1" AcceptedAnswerId="26074" CreationDate="2016-05-08T11:02:15.267" Score="7" ViewCount="400" Body="&lt;p&gt;In &lt;a href=&quot;http://rady.ucsd.edu/faculty/directory/valkanov/pub/classes/mfe/docs/fama_french_jfe_1993.pdf&quot;&gt;Fama and French (1993)&lt;/a&gt;, p. 8, I read &lt;em&gt;&quot;In June of each year $t$ from 1963 to 1991, all NYSE stocks on CRSP are ranked on size (price times shares).&quot;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Later on the same page, they write  &lt;em&gt;&quot;Book-to-market equity, $BE/ME$, is then book common equity for the fiscal year ending in calendar year $t-1$, divided by market equity at the end of December of $t-1$.&quot;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;December seems fine: a year ends in December. &#xA;But why do they choose June and not December, too, for the size?&lt;/p&gt;&#xA;" OwnerUserId="8215" LastActivityDate="2017-03-16T19:28:13.363" Title="Why Fama and French sort on June's size data and not of some other period?" Tags="&lt;asset-pricing&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25898" PostTypeId="2" ParentId="25893" CreationDate="2016-05-08T17:33:20.707" Score="2" Body="&lt;p&gt;In an FX swap you exchange SGD and MYR payments at the beginning of the swap, and then again (in the opposite direction) at the end of the swap 10 years later.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a Cross Currency Basis Swap, in addition to these payments you also make interest payments quarterly. The party that initially received (i.e. borrowed) the SGD makes interest payments based on SGD Libor and the party that received MYR makes payments based on MYR Libor plus/minus a spread.  It is what you use if you want to hedge both principal and interest. It is essentially a swap of one [floating rate] coupon bond-like payment structure against another; the FX swap is more like a swap of zero coupon bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The word &quot;cross currency&quot; implies that two currencies are involved (SGD and MYR), the word &quot;basis&quot; refers to different references for interest calculation (one references SGD interest rates, the other references MYD interest rates).  &lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-05-10T01:44:42.410" LastActivityDate="2016-05-10T01:44:42.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25899" PostTypeId="2" ParentId="8843" CreationDate="2016-05-08T18:52:07.900" Score="3" Body="&lt;p&gt;Don't use TAQ.  The reporting times of the trades can be a few seconds delayed.  Use the exchange feeds.  There you can see which order crossed the spread.  The only issue that you will run into is hidden orders.  In that case you simply can't tell.  (eg:  The mkt is 30.00x 30.02 and then you see 30.01 trade.  You don't have any way to tell if there was a hidden offer or bid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For trades from dark pools they are really not possible to track since they all go to the ADF with a potential delay and there's no published book.&lt;/p&gt;&#xA;" OwnerUserId="20092" LastActivityDate="2016-05-08T18:52:07.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25900" PostTypeId="1" AcceptedAnswerId="25904" CreationDate="2016-05-08T21:19:17.447" Score="3" ViewCount="487" Body="&lt;p&gt;I would like to use Monte Carlo simulation to price some options. First I use standard approach where stock price is discribed by the following process:&#xA;$$S_T = S_0\exp \left[(r - 0.5\sigma^2)T + \sigma \sqrt{T}\varepsilon\right],$$&#xA;where $S_0$ is an initial stock price at time $t = 0$, $S_T$ is a stock price at time $T$, $T$ is a time step, $r$ is the risk free interest rate, $\sigma$ is a standart deviation if stock returns and $\varepsilon$ is an independent normally distributed variable $\varepsilon \sim \phi(0, 1)$&#xA;There is an assumption under this model that log returns of a stock price have a normal distribution, such that $\log{\frac{S_T}{S_0}} \sim \phi(\mu, \sigma^2)$, where (from Ito's Lemma) $\mu = (r - 0.5\sigma^2)T$ and $var = \sigma^2T . $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I assume that returns of a stock price follow &lt;a href=&quot;http://www.econ.boun.edu.tr/content/wp/EC2013_16.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Normal Inverse Gaussian distribution&lt;/a&gt; (NIG). My question is am I able just to plug into my formula for $S_T$ NIG proccess with estimated parameters (using MLE) instead of $\varepsilon$ and than compare option prices? Proccess will look as following:&#xA; $$S_T = S_0\exp \left[(r - 0.5\sigma^2)T + \sigma T\varepsilon^*\right],$$&#xA;where $\varepsilon^* \sim NIG(\hat{\mu}, \hat{\alpha}, \hat{\delta}, \hat{\beta}).$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess that properties of NIG don't allow me to do such manipulations but I am not sure where to find the solution to this problem. Any hints are welcome! &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Many thanks @Quantuple for help:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/GQDby.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/GQDby.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18345" LastEditorUserId="18345" LastEditDate="2016-05-11T18:27:59.763" LastActivityDate="2016-05-11T18:27:59.763" Title="Use NIG distribution to model stock path" Tags="&lt;simulations&gt;&lt;distribution&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25901" PostTypeId="2" ParentId="25893" CreationDate="2016-05-09T02:49:43.473" Score="1" Body="&lt;p&gt;They need to do 3 swaps &#xA;(1) Singapore IRS:   Receive fixed SGD vs Singapore floating rate for 10yrs on SGD 100mm&#xA;(2)  Currency Basis swap:  Receive Singapore floating versus paying MYR floating for 10 yrs.  This swap includes an exchange of principal at the start of the swap (pay SGD 100mm/ receive 33mm MYR) and an exchange of principal at the end in the opposite direction&#xA;(3) MYR IRS:  receive MYR floating versus paying MYR fixed on 33mm&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The data required is the 10yr IRS rates in SGD and MYR, and the 10yr basis swap between SGD floating rate and MYR floating rate.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-05-09T02:49:43.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25902" PostTypeId="1" AcceptedAnswerId="25916" CreationDate="2016-05-09T03:15:02.577" Score="2" ViewCount="373" Body="&lt;p&gt;Hi I am looking for some general clarification to Heath–Jarrow–Morton framework. I am analyzing a problem where the forward rate is modeled as&#xA;$$ f(t,T)=e^{\beta(T-t)} Z_t+h(T-t)  \tag{1}$$&#xA;for some constant $\beta$ and some smooth function $h:R \rightarrow \ R \ with \quad h(0)=0$ and some scalar diffusion&#xA;$$dZt=b(Z_t)dt+\rho dW_t^* \tag{2}$$&#xA;with continuous drift and functions $b(z)$ and $\rho(z)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To show that HJM drift condition implies that $\ \mathbf{b(z)=b+\beta z} \ $ and  $\ \mathbf{(\rho)^2=\alpha} \ $ for some constant b and $\alpha$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q1&lt;/strong&gt; &lt;br&gt;&#xA;&lt;strong&gt;Can anybody explain in simple terms what this above statement mean? what needs to be showed/proved? I am confused here what is the relation between the variables given in the  equations (1) and (2) with those $\alpha$ and b.&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is the analyzes I have done  on this problem. I understand the most of the transformations, but some points are unclear.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking the derivative of $f(t,T)$ in order to get $df(t,T)$ and substituting for $dz_t$ I get&#xA;$$df(t,T)=\big{(} -h'(T-t)+e^{\beta(T-t)}(b(z_t)-\beta z) \big{)} \  dt+e^{\beta(T-t)} \rho(z_t) dW_t^* \tag{3} $$&#xA;the Q-dynamics of the forward rates in HJM framework are of the form&#xA;$$f(t,T)=f(0,T) + \int_0^t \big{(}  \sigma(s,T) \int_s^T \sigma(s,u) \ du \big{)} \ ds + \int_0^t \sigma(s,T) dW_t^* \tag{4}$$ &#xA;or equivalently&#xA;$$ df(t,T)= \sigma(t,T) \int_t^T \sigma(t,u) \ du + \sigma(s,T) dW_t^*\tag{5}$$&#xA;therefore the HJM drift equals &#xA;$$e^{\beta(T-t)} \rho(z_t) \int_t^T e^{\beta(u-t)} \rho(z_t) \ du =\rho(z_t)^2 e^{\beta(T-t)} \frac{ e^{-\beta t}}{\beta} (e^{\beta T} - e^{\beta t})  \tag{6}$$&#xA;equating HJM drift with drift from eq (3) and substituting for $\tau=T-t$ yields the following equity&#xA;$$ \frac{\rho(z_t)^2}{\beta}  e^{\beta \tau}  (e^{\beta \tau} - 1) = -h'(\tau)+e^{\beta \tau}(b(z_t)-\beta z)   \tag{7}$$&#xA;assuming $\tau=0$ results in&#xA;$$ b(z)=h'(0)+\beta z  \tag{8}$$&#xA;comparing with the given equation&#xA;$$b(z)=b+ \beta z \tag{9}$$&#xA;we can infer that $b=h'(0)$&#xA;finally plugging $b(z)$ (8) into (7)  gives the $alpha$ value&#xA;$$\rho^2= \frac{\beta(e^{\beta \tau} h'(0)- h'(t))}{e^{\beta \tau}(e^{\beta \tau}-1)} \tag{10}$$&#xA;$$\alpha=\rho^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Further questions to this problem &lt;br&gt;&#xA;b and $\alpha$ have been derived from the drift condition. I don't understand in what sense does it prove the initial question? &lt;br&gt;&#xA;Does it implicitly mean that the RHS of (10) is a constant? &lt;br&gt;&#xA;what is the relation between the HJM drift and the coefficient of $dW_t^&#xA;*$ in (3)?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="18670" LastEditorUserId="11678" LastEditDate="2016-05-09T23:06:00.860" LastActivityDate="2016-05-09T23:07:57.433" Title="HJM framework problem - showing that HJM drift condition implies that $b(z)=b+βz$ and $(ρ)^2=α$" Tags="&lt;interest-rates&gt;&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;stochastic-volatility&gt;&lt;heath-jarrow-morton&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25903" PostTypeId="2" ParentId="25875" CreationDate="2016-05-09T06:20:08.077" Score="1" Body="&lt;p&gt;Your on the right track. See the link here for how the CBOE VXV - 3 month volatility index is calculated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cboe.com/micro/vxv/3monthvix.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.cboe.com/micro/vxv/3monthvix.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1764" LastActivityDate="2016-05-09T06:20:08.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25904" PostTypeId="2" ParentId="25900" CreationDate="2016-05-09T08:19:53.740" Score="2" Body="&lt;p&gt;Assuming you've used this &lt;a href=&quot;https://en.wikipedia.org/wiki/Normal-inverse_Gaussian_distribution&quot; rel=&quot;nofollow&quot;&gt;definition&lt;/a&gt; for the NIG distribution and that you've managed to come up with estimates $(\hat{\alpha}, \hat{\beta}, \hat{\mu}, \hat{\delta} )$ of the individual NIG parameters, your question boils down to: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;How to simulate paths from the global log-return process $R_t = \ln(S_t/S_0)$ for all $t \in [0,T]$, assuming i.i.d. $NIG(\hat{\alpha}, \hat{\beta}, \hat{\mu}, \hat{\delta} )-$distributed periodic log-returns (in your case daily)?&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;First of all, no, you cannot use the equation you mention. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet, because the NIG distribution is a special case of &lt;em&gt;normal variance-mean mixture&lt;/em&gt; (see &lt;a href=&quot;https://www.duo.uio.no/bitstream/handle/10852/10752/Groth_DUO.pdf?sequence=1&quot; rel=&quot;nofollow&quot;&gt;this document, page 14&lt;/a&gt;), if one lets&#xA;\begin{align}&#xA;\sigma^2 &amp;amp;\sim IG\left( \frac{\delta}{\gamma}, \delta^2 \right),\ \ \text{with } \gamma = \sqrt{ \alpha^2 - \beta^2 }  \\&#xA;\varepsilon &amp;amp;\sim \mathcal{N}(0,1) &#xA;\end{align}&#xA;then the random variable $X$ defined as&#xA;$$ X = \mu + \beta \sigma^2 + \sigma \varepsilon $$&#xA;follows a $NIG(\alpha,\beta,\mu,\delta)$ distribution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, let $r_{\delta t, i}$ denote the $\delta t$-period log-return observed for a given $t_i \in [0,T]$&#xA;$$ r_{\delta t, i} := \ln\left( \frac{S_{t_i}}{S_{t_i-\delta t}} \right) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then proceed as follows to generate realisations of the global return process $(R_t)_{t\geq 0}$.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Under the assumptions of i.i.d. NIG-distributed $\{r_{\delta t, i}\}$, estimate the NIG parameters $(\hat{\alpha}, \hat{\beta}, \hat{\mu}, \hat{\delta} )$ from historical data using your favourite method (Maximum Likelihood Estimation, Moment Matching etc.).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;To simulate the periodic log-returns $\{r_{\delta t,i}\}_{i=1,...,N}$ (in practice $N = T/\delta t$ where $T$ figures the horizon of your MC simulation and $\delta t$ the length of the period over which the individual periodic log-returns prevail) use the key result mentioned above by (i) generating $\sigma_i^2 \sim IG(\hat{\delta}/\hat{\gamma}, \hat{\delta}^2)\ \ \text{i.i.d.}$ (see &lt;a href=&quot;https://en.wikipedia.org/wiki/Inverse_Gaussian_distribution&quot; rel=&quot;nofollow&quot;&gt;here for instance&lt;/a&gt;), (ii) generating $\varepsilon_i \sim \mathcal{N}(0,1) \ \ \text{i.i.d.}$ (iii) computing&#xA;$$ r_{\delta t,i} = \hat{\mu} + \hat{\beta} \sigma_i^2  + \sigma_i \varepsilon_i $$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Once all $\{r_{\delta t, i}\}_{i=1,...,N}$ have been simulated, build the global return process $(R_t)_{t\geq 0}$ by aggregating a certain number $n$ of periodic returns. Indeed, for any fixed $t \in [0,T] $, the global log-return $R_t := \ln(S_t/S_0)$ computes as:&#xA;\begin{align}&#xA;R_t &amp;amp;= \ln\left(\frac{S_t}{S_0}\right) \\&#xA;    &amp;amp;= \ln\left(\frac{S_t}{S_{t-\delta t}} \frac{S_{t-\delta t}}{S_{t- 2\delta t}} \dots \frac{S_{\delta t}}{S_{0}}\right) \\&#xA;&amp;amp;= \sum_{ t_i \in [\delta t, t] } \ln \left( \frac{S_{t_i}}{S_{t_i-\delta t}} \right) \\&#xA;&amp;amp;= \sum_{i \leq n} r_{\delta t,i}&#xA;\end{align}&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This method was first proposed by Rydberg in:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;T. H. Rydberg. The normal inverse Gaussian Lévy process: simulation and approximation. Comm. Statist. Stochastic&#xA;  Models, 13(4):887–910, 1997.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-05-11T15:17:52.193" LastActivityDate="2016-05-11T15:17:52.193" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="25905" PostTypeId="1" CreationDate="2016-05-09T08:37:37.387" Score="0" ViewCount="1958" Body="&lt;p&gt;I'm performing a study where I compare the Fama-French three factor model to the CAPM on the Swedish industrials industry. I do this to compare which of the models is the best performer, but also if FF3FM better explains stock returns industry-wise than just country-wise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my study I want to motivate why I did not choose to compare the four- or five-factor model with CAPM, but I have problems with finding good explanations. One would be that the four-factor model is commonly used with mutual funds (while I measure single stocks), why is that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any other suggestions why the three-factor would be more interesting or better to perform a study on?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="20296" LastEditorUserId="2299" LastEditDate="2016-09-15T05:48:19.087" LastActivityDate="2017-08-11T18:18:33.907" Title="Fama-French three-factor model vs four-factor (Carhart) and five-factor model" Tags="&lt;regression&gt;&lt;research&gt;&lt;factor-models&gt;&lt;factor-investing&gt;" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25907" PostTypeId="1" CreationDate="2016-05-09T13:25:48.610" Score="0" ViewCount="34" Body="&lt;p&gt;Assume, you have a choice between two investments that both cost \$1000 each, however investment A pays \$20 a year and \$950 at the end of year 5 but investment B pays \$10 a year and \$1000 at the end of the 5 years. Which investment should I choose based on it offering a better return?&lt;/p&gt;&#xA;" OwnerUserId="20677" LastActivityDate="2016-05-09T14:36:42.887" Title="Choice between 2 investments that cost the same but offer different interest and face value" Tags="&lt;investment&gt;&lt;present-value&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2016-05-09T15:57:28.607" ContentLicense="CC BY-SA 3.0" />
  <row Id="25909" PostTypeId="2" ParentId="25289" CreationDate="2016-05-09T14:05:44.737" Score="3" Body="&lt;p&gt;The derivation in Appendix A of the paper &lt;a href=&quot;http://www.actuaires.org/AFIR/colloquia/Toronto/Lin_Tan.pdf&quot; rel=&quot;nofollow&quot;&gt;Valuation of Equity-Indexed Annuities under Stochastic Interest Rates&lt;/a&gt; that you mentioned is &lt;strong&gt;Wrong&lt;/strong&gt;: the Girsanov transformation is applied to an $n$-dimensional Brownian motion, where the components are &lt;strong&gt;independent&lt;/strong&gt;. However, for the case here with $n=2$, the Brownian motions are dependent, we can not naively combine them together to form a two-dimensional Brownian motion and then apply the Girsanov transformation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your case, we assume that, under the real-world probability measure $\mathbb{P}$,&#xA;\begin{align*}&#xA;dS(t) &amp;amp;= \mu(S(t)) dt + \sigma(S(t)) dW(t)\\&#xA;dr(t) &amp;amp;= a(b-r(t)) dt + \sigma(r(t)) dZ(t),\\&#xA;\end{align*}&#xA;where $\{W(t), t \ge0\}$ and $\{Z(t), t \ge0\}$ are two standard Brownian motions with instantaneous correlation $\rho$. Based on Cholesky decomposition, we can re-write the above dynamics as&#xA;\begin{align*}&#xA;dS(t) &amp;amp;= \mu(S(t)) dt + \sigma(S(t)) dW(t)\\&#xA;dr(t) &amp;amp;= a(b-r(t)) dt + \sigma(r(t)) d\big(\rho W(t) + \sqrt{1-\rho^2} B(t)\big),&#xA;\end{align*}&#xA;where $\{W(t), t \ge0\}$ and $\{B(t), t \ge0\}$ are two &lt;strong&gt;independent&lt;/strong&gt; standard Brownian motions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To obtain the dynamics under the risk-neutral probability measure $\mathbb{Q}$, let &#xA;\begin{align*}&#xA;\lambda(t) = \frac{r(t) - \mu(S(t))}{\sigma(S(t))}.&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;\frac{d\mathbb{Q}}{d\mathbb{P}}\big|_t = \exp\left(-\frac{1}{2} \int_0^t \lambda^2(s)ds + \int_0^t \lambda(s)dW_s \right).&#xA;\end{align*}&#xA;Moreover, under the measure $\mathbb{Q}$,&#xA;\begin{align*}&#xA;\widehat{W}(t) &amp;amp;= W(t) - \int_0^t \lambda(s)ds, \mbox{ and}\\&#xA;\widehat{B}(t) &amp;amp;= B(t),&#xA;\end{align*}&#xA;are two &lt;strong&gt;independent&lt;/strong&gt; standard Brownian motions. Consequently,&#xA;\begin{align*}&#xA;dS(t) &amp;amp;= r(t) dt + \sigma(S(t)) d\widehat{W}(t)\\&#xA;dr(t) &amp;amp;= \big[a(b-r(t)) + \rho \lambda(t) \sigma(r(t)) \big]dt + \sigma(r(t)) d\big(\rho \widehat{W}(t) + \sqrt{1-\rho^2} \widehat{B}(t)\big).&#xA;\end{align*}&#xA;Note the extra term $\rho \lambda(t) \sigma(r(t))$ in this dynamics under the risk-neutral measure $\mathbb{Q}$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-05-09T23:20:59.050" LastActivityDate="2016-05-09T23:20:59.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25910" PostTypeId="2" ParentId="25907" CreationDate="2016-05-09T14:36:42.887" Score="2" Body="&lt;p&gt;Why don't you calculate the IRR of each investment? (aside from all the issues with &lt;a href=&quot;http://www.investopedia.com/exam-guide/cfa-level-1/corporate-finance/advantages-disadvantages-npv-net-present-value-irr-internal-rate-of-return.asp&quot; rel=&quot;nofollow&quot;&gt;IRR&lt;/a&gt;). &lt;/p&gt;&#xA;" OwnerUserId="17175" LastActivityDate="2016-05-09T14:36:42.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25912" PostTypeId="1" CreationDate="2016-05-09T15:22:09.440" Score="0" ViewCount="939" Body="&lt;p&gt;Basically if someone want to setup a hedge fund how much cost to buy trading software such as Flextrade, portware, Sungaurd or Bloomberg for hedge fund? &lt;/p&gt;&#xA;" OwnerUserId="19972" LastActivityDate="2016-07-22T23:50:03.760" Title="How Much cost to setup trading platform such as Flextrade, portware, Sungaurd or Bloomberg for hedge fund?" Tags="&lt;trading-systems&gt;&lt;hedge-fund&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25914" PostTypeId="2" ParentId="25912" CreationDate="2016-05-09T15:37:30.067" Score="1" Body="&lt;p&gt;I don't know about the others,but the base for Bloomberg is about 1200/month before any useful real-time data.&lt;/p&gt;&#xA;" OwnerUserId="20092" LastActivityDate="2016-05-09T15:37:30.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25916" PostTypeId="2" ParentId="25902" CreationDate="2016-05-09T22:52:12.903" Score="3" Body="&lt;p&gt;You almost get there. However, you ca not conclude that $\rho^2$ is a constant based on $(10)$. Note that, from your $(7)$ and $(8)$, &#xA;\begin{align*}&#xA; \frac{\rho(z_t)^2}{\beta}  e^{\beta \tau}  (e^{\beta \tau} - 1) = -h'(\tau)+e^{\beta \tau}h'(0).&#xA;\end{align*}&#xA;Taking derivative with respect to $\tau$ on both sides, we obtain that&#xA;\begin{align*}&#xA;\frac{\rho(z_t)^2}{\beta} \left(2\beta e^{2\beta \tau} -\beta e^{\beta \tau}\right) = -h''(\tau)+\beta e^{\beta \tau}h'(0).&#xA;\end{align*}&#xA;Then, setting $\tau=0$, &#xA;\begin{align*}&#xA;\rho(z_t)^2 = -h''(0)+\beta h'(0).&#xA;\end{align*}&#xA;That is, $\rho(z_t)^2=\alpha$ is a constant, where $\alpha = -h''(0)+\beta h'(0)$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-05-09T23:07:57.433" LastActivityDate="2016-05-09T23:07:57.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25918" PostTypeId="2" ParentId="25850" CreationDate="2016-05-10T05:36:54.000" Score="1" Body="&lt;p&gt;That all looks correct to me. It might be a bit more natural to convert the one day returns into prices and then compute the five day returns from those, but it's of course equivalent. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your final question, you are generating a sequence of random variables (the quantiles) and want to know how good your estimate of the mean is. A practical choice would be to estimate the standard error of the mean in the usual way. &lt;/p&gt;&#xA;" OwnerUserId="20681" LastActivityDate="2016-05-10T05:36:54.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25919" PostTypeId="2" ParentId="25882" CreationDate="2016-05-10T05:51:50.307" Score="0" Body="&lt;p&gt;Your approach is sensible for a single variate case if the cdf is available, but does (as your friend said) break down for more variates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One issue with multivariate case is the &quot;curse of dimensionality&quot; - as the number of variates increases your number of samples will get infeasibly large very quickly. To address this, one can use a low discrepancy sequence (eg Sobol) rather than a uniform grid. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another issue is that even if the terminal marginal distributions are all known, the terminal joint distribution may not be. Of course, one can pick a copula, but this may not be sufficiently accurate. &lt;/p&gt;&#xA;" OwnerUserId="20681" LastActivityDate="2016-05-10T05:51:50.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25920" PostTypeId="2" ParentId="25848" CreationDate="2016-05-10T06:09:46.160" Score="1" Body="&lt;p&gt;1 is wrong. The implied vol is a convenient way to look at the option price, nothing more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2 is an observed fact for equities in general but not the case for some other assets eg commodity futures. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;3 is also an observed fact for equities generally (but not for single stocks with short time to expiry).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If 1 and 2 were true, then 3 would naturally follow. If we use a local volatility model (where instantaneous vol is a function of the stock price) then the shape of the local vol (from statement 2) would determine the shape of the implied vol (statement 3).&lt;/p&gt;&#xA;" OwnerUserId="20681" LastActivityDate="2016-05-10T06:09:46.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25921" PostTypeId="2" ParentId="25848" CreationDate="2016-05-10T07:35:17.527" Score="3" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;You can show that &quot;the implied variance of an ATM short maturity option is equal to the expectation under the risk neutral measure of the integrated variance over the life of the option.&quot; As you move away from the assumptions: ie not ATM, longer maturity, risk neutral measure far from true, then the forecasting power diminishes. (Google 'stochastic volatility ghysels harvey renault')&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It holds for stock indices as an empirical observation. Not any asset. There are models that capture it through dynamics, eg negative correlation between spot shocks and vol shocks (leverage effect). &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Put option are an insurance against bad states of the world (ie stock market crashes). Therefore market participants are willing to pay a bit more for them (buyers) or are more reluctant to write them (sellers). The outcome is a higher option price, which is reflected by a higher IV. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-05-10T07:35:17.527" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25923" PostTypeId="1" AcceptedAnswerId="25925" CreationDate="2016-05-10T08:51:14.433" Score="2" ViewCount="606" Body="&lt;p&gt;Suppose we have :&#xA;$\frac{dS_{t}}{S_{t}}= \sigma dW_{t}$ with $\sigma_{t}$ a stochastic volatility process.&#xA;How to compute $\mathbb{E}^{Q}[(S_{T}-K)+]$ ? Is there a BS alike formula : &quot;$S_{0}N(d+)-Ke^{-rT}N(d-)$&quot; ?&#xA;Tx !&lt;/p&gt;&#xA;" OwnerUserId="15738" LastEditorUserId="19887" LastEditDate="2016-05-10T09:54:06.047" LastActivityDate="2016-05-10T16:14:46.360" Title="Stochastic volatility" Tags="&lt;black-scholes&gt;&lt;stochastic-volatility&gt;&lt;pricing-formulae&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25925" PostTypeId="2" ParentId="25923" CreationDate="2016-05-10T09:37:19.760" Score="7" Body="&lt;p&gt;[&lt;strong&gt;Short answer&lt;/strong&gt;]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No closed-form formula in general. You need to resort to numerical methods. Monte Carlo is preferred by most practitioners but you could also use Finite Difference schemes (and sometimes even Fourier inversion techniques depending on the model used and the instruments to be priced).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[&lt;strong&gt;Long answer&lt;/strong&gt;]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One usually distinguishes between 2 classes of (pure diffusion) models characterised by the SDE (*)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ d S_t = \sigma_t S_t dW_t $$&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;local volatility&lt;/strong&gt; models are such that $\sigma_t := \sigma(t,S_t)$, see seminal work of Dupire in that area. Except for the degenerate case $\sigma_t = \sigma(t)$, no closed form formulas exist and one has to resort to numerical methods such as Finite Differences schemes to solve the pricing PDE (which can be shown to be a straightforward generalisation of the Black-Scholes PDE) or Monte Carlo to simulate paths of the process $(S_t)_{t\geq 0}$ by discretising the SDE mentioned above (there are numerous possible discretisation schemes).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;stochastic volatility&lt;/strong&gt; models where $\sigma_t$ (or sometimes the instantaneous variance $v_t = \sigma_t^2$) possesses its own source of stochasticity - i.e. its own driving Brownian motion, correlated or not to that which drives the spot price - you therefore find yourself with a system of SDEs, one for the stock price, one for the volatility/variance, see seminal work of Heston, Schobel-Zhu, Stein &amp;amp; Stein and many others in that area. Although Finite Difference and Monte Carlo methods can be used for stochastic volatility models as well, these models were first made popular because they allowed to derive semi closed-form solutions expressed as Fourier transforms for simple instruments (typically European vanilla options and forward starts). These Fourier inversions can be made blazing fast: much faster than any Monte Carlo or Finite Difference scheme. Still, this will never be as fast as a plain evaluation of the BS pricing formula.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(*) There exist other types of diffusion models that are not described by the SDE mentioned above, notably the class of time-changed Lévy models mentioned in @Kiwiakos answer.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-05-10T16:14:46.360" LastActivityDate="2016-05-10T16:14:46.360" CommentCount="19" ContentLicense="CC BY-SA 3.0" />
  <row Id="25926" PostTypeId="2" ParentId="25923" CreationDate="2016-05-10T12:26:14.710" Score="2" Body="&lt;p&gt;The answer is yes. In fact, there always exist a 'Black Scholes like' formula. Easy to show too. If the risk neutral distribution of the price has cumulative density $P$ and probability density $p$, then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;E(S-K)^+=E((S-K)\ 1_{S&amp;gt;K})=E(S\ 1_{S&amp;gt;K})-K\ E(1_{S&amp;gt;K})&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second expectation is just $P(K)$, ie the probability that the option ends up in the money. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first expectation is a bit trickier, but it can be written as $\int_K^\infty s p(s) ds$. The trick is to multiply and divide with $S_0$ and acknowledge that since under the risk neutral measure the price is a martingale, then $S_0=\int_0^\infty s p(s) ds $.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the first expression is written as&#xA;$$&#xA;E(S\ 1_{S&amp;gt;K})=S_0 \frac{\int_K^\infty s p(s) ds}{\int_0^\infty s p(s) ds} = S_0 P^*(K)&#xA;$$&#xA;You can confirm that the fraction (as a function of the strike ie $P^*$ above) is indeed a cumulative density. It is positive, increasing, and integrates to one. It is actually the Delta of the option. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And we have written the price in a 'Black-Scholes like' way as&#xA;$$&#xA;C = S_0 P^*(K) - K\ P(K)&#xA;$$&#xA;Spot times Delta minus Strike times Exercise Probability. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the expression Heston gives in his paper, which was the first with a semi-closed form for stoch vol. Then it was generalised in Bakshi and Madan. Also this expression is widely used for Levy models, which are subordinated Brownian motions (ie random volatility). VG, NIG, etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice of course the distribution might not be readily available, and we might need to compute the quantities numerically. Or take other shortcuts that do not exploit this representation (eg Carr Madan). &lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2016-05-10T12:51:00.203" LastActivityDate="2016-05-10T12:51:00.203" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25929" PostTypeId="2" ParentId="25824" CreationDate="2016-05-10T13:59:50.323" Score="0" Body="&lt;p&gt;After looking for an answer on another website, this formula is right.&lt;/p&gt;&#xA;" OwnerUserId="15650" LastActivityDate="2016-05-10T13:59:50.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25931" PostTypeId="2" ParentId="25850" CreationDate="2016-05-10T17:46:39.023" Score="2" Body="&lt;p&gt;Two comments:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Normal returns should always be in $[-1,+\infty)$. I believe that the way you sample $R_i$ from Stable directly violates that. You might want to sample $\log (1+R_i)$ from Stable instead. The question is very poorly worded. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;For the sampling distribution of a percentile you can invoke order statistics. It will follow a transformation of Beta distribution. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Edit: Regarding your comment on point 2:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If a random variable $X$ follows any continuous distribution with cdf $F(x)=P[X&amp;lt;x]$ then the random variable $U=F(X)$ will follow a uniform distribution. Or, going the other way round, if $U$ is uniform, then $X=F^{-1}(U)$ will have the required distribution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note that $F$ is a monotonic transformation, that is to say if I have a sample $X_1&amp;gt;X_2&amp;gt;\cdots&amp;gt;X_n$ then the transformed $U_1&amp;gt;U_2&amp;gt;\cdots&amp;gt;U_n$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One can show that if I draw a sample of $N$ from a uniform distribution, then the $k$th smallest, denoted $U_{(k)}$, will follow a Beta distribution $B(k, N-k+1)$, say with cdf $Q(u;k,N) = P[U_{(k)}&amp;lt;u]$. If I want to work with a given percentile $p$, then I can set $k=pN$, and the distribution of the percentile will have cdf $Q(u;pN, N)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Putting the two together yields that the cdf of the $p$th percentile of $N$ draws of $X$ will have cdf $Q(F(x);pN,N)$. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2016-06-06T20:36:04.720" LastActivityDate="2016-06-06T20:36:04.720" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25932" PostTypeId="1" CreationDate="2016-05-10T18:02:54.187" Score="2" ViewCount="255" Body="&lt;p&gt;Is there a public source or a paid service that provides FF3 (or FF4 = &quot;Carhart&quot;) factor loadings for US traded ETFs and Mutual Funds? Something that is regularly updated and that provides comparable figures (same time interval, for ex.) for all funds it covers?&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2016-05-10T18:02:54.187" Title="Fama-French Factors for ETFs and MFs" Tags="&lt;etf&gt;&lt;factor-loading&gt;&lt;fama-french&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25933" PostTypeId="1" CreationDate="2016-05-10T18:13:49.513" Score="2" ViewCount="873" Body="&lt;p&gt;I am trying to find the correlation between the returns of two indices over a long period of time (10 years+) . Should I be using the index daily price level or the index daily total return? Most places that I have seen have suggested that I should be using the daily returns. I have read numerous issues with regards to using the price level, and few criticisms of using returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BUT how can you explain the following using returns over price for correlation. To be simple, let's consider a 3 day period. Index A's returns over the 3 days are +3%, +4%, +5%. Index B's returns over the 3 days are -3%, -2%, -1%. Assuming a start point of 100 for each index, Index A goes from 100 to 103 to 107 to 112 over the 3 days. Index B goes from 100 to 97 to 95 to 94. Clearly these indices are very negatively correlated. They are moving in the exact opposite direction! To that point, the price correlation is -0.937. BUT the return correlation is a +1.0. This makes me think that using price levels is better than returns. Thoughts? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;John &lt;/p&gt;&#xA;" OwnerUserId="20688" LastActivityDate="2016-05-10T19:17:03.063" Title="Correlation: Use Price or Return? Return doesn't make sense" Tags="&lt;correlation&gt;&lt;price&gt;&lt;return&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ClosedDate="2016-05-10T19:29:15.260" ContentLicense="CC BY-SA 3.0" />
  <row Id="25934" PostTypeId="2" ParentId="25933" CreationDate="2016-05-10T19:03:50.623" Score="2" Body="&lt;p&gt;Actually prices dont make sense as they are correlated with previous samples (prices), returns are not. Better will be difference between prices, but then you dont have reference point and comparability between assets, so eventually you need returns. At the end that is what you are interested in I think as profit is usually measured in return.&lt;/p&gt;&#xA;" OwnerUserId="6175" LastEditorUserId="6175" LastEditDate="2016-05-10T19:11:20.507" LastActivityDate="2016-05-10T19:11:20.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25935" PostTypeId="2" ParentId="25893" CreationDate="2016-05-10T19:06:12.690" Score="3" Body="&lt;p&gt;Firstly, some instruments:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FX Swap, also known as an FX Forward: exchange of principals at start, and exchange back at end. The back exchange is at an adjusted FX rate, which differs from the spot rate by the quoted number of forward points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Non-Deliverable Forward FX (NDF): much the same as an FX Forward above, but delivery is of the USD (usually) equivalent of the net payment, not the currency itself. There is no exchange of principal because there is no currency delivery.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cross currency Swap (fixed/float): A series of regular fixed rate payments in one currency (usually the minor currency) is swapped for  floating rate payments in the other. For example, 3% MYR vs USD Libor flat. There is generally a fixed spot rate for the principals of the two legs, and exchange of principal front and back. You can also trade fixed/fixed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cross currency basis swap: a series of floating rate payments in one currency (e.g. USD 3m Libor) is exchanged for a series of floating rate payments plus basis in the other (e.g. Euribor + 30bp). There is generally an exchange of principal, and some have embedded resets of the principals to mitigate the spot rate effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I understand it, you want to sell bonds in ccy A, and receive ccy B. So you want to receive fixed on ccy A to pay as coupons on the bond. Doing a fixed/fixed cross currency swap receiving fixed on Ccy A, and paying fixed on Ccy B would achieve that. It would mean you only need to post collateral to one bank, and only in ccy B.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you could do a fixed/float swap receiving fixed in ccy A and paying float in ccy B. You either accept that variability or swap the ccy B float for ccy B fixed by doing an IRS in ccy B.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally you could do an IRS in A receiving fixed and paying float, a cross currency basis swap A to B receiving float A, paying float B, and a B IRS paying fixed and receiving float. But for a corporate it would be hard to justify doing 3 trades instead of 1, with the associated bilateral risks and collateral needs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Often going directly between A and B for minor currencies is illiquid and thus less competitive, so you could go via USD, either with an A/USD fixed/float and a B/USD fixed/float or two fixed/fixed. This approach, while being two trades instead of one, uses two relatively liquid instruments which you will find quoted on Bloomberg, Reuters and can be quoted by multiple banks. In the event of a counterparty default, a replicating trade can be more easily done with a new bank for the broken half. More transparent and easier on everyone from Treasury to compliance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The choice of instruments is then determined by which are the liquid markets in the currencies involved, at the maturities you are seeking.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2016-05-10T19:06:12.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25936" PostTypeId="2" ParentId="25933" CreationDate="2016-05-10T19:17:03.063" Score="0" Body="&lt;p&gt;I suspect that you are mixing correlation and cointegration. What you describe as the co-movement of prices sounds like cointegration. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-05-10T19:17:03.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25937" PostTypeId="1" CreationDate="2016-05-10T22:26:44.023" Score="-1" ViewCount="76" Body="&lt;p&gt;I have a problem right now at work. For certain business segments, some sales target are established each year. These targets are established based on the managers feelings. It's like this: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Manager: &quot;so we grew 10% last year&quot;&lt;br&gt;&#xA;Employee: &quot;yes, economic conditions where good&quot;&lt;br&gt;&#xA;Manager: &quot;ok I feel this year we can grow 8%&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm currently analysing if this forecast tends to be too low and if that is one of the reason why managers tend to grow a lot more than initial target. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I showed that we are getting marks 130% over target on average. Managers just says it was because those years economic conditions where much more favorable than what they expected when the target was set. Which is kind of true, but that doesn't necessarily mean over performance is strictly cause favorable economic conditions. How could prove if this is true, what model could I use to try to isolate the effect of economic growth on sales target? I already try to explain variability on target growth using time series (ARIMA model). And economic inputs tend to be significant and tend to have positive significant parameters but what does this tell me?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I explain variability in target result in one year based on economic variability? If I can say that only a small part of target variability is explained by variability on economic growth I could argue that target might be too low. But how do I implement this analysis. It sound like I'm looking for some kind of R squared but I'm not sure how to make it from time series data.&lt;/p&gt;&#xA;" OwnerUserId="20690" LastEditorDisplayName="user13444" LastEditDate="2016-12-20T22:32:46.760" LastActivityDate="2017-04-21T22:06:00.690" Title="Is my demand prediction too low?" Tags="&lt;time-series&gt;&lt;forecasting&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25939" PostTypeId="1" AcceptedAnswerId="25941" CreationDate="2016-05-11T02:08:44.413" Score="1" ViewCount="111" Body="&lt;p&gt;Okay this is probably going to be an extremely easy/straightforward question but I thought I should post it here just to double check. Suppose I have a payoff $\Phi = (S_{T}-K)^{+}$. Now let's say I now have an equation: $u = s\partial_{s}\Phi - \Phi$, this means that given a payoff $\Phi$ as given above then, substituting this payoff into the equation and assuming $S_T = S_{0}\exp((r-1/2)T+\sigma\sqrt{T}Z_i))$ then I should get: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$u = max(S_{T},0) - max(S_{T}-K,0)$, right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And from this equation, the possible solutions should be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $S_{T} &amp;gt; K$, $u = K$, if $S_{T} &amp;lt; K$ and $S_{T} &amp;gt; 0$, $u = S_{T}$, and if $S_{T} &amp;lt; K$ and $S_{T} &amp;lt; 0$ then $u = 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is all of this correct? I know this is really trivial but I just thought I should check...&lt;/p&gt;&#xA;" OwnerUserId="20543" LastEditorUserId="20543" LastEditDate="2016-05-11T02:23:05.307" LastActivityDate="2016-05-11T04:15:42.110" Title="Differentiating a Payoff" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;payoff&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25940" PostTypeId="2" ParentId="25848" CreationDate="2016-05-11T02:29:56.547" Score="0" Body="&lt;p&gt;Implied Volatility means the option is overpriced versus the model price. It means I'm paying more to buy an option than normally. For example, when a gap happens on the stock, the option price is high. It has no bearing on what will happen, but more on what did. The Bid and Ask price are set by people with expectations. And those prices are out of line with &quot;normal&quot; due to some recent move and expectation. I teach Day Trading and have built software for this. It's not a prediction. It's a mistake (distraction) to treat it as a prediction. This is what traders want (Ask). As a writer of contracts, it would be risk and possible reward. Still gets back to using something else as confirmation of a trend.&#xA;The night before Earnings announcements there are often big price increases for the 2 weeks leading up to that day. These are expectations again and reflect risk to the writer. However, in my research, 9 out of 10 options are NOT worth while to buy the high imp vol options. The 1 that works doesn't pay for the 9 that failed. Being a seller is statistically better, but if one that goes off is like recent GOOG or AMZN, selling a naked option is very expensive.&lt;/p&gt;&#xA;" OwnerUserId="20460" LastActivityDate="2016-05-11T02:29:56.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25941" PostTypeId="2" ParentId="25939" CreationDate="2016-05-11T04:15:42.110" Score="0" Body="&lt;p&gt;$$s\partial_{s}\Phi = S_T I_{S_T&amp;gt;K}.$$&#xA;so no.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I am not absolutely sure whether you want to differentiate wrt S_T or S_0 however.)&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2016-05-11T04:15:42.110" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25942" PostTypeId="1" AcceptedAnswerId="25945" CreationDate="2016-05-11T06:20:19.620" Score="33" ViewCount="5977" Body="&lt;p&gt;There is a big body of literature on &lt;a href=&quot;https://en.wikipedia.org/wiki/Econometric_model&quot;&gt;econometric models&lt;/a&gt; like &lt;a href=&quot;https://en.wikipedia.org/wiki/Vector_autoregression&quot;&gt;ARIMA&lt;/a&gt;, ARIMAX or &lt;a href=&quot;https://en.wikipedia.org/wiki/Vector_autoregression&quot;&gt;VAR&lt;/a&gt;. Yet to the best of my knowledge practically nobody is making use of that in Quantitative Finance. Yes, there is a paper here and there and sometimes you find an example where stock prices are being used for illustrative purposes but this is far from the main stream.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question&lt;/strong&gt;&lt;br&gt;&#xA;Is there a good reason for that? Is it just because of tradition and different schools of thought or is there a good technical explanation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(By the way I was pleased to find an &lt;code&gt;arima&lt;/code&gt; tag here... but this is again a case in point: only 8 out of nearly 7,000 questions (~ 0.1% !) use this tag! ...ok, make this 9 now ;-)&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2017-03-03T12:48:14.827" Title="Why aren't econometric models used more in Quant Finance?" Tags="&lt;modeling&gt;&lt;forecasting&gt;&lt;econometrics&gt;&lt;models&gt;&lt;arima&gt;" AnswerCount="5" CommentCount="5" FavoriteCount="33" ContentLicense="CC BY-SA 3.0" />
  <row Id="25943" PostTypeId="2" ParentId="25942" CreationDate="2016-05-11T06:34:32.987" Score="15" Body="&lt;p&gt;I think you need to differentiate between &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1717163&quot;&gt;Q-quants vs P-quants&lt;/a&gt;. The former might not use Econometrics, but P-quants use them a lot. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2016-05-11T08:09:43.167" LastActivityDate="2016-05-11T08:09:43.167" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25944" PostTypeId="2" ParentId="25942" CreationDate="2016-05-11T08:31:11.227" Score="6" Body="&lt;p&gt;My answer is very much in the spirit of Kiwiakos' answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. in this &lt;a href=&quot;http://arxiv.org/abs/1009.3638&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; (where I am one of the coauthors) we use VMA (vector moving average) models (in the multivariate case) and AR models in the univariate case to calculate proper scaling of volatility or its contributions if there are (cross-) auto-correlations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This happens in the P world due to asynchronous markets. It also happens if you valuate a stock in another currency as stocks have a daily close price and currencies don't (and sometimes you don't get the fx quote of the currency at the same time-stamp as the close of the stock).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would add that if we relate Q to hedging (risk netural is only possible if I can hedge) then we have the bridge to the P world and similar problems arise and solutions from the P-guys can be helpful.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2016-05-12T12:00:51.053" LastActivityDate="2016-05-12T12:00:51.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25945" PostTypeId="2" ParentId="25942" CreationDate="2016-05-11T09:16:09.960" Score="27" Body="&lt;p&gt;It's an interesting question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I particularly agree with the $\mathbb{Q}-\mathbb{P}$ dichotomy mentioned by many.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would add to the other answers that, come to think of it, the Black-Scholes postulated Geometric Brownian Motion could be interpreted as an AR(1) process on the logarithm of the stock price as you &lt;strong&gt;discretise&lt;/strong&gt; the SDE from which it is a solution, which is exactly what you do when running Monte-Carlo simulations (same thing for the Ornstein-Uhlenbeck process as explained &lt;a href=&quot;https://math.stackexchange.com/questions/345773/how-the-ornstein-uhlenbeck-process-can-be-considered-as-the-continuous-time-anal&quot;&gt;here&lt;/a&gt; and noted by @Richard). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually, when taking the continuous-time limit, many more econometric models can be shown to correspond to stochastic processes frequently used by $\Bbb{Q}$ quants (see &lt;a href=&quot;http://quantlabs.net/academy/download/free_quant_instituitional_books_/GARCH%20Option_Valuation_Model_210009.pdf&quot; rel=&quot;noreferrer&quot;&gt;this paper&lt;/a&gt; for instance and the comment of @Kiwiakos below and discussed &lt;a href=&quot;http://www2.warwick.ac.uk/fac/soc/economics/staff/academic/corradi/papers/joe-garch.pdf&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt; with interesting references).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So why do we, at least on the sell-side, tend to favour (jump-)diffusion models over econometric models, while the latter have the advantage that volatility/variance is an observable quantity and not a hidden variable, making them easier to calibrate on historical time series, that is, information observed under $\mathbb{P}$ ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well... essentially because derivatives pricing happens under a risk-neutral measure $\mathbb{Q}$ and not the physical measure $\mathbb{P}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When working under $\mathbb{Q}$, we do &lt;strong&gt;relative valuation&lt;/strong&gt;. Voluntarily over-simplifying the situation, we appeal to the absence of arbitrage opportunity to claim that &lt;em&gt;any financial instrument can be priced solely by looking at the prices of other securities (typically listed options) that can be combined to perfectly replicate the former instrument's behaviour (or used as a perfect hedge, which is equivalent)&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, it is not important to have a model which can be easily calibrated to historical time series, hence under $\mathbb{P}$ (which is the key feature of econometric models IMHO) but essential to have a model that leads to nice closed form formulas for the price of simple instruments that could be used as a &lt;em&gt;relative pricing basis&lt;/em&gt; under $\mathbb{Q}$ (which is the key feature of most jump-diffusion models used by quants IMHO).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the GARCH pricing model proposed by &lt;a href=&quot;http://pages.stern.nyu.edu/~rengle/B303352/Duan.pdf&quot; rel=&quot;noreferrer&quot;&gt;Duan&lt;/a&gt; for instance. True, it is easily calibrable to historical time series, but:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Is the past really useful to understand what will happen in the future, which is the crux of derivatives pricing? Not necessarily, especially since we are in a &lt;em&gt;relative valuation&lt;/em&gt; framework: it is the evolution of the &lt;em&gt;market prices&lt;/em&gt; at which we can trade the elementary replication blocks that matters, not the &lt;em&gt;historical behaviour of the underlying asset&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You need Monte-Carlo simulations to compute European option prices under this model: think about how much computational resources would be needed to calibrate such a model to 1000 vanilla prices several times a day in a live production environment (especially compared to something like Heston were Fast Fourier Transform techniques can be implemented).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Summarising (again, with a voluntary over-simplification)&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;em&gt;Econometric models&lt;/em&gt;: easily calibrated under $\mathbb{P}$ (discrete time + observable volatility/variance), yet need simulation methods à la Monte Carlo to be able to compute option prices, even for the most basic types of options. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;em&gt;(Jump-)Diffusion models&lt;/em&gt;: painful to calibrate to time series (continuous time + hidden Markov models) but admittedly lead to (semi-)closed form formulas for many benchmark instruments (or at least the popular models are the ones that do...), making them easy to calibrate/use under $\mathbb{Q}$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2017-03-03T12:48:14.827" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="25946" PostTypeId="1" AcceptedAnswerId="25947" CreationDate="2016-05-11T10:43:47.687" Score="1" ViewCount="783" Body="&lt;p&gt;I am currently trying to figure out how to estimate the value at risk using the rugarch package in R. I've come to a result, but it seems a bit excessive. Here's my code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;install.packages(&quot;PerformanceAnalytics&quot;)&#xA;install.packages(&quot;fGarch&quot;)&#xA;install.packages(&quot;rugarch&quot;)&#xA;library(fGarch)&#xA;library(PerformanceAnalytics)&#xA;library(rugarch)&#xA;&#xA;#Daten runterladen&#xA;db&amp;lt;- get.hist.quote(instrument = &quot;DB&quot;,  start = &quot;2005-11-21&quot;,&#xA;                  quote = &quot;AdjClose&quot;)&#xA;sys&amp;lt;- get.hist.quote(instrument = &quot;^STOXX50E&quot;,  start = &quot;2005-11-21&quot;,&#xA;                  quote = &quot;AdjClose&quot;)&#xA;#Returns&#xA;retdb&amp;lt;-diff(log(db))&#xA;retsys&amp;lt;-diff(log(sys))&#xA;#GARCH-Modell spezifizieren&#xA;spec2 = ugarchspec(variance.model = list(model = &quot;sGARCH&quot;, garchOrder = c(1,     1), &#xA;                                     submodel = NULL, &#xA;                                     external.regressors = NULL, &#xA;                                     variance.targeting = FALSE),&#xA;               mean.model=list(armaOrder=c(1,0)),&#xA;               distribution.model=&quot;sstd&quot;&#xA;               )&#xA;#GARCH-Modell fitten&#xA;fit&amp;lt;-ugarchfit(spec=spec2,&#xA;      data=retdb)&#xA;fit2&amp;lt;-ugarchfit(spec=spec2,&#xA;           data=retsys)&#xA;&#xA;#var berechnen&#xA;var1&amp;lt;-quantile(fit,0.99)&#xA;var1sys&amp;lt;-quantile(fit2,0.99)&#xA;#plot var&#xA;plot(var1)&#xA;lines(var1sys,col=&quot;red&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And this the image I'm getting (red--&gt;Eurostoxx VaR, black--&gt; DB VaR):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/fyslL.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/fyslL.png&quot; alt=&quot;VaR Deutsche Bank vs. VaR Euro Stoxx&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And, to be honest, I'm lacking the experience if this reasonable or not...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance,&#xA;Richard&lt;/p&gt;&#xA;" OwnerUserId="20694" LastActivityDate="2016-05-12T08:58:29.853" Title="Issues in estimating VaR with GARCH" Tags="&lt;r&gt;&lt;value-at-risk&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25947" PostTypeId="2" ParentId="25946" CreationDate="2016-05-11T12:53:54.673" Score="3" Body="&lt;p&gt;1) You are computing the &quot;actual&quot; VaR, in the sense that you are not forecasting it to see if your VaR model is able to estimate it, but you are just computing the VaR that &quot;has taken place&quot;. To obtain a volatility forecast (either in-sample or out-of-sample) you can use the &quot;ugarchforecast&quot; function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) I think you are estimating the VaR on the wrong side of the distribution: you take the 0.99 quantile instead of the 0.01 one. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) A more meaningful plot is the one with your returns series together with the respective VaRs: there, you can see with your eyes how it behaves.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) Count the number of failures of your VaR (number of times the return process exceeds you VaR) and divide it by the number of observations, to get the Failure Rate: it should be near 0.01 (more generally, near the desired coverage level, such as your 0.01; other common levels are 0.005, 0.05 or 0.1)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5) There are a lot of other tests to check if your model is good in VaR estimation: Dynamic Quantile Test, Conditional and Unconditional coverage tests; other measures are various Loss Functions, (for example, the firm Loss Function), to compare various models performances. In This &lt;a href=&quot;https://mpra.ub.uni-muenchen.de/30364/1/MPRA_paper_30364.pdf&quot; rel=&quot;nofollow&quot;&gt;working paper&lt;/a&gt; you can find a comparison between various techniques to compute VaR (GARCH too) and numerous tests and comparison methods.&lt;/p&gt;&#xA;" OwnerUserId="18694" LastEditorUserId="18694" LastEditDate="2016-05-12T08:58:29.853" LastActivityDate="2016-05-12T08:58:29.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25949" PostTypeId="1" AcceptedAnswerId="25951" CreationDate="2016-05-11T14:27:05.367" Score="3" ViewCount="225" Body="&lt;p&gt;I'm reading Piterbarg &lt;a href=&quot;http://www.google.ch/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=2&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0ahUKEwiXltOSnNLMAhXrCpoKHUGbAoUQFggsMAE&amp;amp;url=http%3A%2F%2Fwww.risk.net%2Fdigital_assets%2F895%2F042-048_AR0310_Cuttingedge.pdf&amp;amp;usg=AFQjCNG6XI6nZuW-t9V51jzqZvx79gCRrQ&amp;amp;bvm=bv.121658157,d.bGs&quot; rel=&quot;nofollow noreferrer&quot;&gt;paper&lt;/a&gt;, &amp;quot;Funding beyond discounting: collateral agreements and derivatives pricing.&amp;quot; and have a question about equation &lt;span class=&quot;math-container&quot;&gt;$(6)$&lt;/span&gt;.&#xA;There he says that for a derivative we have&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$E_t[dV_t]=(r_F(t)V(t)-(r_F(t)-r_C(t))C(t))dt = (r_F(t)V(t)-s_F(t)C(t))dt$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;where &lt;span class=&quot;math-container&quot;&gt;$C(t)$&lt;/span&gt; amount in collateral, &lt;span class=&quot;math-container&quot;&gt;$r_F$&lt;/span&gt; short rate for unsecured funding, &lt;span class=&quot;math-container&quot;&gt;$r_C$&lt;/span&gt; the short rate for risk free rate which corresponds to the safest available collateral, cash and &lt;span class=&quot;math-container&quot;&gt;$s_F(t)$&lt;/span&gt; is the funding spread &lt;span class=&quot;math-container&quot;&gt;$r_F-r_C$&lt;/span&gt;. Why is the above first formula for the expected change in the derivative true?&lt;/p&gt;&#xA;" OwnerUserId="17133" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-05-11T17:30:44.080" Title="expected change in value of a derivative in a multicurve framework" Tags="&lt;discounting&gt;&lt;multicurve&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25950" PostTypeId="2" ParentId="25949" CreationDate="2016-05-11T15:10:56.997" Score="2" Body="&lt;p&gt;self financed portfolio will give you :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dV_t = r_F(t) \underbrace{(V(t)-C(t) - \Delta S_t )}_{\text{cash position}} dt + r_C(t) \underbrace{C(t)}_{\text{posted collateral}} dt + \underbrace{\Delta dS_t}_{\text{market move}} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then you retrieve his equation using that under risk-neutral measure :&#xA;$$\mathbb{E}[dS_t|\mathcal{F}_t]=r_F(t)S_tdt$$&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-05-11T15:10:56.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25951" PostTypeId="2" ParentId="25949" CreationDate="2016-05-11T15:57:31.703" Score="2" Body="&lt;p&gt;From $(2)$ of &lt;a href=&quot;http://www.risk.net/digital_assets/895/042-048_AR0310_Cuttingedge.pdf&quot; rel=&quot;nofollow&quot;&gt;Piterbarg&lt;/a&gt;,&#xA;\begin{align*}&#xA;V(t) = \Delta (t) S(t) + \gamma(t),&#xA;\end{align*}&#xA;where $\Delta (t)= \frac{\partial V(t)}{\partial S}$, and $\gamma(t)$ is the cash account that satisfies&#xA;\begin{align*}&#xA;d\gamma(t) &amp;amp;= \big[r_C(t) C(t) + r_F(t)(V(t)-C(t))-(r_R(t)-r_D(t))\Delta(t)S(t) \big]dt\\&#xA;&amp;amp;=\big[r_F(t)V(t) + (r_C(t)-r_F(t)) C(t)-(r_R(t)-r_D(t))\Delta(t)S(t) \big]dt.&#xA;\end{align*}&#xA;Moreover, based on Equation $(4)$ in the paper,&#xA;\begin{align*}&#xA;dS(t)/S(t) = (r_R(t)-r_D(t))dt + \sigma_S(t) dW_S(t).&#xA;\end{align*}&#xA;Then, from the self-financing condition,&#xA;\begin{align*}&#xA;dV(t) &amp;amp;= \Delta (t) dS(t) + d\gamma(t)\\&#xA;&amp;amp;=\big[r_F(t)V(t) + (r_C(t)-r_F(t)) C(t)\big]dt + \Delta (t)S(t)\sigma_S(t) dW_S(t). \tag{E1}&#xA;\end{align*}&#xA;It is obvious now that&#xA;\begin{align*}&#xA;E_t(dV(t)) = \big[r_F(t)V(t) + (r_C(t)-r_F(t)) C(t)\big]dt.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that Formulas $(3)$ and $(5)$ in &lt;a href=&quot;http://www.risk.net/digital_assets/895/042-048_AR0310_Cuttingedge.pdf&quot; rel=&quot;nofollow&quot;&gt;Piterbarg&lt;/a&gt; can also be derived directly from Equation $({\rm E}1)$ above.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-05-11T17:30:44.080" LastActivityDate="2016-05-11T17:30:44.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25952" PostTypeId="1" CreationDate="2016-05-11T17:33:58.363" Score="2" ViewCount="837" Body="&lt;p&gt;One way to go on about this is to parametrically calculate the returns, i.e. hold the exposure constant and backtest against the factor changes over that horizon. This is not forward looking per se but it's using assumption based model to arrive at that distribution (so no longer assuming a normal distribution). The other way is to simulate returns through a Black Scholes Model.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would the following statement be correct: in an ex ante framework there is a 50% chance of returns being either negative or position, assuming normal distribution and a mean of zero. Whereas in an ex-post framework where we have a realised mean return of 3% per year and run approximately 3% of risk then there is a probability of 16% of being negative over a one year period. Does this make any sense at all to you? How would you back out that 16%? &lt;/p&gt;&#xA;" OwnerUserId="20699" LastActivityDate="2016-05-11T17:51:32.760" Title="Calculating ex ante returns &amp; probability of a negative return over some horizon" Tags="&lt;risk&gt;&lt;factor-models&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25954" PostTypeId="2" ParentId="25952" CreationDate="2016-05-11T17:51:32.760" Score="1" Body="&lt;p&gt;For a normal random variable $\xi$ with mean 0, then&#xA;\begin{align*}&#xA;P(\xi &amp;lt; 0) = P(\xi &amp;gt; 0) = 50\,\%.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a normal random variable $\eta$ with mean (i.e., realized mean return) $\mu=3\,\%$ and risk (i.e., standard deviation) $\sigma = 3\,\%$, then&#xA;\begin{align*}&#xA;P(\eta &amp;lt; 0) &amp;amp;= P\left(\frac{\eta - \mu}{\sigma} &amp;lt; \frac{ - \mu}{\sigma} \right)\\&#xA;&amp;amp;= P\left(\frac{\eta - \mu}{\sigma} &amp;lt; -1 \right)\\&#xA;&amp;amp;\approx 15.87\,\%.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-05-11T17:51:32.760" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25955" PostTypeId="1" CreationDate="2016-05-11T20:22:07.673" Score="2" ViewCount="204" Body="&lt;p&gt;Does any single metric provide a convenient way to capture depth, breadth, and resiliency, or to distinguish between transitory and persistent effects (i.e. between the stationary and random walk components of a time-series model)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which of the many volume-, price-, and transaction cost-based measures are most widely adopted?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to relate observed volatility to liquidity and first need to settle on some objective measure of liquidity&lt;/p&gt;&#xA;" OwnerUserId="19017" LastActivityDate="2016-05-11T20:22:07.673" Title="What are the best measures of market liquidity?" Tags="&lt;liquidity&gt;&lt;liquidity-risk&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25957" PostTypeId="2" ParentId="25942" CreationDate="2016-05-11T22:03:38.707" Score="11" Body="&lt;p&gt;Traditional econometric (time series) models are of little or no value in forecasting market prices for purposes of &quot;making money&quot;, i.e, generating excess return over a benchmark in an asset management setting.  They have some limited value in strategic and tactical asset allocation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The ineffectiveness of time-series modeling in asset management stems primarily from the non-stationary and non-linear nature of financial markets.  There are regime-switching models that can partially address these phenomena, but in my experience they are too simplistic to be of any  lasting value.   Furthermore, any predictive power of such transparent and easily replicated models would be fleeting in largely efficient markets.  Even without such complications, statistically significant estimates of risk premia are virtually impossible -- even if such stable parameters existed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, consider as simple a task as estimating the expected return of a hypothetical asset with price following say a geometric Brownian motion -- where returns over non-overlapping intervals are independent. We have the true return distribution  $N(\mu \delta t, \sigma^2 \delta t),$ where $\mu$ and $\sigma$ are the annualized expected return and volatility, respectively.  If we observe period returns $r_1,r_2 \ldots, r_N$, sampled over intervals of length $\delta t$, then the unbiased or MLE estimators $\hat{\mu}$ and $\hat{\sigma}$ have sampling distributions&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\hat{\mu} \delta t \sim N\left(\mu \delta t, \frac{\sigma^2 \delta t}{N}\right)\\ \frac{(N-1)\hat{\sigma}^2 \delta t}{\sigma^2 \delta t} \sim \chi^2(N-1).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;em&gt;relative&lt;/em&gt; error in the estimate for the expected return is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$RE = \frac{\sigma \sqrt{\delta t/N}}{\mu \delta t}= \frac{\sigma}{\mu \sqrt{T}},$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $T = N \delta t$ is the total length of the sampling period. For fixed $T$, say 3 years, the relative error cannot be improved by increasing the sampling frequency, regardless of how many additional samples are taken. In other words, in order to improve the accuracy of the estimated return by a factor of 5, we must increase the sampling period by a factor of 25 to 75 years -- clearly problematic. &lt;/p&gt;&#xA;" OwnerUserId="8153" LastEditorUserId="8153" LastEditDate="2016-05-12T05:30:06.950" LastActivityDate="2016-05-12T05:30:06.950" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25958" PostTypeId="1" CreationDate="2016-05-11T22:24:28.510" Score="4" ViewCount="1072" Body="&lt;p&gt;Does anyone  know the calculation that these EQD desks are using to calculate the net Vega exposure of the VIX ETPs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am assuming it involves shares outstanding in each ETP, the value of a 30 day constant maturity future or SPVXSTR Index but everything I've tried has not yielded the same results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've reviewed a few of the prospectuses for these ETPs but it just states that they track +1/-1x the performance of SPVXSTR Index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anyone help out with a methodology that is being used here?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;see example attached:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/biJn9.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/biJn9.jpg&quot; alt=&quot;See example here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20706" LastActivityDate="2016-07-27T19:13:08.383" Title="VIX ETP Net Vega exposure" Tags="&lt;volatility&gt;&lt;vix&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="25959" PostTypeId="1" CreationDate="2016-05-11T22:46:26.543" Score="1" ViewCount="1367" Body="&lt;p&gt;What really means broker neutral trading system?Can I  use leverage if using broker neutral EMS?&lt;/p&gt;&#xA;" OwnerUserId="19972" LastActivityDate="2017-05-04T20:26:48.550" Title="What is broker neutral trading system?Can I use leverage if using broker neutral EMS?" Tags="&lt;trading&gt;&lt;hedge-fund&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25960" PostTypeId="1" AcceptedAnswerId="25962" CreationDate="2016-05-11T22:48:04.237" Score="1" ViewCount="2596" Body="&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; I don't understand why a Monte Carlo simulation needs correlated random variables. Isn't each simulation thread independent?&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Background:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Specifically, I'm referring to the below example on pg 319 in the Malz text (&lt;a href=&quot;http://ca.wiley.com/WileyCDA/WileyTitle/productCd-0470481803.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://ca.wiley.com/WileyCDA/WileyTitle/productCd-0470481803.html&lt;/a&gt;).&lt;/p&gt;&#xA;&lt;p&gt;He describes a Monte Carlo simulation with 1,000 simulation threads to calculate credit losses on a CDO with 100 underlying credits.&lt;/p&gt;&#xA;&lt;h3&gt;#1.&lt;/h3&gt;&#xA;&lt;p&gt;In the simulation, we setup a matrix of 1,000 draws from a 100 dimension joint normal distribution.&lt;/p&gt;&#xA;&lt;h3&gt;#2.&lt;/h3&gt;&#xA;&lt;p&gt;We posit 4 separate assumptions for pairwise correlation 0, 0.3, 0.6, 0.9&lt;/p&gt;&#xA;&lt;h3&gt;#3.&lt;/h3&gt;&#xA;&lt;p&gt;For each correlation assumption, the matrix of 1,000 random normals is transformed into matrix of 1,000 correlated random normals (which of course are still 100 dimensional normals).&lt;/p&gt;&#xA;&lt;p&gt;I don't understand why we need to transform the matrix of uncorrelated random normals into correlated ones? Isn't each simulation thread independent of the previous ?&lt;/p&gt;&#xA;" OwnerUserId="9265" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-05-13T04:19:33.933" Title="Why do we need correlated random variables in a Monte Carlo simulation?" Tags="&lt;monte-carlo&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25961" PostTypeId="1" CreationDate="2016-05-11T23:01:28.453" Score="2" ViewCount="570" Body="&lt;p&gt;It is known that the VaR (Value at risk) doesn't fulfill subadditivity, i.e. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$VaR(X)+VaR(Y) \le VaR(X+Y)$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But for elliptical distributions subadditivity is true. Questions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) Which distributions are elliptical? I guess its the (multi)normal and t-distributions...Are stable and hyperbolic distributions elliptical,too?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) Is subadditvity only fulfilled for elliptical distributions? Are there any other conditions (e.g. correlation) which have an impact on subadditivity of VaR?&lt;/p&gt;&#xA;" OwnerUserId="20707" LastActivityDate="2016-05-11T23:01:28.453" Title="subadditivity of VaR" Tags="&lt;risk&gt;&lt;portfolio-management&gt;&lt;statistics&gt;&lt;risk-management&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25962" PostTypeId="2" ParentId="25960" CreationDate="2016-05-12T00:17:54.730" Score="3" Body="&lt;p&gt;Surely what is meant is that the 100 components are pairwise correlated but the 1000 draws are independent.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-05-12T00:17:54.730" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25963" PostTypeId="1" CreationDate="2016-05-12T03:08:31.227" Score="2" ViewCount="3830" Body="&lt;p&gt;I am using the yahoo finance python module: &lt;a href=&quot;https://pypi.python.org/pypi/yahoo-finance&quot; rel=&quot;nofollow&quot;&gt;https://pypi.python.org/pypi/yahoo-finance&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using it for a project and would like to see if anybody else uses data from this source and can vouch for its reliability and accuracy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For my purposes I just need an accurate open and close price. If anybody has any experience to share regarding the accuracy of this python module please let me  know. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also if there are any suggestions regarding alternate data sources for historical open and close prices they would be appreciated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I am not concerned with accurate adjusted close prices, for the time being just actual close price that occurred the day of. &lt;/p&gt;&#xA;" OwnerUserId="20245" LastActivityDate="2016-07-23T13:34:46.003" Title="accuracy of Yahoo Finance stock data (Python module)" Tags="&lt;equities&gt;&lt;data&gt;&lt;market-data&gt;&lt;finance&gt;&lt;python&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25964" PostTypeId="2" ParentId="25942" CreationDate="2016-05-12T05:53:10.413" Score="7" Body="&lt;p&gt;Having thought about this I think the following reason is also important and wasn't mentioned so far:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you look at the inner working of this whole class of econometric models it all boils down to the following: It is possible (under some reasonable assumptions) to express any $MA(q)$ model as an $AR(\infty)$ model (and vice-versa for expressing $AR(p)$ models as $MA(\infty)$ models). So $ARMA(0,\infty)$ and $ARMA(\infty,0)$ are equivalent. (For the exact mathematical details &lt;a href=&quot;https://en.wikipedia.org/wiki/Wold%27s_theorem&quot;&gt;Wold's representation theorem&lt;/a&gt; is relevant).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What this means is that in practice you can increase the number of lags in an $AR(p)$ until any moving average components has disappeared from the autocorrelation function (and in practice they usually decay rapidly and btw this has the additional advantage that you can use least squares instead of ML estimation). So all of these models are basically only linear combinations of a certain number of prior data points in the respective time series (in the univariate case!). Said another way: The working of these models is &lt;em&gt;dependant on a stable autocorrelation structure&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now one of the well known stylized facts at least in the equity space is that &lt;em&gt;there is next to no autocorrelation!&lt;/em&gt; So all of these models are bound to fail when you try to use them for forecasting returns (even if the assumptions of stationarity would be met. NB: Going from prices to returns is basically the $I$ part - or parameter $d$ for differencing - in $ARIMA(p,d,q)$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another stylized fact is of course that there is &lt;em&gt;autocorrelation in the volatility structure&lt;/em&gt;, which gives us &lt;a href=&quot;https://en.wikipedia.org/wiki/Autoregressive_conditional_heteroskedasticity&quot;&gt;the whole class of $ARCH(q)$ models&lt;/a&gt;. And these are far more successful and used a lot by quants as we all know!&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2016-05-12T06:39:08.883" LastActivityDate="2016-05-12T06:39:08.883" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25966" PostTypeId="1" CreationDate="2016-05-12T08:04:48.093" Score="1" ViewCount="78" Body="&lt;p&gt;I made a for loop in Matlab in which I price a swap by using the swapbyzero function. The swapbyzero function requires a rates structure created by using the intenvset function from matlab. The problem with the loop is that it looks like the swapbyzero function is remebering some variables from the previous loop and therefore breaks. &#xA;To be more specific. The first loop calculates a swap starting for example on the 3th june 2016 and the second swap starts at the 6th of september. What I see from the swapbyzero function is that it looks for the date of 3 june in the rates structure for the second swap what doesn't exist off course. &#xA;Does anybody know if the swapbyzero function is remebering some variables from previous loops?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="16788" LastActivityDate="2016-05-12T08:04:48.093" Title="How to run swapbyzero matlab function in a loop" Tags="&lt;swaps&gt;&lt;matlab&gt;&lt;interest-rate-swap&gt;" AnswerCount="0" CommentCount="5" ClosedDate="2016-05-13T20:32:19.563" ContentLicense="CC BY-SA 3.0" />
  <row Id="25967" PostTypeId="1" CreationDate="2016-05-12T09:46:30.427" Score="1" ViewCount="114" Body="&lt;p&gt;Currently I'm trying to test the efficacy of a tail-hedging strategy in which an investor goes long in an index and correspondingly buys 1-month OTM put options. For practical reasons, the options with the particular strike price that we buy each month must be liquid. My dilemma is in how exactly do I define the filters used to select the strike price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently, there are 2 filters - open interest and the strike price itself:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Strike price - Suppose $K$ is 5% of the underlying price rounded to the nearest 100. Then the strike price is $K$ if the corresponding&#xA;options are liquid, $K-100$ if $K$ isn't liquid, and $K+100$ if neither $K$ nor $K-100$ are liquid. No option purchased if none of them is liquid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Open interest - A strike price with an open interest of at least 1000000 contracts is considered liquid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the main problem is that the above definition of a liquid option is really vague. I read that it's a huge mistake to randomly vary&#xA;or not properly define the parameters, and then to rely on the results of such a backtest. I'm testing this strategy for the Indian&#xA;market, wherein option trading picked up from 2009 onwards (i.e., more liquid options were available) according to my project guide.&#xA;This introduces another problem - I don't have enough data points to perform both backtesting and forward-testing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So with all of the above background info in mind, how do I come up with a concrete definition of what a &quot;liquid&quot; strike price should be? Sure I can relax the definition and that way I'll have even more data points available from 2006 onward, but wouldn't that just be reckless overfitting?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="19057" LastEditorUserId="19057" LastEditDate="2016-05-13T05:06:13.670" LastActivityDate="2016-05-13T05:06:13.670" Title="Proper Definition of Backtesting Parameter" Tags="&lt;statistics&gt;&lt;backtesting&gt;&lt;statistical-significance&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25968" PostTypeId="1" CreationDate="2016-05-12T13:25:57.810" Score="0" ViewCount="194" Body="&lt;p&gt;If Stock A returns 5% on average in year Y&#xA;And Stock B returns 2% on average in year Y&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this mean that correlation is 40%?&lt;/p&gt;&#xA;" OwnerUserId="13971" LastActivityDate="2016-05-12T17:02:47.773" Title="Correlation between 2 stocks" Tags="&lt;returns&gt;&lt;correlation&gt;" AnswerCount="2" CommentCount="4" ClosedDate="2016-05-12T18:18:56.337" ContentLicense="CC BY-SA 3.0" />
  <row Id="25969" PostTypeId="1" CreationDate="2016-05-12T13:42:13.110" Score="1" ViewCount="176" Body="&lt;p&gt;What are some common methods in determining fair value of a stock, from market data only, in real-time, as close to instantaneous as possible? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The kind of pricing that algorithmic trading engines would use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(This should be from the information contained in market data only. That is, not taking into account fundamental analysis or news/sentiment analysis)&lt;/p&gt;&#xA;" OwnerUserId="3184" LastEditorUserId="3184" LastEditDate="2016-05-12T15:12:31.400" LastActivityDate="2016-05-12T15:12:31.400" Title="Common, practical methods to calculate fair value of a stock?" Tags="&lt;equities&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="25970" PostTypeId="2" ParentId="25968" CreationDate="2016-05-12T14:17:41.110" Score="3" Body="&lt;p&gt;&lt;em&gt;Does this mean that correlation is 40%?&lt;/em&gt; No.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Very simple example (in R). Let A and B be stocks with returns &lt;code&gt;stockA&lt;/code&gt; and &lt;code&gt;stockB&lt;/code&gt;. Consider following example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;stockA = c(0.05, 0.04, 0.05, 0.06)&#xA;stockB = c(0.01, 0.02, 0.03, 0.02)&#xA;mean(stockA)&#xA;mean(stockB)&#xA;cor(stockA, stockB)&#xA;&#xA;stockA = c(0.04, 0.05, 0.05, 0.06)&#xA;stockB = c(0.01, 0.02, 0.02, 0.03)&#xA;mean(stockA)&#xA;mean(stockB)&#xA;cor(stockA, stockB)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;giving&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; mean(stockA)&#xA;[1] 0.05&#xA;&amp;gt; mean(stockB)&#xA;[1] 0.02&#xA;&amp;gt; cor(stockA, stockB)&#xA;[1] 0&#xA;&amp;gt; &#xA;&amp;gt; stockA = c(0.04, 0.05, 0.05, 0.06)&#xA;&amp;gt; stockB = c(0.01, 0.02, 0.02, 0.03)&#xA;&amp;gt; mean(stockA)&#xA;[1] 0.05&#xA;&amp;gt; mean(stockB)&#xA;[1] 0.02&#xA;&amp;gt; cor(stockA, stockB)&#xA;[1] 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="18030" LastActivityDate="2016-05-12T14:17:41.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25971" PostTypeId="2" ParentId="25968" CreationDate="2016-05-12T17:02:47.773" Score="1" Body="&lt;p&gt;The answer is no.  First, the question is ambiguous about what year Y is.  Is year Y actually 2015? Knowing those returns in one year says nothing about correlation.  Second, if it means that if Stock A goes up 5% then Stock B will go up by 2%, then that also says nothing.  What if Stock A goes down. Does stock B go up or down? Additionally, look at the averages.  Create a series of every year Stock A goes up by exactly 2%. Then one can create any correlation you want, positive or negative, by playing with the Stock B returns. For example lots of small negative returns, and one large positive gets a negative correlation at the same time as a 2% average.  [for example, in time series terms, A is up 2% exactly each time, but B goes from 1 to .9, .8, .7, .6, and then up to .95. The return is about 2% but the correlation would be negative 0.4 rather than positive 0.4]      &lt;/p&gt;&#xA;" OwnerUserId="19627" LastActivityDate="2016-05-12T17:02:47.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25972" PostTypeId="2" ParentId="25765" CreationDate="2016-05-12T18:27:05.843" Score="1" Body="&lt;p&gt;Thank you for your answer @MarkJoshi. I followed you advice and achieved in deriving the approximation formula. However, I can not fully understand why the fact that Black's formula is linear in $\sigma$ for ATM strikes causes the Rebonato approximation only to be accurate for ATM strikes and not OTM and ITM strikes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would be grateful if somebody can point me in the right direction&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My foundings:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I achieved in deriving the approximation as follows:&#xA;Defining the annuity factor as &#xA;$$A_{0,N}\left(t\right):=\sum_{n=0}^{N-1}\tau_nP\left(t,T_{n+1}\right)$$ &#xA;and the swap rate as &#xA;$$S_{0,N}\left(t\right):=\frac{\sum_{n=0}^{N-1}\tau_nP\left(t,T_{n+1}\right)L_n\left(t\right)}{A_{0,N}\left(t\right)}$$&#xA;the Black formula can be written as&#xA;$$Black\left(0\right)=A_{0,N}\left(0\right)\left[S_{0,N}\left(0\right)N\left(d_1\right)-KN\left(d_2\right)\right]$$&#xA;where&#xA;$$d_1=\frac{\log\left(S_{0,N}\left(0\right)/K\right)+\frac{\sigma^2T}{2}}{\sigma\sqrt{T}}$$&#xA;and&#xA;$$d_2=d_1-\sigma\sqrt{T}$$&#xA;Considering the ATM strike $K=S_{0,N}\left(0\right)$, I obtain:&#xA;$$Black\left(0\right)=A_{0,N}\left(0\right)\left[S_{0,N}\left(0\right)\left(N\left(\frac{1}{2}\sigma\sqrt{T}\right)-N\left(-\frac{1}{2}\sigma\sqrt{T}\right)\right)\right]$$&#xA;$$=A_{0,N}\left(0\right)\left[S_{0,N}\left(0\right)\left[N\left(0\right)+\frac{N'\left(0\right)}{1!}\left(\frac{1}{2}\sigma\sqrt{T}\right)+\frac{N''\left(0\right)}{2!}\left(\frac{1}{2}\sigma\sqrt{T}\right)^2+O\left(\sigma^3T^{3/2}\right)-\left(N\left(0\right)+\frac{N'\left(0\right)}{1!}\left(-\frac{1}{2}\sigma\sqrt{T}\right)+\frac{N''\left(0\right)}{2!}\left(-\frac{1}{2}\sigma\sqrt{T}\right)^2+O\left(\sigma^3T^{3/2}\right)\right)\right]\right]$$&#xA;$$=A_{0,N}\left(0\right)\left[S_{0,N}\left(0\right)\left[N'\left(0\right)\left(\frac{1}{2}\sigma\sqrt{T}\right)-N'\left(0\right)\left(-\frac{1}{2}\sigma\sqrt{T}\right)+O\left(\sigma^3T^{3/2}\right)\right]\right]$$&#xA;$$=A_{0,N}\left(0\right)\left[S_{0,N}\left(0\right)\sigma\sqrt{T}N'\left(0\right)+O\left(\sigma^3T^{3/2}\right)\right]$$&#xA;$$=A_{0,N}\left(0\right)\left[S_{0,N}\left(0\right)\frac{\sigma\sqrt{T}}{\sqrt{2\pi}}+O\left(\sigma^3T^{3/2}\right)\right]$$&#xA;$$\approx \frac{1}{\sqrt{2\pi}}A_{0,N}\left(0\right)S_{0,N}\left(0\right)\sigma\sqrt{T}$$&#xA;where the second equality follows by the Taylor expansion of $N$ around $0$ and the approximation holds for small values of $\sigma\sqrt{T}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I checked the accuracy of this approximation in Matlab for an ATM 1Y6Y swaption with an underlying paying swap, see figure below. &#xA;&lt;a href=&quot;https://i.stack.imgur.com/wsptC.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/wsptC.jpg&quot; alt=&quot;Comparision of Black&amp;#39;s Formula and Approximation&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As can be seen from the figure, the approximation works well for small values of $\sigma$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For ITM and OTM strikes, Black's formula is clearly not linear in $\sigma$ but exhibits a convex shape. I examined the behavior of Black's formula for OTM strikes in Matlab and obtained the following results:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/kzqgZ.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/kzqgZ.jpg&quot; alt=&quot;OTM Strikes&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the strike increases and the swaption gets more out of the money, Black's formula becomes more convex. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the same picture I also plotted, for different strikes, the price of the 1Y6Y swaption in terms of the Rebonato approximation volatility and in terms of the implied volatility obtained by a Monte Carlo evaluation. For the ATM strike, the Rebonato volatility and the MC implied volatility are nearly the same. For increasing strikes, the difference between the two types of volatility increases as well, meaning that the Rebonato approximation is less accurate for strikes away from the at-the-money level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question 1  How can this increasing difference (in the strike direction) between the MC implied volatility and the Rebonato volatility be linked to the fact that Black's formula is linear for ATM strikes?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, I noticed that the Rebonato approximation becomes less accurate (difference between Rebonato approximation and MC implied volatility increases) for longer-dated swaptions even for the ATM strike. I performed the same test as above for a 5Y10Y swaption and obtained the following results:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/fuLDW.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/fuLDW.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As can be seen from the figure, there is a significant difference between the MC implied volatility and the Rebonato volatility for the ATM strike. Comparing the MC price and the price obtained by inserting the Rebonato volatility in Blck, the difference between the prices is 12.72 basis points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question 2&lt;/strong&gt; Is it consistent with the theory that the Rebonato approximation is less accurate for long-dated ATM swaptions? What is an acceptable difference? Is 12.72 basis points acceptable? Does this mean that Rebonato approximation is only accurate for ATM strikes and short/medium dated swaptions?&lt;/p&gt;&#xA;" OwnerUserId="19279" LastActivityDate="2016-05-12T18:27:05.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25975" PostTypeId="2" ParentId="25960" CreationDate="2016-05-13T04:13:16.227" Score="1" Body="&lt;p&gt;Correlated (simulated) features or variables are used when the source data has correlated features.  If the original features in the source data are not correlated and are orthogonal, then there is no reason to use correlation when simulating.  Many assets are correlated, mostly through volatility clustering and sentiment.  Secular bull and bear markets can also cause many assets to correlate.  If there was no correlation, then you could merely build a portfolio by randomly selecting the assets, and then weighting the amount owned by historical returns -- which is never a good idea.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bank portfolio stress testing involves use of copulas (simulations) to artificially introduce greater levels of correlation between portfolio assets to determine Variance at Risk, Expected Tail Loss, etc.  Basically, when times are bad (e.g., subprime mortgage crisis), many assets begin to become strongly correlated.  Thus, if there are large market corrections (loss), when many assets start correlating, the chances of greater loss are larger -- because you are not only losing net worth via one asset, but losing a lot more via loss among many correlated assets.  (a particular type of portfolio which can safeguard against high correlation during increased volatility with correlation is called a collar portfolio -- which is a form of hedging).  When correlation is also greater, there is less diversity -- which is less sustainable.         &lt;/p&gt;&#xA;" OwnerDisplayName="user6430" LastEditorDisplayName="user6430" LastEditDate="2016-05-13T04:19:33.933" LastActivityDate="2016-05-13T04:19:33.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25976" PostTypeId="1" CreationDate="2016-05-13T07:35:14.383" Score="2" ViewCount="1039" Body="&lt;p&gt;&lt;strong&gt;Consider a first hypothetical, a swap&lt;/strong&gt;.&#xA;Party 1 is paying 6 month Libor, semi-annually. &#xA;Party 2. pays $1+3*(\frac{Index_\color{red}{T}}{Index_0}-1) $ only at maturity. Say the notional is 1. $Index_t$ is the closing value of some publicly available index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Party 2 has the option, at any time $t &amp;lt; T$, to pay $1+3*(\frac{Index_\color{red}{t}}{Index_0}-1) $ and end the contract.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would I price this contract? Is it appropriate to say that the libor leg will price at par on a reset date and the index related leg, at time $s$ will be valued at  $1+3*(\frac{Index_\color{red}{s}}{Index_0}-1) $ ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To me, the fact that this note can ended at any time, makes it a swaption and we cannot separate the two legs. The optimal choice of when to end the contract will depend both on the value of the index and the value of Libor. Suppose we did not have any market data on the Index, such as swaption vols etc, then how would we go about pricing the swap?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Now consider a Second hypothetical question&lt;/strong&gt;. Consider only the second leg of the swap. You have the option to pick a time $s$ where $ 0 \leq s \leq T$, where you pay $1+3*(\frac{Index_\color{red}{s}}{Index_0}-1) $ . How do I pick the optimal time and what is the value of this contract at some time $t_1$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can simplify the payoff to $\frac{3}{Index_0}(Index_t - \frac{2*Index_0}{3})$, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is like $scaling factor*(S_t-K) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose we fix the exercise time, the time where you can choose to pay K and receive $S_t$ to only be $t=T$ then this becomes a forward contract and the price of a forward contract, at $ t=t_1$ is certainly not $scalingfactor*(S_{t_1}-K)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In our contract, we have the option to &quot;exercise&quot; or to make this payment, at any $t \in (0,T)$. This adds more optionality to the value of this contract should be higher than that of a forward. How should I go about pricing this?&lt;/p&gt;&#xA;" OwnerUserId="6909" LastEditorUserId="6909" LastEditDate="2016-05-13T07:54:20.203" LastActivityDate="2017-11-05T02:48:27.510" Title="Pricing Cancelable swap" Tags="&lt;derivatives&gt;&lt;swaption&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25977" PostTypeId="2" ParentId="16935" CreationDate="2016-05-13T10:39:35.470" Score="2" Body="&lt;p&gt;There isn't a reliable mechanism. Some things to think about:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;It's common for venues to abuse the security reference of the primary venue to mean anywhere that this security is traded. So - for some venues and data sources - if they talk about trading the LSE-listing of RIO on Bats Europe, they will refer to that as RIO.L. I believe your examples above have this kind of crossover. One would refer the price across participating secondary markets, the other to the price specific to the LSE.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;There are downloads that you can use as Rosetta Stones to convert between representations. For European securities, Bats Europe makes a lot of good information public (&lt;a href=&quot;http://www.batstrading.co.uk/trf/market_data/symbol_listing/&quot; rel=&quot;nofollow&quot;&gt;http://www.batstrading.co.uk/trf/market_data/symbol_listing/&lt;/a&gt;). The reference data symbology offered on their website is handy for conversions, and some documents offer close prices. They're one of the largest secondary markets in Europe, so this is valuable data. Their TRF dataset is significantly larger, and useful for rosetta stone purposes.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can often use ISIN+MIC+CCY as a translation mechanism between different systems. Be mindful that this is not 100% either. For example, there are situations on the LSE where ISIN+MIC+CCY is not a unique reference, and refers to a set of ETFs, each with a different multiplier.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The conversion database is a good idea. I've been wanting to do this for a while, and laid some groundwork yesterday, which is why all of this is fresh in my mind. Nothing public yet.&lt;/p&gt;&#xA;" OwnerUserId="20725" LastActivityDate="2016-05-13T10:39:35.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25978" PostTypeId="1" CreationDate="2016-05-13T11:16:25.333" Score="2" ViewCount="294" Body="&lt;p&gt;I get the parameters (long-term mean, volatility, mean-reversion speed, correlation) of two correlated Ornstein-Uhlenbeck processes via a likelihood estimation from hourly data. If I want to transform these to use them to create a daily - instead of hourly - simulation (tree or Monte Carlo), what do I have to do? Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="20224" LastActivityDate="2016-05-15T11:17:54.670" Title="How to transform Ornstein-Uhlenbeck parameters from hourly to daily?" Tags="&lt;volatility&gt;&lt;mean-reversion&gt;&lt;parameter-estimation&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25979" PostTypeId="2" ParentId="25976" CreationDate="2016-05-13T11:55:32.427" Score="1" Body="&lt;p&gt;On the second question, you have the choice to pay $(S_t - K)$ at $t$ or $(S_T - K)$ at $T$. The value at $t$ of deciding to pay now versus later is: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Value at $t$ of paying $S_t - K$ at $t$  -  Value at $t$ of not paying $S_T - K$ at $T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$= -(S_t - K)  + e^{-r(T-t)} (F(t,T) - K)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $F(t,T)$ is the forward price of the index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now $F(t,T) = S_t e^{(r-d)(T-t)}$  where $d$ is the div yield of the index&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so we have &#xA;$$-(S_t - K)  + e^{-r(T-t)} (S_t e^{(r-d)(T-t)} - K)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which comes out to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S_t (e^{-d(T-t)} - 1)  + K(1-e^{-r(T-t)})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the first term is negative and represents the fact that you have to pay divs between $t$ and $T$ if you exercise early.  The second term is positive (assuming positive rates) and represents the value of getting $K$ earlier.  Hence we have a tradeoff.  If divs are zero and rates are positive, you always exercise early.  If rates are negative, you never exercise early.  The most value of exercising early comes when rates are high and positive, and dividends are zero.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastEditorUserId="20454" LastEditDate="2017-11-05T02:11:41.677" LastActivityDate="2017-11-05T02:11:41.677" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25980" PostTypeId="2" ParentId="1937" CreationDate="2016-05-13T12:34:19.800" Score="5" Body="&lt;p&gt;One idea is &lt;a href=&quot;https://en.wikipedia.org/wiki/Dynamic_time_warping&quot; rel=&quot;noreferrer&quot;&gt;Dynamic time warping (DTW).&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is an R package for that: &lt;a href=&quot;https://cran.r-project.org/web/packages/dtw/&quot; rel=&quot;noreferrer&quot;&gt;dtw&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the vignette:&lt;br&gt;&lt;a href=&quot;https://cran.r-project.org/web/packages/dtw/vignettes/dtw.pdf&quot; rel=&quot;noreferrer&quot;&gt;Computing and Visualizing Dynamic Time Warping&#xA;Alignments in R: The dtw Package&lt;/a&gt;&lt;br&gt;by Toni Giorgino&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And here is an example from Systematic Investor with full code:&lt;br&gt;&#xA;&lt;a href=&quot;https://systematicinvestor.wordpress.com/2012/01/20/time-series-matching-with-dynamic-time-warping/&quot; rel=&quot;noreferrer&quot;&gt;Time Series Matching with Dynamic Time Warping&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2016-05-13T12:34:19.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25981" PostTypeId="2" ParentId="25978" CreationDate="2016-05-13T13:27:56.167" Score="1" Body="&lt;p&gt;You can aggregate your starting hourly data to obtain daily data and re-estimate the parameters, then simulate. Alternatvely, with your parameters already obtained, you can simulate hourly data and make a post-simulation aggregation to have daily data.&lt;/p&gt;&#xA;" OwnerUserId="18694" LastActivityDate="2016-05-13T13:27:56.167" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25982" PostTypeId="2" ParentId="7181" CreationDate="2016-05-13T16:25:36.123" Score="0" Body="&lt;p&gt;To be more precise, random forests work by building multiple trees by using sample with replacement from the same training data.  Each tree is also built using a random subset of the features (attributes).  Pruning is usually done for each tree before its inclusion.  Hypothesis values are a result of averaging over all trees.  One of the primary uses of random forests is the reduction of variance.  If bias is the problem, then one should use boosting (Adaboost).&lt;/p&gt;&#xA;" OwnerUserId="20728" LastActivityDate="2016-05-13T16:25:36.123" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25983" PostTypeId="1" AcceptedAnswerId="25986" CreationDate="2016-05-13T16:45:08.913" Score="0" ViewCount="170" Body="&lt;p&gt;I have $$\frac{dM_t}{M_t}=-\frac{\mu}{\sigma} dW_t + \gamma_t dB_t, \tag{1}$$ where $B_t$ and $W_t$ are two independent Brownian Motions, which was further  presented as $$ M_t=\exp \left( -\frac{\mu}{\sigma}W_t - \frac{1}{2} \frac{\mu^2}{\sigma^2}t + \int_0^t \gamma_s dB_s -\frac{1}{2} \int_0^t \gamma_s^2 ds \right) \tag{2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;can anybody explain how $(1)$  was transitioned into $(2)$?&lt;/p&gt;&#xA;" OwnerUserId="18670" LastEditorUserId="11678" LastEditDate="2016-05-13T17:33:25.157" LastActivityDate="2016-05-13T20:32:03.547" Title="stochastic discount factor transformation" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;itos-lemma&gt;&lt;stochastic-discount&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25984" PostTypeId="2" ParentId="7181" CreationDate="2016-05-13T16:51:52.210" Score="15" Body="&lt;p&gt;Recently I attended a presentation by the first author of the following paper who gave us quite a creative and illuminating (kind of meta-)use of random forests in Quant Finance:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2745220&quot; rel=&quot;noreferrer&quot;&gt;All that Glitters Is Not Gold: Comparing Backtest and Out-of-Sample Performance on a Large Cohort of Trading Algorithms (March 2016)&lt;/a&gt;&lt;br&gt; by Thomas Wiecki, Andrew Campbell, Justin Lent, Jessica Stauth (all Quantopian)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Abstract:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When automated trading strategies are developed and evaluated using&#xA;  backtests on historical pricing data, there exists a tendency to&#xA;  overfit to the past. Using a unique dataset of 888 algorithmic trading&#xA;  strategies developed and backtested on the Quantopian platform with at&#xA;  least 6 months of out-of-sample performance, we study the prevalence&#xA;  and impact of backtest overfitting. Specifically, we find that&#xA;  commonly reported backtest evaluation metrics like the Sharpe ratio&#xA;  offer little value in predicting out of sample performance (R² &amp;lt;&#xA;  0.025). In contrast, higher order moments, like volatility and maximum drawdown, as well as portfolio construction features, like hedging,&#xA;  show significant predictive value of relevance to quantitative finance&#xA;  practitioners. Moreover, in line with prior theoretical&#xA;  considerations, we find empirical evidence of overfitting – the more&#xA;  backtesting a quant has done for a strategy, the larger the&#xA;  discrepancy between backtest and out-of-sample performance. Finally,&#xA;  we show that by training non-linear machine learning classifiers on a&#xA;  variety of features that describe backtest behavior, out-of-sample&#xA;  performance can be predicted at a much higher accuracy (R² = 0.17) on&#xA;  hold-out data compared to using linear, univariate features. A&#xA;  portfolio constructed on predictions on hold-out data performed&#xA;  significantly better out-of-sample than one constructed from&#xA;  algorithms with the highest backtest Sharpe ratios.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So what they basically did was to take all kinds of real quant trading algos and asked the old EMH question whether in sample performance has any predictive power for out of sample performance. They calculated all kinds of measures for these algos and used them (and combinations thereof) to predict the out of sample performance. Then they extracted the most important features from the random forest model - the following picture is taken from the paper (p. 9)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/t749Zl.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/t749Zl.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2016-05-13T16:51:52.210" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25985" PostTypeId="2" ParentId="25978" CreationDate="2016-05-13T16:59:12.937" Score="1" Body="&lt;p&gt;Let $X^h$ be your hourly process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $X^d$ be your daily process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\delta$ be one day&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you have &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X^d_t=\frac{1}{\delta}\int_{t-\delta}^{t}X^h_s ds$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dX^h_t = a(b-X^h_t)dt + \sigma dB_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta X^d_t := X^d_{t+\delta}-X^d_t =\frac{1}{\delta}\int_{t-\delta}^t\left(X^h_{u+\delta}-X^h_{u}\right)du$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so it is a gaussian random variable by knowns results on OU.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can express it and compute $Cov(\Delta X^{d}_{k\delta},\Delta X^d_{j\delta})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will then be able to conclude.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Details&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;by known results :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X^h_{t+\delta}-X^h_t=(b-X_{t})(1-e^{-a\delta})+\int_{t}^{t+\delta}e^{a(u-t)}dB_u$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{split}&#xA;X^d_{t+\delta}-X^d_t &amp;amp;= (b-X^d_t)(1-e^{-2a\delta})+\int_{t-\delta}^{t}\frac{1}{\delta}\int_{u}^{u+\delta}e^{a(s-u)}dB_s du \\&#xA;&amp;amp; = (b-X^d_t)(1-e^{-2a\delta})+\int_{t}^{t+\delta}\frac{1}{\delta}\int_{u-\delta}^{u}e^{a(s-u+\delta)}dB_s du \\&#xA;\end{split}&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="20201" LastEditorUserId="20201" LastEditDate="2016-05-15T11:17:54.670" LastActivityDate="2016-05-15T11:17:54.670" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25986" PostTypeId="2" ParentId="25983" CreationDate="2016-05-13T17:17:25.237" Score="2" Body="&lt;p&gt;Apply Ito's lemma to $\ln M_t$, we obtain that&#xA;\begin{align*}&#xA;d\ln M_t &amp;amp;= \frac{1}{M_t} dM_t -\frac{1}{2} \frac{1}{M_t^2} d\langle M, M\rangle_t\\&#xA;&amp;amp;=-\frac{\mu}{\sigma} dW_t + \gamma_t dB_t -\frac{1}{2} \frac{1}{M_t^2}\left(\frac{\mu^2}{\sigma^2} + \gamma_t^2\right)M_t^2dt\\&#xA;&amp;amp;=-\frac{\mu}{\sigma} dW_t + \gamma_t dB_t -\frac{1}{2} \left(\frac{\mu^2}{\sigma^2} + \gamma_t^2\right) dt.\tag{Eq. 1}&#xA;\end{align*}&#xA;Here, since $dM_t=M_t\big[-\frac{\mu}{\sigma} dW_t + \gamma_t dB_t\big]$,&#xA;\begin{align*}&#xA;d\langle M, M\rangle_t = \left(\frac{\mu^2}{\sigma^2} + \gamma_t^2\right)M_t^2dt.&#xA;\end{align*}&#xA;From $(\textrm{Eq.} 1)$, &#xA;\begin{align*}&#xA;\ln M_t - \ln M_0 &amp;amp;= \int_0^t\left[-\frac{\mu}{\sigma} dW_s + \gamma_s dB_s -\frac{1}{2} \left(\frac{\mu^2}{\sigma^2} + \gamma_s^2\right) ds\right]\\&#xA;&amp;amp;=-\frac{\mu}{\sigma}W_t - \frac{1}{2} \frac{\mu^2}{\sigma^2}t + \int_0^t \gamma_s dB_s  - \frac{1}{2} \int_0^t \gamma_s^2 ds.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;M_t = M_0 \exp\left(-\frac{\mu}{\sigma}W_t - \frac{1}{2} \frac{\mu^2}{\sigma^2}t + \int_0^t \gamma_s dB_s  - \frac{1}{2} \int_0^t \gamma_s^2 ds\right).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-05-13T20:32:03.547" LastActivityDate="2016-05-13T20:32:03.547" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="25987" PostTypeId="1" CreationDate="2016-05-13T17:41:56.107" Score="0" ViewCount="111" Body="&lt;p&gt;I am reading &lt;a href=&quot;http://polymer.bu.edu/hes/longstaff01py538.pdf&quot; rel=&quot;nofollow&quot;&gt;Longstaff and Schwartz Valuing Aerican Options by Simulation&lt;/a&gt; because monte carlo simulations, especially their use in option pricing, is interesting to me. However, I am having some difficulty getting through the numerical example - not from lack of understanding the big picture but recreating the example myself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On page 116 the authors discuss stock price paths - they say they are generated under the risk neutral measure but I am missing some background here that will allow me create this example on my own for understanding (or a different example for me to work through). I feel that the authors left out some critical information here on exactly how this example was produced.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone explain to me how these stock prices are generated, or link me to resources so I can figure it out myself? It would go a long way towards me fully understanding this paper.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerDisplayName="user20664" LastEditorUserId="16160" LastEditDate="2016-05-13T22:51:29.753" LastActivityDate="2016-05-13T22:51:29.753" Title="Generating process for stock price paths in this paper?" Tags="&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;risk-neutral-measure&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="25988" PostTypeId="2" ParentId="8478" CreationDate="2016-05-13T18:35:30.580" Score="7" Body="&lt;p&gt;To solve this equation, let &#xA;\begin{align*}&#xA;M_t = e^{(\theta + \frac{1}{2}\sigma^2 ) t - \sigma W_t}.&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;dM_t = M_t\Big[\big(\theta +\sigma^2\big) dt - \sigma dW_t\Big].&#xA;\end{align*}&#xA;Moreover,&#xA;\begin{align*}&#xA;d(M_t X_t) &amp;amp;= M_t dX_t + X_t dM_t + d\langle M, X \rangle_t\\&#xA;&amp;amp;=\theta\,\mu\, M_t dt.&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;M_t X_t &amp;amp;= X_0 + \theta\,\mu\,\int_0^t M_s ds.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;X_t &amp;amp;= X_0 e^{-(\theta + \frac{1}{2}\sigma^2 ) t + \sigma W_t} +  \theta\,\mu\,e^{-(\theta + \frac{1}{2}\sigma^2 ) t + \sigma W_t}\int_0^t e^{(\theta + \frac{1}{2}\sigma^2 ) s - \sigma W_s} ds\\&#xA;&amp;amp;=X_0 e^{-(\theta + \frac{1}{2}\sigma^2 ) t + \sigma W_t} +  \theta\,\mu\,\int_0^t e^{-(\theta + \frac{1}{2}\sigma^2 ) (t-s) + \sigma(W_t - W_s)} ds.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-05-13T18:35:30.580" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25989" PostTypeId="1" AcceptedAnswerId="27699" CreationDate="2016-05-13T19:42:37.883" Score="0" ViewCount="74" Body="&lt;p&gt;I am currently valuating a bond whose cupons have the following structure:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\left\{ \begin{array}{rcl}&#xA;H_j-2\% &amp;amp; \mbox{if}&#xA;&amp;amp; R_j&amp;lt;H_j-2\% \\ R_j  &amp;amp; \mbox{if} &amp;amp; H_j-2\%\leq R_j\leq H_j+2\% \\&#xA;H_j+2\% &amp;amp; \mbox{if} &amp;amp; R_j&amp;gt;H_j+2\%&#xA;\end{array}\right\}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $R_j$ is the rate for a given period and $H_j$ is the forward rate today for the same period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have valuated it destructuring each cupon into a fix payment of $H_j-2\%$, a long position on a caplet with strike $H_j-2\%$ and a short position in a caplet with strike $H_j+2\%$. Now I am shifting the volatility curve upwards and downwards to analyze its impact on the value of the bond. When I move the volatility upwards the value of the bond decreases and when I shift it downwards the value increases. I have spent some time thinking about the cause of this result but I cannot realize why is it. I have tried reasoning based on the vega of each caplet but since the forward rate is always equally distant from the strike of both caplets I see it as a dead end path.Could somebody give me a hint? &lt;/p&gt;&#xA;" OwnerUserId="19128" LastEditorUserId="19128" LastEditDate="2016-05-13T21:12:50.703" LastActivityDate="2016-06-19T14:22:25.093" Title="Impact of the interest rate volatility in the valuation of a bond" Tags="&lt;black-scholes&gt;&lt;interest-rates&gt;&lt;bond&gt;&lt;valuation&gt;&lt;forward-rate&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25990" PostTypeId="2" ParentId="10568" CreationDate="2016-05-13T19:55:26.893" Score="2" Body="&lt;p&gt;From the &lt;a href=&quot;http://www.bis.org/publ/bcbs128b.pdf&quot; rel=&quot;nofollow&quot;&gt;Basel II accord&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;285&quot;&gt;&#xA;&lt;li&gt;For corporate and bank exposures, the PD is the greater of the one-year PD&#xA;associated with the internal borrower grade to which that exposure is assigned, or 0.03%.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So it is 0.03% &lt;/p&gt;&#xA;" OwnerUserId="13311" LastActivityDate="2016-05-13T19:55:26.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25991" PostTypeId="1" CreationDate="2016-05-13T21:00:08.363" Score="-1" ViewCount="152" Body="&lt;p&gt;I hope you can help me. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So let say we have an interest rate swap, with the following characteristic:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Start in 30/06/2015. &#xA;End in 02/07/2019&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It has fixed payment every year, and floating every half year. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The floating leg = From Hull (2012) the floating leg is just set equal to the notional, if we just have had a payment. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the fixed leg: &#xA;Due to weekends, in ex. year 3, the fixed payment will be done 02/07/2018. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fixed leg have day count convention: 30/360. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So basically, do we change the discount factor and the payment because of the extra 2 days? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of year 3, we will have year 3.005 to discount the cash flow. (using the convention actual/365 -&gt; have read this was normal)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and do we change the payment as well? Can we get 1.005 * Notional * Swap rate.&#xA;(30/360) -&gt; again we are two days late? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One more question: &#xA;I am currently using the Vasicek model to find the discount factors. &#xA;But I have read, that some uses the LIBOR rate instead? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you have any experience regarding this ?? &lt;/p&gt;&#xA;" OwnerUserId="20471" LastActivityDate="2017-05-10T13:23:46.340" Title="Pricing of Interest rate swap with start ex. 01/06/2015 to 03/06/2015 - 2 extra days? Change discount factor and fixed payments?" Tags="&lt;pricing&gt;&lt;interest-rate-swap&gt;&lt;discounting&gt;&lt;daycounting&gt;&lt;fixed&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="25993" PostTypeId="2" ParentId="25963" CreationDate="2016-05-13T21:33:19.877" Score="1" Body="&lt;p&gt;Look at &lt;a href=&quot;http://matplotlib.org/api/finance_api.html&quot; rel=&quot;nofollow&quot;&gt;matplotlib.finance&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It downloads data from yahoo finance as well but it is much quicker than the package that you are mentioning.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the reliability, I think that the data source is quite reliable.&lt;/p&gt;&#xA;" OwnerUserId="20637" LastActivityDate="2016-05-13T21:33:19.877" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="25994" PostTypeId="1" CreationDate="2016-05-13T23:45:09.713" Score="0" ViewCount="255" Body="&lt;p&gt;I have been playing with paper trading and am planning on getting into the real stock market soon, but I want to make sure my strategy is realistic before I put real money on it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I made a program that uses historical data to show for every tick, if I were to buy X number of dollars worth at that point, would I be able to make a set amount of profit within a set amount of time. You can mess around with how much you invest, how long you are willing to hold, etc and see what gives the best results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This graph is for investing 10k into Facebook (over the past two weeks). The profit goal is at 10 dollars and the maximum hold time is 20 minutes. In other words, anywhere that is green, if you bought there at market and then resold for whatever price per share would make you $10, the order would theoretically be filled within 20 minutes or less.&#xA;&lt;a href=&quot;https://i.stack.imgur.com/QL56H.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/QL56H.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So basically my strategy is to learn what makes a green spot vs what makes a red spot. I am also working on a neural network that tries to predict whether the current position will turn out green or red. When I think it is in the &quot;green zone&quot; I will buy at market, and once it is filled I will immediately put it back in as a limit order for whatever amount gives me the profit needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This strategy operates under a few assumptions though, and at times seems too good to work the way I think it will (most graphs tend to have more green spots than red, implying that even buying random stocks from any company on a slight upward trend would still have net profit) I am under the assumption that once the price goes above what I have my limit sell listed as, it will always be sold. It is also factoring in commission fees for interactiveBrokers.com, which are 0.005 per share bought, and assuming no other fees aside from the 10/month maintenance (I have found that commission fees are a huge part of how often this strategy profits or not when working with $10k investments)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So does this seem reasonable? Or are there things I may be overlooking?&lt;/p&gt;&#xA;" OwnerUserId="20732" LastActivityDate="2016-05-14T08:53:48.013" Title="Do you think this strategy will work?" Tags="&lt;equities&gt;&lt;strategy&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="25995" PostTypeId="2" ParentId="25840" CreationDate="2016-05-13T23:46:45.083" Score="-2" Body="&lt;p&gt;Not sure what they use in Thinkorswim but I would assume some variation of a Cubic Spline, taking points along the skew and interpolating between them.&lt;/p&gt;&#xA;" OwnerUserId="11748" LastActivityDate="2016-05-13T23:46:45.083" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="25997" PostTypeId="1" AcceptedAnswerId="26009" CreationDate="2016-05-14T01:59:29.883" Score="0" ViewCount="90" Body="&lt;p&gt;I am currently completing a multiple choice question that has stumped me.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;An asset has its price and its corresponding probability described as: 100, 0, -50, -70 and -90 with probabilities 50%, 12%, 6.5%, 1% and 0.5% respectively. Calculate the absolute value at risk with a loss probability of 2%.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;To begin, we have not been given the complete probability distribution of the price of the asset; the probabilities add up to 70%. Is it still possible to calculate the 98% VaR? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It doesn't make too much sense to me as we don't know what's happening at the loss tail of the distribution. For all we know a loss of -100,000,000 can occur with probability 30%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a choice of &quot;None of the answers is correct&quot;, which is what I am leaning for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am hoping for a better explanation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kind regards,&lt;/p&gt;&#xA;" OwnerUserId="13726" LastActivityDate="2016-05-14T14:40:07.720" Title="Calculating VaR of an Incomplete Distribution" Tags="&lt;distribution&gt;&lt;value-at-risk&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="25999" PostTypeId="1" CreationDate="2016-05-14T04:06:55.147" Score="-1" ViewCount="86" Body="&lt;p&gt;Quandl seems to be an excellent source of wide range of free/open financial data. But is there an open source code or platform that uses the quandl datasets to perform security analysis and option pricing.&lt;/p&gt;&#xA;" OwnerUserId="7622" LastActivityDate="2016-05-14T12:41:28.153" Title="Open source code based on quandl for security analysis and options priming" Tags="&lt;option-pricing&gt;&lt;time-series&gt;&lt;quantlib&gt;&lt;technical-analysis&gt;&lt;opensource&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26000" PostTypeId="2" ParentId="25876" CreationDate="2016-05-14T07:06:14.813" Score="1" Body="&lt;p&gt;We assume weak stationarity definition. Price level is non-stationary. Trend-stationarity is like following a trend, not working on this time scale. So need to use returns. Returns on interval &amp;lt;15min are dominated by bid-ask bounce. Useless, trap. So test should be using &gt;15min returns on window interval W &amp;lt; (hold time / N), N = 2-4. Then Unit root test p value can give some degree of stationarity to speculate further in context of specific trading system.&lt;/p&gt;&#xA;" OwnerUserId="2297" LastEditorUserId="2297" LastEditDate="2016-05-14T07:51:17.700" LastActivityDate="2016-05-14T07:51:17.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26001" PostTypeId="2" ParentId="25994" CreationDate="2016-05-14T08:53:48.013" Score="6" Body="&lt;p&gt;The best answer to your question: back test your ideas against historical data. If you think you can predict the market by learning past patterns prove it by testing it, not by discussion. I've done mistake few years ago and fell in love with one idea, which seemed to be like money printing machine, but instead testing it, I spent month discussing it on various forums. And once it went to the market, it just didn't work. The point is: test your ideas as soon as possible, take notes, if doesn't work - move on...&lt;/p&gt;&#xA;" OwnerUserId="20504" LastActivityDate="2016-05-14T08:53:48.013" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26002" PostTypeId="1" CreationDate="2016-05-14T09:19:36.327" Score="-1" ViewCount="111" Body="&lt;p&gt;How is it possible to have access to Datastream, Bloomberg, Wrds database? Is there another free database with long historical data? In fact, I need long time series data belonging to NYSE and NASADAQ companies.&lt;/p&gt;&#xA;" OwnerUserId="20395" LastActivityDate="2016-05-14T10:11:04.123" Title="Financial statement and stock market data" Tags="&lt;data&gt;&lt;market-data&gt;&lt;finance&gt;&lt;historical-data&gt;&lt;accounting&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2016-05-14T12:15:19.850" ContentLicense="CC BY-SA 3.0" />
  <row Id="26003" PostTypeId="2" ParentId="26002" CreationDate="2016-05-14T10:11:04.123" Score="0" Body="&lt;p&gt;You can try finance.yahoo for example &lt;a href=&quot;http://finance.yahoo.com/q/hp?s=GOOG+Historical+Prices&quot; rel=&quot;nofollow&quot;&gt;http://finance.yahoo.com/q/hp?s=GOOG+Historical+Prices&lt;/a&gt; it is free, for the other ones you mentioned you have to pay, usually a lot.&lt;/p&gt;&#xA;" OwnerUserId="18670" LastActivityDate="2016-05-14T10:11:04.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26005" PostTypeId="1" AcceptedAnswerId="26018" CreationDate="2016-05-14T11:58:53.773" Score="0" ViewCount="200" Body="&lt;p&gt;Trying to understand various risk factors for a EURUSD swap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While I understand why a EURUSD swap would have USD LIBOR, EURIBOR, EURUSD currency as risk factors, why is it that it would also have EUR 6M3M sensitivity?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance!&lt;/p&gt;&#xA;" OwnerUserId="6722" LastActivityDate="2016-05-15T06:44:18.897" Title="Factor sensitivities for EURUSD swap" Tags="&lt;risk&gt;&lt;swaps&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26006" PostTypeId="2" ParentId="25999" CreationDate="2016-05-14T12:41:28.153" Score="2" Body="&lt;p&gt;This &lt;a href=&quot;https://www.quandl.com/tools/full-list&quot; rel=&quot;nofollow&quot;&gt;Quandl Page&lt;/a&gt; provides you the informations you need: a lot of programming languages and other tools are linked to Quandl.&lt;/p&gt;&#xA;" OwnerUserId="18694" LastActivityDate="2016-05-14T12:41:28.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26007" PostTypeId="1" CreationDate="2016-05-14T12:50:30.373" Score="0" ViewCount="322" Body="&lt;p&gt;We have used a standard GARCH(1,1) model with t distributed innovations for daily data of S&amp;amp;P index and JPM stock. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question: is there any financial or statistical reason why the GARCH model would be more suitable for an index than for a stock?&lt;/strong&gt; My initial guess was that returns &quot;behave better&quot; with indicies than stocks (for example JPM vary around +20% and -20% whereas S&amp;amp;P vary around +10% -10%) and since the return data is the input into the GARCH model this would make &lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Details&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;To forecast the volatility we used a standard GARCH(1,1) model with t distributed innovations. Via the formula $VaR_t = \hat \mu_t + t \hat \sigma_t$ the volatility forecast was used in the calculation of the forecasted VaR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We had two different datasets: returns on S&amp;amp;P index prices and returns on JPM stock prices. We used the same GARCH model for both return series, and labelled them $m.index$ and $m.stock$ respectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The VaR forecasts were backtested using standard backtesting procedures,&#xA;the most important one is &#xA;Christoffersen's test of independece (also called a cc test). The results from applying this test to our VaR forecasts showed that $m.index$ was better than $m.stock$ with respect to VaR backtesting. It was better because the p-value from Christoffersen's test of independece was $0.603$ for $m.stock$ but only $0.095$ for $m.stock$ suggesting that VaR violations were closer to being &lt;em&gt;independent&lt;/em&gt; and &lt;em&gt;correct number of violations&lt;/em&gt;  when using index returns rather than stock returns. &lt;/p&gt;&#xA;" OwnerUserId="12002" LastActivityDate="2016-05-16T13:05:54.150" Title="GARCH model is better for index than stock" Tags="&lt;time-series&gt;&lt;statistics&gt;&lt;garch&gt;&lt;index&gt;" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26008" PostTypeId="1" AcceptedAnswerId="31359" CreationDate="2016-05-14T13:30:31.823" Score="2" ViewCount="383" Body="&lt;p&gt;The stochastic differential equation for an underlying with jumps in Merton model is:&#xA;$$d{{S}_{t}}=\mu \,{{S}_{t}}dt+\sigma \,{{S}_{t}}\,d{{W}_{t}}^{P}+(J-1){{S}_{t}}d{{q}_{t}}$$&#xA;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$t \quad\,\,\, \quad$ = time&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S \quad\, \quad$ = Underlying stock price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mu\,\,\quad\quad$ = Drift rate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma\quad\,\,\quad$ = Volatility&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dW\,\,\quad$ = Increment of Gauss-Wiener process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dq\quad\quad$ = Poisson process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$J -1 \,\,\,\,\,$= Impulse function producing a jump from $S$ to $S\lambda$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$K\quad\quad$ = $E(\lambda -1)$ , expected relative jump size&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;define a Poisson process $dq_t$ as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d{{q}_{t}}=\left\{ \begin{align}&#xA;  &amp;amp; 0\,\,\,\,\,\,,\,\,\,\,with\,probability\,\,1-\lambda (t)dt\, \\ &#xA; &amp;amp; 1\,\,\,\,\,,\,\,\,\,with\,probability\,\,\,\,\,\,\,\,\lambda (t)dt\, \\ &#xA;\end{align} \right.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\lambda$ = Poisson arrival intensity&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We assume that Gauss-Wiener process and jumps are independent. Based on the SDE the resulting $PIDE$ for a contingent claim $V(S,t)$ that depends on $S$ is given by (&lt;a href=&quot;https://scholar.google.com/scholar_url?url=http://srv02.planchet.net/EXT/ISFA/1226.nsf/fba3680ef04627c2c1256e430032c822/b4201161b37873d6c1256f56002dfc30/%24FILE/Merton%2520%255B1976%255D%2520Option%2520pricing%2520when.pdf&amp;amp;hl=en&amp;amp;sa=T&amp;amp;oi=gsb-gga&amp;amp;ct=res&amp;amp;cd=0&amp;amp;ei=gho3V56PJtCjmAHkiZGYCQ&amp;amp;scisig=AAGBfm1LWxqUeWzkF0JyTWO00hgCbZJzDA&quot; rel=&quot;nofollow&quot;&gt;Merton 1976&lt;/a&gt;):&#xA;\begin{equation}&#xA;\frac{\partial V}{\partial t}+(r-K \lambda )S\frac{\partial V}{\partial S}+\frac{1}{2}{{\sigma }^{2}}{{S}^{2}}\frac{{{\partial }^{2}}V}{\partial {{S}^{2}}}-(r+\lambda )V+\lambda \,\int_{0}^{\infty }{g(J)V(J{{S}_{t}},t)\,}dJ=0&#xA;\end{equation}&#xA;now I want to solve this $PIDE$ with some numerical methods like &quot;Monte Carlo&quot; , &quot;Binomial Tree &quot; etc. in order to pricing European Option. Would anybody give or teach me some useful and &lt;strong&gt;instructive&lt;/strong&gt; note or some references that I can learn  more than 3 numerical methods for Pricing European Options under Merton model ?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I appreciate any help.&lt;/p&gt;&#xA;" OwnerUserId="13370" LastActivityDate="2016-12-06T16:54:31.223" Title="Numerical Methods for Merton Model" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;numerical-methods&gt;&lt;jump&gt;&lt;merton-model&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26009" PostTypeId="2" ParentId="25997" CreationDate="2016-05-14T14:40:07.720" Score="1" Body="&lt;p&gt;The answer is undefined as the probability distribution provided is invalid, the probabilities don't sum up to one, so there's not much to expand on here.&lt;/p&gt;&#xA;" OwnerUserId="2626" LastActivityDate="2016-05-14T14:40:07.720" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26010" PostTypeId="1" CreationDate="2016-05-14T16:23:16.733" Score="1" ViewCount="190" Body="&lt;p&gt;(&lt;strong&gt;SOLVED&lt;/strong&gt;: Solution is below the second graph)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The API results on &lt;code&gt;GSPC&lt;/code&gt;:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/tFzjO.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/tFzjO.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Same period in the interactive chart of &lt;code&gt;^GSPC&lt;/code&gt;:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/ydVy5.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ydVy5.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;SOLVED&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Apparently, Yahoo Finance API has different results for &lt;code&gt;^GSPC&lt;/code&gt; and &lt;code&gt;GSPC&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="20740" LastEditorUserId="20740" LastEditDate="2016-05-17T17:28:46.803" LastActivityDate="2016-05-17T17:28:46.803" Title="Why are Yahoo Finance API values different from the web interface?" Tags="&lt;yahoofinance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26011" PostTypeId="2" ParentId="26010" CreationDate="2016-05-14T17:56:35.390" Score="1" Body="&lt;p&gt;Are you looking at the actual Close values or the Adjusted Close values in the API values? The Interactive chart shows the &lt;code&gt;Adjusted Close&lt;/code&gt; values which account for dividends/splits/other corporate events. More on how &lt;code&gt;Adjusted Close&lt;/code&gt; is calculated from actual &lt;code&gt;Close&lt;/code&gt; &lt;a href=&quot;http://www.investopedia.com/ask/answers/06/adjustedclosingprice.asp&quot; rel=&quot;nofollow&quot; title=&quot;here&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2542" LastActivityDate="2016-05-14T17:56:35.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26012" PostTypeId="2" ParentId="26007" CreationDate="2016-05-14T19:39:47.940" Score="2" Body="&lt;p&gt;The reason is earnings and other idiosyncratic corporate actions like takeovers, major product releases, etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are three terms in garch(1,1), the constant, term proportional to previous day's volatility, and a term proportional to &quot;stock noise&quot;. Earnings jump is much larger than previous &quot;regular&quot; volatility, and also much larger than &quot;regular&quot; noise. When a stock jumps, it is not the type of return that is explained by the model, so the fit is worse. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indexes, by averaging component stocks returns, smoothes out idiosyncratic jumps. Note that you can add terms to a garch model to model earnings, so you can get a better fit, possible comparable to those of an index.&lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2016-05-14T19:39:47.940" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26013" PostTypeId="2" ParentId="25596" CreationDate="2016-05-14T20:52:18.953" Score="1" Body="&lt;p&gt;You need to know what your original conditional distribution was when you fitted the AR-GARCH(1,1). Assuming that you chose a &lt;code&gt;student-t&lt;/code&gt; distribution, the reverse transformation after &lt;code&gt;step 4&lt;/code&gt; in &lt;code&gt;R&lt;/code&gt; would look as follows:&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;step 1: Fit Garch&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;fit &amp;lt;- rugarchfit&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;step 4: Simulate points&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sim &amp;lt;- 'simulated 100 points'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;step 5: Convert 100 uniformly distributed points back to the originally distributed series&lt;/h3&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;shape &amp;lt;- coef(fit)['shape']&#xA;transformed_residuals &amp;lt;- qdist(&quot;std&quot;, mu=0, sigma=1, sim, shape = shape)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="20742" LastActivityDate="2016-05-14T20:52:18.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26015" PostTypeId="2" ParentId="22767" CreationDate="2016-05-15T01:20:43.613" Score="1" Body="&lt;p&gt;Although, I think this question is a bit off-topic for a Quant S.E., I'll try to answer it with my background sitting at a commodities desk at a bank.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Since most of the future contracts are never settled physically&#xA;  (therefore, no actual trades occour), why would the rest (actual&#xA;  buyers and sellers) even agree to participate in this speculative&#xA;  price action game?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What you are confusing here is CME/CFTC's classification term of &quot;speculator&quot; and speculation. &quot;Hedgers&quot; as classified by CME above are still participating in price speculation. By coming into the paper market to hedge, they are expressing their opinion about the physical they own. &quot;Hedgers&quot; also don't settle their paper derivative hedge most often. As in, they don't take delivery of the CME specified physical asset that the futures contract is linked to. Most &quot;hedgers&quot; have a slightly different grade / type of commodity than the listed contract, and they often just use it as a proxy hedge that's most liquid out there (standardized futures contracts traded on exchanges like CME).&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Why futures contract price of commodity is considered to be some kind&#xA;  of approximant of commodity price if all it is is ~97% speculation of&#xA;  traders who never bought/sold, never does and never will be involved&#xA;  in the commodity trade?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Unclear what you mean by &quot;approximant of commodity price&quot; but I think this question perhaps is just a question of &quot;what is forwards/futures?&quot; &lt;/p&gt;&#xA;" OwnerUserId="20724" LastActivityDate="2016-05-15T01:20:43.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26016" PostTypeId="1" CreationDate="2016-05-15T01:36:12.160" Score="0" ViewCount="302" Body="&lt;p&gt;I am trying to use the closing prices of the S&amp;amp;P 500 and the Nikkei Index to see how they are correlated (assuming they are exactly 12 hours apart).  In order to test my method, I have generated two Brownian Motions with a known correlation of 1/2.  I then take the odd-numbered data points of the first Brownian Motion and the even-numbered data points from the second, and I test my method on these data sets.  However, nothing I do seems to work.  I have tried the naive approach of shifting one of the BM's over, I have tried to determine the correlation of the &quot;returns&quot; (I know the intervals are i.i.d.), I have tried a naive data-filling method (insert the midpoint of each pair of data points into the BM), and I have tried to create a new path of the midpoints of one of the two BM's and tried finding the correlation of this, and the other BM.  All of these methods consistently get values close to zero.  Does anyone have any ideas on how to go about getting the correlation from asynchronous data?  I understand that the intervals of Brownian Motions are i.i.d., so I am thinking I should use this to my advantage.&lt;/p&gt;&#xA;" OwnerUserId="20743" LastActivityDate="2017-02-01T19:00:52.000" Title="Correlation of Asynchronous Brownian Motion" Tags="&lt;market-data&gt;&lt;correlation&gt;&lt;brownian-motion&gt;" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26017" PostTypeId="1" CreationDate="2016-05-15T02:39:00.173" Score="0" ViewCount="83" Body="&lt;p&gt;I am doing a regression analysis and my variable of interest turns out to be significant at the 5% level, but the model contains heteroskedasticity which can not be mitigated (using Box-Cox, Feasible generalized least squares).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I still conclude that my variable of interest is significant, or should I consider my result to be insignificant because of persistent heteroskedasticity?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you! &lt;/p&gt;&#xA;" OwnerUserId="15089" LastActivityDate="2016-09-12T18:19:58.410" Title="Heteroskedasticity and significance of parameters" Tags="&lt;regression&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26018" PostTypeId="2" ParentId="26005" CreationDate="2016-05-15T06:44:18.897" Score="0" Body="&lt;p&gt;The dominant IRS float tenor at longer maturities for EUR is 6m Euribor. So we assume that the EUR 3m leg of the xccy basis swap is constructed from a 6m IRS and therefore also 3s6s EUR basis. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the interbank world there will also be risk contributions from the EONIA or FedFund discounting, via OIS or again basis (3sOIS). These sensitivities are generally much smaller than the forward rate sensitivities. &lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2016-05-15T06:44:18.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26019" PostTypeId="1" AcceptedAnswerId="26045" CreationDate="2016-05-15T06:51:35.833" Score="0" ViewCount="147" Body="&lt;p&gt;If I'm looking to pick stocks that will double in 3 years, how do I figure out what is the likely universe that I'm choosing from? I just want a rough estimate of the universe given the market cap constraint of $1b USD market cap on a global basis. How do I go about estimating that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need a historical &quot;average&quot;... historically on average what % of stocks will double in 3 years? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe make some simple standard deviation of returns for the market and see what sigma 2x in 3 years falls under? let's say if historically market goes up 12% a year... not sure if it is the right approach to it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically wanted to get a rough estimate without actually crunching a whole bunch of historical numbers.&lt;/p&gt;&#xA;" OwnerUserId="15482" LastEditorUserId="15482" LastEditDate="2016-05-16T06:25:25.053" LastActivityDate="2017-01-11T15:11:15.920" Title="what % of stocks with +$1b market cap will double in 3 years on average historically?" Tags="&lt;finance&gt;&lt;statistical-finance&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26020" PostTypeId="2" ParentId="25991" CreationDate="2016-05-15T07:08:54.713" Score="0" Body="&lt;p&gt;The floating rate used to determine the interest payment in any given float leg roll depends on the fixing appropriate to the start of the roll. So if the only change to this IRS structure is to extend the final roll by 2 days, then that final rate will just be calculated to include the extra days using the day count convention, and that payment will be discounted from the slightly further payment date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, some things you mention suggest that you are not calculating separate forward and discount rates (I.e. using traditional textbook method), so you will first need to construct a curve of forward rates using multiple swap maturities in order to work out what the final float fixing will be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In any case, for a longer maturity swap, I would expect 2 days to make less difference than the bid-ask spread, particularly for a buy-side actor.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2016-05-15T07:08:54.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26023" PostTypeId="2" ParentId="26007" CreationDate="2016-05-15T10:02:25.930" Score="0" Body="&lt;p&gt;Jacob, you conclude that &quot;The main finding is that VaR is more suited for our index portfolio GSPC than for our stock JPM.&quot; This conclusion is not surprising. However I think that is not the VaR in itself &quot;more suited,&quot; but the underlying GARCH(1,1) model.  You introduce the standardized error in section 4.6. That is the right way. I did not study your pdf in depth, but I'm almost sure that the quality of fit of GARCH(1,1) model for index are, in some sense, better than than those of the same model on a single stock. Here is the problem: the result of Kupiec and or Christoffersen's test are only the transposition of the same thing. The problem for single stock is not the VaR in itself, but finding the &quot;good model,&quot; as ARMA(?,?)-GARCH(?,?), for it. Probably if you fit the same GARCH(1,1) model for a single stock much smaller and less liquid that JPM the resulting VaR will be worse than JPM's. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As liquidity I mean the usual sense in stock market as explained here &#xA;&lt;a href=&quot;https://en.wikipedia.org/wiki/Market_liquidity#Stock_market&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Market_liquidity#Stock_market&lt;/a&gt;&#xA;if the stock A in less liquid than stock B, probably is easier to find a good model for A than for B. That's all.&lt;/p&gt;&#xA;" OwnerUserId="20745" LastEditorUserId="20746" LastEditDate="2016-05-16T13:05:54.150" LastActivityDate="2016-05-16T13:05:54.150" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26024" PostTypeId="1" CreationDate="2016-05-15T13:27:02.237" Score="0" ViewCount="56" Body="&lt;p&gt;If I use monthly price data in the standard CAPM, should I take the price at the beginning or the end of the month? What is the convention? Or does it not matter? Is there any literature that deals explicitly with this subject?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="20747" LastActivityDate="2016-05-17T14:52:07.857" Title="CAPM - Do I use start or end of period prices?" Tags="&lt;finance&gt;&lt;asset-pricing&gt;&lt;capm&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26026" PostTypeId="2" ParentId="22767" CreationDate="2016-05-15T14:13:26.473" Score="1" Body="&lt;p&gt;You don't have to have a large percentage of the participants able to take physical delivery, just a small percentage.  For every contract there are plenty of people who will take it in to inventory or sell out of it if the spread between the spot and future is wide enough.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So there's a band that's created.  For example, if Henry Hub Gas is 2.9 and the future is 2.91, most physicals traders wouldn't find it worth it to trade the arb.  But, when it gets to 3.05 vs 2.9, then you would have people trading it.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the right way to look at is that the spot and future will almost never be perfectly aligned, but they will trade in a band.&lt;/p&gt;&#xA;" OwnerUserId="20092" LastActivityDate="2016-05-15T14:13:26.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26027" PostTypeId="1" CreationDate="2016-05-15T14:22:26.430" Score="1" ViewCount="373" Body="&lt;p&gt;I understand that when a vanilla European option is near expiry, the Theta calculated from BS formula is very inaccurate and almost meaningless for practical use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I'm not sure if other Greeks, such as Gamma and Vega, also have the same characteristics, i.e. becoming inaccurate near expiry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so, is there any other model that overcomes this problem for expiring options?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apologies that I was not from a quant/math background; I'm asking this question from a very practical trading/risk-management perspective. I'd appreciate if anyone can point a direction for me to read further into.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I'm just looking at the simplest vanilla European options for equity index, not any exotic ones.&lt;/p&gt;&#xA;" OwnerUserId="2794" LastEditorUserId="2794" LastEditDate="2016-05-16T08:03:43.257" LastActivityDate="2016-05-16T08:03:43.257" Title="Accurately calculating Greeks for options near expiration" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;greeks&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26029" PostTypeId="2" ParentId="26017" CreationDate="2016-05-15T15:39:16.137" Score="1" Body="&lt;p&gt;You can conclude nothing: your parameters can be significant, but also not significant. If your data are heteroskedastic, you can use a correction to the standard error, that is Heteroskedasticity and Autocorrelation Consistent (HAC) covariance matrix of Newey and West: this computes standard errors robust to heteroskedasticity and you can conclude with more certanty about the significance of your parameters. Anyway, I think FGLS method is robust to heteroskedasticity.&lt;/p&gt;&#xA;" OwnerUserId="18694" LastActivityDate="2016-05-15T15:39:16.137" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26031" PostTypeId="1" CreationDate="2016-05-15T18:32:42.783" Score="1" ViewCount="212" Body="&lt;p&gt;What would a standard asset pricing model predict for the risk-free rate and the equity premium, if the volatility of consumption growth fell?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My gut feel is that the equity premium should fall, but I cannot justify why this would be the case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; By 'standard asset pricing model' the question is implying one with the following intuition: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Assets are priced according to their covariance with&#xA;consumption growth. Assets which pay off when consumption&#xA;growth is high (in good times) are risky, hence they will need to&#xA;have high expected returns for investors to want to hold them&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="20531" LastActivityDate="2017-02-10T14:40:35.003" Title="Asset Pricing: What happens to the Risk-Free rate and the Equity Premium?" Tags="&lt;asset-pricing&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26032" PostTypeId="1" AcceptedAnswerId="26053" CreationDate="2016-05-15T19:12:35.913" Score="5" ViewCount="175" Body="&lt;p&gt;I have read two definitions of the term &lt;em&gt;an arbitrage opportunity&lt;/em&gt; in the literature*. Are they equivalent?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a single period market model over the measurable space $\Omega = \{\omega_1, \dots, \omega_M\}$, comprising $n + 1$ assets $S^0, S^1, \dots, S^n$, of which $S^0$ is the risk-free asset with risk-free interest rate $R \geq 0$. A &lt;em&gt;portfolio&lt;/em&gt; is an $n + 1$ tuple $(x_0, x_1, \dots, x_n) \in \mathbb{R}^{n+1}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Definition 1&lt;/em&gt;&lt;/strong&gt; A portfolio $(x_0, \dots, x_n)$ is an arbitrage opportunity iff&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$x_0 S^0_0 + \cdots + x_n S^n_0 = 0$,&lt;/li&gt;&#xA;&lt;li&gt;$x_0 S^0_1 + \cdots + x_n S^n_1 \geq 0$ for all $\omega \in \Omega$,&lt;/li&gt;&#xA;&lt;li&gt;$x_0 S^0_1 + \cdots + x_n S^n_1 &amp;gt; 0$ for some $\omega \in \Omega$.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Definition 2&lt;/em&gt;&lt;/strong&gt; A portfolio $(x_0, \dots, x_n)$ is an arbitrage opportunity iff&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;x_1 (\frac{1}{1 + R} S^1_1 - S^1_0) + \cdots x_n (\frac{1}{1 + R} S^n_1 - S^n_0) \geq 0&#xA;$$&#xA;for all $\omega \in \Omega$ with strict inequality holding for at least one $\omega \in \Omega$.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;* Definition 1 is from Capiński &amp;amp; Kopp's &quot;Discrete Models of Financial Markets&quot; (Cambridge University Press 2012), whereas definition 2 is from Roman's &quot;Introduction to the Mathematics of Finance: Arbitrage and Option Pricing&quot;, 2nd edition (Springer 2012).&lt;/p&gt;&#xA;" OwnerUserId="15619" LastEditorUserId="15619" LastEditDate="2016-05-16T16:05:23.663" LastActivityDate="2016-05-16T19:09:43.973" Title="Two definitions of arbitrage in finite markets" Tags="&lt;arbitrage&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26033" PostTypeId="1" AcceptedAnswerId="26042" CreationDate="2016-05-15T19:49:44.590" Score="3" ViewCount="747" Body="&lt;p&gt;I am currently doing research on the OTC Markets (OTCQB, OTCQX). As far as I know, the only data available is end of day. The research will require tick level data. This leads me to two questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Are there any resources for tick level data for the OTC markets?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If not, I was considering collecting the data myself. I am not a developer so forgive my ignorance, &lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;What are some possible methods of performing this collection? &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Any elaboration on concerns regarding storage, programming, ect. would be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="15832" LastActivityDate="2016-05-16T04:42:16.377" Title="OTC Market Data" Tags="&lt;data&gt;&lt;programming&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26034" PostTypeId="1" CreationDate="2016-05-15T22:28:26.407" Score="6" ViewCount="9564" Body="&lt;p&gt;In the book that I am studying, the tangent portfolio was defined as the regular efficient portfolio in the case with $n$ risky assets and 1 riskfree asset with the extra requirement that the portfolio invests fully in the risky assets. So the tangent portfolio can be derived using the solutions to the mean/variance analysis problem: $$w = \frac{\mu_P}{\mu^T \Sigma^{-1} \mu}\Sigma^{-1} \mu$$$$ \sigma_P^2 = \frac{\mu_P^2}{\mu^T \Sigma^{-1} \mu}$$ where one can apply the restrictions on $w$ to obtain weights, mean excess return, and variance of the portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet I know that in other books, this portfolio is actually &lt;em&gt;defined&lt;/em&gt; as the one with the highest sharpe ratio. I don't see the connection. How is this proven, if we used the derivation described above? I can calculate the sharpe ratio (it turns out to be the square root of the denominator in the second equation above), but how do I know it's bigger than the ones corresponding to all other investments in risky assets?&lt;/p&gt;&#xA;" OwnerUserId="20753" LastActivityDate="2018-06-01T15:09:19.350" Title="Tangency portfolio and CML - Why does it have the highest sharpe ratio?" Tags="&lt;modern-portfolio-theory&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26035" PostTypeId="2" ParentId="26016" CreationDate="2016-05-15T22:45:31.110" Score="2" Body="&lt;p&gt;Closing prices should be very highly correlated, I assume you care about close to close returns instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the frequency of the data that you seem to be looking at (ie you don't seem to be looking at correlation of the futures return intraday), I assume this is for some sort of modelling/pricing over a longer horizon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I believe most people do here is to look at correlations for 3 or 5 day return periods. The idea here is that in that case common factors driving returns show up again, because as you noticed, on a single day basis there is a de correlation effect due to time zone differences. &lt;/p&gt;&#xA;" OwnerUserId="11851" LastEditorUserId="11851" LastEditDate="2017-02-01T15:00:29.067" LastActivityDate="2017-02-01T15:00:29.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26036" PostTypeId="1" AcceptedAnswerId="26049" CreationDate="2016-05-15T22:56:12.693" Score="1" ViewCount="85" Body="&lt;p&gt;I have a strategy in Samuelson model with zero safe rate defined as $$Z_t^{\Pi}=\frac{X_t^{\Pi}}{X_t^{\rho}} \quad \quad (1)$$  where &#xA;$$\frac{dX_t^{\Pi}}{X_t^{\Pi}} = \mu \pi dt + \sigma \pi \ dW_t \quad \quad (2)$$&#xA;$$ \frac{dX_t^{\rho}}{X_t^{\rho}} = \mu \rho dt + \sigma \rho \ dW_t  \quad \quad (3)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;what gives the following dynamic &#xA;$$\frac{dZ_t^{\Pi}}{Z_t^{\Pi}} = (\mu -\sigma^2 \rho )(\pi - \rho) dt + \sigma (\pi - \rho)\ dW_t  \quad \quad (4)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To prove that $\rho=\frac{\mu}{\sigma^2} $ is the optimal strategy for the $$\max_{\Pi} E [ logX_T^{\Pi}] \quad \quad (5)$$&#xA;&lt;br&gt;&#xA;&lt;br&gt;&#xA;Using (1), logarithmic property, Jensen's inequality and supermartingale property I can derive the below inequality&#xA;$$ E \big{[} log(X_t^{\Pi}) \big{]} \leq E \big{[} log(X_t^{\rho}) \big{]}  \quad \quad (6)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The question I have is how the inequality (5) implies that the optimal strategy is $\rho=\frac{\mu}{\sigma^2} $?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="18670" LastEditorUserId="18670" LastEditDate="2016-05-15T23:45:32.747" LastActivityDate="2016-05-16T15:00:12.160" Title="optimal strategy problem (using Jensen's inequality)" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;utility-theory&gt;&lt;stochastic-control&gt;" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="26037" PostTypeId="2" ParentId="25698" CreationDate="2016-05-15T23:32:26.317" Score="1" Body="&lt;pre&gt;&lt;code&gt;TED spread 6mo chg = TED Spread{t} - TED Spread{t-6}, t := month&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user18489" LastActivityDate="2016-05-15T23:32:26.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26038" PostTypeId="2" ParentId="26031" CreationDate="2016-05-15T23:34:41.117" Score="0" Body="&lt;p&gt;Short answer: Individuals have a preference for smooth consumption streams. To be able to smooth consumption if consumption is more volatile, individuals save more driving down risk-free rates.&lt;/p&gt;&#xA;" OwnerUserId="19775" LastActivityDate="2016-05-15T23:34:41.117" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26039" PostTypeId="2" ParentId="26024" CreationDate="2016-05-16T01:34:43.380" Score="1" Body="&lt;p&gt;The most common approach is to calculate returns as $r_t=\frac{p_t-p_{t-1}}{p_{t-1}}$ or $r_t=ln\left (\frac{p_t}{p_{t-1}}\right)$ using close prices at the end of the month.&lt;/p&gt;&#xA;" OwnerUserId="19775" LastActivityDate="2016-05-16T01:34:43.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26040" PostTypeId="2" ParentId="26027" CreationDate="2016-05-16T02:18:08.670" Score="4" Body="&lt;p&gt;Generalizing, some people who write options trading software are not aware of a few small, but important details, resulting in some pricing idiosyncrasies. That is often the case with retail trading platforms, and you often read statements like &quot;implied vol blows up in days before expiration&quot;, &quot;greeks become unreliable before expiration&quot;, or suggestion of ridiculous fixes, such as using settlement time (Saturday noon) as expiration time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is certainly an issue, but it is not a big issue if your software is written properly. Coming from options market making background, and using better software, greeks would work more or less correctly until about 10 minutes until the close, at which point we would switch to pricing things at parity, and deltas being binary, etc...   &lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2016-05-16T02:18:08.670" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26041" PostTypeId="1" CreationDate="2016-05-16T02:46:47.970" Score="1" ViewCount="115" Body="&lt;p&gt;I am trying to forecast future price using supervised machine learning. My logic is to take open and close price from &lt;strong&gt;t,  t-1, t-2 and t-3&lt;/strong&gt; period to predict future close price in the period &lt;strong&gt;t+1,t+3 and t+5&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quantmod)&#xA;symbol= getSymbols(&quot;AAPL&quot;,from=&quot;2010-03-01&quot;, auto.assign=F)&#xA;close&amp;lt;-Cl(symbol)&#xA;open&amp;lt;-Op(symbol)&#xA;lc1&amp;lt;-lag(close)&#xA;lc2&amp;lt;-lag(close,2)&#xA;lc3&amp;lt;-lag(close,3)&#xA;lo1&amp;lt;-lag(open)&#xA;lo2&amp;lt;-lag(open,2)&#xA;lo3&amp;lt;-lag(open,3)&#xA;X&amp;lt;-cbind(close,open,lc1,lc2,lc3,lo1,lo2,lo3)&#xA;Y&amp;lt;-need to assign close price for t+1,t+3 and t+5&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have created feature vectors using lag function for period 0,1,2 and 3 but my question is how to I assign target variable for t+1, t+3 and t+5 periods.&lt;/p&gt;&#xA;" OwnerUserId="16754" LastActivityDate="2016-05-17T11:13:41.333" Title="How to assign n day target variables in machine learning" Tags="&lt;programming&gt;&lt;machine-learning&gt;&lt;prediction&gt;&lt;forecast&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26042" PostTypeId="2" ParentId="26033" CreationDate="2016-05-16T04:42:16.377" Score="3" Body="&lt;p&gt;From what I know OTC &lt;a href=&quot;http://www.otcmarkets.com/&quot; rel=&quot;nofollow&quot;&gt;http://www.otcmarkets.com/&lt;/a&gt; has their data provided to them by EDGAR, which provides solutions such as API's which can be used to acces things like historical market data. the following website should deliberate on this further &lt;a href=&quot;http://www.edgar-online.com/DataContentSolutions.aspx&quot; rel=&quot;nofollow&quot;&gt;http://www.edgar-online.com/DataContentSolutions.aspx&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following gives more specific API information for Developers &lt;a href=&quot;http://developer.edgar-online.com/home&quot; rel=&quot;nofollow&quot;&gt;http://developer.edgar-online.com/home&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just to confirm when you say tick level data do you essentially meaning intraday stock data? and if so what is the interval (frequency) at which you want this data?&lt;/p&gt;&#xA;" OwnerUserId="20245" LastActivityDate="2016-05-16T04:42:16.377" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26043" PostTypeId="1" AcceptedAnswerId="26060" CreationDate="2016-05-16T05:11:16.067" Score="2" ViewCount="227" Body="&lt;p&gt;I have a market with safe rate r and risky asset S&#xA;$$ \frac{dS_t}{S_t}=(r+Y_t)dt+\sigma dW_t \quad \quad (1)$$&#xA;$$ dY_t = - \lambda Y_t +dB_t \quad \quad (2)$$&#xA;where W, B are Brownian Motions with correlation $\rho$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am deriving the HJB equation for the utility maximization problem $$\max_{X} E[logX_T]  \quad \quad (3)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The V function depends on t, X and Y. HJB is going to be the drift of the dV function derived using Ito formula. Hence the initial dV function will be of the following form&#xA;$$dV(t,X_t,Y_t)=V_t dt + V_x dX_t + V_ydY_t + \frac{1}{2} \big{(} V_{xx} d \langle X \rangle_t + 2 V_{xy} d \langle X,Y \rangle_t + V_{yy} d \langle Y \rangle_t  \big{)} \quad \quad (4)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so I supposed to get the below HJB equation&#xA;$$\sup_{\pi} \big{(}  V_t + V_x (r+y \pi)x - \lambda y V_y + \frac{1}{2} (V_{xx}\sigma^2 \pi^2 x^2 + 2V_{xy} \sigma \rho \pi x + V_{yy} ) \big{)} =0 \quad \quad (5)$$&#xA;using the follwing dynamics&#xA;$$dX_t=X_t(r+ \pi y )dt + \pi \sigma X_t dW_t \quad \quad (6)$$&#xA;$$$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I don't quite follow how the $dX_t$ is created and how the $\pi$ comes into play here. My guess is that it represents portfolio weight and $dX_t$ represents the change in the capital. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the theory (study notes) I have a general formula for one variable and it looks like&#xA;$$dV(X_t^{\Pi},t)=V_t + X_t^{\Pi} (r + \Pi' \mu)V_x + \frac{\Pi_t' \Sigma \Pi_t}{2} (X_t^{\Pi})^2 V_{xx})dt + V_x X_t^{\Pi} \Pi_t' \sigma dW_t  \quad \quad (7)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The use of the $\pi, \Pi$ components confuses me. Could anybody clarify of the logic behind the use of $\pi$ and $dX_t$ derivation please?&lt;/strong&gt; &lt;/p&gt;&#xA;" OwnerUserId="18670" LastActivityDate="2016-05-16T21:11:24.877" Title="example Hamilton-Jacobi-Bellman Equation - clarification of $dX_t$ derivation using $\pi_t$, $\Pi_t$" Tags="&lt;stochastic-processes&gt;&lt;brownian-motion&gt;&lt;utility-theory&gt;&lt;stochastic-control&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26044" PostTypeId="2" ParentId="17315" CreationDate="2016-05-16T05:11:27.097" Score="7" Body="&lt;p&gt;I'd just like to share that I work at Quandl and noticed this thread. We now have global fundamentals data that can be downloaded in various formats including CSV. Our Global Select Stock Fundamentals database can be found here: &lt;a href=&quot;https://www.quandl.com/data/RB1&quot; rel=&quot;noreferrer&quot;&gt;https://www.quandl.com/data/RB1&lt;/a&gt; The database covers 75 harmonized financials, ratios and forecasts for 4500+ most liquid global stocks. There's a special focus on Asian and European companies. The database also covers 6 years history and is updated daily. Another source of global fundamentals that we offer is Global Fundamentals data from Mergent here: &lt;a href=&quot;https://www.quandl.com/databases/MF1&quot; rel=&quot;noreferrer&quot;&gt;https://www.quandl.com/databases/MF1&lt;/a&gt; Key features: Fundamentals data providing 50+ fundamental indicators, including derived margins and ratios, for 10,000+ companies across 67 countries as covered by the Russell Global Index. Also includes auditor status for each company. History goes back to 2005. Updated daily.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We'd also like to comment that we're very conscious of our search feature's shortcomings and we're working very hard to improve our search so that users can find the exact data they need more easily. &lt;/p&gt;&#xA;" OwnerUserId="20757" LastEditorUserId="20757" LastEditDate="2016-05-16T05:17:40.203" LastActivityDate="2016-05-16T05:17:40.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26045" PostTypeId="2" ParentId="26019" CreationDate="2016-05-16T10:04:39.813" Score="1" Body="&lt;p&gt;few comments:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) stock that will double in 3 years means that the yearly average return must satisty $x(1+r)^3=2x$, which gives the value of r=25.99%.&#xA;(a yearly return of 25.99% is highly unrealistic)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) the question &quot;historically on average what % of stocks will double in 3 years?&quot; cannot be answered without&#xA;looking at the historical numbers, and the more data you'd use, the better.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) given that data (whatever data you have available - FTSE, S&amp;amp;P 500, Rusell), you'd&#xA;choose the +$1b stocks, calculate yearly returns and look at the percentage of returns which satisfy&#xA;the above condition (i.e. average return of 25.99%), or calculate returns over three-year&#xA;period and simply count how many have a 100% return in 3 years. This is if you're interested in &lt;em&gt;historical&lt;/em&gt; performance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're looking to &lt;em&gt;forecast&lt;/em&gt; the potential future returns and see if a stock can double, you'd need to do a time-series analysis (of each stock), forecast the returns (with a certain confidence interval), and see whether doubling in 3 years is possible.&lt;/p&gt;&#xA;" OwnerUserId="18030" LastActivityDate="2016-05-16T10:04:39.813" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26046" PostTypeId="2" ParentId="26041" CreationDate="2016-05-16T11:40:38.927" Score="1" Body="&lt;p&gt;You need to assign each of the target variables to their own column and then train a model for each of your forecast horizons&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quantmod)&#xA;symbol= getSymbols(&quot;AAPL&quot;,from=&quot;2010-03-01&quot;, auto.assign=F)&#xA;close&amp;lt;-Cl(symbol)&#xA;open&amp;lt;-Op(symbol)&#xA;lc1&amp;lt;-lag(close)&#xA;lc2&amp;lt;-lag(close,2)&#xA;lc3&amp;lt;-lag(close,3)&#xA;lo1&amp;lt;-lag(open)&#xA;lo2&amp;lt;-lag(open,2)&#xA;lo3&amp;lt;-lag(open,3)&#xA;X&amp;lt;-cbind(close,open,lc1,lc2,lc3,lo1,lo2,lo3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Add outcome variables (Y)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;X$t1&amp;lt;-lag(close,-1)&#xA;X$t3&amp;lt;-lag(close,-3)&#xA;X$t5&amp;lt;-lag(close,-5)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From this you can nou train 3 models to predict the closing of $t+n, n=1,..,n$&lt;/p&gt;&#xA;" OwnerUserId="20742" LastActivityDate="2016-05-16T11:40:38.927" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26047" PostTypeId="2" ParentId="26034" CreationDate="2016-05-16T12:47:21.313" Score="1" Body="&lt;p&gt;Your question is very important! In formal way to demonstrate it is very interesting ... but a bit complicated ... and boring for non mathematicians. We may move around this demonstration to explain most of portfolio theory.&#xA;However, to give the idea, if we have N risky assets we obtain, as efficient frontier, a semi-parabola and the weights of the countless efficient portfolio change point by point. If we have N risky asset + a risk free rate, we obtain, as efficient frontier, a straight line. Now every point/portfolio have only 1 risky component ... a tangent portfolio. Other efficient portfolios are linear combinations between tangent portfolio and risk free asset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This line, as any other, has a slope ... in this framework the slope is the Sharpe ratio! This line is the CML and it is tangent with previous semi-parabola. For the line, to move above the semi-parable is impossible, but if we move below (possible) we have the (inefficient) CAL ... that has a lower slope ... so the CML has maximum slope/Sharpe Ratio. That's all.&lt;/p&gt;&#xA;" OwnerUserId="20746" LastEditorUserId="16148" LastEditDate="2016-05-16T21:27:04.017" LastActivityDate="2016-05-16T21:27:04.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26048" PostTypeId="1" AcceptedAnswerId="26057" CreationDate="2016-05-16T13:05:23.543" Score="2" ViewCount="1288" Body="&lt;p&gt;I would like to know about below questions.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;How many years of historical data is require for Portfolio Optimization in R programming. &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks&#xA;Atul&lt;/p&gt;&#xA;" OwnerUserId="20303" LastEditorUserId="20303" LastEditDate="2016-05-17T16:20:36.773" LastActivityDate="2016-05-17T16:20:36.773" Title="How many years of historical data is require for Portfolio Optimization?" Tags="&lt;r&gt;&lt;portfolio-optimization&gt;&lt;quantmod&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26049" PostTypeId="2" ParentId="26036" CreationDate="2016-05-16T14:17:54.087" Score="1" Body="&lt;p&gt;I assume that the problem is $$\max_{\pi} E\left(\ln Z_T^{\Pi} \right).$$&#xA;Note that $\ln Z_t^{\Pi} = \ln X_t^{\Pi} -\ln X_t^{\rho}$. Moreover,&#xA;\begin{align*}&#xA;d\ln Z_t^{\Pi} &amp;amp;= d\ln X_t^{\Pi} -d\ln X_t^{\rho}\\&#xA;&amp;amp;=\Big[\big(\mu \pi -  \frac{1}{2}\sigma^2 \pi^2\big) - \big(\mu \rho-  \frac{1}{2}\sigma^2 \rho^2\big) \Big]dt + \sigma(\pi-\rho)dW_t.&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;E\left(\ln Z_T^{\Pi} \right) = \Big[\big(\mu \pi -  \frac{1}{2}\sigma^2 \pi^2\big) - \big(\mu \rho-  \frac{1}{2}\sigma^2 \rho^2\big) \Big]T.&#xA;\end{align*}&#xA;Consequently,&#xA;\begin{align*}&#xA;\max_{\pi}E\left(\ln Z_T^{\Pi} \right) &amp;amp;= \max_{\pi}\Big[\big(\mu \pi -  \frac{1}{2}\sigma^2 \pi^2\big) - \big(\mu \rho-  \frac{1}{2}\sigma^2 \rho^2\big) \Big]T\\&#xA;&amp;amp;=\max_{\pi}\Big[-\frac{1}{2}\sigma^2\big( \pi - \frac{\mu}{\sigma^2} \big)^2 + \frac{1}{2}\mu^2- \big(\mu \rho-  \frac{1}{2}\sigma^2 \rho^2\big) \Big]T,&#xA;\end{align*}&#xA;which is a maximization problem for a quadratic function of $\pi$. It is then clear that the maximum is achieved at $\pi = \frac{\mu}{\sigma^2}$.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;EDIT&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Consider the problem $\max_{\pi}E\left(\ln X_T^{\Pi} \right)$. Note that&#xA;\begin{align*}&#xA;d\ln X_t^{\Pi} = \big(\mu \pi -  \frac{1}{2}\sigma^2 \pi^2\big)dt + \sigma \pi dW_t.&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;\max_{\pi}E\left(\ln X_T^{\Pi} \right) &amp;amp;= \max_{\pi}\big(\mu \pi -  \frac{1}{2}\sigma^2 \pi^2\big)T\\&#xA;&amp;amp;=\max_{\pi}\Big[-\frac{1}{2}\sigma^2\big( \pi - \frac{\mu}{\sigma^2} \big)^2 + \frac{1}{2}\mu^2 \Big]T,&#xA;\end{align*}&#xA;which is again a maximization problem for a quadratic function of $\pi$, and the maximum is achieved at $\pi = \frac{\mu}{\sigma^2}$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-05-16T15:00:12.160" LastActivityDate="2016-05-16T15:00:12.160" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26050" PostTypeId="2" ParentId="25440" CreationDate="2016-05-16T14:50:19.800" Score="6" Body="&lt;p&gt;A &quot;flickering&quot; order is one which is repeatedly submitted and cancelled (whether it's at the top of book or not).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answer from @chollida mentions that &quot;the goal typically is to either slow down competitors quotes by flooding the gateway interface with noise&quot; but I don't think that's necessarily true.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rather, I think many flickering quotes are caused by an unintended feedback mechanism - the trader submits an order, thereby changing the displayed order book. Their model processes the new book and tells them to cancel the order, which they do. Now the book looks the same as it did previously, and their model tells them to submit a new order, etc etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solutions are typically -&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Hard-coded rules to not repeatedly submit and cancel orders in a short period of time, or&lt;/li&gt;&#xA;&lt;li&gt;Filtering the order book so that your model does not process your own orders.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Not all firms do either of (1) or (2) and so they will accidentally quote flicker from time to time.&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2016-05-16T14:50:19.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26051" PostTypeId="2" ParentId="26032" CreationDate="2016-05-16T15:30:53.480" Score="2" Body="&lt;p&gt;Short answer: They seem not equivalent. On the first definition, the risk-free rate is part of the portfolio, and enters with quantity $x_0$. In the second definition, they discount the $S_1^n$ quantities by the risk free rate, implying that you have an arbitrage only if the gain you get on your portfolio (at time 1), is greater than the gain you could have had by investing only in the risk free.&lt;/p&gt;&#xA;" OwnerUserId="18694" LastActivityDate="2016-05-16T15:30:53.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26052" PostTypeId="1" CreationDate="2016-05-16T15:31:22.783" Score="1" ViewCount="58" Body="&lt;p&gt;Can someone explain this statement? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;The beauty of the fund separation theorem is that the performance seeking portfolio mandate is the same for all investors&quot; &lt;/p&gt;&#xA;" OwnerUserId="20156" LastActivityDate="2016-05-16T15:31:22.783" Title="Fund Separation Theorem for Performance Seeking Portfolio" Tags="&lt;portfolio-management&gt;&lt;performance-evaluation&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26053" PostTypeId="2" ParentId="26032" CreationDate="2016-05-16T16:00:12.690" Score="3" Body="&lt;p&gt;They are equivalent. From Definition 1, note that $S_1^0 = S_0^0(1+R)$. Then&#xA;\begin{align*}&#xA;x_0 S_1^0 + \cdots x_n S_1^n &amp;amp;= x_0 S_0^0 (1+R)+ x_1 S_1^1 + \cdots x_n S_1^n\\&#xA;&amp;amp;= (-x_1 S_0^1 - \cdots -x_n S_0^n) (1+R)+ x_1 S_1^1 +  \cdots x_n S_1^n\\&#xA;&amp;amp;= x_1 \left(S_1^1 - S_0^1(1+R) \right) + \cdots + x_n \left(S_1^n - S_0^n(1+R) \right)\\&#xA;&amp;amp;=(1+R)\bigg[x_1\Big(\frac{S_1^1}{1+R} - S_0^1 \Big) + \cdots + x_n\Big(\frac{S_1^n}{1+R} - S_0^n \Big) \bigg].&#xA;\end{align*}&#xA;That is, definition 1 implies definition 2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, assume that definition 2 holds. Then, let $S_0^0 = 1$ and&#xA;\begin{align*}&#xA;x_0 = -x_1 S_0^1 - \cdots - x_n S_0^n.&#xA;\end{align*}&#xA;It is easy to check that definition 1 holds, by noting that $S_1^0 = 1+R$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-05-16T19:09:43.973" LastActivityDate="2016-05-16T19:09:43.973" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26054" PostTypeId="1" AcceptedAnswerId="26055" CreationDate="2016-05-16T16:11:28.237" Score="1" ViewCount="169" Body="&lt;p&gt;The CBOE publishes a SKEW index, which is &lt;code&gt;SKEW = 100 - 10*S&lt;/code&gt;, so from the index itself we can get &lt;code&gt;S = (SKEW - 100)/10&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just want to do some preliminary analysis of distributions using &lt;code&gt;SKEW&lt;/code&gt; and &lt;code&gt;VIX&lt;/code&gt; together.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have this python code from another SO question: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;from scipy import linspace&#xA;from scipy import pi,sqrt,exp&#xA;from scipy.special import erf&#xA;&#xA;&#xA;def pdf(x):&#xA;    return 1/sqrt(2*pi) * exp(-x**2/2)&#xA;&#xA;def cdf(x):&#xA;    return (1 + erf(x/sqrt(2))) / 2&#xA;&#xA;# e = location&#xA;# w = scale&#xA;&#xA;def skew(x,e=0,w=1,a=0):&#xA;    t = (x-e) / w&#xA;    return 2 / w * pdf(t) * cdf(a*t)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Can I get a Distribution using this skew parameter? The wiki page mentions the skew variable has to be in the range (-1,1). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I just needed to read the scipy.stats package more closesly -- it's well documented what shape, location, and scale are required for each distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit 2: If SKEW is the 3rd statistical moment, VIX is the variance, what probability distribution can be completely specified by these two parameters? The lognormal is completely specified by variance and location. What are the alternatives? Can I parameterize the lognormal with these two distributions?&lt;/p&gt;&#xA;" OwnerUserId="20194" LastEditorUserId="20194" LastEditDate="2016-05-18T20:14:07.523" LastActivityDate="2016-05-18T20:14:07.523" Title="SKEW Index as parameter in lognormal distribution" Tags="&lt;lognormal&gt;&lt;skew&gt;&lt;skewness&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26055" PostTypeId="2" ParentId="26054" CreationDate="2016-05-16T18:23:05.277" Score="1" Body="&lt;p&gt;The formula in your skew function is one of &lt;a href=&quot;https://en.wikipedia.org/wiki/Skew_normal_distribution&quot; rel=&quot;nofollow&quot;&gt;skew normal distribution&lt;/a&gt;. That distribution has a limit on skew parameter, while in the real world there is no such limit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From personal experience, few years ago I tried doing exactly what you described in your question. After comparing skew normal distribution on SPX with the real world, I concluded that there is not enough kurtosis in skew normal distribution to match wings properly.&lt;/p&gt;&#xA;" OwnerUserId="185" LastEditorUserId="185" LastEditDate="2016-05-16T23:26:10.873" LastActivityDate="2016-05-16T23:26:10.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26057" PostTypeId="2" ParentId="26048" CreationDate="2016-05-16T19:48:53.250" Score="2" Body="&lt;p&gt;Speaking about portfolio optimization in general, historical data is required to estimate the variance-covariance matrix that gives you the volatilities of the stock returns and the covariances thereof. The estimation depends on the periodicity of your returns, i.e. whether you are using intraday, daily, weekly, or monthly returns. (For intraday/daily returns you would also need a noise adjustment.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Theoretically, you can use any length of time series to estimate the matrix. The more data you use to estimate the matrix the more robust it will be. But the correlation relationship between the returns may change over time so it can be feasible to not use all available data. The required time series length also depends on the mentioned periodicity of your returns. For daily returns one year (250 trading days) may be enough, for monthly returns one year may be too few.&lt;/p&gt;&#xA;" OwnerUserId="18221" LastActivityDate="2016-05-16T19:48:53.250" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26059" PostTypeId="1" CreationDate="2016-05-16T21:01:36.203" Score="3" ViewCount="256" Body="&lt;p&gt;I have this problem in asset pricing that I don't know how to solve. Here it is:&#xA;Consider an economy with a complete set of Securities and $N$ states of the world Tomorrow. Assume that there are two alternative set of assets: &lt;strong&gt;either&lt;/strong&gt;&#xA;a) there is a complete set of Arrow-Debreu Securities with price $q_{\theta}$ for the one with nonzero payoff in state $\theta$ &lt;strong&gt;or&lt;/strong&gt;&#xA;b) there is a complete set of complex Securities (and no A-D security) denoted by $j=1,...,N$ with price $q_j$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the equilibrium of the economy with the two different asset structures (and assume it is unique). $(...,\hat{q}_{\theta},...)$ is the equilibrium of the economy with a complete set of A-D Securities; $(...,\bar{q}_{j},...)$ is the equilibrium in the economy with a set of complete Securities, $j=1,...,N$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Show that, for each asset $j$, $$\bar{q}_{j}=\frac{1}{1+r_f}\sum_{\theta}\hat{q}_{\theta} R_{j \theta}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My approach:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since markets are complete, $R$ denotes the $N\times N$ full-ranked matrix of payoffs for the securities, with typical column&#xA;$$&#xA;R_j = [R_{j1},..., R_{jN}]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\bar{q_j} = [q_{j1},...,q_{jN}]$ be the vector of asset prices. Then, it is possible to determine a vector $\psi$ such that:&#xA;$$&#xA;\bar{q_j} =  \psi_{\theta} R_{\theta}&#xA;$$&#xA;Where $\psi_{\theta}$ is the price of the portfolio of complex securities delivering a unit of A-D security.&#xA;Therefore, $\bar{q}_j$ can be explicited as a summation, and discounting at period one with the risk free rate, yields&#xA;$$&#xA;\bar{q}_{j}=\frac{1}{1+r_f}\sum_{\theta}\hat{q}_{\theta} R_{j \theta}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I don't know if my solution is correct, because to me it seems too much naive... I hope that someone can help!&lt;/p&gt;&#xA;" OwnerUserId="16045" LastEditorUserId="16045" LastEditDate="2016-05-17T08:51:31.647" LastActivityDate="2016-05-17T08:51:31.647" Title="Arrow-Debreu Equilibrium Pricing" Tags="&lt;mathematics&gt;&lt;asset-pricing&gt;&lt;finance-mathematics&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26060" PostTypeId="2" ParentId="26043" CreationDate="2016-05-16T21:11:24.877" Score="4" Body="&lt;p&gt;We assume that &#xA;\begin{align*}&#xA;\frac{dX_t}{X_t} &amp;amp;= (r+\pi Y_t)dt + \pi\sigma dW_t,\tag{1}\\&#xA;dY_t &amp;amp;= -\lambda Y_t + dB_t.\tag{2}&#xA;\end{align*}&#xA;From $(2)$, &#xA;\begin{align*}&#xA;Y_t = Y_0 e^{-\lambda t}+ e^{-\lambda t}\int_0^t e^{\lambda u} dB_u.&#xA;\end{align*}&#xA;Moreover, from $(1)$,&#xA;\begin{align*}&#xA;\ln X_T &amp;amp;= \ln X_0 + (r-\frac{1}{2}\pi^2\sigma^2)T + \pi \int_0^TY_t dt + \pi\sigma W_T\\&#xA;&amp;amp;=\ln X_0 + (r-\frac{1}{2}\pi^2\sigma^2)T +\pi Y_0 \int_0^Te^{-\lambda t} dt \\&#xA;&amp;amp;\qquad\quad \ \ \, +\pi\int_0^Te^{-\lambda t}\int_0^t e^{\lambda u} dB_u dt + \pi\sigma W_T.&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;E(\ln X_T) &amp;amp;= \ln X_0 + (r-\frac{1}{2}\pi^2\sigma^2)T +\pi Y_0 \int_0^Te^{-\lambda t} dt \\&#xA;&amp;amp;=\ln X_0 + (r-\frac{1}{2}\pi^2\sigma^2)T + \frac{\pi Y_0}{\lambda}(1-e^{-\lambda T})\\&#xA;&amp;amp;=\ln X_0 - rT -\frac{1}{2}\sigma^2T \left(\pi - \frac{Y_0}{\lambda\sigma^2T}(1-e^{-\lambda T})\right)^2 +\frac{Y_0^2}{\lambda^2\sigma^2T}(1-e^{-\lambda T})^2.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;\max_{\pi}E(\ln X_T) &amp;amp;= \ln X_0 - rT + \frac{Y_0^2}{\lambda^2\sigma^2T}(1-e^{-\lambda T})^2,&#xA;\end{align*}&#xA;which is achieved at &#xA;\begin{align*}&#xA;\pi = \frac{Y_0}{\lambda\sigma^2T}(1-e^{-\lambda T}).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-05-16T21:11:24.877" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26061" PostTypeId="1" CreationDate="2016-05-16T21:18:30.643" Score="2" ViewCount="400" Body="&lt;p&gt;why Implied Vol (VIX) increase with decrease in Stock Price or vice versa? whereas Vega is positively related with change in option price to change in stock price.&lt;/p&gt;&#xA;" OwnerUserId="20765" LastActivityDate="2016-07-18T12:34:30.077" Title="why Implied Vol (VIX) increase with decrease in Stock Price or vice versa?" Tags="&lt;option-pricing&gt;&lt;implied-volatility&gt;&lt;greeks&gt;&lt;vix&gt;&lt;vega&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26062" PostTypeId="2" ParentId="26061" CreationDate="2016-05-16T21:48:17.283" Score="0" Body="&lt;p&gt;Please read &quot;Volatility's Impact On Market Returns&quot; at &lt;a href=&quot;http://www.investopedia.com/articles/financial-theory/08/volatility.asp&quot; rel=&quot;nofollow&quot;&gt;http://www.investopedia.com/articles/financial-theory/08/volatility.asp&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is important to remember that VIX is a volatility index comprised of options and not stocks.  It predicts volatility of future prices.  It is not a measure of the present stock market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a more thorough understanding see the white paper entitle &quot;The CBOE Volatility Index - VIX&quot; at &lt;a href=&quot;https://www.cboe.com/micro/vix/vixwhite.pdf&quot; rel=&quot;nofollow&quot;&gt;https://www.cboe.com/micro/vix/vixwhite.pdf&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="19786" LastActivityDate="2016-05-16T21:48:17.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26063" PostTypeId="1" AcceptedAnswerId="26065" CreationDate="2016-05-16T23:11:48.330" Score="3" ViewCount="1479" Body="&lt;p&gt;On 5/16/16 AXP stock closed with a price of 64.07.&#xA;Yahoo Finance reports an implied volatility of 20.58% for this out of&#xA;the money call option:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    --------------------------------------------------------------------------------&#xA;   Strike Contract           Last  Bid  Ask  Change %Change Volume Open   Implied&#xA;          Name                                                     Intrst Voltlty&#xA;    --------------------------------------------------------------------------------&#xA;    65.00  AXP161021C00065000 2.85  2.96 3.05 -0.15 -5.00%    9     1773   20.58%&#xA;&#xA;    --------------------------------------------------------------------------------&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Tried to see if I could get an implied volatility close to what Yahoo Finance got using this RQuantLib call:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;AmericanOptionImpliedVolatility(type=&quot;call&quot;, value=3.05, underlying=64.07,&#xA;    strike=65, dividendYield=0.02189756, riskFreeRate=0.3070664,&#xA;    maturity=0.4308695, volatility=0.1817867)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Instead of getting an implied volatility, I got this error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error in americanOptionImpliedVolatilityEngine(type, value, underlying,  :&#xA;    root not bracketed: f[1e-07,4] -&amp;gt; [3.468527e+00,4.929779e+01]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Pricing this option using RQuantLib with Yahoo suggested volatility of 0.2058 produces a higher option price of 7.48:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;AmericanOption(type=&quot;call&quot;, underlying=64.07, strike=65,&#xA;    dividendYield=0.02189756, riskFreeRate=0.3070664,&#xA;    maturity=0.4308695, volatility=0.2058, engine=&quot;CrankNicolson&quot;)&#xA;value  delta  gamma   vega  theta    rho divRho&#xA;7.4888 0.8003 0.0313     NA     NA     NA     NA&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;RQuantLib's call to compute implied volatility fails because&#xA;the option price of 3.05 if far less than 7.48. I don't have a choice on what option price I enter to compute implied volatility. I have to use&#xA;the market price. The market price reported by Yahoo could be wrong. &#xA;Checking with Google Finance and CBOE option quote for this option shows that the Ask price of 3.05 is correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With a market price of 3.05, how does Yahoo Finance manage to compute&#xA;implied volatility of 20.58%? Is it possibly using a different model than what is used by QuantLib? Or, is there something wrong in my input to&#xA;RQuantLib?&lt;/p&gt;&#xA;" OwnerUserId="20767" LastActivityDate="2016-05-17T00:40:21.527" Title="Yahoo Finance Implied Volatility Calculation" Tags="&lt;american-options&gt;&lt;rquantlib&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26064" PostTypeId="1" CreationDate="2016-05-16T23:14:38.480" Score="1" ViewCount="49" Body="&lt;p&gt;I am working on a dynamic programming problem with dimension over 1000. In this past, there exist methods like Smolyak algorithm and Adaptive sparse grid method to solve dynamic programming problem with dimension no more than 100. My question is does there exist an algorithm that that can deal with this. It is possible to reduce the dimension of my problem a little bit, but I am afraid it will lose some intuition. &lt;/p&gt;&#xA;" OwnerUserId="20766" LastActivityDate="2016-05-16T23:14:38.480" Title="Dynamic programming problem with dimension over 1000." Tags="&lt;dynamic&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26065" PostTypeId="2" ParentId="26063" CreationDate="2016-05-17T00:40:21.527" Score="7" Body="&lt;p&gt;Probably because your risk-free rate is 0.3070664 (30%)  Try 0.3% &lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2016-05-17T00:40:21.527" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26066" PostTypeId="2" ParentId="26016" CreationDate="2016-05-17T00:57:45.163" Score="3" Body="&lt;p&gt;Bram made a good point about looking at longer-term returns, but that weakens the quality of estimates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are two sources that address the issue directly - a formal approach &lt;a href=&quot;http://arxiv.org/pdf/0805.2310v3.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; &#xA;and one specifically in financial context &lt;a href=&quot;http://www.cmap.polytechnique.fr/financialrisks/conference2011/talks/lorenzo_bergomi.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2016-05-17T00:57:45.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26067" PostTypeId="2" ParentId="17669" CreationDate="2016-05-17T02:22:33.277" Score="1" Body="&lt;p&gt;For options on futures, the American call is worth more than the European when rates &gt;0.   Imagine an option that is deep in the money.  When you exercise, you get delivered a futures position, which is subject to immediate variation margin (ie you collect the intrinsic immediately).  The comparable deep in the money European option is worth the &lt;strong&gt;PV&lt;/strong&gt; of the intrisic. &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-05-17T02:22:33.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26068" PostTypeId="1" AcceptedAnswerId="26070" CreationDate="2016-05-17T05:49:04.190" Score="2" ViewCount="371" Body="&lt;p&gt;Is it possible to calculate Minimum Total Risk mathematically for below problem.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Stock A has 25 percent risk, stock B has 50 percent risk, and their returns are 50  &#xA;percent correlated. What fully invested portfolio of A and B has minimum total  &#xA;risk?&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="20303" LastActivityDate="2016-05-17T07:27:20.380" Title="How to Calculate Minimun total Risk?" Tags="&lt;risk&gt;&lt;portfolio-management&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26069" PostTypeId="2" ParentId="26068" CreationDate="2016-05-17T07:25:13.383" Score="0" Body="&lt;p&gt;You are looking for the minimum variance portfolio of two assets, assuming &quot;risk&quot; translates into volatility (variance) here. So what you would do mathematically speaking is introducing a variable $w\in[0,1]$ which is the weight of stock A (say) in the portfolio, calculate the &quot;risk&quot; - which is the variance - of the portfolio $wA+(1-w)B$ and then solve for the $w_0$ for which then minimum variance is achieved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the answer to your formal question is - yes.&lt;/p&gt;&#xA;" OwnerUserId="17281" LastActivityDate="2016-05-17T07:25:13.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26070" PostTypeId="2" ParentId="26068" CreationDate="2016-05-17T07:27:20.380" Score="2" Body="&lt;p&gt;I assume that risk it measured here in volatility.&#xA;Then a portfolio with 100*$w$ percent invested in A and 100*$(1-w)$ percent invested in B has the annual variance &#xA;$$&#xA;v = w^2 0.25^2 + 2* 0.5 w(1-w) 0.25*0.5 + (1-w)^20.5^2.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Searching for the portfolio with the samllest variance is equivalent to searching for the smallest volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get the minimum we take the derivative of $v$ w.r.t. $w$&#xA;$$&#xA;dv/dw = 2 w 0.25^2 + (1-2w) 0.25*0.5 + (2w-2)0.5^2.&#xA;$$&#xA;Searching the root of this we get that $w^* = 1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus we should invest all our wealth in stock A and the minimal risk is 25%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the volatolity of B were smaller it could reduce risk to invest in B. However as the volatility of B is that high  and the correlation is rather large diversification does not work here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example the 50/50 portfolio has a volatility of approx 74%. The 80/20 has 59% and 90/10 has 56.7%.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-05-17T07:27:20.380" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26071" PostTypeId="2" ParentId="26041" CreationDate="2016-05-17T11:13:41.333" Score="0" Body="&lt;p&gt;What you appear to be doing is actually an &lt;a href=&quot;https://en.wikipedia.org/wiki/Autoregressive_model&quot; rel=&quot;nofollow&quot;&gt;auto-regressive (AR) model&lt;/a&gt;, so perhaps you can benefit from using existing models like &lt;a href=&quot;https://en.wikipedia.org/wiki/ARIMA&quot; rel=&quot;nofollow&quot;&gt;ARIMA&lt;/a&gt; R already has &lt;a href=&quot;https://stat.ethz.ch/R-manual/R-devel/library/stats/html/arima.html&quot; rel=&quot;nofollow&quot;&gt;great&lt;/a&gt; &lt;a href=&quot;http://www.inside-r.org/packages/cran/forecast/docs/auto.arima&quot; rel=&quot;nofollow&quot;&gt;implementations&lt;/a&gt; for.&lt;/p&gt;&#xA;" OwnerUserId="7547" LastActivityDate="2016-05-17T11:13:41.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26072" PostTypeId="1" AcceptedAnswerId="26073" CreationDate="2016-05-17T14:00:06.200" Score="0" ViewCount="139" Body="&lt;p&gt;Say I have an FX arbitrage opportunity by doing a transaction like: &#xA;EUR -&gt; USD -&gt; YEN -&gt; EUR&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems to me like the (exact) same profit can be realized by starting the transaction in USD and doing:&#xA;USD -&gt; YEN -&gt; EUR -&gt; USD&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Did I miss something?&lt;/p&gt;&#xA;" OwnerUserId="20772" LastActivityDate="2016-05-17T14:29:11.810" Title="Does the starting currency matter in triangle arbitrage?" Tags="&lt;fx&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26073" PostTypeId="2" ParentId="26072" CreationDate="2016-05-17T14:29:11.810" Score="3" Body="&lt;p&gt;Let XXXYYY be the forex for currency pair XXX/YYY&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume that when you say you have an arbitrage, you say that :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \text{EURUSD} \times \text{USDYEN}\times\text{YENEUR}\neq 1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you see, starting from another currency is just changing the order of the product, so you did not miss something.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-05-17T14:29:11.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26074" PostTypeId="2" ParentId="25897" CreationDate="2016-05-17T14:39:47.977" Score="4" Body="&lt;p&gt;It is true that FF always use December for their fundamental metrics as this is the end of the fiscal year for most companies. However, the annual reports of the companies are not directly available and so are fundamental data. Thus, the main reason for using June it to avoid look ahead bias. &lt;/p&gt;&#xA;" OwnerUserId="18070" LastActivityDate="2016-05-17T14:39:47.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26075" PostTypeId="2" ParentId="25905" CreationDate="2016-05-17T14:46:25.730" Score="0" Body="&lt;p&gt;A good argument for not using Carhart's momentum factor is that it's more based on behavioural finance arguments whereas the size and value factor are more rooted in the efficient market hypothesies. I.e, value and smaller companies are fundamentlly riskier than growth and big companies. &lt;/p&gt;&#xA;" OwnerUserId="18070" LastActivityDate="2016-05-17T14:46:25.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26076" PostTypeId="1" AcceptedAnswerId="26083" CreationDate="2016-05-17T14:50:31.633" Score="3" ViewCount="1663" Body="&lt;p&gt;In the MATLAB default settings for GARCH estimation they say &quot;presample conditional variance is the sample average of the squared disturbances of the offset-adjusted response data y&quot;. Am I right in interpreting this as the sample variance? (sorry my English is not so sophisticated for me to get that sentence)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(second not totally unrelated question)&#xA;Let's say that I'm using 2000 daily log returns to estimate a GARCH(1,1), and obtain $\omega=0.0000026$, $\alpha_1=0.1381$ and $\beta_1=0.8587$. Therefore the unconditional variance is $\frac{w}{1-\alpha_1 - \beta_1}=0.0008$. Should this estimate theoretically be the same as the sample variance $\frac{1}{n}\sum_{i=1}^{2000}(r_t-\mu_t)^2$, or are unconditional variance and sample variance not the same thing? &lt;/p&gt;&#xA;" OwnerUserId="20573" LastActivityDate="2021-02-13T19:54:19.233" Title="Does the unconditional variance implied by a GARCH equal the sample variance?" Tags="&lt;volatility&gt;&lt;time-series&gt;&lt;garch&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26077" PostTypeId="2" ParentId="26024" CreationDate="2016-05-17T14:52:07.857" Score="0" Body="&lt;p&gt;It's most common to use end of the period figures. However, it should not matter as long as you're consequent. Further, the end of period metric will be very similar to the measure at the beginning of the next period. &lt;/p&gt;&#xA;" OwnerUserId="18070" LastActivityDate="2016-05-17T14:52:07.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26078" PostTypeId="1" CreationDate="2016-05-17T14:57:34.747" Score="5" ViewCount="20197" Body="&lt;p&gt;The queries for Dow Jones and S&amp;amp;P 500 will result in error:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.google.com/finance/historical?q=.INX&amp;amp;startdate=May+11%2c+2015&amp;amp;enddate=May+17%2c+2016&amp;amp;output=csv&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.google.com/finance/historical?q=.INX&amp;amp;startdate=May+11%2c+2015&amp;amp;enddate=May+17%2c+2016&amp;amp;output=csv&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.google.com/finance/historical?q=DJIA&amp;amp;startdate=May+11%2c+2015&amp;amp;enddate=May+17%2c+2016&amp;amp;output=csv&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.google.com/finance/historical?q=DJIA&amp;amp;startdate=May+11%2c+2015&amp;amp;enddate=May+17%2c+2016&amp;amp;output=csv&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;While a query for Apple will succeed:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.google.com/finance/historical?q=AAPL&amp;amp;startdate=May+11%2c+2015&amp;amp;enddate=May+17%2c+2016&amp;amp;output=csv&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.google.com/finance/historical?q=AAPL&amp;amp;startdate=May+11%2c+2015&amp;amp;enddate=May+17%2c+2016&amp;amp;output=csv&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="20740" LastEditorUserId="467" LastEditDate="2016-12-22T09:20:36.113" LastActivityDate="2021-04-21T09:22:15.963" Title="How can one query the Google Finance API for Dow Jones and S&amp;P 500 values?" Tags="&lt;data&gt;&lt;google&gt;" AnswerCount="6" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26080" PostTypeId="2" ParentId="26078" CreationDate="2016-05-17T16:02:33.487" Score="0" Body="&lt;p&gt;It appears that Google doesn't support downloading data for the Dow Jones Industrial Average and quite possibly the S&amp;amp;P 500 Index too.  See the end of this thread: &lt;a href=&quot;http://www.mrexcel.com/forum/excel-questions/471110-web-query-obtain-historical-stock-data-using-google-finance.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.mrexcel.com/forum/excel-questions/471110-web-query-obtain-historical-stock-data-using-google-finance.html&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;You can use the code provided top right by Google when you search for Dow Jones Today (or any other stock market), so =googlefinance(&amp;quot;INDEXDJX:.DJI&amp;quot;). Not sure where the code comes from but it works fine.&lt;/p&gt;&#xA;" OwnerUserId="19786" LastEditorUserId="-1" LastEditDate="2021-04-21T09:22:15.963" LastActivityDate="2021-04-21T09:22:15.963" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="26081" PostTypeId="2" ParentId="26048" CreationDate="2016-05-17T16:06:58.010" Score="1" Body="&lt;p&gt;I agree with everything dnl said. This time period choice can get very involved. You are explicitly choosing an historical period that you think will be repeated in the future. Unfortunately, history does not repeat exactly. There is an old saying, all models are wrong, but some are useful. There is no right answer for the period. Should you include just a recent past or include periods of sharp market moves?  Additionally, there are those that just over-ride the correlation matrix and returns numbers because they explicitly believe they can forecast better than using a previous period.  You might want to explore the Black-Litterman model to see how some try to improve on the efficient frontier model.  If I were doing this, I might look at the correlations estimated only during a rising interest rate environment. &lt;/p&gt;&#xA;" OwnerUserId="19627" LastActivityDate="2016-05-17T16:06:58.010" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26082" PostTypeId="1" CreationDate="2016-05-17T16:27:16.973" Score="2" ViewCount="182" Body="&lt;p&gt;The following question is more math than quant, but since it arises from a mathematical finance textbook, I've figured the good people in this sub might be able to help me. So here goes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the 3rd edition of his textbook &quot;Introduction to Stochastic Calculus with Applications&quot; (Imperial College Press 2012), Fima Klebaner defines &lt;em&gt;quadratic variation&lt;/em&gt; as follows (p. 8):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If $g$ is a function of real variable, define its quadratic variation over the interval $[0, t]$ as the limit (when it exits)&#xA;  $$&#xA;[g](t) = \lim_{\delta_n \rightarrow 0}\sum_{i = 1}^n\left(g(t^n_i) - g(t^n_{i - 1})\right)^2,&#xA;$$&#xA;  where the limit is taken over partitions: $0 = t^n_0 &amp;lt; t^n_1 &amp;lt; \cdots &amp;lt; t^n_n = t$, with $\delta_n = \max_{1 \leq i \leq n} \left(t^n_i - t^n_{i - 1}\right)$.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Klebaner goes on to remark that this definition is not the same as&#xA;$$&#xA;\sup \sum_{i = 1}^n \left(g(t^n_i) - g(t^n_{i - 1})\right)^2&#xA;$$&#xA;where supremum is taken over all partitions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't understand the highlighted definition. I feel that it is lacking in  precision. If anyone understands it, as well as the distinction between it and the other definition, I would appreciate if you could explain it to me. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="15619" LastActivityDate="2016-05-17T16:27:16.973" Title="Quadratic variation" Tags="&lt;stochastic-calculus&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26083" PostTypeId="2" ParentId="26076" CreationDate="2016-05-17T16:39:59.943" Score="7" Body="&lt;p&gt;In this context, &lt;strong&gt;unconditional variance&lt;/strong&gt; refers to the &lt;strong&gt;stationary variance&lt;/strong&gt; level predicted by your GARCH model. This quantity need not coincide with the &lt;strong&gt;sample variance&lt;/strong&gt; of the data on which the latter model has been calibrated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That being said, in an effort to reduce the complexity of the GARCH parameters' estimation process (nasty non-linear optimisation problem), it is frequent amongst practitioners to impose that the unconditional variance (model-bound) matches sample variance (data-bound) perfectly. This technique, which effectively reduces the GARCH parameter space (i.e. constrains the intercept to become a function of the other GARCH parameters and sample variance) is known as &lt;strong&gt;variance targeting&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although I do not know the particulars of the MATLAB function you are using, I guess &quot;presample variance&quot; simply refers to the first value of &lt;strong&gt;conditional variance&lt;/strong&gt; $h_1$ (hence the adjective &lt;strong&gt;pre&lt;/strong&gt;-sample). The knowledge of $h_1$ indeed allows all future conditional variances $(h_2,\dots,h_N)$ to be inferred since you already know the realised series of $(r_1, \dots, r_N) $ where $N=2000$ and $r_N$ the most recent past log-return in your case. Another possibility would be to consider $h_1$ as yet another parameter of your GARCH model and to determine it through maximum likelihood estimation.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-05-17T18:34:22.870" LastActivityDate="2016-05-17T18:34:22.870" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26084" PostTypeId="1" CreationDate="2016-05-17T21:16:20.977" Score="1" ViewCount="759" Body="&lt;p&gt;Simple Question. Can someone explain please: What is Estimation Risk in Value at Risk Backtesting&lt;/p&gt;&#xA;" OwnerUserId="20113" LastActivityDate="2016-05-18T09:53:35.563" Title="What is Estimation Risk - VAR Backtest" Tags="&lt;risk&gt;&lt;estimation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26085" PostTypeId="1" CreationDate="2016-05-18T00:13:45.710" Score="1" ViewCount="144" Body="&lt;p&gt;I have 3 QNET options (european, 2 puts, 1 call, all same expiry, different strikes) that the broker is pricing clearly off a volatility surface. Bloomberg only carries historical volatility and I assume the broker is pricing this off quotes.&lt;/p&gt;&#xA;" OwnerUserId="2685" LastActivityDate="2016-05-18T01:46:14.393" Title="Is it possible to find / estimate the volatility surface of non-listed index options?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;implied-volatility&gt;&lt;volatility-smile&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26086" PostTypeId="2" ParentId="26085" CreationDate="2016-05-18T01:46:14.393" Score="2" Body="&lt;p&gt;Yes, your broker could have used one or combination of many factors: estimated volatility surface from historical returns of your target index, historical returns of similar indexes, implied volatility of similar indexes, existing inventory,etc. Check out these two approaches to deriving surfaces from returns  &lt;a href=&quot;http://www.cboe.com/rmc/2015/CBOE-Bruno-2015.pdf&quot; rel=&quot;nofollow&quot;&gt; starting slide 14&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2016-05-18T01:46:14.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26087" PostTypeId="1" AcceptedAnswerId="35248" CreationDate="2016-05-18T02:09:31.403" Score="12" ViewCount="7156" Body="&lt;p&gt;I am doing a regression analysis of all companies listed on s&amp;amp;p 500. It requires their 10-k reports. Where can I download all of them once?&lt;/p&gt;&#xA;" OwnerUserId="19237" LastEditorUserId="2183" LastEditDate="2017-09-23T05:43:22.530" LastActivityDate="2020-06-29T23:25:54.100" Title="How to download all 10-K reports for all companies listed on S&amp;P 500?" Tags="&lt;data&gt;&lt;sec&gt;" AnswerCount="5" CommentCount="2" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="26089" PostTypeId="1" AcceptedAnswerId="26091" CreationDate="2016-05-18T04:48:21.277" Score="2" ViewCount="162" Body="&lt;p&gt;I am working through this &lt;a href=&quot;http://mx.nthu.edu.tw/~jtyang/Teaching/Risk_management/Papers/Models/Probability%20of%20Loss%20on%20Loan%20Portfolio.pdf&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; on Vasicek's portfolio loss distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On page 3 he mentions that by the law of large numbers,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\lim_{n\to\infty}\sum_{k=0}^{\lfloor nx \rfloor} \binom{n}{k}s^k(1-s)^{n-k}  = 1_{\{x \ge s \}}$$ where $s \in (0,1)$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here $x$ is some real number, $k$ is an integer and $\binom{n}{k}$ is the binomial coefficient. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;but I can't quite work out why this is the case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried some sort of binomial distribution argument but haven't been very successful!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="20781" LastEditorUserId="20781" LastEditDate="2016-05-18T07:00:32.123" LastActivityDate="2016-05-18T07:47:05.043" Title="What is the limiting distribution of loss portfolio?" Tags="&lt;distribution&gt;&lt;vasicek&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26090" PostTypeId="2" ParentId="26087" CreationDate="2016-05-18T04:52:35.490" Score="2" Body="&lt;p&gt;The API's found on this site &lt;a href=&quot;http://developer.edgar-online.com/docs&quot; rel=&quot;nofollow&quot;&gt;http://developer.edgar-online.com/docs&lt;/a&gt; allow you to acces historical SEC filings for most securities. &lt;/p&gt;&#xA;" OwnerUserId="20245" LastActivityDate="2016-05-18T04:52:35.490" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26091" PostTypeId="2" ParentId="26089" CreationDate="2016-05-18T07:47:05.043" Score="1" Body="&lt;p&gt;$$\begin{split}\sum_{k=0}^{[nx]}\binom{n}{k}s^k(1-s)^{n-k}&amp;amp; =\sum_{k=0}^n \mathbb{1}_{k\leq [nx]} \binom{n}{k}s^k(1-s)^{n-k} \\&#xA;&amp;amp; = \sum_{k=0}^n \mathbb{1}_{k\leq nx} \binom{n}{k}s^k(1-s)^{n-k} \\ &#xA;&amp;amp; = \mathbb{P}(\mathcal{B}(n,s)\leq nx)\\&#xA;&amp;amp; = \mathbb{P}\left(\frac{\mathcal{B}(n,x)}{n}\leq x\right)\end{split}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\mathcal{B}(n,s)$ is a binomial of parameters $(n,s)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;using the law of large number you get $\frac{\mathcal{B}(n,s)}{n}\to_{n\to\infty} s$ and you can conclude.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-05-18T07:47:05.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26092" PostTypeId="2" ParentId="26084" CreationDate="2016-05-18T09:53:35.563" Score="2" Body="&lt;p&gt;Even in calculating VAR, you have certain assumptions / constants / random numbers being used. Hence, even your VAR calculation is not 100% correct. So, you are estimating VAR and you hedge similar portion of risk, however your Estimations aren't 100% correct. This is Estimation Risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Estimation risk is a generic term. It could be applied to models, VAR, and all other calculations. It highlights the actual vs estimated values differences and the risk associated with this difference. &lt;/p&gt;&#xA;" OwnerUserId="6799" LastActivityDate="2016-05-18T09:53:35.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26093" PostTypeId="1" CreationDate="2016-05-18T11:26:27.023" Score="1" ViewCount="55" Body="&lt;p&gt;Would this be possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Subsequently, would the pricing of such an annuity be somewhat similar to pricing a lookback option?&lt;/p&gt;&#xA;" OwnerUserId="20592" LastActivityDate="2016-05-18T11:26:27.023" Title="Pricing with-profit/smoothed bonus annuity using Black-Scholes" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;annuity&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26095" PostTypeId="1" CreationDate="2016-05-18T14:29:21.293" Score="1" ViewCount="767" Body="&lt;p&gt;I am trying to update daily prices from yahoo via below R code, but code is not working properly and i am not getting any error as such. One can see the reference code at following link. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.thertrader.com/&quot; rel=&quot;nofollow&quot;&gt;http://www.thertrader.com/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quantmod)&#xA;lookback = 60&#xA;startDate = Sys.Date() - lookback&#xA;thePath = &quot;F:\\Portfolio Management\\&quot;&#xA;theFiles = list.files(path=thePath,pattern=&quot;.csv&quot;)&#xA;&#xA;for (ii in theFiles){&#xA;  data = read.csv(paste(thePath,ii,sep=&quot;&quot;))&#xA;  data = xts(data[,c(&quot;open&quot;,&quot;high&quot;,&quot;low&quot;,&quot;close&quot;,&quot;volume&quot;,&quot;adj.&quot;)],&#xA;             order.by = as.Date(data[,&quot;Index&quot;],format=&quot;%Y-%m-%d&quot;))&#xA;  lastHistoricalDate = index(data[nrow(data),])&#xA;&#xA;  recent = getSymbols(Symbols = substr(ii,1,nchar(ii)-4), &#xA;                      src = &quot;yahoo&quot;, &#xA;                      from = startDate, &#xA;                      auto.assign = FALSE)&#xA;  colnames(recent) = c(&quot;open&quot;,&quot;high&quot;,&quot;low&quot;,&quot;close&quot;,&quot;volume&quot;,&quot;adj.&quot;)&#xA;&#xA;  pos = match(as.Date(lastHistoricalDate,format=&quot;%Y-%m-%d&quot;),index(recent))&#xA;&#xA;  if (!is.na(pos)){ &#xA;    if (pos == nrow(recent))&#xA;      print(&quot;File already up-to-date&quot;)&#xA;&#xA;    if (pos &amp;lt; nrow(recent)){&#xA;      dt = NULL&#xA;      dt = rbind(data,recent[(pos+1):nrow(recent),])&#xA;      write.zoo(dt,paste(thePath,ii,sep=&quot;&quot;),sep=&quot;,&quot;,row.names=FALSE) &#xA;    }&#xA;  }&#xA;&#xA;  if (is.na(pos))&#xA;    print(&quot;Error: dates do not match&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;ERROR in line no. 7&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;for (ii in theFiles){&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="20303" LastEditorUserId="20303" LastEditDate="2016-05-18T14:35:18.133" LastActivityDate="2016-05-18T16:39:58.987" Title="Update Daily price from yahoo in R" Tags="&lt;equities&gt;&lt;r&gt;" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="26096" PostTypeId="1" CreationDate="2016-05-18T14:37:53.533" Score="2" ViewCount="507" Body="&lt;p&gt;I've been reading Cochrane's 2006 paper &quot;The Dog that did not bark: A Defense of Return Predictability&quot;, but i am still struggling to understand what the dog was, and why it wasn't barking?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If anyone could shed some brief intuition that would be appreciated. Perhaps my knowledge of existing literature, in order to identify the 'dog' is lacking.&lt;/p&gt;&#xA;" OwnerUserId="20531" LastActivityDate="2020-01-07T12:44:39.053" Title="The Dog That Did Not Bark?" Tags="&lt;price&gt;&lt;dividends&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26097" PostTypeId="1" CreationDate="2016-05-18T14:50:30.217" Score="5" ViewCount="546" Body="&lt;p&gt;Suppose we have classic Ornstein-Uhlenbeck process. How can we calculate expected number (and variance too) of crossing mean value over the certain period of time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say, if we have discrete OU process ($x_{k+1} = \theta(\mu - x_k)\Delta t + \sigma \varepsilon_k\sqrt{\Delta t}$), then parameter $\theta$ affects the speed of mean reversion. Large $\theta$ means higher frictions around $\mu$, therefore - we have more crossings of mean value over any period of time. Small $\theta$ means the reverse, the OU process is slow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions are - is there any explicit formula that links $\theta$ (or any other parameters) and the number of crossings of mean value? If we know all parameters of OU, how can we estimate expected number of crossings of mean value?&lt;/p&gt;&#xA;" OwnerUserId="20785" LastEditorUserId="185" LastEditDate="2016-05-19T00:44:16.527" LastActivityDate="2016-11-15T11:26:42.613" Title="Mean Crossing for Ornstein-Uhlenbeck" Tags="&lt;stochastic-processes&gt;&lt;mean-reversion&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26098" PostTypeId="2" ParentId="26097" CreationDate="2016-05-18T15:11:18.793" Score="2" Body="&lt;p&gt;I presume you talk about local time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope it can help you :&#xA;&lt;a href=&quot;https://www.cambridge.org/core/books/stochastic-analysis/statistics-of-local-time-and-excursions-for-the-ornsteinuhlenbeck-process/C69519611B7FC1430C17209B94F3224D&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.cambridge.org/core/books/stochastic-analysis/statistics-of-local-time-and-excursions-for-the-ornsteinuhlenbeck-process/C69519611B7FC1430C17209B94F3224D&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20201" LastEditorUserId="20201" LastEditDate="2016-11-15T11:26:42.613" LastActivityDate="2016-11-15T11:26:42.613" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26099" PostTypeId="1" CreationDate="2016-05-18T15:21:39.503" Score="2" ViewCount="124" Body="&lt;p&gt;If I have a portfolio with a Sharpe ratio lower than the Sharpe ratio of the tangent portfolio, can I conclude something about whether or not it is efficient? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so, how/why?&lt;/p&gt;&#xA;" OwnerUserId="20786" LastEditorUserId="467" LastEditDate="2016-06-18T13:05:19.923" LastActivityDate="2016-06-18T13:05:19.923" Title="Can I deduce a portfolio is inefficient by compare is Sharpe ratio to the on the one the tangent portfolio?" Tags="&lt;sharpe-ratio&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26100" PostTypeId="1" CreationDate="2016-05-18T15:43:11.297" Score="0" ViewCount="1100" Body="&lt;p&gt;I’m looking for a nice &amp;amp; detailed explanation for how to derive the formula for the weight of asset 1 in the tangency / maximum Sharpe ratio portfolio in Markowitz portfolio theory in a world with two risky assets and one risk-free investment. I tried but failed to derive myself, hence I’m looking for a reference. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The sources which I found only describe the general approach of how to derive the portfolio with the highest Sharpe ratio and only present the final formula (e.g. slide 42 of this presentation: &lt;a href=&quot;http://www.kellogg.northwestern.edu/faculty/papanikolaou/htm/FINC460/LN/Lecture1.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.kellogg.northwestern.edu/faculty/papanikolaou/htm/FINC460/LN/Lecture1.pdf&lt;/a&gt;) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any recommendations?&lt;/p&gt;&#xA;" OwnerUserId="20787" LastEditorUserId="20787" LastEditDate="2016-05-19T12:34:40.777" LastActivityDate="2017-04-15T02:17:52.553" Title="Derivation of the tangency / maximum Sharpe ratio portfolio in Markowitz Portfolio Theory? (2 risky assets)" Tags="&lt;portfolio&gt;&lt;modern-portfolio-theory&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26102" PostTypeId="2" ParentId="26096" CreationDate="2016-05-18T16:48:18.090" Score="6" Body="&lt;p&gt;I'm not sure how deep of a question you are asking.  The dog that did not bark is from a Sherlock Holmes murder mystery.  The dog at the house did not bark at the intruder, so Holmes believed the dog knew the intruder.  Therefore, the lack of evidence like barking, was itself the evidence. In the Cochrane paper, the introduction mentions that the lack of evidence of returns predictability is itself evidence.  In this case, it is evidence of dividend growth being predictable. Clearly the author is just trying to come up with a literary twist to make his paper more interesting so I would not take it very seriously. I can't defend Cochrane's actual use of this evidence because, although I only skimmed it, I did not find the paper very convincing. &lt;/p&gt;&#xA;" OwnerUserId="19627" LastEditorUserId="848" LastEditDate="2020-01-07T09:46:02.607" LastActivityDate="2020-01-07T09:46:02.607" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="26103" PostTypeId="1" CreationDate="2016-05-18T17:22:54.140" Score="1" ViewCount="421" Body="&lt;p&gt;How does a bank which offers a factor certificate with unlimited maturity, e.g. a certificate which promises the holder to change in value in a constant proportion with respect to a change in the underlying, achieve this constant factor? For example a factor 2 long certificate on gold increases by 2% if gold increases by 1%. So far, I figure that this resembles margin trading with a price calculated something like that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;Price_0 = Underlying_0 - Loan.&#xA;$$&#xA;This evolves over time according to:&#xA;$$&#xA;Price_t = Underlying_t - Loan*(1+r)^t&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The initial difference between the price and the value of the underlying define the factor (or leverage) for the &quot;start&quot; but as the underlying moves this factor changes and there is no additional cash flows from or the holder of the certificate until she sells it. Truly the formulae may be oversimplified but I wonder how these products actually achieve such feature?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thx for any help! &lt;/p&gt;&#xA;" OwnerUserId="20736" LastActivityDate="2016-05-18T17:22:54.140" Title="How can factor certificates achieve constant leverage?" Tags="&lt;etf&gt;&lt;leverage&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26105" PostTypeId="1" AcceptedAnswerId="26106" CreationDate="2016-05-18T18:42:25.693" Score="4" ViewCount="493" Body="&lt;p&gt;Having financial market with safe rate r and risky asset S with dynamics under physical measure P $$\frac{dS_t}{S_t}=\mu dt +\sigma dW_t$$ &#xA;what is the log-stock price?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using Ito formula it is straightforward to derive the below equation&#xA;$$log(S_T)=log(S_t) + (\mu - \frac{\sigma^2}{2})(T-t) + \sigma \ (W_T - W_t) \tag{1}$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;what should be equivalent to $$log(S_T)=log(S_t) + (r - \frac{\sigma^2}{2})(T-t) + \sigma \ (W_T^* - W_t^*)  \tag{2}$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q &lt;br&gt;&#xA;what allows to formally transition (1) into (2)? &lt;br&gt;&#xA;I mean the change of dt into T-t and $\mu$ into r &lt;br&gt; &lt;br&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="18670" LastEditorUserId="11678" LastEditDate="2016-05-18T20:31:04.067" LastActivityDate="2016-05-18T20:31:04.067" Title="clarification to log-stock price formula" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26106" PostTypeId="2" ParentId="26105" CreationDate="2016-05-18T19:16:19.733" Score="5" Body="&lt;p&gt;The dynamics &#xA;\begin{align*}&#xA;\frac{dS_t}{S_t} =\mu dt + \sigma dW_t.&#xA;\end{align*}&#xA;is under the real-world measure $\mathbb{P}$. Then,&#xA;\begin{align*}&#xA;d\ln S_t =\Big(\mu-\frac{1}{2}\sigma^2 \Big) dt + \sigma dW_t.&#xA;\end{align*}&#xA;Therefore,&#xA;\begin{align*}&#xA;\ln S_T = \ln S_t + \Big(\mu-\frac{1}{2}\sigma^2 \Big)(T-t) + \sigma \big(W_T-W_t\big).\tag{1}&#xA;\end{align*}&#xA;To obtain the dynamics under the risk-neutral probability measure $\mathbb{Q}$, we employ the Radon-Nikodym derivative&#xA;\begin{align*}&#xA;\frac{d\mathbb{Q}}{d\mathbb{P}}\big|_{\mathcal{F}_t} = \exp\left(-\frac{1}{2}\lambda^2 t + \lambda W_t \right),&#xA;\end{align*} &#xA;where $\lambda = (r-\mu)/\sigma$ is the market-risk premium. Then, from Girsanov theorem, the process $\{\widehat{W}_t, t \ge 0\}$, where&#xA;$$\widehat{W}_t = W_t -\lambda t,$$&#xA;is a standard Brownian motion under  measure $\mathbb{Q}$. Moreover, under  measure $\mathbb{Q}$,&#xA;\begin{align*}&#xA;\frac{dS_t}{S_t} &amp;amp;=\mu dt + \sigma dW_t\\&#xA;&amp;amp;=rdt + \sigma d\widehat{W}_t.&#xA;\end{align*}&#xA;Consequently, similar to $(1)$ above,&#xA;\begin{align*}&#xA;\ln S_T = \ln S_t + \Big(r-\frac{1}{2}\sigma^2 \Big)(T-t) + \sigma \left(\widehat{W}_T-\widehat{W}_t\right).\tag{2}&#xA;\end{align*}&#xA;Note that, in $(1)$ and $(2)$, the Brownian motions $W$ and $\widehat{W}$ are different.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="19887" LastEditDate="2016-05-18T19:41:20.037" LastActivityDate="2016-05-18T19:41:20.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26107" PostTypeId="1" CreationDate="2016-05-18T20:57:14.347" Score="3" ViewCount="444" Body="&lt;p&gt;Having a payoff of log-contract defined as &#xA;$$ \Pi_T = \ln \left(\frac{S_T}{S_0} \right) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How would you express the MC-estimator for the price of this contract?&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The stock price dynamics here is given as $$\frac{dS_t}{St}=r dt + \sigma dW^{\mathbb {Q}}_t \tag{2}$$&lt;/p&gt;&#xA;" OwnerUserId="18670" LastEditorUserId="19887" LastEditDate="2016-05-19T17:15:08.610" LastActivityDate="2016-05-19T17:15:08.610" Title="Pricing a log-contract using Monte Carlo" Tags="&lt;option-pricing&gt;&lt;stochastic-processes&gt;&lt;monte-carlo&gt;&lt;simulations&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26108" PostTypeId="2" ParentId="26087" CreationDate="2016-05-18T22:27:26.723" Score="2" Body="&lt;p&gt;If you are using R then try Quandl package to download the data, there you can find almost every kind of report.&lt;/p&gt;&#xA;" OwnerUserId="20303" LastActivityDate="2016-05-18T22:27:26.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26109" PostTypeId="1" AcceptedAnswerId="26121" CreationDate="2016-05-19T00:19:46.183" Score="1" ViewCount="438" Body="&lt;p&gt;I have a knock-out option with barrier $L&amp;gt;0$ and strike $K$ that pays at maturity $(S-K)_+$. So, positive payoff occurs only in case the price stays below the barrier over life of the option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am analyzing estimation of the price of this option using Monte Carlo simulation and came across with the below definition of the payoff:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Pi_0=e^{-rT} E^Q [S_T * S_{T/2}]= e^{-rT} \frac{ \Sigma \ S_T(\omega_i) S_{T/2}(\omega_i)}{N}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can this be correct? If yes, could you please explain the logic behind the multiplication $S_T S_{T/2}$?&lt;/p&gt;&#xA;" OwnerUserId="18670" LastEditorUserId="467" LastEditDate="2016-05-19T01:18:08.503" LastActivityDate="2016-05-19T14:23:05.213" Title="Is this formula correct to estimate a knock out option price using monte-carlo?" Tags="&lt;option-pricing&gt;&lt;monte-carlo&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26111" PostTypeId="1" AcceptedAnswerId="26159" CreationDate="2016-05-19T00:38:31.077" Score="2" ViewCount="354" Body="&lt;p&gt;I have been reading articles on liability driven investing, a technique used to increase the correlation b/w assets and liabilities of a pension plan. It appears that they use AA rated corporate bond yields to discount the liabilities. At the same time, the articles say that interest rate is the dominant influential factor for liabilities. So are interest rate and corporate bond yields(AA in this case) are the same thing? Or are they highly positively correlated?&lt;/p&gt;&#xA;" OwnerUserId="19237" LastActivityDate="2016-05-21T20:38:40.497" Title="Relationship between interest rate and corporate bond yield?" Tags="&lt;interest-rates&gt;&lt;interest&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26112" PostTypeId="1" CreationDate="2016-05-19T01:04:08.563" Score="1" ViewCount="60" Body="&lt;p&gt;Well, i'm interested in model a GARCH for a serie. The original serie is $y_t$ (price index of a Stock Market), which has a unit root. So i create the returns:&#xA;$x_t = ln(y_t) - ln(y_{t-1})$.&#xA;Now, i'm confused about the fact of using $\lvert x_t\rvert$ for my GARCH. Why can i use absolute value, i'm thinking, that because i want to model volatility i'm just interested in how the series deviates from his mean in a period of time? Thank's a lot for the answers!&lt;/p&gt;&#xA;" OwnerUserId="20794" LastActivityDate="2016-06-18T09:48:20.323" Title="logarithm and absolut value in returns of stocks" Tags="&lt;garch&gt;&lt;log-returns&gt;" AnswerCount="1" CommentCount="5" ClosedDate="2016-06-18T13:01:13.090" ContentLicense="CC BY-SA 3.0" />
  <row Id="26113" PostTypeId="1" AcceptedAnswerId="26114" CreationDate="2016-05-19T02:37:07.730" Score="3" ViewCount="283" Body="&lt;p&gt;I was just wondering if someone could verify whether these are the two boundary conditions for a Call Spread Black-Scholes PDE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first one I have is: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$max(S_{T} - K_{1}, 0) - max(S_{T}-K_{2},0)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While the second boundary condition I have is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_{t} - K_{1}e^{-r(T-t)} + K_{2}e^{-r(T-t)} - S_{t} = (K_{2}-K_{1})e^{-r(T-t)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this correct? Thanks in advance&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Rather than create a new question, I thought I should ask it here: Should a call spread at time $t_{0}$ always take on a symmetric shape? I have the graph of a call spread PDE at time $t_{0}$ for spot values between 0 to 20, with zero interest rate, and with strikes $K_{1} = 9$, $K_{2} = 11$&lt;a href=&quot;https://i.stack.imgur.com/Zi9iq.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Zi9iq.png&quot; alt=&quot;Call Spread&quot;&gt;&lt;/a&gt;. Does the shape of this call spread look okay, or does it have to be perfectly symmetrical? Thanks!&lt;/p&gt;&#xA;" OwnerUserId="20543" LastEditorUserId="20543" LastEditDate="2016-05-21T02:46:50.617" LastActivityDate="2016-05-21T05:36:28.540" Title="Boundary Conditions for Call Spread" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes-pde&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26114" PostTypeId="2" ParentId="26113" CreationDate="2016-05-19T07:21:35.193" Score="5" Body="&lt;p&gt;Time $T$ boundary condition is correct $u(T,x)=(x-K_1)^+-(x-K_2)^+$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Time $x\to 0$ boundary condition is known and is equal to $0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Time $x\to\infty$ boundary condition is also known and is correct $\lim_{x\to\infty}u(t,x)=(K_2-K_1)e^{-r(T-t)}.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to be precise if you want your boundary be &quot;absorbing&quot; or &quot;reflecting&quot;.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastEditorUserId="6686" LastEditDate="2016-05-21T05:36:28.540" LastActivityDate="2016-05-21T05:36:28.540" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26116" PostTypeId="2" ParentId="26099" CreationDate="2016-05-19T08:07:44.073" Score="1" Body="&lt;p&gt;Sure you can. Sharpe Ratio is defined as:&#xA;$$&#xA;SR=\frac{E(R)-R_f}{\sqrt{Var(R)}}&#xA;$$&#xA;When you have a risk-free asset, the efficient frontier becomes linear (i.e. the line that passes from the $R_f$ and the tangent portfolio), named Capital Market Line (CML) and $SR$ denotes its slope. So lower $SR$ means that your portfolio does not lie on the efficient frontier and hence it is not efficient.  &lt;/p&gt;&#xA;" OwnerUserId="20637" LastActivityDate="2016-05-19T08:07:44.073" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26117" PostTypeId="2" ParentId="26107" CreationDate="2016-05-19T09:05:11.243" Score="6" Body="&lt;p&gt;By definition, the payoff of a log-contract of maturity &lt;span class=&quot;math-container&quot;&gt;$T$&lt;/span&gt; writes&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \phi(S_T) = \ln\left(\frac{S_T}{S_0}\right) $$&lt;/span&gt;&#xA;Let &lt;span class=&quot;math-container&quot;&gt;$\Pi_t$&lt;/span&gt; denote the &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt;-value of such a contingent claim. We are interested in the price at &lt;span class=&quot;math-container&quot;&gt;$t=0$&lt;/span&gt;, best known as the &lt;em&gt;option premium&lt;/em&gt;. Theory tells us that the latter premium can be computed as&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \Pi_0 = e^{-rT} E^{\mathbb{Q}} \left[ \phi(S_T) \right] $$&lt;/span&gt;&#xA;that is, a (discounted and risk-neutral) expectation of the future payout, the payout here being a simple function of the random variable &lt;span class=&quot;math-container&quot;&gt;$S_T$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Assuming we managed to draw &lt;span class=&quot;math-container&quot;&gt;$M$&lt;/span&gt; i.i.d.(independent and identically distributed) samples of the random variable &lt;span class=&quot;math-container&quot;&gt;$S_T$&lt;/span&gt; - which we shall denote by&lt;span class=&quot;math-container&quot;&gt;$(S_T^{(m)})_{m=1,...,M}$&lt;/span&gt; in what follows -, we could easily infer &lt;span class=&quot;math-container&quot;&gt;$M$&lt;/span&gt; i.i.d. samples of the random payout &lt;span class=&quot;math-container&quot;&gt;$\phi(S_T)=\ln(S_T/S_0)$&lt;/span&gt;, then take their average and multiply by the discount factor to get the option price. This is precisely the idea behind Monte Carlo. Now how to simulate i.i.d. samples of &lt;span class=&quot;math-container&quot;&gt;$S_T$&lt;/span&gt;?&lt;/p&gt;&#xA;&lt;p&gt;From the Black-Scholes SDE expressed under the risk-neutral measure &lt;span class=&quot;math-container&quot;&gt;$\mathbb{Q}$&lt;/span&gt;, applying Itô's lemma gets you:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ S_T = S_0 \exp\left( (r-\frac{1}{2}\sigma^2)T + \sigma \sqrt{T} Z \right)$$&lt;/span&gt;&#xA;with &lt;span class=&quot;math-container&quot;&gt;$Z \sim \mathcal{N}(0,1)$&lt;/span&gt; and hence &lt;span class=&quot;math-container&quot;&gt;$S_T$&lt;/span&gt; is lognormally distributed.&lt;/p&gt;&#xA;&lt;p&gt;This shows that, in order to obtain i.i.d. samples &lt;span class=&quot;math-container&quot;&gt;$S_T^{(m)}$&lt;/span&gt;, one just needs i.i.d. samples &lt;span class=&quot;math-container&quot;&gt;$Z^{(m)}$&lt;/span&gt; out of a standard normal distribution (there should exist libraries to do that in any decent programming language)&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ S_T^{(m)} = S_0 \exp\left( (r-\frac{1}{2}\sigma^2)T + \sigma \sqrt{T} Z^{(m)} \right),\ \ \forall m=1,...,M $$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;The i.i.d. sample option payouts are then&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \phi\left(S_T^{(m)}\right) =\ln\left(\frac{S_T^{(m)}}{S_0} \right),\ \ \forall m=1,...,M $$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The Monte Carlo estimator of the option price is then given by&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ S_T^{(m)} = S_0 \exp\left( (r-\frac{1}{2}\sigma^2)T + \sigma \sqrt{T} Z^{(m)} \right),\ \ \forall m=1,...,M $$&lt;/span&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \hat{\Pi}_0 = e^{-rT} \left( \frac{1}{M} \sum_{m=1}^M \phi\left(S_T^{(m)}\right) \right) $$&lt;/span&gt;&#xA;with &lt;span class=&quot;math-container&quot;&gt;$(Z^{(m)})_{m=1,...,M}$&lt;/span&gt; representing &lt;span class=&quot;math-container&quot;&gt;$M$&lt;/span&gt; i.i.d. samples out of a standard normal distribution.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$\hat{\Pi}_0$&lt;/span&gt; is an unbiased estimator of the true premium &lt;span class=&quot;math-container&quot;&gt;$\Pi_0$&lt;/span&gt; whose variance decreases proportionally to &lt;span class=&quot;math-container&quot;&gt;$M^{-1/2}$&lt;/span&gt; (which is a direct consequence of the CLT).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;[Remark 1]&lt;/strong&gt; This result holds for any instrument whose payoff is a function of the terminal value of the asset only, i.e. &lt;span class=&quot;math-container&quot;&gt;$\phi(.)$&lt;/span&gt; of the form &lt;span class=&quot;math-container&quot;&gt;$\phi(S_T)$&lt;/span&gt;. This is known as a European option. The situation of a log-contract with &lt;span class=&quot;math-container&quot;&gt;$\phi(S_T)=\ln(S_T/S_0)$&lt;/span&gt; is just a particular case.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;[Remark 2]&lt;/strong&gt; A log-contract can be priced in semi-closed form (see work of Carr-Madan in that area)&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \Pi_0 =  e^{-rT}\left( rT - \int_0^{F(0,T)} \frac{\tilde{P}(K,T)}{K^2} dK + \int_{F(0,T)}^{\infty} \frac{\tilde{C}(K,T)}{K^2} dK \right) $$&lt;/span&gt;&#xA;where &lt;span class=&quot;math-container&quot;&gt;$\tilde{P}(K,T)$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$\tilde{C}(K,T)$&lt;/span&gt; figure &lt;em&gt;undiscounted&lt;/em&gt; European put/call option prices. This gives you a good reference to compare your MC simulations to (or assess its convergence).&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-05-19T09:37:33.040" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26118" PostTypeId="2" ParentId="26112" CreationDate="2016-05-19T09:06:50.247" Score="0" Body="&lt;p&gt;You can plot $\vert x_t \vert$ or $x^2$ just to see whether your data presents volatility clusters (periods in which volatility is high and other periods in which it is low). When you fit a GARCH model, you fit it simply on the $x_t$ series, not on the $\vert x_t \vert$ or $x^2$ series (as previously said in the comments): the likelihood algorithm will do the work.&lt;/p&gt;&#xA;" OwnerUserId="18694" LastActivityDate="2016-05-19T09:06:50.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26120" PostTypeId="1" AcceptedAnswerId="26122" CreationDate="2016-05-19T13:03:38.030" Score="2" ViewCount="149" Body="&lt;p&gt;I have a doubt :&#xA;I know that if $x_{t}=\int_{0}^{t}\gamma(s)dW_{s}$ (with $W_{s}$ a brownian motion), we have : &#xA;$dx_{t}=\gamma(t)dW_{t}$&#xA;What about if $x_{t}=\int_{0}^{t}\gamma(s,t)dW_{s}$. Do I have to apply a kind of Lieibniz rule to get $dx_{t}$ ? If so what is  the result  ?&#xA;Tx !&lt;/p&gt;&#xA;" OwnerUserId="15738" LastActivityDate="2016-05-19T13:32:18.770" Title="Problem with derivating integral" Tags="&lt;stochastic-calculus&gt;&lt;stochastic&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26121" PostTypeId="2" ParentId="26109" CreationDate="2016-05-19T13:09:25.660" Score="1" Body="&lt;p&gt;Your valuation is NOT for the knock-out option that you have specified. Let &#xA;\begin{align*}&#xA;\tau = \inf\{t \mid 0 \le t \le T, S_t \ge L\}.&#xA;\end{align*}&#xA;Here, we set the infimum of an empty set to $\infty$. Then, the payoff of the knock-out option is of the form&#xA;\begin{align*}&#xA;(S_T-K)^+ 1_{\tau = \infty}.&#xA;\end{align*}&#xA;Under the Black-Scholes setting, this option can be valued analytically. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Monte Carlo simulation is not always good for such type of payoff. For example, you may need to have a particularly fine time slices, and set the payoff to $0$ on each path once the simulated asset value is at or above the barrier level $L$; otherwise, simulate until the maturity $T$, and set the payoff to $(S_T(\omega)-K)^+$, where we use $\omega$ to denote a path.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-05-19T14:23:05.213" LastActivityDate="2016-05-19T14:23:05.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26122" PostTypeId="2" ParentId="26120" CreationDate="2016-05-19T13:17:27.780" Score="3" Body="&lt;p&gt;We assume that $\gamma(s, t)$ is differentiable with respect to $t$. Then,&#xA;\begin{align*}&#xA;dx_t = \left(\int_0^t \frac{\partial\gamma(s, t)}{\partial t} dW_s \right)dt + \gamma(t, t) dW_t.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-05-19T13:32:18.770" LastActivityDate="2016-05-19T13:32:18.770" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26123" PostTypeId="1" CreationDate="2016-05-19T13:26:38.043" Score="5" ViewCount="1170" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Term structure is determined by a two-factor affine model (Vasicek). &#xA;  Using the monthly swap market data, we fit the model to match exactly&#xA;  the one-year and ten-year points along the swap curve each month. Once&#xA;  fitted to these points, we then identify how far off the fitted curve&#xA;  the other swap rates are.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Above a quote what I'm working with and trying to get my head around what are my steps and would appreciate any help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I'm able to do MLE estimation of short (1Y) and long (10Y) points, but I don't understand, how do I calibrate this to fit the initial curve. Without calibration, it is giving me very weird values for other maturities. Main tool I use is R, but really any code or good step-by-step example would help.&lt;/p&gt;&#xA;" OwnerUserId="19954" LastActivityDate="2018-12-24T09:12:25.570" Title="Vasicek yield curve" Tags="&lt;r&gt;&lt;curve-fitting&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26125" PostTypeId="1" AcceptedAnswerId="27952" CreationDate="2016-05-19T14:55:16.993" Score="10" ViewCount="7336" Body="&lt;p&gt;The &lt;a href=&quot;https://www.google.fr/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0ahUKEwjxp-yqsebMAhXDLMAKHQ_gD5kQFggcMAA&amp;amp;url=https%3A%2F%2Fwww.esma.europa.eu%2Fsites%2Fdefault%2Ffiles%2Flibrary%2Fjc_2016_21_final_draft_rts_priips_kid_report.pdf&amp;amp;usg=AFQjCNFsnCefCENpajfz3HhW9xlZV3_i5w&amp;amp;sig2=NeiTa-JZb-B4tr06XmkXQg&amp;amp;bvm=bv.122448493,d.ZGg&quot;&gt;recent regulation&lt;/a&gt; (page 32) on PRIIPs requires to compute a VaR-equivalent volatility defined as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mbox{VEV}=\frac{\sqrt{3.842-2\ln \mbox{VaR}}-1.96}{\sqrt{T}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have an idea how they came up with that formula?&lt;/p&gt;&#xA;" OwnerUserId="20803" LastActivityDate="2017-08-20T14:39:36.713" Title="How is the formula for the VEV (VaR-equivalent volatility) in the PRIIP document derived?" Tags="&lt;volatility&gt;&lt;value-at-risk&gt;&lt;banking-regulations&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="26126" PostTypeId="1" AcceptedAnswerId="26127" CreationDate="2016-05-19T15:47:44.867" Score="2" ViewCount="971" Body="&lt;p&gt;Looking for some clarification to the values of the parameters used in the Carr-Madan payoff decomposition formula. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f(S_T)=f(\kappa) + f'(\kappa) (S_T - \kappa) + \int_0^{\kappa}  f''(K) (K-S_T)^+ \ d K  +   \int_{\kappa}^{\infty}  f''(K) (S_T-K)^+ \ d K$$&#xA;which represents replication by investments in risk free bond, forward and put and call options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&#xA;&lt;strong&gt;what values would be used for: &lt;br&gt;&#xA;1) $S_T$ ? the future price is not known at t=0, so what is used for $S_T$? &lt;br&gt;&#xA;2) $\kappa$? is this the closest forward price to the strike price used for options?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="18670" LastEditorUserId="11678" LastEditDate="2016-05-19T16:15:05.443" LastActivityDate="2016-05-19T16:44:02.733" Title="Carr-Madan european contingent claim payoff decomposition formula - application" Tags="&lt;options&gt;&lt;option-pricing&gt;" AnswerCount="1" CommentCount="12" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26127" PostTypeId="2" ParentId="26126" CreationDate="2016-05-19T16:09:44.273" Score="3" Body="&lt;p&gt;This formula is used for replication of certain payoffs, for example, the log-payoff in &lt;a href=&quot;https://quant.stackexchange.com/questions/18007/variance-replication-using-options/18022#18022&quot;&gt;Variance replication using options&lt;/a&gt;. The value of $\kappa$ can be set to any number, for example, $\kappa=E(S_T)$. This is a decomposition of the payoff, which is not a valuation of the payoff itself, and then further valuation is still needed. For example, based on the above decomposition, the value is given by&#xA;\begin{align*}&#xA;e^{-rT}E\big(f(S_T)\big) &amp;amp;= e^{-rT} E\bigg(f(\kappa) + f'(\kappa) (S_T - \kappa) + \int_0^{\kappa}  f''(K) (K-S_T)^+ \ d K \\&#xA;&amp;amp; \qquad \qquad\qquad \qquad\qquad \qquad \qquad +   \int_{\kappa}^{\infty}  f''(K) (S_T-K)^+ \ d K \bigg)\\&#xA;&amp;amp;=e^{-rT}\bigg[f(\kappa) + f'(\kappa) \big(E(S_T) - \kappa\big) + \int_0^{\kappa}  f''(K) E\big((K-S_T)^+\big) \ d  K \\&#xA;&amp;amp; \qquad \qquad\qquad \qquad\qquad \qquad \qquad +   \int_{\kappa}^{\infty}  f''(K) E\big((S_T-K)^+\big) \ d K\bigg].&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2016-05-19T16:44:02.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26128" PostTypeId="2" ParentId="26123" CreationDate="2016-05-19T16:16:54.887" Score="3" Body="&lt;p&gt;This is a relative value application of equilibrium term structure models. There are really two steps in this exercise:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Step 1 is a calibration procedure that gets you the model &quot;parameters&quot; (i.e., the mean reversion parameters, volatilities/correlation parameters, etc.). This is usually done using historical interest rate dat and either MLE or Kalman filtering techniques (see &quot;Kalman Filtering of Generalized Vasicek Term Structure Models&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once step 1 is done (which BTW is a huge undertaking), you can then apply the model for relative value analysis. Given today's yield curve (as opposed to historical data in step 1), you back out the &quot;factor values&quot; (as opposed to model parameters) so that your model fits a few points on the yield curve. In the example you used, the trader/researcher assume that 2- and 10-year yields are trading fair, and fit the model to match these two points. They then compare the model-implied value for, say, the 5-year point to judge whether or not the 5-year yield is trading rich/cheap.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2016-05-19T16:16:54.887" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26129" PostTypeId="2" ParentId="26100" CreationDate="2016-05-19T16:36:51.740" Score="0" Body="&lt;p&gt;In: MODERN PORTFOLIO THEORY AND INVESTMENT ANALYSIS - ELTON, GRUBER, BROWN, GOETZMANN , chapter 5, you can find a good explanation of your issues. &lt;/p&gt;&#xA;" OwnerUserId="20746" LastActivityDate="2016-05-19T16:36:51.740" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26130" PostTypeId="1" CreationDate="2016-05-19T18:13:52.860" Score="1" ViewCount="36" Body="&lt;p&gt;Let's say I place an order to buy shares. Let's says uncommitted shares are those not actively working with other destinations or brokers, and committed shares are those actively working but yet unfilled with other destinations or &#xA;brokers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can my order be filled and yet uncommitted? If yes, how?&lt;/p&gt;&#xA;" OwnerUserId="20804" LastActivityDate="2016-05-19T18:13:52.860" Title="Can an order be filled but uncommitted?" Tags="&lt;equities&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26131" PostTypeId="1" CreationDate="2016-05-19T18:33:43.080" Score="0" ViewCount="139" Body="&lt;p&gt;The theory of stochastic integration relies on the concept of the Lebesgue-Stieltjes integral. However, it is hard to find a textbook that handles this concept in detail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take, for instance, Chung and Williams' textbook &quot;Introduction to Stochastic Integration&quot;, 2nd edition (Birkhaeuser 2014). &lt;a href=&quot;https://imgur.com/a/bYuWW&quot; rel=&quot;nofollow noreferrer&quot;&gt;Section 1.3, titled &quot;Functions of Bounded Variation and Stieltjes Integrals&quot;, lists facts&lt;/a&gt;, but does not prove them nor gives reference for further reading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where can I turn to (a textbook, online class notes, etc.) to fill in the gaps and read an orderly exposition of the subject matter that accounts for all the results pertinent to stochastic integration, and, in particular, those cited in Chung and Williams' section 1.3?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. The reference need not be in English.&lt;/p&gt;&#xA;" OwnerUserId="15619" LastEditorUserId="15619" LastEditDate="2016-05-19T19:21:00.130" LastActivityDate="2016-05-19T19:30:32.967" Title="Lebesgue-Stieltjes integration and related topics" Tags="&lt;stochastic-calculus&gt;&lt;reference-request&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26132" PostTypeId="2" ParentId="26131" CreationDate="2016-05-19T19:30:32.967" Score="1" Body="&lt;p&gt;Royden's &quot;Real Analysis&quot; is a standard textbook for a first year grad course in Real Analysis. It covers all the integration topics nicely. A more stochastically oriented book would be &quot;Probability with Martingales&quot; by Williams, which covers integration as well.&lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2016-05-19T19:30:32.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26134" PostTypeId="1" CreationDate="2016-05-19T19:56:15.843" Score="2" ViewCount="362" Body="&lt;p&gt;Are there any books/papers/articles to describe how to develop a backtesting software? Something like backtest in quantopian website. How do they calculate the Cumulative performance? &lt;/p&gt;&#xA;" OwnerUserId="1775" LastActivityDate="2020-11-02T20:51:12.210" Title="Backtesting algorithms" Tags="&lt;backtesting&gt;&lt;algorithm&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26135" PostTypeId="1" CreationDate="2016-05-19T21:26:48.930" Score="2" ViewCount="147" Body="&lt;p&gt;Is there any interesting news about CAPM/FF3FM or asset pricing models in general lately? Would have been greatly appreciated!&lt;/p&gt;&#xA;" OwnerUserId="20296" LastEditorUserId="19887" LastEditDate="2016-05-19T21:41:32.103" LastActivityDate="2016-05-20T14:50:30.163" Title="News about CAPM/FF3FM or asset pricing models in general" Tags="&lt;capm&gt;&lt;fama-french&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26136" PostTypeId="1" CreationDate="2016-05-19T22:08:28.073" Score="5" ViewCount="1604" Body="&lt;p&gt;&lt;strong&gt;Setting&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my financial engineering project I'm working on a new calibration formalism for jump-diffusion models and in particular Merton's jump diffusion model. A jump diffusion process $\{X(t), t \geq 0\}$ is a mix of a diffusion process with an additional jump part, that is,&#xA;$$X(t) = \sigma W(t) + \sum_{i=1}^{N(t)} Y_i,$$&#xA;where $\sigma$ is the diffusion volatility, $N(t)$ is a Poisson process with jump-intensity $\lambda$ independent of $W(t)$ and $Y_i \sim N(\mu, \delta^2)$ represent the jump sizes which are i.i.d and independent of $W(t)$ and $N(t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To compare the new calibration method, I use a standard calibration method where the RMSE between model prices (computed by Carr-Madan option pricing formula) and market prices is minimized. Given a quote date with options quoted for, say $15$, different maturities. The result of the calibration is then an &lt;em&gt;optimal&lt;/em&gt; parameter set $\{\mu,\delta, \lambda,\sigma\}$ for each maturity such that the distance between model prices and market prices is minimal. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To compare both calibration methods for a specific quoting date, for instance $29/10/2009$, I do the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) I compute the optimal parameter sets with corresponding RMSE's.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) I match the moments, that is, I compute variance, skewness, kurtosis and hyper skewness under the Merton jump diffusion model for the specific optimal parameter set.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(3) I plot the evolution of the different parameters $\mu,\delta, \lambda$ and $\sigma$ for a specific maturity for quoting dates ranging from $2008$ until $2009$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are some other useful ways to compare two calibration methods? Is it possible to say if a calibration method is better than another? I know this is probably a hard question to answer since the performance depends on a lot of different factors. However, it would be great if I have some different ways to compare them both.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The dataset I'm using: options quoted on the S&amp;amp;P 500 with quoting dates ranging from 1993 until 2009. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="20361" LastEditorUserId="20361" LastEditDate="2016-05-19T22:15:35.563" LastActivityDate="2016-05-19T22:15:35.563" Title="Calibration of Merton's jump diffusion model" Tags="&lt;calibration&gt;&lt;jump&gt;&lt;merton-model&gt;" AnswerCount="0" CommentCount="9" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26137" PostTypeId="1" CreationDate="2016-05-20T01:49:21.300" Score="1" ViewCount="1086" Body="&lt;p&gt;Can anybody explain in simple terms how the critical value of the ADF test can be derived using Monte Carlo simulation?&lt;/p&gt;&#xA;" OwnerUserId="18670" LastActivityDate="2016-05-21T11:16:01.360" Title="how to derive critical values for augmented Dickey–Fuller test (ADF) using Monte Carlo method?" Tags="&lt;time-series&gt;&lt;statistics&gt;&lt;monte-carlo&gt;&lt;simulations&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26138" PostTypeId="1" CreationDate="2016-05-20T02:26:53.117" Score="2" ViewCount="419" Body="&lt;p&gt;If it can be proved that two time series &#xA;$$S_t^1=\alpha + \beta S_t^2 + \xi_t$$&#xA;representing stocks are correlated, with $\beta=-2$ and then are proved to be cointegrated, &lt;br&gt;&#xA;how a portfolio should be built to make a profit?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;br&gt;&#xA;Would be the beta from regression used? or the lambda from AR?&#xA;&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would this portfolio create a profit assuming $V_t=S_t^1 + 2S_t^2$.  wouldn't it be a hedge where those positions offset each other? where the profit should come from?&lt;/p&gt;&#xA;" OwnerUserId="18670" LastEditorUserId="18670" LastEditDate="2016-09-02T14:03:18.177" LastActivityDate="2016-09-02T14:03:18.177" Title="cointegration strategy" Tags="&lt;quant-trading-strategies&gt;&lt;cointegration&gt;&lt;pairs-trading&gt;&lt;mean-reversion&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26139" PostTypeId="1" AcceptedAnswerId="26140" CreationDate="2016-05-20T10:47:49.520" Score="3" ViewCount="376" Body="&lt;p&gt;I got little bit lost in the formulas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume to have two random variables distributed exponentially $X_i \sim Exp(\lambda_i)$ and $X_j \sim Exp(\lambda_j)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, the distribution functions are $F_{X_i}(x_i)= 1-\exp(-\lambda_i x_i)$ and $F_{X_j}(x_j)=1-\exp(-\lambda_j x_j)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the formula for a Gaussian copula, $C(u,v)$, linking these exponential margins?&lt;/p&gt;&#xA;" OwnerUserId="11585" LastActivityDate="2016-05-20T11:35:38.370" Title="Bivariate Gaussian copula with exponential margins" Tags="&lt;copula&gt;&lt;normal-distribution&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26140" PostTypeId="2" ParentId="26139" CreationDate="2016-05-20T11:35:38.370" Score="3" Body="&lt;p&gt;$$C(u,v) = \mathbb{P}\left(X\leq N^{(-1)}(u),\quad \rho X + \sqrt{1-\rho^2}X^\perp \leq N^{(-1)}(v)\right)$$&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-05-20T11:35:38.370" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26141" PostTypeId="1" AcceptedAnswerId="26144" CreationDate="2016-05-20T12:05:57.647" Score="3" ViewCount="986" Body="&lt;p&gt;I have my estimates for an AR(3). To obtain the residuals I'm supposed to use &#xA;$$Y_t-\hat\phi_0-\hat\phi_1Y_{t-1}-\hat\phi_2Y_{t-2}-\hat\phi_3Y_{t-3},$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the Y's are from the dataset. If I do this, won't I get a smaller number of residuals than observations?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ask this, because in a book I'm reading, the authors fit an AR(3) from a dataset, and then present a plot of standardized residuals with the same numbers of observations. How is this possible?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, how does one obtain a standardized residual from a residual?&lt;/p&gt;&#xA;" OwnerUserId="9499" LastActivityDate="2016-05-25T17:42:42.657" Title="How to obtain Standardized Residuals from a Time-Series?" Tags="&lt;time-series&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26143" PostTypeId="1" CreationDate="2016-05-20T14:29:37.643" Score="7" ViewCount="1288" Body="&lt;p&gt;I am a mathematician who wants to learn about quantitative finance, in particular how machine learning can be applied to it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume some machine learning techniques are more applicable than others in this field, so which machine techniques should I look into?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any important academic papers or books it would be worth reading that focus on the latest developments in machine learning applied to finance?&lt;/p&gt;&#xA;" OwnerUserId="6201" LastActivityDate="2019-04-01T21:36:14.893" Title="Machine learning techniques for quantitative finance?" Tags="&lt;finance-mathematics&gt;&lt;machine-learning&gt;" AnswerCount="2" CommentCount="9" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="26144" PostTypeId="2" ParentId="26141" CreationDate="2016-05-20T14:32:09.793" Score="5" Body="&lt;p&gt;Usually for MLE estimation as you said we compute the residuals starting from index &lt;code&gt;number of lag+1&lt;/code&gt; (p+1 for AR model) in this case we obtain &lt;strong&gt;Conditional&lt;/strong&gt; MLE estimates:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\hat{\theta}  = \text{arg max} \sum_{p+1}^{T} \ln f(Y_{t}|\theta)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $f(Y_{t})$ is the marginal density of observation $Y_{t}$ and $\ln$ is employed to maximized the &lt;em&gt;log&lt;/em&gt; likelihood. The first residuals are then fixed as missing values and then we get a smaller number of &lt;em&gt;usable&lt;/em&gt; residuals than observations. (in this case you start the recursion algorithm from index P+1)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it is also possible to estimate your model with &lt;strong&gt;Exact&lt;/strong&gt; MLE estimates:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\hat{\theta}  = \text{arg max} \sum_{p+1}^{T} \ln f(Y_{t}|\theta) + \ln f(Y_{p},...,Y_{1},\theta)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This require to fix some pre-sample values (the $Y_{0},...Y_{-p+1}$ ) in order to be able to run the model. Given that the AR model is stationary you can fix these values to their sample mean or unconditional theoretical mean. In this case first residuals are not missing values and you obtain the same number of &lt;em&gt;usable&lt;/em&gt; residuals than observations. (in this case you start the recursion algorithm from index 1)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding standardized residuals $res_{std}$, it is simply the residuals from the model divided by the conditional standard deviation :  $ res_{std}= res /\sigma_{t}$ , this require to estimate $\sigma_{t}$ via, for instance, a GARCH model. If you don't model the conditional variance part, you use :  $res_{std}= res /\sigma $ where $\sigma$ is the unconditional volatility of residuals obtained during estimation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See this nice &lt;a href=&quot;http://faculty.washington.edu/ezivot/econ584/notes/armaestimation.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;paper&lt;/a&gt; for details.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found my answer no enough documented so this is an update.&#xA;First the MLE method for a simple AR1 model is very well explained in the following page &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See below,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(from :  &lt;em&gt;Hamilton, J. D. (1994). Time Series Analysis (1 edition). Princeton University Press. (page 122)&lt;/em&gt; ):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/kVhv8.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/kVhv8.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/569cN.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/569cN.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/FW7bw.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/FW7bw.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[...]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/cKDud.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/cKDud.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So as we see the Exact Log Likelihood &lt;strong&gt;[equation 5.2.9]&lt;/strong&gt; differs from the Conditional Log likelihood &lt;strong&gt;[equation 5.2.27]&lt;/strong&gt; in the sense that in the exact MLE we maximize the full likelihood (that is why we call it exact) whereas in the conditional version we truncate the likelihood by dropping the marginal :&#xA; $-0.5 \log(2\pi) -0.5\log(\sigma^{2}/(1-\phi^{2}))- \frac{(y_{1}-(c/1-\phi))^2}{2\sigma^{2}/(1-\phi^2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This marginal replaces the &lt;em&gt;expectation&lt;/em&gt; of  $E(Y_{0}) = c+\phi Y_{-1} + \epsilon$ by the unconditonal mean $E(Y_{0}) = \frac{c}{1-\phi}$&lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2016-05-25T17:42:42.657" LastActivityDate="2016-05-25T17:42:42.657" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26145" PostTypeId="2" ParentId="26135" CreationDate="2016-05-20T14:50:30.163" Score="1" Body="&lt;p&gt;Regarding asset pricing models, Google scholar will be a good place to search. Begin your search my putting the title of the seminal paper &quot;The Cross-Section of Expected Stock Returns&quot; by E. F. Fama and K. R. French  published in 1992. Go to the citations link of this paper in the results. Finally, sort by date and it will give you latest articles on the topic. The Same idea can be used with other databases (e.g. ScienceDirect). If you mean latest models by &quot;latest news&quot; then there are many models adding different factors. such as the one adding liqudity premium to the fama-french 3-factor model by Weimin Liu.&lt;a href=&quot;http://down.cenet.org.cn/upfile/36/200811823508181.pdf&quot; rel=&quot;nofollow&quot;&gt;[paper]&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15390" LastActivityDate="2016-05-20T14:50:30.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26148" PostTypeId="2" ParentId="26137" CreationDate="2016-05-21T11:16:01.360" Score="4" Body="&lt;p&gt;The ADF test assumes the DGP &#xA;$$&#xA;\Delta y_t = \alpha +\beta t +\gamma y_t +\delta_1 \Delta y_{t-1}+\cdots +\delta_k \Delta y_{t-k}+\epsilon_t&#xA;$$&#xA;The parameters are estimated using OLS on a sample of length $T$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might impose $\alpha=0$ and/or $\beta=0$, this will give you different null hypotheses to test. But your test is always $\gamma=0$, and the statistic you use to do that is the t-statistic that comes from the regression $t=\hat{\gamma}/\hat{\sigma}_\gamma$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To perform the test you compare this value to the critical value which depends on the sample size $T$, if the DGP assumes $\alpha$ and/or $\beta$ are zero, and the number or lags $k$. Essentially you want to assess what is the probability that you observed the estimated value $\hat{\gamma}$ due to the randomness of the sample (ie generated by the noise $\epsilon_t$) although the true value that generated the data was $\gamma=0$ (ie the sampling distribution under the null). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to produce the sampling distribution using MC you follow the following steps:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Estimate all parameters by OLS using the data you have, and compute the t-statistic $t$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Fix all estimated parameters except $\gamma$ which you set to zero (ie parameters under the null)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Generate Gaussian random numbers $\epsilon_t$, and using the parameters under the null generate random sample paths $y_t$ of the same length as the original data, ie $T$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Using this sample re-estimate $\gamma$ and then the t-statustic using OLS, which is a random number drawn from the sampling distribution under the null, say $t_1$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Repeat steps (3) and (4) above $M$ times, say 10,000 times, and produce a set $t_1,\cdots,t_M$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Percentiles of this distribution give the critical values&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-05-21T11:16:01.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26149" PostTypeId="2" ParentId="26111" CreationDate="2016-05-21T11:45:10.393" Score="1" Body="&lt;p&gt;You earn coupons on a corporate bond portfolio and in this sense corporate bond yield is an interest rate. But it is important (especially in liability driven investment) to recognise that corporate bond yield has two quite different components: credit spread and riskfree interest rate. To quote from Wikipedia &lt;a href=&quot;https://en.wikipedia.org/wiki/Corporate_bond&quot; rel=&quot;nofollow&quot;&gt;Corporate bond&lt;/a&gt;: &quot;High Grade corporate bonds usually trade on credit spread. Credit spread is the difference in yield between the bond and an underlying US Treasury bond (for US Dollar corporates) of similar maturity. Credit spread is the extra yield an investor earns over a risk free instrument (US Treasury) as a compensation for the extra risk.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The lack of interest in your question on this site might be explained by the fact that it can be answered by a straightforward look at Wikipedia.     &lt;/p&gt;&#xA;" OwnerUserId="482" LastEditorUserId="482" LastEditDate="2016-05-21T20:34:16.280" LastActivityDate="2016-05-21T20:34:16.280" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26151" PostTypeId="1" AcceptedAnswerId="26154" CreationDate="2016-05-21T14:26:38.147" Score="0" ViewCount="26" Body="&lt;p&gt;I was working on my finical math homework where I need to find the minimum variance portfolio.  I need to use the following matrix expression.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/2wcql.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/2wcql.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Nowhere in the class notes does the instructor say what the u vector in the above expression is.  At first I thought it was the expected returns of each portfolios (however that would be the m vector).  I reverse engineered the result of an example and it appears the u is just a vector of all ones.  Not sure if this is a finance thing or a matrix algebra thing.  Does u stand for unit vector as in a vector of all ones?  What does it mean?&lt;/p&gt;&#xA;" OwnerUserId="20821" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-05-21T16:08:11.500" Title="What is the u vector in the expression for the weights of the min variance portfolio" Tags="&lt;portfolio-management&gt;&lt;minimum-variance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26152" PostTypeId="1" CreationDate="2016-05-21T14:49:31.647" Score="1" ViewCount="354" Body="&lt;p&gt;I want to extract CIR parameters from monthly LIBOR data in the EULER-MARYAMA method in MATLAB language.&#xA;I found the data but I can't extract parameters from it.&#xA;What is the process? What is the formula?&lt;/p&gt;&#xA;" OwnerUserId="20822" LastEditorDisplayName="user13444" LastEditDate="2016-12-17T09:41:37.270" LastActivityDate="2016-12-17T09:41:37.270" Title="How to extract parameters in the CIR model from data?" Tags="&lt;interest-rates&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26153" PostTypeId="1" AcceptedAnswerId="26155" CreationDate="2016-05-21T15:55:12.287" Score="5" ViewCount="5957" Body="&lt;p&gt;Is it possible to get the right formula for vega of a call option under the black scholes model from this formula? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\partial{C}}{\partial{\sigma}}=\frac{S_0}{\sqrt{2\pi}}{e^\frac{-d_+^2}{2}}(\frac{-1}{\sigma})(d_-)-\frac{Ke^{-rt}}{\sqrt{2\pi}}e^{\frac{-d_-^2}{2}}(\frac{-1}{\sigma})(d_+)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d_-=\frac{\ln{\frac{S_0}{k}}+(r-\frac{\sigma^2}{2})t}{\sigma\sqrt{t}}$&#xA;$d_+=\frac{\ln{\frac{S_0}{k}}+(r+\frac{\sigma^2}{2})t}{\sigma\sqrt{t}}$&lt;/p&gt;&#xA;" OwnerUserId="17063" LastEditorUserId="17063" LastEditDate="2016-05-21T16:05:34.447" LastActivityDate="2016-05-21T16:43:50.660" Title="derive vega for black schole call from this formula?" Tags="&lt;black-scholes&gt;&lt;derivatives&gt;&lt;greeks&gt;&lt;european&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26154" PostTypeId="2" ParentId="26151" CreationDate="2016-05-21T16:08:11.500" Score="2" Body="&lt;p&gt;yes u is the unit vector of all ones&lt;/p&gt;&#xA;" OwnerUserId="17063" LastActivityDate="2016-05-21T16:08:11.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26155" PostTypeId="2" ParentId="26153" CreationDate="2016-05-21T16:43:50.660" Score="6" Body="&lt;p&gt;Note that,&#xA;\begin{align*}&#xA;\frac{\partial{C}}{\partial{\sigma}} &amp;amp;=\frac{S_0}{\sqrt{2\pi}}{e^\frac{-d_+^2}{2}}(\frac{-1}{\sigma})(d_-)-\frac{Ke^{-rt}}{\sqrt{2\pi}}e^{\frac{-d_-^2}{2}}(\frac{-1}{\sigma})(d_+)\\&#xA;&amp;amp;=\frac{1}{\sqrt{2\pi}}e^{\frac{-d_+^2}{2}}\left[-\frac{S_0 d_-}{\sigma} + \frac{Ke^{-rt}d_+}{\sigma} e^{\frac{d_+^2}{2} - \frac{d_-^2}{2}} \right]\\&#xA;&amp;amp;=N'(d_+)\left[-\frac{S_0 d_-}{\sigma} + \frac{Ke^{-rt}d_+}{\sigma} e^{\frac{1}{2}(d_+-d_-)(d_++d_-)} \right]\\&#xA;&amp;amp;=N'(d_+)\left[-\frac{S_0 d_-}{\sigma} + \frac{Ke^{-rt}d_+}{\sigma} e^{\frac{1}{2}\sigma \sqrt{t}\, \frac{2\ln \frac{S_0}{K} +2rt}{\sigma \sqrt{t}}} \right]\\&#xA;&amp;amp;=N'(d_+)\left[-\frac{S_0 d_-}{\sigma} + \frac{S_0d_+}{\sigma} \right]\\&#xA;&amp;amp;=S_0 N'(d_+)\sqrt{t},&#xA;\end{align*}&#xA;which is the Black-Scholes vega formula.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-05-21T16:43:50.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26156" PostTypeId="1" CreationDate="2016-05-21T17:54:07.930" Score="2" ViewCount="111" Body="&lt;p&gt;In part 3.2 of &lt;a href=&quot;http://www.econbiz.de/archiv1/2008/49714_convexity_libor_model.pdf&quot; rel=&quot;nofollow&quot;&gt;Lu and Neftci (2003) &quot;Convexity Adjustments and Forward Libor Model: Case of Constant Maturity Swaps&quot;&lt;/a&gt;, the authors propose a new way of pricing CMS swaps, with Monte Carlo simulations. They show that the par CMS swap rate is a function of forward rates. So we just need a model of forward rate to do the Monte Carlo pricing (such as the Libor Market Model).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, the formula they find for the par CMS swap rate (equation 22 and 23 in their paper) is a function of these forward rates: $F(t_1,t_1,t_2)$, $F(t_2,t_2,t_3)$ and $F(t_3,t_3,t_4)$, with the following notation:&#xA;$F(a,b,c)$ = forward rate viewed from time $a$ between time $b$ and time $c$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These forward rates are then of the form : $F(a,a,c)$. I don't understand why they are said to be forward then. It seems to me that if a forward rate start at the date of observation, it is not a forward rate but a spot rate. Isn't it? Why would they say that then?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks for your help!&lt;/p&gt;&#xA;" OwnerUserId="15650" LastActivityDate="2016-05-21T17:54:07.930" Title="Are forward rates starting at observation date spot rates?" Tags="&lt;interest-rates&gt;&lt;forward-rate&gt;&lt;spot-rate&gt;&lt;cms&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26158" PostTypeId="2" ParentId="10844" CreationDate="2016-05-21T20:16:42.233" Score="2" Body="&lt;p&gt;The first thing you have to understand that volatility is an abstraction, and there are different possible implementations of this abstraction in terms of trading. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When someone writes &quot;short spot index volatility, long on implied volatility&quot; they mean something like take a position in options (implied vol) and delta hedge in the underlying instrument, which creates an offsetting P/L with &quot;spot&quot; (underlying) volatility. &lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2016-05-21T20:16:42.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26159" PostTypeId="2" ParentId="26111" CreationDate="2016-05-21T20:33:05.637" Score="2" Body="&lt;p&gt;Anything that is used for discounting is by definition an &quot;interest rate&quot;. But then the question arises what is the appropriate choice of interest rate to use for discounting pension liabilities. There are many possibilities (many interest rates).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some want to use the expected return on the stock market as the interest rate. That is a very bad choice (although popular), because stock returns are quite risky while a pension is not supposed to be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A reasonable choice is the AA corporate bond rate. After all a pension is a kind of &quot;debt&quot; (a promise to pay) that a corporation owes to its employees, so it make some sense that the discount rate should be similar to the rate that the corporation pays on its corporate bonds. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For state and federal government pensions the issue is more debatable. Since the federal government borrows at the long term risk free rate it may make some sense to use this rate in discounting Social Security and other government sponsored pensions. This rate is lower than the AA rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The whole question of which interest rate should be used is very delicate. Because pensions liabilities are long term, even a small difference in interest rate makes a big difference in the p.v. of the pension liabilities (as you said). Also, it is in the corporations interest to use as big a discount rate as they can to minimize the (reported) presen value, whileit is in the meployees interest to use a smaller interest rate so the company will set aside more money now and make their pension more secure. &lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-05-21T20:38:40.497" LastActivityDate="2016-05-21T20:38:40.497" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26160" PostTypeId="1" CreationDate="2016-05-21T21:59:59.013" Score="1" ViewCount="540" Body="&lt;p&gt;Disclaimer: the question is similar to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/2561/can-momentum-strategies-be-quantitative-in-nature&quot;&gt;Can momentum strategies be quantitative in nature?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and (to an extent)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/2975/what-is-the-expected-return-i-should-use-for-the-momentum-strategy-in-mv-optimiz&quot;&gt;What is the expected return I should use for the momentum strategy in MV optimization framework?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However (on the surface of it), I did not quite find a desirable answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can a momentum strategy be expressed as something to the effect of&#xA;$$r = \beta_0 + \beta_1 \frac{\mathrm{ten\_day\_moving\_average}}{\mathrm{hundred\_day\_moving\_average}} + \epsilon$$ or any other combination of predictors ($x_{2}$, $x_{3}$, ...); or maybe as some nonlinear model?&lt;/p&gt;&#xA;" OwnerUserId="11655" LastEditorUserId="22475" LastEditDate="2017-05-26T14:36:46.917" LastActivityDate="2017-05-26T14:36:46.917" Title="Can a momentum strategy be cast as a multilinear regression model?" Tags="&lt;regression&gt;&lt;momentum&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26161" PostTypeId="1" AcceptedAnswerId="26169" CreationDate="2016-05-22T06:04:50.667" Score="4" ViewCount="324" Body="&lt;p&gt;Given Black and Scholes model, consider the portfolio $a_t$  = 1/2, $b_t$ = $1/2$$S_t$ $exp(-rt)$. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Show that this portfolio replicates one share of stock.&lt;/li&gt;&#xA;&lt;li&gt;Show if it is self-financing. &lt;/li&gt;&#xA;&lt;li&gt;Find another portfolio which is self financing and replicates one share of stock.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;My Attempt:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm fairly sure that for Q1, I need to show that this is a arbitrage free portfolio by showing $C_t$ = $V_t$, and not $C_t$ &gt; $V_t$ or $C_t$ &amp;lt; $V_t$ with &#xA;$V_t$ = $a_t$$S_t$+$b_t$$β_t$. However I'm not entirely sure how to find out $C_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Q2. I believe I need to show that $dV_t$ = $a_tdS_t+b_tdβ_t$ but am not sure how exactly to do that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have no idea how to attempt Q3.  &lt;/p&gt;&#xA;" OwnerUserId="20828" LastEditorUserId="20828" LastEditDate="2016-05-23T02:08:13.007" LastActivityDate="2016-05-23T02:29:09.890" Title="Black-Scholes Model for portfolios" Tags="&lt;black-scholes&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26162" PostTypeId="1" AcceptedAnswerId="26177" CreationDate="2016-05-22T10:16:18.657" Score="4" ViewCount="37926" Body="&lt;p&gt;I remember having seen that somewhere, I can't find it any more. &#xA;Anyone knows how can I get all the list of stocks on Yahoo finance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or even all american stocks, maybe Russell 1000/2000/3000... &lt;/p&gt;&#xA;" OwnerUserId="17897" LastActivityDate="2021-02-26T21:00:45.073" Title="where can I get a list of all yahoo finance stocks symbols" Tags="&lt;yahoofinance&gt;" AnswerCount="7" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26164" PostTypeId="1" CreationDate="2016-05-22T12:01:40.760" Score="3" ViewCount="362" Body="&lt;p&gt;Suppose $dA_t = A_t[\mu dt+\sigma dW_t]$ (assets' value) under the physical measure, plus the other assumptions of the Merton model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose further that debt and equity are tradeable assets that satisfy $A_t = D_t+E_t$ and follow&#xA;processes $D_t = D(t,A_t)$, $E_t = E(t,A_t)$ for differentiable functions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By considering a locally risk-free self-ﬁnancing portfolio of bonds and equity(which by necessity will earn the risk-free rate of return), prove directly that both $D$,&#xA;$E$ satisfy the Black-Scholes equation:&#xA;$$\partial_t f+\frac{1}{2}\sigma^2 A^2 \partial_A^2 f+r A \partial_A f-r f = 0$$&lt;/p&gt;&#xA;" OwnerUserId="19280" LastEditorUserId="2587" LastEditDate="2016-05-24T10:17:34.480" LastActivityDate="2020-01-22T03:11:22.613" Title="Merton model riskless self-financing derivation" Tags="&lt;black-scholes&gt;&lt;credit-risk&gt;&lt;merton-model&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26165" PostTypeId="1" AcceptedAnswerId="26167" CreationDate="2016-05-22T12:23:57.633" Score="1" ViewCount="225" Body="&lt;h1&gt;Problem&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;An investor will receive $365 at the end of each year for thirteen years. The first payment will be received four years from now. Given that the interest rate is 3%, the present value of this cash flow stream is closest to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;$3,552 (Correct solution)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$3,882&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$3,449 (I answered this)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h1&gt;Solution&lt;/h1&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;N = 13&lt;/li&gt;&#xA;&lt;li&gt;PMT = 365&lt;/li&gt;&#xA;&lt;li&gt;I/Y = 3&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Compute PV: PV = $3881.76&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This is the value of the cash flow stream three years from now. We must discount this value back to t = 0 to compute its present value.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;N = 3&lt;/li&gt;&#xA;&lt;li&gt;I/Y = 3&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;FV = -3,881.76. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Compute PV: PV = 3552.36&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h1&gt;Question&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Why is N = 3 in the bottom half of the solution? I used N = 4 because the initial payment is 4 years from now, resulting in answer C instead. Any clarification on this? Thank you very much!&lt;/p&gt;&#xA;" OwnerUserId="20831" LastActivityDate="2016-05-22T15:44:57.730" Title="Time-Value of money exercise problem. Any advice on how to solve?" Tags="&lt;finance&gt;&lt;finance-mathematics&gt;&lt;investment&gt;&lt;accounting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26167" PostTypeId="2" ParentId="26165" CreationDate="2016-05-22T13:27:24.123" Score="0" Body="&lt;p&gt;Summing the PVs of the cash flows, I get 3552. I'm going to guess that your equation assumes the first payment comes at the end of the first period, not at the start of it. For this setup, that would put the &quot;start&quot; date of the instrument at t=3. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally, I would just discount all the cash flows back to today, rather than once to a forward date and then again to today, to eliminate these kinds of issues.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit to show how to count:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;t    y&#xA;0         spot&#xA;1&#xA;2&#xA;3   0   start for purposes of eqn&#xA;4   1   first payment&#xA;5   2&#xA;...&#xA;16 13  last payment&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In computer science there are 2 hard problems: cache invalidation, naming things and off by one errors. (Forgotten the source for that)&lt;/p&gt;&#xA;" OwnerUserId="1314" LastEditorUserId="1314" LastEditDate="2016-05-22T15:44:57.730" LastActivityDate="2016-05-22T15:44:57.730" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26168" PostTypeId="2" ParentId="2993" CreationDate="2016-05-22T14:23:50.527" Score="0" Body="&lt;p&gt;A possible way is to think at the Single Index Model (SIM). In this case if an asset $i$ is uncorrelated with the market, then it is uncorrelated with each other. Thus the condition &quot;.. each uncorrelated with the others and with the market ...&quot; boil down in the second request. Remember that in the SIM $σ_i,j=β_iβ_jσ^2_m$. In this framework, if the SIM hold, we have &#xA;$r_it - r_f = a_i + β_i(r_mt- r_f) + e_it$&#xA;with $a_i = 0$ for each $i$ and $β_i&amp;gt;0$ &lt;em&gt;for most&lt;/em&gt; of $i$. Exactly for the last condition the &lt;em&gt;market&lt;/em&gt; is (the only) &lt;em&gt;common risk factor&lt;/em&gt;. &#xA;Thus we can have a few stock with $β_i=0$ while it is impossible to have &quot;... many such assets&quot;.&#xA;In effect if we have many asset with $β_i=0$ simply the SIM tend to vanish and in end the SIM not hold. Or &#xA;$r_it - r_f = a_i + e_it$ thus $E[r_it] = a_i + r_f$ but in equilibrium $a_i =0$ and effectively if we take in ptf so many asset we tend to achieve, almost surely, the $rf$ rate.&#xA;However in the real word the $σ_(avg)$, in term of suggested by Ram Ahluwalia, never tend to zero but, in well diversified ptf, tend to a positive,  and not too small, value. For this reason &lt;em&gt;common risk factors&lt;/em&gt; exist ... probably in more complicated form than SIM. Or, in other word, the diversification cannot completely eliminate the risk. Or, again, many such [ $β_i=0$]assets &lt;strong&gt;can not exist&lt;/strong&gt;. &#xA;The case in which $β_i&amp;lt;0$ is, a bit more tricky, but similar.&lt;/p&gt;&#xA;" OwnerUserId="20746" LastActivityDate="2016-05-22T14:23:50.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26169" PostTypeId="2" ParentId="26161" CreationDate="2016-05-22T18:22:40.567" Score="2" Body="&lt;p&gt;To show whether it is self-financing, we need to show whether the equation&#xA;\begin{align*}&#xA;dV_t = a_t dS_t+b_t d\beta_t&#xA;\end{align*}&#xA;holds.&#xA;Note that&#xA;\begin{align*}&#xA;V_t &amp;amp;= a_t S_t + b_t \beta_t\\&#xA;&amp;amp;=\frac{1}{2} S_t + \frac{1}{2} S_t e^{-rt} e^{rt}\\&#xA;&amp;amp;=S_t.&#xA;\end{align*}&#xA;Then &#xA;\begin{align*}&#xA;dV_t = dS_t.&#xA;\end{align*}&#xA;On the other hand, &#xA;\begin{align*}&#xA;a_t dS_t + b_t d\beta_t &amp;amp;=\frac{1}{2}dS_t + \frac{1}{2}S_t e^{-rt} \big(re^{rt}\big)dt\\&#xA;&amp;amp;=\frac{1}{2}dS_t + \frac{1}{2}rS_t dt\\&#xA;&amp;amp;\neq dS_t.&#xA;\end{align*}&#xA;Therefore, this is not a self-financing portfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To find another self-financing portfolio that replicates one share of the stock, we can simply set $a_t=1$ and $b_t=0$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-05-23T02:29:09.890" LastActivityDate="2016-05-23T02:29:09.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26170" PostTypeId="2" ParentId="15778" CreationDate="2016-05-22T21:33:55.260" Score="0" Body="&lt;p&gt;Mean variance and CAPM are not the same thing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Neither the mean-variance model are the part of the CAPM. Rather the CAPM, in certain sense, is an part of the mean variance model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To put it better, if we have $N$ risky assets plus a riskless one then we can achieve the &lt;em&gt;a la CAPM&lt;/em&gt; representation. Moreover if the tangency ptf overlap the market ptf, as the CAPM assumption impose (equilibrium), we have the standard CAPM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other way, if the mean variance model do not hold neither the CAPM hold. Instead if the CAPM not hold the mean variance can hold still. The mean variance is more general.&lt;/p&gt;&#xA;" OwnerUserId="20746" LastActivityDate="2016-05-22T21:33:55.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26171" PostTypeId="1" CreationDate="2016-05-22T21:57:26.743" Score="2" ViewCount="84" Body="&lt;p&gt;I have a question about calculating the implied vol. Assuming the implied vol that a option will expire in 1 day is $\sigma_1$, and the implied vol that the option will expire in 2 days is $\sigma_2$. Is there a way to calculate the implied vol from day 1 to day 2 when it has skew?  I know I can compute the local vol from day 1 to day 2 and may transform it to implied vol. But is there a more straight forward way to do it? Thanks!&lt;/p&gt;&#xA;" OwnerUserId="20837" LastActivityDate="2016-05-22T21:57:26.743" Title="Implied volatility" Tags="&lt;implied-volatility&gt;&lt;local-volatility&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26172" PostTypeId="1" AcceptedAnswerId="26175" CreationDate="2016-05-22T23:31:21.643" Score="1" ViewCount="75" Body="&lt;p&gt;I have a plot of a Call Spread Option at time $t ={0}$ but the graph of the call spread is not completely symmetric. My question is: does it have to be? Here is the plot I'm referring to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/6YJDJ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/6YJDJ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm just wondering because at maturity time the Call Spread becomes symmetric, so it anyone can provide a bit of information on this I'd really appreciate it. Thanks!&lt;/p&gt;&#xA;" OwnerUserId="20543" LastActivityDate="2016-05-22T23:46:48.380" Title="Does a Call Spread always need to be symmetric?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26173" PostTypeId="1" CreationDate="2016-05-22T23:36:42.813" Score="2" ViewCount="311" Body="&lt;p&gt;I'm trying to use the reqPositions() method but it doesn't have an event handler associated with it that it references in the API.&lt;/p&gt;&#xA;" OwnerUserId="20839" LastActivityDate="2017-01-25T06:18:59.613" Title="How to request current Interactive Broker positions using VBnet/Activex and the API?" Tags="&lt;programming&gt;&lt;interactive-brokers&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26175" PostTypeId="2" ParentId="26172" CreationDate="2016-05-22T23:46:48.380" Score="4" Body="&lt;p&gt;I assume this is a plot of option value versus price of the underlying.   The only case where it ought to be symmetric is if the pdf of the underlying is symmetric  eg normally distributed.  I'm guessing your chart assumes a lognormal underlying, which is a non symmetric pdf, so the graph is non symmetric.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-05-22T23:46:48.380" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26176" PostTypeId="1" CreationDate="2016-05-23T00:30:01.823" Score="1" ViewCount="90" Body="&lt;p&gt;if I have given CRSP bond portfolio returns with different maturities (1m-12m, etc), how is it possible to compute the Future price and the duration? &#xA;Beside that I do also have the Nelson-svensson-siegel yield curve in form of zero coupon, par yield, instantaneous forward rate etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much for any help!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wende&lt;/p&gt;&#xA;" OwnerUserId="20280" LastActivityDate="2016-05-28T00:47:57.480" Title="Bond Duration with Bond portfolio returns" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;duration&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26177" PostTypeId="2" ParentId="26162" CreationDate="2016-05-23T02:37:23.963" Score="5" Body="&lt;p&gt;BATS has a nice downloadable file: &#xA;&lt;a href=&quot;http://batstrading.com/market_data/listed_symbols/&quot; rel=&quot;noreferrer&quot;&gt;http://batstrading.com/market_data/listed_symbols/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's a CS and XML. They have 7,000 stocks in that list. Good stocks, not OTC.&lt;/p&gt;&#xA;" OwnerUserId="20460" LastActivityDate="2016-05-23T02:37:23.963" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26179" PostTypeId="1" CreationDate="2016-05-23T06:00:54.520" Score="1" ViewCount="44" Body="&lt;p&gt;So, basically i want to debate and find out the real reason behind being flag by ECNs and venues as &quot;toxic&quot;. How to avoid being flag? What kind of strategies are toxic and why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is an article found by a brokerage firm... so the opinion in that article couldn't be that objective.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Article about toxix FX flow &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any thoughts?&lt;/p&gt;&#xA;" OwnerUserId="13990" LastActivityDate="2016-05-23T06:00:54.520" Title="Toxic FX Flow - how to avoid it" Tags="&lt;fx&gt;&lt;quant-trading-strategies&gt;&lt;high-frequency&gt;&lt;quants&gt;" AnswerCount="0" CommentCount="0" ClosedDate="2016-05-23T06:47:44.880" ContentLicense="CC BY-SA 3.0" />
  <row Id="26181" PostTypeId="2" ParentId="26164" CreationDate="2016-05-23T07:12:55.127" Score="0" Body="&lt;p&gt;You need the derivation of BS eq.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Black%E2%80%93Scholes_equation#Derivation&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Black%E2%80%93Scholes_equation#Derivation&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where in your setup you need S = V and case 1: V = E, case 2: V = D.&lt;/p&gt;&#xA;" OwnerUserId="20840" LastActivityDate="2016-05-23T07:12:55.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26182" PostTypeId="1" AcceptedAnswerId="26238" CreationDate="2016-05-23T07:32:51.287" Score="8" ViewCount="425" Body="&lt;p&gt;I've used the SVI model in the past for equity option which worekd quite well. I came across a post on Wilmott where someone said hes using SVI for swaption as well. I would like to test the model and fit it to swaption implied volatitilities (normal). However, there are markets where the forward swap rate goes negative and in the original &lt;a href=&quot;https://www.google.ch/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0ahUKEwiW3MWB1u_MAhXKOxQKHYMIB58QFgghMAA&amp;amp;url=https%3A%2F%2Farxiv.org%2Fpdf%2F1204.0646&amp;amp;usg=AFQjCNGDjP5EhBuPni1wjTzx4cKGzHFBxA&amp;amp;bvm=bv.122448493,d.d24&quot; rel=&quot;noreferrer&quot;&gt;paper&lt;/a&gt; Gatheral and Jacquier they use the moneyness $\log(\frac{K}{F_0})$, where $F_0$ is the forward swap rate. This is not defined for negative rates. Are you aware of any study for the SVI for fixed income? How else can we deal with negative rates in this case?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the model is not really based on any assumption on the underlying like in a SABR model we could change this. However, I'm not sure if there is any theoretical constraints on doing this.&lt;/p&gt;&#xA;" OwnerUserId="17133" LastEditorUserId="17133" LastEditDate="2016-05-25T07:34:44.910" LastActivityDate="2019-04-12T04:27:50.197" Title="SVI negative rates" Tags="&lt;implied-volatility&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26183" PostTypeId="1" CreationDate="2016-05-23T09:29:38.943" Score="2" ViewCount="80" Body="&lt;p&gt;I need help in understanding some results that I have obtained. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am doing some out-of-sample performance analysis for different targets of volatility in mean-variance optimization where I solely change the way the covariance matrix has been estimated. HC in the figure refers to the sample covariance matrix, whereas GS refers to the Gerber-Statistic based covariance matrix (see &lt;a href=&quot;https://blog.thinknewfound.com/2015/07/new-paper-markowitz-introducing-gerber-statistic/&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;) which is supposedly more robust to outliers and noise in the data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if we observe the below figures, one can see that the risk-adjusted-return (adjusted according to HC) for GS is generally lower in expansionary times while its much higher in recessionary times. Now, a plausible explanation for this is that GS works better under more volatile times influenced by noise and outliers. However, I can't find any theories that support the fact that returns are more volatile in recessionary times, compared to expansionary times. Do you have any ideas regarding this matter?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/DYtGB.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/DYtGB.png&quot; alt=&quot;Expansionary out-of-sample performance (evaluated during expansionary periods)&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/vET57.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/vET57.png&quot; alt=&quot;Recessionary out-of-sample performance (evaluated during recessionary periods)&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19949" LastActivityDate="2016-05-23T10:29:35.040" Title="Are financial returns considered more volatile in recessionary times as opposed to expansionary times?" Tags="&lt;portfolio-management&gt;&lt;market&gt;&lt;mean-variance&gt;&lt;financial&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26184" PostTypeId="2" ParentId="26183" CreationDate="2016-05-23T10:29:35.040" Score="1" Body="&lt;p&gt;See &lt;a href=&quot;http://www.princeton.edu/~yacine/leverage.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.princeton.edu/~yacine/leverage.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The leverage effect refers to the observed tendency of an asset’s&#xA;  volatility to be negatively correlated with the asset’s returns.&#xA;  Typically, rising asset prices are accompanied by declining&#xA;  volatility, and vice versa. The term “leverage” refers to one possible&#xA;  economic interpretation of this phenomenon, developed in Black (1976)&#xA;  and Christie (1982): as asset prices decline, companies become&#xA;  mechanically more leveraged since the relative value of their debt&#xA;  rises relative to that of their equity. As a result, it is natural to&#xA;  expect that their stock becomes riskier, hence more volatile.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="7178" LastActivityDate="2016-05-23T10:29:35.040" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26185" PostTypeId="1" CreationDate="2016-05-23T10:40:13.013" Score="1" ViewCount="76" Body="&lt;p&gt;A quick and (hopefully) easy question. Why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;*(always / often / when it's not &lt;em&gt;B&lt;/em&gt;)&lt;/p&gt;&#xA;" OwnerUserId="19663" LastActivityDate="2016-05-23T12:26:43.500" Title="Why is H always* the letter used to describe the level of a barrier?" Tags="&lt;options&gt;&lt;barrier&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26186" PostTypeId="1" CreationDate="2016-05-23T10:56:23.640" Score="0" ViewCount="876" Body="&lt;p&gt;I have Financial LOB data and I feel that a skewed t distribution will fit best. I have a problem trying to find the parameters using MLE numerically since Matlabs built in function does not allow for Skewed t-distn.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can somebody point me to some code which will find the parameters? Or can someone offer advice for an easy way to do this? I also need to simulate using these parameters but I think this is easier&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers&lt;/p&gt;&#xA;" OwnerUserId="20843" LastActivityDate="2016-10-24T16:36:19.897" Title="Skewed Student t distribution MLE and Simulation" Tags="&lt;statistics&gt;&lt;curve-fitting&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26188" PostTypeId="2" ParentId="26186" CreationDate="2016-05-23T11:04:33.560" Score="1" Body="&lt;p&gt;i think the &lt;code&gt;fitdistrplus&lt;/code&gt; library in R could help you with this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;fitdist(data, distr, method = c(&quot;mle&quot;, &quot;mme&quot;, &quot;qme&quot;, &quot;mge&quot;),&#xA;start=NULL, fix.arg=NULL, discrete, keepdata = TRUE, keepdata.nb=100, ...)&#xA;&#xA;# for student t&#xA;fitdistr(x, &quot;t&quot;, start = list(m=mean(x),s=sd(x), df=3), lower=c(-1, 0.001,1))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="20742" LastActivityDate="2016-05-23T11:04:33.560" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26189" PostTypeId="2" ParentId="26186" CreationDate="2016-05-23T11:08:05.017" Score="2" Body="&lt;p&gt;Can you not just measure the moments of your data, and then use them to find &lt;code&gt;mu&lt;/code&gt; and &lt;code&gt;v&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/wSpFh.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/wSpFh.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the second simplifies to &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/F4vvr.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/F4vvr.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19663" LastActivityDate="2016-05-23T11:08:05.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26190" PostTypeId="1" CreationDate="2016-05-23T11:52:45.123" Score="1" ViewCount="523" Body="&lt;p&gt;I do not know to which swaption volatility matrix I have to calibrate the LMM in order to price back correctly the swaptions corresponding to the underlying swaps of a Bermudan Swaption.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My problem:&lt;/strong&gt; For the LMM, I use the simple correlation form &#xA;$\rho_{i,j}=e^{-\beta|i-j|}$&#xA;with beta fixed. This parameter is not taken into account in the calibration.&#xA;For the volatility I use the form&#xA;$$\sigma_i\left(t\right) = \phi_i \left(\left(a+b\left(T_i-t\right)\right)e^{-c\left(T_i-t\right)}+d\right)$$&#xA;Initially I take $\phi_i=1$ for all $i$ and calibrate the parameters $a,b,c,d$ to the ATM swaption market volatilities matrix by minimizing the MSE between these volatilities and the ones determined by the Rebonato swaption volatility approximation formula. We obtain:&#xA;$$V_{ATM swaptions}^{Reb} = V_{ATM swaptions}^{market}$$&#xA;Afterwards we determine the parameters $\phi_i$ such that the diagonal of a fixed strike $K$ market volatility matrix is fitted exactly:&#xA;$$V_{K swaptions}^{Reb} = V_{K swaptions}^{market}$$&#xA;It is important that the diagonal swaption volatilities (=swaption vols of swaptions corresponding to the underlying swaps of a Bermudan Swaption) of a fixed strike $K$ swaption vol matrix are priced correctly when we want to price a Bermudan Swaption with strike $K$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However the Rebonato approximation formula is only accurate for ATM strikes. &#xA;Hence, comparing the Rebonato approximated price with strike $K$ and the price obtained by a Monte Carlo routine with these calibrated parameters, we would in general see that:&#xA;$$V_{K swaptions}^{Monte Carlo} \neq V_{K swaptions}^{Reb} = V_{K swaptions}^{market}$$&#xA;Hence the swaptions corresponding to the underlying swaps of a Bermudan Swaptions are not priced back correctly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anybody know how I can improve my calibration routine in order to price back correctly the swaptions corresponding to a fixed strike?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help is appreciated. Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="19279" LastEditorUserId="19279" LastEditDate="2016-05-23T12:00:40.143" LastActivityDate="2016-05-23T12:00:40.143" Title="Pricing back swaptions corresponding to underlying swaps of Bermudan Swaption in calibrated LMM" Tags="&lt;interest-rates&gt;&lt;monte-carlo&gt;&lt;swaption&gt;&lt;lmm&gt;&lt;bermudan&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26191" PostTypeId="2" ParentId="26185" CreationDate="2016-05-23T12:26:43.500" Score="2" Body="&lt;p&gt;I do not have any reference, but I think $H$ is for hitting.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-05-23T12:26:43.500" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26192" PostTypeId="1" AcceptedAnswerId="26193" CreationDate="2016-05-23T12:37:00.317" Score="1" ViewCount="390" Body="&lt;p&gt;A question regarding this futures:&#xA;&lt;a href=&quot;http://www.cmegroup.com/trading/interest-rates/stir/30-day-federal-fund.html&quot; rel=&quot;nofollow&quot;&gt;http://www.cmegroup.com/trading/interest-rates/stir/30-day-federal-fund.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It says that settlement price = 100 - [average of effective federal fund rate for corresponding month].&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, here are the EFFR's: &lt;a href=&quot;https://apps.newyorkfed.org/markets/autorates/fed%20funds&quot; rel=&quot;nofollow&quot;&gt;https://apps.newyorkfed.org/markets/autorates/fed%20funds&lt;/a&gt;&#xA;They are, of cause, qouted for trading days only.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is: does &quot;average of EFFRs for corresponding month&quot; means average just for trading days or do they have some methodology to take Saturdays and Sundays into account? Couldn't find that on specs.&lt;/p&gt;&#xA;" OwnerUserId="17976" LastActivityDate="2016-05-23T13:04:00.287" Title="30 Day Federal Funds Futures settlement price" Tags="&lt;futures&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26193" PostTypeId="2" ParentId="26192" CreationDate="2016-05-23T13:04:00.287" Score="3" Body="&lt;p&gt;Fed funds futures are calendar-day based. For weekends and holidays, the rate from the previous business day is used.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2016-05-23T13:04:00.287" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26194" PostTypeId="1" CreationDate="2016-05-23T13:19:49.833" Score="2" ViewCount="158" Body="&lt;p&gt;I'v got 6 different equity index time series from which I want to create an index based on a particular percentage. This would be simple although due to different holidays the date don't always match. I'm looking for a method in Matlab which matches dates and uses the previous value of the index when one (or more) index has a holiday while the others don't. &#xA;Anybody an idea?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="16788" LastActivityDate="2016-05-23T20:23:19.623" Title="Creating index from bloomberg data in matlab" Tags="&lt;correlation&gt;&lt;matlab&gt;&lt;bloomberg&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26195" PostTypeId="1" CreationDate="2016-05-23T13:19:53.887" Score="3" ViewCount="1219" Body="&lt;p&gt;I want to calibrate the Hull White 1 factor short rate model to market data. The main purpose is to simulate interest rate paths, which I will use to calculate the net pv of banking liabilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some sources suggest the use of market volatilities (of caps or swaptions), while I also encounter the use of market prices. Can someone explain to me the difference (if any) between the use of volatilities and prices for the calibration of the Hull White model. Which method is preferred with regards to my situation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance &lt;/p&gt;&#xA;" OwnerUserId="20844" LastActivityDate="2016-05-23T18:04:12.630" Title="Calibration of 1F Hull White short-rate model to market data" Tags="&lt;simulations&gt;&lt;calibration&gt;&lt;hullwhite&gt;&lt;interest&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26196" PostTypeId="1" CreationDate="2016-05-23T13:35:20.110" Score="2" ViewCount="145" Body="&lt;p&gt;I'm trying to figure out how to find IR sensitivity of a bond whose time to maturity of a bond is 2 years. Bond pays 10.875 percent coupons yearly. Duration is 1.8 years. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do you find the interest rate elasticity of the bond price? &lt;/p&gt;&#xA;" OwnerUserId="20845" LastActivityDate="2016-05-24T13:19:48.327" Title="Calculating IR sensitivity" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;bond-portfolio&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26197" PostTypeId="2" ParentId="24720" CreationDate="2016-05-23T13:57:49.513" Score="1" Body="&lt;p&gt;Usually it's aggressiveness of your orders + short term alpha. While it's equities not FX, I think you may find something interesting in the recent Barclays LX darkpool lawsuit documents. &lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2016-05-23T13:57:49.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26199" PostTypeId="2" ParentId="24816" CreationDate="2016-05-23T14:50:48.073" Score="1" Body="&lt;p&gt;If your issue is the holding period &quot;sensibility&quot;, I don't have persuasive economic/fundamental motivation about it. It's an interesting question. Anyway in econometric point of view the issue is part of &lt;em&gt;instability parameters problem&lt;/em&gt;.  If the time horizon for your investment project is, for example, one year, then you need return and beta one year based. Therefore, in simplest way, you have to take yearly data return to estimate the beta, with certain historical depth. However the beta are not (explicitly) time horizon dependent and you can take the monthly/weekly/daily data. In my experience the time frequency are not so important in beta estimate (also if the number of observation change and this tend to suggest, at least in my opinion, weekly or daily data ... but monthly are largely used).&#xA;In opposite is so important the historical depth. This problem is strictly related with time varying variance and correlation. However the &quot;beta structure&quot; and experience suggest that it move around one and this fact alleviate the problem. You can see for example Blume's technique.  Maybe if your time horizon is too long the better choice for beta becomes 1. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In any case, for example and at least in the past, Merrill Lynch suggest to use monthly data with 60 obs. In the past I looked for but I'm not found empirical research for support them choice. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope that helps&lt;/p&gt;&#xA;" OwnerUserId="20746" LastActivityDate="2016-05-23T14:50:48.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26200" PostTypeId="2" ParentId="26194" CreationDate="2016-05-23T15:11:05.090" Score="1" Body="&lt;p&gt;Sounds more like a programming question, but what you stressed is relevant, you need to define a methodology to deal with this calendar issue. The options you have are whether choose the smallest common set of dates to calculate your index, or use previous close. Choosing between the two involves investability of your index IMO. Would you be able to purchase the underlyings or at least etfs tracking them on holidays date ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, another aspect to define in your methodology is the dates on which you would rebalance your weights in order to retarget your target percentage allocation.&lt;/p&gt;&#xA;" OwnerUserId="17986" LastActivityDate="2016-05-23T15:11:05.090" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26201" PostTypeId="1" CreationDate="2016-05-23T17:47:51.497" Score="1" ViewCount="1144" Body="&lt;p&gt;In a documentation, there is the following formula for &quot;zero interest rate risky duration&quot; of a bond: $\frac{1-exp(-s \cdot T)}{s}$, where $s$ is spread, $T$ time until maturity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What type of bond (zero-coupon, floating rate, etc.) is this formula valid for and how is it derived? &lt;/p&gt;&#xA;" OwnerUserId="15867" LastActivityDate="2016-06-23T08:47:50.640" Title="Risky duration formula for what kind of bond?" Tags="&lt;bond&gt;&lt;spread&gt;&lt;duration&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26203" PostTypeId="2" ParentId="26195" CreationDate="2016-05-23T18:04:12.630" Score="2" Body="&lt;p&gt;Suppose we have a set of $N_T$ maturities $\tau_t$ and a set of $N_k$ strikes $K_k$ .For each maturity-strike combination $(\tau_t,K_k)$ we have a market price (for example) $Caplet(\tau_t,K_k)=C_{tk}$ and a corresponding model price $Caplet(\tau_t,K_k,\Lambda)=C^\Lambda_{tk}$ in which $\Lambda$ is Hull-Whit's Parameters. The first category minimize the error between&#xA;quoted and model prices The error is usually defined as the squared difference between the quoted and model prices, or the absolute value of the difference; relative errors can also be used. For example, parameter estimates obtained using the mean error sum of squares (MSE) loss function are obtained by minimizing &#xA;$$\frac{1}{N}\sum\limits_{t=1}^{{{N}_{T}}}{\sum\limits_{k=1}^{{{N}_{K}}}{{{w}_{t,k}}}}{{({{C}_{t,k}}-C_{t,k}^{\Lambda })}^{2}}\ ,\ \ N={{N}_{T}}\times {{N}_{K}}\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,(1)$$&#xA;$\omega_{tk}$ is weight parameter.&#xA;&lt;strong&gt;The second&lt;/strong&gt; category are those that minimize the error between&#xA;quoted and model implied volatilities. Again, the error is usually defined as the squared difference, absolute difference, or relative difference, between quoted and model implied volatilities:&#xA;$$\frac{1}{N}\sum\limits_{t=1}^{{{N}_{T}}}{\sum\limits_{k=1}^{{{N}_{K}}}{{{w}_{t,k}}}}{{(I{{V}_{t,k}}-IV_{t,k}^{\Lambda })}^{2}}\ \ ,\ \ N={{N}_{T}}\times {{N}_{K}}\,\,\,\,\,\,\,\,\,\,\,\,\,(2)$$&#xA;&lt;strong&gt;The main disadvantage of Equation&lt;/strong&gt; (2) is that it is numerically intensive.Indeed, at each iteration of the optimization, we must first obtain every Caplet Price and then apply a root-finding algorithm such as the bisection algorithm to extract the implied volatility $IV_{t,k}^{\Lambda }$ from $C_{t,k}^{\Lambda }$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope it will be useful for you.&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastActivityDate="2016-05-23T18:04:12.630" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26204" PostTypeId="1" AcceptedAnswerId="26217" CreationDate="2016-05-23T19:02:28.650" Score="7" ViewCount="835" Body="&lt;p&gt;I am struggling in interpreting results of my simulations. I use Monte Carlo algorithm to simulate stock paths and calculate option price. The notation: $r$ is a risk free interest rate, $T$ is time to maturity, $K$ - strike of an option, $S_T$ - stock price at time $T$, $\sigma$ - volatility of stock log-returns, $c$ - price of a call option, $t$ is a time step.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First I simulate stock paths assuming that stock price follows &lt;a href=&quot;https://en.wikipedia.org/wiki/Geometric_Brownian_motion&quot; rel=&quot;nofollow noreferrer&quot;&gt;GBM&lt;/a&gt; process and calculate option price. Lets assume that $r = 0.05$, $K = 70$, $S_0 = 70$, $\sigma = 0.3$, $T = 0.28 $ (100 days). Number of sims $N = 1000$ and there will be 700 stock movements in each path (7 each day). I get $c = 5.008$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Black%E2%80%93Scholes_model&quot; rel=&quot;nofollow noreferrer&quot;&gt;BSM&lt;/a&gt; model with same parameters gives $c = 4.88$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I assume that log returns can be described by &lt;a href=&quot;https://en.wikipedia.org/wiki/Normal-inverse_Gaussian_distribution&quot; rel=&quot;nofollow noreferrer&quot;&gt;NIG&lt;/a&gt; disrtibution with parameters $\mu$, $\beta$, $\delta$, $\alpha$ and that log returns, $r_i$ can be calculated as (see this &lt;a href=&quot;https://quant.stackexchange.com/questions/25900/use-nig-distribution-to-model-stock-path&quot;&gt;question&lt;/a&gt;):&#xA;$$r_i = \hat\mu + \hat\beta\sigma_i^2 + \sigma_i\varepsilon_i$$&#xA;where $\sigma^2 \sim IG(\hat\delta/\hat\gamma, \hat\delta^2)$, $\varepsilon \sim N(0, 1)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I estimated parameters of NIG distribution using Google &lt;strong&gt;hourly&lt;/strong&gt; returns for 2015 year ($\sigma = 0.29$). After running simulation I get $c = 8.77$ which is far bigger than BSM price and price obtained by GBM simulation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason is that growth rate in the latter model bigger than in GBM. For the NIG model expected value for growth rate $R_T$ for 100 days (700 movements, 7 each day) is&#xA;$$\mathbb{E}(R_T^{NIG}) = \left(\exp\left[\hat\mu + \hat\beta\frac{\hat\delta}{\hat\gamma}\right]\right)^{700} = 1.083$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;while GBM expected growth rate is &#xA;$$\mathbb{E}(R_T^{GBM}) = \left[\exp(r - 0.5\sigma^2)t\right]^{700} = 1.00139$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Finally, the question&lt;/strong&gt;: if I want to sell an option which model should I use? Intuitively it should be GBM because it prices under $\mathbb{Q}$ measure. But why one want to construct different models that prices under real world $\mathbb{P}$ measure e.g. NIG model above? And what are applications of them?&lt;/p&gt;&#xA;" OwnerUserId="18345" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-05-25T16:07:08.117" Title="Interpret simulation results ($P$ and $Q$ measures)" Tags="&lt;monte-carlo&gt;&lt;risk-neutral-measure&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26205" PostTypeId="2" ParentId="26194" CreationDate="2016-05-23T20:23:19.623" Score="0" Body="&lt;p&gt;I have made a solution to an index construction but not in Matlab but in C++ with Visual Studio. Maybe you would like to check it out. It automatically spits out the index from the Bloomberg stream data (&lt;a href=&quot;https://github.com/RTRindex/raleigh-triangle-index&quot; rel=&quot;nofollow&quot;&gt;https://github.com/RTRindex/raleigh-triangle-index&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="7693" LastActivityDate="2016-05-23T20:23:19.623" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26206" PostTypeId="2" ParentId="26196" CreationDate="2016-05-23T20:40:10.560" Score="1" Body="&lt;p&gt;Ok, so I think you are just asking what is the dv01 of the bond.  So if the yield goes up one bp what's the new price?  And if it goes down, what's the new price?  That's the simple way that people look at it.  For a bond that can't be called or converted in any way it's pretty easy.  Let's assume that's what you have.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the process:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;So first you need to find out what is the current price of that bond.  You need to get that from somewhere this is based on a certain settlement date, so make sure you get that as well or your price is not too meaningful.&lt;/li&gt;&#xA;&lt;li&gt;Decide what yield convention you want to use.  ACT/ACT?  Yields only mean something in contex of a convention.  If I tell you that you are going 55 on the freeway you need to know if we are talking kph/mph/knotts, etc.&lt;/li&gt;&#xA;&lt;li&gt;Figure out the yield that is implied at the current price.&lt;/li&gt;&#xA;&lt;li&gt;Add a bp to the yield and compute what the new price would be.&lt;/li&gt;&#xA;&lt;li&gt;Take off a bp from the yield and compute the new price.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Do you know how to calculate the yield from price and price from yield?  You can do it in Excel or Bloomberg or program it yourself.  I'm sure there are lots of posts here explaining how to do a Newtonian expansion if you really want to code it up yourself.  I have some old code I could post if you really can't find that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good luck.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Adding a few notes to answer the follow up question.  When you are being asked about sensitivity to &quot;1+YTM&quot; they mean what is what is the &quot;dv01&quot;, or the dollar value of a .01 move in rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea of convexity just means that a .01 bp change in rate might change your price .10 cents at yield X and a .01 bp change in rate might change your price .20 cents and yield Y.   The change in price is not a linear response to change in rate.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have to know your settlement date and the current price to determine a yield.  Then once you know the yield you can bump it up and down and see the price impact.  I think you can see this intuitively in the extremes.  Imagine if a $10 coupon note with $100 par can be bot for $100 for settle the day before it matures.  That would be a very high yield (by any convention).   Then imagine if you change the price slightly you would greatly change the yield.&lt;/p&gt;&#xA;" OwnerUserId="20092" LastEditorUserId="20092" LastEditDate="2016-05-24T13:19:48.327" LastActivityDate="2016-05-24T13:19:48.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26209" PostTypeId="2" ParentId="26152" CreationDate="2016-05-23T22:13:38.563" Score="2" Body="&lt;p&gt;As You Know, CIR model is the square root process given by the following stochastic differential equation&#xA;$$d{{r}_{t}}=\kappa (\theta -{{r}_{t}})dt+\sigma \sqrt{{{r}_{t}}}d{{W}_{t}}$$ &#xA;Let $\Theta=(\kappa,\theta,\sigma)$. It is well-known that conditional on a realized value of $r_t$, the random variable $2c_t\,r_{t+\Delta t}$  follows a non-central chi-square distribution with $d = 4\kappa\theta/\sigma^2$ degrees of freedom and non-centrality parameter&#xA;$2c_t\,r_te^{−κ\Delta t}$, where&#xA;$$c_t=\frac{2\kappa }{{{\sigma }^{2}}\,[1-{{e}^{-\kappa \Delta t}}]}$$&#xA;Indeed the density of $r_{t+\Delta t}$ is&#xA;$$P(r_{t+\Delta t}|r_t;\Theta)=c\,e^{-u-v}(\frac{u}{v})^{\frac{q}{2}}I_q(2\sqrt{uv})$$&#xA;where &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\,\,\,u_t=c_t\,r_te^{−κ\Delta t}$$&#xA;$$v_t=c_t\,r_{t+\Delta t}$$&#xA;$$\,\,\,\,\,\,\,q=\frac{2\kappa\theta}{\sigma^2}-1$$&#xA;and $I_q(2\sqrt{uv})$ is modified Bessel function of the first kind and of order $q$. The transition density has been originally derived in &lt;a href=&quot;https://quant.stackexchange.com/questions/23178/demonstrate-that-a-square-root-process-is-non-central-chi-squared-distributed/27691#27691&quot;&gt;this&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Parameter estimation is carried out on interest rate time series with N observations We consider equally spaced observations with $\Delta t$ time. &lt;strong&gt;The likelihood&lt;/strong&gt; function for interest rate time series with $N$ observations is step&#xA;$$L(\Theta )=\prod\limits_{i=1}^{N-1}{P({{t}_{t+\Delta t}}}|\,{{r}_{t}}\,;\,\Theta )$$&#xA;It is computationally convenient to work with the log-likelihood function&#xA;$$\ln L(\Theta )=\sum\limits_{i=1}^{N-1}{\ln P({{t}_{t+\Delta t}}}\,|{{r}_{t}}\,;\,\Theta )$$&#xA;from which we easily derive the log-likelihood function of the CIR process&#xA;$$\ln L(\Theta )=(N-1)\ln c+\sum\limits_{i=1}^{N-1}{\left( -{{u}_{{{t}_{i}}}}-{{v}_{{{t}_{i}}}}+\frac{1}{2}q\,\ln \left( \frac{{{v}_{{{t}_{i+1}}}}}{{{u}_{{{t}_{i}}}}} \right)+\ln {{I}_{q}}(\sqrt{2{{u}_{{{t}_{i}}}}{{v}_{{{t}_{i+1}}}}} \right)}$$&#xA;You can find maximum likelihood estimates $\widehat{\Theta }$ of parameter&#xA;vector $\Theta$ by maximizing the log-likelihood function last equation over its parameter space:&#xA;$$\widehat{\Theta }=arg\,\underset{\Theta }{\mathop{max}}\,\,\ln \,L(\Theta )$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorUserId="-1" LastEditorDisplayName="user16651" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-06-23T07:20:57.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26211" PostTypeId="1" CreationDate="2016-05-23T23:39:07.497" Score="2" ViewCount="368" Body="&lt;p&gt;After a few hours trying to solve this I give up! I need help. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need to calculate the BETA of an asset with respect to a portfolio that contains this asset. I have the volatility and correlations for all the portfolio, and the allocation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could use a formula to calculate the correlation between asset A and the portfolio. Because I could get Beta with the usual formula. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need a formula, not a method to calculate this based on historical prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this is what I have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Correlation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   A    B      C&#xA;A  1    0.85  0.78&#xA;B 0.85   1    0.84&#xA;C 0.78  0.84   1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;S.D.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  A       B      C&#xA;19.74% 25.76% 31.19%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Allocation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  A       B      C&#xA;25.00% 25.00% 50.00%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hope you can help me!!&lt;/p&gt;&#xA;" OwnerUserId="20854" LastActivityDate="2016-05-29T00:52:06.660" Title="Correlation between asset A and Portfolio X (which contains A)" Tags="&lt;correlation&gt;&lt;beta&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26212" PostTypeId="2" ParentId="26211" CreationDate="2016-05-24T00:29:44.117" Score="2" Body="&lt;p&gt;You only need to note the following&#xA;\begin{align*}&#xA;corr\left(X_1, \sum_{i=1}^nw_i X_i\right) &amp;amp;= \frac{cov\big(X_1, \, \sum_{i=1}^nw_i X_i \big)}{\sqrt{var(X_1)} \sqrt{var(\sum_{i=1}^n w_i X_i)}}\\&#xA;&amp;amp;= \frac{E\Big(\big(X_1-E(X_1)\big)\big(\sum_{i=1}^n w_i X_i - E(\sum_{i=1}^n w_i X_i) \big)\Big)}{\sqrt{var(X_1)} \sqrt{var(\sum_{i=1}^n w_i X_i)}}\\&#xA;&amp;amp;= \frac{\sum_{i+1}^n w_i E\big((X_1-E(X_1))(X_i - E( X_i) )\big)}{\sqrt{var(X_1)} \sqrt{var(\sum_{i=1}^n w_i X_i)}}\\&#xA;&amp;amp;= \frac{\sum_{i=1}^n w_i\rho_{1, i} \sigma_1 \sigma_i}{\sigma_1 \sqrt{\sum_{i, j=1}^n w_iw_j\rho_{i, j} \sigma_i \sigma_j}}\\&#xA;&amp;amp;= \frac{\sum_{i=1}^n w_i\rho_{1, i} \, \sigma_i}{\sqrt{\sum_{i, j=1}^n w_iw_j\rho_{i, j} \sigma_i \sigma_j}}.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-05-24T02:48:52.013" LastActivityDate="2016-05-24T02:48:52.013" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26213" PostTypeId="1" AcceptedAnswerId="26215" CreationDate="2016-05-24T01:39:26.220" Score="2" ViewCount="1269" Body="&lt;p&gt;I have been trying to build a NSS parameterization of LIBOR term structure, and have confused myself over how all the dates are dealt with.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On &lt;a href=&quot;https://www.theice.com/publicdocs/futures/Fixing_Calendar_2015.pdf&quot; rel=&quot;nofollow&quot;&gt;https://www.theice.com/publicdocs/futures/Fixing_Calendar_2015.pdf&lt;/a&gt;, they state that non-O/N LIBOR quotes have value date T+2. Does that mean the quoted LIBOR rates correspond to forward rates?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of the start and end date of a hypothetical loan, what happens if the loan ends on a non-business day or holiday? It seems that for the value date, the holidays include both US holidays and UK holidays, but is that also the case for the end dates?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ICE doesn't have very clear references with regards to these things, so I would also appreciate any reference that explains the date conventions for LIBOR quotes and/or LIBOR swaps clearly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="20855" LastActivityDate="2016-05-24T05:01:10.570" Title="LIBOR Quoting Conventions" Tags="&lt;libor&gt;&lt;daycounting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26214" PostTypeId="1" CreationDate="2016-05-24T04:07:29.840" Score="1" ViewCount="527" Body="&lt;p&gt;Need help, looking for some comparison between c++ FIX engines, like onixs, antenna and some fpga solutions. &#xA;If anyone has experienced some of the named engines also would like to  hear the experience. &lt;/p&gt;&#xA;" OwnerUserId="13990" LastActivityDate="2019-02-21T10:52:24.897" Title="FIX engines comparison" Tags="&lt;quantlib&gt;&lt;quantitative&gt;&lt;fix&gt;&lt;quants&gt;&lt;quickfix&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26215" PostTypeId="2" ParentId="26213" CreationDate="2016-05-24T05:01:10.570" Score="2" Body="&lt;p&gt;You're pretty much correct, so these are mostly confirmations:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Yes, the &quot;3-month&quot; USD LIBOR rate is really a 2 business day forward 3-month LIBOR rate (assuming the anchor date of your yield curve, the date on which the discount factor is 1, is &quot;today&quot;).&lt;/li&gt;&#xA;&lt;li&gt;USD swaps observe both New York and London holidays.&lt;/li&gt;&#xA;&lt;li&gt;If the maturity date is a bad day, it is adjusted to a business day using the &quot;Modified Following&quot; rule – it's moved to the next business day, unless the next business day follows in the next month, in which case you move it to the previous business day.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2016-05-24T05:01:10.570" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26217" PostTypeId="2" ParentId="26204" CreationDate="2016-05-24T06:29:22.460" Score="6" Body="&lt;p&gt;I believe that the confusion arises because of the wrong treatment of NIG. The answer to the question you link is misleading, as it simulates under P which is not appropriate for option pricing. None of the NIG parameters under P carries over to Q in general, but especially the drift is the problem here. First use the mom gen function of NIG to find the appropriate drift correction, and then it will work. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Also it seems to me that you are mixing time horizons here. To put vol 30% in BS looks like an annualized vol to me, but then you put time to maturity equal to 100, which means 100 years. It is quite basic to get the units sorted out. As you have presented it I cannot understand which units NIG is expressed into. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2016-05-24T11:44:24.927" LastActivityDate="2016-05-24T11:44:24.927" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26218" PostTypeId="2" ParentId="26201" CreationDate="2016-05-24T07:58:27.677" Score="1" Body="&lt;p&gt;&lt;strong&gt;Here is my understanding of your question, I might have oversimplified your problem, and made some hypothesis that were not yours.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming we are talking about a bond paying $1$ each day until $T$ or default event if occuring before $T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's write the risky coupon bond payment in a continous time manner:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\int_0^T \mathbb{1}_{\tau&amp;gt;t} dt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with zero interest rate, NPV is given by (assuming flat intensity)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$NPV = \int_{0}^{T} \mathbb{E}[\mathbb{1}_{\tau&amp;gt;t}]dt = \int_{0}^{T} e^{-st}dt=\frac{1-e^{-sT}}{s}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We focus on risky duration as derivative of the NPV with respect to spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, we are in a continuous time framework where we assumed no recovery in NPV, so intensity and spread are the same&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{risky duration}=\frac{dNPV}{ds}=\frac{(1+sT)e^{-sT}-1}{s^2}=-\frac{T^2}{2}+O_{s\to 0}(sT^3)]$$&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-05-24T07:58:27.677" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26219" PostTypeId="2" ParentId="26204" CreationDate="2016-05-24T10:20:42.590" Score="5" Body="&lt;p&gt;You should see this as a comment to @Kiwiakos answer which already hit the bull's eye.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the SE question you're referring to and to which I have answered, the idea was simply to provide you with a sound way of simulating returns out of a NIG distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It so happens that, for whatever your reason was, you decided to calibrate your NIG parameters based on historical time series, hence information provided under $\mathbb{P}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pricing options under $\mathbb{P}$ is &lt;a href=&quot;https://quant.stackexchange.com/questions/8274/how-to-estimate-real-world-probabilities&quot;&gt;possible&lt;/a&gt;. Yet, it is generally preferred to use an equivalent martingale measure $\mathbb{Q}$ where option prices can be expressed as discounted expectations (intuitive interpretation + nice mathematical treatment based on stochastic calculus and martingale theory). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, the option price is itself a unique quantity: it does not change whether it is expressed under $\mathbb{P}$ or under $\mathbb{Q}$. Using the measure $\mathbb{Q}$ should merely be seen as a smart trick to get rid of the risk aversion issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, moving from $\mathbb{P}$ to $\mathbb{Q}$ requires the specification of a form of market risk premium. Mathematically, it is equivalent to choosing an equivalent martingale measure from the set of all possible measures rendering discounted asset prices as martingales, which relies on Girsanov theorem. It so happens that if the market is complete, there is only one unique measure per numéraire.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, there is no straightforward relationship which can tell you how to move from $\mathbb{P}$ to $\mathbb{Q}$, except in very particular modelling settings, e.g. a GBM under $\mathbb{P}$ remains GBM under $\mathbb{Q}$ but with modified drift (ie $S_T$ is lognormally distributed under both measures). This is because the market is complete in that case. But if you introduce stochastic volatility for instance, the relationship becomes much more complicated as the market is not complete anymore (this has motivated the use of empirical techniques such as entropy minimisation).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In any case, by absence of arbitrage opportunities, under $\mathbb{Q}$ the underlying asset price should always drift at the risk-free rate $r$. Your NIG model is not consistent with that as pointed by Kiwiakos. But simply making the drift $r$ is not enough, see the discussion in the comments and what I just said above. The best alternative would probably be to calibrate your NIG parameters to observed option prices (hence directly under $\mathbb{Q}$) the same way you probably derived your BS dynamics (I mean how did you get $r=5%$ and $\sigma=30%$ in the first place?).&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-05-25T16:07:08.117" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26220" PostTypeId="1" CreationDate="2016-05-24T14:12:39.183" Score="3" ViewCount="332" Body="&lt;p&gt;From the basics of Black Litterman I understand that each view on a stock is implemented via the pick matrix &lt;strong&gt;P&lt;/strong&gt; with the expected value of the views in &lt;strong&gt;Q&lt;/strong&gt;. I have read several papers where each stock with a view is incorporated with a single entry in the &lt;strong&gt;P&lt;/strong&gt; and &lt;strong&gt;Q&lt;/strong&gt; matrices (for simplification I am assuming here absolute views only and no relative views). Is it the case that you can only have one view for each asset? Or is it possible to have multiple views on the same assets and incorporate these through the Black-Litterman approach? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example an asset may have multiple views generated according to several independent factor models or forecasts from several different analysts. Does the BL framework allow for this and how would this be implemented? Is it feasible to also account (from a risk perspective) for the correlations between higher level groupings such as sectors, regions or other exposures, for example?&lt;/p&gt;&#xA;" OwnerUserId="20862" LastActivityDate="2019-03-06T01:25:11.220" Title="Black Litterman: Is it possible to have multiple views (from different sources) on the same asset?" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;&lt;factor-models&gt;&lt;black-litterman&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26221" PostTypeId="1" CreationDate="2016-05-24T14:22:26.720" Score="4" ViewCount="1956" Body="&lt;p&gt;In Ito's calculus one often comes $dW^2=dt$. How does this come about? What is it's relation to the &lt;a href=&quot;https://en.wikipedia.org/wiki/Milstein_method&quot; rel=&quot;nofollow&quot;&gt;Milstein method&lt;/a&gt;?&lt;/p&gt;&#xA;" OwnerUserId="19878" LastEditorUserId="2587" LastEditDate="2016-05-24T14:25:38.130" LastActivityDate="2016-05-24T18:09:40.777" Title="Square of Wiener process" Tags="&lt;stochastic-calculus&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26223" PostTypeId="1" CreationDate="2016-05-24T14:33:03.657" Score="1" ViewCount="179" Body="&lt;p&gt;I would like to model OTM Swaptions. I can use some implementation of the Bachelier model (not B76 due to negative rates) and implied volatilities from Bloomberg.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For 10Y X 10Y (10 years option maturity, 10 years swap length) and 100 bps OTM I get something like 100% volatility pa for the EUR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to make this number plausible. Does it make sense to use a delta normal method here? Thus apply &#xA;$$&#xA;\sigma \approx \Delta \times \text{vola(rate}) \times f &#xA;$$&#xA;where $f$ should be some leverage factor. Which rate would I use? What if I look at duration and put&#xA;$$&#xA;\sigma \approx D \times \text{vola(rate}),&#xA;$$&#xA;again which rate? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there comparable numbers on the web or in Bloomberg? I can not estimate the volatility of swaptions in PORT, right?&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-05-24T14:33:03.657" Title="Estimate the risk of swaptions" Tags="&lt;risk&gt;&lt;swaps&gt;&lt;swaption&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26224" PostTypeId="1" CreationDate="2016-05-24T14:37:21.893" Score="1" ViewCount="56" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/vAFND.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/vAFND.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given a 2-period market with above stock price process along with a riskfree stock with a return of 5%, how do I determine whether the market is arbitrage-free and complete when I only have knowledge of one-period models? Is it enough to determine whether each of the 3 one-period models are arbitrage and complete? And if so, why?&lt;/p&gt;&#xA;" OwnerUserId="20864" LastActivityDate="2016-05-24T14:37:21.893" Title="Arbitrage and completeness in multiperiod model?" Tags="&lt;stochastic-processes&gt;&lt;arbitrage&gt;&lt;asset-pricing&gt;&lt;homework&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26225" PostTypeId="2" ParentId="26221" CreationDate="2016-05-24T15:18:09.457" Score="4" Body="&lt;p&gt;In general $dX^2$ is an ad-hoc or heuristic form of $d\langle X, X\rangle_t$, where $\langle X, X\rangle_t$ is the quadratic variation, which is defined by&#xA;\begin{align*}&#xA;\langle X, X\rangle_t = \lim_{\pi\rightarrow 0} \sum_{i=1}^n (X_{t_i}-X_{t_{i-1}})^2.&#xA;\end{align*}&#xA;Here, $0=t_0 &amp;lt; \cdots &amp;lt; t_n = t$, and $\pi = \max\{ t_i-t_{i-1}, i=1,\ldots, n\}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a Brownian motion $\{W_t, t \ge 0\}$, it can be shown that $\langle W, W\rangle_t = t$. Therefore &#xA;\begin{align*}&#xA;dW^2 = d\langle W, W\rangle_t = dt.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-05-24T15:18:09.457" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="26226" PostTypeId="1" CreationDate="2016-05-24T15:46:03.907" Score="3" ViewCount="74" Body="&lt;p&gt;Has anyone made a serious attempt to  apply option theory to real assets and capital structures, taking into account all the messy details ?&lt;/p&gt;&#xA;" OwnerUserId="20865" LastEditorUserId="11678" LastEditDate="2016-05-25T17:37:59.283" LastActivityDate="2019-05-04T17:30:47.190" Title="Option based approach to real capital structures" Tags="&lt;option-pricing&gt;&lt;capital-structure&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26227" PostTypeId="1" AcceptedAnswerId="26231" CreationDate="2016-05-24T15:59:47.593" Score="3" ViewCount="1746" Body="&lt;p&gt;I am preparing myself for an interview for a quantitative analyst position and one of the sample questions asked in previous examinations was:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Suppose the moon were to disintegrate, and fall to earth over 5000 years. How does this influx of power compare to that of the Sun? Much more, about the same, or much less?&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My idea was to consider the moon as a star and compute its hypothetical flux of energy, but the &quot;fall to earth over 5000 years&quot; puzzles me a bit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would you approach the problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="20866" LastActivityDate="2020-10-02T11:26:28.900" Title="Preparation for interview: influx of power of the moon" Tags="&lt;mathematics&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26228" PostTypeId="2" ParentId="8274" CreationDate="2016-05-24T16:11:56.903" Score="40" Body="&lt;p&gt;The risk-neutral measure &lt;span class=&quot;math-container&quot;&gt;$\mathbb{Q}$&lt;/span&gt; is a mathematical construct which stems from the &lt;em&gt;law of one price&lt;/em&gt;, also known as the &lt;em&gt;principle of no riskless arbitrage&lt;/em&gt; and which you may already have heard of in the following terms: &quot;there is &lt;em&gt;no free lunch&lt;/em&gt; in financial markets&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This law is at the heart of securities' &lt;em&gt;relative valuation&lt;/em&gt;, see this very nice paper by &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1713405&quot; rel=&quot;noreferrer&quot;&gt;Emmanuel Derman&lt;/a&gt; (&quot;Metaphors, Models &amp;amp; Theories&quot;, 2011) and some part of &lt;a href=&quot;https://quant.stackexchange.com/questions/25942/why-arent-econometric-models-used-more-in-quant-finance/25945#25945&quot;&gt;this&lt;/a&gt; discussion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In what follows, assume for the sake of simplicity &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;existence of a risk-free asset ;&lt;/li&gt;&#xA;&lt;li&gt;deterministic and constant rates, with risk-free rate &lt;span class=&quot;math-container&quot;&gt;$r$&lt;/span&gt; ;&lt;/li&gt;&#xA;&lt;li&gt;no dividends and no additional equity funding costs.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How to relate &lt;span class=&quot;math-container&quot;&gt;$\mathbb{Q}$&lt;/span&gt; to &lt;span class=&quot;math-container&quot;&gt;$\mathbb{P}$&lt;/span&gt;: some useful concepts&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;em&gt;risk-neutral&lt;/em&gt; measure &lt;span class=&quot;math-container&quot;&gt;$\mathbb{Q}$&lt;/span&gt; is a probability measure which is &lt;em&gt;equivalent&lt;/em&gt; to &lt;span class=&quot;math-container&quot;&gt;$\mathbb{P}$&lt;/span&gt; and under which the prices of assets (I should rather say the price of self-financing portfolios composed of marketed securities to be perfectly rigorous), discounted at the risk-free rate, turn out to be &lt;em&gt;martingales&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;If one assumes there is no free lunch in the real world (hence under &lt;span class=&quot;math-container&quot;&gt;$\mathbb{P}$&lt;/span&gt;), then the above definition (more specifically the &quot;equivalent&quot; part) suggests that there will be &lt;em&gt;no free lunch under &lt;span class=&quot;math-container&quot;&gt;$\mathbb{Q}$&lt;/span&gt; either&lt;/em&gt;. To convince yourself have a look at the accepted answer to &lt;a href=&quot;https://quant.stackexchange.com/questions/12778/arbitragefree-pricing-q-vs-p&quot;&gt;this&lt;/a&gt; SE question. This answers your question concerning no arbitrage conditions. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The martingale property is convenient since it allows us to represent asset prices as expectations conditional on the information we currenty have, which seems intuitive and natural. Indeed from the definition if &lt;span class=&quot;math-container&quot;&gt;$X_t$&lt;/span&gt; is a &lt;span class=&quot;math-container&quot;&gt;$\mathbb{Q}$&lt;/span&gt;-martingale then&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ X_0 = E^{\mathbb{Q}}[X_t \vert \mathcal{F}_0] $$&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The adjective risk-neutral comes from the fact that, using a &lt;em&gt;replication argument&lt;/em&gt; (static for linear contracts, dynamic for most of the others) and under the assumption of no free lunch (+ market completeness, continuous trading, no frictions), one can show that the true performance of the stock simply disappears from the option valuation problem. Risk aversion thus disappears and only the risk-free rate &lt;span class=&quot;math-container&quot;&gt;$r$&lt;/span&gt; remains. This is exactly what Black-Scholes-Merton showed and which earned them the Nobel prize in the first place, see below.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;A simple example: the Black-Scholes model&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume that the stock price &lt;span class=&quot;math-container&quot;&gt;$S_t$&lt;/span&gt; follows a GBM under &lt;span class=&quot;math-container&quot;&gt;$\mathbb{P}$&lt;/span&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \frac{dS_t}{S_t} = \mu dt + \sigma dW_t^{\mathbb{P}}\ \ \ (1) $$&lt;/span&gt;&#xA;where &lt;span class=&quot;math-container&quot;&gt;$\mu$&lt;/span&gt; is the expected performance of the stock and &lt;span class=&quot;math-container&quot;&gt;$\sigma$&lt;/span&gt; the annualised volatility of log-returns. This equation describes the dynamics of the stock in the real world.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the pricing (we are still under in the real world) of a contingent claim &lt;span class=&quot;math-container&quot;&gt;$V_t = V(t,S_t)$&lt;/span&gt; of which the only thing we know is that it pays out &lt;span class=&quot;math-container&quot;&gt;$\phi(S_T)$&lt;/span&gt; to its holder when &lt;span class=&quot;math-container&quot;&gt;$t=T$&lt;/span&gt; (generic European option). Now, consider the following &lt;em&gt;self-financing&lt;/em&gt; portfolio:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\Pi_t = V_t - \alpha S_t$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using Itô's lemma along with the self-financing property yields:&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align}&#xA;d\Pi_t &amp;amp;= dV_t - \alpha dS_t \\&#xA;       &amp;amp;= \left( \frac{\partial V}{\partial t} + \frac{1}{2}  \sigma^2  S_t^2 \frac{\partial^2 V}{\partial S^2}\right) dt + \left( \frac{\partial V}{\partial S} - \alpha \right) dS_t\\&#xA;\end{align}&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The original argument of Black-Scholes-Merton is then that, if we can dynamically rebalance the portfolio &lt;span class=&quot;math-container&quot;&gt;$\Pi_t$&lt;/span&gt; so that the number of shares held is continuously adjusted to be equal to &lt;span class=&quot;math-container&quot;&gt;$\alpha = \frac{\partial V}{\partial S}$&lt;/span&gt;, then the portfolio &lt;span class=&quot;math-container&quot;&gt;$\Pi_t$&lt;/span&gt; would drift at a deterministic rate which, by absence of arbitrage opportunity, should match the risk-free rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Writing this as &lt;span class=&quot;math-container&quot;&gt;$d\Pi_t = \Pi_t r dt$&lt;/span&gt; and remembering that we've picked &lt;span class=&quot;math-container&quot;&gt;$\alpha = \frac{\partial V}{\partial S}$&lt;/span&gt; to reach this conclusion, we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;\begin{align}&#xA;&amp;amp;d\Pi_t = \Pi_t r dt \\&#xA;\iff&amp;amp; \left( \frac{\partial V}{\partial t} + \frac{1}{2} \sigma^2 S_t^2 \frac{\partial^2 V}{\partial S^2} \sigma^2 \right) dt = \left( V_t - \frac{\partial V}{\partial S} S_t \right) r dt \\&#xA;\iff&amp;amp; \frac{\partial V}{\partial t}(t,S) + r S \frac{\partial V}{\partial S}(t,S) +  \frac{1}{2} \sigma^2 S^2 \frac{\partial^2 V}{\partial S^2}(t,S) - rV(t,S) = 0&#xA;\end{align}&lt;/span&gt;&#xA;which is the famous Black-Scholes pricing equation. Now, the &lt;em&gt;Feynmann-Kac&lt;/em&gt; theorem tells us that the solution to the above PDE can be computed as:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ V_0 = E^\mathbb{Q}[ e^{-rT} \phi(S_T) \vert \mathcal{F}_0 ] $$&lt;/span&gt;&#xA;where under a certain measure &lt;span class=&quot;math-container&quot;&gt;$\mathbb{Q}$&lt;/span&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \frac{dS_t}{S_t} = r dt + \sigma dW_t^{\mathbb{Q}} $$&lt;/span&gt;&#xA;which shows that&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\frac{V_t}{B_t} \text{ and } \frac{S_t}{B_t} \text{ are } \mathbb{Q}\text{-martingales}$$&lt;/span&gt;&#xA;with &lt;span class=&quot;math-container&quot;&gt;$B_t = e^{rt}$&lt;/span&gt; representing the value of the risk-free asset we mentioned in the introduction. Notice how &lt;span class=&quot;math-container&quot;&gt;$\mu$&lt;/span&gt; has completely disappeared from the pricing equation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because this Feynman-Kac formula very much resembles a magical trick, let us zoom in on the change of measure from a more mathematical perspective (the above was indeed the financial argument... at least for deriving the pricing equation, not for expressing its solution in martingale form).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Starting from &lt;span class=&quot;math-container&quot;&gt;$(1)$&lt;/span&gt;, let us define the quantity &lt;span class=&quot;math-container&quot;&gt;$\lambda$&lt;/span&gt; as the excess-return over the risk-free rate of our stock, expressed in volatility units (ie its Sharpe ratio):&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \lambda = \frac{\mu - r}{\sigma} $$&lt;/span&gt;&#xA;Plugging this into &lt;span class=&quot;math-container&quot;&gt;$(1)$&lt;/span&gt; gives:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \frac{dS_t}{S_t} = r dt + \sigma (dW_t^{\mathbb{P}} + \lambda dt)  $$&lt;/span&gt;&#xA;Now &lt;a href=&quot;https://fr.wikipedia.org/wiki/Th%C3%A9or%C3%A8me_de_Girsanov&quot; rel=&quot;noreferrer&quot;&gt;Girsanov theorem&lt;/a&gt; tells us that if we define the Radon-Nikodym of the change of measure as&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \left. \frac{d\mathbb{Q}}{d\mathbb{P}} \right\vert_{\mathcal{F}_t} = \mathcal{E}(-\lambda W_t^{\mathbb{P}}) $$&lt;/span&gt;&#xA;then the process&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ W_t^{\mathbb{Q}} :=  W_t^{\mathbb{P}} - \langle  W^{\mathbb{P}}, -\lambda W^{\mathbb{P}} \rangle_t = W_t^{\mathbb{P}} + \lambda t $$&lt;/span&gt;&#xA;will emerge as a &lt;span class=&quot;math-container&quot;&gt;$\mathbb{Q}$&lt;/span&gt;-Brownian motion, hence we can write:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \frac{dS_t}{S_t} = r dt + \sigma dW_t^{\mathbb{Q}} $$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Okay, this might seem even more magic to you than earlier, but there is a rigorous mathematical treatment behind don't worry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, an interesting feature of writing and manipulating the Radon-Nikodym derivative is that one can eventually show that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$V_0 = E^{\mathbb{Q}} \left[ \left. \frac{V_T}{B_T} \right\vert \mathcal{F}_0 \right] = E^{\mathbb{P}} \left[ \left. \frac{V_T}{B_T} \mathcal{E}(-\lambda W_T^\mathbb{P}) \right\vert \mathcal{F}_0 \right]$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where I have used the &lt;a href=&quot;https://quant.stackexchange.com/questions/10689/bayes-rule-for-conditional-expectations-proof-review&quot;&gt;Bayes' rule for condition expectations&lt;/a&gt;, with &#xA;&lt;span class=&quot;math-container&quot;&gt;$$ X := V_T/B_T,\ \ \ f := \frac{d\mathbb{Q}}{d\mathbb{P}} \vert \mathcal {F}_T = \mathcal{E}(-\lambda W_T^{\mathbb{P}}),\ \ \ E^\mathbb{P}[f \vert \mathcal{F}_0 ] = 1 $$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above result is extremely interesting and can here be re-expressed as&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ V_0 = E^{\mathbb{Q}} \left[ e^{-rT} \phi(S_T) \vert \mathcal{F}_0 \right] = E^{\mathbb{P}} \left[ e^{-\left(r+\frac{\lambda^2}{2}+\frac{\lambda}{T} W_T^{\mathbb{P}}\right)T} \phi(S_T)  \vert \mathcal{F}_0 \right] $$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This shows that, under BS assumptions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The option price can be calculated as an expectation under &lt;span class=&quot;math-container&quot;&gt;$\mathbb{Q}$&lt;/span&gt; in which case we discount cash flows at the risk-free rate.&lt;/li&gt;&#xA;&lt;li&gt;The option price can also be calculated as an expectation under &lt;span class=&quot;math-container&quot;&gt;$\mathbb{P}$&lt;/span&gt; but this time we need to discount cash flows based on our risk-aversion, which transpires through the market risk premium &lt;span class=&quot;math-container&quot;&gt;$\lambda$&lt;/span&gt; (which depends on &lt;span class=&quot;math-container&quot;&gt;$\mu$&lt;/span&gt;). &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This answers your question: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Therefore, in addition to use expected returns, which other adjustment might be needed in order to estimate real-world probabilities?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You need to use a &lt;strong&gt;stochastic discount factor&lt;/strong&gt; accounting for the risk aversion, see above and further remarks below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Estimating real-world probabilities assuming BS&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have different possibilities here. The first idea which springs to mind is to calibrate your diffusion model to observed time series. When doing that, you hope to get an estimate for &lt;span class=&quot;math-container&quot;&gt;$\mu$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$\sigma$&lt;/span&gt; in the GBM case. Now given what we just said earlier, you must be very careful when pricing under &lt;span class=&quot;math-container&quot;&gt;$\mathbb{P}$&lt;/span&gt;: you cannot discount at the risk-free rate. Also obtaining a statistically significant estimation for &lt;span class=&quot;math-container&quot;&gt;$\mu$&lt;/span&gt; (and the latent equity risk premium) may not be as easy as it seems see the discussion &lt;a href=&quot;https://quant.stackexchange.com/a/25957/19887&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;It's more complicated than that when you choose another model than BS&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The relationship:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ V_0 = E^{\mathbb{Q}} \left[ \frac{V_T}{B_T} \vert \mathcal{F}_0 \right] = E^{\mathbb{P}} \left[ \frac{V_T}{B_T} f \vert \mathcal{F}_0 \right] $$&lt;/span&gt;&#xA;with &#xA;&lt;span class=&quot;math-container&quot;&gt;$$f = \left. \frac{d\mathbb{Q}}{d\mathbb{P}} \right\vert_{\mathcal{F}_T}$$&lt;/span&gt;&#xA;will hold (under mild technical conditions). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Compared to the risk-free discount factor&#xA;&lt;span class=&quot;math-container&quot;&gt;$$DF (0,T):=1/B_T $$&lt;/span&gt;&#xA;the quantity&#xA;&lt;span class=&quot;math-container&quot;&gt;$$SDF (0,T):=f/B_T$$&lt;/span&gt;&#xA;is best known as a &lt;strong&gt;Stochastic Discount Factor&lt;/strong&gt; (maybe you've already heard about SDF models, this is precisely that) and we can write, without loss of generality:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ V_0 = E^{\mathbb{Q}} \left[ DF (0,T) V_T \vert \mathcal{F}_0 \right] = E^{\mathbb{P}} \left[ SDF (0,T) V_T \vert \mathcal{F}_0 \right] $$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The problem is that, depending on the model assumptions you use, you cannot always have a simple and/or unique form for &lt;span class=&quot;math-container&quot;&gt;$f$&lt;/span&gt; (hence &lt;span class=&quot;math-container&quot;&gt;$SDF (0,T) $&lt;/span&gt;) as it used to be the case in BS. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is notably the case for incomplete models (i.e. models that include jumps and/or stochastic volatility etc.). So now you understand why when we need models to price options, we directly calibrate them under &lt;span class=&quot;math-container&quot;&gt;$\mathbb{Q}$&lt;/span&gt; and not on time series observed under &lt;span class=&quot;math-container&quot;&gt;$\mathbb{P}$&lt;/span&gt;. &lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2019-07-26T21:39:26.117" LastActivityDate="2019-07-26T21:39:26.117" CommentCount="8" ContentLicense="CC BY-SA 4.0" />
  <row Id="26229" PostTypeId="1" CreationDate="2016-05-24T16:59:04.697" Score="2" ViewCount="34" Body="&lt;p&gt;A book I am reading defines a positive linear functional as a &amp;quot;price functional&amp;quot; from a set of adapted processes to the real numbers. Specifically, it defines a &amp;quot;consistent price functional&amp;quot; as one that gives the value zero to every dividend stream corresponding to any trading strategy. However, it also says that the value of the process &lt;span class=&quot;math-container&quot;&gt;$(1,0,0,0,....)$&lt;/span&gt; can be set to &lt;span class=&quot;math-container&quot;&gt;$1$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Then that means this process is NOT a dividend stream corresponding to some trading strategy. Why not?&lt;/p&gt;&#xA;&lt;p&gt;EDIT: It's from page 59 of &lt;a href=&quot;http://www.math.ku.dk/noter/filer/fin1/ifnotes.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;this notes&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="20867" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-05-25T17:31:26.453" Title="Is $(1,0,0,0,...,0)$ a legitimate dividend stream?" Tags="&lt;option-pricing&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26230" PostTypeId="2" ParentId="26221" CreationDate="2016-05-24T17:49:29.897" Score="2" Body="&lt;p&gt;I don't think just knowing $dW_t\,dW_t=dt$ is enough.We assume&#xA;$$d{{X}_{t}}=\mu (t,{{X}_{t}})dt+\sigma (t,{{X}_{t}})d{{W}_{t}}\,\,\,\,\,(1)$$&#xA;The idea behind the Milstein scheme is that the accuracy of the discretization&#xA;can be increased by expanding the coefficients$\mu =\mu (t,{{X}_{t}})$ and $\sigma =\sigma (t,{{X}_{t}})$ via Ito’s lemma. This is sensible since the coefficients are also functions of $X_t$. Indeed, we can apply Ito’s Lemma to the functions $\mu_t$ and $\sigma_t$ as we would for any differentiable function of $X_t$. By Ito’s lemma, then, the coefficients follow the SDEs&#xA;\begin{align}&#xA;  &amp;amp; d\mu =({{\mu }_{t}}+\mu {{\mu }_{x}}+\frac{1}{2}{{\sigma }^{2}}{{\mu }_{xx}})dt+{{\mu }_{x}}\sigma d{{W}_{t}} \\ &#xA; &amp;amp; d\sigma =({{\sigma }_{t}}+\mu {{\sigma }_{x}}+\frac{1}{2}{{\sigma }^{2}}{{\sigma }_{xx}})dt+{{\sigma }_{x}}\sigma d{{W}_{t}} \\ &#xA;\end{align}&#xA;then&#xA;\begin{align}&#xA;  &amp;amp; \mu (s,{{X}_{s}})=\mu (t,{{X}_{t}})+\int_{t}^{s}{({{\mu }_{u}}+\mu {{\mu }_{x}}+\frac{1}{2}{{\sigma }^{2}}{{\mu }_{xx}})du}+\int_{t}^{s}{{{\mu }_{x}}\sigma d{{W}_{u}}} \\ &#xA; &amp;amp; \sigma (s,{{X}_{s}})=\sigma (t,{{X}_{t}})+\int_{t}^{s}{({{\sigma }_{u}}+\mu {{\sigma }_{x}}+\frac{1}{2}{{\sigma }^{2}}{{\sigma }_{xx}})du}+\int_{t}^{s}{{{\sigma }_{x}}\sigma d{{W}_{u}}} \\ &#xA;\end{align}&#xA;Substitute for $\mu_t$ and $\sigma_t$ inside the integrals of Equation (1), we have &#xA;\begin{align}&#xA;{{X}_{t+\Delta t}}={{X}_{t}}+\int_{t}^{t+\Delta t}{[\mu (t,{{X}_{t}})+\int_{t}^{s}{({{\mu }_{u}}+\mu {{\mu }_{x}}+\frac{1}{2}{{\sigma }^{2}}{{\mu }_{xx}})du}+\int_{t}^{s}{{{\mu }_{x}}\sigma d{{W}_{u}}}]}\,ds \\ &#xA;+\int_{t}^{t+\Delta t}{[\sigma (t,{{X}_{t}})+\int_{t}^{s}{({{\sigma }_{u}}+\mu {{\sigma }_{x}}+\frac{1}{2}{{\sigma }^{2}}{{\sigma }_{xx}})du}+\int_{t}^{s}{{{\sigma }_{x}}\sigma d{{W}_{u}}}]\,d{{W}_{s}}} \\ &#xA;\end{align}&#xA;The differentials higher than order one are $dsdu=\mathcal O(dt^2)$ and $dsdW_u=\mathcal O(dt^{\frac{3}{2}})$ are ignored. The term involving $dW_u dW_s$ is retained since it is $\mathcal O(dt)$, of order&#xA;one. This implies that&#xA;$${{X}_{t+\Delta t}}={{X}_{t}}+\mu (t,{{X}_{t}})\Delta t+\sigma (t,{{X}_{t}})({{W}_{t+\Delta t}}-{{W}_{t}})+\int_{t}^{t+\Delta t}{\int_{t}^{s}{{{\sigma }_{x}}\sigma d{{W}_{u}}}}d{{W}_{s}}\,\,(2)$$&#xA;Apply Euler discretization to the last term in (2) to obtain&#xA;\begin{align}&#xA;  &amp;amp; \int_{t}^{t+\Delta t}{\int_{t}^{s}{{{\sigma }_{x}}\sigma d{{W}_{u}}}}d{{W}_{s}}\approx {{\sigma }_{x}}\sigma \int_{t}^{t+\Delta t}{\int_{t}^{s}{d{{W}_{u}}}}d{{W}_{s}}={{\sigma }_{x}}\sigma \int_{t}^{t+\Delta t}{({{W}_{s}}-{{W}_{t}})}d{{W}_{s}} \\ &#xA; &amp;amp; \quad \quad \quad \quad \quad \quad \quad \quad ={{\sigma }_{x}}\sigma \int_{t}^{t+\Delta t}{{{W}_{s}}\,}d{{W}_{s}}-{{\sigma }_{x}}\sigma ({{W}_{t+\Delta t}}{{W}_{t}}-{{W}_{t}}^{2}) \\ &#xA; &amp;amp; \quad \quad \quad \quad \quad \quad \quad \quad =\frac{1}{2}{{\sigma }_{x}}\sigma (W_{t+\Delta t}^{2}-W_{t}^{2}-\Delta t)-{{\sigma }_{x}}\sigma ({{W}_{t+\Delta t}}{{W}_{t}}-{{W}_{t}}^{2}) \\ &#xA; &amp;amp; \quad \quad \quad \quad \quad \quad \quad \quad =\frac{1}{2}{{\sigma }_{x}}\sigma [{{({{W}_{t+\Delta t}}-{{W}_{t}})}^{2}}-\Delta t]\,\,\,(3)\\ &#xA;\end{align}&#xA;we know ${{W}_{t+\Delta t}}-{{W}_{t}}\overset{d}{\mathop{=}}\,\sqrt{\Delta t}Z$, by substitute (3) in (2) we have&#xA;$${{\widehat{X}}_{t+\Delta t}}={{\widehat{X}}_{t}}+\mu \,\Delta t+\sigma \sqrt{\Delta t}Z+\frac{1}{2}{{\sigma }_{x}}\sigma \Delta t\,({{Z}^{2}}-1)$$ &#xA;as a result&#xA;$$S_{t+\Delta t}=S_t+a(t,S_t)\Delta t+b(t,S_t)\sqrt{\Delta t}\,Z+\frac{1}{2}b(t,S_t)\frac{\partial b(t,S_t)}{\partial S}\Delta t(Z^2-1)$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-05-24T18:09:40.777" LastActivityDate="2016-05-24T18:09:40.777" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26231" PostTypeId="2" ParentId="26227" CreationDate="2016-05-24T17:50:29.547" Score="5" Body="&lt;p&gt;Here's how i'd have at it;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;*&lt;/code&gt; I happen to know these are okay guesses.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;**&lt;/code&gt; Let's assume it's just the potential energy, and that as the point of the &amp;quot;5000 years&amp;quot; part of the question.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The moon came from the earth - likely it's crust since the idea is that it was formed from an impact. The crust of the earth is less dense than the core, so the moon is less dense than the earth. Call it 60% density.&lt;/li&gt;&#xA;&lt;li&gt;The moon is about the same size as a finger nail at arms length.&lt;/li&gt;&#xA;&lt;li&gt;The moon is 240,000 miles away*, my arms are just under 3ft long, and a finger nail is ~1cm in diameter. There are ~5000ft in a mile. Therefore the moon's diameter is &lt;code&gt;240000 x 5000/3 = 4000km&lt;/code&gt; diameter.&lt;/li&gt;&#xA;&lt;li&gt;The earth's radius is 6000km, so it's radius is 3 that of the moon. &lt;span class=&quot;math-container&quot;&gt;$3^3$&lt;/span&gt; is 27 =&amp;gt; the earth weights &lt;code&gt;27/0.6 = 45 ~= 50&lt;/code&gt; times more than the moon.&lt;/li&gt;&#xA;&lt;li&gt;The earth weights 10&lt;span class=&quot;math-container&quot;&gt;$^{25}$&lt;/span&gt;Kg*.&lt;/li&gt;&#xA;&lt;li&gt;potential energy is &lt;span class=&quot;math-container&quot;&gt;$mgh$&lt;/span&gt;. By disintegrating the moon and slowly(5000 years) bringing it down to the earth, we'll be gaining at least it's potential energy**. So this will be &lt;span class=&quot;math-container&quot;&gt;$10^{25}\mathrm{Kg} / 50 \cdot 9.8\mathrm{ms}^{-2} \cdot 240000\mathrm{miles} = 9.8 \cdot 240000 \cdot 10^{25} / 50 \mathrm{Kg\ m\ miles\ s}^{-2} = 10^{34} K m^2 s^{-2} = 10^{33} J$&lt;/span&gt;.&lt;/li&gt;&#xA;&lt;li&gt;There are &lt;span class=&quot;math-container&quot;&gt;$365\ 3600\ 24 =\ \sim30,000,000$&lt;/span&gt; seconds in a year. Power = &lt;span class=&quot;math-container&quot;&gt;$ 10^{33}J / (30000000 \cdot 5000) = 10^{23}W$&lt;/span&gt;&lt;/li&gt;&#xA;&lt;li&gt;Now we go back to the earth bits for a bit, remembering that number. The radius of the earth is 6000Km. So the surface area is &lt;span class=&quot;math-container&quot;&gt;$4 \  \pi \  r^2 = 4 \ \pi \ 6000000^2 = \pi\ 1.32\mathrm{E}^{14} = 5\mathrm{E}^{15}\ \mathrm{m}^2$&lt;/span&gt;&lt;/li&gt;&#xA;&lt;li&gt;Energy per square meter = &lt;span class=&quot;math-container&quot;&gt;$2\cdot10^{7}\ \mathrm{W}$&lt;/span&gt;.&lt;/li&gt;&#xA;&lt;li&gt;It takes 1 calorie to raise 1cm&lt;span class=&quot;math-container&quot;&gt;$^3$&lt;/span&gt; of water by 1 degree. 1 calorie is 4.2J. So per square meter of the earth, we have enough energy to raise &lt;span class=&quot;math-container&quot;&gt;$5\mathrm{E}^6 \mathrm{ml}$&lt;/span&gt;  of water by a degree every second. Or, enough to (raise to a) boil*** &lt;span class=&quot;math-container&quot;&gt;$50\ell$&lt;/span&gt; of water per second per square meter.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;So i'd be saying a lot more.&lt;/p&gt;&#xA;&lt;p&gt;Now, that seems like a lot. It's obviously more that the sun puts out. I'm not sure if i've made any horrible msitakes in here, i'll check later - i'm about to go home. A quick sanity check though, yields that the &lt;a href=&quot;https://en.wikipedia.org/wiki/Vredefort_crater&quot; rel=&quot;nofollow noreferrer&quot;&gt;Vredefort crater&lt;/a&gt; was created by a metoer thought ot have been ~15-20 km in diameter. And that you would have to carve 150 lumps this size from the moon per day to whittle it down to nothing in 5000 years.&lt;/p&gt;&#xA;&lt;p&gt;So that is a &lt;em&gt;lot&lt;/em&gt; of mass that's getting dumped onto the earth each day. Granted, it won't be going as fast, but there's still a lot of substance.&lt;/p&gt;&#xA;&lt;p&gt;This also makes the assumption that &lt;em&gt;all&lt;/em&gt; of the potential energy is converted to heat. I don't think this is likely - what will likely happen is that it will change the angular momentum of the earth such that the total angular momentum of the system stays the same. If you look at the sun and the moon from celestial north, the earth orbits the sun, the moon orbits the earth, and both the earth and the moon rotate - all anti clockwise. Pulling in the moon will make the earth rotate faster and decrease the length of the day.&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;***&lt;/code&gt; ignoring that the energy required to heat water is not constant&lt;/p&gt;&#xA;&lt;p&gt;You also need to ask why it's falling to earth?&lt;/p&gt;&#xA;" OwnerUserId="19663" LastEditorUserId="11723" LastEditDate="2020-10-02T11:26:28.900" LastActivityDate="2020-10-02T11:26:28.900" CommentCount="7" ContentLicense="CC BY-SA 4.0" />
  <row Id="26233" PostTypeId="1" CreationDate="2016-05-24T21:17:32.403" Score="1" ViewCount="86" Body="&lt;p&gt;The title basically says it all. I am looking for a reference text on the pricing of options in a binomial multi-period model. It should be mathemathically rigorous using martingales and conditional expectations yet be self-contained as much as possible. &lt;/p&gt;&#xA;" OwnerUserId="20873" LastActivityDate="2016-06-24T08:57:33.517" Title="Reference for option pricing, binomial multi-period model using martingales and conditional expectations" Tags="&lt;option-pricing&gt;&lt;reference-request&gt;&lt;binomial-tree&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26235" PostTypeId="1" AcceptedAnswerId="26276" CreationDate="2016-05-24T23:19:36.080" Score="4" ViewCount="353" Body="&lt;p&gt;i'm currently a high school student who hasn't gone past Algebra II, and thus I have minimal Calculus knowledge. I know the basics of Integration and Derivation (drop the coefficient, raise to the coefficient), Infinite series, and some basics of random walks (ex. t^0.5 = sigma).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am unable to solve the Black Scholes equation due to it's use of SDEs. I am however familiar with probability theory and have attempted to approximate the CDF of a Gaussian distribution using a Monte Carlo Method. I plugged in the standard deviation and strike price as (strike/sigma) then multiplied by the payout as a percent and added the risk free rate (10 year treasury) times days till expiration divided by 365 (365 days in a year duh). This gave me a value almost equal to the price on the open market. I assume that the inaccuracy is due to loss of precision when retrieving values such as the risk free rate or the asset price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I want to know is whether or not this method of pricing options is viable, or was the semi-successful calculation due to chance? Basically I am seeking peer review since I don't know anyone working in finance who can verify whether I messed up or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My proposed method:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;a function that generates a random number using the Gaussian distribution and if the number is greater than the strike price it adds 0.0001 to an increment variable, otherwise it does not add anything. Repeat 10k times and this approximates the probability of hitting the strike where each random number is one basis point significance.&lt;/li&gt;&#xA;&lt;li&gt;Multiply this probability by the payout in order to find the price where the expected return of the option is zero. &lt;/li&gt;&#xA;&lt;li&gt;Add the interest accrualed by the risk free rate over the period of time that the option is open interest because for some reason this is included in things like Sharpe Ratio and the Black Scholes Model.&lt;/li&gt;&#xA;&lt;li&gt;That value is the option price calculated by this method that seems to fit close with the price of options trading on exchange.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="18578" LastEditorUserId="19887" LastEditDate="2016-05-26T08:38:17.680" LastActivityDate="2016-05-26T17:07:54.653" Title="Is This A Viable Alternative Options Pricing Method?" Tags="&lt;options&gt;&lt;monte-carlo&gt;&lt;asset-pricing&gt;" AnswerCount="1" CommentCount="16" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26237" PostTypeId="2" ParentId="26233" CreationDate="2016-05-25T08:49:37.987" Score="1" Body="&lt;p&gt;If you can get your hands on a physical copy of by &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0387249680&quot; rel=&quot;nofollow&quot;&gt;Stochastic Calculus for Finance I: The Binomial Asset Pricing Model (Springer Finance)&lt;/a&gt; by S. Shreve, I strongly encourage it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you can't, here is an &lt;a href=&quot;http://efinance.org.cn/cn/FEshuo/stochastic.pdf&quot; rel=&quot;nofollow&quot;&gt;electronic document&lt;/a&gt; which adresses exactly the same issues in the first chapters (and a little bit more in the following).&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2016-05-25T08:49:37.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26238" PostTypeId="2" ParentId="26182" CreationDate="2016-05-25T08:54:22.157" Score="7" Body="&lt;p&gt;I would say that $\log K/F$ points towards a log-normal type model. If I were you I would experiment with the moneyness defined as $K-F$ instead. This would make it consistent with normal dynamics. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An alternative would be to define an 'interest rate floor', say $L=-200bp$ and take relative changes relative to that rather than zero, ie define moneyness as $\log (K-L)/(F-L)$. This would correspond to shifted log-normal. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or put an exponent $\beta$ as well and end up with a shifted Sabr. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But for what you describe I'd start with the first suggestion since you work with normal vols in the first place. The other two would require vol transformations to make it work as far as I can see. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2016-05-25T08:59:56.200" LastActivityDate="2016-05-25T08:59:56.200" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26239" PostTypeId="1" AcceptedAnswerId="26242" CreationDate="2016-05-25T11:21:49.817" Score="0" ViewCount="101" Body="&lt;p&gt;The word &quot;benchmark&quot; is often used in Finance, but in a rather fuzzy manner, &lt;a href=&quot;http://www.investopedia.com/terms/b/benchmark.asp?layout=infini&amp;amp;v=5C&amp;amp;adtest=5C&amp;amp;ato=3000&quot; rel=&quot;nofollow&quot;&gt;there for a rough idea of what it is, and how it is 'defined'&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone provide a rigorous and precise definition of what is it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Benchmarks are often used in alternative investment funds to evaluate the performance of a portfolio manager. However, I find the choice of the benchmark of comparison somewhat arbitrary sometimes, and since fees are determined by how much you beat the benchmark, it would make sense to compare what is really comparable... and define precisely what is a financial benchmark, how to build it, or how to choose it?&lt;/p&gt;&#xA;" OwnerUserId="16457" LastActivityDate="2016-05-25T12:04:46.253" Title="What is a definition of &quot;Benchmark&quot;?" Tags="&lt;portfolio-management&gt;&lt;benchmark&gt;&lt;hedge-fund&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26240" PostTypeId="1" CreationDate="2016-05-25T11:34:13.683" Score="11" ViewCount="3136" Body="&lt;p&gt;At maturity $T$, the holder of a &quot;square-or-nothing&quot; call option written on an underlying $S_t$ receives a payoff of the form&#xA;$$ \phi(S_T) = \frac{S_T^2}{K} \pmb{1}_{\{S_T \geq K\}} = \begin{cases}\frac{S_T^2}{K}, &amp;amp;\text{ if }\ \ S_T \geq K, \\&#xA;0, &amp;amp; \text{otherwise}.\end{cases} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume a Black-Scholes diffusion framework where the underlying's risk-neutral drift $\mu$ and volatility $\sigma$ are given. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can one derive a closed-form pricing formula for such an option? &lt;/p&gt;&#xA;" OwnerUserId="20883" LastEditorUserId="11678" LastEditDate="2016-05-25T20:31:58.903" LastActivityDate="2016-05-25T20:31:58.903" Title="How to derive the price of a square-or-nothing call option?" Tags="&lt;options&gt;&lt;pricing&gt;&lt;derivation&gt;&lt;binary&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26241" PostTypeId="2" ParentId="26239" CreationDate="2016-05-25T11:37:55.560" Score="0" Body="&lt;p&gt;One might define a benchmark as the status quo.  If you simply bought all the stocks in the S&amp;amp;P500 for example, you would realize the returns on that index and it takes no active management from you, or a fancy portfolio manager.  It is the default investment strategy, and although it is indeed arbitrary, the usual ones (S&amp;amp;P, Dow, etc.) are often used for equities since they are supposed to be a proxy for the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To see it another way, you'll often hear &quot;underperform&quot; and &quot;outperform&quot; in portfolio management circles, and we need a base case of what we're under or outperforming against.  Since a benchmark is supposed to be the &quot;no skills&quot; strategy, it makes sense to gauge active portfolio managers' performance against such a strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may have also hear of &quot;excess returns&quot;, sometimes defined as $\mu - r$ where $\mu$ is the return rate of an equity and $r$ is the return on a risk-free investment.  The benchmark in this case is an asset with return rate $r$.  Indeed, the rate $r$ is considered guaranteed, so you could &lt;em&gt;always&lt;/em&gt; achieve this, and it makes more sense to gauge an equity's performance with respect to this default investment.&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2016-05-25T11:37:55.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26242" PostTypeId="2" ParentId="26239" CreationDate="2016-05-25T11:50:23.047" Score="1" Body="&lt;p&gt;Some use the acronym SAMURAI: a benchmark should be&lt;/p&gt;&#xA;&#xA;&lt;p&gt;S - Specified in Advance&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A - Appropriate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;M - Measurable&lt;/p&gt;&#xA;&#xA;&lt;p&gt;U - Unambiguous&lt;/p&gt;&#xA;&#xA;&lt;p&gt;R - Reflective of Current Investment Thinking&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A - Accountable&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I - Investable&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In principle it is the responsibility of the decision maker (the board of the pension fund) to set the benchmark, otherwise if the choice is left to the money manager he will of course be tempted to play games. Then the board advertises that it is looking for someone to manage XYZ amount in US equities according to an S&amp;amp;P 500 benchmark and solicits interested firms to compete for this job. That's the model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the retail space it is different and you are right that many mutual funds play games with benchmarks. For example one well known bond fund advertised that it beat its benchmark, which was US Treasury bonds, but the fund also included some mortgage and corporate bonds...&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-05-25T12:04:46.253" LastActivityDate="2016-05-25T12:04:46.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26243" PostTypeId="2" ParentId="26240" CreationDate="2016-05-25T12:04:11.603" Score="8" Body="&lt;p&gt;See this excellent &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2735944&amp;amp;download=yes&quot; rel=&quot;noreferrer&quot;&gt;paper&lt;/a&gt; by @MarkJoshi which defines/discusses the use of &lt;strong&gt;power numeraires&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Starting from a dynamics specified under the risk-neutral measure $\mathbb{Q}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;&amp;amp;\frac{dS_t}{S_t} = (r-q) dt + \sigma dW_t^{\mathbb{Q}}\\&#xA;\iff&amp;amp; S_T\ \vert\ \mathcal{F}_t = S_t e^{(r-q-\frac{\sigma^2}{2})(T-t) + \sigma(W_T-W_t)} \tag{EQ.0}&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us consider the asset (power numéraire)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;N_{t,T} :=&amp;amp;\ \ e^{-r(T-t)} \mathbb{E}^{\mathbb{Q}} \left[S_T^2\ \vert\ \mathcal{F}_t \right] \\&#xA;        =&amp;amp;\ \ S_t^2 e^{\left( r - 2q + \sigma^2 \right)(T-t)} &amp;gt; 0,  \forall t \tag{EQ.1} \in [0,T]        &#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and define the unique equivalent martingale measure $\mathbb{Q}^N$ which uses this asset as numéraire. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the Girsanov theorem (or using the rationale described in the aforementioned paper), it is straightforward to infer the dynamics of the risky asset $S_t$ under the measure $\mathbb{Q}^N$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{dS_t}{S_t} = (r - q + 2\sigma^2) dt + \sigma dW_t^{\mathbb{Q}^N} \tag{EQ.2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;since the Radon-Nikodym happens to compute as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \left. \frac{d\mathbb{Q}^N}{d\mathbb{Q}} \right\vert_{\mathcal{F}_T} = \frac{N_{T,T}\ B_0}{N_{0,T}\ B_T} = \frac{S_T^2}{N_{0,T}\ e^{rT}} = \mathcal{E} \left( 2\sigma W_T^{\mathbb{Q}} \right) \tag{EQ.3} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the notation $\mathcal{E}(X_t)=\exp(X_t-\frac{1}{2}\langle X,X \rangle_t)$ denotes the stochastic exponential.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, the price of square-or-nothing option can be evaluated as&#xA;\begin{align}&#xA;V_0 &amp;amp;= e^{-rT} \mathbb{E}^\mathbb{Q} \left[ \frac{S_T^2}{K} \pmb{1}_{\{ S_T \geq K \}} \ \vert\  \mathcal{F}_0 \right] \\&#xA;    &amp;amp;= e^{-rT} \mathbb{E}^\mathbb{Q^N} \left[ \frac{S_T^2}{K} \pmb{1}_{\{ S_T \geq K \}} \left(\frac{d\mathbb{Q}^N}{d\mathbb{Q}}\big|_{\mathcal{F}_T}\right)^{-1}\ \vert\ \mathcal{F}_0 \right]\ \ \ \text{(change of numéraire)} \\&#xA;    &amp;amp;= N_{0,T} \mathbb{E}^\mathbb{Q^N} \left[ \frac{1}{K} \pmb{1}_{\{ S_T \geq K \}}\ \vert\ \mathcal{F}_0 \right]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \text{(use (EQ.3))} \\&#xA;    &amp;amp;= \frac{N_{0,T}}{K} \mathbb{Q^N}(S_T \geq K)&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At this stage, because we have shown in $\text{(EQ.2)}$ that $S_T$ was lognormally distributed under $\mathbb{Q}^N$, plugging the definition $\text{(EQ.1)}$ of $N_{0,T}$ finally allows us to re-write the above equation as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;V_0 &amp;amp;= \frac{S_0^2}{K} e^{\left( r - 2q + \sigma^2 \right)T} \Phi( d ) \\&#xA;d &amp;amp;= \frac{\ln \left(\frac{S_0}{K}\right) + \left(r-q+\frac{3}{2}\sigma^2\right)T }{\sigma\sqrt{T}}\\&#xA;\Phi(x) &amp;amp;= \mathbb{P}(X \leq x),\ X \sim N(0,1)&#xA;\end{align} &#xA;which is exactly the result given in @Gordon's answer and in Mark Joshi's paper, see middle of page 3.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="11678" LastEditDate="2016-05-25T16:12:21.833" LastActivityDate="2016-05-25T16:12:21.833" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26244" PostTypeId="2" ParentId="26211" CreationDate="2016-05-25T12:58:06.350" Score="1" Body="&lt;p&gt;Thank you gordon! So in addition to the solution you posted, here´s what I actually used in the script where I needed this formula. In the case anyone else can use it:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cov(X,A) = Cov(0.25A+0.25B+0.5C,A) = 0.25Var(A) + 0.25Cov(B,A) + 0.5 Cov(C,A)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Corr(X,A) = Cov(X,A) / sqrt( Var(X)*Var(A) )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;beta[A] = ( vol[A] / vol[X] ) * Corr[X,A]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;have a Good day!&lt;/p&gt;&#xA;" OwnerUserId="20854" LastEditorUserId="20854" LastEditDate="2016-05-29T00:52:06.660" LastActivityDate="2016-05-29T00:52:06.660" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26245" PostTypeId="1" CreationDate="2016-05-25T12:59:29.820" Score="1" ViewCount="669" Body="&lt;p&gt;I have a long form panel for hourly prices of stocks. I want to do log return calculation for this panel data structure. This is sample data:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;&amp;gt; dput(idf)&#xA;  structure(list(Firm = c(&quot;ABC&quot;, &quot;ABC&quot;, &quot;ABC&quot;, &quot;ABC&quot;, &quot;ABC&quot;, &quot;ABC&quot;, &#xA;  &quot;ABC&quot;, &quot;ABC&quot;, &quot;ABC&quot;, &quot;ABC&quot;, &quot;ABC&quot;, &quot;ABC&quot;, &quot;XYZ&quot;, &quot;XYZ&quot;, &quot;XYZ&quot;, &#xA;  &quot;XYZ&quot;, &quot;XYZ&quot;, &quot;XYZ&quot;, &quot;XYZ&quot;, &quot;XYZ&quot;, &quot;XYZ&quot;, &quot;XYZ&quot;, &quot;XYZ&quot;, &quot;XYZ&quot;&#xA;  ), Date = structure(c(1451642400, 1451646000, 1451649600, 1451653200, &#xA;  1451656800, 1451660400, 1451901600, 1451905200, 1451908800, 1451912400, &#xA;  1451916000, 1451919600, 1451642400, 1451646000, 1451649600, 1451653200, &#xA;  1451656800, 1451660400, 1451901600, 1451905200, 1451908800, 1451912400, &#xA;  1451916000, 1451919600), tzone = &quot;UTC&quot;, class = c(&quot;POSIXct&quot;, &#xA;  &quot;POSIXt&quot;)), Price = c(1277, 1273.25, 1273.85, 1273.75, 1272, &#xA;  1265.35, 1248.1, 1242, 1248.15, 1241.1, 1246.5, 1242.5, 225.7, &#xA;  225.5, 225.45, 228.6, 227.7, 227.8, 225.1, 222.35, 222.25, 221.1, &#xA;  221.2, 220.7), rt = c(NA, -0.0029408902678254, 0.000471124032113579, &#xA;  -7.8505259892836e-05, -0.00137484063686699, -0.00524170116535849, &#xA;  -0.0137263688103015, -0.00489941143098349, 0.00493947152112462, &#xA;  -0.00566437187907365, 0.00434154082813709, -0.00321414499282824, &#xA;  NA, -0.000886524880757023, -0.000221754075639957, 0.0138753464936165, &#xA;  -0.00394477829101625, 0.000439077943387822, -0.0119233031003949, &#xA;  -0.0122920309559813, -0.000449842562691316, -0.00518778653061336, &#xA;  0.000452181784779349, -0.00226295638548901), day = structure(c(16801, &#xA;  16801, 16801, 16801, 16801, 16801, 16804, 16804, 16804, 16804, &#xA;  16804, 16804, 16801, 16801, 16801, 16801, 16801, 16801, 16804, &#xA;  16804, 16804, 16804, 16804, 16804), class = &quot;Date&quot;)), .Names = c(&quot;Firm&quot;, &#xA;  &quot;Date&quot;, &quot;Price&quot;, &quot;rt&quot;, &quot;day&quot;), row.names = c(NA, -24L), class = c(&quot;tbl_df&quot;, &#xA;  &quot;data.frame&quot;))&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Below is my code:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;ret = function(x) c(NA,diff(log(x)), NA)&#xA;  df$RT = ave(idf$Price, df$Firm, FUN = ret)&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Is it fine as I did above or should I first convert the long panel to wide panel, and estimate log return columns using for loop or apply functions to &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Return.calculate(x, method=&quot;compound&quot;)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;(from PerformanceanAlytics package)&#xA;and finally, convert it back to long form. Or is there any other way. Thanks&lt;/p&gt;&#xA;" OwnerUserId="15390" LastEditorUserId="15390" LastEditDate="2016-06-23T08:24:48.073" LastActivityDate="2016-06-23T08:24:48.073" Title="R:log return calculation for panel data structure" Tags="&lt;r&gt;&lt;returns&gt;&lt;log-returns&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26246" PostTypeId="2" ParentId="26240" CreationDate="2016-05-25T13:15:57.997" Score="12" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I provided an answer, based on an elementary approach,  to an exactly same question yesterday. However, that question has disappeared, even though I like to keep a record for what I wrote.  I would suggest that people do not delete their questions as they may be helpful for others. Here, I re-post that answer.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;We assume that, under the risk-neutral measure,&#xA;\begin{align*}&#xA;S_T= S_0e^{(\mu-\frac{1}{2}\sigma^2)T + \sigma \sqrt{T}Z},&#xA;\end{align*}&#xA;where $Z$ is a standard normal random variable. Let&#xA;\begin{align*}&#xA;d_1 = \frac{\ln \frac{S_0}{K} + (\mu+\frac{1}{2}\sigma^2)T }{\sigma\sqrt{T}},&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;d_2 = \frac{\ln \frac{S_0}{K} + (\mu-\frac{1}{2}\sigma^2)T }{\sigma\sqrt{T}}.&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;e^{-rT}E\left(\frac{S_T^2}{K}\pmb{1}_{S_T &amp;gt;K} \right) &amp;amp;= \frac{e^{-rT} S_0^2}{K}E\left(e^{(2\mu-\sigma^2)T + 2\sigma \sqrt{T}Z}\pmb{1}_{S_0e^{(\mu-\frac{1}{2}\sigma^2)T + \sigma \sqrt{T}Z} &amp;gt;K} \right)\\&#xA;&amp;amp;= \frac{e^{(-r +2\mu-\sigma^2)T} S_0^2}{K}E\left(e^{2\sigma \sqrt{T}Z}\pmb{1}_{Z &amp;gt;-d_2} \right)\\&#xA;&amp;amp;=\frac{e^{(-r +2\mu-\sigma^2)T} S_0^2}{K}\int_{-d_2}^{\infty} e^{2\sigma \sqrt{T}z} \frac{1}{\sqrt{2\pi}} e^{-\frac{z^2}{2}}dz\\&#xA;&amp;amp;=\frac{e^{(-r +2\mu-\sigma^2)T} S_0^2}{K} \frac{1}{\sqrt{2\pi}}\int_{-d_2}^{\infty} e^{-\frac{1}{2}(z- 2\sigma \sqrt{T})^2 + 2 \sigma^2 T} dz\\&#xA;&amp;amp;= \frac{e^{(-r +2\mu+\sigma^2)T} S_0^2}{K}\frac{1}{\sqrt{2\pi}}\int_{-d_2- 2\sigma \sqrt{T}}^{\infty} e^{-\frac{1}{2}x^2} dx\\&#xA;&amp;amp;= \frac{e^{(-r +2\mu+\sigma^2)T} S_0^2}{K}\Phi(d_2+ 2\sigma \sqrt{T})\\&#xA;&amp;amp;= \frac{e^{(-r +2\mu+\sigma^2)T} S_0^2}{K}\Phi(d_1+ \sigma \sqrt{T}),&#xA;\end{align*}&#xA;where $\Phi$ is the cumulative distribution function of a standard normal random variable.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-05-25T14:28:35.453" LastActivityDate="2016-05-25T14:28:35.453" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26247" PostTypeId="1" CreationDate="2016-05-25T13:39:29.273" Score="2" ViewCount="39" Body="&lt;p&gt;If we invest $w$ in the market portfolio and $1 - w$ in the risk-free asset, and observe a $0$-beta asset with expected return greater than the return on the risk-free asset, how can this be used in diversification to reduce risk?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My initial confusion is due to the expected return being greater than the risk-free asset. In equilibrium (i.e., CAPM), this is not possible since the expected returns on the two should be equal?&lt;/p&gt;&#xA;" OwnerUserId="20886" LastEditorUserId="11678" LastEditDate="2016-05-25T17:29:39.103" LastActivityDate="2016-05-25T17:29:39.103" Title="$0$-beta stock and diversification" Tags="&lt;diversification&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26251" PostTypeId="1" AcceptedAnswerId="26253" CreationDate="2016-05-25T15:40:20.910" Score="0" ViewCount="188" Body="&lt;p&gt;I am reading through the documentation of statsmodel package in python from the &lt;a href=&quot;http://statsmodels.sourceforge.net/stable/generated/statsmodels.tsa.arima_model.ARMA.html#statsmodels.tsa.arima_model.ARMA&quot; rel=&quot;nofollow&quot;&gt;link&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The (p,q) order of the model for the number of AR parameters, differences, and MA parameters to use.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How do I specify the order for ARMA(2,5); ARIMA(2,1,4), AR(2) and MA(6)? I am not able to figure from the document explanation.&lt;/p&gt;&#xA;" OwnerUserId="19665" LastActivityDate="2016-05-25T21:32:02.780" Title="Python statsmodel ARMA question" Tags="&lt;python&gt;&lt;arma&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26252" PostTypeId="1" CreationDate="2016-05-25T15:57:16.840" Score="1" ViewCount="380" Body="&lt;p&gt;I know that a multi-period market model is complete and arbitrage free if there's a &lt;strong&gt;unique equivalent martingale measure&lt;/strong&gt;. The thing is, I have absolutely no clue how to apply this theorem to a simple binomial tree. I just don't get what the two things even have to do with one another. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, consider:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://4.bp.blogspot.com/-6iYbDklTmeU/TdGDNaFzNbI/AAAAAAAADEY/CnQABgAMO9s/s320/binomial_tree.png&quot; alt=&quot;3&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yes, I know that $u = 1.1$. I know that $d = 0.9$. But what does this have anything to do with the complicated theorem which talks about conditional expectations and equivalent martingale measures? I guess $q = (R - d)/(u-d)$ and $1 - q$ is this equivalent martingale measure but why? And why is it unique?&lt;/p&gt;&#xA;" OwnerUserId="20887" LastEditorUserId="-1" LastEditDate="2017-03-10T09:42:46.323" LastActivityDate="2016-05-26T05:38:03.710" Title="How is the fundamental theorem of asset pricing used?" Tags="&lt;option-pricing&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26253" PostTypeId="2" ParentId="26251" CreationDate="2016-05-25T16:34:40.437" Score="1" Body="&lt;p&gt;For &lt;code&gt;ARIMA(2,1,4)&lt;/code&gt; you would need to use the ARIMA model, &lt;a href=&quot;http://statsmodels.sourceforge.net/0.6.0/generated/statsmodels.tsa.arima_model.ARIMA.html&quot; rel=&quot;nofollow&quot;&gt;as described here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You would call with something like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ARIMA(endog, order = (2, 1, 4))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;endog&lt;/code&gt; is your endogenous variable and the tuple given for &lt;code&gt;order&lt;/code&gt; follows the convention AR, Differencing, MA.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For &lt;code&gt;ARMA(1, 1)&lt;/code&gt; you could just use &lt;code&gt;ARMA(endog, order = (1, 1))&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="848" LastEditDate="2016-05-25T21:32:02.780" LastActivityDate="2016-05-25T21:32:02.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26255" PostTypeId="1" CreationDate="2016-05-25T17:38:01.220" Score="2" ViewCount="1238" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;I know that if the order of Arch(m) is over 3, we should use GARCH and GARCH(1,1) was proved to be the best. But was GARCH(1,1) proved to be available for any country's stock market? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;My result show that GARCH(1,1) is not statistically significant (although i bsed on the result of ACF/PACF of Squared error). However, the Garch(2,1) (3,1) (4,1) (5,1) (6,1) (7,1) (8,1) are statistically significant.  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Consequently, i conflict that the method based on the ACF/PACF of the Squared return or Squared error to define the Order of GARCH are not available. How can we estimate the order of GARCH(m.s)? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="20889" LastActivityDate="2016-06-29T10:04:35.380" Title="Define the order of GARCH(m.s)" Tags="&lt;garch&gt;&lt;arch&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26257" PostTypeId="1" AcceptedAnswerId="41927" CreationDate="2016-05-25T18:06:36.940" Score="3" ViewCount="1097" Body="&lt;p&gt;I am trying to regenerate the ARMA parameters from statsmodel in python. The code I am using is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;from statsmodels.tsa.arima_process import arma_generate_sample&#xA;import statsmodels.api as sm&#xA;arparams = np.array([.75, -.25])&#xA;maparams = np.array([.65, .35])&#xA;arparams = np.r_[1, -arparams]&#xA;maparam = np.r_[1, maparams]&#xA;nobs = 250&#xA;np.random.seed(2014)&#xA;y = arma_generate_sample(arparams, maparams, nobs) #generate ARMA series&#xA;res = sm.tsa.arma_order_select_ic(y, ic=['aic', 'bic'], trend='nc')&#xA;z = sm.tsa.ARMA(y, (2,2)).fit()&#xA;print z.arparams&#xA;array([ 0.13178508,  0.08568388])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The regenerated AR params are not same as the one I started with. What am I doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="19665" LastActivityDate="2018-09-26T14:42:24.927" Title="Python regenerating ARMA params using statsmodels" Tags="&lt;python&gt;&lt;arma&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26258" PostTypeId="1" CreationDate="2016-05-25T20:12:27.703" Score="3" ViewCount="6398" Body="&lt;p&gt;We're looking to build a pricer to convert a funding spread in a given currency over a specific funding basis e.g. 20 bps EUR 3m€ and convert it to a funding spread to a different currency with a different funding basis say USD 6m$L.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We're in the process of sourcing market swap data including discount factors for EONIA, FedFund and LIBOR for different tenors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking for someone to help us with this, could even turn into a paid project, basically I'm totally lost!&#xA;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="20890" LastActivityDate="2018-09-25T03:19:53.590" Title="How to build a cross currency swap pricer?" Tags="&lt;interest-rates&gt;&lt;swaps&gt;&lt;quantlib&gt;&lt;interest-rate-swap&gt;&lt;quants&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26259" PostTypeId="1" CreationDate="2016-05-25T22:01:54.277" Score="1" ViewCount="256" Body="&lt;p&gt;Let's say I want to use a Gaussian copula &#xA;$$C_{R_t}(\eta_1, ..., \eta_n) = N_{R_t}(N^{-1}(\eta_1), ...,N^{-1}(\eta_n))$$&#xA;with a time-varying correlation matrix $R_t$. Through DCC we model the correlation which evolves as&#xA;$$Q_t=(1-\alpha-\beta)\overline{Q}+\beta Q_{t-1} + \alpha \epsilon^{*}_{t-1} \epsilon^{*T}_{t-1}$$&#xA;where $\epsilon_t^*=N^{-1}(\eta_t)$. The components $r_{ij,t}$ of $R_t$ is then obtained after normalization&#xA;$$r_{ij,t}=\frac{q_{ij, t}}{\sqrt{q_{ii,t}q_{jj,t}}}$$&#xA;(see &lt;a href=&quot;http://www.frbsf.org/economic-research/files/christoffersen.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.frbsf.org/economic-research/files/christoffersen.pdf&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say that, instead of using some built-in commands in R (such as cgarchspec and cgarchfit from &lt;code&gt;rmgarch&lt;/code&gt; package), I'd want to write a function in R to do this. Specifically, I want R to i) compute $Q_t$, which is measurable at time $t-1$ given previous initial values; ii) convert it in $R_t$ as defined above; iii) and use it as input to generate $N$ random draws from the Gaussian copula at time $t$. Next, I would like R to repeat steps i-iii for $t+1$ using values estimated in $t$, in $t+2$ using $t+1$ data, and so on until $t+d$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would something like this look like? Anyone has a hint, or any link that would introduce me to such multi-level equation? I beg you to pardon my R ignorance but I've never come across such an exercise during my studies and now I'm totally lost. Moreover, I'd like to implement something similar using other copula families, that's why I want to get the basics writing down the equation for the Gaussian one rather than just using the built-in commands. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any hint is appreciated, thank you in advance!&lt;/p&gt;&#xA;" OwnerUserId="20573" LastActivityDate="2016-05-25T22:01:54.277" Title="How to write time-varying functions in R? Applied example" Tags="&lt;time-series&gt;&lt;r&gt;&lt;copula&gt;&lt;dynamic&gt;&lt;joint-probability&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26260" PostTypeId="1" CreationDate="2016-05-25T22:36:13.773" Score="6" ViewCount="2048" Body="&lt;p&gt;With regards to a cross-sectional asset pricing (stocks) study, I am testing if one variable can explain another. One common approach to do this, is to use the double-sorting portfolio technique (sort on variable a into portfolios, then dependent on a - sort b into portfolio). This approach seems to be adequate for such a problem, if you have a large sample so that you get reasonable amount of dispersion in your sort variables. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another approach I have seen in the literature is to create factors of your preferred explanatory variables by using the Fama French factor methodology (HML,SML etc), then sort you portfolios on the first variable (the variable you would like to explain) and run time series regression of a Fama French three factor model (or CAPM) augmented with your new factor. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am wonder if there are any arguments for performing the second over the first approach? Could these approaches complement each other,&lt;/p&gt;&#xA;" OwnerUserId="17366" LastEditorUserId="17366" LastEditDate="2016-05-26T11:54:20.553" LastActivityDate="2019-09-02T11:02:40.387" Title="&quot;Risk&quot; Factor vs Double Sorts" Tags="&lt;capm&gt;&lt;fama-french&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26261" PostTypeId="2" ParentId="26252" CreationDate="2016-05-26T00:04:12.690" Score="2" Body="&lt;p&gt;well solve for the value of $q$ that makes the value of the stock divided by the bond be a martingale. You will find that only one value does so. It is the one you posted. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you then define the discounted value of an option to be its expectation of the discounted pay-off, its discounted value is a martingale. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the discounted value of everything is a martingale. Arbitrages cannot be martingales since a martingale of zero initial value has expectation zero. So there are no arbitrages under the q measure. But the set of arbitrages doesn't change with probability so there are no arbitrages under any equivalent measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(my book &quot;concepts&quot; goes into this stuff in gory detail.)&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2016-05-26T00:04:12.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26263" PostTypeId="1" CreationDate="2016-05-26T02:10:19.000" Score="1" ViewCount="119" Body="&lt;p&gt;My question is not about hidden orders in general. In equity market a trader can post his hidden order inside spread, is it the same way for E-mini S&amp;amp;P 500?&lt;/p&gt;&#xA;" OwnerUserId="20585" LastActivityDate="2016-05-26T02:10:19.000" Title="Is it possible to place hidden order inside spread when trading E-mini S&amp;P 500?" Tags="&lt;options&gt;&lt;limit-order-book&gt;&lt;order&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26264" PostTypeId="2" ParentId="15409" CreationDate="2016-05-26T02:53:55.367" Score="0" Body="&lt;p&gt;I have many materials about GARCH model (Applied Time series econometrics,page198 ; Econometrics by example- Damodar Gujarati p.238; Introductory econometrics for finance - Chris Brooks p.379) to figure out the Order of Garch(m,s). ​&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-All indicate that if the order of ARCH is over 3, use GARCH. And as the order of ARCH increases to infinity, ARCH(m) is equivalent to GARCH(1,1).&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Also, GARCH(1,1) is proved to be useful to model the return of financial asset and rarely used in any higher order model.​ - But my result show that the coefficent of mean equation (Logreturn)is not significant with the P of 0.148. It show the rejection of GARCH(1,1). But another GARCH(2,1) and (3,1) is significant. Please give me suggestion ! Thank you!&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="20889" LastActivityDate="2016-05-26T02:53:55.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26265" PostTypeId="2" ParentId="15409" CreationDate="2016-05-26T02:56:24.430" Score="0" Body="&lt;p&gt;I know that if the order of Arch(m) is over 3, we should use GARCH and GARCH(1,1) was proved to be the best. But was GARCH(1,1) proved to be available for any country's stock market? &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;My result show that GARCH(1,1) is not statistically significant. However, the Garch(2,1) (3,1) (4,1) (5,1) (6,1) (7,1) (8,1) are statistically significant.  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Consequently, i conflict that the method based on the ACF/PACF of the Squared return or Squared error to define the Order of ARCH are not available. How can we estimate the order of GARCH(m.s)? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="20889" LastActivityDate="2016-05-26T02:56:24.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26266" PostTypeId="2" ParentId="26252" CreationDate="2016-05-26T04:58:57.200" Score="1" Body="&lt;p&gt;We know the market model is arbitrage free if and only if there exists&#xA;a martingale measure $Q$, also the Binomial Model is free of arbitrage if and only if $d\le 1+R\le u\,\,$ (&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/019957474X&quot; rel=&quot;nofollow&quot;&gt;Arbitrage Theory in Continuous Time&lt;/a&gt;).It is easy to calculate the martingale probabilities.This Condition is equivalent to saying that $1 + R$ is a convex combination of $u$ and $d$ , i.e. &#xA;$$1+R=u\,{{q}_{u}}+d\,{{q}_{d}}$$&#xA;On the other hand $\,{{q}_{d}}+{{q}_{u}}=1$ then &#xA;$$\left\{ \begin{align}&#xA;  &amp;amp; u\,{{q}_{u}}+d\,{{q}_{d}}=1+R \\ &#xA; &amp;amp; {{q}_{u}}+\,{{q}_{d}}=1 \\ &#xA;\end{align} \right.$$&#xA;$$\Rightarrow \left\{ \begin{align}&#xA;  &amp;amp; {{q}_{u}}=\frac{\left| \begin{matrix}&#xA;   1+R &amp;amp; d  \\&#xA;   1 &amp;amp; 1  \\&#xA;\end{matrix} \right|}{\left| \begin{matrix}&#xA;   u &amp;amp; d  \\&#xA;   1 &amp;amp; 1  \\&#xA;\end{matrix} \right|}=\frac{1+R-d}{u-d} \\ &#xA; &amp;amp; {{q}_{d}}=\frac{\left| \begin{matrix}&#xA;   u &amp;amp; 1+R  \\&#xA;   1 &amp;amp; 1  \\&#xA;\end{matrix} \right|}{\left| \begin{matrix}&#xA;   u &amp;amp; d  \\&#xA;   1 &amp;amp; 1  \\&#xA;\end{matrix} \right|}=\frac{u-(1+R)}{u-d} \\ &#xA;\end{align} \right.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Also you can read the second edition of &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0521514088&quot; rel=&quot;nofollow&quot;&gt;Joshi's Book&lt;/a&gt; , it is so good.)&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-05-26T05:38:03.710" LastActivityDate="2016-05-26T05:38:03.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26267" PostTypeId="1" CreationDate="2016-05-26T06:15:58.850" Score="3" ViewCount="498" Body="&lt;p&gt;My definition of batch-trading: Given $N$ BUY orders, $M$ SELL orders and $O$ ($O &amp;lt; N$) as the max number of open positions to be held. Batch-trading should monitor the orders and when $O$ BUY orders are filled it would cancel the $N-O$ BUY Orders.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To perform this, below is the pseudo-code:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;for every PositionMessage that comes in:&#xA;     if number_of_filled_openpositions &amp;gt;= Max:&#xA;       // cancel is performed only ONCE, I set a &quot;flag&quot; to make sure &#xA;       // cancel is called only once during this entire process&#xA;        cancel_unfilled_BUY_orders_one_by_one()&#xA;       // OpenPositions have a TimeUpdated field,&#xA;       // Sell order will be generated starting from the last filled orders&#xA;       // Sell order is generated only after the position is fully filled&#xA;        Sell_excess_filled_orders()&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem I am facing now is, depending on the day, I might get &lt;em&gt;correct&lt;/em&gt; number of cancellations and &lt;em&gt;correct&lt;/em&gt; number of excess_positions_sold. But on other days, I sometimes run into &lt;code&gt;max number of messages exceeds limit..&lt;/code&gt; or &lt;code&gt;remote host forcibly disconnected your connection&lt;/code&gt; or incorrect number of cancellation or excess_filled_sold.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried introducing a &lt;code&gt;time-delay&lt;/code&gt; within &lt;code&gt;cancel_unfilled_BUY_orders_one_by_one()&lt;/code&gt; so that each cancel order is sent after a time-delay.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am finding it hard to debug because I need the market-to-be-open to test exhaustively, which is 00:00 (midnight) for me and on weekends the markets are not open (this is a hobby project).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What else should I consider? what am I missing? Has anyone else tried doing something similar?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Happy to elaborate more if required.     &lt;/p&gt;&#xA;" OwnerUserId="20897" LastActivityDate="2018-10-17T20:00:42.983" Title="How to perform batch-trading using Interactive Broker API?" Tags="&lt;programming&gt;&lt;automated-trading&gt;&lt;interactive-brokers&gt;&lt;order-handling&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26268" PostTypeId="2" ParentId="21462" CreationDate="2016-05-26T07:21:46.757" Score="5" Body="&lt;p&gt;The SABR model of &lt;a href=&quot;http://www.math.ku.dk/~rolf/SABR.pdf&quot; rel=&quot;noreferrer&quot;&gt;Hagan&lt;/a&gt; is described by the following Stochastic differential equations:&#xA;$$\begin{align}&#xA;  &amp;amp; d{{f}_{t}}={{\alpha }_{t}}f_{t}^{\beta }d{{W}_{t}}^{1} \\ &#xA; &amp;amp; d{{\alpha }_{t}}=v\,{{\alpha }_{t}}d{{W}_{t}}^{2} \\ &#xA; &amp;amp; {{E}^{Q}}[d{{W}_{t}}^{1},d{{W}_{t}}^{2}]=\rho dt \\ &#xA;\end{align}$$&#xA;In these equations, $f_t$ is the forward rate, $\alpha$ is the initial variance, $\beta$ is the exponent for the forward rate and $v$ is the volatility of variance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is well-known the prices of European call options in the SABR model are given by Black's model. For a current forward rate $f$, strike $K$, and implied volatility $\sigma_{B}$ the price of a European call option with maturity $T$ is&#xA;$$C(f,K,{{\sigma }_{\beta }},T)={{e}^{-rT}}(f\,N({{d}_{1}})-K\,N({{d}_{2}}))$$&#xA;where&#xA;\begin{align}&#xA;  &amp;amp; {{d}_{1}}=\frac{\ln \left( \frac{f}{K} \right)+\frac{1}{2}\sigma _{B }^{2}T}{{{\sigma }_{B }}\sqrt{T}} \\ &#xA; &amp;amp; {{d}_{2}}=\frac{\ln \left( \frac{f}{K} \right)-\frac{1}{2}\sigma _{B}^{2}T}{{{\sigma }_{B }}\sqrt{T}} \\ &#xA;\end{align}&#xA;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/vRnR9.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/vRnR9.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Estimating $\alpha$, $\rho$ and v&lt;/strong&gt;:&#xA;This can be accomplished by minimizing the errors between the model and market volatilities {$\sigma_{i}^{market}$}(from interest rate derivatives, for example) with identical maturity T. Hence, for example, we can use SSE, which produces&#xA;$$(\widehat{\alpha },\widehat{\rho },\widehat{v})=\underset{\alpha ,\rho ,v}{\mathop{\arg \min }}\,{{\sum\limits_{i}{\left( \sigma _{i}^{market}-{{\sigma }_{B }}({{f}_{i}},{{K}_{i}};\alpha ,\rho ,v) \right)}}^{2}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Estimating $\beta$:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The at-the-money volatility $\sigma_{ATM}$ is obtained by setting $f = K$ in equation $\sigma (K,\beta)$, which produces&#xA;$${{\sigma }_{ATM}}={{\sigma }_{\beta }}(f,f)=\frac{\alpha \left( 1+\left[ \frac{{{(1-\beta )}^{2}}}{24}\times \frac{{{\alpha }^{2}}}{{{f}^{2-2\beta }}}+\frac{1}{4}\frac{\rho \beta v\alpha }{{{f}^{1-\beta }}}+\frac{2-3{{\rho }^{2}}}{24}{{v}^{2}} \right]T \right)}{{{f}^{1-\beta }}}$$&#xA;Taking logs produces&#xA;$$\ln {{\sigma }_{ATM}}\approx \ln \alpha -(1-\beta )\ln f$$&#xA;&lt;strong&gt;Edit for Gordon&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, the choice of $\beta$ has little effect on the resulting shape&#xA;of the volatility curve produced by the SABR model, so the choice of is not&#xA;crucial. The choice of $\beta$, however, can affect the Greeks. &lt;a href=&quot;http://lesniewski.us/papers/published/HedgingUnderSABRModel.pdf&quot; rel=&quot;noreferrer&quot;&gt;Barlett&lt;/a&gt; provides more accurate Greeks and shows that they are less sensitive to the choice of $\beta$.Indeed The case  $\beta=0$ produces the stochastic normal model, $\beta=1$ produces the stochastic log-normal model, $\beta=\frac{1}{2}$ produces the stochastic CIR model.&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-05-26T17:34:39.787" LastActivityDate="2016-05-26T17:34:39.787" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26271" PostTypeId="2" ParentId="26258" CreationDate="2016-05-26T10:47:24.037" Score="2" Body="&lt;p&gt;You don't need all the discount factors.  You just need the currency basis swap market, which exists precisely for this purpose.   For example if the 5 yr eur/usd currency basis is -25, it means that you can exchange a euribor-25 liability for a usd libor flat liability.   These swaps also have an exchange of principal amounts at the start and end to convert the debt synthetically from euro to dollars.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So your eur+20 liability would become a usdlibor+ 45 liability in dollars. &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-05-26T10:47:24.037" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26272" PostTypeId="1" AcceptedAnswerId="26273" CreationDate="2016-05-26T13:27:04.513" Score="2" ViewCount="263" Body="&lt;p&gt;Hi I was wondering what is the model that best describes the price movement of the stock market?&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;A Brownian motion Process with drift? &lt;/li&gt;&#xA;&lt;li&gt;An Ornstein Uhlenbeck_process?&#xA;    (where the long term mean is described by an ax+b function for the&#xA;    drift component)  &lt;/li&gt;&#xA;&lt;li&gt;A model that uses stochastic volatility?&lt;/li&gt;&#xA;&lt;li&gt;Jump Diffusion Models?&lt;/li&gt;&#xA;&lt;li&gt;Or something else?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;(I placed these 4 points to act as multiple choice bullets. I don't know how to make this question more specific, that is what I want to know, which model best fits the stock market. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which model more realistically fits the stock market, which one will show volatility clustering, price appreciation, market shocks(jump diffusion),  show leptokurtic distributions, mean reversion etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see many models used but I haven't yet seen which one is standard for realistic simulations. I placed the 4 points up there as a guide to which class of mathematical models I'm referring to.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I realize that there can be many good ways to answer this question. I believe though that only a few models will approximate the way the stock market moves and behaves. So IDK.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="20904" LastEditorUserId="20904" LastEditDate="2016-06-02T22:44:45.137" LastActivityDate="2016-06-02T22:44:45.137" Title="Modeling the Stock Market" Tags="&lt;equities&gt;&lt;stochastic-processes&gt;&lt;brownian-motion&gt;&lt;mean-reversion&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ClosedDate="2016-05-30T13:58:26.430" ContentLicense="CC BY-SA 3.0" />
  <row Id="26273" PostTypeId="2" ParentId="26272" CreationDate="2016-05-26T14:08:45.623" Score="1" Body="&lt;p&gt;Given the well-known &lt;a href=&quot;http://www.proba.jussieu.fr/pageperso/ramacont/papers/empirical.pdf&quot; rel=&quot;nofollow&quot;&gt;stylised facts&lt;/a&gt; of equity markets, I would go for a generic stochastic volatility model where&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;log-asset prices, hence geometric returns, are driven by a standard Brownian motion (although this would explain the lack of returns' auto-correlation, it would also boil down to assuming their independence, which is a stronger assumption).&lt;/li&gt;&#xA;&lt;li&gt;volatility of returns is stochastic (would explain heavy tails), mean-reverting (would explain volatility clustering), negatively correlated to the spot evolution (would explain skew). Some may even consider modeling (log-)volatility using fractional Brownian motions instead of standard Brownian motions (better emprical behaviour).&lt;/li&gt;&#xA;&lt;li&gt;volatility and price should be subject to random jumps both in timing and in size (blame it on Murphy's law). Common practice is to use compound Poisson processes to model that feature.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Now, if you are working under the real-world measure and looking at using such a model for forecasting purpose, the complex parts is how exactly would you calibrate such a model to historical data?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are on the other hand working under the risk-neutral measure and that you (manage to decently) calibrate your model to observed vanilla option prices, the question is then, how to can you guarantee that your model will also embed a plausible forward smile dynamics so that it produces decent prices for more exotic structures?&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-05-26T14:37:28.937" LastActivityDate="2016-05-26T14:37:28.937" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26274" PostTypeId="1" AcceptedAnswerId="26283" CreationDate="2016-05-26T16:02:36.650" Score="1" ViewCount="785" Body="&lt;p&gt;I created paths using GBM to implement The stochastic mesh method. But the method requires the conditional distribution, given some S(t) the probability of S(t+1).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've searched and can't find this formula, Does someone know it? Is there any other way to calculate the conditional probability?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me explain a little better, I'm working on the &lt;strong&gt;&lt;a href=&quot;https://www0.gsb.columbia.edu/faculty/pglasserman/Other/bgh.pdf&quot; rel=&quot;nofollow&quot;&gt;stochastic mesh method&lt;/a&gt;&lt;/strong&gt;&#xA;The method require I create N paths over M steps of time. I choose GBM to do this, so in a single path simulation I have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;S = S_{0}, S_{1}, ... ,S_{M}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next I need to calculate the continuation value for wich I need Weights&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;w_{ij} = p_{ij} / \sum_k p_{kj}&#xA;$$&#xA;$$&#xA;p_{ij} = P (S_{t + \bigtriangleup t} \in A \mid S{t} = x) &#xA;$$&#xA;The last  is the formula I'm looking for the GBM&lt;/p&gt;&#xA;" OwnerUserId="18494" LastEditorUserId="18494" LastEditDate="2016-05-26T17:22:26.607" LastActivityDate="2016-05-26T19:49:07.217" Title="Conditional probability of geometric brownian motion" Tags="&lt;stochastic-calculus&gt;&lt;monte-carlo&gt;&lt;brownian-motion&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26276" PostTypeId="2" ParentId="26235" CreationDate="2016-05-26T16:53:22.540" Score="5" Body="&lt;p&gt;You are trying to price an option through Monte Carlo simulations. Here is how it should work, assuming the Black-Scholes diffusion framework.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under the Black-Scholes model's assumptions, the value of a risky asset $S$ at the time $t=T$ is a random variable which reads&#xA;$$ S_T = S_0 e^{\left(\mu-\frac{\sigma^2}{2}\right)T + \sigma \sqrt{T} Z}\tag{1}$$&#xA;with &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$S_0$, initial value of the asset at $t=0$&lt;/li&gt;&#xA;&lt;li&gt;$\mu$, risk-neutral drift of the asset $\color{red}{(*)}$&lt;/li&gt;&#xA;&lt;li&gt;$\sigma$, volatility of the asset&lt;/li&gt;&#xA;&lt;li&gt;$Z$, a standard Gaussian random variable, $Z \sim N(0,1)$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Because the logarithm of $S_T$ is normally distributed&#xA;\begin{align}&#xA;\ln(S_T) &amp;amp;= \ln(S_0) + \left(\mu-\frac{\sigma^2}{2}\right)T + \sigma\sqrt{T}Z \\&#xA;         &amp;amp;\sim N\left(\ln(S_0) + \left(\mu-\frac{\sigma^2}{2}\right)T, \sigma^2 T\right)&#xA;\end{align}&#xA;$S_T$ follows what we call a &lt;strong&gt;log-normal&lt;/strong&gt; distribution. $\color{red}{(**)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, assuming one can write an option price as the discounted expectation of its future payout $\phi(S_T) = \max(S_T-K,0)$ (there is a lot of theory hidden behind that assertion) where we have used $K$ to denote the strike, or exercise price of the option, i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ V_0 = e^{-rT} \mathbb{E} \left[ \phi(S_T) \right] = \mathbb{E} \left[ \max(S_T-K,0) \right] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then one can use a Monte Carlo method to compute the expectation in the RHS. For that, one simply needs to&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Simulate independent draws of the random variable $S_T$ (representing different scenarii of terminal asset values). This should be easy, since we just saw that one only needs to simulate independent draws of a standard Gaussian $Z$ and use the formula $(1)$ given above.&lt;/li&gt;&#xA;&lt;li&gt;Compute the associated payout $\phi(S_T) = \max(S_T-K,0)$ for each draw&lt;/li&gt;&#xA;&lt;li&gt;Average all sampled payout values to obtain their expectation.&lt;/li&gt;&#xA;&lt;li&gt;Finally apply the discount factor $e^{-rT}$ to obtain the desired option price&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Mathematically, the Monte Carlo estimator $\hat{V}_0$ of the true option price $V_0$ is therefore given by&#xA;  \begin{align}&#xA;\textbf{[STEP 1] }&amp;amp;\ \ \ S_T^{(m)} = S_0 \exp\left( (r-\frac{1}{2}\sigma^2)T + \sigma \sqrt{T} Z^{(m)} \right),\ \ \forall m=1,...,M \\&#xA;\textbf{[STEPS 2-3-4] }&amp;amp;\ \ \ \hat{V}_0 = e^{-rT} \left( \frac{1}{M} \sum_{m=1}^M \phi\left(S_T^{(m)}\right) \right)&#xA;\end{align}&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;with $(Z^{(m)})_{m=1,...,M}$ representing $M$ i.i.d. samples out of a standard normal distribution and $M$ the total number of simulations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\hat{V}_0$ is an unbiased estimator of the true premium $V_0$ whose variance decreases proportionally to $M^{-1/2}$ (which is a direct consequence of the Central Limit Theorem, again there's some theory behind that result).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;$\color{red}{(*)}$  $\mu = r_{FOR}-r_{DOM}$ for a $DOM/FOR$ foreign exchange rate and the risk-&quot;free rate&quot; should be replaced by $r = r_{FOR}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\color{red}{(**)}$ You could use a Gaussian model as you suggest (Bachelier model) where $S_T = \mu + \sigma_N \sqrt{T} Z \sim N(\mu, \sigma_N^2T)$, this does not change the rest of the discussion. Note that $\sigma_N$ is known as the Normal (or Bachelier) volatility, while the $\sigma = \sigma_{LN}$ we used above is nown as the LogNormal (or Black-Scholes) volatility.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-05-26T17:07:54.653" LastActivityDate="2016-05-26T17:07:54.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26277" PostTypeId="1" CreationDate="2016-05-26T18:00:59.150" Score="1" ViewCount="484" Body="&lt;p&gt;I am working on an automatized quantitative strategy that use cointegration in Forex. I am backtesting this strategy in Python. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please see below the python file:&#xA;&lt;a href=&quot;https://drive.google.com/file/d/0B1AEYFPAAAE6eW5XeHlkTXprVUU/view?usp=sharing&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://drive.google.com/file/d/0B1AEYFPAAAE6eW5XeHlkTXprVUU/view?usp=sharing&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See below the data that I used to backtest:&#xA;&lt;a href=&quot;https://drive.google.com/file/d/0B1AEYFPAAAE6amx0RWI1MGh3SW8/view?usp=sharing&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://drive.google.com/file/d/0B1AEYFPAAAE6amx0RWI1MGh3SW8/view?usp=sharing&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My Algorithm is:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Read File&lt;/li&gt;&#xA;&lt;li&gt;Transform the data with the log return&lt;/li&gt;&#xA;&lt;li&gt;Treat Outliers&lt;/li&gt;&#xA;&lt;li&gt;Realize the linear regression&lt;/li&gt;&#xA;&lt;li&gt;Test for cointegration with ADF test&lt;/li&gt;&#xA;&lt;li&gt;If the spread is stationary then apply the best ARMA model&lt;/li&gt;&#xA;&lt;li&gt;Forecast and using beta calculation to control the risk&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The equity curve of this strategy is:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/XLQVM.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/XLQVM.png&quot; alt=&quot;Equity Curve of Cointegration Strategy&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you please help to understand how can I improve this algo?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="17798" LastActivityDate="2016-05-26T18:00:59.150" Title="Cointegration for forex using ARMA model to forecast the spread" Tags="&lt;time-series&gt;&lt;fx&gt;&lt;backtesting&gt;&lt;cointegration&gt;&lt;stationarity&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26278" PostTypeId="2" ParentId="26274" CreationDate="2016-05-26T18:30:32.783" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Note that&#xA;$${{f}_{W(t)\left|   W(s) \right.}}\left(x\left| y \right. \right)=\frac{{{f}_{ W(s),W(t)}}\left( x,y \right)}{{{f}_{ W(s)}}\left( y \right)}=\frac{1}{\sqrt{2\pi(t-s)}}\exp \left[-\frac{{{(x-y)}^{2}}}{2(t-s)} \right]$$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;By application of Ito's lemma we have&#xA;$$ln\,S_{t+\Delta t}=ln\,S_t+\left((\mu-\frac{1}{2}\sigma^2)\Delta t+\sigma(W_{t+\Delta t}-W_t)\Delta t\right)$$&#xA;Indeed $ln\,S_{t}$ has a Normal distribution.&#xA;$$$$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;$P(S_{t+\Delta t}&amp;lt;x|S_{t}&amp;lt;y)$=$P(ln\,S_{t+\Delta t}&amp;lt;ln\,x|ln\,S_{t}&amp;lt;ln\,y)$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerDisplayName="user16651" LastActivityDate="2016-05-26T18:30:32.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26279" PostTypeId="1" AcceptedAnswerId="26280" CreationDate="2016-05-26T18:52:39.547" Score="0" ViewCount="61" Body="&lt;p&gt;The following is an excerpt from &lt;em&gt;Introduction to the Mathematics of Finance&lt;/em&gt; by Roman:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;As a more concrete example, suppose that IBM is selling for $\$100$ per share at&#xA;  this moment. A $3$ month &lt;em&gt;call option&lt;/em&gt; on IBM with &lt;em&gt;strike price&lt;/em&gt; $\$102$ is a contract&#xA;  between the buyer and the seller of the option that says that the buyer may (but is&#xA;  not required to) purchase $\color{blue}{\bf 100}$ shares of IBM from the seller for $\$102$ per share at&#xA;  any time during the next $3$ months.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In this example is the number $\color{blue}{100}$ in blue arbitrarily picked by the author? Is it relevant to the concept of &quot;call option&quot;?&lt;/p&gt;&#xA;" OwnerUserId="20908" LastActivityDate="2016-05-26T19:35:40.373" Title="In an example of &quot;call options&quot;" Tags="&lt;options&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26280" PostTypeId="2" ParentId="26279" CreationDate="2016-05-26T19:05:46.757" Score="2" Body="&lt;p&gt;Call options are usually standardized product: in the contract you can (but are not obliged to) buy a certain amount, which is specified. &lt;strong&gt;The most common quantity is 100 shares&lt;/strong&gt; (see for example the description by J. Hull, &lt;em&gt;Options, Futures, and Other Derivatives&lt;/em&gt;).&lt;/p&gt;&#xA;" OwnerUserId="20135" LastActivityDate="2016-05-26T19:05:46.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26281" PostTypeId="1" CreationDate="2016-05-26T19:23:57.900" Score="1" ViewCount="285" Body="&lt;p&gt;In a LMM+ with displacement factor a volatility anchoring technique is used, i.e. a long term volatility assumptions is applied, derived from historic time series. Should I adjust this historic volatility (e.g. 10%) when using Black or the normal implied volatilities?&lt;/p&gt;&#xA;" OwnerUserId="20910" LastActivityDate="2016-05-26T19:23:57.900" Title="Interest rates - Swaptions implied volatility - Volatility anchoring with Black and with normal volatilities" Tags="&lt;implied-volatility&gt;&lt;swaption&gt;&lt;lognormal&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26282" PostTypeId="2" ParentId="26279" CreationDate="2016-05-26T19:35:40.373" Score="1" Body="&lt;p&gt;Yes it's arbitrary, when you agree on the condition you define the how many shares and the Strike price if the contract is not standard&lt;/p&gt;&#xA;" OwnerUserId="18494" LastActivityDate="2016-05-26T19:35:40.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26283" PostTypeId="2" ParentId="26274" CreationDate="2016-05-26T19:41:12.057" Score="1" Body="&lt;p&gt;Applying Itô's lemma to the Black-Scholes SDE and integrating from $t$ to $t+\Delta t$ gives:&#xA;$$ S_{t+\Delta t} = S_t e^{(r-\frac{1}{2}\sigma^2)\Delta t + \sigma \sqrt{\Delta t}Z} $$&#xA;with $Z \sim N(0,1)$, showing that $S_{t+\Delta t}$ given $S_t$ is log-normally distributed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is then straightforward to write, for any compact $\mathcal{A} = [a_1,a_2]$ with $0 &amp;lt; a_1 \leq a_2$ and under the risk-netral measure $\mathbb{Q}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;\mathbb{Q}\left(S_{t+\Delta t} \in \mathcal{A} \vert S_t = x\right) &amp;amp;= \mathbb{Q}\left( x e^{ (r-\frac{1}{2}\sigma^2)\Delta t + \sigma \sqrt{\Delta t}Z} \in [a_1, a_2] \right) \\&#xA;&amp;amp;= \mathbb{Q} \left( \ln(x) + (r-\frac{1}{2}\sigma^2)\Delta t + \sigma \sqrt{\Delta t}Z \in [\ln(a_1), \ln(a_2)] \right) \\&#xA;&amp;amp;= \mathbb{Q} \left( Z \in [a_1^*, a_2^*] \right) \\&#xA;&amp;amp;= \Phi(a_2^*) - \Phi(a_1^*) &#xA;\end{align}&#xA;where we have used the fact that the natural logarithm is a monotone increasing bijective function and defined&#xA;$$\Phi(x) = \text{Pr}(X \leq x), X \sim N(0,1)$$&#xA;to be the normal cumulative distribution function along with&#xA;$$ a_i^* = \frac{ \ln\left(\frac{x}{a_i}\right) + \left(r - \frac{1}{2}\sigma^2\right)\Delta t }{\sigma\sqrt{\Delta t}} $$&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-05-26T19:49:07.217" LastActivityDate="2016-05-26T19:49:07.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26284" PostTypeId="2" ParentId="25653" CreationDate="2016-05-26T23:13:07.213" Score="3" Body="&lt;p&gt;Kalman filter (or similar methods) are quite well suited to deal with observations that are of different sampling frequencies and/or asynchronous. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-05-26T23:13:07.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26285" PostTypeId="2" ParentId="26164" CreationDate="2016-05-27T01:26:39.333" Score="0" Body="&lt;ol&gt;&#xA;&lt;li&gt;Use Ito's lemma to get dD&lt;/li&gt;&#xA;&lt;li&gt;Use dE = dV - dD&lt;/li&gt;&#xA;&lt;li&gt;Form a weighted portfolio of D and E, lets call it V, where the weights sum to 1&lt;/li&gt;&#xA;&lt;li&gt;Use the self-ﬁnancing to get the dynamics of V&lt;/li&gt;&#xA;&lt;li&gt;Find the weights that makes V risk-free&lt;/li&gt;&#xA;&lt;li&gt;Set the drift of V equal to r&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="20914" LastEditorUserId="20914" LastEditDate="2016-05-27T01:37:56.403" LastActivityDate="2016-05-27T01:37:56.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26286" PostTypeId="1" CreationDate="2016-05-27T08:13:48.240" Score="0" ViewCount="75" Body="&lt;p&gt;Suppose, I have written two ordered lists:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_{call}= (\textbf{8000, 8050, 8100}, 8150, 8200, 8250)$ and&lt;br&gt;&#xA;$S_{put} = (7850, 7900, 7950, \textbf{8000, 8050, 8100})$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Entities are correspond to strike prices of call and put on the same underlying asset XYZ.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Spot price is equal to $8067.6$, then XYZ 8050 call and XYZ 8050 put are &quot;at-the-money&quot; options, XYZ 8000 call and XYZ 8100 put are &quot;in-the-money&quot; options, and the remaining options would be &quot;out-of-the-money&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to name strike prices which are marked with bold? Is there a special term?&lt;/p&gt;&#xA;" OwnerUserId="20913" LastEditorUserId="20913" LastEditDate="2016-05-28T01:14:11.973" LastActivityDate="2016-06-27T02:00:20.403" Title="Special term for 'intersection' of option price" Tags="&lt;options&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26287" PostTypeId="1" CreationDate="2016-05-27T09:09:28.577" Score="3" ViewCount="113" Body="&lt;p&gt;This is a financial data cleaning question. I have raw price and yield data for US cash treasury across the curve. In the time-series there are jumps on the day after the treasury auction results come out. Prior to using the data, is it good practice to manually remove the jumps? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="13375" LastActivityDate="2016-12-23T21:44:14.110" Title="How to take care of newly auctioned yield/price in fixed income data" Tags="&lt;fixed-income&gt;&lt;data&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26288" PostTypeId="1" AcceptedAnswerId="26321" CreationDate="2016-05-27T10:36:05.873" Score="3" ViewCount="132" Body="&lt;p&gt;Scenario: developing a custom application which defines a structured workflow for manual order submission to Bloomberg EMSX; it should minimize own persisted state and rely on the remote order book as much as possible; it should be resilient against failures and downtime and prevent duplicate order submission; it should only care about what happened within the current one day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any standard patterns of handling this? Ideally not Bloomberg-specific.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current thinking is to have three lists:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;proposed orders - not submitted, not executed;&lt;/li&gt;&#xA;&lt;li&gt;submitted orders - submitted for execution, but no confirmation received yet;&lt;/li&gt;&#xA;&lt;li&gt;actioned orders - submission confirmation received, fills are being received.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Then there will be some process that will &quot;try hard&quot; to keep the three lists in sync:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;user submits order: remove from proposed orders list and add to submitted orders list;&lt;/li&gt;&#xA;&lt;li&gt;confirmation/fills received: remove from submitted orders list and add to actioned orders list.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;More practically it will reactively act on three respective sets of event streams and manage the respective order lists.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Orders will have a unique ID. Execution platform-specific duplicate prevention will be used as well e.g. EMSX_REQUEST_SEQ, but it doesn't mean there shouldn't be earlier checks done.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What do you think?&lt;/p&gt;&#xA;" OwnerUserId="1915" LastActivityDate="2016-05-29T22:06:56.400" Title="What approaches are there for keeping local and remote order books in sync?" Tags="&lt;programming&gt;&lt;bloomberg&gt;&lt;order-execution&gt;&lt;software&gt;&lt;orderbook&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26289" PostTypeId="2" ParentId="26286" CreationDate="2016-05-27T13:05:17.460" Score="2" Body="&lt;p&gt;I think you might be looking for &quot;in-the-money&quot; for the calls with strikes below spot and the puts with strikes above spot.  And then the options that are close to spot will be called &quot;at-the-money&quot;.  And the remaining options would be &quot;out-of-the-money&quot;.&lt;/p&gt;&#xA;" OwnerUserId="20092" LastActivityDate="2016-05-27T13:05:17.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26290" PostTypeId="2" ParentId="26287" CreationDate="2016-05-27T13:13:35.737" Score="0" Body="&lt;p&gt;You need to have a process to fix the auction-day prices.  Often the coupon is changed and you will have a previous price for the old coupon, which causes the jump.  It happens fairly frequently; at my place we finally automated it.&lt;/p&gt;&#xA;" OwnerUserId="20092" LastActivityDate="2016-05-27T13:13:35.737" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26291" PostTypeId="1" CreationDate="2016-05-27T14:12:23.073" Score="2" ViewCount="282" Body="&lt;p&gt;I would need time series, from 2000 to 2015 (if possible) of sovereign credit ratings by Moody's, S&amp;amp;P and Fitch.&#xA;Could you suggest me a source or provide me such a dataset?&#xA;Thank you very much!&lt;/p&gt;&#xA;" OwnerUserId="20918" LastActivityDate="2016-08-25T18:10:46.033" Title="Time series of European sovereign credit ratings by the Big Three?" Tags="&lt;time-series&gt;&lt;historical-data&gt;&lt;credit-ratings&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26292" PostTypeId="2" ParentId="25605" CreationDate="2016-05-27T14:15:39.413" Score="1" Body="&lt;p&gt;When you are solving for the local vol in the non mean reverting model, you will find that it also depends on strike.  Thus, you can only match vanilla options prices between the two models for a single strike.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say that you pick a strike K&gt;0 for which you match the vanilla option price.  The you will find that for strike B, where B&gt;K, the mean reverting model produces a lower option price, since it has less probability of an extreme move.  Now, the barrier option viewed simplistically consists of short optionality at the B strike - hence the barrier option is worth more under the mean reverting model, assuming that the K strikes have been matched.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-05-27T14:15:39.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26293" PostTypeId="1" CreationDate="2016-05-27T14:53:30.587" Score="8" ViewCount="390" Body="&lt;p&gt;Does the &quot;issuer-pay&quot; model hold also for sovereign credit ratings?&#xA;Do States pay for having their bond being rated?&lt;/p&gt;&#xA;" OwnerUserId="20918" LastEditorUserId="16148" LastEditDate="2016-05-27T16:06:15.967" LastActivityDate="2016-05-27T18:21:07.233" Title="Who pays for sovereign ratings?" Tags="&lt;credit-ratings&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26294" PostTypeId="1" AcceptedAnswerId="26299" CreationDate="2016-05-27T15:14:40.667" Score="3" ViewCount="678" Body="&lt;p&gt;I am experimenting to try to find better ways to hedge some of our equity portfolios.  It's easy enough to use R to get a PCA breakdown of exposure for a portfolio but I can't figure out how to then use that to actually hedge something.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the example below I'm just using four securities.  In real life we would use more, but the small set it to keep this example manageable.  Here's the R code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Get publicly available data&#xA;library(dplyr)&#xA;library(TTR)&#xA;px.spy=getYahooData(&quot;SPY&quot;, 20130101, 20160101)$Close&#xA;px.iwm=getYahooData(&quot;IWM&quot;, 20130101, 20160101)$Close&#xA;px.tlt=getYahooData(&quot;TLT&quot;, 20130101, 20160101)$Close&#xA;px.gld=getYahooData(&quot;GLD&quot;, 20130101, 20160101)$Close&#xA;&#xA;names(px.spy)[1]=&quot;SPY&quot;&#xA;names(px.iwm)[1]=&quot;IWM&quot;&#xA;names(px.tlt)[1]=&quot;TLT&quot;&#xA;names(px.gld)[1]=&quot;GLD&quot;&#xA;&#xA;px=merge( px.spy  , px.iwm )&#xA;px=merge( px  , px.tlt )&#xA;px=merge( px , px.gld )&#xA;&#xA;# turn it into something that we can put into princomp&#xA;pxList=as.data.frame(px) %&amp;gt;% mutate( SPYr = (lag(SPY,1) - SPY )/SPY , IWMr = (lag(IWM,1) - IWM )/IWM  ,&#xA; TLTr = (lag(TLT,1) - TLT )/TLT , GLDr= (lag(GLD,1) - GLD )/GLD) %&amp;gt;% filter( complete.cases(.)) %&amp;gt;% select(SPYr,IWMr,TLTr,GLDr )&#xA;&#xA;pxCov=cor(pxList)&#xA;pc=princomp(pxCov) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now we the loadings in &lt;code&gt;pc$loadings&lt;/code&gt;.  Now, say we wanted to take a portfolio of $100mm of SPY and hedge it with IWM,TLT,GLD based on the PCA exposures.  What's the right way to extract that simply and to create a frame with the weightings?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks, Josh&lt;/p&gt;&#xA;" OwnerUserId="20092" LastActivityDate="2016-05-30T18:13:53.773" Title="Using R with princomp to create hedge baskets" Tags="&lt;r&gt;&lt;hedging&gt;" AnswerCount="2" CommentCount="7" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26295" PostTypeId="2" ParentId="26287" CreationDate="2016-05-27T15:50:46.880" Score="1" Body="&lt;p&gt;No, do nothing. It is important to have &quot;as-of&quot; data for backtesting.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Answer below is when I misread the question and thought you were trying to smooth out jumps in the rolling on-the-run series. I thought I'd keep it for reference purpose:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It depends on what you're doing. If this is purely to show where the rolling on-the-run bond yields have been trading, then no, do nothing. Practitioners are well aware of these &quot;rolls.&quot; (Make sure your computational convention is correct – WIs should be computed using the US Treasury method for forward settlement on the issue date.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the time series is used for relative value trading, then these data need to be processed. The most common technique is to build a spline that generates constant maturity par yields. &lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2016-05-27T16:01:07.830" LastActivityDate="2016-05-27T16:01:07.830" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26296" PostTypeId="2" ParentId="26291" CreationDate="2016-05-27T16:35:37.757" Score="1" Body="&lt;p&gt;Such data are provided by Bloomberg Terminal. I am positive about Moody's and S&amp;amp;P but not sure whether Fitch rating is also available.&lt;/p&gt;&#xA;" OwnerUserId="20637" LastActivityDate="2016-05-27T16:35:37.757" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26297" PostTypeId="2" ParentId="26293" CreationDate="2016-05-27T18:21:07.233" Score="2" Body="&lt;p&gt;The &quot;issuer-pay&quot; model works like this: The Rating Agency goes to the issuer and says &quot;We heard that you are going to issue bonds. We can give you a rating if you pay us XXX dollars. It will help you a lot to have our rating&quot;. The Issuer of course is free to refuse this offer (after all this is just a rating agency, not the Cosa Nostra). In this case the rating agency can still rate the issuer if it wants to (for a variety of reasons, for example to allow comparison with other issuers).  I believe the big countries (United Kingdom, USA, etc.) fall in the latter case: they never pay for ratings, so they are rated gratis (at no charge). In general it will depend on the country's judgement of whether they need a rating or not. &lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2016-05-27T18:21:07.233" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26298" PostTypeId="2" ParentId="26164" CreationDate="2016-05-27T20:28:07.127" Score="4" Body="&lt;p&gt;We construct a locally risk-free self-financing portfolio &lt;span class=&quot;math-container&quot;&gt;$X_t$&lt;/span&gt;, at time &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt;, with &lt;span class=&quot;math-container&quot;&gt;$\Delta_t^1$&lt;/span&gt; share of debt and &lt;span class=&quot;math-container&quot;&gt;$\Delta_t^2$&lt;/span&gt; share of equity. That is,&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}&#xA;X_t = \Delta_t^1 D_t + \Delta_t^2 E_t.&#xA;\end{align*}&lt;/span&gt;&#xA;Then,&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}&#xA;dX_t &amp;amp;=\Delta_t^1 dD_t + \Delta_t^2 dE_t\\&#xA;&amp;amp;=\Delta_t^1\bigg[\Big(\frac{\partial D_t}{\partial t} + \mu A_t\frac{\partial D_t}{\partial A_t} + \frac{1}{2} \sigma^2 A_t^2 \frac{\partial^2 D_t }{\partial A_t^2}\Big)dt + \sigma A_t \frac{\partial D_t}{\partial A_t} dW_t \bigg]\\&#xA;&amp;amp;\quad + \Delta_t^2\bigg[\Big(\frac{\partial E_t}{\partial t} + \mu A_t \frac{\partial E_t}{\partial A_t} + \frac{1}{2} \sigma^2 A_t^2 \frac{\partial^2 E_t }{\partial A_t^2}\Big)dt + \sigma A_t \frac{\partial E_t}{\partial A_t} dW_t \bigg].&#xA;\end{align*}&lt;/span&gt;&#xA;Since &lt;span class=&quot;math-container&quot;&gt;$X_t$&lt;/span&gt; is locally risk-free,&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}&#xA;\Delta_t^1\frac{\partial D_t}{\partial A_t} + \Delta_t^2\frac{\partial E_t}{\partial A_t}=0. \tag{1}&#xA;\end{align*}&lt;/span&gt;&#xA;Moreover, since &lt;span class=&quot;math-container&quot;&gt;$X_t$&lt;/span&gt; earn the risk-free rate &lt;span class=&quot;math-container&quot;&gt;$r$&lt;/span&gt;, &#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}&#xA;dX_t = rX_t dt.&#xA;\end{align*}&lt;/span&gt;&#xA;From &lt;span class=&quot;math-container&quot;&gt;$(1)$&lt;/span&gt;,&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}&#xA;r\Delta_t^1 D_t dt + r\Delta_t^2 E_t dt &amp;amp;= \Delta_t^1\Big(\frac{\partial D_t}{\partial t} + \mu A_t \frac{\partial D_t}{\partial A_t} + \frac{1}{2} \sigma^2 A_t^2 \frac{\partial^2 D_t }{\partial A_t^2}\Big)dt \\&#xA;&amp;amp;\quad + \Delta_t^2\Big(\frac{\partial E_t}{\partial t} + \mu A_t \frac{\partial E_t}{\partial A_t} + \frac{1}{2} \sigma^2 A_t^2 \frac{\partial^2 E_t }{\partial A_t^2}\Big)dt. &#xA;\end{align*}&lt;/span&gt;&#xA;That is, &#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}&#xA;&amp;amp;\Delta_t^1\Big(\frac{\partial D_t}{\partial t} + \mu A_t \frac{\partial D_t}{\partial A_t}+\frac{1}{2} \sigma^2 A_t^2 \frac{\partial^2 D_t }{\partial A_t^2} - rD_t \Big)dt \\&#xA;&amp;amp;+ \Delta_t^2\Big(\frac{\partial E_t}{\partial t} +\mu A_t \frac{\partial E_t}{\partial A_t}+ \frac{1}{2} \sigma^2 A_t^2 \frac{\partial^2 E_t }{\partial A_t^2}-rE_t\Big)dt =0. \tag{2}&#xA;\end{align*}&lt;/span&gt;&#xA;Since &lt;span class=&quot;math-container&quot;&gt;$A_t = E_t + D_t$&lt;/span&gt;,&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}&#xA;\frac{\partial D_t}{\partial t} &amp;amp;= -\frac{\partial E_t}{\partial t},\tag{3}\\&#xA;\frac{\partial D_t}{\partial A_t} &amp;amp;= 1- \frac{\partial E_t}{\partial A_t},\tag{4}\\&#xA;\frac{\partial^2 D_t }{\partial A_t^2} &amp;amp;= - \frac{\partial^2 E_t }{\partial A_t^2}.\tag{5}&#xA;\end{align*}&lt;/span&gt;&#xA;From &lt;span class=&quot;math-container&quot;&gt;$(1)$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$(2)$&lt;/span&gt;, &#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}&#xA;&amp;amp;-\Delta_t^2\frac{\frac{\partial E_t}{\partial A_t}}{\frac{\partial D_t}{\partial A_t}}\Big(\frac{\partial D_t}{\partial t} + \mu A_t \frac{\partial D_t}{\partial A_t}+\frac{1}{2} \sigma^2 A_t^2 \frac{\partial^2 D_t }{\partial A_t^2} - rD_t \Big) \\&#xA;&amp;amp; \quad + \Delta_t^2\Big(\frac{\partial E_t}{\partial t} +\mu A_t \frac{\partial E_t}{\partial A_t}+ \frac{1}{2} \sigma^2 A_t^2 \frac{\partial^2 E_t }{\partial A_t^2}-rE_t\Big) =0.&#xA;\end{align*}&lt;/span&gt;&#xA;Then, from &lt;span class=&quot;math-container&quot;&gt;$(3)$&lt;/span&gt;-&lt;span class=&quot;math-container&quot;&gt;$(5)$&lt;/span&gt;, and multiplying &lt;span class=&quot;math-container&quot;&gt;$\frac{\partial D_t}{\partial A_t}=1-\frac{\partial E_t}{\partial A_t}$&lt;/span&gt; on both sides,&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}&#xA;&amp;amp;-\frac{\partial E_t}{\partial A_t}\bigg[-\frac{\partial E_t}{\partial t} + \mu A_t \Big(1-\frac{\partial E_t}{\partial A_t}\Big)-\frac{1}{2} \sigma^2 A_t^2 \frac{\partial^2 E_t }{\partial A_t^2} - r(A_t-E_t) \bigg] \\&#xA;&amp;amp; \quad + \Big(1- \frac{\partial E_t}{\partial A_t}\Big)\Big(\frac{\partial E_t}{\partial t} +\mu A_t \frac{\partial E_t}{\partial A_t}+ \sigma^2 \frac{1}{2} A_t^2 \frac{\partial^2 E_t }{\partial A_t^2}-rE_t\Big) \\&#xA;=&amp;amp;\ \frac{\partial E_t}{\partial A_t}\frac{\partial E_t}{\partial t} - \mu A_t \frac{\partial E_t}{\partial A_t} + \mu A_t \left(\frac{\partial E_t}{\partial A_t}\right)^2 + \frac{1}{2} \sigma^2 A_t^2\frac{\partial E_t}{\partial A_t}\frac{\partial^2 E_t }{\partial A_t^2} +r(A_t-E_t)\frac{\partial E_t}{\partial A_t} \\&#xA;&amp;amp;\quad - \frac{\partial E_t}{\partial A_t}\frac{\partial E_t}{\partial t} -\mu A_t \left(\frac{\partial E_t}{\partial A_t}\right)^2 - \frac{1}{2} \sigma^2 A_t^2\frac{\partial E_t}{\partial A_t}\frac{\partial^2 E_t }{\partial A_t^2}+rE_t\frac{\partial E_t}{\partial A_t} \\&#xA;&amp;amp;\quad + \frac{\partial E_t}{\partial t} +\mu A_t \frac{\partial E_t}{\partial A_t}+ \frac{1}{2} \sigma^2 A_t^2 \frac{\partial^2 E_t }{\partial A_t^2}-rE_t \\&#xA;=&amp;amp; \ \frac{\partial E_t}{\partial t} +r A_t \frac{\partial E_t}{\partial A_t}+ \frac{1}{2} \sigma^2 A_t^2 \frac{\partial^2 E_t }{\partial A_t^2}-rE_t =0.\tag{6}&#xA;\end{align*}&lt;/span&gt;&#xA;Since &lt;span class=&quot;math-container&quot;&gt;$A_t$&lt;/span&gt; also satisfies &lt;span class=&quot;math-container&quot;&gt;$(6)$&lt;/span&gt;, then so does &lt;span class=&quot;math-container&quot;&gt;$D_t$&lt;/span&gt;. The derivation is this complete.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="6858" LastEditDate="2020-01-22T03:11:22.613" LastActivityDate="2020-01-22T03:11:22.613" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="26299" PostTypeId="2" ParentId="26294" CreationDate="2016-05-28T00:28:09.060" Score="2" Body="&lt;p&gt;Just a heads up, I'm not going to go through all the mathematical caveats of using this approach. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\Sigma$ be your covariance matrix, and $X$ a random vector of daily returns. So&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Var}(X) = \Sigma.$$&#xA;You have a bug in your code. In your code you call it &lt;code&gt;pxCov&lt;/code&gt;, but you probably meant to use &lt;code&gt;cov()&lt;/code&gt; insted of &lt;code&gt;cor()&lt;/code&gt;. Check out the documentation to &lt;code&gt;princomp().&lt;/code&gt; It expects the covariance matrix by default. This will change things.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, &lt;code&gt;princomp()&lt;/code&gt; is interpreting your covariance matrix as a data frame. You should run the following commands instead of your last two lines:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pxCov=cov(pxList)&#xA;pc=princomp(covmat=pxCov) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now the math stuff. All the stuff you want to do, that you mentioned in the comments, can be done by taking expectations, variances, or covariances of linear combinations of your random return vector. The weights will be constructed from the loadings or eigenvectors, and calculation of variances will be simplified using the eigenvalues or standard deviation terms corresponding to the loadings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $w$ be a weight (column) vector. Assume for now that the sum of its entires is $1$. Each element denotes the share of your portfolio sitting in that stock. Basic properties tell us that&#xA;$$\text{Var}(w'X) = w'\Sigma w,$$&#xA;where the apostrophe denotes the transpose. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can take the spectral decomposition of covariance matrices (positive definite and symmetric):&#xA;$$\Sigma = \sum_{i=1}^4 \lambda_i v_i v_i'$$&#xA;with the set of loadings or eigenvectors, $\{v_i\}$ being orthonormal. In your code, these are &lt;code&gt;pc$loadings&lt;/code&gt;. The lambdas that correspond with these are &lt;code&gt;pc$sdev^2&lt;/code&gt;. This function orders everything in decreasing order, so $\lambda_1 &amp;gt; \cdots &amp;gt; \lambda_4$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you say PCA, you are probably trying to use the $v_i$s to construct a ''good'' $w$. There is no single way to do this. If you want to minimize your volatility without paying any mind to your expected returns, you would set $w = v_4$. Then your portfolio variance/risk would be &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Var}(wX) = v_4' \left[ \sum_{i=1}^4 \lambda_i v_i v_i'\right] v_4 = \lambda_4 v_4'v_4 v_4'v_4 = \lambda_4,$$&#xA;because of the orthonormality of the loading vectors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to minimize some other objective function, then you can do that too. For example, if your expected return is $w'\mu$, then you might want to minimize $w'\Sigma w - m w'\mu$. I have no idea what's commonly done in practice, though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to see how much each variance each loading explains, run &lt;code&gt;plot(pc$sdev^2/sum(pc$sdev^2))&lt;/code&gt;. If you want 90\% you need some mix of the first two loadings. So we need to find some $0 &amp;lt; \alpha &amp;lt; 1$ such that $w = \alpha v_1 + (1-\alpha)v_2$. Using stuff like orthogonality that I showed you earlier, you can get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Var}(wX) = \alpha^2\lambda_1 + (1-\alpha)^2\lambda_2 \overset{\text{set}}{=} .9$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you have to use the quadratic formula to find $\alpha$ in order to get your $w$. You could also do a mix of the last three loadings, too. I'm not sure what's done commonly in practice here, either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to find the &quot;exposure&quot; of your new portfolio, $w'X$, to the returns of the SPY, $e_1'X$, which I take to mean as covariance, then you can use the bilinearity of $\text{Cov}(\cdot,\cdot)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Cov}(w'X, e_1'X) = w'\Sigma e_1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $e_1' = (1, 0, 0, 0)$. &lt;/p&gt;&#xA;" OwnerUserId="1870" LastEditorUserId="1870" LastEditDate="2016-05-30T17:02:44.150" LastActivityDate="2016-05-30T17:02:44.150" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="26302" PostTypeId="1" CreationDate="2016-05-28T04:00:45.060" Score="6" ViewCount="10946" Body="&lt;p&gt;Recently, I am doing my dissertation that covers asset pricing theory. The empirical test of Fama 3 factors model is an important part of this dissertation. Please let me review the fama model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fama 3 factors model is $r-R_f=α+β_m(K_m−R_f)+\beta_s⋅SMB+\beta_v⋅HML+e$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $R_f$ is risk free return, ($K_m−R_f$) is premium return and $K_m$ is market return, &lt;strong&gt;SMB&lt;/strong&gt; is the &quot;&lt;strong&gt;Small Minus Big&lt;/strong&gt;&quot; market capitalization risk factor. &lt;strong&gt;HML&lt;/strong&gt; is is the &quot;&lt;strong&gt;High Minus Low&lt;/strong&gt;&quot; value premium risk factor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please let mt detail my question. I have over 500 stocks and their monthly return ,monthly market value and monthly book-to-market ratio (call it b/m). The time interval is from 01.2010 to 12.2015, then because the data is monthly so I have 60 periods. Those data is in one excel document. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;its methodology and what I want to do is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;For all stocks at each period, compute the mean for market value.&lt;/li&gt;&#xA;&lt;li&gt;Divide them into two groups (say big and small size) by comparing each stock with mean. If stock's market value greater than mean, put them into big size group. If small than mean, put them into small size group. Thus, for each period we have two groups, big and small group in terms of market value. &lt;/li&gt;&#xA;&lt;li&gt;For each period, we compare all the stocks' b/m within each group, then furtherly divide them into 3 groups , named high b/m (top 30%) group, medium b/m (middle hierarchy from 30% to 70%) group and low b/m (bottom 30%) group. Namely, for each period, we finally divide 6 groups. They are S/L, S/M, S/H and &lt;strong&gt;B/L&lt;/strong&gt;, &lt;strong&gt;B/M&lt;/strong&gt;, &lt;strong&gt;B/H&lt;/strong&gt;. For example, &lt;strong&gt;S/L&lt;/strong&gt; group contains all stocks that are small market value and low b/m ratio simultaneously. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;These 6 groups are just 6 portfolio. So for each period, we have 6 different portfolios. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far this is my first stage. Then I have second stage:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;After we get 6 different portfolios at each period, we need to compute weighted average return for all stocks at each period.&lt;/li&gt;&#xA;&lt;li&gt;We need to compute the SMB and HML for each period. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;$$SMB=\frac{\left[\left(\frac{S}{L}+\frac{S}{M}+\frac{S}{H}\right)-\left(\frac{B}{L}+\frac{B}{M}+\frac{B}{H}\right)\right]}{3}$$&lt;br&gt;&#xA;  $$HML=\frac{\left[\left(\frac{S}{H}+\frac{B}{H}\right)-\left(\frac{S}{L}+\frac{B}{L}\right)\right]}{2}$$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where S/L,S/M....B/L is the summation return of each group. Like S/L is the summation of each stock's return. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, we got time series data, then can regress this series data, and figure out α and 3 $\beta$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, basically those are want I want to do. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I compute those manually although I use excel, this is really a huge amount of workload, so tired to do this. I am still in step 1 at first stage. Is anyone interesting in telling me how to achieve dividing stocks into portfolios by compute, and compute those data by compute? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;People usually just download the data from French's website. But my goal is to check Fama model in Asian stock market, like Shanghai and Hong Kong. All answers welcome, really really crazy and tired to do this manually. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, thanks everyone in advanced. &lt;/p&gt;&#xA;" OwnerUserId="20925" LastEditorDisplayName="user16651" LastEditDate="2016-05-28T06:25:57.120" LastActivityDate="2020-04-04T17:30:10.330" Title="Could someone teach me how to construct the portfolios by compute (like using R, Excel or Eviews)" Tags="&lt;r&gt;&lt;factor-models&gt;&lt;asset-pricing&gt;&lt;excel&gt;&lt;fama-french&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26303" PostTypeId="2" ParentId="26302" CreationDate="2016-05-28T07:14:38.163" Score="4" Body="&lt;p&gt;First of all, it is not conceivable to do all that work by hand! You are crazy to have just thought it! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, if you want to repeat your work with different datasets, I suggest you to use R, since, once you have written a script, you can use it all the times you want. But, there's a 'but': you cannot think we are going to write some code for you (you should write our names on your dissertation as co-authors). You can ask here about theoretical problems you encounter, or you can post the section of your code that is not working and we would be happy to help you. In every kind of research you will have to conduct, you are going to analyze data, and the best way to do this is using softwares like R (I'm telling you that, sooner or later, you will have to learn to code some (even small) scripts). Once you begin, you will use it for everithing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given this, you can find plenty of YouTube tutorials, pdf guides, examples of scripts and communities (such as stack exchange ones) on the web ready to help you on your path to the dark side of statistical and econometrical analyses with any software you want (R, gretl, Stata, Eviews, or even more programming oriented as MATLAB or Python). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your analysis seems quite simple (in the sense that you do not need strange packages or functions to compute your calculations) and you will discover by yourself how useful, powerful and not that difficult to learn R is.&lt;/p&gt;&#xA;" OwnerUserId="18694" LastActivityDate="2016-05-28T07:14:38.163" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="26304" PostTypeId="2" ParentId="26160" CreationDate="2016-05-28T13:00:46.457" Score="1" Body="&lt;p&gt;Yes, they can be quantitative in nature.  A way to think about this is to set a period of time to analyze the return and then to set it up as a differential equation model and estimate the unknown parameters.  If you think the rate of increase in the return is linear, i.e. the momentum is linear then try running a linear regression model and run diagnostics.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a first attempt try running some simulation models where you use historical data from another asset with similar prior to purchase return behavior and expected momentum behavior.  Use your &lt;strong&gt;data&lt;/strong&gt; to calculate your return (r), which is based on when you purchase and sell the asset and how you are calculating your return and whether you return is absolute or relative (you can simulate different scenarios and different calculations for r).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also suggest adding in some relative performance measures to explore the notion of 'poor prior performance of a given asset' when building your simulation model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The multivariate optimization occurs when you solve for the unknown parameters of the quantitative model.  The validity of the optimization strategy depends on what method you use to solve and what assumptions you make for the model, such as whether variance is fixed and finite and furthermore whether the return is stochastic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be clear, I have no comment on the validity of the theory of momentum or its use for trading strategies.  &lt;/p&gt;&#xA;" OwnerDisplayName="user20928" LastActivityDate="2016-05-28T13:00:46.457" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26306" PostTypeId="1" AcceptedAnswerId="26371" CreationDate="2016-05-28T18:34:56.707" Score="4" ViewCount="746" Body="&lt;p&gt;Suppose I backtest some strategy on in-sample data while varying two parameters, say &lt;span class=&quot;math-container&quot;&gt;$X$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$Y$&lt;/span&gt;. &lt;span class=&quot;math-container&quot;&gt;$X$&lt;/span&gt; can take the values &lt;span class=&quot;math-container&quot;&gt;$\{3,6,9,12,15,18\}$&lt;/span&gt; while &lt;span class=&quot;math-container&quot;&gt;$Y$&lt;/span&gt; can take &lt;span class=&quot;math-container&quot;&gt;$\{10,15,20,25,30\}$&lt;/span&gt;. I want to select appropriate values of &lt;span class=&quot;math-container&quot;&gt;$X$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$Y$&lt;/span&gt; for testing the strat on out-of-sample data. The tables of &lt;code&gt;sharpe&lt;/code&gt; ratios, &lt;code&gt;sortino&lt;/code&gt; ratios and max drawdown (&lt;code&gt;dd&lt;/code&gt;) are as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    &amp;gt; sharpe&#xA;  No_of_stocks  X3.month  X6.month  X9.month X12.month X15.month X18.month&#xA;            10 0.2923854 0.2485804 0.3116992 0.2356674 0.2711520 0.2535123&#xA;            15 0.2801226 0.2757317 0.3362495 0.2420944 0.2369459 0.2293062&#xA;            20 0.2887139 0.2953232 0.2952627 0.2979134 0.2553015 0.2249027&#xA;            25 0.2736581 0.3268325 0.2971468 0.2896665 0.2401743 0.2240485&#xA;            30 0.2761537 0.3423867 0.2964909 0.2905532 0.2948999 0.2137761&#xA;&#xA;&amp;gt; sortino&#xA;  No_of_stocks  X3.month  X6.month  X9.month X12.month X15.month X18.month&#xA;            10 0.4080662 0.3380257 0.4144185 0.3087768 0.3521293 0.3231242&#xA;            15 0.4013694 0.3842653 0.4503256 0.3174395 0.3080369 0.3006281&#xA;            20 0.4172279 0.4103027 0.3873160 0.3958244 0.3307235 0.2933315&#xA;            25 0.3925792 0.4787884 0.3940304 0.3848995 0.3095552 0.2892468&#xA;            30 0.3987750 0.4990707 0.3906656 0.3826982 0.3863327 0.2721931&#xA;&#xA;&amp;gt; dd&#xA;  No_of_stocks  X3.month  X6.month  X9.month X12.month X15.month X18.month&#xA;            10 0.5153225 0.5414108 0.4568199 0.5361848 0.5332630 0.6036963&#xA;            15 0.4821441 0.4207504 0.3996013 0.5099167 0.5355697 0.5306460&#xA;            20 0.4246441 0.3970251 0.4178547 0.3985710 0.4945658 0.5100034&#xA;            25 0.4326678 0.2433439 0.3900689 0.4038422 0.5093099 0.4805518&#xA;            30 0.3173227 0.2467464 0.3621063 0.3928437 0.3686759 0.4893400&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see, the 6-month;30-stock combination gives the best results in general. Someone told me that if, with a small variation in any one of the parameters, the value of the metric changes drastically, I should probably not select those combination of parameters (I guess it could be called an estimation error?). If we move from 6-month;30-stock to 9-month;30-stock, the sortino ratio changes pretty drastically from .499 to .39, and the max drawdown changes from .247 to .362.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So by that logic, I probably need to select the 3-month and 20-stock combination, because the metrics don't change a lot if we vary the no. of stocks or no. of months. My question is: is it okay to just blindly select the combination of parameters that give the best results (6-months,30-stocks) or should I also take the variation in metrics into account (3-months,20-stocks)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="19057" LastEditorUserId="26595" LastEditDate="2019-03-20T09:54:36.130" LastActivityDate="2019-03-20T09:54:36.130" Title="Selection of optimal backtesting parameters" Tags="&lt;quant-trading-strategies&gt;&lt;backtesting&gt;&lt;calibration&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="26307" PostTypeId="2" ParentId="22932" CreationDate="2016-05-28T19:03:31.737" Score="1" Body="&lt;p&gt;Generally, the Wishart stochastic volatility model identifies the volatility of the asset as the trace of a &lt;a href=&quot;https://arxiv.org/pdf/1201.3256v1.pdf&quot; rel=&quot;nofollow&quot;&gt;Wishart process&lt;/a&gt;. Contrary to a classic multifactor Heston model, this model allows to add degrees of freedom with regard to the stochastic correlation. Thanks to its flexibility, this model enables a better fit of market data than the Heston model. Besides, the Wishart volatility model keeps a clear interpretation of its parameters and conserves an efficient tractability.It was showed that calibration of Wishart stochastic volatility model is easier than SV model.&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastActivityDate="2016-05-28T19:03:31.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26308" PostTypeId="2" ParentId="4057" CreationDate="2016-05-28T21:55:13.387" Score="0" Body="&lt;p&gt;Here's an interesting approach to tackle the multi-strategy allocation problem from the paper: &#xA;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2745220&quot; rel=&quot;nofollow&quot;&gt;All that Glitters Is Not Gold: Comparing Backtest and Out-of-Sample Performance on a Large Cohort of Trading Algorithms&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The authors use non-linear machine learning classifiers to determine what is important in strategy selection.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although the authors don't focus on minimizing idiosyncratic risk, they do tackle the problem of over-fitting based on historical performance with other approaches such as the kelly/mean-variance approach. This work could also be extended to include more idiosyncratic risk factors. You could perhaps use the benchmark of each strategy for example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2745220&quot; rel=&quot;nofollow&quot;&gt;All that Glitters Is Not Gold: Comparing Backtest and Out-of-Sample Performance on a Large Cohort of Trading Algorithms&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="1764" LastEditDate="2016-05-29T04:47:42.457" LastActivityDate="2016-05-29T04:47:42.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26309" PostTypeId="1" CreationDate="2016-05-29T03:13:11.913" Score="1" ViewCount="671" Body="&lt;p&gt;I read in &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1584885580&quot; rel=&quot;nofollow&quot;&gt;E. Quian's &quot;Quantitative Equitity Portoflio Management&quot;&lt;/a&gt; the following:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A traditional long-only portfolio [with unit beta] would have most of its risk in the market risk. However, a zero beta portfolio, typically a long-short market-neutral portfolio, would have no systematic risk.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Why are Beta=1 portfolios typically &lt;strong&gt;long-only&lt;/strong&gt; and why are Beta=0 portfolios typically &lt;strong&gt;long-short&lt;/strong&gt; and &lt;strong&gt;market neutral&lt;/strong&gt;?&lt;/p&gt;&#xA;" OwnerUserId="6149" LastEditorUserId="6149" LastEditDate="2016-05-29T15:25:32.410" LastActivityDate="2016-05-29T17:51:08.827" Title="Beta = 1 and 0. Type of portfolios" Tags="&lt;portfolio-management&gt;&lt;capm&gt;&lt;beta&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26310" PostTypeId="1" CreationDate="2016-05-29T03:58:17.100" Score="0" ViewCount="241" Body="&lt;p&gt;Let's say I have formulated an integer linear programming (ILP) problem with the objective function $$F(X)=V(T,X)-C(t,X),$$ where $V(T,X)$ is the payoff of portfolio, and $C(t,X)$ is the initial cost of portfolio, $0&amp;lt;t&amp;lt;T$ is the calendar time, then I have setup a system of constraints and found the optimum solution $X=(x_1, x_2, \ldots, x_n)$, where $x_i$ is the number of units of an $i$-th asset in the portfolio, with $x_i&amp;gt;0$ for buying, $x_i&amp;lt;0$ for short selling.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I'd like to extend the system of constraints and add new constraint on the initial cost $C(t,X)$. Let's say $C(t,X)\le c$, where  $c$ can be either a positive number or zero, or even negative number. I think that theoretically I can find the optimum solution $X$ with the constraint $C(t,X)\le c$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the study (&lt;a href=&quot;http://www.cjournal.cz/files/99.pdf&quot; rel=&quot;nofollow&quot;&gt;Bartoňová M., 2012&lt;/a&gt;) was demonstrated the usage of zero-cost option’s strategy in hedging of sales. But on the page 125 the author conclude:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;And are they really zero-cost? As for initial fee, than yes. It is necessary to take into consideration that there is necessary general agreement with bank for option trading. It must be covered by collateral. There are also costs of contract processing, expert's opinions for assets evaluation, opportunity costs influencing of pledge, also of call option sale... Any zero-cost options are not really zero.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question:&lt;/strong&gt; Can I assume than an ivestor can use the money received&#xA;from the sale of some contracts to buy of other contracts in the portfolio? &#xA;Can I realize the optimal porfolio with the zero or negative initial cost on a market? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Peter Carr and Dilip Madan.  Towards a theory of volatility trading.  In R. Jarrow,  editor, Volatility , pages 417-427. Risk Publications, 1998.&lt;/p&gt;&#xA;" OwnerUserId="20913" LastEditorUserId="20913" LastEditDate="2016-10-28T04:57:26.693" LastActivityDate="2016-10-28T04:57:26.693" Title="Portfolio with zero or negative initial cost" Tags="&lt;portfolio-management&gt;&lt;optimization&gt;&lt;option-strategies&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26311" PostTypeId="2" ParentId="26309" CreationDate="2016-05-29T09:03:44.797" Score="2" Body="&lt;p&gt;Portfolio beta is a linear combination of each asset's beta times the weight of the asset in the portfolio.&#xA;Thus in general we have&#xA;$$&#xA;\beta = \sum_{i=1}^N w_i \beta_i&#xA;$$&#xA;where $w_i$ is the weight of asset $i$ and $\beta_i$ its beta.&#xA;If we assume that for stocks the betas are positive then&#xA;$\beta$ above is positive for positive weights.&#xA;If you have positive and negative weights then you can get $\beta=0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have a 130/30 portfolio - thus positive weights that sum to 130% and negative ones that sum to -30% then you can have a beta of approx 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that for mutual funds and individual investors it is not that easy to have short exposure to single stocks.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2016-05-29T17:51:08.827" LastActivityDate="2016-05-29T17:51:08.827" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26312" PostTypeId="1" CreationDate="2016-05-29T09:09:53.150" Score="2" ViewCount="131" Body="&lt;p&gt;Patton (2006) defines the upper tail dependence coefficient for a time-varying bivariate SJC copula as&#xA;$$\tau^u_t=\Lambda \left(\omega_u + \beta_u \tau^u_{t-1}+\alpha_u \frac{1}{10}\sum^{10}_{i=1}|u_{t-i}-v_{t-i}| \right)$$&#xA;where $\tau^u_t$ is the upper tail dependence coefficient at time $t$, $u_t$ and $v_t$ and the univariate transformations, and $\Lambda$ is a transformation function needed to keep $\tau^u_t$ in $[0,1]$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although I'm working on an extension for multivariate copulas, I'd like to use a similar equation. My (simple) question though (which I guess holds for way simpler cases like an ARMA(1,1) for any time series): how many observations do I need to estimate $\omega_u$, $\alpha_u$ and $\beta_u$; what is the value of $d$ in $(\tau^u_t)_{t\in\{1, ..., d\}}$ in order to have a reliable estimate? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Patton (2006): &lt;a href=&quot;http://www.christoffersen.com/CHRISTOP/2007/Patton_IER_2006.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.christoffersen.com/CHRISTOP/2007/Patton_IER_2006.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20573" LastActivityDate="2016-05-29T09:09:53.150" Title="Estimating time-varying tail dependence for Archimedean copulas" Tags="&lt;time-series&gt;&lt;copula&gt;&lt;arma&gt;&lt;dependence&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26313" PostTypeId="1" AcceptedAnswerId="26326" CreationDate="2016-05-29T09:36:47.450" Score="2" ViewCount="237" Body="&lt;p&gt;Assume a basket of 3 credits, each with some unconditional default probability ${q_i}(t) = \Pr [{\tau _i} \le t]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the joint CDF $H$ of the default times is given by $H(t,t,t) = \Pr [{\tau _1} \le t,{\tau _2} \le t,{\tau _3} \le t] = C({q_1}(t),{q_2}(t),{q_3}(t))$,&#xA;where $C$ is a known copula function (e.g. Archimedan).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: is there some (possibly Copula-based) representation of a function $G$ defined as $G(t,t,t) = \Pr [{\tau _1} &amp;gt; t,{\tau _2} \le t,{\tau _3} \le t]$ ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know a survival copula ${\bar C}$ can be constructed from $C$ but this is not entirely what I want as I want a joint probability of the last two names to default and the first name to survive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="18043" LastActivityDate="2016-05-30T08:02:21.743" Title="Copulas and default probability" Tags="&lt;credit-risk&gt;&lt;copula&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26314" PostTypeId="1" CreationDate="2016-05-29T10:32:25.380" Score="2" ViewCount="348" Body="&lt;p&gt;Minimum Variance Portfolio&#xA;Suppose there are N stocks in the investmentable universe and we have a fully invested portfolio investing 100% of the capital. The Covariance matrix is denoted as ∑.  We are interested in finding the portfolio with minimum variance. An investor choosing this portfolio is only concerned about the risk of the portfolio. Denoting a vector of ones by i=(1,….,1)^' ,  we have the following optimization problem:&lt;br&gt;&#xA;$$Minimize   \frac{1}{2}w'∑w$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Subject to : w’ .i = w_1 + w_2 +……+ w_N =1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to solve above problem using Lagrangian multipliers.&lt;/p&gt;&#xA;" OwnerUserId="20303" LastEditorUserId="20303" LastEditDate="2016-05-29T11:59:01.953" LastActivityDate="2016-05-29T11:59:01.953" Title="Minimum Variance Portfolio problem" Tags="&lt;portfolio&gt;&lt;portfolio-optimization&gt;&lt;mean-variance&gt;" AnswerCount="0" CommentCount="8" ClosedDate="2016-05-29T12:42:33.417" ContentLicense="CC BY-SA 3.0" />
  <row Id="26315" PostTypeId="1" AcceptedAnswerId="26316" CreationDate="2016-05-29T12:17:51.907" Score="5" ViewCount="2343" Body="&lt;p&gt;I am trying to compute the yield on the &lt;a href=&quot;http://www.cmegroup.com/trading/interest-rates/us-treasury/ultra-t-bond.html&quot; rel=&quot;noreferrer&quot;&gt;Ultra-Bond Treasury Futures&lt;/a&gt; which is roughly 172.2187. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Heres the description of the contract:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;U.S. Treasury bonds with remaining term to maturity of not less than&#xA;  25 years from the first day of the futures contract delivery month.&#xA;  The invoice price equals the futures settlement price times a&#xA;  conversion factor, plus accrued interest. The conversion factor is the&#xA;  price of the delivered bond ($1 par value) to yield 6 percent.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Here is what I have entered on my TVM calculator:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using the 30-year treasury to calculate coupon which is 2.65% ( however, I don't know if that is correct) &lt;a href=&quot;https://www.treasury.gov/resource-center/data-chart-center/interest-rates/Pages/TextView.aspx?data=yield&quot; rel=&quot;noreferrer&quot;&gt;US TREASURY Yields&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;N = 50                [25 * 2]&#xA;I = ?&#xA;PV = -172.2187&#xA;PMT = 1.3250          [((0.0265* 100)/2)]&#xA;FV = 100&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I solve this I get &lt;code&gt;I=-0.0874 %&lt;/code&gt;but I am not sure this is correct?&lt;/p&gt;&#xA;" OwnerUserId="13428" LastEditorUserId="13428" LastEditDate="2016-05-29T12:23:19.303" LastActivityDate="2016-05-31T14:26:44.163" Title="How to compute the yield on the Ultra-Bond Treasury Futures" Tags="&lt;bond-yields&gt;&lt;present-value&gt;&lt;bond-futures&gt;&lt;treasuries&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26316" PostTypeId="2" ParentId="26315" CreationDate="2016-05-29T15:32:21.883" Score="4" Body="&lt;p&gt;I think you have a little misunderstanding about treasury futures.  I would get this book:  &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0071456104&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.amazon.com/Treasury-Bond-Basis-Depth-Arbitrageurs/dp/0071456104?ie=UTF8&amp;amp;psc=1&amp;amp;redirect=true&amp;amp;ref_=oh_aui_search_detailpage&lt;/a&gt;  It is the absolute best guide to this product.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few important things to understand:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Every treasury future has optionality to it because you can deliver one of several securities.&lt;/li&gt;&#xA;&lt;li&gt;There is a conversion factor assigned to each deliverable bond.  The CBOT wanted to try to make it as if you are trading a 6% bond and to standardize across all deliverables.&lt;/li&gt;&#xA;&lt;li&gt;The seller of the contract can deliver from the first delivery date to the last.  In today's environment that usually means that you will get the bond on the last day since the carry is higher than the price drop of waiting.  That means you need to use the last delivery date for your settle date.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If you have BBerg enter WNM6 Comdty DLV and you will see the breakdown for the contract and it's deliverables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general to calculate the equivalent yield you have to look at the conversion factor assigned to each deliverable.  There is a formula for it somewhere.  I coded it up once upon a time decade ago and most market data services have that implemented as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general you will multiply the conversion factor time the price and then use the last settle date for the contract and that will get you the yield.  As it is now the ultra has little optionality to it so that will be roughly good enough.  For other contracts you will have to figure out the value of the option that the buyer of the contract is giving to the seller that lets them deliver a cheaper note if conditions change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/YBkSD.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/YBkSD.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt; Added a screen-shot from BBerg.  Take a look.  You can see it shows that the 8/41 is the cheapest to deliver and that the conversion factor is .7015.  &lt;/p&gt;&#xA;" OwnerUserId="20092" LastEditorUserId="20092" LastEditDate="2016-05-31T14:26:44.163" LastActivityDate="2016-05-31T14:26:44.163" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26317" PostTypeId="1" AcceptedAnswerId="26318" CreationDate="2016-05-29T17:03:12.707" Score="2" ViewCount="2431" Body="&lt;p&gt;I am attempting to use the &lt;code&gt;globalMin.portfolio&lt;/code&gt; command to calculate the global minimum variance portfolio in RStudio. My code is as follows (note that several libraries have been included which may not be necessary, since I am unclear which ones are needed to carry out the functions):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#Libraries&#xA;library(corpcor)&#xA;library(tseries)&#xA;library(fPortfolio)&#xA;library(quadprog)&#xA;library(SharpeR)&#xA;library(PortfolioAnalytics)&#xA;library(zoo)&#xA;library(plotly)&#xA;library(portfolio.r)&#xA;library(portfolio_noshorts.r)&#xA;&#xA;rk.free=0.005&#xA;&#xA;rm( list=ls() )&#xA;portfolio &amp;lt;- read.csv2(&quot;File Directory/Document.csv&quot;)&#xA;T &amp;lt;- nrow(portfolio)&#xA;portfolio &amp;lt;- portfolio[ seq(T,1,-1) , ]&#xA;stock1_r&amp;lt;- diff(log(portfolio$stock1))*100&#xA;stock2_r &amp;lt;- diff(log(portfolio$stock2))*100&#xA;stock3_r&amp;lt;- diff(log(portfolio$stock3))*100&#xA;stock4_r	&amp;lt;- diff(log(portfolio$stock4))*100&#xA;stock5_r    &amp;lt;- diff(log(portfolio$stock5))*100&#xA;stock6_r&amp;lt;- diff(log(portfolio$stock6))*100&#xA;stock7_r&amp;lt;- diff(log(portfolio$stock7))*100&#xA;stock8_r&amp;lt;- diff(log(portfolio$t))*100&#xA;stock9_r&amp;lt;- diff(log(portfolio$stock9))*100&#xA;stock10_r&amp;lt;- diff(log(portfolio$stock10))*100&#xA;&#xA;portfolio_r &amp;lt;- data.frame(stock1_r, stock2_r, stock3_r, stock4_r, stock5_r, stock6_r, stock7_r, stock8_r, stock9_r, stock10_r)&#xA;er1=c(mean(stock1_r), mean(stock2_r), mean(stock3_r), mean(stock4_r), mean(stock5_r), mean(stock6_r), mean(stock7_r), mean(stock8_r), mean(stock9_r), mean(stock10_r))&#xA;&#xA;#Covariance Matrix&#xA;covmat1&amp;lt;-cov(portfolio_r)&#xA;&#xA;#Shrinkage estimate of covariance&#xA;cov.shrink(portfolio_r)&#xA;&#xA;#Transform covariance to correlation matrix&#xA;cov2cor(covmat1)&#xA;ew1=rep(1,10)/10&#xA;er1&#xA;covmat1&#xA;ew1&#xA;&#xA;#Compute global minimum variance portfolio&#xA;gmin.port = globalMin.portfolio(er1, covmat1)&#xA;attributes(gmin.port)&#xA;print(gmin.port)&#xA;summary(gmin.port, rk.free=r.free)&#xA;plot(gmin.port, col=&quot;blue&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I attempt to calculate the global minimum variance portfolio, I simply get the error message; &lt;code&gt;&quot;Error: could not find function &quot;globalMin.portfolio&quot;&lt;/code&gt;. This happens even though the expected return (&lt;code&gt;er1&lt;/code&gt;) and covariance matrix (&lt;code&gt;covmat1&lt;/code&gt;) are calculated and output is shown when the program is run. Would appreciate any help.&lt;/p&gt;&#xA;" OwnerUserId="20937" LastEditorUserId="467" LastEditDate="2016-11-04T10:02:40.277" LastActivityDate="2016-11-04T10:05:30.143" Title="How to calculate the global minimum variance portfolio in R?" Tags="&lt;programming&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26318" PostTypeId="2" ParentId="26317" CreationDate="2016-05-29T18:47:51.820" Score="2" Body="&lt;p&gt;The last 2 calls must be changed from&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(portfolio.r) &#xA;&#xA;library(portfolio_noshorts.r)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;source(portfolio.r)&#xA;&#xA;source(portfolio_noshorts.r)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The correct files must be availbale at &lt;a href=&quot;http://Econometrics%20Webpage&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://faculty.washington.edu/ezivot/econ424/&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2142" LastEditorUserId="467" LastEditDate="2016-11-04T10:05:30.143" LastActivityDate="2016-11-04T10:05:30.143" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26319" PostTypeId="1" CreationDate="2016-05-29T21:25:12.723" Score="3" ViewCount="42" Body="&lt;p&gt;Can anyone provide a formula for a polynomial interpolation of the corrected lognormal distribution used to model returns traditionally resulting from the wrong Brownian motion generated model? Obviously I am only looking for a sufficiently good approximation. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="20940" LastActivityDate="2016-05-29T21:25:12.723" Title="Polynomial interpolation of corrected lognormal distribution" Tags="&lt;returns&gt;&lt;brownian-motion&gt;&lt;expected-return&gt;&lt;lognormal&gt;&lt;asset-returns&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26321" PostTypeId="2" ParentId="26288" CreationDate="2016-05-29T22:06:56.400" Score="2" Body="&lt;p&gt;My 3 points for you:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Earlier checks like pre-compliance checks for orders are usually performed.&lt;/li&gt;&#xA;&lt;li&gt;Three different types of orders are correctly recognized - i.e. proposed orders but not routed, submitted orders and waiting for acknowledgement. When an order is added to the submitted queue, it should go through compliance checks and then be added orders which will be routed. &lt;/li&gt;&#xA;&lt;li&gt;Ideally order and execution ids should be kept separate because sometimes an order is partially executed.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="6670" LastActivityDate="2016-05-29T22:06:56.400" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26322" PostTypeId="1" CreationDate="2016-05-29T22:09:27.100" Score="1" ViewCount="270" Body="&lt;p&gt;I have a very fundamental question regarding simulation of DRIFTED geometric brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have the standard Blackos Scholes model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS(t)=r S(t)dt+\sigma S(t) dW^{\mathbb{P}}(t)$, where $W^{\mathbb{P}}(t)$ is the standard Wiener process under probability measure $\mathbb{P}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we want to simulate this, using constant $\Delta t$, we use the recursive formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_{t+1}=S_te^{(r-\frac{\sigma^2}{2})\Delta t+\sigma \sqrt{\Delta t} Z_t }$, where $Z_t \sim N(0,1)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now assume that we want to change the drift such that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$W^{\mathbb{Q}}(t) = W^{\mathbb{P}}(t) - \int_0^t \theta_s ds$ is a brownian motion under $\mathbb{Q}$ such that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS(t)=(r + \sigma \theta )S(t)dt+\sigma S(t) dW^{\mathbb{Q}}(t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now this is where I become unsure. If I want to simulate the drifted process, is it just fine to use the similar method as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_{t+1}=S_te^{(r+\sigma \theta-\frac{\sigma^2}{2})\Delta t+\sigma \sqrt{\Delta t} Z_t }$, where $Z_t \sim N(0,1)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OR is it that I have to use $Z_t \sim N(\theta, 1)$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Im not that strong in the change of measure part, so thats why I'm a bit unsure.&#xA;Would appreciate for help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="18211" LastEditorUserId="18211" LastEditDate="2016-05-30T09:32:32.583" LastActivityDate="2016-05-30T13:00:51.630" Title="Simulate drifted geometric brownian motion under new measure" Tags="&lt;stochastic-processes&gt;&lt;risk-neutral-measure&gt;&lt;simulations&gt;&lt;numerairechange&gt;&lt;girsanov&gt;" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="26323" PostTypeId="2" ParentId="26322" CreationDate="2016-05-29T23:33:49.103" Score="1" Body="&lt;p&gt;in the new measure, the stock has drift $r + \sigma \theta$ so yes you just proceed with that drift as you say. If $\theta$ is time dependent, it gets more complicated.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2016-05-29T23:33:49.103" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26324" PostTypeId="1" CreationDate="2016-05-30T01:58:40.947" Score="4" ViewCount="1018" Body="&lt;p&gt;First of all, assuming a Gaussian, Markowitz, well behaved world. Extensions for non-well behaved world will be welcomed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that by a portfolio made by only by one stock (and a risk free bond) I can use the formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;f* = (R-Rf)/d^2 &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;f* - Wealth fraction that maximize the log return &#xA;R - Asset Return &#xA;Rf - Risk-free return d - Standard Deviation&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But in a portfolio made by a Stock and a option, considering I am only interested in the return at 'the end of the month', so I'm not gonna hedge continually, only buy a stock and a option and wait until expiration. Is there any closed form solution? I currently doing it by Monte Carlo in Excel, but it is a little bit unpractical since I have to simulate all the wealth fraction to see which one maximizes de log return on average (times all the options available).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea?&lt;/p&gt;&#xA;" OwnerUserId="20942" LastActivityDate="2017-01-21T20:56:05.897" Title="How to apply Kelly criterion to a portfolio made by a stock plus a option?" Tags="&lt;portfolio-optimization&gt;&lt;option-strategies&gt;&lt;kelly-criterion&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26325" PostTypeId="1" CreationDate="2016-05-30T03:11:29.947" Score="1" ViewCount="227" Body="&lt;p&gt;How can I construct a simple calculator to imply the cross-currency basis (with sides) from the FX forward and interest rate markets, at maturities under 1y?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Depending on liquidity the market in Australia can get quite out of line between the two.&lt;/p&gt;&#xA;" OwnerUserId="20944" LastEditorUserId="1314" LastEditDate="2016-07-20T10:57:43.497" LastActivityDate="2016-07-20T11:42:51.230" Title="How do I build a cross currency basis swap pricer using implied levels generated from fx forwards?" Tags="&lt;fx&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26326" PostTypeId="2" ParentId="26313" CreationDate="2016-05-30T08:02:21.743" Score="3" Body="&lt;p&gt;$$\text{Pr}[\tau_1&amp;gt;t,\tau_2\leq t,\tau_3\leq t]=\text{Pr}[\tau_2\leq t,\tau_3\leq t] - \text{Pr}[\tau_1\leq t,\tau_2\leq t,\tau_3\leq t]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Pr}[\tau_2\leq t,\tau_3\leq t]=C(1,q_2(t),q_3(t))$$&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-05-30T08:02:21.743" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26327" PostTypeId="2" ParentId="25772" CreationDate="2016-05-30T08:43:29.093" Score="1" Body="&lt;p&gt;Your approach is correct. But  unfortunately it is not applicable. In the case i.e. $\frac{1}{2}&amp;lt;H&amp;lt;1$, &lt;a href=&quot;http://www.emis.de/journals/HOA/IJSA/Volume9_4/448.pdf&quot; rel=&quot;nofollow&quot;&gt;Dai and Heyde&lt;/a&gt; have defined a stochastic integral as limit of Riemann sums.Their approach does not satisfy the property $E[\int_{0}^{t}f(s)dB_{H}s]=0$ (Why?!!). For this reason, &lt;a href=&quot;https://www.math.ku.edu/ksacg/PDF/Duncan-Hu-PDuncan_paper.pdf&quot; rel=&quot;nofollow&quot;&gt;Duncan&lt;/a&gt; have introduced a new stochastic integral with zero mean which is the limit of Riemann sums defined by means of the Wick product. Nowadays, Since the fBm is a Gaussian process, one can apply the stochastic calculus of and introduce the stochastic integral as the divergence operator,that is, the adjoint of the derivative operator variations.Using the notions of fractional integral and derivative, &lt;a href=&quot;http://www.minet.uni-jena.de/fakultaet/mgeo/publicat/pdffiles/iwrtff1_ptrf98.pdf&quot; rel=&quot;nofollow&quot;&gt;Zhahle&lt;/a&gt; has introduced&#xA;a path-wise stochastic integral. The integral of a process $f(s)$ on a time interval $[0, T]$ is defined as&#xA;$$\int_{0}^{T}f(s)dB_{H}(s)=(-1)^{\beta}\int_{0}^{T} D_{0^{t}}^{\beta}D_{T-}^{1-\beta}B_{H}(s)f(s)ds+f(0+)B_{H}(T)$$&#xA;where $D^{\beta}$ denotes the fractional derivative of order $\beta$, and assuming $\beta&amp;gt;1−H$ and $f$ belongs to the space $I_{0+}^{\beta}(L^1([0,T])$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I should mention when process $f$ has $\lambda$-Holder continuous paths with $\lambda&amp;gt;1 − H$, then this integral can be interpreted as a Riemann_Stieltjes integral.&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-05-30T09:23:40.317" LastActivityDate="2016-05-30T09:23:40.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26328" PostTypeId="2" ParentId="26310" CreationDate="2016-05-30T09:21:17.600" Score="1" Body="&lt;p&gt;Interesting question.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer it directly, try searching for the term 'Sequential Quadratic Programming'.  This should lead you to relevant references.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More details, if I am reading your question correctly you are hoping to minimize the loss of a strategy involving sequential transactions (buying or selling) of options. I think your question would be more clear if you also indexed the the asset value by time (the equation does look like you are assuming the asset price is fixed at some future date throughout the duration of the strategy period) and if you do not impose symmetry with respect to the time you do a transaction involving an option. I also think it would be easier to express this problem as a minimization problem and to make it clear whether you are buying or selling the option at a given time period.  This should help clarify your objective function.  &lt;/p&gt;&#xA;" OwnerDisplayName="user20928" LastActivityDate="2016-05-30T09:21:17.600" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26329" PostTypeId="1" AcceptedAnswerId="26337" CreationDate="2016-05-30T12:40:45.050" Score="2" ViewCount="201" Body="&lt;p&gt;In the Double Heston model, there are 2 distinct volatility processes. The SDEs read&#xA;\begin{align}&#xA; &amp;amp; d{{S}_{t}}=r{{S}_{t}}dt+\sqrt{{{v}_{1}}(t)}{{S}_{t}}d{{W}_{1}}(t)+\sqrt{{{v}_{2}}(t)}{{S}_{t}}d{{W}_{2}}(t) \\ &#xA; &amp;amp; d{{v}_{1}}(t)={{\kappa }_{1}}\,({{\theta }_{1}}-{{v}_{1}})\,dt+\,\,{{\sigma }_{1}}\sqrt{{{v}_{1}}(t)}\,d{{B}_{1}}(t) \\ &#xA; &amp;amp; d{{v}_{2}}(t)={{\kappa }_{2}}({{\theta }_{2}}-{{v}_{2}})dt+{{\sigma }_{2}}\sqrt{{{v}_{2}}(t)}\,d{{B}_{2}}(t) \\ &#xA; &amp;amp; E[d{{W}_{1}}d{{B}_{1}}]={{\rho }_{1}}dt \\ &#xA; &amp;amp; E[d{{W}_{2}}d{{B}_{2}}]={{\rho }_{2}}dt \\ &#xA; &amp;amp; E[d{{W}_{1}}d{{B}_{2}}]=E[d{{W}_{2}}d{{B}_{1}}]=E[d{{W}_{1}}d{{W}_{2}}]=E[d{{B}_{1}}d{{B}_{2}}]=0 \\ &#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could someone point out what could be the advantages of using such a model? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="20945" LastEditorUserId="19887" LastEditDate="2016-05-30T21:53:34.350" LastActivityDate="2016-05-30T22:05:43.347" Title="What is the rationale behind using SV models with 2 distinct volatility processes?" Tags="&lt;volatility&gt;&lt;stochastic-volatility&gt;&lt;heston&gt;&lt;svm&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26330" PostTypeId="2" ParentId="26329" CreationDate="2016-05-30T12:47:26.650" Score="1" Body="&lt;p&gt;Loosely speaking, it can be seen as inserting an additional &lt;strong&gt;degree of freedom&lt;/strong&gt; in the underlying's dynamics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be useful from a &lt;strong&gt;static&lt;/strong&gt; perspective: with an additional lever to play on, one can hope to better capture the short term implied volatility smile, which &quot;naive&quot; stochastic volatility models (single volatility factor, no jumps) are known to be bad at (the same goes for the ATM implied volatility term structure).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This additional degree of freedom also allows for richer &lt;strong&gt;forward dynamics&lt;/strong&gt; (notably stochastic skew).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additional info, see &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1447362&amp;amp;download=yes&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;State-of-the-art stochastic volatility models generate a volatility smirk that explains why out-of-the-money index puts have high prices relative to the Black-Scholes benchmark. These models also adequately explain how the volatility smirk moves up and down in response to changes in risk. However, the data indicate that the slope and the level of the smirk fluctuate largely independently. While single-factor stochastic volatility models can capture the slope of the smirk, they cannot explain such largely independent fluctuations in its level and slope over time. We propose to model these movements using a two-factor stochastic volatility model. Because the factors have distinct correlations with market returns, and because the weights of the factors vary over time, the model generates stochastic correlation between volatility and stock returns.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-05-30T22:05:43.347" LastActivityDate="2016-05-30T22:05:43.347" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="26331" PostTypeId="2" ParentId="26322" CreationDate="2016-05-30T13:00:51.630" Score="1" Body="&lt;p&gt;Note that, under measure $Q$, the dynamics is of the form&#xA;\begin{align*}&#xA;dS_t = S_t \big[(r+ \sigma \theta_t) dt + \sigma dW_t^Q \big].&#xA;\end{align*}&#xA;Then, for $\Delta&amp;gt;0$ sufficiently small,&#xA;\begin{align*}&#xA;S_{t+\Delta} &amp;amp;= S_te^{\left(r-\frac{1}{2}\sigma^2\right)\Delta + \sigma \int_t^{t+\Delta} \theta_s ds + \sigma \left(W_{t+\Delta}^Q-W_t^Q\right)}\\&#xA;&amp;amp;\approx S_te^{\left(r-\frac{1}{2}\sigma^2 + \sigma \theta_t\right)\Delta + \sigma \sqrt{\Delta} Z},&#xA;\end{align*}&#xA;assuming that $\theta_t$ is continuous, where $Z\sim N(0, 1)$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-05-30T13:00:51.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26332" PostTypeId="1" CreationDate="2016-05-30T13:10:53.983" Score="1" ViewCount="3501" Body="&lt;p&gt;I use the following well known formula in order to determine the weight of asset i in the tangency portfolio (in the case of two risky assets):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$w_{i,T}=\frac{\sigma[r_2]^2E[R_1]-\sigma[r_1,r_2]E[R_2]}{\sigma[r_2]^2E[R_1]-\sigma[r_1,r_2]E[R_2]+\sigma[r_1]^2E[R_2]-\sigma[r_1,r_2]E[R_1]}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $E[R_i]=r_i-r_f$ is the excess return on asset i (in excess of the riskless rate).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whilst I think I understand the underlying rational and derivation of this formula, it leads to some weird behavior which I don't understand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, let me choose as input $E[R_1]=0,05$, $E[R_2]=0,1$, $\sigma_1=0,12$, $\sigma_2=0,20$ and let me play around with the correlation coefficient $\rho_{1,2}$ (where $\sigma_{1,2}=\rho_{1,2}\sigma_1\sigma_2$).&#xA;The higher the correlation, the lower the weight of asset 1. For instance, in the case of $\rho_{1,2}=0,8$ the weight of asset 1 turns out to be 14,29%. In the case of $\rho_{1,2}=0,9$, the weight of asset 1 is -80%. In the case of a long-only restriction, I’d assume that asset 1 gets a weight of 0% and asset 2 a weight of 100% - which makes intuitively sense. However, if the correlation is $\rho_{1,2}=1,0$, the weight is 250% - i.e. again assuming a long-only constraint, the weights in the tangency portfolio would be now the other way around. This behavior is not limited to the specific input parameters. Why is that?&#xA;Obviously there is something about this formula and tangency portfolio concept which I don’t fully understand yet. I would appreciate any help.&#xA;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="20787" LastActivityDate="2016-05-30T13:10:53.983" Title="Problem with determining weights in tangency portfolio (2 risky assets)" Tags="&lt;portfolio&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio-selection&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26333" PostTypeId="1" AcceptedAnswerId="26344" CreationDate="2016-05-30T14:10:00.573" Score="-1" ViewCount="73" Body="&lt;p&gt;For exam preparation we are given some past papers, however there are no solutions and I would like to know if my logic is correct for the following question:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Assume you are 25 years old. An insurance company is offering you the&#xA;  following retirement contract: Pay in \$2000 per year for the next 40&#xA;  years. When you reach 65 years of age, you will receive \$20000 per&#xA;  year until you reach 100. Assume the prevailing interest rate is 5%&#xA;  per year, all payments occur at year end, and it is January 1 now. Is&#xA;  this annuity a good deal?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="17772" LastEditorUserId="17772" LastEditDate="2016-05-30T21:17:01.480" LastActivityDate="2016-05-30T21:31:20.050" Title="NPV of two annuities" Tags="&lt;annuity&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26334" PostTypeId="2" ParentId="22780" CreationDate="2016-05-30T14:19:09.393" Score="2" Body="&lt;p&gt;Note that the survival copula $C_{\theta_A, \theta_B}(u, v)$ and the non-survival copula $C(u, v)$ are related by&#xA;\begin{align*}&#xA;C_{\theta_A, \theta_B}(\hat{u}, \hat{v}) = \hat{u}+\hat{v}-1 + C(1-\hat{u}, 1-\hat{v}),&#xA;\end{align*}&#xA;where $\hat{u}=\bar{F}_A(x)=1 - F_A(x)$ and $\hat{v}=\bar{F}_B(y)=1-F_B(y)$.&#xA;Then,&#xA;\begin{align*}&#xA;C(u, v) = C_{\theta_A, \theta_B}(1-u, 1-v) + u+v-1,&#xA;\end{align*}&#xA;where $u=F_A(x)$ and $v=F_B(y)$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-05-30T14:40:18.167" LastActivityDate="2016-05-30T14:40:18.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26335" PostTypeId="2" ParentId="25126" CreationDate="2016-05-30T14:27:08.227" Score="1" Body="&lt;p&gt;Negative y means you're short the stock. This may have costs, just as being long the stock may have income from lending it to someone else. These costs can easily be incorporated as a growth adjustment to the stock. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since it costs more to borrow than you make from lending, the growth adjustment should depend on whether your overall position is long or short. (But not whether the particular derivative being priced implies a long or short stock hedge.)&lt;/p&gt;&#xA;" OwnerUserId="20681" LastActivityDate="2016-05-30T14:27:08.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26336" PostTypeId="1" CreationDate="2016-05-30T14:54:40.937" Score="0" ViewCount="75" Body="&lt;p&gt;When I want the monthly volatility of stock and I only have data for about one month and I do calculation like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  Date  Close      Daily Returns   STDEV               STDEV * 24&#xA;    2015-07-15  162.1           &#xA;    2015-07-14  164.5   0.0148056755    0.0165791585    0.0812209576&#xA;    2015-07-13  165     0.0030395137        &#xA;    2015-07-10  160.7   -0.0260606061       &#xA;    2015-07-09  158     -0.0168014935       &#xA;    2015-07-08  154.2   -0.0240506329       &#xA;    2015-07-07  154.6   0.0025940337        &#xA;    2015-07-06  157.5   0.0187580854        &#xA;    2015-07-03  160.8   0.020952381     &#xA;    2015-07-02  161.2   0.0024875622        &#xA;    2015-07-01  161     -0.0012406948       &#xA;    2015-06-30  156.1   -0.0304347826       &#xA;    2015-06-29  158     0.0121716848        &#xA;    2015-06-26  162.5   0.0284810127        &#xA;    2015-06-25  162     -0.0030769231       &#xA;    2015-06-24  160.7   -0.0080246914       &#xA;    2015-06-23  162.9   0.0136901058        &#xA;    2015-06-22  159.4   -0.021485574        &#xA;    2015-06-19  156.6   -0.017565872        &#xA;    2015-06-16  157.8   0.0076628352        &#xA;    2015-06-15  156     -0.0114068441       &#xA;    2015-06-12  159     0.0192307692        &#xA;    2015-06-11  158.9   -0.0006289308       &#xA;    2015-06-10  159.3   0.0025173065        &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So I get 8.1% in monthly volatility. Is this correct calculation or do I have to have one year of data for it to be &quot;correct&quot;?&#xA;Cheers&lt;/p&gt;&#xA;" OwnerUserId="20949" LastActivityDate="2016-06-01T09:36:05.767" Title="Volatility for time periods with little data" Tags="&lt;volatility&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26337" PostTypeId="2" ParentId="26329" CreationDate="2016-05-30T15:55:53.467" Score="1" Body="&lt;p&gt;I think,the additional volatility factor,$v_2(t)$, provides more flexibility in modeling the volatility surface.We know $\rho$ controls the slope of the implied volatility.In the single-factor Heston model, $\rho$ is constant over maturities,In deed&#xA;$$Corr[{dS}/{S\,,\,dv]}\;=\rho \,$$&#xA; which means that model has trouble providing an adequate fit to market implied volatilities when the slope of the smile varies substantially across maturities, although it does a good job when the slopes are all relatively flat or all relatively steep. Incorporating a second volatility factor allows for two different correlations and, hence, for two different regimes of volatility, because In the Double Heston model, the correlation between&#xA;the returns and their variance is stochastic:&#xA;$$Corr[{dS}/{S\,,\,dv]}\;=\frac{{{\sigma }_{1}}{{\rho }_{1}}{{v}_{1}}\,+{{\sigma }_{2}}{{\rho }_{2}}{{v}_{2}}}{\sqrt{{{\sigma }_{1}}{{}^{2}}{{v}_{1}}\,+{{\sigma }_{2}}^{2}{{v}_{2}}}\,\sqrt{{{v}_{1}}\,+{{v}_{2}}}}\,$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, I show the correlation between the returns and  variance processe is stochastic:&#xA;for $j=1,2$ we have&#xA;$$Cov\,[{dS}/{S\,,\,}\;d{{v}_{j}}]={{\sigma }_{j}}{{\rho }_{j}}{{v}_{j}}\,dt$$&#xA;let $v=v_1+v_2$, as a result&#xA;$$Cov\,[{dS}/{S\,,\,}\;dv]=({{\sigma }_{1}}{{\rho }_{1}}{{v}_{1}}\,+{{\sigma }_{2}}{{\rho }_{2}}{{v}_{2}}\,)dt$$&#xA;on the other hand&#xA;\begin{align}&#xA;  &amp;amp; Var\,[{dS}/{S}\;]=({{v}_{1}}\,+{{v}_{2}})dt=vdt \\ &#xA; &amp;amp; Var\,[dv]=({{\sigma }_{1}}{{}^{2}}{{v}_{1}}\,+{{\sigma }_{2}}^{2}{{v}_{2}}\,)dt \\ &#xA;\end{align}&#xA;then&#xA;$$Corr[{dS}/{S\,,\,dv]}\;=\frac{Cov\,[{dS}/{S\,,\,}\;dv]}{\sqrt{ Var\,[{dS}/{S}\;]Var\,[dv]}}=\frac{{{\sigma }_{1}}{{\rho }_{1}}{{v}_{1}}\,+{{\sigma }_{2}}{{\rho }_{2}}{{v}_{2}}}{\sqrt{{{\sigma }_{1}}{{}^{2}}{{v}_{1}}\,+{{\sigma }_{2}}^{2}{{v}_{2}}}\,\sqrt{{{v}_{1}}\,+{{v}_{2}}}}\,$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-05-30T20:18:54.280" LastActivityDate="2016-05-30T20:18:54.280" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26338" PostTypeId="2" ParentId="26336" CreationDate="2016-05-30T16:09:10.107" Score="4" Body="&lt;p&gt;&lt;strike&gt;Not sure why you're multiplying by 24?&lt;/strike&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: got confused by your &lt;code&gt;STDEV * 24&lt;/code&gt;, you meant (and calculated) &lt;code&gt;STDEV * SQRT(24)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $X_i$ is random variable representing daily &lt;em&gt;log&lt;/em&gt; returns, and assuming that log returns are &lt;a href=&quot;https://en.wikipedia.org/wiki/Independent_and_identically_distributed_random_variables&quot; rel=&quot;nofollow&quot;&gt;i.i.d.&lt;/a&gt; then volatility of monthly return is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma_{monthly}=\sqrt{21}\times\sigma_{daily}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(assuming 252 days a year, i.e. $252/12=21$ per month).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and consequently, the yearly vol is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma_{annual}=\sqrt{252}\times\sigma_{daily}$&lt;/p&gt;&#xA;" OwnerUserId="18030" LastEditorUserId="18030" LastEditDate="2016-06-01T09:36:05.767" LastActivityDate="2016-06-01T09:36:05.767" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26339" PostTypeId="2" ParentId="26294" CreationDate="2016-05-30T18:13:53.773" Score="0" Body="&lt;p&gt;Several issues arise no matter which approach you choose (as a reference for my claims you can go through &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2606884&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the covariance matrix of many assets can become instable (the more assets the more instable). Then your PCA will be based on noise. Therefore first get a good stimator of covariance. Using data of something like a year of observations worked good for me. Shrinkage is a good method to estimate the covariance matrix.&lt;/li&gt;&#xA;&lt;li&gt;Then you could use PCA ... but why should you? PCA with long and short loadings will be instable. &lt;/li&gt;&#xA;&lt;li&gt;For me the place to go would be to set-up an optimization problem (and solve it):&lt;/li&gt;&#xA;&lt;li&gt;minimize the tracking error (based on the stable covariance matrix)&lt;/li&gt;&#xA;&lt;li&gt;subject to: long only weights (this will make the thing more robust)&lt;/li&gt;&#xA;&lt;li&gt;and subject to:a cardinality constraint: you want to use $N$ assets for the basket&lt;/li&gt;&#xA;&lt;li&gt;and subject to: sector constraints: if all fails then you will have stocks with enough weight from every sector.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The above will give you a basked with only positive weights, controlled sector deviations and a control over the number of assets in the basket and finally a TE estimate.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-05-30T18:13:53.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26340" PostTypeId="1" AcceptedAnswerId="26343" CreationDate="2016-05-30T20:33:57.680" Score="3" ViewCount="463" Body="&lt;p&gt;I understand the &lt;a href=&quot;https://quant.stackexchange.com/questions/25619/excess-residual-and-active-return&quot;&gt;difference between Excess, Residual and Active Returns&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also understand what &lt;strong&gt;Active Risk&lt;/strong&gt;; defined as: $\sigma_{r_P-r_B}$  (i.e. standard deviation of the difference in returns between our portfolio and benchmark).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, what exactly is &lt;strong&gt;Residual Risk&lt;/strong&gt;? I often see it defined (e.g. &lt;a href=&quot;http://people.brandeis.edu/~yanzp/Study%20Notes/Active%20Portfolio%20Management.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;) as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\omega_p = \sqrt{\sigma^ 2_p-\beta^2_p\sigma^2_B}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $\beta_P = \frac{\text{Cov}(r_p, r_B)}{Var(r_B)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where does this derivation come from? What is residual risk exactly? &lt;/p&gt;&#xA;" OwnerUserId="6149" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-05-30T22:26:30.510" Title="Mathematical Derivation of Residual Risk" Tags="&lt;risk&gt;&lt;capm&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26341" PostTypeId="2" ParentId="26329" CreationDate="2016-05-30T20:56:56.297" Score="2" Body="&lt;p&gt;Two volatility processes yield a higher flexibility of the model. This is of greater importance if one tries to price derivatives with different maturities in one single model. A additional volatility component helps to capture the term structure of volatility, which can depend greatly on time to maturity. See for example the VIX term structure from CBOE:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cboe.com/data/volatilityindexes/volatilityindexes.aspx&quot; rel=&quot;nofollow&quot;&gt;http://www.cboe.com/data/volatilityindexes/volatilityindexes.aspx&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://vixcentral.com/&quot; rel=&quot;nofollow&quot;&gt;http://vixcentral.com/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With maturity average volatility increases/decreases (depends on economic condition) and the increases/decreases are the largest in magnitude for short maturities. The longer the maturity the smaller the change in average volatility per time. To model this properly models have to incorporate a &quot;short-term&quot; volatility component and a &quot;long-term&quot; component. A detailed discussion can be found in &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;The Shape and Term Structure of the Index Option Smirk:&#xA;Why Multifactor Stochastic Volatility Models Work so Well, Peter Christoffersen, Steven Heston, Kris Jacobs, 2009&quot; -- &#xA;&lt;a href=&quot;http://fic.wharton.upenn.edu/fic/papers/09/0905.pdf&quot; rel=&quot;nofollow&quot;&gt;http://fic.wharton.upenn.edu/fic/papers/09/0905.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The model can be found on P.8 EQ: 3-5 and the parameter estimates on P.40 Table 3. What we see is a a long-term volatiltiy ($V_1$) of high persitence and low volatility-of-volatility $\sigma_1$  and a erratic short-term volatility ($V_2$)  of low persitence (high mean reversion speed) and high volatility-of-volatility $\sigma_2$. Therefore, those parameters show impressivly the two-fold dynamic of volatility.&lt;/p&gt;&#xA;" OwnerUserId="6640" LastActivityDate="2016-05-30T20:56:56.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26342" PostTypeId="2" ParentId="26333" CreationDate="2016-05-30T21:01:21.780" Score="0" Body="&lt;p&gt;I'm in your class and was stuck on this too&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's how I make it:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PV of contributions = (2000/0.05)*[1-(1/1.05^40)] = 34318.17&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PV of amount received = (20000/0.05)*[1-(1/1.05^35)] = 327483.89&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Value today of amount received = PV of amount received / (1.05)^40 = 59369.64&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore this annuity is a good deal. Still unsure with this, have you come to a conclusion yet? Thanks&lt;/p&gt;&#xA;" OwnerUserId="20952" LastEditorUserId="20952" LastEditDate="2016-05-30T21:31:20.050" LastActivityDate="2016-05-30T21:31:20.050" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26343" PostTypeId="2" ParentId="26340" CreationDate="2016-05-30T21:04:34.020" Score="7" Body="&lt;p&gt;Note that $\beta$ is the coefficient of the portfolio regressed on the benchmark. That is&#xA;\begin{align*}&#xA;r_P = \alpha+\beta r_B + \varepsilon,&#xA;\end{align*}&#xA;where $\varepsilon$ is the residual. The standard deviation of the residual is called the residual risk. Specifically,&#xA;\begin{align*}&#xA;std(\varepsilon) &amp;amp;= \sqrt{var(r_P-\beta r_B-\alpha)}\\&#xA;&amp;amp;=\sqrt{\sigma_P^2 + \beta^2 \sigma_B^2 - 2 \beta \rho(r_P, r_B) \sigma_P\sigma_B}\\&#xA;&amp;amp;=\sqrt{\sigma_P^2 + \beta^2 \sigma_B^2 - 2 \beta\, \beta\, var(r_B)}\\&#xA;&amp;amp;= \sqrt{\sigma_P^2 - \beta^2 \sigma_B^2},&#xA;\end{align*}&#xA;since $cov(r_P, r_B) = \rho(r_P, r_B)\sigma_P \sigma_B =\beta\, var(r_B)$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-05-30T22:26:30.510" LastActivityDate="2016-05-30T22:26:30.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26344" PostTypeId="2" ParentId="26333" CreationDate="2016-05-30T21:17:41.623" Score="1" Body="&lt;p&gt;Assume that &quot;I&quot; was born on 1st of January. I pay for $40$ years and receive payments for $36$ years ($65$ to $100$). So I pay when I am &#xA;$$25, 26 \dots 64$$&#xA;and receive payments when I am&#xA;$$65, 66,\dots 100.$$&#xA;Hence the PVs of the annuities are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\begin{equation}&#xA;PV_{paid} = \frac{2000}{0.05}\left(1-\left(\frac{1}{1.05}\right)^{40}\right) = 34318.1727 \quad \text{(to 4dp)}\\&#xA;PV_{received~when~65} = \frac{20000}{0.05}\left(1-\left(\frac{1}{1.05}\right)^{36}\right) = 330937.0342\quad \text{(to 4dp)}\\&#xA;PV_{received} = PV_{received~when~65}\times\left(\frac{1}{1.05}\right)^{40} = 47008.1768\quad \text{(to 4dp)}\\&#xA;\end{equation}&#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\therefore NPV = PV_{received} - PV_{paid} = 12690.0041 \quad \text{(to 4dp)}.&#xA;$$&#xA;Hence the annuity is a good deal (having positive NPV).&lt;/p&gt;&#xA;" OwnerUserId="17772" LastActivityDate="2016-05-30T21:17:41.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26345" PostTypeId="1" AcceptedAnswerId="26364" CreationDate="2016-05-31T02:03:13.553" Score="3" ViewCount="789" Body="&lt;p&gt;What is the point/benefit of using a dollar-neutral strategy &lt;em&gt;&lt;strong&gt;in addition to&lt;/strong&gt;&lt;/em&gt; a Beta-neutral strategy? What exactly does a dollar-neutral strategy buy the investor? What's useful about balancing long and short positions?&lt;/p&gt;&#xA;&lt;p&gt;Using the notation in &lt;a href=&quot;https://rads.stackoverflow.com/amzn/click/com/1584885580&quot; rel=&quot;nofollow noreferrer&quot; rel=&quot;nofollow noreferrer&quot;&gt;Qian &lt;em&gt;et al.&lt;/em&gt;'s book&lt;/a&gt;, in the mean-variance optimization problem, why would an investor force:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$w\cdot I = 0 $&lt;/span&gt; &lt;em&gt;in addition to&lt;/em&gt; &lt;span class=&quot;math-container&quot;&gt;$w \cdot B = 0 $&lt;/span&gt; ?&lt;/p&gt;&#xA;&lt;p&gt;with&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$w$&lt;/span&gt; being the portfolio weights&lt;/li&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$B$&lt;/span&gt; being the exposure matrix&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="6149" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-06-01T08:02:27.367" Title="Dollar-Neutral in addition to Market-Neutral?" Tags="&lt;beta&gt;&lt;mean-variance&gt;&lt;market-neutral&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26346" PostTypeId="1" CreationDate="2016-05-31T04:27:37.230" Score="1" ViewCount="109" Body="&lt;p&gt;I am working on a paper that tries to build an optimal portfolio to hedge various risks (mainly interest rate risk). I have never done this before. Which software program should I use to create an optimal portfolio simulation?&lt;/p&gt;&#xA;" OwnerUserId="19237" LastActivityDate="2016-05-31T04:27:37.230" Title="Optimal portfolio construction questions" Tags="&lt;risk-management&gt;" AnswerCount="0" CommentCount="1" ClosedDate="2016-05-31T14:32:55.743" ContentLicense="CC BY-SA 3.0" />
  <row Id="26347" PostTypeId="2" ParentId="18327" CreationDate="2016-05-31T07:14:28.700" Score="1" Body="&lt;p&gt;$$\Delta_1(H)=\frac{V_2(HH)-V_2(HT)}{S_2(HH)-S_2(HT)}=-\frac{1}{12}$$&#xA;and&#xA;$$\Delta_1(T)=\frac{V_2(TH)-V_2(TT)}{S_2(TH)-S_2(TT)}=-1$$&#xA;and&#xA;$$\Delta_0=\frac{V_1(H)-V_1(T)}{S_1(H)-S_1(T)}=-0.433$$&#xA;The optimal exercise time is&#xA;$$\tau(HH)=\infty $$&#xA;$$\tau(HT)=2 $$&#xA;$$\tau(TH)=1 $$&#xA;$$\tau(TT)=1 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;AS a result, you should borrows $1.36$ at time zero and buys the put option. At the same time, to hedge the long position, you need to borrow again and buy $0.433$ shares of stock at time zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt;: If the result of toss is tail and the stock price goes down to $2$, you should exercise the put and get $3$ to pay off your debt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt; : If the result of toss is head and the stock price goes up to $8$, you should should borrow to buy $\frac{1}{12}$ shares of stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt;: If the result of toss is head and the stock price goes up to $16$, should let the put expire because the value of the portfolio is $0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt;: If the result of toss is tail and the stock price goes down to $4$, you should exercise the put to get $1$.&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastActivityDate="2016-05-31T07:14:28.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26349" PostTypeId="2" ParentId="24541" CreationDate="2016-05-31T09:16:01.450" Score="1" Body="&lt;p&gt;I've also met such an question several mins before and I realized that this error cause from the standard library set by Mac. One should set &lt;code&gt;-stdlib=libstdc++&lt;/code&gt; when building, compared to the &lt;code&gt;libc++&lt;/code&gt; by default on several recent MAC versions. &lt;/p&gt;&#xA;" OwnerUserId="18528" LastActivityDate="2016-05-31T09:16:01.450" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26350" PostTypeId="1" CreationDate="2016-05-31T09:34:14.780" Score="0" ViewCount="151" Body="&lt;p&gt;Suppose I have today current duration of a bond and it's historical daily prices. How from that I can calculate the historical duration? e.g. the value of duration I would saw if yesterday, week ago, 43 days ago I checked?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I know the exact formulas for duration are not trivial, but let's say reasonable approximation I can enter as formula to Excel).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;" OwnerUserId="18094" LastActivityDate="2016-05-31T14:35:24.053" Title="Calculate historical duration based on current duration &amp; historical prices" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;finance-mathematics&gt;&lt;duration&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26351" PostTypeId="1" CreationDate="2016-05-31T11:22:06.530" Score="1" ViewCount="443" Body="&lt;p&gt;An example diagram, taken from &lt;a href=&quot;http://arxiv.org/pdf/0910.1205v1.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; paper, looks like follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/tBs6K.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/tBs6K.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is its physical interpretation? The highest eigenvalue, the paper says, represents market mode. So, what does the difference in distance of the maximum eigenvalue from the next largest tell us? What does each (x,y) pair in the plot tell us?&lt;/p&gt;&#xA;" OwnerUserId="20879" LastActivityDate="2016-07-30T18:34:09.410" Title="What does each bar in the empirical average eigenvalues spectrum of the correlation matrix of log-returns of stocks represent?" Tags="&lt;portfolio-management&gt;&lt;portfolio&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;&lt;random-matrix-theory&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26353" PostTypeId="2" ParentId="26350" CreationDate="2016-05-31T14:35:24.053" Score="1" Body="&lt;p&gt;You will use the YIELD() and PRICE() functions in Excel.  There's really no difference between historic duration calculation and current.  You just need the price and settle day.  Here's how you do it:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Get the settlement day for the day that you are interested.  For TSY's it's the next business day.&lt;/li&gt;&#xA;&lt;li&gt;Get the price on the day you care about.&lt;/li&gt;&#xA;&lt;li&gt;Use YIELD() to get the effective yield for that day.&lt;/li&gt;&#xA;&lt;li&gt;Use PRICE() to get the price for a yield 1bp higher and 1bp lower.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h1&gt;4-your original price is your dv01.&lt;/h1&gt;&#xA;" OwnerUserId="20092" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-05-31T14:35:24.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26354" PostTypeId="2" ParentId="26351" CreationDate="2016-05-31T14:42:57.913" Score="1" Body="&lt;p&gt;In a physical system the eigenvectors represent &quot;modes&quot; of random &quot;vibration&quot; (random movement) of a system and the eigenvalues represent the variance (i.e. amplitude) of each of these modes. The eigenvalues added together equal the variance of the overall (combined) movements (the Decomposition Property). In the stock market the main mode (biggest eigenvalue) is the common market movement (stocks' tendency to go up and down together) sometimes called the market factor or beta factor. There is no agreement on what the second is, but it might be, hypothetically, an upward movement in high book-to-market stocks on a day when the low book-to-market stocks go down. In any case, the eigenvalues 2, 3, ..., n involve some category of stock going down/up and some other category going up/down. In the 1970s it was thought that the second mode might be stocks that benefit from higher oil prices (oil companies) go up while stocks that are hurt by rising oil prices go down.  Sensitivity to other macroeconomic factors were also considered as possible modes (interest rates, inflation, the USD exchange rate). Nowadays small cap vs large cap or Value vs growth are popular candidates. In any case the exact description of these factors is not easy (it probably changes over time) and is not really the objective of this type of article. They generally just try to describe how many modes would explain most (say 80 or 90%) of the variance, i.e. the &quot;complexity&quot; of the stock market. The main conclusion is that one mode (one eigenvalue) is not enough (therefore rejecting the CAPM as an adequate model of variance) and that there clearly other modes that are important. The size of the 2d eigenvalue compared to the first is a measure of the inadequacy of a single factor model to explain the stock market; all studies show that the second eigenvalue is clearly not negligible compared to the first.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-05-31T17:19:02.797" LastActivityDate="2016-05-31T17:19:02.797" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="26355" PostTypeId="2" ParentId="25728" CreationDate="2016-05-31T17:53:56.377" Score="3" Body="&lt;p&gt;The assumption of quadratic utility function is very convenient in ptf Theory because it is possible to demonstrate that also if the ptf return are not normally distributed the mean-variance approach is still the best. The best in the sense that any other distributional properties is amenable into mean and variance. For converse, if the return are normally distributed the choice of utility function is irrelevant. More in general, if the ptf return are not known distribution and we use a general utility function, the mean-variance approach is valid yet, but only as approximation.&lt;/p&gt;&#xA;" OwnerUserId="20746" LastActivityDate="2016-05-31T17:53:56.377" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26357" PostTypeId="1" AcceptedAnswerId="26361" CreationDate="2016-05-31T18:40:13.480" Score="8" ViewCount="963" Body="&lt;p&gt;Maybe it's a simple question but I don't really understand why it is theoretically required. Let's take the standard GARCH(1,1)&#xA;$$\sigma^2_{t+1}=\omega+\alpha\epsilon^2_{t}+\beta\sigma^2_{t}$$&#xA;In most textbooks the conditions are: $\omega&amp;gt;0$, $\alpha,\beta\geq0$ and $\alpha+\beta&amp;lt;1$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know in other contexts, but for financial series, $\alpha$ and $\beta$ are in most cases strongly significant, positive and rather persistent (sum slightly less than 1). By construction (since they are squared) $\epsilon^2_t$ and $\sigma^2_t$ are always positive. The positivity of both coefficients $\alpha$ and $\beta$ and lagged variables $\epsilon^2_{t}$ and $\sigma^2_{t}$ ensures the positivity of $\sigma^2_{t+1}$. Considering this, why then should $\omega$ be strictly positive and why is the condition $\geq0$ not enough?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a few series for which I want to estimate the conditional volatility equation. Most of them have a positive intercept, but some of these have $\omega=0$ with positive coefficients $\alpha$ and $\beta$. What should I do since this is not theoretically contemplated in textbooks? How should I interpret these results?&lt;/p&gt;&#xA;" OwnerUserId="20573" LastEditorUserId="848" LastEditDate="2016-06-01T07:15:52.813" LastActivityDate="2016-06-08T19:23:37.307" Title="Why is the GARCH intercept supposed to be strictly positive?" Tags="&lt;volatility&gt;&lt;time-series&gt;&lt;garch&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26358" PostTypeId="1" AcceptedAnswerId="26360" CreationDate="2016-05-31T19:04:22.210" Score="2" ViewCount="596" Body="&lt;p&gt;I would like to price a European option with maturity equals to 5 years. To do this, I'm using the Black-Scholes model with stochastic interest rates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose I choose the CIR model for the risk-free rate.  My question is: should I model the entire term structure of interest rates, or I can just model the 5-year rate? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a side question, which one would be considered a good proxy for the 5-year risk-free rate in the US?&lt;/p&gt;&#xA;" OwnerUserId="12214" LastActivityDate="2016-06-01T15:22:57.520" Title="Valuing derivatives under stochastic interest rates" Tags="&lt;black-scholes&gt;&lt;interest-rates&gt;&lt;stochastic-processes&gt;&lt;term-structure&gt;&lt;risk-free&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26359" PostTypeId="2" ParentId="25728" CreationDate="2016-05-31T19:14:19.923" Score="3" Body="&lt;p&gt;In most settings, utility functions are defined up to an affine transformation: if $u(x)$ defines the preference of an investor, then so does $a*u(x)+b.$ This implies, you can normalize the Taylor expantion of any smooth utility function to $u(x)=x+a*x^2+\ldots$ around 0. So the next step is just to drop off higher order terms. The investor is also usually assumed to be risk-averse, which implies, that $a &amp;lt; 0.$ You can check the details, e.g. here: &lt;a href=&quot;https://www.empiwifo.uni-freiburg.de/lehre-teaching-1/winter-term-10-11/materialien-portfolio-analysis/utility.pdf&quot; rel=&quot;nofollow&quot;&gt;https://www.empiwifo.uni-freiburg.de/lehre-teaching-1/winter-term-10-11/materialien-portfolio-analysis/utility.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2016-05-31T19:14:19.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26360" PostTypeId="2" ParentId="26358" CreationDate="2016-05-31T19:56:40.833" Score="3" Body="&lt;p&gt;A few points can be noted. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The CIR model is usually for a short, or instantaneous, spot rate $r_t$, which is the forward rate over an infinitesimal interval. That is,&#xA;\begin{align*}&#xA;r_t = \lim_{\Delta \rightarrow 0}\frac{1}{\Delta}\left(\frac{1}{P(t, t+\Delta)}-1 \right),&#xA;\end{align*}&#xA;where $P(t, u)$ is the price at time $t$ of a zero-coupon bond with maturity $u$ and unit face value. &lt;/li&gt;&#xA;&lt;li&gt;The $T$-year rate is usually the zero rate $R_T$, defined by&#xA;\begin{align*}&#xA;P(0, T) = e^{-R_T T},\tag{1}&#xA;\end{align*}&#xA;which is not the short rate. &lt;/li&gt;&#xA;&lt;li&gt;Hull-White model may be better as the initial term structure of zero rates, or correspondingly, bond prices, can be matched.&lt;/li&gt;&#xA;&lt;li&gt;For a vanilla European option with a payoff of the form&#xA;\begin{align*}&#xA;\max(S_T-K, \, 0), &#xA;\end{align*}&#xA;the value is given by the Black's formula&#xA;\begin{align*}&#xA;P(0, T)\big[F_TN(d_1) -KN(d_2) \big].\tag{2}&#xA;\end{align*}&#xA;Here, $F_T=S_0/P(0, T)$ is the forward price, $d_1 = \frac{\ln F_T/K + \frac{1}{2}\sigma^2 T}{\sigma \sqrt{T}}$, and $d_2 = d_1 - \sigma \sqrt{T}$. Note that, in Formula $(2)$, the volatility $\sigma$ is Black's implied volatility, which can usually be obtained from the market quote. In this case, the &#xA;stochastic interest rate model is not really needed. That is,  only the $T$-year zero rate $R_T$ is needed to compute the bond price $P(0, T)$ by Formula $(1)$. Here, in your case, the 5-year zero rate is needed. However, we note that the Black's implied volatility is different from the Black-Scholes' implied volatility, if stochastic interest rate is assumed. See &lt;a href=&quot;https://quant.stackexchange.com/questions/18289/black-scholes-under-stochastic-interest-rates.&quot;&gt;this question&lt;/a&gt; for a detailed exposition.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-06-01T15:22:57.520" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="26361" PostTypeId="2" ParentId="26357" CreationDate="2016-05-31T23:27:08.153" Score="6" Body="&lt;p&gt;Consider the GARCH(1,1) process&#xA;\begin{align}&#xA; r_{t+1} &amp;amp;= \sigma_{t+1} z_{t+1} \\&#xA;\sigma^2_{t+1} &amp;amp;= \omega+\alpha r^2_t +\beta \sigma^2_{t}&#xA;\end{align}&#xA;for the returns $r_t$, with ${z_t} \sim N (0,1)$ IID.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In what follows, let us distinguish the conditional return variance&#xA;$$ V [ r_{t+1} \vert \mathcal{F}_t ] = \sigma^2_{t+1} $$&#xA;from the unconditional return variance&#xA;$$ V [ r_{t+1} ]$$&#xA;where $\mathcal{F}_t$ denotes the information available up to time $t$ (filtration), in our case all past values $\{\sigma_t,...,\sigma_0,r_t,...,r_0\}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, notice that if both $\alpha$ and $\beta $ happen to be zero, then if $\omega$ is allowed to reach zero as well there is a possibility that the conditional variance will become zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, because $z_t$ are zero-mean, unit variance and i.i.d, we have that the unconditional returns' variance is strictly equal to (*)&#xA;\begin{align}&#xA;V[r_{t+1}] &amp;amp;= E[r_{t+1}^2]-E [r_{t+1}]^2 = E[r_{t+1}^2] \\&#xA;&amp;amp;= E [ \sigma_{t+1}^2 z_{t+1}^2] = E [ \sigma_{t+1}^2] E [z_{t+1}^2] \\&#xA;&amp;amp;= E[\sigma_{t+1}^2]&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can use this relationship along with the GARCH definition to write&#xA;\begin{align}&#xA;V[r_{t+1}] &amp;amp;= E[\sigma_{t+1}^2] = E [ (\omega+\alpha r^2_t +\beta \sigma^2_{t}) ] \\&#xA;&amp;amp;= \omega + \alpha V [r_t] + \beta V [r_t] \\&#xA;&amp;amp;=  \omega + V [r_t] (\alpha + \beta)&#xA;\end{align}&#xA;Now, assuming weak stationarity we should have that the unconditional variance $\sigma^2_\infty$ is such that&#xA;$$ \sigma^2_\infty = V [r_{t+1}] = V [r_t] $$&#xA;which using the above gives &#xA;$$ \sigma^2_\infty = \frac {\omega}{1-\alpha-\beta} $$ &#xA;From which we see why the condition $\alpha + \beta &amp;lt; 1$ is relevant but also that allowing $\omega $ to reach zero would also imply a possibility that the unconditional variance becomes zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the end of the day, we therefore have that if $\omega=0$ while the other coefficients are positive, you will have (conditional) heteroskedasticity in the sense that conditional variance will evolve through time, but the unconditional stationary variance will be zero, with unrealistic consequence that returns become deterministic at some point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(*) This could have been anticipated since &#xA;\begin{align}&#xA;V [r_{t+1}] &amp;amp;= V [r_{t+1} \vert \mathcal{F}_0] \\&#xA;&amp;amp;= E [r_{t+1}^2 \vert \mathcal{F}_0] \\&#xA;&amp;amp;= E [ E [ r_{t+1}^2 \vert \mathcal{F}_t] \vert \mathcal{F}_0]  \\&#xA;&amp;amp;= E [ V [ r_{t+1} \vert \mathcal{F}_t] \vert \mathcal{F}_0] \\&#xA;&amp;amp;= E [ \sigma_{t+1}^2 \vert \mathcal{F}_0] \\ &#xA;&amp;amp;= E [ \sigma_{t+1}^2 ] &#xA;\end{align}&#xA;where we have made use of the tower law (and the fact that $z_t $ are zero-mean and independently distributed so that $E [r_{t+1}]=0$).&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="7008" LastEditDate="2016-06-08T19:23:37.307" LastActivityDate="2016-06-08T19:23:37.307" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26362" PostTypeId="1" CreationDate="2016-06-01T00:35:57.827" Score="3" ViewCount="557" Body="&lt;p&gt;I am currently trying to implement and model an Importance Sampling estimator for Longstaff and Schwartz algorithm for pricing American put options. It is used such that more paths are in-the-money such that less simulation is required and also the variance is reduced.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am following the steps by &lt;a href=&quot;https://www.rocq.inria.fr/mathfi/Premia/free-version/doc/premia-doc/pdf_html/Moreni_doc.pdf&quot; rel=&quot;nofollow&quot;&gt;Moreni&lt;/a&gt; and simulate $n$-paths of a drifted geometric brownian motion given by: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS_t = S_t\big[(r+\theta \sigma)dt+\sigma dW_t\big]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then moreni defines the likelihood ratio $L_\tau^\theta=exp\{-\theta W_t+0.5 \theta^2 t \}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the stopping time theorem, we want to find for each path $n$ $\sup_\tau \mathbb{E}[f^{(n)}(\tau,S_\tau)]$ the corresponding Importance sampling estimator $\sup_\tau \mathbb{E}[L_\tau^\theta f^{(n)}(\tau,S_\tau)]$, where $f$ is the payoff function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When we have found the stopping time for each path $n$ we can take the average and get the desired put price at time 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is that is the wiener process in the likelihood ratio the random number at $\textit{optimal}$ time $\tau$ for path some path $n_i$? And at the same time should $t$ be the optimal time $\tau$ for path $n_i$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since in R the standard L&amp;amp;S algorithm is existent in the package &lt;code&gt;library(LSMonteCarlo)&lt;/code&gt;, i modified the function &lt;code&gt;AmerPutLSM&lt;/code&gt;, such that it simulate with drift $\theta$ and i set the interest rate to 0.&#xA;However, I seem to get very high prices when I try to simulate compared to the standard one. So I am not sure if I really have understood the math correctly. I use negative values for $\theta$ and it should be around -0.5 and -1 according to Moreni. But the prices I get are really deviating.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the code, that I modified:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;firstValueRow &amp;lt;- function (x)&#xA;{&#xA;  cumSumMat &amp;lt;- matrix(NA, nrow = dim(x)[1], ncol = dim(x)[2])&#xA;  for (i in 1:(dim(x)[1])) {&#xA;    cumSumMat[i, ] &amp;lt;- cumsum(x[i, ])&#xA;  }&#xA;  cumSumMat2 &amp;lt;- cbind(matrix(0, nrow = dim(x)[1], ncol = 1), cumSumMat[, -(dim(x)[2])])&#xA;  ResultMat &amp;lt;- matrix(NA, nrow = dim(x)[1], ncol = dim(x)[2])&#xA;  for (i in 1:dim(x)[2]) {&#xA;    ResultMat[, i] &amp;lt;- ifelse(cumSumMat2[, i] &amp;gt; 0, 0, x[,i])&#xA;  }&#xA;  return(ResultMat)&#xA;}&#xA;&#xA;Spot = 36&#xA;sigma = 0.8&#xA;theta = -1&#xA;mu = 0&#xA;n = 1000&#xA;m = 50&#xA;Strike = 40&#xA;r = 0&#xA;dr = 0&#xA;mT = 1&#xA;&#xA;dt &amp;lt;- mT/m&#xA;GBM &amp;lt;- matrix(NA, nrow = n, ncol = m)&#xA;Zlist &amp;lt;- matrix(NA, nrow = n, ncol = m)&#xA;for (i in 1:n)&#xA;{&#xA;  Z &amp;lt;- rnorm(m, mean = mu, sd = 1)&#xA;  GBM[i, ] &amp;lt;- Spot * exp(cumsum(((r+theta*sigma-0.5*sigma*sigma)*dt)+(sigma*(sqrt(dt))*Z)))&#xA;  Zlist[i, ] &amp;lt;- Z&#xA;}&#xA;X &amp;lt;- ifelse(GBM &amp;lt; Strike, GBM, NA) #stock rates only in the money&#xA;### payoff importance sampling&#xA;Ltheta &amp;lt;- exp(-theta*Zlist-0.5*theta*theta*dt)&#xA;CFL &amp;lt;- matrix(Ltheta*pmax(0, Strike - GBM), nrow = n, ncol = m) #cashflows&#xA;&#xA;Xsh &amp;lt;- X[, -m]&#xA;X2sh &amp;lt;- Xsh * Xsh&#xA;&#xA;Y1 &amp;lt;- CFL * exp(-1 * r * dt)&#xA;Y2 &amp;lt;- cbind((matrix(NA, nrow = n, ncol = m - 1)), Y1[, m]) #value of derivate at time t+1&#xA;&#xA;CV &amp;lt;- matrix(NA, nrow = n, ncol = m - 1) #continuation value&#xA;for (i in (m - 1):1)&#xA;{&#xA;  reg1 &amp;lt;- lm(Y2[, i + 1] ~ Xsh[, i] + X2sh[, i])&#xA;  CV[, i] &amp;lt;- (matrix(reg1$coefficients)[1, 1]) + ((matrix(reg1$coefficients)[2,1]) * Xsh[, i]) + ((matrix(reg1$coefficients)[3,1]) * X2sh[, i])&#xA;  CV[, i] &amp;lt;- (ifelse(is.na(CV[, i]), 0, CV[, i]))&#xA;  Y2[, i] &amp;lt;- ifelse(CFL[, i] &amp;gt; CV[, i], Y1[, i], Y2[, i + 1] * exp(-1 * r * dt))&#xA;}&#xA;CV &amp;lt;- ifelse(is.na(CV), 0, CV)&#xA;CVp &amp;lt;- cbind(CV, (matrix(0, nrow = n, ncol = 1)))&#xA;POF &amp;lt;- ifelse(CVp &amp;gt; CFL, 0, CFL)&#xA;FPOF &amp;lt;- firstValueRow(POF)&#xA;dFPOF &amp;lt;- matrix(NA, nrow = n, ncol = m)&#xA;for (i in 1:m)&#xA;{&#xA;  dFPOF[, i] &amp;lt;- FPOF[, i] * exp(-1 * dt * r * i)&#xA;}&#xA;&#xA;PRICE &amp;lt;- mean(rowSums(dFPOF))&#xA;PRICE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Should the cashflows be multiplied by the likelihood ratio immediately?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Appreciate for help.&#xA;Thanks&lt;/p&gt;&#xA;" OwnerUserId="18211" LastActivityDate="2017-07-09T13:06:02.480" Title="Importance Sampling for Least Square Monte Carlo" Tags="&lt;option-pricing&gt;&lt;r&gt;&lt;monte-carlo&gt;&lt;american-options&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ClosedDate="2017-07-15T08:33:12.607" ContentLicense="CC BY-SA 3.0" />
  <row Id="26363" PostTypeId="1" AcceptedAnswerId="26365" CreationDate="2016-06-01T05:22:14.037" Score="1" ViewCount="432" Body="&lt;p&gt;Since it does not have a closed form solution for the price, it's unlikely to be a martingale. However, on the other hand, if we represent the price as a function of the current stock price and the average price so far, we can write down the formula:&#xA;$$v_n(s,y)=(1+r)^{-1}[\tilde{p}v_{n+1}(us,(y*(n+1)+us)/(n+2))+\tilde{q}v_{n+1}(ds,(y*(n+1)+ds)/(n+2))]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $S_n=s,\frac{1}{n}\sum_{k=0}^nS_k=y$ and $u,d$ are up/down factors. This seems to be a martingale.&lt;/p&gt;&#xA;" OwnerUserId="18335" LastActivityDate="2016-06-09T18:18:46.097" Title="Is Asian option in binomial asset pricing model a martingale?" Tags="&lt;binomial-tree&gt;&lt;martingale&gt;&lt;asian-option&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26364" PostTypeId="2" ParentId="26345" CreationDate="2016-06-01T06:14:10.530" Score="5" Body="&lt;p&gt;Imagine a scenario where a beta neutral portfolio comprised being long one very high beta stock and short many low beta stocks.  Such a portfolio clearly has extreme concentration of risk.  Additionally imposing a 'dollar neutral' constraint, would help to spread the weights more evenly over all the stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A further observation is that measuring true 'beta' is fraught with difficulty, and the underlying true value is likely anyway dynamic (due to cyclical and structural changes at both the corporate and market wide level).  Knowing this, imposing a dollar neutral constraint on the portfolio can be done in a precise way, and in this sense might give some added sense of security (that 'market' risk is being minimised).&lt;/p&gt;&#xA;" OwnerUserId="3297" LastActivityDate="2016-06-01T06:14:10.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26365" PostTypeId="2" ParentId="26363" CreationDate="2016-06-01T06:27:47.663" Score="1" Body="&lt;p&gt;&lt;strong&gt;[Short answer]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yes, one can always represent option prices as martingales, hence expectations, assuming there is no free lunch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When there is no closed-form formula for an option price, it just means that the latter expectation is not analytically tractable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Long answer]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the &lt;strong&gt;absence of arbitrage opportunities&lt;/strong&gt;, one can always appeal to the &lt;strong&gt;existence&lt;/strong&gt; of equivalent probability measures under which option prices (I should rather say the discounted price of all self-financing strategies attainable using marketed securities) emerge as martingales. This is sometimes known as the &lt;em&gt;fundamental theorem of asset pricing&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More specifically, assuming the market model is &lt;strong&gt;complete&lt;/strong&gt; (which is the case for the binomial tree pricing model), each of these measures can be shown to correspond to a &lt;strong&gt;unique&lt;/strong&gt; choice of so-called &lt;em&gt;numeraire&lt;/em&gt;, a numeraire being an asset $N_t &amp;gt; 0$, such that the price $V_t$ of any tradable option, when expressed in numeraire units i.e. $V_t/N_t$, is a martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The equivalent martingale measure associated to the money market account numeraire &#xA;$$ N_t = B_t = e^{\int_0^t r (u) du}$$&#xA;Is best known as the &lt;strong&gt;risk-neutral measure&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the absence of arbitrage opportunities, one can thus always write:&#xA;$$ V_0 = \mathbb {E}^{\mathbb {Q}^B}[ &#xA;e^{\int_0^t r (u) du} V_T ] \tag{I}$$&#xA;where the terminal value of the option $ V_T$ is simply its payoff by absence of arbitrage, payoff which can be written as&#xA;$$ V_T = f (S_{t_1},...,S_{t_N}) $$&#xA;where $f (.) $ is a completely generic function of $N $ equity fixing values observed over the horizon $[0,T]$ ($N $ need not even be finite).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not having a closed form formula for an option price does not mean we cannot write the price in martingale form $(I)$, hence as an expectation, but simply means that the expectation in question is not analytically tractable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can happen because the underlying diffusion model is intractable per se. For instance, even European call/put options have no closed-form formula under the local volatility model or the binomial tree pricing model: one has to restor to numerical methods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can also happen for a tractable diffusion model because of the exotism of the target option: e.g. there is no closed-form formulas for discrete Arithmetic Asian options in the simple Black-Scholes model, while there exist formulas for both the Geometric and continuous arithmetic version.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-06-09T18:18:46.097" LastActivityDate="2016-06-09T18:18:46.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26366" PostTypeId="2" ParentId="26362" CreationDate="2016-06-01T07:56:52.000" Score="0" Body="&lt;p&gt;I just made things clearer hoping it would help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let define $\mathbb{Q}_\theta$ as $$\frac{d\mathbb{Q}_\theta}{d\mathbb{P}}|_{\mathcal{F}_t}=\exp(\theta W_t -\frac{1}{2}\theta^2 t)=Z^\theta_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By girsanov, if $W$ is a brownian motion under $\mathbb{P}$, then $W^\theta_t=W_t-\theta t$ is a brownian motion under $\mathbb{Q}^\theta$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{split}&#xA;\mathbb{E}[f(\tau, W_\tau)]=&amp;amp; \mathbb{E}^{\mathbb{Q}_\theta}[(Z_\tau^\theta)^{-1} f(\tau,W_\tau)] \\&#xA;= &amp;amp; \mathbb{E}^{\mathbb{Q}_\theta}[e^{-\theta W^\theta_\tau-\frac{1}{2}\theta^2\tau}f(\tau,W^\theta_\tau+\theta\tau)]&#xA;\end{split}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and if $\tau$ was defined as :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\tau = \inf\{t\geq 0 : W_t \in A_t\}$$&#xA;then $$\tau = \inf\{t\geq 0 : W^\theta_t+\theta t \in A_t\}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;defining $\tau^\theta$ as :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\tau^\theta= \inf\{ t\geq 0 : W_t+\theta t \in A_t\}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you finally get (using your $L$ notation) and the equality in law&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}[f(\tau, W_\tau)]=\mathbb{E}[L_{\tau^\theta}^\theta f(\tau^\theta,W_{\tau^\theta}+\theta \tau^\theta)]$$&lt;/p&gt;&#xA;" OwnerUserId="20201" LastEditorUserId="20201" LastEditDate="2016-06-14T08:25:47.640" LastActivityDate="2016-06-14T08:25:47.640" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="26369" PostTypeId="1" CreationDate="2016-06-01T09:55:36.857" Score="1" ViewCount="181" Body="&lt;p&gt;I am trying to simulate an asset path based on a t-distribution. I found a lot of ressources and the fact that it will be difficult to do a path. But now I changed my Geometric Brownian Motion Simulation and instead of using normal random numbers, I take random student-t numbers using the Matlab-command trnd. So I get a new path and the increments are student-t distributed. Now I don't know if this is a totally wrong approach, since I am more or less a beginner in quantitative finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for your help&#xA;Kind regards&lt;/p&gt;&#xA;" OwnerUserId="20974" LastActivityDate="2016-06-01T09:55:36.857" Title="student-t asset path" Tags="&lt;returns&gt;&lt;matlab&gt;&lt;distribution&gt;&lt;asset&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26370" PostTypeId="1" CreationDate="2016-06-01T10:13:50.447" Score="7" ViewCount="855" Body="&lt;p&gt;I would like to calculate realized volatility for a 15 min period. Most of the literature I looked up shows how to construct daily realized volatility using intraday data. These literatures does use several techniques (e.g. subsampling, using realised kernel...) to account for microstructure noise. I'm not sure if using these techniques for the 15 min period would help to reduce the microstructure noise since I use seconds data. Do you have any suggestions how to calculate realized volatility for a 15 min interval?&lt;/p&gt;&#xA;" OwnerUserId="20975" LastActivityDate="2016-07-14T20:45:11.843" Title="Realized Vol for 15 min interval using second Data" Tags="&lt;volatility&gt;&lt;high-frequency&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26371" PostTypeId="2" ParentId="26306" CreationDate="2016-06-01T10:23:24.373" Score="3" Body="&lt;p&gt;Firstly I'm only concentrating on Sharpe, this is the most robust of your metrics. Consider the difference between sharpe and drawdown, sharpe contains a contribution from every return in your result, drawdown is just one observation of whatever happens to be the longest run of negative returns. Of course it's your choice if you want to place more weight on Sortino or drawdown.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the data turned into a heat map, blue highest and red lowest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/qSJJ7.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/qSJJ7.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is more of an art than a science so I will attempt to explain what my reasoning would be:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Roughly as you increase the number of months past 9 things get worse so all other things being equal I would go for something with a lower number of months.&lt;/li&gt;&#xA;&lt;li&gt;The lower left triangle of values looks better than the upper right.&lt;/li&gt;&#xA;&lt;li&gt;Although there is a local maxima around (15 stocks, 9 months) the other local maxima around (30 stocks, 6 months) looks better. It's also bang in the middle of this better triangle.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Remember you are trying to estimate from noisy observations what the best parameters are. If a small change in a parameter causes a large change in the observed result who knows what sort of &quot;special&quot; circumstance you have wandered into.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In conclusion I'd pick something between 6-9 months and 20-30 stocks. Hopefully you will have some intuition which will help you pick the exact amounts, namely that more stocks or lower periods should be better.&lt;/p&gt;&#xA;" OwnerUserId="12020" LastActivityDate="2016-06-01T10:23:24.373" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26372" PostTypeId="2" ParentId="18105" CreationDate="2016-06-01T11:13:24.913" Score="0" Body="&lt;p&gt;I guess for you to obtain the value for the real world probability measure P, the expected rate of return should be given...else the value of P should be given.&lt;/p&gt;&#xA;" OwnerUserId="20976" LastActivityDate="2016-06-01T11:13:24.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26373" PostTypeId="1" AcceptedAnswerId="26375" CreationDate="2016-06-01T11:15:53.897" Score="1" ViewCount="297" Body="&lt;p&gt;I dont understand how MM protect themselves from large moves in underlying while being delta hedged. &lt;br&gt;&lt;br&gt;&#xA;Example:&lt;br&gt;&#xA;MM sels 1 ATM put and sells 100stock (delta = 1) as a hedge. Now what will happen if next day stock shoots up? I can't imagine MM losing money on every such occasion, but I don't get how can they protect from it?&lt;/p&gt;&#xA;" OwnerUserId="19704" LastActivityDate="2016-06-01T12:47:46.530" Title="Delta Hedge, does large stock move produce a loss?" Tags="&lt;options&gt;&lt;hedging&gt;&lt;market-making&gt;&lt;delta-hedging&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26374" PostTypeId="1" AcceptedAnswerId="26380" CreationDate="2016-06-01T12:29:35.380" Score="1" ViewCount="152" Body="&lt;p&gt;I have been observing the option chains of put options with differing maturities. I have noticed that those puts with a close expiry date have the steepest volatility smiles.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone please explain why this is the case in an intuitive way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards,&lt;/p&gt;&#xA;" OwnerUserId="13726" LastActivityDate="2016-06-01T14:32:05.230" Title="Put Volatility Smiles and Implied Volatility" Tags="&lt;volatility&gt;&lt;put&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26375" PostTypeId="2" ParentId="26373" CreationDate="2016-06-01T12:47:46.530" Score="1" Body="&lt;p&gt;That's the risk that MM's take, generally.  This is commonly referred to as &quot;gap risk&quot;.  Holistically the idea is that with the law of large numbers you will lose sometimes but overall be OK as you have a large number of these trades.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On our MM desk we have seen a few times where big takeovers were preceded by someone in the market lifting 10k call contracts on all strikes of the acquiring name.  Stinks when it happens but hopefully you make it back in a thousand other places.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You've heard that expression, &quot;picking up nickels in front of a steamroller&quot; ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the book as a whole the MM tries to keep all the greeks reasonably flat.  &lt;/p&gt;&#xA;" OwnerUserId="20092" LastActivityDate="2016-06-01T12:47:46.530" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26376" PostTypeId="1" CreationDate="2016-06-01T13:04:45.540" Score="8" ViewCount="1022" Body="&lt;p&gt;I've been researching the SABR model and one of the main benefits it seems is that you can obtain a closed for solution of the implied BS volatility in certain cases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In all the papers I've read, I have not found any proofs/reasoning as to where this solution actually comes from. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know/can link me to a derivation of it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/vRnR9.png&quot; rel=&quot;noreferrer&quot;&gt;This&lt;/a&gt; is the formula I am referring to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="20762" LastActivityDate="2016-06-01T15:22:56.393" Title="SABR Model Closed Form Solution" Tags="&lt;implied-volatility&gt;&lt;stochastic-volatility&gt;&lt;sabr&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26377" PostTypeId="1" CreationDate="2016-06-01T13:10:57.867" Score="0" ViewCount="541" Body="&lt;p&gt;I would like to setup a back test for Indian equities, Kindly help out with step by step procedure, No need to go into details, outlining of procedure are enough in bullet point, I will research further, In case of further queries, I'll raise my question in the same forum.&lt;/p&gt;&#xA;" OwnerUserId="20303" LastActivityDate="2016-06-02T14:08:16.353" Title="How to setup a back test step by step?" Tags="&lt;backtesting&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26378" PostTypeId="2" ParentId="26374" CreationDate="2016-06-01T13:21:50.897" Score="3" Body="&lt;p&gt;This can be due to various effects. I will list you 2 of them off the top of my head:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Jumps/Crashes : assume you were to price a put option which expires in a few days from now. Your diffusion model tells you this option should be worth $\$3.25e^{-7}$ since it is very out of the money as of today. What price will you quote? Well, in order to be conservative, you'll certainly price in an additional probably of &lt;strong&gt;adverse market movement&lt;/strong&gt; occurring between now and the option expiry (e.g. strong downard jumps or flash crash) that could add value to the put option. This is more marked on put that on call, because one would rarely price in events that would be exceptionally good for him/her in a conservative setting.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In practice, there is usually a &lt;strong&gt;minimum trade price&lt;/strong&gt; for any option listed on an exchange. Even if there were none, you would never be able to sell something for $\$3.25e^{-7}$ anyway since the smallest currency unit is 1 cent (even with lots size of 1000 you'd still have a problem.). The effect is almost the same as jumps: it tends to strongly overvalue options that should theoretically be worth almost nothing. To convince yourself, it is illuminating to perform the following experiment: using a classic BS model with a volatility of $20\%$ generate put option prices. Now replace all put prices that are below the minimum trade price by this precise price and imply the Black-Scholes volatilities out of these corrected prices. Tell me, is the smile flat as you would have expected?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Anyway, over-valuating (by pricing-in extreme events that are not accounted for in your models, or simply due to technicalities) short-term OTM put prices that should theoretically be worth almost nothing leads to higher short-term put implied volatilities.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-06-01T13:35:03.483" LastActivityDate="2016-06-01T13:35:03.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26379" PostTypeId="2" ParentId="26376" CreationDate="2016-06-01T14:31:25.663" Score="3" Body="&lt;p&gt;It comes from Heat Kernel expansion and differential geometry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See Theorem 6 and Section 8 of &#xA;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1717676&amp;amp;download=yes&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1717676&amp;amp;download=yes&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-06-01T14:31:25.663" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26380" PostTypeId="2" ParentId="26374" CreationDate="2016-06-01T14:32:05.230" Score="2" Body="&lt;p&gt;&lt;strong&gt;The short answer:&lt;/strong&gt; Your observation is caused by some sort of central limit theorem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The long answer:&lt;/strong&gt; The reason for the volatility smile/skew is the non-normality of the assumed return distribution. If the implied volatility of out-of-the-money put options is higher than of at-the-money put options, it implies that the market assumes that the &lt;em&gt;risk-neutral probability&lt;/em&gt; of a downside return is higher than implied by a normal distribution. The implied volatility surface can therefore be seen as a convenient way to describe the underlying risk-neutral return distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's assume that the true underlying process generates daily log-returns which are left-skewed and leptokurtic, i.e. downside moves are larger than upside moves. If we observe options with a maturity of one day, we will find that the risk-neutral distribution corresponds to the skewness and kurtosis of the underlying return process. However, if we extend the time horizon returns are aggregated and the central limit theorem starts to work. Thus, longer return horizons generate more normal returns. So for example, if we observe the volatility smile of thirty day options we observe the assumed risk-neutral return distribution of the 30 day log-return which is the sum of the next 22 or so log-returns. Therefore, the 30 day return is necessarily less non-normal than a one day return. If we switch back to the corresponding volatility surface, less non-normal returns imply a flatter smile. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In reality this is a common observation of implied volatility smiles and of historical return distributions. If you calculate the skewness and kurtosis of daily, monthly, quarterly and yearly returns you usually find that yearly returns are the least non-normal. The speed of convergence is dependent on the initial non-normality of the process and for highly non-normal distributions convergence can be very slow. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This answer corresponds the answer of Quantuple who named important microstructural and hedging arguments. &lt;/p&gt;&#xA;" OwnerUserId="9283" LastActivityDate="2016-06-01T14:32:05.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26381" PostTypeId="2" ParentId="26376" CreationDate="2016-06-01T15:22:56.393" Score="0" Body="&lt;p&gt;The derivation is in &quot;Managing Smile Risk&quot; by Pat Hagan et al. A copy is here: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.math.ku.dk/~rolf/SABR.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.math.ku.dk/~rolf/SABR.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is not closed form, but rather an approximation based on expansions. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-06-01T15:22:56.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26382" PostTypeId="1" CreationDate="2016-06-01T16:20:16.020" Score="1" ViewCount="1323" Body="&lt;p&gt;I replicate a Momentum Strategy from Rey and Schmid (2007) &quot;Feasible momentum strategies&quot; based on the idea from Jegadeesh and Titman (1993). I only buy the single stock with the highest past return while, by the same time, the stock with the lowest return is sold short. The momentum strategies include portfolios with overlapping holding periods.&#xA;Each month, thus, 1/K of the holdings is revised. For example, in month t, the J = 6 / K = 3 portfolio of winner stocks consists of three investment cohorts: a position carried over from an investment at the end of month t − 3 in the stock with the highest average return over the respective past 6 months and two positions resulting from investments in the topperforming stocks at the end of months t − 2 and t − 1, respectively. At the end of month t , the first of these investment cohorts is liquidated and replaced with a new investment in the stock with the highest 6-month average return as of time t .The K different investment cohort are rebalanced annualy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/NtqCY.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/NtqCY.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do i calculate the monthly returns correctly? Am I allowed to just sum the discrete Returns vertically and divide them by 3? Or do I have to take compounding returns? How can i annualize these returns? What does the annually rebalancing means in a mathematical way? &lt;/p&gt;&#xA;" OwnerUserId="20982" LastActivityDate="2016-06-01T16:20:16.020" Title="How to calculate monthly Return from a Momentum Strategy with overlapping Holdingperiods?" Tags="&lt;return&gt;&lt;momentum&gt;&lt;calculation&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26383" PostTypeId="2" ParentId="17035" CreationDate="2016-06-01T16:36:26.447" Score="0" Body="&lt;p&gt;Edit: the link does no longer work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CIKs for the NASDAQ and NYSE exchanges can be extracted from the &lt;a href=&quot;http://www.alpha10x.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;Alpha10X&lt;/a&gt; company list, which is accessible via the free demo account in CSV or XML format. Each entity has the following properties:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Id,&lt;strong&gt;CIK&lt;/strong&gt;,LastAcceptanceDateTime,Name,SIC,IndustryDivision,IndustryMajorGroup,IndustryGroup,Industry,FYE,&lt;strong&gt;Exchange&lt;/strong&gt;,Symbol&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The list identifies 2061 CIKs with Exchange = &quot;NASDAQ&quot; and 1605 CIKs with Exchange = &quot;NYSE&quot;.&lt;/p&gt;&#xA;" OwnerUserId="20983" LastEditorUserId="38104" LastEditDate="2018-12-31T19:06:08.413" LastActivityDate="2018-12-31T19:06:08.413" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="26384" PostTypeId="2" ParentId="23284" CreationDate="2016-06-01T17:02:05.690" Score="3" Body="&lt;p&gt;Because XBRL is an &lt;em&gt;extensible&lt;/em&gt; format, there is not an all-encompassing list of tags that can be declared in an XBRL instance. Business entities may create their own unique tags to accommodate special reporting requirements. However, the concepts for the vast majority (+90%) of the facts declared in XBRL instances are defined in the DEI or US-GAAP schema definition files. The most recent versions of these files are at&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://xbrl.sec.gov/dei/2014/dei-2014-01-31.xsd&quot; rel=&quot;nofollow&quot;&gt;http://xbrl.sec.gov/dei/2014/dei-2014-01-31.xsd&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://xbrl.fasb.org/us-gaap/2016/elts/us-gaap-2016-01-31.xsd&quot; rel=&quot;nofollow&quot;&gt;http://xbrl.fasb.org/us-gaap/2016/elts/us-gaap-2016-01-31.xsd&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;respectively.&lt;/p&gt;&#xA;" OwnerUserId="20983" LastActivityDate="2016-06-01T17:02:05.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26385" PostTypeId="2" ParentId="21146" CreationDate="2016-06-01T17:47:59.973" Score="1" Body="&lt;p&gt;XBRL became mandatory for US filers on June 15th, 2011. The SEC requires XBRL data for:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Quarterly and annual reports and transition reports&lt;/li&gt;&#xA;&lt;li&gt;Form 8-K revisions&lt;/li&gt;&#xA;&lt;li&gt;Limited Securities Act registration statements&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;XBRL instances for quarterly and annual reports would typically contain the usual items found on Income statements, Balance Sheets, and Cash Flows.&lt;/p&gt;&#xA;" OwnerUserId="20983" LastActivityDate="2016-06-01T17:47:59.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26388" PostTypeId="1" AcceptedAnswerId="26393" CreationDate="2016-06-01T19:55:19.687" Score="1" ViewCount="318" Body="&lt;p&gt;I wrote my bachelor thesis about European Option Pricing under Stochastic Volatility and Jump Diffusion and am now near the end of my MSc in Quant Finance. As i want to write a &quot;potential job&quot;-oriented master's thesis I wanted to hear some advice.&#xA;So maybe a pretty &quot;dumb&quot; question: do practitioners use for instance stochastic volatility jump diffusion models? &#xA;And are Derivatives/Structured Products priced mainly via Monte Carlo (using variance reduction techniques and assuming there are no closed form solutions available) or do banks employ more complicated techniques like fast fourier transform? Can anyone share a practical insight?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best regards&lt;/p&gt;&#xA;" OwnerUserId="15166" LastActivityDate="2016-06-02T01:43:45.247" Title="What models / methods are used in practice in derivative pricing?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;best-practices&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26389" PostTypeId="1" AcceptedAnswerId="26409" CreationDate="2016-06-01T21:27:02.600" Score="2" ViewCount="163" Body="&lt;p&gt;I am trying to understand and implement a factor model, and I think I might be having some issues.  I am trying to solve for the residuals in the equation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;R_{i} = \sum_{A=1}^{K}\beta_{iA} f_{A} + \epsilon_{i}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where R is an N x 1 (i = 1, ..., N)  matrix, and there are K latent factors.  I know the values inside the B (factor loadings) matrix and R (returns) matrices beforehand.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My understanding is that this equation gives the values the residuals matrix:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\epsilon = (I_{N} - H)R&#xA;$$&#xA;$$&#xA;H = \beta(\beta'\beta)^{-1}\beta'&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this correct way to solve for the residuals?&lt;/p&gt;&#xA;" OwnerUserId="20987" LastActivityDate="2016-06-02T16:47:53.983" Title="Help understanding factor modeling, solving for residuals" Tags="&lt;factor-models&gt;&lt;models&gt;&lt;factor-loading&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26390" PostTypeId="1" CreationDate="2016-06-01T21:27:10.517" Score="4" ViewCount="379" Body="&lt;p&gt;Assume there are two stochastic processes:&#xA;$dx_t = \alpha_1(x_t,t)dt + \beta_1(x_t,t)dW^1_t$&#xA;and $dy_t = \alpha_2(y_t,t)dt + \beta_2(y_t,t)dW^2_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does $dW^1_t\times{dW^2_t} = 0$ imply that $\operatorname{cov}(x_t, y_t) = 0$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it does, please give me a proof.&lt;/p&gt;&#xA;" OwnerUserId="20988" LastActivityDate="2016-06-02T18:28:11.510" Title="Are two stochastic processes independent if the Wiener processes inside are uncorrelated" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;correlation&gt;&lt;covariance&gt;&lt;wienerprocess&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26391" PostTypeId="2" ParentId="26390" CreationDate="2016-06-01T22:15:25.383" Score="1" Body="&lt;p&gt;&lt;strong&gt;Hint:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By Integration, we have&#xA;$$x_t=x_{0}+\int_{0}^{t} \alpha_1(x_s,s)ds+\int_{0}^{t} \beta_1(x_s,s)dW_1(s)$$&#xA;$$y_t=y_{0}+\int_{0}^{t} \alpha_2(y_s,s)ds+\int_{0}^{t} \beta_2(y_s,s)dW_2(s)$$&#xA;then&#xA;$$E[x_t]=x_0+E\left[\int_{0}^{t} \alpha_1(x_s,s)ds\right]$$&#xA;$$E[y_t]=y_0+E\left[\int_{0}^{t} \alpha_2(y_s,s)ds\right]$$&#xA;Now we apply Ito's lemma &#xA;$$d(x_ty_t)=x_tdy_t+y_tdx_t+\underbrace{d[x_t,y_t]}_{0}$$&#xA;as a result&#xA;$$x_ty_t=x_0y_0+\int_{0}^{t}x_sdy_s+\int_{0}^{t}y_sdx_s$$&#xA;on the other hand&#xA;$$Cov(x_t,y_t)=E[x_ty_t]-E[x_t]E[y_t]$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastActivityDate="2016-06-01T22:15:25.383" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26393" PostTypeId="2" ParentId="26388" CreationDate="2016-06-02T01:43:45.247" Score="6" Body="&lt;p&gt;stochastic vol and Levy process models are popular. Jump diffusion less so. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;FT techniques are definitely used. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;These days most of the focus is on valuation adjustments for vanilla products rather than how to price structured products. It tends to use both MC and lattice methods. If you want to be topical, I'd advise something related to valuation adjustments. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2016-06-02T01:43:45.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26395" PostTypeId="1" AcceptedAnswerId="26404" CreationDate="2016-06-02T03:06:22.847" Score="1" ViewCount="71" Body="&lt;p&gt;I am reading the Longstaff and Schwartz's &lt;a href=&quot;http://personal.anderson.ucla.edu/francis.longstaff/interestrate.pdf&quot; rel=&quot;nofollow&quot;&gt;1992&lt;/a&gt; and &lt;a href=&quot;http://www.anderson.ucla.edu/Documents/areas/fac/finance/longstaff_schwartz_interest.pdf&quot; rel=&quot;nofollow&quot;&gt;1993&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From $r = \alpha x + \beta y$ and $V = \alpha^2 x + \beta^2 y$. It was mentioned in the paper that the $r$ is positive correlated with $V$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I could not show that the $\operatorname{corr}(r, V)$ is positive. Would you please give me the proof or hints?&lt;/p&gt;&#xA;" OwnerUserId="20989" LastActivityDate="2016-06-02T16:10:47.587" Title="Why does the correlation between r and V in Longstaff and Schwartz 1992 model is positive?" Tags="&lt;interest-rates&gt;&lt;correlation&gt;&lt;pricing&gt;&lt;vasicek&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26397" PostTypeId="1" CreationDate="2016-06-02T07:26:14.310" Score="2" ViewCount="171" Body="&lt;p&gt;When our goal  is pricing of derivative products we, due to no arbitrage conditions, have to use the risk neutral probability. In other side if we have risk management purpose we have to use the “physical probability” (in this place is better no look in deep what they are).&#xA;However if our goal, generally speaking, is to do the forecast then what kind of probability we must use ? I think the physical, but I’m not totally sure. Maybe exist different case … I don’t known.&#xA;What do you think ? &lt;/p&gt;&#xA;" OwnerUserId="20746" LastActivityDate="2016-06-02T07:26:14.310" Title="Risk neutral probability and forecasting" Tags="&lt;forecasting&gt;" AnswerCount="0" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="26398" PostTypeId="2" ParentId="26390" CreationDate="2016-06-02T08:14:54.953" Score="3" Body="&lt;p&gt;&lt;strong&gt;[Edit]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My &quot;answer&quot; below is not a really an answer for I have completely misinterpreted your original question. I thought you asked about the covariance of 2 processes over a given time horizon (i.e. for a fixed $\omega$) and not the covariance of two random variables (fixed $t$). Also note that $\text{cov}(x,y)=0$ does not mean that $x$ and $y$ are independent (except special case where they have an elliptic distribution), it just means they are uncorrelated (Pearson linear correlation assumed).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;No this is not true in general.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take the example below where I've assumed&#xA;\begin{gather}&#xA;dX_t = X_t( r_X dt + \sigma_X dW_t^X ),\ \ X(0) = X_0 \\&#xA;dY_t = X_t( r_Y dt + \sigma_Y dW_t^Y ),\ \ Y(0) = Y_0 \\&#xA;d\langle W^X, W^Y \rangle_t = \rho_{XY}&#xA;\end{gather}&#xA;with&#xA;\begin{gather}&#xA; X_0 = 1, Y_0 = 2 \\&#xA; r_X = 50\%, r_Y = -50\%\\&#xA; \sigma_X = 50\%, \sigma_Y = 25\%&#xA;\end{gather}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now take $\rho_{XY} = 0\%$ and you get the figure below: although the Brownian increments are uncorrelated (here represented through the log-returns, bottom subplot), the processes $X_t$ and $Y_t$ clearly exhibit significant correlation (see top subplot with a significant sample Pearson correlation).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is essentially due to the &lt;strong&gt;drift terms&lt;/strong&gt; in the SDE. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/uLTle.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/uLTle.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Note that if you take $\rho_{XY}=99\%$ you won't see that correlation (recall it is a correlation between local increments) transpire at the global level either, see below&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/wQfQx.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/wQfQx.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-06-02T18:28:11.510" LastActivityDate="2016-06-02T18:28:11.510" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="26400" PostTypeId="1" AcceptedAnswerId="26403" CreationDate="2016-06-02T11:42:50.313" Score="2" ViewCount="2222" Body="&lt;p&gt;A friend of mine and myself are having an argument on how to correctly determine cumulative return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The dataset has monthly return data and we are trying to determine the 6-month cumulative return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I proposed the following:&#xA;Cumulative return for 6 months is a product of monthly returns:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) Ri=(1+ri_1)∗ ... ∗(1+ri_6)−1 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;He mentioned just adding up the different return values:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) Ri=(ri_1)+ ... (ri_6)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I am pretty sure my way of calculating this is correct, although differences can be small. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;&#xA;Am I correct that when academic papers talk of cumulative return they calculate this with equation (1)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance. S Gontscharoff&lt;/p&gt;&#xA;" OwnerUserId="20487" LastActivityDate="2016-06-02T12:59:46.533" Title="cumulative return calculation, disagreement" Tags="&lt;time-series&gt;&lt;returns&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26401" PostTypeId="2" ParentId="26400" CreationDate="2016-06-02T12:21:13.907" Score="1" Body="&lt;p&gt;If the dataset contains arithmetic returns where 1+r(i)= S(i)/S(i-1) then you are correct.  If the dataset contains logarithmically defined returns where r(i) = log (S(i)/S(i-1)) then your friend is correct.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-06-02T12:21:13.907" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26402" PostTypeId="2" ParentId="26377" CreationDate="2016-06-02T12:58:36.640" Score="1" Body="&lt;p&gt;There are many ways of doing this, but what most traders do is program their strategies into their trading platform and use the backtest feature to make the program give you the set of indicator parameters that will give you the best returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You ideally perform the backtest optimizations on only a portion of your historical prices. Once you are content with the results, run backtests on out of sample data to see if they come close to the optimized results. Also, perform walk-forward tests to make sure the returns (or losses) are distributed throughout history and not in isolated instances.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you cannot program your strategy due to it being discretionary in nature, you will have to go through your charts and log the buys and sells manually in a spreadsheet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try out the Ninjatrader platform. It is free and really good for simple individual tests. You might even be able to make your strategies with a visual wizard without having to program much if your strategy is simple enough.&lt;/p&gt;&#xA;" OwnerUserId="19508" LastActivityDate="2016-06-02T12:58:36.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26403" PostTypeId="2" ParentId="26400" CreationDate="2016-06-02T12:59:46.533" Score="1" Body="&lt;p&gt;To expand on my comment, consider the following R code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;set.seed(1) &#xA;returns &amp;lt;- runif(1000, 0.95,1.055) #Extremely simple return generation with a slight drift. &#xA;plot(cumprod(returns), type = &quot;l&quot;)&#xA;lines(cumsum(returns-1)+1, col = &quot;blue&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which gives the following result:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/QUfZE.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/QUfZE.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;As you can see the effect is not linear, as the difference nearly disappears around index 300 and is greatly reduced at 900, but increases again as the compounding effect increases. So, you will most likely not see major differences in 6 month data, but as soon as you go to larger time scales the effect become noticeable. &lt;/p&gt;&#xA;" OwnerUserId="13808" LastActivityDate="2016-06-02T12:59:46.533" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26404" PostTypeId="2" ParentId="26395" CreationDate="2016-06-02T13:13:04.527" Score="0" Body="&lt;p&gt;Humm....you must miss some hypothesis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming $\alpha&amp;gt;0,\beta&amp;gt;0$, you can without loss of generality set $\alpha=1$. (since $\frac{r}{\alpha}$ and $\frac{V}{\alpha^2}$ being positively correlated is the same as $r$ and $V$ positively correlated)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;now, positive correlation is equivalent to positive covariance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Working with covariance and above hypothesis, I have :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Cov}(r,V)=\text{Var}(x)+\beta^3\text{Var}(y)+(\beta+\beta^2)\text{Cov}(x,y)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $\text{Cov}(x,y)=\rho_{xy}\sqrt{\text{Var}(x)\text{Var}(y)}$&#xA;with $\rho_{xy}$ being the correlation between $x$ and $y$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;we finally get by dividing by $\text{Var}(x)$ and by setting $z=\sqrt{\frac{\text{Var}(y)}{\text{Var}(x)}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\text{Cov}(r,V)}{\text{Var}(x)}\geq 1+\beta^3z^2-(\beta+\beta^2)z$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is an equality if $\rho_{xy}=-1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;now &#xA;$$1+\beta^3z^2-(\beta+\beta^2)z\geq 1-\frac{(\beta+\beta^2)^2}{4\beta^3}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is hit when $z=\frac{\beta+\beta^2}{2\beta^3}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With $\beta$ small enough, rhs is negative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So by setting $x$ and $y$ with $\rho_{xy}=-1$ and $\text{Var}(y)=\left(\frac{\beta+\beta^2}{2\beta^3}\right)^2\text{Var}(x)$, and $\beta$ small enough, you get a counter example.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-06-02T13:13:04.527" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26405" PostTypeId="2" ParentId="26377" CreationDate="2016-06-02T14:08:16.353" Score="1" Body="&lt;p&gt;The most difficult aspect of a backtest is making sure you are working with all stocks that were available at the time each decision is made and using only information that would have been available at the time each decision is made. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means (1) the database must include  stocks that were once in the index but now are not (&quot;dead stocks&quot; like Enron or Northern Rock Bank), (2) the database must include &quot;point in time&quot; figures that capture the date that earnings were released as well as the amount announced, if the earnings are restated there should be a second date and figure with the restated earnings and restatement date, and so on. Many databases include only the currently accepted earnings figure and are not clear on the date they were released.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, you have to be careful about overfitting, which is the testing of a large number of hypotheses at random in the attempt to generate a statistically significant one.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2016-06-02T14:08:16.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26407" PostTypeId="1" CreationDate="2016-06-02T15:23:42.253" Score="2" ViewCount="439" Body="&lt;p&gt;I'm trying to understand the difference between the actuarial method and the U.S. Rule for calculating interest. I think the difference is that the actuarial rule adds unpaid interest to the principal balance and the US Rule does not. So the actuarial rule allows the charging of compound interest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I'm reading Neifeld's Guide to Instalment Computations (a book by an  economist at a major lender back in the `50s) and it says this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;“The United States Rule prescribes the actuarial method. The rule is in essence a decision on the application of partial payments, their apportionment between charge and principal being the point at issue. Interest is computed on the unpaid balance, at the stated rate, for the elapsed time; it is equal to the action of the principal for one period multiplied by the stated rate. In instalment repayments, whether a discount or an add-on transaction, the actuarial method computes the rate which meets the condition of the United States Rule.” at 325&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The first and last sentence of the above quote really confuses me - it sounds like the actuarial method and US rule are the same thing. But is he using &quot;actuarial method&quot; to refer to something else? For example, on another page in the book (p149), it describes the actuarial method as one of several ways &quot;of distributing the credit cost in the amortization of a debt&quot; (along with the direct ratio method, constant ratio method, and others).&lt;/p&gt;&#xA;" OwnerUserId="20999" LastActivityDate="2016-06-02T15:23:42.253" Title="US Rule versus Actuarial Method for calculating interest" Tags="&lt;credit&gt;&lt;interest&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26409" PostTypeId="2" ParentId="26389" CreationDate="2016-06-02T16:47:53.983" Score="1" Body="&lt;p&gt;You see $(Y,X)$, you want a relation ship between $X$ and $Y$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will assume Linear regression&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e you assume it exists $\beta$ such that $Y=X\beta + \epsilon$ and you want to find $\beta$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solution: $\hat{\beta}=(X'X)^{-1}X'Y$ and $\epsilon = Y-\hat{Y}=Y-X\hat{\beta}=(I-X(X'X)^{-1}X')Y$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you apply to your case :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X\to B$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\beta \to f$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Y\to R$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\epsilon \to \epsilon$&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-06-02T16:47:53.983" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26410" PostTypeId="1" AcceptedAnswerId="27492" CreationDate="2016-06-02T16:51:24.807" Score="7" ViewCount="603" Body="&lt;p&gt;Theoretical question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider if a bank account had a -12% yearly interest rate, and an account was currently overdrawn to a balance of -$100.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What would the bank do to the -$100 balance after one month's -1% is applied?&lt;/p&gt;&#xA;" OwnerUserId="21000" LastActivityDate="2016-06-10T14:02:58.507" Title="What if: Negative interest on an overdrawn bank account?" Tags="&lt;interest-rates&gt;&lt;interest&gt;&lt;negative&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26411" PostTypeId="1" CreationDate="2016-06-02T17:29:34.137" Score="1" ViewCount="97" Body="&lt;p&gt;What would be reasonable rates of return for the computation of perpetuity in firm valuation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tend to google FMI's expected World GDP growth rate, but I can't always find results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would someone have any suggestions of methodologies for the estimation of these rates and sources for the required inputs?&lt;/p&gt;&#xA;" OwnerUserId="17633" LastActivityDate="2016-06-19T10:13:52.540" Title="Valuation growth rate for perpetuity" Tags="&lt;equities&gt;&lt;valuation&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26412" PostTypeId="1" CreationDate="2016-06-02T17:32:07.557" Score="1" ViewCount="108" Body="&lt;p&gt;I have a bit of trouble understanding how to determine the replicating portfolio of a call using just a stock and the riskfree asset. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have times $t = 0,1,2$, and at time $2$, we have $3$ payoffs ($(69, 4, 0)$), at time $1$ the arbitrage-free prices are $18$ and $0.8$, and at time $0$, the arbitrage-free price of the call is $4$. (Note that this is just a two-period binomial tree). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I determine the replicating self-financing portfolio, both what is needed to be held at time $0$ and what is needed to be held at time $1$? All the other values (stock prices, rate of return on riskfree asset, and equivalent martingale measures) are available as well. I would prefer an answer based on this simple example as opposed to an answer using some theorem which I have not heard of. &lt;/p&gt;&#xA;" OwnerUserId="21001" LastActivityDate="2016-06-02T17:32:07.557" Title="Replicating portfolio: initial portfolio?" Tags="&lt;option-pricing&gt;&lt;replication&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26413" PostTypeId="1" CreationDate="2016-06-02T17:33:15.063" Score="2" ViewCount="580" Body="&lt;p&gt;I am thoroughly confused after reading Dumas, Fleming &amp;amp; Whaley (1998) &quot;Implied Volatility Functions: Empirical Tests&quot;.  Both the Ad Hoc BS Model and the Deterministic Volatility Function approaches in the paper seem to posit a structure for a function determining volatility and then run a regression to determine the coefficients. What is the difference between the two approaches? What am I overlooking?&lt;/p&gt;&#xA;" OwnerUserId="20377" LastEditorUserId="20377" LastEditDate="2016-06-02T19:14:39.147" LastActivityDate="2016-10-31T10:04:16.207" Title="Difference between Deterministic Volatility Function approach and Ad Hoc Black Scholes?" Tags="&lt;volatility&gt;&lt;black-scholes&gt;&lt;implied-volatility&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26415" PostTypeId="2" ParentId="18885" CreationDate="2016-06-03T00:53:56.230" Score="0" Body="&lt;p&gt;There's nothing wrong with your formulation, in my opinion.  If you model the rate z_30 with a fixed mean, then indeed the forward ZCB price is long vega.  This means that the forward interest rate is short vega (i.e. the 30yr into 10yr forward rate goes down when vol goes up).  This is self-consistent.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In most textbooks, however, the forward interest rate and forward bond prices are taken as given.  Therefore, when you measure the vega of some instrument, you leave forward rates unchanged.  Hence bonds, by definition, have no vega.  To produce a model like this, the mean of your forward rate distribution would have to be set so as to reprice the forward rates correctly.  How this is done exactly, depends on the probability measure you are in.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, a CMS contract, which has a payoff linear in the swap rate, has a non zero vega in the textbook model, but would have a zero vega in the model that you built.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-06-03T00:53:56.230" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26416" PostTypeId="1" AcceptedAnswerId="27443" CreationDate="2016-06-03T05:48:17.967" Score="2" ViewCount="122" Body="&lt;p&gt;Is it possible to convert an SARIMA model to a continuous model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so, what is the methodology to do that? &lt;/p&gt;&#xA;" OwnerUserId="21007" LastActivityDate="2016-06-05T12:54:13.173" Title="From discrete time series models to continuous" Tags="&lt;stochastic-processes&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26417" PostTypeId="2" ParentId="26413" CreationDate="2016-06-03T08:35:53.263" Score="1" Body="&lt;p&gt;At $t=0$, you have a vol surface $(T,K)\to\sigma(t=0,S_t=S_0,T,K)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the hard question is which dynamics i.e $\sigma$ seen as $\sigma: (t,S_t)\to ((T,K)\to \sigma(t,S_t,T,K))$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and even, if you imagine that behind this, there is a deterministic function, you still have to suppose a dependence with respect to $S_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are two examples&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) $\sigma(t=0,S_t=S_0,T,K)=f(T-t,\ln(K/S_t))$ where $f$ is a deterministic function fitting your data at $t=0$ (kind of sticky moneyness)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) $\sigma(t=0,S_t=S_0,T,K)=g(T-t,K)$ where $g$ is a deterministic function fitting your data at $t=0$ (kind of sticky strike)&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-06-03T08:35:53.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26418" PostTypeId="2" ParentId="26416" CreationDate="2016-06-03T08:42:15.527" Score="1" Body="&lt;p&gt;You find the connection between an AR(1) and an Ornstein-Uhlenbeck process here in QSE if you search. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taken the description form &lt;a href=&quot;https://quant.stackexchange.com/questions/11055/ornstein-versus-ar1-for-modeling-stationary-data&quot;&gt;here&lt;/a&gt; (which is just the way to do it):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;X_{n+1} = c + a X_n + b \varepsilon_k&#xA;$$&#xA;and by setting $c=\theta \mu \Delta t, a=−\theta \Delta t$ and $b =\sigma \sqrt{\Delta t}$ &#xA;you will get the discrete time approximation &#xA;$$ &#xA;X_{n+1} = \theta(\mu - X_n)\Delta t + \sigma \varepsilon_k\sqrt{\Delta t},&#xA;$$&#xA;which corresponds to the continuous time OU-process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you add a seasonal process then you have SAR(1).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus AR(1) + seasonal component in discrete time is&#xA;$$&#xA;dX_t = a (b-\mu) dt + dB_t + dS_t &#xA;$$&#xA;where $S_t$ is a periodic function. This would be the solution for the AR(1) case and no seasonal AR or MA component.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we think of the dependence structure in higher order AR processes I wonder whether there is a continuous time model for AR(n) for $n&amp;gt;1$.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-06-03T08:42:15.527" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26419" PostTypeId="1" CreationDate="2016-06-03T09:24:25.683" Score="1" ViewCount="390" Body="&lt;p&gt;Calculate the value of 9-month American call option to buy 1 million units of a foreign currency using a three-step binomial tree. The current exchange rate is 0.79 and the strike price is 0.80 (both expressed as dollars per unit of the foreign currency). The volatility of the exchange rate is 12% per annum. The domestic and foreign risk-free rates are 2% and 5%, respectively. What position in the foreign currency is initially necessary to hedge the risk? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have no idea how to deal with it. I would like someone to help me out. Thanks!&lt;/p&gt;&#xA;" OwnerUserId="21008" LastActivityDate="2016-06-03T09:24:25.683" Title="A question on option pricing" Tags="&lt;option-pricing&gt;" AnswerCount="0" CommentCount="4" ClosedDate="2016-06-03T10:22:48.410" ContentLicense="CC BY-SA 3.0" />
  <row Id="26420" PostTypeId="1" CreationDate="2016-06-03T12:18:12.793" Score="3" ViewCount="556" Body="&lt;p&gt;I am looking at a displaced CIR model and try to calibrate it to market data. I think my results looks reasonable but would like to sense-check with other studies. Does anyone know what &quot;reasonable&quot; parameters (which region they should be in) for a CIR model is? If anyone has some good articles that describe this, I would be glad if you would share it. I can't really seem to find some.   &lt;/p&gt;&#xA;" OwnerUserId="19761" LastActivityDate="2017-03-31T19:27:40.777" Title="Cox-Ingersoll-Ross" Tags="&lt;short-rate&gt;" AnswerCount="2" CommentCount="7" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26421" PostTypeId="1" CreationDate="2016-06-03T14:38:26.517" Score="3" ViewCount="654" Body="&lt;p&gt;I have the following questions about arbitrage that I am unsure of. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Will an inverse term structure rate imply arbitrage possibilities?&lt;/li&gt;&#xA;&lt;li&gt;Will negative zero coupon rates imply arbitrage possibilities? &lt;/li&gt;&#xA;&lt;li&gt;Is it possible to have arbitrage possibilities in an incomplete market?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="21011" LastActivityDate="2016-06-07T14:15:26.187" Title="Questions on arbitrage" Tags="&lt;arbitrage&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26422" PostTypeId="1" CreationDate="2016-06-03T15:10:56.720" Score="4" ViewCount="197" Body="&lt;p&gt;Here are two questions related to implied volatilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) The set up here is for an European option. We can get its implied volatility smile from calibration, the question is why could we also observe 'volatility smile' in the market?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) The second question is for the Heston stochastic volatility model. We use the Heston model to calibrate the implied volatilities of an European option for short term and long term maturities. The results shows clearly it is better fit with long maturity. Why? (Here the Heston model implied volatilities are plotted against the market implied volatilities)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The full answer is not necessarily needed here, some indications or references can also help.&lt;/p&gt;&#xA;" OwnerUserId="21013" LastEditorUserId="21013" LastEditDate="2016-06-03T15:19:55.293" LastActivityDate="2021-02-13T02:04:50.520" Title="How can we observe volatility smile from the market. Drawbacks of Heston Stochastic Volatility Model" Tags="&lt;options&gt;&lt;stochastic-processes&gt;&lt;implied-volatility&gt;&lt;finance&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26423" PostTypeId="2" ParentId="26421" CreationDate="2016-06-03T15:38:17.123" Score="4" Body="&lt;p&gt;1) not sure to see what you mean by inverse term structure rate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) no if $r&amp;gt;-100\%$, $r&amp;lt;0$ means having cash on you will cost you something&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) If there is an unhedgeable risk in your market, it is not complete. So you cannot build an arbitrage based on this risk (since it is unhedgeable, it is pure bet). However, you could have arbitrage elsewhere in your market.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-06-03T15:38:17.123" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26424" PostTypeId="1" CreationDate="2016-06-03T18:10:45.500" Score="1" ViewCount="92" Body="&lt;p&gt;Is it possible to know the typical number of mortgages that can be packaged into a MBS product, e.g. a pass-through MBS, or an agency backed TBA. I think the minimum size is \$1-million but if a typical mortgage is around \$100k then this means only 10 mortgages might be delivered, which seems a very small amount.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any information to see what is typically delivered into a TBA?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="21016" LastActivityDate="2021-01-30T12:18:26.937" Title="Number of mortgages in a MBS" Tags="&lt;mbs&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="26425" PostTypeId="1" CreationDate="2016-06-03T18:25:35.300" Score="1" ViewCount="186" Body="&lt;p&gt;Does anybody have any knowledge of Architecture and/or Infrastructure needed for building your own Robo Advisor. I am looking for directions to get in-depth  knowledge for building your own Robo Advisor. Any help would be greatly appritiated.&lt;/p&gt;&#xA;" OwnerUserId="21015" LastActivityDate="2016-06-03T18:25:35.300" Title="Architecture and Infrastructure for Robo-Advisor" Tags="&lt;portfolio-management&gt;" AnswerCount="0" CommentCount="2" ClosedDate="2016-06-04T21:46:01.977" ContentLicense="CC BY-SA 3.0" />
  <row Id="26426" PostTypeId="2" ParentId="21786" CreationDate="2016-06-03T19:31:00.677" Score="1" Body="&lt;p&gt;I wrote a paper with Alex Shubert. You can get it on archive.org.&lt;/p&gt;&#xA;" OwnerUserId="21018" LastActivityDate="2016-06-03T19:31:00.677" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="26427" PostTypeId="2" ParentId="25804" CreationDate="2016-06-03T20:29:30.993" Score="1" Body="&lt;p&gt;I am sure that some people do this. Generally, there is some evidence that informed traders choose to trade in the option markets first (&lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/0022-1082.194060/abstract&quot; rel=&quot;nofollow&quot; title=&quot;Easley et.al, 1998&quot;&gt;Easley et.al, 1998)&lt;/a&gt;. This is especially true if an informed trader has bad news about a short-sale constrained stock.  In this case the option market leads the equity market. Moreover, I was told that there are some people that extract option implied information (e.g. steepness of the volatility skew or changes in implied volatility) and trade equities based in this. There is a lot of academic literature on this e.g. &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/jofi.12181/abstract&quot; rel=&quot;nofollow&quot;&gt;AN et.al, 2014&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I never tried these strategies myself. Option data should be provided by your broker.  &lt;/p&gt;&#xA;" OwnerUserId="9283" LastActivityDate="2016-06-03T20:29:30.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26428" PostTypeId="1" AcceptedAnswerId="26431" CreationDate="2016-06-03T20:30:18.930" Score="4" ViewCount="357" Body="&lt;p&gt;I am self-studying for an actuarial exam, Models for Financial Economics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's stated as a given in my manual that $\sigma$ is the volatility of the stock, $\sqrt{\text{Var}(\ln(S_t/S_0))}$ and that the volatility of the continuously compounded return on a stock is given by $\sqrt{\text{Var}(\ln(S))}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly $\sqrt{\text{Var(X)}}$ is volatility, but where does the $\ln(S_t/S_0)$ and $\ln(S)$ come from, respectively?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also stated without proof is that if a stock pays continuous dividends, $\sqrt{\text{Var}(\ln(S_t/S_0))} = \sqrt{\text{Var}\big(F_{0, t}^p(S)\big)}$. i.e. the volatility of the stock is the same as the volatility of the prepaid forward on the stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was hoping someone could provide reference to a derivation, or an explanation.&lt;/p&gt;&#xA;" OwnerUserId="5641" LastActivityDate="2016-06-04T01:32:45.657" Title="What's the explanation for the formula for the volatility of a stock / volatility of the continuously compounded return of a stock?" Tags="&lt;black-scholes&gt;&lt;self-study&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26429" PostTypeId="1" CreationDate="2016-06-03T22:14:47.150" Score="2" ViewCount="687" Body="&lt;p&gt;I am currently reading a book which begins its portfolio theory section with the case with $n$ risky assets where it proves that 2-fund separation applies (any minimum variance portfolio is a linear combination of two minimum variance portfolios with distinct returns). It then moves on to the case where there's a riskfree asset as well, and claims at one point that each agent will hold a mix of the tangent portfolio and the riskfree asset. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Why?&lt;/strong&gt; A result like this would require reproving 2-fund-separation in this new situation as well, but the author doesn't mention it at all. Is there then a different way to see this result, or is it just 2fundseparation that the author just forgot to mention still holds?&lt;/p&gt;&#xA;" OwnerUserId="21011" LastActivityDate="2017-01-31T12:33:04.580" Title="Two fund separation when there's a risky asset?" Tags="&lt;modern-portfolio-theory&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26430" PostTypeId="2" ParentId="26428" CreationDate="2016-06-04T01:15:37.787" Score="0" Body="&lt;p&gt;You can see e^(rt) =St/S0, which is continuous and can generate r when t=1 time  lag r= In(St/S0).&lt;/p&gt;&#xA;" OwnerUserId="21017" LastActivityDate="2016-06-04T01:15:37.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26431" PostTypeId="2" ParentId="26428" CreationDate="2016-06-04T01:32:45.657" Score="3" Body="&lt;p&gt;The standard starting point with modelling a stock price process is to use the Black-Scholes model for the stock price. This simply &lt;strong&gt;asserts&lt;/strong&gt; that the changes in the stock price are described by the following stochastic differential equation (SDE)&#xA;$$\dfrac{\textrm{d}S}{S} = \mu\:\textrm{d}t + \sigma\:\textrm{d}W_t$$&#xA;where $W_t$ is a standard Brownian motion (which is a &lt;em&gt;random variable&lt;/em&gt;), and typically $ \mu$ and $\sigma$ are taken to be positive constants, (although this assumption can be dropped, the final result is more complicated).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A standard argument to solve this is to then apply Ito's Lemma to the process $\log(S)$ by considering $\textrm{d}\big(\log(S)\big)$. Although to formally appreciate the subtle details requires a course in stochastic calculus. The final result though is that the solution to the above SDE is &#xA;$$&#xA;S = S_0\exp\left(\left(\mu - \dfrac{\sigma^2}{2}\right)t + \sigma W_t\right)\:.&#xA;$$&#xA;Notice that again $S$ is still a random variable (technically a log-normal random variable). Then if we consider $\log\left(\dfrac{S}{S_0}\right)$ we see that &#xA;$$&#xA;\log\left(\dfrac{S}{S_0}\right)&#xA;=&#xA;\left(\mu - \dfrac{\sigma^2}{2}\right)t + \sigma W_t&#xA;$$&#xA;which is a normally distributed random variable with mean $\left(\mu - \dfrac{\sigma^2}{2}\right)t$ and standard deviation $\sigma t^{\frac{1}{2}}$. What is then typically done is a time scale is picked such that $t\to1$ and so the standard deviation of (aka the noise) evaluates to $\sigma$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise I am not sure what your notation is for a stock which pays dividends, so can't comment on that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Look up any introductory book on &lt;em&gt;financial derivatives&lt;/em&gt; or &lt;em&gt;stochastic calculus for financial applications&lt;/em&gt; and this should cover the issues in more detail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope that helps. &lt;/p&gt;&#xA;" OwnerUserId="21016" LastActivityDate="2016-06-04T01:32:45.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26432" PostTypeId="2" ParentId="26420" CreationDate="2016-06-04T01:45:04.703" Score="0" Body="&lt;p&gt;I am not sure what you mean by a displaced CIR model, but for the following CIR model for annualised interest rates&#xA;$$&#xA;\textrm{d}r = \alpha(\beta-r)\:\textrm{d}t + \sigma \sqrt{r\:} W_t&#xA;$$&#xA;I have seen papers use similar values to $\alpha = 0.6\:\textrm{year}^{-1}$, $\beta = 0.06$, $\sigma = 0.25\:\textrm{year}^{-\frac{1}{2}}$. An example of such a paper is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;&quot;A stochastic partial differential equation model for the pricing of mortgage-backed securities&quot;&lt;/em&gt;,&#xA;by Ferhana Ahmad, Ben Hambly, and Sean Ledger, 2016.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="21016" LastEditorUserId="21016" LastEditDate="2016-06-04T13:06:48.787" LastActivityDate="2016-06-04T13:06:48.787" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="26433" PostTypeId="1" AcceptedAnswerId="27469" CreationDate="2016-06-04T12:39:32.647" Score="3" ViewCount="326" Body="&lt;p&gt;I have a slide on which there is written that under Black-Scholes model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\ln S_{T} \sim N \left ( \ln S_t - \frac{1}{2}\sigma^2(T-t), \sigma^2(T-t) \right )$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, &lt;a href=&quot;https://quant.stackexchange.com/questions/7811/in-black-scholes-why-is-log-fracs-t-triangle-ts-t-sim-phi-mu&quot;&gt;here&lt;/a&gt; there is a good explanation on why:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\ln{\frac{S_{T}}{S_t}} \sim N\left ((\mu - \frac{1}{2}\sigma^2)(T-t), \sigma^2 (T-t) \right )$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but this did not solve my problem. In fact I cannot see how one can get from the second equation to the first one.  I think that there is something wrong. Am I right?&lt;/p&gt;&#xA;" OwnerUserId="13439" LastEditorUserId="13439" LastEditDate="2016-06-06T08:38:16.680" LastActivityDate="2017-08-30T11:17:58.243" Title="Is it possible that under Black-Scholes: $\ln S_{T} \sim N \left ( \ln S_t - \frac{1}{2}\sigma^2(T-t), \sigma^2(T-t) \right )$" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;normal-distribution&gt;" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26434" PostTypeId="2" ParentId="26433" CreationDate="2016-06-04T14:25:37.110" Score="5" Body="&lt;p&gt;Starting from the Black-Scholes model that&#xA;$$&#xA;\dfrac{dS}{S} = \mu \:dt + \sigma\:dW_t&#xA;$$&#xA;where $W_t$ is a standard Brownian motion, and $\sigma$ and $\mu$ are constant where $\sigma &amp;gt; 0$. Here $W_t$ is a Brownian motion under the physical measure $\mathbb{P}$. We can then use Girsanov's theorem to change the measure to &lt;em&gt;risk neutral measure&lt;/em&gt; $\mathbb{Q}$ where we can now have $\mu \to r$, but this requires $\sigma \neq 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using stochastic calculus we we can write the right hand side of the above as a stochastic process $dX_t$ and then we can solve this trivially by using the Dolean stochastic exponential, where if we take our limits of integration to be be the domain $[t,T]$ then we recover&#xA;$$&#xA;S_T = S_t \exp \left( \left(r - \dfrac{\sigma^2}{2}\right)(T-t) + \sigma(W_T - W_t)\right).&#xA;$$&#xA;Now we observe that $S_T$ has a log-normal distribution with &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\log(S_T) \sim N\left(\log(S_t) + \left(r - \dfrac{\sigma^2}{2}\right)(T-t), \sigma^2(T-t)\right)&#xA;$$&#xA;We can then de-mean both sides by $\log(S_t)$ where &#xA;$$&#xA;\log(S_T) - \log(S_t) \sim N\left(\log(S_t) + \left(r - \dfrac{\sigma^2}{2}\right)(T-t), \sigma^2(T-t)\right) - \log(S_t)&#xA;$$&#xA;$$&#xA;\log\left(\dfrac{S_T}{S_t}\right)\sim N\left(\left(r - \dfrac{\sigma^2}{2}\right)(T-t), \sigma^2(T-t)\right)&#xA;$$&#xA;If we then consider the case where $r=0$ then we recover the equations stated in the question. The subtle aspects of the above are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Knowing how to integrate a stochastic process properly.&lt;/li&gt;&#xA;&lt;li&gt;Knowing how to apply Girsanov's theorem to change the measure from $\mathbb{P} \to \mathbb{Q}$ such that in our equations $\mu \to r$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="21016" LastEditorUserId="21016" LastEditDate="2017-08-30T11:17:58.243" LastActivityDate="2017-08-30T11:17:58.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="26435" PostTypeId="1" CreationDate="2016-06-04T15:48:55.707" Score="9" ViewCount="1133" Body="&lt;p&gt;Emanuel Derman wrote a great paper &lt;a href=&quot;http://www.emanuelderman.com/writing/entry/regimes-of-volatility-risk-april-1999&quot; rel=&quot;noreferrer&quot;&gt;in 1999&lt;/a&gt; about volatility regimes and the adjustments the market makes during these periods (sticky strike, sticky implied tree, sticky delta, etc). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has any research been done on the transitions between these regimes, even if identifying them retroactively?&lt;/p&gt;&#xA;" OwnerUserId="20194" LastActivityDate="2017-04-08T21:52:30.813" Title="Transition Between Volatility Regimes" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;market-regimes&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="26436" PostTypeId="1" CreationDate="2016-06-04T18:14:59.750" Score="3" ViewCount="99" Body="&lt;p&gt;I mean from my home for myself&#xA;I have a degree in statistics so I know time series, predictions, R ...&#xA;I would like to design statistical model for trading with R &#xA;I don't ask for trading strategies, only capital required&lt;/p&gt;&#xA;" OwnerUserId="21025" LastEditorUserId="-1" LastEditDate="2016-06-05T19:21:39.670" LastActivityDate="2016-06-05T19:21:39.670" Title="what is the minimum capital necessary for quantitative/automated/algorithm trading?" Tags="&lt;r&gt;&lt;statistics&gt;&lt;quantitative&gt;" AnswerCount="0" CommentCount="0" ClosedDate="2016-06-04T21:41:04.250" ContentLicense="CC BY-SA 3.0" />
  <row Id="26437" PostTypeId="1" CreationDate="2016-06-04T18:56:01.993" Score="1" ViewCount="517" Body="&lt;p&gt;I have not been able to write a Matlab code for the Bates model without errors. Could someone share theirs please?&lt;/p&gt;&#xA;" OwnerUserId="21026" LastActivityDate="2016-06-04T18:56:01.993" Title="Could someone please share the Matlab code for the stochastic volatility jump diffusion option pricing model? (Bates model)" Tags="&lt;option-pricing&gt;&lt;stochastic-volatility&gt;&lt;jump&gt;&lt;bates&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ClosedDate="2016-06-04T21:47:08.933" ContentLicense="CC BY-SA 3.0" />
  <row Id="26438" PostTypeId="1" CreationDate="2016-06-05T00:57:54.060" Score="4" ViewCount="219" Body="&lt;p&gt;In the context of a backtesting engine, is it better to have strategy generate trade signals in the range from -1 to 1 or as exact predicted returns (e.g. -12% or 26%).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The difference lies in how to regress the underlying model: whether to put (the response variable) returns as 1 (for positive) or -1 (for negative) (and use a logit model) or put exact historical return values (and use a linear model).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason for asking this is that I found a model that gives me an R^2 of almost 0 (which would seem rubbish in terms of predicting returns), but when backtesting it performs well and is actually a good proxy for relative signal strength (although the returns it gives are 0.17% or -0.09% etc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that by assigning 1 for positive returns I am losing some of the information; on the other hand trying to predict exact returns seems like a tall order -- I do not like that R^2 might not correspond to backtest results at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which approach is better? Is there some standard literature on this (be it backtesting component design or alpha strategy design)?&lt;/p&gt;&#xA;" OwnerUserId="11655" LastEditorUserId="11655" LastEditDate="2016-06-05T09:19:14.190" LastActivityDate="2016-06-05T09:19:14.190" Title="Trading signal strength: [-1 to 1] or [predicted return]?" Tags="&lt;backtesting&gt;&lt;regression&gt;&lt;strategy&gt;&lt;digital-signal-processing&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27438" PostTypeId="1" AcceptedAnswerId="27445" CreationDate="2016-06-05T08:44:16.577" Score="1" ViewCount="750" Body="&lt;p&gt;Just a quick question I was hoping someone could shed light on.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;So far I am familiar with the Black-Scholes PDE with the terminal&#xA;condition at time $T$ been $V(t=T,S)=(S-K)^+$.&lt;/li&gt;&#xA;&lt;li&gt;I also understand that the Black-Scholes PDE does not contain $S(T)$ and therefore is independent of the terminal condition.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As such, if the terminal condition was to be $(S^2 - K)^+$ the PDE for the call option remains the same - at least that is what I am told.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuitively I don't understand the logic behind this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if $K$ is 50 and $S$ ends up been 100;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;$(S - K) = \$50$, where as.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$(S^2 - K) = 10,000 - 50 = \$9,950$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Surely the $(S^2 - K)+$ option must be worth a lot more?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But apparently the PDE for both these options is the same and therefore the time $t$ value is also the same?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anyone please explain?&lt;/p&gt;&#xA;" OwnerUserId="20875" LastEditorUserId="743" LastEditDate="2016-06-08T15:49:01.890" LastActivityDate="2016-06-08T15:49:01.890" Title="Black-Scholes PDE &amp; Terminal Condition" Tags="&lt;black-scholes&gt;&lt;black-scholes-pde&gt;" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="27439" PostTypeId="2" ParentId="26429" CreationDate="2016-06-05T09:16:55.193" Score="1" Body="&lt;p&gt;The two fund separation theorem still hold. &#xA;If you have N risky asset with your efficient frontier and add the risk free asset, as result you achieve another efficient frontier that boil down in a straight line (the CML).&#xA;You can see also this short explanation &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/26034/tangency-portfolio-and-cml-why-does-it-have-the-highest-sharpe-ratio?rq=1&quot;&gt;Tangency portfolio and CML - Why does it have the highest sharpe ratio?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other the two-fund separation theorem is easy to understand, and demonstrate, in N risky plus 1 riskless setting. In N risky assets setting is sensibly more complicated. If you understood the second case ... the first is already grasped. &lt;/p&gt;&#xA;" OwnerUserId="20746" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-06-05T09:16:55.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27440" PostTypeId="1" CreationDate="2016-06-05T09:55:49.823" Score="3" ViewCount="174" Body="&lt;p&gt;wondering if somebody could check my answer for a homework question!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given a straddle, characterized by its pay-off at maturity $X=|S(T)-K|$, I am asked to find the price of the (simple) claim at any time $t\in [0,T]$. Starting at&#xA;$$V(t)=e^{-r(T-t)}\mathbb{E_Q}[|S(T)-K||\mathcal{F}_t]$$&#xA;with $S(t)=S_0\exp{((r-\frac{1}{2}\sigma^2)t+\sigma W^\mathbb{Q}(t))}$, I finally end up with the value process:&#xA;$$V(t)=2S(t)\Phi(d_1)-2Ke^{-r(T-t)}\Phi(d_2)-S(t)+Ke^{-r(T-t)}$$&#xA;where&#xA;$$d_1=\frac{\ln(S(t)/K)+(r+\frac{1}{2}\sigma^2)(T-t)}{\sigma\sqrt{T-t}},\quad d_2=d_1-\sigma\sqrt{T-t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, it is suggested that there exists a constant hedging portfolio for this claim. The portfolio consists not only of stocks and bonds, but also contains European call options. That is, I wish to find a portfolio with value process $\hat{V}(t)=x_tS(t)+y_tB(t)+z_tC(t)$, where $(x_t,y_t,z_t)$ remains constant for $t\in[0,T]$. My gut tells me that $(x_t,y_t,z_t)=(-1,Ke^{-rT},2)$ as the value process of the claim can be written as:&#xA;$$V(t)=Ke^{-r(T-t)}-S(t)+2C(t)$$&#xA;with $C(t)$ the price for a call option (by the Black-Scholes formula). I can &quot;semi-justify&quot; this by defining $V(t)=v(t,x)+2C(t)$ with $v(t,x)=Ke^{-r(T-t)}-x$, so that $v$ satisfies the Black-Scholes partial differential equation and thus the portfolio with $$x_t=v_x(t,S(t))=-1, \qquad y_t=e^{rt}(v(t,S(t))-x_tS(t))=Ke^{-rT}$$ hedges the claim $K-S(t)$. Then I just add $2C(t)$ to both the value process of the portfolio and $v(t,S(t))$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So! My two questions here are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Have I calculated the value process $V(t)$ for the claim correctly?&lt;/li&gt;&#xA;&lt;li&gt;Have I correctly justified the hedging portfolio for the claim?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="22029" LastActivityDate="2016-06-05T10:55:45.643" Title="Price and constant hedging portfolio for straddle: $X=|S(T)-K|$" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;hedging&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27441" PostTypeId="2" ParentId="27440" CreationDate="2016-06-05T09:59:15.410" Score="4" Body="&lt;p&gt;just take a call and a put struck at $K$ and add them together. For the hedge just add the hedges together as well. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2016-06-05T09:59:15.410" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27442" PostTypeId="2" ParentId="27440" CreationDate="2016-06-05T10:50:36.387" Score="1" Body="&lt;p&gt;Another approach as follow.&#xA;The $T$-Straddle option $X$, i.e. &#xA;$$X=\left\{ \begin{align}&#xA;  &amp;amp; K-S(T)\quad ,\quad 0&amp;lt;S(T)\le K \\ &#xA; &amp;amp; S(T)-K\quad ,\quad S(T)&amp;gt;K \\ &#xA;\end{align} \right.&#xA;$$&#xA;has then following contract function&#xA;$$\Phi (x)=\left\{ \begin{align}&#xA;  &amp;amp; K-x\quad ,\quad 0&amp;lt;x\le K \\ &#xA; &amp;amp; x-K\quad ,\quad x&amp;gt;K \\ &#xA;\end{align} \right.&#xA;$$&#xA;which can be decomposed into the following &lt;strong&gt;basic contract&lt;/strong&gt; functions written&#xA;$$\Phi (x)=K\times {{\Phi }_{B}}(x)-1\times {{\Phi }_{S}}(x)+2\times {{\Phi }_{C,K}}(x)$$&#xA;such that&#xA;\begin{align}&#xA;  &amp;amp; {{\Phi }_{B}}(x)=1 \\ &#xA; &amp;amp; {{\Phi }_{S}}(x)=x \\ &#xA; &amp;amp; {{\Phi }_{C,K}}(x)=\max \{x-K\,,0\} \\ &#xA;\end{align}&#xA;then&#xA;$$\Pi (t,X)=K{{e}^{-r(T-t)}}-{{S}_{t}}+2{{C}_{BC}}({{S}_{T}},K)$$&#xA;Note&#xA;\begin{align}&#xA;  &amp;amp; E_{t}^{Q}\left[ {{\Phi }_{B}}(x) \right]=E_{t}^{Q}\left[ 1 \right]={{e}^{-r(T-t)}} \\ &#xA; &amp;amp; E_{t}^{Q}\left[ {{\Phi }_{S}}(x) \right]=E_{t}^{Q}\left[ {{S}_{t}} \right]={{S}_{t}} \\ &#xA; &amp;amp; E_{t}^{Q}\left[ {{\Phi }_{C,K}}(x) \right]=E_{t}^{Q}\left[ {{({{S}_{T}}-K)}^{+}}]=C_{BC}(S_T,K \right) \\ &#xA;\end{align}&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-06-05T10:55:45.643" LastActivityDate="2016-06-05T10:55:45.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27443" PostTypeId="2" ParentId="26416" CreationDate="2016-06-05T12:54:13.173" Score="1" Body="&lt;p&gt;Let's look at the formula for an ARMA(p, q) model&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;X_t = c + \sigma z_t + \sum_{i=1}^p \varphi_i X_{t-i} + \sigma\sum_{i=1}^{q}\theta_i z_{t-i}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $z_t \in \mathcal{N}(0,1)$ for all $t$. Transform this into the continuous time counterpart below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;X_t = c + \sigma W_t + \int_0^{T_p}\varphi(v)X_{t-v} dv + \sigma\int_0^{T_q}\theta(v)W_{t-v}dv&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $T_{p,q}$ are the width of the lookback window (in years) for the AR and MA terms. The sequence of coefficients have been replaced by continuous functions of time $\varphi, \theta : \mathbb{R_+} \mapsto \mathbb{R}$. Interpolation methods can be used to go from the discrete $\varphi_i$ to the continuous $\varphi(v)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A problem that I see with this is that I believe the $z_t$ should probably not be replaced with $W_t$ but something more like &quot;$\sqrt{dt}dW_t$ &quot; but I am not sure how to formalize that. I am also not sure about how to write out the total derivative for this SDE $dX_t$ any help with that would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="4910" LastActivityDate="2016-06-05T12:54:13.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27445" PostTypeId="2" ParentId="27438" CreationDate="2016-06-05T14:14:13.607" Score="2" Body="&lt;p&gt;The PDE will be the same but because the terminal condition is different the solutions will not be the same. The different boundary condition will give different values at $t=T$. Then the equation is marched backwards in time in both cases using the same equation but because the terminal condition is different the solutions will not agree &lt;/p&gt;&#xA;" OwnerUserId="22031" LastActivityDate="2016-06-05T14:14:13.607" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27447" PostTypeId="1" CreationDate="2016-06-05T15:17:33.213" Score="4" ViewCount="1478" Body="&lt;p&gt;What is the 2x5 swap rate? here 2x5 swap rate refers to the 3-year swap, 2 years forward.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/A7QRN.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/A7QRN.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="21013" LastActivityDate="2018-11-26T12:49:00.663" Title="How to calculate this swap rate" Tags="&lt;swaps&gt;&lt;forward&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27448" PostTypeId="2" ParentId="27438" CreationDate="2016-06-05T15:25:26.530" Score="0" Body="&lt;p&gt;It is reasonable and PDE approach is not suitable. In the Black scholes  model  we have &#xA;$$d\ln {{S}_{T}}=\,(r-\frac{1}{2}{{\sigma }^{2}})dt+\sigma d{{W}_{t}}$$&#xA;so&#xA;$$d\ln {{S}_{T}^2}=\,(2r-{{\sigma }^{2}})dt+2\sigma d{{W}_{t}}$$&#xA;as a result&#xA;$$\ln {{S}_{T}^2}=\ln{{S}_{t}^2}\,+(2r-{{\sigma }^{2}})(T-t)+2\sigma (W_T-W_t)$$&#xA;let &#xA;$$Y(t)=(2r-{{\sigma }^{2}})(T-t)+2\sigma [W(T)-W(t)]$$&#xA;it is clear&#xA;\begin{align}&#xA;  &amp;amp; \,\,\,\,{{E}^{\mathbb{Q}}}\left[ Y(t) \right]=(2r-{{\sigma }^{2}})(T-t) \\ &#xA; &amp;amp; {{\operatorname{var}}^{\mathbb{Q}}}\left[ Y(t) \right]=4{{\sigma }^{2}}(T-t) \\ &#xA;\end{align}&#xA;in the other words we can say&#xA;$$Y\overset{d}{\mathop{=}}\,\ N\left( (2r-{{\sigma }^{2}})(T-t)\,,4{{\sigma }^{2}}\left( T-t \right) \right)$$&#xA;For simplicity we let ${\widetilde{r}}=(2r-{{\sigma }^{2}})$ and $\tau =(T-t)$ so $Y\overset{d}{\mathop{=}}\,\ N\,(\overset{\tilde{\ }}{\mathop{r}}\,\tau \,,{4{\sigma }^{2}}\tau )$ as a result&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{Y-\overset{\tilde{\ }}{\mathop{r}}\,\tau }{2\sigma \sqrt{\tau }}\overset{\,\,d}{\mathop{\,=}}\,\ N(0,\,1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;we have&#xA;$$\Pi (t)=e^{-{r}\tau}{{E}_{t}}^{Q}\left[ {{({{S}_{T}}^{2}-K)}^{+}} \right]=e^{-{r}\tau}{{E}_{t}}^{Q}\left[ {{({{S}_{t}}^{2}{{e}^{{{Y}_{t}}}}-K)}^{+}} \right] $$&lt;br&gt;&#xA;$$\Pi (t)=e^{-{r}\tau}\int\limits_{-\infty }^{\infty }{{{({{S}_{t}}^{2}\,{{e}^{y}}-K,\,0)}^{+}}\,{{f}_{Y}}}(y)\,dy$$&#xA;Finally we should do same procedure with $(S_T-K)^+$, then&#xA;$$\Pi (t)={{S}_{t}}{{\,}^{2}}N\left[ {{d}_{1}} \right]-K{{e}^{-r\,\tau}}\ N\left[ {{d}_{2}} \right]$$ &#xA;where&#xA;\begin{align}&#xA;  &amp;amp; {{d}_{1}}=\frac{(2r+3{{\sigma }^{2}})\tau +\ln \left( \frac{{{S}_{t}}^{2}}{K} \right)}{2\sigma \sqrt{\tau }} \\ &#xA; &amp;amp; {{d}_{2}}={{d}_{1}}-2\sigma \sqrt{\tau } \\ &#xA;\end{align}&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastActivityDate="2016-06-05T15:25:26.530" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27449" PostTypeId="1" CreationDate="2016-06-05T15:37:49.137" Score="1" ViewCount="105" Body="&lt;p&gt;We define the following notions for a jointly normally distributed random vector $P=(P_1,...,P_n)$ with f the density function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mu=\int_{-\infty}^{\infty}(x_i-\mu_i)f_i(x_i)dx_i$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma^2_{ij}=\int_{-\infty}^{\infty}(x_i-\mu_i)(x_j-\mu_j)f_{ij}(x_i,x_j)dx_idx_j$$ where the density function of n-dimensional jointly normally distributed random vector is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f(x)=\frac{1}{(2\pi)^\frac{n}{2}\sqrt{\det{V}}}\exp\left(-\frac12 \left\langle x-\mu,V^{-1}(x-\mu)\right\rangle\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and where $V={(\sigma^2_{ij})}_{1\leq{i,j}\leq{n}}$ is the variance-covariance matrix.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I don't understand the density function of a jointly jointly normally distributed random vector.&lt;/li&gt;&#xA;&lt;li&gt;To understand all of these above terms, is the knowledge of multi-variate normal distribution necessary?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If any quant-finance expert could explain me the above terms, it would be helpful to me in understanding quadratic finance. &lt;/p&gt;&#xA;" OwnerUserId="15605" LastEditorUserId="467" LastEditDate="2016-06-07T06:05:43.077" LastActivityDate="2016-06-07T06:05:43.077" Title="How to understand quadratic finance or practice of Value-at -Risk(VaR)" Tags="&lt;portfolio-management&gt;&lt;var&gt;&lt;portfolio-selection&gt;&lt;cvar&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27450" PostTypeId="1" CreationDate="2016-06-05T16:49:38.987" Score="4" ViewCount="719" Body="&lt;p&gt;I am using ibPy to connect to TWS on a fairly fresh ubuntu machine. I have been successful in logging into the paper trading account and submitting buy and sell orders programatically via the ibPy interface.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I am now trying to do more than simply submit orders. Namely, I am trying to obtain position updated from TWS. I am interested in successfully running the following code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;from time import sleep&#xA;from ib.opt import ibConnection, message&#xA;&#xA;def error_handler(msg):&#xA;    print(msg)&#xA;&#xA;def acct_update(msg):&#xA;    print(msg)&#xA;&#xA;&#xA;con = ibConnection(clientId=100)&#xA;con.register(acct_update,&#xA;         message.updateAccountValue,&#xA;         message.updateAccountTime,&#xA;         message.updatePortfolio)&#xA;con.register(error_handler, &quot;Error&quot;)&#xA;con.connect()&#xA;con.reqAccountUpdates(True, 'DU000000')&#xA;&#xA;sleep(1)&#xA;con.disconnect()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When executed however I obtain the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;error id=-1, errorCode=502, errorMsg=Couldn't connect to TWS.  &#xA;Confirm that &quot;Enable ActiveX and Socket Clients&quot; is enabled on &#xA;the TWS &quot;Configure-&amp;gt;API&quot; menu.&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have ensured that indeed ActiveX and socket clients are enabled in the TWS preferences, so that is not the issue. It surprises me that I would be able to submit orders successfully but not obtain account updates from TWS. Does anyone know why this could be happening?&lt;/p&gt;&#xA;" OwnerUserId="22033" LastActivityDate="2021-04-13T12:06:55.630" Title="Trader Workstation on Ubuntu cannot be connected to via the API" Tags="&lt;programming&gt;&lt;python&gt;&lt;interactive-brokers&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27452" PostTypeId="1" AcceptedAnswerId="27457" CreationDate="2016-06-05T21:24:29.957" Score="1" ViewCount="436" Body="&lt;p&gt;Suppose we have 3 stocks following &lt;a href=&quot;https://en.wikipedia.org/wiki/Geometric_Brownian_motion&quot; rel=&quot;nofollow&quot;&gt;GBM&lt;/a&gt;s.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We are given the distribution of the &lt;strong&gt;daily&lt;/strong&gt; log returns which is multivariate normal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose I want to sample the stock price tomorrow ($\Delta t = 1$ day), could I just sample a return vector from this distribution and then say that the stock price tomorrow is $S_0 \cdot \exp(r_\text{sample}\Delta t)$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been arguing with my friend about this and he claims I should multiply by $\sqrt{\Delta t}$? I don't understand his argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anything wrong with what I am doing here? &lt;/p&gt;&#xA;" OwnerUserId="20156" LastEditorUserId="467" LastEditDate="2016-07-06T09:11:47.650" LastActivityDate="2016-07-06T09:11:47.650" Title="How to simulate 3 correlated stock processes following a GBM?" Tags="&lt;stochastic-processes&gt;&lt;simulations&gt;&lt;log-returns&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27453" PostTypeId="1" CreationDate="2016-06-05T22:40:22.353" Score="1" ViewCount="891" Body="&lt;p&gt;How are rebates factored into the Black-Scholes analytical solutions to pricing barrier options?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Hull's book, he does not have rebates factored into the formulas. Can someone point me to a paper or literature that does this?&lt;/p&gt;&#xA;" OwnerDisplayName="user16556" LastActivityDate="2016-08-05T20:57:37.843" Title="Pricing Barrier Options with Rebates" Tags="&lt;option-pricing&gt;&lt;reference-request&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27454" PostTypeId="1" AcceptedAnswerId="27456" CreationDate="2016-06-05T23:05:32.713" Score="2" ViewCount="124" Body="&lt;p&gt;According to &lt;a href=&quot;http://pages.stern.nyu.edu/%7Edbackus/Disasters/DuffiePanSingleton%20jumps%20Econometrica%2000.PDF&quot; rel=&quot;nofollow noreferrer&quot;&gt;Duffie, Pan and Singleton (2000)&lt;/a&gt; for any real number &lt;span class=&quot;math-container&quot;&gt;$y$&lt;/span&gt; and any &lt;span class=&quot;math-container&quot;&gt;$a$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$b \in \mathbb{R}^n$&lt;/span&gt;, the price of a security that pays &lt;span class=&quot;math-container&quot;&gt;$\exp(aX_t)$&lt;/span&gt; at time &lt;span class=&quot;math-container&quot;&gt;$T$&lt;/span&gt; in the event that &lt;span class=&quot;math-container&quot;&gt;$bX_t \leq y$&lt;/span&gt; is given by:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$G_{a,b}(y;X_{0},T,\chi)=\frac{\psi^{\chi}(a, X_{0}, 0, T)}{2}-\frac{1}{\pi} \int_{0}^{\infty} \frac{\operatorname{Im}\left [ \psi^{\chi} (a + \operatorname{i}vb,X_{0}, 0, T)e^{-ivy} \right ]}{v}dv$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Where:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$X$&lt;/span&gt; is a &lt;span class=&quot;math-container&quot;&gt;$n$&lt;/span&gt;-dimensional Affine Jump Diffusion process;&lt;/li&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$\psi^{\chi}(\cdot)$&lt;/span&gt; is the characteristic function of &lt;span class=&quot;math-container&quot;&gt;$X_T$&lt;/span&gt; conditional on &lt;span class=&quot;math-container&quot;&gt;$X_t=x$&lt;/span&gt;;&lt;/li&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$\operatorname{Im}(\theta)$&lt;/span&gt; determines the imaginary part of &lt;span class=&quot;math-container&quot;&gt;$\theta \in \mathbb{C}$&lt;/span&gt;;&lt;/li&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$v \in \mathbb{R}$&lt;/span&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;As an example they show that the price &lt;span class=&quot;math-container&quot;&gt;$p$&lt;/span&gt; at date &lt;span class=&quot;math-container&quot;&gt;$0$&lt;/span&gt; of a call option with payoff &lt;span class=&quot;math-container&quot;&gt;$[\exp(dX_T)-c]^{+}$&lt;/span&gt; at date &lt;span class=&quot;math-container&quot;&gt;$T$&lt;/span&gt;, for given &lt;span class=&quot;math-container&quot;&gt;$d \in \mathbb{R}$&lt;/span&gt; and&#xA;strike &lt;span class=&quot;math-container&quot;&gt;$c$&lt;/span&gt; is given by:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$p=G_{d,-d}(-\ln c)-cG_{0,-d}(-\ln c)$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;My question is: &lt;strong&gt;how can one identify the parameter &lt;span class=&quot;math-container&quot;&gt;$d$&lt;/span&gt; in practice&lt;/strong&gt;?&lt;/p&gt;&#xA;&lt;p&gt;For example: suppose we are in a Black-Scholes world where the interest rate &lt;span class=&quot;math-container&quot;&gt;$r$&lt;/span&gt; is set to zero. This means that:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\ln S_{T} \sim N \left ( \ln S_t - \frac{1}{2}\sigma^2(T-t), \sigma^2(T-t) \right )$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;If we define the price of the underlying of a call option as &lt;span class=&quot;math-container&quot;&gt;$S_t = \exp(dX_t)$&lt;/span&gt; and we know &lt;span class=&quot;math-container&quot;&gt;$\ln S_t, K, \sigma$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$T-t$&lt;/span&gt;, is it possible to recover the value of &lt;span class=&quot;math-container&quot;&gt;$d$&lt;/span&gt; to price the call option applying the model specified above?&lt;/p&gt;&#xA;" OwnerUserId="13439" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-06-06T07:28:22.707" Title="Find the parameter $d$ of the Affine Option Pricing Model in Duffie, Pan and Singleton (2000)" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;affine-processes&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27455" PostTypeId="2" ParentId="27452" CreationDate="2016-06-06T07:22:55.833" Score="1" Body="&lt;p&gt;You mix up several things:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if you sample from Brownian motion, then &#xA;$$&#xA;B_{t+\Delta t} - B_t  &#xA;$$&#xA;is normally distributed with variance $\Delta t$. Thus if you sample a standard normal $Z$ (with variance 1) then you can use&#xA;$$&#xA;\sqrt{\Delta t} Z&#xA;$$&#xA;as sample for $B_{t+\Delta t} - B_t$ in order to get the correct variance. Recall that constant factors enter variance with the squared value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your question: how do you sample $r$? And if $\Delta t=1$ then it does not matter at all whether you use $\Delta t$ or $\sqrt{\Delta t}$.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-06-06T07:22:55.833" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27456" PostTypeId="2" ParentId="27454" CreationDate="2016-06-06T07:28:22.707" Score="3" Body="&lt;p&gt;$d$ is a vector that collapses the $n$-dimensional vector into a real number. In the BS case $d=1$. There is nothing to be estimated. Also not that in practice affine pricing is done through FFT (and variants) rather than the direct transform you quote. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-06-06T07:28:22.707" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27457" PostTypeId="2" ParentId="27452" CreationDate="2016-06-06T07:33:19.523" Score="1" Body="&lt;p&gt;The log-return of a stock over a period $\Delta t $ starting at $t=0$ is defined as:&#xA;$$ r_{\Delta t} = \ln \left( \frac{S_{\Delta t}}{S_0} \right) $$ &#xA;Thus you should compute $S_{\Delta t}$ as &#xA;$$ S_{\Delta t} = S_0 \exp (  r_{\Delta t} ) $$&#xA;when you are given the $\Delta t $-period log-return i.e. the one which you sample as you propose above. Thus no multiplication by $\Delta t $ or its square root whatsoever.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe your confusion arises from the fact that in the BS equation we traditionally use continuously compounded rates:&#xA;$$  \exp (  r_{\Delta t} ) = \exp \left(  \int_0^{\Delta t} r (t) dt \right) = \exp ( r \Delta t ) $$&#xA;where the last equality holds when $r (t) = r $ a constant, and in which case you should use $\Delta t \approx 1/252$ to compute daily returns if you're using annualised quantities (which is usually the case)&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2016-06-06T07:33:19.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27458" PostTypeId="1" CreationDate="2016-06-06T08:26:45.500" Score="4" ViewCount="467" Body="&lt;p&gt;I am going to get the price of a zero coupon bond in a jump-diffusion model. The dynamic of interest rate as follow&#xA;$$dr_t=\kappa(\theta-r_t)dt+\sigma\sqrt{r_t}\,dW_t+d\left(\sum\limits_{i=1}^{N_t}\,J_i\right)$$&#xA;where $N_t$ represents a Poisson process with constant intensity rate $\lambda&amp;gt;0$ and $\{J_i\}_{i=1}^{\infty}$ denotes the magnitudes&#xA;of jump, which are assumed to be i.i.d. random variables with distribution $f_J$ independent of $W_t$ and $N_t$. Moreover,$W_t$ is assumed to be independent of $N_t$. In addition the jump sizes $\,J_i$ has an exponential distribution with density:&#xA;$${{f}_{J}}(\chi )=\left\{ \begin{matrix}&#xA;   \eta {{e}^{-\eta\,\chi}}\,,\,\,\chi &amp;gt;0\,  \\&#xA;   0\,\,\,\,\,\,\,\,,\,\,\,\,o.w.  \\&#xA;\end{matrix} \right.$$&#xA;where $\eta &amp;gt; 0 $ is an constant. I can prove the arbitrage-free price at time $t$ of a traded interest rate security with paying $H(r)\in\,\mathcal{L^1}(\Omega\,,\,\mathcal{F}_T\,,\,Q)$ and maturity $T$ satisfies the following parabolic partial integro differential equation&#xA;$$\frac{\partial F}{\partial t}+\frac{1}{2}{{\sigma }^{2}}r\frac{{{\partial }^{2}}F}{\partial {{r}^{2}}}+\kappa (\theta -r)\frac{\partial F}{\partial r}-rF+\lambda \int_{-\infty }^{\infty }{(F(t,r+\chi ,T)-F(t,r,T)d\chi =0}$$&#xA;with boundary condition $F(T,r,T)=H(r)$. Obviously in the case of zero-coupon bond we have $$H(r)=P(T,r,T)=1$$ &lt;/p&gt;&#xA;&#xA;&lt;h3&gt;My Challenge&lt;/h3&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;I want to solve this PIDE leading to the bond pricing formula but I have no good idea. &lt;strong&gt;I know&lt;/strong&gt;&#xA;$$F(t,r,T)={{E}}^{\mathbb{Q}}\left[ {{e}^{-\int_{t}^{T}{{{r}_{s}}ds}}}|{\mathcal{F}_{t}} \right]=\exp \left[ A(T,t)-B(t,T){{r}_{t}} \right] \,\,\,\,\,\,(1)$$ &#xA;but I can't extract these deterministic functions. Indeed, I substitute $(1)$ into PIDE. I then have a system of two ordinary differential equations that determine the coefficient functions.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How can I approximate this PIDE by Numerical Methods? &lt;strong&gt;Indeed, I have no other boundary conditions&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user13444" LastEditDate="2016-12-18T07:43:26.860" LastActivityDate="2018-10-26T13:40:07.500" Title="Pricing the discount zero-coupon bond under a jump-diffusion model" Tags="&lt;zero-coupon&gt;&lt;affine-processes&gt;&lt;jump-diffusion&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27459" PostTypeId="2" ParentId="27458" CreationDate="2016-06-06T09:19:13.993" Score="1" Body="&lt;p&gt;If I understood well, your model falls into the generic case of affine models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This reference might help you : &lt;a href=&quot;http://arxiv.org/pdf/1512.03677v1.pdf&quot; rel=&quot;nofollow&quot;&gt;http://arxiv.org/pdf/1512.03677v1.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-06-06T09:19:13.993" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27460" PostTypeId="1" CreationDate="2016-06-06T11:40:47.153" Score="4" ViewCount="112" Body="&lt;p&gt;I'm interested in the areas surrounding Stochastic Volatility Modelling. I've read up on the main models that are prominent in the literature (Hull White, Heston, SABR) but I was wondering what the other issues facing this field are.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Incorporating Stochastic Volatility makes an incomplete model and I've read a few papers on how one may potentially counteract this incompleteness. &#xA;This also leads from the fact that there could be more than one EMM which turns the asset price process into a martingale, so I have also read up on choosing an optimal measure which is closest to the real world measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know about other areas like the two I have mentioned which would be good to read up on to solidify my understanding of Stochastic Volatility?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks! &lt;/p&gt;&#xA;" OwnerUserId="20762" LastActivityDate="2016-06-06T14:29:05.543" Title="Extended Areas on Stochastic Volatility Modelling" Tags="&lt;stochastic-volatility&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27461" PostTypeId="2" ParentId="27453" CreationDate="2016-06-06T11:46:17.550" Score="2" Body="&lt;p&gt;you can write the pay-off as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$(S_T-K)_+ I_{\min S_t &amp;gt; L} + RI_{\min S_t &amp;lt; L}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for down and out call. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first term is the standard call. The second is the rebate. Its value is &#xA;$$&#xA;Re^{-rT} P( \min S_t &amp;lt; L). &#xA;$$&lt;br&gt;&#xA;There is a standard formula for this probability. See eg my book Concepts.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2016-06-06T11:46:17.550" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27462" PostTypeId="1" AcceptedAnswerId="27463" CreationDate="2016-06-06T12:51:58.613" Score="1" ViewCount="137" Body="&lt;p&gt;So I calculated historic volatility/skewness/kurtosis for a commodity. I now would like to construct a volatility smile that reflects this historically realized distribution. I tried using some cornish-fisher like expansions but it has only a limited valid range and it seems in general a bit more complicated than necessary. Any ideas here how to do this?&lt;/p&gt;&#xA;" OwnerUserId="20006" LastActivityDate="2016-06-06T14:09:59.093" Title="construct volatility smile based on historic observations" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;volatility-smile&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27463" PostTypeId="2" ParentId="27462" CreationDate="2016-06-06T14:09:59.093" Score="1" Body="&lt;p&gt;IMHO the simplest way would be to: (1) fit a probability distribution to the $T$-period returns you've historically observed. This can be done by moment-matching the sample variance/skewness/kurtosis statistics you've already computed, or using kernel density estimation (2) compute European option prices by numerically integrating the $T$-period returns pdf (transforming it to prices if it's easier for you) (3) inverting the obtained prices through the BS formula to extract your BS implied volatility smile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Be careful that the information you're using is provided under the real-world measure $\mathbb{P}$ and not in the risk-neutral world $\mathbb{Q}$. So when computing the option prices you should use a stochastic discount factor if you want to be rigorous. See discussions &lt;a href=&quot;https://quant.stackexchange.com/questions/8274/how-to-estimate-real-world-probabilities&quot;&gt;here&lt;/a&gt; for instance.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-06-06T14:09:59.093" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27464" PostTypeId="2" ParentId="27460" CreationDate="2016-06-06T14:29:05.543" Score="3" Body="&lt;p&gt;Great reads to further explore and better understand stochastic volatility models are the series of articles &quot;Smile Dynamics&quot; by Lorenzo Bergomi. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the name indicates the idea is to study stochastic volatility models not only as &quot;smile models&quot; (in the sense that SV models can be used to capture the state of the vanilla market by correctly accounting for implied volatility term structure and skew = static picture) but also as &quot;smile dynamics models&quot; (in the sense that they embed a view on the evolution of that vanilla market).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1493294&quot; rel=&quot;nofollow&quot;&gt;Smile Dynamics I&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1493302&quot; rel=&quot;nofollow&quot;&gt;Smile Dynamics II&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1493308&quot; rel=&quot;nofollow&quot;&gt;Smile Dynamics III&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1520443&quot; rel=&quot;nofollow&quot;&gt;Smile Dynamics IV&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2016-06-06T14:29:05.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27465" PostTypeId="1" CreationDate="2016-06-06T19:29:01.847" Score="1" ViewCount="129" Body="&lt;p&gt;I'm backtesting a strategy that involves &lt;strong&gt;monthly investments&lt;/strong&gt; in a few stocks out of a given set, that is, each month some of the stocks are shortlisted from an index and a long position is taken in them. Each month, the portfolio is equally-weighted in the stocks. The number of trials required for this backtest is $36$ and the backtest period is $84$ months.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now suppose that instead of an equally-weighted portfolio, &lt;strong&gt;each month&lt;/strong&gt; I construct a Markowitz-optimized portfolio instead. So given any month, optimal weightages to be assigned to the shortlisted stocks are determined and the investment is made in a portfolio constructed on the basis of these optimal weightages. Also the number of steps in each Markowitz optimization is $1000$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question: should the number of trials be updated to $36 \times 84 \times 1000$? I'm not clear on this because I tried Googling &quot;markowitz optimization number of trials&quot; and didn't come across any page that discusses treatment of a Markowitz optimization procedure step as a &quot;trial&quot;. Would this be too many trials, and how do I know what's a good upper bound on the number of trials?&lt;/p&gt;&#xA;" OwnerUserId="19057" LastActivityDate="2016-06-06T19:29:01.847" Title="Should the number of Markowitz Optimization steps be counted as backtest trials?" Tags="&lt;backtesting&gt;&lt;portfolio-optimization&gt;&lt;mean-variance&gt;&lt;markowitz&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27466" PostTypeId="1" CreationDate="2016-06-06T20:09:32.230" Score="2" ViewCount="573" Body="&lt;p&gt;So I've managed to backtest simple strategies, like MA, RSI and some fundamental ones (P/E ratios etc) but Im stuck at my last strategy. Here is some information:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Tools:&lt;/strong&gt; Excel and Python (also a little familiar with R)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My strategy is based on 3 momentum factors: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Weekly %net change in mean analyst reccommendations 1-5, where 1 is the best. &lt;/li&gt;&#xA;&lt;li&gt;Weekly %net change in mean analyst NTM EPS estimates, and &lt;/li&gt;&#xA;&lt;li&gt;Weekly % net change in stock price.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Every factor is equally weighted. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My stock Universe is the Nordics (Norway, Sweden, Denmark and Finland) where I filter on 3 month average volume and nr of analysts so that I end up with ~100 stocks as my final stock universe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have 20 years of weekly historical factor data downloaded from my data vendor. The file format is xls(excel). I guess (although not sure with all stocks) I can retrive the OHLC and volume data from Yahoo Finance with Pandas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;So the crude process is sketched out like this:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Lookback period = t-1W&lt;/li&gt;&#xA;&lt;li&gt;Fetch all stocks in universe by reading CSV (Read from Yahoo with Pandas.io.data?)&lt;/li&gt;&#xA;&lt;li&gt;Read the excel file with all the factors for all the stocks (Work with xlwing, xlrdr, Pandas?)   &lt;/li&gt;&#xA;&lt;li&gt;Compute Z-Score for all the factors for all stocks &lt;/li&gt;&#xA;&lt;li&gt;Aggregate the total Z-Score (AZS) for all stocks&lt;/li&gt;&#xA;&lt;li&gt;Eliminate outliers and Winsorize s.t. -3 &gt;= AZS =&amp;lt; 3  &lt;/li&gt;&#xA;&lt;li&gt;BUY top decile and SHORT bottom decile&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;From here I can either&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;8&quot;&gt;&#xA;&lt;li&gt;Equal Weight or,&lt;/li&gt;&#xA;&lt;li&gt;Weight with &lt;strong&gt;Expected Excess Return&lt;/strong&gt;/&lt;strong&gt;Std.dev&lt;/strong&gt; (SR): Where I calculate &lt;strong&gt;Expected Excess Return&lt;/strong&gt; = IC * rank  * vol where IC=0,05 (constant for all stocks), rank=Z-score rank and vol is the past 3 months volatility in %(stored in another excel file). &lt;strong&gt;std.dev&lt;/strong&gt; is the past 3 years realized volatility (I know, the best would be to forecast std.dev with GARCH or similar) &lt;/li&gt;&#xA;&lt;li&gt;At t+1W, repeat step 1-9 and reweight if necessary.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I am a little familiar with the open source backtesters out there: bt, backtester.com, pyalgotrade and zipline. But perhaps my strategy is a bit more complicated to work out with these backtesters? Or can one use fex zipline to backtest this strategy? I don't know.&lt;/p&gt;&#xA;" OwnerUserId="19997" LastEditorDisplayName="user13444" LastEditDate="2016-12-14T07:12:38.983" LastActivityDate="2016-12-14T07:12:38.983" Title="Backtesting Long/Short Market Neutral Z-Score Strategy with Custom Factors and Custom Stock Universe" Tags="&lt;equities&gt;&lt;backtesting&gt;&lt;python&gt;&lt;excel&gt;&lt;longshort&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27468" PostTypeId="1" AcceptedAnswerId="27723" CreationDate="2016-06-07T07:00:09.790" Score="2" ViewCount="170" Body="&lt;p&gt;I am trying to create a model for inflation for trading purposes. In his book &lt;em&gt;The Market: Practice and Policy&lt;/em&gt; S. Nickell presents a model that relates unemployment, inflation and trade deficit. His final formula is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ [ \alpha_1 + \delta_1 \alpha_{12}]u + \alpha_2 \Delta^2 p +&#xA;\alpha_{12} \delta_2 td = [\alpha_1 + \delta_1 \alpha_{12} ] \hat{u}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After he fits this model to data, he finds the coefficients as,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ 0.091 \log u + 0.05 u + 1.07 \Delta^2 p + 1.25 td  =&#xA;0.091 \log \hat{u} + 0.054 \hat{u} - 1.27 \Delta u&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\Delta^2 p$ the rate of change of the price level (ie inflation), $u$ unemployment rate, $td$ trade deficit as proportion of potential output, $\hat{u}$ is natural rate of unemployment. The full derivation can be found at the link below&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://dl.dropboxusercontent.com/u/1570604/tmp/nickell.pdf&quot; rel=&quot;nofollow&quot;&gt;Nickell&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to fit his formula to the data for UK, but cannot figure out how to get $\hat{u}$. Nickell seems to indicate this comes from a seperate calculation, I guess a first-pass on data would calculate $\hat{u}$, then with this new column in hand, I could fit all of the variables shown above. How to compute that first pass? Nickell says $\hat{u}$ can be defined &quot;as that unemployment rate which is consistent with constant inflation and balanced trade&quot; i.e. $\Delta^2p = 0$ and $td=0$. I am not sure what to do with this information: if I set $\Delta^2p = 0$, $td=0$ in the first formula above, I have &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ [ \alpha_1 + \delta_1 \alpha_{12}]u  = [\alpha_1 + \delta_1 \alpha_{12} ] \hat{u}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which make no sense. What should my approach be for this computation? Any help would be greatly appreciated. Data for UK is below.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://dl.dropboxusercontent.com/u/1570604/tmp/uk.csv&quot; rel=&quot;nofollow&quot;&gt;Data&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="616" LastEditorUserId="3297" LastEditDate="2016-06-13T15:17:49.897" LastActivityDate="2016-07-05T11:32:12.950" Title="Trading with Inflation, Unemployment, Trade Deficit Information" Tags="&lt;macro-economics&gt;&lt;inflation&gt;&lt;trade&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27469" PostTypeId="2" ParentId="26433" CreationDate="2016-06-07T07:09:06.527" Score="4" Body="&lt;p&gt;&lt;strong&gt;Thanks to @Phun and @oliversm I solved the problem. So I'm posting here the solution in case someone will need it.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Under Black-Scholes assets dynamics are determined by a Geometric Brownian Motion, and we can define the price of a security at time $t+\Delta t$ as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S_{t+\Delta t}=S_{t}\exp\left(\left(r-\frac{1}{2}\sigma^{2}\right)\Delta t+\sigma\sqrt{\Delta t}\varepsilon\right)\qquad\varepsilon\sim N(0,1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;defining $T=t+\Delta t$ and substituting above leads to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S_{T}=S_{t}\exp\left(\left(r-\frac{1}{2}\sigma^{2}\right)\left(T-t\right)+\sigma\sqrt{T-t}\varepsilon\right)\qquad\varepsilon\sim N(0,1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, &lt;strong&gt;under risk neutral probability pricing the drift term $\mu$ can be replaced with the interest rate, and setting $r=0$&lt;/strong&gt; leads to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S_{T}=S_{t}\exp\left(-\frac{1}{2}\sigma^{2}\left(T-t\right)+\sigma\sqrt{T-t}\varepsilon\right)\qquad\varepsilon\sim N(0,1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following the procedure illustrated &lt;a href=&quot;https://quant.stackexchange.com/questions/7811/in-black-scholes-why-is-log-fracs-t-triangle-ts-t-sim-phi-mu&quot;&gt;here&lt;/a&gt;, it is easy to show that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{S_{T}}{S_{t}}\sim\ln N\left(-\frac{1}{2}\sigma^{2}\left(T-t\right),\sigma^{2}\left(T-t\right)\right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or equivalently:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\ln S_{T}\sim N\left(-\frac{1}{2}\sigma^{2}\left(T-t\right),\sigma^{2}\left(T-t\right)\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At this point let's define $S = \ln (S_T / S_t) = \ln(S_T) - \ln(S_t)$. $S_t$ is known at time $t$, so we can add $\ln S_t$ to $S$. $S+\ln S_t$ will be normally distributed with mean:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\ln S_t-\frac{1}{2}\sigma^{2}\left(T-t\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and variance:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma^{2}\left(T-t\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S+\ln S_{t}\sim N\left(\ln S_{t}-\frac{1}{2}\sigma^{2}\left(T-t\right),\sigma^{2}\left(T-t\right)\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But since $S+\ln(S_t)=\ln(S_T)$ it follows that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\ln S_{T}\sim N\left(\ln S_{t}-\frac{1}{2}\sigma^{2}\left(T-t\right),\sigma^{2}\left(T-t\right)\right)$$&lt;/p&gt;&#xA;" OwnerUserId="13439" LastEditorUserId="13439" LastEditDate="2016-06-07T12:30:54.857" LastActivityDate="2016-06-07T12:30:54.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27470" PostTypeId="1" CreationDate="2016-06-07T11:56:08.007" Score="1" ViewCount="195" Body="&lt;p&gt;Imagine a model with stock prices and dividends of these stocks, as well as a market bond with associated short rate process. It is known that this model is arbitrage-free if there exists an equivalent martingale measure $Q$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is then asserted that the price of a call option at time $t$ is the discounted conditional expectation under the equivalent martingale measure $Q$ of its payoff. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; Why is this true? The way I think about it is that if we imagined that the call option is a new stock which we introduce to the market, then we can consider it as a stock with no dividends up until expiration date where the final dividend is then its payoff. If we imagine &quot;adding&quot; this stock to our model, then it would remain arbitrage-free if and only if this &quot;new stock&quot; was priced so that $Q$ remains an equivalent martingale measure, and this precisely meanas that the call option price at time $t$ needs to be given as that conditional expectation (discounted).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this reasoning correct? &lt;/p&gt;&#xA;" OwnerUserId="22046" LastEditorDisplayName="user16651" LastEditDate="2016-06-07T12:39:22.970" LastActivityDate="2016-06-07T14:04:56.903" Title="Option pricing, origin of formula $\Pi( t,X)= E^{\mathbb{Q}}\left[e^{-\int_{t}^{T}r_s\,ds} X| \mathcal{F}_t\right]$" Tags="&lt;options&gt;&lt;option-pricing&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27471" PostTypeId="2" ParentId="27470" CreationDate="2016-06-07T13:07:36.693" Score="2" Body="&lt;p&gt;Generally we consider this issue for every $T$-claim contingent $\Pi(t,X)$. However,&#xA;there are two main approach in this context. As you mentioned, for first approach we should demand that the extended market $\Pi(.,X)\,,\,S_0\,,S_1,...,S_N$  is free of arbitrage possibilities. Indeed we demand that there should exist a martingale measure $Q$ for the extended market. Applying the definition of a martingale measure we obtain&#xA;$$\frac{\Pi(t,X)}{S_0(t)}=E^{\mathbb{Q}}\left[\frac{\Pi(T,X)}{S_0(T)}|\,\mathcal{F}_t\right]$$&#xA;In particular  we assume that $S_0(t)$ is the money account:&#xA;$$S_0(t)=S_0(0)=\exp\left(\int_{t}^{T}r_sds\right)$$&#xA;For second approach, if the claim is attainable, with hedging portfolio $h$, then the only reasonable price is given by $\Pi(t,X) = V (t, h)$.  &lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastActivityDate="2016-06-07T13:07:36.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27472" PostTypeId="2" ParentId="27470" CreationDate="2016-06-07T14:04:56.903" Score="2" Body="&lt;p&gt;It's only true if the claim can be replicated by dynamically hedging with the tradeable assets. So any proof should certainly refer to that property.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My proof would be:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;There is a dynamic portfolio that replicates the claim, i.e. which is self-financing, pre-visible, and has terminal value equal to the value of the call option&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The value of any portfolio, with any trading strategy that doesn't involve peeking into the future, is a (discounted) martingale under Q&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The present value of the dynamic portfolio is the expected value of the final value which is the expected value of the call payoff under the martingale measure&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The theoretical value of the call option is the cost of setting up a perfect hedge, which is the initial value of the replicating portfolio&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="20681" LastActivityDate="2016-06-07T14:04:56.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27473" PostTypeId="2" ParentId="27450" CreationDate="2016-06-07T14:05:41.820" Score="0" Body="&lt;p&gt;you forgot the parameter port:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;con = ibConnection(port=7497, clientId=100)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;works for me&lt;/p&gt;&#xA;" OwnerUserId="18675" LastActivityDate="2016-06-07T14:05:41.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27474" PostTypeId="2" ParentId="26421" CreationDate="2016-06-07T14:15:26.187" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;If we are talking about zero rates, then any curve is arbitrage free.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;No.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Yes. Although in general arbitrage and incompleteness are in different directions (not enough tradeable instruments --&gt; incomplete, too many traceable instruments --&gt; potential arbitrage), it's of course possible for a model to be incomplete in one place and arbitrageable in another.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="20681" LastActivityDate="2016-06-07T14:15:26.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27475" PostTypeId="2" ParentId="21625" CreationDate="2016-06-07T14:58:57.963" Score="1" Body="&lt;p&gt;In my opinion previous answers are a bit off goal. The CAPM is, at least in your primarily role, an equilibrium model. Is shared opinion that the investors are &quot;risk adverse&quot;and, as a consequence, the risk premium $R_m - R_f$ cannot be negative, but strictly positive. If your target is estimate the risk premium you are not constrained to use the data in backward looking manner. Even better you are not constrained to use the historical data at all. Historical mean is only the easiest way that many books show. You must have forward looking perspective. If in equilibrium (long term) the common opinion became for indefinitely down trend ... stock market is end.&#xA;Nevertheless if you don't care for equilibrium ... $R_m - R_f&amp;lt;0$ is not a problem. In Mean Variance and related CAPM framework the &quot;best results&quot; will be long position in risk free asset and, eventually, short position in risky.&lt;/p&gt;&#xA;" OwnerUserId="20746" LastActivityDate="2016-06-07T14:58:57.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27476" PostTypeId="1" AcceptedAnswerId="27482" CreationDate="2016-06-07T15:18:57.833" Score="3" ViewCount="1229" Body="&lt;p&gt;Say, for example, I'm looking at the Vanguard Information Technology ETF (VGT)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I have the current market price for each of its holdings, and related information&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+--------+--------+--------------+--------+&#xA;| Symbol | Price  | Position     | Weight |&#xA;+--------+--------+--------------+--------+&#xA;| ACN    | 119.60 | 1,220,132.04 | 1.71   |&#xA;| ACIW   |  21.34 |   231,143.64 | 0.06   |&#xA;| ATVI   |  37.76 |   998,647.00 | 0.44   |&#xA;| ACTA   |   9.95 |    72,952.03 | 0.01   |&#xA;| ACXM   |  21.94 |   152,341.53 | 0.04   |&#xA;| ADBE   |  99.12 |   973,663.76 | 1.13   |&#xA;| ...    |    ... |          ... |  ...   |&#xA;| ZEN    |  26.37 |    95,518.00 | 0.03   |&#xA;| ZG     |  30.78 |    99,210.18 | 0.04   |&#xA;| Z      |  30.33 |   197,191.22 | 0.07   |&#xA;| ZNGA   |   2.64 | 1,559,901.29 | 0.05   |&#xA;+--------+--------+--------------+--------+&#xA;&#xA;Total market value: 8,536,310,523&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I go from all the constituents, their position and price etc, and come up with the fair value for the ETF?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, the ETF was trading at 110.31 at the time I got the above prices. &lt;/p&gt;&#xA;" OwnerUserId="3184" LastActivityDate="2016-06-07T19:28:07.243" Title="How can I calculate the fair value of an ETF using the current price of each of its holdings?" Tags="&lt;etf&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27477" PostTypeId="2" ParentId="27476" CreationDate="2016-06-07T15:43:27.180" Score="4" Body="&lt;p&gt;The fair price can be calculated by &lt;strong&gt;[Net Assets / Shares Outstanding]&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In reality the ETF should trade at a slight premium to this calculation due to the convenience of having many assets bundled in one, thus reducing your brokerage expenses in the form of transaction fees to construct a similar portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From this link: (&lt;a href=&quot;https://advisors.vanguard.com/VGApp/iip/site/advisor/investments/productoverview?fundId=0958&quot; rel=&quot;nofollow&quot;&gt;https://advisors.vanguard.com/VGApp/iip/site/advisor/investments/productoverview?fundId=0958&lt;/a&gt;).... we can see there are approximately ~77,930,743 outstanding shares of VGT on net assets of ~$8.2B.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;8,200,000,000 / 77,930,743 = $105.22 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;right now VGT is trading at $110.40, so about a 4.92% premium on the &quot;fair value&quot; of 105.22&lt;/p&gt;&#xA;" OwnerUserId="22051" LastEditorUserId="22051" LastEditDate="2016-06-07T15:48:57.550" LastActivityDate="2016-06-07T15:48:57.550" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27478" PostTypeId="1" AcceptedAnswerId="27541" CreationDate="2016-06-07T16:55:50.757" Score="0" ViewCount="529" Body="&lt;p&gt;When regressing a variable on a constant of 1, the coefficient of this constant is the mean. However, when I specified that the residuals follow a GARCH(1,1) model, the coefficient of the constant does not anymore represent the mean in my model. In my opinion this makes no sense since the residuals are defined to have a mean of zero. The mu in the example below should be the same as the mean of R_d.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Small Example in R:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(rugarch)&#xA;library(quantmod)&#xA;getSymbols('C', from = '2000-01-01')&#xA;C = adjustOHLC(C, use.Adjusted = TRUE)&#xA;R_d = ROC(Cl(C), na.pad = FALSE)&#xA;mean(R_d)&#xA;-0.000436420257283668&#xA;&#xA;spec = ugarchspec(mean.model = list(armaOrder = c(0, 0)), variance.model = list(model = 'sGARCH', garchOrder = c(1, 1)), distribution = 'norm')&#xA;fit = ugarchfit(data = R_d, spec = spec)&#xA;coef(fit)&#xA;&#xA;mu: 0.000430648533256351&#xA;omega: 2.11481883824743e-06&#xA;alpha1: 0.0871525584932368&#xA;beta1: 0.911847414938857&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For egarch or gjr, I get also different results for mu..&lt;/p&gt;&#xA;" OwnerUserId="20975" LastActivityDate="2016-06-10T08:27:45.943" Title="GARCH Model Constant in Regression" Tags="&lt;volatility&gt;&lt;r&gt;&lt;garch&gt;&lt;variance&gt;&lt;mean&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27479" PostTypeId="1" AcceptedAnswerId="27487" CreationDate="2016-06-07T17:02:04.693" Score="10" ViewCount="942" Body="&lt;p&gt;I'm implementing a bunch of different algorithms to price options/find Greeks: finite difference, Monte Carlo, binomial...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not really sure how to check my calculations. I tried using QuantLib to price things for me, but it seems to use actual dates a lot (whereas I'm just interested in year fractions) and the documentation is lacking.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I implemented a finite difference algorithm as described in Wilmott's &quot;Mathematics of Financial Derivatives&quot; and he has some numbers in his book. But my &quot;implementation&quot; of just the analytical Black-Scholes formula already gives different results than his (not by much though).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Again, I just typed up the down and out call option formula from Zhang's Exotic options. He actually goes through explicit examples for each of his formulas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But for a down and out call with $S = 100$, $K= 92$, $H = 95$, $r = 0.08$, $q = 0.03$, $\sigma = 0.2$, $\tau = 0.5$ he gets \$6.936 and I get \$6.908.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question is, what is your go to reference for option prices for checking your code?&lt;/p&gt;&#xA;" OwnerDisplayName="user16469" LastActivityDate="2017-09-29T11:33:25.817" Title="How do you check your option calculations?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;reference-request&gt;&lt;quantlib&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27480" PostTypeId="1" CreationDate="2016-06-07T17:15:57.423" Score="1" ViewCount="64" Body="&lt;p&gt;I have two monthly time series : one is a 'signal', on which I will base my decision to buy or short-sell, and the second one is the time serie of a given asset's price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have implemented this extremely naive algorithm : if the signal at time t is positive, buy at t-1, sell at t, if it is negative, short at t-1, buy at t.&#xA;Testing several (signal, asset) pairs, I find that for some of them I make significant cumulative profit over the years, and for some other, I don't. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I want to explain why this works for some pairs and not for others (or, instead of causality, find a criteria or a quantity that would be characteristic of &quot;good pairs&quot;). Purely investment-wise, it might (but not more than &quot;might&quot;) be enough, but I can't be satisfied with it, and it's not rigorous.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far, I have (with Python/pandas):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;computed the correlation (Spearman, Kendall and Pearson) between the signal time serie and the asset price / returns, but the results are low for the good pairs&lt;/li&gt;&#xA;&lt;li&gt;tried to perform a linear regression the returns against the signal, but the  $\beta$ are insignificants and $R^{2}$ very low, which points (as far as I understand) to at least no linear relationship between the two time series&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I would like to know what other leads to explore (I gladly accept books/articles references as well, if this is an extensively discussed question !)&lt;/p&gt;&#xA;" OwnerUserId="19457" LastActivityDate="2016-06-07T19:10:08.120" Title="Account for empirical relationship between signal and market data" Tags="&lt;time-series&gt;&lt;quant-trading-strategies&gt;&lt;correlation&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27482" PostTypeId="2" ParentId="27476" CreationDate="2016-06-07T19:28:07.243" Score="2" Body="&lt;p&gt;I believe the most precise method is to look at the Creation Units.  See the Portfolio Composition File here:&#xA;&lt;a href=&quot;https://advisors.vanguard.com/VGApp/iip/site/advisor/investments/portfoliodetails?fundId=0958&quot; rel=&quot;nofollow&quot;&gt;https://advisors.vanguard.com/VGApp/iip/site/advisor/investments/portfoliodetails?fundId=0958&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This gives you the shares of each stock required to make one Creation Unit = 25,000 shares of the ETF (see prospectus).  But I'd also use the NAV method given in the other answers as a &quot;sanity check.&quot;&lt;/p&gt;&#xA;" OwnerUserId="22056" LastActivityDate="2016-06-07T19:28:07.243" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27483" PostTypeId="1" CreationDate="2016-06-07T21:51:32.393" Score="1" ViewCount="778" Body="&lt;p&gt;I have taken probability theory course in college and want to see how it is used practically in finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What papers should I read? I want it to be not too difficult (undergraduate probability theory course level would be great)&lt;/p&gt;&#xA;" OwnerUserId="19237" LastActivityDate="2016-06-08T05:53:01.803" Title="Paper on the use of probability theory in finance?" Tags="&lt;probability&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27484" PostTypeId="1" CreationDate="2016-06-07T23:02:01.327" Score="3" ViewCount="978" Body="&lt;p&gt;I'm reading about this approach of using GARCH-EVT-copula methodology to separate univariate and joint estimation and then estimate for example VaR and ES. I wanted to try something similar, but my attempt failed miserably. Anyone of you sees a mistake in the methodology outlined below? Any hint is appreciated!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I took a few series, computed log returns, and multiplied them by -1 (so that I have losses on the right and returns on the left). Then I used this approach:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;1) ARMA-GARCH fitting according to AIC (using the &lt;code&gt;rugarch&lt;/code&gt; package);&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;2) obtain standardized residuals $z_t = \frac{\epsilon_t}{\sigma_t}$;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;3) semi-parametric modeling of $z_t$ using a generalized Pareto&#xA;  distribution for upper and lower tails (thresholds at 10% and 90%) and&#xA;  Gaussian kernel for the interior part (using the &lt;code&gt;spd&lt;/code&gt; package);&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;4) transformation in uniform margins using the &lt;code&gt;pspd&lt;/code&gt; command from the&#xA;  previous package;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;5) copula fitting using an Archimedean copula model via maximum&#xA;  likelihood (since ML could not be evaluated in all points, I&#xA;  transformed the uniform margins in pseudo-observations using the&#xA;  &lt;code&gt;pobs&lt;/code&gt; command before fitting); &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;6) since I want a time-varying copula approach, I use a moving window&#xA;  of 1000 observations to estimate a time-varying Archimedean copula&#xA;  parameter, and fit an ARIMA in order to do forecasting; &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;7) given predicted copula parameters (thanks to previous ARIMA&#xA;  specification), N copula realizations are simulated from day $t+1$ to&#xA;  $T$;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;8) using the &lt;code&gt;qspd&lt;/code&gt; command, I transform copula realizations back in&#xA;  standardized residuals $z_{t}$;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;9) I insert estimated $z_t$ back in ARMA-GARCH specification, compute&#xA;  log returns,  transform in simple returns, and calculate return of&#xA;  equally weighted portfolio;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;10) now I have N returns for each day, and can compute required VaR as&#xA;  the $\alpha$-quantile (90, 95, 97.5, 99, ...). &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now the staggering surprise: this methodology failed miserably for me for relatively moderate quantiles (90, 95 and 97.5) and more extreme quantiles (99, 99.5, 99.9). I obtain a number of violations which is WAY more than expected.&#xA;Any reason why? Is there a mistake in the steps mentioned? &lt;/p&gt;&#xA;" OwnerUserId="20573" LastActivityDate="2016-06-07T23:02:01.327" Title="'GARCH - extreme value theory - copula' approach to estimate risk measures in R" Tags="&lt;time-series&gt;&lt;backtesting&gt;&lt;garch&gt;&lt;var&gt;&lt;copula&gt;" AnswerCount="0" CommentCount="6" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27485" PostTypeId="2" ParentId="27479" CreationDate="2016-06-07T23:49:28.273" Score="2" Body="&lt;p&gt;two things I would try...and this is really off the top of my head... &#xA;is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1). to use put-call parity to check that your work makes financial sense.&#xA;Call = Spot + Put - (strike price)/(1+risk_free_rate)^Time&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2). see if you can recreate anything close to present/past market (Yahoo finance?) data prices, i.e. testing your model against reality. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;good luck&lt;/p&gt;&#xA;" OwnerUserId="5821" LastActivityDate="2016-06-07T23:49:28.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27487" PostTypeId="2" ParentId="27479" CreationDate="2016-06-08T00:38:05.710" Score="6" Body="&lt;p&gt;1: Follow the calculations in &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0071389970&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Complete Guide to Option Pricing Formulas&lt;/a&gt;. The book has many formulas, sample values and outputs. Highly recommended for validating your results. Apparently, this is one of most popular books used by real-world quants (simple and fast).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2: You can still use QuantLib to price with year fractions. I have an example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;DayCounter dc = Actual360();&#xA;Date today = Date::todaysDate();&#xA;Date exerciseDate = today + 90;    &#xA;assert(dc.yearFraction(today, exerciseDate) == 0.25);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here, we make the exercise date exactly 0.25 year fraction away from today (pricing date). Anything from QuantLib using the dates should match your own implementation. You can adjust the exerciseDate, print the yearFraction and use it in your own code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3: Use &lt;code&gt;fOptions&lt;/code&gt;. fOptions and it's related &lt;code&gt;fExoticOptions&lt;/code&gt; are R-packages. They implement the most commonly quantitative finance models. For example, I use the following script to validate my Levy Asian options:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;LevyAsianApproxOption(TypeFlag='c', S=6.80, X=6.90, SA=6.80, r=0.07, b=-0.02, sigma=0.14, Time=0.50, time=0.50)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4: Use &lt;code&gt;OptionMatrix&lt;/code&gt;. OptionMatirx is a finance calculator runs on a desktop computer. &lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="601" LastEditDate="2017-06-12T14:28:34.523" LastActivityDate="2017-06-12T14:28:34.523" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27489" PostTypeId="2" ParentId="26134" CreationDate="2016-06-08T03:17:31.873" Score="2" Body="&lt;p&gt;There are many resources on the web but you need to think why you would want to do this in the first place. Are there not packages or frameworks out there already that will do what you need?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also backtesting or any financial trading platform will be suited to a specific style or method of backtesting. Some are vectorised iterative processes (e.g. just a big for loop with some whistles added on) and others are reactive CEP based solutions (they rely on events coming in from a data feed then reacting to these in some ways) so unless you have a specific style of trading the former will work for most people.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.quantstart.com&quot; rel=&quot;nofollow&quot;&gt;http://www.quantstart.com&lt;/a&gt; has interesting articles on back testing and there are plenty others. Rob Carvers site is quite informative also: &lt;a href=&quot;http://qoppac.blogspot.com/&quot; rel=&quot;nofollow&quot;&gt;http://qoppac.blogspot.com/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2991" LastActivityDate="2016-06-08T03:17:31.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27490" PostTypeId="2" ParentId="27483" CreationDate="2016-06-08T05:53:01.803" Score="1" Body="&lt;p&gt;$\,\,\,$Generally, Finance involve some degree of uncertainty, so we need to use probabilistic reasoning in order to make a sound decision. Nowadays, we need to apply modern probability in each part of finance and this issue is too widespread.However, I introduce some useful articles and books:  &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.ams.org/notices/200411/fea-applebaum.pdf&quot; rel=&quot;nofollow&quot;&gt;Levy processes: From probability to finance and quantum groups&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.springer.com/us/book/9780817641665&quot; rel=&quot;nofollow&quot;&gt;The Laplace Distribution and Generalizations: A Revisit with Applications to Communications, Economics, Engineering, and Finance&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/j.1540-6261.1996.tb05219.x/full&quot; rel=&quot;nofollow&quot;&gt;Recovering Probability Distributions from Option Prices&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S0378437105012069&quot; rel=&quot;nofollow&quot;&gt;The application of continuous-time random walks in finance and economics&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.jstor.org/stable/3215371?seq=1#page_scan_tab_contents&quot; rel=&quot;nofollow&quot;&gt;Large Deviations of Heavy-Tailed Random Sums with Applications in Insurance and Finance&lt;/a&gt; &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://link.springer.com/chapter/10.1007/978-94-010-1842-5_8&quot; rel=&quot;nofollow&quot;&gt;Stable Distributions: Probability, Inference, and Applications in Finance:A Survey, and a Review of Recent Results&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerDisplayName="user16651" LastActivityDate="2016-06-08T05:53:01.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27491" PostTypeId="1" AcceptedAnswerId="27816" CreationDate="2016-06-08T09:29:59.383" Score="2" ViewCount="3084" Body="&lt;p&gt;I'm currently playing around with the great rugarch package in R. However, I tried to test the external regressor functionality. I implemented a GARCH(1,1) process and compared it with a GARCH(0,1) process where I added the lagged squared returns as external regressor. The results should be the same but aren't. Does anyone of you know where my mistake is? Thank you very much in advance for your help.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(rugarch)&#xA;library(quantmod)&#xA;getSymbols('C', from = '2000-01-01')&#xA;C = adjustOHLC(C, use.Adjusted = TRUE)&#xA;R_d = ROC(Cl(C), na.pad = FALSE)&#xA;&#xA;extReg = R_d[1:length(R_d)-1]^2&#xA;spec = ugarchspec(mean.model = list(armaOrder = c(0, 0),include.mean = FALSE), variance.model = list(model = 'sGARCH', garchOrder = c(1, 1)), distribution = 'norm')&#xA;spec2 = ugarchspec(mean.model = list(armaOrder = c(0, 0),include.mean = FALSE), variance.model = list(model = 'sGARCH', garchOrder = c(0, 1),external.regressors=extReg), distribution = 'norm')&#xA;&#xA;fit = ugarchfit(data = R_d[2:length(R_d),1], spec = spec)&#xA;fit2 = ugarchfit(data = R_d[2:length(R_d),1], spec = spec2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The coefficients of the fit model are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;omega: 2.1038530309075e-06&#xA;alpha1: 0.0863073049030114&#xA;beta1: 0.912692551076183&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The coefficients of the fit2 model are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;omega: 8.17097079205033e-07&#xA;beta1: 0.999316873189476&#xA;vxreg1: 1.01005006640392e-08&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="20975" LastActivityDate="2016-07-27T15:40:12.737" Title="rugarch: GARCH external regressors" Tags="&lt;volatility&gt;&lt;r&gt;&lt;garch&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27492" PostTypeId="2" ParentId="26410" CreationDate="2016-06-08T09:43:14.113" Score="3" Body="&lt;p&gt;If you owe money to the bank, you will not receive a compensation.&lt;/p&gt;&#xA;&lt;p&gt;It might not exactly correspond to what you want, but here is my understanding.&lt;/p&gt;&#xA;&lt;p&gt;If we refer to the origin of the rates formation, you see two rates.&lt;/p&gt;&#xA;&lt;p&gt;e.g : &lt;a href=&quot;https://www.ecb.europa.eu/mopo/implement/sf/html/index.en.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.ecb.europa.eu/mopo/implement/sf/html/index.en.html&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h3&gt;the marginal lending rate&lt;/h3&gt;&#xA;&lt;p&gt;this one cannot be negative, ECB will not pay a bank which is out of cash.&lt;/p&gt;&#xA;&lt;h3&gt;the deposit facility rate&lt;/h3&gt;&#xA;&lt;p&gt;this one can be negative, it means that if a bank A doesnot want to invest in any other assets and prefer keeps money on their central bank account,&lt;/p&gt;&#xA;&lt;p&gt;sometimes bank A will prefer to pay a fee rather than invest in some liquidity because of cash needs.&lt;/p&gt;&#xA;&lt;h3&gt;a bank won't pay you if your bank account is negative because it misses an opportunity&lt;/h3&gt;&#xA;&lt;p&gt;if you have &lt;span class=&quot;math-container&quot;&gt;$-100$&lt;/span&gt;€ on your bank A account, then the bank A is missing &lt;span class=&quot;math-container&quot;&gt;$100$&lt;/span&gt;€ on its balance sheet and must borrow money from the central bank, it will apply you the marginal lending rate (+fee),&lt;/p&gt;&#xA;&lt;p&gt;of course, you can pretend that you offer a service to the bank by reducing its extra cash that bank must deposit (at a cost) to the central bank, but remember that bank A would prefer to invest extracash in other assets.&lt;/p&gt;&#xA;&lt;p&gt;My understanding is that negative rates are a way to penalize cash not invested in assets.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-06-10T14:02:58.507" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27493" PostTypeId="1" CreationDate="2016-06-08T10:11:32.257" Score="2" ViewCount="132" Body="&lt;p&gt;I am very new to this field, and have very recently started doing some self study on this topic. After reading some papers and reproducing some of the results in them, I am not very clear about what objective exactly is fulfilled by doing portfolio optimization. I assume that having a minimum variance portfolio is of interest or relevance for investors because it tells them objectively which stocks to buy and which ones to sell, is it not? If that is not the case, then could you please explain why would an optimized portfolio be of interest to investors?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, if we say that investors should invest in stocks according to the optimized portfolio weights, does it mean that investors should invest in all the stocks anyway – and this method just gives the proportion of each to be invested in? If yes, it is a bit confusing, because in real life, although I myself have not traded, I assume that an investor would typically buy or sell only a small subset of stocks at any given time. Is this not true? So, the more meaningful problem to solve would be, in my mind, to find out which stocks to buy or/and sell at any given time, based on the studied stock returns, is it not?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;: For example, we can use www.portfoliovisualizer.com to check which assets to invest in (according to whatever theory they are using):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/AHRRE.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/AHRRE.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The algorithm is not giving as output a portfolio of all the investments that the investor initially had. It is giving a subset of them (I assume the ones most likely to make profit). But portfolio management theory doesn't seem to talk about subsets of assets. Which one is correct, or better?&lt;/p&gt;&#xA;" OwnerUserId="20879" LastEditorUserId="20879" LastEditDate="2016-06-08T16:02:25.053" LastActivityDate="2016-06-09T12:49:40.877" Title="What does an optimized portfolio really tell us?" Tags="&lt;portfolio-management&gt;&lt;quant-trading-strategies&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio&gt;&lt;portfolio-optimization&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27495" PostTypeId="2" ParentId="27479" CreationDate="2016-06-08T10:19:38.683" Score="2" Body="&lt;p&gt;I would tend to do the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If, under your working modelling assumptions, there exist &lt;strong&gt;closed form formulas&lt;/strong&gt;, then compare your results to them. &quot;The Complete Guide to Option Pricing Formulas&quot; in @Student T is indeed a nice reference for that. Beware of true formulas vs. approximations though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if it's not the case:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Compare &lt;strong&gt;different pricers' implementations versus each other&lt;/strong&gt;: e.g. Monte-Carlo vs Finite Difference. Usually the Monte-Carlo pricer is easier to develop (except for complex diffusion models requiring custom stepping schemes), so just push the number of simulations to the limits to obtain a &quot;good&quot; reference (again this assumes a reasonable discretisation bias).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use your &lt;strong&gt;common sense and experience&lt;/strong&gt;: detect if there is something inherently wrong with what you're doing, of if you're not accounting for a particular aspect of the product you're pricing. In the particular case of continuously-monitored barrier you should bear in mind that, because you discretise time, you'll always miss the probability that the barrier activates/de-activates between 2 time steps, which can bias your results. You can use Brownian interpolation to improve your results.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use universal truths (&lt;strong&gt;no-arbitrage arguments&lt;/strong&gt;) : e.g. &lt;em&gt;call-put parity&lt;/em&gt; as mentioned in @Sason Torosean answer, but also &lt;em&gt;in-out parity&lt;/em&gt; for barrier options for example ($V = V_{in} + V_{out}$), or an Asian option with &lt;em&gt;past fixings&lt;/em&gt; can be seen as a new asian option starting today and re-struck at a modified strike etc.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Validate incrementally by testing your pricer on degenerate situations&lt;/strong&gt; where you know the price you should get: e.g. no rates nor dividends, knock-out barrier $H=S_0$ etc. Move to more and more complex situations.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I would be very careful when comparing with third party implementations! For Black-Scholes why not, but as soon as you implement complex models, the tiniest difference in the assumptions can have an enormous impact on the results. So you're always better off validating what you did. That being said, you are rarely the first one to test a model/pricer, so it is highly likely that there exists a decent paper out there with some useful results you can refer to (but be careful!).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2017-09-29T11:33:25.817" LastActivityDate="2017-09-29T11:33:25.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27496" PostTypeId="1" CreationDate="2016-06-08T10:44:39.913" Score="4" ViewCount="1190" Body="&lt;p&gt;I am creating and testing strategies in R code and using systemic investor toolbox(SIT) package as the backtesting tool. I copied a SIT backtesting code from a website and made small changes to make below code and its working fine.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#backtesing long Apple&#xA;#long when fast MA is greater than slow MA and rsi less than 50 else exit&#xA;library(quantmod)&#xA;library(SIT)&#xA;data &amp;lt;- new.env()&#xA;&#xA;# Load historical data and adjusts for splits and dividends&#xA;tickers = spl('AAPL')&#xA;getSymbols(tickers, src = 'yahoo', from = '2000-01-01', env = data, auto.assign = T)    &#xA;for(i in ls(data)) data[[i]] = adjustOHLC(data[[i]], use.Adjusted=T)  &#xA;&#xA;#Calculate the moving averages and lag them one day to prevent lookback bias&#xA;close&amp;lt;-Cl(data[['AAPL']])&#xA;MAF &amp;lt;- lag(SMA(close,50))  &#xA;MAC &amp;lt;- lag(SMA(close,100))&#xA;rsi&amp;lt;- RSI(close,25)&#xA;&#xA;#Sets backtesting environment&#xA;bt.prep(data, align='remove.na') &#xA;prices = data$prices   &#xA;&#xA;#Create a empty list for attaching the models to at a later stage&#xA;models = list()&#xA;&#xA;#Specify the weights to be used in the backtest&#xA;data$weight[] = NA #Zero out any weights from previous&#xA;data$weight[] = ifelse(MAF&amp;gt;MAC&amp;amp;rsi&amp;lt;50,1,0)  #If price of SPY is above the SMA then buy&#xA;&#xA;#Call the function to run the backtest given the data, which contains the prices and weights.&#xA;models$technical_model = bt.run.share(data, trade.summary=T)&#xA;&#xA;#Plot equity curve and export the trades list to csv&#xA;plot(models$technical_model$equity, main=&quot;Equity Curve&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Currently to check the quality of my strategy; I backtest using above code against 10 randomly handpicked stocks and indexs in my portfolio  (AAPL,GOOG, GE,GS,PFE,AA,SPY,^GSPC,XOM,C) and then manually take averages of the results(eg drawdown, sharpe, profit factor etc) to check the strategy viability. But doing this takes lots of my time and energy . How can I backtest my strategy against my whole protofolio instead of one by one in SIT to get a best estimate of my strategy. What kind of modifications should I do to the above code?&lt;/p&gt;&#xA;" OwnerUserId="16754" LastActivityDate="2019-12-28T14:02:05.287" Title="How to backtest strategy in portfolio of stocks using SIT R?" Tags="&lt;r&gt;&lt;backtesting&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27500" PostTypeId="2" ParentId="25579" CreationDate="2016-06-08T13:01:12.967" Score="-2" Body="&lt;p&gt;You can use =BHP(....,) to download the historical data from Bloomberg...to download the latest data you can use BDP instead of BHP.&lt;/p&gt;&#xA;" OwnerUserId="20303" LastActivityDate="2016-06-08T13:01:12.967" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27501" PostTypeId="2" ParentId="22819" CreationDate="2016-06-08T13:30:25.463" Score="7" Body="&lt;p&gt;Better than Markit, you can have a look at &lt;a href=&quot;https://www.datagrapple.com/&quot; rel=&quot;noreferrer&quot;&gt;https://www.datagrapple.com/&lt;/a&gt; (subscription is free). About 1000 CDS are covered. Daily end-of-day prices (mid of a best bid/offer order book) from Jan 2006 and continues on an ongoing basis.&#xA;There are the charts you want starting 2006.&#xA;I think you may also be able to subscribe to an intra-day livefeed if you want.&lt;/p&gt;&#xA;" OwnerUserId="16457" LastEditorUserId="16457" LastEditDate="2016-06-08T16:02:13.467" LastActivityDate="2016-06-08T16:02:13.467" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27502" PostTypeId="1" AcceptedAnswerId="27503" CreationDate="2016-06-08T13:53:08.603" Score="2" ViewCount="412" Body="&lt;p&gt;Let's say I've computed the price of a call using Monte Carlo with $S_0 = 100$ and $K = 80$, using $T = 0.1$ and $r = 0$ to be $\$20.00095$.  This price estimate comes with a $95\%$ confidence interval of $[19.99969 , 20.00221]$.  The issue, then, is trying to estimate implied vol, including a confidence interval, since the $95\%$ lower bound on price is below intrinsic and hence the inverse problem has no solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even if we set the confidence interval to be $[20, 20.00221]$, the implied vol estimate would be $0.2172$ with a $95\%$ confidence interval $[0, 0.2324]$, a huge spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm already using a massive amount of stock prices to get the confidence intervals this tight, so I'd prefer not to just ramp up the number of simulations.  All of the paths finish in the money for this case.  Is there a variance reduction technique, perhaps, for dealing with these deep ITM issues?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2016-06-08T15:17:45.277" Title="Deep ITM Call Implied Vol via Monte Carlo" Tags="&lt;options&gt;&lt;monte-carlo&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27503" PostTypeId="2" ParentId="27502" CreationDate="2016-06-08T14:14:47.670" Score="6" Body="&lt;p&gt;&lt;strong&gt;[Short answer]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IMHO there is a fundamental problem with wanting to extract a sound implied volatility figure out of a deep ITM option's price. You should use out-of-the-money forward options (OTMF) instead: put options for strikes smaller than the forward price (left wing of the volatility surface) and call options otherwise (right wing of the volatility surface).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Long answer]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To illustrate my point, let $V$ denote the $t$-value of a European option, which we split into 2 components &#xA;$$ V = V_i + V_e $$&#xA;according the following thought experiment:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The &lt;em&gt;intrinsic value&lt;/em&gt;, $V_i$, is defined as what you would get if you could exercise the option immediately at time $t$, or equivalently, what your final gain would look like should the underlying price be frozen to its current value up to the contract's expiry. $V_i$ is always positive (but can be zero).&lt;/li&gt;&#xA;&lt;li&gt;The extrinsic or &lt;em&gt;time value&lt;/em&gt;, $V_e$, is the remaining part. It accounts for the fact that the underlying price &lt;em&gt;is expected to evolve&lt;/em&gt; and not remain frozen. $V_e$ can be positive or negative.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;By construction, we have that the intrinsic value $V_i$ does not depend on the future volatility as it is something we have defined assuming the underlying remained frozen. In contrast, the time value $V_e$ does depend on future volatility, more or less strongly depending on the remaining time to maturity $\tau = T-t$ and where the current spot price $S_t$ is located with respect to the strike $K$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By definition, the price of a strongly ITM option essentially corresponds to intrinsic value&#xA;$$ V = V_i + V_e \approx V_i $$ &#xA;Because $V_i$ does not depend on volatility, it is very difficult to imply a robust volatility figure from an ITM option price (the fraction $V_e$ of the option price which truly depends on volatility is very small relative to the full option price $V$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the contrary, strongly OTM options essentially reflect time value&#xA;$$ V = V_i + V_e \approx V_e $$&#xA;which makes it easier to imply volatility (the fraction $V_e$ of the option price which truly depends on volatility is very important relative to the full option price $V$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence you should prefer OTM options to ITM options when it comes to inferring implied volatilities.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-06-08T15:17:45.277" LastActivityDate="2016-06-08T15:17:45.277" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27504" PostTypeId="1" AcceptedAnswerId="27511" CreationDate="2016-06-08T15:44:10.740" Score="0" ViewCount="101" Body="&lt;p&gt;How can I prove that the function&#xA;$$\sigma_i\left(t\right) = k_i\left[\left(a+b\left(T_i-t\right)\right)e^{-c\left(T_i-t\right)}+d\right]$$&#xA;is bounded/unbounded?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma_i\left(t\right)$ is the chosen volatility parametrization in the Libor rate dynamics&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dL_i\left(t\right)=\mu_i\left(t\right)L_i\left(t\right)dt+\sigma_i\left(t\right)L_i\left(t\right)dW_i\left(t\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have no clue how to start, any help is appreciated. Thanks in advance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The instantaneous volatility can be decomposed in the following parts&#xA;$$\sigma_i\left(t\right) = g\left(T_i\right)f\left(T_i-t\right)$$&#xA;where $g\left(T_i\right)=k_i$ is the component specific to the individual forward Libor rate and $f\left(T_i-t\right)=\left(a+b\left(T_i-t\right)\right)e^{-c\left(T_i-t\right)}+d$ is the component depending on the residual maturity $T_i-t$.&lt;/p&gt;&#xA;" OwnerUserId="19279" LastEditorUserId="19279" LastEditDate="2016-06-09T13:17:18.577" LastActivityDate="2016-06-09T13:17:18.577" Title="Prove Volatility Parametrization of Libor Market Model is Bounded/Not Bounded" Tags="&lt;volatility&gt;&lt;lmm&gt;&lt;proof&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27505" PostTypeId="2" ParentId="17604" CreationDate="2016-06-08T17:36:00.883" Score="5" Body="&lt;p&gt;I have had a read through the paper that you quoted and have the following comments which you might find helpful:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I am formally trained in QM, so hopefully there shouldn't be any errors in the physics portions of the answer, but if there are any questions then please comment).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;A few comments about Quantum Mechanics (QM):&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quantum mechanics is a physical theory of measurement originally developed to describe phenomena at atomic scales or smaller. The reason this was needed was because things appeared to behave strangely, and this is reflected in the theory being built on the concept of &lt;em&gt;probability amplitudes&lt;/em&gt;, which (to paraphrase Feynman) &quot;are unlike anything observed before&quot;. The significance of this is that how probabilities are computed in QM are unique to QM (as far as we know). Why I stress this is because it means that only when we are trying to describe physical processes should we interpret what is computed as a probability.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The QM framework:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you ever get the chance to learn some QM, you will see that it is primarily formulated in linear algebra (cf. The Schrodinger Equation). This means that mathematically all we worry about are eigenvectors and eigenvalues, and how these change when we either apply a matrix (an operator), or change basis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Returning to the paper:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The paper gives a brief (and in my opinion flimsy) justification of a model of companies, where these are arranged in a regular fashion (a lattice). There is an interaction between the companies which determines the changes in the supply and demand, which we describe by the state of the system (note the similarity to the role of a QM wavefunction). The paper then effectively proposes an overall function (an operator) which is dependent on this state. This can be thought of as the Hamiltonian of the system, and the aim of the game is to find the eigenvalues to this Hamiltonian (which in physics we would identify as the energy levels). This whole framework is fairly common in quantum mechanics, and especially so in quantum field theory (QFT), and seems to resemble a typical approach to modeling condensed matter (cf. The Heisenberg Model for ferromagnetism).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What is quantum about the system:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nothing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Why bother with all the quantum formalism if the end result is effectively just Gaussian white noise?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can only guess at this point, but it seems reasonable to assume that the author clearly has some knowledge of QM, and hence has identified that the framework he is using in his model involves very similar structures to those physicists use everyday. Hence if he poses the maths problem in a language that physicists might understand they are motivated to read the paper, cite the paper, extend upon the paper, etc. (Remember that a &lt;em&gt;huge&lt;/em&gt; number of physicists turn to the financial industry).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think many of the references to &lt;em&gt;quantum game theory&lt;/em&gt; (and similar obscure fields) are superfluous.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Can classical methods not do any of these things?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The phrase classical methods is perhaps not well defined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Physics and financial maths in general:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although I think the quoted paper is a poor example, there is a huge field of applying approaches used in physics to areas in financial mathematics, including some of the areas mentioned involving QM and QFT. The main tool we can take from physics is Statistical Physics, and a good example of how this can be applied to finance is given by:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&quot;Theory of financial risk and derivatives pricing: From statistical physics to risk management&quot;, Bouchard and Potters&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;which gives great examples of using Hamiltonians, Lagrangians, etc. applied to finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="21016" LastEditorUserId="21016" LastEditDate="2016-06-09T08:01:29.397" LastActivityDate="2016-06-09T08:01:29.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27506" PostTypeId="2" ParentId="22940" CreationDate="2016-06-08T19:52:59.897" Score="1" Body="&lt;p&gt;Unless otherwise defined, the heat map is a VaR back-testing measure for the soundness of the VaR measure. For example, it may be allowed to have 4 VaR breaches, where the static P&amp;amp;L is greater than the VaR, for the past 250 business days, and any breaches with a total number not more than 4 are said to be in the green zone, while 5 to 9 breaches are in the yellow, or cautionary, zone, while 10 or more breaches will be in the red zone.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-06-08T19:52:59.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27507" PostTypeId="2" ParentId="10516" CreationDate="2016-06-08T20:19:26.020" Score="1" Body="&lt;p&gt;Overall you are not mistaken, although it is worth revisiting a few steps in your question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We assume $S$ follows the SDE&#xA;$$&#xA;\dfrac{dS}{S} = \mu\:dt+ \sigma\:dW^\mathbb{P}(t)&#xA;$$&#xA;under the physical measure $\mathbb{P}$. If we change to the risk neutral measure $\mathbb{Q}$ (using Girsanov's theorem) then $\mu \to r$ and we have the following SDE&#xA;$$&#xA;\dfrac{dS}{S} = r\:dt+ \sigma\:dW^\mathbb{Q}(t).&#xA;$$&#xA;Under the Black-Scholes model we would assume that $r$, $\mu$, and $\sigma$ were constants (with $\sigma &amp;gt; 0 $) and we could integrate the SDE in the range $[t,T]$ find that&#xA;$$&#xA;S(T) = S(t)\exp\left(\left(\mu - \dfrac{\sigma^2}{2}\right)(T-t) + \sigma \left(W^\mathbb{Q}(T) - W^\mathbb{Q}(t)\right)\right).&#xA;$$&#xA;Now to simulate this process we only need to sample $\left(W^\mathbb{Q}(T) - W^\mathbb{Q}(t)\right)$  which is achieved by computing $\sqrt{T-t\:}Z$ where $Z\sim N(0,1)$.&#xA;Following this approach you find that $\log \left(\dfrac{S(T)}{S(t)}\right)$ has the desired normal distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The alternative approach you seem to have implemented is to generate the entire path for $S$ which is unnecessary in this case. However, it would be necessary if we needed to know the path at intermediate times (e.g. for an exotic derivative such as an Asian option). At this point there are many ways to simulate the path and the simplest (which you have implemented) is the Euler-Maruyama method (alternatives could include the Milstein method), where&#xA;$$&#xA;S(t + \Delta t) = S(t) + S(t)\times\left(\mu \Delta t + \sigma \sqrt{\Delta t\:}Z\right)&#xA;$$&#xA;and would involve implementing this iteratively. This is much more expensive to compute and so should be avoided if possible, and gives $O(\Delta t)$ convergence in $S(T)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;I give the following 2-line implementation in Python2.7.10&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import numpy as np&#xA;import scipy.stats as stats&#xA;s_0, mu, sigma, T, paths, path_steps = [20.0, 2.0, 1.0, 1.0,  100, 100]&#xA;s_T = s_0 * np.exp((mu-0.5*(sigma**2))*T + sigma*np.sqrt(T)*np.random.normal(0.0, 1.0, 1000))&#xA;print(&quot;\&quot;True\&quot; Mean: \t&quot; + str((mu-0.5*(sigma**2))*T))&#xA;print(&quot;Computed Mean: \t&quot; + str(np.log(s_T/s_0).mean()))&#xA;print(&quot;\&quot;True\&quot; Standard Deviation: \t\t&quot; + str(sigma*np.sqrt(T)))&#xA;print(&quot;Computed Standard Deviation: \t&quot; + str(np.log(s_T/s_0).std()))&#xA;print(&quot;Shaprio-Wilk Normality test, p-value: \t&quot; + str(stats.shapiro(np.log(s_T/s_0))[0]))&#xA;print(&quot;Anderson-Darling Test:&quot;)&#xA;print(&quot;\t&quot; + str(stats.anderson(np.log(s_T/s_0), dist=&quot;norm&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which has the following output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;True&quot; Mean:    1.5&#xA;Computed Mean:  1.48206641711&#xA;&quot;True&quot; Standard Deviation:      1.0&#xA;Computed Standard Deviation:    0.983089657019&#xA;Shaprio-Wilk Normality test, p-value:   0.998949408531&#xA;Anderson-Darling Test:&#xA;    AndersonResult(statistic=0.26799531674055288, critical_values=array([ 0.574,  0.653,  0.784,  0.914,  1.088]), significance_level=array([ 15. ,  10. ,   5. ,   2.5,   1. ]))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The high p-value of the Shapiro-Wilk test supports the Null hypothesis that the result is normally distributed. I am not familiar with the Anderson-Darling test, so see the &lt;a href=&quot;http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.anderson.html#scipy.stats.anderson&quot; rel=&quot;nofollow&quot;&gt;package description&lt;/a&gt; and interpret the result for yourself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="21016" LastActivityDate="2016-06-08T20:19:26.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27508" PostTypeId="1" CreationDate="2016-06-09T01:57:56.723" Score="1" ViewCount="113" Body="&lt;p&gt;I have multiple trading signals developed using cointegration on the same stock using various correlated assets. Is there a mathematical way to combine them to achieve better entry/exit points and exploit more opportunities?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="13375" LastActivityDate="2016-06-09T01:57:56.723" Title="how to mix trading signals for the same product?" Tags="&lt;cointegration&gt;&lt;trading-systems&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27509" PostTypeId="1" CreationDate="2016-06-09T06:24:29.493" Score="1" ViewCount="114" Body="&lt;p&gt;I have a simple research project and I need to explain a behavior of a foreign exchange rate. Could you propose a stochastic process without jumps so that it could be estimated with QMLE? Is GBM  sufficient for short-run(several minutes)? &lt;/p&gt;&#xA;" OwnerUserId="22053" LastEditorUserId="22053" LastEditDate="2016-06-09T08:23:57.940" LastActivityDate="2016-06-09T08:23:57.940" Title="The best process for foreign exchange rate" Tags="&lt;stochastic-processes&gt;&lt;fx&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27510" PostTypeId="1" CreationDate="2016-06-09T07:58:20.647" Score="1" ViewCount="1082" Body="&lt;p&gt;I have implemented the Libor Market Model in Matlab. When I generate a number of paths, I notice that some of them explode. Does anybody have an idea what could cause this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I already tried solving the problem by decreasing the timestep (up to dt=0.001) in order to reduce the error and also by simulating with the log-Euler scheme instead of the 'normal' Euler. In both cases it did not resolve the problem, since some of the Libor rates paths are still diverging. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Specifics:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I simulate the forward Libor rates under the spot measure, whose dynamics are given by:&#xA;$$dL_n\left(t\right)=\sigma_n\left(t\right)L_n\left(t\right)\sum_{j=q\left(t\right)}^n \frac{\tau_j \rho_{j,n} \sigma_j\left(t\right)L_j\left(t\right)}{1+\tau_j L_j\left(t\right)}dt + \sigma_n\left(t\right)L_n\left(t\right)dW\left(t\right)$$&#xA;where&#xA;$$L_n\left(t\right):=L\left(t;T_n,T_{n+1}\right),$$&#xA;$$\tau_n = T_{n+1}-T_n,$$&#xA;$$\sigma_n\left(t\right) = k_n \left[\left(a+b\left(T_n-t\right)\right)e^{-c\left(T_n-t\right)}+d\right],$$&#xA;index function $q\left(t\right)$ is defined by &#xA;$$T_{q\left(t\right)-1}\leq t &amp;lt; T_{q\left(t\right)},$$&#xA;$W$ is a Brownian Motion under the spot measure.&lt;/p&gt;&#xA;" OwnerUserId="19279" LastActivityDate="2017-09-04T07:48:58.533" Title="Exploding Libor Rates in Libor Market Model" Tags="&lt;interest-rates&gt;&lt;simulations&gt;&lt;libor&gt;&lt;sde&gt;&lt;lmm&gt;" AnswerCount="4" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="27511" PostTypeId="2" ParentId="27504" CreationDate="2016-06-09T08:16:34.107" Score="1" Body="&lt;p&gt;If I have read the question correctly then I will assume that $a$, $b$, $c$, $d$, $T_i$, and $k_i$ are constants. If this is the case then the only term which we need to show is bounded is &#xA;$$&#xA;\big(a + b(T_i - t)\big)\exp\big(-c(T_i-t)\big).&#xA;$$&#xA;If we assume that we are only considering the temporal domain $0 \leq t \leq T_i$ such that $T_i - t \geq 0 $ then we can ensure that the the product will remain bounded if we have $c&amp;gt;0$ as this will exponentially dampen the product of the two terms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If though for whatever reason we have the more general case where $ -\infty \leq t \leq \infty$ then it will all depend again on the sign of $c$, but we would only need to consider these two extreme limits.&lt;/p&gt;&#xA;" OwnerUserId="21016" LastActivityDate="2016-06-09T08:16:34.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27513" PostTypeId="2" ParentId="25460" CreationDate="2016-06-09T08:47:59.680" Score="2" Body="&lt;p&gt;To elaborate on the explanation provided by @Alex, the reasoning is because when we look at the PDE we notice that the $S$ terms appear in pairs with the $\dfrac{\partial}{\partial S}$, i.e. $S\dfrac{\partial}{\partial S}$ and $S^2\dfrac{\partial^2}{\partial S^2}$. What this says it that if we were to try a polynomial function of $S$ then after applying these operators then the exponent of $S$ would not change, i.e. $S\dfrac{\partial S^n}{\partial S} \to nS^n$ and similarly $S^2\dfrac{\partial^2 S^n}{\partial S^2} \to n(n-1)S^n$. This means that after trying this ansatz in the PDE it would cancel leaving only a polynomial equation for $n$, which if we can show has solutions, justifies the initial ansatz.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The overall reasoning behind this is that trying to solve PDEs in general is tedious, so always look for shortcuts specific to the problem. A good mentality to solving a PDE problem is that solving the actual PDE in general is relatively easy, the relatively hard bit is applying the boundary conditions! Hence whenever solving a PDE we should keep in mind how are our boundary conditions expressed? If they are a polynomial function of $S$ then we should try a polynomial function as our ansatz. If we have a wave boundary condition then try a wave ansatz, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;e.g.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following &#xA;$$&#xA;\dfrac{\sigma^2}{2} \frac{\partial^2 P}{\partial S^2}-rP+r\frac{\partial P}{\partial S}=0&#xA;$$&#xA;would typically motivate a solution $P = \exp(\mu S)$ and then we would solve for $\mu$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A more general justification can be found in most courses in Linear Algebra and I would recommend seeing examples of the Sturm-Liouville problem. The general reasoning though is to change the basis into one that is easy to solve, e.g. we could solve your original PDE in terms of $\sin(S)$ and $\cos(S)$, or Legendre polynomials, Bessel functions, etc., but the solutions would not be anywhere as tidy. But you only learn which to try by drawing on experience, and even after years of experience and clever justifications it can frequently resort to trial and error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="21016" LastActivityDate="2016-06-09T08:47:59.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27515" PostTypeId="1" CreationDate="2016-06-09T09:46:29.070" Score="1" ViewCount="249" Body="&lt;p&gt;I've browsed a lot of financial APIs lately but most of them only show the daily closing prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any (JSON) API which offers minutely financial data? &lt;/p&gt;&#xA;" OwnerUserId="22076" LastEditorUserId="467" LastEditDate="2016-06-11T06:39:44.997" LastActivityDate="2016-06-11T06:39:44.997" Title="Which API can I use to get financial data minute- or 5m-wise?" Tags="&lt;programming&gt;&lt;market-data&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27518" PostTypeId="2" ParentId="27493" CreationDate="2016-06-09T12:49:40.877" Score="2" Body="&lt;p&gt;It means you should buy the 4 stocks. The model you are using seems to restrict short selling, i.e. by removing this restriction you could get negative weights on certain assets with all assets adding up to 100%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Re your question on limiting your asset selection to stocks that are expected to outperform the population: this has to do with your assumptions behind expected returns. Remember, that the important inputs for your mean variance optimization are &lt;strong&gt;expected&lt;/strong&gt; return, variance and correlations between the assets. Generally historical data is used for this purpose, but this doesn't necessarily reflect the expected &lt;strong&gt;future&lt;/strong&gt; performance of the assets you are about to invest in. You might just as well substitute the historical average returns with your personal expectation of the returns, and if you e.g. expect certain assets to yield negative returns with positive correlation to your total portfolio, then obviously it doesn't really matter whether you include that stock in the selection or not, if short selling restriction is imposed then 0% weight will be allocated to that stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bottom line: PT maximizes your Sharpe, that is the expected excess return of your total portfolio divided by the expected total variance. &lt;strong&gt;Assuming&lt;/strong&gt; that you are risk averse, the returns are normally distributed (i.e. heavy fat tails don't limit the extent to which you can lever your portfolio, and hence Sharpe is reasonable measure of the risk-return trade off) and the inputs are reasonable, then theoretically PT should yield the optimal composition of your portfolio. Relax these assumptions, and MPT runs in to some of the problems that you are wondering about.&lt;/p&gt;&#xA;" OwnerUserId="18607" LastActivityDate="2016-06-09T12:49:40.877" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27519" PostTypeId="2" ParentId="27515" CreationDate="2016-06-09T13:05:18.773" Score="3" Body="&lt;p&gt;Netfonds offers free tick level data. They only offer a few days worth, but you can store it as you go.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.blackarbs.com/blog/3/22/2015/how-to-get-free-intraday-stock-data-from-netfonds&quot; rel=&quot;nofollow&quot;&gt;http://www.blackarbs.com/blog/3/22/2015/how-to-get-free-intraday-stock-data-from-netfonds&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;'''&#xA;Netfonds import 5 days of intraday data&#xA;'''&#xA;&#xA;import numpy as np&#xA;import pandas as p&#xA;from pandas.tseries.offsets import *&#xA;import datetime as dt&#xA;import matplotlib.pyplot as plt&#xA;size = (14,10)&#xA;import seaborn as sns&#xA;sns.set_style('whitegrid')&#xA;&#xA;from pprint import pprint as pp&#xA;import time&#xA;# ================================================================== #&#xA;# timer start #&#xA;t0 = time.clock() &#xA;&#xA;# ================================================ #&#xA;# functions&#xA;# ~~~~~~~~~~~~~~~~~~&#xA;&#xA;now   = dt.date.today()&#xA;year  = str(now.year)&#xA;m     = str(now.month)&#xA;month = '0'+m&#xA;&#xA;day_5 = now - 5 * BDay()&#xA;day_4 = now - 4 * BDay()&#xA;day_3 = now - 3 * BDay()&#xA;day_2 = now - 2 * BDay()&#xA;day_1 = now - 1 * BDay()&#xA;&#xA;days  = [ day_1.day, day_2.day, day_3.day, day_4.day, day_5.day ]&#xA;days  = [ str(d) for d in days ]&#xA;&#xA;def netfonds_p( symbol ):&#xA;    url_posdump  = r'http://www.netfonds.no/quotes/posdump.php?date=%s%s%s&amp;amp;paper=%s.%s&amp;amp;csv_format=csv'&#xA;&#xA;    sym_posdump  = p.DataFrame()&#xA;    cols_posdump = [ 'bid', 'bdepth', 'bdeptht', 'offer', 'odepth', 'odeptht' ]&#xA;&#xA;    # ~~~~~~~~~~~~~~~~~~&#xA;    for day in days:&#xA;        try:&#xA;            sym_posdump = sym_posdump.append( p.read_csv( url_posdump % ( year, month, day, symbol, exchange_sym ), index_col=0, header=0, parse_dates=True ) )   &#xA;        except Exception as e:&#xA;            print( &quot;{} posdump not found&quot;.format( symbol ) )&#xA;    sym_posdump.columns = cols_posdump&#xA;    # ~~~~~~~~~~~~~~~~~~&#xA;    return sym_posdump&#xA;&#xA;def netfonds_t( symbol ):&#xA;    url_tdump = r'http://www.netfonds.no/quotes/tradedump.php?date=%s%s%s&amp;amp;paper=%s.%s&amp;amp;csv_format=csv'&#xA;    sym_tdump = p.DataFrame()&#xA;&#xA;    # ~~~~~~~~~~~~~~~~~~&#xA;    for day in days:&#xA;        try:&#xA;            sym_tdump = sym_tdump.append( p.read_csv( url_tdump % ( year, month, day, symbol, exchange_sym ),&#xA;                        index_col=0, header=0, parse_dates=True ) )&#xA;        except Exception as e:&#xA;            print( &quot;{} tdump not found&quot;.format( symbol ) )&#xA;    # ~~~~~~~~~~~~~~~~~~&#xA;    return sym_tdump&#xA;&#xA;def resample( data ):&#xA;    dat       = data.resample( rule='1min', how='mean').dropna()&#xA;    dat.index = dat.index.tz_localize('UTC').tz_convert('US/Eastern')&#xA;    dat       = dat.fillna(method='ffill')&#xA;    return dat&#xA;&#xA;def trading_start(d):&#xA;    mkt_open = dt.datetime( int(year), int(month), int(d), 9, 30 )&#xA;    return mkt_open&#xA;&#xA;def trading_end(d):&#xA;    mkt_close = dt.datetime( int(year), int(month), int(d), 16, 00 )&#xA;    return mkt_close&#xA;&#xA;def trading_hours(data):&#xA;    test = []&#xA;    for d in days:&#xA;        dat = data[ ( data.index &amp;gt; trading_start(d) ) &amp;amp; ( data.index &amp;lt; trading_end(d) ) ]&#xA;        test.append( dat )&#xA;    return test&#xA;&#xA;# ================================================ #&#xA;# ticker/data #&#xA;# need to know exchange symbol&#xA;# N = NYSE&#xA;# O = Nasdaq&#xA;# A = Amex # common for ETFs&#xA;# ~~~~~~~~~~~~~~~~~~&#xA;ticker       = 'NKE'&#xA;exchange_sym = 'N'&#xA;&#xA;# ~~~~~~~~~~~~~~~~~~&#xA;# resample irregular tick data&#xA;pos = resample( netfonds_p( ticker ) )&#xA;t   = resample( netfonds_t( ticker ).dropna(axis=1) )&#xA;&#xA;# ~~~~~~~~~~~~~~~~~~&#xA;# trading hours only&#xA;pos_rth = trading_hours( pos )&#xA;t_rth   = trading_hours( t )&#xA;&#xA;pos_trading_days = [ pos_rth[0],pos_rth[1],pos_rth[2],pos_rth[3],pos_rth[4] ]&#xA;t_trading_days   = [ t_rth[0],t_rth[1],t_rth[2],t_rth[3],t_rth[4] ]&#xA;&#xA;pos_rth = p.concat( pos_trading_days,ignore_index=True )&#xA;t_rth   = p.concat( t_trading_days, ignore_index=True )&#xA;&#xA;# ================================================ #&#xA;# sample plots&#xA;&#xA;pos_rth[['bid','bdeptht','offer','odeptht']].plot( color='blue', figsize=size, subplots=True )&#xA;plt.legend( loc='upper right' )&#xA;plt.suptitle('{} bid/offer data'.format(ticker), size=18 )&#xA;plt.show()&#xA;&#xA;t_rth.plot( color='blue', figsize=size, subplots=True )&#xA;plt.legend( loc='upper right' )&#xA;plt.suptitle('{} price/volume data'.format(ticker), size=18 )&#xA;plt.show()&#xA;&#xA;# ================================================================== #&#xA;# timer looking clean #&#xA;secs      = np.round( ( time.clock()  - t0 ), 4 )&#xA;time_secs = &quot;{timeSecs} seconds to run&quot;.format(timeSecs = secs)&#xA;mins      = np.round( ( (  time.clock() ) -  t0 )  / 60, 4 ) &#xA;time_mins = &quot;| {timeMins} minutes to run&quot;.format(timeMins = mins)&#xA;hours     = np.round( (  time.clock()  -  t0 )  / 60 / 60, 4 ) &#xA;time_hrs  = &quot;| {timeHrs} hours to run&quot;.format(timeHrs = hours)&#xA;print( time_secs, time_mins, time_hrs )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="22059" LastActivityDate="2016-06-09T13:05:18.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27520" PostTypeId="1" CreationDate="2016-06-09T13:09:19.757" Score="1" ViewCount="36" Body="&lt;p&gt;In this paper about &lt;a href=&quot;https://arxiv.org/abs/1603.05937&quot; rel=&quot;nofollow noreferrer&quot;&gt;combining multiple alphas&lt;/a&gt; are the returns signed returns? if not wouldn't they be mean zero?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, it mentions &quot;realized alpha returns&quot; - does that just mean &quot;realized&quot; past alpha return forecasts or what the real actual return was? And, for the &quot;expected alpha return&quot; that is the independent variable in this regression, isn't the &quot;expected alpha return&quot; just the mean real return (i.e. zero)? Since the alpha is the &lt;span class=&quot;math-container&quot;&gt;$\hat{y}$&lt;/span&gt; in the regression where it is fit to the return..&lt;/p&gt;&#xA;" OwnerUserId="1456" LastEditorUserId="16595" LastEditDate="2019-05-21T16:24:30.727" LastActivityDate="2019-05-21T16:24:30.727" Title="Are the returns in this regression signed returns?" Tags="&lt;returns&gt;&lt;regression&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="27521" PostTypeId="2" ParentId="15365" CreationDate="2016-06-09T13:31:23.037" Score="0" Body="&lt;p&gt;One assumption is that both (or more) instruments are liquid enough to offer a market (both sides).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;use the bid/ask/mid (your choice) or&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&quot;conflate&quot; (implemented by the big boys on their data feeds). i.e. 1 second conflation: if no trade, send out last trade price (or assume so in your application).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="22062" LastEditorUserId="467" LastEditDate="2016-06-11T06:35:04.423" LastActivityDate="2016-06-11T06:35:04.423" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27522" PostTypeId="1" CreationDate="2016-06-09T14:24:12.070" Score="2" ViewCount="646" Body="&lt;p&gt;Thanks for reading, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to calculate the market dividend yield for this set of data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The authors define it as 'The market dividend yield (MDY) is the one-year&#xA;dividend from the CRSP value-weighted market portfolio divided by the current&#xA;price'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I haven't got a clue, I was wondering if someone could help. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The paper is Hong, H., Torous, W., and Valkanov, R., Do Industries Lead Stock Markets? Journal of Financial Economics, 83(2) 367-396, 2007.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And the data can be download from the link: &#xA;&lt;a href=&quot;http://rady.ucsd.edu/faculty/directory/valkanov/&quot; rel=&quot;nofollow&quot;&gt;http://rady.ucsd.edu/faculty/directory/valkanov/&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sam&lt;/p&gt;&#xA;" OwnerUserId="22082" LastActivityDate="2016-06-10T09:10:53.130" Title="How do I calculate Market Dividend Yield from this data?" Tags="&lt;equities&gt;&lt;finance&gt;&lt;research&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27523" PostTypeId="2" ParentId="27522" CreationDate="2016-06-09T14:45:20.510" Score="2" Body="&lt;p&gt;The dividend yield can be computed from the forward prices. However, in practice (e.g., in Bloomberg), the realized dividend yield is computed as the sum of the dividend payments from the whole past year divided by the current equity (stock or index) price, while the implied dividend yield is computed as the sum of the forecast dividend payments, over the whole year forward from the current time, divided by the current equity price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that, the implied dividend yield computed as above is not the same as the continuous dividend yield computed from the forward price, however, they are close, most of the time. For computation of the dividend yield from discrete dividend payments, you can refer to &lt;a href=&quot;https://quant.stackexchange.com/questions/16129/black-scholes-formula-with-deterministic-discrete-dividend-musiela-approach/18284#18284.&quot;&gt;this question&lt;/a&gt; for a clue.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-06-09T15:26:42.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27524" PostTypeId="1" AcceptedAnswerId="27525" CreationDate="2016-06-09T16:07:59.820" Score="3" ViewCount="1246" Body="&lt;p&gt;I am playing around with writing a daily stock price prediction algo in Python using a Monte Carlo/GBM methodology. I know there are many other questions on here about this topic (&lt;a href=&quot;https://quant.stackexchange.com/questions/4589/how-to-simulate-stock-prices-with-a-geometric-brownian-motion&quot;&gt;here&lt;/a&gt;, and &lt;a href=&quot;https://quant.stackexchange.com/questions/4589/how-to-simulate-stock-prices-with-a-geometric-brownian-motion?rq=1&quot;&gt;here&lt;/a&gt;), but I'm super confused on the inputs and choice of time delta to give sensible results. It seems that unless you have a time delta (dt) increment that is suitably tiny, the results are garbage, and vary wildly with the choice of dt. Obviously I can see that dt is involved in the exponential component, so any change to it will have a big effect. My question is how does one choose a dt? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm basically using the great example &lt;a href=&quot;http://nakamuraseminars.org/nsblog/2014/06/21/monte-carlo-in-python-an-example/&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;, which uses numpy (apologies to the non-python people).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to model daily price movements, and look at the results after a certain number of steps (n). I see a lot of examples use a dt of 1/252 (number of trading days in a year, then look at the n-th index of the each sims array to see the values. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why do we need to have dt as 1/252 to model daily movements? Can we use 1/50 say? Does dt have to be 'suitably tiny'? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, let's use FB. It is trading at 118.72. I want to know the probability of it being above 125 after 60 trading days. I will run 10,000 paths. FB standard deviation is 0.12.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using a dt of 1/252, and looking at the 60th value of each result, gives me 1912 paths with a value above 125, so a 19% chance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using a dt of 1/50 gives me 3294 paths, a 33% chance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Very confused. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apologies if this is a stupid question to all the quants on here - I'm primarily a coder. &lt;/p&gt;&#xA;" OwnerUserId="22085" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-06-09T17:45:52.577" Title="Choice of time increment in Monte Carlo/ Geometric Brownian Motion (GBM) stock price prediction" Tags="&lt;stochastic-processes&gt;&lt;monte-carlo&gt;" AnswerCount="1" CommentCount="9" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27525" PostTypeId="2" ParentId="27524" CreationDate="2016-06-09T17:45:52.577" Score="4" Body="&lt;p&gt;Typically when running a Monte Carlo simulation we might simulate an SDE similar to &#xA;$$&#xA;\dfrac{dS}{S} = \mu\:dt + \sigma \: dW(t)&#xA;$$&#xA;by some appropriate method (e.g. Euler-Maruyama, Milstein, etc).&#xA;We notice by dimensional analysis that if $t$ is in units of $\textrm{years}$ then $\mu \sim \textrm{years}^{-1}$ and $\sigma \sim \textrm{years}^{-1/2}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typically we chose $dt = 1/252$ because there are around 252 trading days in a year, and when analysts crunch the daily values, they &quot;pretend&quot; that there are 252 days in a year for convenience. Hence if you want to simulate on a &quot;daily&quot; (252 days in a year) time scale then we would have the scaling $\mu \to \dfrac{\mu}{252}$ and $\sigma \to \dfrac{\sigma}{\sqrt{252\:}}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Provided we are using a Monte Carlo method then we can use whatever timescale we like if we're only interested in the final value. (Compare this to finite difference schemes where our choice of increments always has effects on convergence).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Caveat:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We are using the Monte Carlo approach to simulate what the final value would be, and sometimes this is path dependent (suppose $\sigma \to \sigma(S)$, which is called a local volatility model). Then the distribution of final values we compute is only an approximation to the actual distribution of solutions to the SDE. Hence if we use a smaller $\Delta t$ then our approximate distribution converges to the true distribution (cf strong and weak convergence), and generally for the Euler-Maruyama scheme the convergence is $O(\Delta t)$, which means smaller time scales give better results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this is the case then there are methods for choosing an appropriate $\Delta t$, but this depends on what Monte Carlo scheme we use, Classical MC, Quasi MC, Multilevel MC, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="21016" LastActivityDate="2016-06-09T17:45:52.577" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27526" PostTypeId="1" CreationDate="2016-06-09T17:46:11.433" Score="3" ViewCount="378" Body="&lt;p&gt;I have transformed the BSM PDE&#xA;$$\frac{\partial V}{\partial t} + \frac{\sigma^2}{2}S^2 \frac{\partial^2 V}{\partial S^2} + rS \frac{\partial V}{\partial S} - rV = 0    $$&#xA;to $u(\tau,x) = V(T-\tau,S_{0} e^{x})$ with a change of variables $x = \ln(S/S_{0})$ and $\tau = T -t$ to&#xA;$$ \frac{\partial u}{\partial \tau} = \frac{\sigma^2}{2} \frac{\partial^2 u}{\partial x^2} + (r - \frac{\sigma^2}{2})\frac{\partial u}{\partial x} - ru $$&#xA;For the discretization I use backward difference for the time derivative and central differences for the spatial derivatives. So I have an implicit finite difference scheme of the form&#xA;$$ A u_{i}^{n+1} = u_{i}^{n} $$&#xA;where $i$ is the index for the spatial grid (from 1 to $M = 2B/\Delta x$)  and $n$ for the time grid (from 1 to $N = T/\Delta\tau$) and&#xA;$$  A =      \begin{pmatrix}&#xA;        \beta_{1} &amp;amp; \gamma_{1} &amp;amp; 0 &amp;amp; 0 &amp;amp; \cdots &amp;amp; 0\\&#xA;        \alpha_{2} &amp;amp; \beta_{2} &amp;amp; \gamma_{2} &amp;amp; 0 &amp;amp; \cdots &amp;amp; 0 \\&#xA;        0 &amp;amp; \alpha_{3} &amp;amp; \beta_{3} &amp;amp; \gamma_{3} &amp;amp; \cdots &amp;amp; 0 \\&#xA;        \vdots &amp;amp; \ddots &amp;amp; \ddots &amp;amp; \ddots  &amp;amp;\ddots &amp;amp;\vdots \\&#xA;0 &amp;amp;\cdots &amp;amp; &amp;amp; &amp;amp; \alpha_M &amp;amp; \beta_{M}&#xA;       \end{pmatrix}  $$&#xA;and $\beta_i = 1 - k (\frac{\sigma^2}{\Delta x^2} - r)$, $\gamma_i = k(- \frac{\sigma^2}{2 \Delta x^2} - (r - \frac{\sigma^2}{2}) \frac{1}{2\Delta x})$ and $\alpha_i = k( -\frac{\sigma^2}{2 \Delta x^2} + (r - \frac{\sigma^2}{2})\frac{1}{2 \Delta x})$ $\forall 2 \leq i \leq N-1$&#xA;From the boundary conditions for a European call&#xA;$$\lim_{S \rightarrow 0} V(S,t) = 0 \qquad \lim_{x \rightarrow -\infty} u(x,\tau) = 0$$&#xA;I set $\beta_1 = 1$, $\gamma_{1} = 0$ and $u_{i}^{n} = 0$ as the lower bound&#xA;and from&#xA;$$\lim_{S \rightarrow \infty} V(S,t) = S - K e^{-r(T-t)} \qquad \lim_{x \rightarrow \infty} u(x,\tau) = S_{0} e^{x} - K e^{-r(T-t)}$$&#xA;I set $\alpha_M = 0$, $\beta_{M} = 1$ and $u_{M}^{n} = S_{0} e^{x_{M}} - K e^{-r(T-t)}$ to solve this scheme.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I want to use von Neumann boundaries and I'm not sure how it's done in the transformed PDE. So far I have tried it by leaving the lower boundary as it is and for the upper boundary I used &#xA;$$\lim_{S \rightarrow \infty} \frac{\partial V(S,t)}{\partial S} =  1 \qquad \lim_{x \rightarrow \infty} \frac{\partial u(x,\tau)}{\partial x} = S_{0} e^{x} $$&#xA;From the central difference of the first spatial derivative I get then&#xA;$$ \frac{u_{M+1}^{n+1} - u_{M-1}^{n+1}}{2 \Delta x} = e^{x_{M}} S_{0} \\&#xA;u_{M+1}^{n+1} = 2 \Delta x e^{x_{M}} S_{0} - u_{M-1}^{n+1}$$&#xA;Now I insert this into the last row of the scheme&#xA;$$\alpha_{M} u_{M-1}^{n+1} + \beta_{M} u_{M} + \gamma_{M} (2 \Delta x e^{x_{M}} S_{0} - u_{M-1}^{n+1}) = u_{M}^{n} \\&#xA;(\alpha_{M} - \gamma_{M}) u_{M-1}^{n+1} + \beta_{M} u_{M} = u_{M}^{n} - 2 \Delta x e^{x_{M}} S_{0} \gamma_{M} $$&#xA;So the boundary in the scheme becomes $\alpha_{M} = (\alpha_{M} - \gamma_{M})$, $\beta_M = \beta_M$ and $u_{M}^{n} = u_{M}^{n} - 2 \Delta x e^{x_{M}} S_{0} \gamma_{M}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I implement this in Matlab with the Dirichlet boundary I get good results, but something must be wrong with the von Neumann implementation because the results for large $S$ have very large errors. Can someone please help me?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot&lt;/p&gt;&#xA;" OwnerUserId="22081" LastEditorUserId="22081" LastEditDate="2016-06-09T20:38:47.490" LastActivityDate="2018-06-16T17:31:01.763" Title="von Neumann boundary in the transformed PDE" Tags="&lt;black-scholes-pde&gt;&lt;finite-difference-method&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27527" PostTypeId="2" ParentId="4661" CreationDate="2016-06-09T17:47:14.977" Score="4" Body="&lt;p&gt;Given the Ho-Lee interest rate model of the form&#xA;\begin{align*}&#xA;dr_t = \theta_t dt + \sigma dW_t, &#xA;\end{align*}&#xA;the price at time $t&amp;gt;0$ of a zero-coupon bond, with maturity $T$ and unit face, has the form&#xA;\begin{align*}&#xA;B(t, T) &amp;amp;=E\Big(e^{-\int_t^T r_s ds} \mid r_t \Big)\\&#xA;&amp;amp;=e^{-(T-t)r_t - \int_t^T (T-u)\theta_u du + \frac{\sigma^2}{6}(T-t)^3}.&#xA;\end{align*}&#xA;See &lt;a href=&quot;https://quant.stackexchange.com/questions/15956/ho-and-lee-derivation-for-short-rates-model/15962#15962&quot;&gt;this question&lt;/a&gt; for the details. In particular,&#xA;\begin{align*}&#xA;B(0, t) = e^{t\, r_0 - \int_0^t(t-u)\theta_u du + \frac{\sigma^2}{6}t^3}.&#xA;\end{align*}&#xA;Moreover,&#xA;\begin{align*}&#xA;\theta_t = \sigma^2 t - \frac{\partial^2 \ln B(0, t)}{\partial t^2},&#xA;\end{align*}&#xA;which can be computed piecewise-analytically based on the interpolation scheme of the yield curve.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-06-09T17:47:14.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27528" PostTypeId="2" ParentId="27526" CreationDate="2016-06-09T18:47:47.897" Score="2" Body="&lt;p&gt;I suggest this procedure:&#xA;$$x=\ln\left(\frac{S}{S_0}\right)\,\,\,\ ,\,\,\,\tau=T-t\,\,\,\, ,\,\,\,\,U(x,\tau)=e^{r\tau}V(S_t,t)$$ &#xA;which leads to a forward PDE with constant coefficients&#xA;$$U_\tau(x,\tau)=\frac{\sigma^2}{2}U_{xx}(x,\tau)+\mu\,U_{x}(x,\tau)$$&#xA;where &#xA;$$\mu=r-\frac{1}{2}\sigma^2$$&#xA;After this change of variables, the terminal condition becomes an initial condition at $\tau = 0$:&#xA;$$U(x,0)=\max\{S_0\,e^{x_0}-K,0\}$$ &#xA;In order to apply standard methods of numerical solution of PDEs, such as finite difference or finite element schemes, we need to localize the domain of definition in $x$ to a bounded interval&#xA;$$x\in(x_{min}\,,\,x_{max})$$&#xA;The standard approach consists in choosing the computational domain $(x_{min}\,,\,x_{max})$ sufficiently large” and imposing Dirichlet or Neumann boundary conditions based on the asymptotic of the solution. For instance, in the case of a call option, we have the following asymptotic behavior of the solution:&#xA;$$V_S(S,t)\simeq\,S-K\,e^{-r(T-t)}\,\, ,\,\,S\to\infty$$&#xA;$$V_S(S,t)\simeq0\,\, ,\,\,S\to0$$&#xA;Neumann  Boundaries:&#xA;$$u_x(x_{max},\tau)=S_0e^{x_{max}+r\tau}-K$$&#xA;$$u_x(x_{min},\tau)=0$$&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;It was proved that the localization error due to these boundary conditions goes to zero exponential when the size of the computational domain goes to infinity. However, these results do not indicate whether it is better to take Dirichlet or Neumann conditions&#xA;  nor how to choose domain “sufficiently large” in practice. One often suggests to take this interval in relation with the standard deviation of the Brownian motion for the period $[0,T]$.  This approach uses the so-called transparent boundary conditions:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Transparent boundary conditions may be used for any interval $x\in(x_{min}\,,\,x_{max})$ even small, provided it contains the singularities of the payoff.&lt;/li&gt;&#xA;&lt;li&gt;They provide exact boundary conditions for the localized PDE (and not only asymptotically exact). There is still a small numerical error due to the discretization of these conditions. &lt;/li&gt;&#xA;&lt;li&gt;Transparent boundary conditions are almost as easy to implement as Neumann or Dirichlet conditions.&#xA;For more details,you can read &lt;a href=&quot;http://cermics.enpc.fr/cnf/Voltchkova.pdf&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Discretization&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$x=x_{min}+i\Delta\,x\,\, ,\,\,\Delta\,x=\frac{x_{max}-x_{min}}{N-1}$$&#xA;$$\tau_n=n\Delta t\,\,\, ,\,\,\Delta t=\frac{T}{M}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I&lt;strong&gt;implementation&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have a usual three-point finite difference scheme: &#xA;$$a_lU_{i-1}^{n+1}+a_dU_{i}^{n+1}+a_uU_{i+1}^{n+1}=b_lU_{i-1}^{n}+b_dU_{i}^{n}+b_uU_{i}^{n+1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of the $\theta$-scheme, the coefficients are given by &#xA;\begin{align}&#xA;  &amp;amp; {{a}_{l}}=\theta \,\Delta t\left( -\frac{{{\sigma }^{2}}}{2{{(\Delta x)}^{\,2}}}+\frac{\mu }{2\Delta x} \right) \\ &#xA; &amp;amp; {{a}_{d}}=1+\theta \Delta t\frac{{{\sigma }^{2}}}{{{(\Delta x)}^{\,2}}} \\ &#xA; &amp;amp; {{a}_{u}}=\theta \Delta t\left( -\frac{{{\sigma }^{2}}}{2{{(\Delta x)}^{\,2}}}-\frac{\mu }{2\Delta x} \right) \\ &#xA; &amp;amp; {{b}_{l}}=(\theta -1)\Delta t\left( -\frac{{{\sigma }^{2}}}{2{{(\Delta x)}^{\,2}}}+\frac{\mu }{2\Delta x} \right) \\ &#xA; &amp;amp; {{b}_{d}}=1+(\theta -1)\theta \Delta t\frac{{{\sigma }^{2}}}{{{(\Delta x)}^{\,2}}} \\ &#xA; &amp;amp; {{b}_{u}}=(\theta -1)\Delta t\left( -\frac{{{\sigma }^{2}}}{2{{(\Delta x)}^{\,2}}}-\frac{\mu }{2\Delta x} \right) \\ &#xA;\end{align} &lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-06-09T20:01:32.860" LastActivityDate="2016-06-09T20:01:32.860" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="27529" PostTypeId="1" CreationDate="2016-06-09T18:56:44.983" Score="1" ViewCount="383" Body="&lt;p&gt;Suppose that we have a spread curve $\boldsymbol{s}:=(s_1, ..., s_n)$, where $s_i$ are CDS par spreads. Moreover, assume the standard ISDA model framework, i.e. piecewise constant forward / hazard rates. Let $g$ be the function such that $\boldsymbol{c} = g({\bf s})$, where $\boldsymbol{c}:=(pd_1,...,pd_n)$ is the credit curve corresponding to $\boldsymbol{s}$. Thus, applying $g$ is equivalent to bootstrapping a CDS spread curve. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, let there also be a bond spread curve $\boldsymbol{bs}:=(bs_1, ..., bs_n)$. Here, $bs_i$ is computed as the spread of YTM (yield-to-maturity) of a risky fixed-coupon bond (not necessarily trading at par) over the LIBOR swap rate for the maturity horizon. Finally, the question: is it plausible to construct the credit curve $\boldsymbol{bc}$ corresponding to $\boldsymbol{bs}$ using the very same (CDS bootstrapping) function $g$, i.e. as $\boldsymbol{bc} = g({\bf \boldsymbol{bs}})$? That is, to which extend are the CDS and bond spreads interchangeable?&lt;/p&gt;&#xA;" OwnerUserId="15867" LastActivityDate="2016-06-09T18:56:44.983" Title="Bootstrapping bond spreads as in the standard CDS model" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;spread&gt;&lt;cds&gt;&lt;bond-yields&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27530" PostTypeId="2" ParentId="25351" CreationDate="2016-06-09T19:08:20.640" Score="1" Body="&lt;p&gt;Try the mgarch package, it's available at CRAN. In &lt;a href=&quot;http://faculty.washington.edu/ezivot/book/Ch13.mgarch2ndEdition.ssc&quot; rel=&quot;nofollow&quot;&gt;this link&lt;/a&gt; you will find an example from Prof. Zivot. &lt;/p&gt;&#xA;" OwnerUserId="22088" LastActivityDate="2016-06-09T19:08:20.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27531" PostTypeId="1" CreationDate="2016-06-09T21:27:50.990" Score="1" ViewCount="208" Body="&lt;p&gt;I'm reading the consultative document of the BCBS on the Fundamental Review of the Trading Book: &lt;a href=&quot;http://www.bis.org/publ/bcbs265.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.bis.org/publ/bcbs265.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Table 2 on page 16 shows the liquidity horizons for 5 broad risk factors categories: interest rates, credit, foreign exchange, equities, and commodities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure about the meaning of 2 sub-categories: ATM volatility, and &quot;other&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand volatility is a risk factor, but why using ATM volatility? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;About the “other” sub-category, according to the BCBS, this is &quot;meant to capture all risk factors that would not fall under any of the other buckets defined&quot;. For example, in the case of &quot;Interest rate (other)&quot;, which product would fall in this category?&lt;/p&gt;&#xA;" OwnerUserId="12214" LastActivityDate="2016-06-09T21:27:50.990" Title="Liquidity horizons of risk factors categories" Tags="&lt;volatility&gt;&lt;risk-management&gt;&lt;liquidity&gt;&lt;basel&gt;&lt;market-risk&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27532" PostTypeId="5" CreationDate="2016-06-09T21:56:59.450" Score="0" Body="&lt;p&gt;Given a probability space $(\Omega\,\mathcal{F},P)$ and a measurable space $(\mathbb{R}^n, \mathcal{B}(\mathbb{R}^n)) ,$ an $\mathbb{R}^n$-valued stochastic process is a collection of  $\mathbb{R}^n$-valued random variables on $\Omega$ , indexed by a totally ordered set $\{ t|t\ge0 \}$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-06-10T10:25:18.723" LastActivityDate="2016-06-10T10:25:18.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27533" PostTypeId="4" CreationDate="2016-06-09T21:56:59.450" Score="0" Body="stochastic processes  is a collection of random variables representing the evolution of some system of random values over time." OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-06-10T10:25:11.537" LastActivityDate="2016-06-10T10:25:11.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27534" PostTypeId="1" CreationDate="2016-06-09T22:36:01.540" Score="2" ViewCount="740" Body="&lt;p&gt;I'm estimating a time-varying correlation matrix for the normal copula using the &lt;code&gt;rmgarch&lt;/code&gt; package from R. I've found this code in the rmgarch.tests folder. I use the semiparametric distribution with generalized pareto distribution, which is specified in &lt;code&gt;cgarchspec&lt;/code&gt; and controlled for in &lt;code&gt;cgarchfit&lt;/code&gt; (with thresholds at 0.05 and 0.95). &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#required package   &#xA;install.packages(&quot;rmgarch&quot;)&#xA;library(rmgarch)&#xA;&#xA;#load data &#xA;data(dji30retw)&#xA;Dat = dji30retw[, 1:3, drop = FALSE]&#xA;&#xA;#specification for univariate ARMA-GARCH, normal copula with SPD and fitting&#xA;uspec17 = ugarchspec(mean.model = list(armaOrder = c(2,1)), &#xA;                 variance.model = list(garchOrder = c(1,1), model = &quot;sGARCH&quot;, variance.targeting=FALSE), &#xA;                 distribution.model = &quot;norm&quot;)&#xA;spec17 = cgarchspec(uspec = multispec( replicate(3, uspec17) ), asymmetric = FALSE, &#xA;                 distribution.model = list(copula = &quot;mvnorm&quot;, method = &quot;Kendall&quot;, &#xA;                                           time.varying = TRUE, transformation = &quot;spd&quot;))&#xA;fit17 &amp;lt;- cgarchfit(spec17, Dat, out.sample=100, spd.control=list(upper=0.95, lower=0.05, type=&quot;mle&quot;, kernel=&quot;normal&quot;),&#xA;             cluster=NULL, fit.control=list(eval.se=FALSE))&#xA;T = dim(Dat)[1]-100&#xA;simMu = simS = filtMu = filtS = matrix(NA, ncol = 3, nrow = 100)&#xA;simCor = simC = filtC = filtCor = array(NA, dim = c(3,3,100))&#xA;colSd = function(x) apply(x, 2, &quot;sd&quot;)&#xA;specx17 = spec17&#xA;for(i in 1:3) specx17@umodel$fixed.pars[[i]] = as.list(fit17@model$mpars[fit17@model$midx[,i]==1,i])&#xA;setfixed(specx17)&amp;lt;-as.list(fit17@model$mpars[fit17@model$midx[,4]==1,4])&#xA;&#xA;#simulation &#xA;{for(i in 1:100){&#xA;if(i==1){&#xA;  presigma = matrix(tail(sigma(fit17), 2), ncol = 3)&#xA;  prereturns = matrix(unlist(Dat[(T-1):T, ]), ncol = 3, nrow = 2)&#xA;  preresiduals = matrix(tail(residuals(fit17),2), ncol = 3, nrow = 2)&#xA;  preR = last(rcor(fit17))[,,1]&#xA;  diag(preR) = 1&#xA;  preQ = fit17@mfit$Qt[[length(fit17@mfit$Qt)]]&#xA;  preZ = tail(fit17@mfit$Z, 1)&#xA;  tmp = cgarchfilter(specx17, Dat[1:(T+1), ], filter.control = list(n.old = T), varcoef = fit17@model$varcoef)&#xA;  filtMu[i,] = tail(fitted(tmp), 1)&#xA;  filtS[i,] = tail(sigma(tmp), 1)&#xA;  filtC[,,i] = last(rcov(tmp))[,,1]&#xA;  filtCor[,,i] = last(rcor(tmp))[,,1]&#xA;} else{&#xA;  presigma = matrix(tail(sigma(tmp), 2), ncol = 3)&#xA;  prereturns = matrix(unlist(Dat[(T+i-2):(T+i-1), ]), ncol = 3, nrow = 2)&#xA;  preresiduals = matrix(tail(residuals(tmp),2), ncol = 3, nrow = 2)&#xA;  preR = last(rcor(tmp))[,,1]&#xA;  diag(preR) = 1&#xA;  preQ = tmp@mfilter$Qt[[length(tmp@mfilter$Qt)]]&#xA;  preZ = tail(tmp@mfilter$Z, 1)&#xA;&#xA;  tmp = cgarchfilter(specx17, Dat[1:(T+i), ], filter.control = list(n.old = T), varcoef = fit17@model$varcoef)			&#xA;  filtMu[i,] = tail(fitted(tmp), 1)&#xA;  filtS[i,] = tail(sigma(tmp), 1)&#xA;  filtC[,,i] = last(rcov(tmp))[,,1]&#xA;  filtCor[,,i] = last(rcor(tmp))[,,1]&#xA;}&#xA;sim17 = cgarchsim(fit17, n.sim = 1, m.sim = 2000, startMethod = &quot;sample&quot;, preR = preR, preQ = preQ, preZ = preZ,&#xA;                 prereturns = prereturns, presigma = presigma, preresiduals = preresiduals, cluster = NULL)&#xA;simx = t(sapply(sim17@msim$simX, FUN = function(x) x[1,]))&#xA;simMu[i,] = colMeans(simx)&#xA;# Note: There is no uncertainty for the 1-ahead simulation of cov adn cor&#xA;simC[,,i] = sim17@msim$simH[[1]][,,1]&#xA;simCor[,,i] = sim17@msim$simR[[1]][,,1]&#xA;simS[i,] = sqrt(diag(simC[,,i]))&#xA;}}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;After running this, &lt;code&gt;simx&lt;/code&gt; is a matrix containing all conditional returns. Do you know whether they take into account the copula and SPD marginals, i.e. does this procedure follow the steps: i) given data at $t$, construct correlation matrix $t+1$; ii) given correlation at $t+1$, generate 2000 correlated copula realizations; iii) using the inverse of the SPD obtain standardized residuals; iv) insert these back in the ARMA-GARCH specification and compute return? Intuitively I would say yes (why are GARCH, spd and normal copula specified earlier otherwise?) but I've found no &quot;official&quot; confirmation.&lt;/p&gt;&#xA;" OwnerUserId="20573" LastActivityDate="2019-08-17T13:02:15.267" Title="(Reproducible example) Conditional returns in GARCH-EVT-Copula context (with R)" Tags="&lt;r&gt;&lt;risk-management&gt;&lt;copula&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27535" PostTypeId="2" ParentId="21251" CreationDate="2016-06-09T23:41:55.263" Score="1" Body="&lt;p&gt;Use DVD_HIST_GROSS_WITH_AMT_STAT. It includes normal and abnormal dividends,stock dividends, stock splits, rights, and spinoffs.&lt;/p&gt;&#xA;" OwnerDisplayName="user18489" LastActivityDate="2016-06-09T23:41:55.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27536" PostTypeId="1" CreationDate="2016-06-10T00:40:17.333" Score="2" ViewCount="482" Body="&lt;p&gt;I have learned some knowledge on option pricing by myself at a very beginne level.&#xA;I'm using Matlab R2009b finacial derivative toolbox.&#xA;I found option pricing functions for american options on stock, but not on futures.&#xA;I have read documentations of the toolbox, and still &#xA;have no idea how to compute volatility and greeks of american option on futures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What functions can I use to compute the volatility and greeks of american option on futures?&lt;/p&gt;&#xA;" OwnerUserId="22080" LastEditorUserId="70" LastEditDate="2017-02-14T11:33:23.240" LastActivityDate="2017-03-16T11:56:06.753" Title="How do I compute volatility and greeks of the american option on futures using matlab toolbox?" Tags="&lt;programming&gt;&lt;futures&gt;&lt;american-options&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27537" PostTypeId="1" CreationDate="2016-06-10T01:00:27.783" Score="2" ViewCount="111" Body="&lt;p&gt;This is a problem from Schlogl's book in the chapter on the HJM model: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Price option of the RAN instrument with 3 month coupons and maturity 3 years using Monte Carlo(&lt;a href=&quot;http://www.schlogl.com/sites/default/files/Chapter8exercises.pdf&quot; rel=&quot;nofollow&quot;&gt;Exercise 4 Range Accrual Note&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the code in the Quantlib library? If so can you tell me its location, thank you.&#xA;If not can you give me some suggestions on how to approach it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The background&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A bond's value and payoff are of the form:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V=\sum_{i}^{N} c_{i} B(T_{i-1},T_{i}) \text{ and } [V-K]^{+},$$&#xA;where K is the strike, $c_{i}$ are the coupons and $B(T_{i-1},T_{i})$ is the price of a zero bond at time $T_{i-1}$ with maturity $T_{i+1}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the FRN the coupons $c_{i}$ are determined by some asset or floating rate. Specifically in R&#xA;AN with 3-month coupons (90 days) and interest compounded daily we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$c_{i}=\bar{r}\frac{1}{90}\sum_{k=90\cdot i}^{90\cdot (i+1)}L(t_{k},t_{k+1}),$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the Libor rate is $L(t_{k},t_{k+1})=\frac{1}{t_{k+1}-t_{k+1}}(\frac{1}{B(t_{k},t_{k+1})}-1)$ and $\bar{r}$ is a fixed number or the Libor rate plus a spread s. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So we are searching to price the option with payoff $(\sum_{i}^{N} c_{i} B(T_{i-1},T_{i})-K)^{+}$ with the above $c_{i}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Glasserman in his Monte Carlo book section 3.7, describes how to go about the Libor rate option. I will try that as well.&lt;/p&gt;&#xA;" OwnerUserId="20403" LastEditorUserId="20403" LastEditDate="2016-06-10T14:27:31.250" LastActivityDate="2016-06-10T14:27:31.250" Title="Monte Carlo approach to RAN bonds in Quantlib or suggestions" Tags="&lt;programming&gt;&lt;monte-carlo&gt;&lt;floating-rate&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27538" PostTypeId="1" CreationDate="2016-06-10T02:23:42.600" Score="1" ViewCount="67" Body="&lt;p&gt;I have a minutes OHLC time series stored in fints object, how can I get a new fints object which contains daily OHLC? What is the easiest way to do it?&lt;/p&gt;&#xA;" OwnerUserId="22080" LastActivityDate="2016-06-10T02:23:42.600" Title="How to get daily OHLC (fints) from minutes OHLC (fints) in MatLab?" Tags="&lt;time-series&gt;&lt;matlab&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27539" PostTypeId="1" CreationDate="2016-06-10T03:29:19.200" Score="8" ViewCount="3412" Body="&lt;p&gt;I can appreciate the mathematical derivation, but can anyone explain this in a more intuitive sense?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I often come across the mistaken belief that due to the replicating portfolio being long more downside contracts than upside contracts, the variance swap is long skew. But this is incorrect, these weightings are just to ensure that the $vega exposure is equal both on the downside and the upside.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it something to do with volga, i.e. the vega of the higher vol downside contracts will increase faster (due to an increase in skew) than the vega of the lower vol contracts will decrease?&lt;/p&gt;&#xA;" OwnerUserId="22091" LastActivityDate="2018-07-30T00:56:59.520" Title="Why is a variance swap long skew?" Tags="&lt;swaps&gt;&lt;variance&gt;&lt;skew&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="27540" PostTypeId="1" CreationDate="2016-06-10T08:16:14.443" Score="2" ViewCount="88" Body="&lt;p&gt;Let's say I have to price options on instrument X with a multitude of strikes. For simplicity, assume that X only makes one move during the options' lifetime, and this move is affected by some binary &quot;yes&quot;/&quot;no&quot; event - e.g. an option on the 30 minutes SP500 move after the primaries results for Clinton vs. Sanders are made public (in time when there was still some intrigue there). Assume also, that in case of &quot;yes&quot; X will go up and in case of &quot;no&quot; it will go down. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To improve this pricing w.r.t. market, a colleague of mine suggested the following idea. He goes to a bookies website, and sees their odds. For example, they suggest that yes is 75% probable. He also has his estimate of the standard deviation of the move, e.g. he expects an absolute move of 2%. He then uses the bookies data to scale the moves so that: (the $\Delta X$ here is the move)&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$\Bbb P(\Delta X \geq 0) = 0.75$&lt;/li&gt;&#xA;&lt;li&gt;$\Bbb E|\Delta X| = 0.02$&lt;/li&gt;&#xA;&lt;li&gt;$\Bbb E(\Delta X) = 0$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;He claims that the 3rd condition makes it legit to incorporate the bookies information into pricing, since he makes the X be a martingale in this 1-step model. I agree with the latter fact, but I don't think he can incorporate this bookies information there at all, at least in the classical pricing framework.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, let's consider the case when X follows the binomial model, and only makes moves of 2% up or down (so that the 2nd condition is satisfied). No matter what bookies website would suggest, we would still use 50/50 probabilities for the moves here (to satisfy the 3rd condition). Of course, we don't have enough flexibility to change probabilities after we assured 2nd and 3rd conditions, but I think the underlying point here is: this bookies information can (and should) only be used to estimate the mean of the move, not relative probabilities, and in the pricing world the mean is fixed. Am I right?&lt;/p&gt;&#xA;" OwnerUserId="13480" LastEditorUserId="13480" LastEditDate="2016-06-10T08:38:18.540" LastActivityDate="2016-06-10T08:38:18.540" Title="Use of real-world probabilities in options pricing: binary event with continuous effect" Tags="&lt;option-pricing&gt;" AnswerCount="0" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27541" PostTypeId="2" ParentId="27478" CreationDate="2016-06-10T08:27:45.943" Score="1" Body="&lt;p&gt;When calculating the simple arithmetic mean, each observation has an equal weight:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \hat \mu^{simple} = \frac{1}{T}\sum_{t=1}^T x_t.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the observations are $i.i.d.$, $\hat \mu^{simple}$ is an efficient estimator of the population mean.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When estimating the mean of a GARCH process, $\hat \mu^{simple}$ is no longer efficient. It makes sense to downweight the noisy observations relative to the low-noise observations so as to gain efficiency. So you fit a GARCH model and use inverse fitted standard deviations as weights:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \hat \mu^{GARCH} = \frac{1}{\sum_{t=1}^T \hat \sigma_t}\sum_{t=1}^T \frac{x_t}{\hat \sigma_t}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally the case of estimated weights gives a different number than the case of equal weights:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\hat \mu^{simple} \not\equiv \hat \mu^{GARCH}.$$&lt;/p&gt;&#xA;" OwnerUserId="19645" LastActivityDate="2016-06-10T08:27:45.943" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27542" PostTypeId="2" ParentId="27539" CreationDate="2016-06-10T08:30:32.077" Score="7" Body="&lt;p&gt;As I've mentioned in a comment, it would be wrong to think that entering a variance swap specifically amounts to being &quot;long skew&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you can say however is that, in the absence of jumps (i.e. in a pure diffusion framework, see &lt;a href=&quot;https://quant.stackexchange.com/questions/25423/construction-of-vix-and-vvix/25438#25438&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;https://quant.stackexchange.com/questions/18007/variance-replication-using-options/18022#18022&quot;&gt;here&lt;/a&gt; for further info), the fair &lt;em&gt;variance strike&lt;/em&gt; $K_{var}$ at which a variance swap with notional $N$ and payoff&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ N \times ( \sigma^2_{\text{realised}}(0,T) - K_{var} ) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;should trade at the following par rate (or variance strike)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ K_{var} = \frac{2}{B(0,T)T} \left[ \int_0^{F(0,T)} \frac{P(K,T)}{K^2} dK + \int_{F(0,T)}^\infty \frac{C(K,T)}{K^2} dK \right] $$&#xA;where $T$ figures the contract's maturity date, $\sigma^2_{\text{realised}}(0,T)$ the variance of log-returns that will realise over the horizon $[0,T]$, $B(0,T)$ the discount factor, $P(K,T)$ and $C(K,T)$ European option prices with strike $K$ and maturity $T$ and $F(0,T)$ the forward price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, the price of a variance swap is simply a scaled integral of the OTMF price curve:&#xA;$$ K_{var} \propto \int_0^\infty \frac{V(K,T)}{K^2} dK $$&#xA;$$ V(K,T) = \begin{cases}&#xA;           P(K,T) &amp;amp; \text{if } K &amp;lt; F(0,T) \\&#xA;           C(K,T) &amp;amp; \text{otherwise}&#xA;            \end{cases} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, assume the following situation where,  $S_0=100$, $r=q=0$ (no risk-neutral drift), $T=1$ along with 3 shapes of implied volatility smile at $T$: flat, pure skew, pure convexity. If you compute the fair variance strike $K_{var}$ under these different configurations, you will see that both &lt;strong&gt;negative skew&lt;/strong&gt; and &lt;strong&gt;positive convexity&lt;/strong&gt; have a positive impact and not specifically skew as you seem to indicate. See the simulations below where I've expressed the &quot;variance price&quot; as $\sqrt{K_{var}}\times 100$ similarly to what is done for volatility indices such as the VIX.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/yqQkX.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/yqQkX.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-10-05T13:59:48.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27543" PostTypeId="1" CreationDate="2016-06-10T08:36:20.123" Score="2" ViewCount="251" Body="&lt;p&gt;Let us assume we have a LIBOR 3M curve and that I would like to introduce a small shock up/down of 1bp at a certain point along the curve. I am trying to find out what the best and most efficient way is of doing this, but so far I haven't found a standard approach to be followed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My yield curve is made of cubic splines, and so shifting a point up by 1bp might cause my curve to suffer from unrealistic/undesirable twists around the point in question, rendering the new curve useless. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A different approach I have thought of could be shifting up the point by 1bp and then perform linear interpolation in that local area. Thus, if we shift the point at t(i) and I have t(i-1) &amp;lt; t(i) &amp;lt; t(i+1), then I would do linear interpolation for the points between t(i-1) and t(i+1).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone had to solve this problem before? What would be the best approach without making the new curve look funny?&lt;/p&gt;&#xA;" OwnerUserId="13457" LastEditorUserId="13457" LastEditDate="2016-06-10T09:43:14.373" LastActivityDate="2017-03-26T18:58:20.143" Title="Introducing 1bp shocks to yield curve (and interpolation consequences)" Tags="&lt;interest-rates&gt;&lt;yield-curve&gt;&lt;interpolation&gt;&lt;curve-fitting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27545" PostTypeId="1" AcceptedAnswerId="27551" CreationDate="2016-06-10T09:37:36.077" Score="11" ViewCount="2764" Body="&lt;p&gt;I would like to extend the following question about FX Forward rates in stochastic interest rate setup: &lt;a href=&quot;https://quant.stackexchange.com/questions/25822/expectation-of-a-fx-forward?newreg=763bbe75445742c19d0d394dba15b0e4&quot;&gt;&amp;quot;Expectation&amp;quot; of a FX Forward&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We consider a FX process $X_t = X_0 \exp( \int_0^t(r^d_s-r^f_s)ds -\frac{\sigma^2}{2}t+ \sigma W_t)$ where $r^d$ and $r^f$ are stochastic processes not independent of the Brownian motion $W$. As we know the FX Forward rate is $F^X(t,T) = E_t^d\left[X_T \right]$ under the domestic risk-neutral measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is how to show that $F^X(t,T) = X_t \frac{B_f(t,T)}{B_d(t,T)}$ where $B_d(t,T)$ and $B_f(t,T)$ are respective the domestic and foreing zero-coupon bond prices of maturity $T$ at time $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since &#xA;$X_T = X_t \exp\left( \int_t^T(r^d_s-r^f_s)ds+ \sigma (W_T-W_t)\right)$&#xA;\begin{align}&#xA;F^X(t,T) &amp;amp;= X_t E_t^d\left[\exp\left( \int_t^T(r^d_s-r^f_s)ds-\frac{\sigma^2}{2}(T-t) + \sigma (W_T-W_t)\right)\right]&#xA;\\&amp;amp; =X_t E_t^d\left[\exp\left( \int_t^T(r^d_s-r^f_s)ds \right) \frac{\mathcal E_T(\sigma W )}{\mathcal E_t(\sigma W )}\right]&#xA;\\&amp;amp;= X_t E_t^d\left[\exp\left( \int_t^T(r^d_s-r^f_s)ds \right) \frac{d\mathcal Q^f}{d\mathcal Q^d} \frac{1}{E_t^d \left[\frac{d\mathcal Q^f}{d\mathcal Q^d}\right]}\right] &#xA;\\&amp;amp;= X_t E_t^f\left[\exp\left( \int_t^T(r^d_s-r^f_s)ds \right) \right] &#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now how to conclude given that $r^d$ and $r^f$ are not necessarilly independent of each other since they both depend on the Brownian motion $W$ (by the way let's assume we working in the natural filtration of $W$)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I would like to extend my question to the pricing of non-deliverable&#xA;  FX forwards. I posted a new question for that here : &lt;a href=&quot;https://quant.stackexchange.com/questions/28330/fx-forward-pricing&quot;&gt;FX Forward pricing with correlation between FX and Zero-Cupon&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="22093" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-07-27T20:59:22.750" Title="FX forward with stochastic interest rates pricing" Tags="&lt;stochastic-calculus&gt;&lt;fx&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27546" PostTypeId="1" CreationDate="2016-06-10T09:44:23.060" Score="1" ViewCount="192" Body="&lt;p&gt;Notation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;t - time; G(t) - zero-coupon yield curve; $r$, $r_d$, $r_u$ - interest rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The task is to find market price of a bond for today, while knowing the price of a number of other bonds. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nelson-sigel model provides interest rate curve G(t). The next thing to do is to calibrate interest rate binomial tree using G(t). Also are known bond cash flow, par value and today market price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is how to do it properly. The start yield is given by G($t_1$), where $t_1$=0.25 (step for binomial model).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$100=\frac{1}{2}(\frac{100*G(t_2 )}{1+G(t_1)} +\frac{100*G(t_2 )+100}{(1+G(t_1))*(1+r_u )} + \frac{100*G(t_2 )}{1+G(t_1)} +\frac{100*G(t_2 )+100}{(1+G(t_1))*(1+r_d )})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_u= r_d*exp⁡(2*σ)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$t_2 = 2*t_1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These conditions provide $r_d$, $r_u$ for the second step of i.r. tree.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the next set of conditions for $r_{dd},r_{du},r_{uu}$  correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$1= \frac{1}{4} (\frac{G(t_3)}{1+G(t_1)}+\frac{G(t_3)}{(1+G(t_1))(1+r_d)}+\frac{(G(t_3)+1)}{(1+G(t_1))(1+r_d)(1+r_{dd})}) + \frac{1}{4}(\frac{G(t_3)}{1+G(t_1)}+\frac{G(t_3)}{(1+G(t_1))(1+r_d)}+\frac{(G(t_3)+1)}{(1+G(t_1))(1+r_d)(1+r_{ud})}) + \frac{1}{4}(\frac{G(t_3)}{1+G(t_1)}+\frac{G(t_3)}{(1+G(t_1))(1+r_u)}+\frac{(G(t_3)+1)}{(1+G(t_1))(1+r_u)(1+r_{ud})}) + \frac{1}{4}(\frac{G(t_3)}{1+G(t_1)}+\frac{G(t_3)}{(1+G(t_1))(1+r_u)}+\frac{(G(t_3)+1)}{(1+G(t_1))(1+r_u)(1+r_{uu})})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_{du}= exp⁡(2*σ) r_{dd}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_{uu}= exp⁡(2*σ) r_{ud}=exp⁡(4*σ) r_{dd}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$t_3=3*t_1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an easy way to define $r_{uuu}$, $r_{uuuu}$ and other interest rates (yields), so it would be possible to do it programmatically?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the ways to correctly determine σ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm heavily relying on ideas used in this presentation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://faculty.cbpa.drake.edu/root/Auvergne/DESS%20Analyst%20Binomial.ppt&quot; rel=&quot;nofollow&quot;&gt;http://faculty.cbpa.drake.edu/root/Auvergne/DESS%20Analyst%20Binomial.ppt&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="22092" LastEditorUserId="22092" LastEditDate="2016-06-20T18:22:29.830" LastActivityDate="2016-06-20T18:22:29.830" Title="Bonds with embedded options pricing via binomial model" Tags="&lt;fixed-income&gt;&lt;yield-curve&gt;&lt;valuation&gt;&lt;bond-yields&gt;&lt;lattice&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27548" PostTypeId="2" ParentId="16482" CreationDate="2016-06-10T12:00:24.980" Score="2" Body="&lt;p&gt;You can compute daily gross returns and then simply multiply them:&#xA;$R_w=\prod_i \left(1+R_i \right)-1$, where $R_i=P_{close,i}/P_{close,i-1}-1$&lt;/p&gt;&#xA;" OwnerUserId="22053" LastEditorUserId="12240" LastEditDate="2016-08-09T18:10:15.947" LastActivityDate="2016-08-09T18:10:15.947" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27550" PostTypeId="2" ParentId="27545" CreationDate="2016-06-10T12:44:12.023" Score="5" Body="&lt;p&gt;I think you should look at it the other way around.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $X_t$ denote the FOR/DOM spot exchange rate, i.e. 1 unit of foreign currency = $X_t$ units of domestic currency at time $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The FX forward rate $F^X(t,T)$ is &lt;strong&gt;defined&lt;/strong&gt; as &#xA;$$ F^X(t,T) = X_t \frac{B_f(t,T)}{B_d(t,T)} $$&#xA;by basence of arbitrage opportunity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To understand this, consider the following thought experiment. Let $C_0$ represent a cash amount denominated in the foreign currency. At $t=0$, you - an investor with initial capital $C_0$ - basically face a choice:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Invest in the foreign economy: buy $C_0/B^f(0,T)$ units of foreign zero-coupon bonds at $t=0$. This costs you $C_0$. At $t=T$, you shall receive (assuming no default): $C_0/B^f(0,T)$.&lt;/li&gt;&#xA;&lt;li&gt;Invest in the domestic economy: exchange your $C_0$ units of the foreign currency for $C_0 X_0$ units of domestic currency and buy $C_0 X_0/B^d(0,T)$ units of domestic zero-coupon bonds at $t=0$. This costs you $C_0 X_0$. At $t=T$, you shall receive (assuming no default): $C_0 X_0 / B^d(0,T)$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Now to preclude arbitrage opportunities, it is clear that the two strategies should be equivalent as seen of today. In other words, the fair forward exchange rate should be such that, what you receive when you invest $C_0$ in the foreign economy, converted at the fair forward rate, should match what you receive when you invest $C_0$ in the domestic economy. With the previous notations this writes: &#xA;$$ \left( C_0/B^f(0,T) \right) \times F^X(0,T) = C_0 X_0 / B^d(0,T)$$&#xA;hence&#xA;$$ F^X(0,T) = X_0 \frac{B^f(0,T)}{B^d(0,T)} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[REM 1]&lt;/strong&gt;: you need to consider bonds vs investing in the respective money market accounts when interest rates are stochastic, because the evolution of the money market accounts are not deterministic anymore: when you invest, you don't know what you'll get in the end. Buying bonds and assuming zero-default saves the day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[REM 2]&lt;/strong&gt;: As explained in Gordon's answer if you want to write the forward exchange rate as a martingale under a certain measure $\mathbb{X}$&#xA;$$ F^X(0,T) = X_0 \frac{B^f(0,T)}{B^d(0,T)} = \mathbb{E}^{\mathbb{X}}_0 \left[ X_T \underbrace{\frac{B^f(T,T)}{B^d(T,T)}}_{=1} \right] = \mathbb{E}_0^{\mathbb{X}} [ F(T,T) ]$$ you see that this measure is associated to the numéraire $B^d(t,T)$ since the last expression is equivalent to writing that:&#xA;$$ F(t,T) = \frac{X_t B^f(t,T)}{B^d(t,T)} \text{ is a } \mathbb{X} \text{ martingale} $$&#xA;and $\mathbb{X}$ is called the $T$-forward domestic measure, usually denoted $\mathbb{Q}^d_T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[REM3]&lt;/strong&gt;: If you're wondering whether your proposed SDE is &lt;strong&gt;consistent&lt;/strong&gt; with the above results, here's how you can convince yourself. Applying Itô's lemma to your SDE (expressed under the domestic risk-neutral measure $\mathbb{Q}^d$) and integrating from $t=0$ to $t=T$ gets you&#xA;$$ X_T = X_0 \exp\left(\int_0^T (r^d_t-r^f_t) dt - \frac{1}{2}\sigma^2 T + \sigma W_T^{\mathbb{Q}^d} \right) = X_0 \frac{B^d(T)}{B^f(T)}\mathcal{E}[\sigma W_T^{\mathbb{Q}^d}]$$&#xA;where I've used the notation $B(t)$ for the $t$-value of a money market account in the domestic/foreign economies where $1$ unit of currency has been invested at $t=0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The quanto change of measure then classically writes (see related SE questions)&#xA;$$ \left. \frac{d\mathbb{Q}^f}{d\mathbb{Q}^d} \right\vert_{\mathcal{F}_T} = \frac{X_T B^f(T)}{X_0 B^d(T)} = \mathcal{E}[\sigma W_T^{\mathbb{Q}^d}] $$&#xA;given the expression of $X_T$ found above (note how this is a Doléans-Dade exponential).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we would like to compute the fair forward price as an expectation under the domestic $T$-forward measure $\mathbb{Q}^d_T$ whose Radon-Nikodym derivative wrt $\mathbb{Q}^d$ reads:&#xA;$$ \left. \frac{d\mathbb{Q}^d_T}{d\mathbb{Q}^d} \right\vert_{\mathcal{F}_T} = \frac{1/B^d(T)}{B^d(0,T)} $$&#xA;(notice how this equals one for deterministic rates). We then have:&#xA;\begin{align}&#xA;F^X(0,T) &amp;amp;= \mathbb{E}^{\mathbb{Q}^d_T}_0[ X_T ] \\&#xA;         &amp;amp;= \mathbb{E}^{\mathbb{Q}^d}_0 \left[ X_T \left. \frac{d\mathbb{Q}^d_T}{d\mathbb{Q}^d} \right\vert_{\mathcal{F}_T} \right] = \mathbb{E}^{\mathbb{Q}^d}_0 \left[ X_T \frac{1/B^d(T)}{B^d(0,T)} \right] \tag{1} \\&#xA;         &amp;amp;= \frac{1}{B^d(0,T)} X_0 \mathbb{E}^{\mathbb{Q}^d}_0 \left[ \frac{1}{B^f(T)} \mathcal{E}[\sigma W_T^{\mathbb{Q}^d}] \right] \tag{2}  \\&#xA;         &amp;amp;= \frac{1}{B^d(0,T)} X_0 \mathbb{E}^{\mathbb{Q}^f}_0 \left[ \frac{1}{B^f(T)} \underbrace{\mathcal{E}[\sigma W_T^{\mathbb{Q}^d}] \left. \left(\frac{d\mathbb{Q}^f}{d\mathbb{Q}^d}\right)^{-1} \right\vert_{\mathcal{F}_T}}_{=1} \right] \tag{3}  \\&#xA;         &amp;amp;= X_0 \frac{B^f(0,T)}{B^d(0,T)} \tag{4}&#xA;\end{align}&#xA;where we have used:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Change of measure from the $T$-forward domestic measure $\mathbb{Q}^d_T$ to the dometic measure $\mathbb{Q}^d$ + expression of the corresponding Radon-Nikodym derivative&lt;/li&gt;&#xA;&lt;li&gt;Definition of $X_t$ solution of the original SDE provided under the domestic measure $\mathbb{Q}^d$&lt;/li&gt;&#xA;&lt;li&gt;Change of measure from domestic measure $\mathbb{Q}^d$ to foreign measure $\mathbb{Q}^f$ + expression of the corresponding Randon-Nikodym derivative&lt;/li&gt;&#xA;&lt;li&gt;Definition of the price of a zero-coupon bond under the foreign measure $\mathbb{Q}^f$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Conclusion you can safely use that SDE as it implies no blatant arbitrage issues.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-06-11T16:30:22.053" LastActivityDate="2016-06-11T16:30:22.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27551" PostTypeId="2" ParentId="27545" CreationDate="2016-06-10T13:19:45.510" Score="8" Body="&lt;p&gt;The formula $F^X(t,T) = E_t^d\left(X_T \right)$, under the domestic risk-neutral measure, is problematic. Note that, at time $t$, the forward exchange rate $F^X(t,T)$, for maturity $T$, is the exchange rate such that the payoff $X_T-F^X(t,T)$ has a zero value at $t$. That is,&#xA;\begin{align*}&#xA;B_t^d E_d\left(\frac{X_T-F^X(t,T)}{B_T^d} \mid \mathcal{F}_t\right)=0,&#xA;\end{align*}&#xA;where $E_d$ is the expectation under the domestic risk-neutral measure $Q_d$.&#xA;Here, $B_t^d$ and $B_t^f$ denote respectively the domestic and foreign money market account values.&#xA;Then,&#xA;\begin{align*}&#xA;F^X(t,T) &amp;amp;= \frac{1}{B_d(t, T)}B_t^d E_d\left(\frac{X_T}{B_T^d} \mid \mathcal{F}_t\right) \tag{1}\\&#xA;&amp;amp;\neq E_d(X_T \mid \mathcal{F}_t),&#xA;\end{align*}&#xA;under the stochastic interest rate assumption.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $Q_d^T$ be the domestic $T$-forward measure, and $E_d^T$ be the corresponding expectation operator. Then, for $0 \le t \le T$,&#xA;\begin{align*}&#xA;\frac{dQ_d}{dQ_d^T}\big|_t = \frac{B_t^d B_d(0, T)}{B_d(t, T)}.&#xA;\end{align*}&#xA;From $(1)$, &#xA;\begin{align*}&#xA;F^X(t,T) &amp;amp;= \frac{1}{B_d(t, T)}B_t^d E_d\left(\frac{X_T}{B_T^d} \mid \mathcal{F}_t\right)\\&#xA;&amp;amp;=\frac{1}{B_d(t, T)}B_t^d E_d^T\left(\frac{X_T}{B_T^d} \frac{\frac{dQ_d}{dQ_d^T}\big|_T}{\frac{dQ_d}{dQ_d^T}\big|_t}\mid \mathcal{F}_t\right)\\&#xA;&amp;amp;=\frac{1}{B_d(t, T)}B_t^d E_d^T\left(\frac{X_T}{B_T^d} \frac{B_T^dB_d(t, T)}{B_t^d}\mid \mathcal{F}_t\right)\\&#xA;&amp;amp;= E_d^T\left(X_T\mid \mathcal{F}_t\right).\tag{2}&#xA;\end{align*}&#xA;That is, it is the expectation of the spot exchange rate at maturity $T$, under the $T$-forward measure rather than the risk-neutral measure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Back to Formula $(1)$. Let $Q_f$ be the foreign risk-neutral measure and $E_f$ be the corresponding expectation operator. Then, for $t\ge 0$,&#xA;\begin{align*}&#xA;\frac{dQ_d}{dQ_f}\big|_t = \frac{B_t^d X_0}{B_t^f X_t}.&#xA;\end{align*}&#xA;Moreover, &#xA;\begin{align*}&#xA;F^X(t,T) &amp;amp;= \frac{1}{B_d(t, T)}B_t^d E_d\left(\frac{X_T}{B_T^d} \mid \mathcal{F}_t\right)\\&#xA;&amp;amp;=\frac{1}{B_d(t, T)}B_t^d E_f\left(\frac{X_T}{B_T^d} \frac{\frac{dQ_d}{dQ_f}\big|_T}{\frac{dQ_d}{dQ_f}\big|_t}\mid \mathcal{F}_t \right)\\&#xA;&amp;amp;=\frac{1}{B_d(t, T)}B_t^d E_f\left(\frac{X_T}{B_T^d} \frac{B_T^d}{B_T^f X_T} \frac{B_t^fX_t}{B_t^d}\mid \mathcal{F}_t\right)\\&#xA;&amp;amp;=\frac{X_t}{B_d(t, T)}E_f\left(\frac{B_t^f}{B_T^f}\mid \mathcal{F}_t \right)\\&#xA;&amp;amp;=X_t\frac{B_f(t, T)}{B_d(t, T)}.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Additional information.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Combining with Formula $(2)$, &#xA;\begin{align*}&#xA;E_d^T(X_T \mid \mathcal{F}_t) &amp;amp;= E_d^T\left(X_T\frac{B^f(T, T)}{B_d(T, T)} \mid \mathcal{F}_t\right)\\&#xA;&amp;amp;=X_t\frac{B_f(t, T)}{B_d(t, T)}.&#xA;\end{align*}&#xA;That is, the forward exchange rate process $\left\{X_t\frac{B_f(t, T)}{B_d(t, T)}, 0 \le t \le T \right\}$ is a martingale under the domestic $T$-forward measure.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-06-10T18:56:53.220" LastActivityDate="2016-06-10T18:56:53.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27552" PostTypeId="1" CreationDate="2016-06-10T13:40:11.883" Score="1" ViewCount="446" Body="&lt;p&gt;From what I understand, Bloomberg Open Symbology is now transitioning to OpenFigi:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://bsym.bloomberg.com/sym/&quot; rel=&quot;nofollow&quot;&gt;http://bsym.bloomberg.com/sym/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;BSYM.bloomberg.com will be &lt;em&gt;SHUT-OFF&lt;/em&gt; on June 1st. It is being replaced by OpenFIGI.com.&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You could download a precanned file from BSYM (from &lt;a href=&quot;http://bdn-ak.bloomberg.com/precanned/..&quot; rel=&quot;nofollow&quot;&gt;http://bdn-ak.bloomberg.com/precanned/..&lt;/a&gt;.) however it seems that URL no longer has new files as of 6/9/2016.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does OpenFIGI have a similar precanned file URL?  (I know they have an API but I'm interested in the precanned file.)&lt;/p&gt;&#xA;" OwnerUserId="22095" LastActivityDate="2016-06-10T13:40:11.883" Title="Does OpenFIGI have precanned files?" Tags="&lt;bloomberg&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27553" PostTypeId="2" ParentId="25460" CreationDate="2016-06-10T13:48:50.857" Score="0" Body="&lt;p&gt;With respect I think that this issue was associated Martingale properties AND dominated convergence theorem.(May be Wrong) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $L\in(0,K)$ a fixed price, we can consider the following choices for the exercise of a put option with strike price $K$:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If $S_t\le K$, then we exercise contract at time $t$, and were delighted.&lt;/li&gt;&#xA;&lt;li&gt;O.W. we should wait until the first hitting time(of course we can play &lt;strong&gt;PS4&lt;/strong&gt; until the first hitting time!!) &#xA;$$\tau_L=\inf \{u\ge t:S_u\le L \}$$&#xA;In case $S_T\le L$, the payoff will be $(K-S_t)^{+}$ since $K&amp;gt;L\ge S_t$.&#xA;In case $S_t &amp;gt; L$, the price of the option will&#xA;$$P_L(t,S_t)=E^{\mathbb{Q}}\left[e^{-r(\tau_L-t)}(K-S_{\tau_{L}})^+|S_t\right]$$&#xA;You know that the underlying asset price is written as&#xA;$$S_t=S_0e^{rt+W^{\mathbb{Q}}_t-\frac{1}{2}\sigma^2\,t}\,\,(1)$$&#xA;We claim &#xA;$$P_L(t,S_t=x)=\left\{ \begin{align}&#xA;  &amp;amp; K-x\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,,\,\,\,\,\,0&amp;lt;x\le L \\ &#xA; &amp;amp; (K-L){{\left( \frac{x}{L} \right)}^{-\frac{r}{2{{\sigma }^{2}}}}}\,,\,\,\operatorname{O}.W. \\ &#xA;\end{align} \right. &#xA;$$&#xA;As you see the starting date $t$ does not matter when pricing perpetual options hence $P_L(t, x)$ is actually independent of $t\in\mathbb{R}^+$, and the pricing of the perpetual put option can be performed by taking $t = 0$ and in the sequel we will work under $P_L(t,S_t)=P_L(S_t).$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Proof&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without loss of generality we take $t=0$&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The result is obvious for $S_0=x\le L&amp;lt;K$ since in this case we have $\tau_L=t$ and $S_{\tau_L}=S_0=x$ and we have&#xA;$$P_L(x)=E^{\mathbb{Q}}\left[e^{-r(t-t)}(K-x)^+|x\right]=K-x$$&lt;/li&gt;&#xA;&lt;li&gt;(Fasten seat belt) Noe we should consider difficult case, i.e. $S_0=x&amp;gt;L$ .We know &#xA;$$P_L(x)=E^{\mathbb{Q}}\left[e^{-r(\tau_L-0)}(K-S_{\tau_L})^+|S_0=x\right]=E^{\mathbb{Q}}\left[e^{-r\tau_L}(K-L)|S_0=x\right]$$&#xA;thus we just calculate $E^{\mathbb{Q}}\left[e^{-r\tau_L}|S_0=x\right]$. For this, we note that from $(1)$ for all $\lambda\in\mathbb{R}$ the process $\{Y_{\lambda}(t)\}_{t\ge 0}$ as defined&#xA;$$Y_{\lambda}(t):={\left(\frac{S_t}{S_0}\right)}^{\lambda} e^{-t(r\lambda-\lambda(1-\lambda)\sigma^2/2)}=e^{\lambda\sigma W^{\mathbb{Q}}_t-\frac{1}{2}\lambda^2\sigma^2\,t}$$ &#xA;&lt;strong&gt;is a martingale under the risk-neutral probability&lt;/strong&gt;. Choosing $\lambda$&#xA;such that&#xA;$$r=r\lambda-\frac{1}{2}\lambda(1-\lambda)\sigma^2$$&#xA;then $\lambda=1$ or $\lambda=-\frac{-2r}{\sigma^2}$. &lt;strong&gt;Choosing the negative solution&lt;/strong&gt;, we have $\mathbb Q(\tau_L&amp;lt;\infty)=1$ and the bound&lt;br&gt;&#xA;$$0\le Y_{\lambda}(t)={\left(\frac{S_t}{S_0}\right)}^{\lambda} e^{-t(r\lambda-\lambda(1-\lambda)\sigma^2/2)}={\left(\frac{S_t}{S_0}\right)}^{-\frac{2r}{\sigma^2}} e^{-tr}\le {\left(\frac{L}{S_0}\right)}^{-\frac{2r}{\sigma^2}} $$&#xA;since $r&amp;gt;0$ and $\lambda=-\frac{-2r}{\sigma^2}$. This yields &#xA;$${\left(\frac{L}{S_0}\right)}^{{-\frac{2r}{\sigma^2}}}E^{\mathbb{Q}}\left[e^{-r \tau_L}\right]=E^{\mathbb{Q}}\left[\left(\frac{S_{\tau_L}}{S_0}\right)^{-\frac{2r}{\sigma^2}}e^{-r\tau_L}\mathbb{1}_{\{\tau_L&amp;lt;\infty \}}\right]=E^{\mathbb{Q}}[Y_{\lambda}(t)\mathbb{1}_{\{\tau_L&amp;lt;\infty \}}]$$&#xA;as a result&#xA;$${\left(\frac{L}{S_0}\right)}^{{-\frac{2r}{\sigma^2}}}E^{\mathbb{Q}}\left[e^{-r \tau_L}\right]=E^{\mathbb{Q}}\left[\underset{t\to \infty }{\mathop{\lim }} Y_{\lambda}(\tau_L\wedge t)\right]=\underset{t\to \infty }{\mathop{\lim }}E^{\mathbb{Q}}\left[Y_{\lambda}(\tau_L\wedge t)\right]=E^{\mathbb{Q}}\left[Y_{\lambda}(0)\right]$$&#xA;Indeed we used the dominated convergence theorem,we have&#xA;$${\left(\frac{L}{S_0}\right)}^{{-\frac{2r}{\sigma^2}}}E^{\mathbb{Q}}\left[e^{-r \tau_L}\right]=E^{\mathbb{Q}}\left[Y_{\lambda}(0)\right]=1$$&#xA;In the oher words&#xA;$$E^{\mathbb{Q}}\left[e^{-r\tau_L}|S_0=x\right]={\left(\frac{x}{L}\right)}^{-\frac{r}{2\sigma^2}}\,\,\,\,\,,\,\,\,\,x&amp;gt;L$$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-06-10T16:24:15.743" LastActivityDate="2016-06-10T16:24:15.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27554" PostTypeId="2" ParentId="9313" CreationDate="2016-06-10T13:56:06.460" Score="1" Body="&lt;p&gt;Pretty much agree with what everyone is saying above.&#xA;Just want to add one more comment.&#xA;The sad truth of not advocating a lot on the usage of ML in Asset Management is &#xA;the difficulty to marketing it.&#xA;Most of the pitches on the quant portfolios are trying to make a systematic fundamental (these days called quantamenal) story. ML methods are apparently not in line with the quantamental story.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Last comment, act as a dual role of quant research and portfolio management, I presonally like ML a lot. ML signals could be with low correlation with traditional ones and provides the right direction of turnover in extreme periods where no diversification could be found among most of the traditional signals.&lt;/p&gt;&#xA;" OwnerUserId="22112" LastActivityDate="2016-06-10T13:56:06.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27555" PostTypeId="1" AcceptedAnswerId="27565" CreationDate="2016-06-10T14:15:17.473" Score="5" ViewCount="221" Body="&lt;p&gt;Is somebody aware whether there exist basket derivatives whose underlyings are either related to weather (e.g. temperature) or financial indices (e.g. S&amp;amp;P500)? It is essential that the payoff depends at least on one financial product AND one weather quantity. I'm thinking about something like a rainbow option with payoff:&#xA;$$max\{a_1(R_T-K_1), a_2(S_T-K_2),0\}$$&#xA;where $R_t$ is a temperature, $S_t$ is the S&amp;amp;P500 and $a_1$ and $a_2$ are constants.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NB: I'm not particularly interested in temperature, but it could be anything related to weather (e.g. snow, rain etc...). Nor I'm particular interested in specific payoff functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2016-06-12T17:39:08.033" Title="Basket derivatives on weather AND financial underlying?" Tags="&lt;exotics&gt;&lt;basket&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27556" PostTypeId="1" CreationDate="2016-06-10T14:59:51.153" Score="3" ViewCount="860" Body="&lt;p&gt;anyone who could help me interpreting and modifying this code?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a dataset and want to reserve the last 100 returns for out-of-sample analysis. After specifying and fitting the garch-spd-copula, in the for loop I fix a condition for $i=1$ and another for $i=2,...,100$, and compute these first calculations (presigma, preR, preQ, ...). Now, I want R to do the 1-step ahead forecast simulated 1000 times (n.sim=1 and m.sim=1000 in &lt;code&gt;cgarchsim&lt;/code&gt; command) while incrementally consider the &quot;extended&quot; dataset (consider T for forecasting T+1, consider T+1 for forecasting T+2, ...). I would like the end result to be a 100x3x1000 array (100: observations, 3: assets, 1000: simulations) of 1-step ahead forecasts.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;install.packages(&quot;rmgarch&quot;)&#xA;library(rmgarch)&#xA;&#xA;data(dji30retw)&#xA;Dat = dji30retw[, 1:3, drop = FALSE]&#xA;&#xA;uspec17 = ugarchspec(mean.model = list(armaOrder = c(0,0)), &#xA;             variance.model = list(garchOrder = c(1,1), model = &quot;sGARCH&quot;, variance.targeting=FALSE), &#xA;             distribution.model = &quot;norm&quot;)&#xA;spec17 = cgarchspec(uspec = multispec( replicate(3, uspec17) ), asymmetric = FALSE, &#xA;             distribution.model = list(copula = &quot;mvnorm&quot;, method = &quot;Kendall&quot;, &#xA;                                       time.varying = TRUE, transformation = &quot;spd&quot;))&#xA;fit17 &amp;lt;- cgarchfit(spec17, Dat, out.sample=100, spd.control=list(upper=0.95, lower=0.05, type=&quot;mle&quot;, kernel=&quot;normal&quot;),&#xA;         cluster=NULL, fit.control=list(eval.se=FALSE))&#xA;&#xA;T = dim(Dat)[1]-100&#xA;simMu = simS = filtMu = filtS = matrix(NA, ncol = 3, nrow = 100)&#xA;simCor = simC = filtC = filtCor = array(NA, dim = c(3,3,100))&#xA;colSd = function(x) apply(x, 2, &quot;sd&quot;)&#xA;specx17 = spec17&#xA;for(i in 1:3) specx17@umodel$fixed.pars[[i]] = as.list(fit17@model$mpars[fit17@model$midx[,i]==1,i])&#xA;setfixed(specx17)&amp;lt;-as.list(fit17@model$mpars[fit17@model$midx[,4]==1,4])&#xA;&#xA;for(i in 1:100){&#xA; if(i==1){&#xA; presigma = matrix(tail(sigma(fit17), 1), ncol = 3)&#xA; prereturns = matrix(unlist(Dat[T, ]), ncol = 3, nrow = 1)&#xA; preresiduals = matrix(tail(residuals(fit17),1), ncol = 3, nrow = 1)&#xA; preR = last(rcor(fit17))[,,1]&#xA; diag(preR) = 1&#xA; preQ = fit17@mfit$Qt[[length(fit17@mfit$Qt)]]&#xA; preZ = tail(fit17@mfit$Z, 1)&#xA; tmp = cgarchfilter(specx17, Dat[1:(T+1), ], filter.control = list(n.old = T))&#xA; filtMu[i,] = tail(fitted(tmp), 1)&#xA; filtS[i,] = tail(sigma(tmp), 1)&#xA; filtC[,,i] = last(rcov(tmp))[,,1]&#xA; filtCor[,,i] = last(rcor(tmp))[,,1]&#xA; } &#xA; else{&#xA; presigma = matrix(tail(sigma(tmp), 1), ncol = 3)&#xA; prereturns = matrix(unlist(Dat[(T+i-1), ]), ncol = 3, nrow = 1)&#xA; preresiduals = matrix(tail(residuals(tmp),1), ncol = 3, nrow = 1)&#xA; preR = last(rcor(tmp))[,,1]&#xA; diag(preR) = 1&#xA; preQ = tmp@mfilter$Qt[[length(tmp@mfilter$Qt)]]&#xA; preZ = tail(tmp@mfilter$Z, 1) &#xA; tmp = cgarchfilter(specx17, Dat[1:(T+i-1), ], filter.control = list(n.old = T))  		&#xA; filtMu[i,] = tail(fitted(tmp), 1)&#xA; filtS[i,] = tail(sigma(tmp), 1)&#xA; filtC[,,i] = last(rcov(tmp))[,,1]&#xA; filtCor[,,i] = last(rcor(tmp))[,,1]&#xA; }&#xA; sim17 = cgarchsim(fit17, n.sim = 1, m.sim = 1000, startMethod = &quot;sample&quot;, preR = preR, preQ = preQ, preZ = preZ,&#xA;                prereturns = prereturns, presigma = presigma, preresiduals = preresiduals, cluster = NULL)&#xA; simx = t(sapply(sim17@msim$simX, FUN = function(x) x[1,]))&#xA; simMu[i,] = colMeans(simx)&#xA; simC[,,i] = sim17@msim$simH[[1]][,,1]&#xA; simCor[,,i] = sim17@msim$simR[[1]][,,1]&#xA; simS[i,] = sqrt(diag(simC[,,i]))&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, if I run this, as conditional returns (&lt;code&gt;sim17@msim$simX&lt;/code&gt;) I obtain three 1-step ahead forecasts simulated 1000 times, no trace of the remaining 99 values to be estimated. Any idea why, and how to modify the code in order to have 100 estimates?&lt;/p&gt;&#xA;" OwnerUserId="20573" LastActivityDate="2019-06-13T12:03:30.373" Title="Forecasting conditional returns in DCC-GARCH-copula approach in R" Tags="&lt;r&gt;&lt;garch&gt;&lt;simulations&gt;&lt;forecasting&gt;&lt;copula&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27557" PostTypeId="2" ParentId="27555" CreationDate="2016-06-10T16:03:08.157" Score="1" Body="&lt;p&gt;This is not a direct answer to your question as I am not sure whether the instrument you described exists, but OP would probably find the mathematics behind &lt;em&gt;transmission congestion contracts&lt;/em&gt; very interesting. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Transmission congestion contracts enable the hedging of fluctuations in electricity prices across the power grid, and are auctioned off by regional utilities operators. When demand for electricity in a certain area outstrips the immediate supply, electricity prices and operator expenses increase as the grid transmits power from more distant locations. These contracts derive their value from the demand for power at any one of thousands of transmission points (power stations). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;They are not basket derivatives and there is no &lt;em&gt;direct&lt;/em&gt; relation to weather in the pricing formulae, but as you could probably guess there is a strong correlation with weather in the value of these contracts. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;General pricing inefficiencies, heat waves, blizzards, outages etc. can all make for highly profitable arbitrage opportunities. Trading firms large and small have successfully entered these markets in the past 10 years, arguably to the detriment of the power operators these contracts were designed to benefit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.nytimes.com/2014/08/15/business/energy-environment/traders-profit-as-power-grid-is-overworked.html?_r=0&quot; rel=&quot;nofollow&quot;&gt;http://www.nytimes.com/2014/08/15/business/energy-environment/traders-profit-as-power-grid-is-overworked.html?_r=0&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.computer.org/csdl/proceedings/hicss/2005/2268/02/22680059a.pdf&quot; rel=&quot;nofollow&quot;&gt;https://www.computer.org/csdl/proceedings/hicss/2005/2268/02/22680059a.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="22051" LastActivityDate="2016-06-10T16:03:08.157" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27559" PostTypeId="1" AcceptedAnswerId="27572" CreationDate="2016-06-10T17:44:08.367" Score="5" ViewCount="11540" Body="&lt;p&gt;I am looking for open source software which can download stock data (yahoo/google finance etc) and used for screening/scanning stocks using technical analysis, for example: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;return stock list if close price is greater than 10 period moving average, or &lt;/li&gt;&#xA;&lt;li&gt;return stock list if upper bolinger band is greater than stock close price etc&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Can anyone suggest similar open source software?&lt;/p&gt;&#xA;" OwnerUserId="16754" LastEditorUserId="18728" LastEditDate="2016-06-12T08:03:07.273" LastActivityDate="2016-08-15T20:43:27.167" Title="Open source software for stock screening and scanning using technical analysis?" Tags="&lt;r&gt;&lt;python&gt;&lt;software&gt;&lt;technical-analysis&gt;&lt;opensource&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27560" PostTypeId="2" ParentId="27539" CreationDate="2016-06-10T18:13:34.957" Score="8" Body="&lt;p&gt;If you take Quantuple's stuff a little further, you can really see whether you're long skew. You can pretty easily see the dependence on convexity too (though it should be obvious that you're long convexity).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So first off, we need some smile parametrisation that lets us easily control convexity and skew. I just went with a made up one;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathrm{convexity} = \mathrm{C} = \left. \frac{\partial^2 \sigma}{\partial K^2} \right|_{K=F} \\&#xA;\mathrm{skew} = \mathrm{S} = \left. \frac{\partial \sigma}{\partial K} \right|_{K=F} \\&#xA;\sigma_{\mathrm{atm}} = \sigma(F)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which gives:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{1}{2} C (K-F)^2 + S(K-F) + \sigma_\mathrm{atm}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;*Note that i understand this is not a proper smile, i'm just using it as a simple example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then if you look a pretty extreme range of smiles;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;-0.001 \leqslant \mathrm{S} \leqslant 0.001\\&#xA;0 \leqslant \mathrm{C} \leqslant 0.0001\\&#xA;\sigma_\mathrm{atm} = 20\%&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you get a bunch of images like Quantuple's in the other answer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/0EcRI.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/0EcRI.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/LnYU4.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/LnYU4.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/8etQR.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/8etQR.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/5JGlm.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/5JGlm.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, we can do better:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/wdOXH.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/wdOXH.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So yes, you are long skew. But only a really tiny amount - you're much longer convexity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's python code for this if you want to mess around with it.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import numpy as np&#xA;&#xA;def CND(X):&#xA;  a1,a2,a3,a4,a5 = 0.31938153, -0.356563782, 1.781477937, -1.821255978, 1.330274429&#xA;  L = np.abs(X)&#xA;  K = 1.0 / (1.0 + 0.2316419 * L)&#xA;  w = 1.0 - 1.0 / np.sqrt(2*np.pi)*np.exp(-L*L/2.) * (a1*K + a2*K*K + a3*np.power(K,3) + a4*np.power(K,4) + a5*np.power(K,5))&#xA;  if X&amp;lt;0:&#xA;    w = 1.0-w&#xA;  return w&#xA;&#xA;def BlackSholes(cp,S,X,T,r,v):&#xA;  d1 = (np.log(S/X)+(r+v*v/2.)*T)/(v*np.sqrt(T))&#xA;  d2 = d1-v*np.sqrt(T)&#xA;  if cp=='c':&#xA;    return S*CND(d1)-X*np.exp(-r*T)*CND(d2)&#xA;  else:&#xA;    return X*np.exp(-r*T)*CND(-d2)-S*CND(-d1)&#xA;&#xA;def C(S,X,T,r,v):&#xA;    return BlackSholes(&quot;c&quot;, S, X, T, r, v)&#xA;def P(S,X,T,r,v):&#xA;    return BlackSholes(&quot;p&quot;, S, X, T, r, v)&#xA;&#xA;def B(r,t):&#xA;    return np.exp(-r*t)&#xA;&#xA;def vol(k, vol_atm, convexity, skew, atm=100, max_vol=1):&#xA;    v = 0.5*convexity*k**2 + (skew - convexity*atm)*k + vol_atm + 0.5*convexity*atm**2 - skew*atm&#xA;    return max(1e-5,min(v, max_vol))&#xA;&#xA;import scipy.integrate as integrate&#xA;import scipy.special as special&#xA;def var_swap(S,T,r,atm_vol, convexity, skew):&#xA;    F = S/B(r,T)&#xA;    return np.sqrt((2 / (T*B(r,T))) * (integrate.quad(lambda k: P(S, k, T, r, vol(k, atm_vol, convexity, skew, atm=F)) * k**-2, 0, F)[0] + integrate.quad(lambda k: C(S, k, T, r, vol(k, atm_vol, convexity, skew, atm=F)) * k**-2, F, F*5)[0]))&#xA;&#xA;&#xA;r = 0.0&#xA;T = 1.0&#xA;S = 100.0&#xA;F = S/B(r,T)&#xA;print F&#xA;atm_vol = 0.2&#xA;convexity = 0.0001&#xA;skew = 0.001&#xA;&#xA;&#xA;ks = [k for k in range(1, int(F*2))]&#xA;&#xA;n_scenarios = 20&#xA;skews = np.linspace(-skew, skew, n_scenarios)&#xA;convexities = np.linspace(0, convexity, n_scenarios)&#xA;&#xA;plot_smiles = False&#xA;&#xA;if plot_smiles:&#xA;&#xA;  import colorsys&#xA;  blues = [colorsys.hsv_to_rgb(h, 1, 1) for h in np.linspace(0.5, 0.65, n_scenarios)]&#xA;  reds = [colorsys.hsv_to_rgb(h, 1, 1) for h in np.linspace(0.0, 0.15, n_scenarios)]&#xA;&#xA;  from matplotlib import pyplot&#xA;  fig = pyplot.figure()&#xA;  ax_smiles = fig.add_subplot(1,1,1)&#xA;  ax_opts = ax_smiles.twinx()&#xA;&#xA;  for i, (convexity, skew) in enumerate(zip(convexities, skews)):&#xA;    vols = [vol(k, atm_vol, convexity, skew, atm=F) for k in ks]&#xA;    opts = [BlackSholes(&quot;p&quot; if k &amp;lt; F else &quot;c&quot;, S, k, T, r, vol(k, atm_vol, convexity, skew, atm=F)) * k**-2 for k in ks]&#xA;&#xA;    ax_smiles.plot(ks, vols, color=blues[i])&#xA;    ax_opts.plot(ks, opts, color=reds[i])&#xA;&#xA;  pyplot.show()&#xA;&#xA;else:&#xA;&#xA;  CC = np.linspace(0, convexity,n_scenarios)&#xA;  SS = np.linspace(-skew, skew,n_scenarios)&#xA;&#xA;  CC, SS = np.meshgrid(CC, SS)&#xA;&#xA;  VV = np.empty(CC.shape)&#xA;  for i in range(CC.shape[0]):&#xA;    for j in range(CC.shape[1]):&#xA;      VV[i,j] = var_swap(S, T, r, atm_vol, CC[i,j], SS[i,j])&#xA;&#xA;  from mpl_toolkits.mplot3d import Axes3D&#xA;  from matplotlib import cm&#xA;  from matplotlib.ticker import LinearLocator, FormatStrFormatter&#xA;  import matplotlib.pyplot as plt&#xA;&#xA;  fig = plt.figure()&#xA;  ax = fig.gca(projection='3d')&#xA;  surf = ax.plot_surface(CC, SS, VV, rstride=1, cstride=1, cmap=cm.jet, linewidth=0, antialiased=True)&#xA;&#xA;  ax.set_xlabel(&quot;Convexity&quot;)&#xA;  ax.set_ylabel(&quot;Skew&quot;)&#xA;  ax.set_zlabel(&quot;Var. Swap par rate&quot;)&#xA;  ax.set_ylim(ax.get_ylim()[::-1])&#xA;&#xA;  plt.show()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There is a caveat here though - this is the theoretical value of a variance swap. The market does not trade these according to the theoretical value, there is a difference which I have not seen a way of accounting for yet. The solution to this is that you store a table of varswap par rate spreads which can be interpolated and applied to varswaps at the corresponding start and end dates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This spread does not come from stochastic vol, it seems to me to be some sort of insurance against unpleasantly large costs when &lt;em&gt;something&lt;/em&gt; happens. The alternative is trading corridor variance swaps (i.e. variance only accrues when the index is inside a corridor), to limit the likelihood of this downside.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can easily get skew exposure with trades like the above though, if variance is only accruing when the underlying is above/below a certain level, then you will be long/short skew when the underlying is near the barrier - because when you're only looking at one side of a point, skew and convexity have similar effects.&lt;/p&gt;&#xA;" OwnerUserId="19663" LastEditorUserId="19663" LastEditDate="2016-06-13T12:51:13.157" LastActivityDate="2016-06-13T12:51:13.157" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="27562" PostTypeId="1" CreationDate="2016-06-11T01:01:20.330" Score="3" ViewCount="167" Body="&lt;p&gt;As a 3rd year undergraduate Economics student, I want to write my undergraduate thesis on Risk Analysis of bank failures. I want to prepare my theoretical background in summer time before the starting my senior year.&lt;strong&gt;So, what would be the minimum relevant sequence of study in my case to write an undergraduate thesis about risk theory.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My relevant background, non-measure theoretic probability &amp;amp; statistics ( read Newbold's Statistics for Business and Economics + Wackerly's Mathematical Statistics) ,  undergraduate level Econometrics ( read Gujarati's Basic Econometrics + Wooldridge's Introductory Econometrics + first few chapters of Davidson &amp;amp; Mackinnon's Econometric Theory and Methods) + Undergraduate level Linear Algebra + Advanced Calculus course series which constitutes topics such as  intro to Point set topology and real analysis + Riemann Integration Theory and Differential Calculus. I have not taken any Risk Theory or Actuarial Mathematics courses. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please give some field &amp;amp; topics recommendation so that i smoothly go into the target topics. Additionally, give some self-study textbook recommendations of your field recommendation.&lt;/p&gt;&#xA;" OwnerUserId="19927" LastEditorUserId="19927" LastEditDate="2016-06-11T07:05:25.707" LastActivityDate="2016-10-09T17:46:41.737" Title="what would be the most parsimonous sequence of study?" Tags="&lt;reference-request&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="27563" PostTypeId="1" CreationDate="2016-06-11T02:43:04.893" Score="1" ViewCount="225" Body="&lt;p&gt;I would like to search through all US stocks (via SQL or another technology), and filter them by certain parameters (similar to a &lt;a href=&quot;http://finviz.com/screener.ashx&quot; rel=&quot;nofollow&quot;&gt;stock screener&lt;/a&gt;, but through an API rather than a user interface). Is there such API/WebService that will offer me a database of up-to-date US stocks, or allow me to search stocks by properties such as P/E ratio?&lt;/p&gt;&#xA;" OwnerUserId="22103" LastActivityDate="2016-06-11T02:43:04.893" Title="Is there a public SQL database for all US stocks?" Tags="&lt;data&gt;&lt;programming&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27564" PostTypeId="2" ParentId="27562" CreationDate="2016-06-11T08:26:23.317" Score="1" Body="&lt;p&gt;There are two main roots to risk analysis (as I see it):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Statistics&lt;/li&gt;&#xA;&lt;li&gt;Modelling&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;where the first is more real-world and requires data analytics, whereas the second is more academic/theoretical. Personally I am more of a theorist and will advocate the second approach, but to have the maths for the second is a bit of a step up, and is built around &lt;em&gt;stochastic calculus&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Modelling using Stochastic Calculus:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;@Quantes, It's good you took lectures from the maths department, and it seems like you have a sufficient grounding for normal calculus. As you mentioned though in order to understand how variance/risk adds and combines in a financial setting you will have to take a course in Stochastic Calculus, for which the starting point is normally an overview of measure theory. However, pick up any introductory book (many typically recommend &lt;strong&gt;Steele&lt;/strong&gt; or &lt;strong&gt;Shreve&lt;/strong&gt;) and skip ahead to Brownian motion, then martingales, then semi-martingales, Ito's lemma, and stochastic/Dolean exponential. The final two tools you will need are then Girsanov's Theorem and change of measure theory. Once you have learnt this you will be ample prepared for any course on mathematical finance!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That though just gives you the mathematical tools, as for an intuition into solving financial problems the only extra thing that I suspect would be well worth looking into is change of numeraire, (extension of change of measure).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The book which I personally would recommend, and think is both comprehensive and self contained enough to skip from chapter to chapter is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&quot;Introduction to Stochastic Calculus with Applications&quot; - 3rd Edition - Fima C Klebaner &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;albeit that is my own preference and maths level, and this will change between individuals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;With regards to your thesis: An Example topic&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can only make a guess about how what direction of risk analysis you would want to go into regarding your thesis, (you could learn all of the above and then look into many topics which don't use any of this). To have an idea about what sort of topics this will let you look into, here are a few examples.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Basic derivatives pricing theory (e.g. The Black-Scholes framework).&lt;/li&gt;&#xA;&lt;li&gt;Volatility modelling.&lt;/li&gt;&#xA;&lt;li&gt;Interest rate modelling and forward curves for fixed income markets.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The last of these I think is generally the most interesting (my own bias), but undoubtedly could be linked into a discussion of banking failures surrounding the US subprime mortgage crisis. E.g. having a mathematical idea of how mortgage products are priced and sold is not too difficult an idea qualitatively, the tricky quantitative bit is to put numbers on the risk (e.g. VaR), and to model the risk and sensitivities correctly. E.g. the prices quotes on US mortgage pools (cf. TBA products in the [Agency] MBS market) can be found by most suppliers (Bloomberg), and a large focus is on the risk analysis and interconnections between prepayment and default risk, which to understand quantitatively requires both statistics and a good grasp of financial calculus.&lt;/p&gt;&#xA;" OwnerUserId="21016" LastEditorUserId="21016" LastEditDate="2016-06-11T16:44:40.110" LastActivityDate="2016-06-11T16:44:40.110" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27565" PostTypeId="2" ParentId="27555" CreationDate="2016-06-11T08:53:19.023" Score="3" Body="&lt;p&gt;If you are looking for derivatives on weather (temperature, heating degree days, cooling degree days) and a financial &quot;index&quot;, I think your best bet would be to look for hybrid weather/commodity derivatives.   &lt;/p&gt;&#xA;" OwnerUserId="1739" LastActivityDate="2016-06-11T08:53:19.023" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27566" PostTypeId="1" AcceptedAnswerId="27567" CreationDate="2016-06-11T10:31:40.283" Score="1" ViewCount="1271" Body="&lt;p&gt;This question directly refers to the paper &quot;Capital Asset Pricing Mistakes: The Consistent Opportunities in Tail Hedged Equities&quot;, &lt;a href=&quot;http://www.universa.net/Universa_SpitznagelResearch_201501.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.universa.net/Universa_SpitznagelResearch_201501.pdf&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Very briefly put, an index is hedged by simultaneously buying out of the money put options (whose strike price is lower than the price of the index), so that if the index price crashes, the loss is offset by the payoff from the options. I can't exactly understand how the hedging portfolio is constructed. This is detailed in the last paragraph on page 2, which I quote here:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;...we can safely ascertain that from a risk-reward standpoint, an investment in the S&amp;amp;P 500 Index&#xA;  plus short-term Treasuries could be considered a benchmark for validating a tail hedge argument. Thus, we&#xA;  choose a vanilla 60/40 portfolio -- 60% invested in the S&amp;amp;P 500 and 40% in short-term Treasuries, rebalanced&#xA;  monthly. On the other hand, our tail-hedged portfolio consists of S&amp;amp;P 500 and out-of-the-money put options&#xA;  (specifically one delta which has a strike roughly 30-35% below spot) on the S&amp;amp;P 500. &lt;strong&gt;At the beginning of every&#xA;  calendar month, using actual option prices, the number of third-month options (with a maturity from 11 to 12&#xA;  weeks, and also carrying over the payoff from unexpired options) is determined such that the tail-hedged portfolio&#xA;  breaks even for a down 20% move in the S&amp;amp;P 500 over a month&lt;/strong&gt;...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So from what I understand, suppose at the beginning of June the index price is $2000$ and a $20\%$ OTM option (Strike price of $1600$) expiring in August end costs, say, $50$. I decide to buy $x$ shares of the index and $y$ options. If the index moves down $20\%$, a potential loss of $400x+50y$ (the cost of buying options is counted as a &quot;loss&quot;) must be offset by a gain of $400x+50y$ due to options at June end.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this mean that the price of each option should now be updated to $\frac{400x+50y}{y}$? Although this does make sense because the options would become at the money in case of a $20\%$ down move, obviously we can't be &lt;strong&gt;sure&lt;/strong&gt; that this indeed would be the price of each option at the end of June. So do we simulate the price of each option after one month and accordingly decide how many options to buy at the start of the month (say, using Monte Carlo simulation)?&lt;/p&gt;&#xA;" OwnerUserId="19057" LastActivityDate="2016-06-11T13:52:11.443" Title="Implementation of an option tail-hedging strategy" Tags="&lt;option-pricing&gt;&lt;portfolio-management&gt;&lt;hedging&gt;&lt;option-strategies&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27567" PostTypeId="2" ParentId="27566" CreationDate="2016-06-11T13:52:11.443" Score="2" Body="&lt;p&gt;So,  you simulate the pnl one month in advance in a scenario where the Index has moved down by 20%.   This is for options which are 30% + out of the money.  In your  example this would be August expiration and 1400 strike not the 1600 strike.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you are long X index shares,  as you said then you would lose 400x in one month's time. You buy Y puts to hedge that. You also know how much the puts currently cost (mkt price) say P1, and from that you can figure out the implied volatility they are trading at. &#xA;You have to guesstimate what the value of the puts would be in the after 1 month scenario call that P2.&#xA;This basic calculator here will help:&#xA;&lt;a href=&quot;http://www.option-price.com/&quot; rel=&quot;nofollow&quot;&gt;http://www.option-price.com/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The days til expiration input will change (to 8weeks),  the underlying price will change (from 2000 to 1600) and Crucially the volatility will also change.  It is difficult to estimate what it would be in this scenario.  Typically you would expect a 20% down move in an index in 1 month to correspond to a sizeable move up in volatility. If you read up a little more on vol that might help you get a handle on how to estimate this.&lt;br&gt;&#xA;&lt;a href=&quot;https://en.wikipedia.org/wiki/Volatility_smile&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Volatility_smile&lt;/a&gt; &#xA;You can probably assume the interest rates won't change &#xA;(although a tanking market might mean a rate cut)&#xA;So,  using your vol forecasting crystal ball you will get a price P2 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your hedged portfolio should have a pnl of 0.&#xA;So   Y*(P2-P1)-400X =0     You already know all of the other variables so you can solve for Y to see how many puts you should buy.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In reality the hedge will only perform as well as your estimate of the vol. &lt;/p&gt;&#xA;" OwnerUserId="22101" LastActivityDate="2016-06-11T13:52:11.443" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27568" PostTypeId="2" ParentId="27559" CreationDate="2016-06-11T15:49:14.247" Score="2" Body="&lt;p&gt;I would recommend using &lt;a href=&quot;https://www.python.org/&quot; rel=&quot;nofollow&quot;&gt;Python&lt;/a&gt; because it can be &lt;a href=&quot;https://www.python.org/downloads/windows/&quot; rel=&quot;nofollow&quot;&gt;downloaded for Windows&lt;/a&gt; or &lt;a href=&quot;https://www.python.org/downloads/mac-osx/&quot; rel=&quot;nofollow&quot;&gt;Mac&lt;/a&gt; and is available in almost all Linux repositories as standard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you have Python installed you can use any of the following links to see how to get your data&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.quantstart.com/articles/Downloading-Historical-Intraday-US-Equities-From-DTN-IQFeed-with-Python&quot; rel=&quot;nofollow&quot;&gt;https://www.quantstart.com/articles/Downloading-Historical-Intraday-US-Equities-From-DTN-IQFeed-with-Python&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/12433076/download-history-stock-prices-automatically-from-yahoo-finance-in-python&quot;&gt;https://stackoverflow.com/questions/12433076/download-history-stock-prices-automatically-from-yahoo-finance-in-python&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/leonth/bulk-download-quandl&quot; rel=&quot;nofollow&quot;&gt;https://github.com/leonth/bulk-download-quandl&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://pypi.python.org/pypi/googlefinance&quot; rel=&quot;nofollow&quot;&gt;https://pypi.python.org/pypi/googlefinance&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://code.activestate.com/recipes/511444-stock-prices-historical-data-bulk-download-from-in/&quot; rel=&quot;nofollow&quot;&gt;https://code.activestate.com/recipes/511444-stock-prices-historical-data-bulk-download-from-in/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and of course once you have your data you can screen it in situ on your pc however you want by, for example, using a technical analysis library such as &lt;a href=&quot;http://ta-lib.org/&quot; rel=&quot;nofollow&quot;&gt;TA Lib&lt;/a&gt; and/or writing your own custom screener in Python. An example of the latter can be seen at&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=Y4GHgJjIQnk&quot; rel=&quot;nofollow&quot;&gt;https://www.youtube.com/watch?v=Y4GHgJjIQnk&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="252" LastEditorUserId="252" LastEditDate="2016-06-12T18:33:41.703" LastActivityDate="2016-06-12T18:33:41.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27569" PostTypeId="1" AcceptedAnswerId="27631" CreationDate="2016-06-11T15:57:15.250" Score="1" ViewCount="506" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/LLUEW.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/LLUEW.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hi... I am comparing the log-volatility of two SV models with an application to MATLAB. Since I am a rookie in this field, I do not know if I am wrong in interpreting the graph. In my opinion the only thing I can say is that the standard SV model underestimate the volatility in the volatility is small but I am not sure of my graph. Have you ever seen something like that? Am I completely wrong?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here the references for the models:&#xA;for the SV-MA model see:&#xA;Chan, J.C.C. (2013). &lt;a href=&quot;https://cama.crawford.anu.edu.au/pdf/working-papers/2013/312013.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Moving Average Stochastic Volatility Models&#xA;with Application to Inflation Forecast, Journal of Econometric&lt;/a&gt;,&#xA;176 (2), 162-172.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and for the standard model see:&#xA;Chan, J.C.C. and Hsiao, C.Y.L (2014). &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2359838&quot; rel=&quot;nofollow noreferrer&quot;&gt;Estimation of Stochastic Volatility Models with Heavy Tails and Serial Dependence&lt;/a&gt;. In: I. Jeliazkov and X.S. Yang (Eds.),Bayesian Inference in the Social Sciences, 159-180, John Wiley &amp;amp; Sons, New York.&lt;/p&gt;&#xA;" OwnerUserId="22108" LastEditorDisplayName="user16651" LastEditDate="2016-06-12T08:03:24.647" LastActivityDate="2016-08-14T15:49:01.873" Title="Standard Stochastic Volatility Models VS Moving Average Stochastic Volatility Model" Tags="&lt;stochastic-volatility&gt;&lt;matlab&gt;&lt;econometrics&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27570" PostTypeId="1" CreationDate="2016-06-11T17:24:25.030" Score="1" ViewCount="63" Body="&lt;p&gt;I am modeling a sub-diffusive process where the particles follow geometric Brownian motion (GBM) with movement occurring after randomly distributed waiting times.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have set this up as a simulation to explore different distributions of waiting times, however the process is inefficient. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question: can trinomial trees be used to model sub-diffusive GBM? Since the path steps involve up/down movements or no change - was wondering if the waiting time can be built in by increasing the probability of no change in a specific way.&lt;/p&gt;&#xA;" OwnerUserId="22109" LastActivityDate="2016-06-11T17:24:25.030" Title="Can trinomial trees be used to model subdiffusion?" Tags="&lt;brownian-motion&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27572" PostTypeId="2" ParentId="27559" CreationDate="2016-06-11T20:59:47.990" Score="6" Body="&lt;p&gt;I think the most sophisticated solutions are to be found within the R universe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One package that comes to mind is the &lt;code&gt;quantmod package&lt;/code&gt;. You can use it to download data from Yahoo and Google finance, plot charts and filter your stocks using all kinds of technical indicators (that come with the package).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can be found on CRAN: &lt;a href=&quot;https://cran.r-project.org/web/packages/quantmod/index.html&quot; rel=&quot;noreferrer&quot;&gt;https://cran.r-project.org/web/packages/quantmod/index.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get you started: &lt;a href=&quot;http://www.quantmod.com/examples/&quot; rel=&quot;noreferrer&quot;&gt;http://www.quantmod.com/examples/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A gallery of some of the technical indicators: &lt;a href=&quot;http://www.quantmod.com/gallery/&quot; rel=&quot;noreferrer&quot;&gt;http://www.quantmod.com/gallery/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The full documentation (100 p.) can be found here: &lt;a href=&quot;https://cran.r-project.org/web/packages/quantmod/quantmod.pdf&quot; rel=&quot;noreferrer&quot;&gt;https://cran.r-project.org/web/packages/quantmod/quantmod.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2016-06-11T21:09:06.680" LastActivityDate="2016-06-11T21:09:06.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27573" PostTypeId="1" AcceptedAnswerId="27581" CreationDate="2016-06-11T23:30:16.400" Score="2" ViewCount="152" Body="&lt;p&gt;I understand that an investor who has a view on an underlying's variance would be tempted by a variance swap. But why would one prefer such a contract over another instrument whose value is based on volatility, eg. options ?&lt;/p&gt;&#xA;" OwnerUserId="19693" LastActivityDate="2016-06-12T15:22:25.883" Title="Why would one prefer variance swaps over other instruments?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;swaps&gt;&lt;variance&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27575" PostTypeId="2" ParentId="27573" CreationDate="2016-06-12T06:31:22.637" Score="5" Body="&lt;p&gt;The vega of an option is very dependent on the spot price. The vega of a variance or volatility swap is not. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2016-06-12T06:31:22.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27576" PostTypeId="1" CreationDate="2016-06-12T09:57:59.283" Score="4" ViewCount="138" Body="&lt;p&gt;Does the volatility parametrization that I have chosen give an underspecified model? Which volatility parametrization in the Libor Market Model would suit the best for the particular case described here under?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have implemented the Libor Market Model in Matlab and am simulating paths of forward Libor Rates under the spot measure, whose dynamics are given by&#xA;$$dL_n\left(t\right)=\sigma_n\left(t\right)L_n\left(t\right)\sum_{j=q\left(t\right)}^n \frac{\tau_j \rho_{j,n} \sigma_j\left(t\right)L_j\left(t\right)}{1+\tau_j L_j\left(t\right)}dt + \sigma_n\left(t\right)L_n\left(t\right)dW\left(t\right)$$&#xA;where&#xA;$$L_n\left(t\right):=L\left(t;T_n,T_{n+1}\right),$$&#xA;$$\tau_n = T_{n+1}-T_n,$$&#xA;For the volatility parametrization I have chosen:&#xA;$$\sigma_n\left(t\right) = \left(a+b\left(T_n-t\right)\right)e^{-c\left(T_n-t\right)}+d$$&#xA;where $a,b,c,d$ are constants and $T_n-t$ represents the time to maturity.&#xA;For the correlation I have taken&#xA;$$\rho_{i,j}\left(t\right) = e^{-\beta\left|i-j\right|}$$&#xA;with $\beta=0.05$ constant.&#xA;I have calibrated the Libor Market Model to the co-terminal market swaption volatilities 1Y15Y,2Y14Y,...,14Y1Y,15Y1Y. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After calibration, I see that the market swaption volatilities are not fitted accurately with this volatility parametrization consisting of 4 degrees of freedom. My question is if it is possible that this model is underspecified with this parametrization and if it would be a wise choice to choose another parametrization with more degrees of freedom if we are calibrating to 15 swaption vols. If so, which volatility parametrization would you recommend?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="19279" LastActivityDate="2016-06-12T09:57:59.283" Title="Volatility Parametrization Libor Market Model - Underspecified Model?" Tags="&lt;volatility&gt;&lt;calibration&gt;&lt;swaption&gt;&lt;parameter-estimation&gt;&lt;lmm&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27578" PostTypeId="1" CreationDate="2016-06-12T12:45:04.470" Score="1" ViewCount="256" Body="&lt;p&gt;I have two general questions regarding &quot;in-sample fitting vs. out-of-sample backtesting&quot; kind of analyses. Is there any relationship between the length of the data collected for in-sample fitting ($a$) and the length of the data reserved for out-of-sample performance ($b$)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should $a$ be longer than $b$? If yes by how much (in absolute or relative terms)? Or is it okay to have a longer $b$ than $a$? Is the 50:50 rule discussed in the following link justified? Is it used in academia or by practicioners? &lt;a href=&quot;https://quant.stackexchange.com/questions/1480/what-is-the-ideal-ratio-of-in-sample-length-to-out-of-sample-length&quot;&gt;What is the ideal ratio of in-sample length to out-of-sample length?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's now assume you somehow determined that $b$ is too long for $a$. Would you extend $a$ and reduce $b$ keeping $a+b$ unchanged? Or just reduce $b$, and thus reducing the length of the testing period?&lt;/p&gt;&#xA;" OwnerUserId="20573" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-06-12T12:45:04.470" Title="Relationship between in-sample and out-sample periods length" Tags="&lt;backtesting&gt;&lt;forecasting&gt;&lt;estimation&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27579" PostTypeId="1" AcceptedAnswerId="27602" CreationDate="2016-06-12T13:09:51.183" Score="1" ViewCount="1609" Body="&lt;p&gt;I'm preparing a report on the different Greeks used in risk measurement, and my boss mentioned the inflation delta within the first-order Greeks (and the Inflation Vega, but I guess that if I figure out the first, I will get the latter as well).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anybody know what is commonly referred to as &quot;inflation delta&quot; of a derivative?&lt;/p&gt;&#xA;" OwnerUserId="20507" LastActivityDate="2016-06-14T00:47:00.230" Title="What is the &quot;inflation delta&quot; of an option?" Tags="&lt;derivatives&gt;&lt;greeks&gt;&lt;inflation&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27580" PostTypeId="2" ParentId="1870" CreationDate="2016-06-12T14:57:55.770" Score="1" Body="&lt;p&gt;to add to chrisaycock's reply,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;J has Jd database (comercial) now.  Its a purer vector language than q, but can be used with the same simplicity.&lt;/p&gt;&#xA;" OwnerUserId="22117" LastActivityDate="2016-06-12T14:57:55.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27581" PostTypeId="2" ParentId="27573" CreationDate="2016-06-12T15:14:39.177" Score="3" Body="&lt;p&gt;Clearly, from a theoretical point of view, a varswap is a better way of capturing volatility change, since as mentioned by Mark Joshi a varswap has, by construction, a Vega that does not vary with the stock price. For a single option on the other hand the Vega is at maximum at a stock price $S^*$ roughly comparable to the strike price X and decays in a &quot;bell shaped&quot; fashion for stock price higher or lower than this. (The modal Vega stock price is $S^*=X\exp((-r-\frac{\sigma^2}{2})T$), &quot;below but close to X&quot;, as Mario Draghi would say).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you are betting on volatility and not on the stock price you would clearly prefer to have a fixed Vega (i.e. a fixed sensitivity to vol), unaffected by stock price movement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This could be also accomplished by having a &lt;em&gt;portfolio&lt;/em&gt; of options of various strikes, some above and some below the current stock price, so you have all bases covered if the stock price starts to move up or down between now and maturity. And, amazingly enough, it is by analyzing this strategy that theoreticians have come up with the formulas for valuing varswaps. It is the same logic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a practical point of view buying a static portfolio of many options is more difficult to deal with than buying a single varswap. The varswap is more convenient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But from a practical point of view the varswap also has a disadvantage. The varswaps are OTC instruments traded by a few major IBs only. (Unlike the CBOE traded index options). The prices of varswaps are not published in the WSJ or anywhere else, and as far as I know there has been no academic study of the varswap market pricing, liquidity, efficiency, etc. because the research data is not available. Until then therefore, I will personally stick with index options and VIX futures when I trade volatility.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-06-12T15:22:25.883" LastActivityDate="2016-06-12T15:22:25.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27582" PostTypeId="2" ParentId="27555" CreationDate="2016-06-12T17:39:08.033" Score="2" Body="&lt;p&gt;Please note that this is subjective, but I hope it can help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was told that Frozen Concentrated Orange Juice forward contracts (FCOJ) are used to have a proxy for weather risk.&#xA;&lt;a href=&quot;https://www.theice.com/products/30/FCOJ-A-Futures&quot; rel=&quot;nofollow&quot;&gt;https://www.theice.com/products/30/FCOJ-A-Futures&lt;/a&gt;&#xA;you can imagine have a look at other agricultural forwards, since for these kind of market, demand is linked to economy level (=your financial index) and offer is driven by weather conditions(=your $R$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It exists also a very limited market for Cat Bonds.&#xA;&lt;a href=&quot;https://en.wikipedia.org/wiki/Catastrophe_bond&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Catastrophe_bond&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And last, it exists weather derivatives, I know that some big power companies tried to push them in the past, but I worked recently for a big power company, and they stopped to use it as too risky for the seller and too expansive for the buyer. &lt;a href=&quot;https://en.wikipedia.org/wiki/Weather_derivative&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Weather_derivative&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-06-12T17:39:08.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27583" PostTypeId="2" ParentId="8472" CreationDate="2016-06-12T19:08:51.637" Score="-2" Body="&lt;p&gt;Try Markit.com/RED a very reliable and accurate source &lt;/p&gt;&#xA;" OwnerUserId="22121" LastActivityDate="2016-06-12T19:08:51.637" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27584" PostTypeId="1" AcceptedAnswerId="27588" CreationDate="2016-06-12T19:34:14.693" Score="1" ViewCount="129" Body="&lt;p&gt;I just started reading Hull's &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0133456315&quot; rel=&quot;nofollow noreferrer&quot;&gt;book&lt;/a&gt;, and I got stuck in an example where a financial institution has sold for $300,000 a European call option on 100,000 shares of a non-dividend-paying stock.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Stock price is 49&lt;/li&gt;&#xA;&lt;li&gt;Strike price is 50&lt;/li&gt;&#xA;&lt;li&gt;$r$ is 0.05,&lt;/li&gt;&#xA;&lt;li&gt;vol is 20%,&lt;/li&gt;&#xA;&lt;li&gt;$T$ is 0.3846&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The example says&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Initially, the value of the written option is 240,000. In the&#xA;  situation depicted in Table 18.2, the value of the option can be&#xA;  calculated as 414,500 in Week 9. Thus, the financial institution has&#xA;  lost 174,500 on its short option position. Its cash position, as&#xA;  measured by the cumulative cost, is 1,442,900 worse in Week 9 than in&#xA;  Week 0. The value of the shares held has increased from 2,557,800 to&#xA;  4,171,100. The net effect of all this is that the value of the&#xA;  financial institution’s position has changed by only 4,100 between&#xA;  Week 0 and Week 9.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;table 18.2 is as follow,&#xA;&lt;a href=&quot;https://i.stack.imgur.com/rRTr3.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/rRTr3.png&quot; alt=&quot;table 18.2&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: where did the numbers  &lt;em&gt;4,171,100&lt;/em&gt; and &lt;em&gt;4,100&lt;/em&gt; come from?&lt;/p&gt;&#xA;" OwnerUserId="22122" LastEditorUserId="467" LastEditDate="2016-06-13T05:59:28.540" LastActivityDate="2016-06-13T05:59:28.540" Title="How to understand this example from Hull's book?" Tags="&lt;options&gt;&lt;delta&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27585" PostTypeId="2" ParentId="8478" CreationDate="2016-06-12T22:30:38.750" Score="9" Body="&lt;p&gt;&lt;strong&gt;Another Solution&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We should look for a solution of the form&#xA;&lt;span class=&quot;math-container&quot;&gt;$$X(t)=U(t)V(t)$$&lt;/span&gt; &#xA;where&#xA;&lt;span class=&quot;math-container&quot;&gt;$$dU_t=-\theta\,U_tdt+\sigma\,U_t\,dW_t$$&lt;/span&gt;&#xA;and&#xA;&lt;span class=&quot;math-container&quot;&gt;$$dV_t=\alpha(t)dt+\beta(t)dW_t$$&lt;/span&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$U$&lt;/span&gt; is a geometric Brownian motion, therefore &#xA;&lt;span class=&quot;math-container&quot;&gt;$$U(t)=U(0)\,e^{-(\theta+\frac{1}{2}\sigma^2)t+\sigma W_t}$$&lt;/span&gt;&#xA;let &lt;span class=&quot;math-container&quot;&gt;$U(0)=1$&lt;/span&gt;, this yields &lt;span class=&quot;math-container&quot;&gt;$V(0)=X(0)$&lt;/span&gt;. Now we should find &lt;span class=&quot;math-container&quot;&gt;$\alpha(t)$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$\beta(t)$&lt;/span&gt;. &#xA;&lt;span class=&quot;math-container&quot;&gt;$$dX_t=U_tdV_t+V_tdU_t+d[U,V](t)$$&lt;/span&gt;&#xA;we have&#xA;&lt;span class=&quot;math-container&quot;&gt;$$dX_t=(\alpha (t)U_t-\theta\,X_t+\sigma\beta(t)U_t)dt+(\beta(t)U_t+\sigma\,X_t)dW_t$$&lt;/span&gt;&#xA;thus &lt;span class=&quot;math-container&quot;&gt;$\beta(t)=0$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$\alpha(t)U_t=\mu\,\theta$&lt;/span&gt;, as a result&#xA;&lt;span class=&quot;math-container&quot;&gt;$$dV_t=\frac{\mu\theta}{U_t}dt$$&lt;/span&gt;&#xA;in the other words&#xA;&lt;span class=&quot;math-container&quot;&gt;$$V_t=V_0+\mu\theta\int_{0}^{t}\frac{1}{U_s}ds$$&lt;/span&gt;&#xA;finally&#xA;&lt;span class=&quot;math-container&quot;&gt;$$X_t=U_tV_t=e^{-(\theta+\frac{1}{2}\sigma^2)t+\sigma W_t}\left(X(0)+\mu\theta\int_{0}^{t}e^{(\theta+\frac{1}{2}\sigma^2)s-\sigma W_s}\right)$$&lt;/span&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$$X_t=e^{-(\theta+\frac{1}{2}\sigma^2)t+\sigma W_t}+\mu\theta\int_{0}^{t}e^{-(\theta+\frac{1}{2}\sigma^2)(t-s)+\sigma (W_t-W_s)}ds$$&lt;/span&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorUserId="20454" LastEditorDisplayName="user16651" LastEditDate="2019-02-09T13:13:51.283" LastActivityDate="2019-02-09T13:13:51.283" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="27586" PostTypeId="1" CreationDate="2016-06-12T23:18:15.450" Score="2" ViewCount="68" Body="&lt;p&gt;I'm modeling GARCH-filtered standardized residuals via semiparametric distribution with Gaussian kernel and GPD (generalized pareto distribution) tails with thresholds at 5% and 95%. For some series I'm considering I have negative shape parameters $\xi$, which imply a finite left/right endpoint equal to $-\frac{\beta}{\xi}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, in the testing period (out-of-sample analysis) I use the quantile function to convert copula realizations into standardized residuals through the inverse CDF. I get the following warning:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Warning messages:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;In log(1 + (xi * (as.vector(exceedances) - u))/beta) :&#xA;    Si è prodotto un NaN&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;NaNs are produced in the logarithm expression ($\xi$ shape parameter, $\beta$ scale parameter, $u$ threshold, $x$ value over the threshold). To check what that means, I solve&#xA;$$1 + \xi  \frac{(x-u)}{\beta}\leq0$$&#xA;when $\xi$ is negative&#xA;$$x-u\geq-\frac{\beta}{\xi}$$&#xA;implying that somewhere in the future I have an excess over the threshold which exceeds the bound implied by negative $\xi$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I manually verified that the message wasn't true (in the out-of-sample dataset I NEVER have standardized residuals which exceed the 5% and 95% thresholds by more than $-\frac{\beta}{\xi}$), I decided to verify this with R using this code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;p &amp;lt;- 0&#xA;for (i in 1:2){&#xA;  for (j in 1:9){&#xA;    for (z in 1:100){&#xA;      if (is.nan(ronaldo[i,j,z])==TRUE) {p=1}&#xA;    }&#xA;  }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In ronaldo$[i,j,z]$ I've stored the results of the conditional means at day $i$ of asset $j$ obtained in simulation $z$ (obtained by: i. inverse of CDF of copula realizations; ii. insert in GARCH formula; iii. compute conditional mean). [yes, Ronaldo is my favorite player, and I mean the brazilian Fenomeno]. I should get $p=1$ if any value stored in ronaldo is NaN, right? Well, $p=0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible? Is it possible that R produces a message which isn't verified by the results? Already at a graphical inspection everything seemed alright (I only had numerical values stored in ronaldo), and that little trick with $p$ verifies this. Am I justified in &quot;moving on&quot; and ignoring the message since I don't have NaNs?&lt;/p&gt;&#xA;" OwnerUserId="20573" LastActivityDate="2016-06-12T23:18:15.450" Title="False warning messages in R, is it possible?" Tags="&lt;time-series&gt;&lt;r&gt;&lt;garch&gt;&lt;copula&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27587" PostTypeId="1" CreationDate="2016-06-12T23:22:15.950" Score="-1" ViewCount="1495" Body="&lt;p&gt;Let us assume that we have a foreign asset with volatility $\sigma_{ASSET}$. Now, I know that when pricing this under the foreign measure, I need to do a drift adjustment, namely $\sigma_{ASSET NEW}^2 = \sigma_{ASSET}^2 + \sigma_{FX}^2 +2\rho\sigma_{ASSET}\sigma_{FX}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, I know that this can be FX hedged. My question is, what happens to this volatility when I hedge &lt;strong&gt;continuously?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My thinking is that anything to do with FX should be removed, but I can't justfiy this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I'm further clarifying what I am after. In trying to find the volatility of a hedged asset (hedged against FX), I determine the volatility by looking at the payoff in domestic units. That is,&#xA;$S_T X_T + \sum_{i=1}^N S_{t_{i-1}}(F_{t_{i-1},t_i}^X-X_{t_i})$, where $N$ is the number of hedges such that $t_N = T$, and $T$ is the maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I come up with a volatility using moment matching (which looks really messy so I won't post here unless required). Now I am looking at what happens as the increments between the hedges gets smaller. That is, $N\rightarrow \infty$ and $t_i-t_{i-1}\rightarrow 0$. What I think may happen is as described above, where anything to do with the FX is altogther gone from the volatility. However, that doesn't seem to be  the case with the volatility I have. Is my approach invalid?&lt;/p&gt;&#xA;" OwnerUserId="22125" LastEditorUserId="22125" LastEditDate="2016-06-13T10:05:48.917" LastActivityDate="2016-06-13T10:05:48.917" Title="Quanto derivatives and FX risk management" Tags="&lt;volatility&gt;" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="27588" PostTypeId="2" ParentId="27584" CreationDate="2016-06-13T02:05:17.350" Score="1" Body="&lt;p&gt;If you compute the cumulative sum of the 'Shares Purchased' column you will find that in Week 9 the company owns a total of 78,700 shares. Each share is worth 53.00 (see 'Stock Price' column), so the value of the shares held in Week 9 is 78700*53 = 4,171,100.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;em&gt;increase&lt;/em&gt; in share value is 4,171,100-2,557,800 = 1,613,300&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The loss in the option position is -174,500&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The debit in the cash position is -1,442,900 (=4,000,700-2,557,800 in the 6th column)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Combining these three elements (one positive and two negatives) we have 4100 dollars.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2016-06-13T02:05:17.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27589" PostTypeId="2" ParentId="27579" CreationDate="2016-06-13T07:28:25.657" Score="0" Body="&lt;p&gt;Inflation delta is typically used in the field of fixed income and is defined as sensitivity of the the present value of cash flows to the changes in the inflation curve. In business it is used to measure the inflation risk in the portfolio relative to the liabilities.&lt;/p&gt;&#xA;" OwnerUserId="18663" LastActivityDate="2016-06-13T07:28:25.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27590" PostTypeId="2" ParentId="27587" CreationDate="2016-06-13T07:38:54.633" Score="0" Body="&lt;p&gt;When you are hedging through FX then there are two factors influencing the impact that currency will have on the portfolio: the volatility of currency relative to that of the underlying asset and the interaction between currency and the underlying asset. The larger the volatility ratio ( volatility foreign currency/volatility asset ), the greater the impact of the foreign-currency exposure on the portfolio’s volatility.The lower the volatility ratio, the more important the asset–currency correlation will be in determining the portfolio risk outcome. It is the net effect of the two influences that determines&#xA;whether total portfolio risk is increased or decreased by hedging the foreign-currency exposure.&lt;/p&gt;&#xA;" OwnerUserId="18663" LastActivityDate="2016-06-13T07:38:54.633" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27591" PostTypeId="2" ParentId="27587" CreationDate="2016-06-13T08:57:28.443" Score="0" Body="&lt;p&gt;&lt;strong&gt;[Answer]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well yes, this comes from the interpretation of an option price as the initial endowment of a perfect replicating portfolio. Here the replication consists in holding a self-financing portfolio of shares + foreign/domestic bonds where one dynamically re-balances the delta continuously (assuming all usual assumptions hold: i.e. no transaction consts etc.).&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I recommend you read section 3.2 of &lt;a href=&quot;http://wwwf.imperial.ac.uk/~mdavis/course_material/MOP/MOP_NOTES.PDF&quot; rel=&quot;nofollow&quot;&gt;this document&lt;/a&gt;. Hedging of quanto options is specifically discussed in section 3.2.4. The interpretation of the hedging strategy p.33 is what matters to you.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Some details]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider an equity underlying  $S_t$ denominated in a foreign currency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the FOR/DOM exchange rate $X_t$, which is the price at time $t$ of one unit of foreign currency expressed in domestic currency. The DOM/FOR exchange rate at $t$ is obviously given by $Y_t=(X_t)^{-1}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume that both $S_t$ and $Y_t$ are lognormal under the &lt;em&gt;foreign risk-neutral measure&lt;/em&gt; $\mathbb{Q}^f$, with a linear correlation $\rho$ between their driving Brownian motions&#xA;$$ S_t^f \sim GBM(r^f, \sigma_{ASSET}) \iff S_t^f \sim N(\ln(F(0,t))-\frac{1}{2}\sigma_{ASSET}^2 t, \sigma_{ASSET}^2 t)$$&#xA;$$ Y_t \sim GBM(r^f - r^d, \sigma) \iff Y_t \sim N(\ln(F^Y(0,t))-\frac{1}{2}\sigma^2 t, \sigma^2 t)$$&#xA;where $F(0,t)$ denotes the equity forward in the foreign risk-neutral measure, and $F^Y(0,t)$ the forward DOM/FOR exchange rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the above, the price of the equity underlying expressed in domestic currency units, i.e. $S_t X_t$, is indeed a log-normally distributed random variable with variance:&#xA;$$ (\sigma_{ASSET}^2 + \sigma^2 + 2\rho \sigma_{ASSET} \sigma)t $$&#xA;this is because $S_t X_t$ is the product of 2 correlated log-normal variables (i.e. the log of $S_t X_t$ is a sum of two correlated normal variables. To see that $X_t$ is indeed lognormally distributed you may want to apply Itô's lemma to $X_t=1/Y_t$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, although this is true, I don't think it will be useful for what you are trying to prove, especially since you are dealing with &lt;strong&gt;quanto options&lt;/strong&gt; with payoff functions:&#xA;$$ \phi(S_T) = f(S_T), \text{e.g. } X^{quanto} (S_T-K)^+ $$&#xA;where $X^{quanto}$ is a constant (typically $X^{quanto}  = 1$) and not &lt;strong&gt;compo options&lt;/strong&gt; with payoff functions:&#xA;$$ \phi(S_T,X_T) = f(S_T X_T), \text{e.g. } (S_T X_T - K)^+ $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you look at a quanto option there are 2 things that matter:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;By construction, the price of a quanto option does not depend on the foreign exchange rate&lt;/li&gt;&#xA;&lt;li&gt;The delta of a quanto option naturally embeds the FX risk. This is because, although your option pays in the DOM currency (hence a delta in DOM units), you hedge by buying shares of the foreign underlying (hence in FOR units). Therefore, although you have a constant notional in DOM units, your delta notional in FOR units constantly changes due to the fluctuations of the exchange rate. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-06-13T09:24:56.543" LastActivityDate="2016-06-13T09:24:56.543" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27592" PostTypeId="1" CreationDate="2016-06-13T13:16:10.750" Score="1" ViewCount="201" Body="&lt;p&gt;I have a hard time understanding why the sharpe ratio corrresponding to the efficient portfolios is the highest possible. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my book, it states that the sharpe ratio of the efficient portfolios is the slope of the CML, and so if a portfolio had a higher sharpe ratio, it would lie on a line &quot;steeper&quot; than the CML, and then that would be efficient $\Longrightarrow$ contradiction. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But &lt;strong&gt;WHY&lt;/strong&gt; would it lie on the steeper line? What formula proves this (intuitively reasonable) argument? &lt;/p&gt;&#xA;" OwnerUserId="22133" LastActivityDate="2016-06-14T05:36:38.903" Title="Sharpe ratio highest amongst efficient portfolios?" Tags="&lt;sharpe-ratio&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27595" PostTypeId="2" ParentId="27468" CreationDate="2016-06-13T14:11:32.087" Score="1" Body="&lt;p&gt;I'm ot sure if it's the answer you're looking for but one commonly used method in practice is to simply take a long term average of the unemployment rate.  The long term in this context means a period which covers exactly a full business cycle (either peak to peak or trough to trough).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FYI.  US business cycle dates can be found here (&lt;a href=&quot;http://www.nber.org/cycles.html&quot; rel=&quot;nofollow&quot;&gt;http://www.nber.org/cycles.html&lt;/a&gt;).  A google search will return similar for the UK.&lt;/p&gt;&#xA;" OwnerUserId="3297" LastEditorUserId="3297" LastEditDate="2016-06-13T14:18:40.373" LastActivityDate="2016-06-13T14:18:40.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27597" PostTypeId="2" ParentId="25963" CreationDate="2016-06-13T15:36:51.390" Score="0" Body="&lt;p&gt;First, if you are using python for this, I would recommend that you take a look at &lt;a href=&quot;http://pandas.pydata.org/&quot; rel=&quot;nofollow&quot;&gt;pandas&lt;/a&gt; in general and the &lt;a href=&quot;http://pandas.pydata.org/pandas-docs/stable/remote_data.html&quot; rel=&quot;nofollow&quot;&gt;pandas data reader package&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If data reliability is a concern, I recommend that you self-verify by randomly selecting dates and assets, pulling data from multiple sources (like say yahoo, google, and &lt;a href=&quot;https://www.quandl.com/tools/python&quot; rel=&quot;nofollow&quot;&gt;Quandl&lt;/a&gt;) and checking them against each other and investigating any discrepancies.&lt;/p&gt;&#xA;" OwnerUserId="22136" LastActivityDate="2016-06-13T15:36:51.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27600" PostTypeId="1" AcceptedAnswerId="27608" CreationDate="2016-06-13T22:56:06.810" Score="6" ViewCount="1168" Body="&lt;p&gt;I have been asking this similar question before. However, I really want to be concrete and get and concrete explanation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been reading the paper by &lt;a href=&quot;https://www.rocq.inria.fr/mathfi/Premia/free-version/doc/premia-doc/pdf_html/Moreni_doc.pdf&quot; rel=&quot;noreferrer&quot;&gt;Moreni&lt;/a&gt; and try to implement the same methodology based on least-square monte carlo for both European and American put options.&#xA;They payoff function for both these puts is given by $f(t,S_t)=\max(K-S(t),0)$. The only difference is that for American case, we have payoffs in different times from simulations depending on the optimal stopping time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As usual we have the underlying stock price as geometric brownian motion:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS_t = r S_t dt + \sigma S_t dW_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreni introduces the change of drift in the underlying:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS_t = (r+\theta\sigma )S_t dt + \sigma S_t dW_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When simulating from the drifted process, we have to multiply the PAYOFF functions with the likelihood ratio defined as $L_\theta=\exp\{-\theta W_t+\frac{1}{2}\theta^2 t\}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;so we have $f(t,S_t)=\max(K-S(t),0)\cdot\exp\{-\theta W_t+\frac{1}{2}\theta^2 t\}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;instead of just $f(t,S_t)=\max(K-S(t),0)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea is of course to use negative values for $\theta$ so we get more &quot;in-the money paths&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I try to use these modified payoffs with the Longstaff and schwartz algorithm, I don't get any relevant results. The price gets extremly biased whichever value i use for $\theta$.&lt;br&gt;&#xA;My question is, should the estimated continuation values in least-square method also be modified with the likelihood ratio? In that case how? Or as mentioned in the article, ONLY the payoff functions be multiplied by the likelihood ratio??&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for your patience&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS* Added by request the steps that I use:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Generate $N$-scenarios of the drifted with $\theta$ geometric&#xA;brownian motion&lt;/li&gt;&#xA;&lt;li&gt;Save all the standard normal values $Z_t$ from the GBM for use in&#xA;the likelihood ratio.&lt;/li&gt;&#xA;&lt;li&gt;Create the likelihood ratio using the $Z_t$'s and for some value&#xA;$\theta$&lt;/li&gt;&#xA;&lt;li&gt;Use the likelihood ratio and set&#xA;$f(t,S_t)=\max(K-S(t),0)\cdot\exp\{-\theta W_t-\frac{1}{2}\theta^2&#xA;t\}$ for all paths&lt;/li&gt;&#xA;&lt;li&gt;Now run the Least-square algorithm from $t=T$ down to $t=0$ to&#xA;calculate all the continuation values and optimal stopping times.&lt;/li&gt;&#xA;&lt;li&gt;Take average of all the scenarios.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="18211" LastEditorUserId="18211" LastEditDate="2016-06-14T09:16:04.863" LastActivityDate="2016-06-14T10:26:14.297" Title="Importance Sampling for pricing options with longstaff and schwartz" Tags="&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;american-options&gt;" AnswerCount="2" CommentCount="9" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27601" PostTypeId="2" ParentId="25409" CreationDate="2016-06-13T23:39:15.080" Score="1" Body="&lt;p&gt;Have you considered Marginal Contribution to Total risk (MCTR)? You can decompose your risk across securities/sub-sectors/sectors, such that sum(weight of security * MCTR of security ) = portfolio risk (standard deviation). A good discussion on the topic can be found in &#xA;Active Portfolio Management: A Quantitative Approach for Producing Superior Returns and Controlling Risk &lt;/p&gt;&#xA;" OwnerUserId="5821" LastActivityDate="2016-06-13T23:39:15.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27602" PostTypeId="2" ParentId="27579" CreationDate="2016-06-14T00:47:00.230" Score="1" Body="&lt;p&gt;Typically one only thinks about inflation delta in the context of an inflation derivatives portfolio.  Then it is the sensitivity to a 1bp change in the zero coupon inflation rate for each maturity.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As others have mentioned, regular bonds are sensitive to inflation.  However we typically describe that risk as a risk to nominal interest rates, rather than explicitly a risk to inflation.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-06-14T00:47:00.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27603" PostTypeId="1" AcceptedAnswerId="27606" CreationDate="2016-06-14T04:57:47.037" Score="2" ViewCount="980" Body="&lt;p&gt;I am attempting to calculate the Greeks, and I understand their derivation. However when it comes to actually implementing Vega I am a little lost. Vega is defined analytically as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ SN'(d_1)\sqrt{T-t} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that it requires the first derivative of a normal distribution. I thought my probability knowledge was ok but I can't seem to find anything about its behavior, or how to implement the first derivative of a normal distribution programmatically. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone help me understand this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you! &lt;/p&gt;&#xA;" OwnerDisplayName="user20664" LastActivityDate="2016-06-14T08:43:37.780" Title="Understanding Vega calculation in black Scholes model" Tags="&lt;black-scholes&gt;&lt;vega&gt;&lt;black-scholes-merton&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27604" PostTypeId="2" ParentId="27592" CreationDate="2016-06-14T05:36:38.903" Score="2" Body="&lt;p&gt;The Sharpe Ratio is a direct measure of reward-to-risk. To see how it helps you in creating a portfolio, please consider the following graph:-&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Vx6FL.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Vx6FL.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Sharpe Ratio of X is the slope of the line joining cash with X&#xA;There are three important things to notice in this graph:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you take some investment like &quot;x&quot; and combine it with cash, the resulting portfolio will lie somewhere along the straight line joining cash with x. ( it's a straight line, not a curve; cash is riskless, so there's no &quot;damping out&quot; effect between cash and x.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Since you want the rate of return to be as great as possible, you want to select the x that gives you the line with the greatest possible slope (like we have done in the graph).&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The slope of this line is equal to the Sharpe Ratio of x.&lt;/p&gt;&#xA;" OwnerUserId="18663" LastActivityDate="2016-06-14T05:36:38.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27605" PostTypeId="2" ParentId="27600" CreationDate="2016-06-14T08:29:50.710" Score="0" Body="&lt;p&gt;I would suggest to use :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f(t,S^\theta_t)=\max(K-S^\theta_t,0)\exp(-\theta W_t\color{red}{\mathbf{-}}\frac{1}{2}\theta^2t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $dS^\theta_t=(r+\sigma\theta)S^\theta_t dt + \sigma S^\theta_t dW_t$&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-06-14T08:29:50.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27606" PostTypeId="2" ParentId="27603" CreationDate="2016-06-14T08:43:37.780" Score="2" Body="&lt;p&gt;You know&#xA;$$N(x)=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{x}e^{\frac{-u^2}{2}}du$$&#xA;then &#xA;$$N'(x)=\frac{1}{\sqrt{2\pi}}e^{\frac{-u^2}{2}}$$&#xA;therefore &#xA;$$\mathcal{V}=S_t\sqrt{\tau}N'(d_1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/KfE1C.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/KfE1C.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastActivityDate="2016-06-14T08:43:37.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27608" PostTypeId="2" ParentId="27600" CreationDate="2016-06-14T09:55:45.837" Score="3" Body="&lt;p&gt;Assuming deterministic interest rates, the price of an American call option struck at $K$ and expiring at $T$ is given by&#xA;$$ V_0 = \text{sup}_{\tau \in \mathcal{T}[0,T]} \mathbb{E}_0^\mathbb{Q}\left[ e^{-r\tau} \max(S_{\tau}-K, 0) \right] $$&#xA;where $\mathcal{T}[0,T]$ denotes a family of stopping times with values in $[0,T]$ and where, under the risk-neutral measure $\mathbb{Q}$, we assume $(S_t)_{t\geq 0}$ is a GBM&#xA;$$ \frac{dS_t}{S_t} = r dt + \sigma dW_t^{\mathbb{Q}} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Doing importance sampling boils down to computing the above price by simulating paths and computing the expectation not under the risk-neutral measure $\mathbb{Q}$, but rather, under a modified measure $\mathbb{Q}^\theta$ which you have in your case chosen such that&#xA;$$ \frac{dS_t}{S_t} = (r+\sigma\theta) dt + \sigma dW_t^{\mathbb{Q}^\theta} \tag{1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which implicitly shapes the Radon-Nikodym derivative (see Girsanov theorem)&#xA;$$ \left. \frac{d\mathbb{Q}}{d\mathbb{Q}^\theta} \right\vert_{\mathcal{F}_t} =   \mathcal{E}\left(-\theta W_t^{\mathbb{Q}^\theta}\right) = \exp\left(-\theta W_t^{\mathbb{Q}^\theta} - \frac{1}{2}\theta^2 t \right) := L(\theta,t) \tag{2}$$&#xA;which defines what you refer to as the likelihood ratio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using a change of measure argument (+ optimal sampling theorem), one can then claim that&#xA;\begin{align}&#xA;V_0 &amp;amp;= \text{sup}_{\tau \in \mathcal{T}[0,T]} \mathbb{E}_0^\mathbb{Q}\left[ e^{-r\tau} \max(S_{\tau}-K, 0) \right] \\&#xA;&amp;amp;= \text{sup}_{\tau \in \mathcal{T}[0,T]} \mathbb{E}_0^\mathbb{Q^\theta}\left[ e^{-r\tau} \max(S_{\tau}-K, 0) L(\theta,\tau) \right]&#xA;\end{align}&#xA;where in the last equality above, $S_{\tau}$ (and the expectation) are simulated (taken) under $\mathbb{Q}^\theta$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what you should do is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Generate $N$ stock price paths under the modified measure $\mathbb{Q}^\theta$ using the SDE (1)&lt;/li&gt;&#xA;&lt;li&gt;Apply the Longstaff-Schwartz algorithm (Least Squares Monte Carlo) to obtain, for each simulated path $n=1,...,N$ the value of the discounted exercise value at the optimal stopping time $\tau^{(n)}$&#xA;$$ e^{-r\tau^{(n)}} \max( S_{\tau^{(n)}}-K, 0 ) $$&#xA;(under the hood, the LS algorithm identifies optimal stopping times by approximating continuation values through polynomial regressions relying on cross-sectional information and working backwards in time).&lt;/li&gt;&#xA;&lt;li&gt;Once you have that, it is straightforward to compute the Monte Carlo estimator:&#xA;\begin{align}&#xA;V_0 &amp;amp;= \text{sup}_{\tau \in \mathcal{T}[0,T]} \mathbb{E}_0^\mathbb{Q^\theta}\left[ e^{-r\tau} \max(S_{\tau}-K, 0) L(\theta, \tau) \right] \\&#xA;&amp;amp;\approx \frac{1}{N} \sum_{n=1}^N  \left( e^{-r\tau^{(n)}}  \max( S_{\tau^{(n)}}-K, 0 ) \right) \times L(\theta, \tau^{(n)})&#xA;\end{align}&#xA;with see (2)&#xA;$$ L(\theta,\tau^{(n)}) = \exp\left(-\theta W_{\tau^{(n)}}^{\mathbb{Q}^\theta} - \frac{1}{2}\theta^2 \tau^{(n)} \right) $$&#xA;and by definition of a Wiener process (i.e. standard Brownian motion)&#xA;$$ W_{\tau^{(n)}}^{\mathbb{Q}^\theta} = \sum_{ i : 0 \leq t_i \leq \tau^{(n)} } Z_i \sqrt{t_{i+1}-t_i},\ \ \ Z_i \sim N(0,1)\ \ \text{i.i.d.} $$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;notice how the likelihood ratio $L(\theta,n)$ should be computed for each individual path $n=1,...,N$ depending on the optimal stopping time for that path $\tau^{(n)}$.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-06-14T10:26:14.297" LastActivityDate="2016-06-14T10:26:14.297" CommentCount="24" ContentLicense="CC BY-SA 3.0" />
  <row Id="27609" PostTypeId="1" CreationDate="2016-06-14T09:59:46.013" Score="1" ViewCount="104" Body="&lt;p&gt;I want to understand better cash flow of stock market and it's participants, but could not find any reasonable information online, hope more experienced people here could help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Money IN flow:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;(1)investors, hedge funds, investing banks, pension fund etc... anyone who invests/speculates on stock price&lt;/li&gt;&#xA;&lt;li&gt;(2)companies paying dividends on their shares&lt;/li&gt;&#xA;&lt;li&gt;(3)acquisition. When someone decides to buy public trading company they will return full cost to the market/shareholders.&lt;/li&gt;&#xA;&lt;li&gt;(4)stock buyback &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Money OUT flow:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;(5)IPO. On time off outflow.&lt;/li&gt;&#xA;&lt;li&gt;(6)share dilution.&lt;/li&gt;&#xA;&lt;li&gt;(7)brokers, market makers, stock exchange support etc..&lt;/li&gt;&#xA;&lt;li&gt;(8)speculative profit for category (1)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I hope I did not forget any, please let me know if I did. &#xA;Now we know there should be balance and inflow should be equal to outflow on long term. &lt;strong&gt;The question here - is (2) - (4) enough to cover income for (5) - (8)?&lt;/strong&gt;  I don't have statistical information but my guess would be no, does it mean that category (1) is constantly loosing money?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="19704" LastEditorUserId="19704" LastEditDate="2016-06-14T12:46:31.360" LastActivityDate="2016-06-14T12:46:31.360" Title="Stock market cash flow" Tags="&lt;equities&gt;&lt;market-microstructure&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27611" PostTypeId="1" CreationDate="2016-06-14T14:00:09.270" Score="2" ViewCount="93" Body="&lt;p&gt;I could use some advice on calibration of stochastic intensity models. I am thinking that the CIR model is most suitable, as it can not take negative values (when feller condition is satisfied). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am fairly sure I understand how to calibrate the model to CDS quotes. Is it possible to calibrate to for instance credit spreads on risky bonds? If someone could give a couple of hints on how this can be achieved, or has a good article where they do, so please share :-).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.  &lt;/p&gt;&#xA;" OwnerUserId="19761" LastActivityDate="2016-06-14T14:00:09.270" Title="Calibration of intensity model" Tags="&lt;modeling&gt;&lt;default&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27612" PostTypeId="1" CreationDate="2016-06-14T14:34:49.947" Score="1" ViewCount="132" Body="&lt;p&gt;I know how to calculate a bottom up levered beta for a privately held and not publicly traded company with Hamada (&lt;a href=&quot;https://quant.stackexchange.com/questions/17246/proof-of-hamadas-formula-relationship-between-levered-and-unlevered-beta&quot;&gt;Proof of Hamada&amp;#39;s Formula (Relationship between levered and unlevered beta)&lt;/a&gt;) and the help of &lt;a href=&quot;http://people.stern.nyu.edu/adamodar/New_Home_Page/TenQs/TenQsBottomupBetas.htm&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;e.g. Damodaranquot;&quot;&gt;http://people.stern.nyu.edu/adamodar/New_Home_Page/TenQs/TenQsBottomupBetas.htm&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\beta_{L}=\beta_U×(1+(1-t)\times D/E)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, all the explanations I see in the literature assume that the debt ratio $\theta = D/E$ is a constant. Only sometimes it is casually mentioned that the betas need to be adjusted when D/E changes, but this is never formalised.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What happens if I do a valuation of a company that plans to pay off all debt so that for the future periods $t = 1,2,...$ : $\theta_1 = 0.5$, $\theta_2 = 0.25$, $\theta_3 = 0$. Do we have a time series of betas?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\beta_{L,t}=\beta_U×(1+(1-t)\times \theta_t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;...and do we need to discount future cash flows in each period by its own levered beta? In $t = 1,2$ the free cash flows will be much lower since the debt is paid off but for $t \geq3: \beta_{L,t}=\beta_U$. The value of the business should be much higher because free cash flows are hihger and the discount factor is smaller. Am I right? &lt;/p&gt;&#xA;" OwnerUserId="22149" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2016-06-16T06:32:33.607" Title="Levered beta with changing equity/debt ratios" Tags="&lt;capm&gt;&lt;beta&gt;&lt;capital-structure&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27613" PostTypeId="1" CreationDate="2016-06-14T16:41:44.503" Score="4" ViewCount="291" Body="&lt;p&gt;I own and operate a datacenter adjacent to Bloombergs Datacenter in Orangeburg NY. We have had a couple of trading firms come to us due to our proximity to Bloomberg to receive &quot;data&quot; from them quicker. They then use direct microwave shots to send this information to NJ, as the microwave is faster than the fiber routes available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to figure out what &quot;data&quot; they are getting from Bloomberg to be able to market this to a wider audience and what is the benefit. I understand previously that they wanted to be near the exchanges for low latency trading but now it seems all of the latency has been taken out of the trading portion and they rely on getting the &quot;news/data&quot; faster to make those trading decisions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be appreciated, I am happy to share more info if it is needed but the two initial trading firms are pretty tight lipped on the applications they are purchasing from Bloomberg.&lt;/p&gt;&#xA;" OwnerUserId="22151" LastEditorUserId="467" LastEditDate="2016-06-15T03:45:48.870" LastActivityDate="2016-06-15T18:06:02.867" Title="What is the benefit of having proximity to the Bloomberg datacenter?" Tags="&lt;market-data&gt;&lt;bloomberg&gt;&lt;latency&gt;&lt;news&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27614" PostTypeId="1" AcceptedAnswerId="27615" CreationDate="2016-06-14T16:55:14.137" Score="8" ViewCount="633" Body="&lt;p&gt;Can anyone give me a detailed explanation of how below equations (3) and (4) are derived from (1) and (2)?&#xA;\begin{align*}&#xA;\frac{dF_{t,T}}{F_{t,T}} &amp;amp;=\sigma e^{-\lambda(T-t)}dB_t, \tag{1}\\&#xA;\ln(F_{t,T})&amp;amp;=\ln(F_{0,T})-1/2\int_{0}^{t}\sigma^2 e^{-2\lambda(T-s)}ds+\int_{0}^{t}\sigma e^{-\lambda(T-s)}dB_s.\tag{2}&#xA;\end{align*}&#xA;Given $\ln(S_t)=\ln(F_{t,t})$, we have:&#xA;\begin{align*}&#xA;\frac{dS_t}{S_t}=(\mu_t-\lambda \ln(S_t))dt+\sigma dB_t,\tag{3}&#xA;\end{align*}&#xA;where&#xA;\begin{align*}&#xA;\mu_t=\frac{\partial \ln(F_{0,t})}{\partial t} +\lambda \ln(F_{0,t})+\frac{1}{4}\sigma^2(1-e^{-2\lambda t}). \tag{4}&#xA;\end{align*}&#xA;Or anything related to them will be helpful.&lt;/p&gt;&#xA;" OwnerUserId="22152" LastEditorUserId="11678" LastEditDate="2016-06-15T17:45:34.330" LastActivityDate="2016-06-15T17:45:34.330" Title="How were these SDE derived?" Tags="&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27615" PostTypeId="2" ParentId="27614" CreationDate="2016-06-14T18:35:53.697" Score="11" Body="&lt;p&gt;From $(2)$, &#xA;\begin{align*}&#xA;\ln S_t &amp;amp;=\ln F_{t, t} \\&#xA;&amp;amp;= \ln F_{0, t}-\frac{1}{2}\int_0^t\sigma^2 e^{-2\lambda (t-s)}ds+\int_0^t \sigma e^{-\lambda(t-s)} dB_s\\&#xA;&amp;amp;=\ln F_{0, t}-\frac{\sigma^2}{4\lambda} \left(1-e^{-2\lambda t}\right)+e^{-\lambda t}\int_0^t \sigma e^{\lambda s} dB_s.&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;\lambda e^{-\lambda t}\int_0^t \sigma e^{\lambda s} dB_s = \lambda \ln S_t - \lambda \ln F_{0, t} + \frac{\sigma^2}{4} \left(1-e^{-2\lambda t}\right).&#xA;\end{align*}&#xA;Therefore,&#xA;\begin{align*}&#xA;d\ln S_t &amp;amp;= \left(\frac{\partial \ln F_{0, t}}{\partial t}-\frac{\sigma^2}{2}e^{-2\lambda t} - \lambda e^{-\lambda t}\int_0^t \sigma e^{\lambda s} dB_s\right)dt +\sigma dB_t\\&#xA;&amp;amp;=\left[\frac{\partial \ln F_{0, t}}{\partial t}-\frac{\sigma^2}{2}e^{-2\lambda t}+\lambda \ln F_{0, t} - \frac{\sigma^2}{4} \left(1-e^{-2\lambda t}\right) -\lambda \ln S_t\right]dt + \sigma dB_t\\&#xA;&amp;amp;=\left(\frac{\partial \ln F_{0, t}}{\partial t}+\lambda \ln F_{0, t} -\frac{\sigma^2}{4} - \frac{\sigma^2}{4} e^{-2\lambda t} -\lambda \ln S_t\right)dt + \sigma dB_t.&#xA;\end{align*}&#xA;Note that &#xA;\begin{align*}&#xA;d\langle \ln S, \ln S \rangle_t= \sigma^2 dt. &#xA;\end{align*}&#xA;By Ito's lemma,&#xA;\begin{align*}&#xA;dS_t &amp;amp;= de^{\ln S_t}\\&#xA;&amp;amp;= e^{\ln S_t} d \ln S_t + \frac{1}{2}e^{\ln S_t}d\langle \ln S, \ln S \rangle_t\\&#xA;&amp;amp;=S_t d \ln S_t + \frac{1}{2} \sigma^2 S_t dt\\&#xA;&amp;amp;= S_t\left[\left(\frac{\partial \ln F_{0, t}}{\partial t}+\lambda \ln F_{0, t} -\frac{\sigma^2}{4} - \frac{\sigma^2}{4} e^{-2\lambda t} -\lambda \ln S_t\right)dt + \sigma dB_t + \frac{\sigma^2}{2} dt \right]\\&#xA;&amp;amp;=S_t\big[\left(\mu_t - \lambda \ln S_t\right)dt + \sigma dB_t\big],&#xA;\end{align*}&#xA;where&#xA;\begin{align*}&#xA;\mu_t = \frac{\partial \ln F_{0, t}}{\partial t}+\lambda \ln F_{0, t} +\frac{\sigma^2}{4}\left(1- e^{-2\lambda t}\right).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-06-14T19:42:34.590" LastActivityDate="2016-06-14T19:42:34.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27616" PostTypeId="1" CreationDate="2016-06-14T19:31:14.503" Score="1" ViewCount="73" Body="&lt;p&gt;I know that Bloomberg will give me the swap rates for Treasury 30's-5's, but I don't have a Bloomberg.  Can anyone direct me to a source?&lt;/p&gt;&#xA;" OwnerUserId="22155" LastActivityDate="2016-06-14T19:31:14.503" Title="US Treasury interest rate swaps" Tags="&lt;interest-rate-swap&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27617" PostTypeId="1" AcceptedAnswerId="27619" CreationDate="2016-06-14T19:41:35.547" Score="2" ViewCount="342" Body="&lt;p&gt;Hi guys this is my first question on the Quantitative Finance section of the Stack Exchange network. I am currently reviewing the paper by Professor Alan E. Speight and David G. McMillan '&lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1002/for.1222/abstract&quot; rel=&quot;nofollow&quot;&gt;Daily FX Volatility Forecasts: Can the GARCH(1,1) Model be Beaten using High Frequency Data?&lt;/a&gt;'. These are main characteristics of the pape: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The authors try to further investigate the question of the paper by&#xA;Hansen and Lunde '&lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1002/jae.800/abstract&quot; rel=&quot;nofollow&quot;&gt;A forecast comparison of volatility models: does&#xA;anything beat a GARCH(1,1)?&lt;/a&gt;'.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;They use multiple variations of the GARCH class as forecasting&#xA;models.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;They construct the realised volatility as the sum of squared returns&#xA;and they also account for microsturure bias by using bias adjusted&#xA;measures of realized volatility.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;As forecasting appraisal techniwues they use the Mincer Zarnowith&#xA;regression and its GLS adjusted version by Patton and Sheppard(2009),&#xA;the encompassing technique by Chong and Henry(1986) and the SPA test&#xA;of Hansen (2005).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Their results suggests that the raw intraday GARCH gives better forecasts whereas the daily GARCH gives the worse forecasts.&#xA;My question is, are there any aspects, or advances in the field that MCMillan and Speight didn't incorporate? Any conflicting results? Any weaknesses? All suggestions are welcomed.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="22154" LastEditorUserId="22154" LastEditDate="2016-06-14T23:50:03.113" LastActivityDate="2016-07-15T00:45:12.570" Title="Question regarding volatility forecasting using High Frequency Data" Tags="&lt;volatility&gt;&lt;garch&gt;&lt;forecast&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27618" PostTypeId="2" ParentId="26370" CreationDate="2016-06-14T19:58:14.567" Score="2" Body="&lt;p&gt;I can think two techniques that may possible be of help. The first technique is the &lt;a href=&quot;http://www.ssc.upenn.edu/~fdiebold/papers/paper31/final2.pdf&quot; rel=&quot;nofollow&quot;&gt;moving average adjusted returns&lt;/a&gt; originally proposed by Andersen et. al(2001). See &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=906120&quot; rel=&quot;nofollow&quot;&gt;Hansen et al. (2008)&lt;/a&gt; for details. In order to account for serial correlation an MA(1) is fitted to to the intraday returns data, the residual of which is then squared and aggregated over the trading day to produce the daily measure of realised volatility.&#xA;Besides, is the Hansen and Lunde first order autocorrelation realized volatility measure on the paper Realized Variance and Microstructure Noise.&lt;/p&gt;&#xA;" OwnerUserId="22154" LastActivityDate="2016-06-14T19:58:14.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27619" PostTypeId="2" ParentId="27617" CreationDate="2016-06-15T00:39:03.413" Score="2" Body="&lt;p&gt;A limitation of both papers is they focus on &lt;strong&gt;point estimates&lt;/strong&gt;, i.e they compare $\sigma_{t}$ with $h_{t}$ in the loss functions of the SPA Tests.&#xA;A possible suggestion to overcome it, is to use a loss function based on density forecast, in order to capture the whole forecast density distribution and not only a single point. This may have important implications for risk management.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find an illustration of density forecast comparison in the following empirical article:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wilhelmsson, A. (2013). Density Forecasting with Time-Varying Higher Moments : Journal of Forecasting,&lt;br&gt;&#xA;The ssrn version is &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1768806&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2016-06-15T00:39:03.413" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27620" PostTypeId="1" AcceptedAnswerId="27623" CreationDate="2016-06-15T04:37:09.070" Score="2" ViewCount="883" Body="&lt;p&gt;I have been reading into Hull's section on portfolio insurance through synthetic puts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My understanding is that in order to replicate a put we should replicate it's delta. Proceeding, Hull states that&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;To create a synthetic put option synthetically, the fund manager should ensure that at any given time a proportion $$e^{qT}[1-N(d_{1})]$$ (delta) of the stocks in the original portfolio has been sold and the proceeds invested in the riskless assets.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I am unsure as to how this replicates the delta and furthermore, the put option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If someone could explain further than what has been written in Hull with an example, it would be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="13726" LastEditorUserId="467" LastEditDate="2016-06-15T09:26:20.220" LastActivityDate="2016-06-17T07:10:47.267" Title="How to create a synthetic put?" Tags="&lt;put&gt;&lt;synthetic&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27622" PostTypeId="2" ParentId="26031" CreationDate="2016-06-15T07:59:31.187" Score="2" Body="&lt;p&gt;When investors make decisions in the market, they maximize utility. The utility in turn depends on consumption volatility. An overall goal of the investors is to smooth consumption, so they can consume in each point in time roughly the same amount. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is clear, the more volatile consumption growth the more uncertain is future consumption. Investors want to hedge this risk by saving money today to have extra money tomorrow to keep their level. The saving is done by putting more money in the bank account and less money into stocks. Therefore, stock (bond) prices go down (up) and thus expected returns (interest rates) go up (down). This increases the Equity Risk Premium.&#xA; In the simplest case of a Lucas Tree model the Equity premium is given by &#xA;$$ ERP = \gamma \sigma_C^2 $$&#xA;Where $\sigma_C $ is consumption growth volatility and $\gamma$ the risk aversion. The consumption process is defined via&#xA;$$ dC_t = C_t(\mu_C dt + \sigma_C dW_t^C) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&#xA;Just to be clear. The above explanations hold the other way around as well. So, if consumption volatility goes down, investors don't wish to save as much as before. Therfore the interest rate goes up and, since they invest more in stocks, stocks get more expensive and subsequent expected stock returns go down. This results in a lower ERP. &lt;/p&gt;&#xA;" OwnerUserId="6640" LastEditorUserId="6640" LastEditDate="2016-06-15T11:33:26.323" LastActivityDate="2016-06-15T11:33:26.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27623" PostTypeId="2" ParentId="27620" CreationDate="2016-06-15T10:27:42.070" Score="5" Body="&lt;p&gt;As you can see from the wiki &lt;a href=&quot;https://en.wikipedia.org/wiki/Greeks_(finance)&quot; rel=&quot;nofollow&quot;&gt;page&lt;/a&gt;, the delta of a put is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta = -e^{-qT}N(-d_1)= -e^{-qT} \left(1-N(d_1)\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recall that this $\Delta$ is the derivative of the value of the put $p$ with respect to the value of the underlying stock $S$: $\frac{\partial p}{\partial S}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this means that if the underlying goes up by 1, the price of the put change by $\Delta$. Clearly, you see that for puts $\Delta \leq 0$, which means that if the value of the underlying goes up, the put value goes down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say you have asset $S_0=100$ and you want to replicate a put which would have a $\Delta=-0.25$, then you sell you $0.25$ the stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say the value next day is $S_1 = 80$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume you have a portfolio of $S$ and a put $p$:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Value at $t=0$: $S_0 + p_0 = 100 + p_0$&lt;/li&gt;&#xA;&lt;li&gt;Value at $t=1$: $S_1 + p_1 = S_1 + (S_1 - S_0 )\Delta + p_0 = 80 + (-20) \cdot (-0.25) + p_0 = 85+p_0$&lt;/li&gt;&#xA;&lt;li&gt;The PnL is $(85+p_0) - (100 + p_0) = -15$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Assume now you don't buy the put but you replicate by investing $\Delta$ of the stock:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Value at $t=0$: $S_0 + \Delta S_0 = (1+\Delta)S_0 = 0.75 \cdot 100 = 75$&lt;/li&gt;&#xA;&lt;li&gt;Value at $t=1$: $(1+\Delta)S_1 = 0.75 \cdot 80 = 60$&lt;/li&gt;&#xA;&lt;li&gt;The PnL is $-15$ as well&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You replicated the option (that's the idea to be perfectly correct you indeed need to invest the proceeds at risk free indeed, that's essentially because $p_0$ doesn't move exactly by $\Delta$).&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2016-06-17T07:10:47.267" LastActivityDate="2016-06-17T07:10:47.267" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27624" PostTypeId="1" CreationDate="2016-06-15T11:18:28.900" Score="1" ViewCount="386" Body="&lt;p&gt;Would like to know how to request all securities in an asset class using IBpy, the python wrapper for the Interactive Brokers API. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example getting all currency pairs in the class forex ('CASH'), or all stocks in the class equity ('STK').&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Current efforts: Searched QF stack, stackoverflow and IBPy's google discussion groups.&#xA;Ongoing efforts: Trawling through IBPy's &quot;ibConection&quot; class.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="22143" LastEditorUserId="22143" LastEditDate="2016-06-16T03:42:12.157" LastActivityDate="2016-06-16T04:31:56.117" Title="How to get all securities in an asset class from IBPy (Interactive Brokers python API)" Tags="&lt;interactive-brokers&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27625" PostTypeId="1" CreationDate="2016-06-15T11:33:11.090" Score="3" ViewCount="227" Body="&lt;p&gt;Please advise that how to get the data of credit migration matrices&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a paper of credit migration matrices, I would import the data to Matlab or R for credit analysis. &#xA;&lt;a href=&quot;https://www.researchgate.net/publication/227992149_Credit_Migration_Matrices&quot; rel=&quot;nofollow&quot;&gt;https://www.researchgate.net/publication/227992149_Credit_Migration_Matrices&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards, &#xA;Nelson.&lt;/p&gt;&#xA;" OwnerUserId="17557" LastActivityDate="2018-06-07T01:47:47.633" Title="Data of Credit Migration Matrices" Tags="&lt;forecasting&gt;&lt;credit-risk&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27626" PostTypeId="1" CreationDate="2016-06-15T14:43:25.867" Score="17" ViewCount="7274" Body="&lt;p&gt;Really new to financial Maths. I am currently having problems with the Carr-Madan Formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f(S_T)=f(F_t) + f'(F_t) (S_T - F_t) + \int_0^{F_t}  f''(K) (K-S_T)^+ \ d K  +   \int_{F_t}^{\infty}  f''(K) (S_T-K)^+ \ d K$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am struggling to understand what it is used for and I can't seem to find any good articles to explain what is going on. I was wondering could someone recommend any readings, given that I quite new to this. &lt;/p&gt;&#xA;" OwnerUserId="22166" LastEditorUserId="22167" LastEditDate="2016-06-15T15:31:57.340" LastActivityDate="2020-08-30T16:37:16.880" Title="Carr-Madan Formula" Tags="&lt;options&gt;&lt;european-options&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="18" ContentLicense="CC BY-SA 3.0" />
  <row Id="27627" PostTypeId="1" AcceptedAnswerId="27634" CreationDate="2016-06-15T15:03:19.640" Score="2" ViewCount="196" Body="&lt;p&gt;The London Interbank Offered Rate (LIBOR) is an indicative average interest rate at which a selection of banks (the panel banks) are prepared to lend one another unsecured funds on the London money market. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;LIBOR is currently calculated for 5 different currencies, including the USD.&#xA;If LIBOR denominated in USD is calculated based on London based banks, is it still a good short term interest rate measure for the U.S.? &lt;/p&gt;&#xA;" OwnerUserId="22099" LastActivityDate="2016-06-15T23:13:30.460" Title="Does LIBOR in USD reflect short term interest rates in the U.S.?" Tags="&lt;interest-rates&gt;&lt;libor&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27628" PostTypeId="2" ParentId="27626" CreationDate="2016-06-15T15:14:00.890" Score="21" Body="&lt;p&gt;For a sufficiently smooth function $f$, positive constant $a$, and $x&amp;gt;0$,&#xA;Note that,&#xA;\begin{align*}&#xA;f(x) -f(a) &amp;amp;= \int_a^{x} f'(v) dv \\&#xA;&amp;amp;= \int_a^{x} \big[f'(v) -f'(a) + f'(a) \big] dv \\&#xA;&amp;amp;= f'(a) (x-a) + \int_a^{x}\!\! \int_a^v f''(u)du dv\\&#xA;&amp;amp;= f'(a) (x-a) + \int_a^{x}\!\! \int_u^{x} f''(u)dv du\\&#xA;&amp;amp;= f'(a) (x-a) + \int_a^{x}f''(u)(x-u)du.&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;f(x) &amp;amp;= f(a) + f'(a) (x-a) + \int_a^{x}(x-u)f''(u)du \\&#xA;&amp;amp;= f(a) + f'(a) (x-a) + \int_a^{x}\big(\pmb{1}_{a \leq x} + \pmb{1}_{a &amp;gt; x} \big)(x-u)f''(u)du \\&#xA;&amp;amp;= f(a) + f'(a) (x-a) + \int_a^{x} \pmb{1}_{a \leq x}\,(x-u)f''(u)du + \int_x^{a} \pmb{1}_{a &amp;gt; x}\,(u-x)f''(u)du \\&#xA;&amp;amp;= f(a) + f'(a) (x-a) + \int_a^{x} \pmb{1}_{a \leq x}\,(x-u)^+f''(u)du + \int_x^{a} \pmb{1}_{a &amp;gt; x}\,(u-x)^+f''(u)du \\&#xA;&amp;amp;= f(a) + f'(a) (x-a) + \int_a^{\infty} \pmb{1}_{a \leq x}\, (x-u)^+f''(u)du + \int_{0}^a  \pmb{1}_{a \geq x}\, (u - x)^+f''(u)du  \\&#xA;&amp;amp;=f(a) + f'(a) (x-a)\\&#xA;&amp;amp;\qquad + \int_a^{\infty}(1- \pmb{1}_{x &amp;lt; a})\, (x-u)^+f''(u)du + \int_{0}^a  (1-\pmb{1}_{x&amp;gt;a})\, (u - x)^+f''(u)du  \\&#xA;&amp;amp;= f(a) + f'(a) (x-a) + \int_a^{\infty}(x-u)^+f''(u)du + \int_{0}^a(u - x)^+f''(u)du. &#xA;\end{align*}&#xA;This formula is used in the valuation of a variance swap, and, as an approximation, the constructuion of the VIX index; see &lt;a href=&quot;https://www.cboe.com/micro/vix/vixwhite.pdf&quot; rel=&quot;noreferrer&quot;&gt;https://www.cboe.com/micro/vix/vixwhite.pdf&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2018-04-10T15:42:15.643" LastActivityDate="2018-04-10T15:42:15.643" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="27631" PostTypeId="2" ParentId="27569" CreationDate="2016-06-15T15:40:28.817" Score="3" Body="&lt;p&gt;Finally I have found the answer on my own. The problem was related to the trasformation of the dataset. The original code used: ${{y}_{t}}=400*(\log ({{P}_{t}})-\log ({{P}_{t-1}}))$ as dataset. Initially I did not care about multipling by 400 because I thought it was usless. Instead it makes a big difference. Now the two series are completely overlapped, I think it depends on how MATLAB manages the figures in the spreadsheet.&lt;/p&gt;&#xA;" OwnerUserId="22108" LastActivityDate="2016-06-15T15:40:28.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27632" PostTypeId="2" ParentId="27626" CreationDate="2016-06-15T17:17:21.817" Score="5" Body="&lt;p&gt;The main interest of the formula is that it allows you, at least theoretically,  to replicate any European option with payoff $f(\cdot)$ using only Call and Put options. As simple examples, consider $f(S)=S$ and $f(S)=(S-K)^+$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The formula also implies that knowing all Puts and Calls for all strikes for a given maturity gives you the price of any European option with the same maturity.&lt;/p&gt;&#xA;" OwnerUserId="22171" LastEditorUserId="20454" LastEditDate="2018-03-27T13:03:08.627" LastActivityDate="2018-03-27T13:03:08.627" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27633" PostTypeId="2" ParentId="27613" CreationDate="2016-06-15T18:06:02.867" Score="1" Body="&lt;p&gt;It is possible that they are getting &quot;news&quot;, but what I feel these firms are doing is connecting to EMSX offered by Bloomberg which is an electronic trading platform. Which is why they would probably invest in sending microwave shots of data back to NJ. The data is : which broker offers which security at what rate. Earlier access to data implies that they can get a smaller spread ( from the going market rate) and the orders they place are higher on the list ( hence have more priority). &lt;/p&gt;&#xA;" OwnerUserId="6670" LastActivityDate="2016-06-15T18:06:02.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27634" PostTypeId="2" ParentId="27627" CreationDate="2016-06-15T18:31:50.543" Score="3" Body="&lt;p&gt;It depends on the purpose for which you want to use LIBOR. If you want to use it as a measure of risk free rate, then it is not a good idea, because it included premiums for interbank lending credit risk and liquidity risk. You should use the rate on short term US treasuries for risk free rate (again it depends on the duration of your model). You can also check out Federal Funds rate and how it relates to LIBOR (LIBOR-OIS Spread) to get a better feel for what interest rate you would need. &lt;/p&gt;&#xA;" OwnerUserId="5821" LastEditorUserId="5821" LastEditDate="2016-06-15T23:13:30.460" LastActivityDate="2016-06-15T23:13:30.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27635" PostTypeId="1" AcceptedAnswerId="27751" CreationDate="2016-06-15T19:23:11.170" Score="3" ViewCount="123" Body="&lt;p&gt;Let's assume that price of a certain asset follows Brownian Semimartingale process with a drift term and a Brownian-driven continuous part (no jumps for simplicity). In literature it is often stated that on high frequency data (i.e. order of seconds or even ticks) drift becomes irrelevant both economically and statistically (so we can safely assume that making it equal to zero will have close to none impact on our analysis). While I understand the notion behind it, I'd like to have some kind of formal proof of this statement, or at least some solid empirical evidence.&lt;/p&gt;&#xA;" OwnerUserId="18195" LastActivityDate="2016-06-22T16:28:50.533" Title="Drift irrelevance on high frequency data" Tags="&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27637" PostTypeId="2" ParentId="27627" CreationDate="2016-06-15T22:08:30.713" Score="2" Body="&lt;p&gt;Yes, in general it is. If you take a look at the banks that contribute to the Libor you'll see why:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Bank of America &lt;/li&gt;&#xA;&lt;li&gt;Bank of Tokyo-Mitsubishi UFJ &lt;/li&gt;&#xA;&lt;li&gt;Barclays Bank &lt;/li&gt;&#xA;&lt;li&gt;BNP Paribas &lt;/li&gt;&#xA;&lt;li&gt;Citibank NA &lt;/li&gt;&#xA;&lt;li&gt;Credit Agricole CIB &lt;/li&gt;&#xA;&lt;li&gt;Credit Suisse &lt;/li&gt;&#xA;&lt;li&gt;Deutsche Bank&lt;/li&gt;&#xA;&lt;li&gt;HSBC &lt;/li&gt;&#xA;&lt;li&gt;JP Morgan Chase &lt;/li&gt;&#xA;&lt;li&gt;Lloyds Banking Group &lt;/li&gt;&#xA;&lt;li&gt;Rabobank &lt;/li&gt;&#xA;&lt;li&gt;Royal Bank of Canada &lt;/li&gt;&#xA;&lt;li&gt;Société Générale &lt;/li&gt;&#xA;&lt;li&gt;Sumitomo Mitsui Banking Corporation Europe&#xA;Ltd &lt;/li&gt;&#xA;&lt;li&gt;Norinchukin Bank &lt;/li&gt;&#xA;&lt;li&gt;Royal Bank of Scotland &lt;/li&gt;&#xA;&lt;li&gt;UBS AG&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;It consists not only of british banks, but of banks from all over the world. It does well as an approximation for the short term interest rate, since lending to other banks is relatively low in risk and therefore corresponds to a lower interest. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, as Sason already mentioned, I would not use it as a risk free rate.&lt;/p&gt;&#xA;" OwnerUserId="20694" LastActivityDate="2016-06-15T22:08:30.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27638" PostTypeId="1" AcceptedAnswerId="27639" CreationDate="2016-06-15T23:10:12.600" Score="2" ViewCount="1110" Body="&lt;p&gt;I am trying to understand an optimization algorithm to achieve risk parity in a portfolio. I need some help figuring out the notation in the following formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/da4Cg.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/da4Cg.png&quot; alt=&quot;Formula, algorithm&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found this on &lt;a href=&quot;http://poseidon01.ssrn.com/delivery.php?ID=817078078116004004101107074094088068001008007085063041068117119105027024066001121072026035111101049057019019014024101114003124012022021021058020088096015107092093081008021009007002119111003088106093106116098085001004096085092064110097067102020118102&amp;amp;EXT=pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;THIS&lt;/a&gt; paper.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand the following, if you could help me by pointing any mistake, would be great!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that this algorithm is suppossed to iterate the allocation for each asset at a time.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;$x^*_i$ : The iteration n+1 of asset i.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$σ_i$ : The standard deviation of Asset i&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$x_j$ : allocation for each asset j&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$\sigma_j$ : The standard deviation of asset j&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$\rho_{i,j}$ : This is my biggest question. WHAT is this? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$b_i$ : The risk budget for the asset, which for risk parity is $\frac{1}{n}$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$\sigma(x)$ : The standard deviation of the portfolio&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="20854" LastEditorUserId="467" LastEditDate="2018-01-30T04:51:14.683" LastActivityDate="2018-01-30T07:21:45.687" Title="How to understand this Risk Parity Algorithm?" Tags="&lt;optimization&gt;&lt;risk-parity&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27639" PostTypeId="2" ParentId="27638" CreationDate="2016-06-16T01:54:25.833" Score="2" Body="&lt;p&gt;Your question seems very simple. The $\rho_{ij}$ are the correlations between asset i and asset j, in other words these are the elements of the correlation matrix. This notation is very standard in portfolio optimization problems. The number of securities n, the n-by-n correlation matrix R and the n vector of $\sigma_j$'s are the main inputs of a risk parity problem.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="2587" LastEditDate="2018-01-30T07:21:45.687" LastActivityDate="2018-01-30T07:21:45.687" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27640" PostTypeId="2" ParentId="27624" CreationDate="2016-06-16T04:31:56.117" Score="1" Body="&lt;p&gt;You can't via the API. If you need to search use the contract lookup database&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.interactivebrokers.com/en/?f=%2Fen%2Fgeneral%2Fcontact%2FtipsContractsDatabaseSearch.php%3Fib_entity%3Dllc&quot; rel=&quot;nofollow&quot;&gt;https://www.interactivebrokers.com/en/?f=%2Fen%2Fgeneral%2Fcontact%2FtipsContractsDatabaseSearch.php%3Fib_entity%3Dllc&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1764" LastActivityDate="2016-06-16T04:31:56.117" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27641" PostTypeId="1" AcceptedAnswerId="27646" CreationDate="2016-06-16T04:50:12.000" Score="5" ViewCount="5436" Body="&lt;p&gt;In preparation for my finals, I am attempting a question on chooser options. One question asks&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A European chooser option on an index ETF paying a yield of 3.0% with&#xA;  strike \$64 has a maturity of T2 = 21 months and a choice regarding the&#xA;  type of the option must be made after T1 = 12 months. The risk-free rate&#xA;  is 7%, stock return volatility is assumed to be 33% per year and currently&#xA;  a share costs $61. What is the value of the option?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The answers are&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;One T2-Call = \$10.4641; 0.9778 times T1-Put (\$7.0157) with adjusted&#xA;  strike 62.1085 for a total cost of \$17.32.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Here is my interpretation (most likely incorrect but necessary to illustrate my problem) :&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First and foremost, I do not understand how we can value such an option &lt;b&gt;today&lt;/b&gt; given the information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I do know is that at time t = 1 (yrs), the value of the option is $$V(1) = \mathrm{max}(c,p).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At t = 1, both options have the same strike price (\$64) and remaining  maturity (0.75 yrs.). It can be shown through the put-call parity that&#xA;$$V(T1) = \mathrm{max}(c,c+e^{-r\cdot 0.75}K-S_{1}e^{-q\cdot 0.75}) \\&#xA;= c+e^{-q\cdot 0.75}\mathrm{max}(0,Ke^{-(r-q)\cdot 0.75}-S_{1}).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The constants are given by&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$q$ = dividend yield = 3%&lt;/li&gt;&#xA;&lt;li&gt;$r$ = risk-free rate = 7%&lt;/li&gt;&#xA;&lt;li&gt;$K$ = strike price = 64&lt;/li&gt;&#xA;&lt;li&gt;$S_{1}$ = spot price at time 1 = unknown&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Now in order to calculate the value of the call, I require the spot price at t = 1. This is my first problem since I have been given no such information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I move forward from here, find the value of the chooser option at t = 1, and furthermore its value at t = 0 (if that's what the original question requires)?&lt;/p&gt;&#xA;" OwnerUserId="13726" LastEditorUserId="13726" LastEditDate="2016-06-16T09:02:55.657" LastActivityDate="2019-06-10T20:14:52.313" Title="How is the Chooser Option's value computed in this example?" Tags="&lt;options&gt;&lt;exotics&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27642" PostTypeId="1" CreationDate="2016-06-16T07:16:59.773" Score="2" ViewCount="369" Body="&lt;p&gt;I'm coding in python a backtester for trading the Futures markets (equity futures, precious metals, bond futures, etc..).   When I open a position long or short, I need to deduct an appropriate amount from the portfolio.  I believe this amount should be the margin requirement as calculated by CME's SPAN algorithm.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in simulated trading, what is best practice to calculate or derive the amount to deduct from the account?  (i.e. margin requirement)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any data sources to import this information?  (i.e. python modules, SPAN calculators, metadata files, etc..)  Quandl provides a metadata file for Futures instruments, but its missing margin requirements.&lt;/p&gt;&#xA;" OwnerUserId="22178" LastEditorUserId="22178" LastEditDate="2016-06-16T10:24:49.503" LastActivityDate="2016-06-16T10:24:49.503" Title="Calculating required funds on Futures trades" Tags="&lt;futures&gt;&lt;automated-trading&gt;&lt;algorithmic-trading&gt;&lt;quants&gt;&lt;margin&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27643" PostTypeId="2" ParentId="27642" CreationDate="2016-06-16T07:41:04.487" Score="1" Body="&lt;p&gt;Some exchanges do provide their historic margin requirements. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For CME:&#xA;&lt;a href=&quot;http://www.cmegroup.com/clearing/risk-management/historical-margins.html&quot; rel=&quot;nofollow&quot;&gt;http://www.cmegroup.com/clearing/risk-management/historical-margins.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Caveat for above link is that this is the margin imposed by the exchange on their members. May or may not be the margin your broker imposes on your account.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="22143" LastActivityDate="2016-06-16T07:41:04.487" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27644" PostTypeId="1" CreationDate="2016-06-16T08:07:01.453" Score="2" ViewCount="625" Body="&lt;p&gt;I am doing a small research and looking for a place to purchase historical minute CBOE Index data. I am interested in:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;VIX - CBOE Volatility Index&lt;br&gt;&#xA;VVIX - CBOE VIX VOLATILITY INDEX&lt;br&gt;&#xA;VXV - CBOE VIX VOLATILITY INDEX&lt;br&gt;&#xA;VXST - CBOE Short-Term Volatility Index&lt;br&gt;&#xA;VXMT - CBOE Mid-Term Volatility Index&lt;br&gt;&#xA;VIN - CBOE Near-term VIX Index&lt;br&gt;&#xA;VIF - CBOE Far-term VIX Index  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a reliable place of getting such data? &lt;/p&gt;&#xA;" OwnerUserId="22180" LastActivityDate="2019-10-14T07:47:16.583" Title="CBOE Index Minute Data" Tags="&lt;volatility&gt;&lt;data&gt;&lt;implied-volatility&gt;&lt;historical-data&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27645" PostTypeId="2" ParentId="27641" CreationDate="2016-06-16T08:20:49.027" Score="3" Body="&lt;p&gt;You can refer to one of my previous answers &lt;a href=&quot;https://quant.stackexchange.com/a/22016/467&quot;&gt;here&lt;/a&gt; for a detailed development.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are actually two ways you can price this:&#xA;- the price of a call plus a put with adjusted strike (like above)&#xA;- a put plus the price of a call with an adjusted strike (like in my &lt;a href=&quot;https://quant.stackexchange.com/a/22016/467&quot;&gt;answer&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only difference is whether you do  $\max( a, b ) = b + ( a - b )^+$, or  $\max( a, b ) = a + ( b - a )^+$.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-06-16T08:20:49.027" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27646" PostTypeId="2" ParentId="27641" CreationDate="2016-06-16T08:48:36.847" Score="4" Body="&lt;p&gt;Although the answer of @SRKX is right on spot, I was already writing a solution along the lines of how you had specifically approached the problem. I think it might still be useful to you, so here it goes&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The price of the chooser option, as seen of today $t=0$ is by definition&#xA;\begin{align}&#xA;V_0 &amp;amp;=  \underbrace{e^{-r T_2}}_{\text{Payoff dicount factor}}  \underbrace{\mathbb{E}\left[\ \ \underbrace{\max\left( \mathbb{E}[(S_{T_2}-K)^+ \vert \mathcal{F}_{T_1}], \mathbb{E}[(K-S_{T_2})^+ \vert \mathcal{F}_{T_1} ] \right)}_{\text{Expected payoff at $T_2$ as seen of $T_1$}} \ \ \vert \mathcal{F}_0 \ \ \right]}_{\text{Expected payoff at $T_2$ as seen of $t=0$}} \\&#xA;   &amp;amp;=  e^{-r T_2}  \mathbb{E}_0\left[ \max\left( \mathbb{E}_{T_1}[(S_{T_2}-K)^+], \mathbb{E}_{T_1}[(K-S_{T_2})^+] \right) \right]&#xA;\end{align}&#xA;If you're not familiar with the notation $\mathcal{F}_t$ used for filtrations, you can interpret it as &quot;all the information we know at time $t$&quot;. The notation $\mathbb{E}_t[.]$ simply figures that the expectation is taken conditionally on the knowledge of $\mathcal{F}_t$. Naturally all of these expectations are taken under the risk-neutral measure $\mathbb{Q}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By definition, we also have that the price of European call/put options is given by&#xA;$$ C(T_1,S_{T_1};K,(T_2-T_1)) = e^{-r(T_2-T_1)} \mathbb{E}_{T_1}[(S_{T_2}-K)^+] \tag{def 1} := C_{12} $$&#xA;$$ P(T_1,S_{T_1};K,(T_2-T_1)) = e^{-r(T_2-T_1)}\mathbb{E}_{T_1}[(K-S_{T_2})^+] \tag{def 2} := P_{12} $$&#xA;where $C(t,S_t;K,\tau)$ (resp. $P(t,S_t;K,\tau)$) denotes the price of a European call (resp. put) option as seen of time $t$, given the spot value $S_t$, the strike price $K$ and the time to expiry $\tau$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore,&#xA;$$ V_0 = e^{-r T_2} \mathbb{E}_0\left[ \max\left( \frac{C_{12}}{e^{-r(T_2-T_1)}}, \frac{P_{12}}{e^{-r(T_2-T_1)}} \right) \right]$$&#xA;Yet by call-put parity:&#xA;$$ C_{12} - P_{12} = e^{-r(T_2-T_1)}( S_1 e^{(r-q)(T_2-T_1)} - K ) $$&#xA;so that we can further write (similarly to what you did)&#xA;\begin{align}&#xA;V_0 &amp;amp;= e^{-r T_2} \mathbb{E}_0\left[ \max\left( \frac{C_{12}}{e^{-r(T_2-T_1)}}, \frac{C_{12}}{e^{-r(T_2-T_1)}} - (S_1e^{(r-q)(T_2-T_1)} - K) \right) \right] \\&#xA; &amp;amp;= e^{-r T_2} \mathbb{E}_0\left[ \left( \frac{C_{12}}{e^{-r(T_2-T_1)}} + \max\left( 0, K - S_1e^{(r-q)(T_2-T_1)} \right) \right) \right] \\&#xA;&amp;amp;= \mathbb{E}_0\left[ e^{-rT_1} C_{12} \right] + \mathbb{E}_0\left[ e^{-rT_2} \max\left( 0, K - S_1e^{(r-q)(T_2-T_1)} \right) \right] \tag{1} &#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now using $(\text{def } 1)$ the first term of $(1)$ becomes:&#xA;$$ \mathbb{E}_0 \left[ e^{-rT_1} C_{12} \right] = \mathbb{E}_0 \left[ e^{-rT_2} \mathbb{E}_{T_1}[(S_{T_2}-K)^+] \right] = C(0,S_0;K,T_2)$$&#xA;by the tower property of conditional expectations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, the second term of $(1)$ can on the other hand be expressed as:&#xA;\begin{align}&#xA;\mathbb{E}_0\left[ e^{-rT_2} \max\left( 0, K - S_1e^{(r-q)(T_2-T_1)} \right) \right]&#xA;&amp;amp;= \mathbb{E}_0\left[  \max\left( 0, Ke^{-rT_2} - S_1e^{-rT_1-q(T_2-T_1)} \right) \right] \\&#xA;&amp;amp;= e^{-q(T_2-T_1)} \mathbb{E}_0\left[ e^{-r{T_1}} \max\left( 0, Ke^{-(r-q)(T_2-T_1)} - S_1 \right) \right] \\&#xA;&amp;amp;= e^{-q(T_2-T_1)} P(0,S_0;  Ke^{-(r-q)(T_2-T_1)}, T_1)&#xA;\end{align}&#xA;So that $(1)$ becomes&#xA;$$ V_0 = C(0,S_0;K,T_2) + \underbrace{e^{-q(T_2-T_1)}}_{= 0.9778} P(0,S_0;  \underbrace{Ke^{-(r-q)(T_2-T_1)}}_{= 62.1085}, T_1) $$&#xA;hence a $T_2$ call struck at $K$ + 0.9778 units of a $T_1$ put with adjusted strike 62.1085.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-06-16T09:01:32.523" LastActivityDate="2016-06-16T09:01:32.523" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27647" PostTypeId="2" ParentId="1392" CreationDate="2016-06-16T09:14:50.803" Score="0" Body="&lt;p&gt;In regards to the above answers, for tick data or time series , you could probably use a combination of redis (in memory data-store) &amp;amp; mongodb, or use Hbase with bus events.&lt;/p&gt;&#xA;" OwnerUserId="22181" LastActivityDate="2016-06-16T09:14:50.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27648" PostTypeId="2" ParentId="18305" CreationDate="2016-06-16T09:51:47.550" Score="10" Body="&lt;p&gt;@Gordon, here is how I would interpret this excerpt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume that the discussion starts with $\bf{SALVA}$ explaining to $\bf{SAGE}$ that, in the absence of arbitrage opportunities, it is always possible to identify an equivalent martingale measure (EMM) $\mathbb{Q}$ under which prices of financial instruments can be written as expectations, with no concern for investors' risk-aversion. $\bf{SALVA}$ goes on by explaining the concept of self-financing strategies, no arbitrage etc. but $\bf{SAGE}$ interrupts... he wants something more pragmatic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\bf{SAGE}$. This seems like a beautiful theory. But assume that the underlying asset follows a geometric Brownian motion in the real-world&#xA;$$ \frac{dS_t}{S_t} = \mu dt + \sigma dW_{t}^\mathbb{P}$$&#xA;How does that translate to your so-called risk-neutral world?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\bf{SALVA}$. Well you would appeal to the Girsanov theorem to find out. It goes like this. Define &#xA;$$ \lambda = \frac{\mu - r}{\sigma} $$&#xA;as the Sharpe ratio of your underlying asset, which you could interpret as a return risk premium. Your SDE can then be re-written as&#xA;$$ \frac{dS_t}{S_t} = r dt + \sigma d(W_{t}^\mathbb{P} + \lambda t)$$&#xA;now defining the risk-neutral measure $\mathbb{Q}$ through its Radon-Nikodym derivative&#xA;$$ \left. \frac{d\mathbb{P}}{d\mathbb{Q}} \right\vert_{\mathcal{F}_t} = \mathcal{E}[{\color{blue}{-\lambda W_t^{\mathbb{P}}}}] $$&#xA;Gisanov theorem states that the process&#xA;$$ W_t^{\mathbb{P}} - \langle W^{\mathbb{P}}, {\color{blue}{-\lambda W^{\mathbb{P}}}} \rangle_t = W_t^{\mathbb{P}}  + \lambda t $$&#xA;is a $\mathbb{Q}$-Brownian motion so that we can write:&#xA;$$ \frac{dS_t}{S_t} = r dt + \sigma dW_{t}^\mathbb{Q}$$&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$\bf{SAGE}$. Wait, isn't your Girsanov theorem saying that instantaneous vols and correlations for diffusions are the same under the two measures?&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$\bf{SALVA}$. [looking at Sage carefully] As usual, you pretend to be a jerk but you are quite smart. Yes, you would be right. But it's not that simple. Parametrizing the Radon-Nikodym...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;... wait, let me give you a practical example. Consider a diffusion model where volatility is allowed to be stochastic. Under the real-world this model for instance reads&#xA;\begin{gather}&#xA;\frac{dS_t}{S_t} = \mu_t dt + \sqrt{v_t} dW_t^\mathbb{P} \\&#xA;dv_t = \alpha dt + \beta dB_t^\mathbb{P} \tag{1} \\&#xA;d\langle W^\mathbb{P}, B^\mathbb{P} \rangle_t = \rho dt&#xA;\end{gather}&#xA;The instantaneous variance of your underlying asset (actually that of its log-returns) is $v_t$ with $v_t$ given by $(1)$. Now let's see how that changes when we move to the risk-neutral measure. I'll cut the details but under $\mathbb{Q}$, the price of any self-financing strategy, discounted at the risk-free rate, should be a martingale. We shall assume that the underlying pays no dividend, so that investing in it is a self financing strategy...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\bf{SAGE}$. You're about to lose me in your beautiful theories once again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\bf{SALVA}$. Wait, all this boils down to saying that you should be able to write &#xA;$$ \frac{dS_t}{S_t} = r dt + \text{&amp;lt;insert something here&amp;gt;}\ dW_t^{\mathbb{Q}} $$&#xA;as we did in the GBM case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\bf{SAGE}$. I guess I could live with that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\bf{SALVA}$. Good. Well to do this, we once again appeal to Girsanov. Drawing our inspiration from what we did in the GBM case, let's define the Radon-Nikodym derivative as&#xA;$$ \left. \frac{d\mathbb{P}}{d\mathbb{Q}} \right\vert_{\mathcal{F}_t} = \mathcal{E}[{\color{blue}{-\lambda W_t^{\mathbb{P}} - \lambda_\perp W_t^{\mathbb{P},\perp}}}] $$&#xA;where &#xA;$$\lambda := \frac{\mu_t-r}{\sqrt{v_t}}$$ &#xA;and $\lambda_\perp$ is anything you want as long as $W_t^{\mathbb{P},\perp}$ is independent of $W_t^\mathbb{P}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now take the equation for $S_t$. Given the definition of $\lambda$ we get something similar to the GBM case:&#xA;$$ \frac{dS_t}{S_t} = r dt + \sqrt{v_t} d(W_t^{\mathbb{P}} + \lambda t) $$&#xA;Now we use Girsanov and see that:&#xA;$$ W_t^{\mathbb{Q}} = W_t^{\mathbb{P}} - \langle W^{\mathbb{P}}, {\color{blue}{-\lambda W^{\mathbb{P}} - \lambda_\perp W^{\mathbb{P},\perp}}} \rangle_t $$&#xA;using the bilinarity of quadratic variation and the independence of $W^\mathbb{P}_t$ and $W^\mathbb{P,\perp}_t$ we have&#xA;$$ W_t^{\mathbb{Q}} = W_t^{\mathbb{P}} + \lambda t $$&#xA;and that regardless of the value of $\lambda_\perp$. But, if we now look at the equation for the instantaneous variance:&#xA;$$ dv_t = \alpha dt + \beta dB_t^\mathbb{P} $$&#xA;Girsanov thoerem tells us that&#xA;$$ B_t^\mathbb{Q} = B_t^\mathbb{P} - \langle B^\mathbb{P}, {\color{blue}{-\lambda W^{\mathbb{P}} - \lambda_\perp W^{\mathbb{P},\perp}}} \rangle_t $$&#xA;and using the fact that (Cholesky decomposition)&#xA;$$ B_t^\mathbb{P} = \rho W_t^{\mathbb{P}} + \sqrt{1-\rho^2} W_t^{\mathbb{P},\perp} $$&#xA;along with the bilinearity property of quadratic variation we have that:&#xA;\begin{align}&#xA; B_t^\mathbb{Q} &amp;amp;= B_t^\mathbb{P} - \left\langle \rho W^{\mathbb{P}} + \sqrt{1-\rho^2} W^{\mathbb{P},\perp}, -\lambda W^{\mathbb{P}} - \lambda_\perp W^{\mathbb{P},\perp} \right\rangle_t \\&#xA;&amp;amp;= B_t^\mathbb{P}  + (\lambda \rho + \lambda_\perp \sqrt{1-\rho^2}) t &#xA;\end{align}&#xA;and at the end of the day:&#xA;\begin{gather}&#xA;\frac{dS_t}{S_t} = r dt + \sqrt{v_t} dW_t^\mathbb{Q} \\&#xA;dv_t = (\alpha - \beta(\lambda \rho + \lambda_\perp \sqrt{1-\rho^2}) )dt + \beta dB_t^\mathbb{Q} \tag{2} \\&#xA;d\langle W^\mathbb{Q}, B^\mathbb{Q} \rangle_t = \rho dt&#xA;\end{gather}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\bf{SAGE}$. I think I get it. When I look at the dynamics of the instantaneous variance under the real-world measure versus that under your risk-neutral measure (i.e. when I compare $(1)$ to $(2)$), the instantaneous volatility process is not the same anymore, contrary to the GBM case. And what you were starting to say with &quot;parametrizing the Radon-Nikodym...&quot; here transpires through the fact that the dynamics under $\mathbb{Q}$ really depends on the parameter $\lambda_\perp$, which we have defined as an arbitrary constant: the dynamics under $\mathbb{Q}$ is somewhat defined &quot;up to an arbitrary parameter&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\bf{SALVA}$. [looking at SAGE carefully again]. You are definitely anything but a jerk. Indeed... and you would have reached the exact same conclusion should you have used a dynamic replication argument rather than the martingale approach + Girsanov. The financial rationale is that, because there exists no unique way of hedging the stochasticity of volatility (remember that the stochasticity of the underlying price, can be addressed by taking positions in the underlying itself, since it trades), you face an indetermination: the ideal hedging strategy depends on you... the same kind of indetermination as with what value of $\lambda_\perp$ to pick when parametrising the Radon-Nikodym derivative. We say that the market model is incomplete: there are less marketed securities than there are independent sources of risk (here the represented by the independent Brownian motions $W^{\mathbb{P}}$ and $W^{\mathbb{P},\perp}$. Now the tricky question is how to choose a particular measure $\mathbb{Q}$ out of this set of admissible measures?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\bf{SAGE}$. Let's go and get a coffee. I'm tired.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-06-21T14:19:25.997" LastActivityDate="2016-06-21T14:19:25.997" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27649" PostTypeId="1" CreationDate="2016-06-16T11:12:13.570" Score="1" ViewCount="36" Body="&lt;p&gt;I have some cash that needs to sit on an account for some time (less then a year, where I will withdraw an amount every month).&#xA;I need them in a fixed price/low volatility asset that gives an interest every month or so. Any suggestions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I looked into dividend ETFs, but they are highly correlated with SP500 and I don't want to be impacted by the stock markets movements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you guys think of something?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers&#xA;TY &lt;/p&gt;&#xA;" OwnerUserId="22182" LastActivityDate="2016-06-16T12:28:03.310" Title="I need a low volatility asset that gives an interest/dividen" Tags="&lt;dividends&gt;&lt;interest&gt;&lt;low-volatility&gt;" AnswerCount="2" CommentCount="1" ClosedDate="2016-06-16T16:41:54.917" ContentLicense="CC BY-SA 3.0" />
  <row Id="27650" PostTypeId="2" ParentId="27649" CreationDate="2016-06-16T11:45:11.870" Score="0" Body="&lt;p&gt;Have you looked at money market ETFs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like Pimco's MINT &lt;a href=&quot;http://finance.yahoo.com/quote/MINT&quot; rel=&quot;nofollow&quot;&gt;http://finance.yahoo.com/quote/MINT&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-06-16T11:45:11.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27651" PostTypeId="2" ParentId="27649" CreationDate="2016-06-16T12:20:53.947" Score="0" Body="&lt;p&gt;In addition to money market ETFs already mentioned, have you considered short term bond ETFs like VGSH and VCSH? [This is what I use]. They offer a bit more yield, though admittedly at a slightly higher duration risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://personal.vanguard.com/us/funds/snapshot?FundId=3142&amp;amp;FundIntExt=INT&quot; rel=&quot;nofollow&quot;&gt;https://personal.vanguard.com/us/funds/snapshot?FundId=3142&amp;amp;FundIntExt=INT&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://personal.vanguard.com/us/funds/snapshot?FundId=3145&amp;amp;FundIntExt=INT&quot; rel=&quot;nofollow&quot;&gt;https://personal.vanguard.com/us/funds/snapshot?FundId=3145&amp;amp;FundIntExt=INT&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-06-16T12:28:03.310" LastActivityDate="2016-06-16T12:28:03.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27652" PostTypeId="1" AcceptedAnswerId="27654" CreationDate="2016-06-16T14:38:55.687" Score="3" ViewCount="183" Body="&lt;p&gt;Assuming my underline asset price follows the process:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d\ln (F_{t,T})=-(1/2)\sigma ^2e^{-2\lambda(T-t)}dt+\sigma e^{-\lambda(T-t)}dB_t $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How should I derive an option price formula? &lt;/p&gt;&#xA;" OwnerUserId="22152" LastEditorUserId="467" LastEditDate="2016-06-23T15:19:55.090" LastActivityDate="2016-06-23T15:19:55.090" Title="How to derive an option price for an asset with these dynamics?" Tags="&lt;options&gt;&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27653" PostTypeId="2" ParentId="27625" CreationDate="2016-06-16T14:51:08.550" Score="1" Body="&lt;p&gt;Unfortunately with the S&amp;amp;P ratings, the rating is not in term of timeseries &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.standardandpoors.com/en_US/web/guest/home&quot; rel=&quot;nofollow&quot;&gt;http://www.standardandpoors.com/en_US/web/guest/home&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If anyone is able to find any historical S&amp;amp;P credit ratings by country, please post them.&lt;/p&gt;&#xA;" OwnerUserId="17557" LastActivityDate="2016-06-16T14:51:08.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27654" PostTypeId="2" ParentId="27652" CreationDate="2016-06-16T15:16:15.990" Score="3" Body="&lt;p&gt;For $0 &amp;lt; T_0\le T$, consider the option with payoff, at the option maturity $T_0$, of the form&#xA;\begin{align*}&#xA;\max(F_{T_0, T}-K, \, 0).\tag{1}&#xA;\end{align*}&#xA;Note that&#xA;\begin{align*}&#xA;F_{T_0, T} &amp;amp;= F_{0, T}\exp\left(-\frac{\sigma^2}{2}\int_0^{T_0} e^{-2\lambda (T-t)} dt+\sigma \int_0^{T_0}e^{-\lambda (T-t)} dB_t\right).&#xA;\end{align*}&#xA;Let&#xA;\begin{align*}&#xA;\hat{\sigma}^2 &amp;amp;= \frac{\sigma^2}{T_0}\int_0^{T_0} e^{-2\lambda (T-t)} dt\\&#xA;&amp;amp;=\frac{e^{-2\lambda T}\sigma^2}{2\lambda T_0}\left(e^{2\lambda T_0} -1\right).&#xA;\end{align*}&#xA;Then, in distribution,&#xA;\begin{align*}&#xA;F_{T_0, T} = F_{0, T}\exp\left(-\frac{\hat{\sigma}^2}{2} T_0 + \hat{\sigma} \sqrt{T_0} Z\right),&#xA;\end{align*}&#xA;where $Z$ is a standard normal random variable. The value of Payoff $(1)$ is now given by&#xA;\begin{align*}&#xA;e^{-r T_0}\Big[F_{0, T}\Phi(d_1) - K\Phi(d_2) \Big],&#xA;\end{align*}&#xA;where &#xA;\begin{align*}&#xA;d_1 &amp;amp;= \frac{\ln \frac{F_{0, T}}{K} + \frac{\hat{\sigma}^2}{2} T_0}{\hat{\sigma} \sqrt{T_0}},\\&#xA;d_2 &amp;amp;= d_1 - \hat{\sigma} \sqrt{T_0},&#xA;\end{align*}&#xA;and $\Phi$ is the cumulative distribution function of a standard normal random variable.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-06-16T15:16:15.990" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="27655" PostTypeId="1" AcceptedAnswerId="27657" CreationDate="2016-06-16T15:21:30.250" Score="5" ViewCount="382" Body="&lt;p&gt;It is possible to bet on the Brexit e.g. on this page:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://sports.ladbrokes.com/en-gb/betting/politics/british/eu-referendum/uk-european-referendum/220800266/&quot; rel=&quot;noreferrer&quot;&gt;https://sports.ladbrokes.com/en-gb/betting/politics/british/eu-referendum/uk-european-referendum/220800266/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The quotes are 8/15 for remain, and 8/4 for leave.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone derive the implied probabilities for remain/leave?&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2016-06-18T11:25:48.163" Title="Brexit implied probability" Tags="&lt;probability&gt;&lt;economics&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27656" PostTypeId="2" ParentId="27655" CreationDate="2016-06-16T15:31:53.530" Score="-1" Body="&lt;p&gt;It's 6/4 to leave right now. Hence, the implied probabilities are 6/10 = 0.6 to leave and 8/23 to stay. So it's about 2/3 to leave, 1/3 to stay. You can't do much better, since you don't know number of bets and the profit margin for the venue.&lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2016-06-16T15:31:53.530" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27657" PostTypeId="2" ParentId="27655" CreationDate="2016-06-16T16:52:37.327" Score="4" Body="&lt;p&gt;The general formula for conversion of &quot;a to b&quot; odds to a probability is $p=\frac{b}{a+b}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.calculatorsoup.com/calculators/games/odds.php&quot; rel=&quot;nofollow&quot;&gt;http://www.calculatorsoup.com/calculators/games/odds.php&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So 8/15 remain implies remain with probability 0.652&lt;/p&gt;&#xA;&#xA;&lt;p&gt;8/4 for leave implies leave with probability 0.333&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The amount 1-0.652-0.333 = 0.0145 represents the bid-ask spread or loss that you suffer (and the other side collects) for making both bets.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-06-16T17:00:21.740" LastActivityDate="2016-06-16T17:00:21.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27658" PostTypeId="1" AcceptedAnswerId="30022" CreationDate="2016-06-16T20:02:02.813" Score="2" ViewCount="4814" Body="&lt;p&gt;I want to use a Matlab script to calculate Heston Nandi GARCH prices. I found an appropriate script online and it asks for the &quot;unconditional variance&quot; as an input. How do I calculate the appropriate unconditional volatility? I found this formula online: $$\sigma^2 = s^2 = \frac{1}{n-1} * \sum_{t=1}^n [r^2_t] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this the appropriate one to use? Do I take the variance according to this formula for all asset returns up to the point in time of the option I am trying to value?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/JLZgV.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/JLZgV.png&quot; alt=&quot;Script&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Full Script: `function OptionPrice=HestonNandi(S_0,X,Sig_,T,r)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;%%%%%%%%%%%%%&#xA;% this function calculates the price of Call option based on the GARCH &#xA;% option pricing formula of Heston and Nandi(2000). The input to the&#xA;% function are: current price of the underlying asset, strike price,&#xA;% unconditional variance of the underlying asset, time to maturity in days,&#xA;% and daily risk free interest rate.&#xA;%%%%%%%%%%%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;% Author: Ali Boloorforoosh&#xA;% email:  a_bol@jmsb.concordia.ca&#xA;% Date:   Nov. 1,08&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;            %%%%% sample inputs %%%%%&#xA;% S_0=100;                    stock price at time t&#xA;% X=100;                      strike prices&#xA;% Sig_=.04/252;               unconditional variances per day&#xA;% T=30;                       option maturity&#xA;% r=.05/365;                  daily risk free rate&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;OptionPrice=.5*S_0+(exp(-r*T)/pi)&lt;em&gt;quad(@Integrand1,eps,100)-X&lt;/em&gt;exp(-r&lt;em&gt;T)&lt;/em&gt;(.5+(1/pi)*quad(@Integrand2,eps,100));&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% function Integrand1 and Integrand2 return the values inside the &#xA;% first and the second integrals&#xA;&#xA;function f1=Integrand1(phi)&#xA;    f1=real((X.^(-i*phi).*charac_fun(i*phi+1))./(i*phi));&#xA;end&#xA;&#xA;function f2=Integrand2(phi)&#xA;    f2=real((X.^(-i*phi).*charac_fun(i*phi))./(i*phi));&#xA;end&#xA;&#xA;% function that returns the value for the characteristic function&#xA;function f=charac_fun(phi)&#xA;&#xA;    phi=phi';    % the input has to be a row vector&#xA;&#xA;    % GARCH parameters&#xA;    lam=2;&#xA;    lam_=-.5;                   % risk neutral version of lambda&#xA;    a=.000005;&#xA;    b=.85;&#xA;    g=150;                      % gamma coefficient&#xA;    g_=g+lam+.5;                % risk neutral version of gamma&#xA;    w=Sig_*(1-b-a*g^2)-a;       % GARCH intercept&#xA;&#xA;    % recursion for calculating A(t,T,Phi)=A_ and B(t,T,Phi)=B_&#xA;    A(:,T-1)=phi.*r;&#xA;    B(:,T-1)=lam_.*phi+.5*phi.^2;&#xA;&#xA;    for i=2:T-1&#xA;        A(:,T-i)=A(:,T-i+1)+phi.*r+B(:,T-i+1).*w-.5*log(1-2*a.*B(:,T-i+1));&#xA;        B(:,T-i)=phi.*(lam_+g_)-.5*g_^2+b.*B(:,T-i+1)+.5.*(phi-g_).^2./(1-2.*a.*B(:,T-i+1));&#xA;    end&#xA;&#xA;    A_=A(:,1)+phi.*r+B(:,1).*w-.5*log(1-2.*a.*B(:,1));                    % A(t;T,phi)&#xA;    B_=phi.*(lam_+g_)-.5*g_^2+b.*B(:,1)+.5*(phi-g_).^2./(1-2.*a.*B(:,1)); % B(t;T,phi)&#xA;&#xA;    f=S_0.^phi.*exp(A_+B_.*Sig_);&#xA;    f=f'; % the output is a row vector&#xA;&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;end&lt;/p&gt;&#xA;&#xA;&lt;p&gt;`&lt;/p&gt;&#xA;" OwnerUserId="20377" LastActivityDate="2019-06-24T09:16:29.360" Title="What is the unconditional variance for a GARCH model?" Tags="&lt;volatility&gt;&lt;garch&gt;&lt;variance&gt;&lt;heston&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="27659" PostTypeId="2" ParentId="8735" CreationDate="2016-06-16T20:12:12.760" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.csidata.com&quot; rel=&quot;nofollow&quot;&gt;CSI&lt;/a&gt;: Expensive, but the data is not bad (quality wise)&lt;/li&gt;&#xA;&lt;li&gt;SIX Financial (former Telekurs): Middle tier price-wise, OK data&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.crbtrader.com/marketdata&quot; rel=&quot;nofollow&quot;&gt;CRB&lt;/a&gt;: Terrible customer service, but reasonable pricing&lt;/li&gt;&#xA;&lt;li&gt;CQG (don't know about their pricing)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2909" LastActivityDate="2016-06-16T20:12:12.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27660" PostTypeId="2" ParentId="25905" CreationDate="2016-06-17T00:02:48.240" Score="1" Body="&lt;p&gt;Why are you using only stock returns? Do you&#xA;Mean you're using portfolios or individual stocks? The latter is a tough sell, and I wouldn't recommend it. Running regressions on portfolios is far more standard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, now, motivating the models: If you want to take a theoretical stance, recent(ish) work in asset pricing has focused on grounding the Fama-French factors. To the best of my knowledge, less work has gone into theoretically founding the fourth factor. In particular, I would look into the work of Kogan (at MIT) and production based asset pricing if you want a theoretical justification.&lt;/p&gt;&#xA;" OwnerUserId="22192" LastActivityDate="2016-06-17T00:02:48.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27661" PostTypeId="2" ParentId="27536" CreationDate="2016-06-17T00:08:07.553" Score="1" Body="&lt;p&gt;If you have a formula for options on stock, you can turn it into a formula for options on futures by using the relation $S=F e^{-(r-d)T}$. In other words you observe the price of the future F, you turn it into S by this relation and then you pass this pseudo stock price to the options on stock function or program that you have.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you do this to the Black-Scholes formula you get the &quot;Black 1976&quot; formula which is the simplest options on future formula available. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the Greeks, a similar approach works. For example $\Delta_F=\frac{\partial C}{\partial F}$ (the Delta in terms of the futures price) can be found as $\frac{\partial C}{\partial S}\frac{\partial S}{\partial F}$ where $\frac{\partial C}{\partial S} =\Delta_S$ is the standard delta that your existing program knows how to compute.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2016-06-17T00:08:07.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27662" PostTypeId="2" ParentId="3156" CreationDate="2016-06-17T01:04:38.323" Score="2" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/manahl/arctic&quot; rel=&quot;nofollow&quot;&gt;manahl/arctic: High performance datastore for time series and tick data&lt;/a&gt;  seems a good alternative for time series and tick data. It is built upon mongodb.&lt;/p&gt;&#xA;" OwnerUserId="5427" LastActivityDate="2016-06-17T01:04:38.323" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27665" PostTypeId="2" ParentId="14672" CreationDate="2016-06-17T10:29:24.857" Score="0" Body="&lt;p&gt;In a few words. The CAPM assume the concave utility function because its, implicitly, assume the validity of mean-variance approach. In utility function way the concavity is related with the concept of risk aversion and risk=variance of return. If utility function is convex the investor is prone to risk and CAPM is not valid and mean-variance as well. If as in Prospect Theory there are different risk-preference choice in gain and loss field ... CAPM is valid only in gain field and mean-variance as well.  &lt;/p&gt;&#xA;" OwnerUserId="20746" LastActivityDate="2016-06-17T10:29:24.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27666" PostTypeId="1" AcceptedAnswerId="27667" CreationDate="2016-06-17T10:30:52.070" Score="1" ViewCount="311" Body="&lt;p&gt;The NOK overnight index &lt;a href=&quot;https://www.finansnorge.no/en/interest-rates/nowa---the-norwegian-overnight-weighted-average/&quot; rel=&quot;nofollow&quot;&gt;NOWA&lt;/a&gt; is &lt;a href=&quot;https://www.finansnorge.no/contentassets/76c75430a66548cd9d6740cea6fb55f6/download/nowa-rules.pdf&quot; rel=&quot;nofollow&quot;&gt;defined as&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Reported interest rates shall be calculated as nominal annual rates&#xA;  for the actual number of days in the year ahead (365 or 366).&#xA;  (The percentage return over the term is calculated by dividing the interest rate by the actual number of days in the year ahead and multiplying it by the actual number of days to maturity).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;As far as I can tell, this is a relatively non-standard day count (because it refers to the year from the fixing date). My interpretation of the rule gives:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Fixing on 2015-02-28 = 365 days (2015-02-28 to 2016-02-27 inclusive)&lt;/li&gt;&#xA;&lt;li&gt;Fixing on 2015-03-01 = 366 days (2015-03-01 to 2016-02-29 inclusive)&lt;/li&gt;&#xA;&lt;li&gt;Fixing on 2016-02-28 = 366 days (2016-02-28 to 2017-02-27 inclusive)&lt;/li&gt;&#xA;&lt;li&gt;Fixing on 2016-02-29 = 365 days (2016-02-29 to 2017-02-28 inclusive)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Two questions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Is my interpretation correct?&lt;/li&gt;&#xA;&lt;li&gt;Does this day count have a recognised name?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="18748" LastEditorUserId="18748" LastEditDate="2016-06-17T11:07:22.707" LastActivityDate="2016-06-17T12:53:21.467" Title="NOK NOWA overnight day count" Tags="&lt;daycounting&gt;&lt;convention&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27667" PostTypeId="2" ParentId="27666" CreationDate="2016-06-17T12:53:21.467" Score="0" Body="&lt;p&gt;Yes the interpretation is correct as you are using the day count convention &lt;strong&gt;Actual/Actual&lt;/strong&gt; and yes this day count convention is a non -standard as there are no fixed number of days we have to take like in case of Actual/360 or Actual/365. The reason for using Actual/Actual here as we are calculating on an accrued basis like we do for the calculation of accrued interest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I know there is no standard terminology for the various day count conventions but the below are the recognized names worldwide:-&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actual/Actual, Act/Act ICMA, ISMA-99, Act/Act ISMA&lt;/p&gt;&#xA;" OwnerUserId="18663" LastActivityDate="2016-06-17T12:53:21.467" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27668" PostTypeId="1" AcceptedAnswerId="27669" CreationDate="2016-06-17T13:32:41.390" Score="1" ViewCount="71" Body="&lt;p&gt;We can calculate the expected stock return (under the measure $Q$) from at-the-money ($K=S_t$) option prices as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E\left(\frac{S_T-S_t}{S_t}\right)=\frac{e^{rT}}{S_t}(C_t-P_t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The result is mainly based on the fact that&#xA;$$(S_T-S_t)^+-(S_t-S_T)^+=S_T-S_t$$&#xA;and $C_t=e^{-rT}E((S_T-K)^+)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;I am looking for an expression of stock return using options with $K\neq S_t$.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first approach was to equate the two sides and determine the difference:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$(S_T-K)^+-(K-S_T)^+\stackrel{!}{=} S_T-S_t+\left[(S_T-S_t)^+-(S_t-S_T)^+-((S_T-K)^+-(K-S_T)^+)\right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe it would be possible to rearrange this term to get a sum of option payoffs plus a deterministic part (i.e. a bond).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please let me know if you find a solution.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2016-06-17T13:44:30.363" Title="Implied Expected Stock Return from European Option Prices" Tags="&lt;options&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;&lt;expected-return&gt;&lt;math&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27669" PostTypeId="2" ParentId="27668" CreationDate="2016-06-17T13:44:30.363" Score="3" Body="&lt;p&gt;Note that&#xA;\begin{align*}&#xA;\frac{S_T-S_t}{S_t} &amp;amp;= \frac{S_T-K +K-S_t}{S_t}\\&#xA;&amp;amp;=\frac{(S_T-K)^+-(K-S_T)^+ +K-S_t}{S_t}.&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;E\left(\frac{S_T-S_t}{S_t} \mid \mathcal{F}_t \right) &amp;amp;= \frac{e^{rT}}{S_t}(C_t-P_t)+ \frac{K-S_t}{S_t}.&#xA;\end{align*}&#xA;where &#xA;\begin{align*}&#xA;C_t &amp;amp;= e^{-rT} E\left((S_T-K)^+ \mid \mathcal{F}_t \right),\\&#xA;P_t &amp;amp;= e^{-rT} E\left((K-S_T)^+ \mid \mathcal{F}_t \right).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-06-17T13:44:30.363" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27670" PostTypeId="2" ParentId="1392" CreationDate="2016-06-17T14:02:27.547" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I am wondering if anyone has used NoSQL ... to store and analyze data.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes. Have a look at &lt;a href=&quot;https://github.com/manahl/arctic&quot; rel=&quot;nofollow&quot;&gt;arctic&lt;/a&gt; on github. This is an open-source API built on top of MongoDB, that is in production use by one of the largest hedge funds in the world, for storing time-series data.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I would imagine that NoSQL would be much faster.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In the github &lt;a href=&quot;https://github.com/manahl/arctic/wiki&quot; rel=&quot;nofollow&quot;&gt;wiki&lt;/a&gt; you'll find links to presentations where they show performance metrics vs their existing, commercial DB. This is achieved partly by storing the data in compressed format, and sending over the wire as-such (this is a feature of the API; not MongoDB).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other cool features include versioning, quotas, acls.&lt;/p&gt;&#xA;" OwnerUserId="7230" LastActivityDate="2016-06-17T14:02:27.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27671" PostTypeId="1" CreationDate="2016-06-17T14:28:12.360" Score="1" ViewCount="88" Body="&lt;p&gt;The following is an excerpt from &lt;em&gt;Introduction to the Mathematics of Finance&lt;/em&gt; by Roman:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Expiration Dates&lt;/strong&gt;&lt;br&gt;&#xA;  The last trading day of an option is the third Friday of the expiration month and&#xA;  the option actually expires on the following Saturday. Every stock option is on&#xA;  one of three expiration cycles, which consists of one month per quarter, equally&#xA;  spaced 3 months apart, but starting at different months:  &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;1) January cycle: Jan, Apr, July, Oct&lt;br&gt;&#xA;  2) February cycle: Feb, May, Aug, Nov&lt;br&gt;&#xA;  3) March cycle: Mar, June, Sept, Dec  &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;If the expiration date for the current month has not passed, then there exist&#xA;  options that trade with expiration dates in the current month, the next month and&#xA;  the following two months of the cycle for that underlying. If the expiration date&#xA;  for the current month has passed, then there exist options that trade for the next&#xA;  month, the month after that and the following two months in the cycle.&lt;/strong&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;For example, IBM is on the January cycle. At the beginning of January, there are&#xA;  options that expire in January, February, April and July. Late in January, there&#xA;  are options that expire in February, March, April and July. At the beginning of&#xA;  May, options expire in May, June, July and October.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I don't understand the paragraph in bold. Is it a &lt;em&gt;rule&lt;/em&gt; for the expiration dates? Would anybody explain the IBM example? I totally don't understand where are those months from. &lt;/p&gt;&#xA;" OwnerUserId="20908" LastActivityDate="2016-06-18T13:23:56.863" Title="How should I understand expiration dates?" Tags="&lt;options&gt;&lt;expiration&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27672" PostTypeId="1" CreationDate="2016-06-17T14:52:07.327" Score="5" ViewCount="2680" Body="&lt;p&gt;I am being puzzled while calculating jensen's alpha for single stocks. I have monthly returns data and have calculated alpha for each stock on a monthly basis (used 36-month rolling window for beta estimation). Now, I need to convert my monthly alphas into quarterly and yearly observations. What is the best way to do it? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought of averaging over 3 and 12 months, respectively, but not sure if it's correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would be glad if anyone could help!&lt;/p&gt;&#xA;" OwnerUserId="22200" LastActivityDate="2019-06-07T15:03:35.400" Title="How to convert Jensen's Alpha from monthly to quarterly observations" Tags="&lt;returns&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27673" PostTypeId="1" AcceptedAnswerId="32383" CreationDate="2016-06-17T16:20:30.367" Score="4" ViewCount="3289" Body="&lt;p&gt;Answering this question is relevant to assess the quality of a time series in order to observe whether the data vendor applies some rounding to the data or is more decimal are present than the actual tick size.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please provide possibly the official source (e.g. www.nasdaq.com, www.nyse.com)&lt;/p&gt;&#xA;" OwnerUserId="22202" LastActivityDate="2017-02-12T21:41:56.410" Title="Where can be found the tick size list for stocks traded in NASDAQ and NYSE?" Tags="&lt;equities&gt;&lt;nasdaq&gt;&lt;nyse&gt;&lt;tick&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27674" PostTypeId="1" AcceptedAnswerId="38916" CreationDate="2016-06-17T16:26:50.073" Score="17" ViewCount="1160" Body="&lt;p&gt;The highest rated answer to the question on &lt;a href=&quot;https://quant.stackexchange.com/questions/156/what-concepts-are-the-most-dangerous-ones-in-quantitative-finance-work&quot;&gt;What concepts are the most dangerous ones in quantitative finance work?&lt;/a&gt; is this one:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;blockquote&gt;&#xA;    &lt;p&gt;&lt;strong&gt;Correlation&lt;/strong&gt;&lt;/p&gt;&#xA;  &lt;/blockquote&gt;&#xA;  &#xA;  &lt;p&gt;Correlations are notoriously unstable in financial time series [...]&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question&lt;/strong&gt;&lt;br&gt;&#xA;My question is a little bit broader than just about linear dependence, it is:&lt;br&gt;&lt;em&gt;What is the most stable, non-trivial dependence structure in financial data?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With &lt;em&gt;non-trivial&lt;/em&gt; I mean that I don't want answers that are about direct connections, e.g. between derivative and underlying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The dependence structure can be either &lt;em&gt;cross-sectional&lt;/em&gt; or &lt;em&gt;through time&lt;/em&gt; with univariate time series, it can also be &lt;em&gt;non-linear&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The context of my question is that I am preparing the documentation for a new machine learning R package I wrote and I am looking for a good showcase in the financial sphere. Now this is not a trivial feat given that correlations are notoriously... see above ;-)&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2018-03-21T19:48:13.783" Title="What is the most stable, non-trivial dependence structure in finance?" Tags="&lt;finance&gt;&lt;correlation&gt;&lt;dependence&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="27675" PostTypeId="2" ParentId="27671" CreationDate="2016-06-17T17:02:11.973" Score="4" Body="&lt;p&gt;Yes, these are rules that the exchange uses to start trading new options as the old ones expire (if no new options are introduced trading will come to a halt...). These rules guarantee that a &quot;reasonable number&quot; (which is subjective, of course) of future expiration dates are in existence at all times. But these rules are not that important (not worth memorizing) and they can change if the Exchange decides they want to offer more (or fewer) options in response to customer demand.  My suggestion: don't spend too much effort now on these details... (you can look up the information later if needed).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first example that they give is pretty easy to follow:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;For example, IBM is on the January cycle. At the beginning of January, there are options that expire in January, February, April and July. Late in January, there are options that expire in February, March, April and July.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What this is saying is &quot;upon expiration of the January 2017 options, the exchange will begin trading IBM options for March 2017&quot;, so that as you can see the number of available expiration dates will remain equal to 4.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general these rules determine, upon expiration of an option, if one (or more) new options need to be introduced, and which one(s) it will be.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-06-18T13:23:56.863" LastActivityDate="2016-06-18T13:23:56.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27676" PostTypeId="2" ParentId="8178" CreationDate="2016-06-17T17:24:31.723" Score="1" Body="&lt;p&gt;&lt;strong&gt;Relatively quick Solution&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $U$ and $V$ be normally distributed with means $\mu_u\,,\,\mu_v$, variances $\sigma^2_u\,,\,\sigma^2_v$ and correlation $\rho$ then we can show ( by definition of expectation and apply joint density function ) &#xA;$$\mathbb{E}\left[\left(e^U-e^V\right)^+\right]={\large{e^{\mu_u+\frac{1}{2}\sigma_u^2}}}\Phi\left(d_1\right)-{\large{e^{\mu_v+\frac{1}{2}\sigma_v^2}}}\Phi\left(d_2\right)\qquad (1)$$&#xA;where&#xA;$$d_1=\frac{\mu_u-\mu_v+\sigma_u^2-\rho\sigma_u\sigma_v}{\sqrt{\sigma_u^2-2\rho\sigma_u\sigma_v+\sigma_v^2}}$$&#xA;and&#xA;$$d_2=\frac{\mu_v-\mu_u+\sigma_v^2-\rho\sigma_v\sigma_u}{\sqrt{\sigma_v^2-2\rho\sigma_v\sigma_u+\sigma_u^2}}$$&#xA;By application of Ito's lemma and Girsanov theorem  we have&#xA;$$\ln X_T=\ln X_t+\left(r-\frac{1}{2}{\sigma_x}^2\right)(T-t)+{\sigma_x}({W_T}^{\mathbb{Q}}-{W_t}^{\mathbb{Q}})$$&#xA;$$\ln Y_T=\ln Y_t+\left(r-\frac{1}{2}{\sigma_y}^2\right)(T-t)+{\sigma_y}({B_T}^{\mathbb{Q}}-{B_t}^{\mathbb{Q}})$$&#xA;let $U=\ln X_T$ and $V=\ln Y_T$ apply $(1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit for SRKX&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know &#xA;$$ {{f}_{U,V}}(u,v)=\frac{1}{2\pi {{\sigma }_{u}}{{\sigma }_{v}}\sqrt{1-{{\rho }^{2}}}}{{e}^{\large{-\frac{1}{2(1-{{\rho }^{2}})}\left[ {{\left( \frac{u-{{\mu }_{u}}}{{{\sigma }_{u}}} \right)}^{2}}-2\rho \left( \frac{u-{{\mu }_{u}}}{{{\sigma }_{u}}} \right)\left( \frac{v-{{\mu }_{v}}}{{{\sigma }_{v}}} \right)+{{\left( \frac{v-{{\mu }_{v}}}{{{\sigma }_{v}}} \right)}^{2}} \right]}}} $$&#xA;let &#xA;$$I=\int_{-\infty }^{+\infty }{\int_{v }^{\infty }{{{e}^{u}}}}{{f}_{U,\,V}}(u,v)dudv$$&#xA;and define &#xA;$$g(u,v)=\frac{1}{{{\sigma }_{u}}\sqrt{2\pi (1-{{\rho }^{2}})}}{{e}^{\large{-\frac{1}{2(1-{{\rho }^{2}})}{{\left[ u-\left( {{\mu }_{u}}+\rho \sigma_u \left( \frac{v-{{\mu }_{v}}}{{{\sigma }_{v}}} \right) \right) \right]}^{2}}}}}$$&#xA;Indeed $g$ &lt;strong&gt;is probability density function normal distribution&lt;/strong&gt;. we have&#xA;$$I=\int_{-\infty }^{\infty }{\frac{1}{{{\sigma }_{v}}\sqrt{2\pi }}{{e}^{\large{-\frac{1}{2}{{\left( \frac{v-{{\mu }_{v}}}{{{\sigma }_{v}}} \right)}^{2}}}}}}\left[ \int_{v }^{\infty }{{{e}^{u}}}g(u,v)du \right]dv$$&#xA;thus we can write&#xA;$$I={{e}^{{{\mu }_{u}}+\frac{1}{2}(1-{{\rho }^{2}}){{\sigma }_{u}}^{2}}} \int_{-\infty }^{\infty }{\frac{1}{{{\sigma }_{v}}\sqrt{2\pi }}{{e}^{\large{-\frac{1}{2}{{\left[ \left(\frac{v-{{\mu }_{v}}}{{{\sigma }_{v}}}\right)^2-2\rho\sigma_v\left(\frac{v-\mu_v}{\sigma_v}\right) \right]}}}}}}\Phi \left[ \Lambda  \right]dv$$&#xA;where&#xA;$$\Lambda =\frac{{{\mu }_{v}}+\rho {{\sigma }_{u}}\left( \frac{v-{{\mu }_{v}}}{{{\sigma }_{v}}} \right)+{{(1-\rho )}^{2}}{{\sigma }_{u}}^{2}-v}{{{\sigma }_{u}}\sqrt{1-{{\rho }^{2}}}}$$&#xA;let $y=\large \frac{v-{{\mu }_{v}}-\rho {{\sigma }_{u}}{{\sigma }_{v}}}{{{\sigma }_{v}}}$ by Change of variable and setting good variable we have&#xA;$$I={{e}^{{{\mu }_{u}}+\frac{1}{2}\sigma _{u}^{2}}}\Phi ({{d}_{1}})$$&#xA;using similar steps for the case&#xA;$$J=\int_{-\infty }^{+\infty }{\int_{v }^{\infty }{{{e}^{v}}}}{{f}_{U,\,V}}(u,v)dudv$$&#xA;as a result&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$J={{e}^{{{\mu }_{V}}+\frac{1}{2}\sigma _{V}^{2}}}\Phi ({{d}_{2}})$$&#xA;Now we should use $I$ and $J$ and calculate &#xA;$$E\left[(e^U-e^V)^+\right]=\int_{-\infty}^{\infty}\int_{v}^{\infty}(e^u-e^v)f_{U,V}(u,v)dudv$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-06-18T16:16:13.407" LastActivityDate="2016-06-18T16:16:13.407" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27678" PostTypeId="1" CreationDate="2016-06-17T19:28:27.627" Score="1" ViewCount="65" Body="&lt;p&gt;I'm trying to detect outliers within a financial time series which represents the ratio of cash distributions to equity holders as a percentage operating earnings for the period. Visual inspection indicates several large outliers, mostly associated around the crisis periods in '08-'09. I believe the series should likely be trend stationary as the process shouldn't have a zero mean and a time trend does not make economic sense. KPSS testing indicates stationarity around a non-zero mean which makes sense. However, I believe the indicated level is too low because of the outliers mentioned. The TSO() function, which I've used before, kicks back an error that the value supplied by optim is non-finite. I've never encountered this before and am unsure how to proceed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To clarify, &#xA;I did run auto.arima long with examining the ACF/PACF plots and no autoregressive structure was found (0,0,0). I also tinkered with the innovation types with TSO, setting to &quot;AO&quot; only as I think these are actually the only appropriate ones when the nature of the data is considered. This returned an error as well, I believe it implied that an invertible matrix was found somewhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried altering the CVAL parameter as well, this did not seem to make a difference. Interestingly, I did discover that changing the remove.method to &quot;bottom-up&quot; rather than the default setting did allow for the function to run - I think I need to better understand what is actually going on by doing that however because the auto.arima function returns ARIMA(0,1,0) with a zero mean whereas auto.arima on the original series returns arma(0,0,0) - it seems that the bottom-up outlier removal results in a difference stationary series and I believe that given the fundamentals of the series it is actually likely to be stationary around a non-zero mean but the mean value is skewed due to outliers.&lt;/p&gt;&#xA;" OwnerUserId="18557" LastActivityDate="2016-06-17T19:28:27.627" Title="Outlier removal, issue with TSO function" Tags="&lt;outliers&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27679" PostTypeId="1" CreationDate="2016-06-17T19:44:34.313" Score="1" ViewCount="139" Body="&lt;p&gt;I've read a few questions regarding this, but want some new (more recent) opinions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm in the process of pursuing a degree in Finance, complimented with some Math and a sprinkle of Computer Systems. I recently took a Java class which I had more than a knack for, and decided I wanted to make computer programming a heavier part of my education, with a lean towards financial application. I'm also hoping that having some real skills will help me stand out if the finance sector starts downsizing, as some predict it will.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am considering learning the C++ language, but am not sure if it would be more useful to learn C++ or to go into something such as Python, R or VBA since I've already learned Java. More importantly is the order that I learn these in. I graduate in two years and am wondering if it would be better to market myself as having fundamental computer skills (like C++) or something that is already targeted, like the previously mentioned languages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any other insights would be highly valued as well!&lt;/p&gt;&#xA;" OwnerUserId="22205" LastActivityDate="2016-06-17T19:44:34.313" Title="Programming language to compliment Finance degree" Tags="&lt;programming&gt;&lt;finance&gt;" AnswerCount="0" CommentCount="3" ClosedDate="2016-06-17T21:38:05.957" ContentLicense="CC BY-SA 3.0" />
  <row Id="27680" PostTypeId="1" AcceptedAnswerId="27686" CreationDate="2016-06-17T21:12:03.377" Score="4" ViewCount="820" Body="&lt;p&gt;first of all, the description of this Stackexchange forum says its for professionals or academics. I'm doing a lot of self studying and with that I was able to understand some white papers but still I'm neither a professional nor a finance student so please be kind if I'm not using the right terms all of the time. :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I'm facing the following problem:&#xA;I'm just writing a market making bot for a crypto currency and I'm using the Market Making model by Avellaneda and Stoikov. Therefore I need to model the reference price of the limit order book in the first step. Then the bid and ask spread is calculated based on the volatity, drift, trade frequency and the inventory. The reference price and the spreads are then combined to the offers (limit orders) I place.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I'm calculating this reference price by just taking the best bid and ask offer and then calculating the mid of both. However because the book I'm trying do market making in is very thin, there are a few downsides with this method.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;If somebody places even a very small limit order between the current best bid and ask offer, the reference price shifts in the opposite direction. This is a significant effect if the spread is currently high, which is quite often the case.&lt;/li&gt;&#xA;&lt;li&gt;When for example there is only one large offer which is currently the best ask or bid offer, and this offer is cancled. The price shifts in the direction of the side where the offer was cancled. I could observe this effect in a simulation with real data aswell.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Does anybody know a better way to model the reference price of a limit order book where these affects can be avoided. I have access to level one and level two data of this order book,however Id like to choose the simplest way possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe someone has links to helpful white papers or other reference literature, I'd appreciate that too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks in advance,&#xA;Flo&lt;/p&gt;&#xA;" OwnerUserId="22207" LastActivityDate="2016-06-18T13:11:30.533" Title="Model reference price of Limit order book" Tags="&lt;modeling&gt;&lt;simulations&gt;&lt;limit-order-book&gt;&lt;market-making&gt;&lt;market-model&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27681" PostTypeId="2" ParentId="26411" CreationDate="2016-06-17T21:42:38.507" Score="1" Body="&lt;p&gt;It should be related to your specific valuation model. The most common earnings related models use a risk free rate minus 3%. &lt;/p&gt;&#xA;" OwnerUserId="19598" LastActivityDate="2016-06-17T21:42:38.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27682" PostTypeId="1" AcceptedAnswerId="27684" CreationDate="2016-06-17T22:23:17.247" Score="1" ViewCount="1391" Body="&lt;p&gt;Suppose a swap is booked with maturity on June 19, 2016 (which is a Sunday). Accruals are adjusted according to the modified following roll convention and follow U.S. holidays. For the last cashflow of the swap (regardless of its length), I can think of two reasonable ways to handle the end of the accrual period:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Accrual ends on June 19, 2016 and the accrual end date is not adjusted because adjusting would cause accruals to continue past the swap's maturity date.&lt;/li&gt;&#xA;&lt;li&gt;The accrual end date is adjusted to June 20, 2016 according to its specified roll convention without regard for the maturity date of the swap.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Which of these is typically the correct choice? I looked over the 2006 ISDA definitions a bit, but I didn't find anything that specifically spoke to this case.&lt;/p&gt;&#xA;" OwnerUserId="6101" LastEditorUserId="6101" LastEditDate="2016-06-17T22:37:29.627" LastActivityDate="2016-06-17T23:27:34.347" Title="Roll convention applied to weekend swap maturity date" Tags="&lt;swaps&gt;&lt;convention&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27683" PostTypeId="1" AcceptedAnswerId="27907" CreationDate="2016-06-17T22:42:43.113" Score="0" ViewCount="521" Body="&lt;p&gt;I have been reading &lt;a href=&quot;http://www.econbiz.de/archiv1/2009/99993_likely_hit_barrier.pdf&quot; rel=&quot;nofollow&quot;&gt;Su and Rieger's paper&lt;/a&gt; on barriers and from there have been able to work out the unconditional probability of the process $dXt = μ dt + σ dWt$ touching a down barrier $α$ to be &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb{P}(\min(x_0\rightarrow _T) ≤ α) = \Phi\left(\frac{α - μT}{σ \sqrt{T}}\right) + \exp\left(\frac{2μα}{σ^2}\right) \Phi\left(\frac{α + μT}{σ\sqrt{T}}\right)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All well and good matching simulations nicely etc...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I am looking for  a closed form solution for $\mathbb{P}(\min(x_0\rightarrow _T) ≤ α\, |\, x_T = X)$ (i.e both $x_0$ and $x_T$ are known.)&lt;/p&gt;&#xA;" OwnerUserId="22208" LastEditorUserId="22208" LastEditDate="2016-06-19T17:17:45.750" LastActivityDate="2016-07-02T13:09:49.020" Title="Probability of Brownian motion particle touching barrier given path starts at $X_0$ and ends at a known $X_t$" Tags="&lt;options&gt;&lt;brownian-motion&gt;&lt;barrier&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27684" PostTypeId="2" ParentId="27682" CreationDate="2016-06-17T23:27:34.347" Score="0" Body="&lt;p&gt;The standard convention is to use the next good day as the &quot;payment day.&quot; I'd say generally speaking, the following two settings should produce identical cashflows:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Maturity date of 6/20/2016 &amp;amp; roll day of 19.&lt;/li&gt;&#xA;&lt;li&gt;Maturity date of 6/19/2016 &amp;amp; roll day of 19 or unspecified.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2016-06-17T23:27:34.347" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27686" PostTypeId="2" ParentId="27680" CreationDate="2016-06-18T13:11:30.533" Score="4" Body="&lt;p&gt;This reference price is also sometimes called intrinsic price. One of the simplest ways to improve it in regards to the mid-price (assuming you have the depth data) is the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;define a parameter: the size of a hypothetical market order. Let's say it's about the typical sum of first 3-10 order book levels of the instrument;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;execute a Buy order with such size against the ask book, and calculate execution price;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;execute a Sell order with such size against the bid book, and calculate execution price;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Calculate the intrinsic price as the average of the two prices above; &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I assume there are more sophisticated way to define the intrinsic price, but this one already looks much more stable than mid-price, and solves problems 1,2.&lt;/p&gt;&#xA;" OwnerUserId="1515" LastActivityDate="2016-06-18T13:11:30.533" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27687" PostTypeId="1" AcceptedAnswerId="27719" CreationDate="2016-06-18T13:14:45.707" Score="3" ViewCount="320" Body="&lt;p&gt;Assume that futures price $F(t,T)$ follows the Ito process as described by the following stochastic process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ln F(t,T)=lnF(0,T)+(Z_1(t)e^{-k(T-t)}+Z_2(t))-(1/4k)[(1-e^{-2kT})(h_1^2+h_2^2))+4h_1h_0(1-e^{-kT})+2h_0^2tk]$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Z_1(t)$ and $Z_2(t)$ are state variables following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dZ_1(t)=-kZ_1(t)dt+h_1dW_1(t)+h_2dW_2(t)$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dZ_2(t)=h_0dW_1(t)$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume $W_1$ and $W_2$ are independent. How to derive kalman filter update/measurement equations to estimate the parameters $h_0,h_1,h_2,k$? Observations are $lnF(t,T)$. Many Thanks&lt;/p&gt;&#xA;" OwnerUserId="22152" LastEditorUserId="22152" LastEditDate="2016-06-20T21:31:17.910" LastActivityDate="2016-06-21T22:55:47.357" Title="kalman filter update equation" Tags="&lt;kalman&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27689" PostTypeId="1" CreationDate="2016-06-18T14:34:56.763" Score="2" ViewCount="70" Body="&lt;p&gt;I am implementing a basic trinomial model with constant volatility right now. I want to do an extension that does not take a constant riskfree rate as input, but interpolates between different given interest rates. I thought this would just change the following:&#xA;1) the discount factor at each step&#xA;2) the risk neutral probabilities at each step&#xA;So I could calculate all the interpolated riskfree rates and  all the risk neutral probabilities, use those for backward induction and get my option price. Because the up and down movements would stay the same the tree would still recombine and I assume I would still end up with positive probabilites that sum up to one (can´t see why not!).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I´m not so sure this approach works anymore. The main reason is I couldn´t find any papers or implementations for this approach. That got me puzzled whether I am missing something.&#xA; Maybe it´s the assumption that the volatility stays the same with a changing riskfree rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Google and library search couldn´t really help me, because with all the search words I ended up at articles dealing with interest rate models, which I am not trying to delve into right now, because they are too complex and I only try to implement a deterministic interest rate structure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reframing the question: would my approach work or is there some part missing that I didn´t think of.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="22216" LastActivityDate="2016-06-20T10:28:26.270" Title="Trinomial model for stock options with deterministic interest curve" Tags="&lt;lattice&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27690" PostTypeId="1" CreationDate="2016-06-18T16:46:15.113" Score="5" ViewCount="5643" Body="&lt;p&gt;I have seen two methods for calculating the value of a xccy swap - &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Convert the future foreign payments to the base currency using forward FX rates, net with the base currency payments and discount using the risk-free rate for the base currency. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Discount the foreign payments using the foreign risk free curves and convert to the base currency using the spot rate. Discount the base currency payments with the base/foreign basis curve and net with the foreign payments. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems to me that if I calculate the forward fx prices using a simple interest rate differential, then the basis curve should match the base risk free curve. Am I correct in this view and if so, how does one calculate forward fx rates to yield a result equivalent to the basis curve method? &lt;/p&gt;&#xA;" OwnerUserId="22217" LastActivityDate="2016-07-27T10:34:55.300" Title="Cross Currency Swap pricing" Tags="&lt;fx&gt;&lt;swaps&gt;&lt;forward&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="27691" PostTypeId="2" ParentId="23178" CreationDate="2016-06-18T18:22:27.767" Score="1" Body="&lt;p&gt;&lt;strong&gt;Hint&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;let $s\le t$ and&#xA;$$P(s,y\,;\,t,x)=P(r_t\le x|r_s=y)$$&#xA;The transition probability $P(s,y\,;\,t,x)$  satisfy  Kolmogorov bachward equation&#xA;$$\frac{\partial P}{\partial s}+\kappa (\theta -{{r}_{s}})\frac{\partial P}{\partial r}+\frac{1}{2}{{\sigma }^{2}}{{r}_{s}}\frac{{{\partial }^{2}}P}{\partial {{r}^{2}}}=0\quad \,\,(1)$$&#xA;$$P(s,y\,;\,t,x)=\delta_x\,\,,\,\,s\to t$$&#xA;we define&#xA;$$f(\tau,u,{{r}_{s}})=\mathbb{E}[e^{\large{iur_t}}|\,r(s)]$$&#xA;where $\tau=t-s$. We know CIR process is a affine process thus&#xA;$$f(\tau ,u,{{r}_{s}})=\exp [A(\tau\,,\,u)+B(\tau\,,\,u){{r}_{s}}]$$&#xA;where&#xA;\begin{align}&#xA;  &amp;amp; A(0\,,\,u)=0 \\ &#xA; &amp;amp; B(0\,,\,u)=iu \\ &#xA;\end{align}&#xA;Substitute for $f$ in $(1)$&lt;br&gt;&#xA;$$\frac{\partial f}{\partial s}+\kappa (\theta -{{r}_{s}})\frac{\partial f}{\partial r}+\frac{1}{2}{{\sigma }^{2}}{{r}_{s}}\frac{{{\partial }^{2}}f}{\partial {{r}^{2}}}=0\,.$$&#xA;Note&#xA;\begin{align}&#xA;  &amp;amp; \frac{\partial f}{\partial s}=-\left( \frac{\partial A}{\partial r}+{{r}_{s}}\frac{\partial B}{\partial r} \right)f \\ &#xA; &amp;amp; \frac{\partial f}{\partial r}=B\,f \\ &#xA; &amp;amp; \frac{{{\partial }^{2}}f}{\partial {{r}^{2}}}={{B}^{2}}f \\ &#xA;\end{align}&#xA;as a result&#xA;$$\frac{1}{2}{{\sigma }^{2}}{{r}_{s}}{{B}^{2}}+\kappa (\theta -{{r}_{s}})B-\frac{\partial B}{\partial s}{{r}_{s}}-\frac{\partial A}{\partial s}=0$$&#xA;set  $r_s=0$, then&#xA;$$\frac{\partial A}{\partial s}=\kappa \theta B$$&#xA;setting $r_s=1$,then&#xA;$$\frac{\partial B}{\partial s}+\kappa B=\frac{1}{2}{{\sigma }^{2}}{{B}^{2}}$$&#xA;The first equation is an ordinary differential equation the second is Riccati equation. If You solve these equations then&#xA;$$f(t-s,u,{{r}_{s}})={{\left( 1-\frac{iu}{{{c}_{t}}} \right)}^{-\frac{2\kappa \theta }{{{\beta }^{2}}}}}\exp \left( \frac{i\,u{{e}^{-\kappa (t-s)}}}{1-\frac{iu}{c_t}}{{r}_{s}} \right)$$ &#xA;where&#xA;\begin{align}&#xA;  &amp;amp; {{c}_{t}}=\frac{2\kappa }{{{\beta }^{2}}\,[1-{{e}^{-\kappa (t-s)}}]} \\ &#xA; &amp;amp; k=\frac{4\kappa \theta }{{{\beta }^{2}}} \\ &#xA; &amp;amp; {{\lambda }_{\,t}}=2{{c}_{t}}\,{{r}_{s}}{{e}^{-\kappa (t-s)}} \\ &#xA;\end{align}&#xA;By application Inverse Fourier Transform  we have &#xA;$$p(s,y;\,t,x)=\frac{1}{2}{{e}^{-\frac{1}{2}(2{{c}_{t}}{{r}_{t}}+{{\lambda }_{t}})}}{{\left( \frac{2{{c}_{t}}{{r}_{t}}}{{{\lambda }_{t}}} \right)}^{\frac{k}{4}-\frac{1}{2}}}{{I}_{\frac{k}{2}-1}}(\sqrt{2{{c}_{t}}{{r}_{t}}{{\lambda }_{t}}})$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-06-19T10:13:29.793" LastActivityDate="2016-06-19T10:13:29.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27694" PostTypeId="1" AcceptedAnswerId="27739" CreationDate="2016-06-18T22:53:04.660" Score="2" ViewCount="173" Body="&lt;p&gt;can anyone explain in a bit detail on how PCA is performed in the paper &quot;Markov Models for Commodity Futures: Theory and Practice&quot; by Leif B. G. Andersen. I'm not clear on how the high dimension matrix for Xj is constructed, specifically what is the rows and columns in the matrix?  Thanks.&#xA;link:&#xA;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1138782&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1138782&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_j(t)$ is defined as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_j(t)=lnF(t,t+\delta_j)$, $j=$ 1 month, 2 months,...,48 months. &#xA;So I think the rows are these 48 $X_j(t)$ variables, but what is the column component? By using PCA, he reduced the dimension of a 48*N matrix to 48*2, and concludes that the number of random drivers is 2.&lt;/p&gt;&#xA;" OwnerUserId="22152" LastEditorUserId="22152" LastEditDate="2016-06-21T13:23:51.647" LastActivityDate="2016-06-22T08:57:42.867" Title="How PCA is performed in the paper &quot;Markov Models...&quot;" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27697" PostTypeId="2" ParentId="26411" CreationDate="2016-06-19T10:13:52.540" Score="1" Body="&lt;p&gt;As a standard reference (in the back of my head) I use for Swedish and U.S. equities, 7% real return assuming no growth rate in FCFE. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if we assume the entity will produce $100m per year in fcfe going forward with no growth rate, then the market value of equity is 100/0.07 = 1729. The 7% comes from 2% risk free rate + 5% risk premium (adjusted for inflation), obviously if the interest rates never return to historical levels 7% is a bit high. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a huge subject, people write their PhD thesis in Finance on this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A good book is: &#xA;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0471463396&quot; rel=&quot;nofollow&quot;&gt;https://www.amazon.com/Value-Investing-Graham-Buffett-Beyond/dp/0471463396&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best course available on the planet is:&#xA;&lt;a href=&quot;https://www.coursera.org/course/assetpricing&quot; rel=&quot;nofollow&quot;&gt;https://www.coursera.org/course/assetpricing&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="22222" LastActivityDate="2016-06-19T10:13:52.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27698" PostTypeId="1" AcceptedAnswerId="27707" CreationDate="2016-06-19T10:17:20.977" Score="1" ViewCount="76" Body="&lt;p&gt;I am constructing an investor sentiment index to determine the impact of investor sentiment on stock market crises. I am following the methodology in this paper, &lt;a href=&quot;http://121.192.176.75/repec/upload/201312051625034821.pdf&quot; rel=&quot;nofollow&quot;&gt;http://121.192.176.75/repec/upload/201312051625034821.pdf&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the components in the index is the exchange rate. The movement of exchange rate is closely related to international capital flows. A continuous appreciation of the domestic currency attracts more demand for domestic assets from international investors, leading to a higher investor sentiment index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am constructing the Index for 6 different countries; U.S., UK, China, Canada, Japan and Australia. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: If I follow the method used in the paper and use the end of month national currency per USD (e.g. sterling per USD, Yen per USD etc..), what exchange rate should I use for the U.S? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or should I use a common exchange rate for all 6 countries e.g. national currency per Euro?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be greatly appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="22099" LastActivityDate="2016-06-19T22:57:31.783" Title="Choosing an exchange rate in a macroeconomic panel data set" Tags="&lt;fx&gt;&lt;methodology&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27699" PostTypeId="2" ParentId="25989" CreationDate="2016-06-19T13:37:29.440" Score="0" Body="&lt;p&gt;It depends what type of interest rate model you are using.  If rates are normally distributed, the situation should be as you describe, so there should be minimal exposure to implied volatility.   If rates are lognormally distributed, the higher strike option has greater time value, and has a greater volatility exposure, than the lower strike option, hence the behavior you see.   &lt;/p&gt;&#xA;" OwnerUserId="18388" LastEditorUserId="18388" LastEditDate="2016-06-19T14:22:25.093" LastActivityDate="2016-06-19T14:22:25.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27700" PostTypeId="1" CreationDate="2016-06-19T14:26:07.670" Score="2" ViewCount="306" Body="&lt;p&gt;I use a time-varying Gaussian copula (with GARCH-filtered standardized residuals modeled semiparametrically with Gaussian kernel interior and GPD tails, i.e. generalized pareto distributed) to simulate N copula realizations and convert them back into portfolio returns (equally-weighted). Using a testing windows of 2000 daily returns, I get a number of VaR violations which exceeds the expected number of violations by far (e.g. 450 instead of 200 for 90%-VaR, 280 instead of 50 for 97.5-VaR, ...). However, if I analyze the simulated returns of each component individually, each stock has a number of violations which is approximately in line with those expected. Since the GARCH-GPD-copula approach is quite established in the literature for risk management purposes, my results are most probably due to some mistake I've made, I exclude (for the moment, at least) that I have opposing findings with respect to those usually published.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only two options that come to my mind are:&#xA;i) effect of N; ii) code doesn't work properly (due to my inexperience with R).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i) I've simulated 5000 correlated copula realizations. Is 5000 maybe not enough, would accuracy maybe increase if N=10'000? Is there any rule about how to select number of simulations?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ii) This is the essential part of the code (T equals 2000)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;tmp=cgarchfilter(specx, returns[1:2000,], filter.control=list(n.old=T))&#xA;presigma=matrix(tail(sigma(tmp),1),ncol=9)&#xA;prereturns=matrix(unlist(returns[T+i-1,]),ncol=9,nrow=1)&#xA;preresiduals=matrix(tail(residuals(tmp),1),ncol=9, nrow=1)&#xA;preR=last(rcor(tmp))[,,1]&#xA;diag(preR)=1&#xA;preQ=tmp@mfilter$Qt[[length(tmp@mfilter$Qt)]]&#xA;preZ=tail(tmp@mfilter$Z,1)&#xA;&#xA;for (i in 1:2000){&#xA;tmp=cgarchfilter(specx, returns[i:(T+i-1),], filter.control=list(n.old=T))&#xA;sim &amp;lt;- cgarchsim(fit, n.sim=1, m.sim=5000, startMethod=&quot;sample&quot;, preR=preR, preQ=preQ,&#xA;               preZ=preZ, prereturns=prereturns, preresiduals=preresiduals, presigma=presigma,&#xA;               cluster=NULL)&#xA;simx=t(sapply(sim@msim$simX, FUN=function(x) x[1,]))&#xA;a[i,,] &amp;lt;- simx&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;specx&lt;/code&gt; fixates the GARCH-GPD parameters of the fitting, all &lt;code&gt;pre_&lt;/code&gt; objects are needed as inputs in the &lt;code&gt;cgarchsim&lt;/code&gt; function. All inputs outside the loop compute the inputs for i=1; these are then reevaluated in the loop from i=1 to i=2000 (in-sample and testing periods are both over 2000 data, 4000 in total). &lt;code&gt;simx&lt;/code&gt; then contains all 5000 1-step ahead simulated returns. So &lt;code&gt;a&lt;/code&gt; is a 2000x9x5000 array (9 is the number of series). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you know what could have gone wrong? I'm lost.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT 1:&lt;/strong&gt; It has to be the code. I've tried with N=10'000 and the number of violations doesn't change a bit. I've also tried considering smaller return intervals (e.g. last 100 instead of last 2000) to compute all &lt;code&gt;pre_&lt;/code&gt; objects and account more heavily for recent news, and still the number of violations is the same. Am I wrong (which I assume), or am I swimming in an undiscovered (and flawed) area of the GARCH-copula sea?&lt;/p&gt;&#xA;" OwnerUserId="20573" LastEditorUserId="20573" LastEditDate="2016-06-20T13:57:22.320" LastActivityDate="2016-06-20T13:57:22.320" Title="Problems in computing VaR with GARCH-GPD-copula approach" Tags="&lt;time-series&gt;&lt;r&gt;&lt;garch&gt;&lt;value-at-risk&gt;&lt;copula&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27701" PostTypeId="2" ParentId="8178" CreationDate="2016-06-19T15:48:52.247" Score="1" Body="&lt;p&gt;Measure change is still the most natural approach for such problems. We assume that, under the measure $P$, &#xA;\begin{align*}&#xA;dX_t &amp;amp;= \mu X_t dt + \sigma X_t dW_t^1,\\&#xA;dY_t &amp;amp;= \mu Y_t dt + \sigma Y_t \left(\rho dW_t^1 + \sqrt{1-\rho^2} dW_t^2 \right),&#xA;\end{align*}&#xA;based on the Cholesky decomposition, where $\{W_t^1, t \ge 0\}$ and $\{W_t^2, t \ge 0\}$ are two independent standard Brownian motions, and $\rho$ ($|\rho|&amp;lt;1$) is the correlation. We define the measure $Q$ such that&#xA;\begin{align*}&#xA;\frac{dQ}{dP}\big|_t = \exp\left(-\frac{1}{2}\sigma^2 t + \sigma\left(\rho W_t^1 + \sqrt{1-\rho^2} W_t^2 \right)  \right).&#xA;\end{align*}&#xA;Then,  $\{\widehat{W}_t^1, t \ge 0\}$ and $\{\widehat{W}_t^2, t \ge 0\}$ are two independent standard Brownian motions under $Q$, where&#xA;\begin{align*}&#xA;\widehat{W}_t^1 &amp;amp;= W_t^1 - \rho\sigma t,\\&#xA;\widehat{W}_t^2 &amp;amp;= W_t^2 - \sqrt{1-\rho^2}\sigma t.&#xA;\end{align*}&#xA;Moreover,&#xA;\begin{align*}&#xA;dX_t &amp;amp;= (\mu +\rho\sigma^2) X_t dt + \sigma X_t d\widehat{W}_t^1,\\&#xA;dY_t &amp;amp;= (\mu + \sigma^2) Y_t dt + \sigma Y_t \left(\rho d\widehat{W}_t^1 + \sqrt{1-\rho^2} d\widehat{W}_t^2 \right),&#xA;\end{align*}&#xA;and then&#xA;\begin{align*}&#xA;Y_T &amp;amp;= Y_0 \exp\left(\Big(\mu + \frac{1}{2}\sigma^2 \Big)T + \sigma\left(\rho \widehat{W}_T^1 + \sqrt{1-\rho^2} \widehat{W}_T^2 \right) \right),\\&#xA;\frac{X_T}{Y_T} &amp;amp;= \frac{X_0}{Y_0}\exp\left((\rho-1)\sigma^2T +\sigma(1-\rho)\widehat{W}_T^1-\sigma\sqrt{1-\rho^2} \widehat{W}_T^2 \right)\\&#xA;&amp;amp;=\frac{X_0}{Y_0}\exp\left((\rho-1)\sigma^2T +\sqrt{2(1-\rho)}\sigma \frac{\sigma(1-\rho)\widehat{W}_T^1-\sigma\sqrt{1-\rho^2} \widehat{W}_T^2}{\sqrt{2(1-\rho)}\sigma} \right)\\&#xA;&amp;amp;=\frac{X_0}{Y_0}\exp\left(-\frac{1}{2}\hat{\sigma}^2T +\hat{\sigma} W_T \right),&#xA;\end{align*}&#xA;where $\hat{\sigma} = \sqrt{2(1-\rho)}\sigma$, and&#xA;\begin{align*}&#xA;W_t =\frac{\sigma(1-\rho)\widehat{W}_t^1-\sigma\sqrt{1-\rho^2} \widehat{W}_t^2}{\sqrt{2(1-\rho)}\sigma}&#xA;\end{align*}&#xA;is a standard Brownina motion, by Levy's characterization.&#xA;Therefore,&#xA;\begin{align*}&#xA;E_P\left( (X_T-Y_T)^+\right) &amp;amp;= E_P\left(Y_T \left(\frac{X_T}{Y_T}-1\right)^+\right)\\&#xA;&amp;amp;=E_Q\left( \left( \frac{dQ}{dP}\big|_T\right)^{-1}Y_T \left(\frac{X_T}{Y_T}-1\right)^+\right)\\&#xA;&amp;amp;=Y_0e^{(u+\sigma^2)T}E_Q\left(\left(\frac{X_T}{Y_T}-1\right)^+ \right)\\&#xA;&amp;amp;= Y_0e^{(u+\sigma^2)T} \left[\frac{X_0}{Y_0}\Phi(d_1) - \Phi(d_2) \right]\\&#xA;&amp;amp;= e^{(u+\sigma^2)T} \Big[X_0\Phi(d_1) - Y_0 \Phi(d_2) \Big].&#xA;\end{align*}&#xA;where&#xA;\begin{align*}&#xA;d_1 &amp;amp;= \frac{\ln \frac{X_0}{Y_0} + \frac{1}{2}\hat{\sigma}^2T}{\hat{\sigma}\sqrt{T}}\\&#xA;&amp;amp;=\frac{\ln \frac{X_0}{Y_0} + (1-\rho)\sigma^2T}{\sqrt{2(1-\rho)}\sigma\sqrt{T}},\\&#xA;d_2 &amp;amp;= d_1 - \hat{\sigma}\sqrt{T}\\&#xA;&amp;amp;= d_1 -\sqrt{2(1-\rho)}\sigma\sqrt{T}.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-06-19T15:55:07.420" LastActivityDate="2016-06-19T15:55:07.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27702" PostTypeId="1" CreationDate="2016-06-19T16:48:21.497" Score="1" ViewCount="5234" Body="&lt;p&gt;For calculating P&amp;amp;L from interest rate risk, we often use &lt;a href=&quot;https://en.wikipedia.org/wiki/Bond_duration&quot; rel=&quot;nofollow&quot;&gt;PV01&lt;/a&gt; to estimate the day over day P&amp;amp;L by multiplying PV01 with a change in curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any approach to calculate theta P&amp;amp;L in a similar way?&lt;/p&gt;&#xA;" OwnerUserId="22223" LastEditorUserId="467" LastEditDate="2016-06-20T05:38:23.320" LastActivityDate="2018-08-25T16:24:30.363" Title="How to calculate the theta of a bond?" Tags="&lt;fixed-income&gt;&lt;theta&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27703" PostTypeId="1" CreationDate="2016-06-19T18:20:27.547" Score="4" ViewCount="699" Body="&lt;p&gt;I want to be able to determine the probability of a short option position (call or put) expiring worthless.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't know where to start but I see probabilities derived from the greeks on some web sites?&lt;/p&gt;&#xA;" OwnerUserId="22225" LastActivityDate="2019-11-27T14:34:34.507" Title="How do I calculate the probability of a short option position expiring worthless?" Tags="&lt;options&gt;&lt;greeks&gt;&lt;expiration&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27704" PostTypeId="2" ParentId="27703" CreationDate="2016-06-19T19:13:31.390" Score="2" Body="&lt;p&gt;You can think of delta for calls (-delta for puts) as the first order approximation to probability of expiring in the money. If you subtract this probability from 100%, you'll have the probability of expiring worthless. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want more exact probability, there are algorithms to construct a pdf from IV skew, and calculate probability from there.&lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2016-06-19T19:13:31.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27706" PostTypeId="1" CreationDate="2016-06-19T21:08:05.740" Score="2" ViewCount="303" Body="&lt;p&gt;Does anybody know where I can get historical consensus forecast data for Non-forma Payroll (NFP)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or any forecast data for NFP.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;" OwnerUserId="20916" LastActivityDate="2016-06-20T09:43:17.720" Title="Consensus Forecast Data for NFP" Tags="&lt;forecasting&gt;&lt;forecast&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27707" PostTypeId="2" ParentId="27698" CreationDate="2016-06-19T22:57:31.783" Score="1" Body="&lt;p&gt;Sounds to me like you're looking for something like the USD index, see &lt;a href=&quot;https://en.m.wikipedia.org/wiki/U.S._Dollar_Index&quot; rel=&quot;nofollow&quot;&gt;https://en.m.wikipedia.org/wiki/U.S._Dollar_Index&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for a common exchange rate, sounds to me like you're looking for a &quot;risk&quot; currency which is the currency into which, if you managed FX inventories, you'd convert your trade flows. In other words using USD as a risk currency then you can choose to unwind your GBP, EUR, AUD positions to USD as they happen and then manage your long and short exposures in terms of USD rather than all currency instruments. Depending on competitive spreads that would work for managing inventories. I don't think it would really do for a sentiment index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My guess for a sentiment index is to use a weighted index for each of your 6 currencies relative to the other 5. Also, in terms of &quot;countries&quot; you've missed out the EU.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words for EU make up an index of EURUSD, EURGBP, EURCNY, EURCAD, EURJPY, EURAUD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For USD use EURUSD, GBPUSD, USDCNY, USDCAD, USDJPY and AUDUSD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;etc.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2016-06-19T22:57:31.783" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="27708" PostTypeId="2" ParentId="27690" CreationDate="2016-06-19T23:41:20.657" Score="1" Body="&lt;p&gt;I think you're arriving at a value for a swap using 2 different expressions of the same thing because FX forward prices are calculated using spot rates and adding or subtracting forward points. The forward points for a currency pair express interest rate differentials between the 2 currencies in the pair.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think your question then moves from arriving at a net value of an FX swap to looking at how interest rate / money market data, in other words rates for deposits and loans of a given currency for given timeframes, are used to calculate FX forward points?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yeah in theory the curves should all be the same, but in practise as Alex C says above, the main factor is what rates, for deposits and loans, you can actually get from the money markets. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The thing about &quot;risk free&quot; curves - or money market data - is they only exist if you have an account with the central bank. In reality the curve you're able to obtain depends on your relationships with deposit and loan providers in a given currency. If you can then you shop around in the money markets for the best rates....&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You calculate the forward FX rate by getting the forward cash flows adjusted for interest rates of the 2 currencies according to the interest rates you can get in the money markets. The forward points then express that &quot;rate&quot; as points from the spot rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Check out a worked example of &lt;a href=&quot;http://www.webstersystems.co.uk/fxmm.htm#interest%20arbitrage&quot; rel=&quot;nofollow&quot;&gt;interest rate arbitrage&lt;/a&gt; to see how swaps and rates relate together....&lt;/p&gt;&#xA;" OwnerUserId="7369" LastEditorUserId="7369" LastEditDate="2016-06-20T08:21:46.713" LastActivityDate="2016-06-20T08:21:46.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27709" PostTypeId="2" ParentId="27706" CreationDate="2016-06-20T09:43:17.720" Score="1" Body="&lt;p&gt;You can find it on &lt;a href=&quot;http://www.forexfactory.com/&quot; rel=&quot;nofollow&quot;&gt;http://www.forexfactory.com/&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Click details on &quot;Non-Farm Employment Change&quot; and you will have consensus and actual data for last 15+ years.&lt;/p&gt;&#xA;" OwnerUserId="19615" LastActivityDate="2016-06-20T09:43:17.720" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27711" PostTypeId="2" ParentId="27689" CreationDate="2016-06-20T10:28:26.270" Score="1" Body="&lt;p&gt;you could do it that way. Or you could take a time-dependent drift and discretize&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ d \log S_t = (r(t) - 0.5\sigma^2) dt + \sigma dW_t.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r(t)$ is chosen to be constant across each step so that the df is correct across each step. Take $W_{t+\Delta t} - W_t$ to be $\sqrt{3 \Delta t} X$ with $X \in \{-1,0,1\}.$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are many ways to do a trinomial tree. Eg There are over 30 binomial trees in the literature. See my book &quot;More mathematical finance&quot; for a discussion of the modelling choices.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2016-06-20T10:28:26.270" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27712" PostTypeId="2" ParentId="2260" CreationDate="2016-06-20T12:35:24.843" Score="2" Body="&lt;p&gt;The reason is that the Sharpe Ratio is typically defined in terms of annual return and annual deviation.  As everyone has said, you go from daily returns to annual returns by assuming daily returns are independent and identically distributed.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With that assumption, you get annual return by multiplying by daily return by 252 (compounding makes little difference when daily return is 1 bp).  You get annual deviation by multiplying daily deviation by square root of 252.  So you get the annual ratio by the daily ratio by 252/sqrt(252) = sqrt(252).&lt;/p&gt;&#xA;" OwnerUserId="22243" LastActivityDate="2016-06-20T12:35:24.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27713" PostTypeId="1" CreationDate="2016-06-20T14:09:20.680" Score="1" ViewCount="464" Body="&lt;p&gt;My question is related on this&#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/2260/how-to-annualize-sharpe-ratio&quot;&gt;How to annualize Sharpe Ratio?&lt;/a&gt;&#xA;but is a bit different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under assumpion of IID returns, if excess return is positive, the SR increase over time horizon, with factor $\sqrt T$. Looked at in this way it seems that simply by increasing time horizon the risk reward improves. But if we take the variance, instead of standard deviation, this effect disappears; moreover the ratio remain constant over time. &#xA;This fact seems to me strange. What do you think? &lt;/p&gt;&#xA;" OwnerUserId="20746" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-08-22T15:32:08.380" Title="Sharpe Ratio and your annualization" Tags="&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27714" PostTypeId="1" AcceptedAnswerId="27736" CreationDate="2016-06-20T15:41:32.433" Score="4" ViewCount="4487" Body="&lt;p&gt;I want to calculate the 30/60/90/180 day 100% moneyness implied volatility for a stock. I think I know how to do it but would like to share my thought processes with the group to verify I'm on the right track. I roughly followed the process given in this white paper from Bloomberg (top hit for google search terms &quot;bloomberg implied volatility calculation&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm going to run through an example using AAPL.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assumptions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;AAPL has European-style options&lt;/li&gt;&#xA;&lt;li&gt;As of 2016-04-29 compute the 60-day IV&lt;/li&gt;&#xA;&lt;li&gt;Stock closed at 93.75&lt;/li&gt;&#xA;&lt;li&gt;My calculations are correct :)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The process is as follows:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;60-day IV would be for expiration as of June 28, 2016. Find option series bracketing that date. The June 17 and July 15 series both bracket it.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;For each series, find 4 calls and 4 puts around 93.75. Two should be ITM, two should be OTM. This gives us the 90, 92.5, 95, and 97.5 strikes.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Compute cubic interpolation of a &quot;synthetic&quot; 93.75 strike for the calls and puts on both expiration dates.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;June 17 Call, 3.1005&lt;/p&gt;&#xA;&#xA;&lt;p&gt;June 17 Put,  3.5855&lt;/p&gt;&#xA;&#xA;&lt;p&gt;July 15 Call, 4.0283&lt;/p&gt;&#xA;&#xA;&lt;p&gt;July 15 Put,  4.4095&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;4&quot;&gt;&#xA;&lt;li&gt;Compute the minutes to settlement from 2016-04-29T15:00:00 (CST) to the June 17 and July 15 dates.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;June17_settlement = 70500&lt;/p&gt;&#xA;&#xA;&lt;p&gt;July15_settlement = 110820&lt;/p&gt;&#xA;&#xA;&lt;p&gt;60day_minutes = 86400&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;5&quot;&gt;&#xA;&lt;li&gt;Compute the time-weighted average using #4&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;June17 = (110820 - 86400) / (110820 - 70500) = 0.6057&lt;/p&gt;&#xA;&#xA;&lt;p&gt;July15 = (86400 - 70500) / (110820 - 70500) = 0.3943&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sanity check... 0.6057 + 0.3943 = 1.0&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;6&quot;&gt;&#xA;&lt;li&gt;Compute weighted average Call and Put prices for synthetic 60-day option&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Call&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(3.1005 * 0.6057) + (4.0283 * 0.3943) = 3.4663&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(3.5855 * 0.6057) + (4.4095 * 0.3943) = 3.9104&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;7&quot;&gt;&#xA;&lt;li&gt;Compute time to settlement for 60-day option&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;(60 / 365) = 0.1643835&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;8&quot;&gt;&#xA;&lt;li&gt;Use Black-Scholes to back out the IV of a Call and Put with stock price 93.75, strike 93.75, rfr 0.25%, time to maturity 0.1643835, and prices of:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Call(3.4663) = 22.7% IV&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put(3.9104) = 25.7% IV&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I on the right path here? Any suggestions or corrections would be welcome.&lt;/p&gt;&#xA;" OwnerUserId="20647" LastEditorUserId="20647" LastEditDate="2016-06-20T15:46:43.357" LastActivityDate="2016-06-21T19:42:47.547" Title="How to compute 30/60/90-day Implied Volatility?" Tags="&lt;implied-volatility&gt;&lt;vix&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27715" PostTypeId="1" AcceptedAnswerId="27716" CreationDate="2016-06-20T15:48:13.010" Score="2" ViewCount="735" Body="&lt;p&gt;I'm currently reading a book which provides examples of how hedge funds employed a global macro trading strategy in the past to generate significant returns. Once such example is the convergence of European nations' government bond yields in the lead up to the launch of the Euro (monetary union).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/aXHKw.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/aXHKw.png&quot; alt=&quot;Yield Convergence&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The image shows the movements of government yields in the lead up to the 99 Euro (note that pre the Euro, German debt was considered the benchmark, and all other national debt was a spread above German yields).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The book states that Hedge Funds employed a strategy of going long in Italian/Spanish debt, and going short in German debt - and that these two strategies paid off very well as convergence occurred. Furthermore, it states that the gains from such convergence trades were large because they did them via interbank currency swaps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is two fold: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) How is money made as yields decrease? Is it down to the simple fact that as yields decrease, prices increase? (Plus, why short German bonds - their yields decreased too!)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) How did the use of currency swaps somewhat magnify the profits made? The book states that: &quot;If the interest rate spread narrows before the contract maturity date, the investor effectively books a profit equal to the change in the spread times the number of months to maturity&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advanced.&lt;/p&gt;&#xA;" OwnerUserId="20531" LastActivityDate="2016-10-22T14:59:15.670" Title="How was money made from bond yield convergence?" Tags="&lt;fixed-income&gt;&lt;bond-yields&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27716" PostTypeId="2" ParentId="27715" CreationDate="2016-06-20T16:20:15.083" Score="3" Body="&lt;p&gt;This is the trade that made LTCM famous.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Italian yields were higher than German yields. The prediction was that yields of Italian bonds would become equal to those of German bunds. Since prices move inversely to yields the trade is to be Long Italian Bonds and Short Bunds. You could skip the shorting of bunds (and only be long Italian bonds) but: (1) That would not be a &quot;convergence trade&quot;, (2) You remove some risk by being short bunds (for example what happens if the yields converge by having the Bund yield rise towards the Italian yield? In that case you would not make money if you forgot to short the Bunds).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the second part: The bond trade amounts to a bet on convergence of long term bond rates (eg. 10 year rates), while the currency swap can be seen as an additional bet on the convergence of &lt;em&gt;short&lt;/em&gt; &lt;em&gt;term&lt;/em&gt; rates, since currency swaps are priced based on for example 3 months or 6 month rates. (In fact an FX swap is identical to being long a 3 month ZCB in one currency and short another 3 month ZCB in another currency). And these short term rates converged as well. (but of course the biggest impact of yield changes, i.e. the biggest &lt;em&gt;duration&lt;/em&gt;, is for long term bonds).&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-06-20T16:28:30.623" LastActivityDate="2016-06-20T16:28:30.623" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27717" PostTypeId="2" ParentId="27713" CreationDate="2016-06-20T17:42:50.540" Score="1" Body="&lt;p&gt;One word about annualizing: what does it tell you about the coming year: nothing. Markets will change in 6 months and even more in 12 and any volatility today annualized does not tell you anything about the year to come.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is even more true for expected returns. If markets shot up 10% last month then I bet the market will not be up annualized 120% by the end of the year.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only thing that annualizing is good for is making numbers comparable. Calculating volatility on a weekly basis and annualizing by square-root of 52 will give something similar to the monthly data annualized by square-root of 12.&#xA;There is something more to say about data frequency (why annualied monthly vol will be smaller) but I can not go into this now. All in all annualizing makes &lt;strong&gt;frequencies&lt;/strong&gt; comparable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another thought about SR and horizons:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you look at short horizons, then noise will dominate the signal. You often have a bad risk/reward ratio short term. As time goes on a positive trend in your investment can show up and risk-return gets better.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can do Monte Carlo simulations and illustrate the above phenomenon. My conclusion: improved Sharpe ratio as the horizon increases can be a good model for reality. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit: to address the issue that if you change the risk measure to variance the picture changes: vol is in terms of the returns (square-root of sum of squared returns), variance is in terms of returns  squared. This does not go together well in risk/return. What one could do is look at mean return/expected shortfall or mean return/drawdown. This is what people actually do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT 2: You say that using variance as risk measure changes the picture. Risk measures are categorized as having certain properties. One is positive homogeneity. This means that if $\rho$ is the risk measure of a random return $R$ and $h&amp;gt;0$ then&#xA;$$&#xA;\rho(h X) = h \rho(X).&#xA;$$&#xA;We can see that volatility is positive homogeneous while variance is not. For more properties see &lt;a href=&quot;https://en.wikipedia.org/wiki/Coherent_risk_measure&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&#xA;In the literature about risk measures the consequences of lacking certain properties are derived. Using a risk measure that is not homogeneous (as variance) can have disadvantages.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2016-06-21T17:58:34.217" LastActivityDate="2016-06-21T17:58:34.217" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27718" PostTypeId="1" CreationDate="2016-06-20T19:48:31.500" Score="4" ViewCount="332" Body="&lt;p&gt;What are features and examples of computational finance (financial computing) problems (for thesis project in Master in Computer Science)? Is it possible to defend Computer Science master thesis by writing project about quantitative finance? As far as I have read articles in arxiv.org Computational Finance part, then most of them is about numerical methods and they are more relevant to mathematics than computer science. What can be good theme for the project?&lt;/p&gt;&#xA;" OwnerUserId="22249" LastEditorUserId="308" LastEditDate="2016-06-21T06:29:21.197" LastActivityDate="2016-12-07T16:13:55.130" Title="Is it possible to defend a Computer Science master thesis by writing a project about quantitative finance?" Tags="&lt;numerical-methods&gt;" AnswerCount="4" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27719" PostTypeId="2" ParentId="27687" CreationDate="2016-06-20T21:18:19.053" Score="4" Body="&lt;p&gt;Consider historical observation dates $t_0 &amp;lt; t_1 &amp;lt; \cdots &amp;lt; t_n$.&#xA;From the state variable equations&#xA;\begin{align*}&#xA;dZ_t^1&amp;amp;=-kZ_t^1dt+h_1dW_t^1+h_2dW_t^2,\\&#xA;dZ_t^2&amp;amp;=h_0dW_t^1. &#xA;\end{align*}&#xA;We obtain that, for $i=1, \ldots, n$,&#xA;\begin{align*}&#xA;Z_{t_i}^1 &amp;amp;= e^{-k \Delta t_i} Z_{t_{i-1}}^1 + h_1 \int_{t_{i-1}}^{t_i}e^{-k (t_i-s)}dW_s^1 + h_2 \int_{t_{i-1}}^{t_i}e^{-k (t_i-s)}dW_s^2,\tag{1}\\&#xA;Z_{t_i}^2 &amp;amp;= Z_{t_{i-1}}^2 + h_0 \int_{t_{i-1}}^{t_i}dW_s^1.\tag{2}&#xA;\end{align*}&#xA;Let &#xA;\begin{align*}&#xA;\pmb{x}_{t_i} &amp;amp;= [Z_{t_i}^1, \ Z_{t_i}^2]^T,&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;F &amp;amp;= \left(\!&#xA;\begin{array}{cc}&#xA;e^{-k\Delta t_i} &amp;amp; 0\\&#xA;0 &amp;amp; 1&#xA;\end{array}&#xA;\!\right).&#xA;\end{align*}&#xA;Moreover, let &#xA;\begin{align*}&#xA;\pmb{v}_{t_i} = \bigg[h_1 \int_{t_{i-1}}^{t_i}e^{-k (t_i-s)}dW_s^1 + h_2 \int_{t_{i-1}}^{t_i}e^{-k (t_i-s)}dW_s^2, \ h_0 \int_{t_{i-1}}^{t_i}dW_s^1\bigg]^T&#xA;\end{align*}&#xA;be a two dimensional normal random vector with zero mean and covariance matrix&#xA;\begin{align*}&#xA;Q = \left(\!&#xA;\begin{array}{cc}&#xA;\frac{h_1^2+h_2^2}{2k}\big(1-e^{-2k \Delta t_i} \big) &amp;amp; \frac{h_0h_1}{k} \big(1-e^{-k\Delta t_i} \big) \\&#xA;\frac{h_0h_1}{k} \big(1-e^{-k\Delta t_i} \big) &amp;amp; h_0^2 \Delta t_i&#xA;\end{array}&#xA;\!\right).&#xA;\end{align*}&#xA;Then, based on $(1)$ and $(2)$, &#xA;\begin{align*}&#xA;\pmb{x}_{t_i} = F \pmb{x}_{t_{i-1}} + \pmb{v}_{t_i},&#xA;\end{align*}&#xA;which is the &lt;em&gt;transition equation&lt;/em&gt; or &lt;em&gt;state equation&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $T_1 &amp;lt; \cdots &amp;lt; T_m$ be the futures maturities. From the equation&#xA;\begin{align*}&#xA;\ln F(t,T)&amp;amp;=\ln F(0,T)+\left(Z_t^1 e^{-k(T-t)}+Z_t^2\right) \\&#xA;&amp;amp;\qquad -\frac{1}{4k}\left[(1-e^{-2kT})(h_1^2+h_2^2))+4h_1h_0(1-e^{-kT})+2h_0^2tk\right],&#xA;\end{align*}&#xA;we obtain that&#xA;\begin{align*}&#xA;\ln F(t_i,T_j)&amp;amp;=\ln F(0,T_j)+\left(Z_{t_i}^1 e^{-k(T_j-t_i)}+Z_{t_i}^2\right) \\&#xA;&amp;amp;\qquad -\frac{1}{4k}\left[(1-e^{-2kT_j})(h_1^2+h_2^2))+4h_1h_0(1-e^{-kT_j})+2h_0^2t_ik\right].\tag{3}&#xA;\end{align*}&#xA;For observation time $t_i$, let $\pmb{y}_{t_i}$ be an $m$-dimensional observation vector defined by&#xA;\begin{align*}&#xA;\pmb{y}_{t_i} = &#xA;\left(\!&#xA;\begin{array}{c}&#xA;\ln F(t_i, T_1)\\&#xA;\vdots\\&#xA;\ln F(t_i, T_m)&#xA;\end{array}&#xA;\!\right),&#xA;\end{align*}&#xA;and $\pmb{d}_{t_i}$ be an $m$-dimensional deterministic vector defined by&#xA;\begin{align*}&#xA;\pmb{d}_{t_i} =&#xA;\left(\!&#xA;\begin{array}{c}&#xA;\ln F(0,T_1) - \frac{1}{4k}\left[(1-e^{-2kT_1})(h_1^2+h_2^2))+4h_1h_0(1-e^{-kT_1})+2h_0^2t_ik\right]\\&#xA;\phantom{\frac{\frac{1}{1}}{\frac{1}{1}}} \vdots \phantom{\frac{\frac{1}{1}}{\frac{1}{1}}}\\&#xA;\ln F(0,T_m) - \frac{1}{4k}\left[(1-e^{-2kT_m})(h_1^2+h_2^2))+4h_1h_0(1-e^{-kT_m})+2h_0^2t_ik\right]&#xA;\end{array}&#xA;\!\right).&#xA;\end{align*}&#xA;Moreover, let $H$ be an $(m \times 2)$ matrix defined by&#xA;\begin{align*}&#xA;H = &#xA;\left(\!&#xA;\begin{array}{cc}&#xA;e^{-k(T_1-t_i)} &amp;amp; 1\\&#xA;\phantom{\frac{\frac{1}{1}}{\frac{1}{1}}}\vdots\phantom{\frac{\frac{1}{1}}{\frac{1}{1}}} &amp;amp; \vdots\\&#xA;e^{-k(T_m-t_i)} &amp;amp; 1&#xA;\end{array}&#xA;\!\right),&#xA;\end{align*}&#xA;and $\pmb{w}_{t_i}$ is an $m$-dimensional normal random vector with zero mean and a constant covariance matrix $V$, to be defined below. Then, based on Equation $(3)$, &#xA;\begin{equation}\label{spot_forward_measurement_eqn}&#xA;\pmb{y}_{t_i} = \pmb{d}_{t_i} + H \pmb{x}_{t_i} +\pmb{w}_{t_i},&#xA;\end{equation}&#xA;which is the &lt;em&gt;measurement equation&lt;/em&gt; or &lt;em&gt;observation equation&lt;/em&gt;. Here $\pmb{w}_{t_i}$ is a $m$-dimensional vector of normal random variables. The $(m \times m)$ covariance matrix $V$ of $\pmb{w}_{t_i}$ is determined, together with the model parameters, as part of the maximum likelihood estimation. &lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-06-21T22:55:47.357" LastActivityDate="2016-06-21T22:55:47.357" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27721" PostTypeId="1" CreationDate="2016-06-21T03:27:49.033" Score="10" ViewCount="583" Body="&lt;p&gt;I have a few basic questions on block bootstrapping on a financial time series ('TS').&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming my trade universe consists of 10 stocks, I would like to create a set of synthetic prices for all 10 stocks plus the S&amp;amp;P500 index using their respective historical prices over the past 10 years. The bootstrap method should maintain, to a fair extent, the linear pairwise correlation &lt;em&gt;among&lt;/em&gt; these 10 stocks and with the index at different points in time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I read from academic literature and online resources that block bootstrap is appropriate for my endeavor. However, I still have the following 4 questions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) I would be implementing in R. Assuming I set the same seed for all 10 stocks + index, does block bootstrap maintain the relative 'pairwise' correlation for them?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) Should all 10 stocks use the same block length or individual lengths? Some of the 10 stocks do not have 10 years of historical data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(3) Is it more appropriate to bootstrap on daily returns or the absolute prices? The former leads to some very volatile outcomes (chart 1) while the latter leads to high 'gappy-ness' (chart 2) in the synthetic prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(4) If the answer to (3) is 'daily returns', should it be simple/discrete returns or log returns?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope to get some guidance and thanks in advance!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The charts are created in R using the &lt;code&gt;boot&lt;/code&gt; package. Code for Chart 1 is given below the charts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;CHART 1 (Volatile - synthetic prices ended up 10x the actual at one point):&lt;/strong&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/XPror.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/XPror.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;CHART 2 (Gappy - gap down at start, followed by gap up in middle of chart):&lt;/strong&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/46Y2J.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/46Y2J.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Code for Chart 1&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library( quantmod )&#xA;library( np )&#xA;library( PerformanceAnalytics )&#xA;library( boot )&#xA;&#xA;# Define dummy function&#xA;Fn &amp;lt;- function( aa ) { return ( aa ) }&#xA;&#xA;u_seed &amp;lt;- 25&#xA;&#xA;getSymbols( &quot;AAL&quot; )  # Get Price data&#xA;&#xA;AAL_OHLC &amp;lt;- AAL[ , -( 5:6 ) ]  # Remove unwanted cols&#xA;&#xA;plot( AAL$AAL.Close )&#xA;&#xA;# Compute returns&#xA;AAL_DRet &amp;lt;- CalculateReturns( AAL_OHLC, method = &quot;discrete&quot; )&#xA;AAL_DRet2 &amp;lt;- AAL_DRet[ -1, ]&#xA;&#xA;# Compute block length&#xA;tmp_len &amp;lt;- b.star( AAL_DRet2 )&#xA;blk_len &amp;lt;- round( median( tmp_len[ , 1 ] ), 0 )&#xA;&#xA;AALC_DRet &amp;lt;- AAL_DRet2$AAL.Close&#xA;&#xA;for( seed in u_seed )&#xA;{&#xA;  set.seed( seed )&#xA;&#xA;  z &amp;lt;- tsboot( AALC_DRet, Fn, 1L, l = blk_len, endcorr = T, sim = &quot;geom&quot; )&#xA;&#xA;  # Process new simulated data to xts&#xA;  a_BS &amp;lt;- z$t&#xA;  dim( a_BS ) &amp;lt;- NULL  # Flatten wide matrix into vector&#xA;  names( a_BS ) &amp;lt;- index( AALC_DRet )&#xA;&#xA;  # Chg to xts&#xA;  xts_BS &amp;lt;- as.xts( a_BS )&#xA;  index( xts_BS ) &amp;lt;- index( AALC_DRet )&#xA;&#xA;  # Plot relative chart&#xA;  xts_CumRet &amp;lt;- merge.xts( xts_BS, AALC_DRet )&#xA;  palette( bluefocus )&#xA;  chart.CumReturns( xts_CumRet, legend.loc = &quot;top&quot;, geometric = T )&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="16679" LastEditorUserId="16679" LastEditDate="2016-06-21T16:22:50.050" LastActivityDate="2019-12-15T06:01:30.317" Title="Block bootstrap to synthesize asset prices" Tags="&lt;time-series&gt;&lt;r&gt;&lt;bootstrap&gt;" AnswerCount="0" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="27723" PostTypeId="2" ParentId="27468" CreationDate="2016-06-21T08:56:50.280" Score="0" Body="&lt;p&gt;From Wooldridge's Introductory Econometrics, 4th edition, pg. 390, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \Delta inf_t = \beta_0 + \beta_1 unem_t + e_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once we know the coefficients, natural rate can be computed as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mu_0 = \beta_0 / (-\beta_1) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I worked out the code below, &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import pandas as pd&#xA;df = pd.read_csv('p.raw',sep='\s*',index_col=0)&#xA;df['dinf'] = df.inf.diff()&#xA;import statsmodels.formula.api as smf&#xA;results = smf.ols('dinf ~ unem', data=df).fit()&#xA;print results.summary()&#xA;print 'natural unemployment', results.params.Intercept / -results.params.unem&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;gives&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;5.463&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;meaning a natural rate of unemployment of about %5.5 - this is a reasonable number.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Data&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; year       unem        inf         &#xA; 1948        3.8        8.1     &#xA; 1949        5.9       -1.2     &#xA; 1950        5.3        1.3     &#xA; 1951        3.3        7.9     &#xA; 1952          3        1.9     &#xA; 1953        2.9         .8     &#xA; 1954        5.5         .7     &#xA; 1955        4.4        -.4     &#xA; 1956        4.1        1.5     &#xA; 1957        4.3        3.3     &#xA; 1958        6.8        2.8     &#xA; 1959        5.5         .7     &#xA; 1960        5.5        1.7     &#xA; 1961        6.7          1     &#xA; 1962        5.5          1     &#xA; 1963        5.7        1.3     &#xA; 1964        5.2        1.3     &#xA; 1965        4.5        1.6     &#xA; 1966        3.8        2.9     &#xA; 1967        3.8        3.1     &#xA; 1968        3.6        4.2     &#xA; 1969        3.5        5.5     &#xA; 1970        4.9        5.7     &#xA; 1971        5.9        4.4     &#xA; 1972        5.6        3.2     &#xA; 1973        4.9        6.2     &#xA; 1974        5.6         11     &#xA; 1975        8.5        9.1     &#xA; 1976        7.7        5.8     &#xA; 1977        7.1        6.5     &#xA; 1978        6.1        7.6     &#xA; 1979        5.8       11.3     &#xA; 1980        7.1       13.5     &#xA; 1981        7.6       10.3     &#xA; 1982        9.7        6.2     &#xA; 1983        9.6        3.2     &#xA; 1984        7.5        4.3     &#xA; 1985        7.2        3.6     &#xA; 1986          7        1.9     &#xA; 1987        6.2        3.6     &#xA; 1988        5.5        4.1     &#xA; 1989        5.3        4.8     &#xA; 1990        5.6        5.4     &#xA; 1991        6.8        4.2     &#xA; 1992        7.5          3     &#xA; 1993        6.9          3     &#xA; 1994        6.1        2.6     &#xA; 1995        5.6        2.8     &#xA; 1996        5.4          3     &#xA; 1997        4.9        2.3     &#xA; 1998        4.5        1.6     &#xA; 1999        4.2        2.2     &#xA; 2000          4        3.4     &#xA; 2001        4.8        2.8     &#xA; 2002        5.8        1.6     &#xA; 2003          6        2.3     &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="616" LastEditorUserId="616" LastEditDate="2016-07-05T11:32:12.950" LastActivityDate="2016-07-05T11:32:12.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27724" PostTypeId="1" AcceptedAnswerId="27730" CreationDate="2016-06-21T10:13:20.120" Score="4" ViewCount="270" Body="&lt;p&gt;I am a little bit confused, or uninformed more truthfully, regarding how option pricing (Europeans only in this case) are handled in real life. Up to now I have acquired some theoretical knowledge of different models and how to implement them but I have yet to come in contact with how it actually is performed in the workplace.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From my understanding a huge part of difference option pricing models is how the underlying variables are modeled, which mostly concerns the volatility, which then is used in some sort of implementation say Monte Carlo simulation or a tree model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if I get an assignment of pricing a European option on stock A, do I then first decide on a option pricing model that most accurately capture the volatility behaviour of the stock and then implement it through, let's say, a binomial tree? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can tell I am a bit lost here. Right now I am a student so I do not yet have any experience of working in a financial institution so it would be greatly appreciated if someone who has actual experience of this sort of things could shed some light on it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="22261" LastActivityDate="2016-06-21T13:29:09.260" Title="How does financial institutions value European options in practice?" Tags="&lt;option-pricing&gt;&lt;pricing&gt;&lt;european-options&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27725" PostTypeId="1" AcceptedAnswerId="27732" CreationDate="2016-06-21T10:34:04.593" Score="2" ViewCount="470" Body="&lt;p&gt;Okay so this might be a fairly trivial question but I'm having an issue with valuing a call option using both a Monte Carlo method and a PDE method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I started I first used the parameters:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Spot = 0 to 20&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Strike = 10&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Interest rate = 0&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Volatility = 0.25&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Time = 1&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And both the Monte Carlo and PDE methods came out identical. However, when I changed the spot price range from 90 to 110 and the strike to 100, the Monte Carlo and PDE methods now give different results! For instance, with a spot price of 110, the Monte Carlo method gives (approximately) 16.19 as the option price. However, the PDE method instead gives 10 as the price. And the thing is, this happens with every Monte Carlo and PDE code I try (I found a few off the internet and I've been trying them out). Can someone tell me why this happens?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Just as a small favor, can someone tell me what needs to be modified in this code in order to give the true result? I got the code from the link I mentioned below&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;r=0.0; % Interest rate&#xA;sigma=0.25; % Volatility of the underlying&#xA;M=1600; % Number of time points&#xA;N=160; % Number of share price points&#xA;Smax=110; % Maximum share price considered&#xA;Smin=90; % Minimum share price considered&#xA;T=1.; % Maturation (expiry)of contract&#xA;E=100; % Exercise price of the underlying&#xA;&#xA;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%&#xA;dt=(T/M); % Time step&#xA;ds=(Smax-Smin)/N; % Price step&#xA;% Initializing the matrix of the option value&#xA;v(1:N,1:M) = 0.0;&#xA;% Initial conditions prescribed by the European Call payoff at         expiry:V(S,T)=max(S-E,0);&#xA;v(1:N,1)=max((Smin+(0:N-1)*ds-E),zeros(size(1:N)))';&#xA;%v(1:N,1)=max((Smin+(0:N-1)*ds-E),(5))';&#xA;&#xA;% Boundary conditions prescribed by the European Call:&#xA;v(1,2:M)=zeros(M-1,1)'; % V(0,t)=0&#xA;v(N,2:M)=((N-1)*ds+Smin)-E*exp(-r*(1:M-1)*dt); % V(S,t)=S-Eexp[-r(T-t)] as S -&amp;gt;infininty.&#xA;&#xA;% Determining the matrix coeficients of the explicit algorithm&#xA;aa=0.5*dt*(sigma*sigma*(1:N-2).*(1:N-2)-r*(1:N-2))';&#xA;bb=1-dt*(sigma*sigma*(1:N-2).*(1:N-2)+r)';&#xA;cc=0.5*dt*(sigma*sigma*(1:N-2).*(1:N-2)+r*(1:N-2))';&#xA;&#xA;% Implementing the explicit algorithm&#xA;for i=2:M,&#xA;v(2:N-1,i)=bb.*v(2:N-1,i-1)+cc.*v(3:N,i-1)+aa.*v(1:N-2,i-1);&#xA;end&#xA;% Reversal of the time components in the matrix as the solution of the     BlackScholes&#xA;% equation was performed backwards&#xA;v=fliplr(v);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="20543" LastEditorUserId="20543" LastEditDate="2016-06-22T01:42:18.690" LastActivityDate="2016-06-22T08:50:51.110" Title="Monte Carlo and PDE results are different for a Call Option!" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;black-scholes-pde&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27726" PostTypeId="2" ParentId="27718" CreationDate="2016-06-21T10:58:10.247" Score="2" Body="&lt;p&gt;My CS master was: &lt;strong&gt;Investment recommendations generated using prediction models based on regression in time series&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Description: The purpose of this paper is to present the environment for generating investment recommendations from predictive models based on regression and evaluating their performance using machine learning techniques on historical high frequency data obtained from the foreign exchange market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The work also can find basic information about trading platforms, simulation environments and scientific information related to techniques, models and algorithms used in the work or forming an alternative or expansion for solutions applied.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Probably can't post it on arxiv.org because it was not in English language.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="6175" LastActivityDate="2016-06-21T10:58:10.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27727" PostTypeId="2" ParentId="27718" CreationDate="2016-06-21T12:04:08.163" Score="1" Body="&lt;p&gt;You could focus on the algorithms used to implement the numerical methods.&lt;/p&gt;&#xA;" OwnerUserId="7178" LastActivityDate="2016-06-21T12:04:08.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27728" PostTypeId="1" CreationDate="2016-06-21T12:04:58.313" Score="5" ViewCount="799" Body="&lt;p&gt;I would like to apply the capital asset pricing model (CAPM) for selecting proportions of 6 different stocks. In introductory books, the CAPM model assumes that there is one market index (e.g. the S&amp;amp;P 500) the individual stocks are regressed against.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, suppose the 6 stocks are from different markets (NASDAQ, NYSE, AMEX) but the same market sector (information technology). How do I determine the efficient frontier and tangency portfolio?&lt;/p&gt;&#xA;" OwnerUserId="22264" LastEditorUserId="22264" LastEditDate="2016-06-21T14:46:30.020" LastActivityDate="2017-06-18T17:27:29.950" Title="How to apply the CAPM to 6 stocks from different markets?" Tags="&lt;capm&gt;&lt;index&gt;&lt;market&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27729" PostTypeId="1" AcceptedAnswerId="30217" CreationDate="2016-06-21T13:03:26.957" Score="9" ViewCount="3177" Body="&lt;p&gt;I am having trouble calculating the CVA of a forward contract. The question is presented below&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;There exists a long forwards position underlying on gold with 2 years remaining. The counterparty can only default either at the end of years 1 or 2. The default probabilities for these points in time are 1% and 4% respectively. A recovery rate of 40% is assumed with a risk free rate of 2%&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The forward contract was entered at $1,400 and a 2-year gold forward currently has a forwards price of 1,445 with expected volatility of 19%. Calculate the CVA of this contract.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Answer:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Exposures at $t=1$ and $t=2$ are \$125.23 and \$167.01 respectively with a total CVA of $4.760.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My Attempt:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The general intuition is to first calculate the exposure (potential loss to the investor due to counterparty risk) at times $t=1$ and $t=2$. We will let&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$v_{t}$ be the value of exposure at time $t$.&lt;/li&gt;&#xA;&lt;li&gt;$c(T,K)$ be the value of a European call option underlying on the forward price maturing at time $T$ with strike price $K$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Now, the first exposure occurs at $t=1$ which is in fact related to the value of the forwards contract. In addition, the forward is assumed to be settled at maturity. Thus the exposure of the contract at $t=1$ is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align}&#xA;v_{1} =&amp;amp; \mathrm{max}((F_{1}-1400)e^{-2\%\cdot1},0) \\&#xA;=&amp;amp; e^{-2\%\cdot 1} \mathrm{max}(F_{1}-1400,0) \\&#xA;=&amp;amp; e^{-2\%\cdot 1} c(1,1400)&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, the exposure at time $t=1$ is $e^{-2\%\cdot 1}$ times a European call option with maturity in $1$ year and strike price $1,400$. The Black-Scholes Merton valuation of this is \$129.04. The exposure is therefore&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$v_{1} = e^{-2\%\cdot 1}\times\$129.04. $$&#xA;$$v_{1} = \$126.48 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A similar construction can be made for the exposure at $t=2$. That is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align}&#xA;v_{2} =&amp;amp; \mathrm{max}(F_{2}-1400,0) \\&#xA;=&amp;amp; c(2,1400)&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e. European call option with maturity in $2$ years and strike price $1,400$. The call has a price of \$168.69 and is the exposure at $t=2$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the recovery rate is 40%, the loss rate is 60%. Thus we expect to lose&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align}&#xA;\mathrm{Loss}(v_{1}) =&amp;amp; 60\%\times126.48 = \$75.89 \\&#xA;\mathrm{Loss}(v_{2}) =&amp;amp; 60\%\times168.69 = \$101.21 \\&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally we consider the probabilities in each year and arrive at the CVA. That is,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align}&#xA;\mathrm{CVA} =&amp;amp; 1\%\times75.89 + 4\%\times101.21 \\&#xA;\mathrm{CVA} =&amp;amp; 4.81 \\&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In conclusion my answers are&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$v_{1} = 126.49$&lt;/li&gt;&#xA;&lt;li&gt;$v_{2} = 168.69$&lt;/li&gt;&#xA;&lt;li&gt;CVA = 4.81&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This differs from the disclosed answers of&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Exposures at $t=1$ and $t=2$ are \$125.23 and \$167.01 respectively with a total CVA of $4.760.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I am not sure if the disclosed answers are correct. However, if someone could go through my working and spot an error or provide an explanation, it would be highly appreciated&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For support: Risk Management and Financial Institutions 4ed. John C. Hull, P.g. 440 shows a similar example.&lt;/p&gt;&#xA;" OwnerUserId="13726" LastEditorUserId="13726" LastEditDate="2017-06-24T06:28:59.280" LastActivityDate="2019-09-26T07:35:31.697" Title="How to calculate the CVA of a forward contract?" Tags="&lt;forward&gt;&lt;credit-risk&gt;&lt;cva&gt;&lt;counterparty-risk&gt;&lt;exposure&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27730" PostTypeId="2" ParentId="27724" CreationDate="2016-06-21T13:08:02.810" Score="4" Body="&lt;p&gt;Practitioners tend to wear Black-Scholes glasses when dealing with European options: to them, quoting a certain option price today $V(S_0;T,K)$ is equivalent to quoting the forward price of the underlying $F(0,T)$ along with a relevant Black-Scholes volatility figure $\sigma(T,K)$(*)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That being said, when you are asked to price a European option on a stock $A$, there is typically 2 possible situations in practice: &lt;strong&gt;[A]&lt;/strong&gt; vs &lt;strong&gt;[B]&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[A]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a liquid market of listed vanilla options written on $A$. Basically, this means that a finite set of European options with very specific characteristics (i.e. specific times to maturity $T$ and strike levels $K$) trade on an exchange meaning that their prices are public. In that case, your job is to perform an &quot;arbitrage free inter/extrapolation&quot; of sorts, i.e. you should use the observed prices to infer the price you are looking for under the assumption that there is no free lunch. There are different approaches: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Choose a particular (jump-)diffusion model and calibrate it so that it reproduces observed option prices as best as possible, then use this model to infer the price of the option you want (or any other option for that matter). As you mention, different models have different performances, both regarding the static fit of the vanilla market (which matters when pricing European options, by definition), but also in terms of forward volatility dynamics (which matters when pricing exotics).&lt;/li&gt;&#xA;&lt;li&gt;Wear Black-Scholes glasses and directly interpolate the market implied forward curve and volatility surface. Different interpolation/extrapolation assumptions can be used, see for instance the SVI paradigm when it comes to fitting the implied volatility surface. The complexity here consists in finding interpolation/extrapolation methods that preclude arbitrage opportunities with yet sufficient degrees of freedom.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Typically, the fit of the vanilla market using method (2) will be almost perfect compared to (1) (actually the fit using Local Volatility models à la Dupire with method (1) should be perfect as well, but the same fit can be relatively out for poorly designed Stochastic Volatility models). Still, method (2) is a purely descriptive one: it is not a &quot;model&quot; per se and it will not help you to price options that are not European.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[B]&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;No similar options trade on stock $A$. Various possibilities here also, but much more &quot;freestyle&quot; because you are &quot;in the dark&quot;. Some ideas (usually these are proprietary methods that few are willing to discuss in details, which I won't do here either),&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Use a proxy underlying which behaves similarly to $A$ (here the complexity is transposed to identifying what a good proxy is)&lt;/li&gt;&#xA;&lt;li&gt;Use historical time series (e.g. calibrate an econometric model) along with a stochastic discount factor (e.g. model the market risk premium)&lt;/li&gt;&#xA;&lt;li&gt;Use the break-even volatility (i.e. the volatility which, historically and on average, makes the P&amp;amp;L of your delta-hedged option position zero over a range of different estimation windows).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;(*) This assumes that the discount curve is fixed using e.g. EONIA for derivatives delivering a payoff in EUR.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-06-21T13:29:09.260" LastActivityDate="2016-06-21T13:29:09.260" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27731" PostTypeId="2" ParentId="27728" CreationDate="2016-06-21T13:30:50.730" Score="1" Body="&lt;p&gt;As the six different stocks belongs to different indices, first you need to calculate separate betas for each of them. Now considering that the the six different stocks belong to same portfolio, you need to calculate portfolio beta, standard deviation and expected return at portfolio level by assigning weights to each of the stock. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this way you can have different portfolio by assigning different weights to each of them and then you can have the efficient frontier graph in order to have the optimum portfolio. You can also find out the optimum portfolio through finding of the sharpe ratio for each of the portfolio.&lt;/p&gt;&#xA;" OwnerUserId="18663" LastActivityDate="2016-06-21T13:30:50.730" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27732" PostTypeId="2" ParentId="27725" CreationDate="2016-06-21T13:40:27.587" Score="2" Body="&lt;p&gt;I would definitely recommend &lt;a href=&quot;http://www.volopta.com/Matlab.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Volopta&lt;/a&gt; as a reliable source of self-contained and commented financial engineering source codes (useful for prototyping/understanding but clearly not production code). I have for instance copy-pasted, the explicit PDE solver you are looking for (centred in space, backward in time) below (+ edited for clarity + improved performance, see &lt;strong&gt;[Edits]&lt;/strong&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Running the code in your configuration: $S_0=110, K=100, T=1, r=q=0, \sigma=0.25$ gives $16.1948$ (you can still refine the spot/time meshes, beware of the fact that explicit schemes are only conditionally stable though), while the Black-Scholes price is $16.1904$&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% European Call Option by Explicit Finite Differences&#xA;% Example taken from Clewlow and Strickland's book&#xA;% &quot;Implementing Derivatives Models&quot;, Figure 3.8 (page 61)&#xA;&#xA;clc; clear;&#xA;&#xA;% Config&#xA;T = 1;                                  % Maturity&#xA;Spot = 110;                             % Spot price&#xA;K = 100;                                % Strike price&#xA;v = 0.25;                               % Volatility&#xA;r = 0.0;                                % Risk free rate&#xA;q = 0.0;                                % Dividend yield&#xA;N = 250;                                % Number of time steps&#xA;M = 250;                                % Number of stock price steps&#xA;&#xA;% Time and spot meshes&#xA;J = 0:1:N;                              % Indices for time step&#xA;dt = T/(length(J)-1);                   % Time increment&#xA;I = M:-1:-M;                            % Indices for stock price step&#xA;dx = v*sqrt(3*dt);                      % Increment for stock price&#xA;S = Spot*exp(I.*dx);                    % Initialize spot mesh (non-unif)&#xA;&#xA;% PDE discretisation&#xA;mu = r - q - v^2/2;                     % Drift for stock process&#xA;pu = dt*(v^2/2/dx^2 + mu/2/dx);         % Up probability&#xA;pm = 1 - dt*v^2/dx^2 - r*dt;            % Middle probability&#xA;pd = dt*(v^2/2/dx^2 - mu/2/dx);         % Down probability&#xA;V = zeros(length(I), length(J));        % Initialize option price&#xA;&#xA;% Terminal condition (absence of arbitrage)&#xA;V(:,end) = max(S - K, 0);&#xA;&#xA;% Work backwards through the lattice&#xA;for j=N:-1:1        &#xA;&#xA;    % Inner spatial nodes at time t_j = (j-1)*dt&#xA;    I = 2:2*M;&#xA;    V(I,j) = pu*V(I-1,j+1) + pm*V(I,j+1) + pd*V(I+1,j+1);&#xA;&#xA;    % Lower boundary condition @ S_{min} = S(2*M+1)&#xA;    V(2*M+1,j) = V(2*M,j);&#xA;&#xA;    % Upper boundary condition @ S_{max} = S(1)&#xA;    V(1,j) = V(2,j) + (S(1) - S(2));        &#xA;&#xA;end&#xA;&#xA;% Finite difference price&#xA;fdPrice = V(M+1,1);&#xA;&#xA;% Analytic BS price&#xA;DF0T = exp(-r*T);&#xA;F0T = Spot*exp((r-q)*T);&#xA;bsPrice = bsPrice(v, DF0T, F0T, K, T, 'C');&#xA;&#xA;fprintf('Finite Difference: %0.4f\n', fdPrice)&#xA;fprintf('Analytic: %0.4f\n', bsPrice)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Edits]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apologies for I didn't read the code that I provided in my answer: I only made sure it produced the right output. AMOF this code was pretty messy (it mixed the $i$ and $j$ indices used once for space/time respectively then later for time/space), also it had an additional set of lines inside the main backward loop&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for i=1:2*M&#xA;    V(i,j) = max(K - S(j), V(i,j));&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;that made no sense. I've added my own corrected version above. It should run faster also since I've removed useless &quot;for&quot; loops.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as your own implementation is concerned, there are so many problems that I would advise you start from the one I gave you and ask questions. If you need proper code review post it on &lt;a href=&quot;https://codereview.stackexchange.com/&quot;&gt;Code Review Stack Exchange.&lt;/a&gt; Examples of problems with your implementation include:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Either embed your MATLAB code inside a proper function, or make sure you clear all previously used variables before you run it. If you don't, your results can be wrong (especially if you change the number of time/space nodes in your case, from big M and N, to small ones).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You pick $S_{\text{min}}=90$ and $S_{\text{max}}=110$ to price an option struck at $E=100$... $S_{\text{min}}$ and $S_{\text{max}}$ should correspond to the boundaries of the spatial domain i.e., ideally, $S_{\text{min}}\approx 0$ and $S_{\text{max}}\approx +\infty$. By over-restricting the spatial domain, you can't expect to reasonably approach the real solution (especially if your boundary conditions are wrong).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You do have a problem with your boundary conditions, but also with your matrix coefficients IMHO.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="-1" LastEditDate="2017-04-13T12:41:08.853" LastActivityDate="2016-06-22T08:50:51.110" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27733" PostTypeId="2" ParentId="27672" CreationDate="2016-06-21T14:56:36.607" Score="1" Body="&lt;p&gt;You can do a couple of things:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The easiest way to calculate your quarterly Jensen's alphas is achieved by calculating quarterly returns and then applying the regression method you have done before. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, your Jensen's alpha represents the abnormal monthly return over a benchmark. Therefore, your quarterly Jensen's alpha can be calculated by &lt;a href=&quot;http://breakingdownfinance.com/finance-topics/finance-basics/interest-rate-compounding/&quot; rel=&quot;nofollow noreferrer&quot;&gt;annualizing&lt;/a&gt; your returns : &lt;span class=&quot;math-container&quot;&gt;$r_q = (1+r_{m1})\cdot(1+r_{m2})\cdot(1+r_{m3})-1$&lt;/span&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13950" LastEditorUserId="28784" LastEditDate="2019-01-08T14:52:54.813" LastActivityDate="2019-01-08T14:52:54.813" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="27734" PostTypeId="1" AcceptedAnswerId="29784" CreationDate="2016-06-21T15:10:35.667" Score="3" ViewCount="458" Body="&lt;p&gt;Can anyone recommend papers that model how long temporary price impact last when you buy / sell a trade? This would fall under the TCA realm (Trade Cost Analysis).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="18320" LastEditorUserId="16148" LastEditDate="2016-06-21T18:14:01.807" LastActivityDate="2016-08-23T06:25:58.953" Title="Papers on temporary price impact" Tags="&lt;equities&gt;&lt;market-microstructure&gt;&lt;market-impact&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27735" PostTypeId="2" ParentId="25524" CreationDate="2016-06-21T17:52:11.893" Score="4" Body="&lt;p&gt;I agree with Student T regarding a lack of texts that will teach C++ specifically geared towards finance, and I would also say that isn't the best way to learn the language anyway.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I taught a C++ course for graduate students for several years when I was doing a post-doc.  The intent of the course was to quickly get engineering graduate students with some programming experience (basic Matlab, VBA, etc..) up and running with C++ for research work.  Ultimately, the text I ended up using (quite successfully) was &lt;em&gt;Accelerated C++: Practical Programming By Example&lt;/em&gt; by Koenig and Moo, alongside Stroustrup's &lt;em&gt;The C++ programming&lt;/em&gt; language as a reference.  &lt;em&gt;Accelerated C++&lt;/em&gt; is brief, concise, yet pretty comprehensive, and goes into a lot of why you want to do things the C++ way.&lt;/p&gt;&#xA;" OwnerUserId="7534" LastEditorUserId="7534" LastEditDate="2016-06-22T19:54:11.917" LastActivityDate="2016-06-22T19:54:11.917" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27736" PostTypeId="2" ParentId="27714" CreationDate="2016-06-21T19:42:47.547" Score="2" Body="&lt;p&gt;Thanks to @Quantuple I was able to modify the steps listed above to give a more accurate calculation. I'll run through the modified steps with real numbers all the way to the result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The process is as follows:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;60-day IV would be for expiration as of June 28, 2016. Find option series bracketing that date. The June 17 and July 15 series both bracket it.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;For each series, find 4 calls and 4 puts around 93.75. Two should be ITM, two should be OTM. This gives us the 90, 92.5, 95, and 97.5 strikes. (We'll use the &quot;last&quot; posted on 2016-04-29 for these strikes.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Compute time to maturity for the near-term and next-term options (fractions of a year) from today (2016-04-29)&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;June 17 expiration = 70500 minutes&lt;/li&gt;&#xA;&lt;li&gt;July 15 expration = 110820 minutes&lt;/li&gt;&#xA;&lt;li&gt;maturity-day-minutes = 86400 minutes (60 days)&lt;/li&gt;&#xA;&lt;li&gt;t1 = (70500 / 525600) = 0.1341324200913242&lt;/li&gt;&#xA;&lt;li&gt;t2 = (110820 / 525600) = 0.21084474885844748&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Compute the forward price in each series for the strike with the smallest difference between put/call prices.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;June 17 forward&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;f1 = 92.5 + (e^(0.0025 * 0.1341324200913242)) * (3.80 - 3.02) = 93.28026160207838&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;July 15 forward&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;f2 = 92.5 + (e^(0.0025 * 0.21084474885844748)) * (4.69 - 3.80) = 93.39046925322982&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Compute the weighted average components for both expirations&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;(110820 - 86400) / (110820 - 70500) = 0.6056547619047619&lt;/li&gt;&#xA;&lt;li&gt;(86400 - 70500) / (110820 - 70500) = 0.3943452380952381&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Interpolate the forward price for our specific time T&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;(93.28026160207838 * 0.6056547619047619) + (93.39046925322982 * 0.3943452380952381) = &lt;strong&gt;93.3237214645116&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Compute time to maturity for a 60-day option&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;(60 / 365.0) = 0.1643835616438356&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Use Black-Scholes to compute implied volatility of puts and calls using the interpolated implied forward price instead of spot and the interpolated put/call prices&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;forward price = 93.3237214645116&lt;/li&gt;&#xA;&lt;li&gt;strike = 93.75 (for 100% moneyness)&lt;/li&gt;&#xA;&lt;li&gt;time to maturity = 0.1643835616438356 (60 / 365)&lt;/li&gt;&#xA;&lt;li&gt;risk free rate = 0.25% (feel free to look up and interpolate better value)&lt;/li&gt;&#xA;&lt;li&gt;call option price = 3.4663&lt;/li&gt;&#xA;&lt;li&gt;put option price = 3.9104&lt;/li&gt;&#xA;&lt;li&gt;these inputs into BS produce&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Call IV&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;0.24188995361328125&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Put IV&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;0.24555206298828125&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Average the call and put IV to get mean 60-day IV which is an annualized value&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;(0.24188995361328125 + 0.24555206298828125) / 2 = 0.24372100830078125&lt;/li&gt;&#xA;&lt;li&gt;24.37% annualized&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;To do this calculation for a 90-day IV, follow these steps. Replace the option series for two series that bracket the maturity date, calc &lt;em&gt;t1&lt;/em&gt;, &lt;em&gt;t2&lt;/em&gt;, and a 90-day maturity minutes and plug-and-chug.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll mark this as the accepted answer unless someone speaks up with any corrections or clarifications in the next day or so.&lt;/p&gt;&#xA;" OwnerUserId="20647" LastActivityDate="2016-06-21T19:42:47.547" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27737" PostTypeId="1" AcceptedAnswerId="27738" CreationDate="2016-06-21T20:27:04.030" Score="1" ViewCount="96" Body="&lt;p&gt;All other things being equal, why would rising unemployment data lead to (a trend) of increasing bond futures?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the line of thinking that bond futures prices have the same relationship with economic data points such as interest rates and inflation as do bonds?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Unemployment rising signals a potentially weak economy and (for sake of argument), the probability of interest rates being cut in the near future increases&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Bond prices would increase as interest rates fall, and futures prices on these bonds would also rise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If anyone could clarify, that would be very helpful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="20531" LastActivityDate="2016-06-22T11:59:36.180" Title="Unemployment data and bond futures" Tags="&lt;bond-futures&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27738" PostTypeId="2" ParentId="27737" CreationDate="2016-06-21T20:55:46.820" Score="0" Body="&lt;p&gt;Of course: bond futures are directly linked to the price of bonds (through a &quot;conversion factor&quot;), and prices of bonds move in the opposite direction of bond yields. The common sense view is that an increase in unemployment foreshadows or coincides with a Recession which is generally a period of low interest rates (both because the Fed lowers i.r. and because there is not much appetite for financing of long term projects, hence i.r are naturally low.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All this is every day business common sense, nothing to do with Quant Finance or formal Macroeconomics and its more complicated and more ambivalent models.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-06-22T11:59:36.180" LastActivityDate="2016-06-22T11:59:36.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27739" PostTypeId="2" ParentId="27694" CreationDate="2016-06-21T21:12:53.297" Score="1" Body="&lt;p&gt;Generally, the PCA approach proceeds as follows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider historical observation times $t_0 &amp;lt; t_1 &amp;lt; \cdots &amp;lt; t_K \le0$. For bucketing times $\delta_1 &amp;lt; \cdots \delta_n$, let $X_j(t_k) = \ln F(t_k, t_k+\delta_j)$. Moreover, let $\eta_j$, for $j=1, \ldots, n$, be a normal random variable with a sample set $\big\{X_j(t_k)-X_j(t_{k-1}\}_{k=1}^K\big\}$. Furthermore, let $\Omega = (\rho_{i, j})_{i,j=1}^n$ be the sample correlation matrix. Observe that&#xA;\begin{align*}&#xA;\Omega = \Sigma \Gamma\Sigma^T,&#xA;\end{align*}&#xA;where $\Gamma = diag(\gamma_1, \ldots, \gamma_n)$ is a diagonal matrix of eigenvalues $\gamma_i\ (i=1, \ldots, n)$, and the columns of $\Sigma = (\omega_{i, j})_{i,j=1}^n$ contains the orthonormal eigenvectors of $\Omega$; here, we assume that $\gamma_i\ge \gamma_{i+1}$, for $i=1, \ldots, n-1$. Then, in distribution, there are $n$ independenr standard normal random variables $\xi_i$, for $i=1, \ldots, n$, such that&#xA;\begin{align*}&#xA;\left(\!&#xA;\begin{array}{c}&#xA;\frac{\eta_1-\mu_1}{\sigma_1}\\&#xA;\vdots\\&#xA;\frac{\eta_n-\mu_n}{\sigma_n}&#xA;\end{array}&#xA;\!\right)&#xA;=&#xA;\left(\!&#xA;\begin{array}{ccc}&#xA;\omega_{1,1} &amp;amp; \cdots &amp;amp; \omega_{1, n}\\&#xA;\vdots &amp;amp; \ddots &amp;amp;\vdots\\&#xA;\omega_{n,1} &amp;amp; \cdots &amp;amp; \omega_{n, n}&#xA;\end{array}&#xA;\!\right)&#xA;\left(\!&#xA;\begin{array}{ccc}&#xA;\sqrt{\gamma_1} &amp;amp;  &amp;amp; \\&#xA; &amp;amp; \ddots &amp;amp; \\&#xA; &amp;amp;  &amp;amp; \sqrt{\gamma_n}&#xA;\end{array}&#xA;\!\right)&#xA;\left(\!&#xA;\begin{array}{c}&#xA;\xi_1\\&#xA;\vdots\\&#xA;\xi_n&#xA;\end{array}&#xA;\!\right).&#xA;\end{align*}&#xA;The PCA approach is to find the integer $p$, where $0&amp;lt; p \le n$, such that&#xA;\begin{align*}&#xA;\frac{\sum_{i=1}^p \gamma_i}{\sum_{i=1}^n \gamma_i}\ge l,&#xA;\end{align*}&#xA;where $l$ is a certain given level, for example, 95%. In general, $p=2$ is sufficient. We assume that $p=2$ below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on PCA, we assume that &#xA;\begin{align*}&#xA;\left(\!&#xA;\begin{array}{c}&#xA;\frac{\eta_1-\mu_1}{\sigma_1}\\&#xA;\vdots\\&#xA;\frac{\eta_n-\mu_n}{\sigma_n}&#xA;\end{array}&#xA;\!\right)&#xA;&amp;amp;\approx&#xA;\left(\!&#xA;\begin{array}{cc}&#xA;\omega_{1,1} &amp;amp; \omega_{1, 2}\\&#xA;\vdots &amp;amp; \vdots\\&#xA;\omega_{n,1} &amp;amp; \omega_{n, 2}&#xA;\end{array}&#xA;\!\right)&#xA;\left(\!&#xA;\begin{array}{cc}&#xA;\sqrt{\gamma_1} &amp;amp; 0 \\&#xA; 0  &amp;amp; \sqrt{\gamma_2}&#xA;\end{array}&#xA;\!\right)&#xA;\left(\!&#xA;\begin{array}{c}&#xA;\xi_1\\&#xA;\xi_2&#xA;\end{array}&#xA;\!\right) \label{pca_1} \\&#xA;&amp;amp;=\left(\!&#xA;\begin{array}{c}&#xA;\omega_{1,1}\sqrt{\gamma_1}\xi_1 + \omega_{1,2}\sqrt{\gamma_2}\xi_2\\&#xA;\vdots\\&#xA;\omega_{n,1}\sqrt{\gamma_1}\xi_1 + \omega_{n,2}\sqrt{\gamma_2}\xi_2&#xA;\end{array}&#xA;\!\right). \tag{1}&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Motivated by $(1)$, we can assume that, for $i=1, \ldots, n$,&#xA;\begin{align*}&#xA;d \ln F(t, t+\delta_i) &amp;amp;= \mu_i dt + \sigma_i^0 \left(\omega_{i, 1}\sqrt{\gamma_1} dW_t^1 + \omega_{i, 2}\sqrt{\gamma_2} dW_t^2\right)\\&#xA;&amp;amp;=\mu_i dt + \sigma_i^1 dW_t^1 + \sigma_i^2 dW_t^2,&#xA;\end{align*}&#xA;where $\{W_t^1, t\ge 0\}$ and $\{W_t^2, t\ge 0\}$ are two independent standard Brownian motions, or certain other independent normal (e.g., mean-reverting) processes.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="2587" LastEditDate="2016-06-22T08:57:42.867" LastActivityDate="2016-06-22T08:57:42.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27740" PostTypeId="2" ParentId="27728" CreationDate="2016-06-22T03:40:24.830" Score="1" Body="&lt;p&gt;Depends on what you want to measure. Personally, as these are all tech stocks, I would go with the NASDAQ. So then you have the betas relative to other tech stocks. However, if you are a truly global investor then you could best proxy the market by MSCI world. &lt;/p&gt;&#xA;" OwnerUserId="18070" LastActivityDate="2016-06-22T03:40:24.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27741" PostTypeId="1" AcceptedAnswerId="27746" CreationDate="2016-06-22T03:58:54.253" Score="7" ViewCount="5300" Body="&lt;p&gt;I am using &lt;a href=&quot;http://www.inside-r.org/packages/cran/TTR/docs/volatility&quot; rel=&quot;nofollow noreferrer&quot;&gt;TTR in R&lt;/a&gt; and I am trying to understand the Yang Zhang volatility estimator (without drift). The following equations seem to imply a single value:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;\sigma = \sqrt{{\sigma_o^2}+k\sigma_c^2+(1-k)\sigma_{rs}^2}&#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\sigma_o^2 = \frac{1}{N-1}\sum_{i=1}^{N}ln{\frac{o_i}{c_{i-1}}^2}$$&lt;/span&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\sigma_c^2 = \frac{1}{N-1}\sum_{i=1}^{N}ln{\frac{c_i}{o_{i-1}}^2}$$&lt;/span&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\sigma_{rs}^2 = \frac{1}{N-1}\sum_{i=1}^{N}(ln{\frac{h_i}{c_i}})(ln{\frac{h_i}{o_i}}) + (ln{\frac{l_i}{c_i}})(ln{\frac{l_i}{o_i}})$$&lt;/span&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$$k = \frac{0.34}{1.34 + \frac{N+1}{N-1}}$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However when I run &lt;code&gt;volatility(my_data, n = 100, calc = &quot;yang.zhang&quot;)&lt;/code&gt; I get a vector with a bunch of NAs in front of it. What is my volatility estimate? Is it the last value in the data frame, if so what are the remaining values at the other data points? I apologize if this is trivial - but I cant seem to find anything in the TTR documentation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerDisplayName="user20664" LastEditorUserId="33381" LastEditDate="2019-02-21T09:30:44.537" LastActivityDate="2019-02-21T09:30:44.537" Title="Understanding Yang-Zhang Volatility Estimator" Tags="&lt;volatility&gt;&lt;programming&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="27742" PostTypeId="2" ParentId="27737" CreationDate="2016-06-22T06:55:59.680" Score="0" Body="&lt;p&gt;Not really. I'd wager more on the lines of lower consumption hence higher business/country risk hence higher yields hence lower prices. Not everything that moves is tied to the Fed. &lt;/p&gt;&#xA;" OwnerUserId="20523" LastActivityDate="2016-06-22T06:55:59.680" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27743" PostTypeId="1" CreationDate="2016-06-22T09:03:39.227" Score="1" ViewCount="130" Body="&lt;p&gt;I have a bond with the following cash flow and maturity:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Cash flow vector    Maturity&#xA;4                   0.479452055&#xA;4                   1.479452055&#xA;4                   2.479452055&#xA;4                   3.479452055&#xA;104                 4.479452055&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to derive the price by discounting using the spot curve (see Excel-File for exact values) per 2015-12-31 and a credit spread of 0,054430033:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; Spot Curve   Maturity&#xA; -0.8%         1&#xA; -0.8%         2&#xA; -0.8%         3&#xA; -0.7%         4&#xA; -0.5%         5&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried this in the &lt;a href=&quot;https://www.dropbox.com/s/awd0ml3s8p5zs7w/AT0000A10J83.xls?dl=0&quot; rel=&quot;nofollow&quot;&gt;Excel-Spreadsheet (over here)&lt;/a&gt;, however the prices I calculate differ from the price of my bond valuation engine where 98.22 is provided (in two programmes independently). I guess the discount factors I use are wrong. Yet I do not know how to construct the proper discount curve with these inputs. Can you please point me to the right direction?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&#xA;I have been thinking about my issue and spotted a maturity mismatch since the spot curve is provided for maturity 1 to 10 whilst my first cash flow is at 0.479 - probably this is a problem as well?&lt;/p&gt;&#xA;" OwnerUserId="1807" LastEditorUserId="1807" LastEditDate="2016-06-22T14:30:44.840" LastActivityDate="2016-06-22T14:30:44.840" Title="Discount curve from spot rates for bond pricing" Tags="&lt;bond&gt;&lt;discount-factor-curve&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27744" PostTypeId="2" ParentId="27734" CreationDate="2016-06-22T09:31:44.997" Score="0" Body="&lt;p&gt;You might want to measure the resiliency of a limit order book.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://users.iems.northwestern.edu/~armbruster/2007msande444/large-06.pdf&quot; rel=&quot;nofollow&quot;&gt;http://users.iems.northwestern.edu/~armbruster/2007msande444/large-06.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://hal.archives-ouvertes.fr/hal-00166969/PDF/OE19.pdf&quot; rel=&quot;nofollow&quot;&gt;https://hal.archives-ouvertes.fr/hal-00166969/PDF/OE19.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-06-22T09:31:44.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27746" PostTypeId="2" ParentId="27741" CreationDate="2016-06-22T10:23:28.087" Score="8" Body="&lt;p&gt;The &lt;code&gt;n=100&lt;/code&gt; specifies the number of periods (rolling) for the vol estimate - see the original link &lt;a href=&quot;https://web.archive.org/web/20100326215050/http://www.sitmo.com/eq/409&quot; rel=&quot;noreferrer&quot;&gt;https://web.archive.org/web/20100326215050/http://www.sitmo.com/eq/409&lt;/a&gt; where the &lt;code&gt;n&lt;/code&gt; is referred to as &lt;em&gt;Number of historical prices used for the volatility estimate&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example in R:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(TTR)&#xA;library(quantmod)&#xA;&#xA;getSymbols(&quot;AAPL&quot;)&#xA;nrow(AAPL) # we have 2384 price points&#xA;&#xA;&#xA;vol &amp;lt;- volatility(AAPL, n = 100, calc = &quot;yang.zhang&quot;)&#xA;# if n = 100, then we have 2384 - 100 = 2284 vol estimates for all the &quot;100-day rolling period&quot;&#xA;nrow(na.omit(vol))&#xA;# and we have 100 NA for the initial 100 periods&#xA;sum(is.na(vol))&#xA;&#xA;# if n = 2383 then we have only a single vol estimae (i.e. massive 2383 period window)&#xA;vol2 &amp;lt;- volatility(AAPL, n = 2383, calc = &quot;yang.zhang&quot;)&#xA;nrow(na.omit(vol2))&#xA;sum(is.na(vol2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;produces&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[1] &quot;AAPL&quot;&#xA;&amp;gt; nrow(AAPL) # we have 2384 price points&#xA;[1] 2384&#xA;&amp;gt; &#xA;&amp;gt; &#xA;&amp;gt; vol &amp;lt;- volatility(AAPL, n = 100, calc = &quot;yang.zhang&quot;)&#xA;&amp;gt; # if n = 100, then we have 2384 - 100 = 2284 vol estimates for all the &quot;100-day rolling period&quot;&#xA;&amp;gt; nrow(na.omit(vol))&#xA;[1] 2284&#xA;&amp;gt; # and we have 100 NA for the initial 100 periods&#xA;&amp;gt; sum(is.na(vol))&#xA;[1] 100&#xA;&amp;gt; &#xA;&amp;gt; # if n = 2383 then we have only a single vol estimae (i.e. massive 2383 period window)&#xA;&amp;gt; vol2 &amp;lt;- volatility(AAPL, n = 2383, calc = &quot;yang.zhang&quot;)&#xA;&amp;gt; nrow(na.omit(vol2))&#xA;[1] 1&#xA;&amp;gt; sum(is.na(vol2))&#xA;[1] 2383&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="18030" LastActivityDate="2016-06-22T10:23:28.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27747" PostTypeId="1" AcceptedAnswerId="27761" CreationDate="2016-06-22T11:50:27.323" Score="1" ViewCount="286" Body="&lt;p&gt;I am examining how investor sentiment affects the probability of stock market crises. I am using methodology similar to this paper &lt;a href=&quot;https://ideas.repec.org/p/dij/wpfarg/1110304.html&quot; rel=&quot;nofollow&quot;&gt;https://ideas.repec.org/p/dij/wpfarg/1110304.html&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the control variables in the model is the real interest rate. The authors calculate their measure of the real interest rate as &quot;the money market rate, using the Consumer Price Index&quot; (Table on page 25 of their paper). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have CPI data for the countries that I am using in my study. However, I am not clear on how to transform Money Market Rate and CPI data into a measure of the real interest rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks. &lt;/p&gt;&#xA;" OwnerUserId="22099" LastEditorUserId="22099" LastEditDate="2016-06-23T10:06:58.147" LastActivityDate="2016-06-27T06:51:00.723" Title="How to measure the real interest rate using the consumer price index" Tags="&lt;interest-rates&gt;&lt;methodology&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27748" PostTypeId="1" AcceptedAnswerId="28131" CreationDate="2016-06-22T13:49:36.047" Score="2" ViewCount="82" Body="&lt;p&gt;I am examining the impact of investor sentiment on the probability of stock market crises. I am constructing a composite measure of investor sentiment according to the methodology used in this paper &lt;a href=&quot;http://121.192.176.75/repec/upload/201312051625034821.pdf&quot; rel=&quot;nofollow&quot;&gt;http://121.192.176.75/repec/upload/201312051625034821.pdf&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the variables used in the composite index is the &quot;number of new investor accounts&quot; - top of page 6. This paper uses data for the Shanghai composite index and the Shenzhen Index. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for data on the number of new investor accounts for the S&amp;amp;P 500, FTSE 100, NIKKEI 225, S&amp;amp;P/TSX and the ASX 200. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have searched Bloomberg and datastream but cannot find anything. Any suggestions on where I might find such data would be great.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="22099" LastActivityDate="2016-07-18T16:36:55.143" Title="Where to find historical time series data for number of new investor accounts" Tags="&lt;data&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27749" PostTypeId="1" CreationDate="2016-06-22T15:04:46.040" Score="2" ViewCount="1304" Body="&lt;p&gt;Say I'm considering a long maturity fixed rate swap, for instance 20 years paid semi annually. Now I want to find the fixed rate for this hypothetical swap. I understand that this fixed rate is going to be predicated on discount rates based on the current term structure of the LIBOR yield curve (or whatever reference rate). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because of the very long maturity of the swap, however, I'll need to have LIBOR discount rates for payments that will be made very far in the future. Now it may be the case that LIBOR rates are only quoted up to 1 year. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I need the discount rate for the final payment at the end of the swap, in the distant future, to compute the swap fixed rate. However I don't have a LIBOR discount rate for that payment because it isn't quoted up to that maturity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To compute the swap fixed rate, how do I find the appropriate discount factors beyond what's quoted in the LIBOR curve? &lt;/p&gt;&#xA;" OwnerUserId="17712" LastActivityDate="2017-11-09T00:00:46.030" Title="Constructing Swap Curve from LIBOR" Tags="&lt;swaps&gt;&lt;libor&gt;&lt;yield&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27751" PostTypeId="2" ParentId="27635" CreationDate="2016-06-22T16:28:50.533" Score="2" Body="&lt;p&gt;This is no means a rigorous proof but I believe it may help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's suppose you have Brownian motion under the normal conditions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dX_t = \mu X_tdt + \sigma X_tdW_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The drift $\mu$ and volatility $\sigma$ are constants for each time step. Now let's suppose we 'zoom in' to a smaller time step $s = t/2$. Our drift portion of the equation goes to $\frac{\mu}{2}$ while our volatility goes to $\frac{\sigma}{\sqrt{2}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we continue this pattern we will quickly see that our drift portion of the GBM equation decreases much more quickly than our volatility portion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in one year there are 3153600 seconds. If we were to calculate our drift and volatility based on one year and then use seconds as our time step our mean would be $\frac{1}{3153600}$ as large while our volatility would be $\frac{1}{1775.83}$ as large.&lt;/p&gt;&#xA;" OwnerUserId="5940" LastActivityDate="2016-06-22T16:28:50.533" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27752" PostTypeId="1" AcceptedAnswerId="27753" CreationDate="2016-06-22T16:52:59.130" Score="3" ViewCount="767" Body="&lt;p&gt;About every introduction I've read about automatic trading writes about how well python is suited for the task.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But looking around, I've been able to find just one brooker, Oanda, which has a python api for placing orders. However Oanda is nearly only forex.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where should I look if I wanted to place orders with stocks, options, futures in north america and european exchanges. With python and standalone (No browser Quantopian)&lt;/p&gt;&#xA;" OwnerUserId="22296" LastActivityDate="2017-10-18T06:39:17.893" Title="Python everywhere but where do they execute orders?" Tags="&lt;python&gt;&lt;order-execution&gt;" AnswerCount="5" CommentCount="2" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27753" PostTypeId="2" ParentId="27752" CreationDate="2016-06-22T17:27:29.600" Score="3" Body="&lt;p&gt;IBPy + IB Gateway + TWS and you can send order to any &lt;a href=&quot;https://www.interactivebrokers.com/en/index.php?f=14718&quot; rel=&quot;nofollow&quot;&gt;interactive brokers&lt;/a&gt;, how to &lt;a href=&quot;https://www.quantstart.com/articles/using-python-ibpy-and-the-interactive-brokers-api-to-automate-trades&quot; rel=&quot;nofollow&quot;&gt;setup&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="18675" LastActivityDate="2016-06-22T17:27:29.600" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27755" PostTypeId="1" AcceptedAnswerId="27758" CreationDate="2016-06-22T20:03:47.153" Score="6" ViewCount="2815" Body="&lt;p&gt;After reading some more of &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470181990&quot; rel=&quot;nofollow noreferrer&quot;&gt;Volatility Trading&lt;/a&gt;, I decided to try to make a simple volatility model using daily log returns of an ETF I follow. It turns out &quot;simple&quot; is sort of relative. Unfortunately, it seems most literature is hopelessly vague on how exactly to do such a thing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I started by taking the log of closing prices, and differencing them to detrend the data and get the log return series. I showed it was stationary by running ADF (p-value &amp;lt; 0.01). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now this is where the trouble starts. Since this is a univariate GARCH model, I decided to run with the &lt;code&gt;rugarch&lt;/code&gt; package in R. I initially spec it as GARCH(1,1). The solver fails to converge. Ok - so I run a bootstrapper and try to get more data to see if I can at least get some form of convergence - it fails. Turning up the iterations also seems to make it fail. So I couldn't really explain how good or bad the data was.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After reading &lt;a href=&quot;http://faculty.washington.edu/ezivot/research/practicalgarchfinal.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Eric Zivot's Practical Issues in the Analysis of Univariate GARCH&#xA;Models&lt;/a&gt; it strikes me that I should be using some sort of transformed data. I noticed he mentions squaring the log returns, so I blindly try that and the GARCH solver converges without issue. Reading more into this I find another paper - &lt;a href=&quot;http://cims.nyu.edu/~almgren/timeseries/Vol_Forecast1.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Volatility Forecasting I: GARCH Models&lt;/a&gt; - that discusses that squared returns are positively autocorrelated. So I ask myself - what is this squared return thing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Enter a post from here titled &lt;a href=&quot;https://quant.stackexchange.com/questions/7000/squared-and-absolute-returns&quot;&gt;Squared and Absolute returns&lt;/a&gt;. This post unfortunately isn't so helpful, but it sent me down the rabbit hole reading &lt;a href=&quot;https://www.cmegroup.com/trading/fx/files/volEst.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Volatility Estimation&lt;/a&gt; from the CME group. Section 1.1 highlights that squared returns are a proxy for volatility, however it is extremely imprecise. This leads me to a handful of questions I'm hoping you guys can help me with:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;If squared returns are an imprecise proxy for volatility, why is it suggested we build GARCH volatility models using them? Won't this reduce the effectiveness of the model's predictions?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Eric Zivots paper makes mention of GARCH effects of a time series. One of the ways you can check for the is the Ljung-Box test. However, I don't quite understand how to set this up, especially in R. My inclination is to think that my log return series does not have GARCH effects, however the squared log return series does.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Can we use a different, more precise, volatility estimator and build a GARCH model on that? (ex Garman-Klass)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I apologize if these are trivial questions - I just can't seem to find a single resource that answers my exact question. I'd really appreciate any help or direction to resources where I can figure this stuff out. I really would like to fully understand this before I put it to practical use. Thanks in advance!&lt;/p&gt;&#xA;" OwnerDisplayName="user20664" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2019-06-20T15:40:36.087" Title="GARCH volatility modeling, squared returns, and convergence" Tags="&lt;volatility&gt;&lt;r&gt;&lt;garch&gt;&lt;modeling&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="27758" PostTypeId="2" ParentId="27755" CreationDate="2016-06-23T09:08:02.197" Score="5" Body="&lt;p&gt;Assume that your stationary time series (here a daily close-to-close log-returns' series) is modelled as follows $\forall t \in \mathcal{T}=\{1,...,N\}$&#xA;\begin{align}&#xA;r_t &amp;amp;= E_{t-1}[r_t] + \epsilon_t \\&#xA;    &amp;amp;= E_{t-1}[r_t] + \sigma_t z_t &#xA;\end{align}&#xA;with $z_t \sim N(0,1)$ and $\{z_t\}_{t \in \mathcal{T}}$ are IID.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above equations suggest that, knowing the information available at $t-1$ (i.e. given the filtration $\mathcal{F}_{t-1}$), the conditional mean and variance of $r_t$  are respectively given by&#xA;\begin{align}&#xA;E_{t-1}[r_t] \text{ and } \sigma^2_t&#xA;\end{align}&#xA;Now we can further specify a &lt;em&gt;conditional mean model&lt;/em&gt; e.g. an ARMA(p,q)&#xA;$$ E_{t-1}[r_t] = \omega_1 + \sum_{i=1}^p \alpha_i r_{t-i} + \sum_{j=1}^q \beta_j z_{t-j} $$&#xA;and/or a &lt;em&gt;conditional variance model&lt;/em&gt; e.g. a GARCH(r,s)&#xA;$$ \sigma_t^2 = \omega_2 + \sum_{k=1}^r \gamma_k r^2_{t-k} + \sum_{l=1}^s \delta_l \sigma_{t-l}^2 $$&#xA;Notice that these two models can be specified independently of one another. It is crucial not to confuse the two, especially when using third-party libraries. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, let us forget about the conditional mean in the remainder of this answer and assume $E_{t-1}[y_t]=0$ which is often a reasonable approximation in practice, at least as far as daily log-returns are concerned. Further assuming a GARCH (1,1) one gets:&#xA;$$ r_t = \sigma_t z_t\ \ \text{   along with   }\ \ \sigma_t^2 = \omega + a r_{t-1}^2 + b \sigma_{t-1}^2 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the above specification it is clear that:&#xA;$$ E_{t-1}[r_t^2] = E_{t-1}[\sigma_t^2 z_t^2] = \sigma_t^2 \underbrace{E_{t-1}[z_t^2]}_{=1} $$&#xA;because $z_t \perp \sigma^2_t$ and $\sigma_t^2$ is $\mathcal{F}_{t-1}$-measurable. The above equation shows that squared returns are an unbiased proxy of conditional volatility. Yet because $z_t^2 \sim \chi_{(1)}^2$ this is a very imprecise proxy, see &lt;a href=&quot;https://www.cmegroup.com/trading/fx/files/volEst.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;CME paper&lt;/a&gt; page 5 or &lt;a href=&quot;https://ideas.repec.org/a/taf/apfelt/v3y2007i4p255-257.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Triacca, 2007&lt;/a&gt; page 256 in Applied Financial Economics Letters, 3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now back to your application, you would like to estimate historical volatility right? You have different possibilities. Let's take a look at what you propose:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;GARCH(1,1): Assuming no conditional mean model is superimposed, the parameters you need to estimate are $\omega, a$ and $b$ reading those posts &lt;a href=&quot;https://quant.stackexchange.com/questions/26357/why-is-the-garch-intercept-supposed-to-be-strictly-positive/26361#26361&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;https://quant.stackexchange.com/questions/26076/does-the-unconditional-variance-implied-by-a-garch-equal-the-sample-variance/26083#26083&quot;&gt;here&lt;/a&gt; may help you in your endeavour. There is no reason why you should use transformed returns except if: (1) the function you're using is specifically designed to take transformed returns in input, but I find this weird (you seem to have read that we use squared returns somewhere could you exactly point out where?) (2) Transformations such as taking the square root (or the natural logarithm etc.) maybe to useful to stabilise variance (i.e. make the series stationary), but you have already checked that this was OK via an ADF test. In other words, the function you use should return you an answer. Even if there is no GARCH effect as you seem to imply, in which case $a=b=0$ and you'll have a constant variance (homoskedastic returns). You should further investigate why this step fails IMHO, identify the reason while there is no convergence. Maybe use variance targeting to reduce the complexity of the numerical optimisation step (see the linked posts above)?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/11306/what-is-the-equation-for-garman-klass-volatility&quot;&gt;Garman-Klass&lt;/a&gt; volatility estimator or any other volatility estimator for that matter e.g. &lt;a href=&quot;https://quant.stackexchange.com/questions/27741/understanding-yang-zhang-volatility-estimator&quot;&gt;Yang-Zhang&lt;/a&gt; or sample realised volatility over rolling windows. As the name indicates, these are estimators not models (although they do require underlying modelling assumptions). They are purely descriptive: you apply a formula and get a volatility estimate. I don't see why would one ever want to build a GARCH model on top of such an estimator. Remember that GARCH is a conditional variance model. Why would you model the conditional variance of a volatility estimator?!&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;PS: I'm neither an expert in statistical tests nor in R so I can't really comment on how to set up the Ljung-Box test. Still, I would say that your inclination is not right, although I guess you could claim that, in general, returns are not autcorrelated while squared returns are, see this seminal paper on &lt;a href=&quot;http://www.proba.jussieu.fr/pageperso/ramacont/papers/empirical.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;market stylised facts&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-06-27T16:42:41.790" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27759" PostTypeId="2" ParentId="27713" CreationDate="2016-06-23T09:17:33.060" Score="0" Body="&lt;p&gt;SR increases as a function of measurement frequency because the random components of the return have a greater chance to cancel out for longer frequencies.   There's nothing mysterious about that. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using variance instead of standard deviation makes no sense from a dimensional standpoint.  If returns are in dollars, standard deviation is in dollars but variance is dollars squared.  You want the ratio to be dimensionless.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-06-23T09:17:33.060" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27760" PostTypeId="1" CreationDate="2016-06-23T09:57:48.747" Score="4" ViewCount="881" Body="&lt;p&gt;&lt;strong&gt;I would like to be able to change the timezone for my requests to the IB API, how can I do this?&lt;/strong&gt; I am writing in Python, and thus use the IBPy wrapper found &lt;a href=&quot;https://github.com/blampe/IbPy&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How to reproduce the problem:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Create the contract to be queried by specifying contract.m_symbol = 'AUD', contract.m_secType = 'CASH', contract.m_exchange = 'IDEALPRO', contract.m_primaryExch = 'IDEALPRO', contract.m_currency = 'NZD'&lt;/li&gt;&#xA;&lt;li&gt;Using reqHistoricalData, get the daily opening price of the above contract with EST as the timezone for 23/6/2016. &lt;/li&gt;&#xA;&lt;li&gt;Now change the timezone by modifying the 3rd argument of reqHistoricalData to use JST as the timezone for 23/6/2016.&lt;/li&gt;&#xA;&lt;li&gt;Compare the opening prices from step 2 and 3&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Supposedly, the third argument of the function reqHistoricalData(...) controls the timezone. However, changing from EST to JST doesn't change my prices. I have been in contact with the API guys from IB. They obtain the following results for AUD.NZD:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With EST as timezone opening price for 23/6/16 is: 1.046185&#xA;With JST as timezone opening price for 23/6/16 is: 1.04598&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get:&#xA;1.046185 for all timezone I have tried (GMT, EST, JST).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have approached the following resources:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://interactivebrokers.github.io/tws-api/historical_data.html#hd_request&quot; rel=&quot;nofollow&quot;&gt;General usage and examples&lt;/a&gt; of reqHistoricalData&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.interactivebrokers.com/en/software/api/apiguide/tables/supported_time_zones.htm&quot; rel=&quot;nofollow&quot;&gt;List&lt;/a&gt; of accepted timezones &lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.interactivebrokers.com/en/software/api/apiguide/c/reqhistoricaldata.htm&quot; rel=&quot;nofollow&quot;&gt;Documentation&lt;/a&gt; of reqHistoricalData() function.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;How can I change the timezone in my historic data requests? Any help is greatly appreciated, and I promise to buy you a drink the next time you are in Singapore.&lt;/p&gt;&#xA;" OwnerUserId="22143" LastEditorUserId="22143" LastEditDate="2016-07-04T02:38:14.860" LastActivityDate="2018-12-14T11:38:15.677" Title="Changing timezones with historic forex data (Interactive Brokers API IBPy)" Tags="&lt;fx&gt;&lt;python&gt;&lt;interactive-brokers&gt;&lt;timezone&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27761" PostTypeId="2" ParentId="27747" CreationDate="2016-06-23T10:58:21.757" Score="3" Body="&lt;p&gt;Real rate = Money Market Rate - CPI&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Approximately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I do want to be exact (thanks, @noob2):  $(1+real)=\frac{1+MMR}{1+CPI}$&lt;/p&gt;&#xA;" OwnerUserId="357" LastEditorUserId="357" LastEditDate="2016-06-27T06:51:00.723" LastActivityDate="2016-06-27T06:51:00.723" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27762" PostTypeId="1" AcceptedAnswerId="27768" CreationDate="2016-06-23T12:04:44.313" Score="4" ViewCount="1095" Body="&lt;p&gt;So if i want to calcualte the correlation between a pair of assets, my intuition is that i should calculate whatever correlation i plan on using;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When we look at &lt;em&gt;correlation&lt;/em&gt;, it's normally the correlation of the log returns - which makes sense from a MC standpoint, since it's the correlated random numbers that create the returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If i want to simulate a set of paths of the pair of assets, and one will be simulated using a lognormal returns process and the other a random normal walk (absolute), then i should convert each time series into just the &lt;em&gt;random number sequences&lt;/em&gt; which, when put through the process i will use, will recreate them - and then take the correlation of these numbers (assuming i'm using only historical correlation)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i.e. work out the correlation of the underlying random sequences.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this correct?&lt;/p&gt;&#xA;" OwnerUserId="19663" LastActivityDate="2016-06-24T01:06:10.333" Title="Correlation of a lognormal asset and a normal asset" Tags="&lt;correlation&gt;&lt;normal-distribution&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27763" PostTypeId="1" AcceptedAnswerId="27764" CreationDate="2016-06-23T12:42:22.353" Score="5" ViewCount="719" Body="&lt;p&gt;In all books and references that I have been exposed to, the jump processes have been defined to be Cadlag(right continuous with left limits). But no one has explained why this is the preferable case, why can't it be Caglad? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suspect it has something to do with filtration, but I don't know the exact reasoning. &lt;/p&gt;&#xA;" OwnerUserId="6016" LastActivityDate="2016-06-23T15:05:34.657" Title="Why does jump process has to be Cadlag and not the other way around" Tags="&lt;stochastic-processes&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27764" PostTypeId="2" ParentId="27763" CreationDate="2016-06-23T15:05:34.657" Score="3" Body="&lt;p&gt;I don't know if this is enough. But here is my understanding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's imagine a simple process like a Poisson process.&#xA;It is naturally cadlag, because at the time you jump, you jump. Just before, you have not jumped. Mathematically, if the first jump occurs at $t$, $\forall s&amp;lt;t, N_s=0$ and $N_t=1$. It means that the jump occuring at time $t$ is $t$-measurable (even if it is not predictible).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So a cadlag process means that at the time of the jump, you see the process jumping.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-06-23T15:05:34.657" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27765" PostTypeId="1" AcceptedAnswerId="27766" CreationDate="2016-06-23T15:20:12.420" Score="2" ViewCount="86" Body="&lt;p&gt;If my underlying follows a dynamics of the form &#xA;\begin{align*}&#xA;dF(t,T)/F(t,T)=\sigma_1(t,T)dW_1(t)+\sigma_2(t,T)dW_2(t),&#xA;\end{align*}&#xA;where $\sigma_1(t,T)=h_1e^{-\lambda(T-t)}+h_0$, and $\sigma_2(t,T)=h_2e^{-\lambda(T-t)}$. How to derive an option price?&lt;/p&gt;&#xA;" OwnerUserId="22152" LastEditorUserId="11678" LastEditDate="2016-06-23T17:37:52.577" LastActivityDate="2016-06-23T17:37:52.577" Title="Option price derivation with these dynamics" Tags="&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27766" PostTypeId="2" ParentId="27765" CreationDate="2016-06-23T15:50:16.977" Score="3" Body="&lt;p&gt;You can proceed similarly to &lt;a href=&quot;https://quant.stackexchange.com/questions/27652/how-to-derive-an-option-price-for-an-asset-with-these-dynamics.&quot;&gt;this question&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For $0 &amp;lt; T_0\le T$, consider the option with payoff, at the option maturity $T_0$, of the form&#xA;\begin{align*}&#xA;\max(F_{T_0, T}-K, \, 0).\tag{1}&#xA;\end{align*}&#xA;Note that&#xA;\begin{align*}&#xA;F_{T_0, T} &amp;amp;= F_{0, T}\exp\Bigg(-\frac{1}{2}\int_0^{T_0} \left[\left(h_1e^{-\lambda (T-t)}+h_0\right)^2 + h_2^2e^{-2\lambda (T-t)} \right] dt\\&#xA;&amp;amp;\qquad\qquad\qquad +\int_0^{T_0}\left[\left(h_1e^{-\lambda (T-t)}+h_0\right)dW_t^1 + h_2e^{-\lambda (T-t)}dW_t^2\right]\Bigg).&#xA;\end{align*}&#xA;Let&#xA;\begin{align*}&#xA;\hat{\sigma}^2 &amp;amp;= \frac{1}{T_0}\int_0^{T_0} \left[\left(h_1e^{-\lambda (T-t)}+h_0\right)^2 + h_2^2e^{-2\lambda (T-t)} \right] dt\\&#xA;&amp;amp;=\frac{e^{-2\lambda T}(h_1^2+h_2^2)}{2\lambda T_0}\left(e^{2\lambda T_0} -1\right)+\frac{2e^{-\lambda T}h_0h_1}{\lambda T_0}\left(e^{\lambda T_0} -1\right) + h_0^2.&#xA;\end{align*}&#xA;Then, in distribution,&#xA;\begin{align*}&#xA;F_{T_0, T} = F_{0, T}\exp\left(-\frac{\hat{\sigma}^2}{2} T_0 + \hat{\sigma} \sqrt{T_0} Z\right),&#xA;\end{align*}&#xA;where $Z$ is a standard normal random variable. The value of Payoff $(1)$ is now given by&#xA;\begin{align*}&#xA;e^{-r T_0}\Big[F_{0, T}\Phi(d_1) - K\Phi(d_2) \Big],&#xA;\end{align*}&#xA;where &#xA;\begin{align*}&#xA;d_1 &amp;amp;= \frac{\ln \frac{F_{0, T}}{K} + \frac{\hat{\sigma}^2}{2} T_0}{\hat{\sigma} \sqrt{T_0}},\\&#xA;d_2 &amp;amp;= d_1 - \hat{\sigma} \sqrt{T_0},&#xA;\end{align*}&#xA;and $\Phi$ is the cumulative distribution function of a standard normal random variable.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-06-23T15:55:38.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27768" PostTypeId="2" ParentId="27762" CreationDate="2016-06-23T20:55:08.920" Score="5" Body="&lt;p&gt;Let $(X_t)_{t\geq 0}$ denote a Geometric Brownian Motion&#xA;$$ \frac{dX_t}{X_t} = \mu_X dt + \sigma_X dW^X_t,\ \ \ X(0) = X_0$$&#xA;such that $X_t$ is lognormally distributed $\forall t &amp;gt; 0$&#xA;$$ X_t =  X_0 e^{(\mu_X - \frac{1}{2}\sigma_X ^2)t + \sigma_X W_t^X}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $(Y_t)_{t\geq 0}$ denote an Arithmetic Brownian Motion&#xA;$$ dY_t = \mu_Y dt + \sigma_Y dW_t^Y,\ \ \  Y(0)=Y_0 $$&#xA;such that $Y_t$ is normally distributed $\forall t &amp;gt; 0$&#xA;$$Y_t = Y_0 + \mu_Y t + \sigma_Y W_t^Y $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider an instantaneous correlation between the driving Brownian motions $W^X$ and $W^Y$ &#xA;$$ \rho := \frac{d\langle W^X, W^Y\rangle_t}{dt} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Proposition]&lt;/strong&gt; Specifying an instantaneous correlation $\rho$ between the two driving Brownian motions means that the two normal variables $\ln X_t$ and $Y_t$ exhibit a terminal correlation $\rho$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Proof]&lt;/strong&gt; To see this, notice that&#xA;\begin{align}&#xA;\ln X_t &amp;amp;= \ln X_0 + (\mu_X - \frac{1}{2}\sigma^2_X)t  + \sigma_X W^X_t \\&#xA;         &amp;amp;= \ln X_0 + (\mu_X - \frac{1}{2}\sigma^2_X)t  + \sigma_X (\rho W^Y_t + \sqrt{1-\rho^2}W^{Y,\perp}_t)&#xA;\end{align}&#xA;hence the covariance writes&#xA;\begin{align}&#xA;\text{cov}(\ln X_t,Y_t) &amp;amp;= \text{cov}(\ln X_0 + (\mu_X - \frac{1}{2}\sigma^2_X)t + \sigma_X (\rho W^Y_t + \sqrt{1-\rho^2}W^{Y,\perp}_t),  Y_0 + \mu_Y t + \sigma_Y W_t^Y) \\&#xA;&amp;amp;= \text{cov}(\sigma_X (\rho W^Y_t + \sqrt{1-\rho^2}W^{Y,\perp}_t), \sigma_Y W_t^Y) \\&#xA;                        &amp;amp;= \text{cov}(\sigma_X \rho W^Y_t, \sigma_Y W_t^Y) + \text{cov}(\sigma_X \sqrt{1-\rho^2}W^{Y,\perp}_t, \sigma_Y W_t^Y) \\&#xA;&amp;amp;= \rho \sigma_X \sigma_Y \underbrace{\text{cov}(W^Y_t, W^Y_t)}_{=t} + \sqrt{1-\rho^2}\sigma_X \sigma_Y \underbrace{\text{cov}(W^{Y,\perp}_t,W_t^Y)}_{=0} \\&#xA;&amp;amp;= \rho \sigma_X \sigma_Y t&#xA;\end{align}&#xA;by bilinearity of the covariance operator and using the fact that $W^{Y,\perp}_t \perp W^Y_t$. In parallel we have:&#xA;$$ \text{var}(\ln X_t) = \sigma_X^2 t $$&#xA;$$ \text{var}(Y_t) = \sigma_Y^2 t $$&#xA;so that &#xA;$$ \text{corr} = \frac{\text{cov}(\ln X_t,Y_t)}{\sqrt{\text{var}(\ln X_t)\text{var}(Y_t)}} = \frac{\rho \sigma_X \sigma_Y t}{\sigma_X \sqrt{t} \sigma_Y \sqrt{t}} = \rho $$&#xA;which concludes the demonstration&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-06-24T01:06:10.333" LastActivityDate="2016-06-24T01:06:10.333" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="27771" PostTypeId="1" CreationDate="2016-06-24T12:31:52.610" Score="2" ViewCount="51" Body="&lt;p&gt;I am looking for any reference where the following problem was addressed: given the list of trades of a trader teach an AI to replicate that trader's strategy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several well-known results on hedge fund replication (usually factor based) and methods focusing on the replication of the return distribution (usually by stochastic optimization) but I am looking for a more &quot;active&quot; replication where the machine learns to trade as a trader. The main difference is that in my case I would know all the historical trades which is usually not known with other approaches. &lt;/p&gt;&#xA;" OwnerUserId="5890" LastActivityDate="2016-06-24T12:31:52.610" Title="Reference Request: Trader Replication" Tags="&lt;replication&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27772" PostTypeId="1" AcceptedAnswerId="27779" CreationDate="2016-06-24T12:58:17.790" Score="2" ViewCount="227" Body="&lt;p&gt;The expected return of an option is given by its expected payoff under $P$ over its market price under $Q$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the Black-Scholes model, expected call option return is given as (see &lt;a href=&quot;https://www.google.de/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=2&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0ahUKEwie55G318DNAhUSM8AKHV5bCOkQFggpMAE&amp;amp;url=http%3A%2F%2Fwww.mcgill.ca%2Fdesautels%2Ffiles%2Fdesautels%2Fhj_jan29_2016.pdf&amp;amp;usg=AFQjCNHqr3LsTSzpU_97QCx9hCnRTvnd6g&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;E(R)=\frac{E^P[(S_T-K)^+]}{e^{-rT}E^Q[(S_T-K)^+]}=\frac{e^{\mu \tau}[S_tN(d_1^*)-e^{\mu \tau}KN(d_2^*)]}{C_t(r,T,\sigma,S,K)}-1&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{with }d_1^*=\frac{\ln S_t/K+(\mu+\frac{1}{2}\sigma^2)\tau}{\sigma\sqrt{\tau}},\qquad d_2^*=d_1^*-\sqrt{\tau}\sigma$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I implemented the $P$-payoff in MATLAB as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    E(R) = exp((mu-d)*T)*blsprice(S, K, mu, T, sigma,d)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and get correct values (comparing with other studies).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I also tried to calculate out the expectation integral numerically in MATLAB as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;     E(R2) = integral(@(S_T)max(S_T-K,0).*normpdf(log(S_T),mu-d-sigma^2/2,sigma),0,inf)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(with some arbitrary parameters) and I get a different value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Can someone explain whether there is error in my code for E(R2), or is MATLAB integration just not accurate enough?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. try with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; S=1,T=1,K=1,r=0.01,mu=0.1,sigma=0.05,d=0.02&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2016-06-24T14:37:53.013" LastActivityDate="2016-06-25T00:19:07.637" Title="Expected option return in MATLAB" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;matlab&gt;&lt;expected-return&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27773" PostTypeId="1" CreationDate="2016-06-24T15:18:40.153" Score="1" ViewCount="96" Body="&lt;p&gt;We have several positions in a money market &lt;a href=&quot;https://www.fundsquare.net/security/documents?idInstr=230565&quot; rel=&quot;nofollow&quot;&gt;fund&lt;/a&gt; (&lt;a href=&quot;http://rawfocus.blogspot.co.uk/2016/06/eiopa-cic-codes.html&quot; rel=&quot;nofollow&quot;&gt;CIC&lt;/a&gt; IE43) to report in the S.06.02 QRT, and we receive source data for both Quantity &amp;amp; Par Amount.  These are actually identical.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which one should be used, given that - per &lt;a href=&quot;http://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX%3A32015R2450&quot; rel=&quot;nofollow&quot;&gt;definitions&lt;/a&gt; below - we should use one or the other?  Is Par amount 'relevant' in this case?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;C0130 Quantity&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Number of assets, for relevant assets. This item shall not be reported&#xA;  if item Par amount (C0140) is reported.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;C0140 Par amount&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Amount outstanding measured at par amount, for all assets where this&#xA;  item is relevant, and at nominal amount for CIC = 72, 73, 74, 75 and&#xA;  79 if applicable. This item shall not be reported if item Quantity&#xA;  (C0130) is reported.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="5883" LastActivityDate="2016-06-24T15:18:40.153" Title="S0602 - whether to report Quantity (C0130) or Par Amount (C0140) for Money Market Funds?" Tags="&lt;solvency-ii&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27774" PostTypeId="1" CreationDate="2016-06-24T16:06:51.140" Score="1" ViewCount="103" Body="&lt;p&gt;I'm running x13 Arima analysis on a US GDP series to get the &quot;trend&quot; component.  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;2008-12-31  -8.2&#xA;2009-03-31  -5.4&#xA;2009-06-30  -0.5&#xA;2009-09-30  1.3&#xA;2009-12-31  3.9&#xA;2010-03-31  1.7&#xA;2010-06-30  3.9&#xA;2010-09-30  2.7&#xA;2010-12-31  2.5&#xA;2011-03-31  -1.5&#xA;2011-06-30  2.9&#xA;2011-09-30  0.8&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see the data has negative values and when trying to run the model on the data it complains: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;X13Error: WARNING: Automatic transformation selection cannot be done&#xA;  on a&#xA;            series with zero or negative values.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What is the right way to run X13 when you have negative values in your series?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(This question is related to &lt;a href=&quot;https://stackoverflow.com/questions/38000059/statsmodels-x13error-warning-automatic-transformation-selection-cannot-be-do&quot;&gt;https://stackoverflow.com/questions/38000059/statsmodels-x13error-warning-automatic-transformation-selection-cannot-be-do&lt;/a&gt; where I asked about the program settings) &lt;/p&gt;&#xA;" OwnerUserId="22311" LastEditorUserId="-1" LastEditDate="2017-05-23T11:33:46.017" LastActivityDate="2016-06-24T16:06:51.140" Title="x13 Arima analysis with negative values" Tags="&lt;arima&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27775" PostTypeId="1" AcceptedAnswerId="27802" CreationDate="2016-06-24T16:29:59.630" Score="1" ViewCount="622" Body="&lt;p&gt;How often are company's weights being changed on DAX?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where can I find historical data of DAX weights?&lt;/p&gt;&#xA;" OwnerUserId="17424" LastEditorUserId="17424" LastEditDate="2016-06-24T22:42:47.370" LastActivityDate="2016-06-26T15:58:48.780" Title="DAX - company's weights" Tags="&lt;index&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27776" PostTypeId="1" CreationDate="2016-06-24T18:32:56.843" Score="1" ViewCount="89" Body="&lt;pre&gt;&lt;code&gt;I have a set of variables (lets say a nx3 : 3 variables and n rows). I &#xA;set the mean to be my current data (1x3); data for 3 variables as of &#xA;today and set my covariance matrix as the identity matrix. I then&#xA;calculate the  probability density using the mnvpd function in matlab. In                &#xA;essence these probability densities are my &quot;distances&quot; from my current &#xA;data (my mean variable)&#xA;&#xA;My question is if I want to compute a weighted probability density how do&#xA;I do that? if i want to weight one variable 3x the others.&#xA;&#xA;Based on my most recent value(my Mean parameter) the last data point has&#xA;the highest weight(closest distance). My question is how do I assign the&#xA;4th variable to have for example 3x more weight so that its reflected in&#xA;my calculation of densities.&#xA;&#xA;X is my variable matrix, MU = [0.6638 -0.43 -1.56 0.45]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;X =&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;0.7926   -1.1549   -0.9966    0.0520&#xA;0.7399   -0.8464   -1.4008    0.1385&#xA;0.7428   -0.5986   -1.3788    0.1682&#xA;0.3965   -0.4491   -1.2558    0.2441&#xA;0.6638   -0.4265   -1.5430    0.4194&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Y = mvnpdf(X, MU, eye(4))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Y =&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;0.0152&#xA;0.0218&#xA;0.0235&#xA;0.0228&#xA;0.0253&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Y/sum(Y) =&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;0.1401&#xA;0.2004&#xA;0.2165&#xA;0.2101&#xA;0.2329&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13527" LastEditorUserId="13527" LastEditDate="2016-06-24T18:48:08.587" LastActivityDate="2016-06-24T18:48:08.587" Title="weighted probability densities in matlab" Tags="&lt;matlab&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27777" PostTypeId="1" CreationDate="2016-06-24T22:50:55.130" Score="1" ViewCount="1006" Body="&lt;p&gt;I know the construction of &lt;code&gt;Black-Scholes&lt;/code&gt; model and how do we solve it for an &lt;code&gt;Implied Volatility&lt;/code&gt;. But in general, which option price do software use to come up with Implied Vol for Overall Stock? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say $AMZN?(When I look up for a symbol, it says AMZN has IV of 44%). I have an assumption that it doesn't have to do with option prices, rather it just an expected move in terms of 1 Standard Deviation. &lt;/p&gt;&#xA;" OwnerUserId="22314" LastEditorUserId="743" LastEditDate="2016-06-30T15:44:56.487" LastActivityDate="2019-02-09T19:32:03.110" Title="How do they calculate stocks implied volatility?" Tags="&lt;implied-volatility&gt;&lt;implied&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27778" PostTypeId="2" ParentId="27777" CreationDate="2016-06-24T23:25:41.073" Score="1" Body="&lt;p&gt;It comes from options. A common way to do it is from ATM (at the money) put and call and the Black Scholes formula. There are also other ways that use a larger number of options and more complicated maths.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2016-06-24T23:25:41.073" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27779" PostTypeId="2" ParentId="27772" CreationDate="2016-06-24T23:51:08.857" Score="3" Body="&lt;p&gt;Under GBM&#xA;$$ \frac {dS_t}{S_t} = \mu dt + \sigma dW_t $$&#xA;we get&#xA;$$ S_T = S_0 e^{(\mu - \frac{1}{2}\sigma^2)T + \sigma W_T} $$&#xA;suggesting that&#xA;$$ S_T \sim \text{ln}\mathcal {N} ( \tilde {\mu}, \tilde {\sigma}) $$&#xA;where&#xA;\begin{align}&#xA;\tilde {\mu} &amp;amp;= \ln S_0  + (\mu - \frac{1}{2}\sigma^2)T \\&#xA;\tilde {\sigma}  &amp;amp;= \sigma \sqrt {T}&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if $X \sim \text{ln}\mathcal {N} (\mu, \sigma)$, the &lt;a href=&quot;https://en.m.wikipedia.org/wiki/Log-normal_distribution&quot; rel=&quot;nofollow&quot;&gt;pdf of $X $&lt;/a&gt; reads&#xA;$$ p (x) = \frac {1}{x \sigma \sqrt {2\pi}} e^{-\frac {(\ln x - \mu)^2}{2\sigma^2}} $$&#xA;showing that the lognormal pdf relates to the normal pdf as follows&#xA;$$ \text {lognormpdf} (x, \mu, \sigma) = \frac {\text {normpdf}(\ln (x), \mu, \sigma)}{x} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So finally:&#xA;$$ I = \mathbb {E}_0 [(S_T-K)^+] = \int_0^\infty  \max(S_T-K,0) p (S_T) dS_T  $$&#xA;should be calculated as &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mu_tilde = log(S_0) + (mu - 0.5*sigma^2)*T&#xA;sigma_tilde = sigma*sqrt(T)&#xA;I = integral(@(S_T) max(S_T-K,0) .* 1./S_T.*normpdf(log(S_T),mu_tilde,sigma_tilde),0,inf)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So you basically have 3 problems, 2 of which are in the expressions of the drift/diffusion coefficients (but these will remain hidden when picking $S_0=T=1$) and the main one being the missing factor $1/S_T $ to get the lognormal pdf.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-06-25T00:19:07.637" LastActivityDate="2016-06-25T00:19:07.637" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27780" PostTypeId="1" CreationDate="2016-06-25T00:10:09.643" Score="1" ViewCount="109" Body="&lt;p&gt;I know weekly expiration cycle's Implied Vol. explodes prior to earnings, that is due to Theta and Expected move. But why does it happen on stocks that don't have  earnings? ( let's say earnings will be in 60 days)&lt;/p&gt;&#xA;" OwnerUserId="22314" LastActivityDate="2017-08-02T12:58:13.110" Title="Why closest weekly options have enormous Implied Vol." Tags="&lt;earnings&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27782" PostTypeId="2" ParentId="948" CreationDate="2016-06-25T12:09:01.210" Score="1" Body="&lt;p&gt;Apache Cassandra would be a good fit for storing real-time intraday data. It's a partitioned row store, where rows are organized into table using a partition key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It you use a schema where you store data for one ticker per row with partitioning by day or month (it has a limit of 2B records in a row), the operations in your questions would be very performant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, fetching all or subset of price data for specific ticket would only need sequential scan. And the query would look similar to one in accepted answer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;select price, time from data where symbol = &quot;AAPL&quot; and month = &quot;2012-04&quot; and&#xA;time &amp;gt; &quot;2012-04-10T16:02&quot; and time &amp;lt; &quot;2012-04-10T17:00&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Cassandra is optimized for writes, so it's unlikely that you will have any problems with write performance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, with the right schema, both read and write performance scales linearly with the number of servers.&lt;/p&gt;&#xA;" OwnerUserId="22322" LastActivityDate="2016-06-25T12:09:01.210" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27783" PostTypeId="2" ParentId="23210" CreationDate="2016-06-25T12:25:02.437" Score="1" Body="&lt;p&gt;Apache Cassandra would be a good fit. It's a partitioned row store, where rows are organized into table using a partition key.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is common use case to store time series data, you could simply use ticker and a period as partition key. Cassandra is optimized for writes and it's easily scaled, but you need at least 3 servers for it to run.&lt;/p&gt;&#xA;" OwnerUserId="22322" LastActivityDate="2016-06-25T12:25:02.437" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27784" PostTypeId="1" CreationDate="2016-06-25T14:48:02.287" Score="0" ViewCount="91" Body="&lt;p&gt;I read that equallying voliatility with risk is one of the hardest critics on Quantitative Finance and that this is -indeed- the fundamental base of Quant. This question is analogous considering that volatility is &lt;em&gt;not equal&lt;/em&gt; to risk, but you can establish a univocal relation between them. &lt;/p&gt;&#xA;" OwnerUserId="22324" LastActivityDate="2016-06-25T17:23:56.980" Title="How is possible to relate volatility with risk?" Tags="&lt;volatility&gt;&lt;risk&gt;&lt;risk-management&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27785" PostTypeId="2" ParentId="27784" CreationDate="2016-06-25T17:23:56.980" Score="2" Body="&lt;p&gt;Volatility (often defined in terms of standard deviation of returns, or in terms of implied volatility from option markets) is indeed one measure of risk, but like any single measure of risk, it is incomplete.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Part of the reason for this is that in financial markets, the returns are not normally distributed but rather have &quot;fat tails.&quot;  This means that extreme events happen much more frequently than one might expect if one knew only the standard deviation of the returns (volatility) and if one was assuming a normal distribution for the returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;During the recent financial crisis, some (non-quant) bankers claimed to be seeing events that were many times larger than a standard deviation, with the implication that they were seeing unbelievably improbable events (for example once per ten thousand year events) based on the probability of observing such an event if returns were normally distributed. This has led people to criticize volatility as a measure of risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another commonly used measure of risk is VaR (Value at Risk), which can be calculated using standard deviation, but which then needs to be very carefully interpreted so as not to assume normally distributed returns.  VaR is usually calculated in more sophisticated ways which include much more information than just the standard deviation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The risk measure one uses needs to be tailored to the situation at hand: for a given institution, there needs to be an agreed &quot;risk tolerance&quot; which at Board level may be stated in high level terms. Then the Chief Risk Officer and team need to interpret that risk tolerance and create risk measures and limits which target the high level concerns - they also need to set up monitors and ensure that the business activity lines up with these risk measures,and does not break any risk limits, unless agreed with management.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So volatility by itself is not typically sufficient as a risk measure for most purposes.&lt;/p&gt;&#xA;" OwnerUserId="22326" LastActivityDate="2016-06-25T17:23:56.980" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27786" PostTypeId="2" ParentId="27780" CreationDate="2016-06-25T17:59:53.397" Score="1" Body="&lt;p&gt;One reason short term IVs pop could be a sector-related factor, such as an important number coming out that affects for example financial stocks. Short term options have really high gamma, so can make for a good short term leveraged play.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another factor might be that deep out of the money options often get a bid of nearly zero, but people don't like offering teeny options for nothing, so they might just use a minimum price level for the offered price like 0.01, even if this is far higher than a rational value would be, based on a &quot;sensible&quot; implied vol.  The implied vol calculator probably is then taking a mid-market value, and as short term options have very low vega, you need a very high implied vol to get to that mid-market price.&lt;/p&gt;&#xA;" OwnerUserId="22326" LastActivityDate="2016-06-25T17:59:53.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27788" PostTypeId="1" CreationDate="2016-06-25T18:12:11.593" Score="1" ViewCount="285" Body="&lt;p&gt;Now, the proof I have read goes like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take assets 1 and 2, entirely identical. By assumption there is a pricing vector, i.e. $\sum_s\pi_sd^1_s=q^1$ and $\sum_s\pi_sd^2_s=q^2$ where $d^i_j$ is the payoff of asset $i$ in state $j$ and $\pi_i$ is the $i$-th element of the pricing vector $\vec{\pi}$. Since $d^1_s=d^2_s$ for all $s$ (identical assets), we must have $q^1=q^2$.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;My question about this proof is that the assumption does not say only one $\vec{\pi}$ exists. It seems possible to me that there can be another price vector and we would have got a different price for the same asset. For example, price vector $(1,2,3)$ and $(2,3,4)$.&lt;/p&gt;&#xA;" OwnerUserId="18661" LastActivityDate="2017-04-22T11:15:58.807" Title="Show if Arrow price vector $\pi$ exists, then the law of one price hold" Tags="&lt;asset-pricing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27789" PostTypeId="2" ParentId="26186" CreationDate="2016-06-25T18:23:13.673" Score="1" Body="&lt;p&gt;You might have a look at the &quot;sn&quot; R package in CRAN:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://cran.r-project.org/web/packages/sn/sn.pdf&quot; rel=&quot;nofollow&quot;&gt;Link to standard R documentation for CRAN package sn&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It has a skewed t distribution implemented as well as an MLE function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, a simple approach (which leads to a slightly ugly looking distribution) would be to model the positive returns and negative returns separately.  In pseudocode:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Separate the positive returns (LOB gains) and negative returns into different vectors&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Using the positive returns, multiply them all by -1 and append them to the original positive return data set, creating a symmetric return series&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Do a standard Student t MLE fit to this data&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) Repeat the above steps for the negative return data, creating a symmetric time series, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You now have a version of &quot;the&quot; skewed t distribution (there are a number of ways of creating a skewed t distribution) which has a discontinuity at the zero return point - this is ugly, but the method is at least simple and straightforward. As you can imagine, simulation is also very easy: if your starting uniform random is &amp;lt; 0.5 then you use the &quot;loss&quot; parameters, otherwise you use the &quot;gain&quot; parameters.  It may be that you only really care about the losses - if so then the above process is even simpler.&lt;/p&gt;&#xA;" OwnerUserId="22326" LastEditorUserId="22326" LastEditDate="2016-06-26T09:25:41.540" LastActivityDate="2016-06-26T09:25:41.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27790" PostTypeId="2" ParentId="23210" CreationDate="2016-06-25T21:08:37.007" Score="2" Body="&lt;p&gt;There are many different databases out there, all specialized for different use cases. The main parts you should consider are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Using a time series database, since they can handle timestamped data (e.g. ticks) more efficient than any SQL solution can by using bucketing and other methods.&lt;/li&gt;&#xA;&lt;li&gt;Using a database with a good query language, for example to aggregate multiple values, calculating highs and lows etc.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Therefore, the best solution in my opinion currently out there would be &lt;a href=&quot;https://influxdata.com/&quot; rel=&quot;nofollow&quot;&gt;InfluxDB&lt;/a&gt;. Not only because the easy API for inserting and &lt;a href=&quot;https://docs.influxdata.com/influxdb/v0.13/query_language/data_exploration/&quot; rel=&quot;nofollow&quot;&gt;querying data&lt;/a&gt;, but also because of the whole stack of InfluxData. &lt;/p&gt;&#xA;" OwnerUserId="22328" LastActivityDate="2016-06-25T21:08:37.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27791" PostTypeId="2" ParentId="4271" CreationDate="2016-06-25T21:15:34.973" Score="5" Body="&lt;p&gt;First, let us formulate the problem mathematically:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A symmetric random walk starts at 0 and moves up or down one unit (with equal probability) every 1 second. The are two absorbing barriers located at H and -L, with &lt;span class=&quot;math-container&quot;&gt;$H,L&amp;gt;0$&lt;/span&gt;. Given infinite time, what is the probability &lt;span class=&quot;math-container&quot;&gt;$p_H$&lt;/span&gt; that H will be hit before -L is hit and what is the probability &lt;span class=&quot;math-container&quot;&gt;$p_L$&lt;/span&gt; that -L will be hit before H?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since we have infinite time, one or the other barrier will be hit eventually.&#xA;In the special case where &lt;span class=&quot;math-container&quot;&gt;$H=L$&lt;/span&gt; it is clear from symmetry that &lt;span class=&quot;math-container&quot;&gt;$p_H=p_L=\frac{1}{2}$&lt;/span&gt;. In the general case, the probabilities are &lt;span class=&quot;math-container&quot;&gt;$p_H=\frac{L}{H+L}$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$p_L=\frac{H}{H+L}$&lt;/span&gt;. [Source: S. E. Alm: Simple Random Walk, 2002]. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a stock it is not the price of the stock which follows a random walk, but its logarithm, which starts at initial value &lt;span class=&quot;math-container&quot;&gt;$\ln S_0$&lt;/span&gt; So in the above formulas we would replace H and L with the logs of the position of the barriers compared to the starting point.  The final result is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$p_H = \frac{\ln (L/S_0)}{\ln (H/S_0)+\ln (L/S_0)}$&lt;/span&gt; and similarly &lt;span class=&quot;math-container&quot;&gt;$p_L= \frac{\ln (H/S_0)}{\ln (H/S_0)+\ln (L/S_0)}$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: on 2019/11/11 I corrected a typo pointed out by @ANdrea&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2019-11-12T02:19:13.023" LastActivityDate="2019-11-12T02:19:13.023" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="27792" PostTypeId="2" ParentId="21610" CreationDate="2016-06-25T22:40:02.413" Score="1" Body="&lt;p&gt;For historical volatility I actually like this article:&#xA;&lt;a href=&quot;http://www.todaysgroep.nl/media/236846/measuring_historic_volatility.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.todaysgroep.nl/media/236846/measuring_historic_volatility.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;it provides several of the better known methods for calculating historical vol, which of course could be done manually.  Just being aware of the upsides and downsides of each method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for implied vol, yes as onlyvix has said it's generally ATM that they use. You could just take the closest atm straddle for each day and calculate it via some sort of root finding method such as the Newton Method. Then keep track of each day vs where the underlying was.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are also several online resources that have this done for you as well.&lt;/p&gt;&#xA;" OwnerUserId="11748" LastActivityDate="2016-06-25T22:40:02.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27793" PostTypeId="1" AcceptedAnswerId="27829" CreationDate="2016-06-26T00:38:57.710" Score="6" ViewCount="5273" Body="&lt;p&gt;I've been doing some digging, and this question has been asked many times in various forms over the years - &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/7943/backtesting-options-strategies-in-r&quot;&gt;Backtesting Options Strategies in R&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/74/are-there-any-good-tools-for-back-testing-options-strategies&quot;&gt;Are there any good tools for backtesting options strategies?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/16538/backtesting-on-historical-option-data&quot;&gt;Backtesting on historical options data&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/1391/papers-about-backtesting-option-trading-strategies&quot;&gt;Papers about backtesting option trading strategies&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In particular I am interested in spread trading. From these I've gathered backtesting these strategies is pretty much relegated to commercial tools, or professionals writing their own. I understand the basic idea of backtesting, and I'd like to make my own. Partially because right now I'm just a hobbyist who doesn't yet have the capital to afford a really nice tool, and partially because I would like to learn exactly how it works from the inside.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One post mentions that an options backtester is not much different than an equity backtester. It's possible that this is true - but I don't understand how. For options backtesting, we'd need historical options data (to get the bid/ask, strike, expiration, delta, imp. vol., etc), and also historical data for the underlying contract in order to generate signals. We would also need to properly expire the options. Perhaps I am over-complicating it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any resources that really dive in depth to how their backtester was made? Some of the papers in the 4th link go into it a little bit in the methodology section, but it seemed to me there wasn't too much to chew on in most of them. Most likely because discussion of the backtester itself is tangential to the actual paper.&lt;/p&gt;&#xA;" OwnerDisplayName="user20664" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2021-03-11T20:14:09.547" Title="Writing an Options Strategy Backtester" Tags="&lt;options&gt;&lt;backtesting&gt;&lt;strategy&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27794" PostTypeId="2" ParentId="27788" CreationDate="2016-06-26T04:57:21.770" Score="1" Body="&lt;p&gt;By pricing vector I assume you refer to the &lt;strong&gt;state price vector&lt;/strong&gt;, whose definition can be found &lt;a href=&quot;https://en.wikipedia.org/wiki/State_prices&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to the above definition, the price of a particular state specifically refers to the the price of a contract paying exactly one unit of numeraire if that state does occur and zero unit otherwise. And &lt;strong&gt;state price vector&lt;/strong&gt; is thus the vector of state prices for all states.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it seems to me that this &lt;strong&gt;state price vector&lt;/strong&gt; is kind of normalized, only one specific &lt;strong&gt;state price vector&lt;/strong&gt; exists for a given measure. Thus if two assets are identical (providing exactly same cash flows under any state), their price should be equal to each other no matter what. I think this is the point of the law of one price.&lt;/p&gt;&#xA;" OwnerUserId="19903" LastActivityDate="2016-06-26T04:57:21.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27795" PostTypeId="1" AcceptedAnswerId="27796" CreationDate="2016-06-26T06:40:07.887" Score="1" ViewCount="4880" Body="&lt;p&gt;If I have a forecasted volatility of the log returns of say, 0.03, this is obviously transformed relative to the log I took of the returns. It strikes me that I should raise &lt;code&gt;e&lt;/code&gt; to the power of the volatility I forecasted to in order to get back something &quot;normal&quot; looking. When I do this I get &lt;code&gt;~1.03&lt;/code&gt;, which seems really, really high. This would tell me I'm doing something wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the right way to transform log return volatility back into non-logged volatility?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerDisplayName="user20664" LastActivityDate="2019-03-20T10:04:22.930" Title="Transforming log return volatility into standard return volatility" Tags="&lt;volatility&gt;&lt;log-returns&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27796" PostTypeId="2" ParentId="27795" CreationDate="2016-06-26T08:28:16.223" Score="0" Body="&lt;p&gt;It isn't strictly speaking possible to convert a log vol to a normal vol, although it may be possible to get a rough idea. I am assuming you only have the vol of log returns but not the actual time series here. If you had the original time series, then you would just calculate the standard deviation of the prices to get the normal vol. I assume this is coming from the interest rate arena where we look at normal vols for interest rate options, but used to use log normal models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have one time series with a vol of log returns of 0.03, there is more than one possible normal vol with the same vol of log returns. For example, if you double all the prices/rates that form the original time series, the vol of log returns is unchanged, but the normal vol will double. There is clearly no unique conversion formula that always works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you know that the the log volatility is much less than 100% (as in your case) and that the time series has more or less stayed around the same level of the time period of interest, then a ballpark approximation would be $$ normal vol \approx P_{average} \times logvol  $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $ P_{average} $ is the average price/rate over the time series of interest. This can be shown by writing down the expression for standard deviation of price, dividing the prices within the sum by the average price, and then multiplying outside the sum by the average price. If the average price is a reasonable approximation to any given price in the time series, then the approximation is ballpark OK.  Where the low volatility is needed is where you say that a &quot;percent return&quot; is about the same as a &quot;log return&quot; - this is valid when returns are much less than 100%.&lt;/p&gt;&#xA;" OwnerUserId="22326" LastActivityDate="2016-06-26T08:28:16.223" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27797" PostTypeId="2" ParentId="22955" CreationDate="2016-06-26T09:08:11.033" Score="1" Body="&lt;p&gt;There are a number of different ways to accomplish your goal. One would involve modelling each financial time series and then connecting these marginal distributions using a copula.  Monte Carlo is then a matter of simulating the marginals and the copula.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In using your Cholesky matrix, you are implicitly using an elliptical distribution (think of Gaussian and Student t). If you want to for example create a Gaussian MC simulation in which the marginal distributions are Gaussian and the copula is Gaussian, then you only need the standard deviations of each time series for the marginal distributions and the standard MC simulation approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &quot;pseudocode&quot; the steps are (I assume zero drift for simplicity)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Generate uniform random numbers on the interval [0,1] (like Rand() in Excel)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Convert each of the uniform randoms to standard Gaussian (0,1) randoms (like NORMSINV)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Multiply the Cholesky matrix times the Gaussian random vector to create a vector of correlated randoms for each simulation &quot;date&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) For each underlying, multiply the new &quot;correlated Gaussian&quot; by the standard deviation corresponding to that underlying/asset&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5) Using your portfolio weights and the newly simulated asset returns, calculate the portfolio return&lt;/p&gt;&#xA;&#xA;&lt;p&gt;6) Calculate your statistics (like the PERCENTILE function in Excel)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above series of steps can be converted to other marginal distributions apart from Gaussian, and one can use more realistic copulas than the Gaussian copula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In modelling your distributions and copula, you are making assumptions which lead to model risk. That is not to say that this is a bad approach, but one just needs to be aware of the fitting errors that arise when performing such an exercise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is another simulation method that you might consider which is very easy, and which could be used as a check on the MC method - a sort of &quot;bootstrapping historical simulation&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Again in pseudocode:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Convert the price series to log return series&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Number the data &quot;dates&quot; from 1 to 2000 (the size of your time series)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) k = 1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) Choose a random integer i equally likely to be from 1 to 2000 inclusive&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5) Apply the returns from &quot;date i&quot; to today's prices (the base price we have today)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;6) Using the portfolio weights calculate the fluctuation in portfolio value and record in a vector with index k&lt;/p&gt;&#xA;&#xA;&lt;p&gt;7) k = k + 1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;8) if K &amp;lt; 10,001 go to step 3) above&lt;/p&gt;&#xA;&#xA;&lt;p&gt;9) Calculate the VaR using the vector of portfolio returns (like PERCENTILE in Excel)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this &quot;historical bootstrap VaR&quot; is extremely different from your Gaussian MC VaR then you probably need to use a more realistic set of marginal distribution assumptions and copula assumptions.  A good first step would be to try the Student t distributions and copula. &lt;/p&gt;&#xA;" OwnerUserId="22326" LastEditorUserId="22326" LastEditDate="2016-06-26T09:14:56.533" LastActivityDate="2016-06-26T09:14:56.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27798" PostTypeId="2" ParentId="25653" CreationDate="2016-06-26T09:58:25.730" Score="3" Body="&lt;p&gt;This is a commonly seen problem, and also relates to situations in which one is dealing with some less-liquid underlyings.  I will describe a method that you could think of as &quot;stochastic backfilling&quot; - it uses the &quot;Correlated Brownian Bridge&quot; technique. There are many references for the standard BB technique on the web.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us assume we have one data series which is daily and one weekly, and that the time series are correlated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can we backfill the &quot;missing&quot; data from the weekly series in a way that is consistent with the overall distribution shape of the weekly data series, and also maintains the correlation with the daily time series?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This backfilling will be adding no new information, and there will be uncertainty around the result, as we will effectively be doing a correlated MC Brownian Bridge simulation to fill in the &quot;missing&quot; data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first step is to model the distribution of the weekly time series. Here there are a lot of choices possible. Let us assume we model the time series using a Student t distribution and do an MLE fit.  We will use this information to generate fictitious returns with the right distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second step is the model of the copula that connects the two distributions. For simplicity let us assume a Gaussian copula, but there may be better choices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We now set up a two factor MC simulation, except that the daily factor will have a known return, and the weekly factor will have randomly generated returns. The simulation will run for the five days for a given week. I will not describe how to write a two factor MC simulation here, and assume it is known.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having generated the &quot;first cut&quot; at the five individual days' returns for the weekly time series, we see than in general they will not &quot;compound up&quot; to the actual observed weekly return.  In this case we adjust the returns by adding a constant drift.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The simple way to think of the drift is to imagine a weekly price that goes from 100 to 110 over a week. Let's say our simulated prices go from 100 to 120 over that week.  To make the time series &quot;reconnect&quot;, we simply subtract a constant daily drift from each generated return that forces the final price to be 110 instead of 120.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, each MC run will produce a different Brownian Bridge between the two weekly returns.  This is normal and represents the uncertainty around having backfilled this information: we have not created any information here.  A number of simulations can be run and the uncertainty noted.  There will already be uncertainty in your regressions, and this will add to it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And of course this method can be extended to not just two underlyings but any number, thereby &quot;backfilling&quot; missing data in a way that is consistent with both the observed probability distribution and with the correlation structure of the data.&lt;/p&gt;&#xA;" OwnerUserId="22326" LastActivityDate="2016-06-26T09:58:25.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27799" PostTypeId="2" ParentId="21610" CreationDate="2016-06-26T10:17:17.310" Score="2" Body="&lt;p&gt;One way to do this would be to try to replicate the VIX calculation, which is calculated as the square root of a 30 day variance swap level.  A variance swap can be replicated (in theory) using standard European calls and puts (you would need to convert American style stock option prices to European style prices using option models).  The weighting scheme is inversely proportional to the square of the strike price, and in theory uses all option prices from zero to infinite strike. Of course we don't have this many option prices, and the actual liquid set of option prices is much smaller than the set that gets closing prices on the exchange, so one needs to make pragmatic choices. There are many papers on how to practically replicate variance swaps. Here is one good paper by JPM:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://sbossu.com/docs/VarSwaps.pdf&quot; rel=&quot;nofollow&quot;&gt;JPM Var Swap Paper&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="22326" LastActivityDate="2016-06-26T10:17:17.310" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27800" PostTypeId="2" ParentId="21903" CreationDate="2016-06-26T10:29:28.433" Score="1" Body="&lt;p&gt;The assumption of 100% delta for an option would give a good upper estimate for the exposure due only to the part of the option exposure that comes from the movements in the underlying price. But for example, imagine you had a portfolio which is long a long dated call and long a long dated put, such that the portfolio is overall delta neutral over a reasonably wide range of underlying price moves. In this case it is clear that the approximation will not be good enough, as the delta is zero: option vega has been ignored. For long dated options this is a larger effect, so would have a differently shaped curve from the one you show above. The vega portion of the exposure would depend on the &quot;historical volatility of implied volatility&quot; for the option in question, and the exposure goes to zero at expiration. &lt;/p&gt;&#xA;" OwnerUserId="22326" LastActivityDate="2016-06-26T10:29:28.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27801" PostTypeId="1" CreationDate="2016-06-26T12:23:12.103" Score="1" ViewCount="1019" Body="&lt;p&gt;I begin learn PRM , Someone help me understand Four Basic Axioms of Maximising Expected Utility most intuitive way .Thank you very much&#xA;&lt;a href=&quot;https://i.stack.imgur.com/6Zpmd.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/6Zpmd.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19988" LastActivityDate="2016-06-26T23:58:44.093" Title="Explain Four Basic Axioms of Maximising Expected Utility" Tags="&lt;expected-return&gt;&lt;utility-theory&gt;&lt;theory&gt;&lt;expected&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27802" PostTypeId="2" ParentId="27775" CreationDate="2016-06-26T15:58:48.780" Score="0" Body="&lt;p&gt;A committee at the exchange reviews the composition of the DAX quarterly. In practice there are relatively few and infrequent changes. Current and past weights are given here dax-indices.com/EN/index.aspx?pageID=4 , but the old data only goes back to 2009. Look for spreadsheet files called &quot;Composition DAX&quot;.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2016-06-26T15:58:48.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27803" PostTypeId="1" CreationDate="2016-06-26T21:27:15.890" Score="3" ViewCount="308" Body="&lt;p&gt;Lets say I have two time series $X_t$ and $Y_{t,q}$. As an examples, lets say $X_t$ is a series that measures year over year changes in the level of output of a good (say number of widgets). So $X_t = \frac{Widgets_t}{Widgets_{t-1}} - 1$. I have another series $Y_{t,q}$ that is quarterly and measures changes in number of workers for the company (and would like to use this series because I think that the changes in workers $w_{t,q}$ would be indicative of the change in number of widgets sold. The quarterly series would hopefully provide a good indicator&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would I actually best compare the two series? &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;I could take the mean of the quarters of a given year for $Y_t$ so then I would get $Y^{mean}_t = \frac{1}{4}\sum \limits_{i=1}^4Y_{t,i}-1=\frac{1}{4} \left( \frac{w_{t,1}}{w_{t-1,4}}+\frac{w_{t,2}}{w_{t,1}}+\frac{w_{t,3}}{w_{t,2}}+\frac{w_{t,4}}{w_{t,3}} \right) - 1 $&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Or alternatively, I could take a geometric mean. &#xA;$Y^{geomean}_t = \left( \prod \limits_{i=1}^4Y_{t,i} \right)^{1/4}=\left( \frac{w_{t,4}}{w_{t-1,4}}\right)^{\frac{1}{4}}  - 1 $&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Both dont seem like the most ideal way since the mean method measures more of an interyear change and the geomean measures last quarter of the year changes.&lt;/p&gt;&#xA;" OwnerUserId="17136" LastActivityDate="2016-09-27T21:02:04.870" Title="Compare two time series with different frequencies" Tags="&lt;time-series&gt;&lt;statistics&gt;&lt;estimation&gt;" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27804" PostTypeId="1" AcceptedAnswerId="27875" CreationDate="2016-06-26T23:18:06.237" Score="4" ViewCount="2093" Body="&lt;p&gt;Underlying assets are three global stock index : Eurostoxx 50, HSI, KOSPI 200&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maturity: 36 months with advanced redemption date in every 6 months if prices of indexes satisfy given conditions at each date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Payoff : 4.5%(annually)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case where prices of each indexes at the maturity date are all less than 60% of the prices at the initial date, you get loss.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to use Monte Carlo Simulation using R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I plan to determine the expected returns and co-variance matrix of three indexes from historical data and generate random numbers which follow multivariate normal distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using those random numbers, I will generate paths of each stock indexes and determine the total payoff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, determining the expected return or variance is hard because, lately, historical returns of some of indexes are not good, not even positive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I determine that? Also, If you give me any idea of improving or implementing this simulation, I'd really appreciate that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you. &lt;/p&gt;&#xA;" OwnerUserId="19656" LastEditorUserId="19887" LastEditDate="2016-06-30T09:19:08.390" LastActivityDate="2016-06-30T15:12:14.243" Title="How to price this basket option?" Tags="&lt;option-pricing&gt;&lt;risk-neutral-measure&gt;&lt;copula&gt;&lt;basket&gt;&lt;moments&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="27805" PostTypeId="1" AcceptedAnswerId="27810" CreationDate="2016-06-26T23:29:57.007" Score="2" ViewCount="3071" Body="&lt;p&gt;in my series of questions related to GARCH and volatility I finally think I've got a decent grasp on it. You guys have been great help clearing up my questions for me. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My next question is just a confirmation of my suspicion. It's well known that in finance, volatility is typically understood to be the standard deviation of returns. However, GARCH analysis helps you forecast the &lt;em&gt;conditional variance&lt;/em&gt; of a process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose I have an ARIMA-GARCH forecast for the log returns of a series. GARCH gives us the equations:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$y_t = x'_t + \epsilon_t$$&#xA;$$\epsilon_t|\psi_t ~ N(0, \sigma_t^2$$&#xA;$$\sigma_t^2 = \omega + \alpha_1\epsilon_{t-1}^2 + ... + \alpha_q\epsilon_{t-q}^2 + \beta_1\sigma_{t-1}^2 + ... + \beta_p\sigma_{t-p}^2$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;These equations define the variance at time $t$, $\sigma^2_t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If my forecast returns a value of $0.05$ for the 1 step ahead forecast then I can simply take the square root of the forecast to get the conditional volatility - correct? So in this case the 1 step ahead forecast of volatility is: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sqrt{0.05} = 0.1732$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This &lt;em&gt;seems&lt;/em&gt; correct to me, but I am having trouble finding people who are doing this and I want to make sure that this is sound.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerDisplayName="user20664" LastActivityDate="2016-06-27T20:17:28.180" Title="GARCH variance vs standard deviation for volatility" Tags="&lt;volatility&gt;&lt;garch&gt;&lt;variance&gt;" AnswerCount="2" CommentCount="9" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27806" PostTypeId="1" AcceptedAnswerId="27808" CreationDate="2016-06-26T23:36:53.763" Score="5" ViewCount="4930" Body="&lt;p&gt;What is the use of OIS Swap Curve vs. Basis Swap Curve?&lt;/p&gt;&#xA;" OwnerUserId="20891" LastActivityDate="2019-02-18T06:04:27.343" Title="What is the difference between OIS Swap vs Basis Swap?" Tags="&lt;swaps&gt;&lt;interest-rate-swap&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27807" PostTypeId="2" ParentId="27801" CreationDate="2016-06-26T23:41:06.490" Score="1" Body="&lt;p&gt;Here's a try/start:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $A,B$, and $C$ be three possible events, and let $U(event)$ be the utility derived from each event.  For example, if event $A$ corresponds to the event of winning the lottery, then $U(A)$ will presumably be a very large value.  By contrast, if event $C$ corresponds to the event of falling off a ladder and breaking an arm, $U(C)$ will likely be a very small value.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Transitivity:  if $U(A)&amp;gt;U(B)$ and $U(B)&amp;gt;U(C)$, then $U(A)&amp;gt;U(C)$&lt;/li&gt;&#xA;&lt;li&gt;Continuity: if $U(A)&amp;gt;U(B)&amp;gt;U(C)$, then $\exists p \in [0,1]$ such that &#xA;$$U(B) = pU(A) + (1-p)U(C)$$&#xA;i.e. the utility function $U(event)$ is a &lt;a href=&quot;https://en.wikipedia.org/wiki/Continuous_function#Definition&quot; rel=&quot;nofollow&quot;&gt;continuous function&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Independence of Choice: (?)&lt;/li&gt;&#xA;&lt;li&gt;Stochastic Dominance: if $U(A) = U(B)$, then if we &lt;em&gt;must&lt;/em&gt; choose between $A$ and $B$, we ought to choose the one that is more likely to occur &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="22246" LastEditorUserId="22246" LastEditDate="2016-06-26T23:58:44.093" LastActivityDate="2016-06-26T23:58:44.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27808" PostTypeId="2" ParentId="27806" CreationDate="2016-06-27T00:35:06.057" Score="11" Body="&lt;p&gt;A Basis swap is a broad category of swaps where you exchange one &lt;em&gt;floating rate&lt;/em&gt; against another &lt;em&gt;floating rate&lt;/em&gt;. Without knowing the specific rates involved it is difficult to say more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An OIS Swap is an &lt;em&gt;Overnight Index Swap&lt;/em&gt;, where you exchange a &lt;em&gt;fixed rate&lt;/em&gt; against an average of the overnight rates for the tenor of the swap. For example, if the ON rate is Federal Funds Rate (FFR), then a 3 month OIS swap rate is essentially the market's guess of where the average overnight FFR will be during the next 3 months. (The overnight rate changes on a daily basis so it is of course a floating rate). The OIS curve plots these OIS rates against the tenor.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="38578" LastEditDate="2019-02-18T06:04:27.343" LastActivityDate="2019-02-18T06:04:27.343" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="27809" PostTypeId="2" ParentId="27803" CreationDate="2016-06-27T07:07:13.750" Score="0" Body="&lt;p&gt;Why don't you construct the annual value of $Y_t$ from the data, so in your example it would be $Y_{t,annual} = \sum_{i = 1}^{4}Y_{i, quart}$. This is of course only relevant if levels are important, and the time series is in absolute values. If it is a percentage, the geo-mean would be the correct (see &lt;a href=&quot;https://en.wikipedia.org/wiki/Geometric_mean#Proportional_growth&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Geometric_mean#Proportional_growth&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="357" LastActivityDate="2016-06-27T07:07:13.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27810" PostTypeId="2" ParentId="27805" CreationDate="2016-06-27T09:04:37.480" Score="4" Body="&lt;p&gt;If your question is: &quot;Given all the information available up to time $t$, if I compute the 1 period ahead forecast $r_{t+1}$, is the conditional volatility over $[t,t+1[$ given by $\sqrt{r_{t+1}}$?&quot;, the answer is &lt;strong&gt;NO&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To compute the 1 period ahead conditional variance, you should use your model equations (see &lt;a href=&quot;https://stats.stackexchange.com/questions/41509/what-is-the-difference-between-garch-and-arma/41514#41514&quot;&gt;this&lt;/a&gt; post which might help you better understand the ARMA-GARCH paradigm).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an illustrative example. Consider an ARMA(1,1)-GARCH(1,1) model for the returns process:&#xA;\begin{align}&#xA;r_t &amp;amp;= a + b r_{t-1} + c \sigma_{t-1} z_{t-1} + \sigma_t z_t \\&#xA;\sigma^2_t &amp;amp;= d + e \sigma^2_{t-1} + f r_{t-1}^2 &#xA;\end{align}&#xA;with $\{z_t\}_1^\infty$ iid $N(0,1)$ variables such that:&#xA;$$\mathbb{E}\left[r_t \vert \mathcal{F}_{t-1}\right] = a + b r_{t-1} + \tilde{c} z_{t-1} $$ &#xA;for the ARMA part (conditional mean model) and&#xA;$$\mathbb{V}\left[r_t \vert \mathcal{F}_{t-1}\right] = d + e\sigma^2_{t-1} + fr^2_{t-1} $$&#xA;for the GARCH part (conditional variance model). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now assume you observe a series of $N$ returns $\mathbf{r} = \{r_1,...,r_N\}$. You calibrate your model (usually by maximum likelihood estimation) on these returns and you get a bunch of model parameters (here $a, b, c, d, e, f$). At this point, all you need to do is use the GARCH equation to compute the latent conditional variances. For this, you'll need an initial value $\sigma_1$ to initialise the recursion, in which case you'll have:&#xA;$$ \sigma^2_2 = d + e \underbrace{\sigma^2_1}_{\text{initialisation}} + f \underbrace{r^2_1}_{\text{$1^{st}$ observed return}} $$&#xA;$$ \sigma^2_3 = d + e \underbrace{\sigma^2_2}_{\text{computed @ step 1}} + f \underbrace{r^2_2}_{\text{$2^{nd}$ observed return}} $$&#xA;$$ \vdots $$&#xA;$$ \sigma^2_{N+1} = d + e \underbrace{\sigma^2_N}_{\text{computed @ step N}} + f \underbrace{r^2_N}_{\text{$N^{th}$ observed return}} $$&#xA;Now that you have the 1 period ahead conditional variance $\sigma^2_{N+1}$ just take the square root to get the conditional volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The real question is how to get $\sigma_1$? This is usually part of the model specification and there are different ways to do it, see &lt;a href=&quot;https://quant.stackexchange.com/questions/26076/does-the-unconditional-variance-implied-by-a-garch-equal-the-sample-variance/26083#26083&quot;&gt;this&lt;/a&gt; post, especially the link in the comments of the accepted answer (REM: the notation used is $h_1 := \sigma^2_1$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can easily extend this approach to highest order GARCH models.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2016-06-27T20:17:28.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27811" PostTypeId="2" ParentId="27803" CreationDate="2016-06-27T09:21:10.597" Score="0" Body="&lt;p&gt;the geometric mean is appropriate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;rule of thumb: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;geometric mean for percentage numbers &lt;/li&gt;&#xA;&lt;li&gt;arithmetic mean for absolute numbers and continuous rates &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerDisplayName="user22332" LastActivityDate="2016-06-27T09:21:10.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27812" PostTypeId="1" CreationDate="2016-06-27T10:30:01.380" Score="3" ViewCount="450" Body="&lt;p&gt;Suppose a put option on a stock $S(t)$ following a Geometric Brownian motion is given, with strike $K$ and maturity $T$. Let us denote its price at time $t$ by $p(t,S(t))$. Now, by no-arbitrage consideration, we can easiy see that the price at time $t$ of this option is always at least the instrinsic value of the option itself, namely, the following inequality holds:&#xA;$$&#xA;p(t,S(t))\geq (K-S(t))^+&#xA;$$&#xA;To see this, suppose for example that the opposite inequality holds, i.e., $p(t,S(t)) &amp;lt; (K-S(t))^+$. If so, then at time $t$ buy the put option, buy the stock and exercise the option. It results a riskless profit of $K-S(t)-p(t,S(t)) &amp;gt;0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, from this simple no-arbitrage argument, we see that the price of the option must always be at least its intrisic value. However, at this point I realized something strange: if this is true, why in the world should I exercise my put option before expiry?? The inequality seems to indicate that it would be an unwise decision to ever exercise the American put option at time $t$, and so, the only right time to exercise an American put option would be at expiry, making the American put like an European put (the same as for the American call case).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And yet, we know that the American put option is not the same as the European one. So in my argument there should be something wrong.... but what, exactly?? &lt;/p&gt;&#xA;" OwnerUserId="11960" LastActivityDate="2019-05-29T08:48:54.687" Title="A paradox about the American Put option price" Tags="&lt;black-scholes&gt;&lt;american-options&gt;&lt;put&gt;" AnswerCount="3" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27813" PostTypeId="2" ParentId="27803" CreationDate="2016-06-27T12:00:16.303" Score="1" Body="&lt;p&gt;You need to think in terms of autocorrelations and volatility to make your choice:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;in your example you have the change in the number of workers $Y_{t,q}$&lt;/li&gt;&#xA;&lt;li&gt;what is the meaning of the average change per quarter compared to the yearly production ?&lt;/li&gt;&#xA;&lt;li&gt;probably you should sum your quarterly changes to have a yearly one : I would recommend $\sum_q Y_{t,q}$.&lt;/li&gt;&#xA;&lt;li&gt;if you believe the agitation in the number of workers has an influence on the production, you can add another time series made of the average of changes $\frac{1}{Q} \sum_q |Y_{t,q}|$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2016-06-27T12:00:16.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27814" PostTypeId="2" ParentId="27812" CreationDate="2016-06-27T13:06:01.970" Score="6" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;So, from this simple no-arbitrage argument, we see that the price of the option must always be at least its intrisic value.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes indeed&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;However, at this point I realized something strange: if this is true, why in the world should I exercise my put option before expiry?? The inequality seems to &lt;strong&gt;indicate that it would be an unwise decision to ever exercise the American put option at time &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt;, and so, the only right time to exercise an American put option would be at expiry&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How does the fact that &lt;span class=&quot;math-container&quot;&gt;$P(t,S_t;K,T-t) \geq (K-S_t)^+$&lt;/span&gt; gets you to that conclusion? This is a completely fallacious reasoning IMHO.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The price of an American option is: &#xA;&lt;span class=&quot;math-container&quot;&gt;$$ P(t,S_t;K,T-t) = \text{sup}_{\tau \in [t,T]} \mathbb{E}_t^\mathbb{Q}\left[ e^{-r(\tau-t)} (K-S_\tau)^+ \right] $$&lt;/span&gt;&#xA;the inequality you observe can be obtained by splitting up the family of stopping times &lt;span class=&quot;math-container&quot;&gt;$\tau$&lt;/span&gt; with values in &lt;span class=&quot;math-container&quot;&gt;$[t,T]$&lt;/span&gt; using the fact that&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ [t,T] = \{t\}\ \cup\  ]t,T]$$&lt;/span&gt;&#xA;We then get,&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align}&#xA; P(t,S_t;K,T-t) &amp;amp;= \text{sup}_{\tau \in [t,T]} \mathbb{E}_t^\mathbb{Q}\left[ e^{-r(\tau-t)} (K-S_\tau)^+ \right]  \\&#xA;&amp;amp;= \max\left( \underbrace{\text{sup}_{\tau=t} \mathbb{E}_t^\mathbb{Q}\left[ e^{-r(\tau-t)} (K-S_\tau)^+ \right]}_{\text{immediate exercise}}, \underbrace{\sup_{\tau \in ]t,T]} \mathbb{E}_t^\mathbb{Q}\left[ e^{-r(\tau-t)} (K-S_\tau)^+ \right]}_{\text{differed exercise}} \right)\\&#xA;&amp;amp;= \max\left( (K-S_t)^+, \sup_{\tau \in ]t,T]} \mathbb{E}_t^\mathbb{Q}\left[ e^{-r(\tau-t)} (K-S_\tau)^+ \right] \right) \\&#xA;&amp;amp;= (K-S_t)^+ + \max\left(0, \sup_{\tau \in ]t,T]} \mathbb{E}_t^\mathbb{Q}\left[ e^{-r(\tau-t)} (K-S_\tau)^+ \right] - (K-S_t)^+ \right) \\&#xA;&amp;amp;\geq (K-S_t)^+ &#xA;\end{align}&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When the holder has to choose whether or not to exercise at time &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt;, he/she should compare the value of his option position &lt;span class=&quot;math-container&quot;&gt;$P(t,S_t;K,T-t)$&lt;/span&gt; with the payoff he/she would get if he/she exercised immediately (intrinsic value) &lt;span class=&quot;math-container&quot;&gt;$(K-S_t)^+$&lt;/span&gt;. &#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \underbrace{(K-S_t)^+}_{\text{immediate exercise}} -  \underbrace{P(t,S_t;K,T-t)}_{\text{option value}} = \max\left( 0, (K-S_t)^+ - \sup_{\tau \in ]t,T]} \mathbb{E}_t^\mathbb{Q}\left[ e^{-r(\tau-t)} (K-S_\tau)^+ \right] \right) $$&lt;/span&gt;&#xA;The holder would then exercise at &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt; if the RHS is positive, that is iff&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ (K-S_t)^+ \geq \sup_{\tau \in ]t,T]} \mathbb{E}_t^\mathbb{Q}\left[ e^{-r(\tau-t)} (K-S_\tau)^+ \right] $$&lt;/span&gt;&#xA;or equivalently if the intrinsic value is greater than the continuation value. You see that it is not possible to make a general claim such as &quot;the only right time to exercise would be at expiry&quot; from the above.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Edit]&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let &lt;span class=&quot;math-container&quot;&gt;$$\frac{dS_t}{S_t} = rdt + \sigma dW_t^\mathbb{Q} $$&lt;/span&gt;&#xA;Elaborating on @MJ73550's remark if &lt;span class=&quot;math-container&quot;&gt;$(S_t)_{t\geq 0}$&lt;/span&gt; is a &lt;strong&gt;martingale&lt;/strong&gt;, that is if &lt;span class=&quot;math-container&quot;&gt;$r = 0$&lt;/span&gt;, one can show that, for any convex function &lt;span class=&quot;math-container&quot;&gt;$\phi$&lt;/span&gt;,&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \mathbb{E}_t\left[ \phi(S_\tau) \right] \leq \mathbb{E}_t\left[ \phi(S_T) \right], \ \ \forall \tau: t \leq \tau \leq T $$&lt;/span&gt;&#xA;to see this, we can appeal to Jensen's inequality along with the optional stopping theorem. Indeed for all stopping time &lt;span class=&quot;math-container&quot;&gt;$\tau \leq T$&lt;/span&gt; we can write:&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align}&#xA;\mathbb{E}_t\left[ \phi(S_T) \right] &amp;amp;= \mathbb{E}_t\left[ \mathbb{E}\left[ \phi(S_T) \vert \mathcal{F}_\tau \right] \right]\ \ \text{(Tower property)}\\&#xA;&amp;amp;\geq \mathbb{E}_t\left[ \phi(\mathbb{E}[S_T \vert \mathcal{F}_\tau]) \right] \ \ \text{(Jensen's inequality)} \\&#xA;&amp;amp;= \mathbb{E}_t\left[ \phi(S_\tau) \right] \ \ \ \ \ \ \ \ \ \ \ \ \  \text{(Optional sampling theorem)}&#xA;\end{align}&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using this result the price of an American option, when &lt;span class=&quot;math-container&quot;&gt;$S_t$&lt;/span&gt; is a martingale becomes:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ V^{AME}(t,S_t;K,T-t) = \sup_{\tau \in [t,T]} \mathbb{E}_t^\mathbb{Q}\left[ \phi(S_\tau) \right] = \mathbb{E}_t^\mathbb{Q}\left[\phi(S_T)\right] = V^{EUR}(t,S_t;K,T-t)$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if we consider the case &lt;span class=&quot;math-container&quot;&gt;$r \leq 0$&lt;/span&gt;, the stock process &lt;span class=&quot;math-container&quot;&gt;$(S_t)_{t \geq 0}$&lt;/span&gt; becomes a &lt;strong&gt;sub-martingale&lt;/strong&gt; since in that case:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \mathbb{E}_t[S_T] = S_t \underbrace{e^{r(T-t)}}_{\leq 1} \leq S_t $$&lt;/span&gt;&#xA;Should we let &lt;span class=&quot;math-container&quot;&gt;$\phi: x \rightarrow e^{-r(\tau-t)}(K-x)^+$&lt;/span&gt; which is still a &lt;em&gt;convex&lt;/em&gt; function of &lt;span class=&quot;math-container&quot;&gt;$x$&lt;/span&gt;, we would see that for put options, where &lt;span class=&quot;math-container&quot;&gt;$\phi$&lt;/span&gt; is a &lt;em&gt;monotonically decreasing&lt;/em&gt; function of &lt;span class=&quot;math-container&quot;&gt;$x$&lt;/span&gt;, applying a similar reasoning as earlier shows that it is never optimal to exercise the American put before maturity &lt;span class=&quot;math-container&quot;&gt;$T$&lt;/span&gt;.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="27374" LastEditDate="2019-05-29T08:48:54.687" LastActivityDate="2019-05-29T08:48:54.687" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="27816" PostTypeId="2" ParentId="27491" CreationDate="2016-06-27T15:01:29.863" Score="2" Body="&lt;p&gt;I have found the mistake. The ugarchfit function sets automatically non negativity constraints for all coefficients- This makes sense since the alpha in our case shouldn't be negative. However, when releasing the constraint to negative values you get the right results. The only explanation I can think of is that in the course of optimisation, temporarily negative coefficients estimates are occurring.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;setbounds(spec2)&amp;lt;-list(vxreg1=c(-1,1)) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="20975" LastActivityDate="2016-06-27T15:01:29.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27817" PostTypeId="1" AcceptedAnswerId="27820" CreationDate="2016-06-27T15:53:47.880" Score="1" ViewCount="172" Body="&lt;p&gt;I am self-studying for an actuarial exam on financial economics. This statement in the following problem/solution seems to imply that the prepaid forward price on a stock is the same as the prepaid forward price on a futures contract for the stock, or $F_{0, T}^P(S) = F_{0, T}^P(\text{Future}(S))$. (Not sure if this is correct notation).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So why does the second statement underlined in red follow from the first statement?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/IGqfI.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/IGqfI.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5641" LastActivityDate="2016-06-27T18:12:10.597" Title="How does this statement about the price of a prepaid forward on a stock follow?" Tags="&lt;futures&gt;&lt;forward&gt;&lt;self-study&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27818" PostTypeId="1" CreationDate="2016-06-27T17:02:47.763" Score="1" ViewCount="221" Body="&lt;p&gt;I have a simple question. I think not a question is, is a request. This month I have been studying how to understand and implement the Kalman filter algorithm for simple models such as the local level. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ Y_t = \mu_t + \epsilon_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mu_t = u_{t-1} + \gamma_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I managed to implement this model (i don't have ability in programming). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I'm studying the part of Extended Kalman Filter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And I'm having trouble implementing the model below using the EKF:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Power Growth Model:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$ Y_t = \mu_t + \epsilon_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mu_t = \mu_{t-1}^{(v_{t-1}+1)} + \gamma_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$v_{t} = \phi v_{t} + \eta_t$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It was then that I thought there would be a scalar model example to estimate using the EKF, with only $\mu_{t}$ and some nonlinear form?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have not found Scalar models as an example of use for EKF.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any alternative for the local level model that i could use the EKF to estimating?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestion?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks, Laorie.&lt;/p&gt;&#xA;" OwnerUserId="15685" LastEditorUserId="16148" LastEditDate="2016-06-27T18:53:11.720" LastActivityDate="2016-06-27T18:53:11.720" Title="Example Scalar Model Extended Kalman Filter" Tags="&lt;time-series&gt;&lt;kalman&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27819" PostTypeId="2" ParentId="16857" CreationDate="2016-06-27T17:55:54.393" Score="1" Body="&lt;p&gt;Does the link below help? It's free and has daily 3 month rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://fred.stlouisfed.org/search?st=Libor+3+month+daily&quot; rel=&quot;nofollow&quot;&gt;https://fred.stlouisfed.org/search?st=Libor+3+month+daily&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="22335" LastEditorUserId="22335" LastEditDate="2016-06-27T18:11:57.740" LastActivityDate="2016-06-27T18:11:57.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27820" PostTypeId="2" ParentId="27817" CreationDate="2016-06-27T18:04:52.593" Score="3" Body="&lt;p&gt;It is a very badly worded question in my humble opinion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are three &quot;prices&quot; to contend with.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) If you want to buy a stock and pay for it now, you pay the current stock price S.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) If you want to buy a stock and not have to pay for it until a future delivery date T, then you enter into a &quot;forward&quot; or (in the United States) a &quot;futures contract&quot; which specifies a price F, with $F=S e^{(r-d)T}$. No money is due when you enter into this contract.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(3) There is also an odd thing called a &quot;prepaid forward&quot; which is not much used except to get around tax and other regulations, in which you pay now the sum P in order to get the the stock later. This is priced at $P=F e^{-(r-d)T}$. Perhaps not surprisingly we have $P=S$ since you have to pay now, just like when buying the stock outright.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So there are only two prices for a stock: one if you want to pay now, and a slightly higher one (due to the time value of money) if you want to pay later.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-06-27T18:12:10.597" LastActivityDate="2016-06-27T18:12:10.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27821" PostTypeId="1" AcceptedAnswerId="27881" CreationDate="2016-06-27T19:02:31.327" Score="0" ViewCount="313" Body="&lt;p&gt;I'm replicating the Fama-French five factor model. I have formed factor portfolios. I'm not sure how to calculate the average monthly percent excess returns for portfolios. In other words, I want to get the Table 1 in their paper. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance &lt;/p&gt;&#xA;" OwnerUserId="22266" LastEditorUserId="11678" LastEditDate="2016-06-27T20:26:20.060" LastActivityDate="2016-06-30T14:35:26.907" Title="How to get the average monthly percent excess returns for portfolios formed?" Tags="&lt;portfolio&gt;&lt;fama-french&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27823" PostTypeId="2" ParentId="27805" CreationDate="2016-06-27T20:06:48.573" Score="1" Body="&lt;p&gt;let' s define a ARMA-GARCH model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$y_{t} = \mu_{t} + \epsilon_{t}$&#xA;where $\mu_{t} $ is the conditional mean process (ARMA(p,q) part, $\mu_{t} = E(y_{t}|\mathcal{F}_{t-1})$)  .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The errors (or mean residuals) re defined by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\epsilon_{t} = \sigma_{t} \eta_{t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\eta_{t}$ is a white noise (0,1) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Var[\epsilon_{t}]= \sigma_{t}^{2}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;next see that :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Var[y_{t} \vert \mathcal{F}_{t-1} ]=  E\left[( y_{t} - E(y_{t} ))^{2}\vert \mathcal{F}_{t-1}  \right]  = E\left[( y_{t} - \mu_{t})^{2}\vert \mathcal{F}_{t-1}  \right]  = E\left[( \epsilon_{t})^{2}\vert \mathcal{F}_{t-1}  \right]  = Var[\epsilon_{t}]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Var[y_{t}]= \sigma_{t}^{2}$.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;see that  $Var[y_{t} \vert \mathcal{F}_{t-1} ] \neq  E\left[( y_{t})^{2}\vert \mathcal{F}_{t-1}  \right]  $&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Ex:&#xA; AR(1)-GARCH(1,1)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$y_{t} =AR_{1}y_{t-1}+ \epsilon_{t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\epsilon_{t} = \sigma_{t} \eta_{t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma_{t}^{2}  =w+ \alpha \sigma_{t-1}^{2} + \beta \epsilon_{t-1}^{2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Var[y_{t} \vert \mathcal{F}_{t-1} ]=  E\left[( y_{t} - E(y_{t} ))^{2}\vert \mathcal{F}_{t-1}  \right]  = E\left[( y_{t} - AR_{1}y_{t-1})^{2}\vert \mathcal{F}_{t-1}  \right]  = E\left[( \epsilon_{t})^{2}\vert \mathcal{F}_{t-1}  \right] =Var[\epsilon_{t}]= \sigma_{t}^{2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;now if you only compute the following as you suggest:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$  Var[y_{t} \vert \mathcal{F}_{t-1} ]=E\left[( y_{t} )^{2}\vert \mathcal{F}_{t-1}  \right] = E\left[( AR_{1}y_{t-1}+ \epsilon_{t} )^{2}\vert \mathcal{F}_{t-1}  \right] =...$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you won't find  $Var[y_{t} \vert \mathcal{F}_{t-1} ]=  \sigma_{t}^{2}$ (unless $AR_{1}$=0)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;To summarize you needs to model explicitly the conditional variance&#xA;  process ( $\sigma_{t}$) to be able to forecast it, there is no way to&#xA;  obtain it only from the cond. mean process, it seems rather logical.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2016-06-27T20:06:48.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27824" PostTypeId="2" ParentId="10558" CreationDate="2016-06-27T20:41:45.840" Score="0" Body="&lt;p&gt;I plotted my own long term stock market price chart, nearly half a century ago, using semi-logarithmic scale and adjusting for inflation. So, I figure that now people are half a century late, in figuring out the obvious. But, at least people are starting to ask questions.&lt;/p&gt;&#xA;" OwnerUserId="22338" LastActivityDate="2016-06-27T20:41:45.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27825" PostTypeId="2" ParentId="10558" CreationDate="2016-06-27T20:55:02.957" Score="0" Body="&lt;p&gt;Here is the logic: Think of your investment as doubling and doubling again, and doubling again, rather than as going up a thousand, and then another thousand, and then another thousand. In other words, everything about investing is proportional, and that is EXACTLY what semi-logarithmic chart is.&lt;/p&gt;&#xA;" OwnerUserId="22338" LastActivityDate="2016-06-27T20:55:02.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27826" PostTypeId="2" ParentId="3461" CreationDate="2016-06-27T21:54:43.977" Score="1" Body="&lt;p&gt;First, that's a common thing in active hours. Since you are dealing with fx, you should ask Hotspot representative what kind of liquidity are you getting. Usually, if you want to aggress on those crossing prices, you won't be able to. Imagine everybody trying to do arb on that. &#xA;So, ask Hotspot what kind of liquidity  they are sending you. &lt;/p&gt;&#xA;" OwnerUserId="13990" LastActivityDate="2016-06-27T21:54:43.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27828" PostTypeId="1" CreationDate="2016-06-28T00:06:26.730" Score="1" ViewCount="137" Body="&lt;p&gt;I am working with Importance sampling for Least Squared monte carlo and have now problems understanding the implementation of the Robbins-Monro algorithm for finding the &lt;em&gt;optimal drift&lt;/em&gt; for finding minimum variance of my estimate. The original problem formulation that is now answered is given &lt;a href=&quot;https://quant.stackexchange.com/questions/27600/importance-sampling-for-pricing-options-with-longstaff-and-schwartz/&quot;&gt;here&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The article I am following for Robbins-Monro algorithm is this &lt;a href=&quot;https://quanto.inria.fr/pdf_html/Arouna_doc/&quot; rel=&quot;nofollow noreferrer&quot;&gt;link&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem i want to solve is to find a optimal drift $\theta^*$ by solving:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$H(\theta^*)=\min_{\theta}H(\theta)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $H(\theta)=\mathbb{E}\left[ G^2(Z)e^{-\theta Z+\frac{1}{2}\theta^2}\right]$, the second moment of the payoff function $G(Z)=\max(K-S(t),0)$.&#xA;Indeed, we have: $\nabla H(\theta)=0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now following the Morris monro algorithm in the link, the general formulation of the stochastic algorithm is given in equation (10) and is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_{n+1}=X_n-\gamma_{n+1}F(X_n,Z_{n+1})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and going further to equation (15) we have the second moment (the gradient of $H(\theta)$) given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$h(\theta)=\nabla H(\theta)=\mathbb{E}\left[(\theta-Z)G^2(Z)e^{-\theta Z+\frac{1}{2}\theta^2}\right]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I wonder, since I don't know the second moment, how should I approximate it numerically in order to evaluate the algorithm? Given in the article, they don't really explain how the second moment is found?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Appreciate for help.&#xA;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="18211" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-09-26T11:12:20.360" Title="Finding optimal drift, importance sampling, least square monte carlo" Tags="&lt;monte-carlo&gt;&lt;american-options&gt;&lt;variance&gt;&lt;payoff&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27829" PostTypeId="2" ParentId="27793" CreationDate="2016-06-28T06:59:31.693" Score="3" Body="&lt;p&gt;Alright this is a good question. I've been there before.&#xA;As you said, backtesting options will be almost the same as stocks, but with more data to play with (Greeks, volatility, theoretical prices, etc) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most important thing here will be your historical data. Your source of data. &#xA;In order to backtest options, usually you need to have the whole historical option chain. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You won't find this on Internet for free (Don't even try it) &#xA;However, there are some companies offering this, and let me tell you is not cheap at all. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally, I ended up writing another software that periodically will scan the whole option market, collecting the data from the chains. &#xA;This is a &quot;huge&quot; database that I hold for my backtesting projects. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I suggest you do the same. First focus on the data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good luck &lt;/p&gt;&#xA;" OwnerUserId="13990" LastActivityDate="2016-06-28T06:59:31.693" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="27830" PostTypeId="2" ParentId="27812" CreationDate="2016-06-28T08:10:25.010" Score="3" Body="&lt;p&gt;I think the chain of logic should be as follows:&lt;br&gt;&#xA;We have put value &gt;= intrinsic.&lt;br&gt;&#xA;Therefore either put value &gt; intrinsic or put value= intrinsic.&lt;br&gt;&#xA;If put value &gt; intrinsic, then it is not optimal to exercise.&lt;br&gt;&#xA;If put value = intrinsic , it may be optimal to exercise..&#xA;Hence there is no contradiction. &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-06-28T08:10:25.010" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27831" PostTypeId="2" ParentId="27828" CreationDate="2016-06-28T08:44:30.127" Score="0" Body="&lt;p&gt;Here is a good paper which can help you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.rocq.inria.fr/mathfi/Premia/free-version/doc/premia-doc/pdf_html/mc_jourdainlelong_doc.pdf&quot; rel=&quot;nofollow&quot;&gt;https://www.rocq.inria.fr/mathfi/Premia/free-version/doc/premia-doc/pdf_html/mc_jourdainlelong_doc.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-06-28T08:44:30.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27832" PostTypeId="1" CreationDate="2016-06-28T09:15:46.980" Score="1" ViewCount="331" Body="&lt;p&gt;I want to study the impact of corporate culture on risk-adjusted stock returns. After quantifying corporate culture I wanted to use panel methodology (I have a sample of 100 S&amp;amp;P500 companies over 10 years) to study the question. As for the risk-adjusted returns I use Jensen's alpha from CAPM and Treynor measure and estimate those using rolling regressions of the previous 36-months returns for each month. After estimating monthly alphas for each stock, I calculate cumulative quarterly alphas ((1+r_m1)(1+r_m2)(1+r_m3)-1) and regress quarterly alphas on one-period lagged corporate culture measures. &#xA;However, I also want to calculate alphas using Fama-French model. Can I do it for single stocks and proceed in the same fashion? I read journal articles and I found no paper where an author would calculate alpha for a single stock... everywhere portfolios are constructed. Can anyone explain to me the reason why constructing portfolios are favourable and assess my model? Does it make sense to calculate alphas for single stocks?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="22200" LastActivityDate="2016-10-28T11:26:41.357" Title="Fame-French alpha for a single stock" Tags="&lt;capm&gt;&lt;fama-french&gt;&lt;abnormal-returns&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27833" PostTypeId="2" ParentId="17204" CreationDate="2016-06-28T09:25:56.773" Score="1" Body="&lt;p&gt;&quot;Monte Carlo convergence&quot; means that you've sampled enough individuals to  represent (and understand) a general population.  If the probability models behind your Monte Carlo simulation are accurate, then your results will match reality as you increase your sampling size.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Monte Carlo convergence becomes difficult when you try to study a low-probability sub-population.  As you sample the general population and only count those outcome that match your low-probability tally, you find convergence to be slow.  Very few individuals arrive to your desire outcome.  So, you sample and sample, but converge never comes.&lt;/p&gt;&#xA;" OwnerUserId="22350" LastActivityDate="2016-06-28T09:25:56.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27835" PostTypeId="1" AcceptedAnswerId="27839" CreationDate="2016-06-28T09:53:29.683" Score="2" ViewCount="1763" Body="&lt;p&gt;I am examining how investor sentiment affects the probability of stock market crises. I am using methodology similar to this paper &lt;a href=&quot;https://ideas.repec.org/p/dij/wpfarg/1110304.html&quot; rel=&quot;nofollow&quot;&gt;https://ideas.repec.org/p/dij/wpfarg/1110304.html&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;VIX (equivalents) data for a Canada, China and Australia is either not available or only available from 2008 (I need data for 2001-2015). However, V-Lab provides predictions for various GARCH models for the stock indexes that I am interested in, for example: &lt;a href=&quot;http://vlab.stern.nyu.edu/analysis/VOL.AS51%3AIND-R.GARCH&quot; rel=&quot;nofollow&quot;&gt;http://vlab.stern.nyu.edu/analysis/VOL.AS51%3AIND-R.GARCH&lt;/a&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I haven't studied GARCH models and have only a basic understanding of their uses. My question is, can historical GARCH predictions be used as a measure of stock price volatility (instead of VIX)? And are they used for academic research in this way? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, what other measures are commonly used to proxy the volatility of a stock Index?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="22099" LastEditorUserId="22099" LastEditDate="2016-06-28T14:04:08.613" LastActivityDate="2016-07-11T06:40:46.607" Title="GARCH models vs VIX" Tags="&lt;volatility&gt;&lt;garch&gt;&lt;vix&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27837" PostTypeId="1" CreationDate="2016-06-28T12:52:36.553" Score="2" ViewCount="1104" Body="&lt;p&gt;So I have created a Swaption object and can get the premium with the NPV() function. However, I would also like to calculate the greeks (eg. delta, vega).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From some searching, I found that vega can be extracted from the additionalResults () function of the instrument class, but it doesn't seem to be defined for the Python version of Quantlib.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, let &lt;code&gt;swaption&lt;/code&gt; be an initialized instance of a Swaption object.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;swaption.NPV()&lt;/code&gt; gives me the value as expected, but  &lt;code&gt;swaption.additionalResults()&lt;/code&gt; and &lt;code&gt;swaption.result(&quot;Vega&quot;)&lt;/code&gt; are not defined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://cogitolearning.co.uk/?p=490&quot; rel=&quot;nofollow&quot;&gt;http://cogitolearning.co.uk/?p=490&lt;/a&gt; This link shows the c++ analogue of these functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise, how could I calculate these values? I'm not sure if BlackCalculator is appropriate for these calculations on a &lt;code&gt;swaption&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="22358" LastEditorUserId="743" LastEditDate="2016-06-30T15:41:18.903" LastActivityDate="2016-07-30T16:28:05.267" Title="Calculating the greeks for Quantlib Python Swaptions" Tags="&lt;python&gt;&lt;quantlib&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27838" PostTypeId="1" AcceptedAnswerId="27891" CreationDate="2016-06-28T13:05:40.543" Score="2" ViewCount="676" Body="&lt;p&gt;For weekends project, I would like to setup a &quot;simulated&quot; stock exchange on my dev server (windows/linux), ie. running my own NYSE server ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;what options do I have, open source wise (can be c# or java or else)&lt;/p&gt;&#xA;" OwnerUserId="22359" LastActivityDate="2020-05-09T10:12:06.103" Title="Stock Exchange Software" Tags="&lt;programming&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27839" PostTypeId="2" ParentId="27835" CreationDate="2016-06-28T13:55:23.827" Score="7" Body="&lt;p&gt;These are 2 completely different ways of estimating volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GARCH models are calibrated on historical time series i.e. information provided under the real-world measure $\mathbb{P}$. Although you can obviously use them for forecasting, the core information which is used to build the model is backward-looking in nature (historical behaviour of the stock).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The VIX method on the other hand relies on live listed option prices i.e. information provided under the risk-neutral measure $\mathbb{Q}$. As such, the core information which is used to derive a volatility estimate is forward-looking in nature (equilibrum price seen by market participants).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Naively mixing both approaches would lead to comparing apples with oranges IMHO. Choosing one over the other really depends on what exactly you are trying to achieve.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-07-11T06:40:46.607" LastActivityDate="2016-07-11T06:40:46.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27840" PostTypeId="1" AcceptedAnswerId="27844" CreationDate="2016-06-28T14:52:54.233" Score="0" ViewCount="116" Body="&lt;p&gt;I am hoping to understand 'Brexit' impact on UK yield curves. Specifically, government liability yield curves (so yields based on UK government bonds - Gilts):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The Background&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On 24th of June - the day markets found out Britain is leaving the EU, rates for the whole term structure dropped. The curve also steepened, with a bigger drop at the short end. It seems that Monetary policy expectations are that the Bank of England might look past inflation (driven by depreciation of the pound / more expensive imports), and tackle economic growth by maintaining low interest rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the markets are expecting the BoE to reduce their already low base rate, that might explain the drop in short term rates. The expectation of a prolonged period of economic uncertainty might explain why we see the drop at longer tenors also.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The Question&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've seen some publications on how the BoE constructs their curves (direction to a bulletin found in one of the attachments &lt;a href=&quot;http://www.bankofengland.co.uk/statistics/pages/yieldcurve/default.aspx&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;). But without getting into the maths too much, wanted to get one thing clear:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are yield curves published by central banks, solely a reflection of market expectations, based on fixed income prices in secondary markets? Or, does the government incorporate some of their own 'view' in published curves? A view perhaps reflecting the central banks ideas on future monetary policy?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I understand it - curves, published by central banks are built from publicly available bond market information and do not include any form of forecast or estimate form the central bank. Is this correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example of curves im talking about &lt;a href=&quot;http://www.bankofengland.co.uk/statistics/pages/yieldcurve/default.aspx&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18448" LastActivityDate="2016-06-28T16:49:32.680" Title="Do yield curves only show market expectations, or is there more to them?" Tags="&lt;fixed-income&gt;&lt;market-data&gt;&lt;bond&gt;&lt;yield-curve&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27841" PostTypeId="1" CreationDate="2016-06-28T15:00:39.103" Score="2" ViewCount="64" Body="&lt;p&gt;Is there a simple (ish) approximation for the expected number of steps a random walk is within a set of bounds over a given time period? - in particular if i presume log normal and constant vol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If i want to do it with something like local/stochastic/both vol, then is there a way to do it without resorting to MC/diffusion?&lt;/p&gt;&#xA;" OwnerUserId="19663" LastEditorUserId="19663" LastEditDate="2016-06-28T15:50:39.107" LastActivityDate="2016-06-28T18:17:03.610" Title="Expected number of days inside a corridor" Tags="&lt;monte-carlo&gt;&lt;random-walk&gt;&lt;random-variables&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27842" PostTypeId="1" AcceptedAnswerId="27845" CreationDate="2016-06-28T15:55:06.397" Score="2" ViewCount="647" Body="&lt;p&gt;In my textbook that I am self-studying from it is given that (assuming the Black-Scholes framework):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$\Delta_{stock} = \partial S / \partial S = 1$&lt;/li&gt;&#xA;&lt;li&gt;All other Greeks for the underlying stock = 0&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I can see why $\Gamma_{stock} = 0$, from taking the partial derivative of $\Delta_{stock}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But why is there not some significance to $\theta_{stock}$ $\rho_{stock}$, $\psi_{stock}$, etc. and why are those necessarily 0?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would seem to me that it could be useful taking the partial derivative of the stock price with respect to the risk free rate, the continuously compounded return on the stock, and the variance of the stock.&lt;/p&gt;&#xA;" OwnerUserId="5641" LastEditorUserId="5641" LastEditDate="2016-06-28T16:02:42.747" LastActivityDate="2016-06-28T17:16:20.113" Title="Why are the greeks for the underlying stock 0 with the exception of delta?" Tags="&lt;greeks&gt;&lt;self-study&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27843" PostTypeId="2" ParentId="27840" CreationDate="2016-06-28T16:15:17.003" Score="1" Body="&lt;p&gt;Yes, yield curves are a pictorial representation of the current secondary market yields of government securities (gilts, in the UK).  These market yields are determined largely by expectations about what the central bank will do to short term rates over time.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-06-28T16:15:17.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27844" PostTypeId="2" ParentId="27840" CreationDate="2016-06-28T16:49:32.680" Score="1" Body="&lt;p&gt;Per @dm63, these yield curves are basically smoothed curves that best fit the prices/yields of bonds traded in the secondary market. However, they reflect much more than market expectations. Refer to &lt;a href=&quot;https://quant.stackexchange.com/questions/12687/deriving-interest-rates/12693#12693&quot;&gt;Deriving Interest Rates&lt;/a&gt; for details.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-06-28T16:49:32.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27845" PostTypeId="2" ParentId="27842" CreationDate="2016-06-28T17:16:20.113" Score="4" Body="&lt;p&gt;In the black scholes model, today's stock price, risk free rate and stock volatility are considered independent variables.  They are inputs to the model.  Hence the cross partial derivatives are zero.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could invent a model where you tried to explain the current stock price in terms of risk free rate and volatility.   Then indeed the partial derivatives would not have to be zero.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-06-28T17:16:20.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27847" PostTypeId="1" AcceptedAnswerId="27848" CreationDate="2016-06-28T17:27:16.367" Score="0" ViewCount="51" Body="&lt;p&gt;UK leaves Europe, credit rating get's downgraded. High uncertainty, higher perceived risk - based on just risk/reward, would expect yields on UK debt to increase.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They did the opposite. UK government yield curve was down at all tenors after Brexit news.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assumption is that UK government bonds are still considered a 'safe haven' asset and so demand would have pushed price up/yield down. In addition, there seem to be expectations that the government will maintain a low interest rate environment to foster economic growth. Drop in yields following Brexit is explained.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I took a look a &lt;a href=&quot;http://www.suomenpankki.fi/en/tilastot/korot/pages/tilastot_arvopaperimarkkinat_velkapaperit_viitelainojen_korot_en.aspx&quot; rel=&quot;nofollow&quot;&gt;Finnish yields&lt;/a&gt;(5 / 10 year) after their debt was downgraded on June 3rd. Same thing, yields down. Whilst their economy is under &lt;a href=&quot;http://www.wsj.com/articles/moodys-downgrades-finland-rating-to-aa1-from-triple-a-1464989009&quot; rel=&quot;nofollow&quot;&gt;strain&lt;/a&gt;, this example seems to contradict logic because the only major event on June 3rd seems to be the downgrade - nothing like Brexit. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you think it is right to assume that monetary policy / demand for safe haven assets generally have a heavier 'weight' than the risk/reward logic (worse credit rating = higher risk = higher reward needed to take that risk = higher yield) I have in my head? Is there something I am missing here?? I was expecting the opposite!!&lt;/p&gt;&#xA;" OwnerUserId="18448" LastActivityDate="2016-06-28T17:47:04.500" Title="Yield Curve Movement: Risk/Reward versus Safe Haven Demand &amp; Monetary Policy Expectations" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;yield-curve&gt;&lt;bond-yields&gt;&lt;credit-ratings&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27848" PostTypeId="2" ParentId="27847" CreationDate="2016-06-28T17:47:04.500" Score="0" Body="&lt;p&gt;You're missing something important.  Sovereign credit ratings are very misleading when the sovereign can print its own money (like the UK).  I would argue that every country is AAA in debt of its home currency, since its central bank can just print money to pay off the debts.   There are examples when a sovereign chooses to default on its own currency, admittedly, but this is a choice.   The rating agencies tend to downgrade sovereign debt in home currencies when countries' economies worsen, but I'm not sure it's appropriate.  The markets tend to ignore those downgrades, as you have observed.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-06-28T17:47:04.500" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27850" PostTypeId="2" ParentId="27841" CreationDate="2016-06-28T18:09:47.817" Score="3" Body="&lt;p&gt;This looks to me like a range accrual. Let $t_1, \ldots, t_n$, where $0 &amp;lt; t_1 &amp;lt; \cdots &amp;lt; t_n$ be business days that are being considered. We compute&#xA;\begin{align*}&#xA;E\left(\sum_{i=1}^n \pmb{1}_{b_1 &amp;lt; S_{t_i} &amp;lt; b_2} \right) &amp;amp;=\sum_{i=1}^n E\left(\pmb{1}_{b_1 &amp;lt; S_{t_i} &amp;lt; b_2} \right)\\&#xA;&amp;amp;=\sum_{i=1}^n \left[E\big(\pmb{1}_{S_{t_i} &amp;gt; b_1}\big) -E\big(\pmb{1}_{S_{t_i} \ge b_2} \big) \right]\\&#xA;&amp;amp;=\sum_{i=1}^n \left[\Phi\big(d_2^i(b_1)\big) - \Phi\big(d_2^i(b_2)\big)\right],&#xA;\end{align*}&#xA;where, for positive constant $K$,&#xA;\begin{align*}&#xA;d_2^i(K) = \frac{\ln\frac{S_0}{K} + \big(r-\frac{1}{2}\sigma^2 \big) t_i}{\sigma \sqrt{t_i}}.&#xA;\end{align*}&#xA;For general stochastic volatility, there is no simple method. Monte Carlo may be needed.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-06-28T18:17:03.610" LastActivityDate="2016-06-28T18:17:03.610" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="27851" PostTypeId="1" CreationDate="2016-06-28T21:39:59.147" Score="0" ViewCount="217" Body="&lt;p&gt;This example is from &lt;em&gt;Interest Rate Models: an Infinite Dimensional Stochastic Analysis Perspective&lt;/em&gt; by  Carmona, René, Tehranchi, M R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am wondering if the calculation is correct?, he says approximately, but I am wondering if you agree with me in that the calculation of the discount is to be calculated like this: ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$100000-100000/(1+r) = 100 000 *[1- 1/(1+0.06/4)]=1477.83$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And that he he pays at the start: $100000/(1+0,06/4)=98522.17$. Or shall the calculations be done as in the example? Here is the example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/JYmrm.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/JYmrm.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11692" LastActivityDate="2016-06-28T23:26:59.250" Title="example regarding zero coupon bonds" Tags="&lt;bond&gt;&lt;zero-coupon&gt;&lt;discounting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27852" PostTypeId="2" ParentId="27851" CreationDate="2016-06-28T23:03:49.387" Score="1" Body="&lt;p&gt;You have to be very careful with terminology here. In particular &quot;yield&quot; is being thrown around carelessly by both of you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The textbook is correct if the (meaningless) phrase &quot;at a 6% yield (rate)&quot; is crossed out and replaced by &quot;at a 6% discount rate&quot;.  And this is how Tbill's are handled when they are issued (the press release by the US Treasury speaks of discount rate &lt;a href=&quot;http://abcnews.go.com/Business/wireStory/rates-us-treasury-bills-fall-weekly-auction-40174524&quot; rel=&quot;nofollow&quot;&gt;http://abcnews.go.com/Business/wireStory/rates-us-treasury-bills-fall-weekly-auction-40174524&lt;/a&gt;) and in the secondary market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The calculation you are doing is correct if you are assuming &quot;a 6% money market yield&quot; and then calculating the price from that. And money market yield (as well as &quot;bond equivalent yield&quot; a related measure) are useful measures that are closer to the everyday meaning of &quot;yield&quot;, i.e. how much money you make per year. The MM yield and BE yield are what is used in analytical work (for example to compare tbills to other securities).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The real world calculations of yields involve hair splitting details (such as 360 vs 365 day basis, leap vs non-leap years,...) that are best left  out of a general textbook and so just consider this an an approximate example without sweating the details.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-06-28T23:26:59.250" LastActivityDate="2016-06-28T23:26:59.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27853" PostTypeId="1" CreationDate="2016-06-29T00:35:36.807" Score="3" ViewCount="237" Body="&lt;p&gt;Assume I have two assets A and B that are positively correlated most of the time. I'm trading a strategy based on this correlation. Is there a way to protect myself in the event that the correlation tears?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After some googling I found there are OTC correlation swaps for the purpose. However, there seems to be no similar exchange-traded products. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not have access to the OTC market and therefore I'm wondering if I can replicate a similar portfolio using vanilla options of A and B, as well as the underlyings, to achieve:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;When correlation is positive &amp;amp; high, I'm paying &quot;premium&quot; for the insurance.&lt;/li&gt;&#xA;&lt;li&gt;When correlation is low or even negative, my insurance pays off.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2794" LastActivityDate="2016-06-29T05:19:25.757" Title="How to replicate a correlation swap using only vanilla options and underlying" Tags="&lt;options&gt;&lt;correlation&gt;&lt;replication&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27854" PostTypeId="2" ParentId="27853" CreationDate="2016-06-29T02:23:53.703" Score="3" Body="&lt;p&gt;That's impossible.  Since neither the vanilla options nor the underlyings have any exposure to the correlation, no portfolio of these instruments can either.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-06-29T02:23:53.703" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27855" PostTypeId="1" CreationDate="2016-06-29T02:25:35.820" Score="0" ViewCount="10786" Body="&lt;p&gt;I am reading up on the &lt;code&gt;Carhart Four-Factor&lt;/code&gt; model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say there a regression of stock returns on alpha, &lt;code&gt;RM-RF&lt;/code&gt;, &lt;code&gt;SMB&lt;/code&gt; (small minus big stocks returns), &lt;code&gt;HML&lt;/code&gt; (high minus low value stock returns) and &lt;code&gt;UMD&lt;/code&gt; (up minus down trend stocks). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say my portfolio consists of mostly high value stocks (Apple, Google), yet my &lt;code&gt;HML&lt;/code&gt; coefficient has a t-value of 5 and is therefore very significant. How would I interpret this and how is this possible? I am trying to do the regression but &lt;code&gt;RMRF&lt;/code&gt;, &lt;code&gt;SMB&lt;/code&gt;, &lt;code&gt;HML&lt;/code&gt; and &lt;code&gt;UMD&lt;/code&gt; all have very highly significant coefficients whereas alpha's coefficient is always the only one very far from significant at ~0.4 t value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have trouble how to interpret the other coefficients meaning and therefore help would be much appreciated. &lt;/p&gt;&#xA;" OwnerUserId="22366" LastEditorUserId="743" LastEditDate="2016-06-30T15:42:40.550" LastActivityDate="2016-12-06T04:23:28.277" Title="How to interpret Carhart Four-Factor Model?" Tags="&lt;capm&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27856" PostTypeId="2" ParentId="27855" CreationDate="2016-06-29T03:15:14.230" Score="0" Body="&lt;p&gt;I have made a portfolio that invests more weight in higher market cap stocks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The t-value on the &lt;code&gt;SMB&lt;/code&gt; coefficient is now very small, which makes sense as my portfolio is now skewed to bigger companies. However, how do I interpret a significant negative &lt;code&gt;HML&lt;/code&gt; and &lt;code&gt;UMD&lt;/code&gt;? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My portfolio has a negative relationship with &lt;code&gt;HML&lt;/code&gt; maybe because then I have many low value stocks? And &lt;code&gt;UMD&lt;/code&gt; largely negative means my portfolio has negative momentum?&lt;/p&gt;&#xA;" OwnerUserId="22367" LastEditorUserId="743" LastEditDate="2016-06-30T15:43:24.460" LastActivityDate="2016-06-30T15:43:24.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27858" PostTypeId="2" ParentId="27853" CreationDate="2016-06-29T05:19:25.757" Score="0" Body="&lt;p&gt;Exchanges list some options on spreads, such as crack spreads, spark spreads, etc, so that could provide with you a two factor correlation exposure. But if you are long only two underlyings, it is unlikely you will find an option on the sum of the two.  If you happen to have an approximately index weighted portfolio of stocks, then of course index options would be useful, but it doesn't sound like you are looking for this.&lt;/p&gt;&#xA;" OwnerUserId="22326" LastActivityDate="2016-06-29T05:19:25.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27859" PostTypeId="2" ParentId="27835" CreationDate="2016-06-29T08:36:11.040" Score="2" Body="&lt;p&gt;If you have options data with long enough history you could always construct a comparable index by computing the implied volatilities and using a similar weighting methodology to VIX or looking at the implied volatility of the 1 month call/put with strike closest to the price at the observation date (i.e. one closest to 100% moneyness).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want an easier solution, you could always use indices for which a volatility index comparable to VIX are available. DAX and Eurostoxx are few that come to mind with data available from 2001 onwards.&lt;/p&gt;&#xA;" OwnerUserId="18607" LastEditorUserId="18607" LastEditDate="2016-06-30T08:22:03.940" LastActivityDate="2016-06-30T08:22:03.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27860" PostTypeId="2" ParentId="27837" CreationDate="2016-06-29T09:49:21.780" Score="2" Body="&lt;p&gt;Neither the &lt;code&gt;additionalResults&lt;/code&gt; nor the &lt;code&gt;result&lt;/code&gt; method are exported to Python via SWIG. This is unlikely to change in the future: &lt;code&gt;result&lt;/code&gt; is a template method, and it can't be exported to Python as such, whereas &lt;code&gt;additionalResults&lt;/code&gt; would require a sensible way to export &lt;code&gt;boost::any&lt;/code&gt; to Python and to convert it to a given data type.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you can recompile the QuantLib Python module, though, you can add to the &lt;code&gt;Swaption&lt;/code&gt; class a &lt;code&gt;vega&lt;/code&gt; method that makes the call you cite in the link. Edit &lt;code&gt;swaption.i&lt;/code&gt; in the &lt;code&gt;QuantLib-SWIG&lt;/code&gt; distribution and add&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Real vega() {&#xA;    return self-&amp;gt;result&amp;lt;Real&amp;gt;(&quot;vega&quot;);&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to the &lt;code&gt;%extend&lt;/code&gt; section of the &lt;code&gt;Swaption&lt;/code&gt; interface (&lt;code&gt;self&lt;/code&gt; is a variable used by SWIG to denote the current object, as in Python). This will add a &lt;code&gt;vega&lt;/code&gt; method to the Python wrapper that executes the call above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(A note: when you get it running, please consider opening a pull request with your change for &lt;a href=&quot;https://github.com/lballabio/QuantLib-SWIG&quot; rel=&quot;nofollow&quot;&gt;the QuantLib-SWIG repository on Github&lt;/a&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2016-06-29T09:49:21.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27861" PostTypeId="2" ParentId="26255" CreationDate="2016-06-29T10:04:35.380" Score="3" Body="&lt;p&gt;You're right. &lt;a href=&quot;http://www.bauer.uh.edu/rsusmel/phd/HansenLunde_Garch.pdf&quot; rel=&quot;nofollow&quot;&gt;Hansen and Lunde&lt;/a&gt; ran 330 specifications, and found    GARCH (1,1) the best fitting volatility model. However, in some cases    other specifications can beat the results of GARCH (1,1).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Checking the ACF/PACF of the squared error term is necessary, although, not&#xA; sufficient condition. Let's assume the following GARCH (m,s) model $$y_t=a_0+a(L)\varepsilon_t^2+b(L)y_t $$ $$\varepsilon_t=v_t\sqrt{a_0+a(L)\varepsilon_t^2+b(L)y_t }$$ where $v_t$ is a white-noise procedure. There're many other things to investigate:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Checking the ACF/PACF of the error term&lt;/strong&gt;. Residuals cannot be autocorrelated. The ARMA model ($y_t=a_0+a(L)\varepsilon_t^2+b(L)y_t&#xA;            $) part of the GARCH model is not correctly specified if the&#xA;        residuals are autocorrelated.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Checking the ACF/PACF of the squared error term&lt;/strong&gt;. You can test whether your procedure is a GARCH procedure or not.&#xA;Equivalently, one can examine &lt;strong&gt;Ljung–Box Q-statistics&lt;/strong&gt;. It can be&#xA;used to test for groups of significant coefficients.  Rejecting the&#xA;null hypothesis that the $\varepsilon_t^2$ sequence is serially&#xA;uncorrelated is equivalent to rejecting the null hypothesis of no&#xA;ARCH or GARCH errors. &lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Normality of the errors&lt;/strong&gt;. When you estimate GARCH models with Maximum Likelihood method the default probability density function&#xA;is usually standard normal in many packages (e.g. in R). You can&#xA;easily perform a Jarque-Bera normality test on your residuals. (Note that: For&#xA;most financial assets, the distribution function for the rate of&#xA;return is fat tailed, like Student's t-distribution.)&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Information criterion&lt;/strong&gt;. You can compare how well the estimated models perform using AIC or SBC. It's a fast strategy.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'd recommend you to check ACFs and normality tests of different specifications. In some cases, there is a trade-off: some models do better at ACFs, some at normality tests. Maybe the residuals of yours are pretty asymmetric. For further improvement you can apply EGARCH, TARCH or ARCH-M.&lt;/p&gt;&#xA;" OwnerUserId="22353" LastActivityDate="2016-06-29T10:04:35.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27864" PostTypeId="2" ParentId="27803" CreationDate="2016-06-29T20:07:48.323" Score="0" Body="&lt;p&gt;An alternative approach would be to use a procedure similar to that described in &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Chow, G. C. and Lin, A.-l. (1971). Best linear unbiased interpolation, distribution, and extrapolation of time series by related series, The Review of Economics and Statistics 53(4): 372 – 75.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This procedure is used to produce, for example, quarterly national accounts aggregates where only annual data are available but some indicator variables are available. A linear relationship with an auto-correlated disturbance is assumed between the unobserved quarterly variable and the indicators. Chow-Lin estimates this relationship using some &quot;tricks&quot;. The estimation procedure can be replace by a maximum likelihood estimator. The Chow-Lin procedure is implemented in various software packages but I would recommend that it be programmed using maximum likelihood when you can adapt the procedure to better meet your needs.    &lt;/p&gt;&#xA;" OwnerUserId="9458" LastActivityDate="2016-06-29T20:07:48.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27865" PostTypeId="2" ParentId="2435" CreationDate="2016-06-29T20:27:00.153" Score="2" Body="&lt;p&gt;&lt;strong&gt;Hint&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\,H_0(x,t)=1$ , $H_1(x,t)=x$ and for every $n\ge 2$ set&#xA;$${{H}_{n}}(x,t)=x {{H}_{n -1}}(x,t)-(n-1)\,t\,{{H}_{n-2}}(x,t)$$&#xA;then ${{H}_{n  }}(W_t  ,t)$ is a Martingale. For exapmple&#xA;$$H_1(W_t,t)=W_t$$&#xA;$$\qquad H_2(W_t,t)=W_t^2-t$$&#xA;$$\qquad\qquad H_3(W_t,t)=W_t^3-3tW_t$$&#xA;$$\vdots $$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-06-29T22:18:19.187" LastActivityDate="2016-06-29T22:18:19.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27866" PostTypeId="2" ParentId="25592" CreationDate="2016-06-29T22:02:08.290" Score="1" Body="&lt;p&gt;I think this paper gives a really good overview about risk parity &lt;a href=&quot;http://www.jasonhsu.org/uploads/1/0/0/7/10075125/risk_parity_portfolio_vs_other_asset_allocation_heuristic_portfolios.pdf&quot; rel=&quot;nofollow&quot;&gt;link&lt;/a&gt;. As it points out, risk parity is a alternative to traditional mean variance portfolio construction.&lt;/p&gt;&#xA;" OwnerUserId="19188" LastActivityDate="2016-06-29T22:02:08.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27868" PostTypeId="1" AcceptedAnswerId="27877" CreationDate="2016-06-29T23:30:14.583" Score="2" ViewCount="1266" Body="&lt;p&gt;This question might be silly, but I want to be sure of myself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If one has Value-at-Risk forecasts and there are zero VaR breaches (i.e. no return value is smaller than or equal to the VaR value) then the risk is said to be overestimated right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in a time series we would get zero observations for which holds $$r_t\leq -VaR_t.$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this particular case, I guess the risk is said to be overestimated. Hope someone can confirm this and if this case is called underestimation I would like to hear the reason for why this case is called underestimation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="19857" LastEditorUserId="7008" LastEditDate="2016-07-28T14:10:19.943" LastActivityDate="2016-07-28T14:10:19.943" Title="Overestimating or underestimating risk?" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;value-at-risk&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27870" PostTypeId="1" CreationDate="2016-06-30T02:11:48.913" Score="0" ViewCount="659" Body="&lt;p&gt;I am currently writing my thesis using the Carhart Four-Factor Model. I got my results but I am not sure how to word them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Coefficient on my SMB is 0.22. Wording: if small companies returns are 1% over that of amall companies in a given month, my portfolio's return is expected to increase with 0.22%. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This feels like a really poor explanation because it's not just small-big but I don't know how to word it properly. The same for the HML and UMD factors. If someone could give insight that would be great.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="22367" LastActivityDate="2016-07-06T15:25:31.807" Title="How to interpret my Four-Factor Model results?" Tags="&lt;capm&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27871" PostTypeId="1" CreationDate="2016-06-30T02:22:26.470" Score="2" ViewCount="147" Body="&lt;p&gt;I was considering making some sort of free index data set that would basically attempt to estimate changes in the value of a currency against all other currencies. So I came to thinking if I took daily volume, and daily changes, summed dollar volume for all currencies except the one for the given index, then divided a given currency's estimated volume in dollars lets say for example is CHF, this gives us percent of daily volume, then we would multiply by the percent of daily volume by the change of the currency for the index, for example lets say we are calculating the USD index, we then multiply the price change for USDCHF by the percent of daily volume. Then continue for every currency against the dollar in order to calculate how much the index should move. Is this a thing or should I make it one?&lt;/p&gt;&#xA;" OwnerUserId="18578" LastActivityDate="2016-07-20T21:09:55.877" Title="Is this type of currency index a thing already?" Tags="&lt;fx&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27872" PostTypeId="2" ParentId="27871" CreationDate="2016-06-30T02:51:46.143" Score="3" Body="&lt;p&gt;It is not a thing.  The basic problem is that volume of currency traded is unknown.  FX traded almost exclusively over the counter without centralised clearing or reporting.  There are no daily volume statistics.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The thing that is most commonly done for FX indexes is trade weighting.  Changes in a currency's value are measured against the value of a basket of other currencies, where each currency in the basket is weighted according to its share of the import/export trade.  Probably the weighting would be adjusted annually, or in line with how often the government accounting office publishes import/export statistics.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2016-06-30T02:51:46.143" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27873" PostTypeId="1" CreationDate="2016-06-30T05:13:33.497" Score="0" ViewCount="221" Body="&lt;p&gt;We're using extreme value theory to model tail risks on our portfolio. After we choose the threshold, we fit generalized Pareto distribution to our data over the threshold. The expected value of GPD is quite larger (10%) than the average value of our losses over the threshold. My question is, is this to be expected? Or does that mean that the GPD is a bad fit to the data and that we've chosen the wrong threshold? Also, is there a good way to check whether the GPD is a good fit?&lt;/p&gt;&#xA;" OwnerUserId="22379" LastActivityDate="2016-09-28T12:32:21.350" Title="Extreme value theory expected value of GPD" Tags="&lt;statistics&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27874" PostTypeId="2" ParentId="27832" CreationDate="2016-06-30T08:53:17.420" Score="1" Body="&lt;p&gt;The reason for using Fama French for portfolios is generally that you try to quantify whether your anomaly/strategy etc. is actually capable of providing returns in excess of what could be achieved by passive exposure to the known risk factors included in the model. CAPM essentially does the same but only looks at the passive exposure to market index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know if there is necessarily any methodological problems with using Fama French model to estimate the alpha for a single stock, but I think it makes a lot of sense to consider if it is the right tool in your case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would carefully consider what you want to measure - I would imagine, that certain measures of corporate culture would be significantly correlated with some of the Fama French factors. Without knowledge of the list of variables you plan on investigating, I would still assume that smaller companies probably have very different cultural characteristics than larger companies, and same most likely applies to value factor (think e.g. Facebook vs. Morgan Stanley). Hence it might not make a lot of sense to capture this variation using FF model - you could, however, run the same analysis with subsamples using similar criteria as is used in construction Fama French factors if that interests you.&lt;/p&gt;&#xA;" OwnerUserId="18607" LastActivityDate="2016-06-30T08:53:17.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27875" PostTypeId="2" ParentId="27804" CreationDate="2016-06-30T08:56:02.213" Score="8" Body="&lt;p&gt;No offense but it will be much more complicated than what you think... I'm not even sure that you are familiar with risk-neutral pricing in the first place? I'll try to give you some clues.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This security is called a &lt;strong&gt;basket&lt;/strong&gt; option. On top of the multi-asset feature, there are non-trivial mechanisms embedded in the contract you mention:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;an &lt;strong&gt;auto-callable&lt;/strong&gt; feature, meaning early redemption can happen if certain conditions are met at discrete observation dates specified as part of the contract.&lt;/li&gt;&#xA;&lt;li&gt;a &lt;strong&gt;compo/quanto&lt;/strong&gt; feature. Because individual indices are not denominated in the same currency, either you define the basket $t$-value by converting each individual index's $t$-value in a fixed reference currency (compo) or you simply view these indices values as plain 'numbers' and express their weighted sum in a fixed reference currency regardless of the original denominations (quanto).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Let's forget about the auto-callable and quanto/compo features (as they would require a post of their own to be correctly addressed) and focus only on the basket part for the moment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Omitting these features makes the payoff purely European i.e. it only depends on the terminal value of the basket ($T$-value). Let's denote it by $\phi(B_T)$, where in your case $\phi$ looks like the payoff of a put (or possibly a down-and-in put it's not clear from your explanation). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's also assume deterministic and constant rates in what follows, along with proportional dividends for the sake of clarity. The model categories I list below only reflect my own views, there is no such distinction in practice.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Pricing 101&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Under the risk-neutral measure $\mathbb{Q}$ the price of an option is given by:&#xA;$$ V_0 = e^{-r T} \mathbb{E}_0^\mathbb{Q} \left[ \phi(B_T) \right] $$&#xA;with here &#xA;$$B_t = \frac{1}{N} \sum_{i=1}^N S_t^{(i)} $$&#xA;the $t$-value of the basket, $r$ the risk-free rate (rate at which money can be deposited on the money market, here you can take the EONIA discount curve for instance).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mathematically, the risk-neutral measure $\mathbb{Q}$ is defined in such way that:&#xA;$$ F(0,T) = \mathbb{E}_0^\mathbb{Q}[ S_T ] $$&#xA;where $F(0,T)$ is the forward price at $T$ of the equity $S$ as seen of $t=0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a lot of theory hidden behind the last few equations, I would recommend you to investigate that using a good reference book e.g. &lt;a href=&quot;http://efinance.org.cn/cn/FEshuo/stochastic.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Shreve&lt;/a&gt;. Maybe &lt;a href=&quot;https://quant.stackexchange.com/questions/8274/how-to-estimate-real-world-probabilities/26228#26228&quot;&gt;this&lt;/a&gt; post is a good start also. Anyway, the consequence is that your model should eventually read something like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{dS_t^{(i)}}{S_t^{(i)}} = \frac{\partial \ln F^{(i)}(0,t)}{\partial t} dt + \sigma^{(i)}(...) dW_t^{(i),\mathbb{Q}} $$&#xA;with a certain dependence structure between the Brownian motions driving the individual indices' prices.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Basket Pricing 101&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;From the above you see that:&#xA;$$ V_0 = e^{-rT} \int_0^\infty \phi(B_T) p(B_T) dB_T $$&#xA;in other words, if you know the probability distribution of $B_T$ you are done, since you can either: (1) perform a numerical quadrature and get the option price (2) sample from the terminal distribution and compute the expectation using Monte Carlo simulations. (1) is when $p(B_T)$ is known in closed-form, (2) is more general.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is straightforward to show that the first 2 moments of $B_T$ under $\mathbb{Q}$ are:&#xA;$$ B(0,T) = \mathbb{E}_0^\mathbb{Q}[B_T] = \frac{1}{N} \sum_{i=1}^N F^{(i)}(0,T) $$&#xA;(i.e. sum of the expectations)&#xA;$$ \sigma^2_B = \frac{1}{N^2} \left( \sum_{i=1}^N \sigma^{2,(i)} + 2 \sum_{j=1}^i \rho_{ij} \sigma^{(i)} \sigma^{(j)} \right) $$&#xA;(i.e. sum of the covariances)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Model Type 1]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume $B_T$ is &lt;strong&gt;log-normal&lt;/strong&gt; with first moments given by the above. This is a mere &lt;strong&gt;approximation&lt;/strong&gt; since we know that the sum of $N$ log-normal variables is not a log-normal. But it allows you to compute the price of a basket using the BS formula:&#xA;$$ V_0 = e^{-rT} ( B(0,T) N(d_+) - K N(d_-) ) $$&#xA;$$ d_\pm = \frac{\ln\left(\frac{B(0,T)}{K}\right) \pm \frac{1}{2}\sigma^2_B T}{\sigma_B \sqrt{T}} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Model Type 2]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use a shifted log-normal to approximate $\phi(B_T)$, or any other known distribution for that matter. The idea is that you already know the first 2 theoretical moments of $B_T$ and you can easily write the third and even the fourth moments using standard calculus. You then fit the known distribution to the unknown distribution of $B_T$ by matching their moments. This is known as &lt;strong&gt;moment-matching&lt;/strong&gt;. In the case of a shifted-lognormal, this leads to a closed-form formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Model Type 3]&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You consider the true &lt;strong&gt;marginals&lt;/strong&gt; of each individual asset $S_t^{(i)}$ i.e.&#xA;$$ p^{(i)}(x) = \frac{d F^{(i)}(x)}{d x} = \frac{d \mathbb{Q}\left(S_T^{(i)} \leq x\right)}{ dx} $$&#xA;where $F^{(i)}$ is the $i^{th}$ asset cumulative distribution function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can infer the above risk-neutral probabilities from listed option prices using the &lt;strong&gt;Breeden-Litzenberger idendtity&lt;/strong&gt;, see &lt;a href=&quot;https://quant.stackexchange.com/questions/24918/obtaining-risk-neutral-probability-from-option-prices/24922#24922&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now that you have identified the marginal distributions of each asset $S_t^{(i)}$, you need to define their dependence structure so that you can eventually obtain their joint distribution from which you will be able to infer the distribution of $B_t$ since:&#xA;$$ p(B_t \in A) = \int_{\frac{1}{N} \sum_{i=1}^N x_i \in A} p\left(x_1,...,x_N\right) dx_1 ... dx_N $$&#xA;You can use &lt;a href=&quot;https://en.wikipedia.org/wiki/Copula_(probability_theory)&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;copulas&lt;/strong&gt;&lt;/a&gt;, to form the joint distribution $F^B(x)$ from the knowledge of the marginals $F^{(i)}(x)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Basket model $\infty$]&lt;/strong&gt;&#xA;There are of course many variations of the above methods&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Depending on the choice of copulas used in model 3 above for instance. Gaussian is the usual go-to choice, but you could pick any other dependence structure. One which accounts for the fact that correlations explode when the market crashes seems like a better option. See the problem of correlation skew.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You could use local volatility + instantaneous correlations as a replacement for coupling individual marginals with a Gaussian copula. Choosing different copulas then amounts to defining different local correlation structures. This is still an open research subject, see the work of &lt;a href=&quot;http://Introduction%20into%20%E2%80%9CLocal%20Correlation%E2%80%9D%20Modelling%20arXiv%20...%20-%20arXiv.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;Langnau&lt;/a&gt;, &lt;a href=&quot;http://ssrn.com/abstract=2283419&quot; rel=&quot;nofollow noreferrer&quot;&gt;Guyon&lt;/a&gt; etc. in this area.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;Be careful with decorrelation issues and the famous instantaneous vs. terminal correlation debate&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Additional details]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;To price in the auto-callable feature it may be interesting to set up a hybrid equity-rates model (i.e. work with stochastic interest rates).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;For the same reason, it might also be useful to consider discrete cash dividends instead of discrete proportional dividends.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;To price in the compo feature you'll need to know the FX forwards. To price in the quanto feature you'll need to know the FX volatilities (see quanto drift adjustment) and sometimes more depending on whether you regard the equity volatility as a stochastic process or not.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Your implementation]&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may wonder as to what model your implementation corresponds. Assuming you used the appropriate equity forward curves to build the risk-neutral drifts of the individual indices + used an implied volatility number (i.e. &lt;strong&gt;not quantities estimated under the real-world measure $\mathbb{P}$&lt;/strong&gt; such as expected returns and historical volatility, but rather quantities inferred from listed option prices provided under $\mathbb{Q}$), what you did corresponds to postulating log-normal marginals combined through a Gaussian copula. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is in-between model 1 (which is worse than yours because it assumes $B_t$ is log-normally distributed but exhibits correct first 2 moments) and model 3 (which is better than yours because it uses the true implied maringals and not a log-normal assumption for the marginals).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good luck&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-06-30T15:12:14.243" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27877" PostTypeId="2" ParentId="27868" CreationDate="2016-06-30T09:35:59.330" Score="5" Body="&lt;p&gt;Yes, it is correct.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Underestimation: you under-estimate the risk, so you have more VaR violations than what your model predicts. Ex: With 100 observations, and a 99% VaR, you expect 1 violation but you observe 5 violations. &lt;/li&gt;&#xA;&lt;li&gt;Overestimation: you over-estimate the risk, i.e the risk is less important that you expect. You observe less VaR violations that you expect accordingly your VaR forecast. Ex: With 100 observations, and a 99% VaR, you expect 1 violation but you observe 0 violation. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Please note that here we only focus on the so called “unconditional coverage hypothesis” (the frequency of VaR violations). You should also check that the VaR violations are independently distributed (the independence hypothesis) .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See Christoffersen, P. (1998). Evaluating interval forecasts. International Economic Review, 39(4), 841–862. Retrieved from &lt;a href=&quot;http://www.jstor.org/stable/2527341&quot;&gt;http://www.jstor.org/stable/2527341&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;see also &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2044825&quot;&gt;here&lt;/a&gt; on ssrn   &lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2016-06-30T09:43:42.593" LastActivityDate="2016-06-30T09:43:42.593" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27878" PostTypeId="1" CreationDate="2016-06-30T10:32:44.483" Score="0" ViewCount="235" Body="&lt;p&gt;I need a variable which identifies the possible conflict of interests between credit rating agencies and countries, although they do not pay in order to be rated.&#xA;Such a variable could be the proportion of income coming from each country, namely how many national private companies or banks or other financial institutions pay the CRAs for their services.&#xA;Do you think I can find such data on the agencies' balancesheet, maybe they divide the revenues for market segment?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or other Ideas are welcomed! :)&lt;/p&gt;&#xA;" OwnerUserId="20918" LastEditorUserId="848" LastEditDate="2016-09-28T15:57:07.253" LastActivityDate="2021-04-06T14:01:35.577" Title="Moody's, S&amp;P, Fitch revenues per country" Tags="&lt;credit-ratings&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27879" PostTypeId="2" ParentId="27870" CreationDate="2016-06-30T11:47:21.363" Score="1" Body="&lt;p&gt;Intuitive way to look at it, in my opinion, is that returns similar to the ones generated by your strategy could be achieved by a passive exposure to the four factor model portfolios, and the value added by your strategy (alpha). It should be of interest to you whether your alpha is significantly positive, which of the factors have statistically significant coefficients, and why. This is what I suppose you aim to achieve by using FF4 as the basis of estimating your risk adjusted returns?&lt;/p&gt;&#xA;" OwnerUserId="18607" LastActivityDate="2016-06-30T11:47:21.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27880" PostTypeId="2" ParentId="27878" CreationDate="2016-06-30T14:21:32.753" Score="0" Body="&lt;p&gt;Since only Moody's is quoted please find below what I could find on BBG for Moody's:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/KmGyD.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/KmGyD.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it is on Bloomberg, then you can find it in its balance-sheet. Have fun :)&lt;/p&gt;&#xA;" OwnerUserId="17291" LastActivityDate="2016-06-30T14:21:32.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27881" PostTypeId="2" ParentId="27821" CreationDate="2016-06-30T14:35:26.907" Score="0" Body="&lt;p&gt;If you have a Bloomberg terminal, you have several options including writing a few Excel functions to dump the data you need to produce these calculations (see =BDH() ).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on what I can glean from the question, you do not have that option.  I'd try Yahoo finance for historical asset price data -- should be able to pull down the TBill rate AND the stock returns of your portfolio.  Once you have that historical pricing data, you'll have to compute the returns by comparing the increase in asset price of your portfolio with the increase in the TBill index (or the current annual yield of the TBill adjusted for the holding period or something).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have any updates or clarifications to the question that may redirect our answers, feel free to call that out.&lt;/p&gt;&#xA;" OwnerUserId="22387" LastActivityDate="2016-06-30T14:35:26.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27883" PostTypeId="2" ParentId="27838" CreationDate="2016-06-30T16:41:04.887" Score="0" Body="&lt;p&gt;You will be looking at an awful lot of work!  You won't have enough weekends to finish it.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suggest you open an Interactive Brokers account and use their Trade Workstation (TWS) platform in simulation mode (AKA paper trading).  It uses the real market and allows you to trade it with $4M of fake money.  I have used it for years to test and validate trading algorithms.  If a strategy works out in paper trading mode you can feel confident it will work well on the real market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more information see &lt;a href=&quot;https://www.interactivebrokers.com/en/software/am/am/manageaccount/papertradingaccount.htm&quot; rel=&quot;nofollow&quot;&gt;https://www.interactivebrokers.com/en/software/am/am/manageaccount/papertradingaccount.htm&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19786" LastActivityDate="2016-06-30T16:41:04.887" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27886" PostTypeId="2" ParentId="27777" CreationDate="2016-06-30T18:57:43.830" Score="2" Body="&lt;p&gt;It might be worth noting that in the standard Black-Scholes model the implied volatility $\sigma$ is assumed to be a positive non-zero constant. If this were the case then we could simply look at the stock $S$, look at the historical data, and then compute the log-returns on some arbitrary time scale, and then compute the standard deviation, and we would have the volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, the assumption of using a constant volatility is not great, and we find that volatility tends to change over time, (as well as be different on different timescales!). (Furthermore it is not normally distributed, but we can ignore that caveat for now). This leads to &lt;strong&gt;stochastic volatility&lt;/strong&gt; models (e.g. the Heston Model).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another complication is that the market data is to an extent inconsistent. What I mean by this is that in an ideal world if we took the value of any call option and computed the value of the implied volatility that corresponds to the market price, then we would get the same value regardless of the strike or maturity of the call option. However, in reality we observe that the volatility varies with the strike and maturity, and we instead have a volatility surface. We can then use an extension of the Black-Scholes model and have $\sigma \to \sigma(S,t)$, which is a &lt;strong&gt;local volatility&lt;/strong&gt; model. How we compute volatilities from these surfaces is fairly involved, but a example of how to &quot;calibrate&quot; from market data is the Dupire Equation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In reality what is normally done is to take some weighted average of a local volatility surface computed from call options (as these are the most liquid). This is then averaged again with put options to improve the consistency of the result. (We could then again take a moving average such as an &lt;em&gt;EWMA&lt;/em&gt; over the past and calibrate this further with a stochastic volatility model if we so wished).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hopefully this demonstrates that in theory there is only one value for the implied volatility, but that in reality this is not the case, and that there are multiple approaches to computing a value for the implied volatility, (each hopefully giving a similar answer which doesn't permit any arbitrage).&lt;/p&gt;&#xA;" OwnerUserId="21016" LastActivityDate="2016-06-30T18:57:43.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27887" PostTypeId="2" ParentId="27838" CreationDate="2016-06-30T20:50:51.787" Score="1" Body="&lt;p&gt;hmmm, I mad something like this to test market making strategies. I have my code released, if you are interested however the project was made in a day and a half so you may want to improve on it. Here is a video I made to demonstrate it: &lt;a href=&quot;https://www.youtube.com/watch?v=ka7rSQ2OWIw&quot; rel=&quot;nofollow&quot;&gt;https://www.youtube.com/watch?v=ka7rSQ2OWIw&lt;/a&gt; It links to the source.&lt;/p&gt;&#xA;" OwnerUserId="18578" LastActivityDate="2016-06-30T20:50:51.787" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27889" PostTypeId="1" AcceptedAnswerId="27912" CreationDate="2016-06-30T21:34:07.407" Score="1" ViewCount="920" Body="&lt;p&gt;The way I calculate it is summing up the weighted beta of long and shorts but I saw a table where this wasn't the case so I am wondering if this is not the correct way.&lt;/p&gt;&#xA;" OwnerUserId="22041" LastActivityDate="2016-07-03T01:02:33.820" Title="Can the net portfolio's beta be different from the sum of long and short betas of the portfolio?" Tags="&lt;beta&gt;&lt;portfolio-selection&gt;&lt;longshort&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27890" PostTypeId="1" CreationDate="2016-07-01T03:38:39.600" Score="0" ViewCount="134" Body="&lt;p&gt;I'm having trouble trying to understand the concept of 'anchors'. I came across the term in a sentence that said &lt;strong&gt;&quot;we use a relative&#xA;purchasing power parity approach that is based on the longterm&#xA;average of a currency’s real exchange rate as a fair&#xA;value anchor.&quot;&lt;/strong&gt; (&lt;a href=&quot;https://am.jpmorgan.com/blob-gim/1383276217232/83456/LTCMA-2016-White-Paper-Eur.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;form J.P Morgan, page 66&lt;/a&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, in a separate report the following formula was given:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/3PFWh.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/3PFWh.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The formula was described as &quot;an estimate that is obtained by using 10-year PPP averages as anchors and adjusting by expected bilateral inflation differentials.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sorry if this seems like a silly question! &lt;/p&gt;&#xA;" OwnerUserId="22135" LastActivityDate="2016-11-29T17:01:34.743" Title="'Anchors' for REER/PPP estimates" Tags="&lt;fx&gt;&lt;currency&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27891" PostTypeId="2" ParentId="27838" CreationDate="2016-07-01T06:40:15.283" Score="1" Body="&lt;p&gt;You can try the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/rbwu/rex&quot; rel=&quot;nofollow&quot;&gt;Rex&lt;/a&gt; by Ben Wu&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/objectcomputing/liquibook&quot; rel=&quot;nofollow&quot;&gt;Liquibook&lt;/a&gt; by Object Computing&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://jessx.ec-lille.fr/index.php?page=overview&quot; rel=&quot;nofollow&quot;&gt;JessX&lt;/a&gt; by Ecole Centrale de Lille&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="4660" LastEditDate="2016-07-02T07:59:42.673" LastActivityDate="2016-07-02T07:59:42.673" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27893" PostTypeId="2" ParentId="19464" CreationDate="2016-07-01T07:14:15.510" Score="1" Body="&lt;p&gt;I would recommend the following text:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;Mortgage-Backed Securities: Products, Structuring, and Analytical Techniques&lt;/em&gt;, 2nd Edition - Frank Fabozzi.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Part II: Prepayment and Default Metrics and Behavior&lt;/em&gt; covers the topics you mentioned, and I have been using it recently as a basis for making models based on agency MBS products. This introduces the 100 PSA model, and general pricing using default and prepayment curves.&lt;/p&gt;&#xA;" OwnerUserId="21016" LastActivityDate="2016-07-01T07:14:15.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27897" PostTypeId="2" ParentId="1865" CreationDate="2016-07-01T16:01:09.323" Score="-1" Body="&lt;p&gt;You may want to take a look at this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=4CnowC3UH4s&quot; rel=&quot;nofollow&quot;&gt;https://www.youtube.com/watch?v=4CnowC3UH4s&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18864" LastActivityDate="2016-07-01T16:01:09.323" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27899" PostTypeId="2" ParentId="27890" CreationDate="2016-07-01T18:11:19.293" Score="1" Body="&lt;p&gt;&quot;Anchor&quot; just means a slow moving, far from perfectly accurate but (hopefully still useful) estimate of value of a currency. The authors start with a PPP estimate (left side), then try to modify it in an ad-hoc manner by using expected inflation differentials (right side of the equation), which presumably adjust more quickly (and are forward looking). So there is a slow component in the model (based on PPP, or purchasing power parity) (are you familiar with PPP?) and then another component based on expected inflation. PPI means producer price index and CPI means consumer price index. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anchor is used in this way by FX economists. For example Rogoff (1996): &quot;While few empirically literate economists take PPP seriously as a short-term proposition, most instinctively believe in some variant of purchasing power parity as an anchor for long-run real exchange rates.” Source: &lt;a href=&quot;http://iei.liu.se/fek/frist/723G33/yinghong-files/1.463001/PPP_JEP.pdf&quot; rel=&quot;nofollow&quot;&gt;http://iei.liu.se/fek/frist/723G33/yinghong-files/1.463001/PPP_JEP.pdf&lt;/a&gt; an excellent article on PPP, by the way&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is a nautical analogy: although dropping an anchor will not fix the position of a ship (the ship will continue to be buffetted to and fro by winds and currents) it does guarantee that in the long run the ship will remain within a few hundred feet radius of where the anchor was dropped. So REER and PPP serve, at best, as some rough guide of where the currency will trade in the future, and other factors (the winds and currents) determine its day to day fluctuations.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2016-07-01T18:11:19.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27901" PostTypeId="1" CreationDate="2016-07-01T20:16:09.970" Score="1" ViewCount="1576" Body="&lt;p&gt;I am having some issues with finding the right code in STATA for sorting the data into portfolios by historical volatility (standard deviation) of returns and then calculating portfolio returns and run some regressions (CAPM, Fama French).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the data on weekly prices (&quot;price&quot;) of all the constituents of S&amp;amp;P 600 from 31 Dec 2004 - 29 Jan 2016. From these prices I calculated log returns (&quot;return&quot;). The time variable is called &quot;date&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I need to do:&#xA;1.) Calculate volatility of returns from 31 Dec 2004 - 30 December 2005 for each stock. Then move 1 year forward (yearly rebalancing) and again calculate volatility of returns, and so on. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2.) Then I need to sort the stocks (&quot;id&quot;) into 3 portfolios based on this  volatility. The portfolios are rebalanced at the end of each year (52nd week), so there will be different stocks belonging to each portfolio every period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3.) The returns on portfolios will be calculated each time for the year following portfolio formation (so, the first year will be used for the calculation of standard deviation, the second for calculation of portfolio return, and so on). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code I used so far:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*Calculating returns  &#xA;by id:gen return = log(price[_n] / price[_n-1])   &#xA;&#xA;*Calculating stnadard deviation   &#xA;tsset id date  &#xA;rolling sd=r(sd), window(365) saving(standarddev) stepsize(365) keep(return) : sum return    &#xA;&#xA;*Generate a variable that splits the stocks into 3 groups based on their standard deviation:  &#xA;sum sd, detail  &#xA;egen sd_cut=cut(sd), group(3)  &#xA;table sd_cut, contents(n sd min sd max sd)  &#xA;&#xA;*Merging the original dataset with standarddev.dta:  &#xA;gen week=week(date)  &#xA;gen year=year(date)  &#xA;gen yearweek=yw(year,week)  &#xA;format yearweek %tw  &#xA;&#xA;*for standarddev.dta:  &#xA;gen year=year(date)  &#xA;gen yearweek=yw(year,week)  &#xA;format yearweek %tw  &#xA;&#xA;*merging:&#xA;merge m:1 id yearweek using &quot;C:\stataData\standarddev.dta&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The first issue with my code are the dates. When I ran the &quot;rolling&quot; command, Stata automatically created some end of year dates that were not in my original dataset (for example, I have a date 29 Dec 2006 in my dataset, while Stata gave me 30 Dec 2006, making it impossible to merge the two datasets for further calculations). I have tried to work around it by creating a new varaible &quot;yearweek&quot;, but I am not sure whether this is OK?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next, I still need to sort the stocks by their st.dev. into terciles and calculate the portfolio returns (arithmetic average). Is my variable sd_cut an appropriate indicator of a stock belonging to portfolio 1,2 or 3? How many variables do I need to get at the end?I am assuming 3: portfret1, portfret2 and portfret3 or something like that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried using foreach and forvalues for the calculation of returns, but I always get error:invalid syntax.What am I missing?&#xA;Here are some of the codes I tried so far:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;local yearweek 2005w52/2006w52  &#xA;foreach yearweek{  &#xA;    egen portret1=mean(return) if ‘yearweek’==2005w52 &amp;amp; sd_cut==0  &#xA;}&#xA;&#xA;local i yearweek  &#xA;forvalues i=2005w52/2006w52{  &#xA;    bysort week:egen portret1=mean(return) if ‘i’==2005w52 &amp;amp; sd_cut==0  &#xA;}  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I also tried using bysort, but failed (even when I sorted first on date):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sort id date  &#xA;by date:egen portret1=mean(f365.return) if sd_cut==0 &amp;amp; year==2005  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any help would be appreciated! Thank you in advance!&#xA;Laura&lt;/p&gt;&#xA;" OwnerUserId="22402" LastEditorUserId="29318" LastEditDate="2018-08-26T18:43:47.037" LastActivityDate="2018-08-26T18:43:47.037" Title="Calculating weekly portfolio returns for portfolios sorted by volatility" Tags="&lt;volatility&gt;&lt;returns&gt;&lt;portfolio&gt;&lt;fama-french&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="27904" PostTypeId="2" ParentId="27871" CreationDate="2016-07-02T08:26:46.177" Score="1" Body="&lt;p&gt;re: fx volume&lt;/p&gt;&#xA;&#xA;&lt;p&gt;majority of fx volume is &quot;unknown&quot;, but so is much else in markets. there are ways of estimating volume to feed your models - just don't get overly reliant on it IMO. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;check out CME T&amp;amp;S and a few spot venues. google Lee/Ready and Tick Rule to get ideas on how to create your own estimation models based on available/accessible data for FX. &lt;/p&gt;&#xA;" OwnerUserId="22406" LastActivityDate="2016-07-02T08:26:46.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27905" PostTypeId="1" CreationDate="2016-07-02T09:37:02.083" Score="1" ViewCount="136" Body="&lt;p&gt;In the command line interface to my program, the user can create a basket of stocks, etfs, or futures by saying:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;basket = stocks&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;basket = etfs&lt;br&gt;&#xA;   basket = futures&lt;br&gt;&#xA;  basket = options&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But I want to make a pre-combined basket, consisting of stocks, etfs and futures.  Yes, I could make the user enter:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;basket = stocks,etfs,futures&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But is there a single word appropriate for this predefined basket? &quot;Securities&quot; doesn't include etfs and futures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an appropriate word?&lt;/p&gt;&#xA;" OwnerUserId="2983" LastActivityDate="2016-11-24T01:08:46.830" Title="What do you call a group consisting of stocks, etfs, and futures?" Tags="&lt;futures&gt;&lt;sec&gt;&lt;terminology&gt;" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="27906" PostTypeId="1" AcceptedAnswerId="27909" CreationDate="2016-07-02T11:24:24.553" Score="3" ViewCount="890" Body="&lt;p&gt;More precisely, in equity markets, why would one prefer to buy a forward starting option over a vanilla option ? What about the selling side ?&lt;/p&gt;&#xA;" OwnerUserId="19693" LastActivityDate="2016-07-03T09:21:57.477" Title="Why buy/sell a forward starting option?" Tags="&lt;options&gt;&lt;equities&gt;&lt;derivatives&gt;&lt;forward-start&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27907" PostTypeId="2" ParentId="27683" CreationDate="2016-07-02T12:50:20.497" Score="0" Body="&lt;p&gt;Thanks to Mark Joshi for pointing me to the answer in his comments above. Credit should go to him. For completeness here is the answer expressed in the nomenclature of the question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;P\textbf{(}min(x_0 \to _T) \leq \alpha\:\: | \:\: x_T\textbf{)} =\left\{\begin{matrix}&#xA; e^{-2(\alpha -x_0)(\alpha -x_T)/\sigma ^{2}T} \:\:\:\:\:\:\:\:\ for\: \alpha \leq x_0\: and \: \alpha \leq x_T\&#xA;\\ &#xA;\\ &#xA;1\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:  Otherwise&#xA;\end{matrix}\right.&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="22208" LastEditorUserId="22208" LastEditDate="2016-07-02T13:09:49.020" LastActivityDate="2016-07-02T13:09:49.020" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27908" PostTypeId="2" ParentId="27890" CreationDate="2016-07-02T14:27:21.400" Score="0" Body="&lt;p&gt;Absolute &lt;em&gt;level&lt;/em&gt; measures of PPP contain significant measurement uncertainties and can be subject to large revisions.  Therefore a comparison of absolute level measures between currency areas cannot be relied upon.  &lt;em&gt;Changes&lt;/em&gt; in PPP over time however are much more accurate.  For this reason, an 'anchor', be it a specific point in time historically, or an average over a longer period, is often used as a starting point.  The drift away from the anchor, relative to that for another currency area, then gives you your (adjusted relative) PPP level.  &lt;/p&gt;&#xA;" OwnerUserId="3297" LastActivityDate="2016-07-02T14:27:21.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27909" PostTypeId="2" ParentId="27906" CreationDate="2016-07-02T16:46:06.217" Score="5" Body="&lt;p&gt;It is hard to imagine why a trader would want to buy a forward start option to express a market view, unless there is a one-off event like an election which they don't want to have as part of the live period for the volatility. A forward start option is mainly exposed to the volatility relating to the period &lt;em&gt;after&lt;/em&gt; the strike is set.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Forward start options tend to be used in the creation of &quot;structured products&quot; in several ways. One simple way they can be used is to facilitate a selling period for a structured product. For example, a retail seller will have determined there is appetite for a five year structured product which includes some kind of option. The seller thinks he can sell for example 50 million of the product so can buy 50 million worth of a one month forward start version of the structured product.  Then over the one month period they can try and sell the 50 million of product at close to a constant fixed price, as the delta of the product will be very low.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another use in structure products is as part of a &quot;cliquet&quot; structure. In its simplest form, this would consist of series of for example three month options, each starting when the previous one expires. In a volatile but overall non-trending market such a product can have a better payoff than a simple vanilla option. And all manner of features can be added, such as adding local caps, whereby each option can have a maximum of 10% payout, and/or a global floor in which the minimum payout of the entire structure is fixed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Such products have somewhat fallen out of favor since the credit crisis due to their complexity. They were particularly popular in the UK and France in the late 1990s and early 2000s.&lt;/p&gt;&#xA;" OwnerUserId="22326" LastEditorUserId="22326" LastEditDate="2016-07-03T09:21:57.477" LastActivityDate="2016-07-03T09:21:57.477" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27910" PostTypeId="2" ParentId="24681" CreationDate="2016-07-02T17:26:29.227" Score="0" Body="&lt;p&gt;For the purpose of calculating initial margin (I assume that is what IM refers to) a clearing house would do a calculation that effectively takes into account the notional amounts of both underlyings, each of their marginal probability distributions (of returns) and their correlation, or if the statistics require it, also the characteristics of the copula joining their marginal distributions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So there is no simple answer to the question, as the margin will not look something like notional * volatility * constant as it might approximately be for a futures contract. I can however sympathize with the desire for such a simple answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question is frequently asked of risk departments in clearing houses.&lt;/p&gt;&#xA;" OwnerUserId="22326" LastEditorUserId="22326" LastEditDate="2016-07-02T17:50:53.097" LastActivityDate="2016-07-02T17:50:53.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27912" PostTypeId="2" ParentId="27889" CreationDate="2016-07-03T01:02:33.820" Score="1" Body="&lt;p&gt;You can actually show by construction that the beta of the portfolio is the weighted sum of all the underlyings betas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume the return of the benchmark and some asset $a$ at time $t$ are respectively denoted $r_{b,t}$ and $r_{a,t}$, then the beta of a given asset is defined by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_{a,t} = \alpha_a + \beta_a r_{b,t} + \epsilon_{a,t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's assume you have a portfolio of $n$ assets $(a_1, ..., a_i, ..., a_n)$ each with a weight $w_i$, then the return of the portfolio is at time $t$ is defined as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_{p,t} = \sum_{i=1}^n w_i r_{a_i,t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, by expressing each asset's return in terms of their own beta, you get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align}&#xA;r_{p,t} &amp;amp;= \sum_{i=1}^n w_i r_{a_i,t}\\&#xA;&amp;amp;= \sum_{i=1}^n w_i \left( \alpha_{a_i} + \beta_{a_i} r_{b,t} + \epsilon_{a_i,t} \right)\\&#xA;&amp;amp;= \underbrace{\sum_{i=1}^n w_i \alpha_{a_i}}_{\alpha_p} + \underbrace{\left(\sum_{i=1}^n w_i \beta_{a_i} \right)}_{\beta_p} r_{b,t} +\sum_{i=1}^n w_i \epsilon_{a_i,t}&#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There might be something in the table that you missed (likely the weights as Alex C pointed out) or maybe it was wrong.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2016-07-03T01:02:33.820" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27913" PostTypeId="2" ParentId="22219" CreationDate="2016-07-03T12:24:46.543" Score="1" Body="&lt;p&gt;&lt;em&gt;This is all theoretical and real life will diverge from the theory&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The spot rates and forward rates are linked.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Spot rate for the nth period should equal the product of all the forward rates up to that period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i.e&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let Spot{n} = spot rate for nth period&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let Forw{k,j} = forward rate to period j at period k&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let X_m be the m'th period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then (1+Spot{n})^n = (1 + Forw{0,X_1}) * (1 + Forw{X_1,X_2}) * ... * (1 + Forw{X_n-1,X_n})&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course in real life, there will be slight or not so slight differences which gives rise to arbitrage opportunities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the answer to your question is, you can use either. If you use spot rates, just take it to the correct power. If you use forward rates, you take the product of the forward rates until the correct period. Neverthess, it is good practice to take these calculations with a grain of salt. It is unlikely that you got your cash flows correct anyway so never mind a bit of error in the rates that you use.&lt;/p&gt;&#xA;" OwnerUserId="22412" LastActivityDate="2016-07-03T12:24:46.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27917" PostTypeId="2" ParentId="25869" CreationDate="2016-07-03T20:41:49.597" Score="0" Body="&lt;p&gt;dismissing ask (offer) data in fx makes no sense (not sure if it does anywhere else either).. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;you need to build your own mid-price (don't just subtract bid from offer like most do unless you run a very simple small clip-size taker model). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;you then take the mid-price to make your own bids / offers. not sure what you're trying to do - since you mentioned HFT - guess you are trying to make a market - so setting your mid-price is crucial for you to be able to do anything in fx, in order to do that, you need to see both sides of the market (bids and offers). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;hope helps ;&lt;/p&gt;&#xA;" OwnerUserId="22406" LastActivityDate="2016-07-03T20:41:49.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27918" PostTypeId="1" AcceptedAnswerId="27919" CreationDate="2016-07-03T21:42:18.013" Score="-1" ViewCount="5755" Body="&lt;p&gt;So, per the title, why would a combination of two risky assets that have the same exact expected return and standard deviation while being perfectly negatively correlated not return 0%? Why do you just combine the weighted expected return of the two assets to get the expected return at 0 standard deviation? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems logical that if asset A goes up by expected return and asset B goes down by the expected return, the portfolio return would be 0. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in textbooks the expected return of two perfectly negatively correlated assets is just the sum of their weighted expected returns. Why would you not subtract returns since if one goes up, the other goes down (detracting from returns)? &lt;/p&gt;&#xA;" OwnerUserId="22417" LastActivityDate="2016-07-03T22:26:10.930" Title="Why do two perfectly negatively correlated assets not return 0%?" Tags="&lt;returns&gt;&lt;correlation&gt;&lt;standard-deviation&gt;" AnswerCount="1" CommentCount="4" ClosedDate="2016-07-10T14:12:08.777" ContentLicense="CC BY-SA 3.0" />
  <row Id="27919" PostTypeId="2" ParentId="27918" CreationDate="2016-07-03T22:26:10.930" Score="1" Body="&lt;p&gt;If I understand your question correctly; the (expected) return always depends on the weights that the respective factor has in the portfolio, regardless of the risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are trying to find the optimal portfolio (given risk with highest return, or given return with lowest risk) so in the first step you try to diversify out the risk (and get the weigths for the sought portofilo) once you get your weights, you calculate the return (that does not depend on the risk or covariances at all, just the weights and respective returns).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In extreme case: 50-50 allocation between two perfectly negatively correlated assets of the same return that would result in 0 (expected) return. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But say, typical example - selling ice cream and umbrellas. If it is a rainy season, umbrella stocks goes up 70\$, ice cream loses 30\$ and vice versa if it is sunny. If you invest 50-50, then regardless of the weather you get $0.5*(-30\$)+0.5*(70\$)=40$$ with certainty. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Always the payoff depends on the weights (60-40) and if its a 'bad' year would give you only 10\$ etc. &lt;/p&gt;&#xA;" OwnerUserId="22237" LastActivityDate="2016-07-03T22:26:10.930" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="27921" PostTypeId="2" ParentId="8099" CreationDate="2016-07-04T02:52:02.347" Score="4" Body="&lt;p&gt;My hard-fought results (14,452 CIKs and their tickers):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://dan.vonkohorn.com/2016/07/03/cik-ticker-mappings/&quot; rel=&quot;nofollow&quot;&gt;https://dan.vonkohorn.com/2016/07/03/cik-ticker-mappings/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="22043" LastActivityDate="2016-07-04T02:52:02.347" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27922" PostTypeId="2" ParentId="17035" CreationDate="2016-07-04T03:24:23.873" Score="0" Body="&lt;p&gt;I had to solve this, too, and it took a while so I'm posting my results hoping that I can save others the time.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;NYSE: &lt;a href=&quot;https://dan.vonkohorn.com/2016/07/03/cik-ticker-mappings-for-nyse-listed-securities/&quot; rel=&quot;nofollow&quot;&gt;https://dan.vonkohorn.com/2016/07/03/cik-ticker-mappings-for-nyse-listed-securities/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NASDAQ: &lt;a href=&quot;https://dan.vonkohorn.com/2016/07/03/cik-ticker-mappings-for-nasdaq-listed-securities/&quot; rel=&quot;nofollow&quot;&gt;https://dan.vonkohorn.com/2016/07/03/cik-ticker-mappings-for-nasdaq-listed-securities/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="22043" LastActivityDate="2016-07-04T03:24:23.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27924" PostTypeId="1" AcceptedAnswerId="27926" CreationDate="2016-07-04T09:57:05.203" Score="7" ViewCount="978" Body="&lt;p&gt;Say we have following SDE (Vasicek):&#xA;$$dr(t) =(b-ar_t) dt + \sigma dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am able to reach an integral form of this SDE :&#xA;$$r(t) = r(0) e^{-at} + \frac{b}{a}[1 - e^{-at}] + \sigma e^{-at}\int_0^t e^{as}dW_s$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From here, I would like to conclude that $r(t)$ is Gaussian but I don't know how to proceed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I somehow understand that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E[r(t)] = r(0) e^{-at} + \frac{b}{a}[1 - e^{-at}]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Var[r(t)]= \sigma e^{-at}\int_0^t e^{as} dW_s$$&lt;/p&gt;&#xA;" OwnerUserId="22424" LastEditorUserId="467" LastEditDate="2016-07-05T01:42:37.277" LastActivityDate="2016-07-05T14:09:21.260" Title="How to show that this process is &quot;normally distributed&quot;?" Tags="&lt;stochastic-calculus&gt;&lt;vasicek&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27926" PostTypeId="2" ParentId="27924" CreationDate="2016-07-04T10:48:40.447" Score="8" Body="&lt;p&gt;First, note&#xA;$$\mathbb{E^Q}\left[\int_0^t e^{-a(t-s)}dW_s\right]=0 $$&#xA;and&#xA;$$\mathbb{Var^Q}\left[\int_0^t e^{-a(t-s)}dW_s\right]=\mathbb{E^Q}\left[\int_{0}^{t} e^{-2a(t-s)}ds\right]=\frac{1}{2a}(1-e^{-2at}) $$&#xA;therefore&#xA;$$\mathbb{E^Q}[r_t]=r_0 e^{-at} + \frac{b}{a}(1 - e^{-at})$$&#xA;$$\mathbb{Var^Q}(r_t)=\frac{\sigma^2}{2a}(1-e^{-2at})$$&#xA;&lt;strong&gt;second&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Itô integral can be defined in a manner similar to the Riemann–Stieltjes integral, that is as a limit in probability of Riemann sums; such a limit does not necessarily exist pathwise. Suppose that $W_t$ is a Wiener process and that $X_t$ is a right-continuous (cadlag), adapted and locally bounded process if $I=\{t_0,t_1,\cdots,t_n\}$ is a sequence of partitions of $[0,t]$  with mesh going to zero, then the Itô integral of $X_t$ with respect to $W_t$ up to time t is a random variable&#xA;$$\int_{0}^{t}X_sdW_s=\underset{n\to \infty }{\mathop{\lim }}\,\sum\limits_{i=1}^{n}{X({{t}_{i-1}})(W({{t}_{i}})-W({{t}_{i-1}})})$$&#xA;Set $X_s=e^{as}$, $X_s$ is a deterministic function thus &#xA;$$\int_0^t e^{-a(t-s)}dW_s\sim N\left(0\quad,\quad\frac{1}{2a}(1-e^{-2at})\right) $$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-07-05T14:09:21.260" LastActivityDate="2016-07-05T14:09:21.260" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27927" PostTypeId="2" ParentId="10690" CreationDate="2016-07-04T10:54:49.487" Score="-1" Body="&lt;p&gt;If I have understand right what you are looking for, I think that Nelson–Siegel Model can halp you, google it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hear some readng: &lt;a href=&quot;http://amstat.tandfonline.com/doi/abs/10.1198/jbes.2009.07295&quot; rel=&quot;nofollow&quot;&gt;Nelson-Siegel model&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="22423" LastActivityDate="2016-07-04T10:54:49.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27928" PostTypeId="1" AcceptedAnswerId="27929" CreationDate="2016-07-04T13:28:56.780" Score="1" ViewCount="163" Body="&lt;p&gt;I am a little bit stucked with the following integral process, using Fubini's method, this is an intermediate step of short rate Merton Model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\int_{t}^{T} W(s)ds=\int_{0}^{\hat {T}}ds\int_{0}^{s}dW(u)\\=\int_{0}^{\hat {T}}dW(u)\int_{u}^{\hat {T}}ds\\=\int_{0}^{\hat {T}}(\hat{T}-u)dW(u)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My more specific question is how did the change of integration variables proceed, as the process described by above integration is not very intuitive to me. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks! &lt;/p&gt;&#xA;" OwnerUserId="22427" LastActivityDate="2016-07-04T13:58:49.750" Title="How to understand the following brownian integral using Fubini's method?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;quantitative&gt;&lt;quants&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27929" PostTypeId="2" ParentId="27928" CreationDate="2016-07-04T13:58:49.750" Score="2" Body="&lt;p&gt;\begin{align*}&#xA;  \int_0^T W(t)\, dt &amp;amp;{}= \int_0^T\!\!\int_0^t dW(u)\,dt \\ &amp;amp;{}= \int_0^T\!\!\int_u^T dt\, dW(u) \\&amp;amp;{}= \int_0^T (T - u)\,dW(u) \\&amp;amp;{}= TW(T) - \int_0^T u\, dW(u)&#xA;  \end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;however i am not sure if it is what you are asking for&lt;/p&gt;&#xA;" OwnerUserId="22424" LastActivityDate="2016-07-04T13:58:49.750" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27931" PostTypeId="2" ParentId="10451" CreationDate="2016-07-04T18:36:33.173" Score="2" Body="&lt;p&gt;In Bonds with a negative yield the duration should be longer than the maturity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Duration is the length of time for the return of the fund. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As long as the coupons are positive, the investor returns the fund before the final redemption, in a negative interest rate situation the negative interest rate eats from the fund and the duration should be longer than the maturity.&lt;/p&gt;&#xA;" OwnerUserId="22423" LastActivityDate="2016-07-04T18:36:33.173" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27933" PostTypeId="1" CreationDate="2016-07-05T03:43:57.457" Score="1" ViewCount="526" Body="&lt;p&gt;I 'm trying to get a mid price for forex data. &lt;a href=&quot;https://quant.stackexchange.com/a/27917/22143&quot;&gt;This answer&lt;/a&gt; by alex suggests that I shouldn't simply take ask minus bid. I am not a high frequency trader or market maker. My purpose for the fx mid point data would be to run some pattern  recognition algorithms. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is how should I get a mid price if not just using ask minus bid? &lt;/p&gt;&#xA;" OwnerUserId="22143" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2017-01-09T10:51:56.337" Title="How do I get a good mid-price?" Tags="&lt;market-data&gt;&lt;fx&gt;&lt;price&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27934" PostTypeId="2" ParentId="27933" CreationDate="2016-07-05T08:34:27.783" Score="7" Body="&lt;p&gt;Ask minus bid has nothing to do with the mid price - it is the spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally you see a collection of bid/offer orders resting on different price levels. In the simplest case, you just see one bid at price $p_b$ and one offer at price $p_a$. In this case the mid price is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;p_m = \frac{p_a + p_b}{2}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's all there is to it - you don't need to &quot;approximate&quot; the mid price if you know the best bid and offer. The half-way point between them just &lt;em&gt;is&lt;/em&gt; the mid price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Really, the question you should be asking is &quot;what is the &lt;em&gt;fair&lt;/em&gt; price?&quot; and not &quot;what is the mid price?&quot;. The fair price is the exchange rate at which you would be ambivalent about buying or selling (assuming you don't care about risk).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most of the time, the fair price $p_f$ satisfies $p_b &amp;lt; p_f &amp;lt; p_a$ and you want to get an accurate value for this, using all the information at your disposal. Just using the mid price i.e. $p_f=p_m$ is not a bad approach, but it can break down -&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;If the spread is wide i.e. $p_a \gg p_b$ then the possible range of values for the fair price is very large. This can happen in illiquid markets. In this case, you may want to use information from previous quotes (for example, what was the mid price the last time you saw a bid-offer spread that was not unreasonably wide).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If the quoted volumes on the bid and offer are very different, it may indicate that the fair price is far away from the mid. For example, if the amount bid far exceeds the amount offered, it indicates that demand exceeds supply, so probably $p_f &amp;gt; p_m$, and similarly if the amount offered exceeds the amount bid, you probably have $p_f &amp;lt; p_m$. You can search for &quot;bid ask imbalance&quot; or &quot;liquidity imbalance&quot; to read more about this.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="924" LastEditorUserId="924" LastEditDate="2016-07-05T13:42:58.023" LastActivityDate="2016-07-05T13:42:58.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27936" PostTypeId="1" CreationDate="2016-07-05T12:46:57.717" Score="2" ViewCount="154" Body="&lt;p&gt;Given the estimate of GARCH(1, 1) model parameters I observe the new price. How to update the estimate with this new information. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's assume I know the coefficients that maximize the likelihood given the data up to the time $T$. At time $T+1$ the new price is observed and I wish to update the coefficients without recomputing the full model&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for the asymptotic convergence of the coefficients - at each time step $T$ I am OK to update the coefficients in suboptimal way but I want them to converge to the true values at infinity.&lt;/p&gt;&#xA;" OwnerUserId="5890" LastEditorUserId="5890" LastEditDate="2016-07-05T13:03:26.303" LastActivityDate="2016-07-05T16:36:57.200" Title="Streaming update of the GARCH(1,1) model" Tags="&lt;garch&gt;&lt;estimation&gt;" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="27938" PostTypeId="2" ParentId="2205" CreationDate="2016-07-05T13:26:19.437" Score="2" Body="&lt;p&gt;I have studied unsystematic risk [USR] for more than two decades. In fact, I wrote a book (&lt;A HREF=&quot;http://bit.ly/ValueMaps&quot; rel=&quot;nofollow&quot;&gt;&lt;B&gt;which is here&lt;/B&gt;&lt;/A&gt;) whose central focus is how to deal with USR in the valuation of non-public companies. It is a multifaceted, complex, and difficult issue. Modern Portfolio Theory did professionals in my line of work no favors when it assumed away the existence of USR because few small-business owners hold diversified investment portfolios.&lt;/p&gt;&#xA;" OwnerUserId="22439" LastActivityDate="2016-07-05T13:26:19.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27940" PostTypeId="2" ParentId="27936" CreationDate="2016-07-05T16:36:57.200" Score="3" Body="&lt;p&gt;If you estimate your model via Maximum Likelihood method, you are forced to re-estimate the full model. This is due to the fact that estimates are values which maximize the &lt;em&gt;full&lt;/em&gt; likelihood, the latter being based on a recursive algorithm which use all observations (including the new one) and implies that a new observation may also impact likelihood values of previous points. There is no way to find a kind of score vector to update your estimates. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;However, if you need to update several times your model, you can facilitate the estimation by fixing the starting values to the previous estimates at each step you re-estimate the model. Another rough method is to assume constant your parameters for a period of $x$ observations, and to re-estimate the model every $x$ points.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;When you are talking about the 'true' estimate, don't miss the point that we never observe the true Data Generating Process (DGP) and so that we can't find these 'true' estimates. Your estimates &lt;em&gt;at time t&lt;/em&gt; are only an approximation of the DGP &lt;em&gt;at time t&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2016-07-05T16:36:57.200" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27941" PostTypeId="1" CreationDate="2016-07-05T19:08:15.220" Score="1" ViewCount="162" Body="&lt;p&gt;I a going through Hosmer, Lemenshow and Sturdivant's (HLS) Applied Logistic Regression (2013) and trying to interpret the difference between what STATA is doing and what R is doing. Concerning the fit of the model using multivariable fractional ploynomials (MFP), HLS looks at the glow500 study where the dependent variable is fracture and there are both dichotomous and continuous independent variable. You do not need the book to consider  these questions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the data and the R call to the MFP function&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(mfp)&#xA;library(data.table)&#xA;mydat &amp;lt;- fread('http://www.umass.edu/statdata/statdata/data/glow/glow_bonemed.dat')&#xA;colnames(mydat) = c(&quot;SUB_ID&quot;,&quot;SITE_ID&quot;,&quot;PHY_ID&quot;,&quot;PRIORFRAC&quot;,&quot;AGE&quot;,&quot;WEIGHT&quot;,&quot;HEIGHT&quot;,&quot;BMI&quot;,&quot;PREMENO&quot;,&quot;MOMFRAC&quot;,&quot;ARMASSIST&quot;,&quot;SMOKE&quot;,&#xA;                    &quot;RATERISK&quot;,&quot;FRACSCORE&quot;, &quot;FRACTURE&quot;,&quot;V16&quot;,&quot;V17&quot;)&#xA;head(mydat)&#xA;m = mfp(FRACTURE ~ PRIORFRAC + as.factor(RATERISK) + MOMFRAC  + ARMASSIST + SMOKE + PREMENO + &#xA;          fp(AGE, df=4, select = .15, alpha = .05) + &#xA;          fp(BMI, df=4, select = .15, alpha = .05) + &#xA;          fp(WEIGHT, df=4, select = .15, alpha = .05) + &#xA;          fp(HEIGHT, df=4, select = .15, alpha = .05) ,&#xA;        family = binomial, data= mydat, verbose = TRUE)&#xA;summary(m)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In HLS's book on page 142 there is table that is Cycle 2 of the MFP procedure. Cycle 2 they says contains the &quot;partial liklihood ratio tests that are based, not on the full 11 covariate model, but on a 5 covariate model (from Cycle 1).&quot; NOTE: HERE HE SAYS THERE ARE 5 VARIABLES that are significant from cycle 1. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the MFP function call in R using the same data he used in STATA. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a couple questions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;QUESTION 1&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On page 141 in the book BMI is not significant so it is not included in cycle 2.  You can see the same non-significance in the R output. If you look at Cycle 1 you see    &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;           BMI               &#xA;        506.098      &#xA;        503.837     1&#xA;        501.743     0.5&#xA;        501.574     -2 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So the liklihood ratio test is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1-pchisq(506.098 - 501.574,4) = p-value of .34 &amp;gt; .15 so DO NOT INCLUDE in cycle 2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is the Deviance of the NULL Model excluding BMI compared to the deviance of the best 2-term polynomial fit powers (-2,1) the p-value = .34 which is &gt; .15 so BMI SHOULD NOT BE INCLUDED in CYCLE 2.  But it is. You can look  under Cycle 2 of the output and you see:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;                 BMI                 &#xA;                506.674      &#xA;                505.865     1&#xA;                504.843     -2&#xA;                504.224     -2 -2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So now in R - in Cycle 2 you see 6 (NOT 5 like he says in the book) variables in the model in cycle 2.  BMI again is not significant&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1-pchisq(506.674 - 504.224,4) =  p-value = .65 so again not significant in cycle 2 comparing the NULL model in cycle 2 vs. the best 2 term polynomial (-2,2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So my first question is why is BMI included in Cycle 2 in R? Looking at BMI in cycle 1 it is NOT significant. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;QUESTION 2&lt;/strong&gt; &#xA;Under the Fractional Polynomials part of the output I see:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Fractional polynomials&#xA;                     df.initial select alpha df.final power1 power2&#xA;PRIORFRAC                     1   1.00  0.05        1      1      .&#xA;AGE                           4   0.15  0.05        1      1      .&#xA;as.factor(RATERISK)2          1   1.00  0.05        1      1      .&#xA;as.factor(RATERISK)3          1   1.00  0.05        1      1      .&#xA;MOMFRAC                       1   1.00  0.05        1      1      .&#xA;BMI                           4   0.15  0.05        0      .      .&#xA;WEIGHT                        4   0.15  0.05        0      .      .&#xA;ARMASSIST                     1   1.00  0.05        1      1      .&#xA;HEIGHT                        4   0.15  0.05        1      1      .&#xA;SMOKE                         1   1.00  0.05        1      1      .&#xA;PREMENO                       1   1.00  0.05        1      1      .&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the documentation (&lt;a href=&quot;https://cran.r-project.org/web/packages/mfp/vignettes/mfp_vignette.pdf&quot; rel=&quot;nofollow&quot;&gt;https://cran.r-project.org/web/packages/mfp/vignettes/mfp_vignette.pdf&lt;/a&gt;) df.final is defined as &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;a vector containing the degrees of freedom of each covariate at convergence of the backfitting  algorithm (m=4 for second degree FP, m=2 for first degree FP, m=1 for untransformed variable, m=0 if covariate was excluded).&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;can you explain how the df changes for  weight and BMI so that they are excluded from the final model?&lt;/p&gt;&#xA;" OwnerUserId="18320" LastEditorUserId="18320" LastEditDate="2016-07-05T21:05:45.697" LastActivityDate="2016-07-05T21:05:45.697" Title="logistic regression multivariable fractional ploynomials stata vs. R" Tags="&lt;r&gt;&lt;statistics&gt;&lt;probability&gt;&lt;regression&gt;&lt;logit&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27942" PostTypeId="1" AcceptedAnswerId="27949" CreationDate="2016-07-05T21:10:58.327" Score="2" ViewCount="109" Body="&lt;p&gt;I'm testing a model to estimate the VaR of a portfolio with different stocks. I used 1500 data to estimate some parameters, and now I have other 1500 data for backtesting purposes (for a total of 3000 data on return series). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The model slightly underestimates VaR, i.e. the number of violations exceeds a bit the expected number of violations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if I split the 1500-days testing window in two 750-days periods, I get moderate violations in the first testing period (which spans approximately from 2007 to 2009) and a 'perfect performance' in the second 750-days period (number of violations matches the expected number of violations almost exactly). Therefore, I wanted to consider this splitting procedure in order to highlight the model's advantages and drawbacks in volatile vs. more stable times (performing unconditional and conditional coverage tests separately for two periods). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; Are there problems related to the idea of splitting the testing window in two consecutive periods? More precisely:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Is it okay to consider period 1 from $T$ to $T+749$ and period 2&#xA;from $T+750$ to $T+1499$?&lt;/li&gt;&#xA;&lt;li&gt;Or is it better to allow for &quot;some space&quot;, i.e. consider non-immediately consecutive periods, such as from $T$ to $T+499$ for period 1 and then from $T+750$ to $T+1249$ for period 2 (with 500 data each)? &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I guess my question is: are there any issues related to &quot;independence&quot; between consecutive testing windows, or can I continue with my approach of two consecutive periods?&lt;/p&gt;&#xA;" OwnerUserId="20573" LastEditorUserId="20573" LastEditDate="2016-07-06T09:47:01.357" LastActivityDate="2016-08-05T09:56:39.277" Title="Can I split my backtesting into multiple consecutive sub-periods?" Tags="&lt;backtesting&gt;&lt;var&gt;&lt;value-at-risk&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27943" PostTypeId="1" CreationDate="2016-07-05T21:53:52.947" Score="1" ViewCount="71" Body="&lt;p&gt;There have been a number of articles talking about financial topology and understanding cascading failures and risk. A while back there was another article about how a small number of companies form the core of the modern financial system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm wondering where we can get data of ownership of financial assets and how we can approach forming a high level topology of the economic system and then continue to granulize that.&lt;/p&gt;&#xA;" OwnerUserId="6663" LastActivityDate="2016-07-05T21:53:52.947" Title="Are there data sets for the topology of financial assets?" Tags="&lt;data&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27945" PostTypeId="1" CreationDate="2016-07-06T00:05:00.060" Score="1" ViewCount="802" Body="&lt;p&gt;Why people call (vol call - vol put) risk reversal when risk reversal actually is (call 25 delta -put detlta +25)? when constructing volatility surface? The vol of risk revesal should not be vol call - vol put? Is the terminology just for the sake of convenience?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks&lt;/p&gt;&#xA;" OwnerUserId="22448" LastActivityDate="2019-03-04T01:54:45.640" Title="The name conventions such as ATM, Risk reversal and Butterflies to construct volatility surface" Tags="&lt;risk&gt;&lt;implied-volatility&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27948" PostTypeId="1" AcceptedAnswerId="27950" CreationDate="2016-07-06T06:19:21.023" Score="2" ViewCount="56" Body="&lt;p&gt;After digging around a few sources of futures data (in particular &lt;a href=&quot;https://www.quandl.com/&quot; rel=&quot;nofollow&quot;&gt;Quandl&lt;/a&gt; and &lt;a href=&quot;http://eoddata.com/&quot; rel=&quot;nofollow&quot;&gt;EOD Data&lt;/a&gt;), I noticed the data only reports for business days (i.e. Monday-Friday excluding national holidays).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The NYMEX trades from Sunday at 6:00pm to Friday at 5:15pm. Naturally the Sunday won't be included if only business hours are reported.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this true in general - that data sources only report business days? If so - why?&lt;/p&gt;&#xA;" OwnerDisplayName="user20664" LastEditorUserId="467" LastEditDate="2016-07-06T06:55:10.443" LastActivityDate="2016-07-07T01:05:51.933" Title="Is futures contracts data only reported for business days?" Tags="&lt;data&gt;&lt;futures&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27949" PostTypeId="2" ParentId="27942" CreationDate="2016-07-06T06:20:55.627" Score="0" Body="&lt;p&gt;Ideally you would like to look at both the global backtested period and sub-periods as well, there is nothing wrong with that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No backtesting framework is perfect and no risk ex-ante estimate is perfect either. So you can look at the results over the global period, which conclude that your approach is decent, and then highlight that it particularly didn't work in a given period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, your job is to explain what happened in that period and why your estimate failed. You could claim that there was a very specific event such as government intervention, votes results, etc... Obviously, stating that &quot;market went down very severely that period&quot; is not a good excuse - you're trying to predict risk - but you could claim that market condition change from time to time, and then try to find indicators which detect these changes, and which will allow you to change you estimate to another one more specific to these circumstances.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2016-07-06T06:20:55.627" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27950" PostTypeId="2" ParentId="27948" CreationDate="2016-07-06T07:06:54.157" Score="5" Body="&lt;p&gt;Usually end-of-day prices refer to &lt;strong&gt;settlement&lt;/strong&gt; prices; they are not the last price at which the instrument was trading during that business day. Settlement prices are important because they are the ones considered when computing the P&amp;amp;L for a given day and for posting margin requirements, if necessary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When markets are closed (during non-business days of the exchange in question), then no settlement price is computed, and hence no data is being published because market did not &quot;generally agree&quot; on the price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, markets are usually open intraday from Sunday night, but volumes (i.e liquidity) is much lower and hence prices are less reflective of markets views as well, this is why these data points need to be considered with care.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2016-07-07T01:05:51.933" LastActivityDate="2016-07-07T01:05:51.933" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27952" PostTypeId="2" ParentId="26125" CreationDate="2016-07-06T12:49:32.013" Score="11" Body="&lt;p&gt;Let's assume T=1 and let S be a geometric gaussian process with zero drift, i.e. $\ln(S_1/S_0)$ is normally distributed with mean $-1/2\times\mathrm{VEV}^2$ and volatility VEV.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\ln(\mathrm{VaR}/S_0) = -1/2\mathrm{VEV}^2 - \mathrm{VEV} \times 1.96$$ with the VAR at $0.975$ quantile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a quadratic equation in VEV, with solutions&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathrm{VEV} = -1.96 \pm \sqrt{1.96^2 - 2\ln(\textrm{VaR}/S_0)}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We take the positive solution and are done.&lt;/p&gt;&#xA;" OwnerUserId="22456" LastEditorUserId="848" LastEditDate="2016-07-08T19:37:20.613" LastActivityDate="2016-07-08T19:37:20.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27954" PostTypeId="2" ParentId="25216" CreationDate="2016-07-06T14:10:10.320" Score="0" Body="&lt;p&gt;Similar to dm63's answer: if you are the fixed payer in the swap:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;add a long fixed rate bond with coupon equal to the fixed rate and notional equal to the notional of the swap.&lt;/li&gt;&#xA;&lt;li&gt;add a short Floater with the coupons linked to the floating rate of the swap. The notional is the same as of the fixed rate bond.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;DV01, duration, risk should all be well captures doing this.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-07-06T14:10:10.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27956" PostTypeId="2" ParentId="27855" CreationDate="2016-07-06T15:17:21.747" Score="0" Body="&lt;p&gt;your modeling was similar to the original paper? in this case a negative momentum coeficient is telling you that for this timeframe the winners of the last period are not the winners in this period.&lt;/p&gt;&#xA;" OwnerUserId="22430" LastActivityDate="2016-07-06T15:17:21.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27957" PostTypeId="2" ParentId="27870" CreationDate="2016-07-06T15:25:31.807" Score="0" Body="&lt;p&gt;Complementing Ana's answer: The goal with a multivariate regression is to control by known factors (such as FFs) and check if there is abnormal returns on top of the known ones.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, when reading a paper we will like to check if the signals of the factors are on the same direction and significance level of past literature (and look for explanation otherwise) and check if the &quot;rest&quot; read &quot;Alpha&quot; will be positive and significant.&lt;/p&gt;&#xA;" OwnerUserId="22430" LastActivityDate="2016-07-06T15:25:31.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27958" PostTypeId="1" CreationDate="2016-07-06T17:51:36.983" Score="2" ViewCount="76" Body="&lt;p&gt;Would there be any benefit to an investor to purchase an American Call option on a single share with no expiration date and a strike price of 0 as opposed to purchasing the underlying zero dividend stock instead, assuming both are the same price?  I see a potential benefit to owning the stock itself as having a (negligible) influence in the direction of the company as it may entitle you to vote in board elections and at the annual meetings, but is there any benefit to taking a step away from actual ownership while taking on an identical risk from a pure monetary standpoint?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming this is in the US, are there any tax advantages to holding an option as opposed to holding the underlying stock?&lt;/p&gt;&#xA;" OwnerUserId="22460" LastEditorUserId="22460" LastEditDate="2016-07-06T18:04:44.207" LastActivityDate="2016-07-06T20:53:39.670" Title="Equivalent call option to the underlying stock" Tags="&lt;american-options&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27960" PostTypeId="1" CreationDate="2016-07-06T18:42:03.407" Score="1" ViewCount="70" Body="&lt;p&gt;I'm trying to do multivariate distributions of returns on buckets where all the returns are at least 0.6 correlated at a 95% confidence level. I have the buckets, but their Sigmas cannot be decomposed and my random number generator fails.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What alternatives do I have? If I break the buckets up into smaller ones, I lose the correlation in the simulation. Or am I completely wrong? &lt;/p&gt;&#xA;" OwnerUserId="19473" LastActivityDate="2016-07-08T16:46:49.460" Title="Multivariate normal when Cholesky decomp fails on Sigma" Tags="&lt;multivariate&gt;&lt;cholesky&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27961" PostTypeId="2" ParentId="27958" CreationDate="2016-07-06T18:57:25.917" Score="1" Body="&lt;p&gt;In your question, you reduced your derivative to just a stock. No doubt, it is unlikely to have a derivative with zero strike price and never ending expiry. But let's assume it exists. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Keeping aside ownership advantage of owning of a stock [as mentioned by OP], from here, it is appear to be a dilemma between buying a stock or call. Theoretically, derivative prices are driven by underlying value, not the vice-versa. Therefore, price of derivative would only be influenced by volume in underlying, not from volume in derivative. It means that you can always buy or sell unlimited quantity of option at existing price [assuming no changes in underlying value]   without having any influence on stock price (and, also at option price) but such thing is unlikely to occur for stock. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In such a scenario, call option would assure more price certainty than the underlying stock. &lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorDisplayName="user16651" LastEditDate="2016-07-06T20:28:23.657" LastActivityDate="2016-07-06T20:28:23.657" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="27963" PostTypeId="2" ParentId="27958" CreationDate="2016-07-06T20:53:39.670" Score="0" Body="&lt;p&gt;As of time $t$, the price of an American call option struck at $K$ and expiring at $T $  is:&#xA;$$ V_t = \text{sup}_{\tau} E^\mathbb{Q} \left [  e^{-r(\tau-t)} (S_\tau - K)^+ \vert \mathcal {F}_t \right] $$&#xA;where $\tau$ figures a family of stopping times with values in $[t,T]$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now setting $K=0$ and letting $T \rightarrow \infty$ we have:&#xA;$$ V_t = \text{sup}_{\tau} E^\mathbb{Q} \left [  e^{-r(\tau-t)} S_\tau \vert \mathcal {F}_t \right] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming &lt;strong&gt;no dividends&lt;/strong&gt;: $e^{-rt} S_t = \frac {S_t}{B_t}$ is a $\mathbb{Q}$ martingale in the absence of arbitrage opportunities. In that case, the optimal stopping theorem states that:&#xA;\begin{align}&#xA;E^\mathbb{Q} \left [  e^{-r(\tau-t)} S_\tau \vert \mathcal {F}_t \right] &amp;amp;=  e^{rt} E^\mathbb{Q} \left [  e^{-r\tau} S_\tau \vert \mathcal {F}_t \right] \\&#xA;&amp;amp;= e^{rt} e^{-rt} S_t \\&#xA;&amp;amp;= S_t &#xA;\end{align}&#xA;Such that:&#xA;$$ V_t = S_t $$&#xA;in other words, holding the option is equivalent to holding the stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the real question is: what happens when you consider dividends? This is the game changer IMHO (holding the stock allows you to cash in the dividends, which you cannot do when holding the option). Remember that in that case $e^{(q-r)t} S_t$ is the $\mathbb {Q} $-martingale assuming a continuous div yield. If you consider discrete divs you should additionally be careful with your modelling assumptions (so that $(S_t)_{t \geq 0}$  remains positive, as it should)&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2016-07-06T20:53:39.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27966" PostTypeId="1" AcceptedAnswerId="27972" CreationDate="2016-07-07T03:03:45.700" Score="3" ViewCount="203" Body="&lt;p&gt;Working through an exercise in interest rate modelling and I have the following  setup:&#xA;$r_t = r_0 + \delta N_t$ where $\delta &amp;gt; 0$ and $\lambda &amp;gt; 0$ is the intensity of the Poisson pricess $N_t$. I want to calculate the bond price at time $0$, which is given by the formula&#xA;$$&#xA;B(0,T) = \mathbb{E}_{\mathbb{P}^*}\left( e^{-\int_0^T r_u \,du}\right) = e^{-r_0T}\mathbb{E}_{\mathbb{P}^*}\left( e^{-\delta \int_0^T N_u\,du}\right).&#xA;$$&#xA;where $\mathbb{P}^*$ is the risk-neutral probability measure. I haven't been dealing with Poisson processes lately and am not sure if there is a simple transformation or use of MGFs to get the second integral/expectation using properties of the Poisson process. I have tried to find some resources online but to no avail! Any help is appreciated. Thanks!&lt;/p&gt;&#xA;" OwnerUserId="20781" LastActivityDate="2016-07-08T12:17:02.913" Title="Bond price under Poissonian model of interest rate" Tags="&lt;interest-rates&gt;&lt;stochastic-processes&gt;&lt;bond&gt;&lt;poisson&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27967" PostTypeId="1" CreationDate="2016-07-07T05:47:18.803" Score="1" ViewCount="766" Body="&lt;p&gt;I first found out about &lt;a href=&quot;http://www.netfonds.no/&quot; rel=&quot;nofollow&quot;&gt;netfonds&lt;/a&gt; about a year ago but I hadn't ever really gotten around to actually pulling data from there. I spent a little time today figuring out a way to pull data and here is what I found.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously there is no free, flawless high frequency database available and this is the best thing I have ever seen. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally I would have someone who speaks Norwegian validate this but google translate will have to be the stand in for lack of a better option. &lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Exchange codes:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;NASDAQ: O&lt;/code&gt;&lt;br&gt;&#xA;&lt;code&gt;NYSE: N&lt;/code&gt;&lt;br&gt;&#xA;&lt;code&gt;AMEX: A&lt;/code&gt;&lt;br&gt;&#xA;&lt;code&gt;BATS: BTSE&lt;/code&gt; &lt;em&gt;this is Bats Europe so only euro stocks availible&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using these codes, you can access all of the currently traded symbols using this link:&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Exchange listings:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.netfonds.no/quotes/kurs.php?exchange=A&amp;amp;sectors=&quot; rel=&quot;nofollow&quot;&gt;http://www.netfonds.no/quotes/kurs.php?exchange=A&amp;amp;sectors=&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;This link will show you all of the available symbols that are currently being traded and are available for download.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Using those symbols you can pull 1S bid/ask and trade data.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Link to grab trades:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;http://hopey.netfonds.no/posdump.php?date=[YYYMMDD]&amp;amp;paper=[SymbolFromExchange].[ExchangeCode]&amp;amp;csv_format=csv&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Sample: SPY&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;time,price,quantity,source,buyer,seller,initiator&lt;br&gt;&#xA;             20160706T153000,207.83,600,Auto trade,,,&lt;br&gt;&#xA;20160706T153000,207.84,100,Auto trade,,,&lt;br&gt;&#xA;20160706T153000,207.835,100,Auto trade,,,&lt;br&gt;&#xA;20160706T153000,207.82,100,Auto trade,,,    &lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Link to grab bid/ask:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;http://hopey.netfonds.no/posdump.php?date=[YYYMMDD]&amp;amp;paper=[SymbolFromExchange].[ExchangeCode]&amp;amp;csv_format=csv&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Sample: SPY&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;time,bid,bid_depth,bid_depth_total,offer,offer_depth,offer_depth_total&#xA;20160706T011205,208.52,6400,6400,208.57,2600,2600&#xA;20160706T011257,208.54,6400,6400,208.6,3200,3200&#xA;20160706T011307,208.54,6400,6400,208.59,200,200&#xA;20160706T011316,208.57,3000,3000,208.59,200,200&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Notes:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;These links will not work unless you enter the proper information. They will provide data for the past 11 business days.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;US Market open is 0930, and open marked on Netfonds is 1530. Subtraction to get time would be even easier than having to mess with tz conversion in pandas or something like that.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Only the first four columns are available from trade dump.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Data doesn't appear to be adjusted for splits, mergers or dividends.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The trade dump doesn't seem like it is every trade, I assume it is just the trades accepted by the exchange that did't have to be adjusted or messed with.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;Questions&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;It appears that there is no pull for bid/ask or trades for symbols on NASDAQ, I was unable to get any of them to download. Is there something else that needs to be included to get that data?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Can you pull futures contracts or options from here, would be interested to figure out how to get those.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;-What are all of the exchange codes available. Is there a way to pull a list of them or get more than the ones I have listed above?&lt;/p&gt;&#xA;" OwnerUserId="17012" LastEditorUserId="743" LastEditDate="2016-10-31T19:39:29.593" LastActivityDate="2016-10-31T19:39:29.593" Title="Netfonds.no: Continuing to understand how to get high frequency data" Tags="&lt;equities&gt;&lt;market-data&gt;&lt;high-frequency&gt;&lt;historical-data&gt;&lt;tick-data&gt;" AnswerCount="0" CommentCount="1" ClosedDate="2020-04-23T06:31:28.197" ContentLicense="CC BY-SA 3.0" />
  <row Id="27968" PostTypeId="1" AcceptedAnswerId="27976" CreationDate="2016-07-07T08:02:54.740" Score="2" ViewCount="232" Body="&lt;p&gt;Let us denote by $c^A(t, S(t))$ the price, at time $t$ of a certain American-style derivative security, whose instrinsic value, at time $t$ is denoted by $V(t)$.From the no-arbitrage principle, we know that, at each time $t\in [0,T]$, we must have $c^A(t, S(t))\geq V(t)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us now denote by $c^E(t, S(t))$ the price of the European counterpart of the same derivative, having payoff $V(T)$ exercisable only at time $T$. In this case we know that the relation $c^E(t, S(t))\geq V(t)$, for $t\in [0,T]$ in general does not hold anymore: for example if the European derivative security is a put option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, my question is: suppose that, for a given European security, we actually have the relation  $c^E(t, S(t))\geq V(t)$, for all $t\in [0,T]$. Can we say that in this case the American derivative security is equivalent to its European counterpart? That is, can we conclude that  $c^E(t, S(t))=c^A(t, S(t))$, for all $t\in [0,T]$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is certainly the case for call options, where we have indeed that $c^E(t, S(t))\geq V(t)$, $t\in [0,T]$. But what about for other types of derivatives?&lt;/p&gt;&#xA;" OwnerUserId="11960" LastActivityDate="2016-07-07T20:05:34.887" Title="European vs American derivative securities, interesting question" Tags="&lt;arbitrage&gt;&lt;derivatives&gt;&lt;european&gt;&lt;american&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27969" PostTypeId="1" CreationDate="2016-07-07T08:11:46.437" Score="0" ViewCount="1420" Body="&lt;p&gt;I'm trying to use Bloomberg yield-to-maturity data for sets of sovereign bonds of different maturities to fit to a yield curve. I looked into using the QuantLib library (the FittedBondCurve functionality) but it seems to only take coupon &amp;amp; price data as input, to first bootstrap the bonds before calculating the zero rate yield curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way in Quantlib (or any other opensource code that I haven't yet found) to fit the curve (probably to Nelson Siegel) directly from yield-to-maturity data points? I'm using C++.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="22185" LastEditorUserId="308" LastEditDate="2016-07-07T10:21:19.127" LastActivityDate="2016-08-06T20:19:53.683" Title="Constructing yield curve directly from yield-to-maturity data" Tags="&lt;yield-curve&gt;&lt;bloomberg&gt;&lt;quantlib&gt;&lt;yield&gt;&lt;curve-fitting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27970" PostTypeId="1" CreationDate="2016-07-07T09:15:14.953" Score="1" ViewCount="50" Body="&lt;p&gt;Im looking for some kind of &lt;strong&gt;report&lt;/strong&gt; that would inculde data on the distribution of &lt;strong&gt;corporate loans&lt;/strong&gt; by types of interest(&lt;strong&gt;fixed/floating&lt;/strong&gt;), specifically &lt;strong&gt;global&lt;/strong&gt; not just for one country(developed, undeveloped, developing world). If any of you have known to stumble upon such reports would be grand.&lt;/p&gt;&#xA;" OwnerUserId="22468" LastEditorUserId="848" LastEditDate="2016-07-08T19:22:56.887" LastActivityDate="2016-07-08T19:22:56.887" Title="Distribution of loans by types of interest" Tags="&lt;data&gt;&lt;statistics&gt;&lt;floating-rate&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27972" PostTypeId="2" ParentId="27966" CreationDate="2016-07-07T10:24:13.693" Score="4" Body="&lt;p&gt;Let $$Y_t = \int_0^t N_u du$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $(N_t)_{t \geq 0}$ figures a Poisson process with intensity $\lambda$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the stochastic Fubini theorem we have that:&#xA;\begin{align}&#xA;Y_T &amp;amp;= \int_0^T N_t dt \\&#xA;&amp;amp;= \int_0^T \int_0^t dN_u dt \\&#xA;&amp;amp;\color{lightgray}{= \int_0^T \int_0^T \mathbf{1}\{u \in [0,t]\} dN_u\ dt} \\&#xA;&amp;amp;\color{lightgray}{= \int_0^T \int_0^T \mathbf{1}\{u \in [0,t]\} dt\ dN_u} \\&#xA;&amp;amp;\color{lightgray}{= \int_0^T \int_0^T \mathbf{1}\{t \in [u,T]\} dt dN_u} \\&#xA;&amp;amp;= \int_0^T \int_u^T dt dN_u \\&#xA;&amp;amp;= \int_0^T (T-u) dN_u \\&#xA;&amp;amp;= \sum_{i=1}^{N_T} (T-T_i) \tag{0}&#xA;\end{align}&#xA;where $T_i$ figures the $i^{th}$ Poisson process jump time, which is Gamma distributed with integer parameter $i$ (also known as Erlang distribution see &lt;a href=&quot;http://www.ntu.edu.sg/home/nprivault/MA5182/stochastic-calculus-jump-processes.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; Proposition 15.2 for instance). The jump times $T_i$ are therefore not unconditionally i.i.d. and $Y_t$ cannot be seen as a usual compound Poisson process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, conditioning helps! Indeed, conditionally on the number of jumps $N_T = n$ one can show that the $n$ jump times $\{T_i\}_{i=1}^n$ are actually independently and identically distributed uniformly over $[0,T]$ (see reference &lt;a href=&quot;http://www.ntu.edu.sg/home/nprivault/MA5182/stochastic-calculus-jump-processes.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; top of page 443), that is&#xA;\begin{align}&#xA;T_i\ \vert\ N_T=n \ \ &amp;amp;\sim\ \ T U_i\\&#xA;\{U_i\}_{i=1}^n  \ &amp;amp;\sim\ \ \mathcal{U}[0,1] \ \ \text{i.i.d.}&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We then have:&#xA;\begin{align}&#xA;\mathbb{E} \left[e^{-\delta Y_T} \vert \mathcal{F}_0 \right] &amp;amp;= \mathbb{E} \left[ \left. \exp\left(-\delta \sum_{i=1}^{N_T} (T-T_i)\right) \right\vert \mathcal{F}_0 \right] \tag{1} \\&#xA;&amp;amp;= \mathbb{E} \left[ \left. \mathbb{E} \left[ \left. \exp\left(-\delta \sum_{i=1}^{N_T} (T-T_i)\right) \right\vert \mathcal{F}_T \right] \right\vert \mathcal{F}_0 \right] \tag{2} \\&#xA;&amp;amp;= \mathbb{E} \left[ \left. \mathbb{E} \left[ \left. \exp\left(-\delta T \sum_{i=1}^{N_T} (1-U_i) \right) \right\vert \mathcal{F}_T \right] \right\vert \mathcal{F}_0 \right] \tag{3} \\&#xA;&amp;amp;= \sum_{n=0}^\infty \mathbb{E} \left[ \exp\left(-\delta T \sum_{i=1}^{n} \tilde{U}_i \right) \right] \mathbb{P}^*\left( N_T = n \right) \tag{4}\\&#xA;&amp;amp;= e^{-\lambda T} \sum_{n=0}^\infty \frac{(\lambda T)^n}{n!} \mathbb{E} \left[ \exp\left(-\delta T \sum_{i=1}^{n} \tilde{U}_i \right) \right] \tag{5} \\&#xA;&amp;amp;= e^{-\lambda T} \sum_{n=0}^\infty \frac{(\lambda T)^n}{n!} \prod_{i=1}^n \mathbb{E} \left[   \exp\left(-\delta T \tilde{U}_i \right) \right] \tag{6} \\&#xA;&amp;amp;= e^{-\lambda T} \sum_{n=0}^\infty \frac{(\lambda T)^n}{n!} \left(\mathbb{E} \left[ \exp\left(-\delta T \tilde{U}_1 \right) \right]\right)^n \tag{7} \\&#xA;&amp;amp;= \exp(-\lambda T) \exp\left(\lambda T \mathbb{E} \left[ \exp\left(-\delta T \tilde{U}_1 \right) \right] \right) \tag{8} \\&#xA;&amp;amp;= \exp\left(\lambda T \left(\mathbb{E} \left[ \exp\left(-\delta T \tilde{U}_1 \right) \right] - 1 \right) \right)   \tag{9}&#xA;\end{align}&#xA;where $\tilde{U}_i = 1-U_i$ are also $\mathcal{U}[0,1]$ i.i.d. by construction and we used:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Def. of $Y_T \vert \mathcal{F}_0 = \int_0^T N_u du = \sum_{i=1}^{N_T} (T-T_i)$ see $(0)$&lt;/li&gt;&#xA;&lt;li&gt;Tower property of conditional expectation&lt;/li&gt;&#xA;&lt;li&gt;Conditionally on $N_T$ the Poisson jump times are i.i.d. $\mathcal{U}[0,T]$&lt;/li&gt;&#xA;&lt;li&gt;Expectation over $N_T \vert \mathcal{F}_0$&lt;/li&gt;&#xA;&lt;li&gt;Def. of Poisson Process $(N_t)_{t \geq 0}$&lt;/li&gt;&#xA;&lt;li&gt;Properties of $\exp(.)$ + $\{\tilde{U}_i\}_{i=1}^n$ independent&lt;/li&gt;&#xA;&lt;li&gt;$\{\tilde{U}_i\}_{i=1}^n$ identically distributed&lt;/li&gt;&#xA;&lt;li&gt;Series expansion of $\exp(.)$&lt;/li&gt;&#xA;&lt;li&gt;Properties of $\exp(.)$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Now all you need to do is compute $Z = \mathbb{E}[\exp\left(-\delta T U \right)]$  with $U \sim \mathcal{U}[0,1]$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;Z &amp;amp;= \mathbb{E}[\exp\left(-\delta T U \right)] \\&#xA;&amp;amp;= \int_{0}^1 \exp\left(-\delta T u \right) \underbrace{p^*(u)}_{\mathbf{1}\{u \in [0,1]\}} du \\&#xA;&amp;amp;= \left[ \frac{\exp\left(-\delta T u \right)}{-\delta T} \right]_0^1 \\&#xA;&amp;amp;= \frac{1 - e^{-\delta T}}{\delta T}&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will then be able to write:&#xA;$$ e^{-r_0T}\mathbb{E}^{\mathbb{P}^*}\left[ e^{-\delta \int_0^T N_u\,du} \vert \mathcal{F}_0 \right] = \exp\left(-r_0T + \lambda T\left(\frac{1 - e^{-\delta T}}{\delta T}-1\right)\right) $$&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-07-08T12:17:02.913" LastActivityDate="2016-07-08T12:17:02.913" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="27974" PostTypeId="2" ParentId="27968" CreationDate="2016-07-07T12:15:42.253" Score="1" Body="&lt;p&gt;The European call price converges to zero as the underlying price converges to zero, reflecting the vanishing probability of exercise.At the other extreme, the European call price converges to the discounted value of the difference between the asset price and the strike.For intuition note that the&#xA;probability of exercise converges to one as $S_t$ becomes large and therefore&#xA;that the call value converges to the present value of $S_T - K$. As the call price is non-negative and the call payoff dominates $S_T - K$, we also have the lower bound&#xA;$$\color{green}{C_E(S,t)\ge (S_t e^{-q\tau}-K e^{-r\tau})^+}$$&#xA;&lt;a href=&quot;https://i.stack.imgur.com/tqWsL.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/tqWsL.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let we Consider an American-style call option with exercise price $K &amp;gt; 0$ and maturity date $T$, written on an underlying asset whose price $S$ satisfies the stochastic differential equation (under the risk neutral measure) &#xA;$$dS_t=(r-q)S_tdt+\sigma S_t dW_t\mathbb{^{Q}}$$Here $r$, $q$ and $\sigma$ are constant parameters: the price is a geometric Brownian motion (GBM) process. As exercise cannot be optimal when $S&amp;lt;K$ it has become customary to write the option payoff in the form $V=(S-K)^+$ Our first objective is to characterize the structure of the exercise region and its boundary. Given that the environment is Markovian, the state of nature is completely described by the asset price S and the pair $(S, t)$ contains all the&#xA;information required for pricing and decision-making purposes. Let $C (S, t)$ be the option price at the point $(S, t)$. The immediate exercise region, denoted by $D$, is the set of pairs $(S, t)$ at which immediate exercise is an optimal policy.That is&#xA;$$\color{green}{D=\{(S,t)\in\mathbb{R}^+\times[0,T]: C(S,t)=(S-K)^+\}}$$&#xA;Its complement&#xA;$$\color{green}{ D^c=\{(S,t)\in\mathbb{R}^+\times[0,T]: C(S,t)&amp;gt;(S-K)^+\}}$$&#xA;is the&#xA;continuation region, i.e., the set of prices-dates at which immediate exercise is sub-optimal. Now we describes elementary properties of the exercise region. We can say &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$C_A(S,t)$ is continuous on $\mathbb{R}^+\times[0,T]$.&lt;/li&gt;&#xA;&lt;li&gt;$C_A(.,t)$ is non-decreasing and convex on $[0,T]$ for all $t\in[0,T]$.&lt;/li&gt;&#xA;&lt;li&gt;$C_A (S,.)$ is non-increasing on $[0, T]$ for all $S \in \mathbb{R}^+$.&lt;/li&gt;&#xA;&lt;li&gt;$0\le \frac{\partial C(S,t)}{\partial S}\le 1$ on $\mathbb{R}^+\times[0,T]$&lt;/li&gt;&#xA;&lt;li&gt;$\frac{\partial C(S,t)}{\partial S}= 1$ for every $(S,t)\in D^c$&#xA;&lt;a href=&quot;https://i.stack.imgur.com/BazZ6.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/BazZ6.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;http://rfs.oxfordjournals.org/content/3/4/547.short&quot; rel=&quot;nofollow noreferrer&quot;&gt;kim(1990)&lt;/a&gt;, &lt;a href=&quot;http://engineering.nyu.edu/files/slsg.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;carr, Jarrow and Myneni (1992)&lt;/a&gt; show for $t\in[0,T]$&#xA;$$\color{green}{C_A(S,t)=C_E(S,t)+\pi(S,t,B(.))}$$ &#xA;where $\pi(S,t,B(.))$ is the early exercise premium is given by &#xA;$$\pi=\int_{t}^{T}(q S_t e^{-\delta(s-t)}N(d_1(S_t,B_s,s-t))-rKe^{-r(s-t)}N(d_2(S_t,B_s,s-t))ds$$&#xA;such that&#xA;$$d_1=\frac{\ln\left(\frac{S_t}{B_s}\right)+(r-q+\frac{1}{2}\sigma^2)(t-s)}{\sigma\sqrt{s-t}}$$&#xA;$$d_2=d_1-\sqrt{s-t}$$&#xA;The immediate exercise boundary $B$ solves the recursive non-linear integral&#xA;equation&#xA;$$B_t-K=C_E(B_t,t)+\pi(B_t,t,B(.))$$&#xA;for $t \in [0, T)$, subject to the boundary condition $$B_{T^{-}}=\max\{K,\frac{r}{q}K\}$$ and $$B_T=K\le B_{T^{-}}.$$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Finally because American options offer more exercise opportunities&#xA;  they therefore have higher values than the European options. In the&#xA;  absence of dividends($q=0$) the American call price is the same as the&#xA;  European one, since the optimal exercise policy for such an option is&#xA;  not to exercise.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-07-07T14:06:07.207" LastActivityDate="2016-07-07T14:06:07.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27976" PostTypeId="2" ParentId="27968" CreationDate="2016-07-07T13:33:02.190" Score="3" Body="&lt;p&gt;Consider two options with maturity $T$ that only differ in their exercise styles, one being European (holder can only exercise at $T $), the other American (holder exercises when it's best for him/her). These options need not necessarily be vanilla options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us further denote by $I (S_t) $ the intrinsic value of these contigent claims at time $t $, i.e. the value that the holder would get by exercising at $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your question then translates to&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Assuming that $\forall t \in [0,T]$, the following inequality holds&#xA;  $$ V^E(t,S_t) \geq I(S_t) \tag{A} $$ &#xA;  does that imply the following equality&#xA;  $$ V^A(t,S_t) = V^E(t,S_t) \tag{B} $$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Proof $(B) \Rightarrow (A)$&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The proof is straightforward.&#xA;Indeed, as you've stated in your question the $t$-value of an American option is always greater than the intrinsic value at time $t$: $V^A(t,S_t) \geq I(S_t)$ while by $(B)$ $V^A(t,S_t)=V^E(t,S_t)$. The former inequality comes from the fact that immediate exercise is merely one of the many stopping strategies that the holder of an American option could resolve to and he/she is expected to pick the one which maximises his/her gains.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Proof $(A) \Rightarrow (B)$&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Starting from the definition of the American option&#xA;\begin{align}&#xA;V^A(t,S_t) &amp;amp;= \text{sup}_{\tau \in [t,T]} \mathbb{E}_t^\mathbb{Q}\left[ e^{-r(\tau-t)} I(S_\tau) \right] \tag{1}&#xA;\end{align}&#xA;where $\tau$ represents a family of stopping times with values in $[t,T]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume that $(A)$ holds i.e. $I(S_t) \leq V^E(t,S_t), \forall t \in [0,T]$. In that case from equation $(1)$, we can write that&#xA;\begin{align}&#xA;V^A(t,S_t) &amp;amp;\leq \text{sup}_{\tau \in [t,T]} \mathbb{E}_t^\mathbb{Q}\left[ e^{-r(\tau-t)} V^E(\tau,S_\tau) \right] \tag{2} \\&#xA;\end{align} &#xA;by linearity of the expectation operator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, noting that in the absence of arbitrage $\frac{V^E(t,S_t)}{B_t}$ should emerge as a $\mathbb{Q}$-martingale (remember that $V^E(t,S_t)$ is a tradable asset), with $B_t$ the $t$-value of the risk-free money market account, the optimal sampling theorem gives:&#xA;\begin{align}&#xA;\mathbb{E}_t^\mathbb{Q}\left[ e^{-r(\tau-t)} V^E(\tau,S_\tau) \right] &amp;amp;= e^{rt} \mathbb{E}_t^\mathbb{Q} \left[ \frac{V^E(\tau,S_\tau)}{B_\tau} \right] \\&#xA;&amp;amp;= e^{rt}\frac{V^E(t,S_t)}{B_t} \\&#xA;&amp;amp;= V^E(t,S_t)&#xA;\end{align}&#xA;hence $(2)$ becomes&#xA;\begin{align}&#xA;V^A(t,S_t) &amp;amp;\leq \text{sup}_{\tau \in [t,T]} V^E(t,S_t) = V^E(t,S_t) \tag{I1} \\&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand we have that &#xA;$$ V^A(t,S_t) \geq V^E(t,S_t) \tag{I2} $$&#xA;i.e. the $t$-value of an American option is always greater than the $t$-value of its European counterpart. This is because European exercise at expiry  is merely one of the many stopping strategies that the holder of an American option could resolve to and he/she is expected to pick the one which maximises his/her gains.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Combining inequalities $(I1)$ and $(I2)$ then trivially yields:&#xA;$$ V^A(t,S_t) = V^E(t,S_t) $$&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-07-07T20:05:34.887" LastActivityDate="2016-07-07T20:05:34.887" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="27978" PostTypeId="1" CreationDate="2016-07-07T18:50:18.233" Score="2" ViewCount="101" Body="&lt;p&gt;I was thinking of examining how the constituent companies of the s&amp;amp;p500 are affected by sentiment in crises. Is there any way to download stock prices for all the companies?&#xA;Moreover how can I split the companies into value or growth stocks so as to show how investors react in crises? if they tend to prefer value stocks vs growth stocks.&#xA;Thanks in advance&#xA;Jay&lt;/p&gt;&#xA;" OwnerUserId="19623" LastActivityDate="2016-07-07T19:39:14.787" Title="s&amp;p500 companies value vs growth" Tags="&lt;equities&gt;&lt;returns&gt;&lt;research&gt;&lt;spx&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27979" PostTypeId="1" AcceptedAnswerId="27983" CreationDate="2016-07-07T19:06:33.487" Score="2" ViewCount="155" Body="&lt;p&gt;Let&#xA;$$dr_t=(\alpha(t)-\beta r_t)dt+\sigma   dW_t$$&#xA;where $\alpha$ is non stochastic process and $\beta$ and $\sigma$ are constant.&#xA;Can we write process $r_t$ in the form&#xA;$$r_t=x_t+y_t$$&#xA;where the process $x_t$ satisfies&#xA;$$dx_t=-\beta x_t dt+\sigma dW_t$$&#xA;and $y_t$ be a deterministic function. I used Ito's lemma but was not useful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advanced. &lt;/p&gt;&#xA;" OwnerUserId="20945" LastActivityDate="2016-07-08T13:23:26.230" Title="stochastic interest rate $r_t=x_t+y_t$" Tags="&lt;interest-rates&gt;&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27980" PostTypeId="2" ParentId="27978" CreationDate="2016-07-07T19:32:55.070" Score="2" Body="&lt;p&gt;If you're looking for S&amp;amp;P 500 stock prices, yahoo finance is usually a good source. If you're looking for all of them together &lt;a href=&quot;https://github.com/datasets/s-and-p-500-companies&quot; rel=&quot;nofollow&quot;&gt;datasets&lt;/a&gt; are available on github.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're looking to split between value vs growth you can use any general equity research firm to create the split between growth and value, otherwise use a broad definition from a site like &lt;a href=&quot;https://us.axa.com/axa-products/investment-strategies/articles/growth-vs-value-stock-selection.html&quot; rel=&quot;nofollow&quot;&gt;AXA&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally you will want to identify crisis periods, using something like &lt;a href=&quot;http://www.nber.org/cycles.html&quot; rel=&quot;nofollow&quot;&gt;NBER&lt;/a&gt; to identify US recessions.&lt;/p&gt;&#xA;" OwnerUserId="17175" LastActivityDate="2016-07-07T19:32:55.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27981" PostTypeId="2" ParentId="27978" CreationDate="2016-07-07T19:39:14.787" Score="2" Body="&lt;p&gt;Multiple stock databases hold this data, but none of them are free. If you are in an academic setting, see if your university has a subscription to CRSP. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to split it yourself, you can use different cutoff points for P/E. High P/E = growth, low P/E = value. &lt;/p&gt;&#xA;" OwnerUserId="19473" LastActivityDate="2016-07-07T19:39:14.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27982" PostTypeId="2" ParentId="27969" CreationDate="2016-07-07T20:02:34.910" Score="4" Body="&lt;p&gt;Unless all of your yields are par yields (yield of bonds trading at par), you'll get very unreliable results if you fit your curve using yields alone. This is because yields can be distorted by the coupon effect – given two bonds maturing on the same day and assuming the yield curve is upward sloping, a higher coupon bond will always have lower yield.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you should do is to get the actual bonds (hence their coupon rates and maturity dates) and their prices (or yields, which can be easily converted into prices), and go from there.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2016-07-07T20:02:34.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27983" PostTypeId="2" ParentId="27979" CreationDate="2016-07-07T22:50:00.677" Score="2" Body="&lt;p&gt;By the usual integrating factor method,&#xA;\begin{align*}&#xA;r_t = r_0e^{-\beta t} + \int_0^t \alpha(s) e^{-\beta(t-s)}ds +\sigma \int_0^t e^{-\beta(t-s)}dW_s.&#xA;\end{align*}&#xA;Let&#xA;\begin{align*}&#xA;x_t &amp;amp;=\sigma \int_0^t e^{-\beta(t-s)}dW_s, \textrm { and}\\ &#xA;y_t &amp;amp;=r_0e^{-\beta t} + \int_0^t \alpha(s) e^{-\beta(t-s)}ds.&#xA;\end{align*}&#xA;Then $r_t = x_t + y_t$, moreover,&#xA;\begin{align*}&#xA;dx_t &amp;amp;= d\left(\sigma e^{-\beta t} \int_0^t e^{\beta s}dW_s \right)\\&#xA;&amp;amp;=-\beta \left(\sigma e^{-\beta t} \int_0^t e^{\beta s}dW_s\right)dt + \sigma dW_t\\&#xA;&amp;amp;=-\beta x_t dt + \sigma dW_t,&#xA;\end{align*}&#xA;and $y_t$ is a deterministic function.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-07-08T13:23:26.230" LastActivityDate="2016-07-08T13:23:26.230" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27984" PostTypeId="2" ParentId="23242" CreationDate="2016-07-08T07:08:00.683" Score="2" Body="&lt;p&gt;I don't have perfect solution for above problem, I but can help you out with the alternative. As far as my information you can't download the data country wise. I was also looking for the same. You should have all the symbols first in place. I have prepared a small code which loop through the all available symbols and get historical data from Yahoo.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quantmod)&#xA;startDate = &quot;2000-01-01&quot;&#xA;thePath = &quot; * &quot;&#xA;source(paste(thePath,&quot;code\\listOfInstruments.r&quot;,sep=&quot;&quot;))&#xA;&#xA;for (ii in theInstruments){&#xA;  print(ii)&#xA;  data = getSymbols(Symbols = ii, &#xA;                    src = &quot;yahoo&quot;, &#xA;                    from = startDate, &#xA;                    auto.assign = FALSE)&#xA;  colnames(data) = c(&quot;open&quot;,&quot;high&quot;,&quot;low&quot;,&quot;close&quot;,&quot;volume&quot;,&quot;adj.&quot;)&#xA;  write.zoo(data,paste(thePath,ii,&quot;.csv&quot;,sep=&quot;&quot;),sep=&quot;,&quot;,row.names=FALSE)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Regarding symbols that you can easily download from exchange and save it, It's a one time job. Rest you can use the above code to get the data life long. I have created database using above code only.&lt;/p&gt;&#xA;" OwnerUserId="20303" LastEditorUserId="20303" LastEditDate="2016-07-08T10:51:13.527" LastActivityDate="2016-07-08T10:51:13.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27985" PostTypeId="1" CreationDate="2016-07-08T07:30:09.340" Score="0" ViewCount="111" Body="&lt;p&gt;I have gathered a lot of experience using min-var optimization of the form&#xA;$$&#xA;w' \Sigma w \rightarrow Min,&#xA;$$&#xA;where $w$ are the weights of the assets and $\Sigma$ is the covariance matrix. Of course we have to take care to use a meaningful $\Sigma$ and we need a lot of constraints in real life.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, assume we have calculated a set of scores (e.g. momentum over the last 2 months) or P/B ratio which can be ranked (the higher the better, transform if necessary). What are practical approaches to add this to the objective in the above problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something like &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;a (w' \Sigma w) - b(scores) \rightarrow Min&#xA;$$&#xA;with some constants $a,b&amp;gt;0$. But wouldn't it be really difficult to choose $a$ and $b$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would you approach this? Are there reference on the web?&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-07-09T19:37:20.083" Title="Including a score or a rank in portfolio-optimization" Tags="&lt;portfolio-optimization&gt;&lt;portfolio-selection&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27986" PostTypeId="1" CreationDate="2016-07-08T07:42:16.130" Score="1" ViewCount="119" Body="&lt;p&gt;When computing the volatility on the adjusted stocks' prices, would the resulting volatility be mean-reverting? I believe that the volatility of the log returns is mean reverting, but I am not certain about the prices. The returns are basically a first difference of the prices, so they are stationary; but that is not the case with the non-stationary price time series. Would stationarity play a role in mean reversion anyway?&lt;/p&gt;&#xA;" OwnerUserId="18251" LastActivityDate="2016-07-08T07:42:16.130" Title="Volatility of the adjusted prices mean reversion" Tags="&lt;volatility&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="27988" PostTypeId="2" ParentId="25959" CreationDate="2016-07-08T10:40:51.860" Score="1" Body="&lt;p&gt;You can use leverage. Broker neutral means the trading system is provided by an independent vendor that will connect to any broker that you require. You are their client, and they are not affiliated or loyal to a specific broker.&lt;/p&gt;&#xA;" OwnerUserId="22474" LastActivityDate="2016-07-08T10:40:51.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27989" PostTypeId="2" ParentId="22150" CreationDate="2016-07-08T14:23:22.903" Score="2" Body="&lt;p&gt;&lt;strong&gt;Hint&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By application of Ito's lemma, we have &#xA;$$d(e^{kt}v_t)=\kappa e^{\kappa t}v_t\,dt+e^{\kappa t}dv_t+d(e^{\kappa t})dv_t$$&#xA;therefore&#xA;$$v_t=v_0e^{-\kappa t}+\theta(1-e^{-\kappa t})+\sigma\int_{0}^{t}\sqrt{v_s}e^{-\kappa(t-s)}dB_{s}^{v}+\int_{0}^{t}e^{-\kappa(t-s)}J^v\,dN_{s}$$&#xA;$J_v$ is random jump size occurring at time $t_i$  and $N_t=N_t-N_0$ is the total number of jumps in the times interval $(0,t]$, therefore&#xA; $$v_t=v_0e^{-\kappa t}+\theta(1-e^{-\kappa t})+\sigma\int_{0}^{t}\sqrt{v_t}e^{-\kappa(t-s)}dB_{s}^{v}+\sum\limits_{i=1}^{N_t}e^{-\kappa(t-t_i)}J_{i}^{v}$$&#xA;$$\int_{0}^{T}v_tdt=\frac{v_0}{\kappa}\left(1-e^{-\kappa T}\right)+\frac{\theta}{\kappa}\left(-1+\kappa T+e^{-\kappa T}\right)+\frac{1}{\kappa}\left(1-e^{-\kappa T}\right)\sum\limits_{i=1}^{N_t}e^{\kappa t_i}J_{i}^{v}\\&#xA;\qquad\,\,\,+\sigma\int_{0}^{T}\int_{0}^{t}\sqrt{v_t}e^{-\kappa(t-s)}dB_{s}^{v} dt$$&#xA;and&#xA;$$\frac{1}{T}\int_{0}^{T}v_tdt=\frac{v_0}{\kappa T}\left(1-e^{-\kappa T}\right)+\frac{\theta}{\kappa T}\left(-1+\kappa T+e^{-\kappa T}\right)+\frac{1}{\kappa T}\left(1-e^{-\kappa T}\right)\sum\limits_{i=1}^{N_t}e^{\kappa t_i}J_{i}^{v}\\&#xA;\qquad\,\,\,+\frac{\sigma}{T}\int_{0}^{T}\int_{0}^{t}\sqrt{v_t}e^{-\kappa(t-s)}dB_{s}^{v} dt&#xA;$$&#xA;Now you should calculate&#xA;$$\mathbb{E}\left[\sum\limits_{i=1}^{N_t}e^{\kappa t_i}J_{i}^{v}\right]$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-07-08T14:41:39.960" LastActivityDate="2016-07-08T14:41:39.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27990" PostTypeId="2" ParentId="27960" CreationDate="2016-07-08T16:46:49.460" Score="1" Body="&lt;p&gt;You need to adjust your correlation matrix such that it becomes positive definite.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is an R routine that will do this for you - &lt;a href=&quot;https://stat.ethz.ch/R-manual/R-devel/library/Matrix/html/nearPD.html&quot; rel=&quot;nofollow&quot;&gt;link&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or, if you want to do it yourself, i believe the general method is to do an eigen value decomposition, set any negative eigenvalues to zero, and then reconstruct the original matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're going to go down this route though, it works better to obtain your $\Sigma^\frac{1}{2}$ matrix using the EVD rather than cholesky.&lt;/p&gt;&#xA;" OwnerUserId="19663" LastActivityDate="2016-07-08T16:46:49.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27992" PostTypeId="1" AcceptedAnswerId="28014" CreationDate="2016-07-09T01:21:06.367" Score="1" ViewCount="316" Body="&lt;p&gt;What are the initial and boundary conditions for a Butterfly Option? I want to write up a PDE program for it and I have a rough idea of what the payoff should be (is it just a call and a put at the strike price?) but if anyone can provide me with definitive answers then I'd greatly appreciate it. In particular, I'm after stuff like the time $T$ boundary condition (which is usually the option payoff and taken as the initial condition) which is written as $u(T,x)$, the boundary condition as $x \rightarrow 0$  i.e. $\lim_{x\rightarrow 0} u(t,x)$ (which I think should be equal to $0$) and the boundary condition as $x \rightarrow \infty$ i.e. $\lim_{x\rightarrow \infty} u(t,x)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On a related note, I'm new to financial mathematics and every time I need to look for the conditions for options other than a call option I usually find it incredibly difficult (I have to google search everything for nearly an hour to find something relevant it seems). Does anyone have a resource which provides the initial and boundary conditions for a range of options?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Okay, a quick search showed me that the payoff to a Butterfly Spread is $(S - K_c)^+ + (K_{p} - S)^+ - (S - K_{atm})^+ - (K_{atm} - S)^+$ where $K_{atm} = \frac{K_c + K_p}{2}$, however, I still don't know what the boundary conditions are, can someone tell me what they are (and hopefully even how to derive them?) Thanks!&lt;/p&gt;&#xA;" OwnerUserId="20543" LastEditorUserId="20543" LastEditDate="2016-07-09T01:43:20.490" LastActivityDate="2016-07-11T09:34:04.537" Title="Initial/Boundary Conditions for a Butterfly Option?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;finance-mathematics&gt;&lt;black-scholes-pde&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27993" PostTypeId="1" AcceptedAnswerId="28160" CreationDate="2016-07-09T01:52:28.200" Score="7" ViewCount="501" Body="&lt;p&gt;In &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.592.2043&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow&quot;&gt;Half of a Coin: Negative Probabilities&lt;/a&gt;, the author mentions bond duration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose we have payments at times $t = 1,2,...,n$ denoted respectively by $R_1, R_2, ..., R_n$ and the discount factor is $v = \frac{1}{1+i}$ where $i$ is effective interest rate. Then the bond value today is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$B = \sum_{t=1}^{n} R_tv^t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The bond duration is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$D = \frac{\sum_{t=1}^{n} tR_tv^t}{\sum_{t=1}^{n} R_tv^t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can be seen that $$D = E[T]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$T$ is a random variable with range $t = 1,2,...,n$ each having probability $\frac{R_t v^t}{B}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The author says something like we can have negative probabilities if we have negative $R_t$'s. So this is a kind of bond where instead of making a payment we get a certain amount of money? Is there such a thing? Or is that only in theory?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there another way we can have negative probabilities when it comes to bonds?&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="7788" LastEditDate="2016-07-20T03:41:17.430" LastActivityDate="2016-07-20T07:54:22.890" Title="How can we have negative probabilities in finance? Can we have negative payments in bonds? If not, how else can we have negative probabilities?" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;probability&gt;&lt;duration&gt;&lt;quasiprobability&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27994" PostTypeId="1" AcceptedAnswerId="28033" CreationDate="2016-07-09T10:08:28.497" Score="0" ViewCount="85" Body="&lt;p&gt;I have FIX/FAST data in CSV format. Sample: &#xA;1128=9|9=131|35=f|49=CME|34=5369745|52=20160314214500017847063|60=20160314214500001317818|75=20160315.....&#xA;I need to transfer information into SQL table with tags as names of the fields and&#xA;values as data. Can you advise any free or commercial software which could do this?&lt;/p&gt;&#xA;" OwnerUserId="22484" LastActivityDate="2016-07-12T07:28:13.763" Title="FIX/FAST to SQL table" Tags="&lt;fix&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27995" PostTypeId="1" CreationDate="2016-07-09T10:57:39.310" Score="2" ViewCount="13587" Body="&lt;p&gt;There seems to be a thin line between risk transfer and risk sharing. Can someone explain with example how can this be differentiated?&lt;/p&gt;&#xA;" OwnerUserId="22485" LastEditorUserId="16991" LastEditDate="2016-07-09T17:08:24.817" LastActivityDate="2017-06-05T13:56:39.290" Title="Difference between Risk Transfer and Risk Sharing" Tags="&lt;risk&gt;&lt;risk-management&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27996" PostTypeId="1" CreationDate="2016-07-09T11:15:17.410" Score="1" ViewCount="122" Body="&lt;p&gt;I am working on my dissertation and i would like to provide a nice interpretation of two tables which i will present below. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have 10 portfolio buckets which i sort on 6 different attributes. One of these attributes is return. I take the measurement at time &quot;t&quot; and I proceed to simulate the investment at &quot;t+1&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first table represent mean and returns if the investment was to be simulated at time &quot;t&quot;. in other words it shows my return distribution on the day i take the measurement. This is presented below: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/AmVMp.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/AmVMp.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As u can see bucket bucket 1 has the lowest returns on the day i take the measurement. These increase as i approach bucket 10. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below i show you the statistics of the same 10 portfolios for the actual investment day. (t+1) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/6WiLm.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/6WiLm.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Stats has never been my forte. I am not asking for a full interpretation however a few pointers to get me started would be very useful. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;for the curious, not accounting for insanely large transaction costs, bucket 1 generates a CAPM alpha of 29.8% a year. this perfectly decreases at we approach bucket 10. &lt;/p&gt;&#xA;" OwnerUserId="17895" LastActivityDate="2016-07-09T11:15:17.410" Title="Interpretation of Skew and Kurtoisis - strategy backtesting" Tags="&lt;distribution&gt;&lt;mean&gt;&lt;skewness&gt;&lt;kurtosis&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27997" PostTypeId="1" AcceptedAnswerId="28005" CreationDate="2016-07-09T11:51:54.000" Score="4" ViewCount="1559" Body="&lt;p&gt;I'm trying to code the Hull White stochastic volatility model using matlab and somewhere my code seems to mess up. I've coded the SABR model as well and that's working fine. When I compare prices obtained between my two models, there seems to be a linear relationship (which is what I expect if I've done the Hull White correctly). &#xA;&lt;a href=&quot;https://i.stack.imgur.com/UQlEV.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/UQlEV.jpg&quot; alt=&quot;Hull White SABR price comparison&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I produce implied volatility smiles for the Hull White, it looks something like this: &#xA;&lt;a href=&quot;https://i.stack.imgur.com/YT0Dc.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/YT0Dc.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using the pricing formula for the Hull White model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/RpFED.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/RpFED.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the procedure I'm following for my code:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Simulate Paths of sigma using the Milstein scheme for discretising an SDE&lt;/li&gt;&#xA;&lt;li&gt;Average points at each time incriment for all the simulations and compute \bar{V}.&lt;/li&gt;&#xA;&lt;li&gt;Find the Black Scholes Price&lt;/li&gt;&#xA;&lt;li&gt;Compute Implied Volatility.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;It's definitely going wrong somewhere so if anyone has the time to look through my code I'd be soo grateful! thanks in advance&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function [Imp_Vol, Price] = Hull_White(S0, K, r, sigma0,gamma,alpha, T, M)&#xA;&#xA;&#xA;%   Monte Carlo European Call Option with Local Volatility using the Milstein Scheme. &#xA;%   S0 - Underlying price at T=0&#xA;%   K - Strike Price&#xA;%   T - Time to Maturity in Years (please input uniform decimals ie 1.5,&#xA;%   2.9)&#xA;%   r - Interest rate&#xA;%   sigma0 - Volatility&#xA;%   gamma - Variable in Hull White model&#xA;%   alpha - Variable in Hull White model&#xA;%   M - Number of Monte Carlo Simulations &#xA;%   Output price - corrosponding option price&#xA;&#xA;N=floor(T*260); % Days to maturity&#xA;&#xA;dt=1/260; % incriment for descretization&#xA;&#xA;sigma_path = zeros(N,M);&#xA;&#xA;for j=1:M % starting the Monte Carlo Simulations&#xA;&#xA;    Z=randn(N,1);  % N random numbers to approximate dWi&#xA;    sigma=zeros(N,1); % initialising the volatility path vector&#xA;&#xA;    sigma(1) = sigma0;&#xA;&#xA;     for k=2:N % Calculating the volatility Path using the Milstein Scheme&#xA;&#xA;            sigma(k) = sigma(k-1)*(1 + sqrt(dt)*gamma*Z(k-1) + dt*(alpha + 0.5*gamma*gamma*(Z(k-1)^2-1)));&#xA;     end&#xA;     sigma_path(:,j)=sigma;&#xA;end&#xA;sigma_integral = mean(sigma_path')';&#xA;sigma_integral_squared = sigma_integral.^2;&#xA;dt_vector = dt*ones(N,1);&#xA;&#xA;&#xA;&#xA;V_bar = mean(sigma_integral_squared'*dt_vector); %numerical integration&#xA;&#xA;[Call, Put] = blsprice(S0, K, r, T, V_bar, 0);&#xA;Imp_Vol = blsimpv(S0, K, r, T, Call, [],[], [], []);&#xA;Price = Call;&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="20762" LastActivityDate="2016-07-10T16:37:53.887" Title="Hull White Stochastic Volatility Model in Matlab" Tags="&lt;stochastic-volatility&gt;&lt;matlab&gt;&lt;hullwhite&gt;" AnswerCount="1" CommentCount="12" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="27998" PostTypeId="2" ParentId="22902" CreationDate="2016-07-09T14:43:24.757" Score="4" Body="&lt;p&gt;I've never used QuantStrat, but have used SIT for about two years. Michael's blog provides a great way to learn R, understand SIT, and learn about backtesting strategies. I've never found a mistake in his code, and that's how I made a living for 20+ years. It takes some real persistence to understand how to use it in depth, but you can easily set up tests by just copying and modifying one of Michael's own backtest stubs. Michael seems to have tapered off blogging recently, as has David Varadi, whose strategies Michael often tested. Still, I highly recommend it as a full featured tool that supports universe selection, top n selection, numerous weighting schemes, commissions, various rebalancing periods, leverage use, etc., all customizable and extensible. &lt;/p&gt;&#xA;" OwnerUserId="22486" LastActivityDate="2016-07-09T14:43:24.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="27999" PostTypeId="2" ParentId="27995" CreationDate="2016-07-09T17:04:12.690" Score="3" Body="&lt;p&gt;&lt;strong&gt;Risk Transfer&lt;/strong&gt; simply involves transferring &quot;&lt;strong&gt;only&lt;/strong&gt;&quot; risk to another person for a price. For example, the downside risk of stock can be transferred by purchasing a call option. In this way, the buyer of call option transfers its risk to the writer of the call option. Another example is &lt;strong&gt;insurance&lt;/strong&gt;, wherein, the buyer of insurance transfers its risk to an insurance company. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Risk Sharing&lt;/strong&gt; is an entirely different concept. It involves sharing (dividing) common risk among two or more persons. I think the  &lt;strong&gt;&quot;partnership&quot;&lt;/strong&gt; form of business organization is the most common (and oldest) practice of risk sharing. Banks also use this practice to lend a big amount to individual large size corporation, each bank supplying a portion of the loaned funds. In these cases &quot;&lt;strong&gt;both&lt;/strong&gt;&quot; the profits, as well as potential losses, are shared between the parties.&lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="16148" LastEditDate="2017-06-05T13:56:39.290" LastActivityDate="2017-06-05T13:56:39.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28000" PostTypeId="1" CreationDate="2016-07-09T18:38:43.210" Score="3" ViewCount="157" Body="&lt;p&gt;I am reading Ken Fisher's &lt;a href=&quot;https://rads.stackoverflow.com/amzn/click/com/1118973054&quot; rel=&quot;nofollow noreferrer&quot; rel=&quot;nofollow noreferrer&quot;&gt;Beat the Crowd&lt;/a&gt;, and the second sentence in the book is this: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In investing, the crowd is wrong much more often than right.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I was wondering if there is a way to define the terms in this statement, &quot;in investing&quot;, &quot;crowd&quot; and &quot;wrong much more often than right&quot;, so that this sentence can be quantitatively tested. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My feeling is that if markets are efficient, in retail investing, this statement would imply that while crowds (assume in the simplest case that there are two sets of investors, those who bet on an index going up in the next time period, and those that bet on the index going down in the next time period, and the crowd is whichever set has larger cardinality) are wrong much more often, the volume of the gains of the crowd when they are right are far higher than when they are wrong. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;\mathbb{E}(Y | \text{Crowd is right}) &amp;gt;&amp;gt; \mathbb{E}(Y | \text{Crowd is wrong})&#xA;$$&lt;/span&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this a testable theory? What data would be required to test this? Is there a strand of the literature which tests whether deliberately contrarian behaviour is more profitable?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="3195" LastEditorUserId="16595" LastEditDate="2019-05-13T06:40:27.803" LastActivityDate="2019-05-13T06:40:27.803" Title="In investing, the crowd is wrong much more often than right" Tags="&lt;investing&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="28001" PostTypeId="2" ParentId="27985" CreationDate="2016-07-09T19:37:20.083" Score="-2" Body="&lt;p&gt;See Chris and Almgren &quot;portfolios from sorts&quot;&lt;/p&gt;&#xA;" OwnerUserId="22491" LastActivityDate="2016-07-09T19:37:20.083" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28002" PostTypeId="1" CreationDate="2016-07-10T03:43:46.813" Score="2" ViewCount="116" Body="&lt;p&gt;I found the following paper which uses homotopy analysis for a closed-form solution. Does it have direct/apparent connections with chaos theory?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://bfi.cl/assets/zhao-wong-2006---a-closed-form-solution-to-american-options-under-general-diffusions.pdf&quot; rel=&quot;nofollow&quot;&gt;http://bfi.cl/assets/zhao-wong-2006---a-closed-form-solution-to-american-options-under-general-diffusions.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19666" LastActivityDate="2016-07-10T03:43:46.813" Title="Is there any literature on a closed-form/analytical solution for American option prices with use of Chaos Theory?" Tags="&lt;option-pricing&gt;&lt;american-options&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28003" PostTypeId="1" AcceptedAnswerId="28006" CreationDate="2016-07-10T04:58:41.010" Score="9" ViewCount="851" Body="&lt;p&gt;&lt;strong&gt;The problem:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Let &lt;span class=&quot;math-container&quot;&gt;$T &amp;gt;0$&lt;/span&gt;, and let &lt;span class=&quot;math-container&quot;&gt;$(\Omega, \mathscr F, \{ \mathscr F_t \}_{t \in [0,T]}, \mathbb P)$&lt;/span&gt; be a filtered probability space where &lt;span class=&quot;math-container&quot;&gt;$\mathscr F_t = \mathscr F_t^W$&lt;/span&gt; where &lt;span class=&quot;math-container&quot;&gt;$W = \{W_t\}_{t \in [0,T]}$&lt;/span&gt; is standard &lt;span class=&quot;math-container&quot;&gt;$\mathbb P$&lt;/span&gt;-Brownian motion.&lt;/p&gt;&#xA;&lt;p&gt;Let &lt;span class=&quot;math-container&quot;&gt;$X = \{X_t\}_{t \in [0,T]}$&lt;/span&gt; be a stochastic process where &lt;span class=&quot;math-container&quot;&gt;$X_t = W_t + \sin t$&lt;/span&gt;, and let &lt;span class=&quot;math-container&quot;&gt;$\mathbb Q$&lt;/span&gt; be an equivalent probability measure s.t. &lt;span class=&quot;math-container&quot;&gt;$X$&lt;/span&gt; is standard &lt;span class=&quot;math-container&quot;&gt;$\mathbb Q$&lt;/span&gt;-Brownian motion.&lt;/p&gt;&#xA;&lt;p&gt;Give &lt;span class=&quot;math-container&quot;&gt;$\frac{d \mathbb Q}{d \mathbb P}$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;Girsanov Theorem:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Let &lt;span class=&quot;math-container&quot;&gt;$T &amp;gt;0$&lt;/span&gt;, and let &lt;span class=&quot;math-container&quot;&gt;$(\Omega, \mathscr F, \{ \mathscr F_t \}_{t \in [0,T]}, \mathbb P)$&lt;/span&gt; be a filtered probability space where &lt;span class=&quot;math-container&quot;&gt;$\mathscr F_t = \mathscr F_t^W$&lt;/span&gt; where &lt;span class=&quot;math-container&quot;&gt;$W = \{W_t\}_{t \in [0,T]}$&lt;/span&gt; is the standard &lt;span class=&quot;math-container&quot;&gt;$\mathbb P$&lt;/span&gt;-Brownian motion.&lt;/p&gt;&#xA;&lt;p&gt;Let the Girsanov kernel &lt;span class=&quot;math-container&quot;&gt;$\{\theta_t\}_{t \in [0,T]}$&lt;/span&gt; be a &lt;span class=&quot;math-container&quot;&gt;$\mathscr F_t$&lt;/span&gt;-adapted stochastic process s.t. &lt;span class=&quot;math-container&quot;&gt;$\int_0^T \theta_s^2 ds &amp;lt; \infty$&lt;/span&gt; a.s. and &lt;span class=&quot;math-container&quot;&gt;$\{L_t\}_{t \in [0,T]}$&lt;/span&gt; is a &lt;span class=&quot;math-container&quot;&gt;$( \mathscr F_t , \mathbb P)$&lt;/span&gt; martingale where&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$L_t := \exp(-\int_0^t \theta_s dW_s - \frac 1 2 \int_0^t \theta_s^2 ds)$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Let &lt;span class=&quot;math-container&quot;&gt;$\mathbb Q$&lt;/span&gt; be the probability measure defined by&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$Q(A) = \int_A L_T dP \ \forall A \in \ \mathscr F$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;or &lt;span class=&quot;math-container&quot;&gt;$$L_T = \frac{d \mathbb Q}{d \mathbb P}$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Then &lt;span class=&quot;math-container&quot;&gt;$\{W_t^Q\}_{t \in [0,T]}$&lt;/span&gt; defined by&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$W_t^Q := W_t + \int_0^t \theta_s ds$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;is standard &lt;span class=&quot;math-container&quot;&gt;$\mathbb Q$&lt;/span&gt;-Brownian motion.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;&lt;strong&gt;The solution given:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$X_t = W_t + \int_0^t \cos s ds$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Let &lt;span class=&quot;math-container&quot;&gt;$\theta_t = \cos t$&lt;/span&gt;:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;It is &lt;span class=&quot;math-container&quot;&gt;$\mathscr F_t$&lt;/span&gt;-adapted&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$\int_0^T \theta_s^2 ds &amp;lt; \infty$&lt;/span&gt; a.s.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$E[\exp(\frac 1 2 \int_0^T \theta_t^2 dt)] &amp;lt; \infty$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Then &lt;span class=&quot;math-container&quot;&gt;$\{L_t\}_{t \in [0,T]}$&lt;/span&gt; is a &lt;span class=&quot;math-container&quot;&gt;$( \mathscr F_t , \mathbb P)$&lt;/span&gt; martingale, by Novikov's condition, where&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$L_t := \exp(-\int_0^t \cos s dW_s - \frac 1 2 \int_0^t \cos^2 s ds)$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Thus, by Girsanov's Theorem, we have&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\frac{d\mathbb Q}{d\mathbb P} = L_T...?$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;How exactly does that last line follow?&lt;/p&gt;&#xA;&lt;p&gt;What I find strange is that the Girsanov Theorem defines &lt;span class=&quot;math-container&quot;&gt;$\mathbb Q$&lt;/span&gt; and then concludes &lt;span class=&quot;math-container&quot;&gt;$X_t$&lt;/span&gt; is standard &lt;span class=&quot;math-container&quot;&gt;$\mathbb Q$&lt;/span&gt;-Brownian motion while the problem says there is some &lt;span class=&quot;math-container&quot;&gt;$\mathbb Q$&lt;/span&gt; s.t. &lt;span class=&quot;math-container&quot;&gt;$X_t$&lt;/span&gt; is standard &lt;span class=&quot;math-container&quot;&gt;$\mathbb Q$&lt;/span&gt;-Brownian motion and then asks about &lt;span class=&quot;math-container&quot;&gt;$\frac{d \mathbb Q}{d \mathbb P}$&lt;/span&gt;. Is the problem maybe stated wrong?&lt;/p&gt;&#xA;&lt;p&gt;To say that &lt;span class=&quot;math-container&quot;&gt;$L_T$&lt;/span&gt; is indeed the required density &lt;span class=&quot;math-container&quot;&gt;$\frac{d \mathbb Q}{d \mathbb P}$&lt;/span&gt;, I think we need to use the &lt;a href=&quot;https://books.google.com.hk/books?id=YoMr5Mbo6coC&amp;amp;pg=PT324&amp;amp;lpg=PT324&amp;amp;dq=converse%20of%20the%20girsanov&amp;amp;source=bl&amp;amp;ots=iniu5xWy6e&amp;amp;sig=w7uyixE0bbaGdT9shskEMhle3rM&amp;amp;hl=en&amp;amp;sa=X&amp;amp;ved=0ahUKEwif1sS3nePJAhXC2aYKHcInBccQ6AEIOTAE#v=onepage&amp;amp;q=converse%20of%20the%20girsanov&amp;amp;f=false&quot; rel=&quot;noreferrer&quot;&gt;converse of the Girsanov Theorem&lt;/a&gt;), or maybe the problem should instead give us &lt;span class=&quot;math-container&quot;&gt;$\frac{d \mathbb Q}{d \mathbb P}$&lt;/span&gt; and then ask us to show that &lt;span class=&quot;math-container&quot;&gt;$L_T = \frac{d \mathbb Q}{d \mathbb P}$&lt;/span&gt; possibly showing that &lt;span class=&quot;math-container&quot;&gt;$E[\frac{d \mathbb Q}{d \mathbb P} | \mathscr F_t] = L_t$&lt;/span&gt; or some other route.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;&lt;strong&gt;I tried something slightly different:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;I define &lt;span class=&quot;math-container&quot;&gt;$\hat{\mathbb P}$&lt;/span&gt; s.t.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$L_T = \frac{d\hat{\mathbb P}}{d\mathbb P}$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\hat{\mathbb P} = \int_A L_T d\mathbb P$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;It follows by Girsanov Theorem that &lt;span class=&quot;math-container&quot;&gt;$X_t$&lt;/span&gt; is standard &lt;span class=&quot;math-container&quot;&gt;$\hat{\mathbb P}$&lt;/span&gt;-Brownian motion. Since we are given that there is some &lt;span class=&quot;math-container&quot;&gt;$\mathbb Q$&lt;/span&gt; equivalent to &lt;span class=&quot;math-container&quot;&gt;$\mathbb P$&lt;/span&gt; s.t. &lt;span class=&quot;math-container&quot;&gt;$X_t$&lt;/span&gt; is also standard &lt;span class=&quot;math-container&quot;&gt;$\mathbb Q$&lt;/span&gt;-Brownian motion, it follows by the uniqueness of the Radon-Nikodym derivative that&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\frac{d\hat{\mathbb P}}{d\mathbb P} = \frac{d\mathbb Q}{d\mathbb P}$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$\therefore, \frac{d\mathbb Q}{d\mathbb P}$&lt;/span&gt; is given by &lt;span class=&quot;math-container&quot;&gt;$L_T$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Is that right? I think I'm missing a step somewhere.&lt;/p&gt;&#xA;&lt;p&gt;So, is that indeed what the solution given is meant to be but just omitted pointing out uniqueness of the Radon-Nikodym derivative, if such justification is right?&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;Edit based on &lt;a href=&quot;https://quant.stackexchange.com/questions/15159/uniqueness-of-equivalent-martingale-measure-in-black-scholes-model#comment31938_15167&quot;&gt;this&lt;/a&gt;: Even if Radon-Nikodym derivative is unique, &lt;span class=&quot;math-container&quot;&gt;$\mathbb Q$&lt;/span&gt; may not be unique? If so, is it then that &lt;span class=&quot;math-container&quot;&gt;$\hat{\mathbb P}$&lt;/span&gt; is merely a candidate for one of many possible &lt;span class=&quot;math-container&quot;&gt;$\mathbb Q$&lt;/span&gt;'s?&lt;/p&gt;&#xA;&lt;p&gt;I think we conclude &lt;span class=&quot;math-container&quot;&gt;$\hat{\mathbb P} = \mathbb Q$&lt;/span&gt; based on &lt;span class=&quot;math-container&quot;&gt;$X_t$&lt;/span&gt; being standard Brownian motion under both measures. Is there a proposition for that? Uniqueness of Brownian motion measure or something?&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-07-16T08:12:08.920" Title="Given $\mathbb Q$ and $X_t$ is $\mathbb Q$-Brownian, find $\frac{d\mathbb Q}{d\mathbb P}$ / Uniqueness of Brownian or Radon-Nikodym derivative" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;probability&gt;&lt;brownian-motion&gt;&lt;girsanov&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28004" PostTypeId="2" ParentId="22234" CreationDate="2016-07-10T10:17:27.860" Score="0" Body="&lt;p&gt;Before fitting any ARIMA model, make sure that: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;There is no seasonal trend in your data. If it is present then deseasonalized it by taking appropriate lag difference, as pointed by @Horseless&lt;/li&gt;&#xA;&lt;li&gt;Before fitting any model, make sure data is stationary. &lt;/li&gt;&#xA;&lt;li&gt;Once stationarity is achieved, plot ACF and PACF and find appropriate lag. To find appropriate lag selection, you can use various information criterion, like AIC, BIC, SIC, HQIC etc. (Lot of R packages are available that allow automatic selection of appropriate lag order)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;After fitting appropriate model, make sure that error terms (residuals) are white noise.  &lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2016-07-10T10:17:27.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28005" PostTypeId="2" ParentId="27997" CreationDate="2016-07-10T16:04:45.120" Score="2" Body="&lt;p&gt;In order to compute &#xA;$$ P_0 = \mathbb {E}[C (\hat{V})] $$&#xA;where&#xA;$$ \hat{V} = \frac {1}{T} \int_0^T \sigma^2_s ds $$&#xA;and&#xA;$$ d\sigma_t = \sigma_t (\alpha dt + \gamma dW_t) $$&#xA;using Monte Carlo, you should:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Generate stochastic volatility paths over $[0,T]$ by discretising the above SDE (which here defines a GBM, not a Hull &amp;amp; White diffusion)&lt;/li&gt;&#xA;&lt;li&gt;Calculate the time integral $\hat {V}^{(j)} $ for each simulated path $j=1,...,M$, you can use a trapezoidal integration method for instance.&lt;/li&gt;&#xA;&lt;li&gt;Apply the BS formula to compute $C (\hat {V}^{(j)}) $ &lt;/li&gt;&#xA;&lt;li&gt;Average all of the latter call prices to finally obtain&#xA;$$P_0=\frac {1}{M} \sum_{j=1}^M C (\hat {V}^{(j)})$$.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Instead what you did is (see bullet points in your original question): average all simulated stochastic volatility paths to derive an &quot;average volatility path&quot; from which you calculate an average volatility $\hat {V} $ over $[0,T] $ and apply BS formula using the latter volatility figure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your approach is thus wrong. Remember that the expectation of a function of a random variable is in general not the function of the expectation of that random variable (except for linear functions obviously), see Jensen's inequality. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is a common rookie mistake though, don't worry :)&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-07-10T16:37:53.887" LastActivityDate="2016-07-10T16:37:53.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28006" PostTypeId="2" ParentId="28003" CreationDate="2016-07-10T16:27:30.473" Score="6" Body="&lt;p&gt;IMHO the problem isn't stated correctly indeed, in the sense that the Radon-Nikodym derivative provided as the &quot;solution&quot; is not the unique way to define a measure $\mathbb{Q}$ equivalent to $\mathbb{P}$ and under which $X_t$ is a martingale. Just take &#xA;$$\frac {d\mathbb{Q}}{d\mathbb{P}} =\mathcal{E}\left(-\int_0^t \cos(s) dW_s + a\right)$$&#xA;for any $a \in \mathbb{R}$ (or any finite variation process for that matter, the point being that $a $ should not contribute in terms of quadratic (co)variation) and $\mathcal {E}(.) $ figures the stochastic (or Doleans-Dade) exponential. Note that the solution provided corresponds to picking $a=0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As such, I think that the exercice should have been written the other way around as you mention in your question. Something like: show that, given the following Radon-Nikodym derivative specification, the resulting measure $\mathbb{Q}$ is equivalent to the original measure $\mathbb{P}$ and such that $(X_t)_{t\in [0,T]}$ is a $(\mathbb{Q},\mathcal{F}_t^W)$-martingale.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-07-10T19:34:45.200" LastActivityDate="2016-07-10T19:34:45.200" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28009" PostTypeId="1" AcceptedAnswerId="28010" CreationDate="2016-07-10T20:48:31.320" Score="6" ViewCount="381" Body="&lt;p&gt;Let $W_t$ be a standard wiener process and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Y_t=\int_{0}^{t}\frac{W_s}{(1+W_s^2)^2}ds$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $W(t_0)=\sqrt{3}$, then how can we compute $\mathbb{E}[Y(t_0)]$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is $\mathbb{E}[Y(t_0)]=0$?&lt;/p&gt;&#xA;" OwnerUserId="20945" LastEditorUserId="467" LastEditDate="2016-07-11T02:45:26.877" LastActivityDate="2016-07-14T19:52:06.950" Title="How to compute the expectation of integral of this random function?" Tags="&lt;stochastic-processes&gt;&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28010" PostTypeId="2" ParentId="28009" CreationDate="2016-07-10T22:04:09.010" Score="9" Body="&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; This integral is not Ito's Integral. Indeed  $Y_t$ is a random time change with time change rate $\frac{W_t}{1+W_t^2}.$ (Oksendal, Sixth edition,page 147) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; Sometimes this trick is useful.Indeed we assume that we are going to solve Riemann integral !.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $$f''(x)=\frac{-2x}{(1+x^2)^2}$$&#xA;then&#xA;$$f'(x)=\left(\frac{1}{1+x^2}\right)+c_1$$&#xA;and&#xA;$$f(x)=\tan^{-1}(x)+c_1x+c_2$$&#xA;set $c_1=c_2=0$.By application of Ito's lemma we have&#xA;$$f(W_t)=f(W_0)+\int_{0}^{t}f'(W_s)dW_s+\frac{1}{2}\int_{0}^{t}f''(W_s)ds$$&#xA;therefore&#xA;$$\tan^{-1}(W_t)=\int_{0}^{t}\frac{1}{1+W_s^2}dW_s-\int_{0}^{t}\frac{W_s}{(1+W_s^2)^2}ds$$&#xA;in other words&#xA;$$\int_{0}^{t}\frac{W_s}{(1+W_s^2)^2}ds=\int_{0}^{t}\frac{1}{1+W_s^2}dW_s-\tan^{-1}(W_t)$$&#xA;thus&#xA;$$\mathbb{E}\left[\int_{0}^{t}\frac{W_s}{(1+W_s^2)^2}ds\right]=\underbrace{\mathbb{E}\left[\int_{0}^{t}\frac{1}{1+W_s^2}dW_s\right]}_{0}-\mathbb{E}[\tan^{-1}(W_t)]$$&#xA;as a result&#xA;$$\mathbb{E}\left[\int_{0}^{t}\frac{W_s}{(1+W_s^2)^2}ds\right]=-\mathbb{E}[\tan^{-1}(W_t)]$$&#xA;Now set $t=t_0$&#xA;$$\mathbb{E}\left[\int_{0}^{t_0}\frac{W_s}{(1+W_s^2)^2}ds\right]=-\mathbb{E}[\tan^{-1}(W_{t_0})]=-\mathbb{E}[\tan^{-1}(\sqrt{3})]=-\frac{\pi}{3}$$&#xA;finally&lt;/p&gt;&#xA;&#xA;&lt;blockquote class=&quot;spoiler&quot;&gt;&#xA;  &lt;p&gt;  $$ \color{red}{\mathbb{E}[Y_{t_0}]=-\frac{\pi}{3}}$$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-07-14T19:52:06.950" LastActivityDate="2016-07-14T19:52:06.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28011" PostTypeId="1" AcceptedAnswerId="28042" CreationDate="2016-07-10T22:55:48.403" Score="1" ViewCount="770" Body="&lt;p&gt;Ok, I know what's the difference are between them but still have some question.&#xA;Let's say that the exchange's limit order book looks like this:&#xA;(order depth of LOB)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/S7mqa.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/S7mqa.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, let's say I send a buy FOK order with lmt price $1.12 and size 10.&#xA;It will be executed? or will be cancelled?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What about if I sent same order but as IOC?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just in case, I'm targeting forex market with most common venues (Currenex, EBS, Hotspot, etc)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="13990" LastActivityDate="2016-07-12T15:15:53.833" Title="How FOK or IOC order types are executed" Tags="&lt;market-data&gt;&lt;fx&gt;&lt;market-microstructure&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28012" PostTypeId="1" CreationDate="2016-07-10T23:17:50.660" Score="1" ViewCount="326" Body="&lt;p&gt;I am trying to figure out how to quantify the change in price on a bond for a change in credit risk. I'm not even sure how to quantify a change in credit risk, but I'm thinking possibly something related to either the debt/equity rating of a corporate bond or a change in the credit rating. If there is a better way, please do include it in your answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, my question is how to determine the price change from a change in the credit risk for a bond? Is there a way to quantify this in any remotely accurate way?&#xA;If so, how?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would simple duration/convexity do the trick?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="22405" LastEditorUserId="22405" LastEditDate="2016-07-11T00:19:27.443" LastActivityDate="2016-08-11T21:52:34.793" Title="How do you quantify credit risk?" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;credit-risk&gt;&lt;credit&gt;&lt;credit-ratings&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28014" PostTypeId="2" ParentId="27992" CreationDate="2016-07-11T07:26:09.160" Score="2" Body="&lt;p&gt;You are trying to write a program which solves the following pricing PDE (Black-Scholes assumed)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{\partial V}{\partial t}(t,S) + (r-q)S\frac{\partial V}{\partial S}(t,S) + \frac{1}{2}\sigma^2 S^2 \frac{\partial^2 V}{\partial S^2}(t,S) - rV(t,S) = 0 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $V_0:=V(0,S_0)$ is the target option premium.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;strong&gt;terminal condition&lt;/strong&gt; is that, at $t=T$ (expiry of the contract), the value of the option should be equal to its &lt;a href=&quot;https://en.wikipedia.org/wiki/Butterfly_(options)&quot; rel=&quot;nofollow&quot;&gt;payoff&lt;/a&gt; $\phi (S_T) $ by absence of arbitrage opportunity:&#xA;$$ V(T, S_T) = (S_T-(K-a))^+ - 2(S_T-K)^+ + (S_T-(K+a))^+,\ \ \forall S_T \in \mathbb{R}^+ $$&#xA;where the real parameter $a&amp;gt;0$ describes the &quot;width&quot; of your butterfly position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get the &lt;strong&gt;boundary conditions&lt;/strong&gt; it is illuminating to remember that the solution of the above pricing PDE is, by &lt;a href=&quot;https://en.wikipedia.org/wiki/Feynman%E2%80%93Kac_formula&quot; rel=&quot;nofollow&quot;&gt;Feynman-Kac&lt;/a&gt; formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ V(t,S_t) = \mathbb{E}^\mathbb{Q} \left[ e^{-r(T-t)} \phi(S_T) \vert \mathcal{F}_t \right] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\mathbb{Q}$ is a probability measure under which the value of any self-financing portfolio, discounted at the risk-free rate $r$, constitutes a martingale. Using the above formulation, we can &lt;em&gt;heuristically&lt;/em&gt;(*) see that &#xA;\begin{align}&#xA;\lim_{S \rightarrow 0} V(t,S_t=S) &amp;amp;= \lim_{S_T \rightarrow 0} \mathbb{E}_t^\mathbb{Q}\left[ e^{-r(T-t)} \phi(S_T) \right] \\&#xA;&amp;amp;= e^{-r(T-t)} \phi(0) \\&#xA;&amp;amp;= 0 \\&#xA;\lim_{S \rightarrow \infty} V(t,S_t=S) &amp;amp;= \lim_{S_T \rightarrow \infty} \mathbb{E}_t^\mathbb{Q}\left[ e^{-r(T-t)} \phi(S_T) \right] \\&#xA;&amp;amp;= e^{-r(T-t)} \underbrace{\lim_{S_T \rightarrow \infty} \mathbb{E}_t^\mathbb{Q}\left[ (S_T-(K-a)) - 2(S_T-K) + (S_T-(K+a)) \right]}_{=0} \\&#xA;&amp;amp;= 0&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that, instead of Dirichlet conditions, you could equivalently use Von Neumann conditions at boundaries. For instance here, the fact that Gamma is expected to vanish i.e.&#xA;\begin{align}&#xA;\lim_{S\rightarrow 0} \frac{\partial^2 V}{\partial S^2}(t,S_t=S) = 0 \\&#xA;\lim_{S\rightarrow \infty} \frac{\partial^2 V}{\partial S^2}(t,S_t=S) = 0 \\&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(*) &lt;strong&gt;[REM]&lt;/strong&gt; Although the limit is theoretically defined for the random variable $S=S_t$ we can &quot;heuristically&quot; propagate it to the argument $S_T$ of the payoff function. This is because under homogeneous diffusion models à la Black-Scholes $`\ S_T \propto S_t\ '$. I'm using quotes because this is not the rigorous way to write it, but you get the idea.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-07-11T09:34:04.537" LastActivityDate="2016-07-11T09:34:04.537" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28015" PostTypeId="1" CreationDate="2016-07-11T09:31:59.290" Score="0" ViewCount="83" Body="&lt;p&gt;I tried to calculate treasury bonds YTM from their clean prices through different formula on excel (&quot;yield&quot; or &quot;rate&quot;) and found the same result. However, I do not know whether using the &quot;yield&quot; function, it is more suitable to set the delivery date to the date of the trade or the last date of coupon given that using the date of the trade gives a different result than the &quot;rate&quot; function?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have another question regarding the determination of yields on the basis of prices published at auctions. Is the same formula used?&lt;/p&gt;&#xA;" OwnerUserId="22508" LastActivityDate="2016-07-13T08:27:19.197" Title="yield/price of treasury bonds" Tags="&lt;yield&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28016" PostTypeId="1" AcceptedAnswerId="28017" CreationDate="2016-07-11T11:26:02.513" Score="1" ViewCount="49" Body="&lt;p&gt;The equation is quite simple, however it is not very obvious to me to have the following relationship:&#xA;$$\begin{equation}&#xA;\frac{1-exp(-\kappa(T-t))}{\kappa}\rightarrow(T-t) \quad \rm{when\space} \kappa \rightarrow 0 &#xA;\end{equation}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance! &lt;/p&gt;&#xA;" OwnerUserId="22427" LastActivityDate="2016-07-11T12:04:08.070" Title="How to understand the following limits when kapa limits to Zero" Tags="&lt;stochastic-calculus&gt;&lt;mathematics&gt;&lt;vasicek&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28017" PostTypeId="2" ParentId="28016" CreationDate="2016-07-11T12:04:08.070" Score="1" Body="&lt;p&gt;&lt;strong&gt;:D&lt;/strong&gt; Is it a joke?&#xA;$$\underset{\kappa \to 0 }{\mathop{\lim }}\,\frac{1-e^{-\kappa(T-t)}}{\kappa}=\underset{\kappa \to 0 }{\mathop{\lim }}\,\frac{\frac{d}{d\kappa}\left(1-e^{-\kappa(T-t)}\right)}{\frac{d}{d\kappa}\kappa}=\underset{\kappa \to 0 }{\mathop{\lim }}\,(T-t) e^{-\kappa(T-t)}=T-t$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastActivityDate="2016-07-11T12:04:08.070" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28018" PostTypeId="2" ParentId="28015" CreationDate="2016-07-11T12:10:11.220" Score="1" Body="&lt;p&gt;The correct date to use is the Settlement Date, which is one business day after the Trade Date, or in the case of a newly auctioned security, the Issue Date.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Issue Date is typically between T+2 and T+1week for coupon bearing Treasuries.  See the Treasury Direct website for examples. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The yield function is preferable to the rate function in exceL.  From reading the descriptions, the latter won't work if the settlement date is in the middle of a coupon period.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastEditorUserId="18388" LastEditDate="2016-07-13T08:27:19.197" LastActivityDate="2016-07-13T08:27:19.197" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28019" PostTypeId="2" ParentId="21941" CreationDate="2016-07-11T12:44:31.060" Score="2" Body="&lt;p&gt;You can have a look at &lt;a href=&quot;http://public.econ.duke.edu/~ap172/code.html&quot; rel=&quot;nofollow&quot;&gt;Andrew Patton's &quot;Copula toolbox for Matlab&quot;&lt;/a&gt;. It contains his code for the &quot;Time-varying Symmetrised Joe-Clayton copula&quot;.&lt;/p&gt;&#xA;" OwnerUserId="22510" LastActivityDate="2016-07-11T12:44:31.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28020" PostTypeId="1" AcceptedAnswerId="28022" CreationDate="2016-07-11T13:06:18.023" Score="1" ViewCount="231" Body="&lt;p&gt;We have often discussed the Black-Litterman approach/model in the forum.&#xA;What I was wondering is: is it possible to formulate relative views in the model.&#xA;Relative in the sense&#xA;$$&#xA;\mu_1 &amp;gt; \mu_2&#xA;$$&#xA;where $\mu_i$ is the expected return (as a view) of asset $i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is clear how to formulate relative views of the form&#xA;$$&#xA;\mu_1 - \mu_2 =  v,&#xA;$$&#xA;where the view is that I expect asset 1 to have a return $v$ percent greater as the return of asset 2. However I don't want to fix $v$.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-07-11T15:03:17.473" Title="Can I formulate a general relative view in Black-Litterman?" Tags="&lt;portfolio-optimization&gt;&lt;black-litterman&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28021" PostTypeId="2" ParentId="28012" CreationDate="2016-07-11T13:26:03.847" Score="1" Body="&lt;p&gt;What you're looking for looks to be more in the realm of a mathematical model (specific to the company's size, available liquidity, and industry). &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/354040466X&quot; rel=&quot;nofollow&quot;&gt;Credit Risk Pricing Models&lt;/a&gt; may provide a decent overview of how to build such a model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately duration/convexity will only help you capture the interest rate risk on your bonds, and not any of the idiosyncratic events such as credit downgrades. &lt;/p&gt;&#xA;" OwnerUserId="17175" LastActivityDate="2016-07-11T13:26:03.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28022" PostTypeId="2" ParentId="28020" CreationDate="2016-07-11T15:03:17.473" Score="1" Body="&lt;p&gt;Indeed I think you can, but it comes at a price. To be clear: Neither have I done this myself nor have I attempted it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main idea is typical Bayesian:&#xA;In computing the posterior return parameters for the random variable $\mu$, you can calculate the conditional expectation subject to your inequality constraints, say $A\mu \leq b$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are three, fundamentally different, problems I see with this approach:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Computational Complexity:&lt;/strong&gt; How do we solve the integral $\mathbb{E}[\mu|A\mu \leq b]$? This should be a standard Bayes problem with plenty of literature (stochastic integration?)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;View Formulation:&lt;/strong&gt; What does it mean to have uncertainty attached to the views in the view matrix while constraining the return distribution to fulfill the inequalities all the time?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Following Optimization:&lt;/strong&gt; What I'm not completely sure about: Considering the fact that the distribution of the posterior is not normal anymore, is it still appropriate to proceed with standard mean-variance optimization? (I would guess the answer is yes - at least if we assume a normal market)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;There is a &lt;a href=&quot;http://web.stanford.edu/~bvr/pubs/qualitative-input.pdf&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; that claims to solve the first point by providing an algorithm and also presents a method to add uncertainty to inequality parameters. From what I saw so far I think its definitely worth a look and should fill in all the gaps there are still in the answer.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2016-07-11T15:03:17.473" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28023" PostTypeId="1" AcceptedAnswerId="28024" CreationDate="2016-07-11T15:05:18.430" Score="2" ViewCount="8319" Body="&lt;p&gt;The &lt;a href=&quot;http://www.bis.org/bcbs/publ/d352.htm&quot; rel=&quot;nofollow&quot;&gt;BCBS has presented&lt;/a&gt; a new standard approach for measuring risk for a portfolio, which is based on sensitivities, that is “delta”, “vega” and “curvature” risks.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Delta risk measures the change in price resulting from a small price&#xA;  or rate shock to the value of each relevant risk factor. Vega risk is&#xA;  the risk due to variations in the volatility for options - computed as&#xA;  the product of the vega of a given option and its implied volatility;&#xA;  and curvature risk captures the additional risk due to movement in the&#xA;  delta when the price changes.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The text does not contain formulae: how is the curvature risk actually computed?&lt;/p&gt;&#xA;" OwnerUserId="11645" LastActivityDate="2016-10-31T12:30:19.107" Title="What is curvature risk?" Tags="&lt;risk&gt;&lt;banking-regulations&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28024" PostTypeId="2" ParentId="28023" CreationDate="2016-07-11T16:34:16.197" Score="3" Body="&lt;p&gt;The formulae are on p17 of the document attached to the link you included.&lt;br&gt;&#xA;&lt;a href=&quot;http://www.bis.org/bcbs/publ/d352.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.bis.org/bcbs/publ/d352.pdf&lt;/a&gt;&#xA;It's just the profit or loss due to a specified shock in the underlying, which is not explained by the local delta of the position.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-07-11T16:34:16.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28025" PostTypeId="1" AcceptedAnswerId="28028" CreationDate="2016-07-11T17:36:56.233" Score="3" ViewCount="870" Body="&lt;p&gt;I have constant maturity treasury data from the h15 release of the FED, from which I use 6 month, 1 year, 2, 3, 5, 7, 10, and 20 year yields.  I want to strip the zero coupon curve, but am not sure about the best (most accurate) way to fill in the missing maturities for the CMT yields, which I need before I can bootstrap the zero coupon curve. Is there anyone that can provide me with some references on the different techniques that can be used, that are also understandable for application? &lt;/p&gt;&#xA;" OwnerUserId="22512" LastActivityDate="2016-07-11T18:47:24.957" Title="What techniques can be used to get the missing maturities from the CMT yields?" Tags="&lt;bond-yields&gt;&lt;interpolation&gt;&lt;zero-coupon&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28026" PostTypeId="1" CreationDate="2016-07-11T17:39:14.990" Score="1" ViewCount="141" Body="&lt;p&gt;I know one factor model assumes that one stochastic factor can explain the future evolution of all interest rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone tell me what is the one factor in economic meaning in the one-factor rate model? Does this stochastic factor has economic meaning?&lt;/p&gt;&#xA;" OwnerUserId="18503" LastActivityDate="2016-07-11T19:51:17.143" Title="One factor short rate model" Tags="&lt;factor-models&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28027" PostTypeId="2" ParentId="21244" CreationDate="2016-07-11T17:50:39.777" Score="2" Body="&lt;p&gt;(Although the question was asked long time ago it may be of help for others as well)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may want to have a look at Nagel and Purnanandam (2015) Bank Risk Dynamics and Distance to Default&#xA;(&lt;a href=&quot;https://www.bundesbank.de/Redaktion/EN/Downloads/Bundesbank/Research_Centre/Conferences/2016/2016_06_10_eltville_08_paper_nagel.pdf?__blob=publicationFile&quot; rel=&quot;nofollow&quot;&gt;https://www.bundesbank.de/Redaktion/EN/Downloads/Bundesbank/Research_Centre/Conferences/2016/2016_06_10_eltville_08_paper_nagel.pdf?__blob=publicationFile&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The authors propose a modification of the Merton's model specifically for financial institutions&lt;/p&gt;&#xA;" OwnerUserId="20637" LastActivityDate="2016-07-11T17:50:39.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28028" PostTypeId="2" ParentId="28025" CreationDate="2016-07-11T18:47:24.957" Score="2" Body="&lt;p&gt;The CMT yields published by the Fed/US Treasury are par yields calculated using a cubic spline model. In other words, these are the yields to maturity as well as coupon rates on bonds whose theoretic prices are 100. With this information in mind, you can linearly interpolate between these yields, or use a cubic spline to fill in rates at other tenors, assuming the filled-in rates are also par yields, and bootstrap this resulting &quot;par yield curve.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A better approach would be to use a large number of off-the-run Treasuries and fit a spline through them. Fed researchers provide an implementation of the Svensson model. The methodology, along with the fitted yield curve data (including zero coupon rates), are available &lt;a href=&quot;http://www.federalreserve.gov/pubs/feds/2006/200628/200628abs.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2016-07-11T18:47:24.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28029" PostTypeId="2" ParentId="28026" CreationDate="2016-07-11T19:51:17.143" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Bonds, swaps and swaptions are traded securities and their prices&#xA;  are directly observable in the market. The bond price depends&#xA;  crucially on the random fluctuation of the interest rates over the&#xA;  term of bond’s life. Unlike bonds, interest rates themselves are not&#xA;  “tradeable” securities.We only trade bonds and other fixed income&#xA;  instruments that depend on interest rates.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Your Question&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Firstly Vasicek (1977) proposed the stochastic process for the short rate $r_t$ under the physical measure to be governed by the Ornstein–Uhlenbeck process&#xA;$$dr_t=\kappa(\theta -r_t)dt+\sigma \color{red}{dW_t}\tag 1$$&#xA;where $dW_t$ is a White noise or the differential of the Wiener process. &#xA;In economic time series, the white noise series is often thought of as representing innovations , or shocks . That is, $dW_t$ represents those aspects of the time series of interest which could not have been predicted in advance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The  process $(1)$ is sometimes called the elastic random walk or mean reversion process.The instantaneous drift $\kappa(\theta -r_t)$ represents the effect of pulling the process toward its long-term mean $\theta$ with magnitude proportional to the deviation of the process from the mean. The mean reversion assumption agrees with the &lt;strong&gt;economic phenomenon&lt;/strong&gt; that interest rates appear over time to be pulled back to some long-run average value. To explain the mean reversion phenomenon, we argue that when interest rates increase, the economy slows down and there is less demand for loans; this leads to the tendency for rates to fall.Indeed&#xA;$$\mathbb{E}\left[ {{r}_{T}}|{{r}_{t}} \right]=\theta +({{r}_{t}}-\theta ){{e}^{-\kappa (T-t)}}$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastActivityDate="2016-07-11T19:51:17.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28030" PostTypeId="1" AcceptedAnswerId="28037" CreationDate="2016-07-11T20:59:15.233" Score="1" ViewCount="246" Body="&lt;p&gt;I am self studying for an actuarial exam on financial economics. I encountered the following problem and solution. It seems to me that the author intended to mean what is the probability that the price of the stock is tripled as of $t = 10$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I was curious as to what the solution would look like if we interpreted the question as asking, &quot;What is the probability that the stock will triple at some point during the next 10 years?&quot; (i.e. What is the probability that there exists a time $t \in [0, 10]$ such that $\frac{S_t}{S_0} &amp;gt; 3$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How could the problem be approached if that was the interpretation of what was being asked?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/y10eN.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/y10eN.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5641" LastEditorUserId="19887" LastEditDate="2016-07-12T11:10:05.253" LastActivityDate="2016-07-12T12:53:34.003" Title="Probability that return exceeds a certain level before a certain time (Black-Scholes)" Tags="&lt;brownian-motion&gt;&lt;lognormal&gt;&lt;stopping-time&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28032" PostTypeId="1" CreationDate="2016-07-12T07:16:35.300" Score="5" ViewCount="282" Body="&lt;p&gt;This question might be very basic but still I couldn't really find a satisfying answer anywhere.&#xA;I want to analyse the effect of a repeated event (data release) on the price of a specific asset (I have daily data) thrgouh regression (with a GARCH model for volatility).&#xA;I have already ran an event study, but I would like to see a different approach. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I run a linear regression explaining $R_{t+1}$ with several regressors : lagged return $R_{t}$, exogenous variable $E_{t}$ and the z-score of the released data $Z_{t}$ (equal to 0 on non-release days). For the sake of the argument, suppose that the regression coefficients are all significant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is : how can I use these results to build a basic trading strategy ? So far I could think of three approaches, but I would like to know whether some/all are wrong/useless/good :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Using the coefficient of the lagged return to build basic trend following (if the coeff is &gt; 0 ) or mean-reversion (is it is &amp;lt; 0)&lt;/li&gt;&#xA;&lt;li&gt;Using the coefficient of the z-score of the data to determine whether a positive value has a positive or negative effect on the return. Then, for future data, if the coeff is positive, then if $Z_{t}$ is positive, go long, else go short.&lt;/li&gt;&#xA;&lt;li&gt;Using all the coefficients to later on forecast the value of $R_{t+1}$ and invest accordingly.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Are these ways to interpret regression results investment-wise flawed or correct ? Are there others ?&lt;/p&gt;&#xA;" OwnerUserId="19457" LastActivityDate="2016-09-27T16:48:57.803" Title="Regression coefficient and basic trading strategy" Tags="&lt;quant-trading-strategies&gt;&lt;garch&gt;&lt;regression&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28033" PostTypeId="2" ParentId="27994" CreationDate="2016-07-12T07:28:13.763" Score="0" Body="&lt;p&gt;You can you any available ETL (Extraction, transformation and loading) tool this conversion. Though, there are several commercial tools available like tableau or tools from SAP and oracle. But I would recommend Pentaho Spoon which is part of &lt;a href=&quot;http://community.pentaho.com/projects/data-integration/&quot; rel=&quot;nofollow&quot;&gt;Pentaho Data Integration&lt;/a&gt; (it is a community framework). You can easily create a &lt;a href=&quot;http://wiki.pentaho.com/display/EAI/.02+Creating+a+Transformation+or+Job&quot; rel=&quot;nofollow&quot;&gt;flow&lt;/a&gt; for loading the data into SQL table.  &lt;/p&gt;&#xA;" OwnerUserId="4945" LastActivityDate="2016-07-12T07:28:13.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28035" PostTypeId="1" CreationDate="2016-07-12T08:27:55.873" Score="0" ViewCount="76" Body="&lt;p&gt;I am trying to determine (programmatically) what the current front month contract for a given futures symbol is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would guess that all futures contracts expire on a standard time relative to their exchange. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The trivial solution:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Get current month &lt;/li&gt;&#xA;&lt;li&gt;Retrieve symbol for current month&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Obviously doesn't work. Some futures don't trade on the current month, and its possible the current month's contract has closed and the next month is now trading actively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any resource available that has expiration dates for contracts that I can use? Or is there a way to determine with some simple rules what the front month currently is?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerDisplayName="user20664" LastActivityDate="2016-07-13T08:43:39.943" Title="Need a reliable source of futures expiration dates" Tags="&lt;futures&gt;&lt;expiration&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28036" PostTypeId="1" AcceptedAnswerId="28038" CreationDate="2016-07-12T08:30:16.060" Score="0" ViewCount="836" Body="&lt;p&gt;I tried to implement Matlab program computing the price of the European down and out call option using Monte Carlo and Euler discretization scheme. I have initial price S0=50, strike K=50, barrier level B=45 and time of expiration 6 months. The final price I obtain is very small(0.005). Even when I increase T to 1 or when I decrease the barrier, the price doesn't increase. I don't know what is the problem. I also have one additional question - how can I find Greeks(Delta,Vega,Gamma,Theta,Rho) with Monte Carlo simulation on this model? Here is my code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function [Price]= BlackScholes (n,m,r,T,Var,S0,K,B)&#xA;Price=1:50;&#xA;&#xA;for i=1:n&#xA;I=1;&#xA;for j = 0:(m-1);&#xA;Z(j+1)= randn (1 ,1); &#xA;dW=sqrt (T/m)*Z(j+1);&#xA;if j==0 &#xA;S(j+1) = S0*exp((r-Var/2)*(T/m)+sqrt(Var)*dW);&#xA;if (I==1) &amp;amp; (S(j+1) &amp;lt;= B)&#xA;I = 0;&#xA;end&#xA;else &#xA;S(j +1) = S(j)* exp ((r - Var /2) *(T/m) + sqrt ( Var )* dW); &#xA;if all([ I==1 , S(j+1) &amp;lt;=B])&#xA;I = 0;&#xA;end&#xA;end&#xA;end &#xA;C=zeros(n,1);&#xA;C(i)= exp(-r*T)* max ((S(m-1)-K), 0)*I;&#xA;Price = sum (C (1:n))/n; &#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot! &lt;/p&gt;&#xA;" OwnerUserId="22521" LastActivityDate="2016-12-14T13:57:22.050" Title="Black scholes model for down and out European call option using Monte Carlo" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;stochastic-processes&gt;&lt;monte-carlo&gt;&lt;european-options&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28037" PostTypeId="2" ParentId="28030" CreationDate="2016-07-12T08:45:49.923" Score="1" Body="&lt;p&gt;In that case, the problem becomes a non-trivial &lt;strong&gt;stopping time&lt;/strong&gt; problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a filtered probability space $(\Omega, \mathcal{F}, \mathbb{P})$ equipped with the natural filtration of a standard Brownian motion $W_t^\mathbb{P}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming a geometric Brownian motion for the underlying asset, one gets&#xA;$$ S_t = S_0 \exp\left((\mu-\frac{1}{2}\sigma^2)t + \sigma W_t^\mathbb{P}\right) $$&#xA;and the event $A = \left\{ \frac{S_t}{S_0} = a \right\}$, in words &quot;&lt;em&gt;the stock reaches $a$ times its initial value $S_0$ at a certain time $t$&lt;/em&gt;&quot;, can equivalently be specified as &#xA;$$ A = \left\{ W_t^\mathbb{P} = \alpha(t)\right\} $$&#xA;with &#xA;$$ \alpha(t) =\frac{\ln(a)}{\sigma} - \frac{\mu-\frac{1}{2}\sigma^2}{\sigma}t  $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Define the &lt;em&gt;hitting time&lt;/em&gt;:&#xA;$$ \tau = \inf(t \geq 0: W^\mathbb{P}_t = \alpha(t)) \tag{1} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on the above definitions, your question amounts to: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;[Part 1] Identifying the distribution of the hitting time $\tau$ &lt;/li&gt;&#xA;&lt;li&gt;[Part 2] Computing $\mathbb{P}(\tau &amp;lt; T)$. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Part 1]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all, we know that $\tau &amp;lt; \infty$ $\mathbb{P}$-a.s., since the Brownian motion has continuous sample paths and verifies:&#xA;$$ \limsup_{t \to \infty} W_t^\mathbb{P} = \infty \qquad \qquad \liminf_{t \to \infty} W_t^\mathbb{P}  = -\infty $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The tricky part is that the hitting level $\alpha$ is in fact an affine function of time and not just a constant for which standard results exist. There is a nice answer to this [Part 1] on &lt;a href=&quot;https://math.stackexchange.com/questions/1053294/density-of-first-hitting-time-of-brownian-motion-with-drift&quot;&gt;math.stackexchange&lt;/a&gt; where the following $\color{red}{\text{notations}}$ are used:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;{\color{red}{X_t}} &amp;amp;= \underbrace{W_t^\mathbb{P}}_{\color{red}{B_t}} + \underbrace{\frac{\mu - \frac{1}{2}\sigma^2}{\sigma}}_{\color{red}{c}} t &#xA;\end{align}&#xA;such that the hitting time $(1)$ can be expressed as:&#xA;$$ \underbrace{\tau}_{\color{red}{H_a}} = \inf\left(t \geq 0: {\color{red}{X_t}} = \underbrace{\frac{\ln(a)}{\sigma}}_{\color{red}{a}} \right) $$&#xA;for which it is shown that:&#xA;\begin{align}&#xA;p_{H_a}(t) &amp;amp;= \frac{d \mathbb{P}(H_a \leq t)}{d t} \\&#xA;&amp;amp;= \frac{\color{red}{a}}{\sqrt{2\pi t^3}} \exp \left(- \frac{(\color{red}{a}-\color{red}{c}t)^2}{2t} \right).&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Part 2]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now all that is left is to compute:&#xA;$$ \mathbb{P}(H_a \leq T) = \int_0^T p_{H_a}(t) dt $$&#xA;with in your case $T=10$, $a=3$, $\mu=16\%$ and $\sigma = 40\%$&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2016-07-12T12:53:34.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28038" PostTypeId="2" ParentId="28036" CreationDate="2016-07-12T11:40:52.997" Score="1" Body="&lt;p&gt;There are many things wrong with your code. I'll leave aside the manner in which it is implemented, but note that it is: (1) not Matlab friendly with all the for loops (you should vectorise), (2) the fact that you have splitted the case j==0 in the main loop is a poor coding practice.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for i=1:n&#xA;&#xA;I=1;&#xA;for j = 0:(m-1);&#xA;    Z(j+1)= randn (1 ,1);&#xA;    dW=sqrt (T/m)*Z(j+1);&#xA;    if j==0&#xA;        S(j+1) = S0*exp((r-Var/2)*(T/m)+sqrt(Var)*dW);&#xA;        if (I==1) &amp;amp; (S(j+1) &amp;lt;= B)&#xA;            I = 0;&#xA;        end&#xA;    else&#xA;        S(j +1) = S(j)* exp ((r - Var /2) *(T/m) + sqrt ( Var )* dW);&#xA;        if all([ I==1 , S(j+1) &amp;lt;=B])&#xA;            I = 0;&#xA;        end&#xA;    end&#xA;end&#xA;C=zeros(n,1);                                           %%% [1] THIS IS WRONG&#xA;C(i)= exp(-r*T)* max ((S(m-1)-K), 0)*I;                 &#xA;Price = sum (C (1:n))/n;                                %%% [2] THIS IS USELESS&#xA;&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The reason you observe very small prices, is that only the last path of your MC simulation contributes to the option price. This is because at the line marked with [1] above, you always &lt;strong&gt;reinitialise&lt;/strong&gt; the price vector as a vector full of zeros. Also note that the line [2] is pretty useless and should lie outside of the for loop.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would recommend an implementation along the lines of:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function price = mc_pricer(n,m,r,T,var,S0,K,B)&#xA;&#xA;rng(0);            &#xA;S = zeros(n,m);&#xA;S(:,1)=S0;&#xA;Z = randn(n,m-1);&#xA;t = linspace(0,T,m);&#xA;dt = diff(t);&#xA;for i=2:m&#xA;    S(:,i)=S(:,i-1).*exp( (r-var/2)*dt(i-1) + sqrt(var*dt(i-1))*Z(:,i-1) );&#xA;end&#xA;S_T = S(:,end);&#xA;payoff = max(S_T-K, 0).*(1-any(S&amp;lt;=B,2));&#xA;price = exp(-r*T)*mean(payoff);&#xA;&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-07-12T12:20:22.130" LastActivityDate="2016-07-12T12:20:22.130" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="28039" PostTypeId="1" AcceptedAnswerId="28043" CreationDate="2016-07-12T13:50:08.340" Score="5" ViewCount="2146" Body="&lt;p&gt;I am trying to learn about pairs trading strategy. I know that we have to long and short cointegrated assests simultaneously. But I still have some confusion in how the strategy works. I wrote the pseudo code for what I think pairs trading strategy is?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x=price data of asset x&#xA;y=price data of asset y&#xA;if x and y are correlated and cointegrated&#xA;&#xA; calculate pair ratio(spread) x/y or y/x?&#xA; calculate average of pair ratio(spread)&#xA;&#xA;     if spread &amp;gt; mean&#xA;     sell asset ?&#xA;     buy asset ?&#xA;     else spread &amp;lt; mean&#xA;     sell asset ?&#xA;     buy asset ?&#xA;     close if&#xA;&#xA;else&#xA;&#xA; find new pair of assets x and y&#xA; go to line 1 with new x and y&#xA;&#xA;close if&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here  I am taking pair ratio(x/y or y/x) as the spread? My first question is which pair ratio should I take x/y or y/x? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;if I take &lt;code&gt;x/y&lt;/code&gt; as spread then what assests should I &lt;code&gt;buy&lt;/code&gt; and &lt;code&gt;sell&lt;/code&gt; if &lt;code&gt;spread&amp;gt;mean&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I am wrong in my assesment of pseudo code of pair trading then feel free to correct me.&lt;/p&gt;&#xA;" OwnerUserId="16754" LastEditorUserId="16754" LastEditDate="2016-07-12T14:22:06.833" LastActivityDate="2016-07-13T09:30:50.540" Title="What is the pseudo code for a pairs trading strategy?" Tags="&lt;arbitrage&gt;&lt;pairs-trading&gt;&lt;algorithm&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28040" PostTypeId="1" AcceptedAnswerId="28052" CreationDate="2016-07-12T14:20:27.397" Score="2" ViewCount="152" Body="&lt;p&gt;In the classical Merton portfolio problem, lets assume:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dX_t \, = \, \frac{\pi_t X_t}{S_t} S_t(\mu dt +\sigma dW_t)&#xA;= \pi_t X_t (\mu dt +\sigma dW_t) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ie: zero interest rates for simplicity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We get HJB eqn:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\partial V}{\partial t} + \sup_{\pi \in \mathcal{A} } \left( \pi x \mu \frac{\partial V}{\partial x} + \frac{1}{2} \pi^2 \sigma^2 x^2 \frac{\partial^2 V}{\partial x^2}  \right) = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I calculate the optimal weight for the risky asset to be $$\pi^* = \frac{\mu}{x \sigma^2 \alpha} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is of course constant, as Merton points out. My question is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously the sum of weights corresponding to proportion of wealth invested in each asset must equal 1, but can weights be &gt;1 for a certain asset or &amp;lt;0 in the framework of this classic model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;eg: mu = 0.05, sigma = 0.2 and risk aversion alpha =1 leads to proportion in  risky asset of 1.25? Is this valid?&lt;/p&gt;&#xA;" OwnerUserId="22527" LastActivityDate="2016-07-13T07:11:33.550" Title="Merton portfolio allocation problem proportions/weights &gt;1 or &lt;0?" Tags="&lt;black-scholes&gt;&lt;merton-model&gt;&lt;stochastic&gt;&lt;stochastic-control&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28042" PostTypeId="2" ParentId="28011" CreationDate="2016-07-12T15:15:53.833" Score="2" Body="&lt;p&gt;I don't understand the order book you've set up there: available size at 1.12 is 15 so your FOK (Fill Or Kill) order as defined to fill all, at size 10, will be filled not cancelled. It would be the same for the IOC (Immediate or Cancel) at 1.12 and all 10 will be filled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're FOK or IOC order was for size 20 then the FOK would be cancelled and the IOC filled at 15 and the remaining 5 cancelled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you're really asking is how an exchange aggregates separate customer orders together and sets out which orders will be filled with which. First of all what does it matter with whom your order is filled? You're not offering credit, right? It's the exchange who handles the credit checks. Secondly, the exchange is likely to use a FIFO execution so that your 10 mio order will be filled with customer 1 at size 5 and then customer 2 at another 5 of their size 10. Then customer 2 still has an order at size 5 on the order book waiting for someone else to fill, or be cancelled. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's up to the exchange to confirm and settle payments for the orders. On value date you will send them payment of your size 10 just like the 2 customers you executed with send payment for their size 5's. The exchange back office typically uses DvP (delivery versus payment) to match deliveries of funds then makes the payments out. So they handle credit or late delivery issues, not you...&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2016-07-12T15:15:53.833" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28043" PostTypeId="2" ParentId="28039" CreationDate="2016-07-12T15:30:03.003" Score="11" Body="&lt;p&gt;The following link has a good summary of a typical pair trading strategy:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.quantstart.com/articles/Backtesting-An-Intraday-Mean-Reversion-Pairs-Strategy-Between-SPY-And-IWM&quot;&gt;https://www.quantstart.com/articles/Backtesting-An-Intraday-Mean-Reversion-Pairs-Strategy-Between-SPY-And-IWM&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It actually has full python code as well. It doesn't include a cointegration check though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if X and Y are cointegrated:&#xA;    calculate Beta between X and Y &#xA;    calculate spread as X - Beta * Y&#xA;    calculate z-score of spread&#xA;&#xA;    # entering trade (spread is away from mean by two sigmas):&#xA;    if z-score &amp;gt; 2:&#xA;        sell spread (sell 1000 of X, buy 1000 * Beta of Y)&#xA;    if z-score &amp;lt; -2:&#xA;        buy spread (buy 1000 of X, sell 1000 * Beta of Y)&#xA;&#xA;    # exiting trade (spread converged close to mean):&#xA;    if we're short spread and z-score &amp;lt; 1:&#xA;        close the trades&#xA;    if we're long spread and z-score &amp;gt; -1:&#xA;        close the trades&#xA;&#xA;# repeat above on each new bar, recalculating rolling Beta and spread etc.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="19615" LastEditorUserId="19615" LastEditDate="2016-07-13T09:30:50.540" LastActivityDate="2016-07-13T09:30:50.540" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28044" PostTypeId="1" AcceptedAnswerId="28079" CreationDate="2016-07-12T16:59:36.900" Score="1" ViewCount="873" Body="&lt;p&gt;I came across the term &lt;strong&gt;maximals&lt;/strong&gt; in &lt;a href=&quot;http://forexop.com/strategy/stop-loss-profit-placements-max-returns/&quot; rel=&quot;nofollow&quot;&gt;this article&lt;/a&gt;. Can someone explain what a maximal curve is and how you would calculate it?&lt;/p&gt;&#xA;" OwnerUserId="22529" LastEditorUserId="22529" LastEditDate="2016-07-12T17:21:38.040" LastActivityDate="2016-07-14T16:03:47.297" Title="What is a maximal curve?" Tags="&lt;fx&gt;&lt;forecasting&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28045" PostTypeId="1" AcceptedAnswerId="28051" CreationDate="2016-07-12T17:11:43.357" Score="1" ViewCount="337" Body="&lt;p&gt;I'm trying to simulate some BM for 500 observations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I got correlated increments as I needed and they are not exactly N(0,1), so I standardize them (x-mean(x))/sd(x). But then the resulting Brownian motions are doing a weird elliptic shape and end up back on the x-axis. So I simulated fresh N(0,1) and used the standardizing function on them again (shouldnt do anything, should it?), but got the same result. &lt;a href=&quot;https://i.stack.imgur.com/pXqUk.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/pXqUk.png&quot; alt=&quot;Simulated BM after normalisation&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea why is that? Why do they all (100 paths) converge exactly to zero? I guess it must be the normalisation function, but I cannot figure out why would they all go to zero because of that? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My code in R: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;simGBM&amp;lt;-function(cov=TRUE,secs=100,Tau=500,sigma=0.05,neg.cor=0.3){&#xA;if(cov==TRUE){&#xA;#  s&amp;lt;-apply(simSeries(simCov(secs,neg.cor),Tau),2,normalise)&#xA;m&amp;lt;-simCov(secs,neg.cor)&#xA;s&amp;lt;-simSeries(m,Tau)&#xA;}  else {&#xA;s&amp;lt;-matrix(rnorm(secs*Tau),ncol=secs)}&#xA;&#xA;&#xA;dt&amp;lt;-1/(Tau)&#xA;BM&amp;lt;-apply(s,2,function(x) cumsum(sqrt(dt)*x))&#xA;GBM&amp;lt;-apply(BM,2,function(x) 100*exp((-0.5*sigma*sigma*dt+sigma*x)))&#xA; if(cov==TRUE) {return(list(GBM=matrix(GBM,ncol=secs),cov=m))}&#xA;else{return(matrix(GBM(ncol=secs)))}&#xA;  }&#xA;&#xA;&#xA;normalise&amp;lt;-function(x){&#xA;  ( (x-mean(x))/sd(x) )&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The s is either a series that I simulated with a some covariance structure, or pure white noise.&#xA;Just to clarify, if I dont use the scaling function everything is &lt;strong&gt;ok&lt;/strong&gt; and looks like it works correctly - checked against 'proven correct' examples. &lt;/p&gt;&#xA;" OwnerUserId="22237" LastEditorUserId="22237" LastEditDate="2016-07-13T08:01:18.570" LastActivityDate="2016-07-13T08:19:29.020" Title="Brownian motion simulation - scaling issue" Tags="&lt;r&gt;&lt;brownian-motion&gt;&lt;simulations&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28048" PostTypeId="2" ParentId="28036" CreationDate="2016-07-12T21:34:31.307" Score="2" Body="&lt;p&gt;Besides the code's problem, I highly recommend the Brownian Bridge correction method which can compensate the pricing error resulting from discretization of the continuous path.&lt;/p&gt;&#xA;" OwnerUserId="22533" LastActivityDate="2016-07-12T21:34:31.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28051" PostTypeId="2" ParentId="28045" CreationDate="2016-07-13T06:49:06.163" Score="1" Body="&lt;p&gt;Seems like you are running cumsum on a normalised vector - which'll give you zero as the end value for each path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, in the GBM, the drift term (-sigma^2*dT) needs to accumulate over time.&lt;/p&gt;&#xA;" OwnerUserId="17405" LastActivityDate="2016-07-13T06:49:06.163" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28052" PostTypeId="2" ParentId="28040" CreationDate="2016-07-13T07:11:33.550" Score="2" Body="&lt;p&gt;Your statement should be correct, the weights into the risky asset are not bounded between $0$ and $1$. Essentially, by setting $r=0$ you omit the term which shows that your weights always sum up to one, simply by choosing the weight for the risk-free asset to be $1-\pi^*$. &#xA;In other words, obtaining $\pi^*&amp;gt;1$ simply implies you go short in the risk-free asset. Risk seeking investors (low $\alpha$) will choose to leverage by lending risk-free and putting that money into the stock. &lt;/p&gt;&#xA;" OwnerUserId="16249" LastActivityDate="2016-07-13T07:11:33.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28053" PostTypeId="1" CreationDate="2016-07-13T08:28:06.007" Score="0" ViewCount="257" Body="&lt;p&gt;I have seen formulas that have cracked the future value of growing annuity where there are monthly payments and yearly growth rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But given a future value, is it possible to derive the present value of annuity that is monthly in nature and grows on a yearly basis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. I want a retirement corpus of say $1,000,000 in 2040. What should be my monthly savings over the next 24 years such that monthly savings amount grows by 5% every year. The rate or return can be assumed to be 3%&lt;/p&gt;&#xA;" OwnerUserId="22540" LastEditorUserId="22540" LastEditDate="2016-07-13T08:36:27.177" LastActivityDate="2016-07-13T16:13:55.177" Title="Is there a formula for present value of a growing annuity with yearly payment growth and monthly payments?" Tags="&lt;present-value&gt;&lt;annuity&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2016-07-13T16:35:38.753" ContentLicense="CC BY-SA 3.0" />
  <row Id="28054" PostTypeId="2" ParentId="28035" CreationDate="2016-07-13T08:43:39.943" Score="2" Body="&lt;p&gt;Any premium data provider (e.g. Reuters, Bloomberg) will provide this information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are looking for free data, you could check out the individual contract data on &lt;a href=&quot;https://www.quandl.com/browse?idx=database-browser_futures-data_united-states_individual-contracts&quot; rel=&quot;nofollow&quot;&gt;Quandl&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the contract that will expire next is not necessarily the most liquid contract, and that many underliers have multiple liquid contracts trading at any one time (especially commodities and interest rate futures). Also, just because a contract is tradable, does not mean that you should trade it! As one example, you generally don't want to be long a contract that has physical delivery after the first notice date.&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2016-07-13T08:43:39.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28055" PostTypeId="1" CreationDate="2016-07-13T09:06:12.277" Score="2" ViewCount="131" Body="&lt;p&gt;Brexit saw a lot of volatility in the market. Pound crashed to record lows and the market still seems recovering. Manual traders lost a lot of money. How did the Algos performed?&lt;/p&gt;&#xA;" OwnerUserId="22356" LastActivityDate="2016-07-13T09:06:12.277" Title="How did the algo trading firms perform during Brexit?" Tags="&lt;algorithmic-trading&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ClosedDate="2016-07-13T11:29:09.903" ContentLicense="CC BY-SA 3.0" />
  <row Id="28056" PostTypeId="1" CreationDate="2016-07-13T09:21:07.867" Score="4" ViewCount="983" Body="&lt;p&gt;Modern Portfolio Theory Optimization Problem is based on expected &lt;strong&gt;linear returns&lt;/strong&gt; and covariances of &lt;strong&gt;linear returns.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's said, variance and expected return of a portfolio based on linear returns &lt;em&gt;r&lt;/em&gt; are computed as following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma^2_p = w'\Sigma w$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E_p = \sum_{i=1}^{N}w_ir_i$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if using log-returns &lt;em&gt;R&lt;/em&gt; instead of linear-returns &lt;em&gt;r&lt;/em&gt;,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R = \log(1+r)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the expected log-return of a portfolio is computed as following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E_p = \log\left( \sum_{i=1}^{N} w_i e^{R_i} \right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am struggling to find out the formula to compute the variance of the portfolio based on log-returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. Actually, my goal is to compute the semi-variance of a portfolio semi-covariances matrix based on log-returns.&lt;/p&gt;&#xA;" OwnerUserId="19042" LastEditorUserId="924" LastEditDate="2016-07-13T11:42:27.980" LastActivityDate="2016-07-13T11:42:27.980" Title="Variance of a portfolio based on log-returns" Tags="&lt;log-returns&gt;&lt;covariance-matrix&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28058" PostTypeId="2" ParentId="19607" CreationDate="2016-07-13T11:56:55.727" Score="-1" Body="&lt;p&gt;Sorry if this is late, but this is the bible of Heston (and it has code) &lt;a href=&quot;https://www.amazon.co.uk/Heston-Model-Extensions-Matlab-Finance-ebook/dp/B00EMADBN2/ref=sr_1_1?ie=UTF8&amp;amp;qid=1468410988&amp;amp;sr=8-1&amp;amp;keywords=Heston+matlab&quot; rel=&quot;nofollow&quot;&gt;https://www.amazon.co.uk/Heston-Model-Extensions-Matlab-Finance-ebook/dp/B00EMADBN2/ref=sr_1_1?ie=UTF8&amp;amp;qid=1468410988&amp;amp;sr=8-1&amp;amp;keywords=Heston+matlab&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11762" LastActivityDate="2016-07-13T11:56:55.727" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28059" PostTypeId="1" AcceptedAnswerId="28063" CreationDate="2016-07-13T11:58:12.420" Score="7" ViewCount="580" Body="&lt;p&gt;Is there a way to reduce oscillations for the numerical integration when evaluating the Heston model. I am pricing a series of 5000 options scattered over the Heston model parameter space and  I find that for some parameters, often deep-out-of-the-money options I get negative option prices. I am using 32 Gauss-Laguerre integration, so the integration grid is rather fine, also I have tried extending the maturities to say 10 years, but this only reduces the frequency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not I guess Monte-Carlo is the only way to make sure I get no negative prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks &#xA;Sam&lt;/p&gt;&#xA;" OwnerUserId="11762" LastActivityDate="2019-03-22T11:59:40.230" Title="Heston Model Integration Oscillations" Tags="&lt;options&gt;&lt;derivatives&gt;&lt;numerical-methods&gt;&lt;heston&gt;" AnswerCount="5" CommentCount="1" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="28061" PostTypeId="1" AcceptedAnswerId="28062" CreationDate="2016-07-13T13:30:25.230" Score="1" ViewCount="262" Body="&lt;p&gt;I'm self studying for an actuarial exam and I am curious about a property of the antithetic variate method for increasing the Monte Carlo price accuracy (i.e. For every random draw of $z$, also include a draw of $-z$ in the simulation).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume the Black-Scholes framework and consider a European call option with strike $K$ expiring in $T$ years on a non-dividend paying stock currently priced at $S_0$ with an annual volatility $\sigma$. Suppose that a Monte Carlo simulation is used to estimate the expected value at expiration of the option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The simulation was performed using $n$ draws $u_1, u_2, ..., u_n$ from a uniform distribution to generate the stock price. Suppose that each of these draws generates a stock price at expiration which gives a zero payoff for the call option and therefore $E(\text{Payoff}) = \frac{1}{n} \sum_{i = 1}^n C(S_T^i, K, T) = 0$, where $S_T^i$ is the stock price at expiration for the $i$th draw.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the same uniform draws, and applying the antithetic variate method, will $E(\text{Payoff}) = \frac{1}{2n} \sum_{i = 1}^{2n} C(S_T^i, K, T) &amp;gt; 0$ necessarily?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My intuition says yes, but I don't have a way of convincing myself why.&lt;/p&gt;&#xA;" OwnerUserId="5641" LastActivityDate="2016-07-14T02:28:06.913" Title="Monte Carlo Accuracy - Antithetic Variate Method" Tags="&lt;monte-carlo&gt;&lt;self-study&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28062" PostTypeId="2" ParentId="28061" CreationDate="2016-07-13T13:36:52.640" Score="2" Body="&lt;p&gt;No, you can have &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{1}{2n}\sum_{i=1}^{2n} C(S^i_T,K,T) = 0&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First off, there's the obvious case where $n=1$ and $u_1 = 0.5$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally, for options way out of the money it is common to have &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{1}{n}\sum_{i=1}^{n} C(S^i_T,K,T) = 0&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;even for very large $n$.   Antithetic sampling does not change that.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2016-07-13T13:36:52.640" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28063" PostTypeId="2" ParentId="28059" CreationDate="2016-07-13T14:10:02.270" Score="7" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;In SV model, it is well-known that the integrand for the call price can sometimes&#xA;  show high oscillation, can dampen very slowly along the integration&#xA;  axis, and can show discontinuities.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Remedy&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The ‘‘&lt;a href=&quot;https://perswww.kuleuven.be/~u0009713/HestonTrap.pdf&quot; rel=&quot;nofollow&quot;&gt;Little Trap&lt;/a&gt;’’ formulation of Albrecher et al.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Also , you can use Fourier transforms&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.researchgate.net/publication/238318718_Spanning_and_Derivative-Security_Valuation&quot; rel=&quot;nofollow&quot;&gt;Bakshi and Madan (2000)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.optioncity.net/pubs/ch1excerpt.pdf&quot; rel=&quot;nofollow&quot;&gt;Lewis,(2001)&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://down.cenet.org.cn/upfile/10/200886193225139.pdf&quot; rel=&quot;nofollow&quot;&gt;Gatheral (2006&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://engineering.nyu.edu/files/jcfpub.pdf&quot; rel=&quot;nofollow&quot;&gt;Carr and Madan (1999)&lt;/a&gt; &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-07-14T02:29:47.227" LastActivityDate="2016-07-14T02:29:47.227" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28064" PostTypeId="2" ParentId="28053" CreationDate="2016-07-13T16:13:55.177" Score="1" Body="&lt;p&gt;A simple query on google could have given you the answer...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's define&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;lumpsum &lt;em&gt;q&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;periodic contribution &lt;em&gt;a&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;y&lt;/em&gt; periods&lt;/li&gt;&#xA;&lt;li&gt;a periodic rate &lt;em&gt;i&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$$q*(1+i)^y + a(  ((1+i)^y-1) / i ) - a = f$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose we do not want an initial investment $q=0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2040 - 2016 = 24 years. As you want to know the monthly contribution, everything needs to be converted to months. Thus 24 years equals $y=288$ months. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The 5% yearly return needs to be converted to a monthly return as well. $1,05^{1/12} - 1 = i=0.4\% $.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally let's put a monthly contribution of $a=\$1857.66$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Putting that in the formula gives us +/- $1,000,000.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By rearranging the formula, we isolate the contribution amount &lt;em&gt;a&lt;/em&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$a = (i * (f -q*(i+1)^y))/((i+1)^y-i-1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which gave us a monthly contribution of $1857.66&lt;/p&gt;&#xA;" OwnerUserId="19042" LastActivityDate="2016-07-13T16:13:55.177" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28066" PostTypeId="1" CreationDate="2016-07-13T20:48:22.133" Score="2" ViewCount="1294" Body="&lt;p&gt;I will try to use SABR Model to price call options in FX market. What does it mean to calibrate the model? As far as my understanding of the Wikipedia article goes, it means to estimate the parameters. In this case: Alpha, Beta and the correlation of the wiener process. Have I understood correctly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If yes, Can I estimate the parameters from price history or does it have to option prices?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&#xA;Sanjay, India&lt;/p&gt;&#xA;" OwnerUserId="22550" LastEditorUserId="-1" LastEditDate="2016-07-15T01:11:40.687" LastActivityDate="2016-07-19T11:18:25.663" Title="How does one calibrate a stochastic volatility model?" Tags="&lt;option-pricing&gt;&lt;implied-volatility&gt;&lt;stochastic-volatility&gt;&lt;calibration&gt;&lt;sabr&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28067" PostTypeId="2" ParentId="28059" CreationDate="2016-07-13T21:16:40.540" Score="4" Body="&lt;p&gt;I'd use FFT or similar rather than direct integration. Here is an old paper with Heston example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.math.nyu.edu/~atm262/fall06/compmethods/a1/Fractional_FFT.pdf&quot; rel=&quot;nofollow&quot;&gt;Option pricing using fractional FFT&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-07-13T21:16:40.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28068" PostTypeId="2" ParentId="28059" CreationDate="2016-07-14T01:06:59.857" Score="7" Body="&lt;p&gt;There has been a huge amount of work on this. Generally a Fourier transform approach is used. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, be careful to use the form of the characteristic function that does not wind about zero in order to avoid having to count the normal of windings. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, using contour shifts can make the integral much better behaved. eg integrate along the line with $0.5$ imaginary part to price a covered call. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Third, use a Black--Scholes call with the same strike as a control. This removes poles and makes the integrand much nicer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For details, see my book More Mathematical Finance Chapter 17 and/or my paper&#xA;&lt;a href=&quot;http://ssrn.com/abstract=1941464&quot; rel=&quot;noreferrer&quot;&gt;http://ssrn.com/abstract=1941464&lt;/a&gt; Fourier Transforms, Option pricing and controls. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2016-07-14T01:06:59.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28069" PostTypeId="2" ParentId="28061" CreationDate="2016-07-14T02:28:06.913" Score="0" Body="&lt;p&gt;No. Antithetic variable method is usually for generating smaller standard error than your non-antithetic method, which is a direct result of the negative correlation between original variable and the antithetic variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For OTM option, there definitely will be a lot of path ending up with value 0. What may be a choice is to use importance sampling.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Write out the expectation under RN measure and manually extract another normal density with higher mean (in this case). Then use Monte Carlo method to get this new expectation. You can certainly apply antithetic method to it also to reduce the SE.&lt;/p&gt;&#xA;" OwnerUserId="22533" LastActivityDate="2016-07-14T02:28:06.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28070" PostTypeId="2" ParentId="28066" CreationDate="2016-07-14T03:01:08.117" Score="3" Body="&lt;p&gt;Indeed parameters are selected so that the quoted option prices are as close&#xA;as possible to the model option prices. Alternatively, quoted and model implied&#xA;volatilities can be used instead of prices.The first category are those that minimize the error between quoted and model. The second category,are those that minimize the error between quoted and model implied volatilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use these&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.mathworks.com/help/fininst/calibrating-the-sabr-model.html?requestedDomain=www.mathworks.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.mathworks.com&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/21462/sabr-implied-volatility-and-option-prices/26268#26268&quot;&gt;SABR Implied Volatility and Option Prices&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerDisplayName="user16651" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-07-14T03:01:08.117" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28072" PostTypeId="2" ParentId="24781" CreationDate="2016-07-14T09:34:46.383" Score="5" Body="&lt;p&gt;In a vanilla swap, the IR on the floating leg usually depends on the reset period/swap frequency. If frequency is 6m, 6m LIBOR is used for reset, 3m LIBOR for quarterly resets etc. In a floating CMS leg, the rate used is the CMS rate, regardless of the reset frequency e.g: 10yr CMS leg will use the 10 yr CMS rate, regardless of whether the reset happens semi-annually or quarterly (of course, the rate will be multiplied by the accruing factor to make the dollar interest proportional to the length of the accruing period)&lt;/p&gt;&#xA;" OwnerUserId="22555" LastActivityDate="2016-07-14T09:34:46.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28073" PostTypeId="1" CreationDate="2016-07-14T10:54:01.030" Score="3" ViewCount="206" Body="&lt;p&gt;How to deal with skewness of returns when evaluating different trading strategies? More specifically, I'm back testing different strategies to be implemented as an automated black box strategy. While e.g. Sharpe ratio is a convenient and intuitively simple way to compare the strategies, but if the returns are not normally distributed it is vastly inadequate measure if one considers e.g. the use of leverage. This point is all the more important, when one considers e.g. many of the dynamic strategies like momentum that typically has a negative skew.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This leads me to my question: what is the most convenient way/is there an industry standard to comparing the skew of a trading strategy? Or does everybody simply use max drawdown to evaluate the possibility of the strategy blowing up and as a guideline when considering how much leverage to use?&lt;/p&gt;&#xA;" OwnerUserId="18607" LastActivityDate="2016-07-14T15:38:40.770" Title="Evaluating trading strategies by the skewness of returns" Tags="&lt;portfolio-management&gt;&lt;skew&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28074" PostTypeId="2" ParentId="27993" CreationDate="2016-07-14T13:34:19.313" Score="5" Body="&lt;p&gt;&lt;strong&gt;The answer is NO, with very few exceptions&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There might be bonds with negative coupon(s), and the Bloomberg search even finds some, but there are plenty of reasons why negative coupons are impractical. &#xA;Instead of having negative coupons on the issue, there are bonds with low or 0 coupons, issued at a premium and having a negative yield.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are some of the reasons I can think of why negative coupons are problematic:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-) &lt;strong&gt;Default risk&lt;/strong&gt;: For debt instruments an important thing is the credit rating of the issuer. Ultimately, this translates into default risk, meaning any outstanding coupon payments and the nominal are at risk. A negative coupon would make the bond holder pay, exposing the bond issuer to credit risk. In general terms, this credit risk profile would be very inhomogeneous as the issuer typically has no control over the entity that holds the bond. Almost like a portfolio of bank loans. Even worse, because the issuer has little knowledge about the bond holders. In addition, bond holders can change if security is traded on the secondary market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-) &lt;strong&gt;Settlement/Clearing&lt;/strong&gt;: As far as I know, the large houses (such as Euroclear, Clearstream) &lt;a href=&quot;http://www.clearstream.com/blob/76964/4795b03fa638fa023e04f260e894e3b3/icsd-neg-coupons-aug2015-pdf-data.pdf&quot;&gt;refuse to take care of negative coupons&lt;/a&gt;. Additionally, for floating rate coupons, they comment the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Securities with a floating rate coupon and an interest rate calculation linked to a negative benchmark interest rate may result in a theoretical negative coupon. However, such coupons would usually be announced as ‘NIL payment’ or ‘coupon pays zero’. The possible reasons are the following: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a ‘floor level rate’ (total or benchmark interest rate) has been defined in the terms and conditions of such securities &lt;/li&gt;&#xA;&lt;li&gt;the issuer does not exercise the right to collect negative interest due to the administrative burden and cost of such an operation&lt;/li&gt;&#xA;&lt;li&gt;the terms and conditions of the security define that the interest payment is due to be paid from the issuer to the investor and there is no reverse covenant in place for the investor to pay the issuer.&quot;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;-) &lt;strong&gt;Taxation&lt;/strong&gt;&#xA;In a lot of countries there are taxes on interest income such as coupons for some or all investors. While things are clear for positive coupons, what happens if there are negative coupons? Does the issuer have to pay taxes on interest income for that? Can a bond holder use these as offsetting losses?&#xA;I'm far from being a tax expert but I think there are plenty more questions on this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-) &lt;strong&gt;Trading&lt;/strong&gt; will also be an issue. With negative accrued interests, things could get a little messy. But while the issuer needs to collect coupons from many different entities, this is usually a 1:1 thing meaning that there simply could be a cash payment the size of the accrued interest (which is negative) attached to the trade. In fact, this already happens when a bond is traded between the &quot;ex-date&quot; of the coupon and the factual payment date. So the secondary market should be of little concern.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For the sake of completeness: you can find bonds with negative coupons:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Bloomberg search&lt;/strong&gt;: If you search Bloomberg if there are bonds with negative coupons, the search results are almost 0. There are, as a matter of fact, some bonds with negative coupons in the system. For those bonds, I can only imagine that there is a close connection between the issuer and the bond holder(s), making a rigorous collection of coupon payments possible. See also &lt;a href=&quot;http://www.reuters.com/article/global-bonds-negative-coupons-idUSL8N16B3T8&quot;&gt;this&lt;/a&gt; article.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastEditorUserId="185" LastEditDate="2016-07-15T01:23:48.390" LastActivityDate="2016-07-15T01:23:48.390" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28075" PostTypeId="1" AcceptedAnswerId="28077" CreationDate="2016-07-14T13:38:17.740" Score="2" ViewCount="1087" Body="&lt;p&gt;For pricing variance swaps there is the well-known formula as sum of OTM options weighted by the inverse of the squared strike (see e.g. &lt;a href=&quot;http://www.investopedia.com/articles/active-trading/070213/tracking-volatility-how-vix-calculated.asp&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would it also be valid to derive the local-volatility surface from option prices and then do a Monte-Carlo simulation of future paths and calculate the variance from these prices?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case you have a local-vol surface ready this would be a nice way to calculate the var-swap-rate.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-07-14T14:30:20.850" Title="Pricing variance swaps using Monte Carlo" Tags="&lt;monte-carlo&gt;&lt;vix&gt;&lt;local-volatility&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28076" PostTypeId="2" ParentId="28073" CreationDate="2016-07-14T13:49:36.017" Score="4" Body="&lt;p&gt;You do not state whether your evaluations will result in potentially implementing multiple strategies or just one of them.  This matters because if you are going to be combining multiple ones then you need some reasonable capital allocation assumptions, which increases complexity immensely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's take the simpler case where you just want to choose one.  Multiple metrics depend on the strategy size, of which unscalable mean/variance (Sharpe) ratios are just one.  For example, size affects trading costs, market impact, and broker fees.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, I suggest you choose a few candidate strategy sizes (in terms of capital) and do your analysis just on them.  You can then properly add costs and market impact, and you do not need to worry about scaling.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll further add that if negative skew is important you may wish to look at downside deviation and &lt;a href=&quot;https://en.wikipedia.org/wiki/Sortino_ratio&quot; rel=&quot;nofollow&quot;&gt;Sortino ratios&lt;/a&gt; in addition to Sharpe and max drawdown.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2016-07-14T15:38:40.770" LastActivityDate="2016-07-14T15:38:40.770" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28077" PostTypeId="2" ParentId="28075" CreationDate="2016-07-14T13:53:52.190" Score="2" Body="&lt;p&gt;It is valid to do that, but if your local volatility surface is calibrated to the same OTM options, then your price will converge to the same answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A local volatility surface is mainly a way of treating path-dependent options consistently with the option volatility surface.  Variance swaps are path dependent on the face of it, but as you note the math works out such that they have a representation as a portfolio of path-independent options.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2016-07-14T13:53:52.190" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28078" PostTypeId="2" ParentId="28075" CreationDate="2016-07-14T14:22:01.773" Score="1" Body="&lt;p&gt;The only problem I see with this approach, which remains completely valid from a theoretical perspective, is the embedded (and probably not accounted for) calibration risk: what if your LV surface does not allow you to correctly reproduce the observed vanilla option prices in the first place? In that case, you'll have lost information in the process and always produce biased variance swap prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some remarks:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The &quot;model-free&quot; method you refer to in your link is an approximation of its own: if you want to incorporate real-life details such as discrete variance sampling or cash dividends, you're better off using MC simulations based on your in-house (jump-)diffusion model than using the Carr-Madan based formula, which only holds in the continuous time limit, for pure diffusive processes.&lt;/li&gt;&#xA;&lt;li&gt;A corollary of the Carr-Madan approach is that, if you take 2 purely diffusive models perfectly calibrated to the vanilla options market, be it a local volatility model and a stochastic volatility model such as Heston, then both of these models should give exactly the same variance swap par rates. So you could equivalently store Heston parameters. Since there are only 5 of them, there is even less data to store/maintain than with a local volatility model.&lt;/li&gt;&#xA;&lt;li&gt;Finally, while pricing variance swaps using Monte Carlo is the most general approach, for some models, e.g. Heston, closed-form formulas exist. This can be helpful when computational burden becomes a concern.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-07-14T14:30:20.850" LastActivityDate="2016-07-14T14:30:20.850" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="28079" PostTypeId="2" ParentId="28044" CreationDate="2016-07-14T15:34:25.077" Score="0" Body="&lt;p&gt;The article says: Taking the volatility as input these curves will tell me the probability of a maximum price (either up or down) being reached. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using standard deviation of price data a volatility is calculated into a pips per hour number. That's nice. Based on that calculation the &quot;maximal&quot; gives probabilities that a market moves a particular distance over a particular time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You calculate the maximal using a &lt;a href=&quot;https://en.wikipedia.org/wiki/Probability_density_function&quot; rel=&quot;nofollow&quot;&gt;probability density function&lt;/a&gt;. That article uses a random walk function and has a &lt;a href=&quot;http://forexop.com/?wpdmact=4734&quot; rel=&quot;nofollow&quot;&gt;spreadsheet&lt;/a&gt; you can download.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore this &quot;maximal&quot; can be used as a probability for stops and profit targets being hit, because they are set a certain distance away from a current price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is historical volatility is not a guide to future volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess what you could do is get into a trade, set your stops and targets for a particular time using these maximals, and if they aren't hit - given a margin for error - you take profit anyway because the calculations were &quot;wrong&quot;.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastEditorUserId="7369" LastEditDate="2016-07-14T16:03:47.297" LastActivityDate="2016-07-14T16:03:47.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28081" PostTypeId="1" CreationDate="2016-07-14T16:55:48.077" Score="-1" ViewCount="872" Body="&lt;p&gt;I want to use either the skew normal copula or the skew t copula with a time-varying correlation matrix. But so far I haven't found any way to implement this either in R or Matlab.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would anyone be able to help, does anyone maybe have a code available from some previous work? Or maybe do you know someone who works with copulas for risk management purposes? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the literature I see that there are a few definitions available for these distributions (the skew t for example is defined differently in &lt;a href=&quot;https://arxiv.org/pdf/0911.2342.pdf&quot; rel=&quot;nofollow&quot;&gt;Azzalini &amp;amp; Capitanio (2003)&lt;/a&gt;, &lt;a href=&quot;http://www.ressources-actuarielles.net/EXT/ISFA/1226.nsf/0/303eb11b4d617b79c1257b0800744575/$FILE/t%20copula%20demarta%20mcneil.pdf&quot; rel=&quot;nofollow&quot;&gt;Demarta, S. and A. J. McNeil (2005)&lt;/a&gt; or &lt;a href=&quot;http://www.southampton.ac.uk/~sks/research/papers/sahudeybranco.pdf&quot; rel=&quot;nofollow&quot;&gt;Sahu, Dey &amp;amp; Branco (2003)&lt;/a&gt;). Any definition of the skew normal or t you find in the literature is fine with me. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help is appreciated!&lt;/p&gt;&#xA;" OwnerUserId="20573" LastEditorUserId="467" LastEditDate="2016-12-13T02:35:48.237" LastActivityDate="2017-05-12T04:57:22.647" Title="How to fit a skew normal/t copula to data?" Tags="&lt;programming&gt;&lt;risk-management&gt;&lt;copula&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28082" PostTypeId="1" AcceptedAnswerId="28083" CreationDate="2016-07-14T17:26:50.297" Score="0" ViewCount="218" Body="&lt;p&gt;I encountered the following slide in a lecture on Ito's Lemma.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/puEQT.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/puEQT.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The lecturer explained that $$\frac{\partial V}{\partial t} = 0$$ because the first two derivatives on the slide already took into account time into the change of the value of V.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not convinced. If $V = \log S(t)$ is a function of time, why wouldn't we have to use the chain rule for the third derivative on the slide?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\partial V}{\partial t} = \frac{\partial V}{\partial S(t)} \cdot \frac{\partial S(t)}{\partial t} = S^{-1} \cdot \frac{\partial S(t)}{\partial t} = ...$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure where to go from here to show that it is in fact 0.&lt;/p&gt;&#xA;" OwnerUserId="5641" LastActivityDate="2016-07-26T09:48:53.407" Title="Is there a better, more rigorous explanation for why this partial derivative is 0 using Ito's Lemma?" Tags="&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28083" PostTypeId="2" ParentId="28082" CreationDate="2016-07-14T17:37:36.730" Score="3" Body="&lt;p&gt;A process indeed depends on time $t$. However, in Ito's lemma, only derivatives with respect to independent time variable $t$ is considered. That is, for a process of the form $f(S_t, t)$, $\frac{\partial f}{\partial t}$ is the derivative with respect to the second, that is, the independent, $t$ variable, however, the parameter $t$ in the process $S_t$ is not considered. Ito's lemma takes a particular form, which can not be understood in the normal calculus sense.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-07-14T17:37:36.730" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28084" PostTypeId="1" AcceptedAnswerId="28086" CreationDate="2016-07-14T20:52:00.547" Score="5" ViewCount="268" Body="&lt;p&gt;What is the probability that the arithmetic OU process $dx_t= \theta(\mu-x_t)dt+\sigma dW_t$ hits barrier $U$ before hitting barrier $L$ when  $L&amp;lt;x_0&amp;lt;U$ ?&lt;/p&gt;&#xA;" OwnerUserId="22208" LastEditorUserId="22208" LastEditDate="2016-07-14T21:05:36.980" LastActivityDate="2016-07-18T13:07:46.023" Title="What is the probability that a OU process hits an upper barrier U before a lower barrier L?" Tags="&lt;options&gt;&lt;stochastic-calculus&gt;&lt;mean-reversion&gt;&lt;barrier&gt;&lt;stopping-time&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28085" PostTypeId="1" CreationDate="2016-07-15T08:48:59.237" Score="3" ViewCount="582" Body="&lt;p&gt;I'm looking into the quasi-Gaussian model with linear local volatility as explained by Andersen and Piterbarg (Interest Rate Modeling, Volume 2). I'm trying to calibrate this model and implement it. I wonder if any of you knows where I can get a C++ or Matlab code for such model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks&lt;/p&gt;&#xA;" OwnerUserId="6910" LastActivityDate="2016-07-15T08:48:59.237" Title="Code for quasi-Gaussian model (Cheyette model)" Tags="&lt;interest-rates&gt;&lt;calibration&gt;&lt;local-volatility&gt;&lt;codes&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28086" PostTypeId="2" ParentId="28084" CreationDate="2016-07-15T09:47:11.090" Score="3" Body="&lt;p&gt;Assuming $\theta&amp;gt;0$ (take $\tilde{X}=\mu-X$ if it is not the case)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us denote $\text{erfi}(x)$ the imaginary error function&#xA;Let us denote $\tau_L$,resp.$\tau_U$ the hitting time of $L$resp.$U$ where $L&amp;lt;U$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Using Ito's lemma, prove that :&#xA;$$Y_t = \text{erfi}\left(\sqrt{\frac{\theta}{\sigma^2}}\left(X_t-\mu\right)\right) \text{ is a martingale}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Using optimal stopping theorem, prove that :&#xA;$$\mathbb{P}(\tau_L\leq \tau_U) = \frac{\text{erfi}\left(\sqrt{\frac{\theta}{\sigma^2}}\left(x_0-\mu\right)\right)-\text{erfi}\left(\sqrt{\frac{\theta}{\sigma^2}}\left(U-\mu\right)\right)}{\text{erfi}\left(\sqrt{\frac{\theta}{\sigma^2}}\left(L-\mu\right)\right)-\text{erfi}\left(\sqrt{\frac{\theta}{\sigma^2}}\left(U-\mu\right)\right)}$$&lt;/p&gt;&#xA;" OwnerUserId="20201" LastEditorUserId="20201" LastEditDate="2016-07-18T13:07:46.023" LastActivityDate="2016-07-18T13:07:46.023" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="28087" PostTypeId="1" AcceptedAnswerId="28093" CreationDate="2016-07-15T10:15:34.833" Score="3" ViewCount="226" Body="&lt;p&gt;I have to deal with this one-factor model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation*}&#xA;\begin{cases}&#xA;dS_t = \alpha \bigl(\mu - \log(S_t) \bigr)S_t \, dt + \sigma S_{t} \, dW_t \, , t \geq 0,\\&#xA;S|_{t=0} = S_0 &amp;gt; 0,&#xA;\end{cases}&#xA;\end{equation*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which gives me the following PDE for an European Call option:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation*}&#xA;\begin{cases}&#xA;\frac{\partial V}{\partial t} + \Bigl [ \alpha \Bigl(\mu - \frac{\lambda}{\alpha} - \log (S) \Bigr) S \Bigr ] \frac{\partial V}{\partial S} + \frac{1}{2} \sigma^2 S^2 \frac{\partial^2 V}{\partial S^2} - rV = 0, \\&#xA;V(S,T) = (S -K)^+,&#xA;\end{cases}&#xA;\end{equation*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the parameter $\lambda$ represents the risk premium. Solving numerically the PDE, if I increase $\lambda$ (usually I take positive values) then the price of the option decreases. Is it possible? And what is the economic interpretation of this phenomenon? Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="22566" LastActivityDate="2016-07-15T16:02:21.037" Title="Interpretation of Risk Premium for Schwartz one-factor model" Tags="&lt;risk&gt;&lt;market&gt;&lt;price&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28090" PostTypeId="1" CreationDate="2016-07-15T11:52:31.827" Score="1" ViewCount="327" Body="&lt;p&gt;I recently stumbled over Poisson Disk Sampling (&lt;a href=&quot;https://www.jasondavies.com/poisson-disc/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; and the  &lt;a href=&quot;https://bl.ocks.org/mbostock/dbb02448b0f93e4c82c3&quot; rel=&quot;nofollow&quot;&gt;meditative version&lt;/a&gt;). I wonder if it is an alternative to crude or quasi Monte Carlo for very high dimensional integrals. It is not mentioned in Glasserman's Monte Carlo Methods so I suspect there is some draw-back.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Questions&lt;/h2&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What is known about convergence rates when using Poisson Disk sampling for high dimensional cubature (d&gt;100)?&lt;/li&gt;&#xA;&lt;li&gt;How efficient is the creation of Poisson Disk Samples for high dimensional domains?&lt;/li&gt;&#xA;&lt;li&gt;Is it an alternative to Quasi Monte Carlo methods such as Sobol or Halton sequences? If not, why not?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="482" LastEditorUserId="482" LastEditDate="2016-07-16T07:17:21.207" LastActivityDate="2016-07-19T11:47:27.603" Title="Is Poisson Disk Sampling an alternative to crude Monte Carlo and QMC?" Tags="&lt;option-pricing&gt;&lt;stochastic-processes&gt;&lt;monte-carlo&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28091" PostTypeId="1" CreationDate="2016-07-15T12:00:02.567" Score="19" ViewCount="710" Body="&lt;p&gt;I am new to asset allocation problems and have some concerns regarding the derivation of the continuous-time Kelly criterion (i.e. not the original version destined to discrete sports betting/Casino).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am following the &lt;a href=&quot;https://arxiv.org/pdf/1103.4934.pdf&quot;&gt;derivation&lt;/a&gt; of &lt;em&gt;Martin &amp;amp; Schöneborn&lt;/em&gt;, see page 4 and following.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I understand it, the assumptions are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Economy with 2 investment vehicles: a risky asset $X$ and a risk-free one $B$&lt;/li&gt;&#xA;&lt;li&gt;$X$ is driven by a time-homogeneous diffusion process: $$dX_t = \mu(X_t) dt + \sigma (X_t) dW_t $$ while $B$ follows the usual: $dB_t = rB_t dt$&lt;/li&gt;&#xA;&lt;li&gt;The investment strategy consists in holding $\{\theta_t\}_{t\geq 0}$ units of the risk-asset at any time $t \geq 0$. It is assumed self-financing, so that the P&amp;amp;L over an infinitesimal time interval $[t,t+dt[$ writes:&#xA;$$ d\Pi_t = \theta_t dX_t + dB_t $$&lt;/li&gt;&#xA;&lt;li&gt;The investor aims at maximizing the total discounted expectation of the utility of her $\theta$-controlled P&amp;amp;L over a forward-looking horizon stretching from today $t$ up to infinity:&#xA;$$ V_t = \int_{s=t}^\infty e^{-r(s-t)} \mathbb{E}_t\left[ \mathcal{U}(\theta_s dX_s) \right] $$&lt;/li&gt;&#xA;&lt;li&gt;Since $X_t$ is a diffusive process with bounded quadratic variation, a second order definition of the utility function $\mathcal{U}(.)$ is enough. Typically, we take: &#xA;    $$\mathcal{U}(0)=0,\ \ \mathcal{U}'(0)=1,\ \ \mathcal{U}''(0)=-1/G$$&lt;/li&gt;&#xA;&lt;li&gt;Continuous trading is possible and there are no market frictions.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;And the result is:&#xA;$$ \theta_t = \frac{\mu(X_t)}{\sigma^2(X_t)}G $$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;What I don't understand is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;In the paper, they look for $\{\theta_t\}$ which maximises $V_t$. This leads to the following ODE &#xA;$$ \frac{\partial f}{\partial x}(X_t) \mu(X_t) + \frac{1}{2} \frac{\partial^2 f}{\partial x^2}(X_t) \sigma^2(X_t) - rf(X_t) = -\dot{U}(X_t, \theta_t) $$&#xA;Now they jump to the &quot;intuitively clear conclusion&quot; that this is equivalent to finding $\theta_t$ which maximises $\dot{U}(X_t, \theta_t)$. Unfortunately, it is not clear to me. &lt;/li&gt;&#xA;&lt;li&gt;The fact that the optimal allocation strategy does not involve the risk-free rate $r$ seems weird to me. In my opinion, this comes from the fact that we should rather define the value function $V_t$ to be maximised as:&#xA;$$ V_t = \int_{s=t}^\infty e^{-r(s-t)} \mathbb{E}_t\left[ \mathcal{U}(\theta_s dX_s + dB_s) \right] $$&lt;/li&gt;&#xA;&lt;li&gt;How do you use this Kelly allocation criterion in practice? I mean, suppose time $t$ corresponds to the market close of day $D$. It seems natural to want to know the optimal allocation (or position) one should take at $t+\Delta t$ (e.g. day $D+1$). So what we need is something like:&#xA;$$ \theta_{t+\Delta t} = f(\text{information contained in the filtration } \mathcal{F}_t) $$&#xA;and not $\theta_t$ on the LHS, since it is already known at time $t$ (in the demonstration we always assume $\theta_t$ to be adapted, hence measurable at any $t$). Should I assume a particular continuity assumption for $\theta_t$?&lt;/li&gt;&#xA;&lt;li&gt;I've read somewhere that $\forall G$ the Kelly strategy is optimal in the following sense:&#xA;$$\mathbb{E} \left[ \frac{ \Pi_T(\{\theta_t^{\text{Kelly}(G)}\}_{t\in[0,T]}) }{ \Pi_T( \{\theta_t\}_{t\in[0,T]}) } \right] \geq 1$$&#xA;for all $\{\theta_t\}_{t\in[0,T]}$ adapted to the natural filtration of $W_t$ and where $\Pi_T( \{\theta_t\}_{t\in[0,T]}$ denotes the final wealth of an investment strategy based on the risky asset position sizing $\{\theta_t\}$. But some simulations show me that this is not true, especially not $\forall G$. Even the growth rate $\dot{U}(\theta_t,X_t)$ mentioned in the paper does not seem optimal (sometimes I have basic long only or short only strategy that perform better).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Could someone please help me out? If the answer to all these questions is that this derivation is wrong and not the one I should follow, I would be glad if someone could provide a nice reference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers&lt;/p&gt;&#xA;" OwnerUserId="22568" LastActivityDate="2017-10-06T04:11:52.230" Title="Questions on Kelly criterion" Tags="&lt;quant-trading-strategies&gt;&lt;kelly-criterion&gt;&lt;tactical-asset-allocation&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="28093" PostTypeId="2" ParentId="28087" CreationDate="2016-07-15T16:02:21.037" Score="1" Body="&lt;p&gt;I assume $\alpha&amp;gt;0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $V^\lambda$ be the solution of :&#xA;\begin{equation*}&#xA;\begin{cases}&#xA;\frac{\partial V^\lambda}{\partial t} + \Bigl [ \alpha \Bigl(\mu - \frac{\lambda}{\alpha} - \log (S) \Bigr) S \Bigr ] \frac{\partial V^\lambda}{\partial S} + \frac{1}{2} \sigma^2 S^2 \frac{\partial^2 V^\lambda}{\partial S^2} - rV^\lambda = 0, \\&#xA;V^\lambda(S,T) = (S -K)^+,&#xA;\end{cases}&#xA;\end{equation*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then you want to prove :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\lambda&amp;lt;\lambda' \Rightarrow V^\lambda \geq V^{\lambda'}$$&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Use Feyman Kac to prove that, under $\mathbb{P}$, by denoting :&#xA;$$dX^\lambda_t = \alpha(\mu-\frac{\lambda}{\alpha}-X^\lambda_t)dt-\frac{\sigma^2}{2}dt + \sigma dW_t$$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;$$V^\lambda(t,S) = \mathbb{E}\left[ \left.e^{-r(T-t)}\left(e^{X^\lambda_{T}}-K\right)^+ \right| X^\lambda_t = \ln S \right]$$&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;&lt;p&gt;Prove using Ito's lemma that:&#xA;$$X^{\lambda_1}_T - X^{\lambda_2}_T = e^{-\alpha(T-t)}(X^{\lambda_1}_t-X^{\lambda_2}_t)+(1-e^{-\alpha(T-t)})(\frac{\lambda_2}{\alpha}-\frac{\lambda_1}{\alpha})$$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Using that $x\to (e^{x}-K)^+$ is increasing, prove that:&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;$$ \lambda_1 &amp;lt; \lambda_2 \Rightarrow V^{\lambda_1}(t,S)\geq V^{\lambda_2}(t,S)$$&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Economic intuition&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;$\lambda \uparrow \Rightarrow \mu-\frac{\lambda}{\alpha} \downarrow \Rightarrow$ drift of asset is lower, so lower up-trend, and since call option is increasing with the price of the asset, you get lower values.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-07-15T16:02:21.037" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28094" PostTypeId="5" CreationDate="2016-07-15T20:18:53.747" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2016-07-15T20:18:53.747" LastActivityDate="2016-07-15T20:18:53.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28095" PostTypeId="4" CreationDate="2016-07-15T20:18:53.747" Score="0" Body="A mean reverting process is a process that, over time, tends to drift toward its long-term mean. " OwnerDisplayName="user16651" LastEditorUserId="848" LastEditDate="2016-07-16T05:58:02.993" LastActivityDate="2016-07-16T05:58:02.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28096" PostTypeId="5" CreationDate="2016-07-15T20:38:31.910" Score="0" Body="&lt;p&gt;The &lt;a href=&quot;http://www.math.ku.dk/~rolf/SABR.pdf&quot; rel=&quot;nofollow&quot;&gt;SABR model&lt;/a&gt; of Hagan is described by the following system of stochastic differential equations  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align}&#xA;  &amp;amp; d{{f}_{t}}={{\alpha }_{t}}f_{t}^{\beta }d{{W}_{t}}^{1} \\ &#xA; &amp;amp; d{{\alpha }_{t}}=v\,{{\alpha }_{t}}d{{W}_{t}}^{2} \\ &#xA; &amp;amp; {{E}^{Q}}[d{{W}_{t}}^{1},d{{W}_{t}}^{2}]=\rho dt \\ &#xA;\end{align}$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In these equations, $f_t$ is the forward rate, $\alpha$ is the initial variance, $\beta$ is the exponent for the forward rate and $v$ is the volatility of variance. &lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-07-16T05:57:24.383" LastActivityDate="2016-07-16T05:57:24.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28097" PostTypeId="4" CreationDate="2016-07-15T20:38:31.910" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2016-07-15T20:38:31.910" LastActivityDate="2016-07-15T20:38:31.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28098" PostTypeId="5" CreationDate="2016-07-15T20:49:36.867" Score="0" Body="&lt;p&gt;Let $\left(\Omega, \mathcal{F}, \left\{ \mathcal{F}_{t} \right \}_{t \geq 0}, \mathbb{P}\right)$ be a filtered probability space, i.e. a probability space equipped with a filtration of $\sigma$-algebras. Then a random variable $\tau:\Omega\to [0,\infty)$ is called a stopping time if $$\{\omega\in\Omega:\tau(\omega)\le t\}\in\mathcal{F}_t$$ &lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-07-16T15:23:11.457" LastActivityDate="2016-07-16T15:23:11.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28099" PostTypeId="4" CreationDate="2016-07-15T20:49:36.867" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2016-07-15T20:49:36.867" LastActivityDate="2016-07-15T20:49:36.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28100" PostTypeId="2" ParentId="4079" CreationDate="2016-07-15T21:01:32.273" Score="0" Body="&lt;p&gt;Previous Quandl links/suggestions have been depreciated or are totally unclear.&#xA;Here's a link that's good as of 7/15/2016, you can get data since 2010 for free with this: &lt;a href=&quot;https://www.quandl.com/data/RAYMOND?keyword=outstanding%20shares&quot; rel=&quot;nofollow&quot;&gt;https://www.quandl.com/data/RAYMOND?keyword=outstanding%20shares&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In there you can find export to CSV/XML/JSON options, and instructions on how to get this through the Quandl API in python/matlab/R (and presumably more).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please comment if you find one of these that's free and with data that goes back further.&lt;/p&gt;&#xA;" OwnerUserId="22575" LastActivityDate="2016-07-15T21:01:32.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28101" PostTypeId="2" ParentId="28081" CreationDate="2016-07-15T22:26:30.120" Score="0" Body="&lt;p&gt;Have you look at &lt;code&gt;copula&lt;/code&gt; &lt;code&gt;package&lt;/code&gt;! Maybe you could get ideias from it &lt;a href=&quot;https://www.jstatsoft.org/article/view/v021i04/v21i04.pdf&quot; rel=&quot;nofollow&quot;&gt;https://www.jstatsoft.org/article/view/v021i04/v21i04.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://finzi.psych.upenn.edu/R/library/copula/html/copula-package.html&quot; rel=&quot;nofollow&quot;&gt;http://finzi.psych.upenn.edu/R/library/copula/html/copula-package.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13571" LastActivityDate="2016-07-15T22:26:30.120" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28102" PostTypeId="1" CreationDate="2016-07-15T23:25:32.687" Score="0" ViewCount="1434" Body="&lt;p&gt;I am able to get good approximations for delta, gamma, and rho via finite difference method, but not theta.  I believe my issue is the value of h.  Theta is basically the difference between the price of the the option one time step in the future and the price today divided by the size of the time step, ie &lt;/p&gt;&#xA;&#xA;&lt;p&gt;theta (approx) = V(d_v+1) - V(d_v)/(1/365),&#xA;where V(d_v+1) is the value of the option one time step (1/365) into the future&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This basically comes from &lt;a href=&quot;http://docs.fincad.com/support/developerfunc/mathref/greeks.htm&quot; rel=&quot;nofollow&quot;&gt;http://docs.fincad.com/support/developerfunc/mathref/greeks.htm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I apply this to, for example, the call option quote on 04/18/2013 for ticker A (Agilent, I believe), strike of 40, underlying price of 41.83, expiry of 05/18/2013 (30/365 days to maturity), 1.1% Dividend Yield, 0.3% risk-free rate, I get a theta of -8.9, whereas the actual theta is approximated by a large options data reporting firm as approx -2.2.  My other Greek approximations are close enough, but I cannot get a good approximation for theta.  Anybody have insight into this issue?  Thanks in advance for your help!&lt;/p&gt;&#xA;" OwnerUserId="22576" LastActivityDate="2018-04-19T03:14:26.167" Title="Calculation of option Greek (sensitiviety) theta via finite difference" Tags="&lt;options&gt;&lt;greeks&gt;&lt;finite-difference-method&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28103" PostTypeId="1" CreationDate="2016-07-16T00:17:55.497" Score="0" ViewCount="116" Body="&lt;p&gt;I was asked this question the other day, but it's been years since I've done this work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the probability of a company to default in a year is $8\%$, what is the probability that it will default in year 2?&lt;/p&gt;&#xA;" OwnerUserId="22577" LastActivityDate="2016-07-17T01:15:39.167" Title="What is the probability of defaulting in year 2?" Tags="&lt;default-probability&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28108" PostTypeId="1" AcceptedAnswerId="28110" CreationDate="2016-07-16T12:10:09.627" Score="3" ViewCount="459" Body="&lt;p&gt;I am trying to understand the pricing of various types of swaptions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose I have a swap that starts in 3 months time. How would I go about pricing a swaption on this swap in the following cases: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 Month option&#xA;2 Month option&#xA;3 Month option&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know the standard theory, which seems to let me price the swaption for a 3 month option. However I can't seem to figure out how to bring in the forward starting arrangement for the 1 and 2 month option. &lt;/p&gt;&#xA;" OwnerUserId="22581" LastEditorUserId="789" LastEditDate="2016-07-17T10:43:40.860" LastActivityDate="2016-07-17T10:43:40.860" Title="Swaption pricing" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;interest-rates&gt;&lt;swaps&gt;&lt;swaption&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28109" PostTypeId="2" ParentId="28103" CreationDate="2016-07-16T12:31:20.907" Score="0" Body="&lt;p&gt;I guess with that very sparse information all you could do is take the probability that the company still exists in a year (92%) times 8 % (assuming that the probability itself does not change).&#xA;I believe I had something similar in an exam once. However, it is a really simplistic answer.&lt;/p&gt;&#xA;" OwnerUserId="22216" LastActivityDate="2016-07-16T12:31:20.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28110" PostTypeId="2" ParentId="28108" CreationDate="2016-07-16T13:27:03.517" Score="3" Body="&lt;p&gt;The Black 76 swaption formula works for all these cases.  The expiration time T= 1mo, 2mo or 3mo but the forward rate of the swap is the same in each case.   The market will place different implied volatilities on these 3 options, according to the expectations of realized volatility in these 3 time periods.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-07-16T13:27:03.517" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28111" PostTypeId="1" AcceptedAnswerId="28117" CreationDate="2016-07-16T13:40:44.383" Score="0" ViewCount="335" Body="&lt;p&gt;I am struggling with a formula for calculating the above. I have been using the following example:&#xA;&lt;a href=&quot;https://www.youtube.com/watch?v=lKu2LAgEcpU&quot; rel=&quot;nofollow&quot;&gt;https://www.youtube.com/watch?v=lKu2LAgEcpU&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;A = YEN82 / USD&#xA;B = USD1.6 / GBP&#xA;C = GBP128 / YEN&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The implied JPY/GBP XRate is 131.2 (82 X 1.6).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the difference between the implied JPY/USD XRate and the quoted XRate is a constant should my result not always be either positive or negative the same value? In my calculations I am getting a 2.5% margin when I calculate one way and a -2.44% margin when I calculate the other way. I would have expected the result to be either 2.5% or -2.5%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i.e. Starting with JPY100,000,000&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Option A = 2.5% gain&#xA;====================&#xA;JPY to GBP = 781,250&#xA;USD to GBP = 1,250,000&#xA;JPY to USD = 102,500,000&#xA;&#xA;&#xA;Option B = 2.44% loss&#xA;=====================&#xA;JPY to USD = 1,219,512.20&#xA;USD to GBP = 762,195.12&#xA;JPY to GBP = 97,560,975.61&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="22582" LastActivityDate="2016-10-08T16:05:54.137" Title="Triangular arbitrage formula error" Tags="&lt;arbitrage&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28112" PostTypeId="2" ParentId="28103" CreationDate="2016-07-16T16:15:53.140" Score="1" Body="&lt;p&gt;Generally, survival probability can be interpolated or extrapolated log-linearly, which is, at the least, consistent with the piece-wise constant hazard rate assumption. Specifically, let $x$ be the survival probability at year 2. The year 1 survival probability, 92%, can be log-linearly interpolated from the survival probability 1 at year 0 and the survival probability $x$ at year 2, that is,&#xA;\begin{align*}&#xA;\ln (0.92) = \ln (1) + \frac{\ln x - \ln (1)}{2-0}\times(1-0).&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;x = 0.92^2 = 84.64\%.&#xA;\end{align*}&#xA;Consequently, the default probability at year 2 is $15.36\%$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-07-17T01:15:39.167" LastActivityDate="2016-07-17T01:15:39.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28113" PostTypeId="1" CreationDate="2016-07-16T17:03:27.870" Score="2" ViewCount="122" Body="&lt;p&gt;I hope that this is the right place to ask my question!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let a market with $N\ge1$ risky assets and denote by $(R_i,i=1,\cdots, N)$ their returns and $R$ the vector of these $N$ returns. In addition, there is a riskfree asset with the return $R_f$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Denote by $\mathcal{E}$ the mean of $R$ and $\Lambda$ the covariance matrix of $R$. We suppose that $\Lambda$ is invertible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, let $a=~^t\text{1l}\;\Lambda^{-1}\;\text{1l},\;b=~^t\text{1l}\;\Lambda^{-1}\;\mathcal{E} \text{ and } c=~^t\mathcal{E}\;\Lambda^{-1}\;\mathcal{E}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An investor looks for a portfolio with a maximum mean return for a constant variance return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The market portfolio has the renturn $\mu_M=\frac{b.R_f-c}{a.Rf-b}$ and the variance $\sigma_M^2=\frac{a.\mu_M^2-2b.\mu_M+c}{ac-b^2}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the question: Prove that the return $\mu$ and variance $\sigma$ of an investor's portfolio satisfies $\sigma^2=\sigma_0^2+(\sigma_T^2-\sigma_0^2).\Big(\frac{\mu-\mu_0}{\mu_T-\mu_0}\Big)^2$ where $\mu_0$ and $\sigma_0^2$ the mean return and the variance of the portfolio with minimum variance (we can show that $\mu_0=\frac{b}{a}$ and $\sigma_0^2=\frac{1}{a}$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance for any suggestion!&lt;/p&gt;&#xA;" OwnerUserId="22585" LastEditorUserId="22585" LastEditDate="2016-07-17T18:59:47.413" LastActivityDate="2016-07-17T18:59:47.413" Title="Relation between mean and variance of a portfolio in modern portfolio theory:" Tags="&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;&lt;mean-variance&gt;&lt;markowitz&gt;&lt;risk-free&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28114" PostTypeId="1" CreationDate="2016-07-16T17:33:47.840" Score="1" ViewCount="151" Body="&lt;p&gt;Is there a source of historic dividend dates, ex-dividend dates and dividend values? Also, the next dividend date / ex-dividend date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally in a machine readable form? The publically available APIs don't seem to have the above info as an optional form of info. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.upcomingdividends.co.uk/&quot; rel=&quot;nofollow&quot;&gt;UpcomingDividends&lt;/a&gt; seems to have some of the future data and &lt;a href=&quot;http://www.google.co.uk/finance?q=LON%3ABA&amp;amp;ei=Zm-KV7rmOdbEsAHj3JrgBQ&quot; rel=&quot;nofollow&quot;&gt;Google Finance&lt;/a&gt; seems to have the last dividend info (although no date).&lt;/p&gt;&#xA;" OwnerUserId="22586" LastActivityDate="2016-07-26T12:00:40.790" Title="Historic and future (next) round of machine readable dividend info" Tags="&lt;data&gt;&lt;programming&gt;&lt;historical-data&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28117" PostTypeId="2" ParentId="28111" CreationDate="2016-07-17T10:02:58.990" Score="3" Body="&lt;p&gt;It is correct because a 2.50pct gain followed by a 2.44pct loss gets you back to where you started.  I.e. (1+0.025)(1-0.0244)=1.   &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-07-17T10:02:58.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28120" PostTypeId="1" AcceptedAnswerId="29570" CreationDate="2016-07-17T23:57:14.617" Score="2" ViewCount="2105" Body="&lt;p&gt;I am currently conducting some GARCH modelling and I am wondering about the robust standard errors, which I can obtain from &lt;code&gt;ugarchfit()&lt;/code&gt; in &lt;code&gt;rugarch&lt;/code&gt; package in R. I have found a &lt;a href=&quot;http://faculty.washington.edu/ezivot/econ589/univariateGarch2012powerpoint.pdf&quot; rel=&quot;nofollow&quot;&gt;presentation&lt;/a&gt; and on page 25 the author says that the robust standard errors are obtained from QMLE estimation, but there is no further explanation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is what is the interpretation of these robust standard errors, that is, what are they robust to? I suspect that they are robust to heteroskedasticity, but I would be grateful for some confirmation. Also, what is more common in practice, reporting the non-robust or robust version of the standard errors?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I have found additional information on the topic &lt;a href=&quot;http://chrisauld.com/2012/10/31/the-intuition-of-robust-standard-errors/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. Basically, it confirms what those errors are robust to. Thus, the question whether their use in case of GARCH modeling (on stock index returns) are justifiable?&lt;/p&gt;&#xA;" OwnerUserId="17464" LastEditorUserId="17464" LastEditDate="2016-07-19T21:55:50.423" LastActivityDate="2021-02-24T02:30:59.293" Title="Robust standard errors in GARCH modelling (rugarch)" Tags="&lt;r&gt;&lt;garch&gt;&lt;parameter-estimation&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28123" PostTypeId="2" ParentId="26061" CreationDate="2016-07-18T12:34:30.077" Score="1" Body="&lt;p&gt;you can find from the CBOE paper above mentioned that the value is pretty much that of a strip of vanillas, weighted by 1/K^2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typically if spx spot goes down, then realized vol increases. Together with the increase of realized vol, implied vol gets &quot;re-evaluated&quot; and typically marked higher with a steeper skew etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the remark of the implied vol surface will cause the Vix index to go up as per the formula from the CBOE white paper. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, perhaps the better question would have been: &quot;why does vol spike when markets tank?&quot;&lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2016-07-18T12:34:30.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28124" PostTypeId="1" CreationDate="2016-07-18T14:03:35.137" Score="2" ViewCount="101" Body="&lt;p&gt;Say I am an American issuer, and I've issued some bond denominated in CAD. I've hedged the coupon by entering into an FX USD/CAD fixed for floating swap and I receive the fixed leg and pay floating, paid semi-annually and reset quarterly. Assume this is the only option available to me. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to hedge out the FX floating leg of that IR swap now. I can do that by entering into either an FX basis swap, or by rolling 3 month FX forwards (receiving CAD and paying USD at the fwd rate). So essentially I want to compare these two strategies ex-post where the goal is to hedge that floating rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Besides comparing the cost of each hedge, what other metrics are available to compare these two strategies? The dollar amount alone doesn't capture certain unique features of each strategy (for instance, variability of payment amounts using forwards vs fixed using swaps; tying up capital using swaps; timing of the payments etc). There are also considerations such as lost upside and the opportunity cost of funds used to hedge. Is there a superior metric that's commonly used when evaluating trading strategies? How are comparative strategies typically evaluated?&lt;/p&gt;&#xA;" OwnerUserId="17712" LastEditorUserId="17712" LastEditDate="2016-07-18T14:14:26.010" LastActivityDate="2016-07-18T14:14:26.010" Title="Comparing Hedging Strategies" Tags="&lt;trading&gt;&lt;swaps&gt;&lt;hedge&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28125" PostTypeId="1" AcceptedAnswerId="28127" CreationDate="2016-07-18T14:28:36.320" Score="2" ViewCount="296" Body="&lt;p&gt;I'm self-studying and I encountered the following example. It seems to suggest that volatility is negative in this example. I was under the impression that volatility can never be negative, both from a mathematical perspective and in the &quot;real world.&quot; Am I missing something?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/WA0qa.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/WA0qa.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5641" LastActivityDate="2016-07-19T16:21:21.593" Title="Is this a poorly written example, or could volatility in fact be negative?" Tags="&lt;brownian-motion&gt;&lt;sharpe-ratio&gt;&lt;itos-lemma&gt;&lt;self-study&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28126" PostTypeId="2" ParentId="23292" CreationDate="2016-07-18T14:43:57.163" Score="1" Body="&lt;p&gt;Alex's post hits the main point: leverage amplifies returns (either positive or negative).  In this case, it is not &lt;em&gt;interest rate&lt;/em&gt; but &lt;a href=&quot;http://www.investopedia.com/terms/l/loanconstant.asp&quot; rel=&quot;nofollow&quot;&gt;&lt;em&gt;loan constant&lt;/em&gt;&lt;/a&gt; that we should be focusing on.  For a \$5.68MM loan (80% of \$7.1MM), the loan constant is 7.55%. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In excel, I used the function: $$PMT(5.75\%/12,30\times12,5680000)\times12$$ to come up with annual debt service of \$496,290 which gives a loan constant of 7.55%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus the annual debt service is dilutive to the yield of 6.99% (and even moreso for the 25-year mortgage).&lt;/p&gt;&#xA;" OwnerUserId="20465" LastActivityDate="2016-07-18T14:43:57.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28127" PostTypeId="2" ParentId="28125" CreationDate="2016-07-18T14:56:30.533" Score="5" Body="&lt;p&gt;You seem to use the term &quot;volatility&quot; to describe two very different quantities: (1) the diffusion coefficient of your SDE and (2) the standard deviation of the log-returns under your modelling assumptions. While the first may be negative, the second may not.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Interpretation 1]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a probability space $(\Omega,\mathcal{F},\mathbb{P})$ and a standard Brownian motion $W_t^\mathbb{P}$. From a pure mathematical perspective, the dynamics:&#xA;$$ dS_t = \dots + \vert \sigma \vert dW_t^\mathbb{P} $$&#xA;is strictly equivalent to&#xA;\begin{align}&#xA;dS_t &amp;amp;= \dots - \vert \sigma \vert dW_t^\mathbb{P}\\&#xA;&amp;amp;= \dots + \vert \sigma \vert d(-W_t^\mathbb{P}) \\&#xA;&amp;amp;= \dots + \vert \sigma \vert d \tilde{W}_t^\mathbb{P}&#xA;\end{align}&#xA;since $\tilde{W}_t^\mathbb{P} = -W_t^\mathbb{P}$ can be shown to be a $\mathbb{P}$-Brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means specifying a dynamics this way&#xA;$$ dS_t = G S_t dt + 0.2 S_t dW_t $$&#xA;is the same as specifying it as&#xA;$$ dS_t = G S_t dt - 0.2 S_t dW_t $$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Interpretation 2]&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming a Geometric Brownian Motion as proposed in your exercise (Black-Scholes like dynamics),  applying Itô's lemma and integrating from $0$ to $t$ will get you:&#xA;$$ d\ln(S_t) = (\mu - \sigma^2/2)dt \pm \vert \sigma \vert dW_t^\mathbb{P} $$&#xA;$$ \ln(S_t) = \ln(S_0) + (\mu - \sigma^2/2)t \pm \vert \sigma \vert W_t^\mathbb{P} $$&#xA;where the $\pm$ sign is used for both the positive and negative diffusion coefficient convention;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because of the properties of Brownian motion, in both cases, you'll end up with normally distributed log-returns:&#xA;$$ \ln(S_t) \sim \mathcal{N}( \ln(S_0) + (\mu - \sigma^2/2)t, \sigma^2 t) $$&#xA;with a positive log-returns variance of $\sigma^2 t$ and the associated standard deviation &#xA;$$\sqrt{\sigma^2 t } = \vert \sigma \vert \sqrt{t} &amp;gt; 0$$&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-07-19T16:21:21.593" LastActivityDate="2016-07-19T16:21:21.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28129" PostTypeId="2" ParentId="14927" CreationDate="2016-07-18T16:05:25.503" Score="0" Body="&lt;p&gt;Solved my own question. I was actually looking for was this. CharlesM, your answer was not bad as well. Appreciate the reply. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Does Academic Research Destroy Stock Return Predictability?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2156623&quot; rel=&quot;nofollow&quot;&gt;Does Academic Research Destroy Stock Return Predictability?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7954" LastActivityDate="2016-07-18T16:05:25.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28130" PostTypeId="2" ParentId="25963" CreationDate="2016-07-18T16:14:49.143" Score="0" Body="&lt;p&gt;The biggest problem you face is that prices can be updated over time and I do not think, to the best of my knowledge that Yahoo, will do that for you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would recommend a premium data source such as &lt;a href=&quot;https://www.quandl.com/browse?filterBy=Premium&amp;amp;idx=database-browser_stock-data_united-states_stock-prices-end-of-day-current-and-historical&quot; rel=&quot;nofollow&quot;&gt;https://www.quandl.com/browse?filterBy=Premium&amp;amp;idx=database-browser_stock-data_united-states_stock-prices-end-of-day-current-and-historical&lt;/a&gt; as michael_j_ward stated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may also want to give Thomson Reuters Sirca a look as well as Bloomberg BBG ( these resources are great if you know anyone at an academic institution) as well as the Wharton Databases. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good Luck! &lt;/p&gt;&#xA;" OwnerUserId="7954" LastEditorUserId="7954" LastEditDate="2016-07-23T13:34:46.003" LastActivityDate="2016-07-23T13:34:46.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28131" PostTypeId="2" ParentId="27748" CreationDate="2016-07-18T16:36:55.143" Score="2" Body="&lt;p&gt;I think you best bet is &lt;strong&gt;calling up/emailing the SEC&lt;/strong&gt; and asking to request some records from them. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;First, do a search.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.sec.gov/search/search.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.sec.gov/search/search.htm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;&quot;Search SEC Documents&quot;&lt;/strong&gt; for what you seek and if not, request the records with a FOIL Request.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Request the docs from them using the &lt;strong&gt;&quot; Freedom of Information Act &quot;&lt;/strong&gt; if it does not come up, call them and see if they can release the information you seek because they get the information about new accounts from broker-dealers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/vRHUZ.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/vRHUZ.jpg&quot; alt=&quot;Books and Records Requirements for Brokers and Dealers Under the Securities Exchange Act of 1934 &quot;&gt;&lt;/a&gt;.  --&lt;a href=&quot;https://www.sec.gov/rules/final/34-44992.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.sec.gov/rules/final/34-44992.htm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Below is where you go if what you seek is not coming up where you searched through the document above because it may be &lt;strong&gt;non-public&lt;/strong&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;-&lt;a href=&quot;https://www.sec.gov/oso/foia-freq-docs-custom-list-page&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.sec.gov/oso/foia-freq-docs-custom-list-page&lt;/a&gt;**&lt;br&gt;&#xA;  -Phone number FOIA Office phone: &lt;strong&gt;(202) 551-7900&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;****You will not be able to get as granular as you like unless you get approval from them meaning they know you will not do anything that is against foil law with it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;========================================================================&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good Luck!&lt;/p&gt;&#xA;" OwnerUserId="7954" LastActivityDate="2016-07-18T16:36:55.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28132" PostTypeId="1" CreationDate="2016-07-18T16:59:28.063" Score="0" ViewCount="760" Body="&lt;p&gt;I'm trying to evaluate a convertible bond using the structural approach : the price of convertible bond is an option (call) on the firm value. We suppose that the firm value is equal to the sum of the debt (in this case, convertible bond) and number of stocks multiplied by their market price :&#xA;$$ V(t) = B(t) + NS(t) $$ The authors of the book where I found this method explain that, at the maturity, the price of the convertible is equal to $B(T) = max[min(V(T), D), \kappa V(T)]$ where $D$ is redemption price and $\kappa$ is the inverse of dilution coefficient. Thus, it the bond price at $t=0$ can be calculated using binomial tree method. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is one thing that I don't inderstand, the CB price is equal to the option on firm value, but the firm value depends on CB price, too. How can I estimate the firm value $V(T)$ ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance for your help ! &lt;/p&gt;&#xA;" OwnerUserId="22604" LastActivityDate="2016-08-18T13:43:25.383" Title="Pricing of convertible bonds" Tags="&lt;option-pricing&gt;&lt;binomial-tree&gt;&lt;convertible-bond&gt;" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28133" PostTypeId="1" AcceptedAnswerId="28134" CreationDate="2016-07-18T17:28:53.417" Score="2" ViewCount="7051" Body="&lt;p&gt;I have read the pricing procedure of a Forward-start option in a Black-Scholes world in Musiela-Rutkowski, but I don't find their proof clear (pp. 195-6). Let me summarize their argument:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider two dates $T_0 &amp;lt; T$. A forward-start call option allows the holder to receive, at time $T_0$ and with no additional cost, a call option expirying at $T$, with strike set equal to $S(T_0)K$, for some $K&amp;gt;0$. So, the option life starts at $T_0$, but the holder pays at time $0$ the price of the option. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, let us see how to price such a contract. First, introduce the terminal payoff&#xA;$$&#xA;FS(T)\colon = (S(T) - KS(T_0))^+&#xA;$$&#xA;and to find its price at time $0$, let us start by considering its value at time $T_0$. This is easily found to be &#xA;$$&#xA;FS(T_0) = c(S(T_0), T-T_0, KS(T_0)).&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At this point we see that, after some easy algebraic manipulation, we have&#xA;$$&#xA;c(S(T_0), T-T_0, KS(T_0)) = S(T_0)\cdot c(1, T-T_0, K)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here my problems begin. &lt;strong&gt;What exactly is it meant by the last symbol $c(1, T-T_0, K)$??&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is true that &lt;em&gt;algebraically&lt;/em&gt; the above relation makes sense, $1$ stands for the value at time $T_0$ and the strike is $K$, but, what exactly means? The Black-Scholes formula for the price of an option on... what exactly? An asset whose value at $T_0$ is 1, and what is this asset??&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next, the proof proceeds like that: since $c(1, T-T_0, K)$ is nonrandom, the option's value at time $0$ equals&#xA;$$&#xA;FS(0) = S(0)\cdot c(1, T-T_0, K) =  c(S(0), T-T_0, KS(0)).&#xA;$$&#xA;Why? I argued like that: the price at time $0$ of the contract should be, in the risk-neutral measure, the value&#xA;$$&#xA;FS(0) = \tilde{\mathbf E}[D(T_0)\cdot c(S(T_0), T-T_0, KS(T_0))]=\tilde{\mathbf E} [D(T_0)S(T_0)\cdot c(1, T-T_0, K)],&#xA;$$&#xA;where $D(T_0)$ is the discount factor at time $T_0$ (with constant interest rate).&#xA;Since $c(1, T-T_0, K)$ is a constant (so I have guessed), can take it out of the Expectation symbol and obtain&#xA;$$&#xA;\tilde{\mathbf E} [D(T_0)S(T_0)c(1, T-T_0, K)]= c(1, T-T_0, K)\tilde{\mathbf E} [D(T_0)S(T_0)] = c(1, T-T_0, K)S(0)&#xA;$$&#xA;the last relation because $D(T_0)S(T_0)$ is a martingale. Is it this correct?&#xA;It is my understanding that the value $S(T_0)$ is not known at time $t=0$, so we are treating it as a random variable, hence, it makes sense to take its discounted expectation back to time $0$, while the expression $c(1, T-T_0, K)$ (whose meaning it is unclear to me as I wrote before), it is just a number, since it is calculated at time $T_0$ when all the quantities which appear in $c(1, T-T_0, K)$ are determined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would appreciate if in your opinion this proof is ok, and what is your answer to the question I wrote in bold. Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="11960" LastEditorUserId="11960" LastEditDate="2016-07-18T17:42:32.103" LastActivityDate="2016-07-18T19:46:40.507" Title="Pricing of a Forward-start option in a Black-Scholes framework" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;exotics&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28134" PostTypeId="2" ParentId="28133" CreationDate="2016-07-18T18:04:44.100" Score="3" Body="&lt;p&gt;The proof is fine. For example,  $D(t)S(t)$ is a martingale and then &#xA;\begin{align*}&#xA;E\big(D(t)S(t)\big) = S(0).&#xA;\end{align*}&#xA;Regarding the function $C(1, T-T_0, K)$, it is the value, at time $T_0$, of the option payoff &#xA;\begin{align*}&#xA;\left(\frac{S(T)}{S(T_0)} - K \right)^+.&#xA;\end{align*}&#xA;Here, you can treat $\frac{S(T)}{S(T_0)}$ as the normalized value or return of the asset. The identity&#xA;\begin{align*}&#xA;c(S(T_0), T-T_0, KS(T_0)) = S(T_0)\cdot c(1, T-T_0, K)&#xA;\end{align*}&#xA;can be seen directly from the Black-Scholes' formula or from the payoff equation&#xA;\begin{align*}&#xA;\big(S(T) - KS(T_0)\big)^+ = S(T_0) \left(\frac{S(T)}{S(T_0)} - K \right)^+.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-07-18T19:46:40.507" LastActivityDate="2016-07-18T19:46:40.507" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28136" PostTypeId="1" CreationDate="2016-07-18T19:47:29.400" Score="1" ViewCount="99" Body="&lt;p&gt;I've read a lot about correlate defaults but I can't seem to understand how they're used practically in a portfolio theory setting. Suppose I have two (?) companies, X and Y, and historic default information for each. How does knowing the correlation of defaults between X and Y help me with constructing my portfolio/loss curves? And how does this change if I have a basket of securities instead? I can add more details if needed.&lt;/p&gt;&#xA;" OwnerUserId="22607" LastActivityDate="2016-07-20T02:20:05.167" Title="How exactly are correlated defaults used/analyzed?" Tags="&lt;portfolio-management&gt;&lt;correlation&gt;&lt;modern-portfolio-theory&gt;&lt;default-probability&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28137" PostTypeId="2" ParentId="28136" CreationDate="2016-07-18T20:06:33.010" Score="1" Body="&lt;p&gt;The correlation does not play any role for a linear portfolio, such as a CDS index, However, for a portfolio with nonlinear dependence on the loss of  underlying entities, such as the case for a CDO or an $m$-th to default swap, the correlation plays a role. Here, certain techniques such as copula may be needed, depending on the complexity of the structure.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-07-18T20:06:33.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28140" PostTypeId="1" CreationDate="2016-07-18T22:00:53.260" Score="1" ViewCount="216" Body="&lt;p&gt;I'm trying to understand probability distributions implied from market prices and was reading through &lt;a href=&quot;http://www.ltnielsen.com/wp-content/uploads/Understanding.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; reference explaining the interpretation of $N(d_1)$ and $N(d_2)$ in the log-normal vol Black-Scholes model.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have two sets of questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;If I buy a call at strike $K$ and write a call at strike $K+\Delta K$, can I back into the risk-neutral probability of the underlying rising to $[K, K + \Delta K]$ (which I would work out as $N(d_2)$) from observed vol and market prices?  Is this algebraic rearrangement of the Black-Scholes equation meaningful?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In the context of interest rates, could there be a similar interpretation using normal vol (to allow for negative rates) to back into the probability of interest rates rising to $[X\%, (X + \Delta X)\%]$? If yes, is it possible to convert the implied distribution under $\mathbb{Q}$ to a distribution under $\mathbb{P}$ (i.e. does the other direction of &lt;a href=&quot;https://quant.stackexchange.com/questions/15719/girsanovs-theorem-change-of-measure&quot;&gt;Girsanov&lt;/a&gt; make sense)?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I'm unfamiliar with quant finance and am just digging in, so any questions asking for clarification on a certain part (preferably with a reference) would be much appreciated as well...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="20465" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2017-01-31T13:33:12.440" Title="$\mathbb{P}$ and $\mathbb{Q}$ probability measure/distribution interpretations" Tags="&lt;black-scholes&gt;&lt;probability&gt;&lt;risk-neutral-measure&gt;&lt;normal-distribution&gt;&lt;lognormal&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28144" PostTypeId="1" CreationDate="2016-07-19T05:52:27.737" Score="1" ViewCount="775" Body="&lt;p&gt;I am currently trying to simulate an asset return using the student-t distribution, but I can't find how I should do this. I began with the Geometric Brownian motion and just changed in order that epsilon follows the student-t distribution instead of the normal distribution, but I found out that this is not the correct way, I read a lot about levy-processes, but I don't know exactly how do simulate such returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much in advance&lt;/p&gt;&#xA;" OwnerUserId="20974" LastActivityDate="2016-07-19T13:55:13.577" Title="How to simulate asset returns using student t?" Tags="&lt;distribution&gt;&lt;asset-returns&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28145" PostTypeId="2" ParentId="28144" CreationDate="2016-07-19T07:48:26.273" Score="1" Body="&lt;p&gt;You will need a 'pseudo' random number generator - most stats programming languages have them (Matlab, R, Python...). &#xA;But GBM is defined with Normal increments $N(0,\sigma^{2}(T-t))$ so I dont think using Student's t distribution is a good idea, never seen it in any literature/applications. It is however used for instance in GARCH modelling....&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Random variates:&lt;/em&gt;&lt;/strong&gt; &#xA;For instance in R, you can get random variates from student distribution from the &lt;em&gt;fGarch&lt;/em&gt; &lt;a href=&quot;https://cran.r-project.org/web/packages/fGarch/fGarch.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;package&lt;/a&gt; - rstd() function. &#xA;In Matlab it is described &lt;a href=&quot;http://www.mathworks.com/help/stats/trnd.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you can use this as innovations in your BM or GBM motion simulation. How to do this was answered here few times &lt;a href=&quot;https://quant.stackexchange.com/questions/7125/simulation-of-gbm&quot;&gt;see answer here&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you elaborate further, what language you are using, or even post your code attempt so far, we might be able to help more...&lt;/p&gt;&#xA;" OwnerUserId="22237" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-07-19T13:55:13.577" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28149" PostTypeId="2" ParentId="28132" CreationDate="2016-07-19T08:52:03.060" Score="0" Body="&lt;p&gt;I think the point of this approach is to model the firm value $V(t) $ using some appropriate probability distribution, then deduce the dustribution of the CB price.  Thus the CB price depends on the firm value, but not vice versa.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-07-19T08:52:03.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28152" PostTypeId="2" ParentId="28090" CreationDate="2016-07-19T11:47:27.603" Score="2" Body="&lt;p&gt;The classical and naïve procedure for generating Poisson Hypersphere samples is by acceptance rejection, which has complexity over $O(N^2)$ and is thus unfeasible for most practical usage with on-the-fly generation. This cost could be improved by space partitioning techniques at low dimensions, but at high ones afaik they become useless again with uniform distributions.&#xA;Poisson disc sampling is thus not used widely beyond dimension 10, and I fear in general it is not a meaningful method in high dimensions because of geometric issues, which are conveniently bypassed by standard low discrepancy sequences (e.g. the fact that most of the hypercube volume is near the boundary). &#xA;Another drawback w.r.t. some quasi-MC sequences is that smoothness of the integrand is not exploited and thus convergence can be significantly slower. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similar in spirit is &lt;a href=&quot;http://www.quantize.maths-fi.com/&quot; rel=&quot;nofollow&quot;&gt;optimal quantization&lt;/a&gt; which is performed on arbitrary nonuniform distributions (by Pages, Callegaro &amp;amp;c). It has useful properties but suffers from even worse practical drawbacks (often points must be precomputed).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Imho the way to go is quasi-MC, there are sophisticated modern methods which beat anything else by a wide margin, in particular when used with proper integrand adaptations.&lt;/p&gt;&#xA;" OwnerUserId="3015" LastActivityDate="2016-07-19T11:47:27.603" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28153" PostTypeId="1" CreationDate="2016-07-19T14:54:07.107" Score="3" ViewCount="737" Body="&lt;p&gt;The probability that an arithmetic Brownian motion process $dt = \mu dt + \sigma dW$ hits an upper Barrier $U$ before it hits a lower barrier $L$ is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\mathbb{P}(\tau_U\leq \tau_L) = \frac{\text{Y}(x_0)-\text{Y}(L)}{\text{Y}(U)-\text{Y}(L)}&#xA;$$&#xA;where&#xA;$$&#xA;\text{Y}(x) = exp(\frac{-2\mu x}{\sigma^2})&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what is $\mathbb{P}(\tau_U\leq T \,\cap\, \tau_U\leq\tau_L)$ if both $x_0$ and $x_T$ are known? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;i.e. the probability the process hits $U$ before $L$ whilst in between the end points of a Brownian bridge.&lt;/p&gt;&#xA;" OwnerUserId="22208" LastEditorUserId="22208" LastEditDate="2016-07-19T15:35:27.743" LastActivityDate="2017-02-15T12:28:39.613" Title="What is the probability that a Brownian Bridge hits an upper barrier $U$ before a lower barrier $L$?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;&lt;barrier&gt;&lt;stopping-time&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28154" PostTypeId="1" AcceptedAnswerId="29464" CreationDate="2016-07-19T16:19:49.957" Score="1" ViewCount="773" Body="&lt;p&gt;I try to use &lt;strong&gt;FittedBondDiscountCurve&lt;/strong&gt; with &lt;strong&gt;NelsonSiegelFitting&lt;/strong&gt;, but I faced with error when call &lt;strong&gt;fitResults()&lt;/strong&gt; method: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;14415     def fitResults(self) -&amp;gt; &quot;FittingMethod const &amp;amp;&quot;:&#xA;14416         return _QuantLib.FittedBondDiscountCurve_fitResults(self)&#xA;14417     __swig_destroy__ = _QuantLib.delete_FittedBondDiscountCurve&#xA;14418     __del__ = lambda self: None&#xA;&#xA;RuntimeError: unable to bracket root in 100 function evaluations (last&#xA;bracket attempt: f[-2.29538e+025,5.968e+025] -&amp;gt; [-1.#IND,10200.1])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What does this problem mean?  What can be solution?&#xA;Moreover, could you tell me what is a minization method using in &quot;NelsonSiegelFitting&quot;? How can I change it? Or does it use several methods by default? I've uploaded full code with input file to my &lt;a href=&quot;https://github.com/kirilldolmatov/QuantLib&quot; rel=&quot;nofollow&quot;&gt;github&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Import QuanLib&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;from datetime import datetime, date, time&#xA;import QuantLib as ql&#xA;&#xA;class Bond(object):&#xA;&#xA;    def __init__(self, issuer, bond_name, price, tenor, face_amount):&#xA;        self.dates = []&#xA;        self.cashflows = [] &#xA;        self.issuer = issuer&#xA;        self.bond_name = bond_name&#xA;        self.price = ql.QuoteHandle(ql.SimpleQuote(price))        &#xA;        self.tenor = tenor&#xA;        self.face_amount = face_amount&#xA;&#xA;    def add_date(self, date):&#xA;        day, month, year = map(int, date.split('.'))&#xA;        self.dates.append(ql.Date(day, month, year))&#xA;&#xA;    def add_cashflow(self, cashflow):&#xA;        self.cashflows.append(float(cashflow))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Import Data&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;face_amount = 1000.0 # for all bonds face_amount = 1000.0&#xA;tenor = ql.Period(6, ql.Months) # for all bonds tenor = 6m&#xA;&#xA;bonds = {}&#xA;&#xA;with open('bonds.txt') as f:&#xA;    next(f) #skip header&#xA;&#xA;for line in f:&#xA;    s = line.rstrip().split(';')&#xA;    bond_name = s[1]&#xA;    if bond_name not in bonds:&#xA;        issuer = s[0]        &#xA;        price = float(s[4])            &#xA;        bonds[bond_name] = Bond(issuer, bond_name, price, tenor, face_amount)&#xA;&#xA;    bonds[bond_name].add_date(s[2])&#xA;    bonds[bond_name].add_cashflow(s[3])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Set QuantLib Param&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;evaluationDate = ql.Date(1, 6, 2016)&#xA;ql.Settings.instance().evaluationDate = evaluationDate&#xA;calendar = ql.TARGET()&#xA;day_counter = ql.Thirty360()&#xA;accrualConvention = ql.Unadjusted&#xA;bussiness_convention = ql.Unadjusted&#xA;bondSettlementDays = 0&#xA;curveSettlementDays = 0&#xA;bondSettlementDate = calendar.advance(evaluationDate, bondSettlementDays, ql.Days)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Create QuantLib objects&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;instruments = []&#xA;instruments_names = []&#xA;&#xA;for bond in bonds.keys():&#xA;&#xA;    schedule = ql.Schedule(bonds[bond].dates[0] - bonds[bond].tenor, &#xA;                           bonds[bond].dates[-1], &#xA;                           bonds[bond].tenor,&#xA;                           calendar,&#xA;                           accrualConvention,&#xA;                           accrualConvention,&#xA;                           ql.DateGeneration.Forward,&#xA;                           False)&#xA;&#xA;    helperA = ql.FixedRateBondHelper(bonds[bond].price,&#xA;                                     bondSettlementDays,&#xA;                                     bonds[bond].face_amount,&#xA;                                     schedule,&#xA;                                     bonds[bond].cashflows,&#xA;                                     day_counter,&#xA;                                     bussiness_convention)&#xA;&#xA;    instruments.append(helperA)&#xA;    instruments_names.append(bond)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;QuantLib Optimization&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;tolerance = 1.0e-5&#xA;iterations = 50000&#xA;nelsonSiegel = ql.NelsonSiegelFitting()&#xA;term_structure = ql.FittedBondDiscountCurve(curveSettlementDays, &#xA;                             calendar, &#xA;                             instruments,&#xA;                             day_counter,&#xA;                             nelsonSiegel,&#xA;                             tolerance,&#xA;                             iterations)&#xA;a = term_structure.fitResults()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="20288" LastEditorUserId="20288" LastEditDate="2016-07-27T12:21:33.017" LastActivityDate="2016-08-04T08:15:04.827" Title="QuantLib FittedBondDiscountCurve fitResults [Error]" Tags="&lt;fixed-income&gt;&lt;yield-curve&gt;&lt;python&gt;&lt;quantlib&gt;&lt;curve-fitting&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28155" PostTypeId="1" CreationDate="2016-07-19T16:52:03.253" Score="0" ViewCount="436" Body="&lt;p&gt;Lets say I have two stocks x and y and their corresponding stock price p(x) and p(y). consider HR as hedge ratio. Then we can calculate the spread using this equation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$spread=p(x)-HR*p(y)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;from this step what rationale should we use for buying and selling pairs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my logic&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pairs trading works for two highly correlated stocks. We then sell the costlier stock and buy cheaper stock simultaneously. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If spread is positive the price of &lt;code&gt;x&lt;/code&gt; is higher than price of &lt;code&gt;y&lt;/code&gt; so we will sell x and buy y . if spread is negative y is costlier than x then we sell y and buy x simultaneously. So the total return on pairs trading can be return as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$TotalReturn=sell(return of asset 1)-HR*buy( return of asset2)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;pseudocode&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if(spread&amp;gt;0 and entry_threshold=True)&#xA;TotalReturn=sell(x)-HR*buy(y)&#xA;&#xA;elif(spread&amp;lt;0 and entry_threshold=True)&#xA;TotalReturn=sell(y)-HR*buy(x)&#xA;&#xA;exit_trade(exit_threshold=True)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is this rationale correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;another question? If price of &lt;code&gt;x&lt;/code&gt; is 13 dollar and price of &lt;code&gt;y&lt;/code&gt; is 63 dollar then how many shares of x and y should we buy and sell simultaneously in a pairs trading?&lt;/p&gt;&#xA;" OwnerUserId="16754" LastEditorUserId="16754" LastEditDate="2016-07-20T02:43:08.850" LastActivityDate="2016-07-21T00:49:01.070" Title="How buying/selling pairs and entering/exiting trade works in pairs trading?" Tags="&lt;arbitrage&gt;&lt;pairs-trading&gt;&lt;spread&gt;&lt;algorithm&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28156" PostTypeId="1" AcceptedAnswerId="28158" CreationDate="2016-07-19T17:02:29.380" Score="6" ViewCount="11578" Body="&lt;p&gt;I would like to know how I can calculate the yield of a bond futures contract(say the 5 yr treasury &quot;FVM05&quot; is trading at 108.2)? I am not sure how to go about calculating the yield of the futures contract?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Need some guidance in doing so.&lt;/p&gt;&#xA;" OwnerUserId="5839" LastActivityDate="2016-07-19T18:53:19.363" Title="How do I calculate yield from a bond futures contract?" Tags="&lt;fixed-income&gt;&lt;yield-futures&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="28157" PostTypeId="1" CreationDate="2016-07-19T17:06:27.003" Score="6" ViewCount="527" Body="&lt;p&gt;I am trying to compute equity VaR, forex VaR and total VaR on an international portfolio (10 stocks x 4 countries).  Since I am not interested in the risk disaggregation among diffrent countries I was thinking to apply PCA directly on $\sigma_E$, $\sigma_X$ and $\sigma$ respectively; where $\sigma_E$ is the covariance matrix of the stocks log-returns in local currencies, $\sigma_X$ is the covariance matrix of log-returns on exchange rates and $\sigma$ the covariance matrix of all log-returns (stocks and exchange rates). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;While there shouldn't be any problem for the forex VaR, I am not quite sure I can use PCA on log-returns denominated in different currencies in order to find the equity VaR. My main concern is on how to find and interpret the principal components coefficients. Let’s say that I decide to use 5 PCs that will replace my 40 stocks log-returns, how do I find the coefficients? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would it be possible to create an a-doc portfolio from the log returns denominated in different currencies (without converting them):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_p = w_1 r_1^€+ … + w_{10} r_{10}^€ + w_{11} r_1^{DKK}​ + … + w_{20} r_{10}^{DKK}+ ...$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And then regress it on the principal component factors like this: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_p = α + β_1 PC_1 + ... + β_5 PC_5 + ϵ$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason I am trying to do this is because I would prefer avoid having PCA (or a foundamental factor model) for each country, otherwise I would still have an equity and total variance-covariance matrix with nonzero covariance’s and I would then have to use a multivariate GARCH.&lt;/p&gt;&#xA;" OwnerUserId="22524" LastEditorUserId="22524" LastEditDate="2016-07-21T01:55:41.960" LastActivityDate="2020-04-03T10:00:50.240" Title="PCA for stand alone equity VaR" Tags="&lt;var&gt;&lt;pca&gt;&lt;covariance-matrix&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28158" PostTypeId="2" ParentId="28156" CreationDate="2016-07-19T18:41:37.570" Score="7" Body="&lt;p&gt;There's a lot of intracacies involved and you've got several options. Let's go through an example, using the current front-month 5-year contract FVU6 (FV expiring in September 2016).&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;CTD Yield&lt;/strong&gt;: The cheapest-to-deliver (&quot;CTD&quot;) into FVU6 is the 1.625s of 11/30/2020 and its yield to maturity as of last close is 1.075%. You can simply use this as a proxy as the futures yield. This may seem dumb, but it's actually the one of the most prevalent choices in time series analyses. It works particularly well when the futures contract is fairly priced relative to cash bonds and the CTD is highly likely to be delivered into the contract (as it stands, 1.625s of 11/30/2020 has 100% delivery probability).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;CTD forward yield&lt;/strong&gt;: Given that a futures contract more closely resemble a forward, it is natural to calculate the forward yield of the CTD. You can calculate the forward price for the CTD using the cash-carry formula, assuming that the forward date = delivery date (10/5/2016 in this case). The forward price can then be converted back into a forward yield. For FVU6, we'd have 1.105%.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Futures implied yield&lt;/strong&gt;: You can also calculate the so called futures implied yield. This is computed by assuming that the forward price of the CTD is the futures price multiplied by the conversion factor. In this case, the futures price is 121.46875, while the conversion factor for the 1.625s of 11/30/2020 is 0.8408, so you would assume that the CTD's forward price is $121.46875 \times 0.8408 = 102.130925$. Then you simply calculate the yield to maturity, assuming that the settlement date is the delivery date (10/5/2016), which nets you a yield of 1.099%.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;These methods above assume that the CTD will not change between now and the delivery date. If that's not the case, you may want to calculate an average yield, weighted by CTD delivery probabilities.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2016-07-19T18:53:19.363" LastActivityDate="2016-07-19T18:53:19.363" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28159" PostTypeId="1" AcceptedAnswerId="28172" CreationDate="2016-07-19T20:25:55.190" Score="0" ViewCount="186" Body="&lt;p&gt;I'm attempting to fit a curve through moneyness/IV datapoints of intra-day options. As you can see, the data gets sparser and more variable for highly OTM options.&#xA;&lt;a href=&quot;https://i.stack.imgur.com/ar52p.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ar52p.png&quot; alt=&quot;vertical axis: IV, horizontal: moneyness&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to argue why the outliers in this case can be (at least partially) ignored. One topic-independent argument would be simply the sparsity of the data, giving the outliers exaggerated importance. I would like to make a stronger argument with connection to options though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My reasoning, from what I gathered through a little research, is something along the lines of: the OTM options are by their nature more likely to create anomalies like this since they are &lt;strong&gt;very risky&lt;/strong&gt; and &lt;strong&gt;likely to be traded by amateurs&lt;/strong&gt; who are &lt;strong&gt;attracted by low option premiums&lt;/strong&gt;. Thus an outlier is less likely to hold valuable information about the market. &#xA;Whether that makes (any) sense and whether that could create this effect in the IV is not something I can decide with my lack of theoretical and empirical knowledge about this topic. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I at least somewhat correct? What would be a correct argument? Is there some literature backing up the statements?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's entirely possible I'm missing something or am completely wrong. If that's the case, is there an argument to be made to the same effect? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please answer in simple terms. I am a student of mathematics so I can deal with mathematical complexity, but have very little knowledge of financial derivatives.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much!&lt;/p&gt;&#xA;" OwnerUserId="7013" LastActivityDate="2016-07-20T07:16:21.933" Title="Variability of IVs of OTM options" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;outliers&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28160" PostTypeId="2" ParentId="27993" CreationDate="2016-07-19T22:05:08.263" Score="2" Body="&lt;p&gt;There is no need to resort to negative-coupon bonds. A negative $R_t$ is simply a negative payment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a simple example, build a portfolio consisting of being long a $n$ maturity bond paying a coupon C on $t \in \left\lbrace 1, 2, ..., n \right\rbrace$ and short a zero-coupon bond with face value $V &amp;gt; C$ maturing at $t^*$. Then, $R_t &amp;gt; 0$ for $t \ne t^*$, but $R_{t^*} &amp;lt; 0$. In other words, a net positive cashflow at all $t \in \left\lbrace 1, 2, ..., n \right\rbrace \setminus \left\lbrace t^* \right\rbrace$, with a net negative cashflow at time $t^*$. Assume also that interest rates are strictly positive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly, $D = E \left[ T \right]$ still. Assuming that $B = \sum_{t=1}^n R_t \nu^t&amp;gt; 0$ (the net actualized value of the portfolio is positive), $p_{t^*} = \frac{\nu^{t^*} R_{t^*}}{B} &amp;lt; 0$. Also, $\sum_{\tau \ne t^*} p_\tau &amp;gt; 1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If instead $B &amp;lt; 0$, then $p_{t^*} &amp;gt; 0$, but $p_\tau &amp;lt; 0$ for $\tau \ne t^*$ (all the other &quot;probabilities&quot; are negative).&lt;/p&gt;&#xA;" OwnerUserId="15336" LastEditorUserId="15336" LastEditDate="2016-07-20T07:54:22.890" LastActivityDate="2016-07-20T07:54:22.890" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="28161" PostTypeId="1" AcceptedAnswerId="29569" CreationDate="2016-07-19T22:29:40.833" Score="0" ViewCount="1216" Body="&lt;p&gt;I have a $N x d$ matrix of standardized residuals, and I want to estimate the parameters $\alpha$, $\beta$ and $\gamma$ of the &lt;a href=&quot;https://www.kevinsheppard.com/images/d/de/CES_JFeC.pdf&quot; rel=&quot;nofollow&quot;&gt;asymmetric version&lt;/a&gt; (Cappiello, Engle, Sheppard, 2006) of the usual &lt;a href=&quot;http://www.cass.city.ac.uk/__data/assets/pdf_file/0003/78960/Week7Engle_2002.pdf&quot; rel=&quot;nofollow&quot;&gt;dynamic conditional correlation model&lt;/a&gt; (Engle, 2002):&#xA;$$ Q_t = (1-\alpha-\beta) \bar{Q}-\gamma \bar{N} + \alpha z_{t-1}z_{t-1}' + \beta Q_{t-1}+\gamma n_{t-1}n_{t-1}'$$&#xA;$$R_{ij,t}=\frac{Q_{ij,t}}{ \sqrt{Q_{ii,t}Q_{jj,t}}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Q_t$ is a proxy process, $R_t$ the correlation matrix, $z_t$ a matrix with vectors $[z_1, ..., z_d]$, $n_t$=$I_{\{z_t&amp;lt;0\}}z_t$ the asymmetric innovation, and $\bar{N}=E[n_t n_t']=T^{-1}\sum_{t=1}^T n_tn_t'$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to set the &lt;strong&gt;&quot;empirical&quot; covariance matrix&lt;/strong&gt; over the sample as &lt;strong&gt;starting value&lt;/strong&gt;, i.e. as lagged proxy for estimating $Q_2$, i.e. &#xA;$$Cov(z)=Q_1$$&#xA;and as the &quot;true&quot; &lt;strong&gt;unconditional covariance matrix&lt;/strong&gt;, i.e.&#xA;$$Cov(z)=\bar{Q}$$&#xA;and estimate how the $Q_{t+1}$ forecast depends on past $Q_t$ and past realizations $z_tz_t'$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;QUESTION:&lt;/strong&gt; How can such estimation procedure be implemented in R without having to specify the individual GARCH models? I already have the standardized residuals, therefore I don't need univariate GARCH.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#data for example&#xA;library(rmgarch)&#xA;data(dji30retw)&#xA;Dat = dji30retw[, 1:6, drop = FALSE]&#xA;&#xA;#specify garch specification (the given parameters come from previous analysis)&#xA;models &amp;lt;- list()&#xA;for (i in 1:6){&#xA;models[[i]]=ugarchspec(variance.model = list(model = &quot;gjrGARCH&quot;, garchOrder = c(1, 1),&#xA;                                            submodel = NULL, external.regressors = NULL, variance.targeting = TRUE),&#xA;                      mean.model = list(armaOrder = c(0,0), include.mean = FALSE, archm = FALSE,&#xA;                                        archpow = 1, arfima = FALSE, external.regressors = NULL, archex = FALSE),&#xA;                      distribution.model = &quot;norm&quot;, start.pars = list(), fixed.pars = list(alpha1=8.81e-02,&#xA;                                                                                          beta1=9.41e-01 ,&#xA;                                                                                          gamma1=-8.46e-02,&#xA;                                                                                          omega=5.016982e-07))&#xA;}&#xA;&#xA;#by filtering data with the specification, I create 1-step ahead volatility forecast&#xA;filter &amp;lt;- list()&#xA;for (i in 1:6){&#xA;  filter[[i]]=ugarchfilter(models[[i]],Dat[,i])&#xA;}&#xA;&#xA;#standardized residuals (1141 x 6)&#xA;st.res &amp;lt;- matrix(ncol=6, nrow=1141)&#xA;for (i in 1:6){&#xA;  st.res[,i]=residuals(filter[[i]])/sigma(filter[[i]])&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Assuming &lt;code&gt;st.res&lt;/code&gt; is the matrix I'm working on, how would I proceed in estimating the required parameters? If someone can explain how to estimate the aDCC parameters with given data I'd appreciate it very much.&lt;/p&gt;&#xA;" OwnerUserId="20573" LastEditorUserId="20573" LastEditDate="2016-07-20T15:29:58.360" LastActivityDate="2016-08-10T19:13:20.477" Title="How to estimate an Engle's asymmetric DCC model in R?" Tags="&lt;time-series&gt;&lt;r&gt;&lt;garch&gt;&lt;correlation&gt;&lt;dynamic&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28163" PostTypeId="2" ParentId="28136" CreationDate="2016-07-20T02:20:05.167" Score="0" Body="&lt;p&gt;The way to model the correlation may depend on the portfolio you have.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example you may model the default distribution for a small portfolio of loans using a mixed binomial model. In this case the state of the economy determine the probability of default, but in each scenario the individual defaults events share the same probability (homogeneity). Thus, we have correlation in default events through common dependence on a factor. This is obtained by making the mixture parameter stochastic: p (the probability of default) is randomized. Let $p ̃ $ be the stochastic default probability, which we assume, has a distribution on [0, 1] which can be continuous (i.e., given by a density f) or discrete. Conditional on the value of  $p ̃ $ the number of defaults follows a binomial distribution with probability parameter $p ̃ $.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, in the discrete case, with two possible scenarios, the probability that k out of N default is given by: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P(D=k)=f(p_1)\binom Nk p_1^k (1-p_1 )^{N-k}+f(p_2)\binom Nk p_2^k(1-p_1)^{N-k}$   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The variance of the number of defaults is: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Var[D]=Np ̅(1-p ̅ )+N(N-1)Var[p ̃]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first term is the variance that would apply if the default probability were fixed (i.e. without correlation). The second term is additional variance. Variation in $p ̃ $ is an important contributor to the variance in the number of defaults because it determines the correlation between defaults events. Let $X_i$ denote the default indicator of issuer i (equal to 1 if i defaults and 0 otherwise), we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ρ(X_i  ,X_j )=\frac{Var[p ̃ ]}{p ̅(1-p ̅)} ,   i≠j$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that, since the variance in $p ̃ $ determines the correlation between default event indicators, we can model the correlation by properly chose the distribution of $p ̃ $.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can be proved that for homogeneous large portfolios of loans the distribution of the loss function is equal to the distribution of $p ̃ $. Merton model has an economic meaning and fit whit in this framework so it is often used for this purpose. Assume all firms have the same correlation $ρ$ and same default probability $p ̅ $. The &quot;Fraction of defaults&quot; cumulative distribution for a Large homogeneous loan portfolio may then be written as: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P[p(M)≤θ] = N(\frac{1}{\sqrt{ρ}} (N^{-1} (θ) \sqrt{(1-ρ)}-N^{-1} (p ̅ )))   $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is also known known as one-factor Gaussian copula model and has many applications with CDO. &lt;/p&gt;&#xA;" OwnerUserId="22524" LastActivityDate="2016-07-20T02:20:05.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28164" PostTypeId="1" CreationDate="2016-07-20T03:05:51.430" Score="0" ViewCount="2056" Body="&lt;p&gt;I would like to calculate the interest rate from a EuroDollar Future Contract(say the Sep-16 Futures Contract is trading at 99.2575). From the interest rate, I would like to calculate the zero coupon rate and discount factor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The values of EuroDollar Futures Contract looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;        Price   Zero Coupon Discount Factor&#xA;Sep-16  99.2575 0.673049123 0.997116025&#xA;Dec-16  99.185  0.725403393 0.995093125&#xA;Mar-17  99.1475 0.757944554 0.993081443&#xA;Jun-17  99.1075 0.787513853 0.990695774&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Not sure how to work out the interest rate, zero coupon and discount factor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Need some guidance on doing this.&lt;/p&gt;&#xA;" OwnerUserId="5839" LastActivityDate="2016-07-22T12:46:32.433" Title="Calculating the interest rate from a EuroDollar Futues contract" Tags="&lt;futures&gt;&lt;eurodollars&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28165" PostTypeId="1" CreationDate="2016-07-20T03:19:11.807" Score="1" ViewCount="142" Body="&lt;p&gt;I have a bit of a favor to ask and if anyone could help me out with this I'd really appreciate it. At the moment I'm trying to use the triangle wave formula as the payoff for the Black-Scholes PDE i.e. $\Phi(x) = \frac{2}{\pi}(\sin^{-1}(\sin(S\pi )))$ with the boundary condition $0$ as $S \rightarrow \infty$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, in the numerical Black-Scholes PDE, you start from maturity time $T$ and work your way backwards until you reach the initial time $0$. In order to get a visualization of the plot and ensure everything was working correctly I decided to plot the option at maturity time $T$, and using the conditions as given above I obtained the plot:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/RVwPq.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/RVwPq.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This plot appears to be wrong since it does not look like a triangle wave - as taken from Wolfram Alpha, the triangle wave should look like this: &#xA;&lt;a href=&quot;http://www.wolframalpha.com/input/?i=(2%2Fpi)*(sin%5E(-1)(sin(pi*x)))&quot; rel=&quot;nofollow noreferrer&quot;&gt;Triangle Wave&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone tell me why the PDE plot doesn't look anything like this? I'd really appreciate it, thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="20543" LastActivityDate="2016-07-20T03:19:11.807" Title="Can someone try this Boundary Condition for the Black-Scholes PDE out for me?" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;&lt;black-scholes-pde&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28166" PostTypeId="1" CreationDate="2016-07-20T03:28:01.237" Score="0" ViewCount="160" Body="&lt;p&gt;Here's a puzzle I encountered when trying to understand how treasury bond futures (/ZB) are settled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Supposed I am short 1 September ZB contract at \$170, and on its last trading day the contract settles at \$165. If I were to close the contract at the last minute, my realized P&amp;amp;L will be \$1000 x (\$170 - \$165) = \$5000. That is, for every \$1 difference between my &quot;entry&quot; and &quot;exit&quot; price of /ZB, my final realized P&amp;amp;L is changed by \$1000.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what happens if I don't close the contract? If I understand it correctly, I will pick a bond to deliver, and be paid an &quot;invoice price&quot; which equals the Settlement Price (\$165) times a Conversion Factor, plus the Accrued Interest. For example if the cheapest to deliver (CTD) bond has a conversion factor of 0.9, then I'll be paid an invoice price of \$1000 x \$165 x 0.9 = $148,500 plus accrued interest. It seems obvious to me that the bond conversion factor (0.9) affects my realized P&amp;amp;L in this case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how can it possibly be true that my P&amp;amp;L is not affected by bond conversion factor if I close the contract (because it is always a fixed 1000x multiplier), but is affected by bond conversion factor if I don't?&lt;/p&gt;&#xA;" OwnerUserId="22627" LastActivityDate="2016-07-20T10:32:58.873" Title="Trying to understand T-Bond futures settlement. What am I missing?" Tags="&lt;bond&gt;&lt;futures&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28167" PostTypeId="1" CreationDate="2016-07-20T03:40:45.290" Score="6" ViewCount="309" Body="&lt;p&gt;Edit: I'm a dumbass. The thing below is supposed to be just the motivation of asking. I want to ask for below and in general, hehe.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Assume that we have a general one-period market model consisting of d+1 assets and N states.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using a replicating portfolio $\phi$, determine $\Pi(0;X)$, the price of a European call option, with payoff $X$,  on the asset $S_1^2$ with strike price $K = 1$ given that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S_0 =\begin{bmatrix}&#xA;2 \\ &#xA;3\\ &#xA;1&#xA;\end{bmatrix}, S_1 = \begin{bmatrix}&#xA;S_1^0\\ &#xA;S_1^1\\ &#xA;S_1^2&#xA;\end{bmatrix}, D = \begin{bmatrix}&#xA;1 &amp;amp; 2 &amp;amp; 3\\ &#xA;2 &amp;amp; 2 &amp;amp; 4\\ &#xA;0.8 &amp;amp; 1.2 &amp;amp; 1.6&#xA;\end{bmatrix}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the columns of D represent the states for each asset and the rows of D represent the assets for each state&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;What I tried:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We compute that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X = \begin{bmatrix}&#xA;0\\ &#xA;0.2\\ &#xA;0.6&#xA;\end{bmatrix}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we solve $D'\phi = X$, we get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\phi = \begin{bmatrix}&#xA;0.6\\ &#xA;0.1\\ &#xA;-1&#xA;\end{bmatrix}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would seem that the price of the European call option $\Pi(0;X)$ is given by the value of the replicating portfolio&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S_0'\phi = 0.5$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;On one hand, if we were to try to see if there is arbitrage in this market by seeing if a state price vector $\psi$ exists by solving $S_0 = D \psi$, we get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\psi = \begin{bmatrix}&#xA;0\\ &#xA;-0.5\\ &#xA;1&#xA;\end{bmatrix}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence there is no strictly positive state price vector $\psi$ s.t. $S_0 = D \psi$. By &lt;a href=&quot;http://dybfin.wustl.edu/research/papers/arbetc7.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;'the fundamental theorem of asset pricing'&lt;/a&gt; (or &lt;a href=&quot;http://www.nuff.ox.ac.uk/users/murphya/Teaching/Arbitrage.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;'the fundamental theorem of finance'&lt;/a&gt; or &lt;a href=&quot;http://www.jhqian.org/apt/apbook.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;'1.3.1' here&lt;/a&gt;), there exists arbitrage in this market.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;On the other hand the price of 0.5 seems to be confirmed by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Pi(0;X) = \beta E^{\mathbb Q}[X]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\beta = \sum_{i=1}^{3} \psi_i = 0.5$ (sum of elements of $\psi$) and $\mathbb Q$ is supposed to be the equivalent martingale measure given by $q_i = \frac{\psi_i}{\beta}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E^{\mathbb Q}[X] = q_1X(\omega_1) + q_2X(\omega_2) + q_3X(\omega_3)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ = 0 + \color{red}{-1} \times 0.2 + 2 \times 0.6 = 1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\to \Pi(0;X) = 0.5$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I guess $\therefore$ that we cannot determine the price of the European call using $\Pi(0;X) = \beta E^{Q}[X]$ because there is no equivalent martingale measure $\mathbb Q$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I noticed that one of the probabilities, in what was attempted to be the equivalent martingale measure, is negative. I remember reading about &lt;strong&gt;negative probabilities&lt;/strong&gt; &lt;a href=&quot;https://en.wikipedia.org/wiki/Negative_probability#Finance&quot; rel=&quot;nofollow noreferrer&quot;&gt;in Wiki&lt;/a&gt; and here&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.592.2043&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Half of a Coin:&#xA;Negative Probabilities&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However the following links&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://poseidon01.ssrn.com/delivery.php?ID=649017121009107028094121105090018069032034022058026059113005070074031084099122001112103042027101022023115111118120122066015017046051062093060076111091084020114102061047044088127066112028029002069089095091082087104064117087123080025112103020025082122&amp;amp;EXT=pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Negative Probabilities in Financial Modeling&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.espenhaug.com/NegativeProbabilitiesHaug.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Why so Negative to&#xA;Negative Probabilities?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;mentioned by Wiki seem to assume absence of arbitrage so I think they are not applicable. Or are they?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it perhaps that this market can be considered to be arbitrage-free under some &lt;a href=&quot;https://en.wikipedia.org/wiki/Quasiprobability_distribution&quot; rel=&quot;nofollow noreferrer&quot;&gt;quasiprobability measure&lt;/a&gt; that allows negative probabilities?&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="7788" LastEditDate="2018-08-15T06:37:48.307" LastActivityDate="2018-08-15T07:37:45.470" Title="Can the concept of negative probabilities be used to price a call option?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;probability&gt;&lt;pricing&gt;&lt;quasiprobability&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="28168" PostTypeId="5" CreationDate="2016-07-20T03:41:55.370" Score="0" Body="&lt;p&gt;One possible violation of Kolmogorov axioms is $P(A) \ge 0$ for some $A \in \mathscr F$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The probability function of a random variable $X$ in $(\Omega, \mathscr F, \mathbb P)$ taking values in $(\mathbb R, \mathscr B(\mathbb R))$ is given by $P(X \in B)$ for some $B \in \mathscr{B}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If for some $B \in \mathscr{B}$, we have $P(X \in B) &amp;lt; 0$, then $X$ is not a random variable in $(\Omega, \mathscr F, \mathbb P)$ but can be random variable in quasiprobability space, a measurable space equipped with a quasiprobability function, which is not a measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the outcome of a toss of a 'half-coin' can be represented by a random variable in a quasiprobability space. Its quasiprobability function is not strictly nonnegative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Read more here: &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.592.2043&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow&quot;&gt;Half of a Coin:&#xA;Negative Probabilities&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="7788" LastEditDate="2016-07-21T14:41:46.403" LastActivityDate="2016-07-21T14:41:46.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28169" PostTypeId="4" CreationDate="2016-07-20T03:41:55.370" Score="0" Body="For negative probabilities and other violations of the Kolmogorov axioms" OwnerUserId="7788" LastEditorUserId="7788" LastEditDate="2016-07-20T10:49:50.993" LastActivityDate="2016-07-20T10:49:50.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28172" PostTypeId="2" ParentId="28159" CreationDate="2016-07-20T07:16:21.933" Score="0" Body="&lt;p&gt;This is a qualitative answer...  Deep otm options have a value associated with there degree of convexity..  it has a much higher rate of change then anything ATM...  Gamma is explosive for expiring otm options... Otm options also represent the rare event of a higher order..  so a deep otm option represents a tail event basically... we don't know much about tail events just that they have power laws to them ..  nothing about their frequency...  So basically you would have to make enough money selling those deep otm premiums to cover the loss when the rare event blows through your strike... Because a very small amount of money can hedge a very large drop in a portfolio the premium demand is higher as well.. I've been told this happened after 87 crash...  It has to do with convex asymmetric payoffs basically...  It's the first thing you learn when trading otm options typically by losing money&lt;/p&gt;&#xA;" OwnerUserId="4764" LastActivityDate="2016-07-20T07:16:21.933" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28173" PostTypeId="1" CreationDate="2016-07-20T07:59:39.370" Score="2" ViewCount="493" Body="&lt;p&gt;I would like to calculate funding liquidity following Asness/Moskowitz/Pedersen (2013). Among others, they calculate the LIBOR minus term repo rate, and the Swap-T-bill, LIBOR minus interest rate swaps. I checked the FRED homepage and CRSP for the term repo rate and interest swap rate and found numerous different versions of both variables. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any industry standards in research which particular data (e.g. Swap for 1y or 30y) I should choose for these two variables?&lt;/p&gt;&#xA;" OwnerUserId="22633" LastActivityDate="2017-01-21T07:12:07.197" Title="How to choose the correct ticker for rates?" Tags="&lt;data&gt;&lt;interest-rate-swap&gt;&lt;rates&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28174" PostTypeId="2" ParentId="25219" CreationDate="2016-07-20T08:27:38.157" Score="3" Body="&lt;p&gt;Have you solved it yet? For example in the drift parameter, the dt needs to be vector of time from 0 to 1 by dt. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My code is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  GBM&amp;lt;-apply(BM,2,function(x) 100*exp((cumsum((r-0.5*sigma*sigma)*time)+sigma*x)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where I'm using GBM on already cumsummed Brownian Motion (x). &lt;/p&gt;&#xA;" OwnerUserId="22237" LastActivityDate="2016-07-20T08:27:38.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28175" PostTypeId="2" ParentId="27871" CreationDate="2016-07-20T08:29:54.717" Score="1" Body="&lt;p&gt;An index has to have a purpose. For example, the FTSE100 tracks the performance of the 100 largest capitalised companies on the LSE; it's purpose is to give the expected return of a fund of those largest companies. It is, therefore, replicable; if I wanted to get the same performance as the FTSE100, I just buy the right proportions of shares as the index contains, and keep rebalancing vs the changing portfolio and weightings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for a currency index, the question has to be: What is it for? If you want to know how well USD is performing, then performing against what? If I was a US investor in a collection of European companies, where I want my USD initial capital to track the movement of the currencies of those companies, then I would want a basket containing that proportion of currencies. If I was a Swiss investor with a need to maintain a fund of CNY for my imports, then I would want that in the basket.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ultimately, I think an index which just tracks 'volume' (as measured by whom?) isn't particularly useful. Currency movements are less about how much has moved, and more about the economies and inflationary environments of the countries that issue them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the recent Brexit move. If I were a US investor into the UK, then obviously GBPUSD is going to be a large component in the risks I'm looking at. But for exporting companies, a drop in GBPUSD is helpful, as it cuts labour, rent and other local costs at a stroke. But that UK capitalisation is also reduced. So then perhaps I care more about the long term interest rates available in the UK, and the market's view on its future. So I might want a basket of Gilts, German bonds and Treasuries, each with their own currency dependencies, to reflect my interest or my risk.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2016-07-20T08:29:54.717" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28176" PostTypeId="2" ParentId="28153" CreationDate="2016-07-20T09:14:35.483" Score="1" Body="&lt;h3&gt;Idea&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Let $B$ be a standard brownian motion starting from $x_0=0$, $m_T = \inf_{u\leq T}B_u$ and $M_T =\sup_{u\leq T}B_u$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's define if it exists for $A\in\sigma(B_u,u\leq T)$, $\mathbb{P}(A | B_T=x_T)\stackrel{\rm def}{=}\lim_{\varepsilon\to 0}\mathbb{P}(A|B_T\in(x_T-\varepsilon,x_T+\varepsilon))$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{split}&#xA;\mathbb{P}(\tau_U\leq T \cap \tau_U\leq \tau_L)= &amp;amp; \mathbb{P}(m_T&amp;gt;L;M_T\geq U |B_T =x_T)\\&#xA;= &amp;amp;\mathbb{P}(m_T&amp;gt;L|B_T=x_T)-\mathbb{P}(L&amp;lt;m_T&amp;lt;M_T&amp;lt;U|B_T=x_T)&#xA;\end{split}$$&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Computations attempt&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Then, this is side computations based from results about hitting times from Chapter 3 of Mathematical Methods for Financial Markets of Monique Jeanblanc, Marc Yor and Marc Chesney.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so by denoting $p_T(y)=\frac{1}{\sqrt{2\pi t}}e^{-\frac{y^2}{2t}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have:&#xA;$$\begin{split} P\stackrel{\rm def}{=} &amp;amp; \mathbb{P}(\tau_U\leq T \cap \tau_U\leq \tau_L)\\&#xA;=&amp;amp; \frac{p_T(-2L+x_T)}{p_T(-x_T)} - \frac{\sum_{n=-\infty}^{\infty}p_T(x_T+2n(U-L))-p_T(2U-x_T+2n(U-L))}{p_T(x_T)}&#xA;\end{split}$$&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-07-20T09:14:35.483" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28177" PostTypeId="1" AcceptedAnswerId="28189" CreationDate="2016-07-20T09:33:48.093" Score="0" ViewCount="1811" Body="&lt;p&gt;I'm looking for some intraday stock data. Doesn't really matter what kind of security... I'm just looking for price, volume, bid, and ask. I'm looking to test a model based on the dynamics and kinematics of a body and how it can be applied to stock price movement, however I have no source of sample data to test on. I don't feel the need to purchase any data because I'm not looking for huge quantities... Only a small amount to test on, perhaps just a day's worth, doesn't even matter from what date. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any source of such sample data? Or should I write up a data scraper and just run it for a week to get this data?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a link to a research publication that models stock movement from Newton's Second Law of motion:&#xA;&lt;a href=&quot;http://apmr.management.ncku.edu.tw/comm/updown/DW0904222241.pdf&quot; rel=&quot;nofollow&quot;&gt;http://apmr.management.ncku.edu.tw/comm/updown/DW0904222241.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="22393" LastEditorUserId="22393" LastEditDate="2016-07-20T09:43:19.813" LastActivityDate="2020-01-20T04:07:37.153" Title="Where to find sample intraday data? One to two days or more" Tags="&lt;data&gt;&lt;python&gt;&lt;intraday&gt;&lt;bid&gt;&lt;ask&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28178" PostTypeId="1" AcceptedAnswerId="28193" CreationDate="2016-07-20T10:04:27.500" Score="4" ViewCount="340" Body="&lt;p&gt;There are a number of large trend-following CTAs that have been successfully running for 10+ years. Their main instrument is diversified futures. Why not ETFs (is it due to liquidity / scaling, &lt;a href=&quot;http://www.thehedgefundjournal.com/sites/default/files/a-cost-comparison-of-futures-and-etfs.pdf&quot; rel=&quot;nofollow&quot;&gt;costs&lt;/a&gt;, risk)?&lt;/p&gt;&#xA;" OwnerUserId="11655" LastEditorUserId="11655" LastEditDate="2016-07-20T15:05:45.117" LastActivityDate="2020-10-09T14:50:26.080" Title="Large trend-followers: why use futures rather than ETFs?" Tags="&lt;futures&gt;&lt;etf&gt;&lt;trends&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28179" PostTypeId="2" ParentId="28166" CreationDate="2016-07-20T10:32:58.873" Score="1" Body="&lt;p&gt;During the delivery month, the &quot;net basis&quot; defined as $$ CTD price - (conversion factor * futures price) $$ trades at around zero, otherwise there is an arbitrage.   Therefore daily changes in the CTD price are equal to $ conversion factor * $ daily changes in the futures price.  Hence it is appropriate that the invoice price change is also multiplied by the conversion factor.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-07-20T10:32:58.873" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28180" PostTypeId="2" ParentId="28177" CreationDate="2016-07-20T11:04:43.783" Score="0" Body="&lt;p&gt;You can get it from google finance:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.google.com/finance/getprices?q=LHA&amp;amp;x=ETR&amp;amp;i=60&amp;amp;p=5d&amp;amp;f=d,c,h,l,o,v&quot; rel=&quot;nofollow&quot;&gt;https://www.google.com/finance/getprices?q=LHA&amp;amp;x=ETR&amp;amp;i=60&amp;amp;p=5d&amp;amp;f=d,c,h,l,o,v&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19615" LastActivityDate="2016-07-20T11:04:43.783" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28181" PostTypeId="2" ParentId="27690" CreationDate="2016-07-20T11:10:22.497" Score="0" Body="&lt;p&gt;I think you're asking if say a EURUSD CCBS should be discounted on the USD curve (using FX to convert the EUR payments to USD) or on the EUR curve (adjusted for basis).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once upon a time, the two would have been considered equivalent. That is, investing in USD at Libor flat would be equivalent to investing in EUR at Euribor+Basis, so the basis swap is par-valued.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equivalently, you could say that the basis is the required premium (discount) to cover the increased (decreased) risk of lending in the EUR interbank market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But! We are not in Kansas any more. With cash-collateralised, daily margined, OIS-accrued bilateral arrangements, as far as I'm aware, a CCBS executed as a single trade (in major currencies) is generally collateralised in a single currency (usually USD), and thus the right discounting curve to use is the OIS curve relevant to that currency (i.e. FedFund curve). CCBS can be traded with different collateralisation choices written into the CSA on the contract, so the price then depends on what that choice is for a given trade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll take a guess that when such trades are cleared on LCH, it will depend on what the LCH curve looks like, possibly with other adjustments to take into account Initial Margin.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2016-07-20T11:10:22.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28186" PostTypeId="1" AcceptedAnswerId="28187" CreationDate="2016-07-20T16:47:27.757" Score="7" ViewCount="3314" Body="&lt;p&gt;We consider an stock price $S$ following a normal model: $dS_t = \sigma dW_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can write this as $\frac{dS_t}{S_t}=\frac{\sigma}{S_t}dW_t$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence we can see that $S$ follows a &quot;log-normal&quot; diffusion with a local volatility function $c(S)=\frac{\sigma}{S}$ which is downward sloping.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: can we deduce that the log normal smile implied by this model will be downward sloping as well ? &#xA;That is to say, if we have a local volatility function which is decreasing as a function of $S$, will the lognormal implied vol be decreasing as a function of the strike ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks !&lt;/p&gt;&#xA;" OwnerUserId="15435" LastEditorUserId="15435" LastEditDate="2016-07-20T17:17:45.800" LastActivityDate="2017-02-17T08:28:45.270" Title="Downward sloping smile in normal model" Tags="&lt;volatility-smile&gt;&lt;local-volatility&gt;&lt;lognormal&gt;&lt;normal&gt;" AnswerCount="4" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28187" PostTypeId="2" ParentId="28186" CreationDate="2016-07-20T17:49:31.633" Score="4" Body="&lt;p&gt;Since $S_T = S_0 + \sigma W_T$, &#xA;\begin{align*}&#xA;C &amp;amp;:= E\left((S_T-K)^+ \right)\\&#xA;&amp;amp;= E\left((S_0+\sigma W_T-K)^+ \right)\\&#xA;&amp;amp;=\int_{\frac{K-S_0}{\sigma \sqrt{T}}}^{\infty}(S_0+\sigma\sqrt{T} x-K) \frac{1}{\sqrt{2\pi}}e^{-\frac{x^2}{2}}dx\\&#xA;&amp;amp;=(S_0-K)\Phi\left(\frac{S_0-K}{\sigma \sqrt{T}}\right)+\frac{\sigma\sqrt{T}}{\sqrt{2\pi}}e^{-\frac{(S_0-K)^2}{2\sigma^2 T}},&#xA;\end{align*}&#xA;where $\Phi$ is the cumulative distribution function of a standard normal random variable. Then,&#xA;\begin{align*}&#xA;\frac{dC}{d K} &amp;amp;= -\Phi\left(\frac{S_0-K}{\sigma \sqrt{T}}\right) &amp;lt;0.&#xA;\end{align*}&#xA;On the other hand, let $\sigma_I(K)$ be the log-normal implied volatility, that  is,&#xA;\begin{align*}&#xA;C = C(K, \sigma_I(K)).&#xA;\end{align*} &#xA;Then&#xA;\begin{align*}&#xA;\frac{dC}{d K} &amp;amp;=\frac{\partial C}{\partial K} + \frac{\partial C}{\partial \sigma_I}\frac{\partial \sigma_I}{\partial K}.&#xA;\end{align*}&#xA;Here,&#xA;\begin{align*}&#xA;\frac{\partial C}{\partial K} = - \Phi(d_2),&#xA;\end{align*}&#xA;where &#xA;\begin{align*}&#xA;d_2 = \frac{\ln\frac{S_0}{K} - \frac{1}{2}\sigma_I^2 T}{\sigma_I \sqrt{T}}.&#xA;\end{align*}&#xA;Since&#xA;\begin{align*}&#xA;\lim_{K\rightarrow \infty}\frac{S_0-K}{\ln \frac{S_0}{K}} = \infty,&#xA;\end{align*}&#xA;we can expect that, for $K$ sufficiently large, &#xA;\begin{align*}&#xA;d_2 &amp;gt; \frac{S_0-K}{\sigma \sqrt{T}}.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;\frac{\partial C}{\partial \sigma_I}\frac{\partial \sigma_I}{\partial K} &amp;amp;= \Phi(d_2) - \Phi\left(\frac{S_0-K}{\sigma \sqrt{T}}\right) &amp;gt; 0.&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;\frac{\partial \sigma_I}{\partial K} &amp;gt; 0,&#xA;\end{align*}&#xA;and the implied volatility is a increasing function of such strike levels. In conclusion, &lt;em&gt;the implied volatility does not have to be a decreasing function of the strike&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-07-20T23:26:28.543" LastActivityDate="2016-07-20T23:26:28.543" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="28189" PostTypeId="2" ParentId="28177" CreationDate="2016-07-20T20:52:36.553" Score="2" Body="&lt;p&gt;Check out Quandl's collection of intraday data from AlgoSeek: &lt;a href=&quot;https://www.quandl.com/vendors/as&quot; rel=&quot;nofollow&quot;&gt;https://www.quandl.com/vendors/as&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These are historical trade-based minute bars showing OHLCV for stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you click on each database in the link above, you'll see a tab for &quot;Free Sample Data&quot; to the left. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example: &lt;a href=&quot;https://www.quandl.com/data/ASTRAN/documentation/free-sample-data&quot; rel=&quot;nofollow&quot;&gt;https://www.quandl.com/data/ASTRAN/documentation/free-sample-data&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that to download the free sample data, you'll need to create a Quandl account so that you get a Quandl API key. Making an account is free and easy. Our API is also free to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;[Disclosure: I work for Quandl]&lt;/p&gt;&#xA;" OwnerUserId="19252" LastActivityDate="2016-07-20T20:52:36.553" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28191" PostTypeId="1" AcceptedAnswerId="28307" CreationDate="2016-07-20T23:24:37.520" Score="0" ViewCount="182" Body="&lt;p&gt;Let $$X_1\sim N(\mu_{X_1},\sigma_{X_2}^2)$$ $$X_2\sim N(\mu_{X_2},&#xA;\sigma_{X_2}^2)$$&#xA;where $\mu_{X_2}=c+aX_1$. Also, I have data $D$ (with missing values on $X_1,X_2$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I update/estimate the parameters $\mu_{X_1},\sigma_{X_1},\mu_{X_2},a,c,\sigma_{X_2}$ using EM? i.e. what is the formula for updating $\sigma_{X_2}$?   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My model is a conditional Gaussian, which is a conditional form of a bivariate Gaussian $(X_1,X_2)$ with mean vector $(\mu_1,\mu_2)^\top$ and covariance matrix &#xA;$$\left( \begin{matrix}&#xA;   \Sigma _{11} &amp;amp; \Sigma _{12}  \\&#xA;   \Sigma _{21} &amp;amp; \Sigma _{22}  \\&#xA;\end{matrix} \right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a reference to convert bivariate Gaussian to conditional Gaussian: $$\mu_{2|1}=\mu_{2}+\Sigma_{21}\Sigma_{11}^{-1}(X_1-\mu_1)\quad,\quad \Sigma_{22|1}=\Sigma_{22}-\Sigma_{21}\Sigma_{11}^{-1}\Sigma_{12}$$ which yields my model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that when $X_1$ has different observations and $X_2$ is unobserved, the variance of $X_2$ remains unchanged.So how to update the $\sigma_{x_2}$? Do I need to estimate covariance matrix?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Initial setting for the model&#xA;$$X_1\sim N(5,7)\quad,\quad X_2\sim N(0.5X_1,8)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Data:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X_1:\operatorname{9\,\,4\,\,NA}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\quad X_2:\operatorname{NA\,\,NA\,\,3}$$&lt;/p&gt;&#xA;" OwnerUserId="22152" LastEditorUserId="22152" LastEditDate="2016-07-26T22:23:11.777" LastActivityDate="2016-07-27T10:19:09.103" Title="EM for conditional Gaussian model" Tags="&lt;statistics&gt;&lt;optimization&gt;&lt;normal-distribution&gt;&lt;parameter-estimation&gt;" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="28192" PostTypeId="2" ParentId="28155" CreationDate="2016-07-21T00:49:01.070" Score="1" Body="&lt;p&gt;Your reasoning is correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer your last question: the current prices alone don't decide how many shares to sell and buy in each of the stocks. That is decided by the hedge ratio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, the whole point of the hedge ratio is to assume that it is the ratio that the stocks will revert back to over time. So if we denote the spread at time $t$ by $s_t$ and the hedge ratio as $\beta$, we have&#xA;$$&#xA;s_t = p(x_t) - \beta p(y_t) + \epsilon_t &#xA;$$&#xA;where $\epsilon_t$ is the deviation from the equilibrium state. When you get your signal and let's say $s_t&amp;gt;0$, you sell \$1 worth of $x$ and buy \$ $\beta$ worth of $y$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do you decide $\beta$? Well, usually by doing a linear regression using some past data. In the stated model it is natural to regress $x_t$ on $y_t$ and force the intercept to be $0$.&lt;/p&gt;&#xA;" OwnerUserId="7555" LastActivityDate="2016-07-21T00:49:01.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28193" PostTypeId="2" ParentId="28178" CreationDate="2016-07-21T04:05:11.250" Score="10" Body="&lt;p&gt;Leverage: futures usually require much lower margin than their ETF counterparts. For example /ES (E-mini S&amp;amp;P 500 futures) requires about \$4K overnight maintenance margin per contract (may vary by brokerage) to control 50 times the S&amp;amp;P 500 index (currently valued at about \$108K). This is over 20:1 leverage. Furthermore you do NOT pay interest on your short positions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tax Benefits: in United States the futures contracts typically qualify for the so called Section 1256 Contracts and have special tax treatment. You may be able to significantly reduce your tax liability on realized short-term gains compared to ETF.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Commissions: in general commissions are lower with futures contracts.&lt;/p&gt;&#xA;" OwnerUserId="22627" LastEditorUserId="22627" LastEditDate="2016-07-21T05:36:50.227" LastActivityDate="2016-07-21T05:36:50.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28194" PostTypeId="2" ParentId="27752" CreationDate="2016-07-21T05:56:21.860" Score="0" Body="&lt;p&gt;You'll be able to send orders to many more brokerages if you learn HTML request protocol and how to use RESTful APIs. For example I have written python API wrappers (scripts that convert python commands into the brokerage's protocol) that allow full trading functionality in both TradeKing and Robinhood.&lt;/p&gt;&#xA;" OwnerUserId="18968" LastActivityDate="2016-07-21T05:56:21.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28195" PostTypeId="1" CreationDate="2016-07-21T06:19:17.793" Score="0" ViewCount="78" Body="&lt;p&gt;if I am short GBPJPY and it start to jump up, instead of closing it, could I use Binary Options to long it immediately after jump up? So I could hedge current Forex position if possible.&lt;/p&gt;&#xA;" OwnerUserId="15885" LastActivityDate="2016-07-21T17:20:16.710" Title="Binary Options hedge Forex position" Tags="&lt;fx&gt;&lt;hedging&gt;&lt;binary-options&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28196" PostTypeId="1" CreationDate="2016-07-21T11:21:45.680" Score="1" ViewCount="191" Body="&lt;p&gt;The Fundamental Theorem of Asset Pricing (FTAP) is invoked when we say the time $0$ price of a European option with payoff $g$ is $e^{-rT}E_Q(g(S_T))$, with the hypothesis that $e^{-rt}S_t$ is a $Q$-martingale.  This martingale condition is satisfied if we assume $S_t$ follows a geometric Brownian motion with drift $r$, so we can use Monte Carlo to estimate the price as&#xA;$$&#xA;e^{-rT}\frac{1}{N}\sum_{i=1}^N g(S_T^i)&#xA;$$&#xA;where $\{S_T^i\}$ are lognormal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fair enough, but what permits one to do this same Monte Carlo estimation assuming $S_t$ follows the dynamics of the Heston model?  In particular, under what conditions is $e^{-rt}S_t$ a martingale for some measure?  We don't know the distribution of $S_t$ under this model, so it's not as straightforward as Black-Scholes.  Certainly we can simulate the paths of this model and compute the sum above, which is what it seems people do, but what justifies this theoretically?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2016-07-22T16:42:40.643" Title="FTAP wih Heston Model" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;heston&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28197" PostTypeId="1" CreationDate="2016-07-21T12:29:40.603" Score="2" ViewCount="50" Body="&lt;p&gt;I have a multipart question about futures and production.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets take corn as an example. We add up the total 1 year futures of corn, call this weight $A$ kg. Next, we can get a reasonable estimate of how much the world corn production will be in 1 year call this $B$ kg. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) Is there a relation between $A$ and $B$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) Can nonproducers of a good sell futures? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If yes, suppose  noncorn farmers sell corn futures. Then $A$ may appear greater than $B$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(3) Then how does the supply and demand work? i.e., will this cause the corn price to go down in 1 year? My confusion is, the supply and demand curves I have seen only assume $B$ and not $A$. Can the demand depend on $A$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(4) When $A&amp;gt;B$, what happens if everybody who bought the futures want their corn?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: I am a newbie, so if this sounds dumb please explain that too. Thanks. &lt;/p&gt;&#xA;" OwnerUserId="22648" LastActivityDate="2016-07-22T13:28:51.297" Title="Is there a relation between total futures and the amount of production?" Tags="&lt;futures&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28198" PostTypeId="2" ParentId="28196" CreationDate="2016-07-21T12:43:37.800" Score="0" Body="&lt;p&gt;You can use this article&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://arxiv.org/pdf/cond-mat/0203046.pdf&quot; rel=&quot;nofollow&quot;&gt;Probability distribution of returns in the Heston model with stochastic volatility&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Let &#xA;$$\begin{align}&#xA;  &amp;amp; d{{S}_{t}}=r{{S}_{t}}dt+\sqrt{{{\nu }_{t}}}\left( \rho dW_{1}^{Q}(t)+\sqrt{1-{{\rho }^{2}}}dW_{2}^{Q}(t) \right) \\ &#xA; &amp;amp; d{{v}_{t}}=\kappa (\theta -{{v}_{t}}){{d}{t}}+{{\sigma }_{v}}\sqrt{{{\nu }_{t}}}dW_{1}^{Q}(t) \\ &#xA;\end{align}\&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;we can show&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$${{S}_{T}}={{S}_{t}}\exp(X_t)\tag 1$$&#xA;where &#xA;$$X_t= \left( r\tau-\frac{1}{2}\int_{t}^{T}{{{v}_{s}}}ds+\rho \int_{t}^{T}{\sqrt{{{v}_{s}}}}dW_{1}^{Q}(s)+\sqrt{1-{{\rho }^{2}}}\int_{t}^{T}{\sqrt{{{v}_{s}}}}dW_{2}^{Q}(s) \right)\tag 2$$&#xA;and&#xA;$$v_t=v_s+\kappa\theta(t-s)-\kappa\int_{s}^{t}{{{v}_{u}}}du+\sigma_v\int_{s}^{t}\sqrt{v_u}dW_1^{Q}(u)$$&#xA;As you know, the conditional on a realized value of $v_s$, the random variable $2c_t v_t$ follows a non-central chi-square distribution, where $$c_t=\frac{2\kappa}{\sigma_v^2(1-e^{-\kappa(t-s)})}\tag 3$$&#xA;therefore you can do this procedure : &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Generate a sample from the distribution of $v_t$ given $v_s$.&lt;/li&gt;&#xA;&lt;li&gt;Generate a sample from the distribution of $\int_{s}^{t}{{{v}_{u}}}du$ given $v_t$ and $v_s$.&lt;/li&gt;&#xA;&lt;li&gt;Recover $\int_{t}^{T}{\sqrt{{{v}_{s}}}}dW_{1}^{Q}(s)$ from $(1),(2)$ given $v_t$, $v_s$ and $\int_{t}^{T}{{{v}_{s}}}ds$.&lt;/li&gt;&#xA;&lt;li&gt;Generate a sample from the distribution of $S_t$ given $\int_{t}^{T}{\sqrt{{{v}_{s}}}}dW_{1}^{Q}(s)$ and $\int_{t}^{T}{{{v}_{s}}}ds$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-07-22T16:42:40.643" LastActivityDate="2016-07-22T16:42:40.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28199" PostTypeId="2" ParentId="28197" CreationDate="2016-07-21T13:08:14.143" Score="4" Body="&lt;p&gt;It is not a dumb question, but very confusing to me at a basic level. The Open Interest in futures (what you call A) has nothing at all to do with the total production (what you call B). The futures market is just a derivative market, where side bets are made as to what the PRICE of the crop will be. You cannot use it to infer what the PRODUCTION will be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course speculators (non-producers) can both sell and buy futures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What consumers will eat however, is physical wheat (i.e. B), not A. A is not edible. A only tells you how many people are interested in making side bets on the price of wheat (for speculative or hedging purposes). Keep in mind also that for every seller of futures there is a buyer (i.e. futures are in zero net supply, there are A futures long but also A futures short, netting out to zero).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Added July 22, 2016)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A word about delivery. Futures are designed so that only a small percentage of contracts will be delivered. From the wheat buyer point of view delivery has 2 disadvantages: 1) it takes place at a warehouse chosen by the exchange, not necessarily one convenient to you. 2) The buyer receives wheat selected by the seller, subject only to minimum quality standards set by the exchange. When I buy oranges or bananas at a supermarket I like to carefully choose the fruits myself based on my preferences; I would not like it if the seller &quot;assigned&quot; fruit to me sight unseen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, when delivery approaches wheat futures buyers will visit local warehouses and personally select the wheat they prefer, they will then buy the wheat and close out the long futures contract. Thus the futures serve only as price insurance, the actual physical wheat is purchased in the cash market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A &gt; B and everybody wanting delivery would break the system (like everyone pulling money out of their bank at the same time, or everyone trying to exit a stadium fire at the same time), but is very unlikely. The Futures Exchange and the CFTC watch to make sure there is &quot;orderly liquidation&quot; (i.e. a sharp decrease in A) in the days prior to delivery.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-07-22T13:28:51.297" LastActivityDate="2016-07-22T13:28:51.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28200" PostTypeId="1" AcceptedAnswerId="28234" CreationDate="2016-07-21T14:09:38.670" Score="2" ViewCount="1919" Body="&lt;p&gt;In a comment to &lt;a href=&quot;https://quant.stackexchange.com/questions/28186/downward-sloping-smile-in-normal-model&quot;&gt;this question&lt;/a&gt;, it is mentioned that, under the log-normal distribution, &#xA;\begin{align*}&#xA;vol(k) \approx vol(atm) \times \sqrt{\frac{atm}{k}}.&#xA;\end{align*}&#xA;Here, $k$ is the strike, $atm$ is the at-the-money strike, and $vol(k)$ is the implied volatility corresponding to strike $k$. I have difficulty to derive this approximation. Any suggestion is appreciated.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-07-23T15:34:26.887" Title="Log-normal Volatility Approximation" Tags="&lt;black-scholes&gt;&lt;implied-volatility&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28201" PostTypeId="2" ParentId="16048" CreationDate="2016-07-21T15:11:46.980" Score="0" Body="&lt;p&gt;Correct answer to the question is 20.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;F_o= 100*(1+.1/2)^2=110.25    ....forward price at time 0(future value of 100 stock at time t=1 yr)&#xA;F_t=125*(1+.1/2)=131.25        .....forward price at time t ( future value of 125 at time t=1/2yr down the line)&#xA;d(t,T)=1/(1+.1/2)=.9523&#xA;f_t=(F_t-F_o)*d(t,T)=20&lt;/p&gt;&#xA;" OwnerUserId="22652" LastActivityDate="2016-07-21T15:11:46.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28202" PostTypeId="2" ParentId="28186" CreationDate="2016-07-21T15:47:38.503" Score="4" Body="&lt;p&gt;The implied Black-Scholes skew will be downward sloping in the limit on both the left and the right.  (I believe @Gordon's derivation claiming upward slope may have a sign error somewhere).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/L0Lth.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/L0Lth.png&quot; alt=&quot;normal model implied vols&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Left Side&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the left side it is sufficient to note that the lognormal model has no density below zero while the normal model has strictly positive density in that region.  Thus, implied Black Scholes vols will approach $\infty$ as strikes $K \rightarrow 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Right Side&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the right side, the simplest observation to make is that the lognormal has a much &quot;Fatter&quot; right tail than the normal model.  This leads us to conclude that the relatively skinny tail of the normal model will give rise to smaller and smaller implied vols as we increase the strike.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's make this a bit more precise.  It is easier to do the math if you consider pricing (and implying vols) of digital options rather than of vanilla options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without loss of generality we may take $F=T=1$ where $F$ is the expectation of $S_T$.  The CDFs are &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;CDF_{LN}(K) = \frac12 \left[1 + \operatorname{erf}\left(\frac{\ln K-1}{\sqrt{2}\sigma_{LN}}\right)\right]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;CDF_{N}(K) = \frac12\left[1 + \operatorname{erf}\left( \frac{K-1}{\sigma_N\sqrt{2}}\right)\right]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so the price of a digital call in the lognormal model is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;C_{LN}(K) = \frac12 \left[1 - \operatorname{erf}\left(\frac{\ln K-1}{\sqrt{2}\sigma_{LN}}\right)\right]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;whereas in the normal model it is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;C_{N}(K) = \frac12\left[1 - \operatorname{erf}\left( \frac{K-1}{\sigma_N\sqrt{2}}\right)\right].&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The error function is strictly increasing, and $K$ dominates $\log(K)$ as $K \rightarrow \infty$.   Thus regardless of the base volatilities $\sigma_{LN}, \sigma_{N}$ from which option prices are derived, we will eventually have &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$  C_{LN}(K) \gg C_{N}(K) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is to say, a lognormal model would &quot;expect&quot; to see much higher option prices than the normal model is giving it.  The arguments to the error function are $\log(K)$ versus $K$, leading to a negative slope in option price ratio and therefore a negative slope in implied vol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus a negative slope in implied skew appears on the right side for prices derived from the normal model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;R Code&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;K = seq(0.5, 5, by=0.01)&#xA;F = T = sigma_N = 1&#xA;r = 0&#xA;d1 = (F-K)/(sigma_N*sqrt(T))&#xA;C = (F-K)*pnorm(d1) + (sigma_N*sqrt(T))/sqrt(2*pi)*exp(-d1^2/2)&#xA;vol_curve = implied_volatilities(C, CALL, F, K, r, 1)&#xA;plot(K, vol_curve,&#xA;     xlab='Strike', ylab=&quot;Imp_Vol&quot;,&#xA;     main=&quot;Implied Black-Scholes Vols Of A Normal Model&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2016-07-21T21:02:27.597" LastActivityDate="2016-07-21T21:02:27.597" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28203" PostTypeId="1" CreationDate="2016-07-21T16:23:50.920" Score="-1" ViewCount="831" Body="&lt;p&gt;What does the payoff diagram look like for a long payer swaption corridor?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, suppose that I am looking at a long-payer $1 \times 10$-year swaption with 10Y swaps as the underlying.  If I am buying a 2.0% strike and selling a 2.5% strike, I'm trying to plot the payoffs at various future potential 10Y swap rates in one year (e.g. 1.5%, 2.0%, 2.5%, 3.0%, $...$).  I haven't found a good example online (and am having trouble calculating in excel) and am concerned that the convexity of the bonds will make the payoff nonlinear as the 10Y market swap rate in one year increases above my high strike (unlike IR caps).  If it is nonlinear, is there a quick, intuitive explanation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any thoughts/guidance would be appreciated.  Thanks.&lt;/p&gt;&#xA;" OwnerUserId="20465" LastEditorUserId="20465" LastEditDate="2016-07-21T16:29:02.153" LastActivityDate="2017-05-16T04:52:41.517" Title="Swaption Corridor Payoff Diagram" Tags="&lt;interest-rate-swap&gt;&lt;swaption&gt;&lt;excel&gt;&lt;payoff&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28204" PostTypeId="2" ParentId="28173" CreationDate="2016-07-21T17:00:55.823" Score="0" Body="&lt;p&gt;If you have access to Bloomberg, I'd look at their generic tickers (for 10Y swap, I think it's USSWP10 Curncy).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise, I'd use the &lt;a href=&quot;https://fred.stlouisfed.org/&quot; rel=&quot;nofollow&quot;&gt;St. Louis FRED database&lt;/a&gt; and search for your rates there.&lt;/p&gt;&#xA;" OwnerUserId="20465" LastActivityDate="2016-07-21T17:00:55.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28205" PostTypeId="2" ParentId="28186" CreationDate="2016-07-21T17:16:33.703" Score="1" Body="&lt;p&gt;I agree with Gordon's deduction if the stock price is distributed that way under risk neutral measure. With sufficiently large K it should be monotone, but for other cases, there could be different cases. I think it can be helpful if you create a list of options with different strikes, time to maturity and spot prices to observe the multivariate relationship between implied vol and S0,K,T-t, based on the pricing formula.&lt;/p&gt;&#xA;" OwnerUserId="22533" LastActivityDate="2016-07-21T17:16:33.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28206" PostTypeId="2" ParentId="28195" CreationDate="2016-07-21T17:20:16.710" Score="1" Body="&lt;p&gt;If you want to hedge a short why don't you buy a call option instead? Have a look at  these &lt;a href=&quot;http://www.optiontradingtips.com/strategies/&quot; rel=&quot;nofollow&quot;&gt;option strategies for hedging&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2016-07-21T17:20:16.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28208" PostTypeId="1" CreationDate="2016-07-21T19:32:53.037" Score="5" ViewCount="286" Body="&lt;p&gt;&lt;a href=&quot;https://deepmind.com/dqn&quot; rel=&quot;noreferrer&quot; title=&quot;DeepMind&quot;&gt;DeepMind&lt;/a&gt; have demonstrated amazing capabilities of a reinforcement machine learning agent to competently play Atari video games.  It is most astounding that that during training nothing more than the image frames of the game and the score were provided to the &lt;code&gt;deep Q-network&lt;/code&gt; (DQN).  The agent learned appropriate actions to accurately play a game and operate competently without any specific adaptions to the source code or network hyper-parameters.  It simply needs training on a large number of game sequences to learn a new game.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could this technology feasibly be adapted to permit a machine learning agent to take competent &amp;amp; appropriate trading actions in the financial markets?&#xA;Just like playing Pong, but with the markets?  A high score would be quite agreeable!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have experience to articulate or advice on how this could be practically experimented upon?&lt;/p&gt;&#xA;" OwnerUserId="22655" LastEditorUserId="22655" LastEditDate="2016-07-22T07:04:25.977" LastActivityDate="2018-11-14T14:35:01.463" Title="Predict the financial markets in the fashion of a video game?" Tags="&lt;automated-trading&gt;&lt;machine-learning&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28209" PostTypeId="2" ParentId="27752" CreationDate="2016-07-21T19:50:33.973" Score="-1" Body="&lt;p&gt;Python can be used in QuantConnect and Quantopian (which connect to IB, Robinhood, and many other platforms).&lt;/p&gt;&#xA;" OwnerUserId="22267" LastActivityDate="2016-07-21T19:50:33.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28210" PostTypeId="2" ParentId="27479" CreationDate="2016-07-21T20:32:11.337" Score="0" Body="&lt;p&gt;For a few standard option types under Black-Scholes you can also cross-check your results using &lt;a href=&quot;http://www.acenumerics.com/option-pricer.html&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; free option pricing application. It does vanillas, barriers (continuous and discrete monitoring) and Asians (arithmetic, discrete sampling), all with European/Bermudan/American exercise. It has two separate engines,  PDE/Finite Differences and Monte Carlo, pseudo &amp;amp; quasi-random (Sobol).&#xA;It does a few things that QuantLib doesn't, like American Asian options. It allows very high grid resolutions for the FD engine and up to 1 billion MC replications, all very fast (one billion(10^9) MC samples in about 20 secs, or an arithmetic Asian on a 1000 x  1000 x 200 space-time FD grid in less than a sec). It can do benchmark-level accuracy, for example I get 8-9 correct digits for american vanillas, and also get extreme agreement between the FD and MC engines in many cases (up to 8 digits)&lt;/p&gt;&#xA;" OwnerUserId="19373" LastEditorUserId="19373" LastEditDate="2016-07-26T16:16:12.140" LastActivityDate="2016-07-26T16:16:12.140" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28211" PostTypeId="2" ParentId="28196" CreationDate="2016-07-21T22:37:58.680" Score="3" Body="&lt;p&gt;You don't need any assumption about the distributional properties of $S_t$. What matters for the FTAP is the drift only.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By definition, the risk neutral measure $Q$ is the measure, equivalent to the natural measure $P$ (*), under which the local rate of return (i.e. the instanteneous drift of the SDE of $S_t$ per unit of $S_t$) of &quot;any&quot; traded asset $S_t$ (but also the price of the derivative $g_t$) is $r$, the market risk-free rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equivalently, this consists in requiring that the price of any traded asset measured in unit of the fundamental reference unit of the value of the bank account (aka &lt;em&gt;numeraire&lt;/em&gt;) $B_t=e^{rt }$ ($B_0=1$) is a martingale:&#xA;$$&#xA;E^Q_0 \left[\frac{g_T}{B_T}\right] = \frac{g_0}{B_0}&#xA;$$&#xA;that is the price is, as you mentioned&#xA;$$&#xA;g_0=e^{-rT} E^Q_0 \left[g_T\right]&#xA;$$&#xA;and this holds for any traded asset, disregarding its nature (stock, commodity, index, derivative...).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This truly is an equivalence. Indeed, being $\mu$ the local rate of return of $g_t$ under $Q$:&#xA;$$&#xA;dg_t= \mu g_t dt + (\cdots) dW&#xA;$$&#xA;you have for $m_t=g_t/B_t$, by Ito's lemma:&#xA;$$&#xA;d m_t = [-r m_t + (\mu g_t) (1/B_t)] dt + (\cdots) dW&#xA;$$&#xA;which is a martingale (no drift condition) provided that $$\mu = r$$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see, the diffusion term plays no role in this context. Being the asset dynamics normal, lognormal or with stochastic volatility doesn't matter (**)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(*) the one in which you &quot;live&quot;, that is the one under which you require a risk premium, on the top of the risk free return $r$, for taking the risk of holding the risky asset $S_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(**) for your future reference: &lt;em&gt;the volatility doesn't change under change of measure&lt;/em&gt; (take a look at Chap 2 of Brigo-Mercurio on Interest rates derivatives). It's an advanced concept, maybe better start from the basis: Bjork &quot;Arbitrage theory in continuous time&quot; Chap 10.&lt;/p&gt;&#xA;" OwnerUserId="13528" LastEditorUserId="13528" LastEditDate="2016-07-21T22:46:20.727" LastActivityDate="2016-07-21T22:46:20.727" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28212" PostTypeId="2" ParentId="28157" CreationDate="2016-07-21T23:51:56.400" Score="1" Body="&lt;p&gt;If I have understood your question correctly, no adjustment is necessary if you are using log-returns. Returns of a stock in a differing numeraire is simply a sum of the currency spot process and the locally denominated process. Since you are trying to find the principal components, well, a linear term like this doesn't matter, since that variation will be captured by the components that capture the variation of the local currency (supposing that the relevant currency is one of the pairs you are considering! ).&lt;/p&gt;&#xA;" OwnerUserId="3559" LastActivityDate="2016-07-21T23:51:56.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28215" PostTypeId="2" ParentId="28208" CreationDate="2016-07-22T07:58:12.813" Score="4" Body="&lt;p&gt;This is an interesting question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would reformulate a little bit your question and try an attempt of answer of &lt;strong&gt;&lt;em&gt;why using neural networks is not a good idea for predicting market direction.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IMHO, one main reason would be that it is not possible to experiment a strategy without modifying the market behavior and thus it is impossible to repeat the same experiment again and again, which is a prerequisite of training.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make an analogy with the video-game machine learning, it is as if when you start the level again, the traps where you have lost have been replaced by new ones you never thought about it before.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I encourage other quant.stackexchange members to share their view on the subject.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastEditorUserId="20201" LastEditDate="2016-07-22T08:04:05.687" LastActivityDate="2016-07-22T08:04:05.687" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28216" PostTypeId="2" ParentId="28164" CreationDate="2016-07-22T09:32:15.493" Score="0" Body="&lt;p&gt;these instruments are quoted as: 100 - yield. Thus 99.25 would correspond to a yield of 0.75 (%).&lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2016-07-22T09:32:15.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28217" PostTypeId="1" CreationDate="2016-07-22T12:09:44.480" Score="1" ViewCount="1089" Body="&lt;p&gt;I'm adding a new factor to Fama-French three-factor model. I have constructed portfolios and got 18 three-way sorted portfolios. &#xA;Now, I think I have to do Macbeth procedure to test the model. I'm thinking of doing it on Eviews. I'm new to Eviews. If I get step by step guidance to the procedure, I would be great. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="22266" LastEditorUserId="13571" LastEditDate="2016-07-22T14:25:25.273" LastActivityDate="2016-07-22T14:25:25.273" Title="Fama-Macbeth regression in Eviews" Tags="&lt;regression&gt;&lt;asset-pricing&gt;&lt;fama-french&gt;&lt;eviews&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28218" PostTypeId="2" ParentId="28164" CreationDate="2016-07-22T12:46:32.433" Score="1" Body="&lt;p&gt;1) convert the futures prices into forward rates by using forward rate= 100- futures price.   You now have a chain of forward rates, starting with the rate from Sep 16 to Dec 16.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) you need a rate from today to Sep 16.  Use 2 month spot Libor&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) to calculate a zero coupon rate from today to any given date, chain together the relevant forward rates.  eg the rate to Mar 17 is calculated by chaining together (today to Sep16), (sep 16 to dec 16), (dec 16 to mar 17).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) discount factors can be calculated from zero coupon rates in the standard manner (reciprocal of one dollar invested in the zero coupon rate for the relevant period)&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-07-22T12:46:32.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28219" PostTypeId="2" ParentId="28217" CreationDate="2016-07-22T13:31:59.373" Score="1" Body="&lt;p&gt;There many add-ins you could add to your Eviews, see here: &lt;a href=&quot;http://www.eviews.com/Addins/addins.shtml&quot; rel=&quot;nofollow&quot;&gt;http://www.eviews.com/Addins/addins.shtml&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13571" LastActivityDate="2016-07-22T13:31:59.373" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28220" PostTypeId="2" ParentId="28111" CreationDate="2016-07-22T13:32:53.800" Score="0" Body="&lt;p&gt;You can dowload the following Excel file that implements the &lt;a href=&quot;http://breakingdownfinance.com/trading-strategies/forex-trading/triangular-arbitrage/&quot; rel=&quot;nofollow&quot;&gt;triangular arbitrage&lt;/a&gt;. Just replace the numbers and currencies with yours and the solution to check your outcome.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps :)&lt;/p&gt;&#xA;" OwnerUserId="13950" LastEditorUserId="24630" LastEditDate="2016-10-08T16:05:54.137" LastActivityDate="2016-10-08T16:05:54.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28222" PostTypeId="2" ParentId="25912" CreationDate="2016-07-22T23:50:03.760" Score="0" Body="&lt;p&gt;EMS users compensate providers, directly or indirectly (by direct payment or directed order flow), an average of $10,000 per month.Traders Magazine. &lt;a href=&quot;http://www.tradersmagazine.com/news/ems-move-from-front-office-and-into-the-cloud-woodbine-111642-1.html#Login&quot; rel=&quot;nofollow&quot;&gt;http://www.tradersmagazine.com/news/ems-move-from-front-office-and-into-the-cloud-woodbine-111642-1.html#Login&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="22673" LastActivityDate="2016-07-22T23:50:03.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28224" PostTypeId="5" CreationDate="2016-07-23T00:59:59.453" Score="0" Body="&lt;p&gt;EViews is a statistical package, used mainly for time-series oriented econometric analysis.&#xA;More information in: &lt;a href=&quot;http://www.eviews.com/home.html&quot; rel=&quot;nofollow&quot;&gt;http://www.eviews.com/home.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13571" LastEditorUserId="13571" LastEditDate="2016-07-23T01:49:41.683" LastActivityDate="2016-07-23T01:49:41.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28225" PostTypeId="4" CreationDate="2016-07-23T00:59:59.453" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2016-07-23T00:59:59.453" LastActivityDate="2016-07-23T00:59:59.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28226" PostTypeId="1" CreationDate="2016-07-23T01:32:10.230" Score="4" ViewCount="169" Body="&lt;p&gt;I've been trying to replicate the following &lt;a href=&quot;http://www.utstat.utoronto.ca/sjaimung/papers/VAR-FPCA.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;publication&lt;/a&gt;: CONSISTENT FUNCTIONAL PCA FOR FINANCIAL TIME-SERIES, Sebastian Jaimungal, Eddie K. H. Ng, 2007&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but I havent been able to get the same results estimating the $\beta_{k}$ parameters. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, I got the data from Bloomberg (CL Comdty contracts) from the period specified in the paper but I don't get how is the $\tau$ parameter specified. I using it as number of years to maturity but with the 70 contracts available in bbg seems like I won't fit the $\tau$ that appears in the publication's charts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, assuming I'm correct, when i fit the $\beta_{k}$ using MLS with the common formula ($\beta_{k} = (X^{T}X)^{-1}Xy)$ I get, for the first beta, a similar chart but with a different scale:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/cwcBa.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/cwcBa.jpg&quot; alt=&quot;betas&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess that the parameter calculation is correct, because when i plot the curve against the data it seems very close and the error is quite small, but cant get the same $ \beta_{k}$ scale:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/WmVMK.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/WmVMK.jpg&quot; alt=&quot;fit&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;could it be maybe that the betas are calibrated with the specifict tenors of $\phi$ function?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Libraries:&#xA;&#xA;        install.packages(&quot;vars&quot;)  #If not already installed&#xA;        install.packages(&quot;astsa&quot;) #If not already installed&#xA;        install.packages(&quot;fpca&quot;)  #If not already installed&#xA;        install.packages(&quot;matrixcalc&quot;,  repos=&quot;http://R-Forge.R-project.org&quot;)  #If not already installed&#xA;&#xA;    library(vars)&#xA;    library(astsa)&#xA;    library(&quot;XLConnect&quot;)&#xA;&#xA;    rm(list=ls())&#xA;    &quot;%^%&quot; &amp;lt;- function(S, power)&#xA;    { &#xA;       with(eigen(S), vectors %*% (values^power * t(vectors))) &#xA;    }&#xA;&#xA;    data &amp;lt;-readWorksheetFromFile(&quot;NYMEX.xlsx&quot;,sheet=1,startRow=1,endRow=1000,startCol=2,colTypes = 'numeric')&#xA;    tau &amp;lt;-readWorksheetFromFile(&quot;NYMEX.xlsx&quot;,sheet=2,startRow=1,endRow=1000,startCol=2,colTypes = 'numeric')&#xA;&#xA;#Parameters&#xA;&#xA;    # A_k parametros&#xA;    ak &amp;lt;- c(4,2,1,0.2)&#xA;    #Beta Matrix&#xA;    beta_hat &amp;lt;- matrix(data =NA, nrow = length(data[,1]), ncol = 5)&#xA;    # Matrix Price&#xA;    price_hat &amp;lt;- matrix(data = NA, nrow = length(data[,1]), ncol = length(data[1,]))&#xA;&#xA;#Beta&#xA;&#xA;for(i in 1:length(data[,1]))&#xA;{&#xA;#Clean from NA &#xA;    count = 0&#xA;    for(j in seq(1,length(data[1,]),by=2))&#xA;    {&#xA;        if( (is.na(data[i,j]) == FALSE) &amp;amp; (as.numeric(tau[i,j]) &amp;gt; 0))&#xA;        {&#xA;        count = count + 1 &#xA;        }&#xA;    }&#xA;&#xA;#Vectors Length&#xA;    tau_tmp &amp;lt;- c(1:count)*0&#xA;    price_tmp &amp;lt;- c(1:count)*0&#xA;&#xA;    count = 0&#xA;    for(j in seq(1,length(data[1,]),by=2))&#xA;    {&#xA;        if( (is.na(data[i,j]) == FALSE) &amp;amp; (as.numeric(tau[i,j]) &amp;gt; 0))&#xA;        {&#xA;        count = count +1&#xA;        tau_tmp[count] &amp;lt;- as.numeric(tau[i,j])/360 &#xA;        price_tmp[count] &amp;lt;- log(as.numeric(data[i,j]),base =exp(1))&#xA;        #price_tmp[count] &amp;lt;- as.numeric(data[i,j])&#xA;        }&#xA;    }&#xA;&#xA;#Phi Length&#xA;    phi_tmp &amp;lt;- matrix(nrow =5, ncol = length(tau_tmp))&#xA;    #price_tmp &amp;lt;- (price_tmp)/sd(price_tmp)&#xA;&#xA;#Phi Values&#xA;    phi_tmp[1,] &amp;lt;- 1&#xA;    for(j in 1:length(tau_tmp))&#xA;    {&#xA;        for (k  in 1: length(ak))&#xA;        {   &#xA;            phi_tmp[k+1,j] &amp;lt;- (1- exp(-ak[k]*tau_tmp[j]))/ak[k]&#xA;        }&#xA;&#xA;    }&#xA;#Beta (beta_hat = (x'*x)^-1*x'*y)&#xA;    A &amp;lt;- ginv(t(phi_tmp) %*% phi_tmp) %*% t(phi_tmp)&#xA;    beta_hat[i,] &amp;lt;- t(price_tmp%*%A)&#xA;&#xA;    for(j in 1:length(phi_tmp[1,]))&#xA;    {&#xA;        price_hat[i,j] &amp;lt;- sum(beta_hat[i,]*phi_tmp[,j])&#xA;    }&#xA;&#xA;    }&#xA;&#xA;#Plot beta&#xA;colnames(beta_hat) &amp;lt;- c(&quot;Beta1&quot;,&quot;Beta2&quot;,&quot;Beta3&quot;,&quot;Beta4&quot;,&quot;Beta5&quot;)&#xA;plot.ts(beta_hat,base = exp(1) , main = &quot;Betas&quot;, xlab = &quot;&quot;)&#xA;&#xA;#VAR(1)&#xA;fitvar2 = VAR(beta_hat, p=1, type=&quot;both&quot;)&#xA;&#xA;#Plot E&#xA;e_hat &amp;lt;- residuals(fitvar2)&#xA;A &amp;lt;- e_hat[,1]&#xA;#Lag E&#xA;B &amp;lt;- c(1:length(e_hat[,1]))&#xA;for (i in 1:length(e_hat[,1]))&#xA;{&#xA;    if (i == 1)&#xA;    {&#xA;        B[i] &amp;lt;- NA&#xA;    }&#xA;    if (i &amp;gt;1)&#xA;    {&#xA;        B[i] &amp;lt;- e_hat[i-1,1]&#xA;    }       &#xA;}&#xA;#Model against data&#xA;b &amp;lt;- 857&#xA;ph_plot &amp;lt;- na.omit(price_hat[b,])&#xA;pr_plot &amp;lt;- na.omit(log(as.numeric(data[b,]),base=exp(1)))&#xA;tau_plot &amp;lt;- na.omit(as.numeric(tau[b,])/360)&#xA;plot(ph_plot,col='red')&#xA;lines(pr_plot,col='blue')&#xA;&#xA;#FPCA&#xA;R &amp;lt;- 0.05&#xA;space &amp;lt;- 0.05&#xA;#Parameters&#xA;phi_tmp &amp;lt;- matrix(data = 0, nrow =5, ncol = length(seq(R,7, by=space)))&#xA;N= length(e_hat[,1])&#xA;mat = seq(R,7, by=space)&#xA;    phi_tmp[1,] &amp;lt;- 1&#xA;    for(j in 1:length(seq(R,7, by=space)))&#xA;    {&#xA;        for (k  in 1: length(ak))&#xA;        {   &#xA;            phi_tmp[k+1,j] &amp;lt;- (1- exp(-ak[k]*mat[j]))/ak[k]&#xA;            #phi_tmp[k+1,j] &amp;lt;- (1- exp(-ak[k]*j))/ak[k]&#xA;&#xA;        }&#xA;    }&#xA;&#xA;W = phi_tmp %*% t(phi_tmp)&#xA;uk = eigen((1/N)*(W %^% 0.5) %*% t(e_hat) %*% e_hat %*% (W %^% 0.5))&#xA;z &amp;lt;- (W %^% -0.5) %*% uk$vectors&#xA;&#xA;epsilon &amp;lt;- matrix( data = 0, nrow = 5, ncol = length(phi_tmp[1,]))&#xA;&#xA;for (i in 1:length(phi_tmp[1,]))&#xA;{&#xA;    epsilon[,i] = t(z) %*% phi_tmp[,i]&#xA;}&#xA;&#xA;plot(mat,epsilon[1,], ylim = c(-1,1))&#xA;lines(mat,epsilon[2,])&#xA;lines(mat,epsilon[3,])&#xA;&#xA;print(uk$values/sum(uk$values))&#xA;yt = ginv(z) %*% t(beta_hat)&#xA;plot.ts(t(yt))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="20751" LastEditorUserId="16160" LastEditDate="2017-04-16T17:49:18.490" LastActivityDate="2017-04-16T17:49:18.490" Title="VAR FPCA analysis paper replication" Tags="&lt;programming&gt;&lt;regression&gt;&lt;var&gt;&lt;forward&gt;&lt;pca&gt;" AnswerCount="0" CommentCount="7" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28227" PostTypeId="1" AcceptedAnswerId="28253" CreationDate="2016-07-23T03:09:21.647" Score="2" ViewCount="138" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/JQ6rG.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/JQ6rG.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;Can someone explain what this large negative spike in this stock chart is in after-hours trading?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It almost looks like a data glitch to me, since the value before and after the spike are almost exactly the same, but I'm wondering if it's something more significant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I occasionally see strange anomalies like this when I check a stock and it seems strange.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT 1&lt;/strong&gt;&lt;br&gt;&#xA;Other sources:&lt;br&gt;&#xA;ETradeBank:&lt;br&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/bcpVn.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/bcpVn.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;br&gt;&#xA;Also in this &lt;a href=&quot;http://www.nasdaq.com/symbol/tsla/after-hours&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;here&quot;&gt;table here&lt;/a&gt; from NASDAQ.  That page is updated dynamically, so here is a screenshot of the current data:  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/4r83l.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/4r83l.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it's a data glitch, it must be in the primary data source that everyone else relies on.&lt;/p&gt;&#xA;" OwnerUserId="22675" LastEditorUserId="22675" LastEditDate="2016-07-23T20:34:09.663" LastActivityDate="2016-07-24T20:57:11.173" Title="Move along, nothing to see here...just a super cheap stock price for an instant?" Tags="&lt;equities&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28228" PostTypeId="2" ParentId="25057" CreationDate="2016-07-23T11:43:00.067" Score="3" Body="&lt;p&gt;Well, this seems to be a popular account of these concepts but on a very high level the connection is the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Ricci flow &quot;is a process that deforms the metric of a Riemannian manifold in a way formally analogous to the diffusion of heat, smoothing out irregularities in the metric.&quot;&lt;a href=&quot;https://en.wikipedia.org/wiki/Ricci_flow&quot; rel=&quot;nofollow noreferrer&quot;&gt; [Wikipedia]&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/rieNG.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/rieNG.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the Black-Scholes equation is mathematically based on &lt;a href=&quot;https://en.wikipedia.org/wiki/Geometric_Brownian_motion&quot; rel=&quot;nofollow noreferrer&quot;&gt;Geometric Brownian motion&lt;/a&gt; which describes the diffusion of the probability distribution of an underlying's price paths.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/2KNFG.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/2KNFG.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;[&lt;a href=&quot;http://marcoagd.usuarios.rdc.puc-rio.br/stochast.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Source&lt;/a&gt;]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The connection between Black-Scholes and diffusion becomes especially clear when you have a look at how Black-Scholes' differential equation is solved by transforming it to the diffusion equation, see also this question and answers therein:&lt;br&gt; &lt;a href=&quot;https://quant.stackexchange.com/questions/84/transformation-from-the-black-scholes-differential-equation-to-the-diffusion-equ&quot;&gt;Transformation from the Black-Scholes differential equation to the diffusion equation - and back&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So both, Ricci flow and Black-Scholes, are (based on) mathematical descriptions of diffusion models. I don't think that there is really anything more to it than this.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-07-23T11:43:00.067" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28229" PostTypeId="1" CreationDate="2016-07-23T12:42:44.177" Score="2" ViewCount="146" Body="&lt;p&gt;I need to store OHLC data from the Forex Market.  I live in the UK which is presently in British Summer Time +1.  The Forex Market EST, which is normally -5 from GMT.  I'm not sure how Eastern Daylight time Affects things.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to store the data in a format that is consistent across timezones etc and also to know when the daily trading session starts and ends.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This has got me totally confused: &lt;a href=&quot;http://www.forex-market-hours.net/&quot; rel=&quot;nofollow&quot;&gt;http://www.forex-market-hours.net/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's a two hour difference between the EST times for summer and winter and a one hour difference between the GMT times...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone explain how I can store the data in a time-zone independent format and work out the session start time?&lt;/p&gt;&#xA;" OwnerUserId="22679" LastActivityDate="2016-07-25T21:12:32.983" Title="Forex Market Timezones" Tags="&lt;fx&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28230" PostTypeId="1" CreationDate="2016-07-23T13:25:24.497" Score="0" ViewCount="8723" Body="&lt;p&gt;Is there any way to convert quarterly data to monthly in excel or preferably in STATA?&#xA;I &#xA;Next to that, how can I transform dates in excel so as to be recognized by STATA?&lt;/p&gt;&#xA;" OwnerUserId="19623" LastActivityDate="2016-07-23T14:51:11.993" Title="how to convert quarterly data to monthly" Tags="&lt;econometrics&gt;&lt;excel&gt;&lt;software&gt;&lt;monthly&gt;&lt;date&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28231" PostTypeId="2" ParentId="28230" CreationDate="2016-07-23T14:51:11.993" Score="1" Body="&lt;p&gt;You can use Cubic Splines to convert quarterly data into monthly. See also the following:&#xA;&lt;a href=&quot;https://columbiaeconomics.com/2010/01/20/how-economists-convert-quarterly-data-into-monthly-cubic-spline-interpolation/&quot; rel=&quot;nofollow&quot;&gt;https://columbiaeconomics.com/2010/01/20/how-economists-convert-quarterly-data-into-monthly-cubic-spline-interpolation/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: Take a look at the following link too:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://answers.microsoft.com/en-us/office/forum/office_2010-excel/cubic-splines-in-excel-2010/0033ceae-6c6f-e011-8dfc-68b599b31bf5?auth=1&quot; rel=&quot;nofollow&quot;&gt;http://answers.microsoft.com/en-us/office/forum/office_2010-excel/cubic-splines-in-excel-2010/0033ceae-6c6f-e011-8dfc-68b599b31bf5?auth=1&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12214" LastActivityDate="2016-07-23T14:51:11.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28233" PostTypeId="1" AcceptedAnswerId="40668" CreationDate="2016-07-23T15:14:21.563" Score="5" ViewCount="4051" Body="&lt;p&gt;I cannot quite understood absolutely why a barbell portfolio has higher convexity than a bullet porfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/btL01.gif&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/btL01.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can easily understand how the parallel line represents duration but I cannot see what the curve of the convexity would look like. My guess is that this curve would start very high and then decrease to zero. If so this would explain why a barbell portfolio has a higher convexity than a bullet portfolio purely due to buying the very high yielding bond. I am also not sure whether this solution would be stable as the original bond price-yield curve may move causing changes in the mathematical derivatives.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover I cannot see how convexity could be pictured using the yield curve, ie on the graph below, which I believe may be key to fully understanding convexity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/oDPRr.gif&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/oDPRr.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please assume normal market conditions and &quot;normal&quot; bond curves, ie positive convexity (at least primarily).&lt;/p&gt;&#xA;" OwnerUserId="11723" LastEditorUserId="11723" LastEditDate="2016-07-24T10:25:40.033" LastActivityDate="2018-07-08T00:21:09.677" Title="Why does a barbell portfolio have higher convexity than a bullet porfolio" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;yield-curve&gt;&lt;convexity&gt;&lt;bond-portfolio&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28234" PostTypeId="2" ParentId="28200" CreationDate="2016-07-23T15:34:26.887" Score="3" Body="&lt;p&gt;Page 3 of this document ad-co.com/analytics_docs/ALevin_QP_2012.pdf shows the result, originally given in Risk Magazine by Blyth and Uglum.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The intuition for the formula is given in my comment above.  The original motivation for such a formula was for interest rate options in the 1990s.  Everyone had a lognormal pricing model, but traders understood that the distribution of interest rates may be closer to normal.  Hence we needed a formula to plug in the right lognormal vol into our models.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-07-23T15:34:26.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28235" PostTypeId="1" CreationDate="2016-07-23T18:49:40.627" Score="0" ViewCount="1285" Body="&lt;p&gt;I am looking at using the swaption method to calculate the EPE and ENE on a swap over its life, to use in CVA/DVA calculations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a number of questions, how well does this method work in comparison to IR simulations? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly, how exactly does one implement this method? In particular, how does on treat the payment that has already fixed? &lt;/p&gt;&#xA;" OwnerUserId="22581" LastActivityDate="2016-07-28T14:19:15.463" Title="Swaptions to calculate swap exposure for CVA" Tags="&lt;swaps&gt;&lt;swaption&gt;&lt;cva&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28236" PostTypeId="1" CreationDate="2016-07-23T19:26:06.433" Score="0" ViewCount="191" Body="&lt;p&gt;Why should one calculate the theoretical price of bond if there is already a market quote ? &lt;/p&gt;&#xA;" OwnerUserId="22604" LastActivityDate="2016-07-25T15:11:49.687" Title="Theoretical price of bond : utility" Tags="&lt;bond&gt;&lt;valuation&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2016-07-26T11:15:01.873" ContentLicense="CC BY-SA 3.0" />
  <row Id="28237" PostTypeId="2" ParentId="28227" CreationDate="2016-07-23T20:46:45.967" Score="0" Body="&lt;p&gt;I tried &lt;a href=&quot;http://finance.yahoo.com/chart/TSLA&quot; rel=&quot;nofollow&quot;&gt;yahoo finance&lt;/a&gt; as well. The &quot;glitch&quot; appears there too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However all these sources get their data from the same place, the consolidated ticker.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My guess is that this is just bad data, given the fact that it's out of hours, and like you say the price almost immediately corrects to exactly the level before. It might be that the mid price being reported is (say) the average of the bid and ask, and at this time the bid side disappears for a short while.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Btw, when there is a proper &quot;fat finger&quot; error the price will move a bit more gradually back to fair-ish value often with a few trades at levels on the way down/up.&lt;/p&gt;&#xA;" OwnerUserId="12020" LastActivityDate="2016-07-23T20:46:45.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28238" PostTypeId="1" AcceptedAnswerId="28240" CreationDate="2016-07-23T22:29:58.547" Score="2" ViewCount="242" Body="&lt;p&gt;Talking with some traders the other day, I found out that they were using a pricing model based on a mix between a geometric brownian motion and an arithmetic brownian motion to price certain derivatives.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would anyone know if this is actually a well known model? Or is this actually one of these &quot;secret&quot; solutions that certain quant teams develop?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Practitioners' take on the matter would be particularly helpful.&lt;/p&gt;&#xA;" OwnerUserId="13458" LastActivityDate="2016-07-23T23:49:37.080" Title="Mix of Arithmetic and Geometric Brownian Motion" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;pricing&gt;&lt;models&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28240" PostTypeId="2" ParentId="28238" CreationDate="2016-07-23T23:49:37.080" Score="0" Body="&lt;p&gt;Are you talking about something like this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dx(t)=\ldots\ dt+[x(t)]^\gamma\ dW(t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $\gamma$ is zero then you've got BM, if it's one you get GBM, inbetween you have a 'mix'.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-07-23T23:49:37.080" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28241" PostTypeId="1" AcceptedAnswerId="28250" CreationDate="2016-07-24T00:57:07.707" Score="1" ViewCount="532" Body="&lt;p&gt;As stated, this is an interview question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given Brownian motion $B_t,B_s$ and $t&amp;gt;s$, how to calculate $P(B_t&amp;gt;0,B_s&amp;lt;0)$?&lt;/p&gt;&#xA;" OwnerUserId="18045" LastEditorUserId="18045" LastEditDate="2016-07-24T18:49:16.837" LastActivityDate="2017-10-27T14:27:34.170" Title="Given Brownian motion $B_t,B_s$ and $t&gt;s$, how to calculate $P(B_t&gt;0,B_s&lt;0)$?" Tags="&lt;probability&gt;&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28243" PostTypeId="2" ParentId="15644" CreationDate="2016-07-24T08:19:58.753" Score="2" Body="&lt;p&gt;You have to use T=1...10 because last payment is discounted to year 10. So your short rate lattice is incomplete.&lt;/p&gt;&#xA;" OwnerUserId="4726" LastActivityDate="2016-07-24T08:19:58.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28244" PostTypeId="1" CreationDate="2016-07-24T10:12:35.587" Score="9" ViewCount="7428" Body="&lt;p&gt;What is best API to lookup ISINs by number or name?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, ideally I would like to have an rest-api like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;http://api.isinlookup.org/filter={&quot;isin&quot;:&quot;US38259P5089&quot;} -&amp;gt;&#xA;[&#xA;  {&#xA;    &quot;isin&quot;: &quot;US38259P5089&quot;&#xA;    &quot;name&quot;: &quot;Google Inc.&quot;,&#xA;    &quot;type&quot;: &quot;Equity&quot;&#xA;  }&#xA;]&#xA;&#xA;http://api.isinlookup.org/filter={&quot;name&quot;:&quot;Google&quot;} -&amp;gt;&#xA;[&#xA;  {&#xA;    &quot;isin&quot;: &quot;US38259P5089&quot;&#xA;    &quot;name&quot;: &quot;Google Inc.&quot;,&#xA;    &quot;type&quot;: &quot;Equity&quot;&#xA;  },&#xA;  ...&#xA;]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="22685" LastActivityDate="2018-03-22T14:01:20.243" Title="Rest API to retrieve ISIN" Tags="&lt;programming&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28245" PostTypeId="2" ParentId="15916" CreationDate="2016-07-24T10:41:35.690" Score="2" Body="&lt;p&gt;The risk-free rate used in the valuation of options must be the rate at which banks fund the cash needed to create a dynamic hedging portfolio that will replicate the final payoff at expiry. Dealers borrow and lend at a rate close to LIBOR, which is the funding rate for large commercial banks. The LIBOR swap curve is therefore the rate to be used when pricing options. It is therefore quite wrong to use a Government bond yield curve.&lt;/p&gt;&#xA;" OwnerUserId="12240" LastActivityDate="2016-07-24T10:41:35.690" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28246" PostTypeId="2" ParentId="28244" CreationDate="2016-07-24T10:46:58.657" Score="11" Body="&lt;p&gt;Try &lt;a href=&quot;https://openfigi.com/api&quot; rel=&quot;noreferrer&quot;&gt;OpenFIGI&lt;/a&gt; (formerly the Bloomberg Global Identifier - BBGID)&lt;/p&gt;&#xA;" OwnerUserId="16351" LastActivityDate="2016-07-24T10:46:58.657" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28247" PostTypeId="2" ParentId="25616" CreationDate="2016-07-24T10:54:54.813" Score="0" Body="&lt;p&gt;For the value of the bond it can not matter what your domestic currency is. Thats why your first approach is correct. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If no market price is available you can value the bond usind DCF with JPY interest rates (plus spread), because it pays interest in JPY. If you convert this JPY Cashflows later in USD that is your private fun, and is not a feature of the bond. Imagine for every expected JPY Cashflow you make a forward FX contract to convert it to USD, than you can value the Bond and the forward contracts separatly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A price you have determined that way is the price you can sell the bond for (theoretically). The money from the sales you would convert then with the spot rate.&lt;/p&gt;&#xA;" OwnerUserId="22686" LastActivityDate="2016-07-24T10:54:54.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28250" PostTypeId="2" ParentId="28241" CreationDate="2016-07-24T16:52:43.057" Score="4" Body="&lt;p&gt;Set $X_t=B_t-B_s$ and $Y_t=-B_t$.  $X_t\sim N(0,t-s)$ and $X_t$ , $Y_s$ are independent.&#xA;$$I=P(B_t&amp;gt;0, B_s&amp;lt;0)=P(B_t-B_s&amp;gt;-B_s\,,\, -B_s&amp;gt;0)=P(X_t&amp;gt;Y_s\,, Y_s&amp;gt;0)$$ &#xA;$$I=\frac{1}{2\pi\sqrt{s(t-s)}}\int_{0}^{\infty}\int_{y}^{\infty}\exp\left(-\frac{y^2}{2s}-\frac{x^2}{2(t-s)}\right)dxdy$$ &#xA;Set $$y={\sqrt{s}}\,\,r\sin \theta$$&#xA;$$\quad x={\sqrt{t-s}}\,\,r\cos \theta$$&#xA;we have&#xA;$$dx\,dy=\sqrt{s(t-s)}\,r \,dr d\theta$$&#xA; $y&amp;gt;0$ and $x&amp;gt;y$&#xA;in other words&#xA;$${\sqrt{s}}\,\,r\sin \theta&amp;lt;{\sqrt{t-s}}\,\,r\cos \theta$$&#xA;i.e&#xA;$$\tan \theta &amp;lt;\sqrt{\frac{t-s}{s}}$$&#xA;or &#xA;$$\theta&amp;lt;{\tan^{-1}\left({\sqrt{\frac{t-s}{s}}}\right)}=\cos^{-1}{\left({\sqrt{\frac{s}{t}}}\right)}$$&#xA;therefore&#xA;$$I=\frac{1}{2\pi}\int_{0}^{{\cos^{-1}{\left({\sqrt{\frac{s}{t}}}\right)}}}\int_0^{\infty}r\exp\left(-\frac{r^2}{2}\right)drd\theta$$ &#xA;$$I=\frac{1}{2\pi}\int_{0}^{{\cos^{-1}{\left({\sqrt{\frac{s}{t}}}\right)}}}-\exp\left(-\frac{r^2}{2}\right)\Big{|}_{0}^{\infty}d\theta$$ &#xA;$$I=\frac{1}{2\pi}\int_{0}^{{\cos^{-1}{\left({\sqrt{\frac{s}{t}}}\right)}}}d\theta=\frac{1}{2\pi}\cos^{-1}\left(\sqrt{\frac{s}{t}}\right)$$ &lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-07-26T11:32:45.087" LastActivityDate="2016-07-26T11:32:45.087" CommentCount="19" ContentLicense="CC BY-SA 3.0" />
  <row Id="28251" PostTypeId="1" AcceptedAnswerId="28262" CreationDate="2016-07-24T18:05:34.447" Score="0" ViewCount="120" Body="&lt;p&gt;In Steven Shreve's book &quot;Stochastic Calculus for Finance 2&quot;, page 126, a simple process $\Delta(t)$ is a stochastic process such that there is a partition of time $0 &amp;lt; t_1 &amp;lt; ... &amp;lt; t_n \leq T$, such that $\Delta(t)$ is a constant for $t_i \leq t &amp;lt; t_{i+1}$. However it is not clear whether this partition of time depends on $\omega\in \Omega$. Does anyone know the answer? Thanks. &lt;/p&gt;&#xA;" OwnerUserId="22690" LastEditorUserId="22690" LastEditDate="2016-07-24T18:26:57.433" LastActivityDate="2016-07-25T16:00:28.907" Title="Does the partition of time in a simple process depend on the omega in probability space?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28252" PostTypeId="1" CreationDate="2016-07-24T18:58:41.747" Score="0" ViewCount="174" Body="&lt;p&gt;I am working on time value of option, and especially with dividend, and I have the following questions. &#xA;First if the consider the Black Scholes models with no dividends and free interest rate $r = 0$&#xA;If the write the call price :&#xA;$$\operatorname{Call Price }= \operatorname{Intrinsic value + Time value}.$$&#xA;Where intrinsic $$\operatorname{value} = \max( S_t - K,0)$$ then using the call-put parity.&#xA;It can be shown that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\operatorname{Time Value of Call} = \operatorname{Time Value of Put}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However when we have continuous dividend or free interest rate I don't manage to get the following identity. Or at least I manage to get it for the Forward $F_{t,T} = S_t e^{(r-q)(T-t)}$.&#xA;As $$\frac{dS_t}{S_t} = (r-q)dt + \sigma dW_t \rightarrow \frac{dF_{t,T}}{F_{t,T}} = \sigma dW_t .$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the call put parity but for the future can be rewrite :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$F_{t,T} - K = \operatorname{Call}(F_{t,T},K,\sigma,T,t) - \operatorname{Put}(F_{t,T},K,\sigma,T,t)$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$F_{t,T} - K = F_{t,T} - K +\operatorname{ Time Value Call Forward} - \operatorname{Time Value Put Forward}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\operatorname{Time Value call forward} = \operatorname{Time Value Put forward}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I am missing something or we do not have the relation Intrinsic Value of Call = Intrinsic Value of Put when the free interest rate and the the continuous dividend yield are not equal to 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I may have another question on when to exercise call option but I still need to think about it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In advance thank you very much.&lt;/p&gt;&#xA;" OwnerUserId="18616" LastEditorDisplayName="user16651" LastEditDate="2016-07-24T21:03:56.183" LastActivityDate="2016-07-25T12:32:00.797" Title="Time Value of Option" Tags="&lt;options&gt;&lt;option-strategies&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28253" PostTypeId="2" ParentId="28227" CreationDate="2016-07-24T20:57:11.173" Score="3" Body="&lt;p&gt;here's a print out from Bloomberg.  The trade is only 250 shares and is flagged &quot;AP&quot;  Also, the exchange is &quot;D&quot;, which is the ADF.  That means &quot;Average Price Trade&quot; reported on the ADF.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In English this means that this trade was tied to something else.  Maybe someone had a small mistake that they had to correct for when pricing a larger chuck on TSLA options vs stock.  This would just be a bit to clean it up.  Also, notice the price.  The fractional price is one that cannot be posted to an exchange.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/6ko4O.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/6ko4O.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20092" LastActivityDate="2016-07-24T20:57:11.173" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28254" PostTypeId="1" AcceptedAnswerId="28270" CreationDate="2016-07-24T22:20:14.277" Score="2" ViewCount="555" Body="&lt;p&gt;Let's say that I have a calibrated SABR model in FX market (eg for Eurodollar options). So I have estimated values of beta, rho, alpha, and vol of vol. How do I map the calibration in a (strike, vol)-graph. How mathematically challenging would that process be?&lt;/p&gt;&#xA;" OwnerUserId="18555" LastEditorUserId="18555" LastEditDate="2016-07-25T16:09:01.910" LastActivityDate="2016-07-25T16:47:36.987" Title="SABR model: from calibration to mapping the smile/skew in a graph" Tags="&lt;fx&gt;&lt;stochastic-volatility&gt;&lt;volatility-smile&gt;&lt;skewness&gt;&lt;sabr&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28255" PostTypeId="2" ParentId="26258" CreationDate="2016-07-24T22:30:31.080" Score="5" Body="&lt;p&gt;I recenlty worked on a similar problem and solved it with the help of  Quantlib library.&#xA;Assuming you are working with EUR and USD:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;get cross currency (xccy) swap data EUR / USD. You want to know how&#xA;the xccy is collateralized and if Mark-to-Market resets apply to the&#xA;USD leg.&lt;/li&gt;&#xA;&lt;li&gt;get interest rates swaps fixed vs ois / 3m / 6m in EUR and USD&lt;/li&gt;&#xA;&lt;li&gt;build USD/FedFunds and EUR/Eonia models in Quantlib&lt;/li&gt;&#xA;&lt;li&gt;[here is the difficult part] boostrap a discounting curve for EUR cashflows under USD/Fedfund collateral (this is not implemented in&#xA;Quantlib) [*]&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Now you have a model that allows you to solve your problem, i.e. price any kind of cross currency swap between EUR and USD&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[*] assuming that the swap you want to price is under USD/FedFunds collateralization&lt;/p&gt;&#xA;" OwnerUserId="22691" LastEditorUserId="22691" LastEditDate="2016-07-27T15:18:20.720" LastActivityDate="2016-07-27T15:18:20.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28256" PostTypeId="1" CreationDate="2016-07-25T05:26:14.777" Score="0" ViewCount="61" Body="&lt;p&gt;I am trying to compute treasury yields (with different data) similar to what has been done by &lt;a href=&quot;http://www.bloomberg.com/markets/rates-bonds/government-bonds/us&quot; rel=&quot;nofollow&quot;&gt;bloomberg&lt;/a&gt;, &lt;a href=&quot;http://finance.yahoo.com/bonds&quot; rel=&quot;nofollow&quot;&gt;yahoo finance&lt;/a&gt;, &lt;a href=&quot;http://www.msn.com/en-us/money/markets&quot; rel=&quot;nofollow&quot;&gt;msn money&lt;/a&gt;, and &lt;a href=&quot;http://quotes.wsj.com/bond/BX/TMUBMUSD06M?mod=DNH_S&quot; rel=&quot;nofollow&quot;&gt;wall street&lt;/a&gt;.  I find the data reported by these are not the same and also do not match with that of &lt;a href=&quot;https://www.treasury.gov/resource-center/data-chart-center/interest-rates/Pages/TextView.aspx?data=yield&quot; rel=&quot;nofollow&quot;&gt;US treasury&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please let me know how should I proceed (academic articles reference is also welcomed). &lt;/p&gt;&#xA;" OwnerUserId="22693" LastActivityDate="2016-07-25T15:36:10.147" Title="How to compute treasury yields as reported in the online financial newspapers?" Tags="&lt;yield-curve&gt;&lt;bond-yields&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28257" PostTypeId="1" AcceptedAnswerId="28264" CreationDate="2016-07-25T07:59:27.553" Score="1" ViewCount="136" Body="&lt;p&gt;At the moment I'm comparing plots between the implicit numerical Black-Scholes PDE and the Monte-Carlo Method for the Black-Scholes equation. However, for the particular boundary condition I'm using I'm having a bit of difficulty finding the error in the code, so I thought I should post it here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm currently using an initial condition for the 'option' at time $T$ maturity to be $-\frac{2}{\pi}\tan^{-1}\left(\frac{1}{  \tan((S_{t}\pi) / 2)}\right)$ where $S_{T}$ is the spot price. (This equation is for the sawtooth wave as given here: &lt;a href=&quot;https://en.wikipedia.org/wiki/Sawtooth_wave&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Sawtooth_wave&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, the other boundary condition as $S_{t} \rightarrow \infty$ is $0$ (I know this is not a good boundary condition but it's enough for what I need). Anyway, the issue I'm having is that when I use the above initial condition in both the PDE and Monte Carlo programs they both generate different plots, which is an issue I don't have when when I use other trigonometric functions (such as $\sin(S_{t}/5) $etc.). The parameters are exactly the same, and I've taken it over a sufficiently large interval ($0$ to $400$), so I'm unsure what the problem could be. If it's not too much trouble, could someone try using these boundary conditions in their program to check how it should look?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I forgot to include the parameters I had for the programs - I took Maturity time $T$ to be equal to $1$, interest rate equal to $0$, volatility equal to $0.25$ and spot price ranging from $0$ to $400$. The PDE is an implicit numerical scheme, and there are 1600 grid points in space and 2000 in time. The Monte-Carlo simulation was run 50000 at each grid point (the MC also has 1600 space grid points). In addition, the payoff is $-\frac{2}{\pi}\tan^{-1}\left(\frac{1}{  \tan((S_{t}\pi) / 2)}\right)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've attached a picture below of how the plots look:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/u1j49.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/u1j49.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Domain from 0 to 10:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/GebHi.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/GebHi.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="20543" LastEditorUserId="20543" LastEditDate="2016-07-25T21:58:44.130" LastActivityDate="2016-07-25T21:58:44.130" Title="Can someone check this boundary condition for me?" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;monte-carlo&gt;&lt;finance-mathematics&gt;&lt;black-scholes-pde&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28259" PostTypeId="1" AcceptedAnswerId="28276" CreationDate="2016-07-25T12:01:59.103" Score="2" ViewCount="475" Body="&lt;p&gt;Would anyone know what does it mean to value an asset in &quot;forward space&quot; versus &quot;zero space&quot; ?&#xA;where does one start from when trying to dig into the meaning of this? &#xA;Thanks in advance. &lt;/p&gt;&#xA;" OwnerUserId="22695" LastActivityDate="2016-07-26T09:07:52.147" Title="forward space vs zero space in finance jargon" Tags="&lt;interest-rate-swap&gt;&lt;forward-rate&gt;&lt;bootstrapping&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28260" PostTypeId="2" ParentId="28252" CreationDate="2016-07-25T12:32:00.797" Score="1" Body="&lt;p&gt;Call put parity is :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C(T,K) - P(T,K) = ( F_{t,T} - K ) B(t,T)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and with your notation :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C(T,K) - P(T,K) = ( F_{t,T} - K ) + \text{TimeValueCall}(T,K) - \text{TimeValuePut}(T,K)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reference:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Put%E2%80%93call_parity&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Put%E2%80%93call_parity&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-07-25T12:32:00.797" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28262" PostTypeId="2" ParentId="28251" CreationDate="2016-07-25T12:42:11.543" Score="2" Body="&lt;p&gt;I try to be precise. &lt;em&gt;&lt;strong&gt;There is no dependence in &lt;span class=&quot;math-container&quot;&gt;$\omega$&lt;/span&gt; for the &lt;span class=&quot;math-container&quot;&gt;$t_i$&lt;/span&gt; sequence.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h3&gt;simple process&lt;/h3&gt;&#xA;&lt;p&gt;Let &lt;span class=&quot;math-container&quot;&gt;$t_0&amp;lt;t_1&amp;lt;\dots&amp;lt;t_n&amp;lt;t_{n+1}$&lt;/span&gt; be a increasing sequence of real-numbers then &lt;span class=&quot;math-container&quot;&gt;$f$&lt;/span&gt; is said to be a simple process on a filtered space &lt;span class=&quot;math-container&quot;&gt;$(\Omega,\mathcal{F})$&lt;/span&gt; if:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$f(t,\omega) = \sum_{i\geq 0}\mathbb{1}_{t\in[t_i,t_{i+1})}\xi_i(\omega)\text{ where }\xi_i\text{ is }\mathcal{F}_{t_i}\text{-measurable}$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Here is an example where you can find this definition and how it is useful to build stochastic integrals:&#xA;&lt;a href=&quot;http://www.math.uchicago.edu/%7Emay/VIGRE/VIGRE2008/REUPapers/Olson.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.math.uchicago.edu/~may/VIGRE/VIGRE2008/REUPapers/Olson.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h3&gt;simple function&lt;/h3&gt;&#xA;&lt;p&gt;if you talk about simple functions, then you will have:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$f(t,\omega)=\sum_{k\geq 0}a_k \mathbb{1}_{A_k}$$&lt;/span&gt; where &lt;span class=&quot;math-container&quot;&gt;$A_k$&lt;/span&gt; is a borel set of &lt;span class=&quot;math-container&quot;&gt;$(\mathbb{R}_+\times \Omega,\text{Bor}(\mathbb{R}_+)\times\mathcal{F})$&lt;/span&gt; but then it is not anymore a process with the notion of adaptability, it is just a random variable.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-07-25T16:00:28.907" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28264" PostTypeId="2" ParentId="28257" CreationDate="2016-07-25T13:59:20.397" Score="2" Body="&lt;p&gt;Judging from the oscillations near $S=0$, it looks like the payoff function is causing these problems. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your payoff should go towards -1 as $S$ goes towards zero, but your computer  might just evaluate it at $S=0$, producing nonsense as a result. Depending on the exact implementation, this will then spread through the neighborhood of that point, causing these ripples.&lt;/p&gt;&#xA;" OwnerUserId="22697" LastActivityDate="2016-07-25T13:59:20.397" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28266" PostTypeId="2" ParentId="28256" CreationDate="2016-07-25T14:31:33.687" Score="1" Body="&lt;p&gt;By virtue of being OTC instruments, you'll get different yields from different sources. At the very same point of time, Goldman and JPM might quote slightly different yields (although the difference is virtually nonexistent for hot-run Treasuries). The biggest differences in this case are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Timing: US Treasury computes their yields using bid-side prices at around 3:30pm EST, while financial media usually reports the last traded yield (as of 5pm).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Methodology: Financial media reports the yields of on-the-run issues, while the US Treasury reports hypothetical, constant maturity par yields calculated using a cubic spline model.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2016-07-25T14:31:33.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28267" PostTypeId="2" ParentId="28236" CreationDate="2016-07-25T15:11:49.687" Score="1" Body="&lt;p&gt;There might be a lot of reasons to do so, for example if you want to calculate a sensitivity of the bond price on yieldcurve movements or other input factors. &#xA;Always if you want to learn something about the factors that influence the price you need a model how to calculate the price from these factors. &#xA;Even the difference between the theoretical price and the market price has an interpretation. Its the idiosyncratic component which is often linked to the idiosyncratic credit risk of the issuer.&lt;/p&gt;&#xA;" OwnerUserId="22686" LastActivityDate="2016-07-25T15:11:49.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28268" PostTypeId="2" ParentId="28256" CreationDate="2016-07-25T15:11:56.200" Score="2" Body="&lt;p&gt;There are standard software packages for yield calculations according to &quot;Street&quot; conventions. One is FICALC, endorsed by SIFMA:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.tipsinc.com/ficalc/calc.tips&quot; rel=&quot;nofollow&quot;&gt;http://www.tipsinc.com/ficalc/calc.tips&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is probably hte closest you can get to an industry standard, and is widely used by itself or to check the correctness of other software.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-07-25T15:36:10.147" LastActivityDate="2016-07-25T15:36:10.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28269" PostTypeId="1" CreationDate="2016-07-25T16:05:45.430" Score="0" ViewCount="91" Body="&lt;p&gt;I wonder how post crisis multiple curve approach influences the ir parity theorem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$${\displaystyle (1+i_{\$})={\frac {E_{t}S_{t+k}}{S_{t}}}(1+i_{c})}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say that $i_\$$ is USD Libor 3m rate and $i_c$ is GBP Libor 3m rate (both annualized). Will the parity hold also for 2M tenors of these libor curves?&lt;/p&gt;&#xA;" OwnerUserId="22699" LastActivityDate="2016-07-25T19:23:32.890" Title="IR parity theorem" Tags="&lt;interest-rates&gt;&lt;yield-curve&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28270" PostTypeId="2" ParentId="28254" CreationDate="2016-07-25T16:47:36.987" Score="2" Body="&lt;p&gt;You would simply calculate the prices of various strike options using your parameters, then calculate the black scholes implied vol of each option.  Did I miss the point of your question ?&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-07-25T16:47:36.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28271" PostTypeId="2" ParentId="28269" CreationDate="2016-07-25T19:12:49.610" Score="3" Body="&lt;p&gt;You tell me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The IR parity is a statement of an arbitrage: that if can exchange my amount in currency A into another currency B, invest it and enter a forward spot trade to get back my currency A at a greater effective rate than the rate in currency A, then I have an arbitrage. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The trades for the arbitrage, therefore, are a Spot FX trade, lend currency B, a forward FX trade (known as an Outright), and borrow currency A (or the reverse route). This is only arbitrage if it's risk free, so the rate in each currency must be the risk free rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the Age Of The Textbooks (up to 2007), Libor was that risk free rate, so yes that was the arbitrage, and IR parity held essentially perfectly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But there are some problems post crash. Libor is no longer a measure of the risk free rate. Really the rate there is cash. But cash is not risk free either, and unless you collateralise those trades, you're going to be exposed to a counterparty risk that your credit desk will charge you for. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do collateralise the trades using say cash, then what is going on? You borrow cash and the immediately give it back as collateral? That only makes sense if you are accruing at some floating rate like overnight. So now we're doing an OIS for 3m in each currency, which is effectively fixing our borrowing costs, and we're going to roll a cash amount every night for 3m. Overnight is pretty much risk free, right? But I might borrow at FedFund effective overnight in USD and lend at EONIA minus 2 bp. So then there is a cross currency basis, a premium for borrowing overnight USD instead of EUR, or a credit difference between the quality of overnight counterparty in the different markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So yes, a textbook says that if there is not interest rate parity of interbank fixings then there is an arbitrage. But everything is more complicated now, including the arbitrage by which you would close that gap. The trades still broadly work, so the prices still track each other, but working out what the right number is is not so easy as it was.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the 2m rate, 2m is still published for Libor and Euribor - if you're happy with the 3m rate for arbitrage then you should also be happy with the 2m rate. The difference, though, is that the cross currency basis which is actually traded (and gives lie to IR parity using Xibors) is a basis between 3m tenors, not 2m. So you'd need to make your view of how the 3m premium would translate to a 2m premium. &lt;/p&gt;&#xA;" OwnerUserId="1314" LastEditorUserId="1314" LastEditDate="2016-07-25T19:23:32.890" LastActivityDate="2016-07-25T19:23:32.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28272" PostTypeId="1" CreationDate="2016-07-25T19:38:29.507" Score="-1" ViewCount="578" Body="&lt;p&gt;I have a very fundamental problem, please help me out. I am little confused with the derivation for the close form solution for the Geometric Brownian Motion, from the very fundamental stock model:&#xA;$$\begin{equation}&#xA;dS(t)=\mu S(t)dt+\sigma S(t)dW(t)&#xA;\end{equation}&#xA;$$&#xA;The close form of  the above model is following:&#xA;$$&#xA;\begin{equation}&#xA;S(T)=S(t)\exp((\mu-\frac1 2\sigma^2)(T-t)+\sigma(W(T)-W(t)))&#xA;\end{equation}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe this is quite straightforward for most of you guys, but I really dont know how did you get the $(\mu-\frac 1 2 \sigma^2)$ term. It is clear for me the other way round (from bottom to top), but I fail to derive directly from the top to bottom. I checked some material online, it was saying something with the drift term, which some terms are artificially added during the derivation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your answer and detailed explanation will be greatly appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="22427" LastEditorUserId="22427" LastEditDate="2016-07-25T20:02:46.057" LastActivityDate="2017-02-21T17:57:17.030" Title="Close form solution for Geometric Brownian Motion" Tags="&lt;stochastic-calculus&gt;&lt;finance-mathematics&gt;&lt;quants&gt;" AnswerCount="2" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="28273" PostTypeId="2" ParentId="28272" CreationDate="2016-07-25T20:14:25.713" Score="-1" Body="&lt;p&gt;Have you come across Ito lemma / Ito calculus?. As Gordon suggests: divide the top equation by St, so you get $\frac{dS_t}{S_t}$ and we look at 'by intuition' what does $dln(S_t)$ look like in the Ito world. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Ito states: $df(W,t)=\frac{\partial{f}}{\partial{W}}dW+\frac{\partial{f}}{\partial{t}}dt+\frac{1}{2}\frac{\partial^{2}f}{\partial{W^{2}}}dW^{2}$ &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now from Ito: $d ln(S_t)=\frac{1}{S_t}dS_t - \frac{1}{2}\cdot \frac{1}{S_t^{2}}\cdot dS_t^{2} = \mu dt+\sigma dW_t-\frac{\sigma^2}{2}dt=(\mu-\frac{\sigma^2}{2})dt+\sigma dW_t$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We use in the second equality that $dS_t^{2}=\mu^{2}S_t^{2}d_t^{2}+2\mu\sigma dt\cdot dW_t+\sigma^{2}dW^{2}_t=\sigma^{2}dW^{2}_t=\sigma^{2}dt$ and substitute the original equation for $dS_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From that it follows that &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$ln(S_T)-ln(S_t)=ln(\frac{S_T}{S_t})=(\mu-\frac{\sigma^2}{2})(T-t)+\sigma(W_T-W_t)$ Then by taking $exp(x)$ of both sides of the last equality and multiply by $S_t$ you get the final formula. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="22237" LastEditorUserId="22237" LastEditDate="2016-07-26T18:13:40.287" LastActivityDate="2016-07-26T18:13:40.287" CommentCount="23" ContentLicense="CC BY-SA 3.0" />
  <row Id="28275" PostTypeId="2" ParentId="28229" CreationDate="2016-07-25T21:12:32.983" Score="4" Body="&lt;p&gt;It does not matter which timezone you store timestamps in, though most systems use UTC/GMT), as long as you make the appropriate adjustments to ensure your Trade and Value dates are correct, remembering New York, UK and New Zealand move clocks on different days and directions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;More specifically: by convention, the institutional FX market operates continuously from 05.00 Sydney time on Mondays until 17.00 New York time Fridays - these are local times, e.g. NY is Eastern Daylight Time (EDT) in the NY summer and Eastern Standard Time (EST) in the NY winter (see the ACI model code &lt;a href=&quot;https://acifma.com/model-code&quot; rel=&quot;nofollow&quot;&gt;https://acifma.com/model-code&lt;/a&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Within that week, trades conducted on Sunday carry a Trade Date of Monday; thereafter the Trade Date changes at 17.00 New York time on each of Monday through Friday. So a trade conducted at 16.00 New York time Monday is considered a Monday trade; a trade two hours later at 18.00 is considered a Tuesday trade.  Again these are Eastern Daylight Time in the summer and Eastern Standard Time in the winter. Value Dates (mostly two days after Trade Date, CAD being one day) work the same way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a single exception to that rule. New Zealand Dollar (NZD) and all its crosses change Trade and Value date at 07.00 New Zealand Time (NZDT in NZ summer, NZST in NZ winter).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps and let me know if anything is unclear!&lt;br&gt;&#xA;James Sinclair&lt;/p&gt;&#xA;" OwnerUserId="5161" LastActivityDate="2016-07-25T21:12:32.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28276" PostTypeId="2" ParentId="28259" CreationDate="2016-07-26T01:22:12.853" Score="3" Body="&lt;p&gt;In interest rate land you can look at the yield curve in 3 ways: par space (a chart of the par swap rates of different maturities) , zero space (the zero coupon swap rates) and forward space (usually the 3 month forward rates for various maturities). These are equivalent ways to display the prevailing market rates.  Perhaps that is what is being referred to &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-07-26T01:22:12.853" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28278" PostTypeId="1" AcceptedAnswerId="28281" CreationDate="2016-07-26T02:36:23.393" Score="0" ViewCount="115" Body="&lt;p&gt;I've been trying to fit the following model in Matlab:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\beta_{t}=a+Mt+A\beta_{t-1}+\epsilon_{t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where a is a constant, M is a vector of trend parameters and A a cross-factor interaction matrix. I've been looking at vgxset but it doesn't have the option to add a trend estimation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas?&#xA;Thanks,&lt;/p&gt;&#xA;" OwnerUserId="20751" LastActivityDate="2016-09-16T04:54:20.217" Title="Fit Simple VAR model in Matlab" Tags="&lt;regression&gt;&lt;matlab&gt;&lt;multivariate&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28279" PostTypeId="1" CreationDate="2016-07-26T03:25:01.257" Score="1" ViewCount="140" Body="&lt;p&gt;I was browsing &lt;a href=&quot;http://www.tradingeconomics.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;TradingEconomics.com&lt;/a&gt; and I came across their forecast models which immediately captivated my interest. They describe them as &quot;projected using an autoregressive integrated moving average (ARIMA) model calibrated using our analysts expectations. We model the past behaviour of Japanese Yen using vast amounts of historical data and we adjust the coefficients of the econometric model by taking into account our analysts assessments and future expectations.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a picture below: &lt;a href=&quot;https://i.stack.imgur.com/h304T.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/h304T.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;So, my question is.. how can I create the band throughout the whole data set? From what I have seen thus far in youtube tutorials is that ARIMA is only forward looking it doesn't go through whole data set. Also, can this be done in R? Thank you very much for your time!&lt;/p&gt;&#xA;" OwnerUserId="22642" LastEditorUserId="22707" LastEditDate="2016-07-26T04:44:06.577" LastActivityDate="2016-07-26T04:44:06.577" Title="ARIMA prediction for currencies" Tags="&lt;r&gt;&lt;forecasting&gt;&lt;arima&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28280" PostTypeId="2" ParentId="19597" CreationDate="2016-07-26T04:05:50.207" Score="4" Body="&lt;p&gt;I think what you are looking for is an Adjustable Stop Orders (&lt;a href=&quot;https://www.interactivebrokers.com/en/index.php?f=574&quot; rel=&quot;nofollow&quot;&gt;https://www.interactivebrokers.com/en/index.php?f=574&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using adjustable-stop-order you can limit your losses in case the price falls and protect your profits if the price rises. &#xA;Adjustable stop orders are not orders per say but they are &quot;instructions&quot; to change an existing order. For example: Place a STOP order (to limit your losses after you have taken a position). Then create an adjustable-stop-order to automatically modify the STOP order to STOP LMT or TRAIL STOP LMT order with new trigger price if a certain condition is met.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please make sure to tick the answer if this has actually answered your question.  &lt;/p&gt;&#xA;" OwnerUserId="20897" LastActivityDate="2016-07-26T04:05:50.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28281" PostTypeId="2" ParentId="28278" CreationDate="2016-07-26T05:51:59.603" Score="0" Body="&lt;p&gt;First of all I would not recommend the $M\cdot t$; it is fragile to the choice of $t_0$, isn't it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nevertheless your specification seems to be close to the one of a linear regression (if $\epsilon$ is Gaussian and you metric is the Mahalanobis' one): just organize your dataset as a nice matrix and perform a linear regression.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2016-07-26T05:51:59.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28283" PostTypeId="2" ParentId="28259" CreationDate="2016-07-26T09:07:52.147" Score="0" Body="&lt;p&gt;This sounds to me like an unclear reference to the difference between the spot risk-neutral measure ('zero' curves relate to rates starting today which is generally called 'spot') and the forward measure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;These are different ways to formulate the pricing of derivative securities. They use different numeraires (the idea is that an asset known as the numeraire is the basic unit of currency). Using different measures can allow us to greatly simplify a pricing formula and obtain a closed-form expression.&lt;/p&gt;&#xA;" OwnerUserId="12240" LastActivityDate="2016-07-26T09:07:52.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28285" PostTypeId="1" AcceptedAnswerId="28309" CreationDate="2016-07-26T10:12:36.717" Score="4" ViewCount="7562" Body="&lt;p&gt;I am looking for an API to request intraday data for the London stock exchange. I have seen products like eSignal but this seems to include a lot more than the simple data as XML or JSON and is fairly expensive. The idea is to request data and analyse in an application that I have written so all I need is a real time source. Is there anything available like this? &lt;/p&gt;&#xA;" OwnerUserId="22711" LastEditorUserId="7008" LastEditDate="2016-09-27T23:00:51.427" LastActivityDate="2020-08-17T17:01:10.650" Title="List of Intraday stock prices API" Tags="&lt;programming&gt;&lt;trading&gt;&lt;data-source&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28286" PostTypeId="1" AcceptedAnswerId="28300" CreationDate="2016-07-26T11:27:23.883" Score="0" ViewCount="2188" Body="&lt;p&gt;I am lookign for a list of ISINs or CUSIP for all equity securities traded on the NASDAQ and NYSE. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;while not quantitative, this question is directly related to the data collection process of many quant finance studies so I apologize in advance if this is not the appropriate place to ask. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;" OwnerUserId="17895" LastActivityDate="2016-07-26T14:26:30.853" Title="Where to source security ID data (ISIN, CUSIP)?" Tags="&lt;market-data&gt;&lt;database&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28287" PostTypeId="1" CreationDate="2016-07-26T11:34:13.963" Score="4" ViewCount="2989" Body="&lt;p&gt;Theoretically, in pricing derivatives, most textbooks refer to the risk-free rate. What is obtainable in practice? The risk-free rate or the LIBOR rate?&lt;/p&gt;&#xA;" OwnerUserId="22712" LastActivityDate="2016-07-26T12:51:05.463" Title="Risk Free Rate vs LIBOR" Tags="&lt;finance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28288" PostTypeId="2" ParentId="28114" CreationDate="2016-07-26T12:00:40.790" Score="1" Body="&lt;p&gt;Check this out:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Zacks Splits, Dividends and Corporate Actions Data&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/vyoIQ.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/vyoIQ.jpg&quot; alt=&quot;Image of Zacks Splits, Dividends and Corporate Actions Data&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;a href=&quot;http://www.zacksdata.com/data/splits-dividends-corp-actions/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Zacks Splits, Dividends and Corporate Actions Data&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Data on Quandl API: &lt;a href=&quot;https://www.quandl.com/data/ZDIV&quot; rel=&quot;nofollow noreferrer&quot;&gt;Quandl Zacks Dividends Announcement and History&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7954" LastActivityDate="2016-07-26T12:00:40.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28289" PostTypeId="2" ParentId="27644" CreationDate="2016-07-26T12:32:57.570" Score="2" Body="&lt;h2&gt;Yes,there is. &lt;strong&gt;Key is how long you want to go back/need&lt;/strong&gt;&lt;/h2&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;Educational&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;If you are a student you can get the data from your school if you have access to a database known as WRDS (Wharton Research Data Services) (They have OptionMetrics) Other educational sources would be Thomson Reuters Sirca Tick Data and Bloomberg.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;Non Educational&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;Nanex&lt;/strong&gt;&#xA;&lt;a href=&quot;http://www.nanex.net/historical.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Historical Data&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/ay1co.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ay1co.jpg&quot; alt=&quot;nanex cboe&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;From CBOE ITSELF&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://datashop.cboe.com/option-quotes-intervals&quot; rel=&quot;nofollow noreferrer&quot;&gt;Historical Options Data&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/TRzQp.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/TRzQp.jpg&quot; alt=&quot;purchase historical minute CBOE Index data&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;Best of Luck!&lt;/p&gt;&#xA;" OwnerUserId="7954" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-07-26T12:32:57.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28290" PostTypeId="2" ParentId="28287" CreationDate="2016-07-26T12:51:05.463" Score="2" Body="&lt;p&gt;Before 2007, LIBOR was commonly used for risk-free rate. It was a good proxy because it was quite close to the OIS rates. Since 2007, the LIBOR–OIS spread has spiked and became unstable. Therefore, LIBOR is no longer a good proxy for discounting. Nowadays, Banks usually use OIS for modelling.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Read the &lt;a href=&quot;https://en.wikipedia.org/wiki/Overnight_indexed_swap&quot; rel=&quot;nofollow&quot;&gt;wikipedia article&lt;/a&gt; on OIS-LIBOR spread. John Hull has a very popular &lt;a href=&quot;http://www-2.rotman.utoronto.ca/~hull/DownloadablePublications/LIBORvsOIS.pdf&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; on the subject.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2016-07-26T12:51:05.463" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28291" PostTypeId="2" ParentId="25696" CreationDate="2016-07-26T12:53:51.247" Score="2" Body="&lt;p&gt;From &lt;a href=&quot;http://file.scirp.org/pdf/JMF20120200004_45738367.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;On Valuing Constant Maturity Swap Spread Derivatives&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;&lt;strong&gt;The CMS tickers are represented as USSWAPyy, where yy is the year&#xA;  indicator. For Example the tickers for CMS 30 yrs and CMS 2 yrs are&#xA;  USSWAP30 and USSWAP02 respectively&lt;/strong&gt;&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="7954" LastEditorUserId="7117" LastEditDate="2019-05-06T05:16:20.083" LastActivityDate="2019-05-06T05:16:20.083" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="28292" PostTypeId="1" AcceptedAnswerId="28295" CreationDate="2016-07-26T13:04:23.760" Score="6" ViewCount="26956" Body="&lt;p&gt;I'm looking for a free data source of historical performance data of the MSCI world Value- and Growth index. The data should be calculated with reinvested dividends.&lt;/p&gt;&#xA;" OwnerUserId="22714" LastActivityDate="2016-07-26T13:22:27.300" Title="Where do I get historic performance data of the MSCI World Growth/Value index" Tags="&lt;historical-data&gt;&lt;index&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28293" PostTypeId="2" ParentId="27905" CreationDate="2016-07-26T13:12:28.233" Score="0" Body="&lt;p&gt;I would call these &quot;constituents&quot;.&lt;/p&gt;&#xA;" OwnerUserId="22697" LastActivityDate="2016-07-26T13:12:28.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28294" PostTypeId="2" ParentId="25543" CreationDate="2016-07-26T13:15:41.003" Score="0" Body="&lt;p&gt;&lt;em&gt;I could not find a study about it.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;BUT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;COMMERCIAL HISTORICAL DATA&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;HIGHER RESOLUTION AND MORE COMPLETE DATASETS ARE GENERALLY NOT AVAILABLE FOR FREE. BELOW IS A LIST OF VENDORS &lt;strong&gt;WHICH HAVE PASSED OUR QUALITY SCREENING (IN TOTAL, WE SCREENED OVER A DOZEN VENDORS)&lt;/strong&gt;. &lt;strong&gt;TO QUALIFY, THE VENDOR MUST AGGREGATE DATA FROM ALL US NATIONAL/REGIONAL EXCHANGES AS ONLY COMPLETE DATASETS ARE SUITABLE FOR RESEARCH USE&lt;/strong&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;Caltech&lt;/strong&gt; did a good job of breaking down what was good and what was not. &lt;strong&gt;&quot;Ctrl-F&quot; &quot;errors&quot; or &quot;refresh rate&quot;&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;CalTech: &lt;a href=&quot;http://quant.caltech.edu/historical-stock-data.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Quality of Stock Data&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also this Answer did a great job &lt;a href=&quot;https://stackoverflow.com/a/17263126/4237323&quot;&gt;source of historical stock data&lt;/a&gt;explaining it.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Quant Quote&lt;/strong&gt;&lt;a href=&quot;https://i.stack.imgur.com/f3bMu.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/f3bMu.jpg&quot; alt=&quot;QuantQuote: See 7,8,9 &quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;SP Capital IQ&lt;/strong&gt; &lt;a href=&quot;https://i.stack.imgur.com/63OQW.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/63OQW.jpg&quot; alt=&quot;SPCapitalIq(Compustat)&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7954" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2016-07-27T15:30:56.350" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28295" PostTypeId="2" ParentId="28292" CreationDate="2016-07-26T13:22:27.300" Score="6" Body="&lt;p&gt;This is available directly from MSCI's website: &lt;a href=&quot;https://www.msci.com/end-of-day-data-search&quot; rel=&quot;noreferrer&quot;&gt;MSCI End of Day Index Data Search&lt;/a&gt;. If you click on an index name, you can download the entire history.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2016-07-26T13:22:27.300" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28297" PostTypeId="1" AcceptedAnswerId="28301" CreationDate="2016-07-26T13:35:46.730" Score="1" ViewCount="589" Body="&lt;p&gt;Let $(\Omega, \mathcal{F},\mathbb{P},\{\mathcal{F}\}_t)$ be a filtered- probability space and $W_t$ be standard Wiener process. I want to show stratonovich integral of $W_t$, i.e $\int_{0}^{t} W_s ○ dW_s$ , is not a martingale by Ito lemma.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="22715" LastEditorDisplayName="user16651" LastEditDate="2016-07-26T14:05:25.260" LastActivityDate="2016-07-26T14:46:34.963" Title="Stratonovich Integral and Ito's lemma" Tags="&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="28298" PostTypeId="2" ParentId="24450" CreationDate="2016-07-26T13:52:17.257" Score="2" Body="&lt;h2&gt;It seems that the way to do it free is to scrape them yourself.&lt;/h2&gt;&#xA;&lt;p&gt;&lt;strong&gt;PAID Sources&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;AP&#xA;&lt;a href=&quot;http://www.ap.org/products-services/financial-services&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.ap.org/products-services/financial-services&lt;/a&gt;&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;Elektron Market Data Feeds | Thomson Reuters&#xA;&lt;a href=&quot;http://financial.thomsonreuters.com/en/products/infrastructure/trading-infrastructure/elektron-enterprise-data-management/market-data-feeds.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://financial.thomsonreuters.com/en/products/infrastructure/trading-infrastructure/elektron-enterprise-data-management/market-data-feeds.html&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;AlphaFlash | The fastest machine-readable economic news | AlphaFlash®&#xA;&lt;a href=&quot;http://www.alphaflash.com/product-info/alphaflash-en&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.alphaflash.com/product-info/alphaflash-en&lt;/a&gt;&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;p&gt;Best of luck!&lt;/p&gt;&#xA;" OwnerUserId="7954" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-07-26T23:39:20.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28299" PostTypeId="2" ParentId="28173" CreationDate="2016-07-26T14:03:08.663" Score="1" Body="&lt;p&gt;Here you go.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;On Page 935&lt;/p&gt;&#xA;&lt;p&gt;&amp;quot;A.4. Global Government Bonds Bond index returns come from Bloomberg&#xA;and Morgan Markets, short rates and &lt;strong&gt;10-year government bond yields are&#xA;from Bloomberg&lt;/strong&gt;, and inflation forecasts are obtained from investment&#xA;bank analysts’ estimates as compiled by Consensus Economics. We obtain&#xA;government bond data for the following 10 countries: Australia,&#xA;Canada, Denmark, Germany, Japan, Norway, Sweden, Switzerland, the&#xA;United Kingdom, and the United States over the period January 1982 to&#xA;July 2011, where the minimum number of country bond returns is 5 at&#xA;any point in time and all 10 country bonds are available after&#xA;1990.&amp;quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Orginial Data 2016 :&#xA;&lt;a href=&quot;https://www.aqr.com/library/data-sets/value-and-momentum-everywhere-factors-monthly&quot; rel=&quot;nofollow noreferrer&quot;&gt;Value and Momentum Everywhere: Original Paper Data&lt;/a&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Or &amp;quot;&lt;strong&gt;TED spread&lt;/strong&gt; (3 month LIBOR minus 3 month T-bill rate), U.S., U.K.,&#xA;Japan, Germany (Bloomberg and International Fund Services (IFS))&amp;quot;:&#xA;&lt;a href=&quot;http://www.q-group.org/wp-content/uploads/2014/01/Asness-VME_presentation.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Ted Spread&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Or &amp;quot;Summary of “Value and Momentum Everywhere” Columbia:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;http://Funding%20liquidity%20risks%20are%20measured%20by%20Treasury-Eurodollar%20spread%20(TED),%20LIBOR-term%20repo%20spread,%20and%20Swap-T-bill%20spread.%20Higher%20spreads%20indicate%20tighter%20funding%20constraints%20for%20financial%20institutions%20who%20usually%20are%20the%20marginal%20investors%20or%20the%20market%20makers%20in%20the%20asset%20markets.&quot; rel=&quot;nofollow noreferrer&quot;&gt;Funding liquidity risks are measured by Treasury-Eurodollar spread&#xA;(TED), LIBOR-term repo spread, and Swap-T-bill spread. Higher spreads&#xA;indicate tighter funding constraints for financial institutions who&#xA;usually are the marginal investors or the market makers in the asset&#xA;markets.&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="7954" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-07-26T14:13:33.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28300" PostTypeId="2" ParentId="28286" CreationDate="2016-07-26T14:26:30.853" Score="1" Body="&lt;p&gt;Issue has been sorted. I'll post here for anyone else looking:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I downloaded the Tickers in excel format from the NAz website:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.nasdaq.com/screening/companies-by-industry.aspx?exchange=NASDAQ&quot; rel=&quot;nofollow&quot;&gt;http://www.nasdaq.com/screening/companies-by-industry.aspx?exchange=NASDAQ&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the Bloomberg terminal in uni and the excel API i have the ticker list in column A and i input the following in column B:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;=BDP(A2&amp;amp;&quot; US Equity&quot;,&quot;ID_ISIN&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the output is the ISIN for the ticker in A2. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers. &lt;/p&gt;&#xA;" OwnerUserId="17895" LastActivityDate="2016-07-26T14:26:30.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28301" PostTypeId="2" ParentId="28297" CreationDate="2016-07-26T14:35:11.150" Score="4" Body="&lt;p&gt;It is well-known, $W_t$ is a continues, adapted and locally bounded process.Let $I=\{t_i\}_{i=0}^{n}$ is a sequence of partitions of $[0,t]$, Indeed $0=t_0&amp;lt;t_1&amp;lt;\cdots&amp;lt;t_n=t$ .By definition of stratonovich integral, we have &#xA;$$\int_{0}^{t} W_s\circ dW_s=\frac{1}{2}\underset{n\to \infty }{\mathop{\lim }}\sum_{i=0}^{n-1}(W(t_{i+1})+W(t_i))(W(t_{i+1})-W(t_i))$$&#xA;$$\int_{0}^{t} W_s\circ dW_s=\frac{1}{2}\underset{n\to \infty }{\mathop{\lim }}\sum_{i=0}^{n-1}(W^2(t_{i+1})-W^2(t_i))\quad(\operatorname{Telescoping series })$$&#xA;$$\int_{0}^{t} W_s\circ dW_s=\frac{1}{2}\underset{n\to \infty }{\mathop{\lim }}(W^2(t_n)-W^2(t_0))$$&#xA;Therefore&#xA;$$\int_{0}^{t} W_s\circ dW_s=\frac{1}{2}(\,W^2(t)-W^2(0)\,)=\frac{1}{2}W_t^2\quad (\underset{n\to \infty }{\mathop{\lim }}W(t_n)=W(t))$$&#xA;Hence&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$$\int_{0}^{t} W_s\circ&#xA; dW_s=\frac{1}{2}W_t^2$$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now use Ito lemma.&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-07-26T14:46:34.963" LastActivityDate="2016-07-26T14:46:34.963" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28302" PostTypeId="1" AcceptedAnswerId="29767" CreationDate="2016-07-26T14:44:01.537" Score="6" ViewCount="7107" Body="&lt;p&gt;Question: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When checking the volatility surface for, let's say, a swaption, where the the option expires in 1Y and the underlying starts in 1Y and ends in 5Y, one would check the volatility surface for the quoted volatilities and pick the volatility from Exp. 1Yx5Y ;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What happens to the volatility of a mid curve option? how do you relate/ interpolate the volatility in this case? let's say the option expires in 1Y, and the asset starts in 6Y and ends in 5Y after start? where on the volatility surface should the volatility of a mid curve option be situated? Or in other words howw do you get the volatility for the 6Y fwd 5Y swap for an option that expires in 1Y ? &lt;/p&gt;&#xA;" OwnerUserId="22695" LastEditorUserId="22695" LastEditDate="2016-07-26T14:52:01.003" LastActivityDate="2019-10-24T14:57:57.473" Title="volatility of a mid curve option" Tags="&lt;option-pricing&gt;&lt;valuation&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28303" PostTypeId="1" AcceptedAnswerId="28304" CreationDate="2016-07-26T15:00:50.710" Score="3" ViewCount="202" Body="&lt;p&gt;Let's say I have a black box stock price model I run Monte Carlo on to estimate European call prices.  For a given strike $K$ and expiration $T$, I then back out the Black-Scholes implied volatility $\sigma(K, T)$ from the Monte Carlo price $C_{MC}$, and this assumes the model is lognormal.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I now want to price a digital option using this black box model at the same $K$ and $T$ for which I computed the implied vol.  I use Monte Carlo for this and obtain a price $D_{MC}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say I also compute the price of this digital using the closed-form Black-Scholes price and use $\sigma(K,T)$ as my vol.  I obtain a price of $D_{BS}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, as I understand, $\sigma(K, T)$ is exactly that volatility I had to plug into my Black-Scholes price to obtain $C_{MC}$.  I am now pricing another type of option (digital) for this $K$ and $T$ and use $\sigma(K, T)$ in my closed-form.  My question is, what is the relation between $D_{MC}$ and $D_{BS}$?  Would one expect these to be equal?  Would they be equal only if the black box model was actually just the lognormal model?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2016-07-26T20:54:28.963" Title="Implied Vol in Different Payoffs" Tags="&lt;options&gt;&lt;implied-volatility&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28304" PostTypeId="2" ParentId="28303" CreationDate="2016-07-26T15:40:32.300" Score="4" Body="&lt;p&gt;They would only have been equal (up to the usual MC accuracy and bias) should the black-box model had assumed a GBM dynamics as in the classic Black-Scholes framework.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$D_{MC}$ and $D_{BS}$ will indeed differ in general because &lt;em&gt;digital options are sensitive to the implied volatility skew&lt;/em&gt;, which is inexistent in a Black-Scholes world where $\sigma (K,T)=\sigma $ (flat vol surface).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To see this, remember the &lt;em&gt;model-free&lt;/em&gt; approximation of a digital call $D(K,T)$ as a (normalised) bull call spread with strikes $K-\epsilon$ and $K+\epsilon$ in the limit as the wedge $\epsilon $ tends towards zero:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ D (K,T) = \lim_{\epsilon \rightarrow 0} \frac {C (K-\epsilon,T)-C (K+\epsilon,T)}{2\epsilon} $$&#xA;hence the following,&#xA;\begin{align}&#xA;D (K,T) &amp;amp;= -\frac {dC}{dK} \\&#xA;&amp;amp;= \underbrace {-\frac {\partial C}{\partial K}}_ {\text {BS digital price}} - \underbrace {\frac {\partial C}{\partial \sigma}}_{\text {BS Vega}} \underbrace {\frac {\partial \sigma}{\partial K}}_{\text {Vol skew}}&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a nutshell, as soon as your black-box model allows for vol skew ($\frac {\partial \sigma}{\partial K} \ne 0$), its digital prices will differ from the theoretical BS price which does not ($\frac {\partial \sigma}{\partial K}=0$).&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-07-26T20:54:28.963" LastActivityDate="2016-07-26T20:54:28.963" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28305" PostTypeId="2" ParentId="18822" CreationDate="2016-07-26T19:15:28.110" Score="7" Body="&lt;p&gt;This is an old post, but I thought I would offer the following facts:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) QQ claims to be sited in the Empire State Building, Suite 2100.  (&lt;a href=&quot;https://quantquote.com/contact.php&quot; rel=&quot;noreferrer&quot;&gt;https://quantquote.com/contact.php&lt;/a&gt;)  That is false.  They do not lease or sublease that address.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) The VM message on their sales line is a standard carrier-provided one such as a private individual would have.  It does not mention the company name, the name of an employee, the hours of operation, or anything else you would expect from a corporation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe that QQ is a fraud.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's how I got the information about their address:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;*) I intended to buy QQ's data, so I contacted them asking for the specific custom package I wanted, and also asking why their Volume column has decimals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;*) I got no response to phone or email.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;*) I called again today and noticed how unprofessional their sales line's VM was.  That made me curious.  That was when I noticed they were in the ESB.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;*) Having gotten suspicious, I looked up their address (the Empire State Building, Suite 2100).  I then called the Leasing Office for the ESB (&lt;a href=&quot;http://www.empirestaterealtytrust.com/properties/office/empire-state-building1&quot; rel=&quot;noreferrer&quot;&gt;http://www.empirestaterealtytrust.com/properties/office/empire-state-building1&lt;/a&gt;) and went down the list calling each agent and asking if they would confirm that a company named &quot;QuantQuote Research&quot; rented that suite.  Some of the agents weren't in or said that they couldn't give out information about clients.  I finally found one whose secretary looked up the information for me and said that no, someone else rents that suite. She even called over to ask security at the ESB proper to please check that the tenant did not have any subleases outstanding.  They did not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not giving out the name of the person who gave me this information because I don't want to potentially get her in trouble, but you can definitely do the same as I did to confirm it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is not definitive proof, but I find it suspicious enough that I'm not going to do business with QQ.&lt;/p&gt;&#xA;" OwnerUserId="22720" LastActivityDate="2016-07-26T19:15:28.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28306" PostTypeId="2" ParentId="21593" CreationDate="2016-07-26T20:42:47.127" Score="1" Body="&lt;p&gt;When I worked at a private investment shop as a real estate acquisitions analyst, we valued properties with a blend of various methods.  Common to every analysis was a DCF, a comparables-summary, and a qualitative argument.  The latter was very deal specific, but the former two generalized pretty well across deals.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;DCF&lt;/strong&gt;: to determine what we could pay for the asset today, we split the property CFs into &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;a 5-10yr theoretical &quot;hold&quot;-period where we had visibility over the leases and expected rent steps. We'd make assumptions about rent growth / lease-up for the top-line and required CapEx, OpEx, debt etc to get to net cash flow for the project&lt;/li&gt;&#xA;&lt;li&gt;a reversion value (or projected sale value) at the end of the hold-period based on cap rates we thought the market would support (i.e., what going-in yields the next-buyer would require). Sometimes, we would get greater clarity on our exit value by modeling out a next-buyer hold-period and repeating the process for this buyer assuming low rent growth (something like 1-3%) and a conservative exit cap.  This doesn't quite capture the essence of a &quot;terminal value&quot;, though&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Further on 2. above, I would think of the next-buyer's yield as our contrived terminal discount rate for a perpetuity (or an annuity until the next buyer sells, and so on).  That is, after making assumptions about long-term vacancy, tenant rollover, ongoing capital, general inflation, and economic rents for the property to compute a stabilized operating cash flow, we could compute something like an approximate reversion value by apply a terminal yield to price the stream of CFs like a perpetuity.   &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Comparables&lt;/strong&gt;: when valuing the reversion / next-sale, we would check our yields against recent trades or comparable historical trades, and similarly, check our intermediate and long-term OpEx / CapEx / rent assumptions against the market.  So this was a less structured approach and more served to round out our assumptions&lt;/p&gt;&#xA;" OwnerUserId="20465" LastActivityDate="2016-07-26T20:42:47.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28307" PostTypeId="2" ParentId="28191" CreationDate="2016-07-26T21:02:10.793" Score="0" Body="&lt;p&gt;When $X_1$ is unobserved, at iteration $k=1$ of EM, the posterior mean value (when $X_2=3$) is $5.18$ by using an inference algorithm, i.e. Junction tree/Kalman filter. &#xA;Then the sufficient statistics for $X_1$ is: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$s_1=\Sigma_{i=1}^nx_{i1}=9+4+5.18$ and $s_{11}=\Sigma_{i=1}^nx_{i1}^2=9^2+4^2+(5.18^2+\sigma_{11.2})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\sigma_{11.2}$ is the posterior conditional variance of $X_1$ given $X_2$, when $X_1$ is unobserved. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$s_2=\Sigma_{i=1}^nx_{i2}$ and $s_{22}=\Sigma_{i=1}^nx_{i2}^2$. When $X_2$ is unobserved a term $\sigma_{22.1}$ is also added to $x_{i2}^2$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So parameters $\mu_{X_1}$ and $\sigma_{X_1}$ are obtained. Similarly, posterior mean of unobserved $X_2$ is also obtained by using i.e. Junction tree inference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The sufficient statistics for $s_{12}=\Sigma_{i=1}^nx_{i1}x_{i2}$, and $s_{21}=\Sigma_{i=1}^nx_{i2}x_{i1}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mean vector is then: $\mu^{(k)}=(s_1/n, s_2/n)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Covariance matrix is: $\Sigma^{(k)}=$$\left( \begin{matrix}&#xA;   \Sigma _{11} &amp;amp; \Sigma _{12}  \\&#xA;   \Sigma _{21} &amp;amp; \Sigma _{22}  \\&#xA;\end{matrix} \right)$$=$$\left( \begin{matrix}&#xA;   s_{11}/n-(s_1/n)^2 &amp;amp; s_{21}/n-(s_2/n)(s_1/n)  \\&#xA;   s_{12}/n-(s_1/n)(s_2/n) &amp;amp; s_{22}/n-(s_2/n)^2  \\&#xA;\end{matrix} \right)$$&#xA; $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other parameters in the question are obtained. Conditional mean and conditional variance of $X_2|X_1$ is calculated by the formula in the reference of the question.&#xA;I have validated these formulae with Matlab the result is correct.&lt;/p&gt;&#xA;" OwnerUserId="22152" LastEditorUserId="22152" LastEditDate="2016-07-27T10:19:09.103" LastActivityDate="2016-07-27T10:19:09.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28309" PostTypeId="2" ParentId="28285" CreationDate="2016-07-27T02:24:08.577" Score="6" Body="&lt;p&gt;It seems to be a good question for a Community Wiki ^^&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please note this wiki is devoted to &lt;strong&gt;Intraday&lt;/strong&gt; data only. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are looking for other financial data : see &lt;a href=&quot;https://quant.stackexchange.com/q/141/7008&quot;&gt;What data sources are available online?&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;List of Available Intraday API&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Please add your links with the following syntax:  1) website - 2) minimum time frame - 3) Is it possible to retrieve &lt;strong&gt;Real Time&lt;/strong&gt; data ? ( Yes or No )&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Not Free of Charge&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://www.quandl.com/blog/quandl-launches-intraday-data-2&quot; rel=&quot;nofollow noreferrer&quot;&gt;Quandl API&lt;/a&gt;   ,  One minute Bars, No &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://www.tickdata.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;TickData API&lt;/a&gt; ,Tick by Tick data ,  No&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.bloomberglabs.com/api/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bloomberg API&lt;/a&gt; ,  Tick by Tick data , Yes&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.esignal.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Esignal&lt;/a&gt;, Tick by Tick data , Yes&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.barchartmarketdata.com/fees&quot; rel=&quot;nofollow noreferrer&quot;&gt;BarChart&lt;/a&gt;, Tick by Tick data , Yes&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Free of Charge&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://stooq.com/db/h/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Stooq.com&lt;/a&gt;  - 5 minutes - No  (&lt;em&gt;Nb: Not a real API, just a download page&lt;/em&gt;)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-09-27T23:00:13.080" CommentCount="0" CommunityOwnedDate="2016-07-27T02:24:08.577" ContentLicense="CC BY-SA 3.0" />
  <row Id="28310" PostTypeId="1" AcceptedAnswerId="28312" CreationDate="2016-07-27T03:13:30.650" Score="2" ViewCount="156" Body="&lt;p&gt;Let's say we'd like to find a par rate for a 1 month forward starting 20-year interest rate swap. In this case, we'd need to discount cash flows for the payment periods shifted +1 month from standard semiannual or quarterly payments (which we can find by bootstrapping from frequent 1st year values and yearly rates). And annual rates should available well past the final date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some standard approach to find these discount factors? I assume since par rate is something which defines swaptions' fixing values (its strike), it should be some agreed procedure and not just interpolation.&lt;/p&gt;&#xA;" OwnerUserId="5086" LastActivityDate="2016-07-27T08:20:41.103" Title="Determining discount factors for non-standard maturities" Tags="&lt;interest-rates&gt;&lt;swaps&gt;&lt;interest-rate-swap&gt;&lt;bootstrapping&gt;&lt;discount-factor-curve&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28312" PostTypeId="2" ParentId="28310" CreationDate="2016-07-27T08:20:41.103" Score="1" Body="&lt;p&gt;No it's just interpolation.   In practice there isn't much disagreement among participants for something like one month 20yr forward rate.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-07-27T08:20:41.103" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28313" PostTypeId="1" AcceptedAnswerId="28318" CreationDate="2016-07-27T09:50:56.830" Score="2" ViewCount="551" Body="&lt;p&gt;Is it possible to price barrier options on a basket of stocks using &lt;a href=&quot;http://quantlib.org&quot; rel=&quot;nofollow&quot;&gt;Quantlib&lt;/a&gt;, e.g. a Worst-of Down-and-in-Put on a basket of 3 stocks?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I already checked the &lt;code&gt;MCBarrierEngine&lt;/code&gt; (does not support multiple stocks) and the &lt;code&gt;MCEuropeanBasketEngine&lt;/code&gt; (does not support barrier options), but without any luck.&lt;/p&gt;&#xA;" OwnerUserId="2618" LastActivityDate="2016-07-27T13:17:57.017" Title="Price Barrier Options on Baskets using Quantlib" Tags="&lt;options&gt;&lt;quantlib&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28314" PostTypeId="2" ParentId="25696" CreationDate="2016-07-27T09:50:57.620" Score="1" Body="&lt;p&gt;The question is about the prices of CMS swaps, which are swaps where one side pays CMS and the other side pays Libor + X, where X is the price we are looking for. The payment frequency is usually quarterly or semiannually.  These instruments aren't very liquid.   As far as I know , historical prices are not available in any database.  The best you can do is get current prices by calling an exotics dealer.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main issue with pricing is to decide the convexity adjustment to be added to the forward swap rate for each maturity.  This will be a function of the swaption smile.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-07-27T09:50:57.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28315" PostTypeId="2" ParentId="27690" CreationDate="2016-07-27T10:34:55.300" Score="2" Body="&lt;p&gt;You are correct; methods 1) and 2) will give you the same result but keeping two things in mind:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A) You need to make sure your FX forwards and xccy basis swaps are priced under the same collateral assumption.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;B) The difference between the two methods is more a question of semantics because FX forwards and xccy basis swaps are mutually dependent, so it really depends what market data you have to start with.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;More info:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A) By collateralisation I mean the amount regularly exchanged between the two parties of the swap/contract, on top of any coupons or notional payments scheduled, as the value of the swap/contract fluctuates with the market. In order to take out any credit risk issues, broker feeds assume perfect collateralisation (=&gt; daily, no minimum transfer amount), and so should you for your pure &quot;first-order&quot; rates pricing purposes. But the currency which will be actually posted matters too since it will determine which discount curve and factors will ultimately be used. Xccy swaps vs USD are usually collateralised with US Dollars, which means the cashflows are discounted at Fedfunds. By saying &quot;risk-free rate&quot; I assume this is what you are referring to; the OIS discount rate of the corresponding currency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;B) You can bootstrap your FX forwards from the xccy basis curve or you can bootstrap you xccy bases from FX forwards, assuming you also have all the other curves needed for both discounting and libor forwards. Usually you would go from the xccy basis to FX forwards since the latter usually has market data only for short-term maturities (&amp;lt;1 year). More details on the methodology can be found in this answer to a related question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/a/28255/22726&quot;&gt;https://quant.stackexchange.com/a/28255/22726&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming you are looking at EURUSD discounted at Fedfunds, in the end what you end up with is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Fedfunds discount factors: df(FF) -&gt; those can be applied to any USD amount in the future to get its USD PV.&lt;/li&gt;&#xA;&lt;li&gt;FX forwards: fwd(EURUSD) -&gt; those can be applied to any EUR amount in&#xA;the future to get its USD-equivalent amount in the future&lt;/li&gt;&#xA;&lt;li&gt;Basis discount factors: df(EURUSD) -&gt; those can be applied to any EUR amount in the future to get its EUR PV discounted at Fedfunds.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;But:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;df(EURUSD) =  df(FF) x fwd(EURUSD) / spot(EURUSD)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what I mean is that depending on how you combine these factors (associative property of multiplication...) you can either call them FX forwards, single-currency discount factors or basis discount factors but it really comes down to the same thing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One caveat is if you use a different market feed, like the EONIA/FEDFUNDS basis curve, to get your basis discount factors, but whether or not you find the same result depends on the non-arbitrage property of your market data.&lt;/p&gt;&#xA;" OwnerUserId="22726" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-07-27T10:34:55.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28317" PostTypeId="2" ParentId="28102" CreationDate="2016-07-27T13:12:22.667" Score="1" Body="&lt;p&gt;You should ask your data provider how exactly they come up with this number. Many implementations divide theta by 365 or some other yearly day count to arrive at &quot;theta per day&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It should be simple enough to check the value: for a European option, you can use the analytic formula; for American Options, you can use a tree. Methods to get the Greeks in the binomial method are described in the paper &lt;a href=&quot;http://ssrn.com/abstract=1341181&quot; rel=&quot;nofollow&quot; title=&quot;Implementing Binomial Trees&quot;&gt;Implementing Binomial Trees&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6857" LastActivityDate="2016-07-27T13:12:22.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28318" PostTypeId="2" ParentId="28313" CreationDate="2016-07-27T13:17:57.017" Score="3" Body="&lt;p&gt;There's no such engine at this time. If you want to code it, you can clone and rename the &lt;code&gt;MCEuropeanBasketEngine&lt;/code&gt; and the &lt;code&gt;EuropeanMultiPathPricer&lt;/code&gt; classes.  The new path-pricer class must be modified so that its &lt;code&gt;operator()&lt;/code&gt; returns the payoff of your option as calculated on a given path; the new engine will be mostly unmodified, except for the &lt;code&gt;pathPricer&lt;/code&gt; method which of course must now return an instance of the new path-pricer class.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2016-07-27T13:17:57.017" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28319" PostTypeId="1" AcceptedAnswerId="28320" CreationDate="2016-07-27T15:47:41.273" Score="8" ViewCount="471" Body="&lt;p&gt;I always understood implied volatility as a volatility I need to plug into BS in order to get the market price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is if I am using different model, does it mean that implied volatility is the volatility I need to plug into pricing equation of the new model in order to get market price or am I still referring to BS?&lt;/p&gt;&#xA;" OwnerUserId="22424" LastActivityDate="2016-08-17T20:28:30.260" Title="What is implied volatility?" Tags="&lt;implied-volatility&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28320" PostTypeId="2" ParentId="28319" CreationDate="2016-07-27T15:59:15.207" Score="8" Body="&lt;p&gt;In practice, an implied volatility always refers to the volatility that you need to plug into the Black-Scholes', or Black's, pricing formula to obtain the market price. You may have a different model (e.g., a Heston style stochastic variance model), for which you are able to calibrate the parameters by matching your model price to the market price. However, none of those parameters are called the implied volatility in general.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes, you can also specify some parameters for a model (e.g., the Heston model), and generate some vanilla option prices. Then, you can also calibrate Black's implied volatilites by matching the BS prices to your model prices. &lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-07-27T16:05:00.410" LastActivityDate="2016-07-27T16:05:00.410" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28324" PostTypeId="1" AcceptedAnswerId="28327" CreationDate="2016-07-27T18:29:28.117" Score="8" ViewCount="377" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/zKv7H.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/zKv7H.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea where lies the problem? Thank you for suggestions.&lt;/p&gt;&#xA;" OwnerUserId="22424" LastActivityDate="2016-07-27T20:10:59.390" Title="Black Scholes paradox exercise" Tags="&lt;black-scholes&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28325" PostTypeId="2" ParentId="25958" CreationDate="2016-07-27T19:13:08.383" Score="3" Body="&lt;p&gt;Vega = Shares Outstanding * Share Price * Leverage / 1m Constant Maturity VIX Future&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, Vega = Current Market Cap * Leverage / 1m Constant Maturity VIX Future&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g. Leverage = 2 for TVIX, 1 for VXX&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Net Vega = Total Long ETP vega - Total Short ETP Vega&lt;/p&gt;&#xA;" OwnerUserId="22743" LastActivityDate="2016-07-27T19:13:08.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28327" PostTypeId="2" ParentId="28324" CreationDate="2016-07-27T20:00:29.017" Score="5" Body="&lt;p&gt;In the absence of uncertainty, the drift of the stock $\mu$ under the objective measure $\mathbb {P} $ should be equal to the risk-free  rate $r$ (*) to preclude arbitrage opportunities. Hence, there is no paradox, since the two formulas coincide under such circumstances.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To convince yourself, consider the following thought experiment. At time zero, suppose that you possess a cash amount $S_0$, which you would like to invest. You come up with 2 different investment ideas:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Buy the stock at time zero. With certainty your long position will be worth $S_0e^{\mu T}$ at time $T$.&lt;/li&gt;&#xA;&lt;li&gt;Invest your cash in the risk-free money market account at time zero. This will get you $S_0e^{r T} $ with certainty at time $T$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;It is clear that you should have $r=\mu$ to preclude arbitrage opportunities in that case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(*) $r$ happens to be the drift required under the risk-neutral measure $\mathbb {Q} $, i.e. the drift assumed when deriving the BS formula&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-07-27T20:10:59.390" LastActivityDate="2016-07-27T20:10:59.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28328" PostTypeId="2" ParentId="18296" CreationDate="2016-07-27T20:08:03.497" Score="1" Body="&lt;p&gt;I found this &lt;a href=&quot;http://www.fabiomercurio.it/LMMpostcrunch5.pdf&quot; rel=&quot;nofollow&quot;&gt;Mercurio paper&lt;/a&gt; (PDF) helpful and accessible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first fifteen pages or so provide a nice background on why multiple curves are used (not sure if outdated, though).  Mercurio first motivates the use of multiple curves with an example of what seems to be an arbitrage opportunity. We're given 3m LIBOR, 6m LIBOR, and a 3$\times$3m FRA on a certain date such thatthe implied 3$\times$3m forward LIBOR rate exceeds the FRA, indicating a possible arbitrage opportunity of buying a 6m bond, selling a 3m bond, then entering into a payer FRA in 3m time. However, if we allow for the possibility that:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;our counterparty could default at some point within the 6m window &lt;/li&gt;&#xA;&lt;li&gt;liquidity could dry up between now and in 3m time&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;then this strategy may not be an aribitrage opportunity.  He then explains in Section 2.3:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Such rates, in fact, become compatible with each other as soon as credit and liquidity risks are taken into account. However, instead of explicitly modeling credit and liquidity effects, practitioners seem to deal with the above discrepancies by segmenting market rates, labeling them differently according to their application period. This results in the construction of different zero-coupon curves, one for each possible rate length considered. One of this curves, or any version obtained by mixing “inhomogeneous rates”, is then elected to act as the discount&#xA;  curve.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="20465" LastActivityDate="2016-07-27T20:08:03.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28330" PostTypeId="1" CreationDate="2016-07-27T20:49:39.110" Score="6" ViewCount="748" Body="&lt;p&gt;I would like to extend my question about about FX Forward rates in stochastic interest rate setup: &lt;a href=&quot;https://quant.stackexchange.com/questions/27545/fx-forward-with-stochastic-interest-rates-pricing&quot;&gt;FX forward with stochastic interest rates pricing&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We consider a FX process $X_t = X_0 \exp( \int_0^t(r^d_s-r^f_s)ds -\frac{\sigma^2}{2}t+ \sigma W_t^2)$ where $r^d$ and $r^f$ are stochastic processes not independent of the Brownian motion $W$. The domestic risk-neutral measure is denoted by $\mathbb Q^d$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The domestic and foreign bank accounts are $\beta^d$ and $\beta^f $ respectively. The domestic and foreign zero-coupon bond prices of maturity $T$ at time $t$ are respective $B_d(t,T)$ and $B_f(t,T)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The domestic bond follows the SDE&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{dB_d(t,T)}{B_d(t,T)} = r^d_t \ dt + \sigma(t,T) \ dW^1_t &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with deterministic initial conditions $B_d(0,T)$. The drift and volatility functions in the SDEs are all deterministic functions and $W^1$ and $W^2$  are standard Brownian motions such that $\langle W^1, W^2\rangle_t =\rho \ dt$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now consider domestic $\tau$-forward measure $\mathbb Q^{d,\tau}$ &#xA;$$&#xA;\left. \frac{d\mathbb Q^{d,\tau}}{d\mathbb Q^d}\right|_{\mathcal F_t}  = \frac{B_d(t,\tau)}{\beta_t^dB_d(0,\tau)} = \mathcal E_t \left( \int_0 ^. \sigma(s,\tau) \ dW^1_s\right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the $\mathbb Q^{\tau}$-Brownian motions&#xA;$$&#xA;W^{1,\tau}_. := W^1_. + \int_0 ^. \sigma(s,\tau) \ ds&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;W^{2,\tau}_. := W^2_. + \rho \int_0 ^. \sigma(s,\tau) \ ds&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I would like to calculate the non-deliverable&#xA;  FX forward rate. Since the fixing date $t_f$ is such that $t_f&amp;lt; T$, where $T$ is the settlement date, it implies &#xA;   to pass by the calculation following expectation:&#xA;  $$\mathbb E^{\mathbb Q^d} _t \left[ \exp(-\int_t^T r^d_s ~ds)\  X_{t_f}\right]$$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I can get to this point&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\mathbb E^{\mathbb Q^d} _t \left[ \exp(-\int_t^T r^d_s ~ds)\  X_{t_f}\right]= B_d(t,t_f)\ \mathbb E^{\mathbb Q^{d,t_f}}_t\left[ B_b(t_f,T)X_{t_f}\right].&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From that point I am struggling to get through all the calculations. Is there a smart way to compute the last expectation?&lt;/p&gt;&#xA;" OwnerUserId="22093" LastEditorUserId="-1" LastEditorDisplayName="user16651" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-08-28T20:47:56.690" Title="FX Forward pricing with correlation between FX and Zero-Cupon" Tags="&lt;fx&gt;&lt;correlation&gt;&lt;forward&gt;&lt;forward-rate&gt;" AnswerCount="1" CommentCount="29" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28331" PostTypeId="1" CreationDate="2016-07-27T21:28:46.157" Score="2" ViewCount="362" Body="&lt;p&gt;I was reading through a &lt;a href=&quot;http://bfi.cl/assets/morini-2008---solving-the-puzzle-in-the-interest-rate-market.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;paper&lt;/a&gt; that attempted to present a theoretical explanation for the divergence in value of different LIBOR tenors (and thus for the use of different curves for different tenors).  The author's framework explained differences in terms of FRA and basis swap spreads (in Conjecture 6, p.19), and I was wondering:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;have any comprehensive theoretical frameworks been developed that are used in practice?&lt;/li&gt;&#xA;&lt;li&gt;are there any other reasons (beyond empirical fitting) for using multiple curves (inspired by the answers to &lt;a href=&quot;https://quant.stackexchange.com/questions/7402/how-to-derive-yield-curve-from-interest-rate-swap?rq=1&quot;&gt;this&lt;/a&gt; question)?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Finally, in the framework of multiple curves, is it then appropriate to say that 1Y LIBOR is above 1Y swaps because the swaps use OIS discounting (and are collateralized)? If so, does this extend to explaining any of the difference in long term rates (10Y swaps below 10Y treasuries), or are these dynamics better explained by regulatory environments and repo markets?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="20465" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-07-29T18:51:42.990" Title="LMM &amp; multiple curves" Tags="&lt;interest-rates&gt;&lt;swaps&gt;&lt;libor&gt;&lt;ois-discounting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28332" PostTypeId="2" ParentId="18851" CreationDate="2016-07-28T00:30:24.053" Score="7" Body="&lt;p&gt;&lt;strong&gt;The problem here is that your market is not arbitrage-free&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;JPY OIS = 10% per day, flat&lt;br&gt;&#xA;  USD OIS = 0% per day, flat&lt;br&gt;&#xA;  USDJPY spot = 100&lt;br&gt;&#xA;  USDJPY Forward for tomorrow = 100  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;A quick sense check is that, if you have an interest rate differential, you cannot have the FX forward equal to the spot FX.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would take advantage of the arbitrage as follows:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I borrow overnight 0.9091 (=1/1.1) USD today&lt;/li&gt;&#xA;&lt;li&gt;I sell it spot to receive 90.91 JPY, still today&lt;/li&gt;&#xA;&lt;li&gt;I place the 90.91 JPY overnight to receive 100 JPY tomorrow&lt;/li&gt;&#xA;&lt;li&gt;As per our FX forward contract, tomorrow I give you 100 JPY and you give me 1 USD&lt;/li&gt;&#xA;&lt;li&gt;Tomorrow still, I repay my borrowing of 0.9091 USD and keep the difference, 0.0909 USD which I made risk-free.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You are correct, this is arbitrage, but it does not come from the collateral agreement per se but from the rates market you assumed. Calculating the collateral which should be posted at day one is just the same as calculating the PV of the transaction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. user17252's answer mentions using xccy basis instead of FX forwards but both essentially come down to the same thing as long as you assume the same collateral on both instruments. Usually you would use xccy basis to derive the FX forward you'd need for your calculations. See my answer here for more details on this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/a/28315/22726&quot;&gt;https://quant.stackexchange.com/a/28315/22726&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="22726" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2016-07-28T01:01:22.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28333" PostTypeId="2" ParentId="12920" CreationDate="2016-07-28T07:30:56.217" Score="-2" Body="&lt;p&gt;[ (Current Value / Initial Value)^(365/n)-1 ] (n= no of days)&lt;/p&gt;&#xA;" OwnerUserId="22754" LastActivityDate="2016-07-28T07:30:56.217" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28335" PostTypeId="1" AcceptedAnswerId="28362" CreationDate="2016-07-28T08:59:42.653" Score="0" ViewCount="1668" Body="&lt;p&gt;I backtested an investment strategy over ten years (521 weeks to be specific) and calculated the weekly return using log returns. &#xA;The sum of all weekly returns added up to 145%. &#xA;How do I annualize this return? Is my assumption correct to simply calculate: &#xA;(145/521)*52 to get the annual return? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your help&lt;/p&gt;&#xA;" OwnerUserId="22755" LastActivityDate="2016-07-28T21:32:46.573" Title="Annualized Log Returns" Tags="&lt;log-returns&gt;&lt;annualized&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="28337" PostTypeId="2" ParentId="25442" CreationDate="2016-07-28T09:19:00.010" Score="6" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&quot;CSA discounting&quot; does not give you a lot of information: it just means the collateralisation of the trade follows the rules agreed upon between both parties in the Credit Support Annex. But you don't know what those rules are so you would not necessarily be discounting your transaction's cashflows at OIS. I have heard people use &quot;CSA discounting&quot; interchangeably with &quot;OIS discounting&quot; but it is because they assume a &lt;em&gt;perfect&lt;/em&gt; CSA.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&quot;OIS discounting&quot; means that you are able to discount the cashflows of the transaction using OIS. Typically this means that your CSA is &lt;em&gt;perfect&lt;/em&gt;, meaning both parties post cash (or cash-equivalent), daily, without thresholds or minimum transfer amount.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;However, there is still the question of the currency; what does &quot;OIS discounting&quot; for a cross-currency swap mean? Are you posting cash in (and discounting your xccy at the OIS of) the currency of leg 1 or leg 2? Market-standard swaps have conventions for this but it is not necessarily clear.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Note:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CSAs can be highly customised with the following parameters:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Instruments you can post (cash -&gt; which ccy?, gov bond, corp bond, ... ?)&lt;/li&gt;&#xA;&lt;li&gt;Is it two-way or one-way? (both parties post or just one?)&lt;/li&gt;&#xA;&lt;li&gt;How often do you post? (daily, weekly, monthly, ...?)&lt;/li&gt;&#xA;&lt;li&gt;Threshold: from what level of Mark-To-Market (PV) do you start posting?&lt;/li&gt;&#xA;&lt;li&gt;Minimum Transfer Amount: what is the minimum MTM move which would require collateral to be transferred between parties?&lt;/li&gt;&#xA;&lt;li&gt;Independent Amount: one party can be asked to post an initial margin from day 1 on top of everything else&lt;/li&gt;&#xA;&lt;li&gt;Optionality: do parties have the option to choose what they want to post through time?&lt;/li&gt;&#xA;&lt;li&gt;Structured CSA: e.g. capped total amount posted has become quite popular in the last few years, but you could complicate it further if you wanted to&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Custom CSAs are generally put in place to mitigate specific credit risks, including jump-to-default for example. They can also be found as legacy from a time when the pricing of all those parameters was believed to be negligible.&#xA;All of those will impact your pricing through CVA, FVA, DVA, CTDVA and capital charges.&lt;/p&gt;&#xA;" OwnerUserId="22726" LastActivityDate="2016-07-28T09:19:00.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28339" PostTypeId="2" ParentId="21033" CreationDate="2016-07-28T09:52:37.383" Score="1" Body="&lt;p&gt;I'm assuming that by &quot;retail trader&quot;, you mean that the limitations are: (1) broker with low account minimum balance requirement, and (2) software with low to zero license fees. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In that case, you could use the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;IB: &lt;a href=&quot;https://www.interactivebrokers.com/en/index.php?f=5041&quot; rel=&quot;nofollow&quot;&gt;Interactive Brokers API&lt;/a&gt;. Native support for Java, C# .NET and C++.&lt;/li&gt;&#xA;&lt;li&gt;Lightspeed: &lt;a href=&quot;https://www.lightspeedinstitutional.com/automated-trading/lightspeed-trader-api/&quot; rel=&quot;nofollow&quot;&gt;Lightspeed Trader API&lt;/a&gt;. Native support for C++.&lt;/li&gt;&#xA;&lt;li&gt;Broker-neutral: &lt;a href=&quot;http://www3.rithmic.com/?page_id=9&quot; rel=&quot;nofollow&quot;&gt;Rithmic R | API&lt;/a&gt;. Native support for C++ and C# .NET.&lt;/li&gt;&#xA;&lt;li&gt;Broker-neutral: &lt;a href=&quot;https://developer.tradingtechnologies.com/choose-api&quot; rel=&quot;nofollow&quot;&gt;TT X_TRADER Pro API/FIX Adapter&lt;/a&gt;. Native support for C# .NET.&lt;/li&gt;&#xA;&lt;li&gt;NinjaTrader Brokerage: &lt;a href=&quot;http://www.ninjatraderbrokerage.com/&quot; rel=&quot;nofollow&quot;&gt;NinjaTrader&lt;/a&gt;. Native support for C# .NET.&lt;/li&gt;&#xA;&lt;li&gt;Broker-neutral: &lt;a href=&quot;http://www.cqg.com/products/cqg-apis&quot; rel=&quot;nofollow&quot;&gt;CQG&lt;/a&gt;. Native support for managed C++ and C# .NET.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;All of the above expose a higher-level interface to live market data and order execution.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2016-07-28T09:52:37.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28341" PostTypeId="2" ParentId="19517" CreationDate="2016-07-28T10:20:23.857" Score="6" Body="&lt;p&gt;On aggregate, large shops like Virtu are involved in &lt;em&gt;market making&lt;/em&gt; strategies. There's various classes of market making strategies, and it is unnecessary to distinguish further here for the purpose of answering your question. For your curiosity however, Virtu is especially known for pure arb market making strategies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without diving into technical explanation, the easiest economic intuition to understand is that a market maker is acting as a price intermediator and looks to hold on to risk temporarily for their &quot;customers&quot; and to transfer risk to its natural sink. (Note: A market maker generally doesn't actually have a direct customer relationship but the market matches them to other participants in what amounts to a provider-client relationship effectively).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is significant volatility on a day like Aug 24, 2015, which means significant pricing uncertainty. If there is greater pricing uncertainty, you can guess that there is greater &quot;customer&quot; demand for price intermediation.  &lt;/p&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="4660" LastEditDate="2016-08-03T02:52:51.533" LastActivityDate="2016-08-03T02:52:51.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28342" PostTypeId="2" ParentId="10519" CreationDate="2016-07-28T10:31:18.630" Score="0" Body="&lt;p&gt;Nearly all HFT shops use FPGA architecture. These devices need to be replaced frequently as the quickly are outpaced by the latest improvements in speed, pipelines, parallelism, etc. Unless you are ready to invest $2M a year, figure out another strategy. Lot of guys doing daily price moves with pen and paper are making billions in Omaha, NB.&lt;/p&gt;&#xA;" OwnerUserId="22758" LastActivityDate="2016-07-28T10:31:18.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28343" PostTypeId="2" ParentId="22443" CreationDate="2016-07-28T11:02:50.153" Score="3" Body="&lt;p&gt;First of all, it seems that you are solely concerned about the Funding Valuation Adjustment (FVA) here, and not CVA; Sovereigns have credit risk which should also be valued here given they would not be posting any collateral as mitigant when the market moves in your favour. But let's focus on FVA:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is important to think about FVA (and all other VAs also) as the adjustment to a transaction's PV as the result of moving from one state/set of settings to another. Because dealers will typically hedge themselves in the inter-dealer market, the swaps they enter into to offset new client trades follow standard market conventions, assuming perfect cash CSA hence OIS discounting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically in your example, assuming you would hedge yourself in the open-market like a dealer would do, your FVA comes from the fact that, when the swap PV goes into your favour, you do not receive this value as collateral, but on your hedge, you need to post it anyway. Hence you would need to raise funds to be able to fulfil the collateral call on your hedge.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if your hedge is uncollateralised (unlikely to happen irl) then the FVA would result from you needing to post to the Sovereign when the MTM is negative for you but not receiving it on your hedge. I think this is the scenario you had in mind given your point 2.b)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming this latter scenario, the standard way to value the FVA cost is close to what you describe in 2.b), but not exactly; simulate the paths and calculate the cost of funding incurred for raising funds on the expected negative paths (i.e. Expected Negative Exposure, or ENE). You would calculate it based on your internal treasury's funding curve and probably take out this funding day 1 as a static hedge (as a strip of forward-starting borrowings). This is what you would need to add on top of the price of your uncollateralised hedge.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer 1., I don't think it is a good approximation, but it would depend on the nature of the swap, its maturity etc., and most importantly on what you would qualify as &lt;em&gt;good&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On 3. I see what you are saying but you need to be careful not to get mixed up between the legs of the swap (pay vs receive) and the sign of the MTM (value against or in your favour). The synthetic replication you mention does not seem correct as it is the net of the legs' cashflows which is discounted in a swap, and a one-way CSA does not mean that collateral will be posted on one leg's PV only, but on one side (positive or negative) of the net PV of both legs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&#xA;If you have a correlation built-in between your simulated market and funding cost, apply the latter to all the simulated negative paths and then average it, otherwise you can apply your funding spreads to the average of the negative paths.&lt;/p&gt;&#xA;" OwnerUserId="22726" LastEditorUserId="22726" LastEditDate="2016-07-28T11:09:55.520" LastActivityDate="2016-07-28T11:09:55.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28344" PostTypeId="1" CreationDate="2016-07-28T11:21:20.863" Score="0" ViewCount="674" Body="&lt;p&gt;I am recently getting more interested in Hidden Markov Models (HMM) and its application on financial assets to understand their behavior. But what captured my attention the most is the use of asset regimes as information to portfolio optimization problem.&lt;br&gt;&#xA;I am refering to this  &lt;a href=&quot;http://www.sandpointe.com/pdf/dynamic-asset-allocation-for-regime-switching-framework.pdf.pdf&quot; rel=&quot;nofollow&quot;&gt;article&lt;/a&gt;&lt;br&gt;&#xA;I searched in many sites  for the code to apply an asset allocation problem based on HMM estimations but I can't find ..&lt;br&gt;&#xA;I am extremely interesed ..I would be very grateful if you could provide me any code example that uses HMM to asset allocation problem.&lt;/p&gt;&#xA;" OwnerUserId="17810" LastEditorUserId="17810" LastEditDate="2016-07-28T13:22:40.597" LastActivityDate="2016-07-28T13:39:50.713" Title="Asset allocation problem using Hidden Markov Model" Tags="&lt;r&gt;&lt;optimization&gt;&lt;matlab&gt;&lt;asset-allocation&gt;&lt;hidden-markov-model&gt;" AnswerCount="2" CommentCount="10" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28345" PostTypeId="1" AcceptedAnswerId="28382" CreationDate="2016-07-28T11:52:25.710" Score="5" ViewCount="9567" Body="&lt;p&gt;I'm looking for a company or website that provides API access to historical options data. I would prefer a provider that has a python module to access the API. Any leads would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="22760" LastActivityDate="2016-07-29T19:03:57.910" Title="Where can I find API access to historical options data? Paid or free?" Tags="&lt;options&gt;&lt;historical-data&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28346" PostTypeId="2" ParentId="28344" CreationDate="2016-07-28T12:16:57.607" Score="1" Body="&lt;p&gt;I don't think you'll find anything. Why don't you contact the authors? They must have some code to generate the HMM simulations in the paper, maybe they can share the code with you? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have you checked the Supplementary Materials? Some papers have it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're really determined, you can implement a HMM model yourself. You'll need to supply the Markov transition model (included in the paper), then use the EM algorithm to fit a model. Python scikit-learn has a module for that.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2016-07-28T12:16:57.607" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="28347" PostTypeId="1" CreationDate="2016-07-28T12:27:31.177" Score="1" ViewCount="128" Body="&lt;p&gt;I have following exercise:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Kn91Y.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Kn91Y.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what I did:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA; C(K)&amp;amp;= e^{-r\tau} \mathbb{E}^\mathbb{Q}[((S_T - K)^+] \\&#xA;&amp;amp;= e^{-r\tau}\mathbb{E}^\mathbb{Q}[((S_T - K)\mathbb{1}_{S_T&amp;gt;K}] \\&#xA;&amp;amp;=e^{-r\tau}\mathbb{E}^\mathbb{Q}[S_T \mathbb{1}_{S_T&amp;gt;K}]-Ke^{-r\tau}\mathbb{E}^\mathbb{Q}[\mathbb{1}_{S_T&amp;gt;K}]&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;by$ \mathbb{1}$ I mean indicator function. Now I understand that&#xA;$$ \mathbb{E}^\mathbb{Q}[\mathbb{1}_{S_T&amp;gt;K}] = \mathbb{Q}(S_T&amp;gt;K) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;however I don't know how to deal with&#xA;$$\mathbb{E}^\mathbb{Q}[S_T \mathbb{1}_{S_T&amp;gt;K}]$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;is this the right way how to solve this exercise?&lt;/p&gt;&#xA;" OwnerUserId="22424" LastEditorUserId="16148" LastEditDate="2016-07-28T13:29:20.173" LastActivityDate="2016-07-28T13:29:20.173" Title="Exercise: interpretation of terms in black-scholes" Tags="&lt;black-scholes&gt;&lt;risk-neutral-measure&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28348" PostTypeId="2" ParentId="27447" CreationDate="2016-07-28T13:39:44.293" Score="3" Body="&lt;p&gt;Give or take, should be 6.50%.&#xA;I got this result by applying (5 * 5y swap - 2 * 2y swap) / (5 - 2).&#xA;Clearly this is not exact and I feel a bit ashamed to publish it on a quant forum. &lt;/p&gt;&#xA;" OwnerUserId="22691" LastActivityDate="2016-07-28T13:39:44.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28349" PostTypeId="2" ParentId="28344" CreationDate="2016-07-28T13:39:50.713" Score="3" Body="&lt;p&gt;The basic approach is as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you estimate the HMM you estimate three things:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;When you are in which state&lt;/li&gt;&#xA;&lt;li&gt;The drifts of your assets&lt;/li&gt;&#xA;&lt;li&gt;The covariance matrices of your assets&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You would then take 2. and 3. for each state (1.) and feed it into your favourite allocation optimizer to estimate your optimal portfolio for each state.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Voila!&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2016-07-28T13:39:50.713" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28350" PostTypeId="2" ParentId="22746" CreationDate="2016-07-28T13:53:22.793" Score="3" Body="&lt;p&gt;Which currency are you looking at ? &#xA;Say that your 1y swap would have yearly fixed payments vs 3M floating payments. &#xA;Your 1.5y swap would probably have:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a fixed payment 6m after effective date and another fixed payment 18m&#xA;after effective date&lt;/li&gt;&#xA;&lt;li&gt;regular quarterly floating payments&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Your curve was built with 1y and 2y swaps, nothing in the middle ? Then yes, your interpolation choice would matter a lot. I would look at 3m forward rates and make sure that they optically make sense.&lt;/p&gt;&#xA;" OwnerUserId="22691" LastActivityDate="2016-07-28T13:53:22.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28351" PostTypeId="2" ParentId="28235" CreationDate="2016-07-28T14:19:15.463" Score="1" Body="&lt;p&gt;You might want to refer to this blog page. I didn't know the swap method but what is described at this link seems a good approximation. Of course you will need quite a lot of inputs. The problem of the libor that has already fixed is treated too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://alluve.wordpress.com/2010/04/10/cva-calculation-example/&quot; rel=&quot;nofollow&quot;&gt;https://alluve.wordpress.com/2010/04/10/cva-calculation-example/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="22691" LastActivityDate="2016-07-28T14:19:15.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28352" PostTypeId="1" CreationDate="2016-07-28T14:58:52.703" Score="5" ViewCount="2941" Body="&lt;p&gt;In Steven Shreve's book &quot;Stochastic Calculus for Finance 2&quot;, Definition 5.4.8 says a market is complete if every derivative security can be hedged. What exactly does every derivative security mean? The book up to Ch.5 has only considered European options. But in the proof of Theorem 5.4.9, it constructs a derivative security whose payoff $V(T)$ is path dependent. It looks like this is a case for American option. Is it that every payoff $V(T)$ which is a measurable function in $\mathcal{F}(T)$ is a derivative security, and every derivative security can be defined in such a way?&lt;/p&gt;&#xA;" OwnerUserId="22690" LastActivityDate="2019-01-07T21:59:05.200" Title="About the definition of a complete market" Tags="&lt;stochastic-processes&gt;&lt;risk-neutral-measure&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28354" PostTypeId="2" ParentId="28331" CreationDate="2016-07-28T15:31:01.560" Score="2" Body="&lt;p&gt;As an example:   6 month libor is typically higher than 3 month libor because of the extra credit risk in lending to banks for an additional 3 months.  Derivatives on 6 month libor have to take this into account.  For example, a 5yr basis swap exists where 6 month libor can be swapped for 3 month libor plus a spread.  Credit modeling techniques would need to be applied to model the term structure of this spread, and other tenor spreads. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your example, 1 year libor is higher than the 1 year swap rate because the latter is equivalent to a chain of four 3 month Libors, so has less credit risk.  Note that we are talking about the credit risk of the underlying rate index, not of the swap itself which is negligible. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;10 year swaps being below 10 year Treasuries is mostly explained by the current regulatory environment, as you suggest.  Specifically, the cost of holding assets such as Treasuries on balance sheet.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastEditorUserId="20465" LastEditDate="2016-07-29T08:48:38.407" LastActivityDate="2016-07-29T08:48:38.407" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28355" PostTypeId="2" ParentId="28352" CreationDate="2016-07-28T15:40:19.130" Score="4" Body="&lt;p&gt;The best way to understand is to go back to one-period binomial option pricing. This is also discussed in Shreve's: &quot;Stochastic Calculus for Finance 1&quot; book.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's a nice article on one-period binomial option pricing &lt;a href=&quot;http://www.investopedia.com/articles/investing/021215/examples-understand-binomial-option-pricing-model.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;. You will need to understand:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Although there are infinite ways to assign a one-period probability, there is a &lt;strong&gt;unique&lt;/strong&gt; solution to the risk-neutral probability. Anything else is not a risk-neutral probability.&lt;/li&gt;&#xA;&lt;li&gt;If we have the unique risk-neutral probability, we know there won't be  arbitrage opportunity.&lt;/li&gt;&#xA;&lt;li&gt;If we know there won't be arbitrage opportunity, we know we can hedge (or replicate) any payoff.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As you can see, they are linked. If you can't hedge something, there is no risk-neutral probability, and there is arbitrage. Furthermore, if there is arbitrage you can't really price the option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, let's go back to your question. Recall continuous option pricing is really just infinite one-period binomial trees. We don't talk about discrete probability anymore, we use now use the term &lt;strong&gt;probability measure&lt;/strong&gt; (e.g. risk neutral probability measure).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Complete model basically means everything we just said:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It is a complete model if we can hedge (replicate) everything&lt;/li&gt;&#xA;&lt;li&gt;If we can hedge everything, there is an unique risk-neutral probability (Second fundamental theorem - Theorem 5.4.9 in the book)&lt;/li&gt;&#xA;&lt;li&gt;If we have a unique risk-neutral probability, there is no arbitrage (First fundamental theorem of asset pricing - Theorem 5.4.7 in the book)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Shreve then talks about Radon-Nikodym derivative, which is just a way to relate the real and risk-neutral measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, when the book says &quot;complete market&quot;, it means a perfect market where all risk factors can be hedged perfectly, no transaction costs, no surprise, we can price an option (Black-Scholes), and it's fake (our market is &lt;strong&gt;not&lt;/strong&gt; complete).&lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="601" LastEditDate="2019-01-07T21:59:05.200" LastActivityDate="2019-01-07T21:59:05.200" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="28356" PostTypeId="2" ParentId="25616" CreationDate="2016-07-28T15:49:39.523" Score="6" Body="&lt;p&gt;In #2, you can use FX forwards to convert your JPY cashflows to USD but it is more common in practice to use a cross-currency swap for this purpose. Indeed, the advantage of the latter is that it allows you to keep the nominal of your synthetic USD bond constant because the final exchange in the swap is done at FX spot (not forward), and the difference is made up with higher or lower coupons. This way you can use simple yield calculation methods on the synthetic USD bond without issues.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the real issue with #2 is that the USDJPY FX Forwards you apply to the JPY cashflows should be defaultable in order to fairly price the equivalent USD amount; if the bond defaults, the remaining JPY cashflows will not be paid and therefore you want your USDJPY forwards you entered into on day 1 to be cancelled, otherwise you will be asked to deliver a JPY amount which you are not receiving from the bond anymore.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The pricing impact comes from the FX-credit correlation. If a Japanese corporate defaults, chances are the Japanese economy is in trouble which should devalue JPY vs USD. This correlation is priced in the quanto CDS market; how much cheaper is a credit protection which pays in the local currency of the entity whose default you are protecting against, compared to a protection which pays you in a hard currency like USD?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using defaultable FX forwards is the only way this method could make sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, let's take a step back and evaluate your main question: as a USD investor with JPY bonds on my broker account, the price of my bond fluctuates everyday and so does the USDJPY FX. My daily P&amp;amp;L in USD would depend on those two elements. This is what you describe in #1 and I don't see why you would need anything else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the question is, how do I protect myself against the USDJPY movement, or how do I replicate such a bond, then you can start exploring cross-currency swaps (defaultable for fair pricing) or look at the corporate CDS as a proxy for the bond's Z-spread. On the latter note, as others pointed out, the CDS-bond basis will have an impact.&lt;/p&gt;&#xA;" OwnerUserId="22726" LastActivityDate="2016-07-28T15:49:39.523" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28358" PostTypeId="1" AcceptedAnswerId="28359" CreationDate="2016-07-28T17:32:03.883" Score="0" ViewCount="289" Body="&lt;p&gt;Guys I would like a simple clarification. The paper by &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1002/for.1222/abstract&quot; rel=&quot;nofollow&quot;&gt;McMillan and Speight (2012)&lt;/a&gt; at the data section, defines the logarithmic price as the midpoint of the logarithmic bid and ask. Is that translates to [log(BID)+log(ASK)] / 2 or as log (BID-ASK) ? Thank you very much.&lt;/p&gt;&#xA;" OwnerUserId="22154" LastActivityDate="2016-07-28T17:54:55.863" Title="Logarithmic price defined as the midpoint of the log bid and ask : Simple Clarification" Tags="&lt;quantitative&gt;&lt;quote&gt;&lt;bid&gt;&lt;ask&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28359" PostTypeId="2" ParentId="28358" CreationDate="2016-07-28T17:54:55.863" Score="3" Body="&lt;p&gt;I reckon it's the $\frac{log(ASK)+log(BID)}{2}$, just simple arithmetic average as it makes sense, also considering logarithmic returns, when you can only take a differences from log prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, the second alternative would yield negative 'prices' for spreads lower than 1, which cannot serve as a 'price' indicator.&lt;/p&gt;&#xA;" OwnerUserId="22237" LastActivityDate="2016-07-28T17:54:55.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28360" PostTypeId="2" ParentId="28330" CreationDate="2016-07-28T18:37:55.700" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;We consider the expectation &#xA;  \begin{align*}&#xA;E^{Q_d^{t_f}} \Big(P_d(t_f, T) X_{t_f} \mid \mathcal{F}_t \Big),&#xA;\end{align*}&#xA;  where $Q_d^{t_f}$ is the $t_f$-forward measure, and $P_d(t_f, T)$ is the price at $t_f$ of a domestic zero-coupon bond with maturity $T$. Note that $P_d(t_f, T) X_{t_f}$ is the value at time $t_f$ of the process&#xA;  \begin{align*}&#xA;P_d(t, T) X_t \frac{P_f(t, t_f)}{P_d(t, t_f)},&#xA;\end{align*}&#xA;  where $P_f(t, t_f)$ is the price at $t$ of a foreign zero-coupon bond with maturity $t_f$. If we model the bond prices directly, then we need dynamics for the four processes $X_t$, $P_d(t, t_f)$, $P_d(t, T)$, and $P_f(t, t_f)$. For simplicity, we model the short rates based on the Hull-White interest rate model with corresponding correlated dynamics for $X_t$, $r_t^f$, and $r_t^d$.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Let $X_t$ be the instantaneous exchange rate from one unit foreign currency to units of domestic currency, and&#xA;$r^d_t$ and $r^f_t$ be the domestic and the equity's denominated foreign short interest rates at time $t$.&#xA;Moreover, let &#xA;\begin{align*}&#xA;\Xi= (\rho_{i, j})_{i,j=1}^3&#xA;\end{align*}&#xA;be the correlation matrix of the driving Brownian motions of the 3$-$dimensional random process $\{(X_t, r^f_t, r^d_t),\, t \geq 0\}$, and let&#xA;$$&#xA;LL^T = \Xi,&#xA;$$&#xA;where $L=(l_{i,j})_{i,j=1}^3$ is a lower triangular matrix and $l_{i, i} &amp;gt;0$, for $i=1, \ldots, 3$, be the Cholesky decomposition of $\Xi$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We assume that, under the domestic risk-neutral probability measure $Q_d$,&#xA;\begin{align*}&#xA;dX_t &amp;amp;= X_t\Big[\big(r^d_t - r^f_t\big) dt + \sigma^X dW_t^1\Big], \\&#xA;dr^f_t &amp;amp;= \Big[\big( \theta_t^f - \lambda^f r_t^f \big) - \rho_{2, 1}\sigma^f \sigma^X\, \Big] dt + \sigma^f&#xA;\sum_{i=1}^2 l_{2, i} d W_t^i,\\&#xA;dr^d_t &amp;amp;= \big( \theta_t^d - \lambda^d r_t^d \big) dt + \sigma^d\sum_{i=1}^3 l_{3, i} d W_t^i,&#xA;\end{align*}&#xA;where $\{W_t^1,\, t \ge 0\}, \ldots, \{W_t^3,\, t \ge 0\}$ are independent standard Brownian motions, $\theta_{t}^{a},$ are piece-wise constant functions, and $\lambda^{a}$ and $\sigma^{a}$ are positive&#xA;constant, for $a=X$, $d$, or $f$. Here, $\lambda^d$ and $\lambda^f$ are the mean-reverting speed of the respective dynamic processes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that, under the foreign risk-neutral probability measure $Q_f$,&#xA;$\{\widehat{W}_t^1= W_t^1-\sigma^X t,\, t \ge 0\}$, $\{\widehat{W}_t^2=W_t^2,\, t \ge 0\}$, and $\{\widehat{W}_t^3=W_t^3,\, t \ge 0\}$ are independent standard Brownian motions. Moreover,&#xA;\begin{align*}&#xA;dX_t &amp;amp;= X_t\Big[\left(r^d_t - r^f_t + (\sigma^X)^2\right) dt + \sigma^X d\widehat{W}_t^1\Big], \\&#xA;dr^f_t &amp;amp;= \big( \theta_t^f - \lambda^f r_t^f \big) dt + \sigma_t^f&#xA;\sum_{i=1}^2 l_{2, i} d \widehat{W}_t^i,\\&#xA;dr^d_t &amp;amp;= \Big[\big( \theta_t^d - \lambda^d r_t^d \big) + \rho_{3, 1}\sigma^d \sigma^X\,\Big] dt + \sigma^d\sum_{i=1}^3 l_{3, i} d \widehat{W}_t^i.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $P_d(t, T)$ and $P_f(t, T)$ denote the prices, at time $t$, of the domestic and foreign zero-coupon bonds with maturity $T$. From &lt;a href=&quot;https://quant.stackexchange.com/questions/21513/extended-hull-white-interest-rate-model-for-zero-coupon-bond&quot;&gt;this question&lt;/a&gt;, &#xA;\begin{align*}&#xA;P_a(t, T) &amp;amp;= e^{A_a(t, T) - B_a(t, T) r_t^a},&#xA;\end{align*}&#xA;for $a=d$ or $f$, where &#xA;\begin{align*}&#xA;\beta_a(t, T) &amp;amp;= \frac{1}{\lambda^a}\left(1-e^{-\lambda^a (T-t)} \right),\\&#xA;A_a(t, T) &amp;amp;= -\int_t^T \theta_s^a\beta_a(s, T) ds - \frac{(\sigma^a)^2}{2(\lambda^a)^2}(\beta_a(t, T)-T+t) - \frac{(\sigma^a)^2}{4\lambda^a}\beta_a(t, T)^2.&#xA;\end{align*}&#xA;Then, under the domestic risk-neutral measure,&#xA;\begin{align*}&#xA;\frac{dP_d(t, T)}{P_d(t, T)} &amp;amp;= r_t^d dt - \beta_d(t, T)\sigma^d \sum_{i=1}^3 l_{3, i} d W_t^i,\\&#xA;\frac{dP_f(t, T)}{P_f(t, T)} &amp;amp;= r_t^f dt - \beta_f(t, T)\sigma^f \sum_{i=1}^2 l_{2, i} d \widehat{W}_t^i\\&#xA;&amp;amp;=\left(r_t^f + \rho_{2,1}\beta_f(t, T)\sigma^f \sigma^X \right)dt - \beta_f(t, T)\sigma^f \sum_{i=1}^2 l_{2, i} d W_t^i.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $Q_d^{t_f}$ be the domestic $t_f$-forward measure. Moreover, let $B_d(t)=e^{\int_0^t r_s^d ds}$ be the domestic money market account value at time $t$. Then,&#xA;\begin{align*}&#xA;\frac{dQ_d^{t_f}}{dQ_d}\big|_t &amp;amp;= \frac{P_d(t, t_f)}{P_d(0, t_f) B_d(t)}\\&#xA;&amp;amp;=\exp\left(-\frac{1}{2}\int_0^t (\sigma^d \beta_d(s, t_f))^2ds  - \int_0^t\sigma^d \beta_d(s, t_f) \sum_{i=1}^3 l_{3, i} d W_s^i\right).&#xA;\end{align*}&#xA;Then, $\{\widetilde{W}_t^1,\, 0 \le t \le t_f\}$, $\{\widetilde{W}_t^2,\, 0 \le t \le t_f\}$, and $\{\widetilde{W}_t^3,\, 0 \le t \le t_f\}$, where, for $i=1, \ldots, 3,$&#xA;\begin{align*}&#xA;\widetilde{W}_t^i = W_t^i + \int_0^t l_{3, i} \sigma^d\beta_d(u, t_f) du,&#xA;\end{align*}&#xA;are independent standard Brownian motions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $F_X(t, t_f)=X_t\frac{P_f(t, t_f)}{P_d(t, t_f)}$ be the forward exchange rate at time $t$ for maturity $t_f$. Then,&#xA;\begin{align*}&#xA;\frac{dF_X(t, t_f)}{F_X(t, t_f)} = \sigma^X d\widetilde{W}_t^1 + \beta_d(t, t_f)\sigma^d \sum_{i=1}^3 l_{3, i} d \widetilde{W}_t^i- \beta_f(t, t_f)\sigma^f \sum_{i=1}^2 l_{2, i} d \widetilde{W}_t^i.&#xA;\end{align*}&#xA;Moreover, let&#xA;\begin{align*}&#xA;M(t, t_f) &amp;amp;= -\frac{1}{2}\int_t^{t_f} \bigg((\sigma^X)^2 + (\beta_d(u, t_f)\sigma^d)^2 + (\beta_f(u, t_f)\sigma^f)^2\\&#xA;&amp;amp;\quad  + 2 \rho_{1, 3}\sigma^X \sigma^d\beta_d(u, t_f)- 2 \rho_{1, 2}\sigma^X \sigma^f\beta_f(u, t_f) - 2 \rho_{2, 3}\sigma^d \sigma^f \beta_d(u, t_f)\beta_f(u, t_f)\bigg) du.&#xA;\end{align*}&#xA;Then, &#xA;\begin{align*}&#xA;X_{t_f} &amp;amp;= F_X(t_f, t_f)\\&#xA;&amp;amp;=F_X(t, t_f) \exp\bigg(M(t, t_f) \\&#xA;&amp;amp;\quad + \int_t^{t_f} \Big( \sigma^X d\widetilde{W}_u^1 + \beta_d(u, t_f)\sigma^d \sum_{i=1}^3 l_{3, i} d \widetilde{W}_u^i- \beta_f(u, t_f)\sigma^f \sum_{i=1}^2 l_{2, i} d \widetilde{W}_u^i\Big)\bigg).&#xA;\end{align*}&#xA;Furthermore, let&#xA;\begin{align*}&#xA;N(t, t_f) &amp;amp;= e^{-\lambda^d (t_f-t)} r_t + \int_t^{t_f} \theta_u^d e^{-\lambda^d(t_f-u)} du -\int_t^{t_f}(\sigma^d)^2 e^{-\lambda^d(t_f-u)}\beta_d(u, t_f) du.&#xA;\end{align*}&#xA;Then, &#xA;\begin{align*}&#xA;r_{t_f}^d &amp;amp;= e^{-\lambda^d (t_f-t)} r_t + \int_t^{t_f} \theta_u^d e^{-\lambda^d(t_f-u)} du + \int_t^{t_f} \sigma^d e^{-\lambda^d(t_f-u)} \sum_{i=1}^3 l_{3, i} d W_u^i\\&#xA;&amp;amp;= N(t, t_f)+ \int_t^{t_f} \sigma^d e^{-\lambda^d(t_f-u)} \sum_{i=1}^3 l_{3, i} d \widetilde{W}_u^i.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;P_d(t_f, T) X_{t_f} &amp;amp;= \exp\bigg(A_d(t_f, T) - B_d(t_f, T) r_{t_f}^d \bigg)X_{t_f}\\&#xA;&amp;amp;= F_X(t, t_f) \exp\bigg(A_d(t_f, T) - B_d(t_f, T)N(t, t_f) + M(t, t_f)\\&#xA;&amp;amp;\quad - B_d(t_f, T) \int_t^{t_f} \sigma^d e^{-\lambda^d(t_f-u)}  \sum_{i=1}^3 l_{3, i} d \widetilde{W}_u^i \\&#xA;&amp;amp;\quad + \int_t^{t_f} \Big( \sigma^X d\widetilde{W}_u^1 + \beta_d(u, t_f)\sigma^d \sum_{i=1}^3 l_{3, i} d \widetilde{W}_u^i- \beta_f(u, t_f)\sigma^f \sum_{i=1}^2 l_{2, i} d \widetilde{W}_u^i\Big) \bigg).&#xA;\end{align*}&#xA;Let &#xA;\begin{align*}&#xA;V(t, t_f, T) &amp;amp;= \int_t^{t_f} \bigg((\sigma^X)^2 + \Big(\beta_d(u, t_f)\sigma^d - B_d(t_f, T)\sigma^d e^{-\lambda^d(t_f-u)} \Big)^2 + (\beta_f(u, t_f)\sigma^f)^2\\&#xA;&amp;amp;\quad  + 2 \rho_{1, 3}\sigma^X \Big(\beta_d(u, t_f)\sigma^d - B_d(t_f, T)\sigma^d e^{-\lambda^d(t_f-u)} \Big)- 2 \rho_{1, 2}\sigma^X \sigma^f\beta_f(u, t_f) \\&#xA;&amp;amp;\quad - 2 \rho_{2, 3}\sigma^f \beta_f(u, t_f)\Big(\beta_d(u, t_f)\sigma^d - B_d(t_f, T)\sigma^d e^{-\lambda^d(t_f-u)} \Big)\bigg) du\\&#xA;&amp;amp;= -2M(t, t_f) +  B_d(t_f, T)\int_t^{t_f}\bigg[ B_d(t_f, T)\Big( \sigma^d e^{-\lambda^d(t_f-u)} \Big)^2 \\&#xA;&amp;amp;\qquad\qquad\qquad\qquad\qquad\qquad - 2 (\sigma^d)^2\beta_d(u, t_f)e^{-\lambda^d(t_f-u)} -2 \rho_{1, 3}\sigma^X \sigma^d e^{-\lambda^d(t_f-u)}\\&#xA;&amp;amp;\qquad\qquad\qquad\qquad\qquad\qquad +2 \rho_{2, 3}\sigma^d \sigma^f \beta_f(u, t_f) e^{-\lambda^d(t_f-u)} \bigg]du.&#xA;\end{align*}&#xA;Moreover, let&#xA;\begin{align*}&#xA;V_0(t, t_f, T) &amp;amp;=B_d(t_f, T)\int_t^{t_f}\bigg[ B_d(t_f, T)\Big( \sigma^d e^{-\lambda^d(t_f-u)} \Big)^2 \\&#xA;&amp;amp;\qquad\qquad\qquad\qquad - 2 (\sigma^d)^2\beta_d(u, t_f)e^{-\lambda^d(t_f-u)} -2 \rho_{1, 3}\sigma^X \sigma^d e^{-\lambda^d(t_f-u)} \\&#xA;&amp;amp;\qquad\qquad\qquad\qquad +2 \rho_{2, 3}\sigma^d \sigma^f \beta_f(u, t_f) e^{-\lambda^d(t_f-u)} \bigg]du.&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;&amp;amp;\ E^{Q_d^{t_f}} \Big(P_d(t_f, T) X_{t_f} \mid \mathcal{F}_t \Big) \\&#xA;=&amp;amp;\ F_X(t, t_f) \exp\bigg(A_d(t_f, T) - B_d(t_f, T)N(t, t_f) + M(t, t_f) +\frac{1}{2} V(t, t_f, T) \bigg)\\&#xA;=&amp;amp;\ F_X(t, t_f) \exp\bigg(A_d(t_f, T) - B_d(t_f, T)N(t, t_f) + \frac{1}{2} V_0(t, t_f, T) \bigg).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-07-29T14:56:57.887" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="28361" PostTypeId="1" CreationDate="2016-07-28T21:10:59.100" Score="0" ViewCount="175" Body="&lt;p&gt;Now I'm updating typical equity premium of CAPM and Fama French 3 factors. As you know, some of interest rates are already in negative. To calculate market factors, not so hard to apply them as risk free rate practically. however i wonder if it is no matter that negative risk free rates are applied from the academic perspective. Are there any white papers about this topic? i wanna check the discussion about negative risk free rate.&lt;/p&gt;&#xA;" OwnerUserId="22750" LastActivityDate="2016-09-01T02:26:42.487" Title="Discussion about negative interest rate" Tags="&lt;risk-free&gt;&lt;negative&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28362" PostTypeId="2" ParentId="28335" CreationDate="2016-07-28T21:32:46.573" Score="0" Body="&lt;p&gt;Is it bonds or stocks? If there is no compounding, then I think it should be correct your way. Also if its log returns, you need to sum them and take expectation of them. That will give you the usual 1+R return. As in if you went from 100 to 105, you get 1.05.&lt;/p&gt;&#xA;" OwnerUserId="22237" LastActivityDate="2016-07-28T21:32:46.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28363" PostTypeId="1" CreationDate="2016-07-29T05:45:13.657" Score="0" ViewCount="632" Body="&lt;p&gt;I understand the concept of bootstrapping and building the curve when we have the values for first few maturities. However, I can't quite get how the initial values for zero curve rates are derived from tradable instruments. As I understand, these values are directly implied from OIS par rates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone please clarify, how, given, say a 1M OIS swap bid and ask, can I get the zero curve point at 1M maturity?&lt;/p&gt;&#xA;" OwnerUserId="5086" LastActivityDate="2016-11-29T04:56:11.603" Title="Starting short-end OIS zero curve building" Tags="&lt;interest-rate-swap&gt;&lt;ois-discounting&gt;&lt;ois&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28364" PostTypeId="1" CreationDate="2016-07-28T18:33:44.543" Score="1" ViewCount="6334" Body="&lt;p&gt;I have a list of investments with their expected IRR(Internal Rate of Return). I'm confused about which is the right metric to depict for my population: IRR of IRR or weighted average of IRR. It's tough to understand which is needed when. Can someone help? I'm not even sure what to term the IRR of all my individual IRRs? &lt;/p&gt;&#xA;" OwnerUserId="22779" OwnerDisplayName="Balamurugan P" LastEditorUserId="13571" LastEditDate="2016-07-29T23:45:00.857" LastActivityDate="2016-07-29T23:45:00.857" Title="IRR of IRR or weighted average of IRR" Tags="&lt;risk&gt;&lt;returns&gt;&lt;risk-neutral-measure&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28365" PostTypeId="1" CreationDate="2016-07-29T08:15:35.957" Score="1" ViewCount="441" Body="&lt;p&gt;I found the following example in a book on Model Risk, while trying to explain how risk-neutral pricing takes properly into account the risk involved in different investments.&#xA;The Example is this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose you have a riskless asset ( a bond, say) promising you a riskless return of 50%. So, take a risk free interest rate $r=0.5$. Then, you have a security, which, under the actual probability measure can go up with probability $p=0.5$ and make a return of $125\%$, or can go down (with probability $q=0.5$) yielding a return of $-25\%$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under the actual probability the expected return of the security is then equal to $\frac{1}{2}125\%-\frac{1}{2}25\%=50\%$. On the other hand, this is the same return promised by the bond, so the two investments produce the same expected return (using the actual probability measure, that is).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The book goes on to say that, however, the two investments are not the same because in the security's case it is present a risk that is not present in the bond case and, unless you are a special investor, you will prefer the riskless bond yielding the same expected return. That is the reason why, the book adds, you need to introduce a different measure than the actual one, the risk-neutral measure, that takes into account the presence of risk in the investments, and you shall take the expectation of the return of the risky asset with respect to this measure, and not the actual measure, in order to compare this investment to the riskless investment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now all this makes perfect sense to me, however, if I understand well, the book implies that the two investments are not the same &lt;em&gt;because in the risk neutral measure&lt;/em&gt; the expected return of the risky asset shall be &lt;em&gt;less&lt;/em&gt; than the $50\%$ arising from the actual probability. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, after some calculation, I realised that this is not the case: it appears that the risk-neutral probabilities $\tilde{p}, \tilde{q}$ in this case are &lt;em&gt;the same&lt;/em&gt; as the actual probabilities postulated by the example, that is: $\tilde{p}=\tilde{q}=\frac{1}{2}$, as it is easy to see by letting $r=0.5$, $d=0.75$ and $u=2.25$, and applying the well-known equations for the one-period model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, in fact one obtains that the risky asset has the same return as the bond (i.e., $50\%$) &lt;em&gt;also&lt;/em&gt; under the risk-neutral probability. Therefore, I have two questions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) Am I right to claim that, from the risk-neutral perspective, the two investments are &lt;em&gt;actually equivalent&lt;/em&gt; (contrary to what the book seems to claim)? Or am I missing something?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) Is the above example ill-chosen to illustrate the motivation behind risk-neutrality? &lt;/p&gt;&#xA;" OwnerUserId="11960" LastActivityDate="2016-07-29T08:15:35.957" Title="Risk neutral pricing - Example from a book is correct?" Tags="&lt;pricing&gt;&lt;risk-neutral-measure&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="28366" PostTypeId="2" ParentId="28352" CreationDate="2016-07-29T08:54:03.480" Score="-1" Body="&lt;p&gt;The precise definition of a derivative security, in the framework used by Shreve is the following: let $S(t)$ denote a security or a family of securities (in the multidimensional market model, that is $S(t) = (S_1(t), \cdots, S_n(t))$. Then a &lt;em&gt;derivative security&lt;/em&gt; is determined at time $T$ by the condition of having a payoff $V(T)$, which can be expressed as $V(T)=g(S(T))$, with $g$ an $\mathcal{F}(T)$-measurable function. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the mathematically correct definition, so that in particular for a European call option with strike $K$ you have $g(x)=(x-K)^+$, and so on. Now, look at the proof of Theorem 5.4.9. in this case you have a payoff defined as $V(T)=\mathbf{1}_A\cdot (D(T))^{-1}$. In this case the security $S(T)$ is just $D(T)$, and $g(x)$ is measurable because $A$ is clearly an $\mathcal{F}(T)$-measurable set. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, you're right that Shreve never explictly defines in the book what he precisely means by &quot;derivative security&quot;.&lt;/p&gt;&#xA;" OwnerUserId="11960" LastEditorUserId="11960" LastEditDate="2016-07-29T09:14:01.673" LastActivityDate="2016-07-29T09:14:01.673" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28367" PostTypeId="1" CreationDate="2016-07-29T09:20:39.907" Score="1" ViewCount="25" Body="&lt;p&gt;What are commonly used price movement color schemes?&#xA;Like &#xA;American: up - green, down - red&#xA;European: up - blue, down - red&#xA;Asian 1: up - red, down - green&#xA;Asian 2: up - blue, down - red&#xA;Are these rules correct?&lt;/p&gt;&#xA;" OwnerUserId="19839" LastActivityDate="2016-07-29T09:20:39.907" Title="What are commonly used price movement color schemes?" Tags="&lt;price&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28368" PostTypeId="1" AcceptedAnswerId="28390" CreationDate="2016-07-29T10:45:42.713" Score="2" ViewCount="951" Body="&lt;p&gt;I have a pool of (mortgage) assets that pay cashflows as below. How could I correctly calculate the duration? Does it have a meaning in the sense of a vanilla/callable bond as the measure of price sensitivity?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Year  CF&lt;/p&gt;&#xA;&#xA;&lt;p&gt;0     1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1     25&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2     25&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3     0&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4     0&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5     -5&lt;/p&gt;&#xA;&#xA;&lt;p&gt;6     0&lt;/p&gt;&#xA;&#xA;&lt;p&gt;7     -5&lt;/p&gt;&#xA;&#xA;&lt;p&gt;8     5&lt;/p&gt;&#xA;" OwnerUserId="21023" LastEditorUserId="16148" LastEditDate="2016-07-29T18:57:08.857" LastActivityDate="2016-07-30T16:17:09.543" Title="Duration calculation with negative cashflows" Tags="&lt;bond&gt;&lt;duration&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28370" PostTypeId="1" CreationDate="2016-07-29T11:03:05.447" Score="1" ViewCount="541" Body="&lt;p&gt;this is a question from a quant interview (FO quant for IR Exotics for a big 4). First it might be useful when preparing your interviews, second, any brainstorming will be appreciated. Note that no more information other than the below was given.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us consider the following SDE:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS_t = \sigma(S_t) dW_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_0 = S(0)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We are after $P = E(phi(S_1))$, the expectation of $phi(S_1)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sigma and phi are some arbitrary functions, W is a Brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Describe two algorithms that would (approximatively) compute P. One algorithm is a stochastic approach, the other one is a partial differential equation approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Code it (in C++ or Java).&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;My answer:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;1.Simulate the underlying $S_i$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2.Get the $\sigma_i$ using some assumption on the functional form of $\sigma(S_t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3.Assume some distribution for the function PHI (for example that is normal) and get the price using the Moment Generating Function of the Normal -i.e. $E(e^X) = e^{\mu+\frac{1}{2}\sigma}$&lt;/p&gt;&#xA;" OwnerUserId="22776" LastActivityDate="2016-07-29T11:03:05.447" Title="Stochastic Vol simulation - Quant job interview question" Tags="&lt;programming&gt;&lt;simulations&gt;&lt;stochastic-volatility&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28371" PostTypeId="1" AcceptedAnswerId="28372" CreationDate="2016-07-29T12:44:33.343" Score="4" ViewCount="751" Body="&lt;p&gt;Im working on market reaction to events and I'm using the co-variance matrix to do this. In &lt;a href=&quot;http://www.computing.dcu.ie/~mcrane/Physica%20A_paper_Adelsharkasi.pdf&quot; rel=&quot;nofollow&quot;&gt;this paper&lt;/a&gt; the author writes&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;It has been known for some time that the largest eigenvalue (λ1) contains information on the risk associated with the particular assets of which the co-variance matrix is comprised.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However, there's no reference for this and I haven't found anything that backs up his point because eigenvalues are used for many other things.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I want to know is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;How do we know that the first eigenvalue contains the most information?&lt;/li&gt;&#xA;&lt;li&gt;Where can I get more to read on this topic?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="22773" LastActivityDate="2016-07-29T13:09:24.120" Title="Interpreting Eigenvalues of Co-variance Matrix" Tags="&lt;statistics&gt;&lt;pca&gt;&lt;covariance-matrix&gt;&lt;eigenvalue&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28372" PostTypeId="2" ParentId="28371" CreationDate="2016-07-29T13:03:19.463" Score="6" Body="&lt;p&gt;What you basically do here is a &lt;a href=&quot;https://en.wikipedia.org/wiki/Principal_component_analysis#Computing_PCA_using_the_covariance_method&quot; rel=&quot;noreferrer&quot;&gt;Principal Component Analysis (PCA)&lt;/a&gt;. A good starting point in the financial sphere is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1358533&quot; rel=&quot;noreferrer&quot;&gt;Managing Diversification by Attilio Meucci (2010)&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Page 3:&lt;br&gt;&#xA;&quot;The most natural choice of uncorrelated risk sources is provided by the&#xA;principal component decomposition of the returns covariance [...] The eigenvectors define a set of N uncorrelated portfolios, the principal portfolios [...] are decreasingly responsible for the randomness in the market. Indeed, the&#xA;eigenvalues correspond to the variances of these uncorrelated portfolios.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On page 4, Figure 1 comes a geometric interpretation which should make things intuitive:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/gQrKY.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/gQrKY.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NB: Risk is also defined as volatility here! (as often in finance)&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2016-07-29T13:09:24.120" LastActivityDate="2016-07-29T13:09:24.120" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28373" PostTypeId="1" CreationDate="2016-07-29T13:41:52.153" Score="1" ViewCount="44" Body="&lt;p&gt;Does anyone publish future expectations on any decent interval? Someone like, I dont know, Fidelity or BlackRock or Goldman or someone? What I am looking for is a historical time series of future expectations over the coming decade/year/quarter broken up by asset class or market. Kind of like the following (these are just junk numbers, and random asset classes/classifications):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;            US Equities    IG Debt Emerg Mkts        Alts      Commod&#xA;2010-01-01 -0.562717500 -0.6067040 -1.1361507 -1.00982199  1.98093338&#xA;2011-01-01  1.368597855 -0.4130927 -0.4937642 -0.80985096  0.90505591&#xA;2012-01-01  1.337929407  0.5083512  0.1336754  0.92828093 -0.28171892&#xA;2013-01-01  0.201993831  0.6160652  1.5035705 -1.04733665 -0.57603410&#xA;2014-01-01  0.002473048 -0.2077556 -1.0995428 -0.57457520 -0.88669179&#xA;2015-01-01 -0.819709898  0.6034144 -1.1489759 -0.08771504 -0.07681634&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Again, to be clear, these would be what they expected for the coming year. E.g. - at the beginning of the year in 2010, whomever expected US Equities to return 56%, and investment grade debt to lose 60%, etc. (I know that's ridiculous, work with me.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this make sense? Anyone know of any resources? (Preferably, FREE!)&lt;/p&gt;&#xA;" OwnerUserId="20494" LastActivityDate="2016-07-29T14:04:40.657" Title="Anyone know where I can get some expected returns?" Tags="&lt;historical-data&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28374" PostTypeId="2" ParentId="28364" CreationDate="2016-07-29T13:43:22.167" Score="1" Body="&lt;p&gt;You could add the cash flows (CF) by period and then compute the IRR for that accumulated cash flow (CCF). The resultant IRR will be like a weighted IRR. That will be different from IRR weighted by NPVs or Initial investment of each investment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let say you have two investments with this CFs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;       [0]  [1]  [2]  [3]  [4]  [5]  [6]&#xA;Inv1 -1560  200 1300  800   NA   NA   NA&#xA;Inv2 -1560  200 1300  800   NA   NA 1600&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With a 25% discount rate you will have the NPVs and IRRs:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;          NPVs      IRRs&#xA;Inv1 -158.4000 0.1902671&#xA;Inv2  261.0304 0.3164824&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The accumulated cash flow will be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;       [0]   [1]   [2]   [3]   [4]   [5]   [6]&#xA;CCF  -3120   400  2600  1600     0     0  1600&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can verify that the total NPV is equal to the NPV of CCF at the same discount rate: &lt;code&gt;102.6304&lt;/code&gt;. Nothing new, this is one of the properties of NPV rule.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could also compute the IRR of the CCF: &lt;code&gt;0.2652826&lt;/code&gt;, that will be the IRR of your investments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That rate is different from the mean of IRRs (&lt;code&gt;0.2533748&lt;/code&gt;), and from the weighted IRR using as weights the NPVs (&lt;code&gt;0.5112835&lt;/code&gt;) or the initial investments (&lt;code&gt;0.2533748&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets change the investment 1 to:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;       [0]  [1]  [2]  [3]  [4]  [5]  [6]&#xA;Inv1 -2560  200 3300 1800   NA   NA   NA&#xA;Inv2 -1560  200 1300  800   NA   NA 1600&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then the NPVs and IRRs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;         NPVs      IRRs&#xA;Inv1 633.6000 0.3806551&#xA;Inv2 261.0304 0.316482&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The CCF&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;       [0]   [1]   [2]   [3]   [4]   [5]   [6]&#xA;CCF  -4120   400  4600  2600     0     0  1600&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then the IRR of the CCF: &lt;code&gt;0.3528677&lt;/code&gt;. Again different from the mean of IRRs (&lt;code&gt;0.3485688&lt;/code&gt;), and from the weighted IRR using as weights the NPVs (&lt;code&gt;0.3619311&lt;/code&gt;) or the initial investments (&lt;code&gt;0.3563567&lt;/code&gt;).&lt;/p&gt;&#xA;" OwnerUserId="13571" LastEditorUserId="13571" LastEditDate="2016-07-29T14:09:49.467" LastActivityDate="2016-07-29T14:09:49.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28375" PostTypeId="2" ParentId="28364" CreationDate="2016-07-29T13:45:55.013" Score="0" Body="&lt;p&gt;Each IRR is the [or rather a] solution of a polynomial equation, whose coefficients are the cash flows of the specific projects.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If all the projects are carried out at the same time, the cash flows from combining the projects form the coefficients of a new polynomial.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This overall polynomial equation must be solved from scratch to find the IRR of the overall project. There are AFAIK no &quot;shortcuts&quot; such as as adding or weighing the solutions (IRRs) of the subprojects. It is a whole new IRR problem that must be solved from scratch.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2016-07-29T13:45:55.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28376" PostTypeId="2" ParentId="28373" CreationDate="2016-07-29T14:04:40.657" Score="1" Body="&lt;p&gt;Pretty much all the big banks publish their long-term capital market assumptions. JPM's is available here: &lt;a href=&quot;https://am.jpmorgan.com/us/institutional/library/ltcma-2016&quot; rel=&quot;nofollow&quot;&gt;LONG-TERM CAPITAL MARKET ASSUMPTIONS 2016&lt;/a&gt;. They also provide a few issues from prior years, and you can google around for even earlier issues.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2016-07-29T14:04:40.657" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28377" PostTypeId="1" AcceptedAnswerId="28381" CreationDate="2016-07-29T14:15:12.993" Score="0" ViewCount="70" Body="&lt;p&gt;I am self-studying from a manual on financial economics, and I am trying to completely wrap my head around this solution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/TVFlE.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/TVFlE.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to fill in the in-between steps of this solution based on first principles, so please tell me if my understanding is correct (I'll be referencing the paragraph from the textbook shown below my solution):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rate of return over a one year period is $S_1/S_0$. The expected rate of return is $\textbf{E}[S_1/S_0].$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is therefore asking to find $\text{Pr}[S_1/S_0 &amp;lt; \textbf{E}[S_1/S_0]]$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now $S_1/S_0$ is lognormally distributed, so we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\text{Pr}[\ln(S_1/S_0) &amp;lt; \ln(\textbf{E}[S_1/S_0])] = \text{Pr}[\ln(S_1/S_0) &amp;lt; \alpha]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have that $\ln(S_1/S_0)$ is normally distributed with parameters $m = 0.1 - 0.5(0.30)^2 = 0.055$ and $v = 0.30$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence $\text{Pr}[\ln(S_1/S_0) &amp;lt; \alpha] = \text{Pr}[z &amp;lt; (\alpha - m)/v] = N(\frac{0.1 - 0.055}{0.3}) = N(0.15) = 0.55962$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/O9rug.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/O9rug.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Is the logic of the in-between steps correct? Please correct any detail that I don't have quite right.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What does the author mean by the quantile of the expected return, and why is that helpful?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5641" LastActivityDate="2016-07-29T18:14:33.003" Title="Clarification on this author's solution for this problem on lognormal stock distribution" Tags="&lt;lognormal&gt;&lt;self-study&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28378" PostTypeId="2" ParentId="27873" CreationDate="2016-07-29T15:08:28.850" Score="0" Body="&lt;p&gt;I can answer the second question :&lt;br&gt;&#xA;You can use the following command to see if the GPD fits well the exceedances&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;XFitGPD&amp;lt;-gpdFit(X,u= ...)&#xA;plot(XFitGPD)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="17810" LastActivityDate="2016-07-29T15:08:28.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28379" PostTypeId="1" CreationDate="2016-07-29T15:40:01.767" Score="4" ViewCount="1935" Body="&lt;p&gt;Quick question as a follow-up to &lt;a href=&quot;https://quant.stackexchange.com/questions/28287/risk-free-rate-vs-libor&quot;&gt;this&lt;/a&gt; post: why was LIBOR used instead of OIS pre-2007 for the risk-free rate proxy?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please correct me if I am getting this mixed up, but from what I've seen, it seems that LIBOR was more frequently used as a proxy for the risk-free rate than OIS pre-crisis, but when default probability and credit risk became an issue, OIS rates were used.  Why not OIS in the first place, or what am I missing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="20465" LastEditorUserId="20454" LastEditDate="2017-10-09T16:02:48.307" LastActivityDate="2017-10-09T16:02:48.307" Title="Risk-free: why LIBOR pre-crisis and OIS now" Tags="&lt;libor&gt;&lt;risk-free&gt;&lt;ois-discounting&gt;&lt;ois&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28380" PostTypeId="2" ParentId="28379" CreationDate="2016-07-29T16:53:50.453" Score="12" Body="&lt;p&gt;It comes down to the definition of LIBOR: London Interbank Offer Rate -&gt; Every business day, a panel of large banks are asked by the BBA[*] (British Bankers Association) at what rate they would lend cash (unsecured) in a certain currency to another bank of that panel for a certain maturity, and that for a range of currencies and maturities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g. Currency: USD, Maturity: 3 months -&gt; the aggregate of the day's contributions (based on specific rules) give you the 3-month USD LIBOR fixing for that day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pre-crisis, as you correctly said, those interbank borrowings were considered risk-free, just as much as the overnight funding facility you could make use of at your central bank (Fedfunds in the US). There was theoretically no difference in borrowing for 3 months from another bank or borrowing for 1 month and forward 1 month in 1 month and forward 1 month in 2 months. This is what we call no basis between 1M and 3M LIBOR curves. The same was true for the relationship between all other LIBOR tenors and the overnight rate. Hence, all those rates formed a single, consistent rates curve you could use to discount risk-free cashflows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the crisis, things changed resulting in two main (related) developments for the rates markets:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Because banks realised that their peers are not risk-free, they started charging a credit spread in their LIBOR contributions which therefore created a basis between the OIS discount curve and the LIBOR curves. This means that you need to use the OIS swap curve to derive your risk-free discount factors as those differ from the IRS curve.&lt;/li&gt;&#xA;&lt;li&gt;Similarly, the market started to price a basis between the various LIBOR tenors of the same currency, given that lending to another bank for 3 months was more risky than for 1 month (something known as term premium).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This is what gave rise to &quot;multicurve discounting&quot;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Why not OIS in the first place, or what am I missing?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;As explained above, the OIS was indeed part of the discount curve, but because there was no basis with LIBOR and the LIBOR swaps were most widely traded, the discounting models were fitted onto LIBOR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. Even the Overnight Index embeds a credit premium, but given that you are looking for a rate to discount say perfectly collateralised transactions, on which you would not anyway be able to call collateral more than once a day, you would be left with an inherent overnight exposure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[*] I have not followed closely the latest developments so not sure if it is still the BBA which takes care of computing LIBOR fixings...&lt;/p&gt;&#xA;" OwnerUserId="22726" LastActivityDate="2016-07-29T16:53:50.453" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28381" PostTypeId="2" ParentId="28377" CreationDate="2016-07-29T18:14:33.003" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;Yes, your steps are valid&lt;/li&gt;&#xA;&lt;li&gt;This is a wrong use of the term &quot;quantile&quot;. Here you need to compute a probability (through the normal cdf) and not a quantile (i.e. the value of a random variable corresponding to a given level of the cdf, e.g. the quantile 0.5 (or percentile 50%) is the median)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2016-07-29T18:14:33.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28382" PostTypeId="2" ParentId="28345" CreationDate="2016-07-29T19:03:57.910" Score="5" Body="&lt;p&gt;I work at &lt;a href=&quot;https://www.quandl.com&quot; rel=&quot;noreferrer&quot;&gt;Quandl&lt;/a&gt; and I've listed some of our options databases below. Our API is free to use and data can be downloaded from our site in the tool of your choice, including Python - check out: &lt;a href=&quot;https://www.quandl.com/tools/full-list&quot; rel=&quot;noreferrer&quot;&gt;https://www.quandl.com/tools/full-list&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are some of our options databases: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Free: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.quandl.com/data/CBOE&quot; rel=&quot;noreferrer&quot;&gt;Chicago Board Options Exchange&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Premium:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://www.quandl.com/data/OPT&quot; rel=&quot;noreferrer&quot;&gt;ORATS Option Volatility Surfaces&lt;/a&gt; &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://www.quandl.com/data/VOL&quot; rel=&quot;noreferrer&quot;&gt;US Equity Historical &amp;amp; Option Implied Volatilities&lt;/a&gt; &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://www.quandl.com/data/QOA&quot; rel=&quot;noreferrer&quot;&gt;Quantcha Option Analytics&lt;/a&gt; &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://www.quandl.com/data/PE&quot; rel=&quot;noreferrer&quot;&gt;PortfolioEffect Volatility and Risk Factors&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://www.quandl.com/data/GA&quot; rel=&quot;noreferrer&quot;&gt;Goode Analytics Open Interest Ratio Surfaces&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://www.quandl.com/data/OWF&quot; rel=&quot;noreferrer&quot;&gt;OptionWorks Futures Options&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Hope this helps. &lt;/p&gt;&#xA;" OwnerUserId="19252" LastActivityDate="2016-07-29T19:03:57.910" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28383" PostTypeId="2" ParentId="22593" CreationDate="2016-07-29T19:56:04.973" Score="0" Body="&lt;p&gt;Can you try to plug your analytical solution obtained Method 1 into the PDE and show that it satisfies the PDE with boundary conditions ?&lt;/p&gt;&#xA;" OwnerUserId="22691" LastActivityDate="2016-07-29T19:56:04.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28384" PostTypeId="2" ParentId="27873" CreationDate="2016-07-29T21:14:59.417" Score="2" Body="&lt;p&gt;It is known that GPD can generate (significantly) more negative outcomes than realized. Whether that's a &quot;bug&quot; or &quot;feature&quot; is debated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tend to think of GPD as an &quot;extrapolation&quot; method. Using empirical distribution, the worst case scenario your model can produce is the worst historical observation. Of course, we know we are frequently been surprised by &quot;unprecedented&quot; events in the market. GPD can generates much more extreme cases, effectively allowing you to extrapolate into &quot;unknown territory&quot;. Whether the resulting value is economically sensible requires judgement. But in my mind, this is the whole point of using GPD.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2016-07-29T21:14:59.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28385" PostTypeId="1" AcceptedAnswerId="28414" CreationDate="2016-07-29T23:00:02.670" Score="3" ViewCount="20999" Body="&lt;p&gt;In calculating an annualized Sharpe ratio using monthly returns, what is commonly used as the value for the risk free rate? I am using this formula:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;excess return = monthly returns - risk free rate&#xA;Sharpe ratio = (average(excess returns) / std(excess returns)) * sqrt(12)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Multiplying by the sqrt(12) in order to make the result annual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My understanding is that a common yearly risk free rate is roughly equal to 5%, is this true? Would the monthly risk free rate then be equal to 5% / 12 or .4167%?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondary question, if you are dealing with more than one year of monthly returns, such as 2 or 3 years, would you still multiply by the sqrt(12), or would it be for:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;2 years = multiply by sqrt(24)&#xA;3 years = multiply by sqrt(36)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and so on?&lt;/p&gt;&#xA;" OwnerUserId="22783" LastEditorUserId="22783" LastEditDate="2016-07-30T03:11:14.560" LastActivityDate="2016-08-07T20:15:42.510" Title="What value should the risk free monthly return rate be (Sharpe ratio calculation)?" Tags="&lt;statistics&gt;&lt;modern-portfolio-theory&gt;&lt;factor-models&gt;&lt;sharpe-ratio&gt;&lt;performanceanalytics&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28387" PostTypeId="1" CreationDate="2016-07-29T23:19:55.990" Score="1" ViewCount="206" Body="&lt;p&gt;In &lt;a href=&quot;https://quant.stackexchange.com/questions/24918/obtaining-risk-neutral-probability-from-option-prices&quot;&gt;this&lt;/a&gt; question, the risk-neutral probability distribution $q(S_T=s)$ for the underlying at time $t = T$ is given by the Breeden-Litzenberger identity as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{1}{P(0,T)} \frac{ \partial^2 C }{\partial K^2} (K=s,T) $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, this can be computed numerically for a given $K = s$ with a centered, second-order finite-difference approximation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{ \partial^2 C }{\partial K^2} (K=s,T) \approx \frac{ C(K=s-\Delta K,T) - 2 C(K=s,T) + C(K=s+\Delta K,T)}{ (\Delta K)^2 } $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i.e., the payoff for a butterfly spread around $K = s$ normalized for its width.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If instead we are interested in the CDF $Q(S_T \geq s)$, can we look at the first order finite-difference approximation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{ \partial C }{\partial K} (K=s,T) \approx \frac{ C(K=s-\Delta K,T) - C(K=s+\Delta K,T)}{ (2 \Delta K) } $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to determine the implied risk-neutral CDF?  And similar to the above, is it appropriate to think of this as a normalized payer spread option (buying a call at $K = s + \Delta K$ and selling a call at $K = s - \Delta K$)?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In particular, if the underlying is a swap rate and the market data are swaption prices, what sort of issues (and remedies?) arise from this interpretation (i.e., potential liquidity constraints, or discretization complications with $\Delta K$)?  Finally, is there a standard method for constructing a meaningful error bound on the cumulative probability implied by a certain strike?&lt;/p&gt;&#xA;" OwnerUserId="20465" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-07-29T23:19:55.990" Title="methodology confirmation for computing implied risk-neutral CDF from option prices" Tags="&lt;interest-rates&gt;&lt;probability&gt;&lt;risk-neutral-measure&gt;&lt;finite-difference-method&gt;" AnswerCount="0" CommentCount="6" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28389" PostTypeId="1" CreationDate="2016-07-30T14:44:19.540" Score="2" ViewCount="916" Body="&lt;p&gt;I am looking at a Bloomberg FX vol surface quoted in 10 and 25 delta BF and RR. I know how to convert the RR and BF vols int 10D and 25D call and put vols, but I can't seem to imply a strike price from this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could someone please point me to a reference in this regard? &lt;/p&gt;&#xA;" OwnerUserId="22581" LastActivityDate="2018-08-28T08:52:16.223" Title="FX Delta Volatility" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;volatility&gt;&lt;fx&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28390" PostTypeId="2" ParentId="28368" CreationDate="2016-07-30T16:09:58.867" Score="2" Body="&lt;p&gt;You can calculate the duration and use it as sensitivity measure, as you are used to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is because the npv of the cashflows is:&#xA;$NPV = \sum_i [ c_i * \exp(- y_i * t_i ) ]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With $c_i$ the fixed cashflow amount at time $t_i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From that it follows, that the derivative of the NPV with respect to a parallel shift of the yieldcurve is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d(NPV)/dy = - \sum[ c_i * t_i * \exp(- y_i * t_i ) ]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you divide that by the NPV, you get the definition of the duration.&#xA;You see the formulas are valid regardless of the sign or amount of the $c_i$.&lt;/p&gt;&#xA;" OwnerUserId="22686" LastEditorUserId="16160" LastEditDate="2016-07-30T16:17:09.543" LastActivityDate="2016-07-30T16:17:09.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28391" PostTypeId="1" AcceptedAnswerId="28407" CreationDate="2016-07-30T16:17:35.797" Score="1" ViewCount="246" Body="&lt;p&gt;Say we have a product that pays the following at expiry $T$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Payoff}_{in\ USD} = \text{Notional}_{in\ USD} \cdot \frac{DAXLevel_{in\ EUR}\ at\ t=T}{DAXLevel_{in\ EUR}\ at\ t=0}$$&#xA;i.e. it simply pays the total DAX return in USD (as opposed to EUR, which is the currency in which the DAX is quoted). So it gives USD-based investors exposure to the EUR-denominated index DAX without actually having to invest in EUR. That is, FX risk is seemingly nullified (&lt;em&gt;or is it&lt;/em&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now my question is, how would one &lt;strong&gt;replicate such a payoff&lt;/strong&gt;? After playing around with this for a while (however, without actually finding a working replicating strategy), I also get the impression that &lt;strong&gt;FX risk is not zero&lt;/strong&gt; (i.e. we have non-zero EURUSD fx delta). The reason being that the replicating portfolio will invest in&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The DAX itself (in EUR)&lt;/li&gt;&#xA;&lt;li&gt;A cash account (in EUR)&lt;/li&gt;&#xA;&lt;li&gt;A cash account (in USD)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;i.e. there will have to be conversion of USD into EUR and back.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would anybody be able to point me in the right direction?&lt;/p&gt;&#xA;" OwnerUserId="6621" LastActivityDate="2016-08-03T18:39:02.860" Title="Quanto Total Return of a Foreign Asset into Domestic" Tags="&lt;fx&gt;&lt;index&gt;&lt;replication&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28394" PostTypeId="2" ParentId="25754" CreationDate="2016-07-30T20:00:29.600" Score="1" Body="&lt;p&gt;Set&#xA;$$X_t=\exp\left(-\int_{0}^{t}\theta_sdW_s^{\mathbb{P}}-\frac{1}{2}\int_{0}^{t}\theta_s^{\,2}ds\right)$$&#xA;By application of Gisanov theorem , we have&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$X_t$ is a $\mathbb{P}-$ martingale. &lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;By changing the measure $\mathbb{P}$ to  $\mathbb{Q}$ such that&#xA;$$\mathbb{E^P}\left[\frac{d\mathbb{Q}}{d\mathbb{P}}\Big{|}\mathcal{F_t}\right]=\frac{d\mathbb{Q}}{d\mathbb{P}}\Big{|}_\mathcal{F_t}=X_t$$&#xA;then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$W_t^{\mathbb{Q}}=W_t^{\mathbb{P}}+I_t$$ is a $\mathbb{Q}$ standard wiener process.&#xA;We have&#xA;\begin{equation*}&#xA;Z_t =&#xA;\begin{cases}&#xA;W_t^{\mathbb{Q}}-I_t 			 \qquad &amp;amp; , \qquad 0 \leq t \leq \tau_a \\&#xA;2a-W_t^{\mathbb{Q}}+I_t           \qquad &amp;amp; , \qquad   t &amp;gt; \tau_a&#xA;\end{cases}&#xA;\end{equation*}&#xA;then (If  I am right)&#xA;\begin{equation*}&#xA;dZ_t =&#xA;\begin{cases}&#xA;dW_t^{\mathbb{Q}}-dI_t 			 \qquad &amp;amp; , \qquad 0 \leq t \leq \tau_a \\&#xA;-dW_t^{\mathbb{Q}}+dI_t           \qquad &amp;amp; , \qquad   t &amp;gt; \tau_a&#xA;\end{cases}&#xA;\end{equation*}&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-07-31T13:10:42.537" LastActivityDate="2016-07-31T13:10:42.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28395" PostTypeId="1" AcceptedAnswerId="28396" CreationDate="2016-07-30T20:42:52.790" Score="1" ViewCount="387" Body="&lt;p&gt;Or for that matter a [n]-day low? (As it relates to market data/trading).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When does a [n]-day low get disrupted and you have to begin tallying again?&lt;/p&gt;&#xA;" OwnerUserId="22796" LastActivityDate="2016-07-31T02:13:18.803" Title="What is the definition of a 10-day low?" Tags="&lt;market-data&gt;&lt;trading&gt;&lt;automated-trading&gt;&lt;algorithmic-trading&gt;&lt;indicator&gt;" AnswerCount="2" CommentCount="0" ClosedDate="2016-08-03T05:49:12.633" ContentLicense="CC BY-SA 3.0" />
  <row Id="28396" PostTypeId="2" ParentId="28395" CreationDate="2016-07-30T20:56:23.453" Score="1" Body="&lt;p&gt;It is the lowest price recorded in previous &lt;strong&gt;n&lt;/strong&gt; days, as of last (yesterday's) close. So it in fact does not get disrupted, it is rolling with the dates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say 3 day low (over weekend and Monday) would be the lowest recorded price between Wednesday, Thursday and Friday. &#xA;On Tuesday it would be Thursday, Friday and Monday 1 Aug. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I would make sure to check how my source computed it in the documentation or FAQ section. They might consider only close prices for longer windows - say 52 weeks high/low etc. &lt;/p&gt;&#xA;" OwnerUserId="22237" LastActivityDate="2016-07-30T20:56:23.453" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28399" PostTypeId="1" CreationDate="2016-07-31T00:48:08.380" Score="1" ViewCount="281" Body="&lt;p&gt;Have just installed Quantlib on Mac &lt;/p&gt;&#xA;&#xA;&lt;p&gt;now trying SWIG for Python but get below error &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;g++ -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -Wl,-F. build/temp.macosx-10.11-intel-2.7/QuantLib/quantlib_wrap.o -L/opt/local/lib -L/opt/local/lib -lQuantLib -o build/lib.macosx-10.11-intel-2.7/QuantLib/_QuantLib.so&#xA;ld: warning: ignoring file /opt/local/lib/libQuantLib.dylib, file was built for x86_64 which is not the architecture being linked (i386): /opt/local/lib/libQuantLib.dylib&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;what am i missing? &lt;/p&gt;&#xA;" OwnerUserId="22799" LastEditorUserId="467" LastEditDate="2016-12-04T14:31:58.520" LastActivityDate="2016-12-04T14:31:58.520" Title="How to install QuantLib with Python SWIG for the first time?" Tags="&lt;python&gt;&lt;quantlib&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28400" PostTypeId="2" ParentId="28395" CreationDate="2016-07-31T02:13:18.803" Score="2" Body="&lt;p&gt;How should an n-day low be defined?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's start with the simplest case: a 1 day low. We say that today is a 1 day low if the close of today is lower than the close of yesterday: $c_t&amp;lt;c_{t-1}$. This is the same as a Down Day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generalizing, today is a 2-day low if $c_t&amp;lt;c_{t-1} \wedge c_t&amp;lt;c_{t-2} $. In words: today's close is below both yesterday's close and the day before close.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An n-day low is defined by n comparison operations: today's close is below n previous days: $c_t&amp;lt;c_{t-1} \wedge c_t&amp;lt;c_{t-2} \wedge \cdots \wedge c_t&amp;lt;c_{t-n}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this definition differs from the definition given by Jan Sila: what he calls a 3 day low I consider a 2 day low.  Both definitions are used, so it is best to check how an author defines it. To distinguish the two definitions we could refer to the definition given here as a &quot;n comparison low&quot; (since it makes n &quot;less than&quot; comparisons), while the definition Jan Sila gave is a &quot;n datapoint low&quot; (since it uses the data of the last n datapoints).&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2016-07-31T02:13:18.803" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28401" PostTypeId="2" ParentId="2678" CreationDate="2016-07-31T09:39:28.277" Score="-1" Body="&lt;p&gt;In reality, european option's premium surely can be less than its intrinsic value which is due to short sell is not free...&lt;/p&gt;&#xA;" OwnerUserId="22803" LastActivityDate="2016-07-31T09:39:28.277" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28403" PostTypeId="1" AcceptedAnswerId="30654" CreationDate="2016-07-31T11:27:39.743" Score="4" ViewCount="221" Body="&lt;p&gt;The only paper I could find is the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1100623&quot; rel=&quot;nofollow&quot;&gt;Dividend Yield Strategy in the British Stock Market 1994-2007 by Brzeszczynski et al. (2008)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It states that a portfolio of stocks with high dividend yields outperforms the broad market most of the time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now of course this is only the UK market within a period of a little more than a decade. So I am looking for more papers on this topic covering more markets and longer periods of time.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2016-10-20T16:24:15.277" Title="Do high dividend yield stocks generally outperform the market?" Tags="&lt;quant-trading-strategies&gt;&lt;reference-request&gt;&lt;factor-models&gt;&lt;fundamentals&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28404" PostTypeId="2" ParentId="28399" CreationDate="2016-07-31T13:21:51.463" Score="2" Body="&lt;p&gt;The message is very clear; you are trying to link the wrong architecture.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;/opt/local/lib/libQuantLib.dylib you installed was compiled for the x86_64 architecture, but you're trying to link with i386.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i386 is 32 bits and x86_64 is 64 bits, they can't be used together. You should compile SWIG with x86_64, unless you have a 32 bits (very old) machine.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2016-07-31T13:21:51.463" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28405" PostTypeId="2" ParentId="28389" CreationDate="2016-07-31T14:04:50.283" Score="1" Body="&lt;p&gt;The determination of the strikes are pretty complicated. It will depend on the types of the butterflies, that is, market or smile. Moreover, it will depend on the types of delta hedge ratios, that is, premium adjusted or not (i.e., in pct or in pips). I would suggest you go through Chapter 3 of the book &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470683686&quot; rel=&quot;nofollow&quot;&gt;Foreign Exchange Option Pricing&lt;/a&gt; by Iain J. Clark. &lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-07-31T19:14:54.157" LastActivityDate="2016-07-31T19:14:54.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28406" PostTypeId="1" AcceptedAnswerId="28408" CreationDate="2016-07-31T14:23:19.630" Score="2" ViewCount="1536" Body="&lt;p&gt;According to a few resources online the formula of iVaR is : VaR (after adding the new element) - VaR (before)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is how can this be correct given the lack of subadditivity of VaR? Meaning, we are not supposed to add VaR results of different portfolio but it's OK to subtract them?!?!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, what's the best way to calculate iVaR?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks&lt;/p&gt;&#xA;" OwnerUserId="22383" LastActivityDate="2018-10-26T09:02:46.617" Title="Incremental VaR formula" Tags="&lt;risk-management&gt;&lt;portfolio&gt;&lt;value-at-risk&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28407" PostTypeId="2" ParentId="28391" CreationDate="2016-07-31T15:49:38.770" Score="5" Body="&lt;p&gt;To see the exposure to FX risk and the difficulty for hedging, we assume constant interest rates and constant volatilities. Let $r_d$ and $r_f$ denote respectively the interest rates for USD and EUR. Moreover, let $X_t$ be the exchange rate at time $t$ from one unit USD to units of EUR. Finally, let $S_t$ be the price level of DAX at time $t$. We assume that, under the EUR risk-neutral measure $Q_f$, &#xA;\begin{align*}&#xA;\frac{dX_t}{X_t} &amp;amp;= (r_f-r_d) dt + \sigma_X dW_t\\&#xA;\frac{dS_t}{S_t} &amp;amp;= r_f dt + \sigma_S\big( \rho dW_t + \sqrt{1-\rho^2} dB_t\big),&#xA;\end{align*}&#xA;where $\{W_t, t \ge 0\}$ and $\{B_t, t \ge 0\}$ are two independent standard Brownian motions, and $\rho$ is the correlation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $Q_d$ be the USD risk-neutral measure. Note that&#xA;\begin{align*}&#xA;\frac{dQ_d}{dQ_f}\big|_t = \frac{e^{r_dt} X_t}{e^{r_f t}X_0}.&#xA;\end{align*}&#xA;Therefore,&#xA;\begin{align*}&#xA;e^{-r_dT} E_{Q_d} \left(\frac{S_T}{S_0} \right) &amp;amp;=e^{-r_dT} E_{Q_f} \left(\frac{S_T}{S_0}  \frac{e^{r_dT} X_T}{e^{r_f T}X_0}\right)\\&#xA;&amp;amp;= e^{-r_fT} E_{Q_f} \left(\frac{S_T X_T}{S_0X_0}\right) \tag{1}\\&#xA;&amp;amp;= e^{(r_f-r_d)T}E_{Q_f}\left(e^{-\frac{1}{2}\sigma_S^2 T +\sigma_T (\rho W_T + \sqrt{1-\rho^2} B_T) -\frac{1}{2}\sigma_X^2 T + \sigma_X W_T)} \right)\\&#xA;&amp;amp;=e^{(r_f-r_d)T}e^{\rho\sigma_S\sigma_X T}. \tag{2}&#xA;\end{align*}&#xA;Here, $\rho\sigma_S\sigma_X T$ is the quanto adjustment. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From $(1)$, we note that the payoff $S_T/S_0$ of the quanto forward, in USD, is equivalent to the payoff $S_TX_T/(S_0X_0)$ in EUR. Therefore, a quanto forward is exposed to FX risk. We also note that, though the FX rate does not explicitly appear in valuation formula $(2)$, both the FX risk factors $\rho$ and $\sigma_X$ are presented. Moreover, Formula $(2)$ is based on the constant volatility assumption, while in the local volatility framework, the volatility $\sigma_X$ will depend on the spot FX rate $X_0$. Regarding replication, we basically need to replicate the payoff $S_TX_T/(S_0X_0)$ in EUR, which does not appear an easy exercise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: There is an interesting discussion of a similar product in Section 12.4.5 of the book &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/111817545X&quot; rel=&quot;nofollow&quot;&gt;Financial Risk Management&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-08-03T18:39:02.860" LastActivityDate="2016-08-03T18:39:02.860" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28408" PostTypeId="2" ParentId="28406" CreationDate="2016-07-31T18:17:42.883" Score="3" Body="&lt;p&gt;IMHO I think this is just to get the feeling of having something additive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is just a telescopic serie.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $X_1,\dots,X_n$ be $n$ financial positions, then:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Var}(\sum_{i=1}^nX_i)=\sum_{k=1}^n\underbrace{\text{Var}(\sum_{i=1}^kX_i)-\text{Var}(\sum_{i=1}^{k-1}X_i)}_{\stackrel{\rm def}{=}\text{iVar}(X_k)}$$&lt;/p&gt;&#xA;" OwnerUserId="20201" LastEditorUserId="20201" LastEditDate="2016-08-01T08:24:18.587" LastActivityDate="2016-08-01T08:24:18.587" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28410" PostTypeId="2" ParentId="28385" CreationDate="2016-07-31T20:23:38.203" Score="1" Body="&lt;p&gt;First, it never made sense to me to &quot;annualize&quot; the Sharpe ratio if the input data is monthly. But yes, if you want to annualize you multiply by sqrt(12), and for three years you should multiply by sqrt(36).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To explain my view: The Sharpe ratio really has no meaning by itself. It only has meaning in comparisons (this portfolio vs. the other), and only if it over the same period. (The annual Sharpe ratio of a portfolio over 1971-1980 compared to the annual Sharpe ratio of the same portfolio over 2001-2010 makes no sense whatsoever.) In these comparisons, what's the benefit of multiplying everything by sqrt(12), or sqrt(36)? (Hint: NONE!) What is always important to state is that the inputs were monthly returns (as opposed to annual returns, etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And, to be clear: If you compute a Sharpe ratio from ANNUAL returns of the same portfolio(s), you may get results VERY DIFFERENT from taking the SR computed from monthly returns and multiplying by sqrt(12). I hope the idea of &quot;annualizing&quot; is not based on a misunderstanding of this trivial fact!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now to your actual question: If the input data is monthly (monthly returns), then the risk-free rate should also be on instruments that are risk-free at the one-month horizon - 30 day T-Bills most likely. A one-year T-Bill is not risk-free over one-month horizons.&lt;/p&gt;&#xA;" OwnerUserId="20429" LastEditorUserId="20429" LastEditDate="2016-07-31T20:29:03.557" LastActivityDate="2016-07-31T20:29:03.557" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28411" PostTypeId="1" CreationDate="2016-07-31T20:40:34.310" Score="1" ViewCount="150" Body="&lt;p&gt;For institutional-level deployment (PTF or sell-side algo market making), what new technologies are firms currently using along-side or within CEP engines/platforms to build and generate signals? There is a lot of information on some of the platforms below, but most of it seems a bit dated (2011/2012-ish)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;CEP engines/platforms&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Streambase &lt;/li&gt;&#xA;&lt;li&gt;Apama&lt;/li&gt;&#xA;&lt;li&gt;Esper + Storm&lt;/li&gt;&#xA;&lt;li&gt;Any others? IBM Streams? Sybase? StreamInsights?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Statistical Analysis/Machine Learning integrations..&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Matlab&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;R&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Python&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Java / C++ plugins&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Any others?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="22391" LastEditorUserId="22391" LastEditDate="2016-07-31T22:39:33.457" LastActivityDate="2016-07-31T22:39:33.457" Title="What new technologies are HFT or sell-side algo firms using along-side or within CEP engines/platforms?" Tags="&lt;algorithmic-trading&gt;&lt;cep&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28412" PostTypeId="1" AcceptedAnswerId="39043" CreationDate="2016-07-31T21:44:20.990" Score="4" ViewCount="1603" Body="&lt;p&gt;Can someone point me into the right direction to calculate this one:&#xA;$E(B^4_t)=3t^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had tried using the following property with no luck:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E(B^4_t)=E(B^2_tB^2_t)=E(\int B^2 dt )E(\int B^2 dt )=[E(\int B^2 dt )]^2=[\int E(B^2) dt]^2=[\int t dt]^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any other suggestion will be appreciated. Thanks!&lt;/p&gt;&#xA;" OwnerUserId="22776" LastActivityDate="2018-03-28T16:25:27.283" Title="Variance of Brownian Motion" Tags="&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28413" PostTypeId="2" ParentId="28412" CreationDate="2016-07-31T22:00:30.063" Score="6" Body="&lt;p&gt;At time $t$, Brownian Motion $B_t$ is simply a normal random variable $N(0,t)$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Moment Generating Function for a normal  $N(\mu,\sigma^2)$ random variable is as follows:&#xA;$$M(x) = exp(\mu x + \frac{1}{2}\sigma^2 x^2)$$&#xA;Furthermore, the fourth moment is given as the fourth derivative of this equation:&#xA;$$M''''(x) = exp(\mu x + \frac{1}{2}\sigma^2 x^2)\Big( (\mu + \sigma^2x)^4 + 6\sigma^2(\mu + \sigma^2 x)^2 + 3\sigma^4 \Big)$$&#xA;So the expectation of $B_t^4$ is just the fourth moment, evaluated at $x=0$ (with parameters $\mu = 0$, $\sigma^2 = t$):&#xA;$$E(B_t^4) = M''''(0) = 3\sigma^4 = 3t^2 $$&lt;/p&gt;&#xA;" OwnerUserId="22246" LastActivityDate="2016-07-31T22:00:30.063" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28414" PostTypeId="2" ParentId="28385" CreationDate="2016-08-01T00:08:44.753" Score="2" Body="&lt;p&gt;The &lt;a href=&quot;https://www.treasury.gov/resource-center/data-chart-center/interest-rates/Pages/TextView.aspx?data=yield&quot; rel=&quot;nofollow&quot;&gt;Daily Treasury Yield Curve Rates&lt;/a&gt; are a commonly used metric for the &quot;risk-free&quot; rate of return.  Currently, the 1-month risk-free rate is 0.19%, and the 1-year risk-free rate is 0.50%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Annualizing your Sharpe ratios depends on the time unit you are using to calculate your returns.  You simply multiply your calculated Sharpe ratio by the following (unit-less) factor:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sqrt{\frac{1\ year}{1\ time\ unit}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in this case, if you are using monthly returns, you multiply by $\sqrt{12}$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For 2 and 3 year normalization, you'd want to substitute the numerator &quot;1 year&quot; with &quot;2 years&quot; and &quot;3 years&quot;.   As you guessed, this means you will want to multiply by $\sqrt{24}$ and $\sqrt{36}$, respectively.  &lt;/p&gt;&#xA;" OwnerUserId="22246" LastActivityDate="2016-08-01T00:08:44.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28415" PostTypeId="1" AcceptedAnswerId="28416" CreationDate="2016-08-01T01:05:42.567" Score="0" ViewCount="408" Body="&lt;p&gt;We're given a spreadsheet with a correlation matrix for four stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then there is a calculation for average correlation, but I don't know how it's derived.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$=\left(\operatorname{Average}(C14:F17)-\frac 14\right)\times\frac{16}{10}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to extend this calculation to six stocks. Can someone explain or point me to an explanation for how average correlations are calculated rather than some arbitrary scaling factors?&lt;/p&gt;&#xA;" OwnerUserId="19800" LastEditorDisplayName="user16651" LastEditDate="2016-08-01T18:17:36.820" LastActivityDate="2016-08-01T18:17:36.820" Title="Average Correlation" Tags="&lt;correlation&gt;&lt;correlation-matrix&gt;&lt;covariance-matrix&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28416" PostTypeId="2" ParentId="28415" CreationDate="2016-08-01T01:51:48.850" Score="4" Body="&lt;p&gt;He is forced to use some tricks because Excel can only take average of a rectangular area, but he wants the avg of upper non-diagonal elements of the matrix only. So he subtracts $\frac{1}{n}$ (the average of the 1's on the diagonal), then scales the result by $\frac{n^2}{n(n+1)/2}$ which is the number of total elements divided by on-or-below-diagonal elements. Of course he is using $n=4$ since he has a 4 by 4 matrix. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;These tricks are clever but they detract from the readability of the program (they also will not work if the matrix does not have 1's on the diagonal, etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should try simple cases like 2 by 2 or 3 by 3 to see how it works and then try to prove it for the general n by n case. &lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-08-01T04:02:53.573" LastActivityDate="2016-08-01T04:02:53.573" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28417" PostTypeId="2" ParentId="28363" CreationDate="2016-08-01T02:32:16.423" Score="1" Body="&lt;p&gt;I think I figured it out. The problem was with day count conventions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OIS par rate bid/ask are quoted in 360/ACT form, while zero curve rates are universalized to ACT/ACT (or whatever else is desired by the end user). Therefore, to get the zero rates, mid price of OIS swap is used to find the discount factor as 1/(1+r)^t(360/ACT) from which then zero rate r0 can be backed out 1/(1+r0)^t(ACT/ACT). So, they are essentially same thing, with a desired day count adjustment.&lt;/p&gt;&#xA;" OwnerUserId="5086" LastActivityDate="2016-08-01T02:32:16.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28418" PostTypeId="1" CreationDate="2016-08-01T03:55:00.793" Score="0" ViewCount="654" Body="&lt;p&gt;How is &lt;strong&gt;excess return&lt;/strong&gt; defined for a given asset? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are altogether two different definitions for excess return used in the calculation of &lt;strong&gt;alpha&lt;/strong&gt; and &lt;strong&gt;beta&lt;/strong&gt; and I'm unable to understand which one should we apply to generate valid statistical factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Definition 1&lt;/strong&gt;: Given by the difference between return rate of the stock and risk-asset (such as Treasury Bill) or $ER^{(1)} = R_i - R_f$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Definition 2&lt;/strong&gt;: Given by the difference between return rate of the stock and return rate of the market index with same risk or $ER^{(2)} = R_i - R_M$ &lt;/p&gt;&#xA;" OwnerUserId="22810" LastEditorUserId="22810" LastEditDate="2016-08-01T04:01:31.480" LastActivityDate="2018-07-02T17:24:21.560" Title="Interpretation of Excess Return" Tags="&lt;risk&gt;&lt;index&gt;&lt;beta&gt;&lt;expected-return&gt;&lt;return&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28419" PostTypeId="1" CreationDate="2016-08-01T04:02:49.197" Score="2" ViewCount="6270" Body="&lt;p&gt;I am looking for a formula to calculate the weights of two risky assets that produce the optimal portfolio (i.e highest Sharpe ratio).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far I have found the following formula from a website of University of Missouri&#xA;&lt;a href=&quot;https://i.stack.imgur.com/J5IA1.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/J5IA1.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, this formula often produces negative weights.&#xA;For example, it returns a weight of -24% for Asset A when Risk Free Rate=3%, Ra=5%, STDEVa=15%, Rb=10%, STDEVb=20%, CORRab=50%.&#xA;It is probably because it allows short selling, making it not applicable in my situation. I need to find non-negative weights.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know a formula for non-negative weights for a two-asset optimal portfolio that does not allow short selling?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="22811" LastActivityDate="2018-02-20T18:22:30.070" Title="Formula for Optimal Portfolio of 2 Assets when No Shorting Allowed?" Tags="&lt;portfolio-management&gt;&lt;optimization&gt;&lt;modern-portfolio-theory&gt;&lt;markowitz&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28420" PostTypeId="2" ParentId="28418" CreationDate="2016-08-01T07:38:28.067" Score="2" Body="&lt;p&gt;They are &lt;strong&gt;both&lt;/strong&gt; excess returns even though the standard convention is to talk about &lt;em&gt;risk premium&lt;/em&gt; for $R_{t+1}-R^f$ and &lt;em&gt;excess return on the market&lt;/em&gt; for $R_{t+1}-R_M$. If you believe in CAPM, then you need the former to compute:&#xA;$$\alpha= (\bar{R}-R_f) - \beta(\bar{R}_M-R_f)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By definition, the excess return is the payoff of &lt;strong&gt;a portfolio with price zero&lt;/strong&gt; today, i.e. if today you buy asset i you pay 1\$ to receive $R_{t+1}^i$ tomorrow, the same goes for asset j. Going long 1\$ in i and short 1\$ in j we obtain today 1\$-1\$=0 and tomorrow $R^i_{t+1}-R^j_{t+1}$.&lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2016-08-01T07:38:28.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28421" PostTypeId="2" ParentId="28412" CreationDate="2016-08-01T07:45:51.057" Score="6" Body="&lt;p&gt;&lt;strong&gt;Other Way&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}\left[ \,{{e}^{iuB_t}} \right]=\exp \left( iu\,\mathbb{E}\left[ B_t \right]+\frac{1}{2}{{(\,iu\,)}^{2}}\operatorname{Var}(B_t\,) \right)={\exp \left( -\frac{1}{2}{{u}^{2}}t \right)}$$&#xA;We know&#xA;$$\mathbb{E}\left[{{e}^{iuB_t}} \right]=E\left[1+iuB_t-\frac{1}{2\,!}{{u}^{2}}{{B_t}^{2}}-\frac{1}{3\,!}i{{u}^{3}}{{B_t}^{3}}+\frac{1}{4\,!}{{u}^{4}}{{B_t}^{4}}+\cdots  \right]$$&#xA;therefore&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$${\exp \left( -\frac{1}{2}{{u}^{2}}t \right)}=1+iu\mathbb{E}\left[ B_t \right]-\color{green}{\frac{1}{2!}{{u}^{2}}\mathbb{E}\left[ {{B_t}^{2}} \right]}-\frac{1}{3!}i{{u}^{3}}E\left[ {{B_t}^{3}}\right]+\color{red}{\frac{1}{4!}{{u}^{4}}\mathbb{E}\left[ {{B_t}^{4}} \right]}+\cdots \tag1$$&#xA;On the other hand&#xA;$$\exp \left( -\frac{1}{2}{{u}^{2}}t \right)=1-\color{green}{\frac{1}{2}\,{{u}^{2}}t}+\color{red}{\frac{1}{2!}\left( \frac{1}{4}{{u}^{4}}{{t}^{2}} \right)}-\frac{1}{3  !}\left( \frac{1}{8}{{u}^{6}}{{t}^{3}} \right)+\frac{1}{4  !}\left( \frac{1}{16}{{u}^{8}}{{t}^{4}} \right)-\cdots\tag2 $$&#xA;$(1)$ and $(2)$&#xA;$$\frac{1}{4!}{{u}^{4}}\mathbb{E}\left[ {{B_t}^{4}} \right]=\frac{1}{2  !}\left( \frac{1}{4}{{u}^{4}}{{t}^{2}} \right)$$&#xA;thus&#xA;$$\mathbb{E}\left[ {{B_t}^{4}} \right]=3t^2$$&#xA;Generally, we have&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$$\left\{ \begin{align}   &amp;amp; E\left[ {{B}^{2n+1}}(t)&#xA;\right]=0\,\,\,\,\,\,\,\,\,\,\,\,\,\, \\   &amp;amp; \quad E\left[&#xA; {{B}^{2n}}(t) \right]=\frac{(2n)!}{{{2}^{n}}n\,!}\,{{t}^{n}} \\&#xA;\end{align} \right.$$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-08-01T07:52:52.730" LastActivityDate="2016-08-01T07:52:52.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28422" PostTypeId="2" ParentId="25775" CreationDate="2016-08-01T12:05:31.207" Score="6" Body="&lt;p&gt;I think you did something wrong in translating the input to numerics. As pointed out by dm63 normal vols are quoted in basis points. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using equation A.67a) from the Hagan paper you linked we see (setting $\beta = 0$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma_N(K) = \alpha\frac{\xi}{x(\xi)}\left[1+\frac{2-3\rho^2}{24}\nu^2\tau_{exp}\right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\tau_{exp} = 0.25$ in your example and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\xi = \frac{\nu}{\alpha}(f-K)$$&#xA;$$x(\xi) = \log{\left(\frac{\sqrt{1-2\rho\xi+\xi^2}-\rho+\xi}{1-\rho}\right)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've implemented a very simple (not at all optimized) code just as an example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;                                        #maket data&#xA;iVol &amp;lt;- c(46.6,49.8,52.3,55.2,58.8,62.8,72,92.2)/10000&#xA;strike &amp;lt;- c(0.298,0.798,1.048,1.298,1.548,1.798,2.298,3.298)/100&#xA;exp &amp;lt;- 0.25&#xA;atmF &amp;lt;- 1.298/100&#xA;                                        #object function&#xA;&#xA;f.obj &amp;lt;- function(x,strike,iVol,exp,atmF)&#xA;    {&#xA;        return(1/length(strike)*sum((iVol-sigma.hat(x,strike,atmF,exp))^2))&#xA;    }&#xA;&#xA;# approximatino using formula A.67a) in Hagan paper&#xA;&#xA;sigma.hat &amp;lt;- function(x,strike,atmF,exp)&#xA;    {&#xA;                                        #x[1] = alpha&#xA;                                        #x[2] = nu&#xA;                                        #x[3] = rho&#xA;&#xA;        xi &amp;lt;- x[2]/x[1]*(atmF-strike)&#xA;        x.xi &amp;lt;- log(((sqrt(1-2*x[3]*xi+xi^2)-x[3]+xi)/(1-x[3])))&#xA;        ret &amp;lt;- ifelse(abs(strike-atmF)&amp;lt;10^(-4), x[1]*(1+((2-3*x[3]^2)/(24))*x[2]^2*exp),x[1]*((xi)/(x.xi))*(1+((2-3*x[3]^2)/(24))*x[2]^2*exp))&#xA;        return(ret)&#xA;    }&#xA;&#xA;                                        # fit the model&#xA;&#xA;sol1 &amp;lt;- nlm(f.obj, c(atmF, 0.1, 0.5), strike = strike, iVol = iVol, exp= exp, atmF = atmF)$estimate&#xA;sol2 &amp;lt;- nlm(f.obj, c(atmF,sol1[2],sol1[3]),strike = strike, iVol = iVol, exp = exp, atmF = atmF)$estimate&#xA;sol1&#xA;sol2&#xA;&#xA;x.seq &amp;lt;- seq(0.9*min(strike),1.1*max(strike),0.001)&#xA;y.seq &amp;lt;- sigma.hat(sol2,x.seq,atmF,exp)*10000&#xA;&#xA;plot(100*x.seq,y.seq,type=&quot;l&quot;,col=&quot;red&quot;,xlab = &quot;Strike&quot;, ylab = &quot;implied Vol&quot;, main = &quot;Sabr Normal model&quot;)&#xA;points(100*strike,iVol*10000,col=&quot;blue&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;leading to the following fit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ifQqC.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ifQqC.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17133" LastActivityDate="2016-08-01T12:05:31.207" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28423" PostTypeId="1" AcceptedAnswerId="28452" CreationDate="2016-08-01T12:57:10.143" Score="2" ViewCount="1673" Body="&lt;p&gt;Has anyone used Excel or R Studio to do a simple Chow Test (compare a set of data before and after one particular year)? I have tried to find info but there is not much, especially regarding the use of Excel.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have monthly CDS values from January 2004 to December 2010. I have to split them in two - 2004-2006 and 2007-2010 - and I have to see how they changed from one period to another. The values are in basis points.&lt;/p&gt;&#xA;" OwnerUserId="22814" LastEditorUserId="19645" LastEditDate="2016-08-03T02:43:47.190" LastActivityDate="2016-12-01T10:22:04.600" Title="Implementation of the Chow test in Excel/R" Tags="&lt;r&gt;&lt;statistics&gt;&lt;excel&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28424" PostTypeId="1" AcceptedAnswerId="28425" CreationDate="2016-08-01T15:41:58.297" Score="1" ViewCount="140" Body="&lt;p&gt;I am using variance co variance matrix for calculating the VaR. Now if the some corporate action comes in between like stock split, resulting a huge VaR number on that particular day as the volatility will drop by huge amount. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, if a stock price series is $\$10, \$10.25, \$10.28, \$10.54, \$10.98, \$11.65, \$11.65$ and so on for the last 1 year and suddenly the stock split comes in between and the prices drops to around $\$5$, resulting in huge volatility and thus impacting my VaR number. How to adjust this as to my VaR numbers looks in synchronization?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="18663" LastEditorUserId="22237" LastEditDate="2016-08-01T21:23:30.887" LastActivityDate="2016-08-01T21:23:30.887" Title="How to adjust corporate actions for VaR" Tags="&lt;var&gt;&lt;covariance-matrix&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="28425" PostTypeId="2" ParentId="28424" CreationDate="2016-08-01T19:04:33.543" Score="1" Body="&lt;p&gt;The prices need to be recalculated for 'Adjusted Close'. You basically split or the prices backwards so they correspond to the same number of shares...also when computing a covariance matrix, you need to do it with returns (log returns), not prices! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The comovement you want to capture is in returns of the series.&lt;/p&gt;&#xA;" OwnerUserId="22237" LastActivityDate="2016-08-01T19:04:33.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28426" PostTypeId="1" AcceptedAnswerId="28436" CreationDate="2016-08-01T20:07:56.210" Score="0" ViewCount="1044" Body="&lt;p&gt;Usually, people write $y_t^{(n)}=-\frac{p_t^{(n)}}{n}$ where $y, p$ and log yield and log price respectively. My question is how do one derive this expression?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that $e^{-Y_t^{(n)}\cdot n}=P_t^{(n)}$ if $Y,P$ are the continuous yield and price of the one dollar $n$ period bond respectively at time $t$. Now, if we take logs, we get&#xA;$$-Y_t^{(n)}\cdot n=p_t^{(n)}.$$&#xA;Therefore, we have $Y_t^{(n)}=-\frac{p_t^{(n)}}{n}$ which differs from the equation from the first paragraph. What went wrong?&lt;/p&gt;&#xA;" OwnerUserId="18661" LastActivityDate="2016-08-02T09:19:19.570" Title="How to derive the relationship between log yield and log price?" Tags="&lt;fixed-income&gt;&lt;continuous-time&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28427" PostTypeId="2" ParentId="9351" CreationDate="2016-08-01T20:44:48.207" Score="5" Body="&lt;p&gt;&lt;b&gt;SOLUTION:&lt;/b&gt;&#xA;Let $r_t$ be the log-return at time $t$, and $\hat{r}_t$ be the predicted log-return from  the regression model.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Initialize $loglik(0:T)=0$,$\epsilon_1=0$, $\sigma_1 = 0$, $\mu=U(0,1)*0.0001,\phi=U(0,1)*0.01$, $\alpha_0=U(0,1)*0.00002,\alpha_1=U(0,1)*0.01,\beta_1=0.9 + U(0,1)* 0.01$, $B=10,000$ &lt;/li&gt;&#xA;&lt;li&gt;For $b$ = 1 to $B$&lt;/li&gt;&#xA;&lt;li&gt;$\quad$ For $t$ = 2 to $T$: &lt;/li&gt;&#xA;&lt;li&gt;$ \quad\quad \hat{r}_t = \mu + \phi  r_{t - 1}$&lt;/li&gt;&#xA;&lt;li&gt;$ \quad\quad \epsilon_t = r_t - \hat{r}_t$&lt;/li&gt;&#xA;&lt;li&gt;$ \quad\quad \sigma^2_t = \alpha_0 + \alpha_1 \epsilon_{t-1} ^ 2 + \beta_1 \sigma_{t-1} ^ 2$&lt;/li&gt;&#xA;&lt;li&gt;$\quad$ Next $t$&lt;/li&gt;&#xA;&lt;li&gt;$\quad loglik_b = \sum_t^T \left\{ - \frac{1}{2} \log(\sigma^2_t) - \frac{1}{2}\epsilon_t^2 / \sigma^2_t \right\} $&lt;/li&gt;&#xA;&lt;li&gt;Next $b$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;At each iteration $b$, the log-likelihood function value ($loglik_b$) is determined, which needs to be maximized over the $B$ iterations, that is, ensure it increases during iterations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Parameter results after $B=10,000$ iterations:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mu=0.000745264$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\phi=-0.110093524$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\alpha_0=0.00000401$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\alpha_1=0.117396192$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\beta_1=0.849342676$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is a plot of the fitted SP500 index (Yahoo ^GSPC) volatility, $\sigma_t$, for dates 1/2/2001 to 10/31/2013.  The subprime mortgage crisis in 2008 and debt ceiling in 2011 are very visible. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/IM37D.gif&quot; alt=&quot;Fitted SP500 volatility, $\sigma_t$, from 2001 to 2013&quot;&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, below is a plot of the observed (input) log-returns (blue), $r_t$, and predicted GARCH-filtered returns (red), $\hat{r}_t$, revealing that volatility clustering was removed. &#xA;&lt;img src=&quot;https://i.stack.imgur.com/dKLyO.gif&quot; alt=&quot;GARCH-filtered SP500 log-returns&quot;&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user6430" LastEditorDisplayName="user6430" LastEditDate="2018-03-24T17:28:59.373" LastActivityDate="2018-03-24T17:28:59.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28428" PostTypeId="1" AcceptedAnswerId="28433" CreationDate="2016-08-01T20:51:46.533" Score="4" ViewCount="5099" Body="&lt;p&gt;I would like to show explicitly the rate of convergence of Monte Carlo method to be $O(\sqrt{n})$, where $n$ is the number of simulation paths. Assume I want to do that with a price of a European call option. That is, I pick an analytic solution for the price and start my simulation: fix the number of time steps, say 100 and choose a sequence of paths: $100, 400, 1600, 6400$, and I should see the error between the analytical solution and the one generate by MC decrease by $4$? Would that be the example how to generate it?&lt;/p&gt;&#xA;" OwnerUserId="22823" LastEditorDisplayName="user16651" LastEditDate="2016-08-01T21:21:14.773" LastActivityDate="2016-08-02T09:20:17.840" Title="rate of convergence for Monte Carlo" Tags="&lt;monte-carlo&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="28429" PostTypeId="1" AcceptedAnswerId="28439" CreationDate="2016-08-01T23:19:20.660" Score="3" ViewCount="1280" Body="&lt;p&gt;I would like to know if someone could provide a summarized view of the advantages and disadvantages of the SABR model used to price FX options?&lt;/p&gt;&#xA;" OwnerUserId="18555" LastActivityDate="2016-08-02T16:56:48.993" Title="SABR in FX market: Advantages / disadvantages" Tags="&lt;option-pricing&gt;&lt;volatility&gt;&lt;stochastic-volatility&gt;&lt;sabr&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28430" PostTypeId="2" ParentId="28361" CreationDate="2016-08-02T00:58:03.433" Score="1" Body="&lt;p&gt;The capm doesn't care whether the risk free rate is positive or negative.  In fact I'm not aware of any financial theory that is rendered invalid by negative rates.  The only thing that's special about zero rate level is the fact that you can attain zero rate by holding physical cash.  However it's impractical to hold large amounts of physical cash, so thats of limited relevance. &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-08-02T00:58:03.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28432" PostTypeId="2" ParentId="28428" CreationDate="2016-08-02T08:23:40.657" Score="4" Body="&lt;p&gt;Since you talk about time steps, I assume you use a discretization scheme (like Euler) to simulate your asset. In that case, you have two errors:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $X$ be the true asset, let $X^{M}$ be the discretized asset with $M$ time-steps and let $x^{M,i}$ for $i=1\dots n$ the $n$ paths.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e $(x^{M,i})_{i=1\dots n}$ is a $n$-sample of $X^{M}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you have :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}[f(X_T)]-\frac{1}{n}\sum_{i=1}^n f(x^{M,i}_T) = \underbrace{\mathbb{E}[f(X_T)]-\mathbb{E}[f(X^M_T)]}_{\text{discretization error}}+\underbrace{\mathbb{E}[f(X^M_T)]-\frac{1}{n}\sum_{i=1}^n f(x^{M,i}_T)}_{\text{Monte carlo error}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Discretization error is governed by $\frac{1}{M}$ to the power of the order of the scheme.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;MonteCarlo error is governed as you said.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastEditorUserId="20201" LastEditDate="2016-08-02T08:49:05.627" LastActivityDate="2016-08-02T08:49:05.627" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28433" PostTypeId="2" ParentId="28428" CreationDate="2016-08-02T08:38:36.747" Score="8" Body="&lt;p&gt;The estimation error is a &lt;em&gt;random variable&lt;/em&gt; and not a simple scalar. As such, when performing one-shot assessments, you could always end up observing that using $6400$ paths provides a &quot;better&quot; price estimate than using $100$ of them. What matters is to investigate the &lt;em&gt;variance&lt;/em&gt; of the estimator rather than looking at pointwise values it can take (*)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get a graphical feel for the Monte Carlo rate of convergence, you'll need an exact price to compare your MC estimations to. For a European option and under the BS modelling framework, this price is given by the celebrated BS formula. Let's denote it by $C$. Similarly, let's assume you've picked a discretisation scheme for your SDE (although it's not needed for European contingent claims) and managed to simulate $N$ paths, hence $N$ values for the terminal asset price $S_T$:&#xA;$$ S_T^{(n)},\ \forall n=1,\dots,N $$&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Form a Monte Carlo estimator $\hat{C}_n$ of the true option price $C$ by using only $n$ paths out of the total $N$.&#xA;$$ \hat{C}_n = \frac{1}{n} \sum_{i=1}^n e^{-rT} f(S_T^{(i)}) $$&lt;/li&gt;&#xA;&lt;li&gt;Repeating this for all $n=1,\dots,N$ gets you a sequence of estimators $\{ \hat{C}_n \}_{n=1}^N$.&lt;/li&gt;&#xA;&lt;li&gt;Plot the sequence $\{X_n\}_{n=1}^N$ where $X_n = \vert \hat{C}_n - C \vert$ in a log-log scale (x-axis = simulations used $n$, y-axis = $X_n$).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Due to CLT (as noted by @Behrouz Maleki), you should then observe that the &quot;backbone&quot; of your graph is a straight line of slope $-\frac{1}{2}$ as illustrated in the bottom subplot below (**)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/PkHgw.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/PkHgw.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(*) We can look only at variance because we know the &lt;em&gt;mean&lt;/em&gt; is fine: MC estimators are unbiased (leaving aside discretisation-related bias as made explicit in @MJ73550's answer).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(**) You may want to skip the first simulations and start directly with $n=100$ to avoid polluting your graph.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-08-02T09:20:17.840" LastActivityDate="2016-08-02T09:20:17.840" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="28434" PostTypeId="2" ParentId="28428" CreationDate="2016-08-02T08:42:01.737" Score="2" Body="&lt;p&gt;If you are pricing a standard European-style option then there is no need to have any time-steps and any discretization error can be avoided. You can jump directly to the expiry time of the option in $T$ years using the formula&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S(T)=S(0) \exp \left( (r-\sigma^2/2)T + \sigma \sqrt{T} g \right)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $g$ is an independent Gaussian draw from $N(0,1)$. If you compare the results of this simulation to the output of the Black-Scholes European option pricing formula then you should see the inverse square root dependence of the error. &lt;/p&gt;&#xA;" OwnerUserId="12240" LastActivityDate="2016-08-02T08:42:01.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28436" PostTypeId="2" ParentId="28426" CreationDate="2016-08-02T09:19:19.570" Score="2" Body="&lt;p&gt;This is a misnomer by Cochrane and Piazzesi. It should simply be called the continuously compounded yield. &lt;/p&gt;&#xA;" OwnerUserId="12240" LastActivityDate="2016-08-02T09:19:19.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28438" PostTypeId="1" AcceptedAnswerId="30310" CreationDate="2016-08-02T12:49:56.210" Score="3" ViewCount="4036" Body="&lt;p&gt;I am working on a portfolio optimisation that requires me to constrain on the number of assets used, e.g from S&amp;amp;P500 build a 20 asset portfolio that is feasible. After doing some research I came to the conclusion that there are no non-commercial solvers freely available that can handle mixed integer and quadratic problems (I probably need SOCP as well). So I thought about a pre-optimisation step, i.e use a MIP solver to get me those 20 assets that I can then use in CVXOPT afterwards. Or any heuristic approach like genetic programming. Maybe worth mentioning that I would like to keep it as simple as possible as a first step. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question now is, has anyone experience how this is usually implemented? Is the MIP approach a feasible one? Or can I do s.th along the lines of PCA analysis first and pick the top 20 non correlated assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If mixed integer programming is the way to go does anyone have a brief python example where I could get an idea how it can be implemented?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Implementation od David's LASSO suggestion using cvxpy&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import numpy as np&#xA;import cvxpy as cvx&#xA;&#xA;np.random.seed(1)&#xA;n = 100&#xA;&#xA;mu = np.abs(np.random.randn(n, 1))&#xA;Sigma = np.random.randn(n, n)&#xA;Sigma = Sigma.T.dot(Sigma)&#xA;&#xA;w = cvx.Variable(n)&#xA;lambda_ = cvx.Parameter(sign=&quot;positive&quot;)&#xA;range_ = np.arange(0,100,1)&#xA;&#xA;ret = mu.T*w&#xA;risk = cvx.quad_form(w, Sigma)&#xA;&#xA;objective = cvx.Minimize(risk + lambda_*cvx.norm(w,1))&#xA;constraints = [cvx.sum_entries(w) == 1, w &amp;gt;= 0]&#xA;prob = cvx.Problem(objective, constraints)&#xA;&#xA;weights_count = []&#xA;&#xA;for lambda_vals in range_:&#xA;    print 'Lambda : ',lambda_vals &#xA;    lambda_.value = lambda_vals&#xA;&#xA;    prob.solve(verbose=False)&#xA;    print prob.status&#xA;&#xA;    output = []&#xA;    for i in range(len(w.value)):&#xA;        output.append(round(w[i].value,2))&#xA;&#xA;    weights_count.append(sum(1 for i in output if i &amp;gt; 0))&#xA;&#xA;print weights_count&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5366" LastEditorUserId="5366" LastEditDate="2017-08-07T14:40:07.943" LastActivityDate="2017-08-07T14:40:07.943" Title="Mean Variance portfolio optimisation (Long Only) CVXPY including cardinality constraint" Tags="&lt;portfolio-optimization&gt;&lt;python&gt;&lt;mean-variance&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28439" PostTypeId="2" ParentId="28429" CreationDate="2016-08-02T16:56:48.993" Score="5" Body="&lt;p&gt;Here you can refer to the previously asked question regarding the advantages and disadvatanges of the volatility surface:-&#xA; &lt;a href=&quot;https://quant.stackexchange.com/questions/5981/what-are-the-advantages-disadvantages-of-these-approaches-to-deal-with-volatilit&quot;&gt;What are the advantages/disadvantages of these approaches to deal with volatility surface?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To my knowledge, the main advantage of using SABR in comparison to other models like Heston is that, SABR assumes lognormal distribution whereas heston assumes normal distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also refer to the below article:-&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://dspace.library.uu.nl/bitstream/handle/1874/204290/VlamingGeeskeMaster,SABRmodel.pdf?sequence=1&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://dspace.library.uu.nl/bitstream/handle/1874/204290/VlamingGeeskeMaster,SABRmodel.pdf?sequence=1&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18663" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2016-08-02T16:56:48.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28440" PostTypeId="1" AcceptedAnswerId="29461" CreationDate="2016-08-02T17:16:34.647" Score="0" ViewCount="116" Body="&lt;p&gt;I'm trying to implement BlackProcess with Quantlib (in C#) and the result I get for NPV() is not inline with some resources I can find online. Here is my code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;var underlyingH = new Handle&amp;lt;Quote&amp;gt;(new SimpleQuote(27.77));&#xA;var underlierVolatility = 0.22;&#xA;var dayCounter = new Actual365Fixed();&#xA;var settlementDate= DateTime.UtcNow;&#xA;&#xA;var flatTermStructure = new Handle&amp;lt;YieldTermStructure&amp;gt;(new FlatForward(settlementDate, 0.001, dayCounter));&#xA;var flatVolTs = new Handle&amp;lt;BlackVolTermStructure&amp;gt;(new BlackConstantVol(settlementDate, calendar, underlierVolatility, dayCounter ));&#xA;var computationEngine = new BlackProcess(underlyingH, flatTermStructure, flatVolTs);&#xA;&#xA;// Option&#xA;var payoff = new PlainVanillaPayoff(type, (double)option.Instrument.Strike);&#xA;var europeanOption = new VanillaOption(payoff, new EuropeanExercise(option.Instrument.Expiry.DateTime));&#xA;&#xA;// Black-76 on european option&#xA;europeanOption.setPricingEngine(new AnalyticEuropeanEngine(computationEngine));&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The resources I use to compare my result are:&#xA;&lt;a href=&quot;http://lombok.demon.co.uk/financialTap/options/bond/shortterm&quot; rel=&quot;nofollow&quot;&gt;http://lombok.demon.co.uk/financialTap/options/bond/shortterm&lt;/a&gt;&#xA;&lt;a href=&quot;https://commoditymodels.files.wordpress.com/2012/07/black-76-calculator.xls&quot; rel=&quot;nofollow&quot;&gt;https://commoditymodels.files.wordpress.com/2012/07/black-76-calculator.xls&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: What can create a difference in NPV (1-2% diff) in the result I get form QuantLib according to vanilla engines we can find online?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suspect a mistake in the way I use the different &quot;parameters&quot; like:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;FlatForward&lt;/li&gt;&#xA;&lt;li&gt;BlackConstantVol&lt;/li&gt;&#xA;&lt;li&gt;Actual365 calendar&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I admit having expected very (very) close results.&lt;/p&gt;&#xA;" OwnerUserId="17170" LastActivityDate="2016-08-04T07:42:12.323" Title="Premium result with BlackProcess not in line with online engines" Tags="&lt;programming&gt;&lt;quantlib&gt;&lt;black76&gt;" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="28441" PostTypeId="1" AcceptedAnswerId="28442" CreationDate="2016-08-02T18:09:22.147" Score="2" ViewCount="143" Body="&lt;p&gt;I am looking at the Black Derman Toy local short rate model as&#xA;$$d\log r(t)=\alpha(t)(\theta (t)-\log r(t))dt+\sigma dW(t)$$&#xA;under RN measure. I would like to derive the bond price PDE. For that I consider $f(t,r(t))$ to be a price of a bond and by Feynman Kac I want to write $d[D(t)f(t)]$ and since this has to be a martingale($D(t)$ is a discount factor), I can set $dt$ term to zero. This is where I am stuck. I don't know what $dr(t)$ is!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I start by $$d(D(t)f(t))=fdD+Ddf+dfdD$$&#xA;where $dD=-rDdt$, and $df=f_tdt+f_rdr+0.5f_{rr}drdr$, and I need $dr$, can I get this from the $d\log r(t)$ in some way?&lt;/p&gt;&#xA;" OwnerUserId="22823" LastEditorUserId="16148" LastEditDate="2016-08-02T18:25:39.047" LastActivityDate="2016-08-02T18:25:39.047" Title="Black Derman Toy short rate and PDE" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;parabolic-pde&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28442" PostTypeId="2" ParentId="28441" CreationDate="2016-08-02T18:19:25.473" Score="2" Body="&lt;p&gt;Note that $r(t)=e^{\ln r(t)}$. Then&#xA;\begin{align*}&#xA;dr(t) &amp;amp;= e^{\ln r(t)} d\ln r(t) + \frac{1}{2}e^{\ln r(t)}\langle d\ln r(t), d\ln r(t)\rangle\\&#xA;&amp;amp;=r(t) \big[\alpha(t)(\theta (t)-\log r(t))dt+\sigma dW(t) \big] + \frac{1}{2}\sigma^2 r(t) dt\\&#xA;&amp;amp;=r(t)\Big[\Big(\frac{1}{2}\sigma^2 + \alpha(t)(\theta (t)-\log r(t))\Big)dt + \sigma dW(t)\Big].&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-08-02T18:19:25.473" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28443" PostTypeId="2" ParentId="28319" CreationDate="2016-08-02T18:31:32.673" Score="6" Body="&lt;p&gt;Ok, there is a basic misconception about Implied Volatility. IV is derived &lt;strong&gt;from&lt;/strong&gt; the price of the options in the market. Not the other way around. We do use different IVs to estimate option prices in other conditions, but that is just bringing the equations full circle. The Black-Scholes and many other options models allow us to calculate the risk neutral (less cost of carry) Volatility that is &lt;strong&gt;Implied&lt;/strong&gt; by the current price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, a $7.85 price of a GOOGL call option with a 797.50 strike that is roughly at the money &lt;strong&gt;&lt;em&gt;Implies&lt;/em&gt;&lt;/strong&gt; that the stock has a &lt;strong&gt;&lt;em&gt;Volatility&lt;/em&gt;&lt;/strong&gt; of roughly 14.5%. Meaning that at a point 1 year from now a 1 standard deviation range would roughly be between 14.5% higher and 14.5% lower than the current price of GOOGL. Given stable conditions, GOOGL would have a price between those points 68.2% of the time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This also assumes that the prices have a log-normal distribution, little to no excess kurtosis, no appreciable skew, are i.i.d. (not true) and many other factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Black-Scholes and other formulas can also take IV and several other factors and calculate a price for the option. This is a handy tool to use when you would like to know the price of an option would be relative to changes in the price of the underlying, time, IV changes, interest rate changes, etc..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The real difficulty comes from the fact that the IV you are working with is just an extrapolation of market prices.  This includes the distortions created from the profit motives of traders, incomplete information, portions of the options market not being motivated by profit (options as insurance ie. long/short funds).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to know the value of an option you need to have a clear idea of what you believe the forecast volatility of the stock is. Once you have a way to determine the forecast volatility that makes sense to you that number can be used as the IV input to Black-Scholes or other equation. From that you can get the value of the option based on your belief of what will happen in the market.&lt;/p&gt;&#xA;" OwnerUserId="19959" LastEditorUserId="19959" LastEditDate="2016-08-17T20:28:30.260" LastActivityDate="2016-08-17T20:28:30.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28446" PostTypeId="1" AcceptedAnswerId="29480" CreationDate="2016-08-02T20:02:04.977" Score="1" ViewCount="436" Body="&lt;p&gt;I know Asian option is defined as follow&#xA;$$\left(\frac{1}{T}\int_{0}^{T}S_t dt-K\right)^+$$&#xA;Is there a good idea behind this definition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="22715" LastActivityDate="2016-08-04T21:14:57.173" Title="Asian option and option pricing" Tags="&lt;asian-option&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="28448" PostTypeId="1" CreationDate="2016-08-02T20:47:51.490" Score="4" ViewCount="1795" Body="&lt;p&gt;Is there a good web-based option for back-testing of equity options trading strategies.&lt;/p&gt;&#xA;" OwnerUserId="22836" LastActivityDate="2016-08-18T19:11:14.667" Title="Web-based Backtesting for Options Traders" Tags="&lt;options&gt;&lt;monte-carlo&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="4" ClosedDate="2017-01-14T20:32:58.870" ContentLicense="CC BY-SA 3.0" />
  <row Id="28449" PostTypeId="1" AcceptedAnswerId="28451" CreationDate="2016-08-02T21:50:56.300" Score="1" ViewCount="1249" Body="&lt;p&gt;The data is in the following format:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;{&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Time= 650 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Volume=700&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Last=89.22&lt;/p&gt;&#xA;&#xA;&lt;p&gt;High=89.56&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Low=89.20&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Open=89.25&lt;/p&gt;&#xA;&#xA;&lt;p&gt;}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that the time value represents the current minute of the day, market open being 570 and close 960 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also assume that volume means that in the 650th minute of market trading 700 shares of this stock were traded &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I am confused about what high/low and open/last mean?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;from my understanding last is the last price the stock was traded at during the previous minute of market activity, open is the price its traded at the very beginning of the current minute and high and low are the highest and lowest prices the stock was traded at any moment within that minute.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above explanation is the most logical reasoning I can think of for this type of data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anybody who has experience working with intraday ticker data please confirm or correct my reasoning. &lt;/p&gt;&#xA;" OwnerUserId="20245" LastActivityDate="2016-08-03T02:52:11.347" Title="How to interpret minute by minute ticker data" Tags="&lt;equities&gt;&lt;data&gt;&lt;high-frequency&gt;&lt;historical-data&gt;&lt;tick-data&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="28450" PostTypeId="2" ParentId="28448" CreationDate="2016-08-02T22:07:03.203" Score="0" Body="&lt;p&gt;Thinkorswim brokerage platform has some backtesting capability. Not sure how good it is.&lt;/p&gt;&#xA;" OwnerUserId="7973" LastActivityDate="2016-08-02T22:07:03.203" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28451" PostTypeId="2" ParentId="28449" CreationDate="2016-08-03T02:52:11.347" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;But I am confused about what high/low and open/last mean?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The &lt;strong&gt;high&lt;/strong&gt; (&lt;strong&gt;low&lt;/strong&gt;) is the highest (lowest) trade price that occurred within the minute.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The &lt;strong&gt;open&lt;/strong&gt; price is the price of the first trade that occurred within the minute.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The &lt;strong&gt;close&lt;/strong&gt; price, also known as the &lt;strong&gt;last&lt;/strong&gt; price, is the price of the last trade that occurred within the minute.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The concept of open-high-low-close is also mutually motivated by the use of candlestick charts, thus giving rise to the term &quot;&lt;strong&gt;OHLC&lt;/strong&gt; chart&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's probably two other things that you may not realize yet until you start looking at such time series in an illiquid product or try to implement it in code:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;By definition, the &lt;strong&gt;time&lt;/strong&gt; doesn't have to print if no trade took place within the minute.&lt;/li&gt;&#xA;&lt;li&gt;By construction, we use only trades in the half-open interval $[t, t+1)$, since the intervals must be disjoint.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2016-08-03T02:52:11.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28452" PostTypeId="2" ParentId="28423" CreationDate="2016-08-03T07:29:59.133" Score="2" Body="&lt;p&gt;You can do a Chow test with the &lt;a href=&quot;http://cran.r-project.org/web/packages/strucchange/index.html&quot; rel=&quot;nofollow&quot;&gt;strucchange&lt;/a&gt; package in R. You can find the full documentation &lt;a href=&quot;https://cran.r-project.org/web/packages/strucchange/strucchange.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The package comes with a &lt;a href=&quot;https://cran.r-project.org/web/packages/strucchange/vignettes/strucchange-intro.pdf&quot; rel=&quot;nofollow&quot;&gt;vignette&lt;/a&gt; which shows how to use it (see p. 9ff. if &#xA;you want to dive into an example without further ado).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know whether there is an appropriate Excel add-in available but in general I would not recommend doing these more sophisticated analyses in Excel anyway.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2016-08-03T07:44:27.803" LastActivityDate="2016-08-03T07:44:27.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28454" PostTypeId="1" AcceptedAnswerId="29469" CreationDate="2016-08-03T15:50:55.360" Score="3" ViewCount="1348" Body="&lt;p&gt;I'm self-studying and I'm considering the below example. The specific example is not especially relevant, but I included it for reference. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to understand the relationship between a replicating portfolio and the Black-Scholes equation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is my understanding that a replicating portfolio for a put involves short selling stock and lending money. There would be a positive cash flow of $Se^{-\delta T} N(-d_1)$ and a negative cashflow of $Ke^{-rT} N(-d_2).$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the Black-Scholes formula for a put is: $P = Ke^{-rT}N(-d_2) - Se^{-\delta T} N(-d_1)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This formula suggests that a long position in a put is a &lt;em&gt;positive&lt;/em&gt; cashflow of $Ke^{-rT} N(-d_2)$ and a &lt;em&gt;negative&lt;/em&gt; cashflow of $Se^{-\delta T} N(-d_1)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So wouldn't the replicating portfolio create a &lt;em&gt;short&lt;/em&gt; position put, while the Black Scholes formula provides a &lt;em&gt;long&lt;/em&gt; position put (since the signs are swapped comparing the replicating portfolio to the Black Scholes formula for a put)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should examples like the one below clarify what position the put is in?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically I'm looking for clarification on the signs of the terms in the formula. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/RfP82.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/RfP82.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5641" LastActivityDate="2016-08-04T12:21:47.630" Title="Understanding the relationship between the Black-Scholes formula and a replicating portfolio" Tags="&lt;black-scholes&gt;&lt;replication&gt;&lt;self-study&gt;&lt;put&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28455" PostTypeId="2" ParentId="28032" CreationDate="2016-08-03T19:01:51.427" Score="1" Body="&lt;p&gt;I will give an answer focusing on the econometric aspect of the question. (I could be missing some basic ideas in finance, though.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If each different regressor is roughly uncorrelated with any linear combination of the remaining regressors, then each of the strategies could work and seem reasonable within the given model. However, focusing on the effect of a single variable is less efficient than focusing on all the effects together, so the last approach should dominate the former ones. (There is one caveat, though, which is overfitting if you are using OLS estimation without regularization/shrinkage.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the different regressors are (somewhat highly) correlated with some linear combination of other regressors, the first two approaches could be dominated by estimating simple regresions omitting all variables but the regressors of interest. While this may seem strange in the context of explanatory modelling (why would you omit relevant regressors and thus get inconsistent estimates?), it actually works in predictive modelling; see e.g. F. X. Diebold's blog post on the so-called &quot;predictive consistency&quot;: &lt;a href=&quot;http://fxdiebold.blogspot.no/2014/01/causality-and-t-consistency-vs.html&quot; rel=&quot;nofollow&quot;&gt;&quot;Causality and T-Consistency vs. Correlation and P-Consistency&quot;&lt;/a&gt;. In any case, these approaches would still be dominated by the third approach (using prediction from the full model) (but again, the same caveat applies).&lt;/p&gt;&#xA;" OwnerUserId="19645" LastEditorUserId="19645" LastEditDate="2016-08-28T16:16:57.927" LastActivityDate="2016-08-28T16:16:57.927" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="28456" PostTypeId="1" AcceptedAnswerId="29465" CreationDate="2016-08-04T00:01:39.277" Score="2" ViewCount="509" Body="&lt;p&gt;In an HJM model the forward rate dynamics follow&#xA;$$&#xA;df_t(T) =a_t(f_t(T))dt+b_t(f_t(T))dW_t&#xA;$$&#xA;where $W_t$ is a $d$-dimensional brownian motion, $b_t$ takes values in $\mathbb{R}^{d\times d}$ and $a_t$ takes values in $\mathbb{R}^d$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My confusion arises when we speak of the no-arbitrage condition&#xA;$$&#xA;a_t = b_t\int_0^t b_s^T ds,&#xA;$$&#xA;shouldn't the right hand side be $d\times d$ dimensional and the left hand side be $d$ dimensional?&lt;/p&gt;&#xA;" OwnerUserId="22846" LastActivityDate="2016-08-04T08:25:42.997" Title="Understanding the HJM drift condition's dimensions" Tags="&lt;stochastic-processes&gt;&lt;no-arbitrage-theory&gt;&lt;sde&gt;&lt;stochastic-control&gt;&lt;heath-jarrow-morton&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="28457" PostTypeId="2" ParentId="28456" CreationDate="2016-08-04T00:23:22.510" Score="1" Body="&lt;p&gt;Your issue is that you misinterpreted the NA criterion, it reads:&#xA;$$&#xA;a_t(x) \triangleq \sum_{i=1}^{\infty} \left(b^i_t(x) \int_0^x (b_t^i(u))^T du\right)e_i,&#xA;$$&#xA;where $b^i_t$ denotes the $i^{th}$ column of the volatility matrix $b_t$, $^T$ the transpose and $e_i$ the $i^{th}$ standard basis vector in $\ell^1$.  In other words the $i^th$ coordinate of the vector $a_t(x)$ is given by:&#xA;$$&#xA;a_t^i(x)\triangleq b_t^i(x)\int_0^x b_t^i(u)^T du.  &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course if you want a $d$-dimensional process simply take $\mathbb{R}^d$ instead of $\ell^1$ and assume the sum to go to $d$ instead of being infinite.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helped!&lt;/p&gt;&#xA;" OwnerUserId="11582" LastEditorUserId="11582" LastEditDate="2016-08-04T00:28:39.370" LastActivityDate="2016-08-04T00:28:39.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29456" PostTypeId="2" ParentId="28456" CreationDate="2016-08-04T01:01:18.623" Score="0" Body="&lt;p&gt;Note that, for a given maturity $T$, there is only one forward rate process $\{f_t(T), 0 \le t \le T\}$. That is, $f_t(T)$ is one-dimensional. Therefore, $b_t(f_t(T))$ can only be a $d$-dimensional vector, where $d\ge 1$; it  can not be a $d\times d$ matrix，if $d&amp;gt;1$. Moreover, $a_t(f_t(T))$ is a scalar function, that is, it is not a vector. See the book &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/3540209662&quot; rel=&quot;nofollow&quot;&gt;Martingale Method for Financial Modeling&lt;/a&gt; or the book &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/3540221492&quot; rel=&quot;nofollow&quot;&gt;Interest Rate Models - Theory and Practice&lt;/a&gt; for more details.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-08-04T01:32:25.877" LastActivityDate="2016-08-04T01:32:25.877" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29458" PostTypeId="1" AcceptedAnswerId="29466" CreationDate="2016-08-04T01:35:05.737" Score="1" ViewCount="1945" Body="&lt;p&gt;Let $R(t)$ be an interest rate process and $D(t)=e^{-\int_0^t R(s)ds}$ and $B(t,T)$ the price at time t of a zero coupon bond maturing at T.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone explain why this formula holds? $D(t)B(t,T) = \widetilde{E}[D(T)|F(t)]$? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following is my understanding. Please correct me if I am incorrect. To apply to argument of risk neutral pricing, one needs to first construct a portfolio of assets whose payoff matches the payoff of the derivative security under dynamic hedge. For example, the replicating portfolio of a European call is its underlying stock and risk free bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similar, to price a zero coupon bond, one needs to find a replicating portfolio as well. If this is right, What is the replicating portfolio then?&lt;/p&gt;&#xA;" OwnerUserId="23846" LastEditorUserId="19887" LastEditDate="2016-08-04T08:00:07.407" LastActivityDate="2016-08-04T08:31:33.437" Title="What is the replicating portfolio for a zero coupon bond?" Tags="&lt;option-pricing&gt;&lt;fixed-income&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29460" PostTypeId="1" CreationDate="2016-08-04T04:38:27.027" Score="2" ViewCount="224" Body="&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Bond_credit_rating#Default_rates&quot; rel=&quot;nofollow&quot;&gt;Default rates&lt;/a&gt; are kind of probabilities, right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to use the Girsanov theorem in that context? For example if we have a table of real world probabilities, could we use the Girsanov theorem to convert those real world probabilities into risk-neutral probabilities? Maybe even &lt;a href=&quot;https://en.wikipedia.org/wiki/Forward_measure&quot; rel=&quot;nofollow&quot;&gt;forward&lt;/a&gt; probabilities?&lt;/p&gt;&#xA;" OwnerUserId="7788" LastActivityDate="2017-01-01T13:34:07.753" Title="Girsanov theorem and default rates in bond credit rating" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;probability&gt;&lt;default-probability&gt;&lt;girsanov&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29461" PostTypeId="2" ParentId="28440" CreationDate="2016-08-04T07:42:12.323" Score="1" Body="&lt;p&gt;Reframing this as an answer for future reference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all, what I'm writing here applies to the C++ version of QuantLib and its C# wrappers generated by SWIG; if you're using the QLNet native C# port, I've no idea how that works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By default, QuantLib works at a day resolution and will ignore the hour while calculating TTM, which caused the difference between your calculations and the QuantLib result.  (By the way, it's now quite clear to me how you got the TTM including the hour by calling the &lt;code&gt;yearFraction&lt;/code&gt; method on the day counter; that, too, should have worked at day resolution.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since version 1.7, it is possible to compile QuantLib so that it takes the time of day into account (the feature is not enabled by default because it causes some loss of performance). On Windows, uncomment the line&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;//#    define QL_HIGH_RESOLUTION_DATE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and recompile both QuantLib and the C# module.  On other systems, run&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;./configure --enable-intraday&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and recompile the whole thing. Again, this applies to the C++ version and the C# wrappers generated by SWIG.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2016-08-04T07:42:12.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29462" PostTypeId="2" ParentId="29458" CreationDate="2016-08-04T08:05:13.060" Score="0" Body="&lt;p&gt;Since rate is not a tradable directly, zero-coupon bond is an underlying itself. So you cannot replicate a zero-coupon because it is not a derivative&lt;/p&gt;&#xA;" OwnerUserId="23849" LastActivityDate="2016-08-04T08:05:13.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29463" PostTypeId="2" ParentId="29458" CreationDate="2016-08-04T08:08:28.763" Score="1" Body="&lt;p&gt;To replicate a zero-coupon bond,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;either the zero-coupon bond is a tradeable asset and you buy the zero coupon bond,&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;or you believe in a model and using other rates instruments, you set up a delta-hedging strategy.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-08-04T08:08:28.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29464" PostTypeId="2" ParentId="28154" CreationDate="2016-08-04T08:15:04.827" Score="2" Body="&lt;p&gt;There seems to be a problem in the QuantLib code with using a face amount other than 100.  If you initialize your bond helpers with face amount = 100 and rescale your price accordingly, the fit succeeds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suggest you file an issue at &lt;a href=&quot;https://github.com/lballabio/quantlib/issues&quot; rel=&quot;nofollow&quot;&gt;https://github.com/lballabio/quantlib/issues&lt;/a&gt; so that this can be fixed. In the meantime, you can rescale your prices during the fit.  Once you have the term structure, you can use it to price &lt;code&gt;Bond&lt;/code&gt; objects with the correct face amount.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;About the minimization method: by default, the simplex algorithm is used. &#xA;Currently, it's not possible to choose another one from Python (from C++, the chosen optimizer can be passed to the &lt;code&gt;NelsonSiegelFitting&lt;/code&gt; constructor).&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2016-08-04T08:15:04.827" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29465" PostTypeId="2" ParentId="28456" CreationDate="2016-08-04T08:25:42.997" Score="0" Body="&lt;p&gt;Without loss of generality, we assume $d=1$. Set &#xA;$$\gamma (t,f(t,T))=\int_{t}^{T}b(t,f(t,u))\,du$$&#xA;Indeed, we want to show&#xA;$$a(t,f(t,T))=b(t,f(t,T))\gamma(t,f(t,T))$$&#xA;By application of definition, we have&#xA;$$f(t,T)=-\frac{\partial \ln p(t,T)}{\partial T}$$&#xA;therefore&#xA;$$\ln p(t,T)=-\int_{t}^{T}{f(t,u)\,du}$$&#xA;hence&#xA;$$d\ln p(t,T)=r(t)dt-\int_{t}^{T}{df(t,u)\,du}$$&#xA;in other words&#xA;$$d\ln p(t,T)=\left(r(t)-\int_{t}^{T}{a(t,u)\,du}\right)dt+\gamma (t,T)\,d{{W}}(t)$$&#xA;By application of Ito's lemma, we have&#xA;$$d\left( \frac{p(t,T)}{B(t)} \right)=\frac{p(t,T)}{B(t)}\left(d\ln p(t,T)+\frac{1}{2}d[\ln p(t,T),\ln p(t,T)](t)-r(t)dt\right)$$&#xA;thus&#xA;$$d\left( \frac{p(t,T)}{B(t)} \right)=\frac{p(t,T)}{B(t)}\left( -\left[ \int_{t}^{T}{a (t,u)\,du} \right]dt+\frac{1}{2}{{\gamma }^{2}}(t,T)dt-\gamma (t,T)d{{W}}(t) \right)$$&#xA;we know ${p(t,T)}/{B(t)}$ is a martingale, so&#xA;$$-\left(\int_{t}^{T}{a (t,u)\,du} \right)+\frac{1}{2}{{\gamma }^{2}}(t,T)=0$$&#xA;i.e.&#xA;$$\int_{t}^{T}{a (t,u)\,du}=\frac{1}{2}{{\gamma }^{2}}(t,T)$$&#xA;therefore&#xA;$$\frac{d}{dT}\left(\int_{t}^{T}{a (t,u)\,du}\right)=\frac{1}{2}\frac{d}{dT}{{\gamma }^{2}}(t,T)$$&#xA;finally&#xA;$$a(t,f(t,T))=b(t,f(t,T))\gamma(t,f(t,T))=b(t,f(t,T))\int_{t}^{T}b(t,f(t,u))\,du$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastActivityDate="2016-08-04T08:25:42.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29466" PostTypeId="2" ParentId="29458" CreationDate="2016-08-04T08:31:33.437" Score="2" Body="&lt;p&gt;You are not completely right. Risk-neutral pricing means that the price you'll quote for a given instrument at a given point in time will be the same as the capital you'd require at the same point in time to build a self-financing strategy which will deliver exactly the same future cash flows. The replication mechanism need not be dynamic, it may be static (see for instance static replication of a forward contract by &quot;cash &amp;amp; carry&quot; argument).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This concept is quite intuitive and easy to grasp. However, assuming the existence of a risk-free investment vehicle, best known as the risk-free asset, along with a complete market model defined under a probability measure $\mathbb{P}$, noting that the above claim is strictly equivalent to saying that &lt;em&gt;&quot;any self-financing strategy should emerge as a martingale under a probability measure $\tilde{\mathbb{P}}$ equivalent to $\mathbb{P}$ and associated to the risk-free asset numéraire&quot;&lt;/em&gt; is far less intuitive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a lot of theory behind this last statement (see fundamental theorems of asset pricing). I invite you to investigate on your own as this would require a book to answer. But if you want to be convinced, just go back to the binomial model set up and observe how by using a replication argument, one can get rid of historical probabilities and define a new set of probabilities under which discounted asset prices are martingales.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the end of the day, if you have a complete market model, by absence of arbitrage, there should be a unique risk-neutral measure $\tilde{\mathbb{P}}$ under which:&#xA;$$ \frac{V_t}{B_t} \text{ is a } \tilde{\mathbb{P}}\text{-martingale} \tag{1} $$&#xA;for any self-financing strategy $V_t$ and $B_t = \exp(\int_0^t r(s) ds)$ the $t$-value of a risk-free cash account in which $1$ unit of currency has been invested at $t=0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Applying this in your case:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Investing in the ZC bond is a self-financing strategy: $V_t \to B(t,T)$ &lt;/li&gt;&#xA;&lt;li&gt;What you have defined as $D_t$ is the inverse of what we just defined as $B_t$: $B_t \to 1/D(t)$&lt;/li&gt;&#xA;&lt;li&gt;Claiming $(1)$ by definition means that, $\forall t$&#xA;$$ \frac{V_t}{B_t} = \mathbb{E}^{\tilde{\mathbb{P}}}\left[ \frac{V_T}{B_T} \vert \mathcal{F}_t \right] $$ which using the above notations writes:&#xA;$$ B(t,T) D(t) = \mathbb{E}^{\tilde{\mathbb{P}}}\left[ \underbrace{B(T,T)}_{=1} D(T) \vert \mathcal{F}_t \right] $$&#xA;hence&#xA;$$ B(t,T) = \mathbb{E}^{\tilde{\mathbb{P}}}\left[ 1 e^{-\int_t^T r(s) ds} \right] $$&#xA;where the first line is exactly the equality you gave and the second finds the following interpretation: the value of a contingent claim is the expectation of the discounted value of the future cash flows it shall pay, where the discount is performed at the risk-free rate.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2016-08-04T08:31:33.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29468" PostTypeId="2" ParentId="29460" CreationDate="2016-08-04T11:48:53.910" Score="2" Body="&lt;p&gt;Suppose I give you objective probabilities $\mathbb{P}(S_T \geq K)$ of an equity finishing &lt;em&gt;above&lt;/em&gt; a certain level $K$ at a future time $T$ (or in your case a survival probability in the form of default rates). Can you convert these to risk-neutral probabilities $\mathbb{Q}(S_T \geq K)$ ? Not immediately. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, I need to give you a model for the behaviour of $S_T$, or equivalently to specify the dynamics of the process $(S_t)_{t\in[0,T]}$ under the filtered probability space $(\Omega, \mathcal{F}, (\mathcal{F}_t)_{t\in[0,T]}, \mathbb{P})$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, simply noticing that&#xA;$$ \mathbb{Q}(S_T \geq K) = \mathbb{E}^\mathbb{Q} [\mathbb{1}(S_T \geq K)] = \mathbb{E}^\mathbb{P} \left[\mathbb{1}(S_T \geq K) Z_T \right] $$&#xA;with $$ Z_T = \left. \frac{d\mathbb{Q}}{d\mathbb{P}} \right\vert_{\mathcal{F}_T} $$&#xA;the Radon-Nikodym derivative of the measure change should do the trick (with a tractability depending on your modelling assumptions of course). Obviously, you will appeal to Girsanov to translate the dynamics I provided you under $\mathbb{P}$ under the equivalent measure $\mathbb{Q}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So to answer your question: 'No, it is not possible', at least not without setting up a proper modelling framework. In addition, the conversion will be one to one if and only if you assume a complete market model + no arbitrage (see fundamental theorems of asset pricing).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also notice that usually in the markets we do the opposite. We imply probabilities from quoted instruments and these are therefore obtained under $\mathbb{Q}$. The question is then, can we translate them under $\mathbb{P}$. The reasoning is the exact symmetric of the above.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-08-04T11:59:08.567" LastActivityDate="2016-08-04T11:59:08.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29469" PostTypeId="2" ParentId="28454" CreationDate="2016-08-04T12:14:56.037" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;It is my understanding that a replicating portfolio for a put involves short selling stock and lending money.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You cannot statically replicate an option. So this is not true in general, you'll need to re-balance your replicating portfolio (underlying + cash) dynamically if you want to replicate the option. This will imply sometimes buying stock and borrowing money.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Basically I'm looking for clarification on the signs of the terms in the formula&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Take the case $S=0$ and you'll see that the signs &#xA;$$ P(K,T) = Ke^{-rT}N(-d_2) - Se^{-\delta T} N(-d_1) $$&#xA;are indeed correct since in that case you need to find $P(K,T) = K e^{-rT} &amp;gt; 0$, because the payout of a put option is: $\max(K-S_T,0)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Extending this idea: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Call (Payoff $\to$ Price): $$\max({\color{blue}{+S}}_T{\color{blue}{-K}},0) \to C(K,T) = {\color{blue}{+S}}e^{-\delta T}\phi(d_1) {\color{blue}{-K}} e^{-rT}\phi(d_2)$$&lt;/li&gt;&#xA;&lt;li&gt;Put (Payoff $\to$ Price):  $$\max({\color{blue}{+K}}{\color{blue}{-S}}_T,0) \to P(K,T) = {\color{blue}{+K}}e^{-rT}N(-d_2) {\color{blue}{-S}} e^{-\delta T} N(-d_1)$$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-08-04T12:21:47.630" LastActivityDate="2016-08-04T12:21:47.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29470" PostTypeId="1" CreationDate="2016-08-04T13:13:23.653" Score="3" ViewCount="382" Body="&lt;p&gt;I have an &lt;strong&gt;unobservable&lt;/strong&gt; stochastic quantity $\lambda(t)$, which I analytically know the variance of, that is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Var}(\lambda(t))= \frac{\theta \sigma^2}{2\kappa}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My goal is to get an estimate of $\sigma^2$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can observe S and K historically at times $t=1,2,..$, and know that the following approximately holds&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \lambda(t) \approx S(t)+K(t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does it make sense to simply take the sample variance of the time series $(S(t)+K(t))$, let's call it $\hat{\sigma}^2_S$, and say that a reasonable estimate of $\sigma^2$ is $2 \kappa\frac{\hat{\sigma}^2_S}{\theta}$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It should be mentioned that the distribution of $\lambda$ is not pretty, but I have the mean and variance. &lt;/p&gt;&#xA;" OwnerUserId="19761" LastEditorUserId="467" LastEditDate="2017-01-05T06:43:15.743" LastActivityDate="2017-07-04T14:24:29.433" Title="How to estimate the variance of this stochastic process?" Tags="&lt;estimation&gt;&lt;variance&gt;" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29471" PostTypeId="1" AcceptedAnswerId="29474" CreationDate="2016-08-04T14:20:04.793" Score="3" ViewCount="398" Body="&lt;p&gt;I just have a question for the beginning of a proof: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose&#xA;$\frac{dS_{t}}{S_{t}}=(r_{t}-q_{t})dt+\sigma(t,S_{t})dW_{t}$&#xA;with $r,q,S$ stochastic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the book I read, it is written: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We define the Arrow-Debreu price $\psi(x',y',z',t)$  as the present value of a derivative that pays off $\delta([S_{t},r_{t},q_{t}]-[x',y',z'])$ at time $t$. This is related to the $t$-forward measure probability density of $(x,y,z)$, $\phi(x,y,z,t)$ by: $$\psi(x,y,z,t)=B(0,t)\ \phi(x,y,z,t)$$ as can be seen from the defining equation for $\psi$ and $\phi$: &#xA;$V(S_{0},r_{0},q_{0},t=0)=\iiint V(x,y,z,t)\ \psi(x,y,z,t)\ dx\ dy\ dz$ and &#xA;$V(S_{0},r_{0},q_{0},t=0)=B(0,t)\ \iiint V(x,y,z,t)\ \phi(x,y,z,t)\ dx\ dy\ dz$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With these 2 last equations I understand why: $\psi(x,y,z,t)=B(0,t)\ \phi(x,y,z,t)$. But I don't understand why $V(S_{0},r_{0},q_{0},t=0)=\iiint V(x,y,z,t)\ \psi(x,y,z,t)\ dx\ dy\ dz$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because for me we have $V(S_{0},r_{0},q_{0},t=0)=\mathbb{E}^{Q}[e^{-\int_{0}^{t}r_{s}ds}\ V(S_{t},r_{t},q_{t},t)]$ so where is the discount term $e^{-\int_{0}^{t}r_{s}ds}$ gone?&#xA;Thanks&lt;/p&gt;&#xA;" OwnerUserId="15738" LastEditorUserId="20465" LastEditDate="2016-08-09T18:10:26.040" LastActivityDate="2016-08-09T18:10:26.040" Title="Dupire's formula proof" Tags="&lt;stochastic-calculus&gt;&lt;pricing-formulae&gt;&lt;density&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29472" PostTypeId="2" ParentId="15199" CreationDate="2016-08-04T14:20:41.947" Score="-1" Body="&lt;p&gt;Wealth management and asset management are both services that are closely related to one another. Both wealth management and asset management come under the umbrella of private banking services. Wealth management and asset management are both financial services that are aimed at growing wealth, increasing investment income, increasing profitability and maximizing returns. Wealth management is quite broader in perspective and includes asset management services, investment management, real estate planning, tax planning, etc. Asset management, on the other hand, is related to the management of assets and investments such as stocks, bonds, real estate and other assets.&lt;/p&gt;&#xA;" OwnerUserId="23851" LastActivityDate="2016-08-04T14:20:41.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29473" PostTypeId="1" AcceptedAnswerId="29595" CreationDate="2016-08-04T14:54:43.607" Score="10" ViewCount="503" Body="&lt;p&gt;I'm reading the following two papers (&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2529691&quot; rel=&quot;noreferrer&quot;&gt;first&lt;/a&gt;, &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2529684&quot; rel=&quot;noreferrer&quot;&gt;second&lt;/a&gt;) which suggest a so called &quot;stochastic collocation method&quot; to obtain an arbitrage free volatility surface very close to an initial smile stemming from a sabr. The first paper provides background about the method in general, where the second one is a nice short overview more applied to the specific situation I'm interested in. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So we observe $\sigma(K_i)$ implied normal volatilities (bpsvol) in the market for certain reltaive strikes $ATM + x$bps. $x$ can be something like $25, -50$ etc. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;1. Step: Calibrate an initial Sabr&lt;/strong&gt;&#xA;  Here I fit a Sabr using the Hagans paper assuming a nomral model, i.e. $\beta = 0$. Based on the original paper of Hagan&#xA;  $$ \sigma_N(K) = \alpha\frac{\zeta}{\hat{x}{(\zeta)}}\left(1+\frac{2-3\rho^2}{24}\nu^2\tau_{exp}\right)$$&#xA;  where $\zeta = \frac{\nu}{\alpha}(f-K)$ and $\hat{x}{(\zeta)}=\log{\left(\frac{\sqrt{1-2\rho\zeta+\zeta^2}-\rho+\zeta}{1-\rho}\right)}$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is straight forward and can be tuned to get dsirable results. In what follows we assume such a fit was successful and we were able to find a solution $(\alpha,\nu,\rho)$.&#xA;As outlined for low strikes and logner maturities the implied density function can go negative. In the case of swaption we see low rates and have long maturities, so I would like to remove this butterfly arbitrage using the technique described in the papers above. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The remaining steps are based on the second paper. The idea in short is to use a cheap distribution $F_X$, easy to sample from, to sample a expansive one, $F_Y$. The goal is to find a function $g$ such that &#xA;$$ F_X(x) = F_Y(g(x))$$&#xA;and $Y\overset{d}=g(X)$. They susggest to use the following approximation&#xA;$$y_n \approx g_N(x_n) = \sum_{i=1}^Ny_i l(x_n)$$ a polynomial expansion. Note, $x_i$ and $y_i$ will be strike. How we choose this strikes is not important for my question.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;2. Step: Survival distribution:&lt;/strong&gt; As in the paper we want to choose $X$ to be normally distributed and $Y$ should be the survival distribution function (SDF) from the sabr model, which is given by equation 2.3 in the second paper&#xA;  $$G_Y(y)=1-\int_{-\infty}^y f_Y(x)dx =  \int^{\infty}_y f_Y(x)dx=-\frac{\partial V_{call}(t,K)}{\partial K}\rvert_{K=y}\tag{1}  $$&#xA;  which then leads to&#xA;  $$y_n \approx g_N(x) = \sum_{i=1}^NG^{-1}_Y(G_X(\bar{x_i}))l(x)$$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; In the paper they say one should really integrate from $y$ to $\infty$ in $(1)$ and not use the representation $G_Y(y) = 1-F_Y(y)$. How should I integrate this? How do I find the density $f_Y$? Do I have to approximate it numerically, or should I use the partial derivative of the call prices?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming I was able to get this approxmiation $g_N(x)$ the third step consists then of a recalibration of the sabr model:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Recalibration of Sabr:&lt;/strong&gt; (section 3.5 in the second paper). Here they suggest to recalibrate to market data using:&#xA;  $$ \min\sum_i(\sigma(K_i)-\sigma_{g_N}(K_i))^2$$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt; But how does the form $\sigma_{g_N}$ looks like depending on $g_N$? Since they dont mention the specific formula it must be a rather trivial question, but I dont see the solution.&lt;/p&gt;&#xA;" OwnerUserId="17133" LastActivityDate="2019-01-08T12:42:57.913" Title="clarification to use collocation methods to get arbitrage free sabr" Tags="&lt;implied-volatility&gt;&lt;stochastic-volatility&gt;&lt;sabr&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29474" PostTypeId="2" ParentId="29471" CreationDate="2016-08-04T14:58:00.553" Score="4" Body="&lt;p&gt;I think you are confused by the definitions and interpretations of $\psi(x,y,z,t)$ and $\phi(x,y,z,t)$.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The quantity $\phi(x,y,z,t)$ is a &lt;strong&gt;probability density function&lt;/strong&gt;. Infinitesimally, it represents the probability of transitioning from an initial state $[S_t,r_t,q_t]=[S_0,r_0,q_0]$ at $t=0$ to a state $[S_t,r_t,q_t]=[x,y,z]$ at $t&amp;gt;0$. As such, $\phi(x,y,z,t)$ is the solution of the &lt;a href=&quot;https://en.wikipedia.org/wiki/Fokker%E2%80%93Planck_equation&quot; rel=&quot;nofollow&quot;&gt;Fokker-Planck equation&lt;/a&gt; (or Kolmogorov forward equation) associated to the SDEs of $S_t, r_t$ and $q_t$ with initial condition $\phi(x,y,z,t=0)=\delta([x,y,z]-[S_0,r_0,q_0])$. Since you seem to be familiar with risk-neutral pricing, if $$\phi(x,y,z) = \frac{d\mathbb{Q}\left([S_t, r_t, q_t] \leq [x,y,z]\right)}{d[x,y,z]}$$ and $\mathbb{Q}$ represents the $t$-forward measure one can write:&#xA;\begin{align}&#xA;V(S_{0},r_{0},q_{0},t=0) &amp;amp;:= \mathbb{E}^\mathbb{Q}_0 \left[ B(0,t) V(S_t, r_t, q_t, t) \right] \\&#xA;&amp;amp;= \iiint B(0,t) V(S_t,r_t,q_t,t)\phi(S_t,r_t,q_t,t)dS_t dr_t dq_t  &#xA;\end{align}&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The quantity $\psi(x,y,z,t)$ represents a &lt;a href=&quot;https://en.wikipedia.org/wiki/State_prices&quot; rel=&quot;nofollow&quot;&gt;state price&lt;/a&gt;, i.e. the price of a so-called &lt;strong&gt;Arrow-Debreu security&lt;/strong&gt; which pays off $1$ unit of currency at time $t$ if and only if the world ends up in the specific state $[S_t,r_t,q_t]=[x,y,z]$,&#xA;\begin{align}&#xA;\psi(x,y,z,t) &amp;amp;= \mathbb{E}^\mathbb{Q}\left[ B(0,t) \delta([S_t,r_t,q_t]-[x,y,z]) \right] \\ &amp;amp;= \iiint B(0,t) \delta([S_t,r_t,q_t]-[x,y,z]) \phi(S_t, r_t, q_t, t) dS_t dr_t dq_t \\&#xA;&amp;amp;= B(0,t) \phi(x, y, z)&#xA;\end{align} This means that you can in turn write&#xA;$$ V(S_{0},r_{0},q_{0},t=0):=\iiint V(S_t,r_t,q_t,t)\psi(S_t,r_t,q_t,t)dS_t dr_t dq_t $$&#xA;which corresponds to pricing your contingent claim as a weighted sum of elementary securities of known prices $\psi(S_t,r_t,q_t,t)$ covering all future possible states of the world, better known as the &lt;strong&gt;state price density&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-08-09T15:03:35.013" LastActivityDate="2016-08-09T15:03:35.013" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="29475" PostTypeId="1" AcceptedAnswerId="29482" CreationDate="2016-08-04T15:40:11.043" Score="2" ViewCount="128" Body="&lt;p&gt;For example I want to calculate a year fraction between the dates: 2011.03.31 and 2015.05.30.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are 1521 days between the two dates, but 2012 was a leap year. So what should I use in the denominator? 366 or 365 if I want to use the ACT/ACT convention?&lt;/p&gt;&#xA;" OwnerUserId="17775" LastActivityDate="2016-08-04T22:27:04.460" Title="Day count convention confusion" Tags="&lt;daycounting&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29476" PostTypeId="1" CreationDate="2016-08-04T16:29:03.230" Score="1" ViewCount="1507" Body="&lt;p&gt;Let's assume I constructed usd libor 3M curve setting 1M rate=3M rate (so the curve is flat between 1M-3M). Will 1x4 FRA rates be good if calculated from such curve?&lt;/p&gt;&#xA;" OwnerUserId="23852" LastEditorUserId="20795" LastEditDate="2019-09-20T19:15:21.207" LastActivityDate="2019-09-20T19:15:21.207" Title="Calculating FRA rates" Tags="&lt;interest-rates&gt;&lt;forward&gt;&lt;forward-rate&gt;&lt;rates&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="29477" PostTypeId="1" CreationDate="2016-08-04T18:33:55.863" Score="0" ViewCount="96" Body="&lt;p&gt;Why do some stocks sometimes trade flat after releasing their earnings? Even if good or bad earnings are presented. My suggestion is that the options of the underlying stock have a very high implied volatility and it would be more profitable to be short the options than long the options. Then the party owning the short position tries keeping the stock flat. This party must be I assume the market-maker or another party with large capital at his disposal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question may seem easy, however I am pondering on it for two weeks. I have read the book McMillian on Options and searched on Google Scholar. Unfortunatly, my attempts were not fruitful. Would someone please be so kind and explain why this happens? &lt;/p&gt;&#xA;" OwnerUserId="23856" LastActivityDate="2016-08-04T22:03:57.253" Title="Motivation behind stocks become flat after earnings release" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;market-making&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29478" PostTypeId="2" ParentId="29476" CreationDate="2016-08-04T19:21:09.017" Score="1" Body="&lt;p&gt;The 1x4 FRA rate is given by &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$F(1,4) = \frac{12}{3} \left(\frac{(1+ 4/12 \times L(4))}{(1+ 1/12 \times L(1))}-1 \right)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $L(T)$ is the $T$-month Libor rate seen today.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly $F(1,4)$ depends on the 1M and 4M LIBOR rates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if the market 1M rate $L(1)$ is below the market 3M rate $L(3)$ you will be understating the true FRA rate if you set $L(1)=L(3)$&lt;/p&gt;&#xA;" OwnerUserId="12240" LastEditorUserId="12240" LastEditDate="2016-08-04T19:29:21.223" LastActivityDate="2016-08-04T19:29:21.223" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29480" PostTypeId="2" ParentId="28446" CreationDate="2016-08-04T21:14:57.173" Score="2" Body="&lt;p&gt;This is the standard textbook definition for the payoff of an arithmetic average Asian call option. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In reality the average will be based on a daily average of stock prices over some period at the end of the life of the option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first &quot;idea&quot; behind Asian options is that the payoff is harder to manipulate by dealers - the story is that in certain small markets dealers were able to push down the stock price at expiry by selling shares and so move options out of the money. If the final payoff is based on an average then this is harder to achieve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second &quot;idea&quot; is that the volatility of the average of the stock price is lower than the volatility of the stock price. This makes the option cheaper and so more attractive to investors who believe that the stock price will rise.&lt;/p&gt;&#xA;" OwnerUserId="12240" LastActivityDate="2016-08-04T21:14:57.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29481" PostTypeId="2" ParentId="29477" CreationDate="2016-08-04T22:03:57.253" Score="1" Body="&lt;p&gt;There is no scientifically provable answer on why a stock price behaves in a particular way. It is a balance of supply and demand in common shares. If buyers and sellers &lt;em&gt;both&lt;/em&gt; are happy with the current price and the sentiment is in balance then the price will not move. Basically, the earnings release brings no new information, everyone who already owns stock is content and there are few new potential owners. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Flat after ER is often happens when the firm pre-announces its financial numbers. Then the ER is a formality and the stock does not move.&lt;/p&gt;&#xA;" OwnerUserId="7973" LastActivityDate="2016-08-04T22:03:57.253" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29482" PostTypeId="2" ParentId="29475" CreationDate="2016-08-04T22:27:04.460" Score="2" Body="&lt;p&gt;As I know act/act you are using the sum of 2 fractions. One with 365 and one with 366 in the denominator. In your example the number of days in non-leap-years is 1155 and we have 366 days in leap-years. The resulting year fraction would be 1155/365 + 366/366 = 4.164&lt;/p&gt;&#xA;" OwnerUserId="22686" LastActivityDate="2016-08-04T22:27:04.460" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29483" PostTypeId="2" ParentId="29476" CreationDate="2016-08-05T01:12:34.420" Score="1" Body="&lt;p&gt;The 1x4 FRA rate is where you can lock in 3 mo libor , 1 mo from now.   To construct this rate , you must build a 3 mo libor curve. The first point in this curve is 0x3 libor , which is spot 3 mo libor.   The next point on this curve is the next Eurodollar futures contract.  These expire every month on the third Wednesday.  Then you have to interpolate between the points you can observe.  Today's value of 1 month libor is completely irrelevant to this calculation.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-08-05T01:12:34.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29484" PostTypeId="1" CreationDate="2016-08-05T02:25:19.953" Score="1" ViewCount="218" Body="&lt;p&gt;Sorry to bother you with this request but, does anyone know where I could find a matlab or R code to estimate a regime switching stochastic volatility model (discrete)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much.&lt;/p&gt;&#xA;" OwnerUserId="23860" LastEditorUserId="22804" LastEditDate="2016-08-05T21:06:26.873" LastActivityDate="2016-10-04T03:04:51.957" Title="Is there a way I could find a matlab or R code to estimate a regime switching stochastic volatility model (discrete)?" Tags="&lt;volatility&gt;&lt;stochastic&gt;&lt;markov-switching&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29485" PostTypeId="2" ParentId="18054" CreationDate="2016-08-05T02:27:38.687" Score="-1" Body="&lt;p&gt;Puts and calls will always be exactly the same price, if not then you can take a synthetic position called a reversal, its an arbitrage opportunity and you would make free money.&lt;/p&gt;&#xA;" OwnerUserId="23861" LastActivityDate="2016-08-05T02:27:38.687" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29486" PostTypeId="1" AcceptedAnswerId="29488" CreationDate="2016-08-05T03:59:24.930" Score="1" ViewCount="337" Body="&lt;p&gt;I have &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dX_0(t) = ρX_0(t)dt ; \qquad X_0(0) = 1\\&#xA; dX_1(t) = αX_1(t)dt + βX_1(t)dB(t) ; \qquad X_1(0) = x_1 &amp;gt; 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;as the classical Black-Scholes market. I a trying to look for the replicating portfolio $\theta(t) = (\theta_0(t),\theta_1(t))$ for the following European T-claim: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$F(\omega) = (K -X_1(T,\omega))^+$ $\qquad$ (the European put)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone please help me with this?&lt;/p&gt;&#xA;" OwnerUserId="23854" LastActivityDate="2016-08-05T11:36:33.947" Title="Finding the replicating portfolio a European T-claim (put)" Tags="&lt;black-scholes&gt;&lt;replication&gt;&lt;put&gt;&lt;european-options&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29488" PostTypeId="2" ParentId="29486" CreationDate="2016-08-05T09:01:42.283" Score="1" Body="&lt;p&gt;$$dX_0(t)=\rho\,X_0(t)\,dt$$&#xA;thus&#xA;$$X_0(t)=e^{\rho t}$$ &#xA;To replicate the derivative $V=F(t,X_1(t))$ we form a self-financing portfolio with the stochastic process $X_1$ and deterministic process $X_0$ in the right proportion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence we need to use the replicating $(\theta_0(t),\theta_1(t))$.&#xA;The self-financing assumption means that&#xA;$$V=\theta_1(t)X_1(t)+\theta_0(t)X_0(t)\tag 0$$&#xA;so&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dV=\theta_1(t)dX_1(t)+\theta_0(t)dX_0(t)\tag 1$$&#xA;by application of Ito's lemma, we have&#xA;$$dV=\left(\frac{\partial V}{\partial t}+\alpha X_1(t)\frac{\partial V}{\partial X_1}+\frac{1}{2}\beta^2X_1^2(t)\frac{\partial^2 V}{\partial X_1^2}\right)dt+\beta X_1(t)\frac{\partial V}{\partial X_1}dB_t\tag 2$$ &#xA;We  assume the portfolios are self-financing, which&#xA;implies that changes in portfolio value are due to changes in the value of the three instruments, and nothing else. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under this setup, any of the instruments can be replicated by forming a replicating portfolio of the other two instruments, using the correct weights.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(1)$ and $(2)$&#xA;$$\left(\frac{\partial V}{\partial t}+\alpha X_1(t)\frac{\partial V}{\partial X_1}+\frac{1}{2}\beta^2X_1^2(t)\frac{\partial^2 V}{\partial X_1^2}\right)dt+\beta X_1(t)\frac{\partial V}{\partial X_1}dB_t=\\(\alpha\theta_1(t) X_1(t)+\rho\theta_0(t) X_0(t))dt+\beta\theta_1(t) X_1(t)dB_t\tag 3$$&#xA;so&#xA;$$\theta_1(t)=\frac{\partial V}{\partial X_1}\tag 4$$&#xA;Substituting in Equation $(4)$, we have&#xA;$$\left(\frac{\partial V}{\partial t}+\frac{1}{2}\beta^2X_1^2(t)\frac{\partial^2 V}{\partial X_1^2}\right)=\rho\theta_0(t) X_0(t)\\&#xA;\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\quad=\rho\theta_0(t)\left(\frac{V-\theta_1(t)X_1(t)}{\theta_0(t)}\right)\\&#xA;\\&#xA;\qquad\qquad\qquad\qquad\qquad\qquad\quad\,\,\,\,=\rho V-\rho\theta_1(t)X_1(t)\\&#xA;\\&#xA;\\&#xA;\qquad\qquad\qquad\qquad\qquad\qquad\qquad=\rho V-\rho\frac{\partial V}{\partial X_1}X_1(t)&#xA;$$&#xA;in other words&#xA;$$\frac{\partial V}{\partial t}+\rho X_1(t)\frac{\partial V}{\partial X_1}+\frac{1}{2}\beta^2X_1^2(t)\frac{\partial^2 V}{\partial X_1^2}-\rho V=0\tag 5$$&#xA;Indeed&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$$\theta_0(t)=\frac{V-\theta_1(t)X_1(t)}{X_0(t)}\\ \\&#xA;\theta_1(t)=\frac{\partial V}{\partial X_1} $$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-08-05T11:36:33.947" LastActivityDate="2016-08-05T11:36:33.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29490" PostTypeId="1" CreationDate="2016-08-05T09:30:07.563" Score="2" ViewCount="48" Body="&lt;p&gt;currently I am working with GARCH Modells. And it came to my attention that for the parameter estimation Maximum Likelihood approaches are commonly used. However I was wondering why Least Squared approaches are not in use. And I came up with the following explanation from Rachev in Financial Econonmetrics: &lt;a href=&quot;https://i.stack.imgur.com/y5qao.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/y5qao.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Seems like due to this &quot;strong condition&quot; a Maximum Likelihood approach is more promising. Unfortunately I don't understand the condition. What does it mean and what are the implications? And why is the 8th-Moment important to an GARCH Modell?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot in advance,&#xA;Clemens &lt;/p&gt;&#xA;" OwnerUserId="23863" LastActivityDate="2016-08-05T09:30:07.563" Title="LSE GARCH Modells" Tags="&lt;statistics&gt;&lt;garch&gt;&lt;parameter-estimation&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29491" PostTypeId="1" CreationDate="2016-08-05T10:10:27.190" Score="1" ViewCount="93" Body="&lt;p&gt;I want to understand the procedure of how to predict with the GARCH Modell. Therefore it is said that a one day ahead forecast is easy due to the fact that the GARCH equation can produce this. Furthermore forecasts for more than one day can be achieved by recursive substitution according to Rachev (Financial Econometrics):&#xA;&lt;a href=&quot;https://i.stack.imgur.com/71kPP.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/71kPP.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Somehow I don't get how the equation is transformed. I always stuck at the point where I would substitute the variance with 8.34 and expand the equation to a sum. However I would never come to the point where it looks like 8.35.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot!&#xA;Clemens &lt;/p&gt;&#xA;" OwnerUserId="23863" LastEditorUserId="23863" LastEditDate="2016-08-05T13:35:22.217" LastActivityDate="2016-08-05T13:35:22.217" Title="Transformation of GARCH Equation to multiple-day Forecast Equation" Tags="&lt;statistics&gt;&lt;garch&gt;&lt;forecast&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29492" PostTypeId="2" ParentId="28032" CreationDate="2016-08-05T10:56:07.420" Score="0" Body="&lt;p&gt;You could use GARCH model as filter - fit (mayby with some AR/MA/ARIMA part) and in second step build regression model between obtained residuals and &lt;code&gt;Z(t)&lt;/code&gt; variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you think that impact of &lt;code&gt;Z(t)&lt;/code&gt; is additive or multiplicative against residuals of GARCH model ?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;err(t) = e(t)*sigma(t) + Z(t)&lt;/code&gt;&lt;br&gt;&#xA; or&lt;br&gt;&#xA;&lt;code&gt;err(t) = e(t)*sigma(t)*Z(t)&lt;/code&gt;&lt;br&gt;&#xA;or mayby&lt;br&gt;&#xA;&lt;code&gt;err(t)=e(t)*sigma(t)+Z(t)*sigma(t)&lt;/code&gt; ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Third case looks the most suitable for me and you can deal with it using above approach.&lt;/p&gt;&#xA;" OwnerUserId="2044" LastActivityDate="2016-08-05T10:56:07.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29493" PostTypeId="1" AcceptedAnswerId="29497" CreationDate="2016-08-05T11:10:22.280" Score="1" ViewCount="180" Body="&lt;p&gt;I'm familiar with the expression for a (continuously compounded) credit spread of the form&#xA;$$ c(t,T) = -\frac{1}{T-t} \ln \frac{v(t,T)}{p(t,T)},$$&#xA;where $p(t,T)$ denotes the time $t$ price of a $T$-maturity default-free bond, and $v(t,T)$ denotes the time $t$ price of a $T$-maturity defaultable bond. Using some standard assumptions from credit risk models (that the default time $\tau$ is independent of the short rate $r_t$ process so the $v(t,T)=p(t,T)\left( \delta +(1\color{red}{-}\delta) \mathbb{Q}(\tau &amp;gt; T)\right)$), the spread can be written as&#xA;$$c(t,T) = - \frac{1}{T-t} \ln \left( \delta +(1\color{red}{-}\delta) \mathbb{Q}(\tau &amp;gt; T)\right), $$&#xA;where $\delta$ is the recovery rate and $\mathbb{Q}(\tau &amp;gt; T)$ the risk-neutral probability of the defaultable bond's issuer survival.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I came across the following expression for the &quot;semi-annually compounded&quot; spread, given by&#xA;$$c(t,T)=2\left[  (\delta +(1-\delta))\mathbb{Q}(\tau &amp;gt; T)) ^{\color{red}{-}\frac{1}{2T}}-1 \right].$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't understand how is this expression derived, could somebody explain it to me? The way I see it, the semi-annually compounded spread should be equal to the difference $y_v-y_p$, where yields $y_v$ and $y_p$ are given implicitly through:&#xA;$$p(t,T)\left( 1+\frac{y_p}{2} \right)^{2T}=1, $$&#xA;and&#xA;$$v(t,T)\left( 1+\frac{y_v}{2} \right)^{2T}=1. $$&#xA;In that case, shouldn't spread be equal to:&#xA;$$ c(t,T)= 2 \left[   p(t,T)^{-\frac{1}{2T}} \left(  1- \left( \delta +(1+\delta) \mathbb{Q}(\tau &amp;gt; T)\right)^{-\frac{1}{2T}} \right) \right] ? $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I appreciate any insights on this, many thanks.&lt;/p&gt;&#xA;" OwnerUserId="23864" LastEditorUserId="11678" LastEditDate="2016-08-05T13:47:21.130" LastActivityDate="2016-08-05T13:47:21.130" Title="Right expression for the semi-annually compounded credit spreads?" Tags="&lt;spread&gt;&lt;credit&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29494" PostTypeId="1" AcceptedAnswerId="29495" CreationDate="2016-08-05T11:31:00.780" Score="5" ViewCount="5446" Body="&lt;p&gt;I want to find correlation coeffitiont between $W_t$ and $\int_{0}^{t}W_s ds$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think that these are uncorrelated. But Why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So thanks&lt;/p&gt;&#xA;" OwnerUserId="22715" LastActivityDate="2016-08-05T11:50:11.530" Title="Correlation coeffitiont between two stochastic processes" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29495" PostTypeId="2" ParentId="29494" CreationDate="2016-08-05T11:50:11.530" Score="9" Body="&lt;p&gt;if you talk about correlation then:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;compute expectation:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\mathbb{E}(W_t)=0\text{ and }\mathbb{E}(\int_0^tW_d ds)=0$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;variance:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\text{Var}(W_t)=t\text{ and }\text{Var}(\int_0^tW_s ds)=\frac{t^3}{3}$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;covariance:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\mathbb{E}(W_t\int_{0}^tW_sds)=\int_{0}^t\mathbb{E}(W_tW_s)ds=\int_0^tsds=\frac{t^2}{2}$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;then you get:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\text{Corr}(W_t,\int_0^tW_s ds)= \frac{\sqrt{3}}{2}$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;h3&gt;hint&lt;/h3&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\mathbb{E}(W_uW_s)=\min(u,s)$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\text{Var}(\int_0^tW_sds)=\mathbb{E}(\int_0^t\int_0^tW_sW_u duds)$$&lt;/span&gt;&lt;/p&gt;&#xA;" OwnerUserId="20201" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-08-05T11:50:11.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29496" PostTypeId="1" CreationDate="2016-08-05T11:55:45.647" Score="0" ViewCount="128" Body="&lt;p&gt;OHLC data are one of the most popular kind of data available.&#xA;Are there models which could incorporate all the information provided by OHLC - regular 1-minute frequency data for example ? Usually only close price is used, but &lt;em&gt;high - low&lt;/em&gt; difference provides information about price volatility in given period - because width of range in population is correlated with variance in population (but dependence varies with population size, dependence is stronger for smaller sizes), if &lt;em&gt;high-min&lt;/em&gt; is correlated with volatility we could use it in case of estimation of stochastic volatility model for example.&#xA;Simple simulation of variance and max-min difference in case of population sizes - 10 and 20 : &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;n_iter=1e5&#xA;n_obs=10&#xA;&#xA;out &amp;lt;- matrix(0, n_iter, 2)&#xA;out &amp;lt;- as.data.frame(out)&#xA;names(out)=c(&quot;var&quot;, &quot;max - min&quot;)&#xA;&#xA;for(i in 1:n_iter){&#xA;&#xA;    x &amp;lt;- rnorm(n_obs)&#xA;&#xA;    out[i,1] = var(x)&#xA;    out[i,2] = diff(range(x))&#xA;&#xA;}&#xA;&#xA;plot(out, main = paste(&quot;n_iter = &quot;,n_iter,&quot;, n_obs = &quot;,n_obs))&#xA;abline(lm(out[,2]~out[,1]), col = 2, lwd = 2)&#xA;cor(out)&#xA;&#xA;# case population size 20&#xA;n_iter=1e5&#xA;n_obs=20&#xA;&#xA;out &amp;lt;- matrix(0, n_iter, 2)&#xA;out &amp;lt;- as.data.frame(out)&#xA;names(out)=c(&quot;var&quot;, &quot;max - min&quot;)&#xA;&#xA;for(i in 1:n_iter){&#xA;&#xA;    x &amp;lt;- rnorm(n_obs)&#xA;&#xA;    out[i,1] = var(x)&#xA;    out[i,2] = diff(range(x))&#xA;&#xA;}&#xA;&#xA;plot(out, main = paste(&quot;n_iter = &quot;,n_iter,&quot;, n_obs = &quot;,n_obs))&#xA;abline(lm(out[,2]~out[,1]), col = 2, lwd = 2)&#xA;cor(out)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2044" LastActivityDate="2016-08-06T07:38:59.557" Title="Model which fully incorporate OHLC data (higl ald low also)" Tags="&lt;market-data&gt;&lt;modeling&gt;&lt;models&gt;&lt;ohlc&gt;" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29497" PostTypeId="2" ParentId="29493" CreationDate="2016-08-05T13:22:13.160" Score="0" Body="&lt;p&gt;This is all based on how you define the spread. In continuous compounding case, you can define the spread $c(t, T)$ by the formula&#xA;\begin{align*}&#xA;v(t, T) = e^{-c(t, T) (T-t)} p(t, T).&#xA;\end{align*}&#xA;While, in the semi-annual compounding case, by the formula&#xA;\begin{align*}&#xA;v(t, T) = \left(1+\frac{c(t, T)}{2}\right)^{-2 (T-t)} p(t, T).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-08-05T13:22:13.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29499" PostTypeId="2" ParentId="29496" CreationDate="2016-08-05T14:21:22.903" Score="1" Body="&lt;p&gt;Not a model as such, but this paper might be interesting to you:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www3.nd.edu/~scorwin/documents/high-low_spreads.pdf&quot; rel=&quot;nofollow&quot;&gt;A Simple Way to Estimate Bid-Ask Spreads from Daily High and Low Prices&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It estimates bid-ask spreads from daily OLHC data. Perhaps you could use the same logic with minute data?&lt;/p&gt;&#xA;" OwnerUserId="19615" LastActivityDate="2016-08-05T14:21:22.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29503" PostTypeId="1" AcceptedAnswerId="29542" CreationDate="2016-08-05T15:16:16.150" Score="2" ViewCount="111" Body="&lt;p&gt;I am building a trading strategy that predicts the current period returns using historical returns (think e.g. using an estimated OLS model to predict next weeks return based on this weeks return). However, I am at loss in picking the window I should use for estimating the model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way I see it, there are two ways I can do this:&#xA;a) pick a fixed window length - e.g. 1 year (52 weekly observations), and re-estimate the model every week. However, depending on the asset the slope of the regression tends to change, and is especially suspect to few 'outlier' cases, which makes me question whether the model is still theoretically sound.&#xA;b) use all available data, and roll to window forward every week, re-estimating the model. However, if the relationship is time variant, I think this approach will lead to extended periods of negative returns if there is a break in the model that a shorter window might capture better.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How should I go about determining which method to use? I could of course back test different filtering strategies based on these two, but the more complicated, the more risk of overfitting IMO, and hence I'd prefer a more simplistic but statistically sound method for determining which way to go.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions? Would also love to read good papers that deal with this issue if any come to mind.&lt;/p&gt;&#xA;" OwnerUserId="18607" LastActivityDate="2016-08-08T19:44:00.837" Title="Window length for predictive regressions" Tags="&lt;time-series&gt;&lt;prediction&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29504" PostTypeId="1" CreationDate="2016-08-05T17:09:41.230" Score="42" ViewCount="36872" Body="&lt;p&gt;Let &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$X_t = \int_0^t W_s \,\mathrm d s$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;span class=&quot;math-container&quot;&gt;$W_s$&lt;/span&gt; is our usual Brownian motion. My questions are the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Expectation?&lt;/li&gt;&#xA;&lt;li&gt;Variance?&lt;/li&gt;&#xA;&lt;li&gt;Is it a martingale?&lt;/li&gt;&#xA;&lt;li&gt;Is it an Ito process or a Riemann integral?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Any reference for practicing tricky problems like this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the expectation, I know it's zero via Fubini. We can put the expectation inside the integral. Now, for the variance and the martingale questions, do we have any tricks? Thanks!&lt;/p&gt;&#xA;" OwnerUserId="22776" LastEditorUserId="20795" LastEditDate="2019-01-29T16:52:42.703" LastActivityDate="2019-12-09T03:16:19.490" Title="Integral of Brownian motion w.r.t. time" Tags="&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;" AnswerCount="5" CommentCount="1" FavoriteCount="47" ContentLicense="CC BY-SA 4.0" />
  <row Id="29505" PostTypeId="2" ParentId="29504" CreationDate="2016-08-05T17:14:36.087" Score="15" Body="&lt;p&gt;Set $f(x)=x^3$ and apply Ito's lemma,&#xA;$$W_{t}^{3}=3\int_{0}^{t}W_s^2dW_s+3\int_{0}^{t}W_sds$$&#xA;in other words&#xA;$$\int_{0}^{t}W_sds=\frac 13 W_t^3-\int_{0}^{t}W_s^2dW_s\tag 0$$&#xA;therefore&#xA;$$\mathbb{E}\left[\int_{0}^{t}W_sds\right]=\frac{1}{3}\mathbb{E}[W_t^3]- \mathbb{E}\left(\int_{0}^{t}W_s^2dW_s\right)=0\tag 1$$&#xA;so&#xA;$$\operatorname{Var}\left(\int_{0}^{t}W_sds\right)=\mathbb{E}\left[\left(\int_{0}^{t}W_sds\right)^2\right]=\mathbb{E}\left[\int_{0}^{t}\int_{0}^{t}W_s\,W_u du\,ds\right]\\&#xA;\\&#xA;\qquad\quad\qquad\qquad\,\,\,=\int_{0}^{t}\int_{0}^{t}\mathbb{E}[W_sW_u]duds=\int_{0}^{t}\int_{0}^{t}\min\{s,u\}duds\\&#xA;\\&#xA;\qquad\qquad=\int_{0}^{t}\int_{0}^{s}u\,duds+\int_{0}^{t}\int_{s}^{t}s\,duds=\frac 13 t^3 \tag 2$$&#xA;Indeed &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$$\color{red}{\int_{0}^{t}W_sds\sim N\left(0\,,\,\frac 13t^3\right)}$$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;so, we can say $\int_{0}^{t}W_s ds$ is a normal random time change with time change rate $W_s$.&#xA;Now set $$X_t=\int_{0}^{t}W_udu=\frac 13 W_t^3-\int_{0}^{t}W_u^2dW_u$$&#xA; we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}\left[X_t\Big{|}\mathcal{F}_s\right]=\frac{1}{3}\mathbb{E}\left[W_t^3\Big{|}\mathcal{F}_s\right]-\mathbb{E}\left[\int_{0}^{t}W_u^2dW_u\Big{|}\mathcal{F}_s\right]\tag 3$$&#xA;First we consider&#xA;$$\mathbb{E}\left[W_t^3\Big{|}\mathcal{F}_s\right]=\mathbb{E}\left[(W_t-W_s)^3+3W_s(W_t-W_s)^2+3W_s^2(W_t-W_s)+W_s^3\Big{|}\mathcal{F}_s\right]$$&#xA;Wiener process has Independent increments, then&#xA;$$\mathbb{E}\left[W_t^3\Big{|}\mathcal{F}_s\right]=3W_s\mathbb{E}\left[(W_t-W_s)^2\right]+W_s^3=3W_s(t-s)+W_s^3\tag 4$$&#xA;on the other hand&#xA;$$\mathbb{E}\left[\int_{0}^{t}W_u^2dW_u\Big{|}\mathcal{F}_s\right]=\mathbb{E}\left[\int_{0}^{s}W_u^2dW_u\Big{|}\mathcal{F}_s\right]+\mathbb{E}\left[\int_{s}^{t}W_u^2dW_u\Big{|}\mathcal{F}_s\right]=\int_{0}^{s}W_u^2dW_u\tag 5$$&#xA;$(3)$,$(4)$ and $(5)$&#xA;$$\mathbb{E}\left[X_t\Big{|}\mathcal{F}_s\right]=\frac{1}{3}W_s^3+W_s(t-s)-\int_{0}^{s}W_u^2dW_u\tag 6$$&#xA;$(6)$ and $(0)$&#xA;$$\mathbb{E}\left[\int_{0}^{t}W_udu\Big{|}\mathcal{F}_s\right]=W_s(t-s)+\int_{0}^{s}W_udu\tag 7$$&#xA;hence $\int_{0}^{t}W_udu$ is not a martingale.&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-08-06T05:57:53.017" LastActivityDate="2016-08-06T05:57:53.017" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="29506" PostTypeId="2" ParentId="29504" CreationDate="2016-08-05T18:37:04.397" Score="53" Body="&lt;p&gt;This type of integral has appeared so many times and in so many places; for example, &lt;a href=&quot;https://quant.stackexchange.com/questions/29494/correlation-coeffitiont-between-two-stochastic-processes&quot;&gt;here&lt;/a&gt;, &lt;a href=&quot;https://math.stackexchange.com/questions/1821009/let-z-t-intw-s-ds-show-that-z-t-int-t-s-dw-s/1821133#1821133.&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;https://math.stackexchange.com/questions/1825671/correlation-between-stochastic-processes/1825843#1825843&quot;&gt;here&lt;/a&gt;.&#xA; Basically, for each sample $\omega$, we can treat $\int_0^t W_s ds$ as a Riemann integral. Moreover, note that&#xA;\begin{align*}&#xA;d(tW_t) = W_t dt + tdW_t.&#xA;\end{align*}&#xA;Therefore,&#xA;\begin{align*}&#xA;\int_0^t W_s ds &amp;amp;= tW_t -\int_0^t sdW_s \tag{1}\\&#xA;&amp;amp;= \int_0^t (t-s)dW_s,&#xA;\end{align*}&#xA;which can also be treated as a (parametrized) Ito integral. Then, it is easy to see that&#xA;\begin{align*}&#xA;E\left(\int_0^t W_s ds\right) = 0, &#xA;\end{align*}&#xA;and that&#xA;\begin{align*}&#xA;Var\left(\int_0^t W_s ds\right) &amp;amp;= \int_0^t(t-s)^2 ds\\&#xA;&amp;amp;=\frac{1}{3}t^3.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the martingality, note that, from $(1)$, &#xA;\begin{align*}&#xA;\int_0^{t_2} W_s ds -\int_0^{t_1} W_s ds &amp;amp;=t_2W_{t_2}-t_1W_{t_1} + \int_{t_1}^{t_2}sdW_s\\&#xA;&amp;amp;=t_2(W_{t_2}-W_{t_1}) + (t_2-t_1) W_{t_1} + \int_{t_1}^{t_2}sdW_s\\&#xA;&amp;amp;=(t_2-t_1) W_{t_1} + \int_{t_1}^{t_2}(t_2+s)dW_s,&#xA;\end{align*}&#xA;for $t_2&amp;gt;t_1\ge 0$. Therefore,&#xA;\begin{align*}&#xA;E\left(\int_0^{t_2} W_s ds\mid \mathscr{F}_{t_1} \right) &amp;amp;= \int_0^{t_1} W_s ds + (t_2-t_1) W_{t_1}.&#xA;\end{align*}&#xA;It is not a martingale. Another way to see this is based the equation&#xA;\begin{align*}&#xA;d\left(\int_0^t W_s ds\right) = W_t dt,&#xA;\end{align*}&#xA;which is not driftless.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;EDIT:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;One other approach for the martingality can proceed as follows. For $t_2&amp;gt;t_1 &amp;gt;0$,&#xA;\begin{align*}&#xA;E\left(\int_0^{t_2} W_s ds \mid \mathscr{F}_{t_1}\right) &amp;amp;= \int_0^{t_1} W_s ds + E\left(\int_{t_1}^{t_2} W_s ds \mid \mathscr{F}_{t_1}\right)\\&#xA;&amp;amp;= \int_0^{t_1} W_s ds + \int_{t_1}^{t_2} E\left(W_s \mid \mathscr{F}_{t_1}\right) ds\\&#xA;&amp;amp;=\int_0^{t_1} W_s ds + \int_{t_1}^{t_2} E\left(W_s \mid \mathscr{F}_{t_1}\right) ds\\&#xA;&amp;amp;=\int_0^{t_1} W_s ds + \int_{t_1}^{t_2} E\left(W_s-W_{t_1}+ W_{t_1}\mid \mathscr{F}_{t_1}\right) ds\\&#xA;&amp;amp;= \int_0^{t_1} W_s ds + (t_2-t_1)W_{t_1}.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-08-08T12:55:24.033" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29507" PostTypeId="1" AcceptedAnswerId="33810" CreationDate="2016-08-05T19:27:45.277" Score="3" ViewCount="8980" Body="&lt;p&gt;I have a list of deltas and their corresponding volatilities in an FX market but I want to go from delta to strike price.&#xA;In this Question similar problem is being discussed&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/q/12886/18555&quot;&gt;How can I calculate the strike price or implied volatility from a given delta?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way I understand it, the strike price can be found like this:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/6hUUX.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/6hUUX.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is my approach correct? If yes; pleace help me understand the term, N(d_1), so I can proceed with the solve process?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&lt;br&gt;&#xA;I basically want to create the volatility smile in (strike,vol)-graph from data found by Bloombergs OVDV function:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/VWTRh.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/VWTRh.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So maybe there's a simplere way to do so&lt;/p&gt;&#xA;" OwnerUserId="18555" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2020-05-19T11:37:45.780" Title="Calculate strike from Black Scholes delta" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;delta&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29508" PostTypeId="1" CreationDate="2016-08-05T20:42:28.090" Score="1" ViewCount="258" Body="&lt;p&gt;I was in a lecture of Bruno Dupire's when he said something along the lines of a linear hedge being sufficient for most purposes. He gave a counter example as well: a corporation producing something and multiple currencies, but it went over my head at the time. (I wish I had taken notes)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question is: is it true that a linear hedge is sufficient for most clients, ie. there is no inherent need for derivatives (except futures/swaps)? If so, where can I read more about this and see a possible counter example?&lt;/p&gt;&#xA;" OwnerUserId="23872" LastActivityDate="2016-08-14T16:17:02.180" Title="Is a linear hedge sufficient for most purposes?" Tags="&lt;derivatives&gt;&lt;hedging&gt;&lt;reference-request&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29509" PostTypeId="2" ParentId="27453" CreationDate="2016-08-05T20:57:37.843" Score="0" Body="&lt;p&gt;For payment at the hitting time $\tau$, you basically need to have the density function $\varphi$ of the $\tau$, and then compute the integral $$\int_0^T e^{-rt} \varphi(t) dt.$$  In the case of constant interest rate $r$ and constant volatility $\sigma$,  both the density function $\varphi$ and the integral $\int_0^T e^{-rt} \varphi(t) dt$ can be computed analytically. See Paper &lt;em&gt;Closed Form Formulas for Exotic Options and Their Lifetime Distribution&lt;/em&gt; by Raphael Douady.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-08-05T20:57:37.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29510" PostTypeId="2" ParentId="29508" CreationDate="2016-08-05T22:06:07.143" Score="2" Body="&lt;p&gt;There are many times when a linear hedge is sufficient, and indeed the Black/Scholes option pricing theory shows that a linear hedge can even hedge a highly non-linear payoff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However it's not hard to think of many situations where a linear hedge would not be sufficient eg:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;company has high sensitivity to one-off event, market might not be open or liquid for hedge rebalancing&lt;/li&gt;&#xA;&lt;li&gt;multinational company attempts to hedge currency positions but as rates of exchange change so do sales (2nd order effects)&lt;/li&gt;&#xA;&lt;li&gt;any correlation between the price of the hedging instrument and another material variable&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If it's a linear risk or if the hedge can be rebalanced at any interval then probably linear hedges are sufficient, and to first approximation given the many uncertainties in the economy and business this might well be a good assumption.&lt;/p&gt;&#xA;" OwnerUserId="12020" LastActivityDate="2016-08-05T22:06:07.143" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29511" PostTypeId="1" CreationDate="2016-08-06T01:02:53.950" Score="-1" ViewCount="91" Body="&lt;p&gt;In specific, I will set a certain price to a stock and I want to know how long takes until the historical prices reach this price.&#xA;Thanks you.&lt;/p&gt;&#xA;" OwnerUserId="23873" LastActivityDate="2016-10-07T16:14:36.643" Title="How to calculate the elapsed time until a stock reach a certain price?" Tags="&lt;equities&gt;&lt;price&gt;&lt;time&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29512" PostTypeId="2" ParentId="29511" CreationDate="2016-08-06T01:41:18.050" Score="0" Body="&lt;p&gt;Well, there's no simple answer, but with some assumptions on price generating process you can try to come up with some estimates. If you assume ABM, then your expected time until a price reaches a certain level is infinite [&lt;a href=&quot;https://math.stackexchange.com/questions/531225/expected-stopping-time-of-brownian-motion&quot;&gt;1&lt;/a&gt;]. But you can also derive probability density of how long you would have to wait [&lt;a href=&quot;https://math.stackexchange.com/questions/1053294/density-of-first-hitting-time-of-brownian-motion-with-drift&quot;&gt;2&lt;/a&gt;]. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe some smarter forum member would add if there are similar formulas for GBM.&lt;/p&gt;&#xA;" OwnerUserId="185" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2016-08-08T15:13:21.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29513" PostTypeId="2" ParentId="29507" CreationDate="2016-08-06T01:54:33.130" Score="1" Body="&lt;p&gt;Since $ &#xA;\Delta_K = N(d_1) &#xA;$&#xA;use normal inverse function $ N^{-1} $ (e.g. NORM.INV in excel, norminv in matlab) to calculate $ d_1 = N^{-1} (\Delta_K) $ Then use algebra to solve for $K$&lt;/p&gt;&#xA;" OwnerUserId="185" LastEditorUserId="185" LastEditDate="2016-08-08T15:07:19.807" LastActivityDate="2016-08-08T15:07:19.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29514" PostTypeId="2" ParentId="29496" CreationDate="2016-08-06T07:06:40.820" Score="1" Body="&lt;p&gt;If it is volatility you are interested in, a relevant paper is &quot;Drift‐Independent Volatility Estimation Based on High, Low, Open, and Close Prices&quot; by Dennis Yang and Qiang Zhang, The Journal of Business, Vol. 73, No. 3 (July 2000), pp. 477-492. This builds on the earlier HLC volatility estimator by Parkinson (1980) that was mentioned above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another application of OHLC data is to detect if prices crossed a certain level K during an interval of time (although it will not tell you at what time within the interval the level was crossed).&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-08-06T07:38:59.557" LastActivityDate="2016-08-06T07:38:59.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29515" PostTypeId="1" CreationDate="2016-08-06T09:18:58.677" Score="2" ViewCount="3395" Body="&lt;p&gt;I currently am completing a Computational Finance Assignment, and am trying to figure out how to alter this Matlab code which prices a European put or call option, in order to price an American Put Option. I honestly thought it would be as simple as placing a &lt;code&gt;max()&lt;/code&gt; in the backwards recursion step. I don't want you to just provide the altered code, as I'd rather learn, but I have been thinking about this for a while and am at crossroads. I have left my altered code in thus far in the hope that you could point me in the right direction.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function price  = tree_slow(S0, K, T, r, sigma, opttype, Nsteps)&#xA;%   &#xA;% S0 - current stock price&#xA;% K - strike&#xA;% T - expiry time&#xA;% r - interest rate&#xA;% sigma - volatility&#xA;% opttype - 0 for a call, otherwise a put&#xA;% Nsteps - number of timesteps&#xA;&#xA;%Output&#xA;%   price : option price&#xA;&#xA;%Practical 1: compute the timestep size (Delta t) and tree parameters&#xA;delt = T/Nsteps;&#xA;u = exp(sigma * sqrt(delt) );&#xA;d = 1./u;&#xA;a = exp( r*delt );&#xA;p = (a - d)/(u - d);&#xA;&#xA;%vector of payoff and option price in the tree&#xA;W = zeros(Nsteps+1,1);&#xA;&#xA;%Practical 1: compute the S value at time T and store it in W&#xA;for j=0:Nsteps&#xA;    W(j+1,1) = S0*u^(j)*d^(Nsteps -j);&#xA;end&#xA;&#xA;%Practical 1: compute the payoff&#xA;if(opttype == 0)&#xA;    W = max(W-K,0); &#xA;else&#xA;    W = max(K-W,0);&#xA;end&#xA;&#xA;%Practical 2: fill in the backward recursion&#xA;for n=Nsteps-1:-1:0%timeloop&#xA;&#xA;    %loop over all possible S levels at time t_n &#xA;    for j=0:n &#xA;        %instruction: complete the expectation formula&#xA;        W(j+1,1) = max(K-W(j+2,1),exp(-r*delt)*( p*W(j+2,1) + (1-p)*W(j+1,1) ));&#xA;    end&#xA;&#xA;end&#xA;%instruction: fill in with the right index&#xA;price = W(1);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="23877" LastEditorUserId="12" LastEditDate="2016-08-08T17:15:48.543" LastActivityDate="2016-08-08T17:15:48.543" Title="Pricing American Put Options via Binomial Tree in Matlab" Tags="&lt;options&gt;&lt;matlab&gt;&lt;binomial&gt;&lt;put&gt;&lt;american&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29516" PostTypeId="2" ParentId="28399" CreationDate="2016-08-06T10:01:33.747" Score="2" Body="&lt;p&gt;problem was with python &lt;/p&gt;&#xA;&#xA;&lt;p&gt;sudo port select --set python python27&lt;/p&gt;&#xA;&#xA;&lt;p&gt;;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;sudo port select --set python2 python27 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;fixed the architecture to the right one x86_64 in the build and i stopped getting the linking error. &lt;/p&gt;&#xA;" OwnerUserId="22799" LastEditorUserId="22799" LastEditDate="2016-08-06T10:07:58.070" LastActivityDate="2016-08-06T10:07:58.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29517" PostTypeId="1" CreationDate="2016-08-06T13:28:33.220" Score="0" ViewCount="55" Body="&lt;p&gt;I have been scratching my head over this question, but could not find out an answer. Can anyone explain how is term structure reflected from a short rate model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, if we have a stochastic differential equation for dR(t). It is possible calculate the one year rate, two year rate three year rate etc from the integrals $\int_o^tR(t)dt$. However, how do we make sure that the two year rate is bigger than the one year rate?  &lt;/p&gt;&#xA;" OwnerUserId="23846" LastActivityDate="2016-08-13T14:01:31.023" Title="How is term structure of interest rate reflected in Vasicek?" Tags="&lt;fixed-income&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29518" PostTypeId="1" CreationDate="2016-08-06T14:13:15.327" Score="4" ViewCount="2338" Body="&lt;p&gt;In Shreve's book, future process is defined to be a stochastic process that satisfies the following two conditions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) $Fut_s(T,T) = S(T)$   where $Fut_s(T,T)$ is the future price at expiration and S(T) is the price of the underlying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) At any time $t_k$, the value of the (daily settlement) payment to be received at time $t_{k+1}$ and indeed all future times is zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a consequence of the second condition, the book claims that the future price process has to follow the following equation:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/hQAH5.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/hQAH5.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that the expectation of the right hand side should be zero by condition (2). Can anyone explain why is it not zero under the true probability measure instead of the risk neutral measure?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: This is question is from page 243 of Shreve's Stochastic Calculus for Finance&lt;/p&gt;&#xA;" OwnerUserId="23846" LastActivityDate="2017-04-04T23:58:50.550" Title="Why is future price process defined to be a martingale under the risk neutral measure?" Tags="&lt;risk-neutral-measure&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29519" PostTypeId="1" CreationDate="2016-08-06T17:55:08.847" Score="2" ViewCount="1238" Body="&lt;p&gt;According to the &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=956825&quot; rel=&quot;nofollow&quot;&gt;DTS paper&lt;/a&gt;, the argument for using DTS instead of spread duration itself is that relative spread volatility is more stable than absolute spread volatility. Then surely the same argument applies on yield as well. So why do people not use duration times yield?&lt;/p&gt;&#xA;" OwnerUserId="23879" LastActivityDate="2016-10-06T23:52:59.723" Title="Why do people use (spread) Duration times spread (DTS) but no one uses (yield) duration times yield?" Tags="&lt;fixed-income&gt;&lt;duration&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29520" PostTypeId="1" AcceptedAnswerId="29541" CreationDate="2016-08-06T18:08:31.120" Score="1" ViewCount="154" Body="&lt;p&gt;A few months ago I've read somewhere that although the exponential GARCH model may lead to higher BIC values in comparison to other extensions of the GARCH family (GARCH, GJR-GARCH, TGARCH, ...), volatility forecasting under this model may lead to biased results. I'm trying to find a trustworthy source (an academic paper) which could back this, but so far I've found &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;this &lt;a href=&quot;http://www.mathworks.com/help/econ/assess-egarch-forecast-bias-through-simulations.html&quot; rel=&quot;nofollow&quot;&gt;Matlab&lt;/a&gt; page which indirectly tells me that results are biased, &lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://core.ac.uk/download/files/153/6350116.pdf&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; 2010 working paper which hasn't been published in any journal, and &lt;/li&gt;&#xA;&lt;li&gt;some bachelor/master theses that report this info without backing it with an academic source. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And as you may imagine, I can't (or better, I don't want to) quote other students' theses in my own thesis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you know of any published work which proves this claim? Or a reliable source which suggests why the EGARCH shouldn't be used for forecasting?&lt;/p&gt;&#xA;" OwnerUserId="20573" LastEditorUserId="19645" LastEditDate="2016-08-08T19:47:17.443" LastActivityDate="2016-08-08T19:47:17.443" Title="References for biased forecasts from EGARCH" Tags="&lt;volatility&gt;&lt;time-series&gt;&lt;garch&gt;&lt;reference-request&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29521" PostTypeId="1" CreationDate="2016-08-07T05:00:29.770" Score="1" ViewCount="48" Body="&lt;p&gt;Currently I am analysing the stylized facts for some EURO FX rates. This &lt;a href=&quot;http://ww.long-memory.com/returns/Guillaume-etal1997.pdf&quot; rel=&quot;nofollow&quot;&gt;paper&lt;/a&gt; states that we can prove the fat tail distribution of the FX log returns via the computation of &lt;strong&gt;the tail index&lt;/strong&gt;. For a person who is not familiar with extreme value theory how can I reproduce the results of table 3 in the paper ?&lt;/p&gt;&#xA;" OwnerUserId="22154" LastActivityDate="2016-08-07T05:00:29.770" Title="Tail index estimation to prove non-stable fat tail distribution" Tags="&lt;fx&gt;&lt;statistical-finance&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29522" PostTypeId="2" ParentId="29470" CreationDate="2016-08-07T13:30:10.180" Score="0" Body="&lt;p&gt;$$&#xA;\text{Var}(dL) = \text{Var}(dK)  + \text{Var}(dS)  + \text{cov}(dS, dK)&#xA;$$&#xA;I hope u have some simultaneous observations on $dK$ and $dS$ to estimate the covariance or a good assumption about it.&lt;/p&gt;&#xA;" OwnerUserId="23886" LastEditorUserId="467" LastEditDate="2017-01-05T06:45:02.513" LastActivityDate="2017-01-05T06:45:02.513" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29523" PostTypeId="1" CreationDate="2016-08-07T14:41:25.707" Score="5" ViewCount="191" Body="&lt;p&gt;I've estimated the parameters for the Vasicek model&#xA;$$&#xA;dr(t) = a(b - r(t))dt + \sigma dW(t)&#xA;$$&#xA;and the CIR model&#xA;$$&#xA;dr(t) = a(b - r(t))dt + \sigma\sqrt{r(t)} dW(t)&#xA;$$&#xA;to one-year Treasury yield data from 1974 (which were around 8% then!).  Let's say the estimates I got were&#xA;$$&#xA;Vasicek: a = 3.2, b = 8.1, \sigma = 6.0 \qquad (1)\\&#xA;CIR: a = 3.2, b = 8.1, \sigma = 2.3. \qquad (2)&#xA;$$&#xA;N.b. these values correspond to $r(t)$ in percent, not decimal.  So, my dimensions are short rate level measured in percent (%), and time, say, measured in seconds (s).  The units of the parameters are then&#xA;$$&#xA;a = s^{-1}, b = \%,  \sigma = \%/\sqrt{s}&#xA;$$&#xA;My question is, how does one intuitively interpret the estimated values in (1) and (2)?  I.e., I'm trying to think of the process as a physical process, and so what does a &quot;mean reversion speed of $3.2 / s$&quot; mean, e.g.? Actually, it seems that calling $a$ a &quot;speed&quot; is a misnomer, given the units.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any insights welcome!&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2017-12-31T20:44:15.557" Title="Interpreting Units of Short Rate Parameters" Tags="&lt;interest-rates&gt;&lt;stochastic-processes&gt;&lt;sde&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29524" PostTypeId="1" AcceptedAnswerId="29532" CreationDate="2016-08-07T18:38:31.070" Score="6" ViewCount="8665" Body="&lt;p&gt;Based on this topic:&#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/1621/how-to-derive-the-implied-probability-distribution-from-b-s-volatilities&quot;&gt;How to derive the implied probability distribution from B-S volatilities?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to implement the Breeden-Litzenberger formula to compute the market implied risk-neutral densities for the S&amp;amp;P 500 for some quoting dates. The steps that I take are as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Step 1&lt;/em&gt;: Extract the call_strikes &lt;code&gt;c_strikes&lt;/code&gt; for a given maturity T and the&#xA;    corresponding market prices &lt;code&gt;css&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Step 2&lt;/em&gt;: Once I have the strikes and market prices, I compute the implied volatilities via the function &lt;code&gt;ImplieVolatilities.m&lt;/code&gt; I'm 100% sure that this function works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Step 3:&lt;/em&gt; Next, I interpolate the implied volatility curve by making use of the Matlab command &lt;code&gt;interp1&lt;/code&gt;. Now, the vector &lt;code&gt;xq&lt;/code&gt; is the strikes grid and the vector &lt;code&gt;vq&lt;/code&gt;the corresponding interpolated implied volatilities. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Step 4&lt;/em&gt;: Since I have to volatility curve, I can compute the market implied density:&#xA;\begin{align}&#xA;f(K) &amp;amp;= e^{rT} \frac{\partial^2 C(K,T)}{\partial K^2} \\&#xA;&amp;amp;\approx e^{rT} \frac{C(K+\Delta_K,T)-2C(K,T)+C(K-\Delta_K, T)}{(\Delta_K)^2}&#xA;\end{align}&#xA;where $\Delta_K = 0.2$ is the strike grid size. I only show the core part of the Matlab program:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;c_strikes = Call_r_strikes(find(imp_vols &amp;gt; 0));&#xA;css = Call_r_prices(find(imp_vols &amp;gt; 0)); &#xA;&#xA;impvolss = ImpliedVolatilities(S,c_strikes,r,q,Time,0,css); %implied      volatilities&#xA; xq = (min(c_strikes):0.2:max(c_strikes)); %grid of strikes&#xA;vq = interp1(c_strikes,impvolss,xq); %interpolatd values %interpolated implied volatilities &#xA;&#xA;    f = zeros(1,length(xq)); %risk-neutral density&#xA;function [f] = secondDerivativeNonUniformMesh(x, y)&#xA;dx = diff(x); %grid size (uniform)&#xA;dxp = dx(2:end);&#xA;d2k = dxp.^2; %squared grid size&#xA;f = (1./d2k).*(y(1:end-2)-2*y(2:end-1)+y(3:end)); &#xA;end&#xA;&#xA;figure(2)&#xA;plot(xq,f);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note: &lt;code&gt;blsprice&lt;/code&gt; is an intern Matlab function so that one should definitely work. &#xA;This is the risk-neutral pdf for the interior points: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/mRfZ2.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/mRfZ2.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The data&lt;/strong&gt; The following table shows the option data (left column: strikes, middle: market prices and right column: implied volatilities):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;                   650                     387.5                  0.337024&#xA;                   700                    346.45                  0.325662&#xA;                   750                     306.8                  0.313846&#xA;                   800                    268.95                  0.302428&#xA;                   850                    232.85                  0.290759&#xA;                   900                    199.15                  0.279979&#xA;                   950                     168.1                  0.270041&#xA;                   975                     153.7                  0.265506&#xA;                  1000                     139.9                  0.260885&#xA;                  1025                    126.15                  0.255063&#xA;                  1050                     112.9                  0.248928&#xA;                  1075                     100.7                  0.243514&#xA;                  1100                     89.45                  0.238585&#xA;                  1125                     79.25                  0.234326&#xA;                  1150                      69.7                  0.229944&#xA;                  1175                      60.8                   0.22543&#xA;                  1200                      52.8                  0.221322&#xA;                  1225                      45.8                   0.21791&#xA;                  1250                      39.6                   0.21486&#xA;                  1275                      33.9                   0.21154&#xA;                  1300                     28.85                  0.208372&#xA;                  1325                      24.4                  0.205328&#xA;                  1350                      20.6                  0.202698&#xA;                  1375                      17.3                  0.200198&#xA;                  1400                     13.35                  0.193611&#xA;                  1450                      9.25                  0.190194&#xA;                  1500                      6.55                  0.188604&#xA;                  1550                       4.2                  0.184105&#xA;                  1600                      2.65                  0.180255&#xA;                  1650                     1.675                  0.177356&#xA;                  1700                     1.125                  0.176491&#xA;                  1800                     0.575                  0.177828&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;$T = 1.6329$ is the time to maturity, $r = 0.009779$ the risk-free rate and $q = 0.02208$ the dividend yield. The spot price $S = 1036.2$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Computation of the risk-free rate and dividend yield via Put-Call parity&lt;/strong&gt;&#xA;$r$ is the risk-free rate corresponding to maturity $T$ and $q$ is the dividend yield. In the numerical implementation, we derive $r$ and $q$ by again making use of the Put-Call parity. To that end, we assume the following linear relationship:&#xA;$$f(K) = \alpha K-\beta,$$&#xA;where $\alpha = e^{-rT}$ and $-e^{-qT}S(0) = \beta$, and $f(K) = P(K,T)-C(K,T)$. The constants $\alpha$ and $\beta$ are then computed by carrying out a linear regression. Consequently, the risk-free rate $r$ and dividend yield $q$ are then given by&#xA;\begin{align}&#xA;r &amp;amp;= \frac{1}{T}\ln\left(\frac{1}{\alpha}\right), \nonumber \\&#xA;q &amp;amp;= \frac{1}{T} \ln \left(\frac{-S(0)}{\beta}\right). \nonumber&#xA;\end{align}&lt;/p&gt;&#xA;" OwnerUserId="20813" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2018-04-14T15:30:38.933" Title="Breeden-Litzenberger formula for risk-neutral densities" Tags="&lt;calibration&gt;&lt;density&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29526" PostTypeId="2" ParentId="29523" CreationDate="2016-08-07T20:01:17.543" Score="2" Body="&lt;p&gt;The processes revert towards their mean with the speed $E(dr(t)/dt) =a*(b-r(t))$ so $a$ is not the speed itself, only one factor of it. If $\sigma$ would vanish then $a$ would be $ln (2)$ times the inverse of the time - &lt;strong&gt;hence its unit&lt;/strong&gt; $s^{-1}$- it would take for $b-r(t)$ to halve. Think of a as the decay-factor of the deviation from the mean!&lt;/p&gt;&#xA;" OwnerUserId="23886" LastEditorUserId="23886" LastEditDate="2016-09-07T12:15:51.020" LastActivityDate="2016-09-07T12:15:51.020" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29527" PostTypeId="2" ParentId="29519" CreationDate="2016-08-07T20:11:33.197" Score="1" Body="&lt;p&gt;Yield volatilities have not turned out to scale with yield. Otherwise yields would not have managed to become negative. The paper claims though that spread vol scales well with spread. Hence there are no similar arguments to apply .&lt;/p&gt;&#xA;" OwnerUserId="23886" LastActivityDate="2016-08-07T20:11:33.197" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29528" PostTypeId="2" ParentId="28385" CreationDate="2016-08-07T20:15:42.510" Score="1" Body="&lt;p&gt;The squareroot rule stems from the assumption, that the returns scale linear in time and the standard deviation scale with the squareroot of time. That means for the return of 1 year, that it should equal 12 times the monthly return (at least in some average sense). &#xA;That assumption is certainly not fullfilled, if you use different risk free rates for yearly and monthly returns. In order for the annualized sharpe ratio to be independent from the fact that it is calculated from monthly, yearly or any other frequency of returns you have to use the yearly risk free rate.&#xA;Another possibility seems to be to use the risk free rate that matches the maturity of your assets, whatever that exactly means.&lt;/p&gt;&#xA;" OwnerUserId="22686" LastActivityDate="2016-08-07T20:15:42.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29529" PostTypeId="2" ParentId="29518" CreationDate="2016-08-07T20:38:16.747" Score="1" Body="&lt;p&gt;Your equation describes how the future price is risk adjusted expected to stay constant as it has no interest rate related funding cost (in contrast to the stock). It bears however the same risk as the stock and should hence be compensated by the same true probability updrift. Say S is at 100 now and 2-yr F at 102 because r =1%. With risk premium of 5% we expect stock at approx 106 and 112 in 1 and 2 years. Hence we expect under true prbobability F to rise to 107 in one year and by (1) to 112 in 2 years. Thats the stocks 5 per year in risk premium!&lt;/p&gt;&#xA;" OwnerUserId="23886" LastActivityDate="2016-08-07T20:38:16.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29531" PostTypeId="2" ParentId="3356" CreationDate="2016-08-07T21:26:21.370" Score="3" Body="&lt;p&gt;One way to approach this is to use a structural credit model which links the price of debt and equity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To start with, you may wish to consider the JP Morgan / Deutsche Bank Credit Grades model which came out in 2002. In those days, the growing CDS market made it possible for hedge funds to short credit and to play any perceived mispricing of debt-equity from both sides. So it got a lot of coverage for a while. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is quite a nice extension of Merton's model and the fuzzy barrier solves the zero credit spread for short-term debt that the Merton model implies and which is not found in reality. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whether it is useful or will let you make money is an open question as far as I know. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a link to the technical paper.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.creditrisk.ru/publications/files_attached/cgtechdoc.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.creditrisk.ru/publications/files_attached/cgtechdoc.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should certainly be able to use it to calculate hedge ratios by doing simple perturbation of the stock price.&lt;/p&gt;&#xA;" OwnerUserId="12240" LastEditorUserId="12240" LastEditDate="2016-08-07T21:31:56.603" LastActivityDate="2016-08-07T21:31:56.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29532" PostTypeId="2" ParentId="29524" CreationDate="2016-08-08T07:24:28.143" Score="8" Body="&lt;p&gt;I assume that for approximating the second derivative of the call price $C (K,T) $ at the bounds of the strike domain (see first 2 &quot;if&quot; cases of the last for loop of your code) you tried to set up &lt;em&gt;boundary conditions&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the right bound, your approximation $C(K+\Delta K, T) \approx 0$ could make sense for $K \to \infty$ or at least big enough. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the left bound however, $C(K-\Delta K, T)$ cannot be approximated by zero, since call price is almost only intrinsic value for low strikes. Instead of zero, you could use the discounted difference of the forward price minus the strike, $C(K-\Delta K, T) \approx B(0,T)(F (0,T)-K)$, if $K \to 0$ or at least small enough. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This explains why you observe a strange behaviour on the LHS (with a negative pdf), while I guess that if you zoom in or remove that outlier you should be OK.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a first step, you could simply compute the pdf for interior points xq(2:end-1) (i.e. last case of your for loop) and check what it gives.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Edit]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking more closely, it seems like your input prices allow for static arbitrage opportunities, more specifically butterfly arbitrage. As such you cannot expect to obtain a reasonable pdf.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although it is far from perfect, maybe the script below will help. In it, I try to look for the strikes leading to arbitrage, and discard the corresponding inputs to obtain what a so-called &quot;clean&quot; pdf. This is a non-parametric approach. As discussed in the comments, using a parametric approach (e.g. fitting the vol smile using an arb free representation), will produce an even smoother pdf.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function [ ] = someBreedenLitzenbergerCode( )&#xA;&#xA;% Get data and interpolate&#xA;[K, C, ~] = getData();&#xA;dk = 0.5;&#xA;k = min(K):dk:max(K);&#xA;c = interp1(K, C, k, 'spline');&#xA;&#xA;% Notifying vertical arbitrage opportunities&#xA;dC = diff(C);&#xA;if any(dC &amp;gt; 0)&#xA;    warning('Input call prices allow for arbtirage (vert. spread)'); &#xA;end&#xA;&#xA;% Notifying and dealing with butterfly arbitrage opportunities&#xA;f = secondDerivativeNonUniformMesh(k, c);&#xA;idxkArb = find(f&amp;lt;0)+1;                                     &#xA;if ~isempty(idxkArb)&#xA;    warning('Input call prices allow for arbitrage (butterfly)');&#xA;end&#xA;&#xA;% Finding indices of input strikes/prices leading to arb&#xA;idxKArb = [];&#xA;for i = 1:length(idxkArb)&#xA;    idxHi = find(K&amp;gt;=k(idxkArb(i)),1,'first');&#xA;    idxLo = find(K&amp;lt;=k(idxkArb(i)),1,'last');&#xA;    idxKArb = [idxKArb, idxHi, idxLo];&#xA;end&#xA;idxKArb = unique(idxKArb);&#xA;disp('Strikes leading to butterfly arbitrages');&#xA;disp(K(idxKArb));&#xA;&#xA;% Cleaning inputs and calculating pdf&#xA;K_clean = K; K_clean(idxKArb) = [];&#xA;C_clean = C; C_clean(idxKArb) = [];&#xA;k_clean = min(K_clean):dk:max(K_clean);&#xA;c_clean = interp1(K_clean, C_clean, k_clean, 'spline');&#xA;f_clean = secondDerivativeNonUniformMesh(k_clean, c_clean);&#xA;&#xA;% Plotting results&#xA;if ishandle(1), clf(1); end;&#xA;figure(1);&#xA;subplot(221);&#xA;plot(K, C, 'x'); hold on;&#xA;plot(k, c, 'r-');&#xA;plot(k(idxkArb), c(idxkArb), 'rd');&#xA;grid on;&#xA;title('Original call prices, C(K)');&#xA;subplot(222);&#xA;plot(k(2:end-1), f); hold on;&#xA;plot(k(idxkArb),f(idxkArb-1), 'rd');&#xA;grid on;&#xA;title('Pdf, \phi(K)');&#xA;subplot(223);&#xA;plot(k_clean, c_clean); hold on; &#xA;lh.Box = 'off';&#xA;grid on;&#xA;title('Clean call prices, C(K)');&#xA;subplot(224);&#xA;plot(k_clean(2:end-1), f_clean); hold on;&#xA;a = ksr(k_clean(2:end-1), f_clean, 60); % Available at Matlab Central&#xA;plot(a.x, a.f, 'k-');&#xA;lh = legend('FD','FD + Smoothing');&#xA;lh.Box = 'Off';&#xA;grid on;&#xA;title('Pdf, \phi(K)'); &#xA;&#xA;end&#xA;&#xA;function d2y_dx2 = secondDerivativeNonUniformMesh(x, y)&#xA;&#xA;dx = diff(x);&#xA;dxp = dx(2:end);&#xA;dxm = dx(1:end-1);&#xA;d2k = dxp.*dxm;&#xA;d2kp = dxp.*(dxm+dxp);&#xA;d2km = dxm.*(dxm+dxp);&#xA;d2y_dx2 =  2./d2km .* y(1:end-2) - 2./d2k .*y(2:end-1) + 2./d2kp .*y(3:end);&#xA;&#xA;end&#xA;&#xA;function [strikes, prices, volatilities] = getData()&#xA;&#xA;mat = [650        387.5      0.33702&#xA;      700       346.45      0.32566&#xA;      750        306.8      0.31385&#xA;      800       268.95      0.30243&#xA;      850       232.85      0.29076&#xA;      900       199.15      0.27998&#xA;      950        168.1      0.27004&#xA;      975        153.7      0.26551&#xA;     1000        139.9      0.26088&#xA;     1025       126.15      0.25506&#xA;     1050        112.9      0.24893&#xA;     1075        100.7      0.24351&#xA;     1100        89.45      0.23858&#xA;     1125        79.25      0.23433&#xA;     1150         69.7      0.22994&#xA;     1175         60.8      0.22543&#xA;     1200         52.8      0.22132&#xA;     1225         45.8      0.21791&#xA;     1250         39.6      0.21486&#xA;     1275         33.9      0.21154&#xA;     1300        28.85      0.20837&#xA;     1325         24.4      0.20533&#xA;     1350         20.6       0.2027&#xA;     1375         17.3       0.2002&#xA;     1400        13.35      0.19361&#xA;     1450         9.25      0.19019&#xA;     1500         6.55       0.1886&#xA;     1550          4.2       0.1841&#xA;     1600         2.65      0.18025&#xA;     1650        1.675      0.17736&#xA;     1700        1.125      0.17649&#xA;     1800        0.575      0.17783];&#xA; strikes = mat(:,1);&#xA; prices = mat(:,2);&#xA; volatilities = mat(:,3);&#xA;&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ku5L2.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ku5L2.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-08-09T10:17:38.017" LastActivityDate="2016-08-09T10:17:38.017" CommentCount="23" ContentLicense="CC BY-SA 3.0" />
  <row Id="29533" PostTypeId="2" ParentId="29504" CreationDate="2016-08-08T08:25:26.823" Score="11" Body="&lt;p&gt;Just to add to the already nice answers, the result can also be obtained using the (stochastic) Fubini theorem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;\int_0^t W_s ds &amp;amp;= \int_0^t \int_0^s dW_u\, ds \tag{$W_s=\int_0^s dW_u$}\\&#xA;&amp;amp;= \int_0^t \int_u^t ds\,dW_u \tag{Fubini} \\&#xA;&amp;amp;= \int_0^t (t-u) dW_u \tag{$\int_u^t ds = t-u $}&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And we fall back on the same equation $(1)$ as in @Gordon's answer.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2016-08-08T08:25:26.823" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="29534" PostTypeId="2" ParentId="29515" CreationDate="2016-08-08T12:55:23.160" Score="1" Body="&lt;p&gt;It &lt;em&gt;is&lt;/em&gt; as simple as just taking the &lt;code&gt;max()&lt;/code&gt;. The problem is that you took the wrong one. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You must consider the max between the &lt;em&gt;intrinsic value of the option&lt;/em&gt; on the one hand and its discounted continuation value (which is an expectation in the risk-neutral world) on the other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your final loop, you should therefore replace the line&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;W(j+1,1) = max(K-W(j+2,1),exp(-r*delt)*( p*W(j+2,1) + (1-p)*W(j+1,1) ));&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;W(j+1,1) = max(phi, exp(-r*delt)*( p*W(j+2,1) + (1-p)*W(j+1,1) ));&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where for the tree node &lt;code&gt;j&lt;/code&gt; at the time iteration &lt;code&gt;n&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;w = (+1) * (opttype == 0) + (-1) * (opttype ~= 0)    % w = (opttype == 0) ? +1 : -1&#xA;S = S0*u^(j)*d^(n-j)&#xA;phi = w*(S-K)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-08-08T16:04:57.230" LastActivityDate="2016-08-08T16:04:57.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29535" PostTypeId="1" CreationDate="2016-08-08T16:30:55.143" Score="-1" ViewCount="2610" Body="&lt;p&gt;The I-spread (&quot;mid swap spread&quot; or yield-yield spread) is a standlone measure of credit risk, a security against matched maturity vanilla swap rate. Consider a package in which the investor receives security's coupon and takes credit risk: interest rate exposure is delta-hedged with a matched-maturity swap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The asset swap (ASW)-spread is a measure of total return, because coupon and principle cashflows are discounted at prevailing swap rate.  Upfront principle, which may be large if the security price is far from par, means that the ASW-/I-spreads are often highly divergent. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a closed form soln to convert from one to the other?&lt;/p&gt;&#xA;" OwnerUserId="21023" LastEditorUserId="21023" LastEditDate="2018-08-22T22:42:53.110" LastActivityDate="2018-08-22T22:42:53.110" Title="Compute I-spread from ASW-spread (or vice versa)" Tags="&lt;fixed-income&gt;&lt;derivatives&gt;&lt;swaps&gt;&lt;interest-rate-swap&gt;&lt;asset&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="29536" PostTypeId="1" AcceptedAnswerId="32703" CreationDate="2016-08-08T16:49:35.923" Score="1" ViewCount="277" Body="&lt;p&gt;In a volatile market with uncertainty it's more likely that we see a volatility skew and not so much a smile. Therefore it must hold that, in chaotic markets, out-of-the-money calls and in-the-money puts are in greater demand than in-the-money calls and out-of-the-money puts.(am I correct?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But how come OTM calls and ITM puts are more in demand in volatile markets?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Eg. the day after Brexit there is a skew for GBPUSD options&lt;/p&gt;&#xA;" OwnerUserId="18555" LastEditorUserId="11723" LastEditDate="2017-02-25T12:43:40.053" LastActivityDate="2017-02-26T21:33:01.153" Title="Volatility Smile/skew in volatile markets" Tags="&lt;options&gt;&lt;volatility&gt;&lt;volatility-smile&gt;&lt;skew&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29537" PostTypeId="2" ParentId="29535" CreationDate="2016-08-08T16:57:27.070" Score="0" Body="&lt;p&gt;The asset swap spread is the amortised repayment of the difference in price between a specific credit risky bond and the price of that same bond discounted on the Libor swap curve. It is written as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$D=\frac{P_{Libor}-P}{\rm PV01}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $PV01$ is the the annuity of the swap floating leg and $P_{Libor}$ is the discounted bond price on the Libor curve and $P$ is its actual market price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The repayment is risk free in the sense that the swap leg of the asset swap must continue to the maturity of the asset swap i.e. the swap does not cancel even if the asset defaults. As it depends on the price in the market of the bond, it does depend on the credit risk of that bond which is embedded in its market price and so it is risk-adjusted. As it determines cash flow sizes in a real trade, the asset swap spread is more than just a measure of credit risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your definition of an I-swap is not complete. Can you explain exactly how it is calculated. Does the swap cancel with the bond ? &lt;/p&gt;&#xA;" OwnerUserId="12240" LastActivityDate="2016-08-08T16:57:27.070" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="29538" PostTypeId="2" ParentId="29520" CreationDate="2016-08-08T17:48:55.867" Score="0" Body="&lt;p&gt;This does nor address your question directly, but is somehow related &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&quot;We find no evidence that a GARCH(1,1) is outperformed by more sophisticated models in our analysis of exchange rates, whereas the GARCH(1,1) is clearly inferior to models that can accommodate a leverage effect in our analysis of IBM returns.&quot;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Peter R. Hansen, Asger Lunde, &lt;strong&gt;A forecast comparison of volatility models: does anything beat a GARCH(1,1)?&lt;/strong&gt; &lt;em&gt;JAE&lt;/em&gt;, Volume 20, Issue 7, December 2005, Pages 873–889&lt;/p&gt;&#xA;" OwnerUserId="13571" LastActivityDate="2016-08-08T17:48:55.867" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29540" PostTypeId="2" ParentId="28448" CreationDate="2016-08-08T18:31:45.520" Score="2" Body="&lt;p&gt;&lt;a href=&quot;https://www.getvolatility.com&quot; rel=&quot;nofollow&quot;&gt;GetVolatility&lt;/a&gt; features a pretty robust backtest capability. But be aware, it's paid and somehow expensive, since it focus on professional traders.&lt;/p&gt;&#xA;" OwnerUserId="23895" LastActivityDate="2016-08-08T18:31:45.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29541" PostTypeId="2" ParentId="29520" CreationDate="2016-08-08T19:25:26.993" Score="0" Body="&lt;p&gt;I found a couple of papers mentioning bias of EGARCH:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Demos, Antonis, and Dimitra Kyriakopoulou. &quot;Bias correction of ML and QML estimators in the EGARCH (1, 1) model.&quot; &lt;em&gt;Preprint&lt;/em&gt; (2010).&lt;/li&gt;&#xA;&lt;li&gt;Deb, Partha. &quot;Finite sample properties of maximum likelihood and quasi-maximum likelihood estimators of EGARCH models.&quot; &lt;em&gt;Econometric Reviews&lt;/em&gt; 15.1 (1996): 51-68.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The first one is the same as you mention, so it is of no extra use to you. Probably the second one could be more useful. Unfortunately, I do not have access to it, so I cannot see what is inside.&lt;/p&gt;&#xA;" OwnerUserId="19645" LastActivityDate="2016-08-08T19:25:26.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29542" PostTypeId="2" ParentId="29503" CreationDate="2016-08-08T19:44:00.837" Score="2" Body="&lt;p&gt;Which strategy will work better is an empirical question that depends on the data at hand. That is, you cannot prove theoretically that one approach is better than the other without some extra assumptions.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I could of course back test different filtering strategies based on these two, but the more complicated, the more risk of overfitting IMO&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;As long as you properly split the sample into a &lt;em&gt;training&lt;/em&gt; and &lt;em&gt;test&lt;/em&gt; subsamples, model complexity does not play a role. A model that overfits in the training sample will perform poorly in the test sample, and you will see it.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Of course, if you have a large number of alternative models, one or a few of them may perform well in both the training and the test subsample due to pure luck; but it does not seem you are facing this kind of setting.)&lt;/p&gt;&#xA;" OwnerUserId="19645" LastActivityDate="2016-08-08T19:44:00.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29546" PostTypeId="1" AcceptedAnswerId="29548" CreationDate="2016-08-08T22:14:49.987" Score="0" ViewCount="1850" Body="&lt;p&gt;&lt;strong&gt;Background&lt;/strong&gt;: This question is from Active Portfolio Management by Grinold and Kahn (Exercise 4 of Chapter 2- Consensus Expected Returns: The Capital Asset Pricing Model). I have no background in finance and am trying to work through this book on my own.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; Assume that residual returns are uncorrelated across stocks. Stock A has a beta of 1.15 and a volatility if 35 percent. Stock B has a beta of .95 and a volatility of 33 percent. If the market volatility is 20 percent, what is the correlation of stock A with stock B? Which stock has higher residual volatility?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Comments:&lt;/strong&gt; 1. This question is not about the CAPM because we are assuming there are residual returns? 2. What is the exact definition of volatility being used here? 3. Is there a nice formula for the first part of the question? 4. I have a slight feeling for the second question since the beta determines how much of the volatility comes from the market. 5. The only formulas I think I need are&#xA;$$&#xA;\beta_P  = \frac {\operatorname{Cov}(r_P, r_M)}{\operatorname{Var}(r_M)}, \quad r_P = \beta_P + \theta_P, \quad \sigma_P^2= \beta_P^2\sigma_M^2 + \omega_P^2,&#xA;$$&#xA;where $P$ is the portfolio, $M$ is the market and $r_P$ and $r_M$ are their respective excess returns, $\theta_P$ is the residual return, and $\omega_P$ is the residual variance of portfolio  $P$ (i.e., the variance of $\theta_P$). Finally, just to be clear, $\operatorname{Var}(r_M) = \sigma_P^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Attempt at second part&lt;/strong&gt;: Using the third formula above I get residua volatility for $A$ to be 35-23 = 12%  and for $B$ to be 33- 19 = 14 %, so stock B has higher residual volatility.&lt;/p&gt;&#xA;" OwnerUserId="22212" LastEditorDisplayName="user16651" LastEditDate="2016-08-10T17:28:14.217" LastActivityDate="2016-08-10T17:28:14.217" Title="Calculating the correlation of stock A with stock B" Tags="&lt;volatility&gt;&lt;equities&gt;&lt;capm&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29548" PostTypeId="2" ParentId="29546" CreationDate="2016-08-08T23:53:46.477" Score="2" Body="&lt;p&gt;The definition of correlation is $\rho=\frac{covar(r_A,r_B)}{\sigma_A \sigma_B}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know $\sigma_A=0.35;\sigma_B=0.33$. What is the covariance?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the residuals are independent the covariance only comes from the systematic (market) movement in both stocks. A useful general formula is $covar(\beta_A X,\beta_B X)=\beta_A \beta_B var(X)$. (see &lt;a href=&quot;https://en.wikipedia.org/wiki/Covariance#Properties&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Covariance#Properties&lt;/a&gt; ).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So putting it all together$\rho=\frac{\beta_A \beta_B\sigma_M^2}{\sigma_A \sigma_B}$&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-08-09T00:53:23.667" LastActivityDate="2016-08-09T00:53:23.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29549" PostTypeId="1" CreationDate="2016-08-09T01:06:21.920" Score="1" ViewCount="794" Body="&lt;p&gt;let's take delta; What can the delta of a Heston model be used for? I know it can used for hedging strategies, but can we say something about the market and the model by looking at the delta. Can we conclude anything by comparing the deltas of two models?&#xA;Or other Greeks&lt;/p&gt;&#xA;" OwnerUserId="20722" LastActivityDate="2016-08-09T07:15:42.837" Title="The Greeks of a stochastic volatility model: what's the purpose?" Tags="&lt;options&gt;&lt;greeks&gt;&lt;heston&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29550" PostTypeId="2" ParentId="29549" CreationDate="2016-08-09T07:15:42.837" Score="2" Body="&lt;p&gt;Delta measures the sensitivity of an option's theoretical value to a change in the price of the underlying asset. It is normally represented as a number between minus one and one, and it indicates how much the value of an option should change when the price of the underlying stock rises by one dollar.Indeed&#xA;$$\color{red}{\Delta \approx \frac{U(S+dS,v,t,T,K)-U(S,v,t,T,K)}{dS}}$$ &#xA;where $U$ denotes the option price and $v_t$ is the stochastic volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Mathematically speaking&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the Heston model, we have&#xA;$$\frac{\partial U}{\partial t}+\,r{{S}_{t}}\frac{\partial U}{\partial S}+[\kappa (\theta -{{v}_{t}})-\lambda {{v}_{t}}]\,\frac{\partial U}{\partial v}-rU+\\\frac{1}{2}{{v}_{t}}{{S}_{t}}^{2}\frac{{{\partial }^{2}}U}{\partial {{S}^{2}}}+\rho  \sigma \,{{v}_{t}}{{S}_{t}}\frac{{{\partial }^{2}}U}{\partial S  \partial v}+\frac{1}{2}{{\sigma }^{2}}{{v}_{t}}\frac{{{\partial }^{2}}U}{\partial {{v}^{2}}}=0\tag 1$$&#xA;As you know&#xA;$$\Delta =\frac{\partial U}{\partial S}\,,\,\Gamma =\frac{{{\partial }^{2}}U}{\partial {{S}^{2}}}\,,\,\rho =\frac{\partial U}{\partial r}\,,\,\Theta =\frac{\partial U}{\partial t},\\&#xA;\vartheta =\frac{\partial U}{\partial v},\operatorname{Vanna}=\frac{{{\partial }^{2}}U}{\partial S\partial v},\operatorname{Volga}=\frac{{{\partial }^{2}}U}{\partial {{v}^{2}}}\tag 2$$&#xA;$(1)$ and $(2)$&#xA;$$rU=\color{red}{\Theta} +\,(r-q)S\color{red}{\Delta} +[\kappa (\theta -v)-\lambda v]\color{red}{\vartheta} +\frac{1}{2}v{{S}^{2}}\color{red}{\Gamma} +\rho \sigma \,vS\,\,\color{red}{\operatorname{Vanna}}+\frac{1}{2}{{\sigma }^{2}}v\,\color{red}{\operatorname{Volga}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore the Greeks are so important.&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastActivityDate="2016-08-09T07:15:42.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29551" PostTypeId="2" ParentId="978" CreationDate="2016-08-09T11:30:46.143" Score="3" Body="&lt;p&gt;You have two main papers that show this result:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;In a finite framework and in a somewhat simplified continuous framework, see &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.118.327&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow&quot;&gt;Harrison &amp;amp; Pliska (1981)&lt;/a&gt;, Corollary on page 228, Proposition 2.9 and Proposition 3.31. If you are familiar with French, this &lt;a href=&quot;http://neumann.hec.ca/~p240/c664093/documents/&quot; rel=&quot;nofollow&quot;&gt;webpage of HEC Montreal&lt;/a&gt; has some slides that go through the finite case proofs $-$ look for documents with &lt;em&gt;harrisonpliska&lt;/em&gt; in their name.  &lt;/li&gt;&#xA;&lt;li&gt;An extremely abstract and general version due to Delbaen &amp;amp; Schachermayer (1994).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;These two papers deal with the two Fundamental Theorems of Asset Pricing $-$ i.e. the correspondence between the no-arbitrage condition, the risk neutral measure $\mathbb{Q}$ and the uniqueness of this measure. The risk neutral pricing formula is a direct result of these theorems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my opinion, Harrison &amp;amp; Pliska's finite case theory is enough to understand how the risk neutral pricing theory works.&lt;/p&gt;&#xA;" OwnerUserId="20454" LastActivityDate="2016-08-09T11:30:46.143" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29552" PostTypeId="1" AcceptedAnswerId="29564" CreationDate="2016-08-09T12:41:34.523" Score="2" ViewCount="366" Body="&lt;p&gt;Assume I use some finite difference solver to solve for American type of exercise in BS framework where stock pays dividend discretely. Then at every time iteration, for call option, I firstly adjust for dividends and then account for early exercise by taking a max between intrinsic value and &quot;value to hold&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should I swap the order in a case of a put? Should I first adjust for early exercise and after for a dividend?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason I am in doubt is because with a call I better exercise right before the dividend and with a put right after. Is that correct?&lt;/p&gt;&#xA;" OwnerUserId="22823" LastActivityDate="2016-08-10T09:35:08.123" Title="pricing american put option with fdm" Tags="&lt;american-options&gt;&lt;numerical-methods&gt;&lt;finite-difference-method&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29553" PostTypeId="2" ParentId="28448" CreationDate="2016-08-09T14:41:31.737" Score="1" Body="&lt;p&gt;See &lt;a href=&quot;https://www.quantopian.com/posts/options-trading-quick-simple-question-im-a-newbee&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; workaround suggestion for &lt;a href=&quot;https://www.quantopian.com/home&quot; rel=&quot;nofollow noreferrer&quot;&gt;Quantopian&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;As of now Quantopian only offers equity trading. However, I think it would be fairly easy to hack something together for the sake of backtesting.&lt;/p&gt;&#xA;&lt;p&gt;For simplicity, say it's a European call, I guess you could calculate the Black-Scholes price and buy at time i. Then down the line at e.g. time i+90 (days) you could see if you would get a positive payoff, i.e. max(S-K, 0) &amp;gt; 0 and in that case submit an order.&lt;/p&gt;&#xA;&lt;p&gt;Actually Pandas can be used to fetch options prices from Yahoo! Finance (see &lt;a href=&quot;http://python4econ.blogspot.hk/2013/02/building-stock-options-historical.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://python4econ.blogspot.hk/2013/02/building-stock-options-historical.html&lt;/a&gt;), but I don't think it's possible to get historical option prices anywhere for free. Thus, you might have to stick with your Black-Scholes price (even though the option you calculate might not be available in real life).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="20465" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-08-09T14:41:31.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29554" PostTypeId="1" CreationDate="2016-08-09T15:14:36.610" Score="1" ViewCount="1088" Body="&lt;p&gt;Calculate the value of an interest rate swap with these features:&#xA;Notional $100M&lt;/p&gt;&#xA;&lt;p&gt;Pay: 3.5% semi-annually&lt;/p&gt;&#xA;&lt;p&gt;Receive: BBSW semi-annually&lt;/p&gt;&#xA;&lt;p&gt;Term: 3 years&lt;/p&gt;&#xA;&lt;p&gt;Assume the BBSW curve is as presented here:&lt;a href=&quot;https://i.stack.imgur.com/VVD5W.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/VVD5W.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;I literally have no idea how to do this question as I couldn't find it in my textbook or my lecture slides. So I tried to use the following method. I put the table of data into a graph (using excel) and found the approximate equation for it. From there I was able to find each year's rate.&lt;/p&gt;&#xA;&lt;p&gt;Then i found each 'coupon payment' was 3.5m and used the discounted cash flow model to find the present value of the interest rate swap (97.66m).&lt;/p&gt;&#xA;&lt;p&gt;What is the proper way to do this question.&lt;/p&gt;&#xA;" OwnerUserId="23907" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-08-10T03:01:20.903" Title="Calculating the value of an interest rate swap" Tags="&lt;interest-rate-swap&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29555" PostTypeId="1" AcceptedAnswerId="29557" CreationDate="2016-08-09T15:55:55.023" Score="4" ViewCount="1564" Body="&lt;p&gt;I am reading stochastic calculus and I have understood that the process&#xA;$$X=\int_{0}^{1}\sqrt{\frac{\tan^{-1}t}{t}}dW_t$$&#xA;has normal distribution with mean zero.  How can I find the variance of $X$?&lt;/p&gt;&#xA;" OwnerUserId="22715" LastEditorUserId="467" LastEditDate="2016-08-10T00:51:37.420" LastActivityDate="2016-08-10T10:20:05.663" Title="What's the variance of this Ito integral?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="29556" PostTypeId="2" ParentId="29554" CreationDate="2016-08-09T16:00:02.220" Score="0" Body="&lt;p&gt;It's really simpler than you think.  I'm not sure where to find a good formula, but to do it manually:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Calculate the amount of money that you will receive in each period less the money that you will pay out in each period.&lt;/li&gt;&#xA;&lt;li&gt;Calculate the interest that you will receive or pay depending on the cash balance in that period.  In your example you will start negative since you are paying .035 and receiving .025.  You have no know what rate structure you are using.  Maybe OIS?  Maybe LIBOR?  If you are a commercial end-user you might end up paying a higher rate to borrow than you receive when you have a long cash balance.&lt;/li&gt;&#xA;&lt;li&gt;Discount the payments. Receiving $x in the future gets discounted by some factor.  To be safe use LIBOR.&lt;/li&gt;&#xA;&lt;li&gt;Sum it up!&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="20092" LastActivityDate="2016-08-09T16:00:02.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29557" PostTypeId="2" ParentId="29555" CreationDate="2016-08-09T17:27:17.497" Score="10" Body="&lt;p&gt;$$\mathbb{E^P}\left[\int_{0}^{1}\sqrt{\frac{\tan^{-1}t}{t}}dW_t\right]=0 $$&#xA;thus&#xA;$$\sigma^2=\mathbb{Var^P}\left(\int_{0}^{1}\sqrt{\frac{\tan^{-1}t}{t}}dW_t\right)=\mathbb{E^P}\left[\left(\int_{0}^{1}\sqrt{\frac{\tan^{-1}t}{t}}dW_t\right)^2\right] $$ &#xA;By application of &lt;a href=&quot;https://en.wikipedia.org/wiki/It%C3%B4_isometry&quot; rel=&quot;nofollow&quot;&gt;Ito's isometry&lt;/a&gt;, we have&#xA;$$\sigma^2=\mathbb{E^P}\left[\int_{0}^{1}\left(\sqrt{\frac{\tan^{-1}t}{t}}\right)^2dt\right]=\mathbb{E^P}\left[\int_{0}^{1}\frac{\tan^{-1}t}{t}dt\right]=\int_{0}^{1}\frac{\tan^{-1}t}{t}dt\tag 1$$&#xA;we know (See Maclaurin Series of $\tan^{-1}x$ in &lt;a href=&quot;http://mathworld.wolfram.com/MaclaurinSeries.html&quot; rel=&quot;nofollow&quot;&gt;wolfram&lt;/a&gt;)&#xA;$$\tan^{-1}t=\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{2n-1}t^{2n-1}$$&#xA;hence&#xA;$$\frac{\tan^{-1}t}{t}=\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{2n-1}t^{2n-2}$$&#xA;and&#xA;$$I=\int_{0}^{1}\frac{\tan^{-1}t}{t}dt=\int_{0}^{1}\left(\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{2n-1}t^{2n-2}\right)dt=\sum_{n=1}^{\infty}\int_{0}^{1}\frac{(-1)^{n+1}}{2n-1}t^{2n-2}dt$$&#xA;therefore&#xA;$$I=\sum_{n=1}^{\infty}\left[\frac{(-1)^{n+1}}{(2n-1)^2}t^{2n-1}\Big{|}_{0}^{1}\right]=\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{(2n-1)^2}=\sum_{n=0}^{\infty}\frac{(-1)^{n}}{(2n+1)^2}=\color{red}{G}\tag 2$$&#xA;where $G$ is &lt;a href=&quot;https://en.wikipedia.org/wiki/Catalan%27s_constant&quot; rel=&quot;nofollow&quot;&gt;Catalan's constant&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(1)$ and $(2)$&#xA;$$\sigma^2=G\simeq  0.916$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-08-10T10:20:05.663" LastActivityDate="2016-08-10T10:20:05.663" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29558" PostTypeId="2" ParentId="29476" CreationDate="2016-08-09T20:00:18.877" Score="0" Body="&lt;p&gt;To value a 1x4 FRA you need the forward rate f(1,4) from a 3 Month yield curve. For that you need the discount factors at 1 month and 4 months. The 1 month discount factor can be extracted from the 1 month libor rate. But for the 4 month discount you can not use the 4 month libor. You can use swaps with 4 month left to maturity and payment frequency 3 month but these are not very liquid. Also often FRA quotes are used for these timebuckets below 1 year. &#xA;of course you can also just interpolate between a 3 month zerorate from libor and a 1 year zerorate from swaps. That would be the most simple solution. &#xA;Above 1 year swap rates are normally much more reliable than below.&lt;/p&gt;&#xA;" OwnerUserId="22686" LastActivityDate="2016-08-09T20:00:18.877" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29559" PostTypeId="1" CreationDate="2016-08-09T21:08:16.040" Score="1" ViewCount="206" Body="&lt;p&gt;I would appreciate help with a valuation of a fixed income derivative, with an embedded exit option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Summary:&lt;/strong&gt;&#xA;Goal is to provide valuation of a fixed schedule of quarterly cash flows with an option to exit at any quarter (3 years from today) for a lump sum exit payment (to dispose by refinancing). The lump sum payment is calculated for each quarter based on the spot level of a basket of spreads, and there are no cash flows after the option is executed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;INPUTS:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;$CF_T$ - array of quarterly cash flows assuming no exit,&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$r_{k \times 12}$ - matrix containing 12 month history of $k$ discount margins,&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$\operatorname{ExitCF}(r[1..k][\![t]\!],t)$ - function for calculation of the exit cash flow which depends on k spot-spreads at time t when the exit option is executed,&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$\operatorname{DiscRate}$ - being the discount rate for the valuation.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Main Questions&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Assuming there is only one spread in the basket, how to model the value of the option?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Does it make sense to use Vasicek model for modelling spreads as interest rates?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Does it make sense to normalize all spreads and model their Z-score through Vasicek model?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How to calibrate Vasicek model on normalized Z-scores of a basket of spreads?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Spreads:&lt;/strong&gt;&#xA;The basket of spreads is dominated by the first item which makes some 75%, first two are 85%. It is also highly correlated where last item has 60% correlation to first, second is some 82% to first. Having said that, I would normalize all spreads and look at their Z-score:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;z_{k,t+1} = \frac{r_{k,t+1}-\operatorname{Mean}(r_{k,1 \cdots t+1})}{\operatorname{StDev}(r_{k,1 \cdots t+1}) \cdot \sqrt{4} /\sqrt{t+1}},&#xA;$$&#xA;where standard deviation is annualized by multiplying by $\sqrt{4}$ and divided to adjust for sample size, as the sample grows in the future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Modelling Spreads:&lt;/strong&gt; Given that the first and most important spread in the basket is not a measure of credit risk (a very senior credit instrument), I would like to model it as an interest rate. I also don't want to apply any credit migration provisions. My long term reversion rate should be the present rate at $(t+1)$. I would like to model $z$ variable and derive all rates from there. I initially thought about Cox-Ingersoll-Ross model, but given that the standard deviation factor (containing $\sqrt{r_t}$ was making issues, I think it is more appropriate to use Vasicek model instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume $z$ is a Vasicek process ($k$ assumed to be $1$, and omitted):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ d z_t = a(b - z_t) d t + \sigma_z d W_t, $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;then by replacing $z_t=\frac{r_t-\bar{r_t}}{\sigma_t}$ and $\sigma_z=1$, this is equivalent to $r_t$ being also a Vasicek process:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ d r_t = a([b \sigma_r + \bar{r} ( 1 + \frac{1}{\sigma_r}) ] - r_t ) d t + \sigma_r d W_t . $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would then fit the Vasicek model on spread $k=1$ (the most important one), and solve for $a$ and $b$, based on the terms for $d r_t$ expression.&lt;/p&gt;&#xA;" OwnerUserId="23906" LastEditorUserId="23906" LastEditDate="2016-08-10T17:40:09.077" LastActivityDate="2016-08-10T17:40:09.077" Title="Pricing with Vasicek model on basket of credit spreads" Tags="&lt;option-pricing&gt;&lt;interest-rates&gt;&lt;stochastic-processes&gt;&lt;exotics&gt;&lt;vasicek&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29560" PostTypeId="2" ParentId="17497" CreationDate="2016-08-09T23:10:52.547" Score="0" Body="&lt;p&gt;The variables going into IV are not reliable, and in Black-Scholes there are so many flaws that anything derived from it, including IV, is unreliable as well. This is well-known as a flaw. IV is only an estimate. However, it is based on the fixed underlying and option values today, and these will change in the future. So IV does not measure future volatility in any sense. The commonly held belief is that &quot;volatility leads price&quot; but in fact, it is the other way around: &quot;Price leads volatility. Thus, historical volatility is the only reliable method for understanding the evolving risk in a particular option contract.&lt;/p&gt;&#xA;" OwnerUserId="23912" LastActivityDate="2016-08-09T23:10:52.547" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29561" PostTypeId="2" ParentId="29554" CreationDate="2016-08-10T03:01:20.903" Score="1" Body="&lt;p&gt;The first step is to interpolate the curve into 6-month intervals. For simplicity, you can just linearly interpolate between the rates you're given so that you have rates for 0.5, 1, 1.5, ..., 3 year tenors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next, you prepare the cash flow schedule. The fixed leg (pay) is easy: every 6-month, you pay $100{,}000{,}000 \times 3.5 / 2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The floating leg requires 6-month forward rates. These can be easily computed from the zero rates you're given. For example, the 6m forward 6m rate is solved from $e^{2.5\% \times 0.5}e^{f \times 0.5} = e^{3\% \times 1}$. The corresponding floating leg payment is simply $100{,}000{,}000 \times f / 2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, you need the present value of all the cash flows. AUD swaps are discounted using BBSW rates, which you're given. The 2-year discount factor, for example, is simply $e^{3.5\% \times 2}$. These can be used to calculate the present values of each cash flow, and you just sum these PVs up to obtain the overall swap's NPV.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2016-08-10T03:01:20.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29564" PostTypeId="2" ParentId="29552" CreationDate="2016-08-10T09:35:08.123" Score="1" Body="&lt;p&gt;I would recommend to do both.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the situation where a single discrete dividend is paid at $t$. You use a Finite Difference (FD) scheme to price a European option. Starting from the terminal condition at $T$, by backward induction you manage to obtain the solution $$V(t^+, \mathcal{S})$$ for a discrete grid of spot levels $\mathcal{S}$ at time $t^+$. For the moment, it is as if you did not consider dividends.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, because the stock goes ex at $t$, the no-jump condition writes: $$V(t^-,\mathcal{S}) = V(t^+,\mathcal{S}-D) \tag{1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you talk about &quot;accounting for the dividend payment&quot;, I assume you talk about the transformation $V(t^+,\mathcal{S}) \to V(t^-,\mathcal{S})$ you need to take care of before being able to resume your FD backward stepping up to time $t=0$. From $(1)$ you know that $V(t^+,\mathcal{S}) \to V(t^-,\mathcal{S})=V(t^+,\mathcal{S}-D)$. This means you can (for instance) perform an interpolation to find $V(t^+,\mathcal{S}-D)$ from $V(t^+,\mathcal{S})$ and set $V(t^-,\mathcal{S})$ equal to the result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For American options I would advise to do, when you reach time step $t$&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Once you get $V(t^+,\mathcal{S})$, do $V(t^+,\mathcal{S}) = \max( V(t^+,\mathcal{S}), (\phi(\mathcal{S}-K))^+)$ = check for optimal exercise opportunity &lt;strong&gt;after&lt;/strong&gt; a dividend payment&lt;/li&gt;&#xA;&lt;li&gt;Account for the dividend payment $V(t^+,\mathcal{S}) \to V(t^-,\mathcal{S})=V(t^+,\mathcal{S}-D)$ = account for dividend payment&lt;/li&gt;&#xA;&lt;li&gt;Once you get  $V(t^-,\mathcal{S})$, do $V(t^-,\mathcal{S}) = \max( V(t^-,\mathcal{S}), (\phi(\mathcal{S}-K))^+)$ = check for optimal exercise opportunity &lt;strong&gt;before&lt;/strong&gt; a dividend payment&lt;/li&gt;&#xA;&lt;li&gt;Move backward to previous time step $t-\Delta t$... and repeat.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;with $\phi=\pm1$ for call/put respectively.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2016-08-10T09:35:08.123" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29566" PostTypeId="1" CreationDate="2016-08-10T14:52:06.730" Score="2" ViewCount="2686" Body="&lt;p&gt;I recently started using the R-package &lt;code&gt;PortfolioAnalytics&lt;/code&gt; for performing some portfolio optimization. And I'm trying to get a grasp on what exactly the function &lt;code&gt;optimize.portfolio.rebalancing&lt;/code&gt; is calculating. In particular, I'm wondering why the weights calculated (from the second period onwards) are different than the ones that I get when directly calling &lt;code&gt;optimize.portfolio&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was under the impression that &lt;code&gt;optimize.portfolio.rebalancing&lt;/code&gt; was basically a &quot;wrapper around &lt;code&gt;optimize.portfolio&lt;/code&gt;&quot; (from the manual), so I thought that the function simply calls &lt;code&gt;optimize.portfolio&lt;/code&gt; repeatedly for periods of length &lt;code&gt;rolling_window&lt;/code&gt;. But then, shouldn't the results be identical to what a manual call of &lt;code&gt;optimize.portfolio&lt;/code&gt; with the exact same periods yields? Or is &lt;code&gt;optimize.portfolio.rebalancing&lt;/code&gt; performing some additional calculations? What am I missing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a minimal example illustrating my question:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;data(&quot;edhec&quot;)&#xA;returns &amp;lt;- edhec[, 1:4]&#xA;funds &amp;lt;- colnames(returns)&#xA;&#xA;portfolio &amp;lt;- portfolio.spec(assets = funds)&#xA;portfolio &amp;lt;- add.constraint(portfolio = portfolio, type = &quot;full_investment&quot;)&#xA;portfolio &amp;lt;- add.constraint(portfolio = portfolio, type = &quot;long_only&quot;)&#xA;portfolio &amp;lt;- add.objective(portfolio = portfolio, type = &quot;risk&quot;, name = &quot;ES&quot;)&#xA;&#xA;portfolio.rebalanced &amp;lt;- optimize.portfolio.rebalancing(R = returns,&#xA;                                                       portfolio = portfolio,&#xA;                                                       optimize_method = &quot;ROI&quot;,&#xA;                                                       rebalance_on = &quot;quarters&quot;,&#xA;                                                       training_period = 12,&#xA;                                                       rolling_window = 12)&#xA;&#xA;# check, if optimize.portfolio gives the same results: first period&#xA;portfolio.optimized &amp;lt;- optimize.portfolio(R = returns[&quot;::1997-12-31&quot;,],&#xA;                                          portfolio = portfolio,&#xA;                                          optimize_method = &quot;ROI&quot;)&#xA;portfolio.optimized&#xA;portfolio.rebalanced$opt_rebalancing$`1997-12-31`&#xA;# YES!&#xA;&#xA;# but: last period&#xA;portfolio.optimized &amp;lt;- optimize.portfolio(R = returns[&quot;2006-08-31::2009-08-31&quot;,],&#xA;                                          portfolio = portfolio,&#xA;                                          optimize_method = &quot;ROI&quot;)&#xA;portfolio.optimized&#xA;portfolio.rebalanced$opt_rebalancing$`2009-08-31`&#xA;# NO! What's wrong?&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="23920" LastActivityDate="2016-12-17T23:51:43.643" Title="What is optimize.portfolio.rebalancing in R-package PortfolioAnalytics calculating?" Tags="&lt;r&gt;&lt;portfolio-optimization&gt;&lt;rebalancing&gt;" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="29568" PostTypeId="1" AcceptedAnswerId="29571" CreationDate="2016-08-10T18:52:47.403" Score="1" ViewCount="84" Body="&lt;p&gt;We can find ETF that usually mimick some stock index, for e.g. SP500 has SPDR, Dow Jones Industrial Average has DIA, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does an ETF that tracks all these indexes exist? &lt;/p&gt;&#xA;" OwnerUserId="9499" LastActivityDate="2016-08-10T19:45:58.843" Title="ETFs mimicking world economy?" Tags="&lt;portfolio-management&gt;&lt;etf&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29569" PostTypeId="2" ParentId="28161" CreationDate="2016-08-10T19:13:20.477" Score="1" Body="&lt;p&gt;The &quot;rmgarch&quot; package in R requires specifying univariate GARCH models before a DCC (or asymmetric DCC, aDCC) can be fitted. The &lt;strong&gt;workaround&lt;/strong&gt; is to specify models that essentially &quot;do nothing&quot;, e.g. a GARCH model with $\alpha=0.00001$ and $\beta=0.99999$ and variance targetting at the unconditional variance. These models will produce roughly constant conditional variance so their effect will be negligible. I have done it before, it worked alright.&lt;/p&gt;&#xA;" OwnerUserId="19645" LastActivityDate="2016-08-10T19:13:20.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29570" PostTypeId="2" ParentId="28120" CreationDate="2016-08-10T19:21:36.210" Score="3" Body="&lt;p&gt;There is a mention of robust standard errors in &lt;a href=&quot;https://cran.r-project.org/web/packages/rugarch/vignettes/Introduction_to_the_rugarch_package.pdf&quot; rel=&quot;nofollow&quot;&gt;&quot;rugarch&quot; vignette&lt;/a&gt; on p. 25. The robust standard errors are due to quasi maximum likelihood estimation (QMLE) as opposed to (the regular) maximum likelihood estimation (MLE). They are robust against violations of the distributional assumption, e.g. when the assumed distribution is Normal while the true distribution is Student-$t$. The source cites White &lt;a href=&quot;http://www.jstor.org/stable/1912526&quot; rel=&quot;nofollow&quot;&gt;&quot;Maximum likelihood estimation of misspecified models&quot;&lt;/a&gt; (1982), the (famous) paper introducing QMLE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, are they justifiable? Roughly speaking, if the true distribution is not particularly ill-behaved, QMLE will work. If the true ditribution coincides with the assumed distributions, QMLE will still work, so there is not much to lose (although MLE would give narrower confidence intervals than QMLE, which could be useful). For a rigorous treatment, see White's (1982) paper or an econometrics textbook.&lt;/p&gt;&#xA;" OwnerUserId="19645" LastEditorUserId="19645" LastEditDate="2016-08-11T10:51:08.063" LastActivityDate="2016-08-11T10:51:08.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29571" PostTypeId="2" ParentId="29568" CreationDate="2016-08-10T19:45:58.843" Score="2" Body="&lt;p&gt;If the objective is to mimick all the world's equity stock markets in a single ETF there would appear to be 2 choices:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;VT which tracks something called FTSE Global All Cap Index with a very low expense ratio&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ACWI tracks the MSCI All Country World Index; it is very liquid&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2016-08-10T19:45:58.843" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29572" PostTypeId="1" CreationDate="2016-08-10T20:01:56.100" Score="75" ViewCount="40439" Body="&lt;p&gt;&lt;strong&gt;My company is starting a new initiative aimed at building a financial database from scratch.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;We would be using it in these ways:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Time series analysis of: a company's financial data (ex: IBM's total fixed assets over time), aggregations (ex: total fixed assets for the materials sector over time), etc.&lt;/li&gt;&#xA;&lt;li&gt;Single company snapshot: various data points of a single company&lt;/li&gt;&#xA;&lt;li&gt;Analysis of multiple companies across multiple data fields for a single time frame, usually the current day.&lt;/li&gt;&#xA;&lt;li&gt;Backtesting, rank analysis, data analysis, etc. of ideas and custom factors.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Approximate breadth of data:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;3000 companies&lt;/li&gt;&#xA;&lt;li&gt;3500 data fields (ex: total fixed assets, earnings, etc.)&lt;/li&gt;&#xA;&lt;li&gt;500 aggregation levels&lt;/li&gt;&#xA;&lt;li&gt;Periodicity: daily, monthly, quarterly, annual&lt;/li&gt;&#xA;&lt;li&gt;20 year look-back that would grow over time&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Questions:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;What database should we choose?&lt;/strong&gt; We are currently limited to free options and we prefer open source (on principle). Currently we use PostgreSQL.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;How should I structure this schema-wise?&lt;/strong&gt; I am thinking of breaking up the field types into categories (balance sheet, descriptive, income statement, custom calculations, etc.) so each company would have a table for balance sheet, descriptive, income statement, custom calculations, etc. with each row representing one day and appropriate fields for the category of table for columns/fields. That will be my fully normalized database. Using the fully normalized database, I will then build a data warehouse, temp tables, views, etc. that are not fully normalized to make queries fast for the various use cases described previously. One issue with this approach is the number of tables. If I have, say, 5 categories of company data and 3000 companies I will have 15,000 tables in my fully normalized database for just storing the company data. But still, from my perspective, it seems like the best way to do it.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;What is the best strategy for indexing and structuring the time series portion of this?&lt;/strong&gt; I've talked to a few people and I did some research on time series database indexing/structure, but help/references/tips/etc. in this area, even if they duplicate what I have found, would be helpful. I realize this depends on the answer to #1 above, so maybe assume I am staying with PostgreSQL and I will be building out the &quot;time series&quot; functionality specific bells and whistles myself.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Notes:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;In-depth technical answers and references/links much preferred.&lt;/li&gt;&#xA;&lt;li&gt;This is for a small buy side financial investment firm.&lt;/li&gt;&#xA;&lt;li&gt;If you have been down this road before, suggestions outside of the scope of my initial question are welcome.&lt;/li&gt;&#xA;&lt;li&gt;We cannot compromise on the amount of data, so reducing the amount of data isn't an option for us; however, the numbers I supplied are estimates only.&lt;/li&gt;&#xA;&lt;li&gt;If there is a better place to ask this question, please let me know.&lt;/li&gt;&#xA;&lt;li&gt;There is much more to what we want to do, but this represents the core of what we want to do from a data structure perspective.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="22557" LastActivityDate="2021-02-12T16:26:02.603" Title="Building Financial Data Time Series Database from scratch" Tags="&lt;time-series&gt;&lt;data&gt;&lt;finance&gt;&lt;historical-data&gt;&lt;database&gt;" AnswerCount="9" CommentCount="10" FavoriteCount="103" ContentLicense="CC BY-SA 3.0" />
  <row Id="29573" PostTypeId="2" ParentId="29572" CreationDate="2016-08-10T22:23:53.003" Score="15" Body="&lt;p&gt;The standard answer is going to be that for time series, you want a column store database. These are optimized for range queries (ie: give me everything between two timestamps) because crucially, they store data along one of the dimensions (which you must choose, usually time) contiguously on disk, and thus reads are extremely fast. The alternative, when fully normalizing on a relational database, is that time will be indexed, but not stored contiguously. Thus if you ask for, say 3000 data points, you're hitting the index 3000 times, and even if said index is held entirely in memory (unlikely if you have 3000 companies x3500 fields), this takes a lot of time. Anecdotally, even using MongoDB, which is very vast, I obtained a 100x speed up using Cassandra. Hbase will equally serve you well, while lesser known entrants such as RiakTS, InfluxDB et al, are more specialized towards time series, and often don't have tool support (for example, Flink or Spark). I have found Cassandra to suit my needs very well, but then, I don't have as many fields as you (though it will handle them with ease). However I do store vast amounts of timeseries data (intraday) and Cassandra also has very high ingest rates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;However&lt;/em&gt;. You mention normalization. Cassandra et al will not give you normalization. They will not give you anything like the sophisticated integrity tools which relational databases provide, nor the complex schema options. In particular, if you want column-store speed along more than one of the axes in your data hybercube, you will need to repeat the data transposed form. Otherwise it will revert to relational performance (ie: you can still index across dimensions, of course). If you find that most of your queries will be along the time axis, and that you don't have much need for complex schemas, I would heartily recommend Cassandra. It is heavily used in the financial industry for this reason. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An option which might be equivalent for you however, is Postgres with its column store capabilities. You can specify to Postgres that it should store data along one axis contiguously, thereby getting the benefit of the column stores. Note however that Postgres doesn't scale across multiple machines nearly as easily as Cassandra or Hbase. You'll have to scale it vertically, which is much much more expensive when you start pushing the envelop on ingest or query performance. With Cassandra, you just add cheap boxes. We all know that 10 cheap boxes are much cheaper than the single monster box that will keep up with their (parallelized) performance. Indeed at some performance levels, relational will just choke, whereas Cassandra will scale linearly to as many boxes as you like (Apple reportedly runs 75000 nodes). That's why Netflix uses Cassandra, as does Apple. You'll need some serious z-enterprise style big iron if you want to try to get close to the performance of even a medium sized Cassandra cluster, with a relational database. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, Postgres or Cassandra. It will probably come down to whether or not you are going to put the data up for public (ie large number of users) consumption, or if your data is truly big (&gt; 5 terabytes ish is what I call &quot;big&quot;). In that case Cassandra. Or if you need computer-science rigorous normalization and all the bells and whistles that Postgres will give you, and indeed it is an excellent choice (with column store) if you are not too worried about truly big data growth. &lt;/p&gt;&#xA;" OwnerUserId="954" LastEditorUserId="954" LastEditDate="2016-08-10T22:39:23.460" LastActivityDate="2016-08-10T22:39:23.460" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29574" PostTypeId="1" CreationDate="2016-08-11T04:35:12.700" Score="8" ViewCount="877" Body="&lt;p&gt;I found a video game market (steam community market) which allows for trading of in game items between users, most items are &amp;lt;0.25 USD each, and market capitalization appears to be maybe $5-$10 USD on some items. Something to be noted is the transaction fee is 15% which does limit the possibilities a bit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One example item: &lt;a href=&quot;http://steamcommunity.com/market/listings/753/274940-Get%20Over%20Here%21&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://steamcommunity.com/market/listings/753/274940-Get%20Over%20Here%21&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some discoveries that should be taken into account:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many items appear to have very consistent supply and demand, thus leaving them in a sort equilibrium thus the drift in price is very low.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One thing I did find while manually market making is occasionally a user will sell an item at a price lower than the bid, effectively making spreads go negative. In that case, the highest bidder then receives the item. This occurs on average about 1 out of 15 times a trade is cleared, but will go as long as 100 trades between opportunities on occasion. I created a program that provides constantly re-lists bid and offer quotes at the same price as soon as they are filled. By clearing very high volumes (over 1k items a day) I managed to turn $1 into $14 USD within 3 weeks. This isn't as good as it sound given the returns capped at about 5 bucks invested and I even got blocked from accessing the server after making 8k+ requests in an hour.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given some less popular items have capitalizations of less than 5 USD it is possible for a dealer to accumulate almost all copies of the item in existence, allowing for the fixing of prices, perhaps useful for reducing volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a one week holding period before the in game item is delivered to your inventory, this was implemented into the market before I attempted arbitrage based on negative spreads, and was why I stopped my high volume strategy. A one week delivery means a very large open interest is required in order provide liquidity 24/7.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another thing, I have discovered is certain items are pretty much identical, but the amount they have been used in the game affects the value of the item and creates a spread, this could be used for correlation based stat-arb perhaps?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Modeling the market:&#xA;For an item in equilibrium, the price will not drift much so the time series can be assumed as stationary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since It is easy to accumulate a massive open interest, at least compared to volume, one can assume for the sake of the model that there is unlimited buying and selling potential on behalf of the liquidity provider, and I will assume no one else is providing liquidity to the market and all other bids/offers are individuals seeking the utility of the item, rather than to make gains trading it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$b$ will represent the dealers bid&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$o$ will represent the dealers offer&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$B_t$ will represent a process for the given item's market bid rate defined as $&amp;gt;= b$ with an unknown distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$O_t$ will represent a process for the given item's market offer rate defined as $&amp;lt;= o$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_t$ can be defined as $O_t-B_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One Hypothesis I have, is that $B_t-b$ and $o-O_t$ are perhaps log normal distributed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A method I propose for verifying the distribution is to sample the percent of negative spread arbitrage opportunities and compare them to the expected amount of opportunities a given distribution expects for the Process $S_t$ which could be used for fitting a distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can any research done into this in-game market be applied to real market making for financial markets, or is there factors not accounted for?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Currently I have purchased 15 of this item to experiment with, and for some reason volatility is only slightly lower although prices have hit 1mo highs. I should note there was one occurrence of negative slippage. (-0.05 USD). I have been rigging the Bid rate at 0.10 USD so if you plan to research this Time series please note that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://steamcommunity.com/market/listings/753/274940-Get%20Over%20Here%21&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://steamcommunity.com/market/listings/753/274940-Get%20Over%20Here%21&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I would like to add that a noticeable effect has been made in the manipulation of prices, as average price is slowly increasing. I will plan on cornering the market in order to get a general idea of total copies of a specific item in circulation. This could be useful when rigging supply and demand for the purpose of studying it's effects on the market.&lt;/p&gt;&#xA;" OwnerUserId="18578" LastEditorUserId="848" LastEditDate="2017-01-20T21:14:06.320" LastActivityDate="2018-06-25T05:41:44.387" Title="Is this a viable method for testing market making strategies?" Tags="&lt;time-series&gt;&lt;high-frequency&gt;&lt;market-making&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29576" PostTypeId="1" CreationDate="2016-08-11T12:20:25.457" Score="4" ViewCount="1966" Body="&lt;p&gt;Using the quantmod package in R, one can download the S&amp;amp;P500 index using the following command:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;getSymbols(&quot;^GSPC&quot;, env = sp500, src = &quot;yahoo&quot;,from = as.Date(&quot;1960-01-04&quot;), to = as.Date(&quot;2009-01-01&quot;))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The S&amp;amp;P is further broken down in sectors (with their yahoo symbols in brackets): Health care (XLV), industrials (XLI), consumer staples (XLP), consumer discretionary (XLY), materials (XLB), utilities (XLU), financials (XLF or XLFS), energy (XLE), technology (XLK), and Real Estate (XLRE).   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;These sectors are further broken down in subsectors, but I do not know how to get these indexes.  For example, Healtcare is has Managed care, Pharmaceuticals, equipment, as subsectors.&lt;br&gt;&#xA;For example,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://finance.yahoo.com/quote/%5ESP500-3510?p=%5ESP500-3510&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://finance.yahoo.com/quote/%5ESP500-3510?p=%5ESP500-3510&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is a subsector of the Health care index, but using the symbol given there (^SP500-3510) does not seem to work in the above &lt;code&gt;getSymbol&lt;/code&gt; R command.  Any suggestion on how to get this index?&lt;/p&gt;&#xA;" OwnerUserId="23930" LastEditorUserId="26169" LastEditDate="2017-01-19T14:02:08.177" LastActivityDate="2020-11-26T16:33:03.463" Title="Getting data of sub-sector indexes of an S&amp;P 500 index sector using QuantMod in R" Tags="&lt;time-series&gt;&lt;programming&gt;&lt;spx&gt;&lt;equity-curve&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29577" PostTypeId="1" AcceptedAnswerId="29588" CreationDate="2016-08-11T12:32:24.383" Score="2" ViewCount="1040" Body="&lt;p&gt;I am attempting to calibrate my SV(heston) model to market data. My intention is to minimize the difference between market IVs and my model's IVs. &#xA;I use Bloomberg to get the data, however &lt;strong&gt;fx options&lt;/strong&gt; are quoted in different way than equities and I can't arrive to recover volatility surface in needed format from these data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can download the data in following format:&#xA; RR/BF or Put/Call    and Bid/Ask or Mid/Spread&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I want is to get set of strikes, maturities and IVs for them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for ideas&lt;img src=&quot;https://i.stack.imgur.com/l3a4g.jpg&quot; alt=&quot;![bloomberg screenshot for AUDUSD&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="22424" LastEditorUserId="22237" LastEditDate="2016-08-11T12:46:36.673" LastActivityDate="2016-08-11T21:46:48.403" Title="FX volatility quotation" Tags="&lt;options&gt;&lt;fx&gt;&lt;market-data&gt;&lt;historical-data&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29580" PostTypeId="1" CreationDate="2016-08-11T16:28:06.403" Score="0" ViewCount="341" Body="&lt;p&gt;Why does it make sense to use single-period Markowitz mean-variance optimization techniques when we're trying to figure out asset allocation across multiple asset classes (bonds, stocks, REITs, etc)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Minimizing the variance for a target expected return makes sense to me if you're considering a portfolio of equities. However, including bonds for example complicates things - they have systematic differences from equities such as fixed maturities, periodic coupon payments/reinvestment, depend on interest rate expectations etc. Bonds with a maturity shorter than the investment horizon wouldn't exist at the terminal time in the model. These considerations would naturally be amplified if you're including even more heterogenous asset classes into your portfolio and your optimization problem. The return dynamics would obviously be very different from equities and this seems to be glossed over by the model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I frequently see the standard MVO techniques used to determine asset allocations across equities, fixed income and other classes. Is this theoretically valid? Are there superior techniques for optimizing mixed portfolios?&lt;/p&gt;&#xA;" OwnerUserId="17712" LastActivityDate="2016-08-11T16:28:06.403" Title="Mean-Variance Optimization Techniques with Multiple Asset Classes" Tags="&lt;optimization&gt;&lt;portfolio&gt;&lt;markowitz&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29581" PostTypeId="2" ParentId="15488" CreationDate="2016-08-11T16:42:05.463" Score="1" Body="&lt;p&gt;As a practical viewpoint: having habits from float32-by-default time, I designed my db with Numeric type (aka Decimal, ie fixed-precision). In this case, it was important. In most case, I took a maximum 8 digits precision.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But now with float64 + Numpy (on which Pandas is based) not handling Decimal but float64, I'm converting my db schema to float64 (ie double on postgresql). Moving back-and-forth from float64 (for Numpy processing) and Decimal (for storage) is just too much pain...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Being also a market operator, I hardly see any value-added above 10 digits, markets bid/ask being what they are.&lt;/p&gt;&#xA;" OwnerUserId="23934" LastActivityDate="2016-08-11T16:42:05.463" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29582" PostTypeId="1" AcceptedAnswerId="29585" CreationDate="2016-08-11T17:15:58.513" Score="2" ViewCount="573" Body="&lt;p&gt;I just would like to know why $\Delta$  increases as $r$ increases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like an intuitive answer, without model (I can compute my greeks myself).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="15738" LastActivityDate="2016-08-12T18:41:51.443" Title="why Delta increases as interest rate increases" Tags="&lt;greeks&gt;&lt;delta&gt;" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="29583" PostTypeId="1" AcceptedAnswerId="29586" CreationDate="2016-08-11T17:24:31.610" Score="0" ViewCount="150" Body="&lt;p&gt;I have a trading strategy that closes one position on an asset and open a new position on a different asset every day at noon. No more than one position is open at a single time. Assets are crypto currencies with very high beta so that average daily return on the period I backtest is higher than 2 * trading fees.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My algo pick-up a crypto currency on a daily basis and I use PerformanceAnalytics R package to calculate the daily return from the close prices of every currency that is selected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm wondering how to include the trading fees of 0.25% (&lt;a href=&quot;https://poloniex.com/fees/&quot; rel=&quot;nofollow&quot;&gt;Poloniex&lt;/a&gt; cryptocurrencies trading platform).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I simply remove the fees from the daily returns ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if my daily return without fees are :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;           Daily Return wo fees&#xA;2015-01-01 0.5&#xA;2015-01-02 1.3&#xA;2015-01-03 5.4&#xA;2015-01-04 2.6&#xA;2015-01-05 3.9&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then daily return including fees to close (0.25%) then re-open (0.25%) a position would be :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;           Daily Return w fees&#xA;2015-01-01   0&#xA;2015-01-02 0.8&#xA;2015-01-03 4.9&#xA;2015-01-04 2.1&#xA;2015-01-05 3.4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thank you,&lt;/p&gt;&#xA;" OwnerUserId="15328" LastActivityDate="2016-08-11T18:09:20.720" Title="How to calculate daily return including fees?" Tags="&lt;returns&gt;&lt;expected-return&gt;&lt;fees&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29585" PostTypeId="2" ParentId="29582" CreationDate="2016-08-11T18:03:32.467" Score="7" Body="&lt;p&gt;&lt;strong&gt;[Mathematically]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Risk-neutral pricing means that&#xA;\begin{align}&#xA;C_0(K,T) &amp;amp;= \mathbb {E}_0\left[\frac{1}{B_T} (S_T - K)^+\right]  \\&#xA;&amp;amp;= \mathbb {E}_0\left[\left(\frac {S_T}{B_T} - \frac {K}{B_T}\right)^+\right] &#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now simply notice that the dynamics of $$\tilde{S}_t := \frac {S_t}{B_t},\ \forall t \geq 0$$ is &lt;strong&gt;independent of $r$&lt;/strong&gt; (see the very definition of the risk neutral measure associated to the numéraire $B_t$) while  the present value of the strike $K/B_T$ &lt;strong&gt;decreases as $r$ increases&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a &quot;model-free&quot; result in the sense that it does not depend on working modelling assumptions (i.e. no specific (jump)-diffusion model).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Intuitively]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Increasing $r$ will cause the forward price $F (0,T)$ to increase (model-free cash &amp;amp; carry replication argument), which in turn means that the &lt;em&gt;undiscounted&lt;/em&gt; call price, $\mathbb {E}[(S_T-K)^+] $, will increase because the forward price represents the expectation of the stock price $S_T $ under the risk-neutral measure (hence increasing forward means shifting the pdf towards the right).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In parallel however, the discount factor (measuring the present value of future cashflows) will decrease as $r$ increases. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Everything else equal, it is straightforward to see that the forward price and the discount factor will move in the exact same relative proportions... but in opposite directions thereby compensating each other's effect. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The game changer is the fact that the present value of the strike price as seen of today will decrease regardless, hence causing the call price to increase.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-08-12T06:48:53.217" LastActivityDate="2016-08-12T06:48:53.217" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="29586" PostTypeId="2" ParentId="29583" CreationDate="2016-08-11T18:09:20.720" Score="1" Body="&lt;p&gt;If you're just looking to net out the fees from your gross returns, a-b should be relatively accurate for your backtest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will caution you to make sure that you're reflecting the actual structure of the fees on the trading platform. Depending on where the fees are paid out of, your true returns (in your trading system) may be different from your backtests. If your fees are paid out of the transaction, net of fee returns are calculated one way while if they are paid out externally they should be calculated another. &lt;/p&gt;&#xA;" OwnerUserId="17175" LastActivityDate="2016-08-11T18:09:20.720" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29587" PostTypeId="2" ParentId="29576" CreationDate="2016-08-11T20:11:37.547" Score="1" Body="&lt;p&gt;There is something wrong with the web page for that index.  I tried viewing historical data and there was none.  The link to download historical data is also broken.  I suggest testing another index.&lt;/p&gt;&#xA;" OwnerUserId="19786" LastActivityDate="2016-08-11T20:11:37.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29588" PostTypeId="2" ParentId="29577" CreationDate="2016-08-11T21:46:48.403" Score="2" Body="&lt;p&gt;Due to the nature of OTC trading of FX Options for the majority of the market, they are traded in volatility prices and strikes in delta space. You can derive the specific decimal strikes based on the Black-Scholes delta using the at-the-money volatility for a particular smile tenor, given you know the values of the other parameters in the BS formula as well. However there is a listed FX Options market too, and CME is the largest of all, but it is only liquid for a limited number of pairs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The typical benchmark spreads are 25D RR/FLY, 10D RR/FLY, together with atm those are the points you want to calibrate to.&lt;/p&gt;&#xA;" OwnerUserId="11773" LastActivityDate="2016-08-11T21:46:48.403" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29589" PostTypeId="2" ParentId="28012" CreationDate="2016-08-11T21:52:34.793" Score="2" Body="&lt;p&gt;If there is a CDS on the bond, that might be a good indicator to use, esp. if you want to compare one against another.&lt;/p&gt;&#xA;" OwnerUserId="11773" LastActivityDate="2016-08-11T21:52:34.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29590" PostTypeId="1" AcceptedAnswerId="29591" CreationDate="2016-08-11T23:47:42.077" Score="0" ViewCount="93" Body="&lt;p&gt;I am new to julia, and I am trying to use &quot;map()&quot; to apply the function &quot;quandl&quot; on an array of (n x 1) stock tickers. (&lt;a href=&quot;http://quandljl.readthedocs.io/en/latest/get_data.html&quot; rel=&quot;nofollow&quot;&gt;http://quandljl.readthedocs.io/en/latest/get_data.html&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I wish to pass on more than just the tickers as arguments to the function, such as &quot;from = Date1&quot; and &quot;to = Date2&quot; to download daily prices for a specific time interval. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I cannot seem to find a way to have map() apply the function on the array of strings while also passing the keyword arguments to download data from Date1 to Date2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks &lt;/p&gt;&#xA;" OwnerUserId="23938" LastActivityDate="2016-08-12T01:24:40.907" Title="Julia: Passing arguments to quandl function through the map() function" Tags="&lt;programming&gt;&lt;market-data&gt;&lt;yahoofinance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29591" PostTypeId="2" ParentId="29590" CreationDate="2016-08-12T01:24:40.907" Score="0" Body="&lt;p&gt;Found an answer, all the credit goes to user StefanKarpinski. Follow the link below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stackoverflow.com/questions/38906788/julia-passing-arguments-to-function-through-the-map-function&quot;&gt;https://stackoverflow.com/questions/38906788/julia-passing-arguments-to-function-through-the-map-function&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="23938" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2016-08-12T01:24:40.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29592" PostTypeId="1" CreationDate="2016-08-12T07:27:01.247" Score="1" ViewCount="40" Body="&lt;p&gt;I am looking for a way to extrapolate monthly government bond returns (total return index) that are not available on datastream for the bucket of 10+ (maturities of 10 years and above). For the 4 previous buckets I have monthly data from 1978 onwards, but for the 10+ bucket I only have from 1986 onwards. Does anyone have any idea how I can fill in this missing return data? The easiest solution is just to cut out the missing portion of the sample completely but I think it would be a shame to do so.&lt;/p&gt;&#xA;" OwnerUserId="22512" LastActivityDate="2016-08-12T14:01:19.917" Title="any ideas how to get missing returns for german governement bonds, maturity bucket 10+" Tags="&lt;fixed-income&gt;&lt;returns&gt;&lt;historical-data&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29593" PostTypeId="1" AcceptedAnswerId="29616" CreationDate="2016-08-12T08:44:26.753" Score="2" ViewCount="2393" Body="&lt;p&gt;The option pricing model I am referring to is this one:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://arxiv.org/pdf/1204.0646.pdf&quot; rel=&quot;nofollow&quot;&gt;&lt;strong&gt;Arbitrage-free SVI volatility surfaces&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I calibrated that model by using a set of European options, now I have a set of 5 parameters per maturity that allow to draw volatility skews. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As these curves can be used to price options, I am looking for the best way to get Greeks from that: is it possible to use SVI's output to have Greeks that are more accurate and &quot;realistic&quot; than Black &amp;amp; Scholes' ones?&lt;/p&gt;&#xA;" OwnerUserId="3058" LastEditorUserId="3058" LastEditDate="2016-08-13T08:49:10.657" LastActivityDate="2016-08-14T14:20:59.200" Title="SVI model and Greeks calculation" Tags="&lt;option-pricing&gt;&lt;implied-volatility&gt;&lt;greeks&gt;&lt;calibration&gt;&lt;term-structure&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29594" PostTypeId="1" CreationDate="2016-08-12T09:23:16.870" Score="3" ViewCount="358" Body="&lt;p&gt;I am studying the calibration of the 2 factors Hull White model on Brigo and Mercurio's book. They point out that, using cap volatilities, the value of $\rho$ is almost minus one and this means that the HW 2 factors model tends to degenerate into a one-factor model. So far, so good.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, the authors claim that this one-factor model is non-Markov. Could you explain to me why? I know (more or less) what a Markov process is, but, still, I don't fully understand their statement. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;They also go further, stating the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;the degenerate process for the short rate is still non-Markovian (if $a \ne b$), which explains what really makes the G2++ model outperform its one-factor version&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are many things I don't get about this sentence. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, why are they using the word &quot;still&quot;? Does it mean that even the non-degenerate Hull White 2 factors is non-Markovian? How can I say quickly whether an interest rate model is Markovian or not?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, why on earth (at least in financial modelling) should a non-Markovian process outperfom a Markovian one? Their statement looks very strong...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since we are talking about Markov/non-Markov interest rates, I would also like to ask a question concerning the HJM framework. One of the main problems with this approach is that the dynamics of the short rate is often messy and non-Markovian. Again, by simply looking at the dynamics, how can we say that? The drift of the short rate involves some (deterministic and stochastic) integrals and I read somewhere that if the variable $t$ appears only as one of the extremes of the integral, then the short rate is Markovian; if, on the other hand, $t$ appears also inside the integral, the Markovianity is lost.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it true? If so, could you give me an intuitive and/or rigorous explanation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very, very much for any help you can provide!!! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. Here is the model :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_t=x_t+y_t+\phi_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d x_t=-a x_t\ dt+\sigma dW^1_t $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d y_t=-b y_t\ dt+\eta d W^2_t $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d W^1_t d W^2_t = \rho dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\phi_t$ is the deterministic shift chosen so as to fit any initial forward curve&lt;/p&gt;&#xA;" OwnerUserId="18180" LastEditorUserId="18180" LastEditDate="2016-08-13T17:52:38.200" LastActivityDate="2016-08-13T17:52:38.200" Title="Hull White 2 factors and non Markov interest rates" Tags="&lt;interest-rates&gt;&lt;calibration&gt;&lt;hullwhite&gt;&lt;markov&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29595" PostTypeId="2" ParentId="29473" CreationDate="2016-08-12T10:36:24.847" Score="5" Body="&lt;p&gt;If I got this right, you get a SABR model from fitting market implied volatilites (from market price via Black) to SABR volatilites (from SABR parameters via formula above). Then you step back and think the SABR distribution needs improvement because it is not arbitrage free. Instead you use the collocation method to replace it with its projection onto a series of normal distributions. This arbitrage-free distribution gives analytic option prices (paper 2, section 3.4) not perfectly fitting the given market prices (which the SABR did).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Questions: &quot;How do I find the [SABR probability] density?&quot;&#xA;Answer: That is given by Hagen (and your SABR-parameters). Look in Hagen's &quot;Probability Distribution in the SABR Model of Stochastic volatility&quot;!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q:&quot;Should I use the partial derivative of the call prices&quot; for integration of the above?&#xA;A: No.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q &quot;How should I integrate&quot; the above density?&#xA;A: Numerically if you don't find an analytic formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question: How is volatility at the strikes in the arbitrage-free distribution &quot;depending on&quot; its parameters?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Answer: From what is written out in sections 3.4 and 3.5 the estimated SABR parameters and the collocation points gives the arbitrage-free distribution which then gives analytic call prices. It is subsumed that these prices then via Black gives implied volatilities. So the volatilites are a function of SARB-parameters and should exactly match the implieds (from which we took the SARB) if it not where for adjusting the distribution to an arbitrage-free one. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question: &quot;I dont see a solution&quot;&#xA;A: The solution to minimizing 3.10 goes through finding a set of SABR-parameters close to your initial ones via a &quot;local-search algorithm, like the Nelder-Mead&quot;. That way you will end up with the arbitrage-free distribution (of those within this scope at least)  that most closely mathces the market prices. &lt;/p&gt;&#xA;" OwnerUserId="23886" LastActivityDate="2016-08-12T10:36:24.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29596" PostTypeId="2" ParentId="29582" CreationDate="2016-08-12T10:48:37.783" Score="4" Body="&lt;p&gt;Just to strengthen the intuition in the perfect answer above: With r going very high (and hence F), all prices on cash instruments are expected to gain fast with time (to compensate for the carry) and the call-strike is expected to be deep[er] in the money; hence with a delta close[r] to one.&lt;/p&gt;&#xA;" OwnerUserId="23886" LastEditorUserId="16148" LastEditDate="2016-08-12T18:41:51.443" LastActivityDate="2016-08-12T18:41:51.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29597" PostTypeId="1" CreationDate="2016-08-12T12:06:38.970" Score="6" ViewCount="271" Body="&lt;p&gt;Assume for simplicity that the expiration time of an option is $1$ the initial stock price is $1$ and there is no dividend yield and the risk free return is $0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How is it possible to show that the following holds for the implied volatility :&#xA;$$ \sigma_{\operatorname{imp}}^2 = \operatorname{O}(\log K)$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $K$ is the strike price of the option.&lt;/p&gt;&#xA;" OwnerUserId="23943" LastEditorDisplayName="user16651" LastEditDate="2016-08-12T12:45:14.413" LastActivityDate="2016-08-12T12:45:14.413" Title="implied volatility and strike price" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;volatility&gt;&lt;black-scholes&gt;&lt;implied-volatility&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29598" PostTypeId="2" ParentId="29592" CreationDate="2016-08-12T14:01:19.917" Score="1" Body="&lt;p&gt;This is my preferred way of generating bond returns proxies:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Decide on a tenor for the 10+ bucket. 20-years is a common choice, primarily because Ibbotson's US long-term bond returns reflect that maturity. &lt;/li&gt;&#xA;&lt;li&gt;Take the 10-year yield series&lt;/li&gt;&#xA;&lt;li&gt;Make some assumptions about 10y/20y spread. The simplest assumption is to assume 20-year yield = 10-year yield.&lt;/li&gt;&#xA;&lt;li&gt;At the end of each month, buy a par bond whose 1) coupon = 20-year yield, 2) maturity = 20 years, 3) price = 100&lt;/li&gt;&#xA;&lt;li&gt;At the end of the following month, reprice this par bond, now a 19-year 11-month bond, by assuming its yield to maturity = the new yield. This lets you calculate the monthly return.&lt;/li&gt;&#xA;&lt;li&gt;Buy a new par bond and repeat.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You can also just regress the 10+ return you have against the other buckets and use the coefficients to backcast...&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2016-08-12T14:01:19.917" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29599" PostTypeId="1" CreationDate="2016-08-12T15:09:57.970" Score="1" ViewCount="66" Body="&lt;p&gt;I have a correlation matrix that I produced in Excel using the monthly returns from 200 different trading systems over a X year period.  So, the correlation matrix is 200 rows by 200 columns.  How do I now go about determining the best combination of 10 systems that would give me the lowest correlated subset (i.e., lowest potential of aggregate sum of correlation values in a 10x10 correlation matrix)?  Also, can this be done in Excel?  Thanks.&lt;/p&gt;&#xA;" OwnerUserId="23945" LastActivityDate="2016-08-12T15:09:57.970" Title="Minimum Subset within Correlation Matrix" Tags="&lt;correlation-matrix&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29604" PostTypeId="2" ParentId="15009" CreationDate="2016-08-13T02:18:24.973" Score="0" Body="&lt;p&gt;Use Taylor Expansion to approx price changes for some variations in Yield. Guess the Duration to be less than Full maturity since its Paying coupons and go from there. First price it at Par.&lt;/p&gt;&#xA;" OwnerUserId="23951" LastActivityDate="2016-08-13T02:18:24.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29606" PostTypeId="1" CreationDate="2016-08-13T11:49:36.393" Score="7" ViewCount="7645" Body="&lt;p&gt;I would like to price Asian and Digital options under Merton's jump-diffusion model. To that end, I will have to simulate from a jump diffusion process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, the stock price process is given by&#xA;$$S(t) = S(0)e^{(r-q-\omega)t+X(t)},$$&#xA;where $\omega$ is the drift term that makes the discounted stock price process a martingale and where $X(t) = \sigma W(t)+\sum_{i=1}^{N(t)} Y_i$ is a jump-diffusion process. The process $N(t)$ is a Poisson process with intensity $\lambda$ and the jump sizes $Y_i$ are iid Normally distributed $Y_i \sim N(\mu, \delta^2)$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, the issue here is the simulation of $X(t)$. I would like to simulate $X(t)$ as follows: first, I construct a grid $[0,T]$ with grid step size $\Delta t = 1/252$ (number of trading days in one year). I now want to compute $X$ on this grid stepwise. Therefore:&#xA;$$X_{n\Delta t} = X_{(n-1) \Delta t}+\sigma \sqrt{\Delta t} \epsilon_n + p_n,$$&#xA;where $\epsilon_n$ are standard normal random variables (easy to simulate in Matlab) and where $p_n$ are Compound Poisson random variables independent of $\epsilon_n$. The question is, how to simulate from these $p_n$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was thinking to write a compound Poisson generator myself:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function [p] = CPoissonGenerator(mu,delta,lambda,dt,rows,columns)&#xA;   N = poissrnd((1/lambda)*dt,rows,columns);&#xA;   Y = normrnd(mu,delta,1,N);&#xA;   cP = cumsum([0,Y]);&#xA;   p = cP(end);&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I do not know how to generate a matrix of Poisson random variables without using a loop in the above code? This can be very time consuming. Furthermore, I'm not sure if the program is correct. Is there a better way to do this?&lt;/p&gt;&#xA;" OwnerUserId="20813" LastEditorUserId="467" LastEditDate="2016-08-13T15:20:39.097" LastActivityDate="2016-08-13T15:20:39.097" Title="How to simulate a jump-diffusion process?" Tags="&lt;monte-carlo&gt;&lt;exotics&gt;&lt;random-variables&gt;&lt;poisson&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29607" PostTypeId="1" CreationDate="2016-08-13T11:55:09.003" Score="2" ViewCount="41" Body="&lt;p&gt;I am trying to apply a BL-like model to a random variable which is strongly skewed and leptokurtic. The random variable is actually the change through time of GARCH conditional variance $\sigma_{t+1}^2 - \sigma_t^2$. I would actually like to express views on that change.&#xA;Is there a way to deal with skewed and leptokurtic variables in the Black Litterman model?&lt;/p&gt;&#xA;" OwnerUserId="22107" LastActivityDate="2016-08-13T11:55:09.003" Title="Black Litterman with strongly skewed/leptokurtic variables" Tags="&lt;black-litterman&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29609" PostTypeId="2" ParentId="15009" CreationDate="2016-08-13T12:52:18.280" Score="3" Body="&lt;p&gt;Back of envelope approach:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dP \simeq \frac{\partial P}{\partial y} \times \Delta y$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You know that when $y=3\%$, $P=100$. So you can write&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P-100 \simeq \frac{\partial P}{\partial y} \times (c-y)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and so &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Price $\simeq$ 100 + Duration x (3%-9%). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Guess a duration of around 7.0 for a 10 year bond (they would assume that you would have a feel for this number).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I get 100 - 7 x 6 = 100 - 42 = $58. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I do this carefully assuming annual compounding then I get $61.5 which is in the same ball park. You can refine this using a second order correction but this would be an acceptable first guess that you can do without calculators. &lt;/p&gt;&#xA;" OwnerUserId="12240" LastEditorUserId="12240" LastEditDate="2016-08-13T12:57:58.380" LastActivityDate="2016-08-13T12:57:58.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29610" PostTypeId="2" ParentId="29606" CreationDate="2016-08-13T13:50:50.133" Score="3" Body="&lt;p&gt;you don't need generate a matrix of Poisson random variables:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% S0 = spot price&#xA;% K  = strike price&#xA;% r = risk free rate&#xA;% q  = dividend yield&#xA;% sigma = volatility&#xA;% T = maturity&#xA;% lambda_J= jump frequency&#xA;% mu_J    = jump mean parameter&#xA;% sigma_J = jump volatility parameter&#xA;% N_T = number of time steps&#xA;% N_S = number of stock price paths&#xA;%----------------------------------------------------------------------------&#xA;dt = T/N_T;&#xA;kappa = exp(mu_J) - 1;&#xA;drift = r - q - lambda*kappa - 0.5*sigma^2;&#xA;S = zeros(N_T,N_S);&#xA;for s=1:N_S&#xA;    S(1,s) = S0;&#xA;    for t=2:N_T&#xA;        J = 0;&#xA;        if lambda_J ~= 0&#xA;            Nt = poissrnd(lambda_J*dt);&#xA;            if Nt &amp;gt; 0&#xA;                for i=1:Nt&#xA;                    J = J + normrnd(mu_J - sigma_J^2/2,sigma_J);&#xA;                end&#xA;            end&#xA;        end&#xA;        Z = normrnd(0,1);&#xA;        S(t,s) = S(t-1,s)*exp(drift*dt + sigma*sqrt(dt)*Z + J);&#xA;    end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;for more details please check &lt;a href=&quot;http://www.volopta.com/Matlab.html&quot;&gt;volopta&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastActivityDate="2016-08-13T13:50:50.133" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29612" PostTypeId="2" ParentId="27752" CreationDate="2016-08-13T15:52:53.230" Score="0" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/mementum/backtrader&quot; rel=&quot;nofollow&quot;&gt;https://github.com/mementum/backtrader&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Offers you a backtester in Python and if you want to go LIVE: integration with IB&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the repository page you will find a list of similar projects using Python. Some offer also live trading&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Disclaimer: I am the author&lt;/p&gt;&#xA;" OwnerUserId="17554" LastActivityDate="2016-08-13T15:52:53.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29614" PostTypeId="1" AcceptedAnswerId="29617" CreationDate="2016-08-13T17:58:06.987" Score="4" ViewCount="3326" Body="&lt;p&gt;I have the Black-Scholes equation for European option with maturity $T$ and strike $K$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{cases}\frac{\partial u}{\partial t} = ru - \frac{1}{2} \sigma^2 x^2 \frac{\partial^2 u}{\partial x^2}-r x \frac{\partial u}{ \partial x}\,\,, \quad x \in \mathbb{R} \quad, \quad t&amp;gt;0\\ u(T,x) = \max \{x-K,0\}  \quad\quad, \quad x \in \mathbb{R}. \end{cases} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I use the Feynman-Kac formula to solve this equation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to show that the solution $u$ is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$u(t,x)=xN(d_1) - Ke^{-r(T-t)}N(d_2).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d_1=\frac{\ln(\frac{x}{K})+(r+ \frac{\sigma^2}{2})(T-t)}{\sigma \sqrt{T-t}}$$&#xA;$$d_2=d_1-\sigma \sqrt{T-t},$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$N(x)$ is the distribution of the standard normal distribution function.&lt;/p&gt;&#xA;" OwnerUserId="23960" LastEditorDisplayName="user16651" LastEditDate="2016-08-13T18:10:25.987" LastActivityDate="2016-08-13T20:24:35.867" Title="How to use the Feymann-Kac formula to solve the Black-Scholes equation" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;black-scholes-pde&gt;&lt;normal-distribution&gt;&lt;european-options&gt;" AnswerCount="1" CommentCount="13" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29616" PostTypeId="2" ParentId="29593" CreationDate="2016-08-13T20:13:54.673" Score="3" Body="&lt;p&gt;The SVI is simply a function (empirically fit to the data) which given a maturity and a strike price K, computes a BS implied volatility $\sigma$. Once you have that implied volatility you can plug it into a Black Scholes routine which can compute the BS price and the Black Scholes greeks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that if an option is actually traded with that strike and maturity you could have directly observed the price, and computed the volatility and greeks directly from that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the SVI technique helps compute Greeks in 2 circumstances: (1) if there is no option traded for the strike and maturity you have in mind (you could call this a &quot;what if&quot; calculation of the greeks), (2) if you think the price of the option is somehow noisy or distorted, in which case the SVI based calculation &lt;em&gt;might&lt;/em&gt; be more accurate because it is fit to multiple options, not just the one you are interested in. However IMHO the market prices of options are pretty accurate.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-08-14T14:20:59.200" LastActivityDate="2016-08-14T14:20:59.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29617" PostTypeId="2" ParentId="29614" CreationDate="2016-08-13T20:18:57.323" Score="5" Body="&lt;p&gt;By application of Feynman-Kac theorem $U$ has the representation &#xA;$$U(t,X_t)=e^{-r(T-t)}\mathbb{E}_{t}\left[\,\max\{X_T-K,0\}\,\right]$$&#xA;where $X_t$ satisfy the SDE&#xA;$$dX_t=\mu X_tdt+\sigma X_t dW_{t}^{\mathbb{P}}\tag 1$$&#xA;Now, we define a new measure $\mathbb{Q}$ by&#xA;$$d\mathbb{Q}=L_T\,d\mathbb{P}\quad$$&#xA;on $\mathcal{F}_T$ where&#xA;$$dL_t=\left(\frac{\mu-r}{\sigma}\right)L_t dW^{\mathbb{P}}_t.$$&#xA;By  application of Girsanov theorem, we have&#xA;$$dW^{\mathbb{P}}_t=-\left(\frac{\mu-r}{\sigma}&#xA;\right)dt+dW^{\mathbb{Q}}_t\tag 2$$&#xA;$(1)$ and $(2)$&#xA;$$dX_t=r X_tdt+\sigma X_t dW_{t}^{\mathbb{Q}}.\tag 3$$&#xA;By application of Ito's lemma&#xA;$$\ln X_T=\ln X_t+\left( r-\frac{1}{2}\sigma ^{2} \right)(T-t)+\sigma (W_T-W_t)$$&#xA;Indeed we showed&#xA;$$\ln X_T\sim N\left(\ln X_t+\left( r-\frac{1}{2}\sigma ^{2} \right)(T-t)\,,\, \sigma^2(T-t)\right)\tag 4$$&#xA;therefore&#xA;$$Q(X_T&amp;lt;K)=Q(\ln X_T&amp;lt;\ln K)=N\left(\frac{\ln K-\ln X_t-\left( r-\frac{1}{2}\sigma ^{2} \right)(T-t)}{\sigma^2\sqrt{T-t}}\right)$$&#xA;we now $N(-x)=1-N(x)$, thus&#xA;$$Q({{X}_{T}}&amp;gt;K)=N\left(\frac{\ln \left(\frac{X_t}{K}\right)+\left( r-\frac{1}{2}\sigma ^{2} \right)(T-t)}{\sigma^2\sqrt{T-t}}\right)=N(d_2)\tag 5$$&#xA;Now we should change the measure $\mathbb{Q}$ to another measure $\mathbb{Q}^X$. Consider the Radon-Nikodym derivative&#xA;$$\frac{d\mathbb{Q}^X}{d\mathbb{Q}}=\frac{B_T/B_t}{X_T/X_t}$$&#xA;where&#xA;$$B_t=\exp\left(\int_{0}^{t}r\,du\right)=e^{rt}$$&#xA;as a result&#xA;$${{\mathbb{Q}}^{X}}({{X}_{T}}&amp;gt;K)=\int\limits_{K}^{+\infty }{d{{\mathbb{Q}}^{X}}}=\frac{{{e}^{-r(T-t)}}}{{{X}_{t}}}\int\limits_{K}^{+\infty }{{{X}_{T}}\,d\mathbb{Q}}=\frac{{{e}^{-r(T-t)}}}{{{X}_{t}}}\int\limits_{K}^{+\infty }{{{X}_{T}}{{f}_{{{X}_{T}}}}(x)dx} $$&#xA;we have&#xA;$$\mathbb{Q}^X(X_T&amp;gt;K)=\frac{e^{-r(T-t)}}{X_t}E^\mathbb{Q}[X_T|X_T&amp;gt;K]=N\left(\frac{\ln \left(\frac{X_t}{K}\right)+\left( r+\frac{1}{2}\sigma ^{2} \right)(T-t)}{\sigma^2\sqrt{T-t}}\right)$$&#xA;Indeed&#xA;$$\mathbb{Q}^X(X_T&amp;gt;K)=N(d_1)\tag 6$$&#xA;on the other hand&#xA;$$U(t,x)=e^{-r(T-t)}\mathbb{E}_{t}^{\mathbb{Q}}\left[\,\max\{X_T-K\},0\,\right]\tag 7$$&#xA;it is obvious&#xA;$$\max\{X_T-K,0\}=(X_T-K)\mathbb{1}_{\{X_T&amp;gt;K\}}$$&#xA;then&#xA;$$U(t,X_t)=e^{-r(T-t)}\mathbb{E}_{t}^{\mathbb{Q}}\left[X_T\mathbb{1}_{\{X_T&amp;gt;K\}}\right]-e^{-r(T-t)}\mathbb{E}_{t}^{\mathbb{Q}}\left[K\mathbb{1}_{\{X_T&amp;gt;K\}}\right]$$&#xA;as a result&#xA;$$U(t,X_t)=X_t\,\mathbb{E}_{t}^{\mathbb{Q}}\left[\frac{X_T/X_t}{B_T/B_t}\mathbb{1}_{\{X_T&amp;gt;K\}}\right]-Ke^{-r(T-t)}\mathbb{E}_{t}^{\mathbb{Q}}\left[\mathbb{1}_{\{X_T&amp;gt;K\}}\right]$$&#xA;in other words&#xA;$$U(t,X_t)=X_t\mathbb{E}_{t}^{\mathbb{Q}^X}\left[\mathbb{1}_{\{X_T&amp;gt;K\}}\right]-Ke^{-r(T-t)}\mathbb{E}_{t}^{\mathbb{Q}}\left[\mathbb{1}_{\{X_T&amp;gt;K\}}\right]$$&#xA;so&#xA;$$U(t,X_t)=X_t\mathbb{Q}^X(X_T&amp;gt;K)-Ke^{-r(T-t)}\mathbb{Q}(X_T&amp;gt;K)\tag 8$$&#xA;$(5)$ ,$(6)$ and $(8)$&#xA;$$U(t,X_t)=X_tN(d_1)-Ke^{-r(T-t)}N(d_2)$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-08-13T20:24:35.867" LastActivityDate="2016-08-13T20:24:35.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29618" PostTypeId="1" CreationDate="2016-08-13T21:34:04.787" Score="0" ViewCount="87" Body="&lt;p&gt;In this &lt;a href=&quot;http://www.ecb.europa.eu/press/key/date/2014/html/sp140822.en.html&quot; rel=&quot;nofollow&quot;&gt;speech by Mario Draghi&lt;/a&gt;, in section '2:Responding to high unemployment', and subsection 'Boosting aggregate demand', Mario states «Over the month of August financial markets have indicated that inflation expectations exhibited significant declines at all horizons. The 5year/5year swap rate declined by 15 basis points to just below 2% - this is the metric that we usually use for defining medium term inflation. »&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does the ECB get the markets inflation forecast with the 5y/5y swap rate?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also in the same subsection of the text, there's 'Figure 7: Expected real interest rate path in the euro area and the US'. In this figure, the forecast is obtained from OIS-Inflation swap, according to the subtitle on the vertical axis. How do they obtain this? What's the rationale for it? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="9499" LastActivityDate="2016-08-14T16:27:17.627" Title="Measuring Medium-term Inflation expectations and real interest rate from OIS and Inflation Swaps" Tags="&lt;derivatives&gt;&lt;interest-rate-swap&gt;&lt;inflation&gt;&lt;ois&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29619" PostTypeId="1" AcceptedAnswerId="29620" CreationDate="2016-08-14T00:58:23.733" Score="1" ViewCount="206" Body="&lt;p&gt;Do ETFs impede the free float statistics? &lt;br&gt;&#xA;&lt;br&gt;&#xA;A considerable share of ETFs does the physical replication, so that large number of shares seem to be frozen/parked in those funds. &lt;br&gt;&#xA;&lt;br&gt;&#xA;Is this the case? Do they have significant negative impact on traded volumes of underlying shares?&lt;/p&gt;&#xA;" OwnerUserId="18670" LastActivityDate="2016-08-14T06:24:44.267" Title="ETFs - Do they impede the free float statistics?" Tags="&lt;index&gt;&lt;etf&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29620" PostTypeId="2" ParentId="29619" CreationDate="2016-08-14T06:24:44.267" Score="3" Body="&lt;p&gt;It is a complex question. The first answer should be investors who bought these ETFs would otherwise have invested on equities (say we talk on Equity ETFs) a buy and hold way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Seen like this ETFs concentrate assets under management (AuM) on stocks being parts of indices or &quot;factors&quot;. On the paper these stocks should be chosen to be liquid enough to support such investments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It means:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the more ETFs, the more &lt;strong&gt;concentrate AuM&lt;/strong&gt; on liquid stocks&lt;/li&gt;&#xA;&lt;li&gt;it should impact &lt;strong&gt;correlations&lt;/strong&gt; (i.e. increase them on ETF components: more synchronized in and out, hence synchronized price moves via &lt;strong&gt;market impact&lt;/strong&gt;).&lt;/li&gt;&#xA;&lt;li&gt;anyway: all shares are &lt;em&gt;bought by someone&lt;/em&gt; at any time.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Such invested money should be counted into the &lt;em&gt;free float&lt;/em&gt; since it is not different from passive investment strategies (&lt;em&gt;buy and hold&lt;/em&gt; indices components). What has to be removed from free float (according to me) is what is bought for governance reasons and not for performance reason. You will always find special cases but I guess it is a simple way to understand free float.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In any case it would be very difficult to understand what would be the effect of removing shares from free float if they are bought by &lt;em&gt;slow investors&lt;/em&gt;. It would be an interesting modeling question:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The more shares owned by slow investors (or on index based products)&lt;/li&gt;&#xA;&lt;li&gt;The less free float&lt;/li&gt;&#xA;&lt;li&gt;The less weight for them in indices&lt;/li&gt;&#xA;&lt;li&gt;$\Rightarrow$ Indexed investors have to sell&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; is there an equilibrium ?&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2016-08-14T06:24:44.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29621" PostTypeId="2" ParentId="1207" CreationDate="2016-08-14T08:00:45.010" Score="2" Body="&lt;p&gt;You can get five years of balance sheet and income statement data for free from &lt;a href=&quot;http://usfundamentals.com/&quot; rel=&quot;nofollow&quot;&gt;usfundamentals.com API&lt;/a&gt; in a convenient format. No need to parse html.&lt;/p&gt;&#xA;" OwnerUserId="22322" LastActivityDate="2016-08-14T08:00:45.010" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29622" PostTypeId="1" AcceptedAnswerId="33930" CreationDate="2016-08-14T12:38:45.753" Score="5" ViewCount="663" Body="&lt;p&gt;Recently, I have encountered something called &quot;&lt;strong&gt;&lt;em&gt;uncertain volatility&lt;/em&gt;&lt;/strong&gt;&quot;. Is it a popular concept in QF? Do practitioners use it nowadays? What are its pros and cons compared to e.g more familiar stochastic volatility models?&lt;/p&gt;&#xA;" OwnerUserId="22424" LastActivityDate="2019-11-06T08:57:15.270" Title="Uncertain volatility" Tags="&lt;volatility&gt;&lt;uncertain-volatility&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29623" PostTypeId="2" ParentId="7276" CreationDate="2016-08-14T12:55:58.307" Score="12" Body="&lt;p&gt;Let me start with a disclaimer that I have no interest in promoting GARCH models. However, I am aware of their history, their capabilities and some practical aspects of using them. That helps me come up with a few points to answer your question (Why is GARCH(1,1) so popular?):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;GARCH is inspired by ARMA, a classic time series model, and most likely &lt;em&gt;the&lt;/em&gt; most popular one. ARMA being so heavily researched, well understood (both from theoretical and computational points of view) and broadly used paved a solid way for the advent of GARCH. &lt;/li&gt;&#xA;&lt;li&gt;GARCH(1,1) is very simple, yet it delivers good fit and accurate predictions; while this may not be immediately obvious by looking at $R^2$ values, it is actually the case; see Andersen &amp;amp; Bollerslev &lt;a href=&quot;http://public.econ.duke.edu/~boller/Published_Papers/ier_98.pdf&quot; rel=&quot;noreferrer&quot;&gt;&quot;Answering the skeptics: Yes, standard volatility models do provide accurate forecasts&quot;&lt;/a&gt; (1998). &lt;/li&gt;&#xA;&lt;li&gt;GARCH is able to reproduce some of the stylized facts of asset returns, especially volatility clustering and heavy tails.&lt;/li&gt;&#xA;&lt;li&gt;GARCH(1,1) is hard to beat; see Hansen &amp;amp; Lunde &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1002/jae.800/full&quot; rel=&quot;noreferrer&quot;&gt;&quot;A forecast comparison of volatility models: does anything beat a GARCH (1, 1)?&quot;&lt;/a&gt; (2005). Or isn't it? See Alexios Ghalanos blog post &lt;a href=&quot;http://unstarched.net/2013/01/07/does-anything-not-beat-the-garch11/&quot; rel=&quot;noreferrer&quot;&gt;&quot;Does anything NOT beat the GARCH(1,1)?&quot;&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;To respond to some of Matt Wolf's points: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;em&gt;Garch models stochastic volatility&lt;/em&gt;&lt;br&gt;&#xA;Not 100% correct. GARCH specifies a &lt;em&gt;deterministic equation&lt;/em&gt; for volatility; volatility at time $t$ is completely determined by information as of $t-1$. Compare to &lt;em&gt;stochastic volatility&lt;/em&gt; models; some of them just add a stochastic term to the deterministic GARCH equation to make it stochastic. &lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;making the assumption of the randomness originating from a normal distribution&lt;/em&gt;&lt;br&gt;&#xA;There is no mandatory normality assumption, the choice of the distribution to be assumed is free. Check e.g. the variety of distributions available in &quot;rugarch&quot; package in R. &lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;Though most multivariate models can get quickly complex, multivariate GARCH can be tricky in regards to specifying the covariances (VECH or BEKK come to mind)&lt;/em&gt;&lt;br&gt;&#xA;While that is correct, the issue has been addressed and there are a number of multivariate GARCH models (such as DCC, to give just one example) that accomodate high-dimensional time series easily. See e.g. Bauwens et al. &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1002/jae.842/full&quot; rel=&quot;noreferrer&quot;&gt;&quot;Multivariate GARCH models: a survey&quot;&lt;/a&gt; (2006) or Silvennoinen &amp;amp; Terasvirta &lt;a href=&quot;http://link.springer.com/chapter/10.1007/978-3-540-71297-8_9&quot; rel=&quot;noreferrer&quot;&gt;&quot;Multivariate GARCH models&quot;&lt;/a&gt; (2009). For vast-dimensional case, see Engle et al. &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1354497&quot; rel=&quot;noreferrer&quot;&gt;&quot;Fitting vast dimensional time-varying covariance models&quot;&lt;/a&gt; (2008).&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;[Other models, but not GARCH(1,1)] heavily incorporate regime shifts&lt;/em&gt;&lt;br&gt;&#xA;This is possible with GARCH class of models in general, but specifically vanilla GARCH(1,1) fails here indeed.&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;[Other models, but not GARCH(1,1)] incorporate correlation structures with other asset classes and even non-price return related inputs&lt;/em&gt;&lt;br&gt;&#xA;Again, this is possible with GARCH class of models, but specifically vanilla GARCH(1,1) fails here indeed.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Now, let me reiterate that I am not trying to promote GARCH models; I am just trying to show why they are so popular.&lt;/p&gt;&#xA;" OwnerUserId="19645" LastEditorUserId="19645" LastEditDate="2016-08-14T13:10:05.913" LastActivityDate="2016-08-14T13:10:05.913" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29624" PostTypeId="2" ParentId="17315" CreationDate="2016-08-14T13:01:26.283" Score="22" Body="&lt;p&gt;A friend of mine has created a free source for fundamental financial company data of US listed stocks. All of the data is easily available from &lt;a href=&quot;https://simfin.com/&quot; rel=&quot;noreferrer&quot;&gt;https://simfin.com/&lt;/a&gt;. Feel free to check it out and send him some feedback, so he can improve the service.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update 30.07.17: So he has just updated the site and now standardized company statements for over 2000 US equities and financial ratios are available. If you are looking for a bulk data download feel free to reach out to him.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update 27.05.20: a new version of the bulk download is now available here: &lt;a href=&quot;https://simfin.com/data/bulk&quot; rel=&quot;noreferrer&quot;&gt;https://simfin.com/data/bulk&lt;/a&gt;&#xA;or via the SimFin python API on github: &lt;a href=&quot;https://github.com/SimFin/simfin&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/SimFin/simfin&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="22841" LastEditorUserId="22841" LastEditDate="2020-05-27T09:58:36.353" LastActivityDate="2020-05-27T09:58:36.353" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="29625" PostTypeId="1" CreationDate="2016-08-14T15:51:43.543" Score="0" ViewCount="37" Body="&lt;p&gt;Let’s say that we are defining a U.S. recession trend as 3 consecutive quarters of GDP decline. The GDP figures below would satisfy this definition.  However, these figures are statistics taken from a population with zero sampling error. Q3, as it turns out, is NOT statistically significantly different from Q1.  Does that mean the definition of recession is not satisfied?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q1 – 0.8%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q2 – 0.7%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q3 – 0.6%&lt;/p&gt;&#xA;" OwnerUserId="19565" LastActivityDate="2016-08-15T17:46:49.223" Title="GDP and Statistical Significance" Tags="&lt;statistics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29626" PostTypeId="1" AcceptedAnswerId="34339" CreationDate="2016-08-14T16:09:49.910" Score="2" ViewCount="279" Body="&lt;p&gt;At least two textbooks (Shreve's Stochastic Calculus for Finance - I, theorem 4.4.5 or Campolieti &amp;amp; Makarov's Financial Mathematics, proposition 7.8) prove the optimal exercise theorem that says that the stopping time $ \tau^* = min \{n; V_n = G_n\}$ maximizes $$&#xA;V_n = \max_{\tau \in S_n} \tilde{\mathrm{E}}\Big[\mathrm{I}_{\tau \leq N}\frac{1}{(1+r)^{\tau-n}}G_{\tau}\Big] \qquad (1)&#xA;$$&#xA;by demonstrating that stopped process $ \frac{1}{(1+r)^{n \wedge \tau^*}}V_{n \wedge \tau^*}$ is a martingale under the risk-neutral probability measure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But how can someone conclude from this fact that $\tau^*$ is actually maximizing the right-side of $(1)$?&lt;/p&gt;&#xA;" OwnerUserId="15154" LastEditorUserId="15154" LastEditDate="2017-05-22T08:29:38.080" LastActivityDate="2017-07-12T22:22:17.047" Title="Proof of optimal exercise time theorem for American derivative security in N-period binomial asset-pricing model" Tags="&lt;asset-pricing&gt;&lt;binomial&gt;&lt;stopping-time&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29627" PostTypeId="2" ParentId="29508" CreationDate="2016-08-14T16:17:02.180" Score="1" Body="&lt;p&gt;When you talking about linear hedge you are talking about flattening the Delta on the Option. However, all greeks are local, as the underlying travels a long way away, your greeks will change too. Therefore, in a scenario where the underlying suddenly gaps up or down by a long way, your local linear hedge will have too little or too much effect. All optionalities of an Option are local phenomenons. A real world example would the EURCHF event in early 2015.&lt;/p&gt;&#xA;" OwnerUserId="11773" LastActivityDate="2016-08-14T16:17:02.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29628" PostTypeId="1" AcceptedAnswerId="29635" CreationDate="2016-08-14T16:25:21.943" Score="4" ViewCount="5777" Body="&lt;p&gt;I know that FX Swaps have FX Risk, but why do FX Swaps have Interest Rate Risk as well?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Need some guidance on this.&lt;/p&gt;&#xA;" OwnerUserId="5839" LastActivityDate="2016-08-15T10:07:11.583" Title="Why do FX Swaps have Interest Rate Risk?" Tags="&lt;fx&gt;&lt;swaps&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29629" PostTypeId="2" ParentId="29618" CreationDate="2016-08-14T16:27:17.627" Score="1" Body="&lt;p&gt;The section two remark likely refers to &lt;em&gt;inflation&lt;/em&gt; swaps. In figure 7: OIS is a nominal rate index, subtracting from this the inflation rate on the inflation swaps gives a constructed real rate as written in the header. Real rate = (approx) nominal rate - imflation rate.&lt;/p&gt;&#xA;" OwnerUserId="23886" LastActivityDate="2016-08-14T16:27:17.627" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29630" PostTypeId="2" ParentId="29628" CreationDate="2016-08-14T16:35:56.063" Score="4" Body="&lt;p&gt;Looking at the swap as a series of forwards, considering then that the arbitrage-free FX forward depends (via the so called interest rate parity) both on the FX spot and the interest rates for the terms and currencies involved; gives that both spot FX and IR spread impacts the FX swap.&lt;/p&gt;&#xA;" OwnerUserId="23886" LastActivityDate="2016-08-14T16:35:56.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29631" PostTypeId="1" AcceptedAnswerId="29633" CreationDate="2016-08-14T16:40:27.623" Score="2" ViewCount="585" Body="&lt;p&gt;Not sure, if this has already been asked or if I'm just overlooking a simple switch (such as for dividends or splits or something), so I'd like to ask for help:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm very aware of the fact that there can be occasional errors in historical data downloaded from Yahoo (or any other of the free data providers, for that matter). But I just noticed that the downloaded CSV file contains different data than that very same data, when displayed on screen. As an illustration, please check:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://finance.yahoo.com/quote/AIR.DE/history?period1=1194994800&amp;amp;period2=1200265200&amp;amp;interval=1d&amp;amp;filter=history&amp;amp;frequency=1d&quot; rel=&quot;nofollow&quot;&gt;http://finance.yahoo.com/quote/AIR.DE/history?period1=1194994800&amp;amp;period2=1200265200&amp;amp;interval=1d&amp;amp;filter=history&amp;amp;frequency=1d&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which displays historical data for the Airbus group (from Nov 14, 2007 to Jan 14, 2008). And then please download the CSV file that supposedly should contain that very same data (the link on top of the page gives this link):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://chart.finance.yahoo.com/table.csv?s=AIR.DE&amp;amp;a=10&amp;amp;b=14&amp;amp;c=2007&amp;amp;d=0&amp;amp;e=14&amp;amp;f=2008&amp;amp;g=d&amp;amp;ignore=.csv&quot; rel=&quot;nofollow&quot;&gt;http://chart.finance.yahoo.com/table.csv?s=AIR.DE&amp;amp;a=10&amp;amp;b=14&amp;amp;c=2007&amp;amp;d=0&amp;amp;e=14&amp;amp;f=2008&amp;amp;g=d&amp;amp;ignore=.csv&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that from Nov 28, 2007, onwards the data in the downloaded CSV seems to be completely wrong. Has anyone else experienced this? Am I doing anything wrong?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be much appreciated.&lt;/p&gt;&#xA;" OwnerUserId="23920" LastEditorUserId="23920" LastEditDate="2016-08-14T17:38:07.390" LastActivityDate="2016-08-14T17:51:50.953" Title="Downloaded CSV from Yahoo different than the same data when displayed on page?" Tags="&lt;historical-data&gt;&lt;yahoo&gt;&lt;csv&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29632" PostTypeId="1" CreationDate="2016-08-14T17:14:18.993" Score="1" ViewCount="461" Body="&lt;p&gt;I want to price exotic options under the exponential VG model and Merton's model to compare both models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To price exotics under Merton's model, I have written the code below. The output is the price of a Call option, Asian, Digital and Up and in Barrier Call option. However, the use of loops leads to a very slow computation. Is there a clever way to not use loops here? In case of the VG model, I can do it but in this case, I do not see it. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function [Call,Asian,Digital,UIBP] = ExoticPricingMerton(S0,K,mu,delta,lambda,sigma,r,q,Maturity,H)&#xA;&#xA;ht = 1/252; %trading days&#xA;P = 10^3; %Number of simulations&#xA;grid = (0:ht:Maturity); &#xA;N = length(grid);&#xA;&#xA;omega = r-q-((1/2)*sigma^2+lambda*(exp(mu+(1/2)*delta^2)-1)); &#xA;&#xA;S = zeros(P,N);&#xA;S(:,1) = S0; &#xA;&#xA;for i=1:P&#xA;    for j=2:length(grid)&#xA;        N = poissrnd(lambda*ht);&#xA;        J = cumsum([0, normrnd(mu,delta,1,N)]); &#xA;        Z = normrnd(0,1);&#xA;        S(i,j) = S(i,j-1)*exp(omega*ht + sigma*sqrt(ht)*Z + J(end));&#xA;    end &#xA;end &#xA;&#xA;&#xA;%European Call option&#xA;A = max(S(:,end)-K,0); &#xA;Call = exp(-r*Maturity)*(1/P)*sum(A); &#xA;&#xA;%Asian option&#xA;A = max(mean(S,2) - K,0);&#xA;Asian = exp(-r*Maturity)*(1/P)*sum(A);&#xA;&#xA;%Digital price&#xA;A = max(S(:,end) - K, 0)./(S(:,end)-K);&#xA;Digital = exp(-r*Maturity)*(1/P)*sum(A);&#xA;&#xA;%Up-and-in out Barrier&#xA;A1 = (max(S,[],2)-H)./abs(max(S,[],2)-H);&#xA;A2 = max(A1,0);&#xA;A = (max(S(:,end)-K,0)).*A2;&#xA;UIBP = exp(-r*Maturity)*(1/P)*sum(A); &#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="20813" LastActivityDate="2016-12-30T12:41:16.573" Title="Pricing Exotics: Monte-Carlo is too slow?" Tags="&lt;monte-carlo&gt;&lt;exotics&gt;&lt;merton-model&gt;" AnswerCount="2" CommentCount="9" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29633" PostTypeId="2" ParentId="29631" CreationDate="2016-08-14T17:51:50.953" Score="2" Body="&lt;p&gt;That's quite odd, I have no explanation, so I'd suggest look at different source of the data. Bloomberg if you got access to it, or Finance Google. FG &lt;a href=&quot;https://www.google.com/finance/historical?cid=9661367&amp;amp;startdate=Nov%2014%2C%202007&amp;amp;enddate=Jan%2014%2C%202008&amp;amp;num=30&amp;amp;ei=2q6wV7DkA8TAU5OrgtgN&amp;amp;start=0&quot; rel=&quot;nofollow&quot;&gt;shows same data&lt;/a&gt; and the &lt;a href=&quot;http://www.google.com/finance/historical?cid=9661367&amp;amp;startdate=Nov%2014%2C%202007&amp;amp;enddate=Jan%2014%2C%202008&amp;amp;num=30&amp;amp;ei=2q6wV7DkA8TAU5OrgtgN&amp;amp;start=0&amp;amp;output=csv&quot; rel=&quot;nofollow&quot;&gt;CSV&lt;/a&gt; looks alright - same data as the online table. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe contact yahoo finance that there's a glitch, I never came across something like that. &lt;/p&gt;&#xA;" OwnerUserId="22237" LastActivityDate="2016-08-14T17:51:50.953" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29634" PostTypeId="2" ParentId="29628" CreationDate="2016-08-14T21:24:04.583" Score="0" Body="&lt;p&gt;You can structure an FX swap in terms of money market deposits and loans and vice versa. Say you've got AUDSEK 1 year. The AUDSEK FX swap cash flows have to equal the cash flows you'd get on AUD deposits or loans versus SEK deposits or loans, depending on which way round you buy or sell the swap. Otherwise there's interest arbitrage between the FX markets and the money markets. The interest on deposits or loans in different currencies is all about the rate you will give for a deposit or take for a loan in the given currency for the 1 year, priced according to the competition between providers in the money markets. Go figure. Also check out &lt;a href=&quot;http://www.webstersystems.co.uk/fxmm.htm#interest%20arbitrage&quot; rel=&quot;nofollow&quot;&gt;http://www.webstersystems.co.uk/fxmm.htm#interest%20arbitrage&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7369" LastEditorUserId="7369" LastEditDate="2016-08-15T10:07:11.583" LastActivityDate="2016-08-15T10:07:11.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29635" PostTypeId="2" ParentId="29628" CreationDate="2016-08-14T23:28:04.660" Score="7" Body="&lt;p&gt;An FX Swap can be described as &quot;borrowing in one currency and lending in another&quot;. When put this way it is clear that it has something to do with interest rates in the two currencies. You will be very happy if the i.r. in the currency borrowed rises and the i.r. in the currency lent falls the day after you do the deal, because you will have locked in more favorable rates for the term of the swap. So in that sense it is a bet on rates (more specifically on the difference in rates).&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-08-14T23:47:04.357" LastActivityDate="2016-08-14T23:47:04.357" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29636" PostTypeId="2" ParentId="27760" CreationDate="2016-08-15T06:50:59.740" Score="1" Body="&lt;p&gt;I remember to have encountered similar problems with timezones and decided to approach the timezones in a different way with IB with my python platform (&lt;code&gt;backtrader&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of trying to force the hand of the platform I take whatever timezone information the platform gives me and work from there to my desired timezone.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The process:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;IB gives you the &lt;code&gt;EST&lt;/code&gt; timezone for your asset&lt;/li&gt;&#xA;&lt;li&gt;Luckily this is a name recognized by &lt;code&gt;pytz&lt;/code&gt; (which you should obviously install)&lt;/li&gt;&#xA;&lt;li&gt;Once you have translated the IB timestamp to a &lt;code&gt;datetime&lt;/code&gt;(naive) object named &lt;code&gt;dt&lt;/code&gt; and have the timezone name in &lt;code&gt;ibtzname&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The code would roughly look like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ibtz = pytz.timezone(ibtzname)&#xA;eastern_dt = ibtz.localize(dt)&#xA;sing_tz = pytz.timezone('Asia/Singapore')&#xA;sing_dt = eastern_dt.astimezone(sing_tz)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Obviously you can cache the &lt;code&gt;sing_tz&lt;/code&gt; and &lt;code&gt;ibtz&lt;/code&gt; if they are always fixed values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may also wisth to work internally in &lt;code&gt;UTC&lt;/code&gt; and only convert back to &lt;code&gt;Asia/Singapore&lt;/code&gt; at the last moment. But your own needs should prevail.&lt;/p&gt;&#xA;" OwnerUserId="17554" LastActivityDate="2016-08-15T06:50:59.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29637" PostTypeId="1" CreationDate="2016-08-15T07:41:33.027" Score="1" ViewCount="78" Body="&lt;p&gt;Under the risk neutral measure $\mathbb{Q}$. The FMLS model assumes that the log value of the underlying i.e., $\bar{x}_t=\ln S_t$. with dividend yield $D$ follows a stochastic differential equation of the maximally skewed LS process:&#xA;$$d\bar{x}_t=(r-D-v)dt+\sigma dL^{\alpha -1}_t$$&#xA;where $r$ and $D$ are the risk free intrest and the dividend yield, respectivly. $t$ is the current time. and $v=\sigma ^{\alpha}sec \frac{\alpha \pi}{2}$ is a convexity adjustment. $dL^{\alpha -1}_t$ denotes the maximally skewed log-stable process, which is a special case of the Levy-$\alpha$-stable process $dL^{\alpha ,\beta}_t$ , where $\alpha \in \left( 0,2 \right]$ is the tail index describing the deviation of the LS process from the Brownian motion, and $\beta \in \left[ -1,1 \right]$ is the skew parameter. Remark that in the maximally skewed LS process, the skew parameter $\beta$ βis set to −1, in order to achieve finite moments for index levels and negative skewness in the return density. To ensure that the underlying return has the support on the whole real line, the tail index $\alpha$ needs to be restricted to $(1, 2]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;let $\bar{V}\left( \bar{x},t;\alpha  \right)$ be the price of American puts, with $\bar{x}$ xbeing the log underlying price defined as $\bar{x}=\ln S$ and $\alpha$ being the tail index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Now&lt;/strong&gt; how can i show that $\bar{V}\left( \bar{x},t;\alpha  \right)$ should be governed by  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\partial \bar{V}}{\partial t}+\left( r-D+\frac{1}{2}{{\sigma }^{\alpha }}\sec \frac{a\pi }{2} \right)\frac{\partial \bar{V}}{\partial \bar{x}}-\frac{1}{2}{{\sigma }^{\alpha }}\sec \frac{a\pi }{2}{}_{-\infty }D_{{\bar{x}}}^{\alpha }V\bar{V}-r\bar{V}=0,\,\,\,for\,\,{\bar{x}\in \left( {{x}_{f}},+\infty  \right)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where ${x}_{f}$ is the logarithm of the optimal exercise price, i.e., ${{x}_{f}}\left( t;\alpha  \right)=\ln {{S}_{f}}\left( t;\alpha  \right)$ and ${}_{-\infty }D_{{\bar{x}}}^{\alpha }$ is the one-dimensional Weyl factional operator defined as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$${}_{-\infty }D_{{\bar{x}}}^{\alpha }f\left( x \right)=\frac{1}{\Gamma \left( n-\alpha  \right)}\frac{{{\partial }^{n}}}{\partial {{x}^{n}}}\int\limits_{-\infty }^{x}{\frac{f\left( y \right)}{{{\left( x-y \right)}^{n-\alpha -1}}}dy},\,\,\,\,\,\,n-1\le \Re \left( \alpha  \right)&amp;lt;n $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I appreciate any help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="13370" LastEditorDisplayName="user16651" LastEditDate="2016-08-15T08:08:32.227" LastActivityDate="2016-08-15T08:08:32.227" Title="How can I drive FPDE of American Option Price from FMLS Model?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;american-options&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29638" PostTypeId="1" AcceptedAnswerId="29639" CreationDate="2016-08-15T07:43:32.430" Score="2" ViewCount="1727" Body="&lt;p&gt;I have a chart with prices of multiple stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that some prices are below 100 while others are above 1000, so the chart is really ugly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I compare historical in multiple stocks, so the chart is still readable. For instace, if I add Berkshire Hathaway, I won't be able to read anything off my chart because of the large gap between prices of different stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wonder if that's what the logarithmic scale is for?&lt;/p&gt;&#xA;" OwnerUserId="23971" LastActivityDate="2016-08-15T10:42:53.693" Title="Scale prices in multiple stocks for comparison" Tags="&lt;equities&gt;&lt;price&gt;&lt;charts&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29639" PostTypeId="2" ParentId="29638" CreationDate="2016-08-15T10:01:15.007" Score="3" Body="&lt;p&gt;Index all the stocks to 100 in the start of the period!That is mulitiply all stock prices with 100 and divide all stock prices with their price in the beginning of the time series!&lt;/p&gt;&#xA;" OwnerUserId="23886" LastActivityDate="2016-08-15T10:01:15.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29640" PostTypeId="2" ParentId="24318" CreationDate="2016-08-15T10:24:07.773" Score="0" Body="&lt;p&gt;I would say because when you multiply the total turnover ratio by the full bid ask spread you obtain the double of transaction costs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The bid ask spread contains the &lt;strong&gt;double&lt;/strong&gt; of transaction costs ( it represents the cost of a round trip - of a consecutive buy and sell order), that is the reason why we often take half of the spread as an indication of the transaction costs.   We usually assume that the real transaction costs are : $| \text{price} - \text{mid-quote} |$ which should correspond to $ \approx 0.5 * \text{spread}$. If you only take the purchase side (as in the paper you mentioned ) it amounts to compute half of the double spread which is the transaction costs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way would be to compute $ [0.5 \times \text{spread} \times \text{purchase turnover} ]+ [0.5 \times \text{spread} \times \text{sell turnover} ]  $ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is indeed equal to : $  \text{purchase turnover}  * \text{spread}$ (assuming symmetry of the bid ask spread and realizing that purchase turnover is equal to sell turnover)&lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2016-08-15T10:38:57.693" LastActivityDate="2016-08-15T10:38:57.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29641" PostTypeId="2" ParentId="29638" CreationDate="2016-08-15T10:36:43.117" Score="4" Body="&lt;p&gt;Yes I would recommend you to plot the log of prices instead of prices. It will re-scale the data while preserving the hierarchy of prices, and more importantly it allows to compare  easily the growth among several stocks because a vertical move of 0.01 corresponds to a 1% change of the price at any point in the figure (not matter the price level and the direction of the move). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also this &lt;a href=&quot;http://econbrowser.com/archives/2014/02/use-of-logarithms-in-economics&quot; rel=&quot;nofollow noreferrer&quot;&gt;blog post&lt;/a&gt;  and this &lt;a href=&quot;https://stats.stackexchange.com/questions/27951/when-are-log-scales-appropriate&quot;&gt;SO question&lt;/a&gt; . &lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2016-08-15T10:42:53.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29642" PostTypeId="1" CreationDate="2016-08-15T11:22:29.953" Score="1" ViewCount="83" Body="&lt;p&gt;Do you just use an Euler scheme as before?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. take this process, OU process with a Levy driver. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\text{d}V_t = -\lambda V_t\text{d}t + dZ_t&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you just have &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V_{t_{i+1}} = V_{t_i} - V_{t_i}\lambda \delta t + \delta Z$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\delta_t = t_{i+1}-t_i$ and $\delta Z$ is drawn from the distribution of $Z_{\delta t} - Z_0$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have a reference for the convergence rate for the Euler scheme/reference for any other related scheme?&lt;/p&gt;&#xA;" OwnerUserId="3334" LastActivityDate="2016-08-15T11:22:29.953" Title="How are Levy driven SDE simulated?" Tags="&lt;simulations&gt;&lt;sde&gt;&lt;jump-diffusion&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29644" PostTypeId="1" CreationDate="2016-08-15T14:41:22.043" Score="14" ViewCount="36733" Body="&lt;p&gt;I understand &lt;strong&gt;Fed Funds Rate&lt;/strong&gt; is the rate at which banks lend/borrow to/from each other to maintain their daily reserve requirements at the Central Bank; also it is unsecured-meaning &lt;em&gt;no collateral&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this the same as the &lt;strong&gt;OIS rate&lt;/strong&gt;? I read somewhere that this effectively the same as the Fed Fund Rate- however, OIS is supposed to be &lt;em&gt;secured lending rate&lt;/em&gt;, unlike Fed Funds rate. So, how can they be the same, or even similar?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="23972" LastActivityDate="2018-05-29T02:55:32.490" Title="Difference between OIS Rate and Fed Funds Rate" Tags="&lt;interest-rate-swap&gt;&lt;rates&gt;&lt;ois&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="29645" PostTypeId="1" AcceptedAnswerId="29651" CreationDate="2016-08-15T14:42:10.910" Score="3" ViewCount="362" Body="&lt;p&gt;At the moment the backtester has a &lt;strong&gt;portfolio&lt;/strong&gt;; a portfolio is associated with one &lt;strong&gt;strategy&lt;/strong&gt;. The backtester is used to test different strategies one at a time, giving their return, Sharpe, drawdown.&#xA;But should the portfolio have the ability to be associated with multiple strategies (running simultaneously); or should the backtester have ability to run multiple portfolios, each with an individual strategy? Is this somehow important in the context of &lt;strong&gt;portfolio optimisation&lt;/strong&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: in addition to the speed / parallelisation argument, I am looking for a financial argument. One could argue that a backtester is a simulation of the fund's performance; in that context -- would a fund have a portfolio with multiple strategies assigned to it?&lt;/p&gt;&#xA;" OwnerUserId="11655" LastEditorUserId="11655" LastEditDate="2016-08-16T09:08:44.157" LastActivityDate="2016-08-16T09:08:44.157" Title="Should a backtester have ability to run multiple strategies simultaneously?" Tags="&lt;quant-trading-strategies&gt;&lt;backtesting&gt;&lt;portfolio&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29647" PostTypeId="2" ParentId="29644" CreationDate="2016-08-15T15:52:03.883" Score="4" Body="&lt;p&gt;Secured and unsecured refers to &lt;em&gt;lending&lt;/em&gt;. However OIS is a &lt;em&gt;swap&lt;/em&gt; based on FF, not a loan. It is a different animal. So OIS is a derivative, or a bet, based on the average of future (unsecured) FF rates over a period.. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example my name is Noob Rademayer, I am not a bank so I can't lend or borrow FF in the interbank market, but I can bet on the rate at which banks do. (For example I could bet that the cost of borrowing 1,000,000 in FF over the next 30 days will go up).  To let me make these bets the counterparty may require me to put up a small amount of margin, however I still would not call that secured lending, it is just the normal margin for any derivative trade nowadays (enough to cover the loss if something goes wrong, maybe 1000 USD, not the full notional). On the other hand if I wanted to borrow 1 million USD from my broker I would have to put up more than 1 million in marketable securities; that is a secured loan.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-08-15T16:38:25.370" LastActivityDate="2016-08-15T16:38:25.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29648" PostTypeId="1" CreationDate="2016-08-15T16:40:25.893" Score="1" ViewCount="83" Body="&lt;p&gt;Suppose that we have a market with a stock, modelled by $\{S_t\}_{t&amp;gt;0}$ and a riskless money market account  $\{B_t\}_{t&amp;gt;0}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a strategy $\{ H_t^B,H_t^S\}_{t&amp;gt;0}$ be a portfolio over time. (It matches the option price at maturity $T$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We say that the value of the portfolio at time $t &amp;gt;0$ is :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Pi_t = H_t^B B_t + H_t^S S_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take the scenario of $H_t^B = 1, H_t^S = -3$. From what I've seen in the bibliography we make the abbreviation that $-$ corresponds to a short(sell) position and $+$ to a long(buy) position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words for this scenario the value of the replicating portfolio would be : &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Pi_t = +1 B_t - 3 S_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under this abbreviation, I get confused with the definition of the portfolio value. I think in terms of &quot;when i buy, I spend money, so I assign $-$ to the total value, when I sell, I get money, so that my value is positive $+$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the meaning of using $-$ for selling the asset. What is the meaning of the portfolio value defined under the first abbreviation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only explanation I have for this abbreviation comes from the convention that we see asset prices with positive numbers. Eg when we say a price of a stock is $(+)5$ then it means that to &quot;buy&quot; the asset we need $+5$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone could help? Thank you.&lt;/p&gt;&#xA;" OwnerUserId="23975" LastActivityDate="2016-08-15T17:10:21.403" Title="Signs for the assets in a portfolio and definition of portfolio value" Tags="&lt;portfolio&gt;&lt;replication&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29649" PostTypeId="2" ParentId="11435" CreationDate="2016-08-15T16:48:56.733" Score="1" Body="&lt;p&gt;The DTCC provides a free near-real-time swap activity here:&#xA;&lt;a href=&quot;https://rtdata.dtcc.com/gtr/dashboard.do&quot; rel=&quot;nofollow&quot;&gt;https://rtdata.dtcc.com/gtr/dashboard.do&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can subscribe to this service via RSS Feeds and mine it as needed.  Swap trades must be reported by the sell side, so you can see near-real-time activity as it occurs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="23976" LastActivityDate="2016-08-15T16:48:56.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29650" PostTypeId="2" ParentId="29648" CreationDate="2016-08-15T17:10:21.403" Score="2" Body="&lt;p&gt;To sell the entire portfolio you need to sell one bond and buy three stocks. You have to buy the three stocks to get out of your short position held in the portfolio. The price of the portfolio is the cash you receive when you sell it: +1B - 3S&lt;/p&gt;&#xA;" OwnerUserId="23886" LastActivityDate="2016-08-15T17:10:21.403" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29651" PostTypeId="2" ParentId="29645" CreationDate="2016-08-15T17:12:35.103" Score="3" Body="&lt;p&gt;Well from personal experience backtesting can take as long as several hours depending on the strategy, so it  would certainly be helpful to test in parallel in various cases as it can help speed up performance depending on your hardware.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if you have a portfolio optimizing model requiring a parameter input, running a strategy testing many parameters on a single portfolio in parallel would a help maintain a decent sample size while preserving time taken to backtest.&lt;/p&gt;&#xA;" OwnerUserId="18578" LastActivityDate="2016-08-15T17:12:35.103" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29652" PostTypeId="2" ParentId="29625" CreationDate="2016-08-15T17:46:49.223" Score="1" Body="&lt;p&gt;It doesn't mean the definition is not satisfied. Apparently, the definition you provided refers just to the observed quantities. If the definition were more involved, e.g. if it were to take statistical significance into account, then it would have specify a significance threshold, like 5% p-value.&lt;/p&gt;&#xA;" OwnerUserId="23979" LastActivityDate="2016-08-15T17:46:49.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29653" PostTypeId="2" ParentId="27559" CreationDate="2016-08-15T20:43:27.167" Score="5" Body="&lt;p&gt;Being the question tagged as &lt;code&gt;python&lt;/code&gt; and given I look for small challenges for my platform, &lt;code&gt;backtrader&lt;/code&gt;, I took the chance to see how easy would be to do this with the platform.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Documented at: &lt;a href=&quot;http://www.backtrader.com/posts/2016-08-15-stock-screening/stock-screening/&quot; rel=&quot;noreferrer&quot;&gt;http://www.backtrader.com/posts/2016-08-15-stock-screening/stock-screening/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The core code in this case is an analyzer which looks for assets which are above the 10-days moving average (example from the OP). The analyzer code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;class Screener_SMA(bt.Analyzer):&#xA;    params = dict(period=10)&#xA;&#xA;    def start(self):&#xA;        self.smas = {data: bt.indicators.SMA(data, period=self.p.period)&#xA;                     for data in self.datas}&#xA;&#xA;    def stop(self):&#xA;        self.rets['over'] = list()&#xA;        self.rets['under'] = list()&#xA;&#xA;        for data, sma in self.smas.items():&#xA;            node = data._name, data.close[0], sma[0]&#xA;            if data &amp;gt; sma:  # if data.close[0] &amp;gt; sma[0]&#xA;                self.rets['over'].append(node)&#xA;            else:&#xA;                self.rets['under'].append(node)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It can be used directly with the built-in executable &lt;code&gt;btrun&lt;/code&gt; (created by &lt;code&gt;setup.py&lt;/code&gt; / &lt;code&gt;pip&lt;/code&gt;) or managed with a hand-crafted script. A sample execution with &lt;code&gt;btrun&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;btrun --format yahoo --data YHOO --data IBM --data NVDA --data TSLA --data ORCL --data AAPL --fromdate 2016-07-15 --todate 2016-08-13 --analyzer st-screener:Screener_SMA --cerebro runonce=0 --writer --nostdstats&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Yes: the prices are being directly downloaded from Yahoo with &lt;code&gt;--format yahoo&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which earlier today (before the market closed again today) delivered:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;- Analysis:&#xA;  - over: ('ORCL', 41.09, 41.032), ('IBM', 161.95, 161.221), ('YHOO', 42.94, 39.629000000000005), ('AAPL', 108.18, 106.926), ('NVDA', 63.04, 58.327)&#xA;  - under: ('TSLA', 224.91, 228.423)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am sure that the same can be done with other python platforms like &lt;code&gt;pyAlgoTrade&lt;/code&gt;, &lt;code&gt;zipline&lt;/code&gt;, etc. A list of known (to me) python open source platforms can be found in the README of &lt;code&gt;backtrader&lt;/code&gt; on the front page of the repository: &lt;a href=&quot;https://github.com/mementum/backtrader&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/mementum/backtrader&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Disclaimer&lt;/em&gt;: &lt;em&gt;if not obvious, I am the author of &lt;code&gt;backtrader&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="17554" LastActivityDate="2016-08-15T20:43:27.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29655" PostTypeId="1" AcceptedAnswerId="29657" CreationDate="2016-08-15T21:48:30.610" Score="0" ViewCount="100" Body="&lt;p&gt;What kind of indicators may have predicted the upcoming financial crisis in the 2000 or 2008?&lt;/p&gt;&#xA;" OwnerUserId="23982" LastActivityDate="2016-08-16T17:31:01.603" Title="What kind of indicators would you look in the market preceding a recession/crisis?" Tags="&lt;market&gt;&lt;prediction&gt;&lt;macro-economics&gt;&lt;indicator&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29656" PostTypeId="1" AcceptedAnswerId="29715" CreationDate="2016-08-15T22:00:01.723" Score="1" ViewCount="664" Body="&lt;p&gt;I am looking at the Equity Option example of QuantLib:&#xA;&lt;a href=&quot;http://quantlib.org/reference/_equity_option_8cpp-example.html&quot; rel=&quot;nofollow&quot;&gt;http://quantlib.org/reference/_equity_option_8cpp-example.html&lt;/a&gt;&#xA;and more particularly the FDAmericanEngine. However, I am not interested in the point value of the Finite Difference evaluation that is provided by the NPV function, but rather the full value function, for all asset prices (in [x_min, x_max]) and times to maturity (in [0, T]) in some grid of times and asset prices that I can define.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Surely the Finite Difference solver produces the full value function on a mesh of points in order to produce point value, how can I access this value function?&lt;/p&gt;&#xA;" OwnerUserId="7177" LastActivityDate="2016-08-19T05:55:30.640" Title="Full value function of an American option with QuantLib FD" Tags="&lt;option-pricing&gt;&lt;american-options&gt;&lt;quantlib&gt;&lt;finite-difference-method&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29657" PostTypeId="2" ParentId="29655" CreationDate="2016-08-16T01:12:45.340" Score="1" Body="&lt;p&gt;A Bit broad of a question, although here are a few ideas:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Non Farm Payroll rate of change&#xA;This is produced by the Bureau of labour statistics, and tracks total employed persons. Ideally one would seek the change in payrolls to view the health of the job market for a given month.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;pros:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;large sample size.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;cons:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;there is a bit of lag compared to the jobless claims indicator.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/17prv.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/17prv.png&quot; alt=&quot;10 Yr Payrolls&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;Jobless Claims&#xA;This is produced by the Department of labour and includes total applications for unemployment insurance.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;pros:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;produced weekly&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;cons:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;very volatile and noisy&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/kJzwR.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/kJzwR.png&quot; alt=&quot;Initial Claims&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;GDP growth&#xA;This is produced by the BEA and includes GDP growth with GDP defined as:&#xA;GDP = Consumption + Investment + Government Expenditure + Trade Balance&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;pros:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;literally measures US economic growth&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;cons:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;produced quarterly there fore is a lagging indicator&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ELaxM.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ELaxM.png&quot; alt=&quot;GDP Growth&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;4&quot;&gt;&#xA;&lt;li&gt;PMI (Purchasing Manager's Index)&#xA;A measure of Purchasing manager's sentiment, generally speaking a PMI&amp;lt;50 is indicative of recession. The PMI is reported by the Institute for supply management.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;pros:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;leading indicator&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;cons:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;very subjective reporting&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/wMx8L.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/wMx8L.png&quot; alt=&quot;ISM PMI&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18578" LastActivityDate="2016-08-16T01:12:45.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29659" PostTypeId="2" ParentId="29644" CreationDate="2016-08-16T02:18:12.123" Score="19" Body="&lt;p&gt;The OIS is not the secured (collateralised) lending rate. It represents the cost of repeated overnight unsecured lending over periods of up to two weeks (sometimes more). Because it is based on overnight lending, it is assumed to have a lower credit risk than longer term interbank loans based on say 1M, 2M or 3M Libor and this is what drivers the OIS-Libor spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An overnight index swap (OIS) is a swap in which one party pays a fixed rate of interest known as the OIS rate which depends on the term of the swap and is known at trade inception. It is linked to the cost of unsecured lending.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other party pays the rate equivalent to the daily compounded index rate over the life time of the OIS. This is not known until the end of the life of the OIS. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make the OIS swap have zero initial value at inception, which is how it is traded, the OIS rate therefore must equal the market's expectation of what the compounded daily (geometric average) index rate will be over the lifetime of the OIS. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In USD the index rate is the fed funds rate which is linked to the cost of unsecured lending. In Euros the unsecured lending rate to which the OIS is linked is EONIA and in Sterling it is called SONIA where ONIA stands for overnight index rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main use of OIS swaps is to allow banks to lock in the cost of unsecured overnight funding in advance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, your confusion may be due to the use of OIS for discounting of collateralised non-cleared derivatives. This is market practice since 2008. The OIS rate is used because it is close to the typical interest rate paid on the collateral that is held. It becomes the best estimate of the risk-neutral risk-free rate in a world where the collateral has effectively eliminated counterparty risk.&lt;/p&gt;&#xA;" OwnerUserId="12240" LastEditorUserId="12240" LastEditDate="2016-08-16T02:42:03.513" LastActivityDate="2016-08-16T02:42:03.513" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29660" PostTypeId="1" CreationDate="2016-08-16T02:59:35.620" Score="4" ViewCount="398" Body="&lt;p&gt;Please provide steps to justify the below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Can we use a constant as a numeraire? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Related Question: &lt;a href=&quot;https://quant.stackexchange.com/questions/29686/scaling-stock-price-and-strike-etc-by-a-constant&quot;&gt;Scaling Stock Price and Strike etc. by a Constant&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rest of standard Geometric Brownian Motion and Black Scholes assumptions apply.&lt;/p&gt;&#xA;" OwnerUserId="23946" LastEditorUserId="20454" LastEditDate="2020-06-11T10:40:17.453" LastActivityDate="2020-06-11T10:40:17.453" Title="Using a Constant as a Numeraire" Tags="&lt;stochastic-processes&gt;&lt;derivatives&gt;&lt;numerairechange&gt;&lt;numeraire&gt;" AnswerCount="4" CommentCount="7" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29663" PostTypeId="1" AcceptedAnswerId="36599" CreationDate="2016-08-16T09:12:37.980" Score="1" ViewCount="1336" Body="&lt;p&gt;Let $y_0$ be the forward bond yield observed today for a forward contract with maturity $T$, $y_T$ be the bond yield at time $T$, $B_T$ be the price of the bond at time $T$ and let $\sigma_y$ be the volatility of the forward bond yield.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose that $B_T = g(y_T)$ then expanding using a taylor series yields,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$B_T = G(y_0)+(y_T-y_0)G'(y_0)+0.5G''(y_0)(y_T-y_0)^2$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and then taking expectations we get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E_T(B_T) = G(y_0)+E_T(y_T-y_0)G'(y_0)+0.5G''(y_0)E_T(y_T-y_0)^2$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;as we are working in the risk neutral world, $E_T(B_T)=G(y_0)$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and so &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E_T(y_T-y_0)G'(y_0)+0.5G''(y_0)E_T(y_T-y_0)^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now apparently $E_T[(y_T-y_0)^2]$ is approximately equal to $\sigma_y^2y_0^2T$, but cannot see why this approximation is true.&lt;/p&gt;&#xA;" OwnerUserId="11723" LastEditorUserId="11723" LastEditDate="2016-08-16T09:23:06.060" LastActivityDate="2020-07-07T20:47:34.780" Title="Proof of the convexity adjustment formula" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;expected-return&gt;&lt;convexity&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29665" PostTypeId="2" ParentId="29660" CreationDate="2016-08-16T12:33:45.077" Score="5" Body="&lt;p&gt;A Numeraire must be a tradeable asset.  If you can find a constant tradeable asset, then yes a constant can be used as a numeraire.&lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2016-08-16T12:33:45.077" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29666" PostTypeId="2" ParentId="29660" CreationDate="2016-08-16T13:09:18.153" Score="0" Body="&lt;p&gt;Use a constant to scale the numeraire and S and K would scale the same, volatility (of relative returns) would remain unchanged, S/K and ln(S/K) would remain unchanged and of course time to strike and the interest rate; now look in the Black formula and you see that the call price would scale like S and K as you would expect. &lt;/p&gt;&#xA;" OwnerUserId="23886" LastEditorUserId="23886" LastEditDate="2016-08-16T16:52:18.653" LastActivityDate="2016-08-16T16:52:18.653" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="29668" PostTypeId="2" ParentId="1684" CreationDate="2016-08-16T16:20:23.060" Score="0" Body="&lt;p&gt;I've been looking at the same question. I believe the data augmentation literature is relevant. And no doubt some ideas from Good-Turing frequency estimation and descendants can be adapted. Another idea is to transform one exchange rate so that it roughly coincides with another, and use a barrage of off-the-shelf classification algorithms to see if they can determine fake from real data. I think it all depends on which invariants in the data you believe you know well and which residual behavior is common across different time series. &lt;/p&gt;&#xA;" OwnerUserId="23999" LastEditorUserId="23999" LastEditDate="2016-08-16T16:26:52.700" LastActivityDate="2016-08-16T16:26:52.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29669" PostTypeId="2" ParentId="156" CreationDate="2016-08-16T16:32:37.103" Score="4" Body="&lt;p&gt;&lt;strong&gt;Ignoring to account for possibly omitted variables&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ignoring to account for possibly omitted variables has arguably lead to both of the severe problems below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fall of the US mortgage market in 2008 as risk on mortgage bond portfolios were grossly underestimated as the strong dependence of their bonds on common variables like the state of the business and credit cycles were ignored and covariations and portfolio variance understated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rise and fall of the US junk-bond market fuelled by Milken using statistics covering fallen angels from decades ago to predict default rates on new bonds for which most variables but solvency ratios were other omitted and dissimilar to the variables of the bonds in the statistics.&lt;/p&gt;&#xA;" OwnerUserId="23886" LastActivityDate="2016-08-16T16:32:37.103" CommentCount="0" CommunityOwnedDate="2016-08-16T16:32:37.103" ContentLicense="CC BY-SA 3.0" />
  <row Id="29670" PostTypeId="2" ParentId="29655" CreationDate="2016-08-16T17:31:01.603" Score="1" Body="&lt;p&gt;I recently stumbled over an interesting study related to this question: Yaneer Bar-Yam et al. from the New England Complex Systems Institute (NECSI) published a study in 2011 that used &quot;measures of collective panic&quot; to &quot;predict economic market crises&quot;. To cite a report about the paper:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;[...] Research analysts have found [that] high levels of collective&#xA;  stock movements - or market mimicry - tend to precede crashes, which&#xA;  suggests that measuring the mimicry level of the market could provide&#xA;  significant advance warning of an impending stock market crash. [...]&#xA;  The researchers constructed a model of this mimicry to obtain&#xA;  co-movement data, which is the percentage of stocks that move in the&#xA;  same direction. [...] When substantially more than half of the stocks&#xA;  move in the same direction, this co-movement indicates higher levels&#xA;  of mimicry.&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Personally, I think the results look interesting indeed, although it might be difficult to build an indicator out of these findings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, the paper can be found at: &lt;a href=&quot;https://arxiv.org/pdf/1102.2620.pdf&quot; rel=&quot;nofollow&quot;&gt;https://arxiv.org/pdf/1102.2620.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="23920" LastActivityDate="2016-08-16T17:31:01.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29671" PostTypeId="1" AcceptedAnswerId="29674" CreationDate="2016-08-16T18:26:59.517" Score="3" ViewCount="301" Body="&lt;p&gt;I'm trying to experiment with the SVI model. I use the following scripts:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a = 0.05;&#xA;b = 0.3;&#xA;rho = -0.35;&#xA;m = 0;&#xA;sigma = 0.15; &#xA;&#xA;S0 = 100;&#xA;r = 0.033;&#xA;q = 0.0022; &#xA;T = 0.26; &#xA;F0 = S0*exp((r-q)*T);&#xA;k = (50:0.5:120);&#xA;&#xA;iv = a+b*(rho*(k-m)+((k-m).^2+sigma^2).^(1/2)); &#xA;plot(log(k/F0),(iv/T).^(1/2)); &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Matlab returns me the following:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/qKhhm.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/qKhhm.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the problem here? It doesn't work while it is simply fitting the parametrization. &lt;/p&gt;&#xA;" OwnerUserId="20813" LastActivityDate="2016-08-16T20:57:51.233" Title="SVI Parametrization: simple example does not work" Tags="&lt;matlab&gt;&lt;calibration&gt;&lt;curve-fitting&gt;" AnswerCount="1" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="29672" PostTypeId="1" CreationDate="2016-08-16T18:27:07.710" Score="1" ViewCount="382" Body="&lt;p&gt;For the Fama and French three-factor model,&#xA;$$R_{t}-R_{t,F}=\alpha+\beta_{MKT}\left(r_{t,MKT}-r_{t,f}\right)+\beta_{SMB}R_{t,SMB}+\beta_{HML}R_{t,HML}.$$&#xA;I run Fama-MacBeth cross sectional regressions, defining Model A,&#xA;$$R_{t}-R_{t,F}= \mathrm{intercept} +\lambda_{MKT} \beta_{MKT} + \lambda_{SMB} \beta_{SMB} +\lambda_{HML} \beta_{HML}.$$&#xA;Intuitively, what is the difference between the sensitivity of the risk factors and the risk factors themselves? Why can't I run a Fama-MacBeth regressions defining Model B,  $$R_{t}-R_{t,F}= \mathrm{intercept} +\lambda_{MKT} {MKT} + \lambda_{SMB} {SMB} +\lambda_{HML} {HML}.$$&#xA;If I could run them, though, how would the interpretation of the risk premia ($\lambda$) differ between Models A and B?&lt;/p&gt;&#xA;" OwnerUserId="8215" LastActivityDate="2016-08-16T18:27:07.710" Title="What is the meaning of factor sensitivity and its risk premium?" Tags="&lt;asset-pricing&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29673" PostTypeId="2" ParentId="111" CreationDate="2016-08-16T19:22:16.480" Score="2" Body="&lt;p&gt;Blair Hull as an idea: &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2609814&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2609814&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;He says he sold his automated trading firm to Goldman for 300 million $.&lt;/p&gt;&#xA;" OwnerUserId="24002" LastActivityDate="2016-08-16T19:22:16.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29674" PostTypeId="2" ParentId="29671" CreationDate="2016-08-16T20:57:51.233" Score="3" Body="&lt;pre&gt;&lt;code&gt;a = 0.05;&#xA;b = 0.3;&#xA;rho = -0.35;&#xA;m = 0;&#xA;sigma = 0.15; &#xA;S0 = 100;&#xA;r = 0.033;&#xA;q = 0.0022; &#xA;T = 0.26; &#xA;F0 = S0*exp((r-q)*T);&#xA;k = (50:0.5:120);&#xA;x=log(k/F0);&#xA;iv = a+b*(rho*(x-m)+((x-m).^2+sigma^2).^(1/2)); &#xA;plot(x,(iv/T).^(1/2));&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Pi9vL.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Pi9vL.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastActivityDate="2016-08-16T20:57:51.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29676" PostTypeId="1" CreationDate="2016-08-16T23:47:55.243" Score="0" ViewCount="166" Body="&lt;p&gt;Let's say we have an option with underlying stock X and 2 years until maturity. We work out its volatility from X's historical prices across 3 trading years (756 days). To price the option, I can use Black-Scholes and feed in the parameters - but what if I want to also find the options price on the previous days that we got X's historical prices from? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I correct in assuming that every day we go back from today our time to maturity will increase by 1/252 (aka 1 trading day)? Does this mean that we have to recompute the volatility every day we go back to exclude the &quot;future&quot; days? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So day 1 (today) uses our initial time to maturity &lt;code&gt;T&lt;/code&gt; and volatility; day 2 (yesterday) uses &lt;code&gt;T-(1/252)&lt;/code&gt; as the time to maturity and recomputes the volatility to exclude day 1; and so on... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Highly appreciate any help, thanks. &lt;/p&gt;&#xA;" OwnerUserId="19449" LastActivityDate="2017-01-16T07:24:09.857" Title="How to produce historical prices of an option?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;derivatives&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29677" PostTypeId="1" AcceptedAnswerId="29702" CreationDate="2016-08-17T00:36:43.780" Score="0" ViewCount="140" Body="&lt;p&gt;I have a problem which involves optimisation of a portfolio containing one stock and multiple call options written on it, with the same maturity and different strikes. In order to use optimisation technique, I need a covariance matrix between the options and the stock. &#xA;Usually to calculate covariance matrix one would use a matrix of returns, but what do you do if you use Monte Carlo simulation instead of historic data and portfolio containing derivatives rather than simple stocks?&lt;/p&gt;&#xA;" OwnerUserId="24005" LastActivityDate="2016-09-17T06:31:36.920" Title="Mean-Var optimisation of Monte Carlo simulated model" Tags="&lt;monte-carlo&gt;&lt;portfolio-optimization&gt;&lt;markowitz&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29678" PostTypeId="2" ParentId="29656" CreationDate="2016-08-17T02:23:35.603" Score="0" Body="&lt;p&gt;I think you mean the state of the simulation in all grid points?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;QuantLib doesn't have anything to store all grid points, because that'd be very memory consuming. Instead, QuantLib updates an internal vector while doing rollback. You can always do the rollback yourself to any maturity, and save the vector to your own data structure.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2016-08-17T02:23:35.603" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29679" PostTypeId="2" ParentId="29572" CreationDate="2016-08-17T02:40:01.513" Score="96" Body="&lt;p&gt;I am going to recommend something that I have no doubt will get people completely up in arms and probably get people to attack me. It happened in the past and I lost many points on StackOverflow as people downvoted my answer. I certainly hope people are more open minded in the quant forum.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note - It seems that this suggestion has created some strong disagreement again. Before you read this I would like to point out that this suggestion is for a &quot;Small buy side firm&quot; and not a massive multiuser system.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I spent 7 years managing a high-frequency trading operation and our primary focus was building systems just like this. We spent a huge amount of time trying to figure out the most efficient way to store, retrieve and analyze order level data from both the NYSE, NASDAQ and a wide variety of ECNs. What I am giving you is the result of that work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Our answer was &lt;strong&gt;&lt;em&gt;Don't Use a Database&lt;/em&gt;&lt;/strong&gt;. A basic structured file system of serialized data chunks works far better.  Market time series data is unique in many ways, both in how it is used and how it is stored. Databases were developed for wildly different needs and actually hurt the performance of what you are trying to do. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is in the context of a small to mid-sized trading operation that is focused on data analysis related to trading strategies or risk analytics. If you are creating a solution for a large brokerage, bank or have to meet the needs of a large number of simultaneous clients then I imagine that your solution would differ from mine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I happen to love databases. I am using MongoDB right now for part of a new project allowing us to analyze options trades, but my market timeseries data, including 16 years of options data, is all built into a structured file store.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me explain the reasoning behind this and why it is more performant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, let's look at storing the data. Databases are designed to allow a system to do a wide variety of things with data. The basic CRUD functions; Create, Read, Update and Delete. To do these things effectively and safely, many checks and safety mechanisms must be implemented. Before you read data the database needs to be sure the data isn't being modified, it is checking for colisions, etc.. When you do read the data in a database the server puts a lot of effort into caching that data and determining if it can be served up faster later. There are indexing operations and replicating data to prepare it to be viewed in different ways. Database designers have put huge amounts of effort into designing these functions to be fast, but they all take processing time and if they are not used they are just an impediment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Market time series data is stored in a completely different way. In fact, I would say it is prepared rather than stored. Each data item only needs to be written once and after that never needs to be modified or changed. Data items can be written sequentially, there is no need to insert anything in the middle. It needs no ACID functionality at all. They have little to no references out to any other data. The time series is effectively its own thing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a database does all the magic that makes databases wonderful it also packs on the bytes. The minimum space data can take up is its own original size. They may be able to play some tricks with normalizing data and compression, but those only go so far and slow things down. The indexing, caching and referencing the data ends up packing on the bytes and chewing up storage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reading is also very simplified. Finding data is as simple as time &amp;amp; symbol. Complex indexing does it no good. Since time series data is typically read in a linear fashion and a sequential chunk at once, Caching strategies actually slow the access down instead of help. It takes the processor cycles to cache the data you aren't going to read again anytime soon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the basic structures that worked for us. We created basic data structures for serializing the data. If your major concern is speed and data size you can go with a simple custom binary storage. In another answer, omencat suggested using &lt;a href=&quot;http://discretelogics.com/teafiles/&quot; rel=&quot;noreferrer&quot;&gt;TeaFiles&lt;/a&gt; and that looks like it has some promise also. Our recent need is for more flexibility so we chose to use a fairly dense, but flexible JSON format.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We broke the data up into fairly obvious chunks. The EOD stock data is a very easy example, but the concept works for our larger datasets also.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We use the data for analysis in fairly traditional time series scenarios. It could be referenced as one quote or out to a series containing years of data at a time. It was important to break the data down to bite-sized chunks for storage so we chose to make one &quot;Block&quot; of our data equal one year of EOD stock time series data. Each block is one file that contains a year of OHLC EOD data serialized as JSON. The name of the file is the Stock symbol prefixed by an underscore. Note - the underscore prevents issues when the stock symbol conflicts with DOS commands such as COM or PRN.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note, make sure you understand the limitations of your file system. We got in trouble when we put too many files in one place. This led to a directory structure that is effectively its own index. It is broken down by the year of data and then also sorted by the first letter of the stock symbol. This gives us roughly 20 to a few hundred symbol files per directory. It looks roughly like this;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\StockEOD\{YYYY}\{Initial}\_symbol.json&lt;/p&gt;&#xA;&#xA;&lt;p&gt;AAPL data for 2015 would be&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\StockEOD\2015\A\_AAPL.json&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A small piece of its data file looks like this;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[{&quot;dt&quot;:&quot;2007-01-03T00:00:00&quot;,&quot;o&quot;:86.28,&quot;h&quot;:86.58,&quot;l&quot;:81.9,&quot;c&quot;:83.8,&quot;v&quot;:43674760},&#xA;{&quot;dt&quot;:&quot;2007-01-04T00:00:00&quot;,&quot;o&quot;:84.17,&quot;h&quot;:85.95,&quot;l&quot;:83.82,&quot;c&quot;:85.66,&quot;v&quot;:29854074},&#xA;{&quot;dt&quot;:&quot;2007-01-05T00:00:00&quot;,&quot;o&quot;:85.84,&quot;h&quot;:86.2,&quot;l&quot;:84.4,&quot;c&quot;:85.05,&quot;v&quot;:29631186},&#xA;{&quot;dt&quot;:&quot;2007-01-08T00:00:00&quot;,&quot;o&quot;:85.98,&quot;h&quot;:86.53,&quot;l&quot;:85.28,&quot;c&quot;:85.47,&quot;v&quot;:28269652}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We have a router object that can give us a list of filenames for any data request in just a handful of lines. Each file is read with an Async filestream and deserialized. Each quote is turned into an Object and added to a sorted list in the system. At that point, we can do a very quick query to trim off the unneeded data. The data is now in memory and can be used in almost any way needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the query size gets too big for the computer to handle it isn't difficult chunking the process. It takes a massive request to get there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have had programmers who I described this to almost go into a rage telling me how I was doing it wrong. That this was &quot;Rolling my own database&quot; and a complete waste of time. In fact, we switched from a fairly sophisticated database. When we did our codebase to handle this dropped to a small handful of classes and less than 1/4 of the code we used to manage the database solution. We also got nearly a 100x jump in speed. I can retrieve 7 years of stock end of day data for 20 symbols in a couple of milliseconds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Our old HF trading system used similar concepts but in a highly optimized Linux environment and operated in the nanosecond range.&lt;/p&gt;&#xA;" OwnerUserId="19959" LastEditorUserId="19959" LastEditDate="2016-08-23T05:40:50.320" LastActivityDate="2016-08-23T05:40:50.320" CommentCount="20" ContentLicense="CC BY-SA 3.0" />
  <row Id="29683" PostTypeId="1" AcceptedAnswerId="29689" CreationDate="2016-08-17T13:53:47.713" Score="0" ViewCount="272" Body="&lt;p&gt;Say that my returns are normally distributed. I have the historical returns data for 3 index funds and nothing else. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to compute expected return and standard deviation solely from this data. What are some methods for doing this besides just taking the average return for example? Are there some non-obvious strategies that might enhance the results, or does the normality assumption remove any need for this?&lt;/p&gt;&#xA;" OwnerUserId="17712" LastActivityDate="2016-08-17T19:54:56.307" Title="Calculating Expected Return from Historical Data Alone" Tags="&lt;portfolio-management&gt;&lt;portfolio-optimization&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29685" PostTypeId="1" CreationDate="2016-08-17T13:58:45.113" Score="1" ViewCount="1354" Body="&lt;p&gt;I have a predictor variable (x) and dependent variable (y). Both are monthly rolling annualized returns, which naturally induces significant autocorrelation in x and y. They both also fail to be stationary under ADF tests (is this a natural consequence of their construction of being rolling returns?) In terms of regression, is it more appropriate to 1) difference both x and y first or 2)run the normal regression (y~x) and simply adjust standard errors by using heteroskedasticity and autocorrelation (HAC) consistent covariance matrix estimation methods(such as NeweyWest)? Under what circumstances is each of the methods more appropriate? Please leave any references should you have any.&lt;/p&gt;&#xA;" OwnerUserId="24011" LastEditorUserId="24011" LastEditDate="2016-08-17T15:44:57.813" LastActivityDate="2016-10-17T12:42:27.937" Title="How to adjust regression for rolling returns?" Tags="&lt;time-series&gt;&lt;returns&gt;&lt;regression&gt;&lt;auto-correlation&gt;" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="29686" PostTypeId="1" CreationDate="2016-08-17T14:49:03.350" Score="1" ViewCount="95" Body="&lt;p&gt;Please provide steps to justify the below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) If the stock prices, strike and other price related parameters are scaled by the same constant, will the derivative price scale accordingly? I would think this is different from using a constant as a numeraire, since a numeriance does not affect the strike price. Please confirm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Would scaling by a constant lead to any issues (or a different price), when pricing vanilla options? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Are there any derivatives (exotics) whose price is affected when scaling by a constant? One example, is a variance swap as suggested by user @Mats Lind &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Related Question: &lt;a href=&quot;https://quant.stackexchange.com/questions/29660/using-a-constant-as-a-numeraire&quot;&gt;Using a Constant as a Numeraire&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rest of standard Geometric Brownian Motion and Black Scholes assumptions apply.&lt;/p&gt;&#xA;" OwnerUserId="23946" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-08-19T01:44:45.030" Title="Scaling Stock Price and Strike etc. by a Constant" Tags="&lt;option-pricing&gt;&lt;equities&gt;&lt;derivatives&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29687" PostTypeId="1" CreationDate="2016-08-17T17:00:14.827" Score="3" ViewCount="224" Body="&lt;p&gt;Your current wealth is $W$. Each day you can invest some of it; there's a probability $p$ that you will win as much as you invested, $1-p$ that you will lose it. You want to reach a target wealth $W_T$ within $n$ days. Each day, you can choose the fraction $f$ of your wealth to invest. How do you choose $f$ to maximise the chance to hit your target in time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it helps, assume $p &amp;gt; 0.5$, $n \gg 1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is essentially a pure maths problem but I thought it would be interesting for quants. I have seen discussions of similar problems (e.g. &quot;Can you do better than Kelly in the short run?&quot;, Browne (2000)), but they assume a continuous outcome and a few other things. I'd also be happy with a way to find $f$ via simulations, an analytical formula is not essential.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[Edit: you cannot bet more than you currently have. I should have specified this earlier.]&lt;/p&gt;&#xA;" OwnerUserId="18947" LastEditorUserId="18947" LastEditDate="2016-08-24T10:40:10.740" LastActivityDate="2016-08-24T16:34:55.397" Title="How much to invest to reach a target?" Tags="&lt;probability&gt;&lt;portfolio-optimization&gt;&lt;position-sizing&gt;" AnswerCount="2" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="29688" PostTypeId="2" ParentId="29683" CreationDate="2016-08-17T19:22:56.483" Score="0" Body="&lt;p&gt;Expected returns is easiest so I will start with it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One could do a simple linear regression which would be easy, but would have a large margin for confidence intervals. Just multiply the beta co-efficient by the periods you want to calculate in advance. This will also have some possible lag.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could also take the Correlation between a given trading period's return, and the prior period's return. Just multiply the previous periods's return by the beta co-efficient and you can forecast future returns that way with less lag for a linear relationship. I advice doing this on a longer time frame, forecasting possibly a week, month or even quarter depending on what works best for you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Standard Deviation could be forecasting with a GARCH Model:&#xA;&lt;a href=&quot;https://en.wikipedia.org/wiki/Autoregressive_conditional_heteroskedasticity&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Autoregressive_conditional_heteroskedasticity&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18578" LastActivityDate="2016-08-17T19:22:56.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29689" PostTypeId="2" ParentId="29683" CreationDate="2016-08-17T19:54:56.307" Score="1" Body="&lt;p&gt;I'll break the question down into two questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;em&gt;Can expected returns be calculated from historical returns&lt;/em&gt;: If you make the assumption that &lt;strong&gt;expected returns are constant over time&lt;/strong&gt; (a prevalent view in the 1980s but has since seen challenged), then you could take a sample with relatively neutral valuation (e.g., bond yield at roughly same level at the beginning and end of period, or P/E at roughly same levels), calculate the realized return during this period, and use it as the long-term expected return. If you don't believe expected return is constant over time, then it's not possible to get expected returns out of returns series alone.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;em&gt;Can expected returns be calculated from historical data&lt;/em&gt;: If you can use historical data beyond returns, then your opportunity expands significantly. For example, 10-year bond yield provides an excellent forecast for expected bond returns over the next 10-years (even if you're rolling the bond monthly instead of holding it to maturity). Likewise, dividend yield, earnings yield, etc. can be used to proxy for equity expected returns. More sophisticated econometric models of course can be used as well.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Ilmanen's book &lt;em&gt;Expected Returns&lt;/em&gt; is the best literature I've read and discusses this topic from both an academic and practitioner's perspective.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2016-08-17T19:54:56.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29690" PostTypeId="2" ParentId="10882" CreationDate="2016-08-17T20:47:34.407" Score="3" Body="&lt;p&gt;Consider a fixed-for-floating swap with reset dates $T_0, \ldots, T_{n-1}$ and payment dates&#xA;$T_1, \ldots, T_n$, where $0&amp;lt;T_0 &amp;lt; \cdots &amp;lt; T_n$. We assume that the swap exchanges the floating rate payments $L(T_{i-1}; T_{i-1}, T_i)\Delta T_i$ and the fixed rate payments $K\Delta T_i$, for $i=1, \ldots, n$, where $\Delta T_i =  T_i -T_{i-1}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value of the swap at time $t$, where $0 \leq t \leq T_0$, is given by&#xA;\begin{align*}&#xA;\sum_{i=1}^n L(t; T_{i-1}, T_i)\times \Delta T_i\times P(t, T_i) - K \sum_{i=1}^n P(t, T_i)\times \Delta T_i,\tag{1}&#xA;\end{align*}&#xA;where $P(t, u)$ is the price (i.e., zero price) of a zero-coupon bond with maturity $u$ and unit notional.&#xA;The forward swap rate $s$ is the rate $K$ such that the swap value given by $(1)$ is zero, that is,&#xA;\begin{align*}&#xA;s = \frac{\sum_{i=1}^n P(t, T_i) \times L(t; T_{i-1}, T_i) \Delta T_i }{\sum_{i=1}^n P(t, T_i) \times \Delta T_i}.&#xA;\end{align*}&#xA;For a quarterly resetting frequency, that is,  $\Delta T_i=\frac{1}{4}$, then $\frac{1}{4}L(T_{i-1}, T_i)$ is the quarterly interest rate. Moreover, the quarterly swap rate is given by&#xA;\begin{align*}&#xA;\frac{s}{4} = \frac{\sum_{i=1}^n P(t, T_i) \times \frac{1}{4}L(t; T_{i-1}, T_i)}{\sum_{i=1}^n P(t, T_i)}.\tag{2}&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the given example, we have that $n=2$, $P(t, T_1) = 0.998566$, $P(t, T_2) = 0.99655$, $\frac{1}{4}L(t; T_0, T_1) = 0.0014358$, and $\frac{1}{4}L(t;T_1, T_2) = 0.0020222$. Based on Formula $(2)$, the quarterly swap rate is given by&#xA;\begin{align*}&#xA;\frac{s}{4} = \frac{0.998566 \times 0.0014358 + 0.99655 \times 0.0020222}{0.998566+0.99655} = 0.17287\,\%.&#xA;\end{align*}&#xA;The computation for swap rate with semi-annual or annual accrual frequency  can be proceeded analogously. Moreover, you can set  $T_0$ to any date you like, for example, September or December, as you mentioned. &lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-08-18T01:29:36.797" LastActivityDate="2016-08-18T01:29:36.797" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29693" PostTypeId="1" CreationDate="2016-08-17T22:22:44.407" Score="0" ViewCount="444" Body="&lt;p&gt;&lt;a href=&quot;https://www.math.nyu.edu/faculty/avellane/thesis_Zhang.pdf&quot; rel=&quot;nofollow&quot;&gt;https://www.math.nyu.edu/faculty/avellane/thesis_Zhang.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a formula given above but the immediate problem is that using the volatility for $\alpha$ tends to exaggerate decay since it's not uncommon for stocks to move very little despite the volatility being high. For example the SPX has a VIX of 12 despite the price barely changing .5% in a day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that 3x ETFs reset daily, not inraday. This means you can tons of intraday volatility but if the prices keep ending unchanged, there will be no decay despite high volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think my version is more accurate:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(\delta)^B(e^{(-dBt/360+o/2\ln(1-B^2p^2)-oB/2\ln(1-p^2))})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;t=o*7/5&lt;/p&gt;&#xA;&#xA;&lt;p&gt;o= number of trading days. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;t=total number of days including weekends&lt;/p&gt;&#xA;&#xA;&lt;p&gt;B=leverage factor&lt;/p&gt;&#xA;&#xA;&lt;p&gt;d=dividend yield&lt;/p&gt;&#xA;&#xA;&lt;p&gt;p=daily price change&lt;/p&gt;&#xA;" OwnerUserId="15081" LastActivityDate="2016-08-17T22:22:44.407" Title="Calculating the decay of a leveraged ETF" Tags="&lt;options&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29694" PostTypeId="1" AcceptedAnswerId="29695" CreationDate="2016-08-17T22:29:55.357" Score="2" ViewCount="1012" Body="&lt;p&gt;I was playing around with some fx rates and what caught my attention was the sudden drop of the fx rate EUR/CHF at the 15th of January 2015 4:00 - 5:00 am EST. What really happened that day? Was there any prior information directed towards traders and market makers in the context of qualitative risk management to avoid heavy looses?&#xA;Is there any paper that describes the situation and how biased the volatility forecasts can be from the outliers pollution ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/fuj96.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/fuj96.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="22154" LastActivityDate="2016-08-19T01:28:52.147" Title="EUR/CHF fx rate drop on the 15th of January 2015" Tags="&lt;risk&gt;&lt;fx&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29695" PostTypeId="2" ParentId="29694" CreationDate="2016-08-17T22:44:34.497" Score="7" Body="&lt;p&gt;What happened was totally unexpected end of peg against the euro @ 1.2CHF regime that Swiss central bank aborted. See some &lt;a href=&quot;http://www.cnbc.com/2015/01/15/swiss-franc-sours-stocks-tank-as-euro-peg-scrapped.html&quot;&gt;articles&lt;/a&gt; about it. As far as I know nobody in the markets knew, there was no indication whatsoever..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of management, I'm afraid lots of people got heavy losses, particularly banks (Austria, Poland, Hungary) - lots of Swiss loans that got shockingly higher instalments overnight (by 20%) caused serious stress to portfolios of banks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See for instance this good &lt;a href=&quot;https://www.ft.com/content/b481107a-a6e9-11e4-9c4d-00144feab7de&quot;&gt;article&lt;/a&gt;. or google around this, to get more info - you can set google to look for content only at the beginning of 2015.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding academia, there does not seem to be anything particularly interesting: &#xA;&lt;a href=&quot;https://scholar.google.com/scholar?as_ylo=2015&amp;amp;q=swiss+franc+unpegging&amp;amp;hl=cs&amp;amp;as_sdt=0,5&quot;&gt;https://scholar.google.com/scholar?as_ylo=2015&amp;amp;q=swiss+franc+unpegging&amp;amp;hl=cs&amp;amp;as_sdt=0,5&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding volatility forecasting, this would depend on your model, so hard to give a specific answer to that..&lt;/p&gt;&#xA;" OwnerUserId="22237" LastActivityDate="2016-08-17T22:44:34.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29696" PostTypeId="1" CreationDate="2016-08-17T23:39:39.710" Score="1" ViewCount="112" Body="&lt;p&gt;Let C be a Gaussian or Student copula and F1,...,Fd the empirical margins.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C(u)=F(F_1(u_1)^{-1},...F_d(u_d)^{-1})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know how to draw from C and get $(u_1,...,u_d)$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Imagine that I know $u_1$ and $u_2$. I was wondering how I can sample from C conditional on $u_1$ and $u_2$. I don't expect a closed form formula as I have no expression for F1,...,Fd but how would you 'numerically' generate a serie of conditional draws from C?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have found the following code in R :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rpackages.ianhowson.com/rforge/copula/man/cCopula.html&quot; rel=&quot;nofollow&quot;&gt;http://rpackages.ianhowson.com/rforge/copula/man/cCopula.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I tried it with a gaussian copula and assumed I knew $u_1$ and $u_2$ :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(copula)&#xA;normal &amp;lt;- normalCopula(c(0.8, 0.8, 0.8), dim = 3, dispstr = &quot;un&quot;)&#xA;u1 &amp;lt;- 0.8&#xA;u2 &amp;lt;- 0.1&#xA;draws &amp;lt;- cCopula(cbind(u1, u2, runif(10000)), copula = normal, inverse = TRUE)&#xA;&#xA;plot(density(qnorm(draws[,3]))) # it's a normal, OK&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The last line displays a normal, which is OK for a gaussian copula and gaussian marginals. However, in the conditional draws, the second value is always equal to 0.4619 instead of 0.1 as I would expect. That is why I plan to write my own fuction but I'm not sure where I should start.&lt;/p&gt;&#xA;" OwnerUserId="22107" LastEditorUserId="22107" LastEditDate="2016-08-17T23:44:57.380" LastActivityDate="2016-08-17T23:44:57.380" Title="Sampling from conditional copula" Tags="&lt;copula&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29697" PostTypeId="2" ParentId="10882" CreationDate="2016-08-18T00:01:55.333" Score="3" Body="&lt;p&gt;To answer the first question directly, the swap in question is a 1 Year swap of a fixed rate vs 3 month Libor. The swap starts in Mid-June (the date of the ED futures expiration) and goes until the next June. There are 4 quarterly payments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To understand things better, look carefully at Table 8.4 and see how the three columns on the right are computed from information in the Futures Prices column. Note how the ED price for June is used to calculate an implied rate which is then written down in the Sep row of the table. And so forth.  (It could be fun to reproduce these calculations in a spreadsheet).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This process can be used to value a swap of any tenor, or a deferred swap. Strictly speaking it should only be used to value swaps with quarterly payments of 3-month Libor. That is what the ED futures are tied to. (You could approximate semi-annual by compounding quarterly interest rates, but that's not recommended because a modern (post 2008) approach says 3-month Libor and 6-month Libor should be taken from different curves and you should not approximate one from the other, they are inherently different in liquidity and risk).&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-08-18T00:19:31.977" LastActivityDate="2016-08-18T00:19:31.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29698" PostTypeId="1" AcceptedAnswerId="29714" CreationDate="2016-08-18T00:33:28.450" Score="5" ViewCount="1439" Body="&lt;p&gt;I understand that one factor short rate model models the instantaneous rate given any moment in time. Can anyone explain how to derive a term structure from a short rate model and show that one-factor short-rate model tend to produce parallel shift of the yield curve?&lt;/p&gt;&#xA;" OwnerUserId="23846" LastActivityDate="2018-10-19T08:52:08.570" Title="Why does one-factor short-rate model tend to produce parallel shift of the yield curve?" Tags="&lt;interest-rates&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29699" PostTypeId="1" CreationDate="2016-08-18T01:47:34.377" Score="1" ViewCount="200" Body="&lt;p&gt;Usually Ito's lemma is stated for $C^{1,2}(\mathbb{R}^{d+1},\mathbb{R})$ functions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is does Ito still hold if the domain is restricted.  That is if the semi-martingale $Z_t$ is only considered on $[t_1,t_2]\times B$ where B is an open ball in $\mathbb{R}^d$ and $f$ is $C^{1,2}$ thereon then does the Ito formula still hold?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally,what i need precisely is to know if $f$ is a piecewise $C^{1}$ function in the time parameter and twice differentiable in the space parameter, then does Ito still hold?  If not can it be modified, if so how?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;References are always welcome.  &lt;/p&gt;&#xA;" OwnerUserId="11582" LastActivityDate="2016-08-18T10:50:33.777" Title="Piecewise Ito formula" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;itos-lemma&gt;&lt;stochastic&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29700" PostTypeId="2" ParentId="29699" CreationDate="2016-08-18T06:19:26.037" Score="2" Body="&lt;p&gt;Ito for diffusion is local so it holds locally if conditions are local.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let B a open ball of $\mathbb{R}^d $&#xA;Let I be a open time interval.&#xA;Let f be $C^{1,2}(I,B) $.&#xA;Let $A\subset B $ strictly in $B $ (you take margins wrt to the boundary).&#xA; Let $t_1,t_2\in I $ with $t_1 &amp;lt;t_2$ and $x\in B $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then define $\tau$ the exit time of  $A $ starting from $t_1,x$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can now write Ito lemma between $t_1$ and $\min (\tau ,t_2)$&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-08-18T06:19:26.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29701" PostTypeId="2" ParentId="29660" CreationDate="2016-08-18T06:22:13.327" Score="6" Body="&lt;p&gt;Either $r=0$ in which $B_t$ is constant and is a valid numeraire (as is any multiple of it.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or $ r \neq 0$ in which case an asset of constant value would give an arbitrage since we could take&#xA;$$&#xA;B_t - N_t&#xA;$$&#xA;with $B_0 = N_0$ and get a riskless profit. (or the opposite if $r&amp;lt;0.$) and so it would be a very flawed model.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2016-08-18T06:22:13.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29702" PostTypeId="2" ParentId="29677" CreationDate="2016-08-18T06:24:26.110" Score="2" Body="&lt;p&gt;evolve the stock to the requisite time horizon using some model. &#xA;Get its value and that of the options on it. Compute the returns implied&#xA;by these. Store this vector. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do this many times.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Compute the implied covariance matrix of these vectors of returns.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2016-08-18T06:24:26.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29703" PostTypeId="1" CreationDate="2016-08-18T08:57:20.930" Score="0" ViewCount="110" Body="&lt;p&gt;Can a bond return over a month be positive while the bond also has a positive yield change for the month? How does this occur?&lt;/p&gt;&#xA;" OwnerUserId="20592" LastEditorUserId="16160" LastEditDate="2016-09-19T23:31:54.803" LastActivityDate="2016-10-20T00:28:00.377" Title="Positive bond returns and positive yield change in the same month" Tags="&lt;fixed-income&gt;&lt;bond-yields&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29704" PostTypeId="2" ParentId="29685" CreationDate="2016-08-18T10:00:24.900" Score="0" Body="&lt;p&gt;What is your goal? I assume it is to find if/how y is caused by x. You really ought to make sure that y and x are stationary. There are only a few cases in which linear regression makes sense when they are not stationary (e.g. x is a deterministic trend term) and even in those cases, the statistical properties of the coefficient estimators are different than usual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the regressor is not stationary, the results can just be wrong, as in the case of spurious regression. The Newey-West method is &lt;strong&gt;not&lt;/strong&gt; used to solve problems of stationarity but rather of serial correlation which is not the main issue in your case. It just changes the estimated errors, but if x is not stationary, the coefficient estimates may well be biased.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My hunch is that it'd be enough to inspect if changes in x are related to changes in y. Do this by differencing the two series. However, if you suspect a long term common trend, do a test of cointegration too (if x is just one variable and not a set of many variables, look for the Engle-Granger test, it's very simple).&lt;/p&gt;&#xA;" OwnerUserId="18947" LastActivityDate="2016-08-18T10:00:24.900" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29706" PostTypeId="2" ParentId="28132" CreationDate="2016-08-18T10:14:37.897" Score="0" Body="&lt;p&gt;You can copy the Merton model which assumes that the firm value evolves according to &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dV = \mu V dt + \sigma V dW$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you can simulate from $t=0$ to $T$ to get $V(T)$ in one step using.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V(T) = V(0) \exp \left( (\mu-\sigma^2/2) T + \sigma W_T \right)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have to get $V(0)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure I like this model. It will be hard to make it fit the market and the payoff at expiry is not handled correctly as the terminal stock price is a call option on the future firm value, e.g. it should be zero if $V(T)&amp;lt;D$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And there are more problems too. Do not use it for anything serious.&lt;/p&gt;&#xA;" OwnerUserId="12240" LastActivityDate="2016-08-18T10:14:37.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29707" PostTypeId="1" CreationDate="2016-08-18T10:35:45.667" Score="1" ViewCount="189" Body="&lt;p&gt;I have some difficulties seeing where financial products show up in banks balancesheets? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example if I buy a put and a call option OTC from a bank, will it be an Asset or a liability from the banks perspective?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks guys, hope it is not a silly question. &lt;/p&gt;&#xA;" OwnerUserId="23921" LastActivityDate="2016-08-19T11:41:02.323" Title="A bank sells a put and a call - where does it show up in the book? Asset or Liability" Tags="&lt;options&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29712" PostTypeId="2" ParentId="28132" CreationDate="2016-08-18T13:43:25.383" Score="1" Body="&lt;p&gt;In classical structural modeling, we have that the firm asset value $A(t)$ is the fundamental stochastic variable, following an SDE like the one presented by @Dom &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{dA}{A} = \mu_A d\,t + \sigma_A d\,W&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The stock price is then itself an option on the asset value at some horizon $T_H$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;S_t = S(A(t), \mu_A, \sigma_A, T_H)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the convertible bond price, being an option on $S$, can then be viewed as a compound option, with a payoff in the $S$ options.  In particular at bond maturity time $T \leq T_H$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;CB(T) = \max( \rho \tilde{S}(A(T), \mu_A, \sigma_A, T), F)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\rho$ is conversion ration, $F$ is the final coupon plus face value and $\tilde{S}$ is diluted stock value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, to do pricing we run a binomial tree backwards on $A$ and $S$, from $T_H$ to $T$, find bond prices on the nodes at $T$, and then continue to backwardate from $T$ to time zero.  (American exercise adds only minor complexity to the calculations.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that we typically also have a bankruptcy barrier condition, namely that there exists some $L$ such that if any $A(t)&amp;lt;L$ then the stock value drops to zero and the bond value drops to some bankruptcy recovery value.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2016-08-18T13:43:25.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29713" PostTypeId="2" ParentId="29707" CreationDate="2016-08-18T14:07:15.160" Score="2" Body="&lt;p&gt;For any dealer in OTC options, a short option position represents a liability, since, after receiving the initial payment, that contract offers only potential cash outflows.[1]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To use an IFRS definition, a liability is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;a present obligation&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;arising from a past event&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;the settlement of which is expected to lead to an outflow of future economic benefits from the entity.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'd expect these liabilities to be recognised at &quot;fair value through profit and loss&quot;, i.e. variations in the option liability would generate profit or loss.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To emphasise the point: IAS32 defines a &quot;financial instrument&quot; as &quot;a contract that gives rise to a &lt;strong&gt;financial asset&lt;/strong&gt; of &lt;strong&gt;one entity&lt;/strong&gt; and a &lt;strong&gt;financial liability&lt;/strong&gt; or equity instrument &lt;strong&gt;of another entity&lt;/strong&gt;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The hope of the dealer is that the option premium received is sufficient to cover the costs of hedging that position plus a profit margin.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[1] Ignoring any margining / collateral-type cash flows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: have a look at Deutsche Bank's 2015 balance sheet at &lt;a href=&quot;https://annualreport.deutsche-bank.com/2015/ar/financial-statements/consolidated-balance-sheet.html&quot; rel=&quot;nofollow&quot;&gt;https://annualreport.deutsche-bank.com/2015/ar/financial-statements/consolidated-balance-sheet.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If DB had sold you an OTC option, I'd expect the option position to be reflected in the line &quot;Financial liabilities at fair value through profit or loss&quot;, in the sub-item &quot;Negative market values from derivative financial instruments&quot;.&lt;/p&gt;&#xA;" OwnerUserId="787" LastEditorUserId="787" LastEditDate="2016-08-19T11:41:02.323" LastActivityDate="2016-08-19T11:41:02.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29714" PostTypeId="2" ParentId="29698" CreationDate="2016-08-18T14:31:35.850" Score="9" Body="&lt;p&gt;This has already been explained at the start of Chapter 4 in &lt;a href=&quot;https://www.amazon.ca/Interest-Rate-Models-Practice-Inflation-ebook/dp/B014P9HONM&quot; rel=&quot;nofollow noreferrer&quot;&gt;Brigo's book&lt;/a&gt;. Basically, for any affine model of the short rate $r_t$, the zero-coupon bond price has the form&#xA;\begin{align*}&#xA;P(t, T) = A(t, T)e^{-B(t, T) r_t},&#xA;\end{align*}&#xA;where $A(t, T)$ and $B(t, T)$ are deterministic functions. The yield, or zero rate, is given by&#xA;\begin{align*}&#xA;R(t, T) &amp;amp;= -\frac{\ln P(t, T)}{T-t}\\&#xA;&amp;amp;=-\frac{\ln A(t, T)}{T-t} + \frac{B(t, T)}{T-t} r_t\\&#xA;&amp;amp;=:a(t, T) + b(t, T) r_t.&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;{\rm Corr}\big(R(t, T_1), R(t, T_2) \big) &amp;amp;= {\rm Corr}\big(a(t, T_1) + b(t, T_1 r_t, a(t, T_2) + b(t, T_2) r_t \big)\\&#xA;&amp;amp;={\rm Corr}(r_t, r_t) =1.&#xA;\end{align*}&#xA;That is, at any time $t$, the yield to any two maturity dates are perfectly correlated, and any shift to a single yield causes a parallel shift to the whole yield curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a derivation of the term structure from the Hull-White short rate model, see &lt;a href=&quot;https://quant.stackexchange.com/questions/21513/extended-hull-white-interest-rate-model-for-zero-coupon-bond.&quot;&gt;this answer&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-08-18T17:55:32.127" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29715" PostTypeId="2" ParentId="29656" CreationDate="2016-08-18T15:48:34.857" Score="1" Body="&lt;p&gt;QuantLib does give you the value function, but it's very well hidden. Also, it's only for $t=0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you have your option built and your finite-difference engine set, you can write for instance:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;SampledCurve prices = option.result&amp;lt;SampledCurve&amp;gt;(&quot;priceCurve&quot;);&#xA;for (Size i=0; i&amp;lt;prices.size(); ++i)&#xA;    std::cout &amp;lt;&amp;lt; prices.gridValue(i) &amp;lt;&amp;lt; &quot;\t&quot; &amp;lt;&amp;lt; prices.value(i) &amp;lt;&amp;lt; &quot;\n&quot;;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can also retrieve the full grid or the full set of values at once; see the &lt;code&gt;&amp;lt;ql/math/sampledcurve.hpp&amp;gt;&lt;/code&gt; header for the full interface available from the &lt;code&gt;SampledCurve&lt;/code&gt; class.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, there's no reference for the values one can possibly retrieve from any given engine via the &lt;code&gt;Instrument::result&lt;/code&gt; function; you'll have to look them up in the code for each engine.&lt;/p&gt;&#xA;" OwnerUserId="308" LastEditorUserId="308" LastEditDate="2016-08-19T05:55:30.640" LastActivityDate="2016-08-19T05:55:30.640" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="29716" PostTypeId="1" CreationDate="2016-08-18T18:21:59.390" Score="1" ViewCount="1942" Body="&lt;p&gt;I have created a trading strategy which operate every single day on the DAX 30, for the last 1700 trading sessions (some years). I have the daily returns of my strategy and also the daily returns of my index. I'm using R, therefore i can get sd, mean, var ecc...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The big issue that impresses the market watchers and financial types is the ability to consistently make above-market returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the main important instrument to test the significance of a trading strategy?Is it sufficient a simple t-test? Which type (paired, unpaires ecc..)? What are your suggestions?&lt;/p&gt;&#xA;" OwnerUserId="24031" LastActivityDate="2017-05-14T12:33:38.707" Title="Test statistical significance of a trading strategy" Tags="&lt;r&gt;&lt;statistics&gt;&lt;quant-trading-strategies&gt;&lt;finance&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29717" PostTypeId="2" ParentId="29716" CreationDate="2016-08-18T19:06:42.590" Score="3" Body="&lt;p&gt;You can test if your mean return and variance are significantly different from benchmark statistics. Steps how to do it are described &lt;a href=&quot;http://faculty.ccc.edu/colleges/hwashington/math/Resources/Stats_PDF_Chapters/ch09.pdf&quot; rel=&quot;nofollow&quot; title=&quot;here&quot;&gt;here&lt;/a&gt; &quot;Chapter 9: Testing differences between two means, variances or proportions&quot;.&lt;/p&gt;&#xA;" OwnerUserId="17921" LastEditorUserId="16148" LastEditDate="2016-08-18T20:00:10.540" LastActivityDate="2016-08-18T20:00:10.540" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29718" PostTypeId="2" ParentId="28448" CreationDate="2016-08-18T19:11:14.667" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://www.optionsprofitcalculator.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Optionsprofitcalculator&lt;/a&gt;&#xA;primarily lets users get an overview of option position prices in regard to underlying price at expiration. But you can also fiddle around with certain fields if you know the backdated options values. You just have to expand &amp;quot;manual entry options.&amp;quot;&lt;/p&gt;&#xA;" OwnerUserId="24033" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-08-18T19:11:14.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29719" PostTypeId="1" CreationDate="2016-08-18T19:36:34.520" Score="1" ViewCount="305" Body="&lt;p&gt;I would like to use Python to programmatically find the cusips of all bonds that are currently issued by a given equity. Assume I can use any free api and bloomberg. Thank you!&lt;/p&gt;&#xA;" OwnerUserId="24034" LastActivityDate="2016-11-29T16:56:29.297" Title="Find all bonds associated with an equity" Tags="&lt;equities&gt;&lt;programming&gt;&lt;bond&gt;&lt;python&gt;&lt;capital-structure&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29720" PostTypeId="2" ParentId="29687" CreationDate="2016-08-18T20:52:55.270" Score="1" Body="&lt;p&gt;Trying to get this started I'll go for what I think is the easiest part, in a highly handwaving way if you'll excuse: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With number of days large enough that we will likely not end the last day with wealth $W$ between $0$ and target wealth $W_T$, the time distance to the last day loses significance and the problem could be stated in time invariant form with $W$ developing between infinite borders of bankruptcy and target. For $p &amp;gt; 0.5$ we will become risk adverse as excpected gains are positive and we want to bet cautiously to stay inside the interval to reap those gains with the added benefit of diversification between many bets. If instead $p &amp;lt; 0.5$ we become risk loving as we don't want to let negative expected returns grind down our wealth from repeated playing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We would then stake it all in one go to expose us to negative expected returns only once, but not more than it would take to reach $W_T$; this trivially spells out as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for $  n&amp;gt;&amp;gt;1 $  and  $p&amp;lt;0.5$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f(W) = min(1,W_T/W-1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: By the same argument for $  n&amp;gt;&amp;gt;1 $  and  $p&amp;gt;0.5$:$$W&amp;gt;0: f(W) -&amp;gt; 0; f(0) = 1$$&#xA;Now, this is still some way from the final answer as I guess the question is asking either for the exact expression for $f$ but preferably for some approximation given a specific value of $  n&amp;gt;&amp;gt;1 $?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update2:&lt;/strong&gt; To get optimal $f(w)$ for a given $n$ and $p&amp;gt;0.5$; write out the transition tree backwards starting with $n = 0$ for a couple of $n$:s. For nodes in that tree, use the lowest level of $W$ in each interval of $W$:s that have the same probability of winning. For $n=1$ for instance we thus have $W/W_t = 0.5$ as the one node inside the interval. In order to travel through as many nodes as possible towards a win or lose to exploit $p&amp;gt;0.5$ we have to only stake what we need to get to nearest nodes in the next timestep. We see in the tree that this amount is sometimes $0$, and sometimes $1/2^n$. Looking closer it is further seen that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for $p&amp;gt;0.5; W&amp;gt;=W_T/2^n$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if $int((W/W_T)/2^n)$ is an odd number: $$f(W) = (1/2^n)*W_T/W$$ otherwise: $$f(W) =0$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equally optimal but smoother you could use a sawtooth form for $f$ varying linearly between $0$ at even values for $int((W/W_T)/2^n)$ and $(1/2^n)*W_T/W$ at odd values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update3:&lt;/strong&gt; For $p=0.5$ far away from the last day the game is fair and the outcome does not depend on how we play it. The only thing we have to ensure is to bet boldly enough not to end up with $0&amp;lt;W&amp;lt;W_T$ when the game is finished and of course not to reach for gains that would put us above $W_T$. So every choice: $$0&amp;lt;f&amp;lt;=min(1,W_T/W-1)$$ is equally good away from the endgame. Using the higher value for $f$ yields by symmetry and induction $$P(win) = W/W_T$$ Now you can use that and stationarity of $P(win)$ to show that the lower values for $f$ also works with these $P(win)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[Edited Update 2]&lt;/p&gt;&#xA;" OwnerUserId="23886" LastEditorUserId="23886" LastEditDate="2016-08-24T16:34:55.397" LastActivityDate="2016-08-24T16:34:55.397" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="29721" PostTypeId="1" CreationDate="2016-08-18T21:42:26.300" Score="1" ViewCount="78" Body="&lt;p&gt;Is there a problem in modeling total return rather than price return when using GARCH models?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My line of thinking is that total return includes dividends, which is only a &quot;pseudo-random variable&quot; in that it is much more predictable than price changes, which should only come from &quot;news&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know of any research or have any thoughts on this?&lt;/p&gt;&#xA;" OwnerUserId="23978" LastActivityDate="2016-08-18T21:42:26.300" Title="Price return or total return for GARCH models" Tags="&lt;time-series&gt;&lt;returns&gt;&lt;garch&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29722" PostTypeId="2" ParentId="29694" CreationDate="2016-08-19T01:28:52.147" Score="2" Body="&lt;p&gt;The SNB took away the 1.2000 EURCHF floor it has kept for 2+ years without any prior warning to the market. The floor was initially introduced to keep Swiss Franc from strengthening due to buying demand from a troubled Euro Zone, and being an export economy. The Swiss National Bank had to defend its currency by absorbing Euro and keep on printing Francs. When the ECB, the European Central Bank, was about to announce its own QE programme, the SNB didn't see this as sustainable and threw in the towel and eventually let the market decide where the exchange rate should be. And after that event, the FX Options market has never been the same again...&lt;/p&gt;&#xA;" OwnerUserId="11773" LastActivityDate="2016-08-19T01:28:52.147" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29723" PostTypeId="2" ParentId="29676" CreationDate="2016-08-19T02:12:46.977" Score="1" Body="&lt;p&gt;The simple answer is you cannot do that really... There is no plausible way to derive the implied volatility of an option in the past given the IV as of today. You would need an entire set of historical market data snapshot at the time, the spot, forward, vol surface or the vol for the particular option you want to value.&lt;/p&gt;&#xA;" OwnerUserId="11773" LastActivityDate="2016-08-19T02:12:46.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29725" PostTypeId="2" ParentId="24796" CreationDate="2016-08-19T03:05:35.480" Score="0" Body="&lt;p&gt;FX is a very different beast because there's no centralized market and the actual flow you can interact with differs greatly from participant to participant. I would recommend that you only use historical data that you are storing yourself.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2016-08-19T03:05:35.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29727" PostTypeId="1" CreationDate="2016-08-19T09:32:27.173" Score="2" ViewCount="4317" Body="&lt;p&gt;I have created a strategy specifically for a particular stock which I backtested with its historical data. Now I want to forward test it with simulated stock price generated using Monte Carlo. I have used &lt;a href=&quot;http://vazoof.com/basic-finance-monte-carlo-simulation-in-r/&quot; rel=&quot;nofollow&quot;&gt;this websites&lt;/a&gt; formula for generating simulated return.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$$\operatorname{Return} = \mu\Delta t + \sigma r\sqrt{Δt}$$  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is my code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quantmod)&#xA;set.seed(100)&#xA;aapl=getSymbols(&quot;AAPL&quot;,from=&quot;2014-01-01&quot;,auto.assign=F)&#xA;N=1000 #number of iterations&#xA;ret=ROC(Cl(aapl))&#xA;plot(ret)&#xA;t=1&#xA;mu=mean(na.omit(ret))&#xA;sigma=sd(na.omit(ret))&#xA;new_ret=NULL&#xA;&#xA;for( i in 1:N){&#xA;phi=runif(1, min=0, max=1)&#xA;new_ret[i]=mu*t+sigma*phi*sqrt(t)&#xA;}&#xA;plot(new_ret)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The simulated return(new_ret) looks some what odd and not proper? How to generate simulated data using historical data of a stock price? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Return is calculated using &lt;code&gt;ROC()&lt;/code&gt; function which in turn uses &lt;code&gt;diff(log())&lt;/code&gt; function. How can I generate price from simulated return vales?&lt;/p&gt;&#xA;" OwnerUserId="16754" LastEditorDisplayName="user16651" LastEditDate="2016-08-19T10:34:23.500" LastActivityDate="2016-08-19T10:42:11.317" Title="How to generate simulated stock price from historical data using R?" Tags="&lt;r&gt;&lt;monte-carlo&gt;&lt;simulations&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29728" PostTypeId="2" ParentId="29727" CreationDate="2016-08-19T09:57:27.940" Score="5" Body="&lt;p&gt;This approach is rather crude. It only takes the mean and volatility of the historical returns and assumes a very simple model. I'm not sure if you have much experience with Time Series, but your returns series is a Time series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can now perform tests on these log returns to ensure you can continue with Time series models. One very simple model is ARMA. You can extend it to ARCH-GARCH. R has these function built in and it also has features which will simulate future values using the model it builds. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Check out he &lt;code&gt;arima()&lt;/code&gt; function, or uGARCH. Sorry if you have not come across this yet. It is a fairly simple model but very good in my experience for returns. Id expect it to be better than your model above. It is a common approach in modelling financial time series. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stats.stackexchange.com/questions/146233/which-econometric-models-can-be-used-to-forecast-security-returns-arima-garch&quot;&gt;Which econometric models can be used to forecast security returns +&#xA;ARIMA/GARCH questions&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Autoregressive%E2%80%93moving-average_model&quot; rel=&quot;nofollow noreferrer&quot;&gt;Autoregressive–moving-average model.&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.nr.no/files/samba/bff/SAMBA0804.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Statistical modelling of financial time series: An introduction&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Hope this is useful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your final question. Your code looks fine, although inefficient if you are simulating a lot of data. To forecast prices, you have some return $r$. IF you take today's stock price $S_0$, then tomorrows price will be $S_0(1+r)$ if you use normal returns. Similar formulae hold if you use log prices as I mentioned before. IF your using standard returns, then predicting $n$ days ahead requires $$S_0(1+r_1)(1+r_2)\cdots(1+r_n).$$ This can be applied in a crude for loop or more elegant methods in R.&lt;/p&gt;&#xA;" OwnerUserId="24039" LastEditorUserId="-1" LastEditorDisplayName="user16651" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2016-08-19T10:42:11.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29730" PostTypeId="2" ParentId="29626" CreationDate="2016-08-19T13:59:13.067" Score="0" Body="&lt;p&gt;For simplicity I assume all discount factors to be 1.&#xA;$$&#xA;V_{n}=E\left (G_{{\tau}'_{n}} \mid \mathscr{F}_{n} \right ) \: \text{with} \: {\tau}'_{n} \in S_{n} \: \text{maximizing} \: V_{n}&#xA;$$&#xA;We define&#xA;$$&#xA;\tau^{\ast}_{n} = \min \left \{ m \geq n: V_{m} = G_{m} \right \}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We seek a proof that $\tau^{\ast}_{n}$ is a valid choice for ${\tau}'_{n}$. It's enough to prove that for n = 0, i.e. that it is possible to set&#xA;$$ {\tau}'_{0} = \tau^{\ast}_{0} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fact that the stopped process $V_{n\wedge \tau^{\ast}_{0}}$ is a martingale is not enough to prove the claim. E.g. $\tau^{\ast}_{0} = 0$ would cause the stopped process to be a martingale too, but would most probably not maximize $V_{n}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact I would not use the stopped process at all, but would rather prove the claim like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems clear, that the ${\tau}'_{n} \in S_{n}$ that maximizes $E\left(G_{\tau}\mid \mathscr{F}_{n} \right ) $ also maximizes $E\left(G_{\tau}\mid \mathscr{F}_{0} \right ) $ as long as we keep restricting ourselves to $S_{n}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From that we can conclude that ${\tau}'_{0} = n$ implies ${\tau}'_{n} = n$ and that leads to &#xA;$$&#xA;{\tau}'_{0} = n \:\Rightarrow\: V_{n} = G_{n} &#xA;$$&#xA;because ${\tau}'_{0} = n \:\Rightarrow\: {\tau}'_{n} = n$ and on the set $\left\{{\tau}'_{n} = n\right\}$ is $G_{{\tau}'_{n}}=G_{n}$ which is $\mathscr{F}_{n}$-measurable so that on this set holds:&#xA;$$V_{n} = E\left (G_{{\tau}'_{n}} \mid \mathscr{F}_{n} \right ) = E\left (G_{n} \mid \mathscr{F}_{n} \right ) = G_{n}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we know, that $\left \{ {\tau}'_{0} = n\right \}$ and $\left \{ \tau^{\ast}_{0} = n\right \}$ are both a subset of $\left \{ V_{n} = G_{n} \right \}$. What is left is to prove, that choosing the minimal $n$ in the definition of ${\tau}'_{0}$ works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know that $V_{n}$ is a supermartingal:&#xA;$$&#xA;V_{n} = \max_{\tau \in S_{n}} E\left(G_{\tau}\mid\mathscr{F}_{n} \right)\geq \max_{\tau \in S_{m}} E\left(G_{\tau}\mid\mathscr{F}_{n} \right) \\ = E\left(\max_{\tau \in S_{m}} E\left(G_{\tau}\mid\mathscr{F}_{m} \right) \:\mid \mathscr{F}_{n}\right) = E\left(V_{m}\mid\mathscr{F}_{n}\right) \;for \: m \gt n&#xA;$$&#xA;The inequality stems from the fact, that $S_{n} \supseteq S_{m}$ for $\: m \gt n$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets assume we have $\tau^{\ast}_{n} = \min \left \{ m \geq n: V_{m} = G_{m} \right \}$ and another stopping time $\tau_{1}$ with $V_{n} = G_{n}$ if $\tau_{1}=n$ and $\tau_{1}\geq\tau^{\ast}_{0}$&#xA;We use the optional sampling theorem on the supermartingal $V_{n}$&#xA;$$V_{\tau^{\ast}_{0}}\geq E\left(V_{\tau_{1}}\mid\mathscr{F}_{\tau^{\ast}_{0}}\right)$$&#xA;$$\Rightarrow\: E\left(V_{\tau^{\ast}_{0}}\mid\mathscr{F}_{0}\right)\geq E\left(V_{\tau_{1}}\mid\mathscr{F}_{0}\right)$$&#xA;$$\Rightarrow\: E\left(G_{\tau^{\ast}_{0}}\mid\mathscr{F}_{0}\right)\geq E\left(G_{\tau_{1}}\mid\mathscr{F}_{0}\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which means that indeed $\tau^{\ast}_{0}$ and not $\tau_{1}$ maximizes $E\left(G_{\tau^{\ast}_{0}}\mid\mathscr{F}_{0}\right)$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q.E.D.&lt;/p&gt;&#xA;" OwnerUserId="22686" LastEditorUserId="6686" LastEditDate="2017-07-12T22:22:17.047" LastActivityDate="2017-07-12T22:22:17.047" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="29731" PostTypeId="1" CreationDate="2016-08-19T14:59:25.493" Score="1" ViewCount="200" Body="&lt;p&gt;I've been working on calculating parametric ES assuming the returns follow Paretian stable law. Given the four parameters - $\alpha, \beta,\sigma,\mu$- &lt;a href=&quot;https://www.researchgate.net/profile/Sergio_Ortobelli/publication/228204555_Computing_the_Portfolio_Conditional_Value-at-Risk_in_the_Alpha-Stable_Case/links/02e7e518e531c966dd000000.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Stoyanov&lt;/a&gt; introduces closed form solution of the problem (assuming returns as the r.v., not losses - hence VaR is the negative quantile and we are integrating over the left tail, as I understand it. - see below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/YXFUu.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/YXFUu.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been struggling for two days with implementing this in &lt;code&gt;R&lt;/code&gt;, but I cannot get the results they publish at the end of the paper - expect for a special symmetric case ($\beta=0$) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas where I could possibly go wrong? &#xA;Here are my results: I use &lt;code&gt;integrate&lt;/code&gt; in &lt;code&gt;R&lt;/code&gt;for the integral and it seems to give reasonable values of the integral with absolute error around &lt;code&gt;1e-04&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be greatly appreciated. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; dat&#xA;   alpha    myES  target relError integral myVaR absErrorIntegral subdivisions&#xA;1   1.04 160.837 157.204    0.023   -0.159 6.119            0.000            7&#xA;2   1.07  93.020  86.393    0.077   -0.166 5.755            0.000            6&#xA;3   1.10  66.317  58.302    0.137   -0.174 5.430            0.000            5&#xA;4   1.13  52.234  43.331    0.205   -0.184 5.140            0.000            4&#xA;5   1.16  43.650  34.082    0.281   -0.194 4.878            0.000            4&#xA;6   1.19  37.961  27.831    0.364   -0.205 4.642            0.000            4&#xA;7   1.22  33.996  23.344    0.456   -0.217 4.428            0.000            4&#xA;8   1.25  31.154  19.979    0.559   -0.231 4.234            0.000            3&#xA;9   1.28  29.094  17.369    0.675   -0.246 4.057            0.000            3&#xA;10  1.31  27.617  15.292    0.806   -0.264 3.895            0.000            3&#xA;11  1.34  26.599  13.604    0.955   -0.283 3.746            0.000            3&#xA;12  1.37  25.965  12.200    1.128   -0.305 3.610            0.000            2&#xA;13  1.40  25.672  11.030    1.327   -0.331 3.486            0.000            2&#xA;14  1.43  25.703  10.030    1.563   -0.360 3.371            0.000            2&#xA;15  1.46  26.058   9.170    1.842   -0.395 3.266            0.000            2&#xA;16  1.49  26.758   8.430    2.174   -0.436 3.169            0.000            2&#xA;17  1.52  27.840   7.771    2.583   -0.486 3.080            0.000            2&#xA;18  1.55  29.360   7.200    3.078   -0.546 2.998            0.000            2&#xA;19  1.58  31.399   6.680    3.701   -0.619 2.923            0.000            2&#xA;20  1.61  34.067   6.229    4.469   -0.710 2.854            0.000            2&#xA;21  1.64  37.506   5.817    5.448   -0.824 2.791            0.000            2&#xA;22  1.67  41.917   5.445    6.698   -0.967 2.733            0.000            2&#xA;23  1.70  47.576   5.100    8.329   -1.148 2.679            0.000            1&#xA;24  1.73  54.877   4.790   10.457   -1.383 2.630            0.000            2&#xA;25  1.76  64.422   4.500   13.316   -1.690 2.585            0.000            2&#xA;26  1.79  77.145   4.250   17.152   -2.103 2.544            0.000            2&#xA;27  1.82  94.616   4.010   22.595   -2.673 2.505            0.000            2&#xA;28  1.85 119.654   3.790   30.571   -3.497 2.470            0.000            3&#xA;29  1.88 157.937   3.580   43.116   -4.766 2.437            0.000            3&#xA;30  1.91 222.734   3.390   64.703   -6.928 2.406            0.000            3&#xA;31  1.94 353.958   3.220  108.925  -11.330 2.378            0.001            3&#xA;32  1.97 751.596   3.050  245.425  -24.725 2.351            0.001            4&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="22237" LastEditorUserId="22237" LastEditDate="2016-08-19T15:52:21.577" LastActivityDate="2016-08-19T15:52:21.577" Title="Expected shortfall of stable distribution by Stoyanov" Tags="&lt;r&gt;&lt;risk&gt;&lt;portfolio-management&gt;&lt;statistics&gt;&lt;distribution&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29732" PostTypeId="1" CreationDate="2016-08-19T16:23:41.660" Score="2" ViewCount="1336" Body="&lt;p&gt;I am currently working on a risk analysis model that is primarily focused on options portfolios, but will likely be later expanded to cover mixed (options, stocks, bond, futures, etc...) portfolios. This will be used at a non-professional but advanced level to identify overweighted risks and show how proposed positions would affect the portfolio risk balance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The goal is to be able to clearly show risks in a number of scenarios; Market move up/down, Correction down(w/ IV shock), Individual symbol shocks, etc&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to be able to show the effect of risks to Portfolio performance and also to the greeks and the resulting risk profile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The basic portfolio analysis methods such as beta weighting and VaR models seem to be very limited and don't have any concept of IV change or the effects of volatility shocks. I could mix some different models, but I still need the basic underlying models to do that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anyone offer some suggestions for a risk modeling framework or even specific analysis techniques that could be used in simulations to get the results I need? At this point, I am searching but finding little that directly applies. Some guidance would be very welcome.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note - I understand options pricing models very well, so that isn't the part I am looking for. I need a model that lets me understand and predict how IV will change during periods of market stress so that I can feed the pricing models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Update (12/20/2016)&lt;/em&gt;&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hopefully, I can clarify what I am looking for. The models I am used to working with are all focused on risks associated with price movements in stocks but the portfolios I am trying to model are built primarily from &lt;em&gt;Options&lt;/em&gt; positions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This adds a new dimension to the risk modeling that I would like to get a handle on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the market drops in value 5% I can certainly estimate what would happen to the values of the underlying assets. Then using a pricing model I can determine what the new options values would be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem stems from the fact that a sudden 5% drop in price would have a dramatic effect on the IV of the options. Without taking this into account the model is effectively worthless.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there good models for determining what the change in IV would likely be based on some form of shock in the market? How do I determine the resultant IV due to the uncertainty created by the market disruption?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without this aspect, most risk models are effectively useless for an options portfolio.&lt;/p&gt;&#xA;" OwnerUserId="19959" LastEditorUserId="19959" LastEditDate="2016-12-21T03:02:53.290" LastActivityDate="2020-12-21T14:26:27.347" Title="Portfolio risk analysis in Options &amp; Mixed portfolios" Tags="&lt;options&gt;&lt;risk&gt;&lt;risk-management&gt;&lt;portfolio&gt;&lt;risk-models&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29733" PostTypeId="1" CreationDate="2016-08-19T17:05:12.270" Score="-1" ViewCount="290" Body="&lt;p&gt;I tried calculating the Hurst Exponent using c#, and  compared the results to a series with a known exponent. I am having the following issue in my calculations:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1- All my results are negative.. Instead of positive. I get numbers close to the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;mean reverting series: -1, random series  -0.5,  and trending series : 0. The series have Hurst Exppnents of 0, 0.5. 1.00,  respectively. It appears as if I take the original and subtract 1 . &#xA;I have been trying to figure where my error is for a couple of days and can't seem to find it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has anyone come across in the past... Is there any suggestions on how to fix it?&lt;/p&gt;&#xA;" OwnerUserId="24046" LastEditorUserId="2299" LastEditDate="2017-05-14T11:46:51.340" LastActivityDate="2017-05-14T11:46:51.340" Title="Error/Bug in computing the Hurst Exponent on timeseries" Tags="&lt;statistics&gt;&lt;quantitative&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29735" PostTypeId="1" CreationDate="2016-08-19T19:49:42.453" Score="2" ViewCount="3482" Body="&lt;p&gt;Given a portfolio of assets (say 10) and trading signal (1=Hold):  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;      ___________________   Day Count  ______________________&#xA;&#xA;  Asset |0|1|2|3|4|5|6|7|8|9|10|11| ... |30|31|32|33|34|35| ...&#xA;--------+------------------------------------------------------&#xA;1. IBM  |1|1|1|1|1|1|1|0|0|0| 0| 0| ... | 0|-1|-1|-1| 0| 0| ... &#xA;2. APPL |0|0|0|1|1|1|1|1|0|0|-1|-1| ... |-1| 0| 0| 0| 0| 0| ...&#xA;    :                        :                 :   &#xA;    :                        :                 :&#xA;10.TSLA |0|0|0|0|0|1|1|1|0|0| 0| 0| ... | 0|-1|-1|-1| 0| 0| ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The trading signal can be read as follows:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;IBM : Buy on Day0 and Sell on Day7; then Short on Day31 and Buy back on Day34, and so on. &lt;/li&gt;&#xA;&lt;li&gt;APPL: Buy on Day3 and Sell on Day8; then Short on Day10 and Buy back on Day31, and so on&lt;/li&gt;&#xA;&lt;li&gt;TSLA: Buy on Day5 and Sell on Day8; then Short on Day31 and Buy back on Day34, and so on.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;My question is that, given that the rebalancing time is not fixed and that on some days there are Long only or Short only positions, how can one make this portfolio Beta-Neutral?&lt;/p&gt;&#xA;" OwnerUserId="18890" LastEditorUserId="848" LastEditDate="2016-08-21T19:43:56.460" LastActivityDate="2016-08-21T19:43:56.460" Title="Creating a Beta-Neutral Portfolio" Tags="&lt;portfolio-management&gt;&lt;hedging&gt;&lt;beta&gt;&lt;market&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29736" PostTypeId="1" AcceptedAnswerId="29771" CreationDate="2016-08-19T20:53:12.043" Score="5" ViewCount="345" Body="&lt;p&gt;all of the books and notes I have seen on the Feynman Kac formula mostly applied to Risk neutral measure, i.e. different interest rate models, stochastic volatility, etc. I think risk neutral measure can be replaced with any other measure associated with a traded numerraire $N(t)$ such that $$\frac{V(t)}{N(t)}=\mathbb{E}_t^N\left[\frac{V(T)}{N(T)}\right]$$&#xA;So what came to my mind is annuity measure and swaption price or forward measure and cap price. However, I could not find any references on those PDEs. Can someone point me to some references or provide different measure examples and how PDE is derived in that case. It would be especially useful if the example is a &quot;real application&quot; one and can be seen in practice pricing financial instruments.&lt;/p&gt;&#xA;" OwnerUserId="22823" LastEditorDisplayName="user16651" LastEditDate="2016-08-19T21:02:05.127" LastActivityDate="2016-08-22T08:42:12.933" Title="Other numerraire choices when applying Feynman Kac" Tags="&lt;options&gt;&lt;stochastic-processes&gt;&lt;finite-difference-method&gt;&lt;parabolic-pde&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29740" PostTypeId="1" CreationDate="2016-08-20T05:42:01.583" Score="11" ViewCount="4332" Body="&lt;p&gt;I am looking at the valuation of an Interest Rate Swap (IRS thereafter) which is pretty much vanilla with one small tweak. Floating leg pays 3 months LIBOR in monthly intervals. To be precise: floating leg resets every month, and the 3M LIBOR prevailing at the reset date is paid out at the end of the monthly interval. Payment is of course scaled to 1 month period (multiplied by year fraction equivalent to this monthly period). I feel that I should use convexity adjustment similarly as in the case of the in arrears IRS (but the adjustment will be different this time around). Can anyone guide me to the appropriate convexity adjustment for this case?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maturity: 5 years.&#xA;Floating leg: monthly payments based on the 3M LIBOR prevailing on the reset date (reset dates occur monthly 2 business days before the start of each monthly coupon period).&#xA;Fixed leg: annual fixed payments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The closest case that I've found was in great Brigo and Mercurio  book &quot;Interest Rate Models - Theory and Practice&quot; 13.8.5 page 566 &quot;Forward Rates Resettung Unnaturally and Average-Rate Swap&quot;. However Brigo and Mercurio discuss contract that pays after natural payment date (and in my case it is before natural paymen date).&lt;/p&gt;&#xA;" OwnerUserId="15916" LastEditorUserId="20795" LastEditDate="2019-09-08T10:10:33.510" LastActivityDate="2020-04-01T11:44:40.470" Title="What is the correct convexity adjustment for an Interest Rate Swap with unnatural reset lag?" Tags="&lt;interest-rate-swap&gt;&lt;convexity&gt;&lt;irs&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29741" PostTypeId="2" ParentId="29740" CreationDate="2016-08-20T09:51:03.577" Score="3" Body="&lt;p&gt;This seems to be a (short term, only 3 months) CMS swap. I wrote a paper about the different approaches to price them, available &lt;a href=&quot;http://poseidon01.ssrn.com/delivery.php?ID=316105111106007109009123107096029094097057069013079039085087067107105003122070084075054034098101102014042108117086066107107101037027053089084025112079087070117124123053033013068088021016012076017064030019107030107080068019000104004031091095122084000029&amp;amp;EXT=pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. You can pick the one best fitted for your needs.&lt;/p&gt;&#xA;" OwnerUserId="15650" LastActivityDate="2016-08-20T09:51:03.577" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29742" PostTypeId="2" ParentId="29735" CreationDate="2016-08-20T10:27:28.753" Score="6" Body="&lt;p&gt;There are more ways to approach this but the method I propose should work reasonably well in practice, especially if you increase the number of assets you hold.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Calculate the beta of the stocks you're holding with respect to an index&lt;/li&gt;&#xA;&lt;li&gt;Buy $N_f$ (sell when $N_f$ is negative) future contracts on that index&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;$N_f$ can be calculated as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$N_f =  \frac{\beta_T - \beta_S}{\beta_f}\frac{S}{f}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\beta_T$ is your target beta, $\beta_S$ is the $\beta$ of your stock position, $\beta_f$ the $\beta$ of your future, $S$ the value of your portfolio in dollars and $f$ the futures price. In your case, $\beta_T = 0$ and the formula reduces to &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$N_f =  -\frac{\beta_S}{\beta_f}\frac{S}{f}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The advantage of this strategy is that you have low counterparty risk and relatively low transaction costs. However, there will be some basis risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The CFA Level III curriculum (book 5) has a much broader discussion on this including strategies using options and swaps. The equations given above are taken from there.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2016-08-20T10:27:28.753" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29743" PostTypeId="2" ParentId="29732" CreationDate="2016-08-20T11:38:27.837" Score="2" Body="&lt;p&gt;I'm not sure were your problem exactly lies, but of course you can apply standard risk techniques:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;identify your risk factors (like stock prices and Implied Vol., yieldcurves, credit spreads, ...)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Calculate your risk measure be it VaR or ES. If you have non-standard risk factors, the easiest way to do that is in my opinion via historical simulation. You need a history of all your risk factors and apply all the historic daily movements to your portfolio. &#xA;If your risk horizon is much longer than a day you need to correct for effect of theta.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Complement your risk measure with stress testing and scenario analysis to capture non-linear effects and get a handle on catastrophic scenarios. While you could do your VaR calculation in linear approximation, using only sensitivities, you want to be more precise here to capture the non-linear effects. &#xA;If you really want it, you can assign a probability to your scenarios and aggregate them to one single risk measure too, but the usefullness of that is limited in my opinion.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If you want to get really sophisticated with your scenario analysis, this paper might be of interest to you:&#xA;&lt;a href=&quot;https://www.bis.org/publ/ecsc07c.pdf&quot; rel=&quot;nofollow&quot;&gt;https://www.bis.org/publ/ecsc07c.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="22686" LastActivityDate="2016-08-20T11:38:27.837" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29744" PostTypeId="1" AcceptedAnswerId="29749" CreationDate="2016-08-20T15:28:04.743" Score="1" ViewCount="1387" Body="&lt;p&gt;I know that there are Treasury Credit Teams in Banks, so I would like to know what Treasury Credit is?  I would also like to know the difference between Treasury Credit Risk and Credit Risk? &lt;/p&gt;&#xA;" OwnerUserId="5839" LastActivityDate="2016-08-20T20:05:48.277" Title="What is Treasury Credit Risk?" Tags="&lt;risk&gt;&lt;credit-risk&gt;&lt;credit&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29745" PostTypeId="2" ParentId="14294" CreationDate="2016-08-20T16:38:33.493" Score="0" Body="&lt;p&gt;There is no issue here. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the world of insurance:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;An actuarial value is placed on the insurance by examining the probability of the fire event based on historically similar events and other input data. &lt;/li&gt;&#xA;&lt;li&gt;The event probability (per annum) times the expected size of the loss, plus some extra safety premium and costs, determines the annual premium that must be paid. &lt;/li&gt;&#xA;&lt;li&gt;The insurance company builds a reserve against this risk to cover itself in the event that a fire occurs. &lt;/li&gt;&#xA;&lt;li&gt;There is a distribution around the mean loss so that the losses in one year may be more than the expected loss. However insurance companies know about the law of large numbers which says that as the number of similar independent contracts written becomes large, deviations from the mean will become less likely. So they seek to write more contracts.&lt;/li&gt;&#xA;&lt;li&gt;They will also be required by Insurance Solvency requirements to hold an extra cash buffer against a large deviation in the number of fires.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The world of CDS is quite different:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Every CDS trade has a buyer and a seller so a CDS moves credit risk - it does not create it&lt;/li&gt;&#xA;&lt;li&gt;The price of the CDS is determined by a market not by historical data. &lt;/li&gt;&#xA;&lt;li&gt;Market participants do pay attention to the historical performance of similar companies, or companies with similar ratings, but this is just one ingredient out of many inputs. &lt;/li&gt;&#xA;&lt;li&gt;Market prices respond to market news about the CDS reference entity&lt;/li&gt;&#xA;&lt;li&gt;Most market participants can hedge their position easily&lt;/li&gt;&#xA;&lt;li&gt;Most of the largest holders of CDS are dealers who are hedged.&lt;/li&gt;&#xA;&lt;li&gt;Those who do not hedge are investors who sell protection in order to earn a risk-adjusted return. They should be able to survive a credit event.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If a reference credit does default, then all contracts linked to that reference entity will be triggered. Many of the market players are hedged and so have no net loss. Those who are not hedged will make a gain or loss depending on their position. However, across the market the summed gains and losses will offset exactly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For many of these reasons, the worlds of insurance and derivatives are quite different. &lt;/p&gt;&#xA;" OwnerUserId="12240" LastEditorUserId="12240" LastEditDate="2016-08-20T16:44:20.787" LastActivityDate="2016-08-20T16:44:20.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29746" PostTypeId="2" ParentId="26078" CreationDate="2016-08-20T17:43:19.307" Score="2" Body="&lt;p&gt;The wsj website lets you download csv data for DJI. If you play around a little bit, you can figure out the url query to kick off a download. The, you can use Powershell to make the download programmatic (note: this script also accesses stock quotes from yahoo finance using their currently available csv download method) (Note: the codes for the yahoo query are documented here: &lt;a href=&quot;http://www.canbike.org/information-technology/yahoo-finance-url-download-to-a-csv-file.html&quot; rel=&quot;nofollow&quot;&gt;http://www.canbike.org/information-technology/yahoo-finance-url-download-to-a-csv-file.html&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#script follows&#xA;&#xA;cls&#xA;&#xA;Function Get-LastFriday&#xA;{&#xA;&#xA;    $djiDate = [DateTime]::Now&#xA;&#xA;    while ($djiDate.DayOfWeek -ne &quot;Friday&quot;)&#xA;    {&#xA;&#xA;        $djiDate= [DateTime]::Now.AddDays(-1)&#xA;&#xA;&#xA;    }&#xA;&#xA;    return $djiDate&#xA; }&#xA;&#xA;#prototype: quotes.wsj.com/index/DJIA/historical-prices/download?MOD_VIEW=page&amp;amp;num_rows=1&amp;amp;range_days=1&amp;amp;startDate=08/20/2016&amp;amp;endDate=08/20/2016&#xA;&#xA;$djiDate = Get-LastFriday&#xA;&#xA;$startDate = $endDate = ([String]$djiDate.Month) + &quot;/&quot; +  ([String]$djiDate.Day) + &quot;/&quot; + ([String]$djiDate.Year) &#xA;$uri = &quot;quotes.wsj.com/index/DJIA/historical-prices/download?MOD_VIEW=page&amp;amp;num_rows=1&amp;amp;range_&quot;+$startDate+&quot;&amp;amp;endDate=&quot;+$endDate&#xA;&#xA;Invoke-WebRequest -Uri $uri -OutFile &quot;C:\Users\xxxx\Desktop\dji.csv&quot;&#xA;Import-Csv -Header Date, Open, High, Low, Close -LiteralPath &quot;C:\Users\bill\Desktop\dji.csv&quot; | Out-GridView&#xA;&#xA;Invoke-WebRequest -Uri &quot;http://download.finance.yahoo.com/d/quotes.csv?s=^DJI,VWIAX,VMMXX,VWELX,DODGX&amp;amp;f=nsl1d1t1p&amp;amp;e=.csv&quot; -OutFile &quot;C:\Users\xxxx\Desktop\q.csv&quot;&#xA;Import-Csv -Header Name, Symbol, 'Last Trade', 'Trade Date', 'Last Trade Time', p -LiteralPath &quot;C:\Users\bill\Desktop\q.csv&quot; | Out-GridView&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="24060" LastActivityDate="2016-08-20T17:43:19.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29749" PostTypeId="2" ParentId="29744" CreationDate="2016-08-20T20:05:48.277" Score="1" Body="&lt;p&gt;Treasury Credit Risk is the assessment of Credit Risk within Treasury.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Banks have a Treasury Function or a Treasury Office that (simplifying a little) oversees all of the bank's money, and watches over the bank's liquidity and capital condition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://thegatewayonline.com/investment-banking/types-of-work/barclays-treasury-the-heart-of-the-bank&quot; rel=&quot;nofollow&quot;&gt;http://thegatewayonline.com/investment-banking/types-of-work/barclays-treasury-the-heart-of-the-bank&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One job they perform is the lending of surplus liquidity to other banks and the raising of funds in in the interbank market. This office also has a risk management job, which includes constantly assessing the Credit Risk of other banks that they deal with. They might decide not to do business with BANK X if they think Bank X is about to go under, for example. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Every bank is organized a little different so this answer may be a little too generic.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2016-08-20T20:05:48.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29750" PostTypeId="2" ParentId="29703" CreationDate="2016-08-20T21:59:27.370" Score="1" Body="&lt;p&gt;The price change of a bond over a time period $dt$ is composed of:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) An increase in value due to all coupons and principal repayment getting closer in time and so increasing their PV (assuming no yield change). This price change is roughly equal to $P .y . dt$ where $y$ is the bond yield and $P$ is the bond price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) An increase/decrease in value due to a decrease/increase in bond yields. This may be due to market moves. It will also include a component due to &quot;roll-down&quot; i.e. the tendency of the yield curve to be upward sloping such that as time passes, the corresponding yield declines. The size of the price change is $D . P . dy$ where $D$ is the modified duration of the bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Coupon payments when an amount $c/f$ is paid (coupon $c$ paid with frequency $f$). The bond price will fall by exactly $c/f$ across the coupon payment date. The coupon is a received payment that forms part of the period return and may be reinvested.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A single period total return will take into account all of these. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is possible that the positive contribution of (1) can exceed the negative contribution of (2) if the yield increase is small and the bond duration is low, thereby resulting in a positive total return.&lt;/p&gt;&#xA;" OwnerUserId="12240" LastEditorUserId="12240" LastEditDate="2016-08-20T22:41:41.073" LastActivityDate="2016-08-20T22:41:41.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29751" PostTypeId="1" AcceptedAnswerId="29787" CreationDate="2016-08-21T02:30:17.740" Score="2" ViewCount="795" Body="&lt;p&gt;I understand the VanillaSwap object assumes that payment and calculation resets are the same, so is there any way we could use quantlib to price a swap with different reset and calculation frequencies? (say payment is semiannual but resets is annual).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few candidates I've considered are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;NonstandardSwap: however I think this does not allow different payment and reset schedules too.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Swap: it takes 2 legs but Leg itself is virtual, however there are many other ways implementing this, one way is to use the IborCoupon however that seems to require repeatedly creating every single coupon in order to constructing Leg.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Is there any other simpler way to deal with this given that everything else is similar to a VanillaSwap except using different payment and calculation dates?&lt;/p&gt;&#xA;" OwnerUserId="3595" LastActivityDate="2016-08-23T07:42:24.650" Title="Using quantlib to price swaps with different payment and calculation resets for floating leg" Tags="&lt;swaps&gt;&lt;quantlib&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29752" PostTypeId="1" AcceptedAnswerId="29756" CreationDate="2016-08-21T03:41:55.197" Score="2" ViewCount="132" Body="&lt;p&gt;I am reading Steven Shreve's book &quot;Stochastic Calculus for Finance 2 Continuous-Time Models&quot;, page 304. My intuition is that when the stock price gets closer to the barrier, it will be more and more likely that the price will exceed the barrier in a near future, hence it has a large probability to become worthless. This leads to the consequence that the price of the option should be closer and closer to zero. But I can not justify this intuition from the formula on page 304. Can someone explain this? Thanks a lot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The formula is &#xA;$$V(0)=S(0)I_1-KI_2-S(0)I_3+KI_4$$ where &#xA;$$\quad I_1=\frac{1}{\sqrt{2\pi T}}\displaystyle\int_{k}^be^{\sigma w-rT+\alpha w-\frac{1}{2}\alpha^2T-\frac{1}{2T}w^2}dw$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$I_2=\frac{1}{\sqrt{2\pi T}}\displaystyle\int_{k}^be^{-rT+\alpha w-\frac{1}{2}\alpha^2T-\frac{1}{2T}w^2}dw$$&#xA;and&#xA;$$\quad I_3=\frac{1}{\sqrt{2\pi T}}\displaystyle\int_{k}^be^{\sigma w-rT+\alpha w-\frac{1}{2}\alpha^2T-\frac{2}{T}b^2+\frac{2}{T}bw-\frac{1}{2T}w^2}dw$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$I_4=\frac{1}{\sqrt{2\pi T}}\displaystyle\int_{k}^be^{-rT+\alpha w-\frac{1}{2}\alpha^2T-\frac{2}{T}b^2+\frac{2}{T}bw-\frac{1}{2T}w^2}dw$$&lt;/p&gt;&#xA;" OwnerUserId="22690" LastEditorDisplayName="user16651" LastEditDate="2016-08-23T08:47:13.450" LastActivityDate="2016-08-23T08:50:09.253" Title="Does the Knock-out option price go to $0$ when the stock price goes to the barrier $B$?" Tags="&lt;option-pricing&gt;&lt;exotics&gt;" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29753" PostTypeId="1" AcceptedAnswerId="29763" CreationDate="2016-08-21T08:11:25.493" Score="1" ViewCount="1432" Body="&lt;p&gt;I am using the Quantmod package in R for some data analysis. Now I can downbload price history of particular stocks or index with the following code:-&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quantmod) # Loading quantmod library&#xA;&#xA;getSymbols(&quot;^DJI&quot;, from = as.character(Sys.Date()-365*3))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want to download all the ticker symbols that are composite of a particular Index such as DJI for example. What will be the best way to do that through R?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot in advance.&lt;/p&gt;&#xA;" OwnerUserId="20162" LastActivityDate="2016-08-22T00:13:26.170" Title="How to extract all the ticker symbols of an exchange with Quantmod in R?" Tags="&lt;r&gt;&lt;quantmod&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29754" PostTypeId="1" CreationDate="2016-08-21T09:03:34.657" Score="0" ViewCount="180" Body="&lt;p&gt;I'm reading about copula estimation in the book &lt;a href=&quot;https://books.google.ch/books?id=JgGhLWbl3hAC&amp;amp;pg=PA256&amp;amp;dq=inference%20function%20for%20margins&amp;amp;hl=it&amp;amp;sa=X&amp;amp;ved=0ahUKEwjMrMPyj9LOAhVXOMAKHa93DBQ4ChDoAQgrMAI#v=onepage&amp;amp;q=inference%20function%20for%20margins&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;Financial Modeling Under Non-Gaussian Distributions&lt;/a&gt; by Jondeau, Poon and Rockinger. They say that full maximum likelihood can be difficult because of i) dimensionality and because ii) &quot;the copula parameter may be a &quot;convoluted expression&quot; of the margins parameter.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been looking for a translation of that word, but I only find difficult or complicated as synonyms of convoluted. I believe there is more to it than just &quot;complicated&quot;. Is there maybe a more specific meaning for this word? Would you know what the authors mean with &quot;convoluted expression&quot; in this context?&lt;/p&gt;&#xA;" OwnerUserId="20573" LastActivityDate="2016-08-21T13:35:47.713" Title="Is there a specific meaning to the word &quot;convoluted&quot; in maths or mathematical finance?" Tags="&lt;modeling&gt;&lt;copula&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29755" PostTypeId="2" ParentId="29752" CreationDate="2016-08-21T09:06:26.773" Score="0" Body="&lt;p&gt;Let $X_t $ be a stochastic process. Your question looks like to prove that starting from x and for any t the probability that the time to be above b be smaller than t tends to 1 when $x\uparrow b$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $t&amp;gt;0$. Indeed you want to prove:&#xA;$$\mathbb{P}_x(\sup_{s\leq t}X_s \geq b)\to_{x\to b}=1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If no more assumption on $X $, then it can be true or false.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Case 1&lt;/strong&gt; &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Let $X $ be a Brownian motion&#xA;$$\mathbb{P}_x(\sup_{s\leq t}X_s \geq b)=2\mathbb{P}(W_t\geq b-x)$$&#xA;By the reflection principle.&#xA;And you conclude that it tends to 1.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Case 2&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Let $X $ be a Poisson process compensated.&#xA;I.e $X_t= N_t - \lambda t $ Then by conditioning on $N_t=0$ and $N_t&amp;gt;0$ you can prove that the limit when $x\to b $ tends to $1- P (N_t=0)&amp;lt;1$&lt;/p&gt;&#xA;" OwnerUserId="20201" LastEditorDisplayName="user16651" LastEditDate="2016-08-23T08:50:09.253" LastActivityDate="2016-08-23T08:50:09.253" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29756" PostTypeId="2" ParentId="29752" CreationDate="2016-08-21T09:40:54.423" Score="0" Body="&lt;p&gt;The reflection principle for a driftless Brownian motion $W_t$ starting at $W_0=0$ tells us that the probability of crossing a barrier $B&amp;gt;0$ before option expiry time $T$ is twice the probability of $W_T$ being above the barrier at expiry. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We now use this result in reverse. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We set $t=0$ and put the barrier just above the current value of $W_0=0$ by setting $B=\epsilon$ where $\epsilon$ is small. This is analogous to the stock price being just below the barrier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is clear from symmetry that the probability of W_T being above or below zero at expiry time $T$ will be approximately $1/2$, and exactly $1/2$ as $\epsilon \rightarrow 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence the probability of the barrier being crossed at any time before expiry will be twice this number i.e. it will tend to 1. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the barrier is a knock-out then the option price will tend to zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice the stock price process has a drift $r$ and is lognormal so the numbers are a little bit different. However the same intuition applies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To see this in equation in Shreve's book you should note that he defines in (7.3.3)&#xA;\begin{eqnarray}&#xA;b=\frac{1}{\sigma} \log \frac{B}{S(0)}&#xA;\end{eqnarray}&#xA;So if $S(0) = B$ then $b=0$. Using the identities on page 305 you will see that this means that $I_1=I_3$ and $I_2=I_4$. Substituting these values into the formula on page 304 which is given by&#xA;\begin{eqnarray}&#xA;V(0)=S(0)I_1 - K I_2 -S(0)I_3+K I_4,&#xA;\end{eqnarray}&#xA;gives &#xA;\begin{eqnarray}&#xA;V(0)=0.&#xA;\end{eqnarray}&#xA;And so the knock out option price goes to zero when the stock price goes to the barrier.&lt;/p&gt;&#xA;" OwnerUserId="12240" LastEditorUserId="12240" LastEditDate="2016-08-21T15:20:15.733" LastActivityDate="2016-08-21T15:20:15.733" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29757" PostTypeId="2" ParentId="10905" CreationDate="2016-08-21T12:14:52.800" Score="-2" Body="&lt;p&gt;I think you have to check &lt;a href=&quot;http://www.modulusfe.com/products/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.modulusfe.com/products/&lt;/a&gt; for a high frequency trading solution with open source code. &lt;/p&gt;&#xA;" OwnerUserId="24066" LastEditorUserId="33410" LastEditDate="2018-05-23T06:26:41.260" LastActivityDate="2018-05-23T06:26:41.260" CommentCount="1" CommunityOwnedDate="2016-08-21T12:14:52.800" ContentLicense="CC BY-SA 4.0" />
  <row Id="29758" PostTypeId="2" ParentId="29754" CreationDate="2016-08-21T13:17:04.607" Score="2" Body="&lt;p&gt;&quot;convoluted expression&quot; in American usage just means a complicated, big mathematical expression, sometimes also called &quot;hairy&quot; or &quot;messy&quot;. It is ugly to work with and to look at, so you prefer not to deal with it if possible. Nothing more than that. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is also a mathematical operation called &quot;convolution (&quot;Faltung&quot; in German) but it has nothing to do with the other meaning. When convolution is applied to two functions they are said to be &quot;convolved&quot; which is a different word altogether.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-08-21T13:35:47.713" LastActivityDate="2016-08-21T13:35:47.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29760" PostTypeId="2" ParentId="29732" CreationDate="2016-08-21T15:45:33.327" Score="1" Body="&lt;p&gt;It is a big and open ended question. I'll just throw out 2 thoughts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might be interested in looking at the Chicago Mercantile Exchange (CME) SPAN method of margin calculation for option portfolios. It considers the effect of 16 specific combinations of price and vol moves (&quot;price down, vol unch&quot;, &quot;price down, vol up&quot;, etc.) on the portfolio value. Officially the purpose is purely the required margin calculation, but it is somewhat interesting as a user to look at these 16 numbers and understand in which scenario(s) you have the most losses.  It is a good summary of what the portfolio might do in the short term. This could be generalized or adapted in various ways.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, since you are interested in IV changes, I would certainly look at Vega both for the portfolio as a whole and for specific maturity buckets ('short term', medium term', etc.) or individual expiration months. A familiarity with past shifts in the term structure of vol will help to put these Vegas in context.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-08-21T18:20:42.087" LastActivityDate="2016-08-21T18:20:42.087" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29761" PostTypeId="2" ParentId="24720" CreationDate="2016-08-21T23:15:23.573" Score="5" Body="&lt;p&gt;The primary way ECNs determine if a liquidity taker's flow is 'toxic' or not is by looking at aftermath charts.  The aftermath chart shows the average mark-to-market profit of trades done by the liquidity taker as a function of either time or number of top-of-book updates (optionally broken down by currency pair).  The trade profit is usually viewed from the liquidity provider's perspective, and so the aftermath chart is typically equal to half the average bid/ask spread at the inception of the trade, corresponding to the y-intercept of the aftermath chart.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, the time it takes for the aftermath curve to decay to zero represents the average amount of time a liquidity provider has to monetize the spread earned at inception after trading with the given liquidity taker (by matching the trade with another liquidity taker, for example).  If this amount of time is relatively short (typ. a few seconds), then the flow is harder to monetize.  Such flow is considered 'sharp', and very sharp flow is considered 'toxic'.&lt;/p&gt;&#xA;" OwnerUserId="1039" LastActivityDate="2016-08-21T23:15:23.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29763" PostTypeId="2" ParentId="29753" CreationDate="2016-08-22T00:13:26.170" Score="0" Body="&lt;p&gt;You need the components. You could use yahoo or cnn site, and read the table from that. Then get the tickers. Read all to an environment and work with the data.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(XML) &#xA;urlt &amp;lt;- &quot;http://money.cnn.com/data/dow30/&quot; &#xA;doc.html = htmlTreeParse(urlt, useInternal = TRUE)&#xA;tables &amp;lt;- readHTMLTable(doc.html,as.data.frame=FALSE)&#xA;length(tables)&#xA;tables[[2]]&#xA;tables &amp;lt;- readHTMLTable(doc.html,&#xA;                        stringsAsFactors=FALSE,which = 2)&#xA;&#xA;ticker=sapply(1:length(tables$Company),function(xs)&#xA;  strsplit(rawToChar(charToRaw(text[xs])),&quot;Â&quot;,fixed=TRUE)[[1]][1]&#xA;  )&#xA;#ticker &amp;lt;- as.vector(as.character(ticker))&#xA;library(quantmod)&#xA;StockData &amp;lt;- new.env()&#xA;data &amp;lt;- getSymbols(ticker, env = StockData)&#xA;do.call(merge, eapply(StockData, Cl)[ticker])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13571" LastActivityDate="2016-08-22T00:13:26.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29765" PostTypeId="2" ParentId="948" CreationDate="2016-08-22T00:55:44.643" Score="1" Body="&lt;p&gt;Regarding storage, I stream real-time updates for exchange listed contracts (outright + exchange listed calendar spreads) to &lt;a href=&quot;https://influxdata.com/&quot; rel=&quot;nofollow&quot;&gt;InfluxDB&lt;/a&gt;. Its a time-series database, mostly geared towards IT Ops for storing log data, but it works fine with homogeneous finance data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For options strips, due to the sheer amount of data generated per day, I use &lt;a href=&quot;http://discretelogics.com/teafiles/&quot; rel=&quot;nofollow&quot;&gt;TeaFiles&lt;/a&gt;. Pros for using teafiles are that the file sizes are small, and load times are fast. For each .tea file I assign the following strategy: &lt;code&gt;[ContractSymbol]_[Strike]_[CallOrPut]_[Date].tea&lt;/code&gt;. Files are then stored in Azure BLOB storage. Read benchmarks are good; ~25ms to read a file with 300k entries from a C# loader.&lt;/p&gt;&#xA;" OwnerUserId="16028" LastActivityDate="2016-08-22T00:55:44.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29766" PostTypeId="2" ParentId="29572" CreationDate="2016-08-22T00:59:23.447" Score="5" Body="&lt;p&gt;Regarding storage, I stream real-time updates for exchange listed contracts (outright + exchange listed calendar spreads) to &lt;a href=&quot;https://influxdata.com/&quot; rel=&quot;noreferrer&quot;&gt;InfluxDB&lt;/a&gt;. Its a time-series database, mostly geared towards IT Ops for storing log data, but it works fine with homogeneous finance data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For options strips, due to the sheer amount of data generated per day, I use &lt;a href=&quot;http://discretelogics.com/teafiles/&quot; rel=&quot;noreferrer&quot;&gt;TeaFiles&lt;/a&gt;. Pros for using teafiles are that the file sizes are small, and load times are fast. For each .tea file I assign the following strategy: &lt;code&gt;[ContractSymbol]_[Strike]_[CallOrPut]_[Date].tea&lt;/code&gt;. Files are then stored in Azure BLOB storage. Read benchmarks are good; ~25ms to read a file with 300k entries from a C# loader.&lt;/p&gt;&#xA;" OwnerUserId="16028" LastActivityDate="2016-08-22T00:59:23.447" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29767" PostTypeId="2" ParentId="28302" CreationDate="2016-08-22T02:08:06.543" Score="10" Body="&lt;p&gt;A swaption in which the underlying swap starts at a date materially after the expiration date is called a midcurve swaption.  The implied volatilities of these can not be obtained from the regular swaption surface.  Market makers calculate implied volatilities for midcurves in s number of ways.  One popular method is to compute the volatility of the forward swap using the volatilities of two spot starting swaps, and the correlation between them.  For example , consider a midcurve option expiring in 1 year into a swap which starts 5 years later and ends 10 years later.  The correct volatility can be computed from the 1yrx5yr volatility, the 1yrx10yr volatility , and the correlation between 5yr and 10 yr swaps for the next year.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-08-22T02:08:06.543" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="29768" PostTypeId="1" CreationDate="2016-08-22T03:36:33.153" Score="3" ViewCount="116" Body="&lt;p&gt;As you know, real estate crowd funding platforms are taking off at the moment. Platforms connect investors to real estate assets. I am having an issue with understanding how exactly borrower payment dependent notes work. I simply want more details about the SPVs involved. Is the underlying loan simply a loan and not a debt security? Does the platform directly lend the money or do they do it through a different SPV? And then the platform creates a different SPV to which it issues these borrower payment dependent notes? Would the investors then be buying a pro rata share of the SPV? Thank you so much.&lt;/p&gt;&#xA;" OwnerUserId="24074" LastActivityDate="2016-08-25T04:50:43.213" Title="Borrower, platform, SPV relationship with borrower payment dependent notes?" Tags="&lt;debt&gt;&lt;real-estate&gt;&lt;structured-finance&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29769" PostTypeId="2" ParentId="29572" CreationDate="2016-08-22T03:43:23.377" Score="33" Body="&lt;p&gt;All of the answers above (unfortunately highly upvoted at this point) are missing the point. You shouldn't pick a DBMS or storage solution by general performance benchmarks, you should pick it by use case. If someone says they get a &quot;x ms read&quot;, &quot;y inserts per second&quot;, &quot;k times speedup&quot;, &quot;store n TB data&quot; or &quot;have m years of experience&quot; and use that to justify a proposal to you, don't trust that person.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can describe a common breaking point for every single one of the proposed solutions above:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Flat files: This is a bad idea when you start to have many client applications, you have a small team, &lt;em&gt;and/or&lt;/em&gt; you need to access this data in realtime. Even a small team can have hundreds of processes on heterogenous servers hammering the data simultaneously, so you start making this a hardware or file system problem if you store your data in flat files and rely on your own applications to manage concurrent access. Even 10-20 year old RDBMSes do a fairly decent job of managing this that would take nontrivial amount of time for your own developers to replicate. Writing low level concurrent software to deal with network I/O bounds or file system limitations is almost always more expensive than figuring out how to implement a cluster database or sharding with open source tools, and if you have a small team, your developer time is infinitely more valuable than single file query speed. You said that you plan to backtest against the data store - yeah sure, you can backtest at 500 MB/s to 2 GB/s (millions of entries per second, cool!) on a single server with a plain file on a fast SSD, but it's nontrivial to scale this with plain files.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Column-oriented time series database: Most people mistake modern database optimizations with the column-oriented advantages. More modern DBMSes have clever parallel radix hash joins, SIMD-based aggregation operations and the likes which explain their speedup. Say, in theory, a row-oriented DBMS should always outperform a column-oriented DBMS in write speed, but you'd see the reverse in many benchmarks because many column-oriented DBMSes have more modern ways to defer metadata generation or maintain indices. In the end, column-oriented is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i. A bad idea when you almost always &lt;em&gt;fully materialize&lt;/em&gt; your records &lt;em&gt;early&lt;/em&gt;. For example, suppose you are just storing {time, best_bid, best_ask} and you are just selecting all the columns in the time interval $[a,b]$ because you are doing exploratory analysis and don't yet know what function $f(best\ bid, best\ ask)$ you want to work with. First, the cache advantage of sequentially going through the times (stored continguously) in $\mathbb{O}(n)$ loses to the algorithmic advantage of chasing pointers through the index B-tree in $\mathbb{O}(\log n)$. Most column-oriented DBMS architects are aware of this and implement their query optimizers to fall back on the index if the query follows this pattern, so both row-oriented and column-oriented DBMS are evenly matched here. But at the materialization step, the column-oriented DBMS still has to deserialize the separate columns back into row-oriented records, whereas the row-oriented DBMS just writes out the data in storage order and should be faster in theory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ii. Negligible if your query qualifying sets are usually small. The biggest bottleneck is in loading a disk sector into memory. If your qualifying set is small, all of it lies on the same (few) sector(s) regardless of column-oriented or row-oriented layout, so there is no first order speed advantage in column-oriented layout.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;iii. Expensive if you need third party support. There's only a few production strength column-oriented DBMSes, and getting a contractor to help you here is more expensive than getting free quality assistance on MySQL. If you want realtime applications subscribing to your database, chances are you need an expensive commercial solution because all the open-source options have weak support for such functionality.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;NoSQL: Let's say you have 2 companies that decide to merge, which happens very often since you are looking at daily granularity. There's different conventions for handling this, but now how do you update the earnings associated with either company? There's no cascade-style data model in MongoDB, so now you offload the work from database-level to application level. This can be bad for a few reasons, (1) chances are, you hand this task to an analyst to do it for you, who is more prone to mess it up than letting the schema ensure integrity for you, (2) you need to write use-case-specific code to update specific fields in your JSON documents, which is difficult to maintain, (3) MongoDB, proposed above, has a rather inefficient serialization format (BSON) and almost all your applications downstream are going to get bottlenecked by the BSON library at some point.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Here's what I suggest you do: &lt;strong&gt;Stick with PostgreSQL because you are already familiar with it, design your schema in a futureproof way that is easy for you to migrate your data to any future solutions, determine where the performance bottlenecks of your use cases are before asking for a more specific solution.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll have to ask your end users what these bottlenecks are. Is it:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Backtesting&lt;/li&gt;&#xA;&lt;li&gt;Running time range queries (&quot;Get me all the data columns in this time range.&quot;)&lt;/li&gt;&#xA;&lt;li&gt;Running aggregation operations (&quot;I want to find max trade price, calculate total volume etc.&quot;)&lt;/li&gt;&#xA;&lt;li&gt;Concurrent access (&quot;I want to write my backtest results on server A while server B is broadcasting the results to server B and C.&quot;)&lt;/li&gt;&#xA;&lt;li&gt;Maintaining complex relationships (&quot;I need to know all the dividend date revisions and I have to update them frequently.&quot;)&lt;/li&gt;&#xA;&lt;li&gt;Maintaining unstructured relationships (&quot;This asset class has strike prices but this other asset class doesn't.&quot;)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The ideal solution differs depending on your use case.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="4660" LastEditDate="2016-08-22T04:48:46.583" LastActivityDate="2016-08-22T04:48:46.583" CommentCount="17" ContentLicense="CC BY-SA 3.0" />
  <row Id="29771" PostTypeId="2" ParentId="29736" CreationDate="2016-08-22T07:42:47.683" Score="2" Body="&lt;p&gt;Assuming that you&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Have an (or a set of) SDE(s) describing the dynamics of an asset $X$, with $t$-value $X_t$;&lt;/li&gt;&#xA;&lt;li&gt;Define $V$ as a claim contingent on the asset $X$, with $t$-value $V_t$;&lt;/li&gt;&#xA;&lt;li&gt;Define $N$ as a claim that may but need not be contingent on the asset $X$, with $t$-value $N_t$;&lt;/li&gt;&#xA;&lt;li&gt;Define a probability measure $\mathbb{Q}^N$ associated to the asset $N$ such that&#xA;$$ \frac{V_t}{N_t}=\mathbb{E}_t^{\mathbb{Q}^N}\left[\frac{V_T}{N_T}\right] $$&#xA;hence $N$ is regarded as a &lt;em&gt;numéraire&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;then the &lt;em&gt;pricing PDE&lt;/em&gt; directly follows from the measure you've just defined: just use Ito's lemma to impose that the process $V_t/N_t$ should be a $\mathbb{Q}^N$-martingale (martingale representation theorem). Typically, with simple &lt;em&gt;diffusion&lt;/em&gt; processes, this means writing that the finite variation part (drift) should be zero(*). &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;[Example]&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let the $t$-value of an underlying asset $X$ be driven by the following SDE (diffusion)&#xA;$$ dX_t = \mu(t,X_t) dt + \sigma(t,X_t) dW_t^{\mathbb{Q}^B} $$&#xA;and consider the following contingent claims&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$V_t = V(t,X_t)$ &lt;/li&gt;&#xA;&lt;li&gt;$N_t = N(t) = B_t$ with $ dB_t = B_t r dt$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Pick $N$ as a numéraire thereby introducing the pricing measure $\mathbb{Q}^B$ such that&#xA;$$ \frac{V_t}{B_t}=\mathbb{E}_t^{\mathbb{Q}^B}\left[\frac{V_T}{B_T}\right] $$&#xA;we get, applying (bivariate) Itô's lemma:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;d\left( \frac{V_t}{B_t} \right) &amp;amp;= \frac{1}{B_t} dV_t - \frac{V_t}{B_t^2} dB_t + \frac{1}{2}(0)d\langle V \rangle_t + \frac{1}{2}\frac{2V}{B_t^3}\underbrace{d\langle B \rangle_t}_{=0} - \frac{1}{B_t^2} \underbrace{d\langle V, B \rangle_t}_{=0} \\&#xA;&amp;amp;= \frac{1}{B_t} \left( \frac{\partial V}{\partial t} dt + \frac{\partial V}{\partial X} dX_t + \frac{1}{2} \frac{\partial^2 V}{\partial X^2} \underbrace{d\langle X \rangle_t}_{=\sigma^2(t,X_t)dt} - r V dt  \right) \\&#xA;&amp;amp;= \underbrace{\frac{1}{B_t} \left( \frac{\partial V}{\partial t} + \frac{\partial V}{\partial X} \mu(t,X_t) + \frac{1}{2} \frac{\partial^2 V}{\partial X^2} \sigma^2(t,X_t) - r V \right) dt}_{=\text{Finite Variation Part}} + \frac{1}{B_t} \frac{\partial V}{\partial X} \sigma(t,X_t) dW_t^{\mathbb{Q}^B}&#xA;\end{align} &#xA;and setting the finite variation part to zero gives the well-known pricing PDE:&#xA;$$ \frac{\partial V}{\partial t} + \frac{\partial V}{\partial X} \mu(t,X_t) + \frac{1}{2} \frac{\partial^2 V}{\partial X^2} \sigma^2(t,X_t) - r V = 0$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Usually, we change numéraires (for instance move from the traditional risk-neutral measure $\mathbb{Q}^B$ to an underlying asset related measure $\mathbb{Q}^S$) for mathematical convenience: it is sometimes easier to derive closed-form expressions under a different probability measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, I do not directly see the benefits of moving to the measures you mention. So indeed it is possible but there is probably no point doing it, which would explain the lack of papers on the topic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(*) If you instead assume &lt;em&gt;jump-diffusion&lt;/em&gt;, just be careful as jump processes need to be compensated to emerge as martingales. You can have a look &lt;a href=&quot;https://quant.stackexchange.com/questions/18736/how-we-can-derive-pide-of-double-exponential-jump-diffusion-model-we-know-as?rq=1&quot;&gt;here&lt;/a&gt;, where the question is discussed with a very nice and thorough answer by Gordon.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2016-08-22T08:42:12.933" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29772" PostTypeId="2" ParentId="29733" CreationDate="2016-08-22T08:43:26.277" Score="2" Body="&lt;p&gt;The link below is the MATLAB code related to the bearcave pseudo code above. Its very simple to follow. The plotting code at the end just shows the fit of the pox plot so you do not need to implement that part. The rest should be easily implemented in C#.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://uk.mathworks.com/matlabcentral/fileexchange/57388-hurst-exponent-and-linear-fit/content/Hurst.m&quot; rel=&quot;nofollow&quot;&gt;https://uk.mathworks.com/matlabcentral/fileexchange/57388-hurst-exponent-and-linear-fit/content/Hurst.m&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="24040" LastActivityDate="2016-08-22T08:43:26.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29775" PostTypeId="2" ParentId="27713" CreationDate="2016-08-22T15:32:08.380" Score="1" Body="&lt;p&gt;Sharpe ratio behaviour reflects the diversification over time. &#xA;I can diversify using a large number of stocks (ie toss 10 coins simultaneously) or by holding for a large number of periods (ie toss one coin 10 times). &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-08-22T15:32:08.380" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29776" PostTypeId="1" AcceptedAnswerId="29781" CreationDate="2016-08-22T17:05:53.703" Score="2" ViewCount="3527" Body="&lt;p&gt;I sometimes find it difficult to see, how to hedge a portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let say, that I created a product consisting of an Asian call (strike 1), Vanilla call (strike 2), and an Asian Put (strike 1) on a stock called ABC. Now let say the the delta of the total product is 60%, Gamma is 1,5% and Vega is 1,5.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now If I &lt;strong&gt;SHORT&lt;/strong&gt; this &quot;product&quot;, then I can delta-hedge the portfolio by going LONG in the underlying (Stock ABC) by 0,70 for one product I sell.&#xA;I think this is correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what about the gamma and the vega?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I can gamma-hedge as well, but here I cannot just by/sell the underlying. I need an option on the underlying? ANd this option need to have a gamma of 1,5, but do I need to buy or sell the option??&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And waht about Vega?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope you guys can help me!&#xA;Thanks,&lt;/p&gt;&#xA;" OwnerUserId="23921" LastActivityDate="2016-08-23T00:04:46.300" Title="Hedging, Delta, Gamma, Vega" Tags="&lt;hedging&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29777" PostTypeId="1" AcceptedAnswerId="29789" CreationDate="2016-08-22T17:15:51.697" Score="1" ViewCount="2255" Body="&lt;p&gt;The Black 76 model is one of the standard models for interest rate derivatives like pricing caps, floors, swaptions, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Black 76 model is given as $$dF_t = \sigma F_t dW_t$$ so it models the dynamics of the forward rate $F_t$ which implies a certain term structure. Why is the Black 76 model not considered an interest rate model (like Vasicek) in the literature even though it is used for pricing interest rate derivatives?&lt;/p&gt;&#xA;" OwnerUserId="18221" LastActivityDate="2016-08-23T08:31:20.497" Title="Why is the Black 76 model not considered an interest rate model?" Tags="&lt;interest-rates&gt;&lt;modeling&gt;&lt;factor-models&gt;&lt;black76&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29778" PostTypeId="2" ParentId="25757" CreationDate="2016-08-22T17:20:26.803" Score="1" Body="&lt;p&gt;If you're not in negative correlation territory you will not increase expected return over volatility with your negative return asset. Even at zero correlation it will add volatility (in dollar terms) but you need to decrease it to compensate for the decrease in return.&#xA;Then again if you are talking about total expected return rather than the return minus the risk free rate, then a negative return would be fine in so far the risk free rate itself would be even lower (and you could use it to leverage your portfolio).&lt;/p&gt;&#xA;" OwnerUserId="23886" LastEditorUserId="23886" LastEditDate="2016-08-22T17:33:27.443" LastActivityDate="2016-08-22T17:33:27.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29779" PostTypeId="2" ParentId="29776" CreationDate="2016-08-22T20:11:23.740" Score="0" Body="&lt;p&gt;Greeks have a sign as well as a magnitude. You hedge by taking on the opposite of what you have (hedge positive delta with negative delta, and so on). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long put and long call have positive gamma, shorting either of them gives negative gamma. Long put and long call have positive Vega. Finally long call has positive delta, long put has negative delta and long underlying has positive (1.0) delta. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now to answer your question directly: if your portfolio has a Gamma of -1.5 (if I understood your example correctly you have shorted something with Gamma +1.5), so that's a negative number, to hedge you must take onboard some positive Gamma. You can do it by being long a put or long a call.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-08-22T20:20:30.977" LastActivityDate="2016-08-22T20:20:30.977" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29780" PostTypeId="2" ParentId="29687" CreationDate="2016-08-22T22:39:05.280" Score="2" Body="&lt;p&gt;Let $w^*$ be your target wealth and $w_0$ be your initial amount. One very effective strategy one could apply is the following,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Day 1: Bet $w^* - w_0$; if the bet resolves in your favour then you have reached your target wealth and so stop; Else &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Day 2: Bet $2(w^* -w_0)$; if the bet resolves in your favour then you have reached your target wealth and so stop; Else &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Day 3:  Bet $4(w^* -w_0)$; if the bet resolves in your favour then you have reached your target wealth and so stop; Else&lt;/p&gt;&#xA;&#xA;&lt;p&gt;...&#xA;Day N: Bet $2^{N-1}(w^* -w_0)$  if the bet resolves in your favour then you have reached your target wealth and so stop; Else you have insufficient funds to reach your target wealth; i.e. $2w(t) &amp;lt; w^*$ :(&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The number of bets you can place is then $N+1$ where $N$ is the largest integer such that,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ 2 \Big ( w_0 - (w^* - w_0) \sum_{k=0}^N 2^k \Big ) \geq w^*$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The probability of the strategy being successful is then the complement of the strategy failing in each trial,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ 1 - (1-p)^{N+1} $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if probability of success is $p=0.6$, initial amount is $w(0)=w_0 = 100$, and target wealth is $w^* = 105$ then you can place $4$ bets each with the possibility of achieving the target wealth. The probability of success is the complement of the probability of failure which is, $(1-0.6)^4 = 0.0256$ and so probability of reaching your target wealth is $1 - 0.0256 = 0.9744 $ which is pretty good. You can visualize this with a tree diagram and it helps to explain the reasoning. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;All in all, I am not sure if this is optimal but it seems very effective. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I realized also the policy, $f = f(w)$ can be expressed as,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$   w(t+1) = w(t) + \max\{0,w^* - w(t)\}\mathcal{X}_{t+1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for $t \leq T$ with $T$ chosen such that it is the largest integer for which $2w(T-1) \geq w^*$ in all cases, in particular where you lose in every bet. $\mathcal{X}_{t+1}$ is a random variable which takes the values $1$ and $-1$ with appropriate probabilities.&lt;/p&gt;&#xA;" OwnerUserId="24037" LastEditorUserId="24037" LastEditDate="2016-08-22T23:12:32.333" LastActivityDate="2016-08-22T23:12:32.333" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29781" PostTypeId="2" ParentId="29776" CreationDate="2016-08-23T00:04:46.300" Score="2" Body="&lt;p&gt;Greeks are essentially the a set of results under certain scenario analysis and they are 'local' to the market condition you use to price the options in the first place, local meaning the changes of certain market parameters are not huge, 1 percent spot move, 1 vol point move etc. Usually the lower order greeks are easier to hedge, such as Delta. However, the higher order ones are less so, such as vanna and volgamma. If you want to neutralise your gamma, sure buy/sell some short dated options, vega maybe slightly longer dated options. But you will find as the spot and the vol surface change in live market your greeks will change too and you will have to re-hedge again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the end, you need to ask yourself the purpose of carrying your position, are you a market maker who just wants to earn bid/ask spread and carry fairly risk neutral book or you are a buy-side client where you do want to buy and hold certain positions and be exposed to certain risks where you think the opportunities are.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope you find this useful, as I think a conceptual understanding of the purpose of hedging is a prerequisite to an answer with numbers. If you don't like your risk due to a certain option, liquidate that option, don't put on more options to bandaid it and further complicate your book with more strikes and expiries.&lt;/p&gt;&#xA;" OwnerUserId="11773" LastActivityDate="2016-08-23T00:04:46.300" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29784" PostTypeId="2" ParentId="27734" CreationDate="2016-08-23T06:25:58.953" Score="3" Body="&lt;p&gt;The reference papers for market impact decay are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Waelbroeck, H., and Gomes, C. (2013). &lt;em&gt;Is market impact a measure of the information value of trades? market response to liquidity vs. informed trades&lt;/em&gt;. Social Science Research Network Working Paper Series.&#xA;URL &lt;a href=&quot;http://ssrn.com/abstract=2291720&quot; rel=&quot;nofollow&quot;&gt;http://ssrn.com/abstract=2291720&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Brokmann, X., Serie, E., Kockelkoren, J., and Bouchaud, J. P. (2014). &lt;em&gt;Slow decay of impact in equity markets&lt;/em&gt;.&#xA;URL &lt;a href=&quot;http://arxiv.org/abs/1407.3390&quot; rel=&quot;nofollow&quot;&gt;http://arxiv.org/abs/1407.3390&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Bacry, E., Iuga, A., Lasnier, M., and L. (2015). &lt;em&gt;Market impacts and the life cycle of investors orders&lt;/em&gt;. Market Microstructure and Liquidity, 1 (2).&#xA;URL &lt;a href=&quot;http://ssrn.com/abstract=2532152&quot; rel=&quot;nofollow&quot;&gt;http://ssrn.com/abstract=2532152&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The first one uses a database of &quot;cash trades&quot; (ie trade with no specific decision investment), the second one uses a database of the decisions of an hedge fund, and the third one uses a database of institutional decisions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They have the same conclusions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;permanent impact is linked to the investment decision: if you decided to buy to invest and you are a good portfolio manager, the price will ultimately go up. It is not really linked to your impact (even if you would not have traded, the price will have gone up).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;temporary impact decay has two scales: a fast intraday one, and a slow (12 to 20 days) one. This impact reverts to zero.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Point (1) does not mean permanent impact is fully independent from buying / selling pressure. It can come from the cumulative pressure of all participants, it is a &lt;strong&gt;mean field effect&lt;/strong&gt;: these three papers just say an isolated investor / trader cannot move permanently the price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are not convinced by the upper three papers, you can have a look at this one:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Koudijs, P. (2013). &lt;em&gt;'those who know most': Insider trading in 18th c. amsterdam&lt;/em&gt;. Journal of Political Economy, 123 (6), 1356-1409.&#xA;URL &lt;a href=&quot;http://dx.doi.org/10.3386/w18845&quot; rel=&quot;nofollow&quot;&gt;http://dx.doi.org/10.3386/w18845&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;It identifies market impact and decay on trades from the XVIIIth century on Amsterdam stock exchange!&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2016-08-23T06:25:58.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29786" PostTypeId="1" CreationDate="2016-08-23T07:41:02.190" Score="0" ViewCount="6449" Body="&lt;p&gt;The tabel below contains financial statement information from the CBA 2013 annual report.&lt;a href=&quot;https://i.stack.imgur.com/gtyt2.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/gtyt2.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am asked to find the Net interest income and net interest margain:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My answers are as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Net interest income = interest income-interest expense =35-21=14&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Net income margin = (673-632)/673.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure how to calculate net income margin, but would anyone be able to verify whether my&#xA;answers are correct or not.&lt;/p&gt;&#xA;" OwnerUserId="24093" LastActivityDate="2016-08-23T14:08:33.023" Title="Calculating the net interest income and net interest margin" Tags="&lt;interest&gt;&lt;income&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29787" PostTypeId="2" ParentId="29751" CreationDate="2016-08-23T07:42:24.650" Score="2" Body="&lt;p&gt;There's no code for this at this time.  What you can do is clone and modify the &lt;code&gt;FloatingLeg&lt;/code&gt; function in &lt;code&gt;ql/cashflows/cashflowvectors.hpp&lt;/code&gt; so that it takes another frequency for the resets and uses it to build the coupons together with the other inputs. If you only need LIBOR coupons, you can remove the template arguments from the modified functions and use &lt;code&gt;IborCoupon&lt;/code&gt; directly to reduce its complexity.  So yes, you'll repeatedly create the coupons, but you'll write the code only once in the function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you write it, you can call your modified function and pass the returned leg to the &lt;code&gt;Swap&lt;/code&gt; constructor. The fixed leg can be built by the &lt;code&gt;FixedRateLeg&lt;/code&gt; class, declared in &lt;code&gt;ql/cashflows/fixedratecoupon.hpp&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2016-08-23T07:42:24.650" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29788" PostTypeId="2" ParentId="19469" CreationDate="2016-08-23T07:59:51.010" Score="5" Body="&lt;p&gt;I can't say what other HFT operations do, but I can give you a description of how our automated systems worked and that may give some insight into what goes on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From 1999 to 2007 I ran an HFT and Arbitrage trading operation that focused on the US markets. In the early days we were mostly focused on arbitrage between the ECNs and major exchanges, but over time we evolved into a number of different strategies. These included automated liquidity rebate trading, micro movement trades based on order imbalances and a handful of specific arbitrage situations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Effectively, a large part of our trading was ultra short term market making with an added analytic edge. By the mid 2000's a typical day would include roughly $500 to $700 million in transactions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Our algos would look at level 3 data streaming to our colo facilities and use our models to identify specific opportunities as book imbalances occurred or spreads shifted. It is impossible to know for sure, but from close monitoring of the data it seemed like there were many other operations using similar concepts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We knew that our systems worked best within a range of normal conditions. Outside of &quot;Normal&quot; we were more likely to take losses than make profits. Based on our understanding of our trading we built a market monitoring system that triggered what we jokingly called our GTFO signal. I will leave you to guess what the acronym means, but I won't write it here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When GTFO was triggered we removed all our passive orders from the market and actively liquidated our open positions. This would normally cause a moderate loss for us but prevented much larger losses. Note -  the positions we would liquidate were typically half long and half short, but depending on the situation there could be a resulting bullish bias due to adverse selection.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The triggering situations were rare, but I can see how in some cases a portion of the HTF systems would step back from the market and cause a dip in liquidity. Our process was complete within a few seconds and we didn't resume trading until things stabilized or we felt comfortable getting back to work again.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few specific things to note, and understand I can only comment on what we did. We didn't have any systems that would chase the market down or exasperate the move. Honestly, it wasn't worth programming a strategy around situations that only happen once in a great while.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The HFT reaction may contribute to a portion of a drop in liquidity at the beginning of an extreme market event, but from my point of view our participation didn't go past the first few seconds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think there are many other systemic changes that have happened. Non-automated traders have access to a wide variety of tools they didn't have in the past. Stop loss and other triggered orders are extremely common now. Market information also flows very quickly. Everything is faster for everyone in the trading world, not just HFT systems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is pure speculation, but in my mind it makes sense. An extreme market moving event can be caused by a wide variety of things, recently fat finger errors seem to be the most common. These errors cause a sudden reaction in market prices that cause some HFT systems to back away from the market. This can cause some liquidity to dry up. Simultaneously other types of automated systems, mostly Index/ETF component arbitrage systems or correlation arbitrage see this as an opportunity for profits or at the least a need to rebalance. The sudden price shift creates discrepancies between index components and the ETFs based on the indexes. These systems flood the market with aggressive orders to get filled. This eliminates the arbitrage but can cause a shock in the broader market. Pairs and Multiples trades also get distorted as normally correlated symbols get erratically pulled around.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This first set of events moves the market disruption from one or two concentrated symbols where it began out to a wider number of stocks. As this happens risk parameters on many other systems are getting triggered. These can be anything from stop loss orders at a retail level to risk level triggers at hedge funds. No one has a clear idea of what is happening or why, but the market is suddenly going crazy. Time to bail out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rest of the market is also becoming aware that something is going on. CNBC would be making remarks about the sudden crash and would be scrambling to get Nassim Taleb on the show. A portion of the investing/trading public will start to panic and also liquidate their shares. Day traders are either having a field day or crying into their keyboards. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;All of this is happening in a low liquidity environment. The market makers &amp;amp; specialists (those left) will be backing off the market to their outer limits as quickly as possible. Everyone will be focused on getting out. The market will drop fast.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the old days, many similar things would happen when market shocks occurred, but the market functioned at a much slower pace. This gave the broad market a bit longer to absorb the news before everyone's orders hit. Some participants would see the situation as a buying opportunity. There would be a bit more balance to the process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Today every reaction is concentrated into such a small amount of time there is literally no way to understand what is going on as one of these events unfolds. The only rational choice in an extreme situation where you are uninformed is to limit risks by liquidating.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;HFT systems are part of the markets now, but I honestly don't see them as the cause of these events any more than the other participants. As technology speeds up trading, we are going to see more of these events. For the people who want to demonize the HFT traders and make rules to push them out, be careful of what you wish for. The majority of HFT trading is providing the liquidity that Market Makers and Specialists used to be responsible for. If HFT gets kicked out there will be a big hole in the bid/ask spreads. Without the additional market volume those cheap commissions could also go away quickly. Losing the automated trades would be a huge mess for the markets.&lt;/p&gt;&#xA;" OwnerUserId="19959" LastActivityDate="2016-08-23T07:59:51.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29789" PostTypeId="2" ParentId="29777" CreationDate="2016-08-23T08:26:06.833" Score="2" Body="&lt;p&gt;Black's model for interest rate derivatives is a perfectly acceptable starting model for pricing interest rate derivatives in a forward measure using a lognormal distribution assumption with just one time horizon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only caveat is that a model that evolves the forward rate curve through time (in order to price more complex derivatives than a cap/floor) needs a drift adjustment to ensure that the model is arbitrage free. How this should be done was not made clear until the later work of Heath, Jarrow and Morton in about 1990. Hence such models, and especially the lognormal forward rate version, are now classified as HJM models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the real-world, Black's forward rate model is now only used as a translator to convert cap/floor prices to implied volatility and back. Most dealers price and risk-manage using models which take the interest rate volatility skew into account such as SABR and stochastic/local volatility models.&lt;/p&gt;&#xA;" OwnerUserId="12240" LastEditorUserId="12240" LastEditDate="2016-08-23T08:31:20.497" LastActivityDate="2016-08-23T08:31:20.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29790" PostTypeId="1" AcceptedAnswerId="29819" CreationDate="2016-08-23T08:45:39.107" Score="0" ViewCount="460" Body="&lt;p&gt;I need to categorize a BondFuture trade in one of the five major asset classes  and I am not sure if it should put it to the interest rate asset class or the credit asset class.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A quick (and dirty) thought it to split the bond trade to an IR swap and a CDS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, buying a fixed rate bond could be 'linked' with going short on an IR Swap and short a CDS on the issuer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any other ideas? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="22383" LastActivityDate="2016-12-07T16:08:51.537" Title="Is a bondfuture an IRD or a Credit Derivative?" Tags="&lt;interest-rates&gt;&lt;fixed-income&gt;&lt;credit&gt;&lt;banking-regulations&gt;" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29791" PostTypeId="1" CreationDate="2016-08-23T11:55:22.777" Score="4" ViewCount="515" Body="&lt;p&gt;I am trying to apply SABR on EUR inflation caplets, with positive forward and negative strikes. Classical BS pricing is undefined, and so is SABR. I have read about the shifted SABR, which is supposed to accept negative strikes, but I was wondering whether anyone is aware of an existing implementation on Matlab for instance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have fitted the standard SABR parameters on positive strikes and modified some existing SABR code, adding the shift to the strike and the forward rate in the volatility equation. Now, I am feeding this modified volatility equation with my negative strikes and forward + the fitted SABR parameters, but nothing seems to have changed: it is still impossible to compute vols for negative strikes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I have to feed the original strikes to the shifted model or the shifted strikes ? Do I have to shift the forward as well ? Is anyone aware of a better procedure for using the shifted SABR with negative rates? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot !&lt;/p&gt;&#xA;" OwnerUserId="24032" LastActivityDate="2018-10-06T13:00:45.787" Title="Shifted SABR for negative strikes" Tags="&lt;option-pricing&gt;&lt;stochastic-volatility&gt;&lt;volatility-smile&gt;&lt;sabr&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29795" PostTypeId="2" ParentId="29786" CreationDate="2016-08-23T14:08:33.023" Score="1" Body="&lt;p&gt;You are a bank (or a bank like institution) that makes money from a portfolio of assets (such as loans) which are financed by liabilities (such as deposits or interbank loans).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Net Interest Income is how much you make on your assets after subtracting your cost of financing those assets, so we have 35-21 = 14.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your Net [Interest] Income Margin is how much money you make through this process expressed as a percentage of assets. How to measure the assets? A simple approach is the assets at the beginning of the period, i.e. 645. However I believe the professional standard is the average assets during the year which would be (645+673)/2. We would then have NIM = 14/659 = 2.12%&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2016-08-23T14:08:33.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29796" PostTypeId="1" CreationDate="2016-08-23T15:37:30.890" Score="2" ViewCount="1765" Body="&lt;p&gt;I'm trying to calculate the implied forward rates of the Eurodollar (USD) curve, knowing that the Eurodollar curve is supposed to be a &lt;em&gt;mirror&lt;/em&gt; of the yield curve (else arb).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have this formula for the value of the strip:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Strip = \displaystyle \frac{\prod_{i= 1}^{n}\bigg(1 + R_i \cdot \big(\frac{days_i}{360} \big) \bigg) - 1}{\frac{term}{360}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using this for current values of LIBOR, I have /GEZ6, /GEH7, /GEM7, /GEU7 to replicate a 1-year forward curve. The rates are $R_1 = 93.5bp$, $R_2 = 95bp$, $R_3 = 98bp$, $R_4 = 101bp$. Using this formula gives me the value of the strip at 97.2 basis points, which I'm confident is wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I value the 1-year interest rate forward at December? &lt;/p&gt;&#xA;" OwnerUserId="20194" LastActivityDate="2016-08-24T16:29:39.707" Title="Calculating Implied Forward Rates from Eurodollar Futures Quotes" Tags="&lt;interest-rates&gt;&lt;interest-rate-swap&gt;&lt;libor&gt;&lt;eurodollars&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29797" PostTypeId="1" AcceptedAnswerId="29844" CreationDate="2016-08-23T16:26:46.247" Score="0" ViewCount="102" Body="&lt;p&gt;I am trying to predict change in VaR on a DoD basis. So let's say at t=0, I have my VaR based on full valuation. On t=1, I will have another VaR based on full valuation. I am trying to predict this VaR on t=1 without full valuations. I also have Composite VaR and Incremental VaR at t=0. At t=1, I will also know how my risk factors have changed and if there is any new or dropped trades in my portfolio as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What will be the best way to proceed? Links to any reference material will also be highly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="20162" LastActivityDate="2016-08-25T17:45:24.297" Title="How to predict VaR changes on a DoD basis?" Tags="&lt;risk&gt;&lt;var&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29798" PostTypeId="1" AcceptedAnswerId="29799" CreationDate="2016-08-23T17:07:48.590" Score="0" ViewCount="54" Body="&lt;p&gt;can someone please let me know how to translate a performance return from USD to EUR. For instance, I have a time series (return) over 7 years from an US hedge fund and would like to translate it into EUR return. I am not interested in any form of hedging, I just need the return to be denominated in EUR&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much!&lt;/p&gt;&#xA;" OwnerUserId="16091" LastActivityDate="2016-08-23T18:13:15.407" Title="translating performance from EUR to USD" Tags="&lt;index&gt;&lt;currency&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2016-08-24T07:16:21.017" ContentLicense="CC BY-SA 3.0" />
  <row Id="29799" PostTypeId="2" ParentId="29798" CreationDate="2016-08-23T17:31:59.480" Score="1" Body="&lt;p&gt;First you build a total return index for the HF starting at say 100 so it might look like {100,105,...} if the first period return is 5% etc. These are the dollar amounts owned by an US investor who started with 100 USD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you translate these numbers into EUR by dividing by the time series of historical EURUSD exchange rates which might look like {1.3125,1.2745,...).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you compute the EUR returns from these EUR prices by the usual formula $\frac{P_{t+1}-P_t}{P_t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. If you do the algebra on the above procedure you will see that the EUR returns are $-1+\frac{e_{t-1}}{e_t}(1+r_t)$ for t = 1 to n, which however may be more difficult to remember than the straightforward steps above.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-08-23T18:13:15.407" LastActivityDate="2016-08-23T18:13:15.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29802" PostTypeId="1" CreationDate="2016-08-23T22:08:29.213" Score="0" ViewCount="137" Body="&lt;p&gt;I am reviewing the Fortune 1000 list of companies. Is there a reliable way using information from EDGAR filings to determine which of these companies are primarily acting as regulated public utilities?&lt;/p&gt;&#xA;" OwnerUserId="18606" LastActivityDate="2016-09-23T14:30:45.527" Title="Fortune 1000 companies: which are public utilities?" Tags="&lt;equities&gt;&lt;edgar&gt;&lt;classifier&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29803" PostTypeId="2" ParentId="29802" CreationDate="2016-08-23T22:18:01.450" Score="3" Body="&lt;p&gt;Here is a list you can download from NASDAQ.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.nasdaq.com/screening/companies-by-industry.aspx?industry=Public%20Utilities&quot; rel=&quot;nofollow&quot;&gt;Nasdaq Industry List&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="24106" LastActivityDate="2016-08-23T22:18:01.450" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29804" PostTypeId="1" AcceptedAnswerId="29806" CreationDate="2016-08-24T02:42:21.680" Score="2" ViewCount="4308" Body="&lt;p&gt;I was recently trying to price some IR swaps in BBG. I noticed that when I shock the yield curve up by 1bps at a single specific node, the DV01 is close to zero except at the node nearest the maturity. Nearly 100% of the DV01 for a parallel shift comes from the shock to the node near maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't really understand this, since I would expect every node to have similar risk, perhaps slightly increasing the further away you are.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see this trend with every IR Swap that I look at.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly I am missing some understanding of the exposure of IR Swaps, could anyone here help me?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: I'm looking at the combined legs in this case.&lt;/p&gt;&#xA;" OwnerUserId="24110" LastActivityDate="2016-08-24T15:26:37.903" Title="IR Swaps - Curve sensitivity at maturity node" Tags="&lt;risk&gt;&lt;bloomberg&gt;&lt;interest-rate-swap&gt;&lt;sensitivities&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29805" PostTypeId="2" ParentId="29804" CreationDate="2016-08-24T05:14:45.120" Score="0" Body="&lt;p&gt;For simplicity, let's consider the government par yield curve (ignoring nuances such as market conventions, OIS discounting, etc., this is conceptually equivalent to the par swap curve). The par curve, by definition, represents the yields &amp;amp; coupon rates of bonds trading at par ($100). Now let's shock the 10-year par rate by 100bp, while holding all other points on the par curve unchanged. So after this shock, how much should the value of the 30-year par bond change by? Zero. This is because after shocking the par curve, you continue to &lt;strong&gt;ASSUME&lt;/strong&gt; that the new curve is still a par curve. So by definition, the 30-year par rate still represents the yield/coupon of a bond trading at 100. There's virtually no sensitivity elsewhere – &quot;by definition.&quot;&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2016-08-24T05:42:45.570" LastActivityDate="2016-08-24T05:42:45.570" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29806" PostTypeId="2" ParentId="29804" CreationDate="2016-08-24T07:57:46.070" Score="2" Body="&lt;p&gt;The value of a $T$ year payer swap on a coupon payment date at time $t$, or a new swap that is about to be traded today time $t$, is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V(t) = (S(t,T)-C) \sum_{i=1}^N Z(t_i) \Delta_i$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $C$ is the swap coupon, $S(t,T)$ is the current market swap rate to the swap maturity time $T$, $Z(t_i)$ is a LIBOR discount factor to time $t_i$ and $\Delta_i$ is the year fraction over $[t_{i-1},t_i]$. We assume annual coupons so set $\Delta_i=1$ for simplicity so that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V(t) = (S(t,T)-C) \sum_{i=1}^N Z(t_i)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bumping the swap curve can change the $T$-maturity market swap rate $S(t,T)$ and the discount factors $Z(t_i)$. Suppose we bump the $S(t,T^*)$ rate where $T^{*}$ is one of the input swap rates used to construct the curve. This is done in a way that keeps ALL other input swap rates CONSTANT. To first order we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$${\partial V(t)}/{\partial S(t,T^{*})} = \frac{\partial S(t,T)}{\partial S(t,T^*)} \sum_{i=1}^N Z(t_i)  + (S(t,T)-C) \times \sum_{i=1}^N \frac{\partial Z(t_i)}{ \partial S(t,T^{*})}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the DV01 equals ${\partial V(t)}/{\partial S(t,T^{*})} \times 1$ basis point. The second term is multiplied by $(S(t,T)-C)$ and so if the market swap rate is close to the swap coupon, i.e. $S(t,T) \simeq C$, this term will be small. For a new swap the second term is exactly zero as $C=S(t,T)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now consider an example.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;We build our curve from 1Y, 2Y, 3Y, 4Y, 5Y swap rates and we are valuing a $T=5$ year swap. The value of $T^{*}$ can be $1,2,3,4$ or $5$. Consider then two scenarios:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I) $T^{*}=T$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The term of the bumped swap rate and swap are same. Suppose $T=5$ and $T^{*}=5$ then &#xA;$\partial S(t,T)/\partial S(t,T^*)=1$. Also, bumping $S(t,T^{*}=5)$ will lower discount factors between 4Y and 5Y. This means that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\partial V(t) / \partial S(t,T^{*}) = \sum_{i=1}^N Z(t_i) + (S(t,T)-C) \times \sum_{i=1}^N \frac{\partial Z(t_i)}{ \partial S(t,T^{*})}$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second term will usually be small, especially for a new swap, so we can write $\partial V(t) / \partial S \simeq \sum_{i=1}^N Z(t_i)$. This term is usually known as the swap PV01.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;II) $T^{*} &amp;lt;&amp;gt; T$. The term of the bumped swap rate and swap are different. Consider $T=5$ and $T^{*}=4$ then &#xA;$\partial S(t,T)/\partial S(t,T^*)=0$. Also, bumping $S(t,T^{*}=4)$ will only lower discount factors between 3Y and 4Y but those between 4Y and 5Y will  need to rise to compensate so that the 5Y rate is still matched. The effect at 5 years on the sum of the discount factors will be almost cancelling. This means that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\partial V(t) / \partial S(t,T^{*}) = 0 + (S(t,T)-C) \times \sum_{i=1}^N \frac{\partial Z(t_i)}{ \partial S(t,T^{*})}$$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second term will be very small due to partially offsetting changes in the discount factors, and especially if the swap rate is close to its initial coupon.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;So in summary, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For an existing swap&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If $T^{*} = T$, the DV01 is approximately equal to the swap PV01 &lt;/li&gt;&#xA;&lt;li&gt;If $T^{*} &amp;lt;&amp;gt; T$, the swap DV01 will be close to zero. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For a new swap &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If $T^{*}=T$ the DV01 exactly equals the swap PV01 &lt;/li&gt;&#xA;&lt;li&gt;If $T^{*} &amp;lt;&amp;gt; T$ the swap DV01 is exactly zero.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="12240" LastEditorUserId="12240" LastEditDate="2016-08-24T15:26:37.903" LastActivityDate="2016-08-24T15:26:37.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29807" PostTypeId="2" ParentId="29804" CreationDate="2016-08-24T09:38:09.697" Score="0" Body="&lt;p&gt;First of all, what are your values of swap rate ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the mono curve case where $r$ stands for the curve, and $B^r(T)$ is the zero-coupon bond of maturity $T$ associated to the curve $r$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{PV}_{\text{swap}}(r)=1-B^r(T) - k_0\times\sum_{i=1}^n\delta_i B^r(t_i)=0$$&#xA;the $=0$ is because $k_0$ is designed to have the pv at zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So now, you want to compare &#xA;$$\text{DV01}(\text{swap}) = \text{PV}_{\text{swap}}(r+\epsilon\text{ parallel shift})-\text{PV}_{\text{swap}}(r)$$&#xA;and&#xA;$$\text{Bump}(\text{swap},t)=\text{PV}_{\text{swap}}(r+\epsilon\text{ bump on $t$ node of the yield curve})-\text{PV}_{\text{swap}}(r)$$&#xA;I assume that what you call yield curve is such that:&#xA;$$r : t \to r(t)\text{ st }B(t) = \frac{1}{(1+r(t))^t}$$&#xA;since to compute above quantities, you need to evaluate them on $B$ let us focus on:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Bump}(B(T),t)=\text{PV}_{B(T)}(\text{bumped } r : s \to r(s) \text{ if }s\neq t \text{ and }r(s)+\epsilon\text{ if }s=t)-\text{PV}_{B(T)}(r)$$&#xA;by definition of $B$ and $r$, you get:&#xA;$$\text{Bump}(B(T),t)=0 \text{ if }t\neq T \text{ and }-\epsilon \frac{T}{1+r(T)}B(T)\text{ if }t=T$$&#xA;from that you easily see that:&#xA;$$\text{DV01}(B(T)) =\text{Bump}(B(T),T)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and thus you get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{DV01}(\text{swap}) = -\text{Bump}(B(T),T) - k_0\times\sum_{i=1}^n\delta_i \text{Bump}(B(t_i),t_i)$$&#xA;if $k_0 T$ is small relatively to $1$ then you can prove that the $k_0$ part is small relatively to $\text{Bump}(B(T),T)$&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-08-24T09:38:09.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29808" PostTypeId="1" CreationDate="2016-08-24T09:51:41.533" Score="-1" ViewCount="2434" Body="&lt;p&gt;I have calculated an optimal portfolio, using a historical covariance matrix, and determined the weights of n risky assets in the optimal portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The utility function I minimize is represented by &#xA;$$U(w)=w^T \mathbb{E}(R)-A\frac{1}{2} w^T \mathbb{V}(R)\, w.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am wondering what makes certain assets receive high weights, and what makes certain assets receive low weights?&lt;/p&gt;&#xA;" OwnerUserId="24115" LastEditorUserId="2299" LastEditDate="2017-05-14T12:16:44.733" LastActivityDate="2017-05-14T12:16:44.733" Title="Understanding the Weights of an Optimal (Mean-Variance) Portfolio" Tags="&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29810" PostTypeId="2" ParentId="29808" CreationDate="2016-08-24T10:58:29.930" Score="1" Body="&lt;p&gt;Assuming you are minimising variance/standard deviation of the portfolio, then you are trying to allocate more weights towards less risky assets. You can try this if you create the covariance matrix yourself: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; c&#xA;     [,1] [,2] [,3]&#xA;[1,]  3.0  0.0 -0.1&#xA;[2,]  0.0  6.0  0.2&#xA;[3,] -0.1  0.2  1.0&#xA;&amp;gt; myPack::globMin(c)&#xA;Calucalated:&#xA;myPack::globMin(cov = c)&#xA;&#xA;Expected return:     0.05 &#xA;Standard deviation:  0.8137612 &#xA;Weights:&#xA;asset 1 asset 2 asset 3 &#xA; 0.2430  0.0881  0.6689 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So you see that if I put large variance for the asset (large diagonal element that represents the variance of the asset itself - risk) it is allocated lower weight for the global minimum variance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quite interesting is discussion about this in terms of eigenvectors of the covariance matrix and Random Matrix Theory application, for instance in &lt;a href=&quot;https://www.math.nyu.edu/faculty/avellane/LalouxPCA.pdf&quot; rel=&quot;nofollow&quot;&gt;Laloux&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="22237" LastActivityDate="2016-08-24T10:58:29.930" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29811" PostTypeId="1" CreationDate="2016-08-24T11:02:12.283" Score="2" ViewCount="260" Body="&lt;p&gt;In his book '&lt;em&gt;Stochastic Calculus for Finance II&lt;/em&gt;' Shreve uses the term: '&lt;strong&gt;Short Option Hedging Portfolio&lt;/strong&gt;' on page.156 (4.5.3). Can someone please explain this term with some kind of an example?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is preventing me from understanding why Portfolio Value evolution is equated with Option Value Evolution to derive the Differential Equation of Black-Scholes-Merton.&lt;/p&gt;&#xA;" OwnerUserId="24118" LastEditorUserId="467" LastEditDate="2017-02-09T05:31:07.547" LastActivityDate="2017-02-09T16:40:08.607" Title="What is a Short Option Hedging Portfolio?" Tags="&lt;black-scholes&gt;&lt;portfolio&gt;&lt;european-options&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29812" PostTypeId="2" ParentId="29797" CreationDate="2016-08-24T12:30:41.897" Score="0" Body="&lt;p&gt;Monte Carlo simulation comes to mind: Run a number of simulations. In each simulation, for each of your variables (risk factors, new/dropped trades etc.), pick an outcome according to the (assumed or known) probability distribution. For this set of outcomes, calculate VaR (as best you can - Monte Carlo can be used here as well, you might have faster ways depending on your exact scenario). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From this set of simulated VaRs, you can calculate not only the most probably VaR value, but also the confidence interval (the more simulations you run, the smaller it will get).&lt;/p&gt;&#xA;" OwnerUserId="20272" LastActivityDate="2016-08-24T12:30:41.897" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29814" PostTypeId="2" ParentId="29804" CreationDate="2016-08-24T15:10:15.230" Score="2" Body="&lt;p&gt;This is a common confusion, and it comes down to the difference between forward rates and swap rates. Swap rates are essentially the integral of forward rates (just like zero coupon rates).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The behaviour you're seeing is easy to understand if you think about the effect on the &lt;em&gt;forward&lt;/em&gt; rates of bumping a &lt;em&gt;swap&lt;/em&gt; rate. Here's a sketch of some implied forward rates for a swap curve built from 1y, 2y, 3y, 4y, and 5y swaps:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/7XvNK.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/7XvNK.png&quot; alt=&quot;Swap curve showing effect of bumping 4y point.&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose I bump the 4y swap rate only. The dotted line shows the new forward rates.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Forward rates up to 3y won't move at all, since they must continue to reprice the existing swap rates up to 3y.&lt;/li&gt;&#xA;&lt;li&gt;Thus, to increase the implied 4y rate, the forward rates must increase between the 3y and 4y swap maturities.&lt;/li&gt;&#xA;&lt;li&gt;We didn't move the 5y swap rate, so the forward rates between 4y and 5y need to &lt;em&gt;decrease&lt;/em&gt; to compensate for the heightened rates between 3y and 4y.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Now consider the effect of this perturbation on the value of a swap (where we receive the floating leg). It all depends on how much of the forward rate perturbation is sampled by the swap in question:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If the swap maturity is 3y or less it will show no effect at all, since none of the forward rates it depends on fall in the perturbed region.&lt;/li&gt;&#xA;&lt;li&gt;If the maturity is between 3y and 4y the value of the swap will increase, and more so the closer the maturity is to the 4y point, as this samples more of the positively shifted region.&lt;/li&gt;&#xA;&lt;li&gt;If the maturity is between 4y and 5y the value of the swap will &lt;em&gt;also&lt;/em&gt; increase, but the change will tend to zero as the maturity tends to 5y because we increasingly sample the negatively shifted region (offsetting the positive contribution from 3y-4y).&lt;/li&gt;&#xA;&lt;li&gt;If the maturity is greater than 5y we see no effect, as we fully sample both the positively and negatively shifted regions, which cancel each other out.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Thus, only swaps with maturity between 3y and 5y will show sensitivity to the 4y point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Conversely, a swap with maturity between 3y and 4y will show sensitivity to the 3y and 4y points, and nothing elsewhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the exact results depend on the particular interpolation scheme used - smoother interpolators will tend to result in more dispersed forward rate perturbations.&lt;/p&gt;&#xA;" OwnerUserId="7533" LastEditorUserId="7533" LastEditDate="2016-08-24T15:17:58.550" LastActivityDate="2016-08-24T15:17:58.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29815" PostTypeId="1" AcceptedAnswerId="29817" CreationDate="2016-08-24T16:00:13.400" Score="0" ViewCount="67" Body="&lt;p&gt;I was wondering if someone is aware of the application when pdes of the form arise&#xA;$$u_t+u_{xx}+g=0$$&#xA;i.e. there is a source term now. Any financial instruments that have this type of pde?&lt;/p&gt;&#xA;" OwnerUserId="22823" LastActivityDate="2016-08-25T08:33:32.343" Title="parabolic pde with source term" Tags="&lt;parabolic-pde&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29816" PostTypeId="2" ParentId="29796" CreationDate="2016-08-24T16:22:56.053" Score="2" Body="&lt;p&gt;What you have calculated, correctly as far as I can tell, is a December-starting 1-year compounded &lt;strong&gt;Libor 3m&lt;/strong&gt; forward rate. That's a weird-sounding thing, but it is essentially equivalent to a December-starting 1-year forward &lt;strong&gt;swap rate vs Libor 3m&lt;/strong&gt;. (I've just priced exactly this against a live USD Libor 3m yield curve and I get 97.3 bp.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, &lt;strong&gt;this should not be expected to be comparable to the 1y Libor rate over the same period&lt;/strong&gt;. There is a systematic &quot;basis spread&quot; between 1y and 3m Libor rates, primarily driven by the greater credit risk premium demanded for longer-term lending (thus 1y Libor rates are systematically higher than 3m Libor rates over the same period). That basis is traded through tenor basis swaps, which allow (for example) a stream of 1y Libor payments to be swapped into a stream of 3m Libor payments plus a fixed spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently, for a 1-year spot-starting basis swap paying 1y Libor vs 3m Libor, that spread is quoted at around 60 bp. Add that on to your compounded 3m rate, and you're in the ballpark of the current level of 1y Libor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The tenor basis is a subtle subject. Try this paper which includes a literature review of the topic:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.qfrc.uts.edu.au/research/research_papers/rp348.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.qfrc.uts.edu.au/research/research_papers/rp348.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7533" LastEditorUserId="7533" LastEditDate="2016-08-24T16:29:39.707" LastActivityDate="2016-08-24T16:29:39.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29817" PostTypeId="2" ParentId="29815" CreationDate="2016-08-24T16:59:17.090" Score="2" Body="&lt;p&gt;$$u(t,x)=\mathbb{E}\left[h(B_T)+\int_t^Tg(B_s)ds|B_t=x\right]$$&#xA;where $B$ is a brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you enter a contract whose underlying asset is $B$, such that you pay every day $t$, $-g(B_t)dt$ up to time $T$ where you receive $h(B_T)$, then the value of this contract is $u$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\partial_t u + \frac{1}{2}\partial_{xx}u + g = 0$$ there is $\frac{1}{2}$ in front of $\partial_{xx}u$ same for my comment below. &lt;/p&gt;&#xA;" OwnerUserId="20201" LastEditorUserId="20201" LastEditDate="2016-08-25T08:33:32.343" LastActivityDate="2016-08-25T08:33:32.343" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="29818" PostTypeId="2" ParentId="27749" CreationDate="2016-08-24T16:59:37.140" Score="1" Body="&lt;p&gt;You use quoted market &lt;strong&gt;swap rates&lt;/strong&gt;. Once you reach the end of the Eurodollar strip, about 3 years out, swaps are the most liquid source of information about expected future Libor rates. Since swap rates are essentially long-term averages of Libor rates, you have to solve for the implied forward Libor rates (sometimes called &quot;bootstrapping the yield curve&quot;, but more commonly now it's a global solving problem).&lt;/p&gt;&#xA;" OwnerUserId="7533" LastActivityDate="2016-08-24T16:59:37.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29819" PostTypeId="2" ParentId="29790" CreationDate="2016-08-24T17:11:11.613" Score="1" Body="&lt;p&gt;It depends on the issuer: if it's a corporate then this would be considered a credit derivative, if it's a highly rated sovereign it would be an interest-rate derivative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I am aware there are no futures currently traded on corporate bonds.&lt;/p&gt;&#xA;" OwnerUserId="7533" LastActivityDate="2016-08-24T17:11:11.613" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29820" PostTypeId="2" ParentId="29790" CreationDate="2016-08-24T17:40:30.920" Score="1" Body="&lt;p&gt;There is no doubt that it is an interest rate derivative. A credit derivative will have specific credit events in its term sheet such as bankruptcy, failure to pay, obligation acceleration, repudiation, restructuring etc ... that will cause the contract to trigger. There is no such event in a bond futures contract term sheet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is true that the sovereign issuer of the bond underlying a bond futures contract could (though it is extremely unlikely) default. However from the perspective of the holder of a bond futures contract, that would simply cause a large price movement in the futures contract. It would not make the bond futures contract trigger.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most of the complexity of a bond futures contract comes from the determination of the cheapest-to-deliver. This is based on the term structure of yields and the basket of deliverable bonds. All of the required understanding of a bond future is based on interest rate issues. None of these would be handled via a CDS or interest rate swap.&lt;/p&gt;&#xA;" OwnerUserId="12240" LastEditorUserId="12240" LastEditDate="2016-08-24T17:46:23.307" LastActivityDate="2016-08-24T17:46:23.307" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="29821" PostTypeId="2" ParentId="29811" CreationDate="2016-08-24T17:43:04.900" Score="1" Body="&lt;p&gt;Recognizing that there are both long and short hedge portfolios, the &#xA;long portfolio involves combining  a long stock position with $\beta$ (it is unknown) written call options on the stock. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The hedge is created by selling just enough calls to offset changes in the value of the stock position. This portfolio will involve a net investment of funds because the premium income received from writing the calls will not be sufficient to purchase the stock position.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Similarly, the short hedge portfolio involves shorting the stock,&#xA;  buying call options to hedge the position against upward changes in&#xA;  the stock price, and investing the balance of the funds in a risk-less&#xA;  asset.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Observe that, for both the long and short hedge portfolio, as the stock price changes the option hedge has to be continuously adjusted to maintain the hedge position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to determine the number of call options to buy, let $V=\beta C-S$ &#xA;be the value of the hedge portfolio. From the hedge portfolio construction:&#xA;$$\frac{\partial V}{\partial S}=\beta\frac{\partial C}{\partial S}-1=0\implies \beta=\frac{1}{\frac{\partial C}{\partial S}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given this specification for $\beta$, the change  in  the  value of risk-less hedge&#xA;portfolio will earn the risk-less rate of interest (this follows from the assumption that interest ).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of arbitrage portfolios, this condition is necessary in order to &#xA;prevent the execution of arbitrage trades by either borrowing at the risk-less rate and buying the hedge portfolio or selling the hedge and investing the funds at the riskless rate.&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastActivityDate="2016-08-24T17:43:04.900" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29823" PostTypeId="1" AcceptedAnswerId="29829" CreationDate="2016-08-24T20:51:34.570" Score="2" ViewCount="2598" Body="&lt;p&gt;I seem to be confused on this topic. So I write my SDE without a drift to make it simple: $$dX_t=dW_t$$ and before I get to any finance there is a relation&#xA;that the solution to $$u_t+0.5u_{xx}-ru=0$$ can be written as an expectation&#xA;$$\mathbb{E}[e^{-rT}f(X_T)]$$ at time 0. Expectation is written in a measure where $W_t$ is defined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we look at finance and say that if we choose a BM under RN measure this expectation resembles RN formula! Did not change anything about the PDE, we just gave a name to a measure. But what if I started choosing $W_t$ in a different measure, say associated with a numerraire $N_t$ with $dN_t=adt+bdW_t$? Then I get from finance arguments the price of a derivative &#xA;$$u(t,x)=\mathbb{E}^N[N(t)/N(T)f(X_T)]$$&#xA;There is no discounting anymore, so can I still apply FC and get a different PDE? So the pde derived using Feynman Kac formula looks different for different choice of measures?&lt;/p&gt;&#xA;" OwnerUserId="22823" LastEditorUserId="22823" LastEditDate="2016-08-24T21:52:44.373" LastActivityDate="2016-08-26T13:58:53.130" Title="Feynman Kac and choice of measure" Tags="&lt;option-pricing&gt;&lt;stochastic-processes&gt;&lt;parabolic-pde&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29824" PostTypeId="1" CreationDate="2016-08-24T21:34:50.977" Score="3" ViewCount="1804" Body="&lt;p&gt;I'm reading about latency arbitrage in regards to direct exchange feeds vs. SIP feeds. SIP feeds are on average 1 millisecond slower than direct feeds, which allows HFTs to see an NBBO update before the SIP reflects that update.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All I'm seeing is that HFTs rely on ISOs to react to NBBO changes, and there's no arbitrage mechanism to actually lock in a risk-free profit. For example, suppose TSLA is currently trading \$200.00 bid at \$200.05 offer. A large buyer comes in and knocks out the \$200.05 offer, so the new best offer is now \$200.06. Knowing the next marketable buy order that comes in will be trading against the new \$200.06 offer, an HFT can send ISOs to sell/short TSLA at \$200.06, guaranteeing to be first in line to execute at the new price level. But what's the arbitrage mechanism to close out the trade? The HFT will have sold/shorted shares of TSLA at \$200.06, but it's really only an arbitrage if they have bought it at a lower price before sending the ISO or can guarantee to buy at a lower price in the future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems like everyone is defining 'latency arbitrage' to be the informational advantage that those with lower latencies have, but really the definition of arbitrage is that you're making a risk-free profit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Here's another (different) latency arbitrage example I found:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;NBBO is determined by the SIP (consolidated) feed, which is about 1 ms slower than the direct feed from an exchange E. A HFT with a direct feed to E will detect, for e.g. the raising of the bid above the NBBO, before everyone else, and send a sell/short Intermarket Sweep Order to E to take out that bid. By the time the order arrives at E, E will have the official NBB (since SIP has finally been updated), and so the order is allowed to execute there, and will likely be filled because it is first-in-line.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In this second example, seems like the 'arbitrage' is that you're able sell using an ISO at the new higher bid. But arbitrage is really only arbitrage if you are guaranteed to have bought at a lower price earlier. If you're already an HFT market maker, how is selling with an ISO at the higher bid any better than selling at the offer with a limit order?&lt;/p&gt;&#xA;" OwnerUserId="24123" LastEditorUserId="24123" LastEditDate="2016-08-25T04:52:45.173" LastActivityDate="2016-08-25T09:23:16.197" Title="Latency arbitrage: what exactly is the arbitrage mechanism?" Tags="&lt;arbitrage&gt;&lt;high-frequency&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29825" PostTypeId="1" CreationDate="2016-08-24T22:40:10.547" Score="1" ViewCount="314" Body="&lt;p&gt;A company has to hold an underlying asset for one year and it is looking to use Brent Crude futures to hedge against changes in the underlying asset's price.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Assuming there is no liquidity concerns in Brent Crude futures of all expiries, would it always make more sense to match the maturity of the futures and the underlying asset? (i.e. taking short position in one-year futures in this case). Or, for example if the 3-month futures show the highest $R^2$ between the futures' and underlying asset's historical price changes, are you willing to engage in a rolling hedge even when it means additional basis risk every time you rollover?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In running the regression of futures' and the underlying asset's price changes to estimate the optimal hedge ratio, is it better to use daily, weekly or monthly price? What is the most common industry practice and is there any justification for that?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thank you so much in advance!&lt;/p&gt;&#xA;" OwnerUserId="24124" LastEditorUserId="20913" LastEditDate="2016-11-23T06:15:41.350" LastActivityDate="2018-05-17T16:52:13.927" Title="Two questions regarding cross-hedge" Tags="&lt;futures&gt;&lt;hedge&gt;&lt;optimal-hedge-ratio&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29826" PostTypeId="2" ParentId="29825" CreationDate="2016-08-25T00:08:50.113" Score="1" Body="&lt;p&gt;What you call additional basis risk is unpredictable. It may win or lose in rolling strategy against buying 1 year futures once. But what is measurable is bid/offer spread. In 1 y contract it might be significantly wider that in quarter futures, even considering that you sell 4 times and buy 3 (lose 7 half spreads).&lt;/p&gt;&#xA;" OwnerUserId="20600" LastActivityDate="2016-08-25T00:08:50.113" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29827" PostTypeId="2" ParentId="21701" CreationDate="2016-08-25T00:16:22.653" Score="0" Body="&lt;p&gt;The problem is that when price is &quot;back down&quot; and &quot;you take off the hedge&quot;, at this moment you already lost the premium but you still have that risky short position in call.&lt;/p&gt;&#xA;" OwnerUserId="20600" LastActivityDate="2016-08-25T00:16:22.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29828" PostTypeId="2" ParentId="8456" CreationDate="2016-08-25T00:20:55.177" Score="-1" Body="&lt;p&gt;Google this: Zhang JinE., Yi Xiang, 2008, The implied volatility smirk, Quantitative Finance 8, p. 263–284.&lt;/p&gt;&#xA;" OwnerUserId="20600" LastActivityDate="2016-08-25T00:20:55.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29829" PostTypeId="2" ParentId="29823" CreationDate="2016-08-25T00:31:20.387" Score="5" Body="&lt;p&gt;&lt;strong&gt;1) Feynmann-Kac and Girsanov&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First you should remember that the process $X$ is independent of the measure you are considering. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let's consider a change of measure from ${\mathbb{P}}$ to ${\mathbb{Q}}$. Let us assume $\mathbb{E}_t^{\mathbb{P}}[\tfrac{d{\mathbb{Q}}}{d{\mathbb{P}}}] = e^{\theta W_t^P - \frac{1}{2}\theta^2 t}$ for some constant $\theta$. The BM $W^{\mathbb{P}}$ under ${\mathbb{P}}$ is no longer a BM under ${\mathbb{Q}}$. But Girsanov tells us that $dW^{\mathbb{Q}} = dW^{\mathbb{P}} - d\langle W^{\mathbb{P}}_t,\log \mathbb{E}_t^P[\tfrac{d{\mathbb{Q}}}{d{\mathbb{P}}}]\rangle = dW^{\mathbb{P}} - \theta dt$ is a BM under ${\mathbb{Q}}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you rewrite the SDE of $X$ in terms of this new BM, you see a drift term $d\langle X_t,\log \mathbb{E}_t^{\mathbb{P}}[\tfrac{d{\mathbb{Q}}}{d{\mathbb{P}}}]\rangle$ appear. In your case, this reads &#xA;$$&#xA;  dX_t = \theta dt + dW^{\mathbb{Q}}_t&#xA;$$&#xA;Now you can apply Feynman-Kac which tells you&#xA;$$&#xA;  u^{\mathbb{Q}}(t,x) := \mathbb{E}^{\mathbb{Q}}[e^{-rT}f(X_T)|X_t = x]&#xA;$$&#xA;is going to be solution of the PDE &#xA;$$&#xA;  v_t + \theta v_x + \frac{1}{2}v_{xx} - rv = 0&#xA;$$&#xA;This is a different function because expectation is taken under a different measure and it satisfies a different PDE than your original function&#xA;$$&#xA;  u^{\mathbb{P}}(t,x) = \mathbb{E}^{\mathbb{P}}_t[e^{-rT}f(X_T)|X_t = x]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2) Derivative pricing and change of numeraire&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if you are considering &#xA;$$&#xA;   u(t,x)=\mathbb{E}^N_t[N(t)/N(T)f(X_T)]&#xA;$$&#xA;This function does not depend on the numeraire $N$ you are using. In financial terms, the price does not depend on the currency or asset you are doing your accounting in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case where $N_t = e^{\int_0^t \beta(X_u)\,du}$ for a deterministic function $\beta$, you end up with the usual function&#xA;$$&#xA;   u(t,x)=\mathbb{E}^N[N(t)/N(T)f(X_T)|X_t = x]&#xA;$$&#xA;being solution of &#xA;$$&#xA;  u_t + \frac{1}{2}u_xx - \beta(x)u = 0&#xA;$$&#xA;But in general, $N_t$ is not entirely determined by $X_t$ and you cannot apply FK directly. Remember that FK assumes you have a Markovian process driving everything. So you would still need some assumption like $(X,N)$ being Markovian for example and the conditional expectation should be taken with respect to the value of both $X$ and $N$ : &#xA;$$&#xA;   u(t,x,n)=\mathbb{E}^N[N(t)/N(T)f(X_T)|N_t=n,X_t = x]&#xA;$$&#xA;would then be solution of a PDE given by FK.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope that clarifies things a bit.&lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2016-08-26T13:58:53.130" LastActivityDate="2016-08-26T13:58:53.130" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29830" PostTypeId="1" AcceptedAnswerId="29831" CreationDate="2016-08-25T06:30:43.967" Score="10" ViewCount="6695" Body="&lt;p&gt;I am reading the following paragraph on the VIX wikipedia article and I find it confusing: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The VIX is calculated as the square root of the par variance swap rate for a 30-day term[clarify] initiated today. Note that the VIX is the volatility of a variance swap and not that of a volatility swap (volatility being the square root of variance, or standard deviation). &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This makes zero sense to me, since a volatility swap is precisely the square root of a variance swap which is what VIX is aiming to represent/estimate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would someone have a better/cleaner explanation than this, and perhaps update the wikipedia paragraph?&lt;/p&gt;&#xA;" OwnerUserId="2668" LastActivityDate="2020-06-25T06:00:52.673" Title="Is the VIX more similar to a volatility swap or a variance swap?" Tags="&lt;volatility&gt;&lt;variance&gt;&lt;vix&gt;" AnswerCount="2" CommentCount="11" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="29831" PostTypeId="2" ParentId="29830" CreationDate="2016-08-25T07:47:07.977" Score="9" Body="&lt;p&gt;The price/value of the VIX &lt;em&gt;index&lt;/em&gt; is more akin to the strike/price of a variance swap expressed in vol units than to the strike/price of a vol swap. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if you are to trade a VIX &lt;em&gt;future&lt;/em&gt; (i.e. a delta one contract on the VIX index), the exposure you gain is more comparable to the one of a vol swap in the following sense:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a notional of 1 and a fixed investment horizon $[0,T]$. Ignore second order effects (e.g. daily margining).&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If you buy a variance swap at $t=0$ at a price of 20% (variance strike in volatility units) and that the realised volatility over the contract's life ends up being 25%, you will lock a profit: $25^2-20^2=225$. &lt;/li&gt;&#xA;&lt;li&gt;If you buy a volatility swap at 20% at $t=0$ (volatility strike) and that the realised volatility over the contract's duration ends up being 25%, your profitt will be: $25-20=5$&lt;/li&gt;&#xA;&lt;li&gt;If you enter a VIX future at 20 (variance swap par rate expressed in vol units) at $t=0$ and unwind your position at 25 at $t=T$, you will have made $25-20=5$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2668" LastEditorUserId="19887" LastEditDate="2016-08-26T09:45:44.513" LastActivityDate="2016-08-26T09:45:44.513" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29832" PostTypeId="2" ParentId="29824" CreationDate="2016-08-25T09:23:16.197" Score="1" Body="&lt;p&gt;Even though HFT traders can make good money on average thanks to their lower latency while trading on a single exchange, it seems like the term &quot;Latency arbitrage&quot; refers to in practice simultaneous purchases and sells on &lt;em&gt;different&lt;/em&gt; exchanges. The arbitrage would come from short lived price differences that other traders are relatively too slow to exploit and eliminate. &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2729109&quot; rel=&quot;nofollow&quot;&gt;This academic paper investigates its size&lt;/a&gt; and &lt;a href=&quot;http://www.reuters.com/article/us-usa-markets-arbitrage-idUSKCN0VY2HU&quot; rel=&quot;nofollow&quot;&gt;here is an article discussing the paper.&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="23886" LastActivityDate="2016-08-25T09:23:16.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29833" PostTypeId="1" CreationDate="2016-08-25T10:14:32.667" Score="5" ViewCount="535" Body="&lt;p&gt;Let $r_t, \theta_t$ denote some stochastic processes driven by a $N$ dimensional Brownian motion $W_t$ (they are of course assumed adapted to the natural filtration $\mathcal{F}_t$ of that Brownian motion). Now, Consider the conditional expectation:&#xA;$$ C_t = \Bbb{E} \left[ \int_t^T f(r_s, \theta_s, W_s) ds \,\vert\, \mathcal{F}_t \right] $$&#xA;with $f$ a sufficiently well-behaved function.&#xA;The paper that I am reading (can't insert reference because of NDA) claims that the above expression satisfies an SDE of the type&#xA;$$ dC_t = \alpha_t dt + \nu_t dW_t $$&#xA;where $\alpha$ and $\nu$ are possibly stochastic due to the &quot;martingale representation theorem&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering how to show that? Do you use some kind of Leibniz rule to express $dC_t$ and conclude? Do you rather you some more elaborate tricks like Doob-Meyer decomposition and the likes? &lt;/p&gt;&#xA;" OwnerUserId="24126" LastActivityDate="2016-08-25T13:29:18.573" Title="Martingale representation theorem" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;martingale&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29834" PostTypeId="1" AcceptedAnswerId="29836" CreationDate="2016-08-25T11:16:02.757" Score="1" ViewCount="1040" Body="&lt;p&gt;Why somebody buy the defaulted loans from the banks, if the debtors can not pay back their debt? If I bought these loans I will cause losses myself, because nobody will pay me (or just a lower price than the original value of the loans, if these will be recovered). What is the finance logic behind this method?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, if I can buy these loans on a lower price what I can get when its will be recovered, why the banks sell its?&lt;/p&gt;&#xA;" OwnerUserId="6975" LastActivityDate="2019-07-14T12:57:23.997" Title="Why somebody buy the defaulted loans?" Tags="&lt;banks&gt;&lt;debt&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29835" PostTypeId="1" AcceptedAnswerId="29847" CreationDate="2016-08-25T11:17:12.650" Score="1" ViewCount="437" Body="&lt;p&gt;I am working on a project which addresses finances and I am curious if I could use &lt;a href=&quot;http://quantlib.org/index.shtml&quot; rel=&quot;nofollow&quot;&gt;qunatlib&lt;/a&gt; for it. I have already looked it a documentation about it but since I am definitely not an expert in finances, could not conclude if the quantlib suits well for the measures I have.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I am calculating coupon / dividend payment on top of a bond / stock on a certain day. Lets have a look at the coupon example. &#xA;On the specified day a client has 10 Bonds (each has face amount of 100 USD and coupon rate of 7%), by the simple multiplication I calculate that the client gets 70 USD on that day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As well as I am calculating book and market value of assets along with total and relative price return measures also on top of asset. I am curious of any of those would be possible to calculate by using &lt;code&gt;qunatlib&lt;/code&gt;. I see that it is generally widely used and offers a hand full of features and the further motivation for this is the fact that I would not like to reinvent the wheel if there is a library which can do it for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If anyone could tell me if it is possible to calculate any of those measures using &lt;code&gt;qunatlib&lt;/code&gt; and ideally provide a sample of the measurement it would be great. I'll appreciate any help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thx in advance&lt;/p&gt;&#xA;" OwnerUserId="24127" LastEditorUserId="24127" LastEditDate="2016-08-25T13:36:52.080" LastActivityDate="2016-08-26T02:34:10.460" Title="Would it possible to use quantlib finance library to calculate folowing measures?" Tags="&lt;equities&gt;&lt;bond&gt;&lt;quantlib&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29836" PostTypeId="2" ParentId="29834" CreationDate="2016-08-25T11:32:28.413" Score="5" Body="&lt;p&gt;(1) Often there is some collateral behind the loan (a building, etc.) which with enough effort and time can be sold to recover at least SOME of the value of the loan. However this is not necessarily what the bank is good at or wants to do. Their business is to lend money, not make real estate deals or dispose of dubious merchandise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) A smart buyer will of course pay much less for the loan than they think they can recover. But opinions differ and the residual value is hard to judge. This is a big advantage of the sale: it allows &quot;the market&quot; (that is many potential buyers in competition) to determine the value of the loans in some fairly objective way (the estimates of value made by the bank are ALWAYS biased upward since it is their loan and they try to put an optimistic picture on the situation. [To be a little cynical: it is in their interest to lie, to deny there is any problem, to wait a little longer, partly for accounting reasons]). As they used to say &quot;a thing is worth what someone will willingly pay for it&quot; and that is what the sale does: it establishes a price, removing the uncertainty.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(3) Often the regulators require the bank to sell the loan to &quot;clean up&quot; the bank and give it a chance to &quot;start anew&quot;. The nonperforming loans and the hope of recovering them can be a big distraction for the bank management, which stops lending to more creditworthy enterprises. The regulators are aware of the &quot;inaction bias&quot; mentioned in (2) and they try to encourage the bank to face reality and move forward.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-08-25T14:11:27.057" LastActivityDate="2016-08-25T14:11:27.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29838" PostTypeId="1" AcceptedAnswerId="29854" CreationDate="2016-08-25T12:55:07.757" Score="3" ViewCount="292" Body="&lt;p&gt;The FFT paper for Option Pricing by Carr and Madan says that the reason for adding a dampener to the call price function is because it is not square-integrable: when the log of strike goes to -infinity, the call price goes to S0. I agree with this but I thought that the square integrable property meant that the integral of square of a function between -+ infinity is finite. So, I have 2 questions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) How does the call price function break the square integrable property?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) If the call price is not square integrable why can't we take it's Fourier Transform?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="24129" LastActivityDate="2016-08-28T09:04:44.583" Title="Square Integrable for Fourier Transform" Tags="&lt;options&gt;&lt;option-pricing&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29839" PostTypeId="2" ParentId="29833" CreationDate="2016-08-25T13:20:16.620" Score="5" Body="&lt;p&gt;The martingale representation theorem says that for any martingale $M$, there exists a unique stochastic process $\nu_t$ such that&#xA;\begin{align*}&#xA;M_t = \mathbb{E}(M_0) + \int_0^t\nu_sdW_s.&#xA;\end{align*}&#xA;See, for example, &lt;a href=&quot;https://www.amazon.ca/Stochastic-Differential-Equations-Introduction-Applications/dp/3540047581.&quot; rel=&quot;nofollow&quot;&gt;this book&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since &#xA;\begin{align*}&#xA;C_t &amp;amp;= \Bbb{E} \left( \int_t^T f(r_s, \theta_s, W_s) ds \mid \mathcal{F}_t \right)\\&#xA;&amp;amp;= -\int_0^t f(r_s, \theta_s, W_s) ds + \Bbb{E} \left( \int_0^T f(r_s, \theta_s, W_s) ds \mid \mathcal{F}_t \right),&#xA;\end{align*}&#xA;and $$\Bbb{E} \left( \int_0^T f(r_s, \theta_s, W_s) ds \mid \mathcal{F}_t \right)$$ is a martingale, there exists a a unique stochastic process $\nu_t$ such that&#xA;\begin{align*}&#xA;\Bbb{E} \left( \int_0^T f(r_s, \theta_s, W_s) ds \mid \mathcal{F}_t \right) = a + \int_0^t \nu_s dW_s,&#xA;\end{align*}&#xA;where $a$ is a constant. Let $\alpha_t = -f(r_t, \theta_t, W_t)$. Then&#xA;\begin{align*}&#xA;dC_t = \alpha_t dt + \nu_t dW_t.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-08-25T13:29:18.573" LastActivityDate="2016-08-25T13:29:18.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29840" PostTypeId="2" ParentId="29823" CreationDate="2016-08-25T14:35:23.897" Score="3" Body="&lt;p&gt;You must separate the mathematical theory from the financial theory. The notion of numéraire specifically pertains to the latter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[A] Mathematical perspective&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You reach the following PDE (regardless of how you did it)&#xA;$$ u_t + \mu u_x + \frac{1}{2}\sigma^2 u_{xx} - ru = 0 $$&#xA;Feynman-Kac then tells you that the unique solution can be written as&#xA;$$ u(t,x) = \mathbb{E}^\mathbb{X} \left[e^{-r(T-t)} f(X_T) \vert X_t = x\right] $$&#xA;where $(X_s)_{s \geq t}$ solves $\forall s \geq t$&#xA;$$ dX_s = \mu dt + \sigma dW_s^\mathbb{X} ,\ \ \ X(t) = x $$&#xA;There is no question of numéraire here. $\mathbb{X}$ is a probability measure, it can be anything you like as long as $W_s^\mathbb{X}$ is a $\mathbb{X}$-Brownian motion it does not matter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[B] Financial perspective&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a positive traded asset $N_t$. Arbitrage opportunities are precluded if any self-financing strategy expressed in terms of $N$ (numéraire) emerges as a $\mathbb{N}$-martingale  i.e.&#xA;$$ \frac{V_t}{N_t} = \mathbb{E}^{\mathbb{N}}\left[ \frac{V_T}{N_T} \vert \mathcal{F}_t \right] $$&#xA;Should we introduce yet another numéraire $M$, the following would hold:&#xA;$$ V_t = N_t \mathbb{E}^{\mathbb{N}}\left[ V_T N_T^{-1} \vert \mathcal{F}_t \right] = M_t \mathbb{E}^{\mathbb{M}}\left[ V_T M_T^{-1} \vert \mathcal{F}_t \right] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It entails that if investing in the asset $X_t$ is a self-financing strategy, then we should have that, for any choice of numéraire $N$:&#xA;$$ \frac{X_t}{N_t} \text{ is a } \Bbb{N}\text{-martingale} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Example] A $\to$ B&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a risk-free investment vehicle, with return $r$. Let $S_t$ denote a risky asset paying no dividends with dynamics&#xA;$$ dS_t = \delta dt + \sigma S_t dW_t^\mathbb{P} \tag{1} $$&#xA;This will be our working modelling assumption. Now let $V_t = V(t,S_t,...)$ denote a contingent claim written on $S_t$ which pays no coupons. Consider the self-financing strategy $\Pi_t$ which consists in holding both the contingent claim $V_t$ and a fraction $\alpha_t$ of the risky asset $S_t$:&#xA;$$ \Pi_t = V_t + \alpha_t S_t $$&#xA;Picking $\alpha_t = -\partial V/\partial S$ allows us to &quot;delta hedge&quot; the portfolio $\Pi_t$ so that it's infinitesimal P&amp;amp;L reads:&#xA;\begin{align}&#xA;d\Pi_t &amp;amp;= dV_t - \alpha_t dS_t \\&#xA;&amp;amp;= \frac{\partial V}{\partial t} dt + \frac{1}{2} \frac{\partial^2 V}{\partial S^2} \sigma^2 S_t^2 dt &#xA;\end{align}&#xA;since the latter evolution does not depend the latent source of randomness $dW_t^\mathbb{P}$, the delta hedged portfolio should evolve at the risk-free rate by absence of arbitrage opportunity:&#xA;\begin{align}&#xA;d\Pi_t &amp;amp;= \Pi_t r dt \\&#xA;       &amp;amp;= (V_t - \alpha_t S_t) r dt&#xA;\end{align} &#xA;hence the PDE:&#xA;$$ \frac{\partial V}{\partial t}+ r S \frac{\partial V}{\partial S} + \frac{1}{2} \sigma^2 S^2 \frac{\partial^2 V}{\partial S^2} - rV = 0 $$&#xA;with $V(t=T,S_T=S) = f(S)$ by absence of arbitrage, $f(S)$ denoting the contingent claim's payout. Feynman-Kac then tells us that the solution writes:&#xA;$$ V_t = \mathbb{E}^\mathbb{Q} \left[ e^{-r(T-t)} f(S_T) \vert \mathcal{F}_t \right] \tag{3} $$&#xA;where under $\mathbb{Q}$ &#xA;$$ dS_t = rS_t dt + \sigma S_t dW_t^\mathbb{Q} \tag{2} $$&#xA;You can now:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Compare the dynamics of the risky asset $(1)$ and $(2)$. Notice how we've started from some modelling assumptions under $\mathbb{P}$ but saw that we could actually express the price using a mathematical trick under yet another measure (similar to what happens in the CRR binomial framework: the historical probability disappear from thee pricing equation)&lt;/li&gt;&#xA;&lt;li&gt;From $(2)$ we see that $S_t/B_t$ is a $\mathbb{Q}$-martingale, while from $(3)$ we see that $V_t/B_t$ is also a $\mathbb{Q}$-martingale. Thus $B_t$ is indeed the numéraire associated to the measure $\mathbb{Q}$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Example] B $\to$ A&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See application of Itô's lemma discussed &lt;a href=&quot;https://quant.stackexchange.com/questions/29736/other-numerraire-choices-when-applying-feynman-kac&quot;&gt;here&lt;/a&gt; and relevant references inside.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-08-25T19:59:27.947" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="29841" PostTypeId="2" ParentId="29838" CreationDate="2016-08-25T15:34:36.533" Score="1" Body="&lt;p&gt;$$E\left[(e^{X_T}-K)^+\right]=E\left[e^{\lambda X_T}e^{-\lambda X_t}(e^{X_T}-K)^+\right]$$&#xA;for $\lambda&amp;gt;1$ it is ok to take the fourier transform of $e^{-\lambda x}(e^{x}-K)^+$. Let $\hat{f}_{\lambda,k}$ be the fourier transform of $e^{-\lambda x}(e^{x}-K)^+$ then you get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E\left[(e^{X_T}-K)^+\right] = \int_{\mathbb{R}}E\left[e^{(\lambda +i2\pi\xi) X_T}\hat{f}_{\lambda,k}(\xi)\right]d\xi$$&#xA;and then you use Fourier transfrom pricing because you know well how to compute $\phi_{T}(u)=E[e^{u X_T}]$ thus,&#xA;$$E\left[(e^{X_T}-K)^+\right] = \int_{\mathbb{R}}\phi_T\left(\lambda +i2\pi\xi\right)\hat{f}_{\lambda,k}(\xi)d\xi$$&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-08-25T15:34:36.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29843" PostTypeId="1" AcceptedAnswerId="29845" CreationDate="2016-08-25T17:30:37.510" Score="4" ViewCount="798" Body="&lt;p&gt;Assume I have some dynamics for the stock price under 2 different measures: risk-neutral and forward measures: &#xA;$$dS_t=r S_tdt+\sigma S_td\tilde{W_t}$$&#xA;$$dS_t=\alpha S_tdt+\sigma S_td\hat{W_t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;now I define 2 functions:&#xA;$$g(t,s)=\mathbb{\tilde{E}}[e^{-\int_t^Tr_udu}h(S(T))|\mathbb{F}_t]$$&#xA;$$f(t,s)=\mathbb{\hat{E}}[e^{-\int_t^Tr_udu}h(S(T))|\mathbb{F}_t]$$&#xA;Then in both cases $e^{-\int_0^tr_udu}g$ and $e^{-\int_0^tr_udu}f$ are martingales under $\tilde{\mathbb{P}}$ and $\hat{\mathbb{P}}$ respectively. In the first case, it is basically discounting with a bank account, which(using tower property) is RN measure associated with. In the second though, the measure is associated with the bond of maturity $T$ so I would expectt $f/B(t,T)$ be a martingale under $\hat{\mathbb{P}}$, but I see $e^{-\int_0^tr_udu}f$ is. So they both are?&lt;/p&gt;&#xA;" OwnerUserId="22823" LastEditorUserId="22823" LastEditDate="2016-08-25T17:58:55.000" LastActivityDate="2016-08-25T18:29:02.170" Title="discounted price is a martingale under any measure?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29844" PostTypeId="2" ParentId="29797" CreationDate="2016-08-25T17:32:16.690" Score="1" Body="&lt;p&gt;Lets say you want the 99% daily VaR using a historic simulation over 250 days.&#xA;In this case you have a risk vector with 250 values $v_{1}, ..., v_{250}$ with $v_{n}$ being the change in the portfolio value, if the market would exhibit the same daily movements from $t=0$ to $t=1$ as had happened from $n-1$ days ago to $n$ days ago. Lets call these market movements $d_{i}(n, n-1)$ where $i$ indexes the relevant risk factors. The VaR at $t=0$ is the third lowest value of this risk vector.&#xA;Also given are the sensitivities $\delta_{i}$ to each risk factor at $t=0$, the gammas $\gamma_{i,i}$ and cross gammas $\gamma_{i,j}$ and a forecast for the change in each riskfactor $\hat{d}_{i}$ from $t=0$ to $t=1$.&#xA;I also assume, that you know the new and vanishing positions from $t=0$ to $t=1$ along with their sensitivities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Estimating the VaR at $t=1$:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Update your risk vector according to the new and vanishing positions. Multiply the sensitivities of that positions with market movements $d_{i}(n, n-1)$ and add or subtract that value from the risk vector to get an updated risk vector ${v}'_{1}, ..., {v}'_{250}$. Also update your sensitivities and gammas of the portfolio accordingly to ${\delta}'_{i}$ and ${\gamma}'_{i,j}$. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you want to stay in linear approximation, things are easy. Calculate ${v}'_{0}=\sum_{i} {\delta}'_{i} * \hat{d}_{i}$ and substitute ${v}'_{250}$ with ${v}'_{0}$ to get the new risk vector.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you insist on factor in gamma effects, it gets more complicated. First you have to update your deltas to $t=1$ by $\delta^{\ast}_{i} =  {\delta}'_{i} + \sum_{j} \hat{d}_{i} * {\gamma}'_{i, j} $. Than update your risk vector by &#xA;$$ v^{\ast}_{n} = {v}'_{n} +  \sum_{i} ( \delta^{\ast}_{i} - {\delta}'_{i} ) * d_{i}(n, n-1) $$ &#xA;Than calculate &#xA;$$v^{\ast}_{0}= \sum_{i} \delta^{\ast}_{i} * \hat{d}_{i} + 0.5 * \sum_{i, j} {\gamma}'_{i, j} * \hat{d}_{i} * \hat{d}_{j} $$ &#xA;Substitute $v^{\ast}_{250}$ with $v^{\ast}_{0}$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Determine the third lowest value of your new risk vector to get your VaR estimate.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Remarks: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To 1: Feel free to add gamma effect to calculate updated risk vector.&#xA;If you happen to have the risk vector on positions level you can of course also update the risk vector directly by adding/substracting the change from new/vanishing positions from full valuation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if you need to correct for theta effects (unlikely for daily VaR), than add the difference in the theta effect from $t=0$ and $t=1$ to every element of your risk vector.&lt;/p&gt;&#xA;" OwnerUserId="22686" LastEditorUserId="22686" LastEditDate="2016-08-25T17:45:24.297" LastActivityDate="2016-08-25T17:45:24.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29845" PostTypeId="2" ParentId="29843" CreationDate="2016-08-25T18:22:58.800" Score="3" Body="&lt;p&gt;Indeed, based on your definition, $e^{-\int_0^tr_s ds}f$ is a martingale under the forward measure $\hat{\Bbb{P}}$. Note that, since $f$ is not an asset price process, $f/B(t, T)$ is not a martingale process under $\hat{\Bbb{P}}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $g$ is an asset price process, then $e^{-\int_0^tr_s ds}g$ is a martingale under the risk-neutral measure $\tilde{\Bbb{P}}$. Moreover, $g/B(t, T)$ is a  martingale under the forward measure $\hat{\Bbb{P}}$. In fact, note that&#xA;\begin{align*}&#xA;\eta_t =: \frac{d\tilde{\Bbb{P}}}{d\hat{\Bbb{P}}}|_t = \frac{B(0, T) e^{\int_0^t r_s ds}}{B(t, T)}.&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;g(t, S) &amp;amp;= \tilde{\Bbb{E}}\left(e^{-\int_t^T r_s ds} h(S_T) \mid \mathscr{F}_t \right)\\&#xA;&amp;amp;=\hat{\Bbb{E}}\left(\frac{\eta_T}{\eta_t} e^{-\int_t^T r_s ds} h(S_T) \mid \mathscr{F}_t \right)\\&#xA;&amp;amp;= B(t, T)\hat{\Bbb{E}}\left(h(S_T) \mid \mathscr{F}_t \right).&#xA;\end{align*}&#xA;Therefore,&#xA;\begin{align*}&#xA;\frac{g(t, S)}{B(t, T)} = \hat{\Bbb{E}}\left(h(S_T) \mid \mathscr{F}_t \right)&#xA;\end{align*}&#xA;is a martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your definition of $f$ is just a conditional expectation, which does not have any financial meaning. Alternatively, you can define $f$ by&#xA;\begin{align*}&#xA;f(t, S) =B(t, T)\hat{\Bbb{E}}\left(h(S_T) \mid \mathscr{F}_t \right),&#xA;\end{align*}&#xA;but then $f(t, S)=g(t, S)$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-08-25T18:29:02.170" LastActivityDate="2016-08-25T18:29:02.170" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29846" PostTypeId="2" ParentId="29834" CreationDate="2016-08-25T23:34:47.283" Score="0" Body="&lt;p&gt;Long story short: you buy any financial asset if you see the value given the price you pay. Distressed assets give you the highest yield (with the highest risk) at lower price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Distressed debt specialists have knowledge and sufficient experience to determine whether there's any value left on the table. Some activists aim to participate in bankruptcy and liquidation events (betting on recoveries); others focus on restructuring events aiming to either negotiate better terms for creditors or even converting into equity and effectively taking over the company.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;defaulted asset [loan] is still an outstanding security up until liquidation. the asset might be technically in default after the debtor missed the payment [either coupon or principal] even if financial difficulties are temporary. The bankruptcy [liquidation] process is not yet guaranteed - at some point there still can be a chance for an asset to become performing. Therefore some participants are able to withstand such uncertainty (they'll be rewarded for that accordingly) and their investment strategy will still be solvent if the number of cases with &quot;actual recoveries lower than expected&quot; is below some threshold.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for why banks sell these: 1) clean balance sheet as distressed assets have higher capital charges (rwa); 2) it might not be an area of focus; 3) get cash (with a haircut) now and avoid waiting/participating in bankruptcy events which may take years.&lt;/p&gt;&#xA;" OwnerUserId="18275" LastActivityDate="2016-08-25T23:34:47.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29847" PostTypeId="2" ParentId="29835" CreationDate="2016-08-26T02:34:10.460" Score="3" Body="&lt;p&gt;Is this sufficient for you? Creating a fixed-bond and it's clean price, dirty price and YTM.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;const Date t0 = Date(8, July, 2015);    // July 8th, 2015&#xA;const Date t1 = Date(10, August, 2015); // August 10th, 2015&#xA;const Date t2 = t0 + Period(2, Months); // September 8th, 2015&#xA;const Date t3 = t0 + Period(3, Months); // October 8th, 2015&#xA;&#xA;// Make sure we're evaluating at t0&#xA;Settings::instance().evaluationDate() = t0;&#xA;&#xA;Schedule sch(t0,&#xA;             t3,&#xA;             Period(Monthly),&#xA;             UnitedStates(),&#xA;             Unadjusted,&#xA;             Unadjusted,&#xA;             DateGeneration::Backward,&#xA;             false);&#xA;&#xA;const auto dc = Actual360();&#xA;&#xA;FixedRateBond bond(0, 1000, sch, std::vector&amp;lt;Rate&amp;gt; { 0.07, 0.07, 0.07 }, dc);&#xA;&#xA;// We have four payments (three coupons + one nominal)&#xA;std::cout &amp;lt;&amp;lt; bond.cashflows().size() &amp;lt;&amp;lt; std::endl;&#xA;&#xA;// Coupon for the first payment date&#xA;std::cout &amp;lt;&amp;lt; bond.cashflows()[0]-&amp;gt;amount() &amp;lt;&amp;lt; std::endl;&#xA;&#xA;// Coupon for the second payment date&#xA;std::cout &amp;lt;&amp;lt; bond.cashflows()[1]-&amp;gt;amount() &amp;lt;&amp;lt; std::endl;&#xA;&#xA;// Coupon for the final payment date&#xA;std::cout &amp;lt;&amp;lt; bond.cashflows()[2]-&amp;gt;amount() &amp;lt;&amp;lt; std::endl;&#xA;&#xA;// Nominal at the end of the bond&#xA;std::cout &amp;lt;&amp;lt; bond.cashflows()[3]-&amp;gt;amount() &amp;lt;&amp;lt; std::endl;&#xA;&#xA;Handle&amp;lt;YieldTermStructure&amp;gt; zero(flatRate(t0, 0.05, Actual360()));&#xA;&#xA;boost::shared_ptr&amp;lt;PricingEngine&amp;gt; engine = boost::shared_ptr&amp;lt;PricingEngine&amp;gt;(&#xA;                                            new DiscountingBondEngine(Handle&amp;lt;YieldTermStructure&amp;gt;(zero)));&#xA;bond.setPricingEngine(engine);&#xA;&#xA;std::cout &amp;lt;&amp;lt; bond.dirtyPrice() &amp;lt;&amp;lt; std::endl;&#xA;std::cout &amp;lt;&amp;lt; bond.cleanPrice() &amp;lt;&amp;lt; std::endl;&#xA;std::cout &amp;lt;&amp;lt; bond.yield(dc, Simple, Monthly) &amp;lt;&amp;lt; std::endl;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="601" LastActivityDate="2016-08-26T02:34:10.460" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29848" PostTypeId="2" ParentId="24450" CreationDate="2016-08-26T03:50:55.137" Score="1" Body="&lt;p&gt;Making an HTTP request using the following link will give you the end of day stock market data (in csv) for essential any security listed on an American exchange.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The URL parameter q specifies the ticker of the company you want to get data for. Also the date range is specified in the startdate and enddate parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.google.com/finance/historical?q=MSFT&amp;amp;startdate=Jan+1%2c+2010&amp;amp;enddate=May+17%2c+2016&amp;amp;output=csv&quot; rel=&quot;nofollow&quot;&gt;http://www.google.com/finance/historical?q=MSFT&amp;amp;startdate=Jan+1%2c+2010&amp;amp;enddate=May+17%2c+2016&amp;amp;output=csv&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20245" LastActivityDate="2016-08-26T03:50:55.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29849" PostTypeId="1" AcceptedAnswerId="30277" CreationDate="2016-08-26T03:56:35.590" Score="5" ViewCount="242" Body="&lt;p&gt;Suppose I am invested in the same fund for the first 200 days in 2013, some combination of 150 days in 2014, and the last 100 days in 2015. Further suppose that geometrically linking the daily returns over every day invested gives a cumulative return of 10% over the total 450 days invested during this 3 year time frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What is the annualized return in this case?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A couple possibilities seem reasonable:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Annualize only over days invested:&#xA;$$(1+10\%)^{365/450} - 1 \approx 8.037\%$$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Annualize over the entire time frame:&#xA;$$(1+10\%)^{1/3} - 1 \approx 3.228\%$$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Is one of these very different answers the standard or is it entirely context dependent?&lt;/p&gt;&#xA;" OwnerUserId="24137" LastActivityDate="2016-09-27T22:14:55.237" Title="What is the industry standard for annualizing returns over non-contiguous time periods?" Tags="&lt;time-series&gt;&lt;returns&gt;&lt;finance-mathematics&gt;&lt;annualized&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29850" PostTypeId="1" CreationDate="2016-08-26T12:45:07.847" Score="1" ViewCount="1765" Body="&lt;p&gt;Bull steepening and bear flattening have the common belief that in bad news, treasuries catch a bid and short end rallies more because most bad news are short lived. In good news, treasuries sell off and investors are more comfortable holding longer duration treasuries.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What about the opposite? What are the economic intuitions behind the scenarios of bull flattening and bear steepening?&lt;/p&gt;&#xA;" OwnerUserId="13375" LastActivityDate="2016-10-25T15:49:31.993" Title="In what economic scenario do yield curves bull flatten or bear steepen?" Tags="&lt;yield-curve&gt;&lt;economics&gt;&lt;treasuries&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29851" PostTypeId="2" ParentId="22227" CreationDate="2016-08-26T13:33:44.550" Score="2" Body="&lt;p&gt;For &lt;em&gt;homogenous&lt;/em&gt; diffusion models (i.e. models such that the distribution of $\ln(S_t)-\ln(S_0)$ is level-independent, e.g. Black-Scholes, Heston, Bates etc.), this would indeed hold.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To illustrate this, consider an exponential Lévy model for the spot price under the risk-neutral measure $\mathbb{Q}$ &#xA;$$ S_t = S_0 e^{X_t},\ \forall t \in [0,T] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The price of a call option expiring at $T$ and struck at $K$ in that case reads&#xA;$$ C_0 = C(S_0;K,T) = \Bbb{E}^\Bbb{Q}_0 \left[ \frac{(S_T - K)^+}{B_T} \right] $$&#xA;Now computing the delta yields&#xA;\begin{align}&#xA;\Delta &amp;amp;= \frac{\partial C_0}{\partial S_0} \\&#xA;       &amp;amp;= \Bbb{E}^\Bbb{Q}_0 \left[ \frac{1\{ S_T \geq K\}}{B_T} \frac{\partial S_T}{\partial S_0} \right] \\&#xA;&amp;amp;= \Bbb{E}^\Bbb{Q}_0 \left[ 1\{ S_T \geq K\} \frac{S_T B_0}{S_0 B_T} \right] \\&#xA;&amp;amp;= \Bbb{E}^\Bbb{S}_0 \left[ 1\{ S_T \geq K\} \right] \\&#xA;&amp;amp;= \Bbb{S}( S_T \geq K ) \\&#xA;&amp;amp;= \Bbb{S} ( X_T \geq \ln(K/S_0) )&#xA;\end{align}&#xA;Such that, all else equal, increasing $S_0$ increases the Delta.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2016-08-26T13:33:44.550" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29852" PostTypeId="2" ParentId="29850" CreationDate="2016-08-26T13:37:05.953" Score="1" Body="&lt;p&gt;Curves have had a strong tendency to bull flatten or bear steepen in recent years, and the reason is quite simple – the front end is anchored by Fed policies and can't move much (if at all). In fact, throughout 2010 to mid 2015, most traders don't even look at 2s/10s or 2s/30s curves, because these are perfectly corrected with 10s or 30s (since 2s can't move).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Conversely when the Fed is active, curves are more likely to bear flatten/bull steepen, simply because the front end of the curve is more volatile.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2016-08-26T13:55:26.077" LastActivityDate="2016-08-26T13:55:26.077" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29854" PostTypeId="2" ParentId="29838" CreationDate="2016-08-26T15:02:19.677" Score="2" Body="&lt;p&gt;A real-valued function $f(x)$ is &lt;em&gt;square integrable&lt;/em&gt; over $\Bbb{R}$, we write $f \in L^2(\Bbb{R})$, if and only if&#xA;$$ \int_{-\infty}^{+\infty} f(x)^2 dx &amp;lt; \infty \tag{1} $$&#xA;A &lt;em&gt;necessary condition&lt;/em&gt; for the above integral to be finite is $$\lim_{\vert x \vert\to\infty} f(x) = 0$$&#xA;To convince yourself, think of the interpretation of an integral as the area under a curve: what do you think happens to the integral $(1)$ when $f(x)$ tends to a non-zero asymptotic limit, knowing that the integrand $f(x)^2$ is positive everywhere?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $C(k,T)$ denote the price (as of today) of a European call option, expiring at $T$ and struck at $K=e^k$. Since $$\lim_{k\to-\infty} C(k,T) = \lim_{k\to-\infty} \Bbb{E}^\Bbb{Q}_t \left[ (S_T - e^k)^+ B_T^{-1} \right] = B(0,T) F(0,T) \ne 0$$ &#xA;we have that $C(k,T) \notin L^2$ which answers your first question.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Your second question is more technical. Basically, you are facing a situation where the risk-neutral pdf associated to your diffusion framework is not &lt;em&gt;analytically tractable&lt;/em&gt;, so that you cannot evaluate the expression&#xA;$$ C(k,T) = \Bbb{E}^\Bbb{Q}_t \left[ (S_T - e^k)^+ B_T^{-1} \right]  = \int_{-\infty}^{+\infty} (e^{s_T}-e^k)^+ B_T^{-1} \phi(T, s_T) ds_T $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still, your model being &lt;em&gt;affine&lt;/em&gt;, you know that you can identify the &lt;em&gt;characteristic function&lt;/em&gt; of $s_T=\ln(S_T)$ in closed-form, which happens to be the Fourier transform of the pdf $\phi(T,s_T)$:&#xA;$$\mathcal{G}_g(u) = \int_{-\infty}^{+\infty} e^{ius} \phi(T,s) ds$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From there you would like to appeal to a result known as the &lt;em&gt;Parseval relation&lt;/em&gt;, which would allow you to write&#xA;\begin{align}&#xA;C(k,T) &amp;amp;= \int_{-\infty}^{+\infty} \underbrace{(e^{s_T}-e^k)^+ B_T^{-1}}_{f(s_T)} \underbrace{\phi(T, s_T)}_{g(s_T)} ds_T \\&#xA;&amp;amp; = \langle f(s_T), g(s_T) \rangle = \frac{1}{2\pi}\langle \mathcal{F}_f(u), \mathcal{G}_g(u) \rangle \tag{Parseval} \\&#xA;&amp;amp;= \frac{1}{2\pi} \int_{-\infty}^{+\infty} \mathcal{F}_f(u) \mathcal{G}_g(u) du&#xA;\end{align}&#xA;which would allow you to exploit your knowledge of the characteristic function $\mathcal{G}_g(u)$: you just need to find the Fourier transform of the discounted payoff. This is exactly what @MJ73550 did in his answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The thing is that the Parseval relationship only holds for functions of $f$ and $g$ in $L^2$. Using a similar argument as above it is easy to see that $f \notin L^2$&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-08-28T09:04:44.583" LastActivityDate="2016-08-28T09:04:44.583" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29855" PostTypeId="1" AcceptedAnswerId="29856" CreationDate="2016-08-26T16:26:18.303" Score="1" ViewCount="283" Body="&lt;p&gt;I am wondering how traders come up with prices that are not perfectly explained by the models common for the respective products they are trading. If they use a pricing library, this library should present them a price which is consistent with the model. This would mean market prices should be matched by the most common model quite well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I am studying the SABR model, which to my understanding is a common model for interest rate swaptions. But the best fit of the model to the market data is not extremely good. Where are these prices coming from; in other words: how did the traders come up with these implied volatilities?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example from the paper Managing Smile Risk by Hagan et al.:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/OowMj.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/OowMj.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt; &#xA;The implied volatilities in the market don't look like there could be a common model that explains (interpolates) them all perfectly. How did those prices come to be?&lt;/p&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="11645" LastEditDate="2017-01-05T10:12:09.357" LastActivityDate="2017-01-05T10:12:09.357" Title="Why do prices/volatilitie differ from those prediced by models, if the models are used for pricing?" Tags="&lt;option-pricing&gt;&lt;sabr&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29856" PostTypeId="2" ParentId="29855" CreationDate="2016-08-26T17:12:21.753" Score="3" Body="&lt;p&gt;The simplest answer is that prices are not derived from the models. Prices are a result of trading in the market and express the sum of the information and opinions of all market participants at the time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Despite what many academics would like you to believe, markets participants are not always perfectly rational and not always 100% motivated by the maximum utility of their money. There are many human decisions that drive market choices. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes a trader has to pay the bills (or go on vacation, or put Jimmy through school, or quickly max out your IRA contribution, whatever..) In aggregate, we can assume market efficiency is somewhat true, but even then there is a big gap between the models and reality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The better way to think about any model is that it is a way to describe what the market price represents by wrapping it in a mathematical framework. The nice thing is that if the model is any good it allows you to understand some specific things about what the market believes (in aggregate) based on the price of the asset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A good example is interpreting the future price volatility implied by an asset's option price. By using an option pricing model we are able to calculate the Implied Volatility based on market prices created by people trading in the market. This is literally using a model to infer the range of probable price movement of an asset based on the price of the option contract.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you are comfortable that the model is a good representation of the pricing mechanism, you can also use the model to do what-if analysis of the pricing based on your assumptions of what will happen. This allows you to engineer trades to perform specific functions in your portfolio, such as hedges or balancing risks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is a serious mistake to believe that market prices are a result of the model. Check out &lt;a href=&quot;http://www.businessinsider.com/the-fall-of-long-term-capital-management-2014-7?op=1&quot; rel=&quot;nofollow&quot;&gt;Long Term Capital Management&lt;/a&gt; for an example of what can happen when you make that mistake.&lt;/p&gt;&#xA;" OwnerUserId="19959" LastEditorUserId="19959" LastEditDate="2016-08-27T01:49:52.643" LastActivityDate="2016-08-27T01:49:52.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29857" PostTypeId="2" ParentId="29855" CreationDate="2016-08-26T18:27:40.337" Score="1" Body="&lt;p&gt;The prices come from the market.  One common source is Reuters.  For items not traded in open markets you might assemble a set of bids from various counter parties.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Volatilities are derived from the market prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many places use the market prices as inputs to calibrate shocks to their models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Traders might get &quot;correct&quot; prices from their models which they use to decide when to buy and sell and what.  However, just because their model says the correct price is $X does not mean they can get that price in the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The models are an attempt to estimate what the correct price is but come with a lot of assumptions that aren't necessarily true such as (and varying depending on the model):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Prices are independent of each other.&lt;/li&gt;&#xA;&lt;li&gt;Prices form a random distribution.&lt;/li&gt;&#xA;&lt;li&gt;Prices form a normal random distribution.&lt;/li&gt;&#xA;&lt;li&gt;Everyone is a rational actor.&lt;/li&gt;&#xA;&lt;li&gt;Prices adjust as continuous function with no discontinuities.&lt;/li&gt;&#xA;&lt;li&gt;Markets clear instantly.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;As drobertson points out a study of LTCM (a good book is &lt;em&gt;When Genius Failled&lt;/em&gt;) will introduce you to a lot of potential issues mapping the model to the real world.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the prices to exactly match the model requires magical thinking, specifically of the &quot;the map is the terrain&quot; sort.&lt;/p&gt;&#xA;" OwnerUserId="9413" LastEditorUserId="9413" LastEditDate="2016-08-26T19:01:52.833" LastActivityDate="2016-08-26T19:01:52.833" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="29858" PostTypeId="2" ParentId="17610" CreationDate="2016-08-26T20:00:10.307" Score="1" Body="&lt;p&gt;For the most part there is no serious difficulty in modelling with negative interest rates.  Some of the earliest and most widely-used interest rate models are Gaussian, so admit the possibility of negative interest rates.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other models, like CIR, as you point out do not allow negative rates.  These are unsurprisingly less-preferred now.  There has been some effort to make extensions of models to allow negative rates.  One approach is to &quot;shift&quot; the model, replacing rate $r$ with $r-c$ for some constant $c $.  That has the effect of making a new lower bound $-c $ for a model which formerly had $0$ as the lower bound for the interest rate.  Another possibility is to modify the dynamics to allow negative rates.  For example there is a &quot;Free boundary&quot; variation of SABR [1].&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your example of the American call price is trivial -- the result was only an academic curiosity anyway.  Real stocks have dividends and borrow costs and the theorem wouldn't typically apply anyway.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also don't believe there is any problem with Markowitz theory if the risk-free rate of return is negative.  The efficient frontier analysis is all relative, why does it matter?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[1] &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2557046&quot; rel=&quot;nofollow&quot;&gt;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2557046&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2016-08-26T20:00:10.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29859" PostTypeId="2" ParentId="22227" CreationDate="2016-08-26T20:59:46.203" Score="1" Body="&lt;p&gt;For the general case, the first question is &quot;what do you mean by delta&quot;.  Only in local volatility models is it theoretically possible to hedge continuously with the spot to replicate the option payoff.  With stochastic volatility or jumps, a spot hedge will not be perfect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One answer to &quot;what is delta&quot; is the derivative of option price with respect to spot, holding other model parameters fixed.  That is not natural, though, since it depends on how you parameterize your model.  You can change coordinates, giving what is financially an exactly equivalent model, but delta defined this way will be different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A common solution is to hold market data fixed.  There is some calibration of the model to market data that is treated as a black box.  Delta is defined as the change of option price (under the calibrated model) with respect to change of spot where other calibration market data is held fixed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A third possibility is to define delta as the hedge ratio which produces the minimum variance (according to the model) for option price as spot moves an infintesimal amount.  Here when spot and vol moves are correlated, the vol is assumed to move as spot moves according to that correlation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A fourth possibility specifically in the case of vanilla options is to use the delta under the Black-Scholes model for the inplied volatility of the option in question.  So when different options are priced as having different volatilities, as for a stochastic volatility model, the delta used is from the Black-Scholes model with different volatilites for different strikes and maturities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of the local volatility model, where there is an exact spot hedge, the answer to the question is &quot;yes&quot;.  The delta is the probability under the asset measure of the call finisihing in the money, and this probability increases monotonically with the spot level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For other cases, it will depend on which definition of delta.  Too many possibilities for me here!     &lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2016-08-26T20:59:46.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29860" PostTypeId="1" CreationDate="2016-08-26T22:43:17.997" Score="0" ViewCount="374" Body="&lt;p&gt;I need to model the probability distribution of the values generated from a recombining trinomial tree after n steps&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i.e. a recombining tree with three forward steps (up, down or no change) from each node, and an inverse relationship between the up and down multipliers&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there formulae available for the probabilities associated with each terminal node? Any help would be much appreciated&lt;/p&gt;&#xA;" OwnerUserId="24145" LastActivityDate="2016-08-30T08:04:52.290" Title="Terminal node probabilities for a trinomial tree" Tags="&lt;options&gt;&lt;option-pricing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29861" PostTypeId="2" ParentId="27828" CreationDate="2016-08-27T10:55:08.130" Score="1" Body="&lt;p&gt;$h(\theta)=\nabla H(\theta)=\mathbb{E}\left[(\theta-Z)G^2(Z)e^{-\theta Z+\frac{1}{2}\theta^2}\right]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so just take a bunch of paths and evaluate&#xA;$$&#xA;(\theta-Z)G^2(Z)e^{-\theta Z+\frac{1}{2}\theta^2}&#xA;$$on them and take the average.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2016-08-27T10:55:08.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29862" PostTypeId="1" CreationDate="2016-08-27T15:06:11.320" Score="1" ViewCount="398" Body="&lt;p&gt;Is there any libraries available in python which uses pandas and can be used for backtesting a strategy as well as develop it into a live trading system ?&lt;/p&gt;&#xA;" OwnerUserId="16754" LastEditorUserId="2183" LastEditDate="2017-07-09T06:32:41.787" LastActivityDate="2017-07-09T06:32:41.787" Title="Which libraries in python can be used for backtesting and live trading with pandas?" Tags="&lt;python&gt;&lt;software&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29864" PostTypeId="2" ParentId="29862" CreationDate="2016-08-27T15:39:32.060" Score="4" Body="&lt;p&gt;&lt;a href=&quot;https://pypi.python.org/pypi/zipline&quot; rel=&quot;nofollow&quot;&gt;Zipline&lt;/a&gt; is a trading library that does exactly this.&lt;/p&gt;&#xA;" OwnerUserId="19786" LastActivityDate="2016-08-27T15:39:32.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29865" PostTypeId="1" CreationDate="2016-08-27T17:56:16.183" Score="5" ViewCount="232" Body="&lt;p&gt;My question contains many parts, but I will try to keep it somewhat focused. I am primarily looking for a framework to evaluate the accuracy of a stock-focused Options Pricing Model. One of the hardest questions seems to be determining what the right answer is, even in hindsight.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most common pricing models seem to work on the basic framework established by Black, Scholes, and Merton. There is an interest rate component, some base probability distribution and a way to relate those to time and underlying price changes. Each model gives roughly similar answers, but can differ in many details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for generally accepted approaches to evaluate the output of these models vs reality. My goal is to be able to run the models on a moderately large batch of stocks (~top 300 by options liquidity) for the last 15 years and generate quantitative measurements about their effectiveness. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;These measurements would allow me to rank the models relative to each other. This would be compared to market factors to determine the overall quality of the model and how its quality changes in particular market conditions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At this point, my main focus is comparing the Implied Volatility output of the function to the future reality. My assumption, and I am specifically asking for feedback on this, is that an OPM with a lower Implied Volatility vs Realized Volatility error measurement would be considered a more accurate model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This would not be used to rate the OPM directly. I am honestly not sure what the &quot;Correct&quot; error rate would be or what that would mean. The goal is to compare error rates between different models side by side over the same data set. This should allow me to determine which is the comparatively better model based on its ranking of error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am following the basic theory that all options prices represent a pricing of future risk by the market. The information traders use to determine risk is incomplete and therefore contains a natural (but possibly varying) level of prediction error. Option Pricing Models induce an additional level of error based on their underlying assumptions. A &quot;Better&quot; model would be one that induces a lower level of error vs the realized volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So here are the specifics;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Does comparing Implied Volatility to Realized Volatility make sense as a quantitative measurement of an OPM's effectiveness?&lt;/li&gt;&#xA;&lt;li&gt;Is there anything fundamentally wrong with this concept I should be aware of?&lt;/li&gt;&#xA;&lt;li&gt;Are there any generally accepted methodologies for doing this analysis?&lt;/li&gt;&#xA;&lt;li&gt;Are there other measurements of an OPM's effectiveness that are better or should be considered?&lt;/li&gt;&#xA;&lt;li&gt;What comparisons would make the results of this analysis useful for model selection? (ie vs Interest Rates, vs Historic Volatility, vs Market Shocks, vs Time to Expiration, vs strike distance, etc...)&lt;/li&gt;&#xA;&lt;li&gt;What OPMs should be included in the analysis? (Taking nominations and I will share results.)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I would appreciate constructive comments on the overall concept, but analysis approaches, previous papers and tool suggestions would be more helpful. I am using R, MATLAB and C# (or .NET in general) as my toolkit for doing the work. Any pre-existing tools that would work with those would be extremely appreciated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The computational efficiency of the model isn't as relevant in this situation, but I may want to compare that at a different time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the results are meaningful in any way I am happy to share them and I would welcome collaboration if anyone is interested (make a note in the comments.) &lt;/p&gt;&#xA;" OwnerUserId="19959" LastEditorUserId="19959" LastEditDate="2016-08-28T06:40:06.437" LastActivityDate="2016-08-28T06:40:06.437" Title="Quantitative approaches to measuring the effectiveness of a Stock Option Pricing Model?" Tags="&lt;option-pricing&gt;&lt;implied-volatility&gt;&lt;research&gt;" AnswerCount="0" CommentCount="12" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29866" PostTypeId="2" ParentId="14619" CreationDate="2016-08-27T18:21:35.913" Score="0" Body="&lt;p&gt;I wouldn't go that way at all. There are very good commercial libraries that are well tested. &#xA;Personally I don't justify the effort and cost that will take you to do it from scratch. &#xA;More over, think on the maintenance of that code, testing, etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And as final note, everybody is moving towards fpga... So that libraries will be worthless on that. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's my personal preference. &#xA;Hope helps &lt;/p&gt;&#xA;" OwnerUserId="13990" LastActivityDate="2016-08-27T18:21:35.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29867" PostTypeId="1" CreationDate="2016-08-27T20:26:44.743" Score="5" ViewCount="195" Body="&lt;p&gt;I'm looking for the fastest way to get up-and-running collecting time-series data (mainly through scraping and through 3rd party APIs), storing it and visualizing it on a dashboard with graphs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to create custom dashboards for each of the markets I'm invested in, which show everything from asset prices, to twitter sentiment, to fundamentals and technicals. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;TradingView.com is great for technical analysis, but I am looking to monitor much more in-depth datasets which it does not offer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am currently looking at the TICK stack to get started (&lt;a href=&quot;https://influxdata.com/&quot; rel=&quot;noreferrer&quot;&gt;https://influxdata.com/&lt;/a&gt;). However, it seems much more geared towards IoT and server monitoring. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any other industry standard software stacks available for this application?&lt;/p&gt;&#xA;" OwnerUserId="24152" LastActivityDate="2016-08-27T20:26:44.743" Title="What are some standard software stacks for financial data collection, storage and visualization?" Tags="&lt;database&gt;&lt;visualization&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29868" PostTypeId="2" ParentId="29808" CreationDate="2016-08-27T22:19:26.963" Score="1" Body="&lt;p&gt;Your optimal portfolio is a compromise between high return and low variance. &#xA;The simplest reason for an asset to be strongly weighted in the optimal portfolio is that this asset by itself has an above average ratio of return to variance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively the asset correlates to other assets in a way, that the assets together have a favorable return to variance ratio. In the most extreme case that would happen, if two assets are negativly correlated but both have positive return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your optimal portfolio consist of assets that together maximally diversify (maybe even hedge) each other and simultaniously offer the best reward.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is true for all utility functions that balance return and variance somehow and therefore not specific to your specific form.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your optimal portfolio obviously lies on the efficient frontier.&lt;/p&gt;&#xA;" OwnerUserId="22686" LastActivityDate="2016-08-27T22:19:26.963" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29869" PostTypeId="1" AcceptedAnswerId="31216" CreationDate="2016-08-28T01:40:26.413" Score="0" ViewCount="2678" Body="&lt;p&gt;From this &lt;a href=&quot;https://en.wikipedia.org/wiki/Financial_instrument&quot; rel=&quot;nofollow&quot;&gt;link&lt;/a&gt;: where explained the relationship between asset-classes and financial-instrument types &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's good, but &lt;a href=&quot;http://www.economywatch.com/investment/financial-products.html&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; -Types of financial products: shares, bonds&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So is Financial Instrument = Financial Product ?&lt;/p&gt;&#xA;" OwnerUserId="19132" LastActivityDate="2016-11-27T17:24:44.800" Title="Financial Instrument vs Financial Product" Tags="&lt;trading&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29871" PostTypeId="1" CreationDate="2016-08-29T01:40:07.417" Score="1" ViewCount="69" Body="&lt;p&gt;I have identified a model using principal component regression where $Y_t$ is explained by 4 factors such as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Y_t = \beta_1 X_{1t} + \beta_2 X_{2t} + \beta_3 X_{3t} + \beta_4 X_{4t} + \epsilon_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where: $Y, X_1, X_2, X_3, X_4$ are $\text{I(1)}$ variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I check that $\epsilon_t$ is stationary, can I assume that the variables are co-integrated and hence there was no spurious regression in my principal component regression?&lt;/p&gt;&#xA;" OwnerUserId="24164" LastEditorDisplayName="user16651" LastEditDate="2016-08-29T05:54:43.487" LastActivityDate="2016-08-29T16:39:35.597" Title="How do I test if my betas form a co-integrated vector?" Tags="&lt;regression&gt;&lt;cointegration&gt;&lt;pca&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29872" PostTypeId="1" AcceptedAnswerId="29874" CreationDate="2016-08-29T04:17:09.143" Score="2" ViewCount="4509" Body="&lt;p&gt;Here we want to &lt;strong&gt;show that the Box-Muller method generates a pair of independent standard Gaussian random variables&lt;/strong&gt;. But I don't understand why we use the determinant? For me when you have two independent variables the joint density function is only the product of the two density function. Someone can explain me the meaning of the determinant here? Please.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/iS9La.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/iS9La.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="24166" LastEditorDisplayName="user16651" LastEditDate="2016-08-29T05:49:39.423" LastActivityDate="2020-08-07T19:45:29.017" Title="Box-Muller Method Proof" Tags="&lt;probability&gt;&lt;normal-distribution&gt;&lt;random-variables&gt;&lt;box-muller&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29873" PostTypeId="1" CreationDate="2016-08-29T05:05:44.737" Score="0" ViewCount="104" Body="&lt;p&gt;This is almost certainly going to make me seem like a novice, but googling for answers is very difficult for this sort of thing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My friend asked me to take a look at some forex data recently. My instincts for vector-valued time series are to plot some pictures and try models. If I have to pre-process the data, I generally know what's acceptable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my question: is it more interpretable to convert everything into the base currency? Is this commonly done? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say we have four countries: A,B, C and D, and I'm from country C. Say we have available at some time $(\frac{A}{D}, \frac{A}{C},\frac{B}{C})$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of modelling $(\frac{A}{D}, \frac{A}{C},\frac{B}{C})$ directly shouldn't we model $(\frac{A}{C},\frac{B}{C},\frac{D}{C})$? Here $\frac{D}{C} = \frac{A}{C}/\frac{A}{D}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now everything is in the same units, and this also facilitates profit calculations. Or does all of this depend on the models I'm using? Is it more common to model these levels, or their changes? Or maybe even their returns?&lt;/p&gt;&#xA;" OwnerUserId="1870" LastActivityDate="2016-08-29T05:05:44.737" Title="Common pre-processing steps for forex data" Tags="&lt;time-series&gt;&lt;fx&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29874" PostTypeId="2" ParentId="29872" CreationDate="2016-08-29T05:45:08.917" Score="2" Body="&lt;p&gt;Let $Z=\sqrt{-2\ln(X_1)}$, We have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;\mathbb{P}\left[Z \leq z\right]  = \mathbb{P}\left[-2 \ln(X_1) \leq z^2\right] &#xA;= \mathbb{P}\left[\ln(X_1) \geq -\frac{z^2}{2}\right]  = 1 - \mathbb{P}\biggl[X_1 &amp;lt; \exp\left(-\frac{z^2}{2}\right)\biggr]\, &#xA;\end{align}&#xA;$X_1$ is uniformly defined on $[0, 1]$, therefore &#xA;$$\mathbb{P}[Z\leq z] = 1 - \int_0^{\exp(-z^2/2)} \, dt = 1 - \exp\left(-\frac{z^2}{2}\right).$$&#xA;Indeed&#xA;$$f_Z(z)=\begin{cases}&#xA;\exp\left(-\frac{z^2}{2}\right),\quad z&amp;gt;0\\&#xA;0\qquad\qquad,\quad \text{o.w}&#xA;\end{cases}$$&#xA;let $W=2\pi X_2$. Hence $X_2$ is uniformly distributed on $[0,1]$, so&#xA;$$f_W(w)=\begin{cases}&#xA;\frac{1}{2\pi},\quad 0&amp;lt; w\le 2\pi\\&#xA;0\,\,\,\,, \quad\text{o.w}&#xA;\end{cases}$$&#xA;Since $X_1$ and $X_2$ are independent, $Z$ and $W$ should be independent. We have&#xA;$$f_{Z,W}(z,w)=f_{Z}(z)f_{W}(w)=&#xA;\begin{cases}&#xA;\frac{1}{2\pi}\exp\left(-\frac{z^2}{2}\right),\quad z&amp;gt;0\quad \text{and}\quad 0&amp;lt; w\le 2\pi\\&#xA;0\qquad\qquad\quad\,,\quad \text{o.w}&#xA;\end{cases}$$&#xA;Define function $q:(0,\infty)\times(0,2\pi]\to \mathbb{R}^2$ such that $q(z,w)=(z\cos(w),z\sin(w))$&#xA;thus&#xA;$$\mathbb{P}_{Y_1,Y_2}=\mathbb{P}_{Z,W}\circ q^{-1}$$&#xA;in other words&#xA;$$q_{Y_1,Y_2}(y_1,y_2)=\frac{f_{Z, W}(q^{-1}(y_1, y_2))}{|\det(q'(q^{-1}(y_1, y_2)))|}$$&#xA;we can show easily&#xA;$$z=\sqrt{y_1^2+y_2^2}$$&#xA;then&#xA;$$q_{Y_1,Y_2}(y_1,y_2) = \frac{1}{2 \pi} \exp\left(-\frac{y_1^2 + y_2^2}{2}\right)$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-08-29T06:03:39.810" LastActivityDate="2016-08-29T06:03:39.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29875" PostTypeId="2" ParentId="29869" CreationDate="2016-08-29T09:06:01.250" Score="0" Body="&lt;p&gt;The instrument has a direct correlation with market information (Option, Future, CFD ...), whereas product is generally an account, Bonds, Shares and loan.&lt;/p&gt;&#xA;" OwnerUserId="16927" LastActivityDate="2016-08-29T09:06:01.250" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29877" PostTypeId="2" ParentId="10354" CreationDate="2016-08-29T09:37:09.507" Score="5" Body="&lt;p&gt;In your implementation, you are approximating continuous integrals over the strike domain by Riemann sums. This introduces an error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More specifically, for a fixed time to expiry $\tau$, you're integrating (scaled) OTM price curves (see equations $(3)-(4)-(5)$). As volatility increases, these curves will stretch over &lt;em&gt;wider and wider spatial domains&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When using a &lt;em&gt;fixed strike range&lt;/em&gt; for approximating the integrals, the truncation error will therefore mechanically increase as you will less and less be able to capture what happens in the `tails'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/rPvt6.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/rPvt6.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2016-08-29T09:37:09.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29878" PostTypeId="1" CreationDate="2016-08-29T09:51:37.170" Score="1" ViewCount="284" Body="&lt;p&gt;I am trying to write a simple backtester using python and pandas. I have reused the code of &lt;a href=&quot;https://s3.amazonaws.com/quantstart/media/powerpoint/an-introduction-to-backtesting.pdf&quot; rel=&quot;nofollow&quot;&gt;Michael halls moore's&lt;/a&gt; pandas backtester. I rewrote the programme because first I want to understand how backtesting works and secondly I found (for me) the original code hard to understand.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the rewrote code&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import datetime&#xA;import pandas as pd&#xA;import numpy as np&#xA;from pandas.io.data import DataReader&#xA;&#xA;#download data&#xA;&#xA;start=datetime.datetime(2000,1,1)&#xA;end=datetime.datetime(2012,1,1)&#xA;&#xA;ibm = DataReader('IBM',  'yahoo', start ,end )&#xA;&#xA;#technical analysis library&#xA;#https://www.quantopian.com/posts/technical-analysis-indicators-without-talib-code&#xA;&#xA;def MA(df, n):  &#xA;    MA = pd.Series(pd.rolling_mean(df, n), name = 'MA_' + str(n))  &#xA;    df =MA&#xA;    return df&#xA;&#xA;def gen_signals(df,fast=10,slow=30):&#xA;    signals=pd.DataFrame(index=df.index)&#xA;    signals['signal']=0&#xA;    signals['price']=df&#xA;&#xA;    #fast slow moving average&#xA;    signals['fast']=MA(signals['price'],fast)&#xA;    signals['slow']=MA(signals['price'],slow)&#xA;&#xA;    #if fast sma is greater than slow sma then 1 else 0&#xA;    signals['signal']=np.where(signals['fast']&amp;gt;signals['slow'],1,0)&#xA;&#xA;    #taking difference to genrate actual trading order&#xA;    signals['positions']=signals['signal'].diff()&#xA;    return signals&#xA;&#xA;&#xA;def gen_positions(self):&#xA;    positions=pd.DataFrame(index=self.index).fillna(0.0)&#xA;    positions['position']=10*self['signal'] #10 shares/signal&#xA;    return positions&#xA;&#xA;def backtest(positions,price,initial_capital=10000):&#xA;    #creating protfolio&#xA;    portfolio =positions*price['price']    &#xA;    pos_diff=positions.diff()&#xA;&#xA;    #creating holidings&#xA;    portfolio['holidings']=(positions*price['price']).sum(axis=1)&#xA;    portfolio['cash']=initial_capital-(pos_diff*price['price']).sum(axis=1).cumsum()&#xA;&#xA;    #full account equity&#xA;    portfolio['total']=portfolio['cash']+ portfolio['holidings']&#xA;    portfolio['return']=portfolio['total'].pct_change()&#xA;    return portfolio&#xA;&#xA;#signal generation&#xA;sig=gen_signals(ibm['Close'],fast=5,slow=25)&#xA;sig.head(3)&#xA;&#xA;#positon genration&#xA;pos=gen_positions(sig)&#xA;pos.tail(3)&#xA;&#xA;#backtesting&#xA;re=backtest(pos,sig)&#xA;re.head()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But the out put result is this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;            2011-12-30 00:00:00  position  holidings  cash  total  return  &#xA;Date                                                                       &#xA;2000-01-03                  NaN       NaN        NaN   NaN    NaN     NaN  &#xA;2000-01-04                  NaN       NaN        NaN   NaN    NaN     NaN  &#xA;2000-01-05                  NaN       NaN        NaN   NaN    NaN     NaN  &#xA;2000-01-06                  NaN       NaN        NaN   NaN    NaN     NaN  &#xA;2000-01-07                  NaN       NaN        NaN   NaN    NaN     NaN  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any idea why its happening?&lt;/p&gt;&#xA;" OwnerUserId="16754" LastActivityDate="2016-08-29T13:36:00.300" Title="What is wrong in this python backtester?" Tags="&lt;programming&gt;&lt;backtesting&gt;&lt;python&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2016-08-29T16:48:27.753" ContentLicense="CC BY-SA 3.0" />
  <row Id="29879" PostTypeId="2" ParentId="27873" CreationDate="2016-08-29T10:23:36.177" Score="2" Body="&lt;p&gt;When using EVT and fitting the GPD the threshold level is a choice, and there is no definitive level at which it should be set, though people commonly initially try the most extreme 10% of the data. You should check that your result is not highly sensitive to the threshold, and note that there is no definitive level of sensitivity that is &quot;correct.&quot; But this lack of sensitivity to threshold level is an indication of the appropriateness of using the GPD. It is not surprising that the expected value of your GPD is 10% higher than the average value of losses over the threshold, and that in itself does not mean the GPD is a bad fit.&lt;/p&gt;&#xA;" OwnerUserId="22326" LastActivityDate="2016-08-29T10:23:36.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29881" PostTypeId="1" AcceptedAnswerId="29892" CreationDate="2016-08-29T12:14:58.093" Score="2" ViewCount="257" Body="&lt;p&gt;As a follow up to a &lt;a href=&quot;https://quant.stackexchange.com/q/29855/11645&quot;&gt;recent question&lt;/a&gt; on why market prices and model prices can sometimes differ substantially, this resulted in a new question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do traders come up with prices?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Example: Let's say someone wants to buy a swaption. I always assumed it worked like this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Backoffices continuously collect data and recalibrate the pricing models, for example forward rates or option prices (volatilities) are used to calibrate SABR-Parameters.&lt;/li&gt;&#xA;&lt;li&gt;A trader who wants to sell a swaption uses the bank's pricing library to get an estimate for the fair value of the swaption.&lt;/li&gt;&#xA;&lt;li&gt;The trader adds a few basis points to the NPV from step 2 as a fee.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This does not seem to be the standard approach, so what is actually happening?&lt;/p&gt;&#xA;" OwnerUserId="11645" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-08-29T15:41:23.303" Title="How do traders come up with prices for derivatives?" Tags="&lt;pricing&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="29882" PostTypeId="1" CreationDate="2016-08-29T12:36:29.893" Score="3" ViewCount="1702" Body="&lt;p&gt;I've got an ARIMA model (with a GARCH model for variance estimation) and parameters estimated in Matlab for my set of data. Now I need to use this model in my Java based application for making forecasts for new data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any free Java libraries with such functionality (mainly interested in analog of ARIMA/forecast functionality from Matlab without estimating etc.)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I only found commercial SuanShu (from NumericalMethods) and IMSL from RogueWave. They are cool but cost money.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course there is way to do own implementation for forecasting but not sure if I have time for that. Using remote connection to Matlab / R server is too not suitable in my case. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So any help would be appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: Actually any C/C++ libraries would be fine too cause I could use JNI/JNA for calling it.&lt;/p&gt;&#xA;" OwnerUserId="13348" LastEditorUserId="33410" LastEditDate="2018-05-23T06:26:56.050" LastActivityDate="2020-05-25T18:56:51.833" Title="Please advice free Java library for classical time series forecasting" Tags="&lt;programming&gt;&lt;forecasting&gt;&lt;arima&gt;&lt;library&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="29883" PostTypeId="2" ParentId="10992" CreationDate="2016-08-29T12:59:24.847" Score="11" Body="&lt;p&gt;Assume a constant risk-free rate $r$ and no dividends. Generalisation is straightforward. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To preclude arbitrage opportunities, under the risk-neutral measure $\Bbb{Q}$, the discounted asset price process should be a $\Bbb{Q}$-martingale i.e. &#xA;$$ S_0 = \Bbb{E}^\Bbb{Q}_0 \left[ e^{-rt} S_t \right] \iff \Bbb{E}^\Bbb{Q}_0 \left[ S_t \right]  = S_0 \exp(rt) \tag{1} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, rewriting your equation as&#xA;\begin{align}&#xA;S_t &amp;amp;= S_0 \exp(\alpha t) \mathcal{E}(\sigma W_t) \exp(-\beta \lambda t + J_t) &#xA;\end{align}&#xA;where $ J_t = \sum_{i=1}^{N_t} Y_i $ denotes a compound Poisson process with $\{Y_i\}_{i=1}^\infty$ i.i.d. random variables and $N_t$ a Poisson process of intensity $\lambda$, and taking the expectation under $\Bbb{Q}$ bearing in mind that the Wiener process is independent from the compound Poisson process yields&#xA;\begin{align}&#xA;\Bbb{E}_0^\Bbb{Q} [S_t] &amp;amp;= S_0 \exp(\alpha t) \exp(-\beta \lambda t ) \Bbb{E}_0^\Bbb Q[\exp(J_t)] \tag{2}&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Comparing the above expressions, we see that $(1)$ is consistent with $(2)$ if and only if $ \alpha = r $ and $ \beta $ is such that &#xA;$ \Bbb{E}_0^\Bbb{Q}[ \exp(J_t) ] = \exp(\beta \lambda t ) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Evaluating $\Bbb{E}_0^\Bbb{Q}[ \exp(J_t) ]$ gives&#xA;\begin{align}&#xA;\Bbb{E}_0^\Bbb{Q}[ \exp(J_t) ] &amp;amp;= \Bbb{E}_0^\Bbb{Q} \left[ \exp \left(\sum_{i=1}^{N_t} Y_i\right) \right] \\&#xA;&amp;amp;=  \Bbb{E}_0^\Bbb{Q} \left[ \Bbb{E}_t^\Bbb{Q} \left[ \exp \left(\sum_{i=1}^{N_t} Y_i\right) \right] \right] \\&#xA;&amp;amp;= \sum_{n=0}^\infty \Bbb{E} \left[ \exp\left(\sum_{i=1}^n Y_i\right) \right] \Bbb{Q}(N_t = n) \\&#xA;&amp;amp;= \sum_{n=0}^\infty \prod_{i=1}^n \Bbb{E} \left[\exp(Y_i) \right]  \Bbb{Q}(N_t = n) \\&#xA;&amp;amp;= \sum_{n=0}^\infty \left( \Bbb{E} \left[ \exp(Y_1) \right] \right)^n \Bbb{Q}(N_t = n)  \\&#xA;&amp;amp;= e^{-\lambda t} \sum_{n=0}^\infty \left( \Bbb{E} \left[ \exp(Y_1) \right] \right)^n \frac{(\lambda t)^n}{n!} \\&#xA;&amp;amp;= \exp \left(\Bbb{E} \left[ \exp(Y_1) \right] - 1)\lambda t \right)  &#xA;\end{align}&#xA;thereby showing that, under $\Bbb{Q}$, it is enough that $$ \alpha = r,\ \ \beta = \Bbb{E} \left[ \exp(Y_1) \right] - 1 $$&#xA;to preclude arbitrage opportunities.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-09-30T13:57:04.963" LastActivityDate="2016-09-30T13:57:04.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29884" PostTypeId="2" ParentId="29878" CreationDate="2016-08-29T13:36:00.300" Score="1" Body="&lt;p&gt;You are getting cross-product instead of value by value multiplication in this line:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;portfolio = positions*price['price']    &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I suspect you need something like that (use .position filed from your dataframe) :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;portfolio = positions['position']*price['price']    &#xA;pos_diff = positions['position'].diff()&#xA;&#xA;#creating holidings&#xA;portfolio['holidings'] = (positions['position']*price['price']).sum()&#xA;portfolio['cash'] = initial_capitalpos_diff*price['price']).sum().cumsum()&#xA;....&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13348" LastActivityDate="2016-08-29T13:36:00.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29885" PostTypeId="1" AcceptedAnswerId="29890" CreationDate="2016-08-29T13:53:40.723" Score="3" ViewCount="5868" Body="&lt;p&gt;Consider Black Scholes dynamics for the stock price &#xA;$$dS_t=\mu S_tdt+\sigma S_t dW_t$$&#xA;I have &quot;heard&quot; it is difficult hedging barrier options if the payoff suddenly is set to zero by the boundary condition so close to the expiry if the stock price is close to the barrier, hedging issues arise. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, down and out put option where the strike $K$ is above the barrier $L$. But why is that? The partial derivative doesn't exist or the magnitude is very large? What are the work arounds if any? I assume this is the property of the function and has nothing to do with a numerical method used to calculate the solution.&lt;/p&gt;&#xA;" OwnerUserId="22823" LastEditorUserId="22823" LastEditDate="2016-08-29T14:11:46.377" LastActivityDate="2016-08-29T18:38:50.677" Title="hedging barrier options" Tags="&lt;option-pricing&gt;&lt;hedging&gt;&lt;delta-hedging&gt;&lt;exotics&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29888" PostTypeId="1" CreationDate="2016-08-29T14:43:38.140" Score="1" ViewCount="389" Body="&lt;p&gt;I am stuck with obtaining nice relative error of my analytical derivative of a function. I am comparing values of my function at points $x$ and $x+ \delta$ and the difference does not coincide with derivative value at $x$ multiplied by $\delta$.&#xA;I want to calculate derivative of $C$ wrt to $\sigma_i$. &#xA;Maybe I forgot calculus or I am doing silly mistake somewhere and after 10th revision of formula I can not see it. Can you please shed a light on my problem, cause I am crying on it not the first day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have such functions, dependencies: $t$ - independent variable,&#xA;$$C = C(F,K,\sigma,t)$$&#xA;$$F = F(w_i,F_i)$$ &#xA;$$K = K(w_i,K_i)$$&#xA;$$ \sigma = \sigma( w_i,\sigma_i,F_i,t)$$&#xA;$$F_i = F_i( S_i, R_i, \rho_{xi},\sigma_{x},\sigma_i)$$&#xA;$S_i,R_i,\rho_{xi},\sigma_x,\sigma_i,w_i,K_i$ - as well independent variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I right that total derivative:&#xA;$$\frac{dC}{d\sigma_i} = \frac{\partial C}{\partial F}\frac{d F}{d \sigma_i}  + \frac{\partial C}{\partial K}\frac{d K}{d \sigma_i}  +\frac{\partial C}{\partial \sigma}\frac{d \sigma}{d \sigma_i}  +\frac{\partial C}{\partial t} \frac{d t}{d \sigma_i}$$&#xA;hence:&#xA;$$\frac{dC}{d\sigma_i} = \frac{\partial C}{\partial F} (\frac{\partial F}{\partial w_i}\frac{d w_i}{d \sigma_i} + \frac{\partial F}{\partial F_i}\frac{d F_i}{d \sigma_i}) + 0 + \frac{\partial C}{\partial \sigma}(\frac{\partial \sigma}{\partial w_i}\frac{d w_i}{d \sigma_i} + \frac{\partial \sigma}{\partial \sigma_i}\frac{d \sigma_i}{d \sigma_i} + \frac{\partial \sigma}{\partial F_i}\frac{d F_i}{d \sigma_i} + \frac{\partial \sigma}{\partial t}\frac{d t}{d \sigma_i} ) + 0 $$&#xA;$$\frac{dC}{d\sigma_i} = \frac{\partial C}{\partial F} (0 + \frac{\partial F}{\partial F_i}\frac{d F_i}{d \sigma_i}) + 0 + \frac{\partial C}{\partial \sigma}( 0  + \frac{\partial \sigma}{\partial \sigma_i} + \frac{\partial \sigma}{\partial F_i}\frac{d F_i}{d \sigma_i} + 0) + 0 $$&#xA;Have I omitten something?&#xA;$$\frac{dC}{d\sigma_i} = \frac{\partial C}{\partial F} \frac{\partial F}{\partial F_i}\frac{d F_i}{d \sigma_i} + \frac{\partial C}{\partial \sigma}\frac{\partial \sigma}{\partial \sigma_i} + \frac{\partial C}{\partial \sigma}\frac{\partial \sigma}{\partial F_i}\frac{d F_i}{d \sigma_i} $$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is it a correct way to compute vega wrt to one of the assets in my basket :$\frac{dC}{d\sigma_i} $? I am askying so as I know that partial derivative of $C$ wrt to $\sigma$ is a vega.&lt;/li&gt;&#xA;&lt;li&gt;Interesting, but if I put last summand, i.e. $\frac{\partial C}{\partial \sigma}\frac{\partial \sigma}{\partial F_i}\frac{d F_i}{d \sigma_i} $ to $0$ then I get &lt;strong&gt;perfect relative error&lt;/strong&gt;. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;But I am lost, because apparently it is not $0$.&lt;/p&gt;&#xA;" OwnerUserId="22733" LastEditorUserId="22733" LastEditDate="2016-09-07T16:20:21.040" LastActivityDate="2016-09-07T16:20:21.040" Title="Calculating Greeks for basket option" Tags="&lt;greeks&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29889" PostTypeId="2" ParentId="29885" CreationDate="2016-08-29T14:59:16.313" Score="2" Body="&lt;p&gt;Since you have tagged your question with delta-hedging I assume we delta hedge the option with the underlying. Here difficulties would arise if the amount of underlying contracts we need to exchange to keep the delta near zero is large compared to illiquidity and transaction costs. With these together with volatility about constant, transaction costs would increase with gamma. As gamma gets very high, typically but not only, for plain vanilla options at the money near expiry, delta hedging gets very expensive.&lt;/p&gt;&#xA;" OwnerUserId="23886" LastActivityDate="2016-08-29T14:59:16.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29890" PostTypeId="2" ParentId="29885" CreationDate="2016-08-29T15:00:55.697" Score="1" Body="&lt;p&gt;As you know, Barrier options are extensions of vanilla options in the sense that they have a barrier level which activates or deactivates the option's pay-off upon hitting the barrier. The barrier can be hit when the option is in-the-money or out-of-money. Barrier options which are activated upon hitting the&#xA;barrier are called Knock-in barrier options or simply Ins and those that are instead deactivated are known as Knock-out barrier options or Outs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In knock-out options, if the barrier is not hit by the underlying price from the time of issuance of the option to its maturity, then the option&#xA;holder receives an equivalent pay-off of a vanilla option.Knock-in options only provide a possibility of a positive pay-off after the barrier has been hit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When a barrier option knocks-in, it becomes an equivalent vanilla option and thus, offers the same pay-off whereas a knock-out is equivalent to the corresponding vanilla option as long as the barrier is not hit until maturity (exercise time).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Mathematically speaking&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $M_T=\max\{S_t\, ,\, 0\le t\le T\}$ and $m_T=\min\{S_t\, ,\, 0\le t\le T\}$&#xA;then the payoffs of down-and-out-call  and down-and-out put  respectively are given by&#xA;$$(S_T-K)^+ \mathbb{I}_{\{m_T&amp;gt;L\}}$$&#xA;$$(K-S_T)^+ \mathbb{I}_{\{m_T&amp;gt;L\}}$$&#xA;and the payoffs for the up-and-out call and up-and-out put are given as follows&#xA;$$(S_T-K)^+ \mathbb{I}_{\{M_T&amp;gt;L\}}$$&#xA;$$(K-S_T)^+ \mathbb{I}_{\{M_T&amp;gt;L\}}$$&#xA;Knock-in options give a payoff equivalent to that of an equivalent vanilla option at maturity only when the barrier is hit otherwise the payoff is zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A portfolio consisting of one knock-in call and one knock-out call is equivalent to an ordinary call option,that is,&#xA;$$\text{up-and-out call + up-and-in call}=\text{vanilla call}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, for the other barrier options we have the following relationships,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{down-and-out call + down-and-in call}=\text{vanilla call}$$&#xA;and&#xA;$$\text{up-and-out put + up-and-in put}=\text{vanilla put}$$&#xA;$$\text{down-and-out put + down-and-in put}=\text{vanilla put}$$&#xA;&lt;strong&gt;Reference&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Lishang Jiang, &lt;a href=&quot;http://www.worldscientific.com/doi/pdf/10.1142/9789812703576_fmatter&quot; rel=&quot;nofollow&quot;&gt;Mathematical modelling and methods of option pricing&lt;/a&gt;, World Scientific Publishing Co. Pte. Ltd., 2003.&lt;/li&gt;&#xA;&lt;li&gt;Michael Kateregga,&lt;a href=&quot;https://www.researchgate.net/publication/269076916_Pricing_and_Hedging_of_Barrier_Options&quot; rel=&quot;nofollow&quot;&gt;Pricing and Hedging of Barrier Options,Thesis&lt;/a&gt; · June 2011.&lt;/li&gt;&#xA;&lt;li&gt;Michael Suchaneck, &lt;a href=&quot;https://books.google.com/books?id=jlOTPgAACAAJ&amp;amp;dq=hedging%20barrier%20options&amp;amp;hl=en&amp;amp;sa=X&amp;amp;ved=0ahUKEwjl-4SW9ebOAhVFnBoKHav1Dk8Q6AEIIjAB&quot; rel=&quot;nofollow&quot;&gt;The Pricing and Hedging of Barrier Options and Their Applications in Finance and Life Insurance&lt;/a&gt;, 2008. &lt;/li&gt;&#xA;&lt;li&gt;Nassim Taleb,&lt;a href=&quot;https://books.google.com/books?id=-5-OldaTjVQC&amp;amp;pg=PR18&amp;amp;dq=hedging%20barrier%20options&amp;amp;hl=en&amp;amp;sa=X&amp;amp;ved=0ahUKEwjl-4SW9ebOAhVFnBoKHav1Dk8Q6AEINjAF#v=onepage&amp;amp;q=hedging%20barrier%20options&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;Dynamic Hedging: Managing Vanilla and Exotic Options&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-08-29T18:38:50.677" LastActivityDate="2016-08-29T18:38:50.677" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29891" PostTypeId="1" CreationDate="2016-08-29T15:21:53.817" Score="1" ViewCount="1035" Body="&lt;p&gt;What are the upper and lower bound of American call and put options for an underlying with continuous dividend yield?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For European options, the bounds are known as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;[S_te^{-d\tau}-Ke^{-r\tau}]^+&amp;lt;C_t&amp;lt;S_te^{-d\tau}\\&#xA;[Ke^{-r\tau}-S_te^{-d\tau}]^+&amp;lt;P_t&amp;lt;Ke^{-r\tau}&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I could not find a clear result regarding American options with dividend yield.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2016-08-31T14:04:58.670" Title="American Option Bounds with Dividend Yield" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29892" PostTypeId="2" ParentId="29881" CreationDate="2016-08-29T15:41:23.303" Score="4" Body="&lt;p&gt;You have two main reasons why market prices are not all perfectly aligned with models:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;each bank uses its own model, its own libraries to calibrate, and its own corrected market prices. You can see this reason as the &lt;strong&gt;secret sauce&lt;/strong&gt; of each bank / desk.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;liquidity costs&lt;/strong&gt; are different from one trade and bank to another: (1) do not forget you have different bid and ask prices for the same product (hence for illiquid products the market &lt;em&gt;prices&lt;/em&gt; are &lt;em&gt;transaction prices&lt;/em&gt;; they can be different for buys than for sells); (2) when collateralization is needed, the availability and price for collateral can be different from one bank to another; (3) last but not least banks take their inventory into account, if you already sold a lot of risk in one direction, you will now sell it at an higher price (to try to net your inventory back to zero).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;To be frank there is a third reason, but I do not like it: some banks / desks may have appetite for risk in given directions. They are ready to take risk. Hence the difference between the &quot;&lt;em&gt;fair price&lt;/em&gt;&quot; (in your views: i.e. price that models are telling) and the proposed price can be different.&#xA;I do not like this third case because banks should be intermediaries (i.e. act as market makers). &lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2016-08-29T15:41:23.303" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29893" PostTypeId="2" ParentId="18054" CreationDate="2016-08-29T16:08:34.433" Score="2" Body="&lt;p&gt;Because American style options allow early exercise, the put-call parity will not hold unless they are held to expiration. Early exercise will result in a departure in the present values of the two portfolios.&lt;/p&gt;&#xA;" OwnerUserId="24172" LastActivityDate="2016-08-29T16:08:34.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29894" PostTypeId="2" ParentId="29871" CreationDate="2016-08-29T16:39:35.597" Score="1" Body="&lt;p&gt;If a regression of an integrated variable on one or more integrated variables yields a stationary residual, the variables are cointegrated. This is a special case of the definition of cointegration. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Make sure to use appropriate null distribution and corresponding critical values when testing for absence of a unit root in $\epsilon_t$. Since $\epsilon_t$ is a residual rather than raw data, it is more likely to appear stationary by construction; that is why you need critical values as in Engle &amp;amp; Granger's procedure rather than the regular critical values of an augmented Dickey-Fuller (ADF) test.&lt;/p&gt;&#xA;" OwnerUserId="19645" LastActivityDate="2016-08-29T16:39:35.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29895" PostTypeId="1" CreationDate="2016-08-29T18:12:00.833" Score="1" ViewCount="292" Body="&lt;p&gt;I am currently doing a research which will need ETF and REITs' historical data back in early 2000s.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is I do not know what symbols existed back in then, unlike indices like S&amp;amp;P and DOW, which I can easily look at the historical components.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any (free) way of downloading a dynamic list of symbols on a daily or monthly basis back in early 2000s?&lt;/p&gt;&#xA;" OwnerUserId="24173" LastEditorUserId="743" LastEditDate="2016-10-31T19:41:37.193" LastActivityDate="2017-04-10T22:29:52.380" Title="How do I get a list of all ETFs / REITs?" Tags="&lt;data&gt;&lt;market-data&gt;&lt;historical-data&gt;&lt;etf&gt;" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29896" PostTypeId="5" CreationDate="2016-08-29T21:04:11.277" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2016-08-29T21:04:11.277" LastActivityDate="2016-08-29T21:04:11.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29897" PostTypeId="4" CreationDate="2016-08-29T21:04:11.277" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2016-08-29T21:04:11.277" LastActivityDate="2016-08-29T21:04:11.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29898" PostTypeId="2" ParentId="18054" CreationDate="2016-08-30T00:22:24.603" Score="0" Body="&lt;p&gt;It could be that the chances of a market falling falling are low, but the move will be large.   Conversely , the market is quite likely to go up, but the move will be smaller.   In other words, the market will either grind higher or fall precipitously.  Thus, the market is in equilibrium , but out of the money puts cost more than out of the money calls.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-08-30T00:22:24.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29899" PostTypeId="1" AcceptedAnswerId="29905" CreationDate="2016-08-30T01:59:12.673" Score="0" ViewCount="776" Body="&lt;p&gt;I am self-studying for an actuarial exam and I am having a hard time understanding what happens when a currency option pays off. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the below problem. The payoff at $C_u$ would be $\max(x_u - K, 0) = \max(1.045\text{ €/\$} - €1, 0)$. The author claims that this payoff is €0.045.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't understand how we can subtract €1 from a &lt;em&gt;rate&lt;/em&gt; of 1.045€/$. One is a currency and one is an exchange rate on currencies, so how is one able to subtract if the units are different and then arrive at a payoff in the unit of the strike? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/fbzbo.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/fbzbo.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5641" LastActivityDate="2016-08-30T15:00:08.203" Title="Understanding the payoff of currency options" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;currency&gt;&lt;self-study&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29900" PostTypeId="2" ParentId="29860" CreationDate="2016-08-30T06:17:51.470" Score="2" Body="&lt;p&gt;The probability after $N$ steps to have $u$ up, $d$ down and $N-u-d$ steps with no change is a multinomal distribution:&#xA;$$P(u,d,N) = {p_{up}}^{u} * {p_{down}}^{d} * {p_{stay}}^{N-u-d} * N!/(u!*d!*(N-u-d)! )&#xA;$$&#xA;Take the sum over all combinations with the same $m=u-d$. Than the probability to land at $m$ steps up from your starting point after $N$ steps, with  $-N \leq m \leq N$ is:&#xA;$$&#xA;P(m, N) = \sum_{d=max(0,-m)}^{floor((N-m)/2)} { {p_{up}}^{m+d} * {p_{down}}^{d} * {p_{stay}}^{N-2d-m} * N!/(d!*(m+d)!*(N-2d-m)! ) }&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="22686" LastEditorUserId="22686" LastEditDate="2016-08-30T08:04:52.290" LastActivityDate="2016-08-30T08:04:52.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29901" PostTypeId="2" ParentId="29891" CreationDate="2016-08-30T08:09:18.303" Score="2" Body="&lt;p&gt;For the lower bound, since american call option (resp. put) is bigger than european call option (resp. put). So your lower bounds for european options hold also for american options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the upper bound, there is a slight difference. (sorry for my too quick comment).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here $S_0,T$ and $K$ are positive real numbers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $C^A_T$ be the american call option of maturity $T$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$K&amp;lt;K' \Rightarrow (x-K)^+\geq (x-K')^+ \Rightarrow C^A_T(S_0,K)\geq C^A_T(S_0,K') $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so $C^A_T(S_0,K)\leq C^A_T(S_0,0)=S_0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $P^A_T$ be the american put option of maturity $T$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming you are in an exponential model (like BS)&#xA;$x\to P^A_T(x,K)$ is non-increasing. Thus, $P^A_T(S_0,K)\leq P^A_T(0,K)=K$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$(S_0e^{-dT}-Ke^{-rT})^+\leq C^A_T(S_0,K) \leq C^A_T(S_0,K) \leq S_0$$&#xA;and&#xA;$$(Ke^{-rT}-S_0e^{-dT})^+ \leq P^A_T(S_0,K)\leq P^A_T(S_0,K) \leq K$$&lt;/p&gt;&#xA;" OwnerUserId="20201" LastEditorUserId="9336" LastEditDate="2016-08-31T14:04:58.670" LastActivityDate="2016-08-31T14:04:58.670" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="29902" PostTypeId="2" ParentId="29899" CreationDate="2016-08-30T10:12:34.963" Score="-1" Body="&lt;p&gt;Having a strike price of 1€ for a currency option means that you will be allowed to buy 1\$ for 1€ e.g. it is an exchange rate.&#xA;Therefore the payoff will be the difference between the two rates.&lt;/p&gt;&#xA;" OwnerUserId="23994" LastActivityDate="2016-08-30T10:12:34.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29905" PostTypeId="2" ParentId="29899" CreationDate="2016-08-30T14:47:57.917" Score="2" Body="&lt;p&gt;You are a European citizen of Italian nationality who has decided to purchase an item in 3 months time. This item is a United States 1 Dollar bill, a piece of paper with a picture of george washington on one side and the US Treasury building on the other. Due to a decision made by President Nixon in 1971 the price of this item is not fixed but fluctuates every day. You are quite certain you will purchase the item but you are concerned that if the price of the dollar rises in the meantime your cost in euros will increase. In particular you do not wish to pay an exchange rate greater than 1.0000 Euros to the dollar; a lower rate would be acceptable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have a wealthy uncle who has made the following generous and valuable offer: he will cover the difference if the exchange rate goes above the 1.0000 eur per dollar that you have in mind. So for example if the exchange rate ends up at 1.045€/$, you will put up 1 € and your uncle will give you 0.045€ out of his pocket, the combined 1.045€ will be used to purchase the bill in the free market and you will have paid out of pocket no more than the 1€ you had in mind. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This uncle does not really exist, but it describes the payoff of a call option on one dollar. But the option is not given to you for free, it is a valuable piece of paper and you have to pay a premium up front to obtain it from a greedy investment bank. The payoff is the difference between actual and predetermined (strike) exchange rates multiplied by the notional amount of dollars (in this toy example one dollar bill, but in real markets a suitcase containing one million bills is the standard size).&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-08-30T15:00:08.203" LastActivityDate="2016-08-30T15:00:08.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29907" PostTypeId="1" CreationDate="2016-08-30T16:46:29.017" Score="6" ViewCount="4547" Body="&lt;p&gt;Anyone have a good place to find interest rate swaption implied volatility data? Does Bloomberg's python API allow access?&lt;/p&gt;&#xA;" OwnerUserId="24188" LastEditorUserId="467" LastEditDate="2016-12-29T02:04:52.240" LastActivityDate="2020-05-17T15:11:40.753" Title="Where can I find open swaption implied volatility data?" Tags="&lt;interest-rates&gt;&lt;data&gt;&lt;implied-volatility&gt;&lt;swaption&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29908" PostTypeId="2" ParentId="29907" CreationDate="2016-08-30T17:14:50.070" Score="6" Body="&lt;p&gt;CME publishes its volatility surface daily on their FTP: &lt;a href=&quot;ftp://ftp.cmegroup.com/irs/&quot; rel=&quot;noreferrer&quot;&gt;CME Vol Surface&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately I know of no open APIs that would get you historical data. I'd recommend looking at Barclays Live or Morgan Markets if you don't have access to Bloomberg (volatilty data quality is higher on these dealer sites anyways).&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="467" LastEditDate="2016-12-29T02:05:32.793" LastActivityDate="2016-12-29T02:05:32.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29911" PostTypeId="2" ParentId="14380" CreationDate="2016-08-30T19:45:37.673" Score="2" Body="&lt;p&gt;This has been resurrected as Rblpapi. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/Rblp/Rblpapi&quot; rel=&quot;nofollow&quot;&gt;https://github.com/Rblp/Rblpapi&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5407" LastActivityDate="2016-08-30T19:45:37.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29912" PostTypeId="2" ParentId="15017" CreationDate="2016-08-30T20:23:05.557" Score="1" Body="&lt;h1&gt;Formula:&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$H(i) = \mid\frac{B(i)}{B(i)+S(i)}-p(t)\mid-AF(i) $&lt;/span&gt; (Lakonishok et al. 1992)&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;How to calculate &lt;span class=&quot;math-container&quot;&gt;$AF(i)$&lt;/span&gt;?&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;This answer is based on  &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.197.2210&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Herding and Feedback Trading by Different Types of Institutions&#xA;and the Effects on Stock Prices&#xA;(Jones, Lee, Weis 1999)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Given that &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Institutions in a company are neither net-buying nor net-selling, &#xA;&lt;span class=&quot;math-container&quot;&gt;$p=0,5$&lt;/span&gt;, and&lt;/li&gt;&#xA;&lt;li&gt;there are two institutions active in the given quarter,&#xA;&lt;span class=&quot;math-container&quot;&gt;$n=2$&lt;/span&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Then the probabilities will be...&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For 0 buys: &lt;span class=&quot;math-container&quot;&gt;$\frac{2!\times0.5\times(1-0.5)}{(2-0)\times0!}=0.25$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For 1 buys: &lt;span class=&quot;math-container&quot;&gt;$\frac{2!\times0.5\times(1-0.5)}{(2-1)\times1!}=0.5$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For 2 buys: &lt;span class=&quot;math-container&quot;&gt;$\frac{2!\times0.5\times(1-0.5)}{(2-2)\times2!}=0.25$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;And the absolute values will be...&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For 0 buys: &lt;span class=&quot;math-container&quot;&gt;$\mid \frac{0}{2}-0.5 \mid = 0.5$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For 1 buys: &lt;span class=&quot;math-container&quot;&gt;$\mid \frac{1}{2}-0.5 \mid = 0$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For 2 buys: &lt;span class=&quot;math-container&quot;&gt;$\mid \frac{2}{2}-0.5 \mid = 0.5$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Then the products will be...&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For 0 buys: &lt;span class=&quot;math-container&quot;&gt;$0.25\times0.5=0.125$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For 1 buys: &lt;span class=&quot;math-container&quot;&gt;$0.5\times0=0$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For 2 buys: &lt;span class=&quot;math-container&quot;&gt;$0.25\times0.5=0.125$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;So the answer will be &lt;span class=&quot;math-container&quot;&gt;$AF=0.125+0+0.125=0.25$&lt;/span&gt;&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="24185" LastEditorUserId="24185" LastEditDate="2019-03-19T20:30:59.073" LastActivityDate="2019-03-19T20:30:59.073" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="29913" PostTypeId="1" CreationDate="2016-08-30T20:23:59.037" Score="1" ViewCount="91" Body="&lt;p&gt;They look pretty similar to the layman's eyes: You have to pay something, and then a non-deterministic (or non-fully-known) event occurs. Such event has a (perhaps unknown) probability of occurring and, if the event falls on your side, you get certain money back.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I see many sites like those trading binary options (which seem to be trending topic), I see the regulatory agencies are not related to bet, but to security exchanges.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now, the layman is me, and I cannot fully explain the difference to another layman, in particular regarding binary options, &lt;em&gt;in academical terms&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I make clear to them that a binary option is not &lt;em&gt;exactly&lt;/em&gt; (I mean: in the background - what happens after placing position) a bet in the way betting red/blue in an online roulette? (OR perhaps I am wrong... please correct me in this point)&lt;/p&gt;&#xA;" OwnerUserId="24176" LastEditorUserId="24176" LastEditDate="2016-08-30T20:33:32.123" LastActivityDate="2017-02-10T04:58:04.490" Title="How are bets and high-risk investments conceptually different, and how does this apply to binary options?" Tags="&lt;binary-options&gt;&lt;investing&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29914" PostTypeId="1" CreationDate="2016-08-30T21:27:26.410" Score="1" ViewCount="673" Body="&lt;p&gt;In a volatility smile; why is the ATM point usually or ideally at the bottom?  In other words, why is the &quot;smile&quot; smile shaped as opposed to another shape?&lt;/p&gt;&#xA;" OwnerUserId="24194" LastEditorUserId="11936" LastEditDate="2016-08-31T06:00:20.153" LastActivityDate="2016-09-14T15:53:48.270" Title="At-the-money and volatility smile" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;volatility-smile&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29915" PostTypeId="1" CreationDate="2016-08-30T23:19:13.337" Score="1" ViewCount="445" Body="&lt;p&gt;I've been running some backtests of a pair trading strategy on 1 year worth of 5 min bars of two securities and I've noticed pretty poor returns, especially once transaction costs are taken into account. As a sanity check I ran a few statistical tests on the residuals spread in MATLAB:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Augmented Dickey-Fuller Test rejected null with $p &amp;lt; 0.001$&lt;/li&gt;&#xA;&lt;li&gt;Lilliefors Test rejected null with $p &amp;lt; 0.001$&lt;/li&gt;&#xA;&lt;li&gt;(as an aside) Engle's ARCH Test rejected null with $p \sim 0$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This all begets the question, &lt;strong&gt;why are the returns so poor for a seemingly perfectly cointegrated pair?&lt;/strong&gt; The potential factors I'm considering are poor choice of bar size, the data needs to be filtered, or I need to account for volatility somehow. Any help would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="24195" LastEditorDisplayName="user16651" LastEditDate="2016-08-31T07:20:02.980" LastActivityDate="2016-08-31T07:51:27.400" Title="What causes poor returns in pair trading of very cointegrated securities?" Tags="&lt;volatility&gt;&lt;pairs-trading&gt;&lt;mean-reversion&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29916" PostTypeId="2" ParentId="29913" CreationDate="2016-08-30T23:26:16.280" Score="2" Body="&lt;p&gt;The main difference is that with a binary option you are betting on a real economic risk, that exists independently of the bet. (For example, even if options did not exist, if stock prices go down pension funds will suffer losses, if the price of oil goes up Venezuela and Saudi Arabia will benefit). With gambling you are betting on an artificial risk, such as the toss of a coin, or the spin of the wheel, that has no no economic significance (no one wants to hedge it) and has been created only for entertainment purposes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having said this I would add that binary options seem to me far less useful for hedging (or other economic) purposes than the other types of options that I know. So they seem to me harder to justify. In some countries they are popular because of fiscal (tax) advantages, which I would consider a &quot;bad reason&quot; from a social point of view.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it's a controversial issue.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2016-08-30T23:26:16.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29917" PostTypeId="2" ParentId="29895" CreationDate="2016-08-31T00:50:33.433" Score="0" Body="&lt;p&gt;I don't know of any free sources for a dynamic list of symbols.  Note that symbols change all of the time, so just having a list of symbols at a particular point-in-time will be difficult to match with a price database of symbols that have &quot;current&quot; symbols.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;REITs are a subset of normal operating/holding companies.  They differ from these by electing to be taxed differently to a normal investment company.  There are various qualification rules to be considered a REIT:&#xA;&lt;a href=&quot;https://www.sec.gov/answers/reits.htm&quot; rel=&quot;nofollow&quot;&gt;https://www.sec.gov/answers/reits.htm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not all REITs have always maintained this designation across their lifetime. Have a look at the REITWatch newsletters - probably the most comprehensive source for such information but you should cross-check the REIT designations with more sources as sometimes it took a while for that newsletter to add/remove valid/invalid REITs.&#xA;&lt;a href=&quot;http://reit.com/data-research/data/reitwatch&quot; rel=&quot;nofollow&quot;&gt;http://reit.com/data-research/data/reitwatch&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, Crown Castle International (NYSE:CCI) gained REIT status in late 2013 but the prior 1998 through to late 2013 it was just a normal company.&#xA;&lt;a href=&quot;http://investor.crowncastle.com/phoenix.zhtml?c=107530&amp;amp;p=irol-newsArticle&amp;amp;ID=1888377&quot; rel=&quot;nofollow&quot;&gt;http://investor.crowncastle.com/phoenix.zhtml?c=107530&amp;amp;p=irol-newsArticle&amp;amp;ID=1888377&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A further anomaly is that a company may think it is operating as a REIT but then has to retrospectively alter its designation once the SEC declare it is no longer a REIT.&lt;/p&gt;&#xA;" OwnerUserId="13859" LastActivityDate="2016-08-31T00:50:33.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29918" PostTypeId="2" ParentId="29915" CreationDate="2016-08-31T07:51:27.400" Score="6" Body="&lt;p&gt;A few possibilities -&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Trading costs kill your returns (often a problem for very highly correlated securities)&lt;/li&gt;&#xA;&lt;li&gt;Mean reversion of the cointegration spread is either very weak, or happens over periods which are too long to be practical, or there is no mean reversion whatsoever.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For example, consider the following two securities, which are clearly very strongly related to one another.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/a8NRe.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/a8NRe.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The ADF test on the difference in their prices rejects a unit root, with p &amp;lt; 0.01. However, plotting the difference in prices we see the following -&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/86E9d.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/86E9d.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The spread looks like it mean reverts (hence the ADF test rejected a unit root) but the speed is so slow that it is not practically useful, generally taking ~1 year to revert from the extremes to the mean. Also note that the spread is typically only about 1% of the securities price, so if you are paying 20 basis points trading costs on each leg, plus a commission, you are very unlikely to realize a profit on this trade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is on two synthetic price series that I deliberately constructed to be cointegrated. Remember that cointegration is a concept that applies to two theoretical price series, and true cointegration relationships are almost never observed in finance (particularly among securities where there is no particular reason for a cointegration relationship to exist).&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2016-08-31T07:51:27.400" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29919" PostTypeId="2" ParentId="11103" CreationDate="2016-08-31T08:55:49.353" Score="1" Body="&lt;p&gt;Paul Samuelson in his interview says that he called the simpler one: European option and the complicated one: American. This happened because he was taught that it would be better for him not to start researching option pricing as that research requires &quot;a European kind of mind&quot;:)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;here is the link to his interview:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=RbIzwTGN3Yc&amp;amp;index=5&amp;amp;list=PLjpJ4yrk4-za2KMA84AUiyEa7a97cPcbi&quot; rel=&quot;nofollow&quot;&gt;https://www.youtube.com/watch?v=RbIzwTGN3Yc&amp;amp;index=5&amp;amp;list=PLjpJ4yrk4-za2KMA84AUiyEa7a97cPcbi&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;watch from 09:30&lt;/p&gt;&#xA;" OwnerUserId="24205" LastActivityDate="2016-08-31T08:55:49.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29920" PostTypeId="1" AcceptedAnswerId="29921" CreationDate="2016-08-31T13:32:22.923" Score="0" ViewCount="72" Body="&lt;p&gt;Lets say you get to choose any 2 stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it &lt;em&gt;possible&lt;/em&gt; that a portfolio can be built from the two stocks (long or short either, any weighting) that has a lower volatility (standard deviation of movements), and simultaneously higher percent return than either of the two underlying securities alone.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to say yes, but I think the answer is no.&#xA;In the event of a correlation of -1 between A and B:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;A:&lt;/strong&gt; a stock with high stddev, and small positive return&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;B:&lt;/strong&gt; a stock with same stddev, and small negative return&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Long A short B&lt;/strong&gt; = much higher returns, much higher stddev&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Short A Long B&lt;/strong&gt; = 0 return, 0 stddev&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I currently have an infinite loop randomly building portfolios to test this at home. Bonus: Is it possible with a portfolio with more than 2 stocks in the portfolio?&lt;/p&gt;&#xA;" OwnerUserId="24207" LastEditorUserId="24207" LastEditDate="2016-08-31T13:37:47.523" LastActivityDate="2016-08-31T14:21:59.000" Title="Puzzler on construction of a 2-stock portfolio" Tags="&lt;equities&gt;&lt;correlation&gt;&lt;hedging&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29921" PostTypeId="2" ParentId="29920" CreationDate="2016-08-31T14:21:59.000" Score="1" Body="&lt;p&gt;$X$ and $Y$ perfectly correlated with same vol.&#xA;So $X-Y$ has no volatility at all and for any $n$, $n(X-Y)$ has still no volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $r_X &amp;gt; r_Y$ are returns of $X$ and $Y$, then $n(X-Y)$ has return $n(r_X-r_Y)$ which can be as big as you want with $n$ big enough.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-08-31T14:21:59.000" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29922" PostTypeId="1" CreationDate="2016-08-31T17:44:00.407" Score="1" ViewCount="114" Body="&lt;p&gt;I have 2 time-series datasets. I am trying to find co integration between them. Now the thing is they are negatively correlated. So if I want to look at the distance between them, would I be right in just inverting one (1/value) of them and looking at the distance they maintain over time? Is this approach right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking at currency pairs EURUSD and USDJPY&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mathematically speaking if y=mx+c and y=-mx+d, i could take a negative of mx and see the difference between the new series so obtained and y=mx+c.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, intuitively I am not able to connect if taking the inverse of prices, I would get the same. If i invert USDJPY, I would get JPYUSD and can run it against EURUSD. But I don't really tie it up, whether taking an inverse makes sense&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&#xA;Cheers!&lt;/p&gt;&#xA;" OwnerUserId="24213" LastEditorUserId="24213" LastEditDate="2016-08-31T18:07:59.907" LastActivityDate="2016-08-31T20:04:44.600" Title="Co integration of diverging time series" Tags="&lt;time-series&gt;&lt;correlation&gt;&lt;cointegration&gt;&lt;mean-reversion&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29924" PostTypeId="2" ParentId="29922" CreationDate="2016-08-31T18:51:02.093" Score="1" Body="&lt;p&gt;You would have to inverse them, USD priced in JPY, and EUR priced in USD will almost always be inversely correlated. It is like pricing the SP500 in USD, and comparing it to USD priced in DOW30, It makes no sense! You will get the opposite result, but it will make more sense (inversing it).&lt;/p&gt;&#xA;" OwnerUserId="18578" LastEditorUserId="18578" LastEditDate="2016-08-31T18:57:05.583" LastActivityDate="2016-08-31T18:57:05.583" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29925" PostTypeId="2" ParentId="29922" CreationDate="2016-08-31T20:04:44.600" Score="1" Body="&lt;p&gt;I think the answer lies not in the technicalities of cointegration but rather in the reality of currency markets and international economics. I don't think EUR/USD is cointegrated with USD/JPY or JPY/USD. If they were, EUR and JPY would move in parallell w.r.t USD, apart from short-term deviations. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;This does happen to the extent of how strong/weak USD generally is (e.g. driven by the macroeconomic situation of the U.S.). &lt;/li&gt;&#xA;&lt;li&gt;However, this is only half of the story. There are also separate driving forces behind the strength/weakness of EUR and JPY (their respective macroeconomic situations), respectively, and those need not always coincide (Europe does not always go down when Japan is going down, even though this may sometimes happen). &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Thus there is a common trend between EUR/USD and JPY/USD, but there also are separate trends extra to it, and that prevents cointegration.&lt;/p&gt;&#xA;" OwnerUserId="19645" LastActivityDate="2016-08-31T20:04:44.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29926" PostTypeId="1" CreationDate="2016-08-31T20:23:25.467" Score="3" ViewCount="15989" Body="&lt;p&gt;There are currently a lot of ways for credit scoring. The most popular one is the FICO score, and its variants. For my masters thesis, I would like to work on making my own credit scoring system using machine learning. The idea would be to obtain some real life data, and evaluate the credit scores, not necessarily in the 300-850 range as in the FICO score. What are some good resources to understand how to go about doing the same? Any new ideas are appreciated! Also, what are some places I could get free data (or not so expensive data) to build my model? &lt;/p&gt;&#xA;" OwnerUserId="23908" LastEditorUserId="23908" LastEditDate="2016-09-01T08:12:56.450" LastActivityDate="2016-09-01T08:12:56.450" Title="How do I use machine learning to build a credit scoring model?" Tags="&lt;credit-risk&gt;&lt;machine-learning&gt;&lt;credit-ratings&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="9" ClosedDate="2016-09-01T07:25:39.190" ContentLicense="CC BY-SA 3.0" />
  <row Id="29927" PostTypeId="1" CreationDate="2016-08-31T20:41:44.193" Score="1" ViewCount="114" Body="&lt;p&gt;SPX is usually around 10x that of SPY. SPY is at 217 means SPX is roughly 2165 to 2175. I understand that one is an ETF and the other just 'tracks', SPY gives out dividends, SPY is more liquid, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, for example, for Sept 2 expiry the call premiums are as follows (both of these are PM settled):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Call SPY @218 = $0.59&#xA;&#xA;Call SPX @2180 = $4.1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would have expected SPX to be around &gt;= $5.5&#xA;Can any experienced traders explain the discrepancy?&lt;/p&gt;&#xA;" OwnerUserId="24215" LastActivityDate="2016-10-31T03:03:58.200" Title="Discrepancy between SPX and SPY call premiums" Tags="&lt;options&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29928" PostTypeId="2" ParentId="29926" CreationDate="2016-08-31T21:11:57.783" Score="9" Body="&lt;p&gt;One excellent resource is to try Kaggle and to examine some of the competitions, some of which are specifically on the application of machine learning to credit scoring. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.kaggle.com/c/GiveMeSomeCredit&quot; rel=&quot;noreferrer&quot;&gt;https://www.kaggle.com/c/GiveMeSomeCredit&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You wil see that the winning solution is made public, including source code and output. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/IdoZehori/Credit-Score/blob/master/Credit%20score.ipynb&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/IdoZehori/Credit-Score/blob/master/Credit%20score.ipynb&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are other problems in addition to this one so you should spend some time looking around. Here is another.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.kaggle.com/c/loan-default-prediction&quot; rel=&quot;noreferrer&quot;&gt;https://www.kaggle.com/c/loan-default-prediction&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The preferred ML libraries are either in R or increasingly it seems that Python's Scikit learn is becoming very popular.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note that there are a number of p2p loan platforms in the US (and now in the UK) that provide some loan data for such analysis. Google Prosper and Lending Club. One final point is that if there is a data field with high predictivity, the p2p providers may prefer to keep it proprietary. As a result it may be hard to find models for these loans with good AUC statistics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Stanford University also runs an ML course that covers credit scoring in the student projects submitted. Look here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://cs229.stanford.edu/&quot; rel=&quot;noreferrer&quot;&gt;http://cs229.stanford.edu/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope that is enough to get you started.&lt;/p&gt;&#xA;" OwnerUserId="12240" LastEditorUserId="12240" LastEditDate="2016-08-31T21:30:38.890" LastActivityDate="2016-08-31T21:30:38.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29929" PostTypeId="2" ParentId="29927" CreationDate="2016-09-01T00:44:34.517" Score="2" Body="&lt;p&gt;Some Factors in play:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;(MOST IMPORTANT) Dividend yield, if there was no dividend on SPY call value would go up to about ~0.50 USD&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Liquidity premium, if two assets are identical in every way except liquidity, more liquid asset has a higher value to investors. However in this case I think the liquidity premium is more an issue for the market maker than anyone.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Costs, I doubt costs are equal for Futures trading of SPX vs ETF Trading of SPY, driving costs up. This has to do with the cost of hedging for the market maker.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="18578" LastActivityDate="2016-09-01T00:44:34.517" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29930" PostTypeId="1" CreationDate="2016-09-01T01:17:44.163" Score="2" ViewCount="86" Body="&lt;p&gt;In &lt;a href=&quot;http://www.jstor.org/stable/41678630?seq=1#page_scan_tab_contents&quot; rel=&quot;nofollow&quot;&gt;&quot;Is the Potential for International Diversification Disappearing? A Dynamic&#xA;Copula Approach&quot;&lt;/a&gt; by Christoffersen et al. (2012), the authors present the concept of Conditional Diversification Benefit of a portfolio, based on the expected shortfall, defined as (confidence level $\alpha$ is omitted for legibility reasons):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$CDB_t = \frac{\overline{ES}_t-ES_t}{\overline{ES}_t-\underline{ES}_t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\overline{ES}_t$ is the upper bound of portfolio's ES when there is no diversification, i.e. $\overline{ES}_t = \sum_{i=1}^n w_i ES_{i,t}$ (where $i$ stands for asset $i$), $\underline{ES}_t$ is the lower bound of portfolio's expected shortfall, which by definition coincides with the respective VaR, and $ES_t$ is the actual estimate. In their paper (where each asset is an index representing the economy of a country) they find that $CDB_t$ has declined over the last 15-20 years as a result of increasing dependence between different countries' economies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my project I'm using sector-specific indexes rather than country-specific indexes. My findings differ from Christoffersen et al. (2012): my $CDB_t$ stays relatively constant over time, with some minor fluctuations (the biggest upward fluctuation during the financial crisis), and a plot of the average correlations (average correlation of asset $i$ with assets $(1, ..., i-1, i+1, ...n))$ confirms that these have actually declined, leading to increasing $CDB_t$ during the crisis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this not plausible, or may this be given by the fact that different sectors are diversely hit by the crisis, with some sectors that lost tons of money while others maybe profited from it, or at least are not harmed by it (for example health care companies vs. financial institutions), whereas country-related indexes (which in developed countries include stocks from all industries) are constructed in a fairly similar way, and therefore tend to correlate more during volatile times? Maybe you have an intuitive answer, or a reference to industry correlations during the crisis?&lt;/p&gt;&#xA;" OwnerUserId="20573" LastEditorUserId="20573" LastEditDate="2016-09-01T10:27:14.950" LastActivityDate="2016-09-02T08:03:00.090" Title="Decreasing dependence during the financial crisis?" Tags="&lt;risk&gt;&lt;correlation&gt;&lt;risk-models&gt;&lt;diversification&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29932" PostTypeId="1" AcceptedAnswerId="29933" CreationDate="2016-09-01T08:35:00.817" Score="1" ViewCount="1168" Body="&lt;p&gt;I am working on an option hedging simulation. In this context, I wanted to expand the simulation to include gamma. For testing purposes, I used among others the natural gas futures. When I calculate the greeks  for an ATM-option for the current October contract&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(f=2.86, st=2.90, days=30, vol=0.4, r=0.005),&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get a gamma of 1.21.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I know, the gamma as the second partial derivative of the option price with respect to the underlying price, gives you the rate of change for the delta with respect to a change in the underlying. So if the natural gas futures would change by one point (which obviously would be a very large percentage move), the delta would change by more than one even if it has the boundaries of [0, 1].&lt;br&gt;&#xA;Is my definition, calculation or interpretation of gamma not correct or am I missing something else ?&#xA;(Before posting this, I looked gamma up in some option textbooks like Hull, Sinclair and Natenberg but could not find an explanation regarding this)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for help (and sorry for my trivial question ;-)&lt;/p&gt;&#xA;" OwnerUserId="24201" LastActivityDate="2017-08-14T13:24:06.003" Title="Interpretation of an option gamma larger than one" Tags="&lt;options&gt;&lt;gamma&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29933" PostTypeId="2" ParentId="29932" CreationDate="2016-09-01T09:05:15.190" Score="2" Body="&lt;p&gt;You are correct in saying that gamma represents the rate of change of the delta with respect to changes in the underlying asset price. However, the approximation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\Delta_{t + 1} \approx \Delta_t + \Gamma_t \left( S_{t + 1} - S_t \right)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is only accurate when the changes $S_{t + 1} - S_t$ and $\Delta t$ are small. The reason is that gamma itself is not constant but a function of $S$ and $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, a bounded and differentiable function (delta in your case) does not need to have a bounded derivative (gamma in your case). See for example &lt;a href=&quot;https://math.stackexchange.com/questions/257584/bounded-functions-have-bounded-derivatives&quot;&gt;this question&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2016-09-01T09:05:15.190" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29934" PostTypeId="1" AcceptedAnswerId="29936" CreationDate="2016-09-01T09:53:55.017" Score="2" ViewCount="284" Body="&lt;p&gt;I have the feeling this question has an extremely simple answer but I'll put it out to the group anyway.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Imagine I have data for 3M and 6M forward rates following a lognormal process, and that I would like to find out what the correlation coefficient is between the Brownian Motions defining the dynamics of each rate process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the best way of measuring it?&lt;/p&gt;&#xA;" OwnerUserId="13458" LastActivityDate="2016-09-01T12:40:34.240" Title="Computing Correlation between Forward Rates" Tags="&lt;stochastic-calculus&gt;&lt;correlation&gt;&lt;forward&gt;&lt;forward-rate&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29935" PostTypeId="1" CreationDate="2016-09-01T11:11:21.233" Score="2" ViewCount="1494" Body="&lt;p&gt;I've been looking around the internet but cannot find the exact answer to my question. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Normally when valuing an IRS one uses eonia (for eur swaps) to discount the cashflows. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's imagine I have a 30 year IRS for which both USD and EUR collateral can be posted (in bonds). Now the counterparty which is posting collateral has the option to post collateral in EUR bonds or in USD govt bonds (collateral funding option).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have read that one cannot use the eonia curve anymore to discount the cashflows but has to use some sort of blended curve (or maybe just a curve with the highest interest rates for simplicity).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it correct to use the USD ois curve to discount the swaps cashflows (when you have an IRS for which both EUR and USD govt bonds can be posted)?&#xA;If yes how does this curve needs to be transformed (FX and x-ccy basis)? I assume one cannot just take the USD ois curve and use that for discounting.&lt;/p&gt;&#xA;" OwnerUserId="16788" LastActivityDate="2016-09-09T09:17:12.807" Title="Which discount curve to use when valuing multi currency swaps" Tags="&lt;options&gt;&lt;interest-rate-swap&gt;&lt;discounting&gt;&lt;ois-discounting&gt;&lt;multicurve&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29936" PostTypeId="2" ParentId="29934" CreationDate="2016-09-01T12:40:34.240" Score="1" Body="&lt;p&gt;Assuming you know volatility of each process, correlation of brownian motions are given by the crochet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $X,Y$ such that:&#xA;$$\frac{dX_t}{X_t} = \mu^X dt + \sigma^X dW^X_t $$&#xA;$$\frac{dY_t}{Y_t} = \mu^Y dt + \sigma^Y dW^Y_t $$&#xA;with $d&amp;lt;W^X,W^Y&amp;gt;_t = \rho^{XY}dt$&#xA;then:&#xA;$$d&amp;lt;X,Y&amp;gt;_t = \sigma^X\sigma^Y \rho^{XY} dt$$&#xA;thus:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\rho^{XY}{\sigma^X\sigma^Y}(t_n-t_0) =&amp;lt;X,Y&amp;gt;_{t_n}-&amp;lt;X,Y&amp;gt;_{t_0}\sim \frac{1}{n}\sum_{i=1}^n \frac{X_{t_i}-X_{t_{i-1}}}{X_{t_{i-1}}}\frac{Y_{t_i}-Y_{t_{i-1}}}{Y_{t_{i-1}}}$$&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-09-01T12:40:34.240" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29937" PostTypeId="2" ParentId="21265" CreationDate="2016-09-01T15:17:53.700" Score="5" Body="&lt;p&gt;This is due to the banking regulations that came couple of years back requiring foreign banks to calculate their balance sheet snapshots at the end of every month as compared to US Banks who takes the daily average. As a result, many foreign banks stay away from fed-funds market to show they are borrowing less. This forces the lenders to lend the money at cheaper rates. &#xA;So, for the purpose of your study (I know its way too late)you can actually assume this glitch doesn't occur.&lt;/p&gt;&#xA;" OwnerUserId="24226" LastActivityDate="2016-09-01T15:17:53.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29938" PostTypeId="1" AcceptedAnswerId="29939" CreationDate="2016-09-01T15:45:54.343" Score="2" ViewCount="78" Body="&lt;p&gt;I am trying to do some work on VaR and Expected Shortfall with the help of Generalized Pareto Distributions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone please guide me to some dataset of financial data, preferably something like a  Time Series of Portfolio Pnl Nos. on a daily basis or something on those lines, which is freely available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot for your help.&lt;/p&gt;&#xA;" OwnerUserId="20162" LastActivityDate="2016-09-01T18:20:26.787" Title="Free Data Sets for VaR calculations" Tags="&lt;data&gt;&lt;market-data&gt;&lt;historical-data&gt;&lt;var&gt;&lt;data-mining&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29939" PostTypeId="2" ParentId="29938" CreationDate="2016-09-01T18:20:26.787" Score="1" Body="&lt;p&gt;there is lots of data available on the data wiki: &lt;a href=&quot;https://quant.stackexchange.com/questions/141/what-data-sources-are-available-online&quot;&gt;What data sources are available online?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;None the less I would recommend quandl as they have tons of free data. If you just want portfolios maybe try ETF data or Mutual fund data.&lt;/p&gt;&#xA;" OwnerUserId="18578" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-09-01T18:20:26.787" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29940" PostTypeId="1" AcceptedAnswerId="29945" CreationDate="2016-09-01T20:29:00.060" Score="0" ViewCount="70" Body="&lt;p&gt;Assume I pricing some commodity derivative that has a running cost with $\$c$ being paid per unit of time. So I define the price under the risk neutral measure to be $$P(t,S_t)=\tilde{\mathbb{E}}\left[e^{-r(T-t)}F(S_T)+\int_t^T c\,e^{-r(s-t)}\text{ds}\,|\,\mathcal{F}_t\right]$$&#xA;Now if I multiply both sides by $e^{-rt}$, I have &quot;discounted price of a derivative&quot; on the left, and from the fact that discounted price functions are martingales under risk neutral measure I could calculate $d(e^{-rt}P(t,S_t))$ and set the $dt$ term to zero. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But clearly, that would be a wrong pde in this case. I can see that if I break $\int_t^T=\int_0^T-\int_0^t$ and move the second part to the left, I will get a martingale and I should do Ito on that one. So does the argument &quot;all discounted traded derivatives are martingales under risk neutral measure&quot; doesn't apply in this case? And the argument valid only for the derivatives that have a payoff at maturity $T$? I have not see that mentioned anywhere in EEM pricing. &lt;/p&gt;&#xA;" OwnerUserId="22823" LastEditorDisplayName="user16651" LastEditDate="2016-09-02T13:28:44.323" LastActivityDate="2016-09-02T13:28:44.323" Title="pricing a derivative with a running cost" Tags="&lt;options&gt;&lt;risk-neutral-measure&gt;&lt;parabolic-pde&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29941" PostTypeId="1" AcceptedAnswerId="29976" CreationDate="2016-09-01T21:52:45.453" Score="3" ViewCount="1407" Body="&lt;p&gt;Working with delisted or bought-out companies poses some difficulties in how to organize price data for backtesting. I've been backtesting some investment algorithms on free data from Yahoo! where I don't have the issue of working with delisted companies. I can simply take adjusted closes as authoritative prices. I can keep this data in memory using a (Python) pandas DataFrame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For delisting, the situation is a bit more complicated, and I wonder how to handle it so that when I start buying data that &lt;em&gt;doesn't&lt;/em&gt; have survivor bias, I can put it into a uniform format for purposes of objective backtesting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The simplest case is that the company simply went broke. For example, LEH (Lehman Bros.) at some point just went to 0. But there are other cases:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Buyouts for shares of buying company (as will presumably happen with TSLA and SCTY). How does non-survivor-biased data deal with this situation? If I'm backtesting, say, since 1996, and such an event had happened in 2000, would the adjusted closes for SCTY-X simply track TSLA-X after the buyout date? Otherwise, one would have to somehow manually groom the data, which would be a pain.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Buyouts for cash (PFZ's buy of MDVN, for example) also aren't really the same as just keeping the adjusted close at a fixed price following the event. The event somehow needs to be tagged so that an investment strategy can now distinguish the cash from a stagnating investment.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;My question boils down to the best way to organize a DataFrame with a TimeSeries index for an individual stock so that an algorithm can handle such events in addition to dividends and splits, which the 'Adj Close' column handles for you. The DataFrame returned by &lt;code&gt;pandas&lt;/code&gt; gives back as columns &lt;code&gt;['Open', 'High', 'Low', 'Close', 'Volume', 'Adj Close']&lt;/code&gt;. What would need to be added to this data structure to enable backtesting that includes delisted companies of various kinds?&lt;/p&gt;&#xA;" OwnerUserId="24230" LastActivityDate="2016-09-04T04:14:48.887" Title="How to organize historical data including delisted" Tags="&lt;market-data&gt;&lt;backtesting&gt;&lt;historical-data&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29942" PostTypeId="1" CreationDate="2016-09-02T00:24:52.383" Score="0" ViewCount="404" Body="&lt;p&gt;Is there a website that provides a .csv file of every U.S. stock or a text-only web page of U.S. stocks (e.g., symbol, last trading price, price-to-earnings ratio etc.)?  If there is no free one, what is the cheapest subscription price available?&lt;/p&gt;&#xA;" OwnerUserId="24231" LastActivityDate="2016-09-13T06:31:10.107" Title="Is there a website with text-only (quick downloads) of stock data (symbol, price, etc.)?" Tags="&lt;equities&gt;&lt;data&gt;&lt;market-data&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2016-09-14T05:51:23.650" ContentLicense="CC BY-SA 3.0" />
  <row Id="29943" PostTypeId="1" AcceptedAnswerId="29944" CreationDate="2016-09-02T00:36:35.130" Score="7" ViewCount="1040" Body="&lt;p&gt;This is an open ended question but just want to hear some of everyone's thoughts on this. How does financial mathematics benefit the economy, the stock market, and the individual investor?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know this may not be a proper question to post to this blog but just wanted to hear some thoughts on this.&lt;/p&gt;&#xA;" OwnerUserId="19002" LastActivityDate="2016-09-03T06:23:56.590" Title="Does financial math benefit society?" Tags="&lt;finance&gt;&lt;finance-mathematics&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29944" PostTypeId="2" ParentId="29943" CreationDate="2016-09-02T05:34:57.300" Score="9" Body="&lt;p&gt;It is not financial mathematics in general, but a scientific approach that is beneficial:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;quantitative views and open objective tools make transactions more transparent. It decreases information asymmetry and thus &lt;strong&gt;decrease transaction costs&lt;/strong&gt; in general (bid-ask spread, prices range, volatility, etc).&lt;/li&gt;&#xA;&lt;li&gt;thanks to (good) models, the consistency between investable instruments is better known: the multidimensional nature of prices is insured. It &lt;strong&gt;helps the diffusion of information into prices&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;li&gt;quantitative methods focus on &lt;strong&gt;risk management&lt;/strong&gt;: it helps banks to make the markets and maintain their inventories (and regulator to understand the state of intermediaries' inventories).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In general, it provides a common language to express risk, portfolios and uncertainty. This allows portfolio managers, risk departments, insurance companies, intermediaries and regulators to communicate. More specifically for financial math, it &lt;a href=&quot;http://www.storyofmathematics.com/17th_pascal.html&quot;&gt;started in the XVIIth century&lt;/a&gt; and a big breakthrough was achieved by Bachelier with the concept of &lt;a href=&quot;https://en.m.wikipedia.org/wiki/Louis_Bachelier&quot;&gt;risk replication&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2016-09-03T06:23:56.590" LastActivityDate="2016-09-03T06:23:56.590" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29945" PostTypeId="2" ParentId="29940" CreationDate="2016-09-02T06:26:45.820" Score="2" Body="&lt;p&gt;self financing portfolios have discounted prices that are martingales. So if the products involves paying fees, these have to taken account of to get a martingale. The product is not a self financing portfolio if these are ignored.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2016-09-02T06:26:45.820" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29947" PostTypeId="2" ParentId="29930" CreationDate="2016-09-02T08:03:00.090" Score="1" Body="&lt;p&gt;From my experience, I think your results are plausible. Due to the globalization, economies and stock markets from different countries are much more connected than in the past. Furthermore, since the financial crisis of 2008, central bank policies have also converged more and more (e.g. in the US, Euro-Zone, Japan and UK you have zero-interest-rate policy). From this you would expect an increase of correlation aka a fall of diversification benefits through country diversification.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the results of your study, one can also imagine that correlation between certain sectors has declined over time. The credo in capital markets for a couple of years now is (unfortunately) 'risk-on' or 'risk-off'. Fund managers (and traders) allocate their assets regarding the actual risk-status. Simplified, in 'risk-on' they are overweighted in growth-oriented companies whereas in 'risk-off'-mode, their prefer stable value stocks. Since most sectors can easily characterised as one or the other (on average), it makes sense that the performance difference/correlation of sectors has increased/decreased in dependence of the current risk/market mode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, one could argue that the segment of active funds is dominated by single-country oriented funds and not globally-investing portfolios. From this perspective, the fund managers with the larger influence are the ones which can only allocate among different sectors to manage their risk and not the managers which could also use a country shift for this purpose.    &lt;/p&gt;&#xA;" OwnerUserId="24201" LastActivityDate="2016-09-02T08:03:00.090" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29948" PostTypeId="1" CreationDate="2016-09-02T08:15:48.797" Score="0" ViewCount="241" Body="&lt;p&gt;Could someone please suggest with detailed steps and/or a reference, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) How to convert the below discrete time summation to continuous time form and write it as an integral? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Any methods to solve it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\sum_{t=0}^{T}\left[\left(K-X_{t}\right)\right]\left(Y_{t}-Y_{t+1}\right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, $K$ is a constant.&#xA;$X$ is a geometric brownian motion. $Y$ is another geometric brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please let me know if anything is not clear.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Posted initially on Math Forum with no response; hence posting here. Please let me know if I should delete the posting on the other forum.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://math.stackexchange.com/questions/1899002/discrete-time-to-continuous-time-and-summation-of-two-geometric-brownian-motions&quot;&gt;https://math.stackexchange.com/questions/1899002/discrete-time-to-continuous-time-and-summation-of-two-geometric-brownian-motions&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="23946" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2016-09-02T13:47:48.127" Title="Discrete Time to Continuous Time and Summation of Two Geometric Brownian Motions" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29949" PostTypeId="2" ParentId="29943" CreationDate="2016-09-02T09:23:33.107" Score="4" Body="&lt;p&gt;I'd like to answer this question with one addition: Benefits &lt;em&gt;outside&lt;/em&gt; the finance domain. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Financial mathematics, if you mean not only mathematical models but also computational finance in this encapsulation, is the ultimate numeric field to improve one's skills in statistics, math and computation (coding, algorithms etc.). The trick to finance is its rules are entirely social, not natural; a property many researchers choose to forget. Unlike natural sciences, you cannot fit a theory (theory in general sense) and expect to hold as a general rule. Though, many physicists thrive on quantitative finance jobs with their models designed to explain physics phenomena (e.g. Brownian motion).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition finance is oh so many layered. You can do analysis on micromarket structure (more playground for physicists), or you can simply do fundamental analysis of companies and invest in the long-term (oversimplified Warren Buffet).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the past, economics and finance were more &quot;social sciences&quot; than a quantitative field. Bachelier's work in 1900 (brief, simplified note: He proposed stock returns are distributed in Brownian motion, later &lt;a href=&quot;http://www.nybooks.com/daily/2010/01/11/paul-samuelson-and-the-obscure-origins-of-the-fina/&quot; rel=&quot;nofollow&quot;&gt;discovered&lt;/a&gt; and &lt;a href=&quot;https://books.google.com.tr/books?id=10XtCAAAQBAJ&amp;amp;pg=PA41&amp;amp;lpg=PA41&amp;amp;dq=bachelier%20discovered%20in&amp;amp;source=bl&amp;amp;ots=J84oE3Jn27&amp;amp;sig=DIo4dpJKoizK0Gr57MYT0GYndNg&amp;amp;hl=en&amp;amp;sa=X&amp;amp;ved=0ahUKEwjdm4SZpvDOAhXOhRoKHcSTDl8Q6AEIODAD#v=onepage&amp;amp;q=bachelier%20discovered%20in&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;improved&lt;/a&gt; by Samuelson -in 1965- as log-returns). It is an important foundation of Black-Scholes &lt;a href=&quot;https://people.math.ethz.ch/~jteichma/finalversion071108.pdf&quot; rel=&quot;nofollow&quot;&gt;model&lt;/a&gt;. His PhD supervisor joked to Markowitz that they might not give them the title because his work is no more economics (i.e. foundations of Markowitz Portfolio Theory). Nowadays, mathematical models are an integral part of modern economics and finance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nevertheless, they rarely hold for a long time. If you see &lt;a href=&quot;http://www.e-m-h.org/Fama70.pdf&quot; rel=&quot;nofollow&quot;&gt;Fama's work&lt;/a&gt; on Efficient Market Hypothesis (again early work is by Samuelson), he defends EMH with empirical examples (btw he slams bell-curve economists quite nicely -not as colorful as Taleb- and also has hints on HFT). In the subsequent but more boring and less known papers (EMH-II and EMH-III) he shifts his position (see Joint Hypothesis Problem). I have a &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2813270&quot; rel=&quot;nofollow&quot;&gt;technical report&lt;/a&gt; about that issue in option markets context. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One rule is for sure: market adapts. By extension, it loves to make surprises. Many models fail but we will keep on building new and more sophisticated ones. It will guide the decisions of investors, both informed and uninformed. I don't agree it improved risk management or correct pricing. There are two sides for each trade. Those who built models that predict mortgage market will fail against the risk models of the banks earned significant amount of money. With some stretch, I can agree it largely removed pure arbitrage, with the significant help of improved communication technologies. It gave us a methodological perception on the behavior of the market, just not always the true perception. Financial mathematics only help to improve the sophistication of the markets, this progress yield to many different methods and products (see the development of derivatives, HFT etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remember, trade can only occur if two parties disagree on the fair price of an asset. If we reach to an equilibrium state as many economists and finance scholars theorize, there will be no incentive to trade. Markets should change and adapt continuously in order to continue their existence. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Until this paragraph I tried to explain (with great confusion I worry) the underlying process of financial model progression and its effects on the general field. In my final say, I can recommend you the book &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0262633671&quot; rel=&quot;nofollow&quot;&gt;An Engine, Not a Camera: How Financial Models Shape Markets&lt;/a&gt; Now the outside part.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mathematical models built for physics play a large part in quantitative finance. Models used in finance can play a large part in other fields, such as education (which is also a social science that can benefit greatly from some quantitative approach). I can say statistical and mathematical models in education is largely outdated, unsophisticated and susceptible to large errors. It is possible to automate part of the learning process for the benefit of both educators and learners. You can see some examples in adaptive learning and notice how similar some algorithms are to the finance related models and equations.&lt;/p&gt;&#xA;" OwnerUserId="8147" LastActivityDate="2016-09-02T09:23:33.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29950" PostTypeId="2" ParentId="29913" CreationDate="2016-09-02T09:39:13.803" Score="1" Body="&lt;p&gt;The true difference between gambling and investment is the nature of the underlying probability distribution in my opinion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In gambling, you know the exact probabilities of outcommes behind every game and no deliberate actions can shift these probabilities. For instance, a coin toss in a perfect environment (sorry about the academic peculiarity) is 50% chance for heads and 50% chance for tails. With roulette, similar setting. With dice, similar setting (see &lt;a href=&quot;http://www.cut-the-knot.org/Probability/ChevalierDeMere.shtml&quot; rel=&quot;nofollow&quot;&gt;Chevalier de Mere problem&lt;/a&gt; for instance). With lottery, similar setting. You get the picture.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But for some other games, it is a combination of luck and skill. For instance backgammon is played with dice but still you can use your skills to alter the outcome (assuming you don't know the practically infinite outcomes of all games and their associated probabilities).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In finance, you take bets but you have only an idea about the underlying distribution. This is true for binary options, leveraged forex, stock trade or any related business. True probability distribution is unknown. So it is not pure gamble.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the only objective distinction I can think of.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ps. Binary options can be thought as special cases of barrier options and barrier options are used for hedging purposes. &lt;/p&gt;&#xA;" OwnerUserId="8147" LastActivityDate="2016-09-02T09:39:13.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29951" PostTypeId="2" ParentId="25616" CreationDate="2016-09-02T09:43:34.473" Score="0" Body="&lt;p&gt;This is a very interesting topic, which I would like to comment. So, let's take the original problem. Suppose that we use a dcf model and the two possibilities are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) Discount JPY cash flows with JPY risk free rate + spread from issuer in JPY, convert this to USD with spot&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) convert the JPY cash flow to USD via FX Forwards and use a dcf model with USD risk free rate + spread from issuer in USD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my opinion, what is really decisive here is that we need a liquid spread from the same issuer in both JPY and USD. However, often we do not have these liquid spreads available. In your example, we would assume that we have a JPY spread from the Japanese issuer. What is a favorite workaround in the market is two convert to JPY spread into a USD spread by using the cross currency basis spread between USD and JPY.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But now let's have a look at your second possibility: When using FX Forwards in order to switch to USD we already make use of the cross currency basis (since these are containted in the quoted FX Forwards). But then again we also need this cross currency adjustment in the spread component, which cancels out with the basis from the FX Forwards.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore I would conclude that both of your strategies will be more or less equivalent IF we can assume that the JPY spread and the USD spread from the same issuer differs by exactly the cross currency basis (for pure no arbitrage arguments, this should be true).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in the market you can observe that liquid spreads in different currencies from the same issuer may not be explained by the cross currency basis. One possible explanation for this phenomenon was already pointed out by Marcino above: FX-credit correlation. If your issuer is a large bank (being strategically important), a possible default of this bank would have a significant impact on the FX rate. In this case you would rather have your bond in the currency which will be stronger upon default (because your recovery payment will be more valuable). But this will potentially come with an additional spread on top of the cross currency basis (the latter one is not issuer dependent).&lt;/p&gt;&#xA;" OwnerUserId="24237" LastActivityDate="2016-09-02T09:43:34.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29952" PostTypeId="2" ParentId="3764" CreationDate="2016-09-02T09:55:11.397" Score="1" Body="&lt;p&gt;For Q1 and Q2 I would suggest you should not use a columnar database. The reasons are as follows:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;A typical write-access for your data-type would need to update several symbols with both timestamp and price together in different tables. Due to the high cardinality of your data (low no. of duplicates), columnar compression techniques would not be able to provide the promised speed benefits.&lt;/li&gt;&#xA;&lt;li&gt;Consider whether you would need joins on these large tables when reading them later, because columnar databases don't perform well on joins.&lt;/li&gt;&#xA;&lt;li&gt;For a time-series database with one symbol per table, I would recommend using a traditional RDBMS whose layout and queries have been fine-tuned considering the machine available and the data size/growth estimates.  A properly partitioned conventional modern RDBMS would work well. Indexes may (or may not!) speed up read times, but will definitely slow down writes. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Answer to Q3: Columnar databases are good for low cardinality data, for example status flags - Y/N, male/female, address fields such as state/country, etc. with mostly repeated values throughout the column. A simplistic understanding would be that they break down a table by its fields and record its unique values into a dictionary, the column is then stored as an array of indexes to the dictionary, this allows for high compression and higher speeds as the amount of data retrieved/manipulated is reduced. Actual implementations use many other optimizations such as cache-aware sorting, etc. But the overhead makes writes much slower than modern conventional RDBMS. Columnar databases are specialized software and show great performance only for specific cases, whereas modern RDBMS can be customized and fine-tuned to many different use cases and provide much better help and support to accomplish this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've had very good results with fast writes using Oracle and PostgresQL; and materialized views for fast reads/reporting/analytics. For high performance applications, I've benefited greatly by advice from seasoned, experienced DBAs; I would strongly recommend investing in them instead of buying a shiny new columnar database which a consultant recommended.&lt;/p&gt;&#xA;" OwnerUserId="22333" LastActivityDate="2016-09-02T09:55:11.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29953" PostTypeId="2" ParentId="20642" CreationDate="2016-09-02T10:17:53.103" Score="1" Body="&lt;p&gt;Just found this: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.quandl.com/data/SF0/documentation/about&quot; rel=&quot;nofollow&quot;&gt;https://www.quandl.com/data/SF0/documentation/about&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BOOMSHAKALA! Includes R (amongst a lot of others) and a full db csv download option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.quandl.com/tools/full-list&quot; rel=&quot;nofollow&quot;&gt;https://www.quandl.com/tools/full-list&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="22730" LastActivityDate="2016-09-02T10:17:53.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29956" PostTypeId="2" ParentId="29948" CreationDate="2016-09-02T13:47:48.127" Score="1" Body="&lt;p&gt;By definition&lt;/p&gt;&#xA;&#xA;&lt;p&gt;let $t^n_k=\frac{k}{n}T$, &#xA;$$I^n = \sum_{k=0}^{n-1} (K-X_{t_k})(Y_{t_k}-Y_{t_{k+1}}) \to_{n\to\infty} I = \int_0^T (X_t-K)dY_t $$&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-09-02T13:47:48.127" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29957" PostTypeId="1" AcceptedAnswerId="30090" CreationDate="2016-09-02T15:00:18.107" Score="11" ViewCount="2718" Body="&lt;p&gt;I am trying to figure out what all online Quant Finance courses are out there which are free or relatively less pricey?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;CQF is not less pricey&lt;/li&gt;&#xA;&lt;li&gt;Financial Engineering course on Coursera - Not so great unless you are a very basic learner&lt;/li&gt;&#xA;&lt;li&gt;Option Pricing course on EDX - I found it to be good.&lt;/li&gt;&#xA;&lt;li&gt;MIT Open Courseware videos - pretty good.&lt;/li&gt;&#xA;&lt;li&gt;Monte Carlo Methods in Finance - This was hosted on some MOOC platform in 2014. Pretty interesting for beginners&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;But most of the above ones except CQF is not a full fledged course which 1 can pursue. In today's world of MOOC's there are so many Data Science specializations out there but I don't see any on Quantitative Finance/Stochastic Calculus/Derivatives Modelling etc. courses out there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anybody have any idea if any such courses are available or maybe about to be available?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot.&lt;/p&gt;&#xA;" OwnerUserId="20162" LastEditorUserId="20162" LastEditDate="2016-09-02T16:22:23.950" LastActivityDate="2019-09-18T11:18:52.743" Title="Free or Relatively Less Pricey Quant Finance courses online" Tags="&lt;option-pricing&gt;&lt;stochastic-calculus&gt;&lt;quantitative&gt;&lt;quants&gt;" AnswerCount="5" CommentCount="2" FavoriteCount="19" CommunityOwnedDate="2016-09-04T07:59:22.783" ContentLicense="CC BY-SA 3.0" />
  <row Id="29959" PostTypeId="1" AcceptedAnswerId="29964" CreationDate="2016-09-02T15:56:49.407" Score="0" ViewCount="72" Body="&lt;p&gt;I have only been able to find the calculation for computing volatility for two assets, and I don't believe one can solve for covariance of $n$ assets where $n&amp;gt;2$ . Is there a method for solving for a portfolio's volatility through it's components purely mathematically? I can always solve via simulation but mathematically would be more precise.&lt;/p&gt;&#xA;" OwnerUserId="18578" LastEditorUserId="2587" LastEditDate="2016-09-19T15:09:01.433" LastActivityDate="2016-09-19T15:09:01.433" Title="Solving for volatility of a portfolio via its components" Tags="&lt;risk-management&gt;&lt;var&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29960" PostTypeId="2" ParentId="17204" CreationDate="2016-09-02T16:12:52.513" Score="1" Body="&lt;p&gt;With Monte Carlo, which is nothing more than a numerical method to approximate a definite integral, convergence to K significant digits using N samples means that you will obtain the same K significant digits regardless of the random number sequence used for the N samples.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you say that you obtained the same option price from two Monte Carlo runs using 100,000 samples, I am presuming that you are truncating or rounding your Monte Carlo result to cents, or possibly dollars.  Using 100,000 samples for a Monte Carlo, you can have numerical method errors ranging from at least +/- 6% of the answer you get.  So, if you truncate your MC answers to 10% or more precision (to deciles), then it is very possible that you could get the same answers every time you run your MC using 100,000 samples.  If you truncated your MC answers to less than a 10% precision (to say percentiles), you got lucky.  It will be just a fluke that you got the same answers twice in a row.&lt;/p&gt;&#xA;" OwnerUserId="24242" LastActivityDate="2016-09-02T16:12:52.513" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29961" PostTypeId="1" CreationDate="2016-09-03T04:25:08.157" Score="2" ViewCount="132" Body="&lt;p&gt;Since calls and puts have opposite sign delta, but both are positive vega, it feels like a strategy that buys/sell or sells/buys calls and puts on underlying moves to capture delta should generally tend to be vega neutral. Yet I always find that instead vega pnl always looks very negative. Why could that be, intuitively? &lt;/p&gt;&#xA;" OwnerUserId="1456" LastActivityDate="2016-11-04T10:49:58.247" Title="If you try to capture short term delta by anticipating moves in the underlying, why would vega pnl be so bad?" Tags="&lt;options&gt;&lt;delta&gt;&lt;vega&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29962" PostTypeId="1" AcceptedAnswerId="29966" CreationDate="2016-09-03T08:39:19.270" Score="1" ViewCount="305" Body="&lt;p&gt;I am using R moving average crossover backtest script from &lt;a href=&quot;http://www.eickonomics.com/posts/2014-03-26-python-vs-R-simple-MA-cross-over-model/&quot; rel=&quot;nofollow noreferrer&quot;&gt;eickonomics&lt;/a&gt;. But I have a question about this section.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#Calculate the moving averages and lag them one day to prevent lookback bias&#xA;PreviousSMA_50 &amp;lt;- lag(SMA(Cl(data[['SPY']]),50))  &#xA;PreviousSMA_200 &amp;lt;- lag(SMA(Cl(data[['SPY']]),200))&#xA;. &#xA;.&#xA;data$weight[] = ifelse(as.integer(PreviousSMA_50&amp;gt;PreviousSMA_200)==1,1,0)  #If price of SPY is above the SMA then buy&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why does the author need to lag the SMA values? Why can't he simply use unlagged values?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;PreviousSMA_50 &amp;lt;- SMA(Cl(data[['SPY']]),50) &#xA;PreviousSMA_200 &amp;lt;- SMA(Cl(data[['SPY']]),200)&#xA;. &#xA;.&#xA;data$weight[] = ifelse(as.integer(PreviousSMA_50&amp;gt;PreviousSMA_200)==1,1,0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Why would we use previous SMA value instead of current SMA value? How does it cause lookahead bias? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we need other indicators do we have to lag those values as well?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;rsi&amp;lt;-RSI(Cl(data[['SPY']]),50) &#xA;roc&amp;lt;-ROC(Cl(data[['SPY']]),50) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="16754" LastEditorDisplayName="user13444" LastEditDate="2016-12-16T17:57:43.017" LastActivityDate="2016-12-16T17:57:43.017" Title="Do we need to lag values for backtesting?" Tags="&lt;programming&gt;&lt;backtesting&gt;&lt;technical-analysis&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29963" PostTypeId="1" AcceptedAnswerId="29965" CreationDate="2016-09-03T10:03:21.720" Score="0" ViewCount="151" Body="&lt;p&gt;I know&#xA;$$\int _0^t dW_s=W_t-W_0=W_t$$&#xA;Since $ dW_s dW_s=ds$ ,  so&#xA;$$\int _0^t( dW_s)^2=\int_0^t ds=t-0=t$$&#xA;I Want to know why for $n\ge 3$ we have&#xA; $$\int _0^t (dW_s)^n=0$$&#xA;&lt;strong&gt;My try&lt;/strong&gt;&#xA;$$(dW_s)^2 dW_s (dW_s)^{n-3}=ds dW_s (dW_s)^{n-3}&#xA;=0$$&#xA;Is it true? What is relation between Ito Integarl and varation?&lt;/p&gt;&#xA;" OwnerUserId="22715" LastEditorUserId="22715" LastEditDate="2016-09-04T14:39:34.210" LastActivityDate="2016-09-04T14:39:34.210" Title="Integral with respect of $(dW_s)^n$" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29964" PostTypeId="2" ParentId="29959" CreationDate="2016-09-03T11:08:05.633" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Is there a method for solving for a portfolio's volatility through it's components purely mathematically?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Take variance as a measure of volatility. Let $X_1,\dotsc,X_n$ be a set of random variables (e.g. asset returns). Let $a_1,\dotsc,a_n$ be a corresponding set of weights (e.g. portfolio weights). Then the variance of the linear combination of the random variables (the volatility of the portfolio) is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{aligned}&#xA;\text{Var}\left(\sum_{i=1}^n a_i X_i\right) &amp;amp;= \sum_{i=1}^n \text{Var}(a_i X_i)+\sum_{i=1}^n \sum_{j=1}^n \text{Cov}(a_i X_i,a_j X_j) \\&#xA;&amp;amp;= \sum_{i=1}^n a_i^2 \text{Var}(X_i)+\sum_{i=1}^n \sum_{j=1}^n a_i a_j \text{Cov}(X_i,X_j). \\&#xA;\end{aligned}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This works for $n=2,3,\dotsc$, so not only for $n=2$. (Also, it is a very general result. It does not require any distributional assumptions.)&lt;/p&gt;&#xA;" OwnerUserId="19645" LastActivityDate="2016-09-03T11:08:05.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29965" PostTypeId="2" ParentId="29963" CreationDate="2016-09-03T11:44:03.593" Score="1" Body="&lt;p&gt;The result is true, but your solution is meaningless.Let $I=\{t_0,t_1,\cdots,t_m\}$ is a sequence of partitions of $[0,t]$ and $\delta_m=\max\{t_{i+1}-t_{i}\}_{i=0}^{m}\to 0$ as $m\to \infty$. For $n=3$, we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Big|\sum_{i=0}^{m-1}(W_{t_{i+1}}-W_{t_{i}})^3\Big|\le\underset{0\le i\le m-1}{\mathop{\max }}\Big|W_{t_{i+1}}-W_{t_{i}}\Big|\cdot\Big|\sum_{i=0}^{m-1}(W_{t_{i+1}}-W_{t_{i}})^2\Big|\tag 1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since  the sample path of Wiener process is continues, thus&#xA;$$\lim_{m\to \infty}\underset{0\le i\le m-1}{\mathop{\max }}\Big|W_{t_{i+1}}-W_{t_{i}}\Big|=0\tag 2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\lim_{m\to \infty}\Big|\sum_{i=0}^{m-1}(W_{t_{i+1}}-W_{t_{i}})^2\Big|=\lim_{m\to \infty}\sum_{i=0}^{m-1}(W_{t_{i+1}}-W_{t_{i}})^2=t&amp;lt;\infty\tag 3$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(1)$ and $(2)$ and $(3)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\lim_{m\to \infty}\Big|\sum_{i=0}^{m-1}(W_{t_{i+1}}-W_{t_{i}})^3\Big|=\Big|\lim_{m\to \infty}\sum_{i=0}^{m-1}(W_{t_{i+1}}-W_{t_{i}})^3\Big|\le 0$$&#xA;therefore&#xA;$$\lim_{m\to \infty}\sum_{i=0}^{m-1}(W_{t_{i+1}}-W_{t_{i}})^3=0$$&#xA;In other words&#xA;$$\int_{0}^{t}(dW_s)^3=0$$&#xA;Let the theorem is true for $n=k$, $k&amp;gt;3$, i.e&#xA;$$\int_{0}^{t}(dW_s)^k=\lim_{m\to \infty}\sum_{i=0}^{m-1}(W_{t_{i+1}}-W_{t_{i}})^k=0\tag 4$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For $n=k+1$, we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Big|\sum_{i=0}^{m-1}(W_{t_{i+1}}-W_{t_{i}})^{k+1}\Big|\le\underset{0\le i\le m-1}{\mathop{\max }}\Big|W_{t_{i+1}}-W_{t_{i}}\Big|\cdot\Big|\sum_{i=0}^{m-1}(W_{t_{i+1}}-W_{t_{i}})^{k}\Big|\tag 5$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(2)$ and $(4)$ and $(5)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\lim_{m\to \infty}\Big|\sum_{i=0}^{m-1}(W_{t_{i+1}}-W_{t_{i}})^{k+1}\Big|=\Big|\lim_{m\to \infty}\sum_{i=0}^{m-1}(W_{t_{i+1}}-W_{t_{i}})^{k+1}\Big|\le 0$$ &#xA;In other words&#xA;$$\int_{0}^{t}(dW_s)^{k+1}=0$$&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The theorem was proved by mathematical induction.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-09-03T16:37:24.027" LastActivityDate="2016-09-03T16:37:24.027" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29966" PostTypeId="2" ParentId="29962" CreationDate="2016-09-03T11:44:13.663" Score="3" Body="&lt;p&gt;Because SMA value for a certain day includes that day's closing price. But before the market closing time, obviously it isn't known (because it's in the future), you only know yesterday's closing value. You can not use today's closing price (or any other indicator which is calculated using it) to make any trading decisions or forecasts for this same day.&lt;/p&gt;&#xA;" OwnerUserId="5086" LastActivityDate="2016-09-03T11:44:13.663" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29968" PostTypeId="1" CreationDate="2016-09-03T12:57:37.077" Score="0" ViewCount="79" Body="&lt;p&gt;How do option traders choose their strikes and maturities ? Like why would one roll XX% puts in their protection leg instead of YY% puts, or why choose specifically XX%/YY% as the strikes in a strangle to bet on volatility and not something else etc... I know there are some explanations like &quot;it's the combination that yields the lowest mean delta&quot; or &quot;its the strategy that works the most&quot; but for some reason I don't like them, it's too close to over fitting in backtesting.&lt;/p&gt;&#xA;" OwnerUserId="19693" LastActivityDate="2016-09-03T15:41:32.190" Title="How do option traders choose the strikes and maturities?" Tags="&lt;options&gt;&lt;backtesting&gt;&lt;derivatives&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29969" PostTypeId="2" ParentId="29968" CreationDate="2016-09-03T15:41:32.190" Score="1" Body="&lt;p&gt;If the strategy does not depend on the maturity or strikes (which is rarely true), it is chosen with the available options in the market: the option market is very illiquid, so building a strategy will be a lot cheaper if you use the most liquid strikes/maturities&lt;/p&gt;&#xA;" OwnerUserId="15650" LastActivityDate="2016-09-03T15:41:32.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29970" PostTypeId="1" AcceptedAnswerId="29998" CreationDate="2016-09-03T16:01:02.603" Score="4" ViewCount="1200" Body="&lt;p&gt;1 - I am trying to understand the concept of EVT and how we are able to calculate VaR and ES from that. I would like to understand the maths in more detail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2 - If I have a portfolio of Long and Short options on various stocks, I can create the historical PnL distribution of this portfolio with the help of historical stock price data. Now for this portfolio if I want to use EVT to calculate VaR and ES, how do I go about that? How can I do it with R or by hand?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It will be great if you can point me to some videos or materials which handles this topic from the very basics.&lt;/p&gt;&#xA;" OwnerUserId="20162" LastEditorUserId="19645" LastEditDate="2016-09-03T16:29:43.213" LastActivityDate="2020-07-23T16:14:25.327" Title="Extreme Value Theory in Risk Management" Tags="&lt;r&gt;&lt;var&gt;&lt;reference-request&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29971" PostTypeId="2" ParentId="29941" CreationDate="2016-09-03T16:45:13.897" Score="0" Body="&lt;p&gt;Short answer: Nothing need to be added. At least in my opinion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have a stock selected by whatever rule and the company is acquired or has merged, one could argue, that the investment case (fundamental / technical rules) is not in place anymore and you do not want to keep the successor stock, but instead sell the old one.&#xA;The standard price pattern for these cases would look like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/OiN6L.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/OiN6L.png&quot; alt=&quot;Airgas acquired by Air Liquide&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Airgas was aquired by Air Liquide. The transaction was completed at 23rd of May this year (see &lt;a href=&quot;http://investor.shareholder.com/arg/releases.cfm&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://investor.shareholder.com/arg/releases.cfm&lt;/a&gt;). But the real economic impact of this happened already in November of last year when the agreement between the two companies was announced.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If one had traded this in some kind of quantitative strategy, you usually would check if there is a possibility of a counter bid and if not or unlikely, you would sell the stock very soon afterwards. Because, as one can see clearly in the chart, the price won't do much anymore.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For backtesting purposes only, the easy way would be to sell every stock which has no further price history (e.g. for Airgas at the end of April). More sophisticated would be to check daily/weekly every stock in your portfolio for an abrupt change to an ultra-low volatility regime (e.g. through historic volatility and daily bar size) and sell every stock immediately if this ultra-low volatility criteria is fullfilled, because it indicates with a very high probability an acquisition/merger/etc.&lt;/p&gt;&#xA;" OwnerUserId="24201" LastActivityDate="2016-09-03T16:45:13.897" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29972" PostTypeId="2" ParentId="29970" CreationDate="2016-09-03T18:05:35.667" Score="4" Body="&lt;p&gt;EVT has pluses and minuses, but (under certain conditions) provides the best estimate of extreme quantile returns in a portfolio given the data available.  Probably the simplest and easiest way to do this is to use the peak over threshold method and fit the Generalized Pareto Distribution (GPD). The GPD is very convenient for calculating VaR and ES.  A good reference by an expert is &lt;a href=&quot;http://www.sfu.ca/~rjones/econ811/readings/McNeil%201999.pdf&quot; rel=&quot;nofollow&quot;&gt;this paper by McNeil&lt;/a&gt;. You should make sure to estimate the standard error around your estimate so that you know how reliable the result is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of a long/short portfolio of stock options, you should check whether the option strikes are such that the options are likely to have a material amount of gamma when your portfolio experiences very large moves. For example, if we only had a single stock option in the portfolio and the 99.9th percentile portfolio return happens just when the stock option starts to get in the money, it is likely that EVT will struggle to give a good estimate due to the option nonlinearity (the EVT doesn't get to know which instruments are in your portfolio, only the portfolio returns). But if the options are struck reasonably close to the money, then they will likely act in a linear way when the large returns from the time series are applied to them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can probably code something in Excel, but R has a lot of useful packages for EVT - I recommend RStudio (free) as an interface to R.&lt;/p&gt;&#xA;" OwnerUserId="22326" LastEditorUserId="22326" LastEditDate="2016-09-04T14:45:33.643" LastActivityDate="2016-09-04T14:45:33.643" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29973" PostTypeId="1" AcceptedAnswerId="29978" CreationDate="2016-09-03T23:58:48.327" Score="5" ViewCount="653" Body="&lt;p&gt;I have a decade of experience as a software engineer, but little quantitative finance knowledge. I have an idea for a simple trading strategy based around moving averages. In order to test it, I'd like to benchmark the algorithm against historical data sets for some publicly traded US tickers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is mostly around the mechanical act of actually doing this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where can I obtain these data sets? Either in downloaded files, or via web API? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally, these would be free. I don't need high resolution or any special features. Basically just a daily quote for some major US companies, tabulated nicely into a CSV or some other structured data. Actually, a simple flat file download would be preferable, as I don't want to be hammering some API and incurring latency, limits, and/or potential cost.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="2470" LastEditorUserId="38578" LastEditDate="2019-02-15T01:09:11.783" LastActivityDate="2021-04-08T18:29:52.603" Title="Where to get historical equity data?" Tags="&lt;equities&gt;&lt;programming&gt;&lt;historical-data&gt;&lt;strategy&gt;&lt;moving-average&gt;" AnswerCount="6" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="29974" PostTypeId="1" AcceptedAnswerId="30017" CreationDate="2016-09-04T01:01:52.517" Score="2" ViewCount="1088" Body="&lt;p&gt;I am doing a research exercise where I have two price series $X_t, Y_t$ which I regress against each other and test for cointegration. &lt;br&gt; &#xA;Once I confirm that they are cointegrated (using CADF or Johansen test) I derive the equation for the spread as&#xA;&lt;br&gt;&#xA;$$spread_t = Y_t - (\alpha + \beta X_t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or alternatively&#xA;&lt;br&gt;&#xA;$$spread_t = Y_t -  \beta X_t$$ &lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\alpha$ is the intercept and $\beta$ is the slope coefficient from the regression of $Y_t$ on $X_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a next step I want to do Monte Carlo simulations to test the simple trading rule.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;if spread above 2 st.dev wrt equilibrium buy X and sell Y;&lt;/li&gt;&#xA;&lt;li&gt;if spread below 2 st.dev wrt equilibrium sell X and buy Y;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;but don't know &lt;strong&gt;how to construct the Monte Carlo paths for the simulation&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Could anybody explain how the simulation could be carried out?&lt;/strong&gt;  &lt;br&gt;&#xA;&lt;br&gt;&#xA;Most of the textbooks and research papers explain just how to find asset pairs and test them for the cointegration. Some explain the back-testing on the historical data. I haven't found any explanations how the Monte Carlo simulation could be used to test such trading strategy. &#xA;&lt;br&gt;&#xA;&lt;br&gt;&#xA;Should be only the spread modeled in the AR(1) like process? It seems that one would need to simulate the asset prices anyway. &#xA;Should I maybe use the Vector Auto-regressive  Model (VAR)? My understanding here is that this would give me  some equation again where the spread would be expressed in therms of lagged asset prices. &lt;br&gt;&#xA;Each of the two assets doesn't have to be mean reverting. If I model the prices independently how then the relation (cointegration) between them would be preserved? &lt;/p&gt;&#xA;" OwnerUserId="18670" LastEditorUserId="18670" LastEditDate="2016-09-06T09:14:25.697" LastActivityDate="2016-09-10T20:42:13.927" Title="Cointegration pair trading - how to test a trading rule using Monte Carlo?" Tags="&lt;time-series&gt;&lt;monte-carlo&gt;&lt;quant-trading-strategies&gt;&lt;cointegration&gt;&lt;mean-reversion&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29975" PostTypeId="2" ParentId="29957" CreationDate="2016-09-04T03:03:36.110" Score="3" Body="&lt;p&gt;I have a playlist on youtube I made and will continue updating:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=jXFNpDcYOxM&amp;amp;list=PLqMiStH7exaXmQqV7y-tg68f2ZYZK3Yur&quot; rel=&quot;nofollow&quot;&gt;https://www.youtube.com/watch?v=jXFNpDcYOxM&amp;amp;list=PLqMiStH7exaXmQqV7y-tg68f2ZYZK3Yur&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18578" LastActivityDate="2016-09-04T03:03:36.110" CommentCount="1" CommunityOwnedDate="2016-09-04T07:59:22.783" ContentLicense="CC BY-SA 3.0" />
  <row Id="29976" PostTypeId="2" ParentId="29941" CreationDate="2016-09-04T03:08:50.853" Score="5" Body="&lt;p&gt;The problem you describe isn't trivial. Mainly because once you have it solved for all current known cases someone will figure out a way to do something different and mess up your system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are some approaches that I have seen somewhat successfully used. I won't claim they will give you complete coverage of every case, but they may give you some ideas to start with.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first suggestion is to not use the stock symbol as the primary ID for a company. You want to have your own form of data ID for every company that you deal with. This would be paired with a system for translating to and from your ID and possible symbols. This system will need to be aware of the symbology used by different data sources and the symbol changes over time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This addresses the false assumption that a stock symbol never changes and is consistent between data sources. This gives you better control over ticker changes, shifts to pink sheets and many other situations. It is extremely easy to mistake a symbol change for a company getting delisted if you don't track the company separately from the symbol. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My next suggestion is to always maintain a set of RAW data to work from. This would be the actual price as listed at that moment in time. Adjusted data sets can be great to work with, but it is extremely easy to gloss over what events really mean when you have them pre-baked into the data. As a quick example, a trading system that functions on a stock with dividends may not care about the dividend as a factor in the trade, but the dividend event can have a significant tax impact depending on the timing of the exit. It is tricky in pre-adjusted data sets to spot the situations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The next part is to have a system of storing and retrieving events in your analysis system. The way my group approached this was to have a dataset of company actions linked to the company ID and the date-time of the event. This would include descriptive information about the event, but also an attached action.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The actions were a simplified programmatic description of what happened to the stock at that moment in time. The action contained instructions that the program could use to modify the current holdings. This could include cash disbursements, splits, symbol changes, etc... Each instruction told the program what to do in that specific situation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a specific answer to your delisting question, we would have an action that specifically notes the delisting and have our analysis system take actions on the trade based on that situation. These need to be separate for other similar situations such as trading holds that may or may not lead to delistings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The system would take a query for data from a date range and compare it to actions during that time and adjust everything based on the specific need. This would then output the analysis dataset and any annotations about events needed for the analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit - I am giving details to help with the question below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a simplified example of the data structure used;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Companies are in a table and denoted by a specific ID. Each company has a one to many relationship to StockSeries(Each with a unique ID). There is also a utility table that translates data source symbols to a specific StockSeries based on the point in time referenced. This can be used bidirectionally for lookups.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each StockSeries has a raw data time series linked to it. (note - We don't use a database for this, but that is irrelevant.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each Company has a one to many relationship to an Events table that holds Descriptive, Qualitative, and basic event specific Quantitative information about corporate events.  This allows us to group and categorize events, but it isn't specifically used for acting on data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each event has a one to many relationship to an Actions table. Each Action is a specific programmatic action to take on any trade holdings for a specific StockSeries. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example; &#xA;Action {DateTime: XXXXX, SeriesID:12345, Action: SplitShares, Value: .5}&#xA;Action {DateTime: XXXXX, SeriesID:12345, Action: DisburseCash, Value .25}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way this is set up means that you do need to pay attention to what series the action applies to, but it also allows us to see what is going on from the company level.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Honestly, this is a massive oversimplification. As you build a system like this you will find case after case that doesn't fit or requires some special handling. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I described everything in terms of database structure because your question seemed to infer that is how you are thinking, but much of this was done without a formal database. You should find the data management system that works best for you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have specific questions I can share what I have done in the past. I am sure others will have good suggestions also.&lt;/p&gt;&#xA;" OwnerUserId="19959" LastEditorUserId="19959" LastEditDate="2016-09-04T04:14:48.887" LastActivityDate="2016-09-04T04:14:48.887" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="29977" PostTypeId="1" CreationDate="2016-09-04T03:16:16.790" Score="3" ViewCount="243" Body="&lt;p&gt;When a hedging portfolio $X$ is used to price an asset $V$ expiring at time $T$, is it required that $X(t) = V(t)$ for all $t\in [0, T]$ or is it enough to simply require $X(T)= V(T)$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have always thought that the first case where $X(t) = V(t)$ for all $t\in [0, T]$ is correct. However, Shreve in his book Stochastic Calculus for Finance II seems to be claiming otherwise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The exercise below seems to be claiming that the portfolio process $Y(t)$ of $\Delta(t)S(t)$ and money market hedges $C(t)$ because $Y(T)=C(T)$ a.s. Why is it not required to have $Y(t) = V(t)$ for all $t\in [0, T]$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/xgGHU.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/xgGHU.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/1KHHA.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/1KHHA.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="23846" LastEditorDisplayName="user16651" LastEditDate="2016-09-04T17:54:09.003" LastActivityDate="2017-04-03T17:49:33.357" Title="When a hedging portfolio $X$ is used to price an asset $V $ expiring at time $T$, is it required that $X(t) = V(t) $ for all $t\in [0, T]$?" Tags="&lt;option-pricing&gt;&lt;hedging&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29978" PostTypeId="2" ParentId="29973" CreationDate="2016-09-04T09:26:34.253" Score="3" Body="&lt;p&gt;Recently I came across interesting platform. &lt;a href=&quot;https://www.quantopian.com/&quot; rel=&quot;nofollow&quot;&gt;https://www.quantopian.com/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;they offer exactly what you need and for free. Basically, you code your algo in python, they provide data using api and backtesting.&lt;br&gt;&#xA;Hope it helps.&lt;/p&gt;&#xA;" OwnerUserId="22424" LastActivityDate="2016-09-04T09:26:34.253" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29979" PostTypeId="2" ParentId="29973" CreationDate="2016-09-04T10:38:15.040" Score="2" Body="&lt;p&gt;If you are by any chance familiar with R take a look at the following post &lt;a href=&quot;http://www.thertrader.com/2016/04/21/introducing-fidlr-financial-data-loader/&quot; rel=&quot;nofollow&quot;&gt;LINK&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It offers an easy way to obtain data from Yahoo finance, Google etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: Jameson, I am in a similar situation as you are. I was digging a bit deeper a found also &lt;a href=&quot;https://www.quandl.com/&quot; rel=&quot;nofollow&quot;&gt;Quandl&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20098" LastEditorUserId="20098" LastEditDate="2016-09-05T18:02:45.680" LastActivityDate="2016-09-05T18:02:45.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29981" PostTypeId="2" ParentId="29977" CreationDate="2016-09-04T11:23:46.587" Score="1" Body="&lt;p&gt;I posted a solution to this and other questions in Shreve's second volume &lt;a href=&quot;http://www.matthiasthul.com/wordpress/2010/09/04/stochastic-calculus-for-finance-ii-some-solutions&quot; rel=&quot;nofollow&quot;&gt;on my blog&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;To directly answer your question&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;First note that the process $C(t)$ represents a payout rate. That is, there is not a single terminal payoff $C(T)$ but over each time interval $\mathrm{d}t$, the contract pays $C(t)\mathrm{d}t$. The total discounted cash-flow that the contract pays is &#xA;\begin{equation}&#xA;\int_0^T D(u) C(u) \mathrm{d}u&#xA;\end{equation}&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;We are looking for an initial wealth $Y(0)$ and a portfolio process $\Delta(t)$ such that the discounted wealth process&#xA;\begin{equation}&#xA;D(T) Y(T) = Y(0) + \int_0^T \Delta(u) D(u) S(u) \left( (\alpha(u) - R(u)) \mathrm{d}u + \sigma(u) \mathrm{d}W(u) \right)&#xA;\end{equation}&#xA;is equal to the discounted cash-flow process with probability one, i.e.&#xA;\begin{equation}&#xA;D(T) Y(T) = \int_0^T D(u) C(u) \mathrm{d}u \qquad \mathbb{P}\text{-a.s.}&#xA;\end{equation}&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;While the discounted value processes are equal, you will generally have $Y(t) \neq C(t)$. Consider the following simplified example:&#xA;\begin{equation}&#xA;R(t) = 0, \quad T = 2, \quad C(t) = \begin{cases} 0 &amp;amp; \text{for } 0 \leq t &amp;lt; 1\\ 1 &amp;amp; \text{for } 1 \leq t \leq 2 \end{cases}&#xA;\end{equation}&#xA;I.e. the payout rate is constant at zero for $t \in [0, 1)$ and constant at one for $t \in [1, 2]$ (independent of $W(t)$). Then $Y(0) = 1$, $\Delta(t) = 0$ but $C(0) = 0$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="24222" LastEditorDisplayName="user16651" LastEditDate="2016-09-04T17:56:07.887" LastActivityDate="2016-09-04T17:56:07.887" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="29982" PostTypeId="1" CreationDate="2016-09-04T14:45:55.220" Score="0" ViewCount="186" Body="&lt;p&gt;Shreve mentioned that the forward and futures spread depends on the covariance of the underlying and discount factor under the risk neutral measure. Can anyone explain how to interpret this covariance under risk neutral measure? What does that mean intuitively? &lt;/p&gt;&#xA;" OwnerUserId="23846" LastActivityDate="2018-01-02T00:13:18.070" Title="What is a good way to interpret covariance under risk neutral measure?" Tags="&lt;asset-pricing&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="29984" PostTypeId="2" ParentId="17894" CreationDate="2016-09-04T18:52:17.903" Score="1" Body="&lt;p&gt;You can get them, either adjusted from &lt;a href=&quot;https://www.quandl.com/data/BCEUX?filterSelection=all&amp;amp;keyword=VSTOXX&amp;amp;page=3&quot; rel=&quot;nofollow&quot;&gt;barcharts&lt;/a&gt; or raw from &lt;a href=&quot;https://www.quandl.com/data/CHRIS/EUREX_FVS1-VSTOXX-Futures-Continuous-Contract-1-FVS1-Front-Month&quot; rel=&quot;nofollow&quot;&gt;quandle&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="994" LastActivityDate="2016-09-04T18:52:17.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29985" PostTypeId="1" CreationDate="2016-09-04T19:06:37.570" Score="1" ViewCount="62" Body="&lt;p&gt;Let $B_i(t), B_j(t)$ be two Brownian motion on a filtered probability space. Let {$\theta_1, \theta_2$} be a solution to the market risk of price equations and using {$\theta_1, \theta_2$}, the risk neutral Brownian motions are written as $\tilde{B_i}(t), \tilde{B_j}(t)$. It is easily shown that $$d\tilde{B_i}(t)d \tilde{B_j}(t) = \rho_{ij}(t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now suppose $\rho_{ij}(t)$ is not random, then $$dB_i(t){B_j}(t) = B_i(t)dB_i+ B_j(t)dB_i+dB_idB_j = B_i(t)dB_i+ B_j(t)dB_i+ \rho_{ij}(t)dt$$&#xA;Thus, $E[B_iB_j]=\int_0^{t}\rho_{ij}(u)du$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, $$\tilde{E}[\tilde{B_i}\tilde{B_j}]=\int_0^{t}\rho_{ij}(u)du.$$&#xA;Thus $$\tilde{E}[\tilde{B_i}\tilde{B_j}]=E[B_iB_j].$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if  $\rho_{ij}(t)$ is random, $$\tilde{E}[\tilde{B_i}\tilde{B_j}]\neq E[B_iB_j].$$ &#xA;In this case which of the previous steps fail to hold?&lt;/p&gt;&#xA;" OwnerUserId="23846" LastEditorUserId="11678" LastEditDate="2016-09-07T14:20:02.000" LastActivityDate="2016-09-07T14:20:02.000" Title="Can anyone explain one result regarding the correlation of Brownian motions?" Tags="&lt;stochastic-processes&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29986" PostTypeId="1" AcceptedAnswerId="29987" CreationDate="2016-09-04T20:09:22.343" Score="1" ViewCount="113" Body="&lt;p&gt;As far as I know, there is usually a betwixt in choosing the right value for a threshold. A trade off between bias and variance has to be encountered. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If a low threshold is chosen, the number of observations (exceedances) increase and the estimation becomes more smooth. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, low threshold also introduces some observations from the center of the distribution and the estimation becomes biased. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, a  relatively high threshold eliminates values that would have been part of the extrema hence a higher variance in the estimations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I know the value of a threshold chosen is fit to produce the best results? Moreover, If I am to do a trade off between , what would be worth? Overlook bias and ensure minimal variance or forsake variance and combat bias? Which is better? Are there any texts that I can refer to?&lt;/p&gt;&#xA;" OwnerUserId="15726" LastEditorUserId="467" LastEditDate="2016-12-04T14:27:47.740" LastActivityDate="2016-12-04T14:27:47.740" Title="What is a good choice of threshold for Value at Risk?" Tags="&lt;risk&gt;&lt;statistics&gt;&lt;risk-management&gt;&lt;var&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29987" PostTypeId="2" ParentId="29986" CreationDate="2016-09-04T22:31:09.750" Score="2" Body="&lt;p&gt;The basic method is to plot the result against different thresholds and use the one where it starts to converge. If you use the Hill-estimator it's called Hill-plot. But a lot of variants exist in EVT.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also see:  &lt;a href=&quot;https://www.ine.pt/revstat/pdf/rs120102.pdf&quot; rel=&quot;nofollow&quot;&gt;https://www.ine.pt/revstat/pdf/rs120102.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="22686" LastActivityDate="2016-09-04T22:31:09.750" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="29988" PostTypeId="1" AcceptedAnswerId="29995" CreationDate="2016-09-04T23:18:06.847" Score="0" ViewCount="666" Body="&lt;p&gt;&lt;strong&gt;The formula for the mean reversion model in log normal form:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$x=\ln(S)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$x_{i+1} = x_i + [a(m-x_i)-\frac{1}{2}\sigma^2] dt + \sigma  \sqrt{dt} \epsilon$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Can this formula be written in exponential form?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S(i+1)= S(i)\exp([a(m-S(i))-\frac{1}{2}\sigma^2] dt + \sigma \sqrt{dt}\epsilon)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any reason why we would use the log normal form?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alex&lt;/p&gt;&#xA;" OwnerUserId="24254" LastEditorUserId="20201" LastEditDate="2016-09-05T13:38:05.833" LastActivityDate="2016-09-05T13:39:23.760" Title="Mean reversion formula in log normal or exponential form?" Tags="&lt;mean-reversion&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29989" PostTypeId="2" ParentId="29961" CreationDate="2016-09-05T00:01:38.447" Score="2" Body="&lt;p&gt;I assume you refer to &lt;strong&gt;European plain vanilla&lt;/strong&gt; calls and puts. In this case it immediately follows from the put/call parity in a model-free setting that a call and put option &lt;strong&gt;with the same strike&lt;/strong&gt; have the same vega. Unless two different strikes are involved the resulting portfolio of a long position in one and a short position in the other with the same absolute number of options will be vega neutral.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2016-09-05T00:01:38.447" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="29990" PostTypeId="1" CreationDate="2016-09-05T02:48:46.177" Score="1" ViewCount="309" Body="&lt;p&gt;Why is any positive martingale the exponential of an Ito integral w.r.t. Brownian motion?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a little proof.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;For any positive P-martingale M, $dM_t = Mt ·1/M_tdM_t$. By Martingale Representation Theorem, $dMt = \Gamma_tdW(t)$ for some adapted process $\Gamma_t$. So $dM_t = M_t(\Gamma_t/M_t)dW$, i.e. any positive&#xA;  martingale must be the exponential of an integral w.r.t. Brownian motion.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Where in this proof are we using the fact that $M$ is positive?&lt;/p&gt;&#xA;" OwnerUserId="23846" LastActivityDate="2016-09-05T13:35:19.940" Title="Why can any positive martingale be written as the exponential of an Ito integral w.r.t. Brownian motion?" Tags="&lt;stochastic-processes&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29992" PostTypeId="2" ParentId="22010" CreationDate="2016-09-05T10:16:12.730" Score="2" Body="&lt;p&gt;It is normal. The finance industry is seeing a lot of incompetence. You can NOT realy on the sending party having a highly accurate timestamp - I have seen discrepancies up to more than a second during normal operation. Things hopefully get better once Windows 2016 is widespread as this naturally out of the box synchronized to 1ms accuracy. But at the moment...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;...my advice is to rely on other means. It is QUITE hard to measure true latency, but you can measure order latency. You basically need something that round trips from your end. Keep your side well synced, and then &quot;cope with it&quot; somehow. Third party timestamps will be off, because while you can follow best practices, many others do not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My current most active trading partner uses diferent computers to handle different symbols. The ticks are SIGNIFICNATLY off - as can be ween by timestamps moving backwards between symbols. Nothing I can do about this.&lt;/p&gt;&#xA;" OwnerUserId="2174" LastActivityDate="2016-09-05T10:16:12.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29993" PostTypeId="2" ParentId="29740" CreationDate="2016-09-05T11:57:53.590" Score="1" Body="&lt;p&gt;What you need is the convexity adjustment for 3 month libor when the payment is made 1 month after the reset date (ie 2 months before the natural date).   As an approximation, this will be approximately 2/3 of the convexity adjustment for an arrears swap (paid 3 months before the natural date) and it will be approximately 4/3 of the convexity adjustment for an averaging swap (paid an average of 1.5 months before the natural date).   &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-09-05T11:57:53.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29994" PostTypeId="2" ParentId="29990" CreationDate="2016-09-05T13:35:19.940" Score="1" Body="&lt;p&gt;You are using the fact that $M$ is positive because you divide by $M$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dividing by zero is the root of evil.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-09-05T13:35:19.940" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="29995" PostTypeId="2" ParentId="29988" CreationDate="2016-09-05T13:39:23.760" Score="1" Body="&lt;p&gt;No, you can use both forms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By using the first relationship, you can identify a linear relationship and use linear regression tools.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-09-05T13:39:23.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29996" PostTypeId="1" CreationDate="2016-09-05T15:47:18.427" Score="-1" ViewCount="828" Body="&lt;p&gt;I have a dataset of S&amp;amp;P500 returns for 16 yrs. When I plot the ECDF of the S&amp;amp;P500 and compare it against the CDF of an equivalent Normal distribution, I can see the existence of Fat Tails in the S&amp;amp;P 500 data. The code is as below:-&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quantmod) # Loading quantmod library&#xA;getSymbols(&quot;^GSPC&quot;, from = as.character(Sys.Date()-365*16)) # SPX price date for 16 yrs&#xA;&#xA;SPX &amp;lt;- dailyReturn(GSPC)&#xA;SPX_ecdf &amp;lt;- ecdf(as.numeric(SPX)) # dropping xts class&#xA;&#xA;plot(SPX_ecdf,lwd=2,col=&quot;red&quot;)# Plotting the empirical CDF of S&amp;amp;P500&#xA;SPX_mean &amp;lt;- mean(as.numeric(SPX))&#xA;SPX_sd &amp;lt;- sd(as.numeric(SPX))&#xA;&#xA;xseq&amp;lt;-seq(-4,4,.01)&#xA;cumulative&amp;lt;-pnorm(xseq, mean=SPX_mean, sd=SPX_sd)&#xA;lines(xseq,cumulative,col=&quot;blue&quot;,lwd=2) #Plotting the CDF of a Normal Distribution&#xA;legend(x=&quot;topleft&quot;,c(&quot;Empirical CDF of S&amp;amp;P 500 Daily returns&quot;,&quot;CDF of the Normal Distribution&quot;),col=c(&quot;red&quot;,&quot;blue&quot;),lwd=c(2,2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I would like to model the Tail of my data with the help of GPD. Now if I am correct, the shape parameter ($\xi &amp;gt; 0$) and scale parameter ($ \beta&amp;gt; 0$) in order for the Tail to be a Frechet (If it has really fat tails).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way in R, to test this out and also find the value of these parameters based on my data?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There used to be a package called &lt;strong&gt;POT&lt;/strong&gt; which had a function &lt;strong&gt;fitgpd&lt;/strong&gt; which I believe would have given me my scale and shape parameters. But this package is no longer available. Is anybody aware of a similar function in some other package which gives me the fitted parameters?&lt;/p&gt;&#xA;" OwnerUserId="20162" LastEditorDisplayName="user16651" LastEditDate="2016-09-05T19:30:24.183" LastActivityDate="2021-02-03T19:02:55.287" Title="Fitting Tail Data to Generalized Pareto Distribution in R" Tags="&lt;r&gt;&lt;pareto-distribution&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="29998" PostTypeId="2" ParentId="29970" CreationDate="2016-09-06T01:45:50.677" Score="2" Body="&lt;p&gt;To answer part 1:&#xA;For my MFE capstone project on EVT on interest rate swaps I used &lt;em&gt;Practical Methods of Financial Engineering and Risk Management: Tools for Modern Financial Professionals by Rupak Chatterjee&lt;/em&gt; (my advisor). Chapter 8 gives a good step by step intro to Power Laws and EVT. It also includes some quick Excel demos.&lt;/p&gt;&#xA;" OwnerUserId="18159" LastActivityDate="2016-09-06T01:45:50.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="29999" PostTypeId="1" AcceptedAnswerId="30018" CreationDate="2016-09-06T05:29:40.897" Score="-1" ViewCount="146" Body="&lt;p&gt;The normal stochastic equation only models mean and standard deviation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For now, I'm randomly picking returns from a historical CDF of the returns. I'd like to have some flexibility when it comes to the next two moments - Skewness and Kurtosis. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I'm looking for:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dS_t = \mu S_t \, dt + \sigma_t S_t \, dW_t + \mbox{skew-term} + \mbox{kurtosis-term}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm open to other ways to generating the random returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers!&lt;/p&gt;&#xA;" OwnerUserId="24276" LastEditorUserId="2299" LastEditDate="2017-05-14T11:57:14.230" LastActivityDate="2017-05-14T12:09:16.967" Title="Is there a stochastic equation which can model returns according to its four moments?" Tags="&lt;stochastic-processes&gt;&lt;returns&gt;&lt;skewness&gt;&lt;random-variables&gt;&lt;kurtosis&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30000" PostTypeId="1" CreationDate="2016-09-06T08:39:54.067" Score="1" ViewCount="610" Body="&lt;p&gt;I have a hard time figuring out whether my EWMA calculation of variance is correct when using the python package ARCH 3.2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently, I am doing the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;rm = am.univariate.EWMAVariance(0.94)&#xA;am.univariate.ZeroMean(x,volatility=rm).fit(disp='off').conditional_volatility[-1]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to obtain the EWMA variance over the dataframe x. I cannot figure out:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Why I need to fit the volatility model whereas EWMA is parameterless.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If the ordering of dates is taken care of. Should the time series&#xA;be passed in a given chronological order?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="24278" LastActivityDate="2016-09-06T08:39:54.067" Title="EWMA in python using the arch 3.2 package and pandas" Tags="&lt;finance&gt;&lt;python&gt;&lt;arch&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30001" PostTypeId="2" ParentId="29996" CreationDate="2016-09-06T08:47:33.050" Score="0" Body="&lt;p&gt;I think this should work for me &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(ismev)&#xA;SPX &amp;lt;- SPX*(-1) # Converting the lower tail to the upper tail&#xA;fit&amp;lt;-gpd.fit(as.numeric(SPX),0.04) # This will fit my data of the upper tail beyond threshold of 0.04 to a GPD&#xA;fit$mle    # This should give me the Maximum Likelihood estimates for the scale and shape parameter&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Please let me know if this looks fine?&lt;/p&gt;&#xA;" OwnerUserId="20162" LastActivityDate="2016-09-06T08:47:33.050" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30003" PostTypeId="2" ParentId="29974" CreationDate="2016-09-06T10:42:16.513" Score="0" Body="&lt;p&gt;I think you may confuse with Monte Carlo and time series models you are using. As you said some papers show back test of pair trading strategy, in practice it will do it. After fitting the spread series in in-sample data set (of cause co-integration test valid as well) then optimize parameters, like the trading threshold and stop-loss, then put this strategy in out-sample data set to do the testing. If it performs good and stable, then it's a OK strategy ready to use. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the Monte Carlo part it's hard to say how you can use directly. In general, you fit the two series Xs &amp;amp; Ys(depends what process you use, usually stocks use lognormal process, then run Monte Carlo to produce sort of &quot;out-sample&quot; data, then fit the spread series on the simulated series, after that do your best to find parameters(too much) that makes a strategy (usually find good parameters around simulation means, and control losses when extremes happen).&lt;/p&gt;&#xA;" OwnerUserId="7978" LastActivityDate="2016-09-06T10:42:16.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30005" PostTypeId="1" CreationDate="2016-09-06T13:37:01.707" Score="2" ViewCount="487" Body="&lt;p&gt;I am a little bit new in finance. Perhaps it is not suitable to ask here, but still, I would like someone can help me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I have now in hand are normal volatilities taken from Bloomberg for a swaption 1YX10Y. There are 7 swaption available: USD Swaption Spread 100, USD Swaption Spread 50, USD Swaption Spread 25, USD Swaption ATM, USD Swaption Spread -25, USD Swaption Spread 100, The The description for the with different strikes: ranging from -100bp,-50bp,-25bp,ATM,25bp,50bp,100bp. Suppose the values are 89, 90 ,91, 92,  93, 94, 95 respectively and the current forward swap rate is 5%. How to do the calibration? In general, I should find the least square error of &lt;code&gt;sum_{i}(Market_Price_{i}-Modeled_Price_{i})^2&lt;/code&gt;. However, when I have a particular model, what I calculate is the modeled price. However, how to calculate the market price? From my realization, I only have normal volatility only, I need to know the standard option formula agreed in market to obtain the market swaption value. What is the option formula then? Follow Black formula or Bachelier formula? Otherwise, I cannot do calibration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second question is about the difference between lognormal vol and normal vol. From bloomberg, it states that normal vol measure the absolute movement which lognormal vol measure % movement. Originally, I think lognormal vol should be applied to Black formula while normal vol is applied to Bachelier formula. However, it seems it is not true. Could someone elaborate the ideas a little bit?&lt;/p&gt;&#xA;" OwnerUserId="24284" LastActivityDate="2021-04-26T01:00:54.833" Title="question about the market quote from bloomberg" Tags="&lt;fixed-income&gt;&lt;finance&gt;&lt;bloomberg&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30006" PostTypeId="1" CreationDate="2016-09-06T15:42:33.420" Score="1" ViewCount="78" Body="&lt;p&gt;Suppose that I have two long-only portfolio construction strategies and that I backtest both of them on the same data. If I wanted to find out whether one of these methods would have outperformed the market, then I would regress the resulting excess returns of that method against the excess returns of the market and look at Jensen's alpha.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would I compare (using econometric methods) whether one strategy outperforms the other? Would it make sense to regress one against the other and test whether the intercept is different from $0$? &lt;/p&gt;&#xA;" OwnerUserId="11597" LastEditorUserId="11597" LastEditDate="2016-09-06T15:55:15.033" LastActivityDate="2016-09-06T15:55:15.033" Title="Comparing two portfolio construction strategies" Tags="&lt;portfolio-management&gt;&lt;performance-evaluation&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30007" PostTypeId="1" AcceptedAnswerId="30014" CreationDate="2016-09-06T15:52:03.903" Score="2" ViewCount="649" Body="&lt;p&gt;I have a dataset of S&amp;amp;P500 returns. How can I calculate the value of $F(X ⩽ x)$. My code is as below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quantmod) # Loading quantmod library&#xA;getSymbols(&quot;^GSPC&quot;, from = as.character(Sys.Date()-365*16)) # SPX price date for 16 yrs&#xA;&#xA;SPX &amp;lt;- dailyReturn(GSPC)&#xA;SPX_ecdf &amp;lt;- ecdf(as.numeric(SPX)) # dropping xts class&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How do I calculate the probability of my data to be, let's say $\le -0.025$ ?&lt;/p&gt;&#xA;" OwnerUserId="20162" LastEditorDisplayName="user16651" LastEditDate="2016-09-06T18:44:43.267" LastActivityDate="2016-12-06T10:33:54.150" Title="How to calculate Empirical Cumulative Probability in R" Tags="&lt;r&gt;&lt;probability&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30009" PostTypeId="2" ParentId="20704" CreationDate="2016-09-06T16:35:01.800" Score="0" Body="&lt;p&gt;I'm assuming that you have a one period discrete model; that is you are currently at time $t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $S_t=\frac{1}{m_t}$ be the asset or portfolio of assets that is used as the discount factor.  I assume that there are only two possible outcomes for this asset at time $t+1$: $S_u$ and $S_d$.  Assuming the existence of a risk free asset, I can formulate the problem using matrices as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{bmatrix} S_u &amp;amp; 1+r_f \\ S_d  &amp;amp; 1+r_f \end{bmatrix}\begin{bmatrix} \Delta \\ \Gamma \end{bmatrix} = \begin{bmatrix} a+b \frac{1}{S_u} \\a+b\frac{1}{S_d}\end{bmatrix}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $\Delta$ and $\Gamma$ are the units of each asset that I hold to construct the portfolio.  Solving the matrix for $\Delta$ and $\Gamma$ should give you the answer. &lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2016-09-06T16:35:01.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30012" PostTypeId="1" CreationDate="2016-09-06T20:45:50.057" Score="0" ViewCount="56" Body="&lt;p&gt;I'm trying to create a PDF that has the max values at its tails, and a P(x) of 0 at its mean. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially it would be something like two normal distributions lined up side to side.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any literature regarding such a distribution? I'm trying to model the probability of exiting a position. If the price of the position doesn't move, it has the lowest probability of being exited, but the probability of exit is highest with an extreme move in either direction. &lt;/p&gt;&#xA;" OwnerUserId="19473" LastActivityDate="2016-09-06T20:57:43.923" Title="Probability Distribution that fits my parameters?" Tags="&lt;statistics&gt;&lt;probability&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30013" PostTypeId="2" ParentId="30012" CreationDate="2016-09-06T20:57:43.923" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Essentially it would be something like two normal distributions lined up side to side.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This would e.g. be a mixture of two Gaussians. I.e. let $Y_+ \sim \mathcal{N} \left( \mu_+, \sigma_+^2 \right)$ and $Y_- \sim \mathcal{N} \left( \mu_-, \sigma_-^2 \right)$, then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;X \sim \begin{cases} Y_+ &amp;amp; \text{with probability } p\\ Y_- &amp;amp; \text{with probability } 1 - p \end{cases}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then $X$ has the probability density function&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;f_X(x) = p \phi_{Y_+}(x) + (1 - p) \phi_{Y_-}(x),&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\phi_{Y_\pm}$ are the corresponding normal density functions.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2016-09-06T20:57:43.923" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30014" PostTypeId="2" ParentId="30007" CreationDate="2016-09-06T20:59:01.667" Score="2" Body="&lt;p&gt;quantile() does the opposite of what you want. You could bootstrap probabilities in a loop:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   pseq &amp;lt;- seq(0.001,1, by=0.001)&#xA;   quantile(yourdatahere, pseq)&#xA;  Quantiles[which(abs(Quantiles - (-0.025)) == min(abs(Quantiles - (-0.025))))]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is a shitty inefficient verbose code but it works. ecdf() works too but I can't figure out how to force that data type to anything else. &lt;/p&gt;&#xA;" OwnerUserId="19473" LastActivityDate="2016-09-06T20:59:01.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30015" PostTypeId="2" ParentId="29974" CreationDate="2016-09-06T21:21:43.153" Score="1" Body="&lt;p&gt;You can't use Monte Carlo simulation to test a trading strategy. The parameters (assumptions) you put in the simulation paths will either confirm or reject your hypothesis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can't have an agnostic Monte Carlo test. If you do a stochastic test and write out the code for it, you wouldn't need to run it to know what the results would be. Either X and Y are assumed to converge or they aren't. If they converge, the test will yield positive results. If they don't, your portfolio sucks. That's it. If your simulation paths include a rule to converge at z standard deviations, then the portfolio rules will work. If they don't have any rules to converge, then your portfolio rules will suck. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is why they use historical data. Historical data does not require you to impose any assumptions on the simulation. Either they converge past 2 SD or they don't, but you don't know. You run the test to find out if two securities are cointegrated enough to run a stat arb trading strategy on them successfully. &lt;/p&gt;&#xA;" OwnerUserId="19473" LastActivityDate="2016-09-06T21:21:43.153" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30016" PostTypeId="1" AcceptedAnswerId="30129" CreationDate="2016-09-06T22:03:38.237" Score="2" ViewCount="170" Body="&lt;p&gt;I am self-studying and encountered the following problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/2UMpa.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/2UMpa.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My idea was to calculate the price of the put using a replicating portfolio, then use the formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Pe^{\gamma h} = S\Delta e^{\alpha h} + \beta e^{rh}$$ to solve for $\gamma$, where $P$ is the put premium, $\alpha$ is the continuously compounded return on the stock, $\beta$ is the amount lent in the replicating portfolio, and $\gamma$ is the continuously compounded return on the option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case $$\Delta = \frac{P_u - P_d}{S(u - d)}e^{-\delta h} = \frac{0 - 11.84485}{60.41285 - 33.15522}e^{0\cdot1} = -0.4345506$$ and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\beta = \frac{uP_d - dP_u}{u - d}e^{-rh} = \frac{1.40495(11.84485) - 0.77105(0)}{1.40495 - 0.77105}e^{-0.04\cdot1} = 26.22307,$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;giving a put premium of $$P = \Delta\cdot{}S + \beta = -0.4345506\cdot43 + 26.22307 = 7.53739.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I did not arrive at the same put premium as the textbook, I stopped here. I'm not sure where I am making my mistake at.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know my formula for $\beta$ is correct because:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A successful replicating portfolio must satisfy: $P_d = \Delta S_d e^{\delta h} + \beta e^{rh}$ and $P_u = \Delta S_u e^{\delta h} + \beta e^{rh}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then $\Delta = \frac{(P_d - \beta e^{rh})}{S_d}e^{-\delta h}$ and $\Delta = \frac{(P_u - \beta e^{rh})}{S_u}e^{-\delta h}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore $(P_d - \beta e^{rh})e^{-\delta h} S_u = (P_u - \beta e^{rh})e^{-\delta h} S_d$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Noting that $S_u = S_0\cdot u$ and $S_d = S_0 \cdot d$, we can eliminate $S_0$ and write&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P_d e^{-\delta h} u - \beta e^{rh}e^{-\delta h} u = P_u e^{-\delta h}d - \beta e^{rh - \delta h} d$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This implies that $P_d u e^{-\delta h} - P_u d e^{-\delta h} = \beta(e^{rh}e^{-\delta h}u - e^{rh}e^{-\delta h}d)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence $\beta = \frac{(P_d u - P_u d)e^{-\delta h}}{(u - d)e^{rh}e^{-\delta h}} = \frac{P_d u - P_u d}{u - d}e^{-rh}$&lt;/p&gt;&#xA;" OwnerUserId="5641" LastEditorUserId="5641" LastEditDate="2016-09-16T15:07:15.663" LastActivityDate="2016-09-16T15:07:15.663" Title="Calculating the annual return on an option using a replicating porfolio" Tags="&lt;binomial-tree&gt;&lt;replication&gt;&lt;self-study&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30017" PostTypeId="2" ParentId="29974" CreationDate="2016-09-06T22:39:21.253" Score="1" Body="&lt;p&gt;I am somewhat missing the objectivity or the distinctness of the objective of the question. Nevertheless, here are the conclusions on what I have understood.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;STEP I: Define and ascertain the minimum number of the data-points you need, for determination of $\alpha$ and $\beta$ and let this minimum number be called as a CHUNK or QUANTUM or BUNDLE. Also define the incremental stepping size e.g. $\mathscr{step\_size}$, by which the chunk would move forward in time. For a $\mathscr{chunk\_size}$ = 1000 and $\mathscr{step\_size}$ = 200, the input data moves from 0 to 1000; 200 to 1200; 400 to 1400; 600 to 1600 and likewise, and let's call these SEGMENTS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;STEP II: Each SEGMENT (after testing for the cointegration), would give somewhat different values for the $\alpha$ and $\beta$ which would give different values for $\mathscr{spread_t}$ form a set of random numbers, though a very closely seeded one. From these SEGMENT values, the decision making can be done.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note 1: I think it is the first step for which you wish to create MonteCarlo paths for the simulations. With C++, it can be accomplished using OpenMP, though it is quite stone-age primitive for something like MonteCarlo but with some clever tricks, it usually acquiesces to programmer's wishes.&#xA;Note 2: The crux of the approach is keeping the $\mathscr{step\_size}$ sufficiently short; through which a lot of closely-spaced and random(which is a paradox; hence quasi-random) values for $\mathscr{spread_t}$ can be generated.&#xA;Note 3: MonteCarlo simulations are fundamentally used where the parametric form of the conditioning has been already established and a large number of experiments needed to be done to ascertain the value of the desired variable. In this case, it can be adjudicated that the parametric form for determining $\mathscr{spread_t}$ has been ascertained and hence a MonteCarlo procedure can be carried out, with introduction of stochastic non-linear weight function in the $\mathscr{spread_t}$ (see below). Please note that, these $\mathscr{chunk\_size}$ and $\mathscr{step\_size}$ themselves can be made random, which would perhaps require more number of experiments to conduct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given this problem, my personal approach would be different, somewhat along the lines of:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;STEP I:&#xA;Modifying the spread, after the test for the cointegration has been confirmed, as this establishes the linearity of the relationship.&#xA;Introducing a function such as, $f(t) = k+e^{-\zeta(t, \sigma(t), \eta(t), \delta, \gamma, \cdots)}$, where $k$ is a real number, the shift factor, $\delta$ is a function that gives random number between 0 and 1, accounting for the normalized market-noise (this function mimics the so-called $\epsilon_i$, the random component, in regression analysis) and where $\eta(t)$ is simply the causal function. I would introduce another multiplicative variable $\gamma$ depending upon the historical weights and major share-holders' quantifiable decision making patterns. (It would be much easier, if the $X_t$ and $Y_t$ are the components of the DOW or S&amp;amp;P 500, as the major shareholding figures and the information about shareholders themselves, are easily available for such companies). Please notice that I am deliberately introducing the controlled non-linearity in this relationship for dynamic evaluation of $\mathscr{spread_t}$.&#xA;Here I have constructed a function for $\eta(t)$ for the NASDAQ:AAPL with only 8 data points, though it is extremely primitive, it does illustrate the way and future trend for the equity in the neighborhood of AUG.19.2016.&#xA;$$\eta(\tau) = \sin \left( 0.04545\tau \right) \times e^{1.22\sin \tau + \cos \tau} - 0.00840 \times \sin ({\tau}) \times \mathscr{e} ^{-\tau \sin(\tau)}$$&#xA;I have used $\tau$ for time-variable for visual clarity in equation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given below is a shifted-variation of this as $\eta(\tau-0.77)$&#xA;&lt;a href=&quot;https://i.stack.imgur.com/hETMa.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/hETMa.png&quot; alt=&quot;shifted-variation as $\eta(\tau-0.77)$ &quot;&gt;&lt;/a&gt;&#xA;and here is the final output(though it is very crude due to lack of HP Computing, so the pin-pointing the exact timing is not very reliable.&#xA;&lt;a href=&quot;https://i.stack.imgur.com/kfapU.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/kfapU.png&quot; alt=&quot;the red line indicates the most probable behavior in the neighborhood of AUG.19.2016, note that the shareholders&amp;#39; quantifiable input has been excluded.&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;STEP II:&#xA;Now, from here, I could go on and follow the above standard procedure, with writing OpenMP loops in C++ to conduct as many possible iterations as I could, without getting the cores hanged, to get a lock on the $\mathscr{spread\_t}$. And once, a lock in the predefined trading bandwidth is accomplished, the automated trading can be performed, as per the desired conditions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note 1&lt;/strong&gt; The idea of cointegration in pairs-trading (and in various other stochastic binary-system analysis/estimate procedures) is basically derived from the fact that, in the long run, the assets, or, in general, the cointegrated pair of variables, usually stabilize toward their equilibrium(or the mean regression); the so-called &quot;long-run-equilibrium&quot;(please note that this is just an informal analogy). And now, the MonteCarlo simulations, work backwards, that is, from the volume or the space of all possible outcomes, and interpreting this volume or the space as the probability; though the analysis and the usual pedagogy of Monte Carlo usually goes to show the equivalence of a Monte Carlo estimate to the Expected value of all possible outcomes for a given well-defined and distinct condition(invoking subsequently the &quot;law of large numbers&quot;) and from thereon the usual statistical analysis takes charge. This explains the difficulty in finding Monte Carlo simulation for pairs-trading strategy.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I haven't found any explanations how the Monte Carlo simulation could be used to test such trading strategy.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Also, since the cointegration, establishes a linear relationship between two random walks and Monte Carlo simulations generally don't work well with systems with a linear model. This is why I have introduced a transcedental non-linearity in my approach. Nevertheless, there has been some progress, please see &lt;a href=&quot;https://arxiv.org/pdf/0808.1710.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;this link&lt;/a&gt;. Now, to answer your first question, in theory it is possible to model an asset in isolation (without cointegration and the regressive features, dynamic or otherwise, and various other dependent-variable statistical tools, just using the time-series properties cleverly) but this doesn't generate realistic results. I had used, NASDAQ Composite and NASDAQ:AAPL in the first example. And to answer the second question, in my opinion, it is more of a choice between preserving linearity established by cointegration tests and the realistic results in estimation of future prices. I chose the latter, as it is evident in my approach. Please note that I haven't seen any Monte Carlo simulations for a linear binary system, as of yet. And I could be very well wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note 2&lt;/strong&gt;&#xA;For a parametric form of relationship which is linear, and its constants of proportionality, whose determination is a key issue in all types of simulation, when forced to a MonteCarlo simulation, requires at least the relation to be dependent not trivially on the non-stochastic terms and functions, for it limits the paths of simulations for such a procedure and yields unnecessary time and memory complexities. Any attempt to force genuine MonteCarlo eradicates the linearity of base relationship. The various methods presented to simulate Cointegrated Systems seem to be good, and can be programmed, in their original form, without invoking MonteCarlo method to get the desired outputs.&lt;/p&gt;&#xA;" OwnerUserId="24096" LastEditorUserId="24096" LastEditDate="2016-09-10T20:42:13.927" LastActivityDate="2016-09-10T20:42:13.927" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="30018" PostTypeId="2" ParentId="29999" CreationDate="2016-09-06T22:45:36.960" Score="1" Body="&lt;p&gt;I suggest you have a look at the paper:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Schloegel, Erik (2010) &quot;Option Pricing Where the Underlying Assets Follow a Gram/Charlier Density of Arbitrary Order&quot;, Journal of Economic Dynamics and Control, Vol. 37, No. 3, pp. 611-631&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;available on &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1724062&quot; rel=&quot;nofollow&quot;&gt;SSRN&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A random variable $Y$ that follows a Gram/Charlier Type A series distribution has the probability density function&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;f_Y(x) = \phi(x) \sum_{j = 0}^\infty c_j \mathrm{He}_j(x).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, $\phi(x)$ is the standard normal density function and the $\text{He}_j(x)$ are the Hermite polynomials. The coefficients $c_j$ are related to the cumulants of the distribution. When you truncate the infinite sum at $j = 4$, set $c_0 = 1$, $c_1 = c_2 = 0$, $c_3 = \mathcal{S} / 6$ and $c_4 = \mathcal{K} / 24$, then the resulting distribution has zero mean, unit variance and an approximate skewness of $\mathcal{S}$ and excess kurtosis of $\mathcal{K}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can now define the logarithmic price process $X$ as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;X_t = X_0 + \gamma t + \sigma \sqrt{t} Y,&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\gamma$ is chosen such that $S_t = S_0 \exp \left\{ X_t \right\}$ is a martingale under the bank account numeraire. This approach can be extended to multi periods. Please see the above paper for details. I can also recommend the author's book&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Schloegel, Erik (2014) &quot;Quantitative Finance - An Object-Oriented approach in C++&quot;, Chapman &amp;amp; Hall&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2016-09-06T22:45:36.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30019" PostTypeId="2" ParentId="29999" CreationDate="2016-09-06T23:43:15.113" Score="0" Body="&lt;p&gt;Levy models do that to some degree. They have the iid look and feel of the standard Gaussian models, but allow for higher moments. You can check the papers of Dilip Madan on Variance Gamma as a starting point. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-09-06T23:43:15.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30020" PostTypeId="2" ParentId="14726" CreationDate="2016-09-07T05:01:13.193" Score="1" Body="&lt;p&gt;This is an interesting and subtle question. You're testing a trading strategy, right? Presumably, it needs some time-series properties. If you do an independent bootstrap you'd mess those up. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the same time, independent is good for looking at certain aspects (e.g., skewness over multiple horizons from a momentum strategy). Other than that, you'll probably need to consider a block bootstrap or other dependent bootstrap. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In its simplest form CBB (Circular Block Bootstrap) &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;takes the data, lines up on a circle (to avoid endpoint problems), and&lt;/li&gt;&#xA;&lt;li&gt;For your blocksize N, you pick random starting points in the original dataset (on a circle)&lt;/li&gt;&#xA;&lt;li&gt;Fill in your bootstrap with the next N data points until your bootstrapped sample is the same size as the original. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Then run your strategy and calculate a Sharpe Ratio. From this, you can get a distribution of Sharpe ratios&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The challenge is picking the right blocksize. Usually, this is done with reference to the autocorrelation function of the original timeseries. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For non-bootstrap statistics on Sharpe Ratios, Andy Lo has a paper called &lt;em&gt;The Statistics of Sharpe Ratios&lt;/em&gt;, worth looking at. For IID, they are t-distributions. For non-IID, a HAC variance estimator is needed.&lt;/p&gt;&#xA;" OwnerUserId="15602" LastActivityDate="2016-09-07T05:01:13.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30021" PostTypeId="2" ParentId="3638" CreationDate="2016-09-07T08:38:06.230" Score="5" Body="&lt;p&gt;&lt;strong&gt;No&lt;/strong&gt;, a sum of two GARCH processes is generally not a GARCH process. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I am not even sure whether there exists a nontrivial special case where the opposite holds.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By GARCH I mean the classic definition of GARCH due to &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/0304407686900631&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bollerslev (1986)&lt;/a&gt;, not an arbitrary variation like EGARCH, IGARCH, FIGARCH or whatever else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me provide an example. Take two independent zero-conditional-mean processes $e_{1,t}$ and $e_{2,t}$. Let their conditional variances follow GARCH(1,1). Then the conditional variance equations of $e_{1,t}$ and $e_{2,t}$ are&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ &#xA;\begin{aligned}&#xA;\sigma_{1,t}^2 = \omega_1 + a_1 e_{1,t-1}^2 + b_1 \sigma_{1,t-1}^2; \\&#xA;\sigma_{2,t}^2 = \omega_2 + a_2 e_{2,t-1}^2 + b_2 \sigma_{2,t-1}^2. \\&#xA;\end{aligned}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take $e_t$ to be the simplest possible linear combination of $e_{1,t}$ and $e_{2,t}$, namely, their sum:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ e_t := e_{1,t} + e_{2,t}. $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Will its conditional variance follow a GARCH process? If it would, we could express the conditional variance of $e_t$ as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \sigma_t^2 = \omega + \sum_{i=1}^s \alpha_i e_{t-i}^2 + \sum_{i=1}^r \beta_i \sigma_{t-i}^2 $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(a GARCH($s$,$r$) equation). To show the conditional variance of $e_t$ follows GARCH($s$,$r$) we need to find the appropriate $\omega$, $\alpha$s, $\beta$s, $s$ and $r$. Can this be done? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us start by writing the conditional variance of $e_t$ explicitly based on the fact that $e_t = e_{1,t} + e_{2,t}$ and the properties of $e_{1,t}$ and $e_{2,t}$. The conditional variance of $e_t$ will be the sum of the conditional variances of $e_{1,t}$ and $e_{2,t}$ (there are no covariances due to the assumed independence):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ &#xA;\begin{aligned}&#xA;\sigma_t^2 &amp;amp;= \sigma_{1,t}^2 + \sigma_{2,t}^2 \\&#xA;&amp;amp;= \omega_1 + a_1 e_{1,t-1}^2 + b_1 \sigma_{1,t-1}^2 \\&#xA;&amp;amp;+ \omega_2 + a_2 e_{2,t-1}^2 + b_2 \sigma_{2,t-1}^2 \\&#xA;&amp;amp;= (\omega_1+\omega_2) + (a_1 e_{1,t-1}^2+a_2 e_{2,t-1}^2) + (b_1 \sigma_{1,t-1}^2+b_2 \sigma_{2,t-1}^2). \\&#xA;\end{aligned}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It does not seem possible to express this in terms of $\sigma_t^2 = \omega + \sum_{i=1}^s \alpha_i e_{t-i}^2 + \sum_{i=1}^r \beta_i \sigma_{t-i}^2$ (but how to prove it formally?). And this is the simple example where $e_{1,t}$ and $e_{2,t}$ are independent (so we spare any covariances that would otherwise appear in the above expressions) and the lag orders of their respective GARCH processes coincide.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Why do I arrive at a different conclusion than @John? His claim&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Assuming the coefficients in the Garch equations are constrained to be positive and sum to less than or equal to one on the lagged values, then $r_{3,t}$ will also follow a Garch process as a result of inheriting the Garch variances of the other variables&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;is unfounded, i.e. there is no proof or derivation supporting it. On the contrary, the above expressions illustrate (admittedly, without a formal proof) that the inheritence from the two component processes does not add up to fit in the form of a GARCH model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Bollerslev, Tim. &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/0304407686900631&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;Generalized autoregressive conditional heteroskedasticity.&quot;&lt;/a&gt; &lt;em&gt;Journal of Econometrics&lt;/em&gt; 31.3 (1986): 307-327.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="19645" LastEditorUserId="19645" LastEditDate="2017-05-12T17:24:03.600" LastActivityDate="2017-05-12T17:24:03.600" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="30022" PostTypeId="2" ParentId="27658" CreationDate="2016-09-07T08:45:52.713" Score="1" Body="&lt;p&gt;I'm not sure if you still need an answer, however, if you take a look at the original paper of Heston&amp;amp;Nandi (2000) you will find that &quot;Sig_&quot; as defined in your code, is similar to their annualized long-run volatility (P.579), except that here it is not annualized.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Omega=\frac{\left(\omega+\alpha\right)}{1-\beta-\alpha\gamma^{2}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;solving this for $\omega$ leads to what your code calls &quot;GARCH intercept&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, in your implementation&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;f=S_0.^phi.*exp(A_+B_.*Sig_)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$CF=S_{t}^{\phi}\exp\left(A\left(t,T,\phi\right)+B\left(t,T,\phi\right)h_{t+1}^{*}\right)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see, &quot;Sig_&quot; should be the conditional variance of the following time step (in the single-lag case).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, from what i understand, &quot;Sig_&quot; here is simply an arbitrary starting value for h(0), i.e., the conditional variance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer your question, yes, one could set it equal to the sample variance, but also to any other reasonable value. It barely has any effect on the result and due to the strong mean reversion property of the conditional variance it doesn't matter for longer return samples (few hundred observations).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should also keep in mind that you have to estimate your own parameters for the data you are using.&lt;/p&gt;&#xA;" OwnerUserId="24289" LastEditorUserId="24289" LastEditDate="2016-09-07T20:18:12.213" LastActivityDate="2016-09-07T20:18:12.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30023" PostTypeId="1" AcceptedAnswerId="30025" CreationDate="2016-09-07T08:47:01.240" Score="0" ViewCount="93" Body="&lt;p&gt;My goal is to obtain a strictly positive variance-gamma process for the variance process such that,&#xA;$$Y_{t+1} = Y_t + \mu\Delta + \sqrt{v_t\Delta}\,\,\varepsilon^y_{t+1}\\&#xA;\qquad \qquad\quad \,\,\qquad v_{t+1} = v_t + \kappa (\theta-v_t)\Delta + \sigma_v\sqrt{v_t\Delta}\,\,\varepsilon^v_{t+1} + J^v_{t+1} \\&#xA;J^v_{t+1} = \gamma G_{t+1} + \sigma \sqrt{G_{t+1}}\,\, \varepsilon^g_{t+1} \\&#xA;G_{t+1} \sim \Gamma ( \frac{\Delta}{\nu}, \nu)$$ &lt;br /&gt;&lt;br /&gt;&#xA;However, $J^v_{t+1}$ has to be non-negative in order to prevent the volatility from becoming negative. Does anyone have an idea about how to obtain such a process? &lt;/p&gt;&#xA;" OwnerUserId="22561" LastEditorDisplayName="user16651" LastEditDate="2016-09-07T09:43:13.023" LastActivityDate="2016-09-07T10:05:23.220" Title="Strictly positive variance gamma process?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-volatility&gt;&lt;variance-gamma&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30025" PostTypeId="2" ParentId="30023" CreationDate="2016-09-07T10:05:23.220" Score="0" Body="&lt;p&gt;The simplest way to deal with negative variance-gamma process is to override them as they arise. There are at least two ways to do this&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;In the full truncation scheme, a negative value for $v_t$ is floored at zero. Hence $v_t$ is replaced by $v_t^+=\max\{0,v_t\}$ everywhere in the discretization.&lt;/li&gt;&#xA;&lt;li&gt;In the reflection scheme, a negative value for $v_t$ is reflected with $-v_t$&#xA;. Hence $v_t$ is replaced by $|v_t|$ everywhere in the discretization.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The disadvantage of the full truncation scheme is that it creates zero variances, which is unrealistic because $Y_t$ never exhibit zero variance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The disadvantage of the reflection scheme is that it reflects a large negative variance to a large positive variance. Hence, it transforms realizations of low volatility into high volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet another way is to simulate $\ln v_t$ or $\sqrt{v_t}$ and then exponentiate or square the result.&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastActivityDate="2016-09-07T10:05:23.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30026" PostTypeId="1" AcceptedAnswerId="30027" CreationDate="2016-09-07T11:07:10.760" Score="1" ViewCount="757" Body="&lt;p&gt;We can compute VaR using Historical data and also by Fitting the tails of my Historical data to a GPD(Generalized Pareto Distribution) as shown in EVT and then compute EVT VaR from there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What advantages and dis advantages will each method hold over the other?&lt;/p&gt;&#xA;" OwnerUserId="20162" LastActivityDate="2016-09-07T23:26:43.257" Title="Historical VaR vs. EVT VaR" Tags="&lt;var&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30027" PostTypeId="2" ParentId="30026" CreationDate="2016-09-07T11:26:03.357" Score="3" Body="&lt;p&gt;Historical only has the advantage of being easily computable, that's pretty much it. It only makes sense if you have lots and lots of observations as you observed basically everything (you hope) that can happen. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;EVT&lt;/code&gt; can model the tail better but you are making a parametric assumption - so you need to say why you think &lt;code&gt;GPD&lt;/code&gt; is suitable. So this gives a better estimate as long as the distributional assumption holds. If it doesn't really, than you commit (quite likely) a massive error.  &lt;/p&gt;&#xA;" OwnerUserId="22237" LastActivityDate="2016-09-07T11:26:03.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30028" PostTypeId="2" ParentId="29985" CreationDate="2016-09-07T14:15:08.047" Score="1" Body="&lt;p&gt;If $\rho_{i, j}(t)$ is deterministic, they are indeed equal. However, if $\rho_{i, j}(t)$ is random, then&#xA;\begin{align*}&#xA;E\left(B_i(t) B_j(t) \right) &amp;amp;= E\left(\int_0^t \rho_{i,j}(u)du \right)\\&#xA;&amp;amp;= \int_0^t E(\rho_{i, j}(u)) du,&#xA;\end{align*}&#xA;and, similarly, &#xA;\begin{align*}&#xA;\tilde{E}\left(\tilde{B}_i(t) \tilde{B}_j(t) \right) &amp;amp;= \int_0^t \tilde{E}(\rho_{i, j}(u)) du.&#xA;\end{align*}&#xA;They may be different.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-09-07T14:15:08.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30029" PostTypeId="1" AcceptedAnswerId="30048" CreationDate="2016-09-07T17:31:55.817" Score="3" ViewCount="111" Body="&lt;p&gt;if I want to use &lt;code&gt;t-test&lt;/code&gt; to test significance of my returns, it assumes the random variable is distributed normally. But in my work I work under &lt;a href=&quot;https://en.wikipedia.org/wiki/Stable_distribution&quot; rel=&quot;nofollow&quot;&gt;stable distributed&lt;/a&gt; returns. It seems inappropriate to use this test then. Is there an alternative? Cannot google anything. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers guys&lt;/p&gt;&#xA;" OwnerUserId="22237" LastActivityDate="2016-09-14T17:55:19.440" Title="Significance of return under stable distribution" Tags="&lt;portfolio-management&gt;&lt;asset-returns&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30031" PostTypeId="1" CreationDate="2016-09-07T18:16:53.587" Score="1" ViewCount="63" Body="&lt;p&gt;So corporate profits are taxed as a percentage of the positive earning, but losses will not generate any taxes. Hence taxation have a clear option structure where the government has a call option on the profits generated by the company. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has there been any research on delta hedging this negative delta exposure from this tax option? For example increasing the leverage of the firm or (for publicly traded companies) by stock repurchase. Of course the hedging will change the value of the underlying and thus in turn change the amount needed to be hedged, which makes the problem somewhat complicated. Also there is no definite end point (only stops at bankruptcy).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems like an interesting area of research, but I could not find any references to it online. Are there any other areas (besides standard derivative trading) where techniques for delta hedging have been applied?&lt;/p&gt;&#xA;" OwnerUserId="24306" LastActivityDate="2016-09-07T18:16:53.587" Title="Delta hedging of tax option" Tags="&lt;hedging&gt;&lt;martingale&gt;&lt;delta&gt;&lt;european-options&gt;&lt;delta-neutral&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30034" PostTypeId="2" ParentId="30026" CreationDate="2016-09-07T23:26:43.257" Score="3" Body="&lt;p&gt;I will also add that calculating VaR and CVaR via EVT allows for a further analytical 'peek' into the tail. A dataset may only have 100 points to calculate those values but with EVT and Power Laws you could analytically calculate a 99.9999% VaR or CVaR rather than just a 99% VaR/CVaR from the data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally a bigger advantage is when compared to Monte Carlo methods, EVT can be much faster for finding VaR.&lt;/p&gt;&#xA;" OwnerUserId="18159" LastActivityDate="2016-09-07T23:26:43.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30035" PostTypeId="1" CreationDate="2016-09-08T02:08:03.990" Score="2" ViewCount="192" Body="&lt;p&gt;I was asked the following question at an interview:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Suppose that you're an OTC trader for an exchange that trades bitcoin. What would you do in the following scenario?&lt;/p&gt;&#xA;&lt;p&gt;A large corporate investor wants to initiate an OTC trade for &lt;span class=&quot;math-container&quot;&gt;$50,000$&lt;/span&gt; bitcoin (BTC) to be guaranteed at a price within &lt;span class=&quot;math-container&quot;&gt;$1\%$&lt;/span&gt; of the mid-market price. The average trading volume on the exchange is &lt;span class=&quot;math-container&quot;&gt;$10,000$&lt;/span&gt; BTC/day and volatility has been above average the trailing two weeks (BTC price can be very volatile).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;What would be an optimal answer for this?&lt;/p&gt;&#xA;&lt;p&gt;Observations:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The large transaction is equivalent to &lt;span class=&quot;math-container&quot;&gt;$500 \%$&lt;/span&gt; of the exchange's daily volume, so if we sell all the BTC at once, it will have an upward influence on the BTC price.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If we sell too low, the exchange could lose money if the transaction pumps the BTC price past what they were sold for.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;I'm thinking that partitioning the large transaction into smaller ones might be better, but I'm not certain. Any help or insight appreciated!&lt;/p&gt;&#xA;" OwnerUserId="24311" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2018-02-13T20:09:55.780" Title="Trading a large sum of bitcoin OTC" Tags="&lt;trading&gt;&lt;bitcoin&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30037" PostTypeId="1" CreationDate="2016-09-08T06:50:44.633" Score="0" ViewCount="2998" Body="&lt;p&gt;I want to calculate the EUR equivalent yield from the USD yield curve.&#xA;For example :&#xA; how to translate the USD libor curve into an EUR equivalent yield curve ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I need to use FX forwards or is the X-CCY basis enough ?&lt;/p&gt;&#xA;" OwnerUserId="16788" LastEditorUserId="20201" LastEditDate="2016-09-08T09:53:50.323" LastActivityDate="2016-09-08T14:35:03.930" Title="Convert USD yield into EUR yields" Tags="&lt;fx&gt;&lt;yield-curve&gt;&lt;currency&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30039" PostTypeId="1" AcceptedAnswerId="30053" CreationDate="2016-09-08T08:29:11.780" Score="1" ViewCount="316" Body="&lt;p&gt;Intuitively, Historical VAR is an approach which assumes that in the past data, we have observed everything that can happen, so we consider the worst case(tail). However, when your equity/instrument has a short time series, this assumption breaks down. It is very unlikely that a time series of 100 days will consist of the whole range of likely returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the best approach to overcome this in a simple manner (avoiding MC or complex parametric approaches)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first thought was to build an index of returns from those equities with a complete time series on a sector by sector basis. Then, we can use the index VAR as a proxy. There are 2 problems I have encountered with this:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Using an index means you are averaging returns, which mean you squash the distribution and dampen the extreme values. &lt;/li&gt;&#xA;&lt;li&gt;This approach assumes everything in the same sector moves together on average, and therefore doesn't contain any idiosyncratic risk. I cannot see how to add in this idiosyncratic risk with such a short time series &amp;amp; such short data. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I have seen EVT mentioned in places. This could possible be suitable for equities which have a moderate Time series length(?), but the problem still holds for equities whose series is too short.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="24040" LastActivityDate="2016-09-08T19:39:03.367" Title="Calculating HIstorical VaR with short time series" Tags="&lt;time-series&gt;&lt;risk&gt;&lt;statistics&gt;&lt;var&gt;&lt;risk-models&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30042" PostTypeId="1" CreationDate="2016-09-08T09:43:51.457" Score="1" ViewCount="615" Body="&lt;p&gt;Suppose that interest rate $r(t)$ follows some short-rate models, say Vasicek, so that$dr = a(b-r) dt + \sigma dZ$, with constants $a,b,\sigma$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is well known that the price of zero-coupon bond $P(r,t)$ at current time $t$ maturing at $T$ with face value 1 follows (for example, see McDonald's Derivatives Markets, 3rd ed, p.758):&#xA;$$\frac{\sigma^2}{2} \frac{\partial^2 P}{\partial r^2} + a(b-r) \frac{\partial P}{\partial r} + \frac{\partial P}{\partial t} - r P=0$$&#xA;with boundary condition $P(r,T) = 1$.&#xA;Note that we could write $P(r,t) = \mathbb{E}^\mathbb{Q} \Big[ e^{- \int_t^T r(u)  du} \big| F_t \Big]$ for all $t \leq T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Trying to generalize, for some smooth condition of $h(r,T)$ depending only on $r$ at $T$: If we define $Q(r,t) = \mathbb{E}^\mathbb{Q} \Big[ e^{- \int_t^T r(u)  du} h(r,T) \big| F_t \Big]$ for all $t \leq T$, does the following PDE&#xA;$$\frac{\sigma^2}{2} \frac{\partial^2 Q}{\partial r^2} + a(b-r) \frac{\partial Q}{\partial r} + \frac{\partial Q}{\partial t} - r Q=0$$&#xA;with boundary condition $Q(r,T) = h(r,T)$ hold?&lt;/p&gt;&#xA;" OwnerUserId="24314" LastEditorUserId="24314" LastEditDate="2016-09-08T13:16:37.457" LastActivityDate="2016-09-10T16:28:51.053" Title="PDE for Pricing Interest Rate Derivatives" Tags="&lt;stochastic-processes&gt;&lt;bond&gt;&lt;martingale&gt;&lt;differential-equations&gt;&lt;stochastic-discount&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30043" PostTypeId="1" CreationDate="2016-09-08T09:44:40.450" Score="1" ViewCount="1402" Body="&lt;p&gt;I'm trying to find a formula to calculate the YTM of inflation-linked bonds. I've tried using the conventional YTM formula for bonds and then just adjusting the coupon to the inflation adjusted coupon, but this doesn't seem to be giving an accurate result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could someone point me in the correct direction?&lt;/p&gt;&#xA;" OwnerUserId="20592" LastActivityDate="2016-09-08T10:55:53.403" Title="How to calculate the YTM of an inflation linked bond" Tags="&lt;fixed-income&gt;&lt;bond&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30044" PostTypeId="2" ParentId="30043" CreationDate="2016-09-08T10:55:53.403" Score="2" Body="&lt;p&gt;If it is the real-yield - which is the nominal yield minus inflation - that you are after then you just use the real coupon and price to calculate the yield the same way you would have done with the nominal coupon and price on a nominal bond &lt;a href=&quot;https://en.wikipedia.org/wiki/Inflation-indexed_bond&quot; rel=&quot;nofollow&quot;&gt;as it says in the wikipedia&lt;/a&gt;: &quot;in the case of inflation-indexed bonds such as TIPS, the bond yield is specified as a rate in excess of inflation, so the real yield can be easily calculated using a standard bond calculation formula&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if it is the projected nominal yield you are looking for, I guess you could add inflation quotes from inflation swaps to get some sort of market implicit nominal yield. Then again, for this you should just look at the ordinary nominal market. &lt;/p&gt;&#xA;" OwnerUserId="23886" LastActivityDate="2016-09-08T10:55:53.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30046" PostTypeId="2" ParentId="30037" CreationDate="2016-09-08T12:51:20.370" Score="2" Body="&lt;p&gt;I'm not sure exactly what you mean by the &quot;EUR equivalent yield&quot;, but I think that what you are asking is &quot;How do I calculate the effective cost of funding EUR cashflows at USD Libor?&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that's the case then, fundamentally, what you need are &lt;strong&gt;FX forward rates&lt;/strong&gt;. For a given forward date you can imagine funding EUR at USD Libor by switching some amount of EUR into USD at the spot FX rate, accruing it at USD Libor, and then switching it back into EUR at the forward date using the forward FX rate. You then find something like&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ P^\mathrm{EUR}_\mathrm{USD\ Libor\ 3m}(T) = P^\mathrm{USD}_\mathrm{USD\ Libor\ 3m}(T) \frac{fx(T)}{fx(0)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which defines the discount factors of your &quot;equivalent curve&quot; in terms of those of the native USD Libor 3m curve (take care to get the FX in the correct direction, depending on the convention for the relevant pair).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question then is, whence do you source FX forward rates? Well, there is of course an observable FX forward market, but they are typically only observable for the relatively short term. What about longer terms? This is where the cross-currency basis spreads come in: the value of a cross-currency basis swap depends on forward FX rates, so it follows that observed cross-currency basis spreads can be used to imply forward FX rates. Cross-currency basis swaps are typically quoted to much longer maturities than are seen in the FX forward market (as far out as 50Y+ in major currencies), and so these tend to be the best source of information on long-term FX forward expectations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ultimately then, the answer to your question is that you can use either or both FX forward rates and cross-currency basis spreads, since they both serve as a source for FX foward rates. Which you should prefer will depend on the relative liquidity of the respective products at each point in the term structure, and this depends on the particular currency pair you're dealing with. For EUR and USD, however, in my experience, the cross-currency basis swap market alone is deemed to allow the full FX forward term structure to be calibrated sufficiently well for the purpose of determining cross-currency funding costs.&lt;/p&gt;&#xA;" OwnerUserId="7533" LastEditorUserId="7533" LastEditDate="2016-09-08T14:35:03.930" LastActivityDate="2016-09-08T14:35:03.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30047" PostTypeId="1" AcceptedAnswerId="30052" CreationDate="2016-09-08T13:00:09.937" Score="0" ViewCount="57" Body="&lt;p&gt;Why are average interest rates often weighed by loan (and deposit) sizes?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the size and interest rate of a loan are function of each other, I expect the resulting statistic to be hard to interpret.&lt;/p&gt;&#xA;" OwnerUserId="24319" LastActivityDate="2016-09-08T18:58:43.140" Title="The weight of interest rates" Tags="&lt;interest-rates&gt;&lt;statistics&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30048" PostTypeId="2" ParentId="30029" CreationDate="2016-09-08T14:31:54.153" Score="0" Body="&lt;p&gt;I am not an expert on this topic, but I saw a recent article &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Parkinson (2102): z Test for the significance of the mean of a stable probability distribution  &lt;a href=&quot;http://tandfonline.com/doi/abs/10.1080/02664763.2012.740618&quot; rel=&quot;nofollow&quot;&gt;http://tandfonline.com/doi/abs/10.1080/02664763.2012.740618&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;that may be of interest to you.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2016-09-08T14:31:54.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30050" PostTypeId="1" AcceptedAnswerId="30051" CreationDate="2016-09-08T17:52:04.150" Score="7" ViewCount="11391" Body="&lt;p&gt;I'm a beginner looking at the USD-BTC price chart on gdax:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.gdax.com/trade/BTC-USD&quot; rel=&quot;noreferrer&quot;&gt;https://www.gdax.com/trade/BTC-USD&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It looks like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/4Pszm.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/4Pszm.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to work out what the top graph means. &lt;strong&gt;Can anyone tell me what each of the following things mean&lt;/strong&gt; (my guess in brackets)?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The grey bars (volume bought/sold)  &lt;/li&gt;&#xA;&lt;li&gt;Green hollow bars (sale prices range)  &lt;/li&gt;&#xA;&lt;li&gt;Orange filled bars (sale prices range)  &lt;/li&gt;&#xA;&lt;li&gt;Lines (trend lines of green/orange boxes with different averaging timeframes)&lt;/li&gt;&#xA;&lt;li&gt;The O,H,L,C,V (Open,High,Low,Close,Volume)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a reason that the orange boxes are filled and the green ones are empty?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What are the obvious search terms I should be using to get information on understanding these sorts of graphs?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="24327" LastEditorUserId="24327" LastEditDate="2016-09-08T18:00:24.253" LastActivityDate="2016-09-08T18:44:29.570" Title="Understanding the GDAX price chart" Tags="&lt;fx&gt;&lt;market&gt;&lt;trading-systems&gt;&lt;exchange&gt;&lt;graphs&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2016-09-08T20:35:36.497" ContentLicense="CC BY-SA 3.0" />
  <row Id="30051" PostTypeId="2" ParentId="30050" CreationDate="2016-09-08T18:33:12.603" Score="7" Body="&lt;p&gt;The top chart is called a 'candle stick chart' or 'OHLC candlestick' or 'OHLC bar chart' &lt;a href=&quot;http://multicharts.com/trading-charts&quot; rel=&quot;noreferrer&quot;&gt;http://multicharts.com/trading-charts&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When the price goes down during a time interval (from O to C) the box is filled in orange, when the price goes up it is green bordered with black inside. The exact colors are a matter of taste, as long as they are clearly different to the eye. The box has an up and a down spike giving the min L and the max price H during the interval. The box itself extends from O to C (or C to O) along the vertical dimension.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Volume is how many BTC were traded during each time interval (looks to me like &quot;time interval is 5 minutes, i.e. 12 an hour).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second chart (at bottom) with 'a valley' in green and orange is 'depth of book'. It shows how many BTC are (right side, orange colour) offered, and how may are bid (left side, green) at a certain price or better. The price is on the x axis. The bottom of the valley is where the market price is currently. This chart is a 'point in time' snapshot. (The OHLC chart on the other hand is historical).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more info on the cumulative depth of book chart see here bitcointalk.org/index.php?topic=147716.0 . It lets you see, for example, how many BTC you could sell instantly if you were willing to accept a rather bad (low) price.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-09-08T18:44:29.570" LastActivityDate="2016-09-08T18:44:29.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30052" PostTypeId="2" ParentId="30047" CreationDate="2016-09-08T18:58:43.140" Score="0" Body="&lt;p&gt;When a bank lends money at different rates for different purposes the weighted average interest rate measures how well the 'average dollar' is being utilized by the bank. (A very small amount lent at a very high rate for example does not impact overall bank profitability very much). The average is a kind of 'overview' statistic for the bank as a whole, but I agree with you that if you want to understand &lt;em&gt;WHY&lt;/em&gt; Bank A has a higher average than Bank B you would  have to look at more detail on the loans themselves, such as their size, how long they have been on the books (years ago interest rates were higher) etc. etc. &lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2016-09-08T18:58:43.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30053" PostTypeId="2" ParentId="30039" CreationDate="2016-09-08T19:39:03.367" Score="1" Body="&lt;p&gt;The &lt;em&gt;best approach&lt;/em&gt; is awfully subjective but by characterizing your data set with EVT (e.g. Generalized Pareto Distribution) you could extrapolate into the tail which will give you more risk levels than your data empirically allows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It appears you want to create more data points out of the ether but that would require MC (which you don't want to do). &lt;/p&gt;&#xA;" OwnerUserId="18159" LastActivityDate="2016-09-08T19:39:03.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30055" PostTypeId="1" AcceptedAnswerId="30060" CreationDate="2016-09-08T22:34:03.653" Score="0" ViewCount="124" Body="&lt;p&gt;I'm hoping somebody can help me with the following problem (I'm not a quant).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a SQL table which contains the historic prices for 3 securities, x,y and z. It has the date and the price.  I have to a write a program that, for each year, outputs the buy/sell transactions necessary to maximise the value of the portfolio.  The portfolio has an initial fund of £20000.  yes this a test, but it's not homework.  I don't know where to begin, I don't need help with  the coding but I do need some assistance with the algorithm/math?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="24328" LastEditorUserId="23886" LastEditDate="2016-09-09T14:52:11.237" LastActivityDate="2016-09-09T14:52:11.237" Title="portfolio optimisation based on historical prices" Tags="&lt;programming&gt;&lt;portfolio-optimization&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="0" ClosedDate="2016-09-09T16:05:30.157" ContentLicense="CC BY-SA 3.0" />
  <row Id="30056" PostTypeId="1" AcceptedAnswerId="30059" CreationDate="2016-09-09T03:30:28.560" Score="8" ViewCount="1724" Body="&lt;p&gt;I think some of you know the famous billionaire mathematician James Simons. Somewhat as Warren Buffet, this guy cracked the Wall Street with a mathematical model (essentially most statistic and a bit of probability). It could take a lot of time, but I'd like to understand by myself how he constructs his model or how to reproduce a similar model. It follows that none idea came up so far, and I wish someone would unblock me at this level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Questions :&lt;/strong&gt; Could anyone be able to give me a path, ideas (Markov models, ...) how could I obtain a starting idea? In other words, does anyone have the intuition of the mathematical theory he uses to this algorithm?&lt;/p&gt;&#xA;" OwnerUserId="24331" LastEditorUserId="24331" LastEditDate="2016-09-11T17:42:36.947" LastActivityDate="2016-09-11T17:42:36.947" Title="James Simons (Renaissance Technologies Corp.) and his model" Tags="&lt;history&gt;&lt;hidden-markov-model&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="3" ClosedDate="2016-09-09T16:06:00.253" ContentLicense="CC BY-SA 3.0" />
  <row Id="30057" PostTypeId="1" CreationDate="2016-09-09T05:29:47.663" Score="-1" ViewCount="2121" Body="&lt;p&gt;I'm currently trying to figure out how to use data from Bloomberg to create some analysis on a company's performance using Excel/R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I find the Forward 12m EPS Growth, its 1m Earning Revision and 3m Earning Revision?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question 1:&lt;/strong&gt; Is the &lt;strong&gt;Forward 12m EPS Growth&lt;/strong&gt; obtained directly using the field &lt;code&gt;BEST_EPS_YOY_GTH&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question 2:&lt;/strong&gt; How then do we find the &lt;strong&gt;1m Earning Revision&lt;/strong&gt; and &lt;strong&gt;3m Earning Revision&lt;/strong&gt;?&lt;/p&gt;&#xA;" OwnerUserId="6409" LastActivityDate="2017-04-07T21:36:19.803" Title="Forward 12m EPS Growth and its Earning Revision using Bloomberg" Tags="&lt;r&gt;&lt;bloomberg&gt;&lt;excel&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30059" PostTypeId="2" ParentId="30056" CreationDate="2016-09-09T07:56:24.623" Score="11" Body="&lt;p&gt;In 1983 he was using Hidden Markov Models. Now he employs 100+ PhDs, therefore I expect he will have 50+ strategies using 200+ predictors. And set up as a production line, from the teams importing and cleaning data, down to execution of trades. Every step fine tuned and optimized. There is nothing like 'the algorithm' anymore. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-09-09T07:56:24.623" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30060" PostTypeId="2" ParentId="30055" CreationDate="2016-09-09T08:47:41.040" Score="1" Body="&lt;p&gt;firstly you need to calculate logarithmic returns and then depends on the software you use. For instance &lt;code&gt;R&lt;/code&gt; has everything already coded. If you want to to it yourself (recommended if you say programming is not an issue), then I found &lt;a href=&quot;https://www.google.cz/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0ahUKEwjdifat8YHPAhWIVRQKHQkqDVQQFggdMAA&amp;amp;url=http%3A%2F%2Ffaculty.washington.edu%2Fezivot%2Fecon424%2FportfolioTheoryMatrix.pdf&amp;amp;usg=AFQjCNEWs_-yM5P0LgHffSIVos8kJstC6w&amp;amp;sig2=P8HwK9mV-7ZtlSYkgfVO3A&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; quite straight forward and shows the code in &lt;code&gt;R&lt;/code&gt; as well.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) get the returns &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) calculate covariance matrix &lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) optimise either to find a Global Minimum Variance portfolio, or minimum variance portfolio given a level of return. But then you are adding more uncertainty to the model as you don't really know what is the true expected return.    &lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) You will get your vector of weights and find returns of the portfolio. The weights are the transaction you need - if it is positive, you're buying, if negative you are selling the asset short. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you need the returns in $, then sum up the logarithmic returns and transform them back by taking the exponential of them and subtract 1; you get the cumulative return at the end of the period  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;5) Follow the link, it walks you through it quite nicely in detail.. If you need anything else, comment :)  &lt;/p&gt;&#xA;" OwnerUserId="22237" LastEditorUserId="22237" LastEditDate="2016-09-09T11:20:00.430" LastActivityDate="2016-09-09T11:20:00.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30061" PostTypeId="2" ParentId="29935" CreationDate="2016-09-09T09:07:30.190" Score="1" Body="&lt;p&gt;This is a &quot;cheapest-to-deliver&quot; option - in the absence of any restrictions, the rational investor would post whichever collateral class offers the best rate of return at each moment in time (of course, this could vary over the life of the trade).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, to price in the presence of this option, you need to model the optimal posting strategy. You mentioned one very simple approach which is to assume that current forward rates will be realised, and thence build a blended curve by taking the maximum forward rate amongst the deliverable set on each date over the life of the trade. However, by ignoring the rate dynamics, this systematically underestimates the expected return on collateral.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Better modelling of this option has been receiving quite a bit of research attention. For example, this recent paper offers a fairly practical approach to modelling it:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.risk.net/risk-magazine/technical-paper/2428223/collateral-option-valuation-made-easy&quot; rel=&quot;nofollow&quot;&gt;http://www.risk.net/risk-magazine/technical-paper/2428223/collateral-option-valuation-made-easy&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main difficulty is the absence of observable volatility and correlation indicators for the deliverable indices. The authors in this case use historical observation in lieu, which allows the model to be calibrated and the impact on pricing to be assessed. However, there still remains the problem of hedging those historically calibrated parameters.&lt;/p&gt;&#xA;" OwnerUserId="7533" LastEditorUserId="7533" LastEditDate="2016-09-09T09:17:12.807" LastActivityDate="2016-09-09T09:17:12.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30063" PostTypeId="2" ParentId="4440" CreationDate="2016-09-09T11:19:19.750" Score="0" Body="&lt;p&gt;Reading &lt;a href=&quot;https://www.eba.europa.eu/documents/10180/39865/EBA-BS-2011-165-%28CP-on-GL-IRC%29-FINAL.pdf&quot; rel=&quot;nofollow&quot;&gt;EBA:s draft guidelines on IRC from 2011&lt;/a&gt;, the following quote points at it beeing entirely in the credit risk domain: &quot;20.3 If a simulation, e.g. the asset value process, has not resulted in a changed rating, no change in value shall be assumed...&quot; No change in credit standing, no change in rating and no change in IRC, so IRC is fully credit related.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, in 20.4, regarding migration events, there is no word of incorporating changes in market prices of risk in the calculation, instead a preset rating-to-spread table should be used: &quot;The impact of a rating migration on market prices may be estimated using either currently observed market data (e.g. spreads); or an average of historical market data observed...&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I would humbly say that in the EBA draft of 2011 we have a &lt;em&gt;pure credit&lt;/em&gt; model, and &lt;em&gt;market&lt;/em&gt; prices are only in it as a misleading name for how rating changes are mapped on economic impact in the model.&lt;/p&gt;&#xA;" OwnerUserId="23886" LastActivityDate="2016-09-09T11:19:19.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30064" PostTypeId="2" ParentId="30055" CreationDate="2016-09-09T13:05:11.297" Score="0" Body="&lt;p&gt;If you don't want to write all the code yourself, you can you &lt;code&gt;R&lt;/code&gt;, package &lt;code&gt;PortfolioAnalytics&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It allows you to create portfolio (&lt;code&gt;portfolio.spec&lt;/code&gt;), and optimization constraints (&lt;code&gt;add.constraint&lt;/code&gt;) and set objectives (&lt;code&gt;add.objective&lt;/code&gt;) and optimize it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example code&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;portfolio &amp;lt;- portfolio.spec(assets=fund.names)&#xA;&#xA;portfolio &amp;lt;- add.constraint(portfolio , type=&quot;full_investment&quot;)&#xA;portfolio &amp;lt;- add.constraint(portfolio , type=&quot;long_only&quot;)&#xA;&#xA;portfolio &amp;lt;- add.objective(portfolio, type=&quot;risk&quot;, name=&quot;var&quot;)&#xA;&#xA;# monthly rebalancing, 2 year training, 2 year rolling:&#xA;&#xA;portfolio.optimized &amp;lt;- optimize.portfolio.rebalancing(returns, portfolio,&#xA;ptimize_method=&quot;quadprog&quot;,&#xA;rebalance_on=&quot;months&quot;,&#xA;training_period=24,&#xA;rolling_window=24)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The package is quite flexible, you can add group constraints, long/short/box constraints; add objectives for risk minimizing, mean maximizing, quadratic utility maximizing etc; supports &lt;code&gt;quadprog&lt;/code&gt; solver etc.&#xA;It also allows you to plugin your own covariance matrix (e.g. if you don't want to use &lt;code&gt;cov&lt;/code&gt; but your own like robust covariance matrix estimate).&#xA;And has support for parallel processing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Plenty of code samples in vignette:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://cran.r-project.org/web/packages/PortfolioAnalytics/PortfolioAnalytics.pdf&quot; rel=&quot;nofollow&quot;&gt;https://cran.r-project.org/web/packages/PortfolioAnalytics/PortfolioAnalytics.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18030" LastActivityDate="2016-09-09T13:05:11.297" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30065" PostTypeId="1" AcceptedAnswerId="30067" CreationDate="2016-09-09T17:33:41.783" Score="10" ViewCount="21793" Body="&lt;p&gt;What is the formula for the forward price of a bond (assuming there are coupons in the interim period, and that the deal is collateralised)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please also prove it with an arbitrage cashflow scenario analysis!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suppose it is like &lt;code&gt;fwd = spot - pv coupons) × (1+ repo × T )&lt;/code&gt;, I am not certain at what rate to pv the coupons.&lt;/p&gt;&#xA;" OwnerUserId="17348" LastEditorUserId="20795" LastEditDate="2019-09-08T08:01:04.747" LastActivityDate="2021-04-17T19:26:21.553" Title="Formula for forward price of bond" Tags="&lt;bond&gt;&lt;forward&gt;&lt;pricing-formulae&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="30066" PostTypeId="2" ParentId="30057" CreationDate="2016-09-09T18:22:10.187" Score="1" Body="&lt;p&gt;There is no direct way to estimate Forward 12m EPS Growth using a single bloomberg formula with overrides. &lt;code&gt;BEST_EPS_YOY_GTH&lt;/code&gt; does not allow BF overrides, only FY. Therefore you cannot keep 12m horizon constant. One solution would be to get &lt;code&gt;BEST_EPS&lt;/code&gt; with BF1 override and compare this number with current EPS. For historical analysis, retrieve historical EPS vector and compare it with &lt;code&gt;BEST_EPS&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With respect to &lt;code&gt;Earnings revisions&lt;/code&gt; you simply have to estimate the chg in  &lt;code&gt;BEST_EPS&lt;/code&gt; over any specified period (1mo,3mo etc.).&lt;/p&gt;&#xA;" OwnerDisplayName="user18489" LastActivityDate="2016-09-09T18:22:10.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30067" PostTypeId="2" ParentId="30065" CreationDate="2016-09-09T19:50:37.570" Score="23" Body="&lt;p&gt;Amazingly, there are several different methods for computing bond forward price – the underlying ideas are the same (forward price = spot price - carry), but the computational details differ a bit based on market convention.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's start with the basics. Assume between now ($t_0$) and the forward settlement date $t_2$, the bond makes a coupon payment at time $t_1$. Now consider the following series of trades:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Today, a trader buys a bond at a price of $P + AI_0$ (spot clean price + spot accrued interest).&lt;/li&gt;&#xA;&lt;li&gt;To fund the purchase, the trader enters into a $t_1$-year term repo agreement at a repo rate of $r$. More specifically, he/she sells the repo by borrowing $P + AI_0$ and delivering the bond as collateral.&lt;/li&gt;&#xA;&lt;li&gt;At time $t_1$ (coupon payment date), the repo balance is $(P + AI_0)(1 + rt_1)$ and the trader receives a coupon payment of $c / 2$ for being the owner of the bond.&lt;/li&gt;&#xA;&lt;li&gt;The trader re-enters into another repo agreement that spans from $t_1$ to $t_2$ on a principal of $(P + AI_0)(1 + rt_1) - c/2$. This new loan, combined with the coupon payment of $c/2$, allows the trader to retire the old repo loan without putting up any additional capital.&lt;/li&gt;&#xA;&lt;li&gt;Finally, at time $t_2$, the trader gets back the bond and repays the repo loan along with interest from $t_1$ to $t_2$:&#xA;$$ \left((P + AI_0)(1 + rt_1) - \frac{c}{2}\right) \bigl(1 + r(t_2-t_1)\bigr) . $$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;These trades are economically no different from buying the bond forward at time $t_2$. Therefore, the forward clean price for settlement at $t_2$ must be&#xA;$$ F(t_2) = (P + AI_0)(1 + rt_1)\bigl(1 + r(t_2-t_1)\bigr) - \frac{c}{2}\bigl(1 + r(t_2-t_1)\bigr) - AI_{t_2}. $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The method above is known as the &lt;strong&gt;Compounded Method&lt;/strong&gt;. In the US Treasury market (and most international bond markets), a small approximation is made. Recall for small $rt$, we have&#xA;$$ (1 + rt_1)(1+r(t_2-t_1))\approx 1 + r(t_1+t_2-t_1) = 1 + rt_2, $$&#xA;we therefore have the &lt;strong&gt;Proceeds Method&lt;/strong&gt;:&#xA;$$ F(t_2) = (P + AI_0)(1 + rt_2) - \frac{c}{2}\bigl(1 + r(t_2-t_1)\bigr) - AI_{t_2}. $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Proceeds Method is for all intents and purposes the standard/default way of pricing bond forwards. There's also the &quot;Simple&quot; and &quot;Scientific&quot; methods, but these are rarely used.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2016-09-09T19:56:27.350" LastActivityDate="2016-09-09T19:56:27.350" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="30068" PostTypeId="1" CreationDate="2016-09-09T19:54:37.210" Score="0" ViewCount="52" Body="&lt;p&gt;I know how to simulate correlated returns, but I do not know how to simulate Co-Integrated assets. I would like to simulate a co-integrated time series where the Beta Co-Efficient is not constant, but rather has some degree of drift. An equation or model for doing so would be very helpful, thanks very much Quant SE!&lt;/p&gt;&#xA;" OwnerUserId="18578" LastActivityDate="2016-09-09T20:05:55.630" Title="Simulating Co-Integrated Assets" Tags="&lt;monte-carlo&gt;&lt;correlation&gt;&lt;econometrics&gt;&lt;cointegration&gt;&lt;random-walk&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30069" PostTypeId="2" ParentId="30068" CreationDate="2016-09-09T20:05:55.630" Score="1" Body="&lt;p&gt;I think I just figured it out, and kinda feel dumb. It appears It could be solved by multiplying one time series by the beta co-efficient, and having a random walk model the drift of the beta co-efficient, thus a stationary time series could be contrived by the two co-integrated assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not for sure however, so if I am wrong please correct me.&lt;/p&gt;&#xA;" OwnerUserId="18578" LastActivityDate="2016-09-09T20:05:55.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30071" PostTypeId="1" AcceptedAnswerId="30083" CreationDate="2016-09-09T21:53:04.553" Score="1" ViewCount="254" Body="&lt;p&gt;It is generally assumed that market prices follow random walks, implying market efficiency. However, one could find that some combinations of the &quot;random walks&quot; are cointegrated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this contradict market efficiency? How should it be interpreted?  &lt;/p&gt;&#xA;" OwnerUserId="18670" LastEditorUserId="19645" LastEditDate="2016-09-10T19:48:03.597" LastActivityDate="2016-09-10T19:48:03.597" Title="Does cointegration contradict the market efficiency?" Tags="&lt;cointegration&gt;&lt;market-efficiency&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30073" PostTypeId="1" CreationDate="2016-09-10T03:00:00.283" Score="1" ViewCount="168" Body="&lt;p&gt;Where can I find the Credit default swap index that JPMorganChase bank puts out?  I am able to find some indices for Europe but none for the US.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks&lt;/p&gt;&#xA;" OwnerUserId="6889" LastActivityDate="2017-04-08T19:16:08.147" Title="Where can I find the Credit default swap index that Chase bank puts out?" Tags="&lt;cds&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30074" PostTypeId="2" ParentId="3783" CreationDate="2016-09-10T05:30:38.850" Score="10" Body="&lt;p&gt;I recently stumbled upon this question after needing to do this to do some real-time microstructure analysis and have taken a look at the various possible implementations. Here are some of the pros/cons of each implementation (I'll use C/C++ terminology):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Array:&lt;/strong&gt;&#xA;You have an array of structs ordered from top of book (index 0) to worst (index N). You have to pre-allocate the array to be big enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Insertion is O(LOG N)&lt;/em&gt;: Perform binary search to find the insertion point, then performing a memcpy to shift the tail of the array. Finally, you overwrite the item at the insertion point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Lookup is O(1)&lt;/em&gt;: Your indices directly correspond to levels of market depth. Just hop to where you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Deletions are O(LOG N)&lt;/em&gt;: You seek to the order you want to delete, then perform a memcpy shifting everything back by 1 index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Updates are worst case a deletion + insertion&lt;/em&gt;. Best case, you check if the updated order changes ordering at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pros:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Extremely cache-friendly.&lt;/li&gt;&#xA;&lt;li&gt;Easy to optimize for the compiler&lt;/li&gt;&#xA;&lt;li&gt;Not a lot of re-ordering&lt;/li&gt;&#xA;&lt;li&gt;Fastest lookups&lt;/li&gt;&#xA;&lt;li&gt;Copy operations are usually vectorized (typically if you use std::copy instead of memcpy)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Cons:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Limited vectorization (SSE/AVX2) opportunities&lt;/li&gt;&#xA;&lt;li&gt;lots of copy operations&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Singly-linked List&lt;/strong&gt;: Same concept as an array (head in linked list is top of book, tail is bottom of book).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Insertion is O(N)&lt;/em&gt;: You have to seek through the list, update your new order's &quot;next pointer&quot; to the previous order's &quot;next pointer&quot;, update the previous order's &quot;next pointer&quot; to point to your new quote, and update the head/tail/length of the list if applicable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Lookup is O(N)&lt;/em&gt;: Top of book is trivial O(1) since it's the head of the list. Otherwise you'll need to seek through the list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Deletion is O(N)&lt;/em&gt;: You have to seek through the list to find the target spot. Then swap two pointers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Updates are a deletion + insertion in the worst case&lt;/em&gt;. Best case is O(1) assuming you know the right index (I'll get into this deeper in this response)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few optimizations give it acceptable performance:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Pre-allocate an array of linked list node structs with a quote struct as a member that correspond to the max depth of your book. Use these pointers in your linked list. Since the memory will be contiguous the indirection cost of using pointers will be lessened since you won't get that many cache misses&lt;/li&gt;&#xA;&lt;li&gt;Maintain 25%, 50%, and 75% market depth pointers in addition to head and tail. This significantly reduces the &quot;N&quot; in O(N) for insertion, deletion, and update operations.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Pros:&#xA; - No repeated copying once you seek to the right place&#xA; - Updates/inserts/lookups very fast if most operations are near head of list&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cons:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Lookup of deeper levels incurs high cost O(N)&lt;/li&gt;&#xA;&lt;li&gt;Bad cache performance if you're not careful&lt;/li&gt;&#xA;&lt;li&gt;Dynamic memory allocations if you don't pre-allocate an arena&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Ultimately, I found that the array version has the best average performance &lt;strong&gt;if you're ok with just price/qty priority&lt;/strong&gt;. If you need the precision of price/qty/time priority the arrays just get far too large.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're OK with price/qty priority:&#xA;We can use the property that quantities tend to be very similar for securities to limit the number of copy operations:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Create an array 4x the size of the expected possible price range for the day (you'll obviously need to re-allocate your array if something wild happens). Place the price level corresponding to the expected open in the middle of the array. Whenever you get a new order, the desired index is close to the number of cents difference from this price and the order's price. You can then look forward/backwards to see if the price/qty level exists. If it doesn't, then you'll need to shift the array via a copy. But if it does, you're all set. This &quot;centered array&quot; approach means that after a few minutes of quotes, you'll have the vast majority of your price/qty levels defined. This method only works if you're ok with just price/qty priority. If you require price/qty/time priority then you should probably go with the linked list.&lt;/p&gt;&#xA;" OwnerUserId="24343" LastActivityDate="2016-09-10T05:30:38.850" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30075" PostTypeId="1" AcceptedAnswerId="30081" CreationDate="2016-09-10T08:55:07.967" Score="1" ViewCount="521" Body="&lt;p&gt;I am reading &lt;a href=&quot;http://engineering.nyu.edu/files/amerput7.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Alternative Characterizations&#xA;of American Put Options&lt;/a&gt; by Carr et al. It is stated there that:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Consider an American put option on the stock with strike price $K$ and maturity date $T$. Let $P_t$ denote the value of the American put at time $t \in [0,T]$. For each time $t \in [0,T]$, there exists a critical&#xA;  stock price, $B_t$ , below which the American put should be exercised early, i.e.,&#xA;  $$if S_t \leq B_t, then  P_t =max[0,K-S_t]\tag{2}$$&#xA;  $$if S_t &amp;gt; B_t, then  P_t &amp;gt;max[0,K-S_t]\tag{3}$$&#xA;  The exercise boundary is the time path of critical stock prices, $B_t$ ,$t \in [0,T]$. This boundary is independent of the current stock price $S_0$ and is a smooth, nondecreasing function of time t terminating in the strike price, i.e. $B_T = K$. The put value is also a function, denoted $P(S,t)$, mapping its domain $D ≡ (S,t) ∈ [0,\infty)×[0,T]$ into the nonnegative real line. The exercise boundary,$B_t$ ,$t \in [0,T]$, divides this domain $D$ into a stopping region $S ≡ [0,B_t ]×[0,T]$ and a continuation region $C ≡ (B_t ,∞)×[0,T]$&#xA;  (see Figure 1). &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However, there is no Figure 1 in that article. I wonder what is the figure. In my opinion, the figure is like below&#xA;&lt;a href=&quot;https://i.stack.imgur.com/cUUol.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/cUUol.png&quot; alt=&quot;Domain Figure&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it correct? If it is not, then what is the correct figure?&#xA;Thanks&lt;/p&gt;&#xA;" OwnerUserId="19902" LastActivityDate="2016-09-11T09:59:23.593" Title="Figure of Stopping and Continuation Region" Tags="&lt;american-options&gt;&lt;continuous-time&gt;&lt;stopping-time&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30076" PostTypeId="2" ParentId="30071" CreationDate="2016-09-10T09:03:06.513" Score="1" Body="&lt;p&gt;Cointegration does not contradict market efficiency. On the contrary, lack of cointegration where it is due would contradict market efficiency. For example, if the same stock had noncointegrated prices across different exchanges (e.g. NYSE vs. NASDAQ), only one of them could reflect all available, relevant information, and the others would not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is this a relevant argument? From &lt;a href=&quot;http://www.investopedia.com/terms/m/marketefficiency.asp&quot; rel=&quot;nofollow&quot;&gt;Investopedia&lt;/a&gt;: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Market efficiency refers to the degree to which stock prices and other securities prices reflect all available, relevant information.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="19645" LastActivityDate="2016-09-10T09:03:06.513" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30077" PostTypeId="1" CreationDate="2016-09-10T09:31:52.403" Score="0" ViewCount="299" Body="&lt;p&gt;I'm actually working on carbon markets.&#xA;Anyone knows where I could find EUA (european union allowances) futures prices intraday (15 minutes) from 2008 until now &lt;strong&gt;for free&lt;/strong&gt;?&#xA;Thank you for your help&lt;/p&gt;&#xA;" OwnerUserId="24345" LastEditorUserId="24345" LastEditDate="2016-09-13T12:40:04.927" LastActivityDate="2017-02-10T16:41:01.927" Title="Historical data on EUA Futures (Intraday, 15 minutes) from 2008" Tags="&lt;historical-data&gt;&lt;intraday&gt;&lt;european&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30078" PostTypeId="2" ParentId="30077" CreationDate="2016-09-10T11:59:59.737" Score="1" Body="&lt;p&gt;Have a look at &lt;a href=&quot;https://www.tickdata.com&quot; rel=&quot;nofollow&quot;&gt;Tick Data&lt;/a&gt;. They sell trade (and optionally quote) data for a lot of different instruments including the EUA futures. Their pricing is 125 USD for a one year tick history and you need to order for at least 250 USD at a time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ordered some Eurex DAX future tick history from them. The order process was flawless and their pricing was significantly cheaper than other providers I could find (incl. Eurex directly).&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2016-09-10T11:59:59.737" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30079" PostTypeId="1" CreationDate="2016-09-10T12:00:48.180" Score="0" ViewCount="324" Body="&lt;p&gt;DTCC appears to provide historical o/n repo data for US Treasuries but does not do so for term repo data. If I want to analyze the term repo curve, where would I be able to find historical term repo data?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More specifically, I'm wondering if I would be able to find term repo rate data for specific OTR US Treasuries in any data provider?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="13375" LastEditorUserId="13375" LastEditDate="2016-09-10T12:13:01.157" LastActivityDate="2017-08-06T15:44:22.280" Title="Where can I find historical daily term repo data?" Tags="&lt;fixed-income&gt;&lt;bloomberg&gt;&lt;treasuries&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30080" PostTypeId="2" ParentId="30079" CreationDate="2016-09-10T12:25:51.970" Score="1" Body="&lt;p&gt;Have a look at &lt;a href=&quot;http://www.markit.com/product/pricing-data-securities-finance&quot; rel=&quot;nofollow&quot;&gt;Markit Securities Finance&lt;/a&gt;. If you are an academic, then your institution might have subscribed to it via &lt;a href=&quot;https://wrds-web.wharton.upenn.edu&quot; rel=&quot;nofollow&quot;&gt;WRDS&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2016-09-10T12:25:51.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30081" PostTypeId="2" ParentId="30075" CreationDate="2016-09-10T13:01:58.157" Score="6" Body="&lt;p&gt;The exercise boundary $B_t$ for a &lt;em&gt;finite maturity&lt;/em&gt; American put option is not a constant function of time as in your plot. As mentioned in the excerpt, $B_T = K$ at maturity. But for $t &amp;lt; T$, we have $B_t &amp;lt; K$ as you would never pre-maturely exercise to receive a zero payoff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is a plot of the early exercise boundary that I once produced for a lecture. Note that I used a slightly different notation $E$ is the exercise price (the red line). The optimal exercise boundary is $S_t^*$ (the blue curve). The continuation region is in white and the stopping region in grey.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/lkDhz.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/lkDhz.png&quot; alt=&quot;Early exercise boundary for American put options.&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2016-09-11T09:59:23.593" LastActivityDate="2016-09-11T09:59:23.593" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30082" PostTypeId="2" ParentId="30042" CreationDate="2016-09-10T16:28:51.053" Score="3" Body="&lt;p&gt;Note that&#xA;\begin{align*}&#xA;M(r_t, t) &amp;amp;\equiv Q(r_t, t) e^{-\int_0^t r_u du} \\&#xA;&amp;amp;=E\left(e^{-\int_0^T r_u du} h(r_T, T) \mid \mathscr{F}_t \right)&#xA;\end{align*}&#xA;is a martingale. Moreover, &#xA;\begin{align*}&#xA;dM &amp;amp;= \frac{\partial M}{\partial t}dt + \frac{\partial M}{\partial r} dr_t + \frac{1}{2}\frac{\partial^2 M}{\partial r^2}d\langle r, r\rangle_t\\&#xA;&amp;amp;=\left[\frac{\partial Q}{\partial t} e^{-\int_0^t r_u du} - r_t Q(r_t, t) e^{-\int_0^t r_u du}\right]dt+e^{-\int_0^t r_u du}\frac{\partial Q}{\partial r}dr+ \frac{\sigma^2}{2}\frac{\partial^2 Q}{\partial r^2}e^{-\int_0^t r_u du}dt\\&#xA;&amp;amp;=e^{-\int_0^t r_u du}\left[\left(\frac{\sigma^2}{2}\frac{\partial^2 Q}{\partial r^2} +a(b-r_t)\frac{\partial Q}{\partial r} -r_t Q(r_t, t) + \frac{\partial Q}{\partial t}  \right)dt + \sigma \frac{\partial Q}{\partial r} dZ \right].&#xA;\end{align*}&#xA;Therefore,&#xA;\begin{align*}&#xA;\frac{\sigma^2}{2}\frac{\partial^2 Q}{\partial r^2} +a(b-r_t)\frac{\partial Q}{\partial r} -r_t Q(r_t, t) + \frac{\partial Q}{\partial t}=0.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-09-10T16:28:51.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30083" PostTypeId="2" ParentId="30071" CreationDate="2016-09-10T16:28:56.443" Score="1" Body="&lt;p&gt;There's no contradiction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuitively speaking the Market Efficiency Hypothesis has more to do with &quot;predictability&quot;. In all of its three senses, it's more or less a translation of &quot;you cannot make positive return consistently&quot;, in other words, as long as you're in the market, the next realization of return is no more than random draw, i.e. returns are non-predictable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now that's what we would call things happening along the time line. But if we fixed the time point, and go into cross-sectional data, then there's a good chance to find relationship that is both statistically significant as well as give you good explanation power(in terms of fitting data). The easiest one you can think of is CAPM:&#xA;$$r_i - r_f = \beta_i(r_m - r_f)$$ &#xA;well, this might be leap of faith..But this is nothing more than a cointegration relationship..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So that does this say then? &lt;strong&gt;It means that you cannot predict what happens tomorrow(EMH), but you whatever it happens tomorrow, there could possibly exists a relationship across assets.(Cointegration)&lt;/strong&gt; Remember the randomness are for all assets, but there could some underlying factors which drive all the returns, which then gives you a factor model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So as an example, you buy and sell the same stock for one share, I don't know what the stock price is going to be tomorrow, but I sure know that my payoff is even. And that's it.&lt;/p&gt;&#xA;" OwnerUserId="6016" LastActivityDate="2016-09-10T16:28:56.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30084" PostTypeId="2" ParentId="30073" CreationDate="2016-09-10T16:29:31.383" Score="1" Body="&lt;p&gt;That might be Markit CDX.NA.HY or CDX.NA.IG index, you can check them on &lt;a href=&quot;http://www.markit.com/markit.jsp?jsppage=indices.jsp&quot; rel=&quot;nofollow&quot;&gt;Markit website&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15454" LastActivityDate="2016-09-10T16:29:31.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30085" PostTypeId="1" AcceptedAnswerId="30087" CreationDate="2016-09-10T17:28:40.937" Score="1" ViewCount="237" Body="&lt;p&gt;I have a basic fundamental question on pricing an American option in the &lt;a href=&quot;https://en.wikipedia.org/wiki/Black%E2%80%93Scholes_model&quot; rel=&quot;nofollow&quot;&gt;Black-Scholes&lt;/a&gt; (BS) framework: I seem to confuse two different approaches to price any early exercise,&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Write down a linear complimentary problem and use SOR to solve it;&lt;/li&gt;&#xA;&lt;li&gt;Solve the Black-Scholes &lt;a href=&quot;https://en.wikipedia.org/wiki/Partial_differential_equation&quot; rel=&quot;nofollow&quot;&gt;PDE&lt;/a&gt;, but at every time step choose the maximum between the intrinsic value and the value from BS solution numerically.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Are these approaches equivalent or what's the difference between the two?&lt;/p&gt;&#xA;" OwnerUserId="22823" LastEditorUserId="16786" LastEditDate="2016-09-10T19:57:52.127" LastActivityDate="2016-09-10T19:57:52.127" Title="Pricing an American derivative with finite differences" Tags="&lt;american-options&gt;&lt;finite-difference-method&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30086" PostTypeId="2" ParentId="24846" CreationDate="2016-09-10T17:44:50.247" Score="1" Body="&lt;p&gt;I think it was Gnetting in 2011 who first proved that ES is not elicitable, which then threw some doubt as to whether it was backtestable. Carlo Acerbi pretty much put the matter to bed a few years ago in a number of papers, in which he explained that it does not matter for backtesting purposes whether or not ES is elicitable. &lt;a href=&quot;https://www.msci.com/resources/research/articles/2014/Research_Insight_Backtesting_Expected_Shortfall_December_2014.pdf&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; is a link to his 2014 paper in which he gives three methods for backtesting ES.&lt;/p&gt;&#xA;" OwnerUserId="22326" LastActivityDate="2016-09-10T17:44:50.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30087" PostTypeId="2" ParentId="30085" CreationDate="2016-09-10T17:52:04.040" Score="2" Body="&lt;p&gt;When you use a fully explicit finite difference scheme, you can simply apply the backward induction step and afterwards ensure that the option price at each node is at least equal to the intrinsic value. This is possible as any value $V_{i + 1, j}$ at time $\tau_{i + 1}$ only depends on the values $V_{i, j}$ at time $\tau_i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you use a scheme that is at least partially implicit, then the values $V_{i + 1, j}$ at $\tau_{i + 1}$ additionally also depend on the other values at the same time step. In this case you use e.g. projected successive over-relaxation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This issue is explicitly discussed in Chapter 78.9 of Wilmott (2006), pp. 1244ff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;References:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wilmott, Paul (2006) &quot;Paul Wilmott on Quantiative Finance&quot;, John Wiley &amp;amp; Sons&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2016-09-10T17:52:04.040" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="30089" PostTypeId="1" CreationDate="2016-09-10T21:27:51.500" Score="2" ViewCount="744" Body="&lt;p&gt;Here is a question I found in a book I am not able to finish. Your help will be much appreciated! I also included where I have been so far.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q: Team A plays team B in a series of 7 games, whoever wins 4 games first is the winner. You want to bet 100 that your team wins in which case you will receive 200 or 0 otherwise. However you can bet only on individual games (so game by game sequentially). You can bet X the day before the match and receive 2X if win otherwise 0 if lose.&#xA; - Q1: How do you achieve the desired payout?&#xA; - Q2: What amount do you bet on the 1st game?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For me this is like replicating a binary option paying 100 in case of success or losing 100 in case of default. The aim is to price this option (find this X). It seems to be a binomial tree of 7 states. We consider the first part of the tree (X, X_up, X_down).&#xA;Probability of going up is a just the binomial probability of winning at least 3 games out of of 6 (we are already at the the state 1). So Proba_up = 1 - (1/2^6)*(1+15+6) = 21/32&#xA;Thus we can get the value of X_up = 100*21/32 - 100*(1-21/32) = 40.625&#xA;We then have Proba_down = 1 - Proba_up = 11/32 and then X_down = 100*11/32 - 100*(21/32) = -40.625&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And now I am stuck: I cannot figure out the proba I need to use to discount these values. Many thanks for your help.&lt;/p&gt;&#xA;" OwnerUserId="20179" LastActivityDate="2016-09-10T21:27:51.500" Title="interview question : replication strategy of a betting game" Tags="&lt;options&gt;&lt;probability&gt;&lt;replication&gt;&lt;hedge&gt;" AnswerCount="0" CommentCount="10" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30090" PostTypeId="2" ParentId="29957" CreationDate="2016-09-10T23:48:52.637" Score="4" Body="&lt;p&gt;Just an update on my playlist, It has 33 videos now, roughly 3x more vids. I have included some more general economics and machine learning and programming vids, which have relevant applications in Q finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=jXFNpDcYOxM&amp;amp;list=PLqMiStH7exaXmQqV7y-tg68f2ZYZK3Yur&quot; rel=&quot;nofollow&quot;&gt;https://www.youtube.com/watch?v=jXFNpDcYOxM&amp;amp;list=PLqMiStH7exaXmQqV7y-tg68f2ZYZK3Yur&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18578" LastActivityDate="2016-09-10T23:48:52.637" CommentCount="0" CommunityOwnedDate="2016-09-10T23:48:52.637" ContentLicense="CC BY-SA 3.0" />
  <row Id="30092" PostTypeId="2" ParentId="29576" CreationDate="2016-09-11T11:02:40.540" Score="2" Body="&lt;p&gt;This is a Yahoo data issue - you should contact them regarding their symbols and availability of data.&lt;br&gt;&#xA;It might just be that the index is not covered by them or they are restricted from providing historical data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note that you have referenced ETFs (XLV, XLI, etc.) that trade on NYSE Arca as being sector-based subsets of the S&amp;amp;P 500.  These ETFs are based upon the Select Sector indexes.  The &quot;Select&quot; indexes are a little different from the actual S&amp;amp;P 500 sector indexes in that they have more rules associated with index composition (to minimize churn) and also include other GICS classifications.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, XLK (Technology Select Sector SPDR ETF) is not a GICS sector - it comprises both Information Technology and Telecommunications companies.  From time-to-time it has a different set of components comapred to the S&amp;amp;P 500 Information Technology Sector Index and the S&amp;amp;P 500 Telecommunications Sector Index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reference:&#xA;&lt;a href=&quot;https://us.spindices.com/documents/methodologies/methodology-sp-us-indices.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://us.spindices.com/documents/methodologies/methodology-sp-us-indices.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13859" LastEditorUserId="26169" LastEditDate="2017-01-19T14:02:20.290" LastActivityDate="2017-01-19T14:02:20.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30093" PostTypeId="2" ParentId="24873" CreationDate="2016-09-11T15:04:44.110" Score="1" Body="&lt;p&gt;The Carr et al. (1992) paper you are referring to assumes that the underlying asset follows a geometric Brownian motion (GBM).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Within a wider setting including the GBM case, it was shown by El Karoui et al. (1998) as well as Hobson (1998) that the valuation function of an American plain vanilla option is a convex function of the asset price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;El Karoui, Nicole, Monique Jeanblanc-Picque and Steven E. Shreve (1998) “Robustness of the Black and Scholes Formula”, Mathematical Finance, Vol. 8, No. 2, pp. 93-126&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hobson, David G. (1998) “Volatility MIsspecification, Option Pricing and Superreplication via Coupling”, Annals of Applied Probability, Vol. 8, No. 1, pp. 193-205&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2016-09-11T15:04:44.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30094" PostTypeId="1" CreationDate="2016-09-11T20:38:37.783" Score="1" ViewCount="2879" Body="&lt;p&gt;thank you in advance anyways! I do have a question that drives me mad.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do i calculate the Swap DV01 for a Interest Rate Swap?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think for a bond i multiply the discounted cashflows times the point in time, and divide it through the bond price to end up with duration and thus i can end up with dollar value of 1 bp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But for a european IRS i do not know.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think there exists the cash formula, but this suggests a flat interest curve which is not applicable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;KR and thanks everybody!&lt;/p&gt;&#xA;" OwnerUserId="24362" LastActivityDate="2016-12-11T11:53:59.703" Title="Interest Rate Swap DV01" Tags="&lt;swaps&gt;&lt;interest-rate-swap&gt;&lt;duration&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30095" PostTypeId="1" CreationDate="2016-09-11T21:22:56.987" Score="4" ViewCount="192" Body="&lt;p&gt;In Taiwan there is a FFT of 0.3% on equity sell, and coincidentally HFT seemed to be non-existent in Taiwan market. HFT features high volumes of trades, does the tax make HFT infeasible? &lt;/p&gt;&#xA;" OwnerUserId="24361" LastActivityDate="2018-12-29T10:47:12.827" Title="Does financial transaction tax (FFT) debilitate high frequency trading?" Tags="&lt;high-frequency&gt;&lt;transaction-costs&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30096" PostTypeId="1" CreationDate="2016-09-11T21:29:37.960" Score="2" ViewCount="479" Body="&lt;p&gt;I'm trying to calculate 30/360 (US) date differences, but I'm confused by the differences between calculating dates in one order vs the other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I calculated the difference between date1=2/29/2016 and date2=3/1/16 in Excel (using Days360(date1,date2)), I get one day difference.  When I reverse the dates and calculate then I get -2 days difference instead of -1.  Why the discrepancy?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought the numbers would be consistent either direction. I read the page here:&#xA;&lt;a href=&quot;https://en.wikipedia.org/wiki/Day_count_convention&quot; rel=&quot;nofollow&quot;&gt;Day_count_convention&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which talks about changing day values, but it doesn't go into detail on how to calculate differences in dates or why calculations are different in reverse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another confusing point is that the convention tells you to change the day to 30 if you're end of month in February.  However, you can't have Feb 30 with any date software.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the proper way of calculating the difference between two dates using 30/360 US?&lt;/p&gt;&#xA;" OwnerUserId="24363" LastActivityDate="2016-09-13T14:41:02.787" Title="discrepancy in calculating 30/360 day count" Tags="&lt;fixed-income&gt;&lt;daycounting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30097" PostTypeId="1" CreationDate="2016-09-11T21:49:59.630" Score="3" ViewCount="609" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/4N7P7.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/4N7P7.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why there different implied volatility for different strike prices?, Can plz someone explain to me? I am pretty new to options. Thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="24364" LastEditorUserId="2183" LastEditDate="2017-06-26T09:35:55.187" LastActivityDate="2017-06-26T09:35:55.187" Title="What does implied volatility means for different call and put strike prices?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;implied-volatility&gt;&lt;price&gt;&lt;implied&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30098" PostTypeId="1" CreationDate="2016-09-11T22:37:52.063" Score="0" ViewCount="148" Body="&lt;p&gt;Assume I am solving numerically Black Scholes PDE&#xA;$$u_t+0.5\sigma^2s^2u_{ss}+rsu_s-ru=0$$&#xA;and I decided to have boundary condition on the right boundary as $u_{ss}=0$. One way is to write the discrete approximation for $u_{ss}$, for example, in the case of Crank-Nicolson:&#xA;$$0.5\frac{u^{n+1}_{i-1}-2u^{n+1}_{i}+u^{n+1}_{i+1}}{\delta x^2}+0.5\frac{u^{n}_{i-1}-2u^{n}_{i}+u^{n}_{i+1}}{\delta x^2}=0$$&#xA;and add this to the discretization system .&#xA;Another way to to put this back into equation itself and get&#xA;$$u_t+rsu_s-ru=0$$&#xA; on that boundary. I might be lucky to write the closed formula on that boundary so no discretization is needed.&#xA;In the second approach I basically assume the equation is solved on that boundary, along with the fact the second derivative is zero. In the first approach, I only assume the second derivative is zero. They don't look equivalent to me. So what approach is correct and why?&lt;/p&gt;&#xA;" OwnerUserId="22823" LastActivityDate="2016-09-11T22:37:52.063" Title="zero curvature boundary condition" Tags="&lt;black-scholes&gt;&lt;finite-difference-method&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30099" PostTypeId="1" CreationDate="2016-09-11T22:42:50.197" Score="4" ViewCount="393" Body="&lt;p&gt;I was reading Tavella Randall book and their explanation why binomial trees are a particular example of finite differences. I started having additional questions. So, they way they do that is saying that if there is a certain relation between $\Delta t$ and $\Delta x$, then the explicit finite difference scheme can be viewed as a binomial model. But how about stability? Is it always when I eliminate the second coefficient in my finite differences I will have a stable scheme? What is the stability then for the binomial trees, is there such a concept applied here as well?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, is there anything can be said about implicit method application here? Can binomial trees be stable and unstable?&lt;/p&gt;&#xA;" OwnerUserId="22823" LastActivityDate="2016-09-19T19:21:42.440" Title="binomial trees and finite differences" Tags="&lt;binomial-tree&gt;&lt;finite-difference-method&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30100" PostTypeId="1" CreationDate="2016-09-12T01:20:55.673" Score="1" ViewCount="206" Body="&lt;p&gt;I have an expectation given as:&#xA;$\mathbb{E}\left(S_{T}\mathbb{1}_{S_{T}\geq K} \right)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $K$ is just an arbitrary number (i.e. the strike price, but that's unimportant) and $S$ can be modelled by the equation $S_{t} = \exp((r-\frac{1}{2})t + \sigma W_{t})$. Also, the expectation is under the $\mathbb{P}$-measure, not the $\mathbb{Q}$-measure, so effectively this expectation is $\mathbb{E}^{\mathbb{P}}\left(S_{T}\mathbb{1}_{S_{T}\geq K} \right)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, when trying to evaluate $\mathbb{E}\left(\mathbb{1}_{S_{T}\geq K} \right)$ under the $\mathbb{Q}$-measure, then solving this expectation is fairly easy, since you can integrate the SDE and take the $\log$ of $S$ to get $\log(S_{T}) = \log(S_{0}) + (r-\frac{1}{2})T + \sigma\sqrt{T}N(0,1)$ (since $W_{t}\approx \sqrt{T}N(0,1)$) and thus we have for $\mathbb{E}\left(\mathbb{1}_{S_{T}\geq K} \right) = \mathbb{P}({S_{T}\geq K})$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\log(S_{T}) = (r-\frac{1}{2})T + \sigma\sqrt{T}N(0,1) &amp;gt; \log(K)$ and thus rearranging this equation gives&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$N(0,1) &amp;gt; \frac{\log(K/S_{0}) - (r-\frac{1}{2}\sigma^{2})T}{\sigma\sqrt{T}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and through a little bit more rearrangement (i.e. knowing that $N(0,1)&amp;lt;-x = 1 - N(x)$ we get finally $d_{2} = \frac{(r-\frac{1}{2}\sigma^{2})T + \log(S_{0}/K)}{\sigma\sqrt{T}}$ and thus $\mathbb{E}\left(\mathbb{1}_{S_{T}\geq K} \right) = N(d_{2})$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem I have now however is that I'm a bit unsure how to find  $\mathbb{E}^{\mathbb{P}}\left(S_{T}\mathbb{1}_{S_{T}\geq K} \right)$ (i.e. under the $\mathbb{P}$-measure) since I've never done any measure theory before, so if someone could help me out I'd really appreciate it. Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="20543" LastActivityDate="2016-09-12T15:59:13.877" Title="How do I find this Expectation?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;finance&gt;&lt;probability&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30101" PostTypeId="1" CreationDate="2016-09-12T07:42:54.600" Score="1" ViewCount="32" Body="&lt;p&gt;in long term options on equities, what is the greek used for for security lending rate, and what formula do you use?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;would it often move contrary to moves in risk free (ois) and so in practice is it best to hedge seperately from general ois level... &lt;/p&gt;&#xA;" OwnerUserId="17348" LastEditorUserId="17348" LastEditDate="2016-09-15T17:10:00.560" LastActivityDate="2016-09-15T17:10:00.560" Title="in long term options on equities, what is the greek used for security lending rate, and what formula do you use?" Tags="&lt;greeks&gt;&lt;pricing-formulae&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30102" PostTypeId="2" ParentId="30100" CreationDate="2016-09-12T08:12:40.960" Score="1" Body="&lt;p&gt;In the context of deriving the European plain vanilla price in the Black and Scholes (1973) model, you also evaluate the expectation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathbb{E}^{\mathbb{Q}} \left[ S_T \mathrm{1} \left\{ S_T &amp;gt; K \right\} \right]&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;under the $\mathbb{Q}$ (risk-neutral) measure. Remember that the value of a contract is its discounted expected value under $\mathbb{Q}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think what you might confuse here is that the above expectation is often solved by changing to an auxiliary measure under which the stock price is the numeraire. This measure is often denoted $\mathbb{S}$ but is different from the physical measure $\mathbb{P}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You do not need to change the measure however to solve the expectation, though it makes things much easier once you feel comfortable with the corresponding machinery. Alternatively you can just solve the corresponding integral. Let $\phi(x)$ be the standard normal density function. Then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\mathbb{E}^{\mathbb{Q}} \left[ S_T \mathrm{1} \left\{ S_T &amp;gt; K \right\} \right] &amp;amp; = &amp;amp; \int_{-d_-}^\infty S_0 \exp \left\{ \left( r - \frac{1}{2} \sigma^2 \right) T - \sigma \sqrt{T} x \right\} \phi(x) \mathrm{d}x.&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here we defined $d_-$ through&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;S_T &amp;gt; K &amp;amp; \qquad \Leftrightarrow \qquad &amp;amp; S_0 \exp \left\{ \left( r - \frac{1}{2} \sigma^2 \right) T - \sigma \sqrt{T} x \right\} &amp;gt; K\\&#xA;&amp;amp; &amp;amp; x &amp;gt; \frac{\ln \left( K / S_0 \right) - \left( r - \frac{1}{2} \sigma^2 \right) T}{\sigma \sqrt{T}} =: -d_-.&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Substituting for $\phi(x)$ and collecting terms in $x$ in the integral yields&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\ldots &amp;amp; = &amp;amp; \int_{-d_-}^\infty S_0 \exp \left\{ \left( r - \frac{1}{2} \sigma^2 \right) T \right\} \frac{1}{\sqrt{2 \pi}} \exp \left\{ -\frac{x^2}{2} + \sigma \sqrt{T} x \right\} \mathrm{d}x\\&#xA;&amp;amp; = &amp;amp; \int_{-d_-}^\infty S_0 \exp \left\{ \left( r - \frac{1}{2} \sigma^2 \right) T \right\} \frac{1}{\sqrt{2 \pi}} \exp \left\{ -\frac{x^2 - 2 \sigma \sqrt{T} x \pm \sigma^2 T}{2} \right\} \mathrm{d}x\\&#xA;&amp;amp; = &amp;amp; S_0 e^{r T} \int_{-d_-}^\infty \frac{1}{\sqrt{2 \pi}} \exp \left\{ -\frac{(x - \sigma \sqrt{T})^2}{2} \right\} \mathrm{d}x.&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here we completed the square in the second and third steps. Apply a change of variables by setting $y = x - \sigma \sqrt{T}$ and you get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\ldots &amp;amp; = &amp;amp; S_0 e^{r T} \int_{- \left( d_- + \sigma \sqrt{T} \right)}^\infty \phi(y) \mathrm{d}y\\&#xA;&amp;amp; = &amp;amp; S_0 e^{r T} \mathcal{N} \left( d_+ \right),&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where we defined $d_+ = d_- + \sigma \sqrt{T}$.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2016-09-12T15:59:13.877" LastActivityDate="2016-09-12T15:59:13.877" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30103" PostTypeId="1" AcceptedAnswerId="30108" CreationDate="2016-09-12T10:24:09.677" Score="1" ViewCount="85" Body="&lt;p&gt;I have equity options in my portfolio that can expire during a VaR calculation (with Monte Carlo). For example the time to maturity of my option is T days but I simulate for T+n days (n &gt; 0). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the appropriate way of handling these kind of situations? &lt;/p&gt;&#xA;" OwnerUserId="24369" LastActivityDate="2016-09-13T13:38:26.317" Title="Handling option expiration during Monte Carlo simulation" Tags="&lt;options&gt;&lt;monte-carlo&gt;&lt;var&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30104" PostTypeId="2" ParentId="30094" CreationDate="2016-09-12T11:09:23.183" Score="1" Body="&lt;p&gt;you can calc it as the difference in npv you get when you bump the yield curve and calc your npv , vs your original npv&lt;/p&gt;&#xA;" OwnerUserId="17348" LastActivityDate="2016-09-12T11:09:23.183" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30106" PostTypeId="1" AcceptedAnswerId="30107" CreationDate="2016-09-12T14:15:18.527" Score="0" ViewCount="285" Body="&lt;p&gt;I know how to value a standard zero coupon bond but how would you value a zero coupon bond that is callable and you assume it will be called?  With the formula:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Value = F / (1 + r)^t &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Would the face value change or just the time to maturity change to the time until the call date?&lt;/p&gt;&#xA;" OwnerUserId="24371" LastActivityDate="2016-09-12T15:11:12.123" Title="How to value a called zero coupon bond?" Tags="&lt;fixed-income&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30107" PostTypeId="2" ParentId="30106" CreationDate="2016-09-12T14:25:45.267" Score="0" Body="&lt;p&gt;It would not make much sense (from issuer point of view) for the bond to be called at full face value.  It would be a windfall for the investor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is usually a set schedule of Call Prices and if the ZCB is called in a particular year the redemption amount will be taken from a lookup in this table of values. This RV and the hypothesized call date is what you would use in your formula to value the bond. Often the table is constructed to produce predetermined yield(s) in the event of call. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Details differ depending on the issue&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some Examples&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://definedterm.com/zero_coupon_callable_bond&quot; rel=&quot;nofollow&quot;&gt;https://definedterm.com/zero_coupon_callable_bond&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.reuters.com/article/asia-bonds-idUSL4N0XY39W20150508&quot; rel=&quot;nofollow&quot;&gt;http://www.reuters.com/article/asia-bonds-idUSL4N0XY39W20150508&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-09-12T15:11:12.123" LastActivityDate="2016-09-12T15:11:12.123" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30108" PostTypeId="2" ParentId="30103" CreationDate="2016-09-12T16:20:58.703" Score="2" Body="&lt;p&gt;If you are willing to spend the calculations, you can use a Brownian bridge to work out the probability distribution for the stock price at option expiration time $T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say you have an option on $S$ expiring at $T$ and you have simulated the stock price $S_{T+n}$ for your VAR horizon, starting from today's price $S_0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then (if you are willing to model the stock prices as constant-parameter exponential brownian motions) you can assume that $\log(S_T)$ is gaussian distributed,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\log(S_T) \sim N\left( \mu, v \right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $\mu$ the time weighted average of $\log(S_{T+n})$ and $\log(S_0)$, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;v =  \frac{(T-0)((T+n) - T)}{(T+n)-0} \sigma^2.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From here, you simulate a draw from that gaussian distribution, exponentiate to get $S_T$, and work out option expiration value from $S_T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, to handle this option in your algorithm, you have a 2-stage simulation where in each iteration you you simulate a terminal stock value, then you simulate an &quot;in-between&quot; stock value to get option expiration prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that if you have $N$ options on the same stock, you should use an $N$ stage simulation.  Also note that it is possible to include covariance of stock $S_1$ and $S_2$ in bridge calculations, but that at that point the bridge complexity is so high that you might as well just simulate full paths instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is common in risk applications where options are only a small part of the portfolio  to assume $v=0$ and just accept the bridge mean as $S_T$.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2016-09-13T13:38:26.317" LastActivityDate="2016-09-13T13:38:26.317" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30109" PostTypeId="2" ParentId="30097" CreationDate="2016-09-12T16:26:07.953" Score="2" Body="&lt;p&gt;Implied volatility will depend on the price the option is trading at. If more people buy a certain strike than another, or the given option is more difficult to hedge then the implied volatility will not be the same due to a different price. A simple example would be a stock trading at 10000 USD, and a call option expiring in 30 days with a strike of 12000 USD. Lets also say there is a 20% expected volatility at that time. While there is is a very small chance of the strike being hit, no one in there right mind would expect the strike to be hit and thus no one would buy it. So the fair value would be about 0.1 USD, but because pretty much no one would buy this option it is likely to trade at a lower price maybe even 0 USD and thus implied vol woul be lower or even 0%. The opposite is possible as well, the price of a specific contract could rise due to more investors buying that specific strike than others. As some people mentioned volatility skew is something you may want to read more about.&lt;/p&gt;&#xA;" OwnerUserId="18578" LastActivityDate="2016-09-12T16:26:07.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30110" PostTypeId="1" AcceptedAnswerId="53562" CreationDate="2016-09-12T20:02:23.110" Score="3" ViewCount="319" Body="&lt;p&gt;&lt;em&gt;I am new to the world of investing, so please excuse the clumsy wording of the question... there is probably a better term for what I am looking for or maybe this is even a known/classic problem. If so, please kindly point me in the right direction ;-)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h3&gt;Motivation&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Investment strategies are compared against &quot;the market&quot;, which is usually some weighted index of some / all securities in a given universe. However, the choice of market portfolio is somewhat arbitrary when it can be defined by the investor. A comparison of the alpha / performance of two investors' strategies could be quite difficult when one investor benchmarks her strategy against market portfolio &lt;em&gt;A&lt;/em&gt;, while another benchmarks it against market portfolio &lt;em&gt;B&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thinking about this problem I ended up with the following idea: Why not compare every strategy against the hypothetical optimal return that could be achieved within the relevant universe and time frame &lt;em&gt;if one had a crystal ball&lt;/em&gt;, i.e. by magically buying / selling the combination of securities that would lead to maximum return?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For each set of investment constraints, there is (usually) only one such optimal strategy and thus the &lt;em&gt;&quot;Crystal Ball Return&quot;&lt;/em&gt; would be the ideal reference for objective comparisons of investment strategies.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;The Problem&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;For the sake of simplicity let's assume we have a universe that consists of &lt;code&gt;n&lt;/code&gt; stocks (with end-of-day prices) and are looking at an investment time frame of &lt;code&gt;d&lt;/code&gt; trading days. We're investing a pre-defined amount of money &lt;code&gt;m&lt;/code&gt; (enough to buy at least one of each stock) and there is small but non-negligible fee &lt;code&gt;f&lt;/code&gt; for every transaction. We can change the portfolio (buy/sell stocks) once a day, but we don't have to. All returns are compounded.&#xA;&lt;strong&gt;UPDATE&lt;/strong&gt;: To keep it simple (and the returns bounded), short selling is not allowed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How does one efficiently calculate the sequence of buy/sell actions that leads to the maximum possible return?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To me this smells like dynamic programming, however, maybe I am missing something. The problem formulation seems so commonplace that I'm hoping there is a seminal paper / solution you can point me to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you provide a solution, please try to give some indication of its time / space complexity. Thank you.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt; On first thoughts, fees seem to be a necessary constraint, since without them the optimal strategy would simply be to move all the money on a daily basis into the stock that's growing the most.&lt;/p&gt;&#xA;" OwnerUserId="24099" LastEditorUserId="24099" LastEditDate="2016-09-16T11:36:31.553" LastActivityDate="2020-04-24T06:39:14.747" Title="How to (efficiently) calculate the maximum possible return of a perfect &quot;crystal ball&quot; investment strategy?" Tags="&lt;programming&gt;&lt;optimization&gt;&lt;algorithm&gt;&lt;investment&gt;&lt;dynamic&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30111" PostTypeId="1" CreationDate="2016-09-12T21:01:48.950" Score="-1" ViewCount="851" Body="&lt;p&gt;I have a trading strategy based on the cointegration of X and Y where beta derived from the regression is 0.7. My initial capital to invest is 1000.&#xA;&lt;br&gt;&#xA;&lt;br&gt;&#xA;My understanding that the quantities of X and Y to trade are set in t=0 as&#xA;&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;buy signal (spread below its mean)-&amp;gt;    buying   shares X  and selling   beta  shares Y&#xA;sell signal (spread above its mean) -&amp;gt;  selling   shares X  and buying    beta  shares Y &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;br&gt;&#xA;&lt;code&gt;I know the Prices for X=100 and Y=80 at t=0&lt;/code&gt;. &#xA;&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The signal is generated just by looking at spread in relation to its mean. My confusion comes at scaling when it needs to be converted into share quantities, the portfolio value and returns need to be calculated. &#xA;&lt;br&gt;&#xA;&lt;br&gt;&#xA;For example:&lt;br&gt;&#xA;initial spread is $X - \beta Y = 100 - 0.7 * 80 = 44$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should this be looked at as buying/selling a structured portfolio with the price 44? How should it be seized then? Initial capital / the portfolio price?&#xA;or accounting should be done separately for short and long position and then aggregated?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Going forward the prices of X,Y  will change (spread change), how the shares quantities,  Market Value and returns should be calculated then? I presume the relation in quantity between A and B will stay constant (determined by beta) but the shares quantities will be changing.&#xA;&lt;br&gt;&#xA;Could somebody demonstrate how this should be calculated on this example? &lt;/p&gt;&#xA;" OwnerUserId="18670" LastActivityDate="2017-10-28T18:48:46.230" Title="pair trading cointegration - calculating shares quantities traded, portfolio value and returns" Tags="&lt;quant-trading-strategies&gt;&lt;cointegration&gt;&lt;pairs-trading&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30113" PostTypeId="1" AcceptedAnswerId="30396" CreationDate="2016-09-13T00:12:43.620" Score="0" ViewCount="76" Body="&lt;p&gt;I was working on historical data looking for anomalous patterns that we would not expect to occur at random. I'd like to create a scheme to analyze data and markets to test for statistical significance and consistency over time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question :&lt;/strong&gt; Are there some tools we could use to evaluate the nonrandomness of a database? What do we use usually to say that something is completely random or not (statistically)? Figure we work with change in some value over time.&lt;/p&gt;&#xA;" OwnerUserId="24331" LastEditorUserId="24331" LastEditDate="2016-10-02T01:16:19.787" LastActivityDate="2016-10-02T02:46:40.147" Title="Tools to measure the randomness of database" Tags="&lt;statistics&gt;&lt;random-variables&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30114" PostTypeId="1" CreationDate="2016-09-13T05:43:41.827" Score="1" ViewCount="241" Body="&lt;p&gt;This question relates to credit portfolio analysis.&#xA;I was asked by my teacher the following question :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why would a bank use MC simulation in the implementation of the covariance model (a bottom-up model), rather than use the analytical approach?  State 2 reasons.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far I have come up with that the co-variance model requires an estimation of loss correlation and Monte Carlo simulation can be used to generate an infinite number of scenarios of Unexpected losses from historical observations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know what the second reason for the implementation. &lt;/p&gt;&#xA;" OwnerUserId="24376" LastActivityDate="2016-09-13T05:43:41.827" Title="Monte Carlo simulation implementation" Tags="&lt;monte-carlo&gt;&lt;credit-risk&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30115" PostTypeId="2" ParentId="29942" CreationDate="2016-09-13T06:31:10.107" Score="0" Body="&lt;p&gt;you can download from yahoo finance&lt;/p&gt;&#xA;" OwnerUserId="17348" LastActivityDate="2016-09-13T06:31:10.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30116" PostTypeId="2" ParentId="29914" CreationDate="2016-09-13T06:35:14.100" Score="0" Body="&lt;p&gt;in fx you have such smiles. the premium on the wings is due to aversion of traders to large moves in the underlying.  traders believe the probability of large moves is higher than what is implied through the atm volatility.&lt;/p&gt;&#xA;" OwnerUserId="17348" LastActivityDate="2016-09-13T06:35:14.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30117" PostTypeId="1" CreationDate="2016-09-13T08:19:47.443" Score="1" ViewCount="57" Body="&lt;p&gt;Is it possible to &lt;em&gt;a priori&lt;/em&gt; select an acceptable values of type I and II errors in backtesting (f.e. in case of the unconditional coverage test)? Type I error is directly connected to the significance level, so manipulating it can lead to the desired outcome. What is more, when type II error has more serious consequences than type I error, a higher significance level should be selected. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to quantify this problem? So as to choose a given significance level and at the same time know the probability of commiting those two types of errors?&lt;/p&gt;&#xA;" OwnerUserId="24370" LastActivityDate="2016-09-13T08:19:47.443" Title="A priori selection of acceptable backtesting errors (type I and II)" Tags="&lt;backtesting&gt;&lt;probability&gt;&lt;var&gt;&lt;testing&gt;&lt;error&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30119" PostTypeId="2" ParentId="29914" CreationDate="2016-09-13T11:15:13.327" Score="2" Body="&lt;p&gt;The issue is that volatility is not constant and is not independent of the market level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the market remains near current values until maturity it will almost by definition affect near-the money options the most. Such options can therefore be correctly priced by assuming (well-known BS assumption) that volatility is constant and remains at currently observed level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Conversely for puts struck well below current market level to come into play, it must be that the market plunges substantially between now and maturity. Experience shows that such a sharp drop will be accompanied by a rise in volatility (so called leverage effect discovered by F. Black in late 1970's). The Black Scholes formula is strictly speaking not applicable in this case, but we can get the right answer by plugging into it an assumed volatility considerably higher than the current, to reflect the expected increase in actual volatility along such a path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When these B.S. volatilities are plotted against strike we see the familiar smile curve.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2016-09-13T11:15:13.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30121" PostTypeId="2" ParentId="30096" CreationDate="2016-09-13T14:41:02.787" Score="4" Body="&lt;p&gt;I think your discrepancy is a problem in Excel:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://support.office.com/en-us/article/DAYS360-function-b9a509fd-49ef-407e-94df-0cbda5718c2a&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://support.office.com/en-us/article/DAYS360-function-b9a509fd-49ef-407e-94df-0cbda5718c2a&lt;/a&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;=DAYS360(29/02/2016,01/03/2016,0) = 1 (suitable for &lt;strong&gt;30/360 US&lt;/strong&gt;)&lt;/p&gt;&#xA;&lt;p&gt;=DAYS360(29/02/2016,01/03/2016,1) = 2&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;And reverse calculated the different is 2, because Excel count both days as whole days:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;=DAYS360(01/03/2016,29/02/2016,0) = 2 (suitable for &lt;strong&gt;30/360 US&lt;/strong&gt;)&lt;/p&gt;&#xA;&lt;p&gt;=DAYS360(01/03/2016,29/02/2016,1) = 2&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;If you want to avoid this try Yearfrac&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.excelfunctions.net/Excel-Yearfrac-Function.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.excelfunctions.net/Excel-Yearfrac-Function.html&lt;/a&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;=YEARFRAC(01/03/2016,29/02/2016,0)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;is the same as&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;=YEARFRAC(01/03/2016,29/02/2016,0)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Day count basis&lt;/p&gt;&#xA;&lt;p&gt;0 or omitted = US (NASD) 30/360&lt;/p&gt;&#xA;&lt;p&gt;1 = Actual/actual&lt;/p&gt;&#xA;&lt;p&gt;2 = Actual/360&lt;/p&gt;&#xA;&lt;p&gt;3 = Actual/365&lt;/p&gt;&#xA;&lt;p&gt;4 = European 30/360&lt;/p&gt;&#xA;" OwnerUserId="24382" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-09-13T14:41:02.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30123" PostTypeId="1" CreationDate="2016-09-13T17:38:12.593" Score="-1" ViewCount="859" Body="&lt;p&gt;Is it possible to extract the volume of Corporate bonds in Bloomberg with BDP, BDH or BDS function ? Example : 958254AC8 Corp; 98389BAM2 Corp; 94974BFP0 Corp. Doesn't seem like it's possible, even if we can see some trades in the TDH menu.&lt;/p&gt;&#xA;" OwnerUserId="24339" LastActivityDate="2017-02-13T18:01:53.943" Title="Extract Corporate Bond volume" Tags="&lt;fixed-income&gt;&lt;bloomberg&gt;&lt;excel&gt;&lt;volume&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30128" PostTypeId="1" CreationDate="2016-09-13T21:19:04.800" Score="1" ViewCount="1343" Body="&lt;p&gt;Good evening everyone,&#xA;I would like to ask a question about Monte Carlo and PDE Pricing. &#xA;For an American option, which one should we use, Monte Carlo method or PDE method?&#xA;The same question for an Asian option such as an Asian call?&#xA;As far as I know, PDE method have a downside which is the curse of dimensionality. However, I wonder whether this should be the main reason why Monte Carlo method is the favorite one?&#xA;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="17050" LastActivityDate="2019-09-05T15:50:23.230" Title="Monte Carlo method vs PDE in option pricing" Tags="&lt;option-pricing&gt;&lt;monte-carlo&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30129" PostTypeId="2" ParentId="30016" CreationDate="2016-09-13T22:56:41.163" Score="2" Body="&lt;p&gt;Your computation of $\Delta$ is correct. However, your computation of the cash amount is wrong. You choose the cash amount $\beta$ that you need to initially lend or borrow such that in the up state, the following holds&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;P_u = \Delta S_u e^{\delta h} + \beta e^{r h}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\beta &amp;amp; = &amp;amp; \left( P_u - \Delta S_u e^{\delta h} \right) e^{-r h}\\&#xA;&amp;amp; = &amp;amp; 0.4345506 \cdot 60.41285 \cdot e^{-0.04}\\&#xA;&amp;amp; = &amp;amp; 25.223067.&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;P = \Delta S + \beta = 6.537391&#xA;\end{equation}&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2016-09-16T07:38:35.053" LastActivityDate="2016-09-16T07:38:35.053" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="30132" PostTypeId="2" ParentId="30128" CreationDate="2016-09-14T08:36:20.410" Score="0" Body="&lt;p&gt;There are many factors to consider. But mainly, in my opinion, you may choose the method depending on the complexity of the option and the resources you have.&#xA;PDE method is usually used to solve problem whose complexity level is similar to problems you may solve using trees, and that using other approaches is not suitable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the other hand, using Monte Carlo allows you to consider any property you may think when creating an option, as long as you can model it.   &lt;/p&gt;&#xA;" OwnerUserId="12089" LastActivityDate="2016-09-14T08:36:20.410" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30133" PostTypeId="1" AcceptedAnswerId="30163" CreationDate="2016-09-14T09:05:32.233" Score="2" ViewCount="118" Body="&lt;p&gt;I am solving some interviewing questions regarding gas storage optimization. I am given a gas storage facility with volume, rate of injection and withdrawal, as well as a current forward curve of gas price for the next 12 months. Obviously I should buy forward contracts for the months where prices are lowest, to max out my capacities, and sell forward contracts for the months where prices are highest. This is easy. Then the question becomes: the next day, the forward curve moved, but the basic ordering is unchanged (i.e., the cheap months are still cheap, etc..) , how do I adjust my positions of the forward contracts (long and short) in order to optimize my profit? Since I already maxed out all my capacities, any adjustments cannot change my gas flow. By no-arbitrage, I cannot generate profit by trading these contracts. Therefore I think there is no way to make changes to my contract positions to make more profit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I missing something here? The question sounds like there is some adjustment to be made, otherwise it becomes a trivial question. &lt;/p&gt;&#xA;" OwnerUserId="20158" LastActivityDate="2016-09-15T22:37:47.513" Title="optimize gas storage schedule based on forward prices" Tags="&lt;forward&gt;&lt;commodities&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30134" PostTypeId="1" CreationDate="2016-09-14T09:12:53.390" Score="1" ViewCount="1993" Body="&lt;p&gt;I'm using the &lt;em&gt;default&lt;/em&gt; RSI calculation in the TTR package as follows: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;result = RSI(data,14).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function also allows the user to specify the averaging method:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;result = RSI(data,14,&quot;SMA&quot;), &#xA;result = RSI(data,14, &quot;EMA&quot;) etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I cannot work out what averaging method is being used in the &lt;em&gt;default&lt;/em&gt; version. I have compared the results from all the different averaging methods (SMA, EMA) and none of them match the default. Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="24399" LastActivityDate="2017-11-09T22:56:42.377" Title="R RSI Calculation (TTR package)" Tags="&lt;r&gt;&lt;indicator&gt;&lt;moving-average&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30136" PostTypeId="2" ParentId="30134" CreationDate="2016-09-14T09:31:24.140" Score="1" Body="&lt;p&gt;The answer is that the default uses the Wilder EMA, which does act slightly different from a standard EMA.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i.e. Default = RSI(data,14,&quot;EMA&quot;,wilder = TRUE)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more information on the Wilder Moving Average - &lt;a href=&quot;https://www.incrediblecharts.com/indicators/wilder_moving_average.php&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.incrediblecharts.com/indicators/wilder_moving_average.php&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="24401" LastEditorUserId="30359" LastEditDate="2017-11-09T19:26:02.033" LastActivityDate="2017-11-09T19:26:02.033" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30137" PostTypeId="2" ParentId="30097" CreationDate="2016-09-14T09:44:25.080" Score="1" Body="&lt;p&gt;Every line in the market in your example defines a different option (with a strike, maturity and call/put flag). Everyone of this function has a different price given by the market. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What we call &lt;em&gt;implied volatility&lt;/em&gt; is just the number you have to input as $\sigma$ in the Black Scholes equation to get the price which is traded in the market.&lt;/p&gt;&#xA;" OwnerUserId="6356" LastActivityDate="2016-09-14T09:44:25.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30138" PostTypeId="1" AcceptedAnswerId="30161" CreationDate="2016-09-14T14:51:01.383" Score="3" ViewCount="488" Body="&lt;p&gt;I am trying to determine the variance of the payout of a straddle. For puts and calls individually:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Var[P] = E[P^2] - E[P]^2&#xA;Var[C] = E[C^2] - E[C]^2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where:&#xA;$$&#xA;E[P] \text = e^{-r T}\int _0{}^k\frac{(k-S) }{\sqrt{2 \pi } b S} e^{-\frac{(\log (S)-a)^2}{2 b^2}}dS&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;E[C] \text = e^{-r T}\int _k{}^{\infty}\frac{(S-k) }{\sqrt{2 \pi } b S} e^{-\frac{(\log (S)-a)^2}{2 b^2}}dS&#xA;$$&#xA;$$&#xA;E[P^2] \text = e^{-2r T}\int _0{}^k\frac{(k-S)^2 }{\sqrt{2 \pi } b S} e^{-\frac{(\log (S)-a)^2}{2 b^2}}dS&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;E[C^2] \text = e^{-2r T}\int _k{}^{\infty}\frac{(S-k)^2}{\sqrt{2 \pi } b S} e^{-\frac{(\log (S)-a)^2}{2 b^2}}dS&#xA;$$&#xA;Where:&#xA;$$&#xA;a=T \left(r-\frac{\sigma ^2}{2}\right)+\log \left(S_0\right)&#xA;$$&#xA;and&#xA;$$&#xA;b=\sigma  \sqrt{T}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These results become:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;E[P] = k \Phi \left(-d_2\right) e^{-r T}-S_0 \Phi \left(-d_1\right)&#xA;$$&#xA;$$&#xA;E[C] = S_0 \Phi \left(d_1\right)-k \Phi \left(d_2\right) e^{-r T}&#xA;$$&#xA;$$&#xA;E[P^2] = k^2 \Phi \left(-d_2\right) e^{-2 r T}-2 k S_0 \Phi \left(-d_1\right) e^{-r T}+S_0^2 \Phi \left(d_2-2 d_1\right) e^{\sigma ^2 T}&#xA;$$&#xA;$$&#xA;E[C^2] = k^2 \Phi \left(d_2\right) e^{-2 r T}-2 k S_0 \Phi \left(d_1\right) e^{-r T}+S_0^2 \Phi \left(2 d_1-d_2\right) e^{\sigma ^2 T}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that &#xA;$$&#xA;d_1=\frac{-\log (k)+T \left(r-\frac{\sigma ^2}{2}\right)+\log \left(S_0\right)+\sigma ^2 T}{\sigma  \sqrt{T}}&#xA;$$&#xA;and&#xA;$$&#xA;d_2=d_1-\sigma  \sqrt{T}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;S0 = initial price&#xA;S = price&#xA;k = strike&#xA;r = interest rate&#xA;T = time to expiration&#xA;sigma = implied volatility&#xA;Phi = standard normal variable&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;These results are also shown in this paper: &lt;a href=&quot;https://arxiv.org/pdf/1204.3452.pdf&quot; rel=&quot;nofollow&quot;&gt;https://arxiv.org/pdf/1204.3452.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question: how to combine Var[P] and Var[C] to get Var[straddle]?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since C and P are negatively correlated(right?), can we use this?&#xA;$$&#xA;Var[straddle] = Var[P] + Var[C] - 2\sqrt{Var[P] Var[C] }&#xA;$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems alright, I'm not sure. If we instead start with the payoff for the straddle as a piecewise function:&#xA;$$&#xA;payoff_{straddle} = \begin{array}{cc}&#xA; \{ &amp;amp; &#xA;\begin{array}{cc}&#xA; k-S &amp;amp; 0&amp;lt;S&amp;lt;k \\&#xA; S-k &amp;amp; S\geq k \\&#xA;\end{array}&#xA; \\&#xA;\end{array}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then:&#xA;$$&#xA;   E[straddle] \text = e^{-r T}\int _0{}^{\infty}\frac{payoff_{straddle} }{\sqrt{2 \pi } b S} e^{-\frac{(\log (S)-a)^2}{2 b^2}}dS&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, after separating out the different pieces in the piecewise function, this becomes&#xA;$$&#xA;E[straddle] \text = e^{-r T}(\int _0{}^k\frac{(k-S) }{\sqrt{2 \pi } b S} e^{-\frac{(\log (S)-a)^2}{2 b^2}}dS&#xA;+\int _k{}^{\infty}\frac{(S-k) }{\sqrt{2 \pi } b S} e^{-\frac{(\log (S)-a)^2}{2 b^2}}dS)&#xA;$$&#xA;which is simply&#xA;$$&#xA;E[straddle] = E[C] + E[P]&#xA;$$&#xA;and, similarly&#xA;$$&#xA;E[straddle^2] =E[C^2] + E[P^2]&#xA;$$&#xA;Var[straddle] would then be:&#xA;$$&#xA;Var[straddle] = E[straddle^2] - E[straddle]^2&#xA;          = E[C^2] + E[P^2] - E[P]^2 - E[C]^2 - 2E[C]E[P]&#xA;$$&#xA;$$&#xA;Var[straddle] = Var[C] + Var[P] - 2 E[C]E[P]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second approach seems more robust to me, since we are beginning with payoff for the position and building from there. Perhaps I am missing something though.Thoughts on correct method?&lt;/p&gt;&#xA;" OwnerUserId="18144" LastActivityDate="2016-09-16T11:22:52.420" Title="Variance of a straddle (Black Scholes)" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;covariance&gt;&lt;variance&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30139" PostTypeId="1" AcceptedAnswerId="30140" CreationDate="2016-09-14T14:55:20.933" Score="17" ViewCount="13483" Body="&lt;p&gt;I've come across the term &lt;em&gt;regime switch in volatilities&lt;/em&gt; when reading about the modelling of interest rates but could not find a definition for a &lt;em&gt;regime switch&lt;/em&gt; and what a &lt;em&gt;regime&lt;/em&gt; is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can somebody give an intuitive definition of a &lt;em&gt;regime&lt;/em&gt; and a &lt;em&gt;regime switch&lt;/em&gt; and provide examples?&lt;/p&gt;&#xA;" OwnerUserId="18221" LastActivityDate="2018-12-08T16:08:23.117" Title="What is a regime switch?" Tags="&lt;volatility&gt;&lt;interest-rates&gt;&lt;implied-volatility&gt;&lt;modelling&gt;&lt;market-regimes&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="30140" PostTypeId="2" ParentId="30139" CreationDate="2016-09-14T15:05:50.190" Score="9" Body="&lt;p&gt;The idea of regime switching in volatility is rooted in the observation that volatility is usually fairly consistent and &quot;mild&quot;, and occasionally very high, say during a market crash. The concept goes further, though. Not only does the volatility level differ markedly in different regimes, but the behavior of volatility does as well (degree of mean reversion, shape of smile, term structure skew, etc). Many models use different regimes to allow the tuning of parameters under different regimes, then switching between regimes, to more accurately model observed behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For an exploration for how market behavior can vary under different regimes: &lt;a href=&quot;http://www.emanuelderman.com/writing/entry/regimes-of-volatility-risk-april-1999&quot; rel=&quot;noreferrer&quot;&gt;http://www.emanuelderman.com/writing/entry/regimes-of-volatility-risk-april-1999&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18144" LastActivityDate="2016-09-14T15:05:50.190" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30141" PostTypeId="2" ParentId="30139" CreationDate="2016-09-14T15:36:59.500" Score="1" Body="&lt;p&gt;For example if you think the volatility of short term rates is 0.1 during economic exapansions and 0.15 during recessions, then that would be a very simple regime switch model. The parameters of the model (in this case just the vol) change from time to time. Specifically it 'switches' at certain times from one value to another. (And that is different from a model where vol is constantly changing, which would be called a 'stochastic vol' model). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are techniques in statistics, based on Markov Chains, that can be used to estimate Regime Switch models. [Kuan: Lecture on regime Switching Model, 40 page PDF &lt;a href=&quot;http://homepage.ntu.edu.tw/~ckuan/pdf/Lec-Markov_note_spring%202010.pdf&quot; rel=&quot;nofollow&quot;&gt;http://homepage.ntu.edu.tw/~ckuan/pdf/Lec-Markov_note_spring%202010.pdf&lt;/a&gt; ].&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2016-09-14T15:36:59.500" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30142" PostTypeId="2" ParentId="29914" CreationDate="2016-09-14T15:53:48.270" Score="4" Body="&lt;p&gt;The shape of the implied volatility smile is linked to the higher moments of the underlying return distribution though there is no one-to-one relationship. A convex (concave) smile usually indicates a distribution with positive (negative) excess kurtosis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example for a concave implied vol. smile. It is often observed in markets where a single large jump is anticipated. The smile in my example was generated from a constant coefficient geometric Brownian motion model with $\sigma = 20\%$, $S_0 = 100.0$, $r = 0\%$ and $T = 1 \text{ month}$. In addition there is a single jump in $T^{\text{J}} = 0.5 \text{ month}$ with a jump size of $\pm 10\%$ and equal probability of the jump being up or down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/snc8B.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/snc8B.png&quot; alt=&quot;Implied vol. when a single large jump is anticipated.&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2016-09-14T15:53:48.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30143" PostTypeId="2" ParentId="30029" CreationDate="2016-09-14T17:55:19.440" Score="0" Body="&lt;p&gt;The four parameters of a stable distribution may be estimated by maximum likelihood. John Nolan's stable package is available from &lt;a href=&quot;http://www.robustanalysis.com/&quot; rel=&quot;nofollow&quot;&gt;http://www.robustanalysis.com/&lt;/a&gt; in forms suitable for use in C, C++, R, matlab Mathematica and excel with Windows, Linux or Mac. The package estimates the parameters and produces confidence intervals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might also look at the stable.exe  program available at &lt;a href=&quot;http://fs2.american.edu/jpnolan/www/stable/stable.html&quot; rel=&quot;nofollow&quot;&gt;http://fs2.american.edu/jpnolan/www/stable/stable.html&lt;/a&gt;. This also does maximum likelihood estimates of the parameters and produces confidence intervals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might also find some of the material in &#xA;&lt;a href=&quot;http://www.tcd.ie/Economics/staff/frainj/Stable_Distribution/thesis_main_5.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.tcd.ie/Economics/staff/frainj/Stable_Distribution/thesis_main_5.pdf&lt;/a&gt; useful&lt;/p&gt;&#xA;" OwnerUserId="9458" LastActivityDate="2016-09-14T17:55:19.440" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30144" PostTypeId="1" CreationDate="2016-09-14T19:34:16.167" Score="0" ViewCount="317" Body="&lt;p&gt;My goal is to run a keyword search for phrases like &quot;soybean acreage&quot; or &quot;corn yields&quot; (keywords limited to ag. commodities), and construct a timeline of which dates articles with these key words are published-- obviously filtered by location. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a convenient source where I could download the past 10 years or so of agriculture press releases? Maybe Bloomberg? Or better yet, a site that I could search? &lt;/p&gt;&#xA;" OwnerUserId="20004" LastActivityDate="2016-09-21T00:35:58.557" Title="How to Pull Dump of Old News Articles" Tags="&lt;bloomberg&gt;&lt;commodities&gt;&lt;general&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30146" PostTypeId="1" CreationDate="2016-09-14T20:22:57.787" Score="3" ViewCount="103" Body="&lt;p&gt;I after talking to a research fellow, researched about &lt;code&gt;trading rules from automated search&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found in the book &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1119057868&quot; rel=&quot;nofollow&quot;&gt;Finding Alphas by Tulchinsky&lt;/a&gt; a general chapter, which shows the idea in theory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From an academic standpoint I only found general approaches in trading rule optimization f.ex.: &lt;a href=&quot;http://dollar.biz.uiowa.edu/~street/hirabayashi09.pdf&quot; rel=&quot;nofollow&quot;&gt;Optimization of the Trading Rule in Foreign Exchange &#xA;using Genetic Algorithm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, I would like to ask you if you could share your experience regarding automated search methods for trading rules. Which methodologies are working the best? Any examples?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, I highly appreciate every resource or paper on this topic!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I appreciate your replies!&lt;/p&gt;&#xA;" OwnerUserId="5414" LastActivityDate="2016-09-14T20:22:57.787" Title="Trading rules from automated search" Tags="&lt;quant-trading-strategies&gt;&lt;trading&gt;&lt;trading-systems&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30147" PostTypeId="2" ParentId="30144" CreationDate="2016-09-14T20:35:06.550" Score="1" Body="&lt;p&gt;I found a site with a free API that pulls articles from &quot;thousands&quot; of articles:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://newsriver.io/&quot; rel=&quot;nofollow&quot;&gt;https://newsriver.io/&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: &lt;a href=&quot;http://eventregistry.org/&quot; rel=&quot;nofollow&quot;&gt;http://eventregistry.org/&lt;/a&gt; is also very, very good.They even have a Python 2.x module: &lt;a href=&quot;https://github.com/gregorleban/EventRegistry/&quot; rel=&quot;nofollow&quot;&gt;https://github.com/gregorleban/EventRegistry/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20004" LastEditorUserId="20004" LastEditDate="2016-09-21T00:35:58.557" LastActivityDate="2016-09-21T00:35:58.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30150" PostTypeId="1" CreationDate="2016-09-15T07:33:52.213" Score="3" ViewCount="85" Body="&lt;p&gt;If you were to compare the usual sample covariance estimate to a robust covariance estimate (such as MCD), you can say that the robust estimate is more tolerant to outliers in the data and will not be influenced as much by the presence of these outliers. In other words, the robust estimate is not &quot;jumping at shadows&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a similar statement you can make about covariance estimation using a statistical factor model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the sake of completeness, the procedure for estimating covariance using a statistical factor model is as follows:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Estimate an initial covariance matrix via some other means (sample or robust)&lt;/li&gt;&#xA;&lt;li&gt;Decompose into Eigen values and Eigen vectors and apply the rotation.&lt;/li&gt;&#xA;&lt;li&gt;Discard all but the most significant eigen vectors (you can use a Marcenko-Pastur distribution to calculate a cutoff)&lt;/li&gt;&#xA;&lt;li&gt;Regress the returns on the remaining factors.&lt;/li&gt;&#xA;&lt;li&gt;Calculate the covariance in the usual way for a factor model.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;It seems to me that by discarding the non significant eigen vectors, you are ignoring a lot of the noise and the resulting covariance matrix represents more signal on the off diagonal entries, with more noise represented on the diagonal entries. This is not the same as being robust to outliers though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does the above seem like a fair statement? Is there anything else we can say about it?&lt;/p&gt;&#xA;" OwnerUserId="24413" LastActivityDate="2016-09-15T07:33:52.213" Title="What is special about covariance estimation from statistical factor models?" Tags="&lt;factor-models&gt;&lt;pca&gt;&lt;covariance-estimation&gt;&lt;outliers&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30152" PostTypeId="1" CreationDate="2016-09-15T09:11:38.947" Score="1" ViewCount="1239" Body="&lt;p&gt;Within the IFRS9 framework it is stated that one needs to determine the expected losses and discount these with the effective interest rate (EIR), i.e. the contractual rate at initiation. However, I would like to understand, both from an economical and a mathematical point of view, why this is logical.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, the reason I have difficulty in understanding this is due to the following. I believe that given a product there are two ways to determine the fair value, suppose we are looking at a mortgage:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;If we assume that the contractual rate is the sum of the risk free rate and a spread for credit risk (neglecting other types of risk). Then taking the contractual cashflows and discounting these with the contractual rate corresponds to the discounted cash flow approach, where all the counterparty risk and time value of money is within the discount rate. To this end this results in a fair value of the product. To recap in formula's:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;$$V_0=\sum_{i}\frac{C_i}{(1+r+\lambda)^i},$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $r$ is the risk-free rate, $\lambda$ the spread for credit risk, $r+\lambda$ the contractual rate, and $C_i$ the contractual cashflow at time $i$. $V_0$ is what the bank would write for it's bookvalue. And as one can understand, due to the discounting with the contractual rate it already takes into account expected credit losses. So why even model losses seperately?&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;Instead of looking at the contractual cashflows we will create a model that models the credit risk, that is, risk-neutral pricing, which would look as follows:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;$$V_0=\mathbb{E}\left[\sum_{i}\frac{C_i\cdot1_{\tau&amp;gt;i}+R\cdot1_{i-1&amp;lt;\tau\leq i}}{(1+r)^i}\right],$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\tau$ the default time and $R$ the recovery in case of a default. And, note that discounting is only with respect to the risk-free rate (which might be the funding rate for a bank, if that is more sensible). Now, in this case it would be sensible to model the losses, but if we do so, they should be discounted with the risk-free rate, and so should be the contractual cashflows. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How exactly do we mediate between method 1 where we apply the contractual rate, and method 2 where we model the losses, as for IFRS9 we have to do both things?&lt;/p&gt;&#xA;" OwnerUserId="15947" LastActivityDate="2018-10-04T14:51:28.120" Title="For IFRS9, losses should be discounted with the EIR, why is that sensible?" Tags="&lt;credit-risk&gt;&lt;discounting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30153" PostTypeId="1" CreationDate="2016-09-15T12:00:33.597" Score="0" ViewCount="51" Body="&lt;p&gt;Let $u &amp;lt; v &amp;lt; T$ and assume $S_t$ follows a lognormal $((\mu - \sigma^2/2)t, \sigma^2 t)$ process.  I'm interested in computing the conditional probability&#xA;$$&#xA;P(S_T &amp;gt; S_u \mid S_v = s_*)&#xA;$$&#xA;where $s_* \in (0, \infty)$ is some known value (as is $S_u$).  The idea is that we've already generated the value $s_*$ and, based on this, I'd like to compute the probability the stock is above some value at time $u &amp;lt; v$.  My thought is that I can simply write&#xA;$$&#xA;P(S_T &amp;gt; S_u \mid S_v = s_*) = P(s_* e^{(\mu - \sigma^2/2)(T-v) + \sigma\sqrt{T - v}Z}&amp;gt; S_u)&#xA;$$&#xA;but I'm not confident about the derivation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even better, I'd like to work out&#xA;$$&#xA;P(S_T \in B \mid \mathcal{F}_v)&#xA;$$&#xA;for general $B \in \mathcal{B}$, but I thought I'd start with a concrete probability first.&lt;/p&gt;&#xA;" OwnerUserId="6866" LastEditorUserId="6866" LastEditDate="2016-09-15T12:07:34.603" LastActivityDate="2016-09-16T07:40:22.730" Title="$P(S_T &gt; S_u \mid S_v = s_*)$" Tags="&lt;stochastic-processes&gt;&lt;probability&gt;&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30154" PostTypeId="2" ParentId="30153" CreationDate="2016-09-15T12:40:09.723" Score="2" Body="&lt;p&gt;If you assume that $(S_t)_{t\geq0}$ is a GBM with constant drift $\mu$ and volatility $\sigma$, then conditionally on $\mathcal{F}_v$ you can indeed write that:&#xA;$$ S_T = s_* \exp\left({\left(\mu - \frac{\sigma^2}{2}\right)(T-v) + \sigma\sqrt{T - v}Z} \right)$$&#xA;for any $T \geq v \geq 0$ provided $Z \sim N(0,1)$ and $S_v = s_*$ a.s. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be shown using Itô's lemma. Thus what you wrote is perfectly fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now assuming that $\mathcal{B}$ is a compact set $\mathcal{B}:=[a,b] \in \Bbb{R}$, then&#xA;$$ P(S_T \in \mathcal{B} \,\vert\, \mathcal{F}_v) = P(S_T &amp;lt; b \,\vert\, \mathcal{F}_v) - P(S_T &amp;lt; a \,\vert\, \mathcal{F}_v) $$&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-09-16T07:40:22.730" LastActivityDate="2016-09-16T07:40:22.730" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30156" PostTypeId="1" CreationDate="2016-09-15T13:52:54.033" Score="1" ViewCount="198" Body="&lt;p&gt;Is there a way to convert between continuous and discrete volatility without the actual return data?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, calculating on 12 monthly returns:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;{0.03, 0.91, 0.05, -0.17, -1.64, 0.79, -1.41, 0.69, 1.08, 0.42, 1.29, 1.66}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;from Ito's Lemma, volatility is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma  =\sqrt{\frac{(dS)^2}{S^2 dt}}$&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;σ = 0.0352148&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;whereas using standard deviation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma =\sqrt{\frac{m}{T-1}\sum _{t=1}^T (r[t]-R)^2}$&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;σ = 0.035048&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The reason for asking is I have annualised standard deviation and wish to compute confidence bounds for &lt;code&gt;b = -2, -1, 1, 2&lt;/code&gt;.  However $\sigma$ here is the continuous log version:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$y_0 e^{\left(a-\frac{\sigma ^2}{2}\right) t+b \sigma  \sqrt{t}}$&lt;/p&gt;&#xA;" OwnerUserId="7178" LastEditorUserId="7178" LastEditDate="2016-09-15T14:28:06.750" LastActivityDate="2016-09-15T14:28:06.750" Title="Possible to convert between continuous &amp; discrete volatility without underlying data?" Tags="&lt;volatility&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30159" PostTypeId="2" ParentId="74" CreationDate="2016-09-15T15:54:30.913" Score="1" Body="&lt;p&gt;I know this is an older post, but I found a great tool that I use. It is &lt;a href=&quot;http://www.key2options.com&quot; rel=&quot;nofollow&quot;&gt;http://www.key2options.com&lt;/a&gt;. They are an online backtesting analysis platform. They offer a 3 week free trial and will do a one on one demo with you to show you how it works.&lt;/p&gt;&#xA;" OwnerUserId="24424" LastActivityDate="2016-09-15T15:54:30.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30160" PostTypeId="2" ParentId="28278" CreationDate="2016-09-15T16:13:01.287" Score="1" Body="&lt;p&gt;I suggest you to organize you explanatory variables in different matrix and then use the &lt;code&gt;mvregress(...)&lt;/code&gt; command, that allows you to handle well the results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried in the past to use pre-built command for VAR but I find way simpler to organize it by myself and use usual regression commands.&lt;/p&gt;&#xA;" OwnerUserId="24422" LastEditorUserId="743" LastEditDate="2016-09-16T04:54:20.217" LastActivityDate="2016-09-16T04:54:20.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30161" PostTypeId="2" ParentId="30138" CreationDate="2016-09-15T20:42:58.427" Score="1" Body="&lt;p&gt;Assuming that&#xA;\begin{align*}&#xA;C &amp;amp;= e^{-rT}(S-K)^+,\\&#xA;P &amp;amp;= e^{-rT}(K-S)^+,&#xA;\end{align*} &#xA;and&#xA;\begin{align*}&#xA;straddle = C+ P,&#xA;\end{align*}&#xA;then the formula&#xA;\begin{align*}&#xA;Var[straddle] = Var[C] + Var[P] - 2 E[C]E[P]&#xA;\end{align*}&#xA;is correct. However, the formula&#xA;\begin{align*}&#xA;Var[straddle] = Var[P] + Var[C] - 2\sqrt{Var[P] Var[C] }&#xA;\end{align*}&#xA;is wrong, as $C$ and $P$ are not perfectly negatively corrected. Specifically, since $CP=0$, &#xA;\begin{align*}&#xA;Covar(C, P) &amp;amp;= -E(C)E(P)\\&#xA;&amp;amp;\neq -\sqrt{Var[P] Var[C] }.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-09-16T11:22:52.420" LastActivityDate="2016-09-16T11:22:52.420" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30163" PostTypeId="2" ParentId="30133" CreationDate="2016-09-15T22:37:47.513" Score="2" Body="&lt;p&gt;If we assume that we have no variable storage cost, than the optimal strategy in the beginning seems to be to buy as much as possible in forward contracts for the month with the cheapest forward price. Assuming you can buy enough to get through the year you'll just sell what you have until you start the cycle again next year. &#xA;The next day the forward prices might have changed. If the month with previously lowest prices is still the cheapest month you can win nothing by selling or buying contracts. But imagine a situation where maybe the month next to the former cheapest month becomes the month with the lowest price. Than it would be beneficial to sell all the forward buying contracts and buy them new for the current cheapest month.&#xA;Example:&#xA;At the beginning you buy a forward contract for 100 units of gas in june. And you sell them over the course of the following year. The forward price for june is 10 USD per unit and the prices for all other months are higher than that. &#xA;Now assume the june price drops to 9 USD but the july price drops even lower to 8 USD. Selling all your june contracts causes you a loss of 100*1 USD but by buying the july contracts you save 100*2 USD because you buy 2 USD per unit cheaper than before.&lt;/p&gt;&#xA;" OwnerUserId="22686" LastActivityDate="2016-09-15T22:37:47.513" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30164" PostTypeId="1" AcceptedAnswerId="30181" CreationDate="2016-09-16T00:20:20.037" Score="1" ViewCount="60" Body="&lt;p&gt;Dear fellow community members, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the excerpt from Bernanke and Kuttner (2005) that I need to apply to gather my data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;&lt;strong&gt;A measure of the surprise element of any specific change in the Federal funds target can be derived from the change in the futures contract's price relative to the day prior to the policy action&lt;/strong&gt;. For an event taking place on day &lt;em&gt;d&lt;/em&gt; of month &lt;em&gt;m&lt;/em&gt;, the unexpected, or &quot;surprise&quot;, target funds rate change can be calculated from the change in the rate implied by the current-month futures contract. But because the contract's settlement price is based on the monthly average Federal funds rate, the change in the implied futures rate must be scaled up by a factor related to the number of days in the month affected by the change,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \Delta i^u = \frac{D}{D-d} (f_{m,d}^0  - f_{m,d-1}^0) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\Delta i^u$ is the unexpected target rate change, $f_{m,d}^0$ is the current-month futures rate, and $D$ is the number of days in the month. The expected component of the rate change is defined as the actual change minus the surprise, or &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta i^e = \Delta i - \Delta i^u $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need help applying the above formulas to the Australian Futures Index below. Say there is a surprise change by the RBA (Reserve Bank of Australia) on September 16, what would be the $\Delta i^u$ and $\Delta i^e$? Am i using the right data to measure this? Any help would be very much appreciated as I am very new to finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/uGtmv.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/uGtmv.png&quot; alt=&quot;ASX futures&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="24416" LastActivityDate="2016-09-17T10:11:17.863" Title="Measuring the surprise element of policy actions" Tags="&lt;finance&gt;&lt;futures&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30165" PostTypeId="1" AcceptedAnswerId="30172" CreationDate="2016-09-16T01:13:39.117" Score="0" ViewCount="693" Body="&lt;p&gt;Consider a standard binomial tree. Let $u = e^{(r - \delta)h + \sigma\sqrt{h}}$ and $d = e^{(r - \delta)h - \sigma\sqrt{h}},$ where $\delta$ is the continuously compounded dividend yield, $h$ is the length of one period in a binomial model, and $\sigma$ is volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am told in my textbook that the risk-neutral probability $p*$ is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$p^* = \frac{e^{(r - \delta)h} - d}{u - d} = \frac{1}{1 + e^{\sigma\sqrt{h}}}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried deriving the second equality as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\begin{align}\frac{e^{(r - \delta)h} - d}{u - d} &amp;amp;= \frac{e^{(r - \delta)h} - e^{(r - \delta)h - \sigma\sqrt{h}}}{e^{(r - \delta)h + \sigma\sqrt{h}} - e^{(r - \delta)h - \sigma\sqrt{h}}}\\ &amp;amp;= \frac{e^{(r - \delta)h}(1 - e^{-\sigma\sqrt{h}})}{e^{(r - \delta)h}(e^{\sigma\sqrt{h}} - e^{-\sigma\sqrt{h}})}\\ &amp;amp;= \frac{1 - e^{-\sigma\sqrt{h}}}{e^{\sigma\sqrt{h}} - e^{-\sigma\sqrt{h}}}\end{align}.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now at this point I am stuck and I'm unsure if it's either something algebraic I am not seeing, or if there is some property of forward trees that we can use to reach the conclusion. &lt;/p&gt;&#xA;" OwnerUserId="5641" LastActivityDate="2016-09-16T09:46:33.220" Title="How to derive the formula for risk-neutral probability for a Standard Binomial Tree (Forward Tree)" Tags="&lt;binomial-tree&gt;&lt;self-study&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30167" PostTypeId="1" CreationDate="2016-09-16T02:32:18.210" Score="2" ViewCount="1833" Body="&lt;p&gt;I understand that, based on market convention, you can construct the volatility surface of an indirect quote FX pair by flipping the volatility surface of the direct quote around the ATM level. For example, the 25 Delta Call volatility of USD/JPY is the same as the 25 Delta Put volatility of JPY/USD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am wondering if this is an approximation, though, because I have tried deriving the strikes of (1) USD/JPY call option that gives you 25% delta and (2) JPY/USD put option that gives you -25% delta, but they are not exactly inverse of each other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any insight on this matter is greatly appreciated!&lt;/p&gt;&#xA;" OwnerUserId="24434" LastActivityDate="2016-12-27T04:34:13.200" Title="Volatility Surface for Inverse FX pair / Indirect Quote" Tags="&lt;volatility&gt;&lt;fx&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30168" PostTypeId="1" CreationDate="2016-09-16T03:18:57.847" Score="3" ViewCount="61" Body="&lt;p&gt;&lt;a href=&quot;http://www.bloombergsdr.com/slicefiles&quot; rel=&quot;nofollow&quot;&gt;Bloomberg&lt;/a&gt; and &lt;a href=&quot;https://rtdata.dtcc.com/gtr/dashboard.do&quot; rel=&quot;nofollow&quot;&gt;DTCC&lt;/a&gt; both release swap reporting data in form of downloadable files which can be analyzed later on. I have been looking for the same on ICE and CME sites, but couldn't find. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I download the swap reporting data from these two swap data repositories?&lt;/p&gt;&#xA;" OwnerUserId="15281" LastActivityDate="2016-09-16T03:18:57.847" Title="How to get swap reporting data from repositories ICE and CME?" Tags="&lt;data&gt;&lt;swaps&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30169" PostTypeId="2" ParentId="22946" CreationDate="2016-09-16T06:41:02.290" Score="3" Body="&lt;p&gt;An exact and explicit solution for the valuation of American put options&#xA;SP Zhu 2006,&#xA;Quantitative Finance 6 (3), 229-242&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's an infinite sum of double integrals with recursively defined integrands...&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2016-09-16T06:41:02.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30171" PostTypeId="1" CreationDate="2016-09-16T08:48:45.623" Score="0" ViewCount="109" Body="&lt;p&gt;I am recently doing a project, which I need to apply Sharpe ratio to all the stocks. How do I loop through all the stocks and find the 10 stocks with the highest Sharpe ratio using R program? Thanks a lot!!&lt;/p&gt;&#xA;" OwnerUserId="24439" LastActivityDate="2016-09-19T05:04:56.740" Title="How do I loop through all the stocks and find the 10 stocks with the highest Sharpe ratio using R program?" Tags="&lt;equities&gt;&lt;programming&gt;&lt;finance&gt;&lt;sharpe-ratio&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30172" PostTypeId="2" ParentId="30165" CreationDate="2016-09-16T09:46:33.220" Score="2" Body="&lt;p&gt;Here's one algebraic way to derive it:&#xA;$$&#xA;\frac{(1 - e^{-\sigma\sqrt{h}})(1 + e^{\sigma\sqrt{h}})}{(e^{\sigma\sqrt{h}} - e^{-\sigma\sqrt{h}})(1 + e^{\sigma\sqrt{h}})} = \frac{1 - e^{-\sigma\sqrt{h}} + e^{\sigma\sqrt{h}} - 1}{(e^{\sigma\sqrt{h}} - e^{-\sigma\sqrt{h}})(1 + e^{\sigma\sqrt{h}})} = \frac{e^{\sigma\sqrt{h}} - e^{-\sigma\sqrt{h}}}{(e^{\sigma\sqrt{h}} - e^{-\sigma\sqrt{h}})(1 + e^{\sigma\sqrt{h}})} = \frac{1}{1 + e^{\sigma\sqrt{h}}}&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="19615" LastActivityDate="2016-09-16T09:46:33.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30173" PostTypeId="1" AcceptedAnswerId="30174" CreationDate="2016-09-16T09:50:43.540" Score="1" ViewCount="306" Body="&lt;p&gt;I want to know which volatility estimator should I use for the following scenario: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am implementing a market making bot and therefore I need to make estimations of the volatility of the price in the fashion of asking: What was the volatility of the price in the last couple of Minutes? (5-30 Minutes) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The data I've got available for the estimation is a set of all the prices in that time period at an interval of about 2-5 seconds, which are about 500 data point. And every time a new data point is added to the set, all data points that are older than the period of interest (5-30 Minutes) are removed from it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now I use a basic estimator that calculates the variance of all the prices, however the problem with that is: the volatility oscillates way to much. I would expect the volatility to change slow and continuous over time.&lt;/p&gt;&#xA;" OwnerUserId="22207" LastActivityDate="2016-09-16T10:09:11.117" Title="What volatility estimator for continuous data and small time window?" Tags="&lt;volatility&gt;&lt;estimation&gt;&lt;high-frequency-estimators&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30174" PostTypeId="2" ParentId="30173" CreationDate="2016-09-16T10:09:11.117" Score="3" Body="&lt;p&gt;First, you should use an exponential moving average, since the amount of state you need to keep is much smaller than for a simple moving average.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second the well known estimator of volatility,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\hat{\sigma} = \sqrt{\frac{1}{n}\sum_{i=1}^n (x_i - \bar{x})^2}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is not very robust, since the squaring amplifies the contribution of outliers (which is why you are observing a very noisy volatility estimate - high frequency data has a &lt;em&gt;lot&lt;/em&gt; of outliers).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, consider using a mean absolute deviation estimate,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\hat{\sigma}_{MAD} =  \frac{1}{n} \sum_{i=1}^n |x_i - \bar{x}|&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is more robust to outliers. You need to multiply this by a factor of $\sqrt{\pi/2}$ so that it matches the scale of the standard deviation estimator above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The quantities $x_i$ should be the price differences from tick to tick, i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;x_i = p_i - p_{i-1}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or maybe the returns,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;x_i = \frac{p_i}{p_{i-1}} - 1&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might want to consider thresholding the $x_i$ to some maximum value, say 5x or 10x the current volatility estimate, to reduce the impact of outliers even further.&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2016-09-16T10:09:11.117" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="30175" PostTypeId="2" ParentId="20649" CreationDate="2016-09-16T12:39:10.443" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;No standard. Companies are allowed to name fields as they like. At least it seems to be tolerated.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I dont know about XBRL, but it may help you to know that in the submitted &lt;em&gt;html&lt;/em&gt; version of the financial statements, you can see which lines adhere to GAAP by looking at the field name in the tag of the table cell. All of these start with gaap like &lt;code&gt;gaap_costOfGoodsSold&lt;/code&gt;. But this is only true for the reports after 2011 or so. And fortunately, the GAAP naming seems consistent across companies.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="19592" LastActivityDate="2016-09-16T12:39:10.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30176" PostTypeId="1" AcceptedAnswerId="30180" CreationDate="2016-09-16T14:01:56.140" Score="4" ViewCount="2009" Body="&lt;p&gt;What I have understood is that the overnight index swap is bootstrapped to discount rates/zero rates that in their turn are considered risk free. The reason being, that the reference rate of such swap - which is the overnight uncollateralized lending between banks - corresponds to overnight lending, which is close to risk-free due to its very short period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, what I have also understood is that settlement of these overnight swaps are usually at maturity or annually for swaps longer than 1 year. The credit risk in such swap is thus actually the same as the credit risk in any LIBOR referencing swap due to the fact that settlement/maturity occurs further in the future, allowing for more counterparty credit risk. The only difference being the reference, that is, either LIBOR or the overnight rate. It thus means that in both cases there is an additional spread on both swap rates to adjust for the swap's credit risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, one may argue that the credit risk in such swap is very small, however, the fact that we collateralize swaps, is to me, an indication that the credit risk is sufficiently significant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are these observations correct? If they are, how good is the approximation of the overnight index swap really to risk-free? And if they are not, please correct me.&lt;/p&gt;&#xA;" OwnerUserId="15947" LastEditorDisplayName="user16651" LastEditDate="2016-09-16T14:55:36.983" LastActivityDate="2016-09-17T00:24:04.633" Title="Why is the overnight index swaps considered risk-free?" Tags="&lt;swaps&gt;&lt;credit-risk&gt;&lt;overnight-index&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30177" PostTypeId="1" AcceptedAnswerId="30183" CreationDate="2016-09-16T18:02:21.223" Score="15" ViewCount="1093" Body="&lt;p&gt;Let $C(S, K, \sigma, r, T)$ be the price of a call option. How much can be said about the Greeks without picking a model? Or at least without full Black-Scholes?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below, I write down everything I know in the hopes that&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;people can refer me to a book that does similar things&lt;/li&gt;&#xA;&lt;li&gt;it will be useful for people reading it in the future&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Delta&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Delta = \frac{\partial C}{\partial S}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The amount of stock you should hold for continuous hedging (no t-costs)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{\partial C}{\partial K} = \frac{1}{K} (C- S \frac{\partial C}{\partial S} ) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Proof: assuming that $C$ is homogeneous in $S$ and $K$, apply Euler's homogeneity theorem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The bull spread tells us that $\frac{\partial C}{\partial K}$ is positive. (You could also justify this for $\Delta$ directly with hedging). Hedging shows that $\Delta$ is positive and $\Delta|_{S = 0} = 0$, $\Delta|_{S=\infty} = 1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Gamma&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Gamma = \frac{\partial^2 C}{\partial S ^2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is also for hedging&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C(S+dS) - C(S) \approx \Delta(S) dS + \frac{1}{2}\Gamma(S)dS^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but since you can't just use the underlying, it's a little less clear to me. The butterfly spread shows that $\frac{\partial^2 C}{\partial K ^2} = \left( \frac{K}{S}\right)^2 \Gamma$&#xA;is positive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Rho&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\rho = \frac{\partial C}{\partial r}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r$ can't be a parameter of a truly model independent $C$, so I guess I made the implicit assumption the bond price evolves as&#xA;$d B_t = r B_t dt$&#xA;so $B_t = e^{-r (T - t)}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suppose it would make more sense to have $C$ as a function of $B$ rather than $r$, but it's very similar to $\rho$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\partial C}{\partial B} = \frac{\partial C}{\partial r} \frac{\partial r}{\partial B} \\&#xA;= \rho \frac{-1}{BT} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{\partial C}{\partial B}$ (not sure if it has a name) tells us how much of the risk-free bond to own to hedge, but I have less insight into it than $\Delta$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Theta and Vega&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Theta = \frac{\partial C}{\partial T} \qquad \mathcal{V} = \frac{\partial C}{\partial \sigma}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Again, to have $\sigma$ as a parameter in $C$, some sort of stock price dynamics has to be understood. Both $T$ and $\sigma$ are reasoned about as uncertainty which shows that they are usually positive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't have a very good model independent handle on either of these, but I'm sure it's possible to say something without going full Black-Scholes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular it would be nice to get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Theta = \frac{\sigma}{2T} \mathcal{V}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for when $r= 0$. This intuitively comes from the fact that volatility scales with square root of time, and so the option only depends on the volatility adjusted time $\sigma^2 T$.&lt;/p&gt;&#xA;" OwnerUserId="23872" LastEditorUserId="23872" LastEditDate="2017-02-26T21:48:14.350" LastActivityDate="2017-02-26T22:54:42.880" Title="How much can be said about the Greeks without picking a model?" Tags="&lt;options&gt;&lt;greeks&gt;&lt;reference-request&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="19" ContentLicense="CC BY-SA 3.0" />
  <row Id="30178" PostTypeId="1" CreationDate="2016-09-16T22:11:59.120" Score="1" ViewCount="326" Body="&lt;p&gt;Say I currently hold a set of options positions with the same symbol/expiry that collectively have a net present value based on the estimated value at expiration of +10. I could also liquidate the positions now at a value of +6.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am considering a set of multiple transactions with the same symbol/expiry. If I executed these transactions, I would net +8 including commissions. The estimated present value at expiration for the resulting positions would decline by -3 to 7. I could also liquidate the entire position after the transactions at a value of +5.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to I determine the ROI of executing these transactions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My gut says its 8 / 3 = 266%, I 'invested' that -3 that I lost in value to gain an immediate value of $8. But that does not seem to work for all the different scenarios, such as when a set of transactions results in both an increase in estimated NPV &lt;em&gt;and&lt;/em&gt; a net benefit to the execution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there a general purpose equation that will allow me to measure ROI consistently across these scenarios? How do I account for the reduction in the liquidation value since only one of the two scenarios will occur (either the liquidation value will matter or the value at expiration)?&lt;/p&gt;&#xA;" OwnerUserId="2343" LastActivityDate="2021-04-26T17:05:12.197" Title="How to calculate return on investment for an adjustment to a complex options position?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;returns&gt;&lt;american-options&gt;" AnswerCount="4" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30180" PostTypeId="2" ParentId="30176" CreationDate="2016-09-17T00:24:04.633" Score="4" Body="&lt;p&gt;There's a lot of confusion here.   Most Interest rate swaps (whether versus libor or another floating rate such as fed funds) have virtually no counterparty risk.  That's because they are subject to daily margining, either with an exchange of directly between counterparties.   The cash flows on these swaps are usually discounted at fed funds rates, because the interest paid on the margin amount is usually fed funds.   It's nothing to do with the riskiness of the swap.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-09-17T00:24:04.633" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30181" PostTypeId="2" ParentId="30164" CreationDate="2016-09-17T10:11:17.863" Score="1" Body="&lt;p&gt;Your chart shows the prices of stock index futures.  That is not what the text is talking about.  The text is talking about futures on the overnight federal funds rate.  In the US this would be FFU6 for September.   I dont think an exact Australian equivalent exists.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-09-17T10:11:17.863" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30182" PostTypeId="2" ParentId="29685" CreationDate="2016-09-17T12:17:10.763" Score="1" Body="&lt;p&gt;It depends how large the overlapping interval is. Conceptually an infinite rolling window is equivalent to the level, and no one would suggest to 'regress on levels and apply Newey West'. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think NW is 'robust' in the presence of relatively mild autocorrelation, not a panacea that will give the correct standard errors. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use, say dailly returns aggregated to montly rolling ones, then there is 90% overlap in your consecutive observations (and expected autocorrelation).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My ordered preferences would be:&#xA;4. Newey West or similar&#xA;3. Bootstrap standard errors&#xA;2. Cast as state space and apply Kalman Filter&#xA;1. Drop overlapping observations and use only the non-overlapping ones&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-09-17T12:17:10.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30183" PostTypeId="2" ParentId="30177" CreationDate="2016-09-17T16:52:51.923" Score="16" Body="&lt;p&gt;Find the topic of model-independent properties of option prices very interesting as well. Here are some results that I am aware of and the respective references in the literature. Some are already contained in your initial list as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Plain Vanilla Prices are Convex in the Strike&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Theorem 4 in Merton (1973).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Delta is Bounded by the Slopes of the Payoff Function&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Even under geometric Brownian motion this only holds under no holding cost for the underlying asset.&lt;/li&gt;&#xA;&lt;li&gt;Bergman et al. (1996) show this to hold for European options under certain one- and two-factor diffusion models and allow for jump discontinuities in the payoff function (e.g. digitals). See also Epps (2007), Chapter 8.&lt;/li&gt;&#xA;&lt;li&gt;El Karoui et al. (1998) extend the result by Berman et al. (1998) to American options. Hobson (1998) gives an alternative proof.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Gamma is Positive for Convex Payoffs&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Bergman et al. (1996) - see previous point for the conditions.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Homogeneity in Spot and Strike&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Theorem 9 in Merton (1973) and Bates (2005). This only holds when the underlying exhibits constant returns to scale. Exceptions are e.g. local volatility models.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Vega is Positive for Convex Payoffs&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Theorem 8 in Merton (1973) shows a slightly more general result, namely that the value of a convex payoff is non-decreasing in the riskiness of the underlying asset. In the geometric Brownian motion setting, riskiness corresponds to the diffusion term and thus vega is positive.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bergman, Yaacov Z., Bruce D. Grundy and Zvi Wiener (1996) &quot;General Properties of Option Prices&quot;, Journal of Finance, Vol. 51, No. 5, pp, 1573-1610&lt;/p&gt;&#xA;&#xA;&lt;p&gt;El Karoui, Nicole, Monique Jeanblanc-Picque and Steven E. Shreve (1998) “Robustness of the Black and Scholes Formula”, Mathematical Finance, Vol. 8, No. 2, pp. 93-126&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Epps, Thomas W. (2007) &quot;Pricing Derivative Securities&quot;, World Scientific, Chapter 8.2.1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hobson, David G. (1998) “Volatility Misspecification, Option Pricing and Superreplication via Coupling”, Annals of Applied Probability, Vol. 8, No. 1, pp. 193-205&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Merton, Robert C. (1973) &quot;Theory of Rational Option Pricing&quot;, Bell Journal of Economics and Management Science, Vol. 4, No. 1, pp. 141-183&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-02-26T22:54:42.880" LastActivityDate="2017-02-26T22:54:42.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30184" PostTypeId="2" ParentId="30178" CreationDate="2016-09-17T21:12:18.210" Score="0" Body="&lt;p&gt;I certainly see a problem in the fact, that you say that your position has a npv of 7, but you can not sell your position at 7 right now. I assume you're position has a considerable risk. That means you do not know your actual return. On average it might be 7, but it might be more or less in the end. That means you can only calculate an average ROI not the actual one. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But let's assume your npv's are real market values at which you could sell your position at any time. Since the ROI is simply your profit divided by the capital you used to generate that profit, it would be in your case 5/3 = 166%, since you invested a value of 3 to make a profit of 5.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your transactions result in an immediate increase in cash and value of your position than you have an arbitrage opportunity and you should try to do as much of these transactions as possible. The ROI would be infinite.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Addendum: I think ROI is not usefull in your situation. You can use it at the end, when all positions are eliminated. Before that I doubt its usefullness. I assume that your transactions are changing the risk of your position. Otherwise it seems impossible to me to create a cash and npv increase simultanously. That means you need a measure of success that also takes your risk into considerations like Sharpe ratio et. al.&lt;/p&gt;&#xA;" OwnerUserId="22686" LastEditorUserId="22686" LastEditDate="2016-09-17T23:37:25.827" LastActivityDate="2016-09-17T23:37:25.827" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30186" PostTypeId="2" ParentId="30178" CreationDate="2016-09-17T22:56:32.023" Score="0" Body="&lt;p&gt;My instinct is to compute the expected value of the options right now. In a black-scholes framework, you simply recompute your put / call value with current time to expire and underlying price(s), and add up the values, then compare to the cost in the market of closing these positions. Note that if you use the market IV to calculate this, you will get back from this that both are exactly the same expected value. Like most things with options, determining the best course of action depends on your view of volatility vs the rest of the market.&lt;/p&gt;&#xA;" OwnerUserId="18144" LastActivityDate="2016-09-17T22:56:32.023" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30187" PostTypeId="1" CreationDate="2016-09-18T00:36:27.840" Score="1" ViewCount="87" Body="&lt;p&gt;what kind of adjustments are needed to VIX series so that it could be used to approximate BS IV in calculating near-term (EDIT: weeklys) SPY at-the-money call premiums/deltas?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks a lot.&lt;/p&gt;&#xA;" OwnerUserId="15617" LastEditorUserId="15617" LastEditDate="2016-09-18T05:01:42.163" LastActivityDate="2016-09-18T05:01:42.163" Title="using VIX to approximate BS IV for short term S&amp;P ATM calls" Tags="&lt;black-scholes&gt;&lt;vix&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30190" PostTypeId="1" AcceptedAnswerId="30191" CreationDate="2016-09-18T09:34:44.127" Score="1" ViewCount="8105" Body="&lt;p&gt;Why do you get long vega when you buy an option and short vega when you sell an option? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would have thought that for both buying and selling options the vega would change according to whether the option was ITM or OTM. This would be because as an option participant an increase/decrease in volatility would change the chance of expiring at a financially beneficial position. However this not appear to explain the first statement (which I believe is correct).&lt;/p&gt;&#xA;" OwnerUserId="11723" LastEditorUserId="11723" LastEditDate="2016-09-18T09:41:19.913" LastActivityDate="2016-10-26T21:09:03.807" Title="Long/Short Vega and Option Positions" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;derivatives&gt;&lt;greeks&gt;&lt;vega&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30191" PostTypeId="2" ParentId="30190" CreationDate="2016-09-18T09:54:47.257" Score="5" Body="&lt;p&gt;The risk exposures/sensitivities of long and short positions always have different signs. This has to hold since derivatives are zero sum games.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Vega is always positive for a long position in a European plain vanilla option (or any convex payoff in general). This is true even when the option is already in-the-money. As volatility increases, the probability of very positive and very negative returns increases. As the holder of the option, you are protected against moves in one direction but participate in the other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can construct a very simple binomial example to illustrate this. Consider a one period setting. You are long a call with strike 90. The current stock price is 100 and there are no rates or dividends.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;First consider a &quot;low volatility&quot; scenario, where the stock either goes up to 105 or down to 95. The payoff is either 15 or 5 and the initial price is 10 with a time value of 0.&lt;/li&gt;&#xA;&lt;li&gt;Now consider a &quot;high volatility&quot; scenario, where the stock either goes up to 120 or down to 80. They payoff is either 30 or 0 and the initial price is 15 with a time value of 5.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You see that due to the convexity of the payoff, a higher volatility is advantageous even when the option is already in-the-money since losses are limited. European vanilla options derive their time value (ignoring rates, dividends, ...) from the possibility of crossing the strike, no matter whether they are already in-the-money or not.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2016-10-26T21:09:03.807" LastActivityDate="2016-10-26T21:09:03.807" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30192" PostTypeId="1" AcceptedAnswerId="30196" CreationDate="2016-09-18T11:18:53.577" Score="6" ViewCount="1062" Body="&lt;p&gt;Often when I am reading about options pricing (and/or options greeks) the square root of time continually comes up. What the mathematical justification for why this keeps on turning up?&lt;/p&gt;&#xA;" OwnerUserId="11723" LastActivityDate="2016-09-18T13:30:50.290" Title="Mathematical underpinnings of the square root of time rule" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;greeks&gt;&lt;vega&gt;&lt;theta&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30193" PostTypeId="2" ParentId="30190" CreationDate="2016-09-18T11:21:20.053" Score="4" Body="&lt;p&gt;No, you are incorrect.  A deep in the money option is long vega.  It's not just about the probability of being in the money, it's about how far in the money it is.   Your reasoning is correct if we are talking about digital options which pay a fixed amount if the option expires in the money, but incorrect for regular options.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way to prove this explicitly:  a deep in the money call is equal (by put call parity) to a long position in the underlying + a deep out of the money put.  Since the position in the underlying has no vega, the deep ITM call has the same vega as the deep OTM put.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-09-18T11:21:20.053" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30194" PostTypeId="2" ParentId="30192" CreationDate="2016-09-18T13:10:18.310" Score="3" Body="&lt;p&gt;The reason is that in many common models including geometric Brownian motion, the variance of the logarithmic returns is proportional to time. Thus, their standard deviation/volatility is proportional to the square root of time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider for example the class of Levy models where $X$ is is the logarithmic stock price process such that $S_t = S_0 e^{X_t}$. The cumulant generating function of $X_t$ takes the form&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\psi_{X_t}(\omega) = \psi_{X_1}(\omega) t,&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\psi_{X_1}(\omega)$ is the characteristic exponent which is independent of $t$. You obtain the $n$-th cumulant as the $n$-th derivative of the cumulant generating function with respect to the transform parameter evaluated at zero, i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;c_n(X_t) = \frac{1}{\mathrm{i}^n} \frac{\partial^n \psi_{X_t}}{\partial \omega^n}(0).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You immediately see that the cumulants are proportional to $t$. Since the second cumulant corresponds to the variance, this confirms that the standard deviation of logarithmic returns is proportional to the square root of time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As mentioned the above setup includes the geometric Brownian motion setting with&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\psi_{X_t}(\omega) = \left( \mathrm{i} \omega \left( r - \frac{1}{2} \sigma^2 \right) - \frac{1}{2} \sigma^2 \omega^2 \right) t.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;c_2 \left( X_t \right) = \sigma^2 t&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;as expected.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2016-09-18T13:10:18.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30195" PostTypeId="1" CreationDate="2016-09-18T13:26:26.803" Score="0" ViewCount="313" Body="&lt;p&gt;Any specific Roll Convention that I should use for Indexes with 7D tenor like CNY-CNREPOFIX=CFXS-Reuters or USD-SIFMA Municipal Swap Index ? What will be the Calculation Period Frequency or the Payment Frequency for Payment/Accrual calculation? Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="19462" LastActivityDate="2016-12-09T16:57:53.017" Title="Roll Convention for 7D Index" Tags="&lt;swaps&gt;&lt;interest-rate-swap&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30196" PostTypeId="2" ParentId="30192" CreationDate="2016-09-18T13:30:50.290" Score="8" Body="&lt;p&gt;For any process with independent increments, by the very fact of statistical independence the variance of $x_{t3}-x_{t1}$ is going to be the sum of the variances of $x_{t2}-x_{t1}$ and $x_{t3}-x_{t2}$ for $t1\leq t2 \leq t3$.  Many processes have independent increments, including ABM, GBM, Poisson, etc. Then if you add a homogeneity assumption (the parameters of the process do not change over time) you get a proportionality of the variance to the length of the time interval and thus a proportionality of the standard deviation to $\sqrt t$.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2016-09-18T13:30:50.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30197" PostTypeId="1" CreationDate="2016-09-18T14:43:28.333" Score="0" ViewCount="60" Body="&lt;p&gt;can anyone help me to explain how the following model works?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/IOIDM.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/IOIDM.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this formula $P(t)$ is a price at time $t$ and $F(t)$ is the residual  noise term. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The $\omega(i;T_i)$ and $P_{o}(i;T_i)$ are uniquely determined from the past $T_{i}$ data points by condition that minimizes the root-mean square of $F(t)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why $(\omega_{1}(i;T_i)-1)$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance. &lt;/p&gt;&#xA;" OwnerUserId="9341" LastEditorUserId="22237" LastEditDate="2016-09-18T15:14:28.750" LastActivityDate="2016-09-18T15:23:12.367" Title="Definition of the bubbles and crashes" Tags="&lt;market&gt;&lt;financial&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30198" PostTypeId="2" ParentId="30197" CreationDate="2016-09-18T15:23:12.367" Score="1" Body="&lt;p&gt;The paper explains it quite well I think: There are three cases:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) $\omega&amp;gt;1$ the price is either exponentially increasing or decreasing and $P_{0}$ gives the base line of the exponential divergence. We deﬁne such behavior as a bubble or a crash. In this case the positive feedback from the past price change becomes larger as the time passes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) $\omega=0$ the price follows a random walk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(3) $\omega&amp;lt;0$ the price is convergent to $P_{0}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the value of the parameter just either magnifies the expression $\{P(t-1)-P_{0}\}$, renders it zero, or makes the price increments revert to $P_{0}$.&lt;/p&gt;&#xA;" OwnerUserId="22237" LastActivityDate="2016-09-18T15:23:12.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30200" PostTypeId="1" CreationDate="2016-09-18T19:20:21.613" Score="2" ViewCount="262" Body="&lt;p&gt;My understanding is that in practice, off the run treasury bonds are priced using a spread to the on the run bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How then are the on the run bonds priced - e.g. 5 year treasury?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If a discounting approach is taken, what are appropriate discount rates given this is risk free and there are few other instruments similar to it?&lt;/p&gt;&#xA;" OwnerUserId="13532" LastActivityDate="2016-09-25T13:47:15.553" Title="How do dealers price benchmark treasury bonds?" Tags="&lt;fixed-income&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30201" PostTypeId="1" AcceptedAnswerId="30206" CreationDate="2016-09-18T20:53:06.093" Score="0" ViewCount="145" Body="&lt;p&gt;I have spent numerous months writing a framework for testing and researching for strategies, I now want to publish this framework with hopes of possibly marketing myself. It includes quandl data as well as Oanda data. However I am not sure where to share this frame work. It is written in Java and has various math tools. I know I can publish it on github, and share it on my youtube which tends to get 300-600 views per video. I could also share it on forexfactory (an fx trading forum). Not sure where else I could share it, any ideas Quant SE?&lt;/p&gt;&#xA;" OwnerUserId="18578" LastActivityDate="2016-09-19T04:43:44.883" Title="I want to publish my research framework for quantitative finance" Tags="&lt;fx&gt;&lt;backtesting&gt;&lt;research&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30202" PostTypeId="2" ParentId="30200" CreationDate="2016-09-18T21:52:44.140" Score="3" Body="&lt;p&gt;Treasury bonds are priced by supply and demand from investors.  Probably the most important factor in pricing Treasury bonds is the expected path of short term interest rates over time.  For example, the 5 year treasury yield is approximately equal to the average expected Federal funds rate in effect over the next 5 years.  Many other factors come into play also, but that's the most important.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-09-18T21:52:44.140" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30203" PostTypeId="2" ParentId="29566" CreationDate="2016-09-18T22:58:47.453" Score="1" Body="&lt;p&gt;It rebalances on endpoints(R), you passed it quarters, so every quarter as determined by endpoints(returns,'quarters') it will rebalance using the last 12 observations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case there you called optimize portfolio on a dataset of 37 observations&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;     nrow(edhec[&quot;2006-08-31::2009-08-31&quot;]) &#xA;[1] 37&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This should explain the discrepancy between the two calls as one has a dataset of 12 vs 37.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While in your first test you called optimize portfolio on a dataset of 12 observations which in line with the optimize.portfolio.rebalancing call&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;nrow(edhec[&quot;::1997-12-31&quot;,])&#xA;[1] 12&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2154" LastActivityDate="2016-09-18T22:58:47.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30204" PostTypeId="1" AcceptedAnswerId="30293" CreationDate="2016-09-18T23:12:21.377" Score="2" ViewCount="1141" Body="&lt;p&gt;Its the same question as previous, except I am looking for code in python&#xA; verses R. &lt;a href=&quot;https://quant.stackexchange.com/questions/16738/how-to-approximate-the-time-to-mean-reversion-for-implied-volatility/16747#comment40816_16747&quot;&gt;How to approximate the time to mean reversion for implied volatility&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given an option and its implied volatility, and also the mean value of the implied volatility over the last 30 days, if we find that the current IV is significantly (&gt; 1 std dev.) away from the mean, then:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to approximate the time for the IV to mean revert in vectorized python? &lt;/p&gt;&#xA;" OwnerUserId="1877" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-09-27T16:12:55.027" Title="How to approximate the time to mean reversion for implied volatility in python" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;python&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="30206" PostTypeId="2" ParentId="30201" CreationDate="2016-09-19T04:43:44.883" Score="3" Body="&lt;p&gt;You could also consider publishing on:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;SSRN - &lt;a href=&quot;http://www.ssrn.com/en/&quot; rel=&quot;nofollow&quot;&gt;http://www.ssrn.com/en/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;Google+ - &lt;a href=&quot;https://plus.google.com&quot; rel=&quot;nofollow&quot;&gt;https://plus.google.com&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;CodeProject - &lt;a href=&quot;http://www.codeproject.com/script/Articles/Submit.aspx&quot; rel=&quot;nofollow&quot;&gt;http://www.codeproject.com/script/Articles/Submit.aspx&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="22333" LastActivityDate="2016-09-19T04:43:44.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30207" PostTypeId="2" ParentId="30171" CreationDate="2016-09-19T05:04:56.740" Score="1" Body="&lt;p&gt;I would recommend you should avoid using loops in R unless absolutely necessary since iteration is very slow in R. Some newer data classes improve performance, but in general its always best to use a &quot;vectorised&quot; method if available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could use either &lt;code&gt;order&lt;/code&gt; or &lt;code&gt;rank&lt;/code&gt; to get the 10 stocks with the highest Sharpe Ratio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets assume you have the following data in R:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mydata &amp;lt;- as.data.frame( cbind( scrip=letters, sharpe_ratio=seq(from=-0.25,to=1.00,by=0.05) ) )&#xA;mydata$sharpe_ratio &amp;lt;- as.numeric( as.character(mydata$sharpe_ratio ) )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Method 1&lt;/strong&gt;: Sort and then pick up top 10:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mydata[ order(mydata$sharpe_ratio, decreasing =TRUE) ,][1:10,]&#xA;   scrip sharpe_ratio&#xA;26     z         1.00&#xA;25     y         0.95&#xA;24     x         0.90&#xA;23     w         0.85&#xA;22     v         0.80&#xA;21     u         0.75&#xA;20     t         0.70&#xA;19     s         0.65&#xA;18     r         0.60&#xA;17     q         0.55&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Method 2&lt;/strong&gt;: Find the rank and pick top 10:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sharpe_ranks &amp;lt;- rank( mydata$sharpe_ratio )&#xA;mydata[ sharpe_ranks[ sharpe_ranks&amp;gt;(length(sharpe_ranks)-10) ] ,]&#xA;   scrip sharpe_ratio&#xA;17     q         0.55&#xA;18     r         0.60&#xA;19     s         0.65&#xA;20     t         0.70&#xA;21     u         0.75&#xA;22     v         0.80&#xA;23     w         0.85&#xA;24     x         0.90&#xA;25     y         0.95&#xA;26     z         1.00&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="22333" LastActivityDate="2016-09-19T05:04:56.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30208" PostTypeId="1" AcceptedAnswerId="31228" CreationDate="2016-09-19T10:07:10.543" Score="3" ViewCount="1900" Body="&lt;p&gt;In most Banks, the Traders are provided with ATM Implied vols across different Swaption Expiry's and  different Underlying Swap Maturities.(The ATM Implied Vol Cube)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the trader wants to trade an OTM or ITM Swaption, how would he actually go about pricing the Trade with the ATM Vol Surface he has been provided along with the different analytical tools he will have at his disposal?&lt;/p&gt;&#xA;" OwnerUserId="20162" LastActivityDate="2016-11-28T12:51:53.337" Title="Swaption Trading" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;swaps&gt;&lt;interest-rate-swap&gt;&lt;swaption&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30210" PostTypeId="1" CreationDate="2016-09-19T13:16:19.467" Score="8" ViewCount="896" Body="&lt;p&gt;An American Call Option on an non dividend paying stock has the same value as a european one. I tired to compare the results given by the LSM with the results given by the B&amp;amp;S formular.&#xA;It seems like LSM is really bad for valuing american call options. It always overestimate the value by 5-20%. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But why is the algorithm so bad for call options and so good for put options ?&#xA;Are there some studies concerning this problem ?&lt;/p&gt;&#xA;" OwnerUserId="24478" LastActivityDate="2016-09-21T11:49:06.640" Title="Least Square Monte Carlo - american Call Option" Tags="&lt;monte-carlo&gt;&lt;american-options&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30211" PostTypeId="2" ParentId="30210" CreationDate="2016-09-19T13:33:48.820" Score="8" Body="&lt;p&gt;If implemented properly, least-squares Monte Carlo as originally suggested by Longstaff-Schwartz should allow you to identify &lt;em&gt;sub&lt;/em&gt;-optimal exercise dates and a &lt;strong&gt;lower bound&lt;/strong&gt; of the true option price. There are many articles out there discussing this non trivial topic. @MarkJoshi can probably shed some more light, see this nice &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2415594&quot; rel=&quot;noreferrer&quot;&gt;paper&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You claim that your LSM procedure overestimates the true option price: I guess that you did not use 2 independent set of paths i.e. one for calibrating the exercise boundary through regressions and a separate one for determining the exercise dates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the precision of $5\%-20\%$, IMHO you must have a problem with your implementation. However, it is difficult to say anything more concerning your precision issue since you don't provide all the details: How many paths do you simulate and under what working modelling assumption, did you only use ITM paths during the regression pass, what type of basis functions did you choose and how many of them etc.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-09-20T09:53:35.257" LastActivityDate="2016-09-20T09:53:35.257" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="30212" PostTypeId="2" ParentId="25472" CreationDate="2016-09-19T18:28:52.697" Score="1" Body="&lt;p&gt;The logic behind cumulative P&amp;amp;L is pure scholar's.  Follow it and you loss everything. Take spreadsheet and simulate reality of every day trade step by step (strongly recommend include fees) and find out difference!&#xA;There is a lot of examples, a lot of discussions based on this &quot;unverified?&quot; assumption.&#xA;Use your mind and check what it is written on Internet.&lt;/p&gt;&#xA;" OwnerUserId="24481" LastActivityDate="2016-09-19T18:28:52.697" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30213" PostTypeId="1" AcceptedAnswerId="30216" CreationDate="2016-09-19T22:07:35.740" Score="8" ViewCount="6651" Body="&lt;p&gt;Using the Ornstein–Uhlenbeck process, I want to prove the half life formula for AR(1) is $$\text{HL}=-\log\left(\frac{2}{ \lambda}\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have Ornstein–Uhlenbeck process defined as &#xA;$$dx_t=\theta(\mu-x_t)dt+\sigma dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and AR(1) as&#xA;$$\Delta X_n=\mu+\lambda X_{n-1}+\sigma \varepsilon_n\quad,\quad n\geq 1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am analyzing &lt;a href=&quot;http://www.risklatte.com/Articles/QuantitativeFinance/QF205.php&quot; rel=&quot;noreferrer&quot;&gt;this derivation&lt;/a&gt;. I understand the  steps. The calculated half life for the OU is &#xA;$$T_{1/2}=\frac{\ln(2)}{\theta}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have some difficulties in translating this into the corresponding AR(1) half life. My understanding is that if $dt=1$ then discretized OU model takes form of AR(1). Is this correct? Can anybody clarify the link between those two and the half life adjustment for AR(1)? Do we just replace the $\theta$ for $\lambda$ in the final formula? what would be the explanation? How about the minus sign?&lt;/p&gt;&#xA;" OwnerUserId="18670" LastEditorDisplayName="user16651" LastEditDate="2016-09-20T11:25:36.687" LastActivityDate="2016-09-20T11:25:36.687" Title="How to find the formula for the half-life of an AR(1) process (using the Ornstein–Uhlenbeck process)" Tags="&lt;time-series&gt;&lt;stochastic-processes&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="30214" PostTypeId="1" CreationDate="2016-09-20T03:42:20.223" Score="0" ViewCount="94" Body="&lt;p&gt;If I have an option that has a net credit and results in a positive expected value (based on my own estimates of volatility), how do I calculate an ROI in order to compare with a net debit credit options?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Option 1: Net Credit +5 EV +1&lt;/li&gt;&#xA;&lt;li&gt;Option 2: Net Debit -1 EV +10&lt;/li&gt;&#xA;&lt;li&gt;Option 3: Net Credit +5 EV -1&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Is there another metric that is better equipped to make the comparison between these? Is there information that is missing that is needed to make this comparison?&lt;/p&gt;&#xA;" OwnerUserId="2343" LastEditorUserId="467" LastEditDate="2016-11-20T15:43:17.980" LastActivityDate="2017-05-19T20:12:29.170" Title="How to calculate ROI on a net credit option transaction?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;american-options&gt;&lt;option-strategies&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30215" PostTypeId="1" CreationDate="2016-09-20T07:33:32.480" Score="0" ViewCount="413" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;For a single future contract, I can calc the expected daily move (or rent) by using the following formula:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;      Rent = [Future Price * Implied Volatility / SQRT (252)]&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I am looking for doing the same thing for the daily expected move of a spread between two futures contract (a spread can be negative which makes the exercise harder)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Input I have are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Future 1 Price = 66.50 ; Future 2 = 67.00&#xA;&#xA;Implied Future 1 = 0.23 ; Implied Future 2 = 0.22&#xA;&#xA;Correlation Future 1/Future 2 = 0.9850&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Thank you for your help.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I am looking for calculating the expected move (rent) of the the spread b/w the two Fut (using the  IV of the spread b/w the two Fut). Thank you for your help.&lt;/p&gt;&#xA;" OwnerUserId="24400" LastEditorUserId="467" LastEditDate="2016-11-22T06:25:23.957" LastActivityDate="2018-04-16T19:58:31.103" Title="How to calculate the implied daily move of a spread between two futures contracts?" Tags="&lt;implied-volatility&gt;&lt;historical-data&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30216" PostTypeId="2" ParentId="30213" CreationDate="2016-09-20T08:12:25.657" Score="9" Body="&lt;h2&gt;Convenient rewriting&lt;/h2&gt;&#xA;&lt;p&gt;Let &lt;span class=&quot;math-container&quot;&gt;$$X_t = c + \phi_1 X_{t-1} + \epsilon_t, \quad \vert \phi_1 \vert &amp;lt; 1 \tag{1} $$&lt;/span&gt;&#xA;denote a &lt;em&gt;weakly stationary&lt;/em&gt; AR(1) process. Weak stationarity notably implies that &lt;span class=&quot;math-container&quot;&gt;$$\Bbb{E}[X_t] = \mu = \text{constant}$$&lt;/span&gt; for all &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt;. This property may be used (simply take the expectation on both sides of equation &lt;span class=&quot;math-container&quot;&gt;$(1)$&lt;/span&gt;), to find that the stationary mean &lt;span class=&quot;math-container&quot;&gt;$\mu$&lt;/span&gt; computes as&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \mu = \frac{c}{1-\phi_1} $$&lt;/span&gt;&#xA;which allows one to write (just replace &lt;span class=&quot;math-container&quot;&gt;$c$&lt;/span&gt; in &lt;span class=&quot;math-container&quot;&gt;$(1)$&lt;/span&gt; given the above identity)&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ X_t - \mu = \phi_1(X_{t-1}-\mu) + \epsilon_t $$&lt;/span&gt;&#xA;or&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ Y_t = \phi_1 Y_{t-1} + \epsilon_t \tag{2} $$&lt;/span&gt;&#xA;where &lt;span class=&quot;math-container&quot;&gt;$Y_t = X_t - \Bbb{E}[X_t] $&lt;/span&gt; may be interpreted as the &lt;em&gt;distance to the stationary mean&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;h2&gt;Half-life&lt;/h2&gt;&#xA;&lt;p&gt;The current distance to the stationary mean is &lt;span class=&quot;math-container&quot;&gt;$Y_t$&lt;/span&gt;. When looking for the half-life, by definition we are looking for the time &lt;span class=&quot;math-container&quot;&gt;$t+h$&lt;/span&gt; where the process is expected to halve its distance to the stationary mean, i.e. &lt;span class=&quot;math-container&quot;&gt;$h$&lt;/span&gt; such that&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \Bbb{E}_t [Y_{t+h}] = \frac{1}{2} Y_t $$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;A simple examination of equation &lt;span class=&quot;math-container&quot;&gt;$(2)$&lt;/span&gt; shows that &lt;span class=&quot;math-container&quot;&gt;$\Bbb{E}_t [Y_{t+h}] = \phi_1^h Y_t $&lt;/span&gt; which leads to&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \phi_1^h Y_t = \frac{1}{2} Y_t $$&lt;/span&gt;&#xA;hence&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ h = -\frac{\ln(2)}{\ln(\vert{\phi_1\vert})} $$&lt;/span&gt;&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-09-20T08:12:25.657" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30217" PostTypeId="2" ParentId="27729" CreationDate="2016-09-20T08:47:07.190" Score="3" Body="&lt;p&gt;Actually the problem is that the probability of default the second year is conditioned by the default the first year. So you have to multiply 4%*101.21*99%, because 1% of the times it has already defaulted the first year&lt;/p&gt;&#xA;" OwnerUserId="24487" LastActivityDate="2016-09-20T08:47:07.190" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30218" PostTypeId="1" CreationDate="2016-09-20T09:05:26.403" Score="5" ViewCount="684" Body="&lt;p&gt;I know that this is probably the most asked question in finance but I still can’t get my head around how everything belongs together (risk neutral measure, risk neutral word,real word, arbitrage). Especially in the continuous time. Why can I price any option (even American) in a risk neutral world under the risk neutral measure? Why can I assume that I can model the underlying stock price with the risk free rate?  And why can I only do this when pricing option? What about stock pricing in the risk neutral world? &lt;/p&gt;&#xA;" OwnerUserId="24478" LastEditorDisplayName="user16651" LastEditDate="2016-09-20T11:46:53.080" LastActivityDate="2017-04-20T14:33:22.760" Title="Still confused : risk neutral measure/world" Tags="&lt;option-pricing&gt;&lt;risk-neutral-measure&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30219" PostTypeId="2" ParentId="30218" CreationDate="2016-09-20T09:46:07.950" Score="3" Body="&lt;p&gt;I have an answer (no mathematics!) in &lt;a href=&quot;https://quant.stackexchange.com/questions/28352/about-the-definition-of-a-complete-market/28355#28355&quot;&gt;About the definition of a complete market&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, risk neutral is an abstract concept that relates no-arbitrage and hedging. In quantitative finance, if you can show how you can hedge an instrument (eg: option) via the no-arbitrage argument, you can price it. To understand why you'd need risk neutral, you should start from the discrete model (it's in my answer). &lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-09-20T09:51:33.070" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30220" PostTypeId="1" CreationDate="2016-09-20T10:21:14.727" Score="3" ViewCount="196" Body="&lt;p&gt;In the context of optimal portfolio allocation, I am looking for a (possibly exhaustive) list of risk-averse utility functions verifying part of the so-called Inada conditions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially, I am looking for functions $$U : \mathcal{D}=[0,\infty) \to \Bbb{R} $$ verifying $$\frac{\partial U}{\partial x}(x) &amp;gt; 0\quad, \quad \forall x \in \mathcal{D}$$ $$\frac{\partial^2 U}{\partial x^2}(x) &amp;lt; 0\quad,\quad \forall x \in \mathcal{D} $$ $$\quad \lim_{x \to 0^+} \frac{\partial U}{\partial x}(x) \,\,\,= +\infty $$ $$ \lim_{x \to +\infty} \frac{\partial U}{\partial x}(x) = 0 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could easily come up with the famous family of isoelastic utility functions (CRRA) among which power utility and the logarithmic utility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I was wondering whether there existed any other well known instances of such functions. I would be glad if someone could point me towards an answer or a rigorous approach for finding them.&lt;/p&gt;&#xA;" OwnerUserId="24489" LastEditorDisplayName="user16651" LastEditDate="2016-09-20T11:44:32.093" LastActivityDate="2016-09-22T19:15:31.480" Title="List of risk-averse utility functions" Tags="&lt;risk&gt;&lt;modern-portfolio-theory&gt;&lt;utility-theory&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30223" PostTypeId="2" ParentId="30218" CreationDate="2016-09-20T12:57:08.923" Score="2" Body="&lt;p&gt;For hedging purpose and when you are a bank (i.e. you are not supposed to take inventory risk), the risk neutral measure has nice properties&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;it is built using market prices: as soon as an instrument that can lower your exposure (i.e. can be used to sell your hedging book) is available on the market, you can do it with no bad surprise on your hedging costs. This is really valuable: &lt;strong&gt;the capability to net your risk in the market is priced when you use the risk neutral measure&lt;/strong&gt;. &lt;/li&gt;&#xA;&lt;li&gt;if you hedge continuously (and if all the market dynamics singularities are in you model --I mean, if you use a semi martingale--) it is equivalent to hedging using any other &quot;more realistic&quot; measure... Is it a good news ;) ?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You seem surprise the trend term is no more present under the risk neutral measure. If it really shocks you, just imagine you put its realizations in the Brownian term. Applied mathematicians persist in naming this term a Brownian or a &quot;noise term&quot;, but economists call it the &quot;&lt;strong&gt;innovation&lt;/strong&gt;&quot;. In this case it can help you to see the Brownian term (and the jump one if any) under the risk neutral measure like economists see it: &lt;em&gt;all that is unexpected&lt;/em&gt;. And for sure a deterministic trend that can be expected at $t$ (i.e. that belongs to ${\cal F}_t$) is unrealistic. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course a good point would be: &quot;&lt;em&gt;ok but I know how to predict the trend&lt;/em&gt;&quot;. If it is the case you should go in an hedge fund, not in a bank. The role of a bank is not to take this kind of risks on an inventory that can be as huge as their hedging books. They would have to put an incredible amount of capital in front of this risk; it is not worth to do that.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2016-09-20T12:57:08.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30224" PostTypeId="2" ParentId="27702" CreationDate="2016-09-20T15:34:39.140" Score="0" Body="&lt;p&gt;Theta is a position's sensitivity to a small change in time to maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You just simply would see what happens to the bond when you go one day ahead.&lt;/p&gt;&#xA;" OwnerUserId="24492" LastActivityDate="2016-09-20T15:34:39.140" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30226" PostTypeId="1" AcceptedAnswerId="30238" CreationDate="2016-09-20T21:17:46.523" Score="0" ViewCount="141" Body="&lt;p&gt;I have a spreadsheet with a large number of ticker symbols. Is there any site that can get the current or past (either works) price for each of these stocks in one fell swoop? Paste in the list of stock ticker symbols, and receive a list of their current or past prices as an output. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Doing them one by one would take an eternity in my case, and creating a web scraper is something I'm hoping to avoid if a site out there already has this capability.&lt;/p&gt;&#xA;" OwnerUserId="24495" LastEditorUserId="24495" LastEditDate="2016-09-20T21:58:38.157" LastActivityDate="2016-10-13T21:15:18.660" Title="Obtain prices for list of stocks" Tags="&lt;equities&gt;&lt;data&gt;&lt;market-data&gt;&lt;historical-data&gt;&lt;tick-data&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30228" PostTypeId="2" ParentId="30214" CreationDate="2016-09-20T23:42:40.213" Score="1" Body="&lt;p&gt;To calculate ROI of an option(s) sold for a credit you divide the credit received by margin you must maintain to carry that position.Then do not forget to annualize that number.&lt;/p&gt;&#xA;" OwnerUserId="7973" LastActivityDate="2016-09-20T23:42:40.213" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30229" PostTypeId="1" CreationDate="2016-09-21T04:34:55.330" Score="1" ViewCount="113" Body="&lt;p&gt;How can a day trader figure out what event might have triggered a sudden spike in volume that occurs after hours?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example: a quarter past midnight (NYSE time), the ES Dec 2016 future is crawling slowly... then suddenly, THIS:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/KVqwY.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/KVqwY.png&quot; alt=&quot;Volume spike&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a volume of zero, to a volume of 1000 in 5 seconds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that ES futures volume picks up after midnight, but this occured 15 minutes later, and the general question is,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Where can one find rapid-fire market news after hours?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some Twitter account perhaps? Traders' chatrooms?&lt;/p&gt;&#xA;" OwnerUserId="4848" LastEditorUserId="4848" LastEditDate="2016-09-21T04:57:12.787" LastActivityDate="2016-09-21T06:17:44.460" Title="What just happened in the market?" Tags="&lt;market&gt;&lt;news&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30230" PostTypeId="2" ParentId="30229" CreationDate="2016-09-21T06:17:44.460" Score="5" Body="&lt;p&gt;What happened was the BoJ announcement. Such large scale news are well covered in mainstream media (ft, bloomberg, etc) and also mainstream anti-media (eg zerohedge). &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-09-21T06:17:44.460" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30231" PostTypeId="1" AcceptedAnswerId="30232" CreationDate="2016-09-21T08:19:06.243" Score="5" ViewCount="4852" Body="&lt;p&gt;Is there an equation or rule of thumb to determine the probility of default for a loan with a specific interest rate?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say, a bank offers a company a loan with an interest rate of 6%, by which they assume the change of default is X.&lt;/p&gt;&#xA;" OwnerUserId="24497" LastEditorUserId="24497" LastEditDate="2016-10-04T13:24:26.147" LastActivityDate="2016-10-04T18:22:03.293" Title="Interest rate implied probability of default" Tags="&lt;default-probability&gt;&lt;interest&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30232" PostTypeId="2" ParentId="30231" CreationDate="2016-09-21T08:53:42.543" Score="9" Body="&lt;p&gt;You can use the &quot;credit triangle&quot; which states that the (annualised) credit spread $S$ equals the annualised probability of default $p$ times the loss given default LGD which equals par minus the expected recovery amount $R$, i.e. $S=p(1-R)$. This is a &quot;back-of-the-envelope&quot; approximation to a full hazard rate credit model - from experience I find that the percentage error is usually less than 5%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The credit spread $S$ can be obtained by subtracting the default-free rate from the loan interest rate. The default-free rate is the yield of a par government bond with a similar maturity to the loan. You may also subtract the impact of administration fees and other fees if you know what they are.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The expected recovery rate can be obtained from rating agencies default and recovery statistics for loans. This will depend on whether the loan is secured or unsecured. For a specific loan you can take into account the value of any collateral pledged to the bank by the borrower.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you have $S$ and $R$ you can solve for $p=S/(1-R)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me give an example. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose loan interest rate is 6% and the risk free rate is 1%. In this case $S=0.05$. Assume that $R = 0.4$. In this case $p=0.05/(1-0.4)=0.05/0.6=8.33\%$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the annualised implied probability of default is 8.33%. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So suppose you had 100 loans similar to this one. You would be in profit if 8 or fewer defaulted. More than 8 defaults would result in a loss. Let us check this. Assume $1m per loan.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;8 defaults: Loss is \$1m x 8 x 0.60 = \$4.8m. Interest received = \$100m x 5% = \$5m.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;9 defaults: Loss is \$1m x 9 x 0.60 = \$5.4m. Interest received = \$100m x 5% = \$5m.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With 9 defaults we lose more than we get in interest.....&lt;/p&gt;&#xA;" OwnerUserId="12240" LastEditorUserId="24497" LastEditDate="2016-10-04T18:22:03.293" LastActivityDate="2016-10-04T18:22:03.293" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30235" PostTypeId="2" ParentId="30210" CreationDate="2016-09-21T11:49:06.640" Score="0" Body="&lt;p&gt;Maybe I have something wrong with my calculation. But this is not my whole point. &#xA;When calculating the value of an American put I totally understand why the LSM algorithms underestimates the value. Mainly because I only have an estimated conditional expectation function.&#xA;But with Call option I don’t understand why the algorithms also have to underestimate the value. For me it makes total sense that the LSM approach overestimates the value. Again I only have an estimate of the conditional expectation function. So there can happen two things. Either the LSM algorithms determines that early exercise is favourable. Then the value has to be higher than the European value (overestimation). Or the LSM algorithm determines that early exercise is disadvantageous. Then the value must be exactly the same.&lt;/p&gt;&#xA;" OwnerUserId="24478" LastActivityDate="2016-09-21T11:49:06.640" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30236" PostTypeId="2" ParentId="30204" CreationDate="2016-09-21T12:17:34.920" Score="0" Body="&lt;p&gt;Can't take credit for this but Stuart Reid over at Turing Finance (great resource) has a great &lt;a href=&quot;http://www.turingfinance.com/random-walks-down-wall-street-stochastic-processes-in-python&quot; rel=&quot;nofollow&quot;&gt;post&lt;/a&gt; and &lt;a href=&quot;http://nbviewer.jupyter.org/github/StuartGordonReid/Python-Notebooks/blob/master/Stochastic%20Process%20Algorithms.ipynb&quot; rel=&quot;nofollow&quot;&gt;notebook&lt;/a&gt; on this. Might give you a good starting point.&lt;/p&gt;&#xA;" OwnerUserId="24503" LastActivityDate="2016-09-21T12:17:34.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30238" PostTypeId="2" ParentId="30226" CreationDate="2016-09-21T12:55:24.260" Score="3" Body="&lt;p&gt;I would highly suggest Quandl as a great place to start: &lt;a href=&quot;https://www.quandl.com/tools/excel&quot; rel=&quot;nofollow&quot;&gt;https://www.quandl.com/tools/excel&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has a lot capabilities for stock look ups and works really well once you've gained some familiarities with it. Can really build out a powerful sheet if you don't need tick data or anything like that.&lt;/p&gt;&#xA;" OwnerUserId="24503" LastActivityDate="2016-09-21T12:55:24.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30239" PostTypeId="2" ParentId="30215" CreationDate="2016-09-21T12:55:30.583" Score="0" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;For the daily move you should take the square root of a single day:&#xA;$$\text{Rent} = \text{Future Price}\times \text{Implied Volatility }\times \sqrt{\frac{1}{252}}$$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$$\text{Spread} = \text{Fut1IV} - \text{Fut2IV} $$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Regarding your question, are you wanting to calculate the spread between the two Fut IV or the IV of the spread b/w the two Fut? &lt;/p&gt;&#xA;" OwnerUserId="24505" LastEditorDisplayName="user16651" LastEditDate="2016-09-22T08:35:17.980" LastActivityDate="2016-09-22T08:35:17.980" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30240" PostTypeId="2" ParentId="30226" CreationDate="2016-09-21T13:07:00.147" Score="1" Body="&lt;p&gt;GoogleSheets can query multiple stock data also. Using the built-in functions you can query open, high, low, close prices for a particular date range.&lt;/p&gt;&#xA;" OwnerUserId="24506" LastActivityDate="2016-09-21T13:07:00.147" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30243" PostTypeId="1" AcceptedAnswerId="30245" CreationDate="2016-09-21T19:42:49.070" Score="3" ViewCount="1945" Body="&lt;p&gt;Do vega and gamma always have the same sign (ie both positive or both negative)? Under what circumstances can they have opposite signs?&lt;/p&gt;&#xA;" OwnerUserId="11723" LastActivityDate="2016-09-21T21:41:31.987" Title="Vega and Gamma signs" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;gamma&gt;&lt;vega&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30244" PostTypeId="2" ParentId="30243" CreationDate="2016-09-21T20:13:05.543" Score="3" Body="&lt;p&gt;In the Black Scholes model, for an European option, we have &#xA;$$\text{Vega}=Ke^{-r\tau}\phi(d_2)\sqrt{\tau}$$&#xA;and&#xA;$$\Gamma=Ke^{-r\tau}\phi(d_2)\frac{1}{S^2\sigma\sqrt{\tau}}$$&#xA;thus&#xA;$$\frac{\text{Vega}}{\Gamma}=S^2\sigma{\tau}&amp;gt;0$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastActivityDate="2016-09-21T20:13:05.543" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30245" PostTypeId="2" ParentId="30243" CreationDate="2016-09-21T21:41:31.987" Score="4" Body="&lt;p&gt;Usually vega and gamma go in the same direction, but you can have opposite exposure in a calendar spread. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For an ATM option, vega decreases closer to maturity while gamma increases. If you implement the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-long a 1 month ATM option &lt;/p&gt;&#xA;&#xA;&lt;p&gt;-short a 2 months ATM option &lt;/p&gt;&#xA;&#xA;&lt;p&gt;you should be long gamma and short vega.&lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2016-09-21T21:41:31.987" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30246" PostTypeId="2" ParentId="30204" CreationDate="2016-09-22T00:58:53.367" Score="0" Body="&lt;p&gt;This post gives an overview of two methods to calibrate an OU process (least squares and max likelihood) and gives some code in Matlab. &lt;a href=&quot;https://www.sitmo.com/?p=134&quot; rel=&quot;nofollow&quot;&gt;https://www.sitmo.com/?p=134&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2016-09-22T00:58:53.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30247" PostTypeId="1" AcceptedAnswerId="30254" CreationDate="2016-09-22T02:46:16.967" Score="0" ViewCount="1164" Body="&lt;p&gt;What is the proper way to calculate volatility for the long short portfolio?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if calculated in a standard way the offsetting positions are driving it down. &lt;br&gt;&#xA;How about Sharpe Ratio? that has an impact on the SR either&lt;/p&gt;&#xA;" OwnerUserId="18670" LastActivityDate="2016-09-22T13:39:10.607" Title="volatilty and Sharpe Ratio of long-short portfolio" Tags="&lt;volatility&gt;&lt;sharpe-ratio&gt;&lt;longshort&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30248" PostTypeId="1" AcceptedAnswerId="30249" CreationDate="2016-09-22T04:37:07.497" Score="1" ViewCount="118" Body="&lt;p&gt;A utility function $U$ whose corresponding relative risk aversion function is a linear, increasing function satisfies the differential equation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$-x\frac{U''(x)}{U'(x)}=ax+b$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for some constants $a&amp;gt;o$ and $b\in \mathbf{R}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Show that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$U(x)=c \int _0 ^x t^{-b}e^{-at} dt$$ where $c&amp;gt;0$ is an arbitrary constant.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I massaged the equation so it becomes friendly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$-x \frac{d^2U}{dx^2}=(ax+b)\frac{dU}{dx}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Letting $\frac{dU}{dx}=v$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$-x \frac{dv}{dx}=(ax+b)v$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$x \frac{dv}{dx}+axv=-bv$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.F&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$e^{\int (ax) dx}=e^{a\frac{x^2}{2}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\therefore ve^{a\frac{x^2}{2}}=b\int e^{a\frac{x^2}{2}} dx$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\therefore ve^{a\frac{x^2}{2}}=ba^2x  e^{a\frac{x^2}{2}}+C$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$v=ba^2x+Ce^{-a\frac{x^2}{2}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{dU}{dx}=ba^2x+Ce^{-a\frac{x^2}{2}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$u=ba^2\frac{x^2}{2}+C\int e^{-a\frac{x^2}{2}} dx$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the answer is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$U(x)=c\int^c_0 t^{-b}e^{-at}dt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I cannot understand where the $t$ comes to sit in the equation.&lt;/p&gt;&#xA;" OwnerUserId="24518" LastEditorUserId="24518" LastEditDate="2016-09-22T05:57:42.193" LastActivityDate="2017-04-20T09:33:57.270" Title="Differentiating risk aversion based on utility theory" Tags="&lt;risk&gt;&lt;utility-theory&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30249" PostTypeId="2" ParentId="30248" CreationDate="2016-09-22T06:13:37.957" Score="2" Body="&lt;p&gt;$$-x \frac{d^2U}{dx^2}=(ax+b)\frac{dU}{dx}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Letting $\frac{dU}{dx}=v$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$-x \frac{dv}{dx}=(ax+b)v$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rearranging&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$-\frac{1}{v} dv=\left(a+\frac{b}{x}\right)dx$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ -\int(\ln{v}) dv= \int \left(a+\frac{b}{x}\right) dx $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ v=C e^{-ax}x^b$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $C$ is a constant. By taking $t$ as a dummy variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$U(x)= C\int ^x_0e^{-at}t^{-b}\, dt$$&lt;/p&gt;&#xA;" OwnerUserId="24518" LastEditorDisplayName="user16651" LastEditDate="2016-09-22T06:27:28.517" LastActivityDate="2016-09-22T06:27:28.517" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30251" PostTypeId="1" CreationDate="2016-09-22T07:03:35.507" Score="1" ViewCount="74" Body="&lt;p&gt;Usually, American options can only be priced numerically. An important exception is the perpetual option, i.e. an American option with infinite maturity. Most mathematical finance textbooks treat this case. However, it is always assumed that the underlying is performing a geometric Brownian motion. I am looking for something simpler, namely the case when the underlying is performing a pure random walk. Does anyone know where I can find the corresponding formula? (I want it in the continuous, not discrete case). &lt;/p&gt;&#xA;" OwnerUserId="16950" LastActivityDate="2016-09-22T07:03:35.507" Title="Perpetual American option price under pure random walk" Tags="&lt;american-options&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30254" PostTypeId="2" ParentId="30247" CreationDate="2016-09-22T12:35:34.723" Score="1" Body="&lt;p&gt;You calculate them the same way that you would for any other pnl stream. First calculate the excess returns, i.e. the P&amp;amp;L after accounting for financing (for a long-short portfolio, your financing includes the difference between the rates at which you can borrow and lend cash, as well as any fees for shorting particular instruments) divided by your risk capital.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the volatility is the standard deviation of your excess returns, multiplied by the appropriate annualizing factor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your Sharpe ratio is the average annualized return, divided by the annualized volatility.&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2016-09-22T12:35:34.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30255" PostTypeId="2" ParentId="30247" CreationDate="2016-09-22T13:39:10.607" Score="1" Body="&lt;p&gt;You can either estimate volatility based on gross exposure or NAV. Usually you estimate it on gross and then use your leverage to estimate NAV volatility. Sharpe ratio is not impacted by leverage - returns and volatility should both be estimated on the same basis (NAV/gross) so they cancel out.&lt;/p&gt;&#xA;" OwnerDisplayName="user18489" LastActivityDate="2016-09-22T13:39:10.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30258" PostTypeId="1" CreationDate="2016-09-22T17:12:55.933" Score="6" ViewCount="13622" Body="&lt;p&gt;I'm looking for an intuitive explanation of how to understand the 'price'/trade spread of a CDS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking say at a current CDS on Santander, the index states that it is currently at 132. As I understand it, this is the trade spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also understand that the 100bp coupon gets paid quarterly (i.e. 25k per quarter).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the actual price I would have to pay today to own this CDS? This is the bit I am not understanding. How does a value of 132 translate into a price? (I originally thought that 132bp * notional would be the price?)&lt;/p&gt;&#xA;" OwnerUserId="20531" LastActivityDate="2016-09-25T09:43:43.303" Title="How to interpret the 'price' of a CDS?" Tags="&lt;credit-derivatives&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="30259" PostTypeId="2" ParentId="30258" CreationDate="2016-09-22T18:34:55.450" Score="6" Body="&lt;p&gt;A spread of 132 means that buying the protection will cost you 132 bps per year up to the default or the maturity with no upfront.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because of standardisation of the coupons, there is an upfront.&#xA;So if the spread is 132 and if the coupon is 100bps, and if you buy protection you will pay something upfront because 132bps is what you should have paid per year to buy the protection with no upfront.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-09-22T18:34:55.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30260" PostTypeId="2" ParentId="30220" CreationDate="2016-09-22T19:15:31.480" Score="1" Body="&lt;p&gt;What do you mean by &quot;rigorous approach for finding them&quot;? You have the four conditions and every function which fulfills those conditions is a risk-averse utility function. This is all there is; what else do you need? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are looking for a description of this set in terms of elementary functions (+,.,polynomials, exp and such) you will be disappointed. The set of functions fulfilling these four requirements is HUGE and will contain vast amounts of functions which cannot be described in these terms. The easiest way to see this is to write the utility functions as double integrals. As you might know most integrals cannot be explicitly solved in terms of elementary functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, your desire for explicit representations sounds a bit fishy to me. From the perspective of modelling economic reality, all economic content is contained in those four conditions. If you restrict the utility functions further, e.g. by only looking at CRRA, you add further constraints. These constraints need to be justified by economic reasons, otherwise the conclusions you draw from using restricted utility functions are not based on economics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From this perspective working with stochastic dominance is much better since you reason about large classes of utility functions and not only about artificially restricted families (such as power or exponential utility). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, people often include the full &lt;a href=&quot;https://en.wikipedia.org/wiki/Hyperbolic_absolute_risk_aversion&quot; rel=&quot;nofollow&quot;&gt;HARA&lt;/a&gt; class in their discussions.&lt;/p&gt;&#xA;" OwnerUserId="482" LastActivityDate="2016-09-22T19:15:31.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30261" PostTypeId="2" ParentId="27702" CreationDate="2016-09-22T20:11:00.767" Score="2" Body="&lt;p&gt;To answer that question you first have to define what &lt;em&gt;&quot;no change other than the passage of time&quot;&lt;/em&gt; means. So you could make one of the following &lt;em&gt;&quot;no change&quot;&lt;/em&gt; assumptions.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the shape of the term structure will remain unchanged.&lt;/li&gt;&#xA;&lt;li&gt;assumption of realized forwards.&lt;/li&gt;&#xA;&lt;li&gt;assumption that some other hypothesized scenario will realize.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Based on one of those assumptions you can then reprice the bond based on what you think the price of the bond will be at some point in the future in order to gauge the effect of time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is somewhat unusual to use the term theta in the context of a bond or a bond portfolio however. It would be more appropriate to focus such a discussion around the components of return. I think what you are referring to is carry-roll-down or roll-yield.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For an overview of the subject see &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470891696&quot; rel=&quot;nofollow&quot;&gt;Fixed Income Securities: Tools for Today's Markets 3rd Edition&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="15457" LastActivityDate="2016-09-22T20:11:00.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30263" PostTypeId="2" ParentId="30258" CreationDate="2016-09-22T21:28:06.483" Score="12" Body="&lt;p&gt;A CDS is a contract with a protection leg that pays (100%-Recovery) immediately following a credit event if it happens before maturity, and a premium leg in which a coupon of 100 bps is paid until a credit event or maturity. Hence the value of $1 a short protection (receiving spread) contract is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;V =  100 bps x PV of $1 per year paid to sooner of a credit event or maturity - Protection Leg PV&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We call the PV of $1 per year paid to a credit event or maturity, whichever occurs sooner, the risky PV01 or RPV01 for short.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The CDS par spread is the spread that would make the value of the contract with the same maturity equal to zero right now. In your example this is 132 basis points. So we can write&lt;/p&gt;&#xA;&#xA;&lt;p&gt;0 =  132 bps x RPV01 - Protection Leg PV&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value of the Protection leg is therefore&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Protection Leg PV =  132 bps x RPV01&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is the same protection leg as in V. Substituting this into V we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;V =  (100  - 132 ) bps x RPV01 &#xA;  =  - 32 bps x RPV01&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is negative because we are receiving 100bps to assume a risk for which we should be receiving 132bps. The 132bps is a measure of the credit risk of the CDS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To compensate us for the fact that the contract has a negative value we must be paid an upfront amount equal to &lt;/p&gt;&#xA;&#xA;&lt;p&gt;U =  32 bps x RPV01&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to get us to enter into it. We then put this cash into our cash account. The derivative has the opposite sign so its value offsets this cash amount and so we have not made anything on Day 1.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the RPV01, this is calculated using a model that extracts the probability of default from CDS spreads. But it is close to the PV of \$1 per year for the remaining life of the CDS and so for a 5 year CDS expect it to be 4-4.5. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A simple model for the value of a short protection CDS can be found if you write &lt;/p&gt;&#xA;&#xA;&lt;p&gt;V = (C-S) x RPV01 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;/p&gt;&#xA;&#xA;&lt;p&gt;RPV01 = $\left (1-\exp\left(-gT\right)\right)/g$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and $C$ is the coupon, $S$ is the par CDS spread, $T$ is the remaining life in years and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$g=r+S/(1-R)$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $r$ is the risk-free (Libor) rate and $R$ is the expected recovery rate, usually set to 40%. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I set $r=0.02$ and $T=5$ for a notional of \$10m then I get $V$ equal to -\$144,317. So to enter into this contract I would receive an upfront payment of \$144,317.&lt;/p&gt;&#xA;" OwnerUserId="12240" LastEditorUserId="12240" LastEditDate="2016-09-25T09:43:43.303" LastActivityDate="2016-09-25T09:43:43.303" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30266" PostTypeId="2" ParentId="17948" CreationDate="2016-09-23T06:03:09.737" Score="1" Body="&lt;p&gt;I am assuming the probability of gaining an amount  $x$ is $p$. Then the probability of losing an amount $y$ is $1-p$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E[U(W)]=pU(100+x)+(1-p)U(100-y)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$=p\log{(100+x)}+(1-p)\log{(100-y)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$=p\log{(\frac{100+x}{100-y})}-\log{(100-y)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It should resemble something like that. I just gave you an overview, because I think a lot of details are missing in your question, never mind because you are new to this as you said. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to start a problem like this, you need a table&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{array}{c|lcr}&#xA;probabilty &amp;amp; \text{Gain} &amp;amp; \text{$W_0+x$} &amp;amp; \text{$U(W_0+x)$} \\&#xA;\hline&#xA;p &amp;amp; x &amp;amp; 100+x &amp;amp; \log({100+x}) \\&#xA;1-p &amp;amp; -y &amp;amp; 100-y &amp;amp; \log({100-y}) \\&#xA;\end{array}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your table could contain more probabilities depending on the question, but the sum of the probabilities must be equal to $1$.&lt;/p&gt;&#xA;" OwnerUserId="24518" LastActivityDate="2016-09-23T06:03:09.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30268" PostTypeId="1" CreationDate="2016-09-23T09:30:57.523" Score="1" ViewCount="231" Body="&lt;p&gt;The paper &lt;a href=&quot;ftp://publications.ai.mit.edu/ai-publications/2001/AIM-2001-005.pdf&quot; rel=&quot;nofollow&quot;&gt;An Electronic Market-Maker&lt;/a&gt; define the market order imbalance as follows:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We will define the order imbalance as the total excess demand size&#xA;  since the last change of quote by the market maker.  Suppose there are&#xA;  $x$ buy orders and $y$ sell orders of one share at the current quoted&#xA;  price; the order imbalance is $x - y$. (p. 15)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;An issue with the above definition is that the slightest update of the quote sets the imbalance back to $0$ and forgets all previous order information.  However it makes sense that if we make a large jump in our quoted prices that we will want to forget past now outdated information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any 'standard' ways to define an order imbalance process that captures this information i.e. some exponential decay on previous orders that decays faster when there has been a large shift in prices?&lt;/p&gt;&#xA;" OwnerUserId="6443" LastEditorDisplayName="user16651" LastEditDate="2016-09-23T15:40:06.660" LastActivityDate="2016-09-23T15:40:06.660" Title="Market imbalance measures for market making" Tags="&lt;market-making&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30270" PostTypeId="2" ParentId="29802" CreationDate="2016-09-23T14:30:45.527" Score="2" Body="&lt;p&gt;Just from the EDGAR SIC codes, it won't be possible to tell which are regulated to my knoweldge - this classification method specifically applies to companies by industry. The 4900-4999 is going to be your area of interest though:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/QQkmL.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/QQkmL.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="24503" LastActivityDate="2016-09-23T14:30:45.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30271" PostTypeId="1" CreationDate="2016-09-23T14:34:56.640" Score="10" ViewCount="6765" Body="&lt;p&gt;Say I wanted to buy an option on the CDX US HY Index (specifics here are irrelevant, but the point is that I'm looking for an option on a CDS Index).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What would be the pricing formula given inputs of spread vol, strike, time to maturity, etc?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If anyone could help, that would be great. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have had a look through &lt;a href=&quot;http://eu.wiley.com/WileyCDA/WileyTitle/productCd-0470519282.html&quot; rel=&quot;noreferrer&quot;&gt;Dominic O'Kane's book&lt;/a&gt; (2008) but haven't found an explicit reference. I'm looking to try and build this out in excel, so if anyone is able to show/refer to something done there that would be even more useful.&lt;/p&gt;&#xA;" OwnerUserId="20531" LastEditorUserId="12240" LastEditDate="2016-09-24T10:17:47.623" LastActivityDate="2017-05-18T19:05:07.940" Title="Formula to price a CDS Index Option?" Tags="&lt;option-pricing&gt;&lt;cds&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30273" PostTypeId="2" ParentId="30271" CreationDate="2016-09-23T17:45:44.920" Score="5" Body="&lt;p&gt;A good reference for the valuation of a CDS index option is the paper by &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1080064.&quot; rel=&quot;noreferrer&quot;&gt;Massimo Morini and Damiano Brigo&lt;/a&gt;, where they discussed the Bloomberg CDS index option valuation, which is based on Black's formula given the forward par index spread vol, strike, and time to maturity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The issue with this formula is that the numeraire, the &lt;em&gt;Index Defaultable Present Value per Basis Point&lt;/em&gt;, or the &lt;em&gt;forward PV01&lt;/em&gt;, can be zero with a positive probability, and, as a consequence, the swap measure is not equivalent to the risk-neutral probability measure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Morini and Brigo addressed the issues above, using a sub-filtration method, where they defined the so called no-Armageddon pricing measure that is equivalent to the risk-neutral probability measure, and consequently, they obtained an arbitrage-free option valuation.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-09-23T19:26:27.613" LastActivityDate="2016-09-23T19:26:27.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30274" PostTypeId="2" ParentId="30271" CreationDate="2016-09-23T21:42:42.070" Score="4" Body="&lt;p&gt;You will see a discussion of how to do this in O'Kane's book in section 11.7. It shows that you can adjust the forward CDS index spread in such a way that you can then use Black's swaption pricing formula set out in section 11.3.1. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will need to calculate a few extra terms to make these adjustments which are all set out. These will need you to extract the index survival probability curve from index spreads using a standard CDS valuation model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You then have to adjust the forward rate that you enter. To do so you must calculate the value of the front end protection (PV of a protection leg to the forward start date) and then amortise this over the life of the index swap by dividing by the forward period index risky PV01. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You also have to adjust the strike of the CDS index option. Once again this is explained in the text. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Table 11.2 gives some example values and shows that this model gives option prices which are very close to the full model described before this section.&lt;/p&gt;&#xA;" OwnerUserId="12240" LastEditorUserId="12240" LastEditDate="2016-09-24T17:28:58.040" LastActivityDate="2016-09-24T17:28:58.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30277" PostTypeId="2" ParentId="29849" CreationDate="2016-09-24T10:50:34.600" Score="2" Body="&lt;p&gt;Your second suggestion can be interpreted as an actual return, while the first one would be a hypothetical return, given you could keep making the same gains you did for those days over the entire 3 year period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Everything else depends on your assumptions. You can take &lt;code&gt;(actual days)/365&lt;/code&gt;, often used is &lt;code&gt;actual/360&lt;/code&gt; or even &lt;code&gt;actual/252&lt;/code&gt; if you only consider the number of trading days.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You know what you had and what you ended up with. Your interpretation of how well you did, or how high the return was, is up to the definition.&lt;/p&gt;&#xA;" OwnerUserId="24289" LastActivityDate="2016-09-24T10:50:34.600" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30278" PostTypeId="1" CreationDate="2016-09-24T11:34:01.393" Score="1" ViewCount="323" Body="&lt;p&gt;Hello all hope you're doing fine! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would you please help me answering these questions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) We're short a call option and we delta hedge. We know that there will be a move in the underlying asset price. Which move is good for us?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) We're long a put option, how can we Rhô hedge?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) We're short a call option and we delta hedge.. The stock price decreases and volatility rises.. What should we do?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) How can we hedge Asian options using European calls?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you all!&lt;/p&gt;&#xA;" OwnerUserId="24451" LastEditorUserId="19645" LastEditDate="2021-03-29T12:21:17.527" LastActivityDate="2021-03-29T12:21:17.527" Title="I have an interview for an assistant trader, need your help with some questions" Tags="&lt;hedging&gt;&lt;greeks&gt;&lt;asian-option&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30279" PostTypeId="2" ParentId="22982" CreationDate="2016-09-24T12:02:41.773" Score="2" Body="&lt;p&gt;As q.t.f stated, you shouldn't pay too much attention to the Feller Condition  since it is often violated in the Heston model, especially for options with more than a few weeks until maturity. However, you should make sure that your Characteristic Function stays continuous, else you'll end up with &quot;wrong&quot; prices. This is caused by the branch cut along the negativ real axis and can be avoided through a simple transformation. There are several formulations out there that prevent that from happening, a good and simple start is Albrecher et al. (2006).&lt;/p&gt;&#xA;" OwnerUserId="24289" LastActivityDate="2016-09-24T12:02:41.773" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30280" PostTypeId="2" ParentId="30278" CreationDate="2016-09-24T13:18:38.527" Score="3" Body="&lt;p&gt;On Question 1, you have zero delta (since you delta hedge) and negative gamma. So the cases where you lose money are (1) large upward movement of the underlying, (2) large downward movement of the underlying. The cases where you make money are small upward or downward movements. Another way to look at it is that you lose money in case of an increase in vol, make it with a decrease in vol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On Question 2, if you are long a put you have negative rho. You can hedge this with some positive rho, from a short put or a long call (or an interest rate swap where you received fixed and pay floating). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On Question 3, we are short a call and therefore we are long stock as a delta hedge.  Let's consider two cases separately:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(a) The stock price falls, so the delta of the option position is reduced in absolute value (it is negative and moves towards zero), we have to sell some of our hedging stock to match this decrease.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(b) The volatility rises, what do you think happens to the delta? I think it moves towards -0.5, but without knowing if it is above or below this now, I don't think we can predict the direction of change, up or down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I answer Question 4, do I get the job?&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-09-24T16:08:12.567" LastActivityDate="2016-09-24T16:08:12.567" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="30282" PostTypeId="1" CreationDate="2016-09-24T14:40:37.590" Score="1" ViewCount="1244" Body="&lt;p&gt;I'am trying to produce a rolling window to estimate a covariance matrix using a for-loop. I have my returns under the variable &lt;code&gt;returns_sec&lt;/code&gt; and I have 260 observations stored under &lt;code&gt;N_ret&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I now want to produce a covariance matrix estimate based on ten return series at a time and obtain one big variable with all covariance matrices in it (Top lines: &lt;code&gt;Matrix1&lt;/code&gt;, below &lt;code&gt;Matrix2&lt;/code&gt; and so on).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could to this by hand by writing:  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;kov_test=cov(returns_sec(1:10,:));  &#xA;kov_test2=cov(returns_sec(11:21,:));  ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and copy all results in one variable. But I think there should also be a more effective and easy way using a for-loop.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would be great if anyone of you could help me out!&lt;/p&gt;&#xA;" OwnerUserId="24398" LastEditorUserId="848" LastEditDate="2016-11-07T17:33:22.193" LastActivityDate="2020-03-18T15:44:37.593" Title="How to efficiently get covariance matrices from a rolling window in Matlab?" Tags="&lt;time-series&gt;&lt;programming&gt;&lt;covariance&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30283" PostTypeId="1" AcceptedAnswerId="30583" CreationDate="2016-09-24T15:02:28.893" Score="1" ViewCount="274" Body="&lt;p&gt;How are volatility products set up so that they have constant vega everywhere and what is the intrinsic difference between these products and vanilla options that determines the difference in vega?&lt;/p&gt;&#xA;" OwnerUserId="11723" LastActivityDate="2017-12-25T23:17:56.060" Title="Volatility products and constant vega" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;volatility&gt;&lt;vega&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30284" PostTypeId="1" CreationDate="2016-09-24T15:44:37.427" Score="1" ViewCount="89" Body="&lt;p&gt;Is it reliable to optimize portfolio weights on a yearly-rebalanced portfolio based on the Generalized Orthogonal GARCH (GO-Garch) covariance, coskewness, and cokurtosis matrices with the rmgarch R-package using daily estimates of ten stock indices over 5 years?&lt;/p&gt;&#xA;" OwnerUserId="24555" LastActivityDate="2016-09-24T15:44:37.427" Title="Using GO GARCH to optimize a yearly-rebalanced portfolio based on daily data" Tags="&lt;time-series&gt;&lt;r&gt;&lt;garch&gt;&lt;modern-portfolio-theory&gt;&lt;moments&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30285" PostTypeId="1" AcceptedAnswerId="30304" CreationDate="2016-09-24T16:25:11.850" Score="2" ViewCount="2689" Body="&lt;p&gt;Why does the market assign a vol skew in the presence of a spot vs vol correlation. Both heuristic/fundamental answers as well as mathematical explanations welcomed&lt;/p&gt;&#xA;" OwnerUserId="11723" LastEditorUserId="19887" LastEditDate="2016-09-26T08:05:01.510" LastActivityDate="2016-09-26T08:29:23.117" Title="Vol skew and spot-vol correlation" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;volatility&gt;&lt;skew&gt;&lt;skewness&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30287" PostTypeId="2" ParentId="11019" CreationDate="2016-09-24T19:15:48.047" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;What is here the meanForecast and why is it always the same number?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It is the point forecast due to the conditional mean model. Since it is just a constant in your model &lt;code&gt;m2&lt;/code&gt;, the forecast is also constant.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Is there a way to get the n-th volatility forecast as well as the n-th return forecast, e.g. the predicted volatility for the next day as well as the return. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The documentation of the &lt;code&gt;predict&lt;/code&gt; function is not very explicit, but the first column &lt;code&gt;meanForecast&lt;/code&gt; gives the point forecast and I guess the third column &lt;code&gt;standardDeviation&lt;/code&gt; gives the conditional standard deviation forecasts due to the GARCH model. Square them to get the conditional variance forecasts.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In the case of the model &lt;code&gt;m2&lt;/code&gt; the volatility forecast will be the return forecast, since we assume a pure GARCH model. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Volatility forecast will be the return forecast? In what sense? A return is a random variable, volatility is its property. If by &lt;em&gt;return forecast&lt;/em&gt; you mean a point forecast, again this is not the same as volatility forecast.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;But how can we extract both in the &lt;code&gt;m1&lt;/code&gt; case?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;predict&lt;/code&gt; gives you the conditional mean and conditional standard deviation forecasts in the first and the last columns. Square the latter to get the conditional variance forecasts.&lt;/p&gt;&#xA;" OwnerUserId="19645" LastActivityDate="2016-09-24T19:15:48.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30288" PostTypeId="1" CreationDate="2016-09-24T19:52:17.033" Score="2" ViewCount="585" Body="&lt;p&gt;I like to calculate the mean and standard deviation of a price series, using the Kalman filter. I am somehow stuck with the deviation, or have some problem in understanding, which my research could not solve.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mean(t) =  mean(t-1) + K(t) * ( price(t) - mean(t-1) )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with Kalman gain &lt;code&gt;K(t) = R(t-1) / (R(t-1) + Ve)&lt;/code&gt;, state variance &lt;code&gt;R(t) = (1 - K(t)) * R(t-1)&lt;/code&gt; and measurement error &lt;code&gt;Ve&lt;/code&gt; practically as some pre-defined parameter, similarly to the lookback period in a simple mean.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've read a few times that the variance &lt;code&gt;R&lt;/code&gt; should give kind of variance (and thus standard deviation) of the price series. But with a &lt;code&gt;K &amp;lt; 1&lt;/code&gt;, &lt;code&gt;R&lt;/code&gt; with every iteration just gets smaller and is no way the deviation of the price series. This only would make sense for a constant value to measure, where with every measurement iteration we get more certainty. Is my concept of the Kalman filter too simplistic? Can anybody give me a hint please.&lt;/p&gt;&#xA;" OwnerUserId="24559" LastActivityDate="2018-05-24T11:33:57.737" Title="Mean and standard deviation of price series with Kalman" Tags="&lt;time-series&gt;&lt;modeling&gt;&lt;mean-variance&gt;&lt;standard-deviation&gt;&lt;kalman&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30289" PostTypeId="2" ParentId="23261" CreationDate="2016-09-25T13:03:10.290" Score="1" Body="&lt;p&gt;Duration is a decreasing function of yield. It's simple to consider that lower yielding bonds (in IG or sovereign credit) will increase line item duration when compared against HY.&lt;/p&gt;&#xA;" OwnerUserId="21023" LastEditorUserId="21023" LastEditDate="2018-12-08T16:03:11.080" LastActivityDate="2018-12-08T16:03:11.080" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="30290" PostTypeId="2" ParentId="30139" CreationDate="2016-09-25T13:28:01.080" Score="9" Body="&lt;p&gt;&lt;strong&gt;Regime switching&lt;/strong&gt; is another way to describe &lt;strong&gt;structural changes in a data series&lt;/strong&gt;. For example, an inflation timeseries may change &lt;strong&gt;states&lt;/strong&gt; from ARMA to linear as the economy moves from a period of cyclical growth to prolonged recession.  A stock price may, say, be determined by and correlated to the main equity index when it has a large market capitalisation and then by a sub-index when it's relative size shrinks - consider Apple.  Regime switching enables a very powerful dynamic regression analysis of time series by incorporating both of these periods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &quot;zero bound&quot; at low interest rates would lead to a significantly decreased volatility regime whereas the period of high central bank policy rates arising from high inflation in 1970/80s was characterised by greater volatility - a regime change. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A general application of regime switching is via state space modelling with use of a Dynamic Linear Model (&lt;a href=&quot;http://helios.fmi.fi/~lainema/dlm/dlmtut.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://helios.fmi.fi/~lainema/dlm/dlmtut.html&lt;/a&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A great text to discover more is Nelson &amp;amp; Kim, State Space Models in Regime Switching, or Hamilton's Time Series Analysis. &lt;/p&gt;&#xA;" OwnerUserId="21023" LastEditorUserId="21023" LastEditDate="2018-12-08T16:08:23.117" LastActivityDate="2018-12-08T16:08:23.117" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="30291" PostTypeId="2" ParentId="30200" CreationDate="2016-09-25T13:47:15.553" Score="2" Body="&lt;p&gt;Unquestionably the most liquid point in interest rate markets is &lt;strong&gt;CME exchange-traded ten year note&lt;/strong&gt; future. Because the &lt;strong&gt;&lt;em&gt;basis&lt;/em&gt;&lt;/strong&gt; between future and cheapest-to-deliver (CTD) bond cash price is relatively steady throughout the day, this provides a &quot;knot&quot; that determines the price of the belly of the curve. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other &quot;knots&quot; may be from Fed Funds policy rate, and five/ten year benchmark cash bond prices. These bond prices are set according to supply and demand, for example, by E-Speed/BrokerTec digital exchanges. Market markers are given incentives to provide continuous liquidity on the exchange. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From these knots a cubic spline is used to generated a smooth Treasury yield curve - often new issue bonds or off-the-runs are priced as another basis to the splined curve rather than directly from current Treasuries.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the market evolves, it may be that IRS provide more liquid knots than cash Treasury bonds due to the capital requirements of warehousing positions on balance sheet. In this case, we may in future see the 10y IRS become a driver of on-the run prices (e.g. 10y UST) as the swap-bond basis is similarly &lt;strong&gt;relatively&lt;/strong&gt; steady.&lt;/p&gt;&#xA;" OwnerUserId="21023" LastActivityDate="2016-09-25T13:47:15.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30293" PostTypeId="2" ParentId="30204" CreationDate="2016-09-25T14:41:48.660" Score="2" Body="&lt;p&gt;This is a python duplication with some modeled data&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import pandas as pd&#xA;import numpy as np&#xA;from statsmodels.formula import api&#xA;&#xA;n = 1000&#xA;x = pd.date_range('2010-12-31', periods=n)&#xA;y = np.random.randn(n)&#xA;s = pd.Series(y, x)&#xA;s = np.clip(abs(s.rolling(5).mean()) + .19, 0, 1.2) * 100&#xA;&#xA;df = pd.concat([s.diff(), s.shift()], axis=1, keys=['diff', 'level']).dropna()&#xA;&#xA;Y = df.iloc[:, [0]].values&#xA;X = df.iloc[:, [1]].values&#xA;X = np.concatenate([np.ones_like(X), X], axis=1)&#xA;&#xA;beta = np.linalg.pinv(X.T.dot(X)).dot(X.T).dot(Y)&#xA;print(beta)&#xA;&#xA;[[ 21.79316927]&#xA; [ -0.41239735]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;calculations&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;long_run_mean = -beta[0, 0] / beta[1, 0]&#xA;mean_reversion_speed = -beta[1, 0] * 100&#xA;halflife = -np.log(2) / beta[1, 0]&#xA;&#xA;print(long_run_mean)&#xA;print(mean_reversion_speed)&#xA;print(halflife)&#xA;&#xA;53.359813861&#xA;46.3557243425&#xA;1.49527850204&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Use &lt;code&gt;statsmodels&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;results = api.ols('diff ~ level', df).fit()&#xA;results.params&#xA;&#xA;Intercept    24.735328&#xA;level        -0.463557&#xA;dtype: float64&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="20388" LastEditorUserId="20388" LastEditDate="2016-09-27T16:12:55.027" LastActivityDate="2016-09-27T16:12:55.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30297" PostTypeId="1" AcceptedAnswerId="30401" CreationDate="2016-09-25T18:07:44.793" Score="1" ViewCount="148" Body="&lt;p&gt;I am wondering what are some of the more important/interesting risk measures to watch, &lt;strong&gt;particularly in FX markets&lt;/strong&gt;.&#xA;So far I'm watching the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Greeks&lt;/li&gt;&#xA;&lt;li&gt;Tail moves AKA VaR (left and right tail ~ and observing&#xA;discrepancies)&lt;/li&gt;&#xA;&lt;li&gt;Rolling VaR, correlations, volatilities&lt;/li&gt;&#xA;&lt;li&gt;Stress Loss (given certain scenarios)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Any advice would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="20077" LastActivityDate="2016-10-02T09:02:25.687" Title="What are some of the most important/interesting Risk measures to watch?" Tags="&lt;risk&gt;&lt;fx&gt;&lt;risk-management&gt;&lt;var&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30298" PostTypeId="1" AcceptedAnswerId="30299" CreationDate="2016-09-25T18:45:39.800" Score="5" ViewCount="1264" Body="&lt;p&gt;Given two uncorrelated strategies, each with a Sharpe ratio of 1, what is the  of Sharpe ratio of the ensemble? &lt;/p&gt;&#xA;" OwnerUserId="8175" LastEditorUserId="2379" LastEditDate="2017-02-27T14:59:05.960" LastActivityDate="2020-04-30T21:36:46.290" Title="What is the Sharpe ratio of two uncorrelated strategies, each with Sharpe ratio equal 1?" Tags="&lt;sharpe-ratio&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30299" PostTypeId="2" ParentId="30298" CreationDate="2016-09-25T19:46:00.087" Score="10" Body="&lt;p&gt;If we assume that by ensemble you mean an equally weighted portfolio of the two. We can express that portfolio as $$P = \frac{1}{2}x + \frac{1}{2}y$$&#xA;and the sharpe ratio of $P$, $S(P)$, will be $$\frac{\frac{1}{2}\mu_x + \frac{1}{2}\mu_y - r_f}{\sigma_{\frac{1}{2}x + \frac{1}{2}y}}$$&#xA;becuase $x$ and $y$ are uncorellated, this reduces to $$\frac{\mu_x + \mu_y - 2r_f}{\sqrt{\sigma_x^2 + \sigma_y^2}}$$&#xA;becuase the sharpe ratios $$S(x)=\frac{\mu_x - r_f}{\sigma_x}=S(y)=\frac{\mu_y - r_f}{\sigma_y} = 1$$&#xA;we get $$\mu_x - r_f = \sigma_x \\\mu_y - r_f = \sigma_y $$&#xA;thus $$\mu_x + \mu_y - 2r_f = \sqrt{\sigma_x^2} + \sqrt{\sigma_y^2} $$&#xA;and&#xA;$$S(P) = \frac{\sqrt{\sigma_x^2} + \sqrt{\sigma_y^2}}{\sqrt{\sigma_x^2 + \sigma_y^2}}$$&#xA;What can you say about this ratio? How does it relate to Jensen's inequality? what happens if they are perfectly correlated?&lt;/p&gt;&#xA;" OwnerUserId="15457" LastActivityDate="2016-09-25T19:46:00.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30302" PostTypeId="1" CreationDate="2016-09-26T02:19:57.310" Score="5" ViewCount="206" Body="&lt;p&gt;I've been thinking how to price the early payment of mortgages in banks from emerging markets, where swaptions/caps/floors aren't available, and how to hedge this kind of options. At first I thought about implementing simple methodologies, like one factor short-rate models (in my sight the BDT model) for discounting the future cash flows that I could receive if the options are exercised.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I would like to know if it's a good a idea to start pricing with this kind of models. How good or bad could this end up being? (compared to more sophisticated models). Should I spend time trying to calculate more complete models like the LMM or so? If so, which instruments should I use to get the right parameters?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many models start assuming that there is an observable swaption/cap/floor market, but if there isn't such a market, how should parameters be estimated? For example, I could get the zero yield from the swap market, but what about the vol? How do I benchmark my models?&lt;/p&gt;&#xA;" OwnerUserId="20751" LastEditorDisplayName="user13444" LastEditDate="2016-12-18T22:02:10.830" LastActivityDate="2016-12-18T22:02:10.830" Title="Pricing interest rate options in emerging markets" Tags="&lt;option-pricing&gt;&lt;interest-rates&gt;&lt;short-rate&gt;&lt;development&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30304" PostTypeId="2" ParentId="30285" CreationDate="2016-09-26T08:29:23.117" Score="2" Body="&lt;p&gt;Suppose you were to price 2 instruments: a strongly OTM put and a strongly OTM Call.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the standard BS settings, instantaneous volatility is assumed to be constant. Consequently, the implied volatility of these 2 instruments will be the same, resulting in an absence of implied volatility skew.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, assume a negative spot/instantaneous volatility correlation. Make it very negative ($\rho \approx -1$) to make things clearer. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;When you price the OTM put, it is the strongly bearish paths that will matter to you (think Monte Carlo if you like, only the paths that finish below the strike $ K &amp;lt;&amp;lt; S_0 $ will contribute to the option price), that is, the paths where the spot is expected to strongly decrease. Because of the negative spot/vol correlation, along the latter &quot;bearish&quot; paths, instantaneous volatility is expected to increase, thus making &quot;effective&quot; volatility (i.e. the implied volatility) higher compared to the pure BS case.&lt;/li&gt;&#xA;&lt;li&gt;When you price the OTM call, it is the strongly bullish paths that will matter to you (think Monte Carlo if you like, only the paths that finish above the strike $ K &amp;gt;&amp;gt; S_0 $ will contribute to the option price), that is, the paths where the spot is expected to strongly increase. Because of the negative spot/vol correlation, along the latter &quot;bullish&quot; paths, instantaneous volatility is expected to decrease, thus making &quot;effective&quot; volatility (i.e. the implied volatility) lower compared to the pure BS case.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This illustrates how a &lt;em&gt;negative&lt;/em&gt; spot/(instantaneous) volatility correlation leads to a &lt;em&gt;negative&lt;/em&gt; implied volatility skew. &lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2016-09-26T08:29:23.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30307" PostTypeId="2" ParentId="30167" CreationDate="2016-09-26T10:44:32.990" Score="0" Body="&lt;p&gt;remember that atm strike of usdjpy is defined as fwd× exp(-0.5xvolsq.T) - ie it is the strike at which delta call = delta put for a jpyusd deal&#xA;and atm strike of jpyusd = 1/ atm strike of usd jpy &lt;/p&gt;&#xA;&#xA;&lt;p&gt;also remember that a usd call = jpy put&#xA;so if you have the usdjpy vol at strike k, then by this identity that vol also applies to jpyusd at strike 1/k&lt;/p&gt;&#xA;" OwnerUserId="17348" LastEditorUserId="17348" LastEditDate="2016-09-26T10:56:14.657" LastActivityDate="2016-09-26T10:56:14.657" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30309" PostTypeId="1" AcceptedAnswerId="30313" CreationDate="2016-09-26T11:50:17.417" Score="2" ViewCount="428" Body="&lt;p&gt;Please define Option Open Interest, its interpretation, and why it matters?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From my understanding, option open interest describes the net of long-short outstanding call or put options. But I do not understand, why this would number would matter.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastEditorUserId="9336" LastEditDate="2016-09-26T13:19:19.093" LastActivityDate="2016-09-26T13:44:54.473" Title="Interpretation of Open Interest for Options" Tags="&lt;options&gt;&lt;quant-trading-strategies&gt;&lt;trading&gt;&lt;derivatives&gt;&lt;trading-systems&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30310" PostTypeId="2" ParentId="28438" CreationDate="2016-09-26T11:58:04.220" Score="4" Body="&lt;p&gt;In a &lt;s&gt;quick and easy&lt;/s&gt; first step you could add $L_1$-regularization to the Markowitz problem. That is, you add a term $\lambda ||w||_1$ to the goal function of your optimization problem (where $w$ are the allocation weights to be optimized).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The $L_1$-regularization, which is often termed LASSO in the statistics community, will give you sparse solutions of the weight vectors, i.e. bring several $w_i$ down to zero and leave you with a selected number of remaining asset weights. How many assets exactly will remain depends on the choice of the regularization parameter $\lambda$, which you then should adjust accordingly in order to give 20 assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The nice thing about this approach is that you can stay in the same class of optimization algorithms, because the absolute value of the parameters can be incorporated by linear constraints. See for example &lt;a href=&quot;https://www.ecb.europa.eu/pub/pdf/scpwps/ecbwp936.pdf?36b3daec86625a1e41e4f39905604c62&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.  &lt;/p&gt;&#xA;" OwnerUserId="20336" LastEditorUserId="20336" LastEditDate="2016-09-26T13:39:27.980" LastActivityDate="2016-09-26T13:39:27.980" CommentCount="19" ContentLicense="CC BY-SA 3.0" />
  <row Id="30312" PostTypeId="1" CreationDate="2016-09-26T13:02:55.957" Score="1" ViewCount="1720" Body="&lt;p&gt;I am trying to understand trading liquidity risk $\cdots$ &quot;Trading liquidity risk occurs when an entity is unable to buy or sell a security at the market price due to a temporary inability to find a counterparty to transact on the other side of the trade.&quot; I found this definition  on the net somewhere on the net.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this is to hold true, then can I conclude that trading liquidity risk is common with an OTC market where there are no intermediaries like CCP?&lt;/p&gt;&#xA;" OwnerUserId="17260" LastEditorUserId="7008" LastEditDate="2016-09-27T22:45:34.307" LastActivityDate="2016-09-28T05:21:57.230" Title="Trading liquidity risk" Tags="&lt;finance&gt;&lt;risk-management&gt;&lt;self-study&gt;&lt;liquidity-risk&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30313" PostTypeId="2" ParentId="30309" CreationDate="2016-09-26T13:37:32.993" Score="2" Body="&lt;p&gt;You are generally correct with your definition of open interest. It is the total number of &quot;open&quot; contracts for example contracts that have not been closed by a liquidating trade, exercised, or assigned. For example, if one party buys a call and another sells the call option the open interest on that option is now 1. Open interest can be important for a number of reasons:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It can indicate which strikes are most liquid. If more people who hold positions in a certain strike generally that means the strike will be more liquid. This means the bid ask spread on options with lots of open interest might be relatively tighter.&lt;/li&gt;&#xA;&lt;li&gt;More interestingly open interest can reveal large trades that other people are putting on. For example if you see a huge amount of open interest on in the money options going into a dividend it is possible someone is making a dividend play. Another example is if you see a abnormal amount of calls and puts on the same strike on a stock with a large percentage of its shares shorted this could mean people are turning to the options market and selling calls and buying puts at the same strike to form a synthetic short underlying position (&lt;a href=&quot;http://www.theoptionsguide.com/synthetic-short-stock.aspx&quot; rel=&quot;nofollow&quot;&gt;Synthetic Short Explained&lt;/a&gt;). They might do this if they are having trouble finding shares to borrow.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="9501" LastEditorUserId="9501" LastEditDate="2016-09-26T13:44:54.473" LastActivityDate="2016-09-26T13:44:54.473" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30314" PostTypeId="1" CreationDate="2016-09-26T16:50:23.810" Score="-1" ViewCount="34" Body="&lt;p&gt;When we calculate a difference between the market price and modelled price. so to test the significance whether we apply dependent test or independent test.&lt;/p&gt;&#xA;" OwnerUserId="24580" LastActivityDate="2016-09-26T19:42:02.210" Title="Nature of the sample" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;statistical-finance&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ClosedDate="2016-09-27T07:15:09.490" ContentLicense="CC BY-SA 3.0" />
  <row Id="30316" PostTypeId="1" AcceptedAnswerId="30319" CreationDate="2016-09-26T18:33:49.233" Score="4" ViewCount="598" Body="&lt;p&gt;I was trading various stocks on the market, and I often see that stocks have their price, &lt;em&gt;much&lt;/em&gt; higher or lower, than the Bid and Ask. Also, as the Bid and Ask move in real time, the price moves too, but it &lt;em&gt;stays far above/below the Bid and Ask&lt;/em&gt;&#xA;Here is an example with ARRY:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/hfLlp.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/hfLlp.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/oTM5A.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/oTM5A.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, How can this be possible? If the stock's official price, is the price of the last trade, how can it stay below the Best Bid, or above the Best Ask?&lt;/p&gt;&#xA;" OwnerUserId="22103" LastActivityDate="2016-09-26T19:53:10.310" Title="How can the market price of a stock be significantly lower than its Bid and Ask?" Tags="&lt;equities&gt;&lt;bid&gt;&lt;ask&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30318" PostTypeId="2" ParentId="30316" CreationDate="2016-09-26T19:09:17.263" Score="3" Body="&lt;p&gt;notice the size of the moves on your two stocks. The bid-offer is moving very fast but the last trade might of occured seconds ago. so its a stale price. you should only look at the bid-offer, thats what matter. last trade kind of meaningless. &lt;/p&gt;&#xA;" OwnerUserId="4729" LastActivityDate="2016-09-26T19:09:17.263" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30319" PostTypeId="2" ParentId="30316" CreationDate="2016-09-26T19:12:45.793" Score="8" Body="&lt;p&gt;I don't see this issue in Bloomberg, therefore I would assume it is just bad data in your source. Based on my snaps I suspect that your bid-ask is 15 min delayed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This stock is very active today, therefore I would be surprised if this is due to stale marks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: in reply to your comment&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below are simultaneous snaps from Bloomberg and Yahoo Finance at 20:14 UK time.&#xA;They agree on the price of 6.20, but while Bbg give bid-ask 6.20-6.21 Yahoo gives 6.13-6.14. On my Bbg screen the price was 6.13 about 15 mins ago (at 20:00 UK time, see chart).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Q3F4w.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Q3F4w.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/AeTgo.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/AeTgo.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/iPooc.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/iPooc.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2016-09-26T19:53:10.310" LastActivityDate="2016-09-26T19:53:10.310" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30320" PostTypeId="2" ParentId="30314" CreationDate="2016-09-26T19:42:02.210" Score="1" Body="&lt;p&gt;When you compare each market price to a model price calculated under corresponding assumptions (regarding underlying price, time to maturity, etc.) you have a paired sample (also called dependent sample). &lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2016-09-26T19:42:02.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30321" PostTypeId="2" ParentId="30312" CreationDate="2016-09-26T22:32:39.880" Score="0" Body="&lt;p&gt;I would say that liquidity risk is not necessarily a characteristic of certain type of market but a relation between the market &quot;quoted&quot; price and expectations of the price that counterparts have in that market. I.e any one would buy (sell) you an asset if the price you are charging (paying) is low (high) enough.&lt;/p&gt;&#xA;" OwnerUserId="20751" LastEditorDisplayName="user16651" LastEditDate="2016-09-28T05:21:57.230" LastActivityDate="2016-09-28T05:21:57.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30323" PostTypeId="2" ParentId="29957" CreationDate="2016-09-27T06:05:59.087" Score="2" Body="&lt;p&gt;This is a Specialization course on Trading Algorithms. I haven't taken the course, but it seems good.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.coursera.org/specializations/trading-strategy&quot; rel=&quot;nofollow&quot;&gt;https://www.coursera.org/specializations/trading-strategy&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20162" LastActivityDate="2016-09-27T06:05:59.087" CommentCount="0" CommunityOwnedDate="2016-09-27T06:05:59.087" ContentLicense="CC BY-SA 3.0" />
  <row Id="30325" PostTypeId="1" AcceptedAnswerId="30372" CreationDate="2016-09-27T14:18:23.453" Score="1" ViewCount="1772" Body="&lt;p&gt;I want to apply a Black-Litterman approach for portfolio optimization. My question is how to select investor views? I need to base the choice on a model.&#xA;I would be thankful if you could give me some references or suggestions. &lt;/p&gt;&#xA;" OwnerUserId="17810" LastEditorUserId="17810" LastEditDate="2016-09-27T14:38:16.687" LastActivityDate="2016-09-30T05:14:47.747" Title="How to generate the views in Black-Litterman model?" Tags="&lt;portfolio-optimization&gt;&lt;black-litterman&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30329" PostTypeId="1" CreationDate="2016-09-27T15:28:29.177" Score="1" ViewCount="60" Body="&lt;p&gt;Take for example the Consumption-based model with a power utility function estimated by Cochrane in his paper &quot;A Cross-Sectional Test of an Investment-Based Asset Pricing Model&quot; (1996). The following refers to table 7 and figure 6.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When we use GMM to estimate the unconditional model, where we only use the base assets as moment conditions and conduct a J-test to test, if the pricing errors are close enough to zero, the model cannot be rejected, although of its poor empirical performance. We can see that for example by plotting the exspected returns against the predicted returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In contrast, if we use the base assets and additionally managed portfolios, a conditinal estimation, the J-test clearly rejects the model, which is also supported by the poor preditcions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, it is very unclear to me why this is the case. How can it be that the J-test cannot reject the unconditional estimation, despite the poor performance but the conditional estimation? &lt;/p&gt;&#xA;" OwnerUserId="24592" LastActivityDate="2016-09-27T15:28:29.177" Title="J-test and Empirical Model Performance of Conditional and Unconditional Estimations (as for example in Cochrane (1996))" Tags="&lt;statistics&gt;&lt;asset-pricing&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30331" PostTypeId="1" CreationDate="2016-09-27T19:49:06.103" Score="0" ViewCount="156" Body="&lt;p&gt;I'm supposed to write an essay on &quot;essential new ideas in my current field of research&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, I'm looking for essential (= it has the potential to change the way we look at the discipline) and new (= the last decade) ideas in the area of portfolio theory, selection and optimization as well as equity valuation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Frankly, I have difficulties to come up with really &quot;new&quot; and &quot;essential&quot; concepts - any hints from anybody?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks...&lt;/p&gt;&#xA;" OwnerUserId="20787" LastActivityDate="2016-09-30T16:59:05.653" Title="Essential new ideas in portfolio theory" Tags="&lt;equities&gt;&lt;portfolio&gt;&lt;portfolio-optimization&gt;&lt;valuation&gt;&lt;portfolio-selection&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30332" PostTypeId="2" ParentId="29849" CreationDate="2016-09-27T20:45:05.173" Score="1" Body="&lt;p&gt;Let's assume that you are manager of a fund and you have made the aforementioned investments and gains (and only those). &#xA;When I ask you what was the annualized return of your fund during 2013-2015, the answer most certainly is 3.228% and not 8.037%.&lt;/p&gt;&#xA;" OwnerUserId="24601" LastActivityDate="2016-09-27T20:45:05.173" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30333" PostTypeId="2" ParentId="29849" CreationDate="2016-09-27T21:04:10.293" Score="1" Body="&lt;p&gt;The industry standard is to display annualized returns on a yearly basis because it is requested by most of the authorities (SEC...) and you shouldn't mix years.&#xA;So you should present your returns as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2013 : X %&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2014 : X %&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2015 : X %&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also you should use formula 2) because formula 1) is misleading :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you tell someone that you have a 8% of yearly returns, and that this person lends you x dollars during 100 days and that after this period this investors come back to get its money, you can't tell him to come back later on because up to now you didn't invest its money... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Time is money and so you should use the entire time frame.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2016-09-27T21:10:48.857" LastActivityDate="2016-09-27T21:10:48.857" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30334" PostTypeId="2" ParentId="29849" CreationDate="2016-09-27T22:14:55.237" Score="1" Body="&lt;p&gt;What happened to the cash in the intervening periods?  Was it in a mattress somewhere or in the money market in some form?  The problem to me appears less you have these gaps but you only want to count these return periods.  That would make anyone you are dealing with extremely nervous.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your capital exists in between these investments and the returns on them should be added to get continuous values for the entire timeframe.  If that is, &quot;I put it in a mattress&quot; you need to own that and accept 0% return for those days.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for industry standards I am used to seeing all rates specified as annualized although when applying them to non-year aligned periods the day count convention needs to be specified.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, your second calculation is closest to correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could declare a day count convention (probably actual/252) and report each year individually based on that convention by taking the return for held days and annualizing it out but that would only be acceptable, I think, if you report each year individually with the day count convention and number of days held.&lt;/p&gt;&#xA;" OwnerUserId="9413" LastActivityDate="2016-09-27T22:14:55.237" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30335" PostTypeId="2" ParentId="30312" CreationDate="2016-09-27T22:21:22.283" Score="1" Body="&lt;p&gt;Market liquidity refers to the ease with which an asset can be traded on the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the financial literature, it is generally assumed that assets have a &quot;fundamental&quot; value that correspond to the discounting expected cashflows of this asset. This is roughly the Efficient Market Hypothesis (EMH). This value should correspond to the &quot;market price&quot;, or &quot;display price&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However in the reality, we observe what we call some frictions such as the bid ask spread (we have in reality two prices for an asset not one as in the Walras equilibrium), brokerage fees, transaction taxes and &lt;strong&gt;search and delay costs&lt;/strong&gt; (this correspond to your case). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;All these frictions induce costs to investors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An asset with important transactions costs make it harder to trade this asset (ie decreasing its liquidity). For example an asset that have an important bid ask spread is likely to attract less investors (generally only long terms investors) because it takes times to amortize the bid ask spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The more participants there are, the more liquid the market is. Because transactions costs decrease with the number of participants due to competition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A Central Counterparty Clearing House (CCP), by lowering the counterparty risk, tends to attract investors to the market, henceforth it increases the liquidity (&lt;strong&gt;level&lt;/strong&gt;) of the market. Also, as pointed out by Quantuple standardization plays a role. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However the liquidity risk shouldn't be seen as necessary correlated with  the liquidity level.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;An Illiquid asset may have less liquidity risk than a liquid asset...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;because liquidity risk corresponds to, as usual in finance, an &lt;strong&gt;unexpected&lt;/strong&gt; change in the liquidity level of an asset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To come back to your question: &lt;em&gt;can I conclude that trading liquidity risk is common with an OTC market where there are no intermediaries like CCP?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;No because, even it is true that OTC markets are less liquid than regulated market, it does not indicate by itself that unexpected change in liquidity are more common in OTC market. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As a counter-example I would say that in OTC markets, participants know very well other agents, they trust each other (as much as it is possible in finance....) and so it may be unlikely than a participant refuse to buy/sell an asset at the “market price&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Conversely on regulated market, agents don't know one another, they may suspect the other part of the deal of being more informed, so they may be reluctant to trade at the market price.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In finance, it is important not to mix the &lt;em&gt;level&lt;/em&gt; of something (liquidity, credit, whatsoever even the price level) and the &lt;em&gt;risk&lt;/em&gt; associated.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Final important point:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;I do not say&lt;/em&gt; that OTC market have less liquidity risk than regulated ones (because I don't know - I just know that they are less liquid), I just say that before to conclude about that you need to find evidences that support your hypothesis, you shouldn't draw hasty conclusions.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2016-09-27T22:46:14.357" LastActivityDate="2016-09-27T22:46:14.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30336" PostTypeId="2" ParentId="620" CreationDate="2016-09-27T23:12:50.693" Score="2" Body="&lt;p&gt;In the public domain, there is SVI (stochastic volatility inspired) curve invented by Jim Gatheral. If you need curves which can fit very liquid names or handle W-shape curves (e.g. on earning), you should look at the curves by &lt;a href=&quot;http://www.voladynamics.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;Vola Dynamics&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="24603" LastEditorUserId="24603" LastEditDate="2017-09-12T21:39:39.793" LastActivityDate="2017-09-12T21:39:39.793" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30337" PostTypeId="2" ParentId="30139" CreationDate="2016-09-27T23:57:19.200" Score="6" Body="&lt;p&gt;&lt;strong&gt;Intuition :&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets observe the U.S. ex post real interest rates from 1961 to 1986 :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/dZdTd.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/dZdTd.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At first look it is not easy to identify different states of the economy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now lets apply an econometric model that will try to identify those different states and observe the result:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/3ZvZ5.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/3ZvZ5.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The econometric model identifies 3 different states of the economy, this is what we call three regimes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically the model firstly needs to determine the number of regime switch ( when the &quot;state of the world&quot; changes) : 2 regimes switch in this example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly once a regime switch has been identified, one or several parameters of the model will change. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the above figures, two very basics switching models are employed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One is a single intercept + some random errors.&#xA;Another is the same but with the variance of the errors that change at each new regime.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regime-switching models that are employed are obviously much advanced, they have lot of parameters but the intuition is the same, models needs to detect structural changes in the series then some parameters of the models will be impacted by those changes.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;So the intuition behind these models is to get a model with some coefficients that are regime&#xA;  dependent.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Ps: Illustrations are taken from the official documentation of &lt;a href=&quot;http://www.doornik.com/pcgive/&quot; rel=&quot;noreferrer&quot;&gt;PcGive&lt;/a&gt; (econometric software). &lt;/p&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2016-09-27T23:57:19.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30338" PostTypeId="1" CreationDate="2016-09-28T01:35:31.977" Score="1" ViewCount="58" Body="&lt;p&gt;WACC in my mind is effectively a post-tax measure: $$\text{WACC} = \frac{E}{V}  k_e+\frac{D}{V}k_d(1-t)$$ In this case should cash-flows, in particular loan cash-flows be adjusted for tax as well? Imagine a scenario where a company buys a portfolio of loans. The company is trying to estimate whether to buy the portfolio and for how much. Market approach is not feasible as these transactions do not have publicly available prices, the portfolio is very specific. Question is whether the cash-flows, interest cash flows specifically should be adjusted for the corporate tax rate $t$ by adjusting the total interest payment received $I$ by $(1-t)$ reflecting the fact that the company will have to pay taxes on interest received.&lt;/p&gt;&#xA;" OwnerUserId="2685" LastEditorDisplayName="user16651" LastEditDate="2016-09-28T05:02:36.630" LastActivityDate="2016-09-28T05:02:36.630" Title="Should cash-flows discounted at WACC be pre- or post-tax?" Tags="&lt;discounting&gt;&lt;dcf&gt;&lt;wacc&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30339" PostTypeId="2" ParentId="7053" CreationDate="2016-09-28T04:19:07.637" Score="1" Body="&lt;p&gt;In practical terms, it means your strategy will perform similarly as measured by say Sharpe ratio on the sample of data it has not seen before. Note, there is plenty of ambiguity in the my previous sentence. For example, if you tested on a set of equity data from 10AM to 3PM, removing market openings and closings and struck out special events, you might think you have done a good job optimizing. Then you throw market openings, closing and special events back in and your Sharpe ratio goes negative. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What most don't discuss is how to divide your set of data into in sample and out of sample. I tend to think it should be random which is the closest it gets to fair. Then you could use first set for optimization and second for validation. Even better, during optimization choose the sets dynamically.&lt;/p&gt;&#xA;" OwnerUserId="24606" LastActivityDate="2016-09-28T04:19:07.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30345" PostTypeId="1" CreationDate="2016-09-28T11:21:57.217" Score="7" ViewCount="1012" Body="&lt;p&gt;I came across &lt;a href=&quot;https://www.volar.io/src/pdf/volcurves_CU_24Mar2016.pdf&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; presentation from volar.io. The authors show fitting examples for a flexible volatility smile parametrization in 5 to 8 parameters which is also able to fit the locally concave market implied volatility smiles around special events.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anybody know the details of their parametrization and can you provide a reference? In particular, is it a simple extension of their C3 parametrization where the Cn curve is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\sigma^2(z) = \sigma_0^2 \left( 1 + \sum_{i = 1}^{n - 1} \frac{1}{n!} \xi_i z^n \right)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;z = \frac{\ln(K / F)}{\sigma_0 \sqrt{T}}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suppose this is not the case and there is more to it. Some reasons:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Their examples look very stable on the wings which I would not expect from higher order polynomials. While they do not show too much extrapolation, their C5 and C6 curves on slides 31 and 32 look fairly well behaved in the wings (where they loose some quality of fit though).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It might be possible that they define a lower and upper cutoff beyond which they use a different tail function (e.g. linear in variance) and impose smoothness in these points. However on slide 10, they explicitly write that they don't like &quot;hacks&quot; in the wings.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Another &quot;goal&quot; states on slide 10 is for no-arbitrage constraints to be easy to incorporate. In the above setup, absence of butterfly arbitrage at all strikes used for the calibration creates non-linear constraints for an otherwise nice linear problem.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2016-10-31T00:04:29.650" LastActivityDate="2018-07-11T16:27:18.523" Title="Volar Higher Order Parametrizations" Tags="&lt;implied-volatility&gt;&lt;volatility-smile&gt;" AnswerCount="2" CommentCount="13" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="30346" PostTypeId="2" ParentId="3607" CreationDate="2016-09-28T11:30:14.633" Score="4" Body="&lt;p&gt;The correct answer is &quot;arithmetic mean, because Bill Sharpe says so&quot;. He invented the thing, and he's pretty clear on which one he was looking at. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use the geometric mean, which is lower the higher the volatility in the returns, and then you divide by standard deviation, you have essentially discounted your result TWICE for volatility. &lt;/p&gt;&#xA;" OwnerUserId="24614" LastActivityDate="2016-09-28T11:30:14.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30348" PostTypeId="1" AcceptedAnswerId="30392" CreationDate="2016-09-28T16:47:01.920" Score="4" ViewCount="1392" Body="&lt;p&gt;I am using the MSGARCH package on R to fit a Markov switching GARCH model. I fit the GARCH model using fit.MLE (so standard Maximum Likelihood), using three regimes. The parameters are estimated and given by the vector:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\theta = (\alpha_{11}, \alpha_{12}, \alpha_{13}, \alpha_{21}, \alpha_{22}, \alpha_{23}, \beta_{1}, \beta_{2}, \beta_{3}, P_{1}, P_{2}, P_{2}, P_{4}, P_5, P_6)$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where the j in $\alpha_{ij}$, $\beta_{j}$ denotes the state. The outputed $P_i$ is only six elements and with negative values. Its not the expected nine elements from the transition Probability matrix. Does anyone know what this is? Or how to lookup the correct matrix $P$? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the code for outputing the vector above (importsnp is a series of log-returns):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;require(MSGARCH)&#xA;&#xA;library(coda)&#xA;&#xA;snp &amp;lt;- as.matrix(importsnp)*100&#xA;&#xA;spec &amp;lt;- MSGARCH::create.spec(model = c(&quot;sGARCH&quot;,&quot;sGARCH&quot;,&quot;sGARCH&quot;), &#xA;                             distribution = c(&quot;norm&quot;,&quot;norm&quot;,&quot;norm&quot;), &#xA;                             do.skew = c(FALSE,FALSE,FALSE), &#xA;                             do.mix = FALSE, &#xA;                             do.shape.ind = FALSE)&#xA;set.seed(123) &#xA;&#xA;fit &amp;lt;- MSGARCH::fit.mle(spec = spec, y = snp)&#xA;&#xA;theta &amp;lt;- fit$theta&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="24618" LastEditorUserId="24618" LastEditDate="2016-09-30T08:28:28.143" LastActivityDate="2016-10-01T06:36:56.140" Title="MSGARCH package on R" Tags="&lt;r&gt;&lt;garch&gt;&lt;hidden-markov-model&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30350" PostTypeId="2" ParentId="111" CreationDate="2016-09-28T17:48:42.550" Score="2" Body="&lt;p&gt;You can try this course on Udactiy &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.udacity.com/course/machine-learning-for-trading--ud501&quot; rel=&quot;nofollow&quot;&gt;https://www.udacity.com/course/machine-learning-for-trading--ud501&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="22438" LastActivityDate="2016-09-28T17:48:42.550" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30353" PostTypeId="2" ParentId="30288" CreationDate="2016-09-28T21:37:52.417" Score="0" Body="&lt;p&gt;You need to run over the times series once for initial variance, and a second time with updated Kalman params for the state variance (your Rt). This is two step recursion&lt;/p&gt;&#xA;" OwnerUserId="21023" LastEditorUserId="21023" LastEditDate="2018-05-24T11:33:57.737" LastActivityDate="2018-05-24T11:33:57.737" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="30356" PostTypeId="1" AcceptedAnswerId="30357" CreationDate="2016-09-29T03:06:06.123" Score="2" ViewCount="677" Body="&lt;p&gt;First time poster here. Glad to be here. I just graduated with an MSc in computational finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recently read a question by another user about the delta of an at-the-money binary option as it approaches expiration. After writing a quick Matlab script I have confirmed that the delta in this situation explodes to infinity as the option approaches expiration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can this be valid? If we understand delta as the change in derivative price for every 1 dollar change in the price of the underlying asset, how could the delta ever exceed the payoff of the binary option? If the payoff on the derivative is 1 dollar when the price of the underlying asset exceeds the strike price, then a rational investor would be willing to pay 1 dollar AT MOST for that derivative, and would be willing to pay 0 dollars AT LEAST for that derivative. Therefore, the maximum range of fair values for the option would be 1 dollar right? How could the value of the derivative change by anything greater than 1 dollar then?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's almost as if the pricing model broke in this case. Considering I found values for d2 that were negative, when d2 is supposed to be a probability measure that the asset price expires above the strike, I would say that the model somehow broke. Can anyone explain why it breaks in this case?&lt;/p&gt;&#xA;" OwnerUserId="24628" LastActivityDate="2016-09-29T08:24:44.043" Title="Justification for Binary Option's Infinite Delta?" Tags="&lt;option-pricing&gt;&lt;delta-hedging&gt;&lt;binary-options&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30357" PostTypeId="2" ParentId="30356" CreationDate="2016-09-29T06:17:12.660" Score="2" Body="&lt;p&gt;Your question is essentially the same as &lt;a href=&quot;https://quant.stackexchange.com/questions/29932/interpretation-of-an-option-gamma-larger-than-one/29933#29933&quot;&gt;this&lt;/a&gt;. The approximation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;V_{t + 1} \approx V_t + \Delta_t \left( S_{t + 1} - S_t \right)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is only accurate when $S_{t + 1} - S_t$ and $\Delta t$ are small.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also my answer to &lt;a href=&quot;https://quant.stackexchange.com/questions/30177/how-much-can-be-said-about-the-greeks-without-picking-a-model/30183#30183&quot;&gt;this&lt;/a&gt; question. It provides some references that show that the delta is bounded by the slopes of the payoff function, i.e. in case of a European digital call $[0, \infty)$.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2016-09-29T08:24:44.043" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30359" PostTypeId="2" ParentId="111" CreationDate="2016-09-29T14:10:55.157" Score="0" Body="&lt;p&gt;Look at the seasonal chart for crude oil over 30 years from &lt;a href=&quot;http://www.seasonalcharts.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;seasonalcharts.com&lt;/a&gt;:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/LT7wO.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/LT7wO.gif&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&#xA;&lt;sub&gt;(source: &lt;a href=&quot;http://www.seasonalcharts.com/img/ENERGY-CSH/CRUDEOIL.GIF&quot; rel=&quot;nofollow noreferrer&quot;&gt;seasonalcharts.com&lt;/a&gt;)&lt;/sub&gt;&lt;/p&gt;&#xA;&lt;p&gt;and the seasonal chart for heating oil over 29 years:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/McNjK.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/McNjK.gif&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&#xA;&lt;sub&gt;(source: &lt;a href=&quot;http://www.seasonalcharts.com/img/ENERGY-CSH/HEATOIL.GIF&quot; rel=&quot;nofollow noreferrer&quot;&gt;seasonalcharts.com&lt;/a&gt;)&lt;/sub&gt;&lt;/p&gt;&#xA;&lt;p&gt;Traders know what to do even without using machine learning.  For &lt;span class=&quot;math-container&quot;&gt;$k$&lt;/span&gt;-fold cross validation, it will help to split the input data by years.&lt;/p&gt;&#xA;" OwnerUserId="3188" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2019-02-18T10:00:18.220" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="30360" PostTypeId="2" ParentId="30345" CreationDate="2016-09-29T14:12:26.823" Score="2" Body="&lt;p&gt;I am not a customer, and not familiar with the details of their parametrization, but on page 25 they imply that next 2 parameters (S5) are independent wing parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Later on page 25 and 26 they imply that other parameters S6,S7,S8 are to introduce W-shaped wiggle for names like SPY, AAPL and GOOG.&lt;/p&gt;&#xA;" OwnerUserId="185" LastEditorUserId="185" LastEditDate="2016-10-30T12:01:21.597" LastActivityDate="2016-10-30T12:01:21.597" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30361" PostTypeId="1" CreationDate="2016-09-29T15:00:10.440" Score="0" ViewCount="217" Body="&lt;p&gt;I have no idea how to do this. I can set up the Lagrangian, but I don't know how to translate it into &lt;code&gt;solve.qp()&lt;/code&gt; inputs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The inputs are Dmat, dvec, amat, bvec, meq.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know LaTeX so excuse my notation here. My problem is a global minimum variance portfolio optimization subject to the constraints x1+x2+x3 = 1, as well as 0 &amp;lt; x1 &amp;lt; w1, etc. Essentially, the weights must equal one, and the weights have a min/max condition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the matrix notation is (where Sigma is the covariance matrix of 3 assets)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[2*Sigma  [x1  = [0&#xA; 2*Sigma   x2  =  0&#xA; 2*Sigma   x3  =  0&#xA; 1  1  1   L1  =  1&#xA;-1  0  0   L2  =  0&#xA; 0 -1  0   L3  =  0&#xA; 0  0 -1   L4  =  0&#xA; 1  0  0   L5  =  w1&#xA; 0  1  0   L6  =  w2&#xA; 0  0  1]  L7] =  w3]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I know meq=1, as there is only one equality constraint. How do I translate the rest of the matrices into inputs for &lt;code&gt;solve.qp()&lt;/code&gt;? &lt;/p&gt;&#xA;" OwnerUserId="19473" LastActivityDate="2016-09-29T16:46:06.980" Title="Translating matrix expression of Lagrangian into solve.qp() parameters (R)" Tags="&lt;r&gt;&lt;optimization&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30362" PostTypeId="1" AcceptedAnswerId="30364" CreationDate="2016-09-29T16:39:56.870" Score="6" ViewCount="4923" Body="&lt;p&gt;If I wish to price a fixed-strike Asian Call option via Monte-Carlo (This has no early-exercise), are my following steps correct?:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;1) Simulate random asset prices. (Milstein)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\ d S(t) = \ rS(t)dt + \sigma S(t) d B(t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\ S_{t+dt} = S_t + r S_tdt + \sigma S_t \sqrt{ dt}Z + \frac{1}{2}\sigma^2dt(Z^2-1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2) Average the asset prices for each simulation.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\ A[i]$ is the average for each simulation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll be using both Geometric and Arithmetic averages&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;3) Calculate each payoff and discount it. Find the average of these payoffs&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\text{Payoff}[i]= \exp[-r(T-t)] * \max[A[i]-K,0] $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\text{Average} = \frac{1}{N}\sum_{i=1}^N \text{Payoff}[i]$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm aware that there are some approximation formulae, Finite-Difference methods and closed-form solutions but I'm trying to focus on Monte-Carlo simulations for now.&lt;/p&gt;&#xA;" OwnerUserId="24622" LastEditorUserId="467" LastEditDate="2017-02-22T09:45:08.357" LastActivityDate="2017-02-22T09:45:08.357" Title="How to perform Monte-Carlo simulations to price Asian options?" Tags="&lt;monte-carlo&gt;&lt;asian-option&gt;" AnswerCount="3" CommentCount="7" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30363" PostTypeId="2" ParentId="30361" CreationDate="2016-09-29T16:46:06.980" Score="1" Body="&lt;p&gt;I figured it out, mostly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dmat is your &lt;code&gt;[n x n]&lt;/code&gt; covariance matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;dvec is your &lt;code&gt;[n]&lt;/code&gt; length vector of expected returns, or if you want to find the GMV portfolio, it is a vector of 0s,. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Can someone explain to me where this fits into the Lagrangian matrices? It doesn't matter since I only calculate the GMV portfolio subject to a target return to find an efficient frontier, then calculate the return using my solution weights, but it'd be nice to know.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Amat is your transposed matrix of constraints &lt;code&gt;t([m x n])&lt;/code&gt;, but you also have to invert the signs on your inequality constraints so that they represent &lt;code&gt;&amp;gt;=&lt;/code&gt; constraints.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;bvec is your &lt;code&gt;[m]&lt;/code&gt; vector of constraints, i.e. the other side of the equation opposite the matrix of constraints.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps. &lt;/p&gt;&#xA;" OwnerUserId="19473" LastActivityDate="2016-09-29T16:46:06.980" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30364" PostTypeId="2" ParentId="30362" CreationDate="2016-09-29T16:53:54.253" Score="6" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Instead of simulating the spot price, simulate its logarithm since the latter can be simulated exactly for any time step.&#xA;\begin{equation}&#xA;\ln S_{t + \Delta t} = \ln S_t + \left( r - \frac{1}{2} \sigma^2 \right) \Delta t + \sigma Z,&#xA;\end{equation}&#xA;where $Z \sim \mathcal{N}(0, \Delta t)$. You then just simply take the exponential of the simulated logarithmic price at each time step.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;OK&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;OK&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Calculate the standard error of your estimate. This is just as important as computing the estimate itself and for example allows you to construct confidence intervals. Let&#xA;\begin{equation}&#xA;\text{Variance} = \frac{1}{N - 1} \sum_{i = 1}^N \left( \text{Payoff}_i - \text{Average} \right)^2&#xA;\end{equation}&#xA;be your estimator of the variance. Then the standard error is&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\text{Standard Error} = \sqrt{\frac{\text{Variance}}{N}}.&#xA;\end{equation}&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2016-09-29T17:03:47.587" LastActivityDate="2016-09-29T17:03:47.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30365" PostTypeId="2" ParentId="30362" CreationDate="2016-09-29T17:06:54.690" Score="2" Body="&lt;p&gt;Looks good to me, although idk why you have (T-t) in the discounting... isn't big T the total time to maturity? What is little t in the equation? Shouldn't it just be exp[-rT] because you discount from the time of payoff which is the expiration of the option.&lt;/p&gt;&#xA;" OwnerUserId="24628" LastActivityDate="2016-09-29T17:06:54.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30366" PostTypeId="1" AcceptedAnswerId="30367" CreationDate="2016-09-29T17:46:34.520" Score="1" ViewCount="104" Body="&lt;p&gt;The following picture and highlight:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/QW4ig.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/QW4ig.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This happens often on large gap downs/ups, what is the reasoning for this phenomenon?&lt;/p&gt;&#xA;" OwnerUserId="24637" LastActivityDate="2016-09-29T18:31:39.350" Title="Unexplained, empty candlestick spikes appear after large movements" Tags="&lt;trading&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30367" PostTypeId="2" ParentId="30366" CreationDate="2016-09-29T18:31:39.350" Score="3" Body="&lt;p&gt;Elaborating a bit more on second comment to your question. In the below screenshot you see that there was a turnover of 1,800 shares in DB US Equity at 19:34:13. This was quite off the market prices at this time as shown in your chart.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/8MVh3.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/8MVh3.png&quot; alt=&quot;DB US Equity - times and sales&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the condition code column shows, this was not a regular on-exchange transaction but reported through the FINRA/NYSE trade reporting facility. I.e. this is an off-exchange trade that was reported via the exchange. Most likely the deal was agreed upon before the move but reported after. Either the facility does not allow for entering the time stamp when the trade was arranged or it wasn't entered correctly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/yroBM.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/yroBM.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the &lt;a href=&quot;http://www.finra.org/industry/trade-reporting-facility-trf&quot; rel=&quot;nofollow noreferrer&quot;&gt;FINRA webpage&lt;/a&gt; for details.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2016-09-29T18:31:39.350" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30369" PostTypeId="1" CreationDate="2016-09-29T19:50:08.833" Score="4" ViewCount="1932" Body="&lt;p&gt;&lt;a href=&quot;https://arxiv.org/ftp/arxiv/papers/1601/1601.00991.pdf&quot; rel=&quot;nofollow&quot;&gt;This&lt;/a&gt; paper mentions the concept of rank which is defined as cross sectional rank. For e.g. one of the alphas (#3) is &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(-1 * correlation(rank(open), rank(volume), 10))&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;10 is just the number of days to take any correlation over. I think we can rank the securities according to Open and Volume each day. So we will be getting different set of securities each day. I don't understand how can this daily varying set be used to get a correlation value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thus need guidance on now to calculate this alpha. Any help will be appreciated. Thanks&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&#xA;I understand what rank is. What I don't get is how do you calculate correlation between changing values. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Lets say the universe is 3 stocks. On Day 1, Rank Open is 1,2,3 and&#xA;  Rank Volume is 3,2,1. On Day 2, Rank Open is 1,3,2 and Rank Volume is&#xA;  2,3,1. On Day 3, Rank Open is 3,2,1 and Rank Volume is 1,2,3. This&#xA;  happens for n days (in this case 10).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My primary question is how do you calculate correlation between such vectors to arrive at a single value. Because normal correlation is between two same type of vectors.&lt;/p&gt;&#xA;" OwnerUserId="24639" LastEditorUserId="24639" LastEditDate="2016-09-30T01:02:24.220" LastActivityDate="2016-09-30T01:02:24.220" Title="Meaning of cross sectional rank" Tags="&lt;equities&gt;&lt;quant-trading-strategies&gt;&lt;algorithmic-trading&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30371" PostTypeId="2" ParentId="29719" CreationDate="2016-09-29T22:32:48.577" Score="1" Body="&lt;p&gt;Probably a lot easier to use the Bloomberg add-ins in excel, write a macro to cycle the equities your looking for and retrieve the associated CUSIPs.&lt;/p&gt;&#xA;" OwnerUserId="24642" LastActivityDate="2016-09-29T22:32:48.577" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30372" PostTypeId="2" ParentId="30325" CreationDate="2016-09-30T05:14:47.747" Score="3" Body="&lt;p&gt;Any potential source of &quot;alpha&quot; would suffice, in fact. And your research would be research of how this &quot;alpha&quot; source is able to produce alpha. On my mind, candidates could be &#xA;(1) some well-documented predictions of somebody (like Prechter or Dow) - in that case you'll have 2-3 views for period, and the rest of assets or classes remain in equilibrium - see for example this paper by Batyrbekova - &lt;a href=&quot;http://cyberleninka.ru/article/n/using-elliott-wave-theory-predictions-as-inputs-in-equilibrium-portfolio-models-with-views&quot; rel=&quot;nofollow&quot;&gt;http://cyberleninka.ru/article/n/using-elliott-wave-theory-predictions-as-inputs-in-equilibrium-portfolio-models-with-views&lt;/a&gt;; &#xA;(2) or broker recommendations (ANR  in Bloomberg); &#xA;(3) or some machine learning algorithm, like random forest - something similar to that &lt;a href=&quot;http://cyberleninka.ru/article/n/application-of-ensemble-learning-for-views-generation-in-meucci-portfolio-optimization-framework&quot; rel=&quot;nofollow&quot;&gt;http://cyberleninka.ru/article/n/application-of-ensemble-learning-for-views-generation-in-meucci-portfolio-optimization-framework&lt;/a&gt;; &#xA;(4) or even traditional technical analysis, some method which would give you target prices; &#xA;(5) see also this: &lt;a href=&quot;http://cyberleninka.ru/article/n/cycle-adjusted-capital-market-expectations-under-black-litterman-framework-in-global-tactical-asset-allocation&quot; rel=&quot;nofollow&quot;&gt;http://cyberleninka.ru/article/n/cycle-adjusted-capital-market-expectations-under-black-litterman-framework-in-global-tactical-asset-allocation&lt;/a&gt; ; the author uses FED business cycle indicator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remember that in Black-Litterman view is normally distributed random variable, so you would have to make certain assumptions.&lt;/p&gt;&#xA;" OwnerUserId="6535" LastActivityDate="2016-09-30T05:14:47.747" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30374" PostTypeId="1" CreationDate="2016-09-30T08:12:44.680" Score="1" ViewCount="343" Body="&lt;p&gt;I am given 15 stocks (which is listed in NYSE), and want to track/replicate the S&amp;amp;P500 index. So i am currently have the information about the stock price, and given some capital to invest in (all must be in stocks), how do i determine the weights? I know that these 15 weights must equal to one, but if i take directly from current market, it won't be 1 (because there is 500 stocks in S&amp;amp;P, while i only have 15). Do i re-adjust, and if yes, how?&lt;/p&gt;&#xA;" OwnerUserId="24645" LastActivityDate="2016-09-30T16:37:32.650" Title="Suppose i want to track S&amp;P500 index using 15 stocks, how do i adjust their weights?" Tags="&lt;finance&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;&lt;money-management&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30375" PostTypeId="1" AcceptedAnswerId="30454" CreationDate="2016-09-30T08:26:27.567" Score="1" ViewCount="306" Body="&lt;p&gt;Currently I use the EWMA model with the squared logarithmic returns as proxy estimator for the volatility, in order to forecast the volatility one step ahead in an intraday scenario (time frame is a couple of minutes)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I read and observed the squared returns as volatility estimator has its limitations. So now I want to use a more sophisticated estimator such as Garman-Klass.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Is possible and moreover sensible to combine an estimator such as Garman-Klass with a volatility model like EWMA or any of the ARCH family?&lt;/li&gt;&#xA;&lt;li&gt;Or do I even need a volatility model like EWMA or *ARCH when I use these estimator (i.e Garman-Klass) in order to forecast the volatility ?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="22207" LastActivityDate="2016-10-07T19:15:31.967" Title="Combine EWMA or ARCH model with estimator other than squared returns" Tags="&lt;volatility&gt;&lt;forecasting&gt;&lt;estimation&gt;&lt;intraday&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30376" PostTypeId="1" AcceptedAnswerId="30378" CreationDate="2016-09-30T08:30:34.600" Score="3" ViewCount="416" Body="&lt;p&gt;Consider a Black-Scholes formula for option pricing on conditional interest rate $r=0$ for European call option. Let's write it as $BSCall(\sigma)$ and investigate it as a function of unknown non-random constant volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can look at historical asset price data and compute sample variance $s$ which distribution law depends on unknown true $\sigma$. It has an important property of $\dfrac{(n-1)\text{s}^2}{\sigma} \sim \chi_{n-1} ^2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Due to MLE plug-in property we know that if $\hat{\sigma}$ is an MLE for volatility $\sigma$ then $BSCall(\hat{\sigma})$ is an MLE for Black-Scholes price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this is just a point estimator. Is there any approach to compute the variance or confidence interval (HDI) for option price under volatility estimated with sample variance?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to use a trick from &lt;a href=&quot;https://quant.stackexchange.com/questions/9929/expected-value-of-black-scholes?noredirect=1&amp;amp;lq=1&quot;&gt;expected-value-of-black-scholes&lt;/a&gt; but it seems to be incorrect since rewriting $\sigma = \dfrac{(n-1)\text{s}^2}{\chi_{n-1} ^2}$ brings some exogeneous uncertainty by sampling Chi-squared.&lt;/p&gt;&#xA;" OwnerUserId="24641" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-10-03T07:20:54.567" Title="Distribution of Black-Scholes option price" Tags="&lt;option-pricing&gt;&lt;volatility&gt;&lt;black-scholes&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30378" PostTypeId="2" ParentId="30376" CreationDate="2016-09-30T12:29:41.537" Score="2" Body="&lt;p&gt;I think the easiest way to to what you want is to use &lt;em&gt;confidence intervals&lt;/em&gt; (statistical inference).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, assuming the population has a true variance $\sigma$, the sampling distribution of the variance $s^2$ of an $n$-sample &lt;a href=&quot;https://stats.stackexchange.com/questions/121662/why-is-the-sampling-distribution-of-variance-a-chi-squared-distribution&quot;&gt;verifies&lt;/a&gt;:&#xA;$$ \frac{s^2(n-1)}{\sigma^2}\sim \chi^2_{n-1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can exploit this result to build an $1-\alpha$ confidence interval for the population variance ($\alpha \in [0,1]$, typically $\alpha=5\%$). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed, for a confidence level $1-\alpha$, the following equality holds:&#xA;$$ z_{\alpha/2} \leq \frac{s^2(n-1)}{\sigma^2} \leq z_{1-\alpha/2} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $z_q$ figures the quantile $q$ of a chi-squared distribution with $n-1$ degrees of freedom i.e.&#xA;$$ X \sim \chi^2_{n-1},\quad \Bbb{P}(X \leq z_q) = q $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given a sample variance $\tilde{s}^2$, one can therefore turn the inequality on its head, to write, for a confiedence level $1-\alpha$:&#xA;$$ \frac{\tilde{s}^2(n-1)}{z_{1-\alpha/2}} \leq \sigma \leq \frac{ \tilde{s}^2(n-1)}{z_{\alpha/2}}  $$&#xA;Hence the upper and lower bounds of your $1-\alpha$ confidence interval for the (unobserved) population variance:&#xA;\begin{align}&#xA;\sigma^+ = \frac{ \tilde{s}^2(n-1)}{z_{\alpha/2}},\quad \sigma^- = \frac{\tilde{s}^2(n-1)}{z_{1-\alpha/2}} &#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This could then help you construct $1-\alpha$ confidence bounds on the BS option price given the measure sample variance $\tilde{s}^2$:&#xA;$$ V^+ = \text{BSCall}(\sigma^+),\quad V^- = \text{BSCall}(\sigma^+)$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Edit]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given your desire to obtain a full distribution, why not opt for a Bayesian approach?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume the true population variance $\sigma^2$ follows a certain prior distribution with hyperparameter $\alpha$, $p(\sigma;\alpha)$ over $\Bbb{R}^+$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose that, for a specific sample, you measure a sample variance $s^2$ and wish to compute the posterior of the population variance. Bayes' rule gives:&#xA;$$ p(\sigma^2 \vert s^2, \alpha) = \frac{p(s^2 \vert \sigma^2)}{\int_0^\infty p(s^2 \vert \sigma^2) p(\sigma^2;\alpha) d\sigma^2 } p(\sigma^2; \alpha) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you know:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The prior distribution $p(\sigma^2; \alpha)$: you postulated it. &lt;/li&gt;&#xA;&lt;li&gt;The sampling distribution $p(s^2 \vert \sigma^2)$: $\quad s^2 \sim \sigma^2/(n-1) \chi^2_{n-1}$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Hence you have everything you need to compute the posterior distribution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously, if you stick with the Maxium A Posteriori (MAP) estimator, once again you'll have a pointwise estimate, so I suggest you to perform the full integration. Off the top of my head chi-squared distributions does not allow for conjugate priors so you might have to resort to numerical integration (e.g. adaptive quadrature and the likes).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, the choice of hyper-parameter $\alpha$ will have an impact on the resulting posterior: you might want to set $\alpha$ so that the prior distribution is centered around the sample variance for instance? &lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2016-10-03T07:20:54.567" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30379" PostTypeId="2" ParentId="30376" CreationDate="2016-09-30T12:49:45.603" Score="1" Body="&lt;p&gt;You have bigger problems to worry about than fiddly mathematics for confidence intervals.  To wit, the sample variance is an estimate of &lt;em&gt;past&lt;/em&gt; variability in the underlying.  The volatility in option pricing models is &lt;em&gt;future&lt;/em&gt; volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is well know that there are structural reasons past variability is biased &lt;em&gt;smaller&lt;/em&gt; than future variability under the Black-Scholes model.  We actually observe that in the financial markets.  Let's look at a simplified explanation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a more financially plausible model than Black-Scholes: one where the stock can suddenly go bankrupt due to fraud, and the volatility varies over time.  Neither model is perfect, but the new one (call it SVJ) will be &quot;less wrong&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mathematically, we no longer have the Black-Scholes SDE based on a single stochastic generator $W$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{dS}{S} = \mu dt + \sigma dW&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but rather an SDE with 3 generators: $W,Z$ and a jump process $J$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{dS}{S} = \mu dt + \sigma dW - dJ \\&#xA;d\sigma^2= \kappa(\bar{\sigma}^2-\sigma^2) dt + \eta \sigma^2 dZ&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we were to back out Black-Scholes volatility $\sigma_{BS}$ from option prices generated from the SVJ world,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;there would be skew, and&lt;/li&gt;&#xA;&lt;li&gt;we would find $\sigma_{BS} &amp;gt; \sigma$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Even if $\eta=0$, since no defaults have been observed our observations all come from the cases where we have only followed $W$.  Therefore observations of historical variance would cause us to underestimate $\sigma_{BS}=\sigma$.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2016-09-30T12:49:45.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30381" PostTypeId="2" ParentId="30374" CreationDate="2016-09-30T14:08:50.633" Score="3" Body="&lt;p&gt;Hint: you are looking for weights w1,w2,⋯,w15&#xA;such that the linear combination of the 15 stocks daily returns is maximally correlated with the S&amp;amp;P500 index returns published by S&amp;amp;P. There are method(s) in statistics that can find these weights. Some of these techniques restrict the weights to be positive and some do not. There is plenty of historical return data available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a shortcut (if you don't know how to do regressions, PCA, minimizing a quadratic subject to constraints, etc.) you could indeed re-normalize the market cap weights so they add up to 1 (divide each marketcap by the sum of the marketcaps of the 15 stocks), but this is not recommended because it assumes that the 15 stocks have been chosen to be representative of the mix of stocks in the S&amp;amp;P (the right number of tech stocks, oil stocks, big companies, small companies, etc). which in general will not be true. So the resulting weights will be biased. Do this only if the 15 stocks have been carefully chosen for diversification and balance.      &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, in 1987 Wm. Sharpe published &quot;An Algorithm for Portfolio Improvement,&quot;. This algorithm could be used, starting with an equal weighted mix of the 15 stocks, to modify the weights until the portfolio tracks the S&amp;amp;P 500 as well as possible (in the sense of minimizing the mean-square of the tracking error). I think this could be the best solution. &lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-09-30T15:22:54.190" LastActivityDate="2016-09-30T15:22:54.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30382" PostTypeId="1" CreationDate="2016-09-30T14:34:38.987" Score="1" ViewCount="420" Body="&lt;p&gt;I am new to the quant finance community...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a series of bond cash flows, its market prices and also the spot rates for the timing of those cash flows. How to find the Z-Spread that matches its market price in R?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have written a brute force code starting the Z-spread from zero and increasing it until the price equals market price. Is there any easy method than this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have 2000 bonds and I have to calculate Z-Spreads for all them...and running this brute force code for all them.. It takes 10 hourss.. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to simplify this...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance.&lt;/p&gt;&#xA;" OwnerUserId="24649" LastActivityDate="2016-09-30T14:34:38.987" Title="Find Z-Spread in R" Tags="&lt;bond&gt;&lt;yield-curve&gt;&lt;spread&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30383" PostTypeId="2" ParentId="30374" CreationDate="2016-09-30T14:38:10.070" Score="-1" Body="&lt;p&gt;Well, at first, if you find the way to track it perfectly, let me know, we start a fund, and then we talk about percentages....&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are talking about something called &quot;smart beta&quot;. You want to replicate an index using the minimum number of stocks with the greatest correlation, and R^2. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did an approach when I was studying, it was simple, just using excel and solver. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a certain date, you multiply the returns of each stock to a weight (w1,w2..). Then, you add all the resulting multiplications into a cell. Finally, using solver, make that cell to be 1 (with a minimum error). And there you go!&lt;/p&gt;&#xA;" OwnerUserId="12089" LastActivityDate="2016-09-30T14:38:10.070" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30384" PostTypeId="2" ParentId="30374" CreationDate="2016-09-30T16:30:02.790" Score="2" Body="&lt;p&gt;&lt;a href=&quot;http://eu.wiley.com/WileyCDA/WileyTitle/productCd-0470080140.html&quot; rel=&quot;nofollow&quot;&gt;Maginn et al. (2007)&lt;/a&gt; suggest one of two approaches: optimization and stratified sampling. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Optimization. First, you select some factor model which (you believe) best captures major risk factors in your universe. Then you select portfolio of 15 stocks so that this resulting portfolio would minimize expected tracking risk of original portfolio (S&amp;amp;P500 in our case). That's quite standard task performed by, say, built-in Bloomberg portfolio optimizer. &lt;/li&gt;&#xA;&lt;li&gt;Stratified sampling. You apply &lt;a href=&quot;http://www.morningstar.com/InvGlossary/morningstar_style_box.aspx&quot; rel=&quot;nofollow&quot;&gt;&quot;Morningstar style box&quot;&lt;/a&gt;, or similar multidimensional structure to S&amp;amp;P500. Again, to do it you have to select factors (i.e. dimensions) which you believe to best describe your universe (i.e. S&amp;amp;P500). Then you'll have weights for each cell: for example, 10% of original index cap would be small-cap value stocks; 20% mid-cap value etc.etc. Then you select, say, 2 representative stocks in each cell (for total 18 stocks) and balance its weights so that style box for these 18-stock index would be similar to the one of S&amp;amp;P500. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;" OwnerUserId="6535" LastEditorUserId="6535" LastEditDate="2016-09-30T16:37:32.650" LastActivityDate="2016-09-30T16:37:32.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30385" PostTypeId="2" ParentId="30331" CreationDate="2016-09-30T16:59:05.653" Score="1" Body="&lt;p&gt;I think, an interesting point to start is &lt;a href=&quot;http://www.portfolioprobe.com/2012/01/05/the-top-7-portfolio-optimization-problems/&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt; blog post in PortfolioProbe. At least you'll have a feeling about some drawbacks of traditional methods, and how these drawbacks are traditionally offsetted (or failed to be offsetted). Then, I think, papers and &lt;a href=&quot;http://symmys.com/attilio-meucci/book&quot; rel=&quot;nofollow&quot;&gt;book&lt;/a&gt; by Attilio Meucci have some interesting ideas. &#xA;Then, for many years I have heard about progress of behavioral finance, but this theory (as far as I understand) is purely descriptive; do we have something prescriptive, based on BF? I don't know, but would happily read, if there would be something. Finally, another interesting idea is some theory that would encompass somehow the fact, that in reality decisions are made not by 'representative agent', but by group with its own dynamics. Perhaps that might have some implications on aggregated level (or not? That's just an idea.) &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;" OwnerUserId="6535" LastActivityDate="2016-09-30T16:59:05.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30386" PostTypeId="1" CreationDate="2016-09-30T18:50:00.660" Score="2" ViewCount="1204" Body="&lt;p&gt;In Credit Risk terminology, is the Exposure at Default(EAD) the same thing as the total Credit LIMIT amount on the Loan? Because if Bank gives a loan with a limit of 10,000$ and the borrower has a balance of 2000, at default, he will probably max out the loan; So should the EAD not be the same as the limit amount?&lt;/p&gt;&#xA;" OwnerUserId="218" LastActivityDate="2019-11-02T16:36:11.577" Title="Is exposure at default the same thing as the limit amount on a loan?" Tags="&lt;credit-risk&gt;&lt;default-probability&gt;&lt;exposure&gt;" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30389" PostTypeId="1" CreationDate="2016-09-30T23:24:51.630" Score="0" ViewCount="56" Body="&lt;p&gt;I've been practicing R for about several months, and have begun transitioning from text book examples to what actually interests me. I'm currently participating in the CFA program, but my programming skills are lackluster.  Not asking for code, but a push in the right direction!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was able to pull the stock data for DJIA, but am having trouble getting a handle on the data. Questions: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;What is the easy way to get a hand on the data?&lt;/li&gt;&#xA;&lt;li&gt;How can I quickly write a function to pull daily returns from each 30 XTS Objects -&gt; apply? lapply? Create a new function?&lt;/li&gt;&#xA;&lt;li&gt;Should I be focusing on trying to aggregate all price points into one data frame?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Anything else or other resources you might share would be highly beneficial. &lt;/p&gt;&#xA;" OwnerUserId="24653" LastEditorUserId="35" LastEditDate="2016-10-01T01:46:05.157" LastActivityDate="2016-11-30T05:06:41.677" Title="DJIA Portoflio Optimization" Tags="&lt;optimization&gt;&lt;portfolio&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30390" PostTypeId="2" ParentId="20799" CreationDate="2016-10-01T00:20:56.890" Score="3" Body="&lt;p&gt;Strategy (B) will always win. In most simple sense, you are achieving a yield of 0.80% for investment in the first year, and sell-buying back at 0.80% for investment in the second  year (because as you state the yield curve has not moved). This is known as carry. There is an indirect gain through price-roll, too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Strategy (A) will perform poorly. In your scenario, the yield curve is monotonically increasing (upward sloping). The initial yield is 0.24% [clearly 56bp less carry than (B)], and the roll-down is relatively modest. Bond prices tend to behave oddly in the final days/weeks of trading, as a variety of market participants fund and arbitrage in very different ways. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have a look at money market instruments to discover more.&lt;/p&gt;&#xA;" OwnerUserId="21023" LastActivityDate="2016-10-01T00:20:56.890" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30391" PostTypeId="2" ParentId="20826" CreationDate="2016-10-01T00:37:49.113" Score="0" Body="&lt;p&gt;There are very plausible investment situations where large local or global money managers are obliged to, say buy ten year bond notes with sufficient demand  to substantially lift the price when concurrently the economic discussion at an FOMC meeting results in a monetary policy hike.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question raises a &lt;strong&gt;tricky comparison&lt;/strong&gt; of overnight indexing rates (Fed Funds) with a ten year investment instrument. Clearly the participants' objective in each market are different. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You &lt;em&gt;may&lt;/em&gt; prefer to look at ten year IRS, potentially ten year OIS-indexed IRS where the underlying floating rate is sufficiently close to (or proxied by) Fed Funds rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try a statistical regression of ten year note yields against fed fund rates. Add an instrument or two, if linear regression, and I'd suggest &lt;em&gt;2y10y curve&lt;/em&gt; as a proxy for the economic regime and &lt;em&gt;USD FI fund inflows&lt;/em&gt; or &lt;em&gt;M3 money supply&lt;/em&gt; to account for investment flow. &lt;/p&gt;&#xA;" OwnerUserId="21023" LastEditorUserId="21023" LastEditDate="2016-10-13T19:52:19.523" LastActivityDate="2016-10-13T19:52:19.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30392" PostTypeId="2" ParentId="30348" CreationDate="2016-10-01T02:37:33.183" Score="3" Body="&lt;p&gt;For a more readable output of the fit you can use the function summary():&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;require(MSGARCH)&#xA;&#xA;data(&quot;sp500&quot;)&#xA;&#xA;snp &amp;lt;- as.matrix(sp500)&#xA;&#xA;&#xA;spec &amp;lt;- MSGARCH::create.spec(model = c(&quot;sGARCH&quot;,&quot;sGARCH&quot;,&quot;sGARCH&quot;), &#xA;                             distribution = c(&quot;norm&quot;,&quot;norm&quot;,&quot;norm&quot;), &#xA;                             do.skew = c(FALSE,FALSE,FALSE), &#xA;                             do.mix = FALSE, &#xA;                             do.shape.ind = FALSE)&#xA;set.seed(123) &#xA;&#xA;fit &amp;lt;- MSGARCH::fit.mle(spec = spec, y = snp, ctr = list(do.init = FALSE, do.enhance.theta0 = TRUE))&#xA;&#xA;summary(fit)&#xA;[1] &quot;Specification Type: Markov-Switching&quot;&#xA;[1] &quot;Specification Name: sGARCH_normal_sym sGARCH_normal_sym sGARCH_normal_sym&quot;&#xA;[1] &quot;Number of parameters in each variance model: 3 3 3&quot;&#xA;[1] &quot;Number of parameters in each distribution: 0 0 0&quot;&#xA;[1] &quot;Default parameters:&quot;&#xA;     alpha0_1 alpha1_1 beta_1 alpha0_2 alpha1_2 beta_2 alpha0_3 alpha1_3 beta_3         P         P         P         P&#xA;[1,]      0.1      0.1    0.8      0.1      0.1    0.8      0.1      0.1    0.8 0.3333333 0.3333333 0.3333333 0.3333333&#xA;             P         P&#xA;[1,] 0.3333333 0.3333333&#xA;[1] &quot;DEoptim initialization: FALSE&quot;&#xA;[1] &quot;Fitted Parameters:&quot;&#xA;         alpha0_1   alpha1_1   beta_1 alpha0_2   alpha1_2    beta_2  alpha0_3  alpha1_3   beta_3       P          P&#xA;[1,] 0.0003991736 0.07382696 0.925262    1e-04 0.02250533 0.8543849 0.0848339 0.1587613 0.836886 0.72136 0.03285818&#xA;             P          P         P         P&#xA;[1,] 0.1856006 0.00248085 0.3555367 0.3865909&#xA;[1] &quot;Transition matrix:&quot;&#xA;               t = 1      t = 2     t = 3&#xA;t + 1 = 1 0.72135997 0.18560065 0.3555367&#xA;t + 1 = 2 0.03285818 0.00248085 0.3865909&#xA;t + 1 = 3 0.24578185 0.81191850 0.2578724&#xA;[1] &quot;Stable probabilities:&quot;&#xA;        Stable probabilities&#xA;State 1            0.5214967&#xA;State 2            0.1460292&#xA;State 3            0.3324741&#xA;[1] &quot;Unconditional volatility:&quot;&#xA;       State 1    State 2 State 3&#xA;[1,] 0.6619352 0.02850059 4.41474&#xA;Log-kernel:  -6517.631 &#xA;AIC:  13209.02 &#xA;BIC:  13305.3&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you only want to output the transition matrix you can use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;MSGARCH::transmat(fit)&#xA;               t = 1      t = 2     t = 3&#xA;t + 1 = 1 0.72135997 0.18560065 0.3555367&#xA;t + 1 = 2 0.03285818 0.00248085 0.3865909&#xA;t + 1 = 3 0.24578185 0.81191850 0.2578724&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There are 6 parameters because the other 3 are redundant since it is 1 minus the sum of the other probabilities associated to the same state.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The negative value was a bug that just has been fixed in the development version where the function transforming the parameter vector into the transition matrix was incorrect when the number of states was above 2. Also, we would sometimes obtain negative value when the optimizer did not converge. We made a change to the optimization scheme to avoid this as much as possible. You can download the source code or the tarball of the development version on Github. It will be on CRAN soon.&lt;/p&gt;&#xA;" OwnerUserId="24655" LastEditorUserId="24655" LastEditDate="2016-10-01T06:36:56.140" LastActivityDate="2016-10-01T06:36:56.140" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30393" PostTypeId="2" ParentId="30389" CreationDate="2016-10-01T04:56:30.047" Score="1" Body="&lt;p&gt;It is simple once you get the hang of it. I suggest you research the &lt;code&gt;apply()&lt;/code&gt; family of functions. If you want to pull data from yahoo simply use the following example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quantmod)&#xA;# use lapply- notice each ticker is separated by ';'&#xA;A &amp;lt;-  lapply(&quot;AAPL;AMZN;GOOGL&quot;, getSymbols)&#xA;&#xA;# just add the tickers within the quotation marks separated by semi colons. Also, if the ticket you entered is incorrect or does not exist, it will break so make sure your tickers are correct. &#xA;&#xA;# I wrote this on my phone, but i believe that the function will get you OHLCV for each ticker and return them into A&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13428" LastEditorUserId="13428" LastEditDate="2016-10-01T05:02:16.317" LastActivityDate="2016-10-01T05:02:16.317" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30395" PostTypeId="1" AcceptedAnswerId="30416" CreationDate="2016-10-01T11:10:39.317" Score="0" ViewCount="109" Body="&lt;p&gt;I am trying to model a joint distribution $f(X_1,X_2)$  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(where $X_1$ and $X_2$ are market prices of the options) and then find from it the value of joint payoff price:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$F(X_1, X_2; B_1, B_2) = E[ max(X_1-B_1,0) * max(B_2 -X_2,0)] $ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $B_1$ and $B_2$ are corresponding strike prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have limited samples of individual payoffs $Q_1$ and $Q_2$ for different values of  $B_1$ and $B_2$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Q_1(X_1,X_2;B2) = E[X_1 * max(B_2-X_2,0)]$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Q_2(X_1,X_2;B1) = E[X_2 * max(X_1-B_1,0)]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C(X;k) = E[max(0,X_T - k)]$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to solve this with or without assuming that $X_1$ and $X_2$ are independent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am new to modelling option-prices.&lt;/p&gt;&#xA;" OwnerUserId="24661" LastEditorUserId="24661" LastEditDate="2016-10-02T08:37:25.263" LastActivityDate="2016-10-03T12:43:22.240" Title="Get expected joint-payoff price of digital options from individual payoffs" Tags="&lt;options&gt;&lt;expected-return&gt;&lt;payoff&gt;&lt;joint-probability&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30396" PostTypeId="2" ParentId="30113" CreationDate="2016-10-02T02:46:40.147" Score="1" Body="&lt;p&gt;Computer programmers use the &lt;a href=&quot;http://csrc.nist.gov/groups/ST/toolkit/rng/documentation_software.html&quot; rel=&quot;nofollow&quot;&gt;NIST test Suite&lt;/a&gt; to evaluate the quality of pseudo-random number generators.  I've been interested in using it to test market data for periods of stability (represented by high randomness) and periods of state transition (represented by low randomness).  Multiple implementations exist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A discussion of using the NIST suite to test randomness of financial data can be found &lt;a href=&quot;http://www.turingfinance.com/hacking-the-random-walk-hypothesis/&quot; rel=&quot;nofollow&quot; title=&quot;here&quot;&gt;in this article&lt;/a&gt; along with the author's details on his own implementation of the test suite.&lt;/p&gt;&#xA;" OwnerUserId="9413" LastActivityDate="2016-10-02T02:46:40.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30397" PostTypeId="1" AcceptedAnswerId="30426" CreationDate="2016-10-02T04:26:14.057" Score="13" ViewCount="3145" Body="&lt;p&gt;I have already figured out that Delta-hedging essentially turns European options into volatility products where you pay implied vol and get paid realized vol for long positions and you pay realized vol and get paid implied vol for short positions. I have also discovered that market-making in European options generally is conducted by using volatility models to project vol for some underlying asset and then quoting bid and ask prices using the pricing model subject to the projected vol and finally delta-hedging all option positions that get filled by the market. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the effect of delta-hedging exotic options? Does it have the same effect of turning the exotic options into volatility-based payoff products as opposed to directional price movement payoff products? Do market-makers in exotic options delta-hedge their positions just like is done with vanilla products?&lt;/p&gt;&#xA;" OwnerUserId="24628" LastActivityDate="2016-11-06T12:00:50.537" Title="Delta-Hedging Exotic Options" Tags="&lt;delta-hedging&gt;&lt;exotics&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="17" ContentLicense="CC BY-SA 3.0" />
  <row Id="30398" PostTypeId="1" AcceptedAnswerId="30820" CreationDate="2016-10-02T05:01:19.660" Score="11" ViewCount="25626" Body="&lt;p&gt;As the title reads, what is the difference between credit risk and counterparty credit risk? What are the key differences?&lt;/p&gt;&#xA;" OwnerUserId="5839" LastActivityDate="2017-10-04T04:26:58.417" Title="What's the difference between credit risk and counterparty credit risk?" Tags="&lt;credit-risk&gt;&lt;credit&gt;" AnswerCount="6" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30400" PostTypeId="2" ParentId="30398" CreationDate="2016-10-02T07:33:50.710" Score="2" Body="&lt;p&gt;Please read carefully.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I give you the use we have where I work but it might not be the correct one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Credit risk will refer to spread moves.&#xA;Counterparty credit risk will focus on exposure and loss given default.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-10-02T07:33:50.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30401" PostTypeId="2" ParentId="30297" CreationDate="2016-10-02T09:02:25.687" Score="1" Body="&lt;p&gt;For shorter term market risk indicators I believe that watching for signs of systemic stress is a good idea. IV indices (Vix, MOVE (bonds), JP Morgan G10 and EM FX IV), LIBOR-OIS, CDS spreads, forward points (or its inverse, implied yield), Offshore-Onshore yields and cross-currency basis swaps should all feature on a daily risk monitor. No harm watching cross-asset spot and IV as well as action in other asset classes can quickly spread or move concurrently with FX. Longer term watching for signs of fundamental deterioration in countries' external accounts, budget sustainability and fair value via econometric models helps to keep the medium term trend in mind.&lt;/p&gt;&#xA;" OwnerUserId="16027" LastActivityDate="2016-10-02T09:02:25.687" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30402" PostTypeId="1" CreationDate="2016-10-02T09:17:04.093" Score="1" ViewCount="276" Body="&lt;p&gt;I am stuck at a assignment problem where I have to compute the price of an exotic option. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am given the values the prices of option $C(X;k) = E[max(0,X_T - k)]$ for different strike prices $k$ and I have to compute the exotic price &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$D(X;k) = E[I(X_T &amp;gt; k)]$ for the same set of $k$s.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did this using difference of sum and got &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$D(X;k) = C(X;k) - C(X;k+1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now using these I have to compute another exotic price:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P(X;k) = E[max(X_T - k,0)^2]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried using the same method to get : &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P(X;k) - P(X;k-1) = 2C(X;k) - D(X;k+1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but to numerically calculate $P(X;k)$ at some k, I need the value of $P(X;k+1)$ and I have no initial value for the pricing $P$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be great&lt;/p&gt;&#xA;" OwnerUserId="24661" LastActivityDate="2016-10-02T09:17:04.093" Title="Pricing Exotic options" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;exotics&gt;&lt;binary-options&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30403" PostTypeId="1" AcceptedAnswerId="30467" CreationDate="2016-10-02T10:03:51.527" Score="2" ViewCount="369" Body="&lt;p&gt;Stock prices are not stationary processes during all week or all day. For example EURGBP has low variability at night in Europe but during working hours is changing much more dynamic because of market liquidity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to collect history data (15 minutes interval), calculate ARIMA coefficients and get prediction in R. But it is sensless to include data from night hours if I trade only during day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, is it possible to create ARIMA model based on discontinous data series (like 10:00 - 16:00 Monday, 10:00 - 16:00 Tuesday, 10:00 - 16:00 Wednesday, etc.)? &#xA;How to merge this data minimizing the error (price from Tuesday 10:00 de facto is not next price after Monday 16:00)?&lt;/p&gt;&#xA;" OwnerUserId="24672" LastActivityDate="2020-07-27T11:17:27.580" Title="ARIMA model coefficients from discontinuous data series" Tags="&lt;time-series&gt;&lt;r&gt;&lt;stochastic-processes&gt;&lt;fx&gt;&lt;arima&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30404" PostTypeId="2" ParentId="30398" CreationDate="2016-10-02T13:30:26.290" Score="2" Body="&lt;p&gt;There is no significant difference between the two. Both can be considered a financial risk, although credit risk appear to have a slightly broader view. You might also hear the term default risk used.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suppose technically you could argue credit risk relates specifically to the extension of credit (a one sided risk), and counterparty risk relates to the risk in two sided transactions (e.g. credit swaps). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ultimately, both are used to consider the loss due to opposing party in any transaction failing to live up to their obligation(s) on the basis of either ability or willingness.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might also want to look into settlement risk, a non-financial risk also know as Herstatt Risk, which relates to the failure of a counterparty to deliver after you've delivered on your obligation.&lt;/p&gt;&#xA;" OwnerUserId="24676" LastActivityDate="2016-10-02T13:30:26.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30405" PostTypeId="1" CreationDate="2016-10-02T17:44:48.700" Score="2" ViewCount="1132" Body="&lt;p&gt;This is from Hull, problem 6.16.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose that it is February 20 and a treasurer realizes that on July 17 the company will have to issue \$5 million of commercial paper with a maturity of 180 days. If the paper were issued today, the company would realize \$4,820,000. (In other words, the company would receive \$4,820,000 for its paper and have to redeem it at $5,000,000 in 180 days' time.) The September Eurodollar future price is quoted as 92.00. How should the treasurer hedge the company's exposure?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;So I know the relevant formula here for the number of contracts is $N=\frac{portfolioForwardValue}{futureContractPrice} \frac{portfolioDuration}{futuresDuration}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The given solution says $\frac{portfolioDuration}{futuresDuration} =2$ because the commercial paper's maturity is twice that of the future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't understand this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Isn't the treasurer's goal to ensure there will be \$5 million available in July? In that case $portfolioDuration$ is February to July while $futuresDuration$ is February to September. So shouldn't $\frac{portfolioDuration}{futuresDuration} = \frac{5}{7}$?&lt;/p&gt;&#xA;" OwnerUserId="19800" LastActivityDate="2019-10-21T10:22:55.133" Title="Hedging with interest rate futures, different duration" Tags="&lt;interest-rates&gt;&lt;hedging&gt;&lt;eurodollars&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30406" PostTypeId="1" CreationDate="2016-10-02T18:28:19.720" Score="2" ViewCount="756" Body="&lt;p&gt;I read the Wikipedia articles, and it implied that it was different: &lt;a href=&quot;https://en.wikipedia.org/wiki/Regression_toward_the_mean&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Regression_toward_the_mean&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In finance, the term mean reversion has a different meaning. Jeremy Siegel uses it to describe a financial time series in which &quot;returns can be very unstable in the short run but very stable in the long run.&quot; More quantitatively, it is one in which the standard deviation of average annual returns declines faster than the inverse of the holding period, implying that the process is not a random walk, but that periods of lower returns are systematically followed by compensating periods of higher returns, in seasonal businesses for example.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I was of the impression it was practically the same thing. Just that one might be more general than the other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm asking in the context of both financial instrument price/ror, e.g., stock prices, and cash flow analysis when doing DCF.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does it make sense to say that we are using an assumption of &quot;mean reversion&quot; of past cash flows when we estimate future cash flows as the mean of past cash flows? (The investment object in question has stabil/sideways cash flow.)&lt;/p&gt;&#xA;" OwnerUserId="2792" LastActivityDate="2016-10-02T18:28:19.720" Title="Is there a difference between &quot;regression toward the mean&quot; vs &quot;mean reversion&quot;, in the context of financial time series and cash flow analysis?" Tags="&lt;time-series&gt;&lt;mean-reversion&gt;&lt;dcf&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30408" PostTypeId="2" ParentId="30403" CreationDate="2016-10-02T20:47:07.637" Score="1" Body="&lt;p&gt;When you say discontinuous, you are referring to the clock time. So depending on your assumptions, it may not be discontinuous in trading time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For some securities that are not trading over night and are relatively stable during off hours, you might as well safely ignore the off hours and make the time series continuous. While for others that trade continuously, in case you have NA's in your data after aggregation, you might need to interpolate the time series, although various interpolation method introduces different biases. &lt;/p&gt;&#xA;" OwnerUserId="17835" LastActivityDate="2016-10-02T20:47:07.637" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30412" PostTypeId="1" AcceptedAnswerId="30413" CreationDate="2016-10-03T02:14:56.673" Score="0" ViewCount="129" Body="&lt;p&gt;An investor has initial wealth $30000$ and utility function $\ln{x}$. He is planning to invest in a project where he has $60%$ chance of gaining $\alpha%$ and $40%$ chance of losing $\beta%$. Express the certainty equivalent of this investment in terms of $\alpha$ and $\beta$. If $\beta=20$, find the range of values of $\alpha$ for which the investor will avoid this investment.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{array}{c|lcr}&#xA; \text{p} &amp;amp; \text{x} &amp;amp; \text{$U(W_0+x)$} \\&#xA;\hline&#xA;0.6 &amp;amp; 30000(1+0.0\alpha ) &amp;amp; U[30000(1+0.0\alpha )] \\&#xA;0.4 &amp;amp; 30000(1+0.0\beta ) &amp;amp; U[30000(1+0.0\beta )] \\&#xA;\end{array}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Certainty equivalent&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$=0.6\ln30000[(1+0.0\alpha )]+0.4\ln[30000(1+0.0\beta )]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Introducing $\beta=20$ and since avoid investment&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$=0.6\ln[30000(1+0.0\alpha )]+0.4\ln(24000) \le \ln{30000}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solving this I get $\alpha$ to be negative. There exist some error somewhere.&lt;/p&gt;&#xA;" OwnerUserId="24518" LastActivityDate="2016-10-03T13:49:25.330" Title="Utility function for avoiding investment" Tags="&lt;finance-mathematics&gt;&lt;utility-theory&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30413" PostTypeId="2" ParentId="30412" CreationDate="2016-10-03T09:12:19.037" Score="1" Body="&lt;p&gt;Assuming that $W_0$ is the initial wealth and that $\alpha$ and $\beta$ are &lt;em&gt;yields of return&lt;/em&gt;, the final wealth is a discrete random variable&#xA;\begin{align}&#xA;W_T = \begin{cases}&#xA;W_0(1+\alpha) &amp;amp;\text{ with probability }\quad p=0.6\\&#xA;W_0(1-\beta) &amp;amp;\text{ with probability }\quad 1-p=0.4&#xA;\end{cases}&#xA;\end{align}&#xA;The investment should be avoided iff the expected utility of the terminal wealth is smaller than or equal to that of the initial fortune:&#xA; $$\Bbb{E}[ U(W_T) ] \leq U(W_0) $$ &#xA;this gives&#xA;\begin{align}&#xA;&amp;amp; 0.6 \ln(W_0(1+\alpha)) + 0.4\ln(W_0(1-\beta)) \leq \ln(W_0) \\&#xA;\iff&amp;amp; 0.6 \ln(W_0) + 0.6\ln(1+\alpha) + 0.4\ln(W_0) + 0.4\ln(1-\beta) \leq \ln(W_0) \\&#xA;\iff&amp;amp; \ln(1+\alpha) \leq -\frac{2}{3}\ln(1-\beta)&#xA;\end{align}&#xA;Further assuming $\beta = 20\%$ yields the following range of values of $\alpha$ for which the investor will avoid this investment.&#xA;$$\alpha \leq \exp(-2/3\ln(1-\beta)) - 1 \approx 16.04\% $$&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-10-03T13:49:25.330" LastActivityDate="2016-10-03T13:49:25.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30414" PostTypeId="2" ParentId="30403" CreationDate="2016-10-03T09:23:34.103" Score="0" Body="&lt;p&gt;I would recommend you to use the whole information (to include data from night hours) : firstly adjust your data for the intra-day periodicity with a deterministic function, secondly you can  fit your arima on the periodicity adjusted series. You'll be able to recover the original non-adjusted series by post-multiplying your mean estimates by the deterministic factor. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also here : &lt;a href=&quot;https://quant.stackexchange.com/questions/22435/is-that-a-good-way-to-work-with-the-arma-model/22456#22456&quot;&gt;Is that a good way to work with the ARMA model?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-10-03T09:23:34.103" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30416" PostTypeId="2" ParentId="30395" CreationDate="2016-10-03T12:43:22.240" Score="1" Body="&lt;p&gt;Suppose you would like to compute&#xA;\begin{align}&#xA;Q_1(x_1,x_2;B) &amp;amp;= \Bbb{E}[X_1\max(B-X_2,0)]\\&#xA;Q_2(x_1,x_2;B) &amp;amp;= \Bbb{E}[X_2\max(X_1-B,0)]&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where you know the marginal probability density functions $p_{X_1}(u)$ and $p_{X_2}(v)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's start by focusing on $Q_1$. By definition, the expectation equivalently writes:&#xA;$$ Q_1(x_1,x_2;B) = \int_0^\infty \int_0^\infty u \max(B-v,0)\, p_{X_1X_2}(u,v) du dv $$&#xA;where $p_{X_1X_2}$ figures the &lt;em&gt;joint probability density function&lt;/em&gt; of random variables $X_1$ and $X_2$:&#xA;$$ p_{X_1X_2}(u,v) = p_{X_1 \vert X_2 = v}(u) p_{X_2}(v) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Case 1: $X_1$ and $X_2$ are independent]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then by definition&#xA;$$ p_{X_1 \vert X_2 = v}(u) = p_{X_1}(u) $$&#xA;and we have (Fubini)&#xA;\begin{align}&#xA;Q_1(x_1,x_2;B) &amp;amp;= \int_0^\infty \int_0^\infty u \max(B-v,0)\, p_{X_1}(u) p_{X_2}(v) du dv \\&#xA;&amp;amp;= \int_0^\infty u p_{X_1}(u) du \int_0^\infty \max(B-v,0) p_{X_2}(v) dv \\&#xA;&amp;amp;= \Bbb{E}[X_1] \Bbb{E}[\max(B-X_2,0)]&#xA;\end{align}&#xA;which you know how to solve since you know the marginals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Case 2: $X_1$ and $X_2$ are not independent]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The marginals do not suffice: you need an assumption concerning the dependence structure of $X_1$ and $X_2$. Your question amounts then to saying, &quot;can I infer a unique dependence structure from the knowledge of $Q_1$ and $Q_2$&quot;, the answer is no. The intuition behind that is given in &lt;a href=&quot;https://quant.stackexchange.com/questions/12855/joint-distribution-from-expectations&quot;&gt;this SE question&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-10-03T12:43:22.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30417" PostTypeId="1" AcceptedAnswerId="30420" CreationDate="2016-10-03T13:44:25.717" Score="6" ViewCount="10547" Body="&lt;p&gt;Say a 5% bond using 30/360 convention, 2 coupons per year. Last coupon payment was on 2016-04-01. Now 2016-10-01 is weekend and the coupon is paid on 2016-10-03. Is this coupon 2.5 or slightly more than 2.5?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is accrued interest on 2016-09-30? On 2016-10-03?&lt;/p&gt;&#xA;" OwnerUserId="23879" LastActivityDate="2017-07-25T20:27:45.807" Title="What happens to accrued interest and coupon payment if coupon date is weekend?" Tags="&lt;bond&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30419" PostTypeId="2" ParentId="30417" CreationDate="2016-10-03T19:12:13.323" Score="1" Body="&lt;p&gt;Doing the calculation on the &lt;a href=&quot;http://apps.finra.org/Calcs/1/AccruedInterest&quot; rel=&quot;nofollow&quot;&gt;FINRA calculator&lt;/a&gt; gives an estimate - &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming purchase date of 2016-04-01, &#xA;2016-09-30 would be a hold period of 179 days:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Accrued Interest 2.486 %&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Value of Accrued Interest    $24.86&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And 2016-10-03 would be a holding period of 182 days:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Accrued Interest 2.528 %&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Value of Accrued Interest    $25.28&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Granted, this does not account for the settlement period of the bond (which will have to be included when traded) which will raise your final accrued interest to 184 holding days: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Accrued Interest 2.556 %&lt;/li&gt;&#xA;&lt;li&gt;Value of Accrued Interest    $25.56&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="24503" LastActivityDate="2016-10-03T19:12:13.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30420" PostTypeId="2" ParentId="30417" CreationDate="2016-10-03T20:09:53.717" Score="7" Body="&lt;p&gt;For the vast majority of bonds, as other commenters have pointed out, coupon sizes are generally not affected by bad days (i.e., holidays and weekends), so for a bond with semi-annual coupon payments, the coupon size will (almost) always be as simple as $c/2$. Some exceptions are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Bonds with irregular first coupon periods: The first coupon period spans from the dated date (aka the first interest accrual date) and the first coupon date. If this period is not exactly a full coupon period (can be longer or shorter), then the coupon size must be calculated as $\text{DCF} \times c$, where $\text{DCF}$ is calculated as the day count fraction between the dated date and the first coupon date (usually NOT adjusted for holidays/weekends) using the correct day count convention.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Bonds with irregular last coupon periods: Similarly, the last coupon period, spanning from the penultimate coupon date and the maturity date, may not be a full coupon period. In these cases, the coupon size is also calculated as $\text{DCF} \times c$, where $\text{DCF}$ is calculated as the day count fraction between the penultimate coupon date and the maturity date (neither of which is bad-day adjusted, most of the time).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Bonds whose cashflows that follow the &quot;exact accrual rule&quot;: These are quite rare and the only ones that come to mind are Thailand government bonds.** The cashflows for these bonds are based on the actual number of days for every coupon period.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;As to accrued interest, it should always be calculated using the day count fraction between the previous coupon date (NOT bad-day adjusted) and the settlement date (bad-day adjusted).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the example you cited, the coupon size should be 2.5, paid out on October 3. The accrued interests should be:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;For settlement on 9/30/2016: $179 / 360 \times 5 = 2.486111111111111$;&lt;/li&gt;&#xA;&lt;li&gt;For settlement on 10/3/2016: $2 / 360 \times 5 = 0.02777777777777778$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;** Another exception is term CDs.  Mayle (1993), a standard reference, notes that &quot;The interest flows for a term CD differ from those of any other periodic security in that the amount of each flow is determined by the number of days in its period as opposed to the number of periods per year.&quot;&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="28929" LastEditDate="2017-07-25T20:27:45.807" LastActivityDate="2017-07-25T20:27:45.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30424" PostTypeId="2" ParentId="30397" CreationDate="2016-10-04T09:03:10.003" Score="3" Body="&lt;p&gt;Delta-hedging can be seen from banks as &quot;manufacturing the product&quot;.&#xA;Banks are product manufacturers, so they delta-hedge.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Exotic options are options which are not volatility-only products.&#xA;They depend on volatility dynamics.&#xA;Delta-hedging exotic options need most of the time to use vanilla options in the hedging portfolio.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-10-04T09:03:10.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30426" PostTypeId="2" ParentId="30397" CreationDate="2016-10-04T12:45:41.183" Score="20" Body="&lt;p&gt;Consider reading &lt;a href=&quot;https://www.google.be/search?q=lorenzo%20bergomi%20book&amp;amp;oq=lorenzo%20bergomi%20book&amp;amp;aqs=chrome..69i57.3572j0j7&amp;amp;sourceid=chrome&amp;amp;es_sm=122&amp;amp;ie=UTF-8&quot; rel=&quot;noreferrer&quot;&gt;Lorenzo Bergomi&lt;/a&gt;'s excellent book -- or at least the &lt;strong&gt;first chapter&lt;/strong&gt; available &lt;a href=&quot;http://media.wix.com/ugd/c4ff5c_ba17141422d44ba99daf19ee2b931544.pdf&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt; for download --, it will help you clarify things.&lt;/p&gt;&#xA;&lt;p&gt;Some remarks as to your original question:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It is well known that, under a pure diffusion assumption, the total P&amp;amp;L of a delta hedged European option (i.e. an option whose payoff only depends on the value of the underlying asset at a future date &lt;span class=&quot;math-container&quot;&gt;$T$&lt;/span&gt;) over the horizon &lt;span class=&quot;math-container&quot;&gt;$[0,T]$&lt;/span&gt; writes:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ P\&amp;amp;L_{[0,T]} = \int_0^T \frac{1}{2} \underbrace{\Gamma(t,S_t,\sigma^2_{t,\text{impl.}})S_t^2}_{\text{Gamma dollar}}( \sigma^2_{t,\text{real.}} - \sigma^2_{t,\text{impl.}}) dt $$&lt;/span&gt;&#xA;As such, although a delta hedged European option portfolio is sensitive to the realised vs. implied volatility discrepancy, &lt;strong&gt;it is not a &lt;em&gt;pure&lt;/em&gt; volatility trade&lt;/strong&gt;: the Gamma dollar term introduces a dependency on the spot path. This Gamma dollar term should really be seen as some kind of &lt;em&gt;volatility accumulator&lt;/em&gt;: only along paths where the Gamma dollar is non zero will the discrepancy between realised and implied volatility matter.&lt;/li&gt;&#xA;&lt;li&gt;The previous relationship still holds for digital (or binary) options, since they are also European options after all. What you observe is thus simply a consequence of the fact that the &lt;strong&gt;Gamma map of a binary call is pretty different from that of a vanilla call&lt;/strong&gt; (see below): indeed, it is zero over most of the time to maturity/spot domain. As such the contribution of realised vs. implied volatility discrepancies to the total P&amp;amp;L is completely different: only what happens (1) around the strike, (2) near the expiry matters. This is why you did not observe a strong correlation between the resulting P&amp;amp;L and the realised vol over the &lt;em&gt;entire delta-hedging horizon&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/giHmU.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/giHmU.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Now with respect to delta hedging exotic options, quoting from Lorenzo Bergomi's &amp;quot;chapter's digest&amp;quot; and adding some of my own remarks:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Delta hedging removes the order-one contribution of &lt;span class=&quot;math-container&quot;&gt;$\delta S$&lt;/span&gt; to the P&amp;amp;L of an option position.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Although the &lt;strong&gt;expectation of the P&amp;amp;L&lt;/strong&gt; of a delta hedged portfolio is zero (provided you correctly anticipate the volatility - or variance - of future returns),&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Delta hedging is not adequate for reducing the &lt;strong&gt;standard deviation of the P&amp;amp;L&lt;/strong&gt; [...] The sources of the dispersion of this P&amp;amp;L are: (a) the tails of returns, (b) the volatility of realized volatility and the correlation of future realized volatilities.&lt;/p&gt;&#xA;&lt;p&gt;Using options for gamma-hedging (...)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;In other words, using other vanilla options to locally cancel the gamma dollar term,&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;immunizes us against &lt;strong&gt;realized volatility&lt;/strong&gt; (...) Dynamical trading of vanilla options, however, exposes us to uncertainty as to future levels of &lt;strong&gt;implied volatilities&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Hence the need of stochastic volatility models for modelling the dynamics of implied volatility.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Exotic options often depend in a complex way on the dynamics of implied volatilities&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;An exposure which is usually dealt with by trading vanilla options. See for instance the case of a (relative) forward-start at the money call in a homogeneous diffusion model. In that very specific case, we do not care about delta hedging anymore since it is only the dynamics of forward volatility that matters. One way want to neutralise such an exposure using calendar spreads.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-11-06T12:00:50.537" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="30427" PostTypeId="1" AcceptedAnswerId="30436" CreationDate="2016-10-04T13:04:17.487" Score="4" ViewCount="512" Body="&lt;p&gt;I am looking at a paper by V. Piterbarg, &lt;em&gt;Funding beyond discounting: collateral agreements and derivatives pricing&lt;/em&gt;, that you can download on the following &lt;a href=&quot;http://www.risk.net/digital_assets/5582/risk_0210_piterbarg_newer.pdf&quot; rel=&quot;nofollow&quot;&gt;link&lt;/a&gt;, in which the author adapts the Black-Scholes pricing framework to introduce collateral and funding at a non-risk-free rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Letting $V_t \equiv V(t)$ and $C_t \equiv C(t)$, I am having trouble to go from equation $(3)$...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ V_t = E_t \left[ e^{-\int_t^Tr_F(u)du}V_T+\int_t^Te^{-\int_t^ur_F(v)dv}\left( r_F(u)-r_C(u)\right) C_u \ du \right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;... to equation $(5)$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ V_t = E_t \left[ e^{-\int_t^Tr_C(u)du}V_T\right]-E_t \left[\int_t^Te^{-\int_t^ur_C(v)dv}\left( r_F(u)-r_C(u)\right) \left(V_u-C_u\right)du \right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to the author, to go from $(3)$ to $(5)$ we only need to &quot;&lt;em&gt;rearrange terms&lt;/em&gt;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anybody show how to go from one to the other?&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-10-09T15:35:58.747" LastActivityDate="2017-10-09T15:35:58.747" Title="Risk-neutral expectation equation with collateral and funding costs" Tags="&lt;black-scholes&gt;&lt;discounting&gt;&lt;collateral&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30429" PostTypeId="1" CreationDate="2016-10-04T13:29:55.623" Score="0" ViewCount="696" Body="&lt;p&gt;In the past, most literature assumed a risk-averse investor to model utility preferences. This includes the CRRA and CARA utility functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In recent papers, researchers state that investors may be actually risk-seeking, based on e.g. various studies on option pricing (options provide high leverage and therefore trade at a premium).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone give examples of risk-seeking utility functions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2016-10-04T13:29:55.623" Title="Examples of risk-seeking utility functions?" Tags="&lt;option-pricing&gt;&lt;utility-theory&gt;&lt;leverage&gt;" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="30430" PostTypeId="1" CreationDate="2016-10-04T14:31:00.467" Score="1" ViewCount="149" Body="&lt;p&gt;I'm shopping for real time data API provider for treasury futures. Can anyone share any good ones?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="13375" LastActivityDate="2016-10-08T07:09:08.910" Title="Good real time API providers for treasury futures?" Tags="&lt;programming&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30432" PostTypeId="1" CreationDate="2016-10-04T17:15:24.803" Score="0" ViewCount="493" Body="&lt;p&gt;&quot;Suppose that f and g are the prices of traded securities dependent on a single source of uncertainty and define phi = f/g. The equivalent martingale measure shows that, when there are no arbitrage&#xA;opportunities, phi is a martingale for some choice of the market price of risk. What is more, for a given numeraire security g, the same choice of the market price of risk makes a martingale for all securities f. This choice of the market price of risk is the volatility of g.&quot; (Hull pg 636)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've seen the proof of this result in Hull, and it is clear mathematically. However, I am having trouble explaining the intuition behind EMM without resorting to the mathematical proof. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say you needed to explain it non-technically to an investor. How would you describe the general concepts behind EMM, (such as the choice of the numeraire, market price of risk, volatility of g, forward risk neutrality) and intuitively why EMM makes sense?&lt;/p&gt;&#xA;" OwnerUserId="17712" LastActivityDate="2016-10-04T17:15:24.803" Title="What is the intuition behind the equivalent martingale measure result?" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;stochastic-processes&gt;&lt;derivatives&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30433" PostTypeId="1" CreationDate="2016-10-04T17:31:09.720" Score="2" ViewCount="576" Body="&lt;p&gt;For my finance lecture we are currently on the topic of operation risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Scenarios play a vital role in the estimation of low frequency (or probability), high impact (or severity) events.  How could you estimate the probability of a scenario?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question is 2 marks, but would a step in the right direction be finding an appropriate distribution for frequency and severity of events.&lt;/p&gt;&#xA;" OwnerUserId="24376" LastEditorUserId="19887" LastEditDate="2016-10-05T14:43:24.773" LastActivityDate="2016-11-04T15:10:02.977" Title="How to estimate the probability of a scenario in general" Tags="&lt;probability&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30434" PostTypeId="1" CreationDate="2016-10-04T19:04:29.427" Score="1" ViewCount="113" Body="&lt;p&gt;Does anyone know where to get this paper?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Carr, Peter and R. Lee, January 2004, &quot;At-the-money Implied as a Robust Approximation of the Volatility Swap Rate.&quot; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On google scholar the paper appears to be a working paper (from 2004) from Bloomberg. So maybe should be asking how to access academic papers from Bloomberg.&lt;/p&gt;&#xA;" OwnerUserId="24697" LastActivityDate="2016-10-04T19:04:29.427" Title="&quot;At-the-money Implied as a Robust Approximation of the Volatility Swap Rate.&quot;" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;swaps&gt;&lt;vix&gt;" AnswerCount="0" CommentCount="3" ClosedDate="2016-10-08T16:01:50.890" ContentLicense="CC BY-SA 3.0" />
  <row Id="30435" PostTypeId="2" ParentId="30433" CreationDate="2016-10-04T19:33:18.863" Score="1" Body="&lt;p&gt;This is a particularly fascinating area of inference, at least in my opinion.  While you are asking for an estimation of the probability of an unlikely event, I'll instead offer a paper that presents a heuristic for detection of model error.  It is explicitly probability free.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://arxiv.org/ftp/arxiv/papers/1208/1208.1189.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Mathematical Definition, Mapping, and Detection of (Anti)Fragility&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Taleb has spent the majority of his professional life dealing with so-called &amp;quot;Black Swan Events&amp;quot; (a term he popularized with his book &amp;quot;The Black Swan&amp;quot;).&lt;/p&gt;&#xA;&lt;p&gt;To the point, finding an appropriate distribution of low frequency events is a particularly troublesome task that does not fit nicely into classical statistical inference.  Those events go to the heart of Hume's problem of induction, a topic that Taleb seems to have devoted his professional life to.&lt;/p&gt;&#xA;" OwnerUserId="24530" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-10-04T19:33:18.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30436" PostTypeId="2" ParentId="30427" CreationDate="2016-10-04T20:13:08.950" Score="6" Body="&lt;p&gt;One derivation is to replace $V_u$ in Equation $(5)$ using the expression given by Equation $(3)$ and then work out to reach $(5)$; see Appendix A in &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2220371&quot; rel=&quot;nofollow noreferrer&quot;&gt;this paper&lt;/a&gt; for more details. Here, we provide another derivation. See also &lt;a href=&quot;https://quant.stackexchange.com/questions/25949/expected-change-in-value-of-a-derivative-in-a-multicurve-framework/25951#25951&quot;&gt;this question&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We recall that, from $(2)$ of &lt;a href=&quot;http://www.risk.net/digital_assets/895/042-048_AR0310_Cuttingedge.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Piterbarg&lt;/a&gt;,&#xA;\begin{align*}&#xA;V_t = \Delta (t) S(t) + \gamma(t),&#xA;\end{align*}&#xA;where $\Delta (t)= \frac{\partial V(t)}{\partial S}$, and $\gamma(t)$ is the cash account that satisfies&#xA;\begin{align*}&#xA;d\gamma(t) &amp;amp;= \big[r_C(t) C(t) + r_F(t)(V(t)-C(t))-(r_R(t)-r_D(t))\Delta(t)S(t) \big]dt\\&#xA;&amp;amp;=\big[r_F(t)V(t) + (r_C(t)-r_F(t)) C(t)-(r_R(t)-r_D(t))\Delta(t)S(t) \big]dt.&#xA;\end{align*}&#xA;Moreover, based on Equation $(4)$ in the paper,&#xA;\begin{align*}&#xA;dS(t)/S(t) = (r_R(t)-r_D(t))dt + \sigma_S(t) dW_S(t).&#xA;\end{align*}&#xA;Then, from the self-financing condition,&#xA;\begin{align*}&#xA;dV_t &amp;amp;= \Delta (t) dS(t) + d\gamma(t)\\&#xA;&amp;amp;=\big[r_F(t)V_t + (r_C(t)-r_F(t)) C(t)\big]dt + \Delta (t)S(t)\sigma_S(t) dW_S(t). \tag{*}&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From $(*)$, &#xA;\begin{align*}&#xA;d\left(e^{-\int_0^t r_F(v)dv}V_t \right) &amp;amp;=-r_F(t)e^{-\int_0^t r_F(v)dv}V_tdt + e^{-\int_0^t r_F(v)dv}dV_t\\&#xA;&amp;amp;=e^{-\int_0^t r_F(v)dv}\big[(r_C(t)-r_F(t)) C(t)dt + \Delta (t)S(t)\sigma_S(t) dW_S(t)\big].&#xA;\end{align*}&#xA;Therefore,&#xA;\begin{align*}&#xA;e^{-\int_0^T r_F(v)dv}V_T-e^{-\int_0^t r_F(v)dv}V_t &amp;amp;=\int_t^Te^{-\int_0^u r_F(v)dv}\big[(r_C(u)-r_F(u)) C(u)du\\&#xA;&amp;amp;\qquad + \int_t^T\Delta (u)S(u)\sigma_S(u) dW_S(u).&#xA;\end{align*}&#xA;Taking conditional expectation with respect to $\mathscr{F}_t$ on both sides, we obtain that&#xA;\begin{align*}&#xA;E_t\left(e^{-\int_0^T r_F(v)dv}V_T \right)-e^{-\int_0^t r_F(v)dv}V_t &amp;amp;=E_t\left(\int_t^Te^{-\int_0^u r_F(v)dv}\big[(r_C(u)-r_F(u)) C(u)du\right),&#xA;\end{align*}&#xA;which leads to Equation $(3)$ in &lt;a href=&quot;http://www.risk.net/digital_assets/895/042-048_AR0310_Cuttingedge.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Piterbarg&lt;/a&gt;, that is,&#xA;\begin{align*}&#xA;V_t &amp;amp;= E_t\left(e^{-\int_t^T r_F(v)dv}V_T + \int_t^Te^{-\int_t^u r_F(v)dv}\big[(r_F(u)-r_C(u)) C(u)du\right)\tag{3}&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$$$&#xA;To derive Equation $(5)$, we note that, from $(*)$ above, by rearranging terms,&#xA;\begin{align*}&#xA;dV_t &amp;amp;= \big[r_F(t)V_t + (r_C(t)-r_F(t)) C(t)\big]dt + \Delta (t)S(t)\sigma_S(t) dW_S(t)\\&#xA;&amp;amp;=\big[r_C(t)V_t + (r_F(t)-r_C(t))(V_t -C(t))\big]dt + \Delta (t)S(t)\sigma_S(t) dW_S(t).\tag{**}&#xA;\end{align*}&#xA;As above,&#xA;\begin{align*}&#xA;d\left(e^{-\int_0^t r_C(v)dv}V_t \right) &amp;amp;=-r_C(t)e^{-\int_0^t r_C(v)dv}V_tdt + e^{-\int_0^t r_C(v)dv}dV_t\\&#xA;&amp;amp;=e^{-\int_0^t r_C(v)dv}\big[(r_F(t)-r_C(t))(V_t -C(t))dt + \Delta (t)S(t)\sigma_S(t) dW_S(t) \big],&#xA;\end{align*}&#xA;and, consequently,&#xA;\begin{align*}&#xA;E_t\left(e^{-\int_0^T r_C(v)dv}V_T \right) -e^{-\int_0^t r_C(v)dv}V_t&amp;amp;=E_t\left( \int_t^Te^{-\int_0^u r_C(v)dv}\big[(r_F(u)-r_C(u))(V_u -C(u))du\right),&#xA;\end{align*}&#xA;which leads to Equation $(5)$ in &lt;a href=&quot;http://www.risk.net/digital_assets/895/042-048_AR0310_Cuttingedge.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Piterbarg&lt;/a&gt; immediately, that is,&#xA;\begin{align*}&#xA;V_t =E_t\left(e^{-\int_t^T r_C(v)dv}V_T \right) - E_t\left(\int_t^Te^{-\int_t^u r_C(v)dv}\big[(r_F(u)-r_C(u))(V_u -C(u))du \right). \tag{5}&#xA;\end{align*} &lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-10-05T14:50:01.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30437" PostTypeId="1" CreationDate="2016-10-04T20:59:55.187" Score="-1" ViewCount="271" Body="&lt;p&gt;I would like to understand what the main differences between LCDX and CDXHY are.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, can anyone explain what the cancellable feature for LCDS, which is not there for CDS's, is and what it means for investors?&lt;/p&gt;&#xA;" OwnerUserId="23973" LastEditorUserId="467" LastEditDate="2016-11-04T09:59:25.833" LastActivityDate="2016-11-04T09:59:25.833" Title="What are the difference between LCDX vs CDXHY?" Tags="&lt;index&gt;&lt;cds&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30438" PostTypeId="2" ParentId="30437" CreationDate="2016-10-05T07:38:31.723" Score="1" Body="&lt;p&gt;Broadly speaking, CDX HY is a credit index on companies that are risky according to some credit metrics. Whereas LCDX is a credit index on loans. I remember that loans are syndicated and are backed by assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Documentation can be found on the Markit website.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.markit.com/Documentation/Product/LCDX&quot; rel=&quot;nofollow&quot;&gt;http://www.markit.com/Documentation/Product/LCDX&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.markit.com/Documentation/Product/CDX&quot; rel=&quot;nofollow&quot;&gt;http://www.markit.com/Documentation/Product/CDX&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Look for the Rules document.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastEditorUserId="20201" LastEditDate="2016-10-05T08:00:10.237" LastActivityDate="2016-10-05T08:00:10.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30439" PostTypeId="1" CreationDate="2016-10-05T08:59:38.943" Score="1" ViewCount="315" Body="&lt;p&gt;I've been applying the probability integral transform as shown here to standardise date for input into a neural network:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://math.stackexchange.com/questions/592076/mapping-cdfs-to-each-other?noredirect=1&amp;amp;lq=1&quot;&gt;https://math.stackexchange.com/questions/592076/mapping-cdfs-to-each-other?noredirect=1&amp;amp;lq=1&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to standardise the data that is wiebull distibuted by mapping it to standard normal:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The original histogram is shown below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/xgfHE.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/xgfHE.png&quot; alt=&quot;Original Histogram&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I transform to the standard Normal I get the histogram shown below, which doesn't look very Normal. I don't want the big gap I want the transformed histogram to look as much like a standard normal as possible. Is there anything else I can do?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/STQCY.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/STQCY.png&quot; alt=&quot;Transformed Data&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the pdf of the inverse CDF it is approximately flat, When I normalize by the data set size the resultant sum is approximately 0.5? I would expect it to be approximately one? Should I be normalising the data by some other value other than the size of the data set?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/aIGcI.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/aIGcI.png&quot; alt=&quot;The PDF of the Inverse CDF&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7077" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2016-10-07T19:59:07.910" Title="Probability Integral Transform: Standardisation" Tags="&lt;distribution&gt;&lt;neural-networks&gt;&lt;normalization&gt;" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="30441" PostTypeId="2" ParentId="21149" CreationDate="2016-10-05T11:44:52.857" Score="5" Body="&lt;p&gt;Well, I did some modest research on this topic, looking at peers.&#xA;Most of them use Modern Portfolio Theory, see this pic:&#xA; &lt;a href=&quot;https://i.stack.imgur.com/MrRQK.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/MrRQK.png&quot; alt=&quot;Roboadvisor and portfolio construction&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find this small survey here: &lt;a href=&quot;https://www.linkedin.com/pulse/roboadvisors-like-commodore-vic20-apparently-according-raffaele-zenti?trk=mp-reader-card&quot; rel=&quot;noreferrer&quot;&gt;https://www.linkedin.com/pulse/roboadvisors-like-commodore-vic20-apparently-according-raffaele-zenti?trk=mp-reader-card&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The sector, I mean Roboadvisors, has a lot of disruption potential, obviously. But it is still immature, methodologically, with respect to the &quot;traditional&quot; (i.e. offline) asset management/wealth management industry.&lt;/p&gt;&#xA;" OwnerUserId="24700" LastActivityDate="2016-10-05T11:44:52.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30443" PostTypeId="1" AcceptedAnswerId="30448" CreationDate="2016-10-05T14:48:55.547" Score="3" ViewCount="83" Body="&lt;p&gt;Prior to equity financing:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Market Capitalization is $1B&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Current Share price: $50.00&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Total Common Shares outstanding: 20,000,000&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The company wants to raise 100M in equity through stock selling. I want to know how each of these numbers are effected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These are not the numbers to a specific problem, I just want to learn how each number changes.&lt;/p&gt;&#xA;" OwnerUserId="24705" LastActivityDate="2016-10-05T16:16:15.787" Title="Equity Dilution Question" Tags="&lt;equities&gt;&lt;finance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30444" PostTypeId="1" CreationDate="2016-10-05T15:11:51.927" Score="1" ViewCount="67" Body="&lt;h2&gt;Background:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I've heard that Malliavin Calculus can be used to show the explicit form of a delta-neutral hedge (given an SDE driven market model).  For example, here is a sketch &lt;a href=&quot;https://www.wias-berlin.de/people/bayerc/files/hedging.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; on page 21 on how to achieve a $\Delta$-neutral hedge but how would one achieve a $\Delta$-positive hedge. &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Question:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Fix $T&amp;gt;0$.&lt;br&gt;&#xA;My question is how can this proof strategy be used to show the existence of a hedge $H$ which has:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;positive Delta throughout $[0,T]$&lt;/li&gt;&#xA;&lt;li&gt;H(0)=1&lt;/li&gt;&#xA;&lt;li&gt;$\Delta H(T)\geq \Delta \tilde{H}(T)$ for every hedge $\tilde{H}$ with $\tilde{H}(0)=1$.  &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="11582" LastEditorUserId="11582" LastEditDate="2016-10-05T16:05:26.047" LastActivityDate="2016-10-05T16:05:26.047" Title="Using malliavin derivative to find the worst Delta-positive hedge?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;delta-hedging&gt;&lt;delta-neutral&gt;&lt;malliavin-calculus&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30445" PostTypeId="1" AcceptedAnswerId="30449" CreationDate="2016-10-05T15:40:27.697" Score="0" ViewCount="85" Body="&lt;p&gt;Let's say I have designed an option's portfolio. The portfolio includes long as well as short positions in European-style put and call contracts based on the same underlying asset with different strike prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does it make sense to calculate the &lt;a href=&quot;https://en.wikipedia.org/wiki/Put%E2%80%93call_parity&quot; rel=&quot;nofollow&quot;&gt;call-put parity&lt;/a&gt; for pairs of call and put with the identical strike prices? or is there is an approach to calculate the call-put parity for the option's portfolio as as a measure of the equivalence between call and put contracts?&lt;/p&gt;&#xA;" OwnerUserId="20913" LastActivityDate="2016-10-05T16:58:56.727" Title="Is it possible to calculate the call-put parity for an option's portfolio?" Tags="&lt;portfolio&gt;&lt;reference-request&gt;&lt;option-strategies&gt;&lt;self-study&gt;&lt;put-call-parity&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30448" PostTypeId="2" ParentId="30443" CreationDate="2016-10-05T16:02:15.703" Score="4" Body="&lt;p&gt;In an ideal world the company would issue 2M extra shares priced at 50. The number of  shares would go to 22M and the market cap would be 1.1 Billion. This implicitly assumes the company would invest the money wisely in expanding its business at similar rates of profit, all relevant information is publicly available, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the real world the equity market is somewhat cynical about new equity issues. Shareholders are likely to ask: is the company in trouble? What do they need the money for? Why now when they said at the last AGM that they would not need new money for the foreseeable future (do they know something we don't)? Why didn't they issue debt instead? (Is company in trouble with the banks?) Will they squander some of the money on extra bonuses? For this reason the equity announcement is taken as &quot;bad news&quot; and empirical studies show a drop of 2 to 3% in the equity price upon announcement. The investment bankers will likely recommend a price of 49 a shares and the issue of 2.04 million shares. They will tell new investors this price is attractive for a company that was quoted at 50, thus making their job easier. Of course the shares are fungible so all shares will go to 49 and the number of shares to 22.04M.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is in the short run. In the long run it all depends how well the new money is used, doesn't it? So one should not be too pessimistic about the short run price drop, it will probably matter little in the end. It is just a small bump in the road, the cost of doing business in a world of financial frictions and imperfect information.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2016-10-05T16:16:15.787" LastActivityDate="2016-10-05T16:16:15.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30449" PostTypeId="2" ParentId="30445" CreationDate="2016-10-05T16:58:56.727" Score="1" Body="&lt;p&gt;The put-call parity is just a no-arbitrage condition that exists for options at the same strike and expiration. If you want to know how your portfolio will change or how similar two options are you are going to want to look at the greeks. &lt;a href=&quot;https://en.wikipedia.org/wiki/Greeks_(finance)&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Greeks_(finance)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, if you want long exposure to a stock but don't want to buy a call option you could sell a put option with a similar delta.&lt;/p&gt;&#xA;" OwnerUserId="5940" LastActivityDate="2016-10-05T16:58:56.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30451" PostTypeId="1" AcceptedAnswerId="30463" CreationDate="2016-10-06T04:30:25.630" Score="0" ViewCount="96" Body="&lt;p&gt;There are numerous numerical solvers for American option pricing. However, all of them take as input a fixed value sigma, denoting the historical volatility of the underlying. I am looking for a solver for which I can specify the volatility as a function, i.e. I want to price the underlying&#xA;\begin{equation}&#xA;dX = (r-q) X  dt + \sigma(X) dW_t.&#xA;\end{equation}&#xA;Under the risk neutral measure, the drift is just the difference in risk free rate and dividends. I want to have a pricing method for arbitrary function $\sigma(X)$. &#xA;Is there a numerical method that does exactly that? &lt;/p&gt;&#xA;" OwnerUserId="16950" LastEditorUserId="16950" LastEditDate="2016-10-07T01:30:01.493" LastActivityDate="2016-10-07T09:23:18.790" Title="Numerical American option for variable volatility" Tags="&lt;option-pricing&gt;&lt;risk-neutral-measure&gt;&lt;american-options&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30454" PostTypeId="2" ParentId="30375" CreationDate="2016-10-06T11:16:44.023" Score="1" Body="&lt;p&gt;There are papers about improving *ARCH models by using other estimators than the classic squared returns estimator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are some links:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the paper &lt;a href=&quot;http://www.econjournals.com/index.php/ijefi/article/viewFile/863/pdf&quot; rel=&quot;nofollow&quot;&gt;How Useful are the Various Volatility Estimators for Improving GARCH-based Volatility Forecasts? Evidence from the Nasdaq - 100 Stock Index&lt;/a&gt; for example the researches compare different estimators such as Parkinson, Garman-Klass used in the GARCH model. &#xA;They provide a measure of how useful these estimators are, by comparing them with different error measures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In &lt;a href=&quot;https://mpra.ub.uni-muenchen.de/21323/1/MPRA_paper_21323.pdf&quot; rel=&quot;nofollow&quot;&gt;A Range-Based GARCH Model for Forecasting Volatility by Dennis S. Mapa&lt;/a&gt; different GARCH models such as Garch(1,2) EGarch and the like are upgraded by using the Parkinson estimator. And then again they are all compared by different error measures. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both were very interesting reads for me.&lt;/p&gt;&#xA;" OwnerUserId="22207" LastEditorUserId="22207" LastEditDate="2016-10-07T19:15:31.967" LastActivityDate="2016-10-07T19:15:31.967" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30455" PostTypeId="1" CreationDate="2016-10-06T19:29:02.600" Score="1" ViewCount="80" Body="&lt;p&gt;When determining what to pay for a company or asset people typically discount the future cashflows by the cost of equity, which is defined as the 'risk free rate' &lt;code&gt;(Rf)&lt;/code&gt; + the market risk premium &lt;code&gt;(Rm)&lt;/code&gt;. &lt;code&gt;E(R)   =   Rf +    b (Rm- Rf)&lt;/code&gt;. Assuming a debtless company. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question I have is whether the  discount rate E(R) is the same for every agent, regardless of the opportunities available to them. I am a private individual with a saving account with a maximum return of .5%. Institutions can access risk free ~1% government bonds (which are generally sold in large blocks and thus unavailable to individual investors).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should this influence the relative cost of capital what thus different agents should be willing to pay for an asset?&lt;/p&gt;&#xA;" OwnerUserId="24497" LastActivityDate="2016-10-06T19:29:02.600" Title="Is the discount rate the same for all market participants?" Tags="&lt;valuation&gt;&lt;discounting&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30456" PostTypeId="1" AcceptedAnswerId="30657" CreationDate="2016-10-06T19:45:47.990" Score="3" ViewCount="1566" Body="&lt;p&gt;Or Quantopian?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How about Python libraries like ultrafinance and PyAlgoTrader?&lt;/p&gt;&#xA;" OwnerUserId="13971" LastActivityDate="2020-07-14T21:51:30.587" Title="Does QuantConnect use both bid and ask data for backtesting?" Tags="&lt;quant-trading-strategies&gt;&lt;backtesting&gt;&lt;python&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30457" PostTypeId="1" AcceptedAnswerId="30461" CreationDate="2016-10-06T22:14:17.067" Score="1" ViewCount="1032" Body="&lt;p&gt;Beta is the correlation of a company's stock price to that of the overall market. As such it gives insight in how volatile a stock's price has been in reltation to the market, thus, how risky the investment is likely to be. Beta is used in the CAPM to estimate a company's cost of capital, hence determining its market valuation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value of a stock is therefore based on the assumption that beta is a reliable measure of risk, in the long term.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question I have is, how reliable is beta for long term risk? Hence, should it be used to measure the value of a company?&lt;/p&gt;&#xA;" OwnerUserId="24497" LastActivityDate="2016-10-07T06:30:23.833" Title="How reliable is beta as a measure of risk when investing lwith a long horizon" Tags="&lt;capm&gt;&lt;beta&gt;&lt;valuation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30458" PostTypeId="1" CreationDate="2016-10-07T01:47:30.653" Score="2" ViewCount="98" Body="&lt;p&gt;I'm a phd student in physics, and trying to find a job in hedge funds (which better value and respect scientific logic and methods very much, rather than focus on the social network. Although I'm good at social). I still like physics so much and don't want to forget all those precious knowledge I learned (with very hard work, they're difficult. PS I'm in string theory). The reason I decide not to continue the academic life is simply because I'm not doing so good. After four years, I clearly know I'm just ordinary smart and it would be very hard to get a faculty position in string theory. It's time to leave.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, here comes the question, could I still have time to read some papers in physics as a role of quant (not in working hours of course)? The first two years would be hard of course, since as starters. How about the following years? I'm pretty sure that there must be quants from non-financial backgrounds who still love their original major, physics, chemistry,etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do you guys deal with your old love (and maybe forever love) and the financial job? Thank you for any sharing.&lt;/p&gt;&#xA;" OwnerUserId="24726" LastActivityDate="2016-10-07T01:47:30.653" Title="Will I have time to continue reading some papers in physics after joining hedge funds?" Tags="&lt;finance&gt;" AnswerCount="0" CommentCount="7" ClosedDate="2016-10-07T07:46:09.673" ContentLicense="CC BY-SA 3.0" />
  <row Id="30460" PostTypeId="2" ParentId="30007" CreationDate="2016-10-07T04:53:25.287" Score="2" Body="&lt;p&gt;You need to count the number of observations that are smaller than the threshhold. then divided it by the total number of observations. &#xA;For example, you have a series of 250 returns, 50 of them is smaller than 1%，all other data is greater than 1%, than the empirical cumulative distribution function at 1% is 50／250.&lt;/p&gt;&#xA;" OwnerUserId="16167" LastActivityDate="2016-10-07T04:53:25.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30461" PostTypeId="2" ParentId="30457" CreationDate="2016-10-07T06:24:17.993" Score="1" Body="&lt;p&gt;Though still widely taught, the unfortunate truth is that the CAPM is largely an empirical failure at predicting stock returns. It's still widely used in corporate finance and investment banks for reasons I don't fully understand. How did we get here?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;In the 70s, the CAPM gained immense popularity because the logic was beautifully simple and empirically, stocks with higher betas appeared to have higher average returns.&lt;/li&gt;&#xA;&lt;li&gt;In the 80s and 90s though, this patten essentially reversed, stocks with lower betas had higher average returns! (Search for Fama-French papers on the CAPM if interested.)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Academic, empirical asset pricing has since moved on from the CAPM to broader factor models such as the Fama-French 3 Factor model, Carhart 4 Factor model , or the Fama-French 5 Factor model. In the current literature, key factors that appear to have forecasting power:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Value&lt;/li&gt;&#xA;&lt;li&gt;Momentum&lt;/li&gt;&#xA;&lt;li&gt;Operating profitability (some notion of quality)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;All these factor models follow the classic academic paradigm of writing expected returns as a linear function of covariance with some set of factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another line of empirical asset pricing takes a more behavioral approach, writing expected returns as a function of &lt;em&gt;firm characteristics&lt;/em&gt; rather than &lt;em&gt;covariance with risk factors&lt;/em&gt;. While there's a huge conceptual difference between the two, in practice, the two aren't as different as you might think. High book value to market value stocks all tend to do well or do poorly at similar times and it isn't that different whether: (i) returns are higher for stocks that covary with a portfolio of high book to market ratios (i.e. it's about covariance) or (ii) returns are higher for stocks with high book to market ratios (i.e. it's about firm characteristics).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This doesn't mean beta is entirely useless though! It still remains true that stocks tend to move together. Companies with higher betas are more sensitive to market swings.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Points of caution:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Estimated betas of individual companies aren't very reliable. Estimated betas of &lt;em&gt;portfolios&lt;/em&gt; of companies are much more reliable.&lt;/li&gt;&#xA;&lt;li&gt;CAPM cost of capital calculations based upon a company's estimated beta are probably trash, but telling your boss (or your corporate finance professor) that might not go over well.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2016-10-07T06:30:23.833" LastActivityDate="2016-10-07T06:30:23.833" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30462" PostTypeId="2" ParentId="30007" CreationDate="2016-10-07T09:11:19.043" Score="2" Body="&lt;p&gt;This is what you do:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sum(SPX &amp;lt;= -0.025) / length(SPX)&#xA;## [1] 0.02536052&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This works because TRUE is internally 1 and FALSE is 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even shorter (as mentioned in the comments by @Forgottenscience):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mean(SPX &amp;lt;= -.025) &#xA;## [1] 0.02536052&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You could also use the Empirical Cumulative Distribution Function (as mentioned by @berkorbay) but I think this is overkill in this case:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;SPX_ecdf(-0.025)&#xA;## [1] 0.02536052&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2016-10-07T09:19:25.360" LastActivityDate="2016-10-07T09:19:25.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30463" PostTypeId="2" ParentId="30451" CreationDate="2016-10-07T09:23:18.790" Score="0" Body="&lt;p&gt;The process that you are considering is a special case of a local volatility model&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathrm{d}X_t = \mu X_t \mathrm{d} t + \sigma \left( t, X_t \right) X_t \mathrm{d}W_t.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e. you seem to consider a special case where the volatility is not time but only spot dependent. When you refer to American options, I suppose you mean &quot;American plain vanilla options&quot;. In this case, the natural choice of pricing engine for me would be finite-difference methods. See e.g. Chapter 78.9 in Wilmott (2006) for a gentle introduction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you asked for a &quot;solver&quot; I suppose you are looking for a library that could price under these dynamics. You could have a look at QuantLib - they have a finite difference engine that supports local volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wilmott, Paul (2006) &quot;Paul Wilmott on Quantitative Finance&quot;, 2nd Edition, John Wiley &amp;amp; Sons&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2016-10-07T09:23:18.790" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30464" PostTypeId="1" CreationDate="2016-10-07T10:55:07.583" Score="1" ViewCount="665" Body="&lt;p&gt;I'm working on my thesis in asset pricing, particularly on 'Fama French 5 factors model &amp;amp; q factor model'. May I know why I have to work with the FBRIT and DEADUK securities list for the UK market and not the Worldscope database (wscopeuk).&lt;/p&gt;&#xA;" OwnerUserId="24733" LastEditorUserId="848" LastEditDate="2016-10-08T20:20:53.287" LastActivityDate="2017-02-15T17:36:14.223" Title="Which data to use with the Fama French 5 factors model &amp; q factor model" Tags="&lt;market-data&gt;&lt;asset-pricing&gt;&lt;database&gt;&lt;fama-french&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30465" PostTypeId="1" AcceptedAnswerId="30472" CreationDate="2016-10-07T11:42:35.717" Score="2" ViewCount="484" Body="&lt;p&gt;The Sharpe ratio is known as&#xA;$$SR=\frac{\mu-r_f}{\sigma}$$&#xA;Are these values calculated from discrete or continuously compounded returns?&lt;/p&gt;&#xA;" OwnerUserId="9336" LastActivityDate="2016-10-07T18:21:02.027" Title="Sharpe ratio: discrete or continuous returns?" Tags="&lt;returns&gt;&lt;sharpe-ratio&gt;&lt;performance-evaluation&gt;&lt;performance&gt;&lt;sharpe&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30466" PostTypeId="2" ParentId="17129" CreationDate="2016-10-07T14:05:39.247" Score="1" Body="&lt;p&gt;While SARIMA-GARCH is not currently (October 2016) implemented in R as far as I am aware, you can deal with seasonality by including some dummy variables or Fourier terms in the conditional mean model. If you are using the &quot;rugarch&quot; package in R, you can include these terms via the argument &lt;code&gt;external.regressors&lt;/code&gt; within the argument &lt;code&gt;mean.model&lt;/code&gt; in the &lt;code&gt;ugarchspec&lt;/code&gt; function.&lt;/p&gt;&#xA;" OwnerUserId="19645" LastActivityDate="2016-10-07T14:05:39.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30467" PostTypeId="2" ParentId="30403" CreationDate="2016-10-07T14:23:28.470" Score="2" Body="&lt;blockquote&gt;&#xA;&lt;p&gt;But it is sensless to include data from night hours if I trade only during day.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;This kind of thinking seems to be a common beginners' fallacy in econometrics and related fields (nothing personal). You have to distinguish two elements of your problem:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;understanding how a time series develops (e.g. by building a model for it);&lt;/li&gt;&#xA;&lt;li&gt;utilizing your understanding to find out a function of this development (e.g. a forecast for a specific time period).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;Think of an analogy: if the true model is&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;y=\beta_0+\beta_1 x_1 + \beta_2 x_2 + u&#xA;$$&lt;/span&gt;&#xA;and you are only interested in &lt;span class=&quot;math-container&quot;&gt;$\beta_0$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$\beta_1$&lt;/span&gt; but not &lt;span class=&quot;math-container&quot;&gt;$\beta_2$&lt;/span&gt;, you are still better off estimating &lt;span class=&quot;math-container&quot;&gt;$\beta_0$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$\beta_1$&lt;/span&gt; from the true model rather than the submodel &lt;span class=&quot;math-container&quot;&gt;$$&#xA;y=\beta_0 + \beta_1 x_1  + v.&#xA;$$&lt;/span&gt;&#xA;Your estimates from the full model will be more accurate, and considerably so if &lt;span class=&quot;math-container&quot;&gt;$x_1$&lt;/span&gt; is (highly) correlated with &lt;span class=&quot;math-container&quot;&gt;$x_2$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Now back to your original problem: if the time series development at night were totally unrelated to its development at daytime, you could just ignore the night hours. But in all likelihood the relation is there, so better account for it.&#xA;In other words, I would address the two core elements of your problem in turn without taking shortcuts.&lt;/p&gt;&#xA;" OwnerUserId="19645" LastEditorUserId="21016" LastEditDate="2020-07-27T11:17:27.580" LastActivityDate="2020-07-27T11:17:27.580" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="30468" PostTypeId="2" ParentId="74" CreationDate="2016-10-07T14:32:07.647" Score="1" Body="&lt;p&gt;I've been using a product called &lt;a href=&quot;http://www.algonetexplorer.com&quot; rel=&quot;nofollow&quot;&gt;AlgoNET Explorer&lt;/a&gt; which is by the same people who created ONE (OptionNET Explorer). I've been backtesting multi-leg options strategies with adjustments in 5min intervals using wizards and C# (VB is also supported). Much faster than manual backtesting.  &lt;/p&gt;&#xA;" OwnerUserId="24738" LastActivityDate="2016-10-07T14:32:07.647" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30471" PostTypeId="2" ParentId="30465" CreationDate="2016-10-07T17:49:42.593" Score="1" Body="&lt;p&gt;These are the &lt;em&gt;realized&lt;/em&gt; return and standard deviation for the portfolio over the period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source: Paul Wilmott on Quantitative Finance, sec. ed., p. 329-330&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2016-10-07T17:49:42.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30472" PostTypeId="2" ParentId="30465" CreationDate="2016-10-07T18:21:02.027" Score="5" Body="&lt;p&gt;For client reporting purposes, it is customary to use discrete returns. For backtesting, it pretty much make no difference.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2016-10-07T18:21:02.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30474" PostTypeId="2" ParentId="30282" CreationDate="2016-10-07T21:48:16.323" Score="1" Body="&lt;p&gt;I would recommend you to use rolling overlapping window (1st implementation) instead of non-overlapping (your example - 2nd implementation)&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% overlapping rolling covariance&#xA;[n,m] = size(returns_sec); % n-&amp;gt; number of dates, m-&amp;gt;number of assets&#xA;rolling_window = 10;&#xA;cov_test = nan(m*(n - rolling_window + 1),m);&#xA;for i = rolling_window:n&#xA;    start_index = m*(i - rolling_window) + 1; % aggregate covariance matrix start index&#xA;    end_index = m*(i - rolling_window +1); % aggregate covariance matrix end index&#xA;    covariance_mtx = cov(returns_sec(i-rolling_window +1:i,:));&#xA;    cov_test(start_index:end_index,:) = covariance_mtx;&#xA;end&#xA;&#xA;% non-overlapping rolling covariance&#xA;[n,m] = size(returns_sec); % n-&amp;gt; numberg of dates, m-&amp;gt;number of assets&#xA;rolling_window = 10;&#xA;num = floor(n/rolling_window); % number of non-overllaping intervals&#xA;cov_test = nan(m*num,m);&#xA;for i = 1:num&#xA;    start_index = m*(i - 1) + 1; % aggregate covariance matrix start index&#xA;    end_index = m*i; % aggregate covariance matrix end index&#xA;    covariance_mtx = cov(returns_sec(rolling_window*(i - 1) + 1: rolling_window*i,:));&#xA;    cov_test(start_index:end_index,:) = covariance_mtx;&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="user18489" LastEditorUserId="467" LastEditDate="2016-11-07T04:40:52.663" LastActivityDate="2016-11-07T04:40:52.663" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30476" PostTypeId="2" ParentId="30456" CreationDate="2016-10-07T23:59:58.080" Score="6" Body="&lt;p&gt;QuantConnect uses L1 data (bid and ask quotes) for its US Equities Backtesting.&lt;/p&gt;&#xA;&lt;p&gt;QuantConnect has a full break down of the data library, including &lt;strong&gt;free data&lt;/strong&gt; for download in LEAN format at the data library page: &lt;a href=&quot;https://www.quantconnect.com/data&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.quantconnect.com/data&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;The open-source LEAN &lt;a href=&quot;https://github.com/QuantConnect/Lean&quot; rel=&quot;nofollow noreferrer&quot;&gt;algorithmic trading engine&lt;/a&gt; can support trades and quotes, however, on &lt;a href=&quot;https://www.quantconnect.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;QuantConnect&lt;/a&gt; website the free data library is:&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;US Equities&lt;/strong&gt; - Trades and Quotes data in tick, second, minute, hour and daily bars. Quote data was added to backtesting in April 2020.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;US Fundamentals&lt;/strong&gt; - MorningStar corporation fundamentals.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;FOREX &amp;amp; CFD&lt;/strong&gt; - Quotes; Tick, second, minute, hour and daily bars for FXCM and Oanda market providers. Bars are from the midpoint of the quote data.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;US Options&lt;/strong&gt; - Trade and Quote Minute Bars.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;US Futures&lt;/strong&gt; - Trades, Quotes; Tick, second, minute, hour and daily bars.&lt;/p&gt;&#xA;&lt;p&gt;(Disclosure, I am the Founder of QuantConnect)&lt;/p&gt;&#xA;&lt;p&gt;Edit: Updated state of Futures and Options, and US Equity Quote.&lt;/p&gt;&#xA;" OwnerUserId="16443" LastEditorUserId="16443" LastEditDate="2020-07-14T21:51:30.587" LastActivityDate="2020-07-14T21:51:30.587" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="30477" PostTypeId="2" ParentId="30430" CreationDate="2016-10-08T06:41:09.743" Score="-2" Body="&lt;p&gt;A couple of Python libraries can help you accomplish this. This script was originally posted by Theodor Perisvolris on his &lt;a href=&quot;http://www.theodor.io/scraping-google-finance-data-using-pandas/&quot; rel=&quot;nofollow&quot;&gt;blog&lt;/a&gt;. I have made some minor changes to it for my use case.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;from googlefinance import getQuotes&#xA;import json&#xA;import pandas as pd&#xA;import datetime&#xA;import requests&#xA;&#xA;def get_intraday_data(symbol, interval_seconds=301, num_days=10):&#xA;    # Specify URL string based on function inputs.&#xA;    url_string = 'http://www.google.com/finance/getprices?q={0}'.format(symbol.upper())&#xA;    url_string += &quot;&amp;amp;i={0}&amp;amp;p={1}d&amp;amp;f=d,o,h,l,c,v&quot;.format(interval_seconds,num_days)&#xA;&#xA;    # Request the text, and split by each line&#xA;    r = requests.get(url_string).text.split()&#xA;&#xA;    # Split each line by a comma, starting at the 8th line&#xA;    r = [line.split(',') for line in r[7:]]&#xA;&#xA;    # Save data in Pandas DataFrame&#xA;    df = pd.DataFrame(r, columns=['Datetime','Close','High','Low','Open','Volume'])&#xA;&#xA;    # Convert UNIX to Datetime format&#xA;    df['Datetime'] = df['Datetime'].apply(lambda x: datetime.datetime.fromtimestamp(int(x[1:])))&#xA;&#xA;    #Convert 'Close','High','Low','Open', deleting 'Volume'&#xA;&#xA;    df['Close'] = df['Close'].astype('float64')&#xA;    df['High'] = df['High'].astype('float64')&#xA;    df['Low'] = df['Low'].astype('float64')&#xA;    df['Open'] = df['Open'].astype('float64')&#xA;    del df['Volume']&#xA;&#xA;   # Calculating %Change and Range&#xA;&#xA;    df['%pct'] = (df['Close'] - df['Open'])/df['Open']&#xA;    df['Range'] = df['High'] - df['Low']&#xA;&#xA;    return df&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The function is run by finding the google symbol for the financial instrument you wish to track .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example,&lt;a href=&quot;https://www.google.com/finance?cid=14569560&quot; rel=&quot;nofollow&quot;&gt;S&amp;amp;P US Treasury Bond Futures Index TR&lt;/a&gt; (Symbol = SPUSTBTR),&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;UST = get_intraday_data('SPUSTBTR', interval_seconds=301, num_days= 100)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="24742" LastEditorUserId="24742" LastEditDate="2016-10-08T07:09:08.910" LastActivityDate="2016-10-08T07:09:08.910" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30483" PostTypeId="1" AcceptedAnswerId="36566" CreationDate="2016-10-08T18:52:06.133" Score="1" ViewCount="3925" Body="&lt;p&gt;I've been doing this for some years now, but recently, since I started fiddling around with an old pairs trading strat of mine again, when updating the databases before running the tests, I was thinking about the prices used. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was used to getting all adjusted close prices, dividends, splits, inplits, bonuses, etcs, and just running the strategy with those, but when eyeballing some of those time series and comparing them with the non adjusted series I get directly from the exchange (holy parsing, batman!) I noticed (the obvious) that some stocks are just way way away from their &quot;raw&quot;, unadjusted prices and that that could lead to some really big data errors, contaminating the results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ran across a little white paper where the writer goes along about this issues and I exchanged some emails with some veterans in the industry. The latter told me that they just use adjusted prices for everything on the backtest procedures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was thinking, isn't it a little bit of a stretch to use adjusted prices for mimicking the execution of the trades? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm running a plain vanilla cointegrated pairs trading with some bells and whistles on top, and the difference between the two datasets, adjusted and non adjusted is just too big. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would you consider using the adjusted series for in sample / cointegration / signal triggering, and then just using the real raw unadjusted prices at those times? (when triggering a trade, for example)  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or would you just use the adjusted ones and that's it? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only part I'm sure here is about not using the raw series in cointegration and signal triggering analysis, too many jumps, gaps, with all the dividends, events, splits, etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best Regards &lt;/p&gt;&#xA;" OwnerUserId="18104" LastActivityDate="2021-03-22T05:25:51.100" Title="Close or Adjusted Prices when Backtesting" Tags="&lt;backtesting&gt;&lt;historical-data&gt;&lt;pairs-trading&gt;&lt;database&gt;&lt;adjustments&gt;" AnswerCount="3" CommentCount="10" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30484" PostTypeId="1" AcceptedAnswerId="30501" CreationDate="2016-10-08T19:02:33.047" Score="2" ViewCount="561" Body="&lt;p&gt;Let $Y_{t}$ be&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;Y_{t}=\int_{\Omega} g(X_{u}) du&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $g(.)$ is a deterministic function and $\Omega=[t_{0},t]$ continuos partition of $\mathbb{R}$. &#xA;Furthermore let $X$ be an Ito process &#xA;\begin{equation}&#xA;X_{u}= X_{0}+\int_{0}^{u}\mu(s)ds+\int_{0}^{u} \sigma(s) dW_{s}^{\mathbb{P}} &#xA;\end{equation}&#xA;for som well behaved $\mu$ and $\sigma$ and $(W_{s}^{\mathbb{P}})_{0\leq s}$ is standard brownian motion under objective probability measure $\mathbb{P}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is differential of $Y_{t}$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;dY_{t}=?&#xA;\end{equation}&lt;/p&gt;&#xA;" OwnerUserId="24747" LastEditorUserId="19887" LastEditDate="2016-10-11T15:33:38.667" LastActivityDate="2016-10-12T09:35:09.903" Title="Differential of integral of a stochastic process" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;derivation&gt;" AnswerCount="1" CommentCount="12" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30487" PostTypeId="2" ParentId="18413" CreationDate="2016-10-09T15:41:43.533" Score="0" Body="&lt;p&gt;No. Simple way of thinking of it from a statistical approach:&#xA;Sharpe = (TR - r) / STDEV &lt;/p&gt;&#xA;&#xA;&lt;p&gt;TR = n(x bar), where x bar is the mean arithmetic return. E(cX) = cE(x) is a property of the expectation operator. Proof for the discrete case: express expectation in terms of summation, for which a constant can be pulled out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Var(cX) = c^2Var(X) ==&gt; STDEV(cX) = cSTDEV(X). Proof is slightly more complex so I won't include it, but it is basically done by relating variance to the first 2 moments of X. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the risk free rate is a minor factor, Sharpe ratio can be approximately expressed as: nE(X) / STDEV(X). &#xA;Leveraging just multiplies each value of the random variable X by a constant, which can be pulled out and cancelled from the numerator and denominator. Thus Sharpe ratio is independent of leverage.&lt;/p&gt;&#xA;" OwnerUserId="24760" LastActivityDate="2016-10-09T15:41:43.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30489" PostTypeId="1" AcceptedAnswerId="57513" CreationDate="2016-10-09T19:23:58.963" Score="3" ViewCount="732" Body="&lt;p&gt;I'm attempting to prepare data in the same manner as section 2 of &lt;a href=&quot;http://cs229.stanford.edu/proj2013/TakeuchiLee-ApplyingDeepLearningToEnhanceMomentumTradingStrategiesInStocks.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;this paper&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm finding it a bit of a struggle. Could someone check (/improve upon) my interpretation regarding the 2 sections I have highlighted (below)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the first section (highlighted in yellow):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We note that price momentum is a cross-sectional phenomenon with&#xA;  winners having high past returns and losers having low past returns&#xA;  relative to other stocks. Thus we normalize each of the cumulative&#xA;  returns by calculating the z-score relative to the cross-section of&#xA;  all stocks for each month or day.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;... I'm struggling to understand exactly what is being described.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I can see, the process would be:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;For each day ...&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;for each stock ...&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Assemble a trailing length-33 vector of past prices&lt;/li&gt;&#xA;&lt;li&gt;Use this to compute stock's mean &amp;amp; standard deviation&lt;/li&gt;&#xA;&lt;li&gt;Use today's price $x$ to compute stock's &lt;a href=&quot;https://en.wikipedia.org/wiki/Standard_score&quot; rel=&quot;nofollow noreferrer&quot;&gt;z-value&lt;/a&gt;: $z = \frac{x-\mu}{\sigma}$ &lt;em&gt;(If I understand correctly, $z$ is a basic indication of momentum).&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Now we have a z-vector over all stocks for this day. Normalize it! (?)&lt;/li&gt;&#xA;&lt;li&gt;Now we have a vector indicating relative momentum for each stock for this day.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And the section (highlighted in green):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Finally we use returns over the subsequent month, t + 1, to label the&#xA;  examples with returns below the median as belonging to class 1 and&#xA;  those with returns above the median to class 2.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;... I think translates as:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;get monthly returns for months t-13 through t+1 &amp;amp; compute median&lt;/li&gt;&#xA;&lt;li&gt;class = 1 if return for month t+1 &amp;lt; median else 2&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So it looks as though class 2 stocks follow their normalised $z$ momentum-indicator, whereas class 1 don't.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this look correct?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/42erv.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/42erv.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS No tag for 'data-processing'&lt;/p&gt;&#xA;" OwnerUserId="7172" LastEditorUserId="7172" LastEditDate="2016-10-10T16:02:13.210" LastActivityDate="2021-01-18T10:00:15.153" Title="Interpreting description of a particular (momentum-based) data processing technique" Tags="&lt;market-data&gt;&lt;momentum&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30490" PostTypeId="1" CreationDate="2016-10-09T19:36:22.363" Score="3" ViewCount="333" Body="&lt;p&gt;I want to make a quick reference or some pages, that contains short rate models . I know some models  but I am not sure that ,this list is complete ...please help me to $\textbf{improve}$ this list .thanks in advanced.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\textbf{One-factor short-rate models}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Merton's model (1973) $${{r}_{t}}={{r}_{0}}+at+\sigma W_{t}^{*} $$&#xA;Vasicek model (1977) $$d{{r}_{t}}=(\theta -\alpha {{r}_{t}})dt+\sigma d{{W}_{t}}$$&#xA;Rendleman–Bartter model (1980)$$d{{r}_{t}}=\theta {{r}_{t}}dt+\sigma {{r}_{t}}d{{W}_{t}}$$&#xA;Cox–Ingersoll–Ross model (1985) $$d{{r}_{t}}=(\theta -\alpha {{r}_{t}})dt+\sqrt{{{r}_{t}}}\sigma d{{W}_{t}}$$&#xA;Ho–Lee model (1986)$$d{{r}_{t}}={{\theta }_{t}}dt+\sigma d{{W}_{t}}$$&#xA; Hull–White model (1990)—also called the extended Vasicek model $$d{{r}_{t}}=({{\theta }_{t}}-\alpha {{r}_{t}})dt+{{\sigma }_{t}}d{{W}_{t}}$$&#xA;Black–Derman–Toy model (1990) $$d\ln (r)=[{{\theta }_{t}}+\frac{{{{{\sigma }'}}_{t}}}{{{\sigma }_{t}}}\ln (r)]dt+{{\sigma }_{t}}d{{W}_{t}}$$&#xA; Black–Karasinski model (1991) $$ d\ln (r)=[{{\theta }_{t}}-{{\phi }_{t}}\ln (r)]dt+{{\sigma }_{t}}d{{W}_{t}}$$&#xA;Kalotay–Williams–Fabozzi model (1993) $$d\ln ({{r}_{t}})={{\theta }_{t}}dt+\sigma d{{W}_{t}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\textbf{Multi-factor short-rate models}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Longstaff–Schwartz model (1992)$$\begin{align}&#xA;  &amp;amp; d{{X}_{t}}=({{a}_{t}}-b{{X}_{t}})dt+\sqrt{{{X}_{t}}}{{c}_{t}}d{{W}_{1t}} \\ &#xA; &amp;amp; d{{Y}_{t}}=({{d}_{t}}-e{{Y}_{t}})dt+\sqrt{{{Y}_{t}}}{{f}_{t}}d{{W}_{2t}} \\ &#xA; &amp;amp; d{{r}_{t}}=(\mu X+\theta Y)dt+{{\sigma }_{t}}\sqrt{Y}d{{W}_{3t}} \\ &#xA;\end{align}&#xA;$$&#xA;Chen model (1996)$$\begin{align}&#xA;  &amp;amp; d{{r}_{t}}=({{\theta }_{t}}-{{\alpha }_{t}})dt+\sqrt{{{r}_{t}}}{{\sigma }_{t}}d{{W}_{t}} \\ &#xA; &amp;amp; d{{\alpha }_{t}}=({{\zeta }_{t}}-{{\alpha }_{t}})dt+\sqrt{{{\alpha }_{t}}}{{\sigma }_{t}}d{{W}_{t}} \\ &#xA; &amp;amp; d{{\sigma }_{t}}=({{\beta }_{t}}-{{\sigma }_{t}})dt+\sqrt{{{\sigma }_{t}}}{{\eta }_{t}}d{{W}_{t}} \\ &#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="24761" LastActivityDate="2017-01-15T08:59:58.260" Title="Short rate models (stochastic)" Tags="&lt;interest-rates&gt;&lt;stochastic-processes&gt;&lt;stochastic-volatility&gt;&lt;reference-request&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30492" PostTypeId="2" ParentId="21747" CreationDate="2016-10-10T13:35:10.953" Score="1" Body="&lt;p&gt;Wouldn't you just weight the p/l equation the same way your position is weighted? So:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(P(StockA)*0.8)/(P(StockB)*0.2) = Net % change in the position&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="24772" LastEditorUserId="743" LastEditDate="2016-10-12T18:53:49.423" LastActivityDate="2016-10-12T18:53:49.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30493" PostTypeId="1" CreationDate="2016-10-10T14:22:07.997" Score="1" ViewCount="49" Body="&lt;p&gt;I am preparing a paper about mitigating assessment failures for option pricing models. For the sake of simpliciy, suppose we are talkin about European options. In basic terms, what I would like to say is&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Suppose you have two option pricing models (say A and B) and two contract data sets (say, X and Y). X and Y belong to the same underlying asset but different time periods $[T_0^x,T_T^x]$ and $[T_0^y,T_T^y]$. Also suppose Y is at a later date than X.&lt;/li&gt;&#xA;&lt;li&gt;I price all the contracts in those data sets out-of-sample using continuously updated fitted parameters. (i.e. For contracts at time $T_\tau$ I use data from $T_{\tau^\prime}, \tau^\prime &amp;lt; \tau$).&lt;/li&gt;&#xA;&lt;li&gt;I calculate the pricing errors for each contract in the data sets $\epsilon(\hat{P^A_i},P_i)$ (say I use ARPE = $|\hat{P_i}-P_i|/P_i$).&lt;/li&gt;&#xA;&lt;li&gt;According to my performance metric, suppose model A shows better results than B for data set X but worse results for data set Y.&lt;/li&gt;&#xA;&lt;li&gt;Someone checking my experiment during a time between X and Y would think A is a better model than B (given the experiment limitations). But results of X is not an indicator of future performance, hence the results of Y.&lt;/li&gt;&#xA;&lt;li&gt;Now, generalize it a bit by with multiple time frames (X, Y, Z, W, Q....) and contract space is divided into groups of moneyness and maturity (e.g. contracts between 30-90 days ATM options). Also suppose better model changes frequently (i.e. for X A is better, for Y B is better but for Z A is better again for the same moneyness maturity group).&lt;/li&gt;&#xA;&lt;li&gt;To sum up, my pricing errors within the groups have low predictive power. I want to &quot;decrease the prediction error of the pricing errors&quot;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here is my methodology to improve&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Instead of predefined groups, I employ some machine learning algorithms to form the groups dynamically using pricing errors of the past data. I update the groups periodically. &lt;/li&gt;&#xA;&lt;li&gt;I use 10 different data sets for cross validation. For each data sets I train my ML algorithms using the past 6-months of pricing errors to predict the next week's pricing errors. My performance metric is the difference between the predicted pricing error vs the actual pricing error for each contract.&lt;/li&gt;&#xA;&lt;li&gt;Then I assess the effectiveness of each ML algorithm to find the most suitable algorithm for the given pricing model.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2813246&quot; rel=&quot;nofollow&quot;&gt;Here&lt;/a&gt; is a previous work.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;My questions are&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If I use relative errors I sometimes get huge errors because of the denominator effect. For instance, for the same group, if I estimate the average ARPE as 0.5% but a contract has a ARPE of 5% the relative error of the prediction error is 900%! Is there a way to mitigate that? (I am thinking about using direct absolute errors.)&lt;/li&gt;&#xA;&lt;li&gt;My data has strong dependence as my underlying is the same and for the same time point only time to maturity and moneyness differences.&lt;/li&gt;&#xA;&lt;li&gt;What types of analyses or tests can I do to explain these shifts in both pricing errors and prediction errors? Until now, I was just doing aggregate analyses based on data sets and as a whole. (For instance, I was thinking about making the same experiment with IV errors and compare models.)&lt;/li&gt;&#xA;&lt;li&gt;What should be my approach to present it to an audience with little background on quantitative finance but are proficient in statistics and data mining?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="8147" LastActivityDate="2016-10-10T14:22:07.997" Title="How to reduce data dependence for empirically assessing option pricing model performance?" Tags="&lt;options&gt;&lt;data&gt;&lt;modeling&gt;&lt;forecasting&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30494" PostTypeId="2" ParentId="30490" CreationDate="2016-10-10T15:42:49.433" Score="1" Body="&lt;p&gt;There is the two-factor Hull-White model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Hull%E2%80%93White_model#Two-factor_model&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Hull%E2%80%93White_model#Two-factor_model&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3188" LastActivityDate="2016-10-10T15:42:49.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30495" PostTypeId="2" ParentId="30489" CreationDate="2016-10-10T16:46:00.327" Score="0" Body="&lt;p&gt;Tentatively, thanks to the comments and people on IRC (braverock, bluelou), I think this is the basic stratagem:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;pick a point in time t&lt;/li&gt;&#xA;&lt;li&gt;for each k of our N stocks get prices &lt;code&gt;p(k,:)&lt;/code&gt; i.e. &lt;code&gt;p(k, 1) thru p(k, 12)&lt;/code&gt; for the 12 months t-13 to t-2&lt;/li&gt;&#xA;&lt;li&gt;perform cumulative sum: &lt;code&gt;s = cumsum(p, 2);&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;for each of these 12 datapoints,&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;calculate mean $\mu$ and Standard Deviation $\sigma$ for each of our N stocks and hence calculate $z$ for each stock.  i.e. &lt;em&gt;'the number of sd-s $s$ is above the average stock $s$.'&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;normalize the vector $z$.  so we scale everything so that e.g. If the whole market inflates by 10% say, our vector remains unchanged.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;(...and then we do the same process for the last 20 days).&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I think it is just trying to 'normalise' the position of each stock within the market at each datapoint, i.e. reduce it to a number roughly between say -3 and +3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I learned that it is important to get your input data having a mean of 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm still not quite sure why they don't simply use for their output indicator:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;class 1 if the stock &lt;strong&gt;&lt;em&gt;falls&lt;/em&gt;&lt;/strong&gt; in the next month&lt;/li&gt;&#xA;&lt;li&gt;class 2 if the stock &lt;strong&gt;&lt;em&gt;rises&lt;/em&gt;&lt;/strong&gt; in the next month&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7172" LastActivityDate="2016-10-10T16:46:00.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30496" PostTypeId="1" CreationDate="2016-10-10T16:56:55.643" Score="0" ViewCount="77" Body="&lt;p&gt;Can't seem to get an answer to this on stackoverflow. I'm relatively new to using RJava and was getting a null pointer exception from a piece of code I was trying out. I suspect that this could be due to the data type I am using, but am a bit confused about how to solve this. Any help with this would be great.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import org.rosuda.JRI.Rengine;&#xA;&#xA;public class RJava {&#xA;&#xA;public static void main(String a[]) {&#xA;&#xA;&#xA;    String javaVector = &quot;c(put, 0.0425, 66.592, 66.00, 0, 0.068, 0.072, 0.1)&quot;;&#xA;&#xA;&#xA;    Rengine engine = new Rengine(new String[] { &quot;--no-save&quot; }, false, null);&#xA;&#xA;&#xA;    engine.eval(&quot;library(RQuantLib)&quot;);&#xA;    engine.eval(&quot;rVector=&quot; + javaVector);&#xA;    engine.eval(&quot;Euvol=EuropeanOptionImpliedVolatility(rVector)&quot;);&#xA;&#xA;    double vol = engine.eval(&quot;Euvol&quot;).asDouble();&#xA;    System.out.println(&quot;Vol=&quot; + vol);&#xA;&#xA;}&#xA; }&#xA;&#xA;   Exception in thread &quot;main&quot; java.lang.NullPointerException&#xA;   at co.karan.RJava.main(RJava.java:49)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="24766" LastActivityDate="2016-11-10T00:08:33.527" Title="Using RQuantLib in Java with RJava" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;r&gt;&lt;programming&gt;&lt;rquantlib&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30499" PostTypeId="2" ParentId="30496" CreationDate="2016-10-10T23:37:17.533" Score="1" Body="&lt;p&gt;You should at least give the line number where your code crashes (49 is &lt;strong&gt;not&lt;/strong&gt; the line number you show in the question).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have a null exception and it happens in &lt;code&gt;RJava&lt;/code&gt;, have you tried to use a debugger to figure out where exactly it crashes?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your code can't crash in &lt;code&gt;javaVector&lt;/code&gt; and &lt;code&gt;new Rengine&lt;/code&gt; because the Java runtime guarantees it'll throw an exception but it won't be a null exception. Your code  also can't crash in your &lt;code&gt;eval&lt;/code&gt; calls. So what else?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your code crashes in &lt;code&gt;engine.eval(&quot;Euvol&quot;)&lt;/code&gt;. The function &lt;code&gt;eval&lt;/code&gt; gives you a null and you try to cast to double, you can't do this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, you should think why your R engine gave you a null exception. There're several possibilities:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;1&lt;/strong&gt;: You don't have QuantLib installed. RQuantLib won't work if your QuantLib is not properly installed. Worse, you might not even have RQuantLib installed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2&lt;/strong&gt;: Your inputs to RQuanlib are not correct. Read the documentation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/9oGrb.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/9oGrb.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first argument is a &lt;strong&gt;STRING&lt;/strong&gt;. In your code you gave &lt;code&gt;put&lt;/code&gt;, this is a &lt;strong&gt;variable&lt;/strong&gt; but not a string.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The R vector &lt;code&gt;c(put, 0.0425, 66.592, 66.00, 0, 0.068, 0.072, 0.1)&lt;/code&gt; is invalid. Try to copy it to your R and you'll get an error.&lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="601" LastEditDate="2016-10-10T23:44:01.670" LastActivityDate="2016-10-10T23:44:01.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30501" PostTypeId="2" ParentId="30484" CreationDate="2016-10-11T09:55:10.413" Score="5" Body="&lt;p&gt;Under some probability space $(\Omega,\mathcal{F},\Bbb{P})$ equipped with the (augmentation of the) natural filtration ${\bf{F}}=(\mathcal{F}_t)_{t \geq 0}$ of a $\mathbb{P}$-Wiener process $(W_t)_{t\geq 0}$, consider the Itô process &#xA;$$ X_t = X_0 + \int_0^t \mu(s) ds + \int_0^t \sigma(s) dW_s \tag{1} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for some sufficiently well-behaved functions $\mu$ and $\sigma$, such that the stochastic integration can be defined in the Itô sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Define the integral&#xA;$$Y_t = \int_0^t X_u du $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From $(1)$ it follows that &#xA;\begin{align}&#xA;Y_t &amp;amp;= \int_0^t \left( X_0 + \int_0^u \mu(s) ds + \int_0^u \sigma(s) dW_s \right) du \\&#xA;&amp;amp;= X_0 t + \int_0^t \int_0^u \mu(s) ds du + \int_0^t \int_0^u \sigma(s) dW_s du &#xA;\end{align}&#xA;Using (stochastic) Fubini theorem one can permute the integration order and write&#xA;\begin{align}&#xA;Y_t &amp;amp;= X_0 t + \int_0^t \int_s^t \mu(s) du  ds + \int_0^t \int_s^t \sigma(s) du dW_s \\&#xA;&amp;amp;= X_0 t + \int_0^t (t-s) \mu(s) ds + \int_0^t (t-s) \sigma(s) dW_s \\&#xA;&amp;amp;= \left(X_0 + \int_0^t \mu(s) ds + \int_0^t \sigma(s) dW_s\right) t - \int_0^t s \mu(s) ds - \int_0^t s \sigma(s) dW_s \\&#xA;&amp;amp;= X_t t - \underbrace{\int_0^t s \mu(s) ds}_{\text{classic integral}} - \underbrace{\int_0^t s \sigma(s) dW_s}_{\text{Itô integral}} \\&#xA;\end{align} &#xA;And one can now appeal to the usual &quot;differential&quot; definition (whether from standard calculus or Itô calculus) to write:&#xA;\begin{align}&#xA;dY_t &amp;amp;= \underbrace{X_t dt + t dX_t + 0}_{d(X_t t)\,\,\,\text{Itô's lemma}} - t \mu(t) dt -t \sigma(t) dW_t \\&#xA;&amp;amp;= X_t dt + t dX_t - t \underbrace{(\mu(t) dt + \sigma(t) dW_t)}_{dX_t} \\&#xA;&amp;amp;= X_t dt&#xA;\end{align}&#xA;Now as mentioned in the comments, because any smooth function $g(X_t)$ will also be an Itô process, you can repeat the reasoning with $\tilde{X}_t := g(X_t)$ to get, for your particular problem,&#xA;$$ dY_t = \tilde{X}_t dt = g(X_t) dt $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Remark]&lt;/strong&gt; Should $X_u = X(u) \to X(t,u)$ with an additional, explicit dependence on $t$ things can get more complicated. See &lt;a href=&quot;https://math.stackexchange.com/questions/230996/analogue-of-leibniz-rule-for-stochastic-integrals&quot;&gt;this&lt;/a&gt; related question on math SE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Edit]&lt;/strong&gt; Just saw that this was discussed &lt;a href=&quot;https://math.stackexchange.com/questions/1298990/stochastic-differential-equation-for-time-integral-of-stochastic-process&quot;&gt;here&lt;/a&gt; as well.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="-1" LastEditDate="2017-04-13T12:19:21.677" LastActivityDate="2016-10-12T09:35:09.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30502" PostTypeId="1" CreationDate="2016-10-11T11:11:34.383" Score="1" ViewCount="24" Body="&lt;p&gt;I'm looking to conduct some research regarding government bond purchases by central banks. I am wondering where I can find the maturities of bonds purchased as well as the quantity online?&lt;/p&gt;&#xA;" OwnerUserId="13375" LastActivityDate="2016-10-11T11:11:34.383" Title="Where can I find information about historical asset maturities purchased for QE by Fed and ECB?" Tags="&lt;treasuries&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30503" PostTypeId="2" ParentId="30483" CreationDate="2016-10-11T11:48:38.207" Score="0" Body="&lt;p&gt;If you are using unadjusted data, you need to do the adjustments yourself. For instance, not too long ago Apple made a 7-for-1 stock split. It would be astonishing if you don't account for it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then there is the case with dividends as they are discrete in nature. Suppose we are talking about cash dividends as the dividend amount is usually assumed to be discounted from the stock price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are trading options, options are not protected against regular dividends and special dividends are decided on a case-by-case basis (at least it is what I remember from reading CBOE guidelines). Plus, if you are trading on indexes such as S&amp;amp;P 500 then it is not a big problem that you take adjusted returns and assume continuous dividends for discounting future returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose you are trading a single stock (e.g. MSFT). Then you earn those dividends if you are long the stock and pay for dividends if you are short. You should take these into account when calculating your returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The error gap widens if the dividend paying company is generous in handing out cash. Otherwise, it might not worth the trouble for backtesting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It also has something to do with what you want with the dividends. If you are reinvesting, you can use S&amp;amp;P500 total return index (&lt;a href=&quot;https://ycharts.com/indices/%5ESPXTR&quot; rel=&quot;nofollow&quot;&gt;SPXTR&lt;/a&gt;).  &lt;/p&gt;&#xA;" OwnerUserId="8147" LastActivityDate="2016-10-11T11:48:38.207" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="30505" PostTypeId="1" AcceptedAnswerId="30506" CreationDate="2016-10-11T19:26:31.210" Score="2" ViewCount="143" Body="&lt;p&gt;&lt;strong&gt;Background Information:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The price of a portfolio at time $t$ ($t = 0 ,1$) is $$V_t(\pi) = \phi S_t + \psi B_t$$&#xA;The portfolio $\pi$ is a perfect hedge for the claim $X$ if $V_1(\pi) = X$ a.s. as random variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given claim $X$, to have a perfect hedge then $\phi$ and $\psi$ must satisfy &#xA;\begin{equation}&#xA;\phi S_1(u) + \psi B_1 = X(u)&#xA;\end{equation}&#xA;\begin{equation}&#xA;\phi S_1(d) + \psi B_2 = X(d)&#xA;\end{equation}&#xA;We have solving for this that &#xA;$$\phi = \frac{X(u) - X(d)}{S_1(u) - S_1(d)}$$&#xA;$$\psi = B_1^{-1}(X(u) - \phi S_1(u)) = B_1^{-1}(X(d) - S_1(d))$$&#xA;Thus the resulting value of $X$ at $t=0$ is $$V_0(X) = V_0(\pi) = \phi S_0 + \psi B_0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Let $\beta = B_0 B_1^{-1}$ be the discount factor. Show that &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$$V_0(X) = \beta\left[\left(\frac{\beta^{-1}S_0 - S_1(d)}{S_1(u) - S_1(d)}\right)X(u) + \left(\frac{S_1(u) - \beta^{-1}S_0}{S_1(u) - S_1(d)}\right)X(d)\right]$$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I have tried this three times now and I still not getting the result what I do is this if you want to see my attempted work let me know. Otherwise it would be great if someone could give me a good start to this. There must be something that I am not seeing in regards to some algebra trick.&lt;/p&gt;&#xA;" OwnerUserId="19002" LastActivityDate="2016-10-11T19:52:21.203" Title="Value of a perfect hedge" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30506" PostTypeId="2" ParentId="30505" CreationDate="2016-10-11T19:52:21.203" Score="3" Body="&lt;p&gt;Using the values for $\phi$ and $\psi$ that you have derived, &#xA;\begin{align*}&#xA;V_0(X) &amp;amp;= \phi S_0 + \psi B_0\\&#xA;&amp;amp;= \frac{X(u) - X(d)}{S_1(u) - S_1(d)} S_0 + B_1^{-1}\left(X(u) - \frac{X(u) - X(d)}{S_1(u) - S_1(d)}S_1(u)\right) B_0\\&#xA;&amp;amp;=\beta\left(\frac{X(u) - X(d)}{S_1(u) - S_1(d)} \beta^{-1}S_0 + \frac{X(d) S_1(u) - X(u)S_1(d)}{S_1(u) - S_1(d)} \right)\\&#xA;&amp;amp;=\beta\left(\frac{\beta^{-1}S_0 - S_1(d)}{S_1(u) - S_1(d)} X(u) + \frac{S_1(u) - \beta^{-1}S_0 }{S_1(u) - S_1(d)} X(d)\right).&#xA;\end{align*}&#xA;What you need is to combine terms with $X(u)$ together, and likewise for terms with $X(d)$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-10-11T19:52:21.203" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30508" PostTypeId="1" AcceptedAnswerId="30511" CreationDate="2016-10-11T22:13:36.707" Score="0" ViewCount="74" Body="&lt;p&gt;&lt;strong&gt;Background Information:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question follows from &lt;a href=&quot;https://quant.stackexchange.com/questions/30505/value-of-a-perfect-hedge&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is tempting to write $$V_0(X) = \beta\left[\left(\frac{\beta^{-1}S_0 - S_1(d)}{S_1(u) - S_1(d)}\right)X(u) + \left(\frac{S_1(u) - \beta^{-1}S_0}{S_1(u) - S_1(d)}\right)X(d)\right]$$&#xA;as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V_0(X) = E_Q[\beta X]$$ where the expectation is taken with respect to the new purely formal probability measure $Q$ defined by $$Q(u) = \frac{\beta^{-1}S_0 - S_1(d)}{S_1(u) - S_1(d)}$$ and $$Q(d) = \frac{S_1(u) - \beta^{-1}S_0}{S_1(u) - S_1(d)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that $Q(u) + Q(d) = 1$; $Q$ will be a probability measure provided these values are non-negative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Show why $ \ Q(u),Q(d) \geq 0$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My reasoning:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose $$Q(u) = \frac{\beta^{-1}S_0 - S_1(d)}{S_1(u) - S_1(d)} &amp;lt; 0$$ then either $\beta^{-1}S_0 - S_1(d) &amp;gt; 0$ and $S_1(u) - S_1(d) &amp;lt; 0$ or $\beta^{-1}S_0 - S_1(d) &amp;lt; 0$ and $S_1(u) - S_1(d) &amp;gt; 0$. In either case there would be an arbitrage opportunity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the first case where $$\beta^{-1}S_0 - S_1(d) &amp;gt; 0 \ \ \text{and} \ \ S_1(u) - S_1(d) &amp;lt; 0$$&#xA;Then I believe we would short $\beta^{-1}S_0$ and use the proceeds to go long in a bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure if this is sort of the correct reasoning I need to fulfill the question. Any suggestions are greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-10-12T08:58:56.330" Title="Do we have arbitrage if the probability measures are less than zero" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30509" PostTypeId="1" AcceptedAnswerId="30510" CreationDate="2016-10-11T22:44:26.247" Score="1" ViewCount="4696" Body="&lt;p&gt;I've heard from Renaissance Technologies Corp. that there exists a software for investors which is called Advent Software's Geneva. Could anyone be able to explain to me what is this software exactly?&lt;/p&gt;&#xA;" OwnerUserId="24786" LastEditorUserId="24786" LastEditDate="2016-10-12T01:52:44.143" LastActivityDate="2020-04-03T19:02:24.437" Title="What is Advent Software's Geneva?" Tags="&lt;software&gt;&lt;investing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30510" PostTypeId="2" ParentId="30509" CreationDate="2016-10-12T00:57:28.387" Score="11" Body="&lt;p&gt;Advent Geneva is a complex event processing platform, which employs the latest advancements in artificial intelligence and big data. It employs techniques derived from blockchain technology and cryptography to speed up trading strategies. Under the hood, it uses a fast in-memory database whose kernel sits on an FPGA, to meets its demands in Ultra (in caps) high-frequency trading. It has the ability to drive an electric car autonomously and land it on Mars, using sophisticated Machine Learning (in caps) models, and earns every dollar in Bitcoin through advertising and Deep Learning (in caps). It is also column-oriented and distributed and has reached 3 million downloads on the iTunes store, and Advent was funded by Andreessen Horowitz. And it was written by some obscure mathematician who spent his time studying the analytic properties of weak Ricci curvature bounds, I heard on Zerohedge that's how they're making all that money. It is a crowdsourced spoofing and quote spamming engine  that every Kaggle user swears by and Google has released an open source alternative to it. [insert uninterpretable but colorful Nanex diagram] More importantly, none of the above exists but Elon Musk has an idea to make this happen which makes it more valuable than something that exists anyway.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;...is what I'd have liked to say. The truth is much less interesting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Advent Geneva is simply a middle/back office platform that performs various fund accounting functions, especially PnL/NAV computation, cash/position reconciliation and investor reporting and generation of statements for fund LPs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most hedge fund administrators provide a superset of these services and perform these functions through Advent Geneva. This is especially the case with mid-size fund administrators that do not have the development resources to build their own software platform. So in fact most hedge funds that engage a third party administrator are using it indirectly. While standalone, the licensing fees associated with it are high, it usually comes down to a small number of basis points for a fund at self-sustaining mass.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="4660" LastEditDate="2016-11-18T03:24:21.557" LastActivityDate="2016-11-18T03:24:21.557" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30511" PostTypeId="2" ParentId="30508" CreationDate="2016-10-12T08:58:56.330" Score="2" Body="&lt;p&gt;You've said it, $Q$ will be a &lt;em&gt;probability measure&lt;/em&gt; only if $Q(u)$ and $Q(d)$ are non-negative. This only happens in the &lt;em&gt;absence of arbitrage opportunities&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, if $Q(u)&amp;lt;0$, then either $\beta^{-1}S_0 &amp;gt; S_1(d) &amp;gt; S_1(u)$ or $ S_1(u) &amp;gt; S_1(d) &amp;gt; \beta^{-1} S_0$. In other words, either the risk-free asset strictly outperforms the risky one in all states of the world or the very opposite situation. In any case, this constitutes an arbitrage opportunity since both assets share the same initial price $S_0$. Shorting the under-performing one to go long the other is a zero cost strategy with a postive payout in all states of the world, hence the static arbitrage opportunity. You can use a similar rationale to show that $Q(d)$ cannot be negative in the absence of arbitrage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if you take the argument from the beginning it gives you that: assuming there is &lt;strong&gt;no arbitrage opportunity&lt;/strong&gt; (which is precisely what allowed you to write the first expression you state for $V_0(x)$), then, there &lt;strong&gt;exists a probability measure $Q$&lt;/strong&gt; such that one can write $V_0(X) = \Bbb{E}^Q[\beta X]$.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2016-10-12T08:58:56.330" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30513" PostTypeId="1" CreationDate="2016-10-12T11:27:38.970" Score="0" ViewCount="405" Body="&lt;p&gt;I have read Vidyamurthy and others, but did not find clear example of error correction model (ECM) application in pairs trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How should I use the ECM model in the pairs trading?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How to use ECM coefficients &quot;speed with which the time series corrects itself to maintain equilibrium&quot;, a_x and a_y?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="24792" LastActivityDate="2016-10-14T16:07:53.393" Title="How can I apply error correction model in pairs trading?" Tags="&lt;arbitrage&gt;&lt;pairs-trading&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30514" PostTypeId="2" ParentId="22513" CreationDate="2016-10-12T12:34:34.223" Score="0" Body="&lt;p&gt;The answer to this question has to do with two things: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(i) risk aversion; and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(ii) the current stock price, $S_0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short, the current stock price reflects the risk aversion of the average investor. For example, if you compute the weighted average of the two future stock prices (using the probabilities), you get the risk-neutral stock price, which is typically not the same as the current stock price, $S_0$, that you see in the binomial tree. The reason is that the current stock price reflects the average investor's risk aversion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put differently, suppose that we change the probabilities from, say, 50/50 to 60/40 (60% probability to the upper node). This will then immediately be reflected in the current stock price, as an increase in $S_0$. That, in turn, will increase the price of the replicating portfolio, and hence also the price of the call option. (Note that you cannot change the probabilities without allowing the current stock price to change. If you think about that for a second, it will become obvious to you.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Conclusion: The current stock price already contains information about the probabilities, and therefore, we don't need them to price options. &lt;/p&gt;&#xA;" OwnerUserId="24793" LastActivityDate="2016-10-12T12:34:34.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30516" PostTypeId="1" AcceptedAnswerId="30518" CreationDate="2016-10-12T13:41:53.907" Score="2" ViewCount="60" Body="&lt;p&gt;I was asked this in an interview.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The correct answer, I was told, follow from this argument&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $L_0[0,t]$ denote the time 0 price of Libor for period $0$ to $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $L_0[t,t+\delta_t]$ denote the time 0 price of Libor for period $t$ to $t+\delta t$  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(1+L_0[0,t])^{-1}$ dollar today is worth $1$ dollar at time $t$ hence $1+L_0[t,t+\delta_t]$ dollar at time $t+\delta t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the correct answer should be $(1+L_0[0,t])^{-1}-(1+L_0[0,t+\delta t])^{-1}$ by discounting the extra 1 dollar back to time 0.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I understand this, but I thought&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$1$ dollar today is worth $1+L_0[0,t]$ dollar at time $t$, hence $(1+L_0[0,t])(1+L_0[t,t+\delta_t])$ dollar at time $t+\delta t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That should be the same as investing 1 dollar for period 0 to $t+\delta t$. This should be $1+L_0[0,t+\delta t]$. Equating these give a different answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(1+L_0[0,t])(1+L_0[t,t+\delta_t])= 1+L_0[0,t+\delta t]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This gives $L_0[t,t+\delta_t] = (1+L_0[0,t+\delta t])(1+L_0[0,t])^{-1} - 1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is out by a factor of $1+L_0[0,t+\delta t]$. why is that the case? what did I miss?&lt;/p&gt;&#xA;" OwnerUserId="3334" LastActivityDate="2016-10-12T15:42:15.070" Title="What is time 0 price of Libor starting t for the period $t$ to $t+\delta t$" Tags="&lt;libor&gt;&lt;discounting&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30518" PostTypeId="2" ParentId="30516" CreationDate="2016-10-12T14:47:34.967" Score="0" Body="&lt;p&gt;The answer $$(1+L_0[0,t])^{-1}-(1+L_0[0,t+\delta t])^{-1}$$ is &lt;strong&gt;incorrect&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that, since  $(1+L_0[0,t])^{-1}$ dollar toady worth $1+L_0[t, t+\delta t]$ at time $t+\delta t$, and $(1+L_0[0,t+\delta t])^{-1}$ dollar today worth 1 dollar at time $t+\delta t$, therefore, &#xA;$$(1+L_0[0,t])^{-1}-(1+L_0[0,t+\delta t])^{-1}$$ dollar today worth $L_0[t, t+\delta t]$ at time $t+\delta t$, then&#xA;\begin{align*}&#xA;(1+L_0[0,t])^{-1}-(1+L_0[0,t+\delta t])^{-1} &amp;amp;= L_0[t, t+\delta t] P_0(t+\delta t)\\&#xA;&amp;amp;=L_0[t, t+\delta t] (1+L_0[0,t+\delta t])^{-1}.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;L_0[t, t+\delta t] = (1+L_0[0,t+\delta t])(1+L_0[0,t])^{-1} - 1,&#xA;\end{align*}&#xA;which is the same as your answer in your second part.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;EDIT:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Here, it is assumed that $L(0, t) = \frac{1}{P_0(t)}-1$, where $P_0(t)$ is the price at time $0$ of a zero-coupon bond with maturity $t$ and unit face value.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-10-12T15:42:15.070" LastActivityDate="2016-10-12T15:42:15.070" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30519" PostTypeId="1" CreationDate="2016-10-12T15:04:22.290" Score="1" ViewCount="5571" Body="&lt;p&gt;Suppose I have a sequence of monthly returns of a stock, $r_1,r_2,\ldots$. Suppose further that this is an i.i.d. sequence with with finite second moments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In every paper, report, lecture note etc. the annualized volatility of the return of this stock is given as $\sigma(r_1)\sqrt{12}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, if I annualize the monthly returns first, that is if I consider $(1+r_1)^{12}-1,(1+r_2)^{12}-1,\ldots$, then I get $\sigma((1+r_1)^{12}-1) \approx 12\sigma(r_1)$ since $(1+x)^{12}-1 \approx 12x$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is what is wrong with what I am doing? Is it only a matter of convention that people use the first formula to report annualized volatility?&lt;/p&gt;&#xA;" OwnerUserId="11597" LastActivityDate="2016-10-12T18:05:18.717" Title="Calculating annualized volatility of stock returns" Tags="&lt;volatility&gt;&lt;returns&gt;&lt;annualized&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30520" PostTypeId="2" ParentId="30519" CreationDate="2016-10-12T15:32:28.727" Score="-1" Body="&lt;p&gt;Actually what you are referring as a conventions comes from an assumption that the returns are driven by a normal distribution. If you consider a stochastic variable (time-series of a random variable) that is normally distributed you can demonstrate that the variance of the distribution grows linearly with time. It means that if you go from a 1 day return time-series to a two-days return time series, the variance of the later is going to be twice as the former. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma^2_{annual} = 12 \sigma^2_{month} $  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the standard deviation (which is simplest estimation of the volatility) of the later is going to be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma_{annual} = \sqrt{12} \sigma_{month}$  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The definition of standard deviation, as being the square-root of the variance, is what makes financial industry, as a whole, to consider the square root of the time (compared to the daily volatility, for instance) as the correct way to convert to an annual volatility. &lt;/p&gt;&#xA;" OwnerUserId="24796" LastEditorUserId="24796" LastEditDate="2016-10-12T15:38:46.237" LastActivityDate="2016-10-12T15:38:46.237" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30521" PostTypeId="1" CreationDate="2016-10-12T16:35:24.093" Score="1" ViewCount="78" Body="&lt;p&gt;I am building a model that takes the 12 month ATM call implied volatility as one of its inputs. I downloaded this implied vol time series data from Bloomberg for CM CN Equity (Canadian Imperial Bank of Commerce) for the last decade or so. However, I've noticed a strange pattern in the data. Occasionally, the implied volatility will double or triple for a single day, and then immediately subside. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/UShs9.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/UShs9.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this time series graphs you can see a few of the sudden spikes that I am talking about around the middle, which last a single day. Is there a reason that one-day volatility spikes might be observed in the market, or is it likely a glitch in the data? Should I remove those spikes from a model, or would I be taking out useful information? &lt;/p&gt;&#xA;" OwnerUserId="17712" LastEditorUserId="16148" LastEditDate="2016-10-12T16:43:04.250" LastActivityDate="2016-10-12T17:46:46.580" Title="One-day spikes in implied volatility data" Tags="&lt;volatility&gt;&lt;data&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30522" PostTypeId="2" ParentId="30521" CreationDate="2016-10-12T17:46:46.580" Score="-2" Body="&lt;p&gt;If were you, probably i would take off these data. It seems to be outliers. In any case, check what could be happened in those days. &lt;/p&gt;&#xA;" OwnerUserId="24800" LastActivityDate="2016-10-12T17:46:46.580" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30523" PostTypeId="1" CreationDate="2016-10-12T17:54:32.083" Score="2" ViewCount="963" Body="&lt;p&gt;As there are so many different sccenarios about Vaicek Calibration but there has not been a clear example with data shown, I am totally Confused about how should I do it. so I am bringing the question here and I hope someone can help me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So assume we have a table of historical data like this:&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;|Date/Maturity| 3 Month | 1 year | 3 year | 5 year | 10 year|&#xA;|:----------- |--------:|:------:|:------:|:------:|:------:| &#xA;| jan 15      | 0.0012  | 0.0129 |   .    |  .     |    .   |&#xA;| feb 15      | 0.0013  | 0.0122 |   .    |  .     |    .   |&#xA;| mar 15      | 0.0015  | 0.0123 |   .    |  .     |    .   |&#xA;| apr 15      | 0.0012  | 0.0119 |   .    |  .     |    .   |&#xA;| may 15      | 0.0011  | 0.0122 |   .    |  .     |    .   |&#xA;| jun 15      | 0.0017  | 0.0121 |   .    |  .     |    .   |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;( I didn't complete the final lines because of frustration of writing table here, but they are all numbers. )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to calibrate the vasicek model for this data. which means finding parameters a,b,sigma in a way that the vasicek formula matches the best.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know the first steps which are as follows:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;assume initial values for $r_0$. e.g $r_0 = 0.0010$ and also for a,b and $\sigma$.&lt;/li&gt;&#xA;&lt;li&gt;calculate the euler discritization and get instantaneous interest rate with different scenarios. for example here we make 6 scenarios because we have 6 months. the formula is as follows:&#xA;$$r_{i+1} = a(b-r_i)\Delta t + \sigma  \sqrt{\Delta t}  z_i$$ &#xA;where $z_i$ is a standard normal distribution&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Here I put the plot for 6 scenarios made by Matlab:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/HoucS.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/HoucS.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the Next Step would be to take the next r in each sample. i.e. $r_1$ and use it as instantaneous rate for yield curves. this means we get 6 yield curves from the following formula:&#xA;$$R(\tau) = -\frac{1}{\tau} ln(P(\tau))$$&#xA;$$P(\tau) = A(\tau) . exp(-B(\tau)r(t))$$&#xA;with known A and B taken from Vasicek Model.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Now we get the mean of this 6 scenarios for each time to maturity and e.g get an array of 5 numbers which are maturities for 3 month, 1 year, 3 year, 5 year and 10 year.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;And then I don't know what happens next? Should i use Least squares? Where are we going use the real data values? Am I missing something in the first steps?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I Appreciate any help.&lt;/p&gt;&#xA;" OwnerUserId="24801" LastEditorUserId="20751" LastEditDate="2016-10-17T15:58:16.403" LastActivityDate="2016-10-17T15:58:16.403" Title="Complete Algorithm of Calibration with Vasicek Model using Term-Structure Dynamics over Time" Tags="&lt;calibration&gt;&lt;short-rate&gt;&lt;vasicek&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30524" PostTypeId="2" ParentId="30519" CreationDate="2016-10-12T18:05:18.717" Score="2" Body="&lt;p&gt;It makes no difference whether you work with annualized numbers or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you work with monthly logarithmic returns $\{r_1,r_2,\cdots,r_{12}\}$ then the return for the year is $R=r_1+r_2+\cdots+r_{12}$. Assuming only that the returns are i.i.d and the standard deviation $\sigma$ exists, then the standard deviation of the annual return $R$ is $\sqrt {12} \sigma$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you prefer to work with annualized returns, then you are looking at $\{12 r_1,12 r_2,\cdots,12r_{12}\}$. The return for the full year is $\frac{12r_1+12r_2+\cdots+12r_{12}}{12}$ which is the identical expression as before and its volatility is again $\sqrt {12} \sigma$.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2016-10-12T18:05:18.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30525" PostTypeId="2" ParentId="30513" CreationDate="2016-10-12T19:16:44.900" Score="1" Body="&lt;p&gt;If (x, y) are both integrated to the same order (commonly I(1)), we can estimate an ECM model of the form: &#xA;${\displaystyle A(L)\Delta y_{t}=\gamma +B(L)\Delta x_{t}+\alpha (y_{t}-\beta _{0}-\beta _{1}x_{t})+\nu _{t}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Estimate the model using Ordinary least squares: ${\displaystyle y_{t}=\beta _{0}+\beta _{1}x_{t}+\epsilon _{t}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the predicted residuals ${\displaystyle {\hat {\epsilon _{t}}}=y_{t}-\beta _{0}-\beta _{1}x_{t}}$ from this regression are saved and used in a regression of differenced variables plus a lagged error term: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;${\displaystyle A(L)\Delta y_{t}=\gamma +B(L)\Delta x_{t}+\alpha {\hat {\epsilon _{t-1}}}+\nu _{t}} $.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This completes the error correction method. In practice the widespread uses of ECM in equity pairs has made the revenue potential either tiny or redundant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also see &lt;a href=&quot;https://en.wikipedia.org/wiki/Error_correction_model#An_example_of_ECM&quot; rel=&quot;nofollow&quot;&gt;https://en.wikipedia.org/wiki/Error_correction_model#An_example_of_ECM&lt;/a&gt; for a consumption ECM example.&lt;/p&gt;&#xA;" OwnerUserId="21023" LastEditorUserId="16148" LastEditDate="2016-10-14T16:07:53.393" LastActivityDate="2016-10-14T16:07:53.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30526" PostTypeId="2" ParentId="21747" CreationDate="2016-10-12T19:22:22.273" Score="0" Body="&lt;p&gt;Take BCM's approach, or, weight your exposure (and PNL) by the stock beta within the equity index. To do this, run the least squares regression to determine BetaA:&#xA;'    '&lt;br&gt;&#xA;    StockPriceA = const + BetaA * SectorEquityIndex + residual&#xA;    StockPriceB = const + BetaB * SectorEquityIndex + residual&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could then either trade one stock hedged at that beta against the index, or two stocks (A,B) hedged against one another with weights BetaA/BetaB.&lt;/p&gt;&#xA;" OwnerUserId="21023" LastEditorUserId="21023" LastEditDate="2016-10-13T19:49:39.727" LastActivityDate="2016-10-13T19:49:39.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30527" PostTypeId="1" AcceptedAnswerId="30528" CreationDate="2016-10-12T20:19:09.070" Score="0" ViewCount="97" Body="&lt;p&gt;For $X_t$ a brownian motion defined for $t\in[0,T]$,&lt;br&gt;&#xA;How to show the equality of following events:&#xA;$$&#xA;\{ \displaystyle \max_{[\tau,T]}(X_t)\ge 2u-d, \tau\leq T \}=\{\displaystyle \max_{[0,T]}(X_t)\ge 2u-d\}&#xA;$$&#xA;where,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\tau=min\{t:X_t=u\} $ and  $0&amp;lt;d &amp;lt;u $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I Thank You in advance.&lt;/p&gt;&#xA;" OwnerUserId="20360" LastActivityDate="2016-10-20T11:47:13.413" Title="How to show the equality of these two events?" Tags="&lt;stochastic-processes&gt;&lt;brownian-motion&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30528" PostTypeId="2" ParentId="30527" CreationDate="2016-10-12T22:23:37.710" Score="3" Body="&lt;p&gt;Let $\max_{[0, T]} \left( X_t \right) = M_T$. We have $2u - d &amp;gt; u$ and thus $M_T \geq 2u - d$ implies that $M_T &amp;gt; u$. Note that $X$ is a continuous process with initial value $X_0 = 0 &amp;lt; u$. Then, in order for a path of $X$ to start at $X_0 = 0$ and reach a point $M_T &amp;gt; 2u - d$ it has to cross the level $u$ first.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2016-10-12T22:45:47.457" LastActivityDate="2016-10-12T22:45:47.457" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30530" PostTypeId="1" CreationDate="2016-10-13T03:04:35.643" Score="7" ViewCount="318" Body="&lt;p&gt;Hopefully, this is an acceptable question in this forum, even if it isn't analytically focused.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As part of an effort to analyse the effect of different option trade structures on a portfolio, I need to determine the margin requirements for different trades. Normally I would just build the margin calculation for the specific strategy I am using. In this case, the system needs to be able to handle more complex and possibly non-traditional option trade structures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for a programming library that could be given the appropriate trade information and produce the margin/cost requirements for the trade based on the CBOE Strategy-Based Margin Rules.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cboe.com/framed/pdfframed.aspx?content=/learncenter/pdf/margin2-00.pdf&amp;amp;section=SECT_MINI_SITE&amp;amp;title=CBOE%20Margin%20Manual&quot;&gt;CBOE Margin Manual&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could work with a library written in R, MATLAB, .NET, Java, Javascript or C++. A .NET library would be ideal but I could work with almost anything, especially if it was open source.&lt;/p&gt;&#xA;" OwnerUserId="19959" LastActivityDate="2016-10-17T18:14:23.447" Title="Libraries for calculating options strategy-based margin" Tags="&lt;options&gt;&lt;margin&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30531" PostTypeId="1" CreationDate="2016-10-13T06:14:18.130" Score="0" ViewCount="402" Body="&lt;p&gt;There are call and put options on the same underlying asset, with the same expiry, $T$, and with strikes $K_c=(k_c^1, k_c^2, \ldots, k_c^m)$ and $K_p=(k_p^1, k_p^2, \ldots, k_p^m)$, $S_t$ is a price of the&#xA;underlying asset at calendar time, $0\leq t \leq T$, $\hat{S}_T$ is a forecasting price of the underlying asset at the time $T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose you would like to construct &lt;strong&gt;a negative cost portfolio&lt;/strong&gt; at the start time $t=0$ by combining long and short positions in put and call European-style contracts based on the same underlying asset with different strikes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $X_c=(x_1^c, x_2^c, \ldots, x_m^c)$, $X_p=(x_1^p, x_2^p, \ldots, x_m^p)$ be the number of unit of call&#xA;and put options, with $x_i^c, x_i^p&amp;gt;0$ for buying, $x_i^c, x_i^p&amp;lt;0$ for selling. Denote by $C=(c_1, c_2, \ldots, c_m)$ and $P=(p_1, p_2, \ldots, p_m)$ the market prices for buying and selling of call and put options respectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the cost portfolio, $M$, at the time of purchase, $t=0$, is expressed by:&#xA;$$M=\sum_{i=1}^{m} x_i^c \cdot c_i+ x_i^p \cdot p_i.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the negative cost portfolio $M$ should be negative, i.e. $M&amp;lt;0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Denote by $V$ the payoff function &#xA;$V(S_T, K_c, K_p, T, X)=\sum_{i=1}^{m} x_i^c (\hat{S}_T-k_c^i)^+ + x_i^p (k_p^i - \hat{S}_T)^- - M$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to show that the payoff $V(T)$ at time $T$ is non-negative ($V≥0$)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The example of the portfolio and payoff at $t=0$ and $t=T$ in &lt;code&gt;R&lt;/code&gt; is below &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;X_c &amp;lt;- c(-3, -7, 2, 0, -2, 10);&#xA;X_p &amp;lt;- c( 1,  1, 7, 4, -5, -8);&#xA;K_c &amp;lt;- c(8050, 8150, 8250, 8350, 8400, 8500);&#xA;K_p &amp;lt;- c(7850, 7950, 8050, 8150, 8250, 8350);&#xA;S_hat_T &amp;lt;- 8400;&#xA;C &amp;lt;- c(48.0, 10.0,  0.9,   0.5,   0.3,   0.2); &#xA;P &amp;lt;- c( 2.2, 10.5, 35.0, 100.0, 183.0, 343.0);&#xA;&#xA;M &amp;lt;- sum(X_c*C) + sum(X_p*P);  &#xA;M&#xA;# [1] -3212.1&#xA;V &amp;lt;- sum(X_c*max(S_hat_T-K_c,0)) + sum(X_p*max(K_p - S_hat_T,0))  &#xA;V&#xA;#[1] 0&#xA;V-M&#xA;#[1] 3212.1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;$M=-3212.1&amp;lt;0$, therefore, the portfolio having negative cost&#xA;at time $t=0$, and $V=0$, at the time $T$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is what is wrong with what I am doing? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update.&lt;/strong&gt; After noob2's comment. I tried to find the rule of the cost portfolio calculation, and the book by&#xA;Eliezer Z Prisman (2000) &lt;a href=&quot;https://books.google.ru/books?id=4ka_lYihTwYC&amp;amp;pg=PA96&amp;amp;dq=negative%20cost%20portfolio&amp;amp;hl=en&amp;amp;sa=X&amp;amp;ved=0ahUKEwjvkNyhjNfPAhUKEywKHeuTDUYQ6AEIIzAB#v=onepage&amp;amp;q=negative%20cost%20portfolio&amp;amp;f=false&quot; rel=&quot;nofollow&quot;&gt;Pricing derivative securities&lt;/a&gt;: an interactive, dynamic environment with Maple V and Matlab was found.&lt;/p&gt;&#xA;" OwnerUserId="20913" LastEditorUserId="16148" LastEditDate="2016-10-14T13:01:07.283" LastActivityDate="2016-10-14T13:01:07.283" Title="How to calculate an option porfolio cost and payoff function?" Tags="&lt;arbitrage&gt;&lt;reference-request&gt;&lt;portfolio-selection&gt;&lt;self-study&gt;&lt;european-options&gt;" AnswerCount="0" CommentCount="8" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30534" PostTypeId="1" AcceptedAnswerId="30535" CreationDate="2016-10-13T09:34:38.677" Score="0" ViewCount="404" Body="&lt;p&gt;I was going through some basic stuff and I found something that I couldn't really make sense of. Lets say that two entities A and B engage in a currency swap. A pays 3% on USD, while B pays 2% on JPY. While I understand that the discrepancy in the interest rate stem from the fact that A and B might have different credit ratings from the US and Japan, it seems to me that this would lead to an arbitrage opportunity. If we cut out the middleman, wouldn't this mean that B will be earning a free percentage on the principle? Or, is my understanding of currency swaps and comparative advantage just bogus?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Criticism is welcome as long as they are constructive. I would appreciate any input.&lt;/p&gt;&#xA;" OwnerUserId="19502" LastActivityDate="2016-10-13T10:50:13.133" Title="fixed-for-fixed currency swap interest rate discrepancy" Tags="&lt;currency&gt;&lt;interest-rate-swap&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30535" PostTypeId="2" ParentId="30534" CreationDate="2016-10-13T10:50:13.133" Score="2" Body="&lt;p&gt;I think your understanding of currency swaps may be incorrect. A is paying 3 pct interest on the USD principal and then the whole USd principal at the maturity.  Likewise B pays both interest and principal in Yen.  The interest rate differential is mostly due to different central bank policies in US and Japan, not credit ratings.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-10-13T10:50:13.133" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30536" PostTypeId="1" AcceptedAnswerId="30568" CreationDate="2016-10-13T12:37:20.230" Score="1" ViewCount="585" Body="&lt;p&gt;I heard there is a possibility to model a loan contract including a prepayment option with the help of a swap including a swaption?&#xA;I know that it is possbile to construct a prepayment loan as a callable bond in a binomial tree, but I'm not sure if this relation is somehow related to a swap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Honestly I did not get the intuition how loans can be modelled as swaps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your help,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;K.S.&lt;/p&gt;&#xA;" OwnerUserId="24804" LastActivityDate="2016-10-25T13:09:09.380" Title="Modelling a prepayment loan via an swap and swaptions" Tags="&lt;options&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30543" PostTypeId="1" AcceptedAnswerId="30546" CreationDate="2016-10-13T21:56:59.817" Score="0" ViewCount="85" Body="&lt;p&gt;From the question below am having some issues in solving it. I know that  Fair Market Value of Assets = Net asset value+Liabilities. However, in this case am dealing with stocks and I need to find the market value for a share. How do I move from what I know to stocks or is it a new concept all together? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a REIT that holds high quality office building in some of the best locations in the U.S. The REIT is currently traded at a price of $65/Share and there are 110 million shares outstanding. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Expected next year total revenue:$680M&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Expected next year total expenses (including interest and depreciation):$350M&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Expected next year depreciation:$80M&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Expected next year interest: $60M&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Total Debt: $2.0B&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Current Office CAP in the U.S.: 4.5% to 6.0% depending on quality and location.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a. What is your estimation for a fair market value for a share of the REIT described?&lt;/p&gt;&#xA;" OwnerUserId="24813" LastActivityDate="2016-10-14T02:29:24.400" Title="What is your estimation for a fair market value for a share of the REIT" Tags="&lt;real-estate&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30544" PostTypeId="2" ParentId="25496" CreationDate="2016-10-13T22:33:06.533" Score="2" Body="&lt;p&gt;To answer your second question, the expense ratio fees are reflected in the net asset value of the ETF. Shorting also incurs a borrow cost.&lt;/p&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="16160" LastEditDate="2017-11-08T03:34:50.407" LastActivityDate="2017-11-08T03:34:50.407" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30545" PostTypeId="1" AcceptedAnswerId="30590" CreationDate="2016-10-13T23:01:39.580" Score="0" ViewCount="50" Body="&lt;p&gt;&lt;strong&gt;Background:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have so far taken the bond B to be deterministic for simplicity, but some reflection shows that this is not in any way necessary. Everything works out the same way with a stochastic bond&#xA;$B_1(u) \neq B_1(d)$ (except the algebra takes a little more work), as we now describe.&#xA;The equations defining the hedging portfolio now become&#xA;$$\phi S(u) + \psi B(u) = X(u) \ \ \ \  \  (1.11)$$&#xA;$$\phi S(d) + \psi B(d) = X(d) \ \ \ \  \  (1.12)$$&#xA;where we have temporarily dropped the subscript “1&quot; on $S_1$ and $B_1$ for convenience.&#xA;Assuming that the determinant $\Delta = S(u)B(d) − S(d)B(u)$ is nonzero, the unique solution&#xA;is&#xA;$$\phi = \frac{B(d)X(u) − B(u)X(d)}{\Delta} \ \ \ \ (1.13)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\psi = \frac{S(u)X(d) − S(d)X(u)}{\Delta} \ \ \ \ (1.14)$$&#xA;The claim value is again forced by the assumption of no arbitrage to be&#xA;$$V_0(X) = \phi S_0 + \psi B_0$$&#xA;If we define the discount factor (now stochastic) as $\beta(\cdot) = B_0/B(\cdot)$, we obtain&#xA;$$V_0(X) = E_Q[\beta X] \ \ \ \ \ (1.15)$$&#xA;where $Q$ is a candidate probability measure defined by&#xA;$$Q(u) = \frac{−B(u)S(d) + B(u)B(d)(S0/B0)}{\Delta} \ \ \ \ \ (1.16)$$&#xA;$$Q(d) = \frac{−B(d)B(u)(S0/B0) + S(u)B(d)}{\Delta} \ \ \ \ \ (1.17)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Verify formulas (1.15),(1.16), and (1.17)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Partial solution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;V_0(X) = \phi S_0 + \psi B_0 &amp;amp;= \left(\frac{B(d)X(u) − B(u)X(d)}{\Delta}\right)S_0 + \left(\frac{S(u)X(d) − S(d)X(u)}{\Delta}\right)B_0\\&#xA;&amp;amp;= \frac{B(d)X(u)S_0 - B(u)X(d)S_0 + S(u)X(d)B_0 - S(d)X(u)B_0}{\Delta}\\&#xA;&amp;amp;= \frac{(B(d)S_0 - S(d)B_0)X(u) + (S(u)B_0 - B(u)S_0)X(d)}{\Delta}\\&#xA;&amp;amp;= \left(\frac{B(d)S_0 - S(d)B_0}{\Delta}\right)X(u) + \left(\frac{S(u)B_0 - B(u)S_0}{\Delta}\right)X(d) &#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe this is where I need to incorporate the $\beta(\cdot)$ discount factor but I am really sure how to do that, I don't really understand the discount factor. Any suggestions is greatly appreciated. &lt;/p&gt;&#xA;" OwnerUserId="19002" LastActivityDate="2016-10-17T13:37:39.527" Title="Verifying value of claim as an expectation" Tags="&lt;modern-portfolio-theory&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;&lt;financial-engineering&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30546" PostTypeId="2" ParentId="30543" CreationDate="2016-10-14T02:22:24.263" Score="0" Body="&lt;p&gt;Are you familiar with the concept of 'cap rates' in US commercial real estate? The Cap Rate is a number such that the Market Value of the building is equal to the NOI (net operating income) divided by the cap rate. Estimates of cap rates for various kinds of buildings are publicly available (and included in the problem statement here).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Start by computing the NOI (which is income before depreciation and interest) from the figures given above and divide it by 0.045 (high quality cap rate of 4.5%) to get the building MV. You know the REIT Debt is 2 billion so find the value of the REIT equity by subtraction. Debt+Equity = MV . Finally divide the Equity by the number of shares to find the price per share.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-10-14T02:29:24.400" LastActivityDate="2016-10-14T02:29:24.400" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30547" PostTypeId="2" ParentId="8434" CreationDate="2016-10-14T02:42:34.427" Score="1" Body="&lt;p&gt;I'm not sure but I think this mistake. caller.setRscriptExecutable(&quot;C:/Program Files/R/R-2.15.2/bin/Rscript&quot;);&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you try to use backslash between word. caller.setRscriptExecutable(&quot;C:\Program Files\R\R-3.3.1\bin\i386\Rscript&quot;);&lt;/p&gt;&#xA;" OwnerUserId="24816" LastActivityDate="2016-10-14T02:42:34.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30548" PostTypeId="1" AcceptedAnswerId="30675" CreationDate="2016-10-14T06:29:22.397" Score="0" ViewCount="64" Body="&lt;p&gt;I have been reading NZ Superfund's 2015 Ref Portfolio Review (&lt;a href=&quot;https://www.nzsuperfund.co.nz/sites/default/files/documents-sys/2015%20Reference%20Portfolio%20Review.pdf&quot; rel=&quot;nofollow&quot; title=&quot;here&quot;&gt;here&lt;/a&gt;) and came across this notion:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Our estimate of the equilibrium return on 90-day Treasury Bills is 5%.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And this is under the column Risk-Free Rate.&#xA;Can anybody expalin what does this mean?&lt;/p&gt;&#xA;" OwnerUserId="19096" LastEditorUserId="19096" LastEditDate="2016-10-14T06:34:37.503" LastActivityDate="2016-10-22T14:22:25.370" Title="What does equilibrium return on 90-day Treasury Bills mean?" Tags="&lt;portfolio-management&gt;&lt;yield-curve&gt;&lt;risk-free&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30549" PostTypeId="1" AcceptedAnswerId="30550" CreationDate="2016-10-14T07:16:39.260" Score="7" ViewCount="567" Body="&lt;p&gt;Out of curiosity I tried to compute the portfolio weights of a maximum certainty equivalent allocation, however, by incorporating (quadratic) transaction costs. However, my result is not as intuitive as I thought =(&#xA;I would be happy for each and every hint to solve this problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let the parameters of the return distribution be $\Sigma$ and $\mu$. The current allocation vector is $\omega_c$. The risk aversion factor of the investor is defined as $\gamma$. When shifting his wealth to allocation $\alpha$, the investor pays a fee of the form $T = c(\alpha - \omega_c)'(\alpha - \omega_c)$ with some parameter $c$, therefore transaction costs increase quadratically by factor $c$. &#xA;Therefore, at time point $t+1$ the investor expects the portfolio returns to be&#xA;$$\mu_\text{PF} = \alpha'\mu - T(\alpha,\omega_c)$$&#xA;and the corresponding variance of the portfolio &#xA;$$\sigma^2_\text{PF} = \alpha'\Sigma\alpha.$$&#xA;In one line, the allocation is chosen as the solution to the maximization problem &#xA;$$\alpha^* = \arg \max _{\sum \alpha = 1} \alpha'\mu - T(\alpha,\omega_c) - \frac{\gamma}{2}\alpha'\Sigma\alpha.$$&#xA;Equivalently, we have:&#xA;$$\alpha^* = \omega_c + \arg \max _{\sum \Delta = 0} (\omega_c+\Delta)'\mu - c\Delta'\Delta - \frac{\gamma}{2}(\omega_c+\Delta)'\Sigma(\omega_c+\Delta).$$&#xA;$$ \Delta^* =  \arg \max _{\sum \Delta = 0} \underbrace{\omega_c '\mu  - \frac{\gamma}{2}\omega_c'\Sigma\omega_c}_{CE(\omega_c)} +\Delta'\mu - c\Delta'\Delta - \frac{\gamma}{2}\Delta'\Sigma\Delta - \gamma \Delta'\Sigma\omega_c.$$&#xA;$$ \Delta^* =  \arg \max _{\sum \Delta = 0} \Delta'\mu - \Delta'\underbrace{(c I + \frac{\gamma}{2}\Sigma)}_{:=A}\Delta  - \gamma \Delta'\Sigma\omega_c.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first-order conditions take the form:&#xA;$$\mu - 2A\Delta - \gamma \Sigma\omega_c -\lambda\iota= 0$$&#xA;$$ \iota ' \Delta = 0$$&#xA;It follows that&#xA;$$A^{-1} (\mu-\gamma \Sigma \omega_c - \lambda \iota) = 2\Delta$$&#xA;Evaluating $\iota'\Delta = 0$ with $\Delta$ as above results in &#xA;$$\lambda = \frac{1}{\iota' A^{-1}\iota}\iota'A^{-1}[\mu - \gamma \Sigma \omega_c]$$&#xA;Plug-in gives&#xA;$$\Delta = A^{-1} (I - \frac{1}{\iota'A^{-1}\iota} \iota' A^{-1}\iota)  (\mu-\gamma \Sigma \omega_c ) = 0\iota.$$&#xA;&lt;strong&gt;In other words, no matter how sub-optimal the current allocation and irrespective of the sice of $c$, there will never be any rebalancing&lt;/strong&gt;. I do not believe this result but I also do not see the mistake in my computations. Anyone an idea, where did I miss something/ did something wrong?&lt;/p&gt;&#xA;" OwnerUserId="16249" LastActivityDate="2016-10-14T08:37:12.470" Title="Maximum Certainty Equivalent Portfolio with Transaction Costs" Tags="&lt;portfolio-management&gt;&lt;optimization&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30550" PostTypeId="2" ParentId="30549" CreationDate="2016-10-14T08:25:48.567" Score="6" Body="&lt;p&gt;Seems like a small mistake in the last equation. It should read&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Delta^* = A^{-1} \left[\mu-\gamma \Sigma \omega_c  - \frac{1}{\iota'A^{-1}\iota} \iota' A^{-1}(\mu-\gamma \Sigma \omega_c )\iota\right]$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is not equivalent to your result.&lt;/p&gt;&#xA;" OwnerUserId="19745" LastActivityDate="2016-10-14T08:25:48.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30551" PostTypeId="2" ParentId="30549" CreationDate="2016-10-14T08:37:12.470" Score="4" Body="&lt;p&gt;You would like to solve the following optimisation problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{gather}&#xA;\Delta^* = \arg \max_\Delta \Delta^T\mu - \Delta^T A \Delta  - \gamma \Delta^T \Sigma\omega_c\\&#xA;\text{subject to:}\quad \Delta^T \mathbf{1} = 0 &#xA;\end{gather}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Build the Lagrangian&#xA;$$ \mathcal{L}(\Delta,\lambda) = \Delta^T\mu - \Delta^T A \Delta  - \gamma \Delta^T \Sigma\omega_c - \lambda(\Delta^T \mathbf{1}) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First order KKT conditions then yield:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\partial_\Delta \mathcal{L}(\Delta^*,\lambda^*) = \mu - A\Delta^* - \gamma\Sigma\omega_c - \lambda^*\mathbf{1} = \mathbf{0} \tag{1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;along with $\partial_\lambda \mathcal{L}(\Delta^*,\lambda^*)=0$ (which is precisely the constraint equation)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(1)$ is equivalent to writing&#xA;$$ \Delta^* = A^{-1}(\mu-\lambda^*\mathbf{1} - \gamma\Sigma\omega_c) \tag{2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Plugging this into the constraint equation then gives:&#xA;\begin{align}&#xA;&amp;amp;(\mu-\lambda^*\mathbf{1} - \gamma\Sigma\omega_c)^T(A^{-1})^T \mathbf{1} = 0 \\&#xA;&amp;amp;\mu^T (A^{-1})^T \mathbf{1} -\lambda^*\mathbf{1}^T (A^{-1})^T \mathbf{1} -\gamma\omega_c^T\Sigma^T (A^{-1})^T \mathbf{1} = 0&#xA;\end{align}&#xA;Noting that $A := \frac{\gamma}{2}\Sigma + cI$ is symmetric, i.e. $(A^{-1})^T = A^{-1}$ further yields, as you mention:&#xA;$$ \lambda^* = \frac{1}{\mathbf{1}^T A^{-1} \mathbf{1} } \mathbf{1}^T A^{-1} (\mu -\gamma \Sigma \omega_c ) \tag{3}$$&#xA;Plugging $(3)$ into $(2)$ finally gives:&#xA;$$ \Delta^* = A^{-1}\left( \mu - \gamma\Sigma\omega_c - \frac{1}{\mathbf{1}^T A^{-1} \mathbf{1} } \mathbf{1}^T A^{-1} (\mu -\gamma \Sigma \omega_c ) \mathbf{1} \right) $$&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2016-10-14T08:37:12.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30552" PostTypeId="1" CreationDate="2016-10-14T08:51:49.267" Score="1" ViewCount="339" Body="&lt;p&gt;I am working on CVA (credit valuation adjustments). The Basel committee released consultative document reviewing the CVA Risk Framework 'Review of the Credit Valuation Adjustment Risk Framework (2015)'. It describes the new FRTB-CVA and BA-CVA approaches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The paper 'Model foundations of the Basel III standardised CVA charge' by Pykhtin (2012) describes the model foundations of the current standardised approach. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a similar paper as Pykhtin (2012) describing the model foundations of the Basic CVA approach (BA-CVA)?&lt;/p&gt;&#xA;" OwnerUserId="24817" LastActivityDate="2018-02-15T09:06:19.677" Title="Basel Basic CVA Approach Model Foundations" Tags="&lt;models&gt;&lt;cva&gt;&lt;basel&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30553" PostTypeId="2" ParentId="30128" CreationDate="2016-10-14T09:29:35.513" Score="2" Body="&lt;p&gt;For American (or any HJB problem), numerical methods are depending on the dimensionality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below dimension 3 (even 4), a PDE will do the job nicely, whereas above, MC methods are more appropriate.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-10-14T09:29:35.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30554" PostTypeId="1" CreationDate="2016-10-14T12:35:30.917" Score="1" ViewCount="44" Body="&lt;p&gt;We can analyze factor investment approaches (momentum, low vol, quality, dividend, ...) for example by looking at the corresponding MSCI indices. Doing so we can read of today's valuations (P/E, Dividend Yield, ...).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where can I find a source of a report for historical comparisons of these numbers (to be concrete: P/B or P/E)? My question focuses on EM but Global DM and Europe are also interesting.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="24222" LastEditDate="2017-05-29T07:22:51.573" LastActivityDate="2017-05-29T07:22:51.573" Title="How can we track historical valuations of factor portfolios in emerging markets (in terms of P/B or P/E e.g.)?" Tags="&lt;equities&gt;&lt;market-data&gt;&lt;valuation&gt;&lt;factor-investing&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30558" PostTypeId="1" CreationDate="2016-10-14T18:20:04.803" Score="2" ViewCount="1160" Body="&lt;p&gt;I'm working with &lt;a href=&quot;https://www.fpds.gov/fpdsng_cms/index.php/en/&quot; rel=&quot;nofollow&quot;&gt;US Government procurement contracts&lt;/a&gt; and I'm like to merge the contract data with stock data from CRSP and firm fundamentals from Compustat. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The contract data uses the &lt;a href=&quot;http://www.dnb.com/duns-number.html&quot; rel=&quot;nofollow&quot;&gt;Dun &amp;amp; Bradstreet D-U-N-S&lt;/a&gt; number, I'd like to know if anyone has any experience linking the the D-U-N-S number to Compustat's GVKEY, or any of the common company IDs: PERMNO, CUSIP, or CIK.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a linking table available for academic use?&lt;/p&gt;&#xA;" OwnerUserId="24826" LastActivityDate="2016-10-14T18:20:04.803" Title="Advice on linking DUNS to GVKEY" Tags="&lt;data&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30563" PostTypeId="2" ParentId="30536" CreationDate="2016-10-15T06:58:53.770" Score="1" Body="&lt;p&gt;They are basically the same thing.   For example , if you own the callable loan, it is worth 100pct of principal amount + value of a callable swap where you receive fixed versus libor and you are short a receiver option on the call date. &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-10-15T06:58:53.770" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30566" PostTypeId="1" CreationDate="2016-10-15T11:43:53.487" Score="0" ViewCount="194" Body="&lt;p&gt;I am slightly confused about the volatility term when pricing zero coupon bonds in the Ho-Lee model (and generally about where to get vol from in these kind of short rate models).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A particular framework could be the following. We start with the original non-risk neutral dynamics of the short rate specified by&#xA;$$&#xA;dr_t = \theta\,dt + \sigma\,dW_t&#xA;$$&#xA;However, under the equivalent martingale probability measure, it can be proved that our zero-coupon bond price dynamics are given by&#xA;$$&#xA;dP(t, T) = r_t\,P(t, T)\,dt - (T-t)\,\sigma\,P(t,T)\,d\hat{W}_t&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to find an answer to the following two questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Given that the $\sigma$ above is the vol of the short rate today ($t = 0$), can we use that same figure to price $P(0, T_1)$ and $P(0, T_2)$, with $T_2 &amp;gt;&amp;gt;&amp;gt; T_1$? In other words, is $\sigma$ always the right value to use regardless of when the bond matures?&lt;/li&gt;&#xA;&lt;li&gt;I would like to obtain $\sigma$ from the market for pricing purposes, should I use historical volatility or the (risk-neutral) implied volatility? If implied, are there any well-known methods to obtain it for this scenario?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I sometimes find it a bit hard dealing with volatility when modeling. I have as a reference book &quot;Volatility and Correlation&quot; by Rebonato but I find it difficult to get direct answers from the book. If someone could point me to literature that covers what the best way of obtaining vol is for market practitioners, that would be very helpful.&lt;/p&gt;&#xA;" OwnerUserId="15099" LastActivityDate="2016-10-15T12:14:49.107" Title="Volatility in short-rate models and vol practical issues" Tags="&lt;volatility&gt;&lt;fixed-income&gt;&lt;implied-volatility&gt;&lt;short-rate&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30567" PostTypeId="2" ParentId="30566" CreationDate="2016-10-15T12:07:47.057" Score="1" Body="&lt;p&gt;The model has effectively two free parameters, and therefore one cannot expect it to match bonds of different maturities. Typically this is how you 'get the parameters' by solving to match a given set of instruments. Of course you cannot match 100 instruments with 5 parameters, therefore you either solve in a least squares sense or increase the number of parameters you calibrate. That depends on the purpose of fitting. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One might want to increase the degrees of freedom by making the drift time-varying, ie $\theta=\theta(t)$, which can then be calibrated to an array of bonds of different maturities. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or make the volatility also time varying, ie $\sigma=\sigma(t)$, in order to also match some ATM swaption prices. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice this can be done through trinomial trees, google for &quot;Hull White trees&quot;. The book by Brigo and Mercurio is IMO much better than Rebonato for recipes. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2016-10-15T12:14:49.107" LastActivityDate="2016-10-15T12:14:49.107" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30568" PostTypeId="2" ParentId="30536" CreationDate="2016-10-15T13:51:19.943" Score="1" Body="&lt;p&gt;The idea is that as provider of the loan, you are recieving a fixed amount from the client. When he decides to prepay the loan, you will recieve the money and invest it at a market rate, a floating one, for the next periods until the loan is over in order to cancel the cashflows from the loan. In both cases, the swaption and the callable bond are the same at prepayment date, someone is entering a swap in floating rate and fixed rate.&lt;/p&gt;&#xA;" OwnerUserId="20751" LastActivityDate="2016-10-15T13:51:19.943" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30570" PostTypeId="1" CreationDate="2016-10-15T19:28:22.417" Score="2" ViewCount="306" Body="&lt;p&gt;Assuming I have a USDJPY put option at strike 100 (1USD = 100Yen) and the delta is D1. What is the delta of a corresponding JPYUSD call option at strike 0.01 (1Yen = 0.01USD) with the same maturity?  Would it be related to D1? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much!&lt;/p&gt;&#xA;" OwnerUserId="24835" LastActivityDate="2016-10-16T13:24:12.263" Title="Option Delta Conversion for currency pairs" Tags="&lt;options&gt;&lt;currency&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30571" PostTypeId="1" CreationDate="2016-10-15T20:53:06.630" Score="3" ViewCount="298" Body="&lt;p&gt;I've been fiddling around with different time frames when doing tests for cointegration between two timeseries, and I've realized that the dates that you use for your start/stop of the test will dramatically change the resulting p-value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is from which time frame should I trust the results of my cointegration test? Do I want to look at the past year to determine coint? Do I want to look back as far as possible? Is there some magic number?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the wildly different results my cointegration tests are giving, I would assume that some of these p-values are more &quot;right&quot; than others. Any thoughts?&lt;/p&gt;&#xA;" OwnerUserId="24836" LastEditorUserId="24836" LastEditDate="2016-10-16T03:53:36.330" LastActivityDate="2016-11-14T18:36:53.727" Title="How do you decide what time frame you're going to use when testing for cointegration?" Tags="&lt;time-series&gt;&lt;arbitrage&gt;&lt;cointegration&gt;&lt;pairs-trading&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30574" PostTypeId="2" ParentId="30571" CreationDate="2016-10-16T10:10:38.787" Score="1" Body="&lt;p&gt;If the data generating process was &lt;strong&gt;fixed&lt;/strong&gt; over time, you would choose the longest available data sample for cointegration testing -- because a larger sample yields higher power for the test.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the data generating process is &lt;strong&gt;changing&lt;/strong&gt; over time, then you would identify the time period of interest and use only the corresponding subsample to test for cointegration -- because the test results would differ across periods/subsamples.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the test results change depending on the period/subsample (&lt;strong&gt;your case&lt;/strong&gt;), it is likely that the data generating process is changing over time (across subsamples). Then you have to choose the subsample of interest and test and make inference for that particular subsample, being aware that inference might not hold for other periods/subsamples.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt; addressing the comment&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I'm looking for cointegration because I want to be able to trade a pair of stocks that is both (1) cointegrated in my backtest and (2) will likely be cointegrated in the coming months.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is a very challenging task, and you can never be guaranteed that the data generating process will remain the same over time, especially when it comes to financial time series. There is essentially no way to tell whether cointegration will or will not be present in the future. But you can try theoretical argumentation such as if shares of a company are traded on two exchanges, the prices in the two exchanges should not deviate far away from each other.&lt;/p&gt;&#xA;" OwnerUserId="19645" LastEditorUserId="19645" LastEditDate="2016-11-14T18:36:53.727" LastActivityDate="2016-11-14T18:36:53.727" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="30576" PostTypeId="1" AcceptedAnswerId="30580" CreationDate="2016-10-16T13:23:54.007" Score="1" ViewCount="280" Body="&lt;p&gt;Sorry if this is a silly question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is my understanding that modern exchanges have &quot;circuit breakers&quot; which halt trading for a duration of minutes when there is significant volatility / price movements. So why do we still witness flash crashes such as the famous May 6 2010. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not asking what causes flash crashes. I'm asking why circuit breakers don't prevent them. &lt;/p&gt;&#xA;" OwnerUserId="6661" LastEditorUserId="6661" LastEditDate="2016-10-16T13:44:41.433" LastActivityDate="2016-10-16T17:38:44.423" Title="Why circuit breakers can't prevent a flash crash" Tags="&lt;high-frequency&gt;&lt;exchange&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30577" PostTypeId="2" ParentId="30570" CreationDate="2016-10-16T13:24:12.263" Score="3" Body="&lt;p&gt;Since I'm not a FX guru I need to prove the comment of @alex c&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A USDJPY 100 call on one dollar has payoff:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;max(0, FX-100)  Yen&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where FX=USDJPY at maturity.   A JPYUSD 0.01 call on one Yen has payoff &lt;/p&gt;&#xA;&#xA;&lt;p&gt;max(0, 1/FX - 0.01) Dollars &#xA;= 0.01/FX * max(0,100 - FX) Dollars&#xA;= 0.01 * max(0,100 - FX) Yen&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is the same as a USDJPY 100 put on 0.01 dollars, as suggested.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-10-16T13:24:12.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30578" PostTypeId="1" CreationDate="2016-10-16T17:30:15.323" Score="0" ViewCount="60" Body="&lt;p&gt;&lt;strong&gt;Setting&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we test the CAPM using Fama-MacBeth regressions we do the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, run cross-sectional regressions to determine the beta loading&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ R^i_t- r^f_t = a_i +\beta_i (R^M_t- r^f_t) + \epsilon_t^i$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Afterwards, we determin the market price of risk for each $t$ and calculate the model errors&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ R^i_t- r^f_t = \hat{\beta}_i \lambda^M_t + u_t^i \quad (1) \\&#xA;\alpha_{i,t} = R^i_t- r^f_t - \hat{\beta}_i \lambda^M_t$$ &#xA;Then we can test if the $\bar{\alpha}_i = mean(\alpha_{i,t})$ are jointly zero or not using certain test statistics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to understand choice of regression model in equation $(1)$. Why don't we use the following&#xA;$$ R^i_t- r^f_t = \alpha_i  + \hat{\beta}_i \lambda^M_t + u_t^i \quad (2) $$&#xA;and test if the $\alpha_i$ are jointly zero? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only difference between $(1)$ and $(2)$ is the inclusion of $\alpha$ into the $\lambda_t^M$ estimation. For both approaches it is possible to come up with simple test statistics. So both approaches can be used equally easy.  &lt;/p&gt;&#xA;" OwnerUserId="6640" LastEditorUserId="6640" LastEditDate="2016-10-16T17:57:33.500" LastActivityDate="2016-10-16T17:57:33.500" Title="CAPM test methodology" Tags="&lt;research&gt;&lt;capm&gt;&lt;testing&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30580" PostTypeId="2" ParentId="30576" CreationDate="2016-10-16T17:38:44.423" Score="6" Body="&lt;p&gt;&lt;strong&gt;As a preamble.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two types of &quot;circuit breakers&quot;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;if the price goes outside a (&lt;strong&gt;long term&lt;/strong&gt; or &lt;strong&gt;static&lt;/strong&gt;) corridor defined as yesterday close +/-p% (very often p is a multiple of the long term volatility): &quot;stop the market&quot; and &quot;reopen&quot;;&lt;/li&gt;&#xA;&lt;li&gt;if the price goes outside a (&lt;strong&gt;short term&lt;/strong&gt; or &lt;strong&gt;dynamic&lt;/strong&gt;) corridor defined as previous trade price +/-q%: &quot;stop the market&quot; and &quot;reopen&quot;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Then you can &quot;stop&quot; and &quot;reopen&quot; different ways:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Stop&lt;/strong&gt; can be from really reject / cancel any order to accept orders only in one direction&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Reopen&lt;/strong&gt; is often implementing a fixing auction after at least M minutes.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You will find more information in &lt;a href=&quot;http://www.oslobors.no/obnewsletter/download/2ff3eead07cc1e60ac3313a411737033/file/file/Circuit_breakers.pdf&quot;&gt;this consultation paper for Olso Exchange&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, there is not a concensus among exchanges to know if the rules (and especially p and q) should be publicly disclosed or not. For instance Germany is in favour of secrecy where France is not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;To answer directly to your question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Yes: circuit breakers prevent &quot;flash crashes&quot; every day&lt;/em&gt; (see  for instance &lt;a href=&quot;https://arxiv.org/abs/1211.6667&quot;&gt;High Frequency Trading and Mini Flash Crashes, by Anton Golub, John Keane, Ser-Huang Poon&lt;/a&gt;). Nevertheless you can &lt;em&gt;see&lt;/em&gt; a flash crash before the activation of the circuit breaker. The question is then &quot;&lt;em&gt;should the market have been closed sooner?&lt;/em&gt;&quot;. In my opinion it is a never ending story: you can stop markets very often and &quot;avoid&quot; too large flash crashes, or you can accept wider variations of prices but have a more consistent liquidity across the market. Remember the issues of having several components of an index suspended, but ETFs &quot;pegged on it&quot; open to trade... (have a look at &lt;a href=&quot;https://www.sec.gov/comments/265-29/26529-52.pdf&quot;&gt;US EQUITY MARKET STRUCTURE: LESSONS FROM AUGUST 24, by blackrock&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The point is to have enough liquidity providers to prevent most flash crashes, but you will never demand to a liquidity provider to &quot;catch a falling knife&quot;... It is the role of the exhanges (with the support of regulators) to find ways and mechanisms so that specialists (&lt;a href=&quot;https://www.sec.gov/answers/specialist.htm&quot;&gt;not in the old sense&lt;/a&gt; but in a new one, to be defined) provide enough liquidity to prevent &quot;stupid&quot; flash crashes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The last one on the Sterling was probably not a &quot;stupid&quot; one: as a liquidity provider, it seems natural (and a good risk management practice) to stop providing liquidity in the turmoil of the Brexit when the Sterling is going down...&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2016-10-16T17:38:44.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30583" PostTypeId="2" ParentId="30283" CreationDate="2016-10-16T20:20:07.577" Score="4" Body="&lt;p&gt;&lt;a href=&quot;http://www.trade2win.com/boards/attachments/f112/28465d1184429346-gamma-variance-swaps.pdf&amp;amp;ved=0ahUKEwietZ7kpabYAhVMKewKHaBLAPIQFggnMAA&amp;amp;usg=AOvVaw0s7H_YEQtUvGLxfXxTo_ar&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;Here&quot;&gt;Here&lt;/a&gt; is a document that will answer some of your concerns. There are many other good reads out there but this one is a nice one to get started with.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case the link is broken at the time one reads this answer, the document is called &quot;Just what you need to know about variance swaps&quot; by Sebastien Bossu (JPMorgan 2005).&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2017-12-25T23:17:56.060" LastActivityDate="2017-12-25T23:17:56.060" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30585" PostTypeId="1" CreationDate="2016-10-17T02:41:02.330" Score="0" ViewCount="151" Body="&lt;p&gt;How would you calculate historical bond returns using bond prices? Would you treat bonds just like shares ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="24821" LastActivityDate="2016-10-17T05:10:24.657" Title="Calculating historical Bond returns" Tags="&lt;fixed-income&gt;&lt;finance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30587" PostTypeId="2" ParentId="30585" CreationDate="2016-10-17T05:10:24.657" Score="3" Body="&lt;p&gt;Returns of all assets are calculated in roughly same way, which boil down to changes in prices and returns due to income (e.g., coupon payments for bonds, dividends for stocks, etc.). The discrete period return of a bond is&#xA;$$r = \frac{P_\text{end} + AI_\text{end} + \text{coupon payments during period}}{P_\text{beginning} + AI_\text{beginning}} - 1,$$&#xA;where $P$ is the clean price and $AI$ is the accrued interest.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2016-10-17T05:10:24.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30590" PostTypeId="2" ParentId="30545" CreationDate="2016-10-17T13:37:39.527" Score="1" Body="&lt;p&gt;You are almost there. Note that, to have an expectation of the form $(1.15)$, you need to treat $X\beta$ as a random variable together. That is, the respective probabilities $Q(u)$ and $Q(d)$ should apply to the corresponding realizations $X(u)\beta(u)$ and $X(d)\beta(d)$. Specifically, continuing from your last step,&#xA;\begin{align*}&#xA;V_0(X) &amp;amp;=\left(\frac{B(d)S_0 - S(d)B_0}{\Delta}\right)X(u) + \left(\frac{S(u)B_0 - B(u)S_0}{\Delta}\right)X(d) \\&#xA;&amp;amp;=\left(\frac{B(d)B(u)S_0/B_0 - S(d)B(u)}{\Delta}\right)X(u)\frac{B_0}{B(u)} \\&#xA;&amp;amp;\quad+ \left(\frac{S(u)B(d) - B(u)B(d)S_0/B_0}{\Delta}\right)X(d)\frac{B_0}{B(d)}\\&#xA;&amp;amp;=Q(u)\big[X(u)\beta(u)\big] + Q(d)\big[X(d)\beta(d)\big],&#xA;\end{align*}&#xA;which is $(1.15)$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-10-17T13:37:39.527" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30594" PostTypeId="1" CreationDate="2016-10-17T15:07:00.407" Score="6" ViewCount="407" Body="&lt;p&gt;I have some trouble in choosing the right method/model for the valuation a prepayment option on a loan (in General). &#xA;So far I had some ideas about valuatiing it via a simple PV-method but there should be better ways.&#xA;According to my Research theory about ABS/MBS, in particular calculating the Option Adjusted Spread of the security, provides me the answer to my solution, as far as I understood. I read something about binomial trees or monte-carlo as a method of valuation?&#xA;Is there any literature you could recommend regarding this topic?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Konstantin&lt;/p&gt;&#xA;" OwnerUserId="24804" LastEditorUserId="24804" LastEditDate="2016-10-17T15:21:20.597" LastActivityDate="2019-09-17T13:48:12.260" Title="Valuating Prepayment on Loans- Which models are favorable?" Tags="&lt;option-pricing&gt;&lt;spread-options&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30595" PostTypeId="1" AcceptedAnswerId="30596" CreationDate="2016-10-17T17:59:50.487" Score="0" ViewCount="33" Body="&lt;p&gt;I am searching international statistical data about legal lawsuits against banks over allegations on on money laundering, tax fraud, suspicious transaction, financial markets prices manipulation, Illicit financial flows (illegal capital flight) and so on. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this information exist in the form appropriate for econometric analysis?&lt;/p&gt;&#xA;" OwnerUserId="24846" LastActivityDate="2016-10-17T18:37:00.197" Title="Where can I find statistical data about legal lawsuits against commercial and investment banks?" Tags="&lt;market-data&gt;&lt;statistical-finance&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30596" PostTypeId="2" ParentId="30595" CreationDate="2016-10-17T18:37:00.197" Score="0" Body="&lt;p&gt;I saw these:&#xA;&lt;a href=&quot;http://www.cnbc.com/2015/04/30/7-years-on-from-crisis-150-billion-in-bank-fines-and-penalties.html&quot; rel=&quot;nofollow&quot;&gt;http://www.cnbc.com/2015/04/30/7-years-on-from-crisis-150-billion-in-bank-fines-and-penalties.html&lt;/a&gt;&#xA;&lt;a href=&quot;http://blogs.ft.com/ftdata/2015/07/22/bank-fines-data/&quot; rel=&quot;nofollow&quot;&gt;http://blogs.ft.com/ftdata/2015/07/22/bank-fines-data/&lt;/a&gt;&#xA;The second permits download data collected by the FT (csv format).&#xA;The first aparently use that data and process in Tableau graphics.&#xA;I also saw this:&#xA;graphics.wsj.com/bank-fines-where-did-the-money-go/#firstPage&#xA;May be you can start with it.&lt;/p&gt;&#xA;" OwnerUserId="24841" LastActivityDate="2016-10-17T18:37:00.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30599" PostTypeId="2" ParentId="1435" CreationDate="2016-10-17T19:24:56.667" Score="3" Body="&lt;p&gt;There is a much better pricing formula which is an accurate approximation. Anecdotally I believe that the difference between this and the &quot;offical&quot; CDSW calculator on Bloomberg will be within about 0.5% or less of the notional, especially if the CDS curve is flat.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a \$1 notional of short-protection contract with coupon $C$, market spread $S$ and $T$ years to maturity, where $R$ is the expected recovery rate, and $r$ is the continuously compounded $T$-year swap rate, we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;V= (C-S) \cdot\frac{1- e^{ -gT } }{g}  \cdot\frac{365}{360}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;g=r+\frac{S}{1-R}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This approximation is exact in the limit of a continuously paying premium leg with a flat credit and interest rate curve. As CDS pay quarterly and as credit curves are often quoted using a flat spread, this formula is a good approximation. Note that the factor of 365/360 corrects for the Actual 360 basis used to calculate CDS premium payments, while $T$ is calculated in calendar years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get a more accurate pricing would require you to calculate all of the premium flows correctly. You would also need to have the ability to value the protection leg which requires a time-integral to contract expiry. Finally you would need to fit your model to the term structure of CDS spreads. There is a more detailed description at &lt;a href=&quot;http://www.javaquant.net/papers/ValuationCDSLehman.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;this link&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12240" LastEditorUserId="924" LastEditDate="2017-12-01T13:23:16.020" LastActivityDate="2017-12-01T13:23:16.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30601" PostTypeId="2" ParentId="28203" CreationDate="2016-10-18T00:49:27.297" Score="0" Body="&lt;p&gt;Let's say a 2% payer swaption expires with the 10 yr rate equal to 4%.  The value of this payoff is the present value of a 2% 10 year annuity.  However it is not appropriate to use the 4% 10yr rate to discount this annuity.  Each payment of the annuity must be discounted at its appropriate zero coupon rate.  You can make some assumptions (for example, that these rates move in parallel to the 10 year swap rate), but those are just assumptions.  Hence there is no nice formula that tells you what the swaption will be worth given how far in the money it expires.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-10-18T00:49:27.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30602" PostTypeId="1" AcceptedAnswerId="34718" CreationDate="2016-10-18T01:45:28.513" Score="4" ViewCount="5138" Body="&lt;p&gt;This is a question about comparing results from the Fama french 3 factor model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have not physically done this, but let's assume a Fama French 3 factor regression was performed for Coca-Cola (KO) and Pepsi (PEP). The model used was: &#xA;$$r_{it}-r_{ft1}=\alpha_i+\beta_{im}(r_{mt}-r_{ft2})+\beta_{is}SMB+\beta_{ih}HML$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_{it}$: return of Asset (either KO or PEP)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_{ft1}$: Risk Free Rate (3-month T-bill or equivalent investor uses), also the benchmark in this example&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\alpha_i$: what we are solving for aka output from regression aka intercept, Portfolio (Asset) Return minus Benchmark Return&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(r_{mt}-r_{ft2})$:Market Return minus the Risk Free Rate (3-month T-bill or equivalent investor uses)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume the rest of the variables are their regular assumptions as found in textbooks&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I distinguish between $r_{ft1}$ and $r_{ft2}$ because I have read on this site found &lt;a href=&quot;https://www.bogleheads.org/wiki/Fama_and_French_three-factor_model&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; that the $r_{ft}$ is the benchmark, the risk-free market return. Now in their original model, they did not distinguish the 1 and 2 on the risk free rate as I did. This leads me to think that $r_{ft1}$ is interchangeable with a benchmark such as the S&amp;amp;P 500 for example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, this alpha value solved assumes the benchmark is risk-free rate universally across all assets. Although this is a way to compare all assets, that doesn't mean in theory you can compare two different funds/portfolios/assets this way when they are comprised of different items. You should use the other definition of alpha=Asset minus Benchmark return. So can I change the $r_{ft1}$ to be the benchmark of my asset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this an acceptable/practiced method of thinking about $r_{ft1}$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly, it seems like two different definitions of alpha are being used. Define alpha as Portfolio (Asset) Return minus Benchmark, how we tend to think of alpha. But re-arranging the model would make alpha equal to the Portfolio Return minus Benchmark plus other factors. So now alpha = alpha + stuff. As you can see I am lost and need some clarification about alpha in Fama French.&lt;/p&gt;&#xA;" OwnerUserId="24338" LastActivityDate="2017-06-15T20:23:12.137" Title="Fama French &amp; Solving for Alpha" Tags="&lt;returns&gt;&lt;modern-portfolio-theory&gt;&lt;regression&gt;&lt;factor-models&gt;&lt;fama-french&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30603" PostTypeId="2" ParentId="30602" CreationDate="2016-10-18T03:32:29.183" Score="0" Body="&lt;p&gt;If you take a step back and consider CAPM model (which is a simpler version of Fama French where B_is = 0 and B_ih = 0, you can see that alpha in this case is the excess return you get in addition to the returns driven by aggregate market.  The aggregate market is usually viewed as the Capitalization weighted portfolio of the universe you are invested in; for practical purposes here, just let it be the returns of the SP500.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The point of Fama French is to to also adjust for the returns for small vs large market capitalization stocks and rich vs cheap stocks.  In this case the intuition of 'alpha' remains the same as with the CAPM model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To clarify the usage of the risk adjusted rate:  You need to set r_ft1 = r_ft2.  This is essentially to normalize the returns and adjust for the cost of leverage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The benchmark return is NOT the same as the market return and it is NOT the same as the risk-free-rate.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would run this regression three times, setting r_it to the returns of KO, POP and Benchmark respectively.  In these cases you can compare the relative alphas and betas appropriately.&lt;/p&gt;&#xA;" OwnerUserId="15338" LastActivityDate="2016-10-18T03:32:29.183" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30604" PostTypeId="1" AcceptedAnswerId="30606" CreationDate="2016-10-18T03:53:27.327" Score="0" ViewCount="840" Body="&lt;p&gt;I received this question in a job interview. I don't really have fixed income background and was wondering if anyone can help me understand how to figure out this for myself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Create a 12 month time series representing the “A-AAA” yield at the 2yr, 5yr, 10yr, 20yr and 30yr maturity points.  “A-AAA” is defined as all bonds whose S&amp;amp;P rating is A- or better or Moody’s rating is A3 or better.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please provide results in the following format:&#xA;Date    2yr Yield   5yr Yield   10yr Yield  20yr Yield  30yr Yield&#xA;4/30/2013&lt;br&gt;&#xA;5/31/2013&#xA;…&lt;br&gt;&#xA;2/28/2014&#xA;3/31/2014&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The raw input data provided is bond level data for the constituents of a US Corporate Bond Index for each of 12 consecutive month ends from 4/30/2013 to 3/31/2014. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example rows and file header&lt;/p&gt;&#xA;&#xA;&lt;p&gt;AsOfDate,Identifier,Amount Outstanding,Description,Coupon,Maturity Date,    Price,Yield,Moody's Rating,S&amp;amp;P Rating&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3/31/2014,00037BAA, 500000,ABB FINANCE USA INC,1.625,5/8/2017,100.436928,1.48,A2    ,A&lt;/p&gt;&#xA;" OwnerUserId="24872" LastEditorUserId="12240" LastEditDate="2016-10-18T10:05:15.487" LastActivityDate="2016-10-18T11:58:04.097" Title="How to Construct a Corporate Yield Curve" Tags="&lt;fixed-income&gt;&lt;yield-curve&gt;&lt;bootstrapping&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30605" PostTypeId="1" AcceptedAnswerId="30608" CreationDate="2016-10-18T05:56:58.227" Score="2" ViewCount="1165" Body="&lt;p&gt;In &lt;a href=&quot;https://quant.stackexchange.com/questions/27614/how-were-these-sde-derived&quot;&gt;How were these SDE derived?&lt;/a&gt; I don't understand one part of Gordon's answer, specifically:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\ln S_t=\ln F_{0,t}-\frac{\sigma^2}{4\lambda}(1-e^{-2\lambda t})+\sigma e^{-\lambda t}\int_0^t e^{\lambda s}dB_s$$&#xA;$$d\ln S_t=\bigg(\frac{\partial \ln F_{0,t}}{\partial t}-\frac{\sigma^2 }{2}e^{-2\lambda t}-\lambda \sigma e^{-\lambda t}\int_0^t e^{\lambda s}dB_s\bigg)dt+\sigma dB_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, how to get from the first line to the second. Evidently, Ito's Lemma was applied, however it has been used in a way in which I have not encountered. It seems that the integral with the Brownian motion term was treated as a constant, but I don't see how that is allowed when there is $t$ in the upper limit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help is appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I have come up with a solution, as long as the following is valid. Can anyone please confirm? The first line uses the product rule.&#xA;\begin{align}&#xA;d\bigg(\sigma e^{-\lambda t}\int_0^t e^{-\lambda s}dB_s\bigg)&amp;amp;=d(\sigma e^{-\lambda t})\int_0^t e^{-\lambda s}dB_s+\sigma e^{-\lambda t}d\bigg(\int_0^t e^{\lambda s}dB_s\bigg)\\&#xA;&amp;amp;=-\lambda\sigma e^{-\lambda t}dt \int_0^t e^{-\lambda s}dB_s+\sigma e^{-\lambda t}e^{\lambda t}dB_t\\&#xA;&amp;amp;=-\lambda\sigma e^{-\lambda t}dt \int_0^t e^{-\lambda s}dB_s+\sigma dB_t&#xA;\end{align}&lt;/p&gt;&#xA;" OwnerUserId="24781" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-10-18T09:13:03.423" Title="Ito's Lemma, differentiating an integral with Brownian motion" Tags="&lt;stochastic-calculus&gt;&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30606" PostTypeId="2" ParentId="30604" CreationDate="2016-10-18T07:18:22.120" Score="0" Body="&lt;p&gt;I find the task a little strange as there is usually a big difference between A and AAA yields. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if this is really what is needed then I would do as follows. For each date:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i) I would pull in all of the bonds in the A-AAA category. I would then calculate their full prices by adding the accrued interest on to the provided clean price. That I can easily calculate from the bond information provided.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ii) I would then attempt to best-fit a zero curve form such as the Nelson-Siegel function to these full bond prices using a least squares approach. For example the Nelson-Siegel model has three main parameters $\beta_0, \beta_1,\beta_2$ and the exercise is to find the value of these parameters that fits the market prices best. This can be done easily in something like Excel Solver. The objective function you are minimising is something like&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\hat{O}(\beta_0,\beta_1,\beta_2) = \sum_{k=1}^K \left(P(\beta_0,\beta_1,\beta_2)-P_k \right)^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It might also be advisable to weight different bonds by their issuance size $N_k$. So you could change this to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\hat{O}(\beta_0,\beta_1,\beta_2) = \sum_{k=1}^K N_k \left(P_k(\beta_0,\beta_1,\beta_2)-P_k \right)^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This would result in a curve that is the best fit to that set of bonds and which takes into account the different issuance sizes. Doing this will require me to value each bond $k$ as a stream of $M_k$ discounted cash flows using the appropriate zero rate $r(t)$ for that future date, i.e. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P_k(\beta_0,\beta_1,\beta_2) = \sum_{i=1}^{M_k} \frac{c_k}{(1+r(t_i))^i}+ \frac{1}{(1+r(t_{M_k}))^{M_k}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have written $r(t)$ rather than $r(t,\beta_0,\beta_1,\beta_2)$ to simplify notation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note how the discount zero rate $r(t)$ depends on the cash flow time. This approach is therefore more correct that using a yield-to-maturity based approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;iii) From my fitted curve, I would calculate the 2Y, 5Y, 10Y, 20Y, 30Y zero rates as required. Calculating the different bond yields is simply a matter of solving for the bond coupon that makes a 2Y, 5Y, 10Y, 20Y, 30Y bond price to par. The formula for the $M$-year yield is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$y(M) = \left( 1-\frac{1}{(1+r(t_M))^M}\right) \left( {\sum_{i=1}^M \frac{1}{(1+r(t_i))^i}}\right)^{-1}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This all assumes annual coupons. For semi-annual coupons you should adjust accordingly.&lt;/p&gt;&#xA;" OwnerUserId="12240" LastEditorUserId="12240" LastEditDate="2016-10-18T11:58:04.097" LastActivityDate="2016-10-18T11:58:04.097" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30608" PostTypeId="2" ParentId="30605" CreationDate="2016-10-18T09:11:15.870" Score="1" Body="&lt;p&gt;You are right in your use of product rule.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $\sigma e^{-\lambda t}$ is a finite variation process, you do not have crochet term and this is the standard product rule.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your second line, there is an extra $t$ (which is a typo I presume)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\ln S_t=\ln F_{0,t}-\frac{\sigma^2}{4\lambda}(1-e^{-2\lambda t})+\sigma e^{-\lambda t}\int_0^t e^{\lambda s}dB_s$$&#xA;$$d\ln S_t=\bigg(\frac{\partial \ln F_{0,t}}{\partial t}-\frac{\sigma^2 }{2}e^{-2\lambda t}-\lambda \color{red}{t}\sigma e^{-\lambda t}\int_0^t e^{\lambda s}dB_s\bigg)dt+\sigma dB_t$$&#xA;the correct equation is:&#xA;$$d\ln S_t=\bigg(\frac{\partial \ln F_{0,t}}{\partial t}-\frac{\sigma^2 }{2}e^{-2\lambda t}-\lambda \sigma e^{-\lambda t}\int_0^t e^{\lambda s}dB_s\bigg)dt+\sigma dB_t$$&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-10-18T09:11:15.870" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30611" PostTypeId="2" ParentId="111" CreationDate="2016-10-18T11:24:44.400" Score="1" Body="&lt;p&gt;Perhaps, it's better to create a stock-screener (classification), rather than trying to predict stock price(non-deterministic regression) problem. Making money that way seems to be much easier, and we can use SVCs and reinforcement learning to achieve the same. I am presently trying to build the same using CAN SLIM model of stock picking, and identifying small-cap stocks that can give multibagger returns in 5-10 years time. Any other tips or pointers will be gladly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="24877" LastActivityDate="2016-10-18T11:24:44.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30612" PostTypeId="1" CreationDate="2016-10-18T11:56:56.470" Score="0" ViewCount="1453" Body="&lt;p&gt;I would like to retrieve bond characteristics (bond type, coupon type etc.) for corporate bond ISINs using the Bloomberg Excel Addin.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried &lt;code&gt;=BDP(&quot;DE0001848083&quot;, &quot;COUNTRY&quot;)&lt;/code&gt; which did not work. (&quot;COUNTRY&quot; is just an example - I don't know if this field really exists).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the correct way to retrieve this data?&lt;/p&gt;&#xA;" OwnerUserId="24184" LastEditorUserId="2393" LastEditDate="2016-10-18T19:35:49.267" LastActivityDate="2016-10-18T19:35:49.267" Title="Bond characteristics using Bloomberg in Excel" Tags="&lt;fixed-income&gt;&lt;bloomberg&gt;&lt;excel&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30613" PostTypeId="1" CreationDate="2016-10-18T11:59:00.020" Score="4" ViewCount="132" Body="&lt;p&gt;I have read about Quantitative Easing (QE) and its attempt to bring back inflation. In this, central banks create money, then give it to other banks that buy government bonds, &lt;strong&gt;corporate bonds,&lt;/strong&gt; and assets, in order to increase prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe there are some drawbacks with this, such as perhaps an unfair preference of corporate bonds of large firms compared to SMEs in this &quot;trickle-down&quot; money proliferation, but I could not find evidence or numbers on this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding large firms whose corporate bonds are bought up, I am wondering if there are any measurable effects on the cost of corporate financing. QE is happening since 2009, but I could not find numbers regarding its actual effects. Also, there should be some competition between large firms as to which one's bonds are bought with the new money. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are you aware of empirical results regarding the changing cost of capital and competition between firms for fiat money due to QE?&lt;/p&gt;&#xA;" OwnerUserId="1817" LastEditorUserId="1817" LastEditDate="2016-10-18T12:09:50.250" LastActivityDate="2019-06-02T22:01:10.107" Title="Measurable effects of quantitative easing on corporate financing cost" Tags="&lt;macro-economics&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30614" PostTypeId="2" ParentId="30612" CreationDate="2016-10-18T12:20:12.777" Score="2" Body="&lt;p&gt;You need to specify that the code is an ISIN:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;=BDP(&quot;DE0001848083 ISIN&quot;, &quot;COUNTRY&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;should work as expected.&lt;/p&gt;&#xA;" OwnerUserId="2393" LastActivityDate="2016-10-18T12:20:12.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30615" PostTypeId="1" AcceptedAnswerId="30630" CreationDate="2016-10-18T13:28:46.537" Score="2" ViewCount="869" Body="&lt;p&gt;The stock and bond under the Black-Scholes framework, no dividends:&#xA;$$S_t=S_0e^{\sigma W_t+\mu t}=S_0e^{\sigma \tilde{W}_t +(r-\frac{1}{2}\sigma^2)t}$$&#xA;$$B_t=e^{rt}$$&#xA;where $\tilde{W}_t$ is $\mathbb{Q}$-Brownian motion. Thus, the risk-neutral stock price dynamics:&#xA;$$S_T = LN_\mathbb{Q}(\ln{S_0}+(r-\frac{1}{2}\sigma^2)T,\sigma^2T)$$&#xA;Black-Scholes call option formula:&#xA;\begin{align}&#xA;V_0&amp;amp;=e^{-rT} \mathbb{E}_\mathbb{Q}[(S_T-k)^+]\\&#xA;&amp;amp;=e^{-rT}\mathbb{E}_\mathbb{Q}(S_T1_{S_T&amp;gt;k})-ke^{-rT}\mathbb{Q}(S_T&amp;gt;k)\\&#xA;&amp;amp;=S_0\Phi (d_1)-ke^{-rT}\Phi(d_2)&#xA;\end{align}&#xA;where&#xA;$$d_1=\frac{\ln{\frac{S_0}{k}}+(r+\frac{1}{2}\sigma^2 )T}{\sigma\sqrt{T}}$$&#xA;$$d_2=\frac{\ln{\frac{S_0}{k}}+(r-\frac{1}{2}\sigma^2 )T}{\sigma\sqrt{T}}$$&#xA;My question is, are $\Phi (d_1)$ and $\Phi (d_2)$ computed under the risk-neutral measure $\mathbb{Q}$ or the real world measure $\mathbb{P}$? And is it $$e^{-rT}\mathbb{E}_\mathbb{Q}(S_T1_{S_T&amp;gt;k})-ke^{-rT}\mathbb{Q}(S_T&amp;gt;k)$$ or $$e^{-rT}\mathbb{E}_\mathbb{Q}(S_T1_{S_T&amp;gt;k})-ke^{-rT}\mathbb{P}(S_T&amp;gt;k)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems obvious to me that they should be computed under $\mathbb{Q}$ due to the replication pricing strategy which utilises the risk-neutral stock price dynamics. However, in textbook exercises, finding the explicit value of the call option involves using the table containing probabilities for the standard normal distribution, which are evidently computed under the real world measure $\mathbb{P}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Related &lt;a href=&quot;https://quant.stackexchange.com/questions/25711/understanding-the-solution-of-this-integral/25713#25713&quot;&gt;Understanding the solution of this integral&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="24781" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-10-24T19:33:15.397" Title="Black-Scholes call option formula, which probability measure" Tags="&lt;black-scholes&gt;&lt;call&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30616" PostTypeId="2" ParentId="30615" CreationDate="2016-10-18T13:42:30.563" Score="4" Body="&lt;p&gt;I think you might confuse two things here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the Black-Scholes formula, the term&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\Phi \left( d_2 \right) = \mathbb{Q} \left( \left. S_T &amp;gt; K \right| \mathfrak{F}_t \right)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is the conditionally probability of ending up in-the-money under the risk-neutral probability measure $\mathbb{Q}$. Similarly,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\Phi \left( d_1 \right) = \mathbb{S} \left( \left. S_T &amp;gt; K \right| \mathfrak{F}_t \right)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is the conditionally probability of ending up in-the-money under an auxiliary measure where the underlying asset is used as the numeraire. Neither of them is the real-world probability of ending up in-the-money.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way I understand your question is that you now seem to assume that the evaluation of the corresponding normal distribution function depends on some measure. This is not the case. They are just functions and your lookup tables for them are independent of the respective probabilistic interpretation.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2016-10-19T13:48:28.513" LastActivityDate="2016-10-19T13:48:28.513" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30618" PostTypeId="1" CreationDate="2016-10-18T16:00:41.710" Score="0" ViewCount="163" Body="&lt;p&gt;Suppose that the payoff of some contract is $V_{T}=S_{T}-S_{T'}$ where $T'&amp;lt;T$ and we want to value the contract at time $t&amp;lt;T'$ (the situation where this arises could be a total return swap, where a fixing is anticipated at time $T'$ for the performance period $[T',T]$). Then presumably from risk-neutral pricing&#xA;$$M_{t}V_{t}=E_{t}[M_{T}(S_{T}-S_{T'})]$$&#xA;for a choice of nuumeraire $M$.  If we use the $T$-forward measure, then&#xA;$$V_{t}=P_{t}^{T}E^{T}_{t}[S_{T}]-P_{t}^{T}E_{t}^{T}[S_{T'}]$$&#xA;where $P_{t}^{T}$ is the discount factor observed at time $t$ for the period $[t,T]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first expectation is just $S_{t}-I_{t}^{T}$ where $I_{t}^{T}$ is the present value of any income $S$ pays in $[t,T]$ (we are using the fact that in the $T$-forward measure $E_{t}^{T}[S_{T}]=Fwd_{t}^{T}[S]=\frac{S_{t}-I_{t}^{T}}{P_{t}^{T}}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is how to properly calculate the second expectation by (presumably) switching to the $T'$-forward measure.  Basically, the conceptual difficulty that I am having is how to make sense of the quantity $P_{T}^{T'}$ that shows up when you change numeraires:&#xA;$$P_{t}^{T}E_{t}^{T}[S_{T'}]=\frac{P_{t}^{T}E_{t}^{T'}[\frac{S_{T'}}{P_{T}^{T'}}]P_{t}^{T'}}{P_{t}^{T}}=P_{t}^{T'}E_{t}^{T'}[\frac{S_{T'}}{P_{T}^{T'}}].$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To me it seems like a misapplication of the change of numeraire formula to substitute $T'$ instead of $T$ into the new numeraire process under the expectation, even though $S$ is being evaluated at $T'$ (the overall payoff is still at time $T$).  Barring that possibility, I proceed formally like&#xA;$$P_{t}^{T'}E_{t}^{T'}[\frac{S_{T'}}{P_{T}^{T'}}]=P_{t}^{T'}E_{t}^{T'}[S_{T'}P_{T'}^{T}]=P_{t}^{T'}E_{t}^{T'}[\frac{S_{T'}P_{t}^{T}}{P_{t}^{T'}}],$$&#xA;but it's not clear to me at the moment how to treat this.  If we just take everything out of the expectation, we get&#xA;$$P_{t}^{T}E_{t}^{T'}[S_{T'}]=P_{t}^{T}\frac{S_{t}-I_{t}^{T'}}{P_{t}^{T'}}$$&lt;/p&gt;&#xA;" OwnerUserId="8230" LastEditorUserId="467" LastEditDate="2016-11-20T14:48:14.000" LastActivityDate="2016-11-20T14:48:14.000" Title="How to price a forward struck contract today by changing from a $T&gt;T'$ forward measure to $T'$ forward measure at time $t&lt;T'&lt;T$?" Tags="&lt;risk-neutral-measure&gt;&lt;forward&gt;&lt;valuation&gt;&lt;pricing-formulae&gt;&lt;forward-start&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30619" PostTypeId="1" CreationDate="2016-10-18T16:19:25.873" Score="2" ViewCount="511" Body="&lt;p&gt;Consider a single-name total return swap (TRS) on some reference asset $S$.  For concreteness, suppose the length of the contract is one year with quarterly resets, and the performance of $S$ is exchanged for LIBOR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the TRS value resets at $0$ at each reset date, so for some $t$ in some period that ends at time $T$, the value of the agreement assuming there is no cancellation feature is simply&#xA;$$V_{t}=\mp(S_{t}-P_{t}^{T})\pm P_{t}^{T}S_{0}L_{0}^{T}T$$&#xA;where $P_{t}^{T}$ is the discount factor observed at time $t$ for the period $[t,T]$ and $L_{0}^{T}$ is the period LIBOR (simple) rate set at time $0$ (beginning of the period) for the period $[0,T]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if at any time in the performance period of the contract either party can terminate the agreement (not settle at the market value $V_{t}$), I have seen it claimed that an accrual valuation method is appropriate and that the contract can be valued for any $t$ as&#xA;$$V_{t}=\mp(S_{t}-S_{0})\pm S_{0}L_{0}^{T}(T-t).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't understand the justification for this formula.  Since the bi-cancellable feature can be modeled as a long (short) call and short (long) put position (depending on the side of the contract you are on), some sort of put-call parity should be applicable, which leads to the accrual formula above, but I could not get this to quite work out (perhaps someone with more practice with these types of derivations would more easily be able to do it).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another argument is that the hedging strategy employed by a desk selling this TRS would be to overnight repo $S$, and thus the cumulative borrowing cost upto time $t$ is in some sense $S_{0}L_{0}^{T}(T-t)$, and so if the counterparty wanted to cancel, the desk could just not roll over the repo and sell the asset to cover the position and repo loan.  But besides the assumption of constant interest rates, if the term of the contract is set to $T$ at the beginning of the performance period, then ostensibly the desk takes out a $T$-period loan of $S_{0}$, charges the client the interest on this loan, and then liquidates the position at time $T$ to cover the loan and the performance gain or loss on $S$ (i.e., $S_{T}-S_{0}$).  This hedging argument is how the first valuation formula is obtained (although it can also be obtained in a straight forward manner using risk-neutral pricing methods).&lt;/p&gt;&#xA;" OwnerUserId="8230" LastActivityDate="2021-02-21T22:37:05.807" Title="Valuation of a swap where both parties can cancel (not settle at market) with accrual method instead of present-value?" Tags="&lt;swaps&gt;&lt;valuation&gt;&lt;pricing-formulae&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30620" PostTypeId="2" ParentId="3156" CreationDate="2016-10-18T16:25:50.993" Score="0" Body="&lt;p&gt;If you're looking for a columnar store alternative, have a look at &lt;a href=&quot;http://druid.io&quot; rel=&quot;nofollow&quot;&gt;Druid.io&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Druid is a good fit if you are after &#xA;1. fast aggregations and searches&#xA;2. Real-time analysis&#xA;3. Huge amount of data (petabytes)&#xA;4. High availability data store with no single point of failure&#xA;&lt;em&gt;Source: &lt;a href=&quot;http://druid.io/druid.html&quot; rel=&quot;nofollow&quot;&gt;http://druid.io/druid.html&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="24880" LastActivityDate="2016-10-18T16:25:50.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30622" PostTypeId="1" AcceptedAnswerId="30663" CreationDate="2016-10-18T16:54:13.087" Score="1" ViewCount="438" Body="&lt;p&gt;I downloaded some stock quotes from Quandl databases 'Wiki EOD Stock Prices' and '&#xA;YFinance'. Now I want to report the result of calculations on this data in the publication. What is the correct way to cite this source?&lt;/p&gt;&#xA;" OwnerUserId="24846" LastActivityDate="2016-10-21T15:14:18.150" Title="How to cite quandl data" Tags="&lt;database&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30623" PostTypeId="1" CreationDate="2016-10-18T22:51:21.057" Score="0" ViewCount="123" Body="&lt;p&gt;In a Text book the following is giving as an example. Can someone plz explain the process?&#xA;&lt;a href=&quot;https://i.stack.imgur.com/nyWR1.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/nyWR1.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="24887" LastActivityDate="2016-10-19T00:34:12.090" Title="Futures contracts" Tags="&lt;futures&gt;" AnswerCount="1" CommentCount="2" ClosedDate="2016-10-20T08:08:01.583" ContentLicense="CC BY-SA 3.0" />
  <row Id="30624" PostTypeId="2" ParentId="30594" CreationDate="2016-10-18T23:05:05.243" Score="2" Body="&lt;p&gt;I've been analysing the same problem and i think that the way to go it's calibrating an interest rate model. Think of it as an option on a bond, there is plenty of literature about that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also you can look at Quantlib implementation of callable bonds to get an idea of how can it be implemented.&lt;/p&gt;&#xA;" OwnerUserId="20751" LastEditorUserId="20751" LastEditDate="2019-09-17T00:42:35.987" LastActivityDate="2019-09-17T00:42:35.987" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="30625" PostTypeId="2" ParentId="30623" CreationDate="2016-10-19T00:17:00.800" Score="1" Body="&lt;p&gt;This is a simple numerical example to illustrate the power and the danger of the leverage implicit in futures contracts. Each row in the table represents one day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the first day the futures price is USD 55/unit. On the second day the price rises to 60/unit. Since you are long futures on 10,000 units you have made (60-55)*10000 = USD 50,000. This amount is paid to you in cash at the end of the day so your account balance goes from 55,000 to 55,000+50,000= 105,000. (In 1 day your balance more than doubled! While the price only increased approx 10%). And so on and so forth on every successive day; your A/C balance fluctuates based on changes in the price. Unfortunately it goes negative, at that point you owe the money (both legally and ethically); so it's possible to lose more than your initial investment. The price went from 55 to 47 so you lost (47-55)*10,000 = USD 80,000 made up as follows: 55,000 initial investment plus 3,250 additional investment plus 21,750 owed at the end (the 21,050 in the last row is a typo!).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The exchange requires you to deposit a minimum of 55,000 at the beginning, and to keep the balance to a minimum of 41,250 (which is why you put up 3250 addn'l between the 5th and 6th day), however you can put in more than this if you want; if you put up a full 55*10000 = 550,000 at the beginning (full collateral) you will never have to put up more money. In the example the maximum possible degree of leverage is illustrated.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-10-19T00:34:12.090" LastActivityDate="2016-10-19T00:34:12.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30626" PostTypeId="2" ParentId="30619" CreationDate="2016-10-19T00:43:40.707" Score="3" Body="&lt;p&gt;Any time that a contract is cancellable by either party, it will be cancelled.  That's because it is always to one party's advantage to cancel rather than carry on.  The exception is that the contract is worth exactly zero, which has effectively zero probability.  Therefore, the value of the contract is whatever will get paid out on cancellation.  I.e. The accrual value.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-10-19T00:43:40.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30629" PostTypeId="1" AcceptedAnswerId="30636" CreationDate="2016-10-19T09:10:51.447" Score="-1" ViewCount="1568" Body="&lt;p&gt;I recently came across a question whether a Monte Carlo simulation should represent a forward curve at each tenor. I encountered an approach at a bank which I would consider as somehow strange.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Approach 1: Let’s take GBPEUR as an underlying. To keep things as simple as possible I would choose a Geometric Brownian Motion with constant drift and diffusion calibrated to forward volatilities on GBPEUR. In the next step I would choose an Euler Scheme, simulate 100000 paths in order to solve the stochastic differential equation numerically. By taking the mean over the paths at each tenor I get a point which is close to the forward curve at this tenor. But in my opinion it’s nearly impossible to calibrate the Geometric Brownian Motion in a way that it exactly represents the forward GBPEUR curve on each tenor. Nevertheless that’s the way a simulation is done!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what I now saw implemented in a financial institution is the following. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Approach 2: The guy took each tenor of the forward curve and multiplied it with a normally distributed random number. I would say this should be represented like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;            F_t=F_t N(0,σ) &#xA;            F_t GBPEUR forward curve at tenor t&#xA;            N(0,σ) a normally distributed random number with zero mean  and σ the volatility &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then he took 100000 draws and said that’s my Monte Carlo simulation and of course trivially his simulation represented in the mean the whole forward curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So here are my questions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Do you agree that the approach 1 is the right one? Of course there are technically more advanced ones, but this is the way it is done.&lt;/li&gt;&#xA;&lt;li&gt;Do you agree that it is nearly impossible to represent the whole forward curve with a Monte-Carlo simulation regardless of how complex the underlying sdes are? Otherwise we would have a perfectly calibrated model.&lt;/li&gt;&#xA;&lt;li&gt;Approach 2 is awfully wrong and has nothing to do with a Monte Carlo Simulation. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="24895" LastActivityDate="2016-10-19T20:16:21.113" Title="Monte Carlo Simulation and forward curves" Tags="&lt;simulations&gt;&lt;forward&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30630" PostTypeId="2" ParentId="30615" CreationDate="2016-10-19T09:19:58.370" Score="2" Body="&lt;p&gt;Indeed,these probabilities are obtained under different probability measures but we should change the measure $\mathbb{Q}$ to another measure $\mathbb{Q}^S$. Evaluating $\mathbb{E}_{t}^{\mathbb{Q}}\left[S_T1_{S_T&amp;gt;K}\right]$ requires changing the measure $\mathbb{Q}$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the Radon-Nikodym derivative&#xA;$$\frac{d\mathbb{Q}}{d\mathbb{Q}^S}=\frac{B_T/B_t}{S_T/S_t}$$&#xA;where&#xA;$$B_t=\exp\left(\int_{0}^{t}r\,du\right)=e^{rt}$$&#xA;as a result&#xA;$${{\mathbb{Q}}^{S}}({{S}_{T}}&amp;gt;K)=\int\limits_{K}^{+\infty }{d{{\mathbb{Q}}^{S}}}=\frac{{{e}^{-r(T-t)}}}{{{S}_{t}}}\int\limits_{K}^{+\infty }{{{S}_{T}}\,d\mathbb{Q}}=\frac{{{e}^{-r(T-t)}}}{{{S}_{t}}}\int\limits_{K}^{+\infty }{{{S}_{T}}{{f}_{{{S}_{T}}}}(x)dx} $$&#xA;we have&#xA;$$\mathbb{Q}^S(S_T&amp;gt;K)=\frac{e^{-r(T-t)}}{S_t}E^\mathbb{Q}[S_T|S_T&amp;gt;K]=N\left(\frac{\ln \left(\frac{X_t}{K}\right)+\left( r+\frac{1}{2}\sigma ^{2} \right)(T-t)}{\sigma^2\sqrt{T-t}}\right)$$&#xA;Indeed&#xA;$$\mathbb{Q}^S(S_T&amp;gt;K)=N(d_1)$$&#xA;on the other hand&#xA;$$V(t,S_t)=e^{-r(T-t)}\mathbb{E}_{t}^{\mathbb{Q}}\left[\,\max\{S_T-K\},0\,\right]$$&#xA;it is obvious&#xA;$$\max\{S_T-K,0\}=(S_T-K)\mathbb{1}_{\{S_T&amp;gt;K\}}$$&#xA;then&#xA;$$V(t,S_t)=e^{-r(T-t)}\mathbb{E}_{t}^{\mathbb{Q}}\left[S_T\mathbb{1}_{\{S_T&amp;gt;K\}}\right]-e^{-r(T-t)}\mathbb{E}_{t}^{\mathbb{Q}}\left[K\mathbb{1}_{\{S_T&amp;gt;K\}}\right]$$&#xA;as a result&#xA;$$V(t,S_t)=X_t\,\mathbb{E}_{t}^{\mathbb{Q}}\left[\frac{S_T/S_t}{B_T/B_t}\mathbb{1}_{\{X_T&amp;gt;K\}}\right]-Ke^{-r(T-t)}\mathbb{E}_{t}^{\mathbb{Q}}\left[\mathbb{1}_{\{S_T&amp;gt;K\}}\right]$$&#xA;in other words&#xA;$$V(t,S_t)=S_t\mathbb{E}_{t}^{\mathbb{Q}^S}\left[\mathbb{1}_{\{S_T&amp;gt;K\}}\right]-Ke^{-r(T-t)}\mathbb{E}_{t}^{\mathbb{Q}}\left[\mathbb{1}_{\{S_T&amp;gt;K\}}\right]$$&#xA;so&#xA;$$\color{red}{V(t,S_t)=S_t\mathbb{Q}^S(S_T&amp;gt;K)-Ke^{-r(T-t)}\mathbb{Q}(S_T&amp;gt;K)}$$&#xA;Finally&#xA;$$V(t,S_t)=S_tN(d_1)-Ke^{-r(T-t)}N(d_2)$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-10-24T19:33:15.397" LastActivityDate="2016-10-24T19:33:15.397" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30631" PostTypeId="1" AcceptedAnswerId="30632" CreationDate="2016-10-19T09:22:18.807" Score="7" ViewCount="636" Body="&lt;p&gt;From Baxter and Rennie, page 138:&#xA;$$f(t,T)=\sigma W_t+f(0,T)+\int_0^t\alpha(s,T)ds$$&#xA;$$Z_t=\exp-\bigg(\sigma(T-t)W_t+\sigma\int_0^tW_sds+\int_0^Tf(0,u)du+\int_0^t\int_s^T\alpha(s,u)ds\bigg)$$&#xA;$$dZ_t=Z_t\bigg(-\sigma(T-t)dW_t-\bigg(\int_t^T\alpha(t,u)du\bigg)dt+\frac{1}{2}\sigma^2 (T-t)^2dt\bigg)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would Ito's Lemma be applied here?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried:&#xA;$$Z_t=\exp-\bigg(\sigma(T-t)W_t+\sigma\int_0^tW_sds+\int_0^Tf(0,u)du+\int_0^t\int_s^T\alpha(s,u)ds\bigg)=e^{-X_t}$$&#xA;$$X_t=\sigma(T-t)W_t+\sigma\int_0^tW_sds+\int_0^Tf(0,u)du+\int_0^t\int_s^T\alpha(s,u)ds$$&#xA;\begin{align}&#xA;dX_t &amp;amp;=\sigma(T-t)W_t-\sigma W_tdt+\sigma(W_tdt-W_0d0)+f(0,T)dT-f(0,0)d0+\bigg(\int_t^T\alpha(t,u)du\bigg)dt-\bigg(\int_t^T\alpha(0,u)du\bigg)d0\\&#xA;&amp;amp;=\sigma(T-t)W_t+f(0,T)dT+\bigg(\int_t^T\alpha(t,u)du\bigg)dt&#xA;\end{align}&#xA;\begin{align}&#xA;dZ_t&amp;amp;=-Z_tdX_t+\frac{1}{2}Z_t(dX_t)^2\\&#xA;&amp;amp;=Z_t\bigg(-\sigma(T-t)W_t-f(0,T)dT-\bigg(\int_t^T\alpha(t,u)du\bigg)dt+\frac{1}{2}\sigma^2(T-t)^2dt\bigg)&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few concerns are that I've written $d0$ and that I have $f(0,T)dT$ remaining. I do think that I've applied Ito's Lemma correctly, the issue is with $dX_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help is appreciated.&lt;/p&gt;&#xA;" OwnerUserId="24781" LastEditorUserId="24781" LastEditDate="2016-10-19T11:10:12.193" LastActivityDate="2019-03-01T15:18:18.453" Title="Baxter &amp; Rennie HJM: differentiating Ito integral" Tags="&lt;stochastic-calculus&gt;&lt;itos-lemma&gt;&lt;heath-jarrow-morton&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30632" PostTypeId="2" ParentId="30631" CreationDate="2016-10-19T12:07:41.430" Score="7" Body="&lt;p&gt;Let&#xA;$$Z_t = \exp(-X_t)$$&#xA;with&#xA;$$X_t = \sigma(T-t)W_t+\sigma\int_0^tW_sds+\int_0^Tf(0,u)du+\int_0^t\int_s^T\alpha(s,u)du ds $$&#xA;and $W_t$ a standard Brownian motion, along with the usual assumptions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can write $X_t=f(t,W_t)$ and apply Itô's lemma to get:&#xA;$$ dX_t = \frac{\partial f}{\partial t}(t,W_t) dt + \frac{\partial f}{\partial W_t} (t,W_t) dW_t + \frac{1}{2}\frac{\partial^2 f}{\partial W_t^2}(t,W_t) d \langle W, W \rangle_t $$&#xA;\begin{align}&#xA;\frac{\partial f}{\partial t}(t,W_t) &amp;amp;= -\sigma W_t + \sigma W_t + \int_t^T \alpha(t,u) du\\&#xA;\frac{\partial f}{\partial W_t}(t,W_t) &amp;amp;= \sigma(T-t)\\&#xA;\frac{\partial^2 f}{\partial W_t^2}(t,W_t) &amp;amp;= 0\\&#xA;\end{align}&#xA;where we have used &lt;strong&gt;Leibniz integral rule&lt;/strong&gt; (see &lt;a href=&quot;https://en.wikipedia.org/wiki/Leibniz_integral_rule&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;) to express the time derivatives of integral terms, notably the following:&#xA;\begin{align}&#xA;\partial_t \int_0^t \underbrace{\int_s^T \alpha(s,u) du}_{\tilde{\alpha}(s,T)} ds &amp;amp;= \partial_t \int_0^t \tilde{\alpha}(s,T) ds \\&#xA;&amp;amp;= \int_0^t \underbrace{\partial_t \tilde{\alpha}(s,T)}_{=0} ds + \underbrace{\partial_t(t)}_{=1} \tilde{\alpha}(t,T) - \underbrace{\partial_t(0)}_{0} \tilde{\alpha}(0,T) \\&#xA;&amp;amp;= \tilde{\alpha}(t,T) \\&#xA;&amp;amp;= \int_t^T \alpha(s,u) du&#xA;\end{align}&#xA;Wrapping up, yields the following differential for the process $X_t$&#xA;$$ dX_t = \left(\int_t^T \alpha(t,u) du\right) dt + \sigma(T-t) dW_t$$&#xA;from which one can deduce &#xA;$$ d\langle X, X\rangle_t = \sigma^2(T-t)^2 dt $$&#xA;and finally, applying Itô's lemma to the continuous semi martingale $Z_t = \tilde{f}(t,X_t) = \exp(-X_t)$ &#xA;\begin{align}&#xA;dZ_t &amp;amp;= - Z_t dX_t + \frac{1}{2} Z_t d\langle X, X \rangle_t \\&#xA;     &amp;amp;= Z_t \left( \left(\frac{1}{2} \sigma^2(T-t)^2 - \int_t^T \alpha(t,u) du \right)dt - \sigma(T-t) dW_t \right)&#xA;\end{align}&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-10-20T07:22:08.990" LastActivityDate="2016-10-20T07:22:08.990" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30633" PostTypeId="2" ParentId="30629" CreationDate="2016-10-19T14:25:40.547" Score="2" Body="&lt;p&gt;Assume deterministic interest rates to keep notations uncluttered.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the absence of arbitrage opportunity, under the risk-neutral measure $\Bbb{Q}$ associated to a risk-free money market account denominated in EUR, you suggest to model the GBP/EUR spot exchange rate dynamics using the following SDE:&#xA;$$ \frac{dX_t}{X_t} = (r^{EUR}_t - r^{GBP}_t)dt + \sigma dW_t^{\Bbb{Q}},\quad X(0)=X_0$$&#xA;Solving the equation yields the unique solution:&#xA;\begin{align}&#xA;X_T &amp;amp;= \underbrace{X_0 \exp\left( \int_0^T (r^{EUR}_t - r^{GBP}_t) dt \right)}_{=X(0,T)} \underbrace{\exp(- \frac{1}{2}\sigma^2 T) \exp(\sigma W_T^\Bbb{Q})}_{= \mathcal{E}[W_t]} \tag{0}&#xA;\end{align}&#xA;with $X(0,T)$ denoting the forward exchange rate and $\mathcal{E}[X_t] = \exp(X_t - \frac{1}{2}\langle X \rangle_t)$ the stochastic exponential of a continuous semi martingale $X_t$. From the properties of the latter exponential, it is straightforward to see that:&#xA;$$ X(0,T) = \Bbb{E}^\Bbb{Q} \left[ X_T \vert \mathcal{F}_0 \right] \tag{1} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you are evaluating a forward price using Monte Carlo simulations you are numerically evaluating $(1)$ as:&#xA;$$\tilde{X}(0,T) = \frac{1}{M} \sum_{m=1}^M X_T^{(m)} \tag{2} $$&#xA;where $\{ X_T^{(m)} \}_{m=1}^M$ are iid samples of the random variable $X_T$ simulated under the risk-neutral measure $\Bbb{Q}$, conditionally on the knowledge of $X_0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming you manage to sample from the &lt;strong&gt;true&lt;/strong&gt; distribution of $X_T$ (which is possible under our working modelling assumptions), then &lt;strong&gt;central limit theorem&lt;/strong&gt; (CLT) tells you that your Monte Carlo estimation of the forward exchange rate, although &lt;em&gt;unbiased&lt;/em&gt;, will have a variance $\propto M^{-1/2}$. This is probably what you mean by &quot;you can never exactly represent the forward price&quot;. But I don't understand the approach 2 you mention: do you mean a plus sign instead of a multiplication?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That being said, you do not need Monte Carlo to compute forward prices: in general, those are computable in closed form as I just showed. Also, yes, you can perfectly calibrate a GBM to match a given forward cruve as long as your model can accomodate a term structure for the risk-neutral drift. It is basically equivalent to matching the first moment of the conditional distributions.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2016-10-19T14:25:40.547" CommentCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="30634" PostTypeId="1" CreationDate="2016-10-19T16:28:35.640" Score="3" ViewCount="252" Body="&lt;p&gt;Brazil has had historically two sets of inflation bonds, the NTN-B and NTN-C series each with a different inflation index. The NTN-C is no longer issued. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When creating historical break even inflation (BEI) curves for Brazil what is the standard practice? Do we create two separate curves or combine both series some how?&lt;/p&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="1764" LastEditDate="2016-10-27T10:27:44.610" LastActivityDate="2017-01-15T16:59:16.840" Title="Brazilian break even inflation curves" Tags="&lt;fixed-income&gt;&lt;yield-curve&gt;&lt;inflation&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30635" PostTypeId="1" CreationDate="2016-10-19T20:08:33.737" Score="2" ViewCount="253" Body="&lt;p&gt;What is a good investment metric to reward diversification within a portfolio. Suppose we have a fixed income universe and prefer stable currency, mid yield and mid tenors. Our stressed spread var covar matrix suggests that we have correlation factor amongst each  currency &amp;amp; fixed income class.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A simple metric would be weighted-portfolio for correlation&#xA;Possibly the HHI Herfindahl index weights&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is in the context of Solvency II but would apply much more broadly. Any suggestions or solutions?&lt;/p&gt;&#xA;" OwnerUserId="21023" LastActivityDate="2017-04-19T21:20:11.480" Title="Diversification investment metric for a FI portfolio" Tags="&lt;portfolio-management&gt;&lt;risk-management&gt;&lt;performance-evaluation&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30636" PostTypeId="2" ParentId="30629" CreationDate="2016-10-19T20:16:21.113" Score="0" Body="&lt;p&gt;You are confusing Monte Carlo which is a numerical method and the modelling that comes before that. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The 2 approaches use Monte Carlo simulation but it is the modelling that is different. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In approach 2, the forwards for different expiries are modelled as completely independent. The corresponding process is a white noise. This is not realistic at all but this is not an issue in itself if what you are interested in does not depend on the covariance between rates. For example, you could get the right value for a portfolio of vanilla options at the expiries you simulate. Obviously you would't need a MC simulation for that and a much more serious issue is that your FX forward can actually be negative but I hope you get my point.&lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2016-10-19T20:16:21.113" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30638" PostTypeId="1" CreationDate="2016-10-19T22:23:51.830" Score="7" ViewCount="818" Body="&lt;p&gt;I use Quantstrat heavily for strategy research and optimisation. I have two Python developers about to join my team and would like to use it as an opportunity to diversify our research tools so we are not as reliant upon one framework. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which of the plethora of python backtesting Frameworks is most similar to Quantstrat in terms of strategy design (Indicators, Signals, Rules), preferably vectorised as were mainly dealing with granular data and running multiple parameter sweeps, and also &lt;strong&gt;fully&lt;/strong&gt; supports futures?&lt;/p&gt;&#xA;" OwnerUserId="24906" LastActivityDate="2016-10-20T13:17:01.217" Title="Python Backtesting Framework Similar to Quantstrat" Tags="&lt;backtesting&gt;&lt;futures&gt;&lt;python&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30639" PostTypeId="2" ParentId="30635" CreationDate="2016-10-20T04:53:14.780" Score="0" Body="&lt;p&gt;Also intrested in this question. A more qualitative approch is presented &lt;a href=&quot;https://am.jpmorgan.com/blob-gim/1383280096921/83456/II-FIXINC-ALL.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you tell how did you get your variance-covariance matrix? Did you use daily price changes?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Somebody suggested using VaR if you have multi-currency FI portfolio. So you'd have VaR measures for specific bonds and for overall portfolio. And from there maybe you be able to see the difersification effect?&lt;/p&gt;&#xA;" OwnerUserId="19096" LastActivityDate="2016-10-20T04:53:14.780" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30640" PostTypeId="1" AcceptedAnswerId="30645" CreationDate="2016-10-20T05:20:07.613" Score="1" ViewCount="1190" Body="&lt;p&gt;Is there any list of risk measures commonly used in Equity, FI, FX, Commodities portfolio management? For instance:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equities - standard deviation, beta;&#xA;Bonds - duration, convexity, DV01;&#xA;FX/Commodities - ???;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What risk measures would you look at if you were managing Equity portfolio? What if you are dealing with FI? Or FX?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or should you just ignore these measures and monitor VaR?&lt;/p&gt;&#xA;" OwnerUserId="19096" LastEditorUserId="19096" LastEditDate="2016-10-20T05:59:18.430" LastActivityDate="2016-10-22T14:53:48.730" Title="A comprehensive list of risk measures for different asset classes" Tags="&lt;portfolio-management&gt;&lt;risk-management&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30643" PostTypeId="2" ParentId="18759" CreationDate="2016-10-20T08:48:40.537" Score="1" Body="&lt;p&gt;Here are two nice references: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://www.sitmo.com/?p=134&quot; rel=&quot;nofollow&quot;&gt;https://www.sitmo.com/?p=134&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://commoditymodels.files.wordpress.com/2010/02/estimating-the-parameters-of-a-mean-reverting-ornstein-uhlenbeck-process1.pdf&quot; rel=&quot;nofollow&quot;&gt;https://commoditymodels.files.wordpress.com/2010/02/estimating-the-parameters-of-a-mean-reverting-ornstein-uhlenbeck-process1.pdf&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="24914" LastActivityDate="2016-10-20T08:48:40.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30645" PostTypeId="2" ParentId="30640" CreationDate="2016-10-20T09:17:43.840" Score="4" Body="&lt;p&gt;VaR has the benefit that it is comparable across all asset classes, and can even be computed for multi-asset class portfolios. The downsides are that it either needs assumptions on the joint distribution of all assets in the portfolio (which is difficult to calibrate) or historical simulation/bootstrapping (which may not be relevant to the state of the market today).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For individual asset classes, some common measures of risk include&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Equities&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Net book size (total longs - total shorts)&lt;/li&gt;&#xA;&lt;li&gt;Gross book size (total longs + total shorts)&lt;/li&gt;&#xA;&lt;li&gt;Standard deviation&lt;/li&gt;&#xA;&lt;li&gt;Beta&lt;/li&gt;&#xA;&lt;li&gt;Country exposures/betas&lt;/li&gt;&#xA;&lt;li&gt;Sector exposures/betas&lt;/li&gt;&#xA;&lt;li&gt;Factor exposures/betas (e.g. using BARRA or some other provider to get exposure to value, momentum etc)&lt;/li&gt;&#xA;&lt;li&gt;Value at risk&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Fixed Income&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Net duration (sum of positions x duration)&lt;/li&gt;&#xA;&lt;li&gt;Gross duration (sum of |positions| x duration)&lt;/li&gt;&#xA;&lt;li&gt;DV01, PV01&lt;/li&gt;&#xA;&lt;li&gt;Country risk / duration / DV01&lt;/li&gt;&#xA;&lt;li&gt;Credit risk (sovereign / investment grade / high yield)&lt;/li&gt;&#xA;&lt;li&gt;Value at risk&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Commodities&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Net book size (sum of notionals on futures and spot positions)&lt;/li&gt;&#xA;&lt;li&gt;Gross book size (total longs + total shorts)&lt;/li&gt;&#xA;&lt;li&gt;Beta to commodity index (GSCI, DJCI, BCOM)&lt;/li&gt;&#xA;&lt;li&gt;Sector risk / betas (e.g. energy, agriculture, precious metals, ...)&lt;/li&gt;&#xA;&lt;li&gt;Value at risk&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;FX&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Net risk vs quote currency (typically USD, but you can use any currency)&lt;/li&gt;&#xA;&lt;li&gt;Gross risk vs quote currency&lt;/li&gt;&#xA;&lt;li&gt;Country / regional exposure&lt;/li&gt;&#xA;&lt;li&gt;G10 and emerging market exposure&lt;/li&gt;&#xA;&lt;li&gt;Commodity exposure (e.g. large positions in CAD, AUD, NOK, RUB, BRL...)&lt;/li&gt;&#xA;&lt;li&gt;Value at risk&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You can also define various custom risk measures, for example - compute the adjustment required so that the position has the same volatility as global equities - for bonds, this will mean multiplying the position by a number less than 1, for energy commodities this generally means multiplying by a number greater than 1. This allows you to compare all instruments on the same scale.&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2016-10-20T09:17:43.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30648" PostTypeId="2" ParentId="30527" CreationDate="2016-10-20T10:40:55.137" Score="1" Body="&lt;p&gt;My idea to answer is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $2u-d&amp;gt;u$, then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\{  \displaystyle\max_{[\tau,T]} (X_t)\ge 2u-d \}=\{\displaystyle\max_{[0,T]} (X_t)\ge 2u-d \}$$&#xA;because the random variable $\tau$ is the time of the first crossing of the barrier $u$ by the process $X$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, we have the following equality:&#xA;$$\{\tau \le T\}=\{\displaystyle\max_{[0,T]} (X_t)\ge u \} $$&#xA;Finally, since&#xA;$$\{ \displaystyle\max_{[0,T]} (X_t)\ge 2u-d \}\subset \{\displaystyle\max_{[0,T]} (X_t)\ge u \}  $$&#xA;Therefore&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\{ \displaystyle\max_{[\tau,T]} (X_t)\ge 2u-d, \tau \le T  \}=\{\displaystyle\max_{[0,T]} (X_t)\ge 2u-d \}$$&lt;/p&gt;&#xA;" OwnerUserId="20360" LastEditorUserId="20360" LastEditDate="2016-10-20T11:47:13.413" LastActivityDate="2016-10-20T11:47:13.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30651" PostTypeId="2" ParentId="24796" CreationDate="2016-10-20T13:06:53.283" Score="2" Body="&lt;p&gt;Have a look at the &lt;a href=&quot;https://cran.r-project.org/web/packages/TFX/index.html&quot; rel=&quot;nofollow&quot;&gt;TFX&lt;/a&gt; R package.&lt;/p&gt;&#xA;" OwnerUserId="994" LastActivityDate="2016-10-20T13:06:53.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30653" PostTypeId="1" CreationDate="2016-10-20T14:08:31.110" Score="3" ViewCount="1310" Body="&lt;p&gt;I have read a number articles about margin valuation adjustment (MVA), which effectively is the funding cost of the initial margin, which has become important because of the rise of central clearing and because new rules on bilateral OTC derivatives requiring IM and VM. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;IM should be static for the life of an individual trade, however manner its is calculated initially (e.g., 10 day VAR), right? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Why is there a need to conduct a simulation exercise to calculate the funding cost of this IM if it's known? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I get CVA and FVA because they are based on future MTM's, which are simulated to give an estimated exposure or funding requirement, not clear on MVA.&lt;/p&gt;&#xA;" OwnerUserId="24918" LastEditorUserId="20795" LastEditDate="2019-09-08T09:08:53.507" LastActivityDate="2019-09-08T09:08:53.507" Title="MVA, initial margin valuation adjustment for derivatives" Tags="&lt;cva&gt;&lt;margin&gt;&lt;initial-margin&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="30654" PostTypeId="2" ParentId="28403" CreationDate="2016-10-20T16:24:15.277" Score="3" Body="&lt;p&gt;The highly respected &lt;a href=&quot;https://www.cxoadvisory.com/&quot; rel=&quot;nofollow&quot;&gt;CXO Advisory Group&lt;/a&gt; has done some research on this topic on basis of a suggestion from me. The result is summarized as follows (cited with permission):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In summary, evidence suggests that high-dividend stock ETFs mostly&#xA;  generate positive alpha with beta less than one relative to SPY, but&#xA;  other performance comparisons to the market are mixed.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;After having read the very interesting post I have to say that the case is far from closed but all in all high-dividend stocks don't seem to have a clear edge over the broad market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The full piece can be found here but most of it is behind a paywall: &lt;a href=&quot;https://www.cxoadvisory.com/29079/fundamental-valuation/do-high-dividend-stocks-really-beat-the-market/&quot; rel=&quot;nofollow&quot;&gt;https://www.cxoadvisory.com/29079/fundamental-valuation/do-high-dividend-stocks-really-beat-the-market/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2016-10-20T16:24:15.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30655" PostTypeId="1" AcceptedAnswerId="30656" CreationDate="2016-10-20T18:35:25.700" Score="1" ViewCount="1958" Body="&lt;p&gt;Suppose I have a model for the short rate $r$ as ($W(t)$ is standard Brownian motion)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r(t) = c+ \int_0^t \sigma (s) ^2 (t-s) ds+ \int_0^t \sigma (s) dW(s)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then want to find the dynamics of $r$, but how do I do that when the process itself contains integrals w.r.t Brownian motion? I get stuck when using Ito's formula and trying to calculate the integral&#xA;$ \frac{\partial}{\partial t} \int_0^t \sigma (s) dW(s)$&lt;/p&gt;&#xA;" OwnerUserId="24920" LastActivityDate="2016-10-20T19:27:22.773" Title="Partial derivative of an integral" Tags="&lt;brownian-motion&gt;&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30656" PostTypeId="2" ParentId="30655" CreationDate="2016-10-20T19:17:28.110" Score="3" Body="&lt;p&gt;Let $$X_t = \int_0^t \sigma(s) dW_s$$ denote a stochastic integral in the Itô sense. In that case one can write $r_t = f(t,X_t)$ where $$f:(t,x) \to c + \int_0^t \sigma^2(s)(t-s) ds + x \tag{1}$$&#xA;and use Itô's lemma to compute the differential&#xA;$$ dr_t = \partial_t f(t,X_t) dt + \partial_x f(t,X_t) dX_t + \partial_{xx} f(t,X_t) d\langle X \rangle_t $$&#xA;where from $(1)$&#xA;\begin{align} &#xA;\partial_t f(t,X_t) &amp;amp;= \partial_t \int_0^t \sigma^2(s)(t-s) ds \\&#xA;&amp;amp;= \int_0^t \sigma^2(s) ds + 1 (\sigma^2(t)(t-t)) - 0 (\sigma^2(0)(0-s)) \\&#xA;&amp;amp;= \int_0^t \sigma^2(s) ds&#xA;\end{align}&#xA;from Leibniz integral rule and&#xA;$$ \partial_x f(t,X_t) = 1,\quad \partial_{xx} f(t,X_t) = 0 $$&#xA;along with, by definition of the Itô integral:&#xA;$$ dX_t = \sigma(t) dW_t,\quad d\langle X \rangle_t = \sigma^2(t) dt $$&#xA;such that finally:&#xA;$$ dr_t = \left(\int_0^t \sigma^2(s) ds\right) dt + \sigma(t) dW_t $$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;And indeed by integrating this last equation from $0$ to $t$ one gets:&#xA;$$ r_t - r_0 = \int_0^t \left( \int_0^u \sigma^2(s) ds\right) du + \int_0^t \sigma(u) dW_u $$&#xA;and noting that &#xA;\begin{align}&#xA; \int_0^t \int_0^u \sigma^2(s) ds du &amp;amp;= \int_0^t \int_s^t \sigma^2(s) du ds\\&#xA;&amp;amp;= \int_0^t \sigma^2(s) (t-s) ds&#xA;\end{align}&#xA;by Fubini theorem, one gets&#xA;$$ r_t = r_0 + \int_0^t \sigma^2(s) (t-s) ds + \int_0^t \sigma(s) dW_s $$ &lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-10-20T19:27:22.773" LastActivityDate="2016-10-20T19:27:22.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30657" PostTypeId="2" ParentId="30456" CreationDate="2016-10-20T19:25:53.040" Score="2" Body="&lt;p&gt;At the moment QuantConnect doesn't have bid &amp;amp; ask data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I've been using limit orders in my backtests, and adjusting the limit orders.  I'm guessing what they do is fill your limit order according to the trades coming in... so limit order backtests 'steal' the trades as they come in, until your limit order is filled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For low volume stocks with big spreads, your limit order may not get filled for a long time...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Their 'standard' Order() method just fills your order at the current price.&lt;br&gt;&#xA;You can also model slippage ( 1/10th of 1% in this example):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Securities[symbol].SlippageModel = new ConstantSlippageModel(0.001m);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;All that said, there really is no good way to model bid/ask in a backtest, because in the real world, placing a large-ish limit order often scares off real world traders.&lt;/p&gt;&#xA;" OwnerUserId="24922" LastActivityDate="2016-10-20T19:25:53.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30660" PostTypeId="1" CreationDate="2016-10-21T10:12:57.257" Score="1" ViewCount="150" Body="&lt;p&gt;In 2015 the Fed funds rate was 0.24%, while the US Treaury 10-year government bond was 2.24%. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How is the spread determined? Is there a formula to determine the spread of the US-10 T-bond and the Fed funds rate?&lt;/p&gt;&#xA;" OwnerUserId="24497" LastActivityDate="2018-05-06T14:00:53.733" Title="How is the spread between the US-10 T-bond and the Fed funds rate determined?" Tags="&lt;interest&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30661" PostTypeId="2" ParentId="30618" CreationDate="2016-10-21T11:12:20.480" Score="1" Body="&lt;p&gt;The last step (taking everything outside the expectation ) is invalid.  The expression $E[\frac{S_{T'}}{P^{T'}_T}]$ is the expectation of the product of 2 random variables.   As such, you need a model to describe the joint evolution of the stock and the discount factor before you can go any further.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastEditorUserId="467" LastEditDate="2016-11-20T14:43:50.713" LastActivityDate="2016-11-20T14:43:50.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30663" PostTypeId="2" ParentId="30622" CreationDate="2016-10-21T13:51:57.977" Score="4" Body="&lt;p&gt;Typically for dynamic sources like this, you would provide&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;A reference URL, and&lt;/li&gt;&#xA;&lt;li&gt;a date of download.  &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For just one Quandl data series that is easy due to the Web API, i.e. in BibTeX I would do something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;@online{QuandlXOM,&#xA;  author = {Quandl},&#xA;  title = {{WIKI} Exxon Mobil End-Of-Day Data},&#xA;  year = 2016,&#xA;  url = {https://www.quandl.com/data/WIKI/XOM},&#xA;  urldate = {2016-10-21}&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you used too many series to cite them all, I would recommend at least having one citation per database, like this&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;@online{QuandlWIKI,&#xA;  author = {Quandl},&#xA;  title = {{WIKI} Various End-Of-Day Data},&#xA;  year = 2016,&#xA;  url = {https://www.quandl.com/data/WIKI},&#xA;  urldate = {2016-10-21}&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2016-10-21T15:14:18.150" LastActivityDate="2016-10-21T15:14:18.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30664" PostTypeId="1" AcceptedAnswerId="30665" CreationDate="2016-10-21T14:47:50.470" Score="0" ViewCount="303" Body="&lt;p&gt;Shreve II page 151, the Cox-Ingersoll-Ross model is defined as&#xA;$$dr_t=(\alpha-\beta r_t)dt+\sigma\sqrt{r_t}dW_t$$&#xA;By applying Ito's Lemma, we obtain&#xA;\begin{align}&#xA;r_t&amp;amp;=r_0e^{-\beta t}+\frac{\alpha}{\beta}(1-e^{-\beta t})+\sigma e^{-\beta t}\int_0^te^{\beta u}\sqrt{r_u}dW_u\\&#xA;&amp;amp;=\frac{\alpha}{\beta}+\Big(r_0-\frac{\alpha}{\beta}\Big)e^{-\beta t}+\sigma e^{-\beta t}\int_0^te^{\beta u}\sqrt{r_u}dW_u&#xA;\end{align}&#xA;Now for the variance of $r_t$, Shreve suggests that we set&#xA;$$X_t=e^{\beta t }r_t$$&#xA;and apply Ito's Lemma to obtain $dX_t$, after which $d(X_t^2)$ may be found. Then $d(X_t^2)$ is integrated to obtain $X_t^2$, from which $r_t^2$ is found. Finally, the variance is derived from &#xA;$$Var(r_t)=E(r_t^2)-(E(r_t))^2$$&#xA;My question is, why not take the variance of $r_t$ immediately, that is&#xA;\begin{align}&#xA;Var(r_t)&amp;amp;=\sigma^2 e^{-2\beta t}\int_0^te^{2\beta u}E(r_u)du\\&#xA;&amp;amp;=\sigma^2 e^{-2\beta t}\int_0^te^{2\beta u}\Big(\frac{\alpha}{\beta}+\Big(r_0-\frac{\alpha}{\beta}\Big)e^{-\beta u}\Big)du&#xA;\end{align}&#xA;and from here the integration is simple. It yields the same result as Shreve's method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One possibility is that I have assumed $E(r_u(dW_u)^2)$=$E(r_u)E((dW_u)^2)$, implying independence between $r_t$ and $(dW_t)^2$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help is appreciated.&lt;/p&gt;&#xA;" OwnerUserId="24781" LastActivityDate="2016-10-21T16:10:19.817" Title="Variance of the Cox-Ingersoll-Ross short rate" Tags="&lt;stochastic-calculus&gt;&lt;short-rate&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30665" PostTypeId="2" ParentId="30664" CreationDate="2016-10-21T16:10:19.817" Score="2" Body="&lt;p&gt;The independence assumption is not needed. In fact, based on Ito's isometry and the Fubini theorem,&#xA;\begin{align*}&#xA;Var(r_t) &amp;amp;= E\left((r_t-E(r_t))^2 \right)\\&#xA;&amp;amp;=\sigma^2 e^{-2\beta t} E\left(\left(\int_0^te^{\beta u}\sqrt{r_u}dW_u\right)^2 \right)\\&#xA;&amp;amp;=\sigma^2 e^{-2\beta t} E\left(\int_0^te^{2\beta u} r_u du \right)\\&#xA;&amp;amp;=\sigma^2 e^{-2\beta t}\int_0^t e^{2\beta u}E(r_u) du.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-10-21T16:10:19.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30667" PostTypeId="1" CreationDate="2016-10-21T17:21:05.300" Score="2" ViewCount="5486" Body="&lt;p&gt;I am doing an event study and wanted to know if was going about this correctly$$&#xA;\text{BHAR}_{i(\tau_1,\tau_2)}\quad=\quad\prod_{t=\tau_1}^{\tau_2}(1+R_{i,t})~-~\prod_{t=\tau_1}^{\tau_2}(1+R_{m,t})&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{array}{|c|c|c|c|c|} \hline&#xA;    \textbf{Date} &amp;amp;&#xA;\begin{array}{c}&#xA;\text{Price of} \\&#xA;\text{Stock}~i&#xA;\end{array}&#xA;&amp;amp; \text{LOG RET} &amp;amp; 1+R_{i,t} &amp;amp; 1+R_{m,t} \\ \hline&#xA;    \text{2015-01-01} &amp;amp;	100	&amp;amp; \text{--} &amp;amp; \text{--} &amp;amp; \text{--}                 	\\&#xA;    \text{2015-02-01} &amp;amp; 101 &amp;amp; \phantom{-}0.99503 &amp;amp; 1.99503 &amp;amp; 1.004987\phantom{0} \\&#xA;    \text{2015-03-01} &amp;amp; 102 &amp;amp; \phantom{-}0.00985 &amp;amp; 1.00985 &amp;amp; 1.0039722 \\&#xA;    \text{2015-04-01} &amp;amp; 103 &amp;amp; \phantom{-}0.00975 &amp;amp; 1.00975 &amp;amp; 0.9990084 \\&#xA;    \text{2015-05-01} &amp;amp; 104 &amp;amp; \phantom{-}0.01445 &amp;amp; 1.01445 &amp;amp; 1.005934\phantom{0}  \\&#xA;    \text{2015-06-01} &amp;amp; 104 &amp;amp; -0.0047\phantom{0} &amp;amp; 0.99520 &amp;amp; 1.00491\phantom{00} \\ \hline&#xA;\end{array}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then if I want to calculate the 4-day $\text{BHAR}$ from the 2015-02-01 to 2015-06-01, would it simply be:&#xA;$$&#xA;\begin{array}{cr}&#xA;&amp;amp; (1.9950)_{\text{Day0}} \times (1.0098)_{\text{Day1}} \times (1.00975)_{\text{Day2}} \times (1.01445)_{\text{Day3}} \times (0.9952)_{\text{Day4}} \\&#xA;- &amp;amp; (1.0049)_{\text{Day0}} \times (1.0039)_{\text{Day1}} \times (0.9990)_{\text{Day2}} \times (1.00593)_{\text{Day3}} \times (1.00491)_{\text{Day4}}&#xA;\end{array}?&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="16184" LastEditorUserId="31870" LastEditDate="2018-02-16T14:47:20.550" LastActivityDate="2018-03-18T16:28:49.377" Title="Computing Buy-and-hold abnormal returns (BHARs) $= \prod_{t=\tau_1}^{\tau_2}(1+R_{i,t}) - \prod_{t=\tau_1}^{\tau_2}(1+R_{m,t})$" Tags="&lt;finance&gt;&lt;returns&gt;&lt;finance-mathematics&gt;&lt;event-study&gt;&lt;abnormal-returns&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30669" PostTypeId="1" AcceptedAnswerId="30720" CreationDate="2016-10-21T20:49:11.557" Score="0" ViewCount="174" Body="&lt;p&gt;Ok so I am not a math whizz so need some SERIOUS help here. I have historical volatilities:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;20 day historical volatility = 49.07%&#xA;10 day historical volatility = 47.43%&#xA;5  day historical volatility = 41.77%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My goal is to show the relative change between the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the change between the 20 day HV and the 10 day hv = diff2010&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the change between the 10 day HV and the 5  day hv = diff105&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the overall change of 20 10 5 day = diffabs&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I got helpful advice that I should use the log function to get the difference in a mathematically accurate manner using the equation below&lt;/p&gt;&#xA;&#xA;&lt;p&gt;log_diff2010 = math.log(10 day hv ) - math.log(20 day hv )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;log_diff105 = math.log(5 day hv)  - math.log(10 day hv )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;log_diffabs = math.log(log_diff105) - math.log(log_diff2010)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BUT the log_diffabs results in a -ve log num which causes an error.&#xA;SO I have two questions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 are my calculations for log_diff2010 and log_diff105 correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2 how can I find the overall change for the period 20 10 5 day &lt;/p&gt;&#xA;&#xA;&lt;p&gt;here is the python 3.5 run where it all goes wrong for me :-(&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;blockquote&gt;&#xA;    &lt;blockquote&gt;&#xA;      &lt;p&gt;import math&lt;/p&gt;&#xA;      &#xA;      &lt;p&gt;math.log(47.43)&lt;/p&gt;&#xA;    &lt;/blockquote&gt;&#xA;  &lt;/blockquote&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; 3.85925493988949&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;blockquote&gt;&#xA;    &lt;blockquote&gt;&#xA;      &lt;p&gt;log_diff2010 = math.log(47.43) - math.log(49.07)&lt;/p&gt;&#xA;      &#xA;      &lt;p&gt;log_diff105 = math.log(41.77) - math.log(47.43)&lt;/p&gt;&#xA;      &#xA;      &lt;p&gt;log_diffabs = math.log(log_diff105) - math.log(log_diff2010)&lt;/p&gt;&#xA;    &lt;/blockquote&gt;&#xA;  &lt;/blockquote&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Traceback (most recent call last):&#xA; File &quot;&amp;lt;pyshell#6&amp;gt;&quot;, line 1, in &amp;lt;module&amp;gt;&#xA;   log_diffabs = math.log(log_diff105) - math.log(log_diff2010)&#xA;&#xA;    ValueError: math domain error&#xA;&#xA;  &amp;gt;&amp;gt;&amp;gt; log_diff105&#xA;&#xA; -0.12707656138040635&#xA;&#xA;  &amp;gt;&amp;gt;&amp;gt; log_diff2010&#xA;&#xA;-0.03399291021232198&#xA;  &amp;gt;&amp;gt;&amp;gt; r2010 = round(log_diff2010,4)&#xA;&#xA;  &amp;gt;&amp;gt;&amp;gt; r105 = round(log_diff105,4)&#xA;&#xA;  &amp;gt;&amp;gt;&amp;gt; r2010&#xA;&#xA;  -0.034&#xA;&#xA;  &amp;gt;&amp;gt;&amp;gt; r105&#xA;&#xA;    -0.1271&#xA;&#xA;   &amp;gt;&amp;gt;&amp;gt; rrabs = math.log(r105) - math.log(r2010)&#xA;&#xA;   Traceback (most recent call last):&#xA;&#xA;      File &quot;&amp;lt;pyshell#14&amp;gt;&quot;, line 1, in &amp;lt;module&amp;gt;&#xA;&#xA;&#xA;      rrabs = math.log(r105) - math.log(r2010)&#xA;&#xA;   ValueError: math domain error&#xA;&#xA;   &amp;gt;&amp;gt;&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="24745" LastEditorUserId="24745" LastEditDate="2016-10-22T20:35:27.833" LastActivityDate="2016-10-24T23:09:25.110" Title="want to get the trend in 20 10 5 day historical volatility using Logs but getting negative number" Tags="&lt;volatility&gt;&lt;python&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30671" PostTypeId="2" ParentId="30660" CreationDate="2016-10-21T23:05:28.810" Score="1" Body="&lt;p&gt;The two instruments are separated by funding objective, time and quite possibly inter-galactic forces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Fed funds&lt;/strong&gt; is the deposit rate payable to commercial banks for overnight deposits at various Fed Reserve Banks throughout the US. The FOMC meet to set this rate, depending on their success in adhering to governance framework around stable employment, growth and inflation targets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Ten year note yields&lt;/strong&gt; are the borrowing cost - over that horizon - of the US government at any point in time, based on a semi-annual coupon accrual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The spread between the two represents the market's expectations for all of growth, inflation, credit migration and default costs and many other flow and relative value factors against other, global ten year debt instruments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Can it be measured?&lt;/strong&gt; Yes, as yield/rates difference spread. &lt;strong&gt;Is it meaningful?&lt;/strong&gt; Yes, as an indication of curve steepness, which represents the economy's position in the credit cycle amongst other things.&lt;/p&gt;&#xA;" OwnerUserId="21023" LastActivityDate="2016-10-21T23:05:28.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30674" PostTypeId="1" CreationDate="2016-10-22T06:26:39.677" Score="0" ViewCount="314" Body="&lt;p&gt;Consider an American floating-strike arithmetic-average call option which was initiated 0.125 year ago, and still has 0.25 year to its expiry. The underlier has a current price of \$1.05\, volatility of 0.40, dividend yield of 0.02 and a running average of $0.95 (taken over the earlier period of 0.125 year). The risk free rate is 0.05.  Write a Matlab function to implement the two-state-variable FSGM (Forward Shooting Grid Method) for pricing the above option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With $\rho$ = $\frac{1}{2}$, use your function to generate results for the number of time periods in the lattice being 40, 80 and 160 respectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm having some issues when taking account with the running average. Are the discretized average states the same for each time level?  &lt;/p&gt;&#xA;" OwnerUserId="24795" LastEditorUserId="16160" LastEditDate="2016-10-24T01:13:36.047" LastActivityDate="2016-12-23T12:41:23.363" Title="FSGM for previously issued asian options" Tags="&lt;option-pricing&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30675" PostTypeId="2" ParentId="30548" CreationDate="2016-10-22T14:22:25.370" Score="1" Body="&lt;p&gt;NZ has traditionally had rates higher than US.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As such, their very long run (or equilibrium) estimate of policy rates will likely be way above other developed markets.&lt;/p&gt;&#xA;" OwnerUserId="21023" LastActivityDate="2016-10-22T14:22:25.370" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30676" PostTypeId="2" ParentId="30640" CreationDate="2016-10-22T14:53:48.730" Score="1" Body="&lt;p&gt;Risk measures:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Volatility&lt;/strong&gt;, the broadest classification regards price variance. Across asset classes the volatility of equity broadly equates to DV10 for credit/coupon instruments.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Mean variance&lt;/strong&gt;, Markowitz (1952) showed that if risk is measured by the variance of returns and expected return by the mean of returns, then uncertain investments can be ordered by their ranking in MV space.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;VaR&lt;/strong&gt;, value at risk, if X is the underlying price of a portfolio, then VaR(X){\displaystyle \operatorname {VaR} _{\alpha }(X)} is the negative of the α\alpha -quantile. It estimates how much a set of investments might lose, given normal market conditions, in a set time period such as one day with α=95/99% confidence. Assumption issues are normally distributed returns, or, a concave investor utility function; it does not measure the distribution or extent of risk in the tail, but only provides an estimate of a particular point in the distribution.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Semi variance&lt;/strong&gt;, the SV concentrates on the returns below the mean (expected return) thus the normality assumption is not required.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Expected Shortfall&lt;/strong&gt;, or conditional VaR/expected tail loss, conservatively estimates the value (or risk) of an investment by focusing on less profitable outcomes. For high values of q it ignores the most profitable but unlikely possibilities, while for small values of q it focuses on the worst losses &lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Lower Partial Moments&lt;/strong&gt;, Bawa (1975) and Bawa and Lindenberg (1977) generalised this idea by suggesting models based on LPM over n orders (see for example, Sing and Ong, 2000). LPMs of order 2 are measures of portfolio risk that focus on returns below some target level, so that for example, the semi-variance is just a special case LPM.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Min-Max&lt;/strong&gt;, Young (1998) said given an historic time series of returns, the optimum portfolio under the MM rule is defined as that which would minimise the maximum loss over all past periods, subject to a restriction that some minimum average return is achieved across the observed time periods.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Mean Absolute Deviation&lt;/strong&gt;, all these measures of risk are sensitive to outliers in the data because the mean differences are squared. Here a measure of variability that is less sensitive to outliers, (Konno, 1989), equivalent to MV under normality.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;There are other types of risk that you may additionally consider outside of price risk: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Liquidity risk&lt;/strong&gt;, defined under Basel III as LCR or NSFR.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Operational&lt;/strong&gt;, other non instrument factors.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Systemic&lt;/strong&gt;, contagion risk.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Market risk&lt;/strong&gt;, the expected price is absent.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Traditionally, the measure of risk used in portfolio optimisation models is the variance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sources: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&lt;a href=&quot;http://centaur.reading.ac.uk/21493/1/0304.pdf&quot; rel=&quot;nofollow&quot;&gt;http://centaur.reading.ac.uk/21493/1/0304.pdf&lt;/a&gt;&lt;/em&gt;&#xA;&lt;em&gt;&lt;a href=&quot;http://laurent.jeanpaul.free.fr/Pres%20papierEVRY3.pdf&quot; rel=&quot;nofollow&quot;&gt;http://laurent.jeanpaul.free.fr/Pres%20papierEVRY3.pdf&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="21023" LastActivityDate="2016-10-22T14:53:48.730" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30677" PostTypeId="2" ParentId="27715" CreationDate="2016-10-22T14:59:15.670" Score="0" Body="&lt;p&gt;&lt;strong&gt;&lt;em&gt;Qn: How did the use of currency swaps somewhat magnify the profits made?&lt;/em&gt;&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The key to interest rate derivative positions is no notional is posted, and effectively a margin (the net present value, discounted over the derivative lifetime at prevailing money market rate) call is, and thus easy leverage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the scenario described above, as rates lowered the the NPV remained in the rcvr's favour, generating a positive windfall and easing leverage.&lt;/p&gt;&#xA;" OwnerUserId="21023" LastActivityDate="2016-10-22T14:59:15.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30678" PostTypeId="1" CreationDate="2016-10-22T19:33:49.027" Score="-1" ViewCount="199" Body="&lt;p&gt;The second derivative of the call price at K gives the probability of that strike (implied probability density).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, what adjustments or acknowledgements (if any) need to be made to produce a IPD with puts?&lt;/p&gt;&#xA;" OwnerUserId="20194" LastActivityDate="2016-10-22T19:41:51.573" Title="Implied Probability Density with Puts" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;probability&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30679" PostTypeId="2" ParentId="30678" CreationDate="2016-10-22T19:41:51.573" Score="2" Body="&lt;p&gt;By call-put parity, the second derivative of a European call option price with respect to strike is strictly equivalent to that of a European put.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, yes: the result, known as the Breeden-Litzenberger identity, stays unchanged.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2016-10-22T19:41:51.573" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30680" PostTypeId="2" ParentId="30215" CreationDate="2016-10-22T21:33:22.497" Score="1" Body="&lt;p&gt;First calculate Rent1 and Rent2 for the two futures.   Then the expected daily move of the spread between the futures is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sqrt( Rent1^2 + Rent2^2 -2Rent1Rent2Rho)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where Rho= the correlation between daily moves ifvyhdvteonfurures&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-10-22T21:33:22.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30683" PostTypeId="1" CreationDate="2016-10-23T08:43:55.943" Score="1" ViewCount="925" Body="&lt;p&gt;How does one, having two lists of prices Y and X and wishing to fit the Least Squares model, perform this in Java?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fit is required to calculate the hedge ratio in a pairs trading strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For every period, the spread is calculated as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;symbol1.close - hedgeRatio * symbol2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We intend to compare the performance of this formula versus using normalized moving averages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The below Python code uses the statsmodels library and the Ordinary Least Squares (OLS) method.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import statsmodels.api as sm&#xA;&#xA;def hedge_ratio(Y, X):&#xA;    X = sm.add_constant(X)&#xA;    model = sm.OLS(Y, X).fit()&#xA;    return model.params[1]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="24955" LastEditorUserId="24955" LastEditDate="2016-11-03T12:11:03.563" LastActivityDate="2016-12-03T12:55:27.593" Title="How to calculate the hedge ratio between two securities using the Least Squares model in Java" Tags="&lt;programming&gt;&lt;statistics&gt;&lt;python&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30684" PostTypeId="1" AcceptedAnswerId="30689" CreationDate="2016-10-23T10:26:38.257" Score="1" ViewCount="183" Body="&lt;p&gt;We have the following simple HJM model&#xA;$$f(t,T)=f(0,T)+\int_0^t\alpha(s,T)ds+\sigma W_t$$&#xA;$$r_t=f(0,t)+\int_0^t\alpha(s,t)ds+\sigma W_t$$&#xA;$$P(t,T)=\exp-\bigg(\int_t^Tf(0,u)du+\int_0^t\int_t^T\alpha(s,u)duds+\sigma(T-t)W_t\bigg)\tag{1}$$&#xA;$$\alpha(t,T)=\sigma^2(T-t)+\sigma\gamma_t$$&#xA;Then by Ito's Lemma&#xA;$$d_tP(t,T)=P(t,T)\Big(-\sigma(T-t)dW_t+(r_t-\sigma(T-t)\gamma_t)dt\Big)\tag{2}$$&#xA;My question is, how do we get from (1) to (2)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have attempted the following&#xA;$$P(t,T)=e^{-X_t}$$&#xA;$$X_t=\int_t^Tf(0,u)du+\int_0^t\int_t^T\alpha(s,u)duds+\sigma(T-t)W_t$$&#xA;\begin{align}&#xA;\frac{d}{dt}\int_0^t\int_t^T\alpha(s,u)duds&amp;amp;=\int_0^t\bigg(\frac{\partial}{\partial t}\int_t^T\alpha(s,u)ds\bigg)ds+\int_t^T\alpha(t,u)du\\&#xA;&amp;amp;=-\int_0^t\alpha(s,t)ds+\int_t^T\alpha(t,u)du\\&#xA;\end{align}&#xA;\begin{align}&#xA;dX_t&amp;amp;=-f(0,t)dt-\int_0^t\alpha(s,t)ds+\int_t^T\alpha(t,u)du-\sigma W_tdt+\sigma(T-t)dW_t\\&#xA;&amp;amp;=\bigg(\int_t^T\alpha(t,u)du-r_t\bigg)dt+\sigma(T-t)dW_t&#xA;\end{align}&#xA;\begin{align}&#xA;d_tP(t,T)&amp;amp;=-P(t,T)dX_t+\frac{1}{2}P(t,T)\sigma^2 (T-t)^2dt\\&#xA;&amp;amp;=-P(t,T)\Bigg(\bigg(\int_t^T\alpha(t,u)du-r_t\bigg)dt+\sigma(T-t)dW_t\Bigg)+\frac{1}{2}P(t,T)\sigma^2 (T-t)^2dt\\&#xA;&amp;amp;=P(t,T)\Bigg(\bigg(r_t-\int_t^T\alpha(t,u)du+\frac{1}{2}\sigma^2 (T-t)^2\bigg)dt-\sigma(T-t)dW_t\Bigg)&#xA;\end{align}&#xA;Thus if I have been correct so far, it would imply that&#xA;$$\int_t^T\alpha(t,u)du-\frac{1}{2}\sigma^2 (T-t)^2=\sigma(T-t)\gamma_t\tag{3}$$&#xA;with the change of measure satisfying the condition&#xA;$$\alpha(t,T)=\sigma^2(T-t)+\sigma\gamma_t$$&#xA;I am unable to show the equality in (3), that is if I haven't made any mistakes in the previous working.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help is appreciated.&lt;/p&gt;&#xA;" OwnerUserId="24781" LastActivityDate="2016-10-23T15:12:55.857" Title="Simple HJM model, differentiating the bond price" Tags="&lt;fixed-income&gt;&lt;stochastic-calculus&gt;&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30685" PostTypeId="1" CreationDate="2016-10-23T12:23:45.803" Score="-1" ViewCount="73" Body="&lt;p&gt;A Dealing Certificate practice question&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is a principal doing if he 'insists on a name' at the original price?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Answer: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;He refuses the broker's compensation and demands that the transaction is concluded at the agreed price with the same counterparty&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A) I can't understand why someone would refuse fair compensation if a transaction is no longer possible and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;B) What would be the point if the counterparty is unwilling or unable to complete the transaction&lt;/p&gt;&#xA;" OwnerUserId="24848" LastActivityDate="2017-07-21T02:51:32.563" Title="Why would a principal 'insist on a name' at the original price" Tags="&lt;self-study&gt;&lt;broker&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30686" PostTypeId="1" AcceptedAnswerId="30763" CreationDate="2016-10-23T12:43:44.100" Score="0" ViewCount="746" Body="&lt;p&gt;Assuming that time period used to calculate the beta and correlation between an index and an asset is the same, is it possible to observe low beta while having high correlation? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If yes, how would you explain it? &lt;/p&gt;&#xA;" OwnerUserId="19096" LastEditorUserId="19096" LastEditDate="2016-10-23T13:52:10.773" LastActivityDate="2016-11-03T10:15:50.680" Title="Low beta and high correlation" Tags="&lt;portfolio-management&gt;&lt;correlation&gt;&lt;beta&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30687" PostTypeId="1" CreationDate="2016-10-23T14:26:42.710" Score="1" ViewCount="243" Body="&lt;p&gt;Are the log-periodic power law models used to predict financial market crashes continuous or discrete-time processes?&lt;/p&gt;&#xA;" OwnerUserId="24958" LastActivityDate="2017-11-20T05:29:50.313" Title="Log-periodic power law model: is it a continuous or discrete-time process?" Tags="&lt;time-series&gt;&lt;finance&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30689" PostTypeId="2" ParentId="30684" CreationDate="2016-10-23T14:55:21.700" Score="2" Body="&lt;p&gt;Identity $(3)$ obviously holds if $$\alpha(t, T) = \sigma^2(T-t) +\sigma \gamma_t,$$&#xA;since&#xA;\begin{align*}&#xA;\int_t^T \alpha(t, u)du &amp;amp;= \int_t^T\left(\sigma^2(u-t) +\sigma \gamma_t \right)du\\&#xA;&amp;amp;=\frac{1}{2}\sigma^2(T-t)^2 + \sigma \gamma_t (T-t).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-10-23T15:12:55.857" LastActivityDate="2016-10-23T15:12:55.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30694" PostTypeId="2" ParentId="30685" CreationDate="2016-10-23T18:37:04.887" Score="0" Body="&lt;p&gt;I am not familiar with this exam. But I think he is saying &quot;instead of you the broker giving me money in compensation, give it to the counterparty and ask the counterparty to go through with the original deal plus compensation from you&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example: Principal A would sell at 10. Broker tells B, who agrees to buy at 10. But deal is no longer available. Broker tells B I can arrange another deal with C at 10.5 and in addition give you compensation of 0.5. B refuses and insists on deal with A. Broker goes back to A who is now willing to sell for 10.51, so broker arranges for deal at 10 between A and B, with A receiving 0.51 compensation from broker.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The point is simply that compensation that will &quot;bridge the gap&quot; (i.e approximately 0.5 in this case) can be paid to the seller or to the buyer depending whether the deal is done at the old or the new terms.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-10-23T20:21:23.197" LastActivityDate="2016-10-23T20:21:23.197" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30695" PostTypeId="1" CreationDate="2016-10-23T21:25:35.390" Score="2" ViewCount="198" Body="&lt;p&gt;I would like to draw some general conclusions for the effect of stochasticity of interest rate on the implied volatility of a European call of a stock. Below I show, trivially, the implied volatility of a European call on a cash account with stochastic interest rate is higher than one with the same expected discount factor if the interest rate is independent of the stock price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is: what can we say in general terms about the relative magnitudes of the implied volatility when the interest rate is stochastic?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Consider a European call on a cash account of one dollar with a stochastic interest rate. Let the stochastic discount factor be $d$&#xA;\begin{align*}&#xA;C(K) &amp;amp;:= E\big[d(d^{-1}-K)_+\big] = E\big[(1-Kd)_+\big] \\&#xA;&amp;amp;\ge  \big(1-KE[d]\big)_+ = E[d]\bigg(\frac1{E[d]}-K\bigg)_+ =: C_0(K),&#xA;\end{align*}&#xA;$C_0(K)$ stands for the call price when the interest rate is not stochastic but with the same expected discount factor.&lt;/p&gt;&#xA;" OwnerUserId="6686" LastEditorUserId="6686" LastEditDate="2016-10-25T19:30:19.553" LastActivityDate="2016-10-25T19:30:19.553" Title="Implied Equity Volatility under Stochastic Interest Rate" Tags="&lt;interest-rates&gt;&lt;stochastic-processes&gt;&lt;implied-volatility&gt;" AnswerCount="0" CommentCount="7" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30697" PostTypeId="2" ParentId="16207" CreationDate="2016-10-23T22:33:49.090" Score="1" Body="&lt;p&gt;This question complicates a simple issue. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Model &lt;em&gt;e.g. Italian sovereign&lt;/em&gt; as a credit, and then treat the spread either against Germany or IRS curve, and stress as you would any financial/non-financial credit risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The underlying benchmark curve would naturally fall onto the interest rate risk.&lt;/p&gt;&#xA;" OwnerUserId="21023" LastActivityDate="2016-10-23T22:33:49.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30700" PostTypeId="2" ParentId="30687" CreationDate="2016-10-23T22:59:34.647" Score="1" Body="&lt;p&gt;The model is continuous in t, but you can use is as an approximation (with discrete prices as inputs) without adjustments.  &lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2016-10-23T22:59:34.647" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30701" PostTypeId="2" ParentId="30674" CreationDate="2016-10-23T23:53:46.583" Score="1" Body="&lt;p&gt;The question should be clearer. At first it wasn't even obvious what method you were referring to, hence Alex clarified that. But there are many variations of this method too. Then for example, what is $\rho$ ? Just because you may know what it refers to, it doesn't mean others do immediately. Because looking at the HW paper Alex provided for example, there's no mention of  $\rho$. Looking further I guess I found what you mean (the ratio of the average spacing to the asset spacing at each time-step), but you should've stated it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then to the question itself, the 2 or 3 papers I've now seen on this all state that no, they are not the same, with each progressing time step you have to use more discretized average states/values. Which is logical because as the tree's asset range expands, so should the possible average range. You should just make sure that at every time step this range covers the maximum and minimum possible average, based on the asset values the tree has taken thus far (plus the running average in your case).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Funnily enough the first result that comes up searching for forward shooting grid method is a matlab code that implements it for arithmetic Asians, albeit with no running average. This page though seems to have been taken down recently, maybe your supervisor owns it? :) Of course there is still the cached version...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, it may help you indirectly if I told you  the right price for this option is 0.11274 (calculated with an equivalent PDE method). As you increase the number of time periods in the lattice you should be converging to that, otherwise something's wrong.&lt;/p&gt;&#xA;" OwnerUserId="19373" LastEditorUserId="19373" LastEditDate="2016-10-24T11:23:32.013" LastActivityDate="2016-10-24T11:23:32.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30702" PostTypeId="1" CreationDate="2016-10-24T00:27:58.163" Score="2" ViewCount="672" Body="&lt;p&gt;We have the following single-factor HJM model&#xA;$$d_tf(t,T)=\sigma(t,T)dW_t+\alpha(t,T)dt$$&#xA;$$f(t,T)=f(0,T)+\int_0^t\sigma(s,T)dW_s+\int_0^t\alpha(s,T)ds$$&#xA;The discounted T bond is then&#xA;\begin{align}&#xA;Z(t,T)&amp;amp;=\exp-\bigg(\int_0^Tf(0,u)du+\int_0^t\int_s^T\sigma(s,u)dudW_s+\int_0^t\int_s^T\alpha(s,u)duds\bigg)\\&#xA;&amp;amp;=\exp\bigg(-\int_0^Tf(0,u)du+\int_0^t\underbrace{-\int_s^T\sigma(s,u)du}_{\Sigma(s,T)}dW_s-\int_0^t\int_s^T\alpha(s,u)duds\bigg)&#xA;\end{align}&#xA;By Ito's Lemma&#xA;$$d_tZ(t,T)=Z(t,T)\Bigg(\bigg(\frac{1}{2}\Sigma^2(t,T)-\int_t^T\alpha(t,u)du\bigg)dt+\Sigma(t,T)dW_t\Bigg)$$&#xA;My question is, how was Ito's Lemma applied to the term $\int_0^t\int_s^T\sigma(s,u)dudW_s$, which contains an integral of Brownian motion?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Claus Munk's Fixed Income Modelling proves the following stochastic Leibniz rule on page 57-58&#xA;$$Y_t=\int_t^Tf(0,u)du+\int_t^T\int_0^t\alpha(s,u)dsdu+\int_t^T\int_0^t\sigma(s,u)dW_sdu$$&#xA;$$dY_t=\bigg(\int_t^T\alpha(t,u)du-f(t,t)\bigg)dt+\bigg(\int_t^T\sigma(t,u)du\bigg)dW_t$$&#xA;however due to the different limits in the integrals, I am unable to extrapolate from Munk's example to solve my question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help is appreciated.&lt;/p&gt;&#xA;" OwnerUserId="24781" LastEditorUserId="24781" LastEditDate="2016-10-24T06:27:42.793" LastActivityDate="2016-10-24T06:27:42.793" Title="Stochastic Leibniz rule" Tags="&lt;fixed-income&gt;&lt;stochastic-calculus&gt;&lt;itos-lemma&gt;&lt;heath-jarrow-morton&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30703" PostTypeId="1" AcceptedAnswerId="31547" CreationDate="2016-10-24T00:51:11.973" Score="3" ViewCount="102" Body="&lt;p&gt;I'm currently dealing with the following problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using lasso regressions to model hedge fund returns and understand their exposures. The idea being, that if their returns are simply due to factors, there is no reason to pay 2&amp;amp;20 and one should simply buy those factor exposures from the cheapest provider (etf, smart beta fund, etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Running the regressions and looking at the R^2 helps but seems unsatisfactory to me as regressions with enough possible factors will overfit and spuriously explain everything. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recently I've been trying to cross-validate by training the regression on say 8 years of data and then testing the predicted results for 2 or more out of sample years. I feel there has to be a more rigorous way than this naive leave one out approach, especially keeping in mind that many managers have short track-records.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any advice? Would something like k-folds work well for this type of time-series data?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;p.s. I'm using R by the way so any applied suggestions would be helpful. &lt;/p&gt;&#xA;" OwnerUserId="19520" LastActivityDate="2016-12-16T21:28:28.113" Title="How to Cross-Validate whether fund returns are due to static factor exposures?" Tags="&lt;factor-models&gt;&lt;factor-loading&gt;&lt;hedge-fund&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30704" PostTypeId="2" ParentId="30674" CreationDate="2016-10-24T01:54:22.923" Score="-1" Body="&lt;p&gt;I don't know the method by Barraquand and Pudet. But usually in this kind of method all the discretized average values are of the same form for each time step. For example in Hull and White they are all of the form $S_0 e^{mh}$ where h is a constant and $m=\cdots-2,-1,0,1,2,\cdots$. However the range of values which can occur (i.e. the range of $m$) increases at each time step (lower values as well as higher values than were possible in the previous time step can occur in the next time step. In the first step only $m=0$ can occur).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example is given in this paper by  &lt;a href=&quot;http://quantlabs.net/academy/download/free_quant_instituitional_books_/[The%20Journal%20of%20Derivatives,%20Hull]%20Efficent%20Procedures%20for%20Valuing%20European%20and%20American%20Path-Dependent%20Options.pdf&quot; rel=&quot;nofollow&quot; title=&quot;link&quot;&gt;Hull and White (1993)&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-10-24T02:24:37.773" LastActivityDate="2016-10-24T02:24:37.773" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30705" PostTypeId="1" AcceptedAnswerId="30707" CreationDate="2016-10-24T08:53:47.257" Score="2" ViewCount="1893" Body="&lt;p&gt;I'm reviewing stuff from the past and I'm very confused all of a sudden. Some verification would help about the following.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;\mathbb{E}[e^{\sigma W(t)}|{\cal F}_s] = &#xA;\mathbb{E}[e^{\sigma (W(t) - W(s) + W(s))}|{\cal F}_s] = &#xA;\mathbb{E}[e^{\sigma (W(t) - W(s))}|{\cal F}_s]e^{W(s)}&#xA;$$&lt;/span&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;=\mathbb{E}[e^{\sigma (W(t) - W(s))}]e^{W(s)}&#xA;=\frac{1}{2}\sigma^2 (t-s) e^{W(s)}&#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this true?&lt;/p&gt;&#xA;" OwnerUserId="19502" LastEditorUserId="39066" LastEditDate="2019-03-07T09:17:24.920" LastActivityDate="2019-03-07T09:17:24.920" Title="Conditional expectation of a geometric brownian motion" Tags="&lt;martingale&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="30707" PostTypeId="2" ParentId="30705" CreationDate="2016-10-24T09:10:41.050" Score="3" Body="&lt;p&gt;We have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\sigma \left( W_t - W_s \right) \sim \mathcal{N} \left( 0, \sigma^2 (t - s) \right).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $X \sim \mathcal{N} \left( 0, \xi^2 \right)$, then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\mathbb{E} \left[ e^{X} \right] &amp;amp; = &amp;amp; \frac{1}{\sqrt{2 \pi} \xi} \int_\mathbb{R} \exp \left\{ x -\frac{x^2}{2 \xi^2} \right\} \mathrm{d}x\\&#xA;&amp;amp; = &amp;amp; \frac{1}{\sqrt{2 \pi} \xi} \int_\mathbb{R} \exp \left\{ -\frac{x^2 - 2 x \xi^2 \pm \xi^4}{2 \xi^2} \right\} \mathrm{d}x\\&#xA;&amp;amp; = &amp;amp; \frac{1}{\sqrt{2 \pi} \xi} e^{\xi^2 / 2} \int_\mathbb{R} \exp \left\{ -\frac{\left( x - \xi^2 \right)^2}{2 \xi^2} \right\} \mathrm{d}x\\&#xA;&amp;amp; = &amp;amp; e^{\xi^2 / 2},&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where we recognize the integrand in the second last line as the density of of a $\mathcal{N} \left( \xi^2, \xi^2 \right)$ normal random variable which integrates to one. Thus&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathbb{E} \left[ e^{\sigma \left( W_t - W_s \right)} \right] = \exp \left\{ \frac{1}{2} \sigma^2 (t - s) \right\}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your other steps are correct, i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathbb{E} \left[ \left. e^{W_t} \right| \mathcal{F}_s \right] = \exp \left\{ W_s + \frac{1}{2} \sigma^2 (t - s) \right\}&#xA;\end{equation}&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2016-10-24T09:10:41.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30709" PostTypeId="1" AcceptedAnswerId="30710" CreationDate="2016-10-24T09:36:32.960" Score="0" ViewCount="624" Body="&lt;p&gt;The payoff function of a call is $f(S_T, K) = (S_T - K)^+$, so the expected payoff should allow me to value the price of this call.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\mathbb{E}[f(S_T, K)] = \mathbb{E}[(S_T - K)^+] = \mathbb{E}[(S_T - K) \cdot \mathbb{1}(S_T - K &amp;gt; 0)]&#xA;$$&#xA;$$&#xA;= e^{-rT} (S_T - K) \mathbb{E}[\mathbb{1}(S_T - K &amp;gt; 0)]&#xA;$$&#xA;$$&#xA;= e^{-rT} (S_T - K) \mathbb{P}[(S_T - K &amp;gt; 0)]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the question is simplified to calculating the probability that $S_T$ would be greater than $K$.&#xA;$$&#xA;\mathbb{P}[(S_T - K &amp;gt; 0)] = \mathbb{P}[(S_T &amp;gt; K)]&#xA;$$&#xA;$$&#xA;= \int_K^{\infty} dx&#xA;$$&#xA;where $dx = dS_T = \mu S_0 dt + \sigma S_0 dW$&#xA;$$&#xA;= \int_K^{\infty} \mu S_0 dt + \sigma S_0 dW&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not think this is the correct way to go, and I would appreciate any input on this matter. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="19502" LastActivityDate="2016-10-24T09:53:56.717" Title="Derivation of Black Scholes using expected payoff" Tags="&lt;black-scholes&gt;" AnswerCount="1" CommentCount="3" ClosedDate="2016-10-26T18:19:25.883" ContentLicense="CC BY-SA 3.0" />
  <row Id="30710" PostTypeId="2" ParentId="30709" CreationDate="2016-10-24T09:53:56.717" Score="0" Body="&lt;p&gt;You know the solution to the SDE&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathrm{d}S_t = \mu S_t \mathrm{d}t + \sigma S_t \mathrm{d}W_t&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;S_T = S_0 \exp \left\{ \left( \mu - \frac{1}{2} \sigma^2 \right) T + \sigma W_T \right\}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, $W_T \sim \mathcal{N}(0, T)$, so&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;S_T &amp;gt; K \qquad \Leftrightarrow \qquad S_0 \exp \left\{ \left( \mu - \frac{1}{2} \sigma^2 \right) T + \sigma \sqrt{T} X \right\} &amp;gt; K,&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $X \sim \mathcal{N}(0, 1)$. Rearranging yields&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;X &amp;gt; \frac{1}{\sigma \sqrt{T}} \left( \ln \left( \frac{K}{S_0} \right) - \left( \mu - \frac{1}{2} \sigma^2 \right) T \right) := \alpha&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, $\mathbb{P} \left\{ X &amp;gt; \alpha \right\} = \mathbb{P} \left\{ X &amp;lt; -\alpha \right\}$ and thus $\mathbb{P} \left\{ S_T &amp;gt; K \right\} = \mathbb{P} \left\{ X &amp;lt; -\alpha \right\} = \mathcal{N}(-\alpha)$.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2016-10-24T09:53:56.717" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30711" PostTypeId="2" ParentId="30705" CreationDate="2016-10-24T09:56:08.993" Score="3" Body="&lt;p&gt;Depending on how well you are familiar with stochastic calculus, another way of getting to this result is to recognise that:&#xA;$$ e^{\sigma W_t} = \mathcal{E}[\sigma W_t] e^{\frac{1}{2}\sigma^2 t} $$&#xA;where &#xA;$$ \mathcal{E}(X_t) = \exp\left(X_t - \frac{1}{2}\langle X \rangle_t\right) $$&#xA;denotes the Doléans-Dade exponential (stochastic exponential) of an Itô process $X_t$, which is well-known to verify&#xA;the martingale property i.e.&#xA;$$ \Bbb{E}_0\left[\mathcal{E}(X_t)\right] = \exp(X_0)$$&#xA;(of course the proof relies on @LocalVolatility's answer)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using this result along with the fact that $W_0=0$ by definition for a standard Brownian motion, one gets:&#xA;$$&#xA;\Bbb{E}_0 \left[ e^{\sigma W_t} \right] = \underbrace{\Bbb{E}_0 \left[ \mathcal{E}(\sigma W_t) \right]}_{=\exp(\sigma W_0)=1} \Bbb{E}_0 \left[ e^{\frac{1}{2}\sigma^2 t} \right] = e^{\frac{1}{2}\sigma^2 t}&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-10-24T17:43:11.327" LastActivityDate="2016-10-24T17:43:11.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30715" PostTypeId="1" CreationDate="2016-10-24T16:18:45.277" Score="2" ViewCount="996" Body="&lt;p&gt;My object of research is corn futures:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is well known that corn futures expire 5 times per year: March, May, July, September and December. Due to their finite life that is limited by their maturity, these events are adversely influencing price time series and makes futures raw data unsuitable for long-term statistical analytics. To overcome this issue, historical raw futures contract data (date, price, open interest) has to be modified and rolled with the aim to create a continuous time series. Considering the existence of different methodologies to select roll dates before a contract’s expiration (see several internet sources and articles), I choose the approach to select roll dates for corn futures based on market movements of open interest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consequently, I used two separate individual future price time series to finally construct an artificial continuous return time series: the nearby contract, meaning the contract nearest expiry (= front month – corn C1 contract) and the first-deferred contract, meaning the next contract with the second-shortest time to expiry (= back month – corn C2 contract). To select the roll date, I plan to implemented an algorithm that depending of the level of open interest shifting from one contract to the other splices together the two successive contracts around the last trading day. According to the open interest criterion, the shift between the two series is carried out when the open interest value of the first-deferred contract is consistently greater than the nearby one. This indicated that market participants (liquidity) are leaving the nearby and trading the first-deferred contract.  In order to construct a continuous price series, prices should be taken from the contract with consistently higher levels of open interest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far so good. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question now: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;How to implement the algorithm switch from one to the other and to stick the contracts time series together practically?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Do I understand right, that the nearby (C1) contract dominates the price time series and only around last trading day of the nearby with a decline in open interest I should switch to the first-deferred? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How to implement that switch in Excel? Are there special constraints? Or is it “easily” done with an IF-Formular like “ IF OI is greater in the NB, use price of NB; if not take the first-def. price?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Please find below my excel sheet with the time series and all relevant data:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/pqBcT.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/pqBcT.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;Thank you for your comments and help on that issue.&lt;/p&gt;&#xA;" OwnerUserId="24751" LastEditorUserId="24751" LastEditDate="2016-10-26T18:38:10.217" LastActivityDate="2016-10-26T18:38:10.217" Title="How to construct a continuous price time series out of futures raw data in Excel?" Tags="&lt;time-series&gt;&lt;futures&gt;&lt;continuous-time&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30716" PostTypeId="1" CreationDate="2016-10-24T18:15:03.617" Score="1" ViewCount="3961" Body="&lt;p&gt;A prior post had stated how to get a list of all common stocks traded on NYSE, NASDAQ and AMEX - via NASDAQ site at &lt;code&gt;ftp.nasdaqtrader.com&lt;/code&gt; in &lt;code&gt;SymbolDirectory&lt;/code&gt; and the two files: &lt;code&gt;nasdaqlisted.txt&lt;/code&gt; and &lt;code&gt;otherlisted.txt&lt;/code&gt; (see &lt;a href=&quot;https://quant.stackexchange.com/questions/1640/where-to-download-list-of-all-common-stocks-traded-on-nyse-nasdaq-and-amex&quot;&gt;Where to download list of all common stocks traded on NYSE, NASDAQ and AMEX?&lt;/a&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In that same FTP location I see now a file named &lt;code&gt;nasdaqtraded.txt&lt;/code&gt; at &#xA;&lt;code&gt;ftp.nasdaqtrader.com/symboldirectory&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know if the &lt;code&gt;nasdaqtraded.txt&lt;/code&gt; file have all the same info &lt;code&gt;nasdaqlisted.txt&lt;/code&gt; and &lt;code&gt;otherlisted.txt&lt;/code&gt; has? Does it have more or less info? Updated daily like the other two? It'd be easier to look at this one file than parsing two files to get a list of all common stock. I cannot find info on this file at NASDAQ so not sure of it's purpose.&lt;/p&gt;&#xA;" OwnerUserId="24975" LastActivityDate="2016-11-18T01:01:05.187" Title="Is NASDAQ file &quot;nasdaqtraded.txt&quot; a list of all common stocks traded on NYSE, NASDAQ and AMEX?" Tags="&lt;data&gt;&lt;market-data&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30717" PostTypeId="1" CreationDate="2016-10-24T19:18:37.467" Score="-1" ViewCount="129" Body="&lt;p&gt;Using python 3.5&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In yahoo finance I downloaded banknifty .csv&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/XUfjs.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/XUfjs.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the sheet needs to depict three coin toss per day. At random time . However i couldnt automate the date to repeat three times before next date kicks in.help please&lt;/p&gt;&#xA;" OwnerUserId="24976" LastEditorUserId="24976" LastEditDate="2016-10-26T06:25:52.210" LastActivityDate="2016-10-26T06:25:52.210" Title="Yahoo finance CSV Thursday only data" Tags="&lt;python&gt;" AnswerCount="1" CommentCount="5" ClosedDate="2016-10-25T09:17:35.630" ContentLicense="CC BY-SA 3.0" />
  <row Id="30719" PostTypeId="1" CreationDate="2016-10-24T21:14:52.190" Score="2" ViewCount="507" Body="&lt;p&gt;There are multiple sources that describe using a nonlinear optimization to risk budget a portfolio, with a portfolio target volatility. For example, see pages 16 and 17 of &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2673124&quot; rel=&quot;nofollow&quot;&gt;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2673124&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given assets 1, ... , n, risk budgets $s_1,...,s_n$ and weights $w_i,...,w_n$, maximising:&#xA;$$&#xA;\sum_{i=1}^{n} s_i . log(w_i)&#xA;$$&#xA;subject to &#xA;$$&#xA;\sqrt{w \Sigma w} \leq \sigma_{tgt}&#xA;$$&#xA;will give weights such that  each assets 'risk contribution', will be proportional to its risk budget:&#xA;$$&#xA;w_i . MCR_i \propto s_i&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to adapt this to set $w_i$ $\propto$ $s_i / v_i$, rather than $w_i . MRC(w_i)$ $\propto$ $s_i$, where $v_i$ is asset i's volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible using nonlinear programming, and if so what should my objective function be?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I could do this by just setting the weights and then scaling them to target vol, but I have various constraints that prevent this)&lt;/p&gt;&#xA;" OwnerUserId="24977" LastActivityDate="2016-10-31T06:29:23.640" Title="How can I set portfolio weights inverse to volatility, with constraints and target volatility, using nonlinear optimization?" Tags="&lt;volatility&gt;&lt;portfolio-optimization&gt;&lt;asset-allocation&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30720" PostTypeId="2" ParentId="30669" CreationDate="2016-10-24T23:09:25.110" Score="1" Body="&lt;p&gt;Using exponents / root will solve nagative values&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import math&#xA;&#xA;log_diff2010 = math.log(47.43) - math.log(49.07)&#xA;log_diff105 = (math.log(41.77) - math.log(47.43))&#xA;print log_diff105,(log_diff105**2)**.5,(log_diff2010**2)**.5,(log_diff2010**2)**.5&#xA;log_diffabs = math.log( (log_diff105**2)**.5) - math.log( (log_diff2010**2)**.5)&#xA;print log_diffabs&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="24963" LastActivityDate="2016-10-24T23:09:25.110" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30721" PostTypeId="2" ParentId="30717" CreationDate="2016-10-24T23:57:28.787" Score="1" Body="&lt;p&gt;Without your code it isn't clear, however here are 3 options for grabbing the day from a date in a string:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;from datetime import datetime&#xA;import calendar&#xA;d='10/24/2016' #Oct 24th, 2016&#xA;m_date=datetime.strptime(d,&quot;%m/%d/%Y&quot;)&#xA;print &quot;Your date:&quot;,m_date&#xA;print &quot;Option 1: &quot;,calendar.day_name[m_date.weekday()]&#xA;print &quot;Option 2: &quot;,datetime.today().weekday()&#xA;print &quot;Option 3: &quot;,datetime.today().strftime(&quot;%A&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="24963" LastActivityDate="2016-10-24T23:57:28.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30722" PostTypeId="1" CreationDate="2016-10-25T02:24:31.467" Score="9" ViewCount="476" Body="&lt;p&gt;I've run an ARMA(1, 1)-GARCH(1, 1) model with normal density on log returns for twelve stocks. I computed the one-step-ahead out of sample forecast for daily volatility on a rolling windows for 500 iterations ($h^2_{t|t-1}$) and compared them against Parkinson's observed daily volatility ($\hat{\sigma}^2_{park, \ t |t -1}$). The latter was computed on a window comprising the last ten days.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Estimating volatility with parkinson's formula:&#xA;# where daily is a xts object with the prices&#xA;library(TTR)&#xA;volatility(daily, n = 10, calc = &quot;parkinson&quot;, N = 1, mean0 = FALSE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'd like to compare the one-step ahead forecast made at moment t-1, ($h^2_{t|t-1}$), and the volatility observed on time t, ($\hat{\sigma}^2_t$). A regression forecast ~ observed is unbiased if both the intercept is zero and the slope equals one. I don't want to run a formal test to avoid dealing with heteroskedasticity, correlation and other obstacles, but the plots talk by themselves:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/jZQuR.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/jZQuR.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, you can overlay both observed versus forecasts and see the bias.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/5Mag6.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/5Mag6.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm comparing $h^2_{t|t-1}$ versus $\hat{\sigma}^2_t$ because their square roots would be biased due to Jensen's inequality. I know Parkinson's is a noisy estimator for volatility, but I'm impressed the out of sample forecasts of a basic GARCH(1, 1) are flagged as biased in many stocks. It's simply too suspicious!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone here have an idea what's going on? Does GARCH(1, 1) produce biased forecasts for every stocks or are the observed volatility estimators biased? How could I check and eventually fix the latter without high intraday data?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;A sidenote on Parkinson's volatility&lt;/strong&gt;&#xA;Unfortunately, I've got no access to high frequency data and I can't use the all superior Anderson's RV (the sum of squared intraday returns). I'm therefore forced to rely on low frequency estimators for the observed volatility such as close to close (sample standard deviation on returns), Parkinson's low-high, Garman-Klass, Rogers-Satchell, Yang-Zhang and Yang-Zhang corrected by Garman-Klass. Their definitions can be found in &lt;a href=&quot;https://cran.r-project.org/web/packages/TTR/TTR.pdf&quot; rel=&quot;noreferrer&quot;&gt;enter link description here&lt;/a&gt;. Comparing the forecasts from my GARCH model to any of these estimates for observed volatility still shows bias. Taking for example the following stock, the bias practically doesn't change for different estimates of observed volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/guYz2.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/guYz2.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="8149" LastEditorUserId="8149" LastEditDate="2016-10-27T01:12:49.063" LastActivityDate="2016-10-27T01:12:49.063" Title="Why are my GARCH forecasts biased?" Tags="&lt;volatility&gt;&lt;equities&gt;&lt;time-series&gt;&lt;garch&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30724" PostTypeId="2" ParentId="934" CreationDate="2016-10-25T09:59:03.043" Score="1" Body="&lt;p&gt;from our experience, working on daily time frame doesn't need such non-linear approach (NN, RNN, SVM,...)&#xA;Daily open and close are so informative prices/volume that simple VARMA (linear model) explain dynamic stocks prices with great accuracy...but wr have to recognize that puting foots in intraday is a completely different story. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;we have to admit that using dynamic non linear approach has a real value compared to classic linear econometric/probabilistics models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;despite that, we continue to prevent a maximum as we can of such non-linear approach, because what is well understood must be ablle to be explained simply, and those kind of models exhibits too much 'hidden' features.&lt;/p&gt;&#xA;" OwnerUserId="24988" LastActivityDate="2016-10-25T09:59:03.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30726" PostTypeId="1" CreationDate="2016-10-25T12:10:16.750" Score="1" ViewCount="197" Body="&lt;p&gt;Assume that the underlying $S$ is some index, hence the risk-return $\mu=0$, where $S$ meets&#xA;$$d S = \sigma S d W_t.$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $V$ denote the price of the corresponding call option. To construct the related BS formula,  I construct a portfolio $\Pi=V-\Delta S$, after setting a correct value of $\Delta$, I want the portfolio to be risk-free. That is $$d \Pi = r\Pi d t= r(V-\Delta S) d t,$$ where $r$ is risk-free rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;hence by the Ito formula, I can get the BS-equation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, someone told me that the identity $d \Pi =  r(V-\Delta S) d t$ should be $$d \Pi = (r*V-\mu*\Delta S) d t,$$ and then get another equation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since in my opinion, in the risk-neutral world, $\mu$ turns to be $r$ after applying the Girsonov transformation, and  making the portfolio to be risk-free is under risk-neutral world. I agree with the first identity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;So my question is which one is correct?  If is the latter one, what's meaning of risk-neutral pricing?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much!&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Added 2016/10/26 10:39AM(+8)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for @MJ73550. I am sure the first one is right now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if we distinguish the funding and lending rate for unsecurities (denote as $r_F$) and stock collateral(denote as $r_R$). Then maybe the identity $d \Pi =  r(V-\Delta S) d t$ should be $$d \Pi = (r_F*V-r_R*\Delta S) d t,$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is this equation right?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks again.&lt;/p&gt;&#xA;" OwnerUserId="24374" LastEditorUserId="24374" LastEditDate="2016-10-26T02:49:22.547" LastActivityDate="2016-11-25T16:56:51.017" Title="The meaning of risk-neutral pricing?" Tags="&lt;finance&gt;&lt;pricing&gt;&lt;quants&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30727" PostTypeId="2" ParentId="30726" CreationDate="2016-10-25T12:51:55.117" Score="0" Body="&lt;p&gt;First equation is the right one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it won't help you to understand what happens behind risk-neutral pricing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed you just write that you invest in cash and stocks but you did not write self-financing conditions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) Let $V_t$ be the value of the call,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) Let $\Delta_t$ be your delta of your delta hedge,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(3) Let $\Pi_t$ your cash remunerated at $r$.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;(3) $\Leftrightarrow d \Pi_t = r\Pi_t dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1)+(2)+(3) $\Leftrightarrow V_t = \Pi_t + \Delta_t S_t$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If your portfolio is split between cash and collateral.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V_t = \Pi^{cash}_t + \Pi^{collat}_t + \Delta_t S_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;now you have $d\Pi^{cash}_t = r^{cash}_t\Pi^{cash}_t dt$ and $d\Pi^{collat}_t = r^{collat}_t\Pi^{collat}_t dt$&lt;/p&gt;&#xA;" OwnerUserId="20201" LastEditorUserId="20201" LastEditDate="2016-10-26T12:09:34.597" LastActivityDate="2016-10-26T12:09:34.597" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30728" PostTypeId="2" ParentId="30536" CreationDate="2016-10-25T13:09:09.380" Score="0" Body="&lt;p&gt;So to sum up:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a loan/mortgage with a prepayment Option is from the Position of the Lender:&#xA; - Long in a Receiver swap&#xA; - Short in a Receiver Swaption?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or equivalently from the Position of the borrower:&#xA; - Short in a Bond&#xA; - Long in a Call Option on that bond --&gt; Long in a Receiver Swaption&lt;/p&gt;&#xA;" OwnerUserId="24804" LastActivityDate="2016-10-25T13:09:09.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30729" PostTypeId="1" CreationDate="2016-10-25T13:43:46.840" Score="0" ViewCount="864" Body="&lt;p&gt;How is repo rate risk hedged? And is repo rate dv01 the usual greek for this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i am talking about repo risk in a derivative on a bond&lt;/p&gt;&#xA;" OwnerUserId="17348" LastActivityDate="2016-10-30T05:12:50.283" Title="Hedging and measuring repo rate risk" Tags="&lt;hedging&gt;&lt;greeks&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30730" PostTypeId="1" AcceptedAnswerId="30733" CreationDate="2016-10-25T18:35:53.213" Score="8" ViewCount="6618" Body="&lt;p&gt;I want to calculate the variance of&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$I = \int_0^t W_s^2 ds$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was thinking I could define the function $f(t,W_t) = tW_t^2$ and then apply Ito's lemma so I get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f(t,W_t)-f(0,0) = \int_0^t \frac{\partial f}{\partial t}(s,W_s)ds + \int_0^t \frac{\partial f}{\partial x}(s,W_s)dW_s+ \frac{1}{2}\int_0^t \frac{\partial^2 f}{\partial x^2}(s,W_s)ds \\= I + \int_0^t 2sW_sdW_s + \frac{t^2}{2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By rearranging I get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$I = tW_t^2 - \int_0^t 2sW_sdW_s - \frac{t^2}{2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We then get that (I'm not sure here but i think the expectation is zero of any integral w.r.t BM?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbf{E}[I]=\frac{t^2}{2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And variance&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbf{V}[I] = \mathbf{V}[tW_t^2 - \int_0^t 2sW_sdW_s - \frac{t^2}{2}]&#xA;= t^2\mathbf{V}[W_t^2]+\mathbf{E}[(\int_0^t 2sW_sdW_s)^2] \\= 2t^4 + \mathbf{E}[\int_0^t 4s^2W_s^2ds]\quad\text{(Isometry property)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not sure if it is OK to change order of integration and expectation here, but if I do that, I get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbf{V}[I]= 2t^4 + \int_0^t 4s^2\mathbf{E}[W_s^2]ds = 2t^4 + \int_0^t 4s^2\mathbf{E}[W_s^2]ds = 2t^4 + \int_0^t 4s^3ds=3t^4$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the answer says the variance should be $\frac{t^4}{3}$, so I guess I do something wrong?&lt;/p&gt;&#xA;" OwnerUserId="24920" LastEditorDisplayName="user16651" LastEditDate="2016-10-25T22:21:41.930" LastActivityDate="2020-08-09T15:27:24.290" Title="Variance of time integral of squared Brownian motion" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;&lt;variance&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="30731" PostTypeId="2" ParentId="30730" CreationDate="2016-10-25T19:10:06.110" Score="3" Body="&lt;p&gt;A few hints I would like to suggest: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;How is $Var(W_t^2)$ computed? Note that &#xA;\begin{align*}&#xA;W_t^2 = 2\int_0^t W_s dW_s + t.&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;Var(W_t^2) &amp;amp;=E\left(W_t^2-t)^2\right) =2t^2.&#xA;\end{align*}&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Generally, the variance of a sum is not the sum of variances, which only holds for uncorrelated random variables. That is, you also need to compute the expectation&#xA;\begin{align*}&#xA;E\left(W_t^2 \int_0^t 2s W_s dW_s \right) &amp;amp;=4\int_0^ts^2 ds = \frac{4}{3}t^3.&#xA;\end{align*}&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Finally,&#xA;\begin{align*}&#xA;Var(I) &amp;amp;= Var\left(tW_t^2\right) + Var\left(\int_0^t 2s W_s dW_s \right) - 2tE\left(W_t^2 \int_0^t 2s W_s dW_s \right) = \frac{1}{3}t^4.&#xA;\end{align*}&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-10-25T20:48:25.240" LastActivityDate="2016-10-25T20:48:25.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30732" PostTypeId="1" CreationDate="2016-10-25T20:49:56.390" Score="1" ViewCount="67" Body="&lt;p&gt;Monthly returns seems to be the industry standard for everything. Markowitz used monthly returns in his original paper on mean-variance optimization, the efficient frontier, etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Did he ever provide any justification or reasoning for choosing monthly over weekly or daily or yearly? &lt;/p&gt;&#xA;" OwnerUserId="19473" LastActivityDate="2016-10-25T20:49:56.390" Title="Periodicity justification in Markowitz optimization" Tags="&lt;markowitz&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30733" PostTypeId="2" ParentId="30730" CreationDate="2016-10-25T22:15:55.890" Score="5" Body="&lt;p&gt;&lt;strong&gt;Other Way&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;By application of Ito's lemma , we have&#xA;&lt;span class=&quot;math-container&quot;&gt;$$W^4_t=4\int_{0}^{t}W^3_sdW_s+6\int_{0}^{t}W^2_sds\tag 1$$&lt;/span&gt;&#xA;We &lt;a href=&quot;https://quant.stackexchange.com/questions/28412/variance-of-brownian-motion/28421#28421&quot;&gt;know&lt;/a&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\left\{ \begin{align}   &amp;amp;\mathbb{E}\left[ {{W}^{2n+1}}(t)&#xA;\right]=0\,\,\,\,\,\,\,\,\,\,\,\,\,\, \\   &amp;amp; \quad \mathbb{E}\left[&#xA; {{W}^{2n}}(t) \right]=\frac{(2n)!}{{{2}^{n}}n\,!}\,{{t}^{n}} \\&#xA;\end{align} \right.$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;therefore&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\text{Var}(W^4_t)=\mathbb{E}[W^8_t]-\mathbb{E}[W^4_t]^2=105t^4-(3t^2)^2=96t^4\tag 2$$&lt;/span&gt;&#xA;By application of &lt;a href=&quot;https://en.wikipedia.org/wiki/It%C3%B4_isometry&quot; rel=&quot;nofollow noreferrer&quot;&gt;Ito's Isometry&lt;/a&gt;, we have&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\text{Var}\left(4\int_{0}^{t}W^3_sdW_s\right)=16\int_{0}^{t}\mathbb{E}[W^6_s]ds=240\int_{0}^{t}s^3ds=60t^4\tag 3$$&lt;/span&gt;&#xA;on the other hand&#xA;&lt;span class=&quot;math-container&quot;&gt;$$2\text{Cov}\left(4\int_{0}^{t}W^3_sdW_s\,,\,6\int_{0}^{t}W^2_sds\right)=24t^4\quad\text{(Why?)}\tag 4$$&lt;/span&gt;&#xA;Moreover&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\text{Var}(W^4_t)=\text{Var}\left(4\int_{0}^{t}W^3_sdW_s+6\int_{0}^{t}W^2_sds\right)\tag 5$$&lt;/span&gt;&#xA;thus&#xA;&lt;span class=&quot;math-container&quot;&gt;$$96t^4=60t^4+36\text{Var}\left(\int_{0}^{t}W^2_sds\right)+24t^4$$&lt;/span&gt;&#xA;i.e&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\text{Var}\left(\int_{0}^{t}W^2_sds\right)=\frac{1}{3}t^4$$&lt;/span&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorUserId="27947" LastEditDate="2020-08-09T15:27:24.290" LastActivityDate="2020-08-09T15:27:24.290" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="30735" PostTypeId="1" AcceptedAnswerId="30740" CreationDate="2016-10-26T00:07:02.343" Score="1" ViewCount="136" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Let $\lambda$ be a probability measure on $\Omega$ (finite), with filtration $\{\mathcal{F}_t\}$. Define $\nu(X) = \lambda\left(X\frac{d\nu}{d\lambda}\right)$, where $\frac{d\nu}{d\lambda}$ is a random variable i.e., $\nu(\omega) = \lambda(\omega)\frac{d\nu}{d\lambda}(\omega)$, all $\omega\in\Omega$. Show that &#xA;  $$E\nu[X|\mathcal{F_t}] = \frac{E_{\lambda}\left[X\frac{d\nu}{d\lambda}|\mathcal{F_t}\right]}{E_{\lambda}\left[\frac{d\nu}{d\lambda}|\mathcal{F}_t\right]}$$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Recall from the second fundamental theorem of asset pricing $$\frac{d\nu}{d\lambda} = \frac{S_T^{0}}{\lambda(S_T^{0})}$$ if $S_T^{0}$ is a constant then $$\frac{d\nu}{d\lambda} = 1 \ \ \Rightarrow \ \ \lambda = \nu$$ &#xA;The change of measure formula is $$E_{\nu}[X] = E_{\lambda}\left[X\frac{d\nu}{d\mu}\right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For some attainable claim $X$ let $\phi$ be a self financing strategy replicating $X$ then by the first fundamental theorem of asset pricing $$V_t(\phi) = E_{\nu}\left[X\frac{S_t^{0}}{S_T^{0}} |\mathcal{F_t}\right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am pretty sure the result will follow from one of these fundamental theorems of asset pricing but I am not sure where to go from here. Sorry for the messy start, also if you need me to write the three fundamental theorems I would be happy to do so. Any comments or suggestions is greatly appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternative Solution - For all $\omega\in \Omega$, let $\mathcal{F}_t(\omega) = \mathcal{F}_t$ be the partition element containing $\omega$. Then &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;E_{\nu}[X|\mathcal{F}_t](\omega) &amp;amp;= \frac{\sum_{\omega\in\mathcal{F}_t(\omega)} X(\omega)\nu(\omega)}{\sum_{\omega\in\mathcal{F}_t(\omega)} \nu(\omega)}\\&#xA;&amp;amp;= \frac{\sum_{\omega\in\mathcal{F}_t(\omega)} X(\omega)\lambda(\omega)\frac{d\nu}{d\lambda}(\omega)}{\sum_{\omega\in\mathcal{F}_t(\omega)}\lambda(\omega)\frac{d\nu}{d\lambda}(\omega)}\\&#xA;&amp;amp;= \frac{\left(&#xA;\frac{\sum_{\omega\in\mathcal{F}_t(\omega)} X(\omega)\lambda(\omega)\frac{d\nu}{d\lambda}(\omega)}{\sum_{\omega\in\mathcal{F}_t(\omega)} \lambda(\omega)} \right )}{\left(\frac{\sum_{\omega\in\mathcal{F}_t(\omega)} \lambda(\omega)\frac{d\nu}{d\lambda}(\omega)}{\sum_{\omega\in\mathcal{F}_t(\omega)} \lambda(\omega)} \right )}\\&#xA;&amp;amp;= \frac{E_{\lambda}\left[X\frac{d\nu}{d\lambda}|\mathcal{F}_t\right](\omega)}{E_{\lambda}\left[\frac{d\nu}{d\lambda}|\mathcal{F}_t\right](\omega)}&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="19002" LastEditDate="2016-11-02T16:14:34.667" LastActivityDate="2016-11-02T16:14:34.667" Title="Formula for conditional expectation. Related to the Fundamental Theorems of Asset Pricing" Tags="&lt;mathematics&gt;&lt;asset-pricing&gt;&lt;finance-mathematics&gt;&lt;financial-engineering&gt;" AnswerCount="1" CommentCount="20" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30736" PostTypeId="1" AcceptedAnswerId="30761" CreationDate="2016-10-26T02:43:34.667" Score="0" ViewCount="161" Body="&lt;p&gt;I am becoming more interested in mortgage valuation and would like some pointers on the basic valuation process for a mortgage. I understand there is likely an entire field of study devoted to valuing mortgages but I am looking to understand the basics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My thoughts so far:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Define starting mortgage financing rate, length of mortgage etc.&lt;/li&gt;&#xA;&lt;li&gt;Monte-Carlo simulate mortgage rates (using which stochastic process?)&lt;/li&gt;&#xA;&lt;li&gt;Within each simulated rate path, if the simulated rate drops to a new low by a certain threshold, assume a refinance at the new lower rate&lt;/li&gt;&#xA;&lt;li&gt;Within each simulated rate path, calculate payments at each time step using Amortization equations and financed rate at that time step&lt;/li&gt;&#xA;&lt;li&gt;Sum payments at each time step for each path, average across all simulated paths, discount to present&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Would something like this work? I guess it still doesn't account for default on the mortgage loan. Any pointers would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="24628" LastEditorUserId="24628" LastEditDate="2016-10-26T03:19:25.357" LastActivityDate="2016-10-27T15:37:00.390" Title="General Framework For Valuing Mortgages" Tags="&lt;simulations&gt;&lt;valuation&gt;&lt;mbs&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30738" PostTypeId="2" ParentId="603" CreationDate="2016-10-26T07:32:35.463" Score="2" Body="&lt;p&gt;You might be conflating two different things:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;autocorrelation in &lt;em&gt;model residuals&lt;/em&gt; in a fixed sample (window) and &lt;/li&gt;&#xA;&lt;li&gt;autocorrelation in &lt;em&gt;forecast errors&lt;/em&gt; across samples (rolling or expanding windows).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;(1) is undesirable as it indicates the model misses a pattern which it should ideally capture. This can be remedied, for example, by changing the model. One may add an ARMA structure to the model's error term (to get ARMA-GARCH from pure GARCH, for example), change the model's autoregressive order, or do some other changes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) can happen by construction and need not indicate any problem with the forecasts or the modelling scheme that is generating them. Indeed, forecast errors of $h$ steps ahead will necessarily be MA($h-1$) processes; see e.g. Diebold &lt;a href=&quot;http://www.ssc.upenn.edu/~fdiebold/Teaching221/Forecasting.pdf&quot; rel=&quot;nofollow&quot;&gt;&quot;Forecasting in Economics, Business, Finance and Beyond&quot;&lt;/a&gt; Chapter 10 &quot;Point Forecast Evaluation&quot;, section 10.1 &quot;Absolute Standards for Point Forecasts&quot; (version of 14 December 2015; the linked version might change over time).&lt;/p&gt;&#xA;" OwnerUserId="19645" LastEditorUserId="19645" LastEditDate="2016-10-26T07:39:59.463" LastActivityDate="2016-10-26T07:39:59.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30739" PostTypeId="2" ParentId="20" CreationDate="2016-10-26T07:39:48.443" Score="1" Body="&lt;p&gt;I am not sure I understand your question, but you might be conflating two different things:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;autocorrelation in &lt;em&gt;model residuals&lt;/em&gt; in a fixed sample (window) and &lt;/li&gt;&#xA;&lt;li&gt;autocorrelation in &lt;em&gt;forecast errors&lt;/em&gt; across samples (rolling or expanding windows).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;(1) is undesirable as it indicates the model misses a pattern which it should ideally capture. This can be remedied, for example, by changing the model. One may add an ARMA structure to the model's error term (to get ARMA-GARCH from pure GARCH, for example), change the model's autoregressive order, or do some other changes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) can happen by construction and need not indicate any problem with the forecasts or the modelling scheme that is generating them. Indeed, forecast errors of $h$ steps ahead will necessarily be MA($h-1$) processes; see e.g. Diebold &lt;a href=&quot;http://www.ssc.upenn.edu/~fdiebold/Teaching221/Forecasting.pdf&quot; rel=&quot;nofollow&quot;&gt;&quot;Forecasting in Economics, Business, Finance and Beyond&quot;&lt;/a&gt; Chapter 10 &quot;Point Forecast Evaluation&quot;, section 10.1 &quot;Absolute Standards for Point Forecasts&quot; (version of 14 December 2015; the linked version might change over time).&lt;/p&gt;&#xA;" OwnerUserId="19645" LastActivityDate="2016-10-26T07:39:48.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30740" PostTypeId="2" ParentId="30735" CreationDate="2016-10-26T09:56:45.127" Score="5" Body="&lt;p&gt;Let define $\mathbb{Q}$ and $\mathbb{P}$ two equivalent probabilities on a filtered space $(\Omega,(\mathcal{F}_t)_{t\geq 0})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let define $Z_T=\frac{d\mathbb{Q}}{d\mathbb{P}}$ restricted to $\mathcal{F}_T$ measurable events.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It means that for $X_T$ being $\mathcal{F}_T$ measurable we have:&#xA;$$\mathbb{E}^{\mathbb{Q}}[X_T] = \mathbb{E}^{\mathbb{P}}\left[Z_TX_T\right]$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Let $t\leq T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We want to define the change of probability measure on $\mathcal{F}_t$.&#xA;i.e we want to find $Z_t$ being $\mathcal{F}_t$ measurable such that for $X_t$ being $\mathbb{F}_t$ measurable, we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}^{\mathbb{Q}}[X_t]= \mathbb{E}^{\mathbb{P}}\left[Z_tX_t\right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By definition of $Z_T$, and since $X_t$ is also $\mathcal{F}_T$ measurable, we have:&#xA;$$\mathbb{E}^{\mathbb{Q}}[X_t]= \mathbb{E}^{\mathbb{P}}\left[Z_TX_t\right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i.e &lt;/p&gt;&#xA;&#xA;&lt;p&gt;for any $X_t$ being $\mathcal{F}_t$ measurable we have $Z_t$ being $\mathcal{F}_t$ measurable such that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}^{\mathbb{P}}[Z_T X_t]=\mathbb{E}^{\mathbb{P}}[Z_t X_t]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so $Z_t = \mathbb{E}^{\mathbb{P}}[Z_T|\mathcal{F}_t]$ by definition of conditional expectation.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Let $Y_T$ being $\mathcal{F}_T$ measurable, then we want to compute $\mathbb{E}^{\mathbb{Q}}[Y_T|\mathcal{F}_t]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We denote $Y_t = \mathbb{E}^{\mathbb{Q}}[Y_T|\mathcal{F}_t]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We look for $Y_t$ such that for any $X_t$ being $\mathcal{F}_t$ measurable, we have :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}^{\mathbb{Q}}[Y_TX_t]=\mathbb{E}^{\mathbb{Q}}[Y_t X_t]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By definition of $Z_T$ we have $\mathbb{E}^{\mathbb{Q}}[Y_TX_t]=\mathbb{E}^{\mathbb{P}}[Z_TY_TX_t]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By definition of $Z_t$ we have $\mathbb{E}^{\mathbb{Q}}[Y_tX_t]=\mathbb{E}^{\mathbb{P}}[Z_tY_tX_t]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}^{\mathbb{P}}[Z_TY_TX_t]=\mathbb{E}^{\mathbb{P}}[Z_tY_tX_t]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and again by definition of conditional expectation, we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}^{\mathbb{P}}[Z_TY_T|\mathcal{F}_t]=Z_tY_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;we can now conclude using the definition of $Y_t$ and $Z_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}^{\mathbb{Q}}[Y_T|\mathcal{F}_t] = \frac{\mathbb{E}^{\mathbb{P}}[Z_TY_T|\mathcal{F}_t]}{\mathbb{E}^{\mathbb{P}}[Z_T|\mathcal{F}_t]}$$&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-10-26T09:56:45.127" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30743" PostTypeId="1" AcceptedAnswerId="30753" CreationDate="2016-10-26T14:15:35.827" Score="6" ViewCount="1982" Body="&lt;p&gt;We know that in the Black-Scholes model, the Vega of a European call option is always positive. This can be proved easily, so my question is not really about the result per se. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem is that I find this result somehow counterintuitive. This is my argument: if an option is out of the money and the volatility rises, then the probability that the option end in the money also grows, so that the price grows, and I find it convincing that the vega should be positive in this case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But think now of an option which is in the money (maybe not &quot;too much&quot; in the money). In this case if the volatility grows, doesn't the same argument show that the probability that the option finishes out of the money in this case increases, and consequently the price of the option should actually decrease, not increase.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But it is a fact that the vega is always positive, also for out of the money options. So, where is the fallacy in my intuition?? Thanks for your answers.&lt;/p&gt;&#xA;" OwnerUserId="11960" LastActivityDate="2016-10-27T04:03:19.207" Title="Why is the Vega positive?" Tags="&lt;options&gt;&lt;greeks&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30744" PostTypeId="2" ParentId="30743" CreationDate="2016-10-26T15:45:26.447" Score="2" Body="&lt;p&gt;If volatility increases, then not only probability to be in the money increases but also the money you get when you are in the money will increase too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to convince yourself, try it on the one-step binomial model.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-10-26T15:45:26.447" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30745" PostTypeId="1" CreationDate="2016-10-26T15:51:40.003" Score="1" ViewCount="125" Body="&lt;p&gt;I want to simulate paths for a commodity price. I use the historic data in the following way:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;$X_t$ is the price.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$\ln\left(\frac{X_t}{X_{t-1}}\right)$ is the daily return.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I calculate the slope of the regression for six prices.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I calculate the slope of the slopes found in step 3.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For the simulation I use the Ornstein-Uhlebeck equation&#xA;How can I produce smoother paths in order to have a robust model, i.e. I want to calculate the slope of every six observations and then again the slope of the slopes?&lt;/p&gt;&#xA;" OwnerUserId="25018" LastEditorDisplayName="user16651" LastEditDate="2016-10-27T16:04:29.720" LastActivityDate="2016-10-27T16:04:29.720" Title="Smooth ornstein uhlenbeck process" Tags="&lt;brownian-motion&gt;&lt;regression&gt;&lt;simulations&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30747" PostTypeId="1" CreationDate="2016-10-26T20:18:36.650" Score="1" ViewCount="418" Body="&lt;p&gt;I have seen that on matlab there is the cmd recessionplot that adds bar of recessions to plots. But that is for the official US dates, do you know if there is a similar command for the european crisis as certified by cepr?&lt;/p&gt;&#xA;" OwnerUserId="22194" LastActivityDate="2016-12-23T09:10:08.383" Title="Matlab recessionplot" Tags="&lt;matlab&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30748" PostTypeId="2" ParentId="3486" CreationDate="2016-10-26T20:47:56.443" Score="1" Body="&lt;p&gt;I think this is a common problem for a beginner in QF.&#xA;The holder has two ways to treat the stock if he exercises the call option earlier:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;the holder holds the stock until maturity.&lt;/li&gt;&#xA;&lt;li&gt;the holder think the stock is overpriced, and sell the stock immediately.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In the first case, the holder lost the interest from the cash and also the stock price may fall.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second case is a little tricky. Suppose the stock price is 50, and the strike price is 40. Selling the stock will give you 10. However, a better choice is to short the stock (borrow and sell the stock gives you 50) and close the short position at maturity use money equal or less than 40 (because you have the call option, you at most pay 40 for the stock). Then you can make a profit more than 10.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you see in either case, we have a better solution than just exercising it. For more details, please check Hull's book: section 9.5 Early exercise: calls on a non-dividend-paying stock.&lt;/p&gt;&#xA;" OwnerUserId="25023" LastEditorUserId="25023" LastEditDate="2016-10-26T20:56:42.117" LastActivityDate="2016-10-26T20:56:42.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30749" PostTypeId="1" AcceptedAnswerId="30751" CreationDate="2016-10-26T21:15:04.623" Score="7" ViewCount="1102" Body="&lt;p&gt;I am trying to model $C(K)$, the price of the call $C$ as a function of strike $K$. Because this is tied to Prob ITM - and in fact the probability density function of that particular expiration (&lt;a href=&quot;https://quant.stackexchange.com/a/17650/20194&quot;&gt;https://quant.stackexchange.com/a/17650/20194&lt;/a&gt;) - skew and 'bi-modality' of the pdf become very relevant. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Has any work been done on using models that capture this skew (stochastic vol models) to model the PDF? Is there any insight into what we can &lt;em&gt;roughly&lt;/em&gt; expect from $\frac{dC}{dK}$ using a modern options pricing model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to recreate a pdf from options prices, but in markets where it exhibits extreme skew - what would be the best fit for a cdf/pdf to curve fit? I have asked another &quot;statistics&quot; version of this question here: &lt;a href=&quot;https://stats.stackexchange.com/questions/242590/fitting-a-cdf-to-differentiate-symbolically?noredirect=1#comment461468_242590&quot;&gt;https://stats.stackexchange.com/questions/242590/fitting-a-cdf-to-differentiate-symbolically?noredirect=1#comment461468_242590&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am really looking for a model function with parameters that I can fit my observed $C(K)$ so I can perform analytical derivatives from there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any review or guidance is much appreciated.&lt;/p&gt;&#xA;" OwnerUserId="20194" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-10-28T17:23:54.203" Title="Modeling Call Price w.r.t. Strike w Models that Capture Vol Smile" Tags="&lt;options&gt;&lt;probability&gt;&lt;stochastic-volatility&gt;&lt;heston&gt;&lt;density&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="30750" PostTypeId="2" ParentId="30747" CreationDate="2016-10-26T22:52:27.853" Score="2" Body="&lt;p&gt;You need to do it manually. &#xA;Here's an example of shading an area behind a plot. You just need to adapt the colors and the dates for the recession.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A very basic example about shading an area in a plot. Shading an area bounded by a curve might be of interest as well.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;figure;&#xA;ha = area([4 6], [10 10]);&#xA;hold on&#xA;plot(1:10, 1:10,'r')&#xA;axis([1 10 1 10])&#xA;hold off&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="848" LastEditDate="2016-12-23T09:10:08.383" LastActivityDate="2016-12-23T09:10:08.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30751" PostTypeId="2" ParentId="30749" CreationDate="2016-10-26T22:57:44.657" Score="10" Body="&lt;p&gt;The way that I understand your question is that you are looking to fit the market prices of European plain vanilla options of a single maturity and then back out the corresponding implied probability density function. There are multiple ways that you could approach your problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;1) Modelling the Market Prices&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The market prices of European plain vanilla calls have to be strictly decreasing and convex in the strike. One approach to fitting them that I like is due to Fengler (2009). He uses cubic smoothing splines and obtains a quadratic program that can be solved very efficiently. Given the piecewise polynomial representation of the option prices, you can easily compute the corresponding densities in closed-form using the usual relationship&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;e^{r T} \frac{\partial^2 C_0}{\partial K^2}(K) = \mathbb{Q}(K),&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\mathbb{Q}(K)$ is the implied probability density function at the strike $K$. Since the fit is very flexible, only ensuring the absence of arbitrage, the resulting density can also be bi-modal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2) Modelling the Implied Volatility Smile&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you could fit a parametric form $\sigma_{\text{IV}}(K)$ to the corresponding implied volatility smile and then use the relationship&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\mathbb{Q}(K) &amp;amp; = &amp;amp; S_0 e^{r T} \phi \left( d_+ \right) \sqrt{T} \left\{ \frac{\partial^2 \sigma_{\text{IV}}}{\partial K^2}(K) + 2 \frac{d_+}{K \sigma_{\text{IV}}(K) \sqrt{T}} \frac{\partial \sigma_{\text{IV}}}{\partial K}(K) \right.\\&#xA;&amp;amp; &amp;amp; + \left. \frac{d_+ d_-}{\sigma_{\text{IV}}(K)} \left( \frac{\partial \sigma_{\text{IV}}}{\partial K} \right)^2 + \frac{1}{K^2 \sigma_{\text{IV}}(K) T} \right\},&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;see e.g. Fengler (2005) for details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, many common parametrizations wouldn't be able to fit a bi-modal implied probability density. An alternative is to use a polynomial of degree $n$ in the implied volatility along the lines&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\sigma_{\text{IV}}(k) = a_0 + a_1 k + a_2 k^2 + \sum_{i = 3}^n \left( a_{i, +} k^i \mathrm{1} \{ k \geq 0 \} + a_{i, -} k^i \mathrm{1} \{ k &amp;lt; 0 \} \right),&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $k = \ln \left( K / F_0(T) \right)$ is the logarithmic moneyness. While this is a flexible parametrization for the near-the-money quotes, you would have to separately deal with the wings. If chosen properly, this has the advantage that i) you can fit very flexible shapes, ii) your calibration problem is linear and iii) you can relatively easily apply the above formula to compute the implied probability density in closed-form. However, it does not ensure that the resulting calibration is free of arbitrage. A very similar approach is to use thin plate splines. It has the same advantages/disadvantages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you end up choosing a parametric form for the implied volatility smile that you cannot analytically differentiate, then you could always resort to automatic differentiation libraries. These can help you take exact derivatives (as opposed to finite differences) of almost arbitrary functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;3) Modelling the Implied Distribution&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, you can directly fit the implied distribution. As you mention bi-modal probability densities, I assume you are interested in situations where a jump with a predictable time of occurrence is priced in (e.g. quarterly earning reports). Imagine your &quot;normal&quot; (as in - at all times except for the jump) logarithmic returns follow some Levy process $X$, i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\ln \left( S_t / S_0 \right) = \gamma t + X_t,&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\gamma$ is some drift term (that you need to chose such that the stock price becomes a martingale). You can then augment these dynamics by a single predictable jump $Y$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\ln \left( S_t / S_0 \right) = \gamma t + X_t + Y \mathrm{1} \left\{ t \geq t_J \right\}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Y$ follows e.g. a Gaussian mixture with probability density function&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;f_Y(X) = p \phi \left( x; \mu_+, \sigma_+ \right) + (1 - p) \phi \left( x; \mu_-; \sigma_- \right).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here $p$ is the probability of an up-jump and $\phi(x; \mu, \sigma)$ is the standard normal probability density function. The corresponding characteristic function can be computed in closed-form. Then you use e.g. the Fang and Osterlee (2008) COS method for pricing and calibrate your parameters to the market prices of European plain vanilla options. Finally, you can use the same method to compute the implied density of your calibrated model. The beauty of this approach is that you obtain very easy to interpret parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet another possibility to fit the implied probability density directly is by using a Gram-Charlier series expansion of the normal distribution. The latter is directly parameterized in the higher moments and option prices can be computed very efficiently. A good reference is Schloegel (2013).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The below image is the implied density of Amazon as of 27th October 2016 for the expiry on 4th November 2016. Amazon was reporting their quarterly earnings after the market close on that day. The implied density was computed using the method in 1). The red dashed line is the closing price pre figures and the black dashed line is the opening price post figures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/R9zt3.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/R9zt3.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fang, Fang and Cornelis W. Oosterlee (2008) &quot;A Novel Pricing Method for European Options Based on Fourier-Cosine Series Expansions&quot;, Siam Journal of Scientific Computing, Vol. 31, No. 2, pp. 826-848&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fengler, Matthias R. (2005) &quot;Semiparametric Modeling of Implied Volatility&quot;, Springer Finance&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fengler, Matthias R. (2009) &quot;Arbitrage-Free Smoothing of the Implied Volatility Surface&quot;, Quantitative Finance, Vol. 9, No. 4, pp. 417-428&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Schloegel, Erik (2013) &quot;Option Pricing Where the Underlying Assets Follow a Gram/Charlier Density of Arbitrary Order&quot;, Journal of Economic Dynamics and Control, Vol. 37, No. 3, pp. 611-632&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2016-10-28T17:23:54.203" LastActivityDate="2016-10-28T17:23:54.203" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="30752" PostTypeId="1" CreationDate="2016-10-26T23:22:12.150" Score="0" ViewCount="57" Body="&lt;p&gt;I was wondering wich is the standard for pricing clients account balances in commercial banks. Is there any book that adress alm problems?&lt;/p&gt;&#xA;" OwnerUserId="20751" LastActivityDate="2016-12-20T03:33:49.837" Title="Standars for assigning maturities and hedging account balances in commercial banks" Tags="&lt;banks&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30753" PostTypeId="2" ParentId="30743" CreationDate="2016-10-27T04:03:19.207" Score="2" Body="&lt;p&gt;The payout from a call option is non-linear with limited downside and unlimited upside. So while volatility can increase or decrease the value of the underlying, the payoff is greater on an up-move than the loss on a down-move, hence the positive vega.&lt;/p&gt;&#xA;" OwnerUserId="5107" LastActivityDate="2016-10-27T04:03:19.207" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30754" PostTypeId="1" AcceptedAnswerId="30759" CreationDate="2016-10-27T04:45:06.283" Score="2" ViewCount="2588" Body="&lt;p&gt;The original question is quoted below.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The underlying stock price is now \$100, and tomorrow it will be either \$101 (with probability $p$) or \$99 (with probability $1-p$). A call option with value $c$ which expire tomorrow has exercise price \$100. Find the the value of $c$ under the Black-Scholes model. Ignore interest rate.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;When I tackle this question, I first derive $p=\frac{1}{2}$. To use call option price formula, we need $S, E, r, T-t, \sigma$. From the question, it is clear that $$S=100, E=100, r=0, T-t=\frac{1}{365}$$ So we only need $\sigma$. Since $\sigma$ is measured by the standard deviation of the return $\frac{dS}{S}$, I proceed as follow: $$E(return)=(1/100)(0.5)+(-1/100)(0.5)=0$$&#xA;$$Var(return)=(1/100-0)^2(0.5)+(-1/100-0)^2(0.5)=0.0001$$&#xA;$$sd(return)=\sqrt{0.0001}=0.01$$&#xA;Apply the explicit price formula for call option under the Black-Scholes model, I found $$d_1=0.00026171, d_2=-0.00026171, N(d_1) = 0.500104407965456, N(d_2)=0.499895592034544$$ Thus, the desired price is $$SN(d_1)-Ee^{-r(T-t)}N(d_2)=0.0209$$&#xA;The procedure seems logical to me. However,since the profit from the call option is $$(1)(0.5)+(0)(0.5)=0.5$$ I expected the price to be close or equal to \$0.5. How come they differ so much?&lt;/p&gt;&#xA;" OwnerUserId="25028" LastEditorUserId="25028" LastEditDate="2016-10-27T11:22:07.343" LastActivityDate="2016-10-27T17:33:02.720" Title="Calculate volatility under the binomial model for option pricing" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;binomial&gt;" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30755" PostTypeId="2" ParentId="30730" CreationDate="2016-10-27T08:09:52.940" Score="7" Body="&lt;p&gt;Here's another take on the question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;\begin{align}&#xA;\int_0^t W_s^2 ds &amp;amp;= \int_0^t  \int_0^s d(W_u^2) ds \\&#xA;&amp;amp;= 2 \int_0^t \int_0^s W_u dW_u ds + \int^t_0 \int^s_0 du ds \tag{Itô's lemma}\\&#xA;&amp;amp;= 2 \int_0^t \int_u^t W_u ds dW_u + \frac{t^2}{2}\tag{Stochastic Fubini}\\&#xA;&amp;amp;= 2 \int_0^t W_s (t-s) dW_s + \frac{t^2}{2}&#xA;\end{align}&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you can use Itô's isometry to conclude:&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align}&#xA;\Bbb{V}\left[ 2 \int_0^t W_s (t-s) dW_s  \right] &amp;amp;= 4 \int_0^t \Bbb{E}[W_s]^2 (t-s)^2 d\langle W, W \rangle_s \\&#xA;&amp;amp;= 4 \int_0^t s(t^2-2st+s^2) ds \\&#xA;&amp;amp;= 4 \left( \frac{t^4}{2} - 2\frac{t^4}{3} + \frac{t^4}{4} \right) = \frac{t^4}{3}&#xA;\end{align}&lt;/span&gt;&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="35142" LastEditDate="2018-11-13T13:34:09.120" LastActivityDate="2018-11-13T13:34:09.120" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="30756" PostTypeId="2" ParentId="30754" CreationDate="2016-10-27T09:24:01.113" Score="1" Body="&lt;p&gt;Black Scholes can be seen as the continuous limit of a binomial model when the number of steps go to infinity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(It can be seen as a result of Donsker's theorem)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus it is normal that your call price in the one-period model is different than the one in the BS model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have $n$ steps in your binomial to describe the period $[0,T]$&#xA;and if your increment on one step in $\pm h$, then the &lt;strong&gt;&lt;em&gt;equivalent&lt;/em&gt;&lt;/strong&gt; volatility is $h\sqrt{\frac{n}{T}}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So here $n=1$, $T=\frac{1}{365}$ and $h=1$ so $\sigma=\sqrt{365}$.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-10-27T09:24:01.113" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30757" PostTypeId="2" ParentId="30752" CreationDate="2016-10-27T09:46:47.160" Score="1" Body="&lt;p&gt;Look at the p.65 of this &lt;a href=&quot;https://www.unicreditbank.ru/content/dam/cee2020-pws-ru/issuer-reports/finance/msfo/2015/UCB%20IFRS%20Cons%20FS%2015-e.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;document&lt;/a&gt;. They reveal some information regarding the mapping of the assets and liabilities. Based on this mapping, you could perform gap analysis and see if you have any deficit in a given maturity slot and then hedge accordingly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Joel Bessis' books on Banking Risk Management may also be useful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; Alright, here is the approach that is used:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V(T) = V_0 e^{(-q \sigma \sqrt{T - 0.5 T \sigma^2})}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V_0$ - clients' account balances today (or on calculation date)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$T$ - periods of mapping (could be 3M, 6M, 9M, 1Y, etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$q$ - quantile (95%, 99%, etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma$ - volatility of the clients' account balances over a time period (12M, 24M, 36M)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, the account balance follows GBM with chosen confidence level $q$.&lt;/p&gt;&#xA;" OwnerUserId="19096" LastEditorUserId="19096" LastEditDate="2016-12-20T03:33:49.837" LastActivityDate="2016-12-20T03:33:49.837" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30758" PostTypeId="1" CreationDate="2016-10-27T11:18:57.727" Score="0" ViewCount="1762" Body="&lt;p&gt;In practice historical beta is the most used approach for calculating beta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some one can use i.e. the last 6 month daily returns of stock i and market m to calculcate this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nevertheless I am wondering which horizon this estimate wants to forecast?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following the example above: The next 6 month?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So is it always: Used time horizon length = Forecasted time horizon? &lt;/p&gt;&#xA;" OwnerUserId="25031" LastActivityDate="2016-10-28T12:37:53.833" Title="Historical beta: Beta estimation for which time horizon?" Tags="&lt;time-series&gt;&lt;capm&gt;&lt;beta&gt;&lt;time&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30759" PostTypeId="2" ParentId="30754" CreationDate="2016-10-27T12:29:37.703" Score="3" Body="&lt;p&gt;From your answer to my comment, here is what I would do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Over the horizon $[0,\Delta t]$, the BS model tells you that the expected log-return is &#xA;$$ \Bbb{E}\left[ \ln\left(\frac{S_{t+\Delta t}}{S_t}\right) \right] = \left(\mu-\frac{1}{2}\sigma^2\right)\Delta t$$&#xA;with a variance&#xA;$$ \Bbb{V}\left[ \ln\left(\frac{S_{t+\Delta t}}{S_t}\right)  \right] = \sigma^2 \Delta t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Over the same horizon, your binomial model tells you that:&#xA;$$ \Bbb{E}\left[ \ln\left(\frac{S_{t+\Delta t}}{S_t}\right) \right] = 0.5 \ln(101/100)+0.5\ln(99/100) \approx -5e^{-5}$$&#xA;\begin{align}&#xA;\Bbb{V}\left[ \ln\left(\frac{S_{t+\Delta t}}{S_t}\right) \right] &amp;amp;=(0.5\ln^2(101/100) + 0.5\ln^2(99/100)) - (-5e^{-5})^2 \approx 1e^{-4} &#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want your models to be &lt;em&gt;mutually consistent&lt;/em&gt;, they should at least agree on the two first moments of the log-return's distribution. This constrains you to choose:&#xA;$$ (\mu-\frac{1}{2}\sigma^2)\Delta t = -5e^{-5},\quad \sigma^2 \Delta t = 1e^{-4} $$&#xA;which gives, with $\Delta t=1/365$&#xA;$$\sigma = \sqrt{1e^{-4}\dot\,365} = 1e^{-2}\sqrt{365} = 0.1911$$&#xA;$$\mu = -5e^{-5}\dot\,365+\frac{1}{2}(0.1911)^2 \approx 1e^{-5}$$&#xA;Now you can use BS formula as you propose to find a price around $0.4$.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-10-27T17:33:02.720" LastActivityDate="2016-10-27T17:33:02.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30761" PostTypeId="2" ParentId="30736" CreationDate="2016-10-27T15:27:01.760" Score="1" Body="&lt;p&gt;Some thoughts from someone whose group does mortgage servicing rights valuations:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even for a first pass your assumption regarding refinance is too deterministic.  We have mortgages over a decade old that have never been refinanced.  Without getting into a heavily data derived model you should at least give the refinance a probability instead of absolute occurrence.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you noted you didn't cover default but there is a third condition you didn't include which is payment of additional principle which can occur even with rates increasing.  For that matter, refinance due to sale can occur with interest rates rising.  Both of these plus the refinance option are all grouped together as prepayment.  The figuring of the amortization schedule and discounting is straight forward.  The big modeling is in the prepayment model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for what people are using for the mortgage rate simulations I am used to do descriptive instead of predictive work.  Instead of trying to guess future interest rates with do a few thousand different interest movements and price under each.  This can be pretty computational intensive.  What it does is allow those we support to have a good model of pretty much any real market moves the next day while they are making decisions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://stat.fsu.edu/~jfrade/PAPERS/Mortgage%20modeling/Hayre_Lakhbir.pdf&quot; rel=&quot;nofollow&quot; title=&quot;Modeling of Mortgage Prepayments and Defaults&quot;&gt;This Citibank presentation&lt;/a&gt; gives a pretty good overview and has a few references to get you started.&lt;/p&gt;&#xA;" OwnerUserId="9413" LastEditorUserId="9413" LastEditDate="2016-10-27T15:37:00.390" LastActivityDate="2016-10-27T15:37:00.390" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30762" PostTypeId="1" CreationDate="2016-10-27T16:49:20.157" Score="1" ViewCount="720" Body="&lt;p&gt;Is it possible to pull 500 stocks from yahoo finance through the pandas data reader at once?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need to grab large chunks of adj close prices for different tickers. I can pull like 10-20 at a time and append to a pandas dataframe but i'm ideally looking to grab more than that. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any other sources where I can grab this end of day data?&lt;/p&gt;&#xA;" OwnerUserId="25033" LastEditorUserId="743" LastEditDate="2016-10-28T18:19:16.503" LastActivityDate="2016-12-08T11:02:30.383" Title="pandas pull 500 stocks through data reader" Tags="&lt;data&gt;&lt;market-data&gt;&lt;historical-data&gt;&lt;yahoo&gt;&lt;yahoofinance&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30763" PostTypeId="2" ParentId="30686" CreationDate="2016-10-27T17:43:21.560" Score="0" Body="&lt;p&gt;Yes, it's possible if one instrument has higher volatility that the other. Consider a low volatility series that is slightly lagged. For example, take a large sine wave and duplicate with tiny lag.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice it may be hard to find a well-correlated asset - perhaps alternatively consider a very high freq sine of a lower freq sine function (oscillating oscillations) versus the lower freq sine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From these formula:&#xA;Corr(1,2) = Cov(1,2)/(Var(1).Var(2))^1/2&#xA;and Beta = Cov(1,2)/Var(1)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore Beta = Corr(1,2) * 1/Var(1) * [Var(1) * Var(2)]^0.5&#xA; = Corr(1,2) * [Var(2) / Var(1)]^0.5&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A good reference may be:&#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/9204/are-two-stocks-with-the-same-beta-have-a-correlation-of-1?rq=1&quot;&gt;Do two stocks with the same beta have a correlation of 1?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="21023" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2016-11-03T10:15:50.680" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30764" PostTypeId="1" AcceptedAnswerId="30773" CreationDate="2016-10-27T21:37:14.183" Score="1" ViewCount="971" Body="&lt;p&gt;By being a market maker, I mean when I post a limit order, someone could take your order. For example, suppose during this second the bid-ask is 1,1.01 constantly and I posted a limit order to buy at 1. If I am not trading as a market maker, that order would not be filled. If I am, it may be filled if someone else post an market sell order.&lt;/p&gt;&#xA;" OwnerUserId="25037" LastActivityDate="2019-07-13T18:13:35.123" Title="How could I become a market maker in forex/equity market?" Tags="&lt;equities&gt;&lt;fx&gt;&lt;market&gt;&lt;market-making&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30765" PostTypeId="1" AcceptedAnswerId="30766" CreationDate="2016-10-27T23:15:19.000" Score="1" ViewCount="102" Body="&lt;p&gt;I have been told that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The price of a call with strike price $k$ and risk-free interest $r$ is identical to the price of a call with strike price $ke^{-r}$ and risk-free interest $0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what I claim. Let $c_1$ be the price of an option with interest rate&#xA;$r$ and strike price $k$. Let $c_2$ be the price of an option on the same underlying security, with strike $ke^{-rt}$, same duration as the first call option and an interest rate of $0$. My claim is that $c_1 = (c_2)e^{-rt}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I have that right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bob&lt;/p&gt;&#xA;" OwnerUserId="18353" LastActivityDate="2016-10-28T00:35:31.920" Title="Modeling the price of an option with another option using Black Scholes" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30766" PostTypeId="2" ParentId="30765" CreationDate="2016-10-28T00:30:14.263" Score="3" Body="&lt;p&gt;This is easy to show by just rearranging the Black Scholes solution for European plain vanilla calls. We make the dependence on the strike and rate explicity in what follows and set $\hat{K} = K e^{-r T}$. First,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;d_\pm(K, r) &amp;amp; = &amp;amp; \frac{1}{\sigma \sqrt{T}} \left( \ln \left( \frac{S_0}{K} \right) + \left( r \pm \frac{1}{2} \sigma^2 T \right) \right)\\&#xA;&amp;amp; = &amp;amp; \frac{1}{\sigma \sqrt{T}} \left( \ln \left( \frac{S_0}{K e^{-r T}} \right) \pm \frac{1}{2} \sigma^2 T \right)\\&#xA;&amp;amp; = &amp;amp; \frac{1}{\sigma \sqrt{T}} \left( \ln \left( \frac{S_0}{\hat{K}} \right) \pm \frac{1}{2} \sigma^2 T \right)\\&#xA;&amp;amp; = &amp;amp; d_\pm \left( \hat{K}, 0 \right).&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;C_0(K, r) &amp;amp; = &amp;amp; S_0 \mathcal{N} \left( d_+(K, r) \right) - K e^{-r T} \mathcal{N} \left( d_-(K, r) \right)\\&#xA;&amp;amp; = &amp;amp; S_0 \mathcal{N} \left( d_+ \left( \hat{K}, 0 \right) \right) - \hat{K} \mathcal{N} \left( d_- \left( \hat{K}, 0 \right) \right)\\&#xA;&amp;amp; = &amp;amp; C_0 \left( \hat{K}, 0 \right)&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So yes, what you have been told is correct. And no, your formula is wrong as you seem to claim that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;C_0(K, r) = e^{-r T} C_0 \left( \hat{K}, 0 \right).&#xA;\end{equation}&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2016-10-28T00:35:31.920" LastActivityDate="2016-10-28T00:35:31.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30768" PostTypeId="2" ParentId="28177" CreationDate="2016-10-28T03:08:17.100" Score="1" Body="&lt;p&gt;Tick Data has some sample equity data with bid/ask.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First go to the Tick Data equities web site:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.tickdata.com/equity-data/&quot; rel=&quot;nofollow&quot;&gt;https://www.tickdata.com/equity-data/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then find the Sample Data link.&lt;/p&gt;&#xA;" OwnerUserId="25043" LastActivityDate="2016-10-28T03:08:17.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30769" PostTypeId="1" CreationDate="2016-10-28T05:13:45.767" Score="0" ViewCount="381" Body="&lt;p&gt;The Global Minimum Variance has an annual return standard deviation of 9.9%. Its correlation with the Standard &amp;amp; Poor's 500 Index is 0.45. What is the annual return standard deviation of the S&amp;amp;P 500?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that correlation is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Corr(A,B) = Cov(A, B)/ [StDev(A)*StDev(B)]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in this problem, the covariance isn't given. Does that mean there's not enough information to answer the question?&lt;/p&gt;&#xA;" OwnerDisplayName="user25045" LastActivityDate="2016-10-28T22:46:19.597" Title="Correlation between two indexes" Tags="&lt;risk&gt;&lt;correlation&gt;&lt;index&gt;&lt;standard-deviation&gt;&lt;financial-markets&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30773" PostTypeId="2" ParentId="30764" CreationDate="2016-10-28T08:35:20.303" Score="2" Body="&lt;p&gt;The best training I have heard of for this, other than managing to get a job on the desk is &lt;a href=&quot;http://aci-uk.com/aci-uk-dealing-simulation-course/&quot; rel=&quot;nofollow noreferrer&quot;&gt;ACI Dealing Simulation Course&lt;/a&gt;. That would answer all your questions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem you have is that as a market taker, you're right, you can post buy and sell orders simultaneously as if you're a market maker. Who is your client though? If you're posting orders on an exchange and the market moves too quickly, you'll get put into a position when the market is going against you, which you won't be able to get out of without losing money.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This reminds me of General Patton's speech (google it). The point is to make the other son of bitch lose money, not you.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastEditorUserId="7369" LastEditDate="2018-02-26T13:34:11.363" LastActivityDate="2018-02-26T13:34:11.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30774" PostTypeId="2" ParentId="30769" CreationDate="2016-10-28T08:38:04.883" Score="1" Body="&lt;p&gt;Not enough information. Where did you get this problem from?&lt;/p&gt;&#xA;" OwnerUserId="19096" LastActivityDate="2016-10-28T08:38:04.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30775" PostTypeId="2" ParentId="30764" CreationDate="2016-10-28T10:50:58.013" Score="1" Body="&lt;p&gt;Since the comments answered the equities portion. I'll focus on forex.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First you would need sufficient capital to setup a prime broker or prime of prime relationship. The capital requirement and regulatory requirements here varies across country. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, since in the forex world there is no centralized exchange. You would need to convince each individual ECN, market maker or big bank, exc. exc. to allow you to provide liquidity to them. Each firm will have its own set of requirements.&lt;/p&gt;&#xA;" OwnerUserId="1764" LastActivityDate="2016-10-28T10:50:58.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30776" PostTypeId="2" ParentId="30758" CreationDate="2016-10-28T12:37:53.833" Score="2" Body="&lt;p&gt;Estimation horizon does not depend on forecast horizon but rather on market regime relevance. Using long historical time periods (i.e. 5yrs vs. 1yr) improves estimation confidence but decreases usefulness since the market environment today may be different from the environment 5yrs ago (interest rate level, regulation, different company - M&amp;amp;A etc.). In case you want to estimate historical beta (v.s. Fundamental - see Barra) you can either use Kalman Filters, or estimate beta using various look-back periods and test robustness. Regarding return frequency (daily vs. weekly vs. monthly), this depends on your trading/hedging horizon.&lt;/p&gt;&#xA;" OwnerDisplayName="user18489" LastActivityDate="2016-10-28T12:37:53.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30777" PostTypeId="1" CreationDate="2016-10-28T15:34:13.520" Score="1" ViewCount="289" Body="&lt;p&gt;More of a general question:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;is there anything there like a software to have any meaningful backtesting done on US equities with options in portfolios. Looking more of an off shelf product or open source something that can use for this purpose.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you search online you get some products but nothing really to show some comprehensive data wise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example if you want to test just moving average crossover on stocks with you buying call spread etc and see what would be the returns on that strategy for past 5 years or so. Just an example here, most of the backtesting tools will let you see the returns on the stocks portion part instead of buying the stocks if you do call spread etc on say 100 of stocks etc, is there any tool out there.? I know the data can be problem since, to have meaningful bid/ask spread on option is huge but just say on top 50 names or indexes or something like that. Just thinking out load.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On opensource side, in R there is quantstrat and python zipline etc which deals with equity portion but I have not see anything even in commercial side which provide option with backtesting abilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any pointers will be awesome.&lt;/p&gt;&#xA;" OwnerUserId="25051" LastEditorUserId="743" LastEditDate="2016-10-28T18:18:42.043" LastActivityDate="2016-10-28T18:18:42.043" Title="Backtesting with option" Tags="&lt;options&gt;&lt;backtesting&gt;&lt;historical&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30779" PostTypeId="2" ParentId="30769" CreationDate="2016-10-28T22:46:19.597" Score="0" Body="&lt;p&gt;Here is a clue: The GMVP has a fundamental property: it has the same covariance with every other efficient portfolio. You can assume that the S&amp;amp;P500 is an efficient portfolio. For details see here &lt;a href=&quot;https://quant.stackexchange.com/questions/8776/covariance-of-a-gmv-portfolio-with-any-asset&quot;&gt;Covariance of a GMV portfolio with any asset&lt;/a&gt; This common covariance is usually denoted $\frac{1}{C}$ where $C = 1^T {\Sigma}^{-1} 1 $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We proceeds as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the covariance of the GMVP with itself: That's just the standard deviation squared, i.e. ${0.099}^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the covariance of the GMVP with the S&amp;amp;P500: By the above theorem it is the same number i.e. ${0.099}^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we apply the definition of correlation which you gave and we have $0.45 = \frac{{0.099}^2}{0.099 \sigma_{SP}}$. From this equation $\sigma_{SP}$ is found to be 0.22 or 22%&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2016-10-28T22:46:19.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30780" PostTypeId="1" CreationDate="2016-10-29T01:10:05.357" Score="-1" ViewCount="136" Body="&lt;p&gt;Zero-coupon default-free interest rates maturing over the next five years are listed below (in percent per annum, continuously-compounded):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maturity Years -- Yield&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 --------------------1.9&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2 --------------------2.2&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3 --------------------2.5&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4 --------------------2.8&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5 --------------------3.4&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You expect to inherit $50 million at the end of year two, and would like to invest it for two additional years in the safest possible instrument in real terms. What is the safest investment and its rate of return?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) Execute a forward loan at 3.4%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) Lend for four years at 2.8%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;c) Execute a forward loan at 3.7%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;d) Wait two years and lend for two years&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think I know what to do when the interest rate is constant but I'm not sure what to do when it changes like this. Since the 50$ million inflow is coming in at the end of year 2, do I start looking at the table from year 3?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help appreciated!&lt;/p&gt;&#xA;" OwnerUserId="25056" LastActivityDate="2016-10-29T01:27:28.783" Title="Zero-coupon Loan Investment" Tags="&lt;interest-rates&gt;&lt;finance&gt;&lt;forward&gt;&lt;finance-mathematics&gt;&lt;zero-coupon&gt;" AnswerCount="1" CommentCount="2" ClosedDate="2016-10-29T14:46:08.160" ContentLicense="CC BY-SA 3.0" />
  <row Id="30781" PostTypeId="2" ParentId="30780" CreationDate="2016-10-29T01:27:28.783" Score="1" Body="&lt;p&gt;Safest would be FRA to lock the interest rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="24954" LastActivityDate="2016-10-29T01:27:28.783" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30782" PostTypeId="1" AcceptedAnswerId="30789" CreationDate="2016-10-29T03:31:46.280" Score="2" ViewCount="315" Body="&lt;p&gt;The call option with strike $X$ and maturity $T$ on a ZCB maturing at time $S$, where $T\le S$, is&#xA;$$ZBO(t,T,S,X)=E_t[e^{-\int_t^Tr_sds}(P(T,S)-X)^+]$$&#xA;The ZCB price is denoted by&#xA;$$P(t,T)=E_t[e^{-\int_t^Tr_sds}]$$&#xA;I am familiar with the Black-Scholes metholodogy of deriving the call option price from first principles, and I am interested in applying the methodology here to compute the bond option price. The Vasicek model allows the bond price to be computed analytically. The SDE for the short rate is&#xA;$$dr_t=k(\theta-r_t)dt+\sigma dW_t$$&#xA;and it can be shown that the bond price is&#xA;$$P(t,T)=A(t,T)e^{-B(t,T)r_t}$$&#xA;where $$B(t,T)=\frac{1}{k}(1-e^{-k(T-t)})$$ and $$A(t,T)=\exp{\bigg[\Big(\theta-\frac{\sigma^2}{2k^2}\Big)[B(t,T)-T+t]-\frac{\sigma^2}{4k}B(t,T)^2}\bigg]$$&#xA;My initial steps are to express $ZBO(t,T,S,X)$ in terms of indicator functions, as follows&#xA;\begin{align}&#xA;ZBO(t,T,S,X)&amp;amp;=E_t\Big(e^{-\int_t^Tr_sds}(P(T,S)-X)\mathbb{1}_{P(T,S)&amp;gt;K}\Big)\\&#xA;&amp;amp;=E_t\Big(e^{-\int_t^Tr_sds}P(T,S)\mathbb{1}_{P(T,S)&amp;gt;K}\Big)-XE_t\Big(e^{-\int_t^Tr_sds}\mathbb{1}_{P(T,S)&amp;gt;K}\Big)\\&#xA;&amp;amp;=E_t\Big(e^{-\int_t^Tr_sds}E_t[e^{-\int_T^Sr_sds}]\mathbb{1}_{P(T,S)&amp;gt;K}\Big)-XE_t\Big(e^{-\int_t^Tr_sds}\mathbb{1}_{P(T,S)&amp;gt;K}\Big)\\&#xA;&amp;amp;=E_t\Big(e^{-\int_t^Sr_sds}\mathbb{1}_{P(T,S)&amp;gt;K}\Big)-XE_t\Big(e^{-\int_t^Tr_sds}\mathbb{1}_{P(T,S)&amp;gt;K}\Big)\\&#xA;&amp;amp;=E_t\Big(P(t,S)\mathbb{1}_{P(T,S)&amp;gt;K}\Big)-XE_t\Big(P(t,T)\mathbb{1}_{P(T,S)&amp;gt;K}\Big)\\&#xA;\end{align}&#xA;The main issues are that I have assumed&#xA;$e^{-\int_t^Tr_sds}E_t[e^{-\int_T^Sr_sds}]=e^{-\int_t^Sr_sds}$&#xA;and that $P(t,T)$ appears to be a random variable, even though it is a $\mathbb{Q}$ expectation and thus a constant. Furthermore, the Black-Scholes methodology can only be applied after changing numeraires. If there is a Radon-Nikodym derivative that can do the following&#xA;$$E_t\Big(P(t,S)\mathbb{1}_{P(T,S)&amp;gt;K}\Big)-XE_t\Big(P(t,T)\mathbb{1}_{P(T,S)&amp;gt;K}\Big)=E_t\Big(P(T,S)\mathbb{1}_{P(T,S)&amp;gt;K}\Big)-XE_t\Big(P(T,S)\mathbb{1}_{P(T,S)&amp;gt;K}\Big)$$&#xA;then the bond price can easily be found.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help is appreciated.&lt;/p&gt;&#xA;" OwnerUserId="24781" LastEditorUserId="24781" LastEditDate="2016-10-29T22:28:15.023" LastActivityDate="2016-10-30T16:54:04.123" Title="Analytic ZCB call option under Vasicek" Tags="&lt;black-scholes&gt;&lt;fixed-income&gt;&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30784" PostTypeId="1" AcceptedAnswerId="30785" CreationDate="2016-10-29T12:30:00.050" Score="2" ViewCount="86" Body="&lt;p&gt;Let's say that I live in my own world, with 20 inhabitants.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I own a firm called mc Donald's. ( my people purchase food there of course).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each income to mc Donald's gets into the firm bank.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;McDonald's is also tracking profit each hour , day, week and month.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As McDonald's owner , I will be able to take out any of the profit whenever I want to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Here comes the question&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say I want to make mc Donald's a stock market , where my inhabitants can buy and sell stocks on mc Donald's firm. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I accomplish this ?&#xA;How and what algorithms can I use to do stock price changes to make it appear to be working like how real stock firms works ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How many stocks should I allow the firm to have ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions or spoon feed on how I can make this mc Donald's function like a stock market in itself ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What will be needed for a price drop / increase on the stock's price ?&lt;/p&gt;&#xA;" OwnerUserId="25061" LastEditorUserId="25061" LastEditDate="2016-10-29T12:44:07.143" LastActivityDate="2016-10-29T13:32:13.530" Title="Firm Stock market" Tags="&lt;option-pricing&gt;&lt;risk&gt;&lt;programming&gt;&lt;finance&gt;&lt;trading&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30785" PostTypeId="2" ParentId="30784" CreationDate="2016-10-29T13:32:13.530" Score="1" Body="&lt;p&gt;I would approach this by building a general equilibrium model of the economy. Here is the high-level idea:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;There is a single perishable consumption good and all prices are measured in terms of it.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;There is a fully equity financed firm with one unit of share outstanding. The firm pays a continuous dividend at a stochastic rate $\delta$. You could for example start with a geometric Brownian motion&#xA;\begin{equation}&#xA;\mathrm{d}\delta_t = \mu \delta_t \mathrm{d}t + \sigma \delta_t \mathrm{d}W_t&#xA;\end{equation}&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;There is a continuum of identical risk-averse individuals that maximize their expected lifetime utility&#xA;\begin{equation}&#xA;\mathbb{E}_{\mathbb{P}} \left[ \int_0^\infty e^{-\rho v} u \left( C_v \right) \mathrm{d}v \right]&#xA;\end{equation}&#xA;by, at each point in time, choosing their optimal consumption and portfolio compositions. Here, $u \left( C_t \right)$ is their utility of consumption and $\rho$ is their rate of time preference. You can treat these as one &quot;representative agent&quot;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can introduce additional derivatives into your economy that are in zero net supply and whose payoffs are measurable w.r.t. the filtration generated by $W$. A trivial such example are zero-coupon bonds.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You find the competitive equilibrium that solves the agents' expected utility maximization problem. In this equilibrium, the representative agent holds the one unit of stock, no derivatives and his consumption is equal to the dividend $C_t = \delta_t$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In equilibrium you obtain the dynamics for the stock price as well as valuation functions for all derivatives (and thus a risk-free rate). In my above example, you will find that the stock price also follows a geometric Brownian motion.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Note that there are many ways to setup such an economy and often your assumptions will be a bit reversed-engineered from the desired result. You could certainly add other things like production to make your setup more realistic. Here are some references to get you started:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The above setup is the pure-diffusion version of the Naik and Lee (1990) exchange economy. They consider a Merton jump-diffusion model. Many variations of this model have been used to find economically motivated measure changes for Levy processes, see e.g. Milne and Madan (1991) for the variance gamma model or Kou (2002) for the double exponential jump-diffusion model.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;A good reference for the general topic of continuous time consumption and portfolio choice are the books by Back (2010) and Pennacchi (2008).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;One of the ground braking papers is Cox et al. (1985). They construct a very general multi-factor production economy. This paper is a tough read though.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Back, Kerry E. (2010) &quot;Asset Pricing and Portfolio Choice Theory&quot;, Financial Management Association Survey and Synthesis Series: Oxford University Press&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cox, John C., Jonathan E. Ingersoll and Stephen and Stephen A. Ross (1985) &quot;An Intertemporal General Equilibrium Model of Asset Prices&quot;, Econometrica, Vol. 53, No. 2, pp. 363-384&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kou, Steven G. (2002) &quot;A Jump-Diffusion Model for Option Pricing&quot;, Management Science, Vol. 48, No. 8, pp. 1086-1101&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Milne, Frank and Dilip B. Madan (1991) &quot;Option Pricing with V.G. Martingale Components&quot;, Mathematical Finance, Vol. 1, No. 4, pp. 39-55&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pennachi, George G. (2008) &quot;Theory of Asset Pricing&quot;, Pearson&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2016-10-29T13:32:13.530" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30789" PostTypeId="2" ParentId="30782" CreationDate="2016-10-29T19:56:30.360" Score="2" Body="&lt;p&gt;&lt;strong&gt;Hint&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note $$X=(P(T,S)-K)^+=(P(T,S)-K)1_{P(T,S)&amp;gt;K}\tag 1$$ &#xA;We know&#xA;$$V(t,T,S,K)=\mathbb{E^Q}_t\left[\frac{B(t)}{B(T)}X\right]\tag 2$$&#xA;$(1)$ and $(2)$, we have&#xA;$$V(t,T,S,K)=\underbrace{\mathbb{E}^Q_t\left[\frac{B(t)}{B(T)}P(T,S)1_{P(T,S)&amp;gt;K}\right]}_{I}-K\,\underbrace{\mathbb{E}_t^Q\left[\frac{B(t)}{B(T)}1_{P(T,S)&amp;gt;K}\right]}_{J}\tag 3$$&#xA;Now we should calculate $I$ and $J$. By application of &lt;strong&gt;Bayes formula&lt;/strong&gt;, we have&#xA;$$\mathbb{E}_t^{Q_S}\left[1_{P(T,S)&amp;gt;K}\right]=\frac{\mathbb{E}_t^Q\left[\frac{B(t)}{B(T)}P(T,S)1_{P(T,S)&amp;gt;K}\right]}{P(t,S)}$$&#xA;thus&#xA;$$I=\mathbb{E}_t^Q\left[\frac{B(t)}{B(T)}P(T,S)1_{P(T,S)&amp;gt;K}\right]=P(t,S)\mathbb{E}_t^{Q_S}\left[1_{P(T,S)&amp;gt;K}\right]\tag 4$$&#xA;on the other hand&#xA;$$\mathbb{E}_t^{Q_S}\left[1_{P(T,S)&amp;gt;K}\right]=Q_{S}\left(P(T,S)&amp;gt;K\Big{|}\,\mathcal{F}_t\right)\tag 5$$&#xA;$(4)$ and $(5)$&#xA;$$I=P(t,S)Q_{S}\left(P(T,S)&amp;gt;K\Big{|}\,\mathcal{F}_t\right)\tag 6$$&#xA;Similarly, we have&#xA;$$\mathbb{E}_t^{Q_T}\left[1_{P(T,S)&amp;gt;K}\right]=\frac{\mathbb{E}_t^Q\left[\frac{P(T,T)}{B(T)P(0,T)}1_{P(T,S)&amp;gt;K}\right]}{\frac{P(t,T)}{B(t)P(0,T)}}=\frac{\mathbb{E}_t^Q\left[\frac{B(t)}{B(T)}1_{P(T,S)&amp;gt;K}\right]}{P(t,T)}$$&#xA;therefore&#xA;$$J=P(t,T)\mathbb{E}_t^{Q_T}\left[1_{P(T,S)&amp;gt;K}\right]=P(t,T)\,Q_{T}\left(P(T,S)&amp;gt;K\Big{|}\,\mathcal{F}_t\right)\tag 7$$&#xA;$(3)$ , $(6)$ and $(7)$&#xA;$$V(t,T,S,K)=P(t,S)Q_{S}\left(P(T,S)&amp;gt;K\Big{|}\,\mathcal{F}_t\right)-KP(t,T)\,Q_{T}\left(P(T,S)&amp;gt;K\Big{|}\,\mathcal{F}_t\right)$$&#xA;&lt;strong&gt;Note&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$B(t)$ is Money account.&lt;/li&gt;&#xA;&lt;li&gt;$Q_T$ and $Q_S$ are forward measures.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-10-30T16:54:04.123" LastActivityDate="2016-10-30T16:54:04.123" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30790" PostTypeId="1" AcceptedAnswerId="30794" CreationDate="2016-10-30T04:59:17.197" Score="0" ViewCount="1814" Body="&lt;p&gt;How would one calculate the fair level of 3s1s single currency basis swaps using simply the 1m &amp;amp; 3m libors and ois levels? (so you have fra-ois spread levels in both)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that as the FRA-OIS basis widens, the fair level of 3s1s would increase, but unsure how that level is calculated?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if one entered a 1y basis swap at Xbp over 1mth, how would the stub risk be hedged (in ois since libors are not tradeable) and how does that translate back to finding a fair 3s1s level?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="25069" LastActivityDate="2016-10-30T14:02:14.133" Title="How to calculate fair 3s1s basis levels" Tags="&lt;swaps&gt;&lt;libor&gt;&lt;ois&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30791" PostTypeId="2" ParentId="30729" CreationDate="2016-10-30T05:12:50.283" Score="1" Body="&lt;p&gt;Repo risk is not always perfectly linked to OIS rates, although highly correlated.&#xA;Therefore in large markets (say US) get a different repo curve as GC-OIS spread risk is material.&#xA;This has led to repo rate futures: &lt;a href=&quot;http://www.marketswiki.com/wiki/GCF_Repo_Index_futures&quot; rel=&quot;nofollow&quot;&gt;http://www.marketswiki.com/wiki/GCF_Repo_Index_futures&lt;/a&gt;&#xA;&lt;a href=&quot;http://www.dtcc.com/charts/dtcc-gcf-repo-index&quot; rel=&quot;nofollow&quot;&gt;http://www.dtcc.com/charts/dtcc-gcf-repo-index&lt;/a&gt;&#xA;Would also note that repo rates from Tresury/MBS/Agency will differ and therefore have different contracts and risk buckets. &lt;/p&gt;&#xA;" OwnerUserId="25069" LastActivityDate="2016-10-30T05:12:50.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30794" PostTypeId="2" ParentId="30790" CreationDate="2016-10-30T14:02:14.133" Score="1" Body="&lt;p&gt;The 3s 1s basis cannot be calculated in an arbitrage sense.  You can make some reasonable assumptions.  For example , if fra/iOS is tighter on s forward basis than spot, then 3s 1s is likely to have a similar term structure.  But flows in the market may move it away from intuitive levels.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-10-30T14:02:14.133" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30795" PostTypeId="1" CreationDate="2016-10-30T19:43:17.570" Score="1" ViewCount="185" Body="&lt;p&gt;First I want to talk about one of my wrong ways of pricing an European call option. When I consider the simplest case of European call option, the first idea of determining the price is to calculate the probabilistic average of the output at the end time point, $\displaystyle\int_{\omega\in\Omega}(S(\omega,T)-K)^{+}p(\omega)d\omega$, and pull it back to the current time point by multiplying the mean value by $e^{-r(T-t)}$, where $r$, by assumption, is the stable and constant interest rate of a money market. However, as I continue to learn this subject, I found the logical flaw in this definition. Although there is no doubt that $\displaystyle\int_{\omega\in\Omega}(S(\omega,T)-K)^{+}p(\omega)d\omega$ is the correct average price of the call option in terms of the money at time $T$, there is no natural reason to believe that $e^{-r(T-t)}$ is the correct link between the money at time $T$ and the money at time $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the above example the output $(S(\omega, T)-K)^{+}$ only depends on the final price of the stock. And there are options that the output actually relies on more information of $\omega$, e.g. the exotic option. So what I want to know is that, what is the eventual/most fundamental of determining the price of a call option? I guess you may immediately refer to &quot;arbitrage-free&quot;, or some technical tools like &quot;risk-neutral measure&quot;. But &quot;arbitrage-free&quot; looks more like a philosophical principle. What I really want to investigate, is the idea behind &quot;risk-neutral measure&quot;, or the original idea of how to describe  &quot;arbitrage-free&quot; in terms of mathematical language. In other words, how should one start to consider, by him/herself, the mathematical problem of option pricing, before any of those ideas/tools were developed?&lt;/p&gt;&#xA;" OwnerUserId="25074" LastEditorUserId="16160" LastEditDate="2016-10-30T22:48:19.600" LastActivityDate="2016-10-31T08:37:45.137" Title="What is the principle of determining an arbitrary option price" Tags="&lt;option-pricing&gt;&lt;risk-neutral-measure&gt;&lt;no-arbitrage-theory&gt;&lt;quantitative&gt;&lt;quants&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30798" PostTypeId="2" ParentId="30795" CreationDate="2016-10-31T01:14:32.127" Score="2" Body="&lt;p&gt;You make the argument that the option risky and thus its expected payoff should be discounted at a risk-adjusted rate by a risk averse agent. I would even go one step back. You say that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\int_{\omega \in \Omega} (S(\omega, T) - K)^+ p(\omega)\mathrm{d}\omega&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is the &quot;correct&quot; average price of the call option. What growth rate are you using for the underlying asset which is itself also risky?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These were exactly the open questions in option pricing pre Black-Scholes. The concept of log-normally distributed stock prices was not new and structurally similar equations for European plain vanilla call options were obtained before. A very good account can be found &lt;a href=&quot;http://www.ericbenhamou.net/documents/Encyclo/Pre%20Black-Scholes.pdf&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. The major problem pre Black-Scholes was that both the appropriate growth rate for the underlying asset and the discounting rate used for the option were unobservable and utility dependent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The concept of state prices existed already earlier but the problem was that $n$ terminal states required $n$ linearly independent assets to complete the market and obtain arbitrage prices for contingent claims. Black and Scholes' insight was that a market could be dynamically completed through continuous trading. I.e. although there is an infinite number of terminal states, two assets are sufficient when the risky asset is driven only by a diffusion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both state pricing and Black Scholes heavily rely on the concept of arbitrage or the absence thereof. I will not take the bait and elaborate why this is not a &quot;philosophy&quot; as you claim. I do however suggest you read up on the topic to improve your understanding. Here are a few good references:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Pennachi (2008) is a good general introduction to asset pricing theory. See in particular Chapter 4 &quot;Consumption-Savings and State Pricing&quot; and Chapter 9 &quot;Dynamic Hedging and PDE Valuation&quot;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Musiela and Rutkowski (2005) is an excellent overview of derivatives pricing in a diffusion context. See in particular Chapter 3 &quot;Benchmark Models in Continuous Time&quot;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Musiela, Mark and Marek Rutkowski (2005) &quot;Martingale Methods in Financial Modelling&quot;, Springer, 2nd Edition&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pennachi, George G. (2008) &quot;Theory of Asset Pricing&quot;, Pearson&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2016-10-31T08:37:45.137" LastActivityDate="2016-10-31T08:37:45.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30800" PostTypeId="2" ParentId="14397" CreationDate="2016-10-31T05:58:58.773" Score="1" Body="&lt;p&gt;Maybe this paper is helpfull&#xA;&lt;a href=&quot;http://www.wiley.com/legacy/wileychi/marketmodels/chapter5.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.wiley.com/legacy/wileychi/marketmodels/chapter5.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in page 8  we have&#xA;&lt;a href=&quot;https://i.stack.imgur.com/sI1HI.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/sI1HI.png&quot; alt=&quot;Confidence Intervals for Moving Averages&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="25083" LastActivityDate="2016-10-31T05:58:58.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30801" PostTypeId="2" ParentId="30719" CreationDate="2016-10-31T06:29:23.640" Score="1" Body="&lt;p&gt;For the specification $w_i = s_i/v_i$ the objective is&#xA;$$&#xA;argmin \sum_i \left(w_i - \frac{s_i}{v_i}\right)^2.&#xA;$$&#xA;Add to this any constraints you might have.&lt;/p&gt;&#xA;" OwnerUserId="5107" LastActivityDate="2016-10-31T06:29:23.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30802" PostTypeId="1" AcceptedAnswerId="30803" CreationDate="2016-10-31T06:34:28.233" Score="2" ViewCount="1000" Body="&lt;p&gt;I have came across the excellent &lt;a href=&quot;https://quant.stackexchange.com/questions/18007/variance-replication-using-options/18022#18022&quot;&gt;answer&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for a dicrete approximation of the &lt;a href=&quot;http://engineering.nyu.edu/files/twrdsfig.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Carr-Madan decomposition formula&lt;/a&gt; of the function $f(F_T)$ of the terminal futures price by taking a static position at time $t=0$ in options:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$$f(F_T)=f(\kappa) + f'(\kappa) [(F_T - \kappa)^+ - (\kappa - F_T)^+] + \int_0^{\kappa}  f''(K) (K-F_T)^+ \ d K  +   \int_{\kappa}^{\infty}  f''(K) (F_T-K)^+ \ d K.$$ &#xA;  The first term can be interpreted as the payoff from a static position in $f(\kappa)$ pure discount bonds, each paying one dollar at $T$. The second term can be interpreted as the payoff from $f'(\kappa)$ calls struck at $\kappa$ less $f'(\kappa)$ puts, also struck at $\kappa$. The third term arises from a static position in $f''(K)dK$ puts at all strikes&#xA;  less than $\kappa$. Similarly, the fourth term arises from a static position in $f''(K)dK$ calls at all strikes greater than $\kappa$.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My intuition is to approximate the integral formula by a weighted sum of prices of put and calls on the same underlying asset. The aim of the approximation is the implementation of the option portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say at time $t=0$ one can take a static position (buy-and-hold), and the option's portfolio includes $x_i^c$, $x_i^p$ units of European call and put&#xA;options, $x_i^c, x_i^p&amp;gt;0$ for buying, $x_i^c, x_i^p&amp;lt;0$ for selling, if&#xA;$x_i^c$ or $x_i^p$ equal to $0$ its means that the contract does&#xA;not include in the portfolio, $k^i_c$, $k^i_p$ are the corresponded call and put strikes, $i=1,2, \ldots, n$, $S_t$ is a price of the&#xA;underlying asset at calendar time, $0 \le t \le T$. Then the second term at time $t=0$ can be approximated by the formula&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f'(\kappa) [(F_T - \kappa)^+ - (\kappa - F_T)^+]\approx \sum_{i=1}^{n} x_i^c (S_t - k_c^i)^{+} + x_i^p (k_p^i -&#xA;S_t)^{+},$$ &#xA;the first term is the value of the call option payoff and the&#xA;second is the value of the put option payoff, $X^+=\max(X, 0)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question is:&lt;/strong&gt; If my intuition is correct how to specify the number $n$? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update.&lt;/strong&gt; How to calculate &lt;a href=&quot;http://www.cboe.com/micro/VIX/vixwhite.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;VIX&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to be with the first term $f(\kappa)$ and the third term $\int_0^{\kappa}  f''(K) (K-F_T)^+ \ d K$ and the fourth term $\int_{\kappa}^{\infty}  f''(K) (F_T-K)^+ \ d K$?&lt;/p&gt;&#xA;" OwnerUserId="20913" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-11-01T06:45:59.633" Title="How to approximate the Carr-Madan decomposition formula?" Tags="&lt;reference-request&gt;&lt;option-strategies&gt;&lt;estimation&gt;&lt;european-options&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30803" PostTypeId="2" ParentId="30802" CreationDate="2016-10-31T09:10:24.333" Score="2" Body="&lt;p&gt;Carr-Madan formula tells you that the European-style payoff $f(F_T)$ can be decomposed as:&#xA;$$f(F_T)=f(\kappa) + f'(\kappa) [(F_T - \kappa)^+ - (\kappa - F_T)^+] + \int_0^{\kappa}  f''(K) (K-F_T)^+ \ d K  +   \int_{\kappa}^{\infty}  f''(K) (F_T-K)^+ \ d K$$&#xA;for any positive $\kappa$ of your choice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming deterministic rates w.l.o.g. as well as a complete market, by absence of arbitrage opportunity, to generate the payoff on the RHS at $t=T$, one can enter the following (static) positions today, at $t=0$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \underbrace{\Bbb{E}_0^\Bbb{Q}\left[ e^{-rT} f(\kappa)\right]}_{(1)} + \underbrace{\Bbb{E}_0^\Bbb{Q}\left[ e^{-rT} f'(\kappa) [(F_T - \kappa)^+ - (\kappa - F_T)^+]\right]}_{(2)} + \underbrace{\Bbb{E}_0^\Bbb{Q}\left[ e^{-rT} \int_0^{\kappa}  f''(K) (K-F_T)^+ \ d K\right]}_{(3)} +   \underbrace{\Bbb{E}_0^\Bbb{Q}\left[ e^{-rT} \int_{\kappa}^{\infty}  f''(K) (F_T-K)^+ \ d K\right]}_{(4)} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where by definition:&#xA;$$ (1) = f(\kappa) B(0,T), \quad (2) = f'(\kappa) (C(\kappa,T)-P(\kappa,T)) $$&#xA;$$ (3) = \int_0^\kappa f''(K) P(K,T) dK,\quad (4) = \int_\kappa^\infty f''(K) C(K,T) dK $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(1)$ is equivalent to go long $f(\kappa)$ zero-coupon bonds $B(0,T)$, while $(2)$ corresponds to being long  $f'(\kappa)$ European calls written on the future and short $f'(\kappa)$ European puts. Terms $(3)$ and $(4)$ are more tricky as, per se, they require taking positions in an infinite number of contracts, which is not practical. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you suggest, we could therefore approximate integrals using finite sums, see the calculation of the VIX index for instance. In that case $(3)$ (the reasoning for $(4)$ is almost identical) would become:&#xA;$$ \int_0^\kappa f''(K) P(K,T) dK = \frac{1}{2} \sum_{i=1}^{N-1} (f''(K_i) P(K_i,T) + f''(K_{i+1}) P(K_{i+1},T)) (K_{i+1}-K_i) $$&#xA;where we have used the trapezoidal rule along with ${\bf{K}}=\{ K_i \}_{i=1}^N$ a partition of the interval $[0,\kappa]$ (you could also a simple Riemann sum the idea stays the same) meaning that $(3)$ corresponds to being:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Long $\frac{1}{2}f''(K_i)(K_{i+1}-K_i)$ puts $P(K_i,T),\quad i=1,...,N-1$&lt;/li&gt;&#xA;&lt;li&gt;Long $\frac{1}{2}f''(K_{i+1})(K_{i+1}-K_i)$ puts $P(K_{i+1},T),\quad i=1,...,N-1$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The tricky part in practice is really the finite number of options that actually trade, meaning that you may not have the right granularity to decently approximate the integrals in the Carr-Madan formula (discretisation error + truncation error).&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-10-31T17:03:54.013" LastActivityDate="2016-10-31T17:03:54.013" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="30805" PostTypeId="1" CreationDate="2016-10-31T09:59:56.003" Score="4" ViewCount="542" Body="&lt;p&gt;The CIR short rate model is&#xA;$$dr_t=k(\theta-r_t)dt+\sigma\sqrt{r_t}dW_t$$&#xA;under the risk-neutral measure.&#xA;The bond price is of the form&#xA;$$P(t,T)=A(t,T)e^{-B(t,T)r_t}$$&#xA;where the continuously compounded spot rate is an affine function of the short rate $r_t$. My question is, how should Ito's Lemma be applied to find &#xA;$dP(t,T)$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my attempt:&#xA;$$\ln P(t,T)=\ln A(t,T)-B(t,T)r_t$$&#xA;$$d\ln P(t,T)=d\ln A(t,T)-r_tdB(t,T)-B(t,T)dr_t$$&#xA;$$(d\ln P(t,T))^2=B(t,T)^2\sigma^2r_tdt$$&#xA;\begin{align}&#xA;d(e^{\ln P(t,T)})&amp;amp;=P(t,T)\bigg(d\ln P(t,T)+\frac{1}{2}(d\ln P(t,T))^2\bigg)\\&#xA;&amp;amp;=P(t,T)\bigg(d\ln A(t,T)-r_tdB(t,T)-B(t,T)dr_t+\frac{1}{2}B(t,T)^2\sigma^2r_tdt\bigg)\\&#xA;&amp;amp;=\ldots\\&#xA;&amp;amp;=r_tP(t,T)dt-B(t,T)P(t,T)\sigma\sqrt{r_t}dW_t&#xA;\end{align}&#xA;Although I have followed the steps for Ito's Lemma, I seem to be missing a detail that will allow some terms to cancel out to produce the final line. Moreover the functions $A(t,T)$ and $B(t,T)$ are quite complex and I don't think differentiating them would be a good idea.&#xA;$$A(t,T)=\bigg[\frac{2h\exp{\{(k+h)(T-t)/2\}}}{2h+(k+h)(\exp{\{(T-t)h\}-1})}\bigg]^{2k\theta/\sigma^2}$$&#xA;$$B(t,T)=\frac{2(\exp{\{(T-t)h\}-1)}}{2h+(k+h)(\exp{\{(T-t)h\}-1})}$$&#xA;$$h=\sqrt{k^2+2\sigma^2}$$&#xA;Source: Brigo &amp;amp; Mercurio, Interest Rate Models, 3.2.3&lt;/p&gt;&#xA;" OwnerUserId="24781" LastActivityDate="2016-10-31T11:37:43.373" Title="Chain rule for Ito's Lemma" Tags="&lt;fixed-income&gt;&lt;stochastic-calculus&gt;&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30806" PostTypeId="2" ParentId="30805" CreationDate="2016-10-31T11:37:43.373" Score="2" Body="&lt;p&gt;You have to go start from the original expression of $P$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P(t,T) = \mathbb{E}[e^{-\int_t^T r^s ds}|\mathcal{F}_t]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you define :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$M_t = e^{-\int_0^t r_s ds}P(t,T)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;this is a martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So since you are in a brownian filtration,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dM_t = \sigma_t dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It remains to find $\sigma_t$, which will be done by noticing that :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma^2_t dt = d&amp;lt;M_t&amp;gt; = (e^{-\int_0^t r_s ds})^2 d&amp;lt;P(t,T)&amp;gt;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;using your expression of $d&amp;lt;\ln P(t,T)&amp;gt;$ and since $d&amp;lt;P(t,T)&amp;gt;=P(t,T)^2 d&amp;lt;\ln P(t,T)&amp;gt;$&#xA;you get (using that $P(t,T)&amp;gt;0$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dP(t,T) = r_t P(t,T) dt + P(t,T)\sqrt{\frac{d&amp;lt;\ln P(t,T)&amp;gt;}{dt}}dW_t$$&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-10-31T11:37:43.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30807" PostTypeId="1" CreationDate="2016-10-31T12:29:01.197" Score="1" ViewCount="1436" Body="&lt;p&gt;I have a daily time series in a csv file. With the below command I read the data in a data.frame&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;test &amp;lt;- read.csv(&quot;xxxx.csv&quot;, header = T, sep=&quot;;&quot;, dec=&quot;,&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I want then to convert it in a time series object. Notice that the dates start at  02/01/2009 (d/m/Y) and end at 15/09/2016 (d/m/Y). I list below the number of observations per year:&#xA;2009 250 obs.&#xA;2010 250 obs.&#xA;2011 248 obs.&#xA;2012 249 obs.&#xA;2013 250 obs.&#xA;2014 250 obs.&#xA;2015 250 obs.&#xA;2016 179 obs. up to 15/09/2016&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I now that the ts method needs start and end dates and a frequency. For monthly data it is staraightforward to use fr = 12. What about my case? How may I create a time series object for daily data on working days?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use this approach:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;test.ts &amp;lt;- ts(test$Value, start = c(2009, 2), end = c(2016, 179), frequency = 250)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25018" LastEditorUserId="16148" LastEditDate="2016-10-31T12:49:20.580" LastActivityDate="2016-10-31T12:49:20.580" Title="R Help: Daily time series on business days" Tags="&lt;time-series&gt;&lt;r&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30808" PostTypeId="2" ParentId="28023" CreationDate="2016-10-31T12:30:19.107" Score="0" Body="&lt;p&gt;From the description, is it beta? Changes of Delta is captured by Beta, cause the price and value relation is not linear, so by simply considering Delta, it omits the shape of the relation curve.&lt;/p&gt;&#xA;" OwnerUserId="25091" LastActivityDate="2016-10-31T12:30:19.107" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30810" PostTypeId="1" CreationDate="2016-10-31T13:45:48.303" Score="0" ViewCount="193" Body="&lt;p&gt;What are some methods for estimating recovery rates for an entity? For example, say I am trying to find the recovery rate that would be used to price a single name CDS on JPMorgan.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The true recovery rate is of course highly uncertain and dependent on the distribution of debt within a company's capital structure. Is there a standard quantitative approach for trying to estimate this? Or is there a convenient traded asset whose price I can use to infer an appropriate rate? What method would be the most accurate?&lt;/p&gt;&#xA;" OwnerUserId="17712" LastActivityDate="2016-10-31T13:45:48.303" Title="Estimating Recovery Rates" Tags="&lt;probability&gt;&lt;cds&gt;&lt;recovery&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30812" PostTypeId="1" CreationDate="2016-10-31T20:33:05.263" Score="4" ViewCount="11725" Body="&lt;p&gt;I am finishing up a reference guide for my graduate students on key financial ratios. Would like to include S&amp;amp;P 500 current metrics in my guide. But need to know how reliable is this company CSI Market.  Thanks.&lt;/p&gt;&#xA;" OwnerUserId="25098" LastEditorUserId="16160" LastEditDate="2016-11-01T01:23:22.260" LastActivityDate="2021-03-07T01:53:04.113" Title="How reliable is data from CSI Market?" Tags="&lt;market-data&gt;&lt;market&gt;" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30815" PostTypeId="1" AcceptedAnswerId="30818" CreationDate="2016-11-01T11:31:27.837" Score="2" ViewCount="2071" Body="&lt;p&gt;This has always been difficult to understand for me. How is the second futures contract valued in relation to the front month contract? My understanding is there are carry considerations (3 more months of carry for basis) and there is basis switch price involved. However, in a world of prolonged low volatility and low nominal rate levels, basis switch is a thing of the past. So is carry be the main driver for calendar spread? Then assuming the same CTD, a long calendar spread position would be short front month basis and long next futures' basis. &lt;/p&gt;&#xA;" OwnerUserId="13375" LastActivityDate="2016-11-01T17:12:21.607" Title="How to trade interest rate futures calendar spread?" Tags="&lt;fixed-income&gt;&lt;futures&gt;&lt;valuation&gt;&lt;spread&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30816" PostTypeId="1" AcceptedAnswerId="30819" CreationDate="2016-11-01T13:12:15.123" Score="3" ViewCount="311" Body="&lt;p&gt;I am wondering, what kind of transaction costs practitioners (institutional investors) are faced to. Portfolio optimization literature often evaluates portfolio performance after adjusting for a value taking the form $T(\Delta) = 50/10.000 \sum_{i=1}^N |\Delta_i|$ where $\Delta_i$ is rebalancing of wealth in asset $i$. I do not expect this number to reflect what is really going on in the markets, however, due to the lack of better approximations the functional form above is used frequently in academia. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Does the proportionality constant of $50$ bp has some reliability in the industry?&lt;/li&gt;&#xA;&lt;li&gt;Do investors in reality face a fixed fee as soon as they touch a single asset? In other words, given I rebalance a small amount $\varepsilon&amp;gt;0$, am I going to by a fee anyway just because I called my broker?&lt;/li&gt;&#xA;&lt;li&gt;The form above also assumes that transaction costs keep smooth even I rebalance a lot of my wealth. Does this approximation hold in reality, for example by performing some form of smart order routing?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I am happy for every reply or reference coming up with new ideas on how one could take into consideration transaction costs!&lt;/p&gt;&#xA;" OwnerUserId="16249" LastActivityDate="2016-11-01T15:57:34.550" Title="How large are transaction costs in practice?" Tags="&lt;portfolio-management&gt;&lt;transaction-costs&gt;&lt;rebalancing&gt;&lt;market-impact&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30817" PostTypeId="2" ParentId="16995" CreationDate="2016-11-01T13:33:34.033" Score="2" Body="&lt;p&gt;That's right. Calibration is done in other to obtain one 'a' (mean reversion rate) and one sigma for the entire curve. This case is referred to as the Hull White model with constant mean reversion, i.e. the parameters are not time dependent.&lt;/p&gt;&#xA;" OwnerUserId="24917" LastActivityDate="2016-11-01T13:33:34.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30818" PostTypeId="2" ParentId="30815" CreationDate="2016-11-01T13:43:14.097" Score="6" Body="&lt;p&gt;Trading bond futures calendar spread is actually a very involved exercise, with many moving parts. But first things first, recall that bond futures price is approximately:&#xA;$$ F = \text{spot price} - \text{carry} - \text{delivery option value (DOV)} \pm \text{rich/cheap}.$$&#xA;So calendar spreads represent the differences in spot prices, in carries, in delivery options, and in the relative richness/cheapness. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This decomposition gives some clues on what drives calendar spreads:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Duration&lt;/strong&gt;: Typically (not always), the back-month contract has longer duration. When yields rise, the back contract will lose more money than the front contract, causing calendar spread to widen (rise). This suggests that bond calendar spread is actually very directional with interest rate. (Of course, you can always hedge out the duration risk by trading DV01-weighted calendar spread.)&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Curve&lt;/strong&gt;: When the yield curve steepens, back contract is also likely to underperform the front contract, which causes calendar spread to widen as well.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Repo&lt;/strong&gt;: This affects the carry component. Back contract has more repo exposures. When repo rate rises, back contract increases in value more than the front, causing the calendar spread to tighten. This factor becomes important when the Fed is active.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Switch Option&lt;/strong&gt;: Assuming delivery option is involved, then back contract is likely to be more sensitive to rising volatility. As a result, higher implied volatilities will widen calendar spread. A detailed scenario analysis should also be performed to determine how CTD switches may affect contract valuation.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Relative Value&lt;/strong&gt;: Futures may trade rich or cheap relative to fair value in persistent patterns, perhaps because market participants behave in predictable ways that cause temporary imbalances (more on this next).&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Flows&lt;/strong&gt;: During the roll period, perhaps the most important factor is flows. Real money asset managers tend not to hold their bond futures into the delivery month (because they can't accept physical delivery) and have to roll over to the next contract pretty much around the same time. So how they are positioned will affect the valuation of calendar spread profoundly. For example, if they're predominantly long, then they'll, in aggregate, have to sell the front contract and buy the back contract, causing calendar spread to tighten (all else equal).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2016-11-01T17:12:21.607" LastActivityDate="2016-11-01T17:12:21.607" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30819" PostTypeId="2" ParentId="30816" CreationDate="2016-11-01T13:46:47.257" Score="4" Body="&lt;p&gt;There are two types of costs one occurs while trading: commission fees and slippage. Commission fees (fixed amount paid to broker) are a based on a per share basis (amount per share x shares traded) while slippage (% worse/better execution than market) is a function of participation to total trading volume as well as the order type. Commission fee also depends on execution i.e. algorithm vs. discretionary. If you trade very liquid stocks,using algorithmic execution (i.e. VWAP) and trade below 3-5% of daily volume then commission fees can be $0.0015 per share and slippage &amp;lt;20bps. Think of this as your lower bound. If you trade illiquid stocks or bigger part of daily volume then slippage will increase. 50bps seems arbitrary, so unless you know the above conditions (trading volume, order type, execution venue) or you are able get some numbers from the brokers in order to model slippage, it would be more useful to find pnl decay to various costs assumptions and then think whether the strategy makes sense or not.&lt;/p&gt;&#xA;" OwnerDisplayName="user18489" LastEditorDisplayName="user18489" LastEditDate="2016-11-01T15:57:34.550" LastActivityDate="2016-11-01T15:57:34.550" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30820" PostTypeId="2" ParentId="30398" CreationDate="2016-11-01T16:03:13.143" Score="11" Body="&lt;p&gt;Credit risk is the risk for holding a risky bond. Counterparty risk is the risk that the counterparty will not be able to meet its contractual obligations if the credit event occur. For example, if you have a bond on AAPL and want to buy CDS to protect in case of bankruptcy (note you buy CDS from another counterparty -i.e. AIG- not the company), then credit risk reflects the possibility AAPL will not fully repay the bond, counterparty risk reflects the risk your counterparty (AIG) will not be able to pay you the amount it owes you if AAPL goes bankrupt.   &lt;/p&gt;&#xA;" OwnerDisplayName="user18489" LastActivityDate="2016-11-01T16:03:13.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30824" PostTypeId="1" AcceptedAnswerId="30825" CreationDate="2016-11-02T01:33:57.350" Score="0" ViewCount="38" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;If the price of every asset in a discrete model is strictly increasing, with probability one, then does the market admit arbitrage?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Thoughts: I believe this is true but I am not sure how to give an arbitrage argument to show that there exists some arbitrage strategy. Perhaps I am not understanding the implications of the question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions are greatly appreciated. &lt;/p&gt;&#xA;" OwnerUserId="19002" LastActivityDate="2016-12-02T04:28:27.920" Title="Price of every asset in discrete market model strictly increasing" Tags="&lt;arbitrage&gt;&lt;finance-mathematics&gt;&lt;math&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30825" PostTypeId="2" ParentId="30824" CreationDate="2016-11-02T02:29:33.507" Score="1" Body="&lt;p&gt;Off the top of my head, if interest rates are zero or negative, then yes.  Just borrow the purchase price and buy any asset.  Sell later and pay off the loan.  Otherwise no.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-11-02T02:29:33.507" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30827" PostTypeId="1" CreationDate="2016-11-02T05:07:36.490" Score="-1" ViewCount="504" Body="&lt;p&gt;I'm having trouble understanding how Futures are worth more than Forwards when price and interest rates are positively correlated but both declining. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, a Future with losses of -5 at T(n-1) and -5 at T(n) vs. a Forward with losses of -10 at T(n).  How is the Future more valuable?  Most textbooks I've read explain it as &quot;losses derived from a falling futures price can be financed at a lower interest rate&quot;, but you're still having to borrow 5 at T(n-1) and paying back 5(1+r) at T(n). So total losses for the Future are 5+5(1+r) which is greater than 10 for the forward.&lt;/p&gt;&#xA;" OwnerUserId="25120" LastActivityDate="2017-10-28T17:48:46.247" Title="Falling Futures prices positively correlated with interest rates" Tags="&lt;interest-rates&gt;&lt;correlation&gt;&lt;futures&gt;&lt;forward&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30828" PostTypeId="1" AcceptedAnswerId="30837" CreationDate="2016-11-02T07:57:33.827" Score="2" ViewCount="345" Body="&lt;p&gt;I want to calculate $E_t[(X_T-K)^+]$ where&#xA;$$dX_t=\frac{3}{X_t}dt+2X_t dW_t$$&#xA;and $X_0=x$.  I don't  know how extact the strong solution of  this SDE. Indeed I used Ito's lemma but it was not usefule.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for attantion.&lt;/p&gt;&#xA;" OwnerUserId="22715" LastActivityDate="2016-11-02T17:42:51.703" Title="What is the strong solution for this SDE" Tags="&lt;option-pricing&gt;&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30829" PostTypeId="2" ParentId="30827" CreationDate="2016-11-02T08:15:24.383" Score="0" Body="&lt;p&gt;Call $G_t$ the price of the future, and $F_{t,T}$ the price of a forward at time t with maturity T. You know that by NA $F_{t,T}=R_{t,T}E_t[S_T]=R_{t,T} S_t$ where $R_{t,T}$ is the gross return on a risk free bond with maturity T and $E_t[ \cdot ]$ is a &lt;strong&gt;risk neutral&lt;/strong&gt; expectation. One day before maturity the price of the future will be such that $$G_{T-1}=R_{T-1,T}E_{T-1}[S_T]$$ and two days before maturity $$G_{T-2}=R_{T-2,T-1}E[G_{T-1}]=E_{T-2}[R_{T-2,T-1}R_{T-1,T}S_T]=\\E_{T-2}[R_{T-2,T-1}R_{T-1,T}]E_{T-2}[S_T]+Cov_{T-2}[R_{T-2,T-1}R_{T-1,T},S_T]$$&#xA;You can also rewrite $E_{T-2}[S_T]=\frac{F_{T-2,T}}{R_{T-2,T}}$ and if $\frac{R_{T-2,T-1}R_{T-1,T}}{R_{T-2,T}}\approx 1$ then&#xA;$$G_{T-2}\approx F_{T-2,T}+Cov_{T-2}[R_{T-2,T-1}R_{T-1,T},S_T]$$&lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2016-11-02T08:15:24.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30830" PostTypeId="1" CreationDate="2016-11-02T08:40:00.300" Score="0" ViewCount="50" Body="&lt;p&gt;I'm reading a report about the effects of the introduction of the additional income tax rate in the UK, which was released in 2010 which can be found &lt;a href=&quot;http://webarchive.nationalarchives.gov.uk/20130129110402/http:/www.hmrc.gov.uk/budget2012/excheq-income-tax-2042.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;. Table 5.1 shows a sudden jump in dividend income, followed by a sudden drop, during 2009-11 but the report only describes this as forestalling behaviour, can anyone explain why this happen. Is it because investors who were earning income just above the additional rate were trying to lower their income by placing their wealth in dividends before the arrival of the additional income tax rate&lt;/p&gt;&#xA;" OwnerUserId="25122" LastActivityDate="2017-05-18T10:19:09.897" Title="Can anyone explain why dividend income shot up during 2009-10 and then back down in 2010-11" Tags="&lt;dividends&gt;&lt;income&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30831" PostTypeId="1" AcceptedAnswerId="30833" CreationDate="2016-11-02T08:59:37.567" Score="0" ViewCount="1282" Body="&lt;p&gt;I'm considering to develop a visualization tool, in which the candle stick plot is a big part. I've seen people doing this using Python's matplotlib, Qt and PyQt. There are also several tools out there helping to draw financial plots. I'm now a bit lost, can anyone kindly give me some suggestions about which tool to use?&#xA;Other requirements: the plot needs to be dynamic, and can zoom in/out. Also, my programming skill is limited, C++ should be avoided in the case Python can solve the problem well enough.&#xA;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="22069" LastActivityDate="2016-11-10T17:02:42.887" Title="Which tool is best for drawing candle stick plot?" Tags="&lt;data&gt;&lt;market-data&gt;&lt;visualization&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30832" PostTypeId="2" ParentId="30828" CreationDate="2016-11-02T10:08:20.817" Score="3" Body="&lt;p&gt;You shouldn't say: &quot;Ito's lemma wasn't useful&quot;. Set &#xA;$$Y_t=-2W_t+2t\tag 1$$&#xA;Note $W_0=0$ thus $Y_0=0$.We have&#xA;$$dY_t=2\,dt-2\,dW_t\tag 2$$&#xA;Set $Z_t=e^{Y_t}$. By application of Ito's lemma, we have&#xA;$$dZ_t=e^{Y_t}\,dY_t+\frac{1}{2}e^{Y_t}d[Y_t,Y_t]\tag 3$$&#xA;therefore&#xA;$$dZ_t=4e^{Y_t}dt-2\,e^{Y_t}dW_t=4Z_tdt-2Z_tdW_t\tag 4$$&#xA;on the other hand&#xA;$$d(X_t\,Z_t)=Z_t\,dX_t+X_t\,dZ_t+d[X_t,Z_t]\tag 5$$&#xA;thus&#xA;$$d(X_t\,Z_t)=\frac{3Z_t}{X_t}dt\tag 6$$&#xA;in other words&#xA;$$d(X_t\,Z_t)=\frac{3Z_t^2}{X_tZ_t}dt\tag 7$$&#xA;set $R_t=X_tZ_t$. We have&#xA;$$dR_t=\frac{3Z_t^2}{R_t}dt\tag 8$$&#xA;This can be solved as a regular ODE with separable variables :&#xA;$$R_t\,dR_t=3Z_t^2\, dt$$&#xA;and&#xA;$$\frac{1}{2}R_t^2-\frac{1}{2}R_0^2=3\int_0^{t}Z_s^2ds\\&#xA;\frac{1}{2}R_t^2-\frac{1}{2}x^2=3\int_0^{t}Z_s^2ds\tag 9$$&#xA;then&#xA;$$X_t^2=e^{-2Y_t}\left(x^2+6\int_0^{t}e^{2Y_s}ds\right)\tag {10}$$&#xA;Finally&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$$\color{red}{X_t^2=e^{4W_t-4t}\left(x^2+6\int_0^{t}e^{-4W_s+4s}ds\right)\tag{11}}$$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now How can you calculate $\mathbb{E}_t[(X_T-K)^+]?$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-11-02T10:25:39.680" LastActivityDate="2016-11-02T10:25:39.680" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30833" PostTypeId="2" ParentId="30831" CreationDate="2016-11-02T10:55:30.333" Score="1" Body="&lt;p&gt;Have a look at &lt;a href=&quot;http://bokeh.pydata.org/en/latest/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bokeh&lt;/a&gt;. It makes it very easy to create browser based dynamic visualizations from Python and integrates very well with Juptyer. &lt;a href=&quot;http://bokeh.pydata.org/en/latest/docs/gallery/candlestick.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Here&lt;/a&gt; is a candlestick example incl. pan, zoom, ...&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2016-11-02T10:55:30.333" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30834" PostTypeId="1" CreationDate="2016-11-02T11:14:49.923" Score="4" ViewCount="2290" Body="&lt;p&gt;I love quantmod package in R but now I am slowly moving towards python using pandas for my trading experiments. I have searched a lot for quantmod alternative for python but sofar I was unsuccessful. We can use pandas itself for downloading datas from the internet but its the other &lt;a href=&quot;http://www.quantmod.com/documentation/00Index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;small functions&lt;/a&gt; like &lt;strong&gt;Cl,Ad,OpHi,ROC,Delt,dailyReturns&lt;/strong&gt; etc and technical indicators such as &lt;strong&gt;EMA, RSI, MACD,SMI etc&lt;/strong&gt; I misses a lot. I have found these two packages for technical analysis &lt;a href=&quot;https://github.com/mrjbq7/ta-lib&quot; rel=&quot;nofollow noreferrer&quot;&gt;ta-lib&lt;/a&gt; and &lt;a href=&quot;https://github.com/femtotrader/pandas_talib&quot; rel=&quot;nofollow noreferrer&quot;&gt;pandas_talib&lt;/a&gt; but both are not a good package for pandas. The former one strips the time series and we have to work with numpy array and the later has many bugs in it. Which library in python(with pandas) is the best alternative for quantmod in R.&lt;/p&gt;&#xA;" OwnerUserId="16754" LastActivityDate="2017-10-03T22:17:51.127" Title="Quantmod alternative for pandas?" Tags="&lt;python&gt;&lt;software&gt;&lt;opensource&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30835" PostTypeId="2" ParentId="30111" CreationDate="2016-11-02T12:38:42.680" Score="0" Body="&lt;p&gt;&lt;em&gt;Spread (e) = Y - bX&lt;/em&gt; - this is the synthetic instrument that you are trading. If &lt;em&gt;e&lt;/em&gt; is low you go long &lt;em&gt;e&lt;/em&gt;, that means you long 1 share of &lt;em&gt;Y&lt;/em&gt; and short &lt;em&gt;b&lt;/em&gt;X* shares. Same for the short of &lt;em&gt;e&lt;/em&gt;, short 1 share of &lt;em&gt;Y&lt;/em&gt; long &lt;em&gt;b&lt;/em&gt;X* shares. These are the standard theoretical assumptions. I assume you can calculate PNL from this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I did a lot of tests with pair trading and would propose to you a different methodology, since if you have a lot of pairs you will eventually run into several problems:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) First do not use 1 share per Y and b share per X, use 100. Example: long 100 Y shares, short b*100 X shares, since if b &amp;lt; 1 you can't trade less that 1 share.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) There will be pairs where beta is very small and alpha is very big but since you use only beta, that will suggest putting all your capital in Y, which is wrong. The work around that I used was not using beta to calculate the amount of shares (only use it compute the spread). I have calculated the amount of shares per each side by dividing the total capital (C) allocated to a pair trade by 2 and the dividing that part by the price of a stock. Example: Number of Y shares to trade = (C/2)/(Price of Y stock); number of X shares to trade = (C/2)/(Price of X stock). This approach actually yielded better returns on a lot of tests and it's still is a good approximation. &lt;/p&gt;&#xA;" OwnerUserId="17921" LastActivityDate="2016-11-02T12:38:42.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30836" PostTypeId="1" CreationDate="2016-11-02T14:15:19.510" Score="0" ViewCount="60" Body="&lt;p&gt;Sometimes CB intervenes in fx market buy buying or selling currency to make it stay in some band. My question is how does Central Bank determine the size of interventions? I mean how do they know how much money they need to spend? For example buy 100m usd or 200musd?&lt;/p&gt;&#xA;" OwnerUserId="25125" LastActivityDate="2016-11-03T04:09:31.467" Title="Central Bank intervention in forex market" Tags="&lt;economics&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30837" PostTypeId="2" ParentId="30828" CreationDate="2016-11-02T14:22:23.173" Score="2" Body="&lt;p&gt;Note that&#xA;\begin{align*}&#xA;d\left(X_t^2\right) &amp;amp;= 2X_t dX_t + d\langle X, X\rangle_t\\&#xA;&amp;amp;=(6+4X_t^2)dt + 4X_t^2dW_t,&#xA;\end{align*}&#xA;which can be solved using the technique with an &lt;em&gt;integral factor&lt;/em&gt;. Specifically, note that&#xA;\begin{align*}&#xA;d\left(e^{4t-4W_t}X_t^2 \right) &amp;amp;= X_t^2 d\left(e^{4t-4W_t}\right) + e^{4t-4W_t} d(X_t^2) + \left\langle d\left(e^{4t-4W_t}\right), d(X_t^2) \right\rangle\\&#xA;&amp;amp;=e^{4t-4W_t}X_t^2(12dt-4dW_t)\\&#xA;&amp;amp;\quad +e^{4t-4W_t}\left[(6+4X_t^2)dt + 4X_t^2dW_t\right]- 16  e^{4t-4W_t}X_t^2 dt\\&#xA;&amp;amp;=6e^{4t-4W_t} dt.&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;e^{4t-4W_t}X_t^2 &amp;amp;= x^2+6\int_0^t e^{4s-4W_s} ds.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;X_t^2 = e^{4W_t-4t}\left(x^2+6\int_0^t e^{4s-4W_s} ds \right).&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A general note. For an equation of the form&#xA;  \begin{align*}&#xA;dY_t = (aY_t+b)dt + (cY_t+d) dW_t, &#xA;\end{align*}&#xA;  we can apply an integral factor of the form $$e^{(-a+\frac{1}{2}c^2)t -cW_t}.$$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-11-02T17:42:51.703" LastActivityDate="2016-11-02T17:42:51.703" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30838" PostTypeId="1" CreationDate="2016-11-02T14:35:20.750" Score="1" ViewCount="80" Body="&lt;p&gt;I would always presume that the portfolio consists of 1 stock and 1 risk-free asset. And that the $r, \alpha,\sigma$ are all non-zero, but might be time-dependent. When I say &quot;any&quot; option, I am actually referring to an option of the above type.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that &quot;any&quot; European option can be perfectly dynamically hedged. In the discrete-time case, you can solve for the coefficients of each part of the portfolio backwards. Since this can be done in the discrete-time case, intuitively I believe that this can also be done in the continuous-time case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I look at some type of option whose payoff depends on the stock price in the past in an arbitrary way (e.g. some option that is even more complicated than exotic option/American option), I can't find any intuition to convince myself that this option can be perfectly dynamically hedged, even in the discrete-time case. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Chapter 5 of Steven E. Shreve's book &quot;Stochastic Calculus for Finance 2 Continuous-Time Models&quot;,  he defines a complete market as a market where every derivate security can be hedged. It looks like that the existence of such a  definition has an implication that &quot;a properly designed option can be dynamically hedged&quot;. I wonder where is the intuition from?&lt;/p&gt;&#xA;" OwnerUserId="25086" LastEditorUserId="25086" LastEditDate="2016-11-02T15:58:49.517" LastActivityDate="2016-11-02T15:58:49.517" Title="What is the intuition to believe that a properly designed option can be dynamically hedged (just for the 1 stock case)?" Tags="&lt;risk-neutral-measure&gt;&lt;quants&gt;&lt;market-model&gt;&lt;hedge&gt;" AnswerCount="0" CommentCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="30839" PostTypeId="1" CreationDate="2016-11-02T15:25:14.440" Score="5" ViewCount="147" Body="&lt;p&gt;For the last few weeks, the 12-month ATM call implied volatility of MUFG (TSE 8306) has been trending around 30-35% (according to Bloomberg). This is by far the highest of the major Japanese banks by about 10%. As a proxy for risk expectations, it ranks similarly to Barclays, Credit Suisse, BNP etc which I would have rated as much more risky. GARCH and historical volatility for MUFG are about 10-15% lower, at a level similar to the other Japanese banks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why would there be such a large discrepancy for MUFG and what does that imply about its risk profile? Is it a sensible metric to use for volatility and for risk expectations or is some market activity distorting it?&lt;/p&gt;&#xA;" OwnerUserId="17712" LastEditorUserId="17712" LastEditDate="2016-11-02T18:52:37.510" LastActivityDate="2017-01-20T00:25:19.407" Title="Why is the implied volatility on Bank of Tokyo-Mitsubishi UFJ trending so high?" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;derivatives&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30840" PostTypeId="2" ParentId="30836" CreationDate="2016-11-02T18:06:41.460" Score="2" Body="&lt;p&gt;They can simply place a (very large) limit order at the determined price level(s).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, when the SNB wanted to keep EUR/CHF above 1.20 they had a large buy order at 1.20 (i.e. they agreed to buy 1 EUR for 1.20 CHF) and this guarantees that the EUR/CHF rate stays above 1.20 for as long as the limit order is in place.&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2016-11-02T18:06:41.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30841" PostTypeId="1" CreationDate="2016-11-02T18:53:47.057" Score="1" ViewCount="162" Body="&lt;p&gt;When constructing curves, are there any generic and quantitative metrics that can be computed for any kind curve(government, corporate, swap, exc.. exc..)?&lt;/p&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="1764" LastEditDate="2016-11-05T02:09:14.480" LastActivityDate="2016-11-05T05:58:25.727" Title="Metrics for curve quality" Tags="&lt;curve-fitting&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30842" PostTypeId="1" CreationDate="2016-11-02T20:11:00.020" Score="0" ViewCount="113" Body="&lt;p&gt;Consider the SDE&#xA;$$&#xA;dT(t) = ds(t) + a(s(t) - T(t))dt + \sigma dW(t)&#xA;$$&#xA;where $s(t)$ is a deterministic function that turns out to be the long-term mean (this SDE is used to model daily temperature, so $s$ consists of sines and cosines).  The solution is&#xA;$$&#xA;T(t) = s(t) + (T(0) - s(0))e^{-at} + \int_0^t \sigma e^{-a(t-u)} \, dW(u)&#xA;$$&#xA;I'm trying to estimate the volatility parameter $\sigma$, and I've tried two methods, but they give quite inconsistent results and I'd like to understand the differences.  The first method is to note we can use the solution to write the difference $\Delta T(t) := T(t+1) - T(t)$ as&#xA;$$&#xA;\Delta T(t) = \Delta s(t) - (1 - e^{-a})(T(t) - s(t)) + \sigma e^{-a}\int_t^{t+1}e^{-a(t-u)}\, dW(u)&#xA;$$&#xA;If we then approximate the integral using the left-hand rule, we get&#xA;$$&#xA;\Delta T(t) \approx \Delta s(t) - (1 - e^{-a})(T(t) - s(t)) + \sigma e^{-a}\Delta W(t)&#xA;$$&#xA;and rearranging a bit (and assuming equality) gives&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$$ T(t+1) - s(t+1) = e^{-a}(T(t) - s(t)) + e^{-a}\sigma \epsilon(t) $$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;where $\epsilon(t) \sim \mathcal{N}(0,1)$, i.i.d.  So we have a regression on $T - s$ with regression coefficient $e^{-a}$, and can estimate $\sigma$ by computing the sample standard deviation of the residuals and dividing by $e^{-a}$, where the residuals are $[T(t+1) - s(t+1)] - [e^{-a}(T(t) - s(t))]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second method is to discretize the SDE from the start:&#xA;$$&#xA;T(t+1) - T(t) = s(t+1) - s(t) + a(s(t) - T(t)) + \sigma \epsilon(t)&#xA;$$&#xA;Rearranging also gives a regression equation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$$ T(t+1) - s(t+1) = (1-a)(T(t) - s(t)) + \sigma \epsilon(t) $$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So we again have a regression on $T - s$ with regression coefficient $1-a$, and can again estimate $\sigma$ by computing the sample standard deviation of the residuals $[T(t+1) - s(t+1)] - [(1-a)(T(t) - s(t))]$, with no need to divide by anything at the end.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that &lt;em&gt;we get the same sample standard deviation estimate for both methods&lt;/em&gt;, and thus the two estimates of $\sigma$ will be off by a factor of $e^{-a}$.  I recognize that, had I used the right-hand rule to approximate the stochastic integral, the factor of $e^{-a}$ multiplying $\sigma$ in the first method would disappear, and we'd get the same estimates for $\sigma$.  So, I'd like to know which method of the two is preferred, and whether switching to a right-hand rule is kosher.&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2016-11-02T20:11:00.020" Title="Approximating an SDE for Volatility Estimation" Tags="&lt;volatility&gt;&lt;stochastic-calculus&gt;&lt;estimation&gt;&lt;sde&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30843" PostTypeId="1" AcceptedAnswerId="30856" CreationDate="2016-11-02T20:51:11.837" Score="2" ViewCount="190" Body="&lt;p&gt;&lt;strong&gt;Background Information:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A market satisfies the Law of One Price if every two self-financing strategies that replicate the same claim have the same initial value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An inconsistent pricing strategy is a self-financing strategy $\phi$ with $V_T(\phi)\equiv 0$ and $V_0(\phi) &amp;lt; 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Prove the Law of One Price holds if and only if there does not exist an inconsistent pricing strategy.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Attempted proof - Suppose we have two self financing strategies $\phi$ and $\psi$ that replicates some claim $X$ such that $V_0(\phi) = V_0(\psi)$. Hence we cannot satisfy the condition of $V_0(\phi) &amp;lt; 0$ nor $V_0(\psi) &amp;lt; 0$ so there is no inconsistent pricing strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure how to show the converse and whether this is rigorous enough. Any suggestions are greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="19002" LastActivityDate="2016-11-03T16:31:30.040" Title="Law of One price and the Inconcistent pricing strategy" Tags="&lt;arbitrage&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;&lt;financial-engineering&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30844" PostTypeId="1" CreationDate="2016-11-02T22:25:56.527" Score="2" ViewCount="4408" Body="&lt;p&gt;Is it quantitatively sound to say that if I have assets $x, y,$ and $z$ in a portfolio, and that the total variance of the portfolio is defined as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma_p ^2 = w_x^2\sigma_x^2 + w_y^2\sigma_y^2 +w_y^2w\sigma_y^2 + 2w_xw_y\sigma_{xy} + 2w_yw_z\sigma_{yz} + 2w_xw_z\sigma_{xz}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;that the individual risk contribution of each individual asset is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;${\sigma_p}_x^2 = w_x^2\sigma_x^2 + \sigma_{xy} + \sigma_{xz}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;${\sigma_p}_y^2 = w_y^2\sigma_y^2 + \sigma_{xy} + \sigma_{yz}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;${\sigma_p}_z^2 = w_z^2\sigma_z^2 + \sigma_{xz} + \sigma_{yz}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it mathematically sound to assume that the risk of the portfolio is the sum of the risk of each asset with respect to the other assets? Or is the portfolio risk not something that can broken down in a defined way?&lt;/p&gt;&#xA;" OwnerUserId="19473" LastEditorUserId="19473" LastEditDate="2016-11-04T14:25:54.217" LastActivityDate="2017-03-05T05:22:48.203" Title="Risk contribution of part of a portfolio" Tags="&lt;risk&gt;&lt;modern-portfolio-theory&gt;&lt;mean-variance&gt;&lt;markowitz&gt;" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30845" PostTypeId="1" AcceptedAnswerId="31322" CreationDate="2016-11-02T22:53:21.480" Score="4" ViewCount="595" Body="&lt;p&gt;I am interested in using a 4th order finite difference method in (underlying asset) space to price a European call basket option. I have developed the solver and everything works as expected, except that no matter how high the order of my numerical method is, the maximum convergence rate is always of the second order due to the discontinuity in the first derivative of the payoff function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Luckily, there is a &lt;strong&gt;smoothing&lt;/strong&gt; remedy for this, proven around 1970, in a classic paper &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1002/cpa.3160230210/abstract&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;em&gt;Smoothing of initial data and rates of convergence for parabolic difference equations&lt;/em&gt;&lt;/a&gt; by Kreiss et al. This was more recently used in &lt;a href=&quot;http://epubs.siam.org/doi/pdf/10.1137/140974833&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;em&gt;High-Order Compact Schemes for Parabolic Problems with Mixed Derivatives in Multiple Space Dimensions&lt;/em&gt;&lt;/a&gt; by Düring et al, but without explanation on how the function given by its Fourier transform in Chapter 9 of that paper is inverted and inserted into the smoothing integral.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would appreciate a lot if someone has an idea about how to perform this 4th order smoothing procedure. Practically, I need to solve the following integral:&#xA;$$\tilde{u}_0(s)=\frac{1}{h}\int_{-3h}^{3h} \Phi_4\left(\frac{x}{h}\right)u_0(s-x)\text{d}x,$$&#xA;where $\Phi_4$ is given by its Fourier transform:&#xA;$$\hat{\Phi}_4(\omega)=\left(\frac{\sin(\omega/2)}{\omega/2}\right)^4\times\left(1 + \frac{2}{3}\sin^2(\omega/2)\right).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&#xA;I managed to solve the problem using symbolic powers of Mathematica and Matlab. The solution to the inverse Fourier problem is given below as a Matlab code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;f4 = @(x) (1/36)*(1/2)*...&#xA;    ( +56*x.^3.*sign(x) +(x-3).^3.*(-sign(x-3)) +12*(x-2).^3.*sign(x-2) -39*(x-1).^3.*sign(x-1) -39*(x+1).^3.*sign(x+1) +12*(x+2).^3.*sign(x+2) -(x+3).^3.*sign(x+3));&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then one just needs to plug this expression into the integral given in the first equation along with their favorite initial condition and solve it with a method of preference.&lt;/p&gt;&#xA;" OwnerUserId="25124" LastEditorUserId="25124" LastEditDate="2016-12-06T15:40:31.547" LastActivityDate="2019-02-18T21:11:12.093" Title="Smoothing of the payoff function as a terminal condition for numerical option pricing" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;numerical-methods&gt;&lt;basket&gt;&lt;finite-difference-method&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30846" PostTypeId="2" ParentId="30844" CreationDate="2016-11-03T00:24:34.430" Score="1" Body="&lt;p&gt;It depends.  I don't believe there is any &quot;right&quot; way to allocate risk to asstets in a portfolio, though there are several &quot;good&quot; ways to do so.  One I'm partial to is the Euler's method which essentially defines the risk contribution of an asset to the portfolio is the derivative of the portfolio with respect to a change in the asset, as described in &lt;a href=&quot;https://arxiv.org/pdf/0708.2542.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Tasche's paper&lt;/a&gt;.  In the case of variance then this becomes a fairly straightforward calculation.  BTW, you have some typos in your portfolio variance calculation.&lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2016-11-03T00:24:34.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30848" PostTypeId="2" ParentId="30836" CreationDate="2016-11-03T04:09:31.467" Score="2" Body="&lt;p&gt;They don't know how much intervention will be required to keep the currency at a given level. It depends how much other market participants want to resist the move.   If the central bank is relatively weak, with limited reserves, participants may choose to challenge the intervention, for example.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-11-03T04:09:31.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30850" PostTypeId="2" ParentId="30683" CreationDate="2016-11-03T12:10:24.400" Score="1" Body="&lt;p&gt;The below code works for us:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    final boolean includeIntercept = false;&#xA;    SimpleRegression simpleRegression = new SimpleRegression(includeIntercept);&#xA;&#xA;    for (int i = 0; i &amp;lt; symbol1Bars.size(); i++) {&#xA;        simpleRegression.addData(symbol1Bars.get(i).getClose(), symbol2Bars.get(i).getClose());&#xA;    }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This uses the &lt;a href=&quot;http://search.maven.org/#artifactdetails%7Corg.apache.commons%7Ccommons-math3%7C3.6.1%7Cjar&quot; rel=&quot;nofollow noreferrer&quot;&gt;Apache Commons Math 3 library&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="24955" LastActivityDate="2016-11-03T12:10:24.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30852" PostTypeId="1" CreationDate="2016-11-03T13:18:29.547" Score="0" ViewCount="1165" Body="&lt;p&gt;Is there any number or estimate for the total notional in structured products in the market? I could only find figures for Germany.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What about across categories? I.e. Equity linked notes, index linked notes exc. exc.&lt;/p&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="1764" LastEditDate="2016-11-03T14:47:27.993" LastActivityDate="2016-11-03T16:02:42.910" Title="Total market size of structured products" Tags="&lt;structured-finance&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30853" PostTypeId="2" ParentId="8114" CreationDate="2016-11-03T13:45:17.517" Score="1" Body="&lt;p&gt;You can find some implementations in the open-source python Library : &lt;a href=&quot;https://github.com/AlexandreMoulti/bachelier&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/AlexandreMoulti/bachelier&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your contributions would be very welcome.&lt;/p&gt;&#xA;" OwnerUserId="19011" LastActivityDate="2016-11-03T13:45:17.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30855" PostTypeId="2" ParentId="30852" CreationDate="2016-11-03T16:02:42.910" Score="1" Body="&lt;p&gt;I am not aware of global figures. But for the European market for structured products, you can have a look at &lt;a href=&quot;http://www.eusipa.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;www.eusipa.org&lt;/a&gt;. They aggregate the national figures, including the German ones that you probably found on &lt;a href=&quot;http://www.derivateverband.de&quot; rel=&quot;nofollow noreferrer&quot;&gt;www.derivateverband.de&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2016-11-03T16:02:42.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30856" PostTypeId="2" ParentId="30843" CreationDate="2016-11-03T16:31:30.040" Score="2" Body="&lt;p&gt;Assume the law of one price. We show that there does not exist an inconsistent pricing strategy. Suppose that $\phi$ is an inconsistent self-financing trading strategy, that is, $V_T(\phi)\equiv 0$ and $V_0(\phi) &amp;lt; 0$. Consider another self-financing trading strategy $\psi$ that does not nothing, that is, without holding any of the underlying assets. Then $V_T(\psi)\equiv 0$ and $V_0(\psi) = 0$. This contradicts the law of one price, since both $\phi$ and $\psi$ replicate the same claim, but the initial prices are different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, assuming that there does not exist an inconsistent pricing strategy, we show that the law of one price holds. Consider any two self-financing trading strategies $\phi_1$ and $\phi_2$ such that $V_T(\phi_1) = V_T(\phi_2)$. Note that $\phi=\phi_1-\phi_2$ is also a self-financing trading strategy, and $V_T(\phi) = V_T(\phi_1) - V_T(\phi_2)\equiv 0$. Since there does not exist an inconsistent pricing strategy, $V_0(\phi) \equiv 0$. That is, $V_0(\phi_1) =V_0(\phi_2)$. Therefore, the law of one price holds.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-11-03T16:31:30.040" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30860" PostTypeId="1" AcceptedAnswerId="30868" CreationDate="2016-11-03T22:42:14.480" Score="1" ViewCount="299" Body="&lt;p&gt;I have four Monte Carlo simulations and will list them in order of highest standard error to lowest.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Plain MC&lt;/li&gt;&#xA;&lt;li&gt;MC with delta hedge control variate&lt;/li&gt;&#xA;&lt;li&gt;MC with antithetic variate&lt;/li&gt;&#xA;&lt;li&gt;MC with antithetic and delta variates&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;My textbook makes it seem as though the delta hedge should reduce SE more than the antithetic variate, but my results always show different.  I am using 300 time steps and 100,000 simulations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it helps, my Black-Scholes $\Delta$ is computed as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(exp(-div*(M-t))*pnorm((log(St1/K)+(r-div+((sig^2)/2))*(M-t))/(sig*(sqrt(M-t))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;t = (i-1)*dt&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;i&lt;/code&gt; is the time step&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="25145" LastEditorUserId="467" LastEditDate="2016-11-07T02:27:22.157" LastActivityDate="2016-11-07T02:27:22.157" Title="In a Monte Carlo simulation, will a delta hedge control variate necessarily reduce the standard error more than an antithetic variate?" Tags="&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;simulations&gt;&lt;delta-hedging&gt;&lt;error&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30863" PostTypeId="1" AcceptedAnswerId="30864" CreationDate="2016-11-04T06:28:07.687" Score="4" ViewCount="579" Body="&lt;p&gt;The Vasicek short rate model is&#xA;$$dr_t=\kappa(\theta-r_t)dt+\sigma dW_t$$&#xA;Define the processes $x_t$ and $f(x,t)$&#xA;$$x_t=\frac{r_t}{\kappa}(1-e^{-\kappa(T-t)})+\int_0^tr_sds$$&#xA;$$f(x,t)=e^{a(T-t)-x_t}$$&#xA;Note that $a(t)$ is a function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question 1: Find $df(x,t)$ using Ito's Lemma.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My attempt:&#xA;\begin{align}&#xA;dx_t&amp;amp;=\frac{1-e^{-\kappa(T-t)}}{\kappa}dr_t+\frac{r_t}{\kappa}(-e^{-\kappa(T-t)})\kappa dt\\&#xA;&amp;amp;=\frac{1-e^{-\kappa(T-t)}}{\kappa}(\kappa(\theta-r_t)dt+\sigma dW_t)-r_te^{-\kappa(T-t)}dt\\&#xA;&amp;amp;=(1-e^{-\kappa(T-t)})(\theta-r_t)dt+\frac{\sigma}{\kappa}(1-e^{-\kappa(T-t)})dW_t-r_te^{-\kappa(T-t)}dt\\&#xA;&amp;amp;=\Big( (1-e^{-\kappa(T-t)})\theta-r_t+r_te^{-\kappa(T-t)}-r_te^{-\kappa(T-t)}\Big)dt+\frac{\sigma}{\kappa}(1-e^{-\kappa(T-t)})dW_t\\&#xA;&amp;amp;=\Big( (1-e^{-\kappa(T-t)})\theta-r_t\Big)dt+\frac{\sigma}{\kappa}(1-e^{-\kappa(T-t)})dW_t&#xA;\end{align}&#xA;$$(dx_t)^2=\frac{\sigma^2}{\kappa^2}(1-e^{-\kappa(T-t)})^2dt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\ln{f(x,t)}=a(T-t)-x_t$$&#xA;$$d\ln{f(x,t)}=d_ta(T-t)-dx_t=d_ta(T-t)-\Big( (1-e^{-\kappa(T-t)})\theta-r_t\Big)dt-\frac{\sigma}{\kappa}(1-e^{-\kappa(T-t)})dW_t$$&#xA;$$(d\ln{f(x,t)})^2=(dx_t)^2=\frac{\sigma^2}{\kappa^2}(1-e^{-\kappa(T-t)})^2dt$$&#xA;Applying Ito's Lemma to $f(x,t)$&#xA;\begin{align}&#xA;d(e^{\ln{f(x,t)}})&amp;amp;=f(x,t)d\ln{f(x,t)}+\frac{1}{2}f(x,t)(d\ln{f(x,t)})^2\\&#xA;&amp;amp;=f(x,t)\Bigg(d_ta(T-t)-\Big( (1-e^{-\kappa(T-t)})\theta-r_t\Big)dt-\frac{\sigma}{\kappa}(1-e^{-\kappa(T-t)})dW_t\Bigg)+\frac{\sigma^2}{2\kappa^2}(1-e^{-\kappa(T-t)})^2dt\\&#xA;&amp;amp;=f(x,t)\Bigg(\frac{d}{dt}a(T-t)-\Big( (1-e^{-\kappa(T-t)})\theta-r_t\Big)+\frac{\sigma^2}{2\kappa^2}(1-e^{-\kappa(T-t)})^2\Bigg)dt-\frac{\sigma}{\kappa}(1-e^{-\kappa(T-t)})dW_t\\&#xA;\end{align}&#xA;Question 2: Find the dynamics of the function $a(t)$ such that the process $f(x,t)$ is a martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My attempt:&#xA;$$\frac{d}{dt}a(T-t)-\Big( (1-e^{-\kappa(T-t)})\theta-r_t\Big)+\frac{\sigma^2}{2\kappa^2}(1-e^{-\kappa(T-t)})^2=0$$&#xA;$$\frac{d}{dt}a(T-t)=\Big( (1-e^{-\kappa(T-t)})\theta-r_t\Big)-\frac{\sigma^2}{2\kappa^2}(1-e^{-\kappa(T-t)})^2$$&#xA;$$d_ta(T-t)=\Bigg(\Big( (1-e^{-\kappa(T-t)})\theta-r_t\Big)-\frac{\sigma^2}{2\kappa^2}(1-e^{-\kappa(T-t)})^2\Bigg)dt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone confirm the correctness of my attempts? Any help is appreciated.&lt;/p&gt;&#xA;" OwnerUserId="24781" LastEditorUserId="24781" LastEditDate="2016-11-04T10:01:51.303" LastActivityDate="2016-11-04T10:01:51.303" Title="Application of Ito's Lemma, finding the condition for the martingale" Tags="&lt;fixed-income&gt;&lt;stochastic-calculus&gt;&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30864" PostTypeId="2" ParentId="30863" CreationDate="2016-11-04T08:10:01.667" Score="5" Body="&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&#xA;$$dx_t=\frac{1-e^{-\kappa(T-t)}}{\kappa}dr_t-e^{-\kappa (T-t)}r_tdt+\frac{1}{\kappa}\underbrace{d\left[1-e^{-\kappa(T-t)}\,,\,r_t\right]}_{0}+r_tdt$$&#xA;thus&#xA;$$dx_t=\frac{1-e^{-\kappa(T-t)}}{\kappa}dr_t+\left(1-e^{-\kappa (T-t)}\right)r_tdt\,.$$&#xA;In other words&#xA;$$dx_t=\theta\left(1-e^{-\kappa(T-t)}\right)dt+\frac{1-e^{-\kappa(T-t)}}{\kappa}\sigma\,dW_t\,.\tag 1$$&#xA;By application of Ito's lemma, we have&#xA;$$d\left(e^{-x_t}\right)=-e^{-x_t}dx_t+\frac{1}{2}e^{-x_t}\underbrace{d[x_t\,,x_t]}_{\frac{\left(1-e^{-\kappa(T-t)}\right)^2}{\kappa^2}\sigma^2dt}$$&#xA;therefore&#xA;$$d\left(e^{-x_t}\right)=\left(-\theta\left(1-e^{-\kappa(T-t)}\right)+\frac{\left(1-e^{-\kappa(T-t)}\right)^2}{2\kappa^2}\sigma^2\right)e^{-x_t}dt-\sigma\frac{1-e^{-\kappa(T-t)}}{\kappa} e^{-x_t}dW_t\tag 2$$&#xA;as a result&#xA;$$df(t,x)=e^{-x_t}d\left(e^{a(T-t)}\right)+e^{a(T-t)}d\left(e^{-x_t}\right)+\underbrace{d\left[e^{a(T-t)}\,,\,e^{-x_t}\right]}_{0}$$&#xA;in other words&#xA;$$df(t,x)=\left(\frac{\left(1-e^{-\kappa(T-t)}\right)^2}{2\kappa^2}\sigma^2-\theta\left(1-e^{-\kappa(T-t)}\right)-a'(T-t)\right)e^{a(T-t)-x_t}dt-\sigma e^{a(T-t)-x_t}\frac{1-e^{-\kappa(T-t)}}{\kappa}dW_t$$&#xA;or&#xA;$$df(t,x)=\mu(t,T)f(t,x_t)dt+\sigma(t,T)f(t,x_t)dW_t\tag 3$$&#xA;where&#xA;$$\mu(t,T)=\left(\frac{\left(1-e^{-\kappa(T-t)}\right)^2}{2\kappa^2}\sigma^2-\theta\left(1-e^{-\kappa(T-t)}\right)-a'(T-t)\right)$$&#xA;and&#xA;$$\sigma(t,T)=-\sigma \frac{1-e^{-\kappa(T-t)}}{\kappa}$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-11-04T09:30:56.863" LastActivityDate="2016-11-04T09:30:56.863" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30865" PostTypeId="2" ParentId="29961" CreationDate="2016-11-04T10:49:58.247" Score="2" Body="&lt;p&gt;LocalVolatility's answer seems correct in the case where you trade calls and puts of the same strike, in exactly the same proportion, before anticipated moves (in which case, I would ask why not just trade the stock rather than the options?) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that's not the case, I can't presume to know exactly what your strategy is; are you 'anticipating' an underlying move, say a move up, and then choosing options that look 'cheap' (relative to some pricing model) to trade into positive deltas? Is there a systematic way you're choosing the option to trade, or is it more ad hoc? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In either case, if you're not anticipating changes in implied vol then adverse selection is probably going to get the better of you. For example, if you anticipate that the underlying will go up, and the market is trading at a high implied volatility relative to what you're pricing in (with no real signs it's going to come down), option prices will look higher across the board. In this case, since you want to accrue long deltas, your pricing (or intuition) will probably tell you to sell puts since they're looking expensive right now rather than buy a call which doesn't look too attractive if you're not pricing in volatility. In this case, you will naturally lean towards doing more selling than buying - if you then decide you don't want the vega risk and buy the corresponding call later, you're at a disadvantage - you essentially got into a vega position at a random price, and so you're naturally going to (on average) buy it back at a bad time. It stands to reason that vega PL would be quite negative in this scenario. &lt;/p&gt;&#xA;" OwnerUserId="25150" LastActivityDate="2016-11-04T10:49:58.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30866" PostTypeId="1" AcceptedAnswerId="31229" CreationDate="2016-11-04T13:53:31.387" Score="1" ViewCount="943" Body="&lt;p&gt;To price Swaptions, I use the Black '76 model. I'm trying to update the model to handle negative interest rates. One such approach to doing this is &lt;a href=&quot;http://www.d-fine.com/fileadmin/d-fine/hochgeladen/Fachartikel/WhitePaper_Vols_NegIR_V1_1_en.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;detailed here.&lt;/a&gt; In particular I'm interested in the &quot;shifted lognormal&quot; approach. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, they replace the strike rate k and swap rate r with k-c and r -c, effectively shifting the model's lower bound from 0 to -c. This new lower bound means that it can accommodate negative interest rates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I have understood this model correctly, then we are essentially changing nothing about the model except shifting the parameters, in other words we can take the vanilla Black '76 model, change k and r to k-c and r-c, and then we'll be able to use it for negative interest rates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why does this hold theoretically? &quot;k - c&quot; is not the same as &quot;k&quot;, so I would think that the model has been fundamentally changed and is not giving a fair price for a swaption with swap rate r and strike k if that is the derivative of interest. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, how do we decide the shift parameter c? Different values of c will give different prices, and the authors do not provide clarification on how to calibrate the shift parameter, or when to adjust it dynamically as interest rates evolve. &lt;/p&gt;&#xA;" OwnerUserId="17712" LastEditorUserId="17712" LastEditDate="2016-11-04T14:10:56.553" LastActivityDate="2016-11-28T13:08:52.623" Title="Swaption Price with Negative Swap Rate" Tags="&lt;interest-rates&gt;&lt;pricing&gt;&lt;valuation&gt;&lt;swaption&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30867" PostTypeId="1" CreationDate="2016-11-04T15:51:36.017" Score="2" ViewCount="271" Body="&lt;p&gt;Can someone verify (maybe there is some literature around) the following relationships?&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Callable Bond= Long on Bond + short on a Call Position &#xA;--&gt; &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;PV(CallableBond) = PV(Bond) - Call on Bond?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or state differently:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;PV(Bond) - PV(Callable Bond) = Call on Bond?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;Since a Receiver Swaption equals a Call on a Bond following should be true?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;PV(Bond) - PV(Callable Bond) = ReceiverSwaption?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe someone can provide me with some literature regarding this Topic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;K.S.&lt;/p&gt;&#xA;" OwnerUserId="24804" LastActivityDate="2016-11-04T15:51:36.017" Title="Callable Bond = long Bond - call on bond?" Tags="&lt;options&gt;&lt;bond&gt;&lt;call&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30868" PostTypeId="2" ParentId="30860" CreationDate="2016-11-04T16:32:48.423" Score="3" Body="&lt;p&gt;If your payoff is linear, then it is a little tough to see what's going on, so let's consider the quadratic case.  Here's a generic quadratic to sample, centered at zero&#xA;&lt;a href=&quot;https://i.stack.imgur.com/CKQvM.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/CKQvM.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Antithetic sampling introduces samples with a mean perfectly equal to zero, which effectively introduces perfect bilateral symmetry to the whole problem&#xA;&lt;a href=&quot;https://i.stack.imgur.com/katLo.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/katLo.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In contrast, delta hedging will remove the linear component (just as antithetic sampling did) but will not force your samples to have zero mean, therefore any given set of samples will have some slight bias.&#xA;&lt;a href=&quot;https://i.stack.imgur.com/R6y5p.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/R6y5p.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, it's worth noting that for antithetic sampling with $N$ original samples, you have to compute $f(x)$ $2N$ times, rather than just $N$ times.  For delta hedging you have to compute $\Delta_f(x)$ $N$ times in addition to the $N$ calculations of $f$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It could be that the cost of computing $C(\{\Delta_f(x)\}, N)$ is quite cheap or essentially free, as when you are computing the Black-Scholes formula and need that component anyway, i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;C(\{f(x), \Delta_f(x)\}, N) \approx C(\{f(x)\}, N)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or it could be that it costs quite a bit more, for example if you are using automatic differentiation on complex formulas&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;C(\{f(x), \Delta_f(x)\}, N) \gg C(\{f(x)\}, N)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the antithetic sampling, it may be that the calculation of $f(x)$ is so cheap that the main cost lies in forming the pseudorandom or quasirandom samples so that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;C(\{f(x)\}, 2N) \approx C(\{f(x)\}, N)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or it may be the case that the cost is all in calculation of $f(x)$ so that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;C(\{f(x)\}, 2N) \approx 2 C(\{f(x)\}, N)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore from the point of view of efficiency, it is hard to say more about whether antithetics or delta hedging will achieve the best cost to standard error ratio without knowing details of $f$.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2016-11-07T02:23:29.990" LastActivityDate="2016-11-07T02:23:29.990" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30871" PostTypeId="1" AcceptedAnswerId="30928" CreationDate="2016-11-04T17:43:34.700" Score="1" ViewCount="1877" Body="&lt;p&gt;I am trying to implement a simple minimum variance portfolio optimisation with a few simple constraints:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;long-only portfolio&lt;/li&gt;&#xA;&lt;li&gt;fully invested (sums to one)&lt;/li&gt;&#xA;&lt;li&gt;market-neutrality, i.e sum(betas) = 0.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I am not very experienced with &lt;a href=&quot;http://www.cvxpy.org/en/latest/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;cvxpy&lt;/a&gt; but I quite like it and want to implement my stuff with it going forward. Below is an example( from the cvxpy website), which uses  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\min_x\;\; \frac{1}{2}x^T\Sigma x$$&#xA;Under the constraints&#xA;$$x^T \mathbb{1}=1$$&#xA;$$\mu^Tx \geq \tau$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I now want to add $B^Tx=0$, which will ensure that the portfolios beta is zero.     &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;from cvxpy import *&#xA;import numpy as np&#xA;&#xA;np.random.seed(1)&#xA;n = 10&#xA;Sigma = np.random.randn(n, n)&#xA;Sigma = Sigma.T.dot(Sigma)&#xA;&#xA;betas = [np.random.uniform(-1,1) for _ in range(10)]&#xA;&#xA;w = Variable(n)&#xA;&#xA;risk = quad_form(w, Sigma)&#xA;constraints = [sum_entries(w) == 1, w &amp;gt;= 0]&#xA;prob = Problem(Minimize(risk), constraints)&#xA;&#xA;for i in range(100):&#xA;    prob.solve()&#xA;&#xA;print('Weights :', w.value)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I define the additional variable for beta and how do you alter your constraints list.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the manual I assume we need something in the form a &lt;code&gt;quad_form()&lt;/code&gt;, but does this have to be defined similarly to the risk variable in the example or inside the constraints object? how do you link it to the betas data vector?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would have done something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sum(quad_form(w, betas)) == 0 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;inside the constraints object which unfortunately doesn't work.&lt;/p&gt;&#xA;" OwnerUserId="5366" LastEditorUserId="467" LastEditDate="2016-11-09T02:58:12.620" LastActivityDate="2016-11-09T02:58:12.620" Title="How to build a market-neutral portfolio using CVXPY?" Tags="&lt;portfolio-management&gt;&lt;programming&gt;&lt;optimization&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30872" PostTypeId="2" ParentId="3486" CreationDate="2016-11-04T19:06:44.003" Score="27" Body="&lt;p&gt;Cases where exercising a call early makes sense:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;There is a dividend payment the next day that is &amp;gt;= the interest on the strike price + a put with the same strike and expiration.  Exercise the call, buy the put, and sell a zero-coupon bond for (strike price + put price - dividend).  The transaction has a net 0 cashflow at time 0 and at expiry you will be long a share of stock and have to pay the bond off. If the stock is less than the strike price, you can exercise your put to get the strike price.  As long as the maturity value of the bond is &amp;lt;= the strike price, you are in a better or equal position to having held the option to maturity.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You cannot short the stock or sell the option and believe it has peaked.  If you believe that the stock has reached its highest point before the expiration date and you are unable to hedge by shorting the stock (including using a synthetic short), you should exercise early. Since you are giving up the implicit put (right to not buy if it is below strike), you must believe that the difference between the current price and the price at expiry is larger than the price to buy this put  + the interest on the strike price.  Note: this would also apply if you cannot short the stock or sell the option, or borrow at a good rate and are in dire need of money.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The market is not efficient and you have an opportunity for arbitrage.  There are a couple different ways this could happen, but if you can construct a series of purchases that give you risk free profit, congratulations, you have found a rare opportunity for arbitrage and should take advantage of it.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You will lose the option.  If the option is conditional on some external factor (eg. employment at a company), you should obviously exercise it before losing it, as long as it is in the money.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The risk-free interest rate is negative.  If for some strange reason, interest rates are negative, then the interest on the strike price is negative. If this is larger than the implicit put, buy the put and exercise the option.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You wish to be (subtly) charitable to the seller of the call.  If exercising early is disadvantageous to you and if it is a zero-sum game, then your loss will be their gain.  You could subtly donate to them by exercising non-optimally. They can simply sell another call, which will more than pay for the money they owe you (or else you are in situation 3 above) and they have made money.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="25156" LastEditorUserId="25156" LastEditDate="2020-07-07T19:44:47.303" LastActivityDate="2020-07-07T19:44:47.303" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="30873" PostTypeId="2" ParentId="15820" CreationDate="2016-11-04T19:59:59.923" Score="2" Body="&lt;p&gt;Integrate the integral-differential equation from 0 to $T-t$, we obtain that&#xA;\begin{align*}&#xA;G(T-t, r) - r &amp;amp;= a(r) \int_0^{T-t}\frac{\partial G}{\partial r} (s,r)ds + \frac{ b(r)^2}{2}\int_0^{T-t} \frac{{\partial}^2 G}{\partial r^2} (s,r)ds\\&#xA;&amp;amp;\qquad - b(r)^2 \int_0^{T-t}\frac{\partial G}{\partial r} (u,r) \int_0^u\frac{\partial G}{\partial r} (s,r) \,ds du\\&#xA;&amp;amp;=a(r) \int_0^{T-t}\frac{\partial G}{\partial r} (s,r)ds + \frac{ b(r)^2}{2}\int_0^{T-t} \frac{{\partial}^2 G}{\partial r^2} (s,r)ds\\&#xA;&amp;amp;\qquad -  \frac{ b(r)^2}{2}\left(\int_0^{T-t}\frac{\partial G}{\partial r} (s,r) \,ds\right)^2.\tag{1}&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $$\widehat{P}(t,T) = e^{-\int_0^{T-t} G(s, r_t)ds}.$$&#xA;Then&#xA;\begin{align*}&#xA;\frac{\partial \widehat{P}}{\partial t} &amp;amp;= \widehat{P}\, G(T-t, r_t),\\&#xA;\frac{\partial \widehat{P}}{\partial r} &amp;amp;=-\widehat{P}\int_0^{T-t}\frac{\partial G(s, r)}{\partial r}ds,\\&#xA;\frac{\partial^2 \widehat{P}}{\partial r^2}&amp;amp;=\widehat{P}\left(\int_0^{T-t}\frac{\partial G(s, r)}{\partial r}ds \right)^2 - \widehat{P}\int_0^{T-t}\frac{\partial^2 G(s, r)}{\partial r^2}ds.&#xA;\end{align*}&#xA;Moreover, from $(1)$,&#xA;\begin{align*}&#xA;&amp;amp;\ \frac{b(r)^2}{2}\frac{\partial^2\widehat{P}}{\partial r^2}+a(r)\frac{\partial \widehat{P}}{\partial r}+\frac{\partial \widehat{P}}{\partial t}-r\widehat{P}\\&#xA;=&amp;amp;\ \widehat{P}\Bigg[\frac{b(r)^2}{2}\left(\int_0^{T-t}\frac{\partial G(s, r)}{\partial r}ds \right)^2 - \frac{b(r)^2}{2}\int_0^{T-t}\frac{\partial^2 G(s, r)}{\partial r^2}ds \\&#xA;&amp;amp;\qquad - a(r)\int_0^{T-t}\frac{\partial G(s, r)}{\partial r}ds + G(T-t, r_t) -r\Bigg].&#xA;\end{align*}&#xA;That is, $$\frac{b(r)^2}{2}\frac{\partial^2\widehat{P}}{\partial r^2}+a(r)\frac{\partial \widehat{P}}{\partial r}+\frac{\partial \widehat{P}}{\partial t}-r\widehat{P}=0. $$&#xA;Now, you can apply the Feynman-Kac formula to obtain that&#xA;\begin{align*}&#xA;\widehat{P}(t, T) = E\left(e^{-\int_t^T r_s ds} \mid \mathcal{F}_t \right).&#xA;\end{align*}&#xA;Therefore, $\widehat{P}(t, T) = P(t, T)$ is the zero-coupon bond price. Consequently,&#xA;\begin{align*}&#xA;f(t, T) &amp;amp;= - \frac{\partial}{\partial T} \ln \widehat{P}(t,T)\\&#xA;&amp;amp;=G(T-t, r_t).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-11-04T20:37:37.677" LastActivityDate="2016-11-04T20:37:37.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30874" PostTypeId="2" ParentId="15681" CreationDate="2016-11-04T20:07:26.167" Score="1" Body="&lt;p&gt;Let $B_t=e^{\int_0^t r_s} ds$ be the money-market account value at time $t$, where $r_t$ is the short interest rate rate. Then both $\{\frac{S_t^i}{B_t}, \, t \ge 0\}$ and $\{\frac{S_t^j}{B_t}, \, t \ge 0\}$ are martingales. Therefore, for $0 \le t \le T$,&#xA;\begin{align*}&#xA;\frac{S_t^i}{B_t} &amp;amp;= E\left(\frac{S_T^i}{B_T} \mid \mathcal{F}_t \right)\\&#xA;&amp;amp;= E\left(\frac{S_T^j}{B_T} \mid \mathcal{F}_t \right)\\&#xA;&amp;amp;= \frac{S_t^j}{B_t}.&#xA;\end{align*}&#xA;That is, $S_t^i = S_t^j$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-11-04T20:07:26.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30876" PostTypeId="1" CreationDate="2016-11-04T23:48:00.390" Score="1" ViewCount="43" Body="&lt;p&gt;If I have an asset, whose supply is generally mean-reverting and whose demand is generally cyclical, could I somehow simulate / project the supply and demand levels across multiple discrete time periods into the future and then calculate a price for the asset at each period?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would that best be accomplished?&lt;/p&gt;&#xA;" OwnerUserId="24628" LastActivityDate="2016-11-04T23:48:00.390" Title="Simulating Asset Prices by Independently Simulating Supply and Demand" Tags="&lt;pricing&gt;&lt;simulations&gt;&lt;market-microstructure&gt;&lt;economics&gt;&lt;commodities&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30877" PostTypeId="1" CreationDate="2016-11-05T00:47:06.287" Score="0" ViewCount="95" Body="&lt;p&gt;The &lt;strong&gt;Black76 model&lt;/strong&gt; uses a lognormal process to model the forward rate $L_1(t)$ from $T_1$ to $T_2$ at time $t$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dL_1(t) \ = \ \mu(t) L_1(t) dt + \sigma(t) L_1(t) dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By switching to the $T_2$-forward measure, one can then get rid of the drift term and set up easy pricing formulas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;strong&gt;Libor market model&lt;/strong&gt;, on the other hand, uses several such forward rates at tenors $T_1&amp;lt; \cdots &amp;lt; T_N$, where the brownian motions in these are usually correlated. As in the Black model, the set of forward rates is brought to a common measure and simulated thereafter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If one assumes a time-dependent vola in the Black model which is stepwise constant between the tenor dates, what is the relation to a Libor market model (where the volas are assumed to be constant)? Asked differently, what is the correlation matrix in the LMM in order to reproduce the Black model with stepwise constant vola?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="20336" LastActivityDate="2016-11-06T02:44:43.497" Title="Relation between Libor market model and Black76 with time-dependent vola" Tags="&lt;interest-rates&gt;&lt;libor&gt;&lt;black76&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30878" PostTypeId="2" ParentId="30841" CreationDate="2016-11-05T05:58:25.727" Score="1" Body="&lt;p&gt;RMSE (root mean squared error) is by far the most commonly used quantitative measure for the &quot;goodness-of-fit&quot; of a yield curve. It is simply &#xA;$$ \text{RMSE} = \sqrt{\frac{\sum_{i=1}^n (P_i - \hat{P}_i)^2}{n}}, $$&#xA;where $P_i$ is the market price (or yield) of an input instrument, and $\hat{P}_i$ is its price calculated using the curve. RMSE is usually the quantity you minimize when building a fitted curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But IMHO, curve fitting is actually more art than science. The proper metrics for curve evaluation depends on what your curve is used for and who is using the curve, amongst other things:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The purpose of the curve: A yield curve used for valuation should probably be able to price all benchmark instruments perfectly (i.e., RMSE should be 0). A yield curve used for relative value trading should be optimized to generate tradable signals (e.g., bond spreads to the fitted curve should be mean-reverting). A yield curve used for risk management should generate stable risk analytics. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The user of the curve: The trader for whom you're building the curve may very well have strong personal preference (&quot;taste&quot;). Some traders may prefer their curves to be smoother, and others like wavy ones that amplify mispricings in input instruments.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2016-11-05T05:58:25.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30881" PostTypeId="1" CreationDate="2016-11-05T17:01:09.630" Score="1" ViewCount="39" Body="&lt;p&gt;Let's say I model a 6M forward Libor rate as a process $(L^1_t)_t$ that's a diffusion, with in view a Monte-Carlo (MC) pricing of some product. At some point I will have real life dates $T_i$'s that I will have to convert to real numbers : more precisely, at some point I will have a $dt$ that will represent the time between $T_i$ and $T_{i+1}$, and I will have to look a the year fraction $y$ that the period $[T_i, T_{i+1}]$, and this $y$ is going to be my $dt$, that I will plug in my MC sample path generation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is : which convention practitioners use to calculate the year fraction represented by the period $[T_i, T_{i+1}]$ ? Do they use the actual/$365.25$ so called &quot;quants&quot; convention ? Or do they rather use the market convention for the concerned Libor (forward) rate $L^1$ ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What happens in the case I have another forward Libor rate $L^2$ (with its own market convention) possibly living in another market place, and that I am now modelling the vector $(L^1_t, L^2_t)_t$ with a quadratic covariation $\langle  L^1, L^2\rangle_t = \rho dt$ ? In this case the $dt$ concerns $L^1$ and $L^2$ that have possibly different conventions. For sure, the same convention should be used for all $dt$'s (those in front of terms concerning $L^1$, those in front of terms concerning $L^1_t$ as well as those in front of &quot;mixed&quot; terms). Which convention do the practiotioners choose ? Actual/$365.25$ ? Or do they use the convention related to the numéraire they are simulating under ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Remarks.&lt;/em&gt; 1) Of course my questions concern anything simulable, not only &quot;Xibor&quot; rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) For sure the differences should be really small between an MC price (all other parameters remaining equal) calculated with actual/$365.25$ and an MC price calculated with the $30/360$ convention, but am I really interested in what the practitioners do. I have seen both used : actual/$365.25$ as well as numéraire convention, but I'd like to know if there's any consensus for this modelling choice.&lt;/p&gt;&#xA;" OwnerUserId="13470" LastActivityDate="2016-11-05T19:40:59.177" Title="Passage from dates ranges to real numbers in modelling : which market practice?" Tags="&lt;stochastic-processes&gt;&lt;modelling&gt;&lt;best-practices&gt;&lt;convention&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30882" PostTypeId="2" ParentId="30881" CreationDate="2016-11-05T19:40:59.177" Score="1" Body="&lt;p&gt;For reporting outputs, you should certainly use the proper market convention (e.g., 30/360 and simple interest for USD Libor). However, internal model convention is a different matter. Many quants use Actual/365.25 or Actual/365, combined with continuous compounding. The day count convention only needs to ensure 1-to-1 mapping between date and rate/discount factor (incidentally, the 30/360 convention would NOT satisfy this requirement). Continuous compounding makes math much easier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you have constructed your model, you can convert outputs to any convention needed to satisfy final reporting requirements.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2016-11-05T19:40:59.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30883" PostTypeId="2" ParentId="30877" CreationDate="2016-11-06T02:44:43.497" Score="1" Body="&lt;p&gt;The LMM is typically done with each rate having its own time dependent volatility function. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can the same effective Black constant vols by taking the root mean square vol over the rate's life for each rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The covariance between two rates $i$ and $j$ if we do a step from s to t is &#xA;$$&#xA;\int_{s}^{t} \rho_{ij} \sigma_i(r) \sigma_j(r) dr. &#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2016-11-06T02:44:43.497" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30885" PostTypeId="1" CreationDate="2016-11-06T11:07:48.450" Score="4" ViewCount="797" Body="&lt;p&gt;I am trying to calibrate the &lt;a href=&quot;https://en.wikipedia.org/wiki/Heston_model&quot; rel=&quot;nofollow noreferrer&quot;&gt;Heston model&lt;/a&gt; (or another stochastic volatility model).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I read about maximum likelihood estimates, but there are so many articles as well with other algorithms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you suggest an article (from &lt;a href=&quot;https://papers.ssrn.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://papers.ssrn.com/&lt;/a&gt;) which explains a relatively easy algorithm that is applied nowadays.&lt;/p&gt;&#xA;" OwnerUserId="25170" LastEditorUserId="467" LastEditDate="2016-11-07T05:44:34.380" LastActivityDate="2016-11-07T05:44:34.380" Title="What is a canonical reference on calibrating the Heston Model?" Tags="&lt;stochastic-volatility&gt;&lt;reference-request&gt;&lt;calibration&gt;&lt;heston&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30886" PostTypeId="2" ParentId="30885" CreationDate="2016-11-06T14:17:50.960" Score="4" Body="&lt;p&gt;There are so many articles in this context, such as &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Estimating using loss function&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This method uses the error between quoted market prices and model prices, or between market and model implied volatilities . You can consider these article&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www-users.math.umn.edu/~bemis/IMA/MMI2008/calibrating_heston.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Heston’s Stochastic Volatility Model: Implementation,Calibration, and Some Extensions.&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://www.fsa.ulaval.ca/SBFSIF/Documents/LossFunction%20Lehnert%20final%20version.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Loss Functions in Option Valuation: A Framework for Selection. &lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://faculty.som.yale.edu/zhiwuchen/Papers/empirical.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Empirical Performance of Alternative Option Pricing Models.&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;2.&lt;strong&gt;Differential evolution&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Vollrath has applied the algorithm to interest rate and option model and has found the algorithm effective in identifying the global minimum in the parameter space, albeit at the expense of high computation time. You can this method in this article&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1367502&quot; rel=&quot;nofollow noreferrer&quot;&gt;Calibration of Interest Rate and Option Models Using Differential Evolution.&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;3.&lt;strong&gt;Maximum likelihood estimation&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Atiya and Wall (2009) show how to obtain the maximum likelihood estimates of the physical parameters of the Heston model using a time series of historical stock prices.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://alumnus.caltech.edu/~amir/vol-est-atiya-et-al-QF.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;An Analytic Approximation of the Likelihood Function for the Heston Model Volatility Estimation Problem.&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-11-06T14:27:48.247" LastActivityDate="2016-11-06T14:27:48.247" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30888" PostTypeId="2" ParentId="8426" CreationDate="2016-11-06T16:50:02.050" Score="2" Body="&lt;p&gt;In the paper (&lt;a href=&quot;http://dx.doi.org/10.1287/mnsc.48.11.1512.261&quot; rel=&quot;nofollow noreferrer&quot;&gt;Klaassen, 2002&lt;/a&gt;) the author propose a scenario generation method as well as a rule in order to precludes arbitrage opportunities. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the paper (&lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/itor.12174/abstract;jsessionid=20DDD3B4B79A797E48611AB3AE37D19D.f04t02&quot; rel=&quot;nofollow noreferrer&quot;&gt;Davari-Ardakani, et al. 2016&lt;/a&gt;) authors propose a new scenario generation method, it preserves marginal (non-normal) distributions of asset returns and it precludes arbitrage opportunities. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Klaassen, P. (2002) Comment on ‘‘Generating scenario trees for multistage decision problems’’. Management Science 48 (11), 1512–1516.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hamed Davari-Ardakani, Majid Aminnayeri and Abbas Seifi (2016) Multistage portfolio optimization with stocks and options. International Transactions in Operational Research, 23, 593–622.&lt;/p&gt;&#xA;" OwnerUserId="20913" LastEditorUserId="20913" LastEditDate="2016-11-09T07:14:06.303" LastActivityDate="2016-11-09T07:14:06.303" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30889" PostTypeId="1" AcceptedAnswerId="30890" CreationDate="2016-11-06T17:51:25.563" Score="0" ViewCount="217" Body="&lt;p&gt;In the Black Scholes framework what is the value of an at-the-money vanilla European call option as time to maturity goes to infinit ($T \rightarrow \infty$)?&lt;/p&gt;&#xA;" OwnerUserId="25173" LastEditorUserId="467" LastEditDate="2016-11-07T06:38:59.613" LastActivityDate="2016-11-07T06:38:59.613" Title="What is the value of an ATM call under the Black Scholes Framework when $T \rightarrow \infty$?" Tags="&lt;options&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30890" PostTypeId="2" ParentId="30889" CreationDate="2016-11-06T18:13:28.647" Score="2" Body="&lt;p&gt;The Black-Scholes call option price is given by&#xA;\begin{align*}&#xA;C = S_0 N(d_+) - K e^{-rT}N(d_-),&#xA;\end{align*}&#xA;where $$d_{\pm}= \frac{\ln \frac{S_0}{K}+(r\pm\frac{1}{2}\sigma^2) T}{\sigma \sqrt{T}}.$$&#xA;Here, we assume that the interest rate $r\ge 0$ and $\sigma &amp;gt;0$.&#xA;For an at-the-money call option, that is, $K=S_0$, we note that&#xA;$\lim_{T\rightarrow \infty} d_+ = \infty$, that is, $$\lim_{T\rightarrow \infty} N(d_+) = 1.$$&#xA;In addition, if $r&amp;gt;0$, then $$\lim_{T\rightarrow \infty}Ke^{-rT} N(d_-) = 0,$$ and if $r =0$, then $\lim_{T\rightarrow \infty} d_- = -\infty$, and $\lim_{T\rightarrow \infty} N(d_-) = 0.$ Therefore, $$\lim_{T\rightarrow \infty} C = S_0.$$&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-11-06T18:29:30.783" LastActivityDate="2016-11-06T18:29:30.783" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30891" PostTypeId="1" AcceptedAnswerId="30894" CreationDate="2016-11-06T18:36:52.863" Score="0" ViewCount="371" Body="&lt;p&gt;&lt;strong&gt;Background Information:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question follows from &lt;a href=&quot;https://quant.stackexchange.com/questions/30505/value-of-a-perfect-hedge&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is tempting to write $$V_0(X) = \beta\left[\left(\frac{\beta^{-1}S_0 - S_1(d)}{S_1(u) - S_1(d)}\right)X(u) + \left(\frac{S_1(u) - \beta^{-1}S_0}{S_1(u) - S_1(d)}\right)X(d)\right]$$&#xA;as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V_0(X) = E_Q[\beta X]$$ where the expectation is taken with respect to the new purely formal probability measure $Q$ defined by $$Q(u) = \frac{\beta^{-1}S_0 - S_1(d)}{S_1(u) - S_1(d)}$$ and $$Q(d) = \frac{S_1(u) - \beta^{-1}S_0}{S_1(u) - S_1(d)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that $Q(u) + Q(d) = 1$; $Q$ will be a probability measure provided these values are non-negative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The quantity $\frac{S}{B}$ is called the discounted stock price. It will be useful later to notice that the pricing measure $Q$ has a special property with respect to the discounted stock price: it makes the discounted stock a martingale, i.e., &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;$$\frac{S_0}{B_0} = E_{Q}[S_1/B_1]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am curious on how to verify this. I assume we need to show both sides but I am not sure how to proceed.&lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-11-06T20:53:24.073" Title="Showing the discounted stock is a martingale" Tags="&lt;mathematics&gt;&lt;finance-mathematics&gt;&lt;financial-engineering&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30894" PostTypeId="2" ParentId="30891" CreationDate="2016-11-06T20:53:24.073" Score="1" Body="&lt;p&gt;In your setting, $\beta = B_0 B_1^{-1}$. Then&#xA;\begin{align*}&#xA;E_Q(S_1/B_1) &amp;amp;= Q(u)S_1(u)/B_1 + Q(d)S_1(d)/B_1\\&#xA;&amp;amp;=\frac{\beta^{-1}S_0 - S_1(d)}{S_1(u) - S_1(d)}S_1(u)/B_1 + \frac{S_1(u) - \beta^{-1}S_0}{S_1(u) - S_1(d)}S_1(d)/B_1\\&#xA;&amp;amp;=\frac{\beta^{-1}S_0S_1(u)/B_1 - S_1(d)S_1(u)/B_1 + S_1(u)S_1(d)/B_1-\beta^{-1}S_0S_1(d)/B_1}{S_1(u) - S_1(d)}\\&#xA;&amp;amp;=\beta^{-1}S_0/B_1\\&#xA;&amp;amp;=\frac{S_0}{B_0}.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-11-06T20:53:24.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30895" PostTypeId="2" ParentId="18840" CreationDate="2016-11-07T01:59:34.220" Score="1" Body="&lt;p&gt;If believe you intend that $t_j$ is a fixed time known in advance, for example the day of a contentious election.  And you postulate that the two possible jump sizes are known in advance and agreed uniformly by the market.  This is an artificial assumption -- real markets would price in a continuous range of possible jump sizes -- but is convenient mathematically. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you are right, the martingale condition requires that the risk-neutral probability of up-jump and down-jump are such that the expected value is zero.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To try to get information from the options market, you should take the jump sizes as initially unknown and calibrate those from the options prices.  You could still try the simplistic assumption of a two point distribution -- a fixed up jump size and a fixed down jump size.  Optimise a fit to options prices over different choices for volatility and for these jump sizes.  Again there is a martingale condition that translates these jump sizes to probability of up-jump and down-jump.  But now you are getting those from the market, not ad hoc assumption. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Again the probabilities are risk-neutral not real world.  Risk neutral prices tend to charge more for insuring against bad outcomes, so expect the risk-neutral price for the down jump to be an overestimate of the real world probability of that event.  How much of an overestimate?  Hard to say...&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2016-11-07T01:59:34.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30900" PostTypeId="1" AcceptedAnswerId="31020" CreationDate="2016-11-07T14:11:13.863" Score="1" ViewCount="149" Body="&lt;p&gt;I am trying to output some intermediate variable values in a program using the Quantlib C++ to a text file so that I can try to debug my code to see what's going on, and the way I set up my code is like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the beginning of the method:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;std::ofstream outfile (&quot;C:\\temp\\MY DEBUG FILE&quot;, std::ofstream::out);&#xA;QL_TRACE_ON(outfile); &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then at where I'd like to see the values printed out:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;QL_TRACE(var1, var2, var3, ....) //many more variable here&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then towards the end:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;outfile.close();&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However every time I run through this code the text file is created however it contains nothing at all. (0 byte file)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have also tried to do this at the beginning of the hpp:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#define QL_ENABLE_TRACING&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And my already includes ql/quantlib.hpp which will in turn include the tracing hpp.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there something else I am missing here?&lt;/p&gt;&#xA;" OwnerUserId="3595" LastActivityDate="2016-11-15T11:49:19.070" Title="Quantlib C++: How to output QL_TRACE to a log file" Tags="&lt;quantlib&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30901" PostTypeId="1" AcceptedAnswerId="30904" CreationDate="2016-11-07T17:24:46.273" Score="5" ViewCount="2358" Body="&lt;p&gt;I just tried to price the implied dividend for a few active, liquid options markets using current prices and I am not convinced my results are accurate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using American options, and using the put-call parity relationship that exists for European options. I've seen that at-the-money (or near-the-money) options will give a pretty accurate description of implied dividends. &lt;strong&gt;If I cannot use put-call parity, what methods are use by practitioners to get an implied dividend?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used an interpolated treasury yield curve for accurate interest rate values, and priced IDIV with &#xA; $$IDIV = \text{Stock Price } - \text{Strike } \times e^{-rT} - Call(K,T) - Put(K,T)$$&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;For AAPL:&#xA;&#xA;expiry&#xA;2016-11-11   -0.040236&#xA;2016-11-18   -0.053026&#xA;2016-11-25   -0.061683&#xA;2016-12-02   -0.065252&#xA;2016-12-09   -0.076144&#xA;2016-12-16   -0.029923&#xA;2016-12-23   -0.100593&#xA;2017-01-20    2.660728&#xA;2017-02-17    0.092540&#xA;2017-03-17    0.131359&#xA;2017-04-21    0.263763&#xA;2017-06-16    0.538302&#xA;2017-07-21    0.613789&#xA;2017-11-17    1.193600&#xA;2018-01-19    1.352709&#xA;2019-01-18    2.295825&#xA;&#xA;For SPY:&#xA;expiry&#xA;2016-11-09    0.006997&#xA;2016-11-11    0.008535&#xA;2016-11-16   -0.000494&#xA;2016-11-18    0.006222&#xA;2016-11-23   -0.004294&#xA;2016-11-25    0.002909&#xA;2016-11-30   -0.006724&#xA;2016-12-02   -0.008246&#xA;2016-12-07   -0.016802&#xA;2016-12-09   -0.013155&#xA;2016-12-16    0.799113&#xA;2016-12-23    0.741128&#xA;2016-12-30    0.519134&#xA;2017-01-20    0.872681&#xA;2017-02-17    0.850424&#xA;2017-03-17    1.253229&#xA;2017-03-31    1.446670&#xA;2017-06-16    2.063210&#xA;2017-06-30    2.285904&#xA;2017-09-15    2.853458&#xA;2017-09-29    2.841766&#xA;2017-12-15    3.393382&#xA;2018-01-19    3.920152&#xA;2018-03-16    4.540356&#xA;2018-06-15    5.096783&#xA;2018-09-21    5.609085&#xA;2018-12-21    6.897434&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;These seem far enough off that it's not due to computational errors. What else do I need to account for when using American options to price the implied dividend.&lt;/p&gt;&#xA;" OwnerUserId="20194" LastActivityDate="2016-11-11T13:34:20.163" Title="Implied Dividend from American Options (in practice)" Tags="&lt;american-options&gt;&lt;dividends&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="30904" PostTypeId="2" ParentId="30901" CreationDate="2016-11-07T20:03:43.053" Score="7" Body="&lt;p&gt;There are 2 ways to do it.  The good-enough way, and the complete and complex way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The Good-Enough Way&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here you will convert to a situation where you &lt;em&gt;can&lt;/em&gt; apply put-call parity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Begin by finding the strike $K$ where put and call prices are closest to each other.  This might &lt;em&gt;not&lt;/em&gt; end up being the closest-to-the-money strike, but it will do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now run the following algorithm until it converges on your dividend rate $q$ to sufficient accuracy:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Begin by setting &quot;equivalent&quot; European prices the same as the American prices&lt;/li&gt;&#xA;&lt;li&gt;Use a pricing algorithm for European options and put-call parity to estimate $q$&lt;/li&gt;&#xA;&lt;li&gt;Use $q$ to find the implied vols $\sigma_{P,C}$ for the put and call in the American algorithm&lt;/li&gt;&#xA;&lt;li&gt;Generate new &quot;equivalent&quot; European prices using $q$ and $\sigma_{P,C}$&lt;/li&gt;&#xA;&lt;li&gt;Go to step 2&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This won't be quite correct, since the effective tenor of American options is naturally somewhat less than European, but it will work amazingly well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Complete and Complex&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a more complete solution, you need to have a volatility model, and a term structure of available option prices that goes beyond your tenor of interest.  For example, your model might be that Black-Scholes European volatility looks like&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\sigma_{BS}(K, T) = \sigma_0 + \frac{\mu_1}{T}\log\left(\frac{K}{S_0}\right) + \frac{\mu_2}{T^2}\log\left(\frac{K}{S_0}\right)^2&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From this you must work out the math for local volatility, and write an American option pricer capable of using those local volatilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You then run a nonlinear optimizer to fit this model and your term structure of dividends to the entire option market via the pricing algorithm you wrote.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Final Caveat&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using put-call parity provides us with some rate $q$ such that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;F = e^{(r-q)T}(C-P)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This does &lt;em&gt;not&lt;/em&gt; necessarily mean that $q$ is the dividend rate.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact it is comprised of three pieces&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;q = \epsilon_r + b + \delta&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which are&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$\epsilon_r$: The difference between the interest rates you are using and market interest rates&lt;/li&gt;&#xA;&lt;li&gt;$b$: borrow cost of the underlying&lt;/li&gt;&#xA;&lt;li&gt;$\delta$: dividend rate&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The borrow cost in particular is often very significant.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2016-11-11T13:34:20.163" LastActivityDate="2016-11-11T13:34:20.163" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="30905" PostTypeId="1" AcceptedAnswerId="30908" CreationDate="2016-11-07T21:36:17.133" Score="4" ViewCount="783" Body="&lt;p&gt;I am aware of QuantLib's functions &lt;code&gt;addHoliday()&lt;/code&gt; and &lt;code&gt;removeHoliday()&lt;/code&gt;, but I am wondering if there is a better way to edit the calendar permanently. How does one check and add days to the QuantLib calendars?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, Taiwan's market took a holiday for a typhoon, and maybe I'd like to add that day to the calendar (to take effect across all my software). Or for another example, Japan celebrated its first Mountain Day this past year, but I don't know if is taken into account in my version of &lt;code&gt;QuantLib::Calendar&lt;/code&gt; Japan(). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a straightforward way to view/correct a particular calendar NOT during runtime?&lt;/p&gt;&#xA;" OwnerUserId="25188" LastEditorUserId="467" LastEditDate="2016-11-08T10:34:00.593" LastActivityDate="2016-11-08T10:34:00.593" Title="How to permanently add holidays to QuantLib calendars?" Tags="&lt;programming&gt;&lt;quantlib&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30906" PostTypeId="1" CreationDate="2016-11-07T22:54:14.897" Score="0" ViewCount="321" Body="&lt;p&gt;I have a company with zero interest bearing debt and 10M in cash.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since there is no debt: Am I correct in assuming that the Free cash flows to equity (FCFE) and Free cash flows to the firm (FCFF) will be the same?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I correct in assuming that the market value of the security will be&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NPV + Cash&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regardless of if I take the FCFF or FCFE route?&lt;/p&gt;&#xA;" OwnerUserId="24497" LastActivityDate="2016-11-08T04:59:52.607" Title="Free cash flows to the firm (FCFF) and no debt" Tags="&lt;valuation&gt;" AnswerCount="1" CommentCount="2" ClosedDate="2016-11-08T06:53:23.210" ContentLicense="CC BY-SA 3.0" />
  <row Id="30908" PostTypeId="2" ParentId="30905" CreationDate="2016-11-08T00:42:15.107" Score="4" Body="&lt;p&gt;If you want to change the calendars at compile time you can edit the respective &lt;code&gt;.cpp&lt;/code&gt; file in &lt;code&gt;ql/time/calendars/&lt;/code&gt; - e.g. &lt;code&gt;germany.cpp&lt;/code&gt;. Here you find the different &lt;code&gt;isBusinessDay(...)&lt;/code&gt; implementations for the respective country.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2016-11-08T00:42:15.107" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30910" PostTypeId="2" ParentId="30906" CreationDate="2016-11-08T04:59:52.607" Score="1" Body="&lt;p&gt;I think you're right regarding FCFE and FCFF, but I'm not sure you can say what is the market value of the equity, since the market might price in other factors of the firm business nature (macro economic factors for example), besides NPV and cash.&lt;/p&gt;&#xA;" OwnerUserId="15454" LastActivityDate="2016-11-08T04:59:52.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30911" PostTypeId="1" AcceptedAnswerId="30913" CreationDate="2016-11-08T08:19:29.467" Score="2" ViewCount="170" Body="&lt;p&gt;Return required from risk averse agents from risky investments are proportional to expected return variance. That is from the textbook, you take the portfolio with the highest return to standard deviation, and then you lever or dilute it to fit the return to variance requirement of your investor. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, shouldn't you expect future volatility indicators like the VIX to have a quadratic relationship to stock index levels? A quick look at a chart suggests more of a linear relation. Or is it so that the stock-index has a linear relation to expected volatility, but that the VIX have a quadratic relation to longer term expected volatility?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any references to literature or explanations on this would be more than helpful!&lt;/p&gt;&#xA;" OwnerUserId="23886" LastActivityDate="2019-02-21T08:59:14.693" Title="Risk, required return and expected volatility - what is the relationship?" Tags="&lt;risk&gt;&lt;variance&gt;&lt;vix&gt;&lt;return&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30913" PostTypeId="2" ParentId="30911" CreationDate="2016-11-08T10:14:55.083" Score="5" Body="&lt;p&gt;I think you may be interested in this &lt;a href=&quot;https://academic.oup.com/qje/article/132/1/367/2724543/What-is-the-Expected-Return-on-the-Market&quot; rel=&quot;nofollow noreferrer&quot;&gt; QJE forthcoming article&lt;/a&gt; by Ian Martin. The key idea of the article (page 5) is that the expected return on the market can be decomposed as &#xA;&lt;span class=&quot;math-container&quot;&gt;$E_t[R_{t+1}]-R_f = \frac{1}{R_f}Var^Q(R_{t+1}) + \text{extra terms}$&lt;/span&gt;&#xA;As you correctly pointed out the expected return should be related with the risk neutral variance. The issue with VIX&lt;span class=&quot;math-container&quot;&gt;$^2$&lt;/span&gt; is that &lt;strong&gt;it doesn’t measure risk neutral variance&lt;/strong&gt;, unless we are in the standard lognormal case. As you can see from page 15 the correct way to construct a variance swap is by using a portfolio &lt;strong&gt;with the same weights&lt;/strong&gt; on all puts and calls while the VIX&lt;span class=&quot;math-container&quot;&gt;$^2$&lt;/span&gt; has weights proportional to the &lt;strong&gt;inverse of the squared strike&lt;/strong&gt;, i.e.&#xA;&lt;span class=&quot;math-container&quot;&gt;$SVIX^2=\frac{1}{(T-t)R_f^2}Var^Q(R_{t+1})=\frac{2}{S_t^2}\left[\int_0^F put(K)dK+\int_F^\infty call(K)dK\right]$&lt;/span&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$VIX^2=\frac{2R_f}{T-t}\left[\int_0^F \frac{1}{K^2}put(K)dK+\int_F^\infty \frac{1}{K^2}call(K)dK\right]$&lt;/span&gt;&lt;/p&gt;&#xA;" OwnerUserId="8028" LastEditorUserId="-1" LastEditDate="2019-02-21T08:59:14.693" LastActivityDate="2019-02-21T08:59:14.693" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="30915" PostTypeId="2" ParentId="30762" CreationDate="2016-11-08T10:44:11.677" Score="2" Body="&lt;p&gt;You can download all the company names and values and a lot of other stuff from the Nasdaq or NYSE via &lt;a href=&quot;http://www.nasdaq.com/screening/company-list.aspx&quot; rel=&quot;nofollow&quot;&gt;http://www.nasdaq.com/screening/company-list.aspx&lt;/a&gt; in .csv , then you can process that with df = pd.read_csv(Filename.csv)&lt;/p&gt;&#xA;" OwnerUserId="25197" LastActivityDate="2016-11-08T10:44:11.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30918" PostTypeId="1" AcceptedAnswerId="30923" CreationDate="2016-11-08T12:15:57.697" Score="1" ViewCount="602" Body="&lt;p&gt;I'm genuinely interested in Quantitative Finance, mostly volatility (e.g. Realized Volatility (MSRV, Realized Kernel), VaR based on GARCH under higher order conditional moment dynamics, etc) or just financial time series in general.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, my graduate academic supervisor told me that this field of research is not very appreciated within my graduate program. Bottom line - I have to choose an M&amp;amp;A-related topic for my term paper (basically what every student on this program ends up doing) or my grade for it will see a sharper decline than post-brexit GBP.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's not that I have no interest in M&amp;amp;A, quite the opposite; however, each and every research I come across regarging this topic relies on plain OLS (FE panel at best) running over and over and... you get the idea. Most of the times sample sizes there are laughable and results are subject to shameless p-hacking, i.e. not the kind of motivation for a research one could possibly want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it all that bad or I'm missing something? Aren't there any M&amp;amp;A research directions where I can apply my quant knowledge? &lt;/p&gt;&#xA;" OwnerUserId="18190" LastEditorUserId="467" LastEditDate="2016-11-09T05:22:57.023" LastActivityDate="2016-11-09T05:22:57.023" Title="What are the possible topics of quantitative research in M&amp;A?" Tags="&lt;reference-request&gt;&lt;quants&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="30921" PostTypeId="1" AcceptedAnswerId="30922" CreationDate="2016-11-08T15:30:30.940" Score="3" ViewCount="2042" Body="&lt;p&gt;I am self-studying for an actuarial exam on models for financial economics. I am having a hard time grasping the concept highlighted in red:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/S0HsO.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/S0HsO.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering if someone could further elaborate on why there is an implicit put option that is lost when one early exercises an American call. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried making a concrete example for myself to demonstrate this using a binomial tree model constructed on forward prices, but using different interest rates, volatility, dividend yields, and times to expiration, I could never create a scenario where:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Early exercise of the American call is rational at a node&lt;/li&gt;&#xA;&lt;li&gt;The stock price could decrease below the strike price at a subsequent node from the node that the stock is exercised early&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;But, let's just suppose we have an American call on a stock with strike $K$ expiring at time $T$, $C(S, K, T)$, and that it is rational to early exercise at $t &amp;lt; T$. Suppose that at time $T$, $S &amp;lt; K$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then at time $t$, the call holder exchanges $K$ for $S$, for a payoff of $S - K &amp;gt; 0$. But at time $T$, $S &amp;lt; K$, and so he now has $S - K &amp;lt; 0$. If he had not exercised early, he could have not exercised at expiration and in this case he would have $K &amp;gt; 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A put option's payoff at time $T$ would be $\max{(K - S, 0)} &amp;gt; 0$, since $ S &amp;lt; K$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not seeing an implicit put here, since the payoffs are different. Could someone explain?&lt;/p&gt;&#xA;" OwnerUserId="5641" LastActivityDate="2016-11-08T18:24:35.933" Title="Understanding early exercise of options - The implicit put in an American call" Tags="&lt;american-options&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30922" PostTypeId="2" ParentId="30921" CreationDate="2016-11-08T18:24:35.933" Score="7" Body="&lt;p&gt;Let’s forget about dividends (actually assume there are no dividends). By Put Call parity $C^E(K)= P^E(K) + S - Ke^{-rt}$. Suppose that $S&amp;gt;K$ [otherwise you don’t even think about exercising!], if you exercise the American Call now you get $S - K$ that for sure is less than the intrinsic value of the European call, i.e. when the American Call is still alive its value is at least the value of the European meaning the following chain of inequalities:&#xA;$$C^{AM}(K)\geq C^E(K)= P^E(K) + S - Ke^{-rt} &amp;gt; S-K$$ &#xA;In particular you  can see clearly that are losing the value of the implicit put $P^E(K)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, with the American Put the same chain of inequalities doesn’t hold because $P^E(K)= C^E(K) - S + Ke^{-rt}$ hence the effect is ambiguous. To convince yourself, set S=0 and you’ll see that how much you get from exercising is higher than what you get by keeping the put alive.&lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2016-11-08T18:24:35.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30923" PostTypeId="2" ParentId="30918" CreationDate="2016-11-08T21:19:07.987" Score="1" Body="&lt;p&gt;Check out KPMG M&amp;amp;A &lt;a href=&quot;https://assets.kpmg.com/content/dam/kpmg/pdf/2016/03/ma-predictor-feb-2016.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;predictor&lt;/a&gt;, you can try to make something similar if you can get your hands on the dataset, maybe KPMG is willing to share it. Also there are some interesting researches related to applications of Game Theory to M&amp;amp;A.&lt;/p&gt;&#xA;" OwnerUserId="17921" LastActivityDate="2016-11-08T21:19:07.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30924" PostTypeId="2" ParentId="30653" CreationDate="2016-11-08T21:24:35.883" Score="6" Body="&lt;p&gt;The name initial margin is somewhat misleading as initial margin is dynamic i.e it is adjusted through time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, as you say, on day zero, it can be computed as a 10 day VaR VaR(10, t0). But, on day one, the market conditions will have changed, or you may have paid a cashflow etc etc..... so your 10 day VaR will also change (i.e. VaR(10, t1) is not equal to VaR(10, t0)), hence your initial margin will change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, given a set of Monte-Carlo paths (the simulation you were mentioning), on every path you should try and estimate the 10 day VaR starting from a given date. This will enable you to build your initial margin profile and from there you can compute the cost of funding this IM i.e. the so-called MVA.&lt;/p&gt;&#xA;" OwnerUserId="25205" LastActivityDate="2016-11-08T21:24:35.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30925" PostTypeId="2" ParentId="30871" CreationDate="2016-11-08T22:30:20.060" Score="1" Body="&lt;p&gt;the constraint can simply be implemented by creating the following constraint      &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;w.T*beta == 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5366" LastActivityDate="2016-11-08T22:30:20.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30926" PostTypeId="1" CreationDate="2016-11-08T22:39:46.370" Score="1" ViewCount="479" Body="&lt;p&gt;I am working on using machine learning to obtain American Put's early exercise boundary. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To train the model, I need an output label (known boundaries values).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a fast way to obtain the exercise boundary base on the simulated paths of Geometric Brownian Motion? Any inputs are much appreciated!&lt;/p&gt;&#xA;" OwnerUserId="25207" LastActivityDate="2016-11-09T11:27:49.527" Title="Use machine learning to find exercise boundary of American put option" Tags="&lt;american-options&gt;&lt;machine-learning&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30927" PostTypeId="2" ParentId="30926" CreationDate="2016-11-08T23:34:26.130" Score="2" Body="&lt;p&gt;From what I understand is that you are looking to approximate the exercise boundary under geometric Brownian motion dynamics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you only consider either continuous and/or proportional discrete dividends, then the simplest approach would probably be to use a binomial tree. If you are interested in including fixed discrete dividends, then I'd recommend using a finite difference scheme. In both cases, you'd need to ensure that your spot grid is fine enough in order for your exercise boundary approximation to be sufficiently accurate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A good introductory reference for both methods is &quot;Paul Wilmott on Quantitative Finance&quot;.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2016-11-08T23:34:26.130" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="30928" PostTypeId="2" ParentId="30871" CreationDate="2016-11-09T02:57:54.930" Score="1" Body="&lt;p&gt;The constraint you suggest is wrong as it implies $x^T B x = 0$ which is not what you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The right way to express $B^T x = 0$ is &lt;code&gt;w.T * beta == 0&lt;/code&gt; and you should including this in the constraints list:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;constraints = [sum_entries(w) == 1, w &amp;gt;= 0, w.T * beta == 0]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also the following lines look wrong:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for i in range(100):&#xA;    prob.solve()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems you're solving a hundred times your problem. One call should be enough.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2016-11-09T02:57:54.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30930" PostTypeId="2" ParentId="30926" CreationDate="2016-11-09T09:37:04.310" Score="1" Body="&lt;p&gt;The lattice/FD approach suggested by @LocalVolatility will work fine. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, since you specifically mention &quot;&lt;em&gt;based on the simulated paths of a Geometric Brownian motion&lt;/em&gt;&quot;, you could alternatively consider least-squares Monte-Carlo. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;More specifically, working backwards in time from the expiry to the inception of the contract, the Longstaff-Schwartz algorithm will allow you to work out continuation values from the simulated paths -- under the hood this conditional expectation is evaluated in the least squares sense using standard regression techniques (hence the original name of the method) but you could also use more elaborate supervised learning methods at this point I guess. The intersection of the continuation value and the intrinsic value for each time $t$ then by definition constitutes the optimal exercise boundary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The tricky part is that the standard Longstaff-Schwartz algorithm actually identifies a sub-optimal exercise strategy (resulting prices will be low-biased). On the sunny side, general dividend structures can be handled almost seamlessly in Monte Carlo.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-11-09T11:27:49.527" LastActivityDate="2016-11-09T11:27:49.527" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30931" PostTypeId="2" ParentId="739" CreationDate="2016-11-09T15:56:38.533" Score="1" Body="&lt;p&gt;This is the best historical time series which I could find from &lt;a href=&quot;http://www.tradingeconomics.com/malaysia/rating&quot; rel=&quot;nofollow noreferrer&quot;&gt;tradingeconomics.com/malaysia/rating&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="25215" LastEditorUserId="848" LastEditDate="2016-11-09T17:31:33.380" LastActivityDate="2016-11-09T17:31:33.380" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30932" PostTypeId="1" CreationDate="2016-11-09T17:51:13.683" Score="8" ViewCount="521" Body="&lt;p&gt;I am reading a book &quot;The concepts and practice of mathematical finance&quot; by Mark Joshi. In Chapter 18 he discusses the shapes and dynamics of smiles under different models. I do not understand what is meant by &quot;smile implied by a model&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I understand it, given a vanilla option with a fixed maturity $T$ and strike $K$, implied volatility is defined as the value of the parameter $\sigma$ we need to input into the &lt;strong&gt;Black-Scholes&lt;/strong&gt; formula in order to get the price &lt;strong&gt;observed&lt;/strong&gt; in the market. Repeating this for different strikes, we obtain the smile as a function of $K$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Correct me if I am wrong, but implied volatilities are &lt;strong&gt;always&lt;/strong&gt; meant to be as above and relate to the Black-Scholes model. In this case, can anyone please give me a definition of &quot;smile implied by a model&quot; for a more general model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, Joshi discusses the smiles of the stochastic volatility model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{dS}{S} = \mu dt + V^{1/2} dW^{(1)},$$&#xA;$$ dV = \lambda (V_r - V) dt + \sigma_V V^\alpha dW^{(2)}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What totally confuses me is when he talks about the smile implied by this model. We are allowed to calibrate any of $\alpha$, $\lambda$, $V_r$ and $\sigma_V$ so that the model matches market prices, but volatility of the stock is a stochastic process so there is no way we can introduce &quot;implied volatility&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a similar confusion in the case of jump-diffusions or variance gamma. There could be even more parameters and the solution set that gives the market price would be multidimensional. Let alone the fact that volatility of the stock may not be a parameter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for your help.&lt;/p&gt;&#xA;" OwnerUserId="25206" LastEditorUserId="25206" LastEditDate="2016-11-09T18:55:21.477" LastActivityDate="2016-11-15T18:33:29.743" Title="Confusion with volatility smiles implied by different models" Tags="&lt;implied-volatility&gt;&lt;stochastic-volatility&gt;&lt;models&gt;&lt;implied&gt;&lt;variance-gamma&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30933" PostTypeId="1" CreationDate="2016-11-09T18:09:32.250" Score="1" ViewCount="104" Body="&lt;p&gt;I have been attempting this question a few times over the past few days but can't seem to make any headway on it. Any help would be greatly appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A loan of €L was to be repaid over a twenty-year period by level&#xA;monthly instalments in arrears using an effective interest rate of 5% for&#xA;the first five years, 6% for the next five years and 7% for the rest. The&#xA;first instalment was paid exactly one month after the loan was made&#xA;and €1,766.13 capital was repaid in the 122nd repayment.&#xA;(a) Calculate the amount of each monthly repayment and hence L.&#xA;(b) Find the total amount of interest that was paid in the last twelve&#xA;instalments.&lt;/p&gt;&#xA;" OwnerUserId="25217" LastActivityDate="2016-11-12T15:27:01.847" Title="Variable Loan Interest Question" Tags="&lt;interest&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30934" PostTypeId="2" ParentId="30932" CreationDate="2016-11-09T19:37:20.307" Score="7" Body="&lt;p&gt;In the context of option pricing, &quot;implied volatility&quot; always refers to the equivalent diffusion coefficient in the geometric Brownian motion (GBM) dynamics that is necessary to match an observed European plain vanilla price for a given strike and maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When talking about &quot;model implied volatility smile&quot;, what is meant is that: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You choose some pricing model such as the ones mentioned in your question.&lt;/li&gt;&#xA;&lt;li&gt;You fix the model's parameters.&lt;/li&gt;&#xA;&lt;li&gt;Under the given model dynamics and parameters you value European plain vanilla option prices for all strikes of the maturity of interest.&lt;/li&gt;&#xA;&lt;li&gt;Finally, you then treat these model prices as the observed inputs to your implied volatility computation. I.e. you compute the equivalent GBM volatility such that the previously computed model prices are matched.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2016-11-09T19:43:27.277" LastActivityDate="2016-11-09T19:43:27.277" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30937" PostTypeId="1" CreationDate="2016-11-10T02:38:00.843" Score="1" ViewCount="145" Body="&lt;p&gt;new to the area, and had a question about basis risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I entered into a receive fixed pay 1mo Libor swap, why is it good for me if the 1x3 month Libor widens and bad for me when it tightens.  Also if I am OIS discounting, why is it good for me if the OIS/3Mo Libor basis widens and bad for me when it tightens.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance for your help.  &lt;/p&gt;&#xA;" OwnerUserId="25223" LastActivityDate="2016-11-10T11:20:04.090" Title="Beginner question about basis risk" Tags="&lt;derivatives&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30938" PostTypeId="2" ParentId="8247" CreationDate="2016-11-10T02:45:38.230" Score="0" Body="&lt;p&gt;Say the stock follows geometric brownian motion as you said&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;dS = \mu Sdt+\sigma Sdz&#xA;\tag 1 &#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then &lt;a href=&quot;https://en.wikipedia.org/wiki/It%C3%B4%27s_lemma&quot; rel=&quot;nofollow noreferrer&quot;&gt;Ito's Lemma&lt;/a&gt; says that the process followed by a function $c$ of $s$ and $t$ (such as the price of a call option) is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dc = \left( \frac{\partial c}{\partial S}\mu S + \frac{\partial c}{\partial t}+\frac12 \frac{\partial^2c}{\partial S^2}\sigma^2S^2 \right) dt + \frac{\partial c}{\partial S}\sigma Sdz&#xA;\tag 2 $$&#xA;with the same source of uncertainty $dz$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can then create a portfolio $\Pi$ consisting of&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$-1$ derivative&lt;/li&gt;&#xA;&lt;li&gt;$+\frac{\partial c}{\partial S}$ shares&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The value of this portfolio is then &#xA;$$\Pi = -c + \frac{\partial c}{\partial S}S&#xA;\tag 3 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The change in the value of the portfolio in some small time interval $dt$ is then&#xA;$$d\Pi = -dc+\frac{\partial c}{\partial S}dS&#xA;\tag 4 $$&#xA;substituting $(1)$ and $(2)$ into $(4)$ gives &#xA;$$d\Pi=\left(-\frac{\partial c}{\partial t} -\frac12 \frac{\partial^2c}{\partial S^2}\sigma^2S^2\right)dt &#xA;\tag 5$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this portfolio is &lt;strong&gt;risk free&lt;/strong&gt; because the $dz$ term disappeared. (More technically, this portfolio is &lt;a href=&quot;https://en.wikipedia.org/wiki/Delta_neutral&quot; rel=&quot;nofollow noreferrer&quot;&gt;delta neutral&lt;/a&gt;) Assuming a market without arbitrage, such risk free portfolio must earn a risk-free rate of return, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d\Pi = r\Pi dt&#xA;\tag 6 $$ where $r$ is the risk free interest rate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;substitute $(3)$ and $(4)$ into $(6)$ and we have&#xA;$$\left(\frac{\partial c}{\partial t}+\frac12 \frac{\partial^2c}{\partial S^2}\sigma^2S^2\right)dt = r\left(c - \frac{\partial c}{\partial S}S\right)dt $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\partial c}{\partial t}+\frac12 \frac{\partial^2c}{\partial S^2}\sigma^2S^2 \frac{\partial c}{\partial S}S = rc$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is the Black-Scholes differential equation. Solving for c gives the Black-Scholes formula, but that's for another day. The key takeaway is that the $\mu$ term is hedged away when we create the delta neutral portfolio $\Pi$&lt;/p&gt;&#xA;" OwnerUserId="25222" LastEditorUserId="24222" LastEditDate="2016-11-10T03:16:19.567" LastActivityDate="2016-11-10T03:16:19.567" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30939" PostTypeId="1" AcceptedAnswerId="30942" CreationDate="2016-11-10T09:44:03.713" Score="3" ViewCount="2427" Body="&lt;p&gt;Mean-Variance portfolio optimization attracted lots of attention in this forum so far. I am interested in the effect of incorporating transaction costs into the decision framework and I would like to obtain 'optimal' portfolios. In other words, approaches which are still capable of being solved using quadratic programing by constraining maximum turnover are not what I am looking for. Just recently, &lt;a href=&quot;https://quant.stackexchange.com/questions/30549/maximum-certainty-equivalent-portfolio-with-transaction-costs&quot;&gt;this question&lt;/a&gt; was solved with the help of the community in order to obtain optimal portfolios if we consider quadratic transaction costs. However, what happens if we come up with transaction costs in a V-shape, which means we pay a fee proportionally to the sum of absolute rebalancing:&#xA;$$TC(\omega_\text{new}) \propto ||\omega_\text{new}-\omega_\text{old}||.$$&#xA;&lt;a href=&quot;https://scholar.google.com/scholar?q=The%20mean-variance%20approach%20to%20portfolio%20optimization%20subject%20to%20transaction%20costs&amp;amp;hl=de&amp;amp;as_sdt=0&amp;amp;as_vis=1&amp;amp;oi=scholart&amp;amp;sa=X&amp;amp;ved=0ahUKEwjh6LyQ8J3QAhXE1xQKHXV-DjUQgQMIGzAA&quot; rel=&quot;nofollow noreferrer&quot;&gt;This (rather old) paper&lt;/a&gt; by Atsushi Yoshimoto handles exactly the optimization problem I want to solve:&#xA;$$  \omega_\text{new} = \arg\max {\omega'\mu - \sum_{i=1}^N c_i -\lambda \omega'\Sigma\omega} \\ \text{s.t.} c_i = k(d^+ _{i,t} + d^- _{i,t}), \forall i \\&#xA;\omega_{i}-\omega_{old} = d_{i} ^+ - d_{i} ^-, \forall i \\&#xA;d_i ^+ d_i ^- =0, \forall i \\&#xA;d_i ^+, d_i ^- \geq 0 \forall i \\\omega'\iota=1 $$&#xA;Intuitively speaking the optimization is doing the following: Given estimates of future returns $\mu$ and volatility $\Sigma$, we search for $\omega$ which maximizes our Certainty equivalent. This value is decreased with total transaction costs $\sum c$. Transaction costs occur if we rebalance our portfolio: Given we increase the share of wealth in one asset $i$, this affects $d_i ^+$ and, vice versa, if we decrease the share of wealth in one asset, this increases $d_i ^-$. Total rebalancing in asset $i$ is therefore $d_i ^+ +d_i ^-$. The constraint $d_i ^+ d_i ^- = 0$ ensures, that one cannot buy and sell simultaneously one asset (which should be clear). &#xA;The last constraint requires that our new portfolio weights $\omega$ sum up to 1, therefore we are investing all the money into the available assets (I did not incorporate an additional short sell constraint here, opposed to Yoshimoto).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would love to implement this optimization in R, Matlab, Python, whatever, but I do not understand the structure explained in this paper: All which is explained is that a nonlinear optimizer called GAMS/MINOS was used. I think, 20 Years after publishing there should certainly be a publicly available approach to to this, therefore I ask (i) does an implementation already exist? (ii) If not, how to do this properly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: To show my first approach I worked out this small example for R. Hereby I neglect the estimation of the mean but only consider volatility timing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(alabama)&#xA;library(quantmod)&#xA;&#xA;symbols &amp;lt;- c(&quot;MSFT&quot;,&quot;AAPL&quot;,&quot;MMM&quot;)            &#xA;getSymbols(symbols,src='yahoo',from = '1995-01-01') &#xA;N &amp;lt;- length(symbols)&#xA;&#xA;MSFT &amp;lt;-  to.monthly(MSFT)&#xA;AAPL &amp;lt;-  to.monthly(AAPL)&#xA;MMM &amp;lt;-  to.monthly(MMM)&#xA;returns &amp;lt;- data.frame(MSFT=diff(log(MSFT$MSFT.Adjusted)),&#xA;                  AAPL=diff(log(AAPL$AAPL.Adjusted)),&#xA;                  MMM=diff(log(MMM$MMM.Adjusted)))&#xA;returns &amp;lt;- na.omit(returns)&#xA;names(returns) &amp;lt;- symbols&#xA;&#xA;mu &amp;lt;- rep(1,N)&#xA;sigma &amp;lt;- cov(returns)&#xA;lambda &amp;lt;- 4&#xA;costpara &amp;lt;- 50/10000&#xA;wold &amp;lt;- rep(1/N,N) &#xA;&#xA;fn &amp;lt;- function(w) -w%*%mu + costpara*sum(abs(w-    wold))+lambda*t(w)%*%sigma%*%w&#xA;heq &amp;lt;- function(w) return(sum(w)-1)&#xA;out &amp;lt;- constrOptim.nl(par=wold, fn=fn,heq=heq)&#xA;rbind(out$par,wold)&#xA;&#xA;wnew 0.3333233 0.08347908 0.5831977&#xA;wold 0.3333333 0.33333333 0.3333333&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I am not too familiar with numerical optimization, so can anyone confirm this approach is correct, or point out ways to improve the optimization?&lt;/p&gt;&#xA;" OwnerUserId="16249" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-11-10T11:20:43.763" Title="Portfolio optimization subject to transaction costs" Tags="&lt;portfolio-management&gt;&lt;programming&gt;&lt;optimization&gt;&lt;modern-portfolio-theory&gt;&lt;transaction-costs&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30940" PostTypeId="2" ParentId="30937" CreationDate="2016-11-10T11:20:04.090" Score="2" Body="&lt;p&gt;I don't agree with either statement.  Taking the first statement , if you receive fixed/pay 1m libor , and the 3m/1m basis widens.  There are two ways this can happen (I) the forward rates for 1m libor go down and the forward rates for 3m libor stay the same. In this case you make money.   But also (II) the forward rates for 3m libor could go up and the forward rates for 1m libor stay the same.  In this case you make no money.   I am guessing that whomever told you that was assuming that the case (I) applies, since most swaps traders use 3m libor swaps as a benchmark.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the second statement, if you have just done a swap at market, such that its present value is zero , then changing the discount rate has little effect on its value.  The statement would be generally true if the swap were &quot;in the money&quot;, meaning having positive value to you.  Then if the discount rate is lowered , by libor/iOS spreads widening when 3mo libor stays the same , then you would make money.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-11-10T11:20:04.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30941" PostTypeId="1" CreationDate="2016-11-10T11:20:20.733" Score="1" ViewCount="141" Body="&lt;p&gt;This is the best historical time series which I could find from tradingeconomics.com/malaysia/rating. It would be great if someone could answer my question. I am currently researching on the topic of credit rating. I need to use the data from the link above. However, I am not sure if I interpreted the ratings correctly. For e.g. Fitch's ratings for Malaysia in 2008 and in 2013 are A-, can I assume that from 2008 to 2013 Malaysia had A- as ratings (does it apply to other Credit Rating Agencies as well)? I am not sure if countries get rated yearly and if I could use the last rating of the year to represent the rating for a particular year? Your help is greatly appreciated!&lt;/p&gt;&#xA;" OwnerUserId="25215" LastActivityDate="2017-03-06T06:30:29.580" Title="How do I interpret the credit rating history time series?" Tags="&lt;risk&gt;&lt;credit&gt;&lt;economics&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30942" PostTypeId="2" ParentId="30939" CreationDate="2016-11-10T11:20:43.763" Score="2" Body="&lt;p&gt;What you do looks ok. But in practice how would you set &lt;code&gt;costpara&lt;/code&gt;? This coud have a huge impact on your optimization.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I would do something different. Define the buys $b_i&amp;gt;0$ and the sells $s_i&amp;gt;0$ then you have&#xA;$$&#xA;w_i = wold_i + b_i - s_i&#xA;$$&#xA;or in other terms:&#xA;$$&#xA;w_i-wold_i - b_i + s_i = 0.&#xA;$$&#xA;This is a linear equality that you cas use in your &lt;code&gt;heq&lt;/code&gt;. Then you add a constraint &#xA;$$&#xA;\sum_{i=1}^n b_i + s_i \le T&#xA;$$&#xA;for some turnover limit $T$. Then you make sure that the problem is optimized under a turnover constraint. Multipliying this $T$ by your cost of one percent sold or bought gives you control over transaction costs.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-11-10T11:20:43.763" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30943" PostTypeId="2" ParentId="25370" CreationDate="2016-11-10T12:01:32.060" Score="2" Body="&lt;p&gt;It seems that daily European factor data has been added to the website!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also find daily data for other regions (Japan, APAC, North America).&lt;/p&gt;&#xA;" OwnerUserId="19615" LastActivityDate="2016-11-10T12:01:32.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30945" PostTypeId="1" CreationDate="2016-11-10T13:40:05.887" Score="0" ViewCount="1523" Body="&lt;p&gt;I am sorry for my incompetence. I am new in Quantitive Finance, so I read an article about the relationship between Alpha and Portfolio Risk and I can not understand what is the meaning behind the orthogonality in Finance. &#xA;For example, I met these sentences:&#xA;&quot;Alpha is the search of sources of risk and return that are ideally orthogonal from the manager is using already.&quot;Maybe here &quot;orthogonal&quot; means different?&#xA;And:&#xA;&quot;Alpha must be orthogonal to widely-known factors and to other alphas in portfolio&quot;. What does it mean?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot!&lt;/p&gt;&#xA;" OwnerUserId="22521" LastActivityDate="2016-12-11T12:53:59.557" Title="Orthogonal sources of risk and return" Tags="&lt;risk&gt;&lt;portfolio-management&gt;&lt;return&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30947" PostTypeId="2" ParentId="30831" CreationDate="2016-11-10T17:02:42.887" Score="0" Body="&lt;p&gt;To answer my own question. Lately I found the &lt;a href=&quot;http://www.highcharts.com&quot; rel=&quot;nofollow&quot;&gt;HighStock&lt;/a&gt;, which is in JavaScript.&lt;/p&gt;&#xA;" OwnerUserId="22069" LastActivityDate="2016-11-10T17:02:42.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30949" PostTypeId="1" CreationDate="2016-11-10T17:36:37.123" Score="4" ViewCount="276" Body="&lt;p&gt;I have American option prices for SPY and need to calculate the equivalent European option price to use in further calculations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What does it (formally) mean to price the equivalent European option from an American option?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I have $C_{\text{American}}(K, S, r, T, \delta)$, how do I retrieve $C_{\text{European}}(K, S, r, T, \delta)$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: are there any methods to price the European put (call) from the market price of the American put (call)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the $P_E - P_A \leq 0$ (the American is strictly greater than the European due to exercise premium), will attempts at modeling the time-dependent dividend cash flow provide a model-free approach to price the European counterpart? How do varying interest rates impact these results? Can interest rate variation be safely ignored from some threshold of $T$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit 2: I also can observe the price of the American call. I want to use calls and puts together to strengthen my call &lt;strong&gt;or&lt;/strong&gt; put price curve quotes (or other calculations that are derived from them) knowing that OTM options are much more liquid. So even though I cannot trade the ITM call as well, I can get a better idea of its value for modeling purposes from the corresponding put. This is along the same line of thinking because if I could convert to European options I could utilize strict parity, so a method to price the European counterpart would be pricing the source of disparity between the European and the American.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit 3: I have found a resource (from 1987) that makes attempts at analytically valuing the difference of an American exercise vanilla vs European exercise:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;REFERENCES&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Barone-Adesi, Giovanni &amp;amp; Whaley, Robert E, 1987. &quot; Efficient Analytic Approximation of American Option Values,&quot; Journal of Finance, American Finance Association, vol. 42(2), pages 301-320, June.&lt;/p&gt;&#xA;" OwnerUserId="20194" LastEditorUserId="20194" LastEditDate="2018-08-29T18:54:26.697" LastActivityDate="2018-08-29T18:54:26.697" Title="Pricing the European counterpart from American Options" Tags="&lt;option-pricing&gt;&lt;american-options&gt;&lt;european-options&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="30951" PostTypeId="2" ParentId="30949" CreationDate="2016-11-10T18:36:33.027" Score="3" Body="&lt;p&gt;First, you need to specify your working modelling assumptions by selecting a (jump)-diffusion framework, or more exactly, by postulating the risk-neutral dynamics of the underlying (e.g. Black-Scholes). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, you choose a pricing method, which should allow you to price both American-style and European-style vanillas (e.g. a binomial lattice)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At this point, using the above pricing method, you should be able to calibrate your model parameters so that they allow you to reproduce the American option price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Eventually, you can use these calibrated parameters (e.g. the vol, forward and discount actor in BS) to price the European-style counterpart of your American contract.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-11-10T18:43:04.760" LastActivityDate="2016-11-10T18:43:04.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30952" PostTypeId="1" CreationDate="2016-11-10T23:33:19.743" Score="0" ViewCount="95" Body="&lt;p&gt;I have a company that I want to value that is very thinly traded. Its stock has been very erratic. Doing a regression gives me a beta of 0.52 (std. err. 0.43). In other words useless.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the best way of estimating its cost of equity?&lt;/p&gt;&#xA;" OwnerUserId="24497" LastEditorUserId="24497" LastEditDate="2016-11-10T23:46:56.260" LastActivityDate="2016-11-11T01:27:17.423" Title="CAPM with thinly traded companies" Tags="&lt;capm&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30953" PostTypeId="2" ParentId="30952" CreationDate="2016-11-11T01:27:17.423" Score="1" Body="&lt;p&gt;There are a number of ways you can do this and there is a tonne of material on the web researching this in depth.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The easiest approaches you can take without getting too deep in the mathematics and fundamentals would be either of the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Sector average - Take the weighted average (by revenue, assets or market cap) levered beta from traded companies within the same sector then unlever it to arrive at a pretty good approximate.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Comparable companies - Find companies with very similar capital structure and operations and wither take the median or average.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;There would normally be some form of illiquidity premium added to this however that is another topic all together. Aswath Damodaran explores this topic quite a bit with respect to illiquid companies and calculation of betas for private companies which can be found &lt;a href=&quot;http://people.stern.nyu.edu/adamodar/&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; and contains many examples using excel.&lt;/p&gt;&#xA;" OwnerUserId="24077" LastActivityDate="2016-11-11T01:27:17.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30955" PostTypeId="2" ParentId="30945" CreationDate="2016-11-11T11:23:35.100" Score="1" Body="&lt;p&gt;Although this question is not a good fit for this forum (too basic) I answer it anyway:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It means that both are &lt;a href=&quot;https://en.wikipedia.org/wiki/Independence_(probability_theory)&quot; rel=&quot;nofollow noreferrer&quot;&gt;statistically independent&lt;/a&gt;. So intuitively when one income stream goes up the other either goes up too, or goes down or stays the same - completely independently.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2016-11-11T11:23:35.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30956" PostTypeId="1" CreationDate="2016-11-11T11:30:45.057" Score="4" ViewCount="498" Body="&lt;p&gt;@Behrouz Maleki has provided the PDE of two factor model in &lt;a href=&quot;https://quant.stackexchange.com/questions/18635/boundary-condition-for-convertible-bond-under-two-factor-model-interest-rate&quot;&gt;other post&lt;/a&gt; so &#xA;could anyone please provide Ito lemma of this equation and how this PDE was derived from Vasicek model. as far as I know it is by constructing a portfolio. right?&lt;/p&gt;&#xA;" OwnerUserId="25228" LastEditorUserId="-1" LastEditorDisplayName="user16651" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-11-11T17:55:35.360" Title="Ito lemma of Convertible Bond under Two-factor Model Interest Rate" Tags="&lt;option-pricing&gt;&lt;stochastic-calculus&gt;&lt;hedging&gt;&lt;convertible-bond&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30959" PostTypeId="2" ParentId="10366" CreationDate="2016-11-11T12:35:49.967" Score="1" Body="&lt;p&gt;Credit rating agencies all disclose their codes (and a general methodology) online.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&quot;The 'u' identifier and 'unsolicited' designation are assigned to credit ratings initiated by parties other than the issuer or its agents, including those initiated by S&amp;amp;P Global Ratings.&quot;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&quot;SD: An obligor rated 'SD' (selective default) or 'D' is in default... an 'SD' rating is assigned when S&amp;amp;P Global Ratings believes that the obligor has selectively defaulted on a specific issue or class of obligations but it will continue to meet its payment obligations on other issues or classes of obligations in a timely manner. An obligor's rating is lowered to 'D' or 'SD' if it is conducting a distressed exchange offer.&quot;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;a href=&quot;https://www.standardandpoors.com/en_AU/web/guest/article/-/view/sourceId/504352&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.standardandpoors.com/en_AU/web/guest/article/-/view/sourceId/504352&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="24676" LastActivityDate="2016-11-11T12:35:49.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30960" PostTypeId="2" ParentId="30933" CreationDate="2016-11-11T13:58:36.840" Score="3" Body="&lt;p&gt;We can find the answers by using the recurrence equation for a loan.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;p[n] is the balance of the loan in month n&#xA;r[n] is the interest rate in month n&#xA;d is the regular monthly payment&#xA;s is the initial loan principal&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;using &lt;em&gt;Mathematica&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;RSolve[{p[n + 1] == p[n] (1 + r[n + 1]) - d, p[0] == s}, p[n], n]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;yields&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/6OA6e.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/6OA6e.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Defining the rates&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;rates = Join[&#xA;   ConstantArray[(1 + 0.05)^(1/12) - 1, 60],&#xA;   ConstantArray[(1 + 0.06)^(1/12) - 1, 60],&#xA;   ConstantArray[(1 + 0.07)^(1/12) - 1, 120]];&#xA;Array[(r[#] = rates[[#]]) &amp;amp;, 240];&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so the following variables are now defined&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;r[1], r[2] etc. = 0.0040741237836483535&#xA;r[61], r[62] etc. = 0.004867550565343048&#xA;r[121], r[122] etc. = 0.005654145387405274&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Setting &lt;code&gt;p[0] = s&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The balance in month 240 is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;p[240]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;-486.25993004513117 d + 3.3598013365663992 s&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and should equal zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The capital repayment in month 122 is the repayment less monthly interest&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;d - (p[121] r[122])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;d - 0.005654145387405274 (-162.14186160490192 d + 1.7176096436481687 s)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is required to equal 1,766.13&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solving simultaneously&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;NSolve[{&#xA;  -486.25993004513117 d + 3.3598013365663992 s == 0,&#xA;  d - 0.005654145387405274 (-162.14186160490192 d + 1.7176096436481687 s) == 1766.13},&#xA; {s, d}]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;{{s -&gt; 499996.1740005939, d -&gt; 3454.7115850762493}}&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Calculating the interest for the last 12 months, using inputs to 2 decimal places.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;s = 499996.17&#xA;d = 3454.71&#xA;&#xA;Total[p[# - 1] r[#] &amp;amp; /@ Range[240 - 12, 240]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;1728.46&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="7178" LastEditorUserId="7178" LastEditDate="2016-11-12T15:27:01.847" LastActivityDate="2016-11-12T15:27:01.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30961" PostTypeId="1" AcceptedAnswerId="30968" CreationDate="2016-11-11T15:26:37.613" Score="2" ViewCount="147" Body="&lt;p&gt;I am a beginner to Risk and I am trying to start a project that it can calculate risk measures like &lt;code&gt;VaR&lt;/code&gt;, &lt;code&gt;LSTD&lt;/code&gt;, &lt;code&gt;Beta&lt;/code&gt;, Correlation so I would like to systematically learn how those number are calculated pragmatically.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could someone recommend me some books so that I can get started? Appreciate about that.&lt;/p&gt;&#xA;" OwnerUserId="25216" LastActivityDate="2016-11-12T05:12:20.050" Title="Calculate risk measures (book recommendation)?" Tags="&lt;risk&gt;&lt;programming&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30962" PostTypeId="2" ParentId="30956" CreationDate="2016-11-11T15:47:33.690" Score="6" Body="&lt;p&gt;Let $V(t, r_t, S_t)$ be the convertible bond price at time $t$, where&#xA;\begin{align*}&#xA;dS_t &amp;amp;= S_t(r_t dt + \sigma dW_t^1)\\&#xA;dr_t &amp;amp;=\kappa(\theta-r_t)dt+\Sigma dW_t^2,&#xA;\end{align*}&#xA;and where $\{W_t^1, \, t\ge 0\}$ and $\{W_t^2, \, t\ge 0\}$ are two standard Brownian motions with $d\langle W^1, W^2\rangle_t = \rho dt$. Then, &#xA;\begin{align*}&#xA;&amp;amp;\ dV(t, r_t, S_t) \\&#xA;=&amp;amp;\ \frac{\partial V}{\partial t}dt + \frac{\partial V}{\partial r}dr_t + \frac{\partial V}{\partial S}dS_t \\&#xA;&amp;amp;\quad + \frac{1}{2}\frac{\partial^2 V}{\partial r^2}d\langle r, r\rangle_t + \frac{1}{2}\frac{\partial^2 V}{\partial S^2}d\langle S, S\rangle_t +\frac{\partial^2 V}{\partial S \partial r}d\langle S, r\rangle_t\\&#xA;=&amp;amp;\ \left(\frac{\partial V}{\partial t} + \kappa(\theta-r_t) \frac{\partial V}{\partial r} + r_tS_t \frac{\partial V}{\partial S} + \frac{1}{2}\Sigma^2\frac{\partial^2 V}{\partial r^2} + \frac{1}{2}\sigma^2 S_t^2\frac{\partial^2 V}{\partial S^2} + \rho\sigma\Sigma\frac{\partial^2 V}{\partial S \partial r}\right)dt \\&#xA;&amp;amp;\ +\Sigma \frac{\partial V}{\partial r}dW_t^2 + \sigma S_t \frac{\partial V}{\partial S}dW_t^1.&#xA;\end{align*}&#xA;We note that, under the risk-neutral measure, $\{e^{-\int_0^t r_s ds} V_t, \, t \ge 0\}$ is a martingale. By Ito's lemma,&#xA;\begin{align*}&#xA;d\left(e^{-\int_0^t r_s ds} V_t \right) &amp;amp;= -r_t e^{-\int_0^t r_s ds} V_t dt + e^{-\int_0^t r_s ds} dV_t\\&#xA;&amp;amp;= e^{-\int_0^t r_s ds}\bigg[\bigg(-r_t V_t + \frac{\partial V}{\partial t} + \kappa(\theta-r_t) \frac{\partial V}{\partial r} + r_tS_t \frac{\partial V}{\partial S} \\&#xA;&amp;amp;\qquad\qquad\qquad + \frac{1}{2}\Sigma^2\frac{\partial^2 V}{\partial r^2} + \frac{1}{2}\sigma^2 S_t^2\frac{\partial^2 V}{\partial S^2} + \rho\sigma\Sigma\frac{\partial^2 V}{\partial S \partial r}\bigg)dt\\&#xA;&amp;amp;\quad + \Sigma \frac{\partial V}{\partial r}dW_t^2 + \sigma S_t \frac{\partial V}{\partial S}dW_t^1\bigg].&#xA;\end{align*}&#xA;By the martingality property,&#xA;\begin{align*}&#xA;&amp;amp; -r_t V_t + \frac{\partial V}{\partial t} + \kappa(\theta-r_t) \frac{\partial V}{\partial r} + r_tS_t \frac{\partial V}{\partial S} \\&#xA;&amp;amp;\qquad + \frac{1}{2}\Sigma^2\frac{\partial^2 V}{\partial r^2} + \frac{1}{2}\sigma^2 S_t^2\frac{\partial^2 V}{\partial S^2} + \rho\sigma\Sigma\frac{\partial^2 V}{\partial S \partial r}=0. \tag{1}&#xA;\end{align*}&#xA;This is the PDE satisfied by the instrument price. If Brownian motions $\{W_t^1, \, t\ge 0\}$ and $\{W_t^2, \, t\ge 0\}$ are independent, that is, $\rho=0$, then Equation $(1)$ becomes&#xA;\begin{align*}&#xA;-r_t V_t + \frac{\partial V}{\partial t} + \kappa(\theta-r_t) \frac{\partial V}{\partial r} + r_tS_t \frac{\partial V}{\partial S} + \frac{1}{2}\Sigma^2\frac{\partial^2 V}{\partial r^2} + \frac{1}{2}\sigma^2 S_t^2\frac{\partial^2 V}{\partial S^2} =0. \tag{2}&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-11-11T16:23:36.627" LastActivityDate="2016-11-11T16:23:36.627" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30965" PostTypeId="2" ParentId="30956" CreationDate="2016-11-11T16:23:28.783" Score="3" Body="&lt;p&gt;Gordon's Answer is nice (+1). I want to add the other solution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Remark 1&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $X=(X_1,X_2,...,X_n)$ where the component $X_i$ has a stochastic differential of the form&#xA;$$dX_i(t)=\mu_i(t)dt+\sum_{j=1}^{d}\sigma_{ij}(t)dW_j(t)$$&#xA;where $dW_k(t)dW_j(t)=\rho_{kj}dt$, for all $k,j\in\{1,2,...,d\}$. Let $f:\mathbb{R}^+\times\mathbb{R}^n\to\mathbb{R}\in\mathbb{C}^{1,2}.$ By application of Ito's lemma, we have&#xA;$$df(t,X_1,...,X_n)=\frac{\partial f}{\partial t}dt+\sum_{i=1}^{n}\frac{\partial f}{\partial x_i}dX_i+\frac 12\sum_{i=1}^{n}\sum_{l=1}^{n}\frac{\partial ^2f}{\partial x_i\partial x_l}dX_idX_l\tag 1$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Remark 2&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume that the short rate $r_t$ follows the Ito process as described by the following stochastic differential equation&#xA;$$dr_t=\mu(t,r_t)dt+\sigma(t,r_t)dW_t$$&#xA;and $P(t,T)$ denotes the zero-coupon bond price with maturity $T$. We can show &#xA;$$\frac{\partial P}{\partial t}+\mu(t,r_t)\frac{\partial P}{\partial r}+\frac{1}{2}\sigma^2(t,r_t)\frac{\partial^2 P}{\partial r^2}-r_tP=0\tag 2$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Remark 3&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let&#xA;$$\qquad dS_t=rS_t+\sigma S_tdW_1(t)\\&#xA;\quad\qquad\quad dr_t=\kappa(\theta-r_t)dt+\Sigma dW_2(t)\\&#xA;dW_1(t)dW_2(t)=0\tag 3$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we form a portfolio consisting of one option $V=V(t,S,r,T,K)$ (Short position), $\Delta_1$ units of the stock (long position) and $\Delta_2$ units of the $T-$zero-coupon bond price (long position). The portfolio has value&#xA;$$\Pi=\Delta_1S_t+\Delta_2 P(t,T)-V(t,S,r,T,K)$$&#xA;therefore&#xA;$$d\Pi=\Delta_1dS_t+\Delta_2dP(t,T)-dV(t,S,r,T,K)\tag 4$$&#xA;By application of Ito's lemma, we have&#xA;$$dV_t=\frac{\partial V}{\partial t}dt+\frac{\partial V}{\partial s}dS+\frac{\partial V}{\partial r}dr+\frac 12\left(\sigma^2\frac{\partial^2 V}{\partial s^2}+\Sigma^2\frac{\partial^2 V}{\partial r^2}\right)dt\tag 5$$&#xA;and&#xA;$$dP=\frac{\partial P}{\partial t}dt+\frac{\partial P}{\partial r}dr+\frac{1}{2}\Sigma^2\frac{\partial^2 P}{\partial r^2}dt\tag 6$$&#xA;$(4)\,,\,(5)\,,(6)$ and $(3)$&#xA;$$d\Pi =-\left( \frac{\partial V}{\partial t}+\frac{1}{2}{{\sigma }^{2}}{{S}^{2}}\frac{{{\partial }^{2}}V}{\partial {{S}^{2}}} \right)dt+\left( \Delta _1-\frac{\partial V}{\partial S} \right)dS\\+\left( \Delta _2\frac{\partial P}{\partial r}\,-\frac{\partial V}{\partial r} \right)dr+\Delta _2\,\left( \frac{\partial P}{\partial t}+\frac{1}{2}{{\Sigma }^{2}}\frac{{{\partial }^{2}}P}{\partial {{r}^{2}}} \right)dt\,$$&#xA;We then find the values of $\Delta_1$ and $\Delta_2$ that makes the portfolio riskless. Indeed, we set&#xA;$$ \Delta_1=\frac{\partial V}{\partial S}\\&#xA;\Delta_2=\frac{\frac{\partial V}{\partial r}}{\frac{\partial P}{\partial r}}$$&#xA;thus&#xA;$$d\Pi =-\left( \frac{\partial V}{\partial t}+\frac{1}{2}{{\sigma }^{2}}{{S}_{t}}^{2}\frac{{{\partial }^{2}}V}{\partial {{S}^{2}}}+\frac{1}{2}{{\Sigma }^{2}}\frac{{{\partial }^{2}}V}{\partial {{r}^{2}}} \right)dt+\Delta {{}_{2}}\,\left( \frac{\partial P}{\partial t}+\frac{1}{2}{{\Sigma }^{2}}\frac{{{\partial }^{2}}P}{\partial {{r}^{2}}} \right)dt\tag 7$$&#xA;$(2)$ and $(7)$&#xA;$$d\Pi =-\left( \frac{\partial V}{\partial t}+\frac{1}{2}{{\sigma }^{2}}{{S}^{2}}\frac{{{\partial }^{2}}V}{\partial {{S}^{2}}}+\frac{1}{2}{{\Sigma }^{2}}\frac{{{\partial }^{2}}V}{\partial {{r}^{2}}} \right)dt+\Delta {{}_{2}}\,\left( {{r}_{t}}\,P-\kappa \left( \theta -r \right)\,\frac{\partial P}{\partial r} \right)dt\tag 8$$&#xA;The condition that the portfolio earn the risk-free rate, $r$, implies that the change in portfolio value is $$d\Pi=r\Pi dt$$&#xA;in other words&#xA;$$d\Pi =(\Delta _1r_t\,S_t+\Delta_2r_tP-r_tV)dt\tag 9$$&#xA;$(8)$ and $(9)$&#xA;$$\frac{\partial V}{\partial t}+{{r}_{t}}\,{{S}_{t}}\frac{\partial V}{\partial S}+\kappa \left( \theta -r \right)\frac{\partial V}{\partial t}+\frac{1}{2}{{\sigma }^{2}}{{S}^{2}}\frac{{{\partial }^{2}}V}{\partial {{S}^{2}}}+\frac{1}{2}{{\Sigma }^{2}}\frac{{{\partial }^{2}}V}{\partial {{r}^{2}}}-{{r}_{t}}V=0$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-11-11T16:26:11.557" LastActivityDate="2016-11-11T16:26:11.557" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="30966" PostTypeId="1" AcceptedAnswerId="30967" CreationDate="2016-11-11T16:45:53.507" Score="2" ViewCount="262" Body="&lt;p&gt;I would like to optimize a portfolio allocation (maximizing the exposure or the expected return), but with asset constraints. (some parts of my portfolio cannot exceed a certain minimum or maximum). For example, 60% max on equity and 5% min on cash, say for liquidity. Let's say there are five assets, cash, US and UK equity, US fixed income, and US property.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I achieve that? Is there a way to turn the problem into a linear programming problem? or to approximate the results?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any links or ideas are welcome.&lt;/p&gt;&#xA;" OwnerUserId="21023" LastActivityDate="2018-12-02T08:14:51.767" Title="Portfolio optimisation by asset allocation" Tags="&lt;portfolio-optimization&gt;&lt;asset-allocation&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30967" PostTypeId="2" ParentId="30966" CreationDate="2016-11-11T17:22:08.817" Score="5" Body="&lt;p&gt;There are very powerful software solutions out there, so you should not reinvent the wheel.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One notable R package is &lt;a href=&quot;https://CRAN.R-project.org/package=PortfolioAnalytics&quot; rel=&quot;nofollow noreferrer&quot;&gt;PortfolioAnalytics&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find a very good introduction here, where your concrete constraints requirement is addressed in section 3.3, p. 6:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://cran.r-project.org/web/packages/PortfolioAnalytics/vignettes/portfolio_vignette.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Benett, R.: Introduction to PortfolioAnalytics (2015)&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2016-11-11T17:34:27.653" LastActivityDate="2016-11-11T17:34:27.653" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30968" PostTypeId="2" ParentId="30961" CreationDate="2016-11-11T17:55:14.740" Score="5" Body="&lt;p&gt;A good starting point is the following paper:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://arxiv.org/pdf/0904.0870.pdf&quot; rel=&quot;noreferrer&quot;&gt;Risk Measures in Quantitative Finance by Sovan Mitra (2009)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the abstract:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;[...] Despite risk measurement’s central importance to risk management, few papers exist reviewing them or following their evolution from its foremost beginnings up to the present day risk measures.&#xA;This paper reviews the most important portfolio risk measures in Financial Mathematics, from Bernoulli (1738) to Markowitz’s Portfolio Theory, to the presently preferred risk measures such as CVaR (conditional Value at Risk). We provide a chronological review of the risk measures and survey less commonly known risk measures e.g. Treynor ratio.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your own experiments I recommend the &lt;a href=&quot;https://CRAN.R-project.org/package=PerformanceAnalytics&quot; rel=&quot;noreferrer&quot;&gt;PerformanceAnalytics R package&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://cran.r-project.org/web/packages/PerformanceAnalytics/PerformanceAnalytics.pdf&quot; rel=&quot;noreferrer&quot;&gt;documentation&lt;/a&gt; is quite exhaustive and has many formulas and references included.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://cran.r-project.org/web/packages/PerformanceAnalytics/vignettes/PA-charts.pdf&quot; rel=&quot;noreferrer&quot;&gt;vignette&lt;/a&gt; gets you started.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2016-11-11T18:27:41.687" LastActivityDate="2016-11-11T18:27:41.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30971" PostTypeId="2" ParentId="29895" CreationDate="2016-11-11T19:29:25.143" Score="1" Body="&lt;p&gt;ETF.com has a section called ETF Watch (&lt;a href=&quot;http://www.etf.com/sections/daily-etf-watch.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.etf.com/sections/daily-etf-watch.html&lt;/a&gt;) where you can view all ETF Launches, ETF closures and Index and Ticker Changes by year.&lt;/p&gt;&#xA;" OwnerUserId="25244" LastActivityDate="2016-11-11T19:29:25.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30972" PostTypeId="1" AcceptedAnswerId="30973" CreationDate="2016-11-11T20:14:47.543" Score="0" ViewCount="1272" Body="&lt;p&gt;I'm trying to perform a bootstrap of a yield curve from deposit rates, futures, and swaps, and the interpolation is &quot;blowing up&quot; for the futures maturities being off by two orders of magnitude (100x).  I'm not sure what I'm doing wrong, if anything, or if there's an incorrect assumption I'm making somewhere.  I know some of the code is superfluous, such as having start and maturity dates for the three types if I'm also including explicit periods, but I didn't have much chance to clean it up.  I should also note that I tried changing future_rate_val to be simply the price instead of 100-price, but I got a similarly erroneous result, which is somewhat troubling in and of itself.  Any help would be appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import QuantLib as ql&#xA;from pandas import DataFrame&#xA;import matplotlib.pyplot as plt&#xA;import csv&#xA;&#xA;def get_spot_rates(yieldcurve, day_count, calendar=ql.UnitedStates(), months=121):&#xA;    spots = []&#xA;    tenors = []&#xA;    ref_date = yieldcurve.referenceDate()&#xA;    calc_date = ref_date&#xA;    for month in range(0, months):&#xA;        yrs = month/12.0&#xA;        d = calendar.advance(ref_date, ql.Period(month, ql.Months))&#xA;        compounding = ql.Compounded&#xA;        freq = ql.Semiannual&#xA;        zero_rate = yieldcurve.zeroRate(yrs, compounding, freq)&#xA;        tenors.append(yrs)&#xA;        eq_rate = zero_rate.equivalentRate(day_count,compounding,freq,calc_date,d).rate()&#xA;        spots.append(eq_rate*100)&#xA;    return DataFrame(list(zip(tenors, spots)),columns=[&quot;Maturities&quot;,&quot;Curve&quot;],index=['']*len(tenors))&#xA;&#xA;&quot;&quot;&quot; Deposit Rates &quot;&quot;&quot;&#xA;depo_starts = [ql.Date(1,9,2016),ql.Date(2,9,2016),ql.Date(6,9,2016),ql.Date(6,9,2016),ql.Date(6,9,2016)]&#xA;depo_maturities = [ql.Date(2,9,2016),ql.Date(6,9,2016),ql.Date(6,10,2016),ql.Date(7,11,2016),ql.Date(6,12,2016)]&#xA;&#xA;depo_periods = [ql.Period(1,ql.Days),ql.Period(2,ql.Days),ql.Period(1,ql.Months),ql.Period(2,ql.Months),ql.Period(3,ql.Months)]&#xA;&#xA;depo_rates = [0.45, 0.48, 0.51765, 0.6328, 0.8176]&#xA;&#xA;&quot;&quot;&quot; Futures &quot;&quot;&quot;&#xA;future_starts = [ql.Date(21,9,2016),ql.Date(21,12,2016),ql.Date(15,3,2017),ql.Date(21,6,2017),ql.Date(20,9,2017),ql.Date(20,12,2017),ql.Date(21,3,2018),ql.Date(20,6,2018),ql.Date(19,9,2018),ql.Date(19,12,2018),ql.Date(20,3,2019),ql.Date(19,6,2019)]&#xA;&#xA;future_maturities = [ql.Date(21,12,2016),ql.Date(21,3,2017),ql.Date(15,6,2017),ql.Date(21,9,2017),ql.Date(20,12,2017),ql.Date(20,3,2018),ql.Date(21,6,2018),ql.Date(20,9,2018),ql.Date(19,12,2018),ql.Date(19,3,2019),ql.Date(22,6,2019),ql.Date(19,9,2019)]&#xA;future_rates = [99.13,99.095,99.075,99.045,99.015,98.975,98.955,98.93,98.9,98.855,98.83,98.8]&#xA;&#xA;&quot;&quot;&quot; Swaps &quot;&quot;&quot;&#xA;swap_maturities = [ql.Date(8,9,2020),ql.Date(7,9,2021),ql.Date(6,9,2022),ql.Date(6,9,2023),ql.Date(6,9,2024),ql.Date(8,9,2025),ql.Date(8,9,2026),ql.Date(6,9,2028),ql.Date(8,9,1931),ql.Date(8,9,1936),ql.Date(6,9,1941),ql.Date(6,9,1946),ql.Date(6,9,1956),ql.Date(6,9,1966)]&#xA;&#xA;swap_periods = [ql.Period(4,ql.Years),ql.Period(5,ql.Years),ql.Period(6,ql.Years),ql.Period(7,ql.Years),ql.Period(8,ql.Years),ql.Period(9,ql.Years),ql.Period(10,ql.Years),ql.Period(12,ql.Years),ql.Period(15,ql.Years),ql.Period(20,ql.Years),ql.Period(25,ql.Years),ql.Period(30,ql.Years),ql.Period(40,ql.Years),ql.Period(50,ql.Years)]&#xA;&#xA;swap_rates = [1.06329999999999,1.12319999999999,1.1825,1.24150000000001,1.2975,1.349,1.3965,1.484,1.579,1.68250000000001,1.73049999999999,1.75749999999999,1.77579999999999,1.76000000000001]&#xA;&#xA;&quot;&quot;&quot; Parameter Setup &quot;&quot;&quot;&#xA;calc_date = ql.Date(1,9,2016)&#xA;ql.Settings.instance().evaluationDate = calc_date&#xA;calendar = ql.UnitedStates()&#xA;bussiness_convention = ql.ModifiedFollowing&#xA;day_count = ql.Actual360()&#xA;coupon_frequency = ql.Annual&#xA;&#xA;&quot;&quot;&quot; DepositRateHelper &quot;&quot;&quot;&#xA;depo_helpers = []&#xA;for i in range(len(depo_rates)):&#xA;    depo_helpers.append(ql.DepositRateHelper(ql.QuoteHandle(ql.SimpleQuote(depo_rates[i]/100)),depo_periods[i],3,ql.TARGET(),ql.ModifiedFollowing,False,ql.Actual360()))&#xA;&#xA;&quot;&quot;&quot; FuturesRateHelper &quot;&quot;&quot;&#xA;# Convexity Adjustments&#xA;conv_adjust = [0,0.0001,0.0003,0.0007,0.0013,0.0027,0.005,0.0078,0.0112,0.0158,0.0211,0.0277]&#xA;convexity_quote = []&#xA;for i in range(len(conv_adjust)):&#xA;    convexity_quote.append(ql.SimpleQuote(conv_adjust[i]/100.0))&#xA;&#xA;imm = ql.IMM.nextDate(calc_date)&#xA;futures_helpers = []&#xA;for i in range(len(future_rates)):&#xA;    future_rate_val = (100.0-future_rates[i])/100.0&#xA;    futures_helpers.append(ql.FuturesRateHelper(ql.QuoteHandle(ql.SimpleQuote(future_rate_val)),imm,ql.Euribor3M(),ql.QuoteHandle(convexity_quote[i])))&#xA;    imm = ql.IMM.nextDate(imm)&#xA;&#xA;&#xA;&quot;&quot;&quot; SwapRateHelper &quot;&quot;&quot;&#xA;swap_helpers = []&#xA;for rate,tenor in list(zip(swap_rates,swap_periods)):&#xA;    swap_helpers.append(ql.SwapRateHelper(ql.QuoteHandle(ql.SimpleQuote(rate/100.0)),&#xA;    tenor, calendar,&#xA;    coupon_frequency, bussiness_convention,&#xA;    day_count,&#xA;    ql.Euribor3M()))&#xA;&#xA;rate_helpers = depo_helpers + futures_helpers + swap_helpers&#xA;&#xA;yc_linearzero = ql.PiecewiseLinearZero(calc_date,rate_helpers,day_count)&#xA;yc_cubiczero = ql.PiecewiseCubicZero(calc_date,rate_helpers,day_count)&#xA;&#xA;max_maturity = 50*12&#xA;&#xA;splz = get_spot_rates(yc_linearzero, day_count, months=max_maturity + 1)&#xA;spcz = get_spot_rates(yc_cubiczero, day_count, months=max_maturity + 1)&#xA;&#xA;max_rate = swap_rates[-1]&#xA;min_rate = min(splz.Curve)&#xA;max_rate = max(splz.Curve)&#xA;&#xA;&quot;&quot;&quot;Plotting&quot;&quot;&quot;&#xA;# plt.plot(splcd[&quot;Maturities&quot;],splcd[&quot;Curve&quot;], '.',label=&quot;LogCubicDiscount&quot;)&#xA;plt.plot(splz[&quot;Maturities&quot;],splz[&quot;Curve&quot;],'--', label=&quot;LinearZero&quot;)&#xA;plt.plot(spcz[&quot;Maturities&quot;],spcz[&quot;Curve&quot;],label=&quot;CubicZero&quot;)&#xA;plt.xlabel(&quot;Years&quot;, size=12)&#xA;plt.ylabel(&quot;Zero Rate&quot;, size=12)&#xA;plt.xlim(0,max_maturity/12.0)&#xA;plt.ylim([min_rate * 0.9,max_rate * 1.1])&#xA;plt.legend()&#xA;&#xA;plt.show()&#xA;&#xA;rows = zip(splz.Maturities,splz.Curve)&#xA;&#xA;with open('LIBORBootstrap.csv','w',newline='') as f:&#xA;    writer = csv.writer(f)&#xA;    for row in rows:&#xA;        writer.writerow(row)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="25245" LastEditorUserId="25245" LastEditDate="2016-11-11T20:22:14.980" LastActivityDate="2016-11-11T22:49:02.823" Title="QL-Python Bootstrapping Yield Curve FuturesRateHelper throwing off results" Tags="&lt;yield-curve&gt;&lt;python&gt;&lt;quantlib&gt;&lt;bootstrapping&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30973" PostTypeId="2" ParentId="30972" CreationDate="2016-11-11T22:49:02.823" Score="3" Body="&lt;p&gt;The FuturesRateHelper class knows that futures are quoted as 100-rate, so there's no need to convert the prices.  You can just create them as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;futures_helpers.append(ql.FuturesRateHelper(&#xA;    ql.QuoteHandle(ql.SimpleQuote(future_rates[i])),&#xA;    imm,ql.Euribor3M(),ql.QuoteHandle(convexity_quote[i])))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I admit that the name of the class can lead one astray by mentioning rates instead of prices.  Also, the other helpers might suggest that the division by 100 is needed, but that is only because the rates are given as, say, 0.43% when they are really 0.0043.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2016-11-11T22:49:02.823" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30974" PostTypeId="2" ParentId="30941" CreationDate="2016-11-12T03:09:35.947" Score="1" Body="&lt;p&gt;These ratings are called sovereign credit ratings. The ratings describe the creditworthiness of a country at the time the rating is published. The rating companies such as Fitch or Standard &amp;amp; Poors calculate and publish the ratings either by request (e.g., from the Chinese government) or autonomously so that they can sell the ratings to their subscribers. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The ratings do not reflect the entire past or the future creditworthiness of countries; instead they reflect their present creditworthiness. For example, in August 2011, Standard &amp;amp; Poors downgraded the US's rating from AAA to AA+, as a result of the congress' approval of raising the US debt ceiling. The AA+ rating reflected the creditworthiness of the US government at that time, not 6 months ago and not 6 months later. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, to answer your question, if from 2008 to 2013 Malaysia had A- as ratings, you may assume that it had the same rating for the whole time but that's just an assumption you can make if you are sure the country has not been rated differently during that time. Even in that case, the fact that the country has not been re-rated during that time period does not mean the country has had the same creditworthiness the whole time. It may be the case that the rating companies did not re-rate it for some reasons. &lt;/p&gt;&#xA;" OwnerUserId="25185" LastActivityDate="2016-11-12T03:09:35.947" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30975" PostTypeId="2" ParentId="30961" CreationDate="2016-11-12T05:12:20.050" Score="2" Body="&lt;p&gt;There is a vast literature on Risk. The books of Arrow, Raiffa, and Borch are a good introduction. See also Bernstein (1996) for compelling argument that the understanding of Risk was one of the key developments of modern civilization. &lt;/p&gt;&#xA;" OwnerUserId="20303" LastActivityDate="2016-11-12T05:12:20.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30976" PostTypeId="2" ParentId="30966" CreationDate="2016-11-12T05:19:51.163" Score="1" Body="&lt;p&gt;I agreed with the usage of PortfolioAnalytics package of R programming, but before that I must say read, read, read and try to understand the concept from book written on Active Equity Portfolio Management by Grinold and Kahn. Combination of both will gives you tremendous results of your objective. All the Best.&lt;/p&gt;&#xA;" OwnerUserId="20303" LastActivityDate="2016-11-12T05:19:51.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30977" PostTypeId="1" AcceptedAnswerId="31191" CreationDate="2016-11-12T15:49:55.477" Score="-2" ViewCount="293" Body="&lt;p&gt;Question says it all, if I exercise an option mid day, is the closing price used to fill the order?  In other words, exercise does not lock the price, correct?&lt;/p&gt;&#xA;" OwnerUserId="25249" LastActivityDate="2016-11-25T12:14:54.843" Title="What price is used when you exercise an option mid-trading-day?" Tags="&lt;options&gt;" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="30978" PostTypeId="1" CreationDate="2016-11-12T17:46:28.847" Score="1" ViewCount="17" Body="&lt;p&gt;I have a dataset of stock returns immediately following rumors of or confirmations of acquisitions. It is clear that either the stock does not react, or the stock experiences a strong positive return in these events. What I'm curious about is what might be some relevant technical/fundamental factors correlated to the degree of responsiveness. For example, the volatility of a stock might be positively correlated (if the stock tends to move a lot already, it'll move a lot on such an event) but I'm not sure what else could be very relevant. &lt;/p&gt;&#xA;" OwnerUserId="1456" LastActivityDate="2016-11-12T17:46:28.847" Title="Factors affecting magnitude of responsiveness to acquisition announcements?" Tags="&lt;news&gt;&lt;abnormal-returns&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30981" PostTypeId="1" CreationDate="2016-11-12T23:59:46.843" Score="0" ViewCount="85" Body="&lt;p&gt;What are some of the common forward vol specifications under HJM framework used in the industry. I guess most common would be 2 and 3 factor models, but any pointers to more details would be very useful. An example would be -  parametric instantaneous forward rate vol as sum of two exponential decaying vols (same as G2++ model).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: could you please also point to any references on the model calibration as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your help!&lt;/p&gt;&#xA;" OwnerUserId="7117" LastEditorUserId="7117" LastEditDate="2016-11-18T20:19:33.210" LastActivityDate="2016-11-18T20:19:33.210" Title="Vol specifications under Heath Jarrow Morton framework" Tags="&lt;interest-rates&gt;&lt;modeling&gt;&lt;heath-jarrow-morton&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30982" PostTypeId="1" CreationDate="2016-11-13T02:57:08.017" Score="8" ViewCount="1527" Body="&lt;p&gt;A sequence of transformations can be used to turn the Black-Scholes PDE into the heat equation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $C(S, t)$ be the price of a vanilla European option at time $t$, maturing at time $T$, where the underlying stock's price is $S$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C(S, t)$ satisfies the Black-Scholes equation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{\partial C}{\partial t}&#xA;+ \frac{1}{2} \sigma^2 S^2 \frac{\partial^2 C}{\partial S^2}&#xA;+ (r-q)S\frac{\partial C}{\partial S} - rC =  0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By introducing new variables $\tau = \frac{\sigma^2}{2}(T-t)$ and $x = \ln(S/K)$ and a suitable choice of constants $\alpha$ and $\beta$ we can ensure that $e^{\alpha x + \beta \tau} C(S, t)$ satisfies the heat equation (in $x$ and $\tau$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As someone who has no intuition about PDEs, this last step is quite confusing for me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The heat equation corresponds to Brownian motion so I was wondering if it's possible to carry out this transformation on the level of stochastic processes and only passing to PDEs once you somehow got Brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Multiplication by such an $e^{\alpha x + \beta \tau}$ is a little reminiscent of the Girsanov transformation. I've played around with it, but not getting anywhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;References: the particular coordinate transformation I give is described in full detail in Wilmott's Mathematics of Financial Derivatives&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another, similar one can be found here &lt;a href=&quot;https://quant.stackexchange.com/a/110/23872&quot;&gt;https://quant.stackexchange.com/a/110/23872&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="23872" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2019-12-19T16:11:12.217" Title="What's the intuition behind the transformation of Black-Scholes into Heat equation?" Tags="&lt;black-scholes&gt;&lt;finance-mathematics&gt;&lt;black-scholes-pde&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30983" PostTypeId="2" ParentId="22364" CreationDate="2016-11-13T08:44:53.557" Score="1" Body="&lt;p&gt;Suppose the data generating process as your have suspected is as follows:&#xA;$$y_t = \gamma t + \epsilon_t$$&#xA;A first difference of the series will be&#xA;$$\Delta y_t = \gamma + \epsilon_t - \epsilon_{t-1}$$&#xA;Now as what you have done in your 2nd stage, regressing $\Delta y_t$ on $y_{t-1}$, what you will have estimated in the 2nd stage is &#xA;$$\Delta y_t = \alpha + \beta y_{t-1} + e_t$$&#xA;Which is equivalent to &#xA;$$\gamma + \epsilon_t - \epsilon_{t-1} = \alpha + \beta y_{t-1} + e_t$$&#xA;re-arranging  gives you the following expression:&#xA;$$\epsilon_t - \epsilon_{t-1} = (\alpha - \gamma) + \beta y_{t-1} + e_t$$&#xA;So your 2nd stage regression should yield $\beta =0$ if you have a deterministic time trend. The reason you have a negative and significant coeffcient in 2nd stage, would suggest that the DGP is wrong. I would highly recommend you to perform a residual check on 1st stage. You can fit a deterministic trend to the original model and plot the acf of the residual, I suspect you will see significant autocorrelation for many lags, indicating that you might consider fitting more complicated models such as ARIMA type models.&lt;/p&gt;&#xA;" OwnerUserId="6804" LastActivityDate="2016-11-13T08:44:53.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30984" PostTypeId="1" AcceptedAnswerId="30985" CreationDate="2016-11-13T09:41:05.183" Score="0" ViewCount="1027" Body="&lt;p&gt;I'm working on a finance class related problem, concerning the &lt;em&gt;Effective Annual Rate&lt;/em&gt; (EAR) of an invoice credit rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The standard formula of the EAR is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ EAR = \big(1 + \frac{APR}{m}\big)^{m}-1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $APR$ is the Annual Percentage Rate and $ m $ is the number of compounding periods.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The cost of delaying payment on the invoice is $ 0.0526\ (5.26\%) $ per 20 days.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I know that the answer is supposed to be:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$ EAR = \big(1 + 0.0526\big)^{\frac{365}{20}}-1 = 1.5487 \approx 155\%$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;As you can see, using the standard formula above, would yield another result:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ EAR = \big(1 + \frac{0.0526}{365/20}\big)^{\frac{365}{20}}-1 = 0.0526 \approx 5.26\%$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question: why is there no $ m $ denominator in the  parenthesis of the suggested solution?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm new to this subject so I'm sure the reason for the divergence between the standard formula and the solution is blatantly obvious – probably having to do with the periodization of the EAR (20 days vs. annual rate)? However, I can't seem to grasp the concept properly.&lt;/p&gt;&#xA;" OwnerUserId="19964" LastEditorUserId="19964" LastEditDate="2016-11-13T13:42:12.760" LastActivityDate="2016-11-13T13:42:12.760" Title="Effective Annual Rate (EAR) calculation from periodic rate of invoice credit" Tags="&lt;interest-rates&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30985" PostTypeId="2" ParentId="30984" CreationDate="2016-11-13T10:03:22.187" Score="2" Body="&lt;p&gt;Since &quot;the cost of delaying payment on the invoice is 0.0526 (5.26%)&#xA;0.0526 (5.26%) per 20 days&quot; there is no need to divide by anything to get the rate for the compounding period because it is given: 0.0526.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The literal APR (as an annual rate) would be a nominal rate of 95.995 % compounded every twenty days.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;m = 365/20 = 18.25&#xA;periodic rate = 0.95995/m = 0.0526&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Nominal annual rates are defined as the periodic rate * number of periods per year.  It is necessary to specify the compounding period when describing a nominal annual rate.  For examples see &lt;a href=&quot;https://en.wikipedia.org/wiki/Effective_interest_rate#Calculation&quot; rel=&quot;nofollow noreferrer&quot;&gt;Wiki Calculation&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7178" LastEditorUserId="7178" LastEditDate="2016-11-13T10:15:59.447" LastActivityDate="2016-11-13T10:15:59.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30986" PostTypeId="1" AcceptedAnswerId="30999" CreationDate="2016-11-13T12:45:04.283" Score="0" ViewCount="34" Body="&lt;p&gt;Hopefully these are acceptable questions in this forum.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume such options are today OTC instruments only with significant corporate risk on the miner. I have a little knowledge of interest rate modelling and derivatives et al. but none of gold or other metals. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For (gold)  miners,  with significant debt,  there are underlying practical risk management questions . References to  simple models including any  related &lt;strong&gt;tradeable&lt;/strong&gt; instruments would be of interest&lt;/p&gt;&#xA;" OwnerUserId="6442" LastEditorUserId="6442" LastEditDate="2016-11-13T12:53:32.273" LastActivityDate="2016-11-14T00:58:49.660" Title="Estimate The Interval For European, Say 6 month, At-the-Money, Gold Price Collars" Tags="&lt;options&gt;&lt;risk-management&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="30987" PostTypeId="1" AcceptedAnswerId="31007" CreationDate="2016-11-13T12:50:34.603" Score="6" ViewCount="7421" Body="&lt;p&gt;I am not a mathematician but want to try and understand the BS model for option pricing. I get the intuitive sense of it but am unable to figure out calculation of volatility (as an input). Some online sources indicate taking a time series of log returns of the underlying asset and calc mean and SD and use that. But if my option has and expiry of $T+1$ and $T+2$ months, I am pretty sure I can't use the same volatility input. So is there a rule of thumb / papers that indicate how many historical data points are needed for options of different maturities (and the same strike price)? kindly let me know. Appreciate it!&lt;/p&gt;&#xA;" OwnerUserId="19398" LastEditorDisplayName="user16651" LastEditDate="2016-11-13T17:18:34.420" LastActivityDate="2016-11-14T17:11:46.367" Title="volatility input for black scholes formula" Tags="&lt;volatility&gt;&lt;black-scholes&gt;&lt;stochastic-volatility&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="30989" PostTypeId="1" CreationDate="2016-11-13T14:40:36.127" Score="0" ViewCount="839" Body="&lt;p&gt;I am trying to implement a max return optimization with a large number of assets. I am not sure why this problem won't work. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;w = cvxpy.Variable(num_asset) #30 assets&#xA;constraints = []&#xA;constraints.append(cvxpy.abs(w) &amp;lt;= 1)&#xA;constraints.append(cvxpy.sum_entries(w) == 1)&#xA;objective = cvxpy.Maximize(combined_return.T * w - 0.5 * alpha * cvxpy.quad_form(w, combined_covariance))&#xA;problem = cvxpy.Problem(objective)&#xA;problem.solve(solver='CVXOPT', verbose=True)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The result have 3 of the weights way greater than 1. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;          Holding&#xA;PCLN     0.024891&#xA;MHK      0.005428&#xA;**AZO    -14.429484**&#xA;SJM      0.006767&#xA;COST     0.027336&#xA;CLX      0.006752&#xA;TSO      0.003282&#xA;VLO      0.008457&#xA;PSX      0.014839&#xA;BLK      0.021508&#xA;ICE      0.011146&#xA;EQR      0.009720&#xA;ISRG     0.009747&#xA;BIIB     0.020765&#xA;GILD     0.043480&#xA;UAL      0.005269&#xA;GWW      0.005330&#xA;LMT      0.028927&#xA;**GOOGL   14.624353**&#xA;GOOG     0.182734&#xA;**IBM    121.617234**&#xA;SHW      0.010577&#xA;LYB      0.012353&#xA;EMN      0.003821&#xA;LVLT     0.007118&#xA;VZ       0.085949&#xA;T        0.098943&#xA;NEE      0.022617&#xA;SRE      0.010750&#xA;AEP      0.013104&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Could someone help me understand why that constraint cvxpy.abs(w)&amp;lt;=1 doesn't do the job? Many thanks&lt;/p&gt;&#xA;" OwnerUserId="25207" LastActivityDate="2017-03-13T21:02:13.917" Title="CVXPY 's constrains doesn't work" Tags="&lt;portfolio-optimization&gt;&lt;mean-variance&gt;&lt;black-litterman&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30991" PostTypeId="2" ParentId="30977" CreationDate="2016-11-13T15:20:02.660" Score="2" Body="&lt;p&gt;Your question is about a situation that never occurs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the USA, individual stock options are American and exercised via delivery of the stock (with no consideration of its price at some time t). When you exercise an American call you pay the amount K and you receive the stock. That's it, that's all there is to Exercising. If you wish you can (simultaneously or later, or never, it is up to you) sell the stock and receive $S_t$ where t is the time you decide to sell, say 10:45am on the 12th of December. Then you will have made $S_t-K$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cash settled options are a different kettle of fish. CBOE index options are exercised via cash settlement (no delivery) with reference to the official exchange closing index price BUT THESE OPTIONS ARE EUROPEAN EXERCISE, the exercise takes place at the moment of expiration, according to the formula $(S_t-K)^+$ using the same official settlement price $S_t$ for everyone.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In summary then, it is a design issue. If the exchange wants to create an American option they must provide some tradeable instrument (stock, future) which will be physically delivered. If they wish to create a European option they can have physical delivery or cash settlement with respect to an officially determined closing (or sometimes opening) price. There are no other ways to do things AFAIK.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-11-13T15:25:26.673" LastActivityDate="2016-11-13T15:25:26.673" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30992" PostTypeId="2" ParentId="30989" CreationDate="2016-11-13T16:21:36.157" Score="1" Body="&lt;p&gt;You forgot to include &lt;code&gt;constraints&lt;/code&gt; as a parameter to the call to &lt;code&gt;Problem&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2016-11-13T16:21:36.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30993" PostTypeId="2" ParentId="30982" CreationDate="2016-11-13T18:40:16.190" Score="2" Body="&lt;p&gt;First we should consider the Cauchy-Euler type of ordinary differential equation:&#xA;$$t^2\frac{d^2 y}{dt^2}+at\frac{dy}{dt}+by=0\tag 1$$&#xA;Indeed we should set $\color{red}{t=e^x}$.Please note&#xA;$$\frac{dy}{dx}=\frac{dt}{dx}\frac{dy}{dt}=e^x\frac{dy}{dt}=t\frac{dy}{dt}\tag 2$$&#xA;$$\frac{d^2y}{dx^2}=\frac{dt}{dx}\frac{dy}{dt}+t\frac{dt}{dx}\frac{d^2y}{dt^2}=t\frac{dy}{dt}+t^2\frac{d^2y}{dt^2}=\frac{dy}{dx}+t^2\frac{d^2y}{dt^2}$$&#xA; In other words&#xA;$$\frac{d^2y}{dx^2}-\frac{dy}{dx}=t^2\frac{d^2y}{dt^2}\tag 3$$&#xA;Insert $(2)$ and $(3)$ in $(1)$&#xA;$$\color{red}{\frac{d^2 y}{dx^2}+(a-1)\frac{dy}{dx}+by=0}\tag 4$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Second Indeed, the Black-scholes equation looks a little like the heat equation on the infinite interval in that it has a first derivative of the unknown with respect to time and the second derivative of the unknown with respect to the other (space) variable.On the other hand, notice:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Each time the unknown is differentiated with respect to $S$, it also multiplied by the independent variable $S$, so the equation is not a constant&#xA;coefficient equation.&lt;/li&gt;&#xA;&lt;li&gt;There is a first derivative of $C$ with respect to $S$ in the equation.&lt;/li&gt;&#xA;&lt;li&gt;The sign on the second derivative is the opposite of the heat equation form, so the equation is of backward parabolic form.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;We eliminate each objection with a suitable change of variables. The plan&#xA;is to change variables to reduce the Black-Scholes terminal value problem to&#xA;the heat equation, then to use the known solution of the heat equation to&#xA;represent the solution, and finally change variables back.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Also we know&#xA;$$\color{red}{S_t=S_0e^{(r-\frac12 \sigma^2)t+\sigma B_t}}$$&#xA;On the other hand, set $$P(y,t,x,s)=P(B(t)\le y\,|\,B(s)=x)=\frac{1}{\sqrt{2\pi(t-s)}}\int_{-\infty}^{y}e^{-\frac{(u-x)^2}{2(t-s)}}dy$$&#xA; define&#xA;$$V(t,x,y)=:\frac{d}{dy}P(y,t,x,0)=\frac{1}{\sqrt{2\pi t}}e^{-\frac{(y-x)^2}{2t}}$$&#xA;we have&#xA;$$\frac{\partial V}{\partial t}=-\frac{1}{2t\sqrt{2\pi t}}e^{-\frac{(y-x)^2}{2t}}+\frac{(y-x)^2}{2t^2\sqrt{2\pi t}}e^{-\frac{(y-x)^2}{2t}}\tag 5$$&#xA;and&#xA;$$\frac{\partial V}{\partial x}=\frac{y-x}{t\sqrt{2\pi t}}e^{-\frac{(y-x)^2}{2t}}$$&#xA;and&#xA;$$\frac{\partial^2 V}{\partial x^2}=-\frac{1}{t\sqrt{2\pi t}}e^{-\frac{(y-x)^2}{2t}}+\frac{(y-x)^2}{t^2\sqrt{2\pi t}}e^{-\frac{(y-x)^2}{2t}}\tag 6$$&#xA;Combine $(5)$ and $(6)$&#xA;$$\color{red}{\frac{\partial V}{\partial t}=\frac 12\frac{\partial^2 V}{\partial x^2}}\tag 7$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-11-13T19:38:28.417" LastActivityDate="2016-11-13T19:38:28.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="30995" PostTypeId="1" CreationDate="2016-11-13T20:16:44.420" Score="4" ViewCount="833" Body="&lt;p&gt;In Ho Lee model, assuming risk neutral probability is not exactly 0.5, would a change in the volatility of short-term rate affect the price of an interest rate swap?&#xA;My intuition tells me no as interest rate swap price should only depend on prices of zero at t=0 but my model is throwing a different answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would you it be possible to have some help on both mathematical and intuitive explanations, please?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks.&lt;/p&gt;&#xA;" OwnerUserId="25264" LastEditorUserId="20795" LastEditDate="2019-09-08T10:10:57.410" LastActivityDate="2019-09-08T10:10:57.410" Title="Pricing interest rate swap in Ho Lee model" Tags="&lt;pricing&gt;&lt;interest-rate-swap&gt;&lt;irs&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30996" PostTypeId="1" CreationDate="2016-11-13T21:11:55.277" Score="3" ViewCount="430" Body="&lt;p&gt;There are lot of works about pattern discovery in financial time series - but all of them (known to me) are connected with technical analysis and that is field (as said by many) that is not rigorous science. So - &lt;strong&gt;are there pattern discovery approaches that goes beyond technical analysis and that can be called science&lt;/strong&gt; - e.g. ones that try to discover parameters of hidden markov model or that otherwise try to model the different financial regimes as responses to the macroeconomic events (e.g. country's position in the economic cycle) or as responses to the other events, e.g. by changing tax legislation, by monetary policy changes (interest rate etc.), by governments' stimulus efforts, etc.?&lt;/p&gt;&#xA;" OwnerUserId="22249" LastActivityDate="2017-01-13T08:53:22.627" Title="Data mining of financial time series and pattern discovery - beyond technical analysis?" Tags="&lt;technical-analysis&gt;&lt;data-mining&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="30997" PostTypeId="2" ParentId="30995" CreationDate="2016-11-13T21:40:45.950" Score="1" Body="&lt;p&gt;Under the Ho-lee model,&#xA;\begin{align*}&#xA;dr_t = \theta_t dt + \sigma dW_t.&#xA;\end{align*}&#xA;Then, the price at time $t$ of a zero-coupon bond with maturity $T$ and unit notional is given by&#xA;\begin{align*}&#xA;P(t, T) = E\left(e^{-\int_t^T r_s ds} \mid \mathcal{F}_t \right),&#xA;\end{align*}&#xA;where $\mathcal{F}_t$ is the information set at time $t$. Note that, for any $s\ge t \ge 0$,&#xA;\begin{align*}&#xA;r_s = r_t + \int_t^s \theta_u du + \sigma\int_t^s dW_u.&#xA;\end{align*}&#xA;Therfore,&#xA;\begin{align*}&#xA;\int_t^T r_s ds &amp;amp;=r_t(T-t) + \int_t^T\left(\int_t^s \theta_u du \right)ds+ \sigma \int_t^T\left(\int_t^s dW_u\right)ds\\&#xA;&amp;amp;=r_t(T-t) + \int_t^T\left(\int_u^T \theta_u ds \right)du+ \sigma \int_t^T\left(\int_u^T ds\right) dW_u\\&#xA;&amp;amp;=r_t(T-t) + \int_t^T (T-u)\theta_u du + \sigma \int_t^T (T-u) dW_u.&#xA;\end{align*}&#xA;Note that $\int_t^T (T-u) dW_u$ is independent of $\mathcal{F}_t$ and normal with zero mean and variance&#xA;\begin{align*}&#xA;\int_t^T (T-u)^2 du &amp;amp;= \frac{1}{3}(T-t)^3.&#xA;\end{align*}&#xA;Consequently,&#xA;\begin{align*}&#xA;P(t, T) &amp;amp;= E\left(e^{-\int_t^T r_s ds} \mid \mathcal{F}_t \right)\\&#xA;&amp;amp;=e^{-r_t(T-t) -\int_t^T (T-u)\theta_u du + \frac{\sigma^2}{6}(T-t)^3}.&#xA;\end{align*}&#xA;For $t=0$, then&#xA;\begin{align*}&#xA;P(0, T)=e^{-r_0 T -\int_0^T (T-u)\theta_u du + \frac{\sigma^2}{6}T^3}.\tag{1}&#xA;\end{align*}&#xA;From $(1)$, we see clearly that the bond price depends on the volatility $\sigma$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-11-13T21:40:45.950" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="30999" PostTypeId="2" ParentId="30986" CreationDate="2016-11-14T00:58:49.660" Score="0" Body="&lt;p&gt;There is an infinite set of pairs of strikes that form a costless collar, since for each (positive) put strike there is a call strike that makes the put price equal the call price.  Within each pair, the put strike is less than the forward price and the call strike is greater than the forward price.  The forward price of gold can be observed from otc forward markets or futures markets, and it can be calculated from spot price, interest rates and gold storage costs.  Given a put strike and a forward, the call strike for a costless collar depends on the skew for out of the money puts versus out of the money calls.  For example, if the out of the money calls on gold are at a much higher implied volatility than out of the money puts, then the call strike will be further from the forward than the put strike.  Skew in the gold market (like other otc markets) can move significantly depending on market conditions at any given time.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-11-14T00:58:49.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31001" PostTypeId="1" CreationDate="2016-11-14T03:05:40.917" Score="3" ViewCount="146" Body="&lt;p&gt;Hi Quantitative Fiance Stack Exchange,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's my first go at GARCH models so please give me a chance with my phrasing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that GARCH models are used to forecast volatility. The GARCH(1,1) takes the form:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma^2_t=\alpha+\beta_1\epsilon_{t-1}+\beta_2\sigma^2_{t-1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand the lagged term $\sigma^2_{t-1}$ makes up the AR part of GARCH. However, I also understand the error term $\epsilon_{t-1}$ is dependent on the forecasting model. Consider, forecasting returns using one of the two models:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\hat{y_t}=\gamma\cdot y_{t-1}+\epsilon_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\hat{y_t}=\theta\cdot x_{t-1}+\epsilon_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each model gives a different error term, which I believe is calculated as $\epsilon_t=y_t-\hat{y_t}$. So for the above models, error terms are $\epsilon_t=y_t-\gamma\cdot y_{t-1}$ and $\epsilon_t=y_t-\theta\cdot x_{t-1}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, is my understanding correct that calculating $\beta_1$ and $\beta_2$ of the GARCH(1,1) model depends on which forecasting model we're using?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for the help,&#xA;Donny&lt;/p&gt;&#xA;" OwnerUserId="22689" LastActivityDate="2016-11-15T08:24:26.680" Title="Are GARCH models dependent on the returns forecasting model?" Tags="&lt;garch&gt;&lt;forecasting&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31003" PostTypeId="1" CreationDate="2016-11-14T05:46:46.150" Score="4" ViewCount="335" Body="&lt;p&gt;Hi Quantitative Finance Stack Exchange,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's my first go at GARCH models so give me a chance with my phrasing. I'm looking for an answer to a general question. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, I understand that you can have a forecasting model to forecast returns and a GARCH model to forecast volatility. Let's proceed with the simplest example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Forecasting returns:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\hat{y_t}=\alpha\cdot y_{t-1} + \epsilon_t$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;GARCH(1,1):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\hat{\sigma^2_t}=\beta_1\epsilon_{t-1}+\beta_2\sigma^2_{t-1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I've developed my trading strategy and let's say I found that it works, namely buy when $\hat{y_t} &amp;gt; 0.0020\%$. My question is this. What is the standard way of looking at how GARCH compliments my strategy, if at all?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way I see it is that both predicts different things. One predicts $\hat{y_t}$ and another predicts $\hat{\sigma^2_{t}}$. Therefore, GARCH is only readily implementable if you somehow found a way to incorporate volatility in your strategy. If my existing strategy $\hat{y_t} &amp;gt; 0.0020\%$ works fine, there isn't a need for GARCH correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for your help,&#xA;Donny&lt;/p&gt;&#xA;" OwnerUserId="22689" LastEditorUserId="16148" LastEditDate="2016-11-14T21:46:18.440" LastActivityDate="2016-11-15T04:22:57.047" Title="How is a GARCH model readily complementary to a forecasting model?" Tags="&lt;garch&gt;&lt;forecasting&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31004" PostTypeId="2" ParentId="30996" CreationDate="2016-11-14T06:03:08.817" Score="2" Body="&lt;p&gt;Here is my understanding of when technical analysis and mathematical techniques differ.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Technical analysis predominantly utilizes three things:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Price levels&lt;/li&gt;&#xA;&lt;li&gt;Indicators on price levels&lt;/li&gt;&#xA;&lt;li&gt;Trading using rules based on 1 and 2.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Anything outside of 1, 2 and 3 is beyond technical analysis. Naturally, your analysis can involved all 3, but once you use a technique outside those three, you are slowly inching towards statistical and mathematical techniques. Examples follow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The typical technical analysis backtester is, pick an asset, pick an interval, define an indicator on OHLC bars in that interval and then buy when indicator &gt; value and sell when indicator &amp;lt; value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose, now you have a trading systems defined by parameter set. And you perform cross validation to test its predictive power. While you have used technical analysis to devise the trading rules, cross validation is a statistical technique.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose now that you've decided to perform you analysis. But instead of looking at price levels, you look at the returns of an asset instead of price levels. To me, using returns of an asset is more in the domain of mathematical analysis than technical analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, there is a host of other trading strategies that originates from the return series. I can convincingly say that these are NOT technical analysis.&lt;/p&gt;&#xA;" OwnerUserId="22689" LastActivityDate="2016-11-14T06:03:08.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31005" PostTypeId="2" ParentId="31003" CreationDate="2016-11-14T09:47:58.960" Score="1" Body="&lt;p&gt;Your random innovations in the returns model depend on the volatility model. In this setting, we have $\epsilon_t ~ N(0,\hat{\sigma_t}^2)$.&#xA;The effect of this at a very layman level is that when the volatility is higher, the random innovations are more likely to take larger values, which increases the probability of the returns taking larger values. This is exactly what we wants, as it should increase the jumps between consecutive returns, hence making the volatility of the predicted returns series higher. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think you’re forgetting that there is a dependence on $\sigma_t$ hidden inside the random innovation $\epsilon_t$.  &lt;/p&gt;&#xA;" OwnerUserId="24040" LastActivityDate="2016-11-14T09:47:58.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31007" PostTypeId="2" ParentId="30987" CreationDate="2016-11-14T13:25:36.340" Score="5" Body="&lt;p&gt;The best authority I have seen on this stuff is Natenberg: Option Volatility and Pricing. I can't do much better than check my copy. He says: &lt;em&gt;&quot;Note that there are a variety of ways to calculate historical volatility, but most methods depend on choosing two parameters, the historical period over which volatility is to be calculated, and the time interval between successive price changes.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;The historical period may be ten days, six months, five years, or any period the trader chooses. Longer periods tend to yield an average or characteristic volatility, while shorter periods may reveal unusual extremes in volatility. To become fully familiar with the volatility characteristics of a contract, a trader may have to examine a wide variety of historical time periods.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Next, the trader must decide what intervals to use between price changes. Should he use daily price changes? weekly changes? monthly changes? Or perhaps he ought to consider some unusual interval, perhaps every other day, or every week and a half. Surprisingly, the interval which is chosen does not seem to greatly affect the result. Although a contract may make large daily moves, yet finish a week unchanged, this is by far the exception. A contract which is volatile from day to day is likely to be volatile from week to week, or month to month.&quot;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what happens in practise is weighting a series of volatilities over different time periods, as volatility exhibits &lt;em&gt;serial correlation&lt;/em&gt;. To paraphrase the book:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;For example, suppose we have the following historical volatility data on a certain underlying instrument:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;last 30 days: 24%&lt;/li&gt;&#xA;&lt;li&gt;last 60 days: 20%&lt;/li&gt;&#xA;&lt;li&gt;last 120 days: 18%&lt;/li&gt;&#xA;&lt;li&gt;last 250 days: 18%&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Certainly we would like as much volatility data as possible. But if this is the only data available how might we use it to make a forecast? One method might be to take the average volatility over the periods which we have:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;(24% + 20% + 18% + 18%) / 4 = 20.0%&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;However, since the 24% over the past 30 days is more current than the other data, perhaps it should play a greater role in a forecast&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;(40% * 24%) + (20% * 20%) + (20% * 18%) + (20% * 18%) = 20.8%&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Further, the volatility over the past 60 days ought to be more important than that of the last 120 days, and the last 120 more important than the last 250 and so on. So we can factor that in using a regressive weighting. For example&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;(40% * 24%) + (30% * 20%) + (20% * 18%) + (10% * 18%) = 21.0%&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The &lt;em&gt;serial correlation&lt;/em&gt; is used such that if the volatility on a contract over the last four weeks was 15% then the volatility over the next four weeks is more likely to be close to 15% rather than far away. Once we realise this we give different weights to different past volatility time periods. This has led theoreticians into the ARCH and GARCH models. The book goes on:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Once we have historical volatility then you take another measure for the implied volatility already priced into the market. You might weight implied volatility anywhere between 25% to 75%. For example, suppose a trader has made a current volatility forecast of 20% based on historical data and the implied volatility is currently 24%. If the trader decides to give the implied volatility 75% of the weight, his final forecast will be:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;(75% * 24%) + (25% * 20%) = 23%&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;A PRACTICAL APPROACH&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;No matter how painstaking a trader's method he is likely to find that his volatility forecasts are often incorrect, and sometimes to a large degree. Given this difficulty, many traders find it easier to take a more general approach. Rather than asking what the correct volatility is, a trader might instead ask, given the current volatility climate, what's the right strategy? Rather than trying to forecast an exact volatility, a trader will try to pick a strategy that best fits the volatility conditions in the marketplace. To do this a trader will want to consider several factors:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What is the long term mean volatility of the underlying contract?&lt;/li&gt;&#xA;&lt;li&gt;What has been the recent historical volatility in relation to the mean volatility?&lt;/li&gt;&#xA;&lt;li&gt;What is the trend in recent historical volatility?&lt;/li&gt;&#xA;&lt;li&gt;Where is implied volatility and what is its trend?&lt;/li&gt;&#xA;&lt;li&gt;Are we dealing with options of longer or shorter duration?&lt;/li&gt;&#xA;&lt;li&gt;How stable does the volatility tend to be?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="7369" LastEditorUserId="7369" LastEditDate="2016-11-14T17:11:46.367" LastActivityDate="2016-11-14T17:11:46.367" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31009" PostTypeId="5" CreationDate="2016-11-14T18:49:30.210" Score="0" Body="&lt;p&gt;Stochastic calculus allows a consistent theory of integration to be defined for integrals of stochastic processes with respect to stochastic processes. It is used to model systems that behave randomly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main flavours of stochastic calculus in Quantitative Finance are the Itô calculus and its variational relative the Malliavin calculus.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;a href=&quot;https://en.wikipedia.org/wiki/Stochastic_calculus&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Stochastic_calculus&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2016-11-14T18:49:30.210" LastActivityDate="2016-11-14T18:49:30.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31010" PostTypeId="4" CreationDate="2016-11-14T18:49:30.210" Score="0" Body="A branch of mathematics that operates on stochastic processes." OwnerUserId="12" LastEditorUserId="12" LastEditDate="2016-11-14T18:49:30.210" LastActivityDate="2016-11-14T18:49:30.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31012" PostTypeId="2" ParentId="31001" CreationDate="2016-11-14T20:00:50.060" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I also understand the error term $\varepsilon_{t-1}$ is dependent on the forecasting model.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes, it is. The error term $\varepsilon_t$ in the GARCH model is coming from the full distributional model of $y_t$. The full model is&#xA;$$&#xA;\begin{aligned}&#xA;y_t &amp;amp;= \mu_t + \varepsilon_t, \\&#xA;\varepsilon_t &amp;amp;= \sigma_t \xi_t, \\&#xA;\sigma_t^2 &amp;amp;= \omega + \alpha_1 \varepsilon_{t-1}^2 + \beta_1 \sigma_{t-1}^2, \\&#xA;\xi_t &amp;amp;\sim i.i.d(0,1),&#xA;\end{aligned}&#xA;$$&#xA;where $\mu_t$ is the conditional mean of $y_t$, $\sigma_t^2$ is the conditional variance of $y_t$ and $d$ is some probability distribution with zero mean and unit variance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are not sure which conditional mean model is best for $y_t$, you may end up with a few alternative models characterized by the conditional means $\mu_{1,t}, \mu_{2,t}, \dots$. The the corresponding error terms will differ across the models and will be $\varepsilon_{1,t} = y_t-\mu_{1,t}, \varepsilon_{2,t} = y_t-\mu_{2,t}, \dots$. This will affect the parameter estimates of the conditional variance model, just as you said.&lt;/p&gt;&#xA;" OwnerUserId="19645" LastEditorUserId="19645" LastEditDate="2016-11-15T08:24:26.680" LastActivityDate="2016-11-15T08:24:26.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31013" PostTypeId="2" ParentId="31003" CreationDate="2016-11-14T20:11:17.743" Score="1" Body="&lt;p&gt;One aspect of modelling that has been overlooked in the comments and answers so far is that including a time-varying conditional variance in your model will not only (1) give you time-varying conditional variances but also (2) affect the estimates of the conditional model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, &lt;strong&gt;if&lt;/strong&gt; a certain ARMA-GARCH model approximates the data better than a pure ARMA model with constant conditional variance, &lt;strong&gt;then&lt;/strong&gt; it makes sense to model the data as ARMA-GARCH not only (1) to have better forecasts of volatility but also (2) because neglecting the GARCH part will negatively affect the estimates of the ARMA parameters, making them inefficient and likely even inconsistent.&lt;/p&gt;&#xA;" OwnerUserId="19645" LastActivityDate="2016-11-14T20:11:17.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31015" PostTypeId="2" ParentId="31003" CreationDate="2016-11-14T22:15:05.503" Score="0" Body="&lt;p&gt;Your mean forecast ($y$) already incorporates the GARCH component, (ie $\sigma$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, by being focus on the mean you loose some informations because a forecast mean of 0.02% with a volatility of 0.004% is not similar, in term of risk,  of the same forecast mean (0.02%) with a lower volatility forecast (ex :0.002%) - I assume Gaussian errors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The central tendency (the mean forecast) &lt;strong&gt;does not&lt;/strong&gt; appropriately summarizes your forecast, you should also consider the density forecast. As an example, you can use an interval of confidence (ex:  $y&amp;gt; \mu + 1.96 \sigma$) instead of a fix threshold (ex: $y&amp;gt; \mu$) to better capture your risk.  $\mu$ is your mean threshold level (0.002% in your example) and $\sigma$ the forecasted volatility. 1.96 is a parameter that depend of your risk aversion and of the error term distribution. &lt;/p&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2016-11-14T22:15:05.503" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31018" PostTypeId="2" ParentId="18003" CreationDate="2016-11-15T09:51:29.777" Score="1" Body="&lt;p&gt;this is a very old post and I hope by now you have mastered BLAN. However, Bloomberg's DLIB suite in general is a very comprehensive toolkit which enables you to price and calibrate derivative structures. A number of templates are available for exotic structures. Should this is not enough, you can go to BLAN whereby you can create from scratch any bespoke deal you would ever wish for and also play with different models. Obviously it has quite a bit of a learning curve. Bloomberg people can also code in pricing functions for you.&lt;/p&gt;&#xA;" OwnerUserId="13462" LastActivityDate="2016-11-15T09:51:29.777" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31019" PostTypeId="2" ParentId="30123" CreationDate="2016-11-15T09:57:33.720" Score="0" Body="&lt;p&gt;You would find volume information on T-bills and some TRACE reported bonds. However for any other bond is not possible to get Volume information. You cannot witness the market activity&lt;/p&gt;&#xA;" OwnerUserId="13462" LastActivityDate="2016-11-15T09:57:33.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31020" PostTypeId="2" ParentId="30900" CreationDate="2016-11-15T11:49:19.070" Score="2" Body="&lt;p&gt;Besides what you already did, you also have to add the statement&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;QL_TRACE_ENABLE;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to your method before starting to emit tracing messages; see the documentation at &lt;a href=&quot;http://quantlib.org/reference/group__debug_macros.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://quantlib.org/reference/group__debug_macros.html&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, note that your statement&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;QL_TRACE(var1, var2, var3, ....);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is not going to work as is, since it will be expanded to something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;out &amp;lt;&amp;lt; var1, var2, var3 &amp;lt;&amp;lt; endl;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is unlikely to compile (and even if it does, it won't do what you mean).  If you want to trace multiple variables in a single statement, you can use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;QL_TRACE(var1 &amp;lt;&amp;lt; &quot;, &quot; &amp;lt;&amp;lt; var2 &amp;lt;&amp;lt; &quot;, &quot; &amp;lt;&amp;lt; var3);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;instead.  The alternative is to use multiple statements, in which case you're even better off writing&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;QL_TRACE_VARIABLE(var1);&#xA;QL_TRACE_VARIABLE(var2);&#xA;QL_TRACE_VARIABLE(var3);&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;that will also output the name of the variable besides its value.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2016-11-15T11:49:19.070" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31021" PostTypeId="1" AcceptedAnswerId="31028" CreationDate="2016-11-15T14:36:21.830" Score="3" ViewCount="109" Body="&lt;p&gt;Is there any established &quot;industry standard&quot; to obtain an approximation for the expected principal repayment schedule for a given loan amount, term in months and APR with monthly payments ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I realise the principal repayment will grow non-linearly, but since I'm dealing with terms less than 36 months and since I only need a rough approximation I'm hoping there is an accepted way to obtain a &quot;growth factor&quot; for a linear approximation.&lt;/p&gt;&#xA;" OwnerUserId="25284" LastActivityDate="2016-11-16T09:05:32.873" Title="APR and Term to Principal Repayment Schedule Approximation" Tags="&lt;interest-rates&gt;&lt;fixed-income&gt;&lt;finance&gt;&lt;reference-request&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31022" PostTypeId="1" CreationDate="2016-11-15T15:00:42.213" Score="2" ViewCount="443" Body="&lt;p&gt;I am self-studying models for financial economics and encountered the following problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/zJSxV.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/zJSxV.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't see how the author can conclude that $\gamma = -0.62$. Let's rearrange the second to last equation: $$\gamma - r = -4(0.19 - r)$$ as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r = \frac{\gamma + 0.76}{5}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $\gamma = 0.62$, then $r = 0.276.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $\gamma = -0.62$, then $r = 0.028$, as the author states.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I don't see how the author can conclude $\gamma = -0.62$ when letting $\gamma = 0.62$ does not contradict that $r \geq 0$.&lt;/p&gt;&#xA;" OwnerUserId="5641" LastEditorUserId="5641" LastEditDate="2016-11-16T14:19:51.750" LastActivityDate="2016-11-21T15:41:55.653" Title="How do we know that the instaneous rate of return on this option, $\gamma$ is negative?" Tags="&lt;self-study&gt;&lt;lognormal&gt;&lt;elasticity&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31023" PostTypeId="1" CreationDate="2016-11-15T18:20:03.670" Score="-2" ViewCount="917" Body="&lt;p&gt;I know it has to be done through martingales, but I am not fully sure how to do this BSM pricing.&lt;/p&gt;&#xA;" OwnerUserId="25289" LastActivityDate="2016-11-15T23:11:52.350" Title="How would you price an option with payout ln(St) where St is the stock price at time t" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31024" PostTypeId="1" CreationDate="2016-11-15T18:30:46.963" Score="2" ViewCount="322" Body="&lt;p&gt;I am trying to find the closed- solution of convertible bond $V(s,r,t)$ under Vasicek model of two factor model of PDE shown in below link &#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/30956/ito-lemma-of-convertible-bond-under-two-factor-model-interest-rate?noredirect=1&amp;amp;lq=1&quot;&gt;Ito lemma of Convertible Bond under Two-factor Model Interest Rate&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ V(s,r,t) = \text{conversion option} + \text{straight bond} + \text{premium} $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this right?&lt;/p&gt;&#xA;" OwnerUserId="25228" LastEditorUserId="20454" LastEditDate="2017-07-14T13:09:15.370" LastActivityDate="2018-01-10T14:57:28.710" Title="Closed- solution for Convertible bond price two factor model" Tags="&lt;option-pricing&gt;&lt;interest-rates&gt;&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31025" PostTypeId="2" ParentId="30932" CreationDate="2016-11-15T18:33:29.743" Score="4" Body="&lt;p&gt;Just wanted to point out a few small issues in your statement and maybe help with the conceptual model of these formulas.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;implied volatility is defined as the value of the parameter &lt;strong&gt;σ&lt;/strong&gt; we need&#xA;  to input into the Black-Scholes formula in order to get the price&#xA;  observed in the market.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That is actually backward. Implied Volatility is actually better thought of as the primary output and we later reverse the formula for modeling purposes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The price is a fundamental fact. &lt;em&gt;The price is what it is and a formula doesn't change that.&lt;/em&gt; It is better to rephrase your statement above to something like this;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Given a vanilla option with a fixed maturity &lt;strong&gt;T&lt;/strong&gt; and strike &lt;strong&gt;K&lt;/strong&gt;, implied volatility is derived from the option price as the risk-neutral probability distribution described by the parameter &lt;strong&gt;σ&lt;/strong&gt; using the Black-Scholes formula (or other). Repeating this for different strikes, we obtain the implied volatility of each strike based on its own pricing which leads to the formation of the volatility &lt;strong&gt;Smile&lt;/strong&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We do often use the IV as the input, but that is purely for the purpose of modeling what &lt;em&gt;might&lt;/em&gt; happen to option prices as factors change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are numerous reasons for Smile effects. The primary reason would be that each options pricing model that is capable of describing Implied Volatility relies on some form of implicit or explicit probability distribution as a reference to determine the volatility &lt;em&gt;Implied&lt;/em&gt; by the specific options price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Smile effects happen when the market pricing does not agree with the fundamental assumption of the probability distribution. If market participants feel that tail risks are higher than the model implies and price that into the options then your calculation of IV will give you excess IV in the options further from ATM. This will give you a smile effect. If the risk is priced in as lower in the outer strikes it will appear as a frown. Skew effects can form in the same way.&lt;/p&gt;&#xA;" OwnerUserId="19959" LastActivityDate="2016-11-15T18:33:29.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31026" PostTypeId="2" ParentId="31023" CreationDate="2016-11-15T18:58:36.763" Score="6" Body="&lt;p&gt;We assume that, under the risk-neutral measure, the stock price process $\{S_t, \, t\ge 0\}$ satisfies an SDE of the form&#xA;\begin{align*}&#xA;dS_t = S_t(rdt + \sigma dW_t),&#xA;\end{align*}&#xA;where $r$ is the constant interest rate, $\sigma$ is the constant volatility, and $\{W_t, \, t \ge 0\}$ is a standard Brownian motion. Then&#xA;\begin{align*}&#xA;S_T = S_0 e^{(r-\frac{1}{2}\sigma^2) T + \sigma W_T}.&#xA;\end{align*}&#xA;Moreover, the option payoff  $\ln S_T$ has a value given by&#xA;\begin{align*}&#xA;e^{-rT} E\big(\ln S_T\big) &amp;amp;= e^{-rT} E\Big(\ln S_0+\Big(r-\frac{1}{2}\sigma^2\Big) T + \sigma W_T \Big)\\&#xA;&amp;amp;=e^{-rT} \Big [\ln S_0+\Big(r-\frac{1}{2}\sigma^2\Big) T\Big].&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-11-15T23:11:52.350" LastActivityDate="2016-11-15T23:11:52.350" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31028" PostTypeId="2" ParentId="31021" CreationDate="2016-11-15T23:22:31.537" Score="1" Body="&lt;p&gt;This seems to require a similar answer to &lt;a href=&quot;https://quant.stackexchange.com/a/30960/7178&quot;&gt;an earlier post&lt;/a&gt; of mine, so notwithstanding my use of the same hammer for another nail, here goes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;In short, the following just proves that the growth rate of the principal repayment is equal to the periodic interest rate.  With that the principal repayment schedule can be calculated quite simply.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The balance of a loan follows this recurrence equation.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;p[n + 1] = p[n] (1 + r) - d&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;p[n] is the balance of the loan in month n&#xA;r is the monthly interest rate&#xA;d is the regular monthly payment&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This can be solved like so (using &lt;em&gt;Mathematica&lt;/em&gt; in this instance).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;RSolve[{p[n + 1] == p[n] (1 + r) - d, p[0] == s}, p[n], n]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;s is the initial loan principal&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;yielding &lt;code&gt;p[n_] := (d - d (1 + r)^n + r (1 + r)^n s)/r&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This notation expresses a formula for the balance in month n, which can be used in a function for the principal repayment &lt;code&gt;pr&lt;/code&gt;, (that is, the regular repayment less the payment of interest on the previous month's balance).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pr[n_] := d - (p[n - 1] r)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Combining these expressions it follows that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\text{pr}(n)=d (r+1)^{n-1}-r s (r+1)^{n-1}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for example, taking a £1000 loan over 3 years with 10% interest per month (rather high, but it's just an example), the monthly repayment &lt;code&gt;d&lt;/code&gt; by standard formula is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;s = 1000&#xA;r = 0.1&#xA;n = 36&#xA;&#xA;d = (r (1+r)^n s)/(-1+(1+r)^n) = 103.34306381837332&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using these figures in a calculation of the principal repayment schedule:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;s = 1000&#xA;r = 0.1&#xA;n = 36&#xA;d = 103.34306381837332&#xA;&#xA;pr[1]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;3.3430638183733237&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pr[36]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;93.94823983488523&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ListPlot[Array[pr, 36]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/UjjaJ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/UjjaJ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This plots the schedule of principal repayment over the 3 year term.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the growth factors for two sample periods, from month 4 to 5 and from 35 to 36.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pr[5]/pr[4] - 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;0.1&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pr[36]/pr[35] - 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;0.1&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is simply the monthly interest rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put algebraically:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{\text{pr}(n+1)}{\text{pr}(n)}-1=\frac{d (r+1)^n-r s (r+1)^n}{d (r+1)^{n-1}-r s (r+1)^{n-1}}-1=r$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The growth rate of the principal repayment is equal to the periodic interest rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the principal repayment schedule starts at &lt;code&gt;d - s r&lt;/code&gt; and ends at &lt;code&gt;(d - s r)(1 + r)^(n - 1)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;d - s r&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;3.3430638183733237&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;n = 36&#xA;&#xA;(d - s r)(1 + r)^(n - 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;93.94823983488523&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;as calculated earlier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And of course the expression for the principal repayment simplifies as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\text{pr}(n)=d (r+1)^{n-1}-r s (r+1)^{n-1}=(d-r s) (r+1)^{n-1}$&lt;/p&gt;&#xA;" OwnerUserId="7178" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-11-16T09:05:32.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31029" PostTypeId="1" AcceptedAnswerId="31039" CreationDate="2016-11-16T02:03:00.030" Score="1" ViewCount="1054" Body="&lt;p&gt;I start with predefined beta and alpha. Then I want to find rho and nu so the &lt;strong&gt;S&lt;/strong&gt;um of &lt;strong&gt;S&lt;/strong&gt;quared &lt;strong&gt;E&lt;/strong&gt;rrors is minimized. By SSE I mean the difference between my model estimated volatilities and observed maarket volatilities. How can I do it in R?&#xA;I have done following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;## difvol is a function of rho and nu, which is the sum of squared errors.&#xA;nlm(difvol,0.01,0.01)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;difvol is designed like that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(first observed volatility - Black implied volatility)^2 + (second observed volatility - Black implied volatility)^2 ...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Black implied volatility has no values in my setup because I have no estimates for rho and nu.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the nlm code only returns one estimate and both I need to estimate nu and rho. What to do from here? How do I use nlm properly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know my difvol function could have been better but I don't want to change that.&lt;/p&gt;&#xA;" OwnerDisplayName="user25295" LastActivityDate="2017-05-04T20:00:13.733" Title="SABR calibration in R. How to estimate rho and nu so sum of squared errors is minimized" Tags="&lt;programming&gt;&lt;sabr&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31030" PostTypeId="2" ParentId="31024" CreationDate="2016-11-16T07:19:52.660" Score="2" Body="&lt;p&gt;Let $r_t=r_0+x_t$ where $r_0$ is a constant. We have&#xA;$$V(S,x,t)=SN(d_1)-KP(x,t)N(d_2)$$&#xA;where&#xA;$$d_1=\frac{\ln(S/K)-\ln P(x,t)+\frac12\widehat{\sigma}\tau}{\widehat{\sigma}\sqrt{\tau}}$$&#xA;and &#xA;$$d_2=d_1-\widehat{\sigma}\sqrt{\tau}$$&#xA;and &#xA;$$\widehat{\sigma}=\sigma^2+\Sigma^2$$&#xA;The zero coupon bond pricing in terms of Vasicek-like rates is&#xA;$$P(x,t)=A(t,T)e^{-xB(t,T)}$$&#xA;where&#xA;$$B(t,T)=\frac{1-e^{-\kappa\tau}}{\kappa}$$&#xA;and&#xA;$$A(t,T)=\exp\left(-r_0\tau-\frac12\frac{\Sigma^2}{\kappa^2}\left(-\tau-\frac{2}{\kappa}\left(e^{-\kappa\tau}-1\right)+\frac{1}{2\kappa}(e^{-2\kappa\tau}-1)\right)\right)$$&#xA;For more details, read this article:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://arxiv.org/pdf/cond-mat/9906196.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Towards non-equilibrium option pricing theory&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-11-16T08:04:28.237" LastActivityDate="2016-11-16T08:04:28.237" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31031" PostTypeId="1" CreationDate="2016-11-16T10:53:13.203" Score="3" ViewCount="3655" Body="&lt;p&gt;I'm using Python 2.7.12 with the QuantLib package. I'm trying to price fixed bonds. I understand how to create a bond object. How to get the &quot;right&quot; discounting curve is kind of a problem. Assuming a non-flat term structure, I have seen the ql.ZeroCurve function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;spotCurve = ql.ZeroCurve(spotDates, spotRates, dayCount, calendar, interpolation, compounding, compoundingFrequency)&#xA;spotCurveHandle = ql.YieldTermStructureHandle(spotCurve)&#xA;bondEngine = ql.DiscountingBondEngine(spotCurveHandle)&#xA;fixedRateBond.setPricingEngine(bondEngine)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I assume the inputs are the maturities and yields of zeros with the same &quot;risk&quot; as the bond, we are looking at. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I specify the discount curve directly, e.g. when having the discount factors published by authorities like the FED or the ECB?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="25298" LastActivityDate="2016-11-16T14:10:23.177" Title="Discounting Curve in Quantlib/Python" Tags="&lt;python&gt;&lt;quantlib&gt;&lt;discounting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31035" PostTypeId="2" ParentId="16152" CreationDate="2016-11-16T13:47:36.920" Score="3" Body="&lt;p&gt;All this data is &lt;strong&gt;not&lt;/strong&gt; provided &lt;strong&gt;free&lt;/strong&gt;. Also if you try to crawl all this data from NASDAQ website the NASDAQ's web server will automate close the connection after 4~5 connections.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Xignite API is the answer to your problem but i also suggest to read this article (&lt;a href=&quot;http://www.quantatrisk.com/2015/05/07/hacking-google-finance-in-pre-market-trading-python/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.quantatrisk.com/2015/05/07/hacking-google-finance-in-pre-market-trading-python/&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="25301" LastActivityDate="2016-11-16T13:47:36.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31036" PostTypeId="1" CreationDate="2016-11-16T14:03:10.290" Score="3" ViewCount="147" Body="&lt;p&gt;The book The Volatility Surface by Gatheral (2006) introduces the Brownian bridge like density $q(x_t,t;x_T,T)$ of $x_t$ conditional on $x_T = log(K)$. Can we use $q(x_t,t;x_T,T)$ as the risk neutral measure? Why $q(x_t,t;x_T,T)$ can easily exceed one, and sometimes it can be extremely large? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are some formulae and interpretation from the book (from page 29 to 30). &#xA;For fixed strike $K$ and maturity $T$, define the Black-Scholes gamma&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Gamma_{BS}(S_t,\bar{\sigma}(t)):=\frac{\partial ^2}{\partial S_t^2}C_{BS}(S_t,K,\bar{\sigma}(t),T-t)$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the Black-Scholes forward implied variance function&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$v_{K,T}(t)=\frac{E\big[\sigma_t^2 \cdot S_t^2 \cdot \Gamma_{BS}(S_t,\bar{\sigma}(t))|\mathcal{F}_0\big]}{E\big[S_t^2 \cdot \Gamma_{BS}(S_t,\bar{\sigma}(t))|\mathcal{F}_0\big]}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\bar{\sigma}^2(t):=\frac{1}{T-t}\int_{t}^T v_{K,T}(u)du$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Black-Scholes implied variance, by following Lee(2005),can be expressed as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma_{BS}(K,T)^2=\bar{\sigma}(0)^2=\frac{1}{T}\int_{0}^{T}E^{G_t}[\sigma_t^2]dt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so interpreting $v(t)$ as the expectation of $\sigma_t^2$ with respect to the probability measure $\mathbb{G}_t$ defined, relative to the pricing measure $\mathbb{P}$, by the Radon-Nikodym derivative&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{d\mathbb{G}_t}{d\mathbb{P}}:= \frac{S_t^2\Gamma_{BS}(S_t,\bar{\sigma}(t))}{\mathbb{E}\big[S_t^2 \Gamma_{BS}(S_t,\bar{\sigma}(t))|\mathcal{F}_0\big]}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We compute a risk-neutral expectation:&#xA;$$&#xA;\mathbb{E}^p[f(S_t)] = \int dS_t p(S_t,t;S_0)f(S_t)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;we get the risk neutral pdf of the stock price at time $t$ by taking the second derivative of the market price of European options with respect to strike price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;p(S_t,t;S_0) = \frac{\partial ^2 C(S_0,K,t)}{\partial K^2}\bigg|_{K=S_t}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, from equation of Black-Scholes implied variance $\sigma_{BS}(K,T)^2$ we have&#xA;$$&#xA;v_{K,T}(t) = \mathbb{E}^{G_t} \big[\sigma_t^2 \big] &#xA;           = \mathbb{E}^p \big[\sigma_t^2 \frac{d\mathbb{G}_t}{d\mathbb{P}} \big]&#xA;           =\int dS_t \cdot q(S_t;S_0,K,T) \cdot \mathbb{E}^p \big[ \sigma_t^2 \big| S_t \big]&#xA;           =\int dS_t \cdot q(S_t;S_0,K,T) \cdot  v_L(S_t,t)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where further define&#xA;$$&#xA;q(S_t;S_0,K,T) := \frac{p(S_t,t;S_0) S_t^2 \Gamma_{BS}(S_t)}{\mathbb{E} \big[ S_t^2 \Gamma _{BS}(S_t) \big| \mathcal{F}_0}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and $v_L(S_t,t)= \mathbb{E}^p[\sigma_t^2|S_t]$ is the local variance. q(S_t;S_0,K,T) looks like a Brownian Bridge density for the stock price. Then, the equation of $v_{K,T}(t)$ can be rewritten in terms of $x_t :=log(S_t/S_0)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;v_{K,T}(t)=\int dx_t \cdot q(x_t;x_T,T) \cdot v_L(x_t,t)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: from the last equation of $v_{K,T}(t)$, it seems that q(S_t;S_0,K,T) is the risk neutral measure. However, sometimes it can be extremely large, such as 8 or 12. Should it be some value between 0 and 1?&lt;/p&gt;&#xA;" OwnerUserId="25302" LastEditorUserId="25302" LastEditDate="2016-11-16T16:07:25.717" LastActivityDate="2016-11-16T16:07:25.717" Title="Brownian bridge density and risk neutral density for derivative pricing" Tags="&lt;brownian-motion&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31037" PostTypeId="2" ParentId="31031" CreationDate="2016-11-16T14:10:23.177" Score="5" Body="&lt;p&gt;You can use the &lt;code&gt;DiscountCurve&lt;/code&gt; class, that takes a list of dates and a list of corresponding discount factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The one exported by default in the Python module uses a log-linear interpolation between the given discounts; using a different interpolation would require adding a line in the corresponding SWIG interface and recompiling the module.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2016-11-16T14:10:23.177" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31039" PostTypeId="2" ParentId="31029" CreationDate="2016-11-16T17:28:21.373" Score="2" Body="&lt;p&gt;Try to redesign your object function, your &lt;code&gt;difvol&lt;/code&gt;, so it's a function of a two dimensional vector&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dilvol&amp;lt;-function(X){ &#xA;rho&amp;lt;-X[1]&#xA;nu&amp;lt;-X[2]&#xA;##type in your function here and use rho and nu normally..&#xA;}&#xA;nlm(difvol,c(0.1,0.1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This might work  &lt;/p&gt;&#xA;" OwnerUserId="18555" LastEditorUserId="18555" LastEditDate="2017-05-04T20:00:13.733" LastActivityDate="2017-05-04T20:00:13.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31041" PostTypeId="1" CreationDate="2016-11-16T18:44:12.217" Score="-2" ViewCount="166" Body="&lt;p&gt;the question is in the title and why is it that the market follows a cycle? By cycle, I mean that the market is going up since 8 years and that we think that, most likely, the market is gonna go trough recession soon?&#xA;I might be clear on this, im sorry. &#xA;thank you for the answers &lt;/p&gt;&#xA;" OwnerUserId="25210" LastEditorUserId="3371" LastEditDate="2016-11-17T10:08:10.303" LastActivityDate="2016-11-17T10:08:10.303" Title="Why does the market follow a Fibonacci retracement?" Tags="&lt;market-data&gt;&lt;market-microstructure&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2016-11-19T10:16:23.517" ContentLicense="CC BY-SA 3.0" />
  <row Id="31044" PostTypeId="2" ParentId="31041" CreationDate="2016-11-16T23:44:24.597" Score="1" Body="&lt;p&gt;It may well be just because a lot of other traders follow the idea of Fibonacci retracement.&lt;/p&gt;&#xA;" OwnerUserId="7178" LastActivityDate="2016-11-16T23:44:24.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31045" PostTypeId="1" CreationDate="2016-11-17T08:07:07.093" Score="0" ViewCount="64" Body="&lt;p&gt;If we assume that FED hikes the interest rates next time, then we will expect bond prices in general to fall, but what types of bond do you expect to be affected the most? Corporate bonds or government bonds?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it wrong to assume, that when the economy is going well (high PMI, high GDP growth rates and so on), then the prices/returns from High Yield bonds will be higher than investment grade bonds? and in general corporate bond return will be higher than government bonds?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I totally wrong? I will say that riskier bonds will perform better, when economy goes well, but worst when economy goes bad?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope these are not silly questions&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="25258" LastActivityDate="2016-11-17T11:49:33.753" Title="factors affecting corporate and government bonds" Tags="&lt;fixed-income&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31046" PostTypeId="2" ParentId="25696" CreationDate="2016-11-17T09:50:12.403" Score="3" Body="&lt;p&gt;The spread are quoted on ICAP or in Bloomberg if you have acess to them or you can refer to the paper of Mercurio where you have some quotes and examples&lt;/p&gt;&#xA;" OwnerUserId="24915" LastActivityDate="2016-11-17T09:50:12.403" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31048" PostTypeId="1" AcceptedAnswerId="31051" CreationDate="2016-11-17T11:35:11.663" Score="0" ViewCount="1548" Body="&lt;p&gt;In the famous &lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Ken French web side&lt;/a&gt; there is database of historical values of FF 3 factors model. The partition is between daily/weekly/monthly tables.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is it possible (and how) to transform one of these tables to semi-annual/annual table?&lt;/li&gt;&#xA;&lt;li&gt;If not, is there a way to calculate semi-annual/annual tables based on other data from this web site? Note - The issue is to calculate values based on free public available data, assuming paid access to CRSP etc. N/A.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;" OwnerUserId="18094" LastActivityDate="2017-03-16T19:08:43.277" Title="Fama/French 3 Factors: How to convert published daily/weekly/monthly values to semi-annual/annual?" Tags="&lt;regression&gt;&lt;factor-models&gt;&lt;fama-french&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31049" PostTypeId="2" ParentId="31045" CreationDate="2016-11-17T11:49:33.753" Score="1" Body="&lt;p&gt;In an improving economic environment the spread between junk and prime will tend decrease (i.e. the price difference between the two will narrow).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuition is a rising tide lifts all boats -- i.e. you're not so worried about that slightly spooky company anymore if there is ample economic demand. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The inverse is also true. In a deteriorating economic environment, the spread between junk and prime will generally increase (i.e. a flight to quality -- the rotation out of riskier assets). You can apply the same logic to a single sector or even bond issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first part of your questions tend to relate more to bond duration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say you have two bonds and the coupon on both issues is 5%. And, conveniently, interest rates are 5%. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first bond is has residual life of 10 years. The second, one year. All of a sudden, interest rates change to 6%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, the 10 year bond will be expected to fall more than the one year bond. Basically, you're stuck with a below market coupon for 9 extra years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Issues tend be rather cookie cutter these days (i.e. bullets), however, there are a number of bond features (such as a put or call element) that will significantly change the performance of a bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can read more about bond duration here: &lt;a href=&quot;https://en.wikipedia.org/wiki/Bond_duration&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Bond_duration&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="24676" LastActivityDate="2016-11-17T11:49:33.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31050" PostTypeId="1" CreationDate="2016-11-17T13:57:19.707" Score="5" ViewCount="2712" Body="&lt;p&gt;I am reading about Dupire local volatility model and have a rough idea of the derivation. But I can't reconcile the local volatility surface to pricing using geometric brownian motion process. If I'm not mistaken the proces &#xA;$dS=rSdt+\sigma(S;t) S dX$ given final condition $(S-K)^{+}$ will produce correct options values given some strike. So in other words each time I change the strike $K$ I should get the options values that are consistent with the market (or really close to them). Is it true? How does my model know that I changed my strike?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2016/11/19:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm still not sure if I understand that correctly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I have a matrix of option prices by strikes and maturities then I should fit some 3D function to this data. This can be done by some interpolation/extrapolation or just finding some 3rd degree polynomial. I did the latter. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The formula for instantenous volatility is $\sigma(E;T)=\sqrt{\frac{\frac{\partial V}{\partial T}+rE\frac{\partial V}{\partial E}}{\frac{1}{2}E^2\frac{\partial^2 V}{\partial^2 E}}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I want to perform Monte Carlo simulation I should evaluate $\sigma(E;T)$ at each timestep. At each timestep I simulate current stock price $S_c$ and I pretend it is $E$ so I evaulate $\sigma(E;T)$ at $E=S_c; T=t$. Is this correct? If so, then $\frac{\partial V}{\partial T}$ is really a instantenous change of option price which has the strike $S_c$ and it comes from Matrix of option prices. Is this correct? So really any stochastic process $dS=rSdt+\sigma(S;t) S dX$ should have the same diffusion for all Strikes. If they have exactly the same diffusion, the probability density function will be the same and hence the realized volatility will be exactly the same for all options, but market data differentiate volatility between strike and option price. If I have realized volatility different than implied, there is no way I should get the same option prices as the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example for option with strike K=100 realized vol should be 20% (this is implied from quoted option prices), and for option with strike K=110 realized vol should be 15%, but actually with the dupire formula it will be the same for both of them. Could you guys clarify? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit 2016/11/21:&#xA;Ok guys, I think I understand it now. I performed MC simulation and got the correct numbers. In fact the pdf will be tlhe same but it will allow to replicate implied vol surface.&#xA;Thanks for the explanation, it was helpful.&lt;/p&gt;&#xA;" OwnerUserId="25315" LastEditorUserId="25315" LastEditDate="2016-11-21T07:54:22.687" LastActivityDate="2020-03-17T21:07:33.677" Title="pricing using dupire local volatility model" Tags="&lt;options&gt;&lt;volatility&gt;&lt;calibration&gt;&lt;local-volatility&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31051" PostTypeId="2" ParentId="31048" CreationDate="2016-11-17T13:57:41.307" Score="1" Body="&lt;p&gt;The following paper has a good discussion on the topic:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.researchgate.net/publication/228267016_On_the_Consistency_between_the_Fama-French_Daily_and_Monthly_Factors&quot; rel=&quot;nofollow noreferrer&quot;&gt;On the Consistency between the Fama-French Daily and Monthly Factors&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically you should cumulate monthly ones to get to annual numbers.&lt;/p&gt;&#xA;" OwnerUserId="19615" LastActivityDate="2016-11-17T13:57:41.307" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31053" PostTypeId="2" ParentId="31050" CreationDate="2016-11-17T15:19:27.397" Score="3" Body="&lt;ul&gt;&#xA;&lt;li&gt;Assemble the data, consisting of a matrix of quoted option prices $\{C(T_i,K_j^i)\}_{i=1}^{N}$ where $j=1,2,...,M_i$ together with the yield curve to determine $r$ .&lt;/li&gt;&#xA;&lt;li&gt;Interpolate and extrapolate these prices (or, more likely, the corresponding Black-Scholes implied volatilities) to produce a smooth volatility surface $C$.&lt;/li&gt;&#xA;&lt;li&gt;Calculate $\widehat{\sigma}(T, F)$ from Dupier formula and compute the corresponding $\sigma(T,S).$&lt;/li&gt;&#xA;&lt;li&gt;The price model is determined by&#xA;$$dS_t=\mu(t)S_tdt+\sigma(t,S_t)S_tdW_t.$$&lt;/li&gt;&#xA;&lt;li&gt;Now we can calculate the prices of exotic options by finite-difference methods or Monte Carlo.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&#xA;$$\mu(t)=r_t-q_t$$&#xA;and&#xA;$$F_t=S_t\exp\left(\int_{t}^{T}\mu(s)ds\right)$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-11-17T15:55:50.737" LastActivityDate="2016-11-17T15:55:50.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31054" PostTypeId="1" CreationDate="2016-11-17T16:04:45.813" Score="0" ViewCount="629" Body="&lt;p&gt;Say I'm running a few backtests, say 1980-now, 2000-now and 2010-2015. When I'm calculating the Sharpe ratio of these backtests, do I use the risk-free rates associated with those time periods? or should I use the current risk-free rate for all of them? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My concern is that is that it might misleading to compare the Sharpe ratios of these different backtests to assess the viability of the different trading strategies I'm backtesting, because the Sharpe will be dependent on, say, what the T-bills at the time were looking like at the time of the backtest and not necessarily how profitable the trades are. However, if I use the current risk-free rate for all of them it will (I think) suggest what their risk-adjusted returns would be in the current market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this a valid concern? Or should I just be using the historical risk-free rate for the times I'm backtesting. Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="24836" LastActivityDate="2016-11-17T18:06:38.377" Title="when calculating sharpe ratio of a backtest, do you use the historical risk-free rate or the current one?" Tags="&lt;backtesting&gt;&lt;sharpe-ratio&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31056" PostTypeId="2" ParentId="31050" CreationDate="2016-11-17T17:47:36.437" Score="3" Body="&lt;p&gt;The idea behind this is as follows: Assume you would observe an arbitrage-free continuum of European plain vanilla call option prices $C_0(T, K)$ for all maturities and strikes. For any fixed maturity $T$, this implies a probability density function for the corresponding terminal asset prices via the well-known relationship&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;f_{S_T}(K) = e^{r T} \frac{\partial^2 C}{\partial K^2}(T, K).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The local volatility $\sigma(K, T)$ is the unique deterministic diffusion function such that the model and market implied probability densities agree for all maturities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The payoff of a European contingent claim only depends on the asset price at maturity. Consequently any two models whose implied probability densities agree for the maturity of interest agree on the prices of all European contingent claims. So by construction, the local volatility model matches the market prices of all European contingent claims without the model dynamics depending on what strike or payoff function you are interested in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Edit Nov. 21 2016:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is how I understand your first edit: You write that since there is only one price process, there is one fixed implied standard deviation per maturity. You then argue that consequently, we can't replicate the prices of all European options since the market exhibits a strike-dependent implied volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While your statement is correct, your conclusion is not. The (Black/Scholes) implied volatility does not only reflect the standard deviation of returns but also all deviations from a normal distribution. I.e. a &lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2016-11-21T12:35:20.757" LastActivityDate="2016-11-21T12:35:20.757" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31057" PostTypeId="1" CreationDate="2016-11-17T17:52:29.627" Score="0" ViewCount="68" Body="&lt;p&gt;The portfolio has two types of positions: asset and cash positions. Cash positions are easy. One currency has only one position, so you can add and subtract easily. Asset positions seem to be more difficult. Ideally one asset would have only one position and we would add and subtract quantity from it. However in practice it seems necesary to have multiple positions for the same asset (different purchase price, date) that can exist simultaneously (say for stop limits as part of risk management -- need to know purchase price). Say the strategy decided to sell one asset position. Say in a straightforward scenario the order got fully executed (now the exchange does not know the internal ID of the position), so &lt;strong&gt;if we have several positions (of the same size) how do we know which one to close internally?&lt;/strong&gt; Not talking about situations with partial fill (but I guess same problem). &lt;strong&gt;Or do the exchanges actually issue some kind of position ID via a &quot;Confirmation Report&quot; that can then be attached to the position?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="11655" LastActivityDate="2017-03-30T16:50:14.703" Title="Do exchanges issue position ID after order execution?" Tags="&lt;portfolio&gt;&lt;exchange&gt;&lt;asset&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31058" PostTypeId="2" ParentId="31054" CreationDate="2016-11-17T18:06:38.377" Score="1" Body="&lt;p&gt;You should use the historical risk free rate so that it becomes viable for you to analyse your investment. But make sure your risk free rate should match the duration of the investment which was before while performing a back test. Because if you take the current one, it is not viable to compare your investment in history with the current risk free rate because the risk free rate is the average return over the time period under evaluation. And if you are backtesting a period (say 3 years) then you can take the average of the risk free rate (over 3 year period) over the same time period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps!!!&lt;/p&gt;&#xA;" OwnerUserId="18663" LastActivityDate="2016-11-17T18:06:38.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31060" PostTypeId="1" CreationDate="2016-11-17T20:15:55.460" Score="-1" ViewCount="1498" Body="&lt;p&gt;I want to calculate $\int ^t _0 W_tdW_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that the reasoning is the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $x(t)=W(t)$ with $a=0$ and $b=1$ in the definition of an Ito Process, and $f(t,x)=x^2$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, applying Ito's formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$df=\frac{\partial f}{\partial t}dt + \frac{\partial f}{\partial x}dW+\frac{1}{2}\frac{\partial ^2f}{\partial x^2}dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dW^2=dt+2WdW$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\int dW^2 = \int dt + 2\int WdW$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\int WdW=\frac{1}{2}W^2-\frac{t}{2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem is that I don't understand why $df$ is equal to $dW^2$ since for me it would be $df=d(x^2)=d(W^2)$ and considering that I don't know over which variable I am deriving it, I don't know how the results above are explained.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It may be a really easy question but I am starting to study these things and I want to make sure that I understand the basics of it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="25324" LastEditorUserId="70" LastEditDate="2016-11-20T16:01:07.453" LastActivityDate="2016-11-20T16:01:07.453" Title="How is the Wiener integral $\int{WdW}$ calculated?" Tags="&lt;stochastic-calculus&gt;&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31061" PostTypeId="2" ParentId="31060" CreationDate="2016-11-17T20:45:54.907" Score="6" Body="&lt;p&gt;You are &quot;deriving&quot; with respect to $t$ (the time index in your stochastic process).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$f(t,x) = x^2$ so $f(t,W_t) = W_t^2$. And Ito's lemma tells you &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$W_b^2 - W_a^2 = \int_{t=a}^b d(W_t^2) = \int_{t=a}^b df(t,W_t) = \int_{t=a}^b 2W_t dW_t + \int_{t=a}^b dt$ for all $0 \le a &amp;lt;= b$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: Actually you are not deriving. The differential notation is just a notation to avoid having to write integrals. Ito's lemma is an identity between stochastic integrals.&lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2016-11-17T20:54:27.473" LastActivityDate="2016-11-17T20:54:27.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31062" PostTypeId="2" ParentId="30716" CreationDate="2016-11-18T01:01:05.187" Score="4" Body="&lt;p&gt;The only files you need are 'nasdaqlisted.txt' and 'otherlisted.txt'. Simply merge and sort the files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The 'nasdaqtraded.txt' should be the total of 'nasdaqlisted.txt' and 'otherlisted.txt'. And 99.99% of the time it is. However, I have found a few, rare exceptions where one or two symbols were missing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is best to just download, merge, and sort the listed files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to the definition page, &quot;The symbol directory files are updated periodically through-out each day.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.nasdaqtrader.com/trader.aspx?id=symboldirdefs&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.nasdaqtrader.com/trader.aspx?id=symboldirdefs&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="25326" LastActivityDate="2016-11-18T01:01:05.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31063" PostTypeId="1" AcceptedAnswerId="31065" CreationDate="2016-11-18T05:53:16.910" Score="3" ViewCount="915" Body="&lt;p&gt;I know the Heston model .In this model, we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f(\Phi,x_t,v_t)=\exp(C_j(\tau,\Phi)+D_j(\tau,\Phi)+i * \Phi * x_t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can we extract the Characteristic function  as follows&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f(\Phi_1,\Phi_2,x_t,v_t)=\mathbb{E}[\exp(i * \Phi_1 * x_T+i*\Phi_2*v_T)]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="25329" LastEditorUserId="1809" LastEditDate="2016-11-18T06:27:18.753" LastActivityDate="2016-11-18T08:47:38.960" Title="Problem on Characteristic function in Heston model" Tags="&lt;finance-mathematics&gt;&lt;heston&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31064" PostTypeId="1" AcceptedAnswerId="31101" CreationDate="2016-11-18T06:56:56.920" Score="5" ViewCount="330" Body="&lt;p&gt;Can anyone give me some hints as to how to prove that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$g(x) = \begin{cases}&#xA;         \frac{x}{1-\alpha}, &amp;amp;0 \leq x \leq 1-\alpha\\&#xA;         1 , &amp;amp;1-\alpha \leq x \leq 1&#xA;        \end{cases}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the distortion function corresponding to $\text{CVaR}_\alpha(X)$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here I define $$\text{CVaR}_\alpha(X) = \frac{1}{\alpha} \int_{0}^{\alpha} F_X^{-1}(u) du$$ For more details, see &lt;a href=&quot;https://en.wikipedia.org/wiki/Expected_shortfall&quot; rel=&quot;nofollow noreferrer&quot;&gt;Expected shortfall - Wikipedia&lt;/a&gt; .Of course the inverse is supposed to be understood as the generalized inverse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem is that a direct calculation does not seem to work for me. Maybe I am missing some trick.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be appreciated. &lt;/p&gt;&#xA;" OwnerUserId="25331" LastEditorUserId="467" LastEditDate="2016-11-21T14:39:57.387" LastActivityDate="2016-11-21T14:39:57.387" Title="How to calculate the distortion function for CVaR?" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;coherent-risk-measure&gt;&lt;cvar&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31065" PostTypeId="2" ParentId="31063" CreationDate="2016-11-18T08:16:21.717" Score="4" Body="&lt;p&gt;The Heston model is represented by the bivariate system of stochastic differential equations&#xA;\begin{align}&#xA;  &amp;amp; dS_t=rS_tdt+{\sqrt\upsilon_t}S_t dW_1(t) \\&#xA; &amp;amp; dv_t=\kappa(\theta-v_t) dt+\sigma{\sqrt v_t}dW_2(t) \tag 1\\&#xA;&amp;amp;\mathbb{E}[dW_1(t),dW_2(t)]=\rho dt&#xA;\end{align}&#xA;set $x_t=\ln S_t$, By application of Ito's lemma, we have&#xA;\begin{align}&#xA;  &amp;amp; dx_t=\left(r-\frac12 v_t\right)dt+{\sqrt\upsilon_t} dW_1(t) \\&#xA; &amp;amp; dv_t=\kappa(\theta-v_t) dt+\sigma{\sqrt v_t}dW_2(t) \tag 2\\&#xA;\end{align}&#xA;Let $B_1(t)$ and $B_2(t)$ be two  independent Wiener processes, we have&#xA;\begin{align}&#xA;  &amp;amp; dx_t=\left(r-\frac12 v_t\right)dt+{\sqrt\upsilon_t} dB_1(t) \\&#xA; &amp;amp; dv_t=\kappa(\theta-v_t) dt+\sigma{\sqrt v_t}\left(\rho\,dB_1(t)+\sqrt{1-\rho^2}dB_2(t)\right) \tag 3\\&#xA;\end{align}&#xA;Now we can write the Heston model as follow&#xA;$$dy_t=\mu(t,y_t)dt+\Sigma(t,y_t)dB_t\tag 4$$&#xA;where&#xA;$$y_t=\left( \begin{matrix}&#xA;   {x_t}  \\&#xA;   {v_t}  \\&#xA;\end{matrix} \right)$$&#xA;$$\mu(t,y_t)=\left( \begin{matrix}&#xA;   r-\frac{1}{2}{{v}_{t}}  \\&#xA;   \kappa (\theta -{v_t})  \\&#xA;\end{matrix} \right)&#xA;\\&#xA;\Sigma (t,y_t)=\left( \begin{matrix}&#xA;   \sqrt{{{v}_{t}}} &amp;amp; 0  \\&#xA;   \sigma \rho \sqrt{v_t} &amp;amp; \sigma \sqrt{1-{{\rho }^{2}}}\sqrt{{{v}_{t}}}  \\&#xA;\end{matrix} \right)\tag 5$$&#xA;and&#xA;$$B(t)=\left( \begin{matrix}&#xA;   {{B}_{1}}(t)  \\&#xA;   {{B}_{2}}(t)  \\&#xA;\end{matrix} \right)$$&#xA;The drift $\mu$ and the matrix $\Sigma\Sigma^{\text{T}}$  can both be written in the affine form&#xA;$$\begin{align}&#xA;  &amp;amp;\quad\,\, \mu (t,{{y}_{t}})={{\alpha}_{0}}+{{\alpha}_{1}}{{x}_{t}}+{{\alpha}_{2}}{{v}_{t}} \\ &#xA; &amp;amp; \Sigma {{\Sigma }^{\text{T}}}(t,{{y}_{t}})={{\beta}_{0}}+{{\beta}_{1}}{{x}_{t}}+{{\beta}_{2}}{{v}_{t}} \\ &#xA;\end{align}\tag 6$$&#xA;where&#xA;$${{\alpha }_{0}}=\left( \begin{matrix}&#xA;   r  \\&#xA;   k\theta   \\&#xA;\end{matrix} \right),\,{{\alpha }_{1}}=\left( \begin{matrix}&#xA;   0  \\&#xA;   0  \\&#xA;\end{matrix} \right),{{\alpha }_{2}}=\left( \begin{matrix}&#xA;   -0.5  \\&#xA;   -\kappa   \\&#xA;\end{matrix} \right)\tag 7$$&#xA;and&#xA;$${{\beta }_{0}}={{\beta }_{1}}=\left( \begin{matrix}&#xA;   0 &amp;amp; 0  \\&#xA;   0 &amp;amp; 0  \\&#xA;\end{matrix} \right),{{\beta }_{2}}=\left( \begin{matrix}&#xA;   1 &amp;amp; \rho \sigma   \\&#xA;   \rho \sigma  &amp;amp; {{\sigma }^{2}}  \\&#xA;\end{matrix} \right)\tag 8$$&#xA;The result of &lt;a href=&quot;http://pages.stern.nyu.edu/~dbackus/Disasters/DuffiePanSingleton%20jumps%20Econometrica%2000.PDF&quot; rel=&quot;noreferrer&quot;&gt;Duffie, Pan, and Singleton (2000)&lt;/a&gt; is that the characteristic function has the log-linear form&#xA;$$f(\phi_1,\phi_2,x_t,v_t)=\exp\left(A(\tau,\phi_1,\phi_2)+B(\tau,\phi_1,\phi_2)x_t+C(\tau,\phi_1,\phi_2)v_t\right)$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Duffie, Pan, and Singleton (2000) show that the characteristic&#xA;  function of a wide class of multivariate affine models (of which the&#xA;  Heston model is a special case) has a log linear form .&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;For more details, see it:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.researchgate.net/publication/229760662_Affine_Concatenation&quot; rel=&quot;noreferrer&quot;&gt;Affine concatenation&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-11-18T08:47:38.960" LastActivityDate="2016-11-18T08:47:38.960" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31066" PostTypeId="1" CreationDate="2016-11-18T11:21:58.863" Score="3" ViewCount="277" Body="&lt;p&gt;I am constructing a mean-variance-skewness-kurtosis portfolio based on monthly data with a holding period of one year. &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1635484&quot; rel=&quot;nofollow noreferrer&quot;&gt;Meucci&lt;/a&gt; describes how to annualize higher order moments in general, but not how to do it for co-moments such as the coskewness and cokurtosis matrix. Please enlighten me.&lt;/p&gt;&#xA;" OwnerUserId="24553" LastActivityDate="2016-11-18T11:21:58.863" Title="Annualization of coskewness and cokurtosis" Tags="&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;&lt;skewness&gt;&lt;kurtosis&gt;&lt;annualized&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31067" PostTypeId="1" CreationDate="2016-11-18T14:07:19.157" Score="2" ViewCount="6343" Body="&lt;p&gt;what is the difference between sovereign bond and government bond? Can I assume that both are the same? Thank you very much in advance!&lt;/p&gt;&#xA;" OwnerUserId="25215" LastActivityDate="2016-11-18T14:07:19.157" Title="What is the difference between sovereign bond and government bond?" Tags="&lt;bond&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31068" PostTypeId="1" AcceptedAnswerId="31069" CreationDate="2016-11-18T15:20:28.893" Score="0" ViewCount="1467" Body="&lt;p&gt;I have a question about the following derivation in this &lt;a href=&quot;http://media.wix.com/ugd/c4ff5c_ba17141422d44ba99daf19ee2b931544.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;pdf&lt;/a&gt; (sample chapter from Bergomi - Stochastic Volatility Modeling).&#xA;He derives the PnL for a delta hedged position as&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$PnL = -[P(t+\delta,S+\delta S)-P(t,S)] + rP(t,S)\delta t + \Delta(\delta S - rS \delta t + q S\delta t)$$&lt;/span&gt;&#xA;where &lt;span class=&quot;math-container&quot;&gt;$r$&lt;/span&gt; is the interest rate, &lt;span class=&quot;math-container&quot;&gt;$q$&lt;/span&gt; the repo rate including dividend yield and &lt;span class=&quot;math-container&quot;&gt;$P(t,S)$&lt;/span&gt; denotes the price of the option with underlying &lt;span class=&quot;math-container&quot;&gt;$S$&lt;/span&gt; at time &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt;. He chooses &lt;span class=&quot;math-container&quot;&gt;$\Delta = \frac{\partial P}{\partial S}$&lt;/span&gt;. Then he wants to expand the PnL in powers of &lt;span class=&quot;math-container&quot;&gt;$\delta S$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$\delta t$&lt;/span&gt; just looking at &lt;span class=&quot;math-container&quot;&gt;$\delta t, \delta S$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$\delta S \delta S$&lt;/span&gt; terms. His result is&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ PnL = -(\frac{dP}{dt}- rP +(r-q)S \frac{dP}{dS})\delta t - \frac{1}{2}S^2\frac{d^2P}{dS^2}(\frac{\delta S}{S})^2$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;I'm not sure how he gets that one. If I expand &lt;span class=&quot;math-container&quot;&gt;$P$&lt;/span&gt; in the terms mentioned above I find&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$P(t+\delta,S+\delta S) = P(t,S) + \frac{dP}{dt}\delta t + \frac{dP}{dS}\delta S + \frac{1}{2}*\frac{d^2P}{dS^2}(\delta S)^2$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Doing this for the three terms of &lt;span class=&quot;math-container&quot;&gt;$P$&lt;/span&gt; above I dont get the correct result. So how do you get his formula&lt;/p&gt;&#xA;" OwnerUserId="17133" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-11-18T18:57:42.700" Title="taylor expansion of PnL" Tags="&lt;black-scholes&gt;&lt;hedging&gt;&lt;mathematics&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31069" PostTypeId="2" ParentId="31068" CreationDate="2016-11-18T15:50:56.107" Score="5" Body="&lt;p&gt;$\require{cancel}$&#xA;$$\text{PnL} = -[P(t+\delta t,S+\delta S)-P(t,S)] + rP(t,S)\delta t + \Delta(\delta S - rS \delta t + q S\delta t)$$&#xA;Assuming a pure diffusion, at the order 1 as $\delta t \to 0$ &#xA;$$P(t+\delta,S+\delta S) = P(t,S) + \frac{\partial P}{\partial t}\delta t + \frac{\partial P}{\partial S}\delta S + \frac{1}{2}\frac{\partial^2P}{\partial S^2}(\delta S)^2$$&#xA;Plugging that back in the first equation and using the identity $\Delta = \frac{\partial P}{\partial S}$ gives:&#xA;\begin{align}&#xA;\text{PnL} &amp;amp;= -\frac{\partial P}{\partial t}\delta t \cancel{- \frac{\partial P}{\partial S}\delta S} - \frac{1}{2} S^2 \frac{\partial^2P}{\partial S^2}\left(\frac{\delta S}{S}\right)^2 + rP\delta t + \cancel{\Delta\delta S} - (r - q) S \Delta \delta t \\&#xA;&amp;amp;= -\left( \frac{\partial P}{\partial t} - rP + (r - q) S \frac{\partial P}{\partial S} \right) \delta t +&#xA; \frac{1}{2} S^2 \frac{\partial^2P}{\partial S^2}\left(\frac{\delta S}{S}\right)^2 &#xA;\end{align}&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-11-18T18:57:42.700" LastActivityDate="2016-11-18T18:57:42.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31070" PostTypeId="2" ParentId="31064" CreationDate="2016-11-18T16:46:02.557" Score="1" Body="&lt;p&gt;Maybe prove that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$CVaR_\alpha (X) = \frac{1}{\alpha} \int_0^\alpha F^{-1}_X(u) du$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;has the distortion function&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ g(u)= \begin{cases}  \frac{u}{\alpha}, \quad \;  u \leq \alpha \\     1, \qquad u &amp;gt; \alpha\end{cases}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;would be easier? &lt;/p&gt;&#xA;" OwnerUserId="11585" LastActivityDate="2016-11-18T16:46:02.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31071" PostTypeId="1" AcceptedAnswerId="31083" CreationDate="2016-11-18T16:50:31.813" Score="0" ViewCount="407" Body="&lt;p&gt;I am self-studying and encountered the following passage from my textbook on the market maker's overnight profit on a delta-hedged portfolio:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/xypVg.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/xypVg.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't understand why their isn't a factor of $(e^{r/365} - 1)$ multiplied by the $C(S_0)$ term. My reasoning is that if a call/put is sold, the positive cash flow from the premium could be invested at the risk-free rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My understanding is that the overnight profit on a sold call would be the premium that the call sold for at day 0, which could be invested at the risk free rate overnight, minus the premium that the call could be sold for if held on to for another day, or $C(S_0)\left(e^{r/365} - 1\right) - C(S_1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wouldn't it be more accurate to say that: $$\text{Profit} = -\left(C(S_1) - C(S_0)(e^{r/365} - 1)\right) +\Delta(S_1 - S_0) - (e^{r/365} - 1)\left(\Delta S_0 - C(S_0)\right)?$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we're factoring interest lost on self-financing the selling of an option and buying $\Delta$ shares of stock, why wouldn't we also factor interest gained by selling the option at $T = 0$?&lt;/p&gt;&#xA;" OwnerUserId="5641" LastActivityDate="2016-11-19T18:29:46.243" Title="Why doesn't the overnight profit on a delta-hedged porfolio include interest on the initial selling/buying of the option?" Tags="&lt;market-making&gt;&lt;delta-hedging&gt;&lt;self-study&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31073" PostTypeId="1" AcceptedAnswerId="31082" CreationDate="2016-11-18T20:52:37.823" Score="4" ViewCount="4882" Body="&lt;p&gt;This is somewhat related to the question I asked &lt;a href=&quot;https://quant.stackexchange.com/questions/30972/ql-python-bootstrapping-yield-curve-futuresratehelper-throwing-off-results/30973#30973&quot;&gt;here&lt;/a&gt; but simpler.  I am trying to bootstrap a yield curve from swaps, and am having a problem with the dates/maturities that are coming out.  The code I'm using is below, and the issue that I'm having is that when the results are returned the Maturities field is not matching the maturities I'm inputting.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import QuantLib as ql&#xA;from pandas import DataFrame&#xA;import matplotlib.pyplot as plt&#xA;import csv&#xA;&#xA;def get_spot_rates(yieldcurve, day_count, calendar=ql.UnitedStates(), months=121):&#xA;    spots = []&#xA;    tenors = []&#xA;    ref_date = yieldcurve.referenceDate()&#xA;    calc_date = ref_date&#xA;    for yrs in yieldcurve.times():&#xA;        d = calendar.advance(ref_date, ql.Period(int(yrs*365.25), ql.Days))&#xA;        compounding = ql.Compounded&#xA;        freq = ql.Semiannual&#xA;        zero_rate = yieldcurve.zeroRate(yrs, compounding, freq)&#xA;        tenors.append(yrs)&#xA;        eq_rate = zero_rate.equivalentRate(day_count,compounding,freq,calc_date,d).rate()&#xA;        spots.append(eq_rate*100)&#xA;    return DataFrame(list(zip(tenors, spots)),columns=[&quot;Maturities&quot;,&quot;Curve&quot;],index=['']*len(tenors))&#xA;&#xA;swap_maturities = [ql.Date(9,9,2016),&#xA;ql.Date(15,9,2016),&#xA;ql.Date(22,9,2016),&#xA;ql.Date(29,9,2016),&#xA;ql.Date(11,10,2016),&#xA;ql.Date(9,11,2016),&#xA;ql.Date(8,12,2016),&#xA;ql.Date(10,1,2017),&#xA;ql.Date(8,2,2017),&#xA;ql.Date(8,3,2017),&#xA;ql.Date(8,6,2017),&#xA;ql.Date(8,9,2017),&#xA;ql.Date(8,3,2018),&#xA;ql.Date(10,9,2018),&#xA;ql.Date(10,9,2019),&#xA;ql.Date(10,9,2020),&#xA;ql.Date(9,9,2021),&#xA;ql.Date(8,9,2022),&#xA;ql.Date(8,9,2023),&#xA;ql.Date(10,9,2024),&#xA;ql.Date(10,9,2025),&#xA;ql.Date(10,9,2026),&#xA;ql.Date(8,9,2028),&#xA;ql.Date(10,9,2031),&#xA;ql.Date(10,9,2036),&#xA;ql.Date(10,9,2041),&#xA;ql.Date(10,9,2046),&#xA;ql.Date(8,9,2056)&#xA;]&#xA;&#xA;swap_periods = [ql.Period(1,ql.Days),&#xA;ql.Period(1,ql.Weeks),&#xA;ql.Period(2,ql.Weeks),&#xA;ql.Period(3,ql.Weeks),&#xA;ql.Period(1,ql.Months),&#xA;ql.Period(2,ql.Months),&#xA;ql.Period(3,ql.Months),&#xA;ql.Period(4,ql.Months),&#xA;ql.Period(5,ql.Months),&#xA;ql.Period(6,ql.Months),&#xA;ql.Period(9,ql.Months),&#xA;ql.Period(1,ql.Years),&#xA;ql.Period(18,ql.Months),&#xA;ql.Period(2,ql.Years),&#xA;ql.Period(3,ql.Years),&#xA;ql.Period(4,ql.Years),&#xA;ql.Period(5,ql.Years),&#xA;ql.Period(6,ql.Years),&#xA;ql.Period(7,ql.Years),&#xA;ql.Period(8,ql.Years),&#xA;ql.Period(9,ql.Years),&#xA;ql.Period(10,ql.Years),&#xA;ql.Period(12,ql.Years),&#xA;ql.Period(15,ql.Years),&#xA;ql.Period(20,ql.Years),&#xA;ql.Period(25,ql.Years),&#xA;ql.Period(30,ql.Years),&#xA;ql.Period(40,ql.Years)&#xA;]&#xA;&#xA;swap_rates = [0.37,&#xA;0.4025,&#xA;0.4026,&#xA;0.399,&#xA;0.3978,&#xA;0.4061,&#xA;0.41,&#xA;0.4155,&#xA;0.4273,&#xA;0.4392,&#xA;0.461,&#xA;0.4805,&#xA;0.5118,&#xA;0.538,&#xA;0.587,&#xA;0.638,&#xA;0.7,&#xA;0.756,&#xA;0.818,&#xA;0.865,&#xA;0.913,&#xA;0.962,&#xA;1.045,&#xA;1.137,&#xA;1.2355,&#xA;1.281,&#xA;1.305,&#xA;1.346&#xA;]&#xA;&#xA;&quot;&quot;&quot; Parameter Setup &quot;&quot;&quot;&#xA;calc_date = ql.Date(1,9,2016)&#xA;ql.Settings.instance().evaluationDate = calc_date&#xA;calendar = ql.UnitedStates()&#xA;bussiness_convention = ql.ModifiedFollowing&#xA;day_count = ql.Actual360()&#xA;coupon_frequency = ql.Annual&#xA;&#xA;&quot;&quot;&quot; SwapRateHelper &quot;&quot;&quot;&#xA;swap_helpers = []&#xA;for rate,tenor in list(zip(swap_rates,swap_periods)):&#xA;&#xA;&#xA;swap_helpers.append(ql.SwapRateHelper(ql.QuoteHandle(ql.SimpleQuote(rate/100.0)),&#xA;        tenor, calendar,&#xA;        coupon_frequency, bussiness_convention,&#xA;        day_count,&#xA;        ql.Euribor3M()))&#xA;&#xA;rate_helpers = swap_helpers&#xA;yc_linearzero = ql.PiecewiseLinearZero(calc_date,rate_helpers,day_count)&#xA;yc_cubiczero = ql.PiecewiseCubicZero(calc_date,rate_helpers,day_count)&#xA;&#xA;max_maturity = 40*12&#xA;&#xA;splz = get_spot_rates(yc_linearzero, day_count, months=max_maturity + 1)&#xA;spcz = get_spot_rates(yc_cubiczero, day_count, months=max_maturity + 1)&#xA;&#xA;max_rate = swap_rates[-1]&#xA;min_rate = min(splz.Curve)&#xA;max_rate = max(splz.Curve)&#xA;&#xA;&quot;&quot;&quot;Plotting&quot;&quot;&quot;&#xA;plt.plot(splz[&quot;Maturities&quot;],splz[&quot;Curve&quot;],'--', label=&quot;LinearZero&quot;)&#xA;plt.plot(spcz[&quot;Maturities&quot;],spcz[&quot;Curve&quot;],label=&quot;CubicZero&quot;)&#xA;plt.xlabel(&quot;Years&quot;, size=12)&#xA;plt.ylabel(&quot;Zero Rate&quot;, size=12)&#xA;plt.xlim(0,max_maturity/12.0)&#xA;plt.ylim([min_rate * 0.9,max_rate * 1.1])&#xA;plt.legend()&#xA;&#xA;plt.show()&#xA;&#xA;rows = zip(splz.Maturities,splz.Curve)&#xA;&#xA;with open('OISBootstrap.csv','w',newline='') as f:&#xA;    writer = csv.writer(f)&#xA;    for row in rows:&#xA;        writer.writerow(row)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Anyone with Python and QL can run the whole thing and see the results, but for example I'm getting the following values for the last five Maturities: 15.2361111111, 20.3111111111, 25.3777777778, 30.45, 40.5972222222 instead of 15, 20, 25, 30, and 40.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance for what I assume is a pretty newb question.&lt;/p&gt;&#xA;" OwnerUserId="25245" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-11-19T17:55:38.547" Title="QuantLib Python Swap Yield Curve Bootstrapping Dates and Maturities" Tags="&lt;swaps&gt;&lt;yield-curve&gt;&lt;python&gt;&lt;quantlib&gt;&lt;bootstrapping&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31075" PostTypeId="1" AcceptedAnswerId="31076" CreationDate="2016-11-19T09:34:13.423" Score="0" ViewCount="3841" Body="&lt;p&gt;How to properly calculate negative ROIs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am just wanting to calculate very simple ROIs, which could be very negative, but it doesn't seem to work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wikipedia defines ROI as this formula:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;return on investment = (gain from investment – cost of investment) /&#xA;  cost of investment&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This doesn't seem to work right for negative numbers, for exmaple:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I spend 24.00 and make 2.00 my calculation would be:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(2-24) / 24 = -91.67%&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This doesn't make sense to me, seeing as the total amount I lost was 22 which is 1000% of 2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope someone can help explain what I am misunderstanding, or if there is a better way to work with negative ROI.&lt;/p&gt;&#xA;" OwnerUserId="25342" LastActivityDate="2016-11-19T11:18:15.980" Title="How to Calculate a Negative ROI?" Tags="&lt;finance&gt;&lt;mathematics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31076" PostTypeId="2" ParentId="31075" CreationDate="2016-11-19T11:07:52.933" Score="0" Body="&lt;p&gt;You made a 91.67 % loss. 91.67 percent of 24 being 22.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ROI = -91.67 %&lt;/p&gt;&#xA;" OwnerUserId="7178" LastEditorUserId="7178" LastEditDate="2016-11-19T11:18:15.980" LastActivityDate="2016-11-19T11:18:15.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31077" PostTypeId="1" CreationDate="2016-11-19T15:20:37.423" Score="2" ViewCount="79" Body="&lt;p&gt;What do traders use volatility for if they are not interested in the option space?&#xA;Are there volatility patterns that can predicts future movements of asset prices?&lt;/p&gt;&#xA;" OwnerUserId="25345" LastActivityDate="2016-11-19T16:01:21.123" Title="How is volatility relevant for trading outside of options markets?" Tags="&lt;volatility&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31078" PostTypeId="2" ParentId="31077" CreationDate="2016-11-19T15:37:27.227" Score="2" Body="&lt;p&gt;Yes, when volatility goes up, it is a signal that asset prices are going to be more volatile. Seriously, that is a useful piece of information.  If you want to take a certain amount of risk, you will need to reduce your positions.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-11-19T15:37:27.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31079" PostTypeId="2" ParentId="31077" CreationDate="2016-11-19T16:01:21.123" Score="2" Body="&lt;p&gt;If you measure volatility as the standard deviation of (rate of) returns, it is immensely important in a whole host of methods for financial analysis. It's primarily used as a measure of risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g., when doing portfolio optimization, in context of modern portfolio theory, this is taken to the next level where co-variance of each asset's rate of return is aggregated into a single portfolio variance. Remember that variance is simply the standard deviation squared, i.e., &quot;volatility&quot; squared. This is then combined with the expected return (mean of rates of return) of the portfolio, making it possible to optimize the allocation of your capital such that you get the lowest risk (i.e., volatility) given a required minimum return, or best return given a maximum level of risk (i.e., volatility). If you'd like to know more, I wrote about it in &lt;a href=&quot;http://blog.andersen.im/2012/06/modern-portfolio-theory/&quot; rel=&quot;nofollow noreferrer&quot;&gt;this blog post&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the past volatility, as the standard deviation or returns, was also used a lot for value-at-risk calculations, but is now frowned upon as it assumes that returns are normally distributed. In essence you measure the standard deviation of the rate of returns, and use this statistically to say how much you stand to lose (or more) given a probability, say 5%. Example output of such an analysis would be: &quot;With the proposed portfolio X, there is a 5% chance of losing more than 10% within the next month&quot;. Today you would use other methods, like Monte Carlo simulations, to get better VaR estimates.&lt;/p&gt;&#xA;" OwnerUserId="2792" LastActivityDate="2016-11-19T16:01:21.123" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31080" PostTypeId="1" CreationDate="2016-11-19T16:32:25.980" Score="1" ViewCount="1168" Body="&lt;p&gt;I am preparing for an interview on Monday and I came across a practice question which has me stumped.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;The implied volatility of a 1 year option is 20% and the implied volatility of a 2 year option on the same underlying is trading at 10%. Estimate the implied volatility of a one year option forward starting in 1 year.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Its basically asking, &quot;what is the annualized volatility the market expects for the second year?&quot; correct? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can't just do $\frac{0.2 + x}{2} = 0.1$ because volatilities are not additive correct? So we have to convert to variances first. So now its $\frac{0.04 + x}{ 2} = 0.01$, which doesn't make any sense.&lt;/p&gt;&#xA;" OwnerUserId="24628" LastEditorDisplayName="user16651" LastEditDate="2016-11-20T08:10:06.420" LastActivityDate="2016-12-21T03:51:34.880" Title="Forward-Start Option Implied Volatility" Tags="&lt;options&gt;&lt;volatility&gt;&lt;pricing&gt;&lt;variance&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31081" PostTypeId="2" ParentId="31080" CreationDate="2016-11-19T17:33:04.897" Score="0" Body="&lt;p&gt;Yup, the issue is that with your implied volatility structure, the options with longer maturity are cheaper than the ones with shorter maturity - try checking this with your Black Scholes formula. This implies calendar arbitrage, you should short the shorter one and go long with the longer maturity option.&#xA;The implied forward variance is actually negative in your example, your calculations are correct.&lt;/p&gt;&#xA;" OwnerUserId="25315" LastActivityDate="2016-11-19T17:33:04.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31082" PostTypeId="2" ParentId="31073" CreationDate="2016-11-19T17:55:38.547" Score="4" Body="&lt;p&gt;15 years does correspond to t=15.236 according to the day counter you told the curve to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, you can't get exactly 15 anyway.  Your calculation date is September 1st, 2016; according to the usual conventions, the swap whose rate you're quoting starts spot, that is, two business days after the calculation date. Given the weekend (your calculation date is a Thursday) and the holiday on Labor Day (September 4th) this lands you on September 6th.  Thus, the 15-years swap would have its maturity on September 6th, 2031; but that's a Saturday, so it rolls to September 8th, 2031 (also, your input maturity is September 10th, so you might want to check that, too).  That's 15 years &lt;em&gt;and a week&lt;/em&gt; after your calculation date, which is also t=0 for your curve (since you're passing it to its constructor as reference date).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second: you're passing to the curve a day count convention of Actual/360, for which one year doesn't correspond to 1, but to 365/360=1.01389 (or 366/360 on a leap year).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Putting all together, you get that the 5485 days between the calculation date and the maturity of the 15 years swap correspond to 5485/360=5.23611.&#xA;Similar calculations apply to the other maturities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using Actual/365 (Fixed) gives results closer to what you would expect, since it corresponds to t=1 for a &quot;regular&quot; year; but since leap years correspond to 366/365, you still get t=5485/365=15.0274.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other day counters have better properties for calculating rates (for instance, Act/Act gives you t=1 for 1 year) but I don't advise using them in term structures, since they lack other properties; for instance, there exist pairs of dates $d_1$ and $d_2$ for which the time $T(d_1,d_2)$ between them is 0, or triples $d_1$, $d_2$, $d_3$ for which $T(d_1,d_3) \neq T(d_1,d_2) + T(d_2,d_3)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I suggest instead is that you work with dates directly.  In your &lt;code&gt;get_spot_rates&lt;/code&gt;function, instead of trying to recalculate the maturity dates as &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;d = calendar.advance(ref_date, ql.Period(int(yrs*365.25), ql.Days))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;call &lt;code&gt;yieldcurve.nodes()&lt;/code&gt;, which gives you the list of pairs (date,rate) corresponding to each maturity.  You can use those dates in the call to &lt;code&gt;equivalentRate&lt;/code&gt;, as you already do, and also in the call to &lt;code&gt;yieldcurve.zeroRate&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(And by the way, &lt;code&gt;calendar.advance(ref_date, 365, Days)&lt;/code&gt; doesn't do what you think. It advances the date by 365 &lt;em&gt;business&lt;/em&gt; days, which is a lot more than one year.)&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2016-11-19T17:55:38.547" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31083" PostTypeId="2" ParentId="31071" CreationDate="2016-11-19T18:29:46.243" Score="1" Body="&lt;p&gt;If you keep a delta-hedged portfolio $\pi$, your position looks like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\pi=-C+\Delta S$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and it is worth $\pi$. If you get more money for selling call option that is needed for buying underlying to hedge, you invest it in the risk free money market account. If the money proceeds from selling the call option are not enough to buy the underlying, you borrow from the money market account at the risk free rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it is hedged it has no risk, so it should earn the risk free rate, so overnight you earn what portfolio was worth the day before times risk free rate:&#xA;$\pi (e^{r/365}-1)=(-C+\Delta S)(e^{r/365}-1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equation from the reading (with extra change in the price of option and stock) assumes that your portfolio was not delta-neutral and the hedging was not effective - this happens when the moves in the underlying are large overnight. So effectively the equation from the reading is OK.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is very well explained in Steven Shreve: Stochastic Calculus for Finance I, in the first chapters.&lt;/p&gt;&#xA;" OwnerUserId="25315" LastActivityDate="2016-11-19T18:29:46.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31084" PostTypeId="2" ParentId="30095" CreationDate="2016-11-19T20:25:07.507" Score="3" Body="&lt;p&gt;A lot of designated liquidity providers/market maker are exempt from FTT as authorities rightly believe markets would become less liquid without them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So HFT trading firms just decide to call themselves market makers and do some arbitary liquidity providing role to give them a free pass to carry on with their other strategies tax free. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is the normal investor, small trader that will feel the pain of a financial transaction tax.&lt;/p&gt;&#xA;" OwnerUserId="25348" LastEditorUserId="-1" LastEditDate="2018-12-29T10:47:12.827" LastActivityDate="2018-12-29T10:47:12.827" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="31085" PostTypeId="1" AcceptedAnswerId="31086" CreationDate="2016-11-19T20:44:45.703" Score="1" ViewCount="4400" Body="&lt;p&gt;My prof asked me to make an Variance-Ratio test for overlapping as well as for non-overlapping returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the difference between overlapping and non-overlapping? &lt;/p&gt;&#xA;" OwnerUserId="25350" LastActivityDate="2016-11-19T21:01:05.690" Title="What is the difference between overlapping and non overlapping returns" Tags="&lt;variance&gt;&lt;log-returns&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2016-11-20T10:11:04.503" ContentLicense="CC BY-SA 3.0" />
  <row Id="31086" PostTypeId="2" ParentId="31085" CreationDate="2016-11-19T20:55:36.370" Score="5" Body="&lt;p&gt;An example of non-overlapping one month returns: the return in January, the return in February, the return in March, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example of overlapping 30 day returns: the return from January 1 to January 30, the return from January 2 to January 31, the return from January 3 to February 1, the return from January 4 to February 2, and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are far fewer non-overlapping returns than overlapping returns. The non-overlapping returns are statistically independent of each other, the overlapping are not. If you are going to use overlapping returns you must use specific statistical procedures that are designed to take the dependencies into account.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-11-19T21:01:05.690" LastActivityDate="2016-11-19T21:01:05.690" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31088" PostTypeId="1" AcceptedAnswerId="31090" CreationDate="2016-11-20T10:07:30.060" Score="0" ViewCount="256" Body="&lt;p&gt;Let $N_t$ be a Poisson process with intensity $\lambda&amp;gt;0$ and $S_t$ follows a pure jump process&#xA;$$dS_t=S_t(J_t-1)dN_t$$&#xA;where $J_t$ is the jump size variable if $N_t$ jumps at time $t$. Also, assume $J_t$ follows a lognormal distribution such that&#xA;$\ln{ J_t}\sim N(\mu_j,\sigma_j^2)$ and $J_t$ is also independent of $N_t$ . How can we find $Var(S_T| S_t)$ ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any hint.&lt;/p&gt;&#xA;" OwnerUserId="20945" LastEditorUserId="467" LastEditDate="2016-11-20T14:51:53.907" LastActivityDate="2016-11-20T21:48:22.247" Title="How to compute the conditional variance of this jump process?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;jump&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31090" PostTypeId="2" ParentId="31088" CreationDate="2016-11-20T13:02:43.547" Score="5" Body="&lt;p&gt;&lt;strong&gt;Hint:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By application of Extended Ito's lemmma, we have&#xA;$$d(\ln S_t)=\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{n}\left(\frac{dS_t}{S_{t^-}}\right)^n\tag 1$$&#xA;Note $S_{t^-}$ denote the value of $S_t$ before a jump event. We know $d[N_t,N_t]=dN_t$, thus&#xA;$$d(\ln S_t)=\sum_{n=1}^{\infty}\frac{(-1)^{n+1}}{n}(J_t-1)^n=\left(\ln{J_t} \right)dN_t\tag 2$$&#xA;By taking integrals on $[t,T]$, we have&#xA;$$\int_{t}^{T}d(\ln S_u)=\int_{t}^{T}\left(\ln{J_u} \right)dN_u\tag 3$$&#xA;therefore&#xA;$$\ln\left(\frac{S_T}{S_t}\right)=\sum_{n=1}^{N_{T-t}}\ln J_n\tag 4$$&#xA;in other words&#xA;$$S_T=S_t\prod_{n=1}^{N_{T-t}}J_n\tag 5$$&#xA;Note $J_n \in (0, 2]$ is the jump size occurring at time instant $t_n$. Also   $N_{T-t}=N_T-N_t$ is the total number of jumps in the time interval $(t,T]$. Since $\ln J_n\sim \mathcal{N}(\mu_J,\sigma^2_J)$ are independent and identically distribute, $\ln S_T=\ln S_t+\sum_{n=1}^{N_{T-t}}\ln J_n$ follows a normal distribution.Now apply equation $(5)$&#xA;$$\text{Var}\left(S_T\Big{|}S_t\right)=\text{Var}\left(S_t\prod_{n=1}^{N_{T-t}}J_n\Big{|}S_t\right)=S_t^2\,\text{Var}\left(\prod_{n=1}^{N_{T-t}}J_n\right)\\=S_t^2\,\text{Var}\left(\exp\left(\sum_{n=1}^{N_{T-t}}\ln J_n\right)\right)\\&#xA;$$&#xA;then&#xA;$$\text{Var}\left(S_T\Big{|}S_t\right)=S_t^2\left(\underbrace{\mathbb{E}\left[\exp\left(\sum_{n=1}^{N_{T-t}}\ln J_n^2\right)\right]}_{I}-\underbrace{\mathbb{E}\left[\exp\left(\sum_{n=1}^{N_{T-t}}\ln J_n\right)\right]^2}_{J}\right)\tag 6$$&#xA;Note&#xA;$$I=\mathbb{E}\left[\mathbb{E}\left[\exp\left(\sum_{n=1}^{N_{T-t}}\ln J_n^2\right)\right]\Big{|}N_{T-t}\right]=\exp\left(\lambda(T-t)(E[J_t^2]-1)\right)\\I=\exp\left(\lambda(T-t)e^{2\mu_J+2\sigma_J^2}-\lambda(T-t)\right)\tag 7$$&#xA;similarly&#xA;$$J=\mathbb{E}\left[\mathbb{E}\left[\exp\left(\sum_{n=1}^{N_{T-t}}\ln J_n\right)\right]\Big{|}N_{T-t}\right]^2=\exp\left(2\lambda(T-t)e^{\mu_J+\frac 12\sigma_J^2}-2\lambda(T-t)\right)\tag 8$$&#xA;$(6)$, $(7)$ and $(8)$&#xA;$$\color{red}{\text{Var}\left(S_T\Big{|}S_t\right)=S_t^2\exp\left(\lambda(T-t)e^{2\mu_J+2\sigma_J^2}-\lambda(T-t)\right)\\\qquad\qquad\quad\quad -S_t^2\exp\left(2\lambda(T-t)e^{\mu_J+\frac 12\sigma_J^2}-2\lambda(T-t)\right)}$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-11-20T16:21:27.870" LastActivityDate="2016-11-20T16:21:27.870" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="31092" PostTypeId="2" ParentId="8882" CreationDate="2016-11-20T18:18:17.163" Score="1" Body="&lt;p&gt;Hi there not sure if this is what you mean but the paper below is a bit of a classic in the field. The framework essentially allows for characterisation of the bilateral problem as an asset side CVA and symmetric FVA, both driven by first to default intensities once you realise that the DVA 'benefit' and funding cost essentially have the same 'bank defaults first' probability driving them (under some simplifying assumptions at least). So the FTD nature allows a bilateral treatment. The exposition I find very clear in the paper, the best bit being the intuitive integrals derived via feynman kac after the usual PDE treatment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.defaultrisk.com/pa_crdrv_08.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.defaultrisk.com/pa_crdrv_08.htm&lt;/a&gt;&#xA;Burgard, Christoph, Mats Kjaer, &quot;Partial Differential Equation Representations of Derivatives with Bilateral Counterparty Risk and Funding Costs&quot;, Journal of Credit Risk, Vol. 7, No. 3, (Fall 2011), pp. 75–93.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OOPS - didn't realise how old the question was, sorry, no doubt completely answer completely irrelevant / superfluous now!&lt;/p&gt;&#xA;" OwnerUserId="19239" LastActivityDate="2016-11-20T18:18:17.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31093" PostTypeId="1" AcceptedAnswerId="31098" CreationDate="2016-11-20T21:22:41.357" Score="0" ViewCount="132" Body="&lt;p&gt;I am working on a personal loan dataset. For each loan, we recorded its credit status monthly after it was drawn by the borrower. Let's say there were 6 status coded by A-F. My project is to use Markov chain model to train the data and estimate the transition matrix as shown below. Then we can predict the future movement of any single loan in probability.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Meanwhile, the dataset contained substantial features for a single loan, like loan amount, borrower age, income, dwelling region, bank account profile, last 90 days bank statement data, some other credit bureau data etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just get this project from the very beginning and all thoughts are rough but not accurate. I need brain storm. Thanks heaps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I use the data properly to predict the next state given the current state? Any assumption should be seriously considered in this project and any advice or experiance for me? I will do it in Python and/or R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/BdRAl.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/BdRAl.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="25292" LastEditorUserId="21023" LastEditDate="2016-11-21T19:20:32.150" LastActivityDate="2017-03-21T22:44:17.313" Title="Markov chain downgrades in loan book modelling" Tags="&lt;programming&gt;&lt;python&gt;&lt;machine-learning&gt;&lt;data-mining&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31094" PostTypeId="1" AcceptedAnswerId="31097" CreationDate="2016-11-20T21:44:59.937" Score="-1" ViewCount="8365" Body="&lt;p&gt;I am trying to make a histogram in numpy but numpy.histogram seems to really hate NaN values. I have tried removing NaN values from a list called data in three different ways and Quantopian doesn't let me use any of those three ways:&#xA;1.) TypeError: only integer arrays with one element can be converted to an index&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;data = data[~np.isnan(data)]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;2.) So then I tried using pandas.dropna() and it threw:&#xA;ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;datapd = pd.Series(data)&#xA;hist, bins = np.histogram(datapd.dropna(), density=True, bins = 'auto')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;3.) And when that didn't work I tried removing them on my own:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;i = 0&#xA;    while(i &amp;lt; len(y)):&#xA;        if(float('nan') == y[i]):&#xA;            y[i] = 0&#xA;        i = i + 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It threw the same error:  ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do you remove NaN values in quantopian? I tried these methods in a python console and it worked I have no clue as to why it wouldn't work in quantopian.&lt;/p&gt;&#xA;" OwnerUserId="25366" LastActivityDate="2016-11-21T00:00:34.330" Title="Removing NaN Values in Python Quantopian" Tags="&lt;python&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31095" PostTypeId="2" ParentId="31088" CreationDate="2016-11-20T21:48:22.247" Score="1" Body="&lt;p&gt;Alternatively, let $\{\tau_i\}_{i=1}^{\infty}$ be the jump time of the Poisson process $N$. Moreover, let &#xA;\begin{align*}&#xA;X_t  = \int_0^t (J_s-1)dN_s.&#xA;\end{align*}&#xA;Here, we assume that the jump sizes $J(\tau_i)$, for $i=1, \ldots, \infty$, are independent identically distributed. Then,&#xA;\begin{align*}&#xA;X_t  &amp;amp;= \sum_{0&amp;lt;s\le t}(J_s-1)1_{\Delta N(s) &amp;gt;0}.&#xA;\end{align*}&#xA;Note that&#xA;\begin{align*}&#xA;dS_t = S_{t-} dX_t,&#xA;\end{align*}&#xA;whose solution is the Doleans-Dade exponential, that is,&#xA;\begin{align*}&#xA;S_t &amp;amp;= S_0 \prod_{0 &amp;lt; s \le t} (1+ \Delta X_s)\\&#xA;&amp;amp;=S_0 \prod_{0 &amp;lt; s \le t} J_s 1_{\Delta N(s) &amp;gt;0}\\&#xA;&amp;amp;=S_0\prod_{i=1}^{N_t}J(\tau_i).&#xA;\end{align*}&#xA;For $T&amp;gt;t \ge 0$,&#xA;\begin{align*}&#xA;S_T &amp;amp;= S_t \prod_{i=N_t+1}^{N_T}J(\tau_i)\\&#xA;&amp;amp;= S_t \prod_{i=1}^{N_T-N_t}J(\tau_i) \quad \text{(in distribution)}\\&#xA;&amp;amp;= S_t \prod_{i=1}^{N_{T-t}}J(\tau_i) \quad \text{(in distribution)}.&#xA;\end{align*}&#xA;The remaining is the same as that of @Behrouz Maleki above.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-11-20T21:48:22.247" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31096" PostTypeId="1" CreationDate="2016-11-20T23:12:42.603" Score="0" ViewCount="192" Body="&lt;p&gt;I am looking to connect my trading models to trade in IB. my models are R based.&#xA;what is the best (and fastest) way to create a system that get data from IB and based on this data create trades in IB.&#xA;I looked everywhere and the only thing that i found that might be helpful is the IBrokers package but it is possible only to get data and not to place orders.&#xA;I know that IB API use mainly java but I am not familiar with java so I prefer to do everything in R if this is possible.&#xA;Thanks, &lt;/p&gt;&#xA;" OwnerUserId="17585" LastActivityDate="2019-02-04T20:43:42.263" Title="What is the best way to connect R with IB?" Tags="&lt;programming&gt;&lt;interactive-brokers&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31097" PostTypeId="2" ParentId="31094" CreationDate="2016-11-21T00:00:34.330" Score="2" Body="&lt;p&gt;In general you should probably have a look at the following answers:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/a/13434501/604048&quot;&gt;https://stackoverflow.com/a/13434501/604048&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://stackoverflow.com/a/24489602/604048&quot;&gt;https://stackoverflow.com/a/24489602/604048&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;However, I'd like to address number 3. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You should use &lt;code&gt;numpy&lt;/code&gt; to check for &lt;code&gt;NaN&lt;/code&gt;s, not use the equals operator. &lt;code&gt;np.isnan(...)&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;You shouldn't use a &lt;code&gt;while&lt;/code&gt; loop. It's very unpythonic.&lt;/li&gt;&#xA;&lt;li&gt;Your if statement shouldn't have a parenthesis.&lt;/li&gt;&#xA;&lt;li&gt;The indentation of &lt;code&gt;while&lt;/code&gt; part should make this script fail.&lt;/li&gt;&#xA;&lt;li&gt;Remember you're working with rows. You shouldn't get the ambiguous truth value error if your code was implemented the way you showed. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Maybe you wrote something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;i = 0&#xA;while(i &amp;lt; len(y)):&#xA;    if np.isnan(y[i]):&#xA;        y[i] = 0&#xA;    i = i + 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This produces:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What is happening here is that the if statement gets a list of bools, and doesn't know what to do with it. Is it true when all of them are true? Or, is it true when any of them are true? You could resolve it as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;i = 0&#xA;while(i &amp;lt; len(y)):&#xA;    if np.isnan(y[i]).any():&#xA;        y[i] = 0&#xA;    i = i + 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or more pythonic:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for i in range(0, len(y)):&#xA;    if np.isnan(y[i]).any():&#xA;        y[i] = 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also be careful about the zero assignment. I don't know how pandas data frames are implemented, but typically with normal collection types you'd be replacing a row with the number zero (0).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we weren't working with special pandas data frames, and it was simply lists I'd go for:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;y = [row for row in y if not np.isnan(row).any()]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;... if you wanted to delete a row with any &lt;code&gt;NaN&lt;/code&gt; values. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or, if you simply want to set any element which is &lt;code&gt;NaN&lt;/code&gt; to zero:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;y = [[0 if np.isnan(elm) else elm for elm in row] for row in y]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With test data:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import numpy as np&#xA;y = [[0,0],[1,1],[2,float('nan')],[3,3]]&#xA;print(y)&#xA;x = [row for row in y if not np.isnan(row).any()]&#xA;print(x)&#xA;z = [[0 if np.isnan(elm) else elm for elm in row] for row in y]&#xA;print(z)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This produces the following output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[[0, 0], [1, 1], [2, nan], [3, 3]]&#xA;[[0, 0], [1, 1], [3, 3]]&#xA;[[0, 0], [1, 1], [2, 0], [3, 3]]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2792" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2016-11-21T00:00:34.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31098" PostTypeId="2" ParentId="31093" CreationDate="2016-11-21T00:51:33.697" Score="0" Body="&lt;p&gt;I answered a very similar question on another stack in response to a question about difficulties with an R package. I'm posting the link here - I think it will give you a path forward.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stats.stackexchange.com/questions/233851/multi-state-numerical-overflow-using-msm-package-in-r/239988#239988&quot;&gt;https://stats.stackexchange.com/questions/233851/multi-state-numerical-overflow-using-msm-package-in-r/239988#239988&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6139" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2016-11-21T00:51:33.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31099" PostTypeId="2" ParentId="31080" CreationDate="2016-11-21T02:56:26.300" Score="3" Body="&lt;p&gt;The answer given above is probably the intended answer to the interview question.  However it is not the whole story.  Suppose the 1yr and 2yr options are both at the money and struck at usd100 (and that there are no dividends and interest rates are zero, to make things simple).  Then if the options are priced at 20% and 10% respectively, the implied price of a usd100 call one year forward, is negative (an arbitrage, as stated).   However, the price of a 'then at the money' 1yr option whose strike is determined 1yr from now, cannot be determined from the information we have.   One cannot replicate this option using usd100 calls of 1yr and 2yr maturities.  I would answer the question by saying that the forward option will be cheap, since we can replicate all the usd100 options we want for nothing, but there is a chance that the stock will be at usd200 by then , and we have no way to lock in the volatility of a 1yr usd 200 call at that time.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-11-21T02:56:26.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31101" PostTypeId="2" ParentId="31064" CreationDate="2016-11-21T13:34:07.037" Score="2" Body="&lt;p&gt;I have solved it myself. The key was to realize that for $X \geq 0$ and $S_X(t) = \mathbb{P}(X&amp;gt;t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \int_0^\infty S(t) dt = \int_0^1 F_X^{-1}(u) du  = \mathbb{E}\left[X \right].$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is elegantly explained in &lt;a href=&quot;https://stats.stackexchange.com/questions/18438/does-a-univariate-random-variables-mean-always-equal-the-integral-of-its-quanti&quot;&gt;Characterization of $\mathbb{E}$&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now this relationship can be extended for the whole real line, thus &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \int_0^1 F_X^{-1}(u) du = \int_0^\infty S_X(t) dt + \int_{-\infty}^0 S_X(t) -1 dt$$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rest of the proof is a matter of changing the variables in the indicator functions and considering the two cases of (a) $S_X(t) \geq 1-\alpha$ and (b) $S_X(t) \leq 1-\alpha$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a direct calculation @CaffeRistretto tipp was very helpful. So it is best to start with the definition of CVaR and work towards the distortion function. &lt;/p&gt;&#xA;" OwnerUserId="25331" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2016-11-21T13:34:07.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31103" PostTypeId="2" ParentId="23016" CreationDate="2016-11-21T14:08:46.923" Score="1" Body="&lt;p&gt;There is actually a proof by Gzyl and Mayoral that relates certain distortion risk measures, namely the coherent ones to spectral risk measures. &#xA;See &lt;a href=&quot;https://mpra.ub.uni-muenchen.de/916/1/MPRA_paper_916.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Spectral and Distortion Risk&lt;/a&gt; for details. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So yes for a large class of well known risk measures they are essentially the same. As pointed out this relationship does not hold for non-coherent risk measures. &lt;/p&gt;&#xA;" OwnerUserId="25331" LastActivityDate="2016-11-21T14:08:46.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31104" PostTypeId="1" CreationDate="2016-11-21T15:18:37.763" Score="0" ViewCount="5382" Body="&lt;p&gt;is there anyone who can explain the concept of spread duration, both from a mathematical point of view and an intuitive one? Providing a practical example would be highly appreciated. Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="22470" LastActivityDate="2016-11-24T01:07:08.670" Title="Definition of spread duration" Tags="&lt;fixed-income&gt;&lt;spread&gt;&lt;duration&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31105" PostTypeId="1" CreationDate="2016-11-21T16:07:43.230" Score="1" ViewCount="210" Body="&lt;p&gt;I downloaded MSFT historical data from Yahoo Finance a year ago and re-downloaded it today again. I turns our the two datasets are different. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g., today I got Adj Close  of MSFT for &lt;code&gt;1986-03-19: 0.066604&lt;/code&gt;&#xA;In the dataset from a year ago, I got Adj Close  of MSFT for &lt;code&gt;1986-03-19: 0.068892&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These two numbers are very similar but not the same. Other numbers changed, too.  What's the reason for this change of historical data?&lt;/p&gt;&#xA;" OwnerUserId="25376" LastEditorUserId="467" LastEditDate="2016-11-23T09:42:29.433" LastActivityDate="2016-11-23T09:42:29.433" Title="Why are Yahoo's &quot;Adj closed&quot; data changing over time?" Tags="&lt;market-data&gt;&lt;historical-data&gt;&lt;yahoo&gt;&lt;yahoofinance&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31106" PostTypeId="2" ParentId="26078" CreationDate="2016-11-21T16:27:30.613" Score="4" Body="&lt;p&gt;This is not something you will want to hear, but most free websites have licensing issues and display limited or no download links for S&amp;amp;P and DJI.&#xA;I recommend you use quantdl or stooq instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are some stooq download links:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;DJI:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;https://stooq.com/q/d/l/?s=^dji&amp;amp;i=d&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;S&amp;amp;P: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;https://stooq.com/q/d/l/?s=^spx&amp;amp;i=d&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You do need to clean up the data before you use it though. S&amp;amp;P data goes all the way back to 1789 and DJI goes back to 1896, so I don't even know if it is possible... I wouldn't trust any data before 1960 on any website.&lt;/p&gt;&#xA;" OwnerUserId="19508" LastEditorUserId="19508" LastEditDate="2016-11-22T03:28:04.527" LastActivityDate="2016-11-22T03:28:04.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31107" PostTypeId="1" CreationDate="2016-11-21T16:58:09.310" Score="1" ViewCount="1100" Body="&lt;p&gt;The author of my textbook says that the $\Delta$ of a call on a futures contract is $N(d_1)$ and not $e^{-rT}N(d_1)$. I wasn't convinced, so I tried to prove this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $F = F_{0, T}(S) = S_0e^{(r - \delta)T}$ and consider a call on a futures contract on a stock $S$ \begin{align}C(F, K, \sigma, r, T, \delta) &amp;amp;= Fe^{-rT}N(d_1) - Ke^{-rT}N(d_2)\\&#xA; &amp;amp;= S_0e^{(r - \delta)T}e^{-rT}N(d_1) - Ke^{-rT}N(d_2)\end{align} and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{\partial C}{\partial S} = e^{-\delta T}N(d_1) + S_0e^{-\delta T}N'(d_1) - Ke^{-rT}N'(d_2).$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's relate $\frac{d_1^2}{2}$ and $\frac{d_2^2}{2}$. We know that $d_2 = d_1 - \sigma\sqrt{T}$. So \begin{align*}d_2^2 &amp;amp;= d_1^2 + \sigma^2T - 2d_1\sigma\sqrt{T}\\ &amp;amp;= d_1^2 + \sigma^2T - 2[\ln(F) - ln(K) + (r - r + 0.5\sigma^2)T]\\ &amp;amp;= d_1^2 - 2\ln(F) + 2\ln(K).\end{align*} Then $$\frac{d_2^2}{2} = \frac{d_1^2}{2} - \ln(F) + \ln(K).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now \begin{align*}N'(d_1) &amp;amp;= \frac{e^{-d_1^2/2}}{\sqrt{2\pi}}\\ &amp;amp;= \frac{e^{-d_2^2/2 - \ln(F) + \ln(K)}}{\sqrt{2\pi}}\\ &amp;amp;= \frac{Ke^{-d_2^2/2}}{F\sqrt{2\pi}}\end{align*} and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$N'(d_2) = \frac{e^{-d_2/2}}{\sqrt{2\pi}}$$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence \begin{align*}\frac{\partial C}{\partial S} &amp;amp;= e^{-\delta T}N(d_1) + \frac{S_0e^{-\delta T}e^{-d_2^2/2}\cdot K}{S_0 e^{(r - \delta)T}\sqrt{2\pi}} - Ke^{-rT}\frac{e^{-d_2^2/2}}{\sqrt{2\pi}}\\ &amp;amp;= e^{-\delta T}N(d_1) + \frac{Ke^{-rT}}{\sqrt{2\pi}} - \frac{Ke^{-rT}}{\sqrt{2\pi}}\\ &amp;amp;= e^{-\delta T} N(d_1).\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I missing here?&lt;/p&gt;&#xA;" OwnerUserId="5641" LastActivityDate="2017-02-20T17:51:43.717" Title="Proving that the $\Delta$ of a call on a futures contract under the B-S model is $N(d_1)$" Tags="&lt;black-scholes&gt;&lt;greeks&gt;&lt;self-study&gt;&lt;proof&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31109" PostTypeId="1" AcceptedAnswerId="31110" CreationDate="2016-11-21T20:12:27.323" Score="1" ViewCount="490" Body="&lt;p&gt;I have two questions about Ito's Lemma with respect to calculating SDEs. The examples are simple enough, but I haven't found an answer yet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take $W_t$ as a standard Brownian motion and $g(s)$ as some function of $s$. Assume that all regularities etc. are fulfilled and take $F$ as some function. I know that if $F = \int_0^tg(s)dW_s$, then the corresponding SDE is $dF = g(t)dW_t$. However, applying  Ito's Lemma, I'm not sure how this SDE is derived. I am unsure about the next part:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$dF = \underbrace{\frac{\partial F}{\partial t}}_{=g(t)dW_t}dt + \underbrace{\frac{\partial F}{\partial W_t}}_{=g(t)}dW_t + \underbrace{\frac{1}{2}\frac{\partial^2 F}{\partial W_t^2}}_{=0}dt = g(t)dW_tdt + g(t)dW_t = g(t)dW_t$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question 1:&lt;/strong&gt; is $\frac{\partial F}{\partial t} = g(t)dW_t$ correct? Or should this be zero?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now take $F=\int_0^tW_s^2dW_s$. My approach would be:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$dF = \underbrace{\frac{\partial F}{\partial t}}_{=W_t^2dW_t}dt + \underbrace{\frac{\partial F}{\partial W_t}}_{=W_t^2}dW_t + \underbrace{\frac{1}{2}\frac{\partial^2 F}{\partial W_t^2}}_{=W_t}dt = W_t^2dW_t+W_tdt$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question 2:&lt;/strong&gt; Are the partial derivatives in the above example correct?&lt;/p&gt;&#xA;" OwnerUserId="25381" LastActivityDate="2016-11-21T21:41:07.580" Title="Stochastic differential equation of a Brownian Motion" Tags="&lt;stochastic-processes&gt;&lt;brownian-motion&gt;&lt;itos-lemma&gt;&lt;sde&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31110" PostTypeId="2" ParentId="31109" CreationDate="2016-11-21T21:21:52.530" Score="6" Body="&lt;p&gt;In stochastic calculus, only stochastic integrals are defined. The differential form is just a notation. That is, $$dF=g(t)dW_t$$ is just another expression for the integral $$F=\int_0^t g(s) dW_s.$$ See, for example, in &lt;a href=&quot;https://www.amazon.ca/Brownian-Stochastic-Calculus-Ioannis-Karatzas/dp/0387976558/ref=sr_1_fkmr0_1?ie=UTF8&amp;amp;qid=1479762873&amp;amp;sr=8-1-fkmr0&amp;amp;keywords=browninian+motion+and+stochastic+calculus&quot; rel=&quot;nofollow noreferrer&quot;&gt;this book&lt;/a&gt; or &lt;a href=&quot;https://www.amazon.ca/Stochastic-Integration-Differential-Equations-2005-05-24/dp/B01JXV32BA/ref=sr_1_4?ie=UTF8&amp;amp;qid=1479764411&amp;amp;sr=8-4&amp;amp;keywords=protter&quot; rel=&quot;nofollow noreferrer&quot;&gt;this book&lt;/a&gt;, all Ito's lemmas are expressed in integral forms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your question, note that $F$ is not a function of $t$ and $W_t$, that is, it is not of the form $F(t, W_t)$. In fact, it depends on the whole path of $W_s$ from $0$ to $t$. Then Ito's lemma can not be applied to $F$. The application for both of your questions are incorrect.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-11-21T21:41:07.580" LastActivityDate="2016-11-21T21:41:07.580" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31111" PostTypeId="1" CreationDate="2016-11-22T04:13:32.943" Score="0" ViewCount="572" Body="&lt;p&gt;How do you build a duration-neutral bond portfolio which is long convexity? can you give me an example?&lt;/p&gt;&#xA;" OwnerUserId="13433" LastActivityDate="2016-11-23T00:47:10.933" Title="Bond Duration hedging with long convexity" Tags="&lt;fixed-income&gt;&lt;hedging&gt;&lt;duration&gt;&lt;convexity&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31112" PostTypeId="2" ParentId="31111" CreationDate="2016-11-22T04:33:32.823" Score="1" Body="&lt;p&gt;I would say you can go&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Long a bond with a low coupon&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Short a bond with a higher coupon&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For instance current for US Treasury circa 10Y&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;2% 15NOV26, BPV 8.7265, Convx 89.9624&lt;/li&gt;&#xA;&lt;li&gt;1.5% 15AUG26, BPV 8.3071, Convx 87.9649&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Buy 1,000,000 of the 1.5% and Sell 951,939 of the 2% would give you positive convexity and 0 duration. Of course more extreme coupon differential will give you a much better convexity exposure.&lt;/p&gt;&#xA;" OwnerUserId="1181" LastEditorUserId="1181" LastEditDate="2016-11-23T00:09:51.697" LastActivityDate="2016-11-23T00:09:51.697" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31113" PostTypeId="1" CreationDate="2016-11-22T08:58:39.360" Score="0" ViewCount="88" Body="&lt;p&gt;I have financial time series and PCA scores, that I'm trying to cluster. As PCA scores don't have orientation, I would like to know what clustering method would be suitable for clustering these kind of series? I feel that -1 correlation series with my PCA scores is as important as +1 correlation and should be clustered together.&lt;/p&gt;&#xA;" OwnerUserId="19954" LastActivityDate="2016-11-22T08:58:39.360" Title="Time Series clustering" Tags="&lt;time-series&gt;&lt;cluster&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31114" PostTypeId="2" ParentId="9760" CreationDate="2016-11-22T10:13:27.153" Score="0" Body="&lt;p&gt;The risk free rate is not determined by the currency in use but rather by the credit worthiness of the issuer. As in Zimbabwe which has a bad track record of hyperinflation, but uses the USD, it comes down your expectation of being paid. For example Zimbabwe Treasury Bills for 2018 maturity are trading at 17c in the dollar, indicating what investors feel the worth is in two years time. Though in theory the interest rate on these bonds would indicate the risk free rate, it clearly in this case has no bearing on the risk itself if a Government is seen as potentially not paying. A good guide would be in the currency itself. If the USD is available on demand and foreign payments can be made without hindrance the rate will tend closer to the interest rate on Government bonds, however if there is a rate of more than 1:1 on the &quot;local USD&quot; then it would imply an additional risk to acknowledge. One would have to speak to a local to garner such detail.&lt;/p&gt;&#xA;" OwnerUserId="25385" LastActivityDate="2016-11-22T10:13:27.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31117" PostTypeId="2" ParentId="14184" CreationDate="2016-11-22T10:30:37.813" Score="1" Body="&lt;p&gt;It may be overkill, but you may find the following PhD thesis by &lt;a href=&quot;https://mediatum.ub.tum.de/doc/1165519/1165519.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Peter Hieber&lt;/a&gt; of some use.&lt;/p&gt;&#xA;" OwnerUserId="25387" LastActivityDate="2016-11-22T10:30:37.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31118" PostTypeId="1" AcceptedAnswerId="31121" CreationDate="2016-11-22T11:14:26.103" Score="3" ViewCount="313" Body="&lt;p&gt;There are liquid vanilla options trading on an index of 20 equity components.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is how to price an option on one of the index components, knowing that there are no options trading on that particular equity, hence no implied volatility available. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any market practice on how to estimate that implied volatility?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My way of doing it would be to estimate beta of the stock to that index, probably with the help of kalman filter, and manipulate beta to get &quot;implied&quot; volatility for the underlying. But maybe there is some better way? I don't want to use any metrics such as historical standard deviation etc. Arch model would be useful to predict &quot;true&quot; future volatility, but I would like to  have implied.&lt;/p&gt;&#xA;" OwnerUserId="25315" LastEditorUserId="19887" LastEditDate="2016-11-22T21:25:37.000" LastActivityDate="2018-07-11T09:19:47.547" Title="Estimating implied volatility of an index component with no vanilla options market" Tags="&lt;options&gt;&lt;volatility&gt;&lt;estimation&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31120" PostTypeId="2" ParentId="31107" CreationDate="2016-11-22T12:00:15.757" Score="1" Body="&lt;p&gt;You're correct - the delta in terms of futures contracts is discount factor * N(d1) for a European call-on-future.  Consider a zero-strike call as an example, the delta would be 1.0 multiplied by the discount factor.  Maybe the author meant to say the delta in terms of forward contracts is N(d1)?&lt;/p&gt;&#xA;" OwnerUserId="25390" LastActivityDate="2016-11-22T12:00:15.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31121" PostTypeId="2" ParentId="31118" CreationDate="2016-11-22T14:09:12.020" Score="6" Body="&lt;p&gt;There is no &lt;em&gt;standard&lt;/em&gt; approach to this problem to the best of my knowledge. Different approaches exist and each has its own pros and cons as usual. To mention a few:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Information-based methods&lt;/strong&gt;: these aim at &quot;risk-neutralising&quot; the distribution observed under the physical measure relying on some information criterion e.g. minimising the KL divergence, or relative entropy, between $\Bbb{P}$ and $\Bbb{Q}$. See &lt;a href=&quot;http://www.emanuelderman.com/media/strike_adjusted_spread.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Derman &amp;amp; Zou&lt;/a&gt;'s method for instance.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Econometric methods&lt;/strong&gt;: postulate and calibrate some ARCH/GARCH dynamics under $\Bbb{P}$ and translate it to some &quot;risk-neutral&quot; world $\Bbb{Q}$ (should be equivalent to directly modelling/calibrating the dynamics of the stochastic discount factor). See NGARCH model proposed by Duan in 1995 (can't put my hand on the paper) or the one by &lt;a href=&quot;http://pages.stern.nyu.edu/~rengle/garch_option6.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Barone-Adesi, Engle &amp;amp; Mancini&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Proxy methods&lt;/strong&gt;: factor models built on the assumption that the behaviour of a risky asset exhibits both a &quot;systemic&quot; component (here reflecting the manner in which the index returns drive that of the target single name) and an idiosyncratic component. See &lt;a href=&quot;http://engineering.nyu.edu/files/vgsiapfm1.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Carr &amp;amp; Madan&lt;/a&gt;'s approach.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Hedging-based approach&lt;/strong&gt;: Define the target implied volatility $\sigma_T$ as the BS volatility which would have allowed you to obtain a zero expected P&amp;amp;L if you had hedged a vanilla option of maturity $T$ using that precise vol figure. This amounts to solving some non-linear equation of the form:&#xA;$$ \Bbb{E}^\Bbb{P}[ \text{P&amp;amp;L}_{[0,T]}] = \frac{1}{2M} \sum_{m=1}^M \left[ \sum_{i=1}^N  \Gamma(\sigma_T,S_i^{(m)}) \left(S_i^{(m)}\right)^2 \left( \left(\frac{S_i^{(m)}-S_{i-1}^{(m)}}{S_i^{(m)}}\right)^2 - \sigma_T^2 \delta t \right) \right] = 0$$&#xA;with $m=1,...,M$ representing past realisations of the price process $(S_t)$ over a uniform time partition $t_0,...,t_N$ spanning over $T$ years. See this slide &lt;a href=&quot;http://www.stagirit.org/sites/default/files/articles/a_0369_cboe-bruno-2015.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;deck&lt;/a&gt; by Dupire.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2018-07-11T09:19:47.547" LastActivityDate="2018-07-11T09:19:47.547" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="31122" PostTypeId="1" AcceptedAnswerId="31123" CreationDate="2016-11-22T14:54:09.817" Score="0" ViewCount="98" Body="&lt;p&gt;&lt;strong&gt;Background Information:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The process $W = (W_t:t\geq 0)$ is a $\mathbb{P}$-Brownian motion if and only if &lt;/p&gt;&#xA;&#xA;&lt;p&gt;i) $W_t$ is continuous, and $W_0 = 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ii) the value of $W_t$ is distributed, under $\mathbb{P}$, as a normal random variable $N(0,t)$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;iii) the increment $W_{s+t} - W_{s}$ is distributed as a normal $N(0,t)$, under $\mathbb{P}$, and is independent of $\mathcal{F}_s$, the history of what the process did up to time $s$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $Z$ is a normal $N(0,1)$, then the process $X_t = \sqrt{t}Z$ is continuous and is marginally distributed as a normal $N(0,t)$. Is $X$ a Brownian motion?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the definition Brownian motion above it seems that we directly satisfy the 2 conditions. Although I believe we need to show the third condition to indeed conclude that $X$ is of Brownian motion. I am just not sure how to provide a formal solution to this question. &lt;/p&gt;&#xA;" OwnerUserId="19002" LastActivityDate="2016-11-22T15:41:29.623" Title="Do we have a Brownian motion" Tags="&lt;brownian-motion&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;&lt;financial-engineering&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31123" PostTypeId="2" ParentId="31122" CreationDate="2016-11-22T15:41:29.623" Score="5" Body="&lt;p&gt;Aside from the independence requirement for the increments, that is, the independence of $X_{s+t}-X_s$ and $\mathcal{F}_s$, you can check whether the increment $X_{s+t}-X_s$ has the distribution of $N(0, t)$. In fact, note that&#xA;\begin{align*}&#xA;X_{s+t}-X_s &amp;amp;= (\sqrt{s+t}-\sqrt{s}) Z\\&#xA;&amp;amp;\sim N\left(0,\, (\sqrt{s+t}-\sqrt{s})^2\right),&#xA;\end{align*}&#xA;which obviously does not have the distribution of $N(0, t)$. That is, the process $\{X_t, \, t\ge 0\}$ is not a Brownian motion.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-11-22T15:41:29.623" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31124" PostTypeId="1" CreationDate="2016-11-22T16:12:35.917" Score="0" ViewCount="1719" Body="&lt;p&gt;How do I concretely quantify the delta of a single currency basis swap (ex:3mv6m LIBOR) ? Would you look at the PV impact for every bps change in the 3v6 tenor basis spread ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="19764" LastActivityDate="2017-04-27T05:56:01.350" Title="Single currency basis swap Risk sensitivity" Tags="&lt;swaps&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31125" PostTypeId="1" AcceptedAnswerId="31129" CreationDate="2016-11-22T16:22:00.227" Score="1" ViewCount="830" Body="&lt;p&gt;&lt;strong&gt;Background Information:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The process $W = (W_t:t\geq 0)$ is a $\mathbb{P}$-Brownian motion if and only if &lt;/p&gt;&#xA;&#xA;&lt;p&gt;i) $W_t$ is continuous, and $W_0 = 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ii) the value of $W_t$ is distributed, under $\mathbb{P}$, as a normal random variable $N(0,t)$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;iii) the increment $W_{s+t} - W_{s}$ is distributed as a normal $N(0,t)$, under $\mathbb{P}$, and is independent of $\mathcal{F}_s$, the history of what the process did up to time $s$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $W_t$ and $\tilde{W}_t$ are two independent Brownian motions and $\rho$ is a constant between $-1$ and $1$, then the process $X_t = \rho W_t - \sqrt{1-\rho^2}\tilde{W}_t$ is continuous and has marginal distributions $N(0,t)$. Is this $X$ a Brownian motion?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have the first two conditions met. Now we must check if $X_{s+t} - X_s~N(0,t)$, and if $X_{s+t} - X_s$ is independent of $X_s$. One problem I having here is what is $X_{s+t}$, would it be $X_{s+t}= \rho W_{s+t} + \sqrt{1-\rho^2}\tilde{W}_{s+t}$, and if so is $W_{s+t}$ and $\tilde{W}_{s+t}$ two independent Brownian motions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Updated- We have &#xA;\begin{align*}&#xA;X_{s+t} - X_{s} &amp;amp;= \rho W_{s+t} + \sqrt{1-\rho^2}\tilde{W}_{s+t} - \rho W_s + \sqrt{1-\rho^2}\tilde{W}_s\\&#xA;&amp;amp;= \rho(W_{s+t} - W_s) - \sqrt{1-\rho^2}(\tilde{W}_{s+t} - \tilde{W}_s)\\&#xA;&amp;amp;\sim N(0,t)&#xA;\end{align*}&#xA;Since $W_{s+t} - W{s}\sim N(0,t)$ and $\tilde{W}_{s+t}-\tilde{W}_s\sim N(0,t)$. Now we need to check if $X_{s+t} - X{s}$ is independent of $X_{s}$. To do so we can check if the expectation of the product is equal to the product of the expectations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can show &#xA;$$E\left[(X_{s+t}-X_{s})X_{s}\right]=E[X_{s+t}X_s]-E[X_s^2]=\text{Cov}(X_{t+s},X_s)-\text{Var}(X_s)=s-s=0$$&#xA;Hence $X$ is a Brownian motion.&lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorDisplayName="user16651" LastEditDate="2016-11-22T20:19:43.930" LastActivityDate="2016-11-22T20:19:43.930" Title="Is this process of Brownian motion?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;wienerprocess&gt;" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="31126" PostTypeId="1" AcceptedAnswerId="31128" CreationDate="2016-11-22T17:20:50.117" Score="0" ViewCount="5054" Body="&lt;p&gt;I'm looking at a company's 10-K which gives me the following line items:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Income statement&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Net sales&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;Cost of goods sold&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Gross profit&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;Selling, general and administrative expenses&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Operating income&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;Other income (loss)&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Income before income taxes&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;Income tax expense&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Net income&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Why is there no &lt;strong&gt;Depreciation expense&lt;/strong&gt; line item on this income statement? I thought typically Income before tax was calculated over the operating income less interest and depreciation. On the cash flow statement it does give a Depreciation expense line item.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also what if the notes to Financial Notes do not really indicate which IS line item is tied to to D&amp;amp;A expense? &lt;/p&gt;&#xA;" OwnerUserId="24497" LastEditorUserId="-1" LastEditDate="2019-10-28T05:47:18.893" LastActivityDate="2019-10-28T05:47:18.893" Title="Why does depreciation not show up in my income statement?" Tags="&lt;valuation&gt;&lt;accounting&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="31128" PostTypeId="2" ParentId="31126" CreationDate="2016-11-22T17:58:32.273" Score="1" Body="&lt;p&gt;Here the depreciation &amp;amp; amortization expenses are not just displayed as separate items. Rather, they are probably in this case included in Selling, general and administrative expenses, as well as Cost of goods sold -items. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the possible reasons for not displaying depreciation as a separate item could be that it is natural to allocate the depreciation to different items. In this case some of the depreciation could be directly related to producing the products (thus attributable to COGS), while some of the depreciation might have more to do with general overhead (and thus included in Selling, general and administrative expenses).&lt;/p&gt;&#xA;" OwnerUserId="25364" LastActivityDate="2016-11-22T17:58:32.273" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31129" PostTypeId="2" ParentId="31125" CreationDate="2016-11-22T18:37:51.620" Score="3" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Lévy’s theorem&lt;/strong&gt;: Let $X_t$ be a martingale with $X_0=0$. Then the&#xA;  following are equivalent.&lt;/p&gt;&#xA;  &#xA;  &lt;ol&gt;&#xA;  &lt;li&gt;$X_t$ is a standard Brownian motion. &lt;/li&gt;&#xA;  &lt;li&gt;$X_t$ has continuous sample paths and $X_t^2-t$ is a martingale.&lt;/li&gt;&#xA;  &lt;li&gt;$X_t$ has quadratic variation $[X]_t=t$.&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Proposition:&lt;/strong&gt; If $W^{(1)}_t$ and $W^{(2)}_t$ be two independent standard Brownian motions then $W_t:=\rho W^{(1)}_t-\sqrt{1-\rho^2} W^{(2)}_t$  is a Brownian motion.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Proof&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $(\Omega, \mathcal{F},\mathbb{P},\{\mathcal{F_t}\})$ be a probability space . Clearly, $W_t$ has continuous sample paths and $W_0=0$. Note&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}[W_t|\mathcal{F_s}]=\rho\,\mathbb{E}[W^{(1)}_t|\mathcal{F_s}]-\sqrt{1-\rho^2}\,\mathbb{E}[W^{(2)}_t|\mathcal{F_s}]=\rho W^{(1)}_s-\sqrt{1-\rho^2} W^{(2)}_s=W_s$$&#xA; So $W_t$ is a martingale. Now we should show $W_t^2-t$ is a martingale.By application of Ito's lemma, we have &#xA;$$dW_t^2=2W_tdW_t+d[W_t,W_t]$$&#xA;$$dW_t^2=2W_tdW_t+\rho^2 d[W_t^{(1)},W_t^{(1)}]+(1-\rho^2) d[W_t^{(2)},W_t^{(2)}]-2\rho\sqrt{1-\rho^2}d[W_t^{(1)},W^{(2)}_t]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $W^{(1)}_t$ and $W^{(2)}_t$ are two independent Brownian motions, thus $d[W_t^{(1)},W^{(2)}_t]=0$ , hence&#xA;$$dW_t^2=2W_tdW_t+dt$$&#xA;consequently&#xA;$$d(W_t^2-t)=2W_tdW_t+dt-dt=2W_tdW_t$$&#xA;so to speak&#xA;$$d(W_t^2-t)=2W_tdW_t$$&#xA;Therefore $W_t^2-t$, is a martingale (because it's SDE has a null drift )  and $W_t$ is a standard Brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Another way&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$W_t^{(1)},W_t^{(2)}\stackrel{\mathrm{i.i.d.}}\sim \mathcal N(0,t)$, so $$\rho W_t^{(1)}\sim\mathcal N\left(0,\rho^2 t\right)$$&#xA; and&#xA; $$\sqrt{1-\rho^2}W_t^{(2)}\sim\mathcal N\left(0,(1-\rho^2)t \right)$$ &#xA;thus&#xA;$$W_t \sim \mathcal N\left(0, t \right). $$&#xA;Therefore $\{W_t:t\in\mathbb R_+\}$ is a Gaussian process, and from independence of $W_t^{(1)}$ and $W_t^{(2)}$ we have $$\mathbb E\left[W_t^{(1)}W_t^{(2)}\right] =\mathbb E\left[W_t^{(1)}\right]\mathbb E\left[W_t^{(2)}\right]=0.$$ Let $0&amp;lt;s&amp;lt;t$ we have&#xA;\begin{align}&#xA;\text{Cov}(W_s,W_t) &amp;amp;= \mathbb E[W_sW_t] - \mathbb E[W_s]\mathbb E[W_t]\\&#xA;&amp;amp;= \mathbb E\left[\left(\rho W_s^{(1)}-\sqrt{1-\rho^2}W_s^{(2)}\right)\left(\rho W_t^{(1)}-\sqrt{1-\rho^2}W_t^{(2)}\right)\right] - 0\\&#xA;&amp;amp;= \rho^2\mathbb E\left[W_s^{(1)}W_t^{(1)} \right]+(1-\rho^2) \mathbb E\left[W_s^{(2)}W_t^{(2)} \right] - 2\rho\sqrt{1-\rho^2}\mathbb E\left[W_s^{(1)}W_t^{(2)} \right]\\&#xA;&amp;amp;= \rho^2 s + \left(1-\rho^2\right)s - \rho\sqrt{1-\rho^2}\times 0\\&#xA;&amp;amp;= s.&#xA;\end{align} &#xA;on the other hand&#xA;$$\mathbb{E}[(W_t-W_s)W_s]=\mathbb{E}[W_t\,W_s]-\mathbb{E}[W_s^2]=\text{Cov}(W_t,W_s)-\text{Var}(W_s)=s-s=0$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-11-22T20:16:24.433" LastActivityDate="2016-11-22T20:16:24.433" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="31131" PostTypeId="2" ParentId="31124" CreationDate="2016-11-22T19:05:45.533" Score="1" Body="&lt;p&gt;Been away from a trading desk for a while and was not in flow rates, but presume you'd have a delta to the CSA curve (a discounting delta), and 2 projection deltas, one to 3m and opposing one to 6m. Neglecting the deviation of the sum from zero then quantum of delta overlap is effectively what you describe above I would guess? (i.e. I agree, however this is the basis delta to which you are sensitive if the legs compress / decompress, however there may also be some small residual outright delta if the 6m or 3m leg dominate, in addition as I say to some small discounting delta)&lt;/p&gt;&#xA;" OwnerUserId="19239" LastActivityDate="2016-11-22T19:05:45.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31132" PostTypeId="2" ParentId="31105" CreationDate="2016-11-22T20:24:08.443" Score="1" Body="&lt;p&gt;Yahoo prices are adjusted for all applicable splits and dividend distributions. Data is adjusted using appropriate split and dividend multipliers, adhering to Center for Research in Security Prices (CRSP) standards.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yahoo finance provides a knowledge base article on the adjusted close:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://help.yahoo.com/kb/SLN2311.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://help.yahoo.com/kb/SLN2311.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since your last download, Microsoft (MSFT) has had the following cash dividends since November 2015: 11/15/2016 Cash    0.39, 8/16/2016 Cash    0.36, 5/17/2016 Cash    0.36, 2/16/2016 Cash    0.36, 11/17/2015    Cash    0.36&lt;/p&gt;&#xA;" OwnerUserId="25326" LastActivityDate="2016-11-22T20:24:08.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31133" PostTypeId="2" ParentId="18075" CreationDate="2016-11-22T22:59:58.630" Score="3" Body="&lt;p&gt;Hi am having to write as an 'answer' as am new to forum. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We used stochastic intensity models on desk from a while back. Generally Black-Karasinski to avoid negative hazard rates (and for useful features such as mean reversion). Now in your choice of structural approach with lognormal jumps as some respondents have pointed out you will have to simulate to calibrate your model params. which may be computationally onerous particularly when it comes to risk measures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Forgive me if you have seen but an elegant alternative are the affine jump diffusions, in particular I like Brigo's 'JCIR++' based on a square root process with exponential jumps. This has analytical survival probabilities, AND the intensities are non-negative. See for example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.amazon.co.uk/Interest-Rate-Models-Practice-Inflation/dp/3540221492/ref=sr_1_1?ie=UTF8&amp;amp;qid=1479854412&amp;amp;sr=8-1&amp;amp;keywords=brigo&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.amazon.co.uk/Interest-Rate-Models-Practice-Inflation/dp/3540221492/ref=sr_1_1?ie=UTF8&amp;amp;qid=1479854412&amp;amp;sr=8-1&amp;amp;keywords=brigo&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the SDE &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d\lambda_t=\kappa(\mu-\lambda_t)dt+\nu\sqrt{\lambda_t}dZ_t+dJ_t^{\alpha,\gamma}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\lambda_t$ is the intensity, the jump arrives at rate $\alpha$ and has distribution $Exp(\gamma)$. We also are able to have mean reversion.&#xA;p832 in the reference has the formula for the survivals. But maybe that's old news to you in which case sorry!&lt;/p&gt;&#xA;" OwnerUserId="19239" LastActivityDate="2016-11-22T22:59:58.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31135" PostTypeId="1" AcceptedAnswerId="31139" CreationDate="2016-11-23T00:36:09.127" Score="1" ViewCount="124" Body="&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/E-mini&quot; rel=&quot;nofollow noreferrer&quot;&gt;E-minis&lt;/a&gt; include some high-liquidity lower margin market index future contracts with round-the-clock trading. However, volumes outside regular trading hours are much smaller.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there equivalent contracts in other markets around the world, accessible through an international broker such as IB?&lt;/p&gt;&#xA;" OwnerUserId="4848" LastActivityDate="2016-11-23T04:47:57.517" Title="Equivalents of E-minis in markets outside the US" Tags="&lt;futures&gt;&lt;index&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31136" PostTypeId="1" AcceptedAnswerId="31145" CreationDate="2016-11-23T00:46:08.720" Score="3" ViewCount="3717" Body="&lt;p&gt;I have computed the value at risk of 2 different commodities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming they have not correlated, can I just sum the two standalone VaR to get my overall portfolio's VaR ?&lt;/p&gt;&#xA;" OwnerUserId="25401" LastEditorUserId="467" LastEditDate="2016-11-23T05:51:09.430" LastActivityDate="2016-11-25T09:06:21.220" Title="Is Value At Risk additive?" Tags="&lt;option-pricing&gt;&lt;var&gt;" AnswerCount="4" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31137" PostTypeId="2" ParentId="31111" CreationDate="2016-11-23T00:47:10.933" Score="0" Body="&lt;p&gt;More typically this refers to a portfolio like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long 100MM 10yr bond with coupon 3%&#xA;Short 180MM 5yr bond with coupon 3%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with the principal amounts chosen such that the BPVs in dollars are equal.   This portfolio is long convexity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The term &quot;duration neutral&quot; does not imply matched maturity.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-11-23T00:47:10.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31138" PostTypeId="2" ParentId="31136" CreationDate="2016-11-23T00:49:05.553" Score="0" Body="&lt;p&gt;You need to square them, add the squares , and take the square root.   (Variances are additive, not standard deviations).&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-11-23T00:49:05.553" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31139" PostTypeId="2" ParentId="31135" CreationDate="2016-11-23T00:59:28.143" Score="3" Body="&lt;p&gt;Actually in Europe and Asia many regular (big size) future contracts have a notional similar or smaller than the e-mini sp 500 (&amp;lt;= 110k USD at current market prices). I trade the CAC 40/AEX (on IB by the way) and the minis are illiquid and quote wider for the same transaction fees than the big one (10 ticks vs 1 tick for CAC 40 for instance). In Asia mini-TOPIX/NIKKEI (Japan), mini-HSI/HSCE have reasonable volumes and quote tight.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Europe&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;French CAC 40, lot size 10 = 50k USD (Euronext) (There are minis with lot size 1, relatively illiquid), IB Symbol CAC40&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Dutch AEX, lot size 100 = 50k USD (Euronext) (There are minis with lot size 10, relatively illiquid), IB Symbol EOE&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;German DAX, lot size 25 = 300k USD, mini with lot size 5 = 65k USD (Eurex) (a bit more liquid than the previous two), IB Symbol DAX&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;British FTSE, lot size 10 = 85 k USD (ICE), IB Symbol Z&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Euro Stoxx 50, lot size 10 = 30k USD (Eurex), IB Symbol ESTX50&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Asia&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Japanese Nikkei, lot size 1000 = 170k USD, mini with lot size 100 = 17k USD (JPX) or Topix/mini-topix (140k/14k), good liquidity for the minis, IB Symbol N225 N225M TOPX MNTPX&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Hong Kong HSI, lot size 500 = 150k USD, mini with lot size 10 = 30k USD (HKEX), good liquidity for the minis, IB Symbols HSI MHI HHI.HK MCH.HK&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In Europe and HK, the products targeted for retail are usually listed certificates (structured products), called CBBC (callable bull bear contract) in Hong Kong, Turbos in Europe. They are quite heavily marketed by financial institutions to retail traders.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For this reason (but mostly I think because of the already small size of the full size contract), the need for mini futures is less important than for US index where the big contract is ... well, big.&lt;/p&gt;&#xA;" OwnerUserId="1181" LastEditorUserId="1181" LastEditDate="2016-11-23T04:47:57.517" LastActivityDate="2016-11-23T04:47:57.517" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31140" PostTypeId="1" AcceptedAnswerId="31147" CreationDate="2016-11-23T02:09:24.130" Score="-2" ViewCount="298" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Solve the SDE $$dX_t = X_t(\sigma_t dW_t + \mu_t dt)$$ where $\sigma_t$,$\mu_t$ are deterministic.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Attempted solution&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have $$dX_t = X_t(\sigma_t dW_t + \mu_t dt)$$&#xA;Let $f(x) = \log X$, applying Ito formula we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d \log(X_t) = \sigma_t dW_t X_t \frac{1}{X_t} + \mu_t dt X_t \frac{1}{X_t} + \frac{1}{2}\sigma^2 (-\frac{1}{X_t^2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cancelling terms we have $$d \log(X_t) = \sigma_t dW_t + \mu_t dt - \frac{1}{2}\sigma^2\frac{1}{X_t^2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is where I am lost I am pretty sure this is how we solve for this SDE but the $\frac{1}{X_t^2}$ term is throwing me off.&lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="467" LastEditDate="2016-11-23T05:58:16.947" LastActivityDate="2016-11-23T10:10:44.447" Title="How to solve $dX_t = X_t(\sigma_t dW_t + \mu_t dt)$?" Tags="&lt;mathematics&gt;&lt;finance-mathematics&gt;&lt;sde&gt;&lt;math&gt;" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="31141" PostTypeId="1" AcceptedAnswerId="31240" CreationDate="2016-11-23T02:42:52.327" Score="4" ViewCount="473" Body="&lt;p&gt;&lt;strong&gt;Background Information:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question comes from the book Financial Calculus by Baxter and Rennie. WE start with looking at the marginal of $W_T$ under $\mathbb{Q}$. We need to find the likelihood function of $W_T$ with respect to $\mathbb{Q}$, or something equivalent. One useful trick is to look at moment-generating functions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A random variable $X$ is a normal $N(\mu,\sigma^2)$ under a measure $\mathbb{P}$ if and only if $$E_{\mathbb{P}}(\exp(\theta X)) = \exp\left(\theta\mu + \frac{1}{2}\theta^2 \sigma^2\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To calculate $E_{\mathbb{Q}}[\exp(\theta W_T)]$, we can use the fact of the Radon-Nikodym derivative summary, which tells us that it is the same as the $\mathbb{P}$-expectation $E_{\mathbb{P}}\left[\frac{d\mathbb{Q}}{d\mathbb{P}}\exp(\theta W_T)\right]$. This equals&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E_{\mathbb{P}}[\exp(-\gamma W_T - \frac{1}{2}\gamma^2 T + \theta W_T)] = \exp\left(-\frac{1}{2} \gamma^2 T + \frac{1}{2}(\theta - \gamma)^2 T\right)$$ because $W_t$ is a normal $N(0&amp;lt;T)$ with respect to $\mathbb{P}$. Simplifying the algebra, we have $$E_{\mathbb{Q}}[\exp(\theta W_T)] = \exp\left(-\theta \gamma T + \frac{1}{2}\theta^2 T\right)$$&#xA;which is the moment generating function of a normal $N(-\gamma T, T)$. Thus the marginal distribution of $W_T$, under $\mathbb{Q}$, is also a normal with variance $T$ but with mean $-\gamma T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What about $W_t$ for $t$ less than $T$? The marginal distribution of $W_T$ is what we would expect if $W_t$ under $\mathbb{Q}$ Brownian motion plus a constant drift $-\gamma$. Of course, a lot of other process also have a marginal normal $N(-\gamma T, T)$ distribution at time $T$, but it would be an elegant result if the sole effect of changing from $\mathbb{P}$ to $\mathbb{Q}$ via $\frac{d\mathbb{Q}}{d\mathbb{P}} = \exp\left(-\gamma W_T - \frac{1}{2} \gamma^2 T\right)$ were just to punch in a drift of $-\gamma$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And so it is. The process $W_t$ is a Brownian motion with respect to $\mathbb{P}$ and Brownian motion with constant drift $-\gamma$ under $\mathbb{Q}$. Using our two results about $\frac{d\mathbb{Q}}{d\mathbb{P}}$, we can prove the three conditions for $\tilde{W}_t = W_t + \gamma t$ to be $\mathbb{Q}$-Brownian motion:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i) $\tilde{W}_t$ is continuous and $\tilde{W}_0$ = 0;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ii) $\tilde{W}_t$ is a normal $N(0,t)$ under $\mathbb{Q}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;iii) $\tilde{W}_{t+s} - \tilde{W}_2$ is a normal $N(0,t)$ independent of $\mathcal{F}_s$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first of these is true and ii) and iii) can be re-expressed as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;ii') $E_{\mathbb{Q}}[\exp(\theta \tilde{W}_t)] =\exp(\frac{1}{2}\theta^2 t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;iii') $E_{\mathbb{Q}}[\exp(\theta(\tilde{W}_{t+s} - \tilde{W}_s))|\mathcal{F}_2] =\exp(\frac{1}{2}\theta^2 t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Show that ii') and iii') are equivalent to ii) and iii) respectively, and prove them using the chance of measure process $\varsigma_t = E_{\mathbb{P}}\left(\frac{d\mathbb{Q}}{d\mathbb{P}}|\mathcal{F}_t\right)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not even sure where to start, perhaps a start to the solution or some guidance would be helpful, pretty much teaching myself this stuff so excuse the plethora of questions I may have. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Attempted solution - I want to first show that (ii) and (ii') are equivalent. From (ii) we have that $\tilde{W_t}\sim N(0,t)$ under $\mathbb{Q}$ then the moment generating function is $$M_x(t) = \exp{(\frac{1}{2}t^3)}$$&#xA;I do not see how that it is equivalent to (ii')&lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="19002" LastEditDate="2016-12-13T16:41:18.863" LastActivityDate="2016-12-13T16:41:18.863" Title="How to prove we have a $\mathbb{Q}$-Brownian motion?" Tags="&lt;brownian-motion&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;&lt;financial-engineering&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31142" PostTypeId="2" ParentId="29825" CreationDate="2016-11-23T04:42:42.690" Score="0" Body="&lt;ol&gt;&#xA;&lt;li&gt;Always use the prompt contract when hedging an asset. deferred months can move opposite to the prompt contact on occasion.&lt;/li&gt;&#xA;&lt;li&gt;Use whatever time period you are using to value the asset. If you are using Brent to hedge it then it likely has daily exposure so you would want to use daily price. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="25401" LastEditorDisplayName="user16651" LastEditDate="2016-11-23T06:23:37.587" LastActivityDate="2016-11-23T06:23:37.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31143" PostTypeId="2" ParentId="23020" CreationDate="2016-11-23T04:44:15.190" Score="1" Body="&lt;p&gt;In some local exchanges there are American-style options only. &lt;/p&gt;&#xA;" OwnerUserId="20913" LastActivityDate="2016-11-23T04:44:15.190" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31144" PostTypeId="2" ParentId="31136" CreationDate="2016-11-23T05:28:50.107" Score="0" Body="&lt;p&gt;No, because the value at risk is not, in general, a coherent risk measure as it does not respect the &lt;a href=&quot;https://en.wikipedia.org/wiki/Coherent_risk_measure&quot; rel=&quot;nofollow noreferrer&quot;&gt;sub-additivity property&lt;/a&gt;, i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\rho(X + Y) \ne \rho(X) + \rho(Y)$, $\forall X, Y \in \mathcal{X}$&#xA;for the $VaR$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, Conditional Value at Risk is. Check out &#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/1347/is-conditional-value-at-risk-cvar-coherent&quot;&gt;Is Conditional Value-at-Risk (CVaR) coherent?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20913" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-11-25T09:06:21.220" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31145" PostTypeId="2" ParentId="31136" CreationDate="2016-11-23T05:38:12.773" Score="7" Body="&lt;p&gt;The answer to your question is &lt;strong&gt;no&lt;/strong&gt;. Value at Risk is not additive in the sense that $\text{VaR}(X+Y) \neq \text{VaR}(X) + \text{VaR}(Y)$. But I guess your question is more to aimed at finding a formula for your investments than to look at the property itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the only way to get a nice formula for this is to assume that both assets are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Normally distributed&lt;/li&gt;&#xA;&lt;li&gt;Have a mean equal to 0&lt;/li&gt;&#xA;&lt;li&gt;Are independent&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Closed-Form value at risk for Normal variable&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mathematically the Value at Risk at a given level $\alpha$ is defined as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{VaR}_\alpha(X) = \{ y ~ | ~ \mathbb{P}( X\leq y) = \alpha \}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you can assume you variable $X$ is normally distributed such that $X \sim \mathcal{N}(\mu, \sigma^2)$, then you can re-express $X$ in terms of another variable $Z \sim \mathcal{N}(0,1)$: $X = \mu + \sigma Z$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using this, we know can rewrite the VaR definition as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align}&#xA;\text{VaR}_\alpha(X) &amp;amp;= \{ y ~ | ~ \mathbb{P}( \mu + Z\sigma\leq y) = \alpha\}\\&#xA;&amp;amp;= \left\{ y ~ | ~ \mathbb{P}\left( Z \leq \frac{ y- \mu}{\sigma} \right) = \alpha \right\}\\&#xA;&amp;amp;= \left\{ y ~ | ~ \Phi\left( \frac{ y- \mu}{\sigma} \right) = \alpha \right\}\\&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\Phi(x)$ is the cumulative normal standard distribution function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can then find a closed-form formula to the value at risk of a normally distributed variable $X$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{VaR}_\alpha(X) = \Phi^{-1}(\alpha) \cdot\sigma + \mu$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Distribution of portfolio of two Normal variables&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, let's assume you portfolio $Y$ holds two assets $X_1$ and $X_2$ (the two commodities in your example), which are uncorrelated ($\rho = 0$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you assume that both are normally distributed $X_1 \sim \mathcal{N}(\mu_1,\sigma_1)$ and $X_2 \sim \mathcal{N}(\mu_2,\sigma_2)$, then the we know that the portfolio can be expressed as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align}&#xA;Y &amp;amp;= wX_1 + (1-w)X_2\\&#xA;&amp;amp;= w(\mu_1 + \sigma_1 Z_1) + (1-w)(\mu_2 +\sigma_2 Z_2)\\&#xA;&amp;amp;= w\mu_1 + (1-w) \mu_2 + w\sigma_1 + w \sigma_1 Z_1 + (1-w) \sigma_2 Z_2&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, we know that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}(Y) = w\mu_1 + (1-w) \mu_2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Variance}(Y) = \sigma_Y^2 = w^2 \sigma_1^2 + (1-w)^2 \sigma_2^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;because you assets are independent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As we know, the sum of 2 normally distributed variables is also normally distributed, hence:&#xA;$$Y \sim \mathcal{N}(w\mu_1 + (1-w) \mu_2, w^2 \sigma_1^2 + (1-w)^2 \sigma_2^2)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Value-at-risk of the portfolio&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the formula for value-at-risk for normal variable we found above, we can write:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align}&#xA;\text{VaR}_\alpha(Y) &amp;amp;= \Phi^-1(\alpha) \sigma_Y + \mu_y\\&#xA;\text{VaR}_\alpha(Y)  &amp;amp;= \Phi^-1(\alpha) \sqrt{w^2 \sigma_1^2 + (1-w)^2 \sigma_2^2} + w\mu_1 + (1-w) \mu_2\\&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you assume that $\mu_1 = \mu_2 = 0$, then you get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align}&#xA;\text{VaR}_\alpha(Y)  &amp;amp;= \Phi^-1(\alpha) \sqrt{w^2 \sigma_1^2 + (1-w)^2 \sigma_2^2}\\&#xA;\text{VaR}_\alpha(Y)^2  &amp;amp;= \Phi^-1(\alpha)^2 (w^2 \sigma_1^2 + (1-w)^2 \sigma_2^2)\\&#xA;\text{VaR}_\alpha(Y)^2  &amp;amp;= \Phi^-1(\alpha)^2 w^2 \sigma_1^2 + \Phi^-1(\alpha)^2 (1-w)^2 \sigma_2^2\\&#xA;\text{VaR}_\alpha(Y)^2  &amp;amp;= w^2 \text{VaR}_\alpha(X_1)^2 + (1-w)^2 \text{VaR}_\alpha(X_2)^2\\&#xA;\text{VaR}_\alpha(Y)  &amp;amp;=\sqrt{ w^2 \text{VaR}_\alpha(X_1)^2 + (1-w)^2 \text{VaR}_\alpha(X_2)^2}\\&#xA;\end{align}$$&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2016-11-23T15:55:13.783" LastActivityDate="2016-11-23T15:55:13.783" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="31147" PostTypeId="2" ParentId="31140" CreationDate="2016-11-23T05:59:38.387" Score="2" Body="&lt;p&gt;let $$dY_t=\mu(t,Y_t)dt+\sigma(t,Y_t)dW_t$$&#xA;and $f\in \mathbb{C^2}$.By application of Ito's lemma, we have&#xA;$$df(Y_t)=\frac{\partial f}{\partial y}dY_t+\frac{1}{2}\frac{\partial^2 f}{\partial y^2}d[Y_t,Y_t]$$&#xA;where $$\color{red}{d[Y_t,Y_t]=\sigma^2(t,Y_t)dt}$$ We have&#xA;$$dX_t=\mu_t X_tdt+\sigma_t X_t dW_t$$ thus&#xA;$$d \ln(X_t)=\frac{1}{X_t}(\mu_t X_tdt+\sigma_t X_t dW_t)+\frac{1}{2}\left(\frac{-1}{X_t^2}\right)(\sigma_t X_t)^2 dt$$&#xA;therefore&#xA;$$d \ln(X_t)=\left(\mu_t-\frac{1}{2}\sigma_t^2 \right)dt+\sigma_t dW_t$$&#xA;by integration on $[0,t]$ we have&#xA;$$\ln\left(\frac{X_t}{X_0}\right)=\int_{0}^{t}\left(\mu_s-\frac{1}{2}\sigma_s^2 \right)ds+\int_{0}^{t}\sigma_s dW_s$$&#xA;in other words&#xA;$$X_t=x \exp\left(\int_{0}^{t}\left(\mu_s-\frac{1}{2}\sigma_s^2 \right)ds+\int_{0}^{t}\sigma_s dW_s\right)$$&#xA;where&#xA;$X_0=x$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Useful link&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/1330/what-is-itos-lemma-used-for-in-quantitative-finance/1345#1345&quot;&gt;What is Ito's lemma used for in quantitative finance.&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerDisplayName="user16651" LastEditorUserId="-1" LastEditorDisplayName="user16651" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-11-23T10:10:44.447" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31148" PostTypeId="1" AcceptedAnswerId="31149" CreationDate="2016-11-23T08:42:06.870" Score="0" ViewCount="448" Body="&lt;p&gt;I need pure DAX historical data on H1 interval (open, high, low, close). I can download data e.g from Dukascopy but this is DEU index (CFD for DAX) not DAX. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where I can find good data (not CFD for DAX, not from MM broker etc.)?&#xA;Can be paid.&lt;/p&gt;&#xA;" OwnerUserId="24672" LastActivityDate="2016-11-23T09:12:22.570" Title="DAX historical data H1 interval" Tags="&lt;market-data&gt;&lt;historical-data&gt;&lt;history&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2016-11-23T09:32:39.287" ContentLicense="CC BY-SA 3.0" />
  <row Id="31149" PostTypeId="2" ParentId="31148" CreationDate="2016-11-23T09:12:22.570" Score="1" Body="&lt;p&gt;You can use google finance for that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With i in seconds&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.google.com/finance/getprices?i=3600&amp;amp;p=100d&amp;amp;f=d,o,h,l,c,v&amp;amp;df=cpct&amp;amp;q=DAX&amp;amp;x=INDEXDB&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.google.com/finance/getprices?i=3600&amp;amp;p=100d&amp;amp;f=d,o,h,l,c,v&amp;amp;df=cpct&amp;amp;q=DAX&amp;amp;x=INDEXDB&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1181" LastActivityDate="2016-11-23T09:12:22.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31150" PostTypeId="1" CreationDate="2016-11-23T09:39:47.573" Score="1" ViewCount="571" Body="&lt;p&gt;For examples if we  bought a 10 years corporate  bond and want to hedge the credit risk only using CDS ,&#xA;1-  how can we calculate the hedge ratio (compare the change in the asset credit risk vs what )? Please elaborate. &#xA;2-  What is the best hedge effectiveness testing method to be used (dollar offset ,Regression, others. CTM or  SC  ) and why ?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your help and support&lt;/p&gt;&#xA;" OwnerUserId="25406" LastEditorUserId="2587" LastEditDate="2018-05-24T12:32:32.280" LastActivityDate="2020-05-17T13:42:26.950" Title="How measure the hedge effectiveness in hedging relation using CDS?" Tags="&lt;cds&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="31151" PostTypeId="1" CreationDate="2016-11-23T09:46:56.847" Score="1" ViewCount="855" Body="&lt;p&gt;can anybody tell me which models Bloomberg and Reuters ares using to derive implied volatility for interest derivatives with negative forward rates? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that Black-76 is the standard model, and that ICAP for example uses the displaced diffusion version of Black's model... but do Bloomberg and Reuters get their data from ICAP? Or do they also have internal models?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recently started using Bloomberg and find it very confusing sometimes...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be very helpful if anybody had some literature about this issue or about the different models used by data providers. I would like to write a paper on this topic but the info is pretty limited... at least for somebody like me. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only helpful article I found was this: &lt;a href=&quot;http://www.d-fine.com/fileadmin/d-fine/hochgeladen/Fachartikel/WhitePaper_Vols_NegIR_V1_1_en.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;d-fine - New volatility conventions in negative interest environment&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Philipp&lt;/p&gt;&#xA;" OwnerUserId="25405" LastActivityDate="2016-12-15T20:56:15.813" Title="Which models do Bloomberg/Reuters use to derive implied volatility for interest rate derivatives with negative forward rates?" Tags="&lt;implied-volatility&gt;&lt;derivatives&gt;&lt;bloomberg&gt;&lt;negative&gt;&lt;black76&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31153" PostTypeId="2" ParentId="31150" CreationDate="2016-11-23T15:01:23.557" Score="3" Body="&lt;p&gt;just a few considerations from an ex credit / hybrids trader:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's assume your CDS and bond are denominated in the same CCY to eliminate quanto risk, and we'll assume any interest rate risk is hedged out. Let's also assume that the CDS and bond are coterminal. Your chief sources of risk are then, for any bond + CDS portfolio:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;'Linear' CR01 risk assuming bond and CDS effectively have the same spread.  &lt;/li&gt;&#xA;&lt;li&gt;Jump to default or default risk&#xA;at 'market' recovery.&lt;/li&gt;&#xA;&lt;li&gt;Annuity risk - i.e. the credit risk that emanates from bond and CDS probably having different, and potentially very different premium legs (primarily referring to quantum here than schedule). &lt;/li&gt;&#xA;&lt;li&gt;Credit convexity. &lt;/li&gt;&#xA;&lt;li&gt;Recovery risk in the event of a credit event.&lt;/li&gt;&#xA;&lt;li&gt;Basis risk (bond implied survivals may be significantly different to CDS for a variety of factors - even for sovereigns eg with BTPs (Italian govt bonds) the&#xA;bond-CDS basis can be tens of bps.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Let's now assume that the bond is deliverable into the CDS contract. This means a bond holder can sell the bond at the ISDA auction at the recovery price at which the CDS will settle - this eliminates (5) so let's get that out of the way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(3) and (4) are related: If for example the CDS premium leg is materially higher (eg a standardised 500bps for some credits) than the bond coupons then the 'hedged' position will be short risk and short credit gamma (paying an annuity is like buying protection since the annuity obliterates on default, however as the credit widens the default gain is obviously more and more priced in hence the residual short risk position declines. This can be a material effect say equivalent to 1mm notional equivalent on a 10mm 5y CDS pure annuity with a 500bp coupon). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A differing annuity can also mean that the default even is not hedged (the premium legs do not exactly offset on default) giving rise to (2). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) is probably the main first order risk you are referring to, and we'll come back to this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(6) is pretty unhedgeable in many cases and emanates from the funded vs potentially unfunded nature of the CDS vs bond. All sorts of supply and demand factors particular to the heterogeneous nature of bond vs CDS market participants mean that this basis can swing from +ve to negative, sometimes in response to general market movements, sometimes owing eg to central bank policy action providing funding on eg short dated sovereign bonds. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, from a trading desk point of view, typically the full term structure of CR01 risk measures is generated, annuity differences meaning that the notional flat package is most likely not 'flat', these are hedged  out subject to bid/offfer liquidity constraints, and possibly in many cases the bond-cds basis does mean revert over time so this is not too problematic if not run in too massive a size. Hedging out the actual risk measure in my view is better than regression. However, clearly in many cases the basis and outright spread may not be orthogonal, and so there is definitely something to be said, in the context of book with many credits, to adopt a holistic PCA type approach - this may well save 10s of bps in rehedging costs (credit books do have convexity) and initial hedge bid/offer. It's hugely important to remember however that regimes change in credit markets all the time, so to be too wedded to one approach is dangerous.&lt;/p&gt;&#xA;" OwnerUserId="19239" LastActivityDate="2016-11-23T15:01:23.557" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31154" PostTypeId="2" ParentId="31136" CreationDate="2016-11-23T15:16:03.517" Score="0" Body="&lt;p&gt;Well, if you are using historical VaR, you can add results on each scenario and then calculate percentile of results... There is no other way.&lt;/p&gt;&#xA;" OwnerUserId="25410" LastActivityDate="2016-11-23T15:16:03.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31155" PostTypeId="1" CreationDate="2016-11-23T18:08:47.770" Score="0" ViewCount="57" Body="&lt;p&gt;Recently it was announced that QCOM plans to acquire NXP in a deal taht values NXP at \$110 per share.&#xA;In this case I would expect that the shares of NXP should rise up and hit the \$110 mark and stay there until the acquisition formally completes. But NXP shared are around $98-99 --- why? &lt;/p&gt;&#xA;" OwnerUserId="25412" LastActivityDate="2016-11-24T00:09:13.623" Title="Share price after acquisition announcement (specifically QCOM NXP)" Tags="&lt;equities&gt;&lt;pricing&gt;&lt;valuation&gt;&lt;price&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31156" PostTypeId="1" CreationDate="2016-11-23T20:21:49.937" Score="3" ViewCount="4449" Body="&lt;p&gt;I am attempting to find the annualized covariance between assets in a portfolio but I only have daily data. So how do I annualize the covariance matrix between these assets?&lt;/p&gt;&#xA;" OwnerUserId="24815" LastActivityDate="2016-11-23T20:21:49.937" Title="Annualize a covariance matrix?" Tags="&lt;covariance-matrix&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31159" PostTypeId="2" ParentId="31155" CreationDate="2016-11-24T00:09:13.623" Score="1" Body="&lt;p&gt;Qualcomm must get UE authorities approval on anti-trust concerns before proceeding with the acquisition (because NXP is a dutch company) so the deal has a chance not to go through. Qualcomm is already embroiled in an antitrust issue with the UE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus as there is a non-zero probability of the deal not going through, the share is not trading at the tendered price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.bloomberg.com/news/articles/2016-10-27/qualcomm-must-woo-eu-antitrust-foes-to-win-blessing-for-nxp-bid&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.bloomberg.com/news/articles/2016-10-27/qualcomm-must-woo-eu-antitrust-foes-to-win-blessing-for-nxp-bid&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.fool.com/investing/2016/11/21/is-qualcomm-trying-to-close-the-nxp-semiconductors.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.fool.com/investing/2016/11/21/is-qualcomm-trying-to-close-the-nxp-semiconductors.aspx&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1181" LastActivityDate="2016-11-24T00:09:13.623" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31160" PostTypeId="2" ParentId="31104" CreationDate="2016-11-24T01:07:08.670" Score="2" Body="&lt;p&gt;will try and describe a simplified mathematical description, and hopefully some of it will be intuitive :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am going to use a definition of spread duration used throughout credit markets at least - this may not be what you are getting at so do let me know if this is the case. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Spread duration is a risky duration, that is, the survival probability adjusted discount factor - weighted present value of a one basis point annuity / coupon paid on the bond. (This is almost the same things as price sensitivity, at least to a first order approximation as we'll see).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Spread duration or risky present value of a basis point is given by:&#xA;$PV_{BP_{risky}} = \displaystyle{\int_0^Tc_t\,\mathbb{P}(\tau\geq t)}D_{0,t}\mathrm{dt} =\int_0^T{c_te^{\int_0^t{\lambda_sds}}e^{\int_0^t{r_sds}}\mathrm{dt}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $D_{0,t}$ is the credit riskless discount, $c_t$ is the coupon stream (assumed continuous for simplicity) pf 1bp and $\mathbb{P}(\tau\geq t)$ is the $t$ survival probability. Please note - to make things simple I am assuming here that credit and rates are uncorrelated - in many applications this is NOT suitable. Am also ignoring accrued for clarity of exposition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's now make things even simpler and assume a flat hazard rate and flat interest rate 'curve'. We then have simply that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\displaystyle{PV_{BP_{risky}} =\int_0^T{e^{(\lambda+r)t}\mathrm{dt}} }=\left\{\frac{1-e^{(\lambda+r)T}}{\lambda+r}\right\}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a nice 'quick and dirty' formula for the risky duration which is surprisingly useful for calculating CDS MTMs or CR01 (which latter is the PV change. Now, let's have a look at a CDS MTM:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$PV_{CDS}=PV_{loss\,leg}-PV_{premium\,leg}&#xA;=(1-R)\int_0^T{\lambda e^{(\lambda+r)t}\mathrm{dt}} -\kappa\int_0^T{e^{(\lambda+r)t}\mathrm{dt}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The loss leg integrand houses the survival density, $\kappa$ is the CDS premium or strike as it's often called, and the whole thing reduces to the familiar:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$PV_{CDS}=\{\lambda(1-R)-\kappa\}\cdot\left\{\frac{1-e^{(\lambda+r)T}}{\lambda+r}\right\}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is just $(par\,spread - strike)*risky\,duration$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given this we can see that for CDS, a 1bp move in the spread does indeed deflect the MTM by one unit of the spread duration, but for the fact that the duration is negatively convex for a bought protection position. As the hazard rate widens, the risky duration shortens. A name moving from say 100bp to 500bp can easily lose 15% of its delta on say a 5y CDS struck at 1%, which is material.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally then just to write down a simple formula in a similar vein for a risky bond, we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\displaystyle{PV_{risky\,bond} =\kappa\int_0^T{e^{(\lambda+r)t}\mathrm{dt}} +e^{-(\lambda+r)T}+R\int_0^T{\lambda e^{(\lambda+r)t}\mathrm{dt}}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is risky coupon + principal on survival + recovery on default (integrated against density again). The quick and dirty formula here is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$PV_{risky\,bond}=\{\kappa+R\lambda\}\cdot\left\{\frac{1-e^{(\lambda+r)T}}{\lambda+r}\right\}+e^{-(\lambda+r)T}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once again you can see the risky duration term, enclosed in $\{\cdot\}$ making an appearance, however this time we have a different default payoff of $R$ and not $1-R$, together with a term survival principal. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope that's a helpful summary of some simplified credit pricing showing where spread duration crops up. The reduced form formulae are handy for playing around with in a spreadsheet. Probably ridden with typos I'm afraid so &lt;em&gt;caveat lector&lt;/em&gt;, cheers!&lt;/p&gt;&#xA;" OwnerUserId="19239" LastActivityDate="2016-11-24T01:07:08.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31161" PostTypeId="2" ParentId="27905" CreationDate="2016-11-24T01:08:46.830" Score="1" Body="&lt;p&gt;These are 'delta one' products, referring to the greek, i.e. a 1-to-1 change in the product's price given a change in the underlying.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2016-11-24T01:08:46.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31162" PostTypeId="1" AcceptedAnswerId="31164" CreationDate="2016-11-24T01:24:08.247" Score="3" ViewCount="1091" Body="&lt;p&gt;I recently went through some commodities forward curve modeling documentations, where a diffusion model for the forward price $F(t,T)$ was modeled as a driftless diffusion process (as a function of t with T fixed). The document did not mention whether this model is under risk-neutral measure or real-world measure. The model was estimated using historical data assuming trendless. It was later also used for derivative pricing, which is supposedly under the risk neutral measure. For privacy purposes I cannot reveal the source of this document, but just wonder if it is the case that for commodities, these two measures are the same? Is the forward price expected to not change over time even under the real-world measure? If so, what is the argument? Risk premium equal to zero in the commodities world?&lt;/p&gt;&#xA;" OwnerUserId="20158" LastEditorDisplayName="user16651" LastEditDate="2016-11-24T10:29:43.670" LastActivityDate="2017-03-13T12:21:25.817" Title="Is forward price trendless under the real-world measure?" Tags="&lt;risk-neutral-measure&gt;&lt;commodities&gt;&lt;risk-premium&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31163" PostTypeId="2" ParentId="27812" CreationDate="2016-11-24T02:37:52.540" Score="1" Body="&lt;p&gt;The logic is that $P_t\geq e^{-r(T-t)}K-S_t$, but ${\bf \text{NOT}}$    $P_t\geq K-S_t$&lt;/p&gt;&#xA;" OwnerUserId="25086" LastActivityDate="2016-11-24T02:37:52.540" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31164" PostTypeId="2" ParentId="31162" CreationDate="2016-11-24T07:24:43.107" Score="1" Body="&lt;p&gt;Futures prices are drift less under risk neutral measure. In commodities market, it is often Futures.&#xA;They need to estimate volatility in their model.&#xA;Since volatilities are not affected by change of probability, you can estimate under real word measure.&#xA;So what you describe seems correct.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;#&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;To satisfy commentators. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the continuous time semi martingale framework of Girsanov theorem, a change of probability measure (equivalent) affects only the finite variation part.&#xA;So of course, if you speak about stochastic volatility models, then the sentence is not completely true. Volatilities have to be understood as diffusion part (the $\sigma_t$ in front of $dW_t$)&lt;/p&gt;&#xA;" OwnerUserId="20201" LastEditorUserId="20201" LastEditDate="2016-11-24T13:27:52.937" LastActivityDate="2016-11-24T13:27:52.937" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="31165" PostTypeId="2" ParentId="31162" CreationDate="2016-11-24T09:01:25.090" Score="1" Body="&lt;p&gt;The answer given by MJ73550 already covers most if the points in my opinion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would put it like this: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Concerning the drift: if the cost-of-carry relationship is used in your model then this is the correct drift to use for the spot price to derive the price any derivatives (forwards, futures, options) - this is the risk neutral drift.&#xA;This has nothing to do with the real world drift (which you can only guess/model for the future or observe from traded prices for the past).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you look at forwards then you imply the drift of the spot. Sometimes this is different to the cost-of-carry relationship (in commodity markets it might also be difficult to determine the convenience yield).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus the spot has some drift and it is fixed either by the forwards traded or cost-of-carry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far having modelled the drift of the spot in the risk neutral world we recall that we do not use it to guess the future but to make the prices of traded instruments match.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a forward or futures contract we don't need a risk neutral drift to match traded prices. The futures price already is the correct price for a linear derivative of the spot at some point in time in the future and that's it. But it still has volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then we have two approaches:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;if we want to price e.g. options on these futures then we have to use implied volatility (derived from other options on the same commodity). Then again prices will fit together. This is risk neutral.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;if we want to estimate the risk that we have from this futures position then we talk about the real world. Then we could look at historical volatility.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2016-11-24T09:01:25.090" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31166" PostTypeId="2" ParentId="31162" CreationDate="2016-11-24T09:12:33.440" Score="5" Body="&lt;h2&gt;Definitions&lt;/h2&gt;&#xA;&lt;p&gt;For fixed &lt;span class=&quot;math-container&quot;&gt;$T$&lt;/span&gt; and moving &lt;span class=&quot;math-container&quot;&gt;$t \leq T$&lt;/span&gt; then by definition &lt;span class=&quot;math-container&quot;&gt;$\color{blue}{(*)}$&lt;/span&gt;, forward prices &lt;span class=&quot;math-container&quot;&gt;$F(t,T)$&lt;/span&gt; and future prices &lt;span class=&quot;math-container&quot;&gt;$\text{Fut}(t,T)$&lt;/span&gt; are both &lt;strong&gt;conditional expectations&lt;/strong&gt;. However, these expectations are not taken under the same probability measure. More specifically:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ F(t,T) = \Bbb{E}^{\Bbb{Q}^T}\left[ \left. S_T \right\vert \mathcal{F}_t \right]$$&lt;/span&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \text{Fut}(t,T) = \Bbb{E}^{\Bbb{Q}}\left[ \left. S_T \right\vert \mathcal{F}_t \right] $$&lt;/span&gt;&#xA;where&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$\Bbb{Q}$&lt;/span&gt; the &lt;em&gt;risk-neutral measure&lt;/em&gt;: measure under which the &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt;-value of all self-financing portfolio emerges as a martingale when expressed relative to the money market account numéraire &lt;span class=&quot;math-container&quot;&gt;$B_t = \exp(\int_0^t r_s ds)$&lt;/span&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$\Bbb{Q}^T$&lt;/span&gt; denotes the &lt;em&gt;&lt;span class=&quot;math-container&quot;&gt;$T$&lt;/span&gt;-forward measure&lt;/em&gt;: measure under which the &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt;-value of all self-financing portfolio emerges as a martingale when expressed with respect to the zero-coupon &lt;span class=&quot;math-container&quot;&gt;$T$&lt;/span&gt;-bond numéraire &lt;span class=&quot;math-container&quot;&gt;$P(t,T) = \Bbb{E}^\Bbb{Q}_t\left[B_t B_T^{-1}\right]$&lt;/span&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;From the above definitions we have that:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;When interest rates are deterministic, both measures &lt;em&gt;coincide&lt;/em&gt;. This can be seen by writing the &lt;em&gt;Radon-Nikodym derivative&lt;/em&gt; of the change of measure:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \left. \frac{d\Bbb{Q}}{d\Bbb{Q}^T} \right\vert_{\mathcal{F}_t} = \frac{P(0,T) B_t}{B_0 P(t,T)} $$&lt;/span&gt;&lt;/li&gt;&#xA;&lt;li&gt;Being simple conditional expectations, forward and future prices are martingales under their respective measures. This is a direct consequence of the &lt;strong&gt;tower property of conditional expectations&lt;/strong&gt;. Indeed, looking at the future price process without loss of generality, for &lt;span class=&quot;math-container&quot;&gt;$s &amp;lt; t$&lt;/span&gt; one can always write:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\Bbb{E}^{\Bbb{Q}^T}\left[ \left. \text{Fut}(t,T) \right\vert \mathcal{F}_s \right] = \Bbb{E}^{\Bbb{Q}^T}\left[ \Bbb{E}^{\Bbb{Q}^T}\left[ \left. \left. S_T \right\vert \mathcal{F}_t \right] \right\vert \mathcal{F}_s \right] = \Bbb{E}^{\Bbb{Q}^T}\left[ \left. S_T \right\vert \mathcal{F}_s \right] = \text{Fut}(s,T) $$&lt;/span&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$\color{blue}{(*)}$&lt;/span&gt; e.g. the &lt;em&gt;forward price&lt;/em&gt; is defined such that the value of a &lt;em&gt;forward contract&lt;/em&gt; is zero at inception. Denoting &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt; the inception date, the forward price is thus the strike &lt;span class=&quot;math-container&quot;&gt;$K$&lt;/span&gt; such that the expected discounted cash flows of the contract &lt;span class=&quot;math-container&quot;&gt;$\Bbb{E}^{\Bbb{Q}}_t \left[ B_t B_T^{-1} (S_T-K) \right] = 0$&lt;/span&gt;, which is equivalent to claiming that &lt;span class=&quot;math-container&quot;&gt;$F(t,T) = \Bbb{E}_t^{\Bbb{Q}^T} [S_T]$&lt;/span&gt; with &lt;span class=&quot;math-container&quot;&gt;$\Bbb{Q}^T$&lt;/span&gt; the measure associated to the zero coupon &lt;span class=&quot;math-container&quot;&gt;$T$&lt;/span&gt;-bond numéraire &lt;span class=&quot;math-container&quot;&gt;$P(t,T)$&lt;/span&gt; since &lt;span class=&quot;math-container&quot;&gt;$P(t,T)$&lt;/span&gt; is &lt;span class=&quot;math-container&quot;&gt;$\mathcal{F}_t$&lt;/span&gt;-measurable. A similar reasoning can be used for futures (but the daily settlement mechanism makes it a bit trickier to write down).&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h2&gt;Answer&lt;/h2&gt;&#xA;&lt;p&gt;To simplify things assume deterministic interest rates (so that &lt;span class=&quot;math-container&quot;&gt;$\Bbb{Q} = \Bbb{Q}^T$&lt;/span&gt;) and that we only manipulate adapted, continuous paths processes that verify the usual conditions.&lt;/p&gt;&#xA;&lt;p&gt;From the above definitions, forward/future prices are martingales under some  measure &lt;span class=&quot;math-container&quot;&gt;$\Bbb{Q}$&lt;/span&gt; equivalent to the real world measure &lt;span class=&quot;math-container&quot;&gt;$\Bbb{P}$&lt;/span&gt;. By the &lt;strong&gt;martingale representation theorem&lt;/strong&gt;, this means that they are driftless. Indeed we have that:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ F(t,T) = \Bbb{E}^\Bbb{Q}_t [ S_T ] \iff dF(t,T) = \sigma_t dW_t^\Bbb{Q} $$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;By &lt;strong&gt;Girsanov theorem&lt;/strong&gt; (or Abstract Bayes), this also means that they are not driftless under the equivalent real-world measure &lt;span class=&quot;math-container&quot;&gt;$\Bbb{P}$&lt;/span&gt; in general. Indeed,&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ F(t,T) = \Bbb{E}^\Bbb{P}_t [ S_T ] = \Bbb{E}^\Bbb{Q}_t \left[ S_T \frac{Z_T}{Z_t} \right] \iff dF(t,T) = \mu dt + \sigma_t dW_t^\Bbb{P} $$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;where &lt;span class=&quot;math-container&quot;&gt;$\mu$&lt;/span&gt; is given by the differential of the &lt;em&gt;quadratic covariation&lt;/em&gt; between &lt;span class=&quot;math-container&quot;&gt;$W_t^\Bbb{Q}$&lt;/span&gt; and the stochastic logarithm of the change of measure process&#xA;&lt;span class=&quot;math-container&quot;&gt;$\frac{Z_T}{Z_t}$&lt;/span&gt;, where &lt;span class=&quot;math-container&quot;&gt;$Z_t= \left. \frac{d\Bbb{P}}{d\Bbb{Q}}\right\vert_{\mathcal{F}_t}$&lt;/span&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \mu = d\langle W_t^\Bbb{Q}, \mathcal{L}(Z_T/Z_t) \rangle_t $$&lt;/span&gt;&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2017-03-13T12:21:25.817" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="31167" PostTypeId="1" AcceptedAnswerId="31170" CreationDate="2016-11-24T11:19:57.997" Score="2" ViewCount="232" Body="&lt;p&gt;The conditional expection of variance under risk neutral measure is  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}^Q[V_T |S_T=K]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $S_T$ and $K$ represent the spot price at maturity and strike price, respectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume I know the risk neutral density $q(V,S,t)$, I want to calculate the inverse of conditional expectation of $V_T$. Should I use this formula&lt;br&gt;&#xA;$$\frac{1}{\mathbb{E}^Q[V_T|S_T=K]} = \frac{1}{\int V_t \cdot q(v,s,t)\cdot dV}$$&#xA;or another formula&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{1}{\mathbb{E}^Q[V_T|S_T=K]} = \frac{\int q(v,s,t)\cdot dV}{\int V_t \cdot q(v,s,t)\cdot dV}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Further, if&lt;br&gt;&#xA;$$g(v,s,t)\approx q(v,s,t)\cdot dv \cdot ds$$&#xA;I wonder if we can get&lt;br&gt;&#xA;$$\Bbb{E}^\Bbb{Q}\left[ V_T \vert S_T = s \right] = \frac{\int_\Omega v\,q_{V_T,S_T}(v, s,T)  dv}{\int_\Omega q_{V_T,S_T}(v, s,T) dv} \approx \frac{\sum v\cdot q_{V_T,S_T}(v,s,t) \cdot dv }{\sum q_{V_T,S_T}(v,s,t) \cdot dv}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$= \frac{\sum v \cdot \frac{g(v,s,t)}{dv \cdot ds} \cdot dv }{\sum \frac{g(v,s,t)}{dv \cdot ds} \cdot dv} = \frac{\sum v \cdot g(v,s,t)}{\sum g(v,s,t)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="25302" LastEditorUserId="467" LastEditDate="2016-11-25T17:26:47.943" LastActivityDate="2016-12-05T14:53:49.083" Title="How to express the conditional expected variance under the risk neutral measure?" Tags="&lt;risk-neutral-measure&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31170" PostTypeId="2" ParentId="31167" CreationDate="2016-11-24T12:47:48.820" Score="3" Body="&lt;p&gt;Assume that $q_{V_T,S_T}(v,s,T)$ represents the known joint pdf of 2 continuous random variables $V_T$ and $S_T$ under some probability measure $\Bbb{Q}$. Further assume that the definition domain of $V_T$ is $\Omega$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By definition of the expectation operator + conditional probability density function&#xA;$$ \Bbb{E}^\Bbb{Q}\left[ V_T \vert S_T = s \right] = \int_\Omega \, q_{V_T \vert S_T}(v, s, T) dv $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the product rule of probability&#xA;$$ q_{V_T \vert S_T}(v, s, T) q_{S_T}(s,T) = q_{V_T,S_T}(v, s,T) $$&#xA;hence, going back to the expectation calculation&#xA;$$ \Bbb{E}^\Bbb{Q}\left[ V_T \vert S_T = s \right] = \frac{\int_\Omega v\, q_{V_T,S_T}(v, s,T) dv}{q_{S_T}(s,T)} $$&#xA;Finally using the sum rule to express the marginal $q_{S_T}$ from the joint pdf $q_{V_T,S_T}$ one gets:&#xA;$$ \Bbb{E}^\Bbb{Q}\left[ V_T \vert S_T = s \right] = \frac{\int_\Omega v\, q_{V_T,S_T}(v, s,T) dv}{\int_\Omega q_{V_T,S_T}(v, s,T) dv} $$&#xA;which is equivalent to &lt;strong&gt;the second formula&lt;/strong&gt; you mention.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-11-27T13:31:30.253" LastActivityDate="2016-11-27T13:31:30.253" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31171" PostTypeId="1" CreationDate="2016-11-24T13:12:28.477" Score="2" ViewCount="95" Body="&lt;p&gt;It is no secret that most systematic (quantitative) hedge funds have been doing poorly in 2016. Factor targeting strategies (momentum, value etc.) are all underperforming in most regions and sectors. I was wondering what is going on in the world right now that is causing this. It is possible to come up with a story with hindsight as to what happened in a certain period in history. It is usually hard (or impossible) to verify such a story so I imagine answering this question is even harder. If the answers are bound to be too subjective for this site, I can try to adapt the question.&lt;/p&gt;&#xA;" OwnerUserId="11597" LastActivityDate="2016-11-24T14:05:48.913" Title="Factors not working" Tags="&lt;factor-investing&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31173" PostTypeId="2" ParentId="22377" CreationDate="2016-11-24T13:26:08.087" Score="3" Body="&lt;p&gt;For example iShares has ETFs following &lt;a href=&quot;https://www.ishares.com/uk/individual/en/products/251860/ishares-msci-europe-ucits-etf-inc-fund?siteEntryPassthrough=true&amp;amp;locale=en_GB&amp;amp;userType=individual&quot; rel=&quot;nofollow noreferrer&quot;&gt;MSCI Europe&lt;/a&gt; as well as &lt;a href=&quot;https://www.ishares.com/uk/individual/en/products/251381/ishares-msci-europe-minimum-volatility-ucits-etf&quot; rel=&quot;nofollow noreferrer&quot;&gt;MSCI Europe Minimum Volatility&lt;/a&gt; indices. The P/E ratio (as of 23.11.16) for MSCI Europe ETF was 16.87, while the figure for MSCI Europe Minimum Volatility ETF was 18.16.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus one could argue that the Min vol index is more expensive. It is another topic, whether it makes sense to use direct P/E comparisons to compare cheapness of different indices. For example, the min vol index could include &quot;better&quot; companies on average, and thus paying more for them might be totally appropriate, and wouldn't automatically mean that low vol stocks were overpriced.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rob Arnott has recently argued (among other things) that &lt;a href=&quot;https://www.researchaffiliates.com/en_us/publications/articles/442_how_can_smart_beta_go_horribly_wrong.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;low volatility is expensive&lt;/a&gt;, while Cliff Asness of AQR &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2763956&amp;amp;utm_content=bufferac36e&amp;amp;utm_medium=social&amp;amp;utm_source=twitter.com&amp;amp;utm_campaign=buffer&quot; rel=&quot;nofollow noreferrer&quot;&gt;strongly disagrees&lt;/a&gt; about his usage of value metrics (such as P/E or P/B) in comparing cheapness of different equity factors/styles. &lt;a href=&quot;http://www.bloomberg.com/news/articles/2016-04-25/smart-beta-war-rages-on-as-cliff-asness-slams-pimco-star-s-paper&quot; rel=&quot;nofollow noreferrer&quot;&gt;One of the articels on the argument.&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="25364" LastActivityDate="2016-11-24T13:26:08.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31174" PostTypeId="2" ParentId="31171" CreationDate="2016-11-24T13:46:10.437" Score="3" Body="&lt;p&gt;In addition to momentum and value strategies you mentioned, some other common factor-based strategies are carry, trend (i.e. time-series momentum).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a very general (and subjective) answer, I personally think there have been a number of changes in capital markets in the recent couple of years, that adversely affect the returns of these kinds of strategies. Some of them are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i) The markets have not have very strong trends. Instead there have been large sell-offs followed by strong rebounds as seen in August 2015, Brexit, etc. These have been very challenging for momentum and trend strategies, as they go in with a lot of risk, only to sell it off near the bottom, just as markets are about to rebound.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ii) Markets have been generally more macro driven with increasing correlations within stocks and also between asset classes. In general, little dispersion among asset returns, which means that many long-short strategies are suffering.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;iii) Small differences in global interest rates meaning hard time for carry strategies (especially in FX, but also in other asset classes).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another reason might be increased interest in systematic alternative risk premia strategies, leading to a more competitive market and lower risk premia.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit: It will definitely be interesting to see if there will be other, more systematic answers to this.&lt;/p&gt;&#xA;" OwnerUserId="25364" LastEditorUserId="25364" LastEditDate="2016-11-24T14:05:48.913" LastActivityDate="2016-11-24T14:05:48.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31175" PostTypeId="2" ParentId="7894" CreationDate="2016-11-24T15:01:52.737" Score="2" Body="&lt;p&gt;In a recent paper - &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2785045&quot; rel=&quot;nofollow noreferrer&quot;&gt;Cointegration and Relative Value Arbitrage&lt;/a&gt; by Binh Do and Robert Faff, the issue of relative value arbitrage with three stocks is addressed. On page 27 they formulate the cointegrating relation similarly to how you did: $$\ p_{1t} = \alpha + \gamma p_{2t} + \beta p_{3t} + \epsilon_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They also say that the dollar weights of the asset should satisfy the following equations:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ w_1/w_2 = p_{1t}/-\gamma p_{2t} $$&#xA;$$ w_1/w_3 = p_{1t}/-\beta p_{3t} $$&#xA;$$ |w_1| + |w_2| + |w_3| = 2 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="25364" LastActivityDate="2016-11-24T15:01:52.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31179" PostTypeId="1" AcceptedAnswerId="31500" CreationDate="2016-11-24T20:46:35.803" Score="0" ViewCount="180" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Prove that every point on the capital market line corresponds to a unique portfolio.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Attempted proof&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that each point on the capital market line represents a linear combination of the risk free rate and some portfolio. But I am not really sure how to show that we have uniqueness. Any suggestions or references are greatly appreciated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that we can assume the risk-free rate is zero, which is what my professor presented. Perhaps we would need a different proof if the risk-free rate was not zero but I am not sure, as usual I am lost.&lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="467" LastEditDate="2016-11-25T17:21:54.377" LastActivityDate="2016-12-14T23:25:38.467" Title="How to prove that every point on the capital market line corresponds to a unique portfolio" Tags="&lt;modern-portfolio-theory&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31180" PostTypeId="1" CreationDate="2016-11-24T20:57:32.413" Score="0" ViewCount="28" Body="&lt;p&gt;I am looking at a company's 10-k filing history for my valuation. I have collected figures for &lt;code&gt;retained earnings&lt;/code&gt;, &lt;code&gt;net income&lt;/code&gt; and &lt;code&gt;dividend payments&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would expect: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;retained earnings(y2) = retained earnings(y1) + Net income(y2) - Dividends(y2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However this is off by a about a million (or 5%). Does anyone have any accounting insights on why this might be off??&lt;/p&gt;&#xA;" OwnerUserId="24497" LastActivityDate="2016-11-24T20:57:32.413" Title="Why does the difference between two year's retained earnings not add up?" Tags="&lt;finance&gt;&lt;valuation&gt;&lt;accounting&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31181" PostTypeId="1" AcceptedAnswerId="31188" CreationDate="2016-11-24T22:59:26.040" Score="6" ViewCount="2870" Body="&lt;p&gt;Quanto options pricing formula, as described in this &lt;a href=&quot;https://mathfinance.com/wp-content/uploads/2017/06/wystup_quanto_eqf.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;paper&lt;/a&gt; is a function of two volatilities: one from the underlying asset and another from the exchange rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I read the &quot;right&quot; volatilies to be used in the quanto option pricing formula from the volatility surfaces from the underlying asset and the exchange rate?&lt;/p&gt;&#xA;" OwnerUserId="25437" LastEditorUserId="28328" LastEditDate="2019-03-24T19:55:06.163" LastActivityDate="2019-03-24T19:55:06.163" Title="Which volatilities should I use for Quanto Options?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;volatility&gt;&lt;implied-volatility&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="31182" PostTypeId="1" AcceptedAnswerId="31185" CreationDate="2016-11-24T22:59:57.433" Score="2" ViewCount="192" Body="&lt;p&gt;I have only recently started looking into options trading, so the question may come off as ignorant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My thought was that for an underlying security that has no special event like earnings.  Could we construct a pair of option trades to obtain roll yield on time value?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A simple case: In November, sell a call option expiring in December and buy another call option expiring in January next year, both at the same strike price.  Would this allow me to extract the time value while hedging against price movement?&lt;/p&gt;&#xA;" OwnerUserId="25439" LastEditorUserId="16160" LastEditDate="2016-11-24T23:28:31.340" LastActivityDate="2017-12-28T16:49:02.027" Title="Roll Yield on Options?" Tags="&lt;options&gt;&lt;yield&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31183" PostTypeId="1" CreationDate="2016-11-24T23:45:11.863" Score="1" ViewCount="176" Body="&lt;p&gt;Let's suppose that &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;there is an option on a futures contract,  &lt;/li&gt;&#xA;&lt;li&gt;the underlying asset for the future is an index, and   &lt;/li&gt;&#xA;&lt;li&gt;the future is a cash settled contract.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In this case you have a second-order derivative: an option on a future on an index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm going to design an optional combination and then make delta hedging, i.e. buy/sell a certain number of futures contracts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit after Lliane's answer&lt;/strong&gt; I have a time series (close price of the future), it's length is 2 years (from December, 18, 2014 to December, 15, 2016). The expiration data of the future is Dec, 15, 2016. The traiding volume of future is not uniform and it looks like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/RIli9.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/RIli9.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to estimate a distribution of log-returns of the future. For VaR, i should use last 252 days. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Questions&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) What time series should be used in the calculations with this second-order derivative? The futures time series or the index one?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) What length of time series should be used in the calculations with this second-order derivative?&lt;/p&gt;&#xA;" OwnerUserId="20913" LastEditorUserId="20913" LastEditDate="2017-01-08T08:50:18.403" LastActivityDate="2017-01-08T08:50:18.403" Title="What time series and length should be used for a second-order derivative?" Tags="&lt;options&gt;&lt;futures&gt;&lt;hedging&gt;&lt;var&gt;&lt;reference-request&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31184" PostTypeId="2" ParentId="31183" CreationDate="2016-11-24T23:59:26.977" Score="3" Body="&lt;p&gt;Your exposure is on the future contract, not the underlying asset so I would hedge based on the future, or else you'll have basis risk.&lt;/p&gt;&#xA;" OwnerUserId="1181" LastActivityDate="2016-11-24T23:59:26.977" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31185" PostTypeId="2" ParentId="31182" CreationDate="2016-11-25T00:06:47.417" Score="1" Body="&lt;p&gt;What you describe is called a calendar spread, however as the deltas of the two options will differ when they are not at the money, thus you are not really hedging against price movement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Calendar spreads have been discussed extensively here and elsewhere&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/16727/why-a-calendar-spread-is-a-preferred-strategy-in-a-low-volatility-period&quot;&gt;Why a calendar spread is a preferred strategy in a low volatility period&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/16791/how-to-manage-risk-on-a-call-calendar-when-underlying-is-falling&quot;&gt;How to manage risk on a call calendar when underlying is falling&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.optionseducation.org/strategies_advanced_concepts/strategies/long_call_calendar_spread.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.optionseducation.org/strategies_advanced_concepts/strategies/long_call_calendar_spread.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1181" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2016-11-25T00:06:47.417" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31188" PostTypeId="2" ParentId="31181" CreationDate="2016-11-25T09:31:59.677" Score="4" Body="&lt;p&gt;As usual, if you can put your hands on liquid quanto instruments' prices (e.g. some quanto futures like the dollar-quantoed Nikkei trading on the CME), then you could directly &lt;em&gt;imply&lt;/em&gt; the quanto adjustment $\rho\sigma\tilde{\sigma}$. The problem is that quanto option markets are not as developped as plain vanilla ones and you must resort to something else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume you are pricing a quanto option of maturity $T$ and strike $K^Q$. The issue with doing what is mentioned in one of the comments, namely picking $$\sigma = \Sigma(K^Q,T),\quad \tilde{\sigma}=\tilde{\Sigma}(\text{atm},T)$$ where I used the notation $\Sigma(K,T)$ (resp. $\tilde{\Sigma}(K,T)$) to denote the full Black-Scholes volatility surface of the equity (resp. currency pair), is that this will make the quanto forward dependent on the strike of the quanto option to be priced, which represents an arbitrage opportunity (you can easily convince yourself using call put parity for quanto vanillas). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One remedy is to pick the ATM vol both for the currency and the equity pair $$\sigma = \Sigma(\text{atm},T),\quad  \tilde{\sigma} = \tilde{\Sigma}(\text{atm},T)$$&#xA;The problem in that case, is that in the limit as the equity/fx correlation $\rho$ tends towards zero, the prices of your quanto options will not be consistent plain vanilla ones, since you'll always use the $\text{atm}$ vol. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you really want to be consistent with the smiles of the plain vanilla options (both in the equity and forex markets), then you need a more complex working modelling assumption to begin with (e.g. local or stochastic volatility model for both the equity and the currency pair).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not you could also compute historical covariance and assimilate that to $\rho \sigma \tilde{\sigma}$. There is no perfect way of doing things here.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Edit]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $S$ represent a risky asset denominated in a FOR(eign) currency. Let $\xi_0$ denote a constant FOR/DOM conversion rate agreed on at the quanto contract inception date (chosen equal to $1$ in most applications). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you agree that, in order to preclude arbitrage opportunities, $S_T$, or equivalently $\xi_0 S_T$, should have a unique distribution under some Equivalent Martingale Measure?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Stated differently, the distribution of $\xi_0 S_T$ shouldn't depend on some exogenous parameter, such as a strike level, since that would make it non unique (i.e. one distribution per exogenous parameter value).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well in a BS world (equity $S$ and FX rate $X$ driven by correlated GBMs), one can show that the quanto forward computes as:&#xA;$$ F^{\text{quanto}}(t,T) = F(t,T) e^{-\rho \sigma_S \sigma_X (T-t)} $$&#xA;where $\sigma_S$ (resp. $\sigma_X$) are the constant volatilities of the individual GBMs; $\rho$ is their instantaneous correlation; and $F(t,T)$ the standard equity forward price at $T$ of the asset $S$ whose spot price is known at time $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if you pick $\sigma_S = f(K)$ then clearly the quanto forward becomes a function of $K$. This means that the first moment of the distribution of $\xi_0 S_T$ (hence $S_T$) is a function of $K$ which violates the former uniqueness assumption.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-12-13T14:38:13.487" LastActivityDate="2016-12-13T14:38:13.487" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="31191" PostTypeId="2" ParentId="30977" CreationDate="2016-11-25T11:50:02.397" Score="2" Body="&lt;p&gt;It sounds like you want to know the specifics of assignment once an equity option is exercised, and this is really a 'check with your broker' question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your broker will have a cut-off time to exercise a contact. If you exercise  during that day the security will settle on your account after the normal stock settlement period - i.e. as if you had purchased the security on market, something like T+2 (not to be confused with options settlement which is generally T+1). So, it doesn't matter when on a day you exercise, the security will still settle on your account on the same morning.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most brokers will allow you to sell some or all of the assigned stock before the settlement date and lock in a return (e.g. at the same time as you exercise the call option, you sell an equal quantity of the underlying security on-market). This will generally mean you don't need to provide funding on the settlement date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can reverse the above logic for a put option.&lt;/p&gt;&#xA;" OwnerUserId="24676" LastEditorUserId="24676" LastEditDate="2016-11-25T12:14:54.843" LastActivityDate="2016-11-25T12:14:54.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31192" PostTypeId="1" CreationDate="2016-11-25T13:18:48.783" Score="1" ViewCount="91" Body="&lt;p&gt;When we derive the boundary conditions for the American put options, if we let $S_f(t)$ be the optimal exercise boundary, for $S \gt S_f(t)$ we get $$\frac{1}{2}\sigma^2S^2\frac{\partial^2P}{\partial S^2}+\frac{\partial P}{\partial t}-rP+rS\frac{\partial P}{\partial S} \le 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is it $\le$ and not $=$ like the derivation for the European put option?&lt;/p&gt;&#xA;" OwnerUserId="25452" LastEditorUserId="254" LastEditDate="2016-11-25T14:23:26.493" LastActivityDate="2016-11-25T16:56:15.877" Title="Question regarding the derivation of American Put option" Tags="&lt;black-scholes&gt;&lt;american-options&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31194" PostTypeId="2" ParentId="31192" CreationDate="2016-11-25T14:22:06.993" Score="0" Body="&lt;p&gt;Since we are specifying $S &amp;gt; S_f(t)$ you are correct, and equality holds.   The author was probably trying to generalize to an equation where no restriction on being above the exercise boundary holds.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mathematically, this is clumsy and useless but it often motivates the early exercise updates when we are using finite difference schemes (like trees or grids) to price the option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recall that in these schemes we discretize underling prices to a grid $S_n$ and backwardate from time $t^{m}$ to $t^{m+1}$ by applying a matrix operator to grid prices $P^m$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we use an explicit scheme like a tree this consists of computing&#xA;$$&#xA;\tilde{P}^{m+1} = C \cdot P^m&#xA;$$&#xA;for some matrix $C$ and then handling early exercise by setting&#xA;$$&#xA;{P}^{m+1} = \max\left(\tilde{P}^{m+1} , X\right)&#xA;$$&#xA;where $X$ are exercise values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For nodes on the grid with no neighbors above exercise value, equality holds exactly.  But right near exercise value the finite difference formula for $\frac{\partial^2 P}{\partial S^2}$ term gets an updated term inside, destroying the equality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{\partial^2 P_n}{\partial S^2} \approx \frac{P_{n+1} - 2P_n + {\color{red} {{X}_{n-1}}}}{\Delta S^2}&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2016-11-25T14:22:06.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31196" PostTypeId="2" ParentId="31181" CreationDate="2016-11-25T16:28:45.750" Score="2" Body="&lt;p&gt;when pricing a quanto you need to have a model for both individual asset with a correlation factor, and another model for the FX (ex you can have two Hull White models for IR rates and a Black and Scholes models for the FX diffusion).&#xA;The correlation is mainly calibrated onto historical values since implied correlation is not really accessible.&lt;/p&gt;&#xA;" OwnerUserId="24915" LastActivityDate="2016-11-25T16:28:45.750" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31197" PostTypeId="2" ParentId="31192" CreationDate="2016-11-25T16:56:15.877" Score="1" Body="&lt;p&gt;&lt;strong&gt;Hint&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The slop of option , delta, at $S=S_f(t)$ is $-1$, indeed&#xA;$$\frac{\partial P}{\partial S}=-1$$&#xA;thus we can say that the return from the portfolio can not be greater than the return from a bank deposit, therefore&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{1}{2}\sigma^2S^2\frac{\partial^2P}{\partial S^2}+\frac{\partial P}{\partial t}-rP+rS\frac{\partial P}{\partial S} \le 0$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Reference&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0521497892&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Mathematics of Financial Derivatives: A Student Introduction, Paul Wilmott , Sam Howison and Jeff Dewynn (1995)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerDisplayName="user16651" LastActivityDate="2016-11-25T16:56:15.877" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31198" PostTypeId="2" ParentId="30726" CreationDate="2016-11-25T16:56:51.017" Score="1" Body="&lt;p&gt;I'm not sure I really understand your question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I right in thinking that it amounts to asking whether the BS formula should write: $$\frac{\partial V}{\partial t} + \alpha S \frac{\partial V}{\partial S}  + \frac{1}{2} \frac{\partial^2 V}{\partial S^2} \sigma^2 S^2 - r V = 0$$ with $\alpha=r$ or $\alpha=\mu$? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this is the case, it is self-financing portfolios whose $t$-value should emerge as $\Bbb{Q}$ martingales. Thus, if the stock pays dividend $\alpha = r-q \ne r$. If your model includes a more complex cost of carry/repo cost, it should transpire through $\alpha$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you introduce real world effects (collateral, lending/borrowing asymmetry etc.) it can of course become more complicated; see &lt;a href=&quot;http://www.math.columbia.edu/~fts/What%20Rate%20to%20use%20v1.pdf&quot; rel=&quot;nofollow&quot;&gt;http://www.math.columbia.edu/~fts/What%20Rate%20to%20use%20v1.pdf&lt;/a&gt; (I did not check the validity of the equations but at least it will give you an idea of what effects can be included).&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2016-11-25T16:56:51.017" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31199" PostTypeId="1" AcceptedAnswerId="31201" CreationDate="2016-11-25T17:19:41.910" Score="2" ViewCount="423" Body="&lt;p&gt;Somewhat embarrassingly I'm stuck with something very elementary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to find the conditional probability of a stock movement (GBM):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{P} \big( S_t \geq b \vert S_s \leq b) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for $ t &amp;gt; s$. My main problem is to determine what $\mathbb P(S_t \geq b, S_s \leq b\big)$ equals. &lt;/p&gt;&#xA;" OwnerUserId="25456" LastEditorUserId="467" LastEditDate="2016-11-28T09:32:16.900" LastActivityDate="2016-11-28T09:32:16.900" Title="How to compute the conditional probability for a geometric Brownian process?" Tags="&lt;probability&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31200" PostTypeId="2" ParentId="31199" CreationDate="2016-11-25T18:40:13.787" Score="1" Body="&lt;p&gt;&lt;strong&gt;Hint&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let &#xA;$$dS_t=\mu S_tdt+\sigma S_t dW_t\,.\tag 1$$&#xA;Set $x_t=\ln S_t$, By application of Ito's lemma we have&#xA;$$x_t=x_0+\left(\mu-\frac 12 \sigma^2\right)t+\sigma W_t\tag 2$$&#xA;thus&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$x_t\sim\mathcal {N}\left(x_0+\left(\mu-\frac 12 \sigma^2\right)t\,,\,\sigma^2 t\right)\tag 3$$&#xA;on the other hand&#xA;$$\mathbb P(S_t \geq b\,, S_s \leq b\big)=\mathbb P(\ln S_t \geq \ln b\,, \ln S_s \leq \ln b\big)=\mathbb P(x_t\ge \ln b \,,\,x_s\le \ln b)\tag 4$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;&#xA;$$z_t=\frac{x_t-x_0-\left(\mu-\frac 12 \sigma^2\right)t}{\sigma\sqrt{t}}\sim \mathcal{N}(0,1)$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-11-25T19:20:19.173" LastActivityDate="2016-11-25T19:20:19.173" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="31201" PostTypeId="2" ParentId="31199" CreationDate="2016-11-25T18:56:09.620" Score="1" Body="&lt;p&gt;By a certain algebraic manipulation, what you need is the probability $P(W_t \ge a, W_s \le c)$, which can be computed as below:&#xA;\begin{align*}&#xA;P(W_t \ge a, W_s \le c) &amp;amp;= P(W_t-W_s \ge a-W_s, W_s \le c)\\&#xA;&amp;amp;=E\big(E\left(1_{W_t-W_s \ge a-W_s} 1_{W_s \le c} \mid W_s \right)\big)\\&#xA;&amp;amp;=E\big(1_{W_s \le c}E\left(1_{W_t-W_s \ge a-W_s}  \mid W_s \right)\big)\\&#xA;&amp;amp;=E\Big(1_{W_s \le c}\Big[1-\Phi\Big(\frac{a-W_s}{\sqrt{t-s}}\Big)\Big]\Big)\\&#xA;&amp;amp;=\Phi\Big(\frac{c}{\sqrt{s}} \Big)-\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\frac{a}{\sqrt{s}}}\Phi\Big(\frac{a-\sqrt{s}x}{\sqrt{t-s}} \Big)e^{-\frac{x^2}{2}} dx,&#xA;\end{align*}&#xA;where $\Phi$ is the cumulative distribution function of a standard normal random variable.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-11-25T19:21:18.893" LastActivityDate="2016-11-25T19:21:18.893" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31202" PostTypeId="2" ParentId="31179" CreationDate="2016-11-25T23:08:06.117" Score="1" Body="&lt;p&gt;You have the right idea: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Two different points A and B on the CML have different proportions in the risk free asset, the point to the left has more in the risk free asset than the point on the right. This means that the composition of the two portfolios is distinct , they are not the same, but rather each is unique.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2016-11-25T23:08:06.117" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31203" PostTypeId="2" ParentId="25050" CreationDate="2016-11-26T01:35:51.137" Score="4" Body="&lt;p&gt;Nothing is &quot;wrong,&quot; in the sense that your findings are out of line, but there is a very deep issue that is wrong.  I have written a set of papers on this.  Since you are not a student, but someone trying to use this, I will explain in a lightweight manner what is wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are three main branches of statistics.  In order of discovery they are the Bayesian, the Likelihoodist and the Frequentist.  There are also minor schools of thought as well.  The Bayesian school should really be called the Laplacian school.  The Bayesian school attempts to solve the question $\Pr(\theta|X)$.  The other two schools attempt to solve $\Pr(X|\theta)$, where $\theta$ is(are) some parameter(s) of interest and $X$ is a set of data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is important because they view different things as random.  For the Bayesian school, the parameter is random in the sense that you do not know which one is the true value of the parameter.  For the Frequentist school, parameters are fixed and in stochastic calculus treated as known.  This is critical because humans are not imprinted with the true long run return and true long run covariance matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Black CAPM can be structured as $$\min_{s'}s'\Sigma{s}$$ subject to $$s'\underline{1}=1$$ and $$E(s'(\mu+\epsilon))=\mu_{portfolio}$$ where s is an asset allocation vector, $\mu$ is the true return, $\Sigma$ is a covariance matrix, $\underline{1}$ is a vector of ones, and $\epsilon$ is a vector of shocks.  The problem is that I have proven this problem has no solution.  There is no valid solution to the CAPM, because the values are not truly known.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now that may sound picky, but there is a set of theorems behind it.  Bayesian methods use statistics in a manner that is radically different from how non-Bayesian methods use them.  Statistics are almost an afterthought rather than the key to the method.  Because statistics are a key element to non-Bayesian methods, mathematicians began asking what makes a statistic a valid statistic.  For example why isn't $\sum\sin(x_i)$ a valid estimator of a mean?  Why cannot you use it?  Prove it!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Abraham Wald solved this in 1940 through the complete class theorem.  Anything in the class is valid and anything outside the class of solutions is not valid.  He did this using Frequentist axioms.  To his consternation and surprise, he found that all Bayesian solutions are inside the class.  He also found that any solution that did not match the Bayesian solution, either for a particular data set or at the limit upon infinite repetition, was outside the class.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now this is difficult to talk about unless we talk about one asset at a time.  Using Markowitz's assumptions, lets imagine the wealth from one stock is well modeled by $$\tilde{w}=R\bar{w}+\epsilon.$$  This is equivalent to the time series, treating quantity of shares always a 1, to $$p_{t+1}=Rp_t+\varepsilon_{t+1}.$$  Although I have written a proof that shows for a double auction, ignoring liquidity and bankruptcy risk, the distribution of $\varepsilon$ must be normal, we will just assume normality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A given observation of return $r_t$ can be thought of as $p_{t+1}/p_t-1.$  If we look at the reward instead $R_t=1+r_t$, then we just have future value divided by present value.  If you are about to buy assets and it is time $t-1$ then under Markowitz's assumptions you cannot know the EXACT purchase or sale price.  This makes the numerator and the denominator random variables that are jointly normally distributed.  The distribution of the ratio of the reward is, under Markowitz's assumptions, $$\frac{1}{\pi}\frac{\Gamma}{\Gamma^2+(R_t-\mu)^2}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you calculate the expectation of R, you will find it does not exist.  Therefore you cannot take expectations.  The model cannot be solved as a Bayesian model using expectations, therefore the model has no valid solution in any school.  There is a likelihoodist proof by White in 1958 that says that an estimator for R is the least squares operator, but the sampling distribution is the Cauchy distribution therefore no estimation process exists.  The same problem exists for the Frequentists as there is no variance to minimize.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find formal papers on this at:&#xA;&lt;a href=&quot;https://ssrn.com/abstract=2828744&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://ssrn.com/abstract=2828744&lt;/a&gt;&#xA;and &#xA;&lt;a href=&quot;https://ssrn.com/abstract=2656681&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://ssrn.com/abstract=2656681&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, I have written a paper replacing the option pricing models and I am preparing a paper on subjectively optimal portfolio construction and also extending stochastic calculus using new operators.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short, you cannot do that to find an &quot;efficient frontier.&quot;&lt;/p&gt;&#xA;" OwnerUserId="25459" LastEditorUserId="25459" LastEditDate="2016-11-26T02:48:24.650" LastActivityDate="2016-11-26T02:48:24.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31205" PostTypeId="2" ParentId="30167" CreationDate="2016-11-26T15:15:00.427" Score="1" Body="&lt;p&gt;An example will illustrate things.  Let's say usdjpy forward is 100 and you are considering a usd1mm worth of a 120 call on usdjpy, which entitles you to buy 1mm usd using 120mm yen.  Let's say the correct delta hedge is 0.2mm usd versus 20mm yen.  Then viewed as an option on the usd, the delta is 0.20/1=20pct.  But viewed as an option on jpy, the delta is 20/120= 16.66pct.   Thus the same option has different deltas when measured 'the other way round.  There's no theoretical problem with this since we are using different numeraires.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-11-26T15:15:00.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31206" PostTypeId="1" CreationDate="2016-11-26T19:08:36.077" Score="4" ViewCount="2643" Body="&lt;p&gt;I'm trying to analyse 13F filings and those provide CUSIPs and names. I hoped the names would be sufficient to find the relevant Edgar filings but the names are often imprecise (e.g., &quot;ABBOTT LABS&quot; instead of &quot;ABBOTT LABORATORIES&quot; so Edgar search fails).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I had a way to reliably map CUSIPs to CIKs that would solve my problem - but &quot;official&quot; way of &lt;a href=&quot;https://www.sec.gov/edgar/NYU/cik.coleft.c&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.sec.gov/edgar/NYU/cik.coleft.c&lt;/a&gt; is a mapping from names to CIKs and again the names in 13F don't match the names in that file.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question is - what's the best free way to get from CUSIPs to CIKs? Or alternatively from CUSIPs to the same names as Edgar uses?&lt;/p&gt;&#xA;" OwnerUserId="25416" LastEditorUserId="25416" LastEditDate="2016-11-27T07:54:04.153" LastActivityDate="2020-07-17T03:14:04.323" Title="Map CUSIP to CIK" Tags="&lt;data&gt;&lt;data-mining&gt;&lt;edgar&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31208" PostTypeId="1" AcceptedAnswerId="31217" CreationDate="2016-11-27T00:11:52.270" Score="0" ViewCount="74" Body="&lt;p&gt;&lt;strong&gt;Background Information:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An Inconsistent pricing strategy is a self financing strategy $\phi$ with $V_T(\phi)= 0$  and $V_0(\phi) \neq 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A strong arbitrage is a self-financing strategy $\phi$ with $V_0(\phi) = 0$ and $V_T(\phi) &amp;gt; 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Suppose there exists an Inconsistent pricing strategy. Prove from the definition that there must exist a strong arbitrage. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Attempted proof - Let $\phi$ be a self-financing strategy such that $V_0(\phi)\neq 0$ and $V_T(\phi) = 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am confused how this is possible to prove seems like we have a direct contradiction. Any suggestions are greatly appreciated. &lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="24222" LastEditDate="2016-11-27T11:10:07.380" LastActivityDate="2016-12-13T21:17:53.697" Title="If there is an inconsistent pricing strategy then by defintion we have strong arbitrage" Tags="&lt;arbitrage&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;&lt;financial-engineering&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31209" PostTypeId="1" CreationDate="2016-11-27T02:14:49.207" Score="4" ViewCount="496" Body="&lt;p&gt;I'm reading the paper &lt;a href=&quot;https://arxiv.org/pdf/0904.0870.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;Risk Measures in Quantitative Finance&quot;&lt;/a&gt; by Mitra and Ji (2010). On page 2 it reads:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We note that some Academics distinguish between risk and uncertainty&#xA;  as first defined by Knight [Kni21]. Knight defines risk as randomness&#xA;  with known probabilities (e.g. probability of throwing a 6 on a die)&#xA;  whereas uncertainty is randomness with unknown probabilities (e.g.&#xA;  probability of rainy weather). However, in Financial risk literature&#xA;  this distinction is rarely made.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Let's say I have a portfolio optimization problem: &#xA;$$&#xA;L=\text{argmax}(C, X),&#xA;$$ &#xA;s.t. &#xA;$$&#xA;AX \le B, X \ge 0.&#xA;$$ &#xA;In a general case elements of vectors $C$, $B$ and the matrix $A$ can be random numbers. But we can have two cases: a) distibution characteristics of random variables are known (this is the case of risk), b) distibution characteristics of random variables aren't known (this is the case of uncertainty).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many of the &lt;a href=&quot;https://quant.stackexchange.com/tags&quot;&gt;tags at Quant Stack Exchange&lt;/a&gt; contain the word &quot;risk&quot; and only one tag contains the concept &quot;&lt;a href=&quot;https://quant.stackexchange.com/questions/29622/uncertain-volatility&quot;&gt;uncertain&lt;/a&gt;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to know an opinion of the QF community on this problem: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Do you distinguish these concepts: risk and uncertainty especially in statistical sense?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;F.H. Knight. Risk, uncertainty and profit. Houghton Mifflin Company, 1921.&lt;/li&gt;&#xA;&lt;li&gt;Mitra, Sovan, and Tong Ji. &quot;Risk measures in quantitative finance.&quot; International Journal of Business Continuity and Risk Management 1.2 (2010): 125-135.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="20913" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-11-28T03:16:09.773" Title="Difference between risk and uncertainty" Tags="&lt;risk&gt;&lt;reference-request&gt;&lt;uncertain-volatility&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31210" PostTypeId="2" ParentId="31209" CreationDate="2016-11-27T06:18:50.603" Score="4" Body="&lt;p&gt;I am one of the people (a minority in Quant Finance) who think there &lt;em&gt;is&lt;/em&gt; a difference between Risk and Knightian Uncertainty, and Alan Greenspan is another. Uncertainty explains what is meant by Financial Crisis: a situation (such as 2008) where the information is so confused that people find it impossible to assign probabilities to different scenarios. In this case investors generally stop what they are doing (they refuse to transact) and the standard methods of Risk Management become less applicable (if at all). What were previously thought of as No Arbitrage conditions may be violated. The markets essentially stop functioning temporarily and we rely on outside intervention by central banks, governments etc. to get by. It is a dangerous and scary situation, although t typically does not last long.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, as Sovan Mitra said, most people in Financial Risk do not agree with this view.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2016-11-27T06:18:50.603" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31211" PostTypeId="1" CreationDate="2016-11-27T10:21:20.907" Score="2" ViewCount="1324" Body="&lt;p&gt;I have a weighted portfolio with several assets and weights.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Liquidity of my assets varies from low to high and concentration of assets in the portfolio change from one asset to another, for example asset 1 may represent 5% of the portfolio with volume = 1.000.000,00 USD when asset 2 has 40% of the portfolio with volume = 200.000.000,00 USD over the same period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I measure the average liquidity of my portfolio to compare it's traddability with another portfolios with differents assets and weights ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first idea is simply to mean the all assets volume over a given period but unfortunatly it doesn't takes into account weights of every single assets in the portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second idea is to weight trading volume by it's corresponding asset's weight. For example liquidity of asset 1 would be &lt;code&gt;$1.000.000 * 0.05 = $50.000&lt;/code&gt; and liquidity of asset 2 would be &lt;code&gt;200.000.000,00 * 0.4 = $80.000.000&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this consistent with a measure of the average liquidity of a weighted portfolio ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you,&lt;/p&gt;&#xA;" OwnerUserId="15328" LastActivityDate="2018-09-18T23:00:15.630" Title="How to calculate average liquidity of a portfolio with multiple assets and weights?" Tags="&lt;liquidity&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31212" PostTypeId="2" ParentId="31211" CreationDate="2016-11-27T11:21:09.757" Score="1" Body="&lt;p&gt;Sounds like you need a liquidity metric per asset - do you have publically available trading volumes for all your assets so that in addition to the portfolio weight you can ascribe a liquidity number to each asset? If you don't have such a metric for all assets you may want to consider interpolating the assets over a liquidity grid (created using assets for which you do have a number) using some underlying property of the assets (eg for bonds you could consider ECB haircuts / cds-bond basis as proxies for 'liquidity' metrics  - however these latter will be dynamic which may or may not be desirable). Once you have a liquidity grid in which discretely, or continuously to bucket your assets, then the notional weighted liquidity measure would give you a metric to compare the liquidity of your portfolio to that of another, or indeed to those of assets that define your liquidity grid. Then:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Portfolio \; average \;liquidity\;\Lambda(\Pi)=\frac{\sum\limits_iN_i\cdot w_i\cdot \lambda(A_i)}{\sum\limits_iN_i\cdot w_i}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\lambda(A_i)=\phi(x_{i_1},...,x_{i_n}, G)$ is the individual asset liquidity metric where $\phi$ is some possibly mutivariate interpolation scheme that associates with each asset, based on asset attributes $\{x_{i_k}\}$ and a grid $G$ of reference assets whose liquidities are known vs those same attributes, a liquidity number. It might also be wise to make the asset liquidity a function of volume in your portfolio (eg if your quantity is several times the daily trading volume then it makes sense to attenuate the liquidity number. This is pretty general, you could make things a lot more straightforward with simplifying assumptions, the simplest being if you assets themselves had accessible trading data and so in a sense are themselves reference assets for your interpolation. my 2 cents' anyway - let me know if barking up wrong tree!&lt;/p&gt;&#xA;" OwnerUserId="19239" LastActivityDate="2016-11-27T11:21:09.757" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31213" PostTypeId="2" ParentId="31209" CreationDate="2016-11-27T12:15:17.327" Score="3" Body="&lt;p&gt;In classical finance you only work with &lt;em&gt;risk&lt;/em&gt; (according to the abovementioned definition), which you define in a certain way (e.g. volatility), try to estimate and work with the resulting probabilities. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having said that you will discover that in practice there is often a certain spread priced into financial instruments (like derivatives) which accounts for the unknown unknowns (like e.g. &lt;a href=&quot;https://en.wikipedia.org/wiki/Black_swan_theory&quot; rel=&quot;nofollow noreferrer&quot;&gt;black swans&lt;/a&gt;), e.g. when you look at deep OTM puts you will find that they are priced higher than standard pricing theory would suggest - this is &lt;em&gt;uncertainty&lt;/em&gt; priced into these instruments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another thing are concepts that are &lt;em&gt;called risks although in reality they are uncertainties&lt;/em&gt; according to the abovementioned definition, like &lt;em&gt;operational risks&lt;/em&gt;. These are notoriously hard to quantify, see e.g &lt;a href=&quot;http://eprints.lse.ac.uk/21368/1/DP16.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Power, M.: The invention of operational risk (2003)&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2016-11-27T12:23:32.697" LastActivityDate="2016-11-27T12:23:32.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31216" PostTypeId="2" ParentId="29869" CreationDate="2016-11-27T17:15:05.680" Score="2" Body="&lt;p&gt;Strictly speaking bonds and shares are Financial Instruments. To describe them as Financial Products (as done in the web site you quoted) seems careless or sloppy use of language, but perhaps OK in everyday life. In a job interview (or to impress my boss) I would use &quot;Financial Instrument&quot;. But don't waste time on this, it is a minor issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the distinction? The proper definition of Financial Product is that it is (believe it or not) just another name for a Financial Service, a service which a financial firm delivers to a Client. [Marketing personnel are fond of using the word &quot;product&quot; in this general sense]. Examples are: a bank account, an insurance contract, a brokerage account. A Financial Instrument on the other hand gives the owner specific legal rights recognized by law (the rights of a shareholder, of a bondholder) and these rights are transferred when the ownership changes. Stocks, bonds, options can be transferred from one person to another through appropriate mechanisms. OTOH you don't sell your bank account when you move and no longer need it, you close it, and maybe open another account with another bank (with different terms and conditions) in another city. It is a direct relationship between you and the bank, not an impersonal legal right that can be transferred.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-11-27T17:24:44.800" LastActivityDate="2016-11-27T17:24:44.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31217" PostTypeId="2" ParentId="31208" CreationDate="2016-11-27T17:48:54.477" Score="2" Body="&lt;p&gt;We assume that $V_0(\phi)&amp;lt;0$; otherwise, we can consider the strategy $-\phi$. Then, we buy extra $-V_0(\phi)/S_0^0$ share of the risk-free asset $S^0$, from the $k+1$ assets $S^0, S^1,\ldots, S^k$, which is the deposit or money-market account, and hold until maturity $T$, that is, we consider the trading strategy $\psi$, where &#xA;\begin{align*}&#xA;\psi_i = &#xA;\begin{cases}&#xA;-V_0(\phi)/S_0^0, &amp;amp; \text{ if } i=0,\\&#xA;0, &amp;amp; \text{ otherwise},&#xA;\end{cases}&#xA;\end{align*}&#xA;without any intermediate adjustment. It is then clear that $V_0(\psi+\phi)=0$, and $V_T(\psi+\phi)&amp;gt;0$. In other words, there exists a strong arbitrage strategy (e.g., $\psi+\phi$).&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-12-13T21:17:53.697" LastActivityDate="2016-12-13T21:17:53.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31218" PostTypeId="2" ParentId="4466" CreationDate="2016-11-27T19:30:42.960" Score="5" Body="&lt;p&gt;&lt;strong&gt;Which model to choose from a pool of candidate models depends on what you want to do with it.&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to do &lt;strong&gt;forecasting&lt;/strong&gt;, you should select a model that would be expected to deliver the most accurate forecasts. Akaike's information criterion (AIC) is known to asymptotically select a model (from a given pool) that will deliver the forecasts with the lowest mean squared error. Therefore, it is often used as a model selector in forecasting exercises, and justifiably so. AIC is easy to obtain from a fitted model (by hand or via a built-in function) , so it makes for a handy tool. An alternative to AIC could be the focused information criterion (FIC), which allows for much more flexibility in specifying what kind of loss function you wish to minimize (e.g. mean absolute error in place of mean squared error), but it also requires more involvement from the researcher; you need to derive the specific version of FIC based on your loss function before you can apply it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to &lt;strong&gt;recover the true model&lt;/strong&gt; and the true model happens to be among the set of candidate models, use Bayesian information criterion (BIC). Asymptotically it will select the true model with probability=1. Since most of the time the true model is not in the pool (the reality is more complex than our models), BIC will tend to select a model that approximates the true model the most closely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have yet another goal, a philosophically straightforward way to do model selection is to derive a version of FIC that reflects your goal (but again, it may be a challenging exercise on its own).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In all these cases, the candidate model pool has to be selected in the first place, and that is not a trivial task either. You may bring in subject-matter knowledge; probably you have an idea what type of models should describe your data generating process well. You may then explore a pool as large as is computationally feasible. However, bear in mind that information criteria are not entirely robust against overfitting. When you have a number of models with the same number of parameters, both AIC and BIC reduce to maximizing the likelihood, and that is not at all robust against overfitting. So in practice you may try a somehwta large pool but without going to extreme sizes.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The practice of seeking a model with statistically significant coefficients and well-behaved residuals as suggested in another answer is somehow tangential to the approach above. I am not sure the latter strategy optimizes any sensible loss function except for delivering a nice in-sample fit (and I mean: I am not sure). However, in sample we already know everything, we know each data point. The real goal is normally to generalize out of sample and either say something about the properties of the data generating process (e.g. test some hypotheses about it) or do forecasting. So then the approach above based on AIC, BIC and FIC makes sense. (Even so, recall that once model selection has been performed and you have ended up with a model of choice, you cannot trust the significance tests anymore because they are conditional on the model having been selected. The way of accounting for this conditioning properly is becoming an active research area in statistics.)&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;And then I have not touched upon &lt;strong&gt;regularized estimation&lt;/strong&gt; and &lt;strong&gt;model averaging&lt;/strong&gt; which are more advanced approaches that generalize the problem of model selection.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, you may find much more about all this at &lt;a href=&quot;https://stats.stackexchange.com&quot;&gt;Cross Validated&lt;/a&gt;, a sister site in the Stack Exchange system.&lt;/p&gt;&#xA;" OwnerUserId="19645" LastActivityDate="2016-11-27T19:30:42.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31219" PostTypeId="2" ParentId="31199" CreationDate="2016-11-28T02:01:25.880" Score="0" Body="&lt;p&gt;Another way to obtain many multi-period risk-neutral probabilities related to geometric Brownian motion processes is to use the valuation function for higher-order binaries. These contracts are special cases of the multi-asset multi-period $\mathbb{M}$-binaries introduced by Skipper and Buchen (2003).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In contrast to the others answers, I don't provide the derivation but refer to the original paper. See also Appendix B my paper Zhang and Thul (2016) for a summary of the notation and key results (sorry for the plug).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2-nd Order Bond Binaries&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The time $T_2$ terminal value of a $2$-nd order bond binary is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathcal{B}_{\xi_1, \xi_2}^{s_1, s_2} \left( S_{T_1}, S_{T_2}, T_2 \right)  = \mathrm{1} \left\{ s_1 S_{T_1} &amp;gt; s_1 \xi_1 \right\} \mathrm{1} \left\{ s_2 S_{T_2} &amp;gt; s_2 \xi_2 \right\}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e. this contract has a unit payoff conditional on the asset prices at times $T_1$ and $T_2$ being above ($s_i = 1$) or below ($s_i = -1$) the levels $\xi_1$ and $\xi_2$, respectively. Its time $0 \leq t &amp;lt; T_1$ value is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathcal{B}_{\xi_1, \xi_2}^{s_1, s_2} \left( S_t, t \right) = e^{-r \tau_2} \mathcal{N}_2 \left( \alpha_{0, 1}, \alpha_{0, 2}; \rho \right),&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\tau_i = T_i - t$, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\alpha_{0, i} = \frac{s_i}{\sigma \sqrt{\tau_i}} \left( \ln \left( \frac{S}{\xi_i} \right) + \left( r - \frac{1}{2} \sigma^2 \right) \tau_i \right)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\rho = s_1 s_2 \sqrt{\frac{\tau_1}{\tau_2}}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, $\mathcal{N}_2$ is the bivariate standard normal distribution function with the given correlation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Joint Probability&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using these results, you obtain the probability of interest as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathbb{P} \left\{ S_{T_1} &amp;lt; b, S_{T_2} &amp;gt; b \right\} = e^{r \tau_2} \mathcal{B}_{b, b}^{-, +} \left( S_0, 0 \right)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While you could just as well work out this particular case by hand, the above framework can often still be applied when you are interested in more complex probabilities. For example, barriers can be easily incorporated using the method of images; see e.g. Buchen (2001).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Buchen, Peter W. (2001) &quot;Image Options and the Road to Barriers&quot;, Risk Magazine, Vol. 14, No. 9, pp. 127-130&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Skipper, Max and Peter W. Buchen (2003) &quot;The Quintessiential Option Pricing Formula&quot;, Working Paper, School of Mathematics and Statistics, University of Sydney&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Zhang, Ally Quan and Matthias Thul (2016) &quot;How Much is the Gap? Efficient Jump Risk-Adjusted Valuation of Leveraged Certificates&quot;, Working Paper, &lt;a href=&quot;https://ssrn.com/abstract=2388734&quot; rel=&quot;nofollow noreferrer&quot;&gt;available on SSRN&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2016-11-28T08:47:49.200" LastActivityDate="2016-11-28T08:47:49.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31220" PostTypeId="2" ParentId="31209" CreationDate="2016-11-28T03:16:09.773" Score="2" Body="&lt;p&gt;It is easier to talk about these concepts by moving past Knight a bit.  There has been a lot of discussion since then.  The easiest way to start talking about this is in discussing the three main schools of thought in probability and statistics.  The schools are, in order of discovery, the Bayesian, the Likelihoodist and the Frequentist.  We are going to ignore Fisher's Likelihoodist school because it is epistemological in nature and implies no logical rational behavior.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the Bayesian school there is no such thing as chance.  It doesn't exist.  There is only uncertainty.  To give an example, imagine you watch someone toss a coin twenty times and it comes up head every time.  Now, imagine the same person tosses it H-T in perfect alternation in ten pairings of twenty tosses.  The person tossing the coin is the Amazing Randi.  He lets you inspect the coin and you have a physicist friend test it and it is a perfectly fair coin.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are uncertain as to whether the coin is the same coin that was tossed.  You are uncertain as to whether the Amazing Randi has sufficient control to cause the pattern of tosses.  You are even uncertain as to whether the Amazing Randi had complete control the entire time or whether some of the tosses were really accidents that worked out despite a loss of control.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Bayesian models there is only an absence of information.  Probability exists in the mind of the person making decisions.  It is not a physical property of the universe.  This is even true in quantum mechanics which is usually interpreted in terms of chance.  The goal is to use data to construct a distribution of &quot;plausabilities,&quot; to use Cox's terminology.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the Bayesian framework, data is fixed and not random.  There can be no such thing as a &quot;random sample.&quot;  It is non-nonsensical in meaning.  Because of this, the Bayesian definition of an expectation is $$E(\theta|X)=\int_{\theta\in\Theta}\theta{f(\theta|X)}\mathrm{d}\theta.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you would gamble on an uncertainty and an expectation exists, it does not exist for heavy-tailed distributions, then you integrate over the set of all possible models of the world.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the Frequentist world $\theta=k,k\in\Re$ and there is no uncertainty at all.  Rather than use the word &quot;risk&quot; at this point, we will discuss chance as the word risk has an additional meaning since Knight.  Events can happen only due to chance and when used in the calculus of variations, then all parameters are treated as perfectly known.  Chance is a physical property of the universe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mechanically, this is no different than treating the null hypothesis as strictly true.  In the Frequentist school there is no such thing as a p-value.  That is only part of the Likelihoodist school.  In the Frequentist school there is a value, $\alpha$, that creates an acceptance region and a rejection region.  If a sample implies that the null cannot be rejected, then it is treated AS IF true.  The Frequentist school is behavioral.  You do not know if it is true, but the only rational behavior is to act as if it is.  If it is in the rejection region, then you are are to behave AS IF false and AS IF the minimum variance unbiased estimator is the true value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the example, for the first test for a null of $\theta=.5$, the null would be rejected.  In the second sample, despite the weird pattern and the past observations, it would be accepted as true.  The samples cannot be combined due to the axioms.  This creates a weird to irrational response where one moment you are behaving as if false and the next as if true.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finance has almost entirely dropped the Bayesian meaning and almost entirely adopted the non-Bayesian meaning.  You rarely see a serious discussion of uncertainty in finance because all mean-variance finance models are Frequentist models.  They strictly depend upon Frequentist axioms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Frequentist definition of an expectation, where one exists, is $$E(X)=\int_{x\in\chi}xf(x|\theta)\mathrm{d}x.$$  Frequentist models live in the sample space, which is random.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Risk, in the Bayesian sense is the amount of resources exposed to uncertainty.  Risk in the Frequentist sense is the amount of resources exposed to chance.  Both definitions could have the phrase &quot;of loss,&quot; appended to the end.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This focus on Frequentist methods is problematic because it blocks good modeling.  Any function of the data is a statistic.  Therefore $\sum\sin(x_i)$ is a statistic.  Intuitively you may know it is a pointless statistic, but how do you show that mathematically?  It turns out that the problem was solved with what is known as the complete class theorem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any solution inside the acceptable set is valid and any solution outside the set is invalid.  The sum of the sines is an invalid estimator of the sample mean of the normal distribution.  You can know this because it is outside the complete class of solutions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All Bayesian solutions are inside the complete class of valid solutions.  Frequentist solutions are valid either to the extent they map to a Bayesian solution for a specific sample, or at the limit.  This is problematic because there is a recent proof that there does not exist a Frequentist solution for stocks.  It is the reason the CAPM has never been validated and the heavy tails exist in the tests.  Frequentist solutions are always outside the complete class of solutions.  They are valid for Vegas style gambles and for corporate bonds with fixed coupons, but not for stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would recommend reading &quot;Probability, the Language of Science,&quot; by E.T. Jaynes and &quot;Decision Theory:Principles and Approaches,&quot; by Parmigiani.  Models like the CAPM cannot work in a Bayesian framework, though it is far from obvious, which means they cannot work.  It is unfortunate that Knightian uncertainty fell out of discussion for elegant models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find papers on stocks and uncertainty at &#xA;&lt;a href=&quot;https://ssrn.com/abstract=2828744&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://ssrn.com/abstract=2828744&lt;/a&gt;&#xA;and &#xA;&lt;a href=&quot;https://ssrn.com/abstract=2656681&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://ssrn.com/abstract=2656681&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2016-11-28T03:16:09.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31222" PostTypeId="2" ParentId="31124" CreationDate="2016-11-28T04:08:35.103" Score="1" Body="&lt;p&gt;The risk of a 6s vs3s basis swap is usually expressed in two dimensions a) the risk to the 6s 3s basis swap widening ( i.e. Increasing the forwards for 6s by 1bp in parallel while keeping the forwards for 3s constant ) and the delta risk ( moving the forwards for 3s upwards by 1bp).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typically delta risk is only present in the &quot;stub&quot; at the short end of the curve.  Beyond the next 6mo libor setting , it's a pure basis swap , but prior to that there may be outright delta risk if 6 mo libor has been set and one 3 mo libor has not yet been set.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-11-28T04:08:35.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31224" PostTypeId="2" ParentId="22353" CreationDate="2016-11-28T09:13:24.400" Score="2" Body="&lt;p&gt;If $\sigma_{H}\ne 0$ and $v_0\ne \theta\ne \sigma^2_{BC}$ then prices  are different in BC and Heston model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Especial case&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the Black-Scholes model the dynamics of $S_t$ under risk neutral measure follow the stochastic process &#xA;$$dS_t=(r-q)S_tdt+\sigma_{\color{red}{BC}}S_tdW^{\mathbb{Q}}(t)\tag 1$$&#xA;on the other hand&#xA;$$dS_t=(r-q)S_t+\sqrt{v_t}S_tdW^{\mathbb{Q}}_1(t)\\&#xA;\quad  dv_t=\kappa(\theta-v_t)dt+\sigma_{\color{red}{H}}\sqrt{v_t}dW^{\mathbb{Q}}_2(t)\tag 2$$&#xA;where $d[W^{\mathbb{Q}}_1(t)\,,\,W^{\mathbb{Q}}_2(t)]=\rho dt$. In CRR model we have&#xA;$$\text{Var}[v_t\big{|}v_0]=\frac{v_0\sigma_{\color{red}{H}}^2e^{-\kappa t}}{\kappa}\left(1-e^{-\kappa t}\right)+\frac{\theta\sigma_{\color{red}{H}}^2}{2\kappa}\left(1-e^{-\kappa t}\right)^2\tag 3$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if we set  $\sigma_\color{red}{H}=0$ ,then&#xA;$$\text{Var}[v_t|v_0] = 0\tag 4$$&#xA;This will produce volatility that is time-varying, but $\color{red}{\text{deterministic}}$. Indeed&lt;br&gt;&#xA;$$dv_t=\kappa(\theta-v_t)dt\tag 5$$&#xA;or&#xA;$$v'_t+\kappa v_t=\kappa\theta\tag 6$$&#xA;Equation $(6)$ is a linear ordinary differential equation. We can show easily&#xA;$$v_t=\theta+c\,e^{-\kappa t}\quad ,\quad c\in\mathbb{R}\tag 7$$&#xA;Set $v_0=\theta=\sigma_{\color{red}{BC}}^2$. Therefore $c=0$ and $v=\sigma_{\color{red}{BC}}^2\,.$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;$\color{red}{\text{Warning}\,!}$&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the &lt;a href=&quot;http://www.danipina.com/dani/Books/claude/Heston-original-stoc.vol.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Heston Model&lt;/a&gt; we have&#xA;\begin{align}&#xA;C(t\,,{{S}_{t}},{{v}_{t}},K,T)={{S}_{t}}{{P}_{1}}-K\,{{e}^{-r\tau }}{{P}_{2}}\tag 8&#xA;\end{align}&#xA;where,for $j=1,2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;&amp;amp; \mathbb{P}_j({{x}_{t}}\,,\,{{v}_{t}}\,;\,\,{{x}_{T}},\ln K)=\frac{1}{2}+\frac{1}{\pi }\int\limits_{0}^{\infty }{\operatorname{Re}\left( \frac{{{e}^{-i\phi \ln K}}{{f}_{j}}(\phi ;t,x,v)}{i\phi } \right)}\,d\phi \tag 9 \\ &#xA; &amp;amp; {{f}_{j}}(\phi \,;{{v}_{t}},{{x}_{t}})=\exp [{{C}_{j}}(\tau ,\phi )+{{D}_{j}}(\tau ,\phi ){{v}_{t}}+i\phi {{x}_{t}}]\tag {10} \\ &#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;  &amp;amp; {{C}_{j}}(\tau ,\phi )=(r-q)i\phi \,\tau +\frac{a}{{{\sigma_{\color{red}{H}} }^{2}}}{{\left( ({{b}_{j}}-\rho \sigma_{\color{red}{H}} i\phi +{{d}_{j}})\,\tau -2\ln \left(\frac{1-{{g}_{j}}{{e}^{{{d}_{j}}\tau }}}{1-{{g}_{j}}}\right) \right)}} \tag{11}\\ &#xA; &amp;amp; {{D}_{j}}(\tau ,\phi )=\frac{{{b}_{j}}-\rho \sigma_{\color{red}{H}} i\phi +{{d}_{j}}}{{{\sigma_{\color{red}{H}} }^{2}}}\left( \frac{1-{{e}^{{{d}_{j}}\tau }}}{1-{{g}_{j}}{{e}^{{{d}_{j}}\tau }}} \right) \tag{12}\\ &#xA;\end{align}&#xA;such that&#xA;\begin{align}&#xA;  &amp;amp; {{g}_{j}}=\frac{{{b}_{j}}-\rho \sigma_{\color{red}{H}} i\phi +{{d}_{j}}}{{{b}_{j}}-\rho \sigma_{\color{red}{H}} i\phi +{{d}_{j}}} \\ &#xA; &amp;amp; {{d}_{j}}=\sqrt{{{({{b}_{j}}-\rho \sigma_{\color{red}{H}} i\phi )}^{2}}-{{\sigma_{\color{red}{H}} }^{2}}(2i{{u}_{j}}\phi -{{\phi }^{2}})} \\ &#xA; &amp;amp; {{u}_{1}}=\frac{1}{2}\,,\,{{u}_{2}}=-\frac{1}{2}\,,\,a=\kappa \theta \,,\,{{b}_{1}}=\kappa +\lambda -\rho \sigma_{\color{red}{H}} \,,\,{{b}_{2}}=\kappa +\lambda \,,\ {{i}^{2}}=-1 \\ &#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We can not simply substitute $\sigma_{\color{red}{H}} = 0$ into the pricing functions,&#xA;  because that will lead to division by zero in  the expressions for $C_j(\tau,\phi)$ and  $D_j(\tau,\phi)$.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;With $\sigma_{\color{red}{H}}=0$, the&#xA;&lt;a href=&quot;https://en.wikipedia.org/wiki/Riccati_equation&quot; rel=&quot;nofollow noreferrer&quot;&gt;Riccati equation&lt;/a&gt;  reduces to the ordinary first-order differential equation in the Heston's article (1993) &#xA;$$\frac{\partial {{D}_{j}}}{\partial \tau }={{p}_{j}}-{{b}_{j}}{{D}_{j}}\tag {13}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $p_j=u_j i\phi-\frac 12 \phi^2$.The solution of this ODE is &#xA;$$D_j(\tau ,\phi )=\frac{(i{{u}_{j}}\phi -\frac{1}{2}{{\phi }^{2}})(1-{{e}^{-{{b}_{j}}\tau }})}{{{b}_{j}}}\tag {14}$$&#xA;on other hand , Heston showed &#xA;$$\frac{\partial {{C}_{j}}}{\partial \tau }=ri\phi +a{{D}_{j}}\tag{15}$$&#xA;substitute $(14)$ in $(15)$ and integrate to obtain&#xA;$${{C}_{j}}(\tau ,\phi )\ =ri\phi \tau +\frac{a(i{{u}_{j}}\phi -\frac{1}{2}{{\phi }^{2}})}{{{b}_{j}}}\left( \tau -\frac{1-{{e}^{-{{b}_{j}}\tau }}}{{{b}_{j}}} \right)\tag{16}$$&#xA;In the case $j=2$ and $\lambda=0$, we have&#xA;$$\begin{align}&#xA;  &amp;amp; {{D}_{2}}(\tau ,\phi )=-\frac{(i\phi +{{\phi }^{2}})(1-{{e}^{-\kappa \tau }})}{2\kappa } \\ &#xA; &amp;amp; {{C}_{2}}(\tau ,\phi )\ =ri\phi \tau -\frac{\theta (i\phi +{{\phi }^{2}})}{2}\left( \tau -\frac{1-{{e}^{-\kappa \tau }}}{\kappa } \right) \\ &#xA;\end{align}&#xA;\tag {17}$$&#xA;We know&#xA;$${{f}_{2}}(\phi ;{{\ln S}_{t}},{{v}_{t}})=\exp\left[i\phi\,{\ln S_t}+{{C}_{2}}(\tau \,,\,\phi )+{{D}_{2}}(\tau \,,\,\phi ){{v}_{t}}\right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;let  $v_0=\theta=\sigma_{\color{red}{BC}}^2$, thus&#xA;$$\color{red}{{{f}_{2}}=\exp\left( i\phi \left[\ln {{S}_{t}}+(r-\frac{1}{2}{{\sigma }_{BC}}^{2})\tau \right]-\frac{1}{2}{{\phi }^{2}}{{\sigma }_{BC}}^{2}\tau  \right)=\mathbb{E}\left[\exp\left(i\,\phi\,\ln S_t\right)\right]\tag {18}}$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-11-28T11:09:02.083" LastActivityDate="2016-11-28T11:09:02.083" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="31226" PostTypeId="1" AcceptedAnswerId="31303" CreationDate="2016-11-28T12:12:22.653" Score="1" ViewCount="588" Body="&lt;p&gt;I would like to know what's the way on how to calculate the weighted average interest rate for a loan portfolio properly, especially when looking at periods shorter than a year. The basic definition is, that the Weighted Average Interest Rate = Interest Paid in Period / Total Debt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the question becomes a bit clearer, when I use an example. Please assume a loan of 10000 and an annual interest rate of 5%, which should be paid back in 12 monthly installments. Based on this loan I would like to know the average weighted interest rate in each month. &#xA;Based on the simplest calculation the annual weighted interest rate would be 5%. But I thought in case of a monthly perspective it is necessary to look at the monthly interest expense relative to the debt outstanding. &#xA;That would mean the interest part of the repayment divided by the debt outstanding.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Period  Payment  Interest   Repayment   Debt Outstanding&#xA;   1    856.07        41.67   814.41    9185.59&#xA;   2    856.07        38.27   817.80    8367.79&#xA;   3    856.07        34.87   821.21    7546.58&#xA;   4    856.07        31.44   824.63    6721.95&#xA;   5    856.07        28.01   828.07    5893.88&#xA;   6    856.07        24.56   831.52    5062.37&#xA;   7    856.07        21.09   834.98    4227.39&#xA;   8    856.07        17.61   838.46    3388.93&#xA;   9    856.07        14.12   841.95    2546.97&#xA;  10    856.07        10.61   845.46    1701.51&#xA;  11    856.07        7.09    848.99    852.52&#xA;  12    856.07        3.55    852.52    0.00&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That would for example mean that my weighted interest rate in Period 8 would be 17.61 divided by 3388.93, which would result in a monthly average interest rate of 0.0052. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which is the correct way of calculating a weighted average interest rate, based on fixed-rate mortgages.&lt;/p&gt;&#xA;" OwnerUserId="17695" LastEditorUserId="17695" LastEditDate="2016-12-13T10:35:54.593" LastActivityDate="2016-12-13T10:35:54.593" Title="Calculation of Weighted Interest Rate based on Outstanding Debt" Tags="&lt;interest-rates&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31227" PostTypeId="1" AcceptedAnswerId="31230" CreationDate="2016-11-28T12:23:01.997" Score="8" ViewCount="1672" Body="&lt;p&gt;I am working with intraday stock prices. I have found that the autocorrelation between the returns is negative (significantly so, but the value is very small). I am aware of how to interpret negative correlations from a technical point of view, but what could be the real-life reasons for that?&lt;/p&gt;&#xA;" OwnerUserId="25480" LastActivityDate="2018-01-16T23:43:53.027" Title="Reasons for negative autocorrelation" Tags="&lt;returns&gt;&lt;auto-correlation&gt;" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31228" PostTypeId="2" ParentId="30208" CreationDate="2016-11-28T12:51:53.337" Score="6" Body="&lt;p&gt;At most banks, swaption traders have models that allow non atm volatilities to be controlled by two parameters.  Specifically , a parameter to control the smile (richness of out of the money options) and the skew (whether implied vol is upward or downward sloping as a function of strike ).  Look up papers on the SABR model.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, one would calibrate such s model using market prices that are liquid (such as 100bp high payer swaption for example.  ). Other strikes could then be inferred from the model.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just FYI cap prices are less liquid than swaption prices , so they are not specifically used to calibrate swaption vols.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-11-28T12:51:53.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31229" PostTypeId="2" ParentId="30866" CreationDate="2016-11-28T13:08:52.623" Score="1" Body="&lt;p&gt;The point is that the shifted model is calibrated to keep the atm option price the same (equal to the market price ).  Specifically , c is selected (somewhat arbitrarily) to represent a level that swap rates cannot go below.  Typically it might be -0.50pct or -1pct.  Then, the vols are changed to keep atm option prices the same. And now, you have a model that is still calibrated to the market but gives different prices for out of the money options than before. &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-11-28T13:08:52.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31230" PostTypeId="2" ParentId="31227" CreationDate="2016-11-28T13:09:17.627" Score="10" Body="&lt;p&gt;Looking at transaction prices, they would occur at the market bid if the active part is a seller, and at the ask if the active part is a buyer. With a random flow of sellers and buyers, the price will bounce between the bid and ask prices, creating a negative autocorrelation in returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This penomenon is known as the bid-ask bounce, and has been discussed here in the follow up to &lt;a href=&quot;https://quant.stackexchange.com/questions/1348/control-for-bid-ask-bounce-in-high-frequency-trade-data&quot;&gt;this question on how to adjust for the bounce&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="23886" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-11-29T08:23:59.767" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31232" PostTypeId="2" ParentId="31227" CreationDate="2016-11-28T13:43:07.690" Score="0" Body="&lt;p&gt;Check the paper by Cont (2001). There is a stylized fact about it. Autocorrelation should be absent unless for very small time periods, such as intraday (5 in 5 minutes). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't think there's a really good explanation, since intraday stock prices follow a random walk, so negative autocorrelation is possible. Perhaps one could say that the performance of the company (financials) vs. the news about the company (speculation) can cause negative autocorrelation.&lt;/p&gt;&#xA;" OwnerUserId="23903" LastActivityDate="2016-11-28T13:43:07.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31233" PostTypeId="1" AcceptedAnswerId="31234" CreationDate="2016-11-28T14:05:25.043" Score="-1" ViewCount="54" Body="&lt;p&gt;I am trying to make sense of this example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/kNJ4e.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/kNJ4e.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not following the second line in red: &quot;If you buy an up-and-in put and sell an up-and-in call, the payoff is the strike price minus the stock price whenever the barrier is hit.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can the author conclude this immediately?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I arrived at the same answer as the author, using different reasoning:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $A$ be the event $\{S(t) = 90 \text{ for some } t \in [0, 0.5]\}.$ Then the payoff of the portfolio is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\begin{align*}\text{Payoff(Portfolio)} &amp;amp;= \text{Payoff}(P_{up, in} - C_{up, in} \big| A)*\text{Pr}(A) + \text{Payoff}(P_{up, in} - C_{up, in} \big| A^c)*\text{Pr}(A^c)\\ &amp;amp;= [\max(K - S, 0) - \max(S - K, 0)]*0.6 + 0*0.6.\end{align*}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Noting that $\max(K - S, 0) - \max(S - K, 0)$ is the payoff of a European Put less a European Call, by the Call-Put Parity, the price of this portfolio must be &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P_{up, in} - C_{up, in} = 0.6[F_{0, 0.5}^P(K) - F_{0, 0.5}^P(S)] = 0.6*[75e^{-0.10*0.5} - (80 - 2.5e^{-0.10*0.2})] = 0.6(-6.2073),$$ and so &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P_{up, in} = 4.18 + 0.6(-6.2073) = 0.4556,$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;as desired. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question is, how the author skip all of the intermediate steps and conclude what's in red, i.e., $\text{Payoff(Portfolio)} = 75 - S(0.5)$? &lt;/p&gt;&#xA;" OwnerUserId="5641" LastEditorUserId="5641" LastEditDate="2016-11-28T14:17:04.940" LastActivityDate="2016-11-28T14:54:11.493" Title="Clarification on the payoff of a portfolio consisting of a long Up&amp;In Put and short Up&amp;In Call" Tags="&lt;option-pricing&gt;&lt;exotics&gt;&lt;barrier&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31234" PostTypeId="2" ParentId="31233" CreationDate="2016-11-28T14:54:11.493" Score="1" Body="&lt;p&gt;Assume you are long an up-and-in put and short and up-and-in call of the same maturity, strike and barrier. When $S_t = B$ for $t \in [0, T]$, then both barrier options knock-in and turn into vanilla options. You are now long a put and short a call with the same maturity and strike. From put/call parity, you know that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;S_t + C_t = K e^{-r (T - t)} + P_t&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;P_t - C_t = K e^{-r (T - t)} - S_t&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;as claimed.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2016-11-28T14:54:11.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31235" PostTypeId="1" CreationDate="2016-11-28T14:54:19.873" Score="1" ViewCount="230" Body="&lt;p&gt;Let $S_t$ be the current spot price at time $t$ and $S_T$ be the spot price in the future (at time $T$). Assume the stock pays continuous dividends $d$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does the CAPM imply that the expected spot price is given by, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\mathbb{E}[S_T] = S_te^{(r + \beta\lambda - d)(T-t)}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\beta$ is the asset beta and $\lambda$ is the equity risk premium?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually from the definition of asset returns we have, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\mathbb{E}[R_i] = r + \beta \mathbb{E}[R_m - r]\\&#xA;\Rightarrow \mathbb{E}\left[\frac{S_T - S_t}{S_t}\right] = r+ \beta\lambda\\&#xA;\Rightarrow \mathbb{E}\left[\frac{S_T}{S_t}\right] = 1 +r+ \beta\lambda\\&#xA;\Rightarrow \mathbb{E}[S_T] = S_t(1 +r+ \beta\lambda)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So am I right to say that to get the exponential we have to assume continuous compounding?&lt;/p&gt;&#xA;" OwnerUserId="15771" LastEditorUserId="15771" LastEditDate="2016-11-30T13:00:57.093" LastActivityDate="2016-11-30T13:00:57.093" Title="CAPM and expected future spot price" Tags="&lt;capm&gt;" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="31239" PostTypeId="1" AcceptedAnswerId="31267" CreationDate="2016-11-28T19:04:28.870" Score="1" ViewCount="465" Body="&lt;p&gt;I have a dataset with 5 assets. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I apply mean-variance portfolio:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  In&amp;lt;-rep(1,5) #identity vector&#xA;  delta &amp;lt;- 5 #risk aversion parameter&#xA;  covariance&amp;lt;-cov(sample.data) #covariance matrix&#xA;  mu &amp;lt;- colMeans(sample.data) #mean returns&#xA;  mu &amp;lt;- t(t(mu))&#xA;&#xA;  #I calculate the standard mean-variance weights: &#xA;  xt &amp;lt;- 1/delta* solve(covariance) %*% mu &#xA;  m.w &amp;lt;- as.vector(xt) / In %*% xt %*% t(In)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My problem is that sometimes it can happen that the denominator: &lt;code&gt;In %*% xt #%*% t(In)&lt;/code&gt; is a negative number. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us take the following example with 5 assets:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Mean returns: 6, 6, 1, 1, 1&#xA;Standard deviation of returns: 1, 1, 1, 1, 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Portfolios with a mean of 6 are clearly superior, but the mean-variance calculation sometimes ends up putting large negative weights on the better assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This happens for the following reason:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Calculating &lt;code&gt;xt&lt;/code&gt; results in: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;5.264789 6.134487 -5.267289 -3.337918 -2.79493&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The denominator (&lt;code&gt;In %*% xt #%*% t(In)&lt;/code&gt;) is: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;-0.0008615427 -0.0008615427 -0.0008615427 -0.0008615427 -0.0008615427&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since this denominator is negative and a really small number, the final weights end up being:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-6110.886 -7120.352 6113.787 3874.351 3244.1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Clearly this should be the other way round.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I missing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: noob2 suggested that the problem might be that the covariance matrix is slightly negative definite, but it's not:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; eigen(covariance)&#xA;$values&#xA;[1] 4.90387493 0.12627889 0.11649928 0.09035977 0.07858112&#xA;&#xA;$vectors&#xA;           [,1]       [,2]       [,3]        [,4]        [,5]&#xA;[1,] -0.4529396  0.7235119 -0.1188464 -0.01716486 -0.50690946&#xA;[2,] -0.4664390 -0.2146771 -0.1914489 -0.81623850  0.18289445&#xA;[3,] -0.4511018 -0.6111482 -0.3089085  0.39903609 -0.41030564&#xA;[4,] -0.4289843  0.2157315 -0.2459586  0.41078039  0.73498045&#xA;[5,] -0.4356145 -0.1019909  0.8906754  0.07409282  0.03233327&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's some example data with the properties described above:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.dropbox.com/s/t3212c5sq7w1uug/example.Rdata?dl=0&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.dropbox.com/s/t3212c5sq7w1uug/example.Rdata?dl=0&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="25485" LastEditorUserId="25485" LastEditDate="2016-11-29T14:04:42.217" LastActivityDate="2016-11-30T04:44:29.473" Title="Mean-variance portfolio returns illogical weights" Tags="&lt;programming&gt;&lt;modern-portfolio-theory&gt;&lt;mean-variance&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31240" PostTypeId="2" ParentId="31141" CreationDate="2016-11-28T20:20:47.033" Score="3" Body="&lt;p&gt;You basically need to show ii') and iii'), as they automatically imply ii) and iii). Note that, since&#xA;\begin{align*}&#xA;\frac{dQ}{dP}\big|_T = \exp\Big(-\gamma W_T - \frac{1}{2} \gamma^2 T\Big),&#xA;\end{align*}&#xA;we obtain that&#xA;\begin{align*}&#xA;\zeta_t &amp;amp;= E_P\left(\frac{dQ}{dP}\big|_T \mid \mathcal{F}_t \right)\\&#xA;&amp;amp;=E_P\left(\exp\Big(-\gamma W_T - \frac{1}{2} \gamma^2 T\Big)\mid \mathcal{F}_t \right)\\&#xA;&amp;amp;=\exp\Big(-\gamma W_t - \frac{1}{2} \gamma^2 t\Big).&#xA;\end{align*}&#xA;Therefore, for $0 \le t \le T$,&#xA;\begin{align*}&#xA;E_Q\left(e^{\theta\, \widetilde{W}_t} \right) &#xA;&amp;amp;=E_P\left(\frac{dQ}{dP}\big|_Te^{\theta\, \widetilde{W}_t} \right) \\&#xA;&amp;amp;=E_P\left(E_P\left(\frac{dQ}{dP}\big|_Te^{\theta\, \widetilde{W}_t} \mid \mathcal{F}_t \right)\right) \\&#xA;&amp;amp;=E_P\left(E_P\left(\frac{dQ}{dP}\big|_T \mid \mathcal{F}_t \right)e^{\theta\, \widetilde{W}_t}\right) \\&#xA;&amp;amp;=E_P\left(\zeta_t \, e^{\theta\, \widetilde{W}_t} \right)\\&#xA;&amp;amp;=E_P\left(e^{-\gamma W_t - \frac{1}{2} \gamma^2 t + \theta (W_t + \gamma t)} \right)\\&#xA;&amp;amp;=E_P\left(e^{- \frac{1}{2} \gamma^2 t + \theta \gamma t +(\theta-\gamma) W_t} \right)\\&#xA;&amp;amp;=e^{- \frac{1}{2} \gamma^2 t + \theta \gamma t + \frac{1}{2} (\theta-\gamma)^2 t}\\&#xA;&amp;amp;=e^{\frac{1}{2} \theta^2 t},&#xA;\end{align*}&#xA;which is ii') or ii). Moreover, for any random variable $\xi\in \mathcal{F}_s,$ note that, for $0\le t+s\le T$,&#xA;\begin{align*}&#xA;E_Q\left(e^{\theta(\widetilde{W}_{t+s} - \widetilde{W}_s)} \xi \right) &#xA;&amp;amp;=E_P\left(\frac{dQ}{dP}\big|_T e^{\theta(\widetilde{W}_{t+s} - \widetilde{W}_s)} \xi \right)\\&#xA;&amp;amp;= E_P\left(E_P\left(\frac{dQ}{dP}\big|_T e^{\theta(\widetilde{W}_{t+s} - \widetilde{W}_s)} \xi \mid \mathcal{F}_{t+s}\right)\right)\\&#xA;&amp;amp;=E_P\left(E_P\left(\frac{dQ}{dP}\big|_T  \mid \mathcal{F}_{t+s}\right)e^{\theta(\widetilde{W}_{t+s} - \widetilde{W}_s)} \xi\right)\\&#xA;&amp;amp;= E_P\left(\zeta_{t+s} e^{\theta(\widetilde{W}_{t+s} - \widetilde{W}_s)} \xi \right)\\&#xA;&amp;amp;=E_P\left(e^{-\gamma W_{t+s} -\frac{1}{2} \gamma^2 (t+s) + \theta(W_{t+s} - W_s) + \theta\gamma t} \xi \right)\\&#xA;&amp;amp;=E_P\left(e^{(\theta-\gamma)( W_{t+s} -W_s) -\frac{1}{2} \gamma^2 (t+s) - \gamma W_s + \theta\gamma t} \xi \right)\\&#xA;&amp;amp;=E_P\left(e^{(\theta-\gamma)( W_{t+s} -W_s)}\right)E_P\left(e^{-\frac{1}{2} \gamma^2 (t+s) - \gamma W_s + \theta\gamma t} \xi \right)\\&#xA;&amp;amp;=E_P\left(e^{\frac{1}{2}(\theta-\gamma)^2 t-\frac{1}{2} \gamma^2 (t+s) - \gamma W_s + \theta\gamma t} \xi \right)\\&#xA;&amp;amp;=E_P\left(e^{\frac{1}{2}\theta^2 t-\frac{1}{2} \gamma^2 s - \gamma W_s} \xi \right)\\&#xA;&amp;amp;=E_Q\left(e^{\frac{1}{2}\theta^2 t} \xi \right).&#xA;\end{align*}&#xA;That is, &#xA;\begin{align*}&#xA;E_Q\left(e^{\theta(\widetilde{W}_{t+s} - \widetilde{W}_s)} \mid \mathcal{F}_s \right) = e^{\frac{1}{2}\theta^2 t},&#xA;\end{align*}&#xA;which is iii'), and it implies iii) above.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-11-29T14:04:56.883" LastActivityDate="2016-11-29T14:04:56.883" CommentCount="20" ContentLicense="CC BY-SA 3.0" />
  <row Id="31241" PostTypeId="2" ParentId="31239" CreationDate="2016-11-28T20:27:41.847" Score="0" Body="&lt;p&gt;this probably means that the risk-free rate is too high. If the risk-free rate is greater than the expected return of the minimal variance portfolio, the algorithm breaks and you end up with an optimally inefficient portfolio instead of an optimally efficient one.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2016-11-28T20:27:41.847" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="31242" PostTypeId="1" AcceptedAnswerId="31253" CreationDate="2016-11-28T22:21:27.760" Score="2" ViewCount="130" Body="&lt;p&gt;I saw this model&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{dF(t,T)}{F(t,T)} = \sigma(t,T) dW_t + (\exp(e^{-a(T-t)}dJ_t)-1) + \mu_J(t,T)dt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to model the forward curve. Rewriting&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dF(t,T) = \sigma(t,T)F(t,T) dW_t + F(t,T)(\exp(e^{-a(T-t)}dJ_t)-1) + F(t,T)\mu_J(t,T)dt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not quite understand how this can be written in the integral form. i.e. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$F(s,T) = F(0,T) + \int^s_0\sigma(t,T)F(t,T) dW_t + \int^s_0 F(t,T)\mu_J(t,T)dt + \cdots$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I dont know what &quot;$\cdots$&quot; should be. &lt;/p&gt;&#xA;" OwnerUserId="3334" LastEditorUserId="467" LastEditDate="2016-11-29T07:53:39.393" LastActivityDate="2016-11-29T15:21:54.507" Title="How is this SDE interpreted?" Tags="&lt;sde&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31243" PostTypeId="1" CreationDate="2016-11-28T23:03:33.390" Score="1" ViewCount="52" Body="&lt;p&gt;Any good reference on pricing simple forward contracts with source code? Thanks&lt;/p&gt;&#xA;" OwnerUserId="6499" LastActivityDate="2016-11-28T23:03:33.390" Title="References on Pricing commodity forwards" Tags="&lt;derivatives&gt;&lt;forward&gt;&lt;commodities&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31244" PostTypeId="2" ParentId="31242" CreationDate="2016-11-29T00:06:57.523" Score="1" Body="&lt;p&gt;Looks like jump diffusion. You can take $f(t,T)=\log F(t,T)$, apply Ito's formula for jump diffusions and take it from there. I cannot see how taking integral directly can lead you anywhere. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-11-29T00:06:57.523" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="31250" PostTypeId="1" AcceptedAnswerId="31254" CreationDate="2016-11-29T04:36:57.620" Score="0" ViewCount="41" Body="&lt;p&gt;I know that the fiscal year in USA from 1 October till 30 September. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to know: is whether there a dependence between a &lt;a href=&quot;http://www.investopedia.com/terms/d/declarationdate.asp?lgl=no-infinite&quot; rel=&quot;nofollow noreferrer&quot;&gt;declaration date&lt;/a&gt; and an &lt;a href=&quot;https://en.wikipedia.org/wiki/Fiscal_year&quot; rel=&quot;nofollow noreferrer&quot;&gt;end of fiscal year&lt;/a&gt;? I think this dependence should be have impact on a stopping time (early exercise) of american-style options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In some countries the companies are decrarate an amount of dividends from February till July, and the payout of dividends happens 4-6 months later in one payment.&lt;/p&gt;&#xA;" OwnerUserId="20913" LastEditorUserId="20913" LastEditDate="2016-11-30T03:55:32.347" LastActivityDate="2016-11-30T03:55:32.347" Title="is there a dependence between an annotation date of stocks dividend payment and the end fiscal year" Tags="&lt;reference-request&gt;&lt;american-options&gt;&lt;dividends&gt;&lt;discrete-dividends&gt;&lt;stopping-time&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31251" PostTypeId="1" CreationDate="2016-11-29T04:49:01.933" Score="-4" ViewCount="1147" Body="&lt;p&gt;If the ETF in the European market is tracking an oil company in the US, and now the oil price in the Middle East is likely to rise, how should I hedge this position?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S- I am preparing for Flow Traders interview. Does anyone have an idea about what they ask and what is their case study is about? Any help is appreciated. Thanks&lt;/p&gt;&#xA;" OwnerUserId="25492" LastActivityDate="2017-12-09T15:29:01.573" Title="Interview question on etf" Tags="&lt;trading&gt;&lt;hedging&gt;&lt;etf&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31252" PostTypeId="2" ParentId="31251" CreationDate="2016-11-29T06:37:58.540" Score="2" Body="&lt;p&gt;Your question is not very clear, hedge which position ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are the ETF issuer then you shall hold the US oil companies shares, period (eventually a fx hedge if your ETF is quanto), you have no direct exposure to Middle East oil prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the question is how to replicate a long exposure to a US stock when you are in Europe, with no access to the US underlying. There is no definitive answer to that, use your imagination, mention the spread between Middle East crude and US or EU crude, the non-perfect correlation between crude prices and share prices that might impede the hedge, the cost of rolling the futures, etc. But it doesn't make sense, it would be suicidal to build an ETF on US oil shares by hedging with crude oil futures.&lt;/p&gt;&#xA;" OwnerUserId="1181" LastActivityDate="2016-11-29T06:37:58.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31253" PostTypeId="2" ParentId="31242" CreationDate="2016-11-29T09:35:20.963" Score="3" Body="&lt;p&gt;$\require{cancel}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the following SDE&#xA;$$ \frac{dF(t,T)}{F(t,T)} = \sigma(t,T) dW_t + (\exp(e^{-a(T-t)}dN_t)-1) + \mu_J(t,T)dt  $$&#xA;where $N_t$ figures a standard Poisson process, supposedly independent of the standard Brownian motion $W_t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This SDE should be interpreted by looking at $N_t$ as what it is, namely a random &lt;em&gt;counting process&lt;/em&gt; with, intuitively, $dN_t$ zero everywhere except at (random) jump dates where it is equal to +1. Knowing this allows you to rewrite the jump term as:&#xA;$$ \exp(e^{-a(T-t)}dN_t)-1 = \left(\exp(e^{-a(T-t)})-1\right)dN_t $$&#xA;which is better notational practice (the -1 which was standing out alone on the RHS was a bit weird), so that we have&#xA;$$ \frac{dF(t,T)}{F(t,T)} = \mu_J(t,T)dt + \sigma(t,T) dW_t +  \left(\exp(e^{-a(T-t)})-1\right)dN_t \tag{0} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, as hinted at by @Kiwiakos, letting &#xA;$$ f(t,T) = \ln F(t,T) $$&#xA;and applying Itô's lemma for semi-martingales with jumps yields:&#xA;$$ df(t,T) = \underbrace{\left(\mu_J(t,T)-\frac{\sigma(t,T)^2}{2}\right) dt + \sigma(t,T) dW_t}_{\text{diffusion part}} + \underbrace{(f(t,T)-f(t^-,T))dN_t}_{\text{jump part}} \tag{1} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The original SDE $(0)$ then tells us that, at a jump date $t$:&#xA;$$ \underbrace{\frac{F(t,T) - F(t^-,T)}{F(t^-,T)}}_{dF(t,T)/F(t,T)} = \underbrace{0}_{\text{continuous part (does not jump)}} + \underbrace{ \exp(e^{-a(T-t)})-1}_{\text{non continuous part ($dN_t=1$)}} $$&#xA;or equivalently:&#xA;$$ F(t,T) \cancel{- F(t^-,T)} = \exp(e^{-a(T-t)}) F(t^-,T) \cancel{- F(t^-,T)}$$&#xA;showing that at a jump date&#xA;$$ f(t,T) - f(t^-,T) = \ln(F(t,T)/F(t^-,T)) = e^{-a(T-t)}$$&#xA;Hence the equivalent expression of the Itô lemma applied to $f(t,T)$&#xA;$$df(t,T) = \left(\mu_J(t,T)-\frac{\sigma(t,T)^2}{2}\right) dt + \sigma(t,T) dW_t + e^{-a(T-t)}dN_t \tag{2} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which can easily be integrated.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-11-29T15:21:54.507" LastActivityDate="2016-11-29T15:21:54.507" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31254" PostTypeId="2" ParentId="31250" CreationDate="2016-11-29T10:17:11.323" Score="3" Body="&lt;p&gt;What do you mean by annotation date, there is a declaration(announcement) date, ex-date, record date but I've never heard of an annotation date. Dividends are not decided always at the fiscal year end, in some countries they are approved by the shareholders general meeting which can happen at any time during the year, some companies pay quarterly, others annually, etc..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't think there is a systematic link between the declaration/ex date of dividends and the fiscal year, as the rules and payment period vary wildly from one country to another. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some examples :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;France, Germany, traditionally paid in April-May but this has been slowly changing recently with more semi-annual payments, (fiscal year from Jan to Dec)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Japan, big waves of dividends ex-dates at quarter ends (24 dec, 24 mar, etc., most of it in September end), but the amount can change between the ex-date and the payment date which can be 2 to 3 months later (fiscal year end in march) so you need to double guess the estimate...&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Taiwan, China, dividend period in the summer with fiscal year end in December&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;US, no particular dividend season&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So from these examples you could deduce that dividend ex-date season is usually 3 to 6 months after fiscal year end, when there is a dividend season.&lt;/p&gt;&#xA;" OwnerUserId="1181" LastActivityDate="2016-11-29T10:17:11.323" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31256" PostTypeId="1" AcceptedAnswerId="31259" CreationDate="2016-11-29T12:47:54.100" Score="1" ViewCount="652" Body="&lt;p&gt;Is it now common practice for HFT market-making algorithms to post liquidity in dark pools and exchanges at the same time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ask because I have been reading some documentation (&lt;a href=&quot;https://squeezemetrics.com/monitor/docs#dpi&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://squeezemetrics.com/monitor/docs#dpi&lt;/a&gt;) on a service which is claiming that market-maker inventory is affected by dark pool buying/selling activity (and that this then affects exchange quotes/prices).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet last I heard about this in the news people were getting freaked out about letting HFT into dark pools and fining people or something.&lt;/p&gt;&#xA;" OwnerUserId="25496" LastActivityDate="2016-11-29T14:50:51.490" Title="HFT market-making in dark pools?" Tags="&lt;high-frequency&gt;&lt;market-microstructure&gt;&lt;market-making&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31258" PostTypeId="1" CreationDate="2016-11-29T14:36:56.373" Score="0" ViewCount="65" Body="&lt;p&gt;I am an engineer who is increasingly interested in business-related things, and I am reading and learning a lot about what you can derive e.g. from financial statements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One question I was wondering about is: How can I determine the size of an M&amp;amp;A war chest of a company?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question is inspired by the following article: &lt;a href=&quot;http://www.fool.com/investing/2016/07/11/how-apple-can-use-its-233-billion-war-chest.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.fool.com/investing/2016/07/11/how-apple-can-use-its-233-billion-war-chest.aspx&lt;/a&gt;&#xA;where they determined how big the war chest is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am actually not able to retrace the steps, as it seems to me that the calculation was: Total Assets - Total current liabilites - but my assumption would have been that you cannot just take the entire positions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was thinking more along the lines of: &#xA;Cash+Cash equivalent+liquid short-term investments-short-term debt = war chest&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it correct to say, that the possibilities with the war chests are:&#xA;1) Share buybacks&#xA;2) M&amp;amp;A&#xA;3) Dividend payout&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for your help :) &lt;/p&gt;&#xA;" OwnerUserId="25500" LastActivityDate="2016-11-30T16:14:06.580" Title="How to determine how much a company can invest in M&amp;A activity?" Tags="&lt;finance&gt;&lt;investment&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31259" PostTypeId="2" ParentId="31256" CreationDate="2016-11-29T14:50:51.490" Score="5" Body="&lt;p&gt;Yes, it is. There is plenty of information about it online. E.g. here's a related very recent article: &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2874957&quot; rel=&quot;noreferrer&quot;&gt;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2874957&lt;/a&gt;, here's a link to a discussion on Barclays lawsuit with nice liquidity charts: &lt;a href=&quot;https://jackgavigan.com/2014/06/30/barclays-smoking-chart/&quot; rel=&quot;noreferrer&quot;&gt;https://jackgavigan.com/2014/06/30/barclays-smoking-chart/&lt;/a&gt; You can also find related discussions on &lt;a href=&quot;http://tabbforum.com/&quot; rel=&quot;noreferrer&quot;&gt;http://tabbforum.com/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2016-11-29T14:50:51.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31263" PostTypeId="1" CreationDate="2016-11-29T16:15:02.433" Score="2" ViewCount="138" Body="&lt;p&gt;I am fitting the following ARX(1,1)-GARCHX(1,1,1):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;y_t&amp;amp;=c+a_1y_{t-1}+\gamma_1x_t+\varepsilon_t\\&#xA;h_t&amp;amp;=\delta+\omega_1h_{t-1}+\theta_1\varepsilon_{t-1}^2+\pi_1x_{1,t}&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Delta is negative, suggesting the conditional variance can theoretically be negative. Does anyone know how to get around this problem? My variables are already in logarithmic form, and I have tried standardising them to no avail. Any help would be much appreciated.&lt;/p&gt;&#xA;" OwnerUserId="25506" LastEditorUserId="-1" LastEditDate="2016-11-29T19:53:36.863" LastActivityDate="2016-11-29T19:53:36.863" Title="Negative constant in GARCHX model" Tags="&lt;statistics&gt;&lt;garch&gt;&lt;statistical-finance&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31264" PostTypeId="2" ParentId="29719" CreationDate="2016-11-29T16:56:29.297" Score="2" Body="&lt;p&gt;Bloomberg has a Python interface, so this sort of thing is much easier than it used to be when you had to encapsulate the COM or C++ interface.  First, set up a &lt;code&gt;session&lt;/code&gt; as in the &lt;a href=&quot;https://www.bloomberglabs.com/api/libraries/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bloomberg documentation&lt;/a&gt;, then form a &lt;code&gt;request&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;refDataService = session.getService(&quot;//blp/refdata&quot;)&#xA;request = refDataService.createRequest(&quot;ReferenceDataRequest&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now set up your data request&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;request.append(&quot;securities&quot;, &quot;IBM US Equity&quot;)&#xA;request.append(&quot;fields&quot;, &quot;BOND_CHAIN&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;send the request and wait for the response event.  Iterate over the (single security) and (single) field and you will have an iterable of Bloomberg identifiers for the bonds&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2016-11-29T16:56:29.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31267" PostTypeId="2" ParentId="31239" CreationDate="2016-11-30T04:44:29.473" Score="1" Body="&lt;p&gt;There are a couple of possibilities here.  First, any &quot;efficient&quot; portfolio created using this algorithm can always be stochastically dominated, which implies, of course that it is impossible for it to be the efficient frontier.  This is a well known defect of the model.  In fact, you can prove, knowing only that, that the CAPM is a statistically invalid model in all circumstances.  Most people do not have enough of the statistical fundamentals to actually know that.  Using basic theorems in statistics, it is possible to show that the model specifications are always invalid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second is that your implied mean and standard deviation from your data are ranked in such a way that low risk stocks can get high returns and high risk stocks can get low returns.  Your specific example would always cause a CAPM to fail because there is an implicit simple ordering requirement in the algorithm.  Your example ties the variances, which violates a simple ordering.  Your example, if the CAPM were correct, would be impossible.  An error in the risk-free rate would also violate this ordering.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is also a recent paper that derives the actual distribution of all asset classes.  The distribution in either raw form or log-log form has no covariance matrix.  The assets can co-move, but will violate the definition of covariance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This implies that the covariance structure that the model is dependent on cannot mathematically happen, which in part explains the empirical stochastic dominance observed in the real world.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In 1963, Benoit Mandelbrot showed that the CAPM could not be true, empirically, but that claim has never stuck because no one could figure out why his observations should happen.  Now that the distribution is known, it is obvious why his observations happened.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can start with Mandelbrot's original paper.  The Variation of Certain Speculative Prices, Benoit Mandelbrot, The Journal of Business, Vol. 36, No. 4 (Oct., 1963), pp. 394-419&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2016-11-30T04:44:29.473" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="31269" PostTypeId="1" CreationDate="2016-11-30T10:55:10.233" Score="1" ViewCount="141" Body="&lt;p&gt;Is there a robust way to model 'bond plus cash' simulated returns, say in Excel, for an asset allocation problem between stocks vs bond plus cash?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For equity, &lt;code&gt;mean 5%&lt;/code&gt; &lt;code&gt;st dev 15%&lt;/code&gt; I would use &lt;code&gt;X=U~[0,1]&lt;/code&gt; and &lt;code&gt;R=N(X)~[0.05,0.15^2]&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For bond, &lt;code&gt;mean 3%&lt;/code&gt; &lt;code&gt;st dev 6%&lt;/code&gt;, and for cash &lt;code&gt;mean 2%&lt;/code&gt; &lt;code&gt;st dev 2%&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is then two-fold: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How do I easily truncate cash returns at 0&lt;/li&gt;&#xA;&lt;li&gt;How do I combine the return-risk assumption for both risk-less instruments.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="21023" LastEditorUserId="21023" LastEditDate="2016-12-01T17:12:04.253" LastActivityDate="2016-12-02T17:53:39.327" Title="Simple simulation model of bond plus cash returns" Tags="&lt;stochastic-processes&gt;&lt;asset-allocation&gt;&lt;statistical-finance&gt;&lt;financial-engineering&gt;&lt;asset-returns&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31270" PostTypeId="2" ParentId="31096" CreationDate="2016-11-30T14:25:27.133" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://CRAN.R-project.org/package=IBrokers&quot; rel=&quot;nofollow noreferrer&quot;&gt;IBrokers&lt;/a&gt; does support orders: see &lt;code&gt;?twsOrder&lt;/code&gt; and &lt;code&gt;?placeOrder&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6857" LastActivityDate="2016-11-30T14:25:27.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31271" PostTypeId="2" ParentId="31258" CreationDate="2016-11-30T16:14:06.580" Score="1" Body="&lt;p&gt;This is more of an introductory finance/financial statement analysis question (which isn't really home in quantfin). However, I'm happy to walk you through the analysis. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the article&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When including cash and equivalents and short- and long-term investments on its balance sheet, the iPhone maker is sitting on 233 billion in cash and liquid assets. Even after subtracting 71.9 billion in debt, Apple still has 161.1 billion in net cash.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Pulling AAPL &lt;a href=&quot;https://www.sec.gov/Archives/edgar/data/320193/000119312516559625/d165350d10q.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;Q1 10-Q&lt;/a&gt; (as this article came out on July 11th before the Q2 filing on July 27th), you can scroll to the consolidated balance sheet. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/PezFR.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/PezFR.png&quot; alt=&quot;Balance Sheet&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With Cash of 21.514bn, Long term marketable securities of 177.645bn, and Short term marketable securities of 33.769 bn, you get the 232.92 billion sitting in cash and cash equivalents. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are correct in that broadly speakig a war chest is whatever a company can liquidate in a short term basis to pay for various initiatives. From a corporate governance perspective, share buybacks, M&amp;amp;A, dividends are the only appropriate uses of cash sitting on the balance sheet (which is why AAPL paid out a special dividend several years back). &lt;/p&gt;&#xA;" OwnerUserId="17175" LastActivityDate="2016-11-30T16:14:06.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31272" PostTypeId="2" ParentId="24692" CreationDate="2016-11-30T16:32:47.613" Score="2" Body="&lt;p&gt;I'm not sure if this would qualify as &quot;empirical work&quot; but you should definitely read &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/B000UG9JQA&quot; rel=&quot;nofollow noreferrer&quot;&gt;Dynamic Hedging&lt;/a&gt; if you haven't already. Taleb talks a lot about this. To be more specific, have a look at page 264, the section called &quot;Higher Moment Bets&quot;. I hope this is helpful, although I am not sure if this is what you are looking for. &lt;/p&gt;&#xA;" OwnerUserId="24766" LastActivityDate="2016-11-30T16:32:47.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31276" PostTypeId="1" CreationDate="2016-12-01T00:40:02.077" Score="1" ViewCount="80" Body="&lt;p&gt;How can I create scenarios to stress gamma FX portfolios? If I shock the underlying for example +/-10%, then I gain in both scenarios. I get to capture some losses if I shock the implied volatility. Is this correct?&lt;/p&gt;&#xA;" OwnerUserId="25533" LastEditorUserId="24222" LastEditDate="2016-12-01T01:36:51.580" LastActivityDate="2016-12-01T01:36:51.580" Title="Stress Test for gamma FX portfolios?" Tags="&lt;portfolio&gt;&lt;gamma&gt;&lt;stress&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31277" PostTypeId="2" ParentId="22091" CreationDate="2016-12-01T01:00:21.483" Score="0" Body="&lt;p&gt;An impulse response shows after a variable A has been shocked by 1 standard deviation, how the other variables respond to the shock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Eg. when there is 0.001 spike visible for variable B&#xA; 1 standard deviation shock to variable A cause 0.1% change to variable B&lt;/p&gt;&#xA;" OwnerUserId="25534" LastActivityDate="2016-12-01T01:00:21.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31278" PostTypeId="2" ParentId="24979" CreationDate="2016-12-01T05:42:01.153" Score="1" Body="&lt;p&gt;My formula example does not include cash dividend, management fees (ie. SPY), holding taxes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Daily %=(px[i]-px[i-1])/px[i-1], where px[i] today and px[i-1] is yesterday.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Annual %=(daily[Jan 1st]+1)*(daily[Jan 2nd]+1)....about 252 days terms)-1. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Java, you could use this function. Pass in a daily time-series of returns.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    public static List&amp;lt;Tuple2&amp;lt;LocalDate,Double&amp;gt;&amp;gt; calcAnnualReturns(List&amp;lt;LocalDate&amp;gt; date, List&amp;lt;Double&amp;gt; values) {&#xA;    List&amp;lt;Tuple2&amp;lt;LocalDate,Double&amp;gt;&amp;gt; list = new ArrayList&amp;lt;&amp;gt;();&#xA;    int lastYear=-1; &#xA;    BigDecimal tally=BigDecimal.ZERO;&#xA;    if( values.size()&amp;gt;0 ) {&#xA;        for (int i = 0; i &amp;lt; values.size(); i++) {&#xA;            LocalDate ldt=date.get(i);&#xA;            double value=values.get(i);&#xA;            if( i==0 ) {&#xA;                tally=BigDecimal.valueOf(value+1);&#xA;            }else{&#xA;                if( ldt.getYear()&amp;gt;lastYear ) {&#xA;                    // calculate&#xA;                    tally=tally.subtract(BigDecimal.ONE);                                                   &#xA;                    // add result&#xA;                    list.add(new Tuple2(LocalDate.of(lastYear, 12, 31), tally.doubleValue()));&#xA;                    // reset to new year&#xA;                    tally=BigDecimal.valueOf(value+1);&#xA;                }else{&#xA;                    tally=tally.multiply(BigDecimal.valueOf(value+1));&#xA;                }&#xA;            }&#xA;            //&#xA;            lastYear=ldt.getYear();&#xA;        }               &#xA;        // finish last value&#xA;        tally=tally.subtract(BigDecimal.ONE);                                   &#xA;        list.add(new Tuple2(LocalDate.of(lastYear, 12, 31), tally.doubleValue()));          &#xA;    }&#xA;&#xA;    return list;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="24606" LastActivityDate="2016-12-01T05:42:01.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31279" PostTypeId="1" AcceptedAnswerId="31285" CreationDate="2016-12-01T10:07:45.123" Score="1" ViewCount="233" Body="&lt;p&gt;Some funds publish a new NAV value once a day. Theoretically a fund could smooth its returns by posting smaller gains and smaller losses. This practice is both dodgy and forbidden.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, this may pop up in a computation of the annualized volatility.&#xA;I could use daily data, weekly data and monthly data&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def volatility(nav):&#xA;    # given daily data, compute the annualized volatility&#xA;    return 100*np.sqrt(260)*nav.pct_change().std()&#xA;&#xA;def volatility_week(nav):&#xA;    return 100*np.sqrt(52)*nav.resample(&quot;W&quot;).last().pct_change().std()&#xA;&#xA;def volatility_month(nav):&#xA;    return 100*np.sqrt(12)*nav.resample(&quot;M&quot;).last().pct_change().std()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Obviously it's unlikely that all those volatility estimates &quot;agree&quot;. However, how much deviation shall we accept.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here're some examples. I tested like 10 funds. 3 funds flag up:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Daily;Weekly;Monthly&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4.57;6.12;6.73&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5.44;7.61;9.61&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3.91;4.54;6.07&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's a good test for this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously smoothing the NAV will underestimate the annualized volatility if measured using daily data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kind regards&#xA;Thomas&lt;/p&gt;&#xA;" OwnerUserId="25537" LastEditorUserId="25537" LastEditDate="2016-12-01T10:29:43.743" LastActivityDate="2016-12-01T14:49:22.420" Title="Volatility and resampling" Tags="&lt;volatility&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31280" PostTypeId="1" AcceptedAnswerId="31283" CreationDate="2016-12-01T11:16:03.903" Score="2" ViewCount="99" Body="&lt;p&gt;This question has been asked in several different forms, and the answer given seems to be always &quot;no&quot; because we can &quot;simply read off the yield curve&quot;. However, since the yield curve (or &quot;a yield curve&quot; in a multi-curve world) is constructed from various market instruments (e.g. futures), do we not need a model for rates to derive the yield curve from these instrument (to, for example, calculate a convexity adjustment to be applied to futures)? SO, the question is, given prices of market-observables instruments. do we need a model for dynamics of rates to price a vanilla IR swap? &lt;/p&gt;&#xA;" OwnerUserId="25538" LastActivityDate="2016-12-01T13:22:52.037" Title="Do we need a model for dynamics of IR to price a vanila swap?" Tags="&lt;interest-rates&gt;&lt;interest-rate-swap&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31281" PostTypeId="1" CreationDate="2016-12-01T11:22:45.267" Score="1" ViewCount="65" Body="&lt;p&gt;Can someone provide a reference for this fact on the internet? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;While I know this fact is proved in many text books, but I cannot find a proof of this fact very easily on the internet&lt;/p&gt;&#xA;" OwnerUserId="3334" LastActivityDate="2016-12-01T11:44:51.653" Title="Prove the jump times of a poisson process in a given interval are uniformly distributed" Tags="&lt;poisson-process&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31282" PostTypeId="2" ParentId="31281" CreationDate="2016-12-01T11:44:51.653" Score="3" Body="&lt;p&gt;&lt;a href=&quot;http://www.math.tau.ac.il/~uriy/Papers/encyc57.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.math.tau.ac.il/~uriy/Papers/encyc57.pdf&lt;/a&gt; - page 5 in this does that do it?&lt;/p&gt;&#xA;" OwnerUserId="19239" LastActivityDate="2016-12-01T11:44:51.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31283" PostTypeId="2" ParentId="31280" CreationDate="2016-12-01T13:22:52.037" Score="3" Body="&lt;p&gt;The answer is that it depends of the Zero Curve you're looking to build and the precision and maturity of it. For example, for the Libor3M curve, you might need indeed to use futures if you want to obtain a clean smooth curve for maturites close to 1Y. But again, if you're planing on using longer contracts, you can just bootstrap that part of the curve. It depends the level of precision you're looking for respect to the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most of the time, curves are built different from each other, so you just need to understand the Index you're trading. So the answer would be, yes we need a model for dynamics of rates, as long as the index underlying the swap has the instruments to obtain such data. Otherwise, you won't be marking to market.&lt;/p&gt;&#xA;" OwnerUserId="13533" LastActivityDate="2016-12-01T13:22:52.037" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31284" PostTypeId="1" AcceptedAnswerId="33050" CreationDate="2016-12-01T14:06:23.667" Score="2" ViewCount="277" Body="&lt;p&gt;What is a better representative of a P-B ratio for a sector, for using it as a factor to predict future returns on that sector? The market weighted average of P-B for all names in that index, or market weighted average of all prices/ market weighted average of all book values, basically $\mathbb{E}[f(x)]$ vs. $f(\mathbb{E}[x])$?&lt;/p&gt;&#xA;" OwnerUserId="25540" LastEditorUserId="24222" LastEditDate="2016-12-01T14:21:57.827" LastActivityDate="2017-03-30T22:59:25.117" Title="What is the better representative of a P-B ratio for a sector?" Tags="&lt;index&gt;&lt;prediction&gt;&lt;fundamentals&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31285" PostTypeId="2" ParentId="31279" CreationDate="2016-12-01T14:30:51.607" Score="1" Body="&lt;p&gt;Your examples, where daily vol &amp;lt; weekly vol &amp;lt; monthly vol would imply (in this case, with the magnitude of the difference, actually a quite strongly) positive autocorrelation for daily returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way to test this would be to estimate the autoregression of the daily fund NAVs and compare the results to the autocorrelation of the daily returns of the corresponding market index. If a smoothing effect is to be found, there can of course be some natural explanations (ones not implying any misconduct on part of the fund manager) to it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if the funds holdings are not very liquid, the prices used to calculate NAV could be stale, with the price changes &lt;em&gt;&quot;belonging&quot;&lt;/em&gt; to previous trading day getting attributed to the next day (if there are no completed trades in the last few trading hours). I imagine this could be the case especially when dealing with corporate bond funds (which, from your posted volatility levels could be the case in this particular instance).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: I calculated the daily/weekly/monthly annualized vol for the iBoxx USD Liquid High Yield Index from 2010 onwards, and got the following results: 0.047, 0.062, 0.069. The autocorrelation for the daily returns of the index measured at 0.39, so actually, at least for high yield bonds, it seems natural for the annualized vol measured from a higher frequency to be lower than the one measured from lower frequency returns.&lt;/p&gt;&#xA;" OwnerUserId="25364" LastEditorUserId="25364" LastEditDate="2016-12-01T14:49:22.420" LastActivityDate="2016-12-01T14:49:22.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31286" PostTypeId="1" CreationDate="2016-12-01T14:40:11.897" Score="1" ViewCount="179" Body="&lt;p&gt;I came across a volatility surface quoted in unknown format to me. &#xA;I have ATM Vol            Skew       Kurtosis      PutWing and CallWing&lt;br&gt;&#xA;each for particular tenor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any idea of what these represent/how can I convert them to  strike/moneyness given volatility would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="22424" LastActivityDate="2016-12-01T14:40:11.897" Title="IV surface quoted Skew/Curtosis/Putwing/CallWing" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;volatility-surface&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31287" PostTypeId="1" AcceptedAnswerId="31295" CreationDate="2016-12-01T15:03:21.930" Score="3" ViewCount="181" Body="&lt;p&gt;In equity markets, there are obvious transaction fees such as brokerage, commission fees etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if I wanted to do a more in-depth analysis of the determinants of transaction costs, what would be some key variables to look at? It seems like most analyses focus on liquidity or trade size/volume. But would things such as volatility, yield, credit risk etc be relevant? Or do those only matter to the extent that they affect liquidity?&lt;/p&gt;&#xA;" OwnerUserId="17712" LastActivityDate="2017-02-26T22:01:44.617" Title="What ultimately determines trading costs?" Tags="&lt;portfolio-management&gt;&lt;trading&gt;&lt;asset-allocation&gt;" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31288" PostTypeId="1" AcceptedAnswerId="31292" CreationDate="2016-12-01T16:44:56.437" Score="3" ViewCount="243" Body="&lt;p&gt;I understand the solution to the author's example below, but I can't help but notice that the implied volatility is an imaginary number:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/1P1QU.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/1P1QU.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The time-$t$ price of an All-or-nothing Asset Call is $S_t e^{-\delta(T - t)}N(d_1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have $38.66 = S_0e^{-\delta\cdot T}N(d_1) = 60e^{-0.02\cdot0.5} N(d_1)$ and so $N(d_1) = 0.650808991$ and $d_1 = 0.38751$. Therefore&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$0.38751 = \frac{\ln(60/50) + (0.1 - 0.02 + 0.5\sigma^2)\cdot0.5}{\sigma\sqrt{0.5}},$$ which gives&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma \in \{0.548022 - 0.767436i, 0.548022 + 0.767436i\}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't see how an imaginary implied volatility is possible, so was this option priced incorrectly under the Black-Scholes framework?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is from &quot;Models for Financial Economics&quot; by Abraham S. Weishaus.&lt;/p&gt;&#xA;" OwnerUserId="5641" LastActivityDate="2016-12-01T17:37:52.087" Title="Is the asset-or-nothing call option in this example valued incorrectly in the Black-Scholes framework?" Tags="&lt;black-scholes&gt;&lt;exotics&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31289" PostTypeId="1" CreationDate="2016-12-01T17:15:09.513" Score="2" ViewCount="151" Body="&lt;p&gt;I am currently trying to back test a strategy on a file which contains minutely data for the whole month. I would like to reset my indicators at 3:30 PM . Is there a way I can reset the indicators based on time or any other way ?&#xA;Following is the code for adding data and SMA indicator to my strategy . Since the data index is time series , I could use 15:30:00 as an event to reset the SMA indicator . The data contains 1 month of minutely data .&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;nifty &amp;lt;- as.xts(read.zoo(&quot;01122016CE8100.csv&quot;, &#xA;                         sep =&quot;,&quot;, &#xA;                         header = TRUE,&#xA;                         format = &quot;%H:%M&quot;,&#xA;                         tz = &quot;&quot;))&#xA;SMA_str &amp;lt;- add.indicator(strategy = SMA_str,&#xA;                         name = &quot;SMA&quot;,&#xA;                         arguments = list(x = quote(Cl(mktdata)), n = 20),&#xA;                         label = &quot;SMA&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="24269" LastEditorUserId="848" LastEditDate="2016-12-01T20:47:16.750" LastActivityDate="2016-12-01T20:47:16.750" Title="How to reset indicators in quantstrat / quantmod?" Tags="&lt;programming&gt;&lt;data&gt;&lt;backtesting&gt;&lt;performanceanalytics&gt;&lt;quantmod&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31290" PostTypeId="2" ParentId="26420" CreationDate="2016-12-01T17:19:31.340" Score="1" Body="&lt;p&gt;It &lt;strong&gt;totally&lt;/strong&gt; depends on the asset class / precise underlying obviously. You just cannot transpose a parameter set from one asset class to another. In fact you cannot transpose from one underlying to another within the same asset class since the parameters encode pretty rich heterogeneous behaviour that eg one rate or intensity will display relative to another. The key thing is, do the parameters look sensible for the problem you are looking at. Using the specification mentioned in comments:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\mathrm{d}r_t = \alpha(\beta-r)\:\mathrm{d}t + \sigma \sqrt{r_t\:} W_t&#xA;$$&#xA;Will assume from the comments we are talking about rates and not credit intensities (for which CIR  is also very useful due to analyticity of survival probabilities), I would suggest that the parameters that are easiest to evaluate as being qualitatively sensible or not are  $\beta$ and $\alpha$, respectively the mean reversion rate and target. Once you have these within reasonable bounds then a risk neutral square root process vol drops out. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Going into a bit more detail regarding the possible structure you can impose (within any degrees of freedom not controlled by your calibration instruments):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Try to make sure that $\beta$ is sensible, are your rates mean reverting to something unrealistic? Is there a valid 'equilibrium' level you think could make sense?&lt;/li&gt;&#xA;&lt;li&gt;Think about the dynamics imposed by the reversion parameter $\alpha$: If this is high, you will find in simulations that high levels of $r_t$ will equate to &lt;strong&gt;flatter&lt;/strong&gt; curves, so the forwards will correlate negatively with outright levels of spot. This is crucial eg for behaviour of CMS pricing. In credit world, this is often observed where participants buy front end protection to indemnify against default risk of distressed credits - inversion is very common and therefore having a low $\alpha$ would not be suitable at all. Low $\alpha$ would be associated with high rates &amp;lt;=&gt; high forwards, is this valid? In rates world, think about bear/bull flattening / steepening, which central bank policy action may influence.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Once you are happy with mean reversion / forward dynamics, I think you can be fairly happy with what you've got. The best way is to simulate and assess the parameters, a good test of #2 being for example what is the correlation your parameter set is creating between spot and forwards?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway that's how I would assess the validity of parameters, there really is no universal set that makes sense in all currencies, regions, asset classes etc etc, but luckily they are quite intuitive I think. Interested in other practitioners' thoughts.&lt;/p&gt;&#xA;" OwnerUserId="19239" LastActivityDate="2016-12-01T17:19:31.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31291" PostTypeId="2" ParentId="3284" CreationDate="2016-12-01T17:28:51.107" Score="3" Body="&lt;p&gt;In regards to equity option data, insufficient.  Advertised daily option data, but latest download 3 months old.  Support wont answer or issue refund for my fees.  Sham operation be careful with your membership.  I do recommend.&lt;/p&gt;&#xA;" OwnerUserId="25544" LastActivityDate="2016-12-01T17:28:51.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31292" PostTypeId="2" ParentId="31288" CreationDate="2016-12-01T17:37:52.087" Score="5" Body="&lt;p&gt;I agree with your computations. The problem is that the initial price of the asset-or-nothing call of 38.66 can't arise within the Black-Scholes framework. This seems to be an inconsistency/error in the question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below you see a plot of asset-or-nothing call price as a function of the implied volatility. Note that &quot;1&quot; means 100% implied volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/2miYC.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/2miYC.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $A_0$ be the initial option price. It is easy to check that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\lim_{\sigma \downarrow 0} A_0 = \lim_{\sigma \uparrow \infty} A_0 = S_0 e^{-\delta T} = 59.4030&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\arg \min_{\sigma \in \mathbb{R}_+} A_0 = \sqrt{\frac{1}{T} \left( \ln \left( \frac{S_0}{K} \right) + (r - \delta) T \right)} = 94.30\%&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\min_{\sigma \in \mathbb{R}_+} A_0 = 44.4070.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, you can still apply the model-independent put/call parity for asset-or-nothing options as suggested in the answer.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2016-12-01T17:37:52.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31293" PostTypeId="1" CreationDate="2016-12-01T18:23:20.147" Score="1" ViewCount="55" Body="&lt;p&gt;Is it possible to scrape data from stocktrack.com into Microsoft Excel? I have been writing VBA code but the password protection might be a problem because none of my code works. I'm starting back at ground zero. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have experience scraping data from Stocktrack.com?&lt;/p&gt;&#xA;" OwnerUserId="24815" LastActivityDate="2016-12-01T18:23:20.147" Title="Stocktrack webscrapping?" Tags="&lt;equities&gt;&lt;vba&gt;" AnswerCount="0" CommentCount="5" ClosedDate="2016-12-01T20:42:42.160" ContentLicense="CC BY-SA 3.0" />
  <row Id="31294" PostTypeId="1" CreationDate="2016-12-01T20:02:29.997" Score="2" ViewCount="123" Body="&lt;p&gt;Is Dupire's equation defined when the T input (the expiration) is equal to 0 (the current time)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it's not, how would you determine an appropriate local volatility to use at that time when modelling stock price movements? &lt;/p&gt;&#xA;" OwnerUserId="25333" LastActivityDate="2016-12-01T20:02:29.997" Title="Dupire equation at T = 0" Tags="&lt;local-volatility&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31295" PostTypeId="2" ParentId="31287" CreationDate="2016-12-01T21:43:41.570" Score="3" Body="&lt;p&gt;I would say that an important part of the trading cost is ultimately shaped by the balance of informed (those with private information) and non-informed (liquidy traders) market participants. Imagine a market maker in a market with only non-informed traders that randomly sell att the bid and buy at the ask. The cost for the market maker would be small and she would make money even from a tiny bid-ask spread. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Imagine instead a market with some informed traders. When they know their information would drive up the price above the ask they buy and the market maker will eventually in turn have to buy her inventory back at a higher price realising a loss. In response of course, she will widen her bid-ask spread and perhaps cut back on her volumes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not only does this balance shape the trading cost, the mere existence of the market relies on it. The larger the share of informed traders, the wider the spread. And with wider spreads the share of liquidity trades decrease as they shy away from the trading costs. In the end  only the most informed traders remain and the market closes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Such was &lt;a href=&quot;http://articles.latimes.com/1987-02-25/business/fi-5473_1_capital-markets&quot; rel=&quot;nofollow noreferrer&quot;&gt;the fate of the Japanese perp market&lt;/a&gt;, analysed in the paper &lt;a href=&quot;http://www1.american.edu/academic.depts/ksb/finance_realestate/mrobe/Seminar/Fernando.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;Liquidity Shocks, Systemic Risk, and Market Collapse:&#xA;Theory and Application to the Market for Perps&quot;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="23886" LastActivityDate="2016-12-01T21:43:41.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31297" PostTypeId="2" ParentId="31287" CreationDate="2016-12-01T21:54:50.767" Score="0" Body="&lt;p&gt;It's the covering the cost of giving a price to a client. That's what a trader has to do...&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2016-12-01T21:54:50.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31300" PostTypeId="2" ParentId="9629" CreationDate="2016-12-01T23:57:48.097" Score="-1" Body="&lt;p&gt;If you mean when did it appear in the literature, I did research on it and found 3800 articles on it and never did get back to the first one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you mean when did it first appear in the data, I also did a population study of the CRSP universe.  It is an artifact of the model and is a result of the model being mismatched with reality.  The &quot;smile&quot; is an artifact of measurement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can actually show that Black-Scholes and related models are &quot;inadmissible,&quot; statistical solutions.  I just did a presentation on this for a math group, though not this specific problem.  It was a simpler coin toss or roulette style problem that induced the same type of effect.  I was inspired by a cunningly simple problem by Parmigiani and showed how changing your statistical axioms and following them blindly, which we do with automated or big data solutions, led to very, very different results using the theoretically valid results under different systems of axioms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a set of papers that I am presenting at conferences that covers how the empirical problems with Black-Scholes and Ito calculus style models comes from misunderstanding the deeper axiomatic structures and how to fix them.  There is actually an early warning by von Neumann and Morgenstern in a footnote in a work that preceded Black and Scholes work, but it was never heeded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Things like the smile are empirical contradictions and nature cannot have those.  When you see them, something else is going on.  In this case, it is an accident of how it is being looked in the frame of a model.  Change the frame and the problem vanishes.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2016-12-01T23:57:48.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31302" PostTypeId="2" ParentId="30827" CreationDate="2016-12-02T11:43:18.373" Score="0" Body="&lt;p&gt;Your comparison is not quite apples to apples.  You should compare one futures contract at (n-2) with (1+r) forward contracts.  That makes them equal in terms of equity exposure.   If you do this, you find that you borrow 5 and pay back 5(1+r1) at n where r1 is less than r if rates have gone down.   hence the futures is better if this correlation holds.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-12-02T11:43:18.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31303" PostTypeId="2" ParentId="31226" CreationDate="2016-12-02T13:16:36.097" Score="0" Body="&lt;p&gt;In first place you need to fix the outstanding debt, because in period 12, you are actually calculating interest over period 11 debt. &#xA;In second place, you are right about using the interest part of the repayment divided by the debt outstanding. In the specific case of Period 8 and forward, assuming the other payments have already been payed, you only need to focus on the remaining payments. &#xA;That said, your Weighted Average Interest Rate would be your monthly average interest rate annualized:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Interest in Period 8 = ((17.61 + 14.12 + 10.61 + 7.09 + 3.55) / 4227.39)*360/150&lt;/li&gt;&#xA;&lt;li&gt;Interest in Period 9 = ((14.12 + 10.61 + 7.09 + 3.55) / 3388.93)*360/120&lt;/li&gt;&#xA;&lt;li&gt;Interest in Period 10 = ((10.61 + 7.09 + 3.55) / 2546.97)*360/90&lt;/li&gt;&#xA;&lt;li&gt;Interest in Period 11 = ((7.09 + 3.55) / 1701.51)*360/60&lt;/li&gt;&#xA;&lt;li&gt;Interest in Period 12 = (3.55) / 852.52)*360/30&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="13533" LastActivityDate="2016-12-02T13:16:36.097" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31306" PostTypeId="1" AcceptedAnswerId="31313" CreationDate="2016-12-02T17:43:50.483" Score="2" ViewCount="842" Body="&lt;p&gt;Many sources put the switch from LIBOR discounting to OIS discounting at some point in 2008, or perhaps a little earlier (the earliest I have seen is August 2007). It seems that this may be optimistic, and that the switch did not happen until a couple of years later, some time around 2010.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I can tell, 10Y OIS were not often quoted until mid-2008 (Bloomberg has prices from 6th July) and longer term OIS were not quoted until the end of 2011 (Bloomberg has 15Y+ OIS quotes from 27th Sep 2011).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is some overlap when the market built OIS discount curves, but long-term OIS swaps were not liquidly traded. What techniques were used to build the discount curve in the absence of OIS quotes?&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2016-12-03T13:32:53.463" Title="How were OIS discount curves built before long-term OIS were liquid?" Tags="&lt;swaps&gt;&lt;interest-rate-swap&gt;&lt;ois-discounting&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31307" PostTypeId="2" ParentId="31269" CreationDate="2016-12-02T17:47:44.687" Score="1" Body="&lt;p&gt;If you are not interested in correlations, etc. I'd just make a column for each rebalance date, let's say you want to rebalance at the end of each year for 50 years, you'd have 50 columns, and a row for each number of simulations. Let's say 10,000 (each row is going to be the same, but rand() will make the result different for each. The first cell would be &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ weight_{eq} * (0.05 + 0.15 * rand()) + weight_{bnd} * (0.03 + 0.06 * rand()) + weight_{cash} * (0.02 + 0.02 * rand())$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could put a row at the top that has number of years and a desire to move 2% from equity to bonds and cash. For example, make the weights as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{50-year}{50} (0.05 + 0.15 * rand()) + \frac {year}{50} (0.03 + 0.06 * rand()) + \frac {year}{50} (0.02 + 0.02 * rand())$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The ending total return would be the product of (1 + each of these numbers), assuming these are annualized returns. If you rebalance more or less often than annually, you need to multiply the interest by the percentage of a year and the standard deviation by the square root of time. My answer would likely change if I'm not understanding you correctly, particularly with your comment about truncating cash returns. If I were to model this myself, I would not have any variation in the return for cash. &lt;/p&gt;&#xA;" OwnerUserId="19089" LastEditorUserId="19089" LastEditDate="2016-12-02T17:53:39.327" LastActivityDate="2016-12-02T17:53:39.327" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31312" PostTypeId="2" ParentId="728" CreationDate="2016-12-03T11:30:21.613" Score="1" Body="&lt;p&gt;With regard to memory scalability and parallel processing, it is opportune to update this discussion to 2016 taking into account the existence of the Microsoft R and Spark R for Apache.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;SparkR, an R package initially developed at the AMPLab, provides an R frontend to Apache Spark and using Spark’s distributed computation engine allows us to run large scale data analysis from the R shell.&quot; (by Shivaram Venkataraman Posted in ENGINEERING BLOG June 9, 2015)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With reference to Microsoft-R, &lt;a href=&quot;https://msdn.microsoft.com/en-us/microsoft-r/&quot; rel=&quot;nofollow noreferrer&quot;&gt;In this article of August 2016&lt;/a&gt;, the author presents a set of solutions for open and corporate environments. For the enterprise they offer Disk scalability Operates on bigger volumes &amp;amp; factors, Full parallel threading &amp;amp; processing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/KxKuO.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/KxKuO.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In her words&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;By using and extending open source R, Microsoft R Server is fully&#xA;  compatible with R scripts, functions and CRAN packages, to analyze&#xA;  data at enterprise scale. We also address the in-memory limitations of&#xA;  open source R by adding parallel and chunked processing of data in&#xA;  Microsoft R Server, enabling users to run analytics on data much&#xA;  bigger than what fits in main memory. And since R Server is built on&#xA;  top of Microsoft R Open, you can use any open source R packages to&#xA;  build your analytics.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Microsoft R Server delivers enterprise class performance and&#xA;  scalability for your R-based applications with libraries that allow&#xA;  you to write once and deploy across multiple platforms with minimal&#xA;  effort, whether on-premises or in the cloud.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="25567" LastActivityDate="2016-12-03T11:30:21.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31313" PostTypeId="2" ParentId="31306" CreationDate="2016-12-03T13:32:53.463" Score="5" Body="&lt;p&gt;The ois curves were (and still are) primarily build from adding together (a) interest rate swap rates and (b) Fed Funds/Libor basis swaps.   For example, if 10yr swaps are 2.0%, and 10yr fF/libor is -35bp, the 10yr ois is 1.65%.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The basis swaps have been liquid for decades, so this calculation has always been possible.  However, participants didn't discount swaps at ois until after 2008, when the FF/Libor basis widened dramatically.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-12-03T13:32:53.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31314" PostTypeId="1" CreationDate="2016-12-03T20:26:57.873" Score="11" ViewCount="1886" Body="&lt;p&gt;Let's assume we're happy with simulating $n$ stocks as geometric Brownian motion (GBM). But say we also want the prices to be correlated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I searched around for how to construct correlated paths, the typical strategy was to generate paths of Brownian motion with specified correlations, and then use those paths to construct GBM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, my calculations (and simulations) show that the correlation of the GBM is not the same as the correlation of the underlying Brownian motion, and the GBM correlations go to zero as time goes to infinity. This doesn't make much sense to me from a modeling perspective.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in summary, is it even reasonable to use correlated Brownian motion to construct GBM, or would it make more sense in terms of modeling to somehow construct GBM paths with a constant and specified correlation coefficient?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or did I just mess up with the analysis?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please let me know if something isn't clear. Thanks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&#xA;I understand how to create correlated paths of Brownian motion, specifically using the Cholesky decomposition. Here's what I know:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say $\Sigma$ is a correlation matrix, and $LL^T$ is its Cholesky decomposition. Let $B(t)$ be $d$-dimensional Brownian motion. Then $L B(t)$ is also $d$-dimensional Brownian motion, and Corr$(B_i(t),B_j(t)) = \rho_{ij}$, where $\rho_{ij}$ is the $(i,j)$ element of the correlation matrix $\Sigma$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $$X_i(t) = \mu_iX_i(t)dt + \sigma_i X_i(t)[LB(t)]_i$$&#xA;where $[LB(t)]_i$ is the $i^\text{th}$ element of $LB(t)$. Since we know that $[LB(t)]_i$ is Brownian motion, we know that $X_i(t)$ is geometric Brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Here's the issue:&lt;/strong&gt;&#xA;Let's look at Corr$(X_i(t),X_j(t))$. We can use the result &lt;a href=&quot;https://en.wikipedia.org/wiki/Geometric_Brownian_motion#Multivariate_version&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;here&quot;&gt;here&lt;/a&gt; to get Cov$(X_i(t),X_j(t))$.&#xA;It says that&#xA;$$\text{Cov}(X_i(t),X_j(t)) = X_i(0)X_j(0)e^{(\mu_1+\mu_2)t}\left(e^{\rho_{ij} \sigma_i\sigma_j}-1\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get the correlation of the GBM paths, use the above fact and that $$\text{Var}(X_i(t))=X_i(0)^2 e^{2\mu_i t}\left(e^{\sigma_i^2 t}-1\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus we have&#xA;$$\text{Corr}(X_i(t),X_j(t)) = \frac{e^{\rho_{ij}\sigma_i\sigma_j t}-1}{\sqrt{\left(e^{\sigma_i^2t}-1\right)\left(e^{\sigma_j^2t}-1\right)}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then (I am pretty sure this is always true)&#xA;$$\lim_{t\to\infty}\text{Corr}(X_i(t),X_j(t)) = \begin{cases}&#xA;        1, i=j\\&#xA;        0, i\neq j&#xA;        \end{cases}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To me at least, this isn't what we want. We would rather have the correlation be constant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's instead try to get correlated GBM by using&#xA;$$L X_t$$&#xA;where $X_t$ is $d$-dimensional GBM, and the 1D components are independent. There issue here is that I don't think $L X_t$ is GBM. In other words, the sum of independent GBM's is not GBM. We could try taking the product of correlated GBM's, but I haven't gone down that road yet. And before I do, I wanted to post this question.&lt;/p&gt;&#xA;" OwnerUserId="22377" LastEditorUserId="22377" LastEditDate="2018-06-30T16:26:36.483" LastActivityDate="2018-06-30T16:26:36.483" Title="What's the correct choice for modeling correlated stock prices?" Tags="&lt;brownian-motion&gt;&lt;modeling&gt;" AnswerCount="3" CommentCount="6" FavoriteCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="31315" PostTypeId="1" AcceptedAnswerId="31321" CreationDate="2016-12-04T00:23:41.973" Score="-3" ViewCount="101" Body="&lt;p&gt;&lt;strong&gt;Background Information:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;I am not sure this is relevant:&lt;/p&gt;&#xA;&lt;p&gt;Terminal value pricing:&lt;/p&gt;&#xA;&lt;p&gt;If the derivative &lt;span class=&quot;math-container&quot;&gt;$X$&lt;/span&gt; equals &lt;span class=&quot;math-container&quot;&gt;$f(S_T)$&lt;/span&gt;, for some &lt;span class=&quot;math-container&quot;&gt;$f$&lt;/span&gt; then in the value of the derivative at time &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt; is equal to &lt;span class=&quot;math-container&quot;&gt;$V_t(S_t,t)$&lt;/span&gt;, where &lt;span class=&quot;math-container&quot;&gt;$V(s,t)$&lt;/span&gt; is given by the formula&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$V(s,t) = \exp{(-r(T-t)E_{\mathbb{Q}}(f(S_T)|S_t = s)}$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;And then the trading strategy is given by &lt;span class=&quot;math-container&quot;&gt;$\phi_t = \frac{\partial V}{\partial s}(S_t,t)$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;or perhaps I need t apply this formula to the question below:&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$V_t(X) = B_tE_t = B_t E_{\mathbb{Q}}[B_T^{-1} X| \mathcal{F}_t]$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;I am not sure...&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Consider a Black-Scholes model &lt;span class=&quot;math-container&quot;&gt;$S_t = \exp{(\sigma W_t + \mu t)}$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$B_t = \exp{(rt)}$&lt;/span&gt;, where &lt;span class=&quot;math-container&quot;&gt;$W_t$&lt;/span&gt; is Brownian motion with respect to a given measure &lt;span class=&quot;math-container&quot;&gt;$\mathbb{P}$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Suppose you hold a forward contract obligating you to purchase &lt;span class=&quot;math-container&quot;&gt;$1$&lt;/span&gt; share of stock for &lt;span class=&quot;math-container&quot;&gt;$2$&lt;/span&gt; dollars at time &lt;span class=&quot;math-container&quot;&gt;$t = 5$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;What is the value &lt;span class=&quot;math-container&quot;&gt;$X$&lt;/span&gt; of this contract at maturity &lt;span class=&quot;math-container&quot;&gt;$t = 5$&lt;/span&gt;? Express your answer in terms of &lt;span class=&quot;math-container&quot;&gt;$S_5$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I am not sure how to solve this. Any suggestions is greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-12-04T14:53:08.253" Title="What is the value this &quot;special&quot; forward contract at maturity?" Tags="&lt;black-scholes&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;&lt;financial-engineering&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31316" PostTypeId="1" AcceptedAnswerId="31317" CreationDate="2016-12-04T05:11:15.523" Score="1" ViewCount="89" Body="&lt;p&gt;I have a basic question that's causing me some confusion. I see discussion of a &quot;CDS spread,&quot; defined as the cost of protection. Are these the same as a bid-ask spread? Is there any relation between the two, if not? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="25577" LastActivityDate="2016-12-04T09:29:21.910" Title="Is a CDS spread a spread in a typical sense" Tags="&lt;cds&gt;&lt;credit&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31317" PostTypeId="2" ParentId="31316" CreationDate="2016-12-04T09:29:21.910" Score="4" Body="&lt;p&gt;Regarding the terminology, there is no relation between CDS spread and bid/ask spread. The term spread in this sense refers to the related difference (spread) of the effective (credit risky) interest rate and the &quot;risk free&quot; rate (also see &quot;credit spread&quot;).&lt;/p&gt;&#xA;" OwnerUserId="25579" LastActivityDate="2016-12-04T09:29:21.910" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31318" PostTypeId="2" ParentId="31314" CreationDate="2016-12-04T09:42:23.020" Score="2" Body="&lt;p&gt;The standard approach for simulating correlated random numbers would be via a Cholesky decomposition (see e.g. &lt;a href=&quot;https://en.m.wikipedia.org/wiki/Cholesky_decomposition&quot; rel=&quot;nofollow&quot;&gt;Wikipedia on Cholesky decomposition&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a more specific answer, please provide more information on your approach.&lt;/p&gt;&#xA;" OwnerUserId="25579" LastActivityDate="2016-12-04T09:42:23.020" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31321" PostTypeId="2" ParentId="31315" CreationDate="2016-12-04T14:53:08.253" Score="2" Body="&lt;p&gt;It seems part of the instruction is there to trouble you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have a contract &lt;strong&gt;forcing&lt;/strong&gt; you to buy a stock $S$ at $t=5$ for 2\$, then the value of your contract &lt;em&gt;at maturity&lt;/em&gt; is by definition $S_5 -2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My guess is the question has a follow-up where they as you what the value is at time $t=0$. In this case you can simply create a replicating portfolio, buy buying the stock and borrowing 2\$, which has a value of $S_0 - 2 \exp(-rt)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the contract became &lt;strong&gt;optional&lt;/strong&gt; then the value at $t=5$ would not change but the value at $t=0$ becomes the value of a call on $S$ with maturity $T=5$ and strike price $K=2$, which you can find using Black-Scholes.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2016-12-04T14:53:08.253" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31322" PostTypeId="2" ParentId="30845" CreationDate="2016-12-04T17:40:41.833" Score="2" Body="&lt;p&gt;I just wanted to say that I solved the problem using the symbolic/analytical features of Mathematica and Matlab to perform the inverse Fourier transform and then I used high-order numerical integration to solve the smoothing integral.&lt;/p&gt;&#xA;" OwnerUserId="25124" LastActivityDate="2016-12-04T17:40:41.833" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31323" PostTypeId="2" ParentId="31314" CreationDate="2016-12-04T17:51:55.287" Score="2" Body="&lt;p&gt;Using correlated Brownian motions (Wiener processes) to construct GBMs should result in those GBMs having the same correlation structure as the used Brownian motions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are answers on how to construct correlated Brownian motions &lt;a href=&quot;https://stats.stackexchange.com/questions/38856/how-to-generate-correlated-random-numbers-given-means-variances-and-degree-of&quot;&gt;here&lt;/a&gt;, and, if you prefer to see more analysis, &lt;a href=&quot;https://math.stackexchange.com/questions/163470/generating-correlated-random-numbers-why-does-cholesky-decomposition-work&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; As for the analysis I can see a mistake where $t$ is dropped in your covariance definition. It should be $$\text{Cov}(X_i(t),X_j(t)) = X_i(0)X_j(0)e^{(\mu_1+\mu_2)t}(e^{\rho_{ij}\sigma_i\sigma_j{\color{red}t}}-1),$$&#xA;where the missing term is marked in red.&lt;/p&gt;&#xA;" OwnerUserId="25124" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2016-12-07T06:22:04.720" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31324" PostTypeId="1" CreationDate="2016-12-04T18:05:36.503" Score="1" ViewCount="3641" Body="&lt;p&gt;I have two books, one explains ARCH-M models and one explains GARCH-M models. But I couldn't find the difference between these two types.&lt;/p&gt;&#xA;" OwnerUserId="25587" LastActivityDate="2017-03-06T00:33:39.657" Title="Whats the difference between ARCH-M and GARCH-M models?" Tags="&lt;risk-management&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31325" PostTypeId="2" ParentId="29740" CreationDate="2016-12-04T18:46:12.403" Score="6" Body="&lt;p&gt;Consider a date sequence&#xA;\begin{align*}&#xA;0 \leq t_0 \leq T_s &amp;lt; T_p &amp;lt; T_e,&#xA;\end{align*}&#xA;where $t_0$ is the valuation date, $T_s$ is the Libor start date, $T_p$ is the payment date, and $T_e$ is the Libor end date. Let $\Delta_s^e = T_e-T_s$.&#xA;For $0\le t \le T_s$, define&#xA;\begin{align*}&#xA;L(t, T_s, T_e) = \frac{1}{\Delta_s^e}\bigg(\frac{P(t, T_s)}{P(t, T_e)}-1 \bigg),&#xA;\end{align*}&#xA;where $P(t, \mu)$ is the price at time $t$ of a zero-coupon bond with maturity $\mu$ and unit face value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $Q^{T_e}$ denote the $T_e$-forward measure and $E^{T_e}$ denote the corresponding expectation operator. Moreover, let $Q^{T_p}$ denote the $T_p$-forward measure and $E^{T_p}$ denote the corresponding expectation operator.&#xA;We seek to compute the value defined by&#xA;\begin{align*}&#xA;P(t_0, T_p)E^{T_p}\big(L(T_s, T_s, T_e) \mid \mathcal{F}_{t_0}\big).&#xA;\end{align*}&#xA;Note that, for $0 \le t \le T_p$,&#xA;\begin{align*}&#xA;\eta_t \equiv \frac{dQ^{T_p}}{dQ^{T_e}}\big|_{t} = \frac{P(t, T_p)P(0, T_e)}{P(0, T_p)P(t, T_e)}.&#xA;\end{align*}&#xA;Therefore,&#xA;\begin{align*}&#xA;&amp;amp;\ P(t_0, T_p)E^{T_p}\big(L(T_s, T_s, T_e) \mid \mathcal{F}_{t_0}\big) \\&#xA;=&amp;amp;\ P(t_0, T_p)E^{T_e}\Big(\frac{\eta_{T_p}}{\eta_{t_0}}L(T_s, T_s, T_e) \mid \mathcal{F}_{t_0}\Big)\\&#xA;=&amp;amp;\ P(t_0, T_p)E^{T_e}\Big(\frac{P(t_0, T_e)}{P(t_0, T_p)P(T_p, T_e)} L(T_s, T_s, T_e)\mid \mathcal{F}_{t_0}\Big)\\&#xA;=&amp;amp;\ P(t_0, T_e)E^{T_e}\Big(\frac{1}{P(T_p, T_e)} L(T_s, T_s, T_e)\mid \mathcal{F}_{t_0}\Big)\\&#xA;=&amp;amp;\ P(t_0, T_e)E^{T_e}\Big(\big(1+ \Delta_p^e L(T_p, T_p, T_e) \big) L(T_s, T_s, T_e)\mid \mathcal{F}_{t_0}\Big)\\&#xA;=&amp;amp;\ P(t_0, T_e)E^{T_e}\Big(\big(1+ \Delta_p^e L(T_s, T_p, T_e) \big) L(T_s, T_s, T_e)\mid \mathcal{F}_{t_0}\Big),\tag{1}&#xA;\end{align*}&#xA;where $\Delta_p^e = T_e-T_p$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We assume that under the $T_e$-forward measure $Q^{T_e}$,&#xA;\begin{align*}&#xA;dL(t, T_s, T_e) &amp;amp;= \sigma_s L(t, T_s, T_e) d W_t^s,\\&#xA;dL(t, T_p, T_e) &amp;amp;= \sigma_p L(t, T_p, T_e)d\Big(\rho W_t^s + \sqrt{1-\rho^2}W_t^p\Big), &#xA;\end{align*}&#xA;where $\sigma_s$, $\sigma_p$, and $\rho$ are some constants, and&#xA;$\{W_t^s, 0 \le t \le T_s\}$ and $\{W_t^p, 0 \le t \le T_s\}$ are two independent standard Brownian motions. Then,&#xA;\begin{align*}&#xA;&amp;amp;\ L(T_s, T_p, T_e)  L(T_s, T_s, T_e) \\&#xA;=&amp;amp;\  L(t_0, T_p, T_e) L(t_0, T_s, T_e) e^{-\frac{\sigma_s^2}{2}(T_s-t_0) -\frac{\sigma_p^2}{2}(T_s-t_0) + \sigma_s\big(W_{T_s}^s -W_{t_0}^s\big) + \sigma_p\Big(\rho \big(W_{T_s}^s - W_{t_0}^s\big) + \sqrt{1-\rho^2}\big(W_{T_s}^p - W_{t_0}^p\big)\Big)}.&#xA;\end{align*}&#xA;Moreover,&#xA;\begin{align*}&#xA;E^{T_e}\big(L(T_s, T_p, T_e) L(T_s, T_s, T_e) \big) = L(t_0, T_p, T_e) L(t_0, T_s, T_e)e^{\rho \sigma_s\sigma_p (T_s-t_0)}.&#xA;\end{align*}&#xA;From $(1)$ above, &#xA;\begin{align*}&#xA;&amp;amp;\ P(t_0, T_p)E^{T_p}\big(L(T_s, T_s, T_e) \mid \mathcal{F}_{t_0}\big) \\&#xA;=&amp;amp;\  P(t_0, T_e)E^{T_e}\Big(\big(1+ \Delta_p^e L(T_s, T_p, T_e) \big) L(T_s, T_s, T_e)\mid \mathcal{F}_{t_0}\Big)\\&#xA;=&amp;amp;\ P(t_0, T_e)\left(L(t_0, T_s, T_e) + \Delta_p^e L(t_0, T_p, T_e) L(t_0, T_s, T_e)e^{\rho \sigma_s\sigma_p (T_s-t_0)}\right)\\&#xA;=&amp;amp;\ P(t_0, T_e)L(t_0, T_s, T_e)\left(1 + \Delta_p^e L(t_0, T_p, T_e) e^{\rho \sigma_s\sigma_p (T_s-t_0)}\right)\\&#xA;=&amp;amp;\ P(t_0, T_p)L(t_0, T_s, T_e)\frac{1 + \Delta_p^e L(t_0, T_p, T_e) e^{\rho \sigma_s\sigma_p (T_s-t_0)}}{1+\Delta_p^e L(t_0, T_p, T_e)}\\&#xA;=&amp;amp;\ P(t_0, T_p)\left[L(t_0, T_s, T_e) + \frac{\Delta_p^eL(t_0, T_s, T_e)L(t_0, T_p, T_e)\left(e^{\rho \sigma_s\sigma_p (T_s-t_0)}-1 \right)}{1+\Delta_p^e L(t_0, T_p, T_e)}\right].&#xA;\end{align*}&#xA;Here, the term&#xA;\begin{align*}&#xA;\frac{\Delta_p^eL(t_0, T_s, T_e)L(t_0, T_p, T_e)\left(e^{\rho \sigma_s\sigma_p (T_s-t_0)}-1 \right)}{1+\Delta_p^e L(t_0, T_p, T_e)}&#xA;\end{align*}&#xA;is the convexity adjustment. In practice, you may assume that $\rho\approx 1$ and $\sigma_p\approx\sigma_s$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-12-04T18:46:12.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31326" PostTypeId="1" CreationDate="2016-12-04T22:39:46.753" Score="3" ViewCount="371" Body="&lt;p&gt;Suppose we are to price with Monte Carlo method two options differing only in the maturity time, with the same, say, call option payoff, or Asian option payoff with a fixed averaging window, with the underlying stock price following the Heston model. We know the distribution of variance in the Heston model approaches a stationary one as time approaches infinity. To achieve the same accuracy, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) can we use longer time step size for the option with longer maturity than the one with shorter maturity? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) What about using variable time step size with step size growing towards the time of maturity?&lt;/p&gt;&#xA;" OwnerUserId="6686" LastEditorUserId="6686" LastEditDate="2016-12-05T01:06:40.303" LastActivityDate="2018-02-01T01:35:13.423" Title="Time Step Size for Heston Model for Different Option Maturity" Tags="&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;heston&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31327" PostTypeId="1" CreationDate="2016-12-04T23:49:00.277" Score="2" ViewCount="629" Body="&lt;p&gt;I'm trying to better understand what information is disseminated by the SIP. In essence, if somewhere were to observe the SIP only what would he see?&lt;/p&gt;&#xA;" OwnerUserId="11874" LastEditorUserId="16148" LastEditDate="2020-09-13T02:34:27.397" LastActivityDate="2020-09-13T02:34:27.397" Title="Information disseminated by the Securities Information Processor (SIP)" Tags="&lt;market-data&gt;&lt;trading&gt;&lt;historical-data&gt;&lt;market-microstructure&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="31329" PostTypeId="2" ParentId="31327" CreationDate="2016-12-05T03:29:27.830" Score="1" Body="&lt;p&gt;The Consolidated Tape Association who &quot;oversees the dissemination of real-time trade and quote information&quot; (including the SIP) has a website with all the information &lt;a href=&quot;https://www.ctaplan.com/index&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.ctaplan.com/index&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The technical specifications of the SIP are quite clear :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.nyse.com/publicdocs/ctaplan/notifications/trader-update/cts_output_spec.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.nyse.com/publicdocs/ctaplan/notifications/trader-update/cts_output_spec.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.nyse.com/publicdocs/ctaplan/notifications/trader-update/cqs_output_spec.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.nyse.com/publicdocs/ctaplan/notifications/trader-update/cqs_output_spec.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The three main differences between SIP and different exchange flows are :&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Latency&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;SIP average 470 microseconds, median 210 microseconds&lt;/li&gt;&#xA;&lt;li&gt;BATS advertises 78 microseconds on average&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Depth of book&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;SIP only includes top-of-book for each BBO and NBBO/Finra BBO updates when needs be (&quot;The Short National BBO Appendage is generated whenever a new quote has caused a new National Best Bid and/or Best Offer and the BBO data meets all the field restrictions.&quot;)&lt;/li&gt;&#xA;&lt;li&gt;Exchanges include full book&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Order imbalance data leading up to the auctions which are distributed by some exchanges but not in the SIP&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1181" LastEditorUserId="1181" LastEditDate="2016-12-05T04:09:37.490" LastActivityDate="2016-12-05T04:09:37.490" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="31330" PostTypeId="1" AcceptedAnswerId="31331" CreationDate="2016-12-05T04:48:18.087" Score="3" ViewCount="711" Body="&lt;p&gt;I was reading a paper on arbitrage and it was mentioned that a positive SDF implies no arbitrage and later on it said that positive state prices imply no arbitrage. I am new to this topic and i am confused with the concept. &lt;/p&gt;&#xA;" OwnerUserId="24729" LastEditorUserId="70" LastEditDate="2016-12-10T10:20:44.677" LastActivityDate="2016-12-10T10:20:44.677" Title="What is the difference between state prices and stochastic discount factor?" Tags="&lt;arbitrage&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31331" PostTypeId="2" ParentId="31330" CreationDate="2016-12-05T07:08:49.637" Score="3" Body="&lt;p&gt;The two are very similar. To understand the difference notice that given a discrete sample space $\Omega=\{\omega_1,\omega_2…\omega_S\}$ the price of any payoff can be computed if we define the state prices $q$ (or prices of Arrow-Debreu securities,i.e., securities that pay 1 in one state and 0 in all other states. For instance $q_i(\omega_i)=1$ and $q_i(\omega_j)=0$ for $i\neq j$), as&#xA;$$P_t(X_{t+1})=\sum_{s=1}^S q_s X_{t+1}(\omega_s)$$ If we multiply and divide each state price by the physical probabilities $p(\omega)$ we obtain $$P_t(X_{t+1})=\sum_{s=1}^S p(\omega_s)\frac{q_s}{p(\omega_s)} X_{t+1}(\omega_s)\equiv \sum_{s=1}^S p(\omega_s)m_{t+1}(\omega_s) X_{t+1}(\omega_s)=E^p[m_{t+1}X_{t+1}]$$ where $m_{t+1}(\omega)$ is the stochastic discount factor. The relationship between state prices and SDF is, therefore, $q_s=p(\omega_s)m_{t+1}(\omega_s).$&lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2016-12-05T07:08:49.637" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31332" PostTypeId="1" CreationDate="2016-12-05T11:07:20.033" Score="0" ViewCount="75" Body="&lt;p&gt;We &lt;strong&gt;don't&lt;/strong&gt; have access to:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Bloomberg&lt;/li&gt;&#xA;&lt;li&gt;Thomson Reuters&lt;/li&gt;&#xA;&lt;li&gt;CRSP&lt;/li&gt;&#xA;&lt;li&gt;COMPUSTAT &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;And we are trying to replicate FF-1992, so we can have stocks returns via yahoo finance, like: &lt;a href=&quot;http://investexcel.net/multiple-stock-quote-downloader-for-excel/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://investexcel.net/multiple-stock-quote-downloader-for-excel/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question: How in similar way we can have all other data like ME, BE/ME, P/E and other accounting data? We need some API or similar automated tool to the Excel linked above - Where the ability to perform in single click operation on multiple stocks is very useful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;" OwnerUserId="18094" LastActivityDate="2016-12-05T11:07:20.033" Title="API to query ME, BE/ME, P/E etc. accounting data per stock symbol" Tags="&lt;programming&gt;&lt;data&gt;&lt;market-data&gt;&lt;historical-data&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31333" PostTypeId="1" CreationDate="2016-12-05T12:12:36.777" Score="1" ViewCount="350" Body="&lt;p&gt;Having two spot currency positions,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;short EUR/USD&#xA;long  GBP/USD&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We are looking for a way to diminish the risk of the spread going against us. The basic idea is to invert the positions, namely:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;long  EUR/USD&#xA;short GBP/USD&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, this would not only eliminate the risk, but also any profits that might arise. We would like to be able to cancel the hedge position in exchange for paying a premium. How do we use options to execute this strategy?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would creating the following positions achieve the desired effect?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;put    short    EUR/USD&#xA;put    long     GBP/USD&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="24955" LastActivityDate="2019-09-01T13:49:30.340" Title="How to hedge two currency positions" Tags="&lt;options&gt;&lt;fx&gt;&lt;hedging&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31335" PostTypeId="2" ParentId="15489" CreationDate="2016-12-05T15:02:21.370" Score="-2" Body="&lt;p&gt;Write black and scholes equation,&#xA;for asset or nothing put &#xA;K = 0&#xA;And for cash or nothing put S = 0 And K = B&#xA;and discount with time as e^-rT&lt;/p&gt;&#xA;" OwnerUserId="18079" LastActivityDate="2016-12-05T15:02:21.370" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31337" PostTypeId="2" ParentId="31333" CreationDate="2016-12-05T16:00:48.623" Score="2" Body="&lt;p&gt;In that &quot;portfolio&quot; you've also got a short EURGBP position, because you're short EUR and long GBP and, both long and short USD some of which cancels out. So why not work out the amount you're short and cover that with a EURGBP call?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise, yes you can use options to offset your positions:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;call    EUR/USD&#xA;put     GBP/USD&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7369" LastEditorUserId="7369" LastEditDate="2016-12-06T10:24:44.753" LastActivityDate="2016-12-06T10:24:44.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31338" PostTypeId="1" AcceptedAnswerId="31344" CreationDate="2016-12-05T16:21:41.433" Score="1" ViewCount="177" Body="&lt;p&gt;The yield curve can be explained using a PCA, where the cumulative proportion explained for many practical purposes is high enough with three factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For one set of data, used at &lt;a href=&quot;https://www.r-bloggers.com/principal-component-analysis-to-yield-curve-change/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.r-bloggers.com/principal-component-analysis-to-yield-curve-change/&lt;/a&gt; they explained 58% with factor1 and 85% by adding factor2 and 93% by adding factor3. This is inline with other data sets I have seen, e.g. Tsay - Analysis of Financial Time Series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The three factors are interpreted from the signs and size's of the coef as &quot;shift, twist and curvature&quot;. Since curvature explains the least amount of variability, does that imply shifts &lt;em&gt;happen more seldom&lt;/em&gt; in the real world than a shift does? I.e. does the ordering tell us something about the frequency with which they occur? Or is it just that when shifts do happen the change the look so much that it is the first principal component?&lt;/p&gt;&#xA;" OwnerUserId="12002" LastActivityDate="2016-12-05T18:55:54.833" Title="Yield curve PCA vs real life frequency" Tags="&lt;pca&gt;&lt;yield&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31339" PostTypeId="2" ParentId="31314" CreationDate="2016-12-05T16:46:04.637" Score="1" Body="&lt;p&gt;As CFW noted, one popular way of simulating stocks with GBM returns is Cholesky decomposition. If you have a covariance matrix, you can use it. Else you can use past prices to construct one. You can find example R code &lt;a href=&quot;https://berkorbay.github.io/fe522/02_Monte_Carlo_Simulation.html#simulation-with-multinormal-distribution&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if I understand your question correctly you use one distribution to derive correlations and use another to simulate a correlated stock mechanism. That might not be ideal. Harder to explain and justify. Yet if its predictions fit consistently and sustainably, that's all you need.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some additions to my answer after the last edit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Cholesky decomposition method works with log-returns following BM (or practically normal distribution). At least, this is the most basic case. Not returns, not price levels. You can then rearrange the log-returns to price levels.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) If you want to estimate the correlations the longer the data the weaker correlation you are going to get. It is actually hard to account for some solid level of correlation for some random processes (as admitted by BM) such as price log-returns. It severely depends on the experimental setting. It is also valid for volatility value. You can get a somewhat stationary long term volatility but it might be of no use to you for pricing fixed term contracts (i.e. options) because current market conditions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) There is a method called Graphical LASSO. Perhaps you can use it. Some research on it can be found &lt;a href=&quot;https://arxiv.org/abs/1402.1405&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; and other questions in SE.&lt;/p&gt;&#xA;" OwnerUserId="8147" LastEditorUserId="8147" LastEditDate="2016-12-06T11:47:21.940" LastActivityDate="2016-12-06T11:47:21.940" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31340" PostTypeId="1" AcceptedAnswerId="31341" CreationDate="2016-12-05T16:57:59.047" Score="1" ViewCount="196" Body="&lt;p&gt;I am trying to compare LGD/PD for Banks and other financial institutions using different approach thank Merton. Are there any publicly available data on which I can build?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="22424" LastActivityDate="2016-12-05T17:10:39.870" Title="LGD/PD Databases" Tags="&lt;default-probability&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31341" PostTypeId="2" ParentId="31340" CreationDate="2016-12-05T17:10:39.870" Score="2" Body="&lt;p&gt;Re LGD: you can look at Mark-iT for ISDA Credit Event Auction settlements, here's a link actually&#xA;&lt;a href=&quot;http://www.creditfixings.com/CreditEventAuctions/fixings.jsp&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.creditfixings.com/CreditEventAuctions/fixings.jsp&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously these will give recoveries as determined by bond auctions, varying according to SUB and SENIOR in the type of names you are looking at. These outcomes are a bit pathological for banks as SUB credit events sometimes had no deliverables given bail-ins, prior to the 2014 update to ISDA definitions, therefore $LGD = 1-R$ settled at 100% for SUB in several cases eg BES.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That may all be derivatives mumble swerve, clearly LGD on actual claims may vary from counterparty to counterparty where bilateral commutations maye have been agreed on a case by case basis (eg AIG), but it is a good demonstrable public source.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Re PDs I guess, (sadly) you have to go to ratings agencies but I don't have a link to hand.&lt;/p&gt;&#xA;" OwnerUserId="19239" LastActivityDate="2016-12-05T17:10:39.870" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="31342" PostTypeId="1" CreationDate="2016-12-05T18:13:12.873" Score="1" ViewCount="175" Body="&lt;p&gt;What are the pros and cons of delta re-hedging an option combination (straddle, strangle etc...) with options of the same underlying rather than with the underlying itself?&#xA;I am having a hard time finding litterature on the subject.&lt;/p&gt;&#xA;" OwnerUserId="25470" LastActivityDate="2016-12-05T18:48:08.680" Title="Delta re-hedging with options" Tags="&lt;options&gt;&lt;delta-hedging&gt;&lt;delta-neutral&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31343" PostTypeId="2" ParentId="31342" CreationDate="2016-12-05T18:48:08.680" Score="1" Body="&lt;p&gt;On top of my head, there are two reasons. One is that the underlying may not be accessible, while you can buy/sell options on exchange or OTC. The other (more important) reason is your position on other greeks (gamma, vega, etc). With appropriate options you can adjust both your delta and other greeks.&lt;/p&gt;&#xA;" OwnerUserId="17835" LastActivityDate="2016-12-05T18:48:08.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31344" PostTypeId="2" ParentId="31338" CreationDate="2016-12-05T18:55:54.833" Score="2" Body="&lt;p&gt;Re: does the ordering tell us something about the frequency with which they occur?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No it doesn't. It's more about how much this component contributes to the final variance. Probably every bit of move of the yield curve contains some extent of curvature change. It's just a matter of how much of it can be explained by the variables.&lt;/p&gt;&#xA;" OwnerUserId="17835" LastActivityDate="2016-12-05T18:55:54.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31345" PostTypeId="2" ParentId="31326" CreationDate="2016-12-05T19:06:42.667" Score="1" Body="&lt;p&gt;The time step size is more like a byproduct of the convergence of Monte Carlo simulation rather than something to be decided &lt;em&gt;a priori&lt;/em&gt;. It depends on the accuracy threshold. In general, one should keep refining the grid (number of paths * number of time steps) until her error metric goes under the threshold. To the simplest, this metric could be the difference between two consecutive runs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a side note, there are many ways to speed up the convergence, I'll leave it out for now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I described the general approach in determining the optimal uniform time step. It may differ problem by problem, depends on the accuracy demand. On the other hand, &lt;a href=&quot;http://home.thep.lu.se/~anders/papers/jcp14.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here's a paper that looks relevant to what OP was looking for&lt;/a&gt;. I think a good approach would be to first establish robust method with uniform time step, and then explore ways to improve efficiency (non-uniform time step being one of them).&lt;/p&gt;&#xA;" OwnerUserId="17835" LastEditorUserId="17835" LastEditDate="2016-12-07T18:38:04.413" LastActivityDate="2016-12-07T18:38:04.413" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31346" PostTypeId="2" ParentId="23150" CreationDate="2016-12-05T19:21:42.137" Score="1" Body="&lt;p&gt;As far as I know, the answer is yes and people do it all the time. There's something to add to the textbook example though. First the bid/ask spread on FX spot market is usually much tighter, meaning the room for taking advantage of the such arbitrage is smaller than you think (or you would need huge capital to leverage this kind of trade). For some currency pairs with wider spread, it usually means the liquidity is poorer, and you probably won't be able to execute large trade at the displayed best price. Secondly the spot date of the currency pairs may not be the same (depending on the holiday schedule of different countries), so you'd have to take the real interest rate into consideration.&lt;/p&gt;&#xA;" OwnerUserId="17835" LastActivityDate="2016-12-05T19:21:42.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31347" PostTypeId="2" ParentId="31324" CreationDate="2016-12-05T22:56:51.637" Score="3" Body="&lt;p&gt;In an autoregressive AR(n) model, the current value of the process is a weighted sum of the past n values together with a random term.  where the weightings are fixed and the random innovations are independent and identically distributed. This model is homoskedastic -- the random changes at each time step all come from the same distribution. (homo = same; skedastic = pertaining to scattering.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some real-world phenomena appear to be heteroskedastic instead i.e. they appear to have volatile periods followed by calm periods. The easiest way to do this is simply to specify  what the particular distribution at a particular time will be. For instance, there is a lot more uncertainty in daytime electricity use than in nighttime electricity use, so if we were to model the electricity use at a particular time we might assume that the electricity use during the day would have a particular variance σDayσDay, and that the use during the night would have a lower variance σNightσNight. This is an ARCH model -- it's an AR model with conditional heteroskedacity (conditional on the current time).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, perhaps the swings in volatility don't necessarily happen at particular times -- perhaps the times at which they occur are themselves stochastic. Instead of specifying exactly what the variance is going to be at each particular time, we might model the variance itself with an AR(p) model. This is a GARCH (generalized ARCH) model.&lt;/p&gt;&#xA;" OwnerUserId="18663" LastActivityDate="2016-12-05T22:56:51.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31349" PostTypeId="2" ParentId="21625" CreationDate="2016-12-06T02:07:54.667" Score="2" Body="&lt;p&gt;So, let me begin by stating that the distribution for returns has been derived and solved.  The good news is that it solves your problem, the bad news is that you can also prove that the CAPM, even if strictly true, cannot be solved.  There is in fact a 1958 non-existence proof, once you link them together.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The good news is the missing return is dividends.  The distribution of returns, or price returns plus dividend returns as in IRR, in equilibrium, ignoring bankruptcy, merger and liquidity risks, is $$\left[\frac{\pi}{2}+\tan^{-1}\left(\frac{\mu}{\sigma}\right)\right]\frac{\sigma}{\sigma^2+(r-\mu)^2}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This only holds for stocks sold in a double auction, some assets, such as antiques, have a very different distribution.  You will have to use a Bayesian method because there is no sufficient statistic and the maximum likelihood estimator has not been solved.  There is a wonderful paper in it for you if you can solve the intense polynomial that would be created.  There is no admissible Frequentist estimate.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The distribution differs if you use logs, and you can make an argument for using OLS, but because the underlying likelihood function lacks a covariance matrix, you cannot create a $\beta$ in the sense of the CAPM.  Assets can comove, but cannot covary.  The log-distribution, the hyperbolic secant distribution, violates the definition of covariance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The positive news is that it only requires the subjective intent to make a profit, it does not prohibit long term down trends.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider these papers:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://ssrn.com/abstract=2828744&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://ssrn.com/abstract=2828744&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://ssrn.com/abstract=2656681&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://ssrn.com/abstract=2656681&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to the cost of capital, it is the marginal cost for the firm to acquire its next dollar of capital.  If it has a line of credit then it is pretty simple.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2016-12-06T02:07:54.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31350" PostTypeId="2" ParentId="9054" CreationDate="2016-12-06T02:11:36.690" Score="0" Body="&lt;p&gt;I believe the distribution you are looking for is the multivariate Gumbel distribution.  A paper on it can be found at &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S0167715215001352&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.sciencedirect.com/science/article/pii/S0167715215001352&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2016-12-06T02:11:36.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31351" PostTypeId="2" ParentId="27855" CreationDate="2016-12-06T04:23:28.277" Score="1" Body="&lt;p&gt;Factor models tell you how the returns of your portfolio are related to the returns of the models' factors.  In this case, after controlling for the relation with the size, momentum, and market factors, your portfolio is positively related to the value factor.  We often say it &lt;em&gt;loads on&lt;/em&gt; the value factor (meaning it is exposed to the type of risk that is in the HML portfolio).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why does that surprise you?  Is it because you think &lt;em&gt;ex ante&lt;/em&gt; that you know that your portfolio is made up of growth stocks?  If so, bear in mind the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;There a many definitions of value/growth.  You seem to have in mind that value means &quot;cheap.&quot;  This is one definition, but not the one Fama and French use to construct their HML factor. &lt;/li&gt;&#xA;&lt;li&gt;Just because a stock qualifies as value, even by the Fama-French definition, that doesn't mean it will necessarily have a positive loading on the HML factor.  That's the &lt;strong&gt;fallacy of division&lt;/strong&gt;.  If you have a lot of stocks in your portfolio and they really are growth stocks, then maybe you made a mistake in your math somehow. Otherwise I think you are making wrong assumptions about the probability of the member of a population (or several members) having traits that differ from those of the population as a whole.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Generically, the interpretation of a positive coefficient is that your particular portfolio has a lot of whatever type of risk is in the value portfolio, not that is &lt;strong&gt;is&lt;/strong&gt; necessarily a value portfolio.  If yours really is a diversified portfolio of growth stocks (as defined by Fama and French), a negative HML coefficient would be likely, but I doubt that is really the case for your portfolio.&lt;/p&gt;&#xA;" OwnerUserId="11708" LastActivityDate="2016-12-06T04:23:28.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31353" PostTypeId="1" CreationDate="2016-12-06T14:09:43.527" Score="1" ViewCount="409" Body="&lt;p&gt;The formula (3.8) on page 30 of the book THE VOLATILITY SURFACE by Gatheral(2006) introduces a method for computing the expected variance under the risk neutral measure. By denoting $x_t = log(S_t/S_0)$, and $q(x_t,t;x_T,T)$ and $\sigma^2_{loc}(x_t,t)$ represent the $pdf$ of $x_t$ and local variance, respectively:&lt;br&gt;&#xA;$$&#xA;E[\sigma^2_{K,T}(t)]= \int dx_t\cdot q(x_t,t;x_T,T) \cdot \sigma^2_{loc}(x_t,t)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use this formula to compute the expected variance and it can return the negative value. My approach is:  &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;simulate a sequence of $x_t$;  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;use my function to compute $q(x_t,t;x_T,T)$ for each point of $x_t$ and they are positive;  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;generate a sequence of local variance which are positive;  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;integrate from $0$ to each point of $x_t$.Then, I get a sequence of expected variance. When $x_t$ is negative, then the integrated result is negative. How can I overcome this problem?  &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="24987" LastActivityDate="2016-12-06T14:09:43.527" Title="compute the risk-neutral expected variance" Tags="&lt;risk-neutral-measure&gt;&lt;variance&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31354" PostTypeId="1" CreationDate="2016-12-06T14:24:07.920" Score="4" ViewCount="33401" Body="&lt;p&gt;Could anyone explain me how to interpret factors and what kind of regressions I should run?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have already calculated the factor returns as well as 6 Fama-French portfolio returns, the only problem is I do not know how to properly combine all the information and reach useful results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I run regressions on SMB and HML to find whether those factors explain market movements by looking at R squared and then run regressions on 6 portfolios to see how significant the portfolio returns are?&lt;/p&gt;&#xA;" OwnerUserId="25605" LastEditorUserId="70" LastEditDate="2016-12-10T10:26:20.327" LastActivityDate="2017-11-09T21:14:41.457" Title="How exactly do I calculate and interpret factors in Fama-French model?" Tags="&lt;regression&gt;&lt;factor-models&gt;&lt;fama-french&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31357" PostTypeId="1" AcceptedAnswerId="31364" CreationDate="2016-12-06T16:36:41.407" Score="0" ViewCount="114" Body="&lt;p&gt;I am self-studying and I am working on the following problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/d2n9T.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/d2n9T.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My solution is different and I'm arriving at a different answer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The parameters of the lognormal random variable $S_t/S_0$ are: $$m = \mu t = (\alpha - \delta - 0.5\sigma^2)t$$ and $$v = \sigma\sqrt{t},$$ where $\alpha$ is the stock's continuously compounded rate of return, $\sigma$ is the stock's annual volatility, and $t = \frac{1}{250}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then we have $m = (\alpha - 0.5\sigma^2)/250$ and $v = \sigma\sqrt{1/250}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$40e^{m + z_1v} = 40e^{(\alpha - 0.5\sigma^2)/250 + 1.18\sigma\sqrt{1/250}} = 40.866$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$40.866e^{m + z_2v} = 40e^{(\alpha - 0.5\sigma^2)/250 - 0.53\sigma\sqrt{1/250}} = 40.519.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This gives us the system of equations:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(\alpha - 0.5\sigma^2)/250 + 1.18\sigma\sqrt{1/250} = \ln(40.886/40)$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(\alpha - 0.5\sigma^2)/250 - 0.53\sigma\sqrt{1/250} = \ln(40.519/40.866).$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solving yields $\alpha = 0.2666063$ and $\sigma = 0.281421201$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It appears to me that the author is starting with the lognormal parameters already in terms of 1 day, and then converting to the annual return/volatility at the end. I am starting with the annual lognormal parameters, converting to daily, and then solving for the annual return/volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If my reasoning is correct, I don't see why my solution wouldn't match the one using the author's method.&lt;/p&gt;&#xA;" OwnerUserId="5641" LastEditorUserId="5641" LastEditDate="2016-12-06T16:48:14.387" LastActivityDate="2016-12-07T01:37:35.667" Title="Simulating a stock price with Monte Carlo - Why my solution isn't equivalent to the author's" Tags="&lt;monte-carlo&gt;&lt;self-study&gt;&lt;lognormal&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31358" PostTypeId="2" ParentId="27718" CreationDate="2016-12-06T16:43:39.693" Score="1" Body="&lt;p&gt;This mostly depends on the regulations of the institution that is issuing a degree. I have been mentoring myself several CS master theses focused on Computational Finance, mainly related to solving high-dimensional option pricing problems using Radial Basis Function approximations. Therefore, it is possible.&lt;/p&gt;&#xA;" OwnerUserId="25124" LastEditorUserId="25124" LastEditDate="2016-12-07T14:35:42.270" LastActivityDate="2016-12-07T14:35:42.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31359" PostTypeId="2" ParentId="26008" CreationDate="2016-12-06T16:54:31.223" Score="1" Body="&lt;p&gt;You should take a look at the BENCHOP project. There we benchmarked around 15 different numerical methods against 6 option pricing problems. One of the problems was the Merton model. The methods were split into 4 families: &lt;em&gt;Monte Carlo&lt;/em&gt;, &lt;em&gt;Fourier&lt;/em&gt;, &lt;em&gt;Finite Difference&lt;/em&gt;, and &lt;em&gt;Radial Basis Function&lt;/em&gt; methods. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the paper containing the results: &lt;br&gt;&#xA;&lt;a href=&quot;http://dx.doi.org/10.1080/00207160.2015.1072172&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://dx.doi.org/10.1080/00207160.2015.1072172&lt;/a&gt;, &lt;br&gt;&#xA;and here is the project page where you can see the implementational details for each of the methods: &lt;br&gt;&#xA;&lt;a href=&quot;http://www.it.uu.se/research/project/compfin/benchop&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.it.uu.se/research/project/compfin/benchop&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;BENCHOP – The BENCHmarking project in option pricing&#xA;Lina von Sydow, Lars Josef Höök, Elisabeth Larsson, Erik Lindström, Slobodan Milovanović, Jonas Persson, Victor Shcherbakov, Yuri Shpolyanskiy, Samuel Sirén, Jari Toivanen, Johan Waldén, Magnus Wiktorsson, Jeremy Levesley, Juxi Li, Cornelis W. Oosterlee, Maria J. Ruijter, Alexander Toropov, and Yangzhang Zhao&#xA;International Journal Of Computer Mathematics Vol. 92 , Iss. 12,2015&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25124" LastActivityDate="2016-12-06T16:54:31.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31360" PostTypeId="2" ParentId="7246" CreationDate="2016-12-06T17:40:37.663" Score="2" Body="&lt;p&gt;This article has some interesting descriptions about the different methods used and when you would them:&#xA;&lt;a href=&quot;https://www.quandl.com/collections/futures/continuous&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.quandl.com/collections/futures/continuous&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thought it might be somewhat relevant to your question.&lt;/p&gt;&#xA;" OwnerUserId="22178" LastActivityDate="2016-12-06T17:40:37.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31361" PostTypeId="1" CreationDate="2016-12-06T19:40:28.190" Score="6" ViewCount="1747" Body="&lt;p&gt;I was looking at this thread &lt;a href=&quot;https://quant.stackexchange.com/questions/17125/please-give-a-step-by-step-explanation-on-how-to-build-a-factor-model&quot;&gt;here&lt;/a&gt;, reading about how to run regressions and thereby construct factor models. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming these factor models are properly specified, I am trying to better understand how they facilitate prediction of &lt;strong&gt;&lt;em&gt;future&lt;/em&gt;&lt;/strong&gt; returns. How do they exactly help with the estimation of a future return vector's mean vector and covariance matrix? These regressions estimate the conditional distribution of returns, &lt;strong&gt;&lt;em&gt;given contemporaneous information about factors&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These are my questions: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;how are future factors forecasted from old ones? &lt;/li&gt;&#xA;&lt;li&gt;Are there economic arguments that justify the avoidance of this issue? I suspect that some people will assume factors have conditional (on previous factors) mean zero and constant conditional covariance matrix.&lt;/li&gt;&#xA;&lt;li&gt;Are there any references where people run these regressions on lagged factors?&lt;/li&gt;&#xA;&lt;li&gt;Why aren't the dynamics of the factors talked about more? Perhaps they are, though, and I just need to read more.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Ideally your answers will provide highly cited papers and other resources. I'm looking for sources and specifics here.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;&lt;strong&gt;&lt;em&gt;Edit:&lt;/em&gt;&lt;/strong&gt;&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Thanks to @Will Gu for pointing out the difference between &quot;risk&quot; models and &quot;alpha&quot; models. I'm not totally convinced that modelling should be done separately for these two tasks, though. In either case, one wants the probability distribution of the future returns $r_{t+k}$, given the past returns $r_{1:t}$ and past factor information $f_{1:t}$ (of course $f_{1:t}$ may be some deterministic transformation of the returns data $r_{1:t}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suspect for these &quot;risk&quot; models, one takes concurrent factors and is implicitly using the fact that&#xA;$$&#xA;p(r_{t+k}|r_{1:t},f_{1:t}) = \int p(r_{t+k}|f_{t+k})p(f_{t+k}|r_{1:t},f_{1:t})df_{t+k}&#xA;$$&#xA;if one can assume conditional independence in certain areas. These regressions that people run emphasize estimation of $p(r_{t+k}|f_{t+k})$ and neglect the other part: $p(f_{t+k}|r_{1:t},f_{1:t})$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suspect that when one is fitting an &quot;alpha&quot; model one is using the decomposition above OR just trying to estimate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;p(r_{t+k}|f_{1:t},r_{1:t})&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;directly. &lt;/p&gt;&#xA;" OwnerUserId="1870" LastEditorUserId="1870" LastEditDate="2016-12-07T04:58:23.820" LastActivityDate="2016-12-07T04:58:23.820" Title="How to use factor models for prediction?" Tags="&lt;regression&gt;&lt;factor-models&gt;&lt;capm&gt;&lt;fama-french&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31362" PostTypeId="2" ParentId="29957" CreationDate="2016-12-06T22:52:35.517" Score="2" Body="&lt;p&gt;These certificates at UW are excellent and I highly recommend them.&lt;a href=&quot;https://depts.washington.edu/compfin/non-degree/certs/&quot; rel=&quot;nofollow noreferrer&quot;&gt;UW CFRM certificate&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="25614" LastActivityDate="2016-12-06T22:52:35.517" CommentCount="2" CommunityOwnedDate="2016-12-06T22:52:35.517" ContentLicense="CC BY-SA 3.0" />
  <row Id="31363" PostTypeId="2" ParentId="31361" CreationDate="2016-12-07T01:10:11.780" Score="2" Body="&lt;p&gt;You kinda mentioned in your questions, but the predictive model is essentially a lagged version of the &quot;factor model&quot;. Part of the problem comes from the subscripts, the model itself doesn't really constrain when you observe the predictors. For now, we can assume the subscript $t$ means information at or up to time $t$, then if you change your response vector to $t+1$, this is effectively a predictive model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, in reality you might find a lot of factors have strong explanatory power but not much predictive power, e.g. regressing individual stock return on SP500 index return of the same day might get you a decent $R^2$. It &lt;em&gt;explains&lt;/em&gt; the variance of your stock return, but can't be used for prediction. You would need to study the residuals for unexplanatory variances.&lt;/p&gt;&#xA;" OwnerUserId="17835" LastActivityDate="2016-12-07T01:10:11.780" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31364" PostTypeId="2" ParentId="31357" CreationDate="2016-12-07T01:37:35.667" Score="2" Body="&lt;p&gt;you got a typo. It should be &lt;code&gt;40.886&lt;/code&gt; in your last equation. Then $\sigma$ should match. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, If $\alpha$ means annualized log return, it should be&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mu\,t = \alpha - \frac 1 2\sigma^2\,t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in your last two equations, the first term should be&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac \alpha {250} - \frac 1 2 \sigma^2$&lt;/p&gt;&#xA;" OwnerUserId="17835" LastActivityDate="2016-12-07T01:37:35.667" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31367" PostTypeId="1" CreationDate="2016-12-07T09:11:09.690" Score="1" ViewCount="2458" Body="&lt;p&gt;I use QLIKE as loss function to evaluate the forecasting performance of a RV realized volatility model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;QLIKE = log $h$ + $\frac{\hat{\sigma}^2}{h}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $h$ is volatility forecast and $\hat{\sigma}^2$ is the ex post value of volatility (realized volatility computed with intraday returns).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I proxy volatility with log(RV), what are $h$ and $\hat{\sigma}^2$ in the QLIKE? The forecast and ex post value of log(RV) or the forecast and ex post value of RV? If I keep the logs, $h$ is sometimes negative and I have the problem of a log of a negative quantity. I'm not sure if I should come back to RV with exponential of the forecast of log(RV) or I should, for instance, replace log(RV) with log(1+RV).&lt;/p&gt;&#xA;" OwnerUserId="25620" LastEditorUserId="25620" LastEditDate="2016-12-07T10:13:39.387" LastActivityDate="2016-12-07T10:13:39.387" Title="QLIKE loss function to evaluate forecasting model of log(realized volatility)" Tags="&lt;volatility&gt;&lt;forecasting&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31368" PostTypeId="1" AcceptedAnswerId="31374" CreationDate="2016-12-07T10:12:23.233" Score="9" ViewCount="3371" Body="&lt;p&gt;When ATM implied volatility is higher than OTM put and call I believe that the volatility smile is no longer arbitrage free? Why is that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, when ATM implied volatility is lower than OTM put and call is the volatility smile always arbitrage free? Why is that?&lt;/p&gt;&#xA;" OwnerUserId="6428" LastActivityDate="2018-08-12T10:31:25.517" Title="Arbitrage Free Volatility Smile" Tags="&lt;implied-volatility&gt;&lt;no-arbitrage-theory&gt;&lt;volatility-smile&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="31369" PostTypeId="1" AcceptedAnswerId="31372" CreationDate="2016-12-07T10:55:01.513" Score="2" ViewCount="1663" Body="&lt;p&gt;Is there any formula to calculate all drawdowns (and maximum drawdown) directly from return series? Or is it always necessary to convert the returns into implied &quot;prices&quot; first and then proceed with finding drawdowns?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example (done in Excel):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Date     Returns     100,00      Drawdown &#xA;01.02.2000  0,30     100,30      -     &#xA;01.03.2000  2,60     102,91      -     &#xA;01.04.2000  1,10     104,04      -     &#xA;01.05.2000  -1,00    103,00     -1,00   &#xA;01.06.2000  1,50     104,54      -     &#xA;01.07.2000  2,50     107,16      -     &#xA;01.08.2000  1,60     108,87      -     &#xA;01.09.2000  6,70     116,17      -     &#xA;01.10.2000  -1,40    114,54     -1,40   &#xA;01.11.2000  4,00     119,12      -     &#xA;01.12.2000  -0,50    118,53     -0,50   &#xA;01.01.2001  8,10     128,13      -     &#xA;01.02.2001  4,00     133,25      -     &#xA;01.03.2001  -3,70    128,32     -3,70   &#xA;01.04.2001  -6,10    120,49     -9,57   &#xA;01.05.2001  1,70     122,54     -8,04   &#xA;01.06.2001  -4,90    116,54     -12,54   &#xA;01.07.2001  -2,20    113,97     -14,47   &#xA;01.08.2001  7,00     121,95     -8,48   &#xA;01.09.2001  5,80     129,03     -3,17   &#xA;01.10.2001  -6,50    120,64     -9,47   &#xA;01.11.2001  2,40     123,53     -7,29   &#xA;01.12.2001  -0,50    122,92     -7,76   &#xA;01.01.2002  -0,90    121,81     -8,59 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am taking the current &quot;price&quot;, then subtracting from this &quot;price&quot; the maximum &quot;price&quot; between the inititation date and the current date, then dividing this difference by that max &quot;price&quot;. And finally, the drawdown is the minimum between this result and 0:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;=MIN((C11-MAX($C$3:C11))/MAX($C$3:C11);0)*100&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Max drawdown would be the minimum among the drawdowns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to do this in R. Preferably without creating the &quot;price&quot; table. Any ideas?&lt;/p&gt;&#xA;" OwnerUserId="19096" LastActivityDate="2016-12-07T14:02:00.687" Title="Reproduce findDrawdowns and maxDrawdown functions in R given return series" Tags="&lt;programming&gt;&lt;drawdown&gt;&lt;maximum-drawdown&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31370" PostTypeId="2" ParentId="31368" CreationDate="2016-12-07T11:12:41.350" Score="3" Body="&lt;p&gt;Neither situation is necessarily an arbitrage.  Negative smile is consistent with a 'thin-tailed' density function , just as positive smile is consistent with a fat tailed density function .  It's true that an extreme amount of negative smile could cause the implied density to be negative in places I.e an arbitrage.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-12-07T11:12:41.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31371" PostTypeId="2" ParentId="14706" CreationDate="2016-12-07T12:28:23.013" Score="6" Body="&lt;p&gt;Let's Be Rational uses exactly two iterations to give full machine accuracy for all inputs. It can be viewed as a three-stage analytical formula if you like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code is free to download at www.jaeckel.org.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rgds,&#xA;Peter&lt;/p&gt;&#xA;" OwnerUserId="25624" LastActivityDate="2016-12-07T12:28:23.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31372" PostTypeId="2" ParentId="31369" CreationDate="2016-12-07T13:44:29.940" Score="2" Body="&lt;p&gt;I don't think you can do it without prices. But creating such a &quot;price&quot; series&#xA;is very easy in R.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;r &amp;lt;- rnorm(10, sd = 0.01)  ## returns&#xA;cumprod(1 + r)             ## =&amp;gt; 'prices'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You can then easily compute the maximum drawdown:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;require(&quot;NMOF&quot;)&#xA;drawdown(cumprod(1 + r))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In fact, you may not even need a package for computing drawdowns, since it is also very easy in R.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;v &amp;lt;- cumprod(1 + r)&#xA;1 - v/cummax(v)         ## drawdown&#xA;max(1 - v/cummax(v))    ## max. drawdown&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6857" LastEditorUserId="6857" LastEditDate="2016-12-07T14:02:00.687" LastActivityDate="2016-12-07T14:02:00.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31373" PostTypeId="1" CreationDate="2016-12-07T13:54:15.590" Score="2" ViewCount="1089" Body="&lt;p&gt;Credit spreads are a key economic indicator. They are the difference between yields on corporate and government debt. They are a measure of confidence in the private sector, they provide insight into economic culture.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Where can I find a free and reliable online daily historical data source that indicates how credit spreads are moving by region?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CDX and iTraxx quotes provide exactly this information but as an individual, you struggle to even pay &lt;a href=&quot;http://www.markit.com/product/cdx&quot; rel=&quot;nofollow noreferrer&quot;&gt;Markit&lt;/a&gt; to provide them - they generally only have corporate clients.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.quandl.com/search?query=bond%20yields&quot; rel=&quot;nofollow noreferrer&quot;&gt;Quandl.com&lt;/a&gt; has databases of bond yield by credit rating which could be used in conjunction with government interest rates to get an indication of how spreads are moving but the data is not reliable and there is little explanation of what regions/markets the databases cover.&lt;/p&gt;&#xA;" OwnerUserId="18448" LastEditorUserId="18448" LastEditDate="2016-12-07T14:32:44.393" LastActivityDate="2016-12-07T14:32:44.393" Title="Free Data Source for Credit Spreads?" Tags="&lt;interest-rates&gt;&lt;market-data&gt;&lt;spread&gt;&lt;credit&gt;&lt;bond-yields&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31374" PostTypeId="2" ParentId="31368" CreationDate="2016-12-07T14:09:24.307" Score="17" Body="&lt;p&gt;I generally agree with @dm63's answer: A convex (concave) smile around the forward usually indicates and leptokurtic (platykurtic) implied risk-neutral probability density. Both situations can or cannot admit arbitrage. I provide you with two counterexamples to your statements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;A volatility smile that is concave around the forward does not necessarily represent an arbitrage.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Concave smiles often arise when a significant jump with a predictable time of occurrence is priced in. This is often the case for single stocks around quarterly earnings announcements or for indices around macro events such as elections, referendums or rate decisions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider for example an underlying asset that does not move except for by a single jump. Let $X_t = \ln \left( S_t / S_0 \right)$ and define&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;X_t = \int_0^t \gamma(u) \mathrm{d}u + Y \mathrm{1} \left\{ t \geq t_J \right\}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, the jump time $t_J$ is known and has the random jump size $Y$. $\gamma$ is a deterministic drift that is chosen such that the discounted asset prices is a martingale under the risk-neutral probability measure $\mathbb{P}^*$. It is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\gamma(t) = r - \ln \left( \phi_Y(-\mathrm{i}) \right) \delta \left( t - t_J \right),&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\phi_Y(\omega)$ is the characteristic function of $Y$ and $\delta$ is the Dirac delta function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume that $Y$ follows a normal mixture distribution, i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;Y \sim \begin{cases} Y_1 &amp;amp; \text{with probability }p\\ Y_2 &amp;amp; \text{with probability } 1 - p.\end{cases}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Y_1 \sim \mathcal{N} \left( \mu_1, \sigma_1^2 \right)$ and $Y_2 \sim \mathcal{N} \left( \mu_2, \sigma_2^2 \right)$. This model usually generates platykurtic implied densities and concave implied volatility smiles.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a numerical example. Let $t_J = 1 \text{ day}$, $\mu_1 = -5\%$, $\mu_2 = +5\%$, $\sigma_1 = \sigma_2 = 2\%$ and $p = 50\%$. Further let $S_0 = 100$, $r = 0\%$ and consider a maturity of $T = 1 \text{ week}$. We get the following implied density and volatility smile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/QUIf9.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/QUIf9.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, you would consider more complex/realistic underlying dynamics such as e.g. a stochastic volatility and/or jump-diffusion model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To give you a real-world example: Here is the DAX 30 implied volatility smile as of December 1, 2016 for the maturity December 9, 2016. There was a jump priced in on the night of Sunday December 5th due to the Italian referendum which roughly had the implied parameters $\mu_1 = +2\%$, $\mu_2 = -3.5\%$, $\sigma_1 = \sigma_2 = 1.5\%$ and $p = 70\%$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/STmCS.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/STmCS.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;A volatility smile that is convex around the forward is not necessarily arbitrage-free.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few popular implied volatility smile parametrizations are not arbitrage-free for their full parameter range.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Roper (2010) for example shows that the so-called &quot;arbitrage free&quot; original SVI parametrization due to Gatheral (2004) is actually not arbitrage free, even for realistic parameter combinations; see Figures 1 and 2 in his paper.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another example is the Hagan et al. (2002) SABR parametrization, which is known to generate negative densities on the far downside strikes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For both examples, there exists a vast body of literature that aims at providing arbitrage-free alternative formulations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gatheral, Jim (2004) &quot;A Parsimonious Arbitrage-Free Implied Volatility Parametrization&quot;, Presentation, Global Derivatives &amp;amp; Risk Management 2004&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hagan, Patrick S., Deep Kumar, Andrew S. Lesniewski and Diana E. Woodward (2002) &quot;Managing Smile Risk&quot;, Wilmott Magazine&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Roper, Michael (2010) &quot;Arbitrage Free Implied Volatility Surfaces&quot;, Working Paper, University of Sydney&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2016-12-07T17:10:10.707" LastActivityDate="2016-12-07T17:10:10.707" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31376" PostTypeId="2" ParentId="29790" CreationDate="2016-12-07T15:51:18.937" Score="1" Body="&lt;p&gt;Good lord - sovereign debt crisis anyone? 2010? Sorry it's a &lt;strong&gt;hybrid&lt;/strong&gt; like any bond, not just corporates bonds, that way of looking at the world is as aged as thinking that banks can always fund at LIBOR, it is emphatically BOTH a credit derivative and an interest rate derivative. To ignore credit risk on a european government bond and to use use words such as 'highly rated government bond' is completely to ignore the aftermath of the credit crunch. After all, why do european govvies trade at differing asset swap spreads if not for differing credit quality between eg Greece / Italy / Germany. Why do these spreads loosely follow sovereign CDS spreads (albeit on a mean reverting basis given liquidity factors influencing bond CDS basis). Why does the ECB impose varying haircuts on EGBs posted as collateral if not for reasons of credit quality? All bonds have credit risk, doesn't matter if they're issued by a government, or a corporate, or a bank. Sovereigns default, they have non-zero credit spreads. Please let's not repeat the mistakes of the past!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All that having been said, as the OP is forced to make a choice, I do agree that most banks will rightly classify and trade these in their rates pod. I just wanted to be clear that this is owing to being forced to classify, than for the fact that there is no credit risk in the product. Anyone who has traded through the sovereign debt crisis might feel this distinction.&lt;/p&gt;&#xA;" OwnerUserId="19239" LastEditorUserId="19239" LastEditDate="2016-12-07T16:08:51.537" LastActivityDate="2016-12-07T16:08:51.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31377" PostTypeId="2" ParentId="27718" CreationDate="2016-12-07T16:13:55.130" Score="1" Body="&lt;p&gt;My CS master was: &quot;Option Pricing through differential Equations&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It had mostly focused on the numerical algorithms used to pricing and their accuracy/speed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I doubt you would have any issue defending your thesis if you pick something similar...&lt;/p&gt;&#xA;" OwnerUserId="22383" LastActivityDate="2016-12-07T16:13:55.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31378" PostTypeId="1" CreationDate="2016-12-07T18:01:25.073" Score="0" ViewCount="1044" Body="&lt;p&gt;I want to find the list of comapanies delisted on NYSE exchange and the companies which will be delisted, is there any website which tracks it on a real time basis?&lt;/p&gt;&#xA;" OwnerUserId="25628" LastEditorUserId="17175" LastEditDate="2016-12-07T21:00:54.823" LastActivityDate="2016-12-07T21:00:54.823" Title="Website tracking list of companies delisted on NYSE exchange" Tags="&lt;equities&gt;&lt;market-data&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31379" PostTypeId="2" ParentId="31378" CreationDate="2016-12-07T18:45:48.613" Score="2" Body="&lt;p&gt;You can find active delisting on the &lt;a href=&quot;https://www.nyse.com/regulation/delistings&quot; rel=&quot;nofollow noreferrer&quot;&gt;NYSE website&lt;/a&gt;. As for the list of delisted companies, generally what you are looking for is the &lt;a href=&quot;http://www.investopedia.com/terms/s/sec-form-25.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;Form 25&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A notification given to the SEC by a national securities exchange telling of the removal from listing on that exchange and registration of matured, redeemed or retired corporate securities. SEC Form 25 is required by Rule 12d2-2 of the Securities Exchange Act of 1934. A security is considered to be delisted 10 days after the filing of Form 25 with the SEC.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can get the list of the most recent filings from &lt;a href=&quot;https://www.sec.gov/cgi-bin/browse-edgar?company=&amp;amp;CIK=&amp;amp;type=25-NSE&amp;amp;owner=include&amp;amp;count=100&amp;amp;action=getcurrent&quot; rel=&quot;nofollow noreferrer&quot;&gt;EDGAR&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="17175" LastActivityDate="2016-12-07T18:45:48.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31380" PostTypeId="1" CreationDate="2016-12-07T22:42:56.550" Score="2" ViewCount="83" Body="&lt;p&gt;Let's say you want to have a equally-weighted (in terms of the option price) portfolio of short put options on various stocks with the same maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Running Monte-Carlo simulations, it seems that choosing options with a highly correlated stock as an underlying results into a higher value of my portfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuitively, I would have guessed that correlations close to zero would be preferable, because then we would have more independent bets which are more likely to be not executed at maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas what correlation structure should be preferred?&lt;/p&gt;&#xA;" OwnerUserId="25630" LastEditorUserId="467" LastEditDate="2016-12-08T05:17:47.697" LastActivityDate="2016-12-08T05:17:47.697" Title="Portfolio of single stock short put options: which correlation structure preferrable?" Tags="&lt;options&gt;&lt;correlation&gt;&lt;portfolio&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31381" PostTypeId="2" ParentId="31227" CreationDate="2016-12-08T00:18:16.767" Score="0" Body="&lt;p&gt;One possible reason for negative autocorrelation is an imbalance between dynamic option hedgers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say an oil producer wants to buy puts on oil, a bank will sell it to them and then delta hedge the risk, whereas the producer won't.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, if the price of oil goes up the delta of the option for the bank will decrease (as the option goes out of the money) and so they'll sell oil into the market until they hit delta-neutrality, putting selling pressure while the oil producer won't be hedging so the impact is only coming from one side. And viceversa for a decrease.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another possible reason is that it is hitting stops both above and below. So the price rises a bit hits a stop, comes back down hits another stop bounces up again, etc. etc. until it clears all the stops on one side and then generally rips through.&lt;/p&gt;&#xA;" OwnerUserId="19520" LastActivityDate="2016-12-08T00:18:16.767" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31383" PostTypeId="1" CreationDate="2016-12-08T04:01:21.147" Score="9" ViewCount="1405" Body="&lt;p&gt;An option is the &lt;strong&gt;right&lt;/strong&gt;, but not the privilege, to trade an underlying at the strike price. Buying a stock option doesn't require any margin - I've just tested this with InteractiveBrokers, trying to buy an AAPL put.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, buying an ES futures option (call or put) requires quite a hefty margin (1575 initial, 1056 maintenance). What is the justification for that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the buyer, I pay the option premium, which is the maximum I can lose (50*11.25 = 562.50), no?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/WM3b8.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/WM3b8.png&quot; alt=&quot;Buying ES mini FOP requires $1575 in margin on IB&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="4848" LastEditorUserId="20795" LastEditDate="2019-09-08T09:09:28.653" LastActivityDate="2019-09-08T09:09:28.653" Title="Why does buying future options require margin?" Tags="&lt;options&gt;&lt;futures&gt;&lt;margin&gt;&lt;initial-margin&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="31384" PostTypeId="1" AcceptedAnswerId="31388" CreationDate="2016-12-08T04:35:43.773" Score="2" ViewCount="300" Body="&lt;p&gt;I often see the right part of the vol smile referred to as 'call skew'. However, due to put/call parity, this also represents skew for ITM puts. Is there a reason behind this convention?&lt;/p&gt;&#xA;" OwnerUserId="25637" LastActivityDate="2016-12-08T13:10:44.500" Title="Why is the right part of the vol smile referred to as call skew" Tags="&lt;volatility-smile&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31387" PostTypeId="2" ParentId="16081" CreationDate="2016-12-08T11:25:43.487" Score="1" Body="&lt;p&gt;Yes, the assumption in MPT is normal distribution for returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can programme yourself in R or Excel, following elementary linear algebra.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Eric Zivot (U Wash) has a spreadsheet solution here:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://faculty.washington.edu/ezivot/econ424/solverex.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://faculty.washington.edu/ezivot/econ424/solverex.pdf&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://faculty.washington.edu/ezivot/econ424/Efficient%20Portfolios%20in%20Excel%20Using%20the%20Solver%20and%20Matrix%20Algebra.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://faculty.washington.edu/ezivot/econ424/Efficient%20Portfolios%20in%20Excel%20Using%20the%20Solver%20and%20Matrix%20Algebra.pdf&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="21023" LastActivityDate="2016-12-08T11:25:43.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31388" PostTypeId="2" ParentId="31384" CreationDate="2016-12-08T13:10:44.500" Score="1" Body="&lt;p&gt;I am not familiar with the terms call and put skew but rather upside and downside skew. However, I can image why they are used by some people.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Short Answer&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At-the-money and out-of-they-money options are usually more liquid than in-the-money options. I.e., on the upside (downside) calls (puts) have smaller spreads and give you a stronger signal of the mid market price at this strike. Consequently, you mainly use these instruments to construct your implied volatility smile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Some Intuition&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a bit of (heavily simplified) intuition why this is the case. Assume you are a market maker quoting otherwise identical European call and put options. You have a calibrated fair/mid-market implied volatility smile and now need to determine the corresponding bid and offer prices you are willing to quote. Your spread should account for your risk exposures, and you arrive at the following formula&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;s(T, K) = \alpha \frac{\partial V}{\partial \sigma}(T, K) + \beta \left| \frac{\partial V}{\partial S}(T, K) \right|.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, $\alpha$ is the spread you charge for one unit of vega and $\beta$ is the spread you charge for one unit of delta. Since the vega of European call and put options of the same strike are identical the spread difference stems from the delta. Since out-of-the-money options have a lower absolute delta, you are showing tighter quotes for them.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2016-12-08T13:10:44.500" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31389" PostTypeId="1" AcceptedAnswerId="31393" CreationDate="2016-12-08T14:58:48.013" Score="3" ViewCount="842" Body="&lt;p&gt;Let $X$ be a continuous random variable and $Q_x$ is the associated quantile function. Show that expected shortfall $ES_X[p]$ at the confidence level $p$ which is defined as&lt;br&gt;&#xA;$$ES_X[p]=\Bbb E[X|X\leq Q_x(1-p)]$$ has the representation $$ES_X[p]=\frac{1}{1-p}\int_0^{1-p} Q_x(a)da.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can some one give me a hint for this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know the definition of quantile function $Q_X(p)=\inf\{x: F_x \geq p\}$, I can think of it on an intuitive level, but want some thoughts to get started mathematically&lt;/p&gt;&#xA;" OwnerUserId="25173" LastActivityDate="2016-12-08T17:14:46.600" Title="Expected Shortfall Formula in terms of P" Tags="&lt;value-at-risk&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31390" PostTypeId="2" ParentId="31383" CreationDate="2016-12-08T15:05:47.947" Score="5" Body="&lt;p&gt;This page explains why you need a margin: &lt;a href=&quot;http://www.cmegroup.com/education/a-primer-on-margining-styles-for-options.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.cmegroup.com/education/a-primer-on-margining-styles-for-options.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Improvements:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Futures options, as well as futures margins, are governed by the&#xA;  exchange through a calculation algorithm known as SPAN margining.  For&#xA;  information on SPAN and how it works, please research the exchange web&#xA;  site for the CME Group, www.cmegroup.com.  From their web site you can&#xA;  run a search for SPAN, which will take you to a wealth of information&#xA;  on the subject and how it works.  The Standard Portfolio Analysis of&#xA;  Risk system is a highly sophisticated methodology that calculates&#xA;  performance bond requirements by analyzing the “what-ifs” of virtually&#xA;  any market scenario.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://ibkr.info/node/254&quot; rel=&quot;nofollow noreferrer&quot;&gt;Source&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Initial margin, also known as the total performance bond, is the term&#xA;  applied to the initial deposit or margin money each customer is&#xA;  required to put up as security for a guarantee of contract fulfillment&#xA;  at the time a futures or option position is established. Initial&#xA;  margin requirement has two components: the risk component and the&#xA;  equity component. &lt;strong&gt;The risk component is the risk level determined by&#xA;  SPAN (“Standard Portfolio Analysis of Risk”), which is a market&#xA;  simulation-based Value at Risk system.&lt;/strong&gt; The equity component is the net&#xA;  option value, which will be discussed in the following section. The&#xA;  margin rates used for calculating initial margin requirements for CME&#xA;  Group’s futures and options products are available online.  The&#xA;  requirement amounts for specific portfolios are calculated using SPAN.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cmegroup.com/education/a-primer-on-margining-styles-for-options.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Source&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;SPAN evaluates overall portfolio risk by calculating the worst&#xA;  possible loss that a portfolio of derivative and physical instruments&#xA;  might reasonably incur over a specified time period (typically one&#xA;  trading day). This is done by computing the gains and losses the&#xA;  portfolio would incur under different market conditions.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;At the core of the methodology is the SPAN risk array, a set of&#xA;  numeric values that indicate how a particular contract will gain or&#xA;  lose value under various conditions. Each condition is called a risk&#xA;  scenario. The numeric value for each risk scenario represents the gain&#xA;  or loss that particular contract will experience for a particular&#xA;  combination of price (or underlying price) change, volatility change,&#xA;  and decrease in time to expiration.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cmegroup.com/clearing/risk-management/span-overview.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Source&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;These Scan Risk Scenarios provide sixteen different potential market&#xA;  scenarios and show the associated gain/loss per Contract.  The chart&#xA;  below displays the sixteen risk scenarios.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.cmegroup.com/confluence/display/pubspan/Risk+Arrays&quot; rel=&quot;nofollow noreferrer&quot;&gt;Source&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Htbl0.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Htbl0.jpg&quot; alt=&quot;IBKR&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see from the risk scenarios for the Call options on the ES Futures, there are negative values generated from their models. I currently do not have details of their models and thus cannot tell how exactly these results have been obtained. But the basic principle is this.&lt;/p&gt;&#xA;" OwnerUserId="19096" LastEditorUserId="19096" LastEditDate="2018-02-26T03:58:53.710" LastActivityDate="2018-02-26T03:58:53.710" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31391" PostTypeId="2" ParentId="31389" CreationDate="2016-12-08T16:20:37.437" Score="5" Body="&lt;p&gt;Note that $Q_X$ is the pseudo-inverse of the distribution function $F$, and for any uniform random variable $U$ over $[0, 1]$, the random variable $Q_X(U)$ has the same distribution as $X$. Moreover, since $X$ is continuous, $Q_X$ is strictly increasing. Proofs of these facts are purely mathematical, and can be discussed some other questions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, we assume these facts are true. Then&#xA;\begin{align*}&#xA;ES_X(p) &amp;amp;=E\left(X \mid X\le Q_X(1-p)\right)\\&#xA;&amp;amp;=\frac{E\left(X\, 1_{X\le Q_X(1-p)} \right)}{P(X\le Q_X(1-p))}\\&#xA;&amp;amp;=\frac{E\left(Q_X(U)\, 1_{Q_X(U)\le Q_X(1-p)} \right)}{P(Q_X(U)\le Q_X(1-p))}\\&#xA;&amp;amp;=\frac{E\left(Q_X(U)\, 1_{U\le 1-p} \right)}{P(U\le 1-p)}\\&#xA;&amp;amp;=\frac{1}{1-p}\int_0^{1-p} Q_X(a) da.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-12-08T16:28:22.903" LastActivityDate="2016-12-08T16:28:22.903" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31393" PostTypeId="2" ParentId="31389" CreationDate="2016-12-08T17:09:14.297" Score="6" Body="&lt;p&gt;Gordon's answer is spot on. Another way to see it though, would be using Bayes formula and a change of variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;ES_X(p) &amp;amp;=E\left(X \mid X\le Q_X(1-p)\right)\\&#xA;&amp;amp;=\int_{-\infty}^{\infty} x\,  \phi\left(x \mid x\le Q_X(1-p)\right) dx \\&#xA;&amp;amp;=\int_{-\infty}^{\infty} x\, \frac{\phi\left(x\le Q_X(1-p) \mid x \right)\phi(x)}{\int_{-\infty}^{\infty} \phi\left(u\le Q_X(1-p) \mid u \right)\phi(u) du } dx&#xA;\end{align*}&#xA;Now simply note that &#xA;$$\phi\left(x \le Q_X(1-p) \mid x \right) = 1\left\{ x \le Q_X(1-p) \right\} $$&#xA;to be able to rewrite the integral as in the second line in Gordon's answer&#xA;\begin{align*}&#xA;ES_X(p) &amp;amp;= \frac{E\left(X\, 1_{X\le Q_X(1-p)} \right)}{P(X\le Q_X(1-p))} \\&#xA;        &amp;amp;= \frac{1}{1-p} \int_{-\infty}^{Q_X(1-p)} x\, \phi(x) dx&#xA;\end{align*}&#xA;a change of variable $x \to y=\Phi(x)$ (the cdf of $X$) finishes the demonstration.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2016-12-08T17:14:46.600" LastActivityDate="2016-12-08T17:14:46.600" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31394" PostTypeId="1" AcceptedAnswerId="31396" CreationDate="2016-12-08T18:07:43.490" Score="0" ViewCount="57" Body="&lt;p&gt;I am a software engineer. I might be working on a project in near future that will require some knowledge of basic finance terms. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I never had any course about finance or accounting in college or university. There will be a financial expert on project to guide the engineers but I also want to gain some knowledge about subject. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to know if there is any book or small tutorial available that can teach me the basics. I searched online but could not find.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some of the terms are Debt, Mortgage, Liquid Debt, Net Worth, Investment and Growth Rate, Loan, Credit Card and Interest rate, Ownership etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can search for these terms online and understand but I don't want to be limited to these, I want to know the basics and there must be more terms there if our project grows in future.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It is quite possible that all of these terms are easily understood to you, so please don't say this is 8th grade knowledge :)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="25642" LastActivityDate="2016-12-08T18:22:17.810" Title="Where can I get intro to basic personal finance terms? I'm a software engineer" Tags="&lt;finance&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2016-12-08T20:46:33.820" ContentLicense="CC BY-SA 3.0" />
  <row Id="31396" PostTypeId="2" ParentId="31394" CreationDate="2016-12-08T18:22:17.810" Score="0" Body="&lt;p&gt;Hillier, Ross, Westerfield, Jaffe, Jordan: Corporate Finance&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Read this book. I was recommended to use this book for the citation of basic terms in my thesis. I was surprised how well and easy it was explained. It has also a good structure. If you go to a university library, you will most likely find it, which you can borrow then.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: If you want to look up just a few terms: go to investopedia. They're not always that scientific, but for the basic purposes of understanding the terms it's mostly sufficient.&lt;/p&gt;&#xA;" OwnerUserId="24656" LastActivityDate="2016-12-08T18:22:17.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31397" PostTypeId="1" CreationDate="2016-12-08T19:04:34.840" Score="1" ViewCount="1190" Body="&lt;p&gt;I was wondering if someone could help me with a problem, regarding the Merton Black Scholes PDE. I have an exam soon and this question on an old exam has been bothering me and a friend for quite a while. We simply don't get it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question goes this way:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;The payoff of a so-called European log-contract is $g \left( S_T \right) = \ln \left( S_T / K \right)$ where $K$ is the strike price and S is a risky non-dividend MBS asset. &#xA;Find the price $c(s,t)$ of such asset.&#xA;Hint: Use the Black-Scholes PDE and give yourself the fact that c has the following form:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;c(s,t) = a(t) + b(t) \ln(s/K)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Find the functions $a(t)$ and $b(t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried to figure out the solution and see if there's anything online, but nothing works. Using the BS-PDE is not helping. All help and advice would be GREATLY appreciated!&lt;/p&gt;&#xA;" OwnerUserId="25643" LastEditorUserId="24222" LastEditDate="2016-12-08T19:08:16.227" LastActivityDate="2016-12-08T20:00:12.710" Title="Pricing log-contract with Black-Scholes PDE" Tags="&lt;black-scholes&gt;&lt;finance&gt;&lt;black-scholes-pde&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31399" PostTypeId="2" ParentId="31397" CreationDate="2016-12-08T19:38:45.700" Score="4" Body="&lt;p&gt;The B/S PDE for a contingent claim $V(S, t)$ is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\frac{\partial V}{\partial t} + r S \frac{\partial V}{\partial S} + \frac{1}{2} \sigma^2 S^2 \frac{\partial V^2}{\partial S^2} - r V = 0&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;subject to the terminal condition $V(S, T) = \ln(S / K)$. According to the hint, the solution to $V(S, t$) takes the form&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;V(S, t) = a(t) + b(t) \ln(S / K).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the terminal condition has to hold for all $S$, it follows that $a(T) = 0$, $b(T) = 1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take the partial derivatives of the guess to get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\frac{\partial V}{\partial t}(S, t) &amp;amp; = &amp;amp; a'(t) + b'(t) \ln(S / K),\\&#xA;\frac{\partial V}{\partial S}(S, t) &amp;amp; = &amp;amp; b(t) \frac{1}{S},\\&#xA;\frac{\partial^2 V}{\partial S^2}(S, t) &amp;amp; = &amp;amp; -b(t) \frac{1}{S^2}.\\&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Substituting back yields&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;a'(t) + b'(t) \ln(S / K) + r b(t) - \frac{1}{2} \sigma^2 b(t) - r a(t) - r b(t) \ln(S / K) = 0.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since for each fixed $t$, this solution has to hold for all values of $S$, we collect terms containing $\ln(S / K)$ and get the ODEs&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;0 &amp;amp; = &amp;amp; a'(t) + \left( r - \frac{1}{2} \sigma^2 \right) b(t) - r a(t),\\&#xA;0 &amp;amp; = &amp;amp; \left( b'(t) - r b(t) \right) \ln(S / K)&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution to the second ODE that satisfies $b(T) = 1$ is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;b(t) = e^{-r (T - t)}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution to the first ODE that satisfies $a(T) = 0$ is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;a(t) = b(t) \left( r - \frac{1}{2} \sigma^2 \right) (T - t).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Combining these results yields&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;V(S, t) = e^{-r (T - t)} \left[ \left( r - \frac{1}{2} \sigma^2 \right) (T - t) + \ln(S / K) \right].&#xA;\end{equation}&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2016-12-08T19:38:45.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31401" PostTypeId="1" AcceptedAnswerId="31406" CreationDate="2016-12-08T20:23:32.843" Score="4" ViewCount="23517" Body="&lt;p&gt;which is the difference betwee a model like CAPM and a single index model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the first a special case of the second?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best&lt;/p&gt;&#xA;" OwnerUserId="22194" LastActivityDate="2019-02-19T16:56:14.930" Title="Difference between CAPM and single index model" Tags="&lt;capm&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31402" PostTypeId="1" CreationDate="2016-12-08T20:50:54.623" Score="3" ViewCount="655" Body="&lt;p&gt;Along with many other people, I have been using Moody's seasoned BAA and AAA corporate bond yield series for my research for some time. I use them primarily to compute and analyze the quality spread.  Unfortunately, it appears that the Fed will &lt;a href=&quot;https://fred.stlouisfed.org/series/BAA&quot; rel=&quot;nofollow noreferrer&quot;&gt;no longer be computing and publishing these series&lt;/a&gt;.  I've been looking around for a replacement.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The obvious choice, it seemed, was the BofA Merrill Lynch Corporate &lt;a href=&quot;https://fred.stlouisfed.org/series/BAMLC0A4CBBBEY&quot; rel=&quot;nofollow noreferrer&quot;&gt;BBB yield&lt;/a&gt; and &lt;a href=&quot;https://fred.stlouisfed.org/series/BAMLC0A1CAAAEY&quot; rel=&quot;nofollow noreferrer&quot;&gt;AAA yield&lt;/a&gt; series.  However, plotting the spread between these two against the spread of the old Moody's series, they don't seem to be that close.  Certainly not a continuation nor drop-in replacement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the new consensus data series to be used to look at the quality spread?  Do we just use the BofA Merrill Lynch series or is there another series I'm overlooking?&lt;/p&gt;&#xA;" OwnerUserId="11708" LastActivityDate="2016-12-08T20:50:54.623" Title="Replacement for Moodys BAA and AAA series" Tags="&lt;data&gt;&lt;spread&gt;&lt;bond-yields&gt;&lt;indicator&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31403" PostTypeId="1" CreationDate="2016-12-08T21:30:06.600" Score="0" ViewCount="69" Body="&lt;p&gt;What numerical distributions  yield misleading standard deviation calculations? Can you make the standard deviation of distribution 1 attain a higher value than the standard deviation of distribution 2 where they are from two different discrete probability distributions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am aware that standard deviation is sensitive to the number of sample points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I am interested in the same question for downside standard deviation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for reading this  &lt;/p&gt;&#xA;" OwnerUserId="25647" LastActivityDate="2016-12-08T22:21:17.740" Title="How can certain numerical distributions yield misleading standard deviation calculations?" Tags="&lt;standard-deviation&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2016-12-09T08:07:03.763" ContentLicense="CC BY-SA 3.0" />
  <row Id="31404" PostTypeId="2" ParentId="31403" CreationDate="2016-12-08T22:06:19.387" Score="1" Body="&lt;p&gt;There are no distributions that have a standard deviation that trigger &lt;em&gt;misleading&lt;/em&gt; calculations.  Not all distributions have a standard deviation.  The standard textbook estimator for variance is an unbiased estimator for variance, but it is a biased estimator for the standard deviation.  This is because taking the square root of an expectation, which is what you are doing when you take the square root of the estimate of sample variance, is not necessarily equal to taking the expectation of the square root, which is what an unbiased estimator would do.  This is known as Jensen's inequality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because of this you can sort of play small sample size games on purpose with a handful of discrete distributions that have been rigged to trigger this property, but that is more of a parlor trick.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now among the continuous distributions, the distribution of returns for most assets lacks the property normally called variance.  The US stock market returns for going concerns is close to a truncated Cauchy distribution, with the slight skew being due to the budget constraint.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A standard deviation can be thought of as a property, like a nose is a property of many animals, but absent in trees.  If you saw something with a nose, you would not say it was a tree.  Some distributions have no standard deviation and so any calculation of a standard deviation will be misleading as it will generate a random number instead.  The symmetric Cauchy distribution has the peculiar property that as the sample size goes to infinity, the sample variance will go to infinity.  Conversely, when you do this with a normal distribution you will get a near perfect estimate of the true variance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nonetheless, the only way to trigger this type of behavior in discrete distributions is to bin a distribution that has no variance.  Binning will not cause a variance to appear, but it would be a weird thing to do with a discrete distribution, on purpose.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The symmetric Cauchy distribution is $$\frac{1}{\pi}\frac{\sigma}{\sigma^2+(x-\mu)^2}.$$  With a little bit of creativity and a good proper understanding of how to solve the constant of integration and evenly spaced bins, you could create a discrete distribution, say over the values of the Cauchy distribution on the integers, that would generate a misleading variance because it would not have one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find a derivation for the returns on various asset classes at &lt;a href=&quot;https://ssrn.com/abstract=2828744&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://ssrn.com/abstract=2828744&lt;/a&gt;  It is technical however so I wouldn't worry about it too much.  It is listed more for completeness.  As your technical skills increase, you can come back to it.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastEditorUserId="25459" LastEditDate="2016-12-08T22:21:17.740" LastActivityDate="2016-12-08T22:21:17.740" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="31405" PostTypeId="1" AcceptedAnswerId="31412" CreationDate="2016-12-08T22:29:50.273" Score="1" ViewCount="186" Body="&lt;p&gt;So we have the basic structure:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma^2_{Pxy} = w_x^2 \sigma_x^2 + w_y^2 \sigma_y^2 + 2 w_x w_y \sigma_{xy}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma^2_{Px} = w_x^2 \sigma_x^2 + w_x w_y \sigma_{xy}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma^2_{Py} = w_y^2 \sigma_y^2 + w_x w_y \sigma_{xy}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma^2_{Pxy} = \sigma^2_{Px} + \sigma^2_{Py}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that this structure leaves the risk measure in terms of variance, so if we want to find percentage contribution to risk, it doesn't easily translate from variance to standard deviation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Meaning, it is easy to solve for:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \cfrac{\sigma^2_{Px}}{\sigma^2_{Pxy}} =$ percentage contribution to risk (variance), as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \cfrac{\sigma^2_{Px}}{\sigma^2_{Pxy}} + \cfrac{\sigma^2_{Py}}{\sigma^2_{Pxy}} = 1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, it is not easy to solve for:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \cfrac{\sigma_{Px}}{\sigma_{Pxy}} =$ percentage contribution to risk (std dev), as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \cfrac{\sigma_{Px}}{\sigma_{Pxy}} + \cfrac{\sigma_{Py}}{\sigma_{Pxy}} \ne 1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, it isn't right to just scale it to whatever the square root of the percentages happen to sum to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $ x = \cfrac{\sigma_{Px}}{\sigma_{Pxy}}$ and $ y = \cfrac{\sigma_{Py}}{\sigma_{Pxy}}$, it is not clear what $ \cfrac{x}{x + y}$ equals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have a solution to this problem?&lt;/p&gt;&#xA;" OwnerUserId="19473" LastActivityDate="2016-12-10T10:45:08.993" Title="Converting Contribution To Risk from Variance to Stdev" Tags="&lt;risk&gt;&lt;portfolio&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31406" PostTypeId="2" ParentId="31401" CreationDate="2016-12-08T23:06:00.393" Score="5" Body="&lt;p&gt;As you know the equation that describes them is the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The single index model is an empirical description of stock returns. You do some regressions using data and you come up with Alphas, Betas etc. That's all. It is useful for example in modeling risks of a bunch of stocks in a simple way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The CAPM is an economic theory that says that Alpha in the long run has an expected value of zero, which means that the returns investors get are solely due to their exposure to the 'market factor'. This is justified by some reasoning like &quot;other risks can be diversified away, so they will not be rewarded in equilibrium, only 'systematic risk' will be rewarded&quot;.  However, as you know, this has not held up well and it seems that there are other factors that are 'rewarded' in practice. So the CAPM is seen by many as flawed in some ways.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2016-12-08T23:06:00.393" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31407" PostTypeId="1" CreationDate="2016-12-09T00:13:50.113" Score="2" ViewCount="1282" Body="&lt;p&gt;What is the difference between stochastic discount factor and stochastic discount factor process and how are they both related?&lt;/p&gt;&#xA;" OwnerUserId="24729" LastActivityDate="2016-12-09T05:28:11.893" Title="What is the difference between stochastic discount factor and stochastic discount factor process?" Tags="&lt;stochastic-discount&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31410" PostTypeId="1" CreationDate="2016-12-09T02:20:01.367" Score="0" ViewCount="26" Body="&lt;p&gt;I am looking at a stock, say stock X and I am simulating it by a random walk. It is only simulated once every month, where $t$ represents the month. I am letting $S_0$ represent the value of the stock at the beginning of the year, $S_0$. I have the following: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_t - S_0 = X_1 +X_2+...+X_t$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_1,...$ is iid sequence of variables. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am expecting that this stock will increase by $0$ this year and am modeling this as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P(x_i = g) = \frac{1}{2}, P(x_i = -g) = \frac{1}{2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $g &amp;gt; 0$ is a constant depending on $i$. I have found that assuming that in this year the stock has zero expectation gain so $E[S_{365} - S_0] = 0$. I have calculated the std of the change of the stock this year and it is 108 points (108 dollars). I am unsure of how large to take $g$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I am thinking it could be about 25 but I am not sure as this seems pretty high. &lt;/p&gt;&#xA;" OwnerUserId="16210" LastActivityDate="2016-12-09T02:20:01.367" Title="Random Walk choosing constant $g$" Tags="&lt;equities&gt;&lt;stochastic-processes&gt;&lt;random-walk&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31411" PostTypeId="2" ParentId="31383" CreationDate="2016-12-09T03:15:46.500" Score="4" Body="&lt;p&gt;The answer given by AK88 is good.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To put it in simpler terms it is because a &quot;futures account&quot; (holding futures and options on futures) works differently from a &quot;stock account&quot; holding stocks and options on stocks or indexes). At Interactive Brokers you have a single account, but it is divided into separate futures and stocks subaccounts that work according to these different conventions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a stock account when you buy an asset, cash is deducted from your account, in a futures account when you &quot;buy&quot; something (more correctly when you open a long position) cash does not disappear but is &quot;earmarked&quot; or set aside in the form of a margin requirement; cash leaves or enters the account only because of daily mark to market of your existing positions (or of course when you personally take money out or put more in). &lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2016-12-09T03:15:46.500" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31412" PostTypeId="2" ParentId="31405" CreationDate="2016-12-09T04:25:40.457" Score="2" Body="&lt;p&gt;$ \cfrac{\sigma_{Px}}{\sigma_{Pxy}} + \cfrac{\sigma_{Py}}{\sigma_{Pxy}} \ne 1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;beacuse &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ {\sigma_{Px}} + {\sigma_{Py}} \ne {\sigma_{Pxy}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;as we had &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma^2_{Px} + \sigma^2_{Py} = \sigma^2_{Pxy}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and this is equal to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sqrt{(\sigma^2_{Px} + \sigma^2_{Py})}/\sigma^2_{Pxy} = 1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me know if you want to see an example of risk contribution based on standard deviations of the constituent assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma^2_{Pxy} = w_x^2 \sigma_x^2 + w_y^2 \sigma_y^2 + 2 w_x w_y \sigma_{x} \sigma_{y} \rho_{xy}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the standard deviation of the portfolio is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma_{Pxy} = \sqrt{w_x^2 \sigma_x^2 + w_y^2 \sigma_y^2 + 2 w_x w_y \sigma_{x} \sigma_{y} \rho_{xy}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now find the marginal risk contribution of asset $x$ by taking the derivative of the portfolio standard deviation with respect to $w_x$ (the weight of asset $x$):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\cfrac {d \sigma_{Pxy}} {d w_x} = \cfrac {d \sqrt{w_x^2 \sigma_x^2 + w_y^2 \sigma_y^2 + 2 w_x w_y \sigma_{x} \sigma_{y} \rho_{xy}}} {d w_x} = \cfrac {d (w_x^2 \sigma_x^2 + w_y^2 \sigma_y^2 + 2 w_x w_y \sigma_{x} \sigma_{y} \rho_{xy})^{1/2}} {d w_x} = \cfrac {1} {2 (w_x^2 \sigma_x^2 + w_y^2 \sigma_y^2 + 2 w_x w_y \sigma_{x} \sigma_{y} \rho_{xy})^{1/2}} (2 w_x \sigma_x^2 + 2 w_y \sigma_{x} \sigma_{y} \rho_{xy}) = \cfrac {w_x \sigma_x^2 + w_y \sigma_{x} \sigma_{y} \rho_{xy}} {\sigma_{Pxy}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Total risk contributed by asset $x$ to the portfolio is equal to &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\cfrac {w_x \sigma_x^2 + w_y \sigma_{x} \sigma_{y} \rho_{xy}} {\sigma_{Pxy}} w_x = \cfrac {w_x^2 \sigma_x^2 + w_x w_y \sigma_{x} \sigma_{y} \rho_{xy}} {\sigma_{Pxy}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Likewise, total risk contributed by asset $y$ to the portfolio is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\cfrac {w_y \sigma_y^2 + w_x \sigma_{x} \sigma_{y} \rho_{xy}} {\sigma_{Pxy}} w_y = \cfrac {w_y^2 \sigma_y^2 + w_x w_y \sigma_{x} \sigma_{y} \rho_{xy}} {\sigma_{Pxy}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&#xA;$\sigma_{x} = 15%$;&#xA;$\sigma_{y} = 20%$;&#xA;$\rho_{xy} = 0.5$;&#xA;$w_x = 60%$;&#xA;$w_y = 40%$;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So we have:&#xA;$\sigma_{Pxy} = 14.73%$;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Risk contributions to the portfolio:&#xA;$\sigma_{Px} = 7.94%$;&#xA;$\sigma_{Py} = 6.79%$;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this what you were looking for?&lt;/p&gt;&#xA;" OwnerUserId="19096" LastEditorUserId="19096" LastEditDate="2016-12-10T10:45:08.993" LastActivityDate="2016-12-10T10:45:08.993" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31413" PostTypeId="2" ParentId="31407" CreationDate="2016-12-09T05:28:11.893" Score="4" Body="&lt;p&gt;You should consider the following different, but related, concepts:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Pricing kernel: It is a stochastic process $\{M_t\}_{t=1}^\infty$ such that the pricing process is a martingale, i.e., $M_t S_t =E_t[M_{t+1}S_{t+1}] \quad \forall t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Stochastic discount factor: you can divide both sides of the previous equation by $M_t$ to obtain that $P_t=E_t\left[\frac{M_{t+1}}{M_t}S_{t+1}\right]=E[SDF_{t+1}\times Payoff_{t+1}]$ . The SDF tells you about the ratio between marginal utility of wealth at time t+1 and at time t, i.e., $SDF_{t+1}=\left(\frac{\partial U( W)}{\partial W_{t+1}}\right)/\left(\frac{\partial U( W)}{\partial W_{t}}\right)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-Stochastic discount factor process: it is the stochastic process of $\left\{SDF_t\right\}_{t=1}^\infty$ &lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2016-12-09T05:28:11.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31415" PostTypeId="1" CreationDate="2016-12-09T10:39:23.720" Score="-1" ViewCount="75" Body="&lt;p&gt;Does someone know some good literature(Papers or Books) regarding the topic how to Price debt/credit with prepayment?&#xA;I just found literature about the general topic , like how to price callable bonds, but I never found literature that clearly states that a debt with a prepayment Option can be f.e. be modelled as a callable bond or a bond with a swaption.&#xA;Maybe u have some recommendations?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thy,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;K.S.&lt;/p&gt;&#xA;" OwnerUserId="24804" LastActivityDate="2017-07-18T23:26:33.163" Title="Pricing Debt/Credit/Mortgage+ Prepayment- Literature?" Tags="&lt;credit&gt;&lt;debt&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31416" PostTypeId="1" CreationDate="2016-12-09T11:07:03.460" Score="3" ViewCount="886" Body="&lt;p&gt;I am trying to understand why the Sharpe ratio changes (increases) when I simulate leveraging my portfolio by multiplying all the time series of daily returns by a leverage factor (e.g. 5).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that the Sharpe ratio should not change when a portfolio is leveraged (other things being equal).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I find that the annualized Sharpe ratio (calculated geometrically with formula: &lt;code&gt;return = (product of 1+ daily returns ^ (262/number of returns))-1&lt;/code&gt;, &lt;code&gt;stdev = stdev(returns)*(sqrt(262))&lt;/code&gt; &lt;em&gt;deos&lt;/em&gt; increase (e.g. from 3.1 to 4.3).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the daily Sharpe ratio (calculated as the arithmetic average of returns divided by standard deviation) remains identical (mathematically identical).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am assuming a risk free rate of zero, so the Sharpe is simply return divided by &lt;code&gt;stdev&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm sure it's something obvious, but can anyone explain why?&lt;/p&gt;&#xA;" OwnerUserId="25654" LastEditorUserId="467" LastEditDate="2016-12-09T12:50:35.650" LastActivityDate="2016-12-09T16:22:37.307" Title="Should the Sharpe ratio of a portfolio change when it is leveraged?" Tags="&lt;leverage&gt;&lt;sharpe&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31418" PostTypeId="1" AcceptedAnswerId="31420" CreationDate="2016-12-09T15:04:33.223" Score="0" ViewCount="509" Body="&lt;p&gt;\begin{equation}&#xA;Z(t) = \exp (a W(t))&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am asked to find $dZ$. I am pretty sure it can be done using Ito's lemma. But in all my textbook (Bjork) examples Ito's lemma is giving from a $dZ$ function and not the other way around.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question: I want to use Ito's lemma to find $dZ$. How do I define my $f$ (from the standard Ito's lemma formulation) function? &lt;/p&gt;&#xA;" OwnerDisplayName="user25295" LastEditorUserId="467" LastEditDate="2016-12-09T15:43:13.787" LastActivityDate="2016-12-09T15:48:18.023" Title="How to define the $f$ function to apply Ito's lemma?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;itos-lemma&gt;&lt;homework&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31419" PostTypeId="2" ParentId="31416" CreationDate="2016-12-09T15:32:07.133" Score="4" Body="&lt;p&gt;Let us assume:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a constant risk-free rate $r$&lt;/li&gt;&#xA;&lt;li&gt;a risky asset with returns $X$&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;with expected value $\mathbb{E}(X)=\mu_X$&lt;/li&gt;&#xA;&lt;li&gt;and variance $\text{Var}(X)=\sigma_X^2$&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;a portfolio investing $w$ in the risky asset and $(1-w)$ in the risk-free asset&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Then you can compute the expected value of the portfolio:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mu_P = \mathbb{E}(P) = w \mu_X + (1-w)r$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and variance&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma_P^2 = \text{Var}\left[wX + (1-w)r\right] = w^2\sigma_X^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use the definition of the &lt;a href=&quot;https://en.wikipedia.org/wiki/Sharpe_ratio&quot; rel=&quot;noreferrer&quot;&gt;Sharpe ratio&lt;/a&gt;, you have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Sharpe}(P) = \frac{\mu_P - r}{\sigma_P} = \frac{w (\mu_X - r)}{w \sigma_X} = \frac{\mu_X - r}{\sigma_X}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly, the weight $w$ gets simplified and disappears in the Sharpe's computation which means that the Sharpe ratio stays the same $\forall w$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, this assumes that the mean is estimated as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\hat{\mu}(X) = \frac{1}{n}\sum_{i=1}^n r_{X,i}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and in particular:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\hat{\mu}(wX) = \frac{1}{n}\sum_{i=1}^n wr_{X,i} = w \frac{1}{n}\sum_{i=1}^n r_{X,i} = w \hat{\mu}_X$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, what you are doing is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\hat{\mu}(X) = \left(\prod_{i=1}^n 1 + r_{X,i}\right)^{\frac{1}{N}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and in particular&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\hat{\mu}(wX) = \left(\prod_{i=1}^n 1 + wr_{X,i}\right)^{\frac{1}{N}} \neq w\hat{\mu}(X)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, you are not computing the expected value strictly-speaking, so you're not really computing a Sharpe ratio. Furthermore, your version loses the property of being independent of $w$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A lot of people use the same approach in the industry, but it's fair to say that this is not the exact definition of the Sharpe.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2016-12-09T16:22:37.307" LastActivityDate="2016-12-09T16:22:37.307" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31420" PostTypeId="2" ParentId="31418" CreationDate="2016-12-09T15:48:18.023" Score="3" Body="&lt;p&gt;In fact, the variable $Z_t$ is a function of $W_t$, which is the stochastic variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, you can see $Z_t$ as $f(W_t) = \exp(aW_t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rest is a trivial application of Ito's lemma to find $dZ_t=df(W_t)$.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2016-12-09T15:48:18.023" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31421" PostTypeId="2" ParentId="30195" CreationDate="2016-12-09T16:57:53.017" Score="1" Body="&lt;p&gt;The CNY 7D swaps have 3M calculation and payment periods. Within those 3M calculation periods the swap will have 7D reset periods. The fixing is -1D prior to the reset date each week and this date can vary it depends on start and end date of swap. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Muni swaps however fix on each Wed effective for Thursday so the weekly reset date is always set on Thursday.&lt;/p&gt;&#xA;" OwnerUserId="25660" LastActivityDate="2016-12-09T16:57:53.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31425" PostTypeId="1" AcceptedAnswerId="31433" CreationDate="2016-12-09T23:36:53.840" Score="0" ViewCount="166" Body="&lt;p&gt;&lt;strong&gt;Background Information:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I came across this question in chapter 2 of Active portfolio Management by Grinold and Kahn. It pertains to the efficient frontier which is displayed below: &lt;a href=&quot;https://i.stack.imgur.com/DSYWf.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/DSYWf.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If $T$ is fully invested and efficient and $T\neq C$, prove there exists a fully invested portfoli $T^{*}$ such that $Cov(r_T, r_{T^{*}}) = 0$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;We have that $T$ is fully invested on the efficient frontier so $h_{T}^{T}e = 1$ since we want to find a $T^{*}$ that is also fully invested and efficient but $T^{*}\neq C$ it seems to me by the picture above that the only way we can have $Cov(r_T, r_{T^{*}}) = 0$ then $T^{*} = Q$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additional thoughts:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $T$ is efficient and fully invested it must be a linear combination of $h_C$ and $h_Q$ thus $$h_T = c_1 h_C + c_2 h_Q$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then since $h_T^{T}e = 1$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\left(c_1h_C + c_2 h_Q\right)^{T}e = 1 \ \Rightarrow \ c_1 + c_2 = 1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Like wise since $T^{*}$ is  fully invested so $h_{T^*}^{T}e = 1$. Now, $r_T = h_{T}^{T} r = \left(c_1h_C + c_2 h_Q\right)^{T}r$ and $r_{T^{*}} = h_{T^{*}}^{T}r$ So,&#xA;\begin{align*}&#xA;Cov(r_T,r_{T^{*}}) &amp;amp;= Cov((c_1h_{C}^{T} + c_2 h_{Q}^{T})r,h_{T^{*}}^{T}r)\\&#xA;&amp;amp;= c_1 c_2 Cov(h_C^{T}r + h_Q^{T}r, h_{T^{*}}^{T}r)\\&#xA;&amp;amp;= c_1 c_2\left(E[(h_C^T r + h_Q^{T})h_{T^{*}}^{T}r] - E[h_C^{T}r + h_{Q}^{T}r]E[h_{T^{*}}^{T}r]\right)\\&#xA;&amp;amp;= c_1 c_2 \left(E[h_{C}^{T}r h_{T^{*}}r] + E[h_{Q}^{T}r h_{T^{*}}^T r] - E[h_C^{T}r]E[h_{T^{*}}^T r] - E[h_{Q}^{T}r] E[h_{T^{*}}^T r]\right)\\&#xA;&amp;amp;= 0&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure if this is correct although. I don't really know exactly how to approach this problem, any suggestions are greatly appreciated. &lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="19002" LastEditDate="2016-12-10T17:44:54.010" LastActivityDate="2016-12-10T17:54:19.647" Title="Show that there exists a fully invested portfolio such that the covariance between their returns is zero" Tags="&lt;modern-portfolio-theory&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;&lt;financial-engineering&gt;" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="31426" PostTypeId="1" AcceptedAnswerId="31431" CreationDate="2016-12-10T10:47:22.517" Score="5" ViewCount="612" Body="&lt;p&gt;Currently, I´m studying portfolio management and portfolio selection. The founder of the MPT is Harry Markowitz, of course. But reading his famous article from 1952 and his book from 1959 (actually, I have the 2nd edition from 1991 at hand, but that shouldn´t make a difference), I realized that Markowitz never really derived an equation to calculate the efficient frontier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;He does describe what efficient portfolios are and introduces some algorithms to attain efficient sets. But if I´m not mistaken, the first who derived an equation to calculate the efficient frontier was Robert Merton in his paper &lt;a href=&quot;http://www.people.hbs.edu/rmerton/analytical%20derivation.72.pdf&quot; rel=&quot;noreferrer&quot;&gt;&quot;An Analytic Derivation of the Efficient Portfolio Frontier&quot;&lt;/a&gt; from 1972.&#xA;Starting with the expected return $\bar{E}$ of the minimum variance portfolio, Merton derives the following equation that yields the expected return of an efficient portfolio as a function of its variance:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E=\bar{E}+\frac{1}{C} * \sqrt{DC(\sigma^2 - \bar{\sigma}^2)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: Why didn´t Markowitz derive such an equation? I guess he could have done it, he is a genius in his field of research and the founder of this theory.&#xA;Moreover, it seems much easier to calculate the efficient frontier using an equation rather than algorithmic approaches, so I suppose there must have been an early interest in finding such an equation like Merton did.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be very nice if someone can clarify this. Maybe I´m missing out on a pivotal element.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot in advance. &lt;/p&gt;&#xA;" OwnerUserId="25669" LastEditorUserId="70" LastEditDate="2016-12-10T12:08:34.560" LastActivityDate="2016-12-10T17:11:34.767" Title="Why did Markowitz not derive an equation for the efficient frontier?" Tags="&lt;modern-portfolio-theory&gt;&lt;portfolio-selection&gt;&lt;markowitz&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31427" PostTypeId="1" AcceptedAnswerId="31432" CreationDate="2016-12-10T12:37:40.173" Score="0" ViewCount="66" Body="&lt;p&gt;how to describe this pattern in Leonardo Finmeccanica's share price (observed &lt;a href=&quot;https://finance.yahoo.com/quote/LDO.MI?ltr=1&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;)? It is a fairly liquid stock, but the price seems to alternate between ca. 8 and ca 13!! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know what could explain this observation? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/3VvC8.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/3VvC8.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="25672" LastEditorUserId="25672" LastEditDate="2016-12-10T13:08:35.007" LastActivityDate="2016-12-10T17:25:49.863" Title="weird stationary pattern in LDO.MI's stock price" Tags="&lt;market-microstructure&gt;&lt;spread&gt;&lt;liquidity&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31429" PostTypeId="1" CreationDate="2016-12-10T15:48:12.993" Score="1" ViewCount="105" Body="&lt;p&gt;I am looking for a reliable data source provider for 1 to 320 minute S&amp;amp;P500 data. Or the ES mini contract. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone suggest a good source for this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&#xA;Andrew&lt;/p&gt;&#xA;" OwnerUserId="25673" LastActivityDate="2017-01-18T21:35:31.360" Title="Reliable data sources of 1,2,3,5,10,30,60,320 minute S&amp;P500 O,H,L,C,V data" Tags="&lt;time-series&gt;&lt;futures&gt;&lt;index&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31430" PostTypeId="2" ParentId="31429" CreationDate="2016-12-10T16:35:54.123" Score="1" Body="&lt;p&gt;I get this data (both the index and the Eminis) from TICKDATA.COM (I am not affiliated with this company). Reliable and high quality. I am sure there are many many satisfactory other sources.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2016-12-10T16:35:54.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31431" PostTypeId="2" ParentId="31426" CreationDate="2016-12-10T16:57:15.027" Score="3" Body="&lt;p&gt;It &lt;em&gt;is&lt;/em&gt; surprising. What I think is: Markowitz became interested in the general problem when there are constraints (including inequality constraints) on the portfolio weights (in addition to the standard $\sum w_i = 1$ constraint). Once he devised a computer algorithm [the Critical Line Method] for solving this problem (he was a math programming whiz) he seems to have stopped there. Perhaps he did not realize the importance of an analytical formula in the simple case with only a fully invested constraint. Merton had a better math background I believe and saw this. Merton has also said [personal communication] that he does not like geometric arguments (like Markowitz used throughout his book) and preferred an analytic or algebraic method of deriving results from starting assumptions. He started out trying to derive Portfolio Theory in this manner, and it took him farther than Markowitz.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-12-10T17:11:34.767" LastActivityDate="2016-12-10T17:11:34.767" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31432" PostTypeId="2" ParentId="31427" CreationDate="2016-12-10T17:25:49.863" Score="2" Body="&lt;p&gt;Seems like the least interesting pattern of all - data errors at the Yahoo's side. Just checked with Bloomberg - nothing similar is present.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not a data error, this could be bid-ask bounce (dismissed with here since you mention it's a liquid stock).&lt;/p&gt;&#xA;" OwnerUserId="25674" LastActivityDate="2016-12-10T17:25:49.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31433" PostTypeId="2" ParentId="31425" CreationDate="2016-12-10T17:41:01.590" Score="2" Body="&lt;p&gt;There is a procedure for finding $T^*$ starting from the portfolio $T$ on the efficient frontier, such that $cov(T^*,T)=0$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the point $T$ draw a line thorough the point $C$ (which represents the global minimum variance portfolio or GMVP) until it intersects the Y axis at a point $R_z$. Draw a horizontal line from this point until it intersect the parabola at a point we will call $T^*$. This is the desired portfolio having zero covariance with $T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly if T and C coincides the procedure fails: the line TC is not defined. We know that the GMVP has the same non-zero covariance with every portfolio on the parabola, so this case is not solvable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The detailed proof can be found for example on page 6,7,8 of this paper&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://eclass.aueb.gr/modules/document/file.php/INF258/ConstMalliarisPortfolioChapter.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://eclass.aueb.gr/modules/document/file.php/INF258/ConstMalliarisPortfolioChapter.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2016-12-10T17:41:01.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31436" PostTypeId="1" CreationDate="2016-12-11T09:31:53.510" Score="3" ViewCount="630" Body="&lt;p&gt;I just estimated a &lt;code&gt;ARMA(1,1)+GARCH(1,1)+Threshold order(1)&lt;/code&gt; equation for time series of stock prices. &#xA;Now I'm going to estimate the residuals' marginal distributions using the kernel density estimator in the interior of the distribution and the POT method in the tails using 10% of the data points for each tail.&#xA;I calculated cdf for all tail points using estimated parameters $(\mu=-5.98,\sigma=36.342 ,\varepsilon=-7.04)$ but the function doesn't support all of data points in tails. $(\mu &amp;lt; x &amp;lt; \mu-\frac{\sigma}{\varepsilon})$&#xA;Am I supposed to fit GPD to all data not just tails?&#xA;what are the other distributions appropriate for modeling tail data?&lt;/p&gt;&#xA;" OwnerUserId="25597" LastEditorDisplayName="user16651" LastEditDate="2016-12-11T16:40:56.513" LastActivityDate="2017-01-12T17:37:24.670" Title="Modeling tail data using Generalized Pareto distribution" Tags="&lt;statistics&gt;&lt;garch&gt;&lt;value-at-risk&gt;&lt;arma&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31437" PostTypeId="1" CreationDate="2016-12-11T13:51:15.090" Score="2" ViewCount="194" Body="&lt;p&gt;Every book I read refers me to many other books, there is practically no way I can read all this text in my life time. Once and for all, where is the best place to fish for ideas?&lt;/p&gt;&#xA;" OwnerUserId="25622" LastActivityDate="2016-12-11T14:07:27.303" Title="Where can I find ideas for strategies?" Tags="&lt;finance&gt;&lt;finance-mathematics&gt;&lt;statistical-finance&gt;&lt;financial-engineering&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2016-12-11T15:41:01.023" ContentLicense="CC BY-SA 3.0" />
  <row Id="31438" PostTypeId="2" ParentId="31437" CreationDate="2016-12-11T14:07:27.303" Score="3" Body="&lt;p&gt;There are lots of different sources out there where you can find various quantitative strategies. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually, different blog aggregators like &lt;a href=&quot;https://www.r-bloggers.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.r-bloggers.com&lt;/a&gt; post on their websites interesting new approaches and techniques. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also find great deal of information on Quantopian's dedicated page here: &lt;a href=&quot;https://www.quantopian.com/posts/trading-strategy-ideas-thread&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.quantopian.com/posts/trading-strategy-ideas-thread&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ssrn.com and arxiv.org also may be useful. &lt;/p&gt;&#xA;" OwnerUserId="19096" LastActivityDate="2016-12-11T14:07:27.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31439" PostTypeId="1" CreationDate="2016-12-11T19:40:04.000" Score="1" ViewCount="10150" Body="&lt;p&gt;I am working on conditional volatility and realized volatility but the difference between these two measures is not clear to me. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anybody explain how these two volatilities are related? Does the realized vola affect the conditional vola? I have read some papers which use particular models to model conditional vola and sometimes call it conditional vola and sometimes just vola. Does that mean that e.g. a Garch model can be used to model volatility or do I use Garch to model conditional volatility?&lt;/p&gt;&#xA;" OwnerUserId="25692" LastEditorUserId="467" LastEditDate="2016-12-12T04:34:16.310" LastActivityDate="2019-11-19T17:05:24.310" Title="What is the difference between conditional volatility and realized volatility?" Tags="&lt;volatility&gt;&lt;garch&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31440" PostTypeId="2" ParentId="31439" CreationDate="2016-12-11T21:02:07.987" Score="2" Body="&lt;p&gt;The main point of GARCH theories is that volatility is always changing and that it is therefore a latent (&quot;not directly observable&quot;) variable. The underlying volatility at a point in time is called the conditional volatility at that particular moment and is modeled by various GARCH-type equations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The historical or realized volatilities on the other hand are the observed volatilities during specific intervals of time, the historical is usually computed from daily data and the realized from more high frequency data (such as 10 minute data).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But even a realized volatility will be estimated over an INTERVAL of time, even if short, and is therefore different from the conditional volatility which is instantaneous. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea behind the early &quot;realized volatility&quot; papers was in fact to come closer to the conditional volatility by sampling the underlying time series at higher frequency, but knowing that you can never get to the ultimate goal of &quot;seeing&quot; conditional (instantaneous) volatility.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-12-11T21:08:24.803" LastActivityDate="2016-12-11T21:08:24.803" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31441" PostTypeId="1" AcceptedAnswerId="31449" CreationDate="2016-12-11T23:14:05.500" Score="1" ViewCount="139" Body="&lt;p&gt;&lt;strong&gt;Background Information:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;This question is from Lectures on Financial Mathematics: Discrete Asset Pricing.&lt;/p&gt;&#xA;&lt;p&gt;Theorem 3.2 First Fundamental Theorem of Asset Pricing - Suppose &lt;span class=&quot;math-container&quot;&gt;$\nu$&lt;/span&gt; is any measure such that &lt;span class=&quot;math-container&quot;&gt;$S/S^{0}$&lt;/span&gt; is a &lt;span class=&quot;math-container&quot;&gt;$\nu$&lt;/span&gt;-martingale. For an attainable claim &lt;span class=&quot;math-container&quot;&gt;$X$&lt;/span&gt; with replicating strategy &lt;span class=&quot;math-container&quot;&gt;$\phi$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$0\leq t\leq T$&lt;/span&gt;, we have&#xA;&lt;span class=&quot;math-container&quot;&gt;$$V_t(\phi) = E_{\nu}\left(X\frac{S_t^{0}}{S_T^{0}}|\mathcal{F}_t\right)$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Prove that:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;All martingale measures price the attainable claim equally, and&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;if there is a martingale measure, then all replicating strategies for a given claim have the same value at all times.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I am sort of confused even where to begin, some guidance or suggestions may help.&lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-12-12T18:40:45.280" Title="All martingale measures price the attainable claim equally" Tags="&lt;mathematics&gt;&lt;finance-mathematics&gt;&lt;martingale&gt;&lt;financial-engineering&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31442" PostTypeId="2" ParentId="31436" CreationDate="2016-12-12T02:09:11.097" Score="1" Body="&lt;p&gt;You might be interested in this &lt;a href=&quot;https://ssrn.com/abstract=2702275&quot; rel=&quot;nofollow noreferrer&quot;&gt;ARTICLE&lt;/a&gt; (published in Quantitative Finance 2016) and citations therein. The authors consider different distributions to model tails in financial time series and in particular focus on EVT/GPDs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GPDs are used to specifically model tails and hence are fitted after some threshold that separates the tail from the central region of the distribution. Threshold choice is a separate discussion, the literature provides &#xA;several methods (e.g. see article above).&lt;/p&gt;&#xA;" OwnerUserId="25579" LastEditorUserId="25579" LastEditDate="2016-12-13T16:57:26.540" LastActivityDate="2016-12-13T16:57:26.540" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31444" PostTypeId="1" AcceptedAnswerId="31448" CreationDate="2016-12-12T13:50:00.517" Score="0" ViewCount="99" Body="&lt;p&gt;Suppose the book of ticker &lt;code&gt;X&lt;/code&gt; is empty. Simultaneously trader &lt;code&gt;A&lt;/code&gt; sends a limit buy order for 1 unit of &lt;code&gt;X&lt;/code&gt; at price &lt;code&gt;2$&lt;/code&gt; and trader &lt;code&gt;B&lt;/code&gt; sends limit sell order of 1 unit of &lt;code&gt;X&lt;/code&gt; for &lt;code&gt;1$&lt;/code&gt;, what will happen? What is going to be the fill price? Same question for market order, suppose the book for ticker &lt;code&gt;X&lt;/code&gt; is empty and traders &lt;code&gt;A&lt;/code&gt; and &lt;code&gt;B&lt;/code&gt; send a buy and sell market orders (without prices) is the fill price going to be the last fill price? how is the fill price determined in such case?&lt;/p&gt;&#xA;" OwnerUserId="25622" LastEditorUserId="25622" LastEditDate="2016-12-12T14:04:52.630" LastActivityDate="2016-12-12T16:04:20.050" Title="Fill prices on limit and market orders" Tags="&lt;price&gt;&lt;order-execution&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31445" PostTypeId="1" AcceptedAnswerId="31451" CreationDate="2016-12-12T14:47:54.027" Score="3" ViewCount="171" Body="&lt;p&gt;Consider the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;dn_t = [\theta_n(t)-a_nn_t]dt + \sigma_ndW_{t}^n \\ &#xA;dr_t = [\theta_r(t)-\rho_{r,n}\sigma_n\sigma_r-a_rr_t]dt + \sigma_rdW_{t}^r&#xA;$$&#xA;Interpret $dn_t$ as the diffusion for the nominal short rate and $dr_t$ as the diffusion for the short real rate. Now write the following expectation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\mathbb{E^Q}[I_{T}] = I_0\mathbb{E^Q}[e^{\int_0^Tn(s)-r(s)ds}]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can it be simplified further? I considered separating the terms and calculating the expectations separately and multiply but the fact is that both processes are correlated suggests to me that this can't be done. Anyone? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I interpret the difference between $n(s)$ and $r(s)$ in the integral as the spread between the nominal and real short rates. Note that the quantity $I_t$ represents the inflation at time $t$. This makes sense intuitively: the expected inflation at a future time depends on the expected spread at the same future time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just want to know if I can drill further into the algebra and obtain something simpler/more elegant. Or perhaps someone knows of a discussion I could consult?&lt;/p&gt;&#xA;" OwnerUserId="20548" LastEditorUserId="70" LastEditDate="2016-12-15T10:10:35.637" LastActivityDate="2016-12-15T10:10:35.637" Title="Expectation of two correlated processes?" Tags="&lt;stochastic-processes&gt;&lt;reference-request&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31447" PostTypeId="2" ParentId="31444" CreationDate="2016-12-12T16:02:05.623" Score="1" Body="&lt;p&gt;While the behavior is generally exchange-dependent, in the first case, the orders are likely to get crossed at $1.50, and in the second, both return unfilled.&lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2016-12-12T16:02:05.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31448" PostTypeId="2" ParentId="31444" CreationDate="2016-12-12T16:04:20.050" Score="3" Body="&lt;p&gt;In the first case it is a &quot;race condition&quot;: whichever order is received first (even if it is only one microsecond before the other) will populate the Book and the second limit order will execute against it, at the price of the first order.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the second case it is indeterminate and may depend on the details of how the &quot;matching engine&quot; works. Probably when the first market order is received against an empty Book, it will be rejected and so will the second since the Book is still empty.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both of these are &quot;edge conditions&quot; or peculiar cases where the result may be highly implementation dependent.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2016-12-12T16:04:20.050" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31449" PostTypeId="2" ParentId="31441" CreationDate="2016-12-12T18:40:45.280" Score="2" Body="&lt;p&gt;For Question 1, let $\phi$ be a replicating strategy, that is, $V_T(\phi) = X$. Then for any two martingale measures $u$ and $v$, from the &lt;em&gt;First Fundamental Theorem of Asset Pricing&lt;/em&gt;,&#xA;\begin{align*}&#xA;E_u\left(X\frac{S_t^0}{S_T^0}\mid \mathcal{F}_t\right) = V_t(\phi),&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;E_v\left(X\frac{S_t^0}{S_T^0}\mid \mathcal{F}_t\right) = V_t(\phi).&#xA;\end{align*}&#xA;That is, all martingale measures price the attainable claim equally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Question 2, let $\mu$ be the martingale measure. Moreover, let $\phi$ and $\psi$ be two replicating strategies, that is, $V_T(\phi)= V_T(\psi)=X$. Then, for any time $t$,&#xA;\begin{align*}&#xA;V_t(\phi) &amp;amp;= E_{\mu}\left(V_T(\phi)\frac{S_t^0}{S_T^0}\mid \mathcal{F}_t\right)\\&#xA;&amp;amp;= E_{\mu}\left(X\frac{S_t^0}{S_T^0}\mid \mathcal{F}_t\right)\\&#xA;&amp;amp;= E_{\mu}\left(V_T(\psi)\frac{S_t^0}{S_T^0}\mid \mathcal{F}_t\right)\\&#xA;&amp;amp;= V_t(\psi).&#xA;\end{align*}&#xA;That is, all replicating strategies for a given claim have the same value at all times.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-12-12T18:40:45.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31450" PostTypeId="2" ParentId="31354" CreationDate="2016-12-12T19:09:23.270" Score="1" Body="&lt;p&gt;I believe you have every right to &quot;calculate&quot; the FF factor returns, but you might just use the factors returns on their &lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;website&lt;/a&gt;. As you mentioned, you can regress on these factors and $R^2$ should tell you how much of the variance in your return series can be explained by FF factors. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not quite sure what goal you are trying to achieve, but one use case would be something like &quot;alpha research&quot;. If these factors are represented by available products in the market, you might just subtract their contributions from your returns series and focus on the residuals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, running regression on the 6 portfolios (returns also available on their website among others) shows how much of your return variance can be explained by the 6-portfolio returns. The only usefulness of this kind of analysis IMHO is to see what existing portfolio does your return series mostly look like.&lt;/p&gt;&#xA;" OwnerUserId="17835" LastActivityDate="2016-12-12T19:09:23.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31451" PostTypeId="2" ParentId="31445" CreationDate="2016-12-12T20:12:07.343" Score="6" Body="&lt;p&gt;Note that, as in &lt;a href=&quot;https://quant.stackexchange.com/questions/21513/extended-hull-white-interest-rate-model-for-zero-coupon-bond/21516#21516.&quot;&gt;this question&lt;/a&gt;, for $s\ge t\ge 0$,&#xA;\begin{align*}&#xA;n_s = e^{-a_n(s-t)}n_t + \int_t^s  \theta_n(u)e^{-a_n(s-u)} du + \int_t^s \sigma_n e^{-a_n(s-u)} dW^n_u,&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;r_s = e^{-a_r(s-t)}r_t + \int_t^s  (\theta_r(u) -\rho_{r,n}\sigma_n\sigma_r) e^{-a_r(s-u)} du + \int_t^s \sigma_r e^{-a_r(s-u)} dW^r_u.&#xA;\end{align*}&#xA;Moreover, &#xA;\begin{align*}&#xA;\int_t^T n_s ds &#xA;= \frac{1}{a_n}\Big(1-e^{-a_n(T-t)} \Big) n_t &amp;amp;+ \int_t^T\!\! \frac{\theta_n(u)}{a_n}\Big(1-e^{-a_n(T-u)} \Big)du \\&#xA;&amp;amp;+ \int_t^T \!\!\frac{\sigma_n}{a_n}\Big(1-e^{-a_n(T-u)} \Big)dW_u^n,&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;\int_t^T r_s ds=&#xA; \frac{1}{a_r}\Big(1-e^{-a_r(T-t)} \Big) n_t &amp;amp;+ \int_t^T\!\! \frac{\theta_r(u)-\rho_{r,n}\sigma_n\sigma_r}{a_r}\Big(1-e^{-a_r(T-u)} \Big)du \\&#xA;&amp;amp;+ \int_t^T \!\!\frac{\sigma_r}{a_r}\Big(1-e^{-a_r(T-u)} \Big)dW_u^r.&#xA;\end{align*}&#xA;Let $B_n(t, T) = \frac{1}{a_n}\Big(1-e^{-a_n(T-u)} \Big)$, and $B_r(t, T) = \frac{1}{a_r}\Big(1-e^{-a_r(T-u)} \Big)$.&#xA;Then, &#xA;\begin{align*}&#xA;\int_t^T n_s ds &amp;amp;= B_n(t, T) n_t + \int_t^T  \theta_n(u) B_n(u, T) du + \int_t^T \sigma_n B_n(u, T) dW_u^n,&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;\int_t^T r_s ds &amp;amp;= B_r(t, T) r_t + \int_t^T (\theta_r(u)-\rho_{r,n}\sigma_n\sigma_r) B_r(u, T) du + \int_t^T \sigma_r B_r(u, T) dW_u^r.&#xA;\end{align*}&#xA;Moreover,&#xA;\begin{align*}&#xA;E\left(e^{\int_t^T (n_s-r_s) ds} \mid \mathcal{F}_t \right) &amp;amp;=&#xA;e^{B_n(t, T) n_t-B_r(t, T) r_t+\int_t^T  \theta_n(u) B_n(u, T) du -\int_t^T (\theta_r(u)-\rho_{r,n}\sigma_n\sigma_r) B_r(u, T) du}\\&#xA;&amp;amp;\quad \times e^{\frac{1}{2}\int_t^T \sigma_n^2 B_n(u, T)^2 du+\frac{1}{2}\int_t^T \sigma_r^2 B_r(u, T)^2 du - \int_t^T \rho_{r,n}\sigma_n\sigma_r B_n(u, T)B_r(u, T)du}.&#xA;\end{align*}&#xA;Moreover, &#xA;\begin{align*}&#xA;\int_t^T \sigma_n^2 B_n(u, T)^2 du &amp;amp;= -\frac{\sigma_n^2}{a_n^2}\big(B_n(t, T) -T+t\big)-\frac{\sigma_n^2}{2a_n}B_n(t, T)^2,\\&#xA;\int_t^T \sigma_r^2 B_r(u, T)^2 du &amp;amp;= -\frac{\sigma_r^2}{a_r^2}\big(B_r(t, T) -T+t\big)-\frac{\sigma_r^2}{2a_r}B_r(t, T)^2&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;\int_t^T B_n(u, T)B_r(u, T)du = \frac{1}{a_na_r}\left[T-t - B_n(t, T)-B_r(T, t)+\frac{1}{a_n+a_r}\left(1-e^{-(a_n+a_r)(T-t)}\right) \right].&#xA;\end{align*}&#xA;Therefore,&#xA;\begin{align*}&#xA;E\left(e^{\int_t^T (n_s-r_s) ds} \mid \mathcal{F}_t \right)&#xA;&amp;amp;= A_n(t, T) A_r(t, T) C(t, T) e^{B_n(t, T) n_t-B_r(t, T) r_t},&#xA;\end{align*}&#xA;where &#xA;\begin{align*}&#xA;A_n(t, T) &amp;amp;= e^{\int_t^T  \theta_n(u) B_n(u, T) du -\frac{\sigma_n^2}{2a_n^2}\big(B_n(t, T) -T+t\big)-\frac{\sigma_n^2}{4a_n}B_n(t, T)^2}, \\&#xA;A_r(t, T) &amp;amp;= e^{-\int_t^T  (\theta_r(u)-\rho_{r,n}\sigma_n\sigma_r) B_r(u, T) du -\frac{\sigma_r^2}{2a_r^2}\big(B_r(t, T) -T+t\big)-\frac{\sigma_r^2}{4a_r}B_r(t, T)^2},&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;C(t, T) = e^{\frac{-\rho_{r,n}\sigma_n\sigma_r}{a_na_r}\left[T-t - B_n(t, T)-B_r(T, t)+\frac{1}{a_n+a_r}\left(1-e^{-(a_n+a_r)(T-t)}\right) \right]}&#xA;\end{align*}&#xA;Note that this is similar to the Hull-White zero-coupon bond pricing formula.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-12-12T21:15:16.303" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31453" PostTypeId="1" AcceptedAnswerId="31463" CreationDate="2016-12-12T22:09:11.450" Score="0" ViewCount="59" Body="&lt;p&gt;&lt;strong&gt;Background Information:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question is from Lectures on Financial Mathematics: Discrete Asset Pricing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Prove that for discrete models, the existence of a strong arbitrage is also equivalent to the existence of a self-financing strategy such that $V_0(\phi) &amp;lt; 0$ and $V_T(\phi) \geq 0$.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Attempted proof - Suppose $\psi$ is a self-financing strategy such that $$V_0(\psi) = 0 \ \ \text{and} \ \ V_T(\psi) &amp;gt; 0$$&#xA;Now suppose we also have a self-financing strategy $\phi$ such that $$V_0(\phi) &amp;gt; 0 \ \ \text{and} \ \ V_T(\psi) \geq V_T(\phi)$$&#xA;Now let $\Omega = \psi - \phi$, which is also a self-financing strategy since the difference of two self-financing strategies is a self-financing strategy. Then $$V_0(\Omega) = V_0(\psi - \phi) = V_0(\psi) - V_0(\phi) = 0-V_0(\phi) &amp;lt; 0$$&#xA;and&#xA;$$V_T(\Omega) = V_T(\psi - \phi) = V_T(\psi) - V_T(\phi) \geq 0 $$&#xA;Thus we have a self-financing strategy such that $$V_0(\Omega) &amp;lt; 0 \ \ \text{and} \ \ V_T(\Omega) \geq 0$$&#xA;A similar arguments holds for the converse.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure if this is completely right, any suggestions are greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="19002" LastActivityDate="2016-12-13T21:33:55.260" Title="For discrete models, the existence of strong arbitrage is equivalent to a particular self-financing strategy" Tags="&lt;arbitrage&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;&lt;financial-engineering&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31454" PostTypeId="1" CreationDate="2016-12-12T22:42:38.703" Score="-2" ViewCount="77" Body="&lt;p&gt;I am currently in the process of deciphering the notes written by an instructor. I missed the class.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;He writes:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Continuous time trading: $S(T) = W(T)$, &quot;Bachelier Model&quot;. $\phi(t)$&#xA;  denotes number of shares held at time t. Approximation is&#xA;  $\phi^{(n)}(t) = \phi(t_i), t_i &amp;lt; t &amp;lt; t_{i+1}, t_i = \frac{i}{n}T$.&#xA;  Gain from strategy $\phi^{(n)}$ is $\sum_{i=1}^n \phi(t_{i-1})[W_{t_i}&#xA;&amp;gt; - W_{t_i -1}] = \int_0^T \phi^{(n)}(s) dW(s).$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I don't understand what $n$ or $\phi^{(n)}$ is. Is it a derivative?&lt;/p&gt;&#xA;" OwnerUserId="25704" LastEditorUserId="467" LastEditDate="2016-12-13T02:18:23.633" LastActivityDate="2016-12-13T09:07:17.743" Title="What does $\phi^{(n)}(t)$ mean for a portfolio?" Tags="&lt;portfolio&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31455" PostTypeId="2" ParentId="31454" CreationDate="2016-12-13T00:27:34.367" Score="1" Body="&lt;p&gt;n is the number of time steps used in the discrete time solution $\phi^{(n)}$ to approximate the continuous time solution $\phi$ (the time period $T$ is being broken up into n steps). The higher the n the better the approximation. In the expression $\phi^{(n)}$ n is a super-script, not an exponent nor a derivative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a feeling that later on you are going to be told that $n \rightarrow \infty $ ...&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2016-12-13T00:33:18.767" LastActivityDate="2016-12-13T00:33:18.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31456" PostTypeId="2" ParentId="31354" CreationDate="2016-12-13T06:30:52.543" Score="6" Body="&lt;p&gt;The clearest hands-on explanation I have seen so far is the following: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.efficientfrontier.com/ef/101/roll101.htm&quot; rel=&quot;noreferrer&quot;&gt;Bernstein, W.: Rolling Your Own: Three-Factor Analysis&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Everything is explained very clearly and step-by-step with Excel.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Concerning your question: The R-squared tells you how much percent are explained by the factors. The intercept is your alpha, the coefficients of the factors tell you in which direction the portfolio is tilted (e.g. HML for a value fund) and the t- and p-values tell you whether the factors are &lt;a href=&quot;https://en.wikipedia.org/wiki/Statistical_significance&quot; rel=&quot;noreferrer&quot;&gt;statistically significant&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As @WillGu correctly mentions you should use the data from the &lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html&quot; rel=&quot;noreferrer&quot;&gt;FF website&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps to get you started.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2016-12-13T06:37:32.863" LastActivityDate="2016-12-13T06:37:32.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31462" PostTypeId="1" CreationDate="2016-12-13T15:47:46.770" Score="1" ViewCount="1582" Body="&lt;p&gt;My employer has asked me to implement a gold price list for our website.&#xA;I found Yahoo Finance to be a good option coding-wise, my only problem is that the value I'm getting is different from other websites that offer the info.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using the following to get the value:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20(%22XAUUSD%22)&amp;amp;env=store://datatables.org/alltableswithkeys&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://query.yahooapis.com&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The rate I'm getting at the moment is: &lt;code&gt;&amp;lt;Rate&amp;gt;1323.0000&amp;lt;/Rate&amp;gt;&lt;/code&gt;&#xA;Compared to the rate at &lt;a href=&quot;https://www.bloomberg.com/quote/XAUUSD:CUR&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bloomberg&lt;/a&gt; which is &lt;code&gt;1,157.29USD&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is there a difference and which one should I use?&lt;/p&gt;&#xA;" OwnerUserId="25720" LastEditorDisplayName="user16651" LastEditDate="2016-12-13T17:31:48.247" LastActivityDate="2017-01-14T17:05:24.037" Title="XAU/USD rate in Yahoo Finance API" Tags="&lt;programming&gt;&lt;trading&gt;&lt;yahoofinance&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31463" PostTypeId="2" ParentId="31453" CreationDate="2016-12-13T15:48:21.767" Score="1" Body="&lt;p&gt;We first assume the strong arbitrage, that is, there is a self-financing strategy $\phi$ such that $V_0(\phi)=0$ and $V_T(\phi)&amp;gt;0$. Then, on the finite sample space, there exists $\alpha &amp;gt;0$ such that &#xA;\begin{align*}&#xA;S_0^0\frac{V_T(\phi)}{S_T^0}\ge \alpha,&#xA;\end{align*}&#xA;where $S^0$ is the risk-free asset among the $k+1$ assets $S^0, S^1, \ldots, S^k$, which is the deposit or money-market account. We buy $-\alpha/S_0^0$ share of the risk-free asset $S_0$, and hold until maturity $T$, that is, we consider the trading strategy $\psi$, where &#xA;\begin{align*}&#xA;\psi_i = &#xA;\begin{cases}&#xA;-\alpha/S_0^0, &amp;amp; \text{ if } i=0,\\&#xA;0, &amp;amp; \text{ otherwise},&#xA;\end{cases}&#xA;\end{align*}&#xA;without any intermediate adjustment. It is then clear that $V_0(\psi+\phi)=-\alpha &amp;lt;0$, and &#xA;\begin{align*}&#xA;V_T(\psi+\phi) &amp;amp;= V_T(\psi) + V_T(\phi)\\&#xA;&amp;amp;=-\alpha\frac{S_T^0}{S_0^0} + V_T(\phi)\\&#xA;&amp;amp;=\frac{S_T^0}{S_0^0}\left(S_0^0\frac{V_T(\phi)}{S_T^0} - \alpha \right) \ge 0&#xA;\end{align*}&#xA;$$$$&#xA;For the other way around, where $V_0(\phi)&amp;lt;0$ and $V_T(\phi)\ge 0$, we can simply set $\alpha = -V_0(\phi)$ in the above strategy $\psi$. Then  $V_0(\psi+\phi)=0$, and $V_T(\psi+\phi)&amp;gt; 0$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-12-13T21:33:55.260" LastActivityDate="2016-12-13T21:33:55.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31464" PostTypeId="2" ParentId="25579" CreationDate="2016-12-13T15:57:35.047" Score="1" Body="&lt;p&gt;=BDP(&quot;AAPL US Equity&quot;,&quot;IS_EPS&quot;, &quot;FUNDAMENTAL_DATABASE_DATE=20141231&quot;) returns 6.49 which is what their fundamental database had available on 31st Dec 2014 and was their full year EPS for Fiscal Year ending 27 Sept 2014.&#xA;If you use =BDP(&quot;IBM US Equity&quot;,&quot;IS_EPS&quot;, &quot;FUNDAMENTAL_DATABASE_DATE=20141231&quot;) for IBM whose year end is in December then this displays 15.06 which was their 2013 year end as the 2014 EPS number of 11.97 wasn't yet available.&#xA;Changing the formula to&#xA;=BDP(&quot;IBM US Equity&quot;,&quot;IS_EPS&quot;, &quot;FUNDAMENTAL_DATABASE_DATE=20150228&quot;) then reflects the 2014 EPS a by this time it had been published.&lt;/p&gt;&#xA;" OwnerUserId="24095" LastActivityDate="2016-12-13T15:57:35.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31467" PostTypeId="1" CreationDate="2016-12-13T12:52:03.213" Score="2" ViewCount="740" Body="&lt;p&gt;We have a dataset which has open,high,low and close values.&#xA;We have normalized the data and trying to plot normalized open values against Date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The dataset can be found at &lt;a href=&quot;http://finance.yahoo.com/quote/ORCL/history?period1=1323475200&amp;amp;period2=1481328000&amp;amp;interval=1d&amp;amp;filter=history&amp;amp;frequency=1d&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://finance.yahoo.com/quote/ORCL/history?period1=1323475200&amp;amp;period2=1481328000&amp;amp;interval=1d&amp;amp;filter=history&amp;amp;frequency=1d&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We tried to replicate the graphs from &lt;a href=&quot;https://stats.stackexchange.com/questions/39279/how-to-plot-20-years-of-daily-data-in-time-series&quot;&gt;https://stats.stackexchange.com/questions/39279/how-to-plot-20-years-of-daily-data-in-time-series&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The output is not as expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Code: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;oracle$date &amp;lt;- as.Date(oracle$Date,&quot;%y-%m-%d&quot;)&#xA;print(oracle$date)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Issue 1: It prints dates up to 2027 even when have values from 2011-2016.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;oracle$week &amp;lt;-(as.integer(oracle$date) + 3) %/% 7&#xA;print (oracle$week)&#xA;oracle$week &amp;lt;- as.Date(oracle$week * 7 - 3, as.Date(&quot;2011-12-12&quot;, &quot;%Y-%m-%d&quot;))&#xA;print(oracle$week)&#xA;par(mfrow=c(1,2))&#xA;plot(as.factor(unclass(oracle$Date[1:1259])), oracle$NO[1:1259], type=&quot;l&quot;,&#xA;     main=&quot;Original Plot: Inset&quot;, xlab=&quot;Factor code&quot;)&#xA;plot(oracle$Date[1:1259], oracle$NO[1:1259], type=&quot;n&quot;, ylab=&quot;Price&quot;, &#xA;     main=&quot;Oracle Opening Prices&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Graphs are not displayed as shown in answer (8) of &lt;a href=&quot;https://stats.stackexchange.com/questions/39279/how-to-plot-20-years-of-daily-data-in-time-series&quot;&gt;https://stats.stackexchange.com/questions/39279/how-to-plot-20-years-of-daily-data-in-time-series&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is as displayed below:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/KU6gw.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/KU6gw.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;tmp &amp;lt;- by(oracle[1:1259,], oracle$week[1:1259], function(x) lines(x$Date, x$NO, lwd=2))&#xA;print(tmp)&#xA;par(mfrow=c(1,1))&#xA;colors &amp;lt;- terrain.colors(52)&#xA;plot(oracle$Date, oracle$NO, type=&quot;n&quot;, main=&quot;Oracle Opening Prices&quot;)&#xA;tmp &amp;lt;- by(oracle, oracle$week, &#xA;function(x) lines(x$date, x$Open, col=colors[x$week %% 52 + 1]))&#xA;print(tmp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerDisplayName="ashti" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2016-12-13T17:52:20.120" Title="How to plot time series for stock data using R" Tags="&lt;programming&gt;&lt;time-series&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31468" PostTypeId="2" ParentId="31467" CreationDate="2016-12-13T13:39:00.920" Score="2" Body="&lt;p&gt;This is commonly done in R using the Quantmod package and getSymbols wrapper. A good built-in chart setup is from the PerformanceAnalytics package.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;require(quantmod)&#xA;require(PerformanceAnalytics)&#xA;getSymbols(&quot;ORCL&quot;, from = &quot;1996-01-01&quot;)&#xA;chart.TimeSeries(ORCL[,1], main = &quot;Oracle Opening Prices&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, since I am not entirely sure what answer (8) mean (the one with 8 upvotes?), I cannot determine exactly what plot you want. &lt;/p&gt;&#xA;" OwnerUserId="13808" OwnerDisplayName="Forgottenscience" LastActivityDate="2016-12-13T13:39:00.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31469" PostTypeId="2" ParentId="31439" CreationDate="2016-12-13T19:43:43.943" Score="3" Body="&lt;p&gt;&lt;strong&gt;Conditional&lt;/strong&gt; volatility is the volatility of a random variable given (i.e. conditioning on) some extra information. E.g. in the GARCH model the conditional volatility is conditioned on past values of itself and of model errors (see below). &lt;strong&gt;Unconditional&lt;/strong&gt; volatility is the &quot;general&quot; volatility of a random variable when there is no extra information (no conditioning).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Realized&lt;/strong&gt; volatility is the empirical unconditional variance over a given time period. E.g. if 5-minute returns on a stock price are collected over a trading day, their empirical variance can be called realized volatility (&quot;realized&quot; in the sense that it has already been measured). Recall that variance is a property of the data generating process that is unobservable and can only be measure with imperfect precision from the data.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Does that mean that e.g. a Garch model can be used to model volatility or do I use Garch to model conditional volatility?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The GARCH($s,r$) model looks like this:&#xA;$$&#xA;\begin{aligned}&#xA;r_t &amp;amp;= \mu_t + u_t, \\&#xA;u_t &amp;amp;= \sigma_t \varepsilon_t, \\&#xA;\sigma_t^2 &amp;amp;= \omega + \sum_{i=1}^s\alpha_i u_{t-i}^2 + \sum_{j=1}^r\beta_j \sigma_{t-j}^2, \\&#xA;\varepsilon_t &amp;amp;\sim i.i.d.(0,1).&#xA;\end{aligned}&#xA;$$&#xA;It specifies the &lt;strong&gt;conditional&lt;/strong&gt; distribution of a random variable $r_t$ conditional on past values of the model errors $u_t$, conditional variances $\sigma^2_{t-j}$ and whatever other variables that determine the conditional mean $\mu_t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;strong&gt;unconditional&lt;/strong&gt; variance $\sigma_t$ of the error term $u_t$ is given by $\frac{\omega}{1-\sum_{i=1}^s\alpha_i u_{t-i}^2 + \sum_{j=1}^r\beta_j \sigma_{t-j}^2}$, while the unconditional variance of $r_t$ is generally more messy as it also involves $\mu_t$ which may be arbitrarily complicated. (However, the conditional mean is often taken to be as simple as $\mu_t=0$ in which case the conditional and unconditional variances of $r_t$ equal those of $u_t$.)&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I have read some papers which use particular models to model conditional vola and sometimes call it conditional vola and sometimes just vola.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I think &quot;conditional&quot; is sometimes omitted for brevity if it is supposed to be clear from the context. Otherwise it is mentioned explicitly to avoid ambiguity.&lt;/p&gt;&#xA;" OwnerUserId="19645" LastActivityDate="2016-12-13T19:43:43.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31470" PostTypeId="1" CreationDate="2016-12-13T21:25:49.193" Score="4" ViewCount="9801" Body="&lt;p&gt;I'm looking to find the correct way to calculate the ex ante tracking error of a portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If say I have 10 funds, and their historical returns series (used to calculate mean return, standard deviation and correlations/ covariances or anything else needed) how would I calculate the ex ante tracking error for a portfolio made up of the 10 funds, with weights fixed?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="25726" LastActivityDate="2020-10-28T02:06:03.437" Title="How to calculate ex Ante Tracking Error" Tags="&lt;correlation-matrix&gt;&lt;tracking-error&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31471" PostTypeId="2" ParentId="31470" CreationDate="2016-12-13T23:14:25.897" Score="1" Body="&lt;p&gt;Here are the steps:- &#xA;1.First you need to calculate the historical return series for your portfolio from the historical return series for each fund by adding the returns for each fund on a daily basis taking weights into consideration.&#xA;2. Calculate the historical return series for your benchmark.&#xA;3. Calculate the difference between the returns of your portfolio and the benchmark for each day.&#xA;4. Once you get the return series for the difference between the two, calculate the standard deviation of this series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this helps.&lt;a href=&quot;https://i.stack.imgur.com/q3pL5.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/q3pL5.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18663" LastEditorUserId="18663" LastEditDate="2016-12-14T19:15:45.240" LastActivityDate="2016-12-14T19:15:45.240" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31472" PostTypeId="1" AcceptedAnswerId="32101" CreationDate="2016-12-13T23:20:38.303" Score="-1" ViewCount="611" Body="&lt;p&gt;I am willing to do my Master Thesis about option pricing.&#xA;Do you have any suggestions? I would like it to be something simple, like comparing methods, e.g. compare ARCH and GARCH approaches for volatility estimates and their impact options pricing . Or this could be some empiriacl study using data from the Market. Any suggestions of something simple?&#xA;Please try to detail a little bit because I am a beginner in the subject - I've fully read Hull and I'm starting to read Schreve.&#xA;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="25437" LastActivityDate="2017-01-25T19:56:15.523" Title="Suggestions for a Master thesis in option pricing models" Tags="&lt;options&gt;&lt;volatility&gt;&lt;garch&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31473" PostTypeId="1" CreationDate="2016-12-14T02:02:38.250" Score="2" ViewCount="141" Body="&lt;p&gt;&lt;s&gt;Basically a negative forward vol in the ATM vol term structure.&lt;/s&gt; For index options, it's probably rare. But for single name options, I've seen a bunch of examples on Bloomberg. Does this relationship admit some weak form of arbitrage?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: I think I have falsely claimed about the forward vol in this situation. Some people might call it &quot;nagative forward vol&quot;, but now I don't think it makes much sense (might just be an analogy to interest rate). And as commented in one of the answers, the implied forward vol should be calculated as suggested on &lt;a href=&quot;https://en.wikipedia.org/wiki/Forward_volatility&quot; rel=&quot;nofollow noreferrer&quot;&gt;Wikipedia&lt;/a&gt;, assuming that the two periods are independent of each other. Otherwise, some correlation coefficient is needed in the calculation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I read a bit more on this topic, this kind of phenomenon doesn't admit any arbitrage, but another situation would. If we factor in the time component and calculate the implied variance as $\sigma^2T$, then a &quot;negative forward variance&quot; would admit arbitrage under Black-Scholes dynamics.&lt;/p&gt;&#xA;" OwnerUserId="17835" LastEditorUserId="17835" LastEditDate="2016-12-14T08:54:25.303" LastActivityDate="2016-12-14T08:54:25.303" Title="For equity options, why sometimes ATM vol of shorter expiration is higher than that of longer expiration?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;arbitrage&gt;" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31475" PostTypeId="2" ParentId="31473" CreationDate="2016-12-14T03:34:28.800" Score="1" Body="&lt;p&gt;It doesn't have to imply negative forward vol.  for example , 1month 20 Vol and 2 month 19 vol implies (approximately ) that 1 month vol in 1 month time will be 18.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-12-14T03:34:28.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31476" PostTypeId="2" ParentId="31287" CreationDate="2016-12-14T05:57:40.043" Score="1" Body="&lt;p&gt;One other thing to consider is the size of the trade with respect to the volume on a given day. If your simulated trade is larger than the actual volume on that day, then your strategy is unrealistic. You should try running a backtest where you can trade a maximum of 5% of the daily volume, for example. Obviously when trading large ETFs you won't have this problem, but small-cap strategies will often run into this issue. I wrote a blog about trading costs, although it doesn't address the volume side of it. &lt;a href=&quot;https://rquantceptivity.wordpress.com/2016/12/05/first-blog-post/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://rquantceptivity.wordpress.com/2016/12/05/first-blog-post/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="25730" LastActivityDate="2016-12-14T05:57:40.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31477" PostTypeId="2" ParentId="31473" CreationDate="2016-12-14T07:19:04.547" Score="0" Body="&lt;p&gt;A large part of single stock volatility comes just after and around quarterly earnings  announcements. An option with short expiry over one announcement thus may price at higher annualized vol than a longer expiry that also encompasses precisely one announcement.&lt;/p&gt;&#xA;" OwnerUserId="23886" LastActivityDate="2016-12-14T07:19:04.547" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31479" PostTypeId="1" AcceptedAnswerId="31481" CreationDate="2016-12-14T08:46:08.577" Score="0" ViewCount="2164" Body="&lt;p&gt;From volatility surfaces we have a implied distribution of $S_T$. This distribution is the &lt;strong&gt;real world&lt;/strong&gt; distribution or this is a &lt;strong&gt;risk neutral&lt;/strong&gt; distribution?&lt;/p&gt;&#xA;" OwnerUserId="25437" LastActivityDate="2016-12-14T10:23:30.520" Title="What the implied distribution really is?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;implied-volatility&gt;&lt;risk-neutral-measure&gt;&lt;distribution&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31480" PostTypeId="2" ParentId="31479" CreationDate="2016-12-14T09:06:01.040" Score="-1" Body="&lt;p&gt;I'm not a probabilist but I tend to think real-world distribution in financial world doesn't exist (or at least is not a proper term). None of the financial events are really repeatable or IID.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And to your question, it should be risk-neutral density function.&lt;/p&gt;&#xA;" OwnerUserId="17835" LastActivityDate="2016-12-14T09:06:01.040" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="31481" PostTypeId="2" ParentId="31479" CreationDate="2016-12-14T09:07:07.060" Score="4" Body="&lt;p&gt;In this related question &lt;a href=&quot;https://quant.stackexchange.com/questions/1621/how-to-derive-the-implied-probability-distribution-from-b-s-volatilities?rq=1&quot;&gt;How to derive the implied probability distribution from B-S volatilities?&lt;/a&gt;, it is  shown how to infer the implied probability density of the future prices of a risky asset from a continuum of call prices written on that asset (Breeden-Litzenberger identity).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The developments, which I invite you to read, basically rely on the fact that the call price writes&#xA;$$ C=e^{-rT} \int_0^\infty (S-K)^+ p(S) dS $$&#xA;or equivalently&#xA;$$ C = e^{-rT} \Bbb{E} \left[ (S_T-K)^+ \right] \tag{1} $$&#xA;under some measure where $S_T$ is a random variable with probability density function:&#xA;$$ d\Bbb{P}(S_T \leq S)/dS = p(S) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, the fundamental theorem of asset pricing tells us that equation $(1)$ holds under the so-called &lt;em&gt;risk-neutral measure&lt;/em&gt; (a measure &lt;em&gt;equivalent&lt;/em&gt; to the real-world measure but under which the $t$-value of any self-financing strategy is a &lt;em&gt;martingale&lt;/em&gt; when expressed with respect to the risk-free money market account numéraire). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consequently, the implied density $p(S)$ you compute by evaluating &#xA;$$ p(S) = e^{rT} \frac{\partial^2 C}{\partial K^2}(K=S) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is indeed a risk-neutral pdf (because it relies on the risk-neutral expression of the call price $(1)$.)&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-12-14T10:23:30.520" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31487" PostTypeId="2" ParentId="16471" CreationDate="2016-12-14T14:46:50.953" Score="2" Body="&lt;p&gt;As you state in your comment, you only have trouble with the second partial derivative w.r.t. the spot. So you understand how the first partial derivative is obtained&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\frac{\partial C}{\partial S} = e^{-x} \frac{\partial U}{\partial x}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you just carefully apply the chain rule again. In ALL details:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\frac{\partial^2 C}{\partial S^2} &amp;amp; = &amp;amp; \frac{\partial}{\partial S} \left\{ e^{-x} \frac{\partial U}{\partial x} \right\}\\&#xA;&amp;amp; = &amp;amp; \frac{\partial}{\partial x} \left\{ e^{-x} \right\} \frac{\partial U}{\partial S} + e^{-x} \frac{\partial}{\partial x} \left\{ \frac{\partial U}{\partial S} \right\}\\&#xA;&amp;amp; = &amp;amp; \frac{\partial}{\partial x} \left\{ e^{-x} \right\} \frac{\partial x}{\partial S} \frac{\partial U}{\partial x} + e^{-x} \frac{\partial^2 U}{\partial x^2} \frac{\partial x}{\partial S}\\&#xA;&amp;amp; = &amp;amp; e^{-x} \frac{\partial x}{\partial S} \left( \frac{\partial^2 U}{\partial x^2} - \frac{\partial U}{\partial x} \right)\\&#xA;&amp;amp; = &amp;amp; e^{-x} \frac{1}{S} \left( \frac{\partial^2 U}{\partial x^2} - \frac{\partial U}{\partial x} \right)\\&#xA;&amp;amp; = &amp;amp; e^{-2 x} \frac{1}{K} \left( \frac{\partial^2 U}{\partial x^2} - \frac{\partial U}{\partial x} \right)&#xA;\end{eqnarray}&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2016-12-14T14:46:50.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31488" PostTypeId="1" CreationDate="2016-12-14T15:20:25.857" Score="0" ViewCount="499" Body="&lt;p&gt;I want to calculate default of probability of internal ratings for a particular bank. I have only the following data:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Liquidity Ratio&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;short-term assets / short-term liabilities = 2.6&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Profitability Ratios &#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;ROA&lt;/strong&gt; - yearly net profit / average total assets = 26%&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Sales growth&lt;/strong&gt; - (current sales − previous sales) / previous sales = 31%&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Projected debt service capacity&lt;/strong&gt; - (Projected Operational Cash − Flow (stress tested for FX risk)) / Total payments toward the bank = 3&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Solvency Ratios&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Debt/EBITDA = 0.4&lt;/li&gt;&#xA;&lt;li&gt;Total equity / total assets = 71%&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Could you tell me can I calculate the probability default (PD) rate with this data?&#xA;How to proceed?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="25734" LastActivityDate="2017-11-09T22:14:34.170" Title="Probability default calculation" Tags="&lt;portfolio&gt;&lt;probability&gt;&lt;default&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31489" PostTypeId="1" CreationDate="2016-12-14T15:23:25.260" Score="5" ViewCount="328" Body="&lt;p&gt;I have built a model in R that predicts weekly and monthly returns of stock prices using regression trees, roughly based on &lt;a href=&quot;https://www.r-bloggers.com/using-cart-for-stock-market-forecasting/&quot; rel=&quot;noreferrer&quot;&gt;https://www.r-bloggers.com/using-cart-for-stock-market-forecasting/&lt;/a&gt;. In my training and test sets weekly and monthly return rates (the target variables) are calculated for Fridays as follows:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Weekly: (Friday close - Monday open) / Monday open&lt;/li&gt;&#xA;&lt;li&gt;Monthly: (Last Friday of the month close - first Monday of the month &#xA;open) / first Monday of the month open&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Weekly returns are available for each Friday of the week and monthly returns are available for each last Friday of the month.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the predictive model, I can then predict weekly and monthly returns using the data available today. E.g. if today's data is xyz then the model predicts a weekly return of 0.1 and a monthly return of -0.02.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;df_test$pred_weekly_return &amp;lt;- predict(tree_weekly,df_test)&#xA;df_test$pred_monthly_return &amp;lt;- predict(tree_monthly,df_test)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am struggling with how to interpret these predicted weekly and monthly returns. If I use today's Wednesday 14 December data, is the predicted weekly return then for next week Wednesday 21 December or for this week Friday 16 December? And is the predicted monthly return then for the end of this month 31 December or, say, 31 days from now 13 January?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any advice would be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="25735" LastActivityDate="2018-03-10T02:14:43.970" Title="Interpret predictions weekly and monthly stock price returns" Tags="&lt;equities&gt;&lt;returns&gt;&lt;prediction&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ClosedDate="2018-03-10T10:15:35.597" ContentLicense="CC BY-SA 3.0" />
  <row Id="31490" PostTypeId="2" ParentId="31488" CreationDate="2016-12-14T15:55:41.843" Score="1" Body="&lt;p&gt;No, you cannot.  If you had a pre-existing model that had been validated and used these variables, then yes you could, but you cannot calculate a probability from one data point and no other source of information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Subjectively, the short run probability is small as there is massive coverage of short term debt.  Unless there is a hidden liability, it is nearly zero.  If the firm were sued tomorrow, lost in court and the judgment was devastating then it could become insolvent, but it is nearly zero.  The exact value cannot be calculated without other information.  Even for questions such as &quot;will the sun rise tomorrow,&quot; there is a small, if trivial possibility some catastrophic and unknown event could happen.  It is just so close to zero that we ignore it.  This is the same for the above.  It is nearly zero, in the very short term.  We do not know if management will change its policies because it is doing so well.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2016-12-14T15:55:41.843" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="31491" PostTypeId="2" ParentId="31354" CreationDate="2016-12-14T16:06:47.080" Score="1" Body="&lt;p&gt;The Fama French SMB and HML portfolios represent the Size premium and the Value premium respectively observed in the equity markets. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Its not clear what your intention is but here's what I would suggest&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Take the return series of your portfolio, align it with the factor returns of the SMB and HML portfolios which you can download from Kenneth French's website as pointed by @WillGu &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Run a multiple regression of your portfolio returns vs HML and SMB with an intercept.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Observe the coefficients on SMB, HML and also the intercept as well as their t-stats (p-values)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Observe the R-squared &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Here is one interpretation&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;If you observe high R-squared and significant coefficients, this would mean a large percentage of your returns are explained by SMB and HML.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In addition, if you observe a significant and nonzero intercept - it would mean your portfolio returns are also being explained by factors outside of SMB and HML.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="25458" LastActivityDate="2016-12-14T16:06:47.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31492" PostTypeId="2" ParentId="31401" CreationDate="2016-12-14T16:18:00.490" Score="0" Body="&lt;p&gt;Indeed one is the special case of the other. In CAPM you are regressing stock (or portfolio) returns vs the Market (your index) . But your index could be any independent variable that you believe explains the left hand side (your returns) - it could be the returns of an industry, an ETF a different index - what not.&lt;/p&gt;&#xA;" OwnerUserId="25458" LastEditorUserId="25458" LastEditDate="2017-02-27T14:04:39.280" LastActivityDate="2017-02-27T14:04:39.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31493" PostTypeId="2" ParentId="31489" CreationDate="2016-12-14T16:33:18.660" Score="1" Body="&lt;p&gt;It depends on the structure of your model. Unless the variables of your regression tree are lagged, you are going to be predicting the the weekly returns/monthly returns  at time t. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try an equation of the form (this would mean lagging all of your variables by 1 time period and training on the returns that way). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$y_t$= $B_{0_t}$ + $B_{1_{t-1}}$ $x_{1_{t-1}}$+ .... $B_{n_{t-1}}$ $x_{n_{t-1}}$ &lt;/p&gt;&#xA;" OwnerUserId="17175" LastActivityDate="2016-12-14T16:33:18.660" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31494" PostTypeId="2" ParentId="7800" CreationDate="2016-12-14T17:05:17.863" Score="3" Body="&lt;p&gt;To build an industry factor model, you would need to calculate exposures to industries. If you had GICS (or similar) data available you could use a bottom up approach and calculate those exposures. 1 if the stock belongs to that industry, 0 if not. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the absence of such data you would need to infer those values. Here is one that I'd suggest (assuming you are looking at the US equity market)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sector/Industry ETFs  (IShares, State Street) are good proxies for industries. Select a set of ETFs that are liquid and encompass the entire industry breadth of the US stock market. Conduct multiple regressions of stock returns on the selected ETF returns over a sufficiently long historical period. Use the obtained coefficients as industry exposures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other parts of a risk model that you'd need are the covariance matrix and residual volatility of the instruments. For the covariance matrix use the etf returns over the same or different historical period as the multiple regression above  and calculate their covariance. For the residual volatility - use the residuals of the multiple regression above and calculate their standard deviation. You may want to apply some exponential weighting in both the cases.&lt;/p&gt;&#xA;" OwnerUserId="25458" LastActivityDate="2016-12-14T17:05:17.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31495" PostTypeId="2" ParentId="31284" CreationDate="2016-12-14T17:19:18.393" Score="0" Body="&lt;p&gt;The answer to your question would depend on what is the intended use case for the number. If you follow convention and use it for similar use cases the second choice would be the right number to look at. &lt;a href=&quot;http://www.indexologyblog.com/2014/02/07/inside-the-sp-500-pe-and-earnings-per-share/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.indexologyblog.com/2014/02/07/inside-the-sp-500-pe-and-earnings-per-share/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="25458" LastActivityDate="2016-12-14T17:19:18.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31496" PostTypeId="2" ParentId="31470" CreationDate="2016-12-14T20:29:56.383" Score="4" Body="&lt;p&gt;For ex-ante tracking error, you need a forecast covariance matrix $C$. Then the quantity you require is $\sqrt{w^{T}Cw}$, where $w$ is a vector of excess weights relative to the benchmark. You can construct a forecast covariance matrix from realized covariances if you think historical relationships will persist, or you use other methods, for example factor models.&lt;/p&gt;&#xA;" OwnerUserId="20059" LastActivityDate="2016-12-14T20:29:56.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31497" PostTypeId="2" ParentId="2205" CreationDate="2016-12-14T20:42:08.143" Score="2" Body="&lt;p&gt;Unsystematic risk of a single stock can be calculated as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma_\lambda-\rho_{\lambda,m}\sigma_\lambda=\sigma_\lambda(1-\rho_{\lambda,m})$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\sigma_\lambda$ is the volatility of the stock $\lambda$ and $\rho_{\lambda,m}$ is the correlation between this stock and the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Written differently this is the same as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma_\lambda-\beta_\lambda\sigma_m$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which means that the unsystematic risk of a single stock is its volatility minus its beta scaled by the market volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sources:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://dx.doi.org/10.1080/00036846.2014.959652&quot; rel=&quot;nofollow noreferrer&quot;&gt;Cara M. Marshall (2015) Isolating the systematic and unsystematic&#xA;components of a single stock’s (or portfolio’s) standard deviation,&#xA;Applied Economics, 47:1, 1-11, DOI:&#xA;10.1080/00036846.2014.959652&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://dx.doi.org/10.1080/00036846.2015.1068925&quot; rel=&quot;nofollow noreferrer&quot;&gt;Fabio Pizzutilo (2015): Isolating the systematic and unsystematic&#xA;components of a single stock’s (or portfolio’s) standard&#xA;deviation: a comment, Applied    Economics, DOI:&#xA;10.1080/00036846.2015.1068925&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="12" LastActivityDate="2016-12-14T20:42:08.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31498" PostTypeId="1" AcceptedAnswerId="31508" CreationDate="2016-12-14T20:48:26.363" Score="4" ViewCount="338" Body="&lt;p&gt;I am going to join the equity execution arm of an investment bank soon. I have minimal exposure to algorithmic execution, and am looking to increase my knowledge on the topic. Can someone provide a curated list of references (papers, books, online resources) relevant to a person in my position? An ideal response would present resources covering the basic concepts of execution, any mathematics relevant to the field, and perhaps even recent and future developments.&lt;/p&gt;&#xA;" OwnerUserId="20059" LastActivityDate="2016-12-16T15:17:53.287" Title="Algorithmic Execution Literature/References" Tags="&lt;equities&gt;&lt;reference-request&gt;&lt;order-execution&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31499" PostTypeId="1" AcceptedAnswerId="31948" CreationDate="2016-12-14T21:16:44.093" Score="0" ViewCount="139" Body="&lt;p&gt;A European barrier call with barrier $B = 50$, expiration $T = 31$, and strike $K = 33$ costs $12$. The investor is interested in a product that, unlike this barrier call, offers some protection for the case that the stock goes above the barrier 50. The investor wants to buy an investment product called &lt;em&gt;Secured Barrier Call&lt;/em&gt; whose payoff structure is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Payoff}=&#xA;\begin{cases}&#xA;S(31)-33\quad, &amp;amp; \text{if} \hspace{2mm} S(31)\ge33 \hspace{2mm} \text{and} \hspace{2mm} S(t) &amp;lt; 50\quad,\hspace{5mm} \forall \,t\le 31 \\ &#xA;50\hspace{2.2cm}, &amp;amp; \text{if} \hspace{2mm} S(t)\ge50 \hspace{2mm}\text{for some}\,\,t\le31 \\ &#xA;0\hspace{2.45cm}, &amp;amp; \text{o.w}&#xA;\end{cases}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An American digital call with strike $33$ and expiration $31$ costs $0.73$, and the American digital call with strike $50$ and expiration $31$ costs $0.70$.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I need to compute the price of the &lt;em&gt;Secured Barrier Call&lt;/em&gt;. After&#xA;  computation, I got $46.94$.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That's what I've done: $C_0=12-2\times0.73+52\times0.70=46.94$. But I am not confident about what I've got. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you please confirm or help me with any hint if it's wrong? Thank you. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S.: I recently started working on quantitative finance, and it's a problem that I found in book for practicing.&lt;/p&gt;&#xA;" OwnerUserId="25265" LastEditorUserId="25265" LastEditDate="2016-12-15T15:21:22.603" LastActivityDate="2017-01-18T13:14:17.330" Title="Pricing Secured Barrier Call" Tags="&lt;option-pricing&gt;&lt;brownian-motion&gt;&lt;binary-options&gt;&lt;barrier&gt;&lt;continuous-time&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31500" PostTypeId="2" ParentId="31179" CreationDate="2016-12-14T23:25:38.467" Score="0" Body="&lt;p&gt;I believe to prove this rigorously we need to first note that we want to $$\min{h^T V h } \ \ \text{subject to} \ \ h^T f = f_P$$&#xA;Using Lagrange multiplier we have the problem &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{cases}&#xA;2Vh &amp;amp;= \lambda f\\&#xA;h^T f &amp;amp;= f_P&#xA;\end{cases}&#xA;Thus, $$h = \frac{\lambda}{2}V^{-1}f = c\times h_Q$$&#xA;where $c = \frac{\lambda}{2}$ so, every point on the capital market line corresponds to a unique portfolio. &lt;/p&gt;&#xA;" OwnerUserId="19002" LastActivityDate="2016-12-14T23:25:38.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31501" PostTypeId="1" CreationDate="2016-12-14T23:30:36.967" Score="3" ViewCount="194" Body="&lt;p&gt;Many of us are familiar with the connection between spurious correlation and its relationship to cointegration. Granger explains in his seminal 1974 paper  &lt;a href=&quot;http://wolfweb.unr.edu/homepage/zal/STAT758/Granger_Newbold_1974.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;Spurious Regressions in Econometrics&quot;&lt;/a&gt; how hypothesis testing on two time series that are I(1) can lead to significance tests that are very biased according to experimental results (resulting in far more &quot;significant&quot; correlations than there should be). Later,  &lt;a href=&quot;https://www.researchgate.net/profile/Peter_Phillips2/publication/222451715_Understanding_Spurious_Regression_in_Econometrics/links/00463531fe0ebb8d2f000000.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Philips (1986)&lt;/a&gt; showed with functional limit theory exactly why these I(1) time series led to biased results: because in fact there is no convergent asyptotic behavior for the correlation coefficient for these series (among other relevant statistics). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;At this point, there seems to be a gap in my understanding. There seems to be dozens of articles online confidently proclaiming that you can &quot;get around&quot; the spurious correlation problem if the two time series in question are not only I(1), but also cointegrated. The explanation seems to be that since the error term is I(0), the usual assumptions of hypothesis testing for correlation are met. Of course, this makes intuitive sense, since the original assumption for the correlation significance test is that the residuals are iid normal. But saying the residuals are I(0) is not the same as saying they are iid normal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am wondering if there is a reference that explains this relationship in more detail? Who was it that showed that regular hypothesis testing is valid when the two series are cointegrated? And is this an &quot;if and only if&quot;, or are there other circumstances other than co-integration under which regular OLS correlation testing is still valid?&lt;/p&gt;&#xA;" OwnerUserId="12162" LastEditorUserId="70" LastEditDate="2016-12-15T10:01:18.493" LastActivityDate="2016-12-15T10:01:18.493" Title="Why does the presence of cointegration solve the problem of spurious correlation?" Tags="&lt;correlation&gt;&lt;reference-request&gt;&lt;cointegration&gt;" AnswerCount="0" CommentCount="5" ClosedDate="2016-12-15T19:28:04.080" ContentLicense="CC BY-SA 3.0" />
  <row Id="31503" PostTypeId="2" ParentId="31498" CreationDate="2016-12-15T07:28:56.103" Score="2" Body="&lt;p&gt;I think that among others, &lt;em&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0195301641&quot; rel=&quot;nofollow noreferrer&quot;&gt;Empirical Market Microstructure&lt;/a&gt;&lt;/em&gt; is a good book to start with. For more recent theories, you can find articles from &lt;code&gt;q-fin.TR&lt;/code&gt; subsections on &lt;a href=&quot;http://arXiv.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;arXiv.org&lt;/a&gt;. Although before digging into specific paper, I would try to find some recent review papers to get an impression on the big picture. Certainly you would see different authors have different beliefs/views on the market microstructure.&lt;/p&gt;&#xA;" OwnerUserId="17835" LastActivityDate="2016-12-15T07:28:56.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31504" PostTypeId="1" AcceptedAnswerId="31507" CreationDate="2016-12-15T10:50:59.347" Score="0" ViewCount="574" Body="&lt;p&gt;Good morning all,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When trying to decipher some documentation I have come across this stochastic process which seems to me much like a Ornstein-Uhlenbeck (or Vasicek) process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dX_t=-\kappa(X_t-\sigma^2/2\kappa)dt+\sigma dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the long-term mean level coincides with the asymptotic variance of the process: $Var[X_t]=\sigma^2/2\kappa$ as $t\rightarrow \infty$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question is&lt;/strong&gt;: Does this make any sense? It certainly does not to me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much, this forum is veryhelful :)&lt;/p&gt;&#xA;" OwnerUserId="25743" LastEditorDisplayName="user16651" LastEditDate="2016-12-15T11:46:11.093" LastActivityDate="2016-12-15T11:49:18.657" Title="Mean Reverting to its own variance?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;mean-reversion&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31505" PostTypeId="1" CreationDate="2016-12-15T10:55:52.417" Score="0" ViewCount="139" Body="&lt;p&gt;I scan / trade a universe of 1500 different European and US stocks and ETFs trading on many different exchanges. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to get notified before any of the tickers are delisted, so I can sell any holdings of a stock or ETF before delisted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know of a - free or paid - website or API (preferably) where I can get about delistings &lt;em&gt;before&lt;/em&gt; they happen (effective date)?&lt;/p&gt;&#xA;" OwnerUserId="25745" LastEditorUserId="25745" LastEditDate="2016-12-15T11:48:50.207" LastActivityDate="2019-07-08T05:47:32.123" Title="Where can I get alerts for future delisting of stocks/ETFs?" Tags="&lt;equities&gt;&lt;programming&gt;&lt;etf&gt;&lt;european&gt;&lt;american&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31506" PostTypeId="1" AcceptedAnswerId="31509" CreationDate="2016-12-15T11:13:04.063" Score="1" ViewCount="4241" Body="&lt;p&gt;I would like to understand how to compute from Maturity Date the Payment Dates of a coupon bond.&#xA;For example, consider that today I am buying a bond that matures in &lt;code&gt;31/12/2017&lt;/code&gt; and that pay semi-annual coupon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which are the Cash Flow Dates? &lt;code&gt;31-12-2016&lt;/code&gt; and &lt;code&gt;30-06-2016&lt;/code&gt;? or &lt;code&gt;31-12-2016&lt;/code&gt; and &lt;code&gt;1-07-2016&lt;/code&gt;? or I have to subtract the exact number of days?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the Exact Meaning of &quot;&lt;strong&gt;Semi-Annual&lt;/strong&gt;&quot;? 6 Month? 365/2 days?&#xA;Does exist any kind of this convention?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance.&lt;/p&gt;&#xA;" OwnerUserId="25746" LastEditorDisplayName="user16651" LastEditDate="2016-12-15T11:42:52.667" LastActivityDate="2016-12-16T08:56:05.233" Title="How to Compute Dates for Bond" Tags="&lt;bond&gt;&lt;pricing&gt;&lt;convention&gt;&lt;date&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31507" PostTypeId="2" ParentId="31504" CreationDate="2016-12-15T11:33:16.760" Score="1" Body="&lt;p&gt;Yes, it is true. Let&#xA;$$dX_t=\kappa\left(\frac {\sigma^2}{2\kappa} -X_t\right)dt+\sigma dW_t\tag 1\\$$&#xA; Where $X_0=x$. By application of Ito's lemma we have&#xA;$$d\left(e^{\kappa t}X_t\right)=\kappa e^{\kappa t}X_tdt+e^{\kappa t}dX_t+\underbrace{d[e^{\kappa t},X_t]}_{0}$$&#xA;thus&#xA;$$d\left(e^{\kappa t}X_t\right)=\frac{1}{2}\sigma^2 e^{\kappa t}dt+\sigma e^{\kappa t}dW_t\tag 2 $$&#xA;By integration on $[0,t]$, we have&#xA;$$X_t=x e^{-\kappa t}+\frac{1}{2\kappa}\sigma^2 (1-e^{-\kappa t})+\sigma\int_{0}^{t}e^{-\kappa(t-s)}dW_s\tag 3$$&#xA;and&#xA;$$\text{Var}(X_t)=\mathbb{E}\left[\left(\sigma\int_{0}^{t}e^{-\kappa(t-s)}dW_s\right)^2\right]=\sigma^2\int_{0}^{t}e^{-2\kappa(t-s)}ds=\frac{\sigma^2}{2\kappa} (1-e^{-2\kappa t})\tag 4$$&#xA;Since $\kappa&amp;gt;0$, &#xA;$$\lim_{t\to \infty}\text{Var}(X_t)=\frac{\sigma^2}{2\kappa}\tag 5$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-12-15T11:49:18.657" LastActivityDate="2016-12-15T11:49:18.657" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31508" PostTypeId="2" ParentId="31498" CreationDate="2016-12-15T11:43:43.957" Score="5" Body="&lt;p&gt;You now have four reference books for algo trading&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.worldscientific.com/worldscibooks/10.1142/8967&quot; rel=&quot;nofollow noreferrer&quot;&gt;Market Microstructure in Practice&lt;/a&gt; (L and Laruelle) for an introduction and microstructure related aspects&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.amazon.fr/Financial-Mathematics-Market-Liquidity-Execution/dp/1498725473&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Financial Mathematics of Market Liquidity&lt;/a&gt; (Guéant) for practitioner who want to start implementation&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1107091144&quot; rel=&quot;nofollow noreferrer&quot;&gt;Algorithmic and High-Frequency Trading&lt;/a&gt; (Careta, Jaimungal and Penalva) for quants or young researchers&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0956399207&quot; rel=&quot;nofollow noreferrer&quot;&gt;Algorithmic Trading and DMA&lt;/a&gt; (Johnson) for technological aspects&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Last but not least, you have &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1498706487&quot; rel=&quot;nofollow noreferrer&quot;&gt;Quantitative Trading&lt;/a&gt; (Guo et al) covering a lot of aspects and probably best for people already knowing algo trading good enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course I would recommend to read them in this order.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2016-12-16T15:17:53.287" LastActivityDate="2016-12-16T15:17:53.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31509" PostTypeId="2" ParentId="31506" CreationDate="2016-12-15T13:00:57.667" Score="5" Body="&lt;p&gt;To compute the cash flow dates you need to know the maturity date, the tenor, the payment frequency, the business day convention and the holiday calendar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The cash flow dates step backward from the maturity of the bond, in units of the payment frequency. For example, for a two year bond maturing on 31/12/2017 with a semi-annual coupon, you step back in units of six months, getting&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;31/12/2017&lt;/li&gt;&#xA;&lt;li&gt;30/06/2017&lt;/li&gt;&#xA;&lt;li&gt;31/12/2016&lt;/li&gt;&#xA;&lt;li&gt;30/06/2016&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You then need to make a business day adjustment for dates that don't fall on a business day. For example, the 30th Jun 2017 is a Saturday, and the 31st Dec 2016 is a Sunday. You would also need to adjust if a day was a holiday (e.g. Independence Day in the US, or Christmas Day in many countries).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are four business day conventions in common use -&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Following (move payments to the next business day)&lt;/li&gt;&#xA;&lt;li&gt;Previous (move payments to the previous business day)&lt;/li&gt;&#xA;&lt;li&gt;Modified Following (move to the next business day, unless it falls in a different month, in which case use the previous business day)&lt;/li&gt;&#xA;&lt;li&gt;Modified Previous (move to the previous business day, unless it falls in a different month, in which case use the next business day)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I believe that the convention for US treasuries is Modified Following, though it is worth checking this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the payment on 30/06/2017 (Saturday) the next business day is 02/07/2017, but this falls in a different month, so the payment actually happens on 29/06/2017 (a Friday).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the payment on 31/12/2016 (Sunday) the next business day is 02/01/2017 (which is a Tuesday - note that Monday 1st Jan is a public holiday, even though it is not a weekend) which again falls in a different month, so the payment happens on 29/12/2016 (Friday).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this approach works for most bonds, &lt;strong&gt;but not all&lt;/strong&gt;. For example, Mexican government bonds have a payment frequency of 182 days, rather than 6 months. An advantage of this is that 182 days is exactly 26 weeks, so the payments will always fall on the same day of the week, which reduces the need for business day conventions. On the other hand, it will not always fall on the same day of the month - a payment on Weds 16th March 2016 will be followed by a payment on Weds 14th Sep 2016, rather than Fri 16th Sep 2016. If it is important to get the dates correct for a particular bond, the best thing to do is find a source of static data which can tell you the exact coupon dates (e.g. Bloomberg can do this).&lt;/p&gt;&#xA;" OwnerUserId="924" LastEditorUserId="924" LastEditDate="2016-12-16T08:56:05.233" LastActivityDate="2016-12-16T08:56:05.233" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31512" PostTypeId="1" AcceptedAnswerId="31516" CreationDate="2016-12-15T16:38:58.480" Score="2" ViewCount="575" Body="&lt;blockquote&gt;&#xA;&lt;p&gt;Consider a Black-Scholes model &lt;span class=&quot;math-container&quot;&gt;$S_t = 5\exp{(\sigma W_t + \mu t)}$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$B_t = \exp{(rt)}$&lt;/span&gt;, where &lt;span class=&quot;math-container&quot;&gt;$W_t$&lt;/span&gt; is Brownian motion with respect to a given measure &lt;span class=&quot;math-container&quot;&gt;$\mathbb{P}$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Suppose you hold a forward contract &lt;span class=&quot;math-container&quot;&gt;$X$&lt;/span&gt;, that pays at &lt;span class=&quot;math-container&quot;&gt;$T=3$&lt;/span&gt;, the value &lt;span class=&quot;math-container&quot;&gt;$X = (S_3)^2$&lt;/span&gt; the square of the stock price at the terminal time.&lt;/p&gt;&#xA;&lt;p&gt;Compute the value of the contract &lt;span class=&quot;math-container&quot;&gt;$X$&lt;/span&gt; at time &lt;span class=&quot;math-container&quot;&gt;$t=0$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Explain how the no arbitrage condition is related to your answer.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I asked a similar question like this before but I am confused now when &lt;span class=&quot;math-container&quot;&gt;$S_t$&lt;/span&gt; is squared. Any suggestions is greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="-1" LastEditorDisplayName="user16651" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-12-16T11:11:50.870" Title="Black-Scholes evaluating the squared of the stock price" Tags="&lt;black-scholes&gt;&lt;stochastic-processes&gt;&lt;arbitrage&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31513" PostTypeId="1" CreationDate="2016-12-15T16:43:30.607" Score="0" ViewCount="203" Body="&lt;p&gt;Why is volatility always quoted in terms of caplet and swaption? Why not quoted in terms of other instruments?&lt;/p&gt;&#xA;" OwnerUserId="5839" LastActivityDate="2016-12-15T16:43:30.607" Title="Caplet and Swaption Volatilities" Tags="&lt;volatility&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31514" PostTypeId="1" AcceptedAnswerId="31519" CreationDate="2016-12-15T16:44:59.777" Score="2" ViewCount="444" Body="&lt;blockquote&gt;&#xA;&lt;p&gt;If we have a Black-Scholes model &lt;span class=&quot;math-container&quot;&gt;$B_t = \exp{(rt)}$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$S_t = S_0\exp{(\sigma W_t + \mu t)}$&lt;/span&gt; then is it complete?&lt;/p&gt;&#xA;&lt;p&gt;What if &lt;span class=&quot;math-container&quot;&gt;$W_1$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$W_2$&lt;/span&gt; are independent Brownian motions. Then the two-stage Black-Scholes model &lt;span class=&quot;math-container&quot;&gt;$$B_t = \exp{(rt)}$$&lt;/span&gt; &lt;span class=&quot;math-container&quot;&gt;$$S_1(t) = \exp{(W_1(t) + W_2(t) + t)}$$&lt;/span&gt; &lt;span class=&quot;math-container&quot;&gt;$$S_2(t) = \exp{(W_1(t) + 2W_2(t) + 2t)}$$&lt;/span&gt;&#xA;is complete?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I know that we have a completeness if there is a unique martingale measure but I am not sure if this is the case for these two models.&lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="-1" LastEditorDisplayName="user16651" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2016-12-16T08:26:12.100" Title="Is Black-Scholes complete?" Tags="&lt;black-scholes&gt;&lt;stochastic-processes&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31515" PostTypeId="1" CreationDate="2016-12-15T16:50:24.910" Score="-1" ViewCount="242" Body="&lt;p&gt;Consider the arithmetic Brownian motion $X(t) = \alpha t + \sigma Z(t)$ and evaluating $dX(t)$ using Ito's lemma.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have $\frac{\partial X}{\partial t} = \alpha$, which does not involve $Z(t)$, even though $Z(t)$ varies with $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When using Ito's lemma, why is $Z(t)$ treated as an independent random variable from $t$ and therefore the partial with respect to $t$ treats $Z(t)$ as a constant?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; I'm not sure why this is getting downvoted. What I have above is coming directly from my textbook &quot;Models for Financial Economics&quot; by Abraham Weishaus.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for clarification on what the author writes in italics: &quot;When using Ito's lemma, $Z(t)$ treated as an independent random variable from $t$ and therefore the partial with respect to $t$ treats $Z(t)$ as a constant&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/E4SDB.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/E4SDB.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5641" LastEditorUserId="5641" LastEditDate="2016-12-16T01:35:59.983" LastActivityDate="2016-12-16T07:54:15.897" Title="Why does the partial derivative, $X_t$, of an ABM $X(t)$ not involve standard Brownian motion $Z(t)$, even though $Z(t)$ varies with $t$?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31516" PostTypeId="2" ParentId="31512" CreationDate="2016-12-15T16:58:13.867" Score="4" Body="&lt;p&gt;Let $$dS_t=r S_tdt+\sigma S_t dW^{\mathbb{Q}}_t\tag 1$$&#xA;where $S_0=5$. Set $X_t=S_t^2$. By application of Ito's lemma, we have&#xA;$$dX_t=\left(2r+\sigma^2\right)X_tdt+2\sigma^2X_tdW^{\mathbb{Q}}_t\tag 2$$&#xA;in other words&#xA;$$X_T=X_0+\left(2r+\sigma^2\right)\int_{0}^{T}X_t dt+2\sigma^2\int_{0}^{T}X_t dW^{\mathbb{Q}}_t\tag 3$$&#xA;thus&#xA;$$\mathbb{E}^{\mathbb{Q}}_{0}[X_T]=\mathbb{E}^{\mathbb{Q}}[X_T]=X_0+\left(2+\sigma^2\right)\int_{0}^{T}\mathbb{E}^{\mathbb{Q}}[X_t] dt\tag 4$$&#xA;as a result&#xA;$$d\,\mathbb{E}^{\mathbb{Q}}[X_T]=\left(2r+\sigma^2\right)\mathbb{E}^{\mathbb{Q}}[X_T]\tag 5$$&#xA;therefore&#xA;$$\mathbb{E}^{\mathbb{Q}}[X_T]=25\,e^{(2r+\sigma^2)T}\tag 6$$&#xA;Finally, we have&#xA;$$\Pi(0)=e^{-r(T-0)}\mathbb{E}^{\mathbb{Q}}[X_T]=25\,e^{(r+\sigma^2)T}\tag 7$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-12-16T11:11:50.870" LastActivityDate="2016-12-16T11:11:50.870" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="31517" PostTypeId="2" ParentId="31462" CreationDate="2016-12-15T17:05:13.820" Score="1" Body="&lt;p&gt;Definitely use the Bloomberg. Or there are several brokers you could use to get gold indicative prices. See &lt;a href=&quot;https://stackoverflow.com/questions/10040954/alternative-to-google-finance-api&quot;&gt;https://stackoverflow.com/questions/10040954/alternative-to-google-finance-api&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could even use a spread betting account and API.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think there's a difference in rates with Bloomberg because Yahoo rate is frozen.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2016-12-15T17:05:13.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31518" PostTypeId="1" AcceptedAnswerId="31523" CreationDate="2016-12-15T17:37:14.240" Score="2" ViewCount="345" Body="&lt;p&gt;Assume that the random vector $(X,Y)$ is (bivariate) normally distributed. Show that&#xA;$$ \Bbb E[X|Y=y]= \Bbb E[X]+ \frac {Cov[X,Y]}{Var[Y]}(y-\Bbb E[Y])$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, &#xA;$$ Var[X|Y=y]= (1-\rho^2) Var[X]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know i should be converting these variables into standard normal and then using Cholesky decomposition to come up with independent standard normal, I am getting pretty close to the answer but, its not neat. I might have done something wrong, Can some one please lay out the first step to convert X&amp;amp;Y to standard normal?? Thanks so much&lt;/p&gt;&#xA;" OwnerUserId="25173" LastEditorDisplayName="user16651" LastEditDate="2016-12-15T18:59:20.023" LastActivityDate="2016-12-17T06:33:46.600" Title="Expectation and Cholesky Decomposition" Tags="&lt;normal-distribution&gt;&lt;cholesky&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31519" PostTypeId="2" ParentId="31514" CreationDate="2016-12-15T17:40:45.830" Score="3" Body="&lt;p&gt;&lt;strong&gt;Meta-theorem&lt;/strong&gt; : Let $M$ denote the number of underlying traded assets in&#xA;the model excluding the risk free asset, and let $R$ denote the number of random&#xA;sources. Generically we then have the following relations&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The model is arbitrage free if and only if $M \le R$ .&lt;/li&gt;&#xA;&lt;li&gt;The model is complete if and only if $M \ge R$.&lt;/li&gt;&#xA;&lt;li&gt;The model is complete and arbitrage free if and only if $M = R$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In the Black–Scholes model, we have one underlying asset $S_t$ plus the risk free asset so $M = 1$. Also we have one driving Wiener process, giving us $R = 1$, so in fact $M = R$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the second model,  we have two underlying assets $S_1(t)$ and $S_2(t)$  plus the risk free asset so $M = 2$. Also we have two driving Wiener process, giving us $R = 2$, so in fact $M = R$.&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-12-15T18:56:46.057" LastActivityDate="2016-12-15T18:56:46.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31521" PostTypeId="2" ParentId="24827" CreationDate="2016-12-15T17:50:37.683" Score="0" Body="&lt;p&gt;I think number of tickers is a monthly limit and number of data points is a daily limit. If you hit the number of tickers your API is cut off for the rest of the month, if you hit number of data points you're cut off for rest of the day. However you can get these reset once if you ask nicely but they don't want you downloading a lot of data and they won't disclose the exact limits otherwise people will work around it. Also your data is not allowed to leave the terminal.&#xA;However if you have a Factset account you can download what you like and do what you like with it.&lt;/p&gt;&#xA;" OwnerUserId="24095" LastEditorDisplayName="user13444" LastEditDate="2016-12-19T10:38:43.220" LastActivityDate="2016-12-19T10:38:43.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31522" PostTypeId="2" ParentId="31515" CreationDate="2016-12-15T17:56:18.893" Score="1" Body="&lt;p&gt;Your imagine  from Ito's lemma is false. Although $Z(t)$ is a time-dependent process, we shouldn't apply $\frac{\partial Z(t)}{\partial t}$ in Ito's lemma. It is meaningless.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $f(t,x)=\alpha t+\sigma x\in \mathbb{C}^{1,2}\left([0,+\infty)\times \mathbb{R}\right)$. By application of Ito's lemma, we have&#xA;$$df(t, Z(t))=\frac{\partial f}{\partial t}(t, Z(t))dt+\frac{\partial f}{\partial x}(t, Z(t))dZ(t)+\frac 12\frac{\partial^2 f}{\partial x^2}(t, Z(t))d[Z(t),Z(t)]\tag 1$$&#xA;thus&#xA;$$dX(t)=\alpha dt+\sigma dZ_t\tag 2$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-12-16T07:54:15.897" LastActivityDate="2016-12-16T07:54:15.897" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31523" PostTypeId="2" ParentId="31518" CreationDate="2016-12-15T18:07:47.543" Score="4" Body="&lt;p&gt;By Cholesky decomposition, you can express the normal random variables $X$ and $Y$ in the form&#xA;\begin{align*}&#xA;Y &amp;amp;= E(Y) + \sqrt{Var(Y)}\, \xi,\\&#xA;X &amp;amp;= E(X) + \sqrt{Var(X)}\left(\rho \xi+\sqrt{1-\rho^2} \eta\right),&#xA;\end{align*}&#xA;where $\rho = \frac{Cov(X, Y)}{\sqrt{Var(X)Var(Y)}}$ is the correlation, $\xi$ and $\eta$ are two independent standard normal random variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then,&#xA;\begin{align*}&#xA;E(X \mid Y) &amp;amp;= E\left(E(X) + \sqrt{Var(X)}\left(\rho \xi+\sqrt{1-\rho^2} \eta\right) \mid \xi \right)\\&#xA;&amp;amp;=E(X) + \rho \sqrt{Var(X)}\xi\\&#xA;&amp;amp;=E(X) + \frac{Cov(X, Y)}{\sqrt{Var(Y)}}\xi\\&#xA;&amp;amp;=E(X) + \frac{Cov(X, Y)}{Var(Y)}\big(Y-E(Y) \big).&#xA;\end{align*}&#xA;The computation for $Var(X\mid Y)$ is similar, specifically,&#xA;\begin{align*}&#xA;Var(X \mid Y) &amp;amp;=E\left((X-E(X\mid Y))^2\mid Y \right)\\&#xA;&amp;amp;=E\left( (X-E(X\mid Y))^2\mid \xi\right)\\&#xA;&amp;amp;=E\left(Var(X)(1-\rho^2) \eta^2 \mid \xi\right)\\&#xA;&amp;amp;=E\left(Var(X)(1-\rho^2) \eta^2\right)\\&#xA;&amp;amp;=Var(X)(1-\rho^2).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2016-12-15T19:59:42.947" LastActivityDate="2016-12-15T19:59:42.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31524" PostTypeId="2" ParentId="31518" CreationDate="2016-12-15T18:31:26.660" Score="3" Body="&lt;p&gt;&lt;strong&gt;Another approach&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f_{X|Y}(x,y)=\frac{f_{X,Y}(x,y)}{f_{Y}(y)}\tag 1$$&#xA;Set&#xA;$$u=\frac{x-\mu_X}{\sigma_X}$$&#xA;and&#xA;$$v=\frac{y-\mu_Y}{\sigma_Y}$$&#xA;we have&#xA;$$f_{X|Y}(x,y)=\frac{\frac{1}{2\pi\sigma_X\sigma_Y\sqrt{1-\rho^2}}\exp\left(-\frac{u^2-2\rho uv+v^2}{2(1-\rho^2)}\right)}{\frac{1}{\sqrt{2\pi}\sigma_Y}\exp\left(-\frac{1}{2}v^2\right)}\\\qquad\qquad\qquad\qquad=\frac{1}{\sqrt{2\pi(1-\rho^2)}\sigma_X}\exp\left(-\frac 12\left[\frac{u-\rho v}{\sqrt{1-\rho^2}}\right]^2\right)\tag 2$$&#xA;Indeed&#xA;$$f_{X|Y}(x,y)=\frac{1}{\sqrt{2\pi(1-\rho^2)}\sigma_X}\exp\left(-\frac{1}{2}\left[\frac{x-(\mu_X+\rho\frac{\sigma_X}{\sigma_Y}(y-\mu_Y)}{\sigma_X\sqrt{1-\rho^2}}\right]^2\right)\tag 3$$&#xA;as a result&#xA;$$\mathbb{E}[X|Y]=\mu_X+\rho\frac{\sigma_X}{\sigma_Y}(y-\mu_Y)\tag 4$$&#xA;and&#xA;$$\text{Var}(X|Y)=\sigma_X^2(1-\rho^2)\tag 5$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-12-17T06:33:46.600" LastActivityDate="2016-12-17T06:33:46.600" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31525" PostTypeId="1" CreationDate="2016-12-15T18:48:32.977" Score="0" ViewCount="338" Body="&lt;p&gt;For a swap thats fully collateralised once a day, i suppose that the cva measures risk only for the intraday chance of counterparty default?  Surely thats tiny enough to be neglible, or am i missing something?&lt;/p&gt;&#xA;" OwnerUserId="17348" LastActivityDate="2018-09-03T17:00:51.300" Title="cva for a collateralised swap" Tags="&lt;cva&gt;&lt;default&gt;&lt;exposure&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31526" PostTypeId="2" ParentId="31151" CreationDate="2016-12-15T19:29:15.433" Score="-1" Body="&lt;p&gt;as per the paper , shifted logN , and Normal are both used by bloomberg&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i am not sure where bbg / reuters get their data from&lt;/p&gt;&#xA;" OwnerUserId="17348" LastEditorUserId="17348" LastEditDate="2016-12-15T20:56:15.813" LastActivityDate="2016-12-15T20:56:15.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31527" PostTypeId="2" ParentId="31525" CreationDate="2016-12-15T20:32:32.867" Score="0" Body="&lt;p&gt;I would say it is negligible, the only times have ever had to compute that on standalone ISDAs (with just one albeit large swap) it's really honestly been very small perhaps a few tens of k for a 500mm swap over 15 years from distant memory, even if you say for example that your period of risk is greater than a day (let's say you have a massive swap, a major deriv cprty defaults, whole market is same way around so you can't replace your market risk hedge as quickly as you'd like - inconceivable in vanilla swaps but bear in mind regulatory hedge replacement windows typically assume 7 days or similar). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is even in the context of wrong way credit rates correlation - if you model credit intensity and rates as correlated brownians you just aren't going to get a material one day move. As a caveat I would say however if you have a large long dated swap book that is very one way vs a counterparty (let's say you are receiving fixed and assume low rates &amp;lt;-&gt; wide credit), then obviously it will add up. So as in many problems, it's worth looking at with conservative assumptions on period of risk and correlation, to allow you decide if you can afford to ignore it on your portfolio. Regulators as mentioned do demand a marghin period of risk, but unless am wrong for certain banks, this does not generally make it into economic CVA calculations and hedging decisions.&lt;/p&gt;&#xA;" OwnerUserId="19239" LastActivityDate="2016-12-15T20:32:32.867" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31528" PostTypeId="1" CreationDate="2016-12-15T21:00:06.590" Score="0" ViewCount="851" Body="&lt;p&gt;For example, price, iv, delta, gamma, volume, and open interest&lt;/p&gt;&#xA;" OwnerUserId="25756" LastEditorUserId="308" LastEditDate="2016-12-15T23:01:54.160" LastActivityDate="2017-01-01T23:52:59.987" Title="How to request intra day real time option data using ibPY?" Tags="&lt;options&gt;&lt;programming&gt;&lt;python&gt;&lt;interactive-brokers&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31530" PostTypeId="2" ParentId="31525" CreationDate="2016-12-15T21:29:11.097" Score="-1" Body="&lt;p&gt;i think that cva is meant to cover Expected credit losses&#xA;and PFE x% covers Unexpected credit losses&#xA;and so gap risk would be more covered by PFE&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i think initial margin for ccp cleared trades is more like a charge for PFE than for cva&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, i still dont really fully get where the demand for cva is coming from &lt;/p&gt;&#xA;" OwnerUserId="17348" LastActivityDate="2016-12-15T21:29:11.097" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31531" PostTypeId="2" ParentId="25176" CreationDate="2016-12-15T21:37:40.657" Score="4" Body="&lt;p&gt;I have been through your confusion myself for the last five years. Until recently, my account started to get some consistent performance.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;First, I started with Technicals, Spent $$$ on a automated trading platform. From there I created common strategies. The results is not promising. The strategy doesn't consists parameters and if one strategy works on one specific product, it probably won't work on the other product. The movement of the price seems so random. And my expectation for the strategy performance is high. (Nearly did I know I was so close.) I concluded all the failures due to simplicity of technicals.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I then moved onto next stage which tries to use complex model to predict price movement. The complex models includes using various machine learning techniques. That doesn't work well either. The prediction accuracy is not as high as I expected. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Then I thought I might need some quantitive finance knowledge to better understand the financial markets. I then studies stochastic calculus and various quantitive financial techniques. In the end, what quantitive finance tells me is that I should get the same return as the fixed-income. And the time series predication model doesn't perform any better than my machine learning techniques. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;At this point, I considered giving up. Because each of above tasks takes tremendous effort and time. The most hurting part is that, after all these efforts, there is no rewards.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;At some rare situation, I met with &quot;this investment group&quot; of people, they shed some lights that brings me to today's state. Market is mostly random but there are some non-randomness in it. And this non-randomness is your chance of making money. But it's buried under high randomness. The expectation of making money should not be high (you'll never get an ATM), but by careful control of risks and leverage, it's possible to make enough money that others can only be jealous about. Slippage and Transaction cost is your enemy. On average, you can only get so little after slippage and transactions cost. But for financial assets, there are leverage that the little can be huge. Leverage is a double blade sword. Risk is also increased under leverage. But the good thing about risk is that there are some established practice in both academia and industry that can help alleviate risk (but not completely remove).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Finding a strategy is only part of your job. Finding a &quot;good&quot; strategy is hard, but finding a &quot;working&quot; strategy is not so difficult. The other part of your job is to reduce the risk using various methods. Then increase leverage to get more rewards even though you have a &quot;mediocre&quot; strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this can shed some lights to people who are still struggling alone.&lt;/p&gt;&#xA;" OwnerUserId="2661" LastActivityDate="2016-12-15T21:37:40.657" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31533" PostTypeId="2" ParentId="16657" CreationDate="2016-12-16T06:22:46.847" Score="0" Body="&lt;p&gt;You can start with &lt;em&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470319585&quot; rel=&quot;nofollow noreferrer&quot;&gt;Wilmott&lt;/a&gt;&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS_t = \mu S_t dt +\sigma S_t dZ_t + (J-1)S_t dq_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the Poisson Process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;  dq_t =\begin{cases}&#xA;    0, &amp;amp; \text{with prob $1-\lambda(t)dt$}\\&#xA;    1, &amp;amp; \text{with prob $\lambda(t)dt$}&#xA;  \end{cases}&#xA;\end{equation}&#xA;Also assume that jump arrival rate $\lambda(t)$ is independent of stock price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming a known jump size $J$ is simple but somewhat unrealistic, one can assume some distribution of jump size. For example, Merton's jump diffusion models assumes $J$ to be lognormally distributed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note however, that in the case of random jump size, there's no replicating portfolio so there is no self-financing hedge. &lt;/p&gt;&#xA;" OwnerUserId="17835" LastActivityDate="2016-12-16T06:22:46.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31534" PostTypeId="1" CreationDate="2016-12-16T09:09:26.743" Score="1" ViewCount="918" Body="&lt;p&gt;In the Black Scholes model, the normalized price process is a martingale under the martingale measure $Q$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I don't understand is, why is this limited to the Black Scholes model only? Does this not hold for the general model where $$dS(t) = S(t)\alpha(t,S(t))dt + S(t)\sigma(s,S(t))dW(t)?$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At least I was asked to prove this property, and I did not need to assume that $\alpha$ and $\sigma$ were constants. So was my proof wrong?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way I proved it was that I first found out $d\Pi(t)$ using the neutral risk evaluation formula, and then I used the multi-dimensional Ito formula on the ratio of the price process over the riskfree asset. The dt part just cancelled out, and so I was left with only dW(t), and then it's a martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, here in &lt;a href=&quot;https://books.google.dk/books?id=YoMr5Mbo6coC&amp;amp;pg=PT208&amp;amp;lpg=PT208&amp;amp;dq=the%20martingale%20property%20normalized%20price%20process&amp;amp;source=bl&amp;amp;ots=inlvazQu7c&amp;amp;sig=OC_2YsVkKktQd2tf5sVCErasmrU&amp;amp;hl=en&amp;amp;sa=X&amp;amp;ved=0ahUKEwjXwN7isvjQAhWECywKHSteC7sQ6AEIMDAD#v=onepage&amp;amp;q=the%20martingale%20property%20normalized%20price%20process&amp;amp;f=false&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bjork&lt;/a&gt;'s text. He too states the martingale property in the generalized section with the model as stated above, and then shortly after he has a subsection where he focuses strictly on the standard Black Scholes model. This merely adds to my confusion: if the result holds generally, why does he claim in the theorem that it only holds in the Black Scholes model? And why does he not put this theorem inside subsection 7.5 where he limits himself to precisely the Black Scholes model??&lt;/p&gt;&#xA;" OwnerUserId="25763" LastEditorDisplayName="user16651" LastEditDate="2016-12-16T09:40:56.170" LastActivityDate="2016-12-16T09:43:22.637" Title="The martingale property - why only for Black Scholes model?" Tags="&lt;black-scholes&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31535" PostTypeId="1" CreationDate="2016-12-16T09:26:42.970" Score="2" ViewCount="116" Body="&lt;p&gt;A portfolio of 13 different companies have loans. Company $i$ default on their loan with probability $p_i$ and survive with prob $q_i=1-p_i$. Let $Y_i=1$ denote default. &lt;strong&gt;Question: How could I get to a reasonable guess, preferrably using probability theory, on what is the probability of default for the portfolio?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am pondering about the risk on a loan to the entire portfolio. I am free to make assumptions and be creative, for example not find an exact solution but bound the probability by some interval. I make three scenarios, each with different assumptions&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I) If one defaults, all other defaults. &lt;/li&gt;&#xA;&lt;li&gt;II) The firms are independent&lt;/li&gt;&#xA;&lt;li&gt;III) They are positively/negatively correlated in the sense that if one falls, it is a higher/lower probability of the other falling. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h1&gt;I)&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Pr(portfolio.defaults) = Pr(someone defaults) = 1 - Pr(no one defaults). Here my thinking stops, can I &lt;/p&gt;&#xA;&#xA;&lt;h1&gt;II)&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Here it is like a binomial with $n=13$ although the probabilities $p$ are not the same but are changing. I could make an upper bound and say it is equal to $Bin(n=13, p=max[p_i])$ but surely there is a distribution for this? Maybe I could use the PDF of a Bin directly via ${\displaystyle \Pr(Y_i=k)={\binom {n}{k}}p_i^{k}(1-p_i)^{n-k}}$&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;I) and II)&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;We have that &lt;em&gt;Pr(portfolio.default) = by assummption I = Pr(someone defaults) = 1 - Pr(no one defaults)&lt;/em&gt;. Since they are independent by assumption II we have $$Pr(portfolio.default) = 1 - (q_1 \times ... \times q_{13})$$&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;III)&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I have not started thinking about this scenario. &lt;/p&gt;&#xA;" OwnerUserId="12002" LastActivityDate="2016-12-16T09:26:42.970" Title="Portfolio diversification on default risk" Tags="&lt;probability&gt;&lt;default-probability&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31536" PostTypeId="2" ParentId="31534" CreationDate="2016-12-16T09:43:22.637" Score="3" Body="&lt;p&gt;It is not a property per se. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rather, it is the &lt;em&gt;absence of arbitrage opportunities&lt;/em&gt; which requires that &quot;normalised&quot; prices of self-financing investment strategies emerge as martingales under some probability measure equivalent to the physical measure, where by &quot;normalised&quot; one should understand, &quot;prices expressed with respect to a certain numéraire&quot;, a &lt;em&gt;numéraire&lt;/em&gt; being any, positive-valued, tradable asset which will serve as a relative basis to express the value of some other assets/self-financing strategies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is obviously not limited to the BS model. Any valuation model working under the &quot;no free lunch&quot; assumption should verify that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet, for pure diffusion models like BS, such equivalent martingale measures are unique (read: there exists a unique measure per type of numéraire, the &lt;em&gt;risk-neutral measure&lt;/em&gt; being associated to the &lt;em&gt;risk-free money market account&lt;/em&gt; numéraire). This is not the case for stochastic volatility models or models that include random jumps. We talk about (market) model (in)completeness.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2016-12-16T09:43:22.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31537" PostTypeId="1" CreationDate="2016-12-16T10:02:04.990" Score="0" ViewCount="85" Body="&lt;p&gt;See the solution to Exercise 7.6 here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/btC0m.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/btC0m.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution calculates $E^Q (S(T_1)/S(T_0))$ and then just plugs that into the risk neutral valuation formula. But why? The risk neutral valuation formula holds for claims that depend on $T$ alone. Why can it be used also for this case where the claim depends on one more date?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My solution was similar, but I still don't trust it. How can I use a theorem which solves a different problem than this one, where the claim depends on multiple dates?&lt;/p&gt;&#xA;" OwnerUserId="25765" LastEditorDisplayName="user16651" LastEditDate="2016-12-16T11:44:55.797" LastActivityDate="2016-12-16T11:44:55.797" Title="Bjork exercise 7.6: Claim that depends on $T_1$ and $T_0$" Tags="&lt;continuous-time&gt;&lt;homework&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31538" PostTypeId="2" ParentId="31537" CreationDate="2016-12-16T10:25:50.763" Score="1" Body="&lt;p&gt;The spot price process is driven by a constant coefficient geometric Brownian motion. Thus, the ratio $S \left( T_1 \right) / S \left( T_0 \right)$ is&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;independent of $\mathcal{F} \left( T_0 \right)$ and&lt;/li&gt;&#xA;&lt;li&gt;its distribution only depends on the length of the time interval $T_1 - T_0$.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;It follows that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;S \left( T_1 \right) / S \left( T_0 \right) \sim S \left( T_1 - T_0 \right) / S(0),&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\sim$ denotes equality in distribution. I.e. the solution is the same as the one that only involves the single date $T_1 - T_0$. Note that in the general case where the payoff function is given by $f \left( S \left( T_0 \right), S \left( T_1 \right) \right)$, this might no longer hold.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2016-12-16T10:25:50.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31539" PostTypeId="2" ParentId="31537" CreationDate="2016-12-16T10:26:45.260" Score="2" Body="&lt;p&gt;The valuation formula for a contingent claim delivering a payoff at $T$, as seen of today $t$ knowing that the underlying is currently worth $s$ reads&#xA;$$ \Pi(t,s) = e^{-r(T-t)} \Bbb{E}^\Bbb{Q} \left[ f(S_T) \mid \mathcal{F}_t \right] $$&#xA;where $f(S_T)$ is the $\mathcal{F}_T$-measureable payoff of your contingent claim.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the exercise you mention, we have $t &amp;lt; T_0 &amp;lt; T_1=T$ along with $f(S_{T_1}) = \frac{S_{T_1}}{S_{T_0}}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because $f(S_{T_1})$ is $\mathcal{F}_{T_1}$ measurable (at $T_1$ you &quot;known&quot; both $S_{T_0}$ and $S_{T_1}$) then you can seamlessly use the standard valuation formula to write:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \Pi(t,s) = e^{-r(T_1-t)} \Bbb{E}^\Bbb{Q} \left[ \frac{S_{T_1}}{S_{T_0}}\mid \mathcal{F}_t \right] $$&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2016-12-16T10:26:45.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31540" PostTypeId="1" AcceptedAnswerId="31542" CreationDate="2016-12-16T12:43:01.613" Score="2" ViewCount="400" Body="&lt;p&gt;Using simple delta-probability decomposition, the price European call options a non- dividend paying asset can be computed as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;C(T,K) = {S_0}{\rm{ }}{\Pi _1} - {e^{ - rT}}K{\rm{ }}{\Pi _2},&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;{\Pi _1} = \frac{1}{2} + \frac{1}{\pi }\int_0^\infty  {{\mathop{\rm Re}\nolimits} \left[ {\frac{{{e^{ - iw\ln (K)}}{\psi _{\ln {S_T}}}(w - i)}}{{iw{\psi _{\ln {S_T}}}( - i)}}} \right]} \;dw,&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}\label{pi2}&#xA;{\Pi _2} = \frac{1}{2} + \frac{1}{\pi }\int_0^\infty  {{\mathop{\rm Re}\nolimits} \left[ {\frac{{{e^{ - iw\ln (K)}}{\psi _{\ln {S_T}}}(w)}}{{iw}}} \right]} \;dw,&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and where ${\psi _{\ln {S_T}}}$ is the characteristic function of the log-asset price. For instance, for the Heston and Variance Gamma models, the corresponding $\psi^{H}_{\ln {S_T}}$ and $\psi^{VG}_{\ln {S_T}}$ are given by:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Variance Gamma&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\psi _{\ln ({S_t})}^{VG}(w) = {\left( {\frac{1}{{1 - i\theta vw + ({\sigma ^2}v/2){w^2}}}} \right)^{t/v}}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Heston&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;  \psi_{\ln(S_t)}^{H} (w) = e^{ C(t,w) \overline{V}+ D(t,w) V_0 +iw \ln(S_0 e^{rt})},&#xA;\end{equation}&#xA;where&#xA;\begin{eqnarray*}&#xA;  C(t,w) &amp;amp;=&amp;amp;  a \left[ r_{-} \cdot t - \frac{2}{\eta^2}  \ln \left(  \frac{1-g e^{-ht}}{1-g} \right) \right], \\&#xA;   D(t,w) &amp;amp;=&amp;amp;   r_{-}   \frac{1-e^{-ht}}{1-g e^{-ht}},  \\&#xA;   \alpha &amp;amp;=&amp;amp; - \frac{w^2}{2}- \frac{iw}{2}, \quad \beta = a - \rho \eta i w , \quad \gamma = \frac{\eta^2}{^2}, \\&#xA;  r_{\pm} &amp;amp;=&amp;amp; \frac{ \beta \pm h}{\eta^2},  \quad h= \sqrt{ \beta^2- 4 \alpha \gamma}, \quad g= \frac{r_{-}}{r_{+}}.&#xA;\end{eqnarray*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These equations, however, are intended for options on spot prices. If I were interested in options on futures, which modifications should be made to the formulas above?(because it is not as straightforward as simply using $F_0$ instead of $S_0$ and removing the effects of $r$, right?)&lt;/p&gt;&#xA;" OwnerUserId="5208" LastEditorUserId="5208" LastEditDate="2016-12-19T08:55:15.000" LastActivityDate="2016-12-19T08:55:15.000" Title="Characteristic functions for options on futures" Tags="&lt;option-pricing&gt;&lt;forward&gt;&lt;heston&gt;&lt;characteristic-function&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31542" PostTypeId="2" ParentId="31540" CreationDate="2016-12-16T14:34:33.210" Score="3" Body="&lt;p&gt;I generally agree with Quantuple's comment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I explicitly discuss the case of the variance gamma model, though most of this also applies to Heston. First note that in case of the variance gamma model, the characteristic function that you presented is not the one of the logarithmic stock price under the risk-neutral probability measure. Let $X$ be a variance gamma process as in Madan et al. (1998). The characteristic function of $X_t$ is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\phi_{X_t}(\omega) = \left( 1 - \mathrm{i} \theta \nu \omega + \frac{1}{2} \sigma^2 \nu \omega^2 \right)^{-t / v};&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;see Equation (7) in the original paper (note that there was originally a typo in your question). We now look for a drift term $\gamma$, such that the process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;Y_t = \exp \left\{ \gamma t + X_t \right\}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is a martingale. You find that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\gamma = -\ln \left( \phi_{X_t}(-\mathrm{i}) \right).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your model for the stock and forward prices respectively is then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;S_t &amp;amp; = &amp;amp; S_0 \exp \left\{ (r + \gamma) t + X_t \right\}\\&#xA;F_t(T) &amp;amp; = &amp;amp; F_0(T) \exp \left\{ \gamma t + X_t \right\}&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with characteristic functions&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\phi_{\ln \left( S_t \right)}(\omega) &amp;amp; = &amp;amp; \exp \left\{ \mathrm{i} \left( \ln \left( S_0 \right) + r + \gamma \right) \omega t \right\} \phi_{X_t}(\omega)\\&#xA;\phi_{\ln \left( F_t(T) \right)}(\omega) &amp;amp; = &amp;amp; \exp \left\{ \mathrm{i} \left( \ln \left( F_0(T) \right) + \gamma \right) \omega t \right\} \phi_{X_t}(\omega)&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can now re-use your general expressions for $\Pi_1$ and $\Pi_2$ in terms terms of the appropriate characteristic function as these are just the corresponding exercise probabilities under the respective measure. Your pricing formula then becomes&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;C_0 = e^{-r T} \left( F_0(T) \Pi_1 - K \Pi_2 \right).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to convince yourself that this is correct, then you could work through the detailed steps given e.g. in Schmelzle (2010).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Madan, Dilip B, Peter P. Carr and Eric C. Chang (1998) &quot;The Variance Gamma Process and Option Pricing&quot;, European Finance Review, Vol. 2, pp. 79-105&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Schmelzle, Martin (2010) &quot;Option Pricing Formulae Using Fourier Transform: Theory and Application&quot;, Technical Report&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2016-12-16T14:42:31.667" LastActivityDate="2016-12-16T14:42:31.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31543" PostTypeId="1" CreationDate="2016-12-16T18:40:46.493" Score="0" ViewCount="171" Body="&lt;p&gt;Let the dynamic of underlying asset $S_t$ under objective probability measure $\mathbb{P}$ be as follow  $$dS = \mu Sdt + \sigma S dW_t^{\mathbb{P}}.$$&#xA;We now define another probability measure $\mathbb{Q}$ under which the $S$-process has a different probability distribution. This is done by defining the $\mathbb{Q}$-dynamics of $S_t$ as&#xA; $$dS_t = r S_t dt + \sigma S_t dW_t^{\mathbb{Q}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know the arbitrage free price of the claim $f(S_T)$, at time $t$ is given by $$\Pi(t) = e^{-r(T-t)}\mathbb{E}^Q_{t,s}\left[ f(S_T)\right]$$. &#xA; The subscripts $t,s$ indicate that we take the expectation given the initial condition that $S(t) = s$. Is this theorem equivalent to writing $E^Q \left(f(S_T) | \mathcal{F}_t\right)$, that is, the expectation &quot;given what we know at time $t$&quot;, which is another way that I've seen the risk neutral formula written down?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason for my confusion is that in the former, we only assume that we know the price at time $t$ exactly, but in the latter with the conditional expectation, we have access to the entire path information contained in $\mathcal{F}_t$, right? So how can they be equivalent, when the latter is a narrower form of expectation?&lt;/p&gt;&#xA;" OwnerUserId="25765" LastEditorDisplayName="user16651" LastEditDate="2016-12-16T19:30:24.603" LastActivityDate="2016-12-16T19:30:24.603" Title="Is this the same as the conditial expectation in risk neutral pricing formula?" Tags="&lt;arbitrage&gt;&lt;risk-neutral-measure&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31544" PostTypeId="1" CreationDate="2016-12-16T18:49:35.130" Score="3" ViewCount="6574" Body="&lt;p&gt;Can someone explain which curves are used to calculate FX forward rates? I have the idea that it involves using the local OIS curves for both currencies, but my calculation shows that it is not the case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="25775" LastActivityDate="2017-02-22T14:00:45.823" Title="FX forward curve building" Tags="&lt;fx&gt;&lt;forward&gt;&lt;ois&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31545" PostTypeId="2" ParentId="31543" CreationDate="2016-12-16T19:04:31.117" Score="1" Body="&lt;p&gt;In the case you mentioned, the terminal payoff of the contingent claim only depends on $S_T$. You have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;S_T = S_t \exp \left\{ \left( r - \frac{1}{2} \sigma^2 \right) (T - t) + \sigma \left( W_T - W_t \right) \right\}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume that $\mathcal{F}_t$ is the natural filtration generated by the processes $S$ or equivalently $W$. In that case, $S_t$ is $\mathcal{F}_t$-measurable and the increment $W_T - W_t$ is independent of $\mathcal{F}_t$. Consequently,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathbb{E} \left[ \left. f \left( S_T \right) \right| \mathcal{F}_t \right] = \mathbb{E} \left[ \left. f \left( S_T \right) \right| \sigma \left( S_t \right) \right] = g \left( t, S_t \right).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e. the additional information from observing the full path of $S$ over the interval $[0, t]$ is not relevant for computing the conditional expectation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could construct path-dependent contingent claims, where this does not hold. Consider e.g. a knock-out barrier option with terminal payoff&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;f \left( S_T, M_T \right) = h \left( S_T \right) \mathrm{1} \left\{ M_T &amp;lt; B \right\},&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $M_t = \max_{u \in [0, t]} S_u$ is the running maximum of the process $S$. In this case,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathbb{E} \left[ \left. f \left( S_T \right) \right| \mathcal{F}_t \right] \neq \mathbb{E} \left[ \left. f \left( S_T \right) \right| \sigma \left( S_t \right) \right]&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;since by just knowing $S_t &amp;lt; B$, we don't know if also $M_t &amp;lt; B$. However,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathbb{E} \left[ \left. f \left( S_T \right) \right| \mathcal{F}_t \right] = \mathbb{E} \left[ \left. f \left( S_T \right) \right| \sigma \left( S_t, M_t \right) \right] = g \left( t, S_t, M_t \right).&#xA;\end{equation}&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2016-12-16T19:04:31.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31546" PostTypeId="2" ParentId="8700" CreationDate="2016-12-16T20:15:45.847" Score="1" Body="&lt;p&gt;Well, as an economist / Financial Analyst and trainer in capital investment analysis, in public and private sector, for more than 4 decades, I feel most of these arguments on IRR Vs NPV is like a blind man trying to catch a cat that is not there! First: both IRR and NPV are outputs (estimates) produced by the same equation using the same data (NCF) and same method (DCF). That being the case, how can one be superior to the other? Reinvestment assumption is a fallacy and no consensus arrived (I am publishing a paper with numerical analysis and evidence that there is no reinvestment assumption). On multiple IRR, yes there are multiple IRR with non-normal NCF and in that case NPV also suffers as that becomes zero multiple times. The problem is with NCF data and not with the estimate IRR or NPV. On mutually exclusive projects NPV is not the best criteria as widely proclaimed. Mathematically NPV is the unallocated the NCF and with lower discount rate more NCF remains unallocated (or instead over allocated to return of capital, ROC) to return on invested capital (ROIC) and with higher discount rate the NPV becomes zero and at that point the NCF fully allocated (optimized) to ROC and ROIC. When NPV is zero at IRR that indicates, the IRR is the maximum ROIC for that NCF. NPV could not reveal the full potential of the NCF to generate the highest ROIC. I am amazed to see the developments or progress in IRR vs NPV debate, mainly driven by software based analysis, and most debates are diverging without focus and at times reinventing the wheels. I could see more divergence in the last 2 decades and analysts are fantasizing with coining more and more terminology without adding value to the knowledge system on capital budgeting.&#xA;Hopefully, I will contribute my papers to further facilitate the understanding of the CBA and capital investment analysis.&lt;/p&gt;&#xA;" OwnerUserId="25776" LastActivityDate="2016-12-16T20:15:45.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31547" PostTypeId="2" ParentId="30703" CreationDate="2016-12-16T21:28:28.113" Score="1" Body="&lt;p&gt;Both of the references below talk about specifically the problem you are looking at and discuss methodologies that might of interest.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;There has been a lot of work done on replicating hedge fund returns and studying whether they can be explained by common factors. The seminal &lt;a href=&quot;https://www.analyticsvidhya.com/blog/2014/12/caret-package-stop-solution-building-predictive-models/&quot; rel=&quot;nofollow noreferrer&quot;&gt;paper&lt;/a&gt; on this topic was written by Andrew Lo&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Also Andrew Ang, when he was at Columbia did a great job of &lt;a href=&quot;https://www0.gsb.columbia.edu/faculty/aang/papers/report%20Norway.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;explaining&lt;/a&gt; hedge fund returns via common factors in his paper, that kinda started the smart beta revolution.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;w.r.t. R packages - the &lt;a href=&quot;https://cran.r-project.org/web/packages/caret/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;caret&lt;/a&gt; package is the one you want to look at. &lt;a href=&quot;https://www.analyticsvidhya.com/blog/2014/12/caret-package-stop-solution-building-predictive-models/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Here&lt;/a&gt; is a reference on caret that talks about using caret for data partitioning, linear regression and cross validation .&lt;/p&gt;&#xA;" OwnerUserId="25458" LastActivityDate="2016-12-16T21:28:28.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31548" PostTypeId="1" CreationDate="2016-12-17T00:56:42.513" Score="2" ViewCount="20663" Body="&lt;p&gt;Most answers to the question &quot;what is the dv01 of an interest rate swap&quot; are along the lines of: &quot;compute the difference between the price of the swap and its price using a curve perturbed by 1 basis point&quot;. While i agree with this answer, I wanted to link this to a formula that I believe expresses the dv01 as a function of the relevant discount factors throughout the life of the swap and the day count fractions for each period. Can someone help point towards this version? &lt;/p&gt;&#xA;" OwnerUserId="25779" LastActivityDate="2017-09-03T14:23:55.017" Title="formula for physical DV01 of interest rate swap" Tags="&lt;interest-rates&gt;&lt;swaps&gt;&lt;greeks&gt;&lt;interest-rate-swap&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31550" PostTypeId="1" CreationDate="2016-12-17T02:00:33.727" Score="3" ViewCount="180" Body="&lt;p&gt;The above ensemble methods appear useful in several machine learning competitions, like Netflix prize or KDD. They work by diversifying between several model variants. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are they also useful in portfolio construction or other quant finance subjects? What are examples of their uses?&lt;/p&gt;&#xA;" OwnerUserId="16956" LastActivityDate="2016-12-17T02:00:33.727" Title="What are examples of boosting, bagging, stacking or subspace method in quantitative finance?" Tags="&lt;portfolio-management&gt;&lt;portfolio-optimization&gt;&lt;machine-learning&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31554" PostTypeId="2" ParentId="31544" CreationDate="2016-12-17T12:46:38.433" Score="3" Body="&lt;p&gt;Your method assumes you can borrow or lend at OIS in both currencies, but in practice you cannot. That's why there is a current basis swap market , where you lend at OIS in one currency versus borrowing at OIS + X in the other currency , where X is not zero.   That is the missing piece of your calculation.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why, you may ask , is X not zero , as many textbooks assume?  Apparently because most institutions cannot actually borrow and lend at OIS in all currencies.  For example , only certain banks in the US have access to the Federal Funds market.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-12-17T12:46:38.433" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31555" PostTypeId="1" AcceptedAnswerId="31556" CreationDate="2016-12-17T13:21:18.470" Score="0" ViewCount="89" Body="&lt;p&gt;An ALM study produces several future real world interest paths, lets say the set consists of 5000 of such paths. What is the chance that one such path becomes reality? If in 50% of the paths the company goes bankrupt can we conclude that the probably of bankruptcy is 50%?&lt;/p&gt;&#xA;" OwnerUserId="13730" LastEditorUserId="848" LastEditDate="2016-12-17T13:47:28.417" LastActivityDate="2016-12-17T14:00:50.520" Title="Asset Liability Management, probabilty of realising the paths in a Monte Carlo simulation" Tags="&lt;monte-carlo&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31556" PostTypeId="2" ParentId="31555" CreationDate="2016-12-17T14:00:50.520" Score="1" Body="&lt;p&gt;No, you can't.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, these paths are created using assumptions that will not exactly hold in the real world and therefore the outcome of the simulation will never be an exact estimate of the real probability, independent of the number of simulations you use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if the assumptions approximately hold &lt;em&gt;and&lt;/em&gt; you create a sufficient amount of paths the percentage of paths end up in bankruptcy would hopefully come close to the real probability. At the very least they should give you some idea what the future might bring.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2016-12-17T14:00:50.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31557" PostTypeId="1" CreationDate="2016-12-17T16:50:42.863" Score="1" ViewCount="70" Body="&lt;p&gt;I do a lot of nonlinear parameter estimation, but do not have any experience in finance. I posted the following answer to a question about a EGARCH model on &#xA;cross validated.  I have copied the model description and&#xA;solution to here so that I have a self-contained question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the data if anyone is interested. My junk email address is xbobolson@gmail.com.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta y_{t} = \alpha + \sum^{12}_{j}\beta_{j}S_{j,t}(1 + \gamma_{1}D_{1,t} + \gamma_{2}D_{2,t}) + \varepsilon_{t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\ln(\sigma^2_{t}) = \omega_{0} + \sum^{2}_{i=1} \omega_{i} |\frac{\varepsilon_{t-i}}{\sigma_{t-i}}| + \lambda \frac{\varepsilon_{t-1}}{\sigma_{t-1}} + \omega_{3} \ln(\sigma^{2}_{t-1}) + \sum^{12}_{j}\delta_{j}|S_{j,t}|(1 + \rho_{1}D_{1,t} + \rho_{2}D_{2,t})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stats.stackexchange.com/questions/250274/additional-nonlinear-terms-in-the-egarch-model-maximum-likelihood-estimation&quot;&gt;https://stats.stackexchange.com/questions/250274/additional-nonlinear-terms-in-the-egarch-model-maximum-likelihood-estimation&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It took me  a while to develop a stable estimation scheme using AD Model Builder. I am curious to know from the GARCH experts if this is simple to do with some existing software.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; # Number of parameters = 35  Objective function value = -89.3242  Maximum gradient component = 7.45641e-05&#xA; # alpha:&#xA; -0.0184773755820&#xA; # beta:&#xA;  0.0776272250120 -0.0282086700728 0.0105870775566 -0.796727950111 -0.0329451864914 0.0574720791322 -0.00769006016788 0.0634996913172 -0.271844797702 -0.00148927676168 -0.107749917570 -0.0235315136652&#xA; # gamma:&#xA;  -1.28418932915 0.253708104907&#xA; # omega0:&#xA; -0.0288892906469&#xA; # omega:&#xA;  -0.0390792976332 0.0693366331859&#xA; # lambda:&#xA; -0.0174406066104&#xA; # ls1:    log standard deviations for periods 1 and 2&#xA; 0.521640582874&#xA; # omega3:&#xA; 0.995013839900&#xA; # delta:&#xA;  -0.0454107838910 0.0442755011514 0.0848044432830 -0.202324778947 -0.0184050276271 0.00891208520744 0.00954099100492 0.00610579281349 -0.0181269442505 0.0502826182040 -0.0135121954742 -0.143376988696&#xA; # rho:&#xA;  0.144999774670 1.88445900772&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25787" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2016-12-17T19:57:25.100" Title="Comments on solution to a rather complicated EGARCH model" Tags="&lt;volatility&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31559" PostTypeId="1" CreationDate="2016-12-17T20:26:03.550" Score="-1" ViewCount="45" Body="&lt;p&gt;How do you simulate an exponential random variable over an interval $[0, T]$  with $T &amp;gt; 0$?&lt;/p&gt;&#xA;" OwnerUserId="20360" LastEditorUserId="24222" LastEditDate="2016-12-18T00:27:22.767" LastActivityDate="2016-12-18T00:27:22.767" Title="How to simulate the exponential law over an interval of the form [0,T]?" Tags="&lt;distribution&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31560" PostTypeId="2" ParentId="31559" CreationDate="2016-12-17T21:31:32.533" Score="4" Body="&lt;p&gt;You should post on mathematics.stackexchange&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I answer but I should not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $X $ be an exponential r.v. of parameter $\lambda $&#xA;$$P (X&amp;lt;u|X &amp;lt;T)=\frac {P (X&amp;lt;min (u,T))}{P (X &amp;lt;T )} $$&#xA;So for $0\leq u\leq T$&#xA;$$P (X&amp;lt;u|X &amp;lt;T)=\frac {1-\exp (-\lambda u)}{1-\exp (-\lambda T)} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if $U $ is an uniform on $ [0,1]$ then&#xA;$$Y= -\frac {1}{\lambda }\ln\left (1-U (1-\exp(-\lambda T))\right) $$ is an exponential r.v. of parameter $\lambda $ conditionned to be on $[0,T] $&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2016-12-17T21:31:32.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31562" PostTypeId="2" ParentId="22446" CreationDate="2016-12-17T23:50:30.577" Score="2" Body="&lt;p&gt;I recently came across the same problem, though for different asset dynamics. I usually use one of two approaches:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;1) Symbolic Differentiation&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use a compute algebra system such as Mathematica or SymPy to get analytic expressions for the higher-order cumulants. The advantage is that you get exact expressions with no approximation errors. These can however get very lengthy and potentially lead to inefficient code. The fourth cumulant of the Heston model for example already spans half a page at 11pt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2) Automatic Differentiation&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use an automatic differentiation (AD) library that supports complex numbers. In C++ for example I use &lt;a href=&quot;https://www.coin-or.org/CppAD/&quot; rel=&quot;nofollow noreferrer&quot;&gt;CppAD&lt;/a&gt; from the COIN-OR project. You make your code AD-ready by templating the complex data type in your cumulant generating function implementation, i.e.&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;template&amp;lt;typename Type&amp;gt;&#xA;Type cumulantFunction(double maturity,&#xA;                      Type omega) const&#xA;{&#xA;    // your implementation&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The AD library can then compute exact derivatives of any order without you having to explicitly implement anything. See also &lt;a href=&quot;http://www.matthiasthul.com/wordpress/2016/05/17/automatic-cos-method/&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; blog post for some more details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Summary&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I prefer to use the analytic derivatives for performance-critical production code when feasible as I found that these are usually computed faster than via AD. For higher-order derivatives and/or relatively involved expressions I resort to AD. I also found that AD serves as a great tool for unit-testing hand-coded analytical derivatives.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2016-12-17T23:50:30.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31563" PostTypeId="1" AcceptedAnswerId="31566" CreationDate="2016-12-18T01:20:13.603" Score="13" ViewCount="598" Body="&lt;p&gt;The probability of the Fed raising rates 3 times in 2017 is above 45%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What data and formula is used to calculate this probability? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This Financial Times &lt;a href=&quot;https://www.ft.com/content/ffe008d2-c39d-11e6-9bca-2b93a6856354&quot; rel=&quot;noreferrer&quot;&gt;article&lt;/a&gt; is published on 17Dec2016.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;She portended that three rate rises were in the pipeline for next&#xA;  year, more than had been expected.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Second, the market actually believed her. The sharp rise in bond&#xA;  yields that has followed, with the US 10-year Treasury now yielding&#xA;  more than 2.6 per cent for the first time in more than two years,&#xA;  shows this.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;So does the fed funds futures market, where investors place bets on&#xA;  the future path of rates. On election eve, &lt;strong&gt;this market put the chance&#xA;  of three rate rises next year at less than 5 per cent. By Wednesday,&#xA;  before Ms Yellen spoke, this had risen to about 30. Now it stands just&#xA;  above 45 per cent.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="6190" LastEditorUserId="467" LastEditDate="2016-12-18T15:37:18.630" LastActivityDate="2016-12-22T00:19:13.367" Title="How is this probability (45%) of Fed raising rates 3 times in 2017 calculated from Fed Funds market?" Tags="&lt;interest-rates&gt;&lt;futures&gt;&lt;yield-futures&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31564" PostTypeId="2" ParentId="31548" CreationDate="2016-12-18T09:50:29.477" Score="1" Body="&lt;p&gt;&lt;strong&gt;Short answer&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;DV01(t) = \sum_{j=1}^N \alpha_j Z_t(t_j)&#xA;\end{equation}&#xA;with &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$DV01(t)$ the DV01 of the swap at time t&lt;/li&gt;&#xA;&lt;li&gt;$j$ the period number&lt;/li&gt;&#xA;&lt;li&gt;$\alpha_j$ the fraction of a year of the period $j$&lt;/li&gt;&#xA;&lt;li&gt;$Z_t(t_j)$ the discount factor from $t$ to $t_j-t$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Simple proof&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First let's define $\alpha_j$ as the fraction of a year of the period $j$ (time between two swap payments)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $Z_t(T)$ be the value of a zero-coupon bond of maturity $T$ at time $t$ (ie discount factor from $t$ to $T-t$). Then $Z_0(t)$ is today discount factor for maturity $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value of a swap $V_{swap}$ is the difference of its floating leg value $V_{float}$ and its fixed leg value $V_{fix}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At any time $t$, for an $N$-year swap between its start date $t_0$ and its end date $t_N$:&#xA;\begin{equation}&#xA;V_{float}(t) = Z_t(t_0) - Z_t(t_N)&#xA;\end{equation}&#xA;and&#xA;\begin{equation}&#xA;V_{fix}(t) = R_{fix} \times \sum_{j=1}^N \alpha_j Z_t(t_j)&#xA;\end{equation}&#xA;with $R_{fix}$ the fixed rate of the swap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value of the swap is&#xA;\begin{align}&#xA;\begin{split}&#xA;V_{swap}(t) &amp;amp;= V_{float}(t) - V_{fix}(t) &#xA;\\&#xA;&amp;amp;= Z_t(t_0) - Z_t(t_N) - R_{fix} \times \sum_{j=1}^N \alpha_j Z_t(t_j)&#xA;\end{split}&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us denote the DV01 of the swap by $DV01(t)$ at time $t$. It is defined as the partial derivative of the swap value with respect to the fixed rate of the swap $R_{fix}$&#xA;\begin{equation}&#xA;DV01(t) = \frac{\partial V_{swap}(t)}{\partial R_{fix}} = \sum_{j=1}^N \alpha_j Z_t(t_j)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Note that the minus sign can be added or removed depending if you are paying or receiving the swap)&lt;/p&gt;&#xA;" OwnerUserId="15650" LastActivityDate="2016-12-18T09:50:29.477" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31566" PostTypeId="2" ParentId="31563" CreationDate="2016-12-18T14:01:49.040" Score="9" Body="&lt;p&gt;Using the following data from 12/18/16:&#xA;Jan 2017 Fed funds futures =9936, &#xA;Jan 2018 Fed Funds futures =9877&#xA;implies that 99.36-98.77 = 59bp of hikes are built in for 2017.&#xA;IF you assume the only two possibilities are 2 hikes or 3 hikes (meaning, 50bp or 75bp of hikes, assuming each hike would be 25bp), then by simple linear interpolation the probability of 3 hikes must be (59-50)/(75-50)= 36%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above is a commonly used method when there are only two realistic possibilities, so the only data you need is the correct fed funds futures contract.  If there are more possibilities, you need to utilize the options market in order to obtain more information.  For example, if the Fed hikes 3 times the Fed fund futures will be at about 98.61.  We look at the options market:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Jan 2018 98.6875 put option = 0.095,&#xA;Jan 2018 98.625 put option = 0.0775,&#xA;Therefore Jan 2018 98.6875-98.625 put spread = 0.0175, &#xA;but the max payoff of this put spread is 0.0625&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so the implied probability of the put spread being in the money (ie futures&amp;lt;98.625) is 175/625 = 28%, a slightly different answer.  This is equivalent to the probability of at least 3 hikes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For some reason I'm not getting 45%, but the market may have moved, or the option prices i am using may be stale.  Anyway i hope this illustrates the methods typically used.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastEditorUserId="18388" LastEditDate="2016-12-18T20:18:23.203" LastActivityDate="2016-12-18T20:18:23.203" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31567" PostTypeId="1" CreationDate="2016-12-18T17:11:07.387" Score="14" ViewCount="502" Body="&lt;p&gt;Usually models in quantitative finance are taught by giving, let's say, stochastic differential equations, initial conditions, and then pricing, under the model, various derivatives written on the underlying. Qualifying a model as good or bad wrt the pricing of a given derivative is often done by saying that the model captures, in a rather pertinent way, &quot;quantities&quot; the derivative is sensitive to. (For instance the Black-Scholes model would be bad to price forward starting options as it fails, least to say, to capture movements of the forward implied volatility.) Then, we can compute the discounted P&amp;amp;L of the porfolio consisting in the sold derivative and underlyings (corresponding to a delta-hedge of the derivative).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now consider a european option of pay-out function &lt;span class=&quot;math-container&quot;&gt;$\varphi$&lt;/span&gt; and maturity &lt;span class=&quot;math-container&quot;&gt;$T$&lt;/span&gt; written on a (tradable) underlying &lt;span class=&quot;math-container&quot;&gt;$S$&lt;/span&gt;. Consider the aforementioned portfolio associated to this option and note &lt;span class=&quot;math-container&quot;&gt;$\Delta_t$&lt;/span&gt; the number of shares that we have in the portfolio at time &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt;. We can write (and it's quite classic) the discounted P&amp;amp;L of the portfolio over the options's lifetime as &lt;span class=&quot;math-container&quot;&gt;$$P\&amp;amp;L_0 = -e^{-\int_0^T r_S ds} \varphi (S_T) + \pi_0 + \int_0^T e^{-\int_0^t r_s ds} \Delta_t \left( dS_t - S_t r_t dt\right)$$&lt;/span&gt; where &lt;span class=&quot;math-container&quot;&gt;$\pi_0$&lt;/span&gt; is the price we make a time &lt;span class=&quot;math-container&quot;&gt;$t=0$&lt;/span&gt; on the option. Note that I only stress the dependance of &lt;span class=&quot;math-container&quot;&gt;$\Delta$&lt;/span&gt; in time, but it can, of course, depend on anything else. Note also that &lt;span class=&quot;math-container&quot;&gt;$P\&amp;amp;L_0$&lt;/span&gt; does not depend on any model specification for &lt;span class=&quot;math-container&quot;&gt;$S$&lt;/span&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is the following : without making any model hypothesis, that is, without specifying &lt;span class=&quot;math-container&quot;&gt;$dS_t$&lt;/span&gt; or &lt;span class=&quot;math-container&quot;&gt;$r_t$&lt;/span&gt;, is there a correspondance&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\{\textrm{set of hypotheses on $P\&amp;amp;L_0$}\}\to \{\textrm{models on $S$ under a certain measure}\}$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;such that for any given &quot;known&quot; model (BS, Heston, SABR, 3/2, 4/2, Bergomi's P1 etc) there exist a set of hypotheses on &lt;span class=&quot;math-container&quot;&gt;$P\&amp;amp;L_0$&lt;/span&gt; (for instance on its expectation, its variance that one would like for instance to minimize, on its others moments etc under some measure or under another, or something else) that &lt;em&gt;lead&lt;/em&gt; to the given model and the fondamental theorem of pricing associated to it ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By &lt;em&gt;lead&lt;/em&gt; I mean : wanting to prescrible/minimize some quantities associated to &lt;span class=&quot;math-container&quot;&gt;$P\&amp;amp;L_0$&lt;/span&gt; will lead to functional equations (variational, in fact) on the function &lt;span class=&quot;math-container&quot;&gt;$\Delta$&lt;/span&gt; that will lead to a PDE that will ultimately lead (through Feynman-Kac) to a model on &lt;span class=&quot;math-container&quot;&gt;$S$&lt;/span&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all : how to introduce dependance of &lt;span class=&quot;math-container&quot;&gt;$\Delta$&lt;/span&gt; in a parameter (in &lt;span class=&quot;math-container&quot;&gt;$S$&lt;/span&gt; for instance, to begin with, or later in realized variance) through assements/hypotheses on the &lt;span class=&quot;math-container&quot;&gt;$P\&amp;amp;L_0$&lt;/span&gt; ? How to retrieve the Black-Scholes model ? Other models ?&lt;/p&gt;&#xA;" OwnerUserId="13470" LastEditorUserId="13470" LastEditDate="2019-02-28T07:02:27.200" LastActivityDate="2019-02-28T07:02:27.200" Title="How to, from various hypotheses on the P&amp;L, get known models (BS, Heston etc ...)" Tags="&lt;black-scholes&gt;&lt;stochastic-processes&gt;&lt;stochastic-volatility&gt;&lt;delta-hedging&gt;&lt;stochastic-control&gt;" AnswerCount="1" CommentCount="15" FavoriteCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="31568" PostTypeId="2" ParentId="20799" CreationDate="2016-12-19T03:38:19.423" Score="2" Body="&lt;p&gt;Strategy A:  You borrow at 0% and invest at 0.24% for one year, so you make 0.24% total return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Strategy B:  You borrow at 0% and invest for one year at 0.80%, making 0.80%.  You then sell the 0.80% bond at a yield of 0.55% (it is now a 2yr bond, whose yield must be 0.55% if rates are unchanged).  The price of this bond will be 100.50%, since you are getting an extra 0.25% for an additional 2 years.  Hence your overall profit is 0.80% + 0.50% = 1.30%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore Strategy B is much better , assuming rates do indeed stay unchanged.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-12-19T03:38:19.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31569" PostTypeId="1" CreationDate="2016-12-19T04:09:44.340" Score="1" ViewCount="2800" Body="&lt;p&gt;I'm beginning to learn Portfolio Theory and I want to understand the Beta and its value for efficient portfolios. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An efficient portfolio is the one that gives the best expected return for an accepted level of risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since Beta is the systematic risk and is defined as the correlation of the asset with the market, will it always be lesser than 1 for an efficient portfolio or would it be proportional to 1, depending on what is invested in the market portfolio? &lt;/p&gt;&#xA;" OwnerUserId="17636" LastEditorUserId="467" LastEditDate="2016-12-22T09:22:48.417" LastActivityDate="2017-01-21T10:15:27.763" Title="What is the Beta of an efficient portfolio?" Tags="&lt;modern-portfolio-theory&gt;&lt;beta&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31572" PostTypeId="1" CreationDate="2016-12-19T10:45:07.037" Score="-1" ViewCount="182" Body="&lt;p&gt;If we assume normally distributed return (or normally distributed log Returns) for an asset and the market, can be then also say that the betas derived by this are also normally distributed?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How about time-varying betas calculcated by a rolling window OLS? Are they also normally distributed?&lt;/p&gt;&#xA;" OwnerUserId="25031" LastActivityDate="2016-12-20T04:43:29.007" Title="Finance beta: normally distributed?" Tags="&lt;beta&gt;&lt;normal-distribution&gt;&lt;log-returns&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31574" PostTypeId="2" ParentId="27933" CreationDate="2016-12-19T13:03:00.017" Score="2" Body="&lt;p&gt;This is an &lt;code&gt;implied mid&lt;/code&gt; price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If an illiquid market and/or quiet time of day to snap bid and ask prices, you may have an implied mid that is skewed (consider the case that a dealer offers at his mid to quickly close a position, but fails to find a buyer unless he hits a bid, crossing full B-A).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A better solution would be &lt;code&gt;weighted implied mid&lt;/code&gt;, pick the top five/ten quotes on the orderbook and average. Bloomberg does something very close to this on ALLQ.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;p(mid) = [SUM(i=1 to 5){bid(i)(p&lt;em&gt;vol)} + SUM(i=1 to 5){ask(i)(p&lt;/em&gt;vol)} ] / {SUM(i=1 to 5){bid(vol)+ask(vol)}}* 1/2&lt;/p&gt;&#xA;" OwnerUserId="21023" LastEditorUserId="21023" LastEditDate="2017-01-09T10:51:56.337" LastActivityDate="2017-01-09T10:51:56.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31575" PostTypeId="2" ParentId="24827" CreationDate="2016-12-19T13:09:15.737" Score="0" Body="&lt;p&gt;Bloomberg provides different types of licenses for different use cases (terminal, b-pipe, sapi, data license). If you have a terminal, the daily limit is 600K requests: # requests = # tickers x # fields x # (bdp,bdh,bds) formulas (i.e. bdh('AAPL US Equity','px_last','1/1/2000','1/1/2016' is one request). If you hit your daily or monthly limit, then your api will be blocked - if you try to retrieve more data you will get an error that you reached your limit. Bloomberg allows you to reset your limit once or twice per month. If you consistently hit your limit your sales rep will contact you trying to sell you a pay-per-use license. So, as long as you use terminal there is no way to be overcharged. Now, if you have sapi or another license which is pay-per-use it is possible to exceed original limits (bloomberg will not block you for retrieving more data) and be charged later for it.&lt;/p&gt;&#xA;" OwnerDisplayName="user18489" LastActivityDate="2016-12-19T13:09:15.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31576" PostTypeId="2" ParentId="10078" CreationDate="2016-12-19T13:43:56.307" Score="2" Body="&lt;p&gt;You will need to recal alpha beta and rho:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;dF_{t}&amp;amp;=\sigma _{t}F_{t}^{\beta }\,dW_{t}\\&#xA;d\sigma _{t}&amp;amp;=\alpha \sigma _{t}^{{}}\,dZ_{t}\\&#xA;\end{align*}&#xA;Where&#xA;$$dW_{t}dZ_{t}=\rho dt$$&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;alpha, volvol, lognormal vol of vol param sigma, alpha &gt;= 0. &lt;/li&gt;&#xA;&lt;li&gt;beta, skew, closed form soln only if in set {0,1}&lt;/li&gt;&#xA;&lt;li&gt;rho, correlation coefficient between two stochastic state variables forward price F and volatility of fwd price, sigma. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Parameters describe smile (richness of out of the money options) and the skew (whether implied vol is upward or downward sloping as a function of strike).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take a look at Matlab's implementation, which discusses two methods based on closed form,&#xA;&lt;a href=&quot;https://www.mathworks.com/help/fininst/calibrating-the-sabr-model.html?s_tid=gn_loc_drop&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.mathworks.com/help/fininst/calibrating-the-sabr-model.html?s_tid=gn_loc_drop&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="21023" LastEditorUserId="21023" LastEditDate="2016-12-27T17:07:01.750" LastActivityDate="2016-12-27T17:07:01.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31577" PostTypeId="1" AcceptedAnswerId="31587" CreationDate="2016-12-19T14:12:21.213" Score="4" ViewCount="536" Body="&lt;p&gt;Thanks very much for your help in advance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to understand the yield curve construction from Python Quantlib. And it seems I cannot get the curve output the same dates(nodes) as my input when using the FuturesRateHelper. Here is my code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;calc_date = ql.Date(18, 2, 2015)&#xA;ql.Settings.instance().evaluationDate = calc_date&#xA;&#xA;bussiness_convention = ql.ModifiedFollowing&#xA;daycount = ql.Actual365Fixed()&#xA;calendar = ql.JointCalendar(ql.UnitedStates(), ql.UnitedKingdom())&#xA;&#xA;depo_r = {ql.Period(1, ql.Weeks): float(0.001375),       &#xA;      ql.Period(int(1), ql.Months): float(0.001717), &#xA;      ql.Period(int(2), ql.Months): float(0.002112), &#xA;      ql.Period(int(3), ql.Months): float(0.002381) &#xA;    }&#xA;&#xA;depoHelpers = [ql.DepositRateHelper(ql.QuoteHandle(ql.SimpleQuote(depo_r[p])), &#xA;            p, &#xA;            0, calendar, bussiness_convention, False, daycount)&#xA;            for p in depo_r.keys()]&#xA;&#xA;&#xA;future_r = {ql.Date(17, 6, 2015): float(99.725),&#xA;            ql.Date(16, 9, 2015): float(99.585),&#xA;            ql.Date(16, 12, 2015):float(99.385),&#xA;            ql.Date(16, 3, 2016): float(99.16),&#xA;            ql.Date(15, 6, 2016): float(98.93),&#xA;            ql.Date(21, 9, 2016): float(98.715)&#xA;            }&#xA;&#xA;futuresHelpers =[ql.FuturesRateHelper(ql.QuoteHandle(ql.SimpleQuote(future_r[d])),&#xA;                                     d, 3,&#xA;                                     calendar, bussiness_convention,&#xA;                                     True, daycount,&#xA;                                     ql.QuoteHandle(ql.SimpleQuote(0.0)))&#xA;                   for d in future_r.keys() ]&#xA;&#xA;&#xA;helpers = depoHelpers + futuresHelpers&#xA;&#xA;curve = ql.PiecewiseFlatForward(0, calendar, helpers, daycount)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and here is my output when I printed &lt;strong&gt;curve.dates()&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;---------&#xA;February 18th, 2015&#xA;---------&#xA;February 25th, 2015&#xA;---------&#xA;March 18th, 2015&#xA;---------&#xA;April 20th, 2015&#xA;---------&#xA;May 18th, 2015&#xA;---------&#xA;September 17th, 2015&#xA;---------&#xA;December 16th, 2015&#xA;---------&#xA;March 16th, 2016&#xA;---------&#xA;June 16th, 2016&#xA;---------&#xA;September 15th, 2016&#xA;---------&#xA;December 21st, 2016&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am very confused as the the date of June 17, 2015 disappeared and several dates are also shifted from my input (e.g. Sep 21 2016 as in my input (which is an IMM date) but Sep 15 2016 was shown in the output). Why is it happening?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks for your help again.&lt;/p&gt;&#xA;" OwnerUserId="25808" LastActivityDate="2016-12-20T06:34:08.460" Title="Python Quantlib yield curve dates different than input" Tags="&lt;yield-curve&gt;&lt;python&gt;&lt;quantlib&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31579" PostTypeId="1" CreationDate="2016-12-19T15:34:44.627" Score="2" ViewCount="1008" Body="&lt;p&gt;I am trying to compute the calibration of an FX market volatility surface, and especially I want to retrieve the strikes from the deltas quoted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't have any trouble reverse-engineering the formulas for non premium-adjusted deltas. However, for many currency pairs, the convention is to use premium-adjusted deltas, which are not monotonic in strike. For example, for a premium-adjusted forward delta (Source: &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470683686&quot; rel=&quot;nofollow noreferrer&quot;&gt;Clark - FX Option Pricing - Chap3 p47&lt;/a&gt;):&#xA;$$&#xA;\Delta_{F;\%} = \omega\frac{K}{F_{0,T}}N(\omega d_{2})&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following &lt;a href=&quot;http://www.frankfurt-school.de/clicnetclm/fileDownload.do?goid=000000425413AB4&quot; rel=&quot;nofollow noreferrer&quot;&gt;this source, p14&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;One common solution to this problem is to search for strikes corresponding to&#xA;  deltas which are on the right hand side of the delta maximum.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What is the argument or the intuition behind this statement?&lt;/p&gt;&#xA;" OwnerUserId="24989" LastActivityDate="2016-12-19T15:34:44.627" Title="Conversion of a premium-adjusted delta to a strike" Tags="&lt;fx&gt;&lt;delta&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31582" PostTypeId="1" AcceptedAnswerId="31589" CreationDate="2016-12-19T23:20:45.227" Score="7" ViewCount="815" Body="&lt;p&gt;I want to price a quanto option using a Stochastic Volatility model (like &lt;a href=&quot;https://en.wikipedia.org/wiki/Heston_model&quot; rel=&quot;noreferrer&quot;&gt;Heston&lt;/a&gt; model, 1993).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Normally, what we do is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Calibrate the stochastic volatility model,&lt;/li&gt;&#xA;&lt;li&gt;draw a binomial tree consistent with the model, with numerous steps and&lt;/li&gt;&#xA;&lt;li&gt;derive the option price from the binomial tree.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This process is given as an example in &lt;a href=&quot;http://www.wiley.com/WileyCDA/WileyTitle/productCd-0470997893.html&quot; rel=&quot;noreferrer&quot;&gt;this&lt;/a&gt; book on page 284, where an European vanilla option is priced under a stochastic volatility model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what about for a quanto option? How can I draw a binomial tree to price this option? That is, a binomial tree that takes into consideration the correlation among the underlying asset and the exchange rate?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some way to apply a stochastic volatility model to price a quanto option? Could you please help me with the detailed steps?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The quanto option pricing formula is given in &lt;a href=&quot;http://www.frankfurt-school.de/clicnetclm/fileDownload.do?goid=000000200793AB4&quot; rel=&quot;noreferrer&quot;&gt;this&lt;/a&gt; paper.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[EDIT - being more specific]&lt;/strong&gt;&#xA;Suppose I already have:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The correlation among the underlying asset ($S$) and the exchange rate. I have it. I know it is, say, 0.7.&lt;/li&gt;&#xA;&lt;li&gt;I have a well calibrated Heston model for the volatilities of both the underlying asset ($S$) and the exchange rate.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I want to know:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How to get, from my Heston model, the volatilities that I need to put into the quanto option pricing formula? In the formula of &lt;a href=&quot;http://www.frankfurt-school.de/clicnetclm/fileDownload.do?goid=000000200793AB4&quot; rel=&quot;noreferrer&quot;&gt;this&lt;/a&gt; paper, the vols are supposed constant. How can I treat stochastic vols using this formula? I do not know what vols I shoul put into the quanto option pricing formula. I want to know how to get the vols that I need from the Heston model.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="25437" LastEditorUserId="25437" LastEditDate="2016-12-20T11:58:43.537" LastActivityDate="2017-01-30T08:34:17.557" Title="How to use a stochastic volatility model to price a quanto option" Tags="&lt;option-pricing&gt;&lt;implied-volatility&gt;&lt;stochastic-volatility&gt;" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="31583" PostTypeId="2" ParentId="21495" CreationDate="2016-12-20T01:27:45.180" Score="2" Body="&lt;p&gt;You can replace BM with FBM. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in finance, fBm is not a semi-martingale, the general results of mathematical finance in Delbaen and Schachermayer (1994) already imply that it allows a certain kind of arbitrage. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, Rogers (1997); Sottinen (2001); Cheridito et al. (2003); Bender and Elliott (2004); Bj¨ork and Hult (2005) have shown that the Black-Scholes model driven by fBm allows arbitrage in a number of ways.&lt;/p&gt;&#xA;" OwnerUserId="25655" LastEditorUserId="743" LastEditDate="2016-12-20T18:41:46.697" LastActivityDate="2016-12-20T18:41:46.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31584" PostTypeId="1" AcceptedAnswerId="31590" CreationDate="2016-12-20T04:27:03.360" Score="1" ViewCount="577" Body="&lt;p&gt;Is there a way to calculate the four 3-month LIBOR rates (spot and forward) given a 1-year spot LIBOR rate and a 1y1y forward LIBOR rate? &lt;/p&gt;&#xA;" OwnerUserId="25812" LastActivityDate="2016-12-20T08:35:39.407" Title="Calculating 3 month libor from 1 year libor?" Tags="&lt;option-pricing&gt;&lt;interest-rates&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31585" PostTypeId="2" ParentId="31572" CreationDate="2016-12-20T04:43:29.007" Score="-1" Body="&lt;p&gt;So you actually asked two questions, one regarding $\beta$ in raw form and one involving $\beta$ in log form.  For purposes of notation, I will distinguish $\beta_{raw}$ and $\beta_{log}$ as these are two very different questions.  If I am discussing a population parameter, then I will use $\beta$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a general note, there are two possible answers and the answer for finance, and also for cancer research, is different than the answer for something such as a prediction of warranty costs for new cars.  The reason has to do with the central limit theorem.  You can assume that $\beta_{raw}$ converges to a Student's t distribution for most things except stock and cancer, and the infrared divergence in quantum mechanics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In 1801 Laplace wrote a letter to Poisson with a proof for what used to be called the law of errors and is now called the central limit theorem.  He wanted Poisson to review his proof.  Poisson found a counter-example to the central limit theorem, but wrote that a mere footnote is required &quot;as we will, without a doubt, not encounter it in practice.&quot;  This language is unfortunate for two reasons.  First, this is correspondence between two of histories greatest mathematicians and a footnote for the greatest might need an entire book for the rest of us.  The second is that the statistics textbooks often omitted this exception, even in graduate works, because why add a footnote no one will need in practice.  Stocks sit inside this exception.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The next encounter with this problem was in 1851, 52, or 53, I no longer remember which year.  The great Augustin Cauchy had just derived a method of regression using the median.  Just to be clear, I should have written the Great Augustin Cauchy, not only because he was great, but because he knew he was great.  The lesser mathematician Bienayme' about a month later published proofs that OLS was the best method and Cauchy took this as an insult.  Most of the practical things we teach undergraduates come from Bienayme', including the misnamed Chebychev inequality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cauchy found a specific case where OLS and OLS type methods would always produce an incorrect answer, even with an infinite amount of data.  In fact it would not even be an approximation.  It was a variant on Poisson's original issue.  $\beta_{raw}$ is a form of an arithmetic mean, but for slopes.  Cauchy found a case, usually ignored now, where the distribution had no mean, only the zeroth moment exists.  As such, $\beta_{raw}$ is the estimator of a non-existent thing.  It would behave in a strange way, for time data, it would be time-varying.  For non-time data, it would simply vary from sample to sample, but not converge.  It would appear to have heteroskedasticity, or even time-varying heteroskedasticity, but in fact is askedastic.  You would even get runs that look like volatility clusters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The next appearance is in 1958 when John White solved the test statistic for the explosive root case of AR(1) problems.  It was generalized in 1962 by Rao for stochastic polynomials of any order with explosive roots.  Mann and Wald showed in 1943 that the estimator was the OLS estimator.  White showed that the distribution of the error term did not matter, provided it had finite variance greater than zero and a mean of zero.  This is important because it can have heteroskedasticity, or not. It could be Wishart distributed errors or normal, it didn't matter.  Pick ANY error structure and the test statistic was the same and was solved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem was, it was Cauchy's distribution that had no mean.  So the sampling distribution of $\beta_{raw}$ for equity securities is the Cauchy distribution.  The reason is can be found at &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2828744&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2828744&lt;/a&gt; where you can get an extended discussion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\beta_{log}$ is a different creature however.  The likelihood function is the hyperbolic secant distribution.  You can read why in the above paper.  It has a mean and a variance of a sort.  Returns in logs will converge to a hyperbolic secant distribution, in a Markowitz style world,with no liquidity costs and no bankruptcy or mergers.  It is heavy tailed, but not fat tailed.  The sampling distribution of a regression for the slopes will converge to normality as the sample becomes very large, but, you have to ignore the covariance matrix that OLS provides you.  The hyperbolic secant distribution has no covariance matrix implying that stocks can comove, but cannot covary.  Indeed, they are not independent and cannot be independent, yet they do not covary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The covariance matrix describes the uncertainty in the sample, but it does not point to a population parameter.  In this type of math $\sigma_{ij}$ does not exist as a population parameter.  The logarithmic form of regression points to Theil's median based regression for the raw data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It has been the assumption, since 1952, that some form of normality was present if we could just find the correct restrictions to put on a model.  Maybe if finance added ARCH or GARCH, or time-varying means, we could get to where we are going, but there was a warning in 1953 by John von Neumann that this branch of mathematics was as yet unsolved and that many things that looked like proofs at that time may turn out not to be proofs.  This branch of mathematics has been solved.  If you are getting weird effects in your $\beta_{raw}$ measurements, take a look at your tails.  Do they sit inside six $\sigma$?&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2016-12-20T04:43:29.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31586" PostTypeId="2" ParentId="31584" CreationDate="2016-12-20T06:03:00.030" Score="0" Body="&lt;p&gt;From 1 year interest rates you can calculate financial equivalent interest rates for other maturities, but not the interest rate of those maturities. &lt;/p&gt;&#xA;" OwnerUserId="25813" LastActivityDate="2016-12-20T06:03:00.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31587" PostTypeId="2" ParentId="31577" CreationDate="2016-12-20T06:34:08.460" Score="4" Body="&lt;p&gt;Each future gives you forward rate between &lt;code&gt;t1&lt;/code&gt; and &lt;code&gt;t2&lt;/code&gt;. This is very important, it gives you the rate for &lt;code&gt;t2&lt;/code&gt; from &lt;code&gt;t1&lt;/code&gt;. Thus, the bootstrap algorithm extracts a value for &lt;code&gt;t2&lt;/code&gt; &lt;strong&gt;NOT&lt;/strong&gt; &lt;code&gt;t1&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;June 17, 2015 is your &lt;code&gt;t1&lt;/code&gt;. It is the starting date of your future, which matures in three months. Sept 17, 2015 is the mature date, and it is indeed shown in your output.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, Sep 21 2016 is your &lt;code&gt;t1&lt;/code&gt;, your &lt;code&gt;t2&lt;/code&gt; is December 21st, 2016, again shown in your output.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remember, it's the date your instrument matures defines your curve tenors, not when it starts.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2016-12-20T06:34:08.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31588" PostTypeId="2" ParentId="17371" CreationDate="2016-12-20T07:38:03.593" Score="0" Body="&lt;p&gt;Interactive Brokers posted a recorded webinar at youtube on Dec 13 2016.&#xA;&lt;a href=&quot;https://www.youtube.com/watch?v=hogXB07OJ_I&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.youtube.com/watch?v=hogXB07OJ_I&lt;/a&gt;&#xA;The topic is to use IBridgePy, a flexiable and easy-to-use python tool to trade at IB. You can easily get the positions in IBridgePy.&lt;/p&gt;&#xA;" OwnerUserId="25612" LastActivityDate="2016-12-20T07:38:03.593" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31589" PostTypeId="2" ParentId="31582" CreationDate="2016-12-20T07:47:57.250" Score="5" Body="&lt;p&gt;If you consider Heston as your working modelling assumption to price quantos (caveat: you also need additional considerations regarding the fx dynamics and equity-fx dependence), then you should use the usual numerical methods associated to Heston (well, not Fourier transform-based methods since there are no semi-closed form formulae for quanto vanillas under Heston - I think the Stein&amp;amp;Stein stochastic vol model leads to something more tractable though), so Finite Differences or Monte Carlo.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What changes compared to standard Heston is that the dynamics of the (foreign) risky asset since it now needs to be expressed in the (domestic) risk-neutral mesure to be able to price quanto options as discounted payoff expectations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Contrary to what happens for quantos priced under correlated equity-fx GBMs (see &lt;a href=&quot;https://quant.stackexchange.com/questions/31181/which-volatilities-should-i-use-for-quanto-options&quot;&gt;this question&lt;/a&gt;), both the drift of the equity and that of its instantaneous variance get &quot;quanto-adjusted&quot; (consequence of Girsanov theorem with stochastic vol, assuming equity and vol driving Brownian motions are correlated). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;All that needs to be done - and it is not as easy as it seems in practice due to the absence of a liquid market, hence &quot;implied&quot; parameters, see the question which I have referred to earlier - is to specify parameters for the dependence structure between the various driving Brownian motions if your model (equity, variance, fx). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can get an idea of what awaits you by reading the following paper:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Dimitroff G., Szimayer A., Wagner A.]&lt;/strong&gt;, &lt;em&gt;Quanto Option Pricing in the Parsimonious Heston Model&lt;/em&gt;, Fraunhofer-Institut fur Techno- und Wirtschaftsmathematik, 2009&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is available &lt;a href=&quot;https://www.itwm.fraunhofer.de/fileadmin/ITWM-Media/Zentral/Pdf/Berichte_ITWM/2009/bericht_174.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; for download.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2016-12-20T15:44:25.597" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31590" PostTypeId="2" ParentId="31584" CreationDate="2016-12-20T08:35:39.407" Score="1" Body="&lt;p&gt;You can calculate the risk-free 2-year LIBOR rate based on what you have. You can impute the 3-month LIBOR rate if you have an overnight rate to start with. Then the 3-month LIBOR rate would depend on your assumptions (linear, constant forward, etc)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the 3-month forward LIBOR (forward starting point within 21 months), it's gonna be the result of imputation as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are basically trying to generate a curve based on two points.&lt;/p&gt;&#xA;" OwnerUserId="17835" LastActivityDate="2016-12-20T08:35:39.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31591" PostTypeId="1" CreationDate="2016-12-20T09:38:33.417" Score="4" ViewCount="646" Body="&lt;p&gt;Can some one help in creating step by step guide to learn Quantitative Finance?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The suggestions should be in the lines of&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1- Which Maths topics needs to be learn 1st&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2- Which Maths Books or resources should be used to learn the above topics&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3 - Once the Maths brush up is done which topics to do after that and in what order and which books&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4 - Any other suggestions&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The cost of a MFE is too high nowadays and CQF is also not that cheap, but there are many students/professionals out there who would like to learn the subject but doesn't have the means or time to do a Full Time Program. They would like to learn on their own but there is no definitive guide on which topics should be handled and in what order.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please help me build this list.&lt;/p&gt;&#xA;" OwnerUserId="20162" LastActivityDate="2016-12-20T09:55:44.450" Title="Step by Step Guide to Learn Quantitative Finance" Tags="&lt;stochastic-calculus&gt;&lt;finance-mathematics&gt;&lt;quantitative&gt;&lt;financial-engineering&gt;&lt;books&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ClosedDate="2016-12-20T12:15:28.630" ContentLicense="CC BY-SA 3.0" />
  <row Id="31592" PostTypeId="2" ParentId="31591" CreationDate="2016-12-20T09:55:44.450" Score="5" Body="&lt;p&gt;This thread will inevitably close because it doesn't meet community guidelines, but I respect your passion in this field and my best suggestion for you is that if you're trying to emulate a MFE education, go look up the course listings of any reputable MFE program, and then look into the sites for those (past) classes and see the recommended readings and resources.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2016-12-20T09:55:44.450" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31593" PostTypeId="1" CreationDate="2016-12-20T14:11:09.643" Score="0" ViewCount="1441" Body="&lt;p&gt;I would like to have the CDS for the main countries. Do you know where I could find these data free to use?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot&lt;/p&gt;&#xA;" OwnerUserId="22194" LastEditorUserId="21023" LastEditDate="2016-12-20T16:39:04.583" LastActivityDate="2016-12-20T22:44:37.040" Title="dataset on Credit Default Swap" Tags="&lt;data&gt;&lt;cds&gt;&lt;credit&gt;&lt;sovereign-cds&gt;" AnswerCount="2" CommentCount="0" ClosedDate="2017-01-18T19:51:51.100" ContentLicense="CC BY-SA 3.0" />
  <row Id="31594" PostTypeId="2" ParentId="31593" CreationDate="2016-12-20T15:16:34.303" Score="-1" Body="&lt;p&gt;Bloomberg &lt;code&gt;CDSX&lt;/code&gt;, or try a quick search:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.cnbc.com/sovereign-credit-default-swaps/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.cnbc.com/sovereign-credit-default-swaps/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.swapsinfo.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.swapsinfo.org/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="21023" LastEditorUserId="21023" LastEditDate="2016-12-20T22:44:37.040" LastActivityDate="2016-12-20T22:44:37.040" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31595" PostTypeId="2" ParentId="24780" CreationDate="2016-12-20T16:20:35.057" Score="4" Body="&lt;p&gt;This is an interesting exercise and would be compelled to see the results of your data gathering.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The principal purpose of treasury note (cash bond) analysis is for yields and the cross-asset class relative valuation where both provide signals. Alternatively, futures provide a technical analysis picture supplementary to yield dynamics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally I would attempt to combine both, although it depends on your strategies.&lt;/p&gt;&#xA;" OwnerUserId="21023" LastEditorUserId="21023" LastEditDate="2018-12-30T16:50:17.803" LastActivityDate="2018-12-30T16:50:17.803" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="31596" PostTypeId="1" AcceptedAnswerId="31603" CreationDate="2016-12-20T16:44:47.257" Score="3" ViewCount="876" Body="&lt;p&gt;Is it possible to bootstrap at least an approximate 6 month LIBOR curve (actually NIBOR, for Norway, in my case) if rates for 3 month FRAs are known? For example, say we know the rates for 1x4, 7x10, and 10x13 FRAs. Can we deduce any points on the 6 month curve?&lt;/p&gt;&#xA;" OwnerUserId="16684" LastActivityDate="2016-12-21T00:37:38.160" Title="6 month curve from 3 month forward rate agreements" Tags="&lt;libor&gt;&lt;bootstrapping&gt;" AnswerCount="2" CommentCount="7" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31597" PostTypeId="2" ParentId="31596" CreationDate="2016-12-20T19:21:56.420" Score="0" Body="&lt;p&gt;You would need spot rates to anchor on. For example, in addition to the forward rates, if you have one-month spot, then you can calculate four-month spot based on your forward. you can impute the spot between one and four months.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To your question specifically, if you have spot at one-month and seven-month, then you can impute the six-month spot. Other combination like four and seven would work, too. The idea to is have spots on both sides so that you can impute.&lt;/p&gt;&#xA;" OwnerUserId="17835" LastActivityDate="2016-12-20T19:21:56.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31598" PostTypeId="2" ParentId="31593" CreationDate="2016-12-20T20:02:02.480" Score="-1" Body="&lt;p&gt;You can have a look at &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.datagrapple.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;DataGrapple&lt;/a&gt; (there are sovereigns, for sure)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.otcstreaming.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;OTCStreaming&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;for data on credit default swaps.&lt;/p&gt;&#xA;" OwnerUserId="16457" LastActivityDate="2016-12-20T20:02:02.480" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31601" PostTypeId="2" ParentId="30839" CreationDate="2016-12-20T22:51:25.080" Score="1" Body="&lt;p&gt;Bunch of fines are due - they're also implicit in insider trading/cartel with unknown fiscal and regulatory consequences.&lt;/p&gt;&#xA;" OwnerUserId="21023" LastActivityDate="2016-12-20T22:51:25.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31603" PostTypeId="2" ParentId="31596" CreationDate="2016-12-21T00:37:38.160" Score="4" Body="&lt;p&gt;No, you can't. You can never deduce the 3M/6M basis spread from 3 month instruments alone. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you consider the OIS curve riskless, you can interpret the 3 month curve as riskless rate + additional cost for things like credit risk, liquidity and so on. The 6 month rate contains even more of these credit risk and liquidity cost. How much exactly though is impossible to say from 3 month rates alone. &lt;/p&gt;&#xA;" OwnerUserId="22686" LastActivityDate="2016-12-21T00:37:38.160" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31604" PostTypeId="2" ParentId="24780" CreationDate="2016-12-21T01:26:26.790" Score="6" Body="&lt;p&gt;It is preferable to use constant maturity yields (ideally par yields) for running PCA analyses. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using constant maturity par yields has several advantages:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;By definition, the yields are of constant maturity, so your results won't be distorted by &quot;rolls.&quot; When you use either rolling futures yields or on-the-run bond yields, there could be many breaks in the series as the CTD/on-the-run bond changes over time. Rolling futures are particularly bad. The US contract, for example, can trade like a 15-year note or 25-year bond depending on the interest rate environment.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Par yields are immune from coupon effect. If coupon rates gradually increase over time, the associate yield series would be biased downward if the yield curve is upward sloping (high coupon bonds trade at lower yields, all else equal). This makes it difficult to tell whether bonds are really richening, or perhaps we're just seeing a downtrend because of changing bond coupons. Of course, par rates don't suffer from this problem.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;As an example, let's say you're interested in looking at how TY (10-year contract) is trading relative to TU (2-year contract) and US (bond contract). You can potentially run a PCA analysis using 1.75y/6.75y/20y par yields (tenors approximate the maturities of current CTDs for the respective futures). The result will be much more robust than if you used rolling TU/TY/US yields.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2016-12-21T01:26:26.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31605" PostTypeId="2" ParentId="31569" CreationDate="2016-12-21T03:08:24.687" Score="2" Body="&lt;p&gt;When you say an efficient portfolio, I assume you mean a portfolio that lies on the efficient frontier, which is the most efficient portfolio in terms of risk-return trade-off, when we have only risky assets to chose from.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Different points/portfolios on the efficient frontier have different levels of risk and therefore different beta values.  However, the 'market' is just one of these efficient portfolios and is determined by the point at which a line starting from the risk-free rate of return on the y-axis is tangential to the efficient frontier, and this then determines the risk-level that is equivalent to a beta of unity.  The other efficient portfolios can then be assessed in relation to this one market portfolio in terms of the percentage of that market risk level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, once the market portfolio has been determined in this way, no rational person would invest in another portfolio on the efficient frontier.  This is because we now have a set of portfolios that supersedes the efficient frontier for all levels of risk except that of the market portfolio (where the line through the risk-free rate touches the efficient frontier).  This more efficient set of portfolios is the infinite set of combinations between just two assets - the risk-free asset and the one market portfolio asset.  If you put some of your money on deposit at the risk-free rate and the rest of your money in the one market portfolio then you will obtain a risk-return trade-off that is somewhere along the line between the risk-free rate and the market portfolio, i.e. your beta will be somewhere in between zero and 1.  The minute you borrow money at the risk-free rate and invest your own money plus the borrowed money in the one market portfolio then you will obtain a risk-return trade-off that is somewhere along the same* line but beyond the point representing the one market portfolio, this is what makes your beta greater than one - you are gearing yourself to the market.  The line joining the risk-free rate with the one market portfolio is what is called the 'Capital Market Line'.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Actually, it is not quite the same line, because the risk-free borrowing rate is in practice higher than the risk-free lending rate and so as compared to the line drawn from a mid-rate risk-free rate, the portion of the line to the left hand side of the market portfolio has a slightly lower starting point (and a slightly steeper gradient) and the portion beyond the market portfolio drops down a little (having a less steep gradient).  The Capital Market Line is in practice a kinked line.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Hope that helps.&lt;/p&gt;&#xA;" OwnerUserId="15609" LastActivityDate="2016-12-21T03:08:24.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31606" PostTypeId="1" AcceptedAnswerId="31634" CreationDate="2016-12-21T10:30:33.063" Score="2" ViewCount="513" Body="&lt;p&gt;Disclaimer: I have some knowledge of statistics, machine learning and probability theory, but next to zero knowledge of finance (I had to look up Wikipedia to refresh my knowledge of the difference between a bond and a stock), so please don't shoot the newbie :) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was reading &lt;a href=&quot;https://stats.stackexchange.com/q/252610/58675&quot;&gt;this question&lt;/a&gt; on Cross Validated, and I noted that some users (included the original poster) noted that the task of predicting the stock market was impossible. To be pedantic, I think they were actually referring to the simpler (?) task of predicting the future values of a specific stock price based on the stock price past values, not predicting the overall trend of the whole stock market, but you get my point. This is something which I've seen often in pop-finance books, and which is usually explained intuitively this way: if there was a model which could be used to predict reliably the future price of one or more stock, everyone would use it, this would affect the future stock exchanges and prices, changing the data generating process (the stochastic process corresponding to the stock price time series), and thus the model wouldn't work anymore. Another argument which is sometimes given is that market crises are never predicted (the subprime mortgage crisis, dot-com bubble, etc.).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;However,  there are companies, university degrees, research centers, etc. which work in the field of quantitative finance, so, even if the endeavor of predicting the stock and bond markets is understandably hard, there must be some degree of success. What is currently predictable with some margin of accuracy, and what is not? Concerning the level of the answer, I can follow you if you talk about expectation, stochastic processes, martingales, Monte Carlo and Markov Chain Monte Carlo, neural networks, etc.. However I've only heard about stuff such as the Black-Scholes equation, without knowing the actual details. I think I could understand if you explained me the concept, but I cannot say for sure.&lt;/p&gt;&#xA;" OwnerUserId="25822" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2016-12-22T22:27:11.563" Title="What is currently predictable in the stock and bond markets and what is not" Tags="&lt;equities&gt;&lt;bond&gt;&lt;prediction&gt;" AnswerCount="4" CommentCount="9" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31607" PostTypeId="2" ParentId="31606" CreationDate="2016-12-21T18:02:09.410" Score="1" Body="&lt;p&gt;I think, the popular consensus is that, while in general the stock prices are unpredictable, there are certain market regimes it's possible. That's pretty much the premise of a well-written book by Lo and MacKinlay: &lt;a href=&quot;http://press.princeton.edu/titles/6558.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://press.princeton.edu/titles/6558.html&lt;/a&gt; which I recommend. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of ML forecasting methods, it often translates to the situation, when the most difficult part is to figure out in what particular situations to use these forecasting methods, and not so much which particular type of a regression technique or a neural net is optimal.&lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2016-12-21T18:02:09.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31608" PostTypeId="2" ParentId="31606" CreationDate="2016-12-21T18:58:29.763" Score="3" Body="&lt;p&gt;The renowned CXO Advisory Group has a section &lt;a href=&quot;https://www.cxoadvisory.com/what-investing-approaches-work-best/&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;What Works Best?&quot;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here some general information is given and many links to their research articles which e.g. summarize lots of current academic research (although most of the linked articles are behind a paywall the links to the original papers are normally provided).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The article closes with &quot;In summary, strategic diversification and momentum and value strategies applied at the asset class level via low-fee funds (especially with momentum and value in combination) may be among the best approaches [...]&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In any case I think this is a valuable place to start. I myself have been a subscriber to their service for many years and it has helped me to keep some perspective.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2016-12-21T18:58:29.763" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31609" PostTypeId="1" AcceptedAnswerId="31617" CreationDate="2016-12-21T22:09:33.710" Score="1" ViewCount="1558" Body="&lt;p&gt;I'm trying to interpolate initial stub rate ( 'Index to' in the image ) for the following FRN pricing example.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Fixes on 2016/11/30&lt;/li&gt;&#xA;&lt;li&gt;1m : 0.623670&lt;/li&gt;&#xA;&lt;li&gt;2m : 0.742500&lt;/li&gt;&#xA;&lt;li&gt;3m : 0.93417&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Please be as specific as possible ( particularly day count convention ).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/fvTdx.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/fvTdx.gif&quot; alt=&quot;3m Floater&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3101" LastEditorUserId="21023" LastEditDate="2016-12-22T18:19:26.513" LastActivityDate="2016-12-22T18:19:26.513" Title="How does Bloomberg arrive at stub rate for swaps/floaters?" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;pricing&gt;&lt;bloomberg&gt;&lt;interpolation&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31610" PostTypeId="2" ParentId="31563" CreationDate="2016-12-22T00:19:13.367" Score="2" Body="&lt;p&gt;It is not taken from options. The numbers are taken from the &lt;a href=&quot;http://www.cmegroup.com/trading/interest-rates/countdown-to-fomc.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Fed Watch tool&lt;/a&gt; provided by the CME, who list the Fed Funds Futures. There entire methodology is available &lt;a href=&quot;http://www.cmegroup.com/trading/interest-rates/files/fed-funds-futures-probability-tree-calculator.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; - which details several examples.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you &quot;chain&quot; successive months you will get the same answer. You can see this by selecting Dec 2018 with the tool and seeing the probability is currently 25.7% (it has fallen in recent days).&lt;/p&gt;&#xA;" OwnerUserId="20194" LastActivityDate="2016-12-22T00:19:13.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31611" PostTypeId="1" AcceptedAnswerId="31614" CreationDate="2016-12-22T05:46:04.570" Score="10" ViewCount="2781" Body="&lt;p&gt;I am looking for a model that would allow me to predict the change in the Implied Volatility of an option based on a hypothetical change in the market. The goal is to create a better simulation of possible risks in an options based portfolio when it is exposed to market shocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When market conditions change, the price of an option adjusts to reflect the risk perceived by the market. This is observed as a change in calculated Implied Volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A common phenomenon is that when the price of a stock suddenly drops the associated options see an increase in risk premium and the calculated Implied Volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My goal is to have a model that allows me to quantify the range of potential changes based on a hypothetical change in market conditions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I realize that the goal is difficult and there may be no perfect answer but I need to find something that at least allows me to start the modeling process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know of any research papers or work in this area?&lt;/p&gt;&#xA;" OwnerUserId="19959" LastActivityDate="2017-03-18T16:37:33.393" Title="Model to Predict the Change in IV of an Option" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;modeling&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31612" PostTypeId="2" ParentId="31611" CreationDate="2016-12-22T08:12:47.117" Score="3" Body="&lt;p&gt;I would say that Derman's 99 paper on &quot;Regimes of Volatility&quot; (also called volatility &quot;stickiness assumptions&quot; by some practitioners) is an excellent place to start your investigations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.google.be/url?sa=t&amp;amp;source=web&amp;amp;rct=j&amp;amp;url=http://www.emanuelderman.com/writing/entry/regimes-of-volatility-risk-april-1999&amp;amp;ved=0ahUKEwj6ytjtrIfRAhXCMVAKHZsyByoQFggaMAA&amp;amp;usg=AFQjCNEn4vXDhHBc88Wq5sVMZ6pOohWnqw&amp;amp;sig2=nOBBW-t5T2VQO3WSr-W6uw&quot; rel=&quot;nofollow noreferrer&quot;&gt;Here&lt;/a&gt; is the paper and a &lt;a href=&quot;https://www.google.be/url?sa=t&amp;amp;source=web&amp;amp;rct=j&amp;amp;url=http://www.emanuelderman.com/media/smile-lecture9.pdf&amp;amp;ved=0ahUKEwj6ytjtrIfRAhXCMVAKHZsyByoQFggcMAE&amp;amp;usg=AFQjCNHDzoqi5MmVETmLlKRG-dseAUy20A&amp;amp;sig2=0IstaORf0eBmJiBzqqX8Kg&quot; rel=&quot;nofollow noreferrer&quot;&gt;lecture&lt;/a&gt; around it. Also see &lt;a href=&quot;https://quant.stackexchange.com/questions/26435/transition-between-volatility-regimes&quot;&gt;this&lt;/a&gt; related SE question.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2016-12-22T08:33:36.883" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31613" PostTypeId="2" ParentId="31611" CreationDate="2016-12-22T09:33:10.830" Score="3" Body="&lt;p&gt;You may be interested in these papers by Dumas et al. (1998) and Goncalves and Guidolin (2006). Here the abstracts:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-&lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.364.8005&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Dumas et al (1998):&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Black and Scholes (1973) implied volatilities tend to be systematically related to the option’s exercise price and time to expiration. Derman and Kani (1994), Dupire (1994), and Rubinstein (1994) attribute this behavior to the fact that the Black/Scholes constant volatility assumption is violated in practice. These authors hypothesize that the volatility of the underlying asset’s return is a deterministic function of the asset price and time. Since the volatility function in their model has an arbitrary specification, the deterministic volatility (DV) option valuation model has the potential of fitting the observed cross-section of option prices exactly. Using a sample of S&amp;amp;P 500 index options during the period June 1988 and December 1993, we attempt to evaluate the economic significance of the implied volatility function by examining the predictive and hedging performance of the DV option valuation model.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-&lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=651721&quot; rel=&quot;nofollow noreferrer&quot;&gt;Goncalves and Guidolin (2006)&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;One key stylized fact in the empirical option pricing literature is the existence of an implied volatility surface (IVS). The usual approach consists of fitting a linear model linking the implied volatility to the time to maturity and the moneyness, for each cross section of options data. However, recent empirical evidence suggests that the parameters characterizing the IVS change over time. In this paper, we study whether the resulting predictability patterns in the IVS coefficients may be exploited in practice. We propose a two-stage approach to modeling and forecasting the S&amp;amp;P 500 index options IVS. In the first stage, we model the surface along the cross-sectional moneyness and time-to-maturity dimensions, similarly to Dumas, et. al., (1998). In the second-stage, we model the dynamics of the cross-sectional first-stage implied volatility surface coefficients by means of vector autoregression models. We find that not only the S&amp;amp;P 500 implied volatility surface can be successfully modeled, but also that its movements over time are highly predictable in a statistical sense. We then examine the economic significance of this statistical predictability with mixed findings. Whereas profitable delta-hedged positions can be set up that exploit the dynamics captured by the model under moderate transaction costs and when trading rules are selective in terms of expected gains from the trades, most of this profitability disappears when we increase the level of transaction costs and trade multiple contracts off wide segments of the IVS. This suggests that predictability of the time-varying S&amp;amp;P 500 implied volatility surface may be not inconsistent with market efficiency.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pay attention that both paper “forget” to take into account the possibility of arbitrage in their estimation, so to do something meaningful you should implement some no arbitrage constraints while performing the regressions.&lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2016-12-22T09:33:10.830" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31614" PostTypeId="2" ParentId="31611" CreationDate="2016-12-22T09:40:49.163" Score="6" Body="&lt;p&gt;One approach that I have seen being used is to try to model the (joint) dynamics of the forward at-the-money volatility as well as its first one or two derivatives. The idea is to find a parametrization for each of these quantities that you can easily estimate from historical data. You will generally find that the sensitivities themselves have a significant term-structure. Here are a few references to get you started.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Forward At-the-Money&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the Hagan et al. (2002) SABR model, the parameter $\beta$ controls the dynamics of the forward at-the-money implied volatility, the so-called &quot;backbone&quot;. The corresponding implied volatility approximation is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\sigma \left( F_0(T), T \right) = \frac{\alpha}{F_0(T)^{1 - \beta}} \left( 1 + \left( \frac{(1 - \beta)^2 \alpha^2}{24 F_0(T)^{2(1 - \beta)}} + \frac{\rho \beta \nu \alpha}{4 F_0(T)^{1 - \beta}} + \frac{\left( 2 - 3 \rho^2 \right) \nu^2}{24} \right) T \right)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Within this model, we can approximate a change in the forward at-the-money volatility as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\sigma \left( F_0(T) + \Delta, T \right) \approx \sigma \left( F_0(T), T \right) \left( \frac{F_0(T) + \Delta}{F_0(T)} \right)^{\beta - 1}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e. you can estimate the parameter $\beta$ by regressing the change in the logarithmic at-the-money volatility on the change in the logarithmic forward. As mentioned before, you'll need to allow $\beta$ to be time-to-maturity dependent in practice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Derivatives&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of trying to model the dynamics of the at-the-money derivatives of the implied volatility smile directly, it makes sense to first introduce a normalization. Let for example&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;x(K, T) = \frac{\ln \left( K / F_0(T) \right)}{\sigma \left( T, F_0(T) \right) \sqrt{T}}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;be the number of at-the-money standard deviations that the strike $K$ is away from the forward of maturity $T$. Now compute the first few derivatives of the implied volatility smile as a function of this new moneyness measure. These normalized moneyness measures have a much milder term-structure and level-dependence. See for example Tompkins (2001) or Klassen (2016) who both use this normalization though in slightly different contexts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hagan, Patrick S., Deep Kumar, Andrew S. Lesniewski, and Diana E. Woodward (2002) &quot;Managing Smile Risk&quot;, Wilmott Magazine, pp. 84-108&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Klassen, Timothy R. (2016) &quot;Equity Implied Vols for All, Part 2: Implied Volatility Curve Design and Fitting&quot;, Presentation, Volar Technologies&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tompkins, Robert G. (2001) &quot;Implied Volatility Surfaces: Uncovering Regularities for Options on Financial Futures&quot;, European Journal of Finance, Vol. 7, No. 3&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2016-12-22T09:40:49.163" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31615" PostTypeId="2" ParentId="9760" CreationDate="2016-12-22T11:43:53.810" Score="2" Body="&lt;p&gt;Since Ecuador uses the US dollar, the appropriate rate to use for &lt;em&gt;discounting&lt;/em&gt; is the US dollar risk-free rate (i.e. the zero coupon rate bootstrapped from the overnight swap curve). The US dollar is the natural numeraire to use for valuing securities priced in US dollars.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, say that Ecuador five year notes with a coupon of 10.75% are currently trading at par, and the US discount curve is flat at $r = 2$%. Then by discounting under the risk-free rate, we see that the price would be&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\$141.12 = \$100 \times \exp(-5r) + \$10.75 \times \sum_{t=1}^5 \exp(-tr)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The actual price of $100 is obtained by discounting by the yield, which is about 10.21% (assuming the Ecuadorean yield curve is flat as well). The difference between the risk-free rate and the actual yield is the credit spread, which for Ecuador is 10.21% - 2% = 8.21%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This highlights a subtlety - although the relevant risk free rate is 2%, we do not reproduce the traded prices for Ecuadorean bonds by discounting at the risk free rate, because the market does not consider Ecuadorean bonds to be risk-free.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In recent times, very few (if any) government bonds are actually considered to be risk free, which raises the question of what rate to use for the risk-free rate in any country! In practice, the risk-free rate is taken from the overnight swap curve, and other rates are generally at a premium to this. For example, the US 10Y redemption yield is currently priced around 0.15% above the risk-free rate, reflecting the market's valuation of the credit risk in US government bonds.&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2016-12-22T11:43:53.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31616" PostTypeId="1" AcceptedAnswerId="31618" CreationDate="2016-12-22T12:19:55.820" Score="0" ViewCount="184" Body="&lt;p&gt;I am having trouble pricing options. Now please bear with me because I am a total noob. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given an american put option on the CL stock: &#xA;&lt;a href=&quot;https://i.stack.imgur.com/RjEnY.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/RjEnY.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The last price is 4.75\$, with an implied volatility of 19.97%.&#xA;The price of the underlying stock is currently 66.05\$.&#xA;The option expires in 13 months.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% Price of a European Call under Black-Scholes&#xA;function out = bs(S0, K, r, T, sigma) &#xA;&#xA;    d_1 = (log(S0/K)+(r+sigma^2/2)*T)/(sigma*sqrt(T));&#xA;    d_2 = d_1 - sigma*sqrt(T);&#xA;    out = S0*normcdf(d_1)-K*exp(-r*T)*normcdf(d_2);&#xA;&#xA;end&#xA;&#xA;r = 0.01;&#xA;S0 = 66.05;&#xA;K = 65.00;&#xA;T = 13/12;&#xA;sigma = 0.1997;&#xA;BS = bs(S0, K, r, T, sigma)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;BS = 6.3147&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My question: Why is my theoretical price higher than the empirical one? Is it due to supply and demand mechanics, or did I do something wrong with the parameters?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am aware that the bs function I use prices European options, and the CL option I provided is an American option. But as far as I know, American options tend to be more expensive. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help is greatly appreciated!&lt;/p&gt;&#xA;" OwnerUserId="16889" LastEditorUserId="16889" LastEditDate="2016-12-22T12:28:33.690" LastActivityDate="2016-12-22T12:37:53.790" Title="Options: theoretical vs empirical price" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="31617" PostTypeId="2" ParentId="31609" CreationDate="2016-12-22T12:23:25.117" Score="3" Body="&lt;p&gt;Basic money markets arithmetic. Using day count convention ACT/ACT,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;01 Dec 2016 to 13 Jan 2017 is 43 days,&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;(43-30)/(60-30)*(2m Libor - 1m Libor)+(1m Libor)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;= 0.675163&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="21023" LastEditorUserId="21023" LastEditDate="2016-12-22T12:40:05.307" LastActivityDate="2016-12-22T12:40:05.307" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31618" PostTypeId="2" ParentId="31616" CreationDate="2016-12-22T12:37:53.790" Score="2" Body="&lt;p&gt;I think the major problem is probably that you don't take dividends into account. As a consequence your forward is to too high and consequently your call price is too high.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, you don't take into account repos and your interest rate seems off. This again affects the forward.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, it is difficult to try to recover a market price given an implied volatility that you didn't compute yourself, at least for American options. The implied volatility is the diffusion coefficient that matches a model price with the market price. It thus depends not only on the other market parameters that were used in its computation but also the model implementation itself.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2016-12-22T12:37:53.790" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="31619" PostTypeId="1" AcceptedAnswerId="31620" CreationDate="2016-12-22T12:42:53.900" Score="3" ViewCount="243" Body="&lt;p&gt;I am trying to understand the economics of spoofing (I am a lay person). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that from a risk point of view, aside from the legal risk, the main risk is that of having a &lt;a href=&quot;https://quant.stackexchange.com/a/21058/994&quot;&gt;limit order filled before one can cancel it&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My main question is: on US exchanges, do professional participants also have to pay for canceling a limit order? (is there a deterministic cost to consider as well?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I understand that some brokers &lt;a href=&quot;https://www.interactivebrokers.com/en/?f=%2Fen%2Faccounts%2Ffees%2FcancelModifyExamples.php&quot; rel=&quot;nofollow noreferrer&quot;&gt;impose charges for canceled order&lt;/a&gt;. But presumably, these fee schedules are more relevant for retail investors. I'am specifically wondering about non retail HFT type operations.) &lt;/p&gt;&#xA;" OwnerUserId="994" LastEditorUserId="21023" LastEditDate="2018-04-02T18:10:19.250" LastActivityDate="2018-04-02T18:10:19.250" Title="Economics of spoofing" Tags="&lt;equities&gt;&lt;high-frequency&gt;&lt;pricing&gt;&lt;market-microstructure&gt;&lt;asset-pricing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31620" PostTypeId="2" ParentId="31619" CreationDate="2016-12-22T13:28:33.143" Score="4" Body="&lt;p&gt;Layering is a spoofing of buy(sell) orders sometimes complemented by higher(lower) sell(buy) orders that push the market up(down). Execution of a limit order above(below) would not be a concern, as your price objective is fulfilled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No charge to cancel orders in the most common exchanges, for example, EUREX futures and OTC FI instruments. In equity HFT would also suggest no charge as would be detrimental to exchange objective of an increased order book. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This article by Bloomberg's Matt Levine details how market making and layering activities could be a thinly separated line, &lt;a href=&quot;https://www.bloomberg.com/view/articles/2015-10-08/why-do-high-frequency-traders-cancel-so-many-orders-&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.bloomberg.com/view/articles/2015-10-08/why-do-high-frequency-traders-cancel-so-many-orders-&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, there exist order types in equity HFT exchanges that &lt;em&gt;protect&lt;/em&gt; the bid(offer) from being executed, unless trade conditions are met.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try KCG's excellent Demystifying Order Types, &lt;a href=&quot;https://www.kcg.com/uploads/documents/KCG_Demystifying-Order-Types_092414.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.kcg.com/uploads/documents/KCG_Demystifying-Order-Types_092414.pdf&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Financial risk, legal, moral all abound....&lt;/p&gt;&#xA;" OwnerUserId="21023" LastEditorUserId="21023" LastEditDate="2018-04-02T15:11:45.420" LastActivityDate="2018-04-02T15:11:45.420" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="31621" PostTypeId="1" CreationDate="2016-12-22T13:41:28.510" Score="0" ViewCount="35" Body="&lt;p&gt;I am doing some research on Germany, France and Spain on their spread.&#xA;I would like to try to 'forecast' or 'explain' the the spread on sovreign debt using OLS regression on unemployment and debt amount.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to ask you some suggestions on the methodology:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) To use OLS in time series all data shall be stationary but once I have stationarized them it works fine; right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Would you regress the spread between germany and france on unemployment of France or on the $\Delta$ between unemployment in france and germany?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) To forecast I would regress spread at time $t$ on variables at $t-1$, is it fine? To explain, on the other hand, both shall be at time $t$. Do you agree?&lt;/p&gt;&#xA;" OwnerUserId="22194" LastEditorUserId="21023" LastEditDate="2016-12-22T16:20:56.500" LastActivityDate="2016-12-22T16:20:56.500" Title="basic econometric model on country spread methodology" Tags="&lt;econometrics&gt;&lt;macro-economics&gt;&lt;macro&gt;&lt;methodology&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31622" PostTypeId="2" ParentId="31287" CreationDate="2016-12-22T15:53:49.327" Score="0" Body="&lt;p&gt;With respect to the implicit trading costs - it would be the following&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Spread - higher the spread, more the trading costs.&lt;/li&gt;&#xA;&lt;li&gt;Your trade size vs market volume over the same period.&lt;/li&gt;&#xA;&lt;li&gt;Volatility of the stock - for a high vol stock your counterparties would expect a higher premium to provide liquidity to you.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If you want to dig in deeper you can also look at cross impact on similar assets which is less well understood - for example if you trade SPY (the S&amp;amp;P 500 etf) your impact would not be limited to the price of SPY, but also S&amp;amp;P 500 futures and other S&amp;amp;P 500 linked derivatives. Another example might be Ford and GM - similar stocks in the same industry. If you influence the price of Ford by your trading, it would influence the price of GM too. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cims.nyu.edu/~almgren/papers/costestim.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;This&lt;/a&gt; paper is a good starting point for the academically oriented.&lt;/p&gt;&#xA;" OwnerUserId="25458" LastEditorUserId="25458" LastEditDate="2017-02-26T22:01:44.617" LastActivityDate="2017-02-26T22:01:44.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31623" PostTypeId="2" ParentId="31621" CreationDate="2016-12-22T16:01:33.380" Score="1" Body="&lt;p&gt;These are good questions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1: Yes. Similarly, consider absolute yield level as a regressand. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2: Regress on unemployment absolute AND difference. You can toss out any statistically insignificant (||&amp;lt;2).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3: Perhaps matching in time for observable and dependent variable is best; you can test lagged models, which is significant in the context of credit spread modelling where there is some degree of &quot;looking ahead&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may end up with multiple econometric models to test, no bad thing - here the art can be mathematicalised using &lt;a href=&quot;https://en.wikipedia.org/wiki/Akaike_information_criterion&quot; rel=&quot;nofollow noreferrer&quot;&gt;AIC&lt;/a&gt;/BIC or similar model selection methods. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;france credit spread = debt + relative debt spread + unemployment rate + relative unemployment spread&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="21023" LastActivityDate="2016-12-22T16:01:33.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31624" PostTypeId="1" AcceptedAnswerId="31627" CreationDate="2016-12-22T16:07:59.837" Score="-1" ViewCount="483" Body="&lt;p&gt;Is there any literature on trading strategies for illiquid equities markets, such as research papers or articles?  I've done some searching but haven't turned anything up.&lt;/p&gt;&#xA;" OwnerUserId="20987" LastActivityDate="2016-12-22T16:23:49.997" Title="Trading strategies for illiquid markets" Tags="&lt;equities&gt;&lt;quant-trading-strategies&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2016-12-23T17:27:50.193" ContentLicense="CC BY-SA 3.0" />
  <row Id="31626" PostTypeId="2" ParentId="25937" CreationDate="2016-12-22T16:21:00.380" Score="0" Body="&lt;p&gt;This forecast problem seems to stem from your perception of what forecasting might achieve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we were to estimate the next seasons Champions League winner, knowing only that Real won in 2016, we will probably perform poorly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if we follow player moves, understand coaching changes and the performance of each constituent team in a smaller league or higher frequency games, we may be able to add this to our forecasting decision.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Possibly the use of data harvesting and surveys in your business may prevent the stab-in-dark performance marks. Maybe business school can help...&lt;/p&gt;&#xA;" OwnerUserId="21023" LastActivityDate="2016-12-22T16:21:00.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31627" PostTypeId="2" ParentId="31624" CreationDate="2016-12-22T16:23:49.997" Score="1" Body="&lt;p&gt;Here's a research paper on that:&#xA;&lt;a href=&quot;https://pdfs.semanticscholar.org/f879/c1268cfadcd721dfabc643cf28434b88f556.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://pdfs.semanticscholar.org/f879/c1268cfadcd721dfabc643cf28434b88f556.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18555" LastActivityDate="2016-12-22T16:23:49.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31630" PostTypeId="1" CreationDate="2016-12-22T18:45:53.290" Score="1" ViewCount="247" Body="&lt;p&gt;there have been loads of papers on skews ATM / OTM, volatility premium and such. Lots of explanations for why iv is different on same stock with different strikes focused on preference of informed traders.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But is there a  model-based, non-behavioral explanation for the difference of implied vol for different strikes?  Could it be approached through state price distribution?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks and happy holidays&lt;/p&gt;&#xA;" OwnerUserId="25842" LastActivityDate="2016-12-27T01:09:25.707" Title="Question on implied vol (surface) and strikes" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;distribution&gt;&lt;stochastic&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31631" PostTypeId="2" ParentId="31630" CreationDate="2016-12-22T19:38:46.513" Score="1" Body="&lt;p&gt;This is an interesting question. I guess the fundamental belief is that any model serves the purpose of capturing what happens as aggregated behaviors in the market. Believe it or not, model also influences the market, especially when most of the transactions are done by people who utilize models (banks, funds, etc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The basic idea of vol smile is the uncertainty of (realized) vol, and thus the demand for additional risk premia. &lt;strong&gt;This is kinda non-behavioral, but not model-based.&lt;/strong&gt; It's an assumption but it checks out with the empirical observation. There's definitely some evolvement in people's views on the market. For a while in history, the vol was actually flat.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you believe this is true, then the vol smile is an natural derivation from the addition of vol of vol. But I'll try to explain from the model-perspective. Let's start from Black-Scholes model (with some behavioral explanation). By the way, &lt;strong&gt;This is model-based, but somewhat behavioral&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you plot the vega-gamma (second derivative of option price w.r.t vol) against the (log) strike from the Black-Scholes model, you would see a two-hump-shape curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/03Mjc.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/03Mjc.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if you long an ITM/OTM option, you are effectively long both vega and vega-gamma (since it's positive). And then you can short appropriate amount of ATM option to make vega-neutral (since ATM option has zero vega-gamma in Black-Scholes). Now you are long pure vega gamma, and whenever vol moves, you make money (if you believe that vol does move).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, we'd be happy to buy high/low strike options if vol is flat, effectively ATM/OTM option prices are bid up, therefore the implied vol. This works for both high/low strikes, leading to a smile in vol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similar approach can be used to explain the vol skew (risk-reversal) by looking at vega-dspot, but I'll leave it out for now since it's not exactly what OP was asking about.&lt;/p&gt;&#xA;" OwnerUserId="17835" LastEditorUserId="17835" LastEditDate="2016-12-23T19:32:07.177" LastActivityDate="2016-12-23T19:32:07.177" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31633" PostTypeId="2" ParentId="31606" CreationDate="2016-12-22T21:04:59.007" Score="2" Body="&lt;p&gt;I think you have a small misunderstanding in terms of what the folks with all of the various incarnations of quantitative degrees are doing.  There are always people trying to punt on the direction of the stock market for sure - and there is always an appetite with investors to try to outperform the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you are missing is that humanity is net long assets as a whole.  That means that people have investments that need to be managed.  What do you do with those investments?  How to manage them?  Lend them?  Optimize them to suit certain objectives (think of pensions and insurers).  So many of the  quantitative people in finance work on these kinds of problems.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many banks will have teams of quantitative people working to improve the process of lending their shares and properly collateralizing them.  Just as one example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think a lot of times quantitative people are disappointed when they get to a finance job and realize that they are not going to be predicting where a stock is going but are instead trying to solve a problem like figuring out which broker is giving the best value for their execution services. &lt;/p&gt;&#xA;" OwnerUserId="20092" LastActivityDate="2016-12-22T21:04:59.007" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31634" PostTypeId="2" ParentId="31606" CreationDate="2016-12-22T22:27:11.563" Score="1" Body="&lt;p&gt;I'll add my two cents even though there have been a couple of answers. In terms of the actual price of stock XYZ tomorrow, it's not likely to be predicable. The price is an combination of both market move and individual stock move, and all come down to supply and demand. There are market research that gives all kinds of target prices, but are mostly just used to advertise to clients.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But just like you can forecast weather based on both historical information and surrounding atmosphere, you can generate some subjective view in terms of the stock price changes (going up or down) based on your experience and observation of the current market, just like what day traders do. In this case, other people may have gotten similar view and started actions before you do, so price would have changed already. That's called factor-in or price-in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In some scenarios, &lt;strong&gt;certain people can predict the stock price because of information asymmetry&lt;/strong&gt;, e.g. knowing ahead of time the earning announcement details. Some other people may piggy-back one way or another (could even be their alphas), while most of the uninformed traders just trade randomly and get exploited. It's essentially a zero-sum game. I've heard that most of the liquidity in the US stock market comes from institutional trading, but still, some institutions are better than others.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Down to the micro-structure level, &lt;strong&gt;stock-price is predictable if you look at tick-by-tick&lt;/strong&gt;. The market orders are highly autocorrelated. This is likely because of order execution. This regime is not accessible to average people though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not being able to predict stock price doesn't mean you can't make money by investment. The fundamental theory of investment is risk-reward trade-off. You can form/sort your portfolio based on some criteria and hope for growth better than the market portfolio (based on SP500 for example). The relative value here is probably more predictable than individual stock prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The quant finance people don't necessarily care about the price levels, as a lot of the theories are based risk-neutral assumptions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In summary, I don't think that the exact level of stock/bond price is predicable, but it shouldn't affect a lot of the quant finance work.&lt;/p&gt;&#xA;" OwnerUserId="17835" LastActivityDate="2016-12-22T22:27:11.563" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31635" PostTypeId="1" CreationDate="2016-12-22T22:55:43.677" Score="0" ViewCount="516" Body="&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe there is no way to get explicit solutions for basket options (maybe the Black-Scholes differential equation can't be solved directly ??).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q3:&lt;/strong&gt; How do you price and hedge ( S1(T) + S2(T) - K )+ at time t. S1 evolves in $ S2 evolves in €, and the flows are in \$ ??&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An alternative solution (if S1 and S2 were in $) might be Monte-Carlo simulation of S1 and S2 under risk-free hypothesis. The hedging is done using finite differiation method in the simulations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you already ;D&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Guillaume&lt;/p&gt;&#xA;" OwnerUserId="25844" LastEditorUserId="25844" LastEditDate="2016-12-29T20:48:20.707" LastActivityDate="2017-02-28T01:06:55.280" Title="How to price a quanto basket option?" Tags="&lt;option-pricing&gt;&lt;hedging&gt;&lt;finance-mathematics&gt;&lt;price&gt;&lt;financial-engineering&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31636" PostTypeId="2" ParentId="19081" CreationDate="2016-12-22T23:00:18.540" Score="2" Body="&lt;p&gt;Just brainstorming here, could you possibly approach risk of an option from a probabilistic perspective?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because the price of the option ($S - X$, where $S$ is lognormally distributed) is lognormally distributed with the same standard deviation as $S$ (aside from being truncated at 0 and having the probability go to infinity as $S$ decreases or $X$ increases, which would pose issues) we can assume that the volatility of the distribution of $P$ is most sensitive to changes in $\sigma_S$, not $S$. Therefore, based on the historical distribution of $\sigma_S$, could you not compute the implied distribution of values of the price of the option?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially run a low-iteration Monte Carlo sampling from the historical distribution of volatility, then use the output of option prices to estimate a distribution of returns for $P$, and therefore the risk. Just find the optimal volatility by running volatility for different periods and finding which one most closely matches the current implied vol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that the math to support this is completely absent and there is likely a huge flaw in the assumptions made, but it may be a solution. Just choose a holding period and only calculate for that one $t$, or iterate across all $t$ and have a dynamic volatility that would require automatic rebalancing. &lt;/p&gt;&#xA;" OwnerUserId="19473" LastActivityDate="2016-12-22T23:00:18.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31637" PostTypeId="1" CreationDate="2016-12-23T04:06:59.910" Score="0" ViewCount="29" Body="&lt;p&gt;As time passes, outside of inflation, the buying power of an individual changes relative to their peers wealth. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I measure the effect wealth inequality has relative to one's savings? &lt;/p&gt;&#xA;" OwnerUserId="1098" LastActivityDate="2016-12-23T16:17:20.170" Title="How can I measure wealth gain (loss) due to inequality?" Tags="&lt;inflation&gt;&lt;theory&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31639" PostTypeId="2" ParentId="9629" CreationDate="2016-12-23T15:37:35.283" Score="0" Body="&lt;p&gt;I'm going to question your initial assumption.  The volatility smile is always there.  Ultimately all the volatility smile means is that low probability payout options imply a higher volatility than higher probability ones.  Simple example being the AAPL 10000 call will imply a higher vol than the AAPL 100 call.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is an intuitive mechanical reason why this &lt;em&gt;HAS&lt;/em&gt; to be.  Many of the out of the money options are worth something like .00001.  But generally they will have to be quoted and trade in some increment like .01 or .05.  So just market structure (for listed options) will force some kind of minimum price - and that's more than the ATM vol justifies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But more importantly, as people we always worry too much about low probability events.  We pay too much for lottery tickets, we agree to settle cases that we know we should win, etc.  All that behavioral stuff that has been true since the dawn of time.  That drives people to price up a little bit the tails for options.  Just imagine telling your boss that you sold the AAPL 300 call JAN 18 for .005.  &quot;But I sold it for an iVol of 25!&quot;  No, you would just get fired.  &lt;/p&gt;&#xA;" OwnerUserId="20092" LastActivityDate="2016-12-23T15:37:35.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31640" PostTypeId="2" ParentId="31637" CreationDate="2016-12-23T16:17:20.170" Score="1" Body="&lt;p&gt;Economists generally think of three similar, but distinct, metrics of economic disparity: inequality of income, consumption and wealth. Income inequality is the most commonly cited measure, consumption inequality, though harder to measure, provides a better proxy of social welfare. Wealth is also an important metric since it can be inherited, unlike income. Most people would use the Gini coefficients to measure all three.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This &lt;a href=&quot;https://www.equalitytrust.org.uk/how-economic-inequality-defined&quot; rel=&quot;nofollow noreferrer&quot;&gt;article&lt;/a&gt; might be of use.&lt;/p&gt;&#xA;" OwnerUserId="13533" LastActivityDate="2016-12-23T16:17:20.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31645" PostTypeId="1" CreationDate="2016-12-24T11:33:09.397" Score="1" ViewCount="183" Body="&lt;p&gt;I'm wondering how we can price a european swaption with a floor on the floating leg.&#xA;Assuming that we use the HW 1 factor model, how we can simultaneously calibrate the swaption ( on swap rate volatility) and the floor (on the libor volatility).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you have any idea how to do this?&lt;/p&gt;&#xA;" OwnerUserId="25203" LastEditorUserId="467" LastEditDate="2016-12-24T13:47:51.130" LastActivityDate="2016-12-24T13:47:51.130" Title="How to prrice a European swaption with floor?" Tags="&lt;option-pricing&gt;&lt;calibration&gt;&lt;swaption&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31646" PostTypeId="2" ParentId="31645" CreationDate="2016-12-24T13:26:06.417" Score="1" Body="&lt;p&gt;You can't.   In a 1 factor model, if you calibrate the libor floor to market, then the swaption prices in the model are likely to be too high versus the market.  That's because the difference between swaption prices and cap/floor prices is determined chiefly by the expected decorrelation between different parts of the swap curve , which is not present in the model.  You need a richer model such as a multifactor and/or term structure model in order to achieve this.   &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-12-24T13:26:06.417" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31648" PostTypeId="1" AcceptedAnswerId="31652" CreationDate="2016-12-24T15:43:56.950" Score="3" ViewCount="274" Body="&lt;p&gt;I have a following stochastic integral - related problem that I have difficulty to solve: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given &#xA;\begin{equation}&#xA;dX_t = -\alpha X_tdt+\sigma\sqrt{X_t}dW_t&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the second moment of $X_t$ is denoted by $m^{(2)}_t=\mathbb{E}(X_t^2)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you prove that $m^{(2)}_t$ has the following expression: &#xA;\begin{equation}&#xA;m^{(2)}_t=\frac{\sigma^2}{\alpha}X_0\exp(-\alpha t)+(X^2_0-\frac{\sigma^2}{\alpha}X_0)\exp(-2\alpha t)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can give you the expression of $d(X_t^2)$ just to save some time:&#xA;\begin{equation}&#xA;d(X_t^2)=-2\alpha X^2_t dt+2\sigma X_t\sqrt{X_t} dWt+\sigma^2 X_t dt&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks!!&lt;/p&gt;&#xA;" OwnerUserId="22427" LastEditorDisplayName="user16651" LastEditDate="2016-12-25T12:24:10.390" LastActivityDate="2016-12-25T12:24:10.390" Title="Moment Ito's Process Proof" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;&lt;itos-lemma&gt;&lt;sde&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31649" PostTypeId="2" ParentId="31648" CreationDate="2016-12-24T16:16:02.967" Score="3" Body="&lt;p&gt;Set $f(t,x)=xe^{\alpha t}\in\mathbb{C}\left([0,\infty)\times\mathbb{R}\right)$. By application of Ito's lemma, we have&#xA;$$d\left(X_te^{\alpha t}\right)=\alpha e^{\alpha t}X_t dt+e^{\alpha t}dX_t +\underbrace{d[e^{\alpha t},X_t]}_{0}\tag 1$$&#xA;thus&#xA;$$d\left(X_te^{\alpha t}\right)=\sigma e^{\alpha t}\sqrt{X_t}dW_t\,. \tag 2$$&#xA;By Integration on $[0,t]$, we have&#xA;$$X_te^{\alpha t}=X_0+\sigma \int_{0}^{t}e^{\alpha s}\sqrt{X_s}dW_s \tag 3$$&#xA;therefore&#xA;$$X_t=X_0e^{-\alpha t}+\sigma \int_{0}^{t}e^{-\alpha (t-s)}\sqrt{X_s}dW_s \, .\tag 4$$&#xA;Now calculate $\mathbb{E}[X_t]$ and $\text{Var}(X_t)$ and apply&#xA;$$\mathbb{E}[X_t^2]=\text{Var}(X_t)+\mathbb{E}[X_t]^2\tag 6$$&#xA;&lt;strong&gt;Note&lt;/strong&gt;&#xA;$$\mathbb{E}[X_t]=X_0e^{-\alpha t}\tag 7$$&#xA; and&#xA;$$\text{Var}(X_t)=\mathbb{E}\left[\left(\sigma \int_{0}^{t}e^{-\alpha (t-s)}\sqrt{X_s}dW_s\right)^2\right]=\sigma^2 \int_{0}^{t}e^{-2\alpha (t-s)}\mathbb{E}\left[X_s\right]ds\tag 8$$&#xA;therefore&#xA;$$\text{Var}(X_t)=\frac{X_0\sigma^2}{\alpha}(e^{-\alpha t}-e^{-2\alpha t})+X_0^2e^{-2\alpha t}\tag 9$$&#xA;&lt;strong&gt;More details&lt;/strong&gt;&#xA;$$\mathbb{E}[X_t^2]=\text{Var}(X_t)+\mathbb{E}[X_t]^2=\frac{X_0\sigma^2}{\alpha}(e^{-\alpha t}-e^{-2\alpha t})+X_0^2e^{-2\alpha t}+X_0^2e^{-2\alpha t}\tag{10}$$&#xA;then&#xA;$$\mathbb{E}[X_t^2]=\frac{\sigma^2}{\alpha}X_0e^{-\alpha t}+(X^2_0-\frac{\sigma^2}{\alpha}X_0)e^{-2\alpha t}\tag{11}$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2016-12-24T16:58:46.073" LastActivityDate="2016-12-24T16:58:46.073" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="31650" PostTypeId="2" ParentId="24450" CreationDate="2016-12-24T19:11:15.490" Score="1" Body="&lt;p&gt;Try out &lt;a href=&quot;http://docs.intrinio.com/#company-news&quot; rel=&quot;nofollow noreferrer&quot;&gt;Intrinio's api&lt;/a&gt;. It isn't free but it's the cheapest I've come across for a retail investor (and I was actually suggested them by Xignite employee who suggested that they might be a good fit). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I write a C# wrapper for their API, but am not associated.. unfortunately I didnt need, and so didnt implement, the functionality to get the news data, but if you want to contribute at all, please feel free to do so, see &lt;a href=&quot;https://github.com/daleholborow/iayos.intrinioapi&quot; rel=&quot;nofollow noreferrer&quot;&gt;my intrinio wrapper source and feel free to make contributions&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="22730" LastActivityDate="2016-12-24T19:11:15.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31652" PostTypeId="2" ParentId="31648" CreationDate="2016-12-24T21:06:28.490" Score="1" Body="&lt;p&gt;&lt;strong&gt;Another way&lt;/strong&gt;&#xA;\begin{equation}&#xA;X_t^2=X_0^2-2\alpha \int_{0}^{t}X^2_s ds+2\sigma\int_0^t X_s\sqrt{X_s} dW_s+\sigma^2\int_{0}^{t} X_s ds&#xA;\end{equation}&#xA;thus&#xA;$$\mathbb{E}[X_t^2]=X_0^2-2\alpha\int_{0}^{t}\mathbb{E}[X^2_s] ds+\sigma^2\int_{0}^{t} \mathbb{E}[X_s] ds$$&#xA;As you saw in the first answer, &#xA;$\mathbb{E}[X_s]=X_0^2e^{-\alpha s}$,&#xA;thus&#xA;$$\mathbb{E}[X_t^2]=X_0^2-2\alpha\int_{0}^{t}\mathbb{E}[X^2_s] ds-\frac{\sigma^2}{\alpha}X_0^2\left(e^{-\alpha t}-1\right) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Set $m(t)=\mathbb{E}[X_t^2]$, we have&#xA;$$m(t)=X_0^2-2\alpha \int_0^t m(s)ds-\frac{\sigma^2}{\alpha}X_0\left(e^{-\alpha t}-1\right)$$&#xA;Take differentiate with respect to time,&#xA;$$m'(t)=-2\alpha\,m(t)+\sigma^2 X_0\,e^{-\alpha t}$$&#xA;In other words&#xA;$$m'(t)+2\alpha\,m(t)=\sigma^2 X_0\,e^{-\alpha t}$$&#xA;This ODE is a First-order equation ,&#xA;$$\mu(t)=e^{\int {2\alpha } dt}=e^{2\alpha t}$$&#xA;and &#xA;$$m(t)=\frac{1}{e^ {2\alpha t}}\left(\sigma^2 X_0 \int e^ {2\alpha t}e^ {-\alpha t}dt+c\right)$$&#xA;where $c$ is a constant, we have&#xA;$$m(t)=e^ {-2\alpha t}\left(\frac{\sigma^2 X_0}{\alpha}e^{\alpha t} +c\right)$$&#xA;on the other hand $m(0)=X_0^2$ and $m(0)=\frac{\sigma^2 X_0}{\alpha}$, therefor $c=X_0^2-\frac{\sigma^2 X_0}{\alpha}$. Finall we have&#xA;$$m(t)=\frac{\sigma^2}{\alpha}X_0e^{-\alpha t}+\left(X^2_0-\frac{\sigma^2}{\alpha}X_0\right)e^{-2\alpha t}$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastActivityDate="2016-12-24T21:06:28.490" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31653" PostTypeId="1" AcceptedAnswerId="31687" CreationDate="2016-12-25T00:53:20.160" Score="1" ViewCount="781" Body="&lt;p&gt;I am trying to model the stock's price process. Let's assume volatility and risk-free rate is given. I've come up with the code below to try and model the price process with the geometrical Brownian motion. This should take into account risk-free rate and dividend yield q.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S_t = S_0  \exp\left(\left[r-q-\frac 12\sigma^2\right]t + \sigma W_t\right)$$&#xA;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;% initial price, time, risk-free rate, dividend yield pct, volatility&#xA;% p = simPrice(66, 365, 0.0088, 0.0236, 0.2);&#xA;&#xA;function [path] = simPrice(initialPrice, days, r, q, sigma)&#xA;&#xA;    path = zeros(1, days+1);&#xA;    path(1) = initialPrice;&#xA;    for t=1:length(path)-1&#xA;        path(t+1) = nextSt(path(t), (1/days), r, q, sigma);&#xA;    end&#xA;&#xA;end&#xA;&#xA;function [ expected ] = nextSt(initial, t, r, q, sigma)&#xA;&#xA;    n = randn();&#xA;    expected = initial * exp( (r - q -(0.5 * (sigma^2)))*t + sigma*sqrt(t)*n);&#xA;end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, as I am quite new to this, I'd like some reassurance that this is indeed correct. I feel like the price process is a bit jumpy? I am particularly worried that I am doing something wrong in the nextSt(..) function. This could be either in the formula inside the function itself (am I implementing the $W_t$ part of the formula correctly?) or the parameters I pass to it. For example, I am not sure if I am doing the time parameters right here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/YYImZ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/YYImZ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that I am using annualised volatility, dividend yield and risk-free rate. The next St is always computed over one day. So shouldn't I have to convert those parameters to daily values by dividing by $sqrt(252)$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the result when I do so:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/OFbNc.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/OFbNc.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The results on the first graph seem more plausible, but the parameters I used there make no sense?&lt;/p&gt;&#xA;" OwnerUserId="16889" LastEditorUserId="16889" LastEditDate="2016-12-25T14:59:01.317" LastActivityDate="2016-12-27T15:34:41.070" Title="Matlab implementation for modelling stock price process" Tags="&lt;stochastic-processes&gt;&lt;programming&gt;&lt;brownian-motion&gt;&lt;modeling&gt;&lt;wienerprocess&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31654" PostTypeId="2" ParentId="18613" CreationDate="2016-12-25T13:21:45.847" Score="2" Body="&lt;p&gt;Loxol's answer is right. As long as you change your scale, your condition also changes, you can not more assume $\sigma_b&amp;gt;\sigma_a$ as you need also amend your condition in order to match your new rescaled process. Loxol already give the way of constructing new condition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you mentioned $\sigma_b&amp;gt;\sigma_a$ hold only for $B_t$ and $A_t$, this cannot be transferred to the new process. Consider $\sigma_b^2=1/2$ and $\sigma_a^2=1/4$, $B_t$ is more volatile than $A_t$. However, $\tilde B_t$ has $1/8$, which is not necassary volatile than $A_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is caused by changing the volatility structure with multiplication of $\sigma_A^2$. If $\sigma_A^2&amp;gt;1$, you emphasize the volatility of $B_t$ and for $\sigma_A^2&amp;lt;1$, you reduce the volatiliy. Only $\sigma_A^2=1$ the volatility structure remain unchanged, where your condition $\sigma_b&amp;gt;\sigma_a$ can be transferred to $\tilde B_t$. And the problem is just, if you choose $\sigma_A^2$&amp;lt;1, you are reducing the volatility of $\sigma_b$ and you cannot use $\sigma_b&amp;gt;\sigma_a$ for $\tilde B_t$. Therefore your assumption that $\sigma_b&amp;gt;\sigma_a$ implies $\tilde B_t$ is more volatile than $A_t$ is generally wrong.&lt;/p&gt;&#xA;" OwnerUserId="25867" LastEditorUserId="25867" LastEditDate="2016-12-25T14:54:41.637" LastActivityDate="2016-12-25T14:54:41.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31655" PostTypeId="1" CreationDate="2016-12-25T15:12:54.640" Score="1" ViewCount="147" Body="&lt;p&gt;Suppose, using market data for a stock, at a tick level, I arrive at a time series, I(t), which is a linear transform of the stock price time series, S(t). I(t) is not leading S(t) and the lagged correlation between I(t) and S(t) is close to one for a small t.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is that for such a case, does the researcher achieve anything at all? Any analysis which can be performed on I(t) can be performed on S(t) and since I(t) doesnt lead, we dont have any advantage at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not sure if what I have said makes sense but would like to know experts' opinion on the same. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards&lt;/p&gt;&#xA;" OwnerUserId="15428" LastActivityDate="2016-12-25T15:12:54.640" Title="Linear Transformation of stock price" Tags="&lt;time-series&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31656" PostTypeId="1" CreationDate="2016-12-25T15:15:34.107" Score="5" ViewCount="1903" Body="&lt;p&gt;From the &lt;a href=&quot;https://en.wikipedia.org/wiki/Black%E2%80%93Scholes_model&quot; rel=&quot;noreferrer&quot;&gt;Wikipedia page&lt;/a&gt;, we know call option as an example is price through delta hedging.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Pi=-V+V_SS$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and over $[t,t+\triangle t]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\triangle\Pi=-\triangle V+V_S\triangle S$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Is it mathematically rigorous to use $\triangle$ notation in deriving BS formula?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is Delta-Hedging always the best trading strategy in the BS model? How about the other option/derivative models? If not, how to actually find the best trading strategies?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If yes, how to implement it statistically?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="25868" LastEditorUserId="848" LastEditDate="2016-12-25T17:11:40.210" LastActivityDate="2016-12-26T23:33:29.393" Title="Black Scholes in Practice: Delta Hedging" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;optimization&gt;&lt;brownian-motion&gt;&lt;continuous-time&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31657" PostTypeId="1" AcceptedAnswerId="31660" CreationDate="2016-12-25T15:40:53.400" Score="-1" ViewCount="1162" Body="&lt;p&gt;Suppose that x is the yield to maturity with continuous compounding on a discount bond that pays off $1 at time T. Assume that the x follows the process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dx=a(x_0-x)dt + sxdz$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $a, x_0$ and $s$ are positive constants and $dz$ is the wiener process. What is the process followed by a bond price?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solution:&#xA;$dS=\mu Sdt+\sigma S dz$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where S is the bond price and $\mu$ and $\sigma$ are expected instantaneous return and instantaneous volatility respectively. Yield to maturity is the total return anticipated on a bond if the bond is held until the end of its lifetime.&lt;/p&gt;&#xA;" OwnerUserId="15605" LastEditorUserId="15605" LastEditDate="2016-12-25T16:05:11.150" LastActivityDate="2016-12-25T17:42:43.677" Title="Bond price and its process" Tags="&lt;bond&gt;&lt;brownian-motion&gt;&lt;itos-lemma&gt;&lt;bond-yields&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31658" PostTypeId="1" AcceptedAnswerId="31672" CreationDate="2016-12-25T16:31:09.387" Score="-1" ViewCount="2474" Body="&lt;p&gt;I have a theoretical question concerning NPV calculation of financial products.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know how to calculate it when future flows have to be estimated, but I am wondering how to calculate past flows. In fact, I am even wondering if it makes&#xA;sense to calculate past flows for NPV of a financial product as it is generally used to estimate value of cashflows to be received/paid in the future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me give you more context about this question: I am a programmer and I am working on a &quot;NPV&quot; function where the pricing date is a parameter, this date is used to discount the flows (this &quot;NPV&quot; function will price &quot;as of&quot; pricing date). It would be possible to use this npv function&#xA;choosing a pricing date before trade booking but also in the middle of the trade &quot;life&quot; (for example, for an IR Swap, it would be possible to select a pricing date where some payments have already been done and some other still didn't occur).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see several possibilities: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;force to select a pricing date before occurence of the first payment (if we consider NPV calculation only making sense to evaluate if it worths entering in a new deal or not)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;only take into account future flows of the trade&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;estimate future flows and, for the past flows, retrieve the realized payments&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This question will probably look abstract (and even weird!) for most of you. I am aware of it and sorry about that. Your feedbacks are welcomed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks and regards &lt;/p&gt;&#xA;" OwnerUserId="25869" LastActivityDate="2017-05-30T11:37:09.380" Title="NPV calculation of past flows" Tags="&lt;pricing&gt;&lt;present-value&gt;&lt;irs&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31659" PostTypeId="2" ParentId="31656" CreationDate="2016-12-25T17:34:39.710" Score="2" Body="&lt;p&gt;The $\Delta$ just define the time difference you are considering. In order to formulate the differential equation correctly you need to send $\Delta$ to zero. i.e $lim_\Delta\rightarrow 0  $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to understand the meaning of Delta Hedging, you need to understand the composition of the portfolio. As you stated, it is a short position in Derivative and $\Delta$ long position in the underlying asset. This portfolio cancels exactly the random term $dS$ with Wiener-process each other within the time intervall $\Delta t$. However $\Delta$ depends on the time intervall you are considering and this may vary during the time evolution. Therefore you need also hedge the time dependent change of $\Delta$, which is called as Gamma-Hedging.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Hedging-Method with other Models are similiar. Since the change of the derivative and the underlying are generated by the same Wiener-Process, you can always design a hedging method in order to cancel the random-term, i.e.&#xA;For the asset:&#xA;$$dS=\mu dt+ \sigma dW$$&#xA;For the derivative:&#xA;$$dV=\mu_V dt+ \sigma_V dW$$&#xA;Consider the Derivative V(i.e. Options) does not need to be a derivative(in mathematical sense). But this should demonstrate the idea. The idea is just to find a portfolio to cancel the $dW$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you can see, we completely canceled our uncertainty(in ideal case), under risk neutral measure, the change of your portfolio value is completely based on the time value of your money. If you are risk neutral, this is the best trading strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most common implementation is Finite Difference Methods and Monte-Carlo-Simulation. As the $\Delta$ is a derivative with respect to a Ito-Process, you need first solve this Differentialequation by finite difference methods and then simulate its path by Monte-Carlo-Simulation.&lt;/p&gt;&#xA;" OwnerUserId="25867" LastEditorUserId="25867" LastEditDate="2016-12-25T18:04:49.277" LastActivityDate="2016-12-25T18:04:49.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31660" PostTypeId="2" ParentId="31657" CreationDate="2016-12-25T17:36:18.760" Score="3" Body="&lt;p&gt;If I understand your question correctly, then the zero-coupon bond price for the maturity $T$ is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;B_t = e^{-x_t (T - t)},&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $t \in [0, T]$ and $x_t$ is the per annum yield-to-maturity. Note that you didn't make the definition of $x$ fully clear in your question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get the dynamics of $B$, you just apply the Ito formula to the function $f(t, x) = e^{-x (T - t)}$ with&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;f_t(t, x) = x f(t, x), \quad f_x(t, x) = -(T - t) f(t, x), \quad f_{xx}(t, x) = (T - t)^2 f(t, x).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\mathrm{d}B_t &amp;amp; = &amp;amp; \mathrm{d}f \left( t, x_t \right)\\&#xA;&amp;amp; = &amp;amp; x_t B_t \mathrm{d}t - (T - t) B_t \mathrm{d}x_t + \frac{1}{2} (T - t)^2 B_t \mathrm{d} \langle x \rangle_t\\&#xA;&amp;amp; = &amp;amp; \left( x_t + \frac{1}{2} (T - t)^2 s^2 x_t^2 \right) B_t \mathrm{d}t - (T - t) B_t \mathrm{d}x_t\\&#xA;&amp;amp; = &amp;amp; \underbrace{\left( x_t + \frac{1}{2} (T - t)^2 s^2 x_t^2 - (T - t) a \left( x_0 - x_t \right) \right)}_{\mu \left( t, x_t \right)} B_t \mathrm{d}t + \underbrace{(t - T) s x_t}_{\sigma \left( t, x_t \right)} \mathrm{B}_t \mathrm{d}z.&#xA;\end{eqnarray}&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2016-12-25T17:42:43.677" LastActivityDate="2016-12-25T17:42:43.677" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31661" PostTypeId="1" CreationDate="2016-12-25T19:13:04.453" Score="3" ViewCount="205" Body="&lt;p&gt;Many research papers use differing solution methods to attempt to find the 'true' value of an option whether it be Euro, American, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They never mention how they do find the true option value to test against however. Which becomes my question: how does one find the true value of an option for given input variables to test against?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Appreciate any help.&lt;/p&gt;&#xA;" OwnerUserId="18013" LastActivityDate="2016-12-27T01:14:32.780" Title="Finding the True Option Value" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;american-options&gt;&lt;valuation&gt;&lt;european-options&gt;" AnswerCount="1" CommentCount="14" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31664" PostTypeId="1" CreationDate="2016-12-26T01:05:33.700" Score="0" ViewCount="1556" Body="&lt;p&gt;&lt;strong&gt;Q1&lt;/strong&gt; Are there options that doesn't have a closed form pricing formula like BS? Is this the situation when we have to use Finite Difference Method? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone give an example? (I hope this option really exist so that I can look for its historical data from Yahoo Finance)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q2&lt;/strong&gt; After pricing the option, what should we do to develop trading strategies?&lt;/p&gt;&#xA;" OwnerUserId="25868" LastEditorUserId="467" LastEditDate="2016-12-26T04:34:14.020" LastActivityDate="2016-12-26T15:44:31.267" Title="Which options do not have a closed form pricing formula like BS?" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;finite-difference-method&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31666" PostTypeId="2" ParentId="31664" CreationDate="2016-12-26T07:39:38.180" Score="0" Body="&lt;p&gt;Most of the options in finance don't have closed form solutions. That includes American and many exotic options. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you don't have a formula, you may use numeric methods such as FDM. You may also approximate the option with an analytic solution.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2016-12-26T07:39:38.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31667" PostTypeId="2" ParentId="31658" CreationDate="2016-12-26T10:12:05.547" Score="1" Body="&lt;p&gt;The idea of considering past cash flows into an NPV calculation is rather adventurous, in my opinion.&#xA;If an investor wants to invest money into a financial instrument that has already generated positive cash flows before making his investment (e.g. investing into a bond when some interest payment dates have already passed), the investor would not consider these cash flows into his calculation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The concept of the NPV is intended to calculate the growth of an investor's wealth at time $t$, discounting all the cash flows attributable to an investment minus its costs. Since an investment can be understood as the process of buying the entitlement to receive future cash flows, it is not very intuitive to consider cash flows from the past.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I might be wrong, but that's my view on the subject. :)&lt;/p&gt;&#xA;" OwnerUserId="25669" LastEditorUserId="25669" LastEditDate="2016-12-26T17:31:27.267" LastActivityDate="2016-12-26T17:31:27.267" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31668" PostTypeId="2" ParentId="31661" CreationDate="2016-12-26T10:38:10.513" Score="3" Body="&lt;p&gt;Basically it boils down to this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You either use a descriptive or a prescriptive (normative) model, i.e. you either think that the market is always right or you think that you alone know how to determine the &quot;true&quot; price of an option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The original idea of BS was to build a prescriptive model but most modern models try to take the market prices as given and calibrate their models accordingly, thereby gaining one common variable to make all prices comparable: volatility. One prerequisite is to seek consistency for all prices which is normally done via hedging arguments (which often leads to risk-neutrality assumptions). Yet in practice even in the case of minor inconsistencies they often cannot be used to make money due to friction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the end it all boils down to your business model (this is what I meant with my question about the &lt;em&gt;true&lt;/em&gt; value of a stock). When you are on the buy side you try to find mispriced options with a prescriptive model (so you are saying that you know which is the &lt;em&gt;true&lt;/em&gt; price - and all other market participants are wrong). When you are on the sell side you use a calibrated descriptive model which mainly seeks consistency so that you can live on the spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(This is why I gave this link in the comments: &lt;a href=&quot;https://quant.stackexchange.com/questions/6988/how-do-we-use-option-price-models-like-black-scholes-model-to-make-money-in-pr/6990#6990&quot;&gt;How do we use option price models (like Black-Scholes Model) to make money in practice?&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in a way &lt;em&gt;truth&lt;/em&gt; is relative: It either means overall consistent with the market or it means smarter than the market.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2016-12-26T10:54:31.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31669" PostTypeId="2" ParentId="31664" CreationDate="2016-12-26T10:52:01.440" Score="2" Body="&lt;p&gt;The question about the availability of closed-form solutions can generally not be answered for types of options alone but only for the combination of a payoff function and the underlying asset dynamics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider for example European plain vanilla options. These have a (quasi) closed-form solution when the underlying follows an exponential Levy processes including geometric Brownian motion (GBM), in many stochastic volatility models but &lt;em&gt;not&lt;/em&gt; under local volatility dynamics. However, you will &lt;em&gt;usually&lt;/em&gt; find that options that cannot be priced in closed-form under GBM cannot be priced in closed-form under other (sensible) underlying asset dynamics either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, many more exotic options that &lt;em&gt;can&lt;/em&gt; be priced in closed-form under GBM &lt;em&gt;should&lt;/em&gt; not be priced using this model. The reason is that the value of the payoff is heavily driven by risk-factors whose dynamics are not modelled. Examples are the forward skew sensitivity of American binary options, the stochastic interest rate exposure of equity linked bonds with an uncertain maturity, ... .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once the option cannot be priced in closed-form under the respective model dynamics, you need a numerical method such as finite differences, Monte Carlo simulation, trees, ... .&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2016-12-26T15:44:31.267" LastActivityDate="2016-12-26T15:44:31.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31670" PostTypeId="1" CreationDate="2016-12-26T14:52:24.897" Score="2" ViewCount="280" Body="&lt;p&gt;Let $\sigma(t)$ be a given deterministic function of time and define the&#xA;process $X_t$ by&#xA;$$X(t) = \int_0^t \sigma(s)dW(s)$$ &#xA; I want to show  $$E\left[ \int_0^t \sigma(s) e^{iuX(s)} dW(s)\right] = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is part of exercise 4.3 in Bjork &quot;Arbitrage Theory in continuous time&quot;, and you can see the solution here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/qeGWd.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/qeGWd.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution does not explain it.&lt;/p&gt;&#xA;" OwnerUserId="25874" LastEditorUserId="467" LastEditDate="2016-12-28T11:15:36.010" LastActivityDate="2016-12-28T11:16:01.683" Title="How to show that $E\left[ \int_0^t \sigma(s) e^{iuX(s)} dW(s)\right] = 0$?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31671" PostTypeId="2" ParentId="31670" CreationDate="2016-12-26T15:32:50.657" Score="4" Body="&lt;p&gt;&lt;strong&gt;Some basic details&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\quad$ The Itô integral can be defined in a manner similar to the Riemann–Stieltjes integral, that is as a limit in probability of Riemann sums; such a limit does not necessarily exist pathwise. Suppose that $W_t$ is a Wiener process and that $\sigma_t$ is a right-continuous (cadlag), adapted and locally bounded process if $I=\{t_0,t_1,\cdots,t_n\}$ is a sequence of partitions of $[0,t]$  with mesh going to zero, then the Itô integral of $\sigma_t$ with respect to $W_t$ up to time t is a random variable&#xA;$$X_t=\int_{0}^{t}\sigma(s)dW_s=\lim_{n\to\infty}\,\sum_{i=1}^{n}\sigma(t_{i-1})(W(t_i)-W(t_{i-1}))$$&#xA;since $\sigma(s)$ is deterministic process and $W({t_i})-W(t_{i-1})\sim\mathcal{N}(0,t_i-t_{i-1})$ , thus $X_t$ is normally distributed such that&#xA;\begin{align*}&#xA;\mathbb{E}[X_t]&amp;amp;=\mathbb{E}\left[\lim_{n\to\infty}\sum_{i=1}^{n}\sigma(t_{i-1})(W_{t_i}-W_{t_{i-1}})\right]\\&#xA;&amp;amp;=\lim_{n\to\infty}\mathbb{E}\left[\sum_{i=1}^{n}\sigma(t_{i-1})(W_{t_i}-W_{t_{i-1}})\right]\\&#xA;&amp;amp;=\lim_{n\to\infty}\sum_{i=1}^{n}\mathbb{E}\left[\sigma(t_{i-1})(W_{t_i}-W_{t_{i-1}})\right]\\&#xA;&amp;amp;=\lim_{n\to\infty}\sum_{i=1}^{n}\sigma(t_{i-1})\mathbb{E}\left[W_{t_i}-W_{t_{i-1}}\right]\\&#xA;&amp;amp;=0 .&#xA;\end{align*}&#xA;By application of &lt;a href=&quot;https://en.wikipedia.org/wiki/It%C3%B4_isometry&quot; rel=&quot;nofollow noreferrer&quot;&gt;Ito's isometry formula&lt;/a&gt;, we have&#xA;$$\text{Var}(X_t)=\text{Var}\left(\int_{0}^{t}\sigma(s)dW_s\right)=\mathbb{E}\left[\left(\int_{0}^{t}\sigma(s)dW_s\right)^2\right]=\mathbb{E}\left[\int_{0}^{t}\sigma^2_sds\right]=\int_{0}^{t}\sigma^2_sds$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Proof&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $Y(t)$ be a regular adapted process such that $\int_{0}^{t}\mathbb{E}\left[ Y^2(s)\right]ds &amp;lt; \infty$ then&#xA;$$\mathbb{E}\left[\int_{0}^{t}Y(s)dW_s\right]=0$$&#xA;Set $Y(s)=\sigma(s) e^{iuX(s)} $, we have&#xA;$$\int_{0}^{t}\mathbb{E}\left[ Y^2(s)\right]ds=\int_{0}^{t}\mathbb{E}\left[ \sigma^2(s) e^{2iuX(s)}\right]ds=\int_{0}^{t}\sigma^2(s)\mathbb{E} \left[ e^{2iuX(s)}\right]ds\tag 1$$&#xA;$X(t)$ is normally distributed with zero mean and a variance given by&#xA;$$\text{Var}(X_s)=\int_{0}^{s}\sigma^2(v)dv$$&#xA;thus&#xA;$$\mathbb{E} \left[ e^{2iuX(s)}\right]=\exp\left(2\text{i}\,u\,\mathbb{E}[X_s]-2u^2\text{Var}(X_s)\right)\tag 2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a result&#xA;$$\int_{0}^{t}\mathbb{E}\left[ Y^2(s)\right]ds=\int_{0}^{t}\sigma^2(s)\exp\left(-2u^2\int_{0}^{s}\sigma^2(v)dv\right)ds&amp;lt;\infty$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorUserId="467" LastEditDate="2016-12-28T11:16:01.683" LastActivityDate="2016-12-28T11:16:01.683" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="31672" PostTypeId="2" ParentId="31658" CreationDate="2016-12-26T17:45:27.567" Score="1" Body="&lt;p&gt;In basic instruments, one can ignore the past fixings and price purely on the future cashflows. Hence the term Net Present Value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With more exotic stuff such as range accruals, the past fixings are used to calculate the future payoff. In this case, to find the NPV at an intermediate date between the start date and expiry, you typically need to enter the fixings on the past reset dates. Past as in before the date of interest. Of course the date of interest might be in the future from your actual today so you don't really know what the fixings will be. A reasonable way to proceed (if it is purely for indicative purposes) is to get the estimated fixings via the interest rate curve of the reference rate (I am assuming you have an exotic interest rate instrument). Take care to use the forward starting rates from the curve. &lt;/p&gt;&#xA;" OwnerUserId="19333" LastActivityDate="2016-12-26T17:45:27.567" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31673" PostTypeId="1" CreationDate="2016-12-26T18:47:03.610" Score="1" ViewCount="257" Body="&lt;p&gt;I would like to calculate the volatility of an equity option spread with all legs having the same expiration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reading &lt;em&gt;Option Volatility and Pricing 2nd Edition&lt;/em&gt; by Natenberg, Chapter 20, section &lt;em&gt;Forward Volatility&lt;/em&gt; he writes about calculating the volatility for a calendar spread:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We need to reduce the volatility until we find the single volatility that will cause the spread to be worth 1.49. Using a computer, we find that the February/March calendar spread has an implied volatility of 25.94 percent.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;He proceeds to give instructions for an approximation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \frac{O_{2} - O_{1}}{V_{2} - V_{1}} $  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $O_{2} - O_{1}$ being the price of the spread&lt;br&gt;&#xA;and $V_{2} - V_{1}$ being the vega of the spread&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can one combine the volatilities of a spread, specifically a spread where all legs have the same expiration, into a single exact volatility quantity?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks&lt;/p&gt;&#xA;" OwnerUserId="25882" LastActivityDate="2016-12-26T18:47:03.610" Title="How to calculate the volatility of a equity option spread" Tags="&lt;options&gt;&lt;volatility&gt;&lt;spread&gt;&lt;spread-options&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31675" PostTypeId="1" AcceptedAnswerId="32481" CreationDate="2016-12-26T20:16:02.090" Score="0" ViewCount="592" Body="&lt;p&gt;&lt;strong&gt;Issue&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function &lt;code&gt;create.EfficientFrontier&lt;/code&gt; from the &lt;code&gt;PortfolioAnalytics&lt;/code&gt; package is outputting an error message that reads:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error in `colnames&amp;lt;-`(`*tmp*`, value = c(&quot;mean&quot;, &quot;StdDev&quot;, &quot;out&quot;, &quot;w.Asset1&quot;,  : &#xA;  attempt to set 'colnames' on an object with less than two dimensions&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Troubleshooting performed so far without success&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Searched for identical cases - found a few cases with the same error message but output from different functions&lt;/li&gt;&#xA;&lt;li&gt;Checked if the covariance matrix was not positive definite&lt;/li&gt;&#xA;&lt;li&gt;Had recently updated the zoo package so I reinstalled the older version&lt;/li&gt;&#xA;&lt;li&gt;Besides my own code, I tried to run the example codes I found in two different blogs however, I got the exact same error once I tried to execute the function &quot;create.EfficientFrontier&quot;. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;You can check the link below for the code and specific data set in order to try to reproduce my error:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/R-Finance/PortfolioAnalytics/blob/master/demo/demo_efficient_frontier.R&quot; rel=&quot;nofollow noreferrer&quot;&gt;Efficient Frontier Demo from Ross Bennett (PortfolioAnalytics developer)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Three different data sets and the same error, so I suppose I might have some basic misconfiguration issue on my RStudio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas on what the culprit could be?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="25883" LastEditorUserId="26432" LastEditDate="2017-02-17T01:24:32.883" LastActivityDate="2018-04-08T08:20:13.360" Title="PortfolioAnalytics R package - Error with the function &quot;create.EfficientFrontier&quot;" Tags="&lt;programming&gt;&lt;portfolio-management&gt;&lt;finance&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31676" PostTypeId="2" ParentId="31656" CreationDate="2016-12-26T23:27:53.990" Score="3" Body="&lt;p&gt;1.) in textbooks usually stochastic differential $d$ is used which is rigourous &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2.) delta heding in Black Scholes worldis perfect as it's the only way to eliminate risk completely in non friction market with continuous hedging&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3.) in practice usually discrete hedging is used by delta-hedging and gamma-hedging , example of statistical implementation in python is here:&#xA;&lt;a href=&quot;http://www.pricederivatives.com/en/simple-example-simulation-of-delta-hedging-with-python/&quot; rel=&quot;nofollow noreferrer&quot;&gt;delta hedging simulation with python&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18914" LastEditorUserId="18914" LastEditDate="2016-12-26T23:33:29.393" LastActivityDate="2016-12-26T23:33:29.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31678" PostTypeId="2" ParentId="30167" CreationDate="2016-12-27T04:34:13.200" Score="0" Body="&lt;p&gt;Basically the strike of USDJPY call corresponding to the 25% delta is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$K_c = Fe^{\frac {\sigma_K^2}{2}T - \sigma_K \sqrt T N^{-1}(\Delta_c e^{qT})}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $F$ is the forward price, $\sigma_K$ is the implied vol for a given delta, $N^{-1}(x)$ is the inverse normal CDF, $q$ is the asset currency interest rates, and $\Delta_c \in [0, 0.5]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly for put, $K_p$ is the strike for a put with delta $-\Delta_p$, and $\Delta_p \in [0, 0.5]$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$K_p = Fe^{\frac {\sigma_K^2}{2}T + \sigma_K \sqrt T N^{-1}(\Delta_p e^{qT})}$&lt;/p&gt;&#xA;" OwnerUserId="17835" LastActivityDate="2016-12-27T04:34:13.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31681" PostTypeId="1" AcceptedAnswerId="31682" CreationDate="2016-12-27T11:26:05.650" Score="0" ViewCount="147" Body="&lt;p&gt;This is the first time I use the Package ‘PerformanceAnalytics’. I have a problem when it comes to use &quot;Rf&quot; (risk-free rate) when using the CAPM.beta.&#xA;I use EONIA as a proxy for the risk free-rate. Here is my code :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(zoo)&#xA;library(Quandl)&#xA;library(PerformanceAnalytics)&#xA;cac &amp;lt;- Quandl('YAHOO/INDEX_FCHI', start_date = '2014-01-01', end_date = '2016-01-01', type = 'zoo')&#xA;saf &amp;lt;- Quandl('YAHOO/PA_SAF', start_date = '2014-01-01', end_date = '2016-01-01', type = 'zoo')&#xA;eonia &amp;lt;-Quandl(&quot;BOF/QS_D_IEUEONIA&quot;, start_date = '2014-01-01', end_date = '2016-01-01', type = 'zoo')&#xA;safreturn &amp;lt;- Return.calculate(saf$Close, method = (&quot;log&quot;))&#xA;cacreturn &amp;lt;- Return.calculate(cac$Close, method = (&quot;log&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;then when I try to use the CAPM.beta() function I get :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;CAPM.beta(safreturn, cacreturn, eonia)&#xA;Error in NextMethod(.Generic) : &#xA;  dims [product 523] do not match the length of object [266730]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think that I understand that the problem comes from the length of &lt;code&gt;Rf = eonia&lt;/code&gt;.&#xA;I have noticed that even if the length of &lt;code&gt;safreturn&lt;/code&gt; and &lt;code&gt;cacreturn&lt;/code&gt; are not the same, if I put a random number for &lt;code&gt;Rf&lt;/code&gt; I can obtain a solution, but I need to use the daily rate of EONIA.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone help me ?&#xA;Thanks in advance :)&lt;/p&gt;&#xA;" OwnerUserId="25880" LastActivityDate="2016-12-27T15:32:37.650" Title="Package ‘PerformanceAnalytics’ - Risk-free rate : Trouble using CAPM.beta() function" Tags="&lt;time-series&gt;&lt;programming&gt;&lt;capm&gt;&lt;performanceanalytics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31682" PostTypeId="2" ParentId="31681" CreationDate="2016-12-27T12:46:47.867" Score="0" Body="&lt;p&gt;The problem is that the length of the time series are different, despite you setting similar starting dates. CAPM.Beta then try to coerce the data unsuccessfully, which can be seen in the &lt;code&gt;length of object [266730]&lt;/code&gt;, which is equal to 510 * 523, which in turn is the length of the eonia series and the cacreturn series, respectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not much of a zoologist, so I prefer to use the &lt;code&gt;xts&lt;/code&gt; library for financial series. The following should solve the problem:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(xts)&#xA;library(Quandl)&#xA;library(PerformanceAnalytics)&#xA;cac &amp;lt;- Quandl('YAHOO/INDEX_FCHI', start_date = '2014-01-01', end_date = '2016-01-01', type = 'xts')&#xA;saf &amp;lt;- Quandl('YAHOO/PA_SAF', start_date = '2014-01-01', end_date = '2016-01-01', type = 'xts')&#xA;eonia &amp;lt;-Quandl(&quot;BOF/QS_D_IEUEONIA&quot;, start_date = '2014-01-01', end_date = '2016-01-01', type = 'xts')&#xA;safreturn &amp;lt;- Return.calculate(saf$Close, method = (&quot;log&quot;))&#xA;cacreturn &amp;lt;- Return.calculate(cac$Close, method = (&quot;log&quot;))&#xA;&#xA;retmerge &amp;lt;- na.exclude(merge.xts(cacreturn, safreturn, eonia)) #na.exclude removes all rows with NA values&#xA;&#xA;CAPM.beta(retmerge[,1], retmerge[,2], retmerge[,3])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13808" LastEditorUserId="13808" LastEditDate="2016-12-27T15:32:37.650" LastActivityDate="2016-12-27T15:32:37.650" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31683" PostTypeId="1" AcceptedAnswerId="31693" CreationDate="2016-12-27T13:41:20.553" Score="0" ViewCount="620" Body="&lt;p&gt;I have a portfolio of foreign stocks. All stocks are denominated in foreign currency. I need to compute returns and risk metrics in national currency which is different from stocks currency. Stocks`s weights in the portfolio may change during optimization, but currency position always has the weight equal to one (no stocks from other exchanges). How to implement this in portfolio optimization procedure? Maybe I should add some constraint to my portfolio? How to deal with such a constraint as that the sum of all other assets weights must be equal to 1?&lt;/p&gt;&#xA;" OwnerUserId="24846" LastActivityDate="2016-12-28T04:14:07.297" Title="How to take into account currency risk when optimizing portfolio?" Tags="&lt;modern-portfolio-theory&gt;&lt;currency&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31684" PostTypeId="1" AcceptedAnswerId="31690" CreationDate="2016-12-27T13:57:39.140" Score="2" ViewCount="217" Body="&lt;p&gt;It seems to me that Currency Risk can be diversified away and hence one should not get paid for taking it.  Do you agree?&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-12-27T21:31:20.163" Title="Portfolio Theory: Currency Risk" Tags="&lt;modern-portfolio-theory&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31685" PostTypeId="1" CreationDate="2016-12-27T14:02:18.053" Score="4" ViewCount="224" Body="&lt;p&gt;Some years ago, a colleague made the argument that volatility should be thought of as an asset class.  That means that taking exposure to implied volatility, in the form of volatility bonds, or long dated OTC options, can enhance returns and have low correlation to existing traditional portfolios.  This was said in the context of interest rate volatility, although the same could be said of fx or equity volatility.  Does anyone agree or disagree with this concept?  Is volatility an asset class?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I accept that volatility is a risk factor, not an asset class, as @kiwiakos points out.  Suppose someone suggests a volatility bond, where you receive the realized volatility on some underlying asset over some period.  Does this ever have a logical place in a portfolio?&lt;/p&gt;&#xA;" OwnerUserId="18388" LastEditorUserId="467" LastEditDate="2016-12-28T16:12:45.960" LastActivityDate="2016-12-29T04:42:22.417" Title="In portfolio theory, has volatility a logical place as an asset class?" Tags="&lt;modern-portfolio-theory&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31687" PostTypeId="2" ParentId="31653" CreationDate="2016-12-27T15:34:41.070" Score="0" Body="&lt;p&gt;Time dimension of volatility and risk-free rate should match the time unit of your step (dt) in BM. If t represents year then sigma and r should be annualized, if t is in days then you should apply the square-root rule.&lt;/p&gt;&#xA;" OwnerDisplayName="user18489" LastActivityDate="2016-12-27T15:34:41.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31688" PostTypeId="2" ParentId="31685" CreationDate="2016-12-27T16:04:17.097" Score="4" Body="&lt;p&gt;IMO: Volatility is a risk factor not an asset class. Asset classes are collections of assets and volatility is not one. Options, volatility derivatives, etc, are asset classes which might offer exposure to volatility. You wouldn't say that 'the stock return is an asset class' but rather 'stocks constitute an asset class'. Of course some would define the 'volatility asset class' as the class that pretty much includes all derivatives. Nothing wrong with that, it is a matter of definition. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now whether or not volatility as a risk factor has low correlation with other risk factors is another question. IMO it is not a low correlation asset especially during market turbulence. Stocks and their volatility jump together, even if they exhibit low correlation during normal times. Exchange rates are the same. Interest rate volatility correlates with the slope of the yield curve, which in turn follows the business cycle. Etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also to take on volatility risk one typically needs to also take non-linear exposure to other factors, liquidity risk, tail risk, etc. Volatility can be used to hedge effectively, but it is not for everyone and correlation is not a sufficient metric of dependence. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2016-12-27T16:32:16.050" LastActivityDate="2016-12-27T16:32:16.050" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31689" PostTypeId="2" ParentId="18070" CreationDate="2016-12-27T18:12:44.800" Score="1" Body="&lt;p&gt;$$Var(\int _0^T e^{W_t} dt)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$= E[(\int _0^T e^{W_t} dt)^2] - (E[\int _0^T e^{W_t} dt])^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E[\int _0^T e^{W_t} dt] = \int _0^T E[e^{W_t}] dt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recall that $W_t$ is normal.&#xA;use mgf&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E[(\int _0^T e^{W_t} dt)^2]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll try following &lt;a href=&quot;https://stats.stackexchange.com/questions/187486/how-to-compute-expectation-of-square-of-riemann-integral-of-a-random-variable&quot;&gt;this&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E[(\int_0^T e^{W_t} dt)^2]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ = E[(\int_0^T e^{W_t} dt)(\int _0^T e^{W_s} ds)]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ = E[\int_0^T \int_0^T e^{W_t} e^{W_s} dt ds]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ = \int_0^T \int_0^T E[e^{W_t} e^{W_s}] dt ds$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without loss of generality, suppose $s &amp;lt; t$. Then by considering the exponential martingale, we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E[e^{W_t} e^{W_s}] = E[E[e^{W_t} e^{W_s}|\mathscr F_s]]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$= E[e^{W_s}E[e^{W_t} |\mathscr F_s]]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$= E[e^{W_s}e^{\frac{t}{2}}E[e^{\frac{-t}{2}}e^{W_t} |\mathscr F_s]]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$= E[e^{W_s}e^{\frac{t}{2}}e^{\frac{-s}{2}}e^{W_s}]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$= e^{\frac{t}{2}}e^{\frac{-s}{2}}E[e^{W_s}e^{W_s}]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$= e^{\frac{t}{2}}e^{\frac{-s}{2}}E[e^{2W_s}]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that $2W_s$ is normal too.&#xA;Use mgf again&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \int_0^T \int_0^T E[e^{W_t} e^{W_s}] dt ds$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ = \int_0^T  e^{\frac{t}{2}} dt \int_0^T e^{\frac{-s}{2}}E[e^{2W_s}]  ds$$&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2016-12-29T11:40:22.403" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31690" PostTypeId="2" ParentId="31684" CreationDate="2016-12-27T19:49:43.250" Score="3" Body="&lt;p&gt;Yes, FX generally does not command a risk premium (expected return = 0, but volatility is not 0), and you can improve the Sharpe ratios of global equity/bond portfolios just by hedging away FX risk. See this excellent AQR paper: &lt;a href=&quot;https://www.aqr.com/library/aqr-publications/risk-without-reward-the-case-for-strategic-fx-hedging&quot; rel=&quot;nofollow noreferrer&quot;&gt;Risk Without Reward: The Case for Strategic FX Hedging&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2016-12-27T21:31:20.163" LastActivityDate="2016-12-27T21:31:20.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31692" PostTypeId="1" CreationDate="2016-12-28T03:42:04.593" Score="0" ViewCount="65" Body="&lt;p&gt;What is the whole list of assumption that Ho Lee model was under?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please briefly describe how was each assumption match the real world finance/economics applications so that it shows how the model can had real application.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can find no reference to these question.&lt;/p&gt;&#xA;" OwnerUserId="2744" LastEditorUserId="2744" LastEditDate="2016-12-28T19:28:04.567" LastActivityDate="2016-12-28T19:28:04.567" Title="What is the whole list of assumption that Ho Lee model was under?" Tags="&lt;modeling&gt;&lt;models&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31693" PostTypeId="2" ParentId="31683" CreationDate="2016-12-28T04:14:07.297" Score="1" Body="&lt;p&gt;I think for multi currency portfolios you will have to seperate out equity risk and currency risk. For example, if you own Gazprom stocks with current value of 1M RUB, then you have company specific risk (equity risk) and Ruble risk (currency risk). Since your investment has two risk sources, you should calculate risk and return metrics both for equity and currency. Then you can optimize your portfolio accordingly. On the other hand, you could hedge out your currency exposure entirely, then move on optimizing your portfolio only considering equity risk.I am not completly sure if these are robust approaches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several research papers out there that discuss this subject:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://documents.pimco.com/viewer/GetFile.aspx?Id=r%2FdJvB33tqCN2INm7Y%2FymiqTniQuKlN%2BdPVFSoNVItkQQcxzHjO0PaV6GkmP9Q7%2FPsIv%2FHw%2FexzvNma%2Bmrh48QScW%2FMYtjOLCbKn1mQoHBAn2gvT6bk2dsh1UQyKFZSP%20&quot; rel=&quot;nofollow noreferrer&quot;&gt;Currency Hedging Optimization for Multi-Asset Portfolios (PIMCO, 2016)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://pubs.doc.ic.ac.uk/multi-currency-portfolios/multi-currency-portfolios.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Computing optimal multi-currency mean-variance portfolios (Rustem, 1994)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.sef.hku.hk/tpg/econ6017/2011/black-litterman-1992.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Global Portfolio Optimization (Balck &amp;amp; Litterman, 1992)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.cfapubs.org/doi/pdf/10.2469/faj.v51.n1.1872&quot; rel=&quot;nofollow noreferrer&quot;&gt;Universal Hedging: Optimizing Currency Risk and Reward in International Equity Portfolios (Black)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="19096" LastActivityDate="2016-12-28T04:14:07.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31694" PostTypeId="1" AcceptedAnswerId="31710" CreationDate="2016-12-28T14:57:58.290" Score="0" ViewCount="501" Body="&lt;p&gt;I need to price an inflation-linked bond issued by italian government.&#xA;Which models are indicated for this bond? &#xA;I think I can price bond as a FRN plus an option on inflation rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, first problem: how can I find data on inflation to estimate volatility? &#xA;Second problem: I have path dependency on the result of the option (if inflation becomes negative, to have the premium inflation has to get higher than the last maximum), how to face this? which kind of option can I use?&#xA;thanks &lt;/p&gt;&#xA;" OwnerUserId="25903" LastActivityDate="2016-12-29T12:39:05.667" Title="Pricing models for inflation-linked bonds?" Tags="&lt;options&gt;&lt;fixed-income&gt;&lt;inflation&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31695" PostTypeId="1" CreationDate="2016-12-28T15:49:09.190" Score="0" ViewCount="118" Body="&lt;p&gt;Do you have any idea/hints how could I estimate the size of the trading book of a particular bank relying solely on its annual financial report?&#xA;Any help would be much appreciated!&lt;/p&gt;&#xA;" OwnerUserId="20629" LastActivityDate="2017-04-28T07:37:54.470" Title="Trading book estimation" Tags="&lt;finance&gt;&lt;trading&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31697" PostTypeId="2" ParentId="31685" CreationDate="2016-12-28T16:31:15.770" Score="1" Body="&lt;p&gt;Whether volatility is an asset class or not is a matter of point of view. Nevertheless, funds exist to have exposure to it such, for example ETFs (see &lt;a href=&quot;http://etfdb.com/etfdb-category/volatility/&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;, to name a few).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Adding such a fund to a multi-asset portfolio is perfectly fine for example. You would expect its return to be decorrelated (i.e. $\rho &amp;lt;&amp;lt; 0$) from the underlying asset class (for example Equities for VIX) in a bear market at least. Probably quite uncorrelated (i.e. $\rho 0$) to it otherwise although I have not personally tested this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is particularly useful for long-only funds where as it gives you a long exposure on the downside.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I agree with Kiwiakos though that if you're doing factor-based risk allocation you would probably find it to be correlated to the other factors which is obviously an issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally that this is an exposure to implied-volatility though, not really observed volatility. So if market severly overprice or underprice risk in the markets (puts or calls very expensive, for example) you might be able to catch some other kind of &quot;risk&quot; there if you're not allowed to hold derivatives in your portfolio.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2016-12-28T16:31:15.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31698" PostTypeId="2" ParentId="17471" CreationDate="2016-12-28T16:55:30.733" Score="2" Body="&lt;p&gt;I have read the 2008 and the 1988 version.  The 2008 version is the 1940 version with commentary by accountants in added chapters to bring the book up to current methods and to discuss what changed in the world since the writing of the original 1940 book.  The 1988 book is not by Graham as he had died in 1973, but primarily by Syndey Cottle with the blessing and imprimatur of David Dodd.  I have not read either the '34 book nor the '62 book.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fact that modern users felt obligated to reissue the 1940 book and not the '62 book tells me they felt the 1940 book was better.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The differences between the 1988 book and the 2008 book are pretty stark.  If you have never done security analysis before and you need technical skills, then the 1988 book is better.  It is more of a &quot;what&quot; book.  If you have excellent accounting skills and have done security analysis, then the 1940 book is better as it is more of a &quot;why&quot; book.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The 1988 book is a bit more step by step view of what to do with ratios and so forth.  The 1940 book is more of an attitude toward viewing and understanding relationships inside and outside the firm as well as the role of the statements and their notes.  Really, security analysis is notes analysis as the statements are inadequate for the purpose.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2016-12-28T16:55:30.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31699" PostTypeId="1" AcceptedAnswerId="31702" CreationDate="2016-12-28T17:41:55.123" Score="0" ViewCount="529" Body="&lt;p&gt;As you know, with basic assumptions default probability could be calculated by &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{CDS Spread} = p \cdot \frac{1-RR}{1+r}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does that make sense to use 5 Year CDS Spread with 5 year Generic Government Bond Yield as risk-free rate?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If yes, most CDSs are written of USD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which one is okay to use US Government bond or Country's Government which is bank operates? It seems currency mismatch to me: if I calculate a German bank's default, I would use the CDS spread of the bank (which is $ Denominated) and rate of Germany Bond? Would that make sense? &lt;/p&gt;&#xA;" OwnerUserId="25110" LastEditorUserId="467" LastEditDate="2016-12-29T03:10:02.263" LastActivityDate="2016-12-29T03:10:02.263" Title="Which interest rate to choose to estimate a CDS default probability?" Tags="&lt;cds&gt;&lt;default-probability&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31702" PostTypeId="2" ParentId="31699" CreationDate="2016-12-29T02:42:39.307" Score="0" Body="&lt;p&gt;Normally for USD denominated CDS you should use US government bonds as the risk free rate. As a general rule debt is more likely to be risk free if it is issued in the government's currency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you take a high credit risk country (for instance Venezuela), then using Venezuela government USD yield as the risk free rate you will end up having a wrong probability of default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PDVSA which is the venezuelian petroleum exporter has a 5Y CDS at 4 898 bp, Venezuela @ 4 004 bp. Your risk free rate isn't exactly risk free and a 900 bp credit spread won't give you the same probability of default than the 4870 bp credit spread that better reflects the actual risk and probability of default.&lt;/p&gt;&#xA;" OwnerUserId="1181" LastActivityDate="2016-12-29T02:42:39.307" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31703" PostTypeId="2" ParentId="31685" CreationDate="2016-12-29T04:42:22.417" Score="1" Body="&lt;p&gt;I agree with @SRKX that it is a matter of perspectives. I have seen various types of classifications of asset classes. For example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;at CPPIB they believe there are only 2 asset classes - stocks and bonds;&lt;/li&gt;&#xA;&lt;li&gt;JPMAM has three asset classes - Equities, Bonds, Alternatives (including HF, PE, VC, Real Estate, Commodities, Gold);&lt;/li&gt;&#xA;&lt;li&gt;GSAM is more granular and has like 20 asset classes (at least it was presented so by their GPS team). They strongly believe that HF and PE should be treated as seperate asset classes, as they have unique risk return characteristics;&lt;/li&gt;&#xA;&lt;li&gt;Antti Ilmanen also treats HF, PE, VC as different asset classes &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1119990726&quot; rel=&quot;nofollow noreferrer&quot;&gt;in his book&lt;/a&gt;. He then talks little about volatility being an asset class, but does not state it explicitly;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0199959323&quot; rel=&quot;nofollow noreferrer&quot;&gt;Andrew Ang&lt;/a&gt; argues that HF and PE are not asset classes;&lt;/li&gt;&#xA;&lt;li&gt;list goes on and on.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I have not seen clear definition of asset classes, but according to &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1002/9781118656761.app1/pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;this document&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;How do we define an asset class? There are several ways to do so. The first is in terms of the investment attributes that the members of an asset class have in common. These investment characteristics include &lt;strong&gt;(1) the major economic factors that influence the value of the asset class and, as a result, correlate highly with the returns of each member included in the asset class; (2) have a similar risk and return characteristic; and (3) have a common legal or regulatory structure.&lt;/strong&gt; Based on this way of defining an asset class, the correlation between the returns of different asset classes would be low.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now, can we treat volatility as an asset class? There have been some discussion regarding this issue (&lt;a href=&quot;http://econpapers.repec.org/bookchap/wsiwschap/9789814566926_5f0014.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;, &lt;a href=&quot;https://www.stoxx.com/document/Research/Expert-speak-articles/article_giese_201008.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;, &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.454.6690&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;, etc.). Based on this, I think volatility could be treated as an asset class. It has been around for a while and unlike strategies like value, momentum, size, volatility actually has a commonly traded product - VIX.&lt;/p&gt;&#xA;" OwnerUserId="19096" LastActivityDate="2016-12-29T04:42:22.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31704" PostTypeId="2" ParentId="31695" CreationDate="2016-12-29T05:03:41.013" Score="1" Body="&lt;p&gt;Regulatory bodies usually require distinction between trading and banking book for all positions. Have a look at this &lt;a href=&quot;https://annualreport.deutsche-bank.com/2014/ar/management-report/risk-report/market-risk/trading-book.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;page&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19096" LastActivityDate="2016-12-29T05:03:41.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31705" PostTypeId="1" CreationDate="2016-12-29T08:10:36.810" Score="1" ViewCount="601" Body="&lt;p&gt;For any portfolio on mean-variance efficient frontier, does there exist a portfolio on the frontier which has zero correlation with it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to play around with the covariance, by setting correlation equal to zero and then showing that since s.d. are positive, the only way it can be zero is when covariance is zero. And from there, tried to prove that this exists (when the covariance between two portfolios are zero). But no success.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to prove it?&lt;/p&gt;&#xA;" OwnerUserId="25910" LastEditorUserId="467" LastEditDate="2016-12-29T12:09:18.117" LastActivityDate="2017-01-28T16:42:42.200" Title="For any efficient portfolio, does there exist another efficient portfolio which has zero correlation with it?" Tags="&lt;finance&gt;&lt;portfolio&gt;&lt;mean-variance&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31706" PostTypeId="2" ParentId="31705" CreationDate="2016-12-29T08:51:46.017" Score="1" Body="&lt;p&gt;Let the portfolio be $T.$ Suppose $T$ is not the minimal variance portfolio, $M.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider &#xA;$$&#xA;\theta T + (1-\theta) M&#xA;$$&#xA;the covariance of this with $T$ is &#xA;$$&#xA;\theta \operatorname{Var}(T) + (1-\theta ) \operatorname{Cov}(T,M). &#xA;$$&#xA;By varying $\theta$ we can get zero (i.e. let $ \theta=\frac{\operatorname{Cov}(T,M)}{\operatorname{Cov}(T,M)-\operatorname{Var}(T)})$. This portfolio is a linear combination of frontier portfolios so it is a point on the frontier. Call it $Z.$ However, we still have to discuss which side of the frontier it is on, efficient (max return for a given risk) or inefficient (min return for a given risk). I will show that $Z$ is inefficient rather than efficient:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that $T$, $Z$ and $M$ all lie on a straight line in weight space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By considering the minimal variance combination of $T$ and $Z$ which is $M$ we see that they must lie on different sides of $M$ since the weights in the formula for a minimal variance combination of two assets will be positive. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So $Z$ is on the inefficient frontier not the efficient one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note all this assumes $T \neq M.$ (Otherwise $\theta$ is not defined, due to division by zero).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(see my book on portfolio theory for more discussion.)&lt;/p&gt;&#xA;" OwnerUserId="1809" LastEditorUserId="16160" LastEditDate="2017-01-28T16:42:42.200" LastActivityDate="2017-01-28T16:42:42.200" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31708" PostTypeId="2" ParentId="26162" CreationDate="2016-12-29T10:57:05.377" Score="0" Body="&lt;p&gt;YQL seems to fail at queries with like '%AM%' and also there is no other way to get list of all stock symbols. but i think this can do the trick.. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;select * from yahoo.finance.industry where id in (1,2,3....260)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;this will give you list of companies and there symbols. &#xA;start with &#xA;select * from yahoo.finance.industry where id in (112)&#xA;and see if it works. &lt;/p&gt;&#xA;" OwnerUserId="25913" LastActivityDate="2016-12-29T10:57:05.377" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31709" PostTypeId="2" ParentId="22353" CreationDate="2016-12-29T11:30:12.317" Score="2" Body="&lt;p&gt;The answer depends on the parameter settings, but you should always check the risk neutral densities. One of the several complaints against BS is the underlying GBM has lower tails so it underprices OTM (out-of-the-money) options as the market is more heavy tailed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Heston log-return density is leptokurtic (higher tails and kurtosis). See &lt;a href=&quot;http://fedc.wiwi.hu-berlin.de/xplore/tutorials/stfhtmlnode46.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://fedc.wiwi.hu-berlin.de/xplore/tutorials/stfhtmlnode46.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It depends on the setting of your parameters but usually Heston should give higher prices for OTM options for compatible parameter optimizations (i.e. both models' parameters are estimated using the same data).&lt;/p&gt;&#xA;" OwnerUserId="8147" LastActivityDate="2016-12-29T11:30:12.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31710" PostTypeId="2" ParentId="31694" CreationDate="2016-12-29T12:39:05.667" Score="1" Body="&lt;p&gt;I think you are referring to the BTP Italia series of bonds issued by the Italian Treasury, aimed at retail investors and linked to the Italian inflation rate.  These bonds are issued in Euro, have a fixed coupon, plus they pay out semi annually any increase in the Italian inflation index, which is the &quot;FOI ex-tobacco&quot; index.   Here is a link  &lt;a href=&quot;http://www.dt.tesoro.it/en/debito_pubblico/btp_italia/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.dt.tesoro.it/en/debito_pubblico/btp_italia/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typically these bonds are valued by just discounting the fixed coupons at a fair market real rate of interest.  eg if the 10yr bonds carry a 1.75% coupon, but the fair real rate is 1.65%, then they are worth 100% of par plus the present value of 10bp for 10yrs.   The fair real rate is usually judged versus other sovereign issuers in a similar way that nominal bonds are compared.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you mention, a significant complication is the embedded option in the inflation calculations.  It is stated in the terms that the Inflation index is effectively protected from going down, so that the inflation payments can never be negative.  This is a complicated path dependent option.  The way I would value it is to download a history of the relevant index, calculate its historical volatility, and build a monte carlo simulation of the bond value without this feature versus the bond value with this feature.  Intuitively I would expect the floor to have some value, since the Eurozone has been flirting with deflation in the last few years.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-12-29T12:39:05.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31711" PostTypeId="2" ParentId="14630" CreationDate="2016-12-29T12:44:46.917" Score="1" Body="&lt;p&gt;The change in value of an inflation linked bond is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Change in Real Yield * Duration &lt;/p&gt;&#xA;&#xA;&lt;p&gt;= (Change in nominal yield of non-linked bonds - Change in inflation expectations) * Duration&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Duration is approximately constant for daily or weekly moves, although it will change if real rates move, so the above is an approximation.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-12-29T12:44:46.917" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31712" PostTypeId="1" CreationDate="2016-12-29T15:35:33.737" Score="0" ViewCount="480" Body="&lt;p&gt;It is well know that one uses the Black 76 model to price commodity derivatives. I would however like to perform a Monte Carlo simulation that ties back to this number. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would one go about this process? Is there a way to make use of the known future prices to simulate suitable spot prices that will result in the Monte Carlo tying back to the formula approach? &lt;/p&gt;&#xA;" OwnerUserId="25919" LastActivityDate="2019-02-03T17:03:44.063" Title="Black's model and Monte Carlo" Tags="&lt;black-scholes&gt;&lt;monte-carlo&gt;&lt;commodities&gt;&lt;black76&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31715" PostTypeId="1" CreationDate="2016-12-29T17:06:23.837" Score="1" ViewCount="678" Body="&lt;p&gt;I have been doing some research regarding options pricing (particularly using B.S)&#xA;and have come across two research papers which discuss how the Black Scholes model has a tendency to overprice and underprice call options in certain scenarios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The papers are: &lt;a href=&quot;https://www.jstor.org/stable/2328053?seq=1#page_scan_tab_contents&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.jstor.org/stable/2328053?seq=1#page_scan_tab_contents&lt;/a&gt;&#xA;and: &lt;a href=&quot;http://people.stern.nyu.edu/msubrahm/papers/wop.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://people.stern.nyu.edu/msubrahm/papers/wop.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Particularly the first paper mentions that &quot; B.S overprices deep in-the-money options, while it underprices deep out-the-money options.&quot; As well later mentioning &quot;An explanation for the systematic price bias is the assumption of lognormally distributed security price, which fails to systematically capture important characteristics of the actual security price process.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand the fact that Black Scholes has a tendency to fall short and misprice under certain conditions (when it's assumptions do not hold true). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I am confused by the concept of it &quot;overpricing&quot; and &quot;underpricing&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way I see it is this: if you have a pricing model based on certain assumptions and in a particular case an assumption is false then the price your model has produced is &quot;mispriced&quot; (i.e. it did not take an important factor into account and therefore can not reflect the true price)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But to say that an option is for example &quot;overpriced&quot; would you not need to know the true price of it? since &quot;over&quot; is a relative term. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In which case how do you get the true price of an option in order to determine whether something is over or under priced? &lt;/p&gt;&#xA;" OwnerUserId="20245" LastActivityDate="2016-12-30T11:14:05.950" Title="Black Scholes biases" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;volatility&gt;&lt;black-scholes&gt;&lt;derivatives&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31717" PostTypeId="2" ParentId="18070" CreationDate="2016-12-29T19:09:38.593" Score="4" Body="&lt;p&gt;To compute the variance&#xA;$$\text{Var}\left(\int _0^T e^{W_t} dt \right),$$&#xA;we need to compute&#xA;\begin{align*}&#xA;E\left( \left(\int _0^T e^{W_t} dt \right)^2 \right) &amp;amp;= \int_0^T\!\!\!\!\int_0^T E\left(e^{W_s+W_t} \right) ds\,dt.&#xA;\end{align*}&#xA;Note that, for $0 \le s, t \le T$,&#xA;\begin{align*}&#xA;W_s+W_t = &#xA;\begin{cases}&#xA;W_t -W_s + 2 W_s, &amp;amp; \text{ if } s \le t,\\&#xA;W_s -W_t + 2 W_t, &amp;amp; \text{ else}.&#xA;\end{cases}&#xA;\end{align*}&#xA;That is, as a sum of two independent normal random variables, $W_s+W_t$ is normal, with mean $0$ and variance&#xA;\begin{align*}&#xA;\text{Var}(W_s+W_t) = &#xA;\begin{cases}&#xA;t+3s, &amp;amp; \text{ if } s \le t,\\&#xA;s+3t, &amp;amp; \text{ else}.&#xA;\end{cases}&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;E\left( \left(\int _0^T e^{W_t} dt \right)^2 \right) &amp;amp;= \int_0^T\!\!\!\!\int_0^T E\left(e^{W_s+W_t} \right) ds\,dt\\&#xA;&amp;amp;=\int_0^T\left[\int_0^t E\left(e^{W_s+W_t} \right) ds+\int_t^T E\left(e^{W_s+W_t} \right) ds\right]dt\\&#xA;&amp;amp;=\int_0^T\left[\int_0^t e^{\frac{1}{2}t + \frac{3}{2}s} ds+\int_t^T  e^{\frac{1}{2}s + \frac{3}{2}t} ds\right]dt.&#xA;\end{align*}&#xA;The remaining is simple calculus.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-12-29T19:09:38.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31718" PostTypeId="2" ParentId="31715" CreationDate="2016-12-29T20:40:44.027" Score="3" Body="&lt;p&gt;Perhaps they mean that if you use the ATM implied volatity as an input to price ITM and OTM options, then some will be underpriced and some overpriced compared to the true price observed in the market. Equivalent to saying that implied volatilities exhibit a pattern and they are not constant across moneyness.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2016-12-29T20:40:44.027" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31719" PostTypeId="2" ParentId="31715" CreationDate="2016-12-29T23:21:55.167" Score="-2" Body="&lt;p&gt;Let me give you three or four of my papers.  It will solve your problem.  The answer &quot;why&quot; is simply too long to answer here.  The basis of my papers is that returns are not data.  Prices are data and returns are a transformation of that data.  It follows then that you cannot make assumptions about the distributions of returns, but you can either derive the distribution of prices or you could make assumptions about the distributions of prices.  You could actually show that it is mathematically impossible for equity prices to be either normally or lognormally distributed.  It isn't possible as it would create a mathematical contradiction in an option pricing model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It turns out that you can derive the distribution of prices by using the rules that derive the price structures and the error terms.  It is also well understood in statistics how to do the transformations necessary to determine the distribution of returns for an asset class.  So, for example, under Markowitz's assumption, returns on investing must be the ratio of two, independent, normal distributions centered on (0,0) in the error space.  On the other hand, if you were buying and selling assets at Sotheby's, such as art, then you will encounter the ratio of two Gumbel distributions.  The &lt;em&gt;rules&lt;/em&gt; determine the distributions.  Other issues, such as the budget constraint, the cost of liquidity, merger and bankruptcy risk are part of the rules and so in part determine the final distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This in turn determines the rules of econometrics, which in turn determines the rules for pricing options.  I also did a population test as a partial verification.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The papers at the page &lt;a href=&quot;https://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=1541471&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=1541471&lt;/a&gt; will explain why the papers see systematic mispricing.  I am working with a measure theorist to extend the laws of stochastic calculus to include this situation and would like to have a fundamental extension of the rules of calculus prepared by Spring break.  I have also started a paper on subjectively optimal portfolios, but I am teaching six classes so it won't be finished before summer.  Just a warning, I put rough drafts out there, so the calculus paper, when it first comes out, could have poor language or be missing a boundary condition or something like that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please feel free to send any criticisms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;  You can tell something is mispriced in two ways.  First,  you can do a correlation study to see if option prices are correlated with actual outcomes.  Second, you can use the method of inverse probability,  as is done in one of the papers referenced, to test the assumptions directly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Informally,  the findings excluded Ito calculus models from use. Because an inverse method was used, a prior probability for mean-variance finance was used, giving it 999,999:1 odds of being the true model or something like it, over the alternative that no variance existed, and it was still falsified despite prior bias.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have not used Bayesian or inverse methods, &lt;a href=&quot;http://www.seaturtle.org/mtn/archives/mtn122/mtn122p1.shtml?nocount&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.seaturtle.org/mtn/archives/mtn122/mtn122p1.shtml?nocount&lt;/a&gt; provides an informal account.  A good set of youtube videos of a grad course on them are at &lt;a href=&quot;http://www.youtube.com/user/opinionatedlessons/videos?view=0&amp;amp;flow=list&amp;amp;sort=da&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.youtube.com/user/opinionatedlessons/videos?view=0&amp;amp;flow=list&amp;amp;sort=da&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="25459" LastEditorUserId="25459" LastEditDate="2016-12-30T11:14:05.950" LastActivityDate="2016-12-30T11:14:05.950" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="31720" PostTypeId="2" ParentId="31635" CreationDate="2016-12-30T00:14:46.373" Score="1" Body="&lt;p&gt;well there are approximations for the prices but no exact formula since you have a sum of lognormals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take the USD bank account as numeraire. Then the drift of S1 is the drift of the riskless account r. The drift of S2 is $r +C_{f2}$ where $C_{f2}$ is the instantaneous covariance between $S2$ and the FX rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now just compute&#xA;$$&#xA;\mathbb{E} \left( (S_1(T) + S_2(T) - K)_+ \right)e^{-rT}.&#xA;$$&#xA;This is a 2-dim integral so Monte Carlo is overkill. Just use a simple 2d-integral method.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2016-12-30T00:14:46.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31722" PostTypeId="1" CreationDate="2016-12-30T04:01:27.750" Score="1" ViewCount="55" Body="&lt;p&gt;As is stated by the title&#xA;Time series pair X, Y, with first half correlation 0.3 and rest half 0.4, what is the general correlation?&lt;/p&gt;&#xA;" OwnerUserId="18045" LastActivityDate="2016-12-30T04:01:27.750" Title="Time series pair X, Y, with first half correlation 0.3 and rest half 0.4, what is the general correlation?" Tags="&lt;correlation&gt;" AnswerCount="0" CommentCount="3" ClosedDate="2016-12-31T19:04:58.167" ContentLicense="CC BY-SA 3.0" />
  <row Id="31723" PostTypeId="2" ParentId="29632" CreationDate="2016-12-30T05:44:03.497" Score="1" Body="&lt;p&gt;I assume you are using MatLab.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may consider pre-generating all 1,000 random numbers once before for-loop by exploiting array coding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another approach, have you ever tried using Quasi Monte Carlo?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.mathworks.com/help/stats/generating-quasi-random-numbers.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Generating Quasi-Random Numbers&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;QMC ensures faster convergence and MatLab has functions that can generate quasi-random sequence very fast (a billion under a second).&lt;/p&gt;&#xA;" OwnerUserId="13991" LastEditorUserId="13991" LastEditDate="2016-12-30T07:34:10.920" LastActivityDate="2016-12-30T07:34:10.920" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31724" PostTypeId="1" CreationDate="2016-12-30T11:01:02.343" Score="0" ViewCount="144" Body="&lt;p&gt;Using Excel, how could I calculate a cubic spline curve in monthly granularity when my inputs are a combination of months, quarters and years?  The quarter and yearly averages of the spline curve need to be exactly the same as the input.  An example set of inputs would be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Period      Number&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Feb-17      100.00&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mar-17      110.00&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apr-17      115.00&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q2-17       117.00&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q3-17       116.00&lt;/p&gt;&#xA;&#xA;&lt;p&gt;cal-18      120.00&lt;/p&gt;&#xA;&#xA;&lt;p&gt;cal-19      121.50&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, I can only find how to do this if the inputs are all single months.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help will be much appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks. &lt;/p&gt;&#xA;" OwnerUserId="25929" LastActivityDate="2016-12-30T11:30:42.763" Title="cubic spline in excel with month, quarter and year inputs" Tags="&lt;time-series&gt;&lt;excel&gt;&lt;forecast&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31725" PostTypeId="2" ParentId="31724" CreationDate="2016-12-30T11:30:42.763" Score="1" Body="&lt;pre&gt;&lt;code&gt;Dates   Index&#xA;01.03.2017  100&#xA;01.04.2017  110&#xA;01.05.2017  115&#xA;01.06.2017  117&#xA;01.10.2017  116&#xA;01.01.2019  120&#xA;01.01.2020  121&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I took the end points of the months, quarters, and years that you&#xA;provided; &lt;/li&gt;&#xA;&lt;li&gt;Draw the dot plot with smooth lines in Excel; &lt;/li&gt;&#xA;&lt;li&gt;Right-click on this line and choose &quot;add line trend&quot;; &lt;/li&gt;&#xA;&lt;li&gt;Select &quot;Polynomial&quot; and choose degree &quot;3&quot;; &lt;/li&gt;&#xA;&lt;li&gt;Tick the box that says &quot;show &#xA;the equation on diagram&quot;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The result is awful, but I think you can play around and make it look better.&lt;/p&gt;&#xA;" OwnerUserId="19096" LastActivityDate="2016-12-30T11:30:42.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31726" PostTypeId="2" ParentId="29632" CreationDate="2016-12-30T12:41:16.573" Score="3" Body="&lt;p&gt;You're using a wrong tool for the job. Write your Monte Carlo in a faster language (Java would probably suffice, if not than C++ which is standard for such things). Then you will be able to efficiently generate more than 1000 paths. In fact, doing Monte Carlo derivatives pricing with 1000 paths is worthless. Your results are, most probably, very inaccurate. Read a good book on Monte Carlo pricing before venturing further and wasting your time.&lt;/p&gt;&#xA;" OwnerUserId="89" LastActivityDate="2016-12-30T12:41:16.573" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="31728" PostTypeId="2" ParentId="25656" CreationDate="2016-12-30T13:08:59.857" Score="0" Body="&lt;p&gt;In practice people do look at the time decay of bond portfolios, as follows:   Often the &quot;carry&quot; is calculated , which means the profit or loss over the next day making the assumption that bond yields of all maturities stay the same.  This assumption sonewhat conflicts with theory, since the more likely scenario is that bond yields move to their forward yields computed the day before, but nevertheless that is what people do. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no concept of true option style time decay in bonds, since there is no volatility input to calculate bond prices.   That's a consequence of the fact that we assume bond prices (and forward rates) are a given , so they don't move when interest rate volatility moves.  Arguably that assumption could be challenged. &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-12-30T13:08:59.857" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31729" PostTypeId="2" ParentId="23211" CreationDate="2016-12-30T13:46:21.130" Score="2" Body="&lt;p&gt;The term &quot;smart beta&quot; is loaded and ambiguous.  It means different things to different people.  Some people manage products that they would argue are not smart beta while the rest of the industry vehemently disagrees.  I've gone the route of defining what it means to me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Smart Beta&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;&#xA;Short Version&lt;br&gt;&#xA;&lt;em&gt;Commoditized Factor Investing&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Longer Version&lt;br&gt;&#xA;Investment strategies tend to follow a life cycle that begins with&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alpha - Brand new, fairly effective, and proprietary&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and ends with&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Beta - Generic asset class investing&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Smart Beta is somewhere in between where we are mostly familiar with the details of factor investing and want to access investment vehicles more cheaply.  As time marches on, various factor investing strategies will become more and more commoditized.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Those who claim that their factor investment product is &lt;strong&gt;&lt;em&gt;NOT&lt;/em&gt;&lt;/strong&gt; smart beta are those who believe that their product is differentiated from the rest (not a commodity) and that it takes skill to implement.  Or, it's bad for business to admit that you can go around the corner and pay 9 basis points for the same strategy.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Response to Comment&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Can you explain what does it mean: Investment strategies tend to follow a life cycle that begins with Alpha and ends with Beta? &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is my opinion and how I describe this process.  When the first person to decided to invest more in equities because it had a higher return on average than fixed income, they didn't call it Beta.  That person thought they had a good strategy and probably kept it to themselves.  Proprietary return strategies are what I call Alpha.  As that strategy becomes more well known and more accessible, it transitions towards Beta.  Our quintessential definitions of Beta are now Fixed Income, Equity, Cash, Commodities, Currency.  Smart Beta is somewhere in between.  Momentum is becoming more accessible because we discuss it a lot more.  We understand it better.  We accept fairly standard portfolio construction around it.  Its accessibility is no longer limited to high net worth individuals institutions.  Index providers are producing easily maintainable portfolios that exhibit characteristics that are consistent with what we've called Momentum.  The same thing is happening for Value and other factors as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The less secret and proprietary they are, the more Beta like they are.  That's what I mean.&lt;/p&gt;&#xA;" OwnerUserId="20388" LastEditorUserId="20388" LastEditDate="2017-01-04T18:57:35.653" LastActivityDate="2017-01-04T18:57:35.653" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31731" PostTypeId="1" AcceptedAnswerId="31734" CreationDate="2016-12-30T16:51:47.890" Score="0" ViewCount="46" Body="&lt;p&gt;The below exercise and solution was found in &quot;Models for Financial Economics&quot; by Abraham Weishaus. My issues are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;In this problem, $S(t)$ does not satisfy the Black-Scholes framework because volatility is time-varying. According to &lt;a href=&quot;https://phps.portals.mbs.ac.uk/Portals/49/docs/spoon/BS.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;this paper on page 15,&lt;/a&gt; it would appear that we would need to modify the volatility of $S(t)$ for use in the Black-Scholes formula such that:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;$$\text{Var}\left(\ln S(t) | S(0)\right) = \frac{1}{1 - 0}\int_0^1 (\sigma(t))^2 dt = \frac{1}{1 - 0}\int_0^1 (0.16t)^2 dt = 0.00853333.$$&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;The second issue is that this appears, based on the wording, to be a gap option where the trigger is $S(1) &amp;gt; 60$ and &lt;em&gt;not&lt;/em&gt; $S(1)^{0.9} &amp;gt; 60$.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The author mentions in the errata that the $r$ in the fourth expression from the top of the solution should be changed in the exponent to $\alpha$, but does not address these other concerns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are these concerns justified, or is the author's solution correct?&#xA;&lt;a href=&quot;https://i.stack.imgur.com/Tefu2.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Tefu2.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5641" LastEditorUserId="5641" LastEditDate="2016-12-30T19:47:40.633" LastActivityDate="2016-12-30T20:29:44.963" Title="Valuing a claim on $S^a$: This exercise/solution appears to have a mistake" Tags="&lt;self-study&gt;&lt;exotics&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31732" PostTypeId="1" CreationDate="2016-12-30T18:24:09.123" Score="3" ViewCount="722" Body="&lt;p&gt;&lt;em&gt;Note - These are my interpretations of options pricing and assumptions going into this question. Please feel free to comment on them or correct me if I am off.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Option Implied Volatility varies based on the perceived risks in the market affecting the price of the options. Roughly interpreted this way, as perceived risks get higher, sellers will raise the price at which they are willing to execute a trade to compensate themselves for the risks they are taking. Based on the options pricing model you are using this can be interpreted as the Implied Volatility of future price movements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These risks can be broken down into broad categories. In this case, I am going to use the following categories to frame the question; &lt;strong&gt;Systemic Risk&lt;/strong&gt; and &lt;strong&gt;Point Risk&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see &lt;strong&gt;Systemic Risk&lt;/strong&gt; as the broad set of risks that could affect the price of a stock at any particular time. This category would include general volatility of the stock, broad market and sector risks, rumors and information risks, etc... Essentially, things that could affect the volatility of the stock price at any point in time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Point Risk&lt;/strong&gt; is more specific. In this case, I am referring to a specific known risk at a point in time. An earnings announcement is a perfect example of this. We know almost exactly when the earnings release will happen but since the information is unknown there is a risk of a shock to the stock price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The concept of a &lt;strong&gt;Point Risk&lt;/strong&gt; can be extended to anything that could have an effect on the volatility of an underlying's price within a definable period of time. Examples could include Fed Rate announcements, FDA approvals, Industry Events, etc...&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;The Question:&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;What model gives me the ability to determine the portion of an option's implied volatility that can be attributed to a known Point Risk vs what is attributed to more general Systemic Risk?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My goal is to be able to analyze option IV around an event and determine if the market is perceiving more or less risk from that event compared to previous similar events.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that IV can go up or down separate from the event itself. I can't just compare the IV between two different events because other factors could be driving up the Systemic Risk portion of the IV independent of the Point Risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can look at options that expire before the event or expirations far after the event but even those contain some level of event risk bias.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have suggestions for approaching this problem or know of research that relates to the concepts?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My preference is to have a model that has some form of explanatory ability rather than a non-parametric converged solution like a Hidden Markov Model or Neural Net solution.&lt;/p&gt;&#xA;" OwnerUserId="19959" LastActivityDate="2017-06-01T23:34:02.930" Title="Seeking a model to Isolate a stock option's Implied Volatility related to a specific event" Tags="&lt;option-pricing&gt;&lt;risk&gt;&lt;implied-volatility&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31733" PostTypeId="1" CreationDate="2016-12-30T18:36:12.730" Score="0" ViewCount="178" Body="&lt;p&gt;Anyone with real experience between these two types? &#xA;Trying to use Pegged orders for an hft strategy (on forex) and wanted to know if someone could tell me advantages / disadvantages to use them instead of the common cancel / Replace &lt;/p&gt;&#xA;" OwnerUserId="13990" LastActivityDate="2017-05-03T14:42:37.563" Title="Pegged orders vs Cancel/Replace" Tags="&lt;market-data&gt;&lt;fx&gt;&lt;market-microstructure&gt;&lt;market-making&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31734" PostTypeId="2" ParentId="31731" CreationDate="2016-12-30T20:29:44.963" Score="2" Body="&lt;p&gt;Under the Black-Scholes' framework, the underlying stock price price process $\{S_t, \, t\ge 0\}$ satisfies an SDE of the from&#xA;$$ dS_t = S_t (\alpha dt + \sigma dW_t),$$&#xA;where $\{W_t, \, t\ge 0\}$ is a standard Brownian motion, $\alpha$ is the continuously compounded stock return, and $\sigma$ is the constant volatility. Then&#xA;$$S_t = S_0e^{(\alpha-\frac{1}{2}\sigma^2)t + \sigma W_t}.$$ Consequently,&#xA;$$\ln S_t = \ln S_0 + \big(\alpha-\frac{1}{2}\sigma^2\big)t + \sigma W_t,$$ and&#xA;$$\text{Var}( \ln S_t \mid S_0) = \sigma^2 t.$$ From the given information, $\alpha=0.15$, $\sigma = 0.4$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $X_t = S_t^a$. Note that&#xA;\begin{align*}&#xA;X_t &amp;amp;= X_0e^{(a\alpha-\frac{1}{2}a\sigma^2)t + a\sigma W_t}\\&#xA;&amp;amp;=X_0e^{(a\alpha + \frac{1}{2}a(a-1)\sigma^2-\frac{1}{2}a^2\sigma^2)t + a\sigma W_t}\\&#xA;&amp;amp;\equiv X_0e^{(\mu-\frac{1}{2}a^2\sigma^2)t + a\sigma W_t}.&#xA;\end{align*}&#xA;Here,&#xA;\begin{align*}&#xA;\mu = a\alpha + \frac{1}{2}a(a-1)\sigma^2 = 0.1287.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The option payoff is given by&#xA;\begin{align*}&#xA;(S_1^a - 30) 1_{S_1 &amp;gt; 60} &amp;amp;= (S_1^a - 30) 1_{S_1^a &amp;gt; 60^a}\\&#xA;&amp;amp;= (X_1 - 30) 1_{X_1 &amp;gt; 60^a}\\&#xA;&amp;amp;=X_1\, 1_{X_1 &amp;gt; 60^a} - 30\, 1_{X_1 &amp;gt; 60^a}.&#xA;\end{align*}&#xA;Therfore, the expected payoff is given by&#xA;\begin{align*}&#xA;E(X_1) N(d_1) - 30 N(d_2),&#xA;\end{align*}&#xA;where &#xA;\begin{align*}&#xA;d_1 = \frac{\ln (X_0 / 60^a) + \mu + \frac{1}{2}a^2 \sigma^2}{a\sigma},&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;d_2 = d_1 - a\sigma.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2016-12-30T20:29:44.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31735" PostTypeId="2" ParentId="31732" CreationDate="2016-12-30T22:02:20.593" Score="-1" Body="&lt;p&gt;So as far as I can tell, there would only be one methodology that could solve this.  You are trying to solve two distinct things and they use the same methodology.  If $r$ is some measure of locally &lt;em&gt;observed&lt;/em&gt; volatility or risk both in the past and to be predicted in the future, $\sigma$ is the true parameter in nature, $I$ is general information, and $E$ is event specific information, then I believe you are forced by the nature of your description into a Bayesian methodology.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason is that while there may be methods to model $\sigma_t$ in Frequentist and Likelihoodist methodologies, there is no methodology to model realizations, which is a different type of question.  Fortunately, there are Bayesian solutions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, I want to point out that an event is nothing more than data, but &lt;em&gt;you and possibly the public&lt;/em&gt; see it as significant.  In other words, you do not consider a hurricane in the same category as rain.  The drops of water are essentially the same, if maybe a bit more energetic in a hurricane than in a gentle spring drizzle.  There is a second issue as well.  An inchoate risk stops being a risk once it is realized, then it is a fact.  It might be an unpleasant fact, but it is now a certainty.  Markets may not be responding to a change in risk, but a change in certainty.  It may be that $\sigma$ fell once some event was realized, but $\mu$ not only changed, but it is now more certain than ever.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nonetheless, Bayesian methods allow all kinds of things to be parameters other than just centers of location, scale, skew and so forth.  Ben Roethlisberger could be a parameter.  He would have various parameters associated with him as well, such as quarterback, completions, Steelers, age and so on, but they may be combined in him in a unique manner making him distinct.  As long as you can make a model that is sensible, Bayesian methods will be glad to assist you.  If you were playing fantasy football, you could make each player a parameter that is itself a unique configuration of parameters, which are part of a larger system that has parameters.  If it were not for the dimensionality, it is probably a solvable problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, you do not have to collect the data on a variable to include it in a model.  There is a great article on modeling three sided coins (heads, tails, sides) and two of those models include variables for which no data was captured.  See &lt;a href=&quot;http://statweb.stanford.edu/~owen/courses/306a/threesidedcoin_amstat.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://statweb.stanford.edu/~owen/courses/306a/threesidedcoin_amstat.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The article also provides an intermediate view of how to test various competing models to remove bad ones.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you are wanting to do is predict local volatility given information, event information (which could just be a jump again see the article) and the parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You want to know $\Pr(r|IE\sigma\mu{t})$.  That is solved through the Bayesian predictive distribution.  It will provide you a distribution of the future sample space of realizations of $r$.  The reason you cannot do this in Frequentist methods is the same reason people misinterpret confidence intervals.  One of the features of the edges of confidence intervals is that they are random and that smaller intervals are not intrinsically better than wide ones.  People mistake interval size for precision. It is a similar type of problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also do sensitivity analysis between the effects of $I$ and $E$ on price movements.  Believe it or not there is a paper on this in 1941 that John Maynard Keynes spent some time commenting on.  It is by Landon, but you will not want to read it.  Instead, pick up the generalized form in ET Jaynes book &lt;em&gt;Probability: The Language of Science&lt;/em&gt;.  It is a bit polemic and it won't work for your specific application, but it will give you the thinking.  Landon was concerned with signal and noise in telecommunication lines.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally, I am opposed to this category of thinking and models, as a disclosure.  Nonetheless, what you are wanting to do is ambitious.  In the event you have not heard of the Bayesian predictive distribution, I will give a very brief math tutorial.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, lets imagine there is a future sample space $\chi$, and historic sample space $X$ and an observed sample $x$.  There is also a parameter space $\Theta$ and a parameter $\theta$.  Both could be vectors in vector spaces.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bayes theorem, for purposes of analysis, is made up of four parts.  The first part is called the prior distribution, almost always shortened to the &quot;prior.&quot;  It will be denoted $\pi(\theta)$ and contains everything you professionally know about the parameter prior to looking at the sample.  If you know it cannot be negative, then you assign a zero probability over the negative numbers.  If you know it cannot be 5,000,000% per year every year, then you either assign a zero percent probability or some very narrow tail of a probability.  And so on with each parameter.  You encode, as best you can, the existing body of knowledge on the topic.  This has two advantages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It avoids wasting information and it can normalize your sample, if by chance, you grabbed the weird sample.  If you are completely ignorant as to the value of $\theta$ then you would assign an &quot;ignorance&quot; prior, that is a formula that is designed to mimic ignorance in a probabilistic manner.  The prior is everything you know about the problem right now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second portion is the likelihood.  It is the probability of observing the data you actually observed at a specific possible value or set of values for the parameter or vector of parameters.  It is denoted $\mathcal{L}(x|\theta)$.  This is your model.  The numerator is the product of the prior and the likelihood.  It is a density so this calculation is repeated over every possible value of the parameter, that is for all $\theta\in\Theta$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The third portion is called the evidence.  The numerator is summed over the entire parameter space.  You are adding up every possible explanation of the data you saw weighted for its prior probability.  It is written as $\int_{\theta\in\Theta}\mathcal{L}(x|\theta)\pi(\theta)\mathrm{d}\theta$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The final portion is called the posterior distribution and it is denoted $\pi(\theta|x)$.  It is the density of the uncertainty (not chance, Bayesian methods do not have chance) regarding the parameter.  Collectively, they are $$\pi(\theta|x)=\frac{\mathcal{L}(x|\theta)\pi(\theta)}{\int_{\theta\in\Theta}\mathcal{L}(x|\theta)\pi(\theta)\mathrm{d}\theta}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Bayesian predictive distribution begins with the posterior distribution.  It would predict the probability of  $\tilde{x}$ for all $\tilde{x}\in\chi$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The posterior distribution is a quantification of the remaining uncertainty about the parameter $\theta$.  This uncertainty is factored out leaving only the distribution based on the information in the data $x$.  The posterior distribution is $$\pi(\tilde{x})=\int_{\theta\in\Theta}\mathcal{L}(\tilde{x}=k|\theta)\pi(\theta|x)\mathrm{d}\theta.\forall{k}\in\chi.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are wanting to find $\Pr(\tilde{r})$.  Even though I am opposed to this class of models, best of wishes and good luck.  Your findings may help others.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2016-12-30T22:02:20.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31736" PostTypeId="2" ParentId="24512" CreationDate="2016-12-30T23:20:11.397" Score="1" Body="&lt;p&gt;just as a note, I compiled for QuantLib 1.9 and Python 2.7.12.&#xA;I installed QuantLib using macports, then I spent a lot of time trying to understand the compilation error. Do as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Ignore the ./configure and make steps&#xA;2) Go straight for the Python folder&#xA;3) run: python setup.py build&#xA;4) after complaining about the i386 crap and x86_64, run the following (compile again):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;g++ -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/opt/local/include -I/opt/local/include -c QuantLib/quantlib_wrap.cpp -o build/temp.macosx-10.6-intel-2.7/QuantLib/quantlib_wrap.o -Wno-unused&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5) Link again:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;g++ -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.6-intel-2.7/QuantLib/quantlib_wrap.o -L/opt/local/lib -L/opt/local/lib -lQuantLib -o build/lib.macosx-10.6-intel-2.7/QuantLib/_QuantLib.so&lt;/p&gt;&#xA;&#xA;&lt;p&gt;6) DON'T USE python setup.py install&lt;/p&gt;&#xA;&#xA;&lt;p&gt;7) Run python setup.py test, check if it works&lt;/p&gt;&#xA;&#xA;&lt;p&gt;8) copy the QuantLib folder in build/lib.macosx-10.6-intel-2.7/ to python site-packages (Frameworks/Python.framework/Versions/2.7/lib/Python2.7/site-packages&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Test it in the interpreter. Things that others can pursuit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Honestly, I don't know the reason for the two arch flags in the build process (-arch i386 -arch x86_64), but I know that this is the problem for linking the libs. I checked everything in the setup.py and the environment variables, I don't know where it is set. Also, I don't know why the sudo python setup.py install fails to move properly the files.&lt;/p&gt;&#xA;" OwnerUserId="25933" LastActivityDate="2016-12-30T23:20:11.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31739" PostTypeId="2" ParentId="31732" CreationDate="2016-12-31T14:03:48.093" Score="1" Body="&lt;p&gt;For stocks, here are some possibilities:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(i) you could assume the level of the VIX index as a measure of the sytemic volatility&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(ii) you could take the VIX, scaled by the beta of your specific stock, as a measure of underlying volatility&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(iii) you could build a model which allows for the volatility for each day to be specified.  You would then give each day a label as follows:  earnings announcement, Fed announcement, election day, and no event.  (as many specific events as you like).  Using a least squares approach, or just using educated guesswork, you then solve for the volatility of each type of day such that the implied volatility of any observable option is respected.  For example, if a 1 month option on the stock is trading at 26% vol, then the sum of the squares of the percent moves on all the constituent days must add up to 26^2.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The approach (iii) is the type of model used by short dated option traders on the street.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2016-12-31T14:03:48.093" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31740" PostTypeId="1" CreationDate="2016-12-31T17:45:34.737" Score="8" ViewCount="338" Body="&lt;p&gt;In MPT, very much effort by researchers is put into developing methods and techniques to handle the rather poor performance of the estimated means, variances and covariances. There are shrinkage estimations, random matrix theory or approaches that address the optimization constraints, for example. Some of them are very complex and sophisticated and in turn require excessive data processing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the same time, all these estimation problems arise from the assumption that asset returns are i.i.d. and moreover normally distributed. It has been shown numerous times that these assumptions are contradicted by empirical evidence. Researchers do not seem to agree on how to classify the probability distribution of asset returns. Some mention the classification as an $\alpha$-stable distribution other than the normal distribution, others suppose to classify asset returns as some non-normal distribution with finite second moments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: Why don't researchers focus on developing a more adequate distribution of asset returns? I mean, handling the estimation errors seems like approaching the problem from the wrong side to me. Wouldn't it be more promising to find an adequate probability distribution of asset returns and to develop models that implement this distribution? Instead of correcting the errors, one would be able to avoid them from the very beginning. I hope I'm not overlooking something. But from what I've seen so far, the focus really seems to be on estimation error reduction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm just asking out of my own interest, because I've been wondering about this. It's quite astonishing to see the above mentioned assumptions being applied although they have been proven to be inadequate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot in advance and have a good start into the new year.&lt;/p&gt;&#xA;" OwnerUserId="25669" LastEditorUserId="25669" LastEditDate="2016-12-31T21:06:22.380" LastActivityDate="2017-06-15T21:09:40.520" Title="Portfolio Theory: Why is so much effort put into the reduction of estimation errors?" Tags="&lt;statistics&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;&lt;normal-distribution&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31741" PostTypeId="1" CreationDate="2016-12-31T20:45:39.640" Score="0" ViewCount="59" Body="&lt;p&gt;Consider as in (&lt;a href=&quot;https://arxiv.org/abs/1406.5414&quot; rel=&quot;nofollow noreferrer&quot;&gt;1&lt;/a&gt;, Definition 2.1) a convex subset $\mathcal{X}_1$ of the set of semimartingales $\mathbb{S}$ satisfying the following properties:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$X_0=0$&lt;/li&gt;&#xA;&lt;li&gt;$X_t\geq -1$ for all $t\geq 0$&lt;/li&gt;&#xA;&lt;li&gt;for all bounded predictable strategies $H,G\geq 0$, $X,Y\in\mathcal{X}_1$ with $H_tG_t=0$ for all $t\geq 0$ and $Z=H\dot\ X + G\dot\ Y\geq -1$, it holds that $Z\in\mathcal{X}_1$&lt;/li&gt;&#xA;&lt;li&gt;being closed in the Emery topology&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This set represents some wealth processes, as stated in the remark after the definition: Let $S$ be a semi-martingale and set $\mathcal{X}_1:=\{\varphi\dot\ S|\varphi\text{ is }S\text{-integrable and } (\varphi\dot\  S)\geq -1)\}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Condition 1 states, that the accumulated income of the portfolio at time zero is zero and condition 2 states, that the accumulated loss of the portfolio is bounded from below by $-1$. But what is the financial motivation of condition 3?&lt;/p&gt;&#xA;" OwnerUserId="24797" LastEditorUserId="24797" LastEditDate="2017-01-03T23:29:41.970" LastActivityDate="2017-01-03T23:29:41.970" Title="Concatenation property of a set of semimartingales" Tags="&lt;stochastic-processes&gt;&lt;finance-mathematics&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31743" PostTypeId="1" AcceptedAnswerId="31753" CreationDate="2017-01-01T06:00:00.517" Score="3" ViewCount="1599" Body="&lt;p&gt;&lt;strong&gt;Background&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My final objective is to find a portfolio located on the efficient frontier from a choice of 100 stocks from a stock index (eg. S&amp;amp;P500). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This efficient portfolio will be such that its variance is the same as the stock index variance. &lt;strong&gt;Wrapping it up, maximizing return for a given target risk&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Problem&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I first learned how to use the PortfolioAnalytics package but I got an error from the function create.efficientFrontier whenever I passed the argument &lt;strong&gt;type=&quot;mean-StdDev&lt;/strong&gt;&quot; to the function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without a solution for the problem above, I decided to use the fPortfolio package. I got an efficient frontier but  I can't get a matrix with the weights, returns and variance together so I can do a binary search on the variance column and then select the corresponding weights (maybe there is a way but I'm new to R).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without a solution for the problem above, I decided to go straight to the solve.QP solution. I finally was able to do what I wanted in the first place.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once I got an efficient frontier, I decided to compare it with the one I got from fPortfolio. For my surprise, the variance results differ significantly while returns are the same. Once I troubleshot, I found out that the difference was due to the Dmat argument, ie, the covariance matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm passing &lt;strong&gt;Dmat &amp;lt;- Cov * 2&lt;/strong&gt; to the &lt;strong&gt;solve.QP function&lt;/strong&gt; but if I instead use &lt;strong&gt;Dmat &amp;lt;- Cov&lt;/strong&gt; then I get the same results from fPortfolio. Nothing changed, same dataset, same constraints. &lt;strong&gt;&lt;em&gt;Obviously, the variance of the portfolios from solve.QP is twice the variance of those from fPortfolio.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;I'm using the most basic default configuration in fPortfolio, i.e., only passing the returns dataset to it.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;MV Portfolio Frontier &#xA; Estimator:         covEstimator &#xA; Solver:            solveRquadprog &#xA; Optimize:          minRisk &#xA; Constraints:       LongOnly&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have come across some codes in the web &lt;strong&gt;multiplying the covariance matrix by 2&lt;/strong&gt; and passing this as &lt;strong&gt;Dmat&lt;/strong&gt;. Yet, some other codes &lt;strong&gt;simply pass the covariance matrix as Dmat&lt;/strong&gt; to the solve.QP function (i.e, &lt;strong&gt;without multiplying it by 2&lt;/strong&gt;). &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;Which approach is correct?&lt;/em&gt;&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;From my investigation of quadratic programming and the solve.QP function, I believe the covariance matrix &lt;strong&gt;must be multiplied by 2&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The solve.QP routine implements the dual method of Goldfarb and Idnani&#xA;  (1982, 1983)  for solving quadratic programming problems of the form &#xA;      min(-d^T b + 1/2 b^T D b) with the constraints A^T b &gt;= b_0.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The mean-variance optimization (efficient frontier) is a quadratic programming problem of the form min(w^T D w - q R^T w) with the constraints A^T w &gt;= w_0.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;Therefore, when translating the MV objective function to the equivalent form used by solve.QP, the covariance matrix must be multiplied by 2&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However, this would imply that &lt;strong&gt;&lt;em&gt;the code from fPortfolio is incorrect&lt;/em&gt;&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Has anybody noticed this behavior of fPortfolio before?&lt;/strong&gt; &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;I guess I'm missing something very basic in here!&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Code&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;eff.frontier &amp;lt;- function (ret, max.allocation=NULL, rf=0, risk.limit=.5, risk.increment=.005)&#xA;{          &#xA;  Dmat &amp;lt;- 2 * cov(ret)      &#xA;  n &amp;lt;- ncol(Dmat)      &#xA;  Amat &amp;lt;- cbind(1, diag(n))&#xA;  bvec &amp;lt;- c(1, rep(0, n))&#xA;  meq &amp;lt;- 1&#xA;&#xA;  if(!is.null(max.allocation)){&#xA;    Amat &amp;lt;- cbind(Amat, -diag(n))&#xA;    bvec &amp;lt;- c(bvec, rep(-max.allocation, n))&#xA;  }&#xA;&#xA;  nLoops &amp;lt;- risk.limit / risk.increment + 1&#xA;  iLoop &amp;lt;- 1&#xA;&#xA;  eff &amp;lt;- matrix(.0, nrow=nLoops, ncol=n+3)&#xA;  colnames(eff) &amp;lt;- c(colnames(returns), &quot;Return&quot;, &quot;StdDev&quot;, &quot;SharpeRatio&quot;)&#xA;&#xA;  for (i in seq(from=0, to=risk.limit, by=risk.increment))&#xA;    {&#xA;    dvec &amp;lt;- colMeans(ret) * i&#xA;    sol &amp;lt;- solve.QP(Dmat=Dmat, dvec=dvec, Amat=Amat, bvec=bvec, meq=meq)&#xA;    eff[iLoop,&quot;StdDev&quot;] &amp;lt;- sqrt(sum(sol$solution %*% colSums((Dmat * sol$solution))))&#xA;    eff[iLoop,&quot;Return&quot;] &amp;lt;- as.numeric(sol$solution %*% colMeans(ret))&#xA;	eff[iLoop,&quot;SharpeRatio&quot;] &amp;lt;- (eff[iLoop,&quot;Return&quot;]-rf) / eff[iLoop,&quot;StdDev&quot;]&#xA;	eff[iLoop,1:n] &amp;lt;- sol$solution&#xA;    iLoop &amp;lt;- iLoop+1&#xA;    }&#xA;    return(as.data.frame(eff))&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25883" LastEditorUserId="25883" LastEditDate="2017-01-01T23:03:22.427" LastActivityDate="2017-04-19T14:57:13.910" Title="Dmat argument in solve.QP R function: Cov or 2*Cov?" Tags="&lt;portfolio-management&gt;&lt;portfolio&gt;&lt;optimization&gt;&lt;portfolio-optimization&gt;&lt;portfolio-selection&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31744" PostTypeId="2" ParentId="31740" CreationDate="2017-01-01T11:40:07.997" Score="3" Body="&lt;p&gt;In MPT investors maximize ex ante expected return for a given level of ex ante variance. Gaussian-ity or iid-ness of returns are not requirements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is estimating these ex-ante quantities using ex-post transformations of the recent history. Many of the sophisticated techniques that you mention try to offer robustness of ex post estimators in the presence of fat tails and/or lack of iid-ness. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Researchers have correctly (imo) concluded that trying to identify an ever changing 10000-dimensional distribution is futile, therefore it makes sense to try and focus on the quantities of interest only.&lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2017-01-01T11:40:07.997" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31745" PostTypeId="2" ParentId="28140" CreationDate="2017-01-01T12:33:57.177" Score="1" Body="&lt;p&gt;The price of a [K,K+dK] call spread informs you about the risk neutral probability of the underlying being above K.  (Not in the interval (K,K+dK)). This is true regardless of any assumed distribution , lognormal or normal.  Hence true for options on any asset (stocks, interest rates etc).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;No derivative price can tell you anything about P.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-01-01T12:33:57.177" CommentCount="0" CommunityOwnedDate="2017-01-01T12:33:57.177" ContentLicense="CC BY-SA 3.0" />
  <row Id="31746" PostTypeId="1" CreationDate="2017-01-01T13:50:21.053" Score="0" ViewCount="1070" Body="&lt;p&gt;I have 4 risky securities (have returns and var-cov matrix for monthly data), and I can lend at 1% per annum, but borrow at 5% per annum. If i wish to obtain the s.d. of 5%, what is the optimal portfolio? How would I go about solving this? I tried finding tangency portfolios for both rates, but not sure how to proceed from there.&lt;/p&gt;&#xA;" OwnerUserId="25910" LastActivityDate="2017-12-30T17:34:10.447" Title="optimal portfolio with different lending and borrowing rates" Tags="&lt;finance&gt;&lt;portfolio&gt;&lt;portfolio-optimization&gt;&lt;markowitz&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31747" PostTypeId="2" ParentId="31746" CreationDate="2017-01-01T14:21:50.320" Score="1" Body="&lt;p&gt;In this case the Capital Market Line is composed of three sections: (1) a straight line segment from the 1% point on the y axis that is tangent to the frontier at a point T. A (curved) section of the frontier from T to another point S on the frontier. S is determined as the point of tangency of a line from 5% on the y axis to the frontier. And (3) a ray (half line) that starts at S and is part (the rightmost part) of the tangent mentioned earlier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So just draw the frontier, the two tangents, the above mentioned three part Capital Market Line (straight, curved, then straight again) and find the point on the CML having a s.d. of 5%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This figure may help (though unfortunately the points T and S are not clearly labeled as such):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.d42.com/_/rsrc/1272735029294/portfolio/theory/the-efficient-frontier-with-risk-free-lending-and-borrowing/figure_3.7.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.d42.com/_/rsrc/1272735029294/portfolio/theory/the-efficient-frontier-with-risk-free-lending-and-borrowing/figure_3.7.jpg&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2017-01-01T14:51:00.500" LastActivityDate="2017-01-01T14:51:00.500" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31749" PostTypeId="2" ParentId="31740" CreationDate="2017-01-01T21:10:41.140" Score="2" Body="&lt;p&gt;There are two ways to answer your question.  One is direct and has less depth to it, the other is more indirect and has a lot of depth to it.  I will begin with the indirect one because it has wide ranging applications beyond finance or economics and because it should serve as a warning to journal editors and so forth.  Also, it covers an area of statistics that everyone but statisticians have forgotten about.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although the idea of a statistic is rather old, the field of statistics is rather new.  It is probably the newest or nearly newest of all fields.  Aeronautics is older.  Genetics is older.  It opened up a ton of practical questions that it took time to solve.  It has to do with how the field defined as statistic.  A statistic is any function of the data.  This means that almost every statistic is useless as there are uncountably many functions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This led to a process to decide which statistics to keep and which to discard.  This created unexpected results.  If you are finding poor estimators as a result of your theory, then there is a good chance, you are doing it wrong.  In the defense of finance, it has been struggling with this since Mandelbrot published the first empirical refutation of mean-variance finance.  It tried to solve it in the 1960's but a couple of things got in the way.  The first was the use of punch card technology.  Even if work by Eugene Fama or Mandelbrot were correct, it would have resulted in problems that would take decades to solve.  The second was that there was no reason for them to be correct.  There was no theory behind the observations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The unexpected result, in searching for a statistic, was that all Bayesian statistics were admissible.  This was surprising because it was proved with Frequentist axioms.  It also found that all other statistics were valid to the extent they either mapped to a Bayesian measure in a particular case or at the limit.  It provides a test, however.  If you can stochastically dominate a measure, then you drop that measure.  If you hunting for accurate measurements that work, then something deeper is going on and you are missing it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The more direct answer is that the distribution of returns, for the Markowtiz model to be correct, have to have certain properties.  The first is that there needs to be a mean in order to have an expectation in the first place.  Most standard distributions have a mean, but not all do.  The Cauchy distribution and, in general, the Paretian distributions of Mandelbrot's article do not.  The Cauchy distribution is $$\frac{1}{\pi}\frac{\sigma}{\sigma^2+(x-\mu)^2}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second is that if a mean exists, a covariance matrix needs to exist.  Not all distributions with a variance have a covariance in its multivariate form.  The hyperbolic secant distribution is an example of that.  It is $$sech\left(\frac{x-\mu}{\sigma}\right).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There have been attempts to use both in empirical finance.  If either of those distributions are present in the likelihood function, then mean-variance finance is indefensible.  The former is problematic because you cannot form an expectation on your returns in the first place.  They are excluded by the laws of general summation.  The second is a bit more subtle because if the second is present none of the assets can be independent, but none of them can covary either.  They can comove, but not covary.  It creates a very ugly issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a paper that derives the distribution of returns at &lt;a href=&quot;https://ssrn.com/abstract=2828744&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://ssrn.com/abstract=2828744&lt;/a&gt;.  It shows that there are many distributions that can be present.  The logic of the paper is that returns are not data, rather, prices are data.  Returns are transformations of data.  In particular, they are the ratio of jointly distributed variables, a present value and a future value.  The distribution depends upon the rules in use to create the prices.  As a result, stocks have different returns than antiques because the auction process is different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As it happens, all distributions for equity securities include some mixture of a transformation of the Cauchy distribution.  Because the distributions involved lack a sufficient statistic, any point estimator has to lose information, so no non-Bayesian solution exists for projective problems (such as choosing an allocation), and should be avoided for inferential questions if possible.  You cannot avoid them in your true hypothesis is a sharp null hypothesis as there is no good Bayesian solution for sharp null hypotheses.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A population test of the paper can be found at &lt;a href=&quot;https://ssrn.com/abstract=2653151&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://ssrn.com/abstract=2653151&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are also papers to replace the method of pricing options and the rules of econometrics.  Papers to create optimal portfolios and to extend stochastic calculus are in process.  The distributions paper will be presented at the Southerwestern Finance Association Conference in March.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some things will have to change.  You cannot make an assumption of i.i.d. variables, for example.  The entire discussion of the Solow convergence will have to change in economics and so the core of the whole discussion of capital, physical, financial and human.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A lot of focus will end up on the scale parameter.  In the Cauchy distribution, there is no covariance matrix.  If you had a one asset portfolio, denoted $a$, then it may have a scale parameter $\gamma_a$.  If you switch to a two asset portfolio you do not get two scale parameters, let alone a covariance style matrix.  Instead you get a new scale parameter $\gamma_{ab}$.  If you got fancy and used a vector process, all the vectors would jointly share a scale parameter $\gamma_v$.  Taking the logarithm brings you to the hyperbolic secant distribution and so no gain is had.  It also has no covariance matrix, but OLS does.  OLS would be measuring something that does not exist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The headaches are just starting.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2017-01-01T21:10:41.140" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31751" PostTypeId="2" ParentId="31528" CreationDate="2017-01-01T23:52:59.987" Score="1" Body="&lt;p&gt;Interactive Brokers posted a webinar on Dec 13 2016 about using IBridgePy to connect to IB's API. &lt;a href=&quot;https://www.youtube.com/watch?v=hogXB07OJ_I&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.youtube.com/watch?v=hogXB07OJ_I&lt;/a&gt;.&#xA;It is pretty easy to request real time price of option data. You may check out the website of IBridgePy at www.IBridgePy.com&#xA;To learn how to use it, you may refer to its documentation.&lt;/p&gt;&#xA;" OwnerUserId="25612" LastActivityDate="2017-01-01T23:52:59.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31752" PostTypeId="1" AcceptedAnswerId="31860" CreationDate="2017-01-02T01:23:15.710" Score="1" ViewCount="1347" Body="&lt;p&gt;New to using PortfolioAnalytics (and fairly new to R in general) and am encountering an error when running &lt;code&gt;optimize.portfolio.rebalance&lt;/code&gt; -- see below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Error in UseMethod(&quot;extractObjectiveMeasures&quot;) : &#xA;  no applicable method for 'extractObjectiveMeasures' applied to an object of class &quot;c('simpleError', 'error', 'condition')&quot;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've looked at the vignette and package documentation on CRAN, but haven't been able to figure out what might be causing this specific problem. &lt;code&gt;optimize.portfolio&lt;/code&gt; seems to work fine with the same constraints and objectives. Perhaps I haven't loaded all of the required libraries? Open to any other suggestions. Thank you.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Load packages&#xA;library(xts)&#xA;library(ROI)&#xA;library(doParallel)&#xA;library(PortfolioAnalytics)&#xA;&#xA;# Define pseudo dates and returns (format as xts)&#xA;dates &amp;lt;- seq(from = as.Date(&quot;2016-01-01&quot;), to = as.Date(&quot;2016-12-01&quot;), by = &quot;month&quot;)&#xA;returns &amp;lt;- as.xts(data.frame(&quot;A&quot; = runif(12, -.05, .05), &#xA;                         &quot;B&quot; = runif(12, -.10, .20), &#xA;                         &quot;C&quot; = runif(12, -.15, .30)), &#xA;                  order.by = dates)&#xA;&#xA;# Register doParalell session (PortfolioAnalytics suggests this when running optimizations w/ rebals)&#xA;registerDoParallel(cores = 2)&#xA;&#xA;# Initiate portfolio object&#xA;port &amp;lt;- portfolio.spec(assets = colnames(returns))&#xA;&#xA;# Add constraints &#xA;port &amp;lt;- add.constraint(portfolio = port, type = &quot;long_only&quot;)&#xA;port &amp;lt;- add.constraint(portfolio = port, type = &quot;full_investment&quot;)&#xA;port &amp;lt;- add.constraint(portfolio = port, type = &quot;box&quot;, min = 0.02, max = 0.40)&#xA;&#xA;# Add objectives - want to maximize Sharpe Ratio&#xA;port &amp;lt;- add.objective(portfolio = port, type = &quot;risk&quot;, name = &quot;StdDev&quot;)&#xA;port &amp;lt;- add.objective(portfolio = port, type = &quot;return&quot;, name = &quot;mean&quot;)&#xA;&#xA;# Run optimization WITHOUT rebalancing - THIS SEEMS TO RUN FINE...&#xA;portOPT &amp;lt;- optimize.portfolio(R = returns,&#xA;                              portfolio = port,&#xA;                              optimize_method = &quot;ROI&quot;,&#xA;                              maxSR = TRUE)&#xA;portOPT&#xA;&#xA;# Run optimization with rebalancing&#xA;portOPT.R &amp;lt;- optimize.portfolio.rebalancing(R = returns,&#xA;                                            portfolio = port,&#xA;                                            optimize_method = &quot;ROI&quot;,&#xA;                                            maxSR = TRUE,&#xA;                                            training_period = 6,&#xA;                                            rebalance_on = &quot;months&quot;)&#xA;portOPT.R&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I'm running Windows 10 and thought it would be helpful to include a list of my currently installed packages: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://docs.google.com/spreadsheets/d/1JLauyCpmDg3DOztRJKntoZ2LFMxV4_ouLOKYUVenEAA/edit?usp=sharing&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://docs.google.com/spreadsheets/d/1JLauyCpmDg3DOztRJKntoZ2LFMxV4_ouLOKYUVenEAA/edit?usp=sharing&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="25945" LastEditorUserId="25945" LastEditDate="2017-01-04T20:43:30.373" LastActivityDate="2017-01-10T03:01:10.513" Title="PortfolioAnalytics [R] - optimize.portfolio.rebalancing error" Tags="&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;&lt;asset-allocation&gt;&lt;rebalancing&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31753" PostTypeId="2" ParentId="31743" CreationDate="2017-01-02T06:16:51.230" Score="1" Body="&lt;p&gt;The results that you are getting from &lt;strong&gt;fPortfolio&lt;/strong&gt; package are correct. And if you do not multiply your covariance matrix by 2 you will get the same result from &lt;strong&gt;quadprog&lt;/strong&gt; package. So, either use &lt;strong&gt;fPortfolio&lt;/strong&gt; or &lt;strong&gt;quadprog&lt;/strong&gt; without 2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;1/2&quot; in that formula that you sited might be referring to some specific problem. However, I have also seen this multiplication by 2 approach in portfolio optimization studies. For example, Eric Zivot used this method in his materials. I do not think that this is correct. To be sure, I advise you to go through a simple example using Excel, manually completing all the step required.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looked into this problem little further and tried the following code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(fPortfolio)&#xA;library(quadprog)&#xA;ret = 100 * LPP2005.RET[,1:6]&#xA;Dmat1 &amp;lt;- cov(ret)     &#xA;Dmat2 = 2 * cov(ret)&#xA;Dmat3 = 10 * cov(ret)&#xA;n &amp;lt;- ncol(Dmat)      &#xA;dvec = rep(0, n)&#xA;Amat &amp;lt;- cbind(rep(1, n), diag(n))&#xA;bvec &amp;lt;- c(1, rep(0, n))&#xA;meq &amp;lt;- 1&#xA;## Dmat&#xA;## n&#xA;## dvec&#xA;## Amat&#xA;## bvec&#xA;qp.out1 = solve.QP(Dmat, dvec, Amat, bvec, meq, FALSE)&#xA;qp.out2 = solve.QP(Dmat, dvec, Amat, bvec, meq, FALSE)&#xA;qp.out3 = solve.QP(Dmat, dvec, Amat, bvec, meq, FALSE)&#xA;qp.out1$solution&#xA;qp.out2$solution&#xA;qp.out3$solution&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I got the same weights for all &lt;code&gt;Dmats&lt;/code&gt;. So it looks like in getting weights multiplying your covariance matrix by a constant doesn't change the optimization result. However, when you are building your &lt;code&gt;eff.frontier&lt;/code&gt; you are still passing those n times multiplied covariance matrix to get your standard deviations:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;eff[iLoop,&quot;StdDev&quot;] &amp;lt;- sqrt(sum(sol$solution %*% colSums((Dmat * sol$solution))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I think the solution is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;eff[iLoop,&quot;StdDev&quot;] &amp;lt;- sqrt(sum(sol$solution %*% colSums((cov(ret) * sol$solution)))) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="19096" LastEditorUserId="19096" LastEditDate="2017-01-03T07:26:24.517" LastActivityDate="2017-01-03T07:26:24.517" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="31755" PostTypeId="1" CreationDate="2017-01-02T14:24:41.107" Score="0" ViewCount="3443" Body="&lt;p&gt;Suppose that there is no risk free asset whatsoever. In addition I have a market portfolio which consists of 4 stocks. How can I identify a zero beta portfolio? Shouldn't it actually have  expected return which is equivalent to the risk free asset? I am a bit confused. &lt;/p&gt;&#xA;" OwnerUserId="25910" LastEditorUserId="467" LastEditDate="2017-01-03T06:50:06.913" LastActivityDate="2017-08-12T20:36:09.313" Title="How can I identify a zero beta portfolio?" Tags="&lt;portfolio-optimization&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31756" PostTypeId="2" ParentId="31755" CreationDate="2017-01-02T15:11:40.597" Score="3" Body="&lt;p&gt;Suppose you construct a portfolio $P$ using the 4 stocks with some weights $w_1$, $w_2$, $w_3$ and  $w_4$. Then :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Compute your portfolio's PnL:  $P(t)$,&lt;/li&gt;&#xA;&lt;li&gt;Regress $P(t)$ on $M(t)$ (where $M(t)$ is the market return) on a specified time-horizon that you must choose. You obtain a coefficient $b$.&lt;/li&gt;&#xA;&lt;li&gt;Then consider the new portfolio $P'$ defined as $P'(t)=P(t)-bM(t)$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$P'$ is then a zero-beta portfolio. However you must frequently compute the regression to adjust the coefficient $b$.&lt;/p&gt;&#xA;" OwnerUserId="25949" LastEditorUserId="467" LastEditDate="2017-01-03T06:53:12.833" LastActivityDate="2017-01-03T06:53:12.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31757" PostTypeId="1" AcceptedAnswerId="31758" CreationDate="2017-01-02T16:23:51.790" Score="0" ViewCount="221" Body="&lt;p&gt;Let $W_T$ denote normalised univariate Brownian motion and let&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_t = W_t^2 + \alpha W_t + \beta t + \gamma$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\alpha, \beta$ and $\gamma$ are constants. Determine conditions on these constants such that $X_t$ is a Martingale.&lt;/p&gt;&#xA;" OwnerUserId="25951" LastActivityDate="2017-01-02T17:25:06.257" Title="Determine the conditions for Brownian motion to be a Martingale" Tags="&lt;brownian-motion&gt;&lt;martingale&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31758" PostTypeId="2" ParentId="31757" CreationDate="2017-01-02T17:18:20.387" Score="2" Body="&lt;p&gt;Hint&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $s&amp;lt;t$.&#xA;$$E[W_t^2|F_s]=E[(W_t-W_s)^2|F_s]+2 E[(W_t-W_s)W_s|F_s]+E[W_s^2|F_s]$$&#xA;so&#xA;$$E[W_t^2|F_s]=E[(W_t-W_s)^2]+2W_s E[(W_t-W_s)]+W_s^2=t-s+W_s^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E[\alpha  W_t|F_s]=\alpha  E[W_t-W_s|F_s]+\alpha E[ W_s|F_s]=\alpha  E[W_t-W_s]+\alpha  W_s=\alpha  W_s$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E[\beta t+\gamma |F_s]=\beta t +\gamma$$&lt;/p&gt;&#xA;" OwnerUserId="20945" LastEditorUserId="20945" LastEditDate="2017-01-02T17:25:06.257" LastActivityDate="2017-01-02T17:25:06.257" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="31762" PostTypeId="2" ParentId="31755" CreationDate="2017-01-02T18:28:46.880" Score="3" Body="&lt;p&gt;There is a graphical method of solving this problem. Any portfolio say P, Q, M has a counterpart on the frontier that has zero covariance with it (with one exception).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the given portfolio say M draw a tangent to the frontier that intersects the y axis at a point $R_M$. This point plays a role similar to the risk free rate. From this point draw a horizontal line until it intersect the frontier at $Z(M)$. This portfolio has zero covariance with M and therefore when M is the market portfolio $Z(M)$ is the zero-beta portfolio. It is on the inefficient side of the frontier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See diagram here&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://images.slideplayer.com/6/1619405/slides/slide_42.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://images.slideplayer.com/6/1619405/slides/slide_42.jpg&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: the concept of the zero-beta portfolio was invented by Fischer Black to deal with the situation where there is no risk free asset. In this situation the zero beta portfolio plays a role similar (but not exactly the same) as the risk free asset if the risk free asset existed.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-01-02T18:28:46.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31763" PostTypeId="2" ParentId="31732" CreationDate="2017-01-02T18:52:37.563" Score="1" Body="&lt;p&gt;&lt;strong&gt;Basic Setup&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's first assume that the &quot;base&quot; dynamics of the asset (that is at all times except for the event) follow a geometric Brownian motion (GBM) with diffusion coefficient $\sigma$. The jump itself is a normally distributed random variable $Z \sim \mathcal{N} \left( -\frac{1}{2} \xi^2, \xi^2 \right)$. Note that we cannot specify the mean jump size as it is implicitly imposed by the martingale property of the discounted asset price process. Let $X_t = \ln \left( S_t / S_0 \right)$ be the logarithmic return process. Then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;X_t = \left( r - \frac{1}{2} \sigma^2 \right) t + \sigma W_t + Z \mathrm{1} \left\{ t \geq t_\text{J} \right\},&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $t_\text{J}$ is the jump time. It follows that $X_t$ is normally distributed with&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;X_t \sim \mathcal{N} \left( \left( r - \frac{1}{2} \sigma^2 \right) t - \frac{1}{2} \xi^2 \mathrm{1} \left\{ t \geq t_\text{J} \right\}, \sigma^2 t + \xi^2 \mathrm{1} \left\{ t \geq t_\text{J} \right\} \right).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, the implied volatility for an option with expiry in $T$ is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\sigma^{\text{IV}}(T) = \sqrt{\frac{1}{T} \left( \sigma^2 T + \xi^2 \mathrm{1} \left\{ T \geq t_\text{J} \right\} \right)}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let for example $\sigma = 20\%$, $\xi = 5\%$ and $t_\text{J} = 7$ days (blue) and $t_\text{J} = 5$ days (red). The corresponding implied volatiity term structures are&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/IUov2.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/IUov2.png&quot; alt=&quot;Term-structures of implied volatilities in Black and Scholes (1976) with an event jump.&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This suggests two approaches to calibrate the model:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;To the cross section of implied volatilities for two or more maturities. At least one of these maturities has to be longer than $t_\text{J}$.&lt;/li&gt;&#xA;&lt;li&gt;To the time series of implied volatilities for a single option that matures after $t_\text{J}$.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In each case, we use the above expression for $\sigma^{\text{IV}}$ and calibrate the parameters $\sigma$ and $\xi$ to match the inputs, e.g. in a least-squares sense. Of course we can also mix both methods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the presence of an implied volatility smile, we could try and apply the above approach to the at-the-money volatilities. However, even then the assumption of a flat base term structure is usually too restrictive and we might consider using a parametrization for $\sigma(t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;More General Setup&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to simultaneously calibrate our model to the cross section of all listed options, we need to use more complex base dynamics. Let the logarithmic return process be defined as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;X_t = r t + \underbrace{Y_t - \ln \left( \phi_{Y_t}(-\mathrm{i}) \right)}_{\text{base dynamics}} + \underbrace{\left( Z - \ln \left( \phi_{Z}(-\mathrm{i}) \right) \right) \mathrm{1} \left\{ t \geq t_\text{J} \right\}}_{\text{jump dynamics}}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here $Y$ is the base process, $Z$ is the random jump size and $\phi_{Y_t}(\omega)$ and $\phi_Z(\omega)$ are the corresponding characteristic functions. We can then compute European options prices using the same Fourier inversion methods that we use for our base dynamics anyways.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example: Assume that $Y$ is driven by a Bates (1996) stochastic volatility and jump diffusion process of the form&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\mathrm{d}Y_t &amp;amp; = &amp;amp; -\frac{1}{2} V_t \mathrm{d}t + \sqrt{V_t} \mathrm{d}W_t^Y + \sum_{i = 1}^{N_t} A_i,\\&#xA;\mathrm{d}V_t &amp;amp; = &amp;amp; \kappa \left( \theta - V_t \right) \mathrm{d}t + \nu \sqrt{V_t} \mathrm{d}W_t^V&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\mathrm{d} \langle W^Y, W^V \rangle_t = \rho \mathrm{d}t$, $N$ is a compound Poisson process with activity rate $\lambda$ and $\left\{ A_i \right\}_{i = 1}^\infty$ is a sequency of i.i.d. $\mathcal{N} \left( \alpha, \beta^2 \right)$ normal random variables. We fix the following parameters: $S_0 = 100$, $r = 0\%$, $\sqrt{V_0} = 15\%$, $\kappa = 2.0$, $\sqrt{\theta} = 25\%$, $\nu = 100\%$, $\rho = -50\%$, $\lambda = 15$, $\alpha = -1.0\%$, $\beta = 2.5\%$, $t_J = 14$ days and $\xi = 5\%$. We get the following short term implied volatility smiles:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Lrkbo.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Lrkbo.png&quot; alt=&quot;Sample implied volatility smiles under Bates (1996) with an event jump.&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-01-02T21:40:38.857" LastActivityDate="2017-01-02T21:40:38.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31765" PostTypeId="1" CreationDate="2017-01-02T20:34:12.123" Score="0" ViewCount="73" Body="&lt;p&gt;This question is not about where to gain access to data - but how to properly cite it. Frequently in publications like the WSJ or Bloomberg, the data is cited as &quot;Bloomberg&quot; or &quot;WSJ&quot;. For example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/X7Rpw.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/X7Rpw.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Doesn't this data belong to Stoxx? Or even more granularly, to the exchange that is executing orders on the constituent stocks? &lt;/p&gt;&#xA;" OwnerUserId="20194" LastActivityDate="2017-05-03T19:45:43.570" Title="Data Sources - When citing source" Tags="&lt;data-source&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31766" PostTypeId="1" CreationDate="2017-01-03T03:30:39.270" Score="4" ViewCount="282" Body="&lt;p&gt;In Shreve's book, the value of cash flow for a future of discrete case is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\dfrac{1}{D(t)}E\Big[\sum\limits_{j=k}^{n-1}D(t_{j+1})(\textrm{Fut}_S(t_{j+1},T)-\textrm{Fut}_S(t_j,T))\Big|\mathcal{F}(t)\Big]$$&#xA; The continuous version is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\dfrac{1}{D(t)}E\Big[\int_t^T D(u)\textrm{d} \textrm{Fut}_S(u,T) \Big|\mathcal{F}(t)\Big]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But you know that Ito integral chooses the left-hand endpoint, we should replace $D(t_{j+1})$ by $D(t_j)$ in the first equation, the version in  Shreve's book is actually the right-hand endpoint, but the author always regards as a Ito integral. So where is my misunderstanding? Here $D(t)$ is discounted factor. &lt;/p&gt;&#xA;" OwnerUserId="25797" LastEditorUserId="25797" LastEditDate="2017-01-04T04:29:52.000" LastActivityDate="2017-12-30T11:37:37.873" Title="Value of cash flow for a future in Shreve's book" Tags="&lt;futures&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31767" PostTypeId="2" ParentId="31755" CreationDate="2017-01-03T07:36:14.373" Score="2" Body="&lt;p&gt;How to build a 0-$\beta$ portfolio was addressed by the two other answers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the second part of your question:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Shouldn't it actually have expected return which is equivalent to the&#xA;  risk free asset?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Under the CAPM:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}(r_a - r_f) = \beta(r_m-r_f) \Longleftrightarrow \mathbb{E}(r_a) = r_f+\beta(r_m-r_f)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, indeed $\beta=0 \Longrightarrow \mathbb{E}(r_a) = r_f$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nevertheless, a lot of people either do not believe in the CAPM or at least want to exploit small arbitrage opportunities around it. These people would expect to have another return on top of the risk-free rate. A typical example of people doing this for living are market-neutral hedge-funds.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2017-01-03T07:36:14.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31768" PostTypeId="2" ParentId="31766" CreationDate="2017-01-03T09:50:44.120" Score="1" Body="&lt;p&gt;Let $\mathcal {V} =\mathcal {V}(t,T)$ be the class of functions&#xA;$$f(t,\omega):[0,\infty)\times\Omega\to\mathbb{R}$$&#xA;such that&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$(t,\omega)\to f(t,\omega)$ is $\mathcal{B}\times\mathcal{F}$ where $\mathcal{B}$ denotes the Borel algebra on $[0,\infty)$.&lt;/li&gt;&#xA;&lt;li&gt;$f(t,\omega)$ is $\mathcal{F}_t$ adapted.&lt;/li&gt;&#xA;&lt;li&gt;$\mathbb{E}\left[\int_{t}^{T}f^2(s,\omega)ds\right]&amp;lt;\infty$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Suppose $f\in\mathcal V(t,T)$ and that $t\to f(t,\omega)$ is continuous  .  Let $I=\{u_i\}_{i=0}^{n}$ is a sequence of partitions of $[t,T]$, Indeed $t=u_0&amp;lt;u_1&amp;lt;\cdots&amp;lt;u_n=T$ .By definition of Ito integral, we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\int\limits_t^T f(u,\omega)dW(u,\omega)=\lim_{\Delta u_j\to0}\sum_{j=0}^{n-1}f(u_j,\omega)(\,W(u_{j+1},\omega)-W(u_{j},\omega)\,)\qquad,\quad\text{ in }\, L^2(P).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly we define the &lt;em&gt;Stratonovich integral&lt;/em&gt; of $f$ by &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\int\limits_t^T f(s,\omega)\circ dW(u,\omega)=\lim_{\Delta u_j\to0}\sum_{j=0}^{n-1}f(u_j^*,\omega)(\,W(u_{j+1},\omega)-W(u_{j},\omega)\,)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $u_j^*=\frac12(u_j+u_{j+1}),$ whenever the limit exists in $L^2(P)$. In general these integrals are different. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I think the value of cash flow for a future of discrete case is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\dfrac{1}{D(t)}\mathbb{E}\left[\sum\limits_{j=k}^{n-1}D(t_{j})(\,\textrm{Fut}_S(t_{j+1},T)-\textrm{Fut}_S(t_j,T)\,)\Big|\mathcal{F}_t\right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thus the continuous version is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\dfrac{1}{D(t)}\mathbb{E}\Big[\int_t^T D(u)\textrm{d} \textrm{Fut}_S(u,T) \Big|\mathcal{F}(t)\Big]$$&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorDisplayName="user16651" LastEditDate="2017-01-03T09:57:13.757" LastActivityDate="2017-01-03T09:57:13.757" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="31769" PostTypeId="2" ParentId="31733" CreationDate="2017-01-03T12:51:52.747" Score="1" Body="&lt;p&gt;I would say that generally it depends on the frequency of the orders you intend to send to your providers. If you have a cancel strategy to cancel market orders that aren't filled, as the market moves, then use market orders. If you have a lower frequency strategy where you don't intend to cancel orders, then use pegged orders, which are basically limit orders. This is to keep your providers happy with order frequencies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other than that I suppose a limit order allows you to specify an execution price - barring slippage - anywhere, as opposed to a market order which is either executed at market by your provider, or a bid / offer is put in the book (basically like a limit order) which may or may not be executed before you cancel.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since a private dealer isn't legally required to make a market, then you aren't required to submit market orders... which could be an advantage depending on what your trading strategy is.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastEditorUserId="7369" LastEditDate="2017-01-03T13:11:07.140" LastActivityDate="2017-01-03T13:11:07.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31771" PostTypeId="1" CreationDate="2017-01-03T14:59:24.527" Score="1" ViewCount="460" Body="&lt;p&gt;I have a time series of daily returns and and I computed the conditional variances by means of a Garch model. Now I would like to built a regression with some other monthly data and the previously computed daily variances. What is the best way to deal with it? How would I convert the daily into monthly variances? &lt;/p&gt;&#xA;" OwnerUserId="25963" LastActivityDate="2017-01-04T02:51:19.590" Title="How to convert daily conditional variances into monthly?" Tags="&lt;volatility&gt;&lt;programming&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31772" PostTypeId="2" ParentId="31765" CreationDate="2017-01-03T17:22:38.170" Score="2" Body="&lt;p&gt;The data belongs to Stoxx but you accessed it using Bloomberg. &#xA;To proper cite you should use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;The stock level data come from Bloomberg Ticker XXX accessed on 03 Jan, 2017, [link here if applicable].&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See some examples of those type of citations: &#xA;&lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S1058330007000262&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.sciencedirect.com/science/article/pii/S1058330007000262&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2017-01-03T17:22:38.170" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31773" PostTypeId="2" ParentId="31771" CreationDate="2017-01-03T18:15:05.137" Score="1" Body="&lt;p&gt;One of the approaches in Literature to aggregate volatility estimates from &quot;weak&quot; GARCH processes is the Drost Nijman scaling as presented in &lt;a href=&quot;http://finance.martinsewell.com/stylized-facts/dependence/DrostNijman1993.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://finance.martinsewell.com/stylized-facts/dependence/DrostNijman1993.pdf&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Though the square root scaling approach (based on an i.i.d. assumption for returns) is probably often used, refer the paper by Diebold for some weaknesses.  &lt;a href=&quot;http://www.ssc.upenn.edu/~fdiebold/papers/paper18/dsi.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.ssc.upenn.edu/~fdiebold/papers/paper18/dsi.pdf&lt;/a&gt;. This paper also contains a discussion on the Drost Nijman volatility scaling.&lt;/p&gt;&#xA;" OwnerUserId="2504" LastEditorUserId="2504" LastEditDate="2017-01-04T02:51:19.590" LastActivityDate="2017-01-04T02:51:19.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31776" PostTypeId="1" CreationDate="2017-01-03T19:37:17.407" Score="1" ViewCount="80" Body="&lt;p&gt;I have a collection of historical data that I want to fit to the following model&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;y_{t+1} - y_t = \alpha + (\rho + \sigma_2 Z_{t+1} )y_t + \sigma_1 Z_{t+1}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where everything except the y's are constant. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To my understanding this model is something like a normal / lognormal mixture. If I plot my data against a random normal sample it more or less fit a straight line. Had it not been for $\sigma_2$ I'd known what to do  but now its a bit more involved. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks. &lt;/p&gt;&#xA;" OwnerUserId="25456" LastActivityDate="2017-01-03T19:37:17.407" Title="Maximum likelihood for lognormal mixture" Tags="&lt;optimization&gt;&lt;lognormal&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31778" PostTypeId="1" CreationDate="2017-01-03T21:04:04.993" Score="1" ViewCount="771" Body="&lt;p&gt;Supposed we have 1-year call option with a strike of 90 and it costs 10. We also have 1-year put on the same stock with a strike of 100. The risk free rate is 5% per annum. the stock is currently trading at 80. For which price of a put option we can find an arbitrage strategy, for 20 or 30? And what the arbitrage strategy would be? I thought about shorting the put and the stock, and buying the call. According to my calculations it will always yield a non-negative profit, but I am not sure whether I am on the right track. &lt;/p&gt;&#xA;" OwnerUserId="25910" LastActivityDate="2017-01-07T12:28:24.397" Title="Options Arbitrage strategy" Tags="&lt;options&gt;&lt;arbitrage&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31779" PostTypeId="2" ParentId="30844" CreationDate="2017-01-04T03:27:21.187" Score="1" Body="&lt;p&gt;Defining the risk of the portfolio as its variance given by&#xA;$$&#xA;\sigma_p^2 = \sum_{ij}w_i\sigma_{ij}w_j&#xA;$$&#xA;where $w_i$ is the portfolio weight of asset $i$ and $\sigma_{ij}$ is the covariance between asset $i$ and $j$. The risk contribution of asset $k$ to the portfolio variance is&#xA;$$&#xA;\sigma_{pk}^2 = \frac{w_k}{2}\frac{\partial \sigma_p^2}{\partial w_k} = w_k\sum_j\sigma_{kj}w_j&#xA;$$&#xA;where we have used the fact that $\sigma_{ij} = \sigma_{ji}$. Note that $\sigma_{kk} = \sigma_k^2$. It is easy to see that the sum of the individual risk contributions add up to the portfolio variance as&#xA;$$&#xA;\sum_k \sigma_{pk}^2 = \sum_{kj}w_k\sigma_{kj}w_j = \sigma_p^2&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="5107" LastActivityDate="2017-01-04T03:27:21.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31780" PostTypeId="1" CreationDate="2017-01-04T04:56:12.073" Score="1" ViewCount="614" Body="&lt;p&gt;I have ticks data in format: Date, Time, Open, High, Low, Close, Volume.&#xA;11/09/2014,17:00:00,2019.00,2019.00,2019.00,2019.00,5&#xA;11/09/2014,17:00:00,2020.00,2020.00,2020.00,2020.00,25&#xA;11/09/2014,17:00:00,2028.00,2028.00,2028.00,2028.00,20&#xA;11/09/2014,17:00:00,2030.00,2030.00,2030.00,2030.00,10&#xA;11/09/2014,17:00:00,2035.00,2035.00,2035.00,2035.00,30&#xA;11/09/2014,17:00:00,2037.00,2037.00,2037.00,2037.00,15&#xA;11/09/2014,17:00:00,2038.00,2038.00,2038.00,2038.00,10&#xA;11/09/2014,17:00:00,2040.00,2040.00,2040.00,2040.00,40&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to construct range bars from this data with range 2.00. It is clear for me how to built that if difference between high and low reaches strictly 2.00. But there are some cases when that difference becomes more than 2.00. So how many bars will be present in this case? What open, high, low, close, volume values will these bars have?&#xA;I would very appreciate if somebody give me an explanation and convert data I provided to Open, High, Low, Close, Volume format.&lt;/p&gt;&#xA;" OwnerUserId="25970" LastActivityDate="2021-05-10T09:07:05.623" Title="Ticks aggregation into range bar chart" Tags="&lt;tick-data&gt;&lt;ohlc&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31781" PostTypeId="2" ParentId="22232" CreationDate="2017-01-04T06:50:58.873" Score="0" Body="&lt;p&gt;Louis's answer is good.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my understanding, state variables ensure your problem can be stated as a Markov decision problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Think of a balloon landing control problem under fuel consumption constraint.&#xA;Position and fuel level are obviously state variables.&#xA;But Newton principle implies to take into account acceleration. It is often possible by integration of Newton principle, that only speed is needed.&#xA;In the end, your state variables are position, speed, acceleration and fuel level. Your control is the fuel injection to balloon's engine.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2017-01-04T06:50:58.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31782" PostTypeId="1" CreationDate="2017-01-04T08:48:12.257" Score="3" ViewCount="95" Body="&lt;p&gt;My question is about factor investing. In most equity markets (Europe, US) the factors momentum and low volatility have outperformed the cap weighted indices in the last couple of years while the value factor - which in my perception was still &amp;quot;fashionable&amp;quot; as investment style (&amp;quot;we are value-investors...&amp;quot;) - underperformed significantly.&lt;/p&gt;&#xA;&lt;p&gt;The last quarter of 2016 brought a change. After the US presidential election the low vol factor underperformed significantly while value continued its comeback which had already started sooner in 2016.&lt;/p&gt;&#xA;&lt;p&gt;My question: Is this performance spread really due to the &amp;quot;factors&amp;quot; or rather due to the changing outlooks for industry sectors? If the latter were true then a portfolio with factors tilts but approximately sector neutrality could be a remedy to this development.&lt;/p&gt;&#xA;&lt;p&gt;The performance claims above for 2016 can be checked on the &lt;a href=&quot;https://www.msci.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;MSCI webpage &lt;/a&gt;where factsheets for their indices are available showing the performance of the factor indices as well as the cap weighted ones per year. I did not post the performance charts from there as this could be forbidden by MSCI.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2020-12-03T21:43:26.520" LastActivityDate="2020-12-03T21:43:26.520" Title="Underperformance of low vol factor after US presidential election, comeback of Value" Tags="&lt;factor-investing&gt;&lt;low-volatility&gt;&lt;value-investing&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="31783" PostTypeId="1" AcceptedAnswerId="32887" CreationDate="2017-01-04T15:18:32.020" Score="0" ViewCount="372" Body="&lt;p&gt;I would like a general framework for the calibration of the unknown parameters in an arbitrary stochastic differential equation. I have a proposed method that seems reasonable in theory, but is problematic &#xA;in practice. Can you help?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;The method&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Suppose we have the SDE $dX=\mu(t,X)dt+\sigma(t,X)dW$, where $W(t)$ is a Wiener process. And suppose we know a time series realization (&quot;historical data&quot;) $X(t_n)=X_n$ for $n=0,\ldots,N$. And further suppose that the functions $\mu$ and $\sigma$ contain unknown real parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea is to convert the SDE into a finite difference equation (which holds approximately):&#xA;$$X_{n+1}-X_{n} = \mu(t, X_n) (t_{n+1}-t_n)+ \sigma(t, X_n)\sqrt{t_{n+1}-t_n} Z_n.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here: $n=0,\ldots,N-1$ and $Z_n$ are independent random variables, each with a standard normal distribution. Here, I used the heuristic fact that $dW$ is normal with mean 0 and variance $dt$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solving for $Z_n$ gives $Z_n$ as a function of the unknown parameters:&#xA;$$Z_n =\frac{X_{n+1} - X_{n} - \mu(t, X_n)(t_{n+1}-t_n)}{\sigma(t, X_n) \sqrt{t_{n+1} - t_n}}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The liklihood of the time series is given by &#xA;$$\prod_{n=0}^{N-1} \phi(Z_n) = \left( \frac{1}{\sqrt{2 \pi}} \right)^N&#xA;\exp \left( -\frac{1}{2} \sum Z_{n}^{2} \right).$$&#xA;Here, $\phi$ is the probability density of the standard normal. Maximizing the liklihood requires minimization of $\sum Z_n^2$. And this gives the maximum liklihood estimators.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;The problem&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Consider the SDE $dX = \sigma dW$, with unknown $\sigma$. Given historical data, and following the above method, we get&#xA;$$\sum Z_n^2 = \frac{1}{\sigma} \sum \frac{X_{n+1} - X_{n}}{\sqrt{t_{n+1} - t_n}}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, this does not have a minimum wrt $\sigma$ (except for perhaps $\sigma = \infty$, which does not make sense).&lt;/p&gt;&#xA;" OwnerUserId="25979" LastEditorUserId="467" LastEditDate="2017-01-05T05:04:41.693" LastActivityDate="2017-03-07T22:04:36.387" Title="How to calibrate an SDE's by finite difference equation?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;numerical-methods&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31784" PostTypeId="1" CreationDate="2017-01-04T19:16:40.063" Score="5" ViewCount="1774" Body="&lt;p&gt;I'm in the position to calculate a non-parametric volatility estimator for 15 and 30 minutes intervals of the SPY. I got data sampled on second resolution. However, I checked plenty of papers but, as far as I understood them, all of the proposed models are solely applied to measure daily volatility. All of the proposed kernels or subsampling methodologies to deal with microstructure noise and/or jumps are  estimated to get daily volatility. How do I estimate a robust realized volatility measure for the stated intraday frequencies?&lt;/p&gt;&#xA;" OwnerUserId="25980" LastEditorUserId="467" LastEditDate="2017-01-05T05:06:18.923" LastActivityDate="2017-06-09T20:50:03.017" Title="How to compute the realised intraday volatility?" Tags="&lt;volatility&gt;&lt;intraday&gt;" AnswerCount="1" CommentCount="9" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31785" PostTypeId="2" ParentId="235" CreationDate="2017-01-04T20:08:09.067" Score="1" Body="&lt;p&gt;The answer requires reflected Brownin motion&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$w=(\ln (p/b)+rt+ \frac{\sigma^2}{2} t)/(\sqrt{t}\sigma) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$z=(\ln (p/b)-rt- \frac{\sigma^2}{2} t)/(\sqrt{t}\sigma) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$g=2(\frac{\sigma^2}{2}+r)/\sigma^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;probability of hitting=  $N(w)+(b/p)^gN(z)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for $b&amp;gt;p$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$N$ cumulative normal distribution &lt;/p&gt;&#xA;" OwnerUserId="15081" LastActivityDate="2017-01-04T20:08:09.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31786" PostTypeId="2" ParentId="22010" CreationDate="2017-01-04T22:07:53.363" Score="0" Body="&lt;p&gt;It is amazing how careless financial industry is given the amount of oversight and regulation. We've had to disable time check with some parties simply because they refuse to maintain proper time (they just don't give two ****s about that kind of thing).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've come up with another method to estimate the delay. It works for us and our purposes. Record the time order is sent to counter party and compare with when either PENDING NEW or NEW execution report is received. Obviously this isn't perfect for you needs since it doesn't really measure time latency, but thought to share.&lt;/p&gt;&#xA;" OwnerUserId="25982" LastActivityDate="2017-01-04T22:07:53.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31787" PostTypeId="1" AcceptedAnswerId="31789" CreationDate="2017-01-04T23:33:35.407" Score="1" ViewCount="1054" Body="&lt;p&gt;I am taking a time series analysis class that uses &lt;a href=&quot;http://www.eviews.com/home.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;EViews&lt;/a&gt;. What packages in python do equivalent work?&lt;/p&gt;&#xA;" OwnerUserId="19654" LastEditorUserId="467" LastEditDate="2017-01-05T01:32:42.050" LastActivityDate="2017-01-05T01:32:42.050" Title="Which python packages would you recommend for time series analysis?" Tags="&lt;python&gt;&lt;econometrics&gt;&lt;eviews&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31789" PostTypeId="2" ParentId="31787" CreationDate="2017-01-05T01:00:09.983" Score="4" Body="&lt;p&gt;The gold standard for time series analysis in Python is &lt;a href=&quot;http://pandas.pydata.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;pandas&lt;/a&gt;. Pandas was originally developed at AQR to support their in-house research and has since been open-sourced. It has very high-performance implementations for data structures such as &lt;code&gt;Series&lt;/code&gt;, &lt;code&gt;DataFrame&lt;/code&gt;, and &lt;code&gt;Panel&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pandas itself is very rich. Not only does it let you create time series representations effortless, it has built-in utilities for merging time series, plotting data (requires &lt;a href=&quot;http://matplotlib.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;matplotlib&lt;/a&gt;), handling missing data, resampling time series into different frequencies, calculating rolling/expanding-window statistics, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because it's the gold standard, many Python numerical packages work seamlessly with pandas to provide even more capabilities. For example, &lt;a href=&quot;http://statsmodels.sourceforge.net&quot; rel=&quot;nofollow noreferrer&quot;&gt;statsmodels&lt;/a&gt; is a statistical package that lets you run everything from a simple &lt;a href=&quot;http://www.statsmodels.org/dev/examples/notebooks/generated/ols.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;linear regression&lt;/a&gt; to a complicated &lt;a href=&quot;http://www.statsmodels.org/dev/examples/notebooks/generated/statespace_dfm_coincident.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;dynamic factor model&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2017-01-05T01:08:57.093" LastActivityDate="2017-01-05T01:08:57.093" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31790" PostTypeId="1" AcceptedAnswerId="31796" CreationDate="2017-01-05T02:54:50.710" Score="1" ViewCount="245" Body="&lt;p&gt;Are there any commonly traded instruments that would allow one to bootstrap a one week LIBOR curve?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, is there some alternate way to value forward starting swaps with a short first period that use interpolation between one week LIBOR and 1M LIBOR for the coupon of the first floating payment?&lt;/p&gt;&#xA;" OwnerUserId="16684" LastActivityDate="2017-01-05T09:49:21.287" Title="One week LIBOR?" Tags="&lt;interest-rate-swap&gt;&lt;libor&gt;&lt;bootstrapping&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31792" PostTypeId="1" AcceptedAnswerId="31822" CreationDate="2017-01-05T07:47:46.843" Score="0" ViewCount="171" Body="&lt;p&gt;I have a conundrum.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a stock that has had considerable price appreciation over the past year. Well over 100%. I no longer see any factor (or fundamentals) supporting it's current price (in the short term). Having said that though the long term may well see further price appreciation, but I believe that to be 6-9 months+.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have three options in trying to protect the capital / unrealized profit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Sell the stock. Something I don't want to so because I like it for the long term and don't want to take a tax hit now.&#xA;2) Buy an near OTM put - thereby instituting a protective put strategy.&#xA;3) Create a Collar on the position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my predicament. Do I use option (2) or (3)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) Is quite feasible for a shorter dated option &amp;lt;45 days. It's not expensive to buy an OTM put and therefore won't erode capital/unrealized-profit. Buying a longer date put ~100 days is much more expensive and therefore will erode capital.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(3) I have priced and can create a zero cost collar for a longer dated option ~100 days but for this to work (zero cost) I will have very little upside before the stock would be called. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(3.1) Buy a longer dated put (6 months) and sell shorter dated calls (1 month) over time to recover the premium paid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The stock is reasonably volatile so for option (3) it could potentially move in to be called in the short term. &lt;/p&gt;&#xA;" OwnerUserId="25989" LastEditorUserId="25989" LastEditDate="2017-01-05T07:59:20.690" LastActivityDate="2017-01-06T17:11:06.090" Title="To Collar or not to Collar" Tags="&lt;black-scholes&gt;&lt;american-options&gt;&lt;option-strategies&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31796" PostTypeId="2" ParentId="31790" CreationDate="2017-01-05T09:49:21.287" Score="2" Body="&lt;p&gt;There are no traded instruments that would allow a 1w libor curve to be bootstrapped.  If you need to calculate a forward rate for 1week libor in the current environment, I would suggest that it can be bounded as follows :  overnight fed funds &amp;lt; 1 week libor &amp;lt; 1 month libor.   The forward rates on the bounds can be calculated from bootstrapped curves.   &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-01-05T09:49:21.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31797" PostTypeId="2" ParentId="15489" CreationDate="2017-01-05T11:19:18.977" Score="4" Body="&lt;p&gt;You can derive these formulae by tweaking the black scholes derivation.  If you are using PDE method, you will use different boundary conditions.  If you are using integration over the risk neutral probability , you will use a different payoff function but the same risk neutral density.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively , you can observe that these payoffs are combinations of regular puts and calls. For example , the cash or nothing call is the limit of a [E, E+dE] call spread as dE tends to zero, so you can obtain it by differentiating the regular black scholes call price by E.   Then, the asset or nothing call = the regular call option + the cash or nothing call, so you can derive that one as well.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-01-05T11:19:18.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31798" PostTypeId="1" AcceptedAnswerId="31817" CreationDate="2017-01-05T13:58:23.683" Score="0" ViewCount="140" Body="&lt;p&gt;I might be asking a very simple question for the FX experts...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to check the HistSim VaR process for a currency NDF.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the PV for the product is defined as:- &#xA;   (f(T) - K)*discFactor(DOM,T)*N&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;f is the forward outright for the NDF ccy pair&#xA;k is the strike&#xA;T is the maturity&#xA;discFactor(DOM,T) is the domestic discount factor&#xA;N is the foreign ccy&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This can be re-written as = (Spot + Swap_point(T) - k)* discFactor(DOM,T)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I then right in saying that the risk_factors are:-&#xA;   1) Spot&#xA;   2) the forward fxSwap point&#xA;   3) domestic risk-free rate ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For VaR, I will also need the correlation between each of these risk-factor &#xA;   changes&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, for USDCNY where base = USD, I am guessing I need to switch from Base=USD to Base=CNY&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="24131" LastActivityDate="2017-01-06T10:58:08.410" Title="fx : HistSim VaR for currency NDFs" Tags="&lt;fixed-income&gt;&lt;fx&gt;&lt;var&gt;&lt;currency&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31800" PostTypeId="1" AcceptedAnswerId="31820" CreationDate="2017-01-05T16:47:07.043" Score="6" ViewCount="17016" Body="&lt;p&gt;Is there any regular relationship between Delta and the Time-To-Expiry of an option?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have observed that options that expiry sooner are more sensitive to underlying movements (with equal strikes). Is there any way to justify this relationship?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suppose that at some point as well as the options get's closer to the expiry it's delta will be much lower for deep-in-the money or deep-out-of-the-money option.&lt;/p&gt;&#xA;" OwnerUserId="19323" LastEditorUserId="467" LastEditDate="2017-01-06T10:07:03.307" LastActivityDate="2017-03-14T18:15:18.213" Title="What is the relationship between Time-To-Expiry and Delta?" Tags="&lt;options&gt;&lt;greeks&gt;&lt;delta&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31801" PostTypeId="2" ParentId="31800" CreationDate="2017-01-05T17:11:11.130" Score="5" Body="&lt;p&gt;You are looking for the Greek commonly referred to as Charm. This is a quick visualization with a good chart I found on Google: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.optiontradingtips.com/greeks/charm.html&quot; rel=&quot;noreferrer&quot;&gt;https://www.optiontradingtips.com/greeks/charm.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19473" LastActivityDate="2017-01-05T17:11:11.130" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31802" PostTypeId="2" ParentId="22125" CreationDate="2017-01-05T17:18:53.243" Score="0" Body="&lt;p&gt;I think you are approaching your portfolio from the complete wrong starting point. Your &quot;securities&quot; are the individual hedge funds. You should be using individual strategies to &quot;hedge&quot; the other strategies. It sounds like you're attempting to create a hedge overlay.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you wanted a diversified equity portfolio, would you buy a 50 names in with $\beta = 1.5$ to one specific subsector, and &quot;hedge&quot; by shorting an ETF for that same subsector and going long an ETF for another sector? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, you should not be overlaying a hedge for your hedge fund portfolio. They should already be hedged. The risks that hedge funds take exposure to should be calculated and precise. You should not have unwanted sector, geopolitical, etc. risk in your portfolio because a good hedge fund manager will have a very narrow strategy that only exposes itself to certain risks. The more risk you hedge away, the lower your returns will be. That defeats the purpose of even hiring the fund. &lt;/p&gt;&#xA;" OwnerUserId="19473" LastActivityDate="2017-01-05T17:18:53.243" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31803" PostTypeId="1" CreationDate="2017-01-05T18:07:03.973" Score="2" ViewCount="208" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Let $W^P$ be a $d$-dimesional $P$-wiener procss. Define $L_t =&#xA;&amp;gt; e^{\int_0^t \phi_s^T dW_s^P - \frac{1}{2} \int_0^t \| \phi_s\|^2&#xA;&amp;gt; ds}$.Assuming $E^PL_T = 1$, then the measure given by $dQ = L_TdP$ is&#xA;  a probability measy and $dW_t^P = \phi_tdt+dW_t^Q$ where $W_t^Q$ is a&#xA;  $W$-wiener process.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That's the Girsanov theorem, but what in the world is that first integral in the definition of $L_t$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\phi^T$ is a row vector ..... do we have multiple dimensional versions of stochastic integrals as well??&lt;/p&gt;&#xA;" OwnerUserId="26148" LastEditorUserId="467" LastEditDate="2017-01-06T10:08:58.010" LastActivityDate="2017-01-06T10:08:58.010" Title="How to understand the integral in the Girsanov theorem?" Tags="&lt;stochastic-calculus&gt;&lt;finance-mathematics&gt;&lt;girsanov&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31806" PostTypeId="1" CreationDate="2017-01-05T20:59:15.563" Score="1" ViewCount="122" Body="&lt;p&gt;Suppose I have a time series of stock growth and one of gdp growth and education over the years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I try to explain stock using gdp and education by running an OLS or would I be mistaken from a formal (not content) point of view?&lt;/p&gt;&#xA;" OwnerUserId="25954" LastEditorUserId="467" LastEditDate="2017-01-06T07:11:07.097" LastActivityDate="2017-01-06T07:11:07.097" Title="How to find relationships between financial data?" Tags="&lt;time-series&gt;&lt;econometrics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31807" PostTypeId="1" AcceptedAnswerId="31812" CreationDate="2017-01-05T22:24:06.527" Score="0" ViewCount="107" Body="&lt;p&gt;A derivative security pays a cash amount &lt;em&gt;c&lt;/em&gt; if the spot price of the underlying asset at maturity is between K1 and K2, where 0&amp;lt; K1 &amp;lt; K2 and expires worthless otherwise. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q: how to construct this derivative security using plain vanilla call options?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anyone tell me how to construct this type of derivative security specifically and generally? Thanks!&lt;/p&gt;&#xA;" OwnerUserId="25996" LastActivityDate="2017-01-06T03:27:53.957" Title="How to synthesize this derivative security using plain vanilla call options?" Tags="&lt;options&gt;&lt;derivatives&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31809" PostTypeId="2" ParentId="31806" CreationDate="2017-01-06T00:41:31.717" Score="3" Body="&lt;p&gt;I'm not sure what you mean by &lt;em&gt;formal&lt;/em&gt; but if you have intuition into why gdp or your education metric should be related to the growth of stocks, then by all means, build a model that tries to find the relationship between them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OLS is one way to find a relationship between gdp and education relative to stock growth.  There would be nothing wrong with that concept in general.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, there are many things you could do wrong in setting up your model.  You may want to share more in order to get more help.&lt;/p&gt;&#xA;" OwnerUserId="20388" LastActivityDate="2017-01-06T00:41:31.717" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="31810" PostTypeId="1" AcceptedAnswerId="31811" CreationDate="2017-01-06T00:47:34.063" Score="1" ViewCount="45" Body="&lt;p&gt;As described in a &lt;a href=&quot;https://www.khanacademy.org/economics-finance-domain/core-finance/money-and-banking/bank-bailout/v/bailout-12-lone-star-transaction&quot; rel=&quot;nofollow noreferrer&quot;&gt;Khan Academy video&lt;/a&gt;, Merrill Lynch offloaded some CDOs to an entity called Lone Star Funds in the following way: (1) the purchase price was marked as \$6.7B; (2) Lone Star provided \$1.7B in cash; (3) Merrill Lynch provided a \$5B loan for the rest of the purchase; (4) if Lone Star defaults on the loan, their only exposure is the CDOs themselves. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This creates an interesting arrangement where \$6.7B is kind of like a strike price on an option. If the CDOs are worth less, then Lone Star loses all of the \$1.7B and Merrill takes a haircut proportional to how much less. If they are worth more than \$6.7B, Merrill caps out at \$6.7B and Lone Star receives the profit. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this kind of arrangement common (I am completely new to finance)? Does it have a name? At first, it seemed like a way of cooking the books (marking the sale price of the CDOs higher than it was) but when I thought about it, it seemed more like a speculative arrangement on its price. &lt;/p&gt;&#xA;" OwnerUserId="25998" LastActivityDate="2017-01-06T02:57:59.400" Title="Name of this type of purchase agreement?" Tags="&lt;jargon&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31811" PostTypeId="2" ParentId="31810" CreationDate="2017-01-06T02:57:59.400" Score="0" Body="&lt;p&gt;That's not quite right.  Lone star essentially pays 1.7bn for a call option on the CDO, struck at 5bn.  If the cdos are worth less than 5bn, lone star defaults and Merrill collects the cdos.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This arrangement is called a purchase of cdos using a non recourse loan.  Meaning , Merrill has no recourse to any assets of lone star other than the cdos.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A buyer would do this because it's a way to buy cdos using leverage with limited downside.  A bank would do this if they desire to get the CDo position off their books ( however , there may be some debate on the accounting treatment , since the bank will own the CDo again if it falls below 5bn).  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-01-06T02:57:59.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31812" PostTypeId="2" ParentId="31807" CreationDate="2017-01-06T03:27:53.957" Score="2" Body="&lt;p&gt;Buy a [K1, K1+w] call spread and sell a [K2, K2+w] call spread, where w is as small as possible.  The amount of notional of these you will need is c/w.   The limit of this as w goes to zero is the payoff you desire.  In practice you will be limited to whatever strikes are available to trade.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-01-06T03:27:53.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31813" PostTypeId="1" AcceptedAnswerId="31814" CreationDate="2017-01-06T05:59:42.640" Score="3" ViewCount="2129" Body="&lt;p&gt;This seems like a very basic question, but the Internet does not seem to know, so:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have a stream of bid, ask, and last trade prices, how do you convert those into periodic open/high/low/close bars?  Is there a standard definition?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main question is whether the summaries incorporate the bid and ask or just last trade prices.  The other question is whether the previous close is equal to the next open (talking intraday bars here, excluding the session open and close).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My guess is that bars just use last trade prices and the previous close generally equals the next open, but that seems to drop a lot of information, especially for intraday bars.&lt;/p&gt;&#xA;" OwnerUserId="26000" LastActivityDate="2017-01-25T11:39:15.487" Title="How are OHLC bars made from bid, ask, and last trade prices?" Tags="&lt;market-data&gt;&lt;charts&gt;&lt;quote&gt;" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31814" PostTypeId="2" ParentId="31813" CreationDate="2017-01-06T07:10:15.970" Score="1" Body="&lt;p&gt;Bars represent an summarized view of what happened during a given period of time of a single given value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, you need to first pick the value you want to summarize: &lt;em&gt;Bid&lt;/em&gt;, &lt;em&gt;Ask&lt;/em&gt; or &lt;em&gt;Last Trade&lt;/em&gt; and use values of only these measures to build your bars.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2017-01-06T07:10:15.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31815" PostTypeId="2" ParentId="16793" CreationDate="2017-01-06T08:16:10.560" Score="2" Body="&lt;p&gt;I realize the previous answer doesn't answer anything, yes the spread over LIBOR on the swap is such that the swap has 0 value at inception, but how do you compute the value of the equity leg ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The spread on an equity swap depends on the level at which you can repo the underlying equity if you replicate the swap through a buy and sell transaction + a stock loan (its slightly different due to the regulatory treatment, a stock loan is on the balance sheet whereas a swap is not).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A swap from the &quot;equity payer&quot; perspective is the same as borrowing the stock, then shorting it. From the &quot;equity receiver&quot; perspective it is buying the stock and lending it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The spread level will depend on this implicit lending/borrowing transaction terms :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Is the transaction breakable before its end or not, with which notice period ?&lt;/li&gt;&#xA;&lt;li&gt;What is the term (duration of the transaction) ?&lt;/li&gt;&#xA;&lt;li&gt;What is the collateral (independent amount) level arranged, in which currency ?&lt;/li&gt;&#xA;&lt;li&gt;The repo itself (how hard is it to borrow the security) ?&lt;/li&gt;&#xA;&lt;li&gt;Additional considerations such as cross-currency basis if the financing currency is different from the underlying currency, etc.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1181" LastActivityDate="2017-01-06T08:16:10.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31816" PostTypeId="1" CreationDate="2017-01-06T09:58:08.640" Score="1" ViewCount="169" Body="&lt;p&gt;Since the papers about realized volatility calculate daily volatility out of intraday data, is it also possible to apply same methods to calculate e.g. 10 minutes volatility by smaller sampled data e.g. by 1 second returns? I could not find a single paper about that. Specifically, I'm interest if methods which remove microstructure noise, such as kernels, are still valid.&lt;/p&gt;&#xA;" OwnerUserId="25980" LastActivityDate="2017-01-06T09:58:08.640" Title="Intraday Volatility using Realized Kernels" Tags="&lt;volatility&gt;&lt;high-frequency&gt;&lt;intraday&gt;&lt;kernel&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31817" PostTypeId="2" ParentId="31798" CreationDate="2017-01-06T10:58:08.410" Score="0" Body="&lt;p&gt;The risk factors for NDF are the same as for vanilla FX forward. The thing about an NDF is that all that changes hands on value date is a cash flow calculated according to the difference in rates since trade date, usually in USD. That means that you can &quot;trade&quot; the instrument offshore and you don't have to comply with onshore trading regulations...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looks like Matt Wolf already answered the question about risk factors for FX forwards &lt;a href=&quot;https://quant.stackexchange.com/questions/9133/var-for-fx-forwards?rq=1&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7369" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2017-01-06T10:58:08.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31818" PostTypeId="1" CreationDate="2017-01-06T11:38:59.483" Score="2" ViewCount="295" Body="&lt;p&gt;I am facing t = 1,..T investment periods where each period I have x$ to invest. Suppose each period I can build a portfolio from thousands of assets (some are uncorrelated whilst some are highly correlated) for which I know the exact probability distribution so I can calculate expected values and covariance matrices exactly (no estimation error). Cash (zero return zero risk) can be included as an asset too. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The return distributions of these assets are non-normal. In particular, for one period, they return a large positive value (&gt;100%) with a small probability (eg. 5% - 15%) and return -100% otherwise (i.e. binary outcomes). Each period I am faced with a different set of assets with similar, but never identical, characteristics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So each period I have to choose what weight to place on each asset, assuming no short selling and no leverage i.e. (0% &amp;lt;= Wi &amp;lt;= 100%) for each asset i, Sum(Wi)=100%. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, given the above, what is the best way to optimize such a portfolio each period? Ideally I would like an efficient frontier which gives me the least risky portfolio for each level of expected return but a single point portfolio will also do. Probably the best definition of risk (other suggestions are welcomed) is the magnitude or likelihood of sub-zero returns. But it is important the risk measure takes into account the dependence between the assets.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some possibilities with my concerns:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Mean-variance optimization - Return distributions are heavily non-normal&lt;/li&gt;&#xA;&lt;li&gt;Mean-semivariance - Is non-normality an issue?&lt;/li&gt;&#xA;&lt;li&gt;Geometric mean (Kelly) optimization - Does it take into account the correlation between assets?&lt;/li&gt;&#xA;&lt;li&gt;Any other optimization techniques? &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="26004" LastActivityDate="2017-03-10T13:10:45.930" Title="Optimize portfolio of non-normal binary return assets" Tags="&lt;optimization&gt;&lt;portfolio-optimization&gt;&lt;mean-variance&gt;&lt;kelly-criterion&gt;&lt;abnormal-returns&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31819" PostTypeId="2" ParentId="31813" CreationDate="2017-01-06T11:53:11.603" Score="-2" Body="&lt;p&gt;My understanding is that most OHLC data is made from Bid ticks&lt;/p&gt;&#xA;" OwnerUserId="24570" LastActivityDate="2017-01-06T11:53:11.603" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31820" PostTypeId="2" ParentId="31800" CreationDate="2017-01-06T15:17:46.680" Score="4" Body="&lt;p&gt;Here is a page from &lt;a href=&quot;http://www.theoptionsguide.com/delta.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Options Guide&lt;/a&gt; with an understandable picture.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/4MUPW.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/4MUPW.gif&quot; alt=&quot;Time to expiration and delta&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They explain, &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;As the time remaining to expiration grows shorter, the time value of the option evaporates and correspondingly, the delta of in-the-money options increases while the delta of out-of-the-money options decreases.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This happens because the shorter expiration that is deep in-the-money tends to behave as the stock, with an underlying gain of $1 having an option movement of more than 95 cents (that's a delta &gt; 0.95). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But with a shorter expiration, the out-of-the-money option has very little chance of being exercised. Thus, the option movement is small, perhaps 5 cents (that is, a delta around 0.05).&lt;/p&gt;&#xA;" OwnerUserId="343" LastActivityDate="2017-01-06T15:17:46.680" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31821" PostTypeId="1" AcceptedAnswerId="31837" CreationDate="2017-01-06T16:38:36.890" Score="1" ViewCount="140" Body="&lt;p&gt;If stock prices are meant to follow a martingale, then why are neural networks used in efficient pricing, given that they train themselves from historical data &lt;/p&gt;&#xA;" OwnerUserId="20596" LastActivityDate="2017-01-08T02:55:59.027" Title="martingale anomaly in pricing risky assets" Tags="&lt;martingale&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31822" PostTypeId="2" ParentId="31792" CreationDate="2017-01-06T17:11:06.090" Score="0" Body="&lt;p&gt;I think your option 3, with a zero-cost collar, is a good way to go.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's another option. You could also consider a ratio. Say you own 200 shares with the stock at \$100. Sell 1 \$105 call, and use the proceeds to pay for 2 \$90 puts. You would benefit on the upside movement of the stock. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or if you really don't think it'll go up much more and have the margin, sell 3 \$110 calls and pay for 2 \$90 puts. Here you would be hurt by an upside movement of the stock. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;http://www.investopedia.com/terms/r/ratio_call_write.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.investopedia.com/terms/r/ratio_call_write.asp&lt;/a&gt; for the Ratio Call Write. &lt;/p&gt;&#xA;" OwnerUserId="343" LastActivityDate="2017-01-06T17:11:06.090" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31823" PostTypeId="2" ParentId="10905" CreationDate="2017-01-06T19:22:18.390" Score="1" Body="&lt;p&gt;Still in early stages but if you can code in Java / Python this might be worth taking a look: &lt;a href=&quot;https://github.com/melphi/algobox&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/melphi/algobox&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26006" LastActivityDate="2017-01-06T19:22:18.390" CommentCount="0" CommunityOwnedDate="2017-01-06T19:22:18.390" ContentLicense="CC BY-SA 3.0" />
  <row Id="31824" PostTypeId="1" AcceptedAnswerId="31825" CreationDate="2017-01-06T20:00:33.277" Score="1" ViewCount="881" Body="&lt;p&gt;I'm using the following R code to calculate the vega on a vanilla option with the inputs S = 100, X = 100, t = 1, r = 0.005 and vol = 0.5&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The vega calculated is around 39.85; I was expecting it to be around 0.3985.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The vega shape vs. spot, when plotted, is correct but the value is always a factor of 100 out. Should I be dividing by spot, strike or always dividing by 100 simply to get to a decimal of %? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If someone could offer a quick explanation it would help me a lot!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;vega &amp;lt;- function(S, X, t, r, vol){&#xA;d1 &amp;lt;- (log(S/X)+(r+ 0.5 * vol^2) * t) / ( vol * sqrt(t))&#xA;Np &amp;lt;- ( exp(-d1^2/2)/ sqrt(2 * pi) )&#xA;S * sqrt(t) * Np&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="26007" LastEditorUserId="24222" LastEditDate="2017-01-06T20:16:53.337" LastActivityDate="2017-01-06T20:16:53.337" Title="Calculating option vega for vanilla call seems to be factor of 100 out" Tags="&lt;black-scholes&gt;&lt;vega&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31825" PostTypeId="2" ParentId="31824" CreationDate="2017-01-06T20:07:30.027" Score="2" Body="&lt;p&gt;When you calculate the partial derivative of the option price $V$ w.r.t. $\sigma$, then you get a first order approximation of the change in $V$ for a &lt;strong&gt;unit&lt;/strong&gt; change in $\sigma$. A unit change is e.g. $\sigma$ increasing from 0.2 (20%) to 1.2 (120%). If you want the vega for a one percentage point change in volatility, then divide by 100.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2017-01-06T20:07:30.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31827" PostTypeId="2" ParentId="31778" CreationDate="2017-01-07T02:15:38.867" Score="2" Body="&lt;p&gt;At time of payout you have&#xA;$$C(K=90) \leqslant C(K = 100) + 10$$&#xA;and&#xA;$$P(K=90) \geqslant P(K=100) - 10$$&#xA;From that using put-call parity you can deduct&#xA;$$ S - 100 * e^{-rT} \leqslant C(K=90) - P(K=100) \leqslant S - 90 * e^{-rT}$$&#xA;If this inequality is violated, than you have an arbitrage opportunity. Take advantage of it by buying the stuff that is underpriced and short the overprice things.&#xA;E.g. assume the first inequality does not hold.&#xA;Than $C(K=90)$ is too cheap or $P(K=100)$ to expensive. Buy the Call, Sell the Put and the Stock.&#xA;The payout at T is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For $S \leqslant 90$: $-100+S-S=-100$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For $90 \leqslant S \leqslant 100$: $S-90 - 100 + S - S = S - 190$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For $100 \leqslant S$: $S - 90-S=-90$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For all three outcomes the payout is greater than -100. &#xA;Our assumption was that &#xA;$$C(K=90)-P(K=100)-S &amp;lt; -100 * e^{rT}$$&#xA;Which means we got more than 100 (discounted) in cash for our position at time of inception. &#xA;Since we made more money from selling the shorts than we loose by buying the call and through the payout we make a sure profit.&lt;/p&gt;&#xA;" OwnerUserId="22686" LastEditorUserId="22686" LastEditDate="2017-01-07T02:20:54.407" LastActivityDate="2017-01-07T02:20:54.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31828" PostTypeId="2" ParentId="31813" CreationDate="2017-01-07T05:13:09.913" Score="1" Body="&lt;p&gt;Pick a time range of traded prices, open is the first value in the range, high is the max of the range, low is the min and close is last value in the range.&lt;/p&gt;&#xA;" OwnerUserId="16327" LastActivityDate="2017-01-07T05:13:09.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31829" PostTypeId="2" ParentId="31821" CreationDate="2017-01-07T06:08:15.393" Score="0" Body="&lt;p&gt;Real-world stock prices &lt;em&gt;can&lt;/em&gt; follow a martingale. Just not directly. You can indirectly make assumptions about how price evolution itself, can construct utilities, payoffs and various perceptions of risk, for particular agents/players in the market. As a vague example, you can extract a particular &quot;martingale&quot; price (or neighborhood), from various BSDEs, PDEs, FBSDEs, where if an agent observes market price hit a &quot;martingale&quot; price, then her utilities become martingales themselves (pure 50-50 fair game).     &lt;/p&gt;&#xA;" OwnerUserId="26012" LastActivityDate="2017-01-07T06:08:15.393" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31831" PostTypeId="2" ParentId="31778" CreationDate="2017-01-07T12:28:24.397" Score="3" Body="&lt;p&gt;We would like to obtain bounds on P(100).   First calculate P(90) from put-call parity: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;C(90)-P(90)= stock - PV(strike) &#xA;=S- 90/1.05 = 80-85.71= -5.71&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So P(90)= C(90)+5.71= 15.71&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now observe the following inequalities: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;P(100) &gt; P(90) &gt; P(100) -10/1.05&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first of these states that the right to sell for 100 is always better than the right to sell for 90.  The second states that the value of the 100-90 put spread can never be greater than the PV of its maximum payoff (10).  So from these we obtain :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P(100) &gt; 15.71 and P(100) &amp;lt; 25.24&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the arbitrage bounds for the 100 put.  This all assumes the stock does not pay dividends.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-01-07T12:28:24.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31832" PostTypeId="1" CreationDate="2017-01-07T14:17:57.213" Score="8" ViewCount="295" Body="&lt;p&gt;A major technique employed throughout Bjork's &quot;Arbitrage theory in Continuous Time&quot; is that when taking the expectation of a stochastic integral, the result is 0. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is based on a result presented in chapter 4, which states that if the integrand, say $\psi$, satisfies that $\int_0^t E \psi^2 ds &amp;lt; \infty$, then the expectation of $\int_0^t \psi dW_s$ is zero. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in subsequent arguments, regardless of how complex $\psi$ may have been defined in that setting, the author never demonstrates that this non-trivial condition is actually satisfied, which causes trouble for me in doing exercises, as I do not know whether I too can just assume that it is satisfied, or whether I have to go through some very tedious calculations in order to show that it is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, is it normal to not check it? Is there an easy way to see that it is satisfied?&lt;/p&gt;&#xA;" OwnerUserId="26014" LastActivityDate="2017-01-12T22:44:47.653" Title="Why won't Bjork ever show that the integrability condition is satisfied?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;arbitrage&gt;&lt;mathematics&gt;&lt;stochastic&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31837" PostTypeId="2" ParentId="31821" CreationDate="2017-01-08T02:49:36.917" Score="2" Body="&lt;p&gt;It has been shown theoretically (Samuelson, 1973) that in an informationally efficient market prices of securities follow a martingale. Cox Ross Rubinstein showed in 1973 how this hypothesis combined with Black-Scholes-Merton dynamic hedging could be used to price derivatives namely options, and this was made into a general theory of derivative pricing by Harrison an Kreps in 1979 (the so called martingale pricing theory). Empirical work at about this time also confirmed that stock prices to a large extent conform to the martingale idea.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Today Quant Finance is divided into two parts: Derivative Pricing and Quant Investment Management.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Derivative Pricing the martingale methods are routinely used to price a large number of derivatives. These methods are used extensively in practice and are quite successful. The martingale &lt;em&gt;assumption&lt;/em&gt; serves as a foundation for this kind of work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Quant Investment Management the situation is more complicated. Much work takes a martingale approach, however there has also been empirical work that demonstrates some deviations of stock prices from martingales; the most famous being the momentum effect of Jegadeesh and Titman (1993). Some attempts have been made to capture this effect in an investment strategy, with mixed results. Many people continue to believe that the martingale hypothesis has merit. Finally there is a small number of people, out of the mainstream of Finance, who have attempted to use Neural Networks to predict stock prices. This work is on the fringes, has not been very successful as far as I know, and appears misguided to those of us who still believe that stock prices are close to martingales. (Still science sometimes advances by having people try out seemingly strange new ideas, so I'll keep an open mind about neural networks).&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2017-01-08T02:55:59.027" LastActivityDate="2017-01-08T02:55:59.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31838" PostTypeId="1" AcceptedAnswerId="31841" CreationDate="2017-01-08T03:27:34.463" Score="0" ViewCount="833" Body="&lt;p&gt;A CSA (Credit Support Annex) agreement specifies the interest rate to be earned on the collateral provided to back a derivatives transaction. For cash collateral this rate is generally the OIS (overnite index swap rate). A 'zero floor' refers to the provision that the i.r. rate applied may not be negative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to determine the value 0 floors in csa agreements in a world where negative ois rates are possible?&lt;/p&gt;&#xA;" OwnerUserId="26026" LastEditorUserId="16160" LastEditDate="2017-01-08T08:08:50.640" LastActivityDate="2017-01-08T15:19:35.700" Title="How to price 0 floors in csa agreements for negative ois rates?" Tags="&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31839" PostTypeId="1" AcceptedAnswerId="31840" CreationDate="2017-01-08T07:35:31.190" Score="5" ViewCount="542" Body="&lt;p&gt;I am trying to understand the transformation of the Black-Scholes equation to the one-dimensional heat equation from &lt;em&gt;Joshi, M. (2011). The Concepts and practice of mathematical finance. 2nd ed. Cambridge, U.K.: Cambridge University Press, pp.119.&lt;/em&gt; . The author stated that the Black-Scholes equation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \frac{\partial C}{\partial t}(S,t) +rS \frac{\partial C}{\partial S}(S,t) + \frac{1}{2}\sigma^2 S^2 \frac{\partial^2 C}{\partial S^2}(S,t) -rC=0 $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;can be rewritten as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \frac{\partial C}{\partial t}(S,t) +(r-\frac{1}{2}\sigma^2) S \frac{\partial C}{\partial S}(S,t) + \frac{1}{2}\sigma^2 (S \frac{\partial}{\partial S})^2 C -rC=0 $,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;however I can't see how these two equations are equivalent, in particular, I don't understand how the additional $-\frac{1}{2} \sigma^2 S \frac{\partial C}{\partial S} (S,t)$ came about. I have tried expanding the squared differential operator as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;&amp;amp; \frac{1}{2}\sigma^2(S \frac{\partial}{\partial S})^2 C(S,t) \\&#xA;&amp;amp;= \frac{1}{2} \sigma^2 \frac{\partial}{\partial S} [\frac{\partial}{\partial S} (S^2 C(S,t))] \\ &#xA;&amp;amp;= \frac{1}{2}\sigma^2 \frac{\partial}{\partial S} [2S\cdot C(S,t) + S^2 \frac{\partial C(S,t)}{\partial S}] \\ &#xA;&amp;amp;= \frac{1}{2}\sigma^2 [2C(S,t) + 2S \frac{\partial C(S,t)}{\partial S} + 2S \frac{\partial C(S,t)}{\partial S} + S^2 \frac{\partial^2 C(S,t)}{\partial S^2} \\ &#xA;&amp;amp;= \frac{1}{2} \sigma^2 [2C(S,t) + 4S \frac{\partial C(S,t)}{\partial S}] + \frac{1}{2} \sigma^2 S^2 \frac{\partial ^2 C(S,t)}{\partial S^2}&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there something that I missed out? Can anyone help me out?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="26028" LastActivityDate="2017-01-08T08:29:15.567" Title="Equivalent form of Black-Scholes Equation (to transform to heat equation)" Tags="&lt;black-scholes&gt;&lt;call&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31840" PostTypeId="2" ParentId="31839" CreationDate="2017-01-08T08:29:15.567" Score="9" Body="&lt;p&gt;I think you've cottoned on to the main question - that is,to see why $\frac{1}{2} \sigma^2 S^2 \frac{\partial^2 C}{ \partial S^2 }$ is the same thing as $-\frac{1}{2} \sigma^2 S \frac{\partial C}{\partial S} + \frac{1}{2} \sigma^2 (S \frac{\partial}{\partial S})^2 C $. I think your confusion comes from dealing with the squared operator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Writing down what the expression means, we have &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;(S \frac{\partial}{\partial S})^2 C= (S \frac{\partial}{\partial S}) (S \frac{\partial}{\partial S}) C&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, &lt;strong&gt;apply $S \frac{\partial}{ \partial S} $ to $C$ first, then apply $S \frac{\partial}{\partial S}$ to the result&lt;/strong&gt;. Note that we can't just switch the order of these symbols - this is not the same thing as $\frac{\partial}{\partial S} \frac{\partial}{\partial S} S^2 $. (The derivative operator rarely commutes with anything - try evaluating this on a hypothetical option with constant value $C=1$) Expanding out the expression should give &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;(S \frac{\partial}{\partial S})^2 C = S \frac{\partial}{\partial S} (S \frac{\partial C}{\partial S})&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and applying the product rule gives that this is equal to &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;S (\frac{\partial S}{\partial S} \frac{\partial C}{\partial S} + S \frac{\partial ^2 C}{\partial S ^2})&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Incidentally, we can see that it's exactly the product rule that makes the derivative fail to commute with multiplication by $S$). So&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;(S \frac{\partial}{\partial S})^2 C= S \frac{\partial C}{\partial S} + S^2 \frac{\partial ^2 C}{\partial S ^2}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Multiply this by $\frac{1}{2} \sigma^2$ and rearrange a little and we should have our result.&lt;/p&gt;&#xA;" OwnerUserId="25150" LastActivityDate="2017-01-08T08:29:15.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31841" PostTypeId="2" ParentId="31838" CreationDate="2017-01-08T15:19:35.700" Score="2" Body="&lt;p&gt;A couple of observations&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(A) if the value of the floor, relative to a non floored CSA, is worth an amount X to one of the counterparties to the CSA, then it is worth -X to the other counterparty.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(B) The value of the floor depends on what is in the derivatives portfolio under that CSA.  If, from your perspective as Counterparty A, the portfolio becomes a big receivable when ois rates are negative, then X is negative for you. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(C) the exact valuation requires a complex model that can handle the correlation between all trades that are in the portfolio, versus ois rates.  If there are multiple asset classes represented in the portfolio, this could be handled by a multiasset Monte Carlo Model.  Even then, calibration would not be easy.  Most banks haven't developed precise technology for this.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-01-08T15:19:35.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31842" PostTypeId="1" AcceptedAnswerId="31843" CreationDate="2017-01-08T21:06:46.737" Score="1" ViewCount="532" Body="&lt;p&gt;I'm using the Excel XIRR function because I have inflows and outflows on the same dates.  To use the IRR function instead, I would have to compute the net inflow or outflow on a given date and then have a single row for that date's net inflow/outflow.  All of my dates are always on the first of the given month.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem I'm having is the XIRR function is not giving the IRR that I have guessed.  To illustrate this, in the spreadsheet below is a list of inflows and outflows (column C) and the corresponding dates (column A).  The IRR computed by Excel's XIRR function is 39.098%.  You can see this on the spreadsheet and you can see the function I used to compute it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then compute the month number, where the first month is month number zero.  The formula to compute the month number is also shown.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then compute the present value of the inflow/outflow (from column C) using the month number and a rate that I guessed at (cell C31).  I then add up all of the present values, getting 1.97 in cell I29 (all the formulas are shown).  I just fiddled around with the rate (cell C31) trying to get a sum of zero.  I stopped when I got to 1.97, figuring that was close enough.  As this sum is nearly zero, the rate of 33.430% is the IRR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a fairly significant difference between Excel's XIRR and my IRR.  Why is this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/bHhfc.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/bHhfc.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15063" LastActivityDate="2017-01-09T11:30:43.307" Title="Excel XIRR function producing unexpected IRR" Tags="&lt;excel&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31843" PostTypeId="2" ParentId="31842" CreationDate="2017-01-09T09:38:32.827" Score="2" Body="&lt;p&gt;You can calculate the monthly IRR then annualise. Both IRR and XIRR = 39.1% pa.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/qMhrg.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/qMhrg.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Confirming the XIRR, as you calculated in Excel.  XIRR = 39.098% pa.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/WGIai.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/WGIai.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also calculate the IRR in one step.  IRR = 39.062% pa.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/slpBc.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/slpBc.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7178" LastEditorUserId="7178" LastEditDate="2017-01-09T11:30:43.307" LastActivityDate="2017-01-09T11:30:43.307" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="31845" PostTypeId="2" ParentId="31832" CreationDate="2017-01-09T09:50:28.060" Score="0" Body="&lt;p&gt;We should check the martingale properties.&lt;/p&gt;&#xA;&lt;p&gt;Let &lt;span class=&quot;math-container&quot;&gt;$(\Omega ,\mathcal{F},\{\mathcal{F}\}_{t\ge 0},\mathbb{P}) $&lt;/span&gt; be  a filtered probability space. We define   the class of functions ,&lt;span class=&quot;math-container&quot;&gt;$\mathcal {V} =\mathcal {V}(t,T)$&lt;/span&gt;, as follow&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\psi(t,\omega):[0,\infty)\times\Omega\to\mathbb{R}$$&lt;/span&gt;&#xA;such that&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$(t,\omega)\to \psi(t,\omega)$&lt;/span&gt; is &lt;span class=&quot;math-container&quot;&gt;$\mathcal{B}\times\mathcal{F}$&lt;/span&gt; where &lt;span class=&quot;math-container&quot;&gt;$\mathcal{B}$&lt;/span&gt; denotes the Borel algebra on &lt;span class=&quot;math-container&quot;&gt;$[0,\infty)$&lt;/span&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$\psi(t,\omega)$&lt;/span&gt; is &lt;span class=&quot;math-container&quot;&gt;$\mathcal{F}_t$&lt;/span&gt; adapted.&lt;/li&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$\mathbb{E}\left[\int_{t}^{T}\psi^2(s,\omega)ds\right]&amp;lt;\infty$&lt;/span&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;In this case, we have&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\mathbb{E}\left[\int_{t}^{T}\psi(s,\omega)dW_s\right]=0$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Remark&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;If &lt;span class=&quot;math-container&quot;&gt;$M_t$&lt;/span&gt; be an  an arbitrary martingale with respect to &lt;span class=&quot;math-container&quot;&gt;$\{\mathcal{F}\}_{t\ge 0}$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$\psi(.,\omega)$&lt;/span&gt; be  bounded then &lt;span class=&quot;math-container&quot;&gt;$\int_{t}^{T}\psi(s,\omega)dM_s$&lt;/span&gt; is a martingale,and&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\mathbb{E}\left[\int_{t}^{T}\psi(s,\omega)dM_s\right]=0$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Counter Example&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;The Constant elasticity of variance model ,&lt;a href=&quot;https://www.jstor.org/stable/2330906?seq=1#page_scan_tab_contents&quot; rel=&quot;nofollow noreferrer&quot;&gt;CEV&lt;/a&gt;, describes a process which evolves according to the following stochastic differential equation:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$dS_t=\mu S_t dt+\sigma S_t^{\gamma} dW_t\tag 1$$&lt;/span&gt;&#xA;where The constant parameters &lt;span class=&quot;math-container&quot;&gt;$\mu\,,\sigma$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$\gamma  $&lt;/span&gt; satisfy the conditions: &lt;span class=&quot;math-container&quot;&gt;$\mu\in\mathbb{R}$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$\sigma\ge 0$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$\gamma\ge 0$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The parameter &lt;span class=&quot;math-container&quot;&gt;$ \gamma $&lt;/span&gt; controls the relationship between volatility&#xA;and price, and is the central feature of the model. When &lt;span class=&quot;math-container&quot;&gt;$  \gamma &amp;lt;1$&lt;/span&gt;&#xA;we see the so-called leverage effect, commonly observed in equity&#xA;markets, where the volatility of a stock increases as its price falls.&#xA;Conversely, in commodity markets, we often observe &lt;span class=&quot;math-container&quot;&gt;$\gamma&amp;gt;1$&lt;/span&gt;&#xA;so-called inverse leverage effect, whereby the volatility of the price&#xA;of a commodity tends to increase as its price increases.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I use the standard technique, I can integrate, take expectations, differentiate&#xA;with respect to time and solve by ODE techniques !! .  Now, I write the equation &lt;span class=&quot;math-container&quot;&gt;$(1)$&lt;/span&gt; in integral form&#xA;&lt;span class=&quot;math-container&quot;&gt;$$S_t=S_0+\mu\int_{0}^{t}S_u du+\sigma\int_{0}^{t}S_u^\gamma dW_u\tag 2$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;It is known that the expectation of a stochastic integral is zero, thus&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\mathbb{E}[S_t]=S_0+\mu\int_{0}^{t}\mathbb{E} [S_u] du\tag 3$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;This can be differentiated to obtain the ordinary differential equation&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\frac{d\mathbb{E}[S_t]}{dt}=\mu \mathbb{E}[S_t]\tag 4$$&lt;/span&gt;&#xA;which has the unique solution&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\mathbb{E}[S_t]=S_0e^{\mu t}$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Indeed this procedure is so wrong . For &lt;span class=&quot;math-container&quot;&gt;$\gamma&amp;gt; 1$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$$\mathbb{E}[S_t]&amp;lt;S_0e^{\mu t}\tag 5$$&lt;/span&gt;. Indeed, if &lt;span class=&quot;math-container&quot;&gt;$\gamma&amp;gt; 1$&lt;/span&gt; then  the local martingale property holds and &lt;span class=&quot;math-container&quot;&gt;$\int_{0}^{t}S_u^\gamma dW_u$&lt;/span&gt; is not a proper martingale, and has strictly negative expectation at all positive times. The reason that the martingale property fails here for &lt;span class=&quot;math-container&quot;&gt;$\gamma&amp;gt;1$&lt;/span&gt; is that the coefficient &lt;span class=&quot;math-container&quot;&gt;$\sigma S_t^\gamma$&lt;/span&gt; of &lt;span class=&quot;math-container&quot;&gt;$dW_t$&lt;/span&gt; grows too fast in &lt;span class=&quot;math-container&quot;&gt;$\ S_t$&lt;/span&gt;.&lt;/p&gt;&#xA;" OwnerDisplayName="user16651" LastEditorUserId="-1" LastEditorDisplayName="user16651" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2017-01-09T10:58:22.030" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31847" PostTypeId="2" ParentId="31818" CreationDate="2017-01-09T12:17:05.857" Score="2" Body="&lt;p&gt;For a single period, I would consider scenario optimisation: simulate&#xA;your assets' returns (which you can do since you know their&#xA;statistical properties, including correlations), and in this way create a large number of&#xA;scenarios. Collect these scenarios in a matrix, &lt;code&gt;R&lt;/code&gt;, say, with scenarios in rows,&#xA;assets in columns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The portfolio returns for a given weight vector &lt;code&gt;w&lt;/code&gt; are easily computed&#xA;as &lt;code&gt;Rw&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The advantage of this approach is that now you have a univariate&#xA;problem, and you may apply all kinds of objective functions to your&#xA;optimisation problem. In particular, you may use objective functions that&#xA;explicitly deal with the non-normal distributions of your assets&#xA;(e.g. the probability of losing more than x%).&lt;/p&gt;&#xA;" OwnerUserId="6857" LastActivityDate="2017-01-09T12:17:05.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31848" PostTypeId="1" AcceptedAnswerId="31852" CreationDate="2017-01-09T13:02:50.593" Score="3" ViewCount="1103" Body="&lt;p&gt;The distribution for the short rate in Hull-White model on Wikipedia is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Y0uAN.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Y0uAN.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the same equation in Damiano's &lt;code&gt;Interest Rate Models - Theory and Practice&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/4ElVy.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/4ElVy.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q&lt;/strong&gt;: I don't see how the formulas for the &lt;strong&gt;expectation&lt;/strong&gt; are related. The formula in the book has instantaneous forward curve, which is nowhere in Wikipedia.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2017-01-09T20:40:31.563" Title="Hull-White formula on wikipedia, correct?" Tags="&lt;hullwhite&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31849" PostTypeId="1" CreationDate="2017-01-09T14:43:28.200" Score="1" ViewCount="910" Body="&lt;p&gt;I would like to generate a random covariance matrix with variances in certain range. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can it be done? (In R if possible)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to generate a lower triangular matrix $L$ where the diagonal $D = \sqrt{V}$, where $V$ is the vector of variances. The problem lies with the rest of the values that do not lie on the diagonal. I do not know how to generate them in order to get at the end a meaningful covariance matrix. Finally, I would just do $C = LL^T$ (Cholesky) in order to get a positive definite matrix with the diagonal being $V$. &lt;/p&gt;&#xA;" OwnerUserId="24369" LastActivityDate="2017-01-09T21:54:16.827" Title="Generating a random covariance matrix with variances in range" Tags="&lt;covariance-matrix&gt;&lt;random-variables&gt;" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31850" PostTypeId="2" ParentId="31849" CreationDate="2017-01-09T14:55:11.660" Score="2" Body="&lt;p&gt;I haven't heard of a method to do it your way. Usually, you start with covariance matrix and do Cholesky in order to be able to generate random draws from the multinomial normal distribution with given covariance matrix. Maybe that is what you want? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In any case, if you need precisely specify the variances, see: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Hirschberger, M., Y. Qi, &amp;amp; R. E. Steuer (2007): “Randomly generating portfolio-selection covariance matrices with specified distributional charac- teristics.” European Journal of Operational Research 177(3): pp. 1610–1625.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But they have to be quite specific and I wasn't able to get their algorithm working.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But more suitable I reckon is Higham's Nearest PD (implemented in R in &lt;code&gt;Matrix&lt;/code&gt; package, function &lt;code&gt;nearPD&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Higham, N. J. (2002): “Computing the nearest correlation matrix—a problem from finance.” IMA journal of Numerical Analysis 22(3): pp. 329–343.&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="22237" LastEditorUserId="22237" LastEditDate="2017-01-09T15:43:35.110" LastActivityDate="2017-01-09T15:43:35.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31851" PostTypeId="2" ParentId="31849" CreationDate="2017-01-09T15:30:08.853" Score="3" Body="&lt;p&gt;A useful decomposition is, in R's matrix notation, &lt;code&gt;V = S %*% C %*% S&lt;/code&gt;, in which &lt;code&gt;S&lt;/code&gt; is&#xA;a matrix with the standard deviations on the main&#xA;diagonal and zeros elsewhere, and &lt;code&gt;C&lt;/code&gt; is the correlation matrix.&#xA;(See this note on &lt;a href=&quot;http://comisef.wikidot.com/tip:diagonalmatrixmultiplication&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;Matrix Multiplication with Diagonal Matrices&quot;&gt;Matrix Multiplication with Diagonal Indices&lt;/a&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get a meaningful &lt;code&gt;V&lt;/code&gt;, you need to have &lt;code&gt;C&lt;/code&gt; positive (semi)-definit.&#xA;A simple way to achieve this is to make the correlation a positive constant.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;n &amp;lt;- 5  ## number of assets&#xA;C &amp;lt;- array(0.5, dim = c(n, n))&#xA;diag(C) &amp;lt;- 1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For more variation, an approach that I have used is to&#xA;sample correlations from a reasonable range. Then, of&#xA;course, there is no guarantee that &lt;code&gt;C&lt;/code&gt; is positive&#xA;semi-definit, but you can repair it. See, for instance,&#xA;the function &lt;code&gt;repairMatrix&lt;/code&gt; in package &lt;code&gt;NMOF&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="6857" LastActivityDate="2017-01-09T15:30:08.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31852" PostTypeId="2" ParentId="31848" CreationDate="2017-01-09T15:36:36.013" Score="12" Body="&lt;p&gt;For the Hull-White model, where &#xA;\begin{align*}&#xA;dr_t = (\theta(t)-a r_t)dt+ \sigma dW_t,&#xA;\end{align*}&#xA;under the risk-neutral measure, we have that, for $t\ge s \ge 0$,&#xA;\begin{align*}&#xA;r_t = e^{-a(t-s)} r_s + \int_s^t  \theta(u)e^{-a(t-u)} du + \int_s^t \sigma e^{-a(t-u)} dW_u.&#xA;\end{align*}&#xA;Then, if $\theta$ is a constant,&#xA;\begin{align*}&#xA;r_t \mid r_s &amp;amp;\sim N\left(e^{-a(t-s)} r_s + \int_s^t  \theta e^{-a(t-u)} du\Big), \, \frac{\sigma^2}{2a}\Big(1-e^{-2a(t-s)}\Big)\right) \\&#xA;&amp;amp;\sim N\left(e^{-a(t-s)} r_s + \frac{\theta}{a} \Big(1-e^{-a(t-s)}\Big), \, \frac{\sigma^2}{2a}\Big(1-e^{-2a(t-s)}\Big)\right).&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the general case (see &lt;a href=&quot;https://quant.stackexchange.com/questions/21513/extended-hull-white-interest-rate-model-for-zero-coupon-bond/21516#21516.&quot;&gt;this question&lt;/a&gt;), the price of a zero-coupon bond price is given by&#xA;\begin{align*}&#xA;P(t, T) &amp;amp;= A(t, T) e^{-B(t, T)\, r_t},&#xA;\end{align*}&#xA;where&#xA;\begin{align*}&#xA;B(t, T) = \frac{1}{a}\Big(1-e^{-a(T-t)} \Big),&#xA;\end{align*}&#xA;and &#xA;\begin{align*}&#xA;A(t, T) &amp;amp;= \exp\left(- \int_t^T  \theta(u) B(u, T) du -\frac{\sigma^2}{2a^2}\big(B(t, T) -T+t\big)-\frac{\sigma^2}{4a}B(t, T)^2\right).&#xA;\end{align*}&#xA;Given the initial bond price curve, note that&#xA;\begin{align*}&#xA;\ln P(0, T) = \ln A(0, T) - B(0, T)\, r_0.&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;f(0, T) &amp;amp;= -\frac{\partial \ln P(0, T)}{\partial T}\\&#xA;&amp;amp;= \int_0^T  \theta(u) \frac{\partial B(u, T)}{\partial T} du + \frac{\sigma^2}{2a^2}\Big(\frac{\partial B(0, T)}{\partial T} -1\Big)+ \frac{\sigma^2}{2a}B(0, T) \frac{\partial B(0, T)}{\partial T}\\&#xA;&amp;amp;\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\ + \frac{\partial B(0, T)}{\partial T} r_0\\&#xA;&amp;amp;=\int_0^T  \theta(u) e^{-a(T-u)} du+ \frac{\sigma^2}{2a^2}\Big(e^{-a T} -1\Big)+ \frac{\sigma^2}{2a^2}\Big(e^{-a T}-e^{-2a T} \Big) + e^{-a T} r_0\\&#xA;&amp;amp;=\int_0^T  \theta(u) e^{-a(T-u)} du - \frac{\sigma^2}{2a^2}\Big(e^{-a T} -1\Big)^2 + e^{-a T} r_0.&#xA;\end{align*}&#xA;That is, &#xA;\begin{align*}&#xA;\int_0^T  \theta(u) e^{-a(T-u)} du &amp;amp;= f(0, T) + \frac{\sigma^2}{2a^2}\Big(e^{-a T} -1\Big)^2-e^{-a T} r_0\\&#xA;&amp;amp;=\alpha(T)-e^{-a T} r_0, \tag{1}&#xA;\end{align*}&#xA;where&#xA;\begin{align*}&#xA;\alpha(T) = f(0, T) + \frac{\sigma^2}{2a^2}\Big(e^{-a T} -1\Big)^2.&#xA;\end{align*}&#xA;Moreover, from $(1)$, &#xA;\begin{align*}&#xA;\int_0^T  \theta(u) e^{au} du= e^{aT}\alpha(T)-r_0.&#xA;\end{align*}&#xA;Then &#xA;\begin{align*}&#xA;\int_s^t \theta(u) e^{-a(t-u)} du &amp;amp;= e^{-a t} \int_s^t \theta(u) e^{a u} du\\&#xA;&amp;amp;= e^{-a t}\left(e^{at}\alpha(t)-e^{as} \alpha(s) \right)\\&#xA;&amp;amp;=\alpha(t) - e^{-a(t-s)}\alpha(s).&#xA;\end{align*}&#xA;Therefore,&#xA;\begin{align*}&#xA;r_t \mid r_s &amp;amp;\sim N\left(e^{-a(t-s)} r_s + \int_s^t  \theta(u) e^{-a(t-u)} du\Big), \, \frac{\sigma^2}{2a}\Big(1-e^{-2a(t-s)}\Big)\right) \\&#xA;&amp;amp;\sim N\left(e^{-a(t-s)} r_s + \alpha(t) - e^{-a(t-s)}\alpha(s), \, \frac{\sigma^2}{2a}\Big(1-e^{-2a(t-s)}\Big)\right).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2017-01-09T20:40:31.563" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31853" PostTypeId="1" CreationDate="2017-01-09T16:56:05.263" Score="-2" ViewCount="118" Body="&lt;p&gt;Assume an equity fund sample shows returns negatively correlated with the S&amp;amp;P 500.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are we more inclined to say that a) these funds are invested outside the S&amp;amp;P 500, perhaps non-US stocks; b) these funds have selected stocks belonging to the S&amp;amp;P 500, but substantially uncorrelated with the index?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I give a quantitative context for the problem above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let  $R_{it}$,  $M_t$ be resp. the $i$-th fund, and the index return in $t$. &#xA;Let $s_i$ be the total wealth of the $i$-th fund invested in stocks belonging to the index. Therefore,  $\bar{s}_i=1- s_i$ identifies portfolio assets not belonging to the index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the linear model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;R_{it} = \alpha_i + \beta_iM_t + e_{it}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a large sample of funds, if  $\beta_i$ are consistently and significantly negative, can we say that  $\bar{s}_i$ is large, that is,  on average funds' wealth is not invested in the S&amp;amp;P index?&lt;/p&gt;&#xA;" OwnerUserId="3434" LastEditorUserId="3434" LastEditDate="2017-01-12T19:10:08.523" LastActivityDate="2017-01-12T19:10:08.523" Title="Return correlations" Tags="&lt;correlation&gt;&lt;index&gt;&lt;mutual-fund&gt;&lt;funds&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31854" PostTypeId="2" ParentId="31853" CreationDate="2017-01-09T17:21:40.153" Score="0" Body="&lt;p&gt;When you say &quot;an equity fund sample shows returns negatively correlated with the S&amp;amp;P 500&quot;. So if I assume that the benchmark (S &amp;amp; P 500 in your case) to measure the performance of the returns is correct and it is negatively correlated, then it may be because the fund has the inverse positions as that of S &amp;amp; P 500. For example it might be possible that the 10 stocks which are there in the fund as long positions are there in the S &amp;amp; P 500 as short positions which will depict a negative correlation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if talk about your two given options:-&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) &quot;these funds are invested outside the S&amp;amp;P 500, perhaps non-US stocks&quot; - If this is the case then the obviously the choice of benchmark is entirely wrong i.e. it is obvious if the fund has invested in non US stocks, then it will show  a negative corelation when compared to S &amp;amp; P 500.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) &quot;these funds have selected stocks belonging to the S&amp;amp;P 500, but substantially uncorrelated with the index?&quot; - We can say this option as I have given the explanation at the start of my answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps!!&lt;/p&gt;&#xA;" OwnerUserId="18663" LastActivityDate="2017-01-09T17:21:40.153" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31855" PostTypeId="1" CreationDate="2017-01-09T17:29:25.660" Score="1" ViewCount="74" Body="&lt;p&gt;Assume a stochastic process $X_0 = 0$ and $X_t = \nu t + \sigma W_t$  where $W_t$ is standard Brownian motion and $\nu$ is a drift (can have $\nu \leq 0$ if necessary, but prefer it to be general), and $\sigma &amp;gt; 0$.  Furthermore,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Let  $\underline{X} &amp;lt; X_0$ be an exogenously given default threshold.  &lt;/li&gt;&#xA;&lt;li&gt;Define the first passage time as the random stopping time: $T = \inf\{ 0 &amp;lt; t \mid X_t=\underline{X} \}$.&lt;/li&gt;&#xA;&lt;li&gt;Define $0 &amp;lt; \bar{T} &amp;lt; \infty$ as a terminal time.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;An asset pays out as follows:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If default has not happened by the terminal date (i.e., $T &amp;gt; \bar{T}$), the asset pays $p(X)$&lt;/li&gt;&#xA;&lt;li&gt;If default does occur (i.e. $T \leq \bar{T}$), the asset pays $0$&lt;/li&gt;&#xA;&lt;li&gt;Everything is discounted at rate $r&amp;gt; 0$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;QUESTION:&lt;/strong&gt;&#xA;Given a $\nu,\sigma^2,\bar{T}, X(0),\underline{X}$, how do we price this asset?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is this standard?&lt;/strong&gt;&#xA;More abstractly (and forgive my poor knowledge of terminology),  is this linear combination of standard debt and equity instruments?  Looks a lot like a some weird combination of a stock market futures contract and a credit default swap, but I can't figure it out?  If it is standard, then we may be able to just add up the solution from some standard formulas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Attempts at solution:&lt;/strong&gt;&#xA;My gut tells me this can be written recursively with a Bellman equation such as:&#xA;$$&#xA;r V(t,X) = \nu V_X(t,X) + \frac{1}{2}\sigma^2 V_{XX}(t,X) + V_t(t,X)&#xA;$$&#xA;With boundary values,&#xA;$$&#xA;V(t,\underline{X}) = 0, \text{for all $t &amp;lt; \bar{T}$}&#xA;$$&#xA;and &#xA;$$&#xA;V(\bar{T},X) = p(X), \text{for all $X \geq \underline{X}$}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And if we could solve PDE, then the price is: $V(0,X(0))$.  Is this correct, or are the boundary values incorrect because they let the $X$ dip below $\bar{X}$ and then go above to gain potentially be higher at $\bar{T}$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this is the correct PDF and boundary values, I can attempt a direct solution.&lt;/p&gt;&#xA;" OwnerUserId="26009" LastEditorUserId="26009" LastEditDate="2017-01-10T16:55:26.143" LastActivityDate="2017-01-10T16:55:26.143" Title="Pricing defaultable asset with finite maturity" Tags="&lt;stochastic-processes&gt;&lt;futures&gt;&lt;brownian-motion&gt;&lt;default&gt;" AnswerCount="0" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="31856" PostTypeId="2" ParentId="31849" CreationDate="2017-01-09T21:54:16.827" Score="1" Body="&lt;p&gt;It is not entirely clear to me what you really want but the following approach might help. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume you can generate (samples of) &quot;variances in a certain range&quot;. So let $\sigma_1^2,\ldots,\sigma_n^2$ be an (instance of) such variances.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your problem then is to find a way to generate random symmetric matrices with eigenvalues $\sigma_1^2,\ldots,\sigma_n^2$. According to the spectral theorem a real n-by-n matrix $C$ is positive definite with such eigenvalues if and only if it allows orthogonal diagonalisation, i.e. the factorisation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ C = Q D Q^T$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $D=\text{diag}(\sigma_1^2,\ldots,\sigma_n^2)$ is a diagonal and $Q$ a n-by-n orthogonal matrix. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you know $D$ the only thing you need to do is sample orthogonal matrices. This can be done in R using &lt;code&gt;rortho&lt;/code&gt; from the package &lt;code&gt;pracma&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="482" LastActivityDate="2017-01-09T21:54:16.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31857" PostTypeId="1" CreationDate="2017-01-09T22:12:32.183" Score="1" ViewCount="160" Body="&lt;p&gt;I am not sure if this is the right site, I hope so! But it is half coding half econometric so I guess the answer can only be given from finance professional.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In matlab it is possible to run robust regressions by putting the option 'RobustOpts','on' in fitlm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the output there is also the $R^2$ and adjusted-$R^2$. However, my question is: $R^2$ is a typical concept of min squared residuals, does this apply to robust regressions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And what is exactly the $R^2$ in that specific context?&lt;/p&gt;&#xA;" OwnerUserId="22194" LastActivityDate="2017-01-10T20:45:36.190" Title="Robust regressions: how to interpreter R^2" Tags="&lt;programming&gt;&lt;regression&gt;&lt;robust-optimization&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31858" PostTypeId="2" ParentId="31857" CreationDate="2017-01-09T23:07:19.893" Score="1" Body="&lt;p&gt;$R^{2}$ is a measure of goodness of fit. You can calculate it regardless of the type of linear regression model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it may not always have value. For instance, if you have an extreme outlier in your data, then a classic $R^{2}$ will typically be lower than you expect (because there is variation in the data that your model is not picking up). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternately, you can calculate a weighted $R^{2}$ based on how the robust regression is performed. Assuming Matlab chooses weights to effectively ignore the outlier and treat the other data the same, then a weighted $R^{2}$ would be higher. That being said, I don't know if that's how Matlab calculates it or not. It would be simple enough to verify.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might also find the discussion &lt;a href=&quot;https://stats.stackexchange.com/questions/83826/is-a-weighted-r2-in-robust-linear-model-meaningful-for-goodness-of-fit-analys&quot;&gt;here&lt;/a&gt; informative (and how to calculated weighted $R^{2}$). &lt;/p&gt;&#xA;" OwnerUserId="2379" LastEditorUserId="-1" LastEditDate="2017-04-13T12:44:17.637" LastActivityDate="2017-01-10T20:45:36.190" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31859" PostTypeId="2" ParentId="31857" CreationDate="2017-01-09T23:15:40.220" Score="0" Body="&lt;p&gt;R-squared is a statistical measure of how close the data are to the fitted regression line. It is also known as the coefficient of determination, or the coefficient of multiple determination for multiple regression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is also a statistical tool which measures the goodness of fit for a linear model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;R2=1−SSE/SST&lt;/em&gt;, where &lt;strong&gt;SSE&lt;/strong&gt; is the sum of squared error (residuals or deviations from the regression line) and &lt;strong&gt;SST&lt;/strong&gt; is the sum of squared deviations from the dependent's Y mean.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And yes you may apply it to robust regression but there are limitations to it as it doesn't indicate whether a regression model is adequate. You can have a low R-squared value for a good model, or a high R-squared value for a model that does not fit the data.&lt;/p&gt;&#xA;" OwnerUserId="18663" LastActivityDate="2017-01-09T23:15:40.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31860" PostTypeId="2" ParentId="31752" CreationDate="2017-01-10T03:01:10.513" Score="0" Body="&lt;p&gt;The 0.2 versions of the ROI packages made breaking changes. We're working on a fix. In the meantime, I would suggest downgrading to ROI v0.1-0 and and ROI.plugin.* to 0.0-2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could also run the optimization with a different optimization method, e.g. &lt;code&gt;optimize_method = &quot;random&quot;&lt;/code&gt; or &lt;code&gt;optimize_method = &quot;DEoptim&quot;&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="26048" LastActivityDate="2017-01-10T03:01:10.513" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31861" PostTypeId="1" AcceptedAnswerId="31862" CreationDate="2017-01-10T04:06:02.377" Score="6" ViewCount="4219" Body="&lt;p&gt;Suppose we have a Brownian Motion $BM(\mu,\sigma)$ defined as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_t=X_0 + \mu ds + \sigma dW_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The quadratic variation of $X_t$ can be calculated as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dX_t dX_t = \sigma^2 dW_tdW_t = \sigma^2 dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where all lower order terms have been dropped, therefore the quadratic variation (also the variance of $X_t$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$[X_t,X_t]=\int_0^t \sigma^2 ds=\sigma^2 t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was trying to use the same tech solve the problem posted in &lt;a href=&quot;https://quant.stackexchange.com/questions/29504/integral-of-brownian-motion-w-r-t-time?noredirect=1&amp;amp;lq=1&quot;&gt;Integral of Brownian Motion w.r.t Time&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I start as differential form $dX_t = W_tdt$ and calculate $dX_t dX_t$. After drop all lower order terms, I have $dX_tdX_t=0$. This means the quadratic variation is zero. Hence we have the variance is zero?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand this isn't correct. But I really want to know what, prevents me doing this problem as previous one?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am pretty new to SDE and any help will be appreciated! Thanks a lot!&lt;/p&gt;&#xA;" OwnerUserId="19653" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2017-01-10T13:29:27.123" Title="Can I always use quadratic variation to calculate variance?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="31862" PostTypeId="2" ParentId="31861" CreationDate="2017-01-10T06:48:00.783" Score="12" Body="&lt;p&gt;Quadratic variation and variance are two different concepts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $X $ be an Ito process and $t\geq 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Variance of $X_t$ is a deterministic quantity where as quadratic variation at time $t $ that you denoted by $[X,X]_t $ is a random variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is confusing you is the fact that when $X $ is a martingale then&#xA;$X^2_t-[X,X]_t$ is a martingale thus you have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E (X_t^2)=E ([X,X]_t)+E (X^2_0) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case where $X_0=0$ ( and thus $E (X_t)=0$ because $X $ is a martingale)&#xA;You have $$Variance (X_t)=E ([X,X]_t) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the general case, it is not true. Your example is the case where $X $ is not a martingale and thus it is not true.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please comment for any further explanation.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastActivityDate="2017-01-10T06:48:00.783" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31863" PostTypeId="1" AcceptedAnswerId="31865" CreationDate="2017-01-10T07:18:24.603" Score="5" ViewCount="2054" Body="&lt;p&gt;The wikipedia &lt;a href=&quot;https://en.wikipedia.org/wiki/Cox%E2%80%93Ingersoll%E2%80%93Ross_model&quot; rel=&quot;nofollow noreferrer&quot;&gt;entry on the CIR Model&lt;/a&gt; states that &quot;this process can be defined as a sum of squared Ornstein–Uhlenbeck process&quot; but provides no derivation or reference. Can any one do that? I could only derive equilibrium level for special numbers proportional to natural numbers and not for arbitrary real numbers.&lt;/p&gt;&#xA;" OwnerUserId="6686" LastEditorUserId="6686" LastEditDate="2017-01-10T18:31:16.713" LastActivityDate="2020-06-04T22:37:20.907" Title="CIR Process from Ornstein–Uhlenbeck process" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;heston&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31865" PostTypeId="2" ParentId="31863" CreationDate="2017-01-10T10:49:51.533" Score="6" Body="&lt;p&gt;I don't think that the statement you reference is correct for general $n \in \mathbb{R}$ but only for $n \in \mathbb{N}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The intuition behind this is that each Ornstein-Uhlenbeck (OU) process is normally distributed. Thus the sum of $n$ squared OU processes is chi-squared distributed with $n$ degrees of freedom. Define $X$ to be a $n$-dimensional vector valued OU process with&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathrm{d}X_t^i = \alpha X_t^i \mathrm{d}t + \beta \mathrm{d}W_t^i,&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W$ is a $n$-dimensional vector of independent Brownian motions. Let&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;Y_t = \sum_{i = 1}^n \left( X_t^i \right)^2.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\mathrm{d} \left( X_t^i \right)^2 &amp;amp; = &amp;amp; 2 X_t^i \mathrm{d}X_t^i + 2 \mathrm{d} \langle X^i \rangle_t\\&#xA;&amp;amp; = &amp;amp; \left( 2 \alpha \left( X_t^i \right)^2 + \beta^2 \right) \mathrm{d}t + 2 \beta X_t^i \mathrm{d}W_t^i&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\mathrm{d}Y_t &amp;amp; = &amp;amp; \mathrm{d} \left( \sum_{i = 1}^n \left( X_t^i \right)^2 \right)\\&#xA;&amp;amp; = &amp;amp; \sum_{i = 1}^n \mathrm{d} \left( X_t^i \right)^2\\&#xA;&amp;amp; = &amp;amp; \left( 2 \alpha Y_t + n \beta^2 \right) \mathrm{d}t + 2 \beta \sum_{i = 1}^n X_t^i \mathrm{d}W_t^i,&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the second step follows from the independence of the Brownian motions. Next note that the process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;Z_t = \int_0^t \sum_{i = 1}^n X_u^i \mathrm{d}W_u^i&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is a martingale with quadratic variation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\langle Z \rangle_t &amp;amp; = &amp;amp; \int_0^t \sum_{i = 1}^n \left( X_u^i \right)^2 \mathrm{d}u\\&#xA;&amp;amp; = &amp;amp; \int_0^t Y_u \mathrm{d}u.&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consequently, by Levy's characterization theorem, the process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\tilde{W}_t = \int_0^t \frac{1}{\sqrt{Y_u}} \sum_{i = 1}^n X_u^i \mathrm{d}W_u^i&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is a Brownian motion. Thus&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\mathrm{d}Y_t &amp;amp; = &amp;amp; \left( 2 \alpha Y_t + n \beta^2 \right) \mathrm{d}t + 2 \beta \sqrt{Y_t} \mathrm{d}\tilde{W}_t\\&#xA;&amp;amp; = &amp;amp; \kappa \left( \theta - Y_t \right) \mathrm{d}t + \xi \sqrt{Y_t} \mathrm{d}W_t,&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\kappa = -2 \alpha$, $\theta = -n \beta^2 / 2 \alpha$ and $\xi = 2 \beta$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be generalized to $n \in \mathbb{R}$ by considering a time-change of a squared Bessel process. A comprehensive reference is Chapter 6 in Jeanblanc, Yor and Chesney (2009) &quot;Mathematical Methods for Financial Markets&quot;, Springer.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-01-10T18:49:51.110" LastActivityDate="2017-01-10T18:49:51.110" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="31868" PostTypeId="2" ParentId="31784" CreationDate="2017-01-10T18:58:16.513" Score="-1" Body="&lt;p&gt;Have a look at the following R package:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.rdocumentation.org/packages/highfrequency/versions/0.4&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.rdocumentation.org/packages/highfrequency/versions/0.4&lt;/a&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe it has all the tools you need and good references to papers and methodology. &lt;/p&gt;&#xA;" OwnerUserId="16937" LastActivityDate="2017-01-10T18:58:16.513" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31870" PostTypeId="2" ParentId="74" CreationDate="2017-01-11T08:47:51.400" Score="0" Body="&lt;p&gt;&lt;a href=&quot;https://orats.com/products/scan-backtest&quot; rel=&quot;nofollow noreferrer&quot;&gt;ORATS&lt;/a&gt; offers a comprehensive scanning and backtesting tool. &lt;/p&gt;&#xA;" OwnerUserId="26068" LastActivityDate="2017-01-11T08:47:51.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31873" PostTypeId="1" CreationDate="2017-01-11T13:00:42.427" Score="5" ViewCount="113" Body="&lt;p&gt;In a recent paper of Salazar et al. (2014),  &lt;a href=&quot;http://apo.org.au/files/Resource/the_diversification_delta_-_a_different_perspective.pdf&quot; rel=&quot;noreferrer&quot;&gt;&lt;em&gt;The Diversification Delta: A Different Perspective&lt;/em&gt;&lt;/a&gt;, forthcoming in the Journal of Portfolio Management , the authors propose to use the exponential Shannon entropy as an uncertainty measure in portfolio selection and make the following claim:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we define $$H(X)=−\int_xf(x)\text{ln}f(x)dx$$ &#xA;to be the differential Shannon entropy, then we have that for random variables $X$ and $Y$ (pp.10): $$\text{exp}(H(X+Y))\leqslant \text{exp}(H(X))+\text{exp}(H(X))$$  After thorough research I haven't been able to find any proof of this sub-additive property which makes me wonder: is this property really correct? And would you have any proof of it? Moreover is seems that this sub-additive property is at odds with the entropy power inequality that says that for independent $X$ and $Y$: $$\text{exp}(2H(X+Y))⩾\text{exp}(2H(X))+\text{exp}(2H(X))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I am interested in knowing how this property would generalize to Rényi entropy defined as $$H_\alpha(X)=\frac{1}{1-\alpha}\text{ln}∫_x(f(x))^αdx$$ Is $\text{exp}(H_\alpha(X))$ also sub-additive for some values of $\alpha$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would really appreciate any insights you might have on this problem.&lt;/p&gt;&#xA;" OwnerUserId="26072" LastEditorUserId="70" LastEditDate="2017-02-14T13:05:30.290" LastActivityDate="2017-02-14T13:05:30.290" Title="Is the exponential Shannon entropy sub-additive?" Tags="&lt;portfolio-management&gt;&lt;mathematics&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31875" PostTypeId="1" CreationDate="2017-01-11T20:16:20.177" Score="1" ViewCount="889" Body="&lt;p&gt;Can anybody please help me out with the below question with a brief explanation:-&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A 10-year zero coupon bond is callable annually at par (its face value) starting at the beginning of year 6. Assume a flat yield curve of 10%. What is the bond duration?&#xA;A- 10 Years&#xA;B- 5 Years&#xA;C- 7.5 Years&#xA;D- Cannot be determined based on the data given.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to me it should be 10 years as the duration of a zero coupon bond is always equal to its maturity. But I am not getting convinced with  my answer because of the callable feature in the question. Can somebody please explain me in context of the callable feature on the zero coupon bond?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!!&lt;/p&gt;&#xA;" OwnerUserId="18663" LastActivityDate="2017-01-11T20:16:20.177" Title="Duration of callable zero coupon bond" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;duration&gt;&lt;zero-coupon&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31878" PostTypeId="1" CreationDate="2017-01-12T08:16:36.360" Score="4" ViewCount="4446" Body="&lt;p&gt;What is the difference between trading physical gold forwards and XAU/USD forwards? Why are both traded? The physical gold forward would obviously be settled physically, but how is an XAU/USD settled, i.e, when gold is traded as a currency?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="26083" LastActivityDate="2017-01-19T01:34:45.527" Title="Trading physical gold vs XAU" Tags="&lt;forward&gt;&lt;commodities&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31881" PostTypeId="1" CreationDate="2017-01-12T11:28:28.420" Score="0" ViewCount="513" Body="&lt;p&gt;Maybe you can help me with the question about trading on CFE.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With which broker can I trade S&amp;amp;P 500 Variance Futures (VA)?&lt;/p&gt;&#xA;" OwnerUserId="26085" LastEditorUserId="19887" LastEditDate="2017-01-12T12:51:44.153" LastActivityDate="2017-01-12T13:48:27.797" Title="Variance Futures Trading" Tags="&lt;futures&gt;&lt;variance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31882" PostTypeId="2" ParentId="31881" CreationDate="2017-01-12T13:48:27.797" Score="1" Body="&lt;p&gt;The market for Variance futures on the CBOE Futures Exchange is unfortunately inactive, there is not much trading if any on most days. (Probably they will be delisted soon?). Some other CFE futures contract (such as VIX) are very active and can be traded for example on Interactive Brokers. The broker is not the issue, it is just that the VA contract is a failure so far.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2017-01-12T13:48:27.797" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31883" PostTypeId="1" CreationDate="2017-01-12T13:59:12.120" Score="3" ViewCount="737" Body="&lt;p&gt;I have specified a (Lognormal) short-rate model (non-affine) under the Risk-Neutral measure $Q$ as a shifted exponential vasicek:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ r(t) = e^{y(t)} + \phi(t)\\&#xA;\text{with} \quad  dy(t) = \kappa(\theta - y(t))dt + \sigma_y dW(t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\phi(t)$ is a shift based on parameters in $y$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can compute ZC Bond prices with the short-rate model, from which I can obtain forward rates. I want to use this to price financial derivatives, in particular Swaptions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Following &lt;a href=&quot;http://www.ntu.edu.sg/home/nprivault/indext.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Privault&lt;/a&gt; Proposition 14.6, the price of a European Swaption is given by &#xA;$P(t,T_i, T_j) \mathbb{\hat{E}}_{i,j} \Big[ (S(T_i, T_i, T_j) - K)^+ \vert \mathcal{F}_t \Big]$&#xA;i.e. the expected payoff under the $(T_i, T_j)$ - Forward measure, where $S(\cdot)$ is the Swap Rate. Is there a way I can use MC simulations, to simulate this price? Or is pricing via Black the only option (since we simulate Lognormal distributed Rates) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) I understand that the $T$-Forward Measure takes ZC Bonds as numeraire and by Girsanov Theorem the drift of the short-rate model changes under the $T$-Forward Measure. How would it be possible to specify my short-rate model under $T$-Forward Measure?&lt;/p&gt;&#xA;" OwnerUserId="16376" LastEditorUserId="16376" LastEditDate="2017-01-12T14:41:31.863" LastActivityDate="2020-09-06T16:32:58.970" Title="How to price Swaptions with short rate models?" Tags="&lt;options&gt;&lt;fixed-income&gt;&lt;stochastic-processes&gt;&lt;risk-neutral-measure&gt;&lt;short-rate&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31886" PostTypeId="2" ParentId="31832" CreationDate="2017-01-12T19:54:46.367" Score="1" Body="&lt;p&gt;Here is one sufficient condition for square integrability of $\psi(t,\omega)$ which may be very useful. Given stochastic process $X(t,\omega)$ satisfying SPDE&#xA;$$dX = \mu(t,X)dt+\sigma(t,X)dW$$&#xA;where $(\mu(t,x),\sigma(t,x))$ is Liptschitz continuous, I think $\displaystyle\int_t^T \mathbf E[\sigma(s,X)^2]ds&amp;lt;\infty$. Note here that the functions depend on the spatial variable $x$ rather than the more general sample $\omega$. I will write out the proof when I have time.&lt;/p&gt;&#xA;" OwnerUserId="6686" LastEditorUserId="6686" LastEditDate="2017-01-12T22:44:47.653" LastActivityDate="2017-01-12T22:44:47.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31888" PostTypeId="1" CreationDate="2017-01-13T08:21:33.167" Score="2" ViewCount="210" Body="&lt;p&gt;I am looking at acquiring a system to help with multi-instrument modelling. Across the spectrum Equity/FI/Swap/Repo/CDS/FxSwap/Forward/Future/etc for vanilla and more complex derivatives. The modeling is all the way from instrument creation and financial modelling for a deal through to xVA , Credit Risk , E/P-FE , the list is obviously long. I have recently had the pleasure of seeing some implementations of a system called FINCAD and another called TriOptima. I was hoping someone might have had experience with one the other or both and could deliver an option as to their experience and ability / flexibility / coverage / usage of the systems?&lt;/p&gt;&#xA;" OwnerUserId="25989" LastActivityDate="2017-01-13T08:21:33.167" Title="Derivative and Credit Risk Modelling" Tags="&lt;derivatives&gt;&lt;credit-risk&gt;&lt;risk-models&gt;&lt;quants&gt;&lt;credit-derivatives&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31889" PostTypeId="1" CreationDate="2017-01-13T08:51:41.943" Score="1" ViewCount="157" Body="&lt;p&gt;It is not clear for me the mechanism of margin requirements for OTC variance swaps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't see in supplementary information to OTC Swaps the rules of margin maintenance or initial margin or something like that. How do the counterparties guarantee (without margin, unlike in futures trading) that trade losses do not exceed the initial deposit amount?&lt;/p&gt;&#xA;" OwnerUserId="26085" LastEditorUserId="20795" LastEditDate="2019-09-08T09:09:07.583" LastActivityDate="2019-09-08T09:09:07.583" Title="Margin requirements for OTC variance swaps" Tags="&lt;swaps&gt;&lt;margin&gt;&lt;variance-swap&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="31890" PostTypeId="2" ParentId="30996" CreationDate="2017-01-13T08:53:22.627" Score="3" Body="&lt;p&gt;I think it is important to understand the following: Technical analysis is not rigorous &lt;em&gt;not&lt;/em&gt; because of the used data per se but because of the used methodology!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Classical technical analysis uses ill-defined graphical patterns and has no good quantitative methodology for testing the accuracy of the results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many of the same problems often haunt classical fundamental analysis which uses different metrics so the big difference to quantitative finance - as I understand it - is a mathematical systematization of those concepts and using the scientific method to find out what works and what doesn't.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On top of that with quantitative finance und especially machine learning (which is the term used nowadays) you could use the full construction kit of  algorithms that can learn from and make predictions on data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But even classical technical analysis can be made rigorous, see e.g. my answer here:&lt;br&gt;&#xA;&lt;a href=&quot;https://quant.stackexchange.com/a/8258/12&quot;&gt;https://quant.stackexchange.com/a/8258/12&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2017-01-13T08:53:22.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31892" PostTypeId="1" CreationDate="2017-01-13T12:46:17.587" Score="1" ViewCount="419" Body="&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the following model, where $r=0$, and a dividend of 1 unit of currency is paid at time 1.5.&#xA;$$&#xA;\begin{array}{|c|c|c|c|}&#xA;\hline&#xA;&amp;amp; S(0,\omega) &amp;amp; S(1,\omega)^* &amp;amp; S(2,\omega)^* \\ \hline&#xA;\omega_1 &amp;amp; 6&amp;amp; 9&amp;amp; 11\\ \hline&#xA;\omega_2 &amp;amp; 6&amp;amp; 9&amp;amp; 7\\ \hline&#xA;\omega_3 &amp;amp; 6&amp;amp; 4&amp;amp; 7\\ \hline&#xA;\omega_4 &amp;amp; 6&amp;amp; 4&amp;amp; 1\\ \hline&#xA;\end{array}&#xA;$$&#xA;a) Calculate the risk-neutral probabilities at each node of the information tree.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) Calculate the value at each node of an American call option with exercise price $K=5$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;c) Construct a hedging strategy for the portfolio&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My solution:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) Risk neutral probabilities give expected value equal to the value. Make sure to use dividend in expected value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$6=9\times p + 4 \times (1-p) \implies P(S(1)=9) = \frac{2}{5},\quad P(S(1)=4) = \frac{3}{5}$&#xA;$9=12\times p + 8 \times (1-p) \implies P(S(2)=11|S(1)=9) = \frac{1}{4}, \quad P(S(2)=7|S(1)=9) = \frac{3}{4}$&#xA;$4=8\times p + 2 \times (1-p) \implies P(S(2)=7|S(1)=4) = \frac{1}{3},\quad  P(S(2)=1|S(1)=4) = \frac{2}{3}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) Work backwards from end, working out the max of value of exercising at that point or expected value of continuing.&#xA;$$&#xA;\begin{array}{|c|c|c|c|}&#xA;\hline&#xA;&amp;amp; V_{amer}(0,\omega) &amp;amp; V_{amer}(1,\omega)^* &amp;amp; V_{amer}(2,\omega)^* \\ \hline&#xA;\omega_1 &amp;amp; 2&amp;amp; 4 \text{ (stopping point)}&amp;amp; 6\\ \hline&#xA;\omega_2 &amp;amp; 2&amp;amp; 4 \text{ (stopping point)}&amp;amp; 2\\ \hline&#xA;\omega_3 &amp;amp; 2&amp;amp; \frac{2}{3}&amp;amp; 2\\ \hline&#xA;\omega_4 &amp;amp; 2&amp;amp; \frac{2}{3}&amp;amp; 0\\ \hline&#xA;\end{array}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;c) ???&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is part C asking? What is the portfolio, is it the stock, is it the option, is it something else? Aren't there different ways to hedge something? Does it mean working out how many units of stock at each node to short to eliminate the risk at each step? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, are my answers correct for the other two parts? Is my notation correct?&lt;/p&gt;&#xA;" OwnerUserId="26097" LastActivityDate="2017-01-13T12:46:17.587" Title="Constructing a hedging strategy for an American option" Tags="&lt;option-pricing&gt;&lt;hedging&gt;&lt;american-options&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31893" PostTypeId="2" ParentId="31181" CreationDate="2017-01-13T14:58:44.470" Score="4" Body="&lt;p&gt;The main issue with the answer from @quantuple is that the price does not converge to the Black-Scholes price when rho=0 or when the quanto adjustment is negligible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is answered in section 4 of the paper &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2097921&quot; rel=&quot;nofollow noreferrer&quot;&gt;On the Simulation of a Quanto Process Under Local Volatility&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In particular, it is shown that using atm vols (both fx and equity) for the quanto adjustment and vol @ strike for the Black-Scholes formula leads to reasonable results. As mentioned in other comments, using a strike dependent vol for the quanto adjustment is going to lead to arbitrages/be inconsistent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, a more sophisticated adjustment is to use a manufactured vol based on the distribution of FX and Equity processes such as in the paper &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2388093&quot; rel=&quot;nofollow noreferrer&quot;&gt;Quanto Implied Volatility Smile&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26098" LastEditorUserId="26098" LastEditDate="2019-03-24T17:42:17.667" LastActivityDate="2019-03-24T17:42:17.667" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="31894" PostTypeId="1" AcceptedAnswerId="31918" CreationDate="2017-01-13T15:16:15.110" Score="5" ViewCount="2006" Body="&lt;p&gt;Looking at a time series two North American CDX indexes, one high yield and one investment grade, shows somewhat unexpected trends.  CDX.NA.IG seems to be much higher and more volatile than  CDX.NA.HY, which is the opposite of what I would expect. From Bloomberg:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/MC8dg.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/MC8dg.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The ticker for the IG index is IBOXUMAE, and for the HY index is IBOXHYAE. Is there any reason why the IG index was so much higher pre-2013? Can I still use pre-2013 data or would that be problematic?&lt;/p&gt;&#xA;" OwnerUserId="17712" LastActivityDate="2017-01-17T09:49:04.083" Title="Reliability of CDS indices?" Tags="&lt;data&gt;&lt;cds&gt;&lt;indexes&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31896" PostTypeId="1" AcceptedAnswerId="31916" CreationDate="2017-01-13T20:45:25.483" Score="3" ViewCount="974" Body="&lt;p&gt;I'm trying to write an R script which takes in the 25d calls and puts along with ATM and creates a vol. smile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've attempted to use the method put forward by Castagna and Mercurio to calculate the vanna-volga volatility. The expression put forward, for a European Call is: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;C(K) = CBS(K)+ w(K1)&lt;em&gt;[CMkt(K1)-CBS(K1)]+w(K3)&lt;/em&gt;[CMkt(K3)-CBS(K3)]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where w1 and w3 are calculated as per the code below.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;BSoption &amp;lt;- function(type, S, X, t, r, rf, v)&#xA;{&#xA;&#xA;  d1 &amp;lt;- (log(S/X) + (r-rf + 0.5 * v^2) * t)/(v * sqrt(t))&#xA;  d2 &amp;lt;- d1 - v*sqrt(t)&#xA;  if (type == &quot;c&quot;){&#xA;    pnorm(d1)*S*exp(-rf*t) - pnorm(d2)*X*exp(-r*t)&#xA;  } else {&#xA;    pnorm(-d2)*X*exp(-r*t) - pnorm(-d1)*S*exp(-rf*t)&#xA;  }&#xA;}&#xA;&#xA;vega &amp;lt;- function(S, X, t, r, rf, v)&#xA;{&#xA;  d1 &amp;lt;- (log(S/X) + (r -rf + 0.5 * v^2) * t)/(v * sqrt(t))&#xA;  Np &amp;lt;- (exp(-d1^2/2))/ sqrt(2 * pi) &#xA;  (S * exp(-rf*t)*sqrt(t) * Np)/100&#xA;}&#xA;&#xA;implied.vol &amp;lt;-&#xA;  function(type, S, X, t, r, rf, market){&#xA;    sig &amp;lt;- 0.20&#xA;    sig.up &amp;lt;- 1&#xA;    sig.down &amp;lt;- 0.001&#xA;    count &amp;lt;- 0&#xA;    err &amp;lt;- BSoption(type, S, X, t, r, rf, sig) - market &#xA;&#xA;    ## repeat until error is sufficiently small or counter hits 1000&#xA;    while(abs(err) &amp;gt; 0.00001 &amp;amp;&amp;amp; count&amp;lt;1000){&#xA;      if(err &amp;lt; 0){&#xA;        sig.down &amp;lt;- sig&#xA;        sig &amp;lt;- (sig.up + sig)/2&#xA;      }else{&#xA;        sig.up &amp;lt;- sig&#xA;        sig &amp;lt;- (sig.down + sig)/2&#xA;      }&#xA;      err &amp;lt;- BSoption(type, S, X, t, r, rf, sig) - market&#xA;      count &amp;lt;- count + 1&#xA;    }&#xA;&#xA;    ## return NA if counter hit 1000&#xA;    if(count==1000){&#xA;      return(NA)&#xA;    }else{&#xA;      return(sig)&#xA;    }&#xA;  }&#xA;&#xA;S &amp;lt;- 0.906&#xA;X &amp;lt;- seq(0.7,1.2,0.01)&#xA;t &amp;lt;- 1&#xA;r &amp;lt;- 0.0507&#xA;rf &amp;lt;- 0.047#-log(0.9945049)/t&#xA;ATMcost &amp;lt;- BSoption(&quot;c&quot;,S,XATM,t,r,rf,vATM)&#xA;&#xA;v25p &amp;lt;- 0.13575#vv.inputs$Vol[vv.inputs$Skew == -0.25]&#xA;vATM &amp;lt;- 0.132#vv.inputs$Vol[vv.inputs$Skew == 0.0]&#xA;v25c &amp;lt;- 0.13425#vv.inputs$Vol[vv.inputs$Skew == 0.25]&#xA;&#xA;X25p &amp;lt;- 0.8350575#BSStrikeFromDelta(&quot;p&quot;,S,v25p,t,r,rf,0.25)&#xA;XATM &amp;lt;- S&#xA;X25c &amp;lt;- 1.000846#BSStrikeFromDelta(&quot;c&quot;,S,t,r,v25c,rf,0.25)&#xA;&#xA;w1 &amp;lt;- (vega(S,X,t,r,rf,vATM)/vega(S,X25p,t,r,rf,v25p))*((log(XATM/X)*log(X25c/X))/(log(XATM/X25p)*log(X25c/X25p)))&#xA;w2 &amp;lt;- (vega(S,X,t,r,rf,vATM)/vega(S,XATM,t,r,rf,vATM))*((log(X/X25p)*log(X25c/X))/(log(XATM/X25p)*log(X25c/XATM)))&#xA;w3 &amp;lt;- (vega(S,X,t,r,rf,vATM)/vega(S,X25c,t,r,rf,v25c))*((log(X/X25p)*log(X/XATM))/(log(X25c/X25p)*log(X25c/XATM)))&#xA;&#xA;VV.price &amp;lt;- ATMcost + w1*(BSoption(&quot;c&quot;,S,X25p,t,r,rf,v25p)-BSoption(&quot;c&quot;,S,X25p,t,r,rf,vATM)) + w3*(BSoption(&quot;c&quot;,S,X25c,t,r,rf,v25c)-BSoption(&quot;c&quot;,S,X25c,t,r,rf,vATM))&#xA;&#xA;VV.vol &amp;lt;- 0&#xA;for(i in 1:length(X)){&#xA;  VV.vol[i] &amp;lt;- implied.vol(&quot;c&quot;,S,X[i],t,r,rf,VV.price[i])&#xA;}&#xA;plot(X,VV.price)&#xA;plot(X,VV.vol)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see, I calculate the vanna-volga price of the option, which is consistent with the given quotes but, when I plot the volatility 'smile', it actually is not a smile at all and I'm not sure where I'm going wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help is much appreciated.&lt;/p&gt;&#xA;" OwnerUserId="26007" LastEditorUserId="26007" LastEditDate="2017-01-14T09:31:35.927" LastActivityDate="2017-01-16T08:23:57.267" Title="Calculating implied vol using vanna volga" Tags="&lt;programming&gt;&lt;implied-volatility&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31897" PostTypeId="1" CreationDate="2017-01-13T22:49:07.237" Score="2" ViewCount="132" Body="&lt;p&gt;I'm confused as to how a method that values securities purely on their expected return works in the real world if it doesn't take into account the fact that investors demand a higher return for greater variance in expected return.&lt;/p&gt;&#xA;" OwnerUserId="26102" LastActivityDate="2017-01-13T23:40:55.663" Title="How can risk-neutral pricing find the right price for securities if it doesn't account for risk premia?" Tags="&lt;risk-neutral-measure&gt;&lt;sharpe-ratio&gt;&lt;expected-return&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31898" PostTypeId="2" ParentId="31897" CreationDate="2017-01-13T23:40:55.663" Score="4" Body="&lt;p&gt;The &lt;em&gt;price&lt;/em&gt; of a derivative does not explicitly depend on the expected return of the underlying, however the &lt;em&gt;price change&lt;/em&gt; or &lt;em&gt;return&lt;/em&gt; of the derivative depends on the return of the underlying. Hence the &lt;em&gt;expected return&lt;/em&gt; of the derivative depends on the &lt;em&gt;expected return&lt;/em&gt; of the underlying, which is what matters. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also remember that the price is a function of the spot of the underlying, and this is what a pricing formula does: establishes how the derivative is priced &lt;em&gt;relative&lt;/em&gt; to the underlying price. A derivative inherits all risk from the underlying, it does not have its own risk, so to speak. If the underlying becomes very risky, then its price will fall to offer higher expected return in the future; the derivative price will also change to reflect that. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2017-01-13T23:40:55.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31899" PostTypeId="1" AcceptedAnswerId="31901" CreationDate="2017-01-14T06:26:17.113" Score="1" ViewCount="984" Body="&lt;p&gt;I'm trying to get my head around the following Kaggle competition:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.kaggle.com/c/two-sigma-financial-modeling/data&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.kaggle.com/c/two-sigma-financial-modeling/data&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The data is a frame made up of various columns, with a tuple structure as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;time,id,derived0,derived1,...,derivedn,fundemental0,fundemental1,...,fundementalm,technical0,technical1,....,technicalk&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There are 3 types of value columns that represent:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Fundamental values &lt;/li&gt;&#xA;&lt;li&gt;Derived values &lt;/li&gt;&#xA;&lt;li&gt;Technical values&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Fundamental values&lt;/em&gt;&lt;/strong&gt; are raw values say the stock price or temperature at time T&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Derived values&lt;/em&gt;&lt;/strong&gt; are 'derived' from a combination of fundamental values perhaps? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;eg: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;time @ t_i derived[1] = fundamental[0] - fundamental[3] / fundamental[2]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But what is definition of &lt;strong&gt;&lt;em&gt;technical value&lt;/em&gt;&lt;/strong&gt;? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is an example technical value in terms of others?&lt;/p&gt;&#xA;" OwnerUserId="26105" LastActivityDate="2017-01-14T11:37:36.147" Title="What is a technical value?" Tags="&lt;data&gt;&lt;technicals&gt;&lt;column-oriented&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31900" PostTypeId="2" ParentId="31896" CreationDate="2017-01-14T10:38:58.100" Score="0" Body="&lt;p&gt;In the line below all I had to do was replace X[i] with XATM because the vanna volga method creates a price for an option that satisfies the hedged vega,vanna,volga ATM so you're always getting vol. with ATM strike.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;VV.vol[i] &amp;lt;- implied.vol(&quot;c&quot;,S,X[i],t,r,rf,VV.price[i])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="26007" LastActivityDate="2017-01-14T10:38:58.100" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31901" PostTypeId="2" ParentId="31899" CreationDate="2017-01-14T11:37:36.147" Score="2" Body="&lt;p&gt;In conventional parlance, fundamental values would refer to data about the stock's financials, i.e. the data contained in the financial statements. Examples could be the cash flow, assets, liabilities and so on. Technical values would refer to data obtained from the price history of the stock, for example a 50 day moving average of the price, or the resistance level among other things. My guess is that derived values would be a function of technical and fundamental values here. Note that the competition mentioned might not adhere to these conventions.&lt;/p&gt;&#xA;" OwnerUserId="20059" LastActivityDate="2017-01-14T11:37:36.147" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31905" PostTypeId="2" ParentId="11264" CreationDate="2017-01-14T20:34:26.923" Score="17" Body="&lt;p&gt;In Pandas 0.19.2++:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def Bolinger_Bands(stock_price, window_size, num_of_std):&#xA;&#xA;    rolling_mean = stock_price.rolling(window=window_size).mean()&#xA;    rolling_std  = stock_price.rolling(window=window_size).std()&#xA;    upper_band = rolling_mean + (rolling_std*num_of_std)&#xA;    lower_band = rolling_mean - (rolling_std*num_of_std)&#xA;&#xA;    return rolling_mean, upper_band, lower_band&#xA;&#xA;def main():&#xA;&#xA;     price_series = get_data(ticker, dates) # it is a Pandas series...&#xA;&#xA;     rolling_avg_price, upper_band, lower_band = Bolinger_Bands(price_series, 20, 2)&#xA;&#xA;     do_other_processing(rolling_avg_price, upper_band, lower_band)&#xA;     ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="26110" LastEditorUserId="15351" LastEditDate="2017-02-10T18:24:07.857" LastActivityDate="2017-02-10T18:24:07.857" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31906" PostTypeId="1" CreationDate="2017-01-14T21:12:55.813" Score="2" ViewCount="847" Body="&lt;p&gt;I am told that this is a consequence of the Girsanov theorem, yet I do not see how it it is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider some standard model with $dS_i = \mu S_i dt + \sigma S_i dW^P$. Let $Q$ be an equivalent martingale measure. Then, it is claimed that due to the Girsanov theorem, $dS_i = \sigma S_i dW^Q$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the Girsanov theorem only proves this for a particular measure $Q$ which it defines by first introducing a particular variable $L$ defined in terms of another process called the kernel. The $Q$ which is defined through this process may be very different than the $Q$ we have given above, so I don't understand how the Girsanov theorem can be used?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should we not instead prove that given any martingale measure $Q$, then we can always determine a kernel which can be used to define this measure $Q$ using the recipe in the Girsanov theorem, and THEN we can use Girsanov?&lt;/p&gt;&#xA;" OwnerUserId="26111" LastEditorUserId="24222" LastEditDate="2017-01-14T21:37:08.783" LastActivityDate="2017-01-14T21:57:15.730" Title="Why do we have zero drift when switching to a martingale measure?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;probability&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31907" PostTypeId="2" ParentId="31906" CreationDate="2017-01-14T21:57:15.730" Score="2" Body="&lt;p&gt;As you didn't explain your notation: First note that if $S$ denotes the price process of a spot asset (such as a stock), then it is not a martingale under the risk-neutral probability measure $\mathbb{Q}$. Instead, the discounted price process is a martingale under $\mathbb{Q}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Girsanov's theorem is more general than just for finding the risk-neutral probability measure. In case of a Brownian motion, it defines how the drift changes under an equivalent change of measure. It states that when $W^{\mathbb{P}}$ is a $\mathbb{P}$ Brownian motion, then the process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;W^{\mathbb{Q}}_t = W_t^{\mathbb{P}} - \int_0^t \lambda_u \mathrm{d}u&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is a Brownian motion under $\mathbb{Q}$ defined through the Radon-Nikodym derivative process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\left. \frac{\mathrm{d}\mathbb{Q}}{\mathrm{d}\mathbb{P}} \right| \mathfrak{F}_t = \mathcal{E}_t \left( \int_0^\cdot \lambda_u \mathrm{d}W_u^{\mathbb{P}} \right).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I understand your question correctly then you refer to the process $\lambda$ as the &quot;kernel&quot;. I agree with you that Girsanov's theorem does not by itself yield a risk-neutral probability measure but only under an appropriate choice for the process $\lambda$. And yes - when you want to construct a martingale, you often first search for the process $\lambda$ and then invoke Girsanov's theorem to define the corresponding measure change.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2017-01-14T21:57:15.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31911" PostTypeId="1" AcceptedAnswerId="31912" CreationDate="2017-01-15T12:05:18.697" Score="1" ViewCount="136" Body="&lt;p&gt;I've been playing around with ideas (not primarily to make money) about what exactly is going to happen when Czech National Bank will leave the EUR\CZK peg? It's been on for roughly 2.5 yrs as a contra-deflationary measure by depreciating the currency (from 25.5 CZK to 27 CZK for EUR).  &lt;a href=&quot;https://www.ft.com/content/ada9bb75-8428-3a5b-b8ba-9fdf653bba5d&quot; rel=&quot;nofollow noreferrer&quot;&gt;FT write about the current situation in a nutshell&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Surely all participants have been calculating for months  how to trade once the intervention stops. Pretty sure everyone will be speculating on appreciation (roughly levels suggested by Big Mac index or something like that - ideas for indicators?). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But &lt;a href=&quot;https://www.cnb.cz/miranda2/export/sites/www.cnb.cz/en/public/media_service/conferences/speeches/download/benda_holub_20160907_london.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;CNB says(slide 29)&lt;/a&gt; it wont happen since the price level rose accordingly. Yet from market graph there is clear downwards pressure on the rate - so if the market thinks its gonna go down, would it? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is 4 hour graph with pressure on the limit (EUR\CZK se we expect it to go down (CZK appreciating)):&#xA;&lt;a href=&quot;https://i.stack.imgur.com/ICWiA.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ICWiA.png&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or what about going long on put options? But then getting European option, I assume the market would be volatile so cant get the exercise date correctly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So basically I'm after if there is a historical parallel to this? CHF in Dec 2015 was totally unexpected so there was massive fuzz and I dont think anyone has CZK mortgages etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you reckon the market would move big time or not? CNB has history and reputation for being quite straightforward, but surely they wouldn't put in presentation that upheaval is expected as it would definitely result in one.&lt;/p&gt;&#xA;" OwnerUserId="22237" LastActivityDate="2017-01-16T22:52:00.000" Title="Trading a planned drop of FX peg" Tags="&lt;volatility&gt;&lt;fx&gt;&lt;trading&gt;&lt;central-banking&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31912" PostTypeId="2" ParentId="31911" CreationDate="2017-01-15T13:39:56.010" Score="3" Body="&lt;p&gt;The lesson learned from the CHF episode is that the central bank eventually gets nervous about the losses they are likely to incur.   Theoretically any central bank can print its own currency and sell it into the open market without limit, but if the currency eventually appreciates, there will be a massive loss.  The capitulation generally occurs when the currency is trading at the peg in large volumes.   In your example, it is trading at the peg in small volumes, suggesting a more modest appreciation than the CHF if the peg breaks.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fx option market might be able to tell you something about the expected timing of any peg removal.  If one month options are very high vol versus one year options , it could be sooner rather than later.   European options are ok for speculation on this, since you can delta hedge in the fx market if the peg disappears during the term of the option.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-01-15T13:39:56.010" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31914" PostTypeId="2" ParentId="30634" CreationDate="2017-01-15T16:59:16.840" Score="1" Body="&lt;p&gt;yes: from what I can recall, Deutsche use separate curves for IGP-M(NTN-C) vs IPCA(NTN-B). Note also that the &lt;a href=&quot;https://www.bcb.gov.br/pec/wps/ingl/wps214.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;BEIR doesn’t predict future inflation very well&lt;/a&gt;, one of the reasons being that unlike other markets, the indexation lag of Brazilian real bonds is very small (only a half month, the lag for TIPS is 3mths), and that certain points on the inflation swap curve are very very illiquid. Certain tweaks need to be made to the usual inflation swap pricing methodology.&lt;/p&gt;&#xA;" OwnerUserId="15518" LastActivityDate="2017-01-15T16:59:16.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31916" PostTypeId="2" ParentId="31896" CreationDate="2017-01-16T08:23:57.267" Score="0" Body="&lt;p&gt;Actually the best way to answer this question was to use the original Mercurio and Castagna paper which has a proof and explanation for the best way to calculate implied vol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See paper here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.fabiomercurio.it/consistentfxsmile.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.fabiomercurio.it/consistentfxsmile.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26007" LastActivityDate="2017-01-16T08:23:57.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31918" PostTypeId="2" ParentId="31894" CreationDate="2017-01-16T11:44:57.827" Score="11" Body="&lt;p&gt;The indices have different quoting conventions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way that a CDS index is traded is that you pay a fixed amount per year for protection in case of default (100 bps for IG, 500 bps for HY) and therefore the contract does not have a zero present value (as it would have if you paid the par spread, like in a fixed for floating interest rate swap). The amount you pay to enter the contract is the &quot;upfront&quot;. If the fair spread is above the annual coupon, you will need to pay to enter the contract, i.e. the upfront is positive. If the fair spread is below the annual coupon, you will be paid to enter the contract, i.e. the upfront is negative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you see a quote for CDX IG, you are seeing the fair spread being quoted. There is a model used to turn this into an upfront payment (the &lt;a href=&quot;http://www.cdsmodel.com/cdsmodel/&quot; rel=&quot;noreferrer&quot;&gt;ISDA CDS Standard Model&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CDX HY is quoted directly as the upfront (or rather, it is quoted as 100 minus the upfront, since the upfront can be negative, and dealers want to avoid using negative prices).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Very roughly, the relationship between the upfront and the spread is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;{\rm Upfront} = {\rm Tenor} \times ({\rm Spread} - {\rm Coupon})&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;{\rm Spread} = {\rm Coupon} + \frac{\rm Upfront}{\rm Tenor}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So when you see the CDX HY being quoted as 106, that means that the upfront is -6. Converting this to basis points gives -600. The coupon for CDX HY is 500 basis points, and the tenor is 5 years, so the spread is 500 + (-600)/5 = 380 basis points, i.e. buying protection on HY issues is cheap at the moment (relative to the CDS coupon).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Converting the CDX HY quote to a spread gives the expected relationship between the contracts -&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/yEinS.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/yEinS.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="924" LastEditorUserId="924" LastEditDate="2017-01-17T09:49:04.083" LastActivityDate="2017-01-17T09:49:04.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31919" PostTypeId="1" CreationDate="2017-01-16T14:32:01.717" Score="1" ViewCount="88" Body="&lt;p&gt;I want to do empirical research regarding prepayment behaviour on mortgage credits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any public data provided online regarding this topic? I'm especially interessted in mortgage/retail credit data in the European Union or in particular, in Germany.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thy,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;KS&lt;/p&gt;&#xA;" OwnerUserId="24804" LastActivityDate="2017-01-23T13:04:21.400" Title="Prepayment-Data : Open Databases?" Tags="&lt;credit&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31920" PostTypeId="1" CreationDate="2017-01-16T16:04:51.660" Score="5" ViewCount="262" Body="&lt;p&gt;Let $\lambda$ be the market price of risk: $\frac{a - r}{\sigma}$, and define $Y(t) = e^{-\lambda W(t) - (r + \frac{\lambda^2}{2})t}$. Let $V^h(t)$ be the value process of any self-financing portfolio. The market is a standard Black Scholes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is $Y(t)V^h(t)$ a martingale?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Evidently, $Y(t)$ solves the GMB $dY(t) = -rY(t)dt - \lambda Y(t)dW(t)$. Since $h$ is self-financing, we also obtain a differential for that process. Then we can apply the Ito formula using these two differentials, and obtain the differential of their product, yes? For it to be a martingale, the $dt$-term must disappear, yet, it does not disappear in my calculations. So are my calculations wrong, or is my method off?&lt;/p&gt;&#xA;" OwnerUserId="26135" LastEditorUserId="16160" LastEditDate="2017-01-16T20:01:52.877" LastActivityDate="2017-01-18T19:56:57.317" Title="Why is $Y(t)V^h(t)$ a martingale?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;finance&gt;&lt;arbitrage&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31921" PostTypeId="2" ParentId="30464" CreationDate="2017-01-16T17:30:39.780" Score="2" Body="&lt;p&gt;I'd recommend you to use the LSPD database which is more comprehensive. However, I once used similar data to test the profitability factor in the UK markets. See the outline below on how to get and filter the data according to Fama &amp;amp;French.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The data comes from the Worldscope UK database [WSCOPEUK], which starts in 1985.&#xA;I use the Worldscope database instead of all UK stocks [FBRIT] in combination with all the so called ’dead’ stocks [DEADUK] because of the better availability of accounting data in the early years of the sample. At the time of writing the Worldcope UK database consists of 5,359 stocks whereas the a combination of [FBRIT] and [DEADUK] counts 10,329 stocks over the same period. An advantage of the Worldscope database is that it includes dead stocks and therefore is relatively free of survivor-ship bias. Starting with the Worldscope UK&#xA;database I exclude all non-equities, all non-British stocks, companies not traded in London and those companies of which the provided listing is not their main listing. Further, financial companies, those with SIC codes starting with six, are also excluded (Novy-Marx, 2013). Datastream’s total returns index [RI] is used to gather returns, [MV] as proxy for the market value. Book value of equity is total assets [WC02999] minus total liabilities [WC03351]. Gross&#xA;profits are defined as [WC01100] and revenue as [WC01001]. Operating income [WC01250] or EBIT represents the difference between sales and total operating expenses.10 In line with Gregory et al. (2013), I use the monthly return on three month Treasury Bills [UKTBTND] as proxy for the risk-free rate since this data is available from January 1985 whereas monthly return on one month Treasury Bills is only available form March 2000. Datastream’s total return index [RI] becomes stuck on the last traded day in the case a company goes into&#xA;administration, it is not revised to zero. Using [X(RI)*(X(PT)/X(PT] instead of [RI] helps to overcome this obstacle.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this is slightly different from operating income minus interest expense used by Fama and French (2015). They argue that interest expense is a compensation for debt holders since they partly finance the total assets. However, I find that the Worldscope coverage on interest expense [WC01251] for my sample is weak. Hence, I prefer using the straightforward EBIT measure as a proxy for operating income.&lt;/p&gt;&#xA;" OwnerUserId="18070" LastActivityDate="2017-01-16T17:30:39.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31922" PostTypeId="1" AcceptedAnswerId="31923" CreationDate="2017-01-16T19:36:09.850" Score="1" ViewCount="620" Body="&lt;p&gt;What is the rationale of equation 7 in this &lt;a href=&quot;https://poseidon01.ssrn.com/delivery.php?ID=155119021069075114121125117014106011000056041004079034011123127091083117025088011106005026024030117063044088105089076080029030029059043064055126086120064109099102019049020053022123113081101007069127097084010010106102097113008116003013077104123091126008&amp;amp;EXT=pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;paper&lt;/a&gt;? Could you please provide a step-by-step demonstration of this equality?&lt;/p&gt;&#xA;" OwnerUserId="25437" LastActivityDate="2018-11-12T14:20:21.857" Title="Analytical Solution for Heston Model" Tags="&lt;volatility&gt;&lt;heston&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31923" PostTypeId="2" ParentId="31922" CreationDate="2017-01-16T21:37:46.943" Score="4" Body="&lt;p&gt;This equation is unrelated to the Heston model. It is simply the value of a European call under the a constant coefficient geometric Brownian motion, i.e. the Black and Scholes (1973) model. Here $\nu$ is the &lt;em&gt;constant&lt;/em&gt; volatility and $\mu$ is the risk-neutral drift of the asset. For a stock you could for example have $\mu = r - q$ where $r$ is the risk-free interest rate and $q$ is the dividend yield.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You find a derivation of this formula in almost any introductory book on continuous time finance - e.g. Shreve's &quot;Continuous Time Finance II&quot; or Musiela and Rutkowksi's &quot;Martingale Methods in Financial Modelling&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that there is one mistake in the formula: the authors forget to discount the call price. In their notation it should read&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;C_0 = \frac{1}{2} \color{red}{e^{-r \left( T - t_0 \right)}} \left( S_0 e^{\mu \left( T - t_0 \right)} \mathrm{erfc} \left( -\frac{d_+}{\sqrt{2}} \right) - K \mathrm{erfc} \left( -\frac{d_-}{\sqrt{2}}\right) \right),&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;d_\pm = \frac{1}{\sqrt{\nu \left( T - t_0 \right)}} \left( \ln \left( \frac{S_0}{K} \right) + \left( \mu \pm \frac{1}{2} \nu \right) \left( T_0 - t \right) \right)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually you find this formula expressed in terms of the cumulative normal distribution function $\mathcal{N}(x)$ instead of the complementary error function $\mathrm{erfc}(x)$. The connection between the two is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\frac{1}{2} \mathrm{erfc} \left( -\frac{d_\pm}{\sqrt{2}} \right) &amp;amp; = &amp;amp; \frac{1}{2} \left( 1 - \mathrm{erf} \left( -\frac{d_\pm}{\sqrt{2}} \right) \right)\\&#xA;&amp;amp; = &amp;amp; \frac{1}{2} \left( 1 + \mathrm{erf} \left( \frac{d_\pm}{\sqrt{2}} \right) \right)\\&#xA;&amp;amp; = &amp;amp; \mathcal{N} \left( d_\pm \right).&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You then get the more familiar expression&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;C_0 = e^{-r \left( T - t_0 \right)} \left( S_0 e^{\mu \left( T - t_0 \right)} \mathcal{N} \left( d_+ \right) - K \mathcal{N} \left( d_- \right) \right).&#xA;\end{equation}&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-01-16T21:43:17.243" LastActivityDate="2017-01-16T21:43:17.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31925" PostTypeId="1" CreationDate="2017-01-16T22:37:15.630" Score="1" ViewCount="522" Body="&lt;p&gt;I am using a simple &lt;a href=&quot;https://en.wikipedia.org/wiki/Autoregressive_conditional_duration&quot; rel=&quot;nofollow noreferrer&quot;&gt;ACD (autoregressive conditional duration) model&lt;/a&gt; with expoential or Burr distributed residuals and 1 lag, i.e. ACD(1,1).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am modelling durations for transactions data on a 'medium' liquidity market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I obtain a correct fit, but not very good out-of-sample results.&#xA;Does anyone have experience with handling this model on real data? and using it for out-of-sample prediction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am interested by practitioner's ressource: code, tutorial, example, notebooks, etc. or direct feedback.&lt;/p&gt;&#xA;" OwnerUserId="16457" LastActivityDate="2017-01-17T06:59:45.157" Title="Use of ACD to model transaction durations" Tags="&lt;time-series&gt;&lt;market-microstructure&gt;&lt;econometrics&gt;&lt;models&gt;&lt;duration&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31926" PostTypeId="2" ParentId="31911" CreationDate="2017-01-16T22:52:00.000" Score="2" Body="&lt;p&gt;The other thing about the CHF peg was the central bank gave no indication and if I remember rightly in the previous meeting said they'd continue with the peg. Then one day, without notice, there's no central bank bid (of 1,000,000,000) on EBS. (Most bids on EBS are only 1,000,000 so that's an unusual size)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whereas here the CZK central bank is giving notice to expect no bid on EURCZK in mid 2017. So I'd guess there's more chance of a contrarian reaction, but I'd guess a long put is likely to come good in the following weeks.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2017-01-16T22:52:00.000" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31927" PostTypeId="1" CreationDate="2017-01-16T22:54:01.843" Score="1" ViewCount="168" Body="&lt;p&gt;First of all, I apologise if similar questions have already been asked; I've googled around but most similar questions aren't focused on developing specifically quant-friendly programming skills.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm a final year undergrad (physics) in the UK.  As I enjoy programming, I've decided to apply to Master's courses in CS or Machine Learning/Data Science and I'm thinking about quant-like roles after that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, while I basically know how to program, I'm not sure what sort of things I should try or projects I should get involved with to help prepare me for this line of work, or any job which involves a mixture of math and coding. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've used Python to solve the first 50 Project Euler problems, and I recently completed Andrew Ng's online Machine Learning course. A few years ago I took a course which culminated in using Java to simulating the major bodies of the Solar System. This semester I'm taking a course in numerical computing that involves things like DFT's, numerical integration and Monte Carlo simulations. I'm able to use Python if I want for this, although I'm tempted to try using C++ (even if it means I get a lower grade).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What do you guys suggest I do beyond this?&lt;/p&gt;&#xA;" OwnerUserId="26140" LastActivityDate="2017-01-16T23:26:35.890" Title="How should I develop my coding ability in order to set myself up for a quant role?" Tags="&lt;python&gt;&lt;numerical-methods&gt;&lt;quants&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2017-01-17T08:34:46.247" ContentLicense="CC BY-SA 3.0" />
  <row Id="31928" PostTypeId="2" ParentId="31927" CreationDate="2017-01-16T23:26:35.890" Score="4" Body="&lt;p&gt;To test your programming skills, try QuantLib. Can you do interest-rate modelling with QuantLib? Can you debug the 10-level C++ template? Do you know how to use day count? Do you know how to use business calendar? Do you know how to link a forward curve with a LIBOR market index? Do you know how to calibrate a model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you could, you have proven yourself a real professional. &lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2017-01-16T23:26:35.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31929" PostTypeId="1" CreationDate="2017-01-17T02:23:20.137" Score="0" ViewCount="129" Body="&lt;p&gt;$(x_1, x_2, x_3)$~$N(0, \Sigma(\sigma_{ij}))$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then how to calculate&#xA;$$E[x_2| x_1\leq a, x_3\leq b]$$  &lt;/p&gt;&#xA;" OwnerUserId="25797" LastEditorUserId="25797" LastEditDate="2017-01-17T03:20:11.070" LastActivityDate="2017-02-16T16:51:40.087" Title="How to compute conditional expectation of multivariate normal" Tags="&lt;normal-distribution&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31930" PostTypeId="2" ParentId="31929" CreationDate="2017-01-17T05:20:49.470" Score="1" Body="&lt;p&gt;Your expectation is given by&#xA;$$&#xA;\begin{align*}&#xA;E[x_2 \:|\: x_1 \leq a, x_3 \leq b] &amp;amp;= \int_{-\infty}^\infty x_2 f(x_2 \:|\: x_1 \leq a, x_3 \leq b) \:dx_2&#xA;\end{align*}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To solve this problem you first need the pdf of $x_2 \:|\: x_1 \leq a, x_3 \leq b$. This is given by&#xA;$$&#xA;f(x_2 \:|\: x_1 \leq a, x_3 \leq b) = \frac{\int_{-\infty}^a\int_{-\infty}^bf_x(x_1,x_2,x_3) \:dx_3dx_1}{P[x_1 \leq a, x_3 \leq b]}&#xA;$$&#xA;where&#xA;$$&#xA;P[x_1 \leq a, x_3 \leq b] = \int_{-\infty}^a\int_{-\infty}^\infty\int_{-\infty}^bf_x(x_1,x_2,x_3)\:dx_3dx_2dx_1&#xA;$$&#xA;and the joint probability distribution $f_x$ is given by&#xA;$$&#xA;f_x(x_1,x_2,x_3) = \frac{\mathrm{exp}\left(-\frac{1}{2}x^T\Sigma^{-1}x\right)}{\sqrt{(2\pi)^3|\Sigma|}}&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="5617" LastActivityDate="2017-01-17T05:20:49.470" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31931" PostTypeId="2" ParentId="31925" CreationDate="2017-01-17T06:59:45.157" Score="1" Body="&lt;p&gt;I have tested several Multiplicative Errors Models, including the standard ACD model. I used these models to forecast the bid ask spread ( non-negative data) and I obtain interesting results. As a main information I have found that the choice of the error term distribution is pivotal with the Burr distribution being by far the best  (tested: Exp, Weibull, Generalized Gamma). Also I have found that long memory models (FIACD by Jasiak (1998), LMACD by Karanasos (2003)) have better out-of-sample density forecast accuracy  than other MEM models. So I recommend you to test these latter models. Finally I have compared those models with ARMA ones and found that MEM models should be preferable for tails forecasts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I plan to release freely the code (in &lt;a href=&quot;https://en.wikipedia.org/wiki/Ox_(programming_language)&quot; rel=&quot;nofollow noreferrer&quot;&gt;Ox&lt;/a&gt;) that I made to estimate those models, I still need to do a minimal help documentation. I'll edit this answer when I'll do it.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2017-01-17T06:59:45.157" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31932" PostTypeId="2" ParentId="31920" CreationDate="2017-01-17T09:51:21.667" Score="4" Body="&lt;p&gt;Remember that a martingale is always defined with respect to some &lt;strong&gt;probability measure&lt;/strong&gt;. Your confusion comes from the fact that you are not keeping track of the measures that are introduced.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;$\lambda = \frac{a-r}{\sigma}$ indeed reflects some &lt;em&gt;market price of risk&lt;/em&gt;, in the sense that, for the following diffusion model under the physical measure $\Bbb{P}$&#xA;\begin{align}&#xA;\frac{dS_t}{S_t} &amp;amp;= a dt + \sigma dW_t^\Bbb{P} \\&#xA;                 &amp;amp;= (r + \lambda \sigma) dt + \sigma dW_t^\Bbb{P} &#xA;\end{align}&#xA;$\lambda$ can be seen as a risk-premium (excess return per units of volatility) for the risky asset $S$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose now that we were to define a measure $\Bbb{Q} \sim \Bbb{P}$ such that $S_t \sim GBM(r, \sigma)$ under $\Bbb{Q}$ (hence making the risk-premium disappear). This measure is defined through the following Random-Nikodym derivative:&#xA;$$ \left. \frac{d\Bbb{Q}}{d\Bbb{P}} \right\vert_{\mathcal{F}_t} = \mathcal{E}[-\lambda W_t^\Bbb{P}] = e^{rt} Y_t $$&#xA;with your &#xA;$$ &#xA;Y_t = e^{-\lambda W_t^\Bbb{P}-(r+\frac{1}{2}\lambda^2)t} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed, Girsanov tells us that&#xA;$$ W_t^\Bbb{P} - \langle W^\Bbb{P} , -\lambda W^\Bbb{P} \rangle_t = W_t^\Bbb{P} + \lambda t$$&#xA;is a $\Bbb{Q}$ Brownian motion&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;On the other hand, the fundamental theorem of asset pricing tells you that, in the absence of arbitrage opportunity, the discounted value of any self-financing portfolio should be a martingale under the equivalent measure $\Bbb{Q}$, hence:&#xA;$$ \Bbb{E}^\Bbb{Q}[e^{-rt} V_t^h \mid \mathcal{F}_s] = \Bbb{E}^\Bbb{Q}_s [ e^{-rt} V_t^h ] = e^{-rs} V_s^h $$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;From &lt;strong&gt;Girsanov theorem&lt;/strong&gt; for conditional expectations (sometimes called &lt;strong&gt;abstract Bayes formula&lt;/strong&gt;) we have that, for an $(\mathcal{F}_t,\Bbb{Q})-$measurable process $X_t$&#xA;$$ \Bbb{E}^\Bbb{Q}_s [ X_t ] = \frac{ \Bbb{E}_s^\Bbb{P} \left[ X_t Z_t \right] }{ \Bbb{E}_s^\Bbb{P} [ Z_t ] } $$&#xA;where we have used the shorthand notation&#xA;$$ Z_t = \left. \frac{d\Bbb{Q}}{d\Bbb{P}} \right\vert_{\mathcal{F}_t} $$&#xA;Applying this to $X_t = e^{-rt}V_t^h$ and the equivalent measures $\Bbb{P}$ and $\Bbb{Q}$ defined earlier (hence $Z_t = e^{rt} Y_t = \mathcal{E}[-\lambda W_t^\Bbb{P}]$ a $\Bbb{P}$-martingale) yields:&#xA;$$ \Bbb{E}^\Bbb{Q}_s [ e^{-rt} V_t^h ] = \frac{ \Bbb{E}_s^\Bbb{P} \left[ V_t^h Y_t \right] }{ \Bbb{E}_s^\Bbb{P} [ e^{rt} Y_t ] } $$&#xA;hence isolating the expectation on the RHS and using the fact that $e^{-rt}V_t^h$ is a $\Bbb{Q}$-martingale,&#xA;$$ \Bbb{E}_s^\Bbb{P} \left[ V_t^h Y_t \right] = \underbrace{\left(e^{rs} Y_s\right)}_{Z_t \text{ is a } \Bbb{P}-\text{martingale  }} \underbrace{e^{-rs} V_s^h}_{e^{-rt}V_t^h \text{ is a } \Bbb{Q}-\text{martingale  }} = Y_s V_s^h $$&#xA;and $V_t^h Y_t$ is indeed a $\Bbb{P}$-martingale (but not a $\Bbb{Q}$-martingale).&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Remark]&lt;/strong&gt;&#xA;Of course you should reach the same result with your approach consisting in using the martingale representation theorem (i.e. calculating the differential of the product $Y_t V_t^h$ and making sure that the resulting drift is zero). The thing is that both processes should be expressed under the same measure for it to work, here $\Bbb{P}$. In your post, you actually mix Brownians defined under $\Bbb{P}$ and Brownians defined under $\Bbb{Q}$.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2017-01-17T10:46:18.513" LastActivityDate="2017-01-17T10:46:18.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31933" PostTypeId="2" ParentId="31878" CreationDate="2017-01-17T10:33:09.837" Score="3" Body="&lt;p&gt;cash settled ..XAU/USD is nothing but the spot price of gold quoted in dollars. The main difference between physical forwards and xau would be the end users. Think of big jewelry chains that need to lock in the price to keep their input costs low while the latter would be used by speculators (at the very least). Hence no different from a SnP futures. But the XAU is used by a lot of traders that have views on the USD given the apparent -ve correlation (again, i personally don't believe in correlations given the normalcy assumptions and time frame cherry picks by users)..an interesting article explains some of the above &lt;a href=&quot;https://www.dailyfx.com/forex/education/trading_tips/chart_of_the_day/2013/12/12/What_Does_The_USDOLLAR_Mean_For_Gold.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.dailyfx.com/forex/education/trading_tips/chart_of_the_day/2013/12/12/What_Does_The_USDOLLAR_Mean_For_Gold.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19398" LastActivityDate="2017-01-17T10:33:09.837" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31935" PostTypeId="1" AcceptedAnswerId="31945" CreationDate="2017-01-17T11:56:17.863" Score="0" ViewCount="548" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/r41X6.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/r41X6.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the expression of a basis floating versus floating swap where the first term is a forward CMS Swap leg and the second one is a forward BOR leg where X is the margin that would make equal both leg? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose X and all other parameters are know except the CA term? How can I express the CA term related to the others?&lt;/p&gt;&#xA;" OwnerUserId="24915" LastEditorUserId="24915" LastEditDate="2017-01-18T08:54:41.070" LastActivityDate="2017-01-19T10:57:37.120" Title="Basis swap spread pricing and bootstrapping" Tags="&lt;option-pricing&gt;&lt;swaps&gt;&lt;interest-rate-swap&gt;&lt;convexity&gt;&lt;cms&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31937" PostTypeId="1" AcceptedAnswerId="31951" CreationDate="2017-01-17T20:57:10.863" Score="10" ViewCount="298" Body="&lt;p&gt;have been asked to look at some financial timeseries for potential suspicious activity. These are stocks (my background fixed income hybrids trading and not forensic analyst...) and most of the conclusions will be drawn from granular trade level data (spoofing etc). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, there exist general quantitative / statistical approaches to detection of patterns of activity and informational asymmetry and am wondering if anyone can give me some references (regulatory or otherwise). I found this general survey but would like pointers on journals / books / papers to consult if possible: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;www.consob.it/documenti/quaderni/qdf54en.pdf&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(also I think Algorithmic Trading by Cartea et al has some paragraphs on infomational asymmetry, which will explore).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There must be a substantial body of research on this, am hoping some might be public domain, can anyone help?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's some interesting pattern recognition work if interested:&#xA;&lt;a href=&quot;https://webdocs.cs.ualberta.ca/~zaiane/postscript/DSAA2014.pdf&quot; rel=&quot;noreferrer&quot;&gt;https://webdocs.cs.ualberta.ca/~zaiane/postscript/DSAA2014.pdf&lt;/a&gt;;&#xA;&lt;a href=&quot;http://www.ijtef.org/vol7/503-FR00023.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.ijtef.org/vol7/503-FR00023.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19239" LastEditorUserId="12" LastEditDate="2017-02-17T17:10:37.437" LastActivityDate="2017-02-17T17:10:37.437" Title="Reference request: Quantitative approaches to market abuse detection" Tags="&lt;time-series&gt;&lt;market-microstructure&gt;&lt;neural-networks&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31939" PostTypeId="2" ParentId="18346" CreationDate="2017-01-17T22:11:30.910" Score="0" Body="&lt;p&gt;If moneymarket rate is always 0, then the bond is also priced at 1 by no arbitrage. However, if you have to go through all the measure change exercise...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To price the zero-bond as a derivative:&#xA;Let B(t,S) be the price of the bond as a function of S. We know that $B(T, S_T) =1$. To price any derivative we will use martingale pricing:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{B(t_0)}{N(t_0)} = E^Q \frac{B(T)}{N(T)}$ where N(t) is our numeraire. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We will take the moneymarket account to be our numeraire. Note that since the riskfree rate is always zero in this example we have $dN = 0 dt = 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The dynamics of the discounted stock are given by:&#xA;$d\frac{S}{N} = \frac{1}{N}dS - \frac{S}{N^2}dN = \frac{dS}{N} = dS$, since N(t) =1 for all t.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We change the measure from P to Q in order to make $d\frac{S}{N}$ a martingale. In this case it is equivalent to making $dS$ a martingale. We apply girsanov and endup with $dS = dW^Q$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$B(t_0) = E^Q(B(T)) = \int 1 dW^Q = 1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(chapter 11 of Bjorks book is good reference for girsanov).&lt;/p&gt;&#xA;" OwnerUserId="17316" LastEditorUserId="20454" LastEditDate="2017-11-14T22:16:52.723" LastActivityDate="2017-11-14T22:16:52.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31941" PostTypeId="1" CreationDate="2017-01-17T23:42:27.020" Score="2" ViewCount="156" Body="&lt;p&gt;Assuming we know the local volatility function σ(S,t) for all S and t, how can we recover the corresponding implied volatility for a given strike K (and the other necessary parameters, S, r, T, t...)? What is the formal mathematical way to express the dependency σimplied(K) to the σ(S,t)s?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you also recommend documents where I can find numerical methodology?&lt;/p&gt;&#xA;" OwnerUserId="25460" LastActivityDate="2017-01-17T23:42:27.020" Title="from local volatility function to implied volatility for a given strike" Tags="&lt;implied-volatility&gt;&lt;local-volatility&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31943" PostTypeId="1" CreationDate="2017-01-18T05:04:19.690" Score="1" ViewCount="150" Body="&lt;p&gt;why does index futures swing (in absolute) more than index, when index futures price is lower than index (Backwardation)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say, SET50 Index(Thailand) is at 950, SET50 active Futures will be at around 945 (1 month to expiration). If SET50 moves 10 points, SET50 active Futures will, on average, move more than 10 points.(by comparing (Daily and intra-day standard deviation of $\Delta S$ and $\Delta F$) &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What is an explanation?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Given that $F=Se^{(r-q)(T-t)}$ and $\Delta _F=e^{(r-q)(T-t)}$ and minimum variance hedge ratio($h^*$) = $\rho \frac {\Delta S}{\Delta F}$,&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;Is there any relationship between $\Delta _F$ and $h^*$?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;======================================================&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Other related questions&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I want to hedge SET50 with SET50 Futures (that swing more than index) and minimise basis risk, what Delta should I use if&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;I want to hedge until futures expiration&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I want to close out hedge position before expiration (say, 5 days) and futures prices are mostly traded fair &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I want to close out hedge position before expiration (say, 5 days) and futures prices are always traded cheap but expected to be converged to fair at 5 day before expiration&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="13991" LastEditorUserId="13991" LastEditDate="2017-01-18T05:24:26.923" LastActivityDate="2017-01-18T10:43:48.047" Title="why does index futures swing more than index?" Tags="&lt;futures&gt;&lt;hedging&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31944" PostTypeId="1" CreationDate="2017-01-18T05:07:57.477" Score="0" ViewCount="164" Body="&lt;p&gt;If I had a portfolio with one stock with an initial value of 100 and the next day the stock gained 5 and I added 50 too, would I adjust the log return this way: ln [(155-50)/100]?&lt;/p&gt;&#xA;" OwnerUserId="26151" LastActivityDate="2017-01-18T09:06:16.257" Title="Adjusting a daily log return for a cash inflow/outflow" Tags="&lt;portfolio-management&gt;&lt;returns&gt;&lt;log-returns&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2017-01-18T19:48:58.120" ContentLicense="CC BY-SA 3.0" />
  <row Id="31945" PostTypeId="2" ParentId="31935" CreationDate="2017-01-18T09:01:08.900" Score="1" Body="&lt;p&gt;As far as I can tell, not being an expert in basis swap pricing, this is just algebra -&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;X_{n,c} = \frac{\sum_{i=1}^n \left( S_{i,c}'(0) + {\rm\bf CA}(S_{i,c}'; \delta)\right) P(0,T_i')}{\sum_{i=1}^n P(0,T_i')} - \frac{1 - P(0,T_n')}{\delta \sum_{i=1}^n P(0,T_i')}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which rearranges to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\sum_{i=1}^n {\rm\bf CA}(S_{i,c}'; \delta) P(0,T_i')  =  - \sum_{i=1}^n S_{i,c}'(0)P(0,T_i') + \frac{1 - P(0,T_n')}{\delta} + X_{n,c} \sum_{i=1}^n P(0,T_i')&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can't reduce it any further, since there are multiple &lt;strong&gt;CA&lt;/strong&gt; terms (one for each $i$) not just one.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;As pointed out in the comments, you can &lt;em&gt;bootstrap&lt;/em&gt; the curve if you have $X_{n,c}$ for multiple $n$. For example, for $n = 1$ you can derive&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;{\rm\bf CA}(S_{1,c}'; \delta) =  - S_{1,c}'(0) + \frac{1 - P(0,T_1')}{\delta} + X_{1,c}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For any other $n$, assuming that you have already computed ${\rm\bf CA}(S_{k,c}';\delta)$ for $k=1,\dots,n-1$ then then you have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;{\rm\bf CA}(S_{n,c}';\delta)  = \frac{ - \sum_{i=1}^n S_{i,c}'(0)P(0,T_i') + \frac{1 - P(0,T_n')}{\delta} + X_{n,c} \sum_{i=1}^n P(0,T_i') - \sum_{i=1}^{n-1} {\rm\bf CA}(S_{i,c}'; \delta) P(0,T_i') }{P(0,T_n') }&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which allows you to compute all values of ${\rm\bf CA}(S_{n,c}';\delta)$ iteratively.&lt;/p&gt;&#xA;" OwnerUserId="924" LastEditorUserId="924" LastEditDate="2017-01-19T10:57:37.120" LastActivityDate="2017-01-19T10:57:37.120" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31946" PostTypeId="2" ParentId="31944" CreationDate="2017-01-18T09:06:16.257" Score="1" Body="&lt;p&gt;Yes, the log return on your portfolio is the log percentage chance in the value of your portfolio, including the value of all assets and cash.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you initially have an asset valued at 100 and no cash, and then next day you have an asset valued at 105 and 50 cash, then the log return is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;R = \ln \left( \frac{105 + 50}{100} \right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typically you would want the 50 in cash to be a cashflow derived from the asset (e.g. a dividend or a bond coupon) for this to make sense. If you have an account that holds stock and cash, and you are just paying an extra 50 into the account, it doesn't make much sense to consider that as part of the return.&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2017-01-18T09:06:16.257" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31947" PostTypeId="2" ParentId="31943" CreationDate="2017-01-18T10:43:48.047" Score="5" Body="&lt;p&gt;The empirical relationship between the futures price $F$ and the spot price $S$ is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;F = S e^{b\tau}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\tau$ is the time to expiry, and $b$ is the empirical basis, i.e. the number that makes the equation hold, given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;b = \frac{1}{\tau}\log(F/S)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can be compared to the theoretical basis,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;b_{\rm theor}  = r - q&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $r$ is the funding rate and $q$ is the expected dividend rate to expiry, but in general you will have $b\neq b_{\rm theor}$ (due to transaction costs, regulation, taxes and other limits to arbitrage). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The percentage futures return can be expressed as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{\delta F}{F} \approx \frac{\delta S}{S} + \tau \cdot \delta b + b \cdot \delta\tau&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or, with $r_f=\delta F/F$ and $r_s = \delta S/S$, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;r_f\approx r_s+ \tau \cdot \delta b + b \cdot \delta\tau&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The futures delta is, as you said,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\Delta_F = e^{b\tau}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is, in general, less than one if the futures are in backwardation (i.e. $b &amp;lt; 0$) which is true about 75% of the time for SET50 futures. However, as you correctly point out, when the spot moves by 10 points, the futures tend to move by &lt;em&gt;more&lt;/em&gt; than 10 points, not less (a rough calculation suggests that the futures move by around 10.5 points for every 10 point move in the underlier).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to hedge the futures by holding an offsetting amount of the spot, one option is to hold $\Delta_F$ of the spot. Alternatively you can take into account the comovement of the futures and the spot, and compute the hedge ratio $\beta$ to minimize the square of $r_f - \beta \cdot r_s$ (note that here we are talking in percentage terms, rather than absolute terms - to convert the hedge ratio back to absolute terms, you should multiply by $\Delta_F$, i.e. you would hold $\beta\cdot\Delta_F$ of the spot for each unit of the futures).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align}&#xA;\beta &amp;amp; = \frac{{\rm Cov}(r_f,r_s)}{{\rm Var}(r_s)} \\&#xA;      &amp;amp; \approx \frac{{\rm Var}(r_s) + \tau \cdot {\rm Cov}(r_s, \delta b)}{{\rm Var}(r_s)} \\&#xA;      &amp;amp; = 1 + \tau \frac{{\rm Cov}(r_s, \delta b)}{{\rm Var}(r_s)} \\&#xA;      &amp;amp; = 1 + \tau \cdot \rho_{b,s} \frac{\sigma_b}{\sigma_s}&#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\rho_{b,s}$ is the correlation between changes in the empirical basis and changes in the spot, and $\sigma_b$, $\sigma_s$ are the volatilities of the basis and the spot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This tells us that the hedge ratio will be greater than one if changes in the spot are positively correlated with changes in the empirical basis, and less than one if changes in the spot are negatively correlated with changes in the empirical basis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I measure a daily correlation of around 0.05 between changes in the spot and changes in the basis, indicating that you should over-hedge the futures with the spot, as opposed to a hedge ratio of 1 that you would use if you didn't take spot/basis correlation into account.&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2017-01-18T10:43:48.047" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31948" PostTypeId="2" ParentId="31499" CreationDate="2017-01-18T13:14:17.330" Score="2" Body="&lt;p&gt;The goal of this exercise is to replicate the payoff of the Secured Barrier Call by a linear combination of the known products: European up-out call (cost 12), digital strike 33 (cost 0.73) and digital strike 50 (cost 0.7).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looks to me it is sufficient to buy:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;1x up-out call&lt;/li&gt;&#xA;&lt;li&gt;50 x digital strike 50&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The payout at expiry of this linear combination would be:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$(S(31) - 33)^+$ if S(t) &amp;lt;50 for all t &amp;lt;= 31&lt;/li&gt;&#xA;&lt;li&gt;50 if S(t) touched 50 at any time&lt;/li&gt;&#xA;&lt;li&gt;0 otherwise&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2017-01-18T13:14:17.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31949" PostTypeId="1" CreationDate="2017-01-18T13:31:26.197" Score="1" ViewCount="66" Body="&lt;p&gt;Under a Black-Scholes model.&#xA;I have to find the risk free rate interest to within $0.5\%$ p.a. for a european call option on a stock with : $T=1$ year $K=6$, $S_0=5.50$, $\sigma=20\%$.&#xA;The book says the option is prices at $60p$ (does it means Option$=S_0*0.60$ ?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answer is $14.5\%$, but i don't understand how to get it since we do not have all the elements for interpolating $\mathcal N(d)$ ?&lt;/p&gt;&#xA;" OwnerUserId="18829" LastEditorUserId="18829" LastEditDate="2017-01-18T13:37:49.507" LastActivityDate="2017-01-18T23:49:07.650" Title="simple question on rate finding under B&amp;S" Tags="&lt;black-scholes&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31950" PostTypeId="1" AcceptedAnswerId="32245" CreationDate="2017-01-18T14:25:37.777" Score="0" ViewCount="4583" Body="&lt;p&gt;Suppose that a stock price $S$ follows Geometric Brownian Motion with expected return $\mu$ and volatility $\sigma:$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dS = \mu S dt +\sigma S dz$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to find out the process followed by variable $S^n$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to prove that $S^n$ also follows geometric brownian motion?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The expected value of $S_T,$ the stock price at time $T,$.is $Se^{\mu(T-t)}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the expected value of $S^n_T$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Answer:-&#xA; The expected value of $S^n_T$ is $S(t)^n e^{[n(r-\delta)+\frac12 n^2\sigma^2]T}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But i found tha answer in some study material on internet as $S(t)^n e^{[n(r-\delta)+\frac12 n(n-1)\sigma^2]T}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would anyone explain me why the difference occurred between my answer and answer provided by study material on internet? r is risk-free interest rate.$\delta$ is dividend yield on the stock. $S(t)=e^{Y(t)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a geometric Brownian motion ${S_t}$, the expected value of the process at time t given the history of the process up to time s, for $s &amp;lt; t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E[S{(t)}|S{(u)}, 0\leq u \leq s]=S(s)E[e^{Y(t)-Y(s)]}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the mgf of a normal random variable $W$ is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E[e^{nW}]=\exp[nE(W)+n^2 Var(W)/2]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, since $S(t)-S(s)$ is normal with mean $(r-\delta)(t-s)$ and variance $\sigma^2 (t-s)$ it follows that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E[e^{S(t)-S(s)}]=e^{n(r-\delta)+\frac12(t-s)n^2\sigma^2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus we will get final answer to expected value of $S^n_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E[S(t)|S(u),0\leq u \leq s]= E[e^{Y(t)}|Y(u),0\leq u \leq s]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$L.H.S=E[e^{Y(s)+Y(t)-Y(s)}|Y(u),0\leq u\leq s]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$L.H.S.=e^{Y(s)}E[e^{Y(t)-Y(s)}|Y(u),0\leq u\leq s]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$L.H.S.=S(s)E[e^{Y(t)-Y(s)}]$&lt;/p&gt;&#xA;" OwnerUserId="15605" LastEditorUserId="15605" LastEditDate="2017-01-26T15:35:08.467" LastActivityDate="2017-02-04T14:08:24.307" Title="Given $S$ is a Geometric Brownian Motion, how to show that $S^n$ is also a Geometric Brownian Motion?" Tags="&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="19" ContentLicense="CC BY-SA 3.0" />
  <row Id="31951" PostTypeId="2" ParentId="31937" CreationDate="2017-01-18T14:30:37.693" Score="6" Body="&lt;p&gt;I can't help as much with public literature, but I did see a talk with a member of the FINRA data science team responsible for exactly this (event link below - perhaps you can track down the speaker).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know the structure of your data, but the approach FINRA took was to develop trader-level attributes (not stock level) to create profiles for each trader (I.e. Number of trades, volume, etc.) and applied unsupervised clustering algorithms to the traders. Once they did so, they determined which neighborhood clusters seemed okay and which were large outliers / potentially malicious. You didn't mention if your data set had trader id's, but this would likely be my approach and FINRA seemed to have success.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this helps and good luck!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://d1ryye6yw47pmy.cloudfront.net/images/3651/2016_Trading_Event.pdf?1463507984&quot;&gt;http://d1ryye6yw47pmy.cloudfront.net/images/3651/2016_Trading_Event.pdf?1463507984&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26157" LastActivityDate="2017-01-18T14:30:37.693" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31952" PostTypeId="2" ParentId="31920" CreationDate="2017-01-18T14:34:07.253" Score="1" Body="&lt;p&gt;Alternative to @Quantuple's answer, we can also proceed as follows. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We assume that, under the assumed probability measure (e.g., the real world measure), the underlying stock process $\{S_t, t \ge 0\}$ satisfy an SDE of the form&#xA;\begin{align*}&#xA;dS_t = S_t (adt + \sigma dW_t),&#xA;\end{align*} &#xA;where $\{W_t, t\ge 0\}$ is a standard Brownian motion. Moreover, let $B_t=e^{rt}$ be the money-market account value at time $t$. We assume that the value process $\{V_t^h, t \ge 0\}$ of the self-financing portfolio is of the form&#xA;\begin{align*}&#xA;V_t^h = \alpha_t B_t + \beta_t S_t,&#xA;\end{align*}&#xA;where $\alpha_t$ and $\beta_t$ are units of the money-market account and the underlying stock. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that, &#xA;\begin{align*}&#xA;dV_t^h &amp;amp;= \alpha_t dB_t + \beta_t dS_t\\&#xA;&amp;amp;=r\alpha_t B_t dt + a\beta_t S_tdt + \sigma \beta_t S_t dW_t.&#xA;\end{align*}&#xA;From the assumption,&#xA;\begin{align*}&#xA;dY_t = -rY_tdt - \lambda Y_t dW_t.&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;&amp;amp;\ d\left(Y_tV_t^h\right) \\&#xA;=&amp;amp;\ Y_t dV_t^h +  V_t^h dY_t + d\langle Y, V^h\rangle_t\\&#xA;=&amp;amp;\ Y_t\left( r\alpha_t B_t dt + a\beta_t S_tdt + \sigma \beta_t S_t dW_t\right)+V_t^h\left( -rY_tdt - \lambda Y_t dW_t \right) -\lambda \sigma\beta_tY_t S_t dt\\&#xA;=&amp;amp;\ Y_t\left[\left(r\alpha_t B_t+a\beta_t S_t-rV_t^h- \lambda \sigma\beta_tS_t\right)dt + \left(\sigma \beta_t S_t -\lambda V_t^h \right)dW_t \right]\\&#xA;=&amp;amp;\ Y_t\left[\left(r\alpha_t B_t+r\beta_t S_t-rV_t^h\right)dt + \left(\sigma \beta_t S_t -\lambda V_t^h \right)dW_t \right]\\&#xA;=&amp;amp;\ Y_t\left(\sigma \beta_t S_t -\lambda V_t^h \right)dW_t.&#xA;\end{align*}&#xA;That is, $\{Y_tV_t^h, t \ge0\}$ is a martingale.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-01-18T19:56:57.317" LastActivityDate="2017-01-18T19:56:57.317" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31953" PostTypeId="1" CreationDate="2017-01-18T15:08:38.160" Score="1" ViewCount="451" Body="&lt;p&gt;Consider the following setup:&#xA;Let $S=\left(S_1,\ldots,S_n\right)$ be a $n$-dimensional price process and denote by $V$ its value process defined by $V_t=\phi_t\dot\ S_t$ for $t=0,\ldots,T$.&#xA;In &quot;Stochastic Finance&quot; by Föllmer and Schweizer, we have the following definition for arbitrage in chapter 5:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Definition: A self-financing trading strategy $\phi$ is called an arbitrage opportunity if its value process V satisfies&#xA;  $V_0\leq 0$ a.s., $V_T\geq 0$ a.s. and $P(V_T&amp;gt;0)&amp;gt;0$. If there is no arbitrage opportunity, then the financial market is said to satisfy NA. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In the book &quot;The mathematics of arbitrage&quot; by Schachermayer and Delbaen, we have the following definition of arbitrage in chapter 2:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Definition: The set $K=\{(\phi\dot\ S)_T|\phi\in\mathcal{H}\}$, where $\mathcal{H}$ is the set of trading strategies. Define $C=\{g\in L^\infty(\Omega,\mathcal{F},P)|\exists f\in K\ f\geq g \}$ as the set of contingent claims super-replicable at time T. A financial market satisfy the (NA) (no arbitrage), if $$C\cap L^\infty_{\geq 0}=\{0\}$$  &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Is it possible to prove the equivalence of these definitions?&lt;/p&gt;&#xA;" OwnerUserId="24797" LastEditorUserId="24797" LastEditDate="2017-01-18T17:18:03.633" LastActivityDate="2017-01-18T17:18:03.633" Title="Different definitions of arbitrage" Tags="&lt;stochastic-calculus&gt;&lt;arbitrage&gt;&lt;finance-mathematics&gt;" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="31954" PostTypeId="1" CreationDate="2017-01-18T19:45:02.390" Score="2" ViewCount="236" Body="&lt;p&gt;I got a problem when calculating the out-of-sample performance of my model. &#xA;I have the following settings:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;I have daily data.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I use a rolling window of 1 week.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I use the previous six months of data to estimate my model parameters.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thus, the model parameters are estimated every week using the previous 6 month of data. Each time the parameters are estimated the investment control remains fixed for 1 week (I do not rebalance) until the parameters are next updated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: How do I calculate performance/return including transaction cost? When I have estimated the parameters and make a trade to rebalance at day 1, do I then need to &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Calculate the daily return of the portfolio in the 1 week window and sum it to get the return for the week. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Compute the new positions from the new estimated parameters.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Compute the total expected trading cost from step 2).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Subtract the total expected trading cost from the portfolio return calculated in 1.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="26159" LastEditorUserId="24222" LastEditDate="2017-01-18T22:22:18.627" LastActivityDate="2017-08-17T02:47:48.130" Title="Out-of-sample performance" Tags="&lt;trading&gt;&lt;transaction-costs&gt;&lt;performance&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31955" PostTypeId="1" CreationDate="2017-01-18T20:13:48.427" Score="3" ViewCount="104" Body="&lt;p&gt;I keep reading that linear returns aggregate across securities, but I'm having trouble proving it. I suspect there's some mistake in my approach; I'd appreciate some help in seeing it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose we have two securities, $A$ and $B$. They have prices at timestep $t$ of $P_A^t$ and $P_B^t$, respectively. The portfolio has weights $w_A$ and $w_B$, which sum to 1. The price of the portfolio is then &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P_P^t = w_A P_A^t + w_B P_B^t.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We define linear returns via the formula&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R^t = \frac{P^t}{P^{t-1}} - 1.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, the linear returns of the portfolio are&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R_P^t = \frac{P_P^t}{P_P^{t-1}} - 1 = \frac{w_A P_A^t + w_B P_B^t}{w_A P_A^{t-1} + w_B P_B^{t-1}} - 1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see it claimed in &lt;a href=&quot;http://www.portfolioprobe.com/2010/10/04/a-tale-of-two-returns/&quot; rel=&quot;nofollow noreferrer&quot;&gt;various locations&lt;/a&gt; &lt;a href=&quot;https://poseidon01.ssrn.com/delivery.php?ID=237074081092012096086001116016087117052050089038069021127118099117101114098094011105100061021123008121098000026097009087086095011010071043048118000071025127088011089034030071127117006111112020122118087104086106075113082116076080016090065079127117000&amp;amp;EXT=pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;around the internet&lt;/a&gt; that these returns aggregate over securities, which is to say that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R_P^t = w_A R_A^t + w_B R_B^t.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, this formula yields&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ R_P^t = w_A \frac{P_A^t}{P_A^{t-1}} + w_B \frac{P_B^t}{P_B^{t-1}} - 1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which, as far as I can see, is not in general equal to the previous expression for returns. In particular,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ w_A \frac{P_A^t}{P_A^{t-1}} + w_B \frac{P_B^t}{P_B^{t-1}} \neq \frac{w_A P_A^t + w_B P_B^t}{w_A P_A^{t-1} + w_B P_B^{t-1}}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I missing here? I need to be able to use linearity when justifying Markowitz-style optimization.&lt;/p&gt;&#xA;" OwnerUserId="26160" LastActivityDate="2017-01-18T22:52:19.943" Title="Proof that linear returns aggregate across securities" Tags="&lt;returns&gt;&lt;optimization&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31956" PostTypeId="2" ParentId="31429" CreationDate="2017-01-18T21:35:31.360" Score="2" Body="&lt;p&gt;Good list of reviewed data sources from Caltech (includes Tickdata.com mentioned in previous posts).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://quant.caltech.edu/historical-stock-data.html#&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://quant.caltech.edu/historical-stock-data.html#&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26162" LastActivityDate="2017-01-18T21:35:31.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31957" PostTypeId="1" CreationDate="2017-01-18T22:31:24.250" Score="1" ViewCount="405" Body="&lt;p&gt;The market is arbitrage-free iff there exists an equivalent martingale measure for the discounted price process of the stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in a world with a finite amount of possible outcomes $\Omega$ that follow the probability distribution $P$, where we can change $P$ by an equivalent probability measure that is a martingale, there are no arbitrage opportunities. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now this martingale measure is supposed to model a 'fair game/price'. Could someone please shed some light on why a 'fair price' implies there is no arbitrage? What is a 'fair price'?&lt;/p&gt;&#xA;" OwnerUserId="16889" LastActivityDate="2017-01-18T22:31:24.250" Title="Fair price and no arbitrage" Tags="&lt;arbitrage&gt;&lt;asset-pricing&gt;&lt;no-arbitrage-theory&gt;&lt;martingale&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="31958" PostTypeId="2" ParentId="31955" CreationDate="2017-01-18T22:52:19.943" Score="4" Body="&lt;p&gt;I think you are simply confusing percentage weights and number of assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your definition the &lt;strong&gt;initial percentage weight&lt;/strong&gt; of the $m$ assets in the portfolio are given by $w_i^{t - 1}$ and they sum to one, i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\sum_{i = 1}^m w_i^{t - 1} = 1.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now define the &lt;strong&gt;absolute number of assets&lt;/strong&gt; as $n_i$. They are linked to the percentage weights through&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;w_i^{t - 1} = \frac{n_i P_i^{t - 1}}{\sum_{j = 1}^m n_j P_j^{t - 1}}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you don't rebalance your portfolio, the number of assets stays the same in $t - 1$ and $t$. The value of the portfolio at any time $t$ is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;P_P^t = \sum_{i = 1}^m n_i P_i^t.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;R_P^t &amp;amp; = &amp;amp; \frac{P_P^t}{P_P^{t - 1}} - 1\\&#xA;&amp;amp; = &amp;amp; \frac{\sum_{i = 1}^m n_i P_i^t}{\sum_{j = 1}^m n_j P_j^{t - 1}} - 1\\&#xA;&amp;amp; = &amp;amp; \sum_{i = 1}^m \left( \frac{n_i P_i^{t - 1}}{\sum_{j = 1}^m n_j P_j^{t - 1}} \right)\frac{P_i^t}{P_i^{t - 1}} - 1\\&#xA;&amp;amp; = &amp;amp; \sum_{i = 1}^m w_i^{t - 1} \frac{P_i^t}{P_i^{t - 1}} - 1\\&#xA;&amp;amp; = &amp;amp; \sum_{i = 1}^m w_i^{t - 1} R_i^t&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that generally $w_i^t \neq w_i^{t - 1}$.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2017-01-18T22:52:19.943" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31959" PostTypeId="2" ParentId="31954" CreationDate="2017-01-18T22:58:12.410" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Holding period return would be more appropriate. Calculate your one week return by using your ending portfolio NAV. The easiest way to do this would to be to store number of shares in each position and multiply by price after one week to obtain your new NAV. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Yes.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Yes. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;No, subtract it from your ending portfolio NAV. The process is as follows: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Estimate parameters/train model&lt;/li&gt;&#xA;&lt;li&gt;Determine positions through model&lt;/li&gt;&#xA;&lt;li&gt;Calculate trades by netting new portfolio with current portfolio.&lt;/li&gt;&#xA;&lt;li&gt;Determine position sizes in terms of % of pre-trade NAV. Add trading costs as % of pre-trade NAV. The total sum of the pre-trade position sizes will now exceed 100%. Proportionally resize such that the new positions plus trading costs sum to 100%.&lt;/li&gt;&#xA;&lt;li&gt;Execute trades. Recalculate NAV at end of the week and restart. &lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Total period return minus trading costs is obviously $ \cfrac{{NAV}_{end}}{NAV_{start}}-1$. It's easier to keep everything in terms of NAV until you want to calculate a period return, since your trades will be calculated off of NAV.&lt;/p&gt;&#xA;" OwnerUserId="19473" LastActivityDate="2017-01-18T22:58:12.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31960" PostTypeId="2" ParentId="31949" CreationDate="2017-01-18T23:40:31.070" Score="1" Body="&lt;p&gt;Here is the general solution to your problem of finding the implied rate in the Black-Scholes model. It is actually quite similar to finding the implied volatility. First notice that the European plain vanilla rho&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\frac{\partial C_0}{\partial r} = K T e^{-r T} \mathcal{N} \left( d_- \right),&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is strictly positive (except for in edge cases). Next note that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\lim_{r \downarrow -\infty} C_0 = 0, \qquad \lim_{r \uparrow \infty} C_0 = S_0.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, when your initial call price is inbetween the above two bounds, then you can employ a root-search to find the unique solution for the implied interest-rate. Typical approaches are the bisection algorithm or the the Newton-Raphson algorithm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a simply Python script:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import numpy as np&#xA;import scipy.stats as st&#xA;import scipy.optimize as op&#xA;&#xA;def blackScholesCall(maturity, strike, spot, rate, volatility):&#xA;    discount = np.exp(-rate * maturity)&#xA;    forward = spot / discount&#xA;    totalVolatility = volatility * np.sqrt(maturity)&#xA;    dPlus = np.log(forward / strike) / totalVolatility + 0.5 * totalVolatility * totalVolatility&#xA;    dMinus = dPlus - totalVolatility&#xA;    return discount * (forward * st.norm.cdf(dPlus) - strike * st.norm.cdf(dMinus))&#xA;&#xA;solution = op.root(lambda rate: blackScholesCall(1.0, 6.0, 5.5, rate, 0.2) - 0.6, 0.0)&#xA;print &quot;implied rate = %s&quot; % solution.x[0]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It outputs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;implied rate = 0.145974327185&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which is rounded to 14.50% in your case.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-01-18T23:49:07.650" LastActivityDate="2017-01-18T23:49:07.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31961" PostTypeId="2" ParentId="31878" CreationDate="2017-01-19T01:34:45.527" Score="0" Body="&lt;p&gt;Think of it this way: you would like to trade physical gold in the London market, but you are not set up for it, you don't have a warehouse, you don't know the right people, etc. You could ask &quot;a friend&quot; to trade physical gold for you and give you the gains or losses in cash.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Trading XAU/USD is similar, but instead of a friend, you would rely on the foreign exchange department of a bank as the intermediary. One difference is the bank does not do it just for you but for multiple customers, and their gold (and the bank's) is comingled in one account. (You don't get to see and touch &quot;your gold&quot; like you would with physical trading, but if the bank is reputable I would not worry too much about that). For speculative trading (where you don't need delivery) it is simpler and easier, especially if you already have an FX relationship with a bank. You &lt;em&gt;might&lt;/em&gt; be able to get delivery on an  exceptional basis for an extra fee, but if you want delivery you would probably go to the trouble of setting up your own physical gold trading operation.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-01-19T01:34:45.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31962" PostTypeId="1" AcceptedAnswerId="31968" CreationDate="2017-01-19T01:38:44.073" Score="1" ViewCount="395" Body="&lt;p&gt;In Shreve's book, he obtain the PDE of barrier option by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Payment function&#xA;$$V(T) = (S(T) - K)^+\mathbb{II}_{\{S_{\textrm{max}}(T) &amp;gt; B\}}$$&#xA;Then use the risk neutral pricing formula and Markov property of $S(t),$ we have its value&#xA;$$V(t) =  v(t,S(t))$$&#xA;for some function $v(t,x),$ then we can have the PDE of barrier option respect to $v(t,x).$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in lookback option, he regards $S_{\textrm{max}}(t)$ as a new variable $y$ and value function becomes $v(t,x,y),$ although finally $v(t,x,y)$ can be changed into one variable $u(t,z).$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question is, why there is one variable in barrier but two variables in lookback, or they are just equivalent?&lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-01-19T12:49:42.533" Title="PDE of barrier and lookback options" Tags="&lt;exotics&gt;&lt;barrier&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31963" PostTypeId="1" AcceptedAnswerId="31969" CreationDate="2017-01-19T04:51:42.280" Score="1" ViewCount="664" Body="&lt;p&gt;I have developed a trading algorithm, surprisingly simple in nature (I did start off with grand plans of applying Machine Learning to this problem as I am a data scientist by trade). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would place the code here, but I would like to do some appropriate backtesting before throwing it open for peer review. In any case, I am seeing accuracies of &lt;code&gt;predicted_trading_signal&lt;/code&gt; compared with &lt;code&gt;perfect_insight&lt;/code&gt; of $+80\%$ across many of the russell 2000 group, which as a data scientist, and a rational person seems too good to be true. To this end, I would like to know if this is an appropriate test &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is some pseudocode:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# generate trading signal up onto data[i]&#xA;predicted_trading_signal = some_algo(data[:i])&#xA;&#xA;# generate perfect insight signal&#xA;perfect_insight = another_algo(data[i], data[i+1])&#xA;# where data[i+1] is say the next day&#xA;if some_statistical_property_of_data &amp;gt; lambda:&#xA;    if  predicted_trading_signal == perfect_insight:&#xA;        correct+=1&#xA;    else:&#xA;        incorrect+=1&#xA;&#xA;# after running over all windows of interest for a particular stock &#xA;accuracy = 100.0* correct /float(correct + incorrect)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I wish I could be more concrete with the code!&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Is this a valid approach to computing accuracy&lt;/li&gt;&#xA;&lt;li&gt;is conditioning on information up until todays date and using the following days price typical in testing strategies without data leakage (a subtle problem to a naive person such as myself in trading)&lt;/li&gt;&#xA;&lt;li&gt;Is there a better approach?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;My final question (hopefully this is considered part of the bigger question - I hate multiple questions in one post on mathstackexchange)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I determine the profit-loss calculation as&#xA;$$&#xA;P_i = \text{trading_signal}_{i-1}\left(S_{i} - S_{i-1}\right)\cdot C_{i-i}&#xA;$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$C_{i-1}$ is the initial capital invested.&lt;/li&gt;&#xA;&lt;li&gt;$S_i$ stock price&lt;/li&gt;&#xA;&lt;li&gt;$\text{trading_signal}_{i-1}$ is initial trading signal &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="11834" LastActivityDate="2017-01-19T10:18:13.403" Title="Computing the profits for a simple trading strategy (Backtest)" Tags="&lt;quant-trading-strategies&gt;&lt;backtesting&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31964" PostTypeId="1" CreationDate="2017-01-19T05:13:25.250" Score="3" ViewCount="787" Body="&lt;p&gt;I was hoping to consult on the relevance on the relevance of mathematical finance in the asset management business. Traditionally, mathematical finance focuses more on topics related to stochastic process and model under certain assumptions, risk-neutrality for example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;AM seems to prefer another sets of skills concentrated on corporate finance, econometrics (time series, panel, cross section) and recently, machine learning.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the question is, what do you think of the relevance of mathematical finance in asset management?&lt;/p&gt;&#xA;" OwnerUserId="25885" LastEditorUserId="467" LastEditDate="2017-02-07T05:35:53.243" LastActivityDate="2017-02-07T15:55:52.857" Title="Is mathematical finance relevant in asset managament?" Tags="&lt;finance-mathematics&gt;&lt;asset-allocation&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31966" PostTypeId="1" CreationDate="2017-01-19T08:16:09.243" Score="1" ViewCount="630" Body="&lt;p&gt;For my master thesis, I wish to work onto Cointegration and Pair Trading. I was wondering if any of you had some scholar/blog material recommendations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best Regards&lt;/p&gt;&#xA;" OwnerUserId="24805" LastActivityDate="2017-01-19T11:28:19.027" Title="Looking for materials regarding Pair Trading" Tags="&lt;trading&gt;&lt;cointegration&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="3" ClosedDate="2017-01-20T17:31:51.603" ContentLicense="CC BY-SA 3.0" />
  <row Id="31968" PostTypeId="2" ParentId="31962" CreationDate="2017-01-19T09:59:40.393" Score="4" Body="&lt;p&gt;The difference is that the barrier option is weakly path dependent while the lookback option is strongly path dependent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case of a knock-out barrier option, conditional on the option being alive at the pricing time you don't need to carry any additional state variables except for the current asset price. The payoff doesn't directly depend on the level of $S_{\text{max}}(0, T)$ except through the survival indicator. Given the current spot $S(t)$ and conditional on no prior knock-out you can compute the joint density of $\left( S(T), S_{\max}(t, T) \right)$. The information on $S_{\max}(0, t)$ is irrelevant for the payoff in that case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case of a lookback option, the payoff directly depends on $S_{\max}(0, T)$. You thus need to introduce a second state variable and obtain a two-dimensional PDE. It turns out that the dimension of the latter can be reduced in case of a lookback option since the price is homogeneous of degree one in the two state variables $S(t)$ and $S_{\max}(0, t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also Chapter 22 &quot;An Introduction to Exotic and Path-Dependent Derivatives&quot; in Wilmott (2006) &quot;Paul Wilmott on Quantitative Finance&quot;, Wiley.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-01-19T12:49:42.533" LastActivityDate="2017-01-19T12:49:42.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31969" PostTypeId="2" ParentId="31963" CreationDate="2017-01-19T10:18:13.403" Score="2" Body="&lt;p&gt;To begin with, I'm assuming that your trading strategy gives output something of the kind - Buy, Sell, Neutral&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While on a cursory glance, your calculation seems fine, here are a few things that you can look at&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Why does the perfect insight only look at the incremental change? Many trading ideas are path dependent - so re-check if your best suited action would have changed if you added history.&lt;/li&gt;&#xA;&lt;li&gt;The accuracy parameter, as I understand is the percentage of wins in the strategy trades. The more commonly used term for this is &quot;hit ratio&quot;. However, the hit ratio is a misleading number. The hit ratio should always be look at, in conjunction with the &quot;Average Winning Trade / Average Losing Trade&quot; number. Only then can you arrive at the expected values. What can happen is that you have a strategy which has an 80% hit ratio, but your average win/average loss is 0.1, which would mean that overall, the strategy is generating negative returns.&lt;/li&gt;&#xA;&lt;li&gt;I see that you are using a statistical condition on the data - I hope that this accounts for the transaction costs - as in, the trade is called a win only if it is sufficiently higher than the entry price.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As for your query on Profit calculation, you have missed out on the dividing factor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P_i=trading\_signal_{i−1}.\frac{(S_i−S_{i−1})}{S_{i−1}}⋅C_{i−i}$&lt;/p&gt;&#xA;" OwnerUserId="26170" LastActivityDate="2017-01-19T10:18:13.403" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31970" PostTypeId="2" ParentId="31966" CreationDate="2017-01-19T11:28:19.027" Score="6" Body="&lt;p&gt;Here is a literature list from my masters thesis on stat arb.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Lederman, J., (1996). Market Neutral: Long/Short Strategies for Every&#xA;  Market Environment, 2. – 3. lpp.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Gatev, E., Goetzman, W. N., Rouwenhorst, K. G. (1999). Pairs Trading:&#xA;  Performance of a Relative Value Arbitrage Rule, Review of Financial&#xA;  Studies, Oxford University Press for Society for Financial Studies,&#xA;  vol. 19(3), pp 797-827. doi:10.1093/rfs/hhj020&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Vidyamurthy, G., (2004). Pairs Trading: Quantitative Methods and&#xA;  Analysis, 75. – 79. lpp.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Avellaneda, M., Lee, J.-H. (2008). Statistical arbitrage in the US&#xA;  equities market. Quantitative Finance, 10(7): pp 761 - 782.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Chan, E., (2013). Algorithmic Trading: Winning Strategies and Their&#xA;  Rationale, 42. – 78. lpp.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Drakos, S. (2016) Statistical Arbitrage in S&amp;amp;P500. Journal of&#xA;  Mathematical Finance, 6, pp 166-177. dx.doi.org/10.4236/jmf.2016.61016&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Chen, Y., Ren, W., Lu, X., (2015). Machine Learning in Pairs Trading&#xA;  Strategies, 1. – 5. lpp.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Wenbin, Z., Zhen, D., Bindu, P., Milan, D., (2014). A Multi-factor&#xA;  adaptive statistical arbitrage model, 2. – 3. lpp.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Bogomolov, T., (2010). Pairs trading in the land down under. Finance&#xA;  and Corporate Governance Conference. 13. – 14. lpp.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Do, B., Faff, R., (2012). Are pairs trading profits robust to trading&#xA;  costs?. Journal of Financial Research, 35(2): pp 261–287. doi:&#xA;  10.1111/j.1475-6803.2012.01317.x&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Kristoufek, L., Vosvarda, M., (2013). Measuring capital market&#xA;  efficiency: Long-term memory, fractal dimension and approximate&#xA;  entropy. The European Physical Journal B July 2014, pp. 87-162.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Kristoufek, L., Vosvarda, M., (2012). Measuring capital market&#xA;  efficiency: Global and local correlations structure. Physica A:&#xA;  Statistical Mechanics and its Applications. Volume 392, Issue 1, 1&#xA;  January 2013, pp 184–193. doi:10.1016/j.physa.2012.08.00373&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Boehemer, E., Fong, K., Wu, J., (2015). International Evidence on&#xA;  Algorithmic Trading, 7. – 8. lpp.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Hendershott, T., Riordan, R., (2011). High Frequency Trading and Price&#xA;  Discovery. Manuscript, University of California, Berkeley, 6. – 7.&#xA;  lpp.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Lamont, A., Thaler, R., (2003). Anomalies: The Law of One Price in&#xA;  Financial Markets. Journal of Economic Perspectives, 17(4): pp&#xA;  191-202. doi: 10.1257/089533003772034952&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Do, B., Fa, R., Hamza, K. (2006). A new approach to modeling and&#xA;  estimation for pairs trading.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;In Proceedings of 2006 Financial Management Association European&#xA;  Conference. 3. – 4. lpp.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Gatev, E., Goetzmann, W. N., Rouwenhorst, K. G. (2006). Pairs trading:&#xA;  Performance of a relative-value arbitrage rule. Review of Financial&#xA;  Studies, 19(3): pp 797 - 827.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Krauss, C., (2015). Statistical arbitrage pairs trading strategies:&#xA;  Review and outlook, IWQW Discussion Paper Series, No. 09/2015. 5. – 8.&#xA;  lpp.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Engle, R. F., Granger, C. W. J., (1987). Co-Integration and error&#xA;  correction: Representation, estimation, and testing. Econometrica,&#xA;  55(2): pp 251-276.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Do, B., Faff, R., (2010). Does Simple Pairs Trading Still Work?.&#xA;  Financial Analysts Journal, 66(4): pp 83–95. doi:&#xA;  &lt;a href=&quot;http://dx.doi.org/10.2469/faj.v66.n4.1&quot; rel=&quot;noreferrer&quot;&gt;http://dx.doi.org/10.2469/faj.v66.n4.1&lt;/a&gt;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Huck, N. (2015). Pairs trading: does volatility timing matter? Applied&#xA;  Economics, pp 1-18.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Huck, N. and Afawubo, K. (2015). Pairs trading and selection methods:&#xA;  is cointegration superior? Applied Economics, 47(6): pp 599-613.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Johansen, S., (1988). Statistical analysis of cointegration vectors.&#xA;  Journal of Economic Dynamics and Control, 12(2-3): pp 231-254.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Lim, V., Martin, L., (1995). Regression‐based cointegration estimators&#xA;  with applications. Journal of Economic Studies, 22 (1), pp 3 – 22. 74&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Odelson, BJ., Rajamani, MR., Rawlings JB., (2006). A new&#xA;  autocovariance least-squares method for estimating noise covariances.&#xA;  Automatica 42 (2), pp. 303-308.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Rajamani, MR., Rawlings JB., (2009). Estimation of the disturbance&#xA;  structure from data using semidefinite programming and optimal&#xA;  weighting. Automatica 45 (1), pp. 142-148.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Bentz, Y. (2003), Quantitative Equity Investment Management with Time-&#xA;  Varying Factor Sensitivities. Applied Quantitative Methods for Trading&#xA;  and Investment. John Wiley &amp;amp; Sons, Chichester, 213. - 237. lpp.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Bogomolov, T. (2013). Pairs trading based on statistical variability&#xA;  of the spread process. Quantitative Finance, 13(9): pp. 1411 - 1430.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Mudchanatongsuk, S., Primbs, J. A., Wong, W. (2008). Optimal pairs&#xA;  trading: A stochastic control approach. In American Control&#xA;  Conference, 2008, pp 1035 – 1039.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Boguslavsky, M., Boguslavskaya, E. (2004). Arbitrage under power.&#xA;  Risk, 17(6): pp. 69 - 73. &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Chen, H., Chen, S. J., Li, F. (2012). Empirical investigation of an&#xA;  equity pairs trading strategy. 5. - 7. lpp.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Pole, A. (2008). Statistical arbitrage: algorithmic trading insights&#xA;  and techniques. John Wiley &amp;amp; Sons, Hoboken, N.J. 105. - 106. lpp.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Bowen, D. A., Hutchinson, M. C. (2014). Pairs trading in the UK equity&#xA;  market: Risk and return. The European Journal of Finance, 0(0): pp 1 -&#xA;  25.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Frank, N. (2009). Linkages between asset classes during the financial&#xA;  crisis, accounting for market microstructure noise and non-synchronous&#xA;  trading, Economics Series Working Papers 2009-W04, University of&#xA;  Oxford, Department of Economics. 26. – 30. lpp.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Manda K., (2010). Stock Market Volatility during the 2008 Financial&#xA;  Crisis. The Leonard N. Stern School of Business Glucksman Institute&#xA;  for Research in Securities Markets. 13. – 24. lpp.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Sandoval L., Franca I., (2011). Correlation of financial markets in&#xA;  times of crisis. Insper, Instituto de Ensino e Pesquisa. 15. – 17.&#xA;  lpp. 75&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Perlin, M. S. (2009). Evaluation of pairs-trading strategy at the&#xA;  Brazilian financial market. Journal of Derivatives &amp;amp; Hedge Funds,&#xA;  15(2): pp. 122 - 136.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Rudy J., (2011). Four essays in statistical arbitrage in equity&#xA;  markets. Liverpool John Moores University. 15. – 17. Lpp.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Mori, M., Ziobrowski, A. J., (2011). Performance of pairs trading&#xA;  strategy in the U.S. REIT market. Real Estate Economics, 39(3): pp.&#xA;  409 - 428. Puspaningrum, H. (2012). Pairs trading using cointegration&#xA;  approach. University of Wollongong. 31. – 33. lpp.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Lin, Y.-X. McCrae,. M., Gulati, C. (2006). Loss protecetion in pairs&#xA;  trading through minimum profit bounds: A cointegration approach.&#xA;  Journal of Applied Mathematics and Decision Sciences, 2006: pp 1-14.&#xA;  dx.doi.org/10.1155/JAMDS/2006/73803&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Bee M., Gatti G., (2015). An improved pairs trading strategy based on&#xA;  switching regime volatility, DEM Discussion Papers 2015/13. 10. – 14.&#xA;  lpp.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Grima, P., Paulson, A. (1999). Risk arbitrage opportunities in&#xA;  petroleum futures spreads. Journal of Futures markets (19): pp 931-955&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Dolatabadi S., Nielsen, M., Xu K., (2015). A fractionally cointegrated&#xA;  VAR analysis of price discovery in commodity futures markets. Journal&#xA;  of Futures Markets, 35(4): pp. 339 – 356.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Broumandi, S., Reuber, T., (2012). Statistical arbitrage and FX&#xA;  exposure with South American ADRs listed on the NYSE. Financial Assets&#xA;  and Investing, 3(2): pp. 5 - 18.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Hong, G. and Susmel, R. (2003). Pairs-trading in the Asian ADR market.&#xA;  Working paper, University of Houston. 9. – 11. lpp.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Coldeira, J. F., Moura, G. V. (2013). Selection of a portfolio of&#xA;  pairs based on cointegration: A statistical arbitrage strategy.&#xA;  Brazilian Review of Finance, 11(1): pp. 49 - 80.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Dunis, C. L., Giorgioni, G., Laws, J., Rudy, J. (2010). Statistical&#xA;  arbitrage and high-frequency data with an application to Eurostoxx 50&#xA;  equities. Working paper, Liverpool Business School. 12. lpp. 76&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Dunis, C. L., Ho, R. (2005). Cointegration portfolios of European&#xA;  equities for index tracking and market neutral strategies. Journal of&#xA;  Asset Management, 6(1): pp 33 - 52.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Alexander C., Dimitriu A., (2002). The cointegration alpha: enhanced&#xA;  index tracking and long–short market neutral strategies. 10. lpp.&#xA;  Karakas, O. (2009). Mean reversion between different classes of shares&#xA;  in dual-class firms: Evidence and implications. Working paper, London&#xA;  Business School. 10. – 12. lpp.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Morse D., Ushman N., (1983). The Effect of Information Announcements&#xA;  on the Market Microstructure. The Accounting Review 58 (2): pp.&#xA;  247-258.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Park, J., 1995, A market microstructure explanation for predictable&#xA;  variations in stock returns following large price changes, Journal of&#xA;  Financial and Quantitative Analysis (30): pp. 241-256.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Alexander, C. (1999). Optimal hedging using cointegration.&#xA;  Philosophical Transactions: Mathematical, Physical and Engineering&#xA;  Sciences, 357(1758): pp 2039 - 2058.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Bruno C., Caldeira F., Guilherme M., (2014). Is Pairs Trading&#xA;  Performance Sensitive to the Methodologies?: A Comparison. 16. lpp.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Montana, G., Triantafyllopoulos, K., Tsagaris, T. (2009). Flexible&#xA;  least squares for temporal data mining and statistical arbitrage.&#xA;  Expert Systems with Applications, 36(2): pp 2819 - 2830.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Aldridge, I. (2009). High-Frequency Trading: A Practical Guide to&#xA;  Algorithmic Strategies and Trading Systems, 2nd Edition. 131. - 144.&#xA;  lpp&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Kim, K. (2011). Performance analysis of pairs trading strategy&#xA;  utilizing high frequency data with an application to KOSPI 100&#xA;  equities. SSRN Electronic Journal. 6. - 10. lpp&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Bogomolov, T. (2011). Pairs trading in the land down under. In Finance&#xA;  and Corporate Governance Conference. 11. - 12. lpp&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Pastukhov S., (2005). On Some Probabilistic-Statistical Methods in&#xA;  Technical Analysis. Theory of Probability &amp;amp; Its Applications, 49 (2):&#xA;  pp 245–260. 77 Mudchanatongsuk, S., Primbs, J. A., Wong, W. (2008).&#xA;  Optimal pairs trading: A stochastic control approach. In American&#xA;  Control Conference, 2008, pp 1035 - 1039.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Patro K., (2001). Measuring performance of international closed-end&#xA;  funds. Journal of Banking &amp;amp; Finance. 25(9): pp 1741 – 1767.&#xA;  doi:10.1016/S0378-4266(00)00151-5&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Infantino, Leandro R., Itzhaki S., (2010). Developing high-frequency&#xA;  equities trading models. Sloan School of Management. 41. – 52. lpp.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Blokker J., Chamoun E., Jreige I., Georgoudis, P., Galal, S., (2010).&#xA;  Statistical Arbitrage. 5. – 8. lpp.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Platania D., (2015). Valuation of derivative assets under cyclical&#xA;  mean-reversion processes for spot prices. 26. – 30. lpp.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Lund, J., (1999). Model for Studying the Effect of EMU on European&#xA;  Yield Curves. European Finance Review, (2): pp 321 – 363.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Ruiter H., J., (2009). The Performance of a Pairs Trading Strategy in&#xA;  Asian Markets for 2002 to 2009. 16. – 26. lpp&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Fama, E. F. (1965a), Random walks in stock market prices, Financial&#xA;  Analysts Journal, 21(5): pp. 55 – 59.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Chong, T., T.-H. Lam, I. Yan (2011). Is the Chinese stock market&#xA;  really ineficient? China Economic Review 23(1): pp. 122-137.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Lim, K.-P., R. Brooks, J. Kim (2008). Financial crisis and stock&#xA;  market eciency: Empirical evidence from Asian countries. International&#xA;  Review of Financial Analysis 17: pp 571 - 591.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Alexeev, V., Tapon. F., (2011). Testing weak form efficiency on the&#xA;  Toronto Stock Exchange. Journal of Empirical Finance 18: pp. 661 -&#xA;  691.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Barunik, J., T. Aste, T. Di Matteo, Liu R., (2012). Understanding the&#xA;  source of multifractality in financial markets. Physica A 391, pp.&#xA;  4234 - 4251. 78&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Cajueiro, D., B. Tabak (2004a). Evidence of long range dependence in&#xA;  Asian equity markets: the role of liquidity and market restrictions.&#xA;  Physica A 342: pp 656 - 664.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Vandewalle, N., Ausloos M.,, Boveroux P., (1997). Detrended&#xA;  Fluctuation Analysis of the Foreign Exchange Market. 46. – 48. lpp.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Barkoulas, J., Baum C. (1996). Long-term dependence in stock returns.&#xA;  Economics Letters 53, pp. 253 - 259.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Matteo, D., Aste, T., Dacorogna, M.,(2005). Long-term memories of&#xA;  developed and emerging markets: Using the scaling analysis to&#xA;  characterize their stage of development. Journal of Banking &amp;amp; Finance&#xA;  29: pp. 827 - 851.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Gneiting, T., Schlather, M., (2004). Stochastic Models That Separate&#xA;  Fractal Dimension and the Hurst Effect. SIAM Review 46(2):, pp. 269 –&#xA;  282.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Pincus S., M., (1991). Approximate entropy as a measure of system&#xA;  complexity. PNAS 88 (6): pp. 2297–2301, doi: 10.1073/pnas.88.6.2297&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Bhattacharya, Bhattacharya, (2012). Long Memory in Stock Returns: A&#xA;  Study of Emerging Markets. Iranian Journal of Management Studies 5&#xA;  (2): pp 66 – 88.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="17921" LastActivityDate="2017-01-19T11:28:19.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31971" PostTypeId="1" CreationDate="2017-01-19T11:45:31.577" Score="6" ViewCount="1380" Body="&lt;p&gt;My question is regarding the European Commission regulation on standardizing the information in the key information documents for PRIIPs. In the &lt;a href=&quot;http://ec.europa.eu/finance/finservices-retail/docs/investment_products/20160630-delegated_regulation-annex_en.pdf&quot; rel=&quot;noreferrer&quot;&gt;Annex IV&lt;/a&gt; of the regulation, one can find the explanation on the determination of an MRM class for the category 3 products (paras. 16-24)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now my question is regarding calculation of the return of the underlying contract, as explained in para. 22, and specifically the formula in 22c:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Return = E[Return_{risk-neutral}] - E[Return_{measured}] - 0.5\sigma^2N - \rho\sigma\sigma_{ccy}N$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anybody give more details on this formula? I personally do not think I fully understand the first two terms in the formula. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also tried to reproduce the category 3 calculation as given in the &lt;a href=&quot;http://ec.europa.eu/finance/events/2016/0711-workshop-priips-framework/docs/160711-risk-section-kid_en.pdf&quot; rel=&quot;noreferrer&quot;&gt;Commission presentation&lt;/a&gt;, but I miss the point after summing up the simulated daily returns, i.e. step 9. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="26173" LastEditorUserId="26173" LastEditDate="2017-01-19T14:45:06.353" LastActivityDate="2019-09-01T01:01:55.253" Title="Question regarding the Category 3 PRIIP MRM calculation" Tags="&lt;value-at-risk&gt;&lt;banking-regulations&gt;&lt;bootstrap&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="31972" PostTypeId="2" ParentId="27728" CreationDate="2017-01-19T13:03:29.577" Score="1" Body="&lt;p&gt;The market index in the definition of CAPM should be viewed in slightly broader terms, in that, the right choice of the market instrument may not be a physical market/exchange in itself. CAPM basically allows you to differentiate between the systematic risk and the idiosyncratic risk in your portfolio. Hence the systematic risk is best reflected in that index which has the maximum intersection with &lt;em&gt;all&lt;/em&gt; of the constituent stocks&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, since all of them are US IT stocks, the right choice of a market index would be an index that specifically tracks that sector - something like the MSCI US Information Technology Index (MXUS0IT Index on Bloomberg), which would reflect the systematic risk, and then, you can have a more accurate measure of the alpha, and hence the portfolio weights by drawing from CAPM.&lt;/p&gt;&#xA;" OwnerUserId="26170" LastActivityDate="2017-01-19T13:03:29.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31975" PostTypeId="1" CreationDate="2017-01-19T15:06:30.417" Score="0" ViewCount="165" Body="&lt;p&gt;Is the text &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0071456104&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Treasury Bond Basis&lt;/a&gt; by Burghardt still the authoritative source on this topic?  The most recent edition was published in 2005.  I think that, based on the contents and others' referrals, the text will be a very useful introduction, but I also imagine some of the material is out-of-date and some topics currently viewed as important not included.  Is there a more recent recommendable text available to supplement this one or outright replace it?  Or perhaps better yet, a set of supplementary lecture notes for a course where this text was used?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm similarly curious about &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0071418555&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Eurodollar Futures and Options Handbook&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm moving to a liquid rates desk in the near future (quant role), and I need to be up-to-date on these products/markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="26176" LastEditorUserId="26176" LastEditDate="2017-01-19T15:12:39.570" LastActivityDate="2017-01-19T16:24:36.653" Title="Textbook for US Treasury Bond / Notes Futures" Tags="&lt;interest-rates&gt;&lt;futures&gt;&lt;bond-futures&gt;&lt;eurodollars&gt;&lt;treasuries&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31976" PostTypeId="2" ParentId="31975" CreationDate="2017-01-19T16:24:36.653" Score="1" Body="&lt;p&gt;In my opinion, there is no better reference than &lt;em&gt;The Treasury Bond Basis&lt;/em&gt;, which I still read cover-to-cover at least once a year.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the publication of the 2005 edition, the biggest development is the introduction of the WN (ultra-long bond) contract in 2009. The TN (ultra 10-year) contract was introduced in 2016 as well. But the same set of tools and analytical techniques would apply.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As @LazyCat mentioned, &lt;em&gt;Interest Rate Markets&lt;/em&gt; is also a great reference. The discussion on futures calendar spread is particularly good, but Burghardt's &lt;em&gt;Bond Basis&lt;/em&gt; still provides extensive/unrivaled historical context for understanding the evolution of bond basis.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2017-01-19T16:24:36.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31978" PostTypeId="2" ParentId="31919" CreationDate="2017-01-19T19:05:09.990" Score="1" Body="&lt;p&gt;Kosta, this is a hard one. In principle if you had a securitized product made out of mortgage credits, under conditions, you could get a quasi-free solution with Bloomberg as they some times source assumptions. Depending on the pool you could probably generalize that for the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand however that you want historical patterns, my best bet at this stage would be the EMF, European Mortgage Federation. The source data and reports.&lt;/p&gt;&#xA;" OwnerUserId="13462" LastActivityDate="2017-01-19T19:05:09.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31979" PostTypeId="2" ParentId="31415" CreationDate="2017-01-19T19:15:17.933" Score="0" Body="&lt;p&gt;Kosta, that would depend on your level of math or background knowledge already on the subject. I believe that a good starting point would be &lt;a href=&quot;https://www.amazon.co.uk/Investing-Mortgage-Backed-Asset-Backed-Securities-Financial/dp/1118944003/ref=sr_1_5?ie=UTF8&amp;amp;qid=1484853104&amp;amp;sr=8-5&amp;amp;keywords=mortgage%20backed%20securities&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt;. Not heavy on math but it presents the general idea. You can then expand on making the underlying assumptions (default, prepayment arrival) more intricate.&lt;/p&gt;&#xA;" OwnerUserId="13462" LastActivityDate="2017-01-19T19:15:17.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31981" PostTypeId="1" CreationDate="2017-01-20T01:56:55.023" Score="-1" ViewCount="5668" Body="&lt;p&gt;Why is the delta of a short call option negative? In Black-Scholes-Merton equation the delta of a call option is always a probability function therefore it does not imply such a consequence. How do I interpret this fact from a mathematical/quantitative point of view?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: My bad. I thought a long/short call refers to a call with long/short maturity time. Please disregard this question.&lt;/p&gt;&#xA;" OwnerUserId="25086" LastEditorUserId="25086" LastEditDate="2017-01-21T17:26:52.703" LastActivityDate="2017-01-21T17:26:52.703" Title="why is the delta of a short call option negative?" Tags="&lt;delta&gt;&lt;call&gt;" AnswerCount="2" CommentCount="5" ClosedDate="2017-02-07T13:01:01.900" ContentLicense="CC BY-SA 3.0" />
  <row Id="31983" PostTypeId="1" AcceptedAnswerId="32148" CreationDate="2017-01-20T04:46:25.483" Score="2" ViewCount="670" Body="&lt;p&gt;I am trying to get multiple indicator values such as RSI and EMA for equities using the package tidyquant in R.  I tried the example from the vignette which is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;tq_get(&quot;AAPL&quot;, get = &quot;stock.prices&quot;)%&amp;gt;% tq_transform_xy_(x_fun = 'close', transform_fun = 'periodReturn',period = 'weekly') %&amp;gt;% tq_mutate(x_fun = Cl, mutate_fun = RSI, n = 14, period = 'weekly') %&amp;gt;% tq_mutate(x_fun = Cl, mutate_fun = EMA, n = 14, period = 'weekly')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;resulting to an error: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error in match(x, table, nomatch = 0L) : argument &quot;.x&quot; is missing, with no default&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;How do I transform the Closing stock prices to weekly?; and&lt;/li&gt;&#xA;&lt;li&gt;How do I get the RSI and EMA in one tq_mutate line with RSI and EMA column names? (Both result to EMA column names).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="25995" LastEditorUserId="25995" LastEditDate="2017-01-20T05:03:35.870" LastActivityDate="2017-01-29T11:32:35.540" Title="Computing multiple indicators in tidyquant" Tags="&lt;programming&gt;&lt;trading&gt;&lt;indicator&gt;&lt;quantmod&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31986" PostTypeId="2" ParentId="31981" CreationDate="2017-01-20T08:44:39.810" Score="2" Body="&lt;p&gt;The delta of any position, $\Delta_P$,  is the number of units you hold, $N$, multiplied by the delta of each unit, $\Delta$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\Delta_P = N\times \Delta&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are correct that for a call option you have $0\leq \Delta \leq 1$. If you are short a call option, then you have a negative position (that's what being short means) so $N&amp;lt;0$ and therefore $\Delta_P &amp;lt; 0$.&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2017-01-20T08:44:39.810" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31987" PostTypeId="2" ParentId="31983" CreationDate="2017-01-20T09:21:54.737" Score="0" Body="&lt;p&gt;Answer to 1):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(tidyquant)&#xA;tq_get(&quot;AAPL&quot;, get = &quot;stock.prices&quot;)%&amp;gt;%&#xA;  tq_transform_xy_(x = 'close', transform_fun = 'periodReturn',period = 'weekly')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;this gives you &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; A tibble: 525 × 2&#xA;         date weekly.returns&#xA;       &amp;lt;dttm&amp;gt;          &amp;lt;dbl&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Appearantly the vignette is not up to date if you look at the help of &lt;code&gt;tq_transform_xy_&lt;/code&gt; then you see that the argument should be &lt;code&gt;x&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Doing this you get rid of the error. But you get returns. I am not an expert in technical trading but does it makes sense to calculate an EMA on returns? Wouldn't you rather do this on prices?&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2017-01-20T09:35:39.553" LastActivityDate="2017-01-20T09:35:39.553" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31988" PostTypeId="2" ParentId="31981" CreationDate="2017-01-20T12:44:44.050" Score="0" Body="&lt;p&gt;A couple of different ways to look at it&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Delta is the change in price/value of the option per unit change in price of the underlying&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;For a long call option - any +ve change in the price of underlying, regardless of ATM/OTM/ITM, can only increase the value of the option. Hence, the delta of a long call option is always positive&lt;/li&gt;&#xA;&lt;li&gt;A short call position is the mirror/counterparty of the long call position. So if the long increases in value - the short can only decrease in value. Hence the short call position always has a negative delta&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Another way to look at this would be in terms of replicating a stock with options&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Long a Put, and Short a call replicates a Short position in the Stock. Now a short position in the stock has a delta of -1. Long Put has a delta between -1 and 0. Hence the short call needs to have a negative delta&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="26170" LastActivityDate="2017-01-20T12:44:44.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31989" PostTypeId="2" ParentId="31964" CreationDate="2017-01-20T13:06:14.423" Score="1" Body="&lt;p&gt;There are multiple reasons as to why 'traditional' mathematical finance or $P$ topics are not as prevalent in the industry as $Q$ topics.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;A major reason for this is that the latter makes numerous simplifying assumptions, which &lt;em&gt;oversimplify&lt;/em&gt; the models, and detach it from reality &lt;/li&gt;&#xA;&lt;li&gt;Also, most of the latter models do not have closed form solutions&lt;/li&gt;&#xA;&lt;li&gt;$Q$ topics generally leave us with models that require significant computing time - and hence it might be more rewarding to use less accurate but much faster statistical models&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;That said and done, the distinction between the two is a fine line, and more often than not, you'll find one drawing from the other. Also, some of the assumptions that we make, when drawing up $P$ models, are results from $Q$ topics&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1717163&quot; rel=&quot;nofollow noreferrer&quot;&gt;'P' Versus 'Q': Differences and Commonalities between the Two Areas of Quantitative Finance&lt;/a&gt; would be an interesting read!&lt;/p&gt;&#xA;" OwnerUserId="26170" LastActivityDate="2017-01-20T13:06:14.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="31991" PostTypeId="1" CreationDate="2017-01-20T13:32:53.593" Score="1" ViewCount="623" Body="&lt;p&gt;Having trouble with understanding the logic of FVA. Let's assume that as a trader I trade with a client an uncollateralised fx forward. Then, I hedge my position with &quot;risk-free&quot; bank with which I have a signed CSA. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Having EE profile for the trade I calculate FVA and get some value. What is the meaning for this value? The future value of the trade may be much more or less than FVA. How does this value hedge funding risk?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Why should I calculate FVA for the client's portfolio (e.g. incremental FVA)? It seems more logical to calculate FVA for the &quot;risk-free&quot; bank as funding risk comes from CSA agreement.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Any help is highly appreciated. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="26188" LastActivityDate="2017-01-20T13:32:53.593" Title="Funding Valuation Adjustment (FVA) - understanding issues" Tags="&lt;risk-management&gt;&lt;derivatives&gt;&lt;valuation&gt;&lt;cva&gt;" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="31992" PostTypeId="2" ParentId="31937" CreationDate="2017-01-20T15:19:53.070" Score="2" Body="&lt;p&gt;I cannot speak specifically because I have proprietary insight into the issue, but one approach is to compare the timing of trading activity (volume, bids/offers on the book traded and withdrawn) with publicly-announced news.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Think Granger Causality, and which event seems to cause the other.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="19379" LastActivityDate="2017-01-20T15:19:53.070" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31993" PostTypeId="1" CreationDate="2017-01-20T15:28:47.530" Score="1" ViewCount="2134" Body="&lt;p&gt;Under the Black-Scholes model, the delta of a call option is sometimes interpreted as the probability for the option to end in the money.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I assume that the underlying follows a normal distribution (Bachelier model), does the same approximation hold for the Bachelier delta?&lt;/p&gt;&#xA;" OwnerUserId="17104" LastActivityDate="2017-01-21T09:29:53.540" Title="Bachelier option delta = probability of exercise?" Tags="&lt;delta&gt;&lt;normal&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="31995" PostTypeId="1" AcceptedAnswerId="31998" CreationDate="2017-01-20T16:17:49.160" Score="1" ViewCount="1299" Body="&lt;p&gt;I am having some trouble to understand the derivation of the parameters of zero coupon pricing formula using Hull White. Specifically I am trying to understand how to get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://latex.codecogs.com/gif.latex?LogA(t,T)=[tR(0,t)-TR(0,T)]&amp;plus;B(t,T)&amp;space;f%5EM&amp;space;(0,t)-(%5Csigma&amp;space;%5E2&amp;space;(1-&amp;space;exp%5E(-2at)))/4a%5Csigma*B(t,T)%5E2&quot; title=&quot;LogA(t,T)=[tR(0,t)-TR(0,T)]+B(t,T) f^M (0,t)-(\sigma ^2 (1- exp^(-2at)))/4a\sigma*B(t,T)^2&quot; /&gt; --[1]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;img src=&quot;https://latex.codecogs.com/gif.latex?R(t,T)&quot; title=&quot;R(t,T)&quot; /&gt; is the continuously compounded zero spot rate:&#xA;&lt;img src=&quot;https://latex.codecogs.com/gif.latex?R(t,T)=-logA(t,T)/(T-t)&amp;plus;&amp;space;B(t,T)r(t)/(T-t)&quot; title=&quot;R(t,T)=-logA(t,T)/(T-t)+ B(t,T)r(t)/(T-t)&quot; /&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;img src=&quot;https://latex.codecogs.com/gif.latex?f%5EM(0,t)&quot; title=&quot;f^M(0,t)&quot; /&gt; is the initial instantaneous forward rate curve&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand the process to get below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://latex.codecogs.com/gif.latex?-Log(A(t,T))=%5Cint&amp;space;%5Ctheta&amp;space;(u)B(u,T)du&amp;plus;%5Csigma&amp;space;%5E2/2a%5E2*(T-t-B(t,T))-%5Csigma&amp;space;%5E2/4a*B(t,T)%5E2&quot; title=&quot;-Log(A(t,T))=\int \theta (u)B(u,T)du+\sigma ^2/2a^2*(T-t-B(t,T))-\sigma ^2/4a*B(t,T)^2&quot; /&gt;    --[2]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://latex.codecogs.com/gif.latex?%5Ctheta&amp;space;(t)&amp;space;=&amp;space;af%5EM(0,&amp;space;t)&amp;plus;%5Cpartial&amp;space;f%5EM(0,T)%5Cpartial&amp;space;t&amp;plus;%5Csigma&amp;space;%5E2/2a%5E2*(1-e%5E-2at))&quot; title=&quot;\theta (t) = af^M(0, t)+\partial f^M(0,T)\partial t+\sigma ^2/2a^2*(1-e^-2at))&quot; /&gt;          ---[3]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone please help me with deriving [1] from [2] or [3]?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks very much in advance.&lt;/p&gt;&#xA;" OwnerUserId="25808" LastEditorUserId="-1" LastEditDate="2017-03-10T09:42:46.467" LastActivityDate="2017-01-21T15:28:41.897" Title="zero coupon bond pricing formula using Hull White" Tags="&lt;hullwhite&gt;&lt;zero-coupon&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="31997" PostTypeId="2" ParentId="31993" CreationDate="2017-01-20T18:41:03.507" Score="2" Body="&lt;p&gt;First, your statement that the delta of a call option under the Black-Scholes model is equal to the exercise probability is not true. This is a common misconception - see for example: &lt;a href=&quot;https://quant.stackexchange.com/questions/10124&quot;&gt;this question&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now regarding your question. Assume that the forward price $F$ for the maturity $T$ under the risk-neutral measure $\mathbb{Q}$ follows&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathrm{d}F_t = \sigma \mathrm{d}W_t&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for $t \in [0, T]$. Then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;C_0 &amp;amp; = &amp;amp; e^{-r T} \mathbb{E}_{\mathbb{Q}} \left[ \left( F_T - K \right)^+ \right]\\&#xA;&amp;amp; = &amp;amp; e^{-r T} \int_{-d}^\infty \left( F_0 + \sigma \sqrt{T} x - K \right) \phi(x) \mathrm{d}x\\&#xA;&amp;amp; = &amp;amp; e^{-r T} \left\{ \left( F_0 - K \right) \mathcal{N}(d) + \sigma \sqrt{T} \mathcal{N}'(d) \right\},&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;d = \frac{F_0 - K}{\sigma \sqrt{T}}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Carefully differentiating yields&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\frac{\partial C_0}{\partial F_0} &amp;amp; = &amp;amp; e^{-r T} \mathcal{N}(d),&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where we use that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\frac{\partial}{\partial F_0} \sigma \sqrt{T} \mathcal{N}'(d) = -d \mathcal{N}'(d).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The exercise probability is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathbb{Q} \left\{ F_T &amp;gt; K \right\} = \int_{-d}^\infty \phi(x) \mathrm{d}x = \mathcal{N}(d).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So except for the discounting, the two expressions are the same in case of the Bachelier model.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Edit: The price of a spot asset $S$ doesn't follow an arithmetic Brownian motion under $\mathbb{Q}$. We obtain the delta of a European call option on it as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\frac{\partial C_0}{\partial S_0} = \frac{\partial C_0}{\partial F_0} \frac{\partial F_0}{\partial S_0} = \mathcal{N}(d).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The exercise probability is still&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathbb{Q} \left\{ S_T &amp;gt; K \right\} = \mathcal{N}(d)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;since $F_T = S_T$ at maturity.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2017-01-21T09:29:53.540" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="31998" PostTypeId="2" ParentId="31995" CreationDate="2017-01-20T21:12:51.790" Score="3" Body="&lt;p&gt;Under the Hull-White interest rate model,  the short rate $r_t$ satisfies a risk-neutral SDE of the form &#xA;\begin{align*}&#xA;dr_t = (\theta(t)-a r_t)dt+ \sigma dW_t.&#xA;\end{align*}&#xA;The price at time $t$ of a zero-coupon bond with maturity $T$ and unit face value is then given by&#xA;\begin{align*}&#xA;P(t, T) &amp;amp;= A(t, T) e^{-B(t, T) r_t},&#xA;\end{align*}&#xA;where&#xA;\begin{align*}&#xA;B(t, T) &amp;amp;= \frac{1}{a}\Big(1-e^{-a(T-t)} \Big),\\&#xA;A(t, T) &amp;amp;= \exp\left(- \int_t^T  \theta(u) B(u, T) du -\frac{\sigma^2}{2a^2}\big(B(t, T) -T+t\big)-\frac{\sigma^2}{4a}B(t, T)^2\right), \tag{1}\\&#xA;\theta(t) &amp;amp;= af^M(0, t) +\frac{\partial f^M(0, t)}{\partial t}+\frac{\sigma^2}{2a}\left(1-e^{-2at}\right), \\&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;f^M(0, t) &amp;amp;= -\frac{\partial \ln P(0, t)}{\partial t}. &#xA;\end{align*}&#xA;Note that, &#xA;\begin{align*}&#xA;\ln P(0, T) = -\int_0^T f^M(0, u) du.&#xA;\end{align*}&#xA;Moreover, we define the yield-to-maturity $R(t, T)$ by&#xA;\begin{align*}&#xA;R(t, T) &amp;amp;=\frac{-\ln P(t, T)}{T-t}.&#xA;\end{align*} &#xA;We show that&#xA;\begin{align*}&#xA;\ln A(t, T) &amp;amp;= \left[tR(0, t)-TR(0, T) \right] + B(t, T)f^M(0, t) -\frac{\sigma^2}{4a}\left(1-e^{-2at} \right)B(t, T)^2.\tag{2}&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that, &#xA;\begin{align*}&#xA;&amp;amp; \ \int_t^T \frac{\partial f^M(0, u)}{\partial u}B(u, T) \\&#xA;=&amp;amp;\ f^M(0, u)B(u, T)\, \big|_t^T - \int_t^T f^M(0, u)\frac{\partial B(u, T)}{\partial u}du\\&#xA;=&amp;amp;\ -f^M(0, t)B(t, T) + \int_t^T f^M(0, u) e^{-a(T-u)} du\\&#xA;=&amp;amp;\ -f^M(0, t)B(t, T) - a\int_t^T f^M(0, u) B(u, T) du + \int_t^T f^M(0, u)du.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;&amp;amp;\ a\int_t^T f^M(0, u) B(u, T) du + \int_t^T \frac{\partial f^M(0, u)}{\partial T}B(u, T) \\&#xA;=&amp;amp;\ -f^M(0, t)B(t, T)+\int_t^T f^M(0, u)du\\&#xA;=&amp;amp;\ -f^M(0, t)B(t, T)- \ln P(0, T)+\ln(0, t)\\&#xA;=&amp;amp;\ -f^M(0, t)B(t, T)+ TR(0, T)-tR(0, t).&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;&amp;amp;\ \int_t^T  \frac{\sigma^2}{2a}\left(1-e^{-2au}\right) B(u, T) du \\&#xA;=&amp;amp;\ \frac{\sigma^2}{2a^2}\int_t^T \left(1-e^{-2au}\right)\left(1-e^{-a(T-u)} \right)du\\&#xA;=&amp;amp;\ \frac{\sigma^2}{2a^2}\int_t^T \left(1-e^{-2au} - e^{-a(T-u)} + e^{-a(T+u)}\right)du\\&#xA;=&amp;amp;\ \frac{\sigma^2}{2a^2}\left[T-t+\frac{1}{2a}\left(e^{-2aT}-e^{-2at} \right) + \frac{1}{a}\left(1-e^{-a(T-t)} \right) -\frac{1}{a}\left(e^{-2aT}-e^{-a(T+t)}\right)  \right] \\&#xA;=&amp;amp;\ \frac{\sigma^2}{2a^2}\left[\big(T-t- B(t, T)\big) + \frac{1}{2a}e^{-2at}\left(-e^{-2a(T-t)}-1 +2e^{-a(T-t)} \right)\right]\\&#xA;=&amp;amp;\ \frac{\sigma^2}{2a^2}\big(T-t- B(t, T)\big) - \frac{\sigma^2}{4a}e^{-2at}B(t, T)^2.&#xA;\end{align*}&#xA;Therefore,&#xA;\begin{align*}&#xA;&amp;amp;\ \ln A(t, T) \\&#xA;=&amp;amp;\ - \int_t^T  \theta(u) B(u, T) du -\frac{\sigma^2}{2a^2}\big(B(t, T) -T+t\big)-\frac{\sigma^2}{4a}B(t, T)^2\\&#xA;=&amp;amp;\ f^M(0, t)B(t, T)+ tR(0, t)- TR(0, T)- \frac{\sigma^2}{2a^2}\big(T-t- B(t, T)\big) + \frac{\sigma^2}{4a}e^{-2at}B(t, T)^2\\&#xA;&amp;amp;\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad -\frac{\sigma^2}{2a^2}\big(B(t, T) -T+t\big)-\frac{\sigma^2}{4a}B(t, T)^2\\&#xA;=&amp;amp;\ \big(tR(0, t)- TR(0, T)\big)+f^M(0, t)B(t, T) - \frac{\sigma^2}{4a}\left(1-e^{-2at} \right)B(t, T)^2,&#xA;\end{align*}&#xA;which is the required Claim $(2)$ above. &lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-01-21T15:28:41.897" LastActivityDate="2017-01-21T15:28:41.897" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32000" PostTypeId="1" AcceptedAnswerId="32246" CreationDate="2017-01-20T22:57:32.070" Score="0" ViewCount="592" Body="&lt;p&gt;CRSP has a nice, &lt;em&gt;permanent&lt;/em&gt; identifier system for securities known as &quot;permno&quot;s. I don't have access to a Bloomberg terminal, but am considering the investment. Does the Bloomberg terminal know these identifiers?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What about other identifiers? I'm sure it know CUSIPs. What about Compustat's &quot;GVKEY&quot;s?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="26196" LastActivityDate="2017-02-04T15:50:49.583" Title="Does Bloomberg Terminal have access to CRSP &quot;permno&quot;s, Compustat GVKEYs?" Tags="&lt;data&gt;&lt;bloomberg&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32002" PostTypeId="1" AcceptedAnswerId="32023" CreationDate="2017-01-21T01:29:19.627" Score="0" ViewCount="549" Body="&lt;p&gt;I understand lookahead bias is pretty common industry knowledge. But I cannot wrap my head around how I am introducing it and could use a nice and easy explanation. Here's my thought process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have $N$ data points of OHLC data. Lets say for the sake of argument I pull $t = 1$ to $N$ from a database.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I train a model on the closing price of this instrument to predict the $t + 1$th value. I understand that by doing so I have introduced lookahead bias.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where I struggle with is - when I go to predict the next time period's close with live data I'm going to&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Pull $N - 1$ data points &lt;/li&gt;&#xA;&lt;li&gt;Wait for this current candle to close (for the sake of argument, lets say I get this data as fast as possible)&lt;/li&gt;&#xA;&lt;li&gt;Add the new data point to the list of $N -1 $ data points I have pulled from my database&lt;/li&gt;&#xA;&lt;li&gt;Predict the $N+1$th data point (the NEXT time periods data point, in other words the &lt;em&gt;now&lt;/em&gt; current data point's close)&lt;/li&gt;&#xA;&lt;li&gt;Make my trade&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I feel like this is what I am doing in the training procedure, assuming that when I train on the $N$ data points, the $N$th data point has closed already.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could someone take this example and explain to me where I'm making a mistake in my reasoning? I would really appreciate it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I should be more specific. Assuming I generate a $-1$ or $1$ signal for sell and buy respectively, and I am using a log return series. &lt;/p&gt;&#xA;" OwnerDisplayName="user20664" LastEditorDisplayName="user20664" LastEditDate="2017-01-21T02:17:45.767" LastActivityDate="2017-01-22T05:35:49.827" Title="Trouble understanding lookahead bias" Tags="&lt;backtesting&gt;&lt;modeling&gt;&lt;forecasting&gt;&lt;prediction&gt;&lt;forecast&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32005" PostTypeId="1" CreationDate="2017-01-21T09:42:02.743" Score="4" ViewCount="2013" Body="&lt;p&gt;I have a very quick question. Suppose that I buy a European call option from party S with expiry $T$. I want to determine the general formula for the CVA of the option, at time $t$. If I let $T_1\leq T$ be the default time of $S$ and I denote by $\xi=S$ the default event of $S$ (I am following here the notation of Quantitative Risk Management by McNeil, Frey, Embrechts, Chapter 17), and I denote by $c(t,T)$ the risk-neutral, default-free (Black-Scholes) price of the option at time $t$, is the following formula correct:&#xA;$$&#xA;CVA(t) = LGD\cdot\mathbb E^Q[\mathbb 1_{\{T_1\leq T\}}\cdot\mathbb 1_{\{\xi=S\}}D(t,T_1)c(T_1,T) |\mathcal F_t]&#xA;?&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My point here is that the evaluation of the default-free expected cash flow of the option is just the price of the option at time $t$, and since this cannot be negative, the term $c(T_1,T)$ is always positive, so there's no need to take its positive part.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So is my formula above correct?&lt;/p&gt;&#xA;" OwnerUserId="11960" LastEditorUserId="11960" LastEditDate="2017-01-22T07:01:59.973" LastActivityDate="2017-02-01T17:09:35.580" Title="CVA formula for a call option" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;cva&gt;&lt;counterparty-risk&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32007" PostTypeId="2" ParentId="18558" CreationDate="2017-01-21T15:12:00.473" Score="2" Body="&lt;p&gt;The IRR cannot be used to move the Present Value to a Future Value, because it doesn't represent the rate for that interval of time.  It is a complicated average of rates for 1,2,3 years, not the rate for 3 years which you require.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-01-21T15:12:00.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32008" PostTypeId="1" CreationDate="2017-01-21T15:54:31.013" Score="2" ViewCount="615" Body="&lt;p&gt;The question is what R optimization could be applicable to find a vector of weights that when, multiplied by S matrix creates equal rows sums, and when set in the objective function returns the minimal value.&lt;br&gt;&#xA;The code will be reused for different number and combination of assets.&lt;br&gt;&#xA;n = number of assets&lt;br&gt;&#xA;x = vector of weights per asset (the solution of the optimization X1,…,Xn) #unknown&lt;br&gt;&#xA;R = matrix of returns for n number of assets&lt;br&gt;&#xA;S = a given matrix of numbers with 2 rows  and n columns&lt;br&gt;&#xA;&lt;strong&gt;Objective&lt;/strong&gt;: minimize the fun.obj  &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;fun.obz &amp;lt;- function(R, x, na.rm = TRUE) {&#xA;covmat &amp;lt;- var(R = R, na.rm = na.rm)&#xA; utc &amp;lt;- upper.tri(covmat)&#xA; wt.var &amp;lt;- sum(diag(covmat) * x^2)&#xA;wt.cov &amp;lt;- sum(x[row(covmat)[utc]] *&#xA;                 x[col(covmat)[utc]] *&#xA;                 covmat[utc])&#xA; variance &amp;lt;- wt.var + 2 * wt.cov&#xA;return(variance)  }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Constraints&lt;/strong&gt;:&lt;br&gt;&#xA;The sum of x == 1&lt;br&gt;&#xA;Each x &gt;= 0 #positive&lt;br&gt;&#xA;S[1,] == S[2,]   meaning S[1,]-S[2,] == 0 # the sum of each column is equal or with a small tolerance.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Create data&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library('Quandl')&#xA;a1 = Quandl(&quot;YAHOO/AAPL&quot;, transform =&quot;rdiff&quot;, start_date=&quot;2013-12-31&quot;, type=&quot;xts&quot;)&#xA;a2 = Quandl(&quot;YAHOO/GOOG&quot;, transform =&quot;rdiff&quot;, start_date=&quot;2013-12-31&quot;, type=&quot;xts&quot;)&#xA;a3 = Quandl(&quot;YAHOO/MSFT&quot;, transform =&quot;rdiff&quot;, start_date=&quot;2013-12-31&quot;, type=&quot;xts&quot;)&#xA;&#xA;a4 = Quandl(&quot;YAHOO/HPQ&quot;, transform =&quot;rdiff&quot;, start_date=&quot;2013-12-31&quot;, type=&quot;xts&quot;)&#xA;a5 = Quandl(&quot;YAHOO/ORCL&quot;, transform =&quot;rdiff&quot;, start_date=&quot;2013-12-31&quot;, type=&quot;xts&quot;)&#xA;R = merge(a1$`Adjusted Close`,a2$`Adjusted Close`,a3$`Adjusted Close`,a4$`Adjusted Close`, a5$`Adjusted Close`, all=TRUE)&#xA;colnames(R) = c('AAPL','GOOG','MSFT','HPQ','ORCL')&#xA;n = ncol(R)&#xA;S = matrix( c(-0.003296857,-0.003361181,-0.005320475,0.001920951,-0.0017016479,-0.005304732, -0.007212091,-0.003841529,0.004978937,-0.0001444762), byrow=TRUE, ncol=5)&#xA;colnames(S) = c('AAPL','GOOG','MSFT','HPQ','ORCL')&#xA;rownames(S) = c('S1','S2')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="26205" LastActivityDate="2017-01-21T15:54:31.013" Title="Optimal weights for portfolio optimisation (r)" Tags="&lt;programming&gt;&lt;risk-management&gt;&lt;optimization&gt;&lt;portfolio-optimization&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32009" PostTypeId="2" ParentId="26324" CreationDate="2017-01-21T16:54:32.323" Score="3" Body="&lt;p&gt;Kelly is mostly based upon assets with zero correlation made independent of each other.&#xA;The way I approximate Kelly for multiple bets with correlation is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Assume after your first bet the capital is gone.&lt;/li&gt;&#xA;&lt;li&gt;Place a second bet based upon the Kelly of the remaining capital.&lt;/li&gt;&#xA;&lt;li&gt;Factor in correlation..&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Part 3 is the challenging part.&#xA;I assume that with multiple bets at zero correlation placed simultaneously that I would bet the full Kelly per bet made. &#xA;I assume that with multiple bets at a correlation of 1 I would divide the Kelly by the number of bets.&#xA;So if for example I were to make 5 bets with a Kelly of 20%... a correlation of 1 would be 20% divided by 5 or 4% per bet.&#xA;A correlation of zero would be 1-(0.80^5) to determine total capital at risk and then divide by 5 which is ~13.45% per bet.&#xA;A correlation of 50% is the average of the two or ~8.7%&#xA;Anything else is a weighted average but you have to be careful not to get the weightings backwards.&#xA;For example a correlation of 20% you take 80% of the Kelly amount 13.45 and 20% of 4% and sum them together.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't believe this is totally accurate because I'm not sure the relationship of correlation is linear and also the assumption that the capital is gone after a single Kelly bet in reality would instead follow more of a decision tree of possible futures and grow increasingly complex with each additional bet... but it serves its purpose.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Major warning: the markets are totally uncertain. Given uncertain edges and conditions that change there is FAR greater problems with overbetting than under betting.&#xA;Even an extremely small probability of overbetting by more than 2x Kelly or brief period of substantially overbetting by more than 2x the Kelly introduces the risk of ruin and may turn a positive edge negative. &#xA;However... the costs of fees going up as a percentage of the trade goes up as a trade gets smaller which is problematic for smaller accounts. Smaller accounts are more likely to recover losses through additional deposits so this may suggest a slightly more aggressive approach initially and a plan to scale back risk for awhile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, there are utility functions of wealth and psychological ones which suggests that a dollar lost costs more than a dollar gain, particularly as it pertains to producing an annual (or monthly) gain vs an annual loss.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As such, one possible modification is to bet a fractional Kelly initially and then as you start to produce gains increase the fraction of the Kelly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may wish to run Monte Carlo simulations to determine the probability of bad results and seek to minimize those results... unfortunately I don't really know how correlation relates to probability of a similar outcome so a I haven't been able to effectively model a multi variable portfolio with an average correlation or correlation matrix or matrices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I personally look at risk of stock a little different because I am very unlikely to lose more than 10% in a stock so instead I factor in the likely capital at risk on a stock trade to be 1% for a 10% position or 2% if I'm being more conservative about the possibility of an overnight gap down or making poor decisions due to psychological factors.&#xA;If I calculate the Kelly to be something like  just over 2% per out of the money option position for 20 option positions, (totalling about 45%), I'd prefer to replace some of the options with stocks and reduce the risk by estimating a higher correlation and even modifying my initial approach and only considering that the upper limit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I basically am aiming for 1% per option for up to 20 positions plus 5 optional &quot;double position size&quot; and up to 2 of those 5 optionally &quot;triple&quot;.&#xA;This gets me to a maximum of 27% at risk in options which allows me to put 180% of stock at 1% risk or 90% at risk. I prefer to have capital available at all times and a much lower profile so I instead might aim for 1/3rd of that and up to 60% stock which leaves a minimum of 13% cash.&#xA;Since I'm unlikely to use the upper end limit of capital and unlikely to require the margin I'll put a 10% position into an income basket.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also like to use a portion of my portfolio based upon a more game theoretic solution of positioning based upon the probability that a bullish trade will produce a win vs a bearish trade.&#xA;So I'll establish a minimum of 20% bearish (or bullish) option positions.&#xA;I'll also diversify over multiple timelines and since it is likely I'll have unused capital at specific times I will buy VXX puts and/or XIV position to use up capital when the implied volatility (measured by the VIX index) of the market rises too high.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I sort of want to have a portfolio that isn't just playing the individual stocks and cash, and there are several other money management problems that come up as one or more position that is active increases by a large amount, but selling before a target price is undesirable and exiting early can turn a profitable system unprofitable...&#xA;So I am considering owning a set portion of that 20 positions (or additional position) in SPY calls when the market is low or oversold and reducing when the market is high (or using VXX puts or XIV as a proxy following vix spikes) as that will allow me to solve overallocation into the market by reducing SPY calls with a more mean reversion philosophy.&#xA;There are also other low correlation assets, some of which may be contained in the income basket (such as bonds) and others of which have not been mentioned like commodities and currency trades that are generally strong in game theoretic equilibrium solutions that may be worth integrating.&#xA;Ultimately, reducing position sizes of individual trades may provide some trade off.&#xA;Also, Options not only have potential correlation of underlying instruments but of expiry cycles which can be mitigated through diversification of expiry and possibly mixing of strategies from long put/call and short/long bear put spreads and bull call spreads.&#xA;There are mathematical solutions in scholarly papers if you are really advanced that better answer this many of which are covered in the book Kelly Capital Growth investment criterion.&lt;/p&gt;&#xA;" OwnerUserId="26206" LastEditorUserId="24222" LastEditDate="2017-01-21T20:56:05.897" LastActivityDate="2017-01-21T20:56:05.897" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32010" PostTypeId="1" AcceptedAnswerId="32015" CreationDate="2017-01-21T18:06:44.413" Score="2" ViewCount="106" Body="&lt;p&gt;I saw this line on some website but can not understand it. Can anyone explain it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Even if the underlying asset price remains unchanged, the option delta for an in-the-money option increases as expiration nears; the opposite is true for an out-of-the-money option.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the context the simplest BSM equation, the delta has the formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Delta = \frac{1}{\sqrt{2 \pi}} \int_{\frac{1}{\sigma\sqrt{T}} \left( \ln \left( \frac{K}{S_0} \right) - \left( r + \frac{\sigma^2}{2} \right) T \right)}^{+\infty}\exp \left( -\frac{x^2}{2} \right) \mathrm{d}x.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By doing some mathematical analysis, when ITM, $\Delta$ shall increase when $T$ decreases only if&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$T\leq\frac{ \left( r + \sigma^2/2 \right)}{\ln \left( S_0 / K \right)}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When OTM, $\Delta$ shall decrease whenever $T$ decreases, unconditionally. So this result is different from what I saw online and it confuses me.   &lt;/p&gt;&#xA;" OwnerUserId="25086" LastEditorUserId="24222" LastEditDate="2017-01-21T20:34:36.057" LastActivityDate="2017-01-21T20:44:11.303" Title="Why &quot; Even if the underlying asset price remains unchanged, the option delta for an in-the-money option increases as expiration nears&quot;" Tags="&lt;black-scholes&gt;&lt;delta&gt;" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32012" PostTypeId="2" ParentId="32010" CreationDate="2017-01-21T18:25:04.497" Score="2" Body="&lt;p&gt;If the call is ITM, ie $K&amp;lt;S$, as expiry approaches the likelihood that the option will be exercised increases, as there is now less time for it to go OTM. Delta is the position that the hedger is holding, therefore she will need to hold more of the stock. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2017-01-21T18:25:04.497" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32013" PostTypeId="1" AcceptedAnswerId="32018" CreationDate="2017-01-21T18:49:33.330" Score="1" ViewCount="123" Body="&lt;p&gt;While trying to implement my version of Euler's method for simulating a SDE in C++, I came up with a problem. It occurs in some cases that the path generated by my method ends up giving values which are &lt;code&gt;NaN&lt;/code&gt; (not-a-number). This happens rarely, but usually around 1 or 2 of these cases appear if I compute 100 paths. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe the issue comes up with the normal random numbers $Z_i$ that I'm using for the iteration $$S_{i+1}=S_i+f(S_i)\cdot \sqrt{dt}\cdot Z_i$$&#xA;(where the SDE is for example $dS_t=f(S_t)dW_t$). I tried using both &lt;code&gt;std::normal_distribution&lt;/code&gt; with generator &lt;code&gt;std::mt199737&lt;/code&gt; and implementing my own Box-Muller method (generating uniform numbers with &lt;code&gt;std::uniform_real_distribution&lt;/code&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With both approaches, there is always the odd value that makes the whole simulation go to infinity and produce &lt;code&gt;NaN&lt;/code&gt;. The thing is that I need to do some computations with the final values $S_1$ produced by my paths. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should I just ignore the &lt;code&gt;NaN&lt;/code&gt; ones? There is only a very small number of them compared with the total number of paths. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do people have these sort of problems when running this type of simulation? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#include &amp;lt;iostream&amp;gt;&#xA;#include &amp;lt;vector&amp;gt;&#xA;#include &amp;lt;random&amp;gt;&#xA;&#xA;typedef double ( *funct )( double );&#xA;&#xA;double square( double x ) { return x * x; }&#xA;double fourx( double x ) { return 4 * x; }&#xA;&#xA;double generateGaussian();&#xA;std::vector&amp;lt; double &amp;gt; createPath( unsigned, double, funct );&#xA;&#xA;&#xA;int main()&#xA;{&#xA;  double initial = 1.0;&#xA;  unsigned intervals = 3000;&#xA;  unsigned paths = 500;&#xA;&#xA;  std::vector&amp;lt; double &amp;gt; path;&#xA;  int n = 0;&#xA;  for ( auto j = 0; j &amp;lt; paths; ++j )&#xA;  {&#xA;    path = createPath( intervals, initial, square );&#xA;    if ( isnan( path.back() ) )&#xA;      ++n;&#xA;  }&#xA;&#xA;  std::cout &amp;lt;&amp;lt; n &amp;lt;&amp;lt; std::endl;&#xA;}&#xA;&#xA;double generateGaussian()&#xA;{&#xA;  static std::mt19937 generator( std::random_device{}() );&#xA;  std::normal_distribution&amp;lt; double &amp;gt; dist( 0.0, 1.0 );&#xA;&#xA;  return dist( generator );&#xA;}&#xA;&#xA;std::vector&amp;lt; double &amp;gt; createPath( unsigned numberOfIntervals, double initialCondition, funct f )&#xA;{&#xA;  double sqdt = sqrt( 1.0 / numberOfIntervals );&#xA;  std::vector&amp;lt; double &amp;gt; path;&#xA;  path.push_back( initialCondition );&#xA;  for ( auto i = 0; i &amp;lt; numberOfIntervals; ++i )&#xA;  {&#xA;    double Z = generateGaussian();&#xA;    double Si = path.back();&#xA;    double S = Si + f( Si ) * sqdt * Z;&#xA;&#xA;    path.push_back( S );&#xA;  }&#xA;  return path;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I simply compile it with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;g++ -std=c++11 test.cpp&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is on a terminal on Mac OS X 10.10.5:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;g++ -v&#xA;Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1&#xA;Apple LLVM version 7.0.2 (clang-700.1.81)&#xA;Target: x86_64-apple-darwin14.5.0&#xA;Thread model: posix&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;From time to time I get a path that terminates with a &lt;code&gt;NaN&lt;/code&gt;. I also implemented this with other functions and get similar occurrences. I tried for example taking $f(x)=4x$ (so $dS_t=4S_tdW_t$) and sometimes I get unusually huge numbers (even ignoring the &lt;code&gt;NaN&lt;/code&gt; paths). Also in this particular case of $f(x)=4x$, I get completely inconsistent results from run to run, which kind of annoys me, but I haven't thought about why yet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, if I initialize the generator with 0, I get, with this exact same code, 2 &lt;code&gt;NaN&lt;/code&gt;'s. &lt;/p&gt;&#xA;" OwnerUserId="25227" LastEditorUserId="25227" LastEditDate="2017-01-21T22:32:24.453" LastActivityDate="2017-01-21T23:38:09.517" Title="Extreme cases of normal random numbers and NaN" Tags="&lt;stochastic-calculus&gt;&lt;simulations&gt;&lt;numerical-methods&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32014" PostTypeId="1" AcceptedAnswerId="32017" CreationDate="2017-01-21T20:27:55.933" Score="1" ViewCount="941" Body="&lt;p&gt;The market is arbitrage free iff there exists an equivalent martingale measure for the discounted price process of the stock. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My course only provides me part of the entire proof that shows that whenever such martingale exists, it implies the market must be arbitrage free.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Proof:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume $P^*$ is an equivalent martingale for the discounted stock price process $S'$. For any self-financing strategy $\phi$, we have that $V'^\phi$ is a $P^*$ martingale. ($V'$ here is the discounted value of such strategy). So: $$ E_{P^*}[V'^\phi_T] = V^\phi_0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose now that $\phi$ is an arbitrage oppurtunity. Then $P(V^\phi_0=0) = 0$ (the initial cost of the strategy is zero), so also $P^*(V^\phi_0=0) = 0$ and thus $ E_{P^*}[V'^\phi_T] = B^{-1}_TE_{P^*}[V^\phi_T] = B^{-1}_TV^\phi_0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We must have  $$ P^*(V^\phi_T\geq0) = 1 , P^*(V^\phi_T\gt0) &amp;gt; 0 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Together with the fact that for each possible outcome $\omega$, we have $P^*({\omega}) \gt 0$, this leads to a contradiction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now as explanation for the contradiction, it says that we can not have a non negative random variable with a zero mean and positive mass on the positive real numbers. Which I don't understand. Could someone shed some light on this explanation?&lt;/p&gt;&#xA;" OwnerUserId="16889" LastEditorUserId="16889" LastEditDate="2017-01-21T20:33:03.863" LastActivityDate="2017-01-21T20:52:48.997" Title="No-arbitrage theorem: a proof" Tags="&lt;risk-neutral-measure&gt;&lt;no-arbitrage-theory&gt;&lt;martingale&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32015" PostTypeId="2" ParentId="32010" CreationDate="2017-01-21T20:28:57.793" Score="4" Body="&lt;p&gt;@Kiwiakos gave you the intuition. Here is the corresponding analysis that you asked for. The European plain vanilla call delta is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\frac{\partial C_0}{\partial S_0} = \mathcal{N} \left( d_+ \right),&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;d_+ = \frac{1}{\sigma \sqrt{T}} \left( \ln \left( \frac{S_0}{K} \right) + \left( r - \frac{1}{2} \sigma^2 \right) T \right)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Differentiating again w.r.t. $T$ yields&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\frac{\partial^2 C_0}{\partial S_0 \partial T} &amp;amp; = &amp;amp; \mathcal{N}' \left( d_+ \right) \frac{\partial d_+}{\partial T}\\&#xA;&amp;amp; = &amp;amp; \mathcal{N}' \left( d_+ \right) \frac{1}{2 \sigma T \sqrt{T}} \left( -\ln \left( \frac{S_0}{K} \right) + \left( r - \frac{1}{2} \sigma^2 \right) T \right).&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This term is negative (delta is increasing as the time-to-maturity becomes shorter) if&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;-\ln \left( \frac{S_0}{K} \right) + \left( r - \frac{1}{2} \sigma^2 \right) T &amp;lt; 0 \qquad \Leftrightarrow \qquad S_0 &amp;gt; K \exp \left\{ \left( r - \frac{1}{2} \sigma^2 \right) T \right\} := S^*(T)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is in accordance with the formula you provided. In the limit we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\lim_{T \downarrow 0} S^*(T) = K&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;as expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the statement that you quoted that says that delta increases for in-the-money options as the time-to-maturity decreases. This is roughly true as you see from the above though not fully accurate.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-01-21T20:36:27.043" LastActivityDate="2017-01-21T20:36:27.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32016" PostTypeId="2" ParentId="32010" CreationDate="2017-01-21T20:44:11.303" Score="3" Body="&lt;p&gt;Note that the option delta is given by&#xA;$\Delta= N(d_1)$, where&#xA;\begin{align*}&#xA;d_1 = \frac{\ln\frac{S_t}{K}+\big(r+\frac{\sigma^2}{2}\big)(T-t)}{\sigma\sqrt{T-t}}.&#xA;\end{align*}&#xA;Let $\tau = T-t$ be the residual option maturity. Then, for $K &amp;lt;S_t$,&#xA;\begin{align*}&#xA;\frac{\partial d_1}{\partial \tau} &amp;amp;= \frac{(r+\frac{\sigma^2}{2}\big) \tau - \ln\frac{S_t}{K}}{2\sigma \tau^{\frac{3}{2}}}.&#xA;\end{align*}&#xA;Therefore, as expiration nears, or as $\tau \rightarrow 0$, $\frac{\partial d_1}{\partial \tau} &amp;lt; 0$, that is, the option delta increases as the residual option maturity $\tau$ decreases (i.e., expiration nears).&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2017-01-21T20:44:11.303" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32017" PostTypeId="2" ParentId="32014" CreationDate="2017-01-21T20:46:19.493" Score="4" Body="&lt;p&gt;Consider a random variable $X$ that has a probability density function (PDF) $f(x)$. $X$ being non-negative means that $f(x) = 0$ for $x &amp;lt; 0$. The expectation of $X$ is thus&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\int_{-\infty}^\infty x f(x) \mathrm{d}x = \int_0^\infty x f(x) \mathrm{d}x.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $f(x) \geq 0$ for it to be a valid PDF, it follows that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\int_0^\infty x f(x) \mathrm{d}x = 0 \qquad \Leftrightarrow \qquad f(x) = \delta(x),&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\delta(x)$ is the Dirac delta function. I.e. for $X$ to have a zero-mean, its PDF needs to be a point mass as zero.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-01-21T20:52:48.997" LastActivityDate="2017-01-21T20:52:48.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32018" PostTypeId="2" ParentId="32013" CreationDate="2017-01-21T23:20:25.033" Score="3" Body="&lt;p&gt;The problem is not with your code but with the SDE itself. The process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathrm{d}S_t = \sigma S^\beta \mathrm{d}W_t&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is a non-negative local martingale. For $\beta \leq 1$ it is a martingale and for $\beta &amp;gt; 1$ it is a strict local martingale. This manifests in your simulation by the diffusion term exploding for some paths when using the function &lt;code&gt;square&lt;/code&gt;. It leads to &lt;code&gt;S = Inf&lt;/code&gt; or &lt;code&gt;S = -Inf&lt;/code&gt; and on the next step and all following ones you get &lt;code&gt;S = NaN&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When using your function &lt;code&gt;fourx&lt;/code&gt;, you shouldn't encounter this. A better discretization of the SDE&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathrm{d}S_t = \sigma S_t \mathrm{d}W_t&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is by simulating the logs. I.e. you approximate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathrm{d} \ln S_t = -\frac{1}{2} \sigma^2 \mathrm{d}t + \sigma \mathrm{d}W_t&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\ln S_i = \ln S_{i - 1} - \frac{1}{2} \sigma^2 \Delta t + \sigma \sqrt{\Delta t} Z.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This way you get rid of the state-dependence in the diffusion coefficient and incur no discretization error for any step size.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also &lt;a href=&quot;https://quant.stackexchange.com/questions/14232/&quot;&gt;this&lt;/a&gt; related question.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2017-01-21T23:38:09.517" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32019" PostTypeId="1" AcceptedAnswerId="32020" CreationDate="2017-01-21T23:35:27.060" Score="0" ViewCount="1213" Body="&lt;p&gt;We have the risk-free valuation formula $$ \pi^X_i = B_T^{-1}B_iE_{P^*}[X|F_i]$$&#xA;Where $P^*$ is an equivalent martingale measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is this martingale measure considered risk-neutral? All I know is that an expected price with a martingale prob measure just predicts the last known value again. $E_{P^*}[X|F_i] = X_i$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does this make it risk-neutral?&lt;/p&gt;&#xA;" OwnerUserId="16889" LastActivityDate="2017-01-21T23:51:13.367" Title="Why is a martingale a risk-neutral measure" Tags="&lt;probability&gt;&lt;hedging&gt;&lt;risk-neutral-measure&gt;&lt;asset-pricing&gt;&lt;martingale&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32020" PostTypeId="2" ParentId="32019" CreationDate="2017-01-21T23:51:13.367" Score="1" Body="&lt;p&gt;The expected return of every spot asset under $\mathbb{P}^*$ is the same and equal to the risk-free interest rate, irrespective of the risk. Only a risk-neutral agent would price securities this way. A risk-averse agent would demand a positive expected excess return for an asset that covaries positively with shocks to her consumption.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2017-01-21T23:51:13.367" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32021" PostTypeId="2" ParentId="9380" CreationDate="2017-01-22T01:14:16.670" Score="3" Body="&lt;p&gt;I wrote a proof deriving the distribution of returns for all asset and liability classes.  If there were no budget constraint, limitation on liability and liquidity had no cost, then you can prove the distribution of returns follows a Cauchy law.  The budget constraint triggers skew that becomes larger and larger the higher the return.  The reason is that 100% of the population would accept IBM stock at zero dollars per share, while no one would pay an infinite price.  The denominator has to exist because you bought it, but the numerator does not. The probability of a trade declines as the sales price increases and returns can be thought of as the probability of a specific return, given a trade happened, times the probability a trade happened.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nonetheless, until you get to the upper ends, the Cauchy distribution is a reasonably good fit for returns on securities that are going concerns.  Firms that are going to merge or become bankrupt have different distributions.  I also empirically tested this and solved the option pricing model as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The easiest thing is to go to my author page.  &lt;a href=&quot;https://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=1541471&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=1541471&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Start with the article &quot;The Distribution of Returns,&quot; it has everything from stocks to bonds to antiques to accounting ratios.  Then go to the article on why practitioners should use Bayesian methods, then if you are interested you can look at the empirical test.  Finally, that leaves you an option pricing model.  It is not &lt;em&gt;THE&lt;/em&gt; option pricing model, but &lt;em&gt;a&lt;/em&gt; option pricing model.  The article discusses realistic extensions.  I am preparing two more articles for summer.  One extends stochastic calculus to cover macroeconomics and finance as it does not hold under the current assumptions.  The second discusses how to build a &lt;em&gt;subjectively&lt;/em&gt; optimal portfolio.  It takes little work to realize that there cannot exist an objectively optimal portfolio.  A person with a mortgage and a child going to college is facing differing constrains than a pension fund.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2017-01-22T01:14:16.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32022" PostTypeId="1" CreationDate="2017-01-22T03:12:51.073" Score="0" ViewCount="127" Body="&lt;p&gt;Consider a Black Scholes model with two risky assets that are driven by the same $W$-process, and then 1 risk-free asset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When is this model arbitrage-free and complete? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have only 1 driving Wiener process, so it does not fit into the theory I learned from Bjork, chapter 13.&lt;/p&gt;&#xA;" OwnerUserId="26211" LastEditorUserId="20795" LastEditDate="2017-01-23T21:27:59.740" LastActivityDate="2017-01-23T21:27:59.740" Title="Black Scholes: two assets, same $W$-process" Tags="&lt;black-scholes&gt;&lt;arbitrage&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32023" PostTypeId="2" ParentId="32002" CreationDate="2017-01-22T05:35:49.827" Score="2" Body="&lt;p&gt;The issue is how do you evaluate the success of your trades. If the P&amp;amp;L in your simulation is measured as C(t+1)-C(t) then your simulation is not completely realistic, because in real life by the time you compute the signal based on C(t), even if you do so quickly, the price C(t) will not be the current price and you will not be able to buy at that price. How big a problem this is depends on how liquid and volatile the market is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One solution might be to measure the P&amp;amp;L as C(t+1)-O(t+1). This assumes that you will buy at the next bar open, based on the signal computed at the previous bar close.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-01-22T05:35:49.827" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32024" PostTypeId="2" ParentId="32022" CreationDate="2017-01-22T07:37:11.320" Score="-3" Body="&lt;p&gt;You must have $ r= \mu_1 = \mu_2$ for arbitrage-ness. The completeness follows because $n &amp;lt; k$ (k is the number of random sources, n is the number of risky assets).&lt;/p&gt;&#xA;" OwnerUserId="26213" LastEditorUserId="848" LastEditDate="2017-01-22T09:59:52.173" LastActivityDate="2017-01-22T09:59:52.173" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32025" PostTypeId="1" AcceptedAnswerId="43419" CreationDate="2017-01-22T10:12:05.323" Score="2" ViewCount="471" Body="&lt;p&gt;I'm looking to build a news-based trading algo and I need a live news feed for economic data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there are free sources available? I cannot find a single one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It doesn't have to be perfect, and I'm willing to get my hands dirty and do some development but if anyone has done this before, I would like to know where you got your data and how you were able to make it &quot;live&quot; (that is, did you poll a service, did you scrape a page, or were you able to get a push stream set up somehow?) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a side, I'm also interested in non-economic news feeds for a stocks strategy. Same question applies (are there any free sources of corporate news and how were you able to make it &quot;live&quot;, if it wasnt already build for that)?&lt;/p&gt;&#xA;" OwnerUserId="3038" LastEditorUserId="12" LastEditDate="2017-02-17T17:11:41.367" LastActivityDate="2019-01-10T14:48:41.240" Title="Are there any free algorithmic economic news feeds available?" Tags="&lt;data&gt;&lt;news&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32026" PostTypeId="2" ParentId="32025" CreationDate="2017-01-22T10:18:29.603" Score="1" Body="&lt;p&gt;You could use a RSS data feed from any reputable source (Bloomberg, TReuters, etc)&lt;/p&gt;&#xA;" OwnerUserId="20084" LastActivityDate="2017-01-22T10:18:29.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32029" PostTypeId="1" CreationDate="2017-01-22T17:35:18.337" Score="2" ViewCount="228" Body="&lt;p&gt;In Hull's 8ed., he states in Chapter 33, Energy and Commodity Derivatives,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The second part of the chapter considers weather and insurance derivatives. A&#xA;  distinctive feature of these derivatives is that they depend on variables with &lt;strong&gt;no systematic&#xA;  risk&lt;/strong&gt;. For example, the expected value of the temperature at a certain location or the&#xA;  losses experienced due to hurricanes can &lt;strong&gt;reasonably be assumed to be the same in a risk-&#xA;  neutral world and the real world&lt;/strong&gt;. This means that historical data is potentially more&#xA;  useful for valuing these types of derivatives than for some others.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;(Boldface mine) He elaborates, in Section 33.7,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;One distinctive feature of weather and insurance derivatives is that there is no systematic&#xA;  risk (i.e., risk that is priced by the market) in their payoffs. This means that estimates&#xA;  made from historical data (real-world estimates) can also be assumed to apply to the&#xA;  risk-neutral world. Weather and insurance derivatives can therefore be priced by&lt;/p&gt;&#xA;  &#xA;  &lt;ol&gt;&#xA;  &lt;li&gt;&lt;p&gt;&lt;strong&gt;Using historical data to estimate the expected payoff&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;li&gt;&lt;p&gt;Discounting the estimated expected payoff at the risk-free rate&lt;/p&gt;&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I'm still unclear on this.  Hull is saying it's okay to use the physical probability measure in derivatives pricing for weather derivatives.  His argument seems vague, however --- what does &quot;no systematic risk&quot; mean, and why does this imply the physical measure is valid?  Also, what does this say about the market price of risk?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastEditorUserId="6866" LastEditDate="2017-01-24T18:14:06.850" LastActivityDate="2017-07-30T19:01:13.547" Title="Physical Measure in Weather Derivatives -- Hull" Tags="&lt;option-pricing&gt;&lt;derivatives&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32031" PostTypeId="1" CreationDate="2017-01-22T18:41:48.757" Score="1" ViewCount="127" Body="&lt;p&gt;I have a question regarding differing stock volume amounts for a specific stock reported on various financial websites.&#xA;For example, let's take a look at Lockheed Martin's volume amount at &lt;strong&gt;12-12-2016&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yahoo Finance:  &lt;strong&gt;7 080 300&lt;/strong&gt;&lt;br&gt;&#xA;&lt;a href=&quot;https://finance.yahoo.com/quote/LMT/history?period1=1481238000&amp;amp;period2=1481583600&amp;amp;interval=1d&amp;amp;filter=history&amp;amp;frequency=1d&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://finance.yahoo.com/quote/LMT/history?period1=1481238000&amp;amp;period2=1481583600&amp;amp;interval=1d&amp;amp;filter=history&amp;amp;frequency=1d&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Google Finance:  &lt;strong&gt;7 080 271&lt;/strong&gt;&lt;br&gt;&#xA;&lt;a href=&quot;https://www.google.com/finance/historical?cid=21553&amp;amp;startdate=Dec+9%2C+2016&amp;amp;enddate=Dec+13%2C+2016&amp;amp;num=30&amp;amp;ei=wrWEWIGdIMWCswHOr4No&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.google.com/finance/historical?cid=21553&amp;amp;startdate=Dec+9%2C+2016&amp;amp;enddate=Dec+13%2C+2016&amp;amp;num=30&amp;amp;ei=wrWEWIGdIMWCswHOr4No&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Stock Market Watch: &lt;strong&gt;7 079 560&lt;/strong&gt;&lt;br&gt;&#xA;&lt;em&gt;&quot;You need at least 10 reputation to post more than 2 links.&quot;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and finally the Lockheed Martin's official website: &lt;strong&gt;7 078 760&lt;/strong&gt;&lt;br&gt;&#xA;&lt;em&gt;&quot;You need at least 10 reputation to post more than 2 links.&quot;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My guess is that it perhaps could be a result of some data providers including pre-market and after-hours trading into the calculation of the volume but still, 4 different numbers?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope someone can explain this.&#xA;Thank you in advance. &lt;/p&gt;&#xA;" OwnerUserId="19965" LastEditorUserId="24222" LastEditDate="2017-01-22T18:52:39.433" LastActivityDate="2017-01-22T18:52:39.433" Title="Discrepancy in stock volume amounts at Yahoo, Google, Stock Market Watch and the official website of a company" Tags="&lt;equities&gt;&lt;volume&gt;&lt;yahoofinance&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32032" PostTypeId="1" CreationDate="2017-01-22T18:58:03.090" Score="5" ViewCount="11013" Body="&lt;p&gt;I don't know if there are any similar posts in this forum but I’m trying to describe below all things that I understand about OIS rates and Libor rates.&lt;br&gt;&#xA;Please correct me if I’m wrong somewhere. I am glad to hear any comments from all.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I understand, &lt;strong&gt;OIS rate 3 months&lt;/strong&gt; is calcultated as a fixed rate for a period 3 months which is exchanged for the geometric average (floating rate) of the overnight rates during this period.  &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;First, &lt;strong&gt;Overnight rates&lt;/strong&gt; in this case are interest rates where a group of banks are agreed to pay in the interbank market, during 1 day. Regarding those rates, we have EONIA for Euro zones, SONIA for UK or Fed funds rate for US. &#xA;These rates are fixed day-by-day by Central Bank. I'm not sure how they are calculated but it seems like they are the average of lending rates between a group of selected banks, at a given date. It means that each of a number of selected banks (for example 60 banks in Euro zones) will contribute their own lending rate everyday, and we will take the average of them as the overnight rate at that day. Am i right until now?   &lt;/li&gt;&#xA;&lt;li&gt;Based on Overnight rates we have, we are able to calculate the OIS rate 3 months by the following formula: &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;$$ \text{OIS Rate 3 months} =  \prod_i  \left( 1 + \frac{n_ir_i}{D}\right) -1 $$  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;with:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$r_i$: is overnight rate at date $i$,  &lt;/li&gt;&#xA;&lt;li&gt;$D$: number of days during 3 months,  &lt;/li&gt;&#xA;&lt;li&gt;$n_i$: number of open days between date $i$ and date $i+1$. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Is it right?&lt;/em&gt;&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;For OIS Rate more than 3 months (ex 1 year or 5 years), we usually subdivide the period of maturity into every 3 months because of quarterly payment. It means that at the end of sub-period 3 months, we will exchange fixed flux with floating flux.&lt;br&gt;&#xA;So how to calculate OIS rate 5 years? we do the same (based on OIS rate 3 months as we do with overnight rates in the formula above?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="26147" LastEditorUserId="24222" LastEditDate="2018-08-18T14:24:55.797" LastActivityDate="2019-07-09T00:34:05.190" Title="Calculate OIS rate 3 months, 1 year" Tags="&lt;interest-rates&gt;&lt;interest-rate-swap&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="32033" PostTypeId="1" CreationDate="2017-01-22T19:34:30.100" Score="4" ViewCount="1231" Body="&lt;p&gt;I have the following problem right now: solve&#xA;$$F_t(t,x) + rxF_x(t,x) + \frac{\sigma^2}{2}F_{xx}(t,x) = rF(t,x), \\ F(T,x) = (x - K)^2.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I solve this?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There exists a theorem to solve this, which represents $F(t,x)$ as the discounted expected value of $(X - k)^2$ where $dX = rXds + \sigma X dW$ and with $X_t = x$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, my issues are mainly centered around how messy my calculations get. If I try to solve the above by first calculating $X_s$ since it satisfies a GBM, and then calculating its expectation after first squaring it in the way I need to $(X - k)^2$, the calculations get incredibly messy, and all I get is a whole lot of $\exp$'s to a bunch of powers that vaguely resemble one another but it still doesn't simplify easily.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have I made a mistake, or is the answer really that messy?&lt;/p&gt;&#xA;" OwnerUserId="26220" LastEditorUserId="20795" LastEditDate="2017-01-23T21:27:56.337" LastActivityDate="2017-01-23T21:27:56.337" Title="How to solve this PDE using Feynman-Kac?" Tags="&lt;stochastic-calculus&gt;&lt;differential-equations&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32034" PostTypeId="2" ParentId="32033" CreationDate="2017-01-22T19:51:21.037" Score="4" Body="&lt;h2&gt;Martingale Approach&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;As you noted, you need to solve&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;F(0) &amp;amp; = &amp;amp; e^{-r T} \mathbb{E} \left[ \left( X_T - K \right)^2 \right]\\&#xA;&amp;amp; = &amp;amp; e^{-r T} \left( \mathbb{E} \left[ X_T^2 \right] - 2 K \mathbb{E} \left[ X_T \right] + K^2 \right)&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $Y_t = X_t^2$. Then, by applying the Itō formula, we get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\mathrm{d}Y_t &amp;amp; = &amp;amp; 2 X_t \mathrm{d}X_t + \mathrm{d} \langle X \rangle_t\\&#xA;&amp;amp; = &amp;amp; \left( 2 r + \sigma^2 \right) Y_t \mathrm{d}t + 2 \sigma Y_t \mathrm{d}W_t.&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It follows that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\mathbb{E} \left[ X_T \right] &amp;amp; = &amp;amp; X_0 e^{r T},\\&#xA;\mathbb{E} \left[ X_T^2 \right] &amp;amp; = &amp;amp; X_0^2 e^{\left( 2 r + \sigma^2 \right) T}.&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consequently,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;F(0) = e^{-r T} \left( X_0^2 e^{\left( 2 r + \sigma^2 \right) T} - 2 K X_0 e^{r T} + K^2 \right).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;PDE Approach&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can apply a change of variables to the PDE. Define&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\tau = (T - t), \quad \xi = r - \frac{1}{2} \sigma^2, \quad y = \ln(x) + \xi \tau, \quad F(t, x) = e^{-r \tau} G(\tau, y).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After carefully applying the chain rule, we obtain the PDE&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\frac{\partial G}{\partial \tau} = \frac{1}{2} \sigma^2 \frac{\partial^2 G}{\partial y^2}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with initial condition&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;G(0, y) = \left( e^y - K \right)^2.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fundamental solution is the heat kernel given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\phi(\tau, y) = \frac{1}{\sqrt{2 \pi \sigma^2 \tau}} \exp \left\{ -\frac{y^2}{2 \sigma^2 \tau} \right\}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We obtain $G(\tau, y)$ through the convolution&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;G(\tau, y) &amp;amp; = &amp;amp; \int_{-\infty}^\infty G(0, z) \phi(\tau, y - z) \mathrm{d}z\\&#xA;&amp;amp; = &amp;amp; \int_{-\infty}^\infty \left( e^{2 z} - 2 K e^z + K^2 \right) \phi(\tau, y - z) \mathrm{d}z.&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next note that for some $\alpha \in \mathbb{R}$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\int_{-\infty}^\infty e^{\alpha z} \phi(\tau, y - z) \mathrm{d}z &amp;amp; = &amp;amp; e^{\alpha y + \alpha^2 \sigma^2 \tau / 2}&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;G(\tau, y) = e^{2 y + 2 \sigma^2 \tau} - 2 K e^{y + \sigma^2 \tau / 2} + K^2&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and substituting back yields&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;F(0, x) = e^{-r T} \left( x^2 e^{\left( 2 r + \sigma^2 \right) T} - 2 K x e^{r T} + K^2 \right)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;as before.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-01-22T21:05:13.990" LastActivityDate="2017-01-22T21:05:13.990" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32035" PostTypeId="1" CreationDate="2017-01-22T19:58:05.693" Score="1" ViewCount="174" Body="&lt;p&gt;I'm having a hard time trying to understand a formula about self financing strategy trading. &#xA;Let's suppose you have two assets, $\phi=(\phi_0,\phi_1)$ is the vector that represents the quantity you have for each one of them and $S=(1,S_1)$ is the price (the first asset isn't risky so we suppose it has a constant price).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the discrete model, without transaction cost :&#xA;The self financing hypotheses would mean having $\phi_0(t)+\phi_1(t)S_1(t)=\phi_0(t+1)+\phi_1(t+1)S_1(t)$  which means that when you are in the moment $t$, you see the prices and you take decisions to build a portfolio for the moment $t+1$ so you don't lose money and you don't need money from the outside.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I figured that for discrete time with transaction cost $\lambda$, this would become (correct me if I'm wrong) : &#xA;$\phi_0(t)+\phi_1(t)(1-\lambda)S_1(t)=\phi_0(t+1)+\phi_1(t+1)S_1(t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I'm reading this article with a continuous model and transaction cost and it says that a trading strategy would be self financing if we have : &#xA;$d\phi^{0}_t=(1-\lambda)S^{1}_d\phi^{1,\downarrow}_t-S^{1}_td\phi^{1,\uparrow}_t$&#xA;where $\phi^{1}_t=\phi^{1,\uparrow}_t-\phi^{1,\downarrow}_t$ using the Jordan-Hahn decomposition into two no-decreasing function. Now I don't know much about this decomposition, tried to look it up but didn't understand how is it relevant here.&#xA;I can get intuitively the meaning in the discrete model but I can't establish something between the continuous model and the discrete one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone give me some help ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks :)&lt;/p&gt;&#xA;" OwnerUserId="26218" LastActivityDate="2017-01-22T19:58:05.693" Title="Self financing strategy : how to understand it in continuous + transaction cost model?" Tags="&lt;finance&gt;&lt;quant-trading-strategies&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32036" PostTypeId="1" CreationDate="2017-01-22T20:41:11.010" Score="1" ViewCount="54" Body="&lt;p&gt;Suppose I have a probability distribution for the return of a given stock from now until some expiration date. Is there any algorithm/process/software that will take that probability distribution and tell me the specific options trade (which strike prices and how many contracts at each strike to buy) that will give me the best performance (in terms of return or risk-adjusted return)? There are so many possible combinations of trade types (straddles, spreads, butterflies, etc) and strikes that it seems impractical to brute-force search.&lt;/p&gt;&#xA;" OwnerUserId="18968" LastEditorUserId="18968" LastEditDate="2017-01-22T23:09:30.100" LastActivityDate="2017-01-22T23:09:30.100" Title="How to find the ideal options trade given certain return distribution?" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;risk&gt;&lt;portfolio-management&gt;&lt;finance&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32037" PostTypeId="1" AcceptedAnswerId="32039" CreationDate="2017-01-22T21:55:59.830" Score="4" ViewCount="3337" Body="&lt;p&gt;In most option pricing textbooks, time to maturity is given as a convenient figure such as 6 months (T=0,5).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice how do you effectively calculate time to maturity given today's date and the expiration date? Knowing that there are about 252 trading days in one year, do you consider T as the ratio between the number of trading days between &quot;today&quot; and the expiration date over 252?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; a related question (and answer) can be found here: &lt;a href=&quot;https://quant.stackexchange.com/questions/3205/ways-of-treating-time-in-the-bs-formula&quot;&gt;Ways of treating time in the BS formula&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9249" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2017-01-23T17:19:37.563" Title="When pricing options, which day counting conventions should be used to calculate time to maturity?" Tags="&lt;option-pricing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32038" PostTypeId="1" CreationDate="2017-01-22T22:33:53.547" Score="-1" ViewCount="225" Body="&lt;p&gt;In a recent book I read, the author mentioned the terminal condition &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathop {\lim }\limits_{t \to T} V(S,t) = \max \left\{ {X - S,0} \right\}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt; This is intuitive to understand. Then he defines $$\tau  \equiv T - t$$ and when $r&amp;gt;0$, the terminal condition above can be simplified as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathop {\lim }\limits_{\tau  \to 0} V(S,\tau) = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in the range $${\Sigma _1} = \left\{ {(S,\tau )|B(\tau ) \le S &amp;lt;  + \infty ,0 \le \tau  \le T} \right\}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is not so intuitive . How can the value of the option be equal to zero in this case?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;@Update: The book is &quot; Homotopy Analysis Method&#xA;in Nonlinear Differential&#xA;Equations&quot; p. 432&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$B(\tau ) $= optimal exercise boundary&lt;/p&gt;&#xA;" OwnerUserId="26222" LastEditorUserId="26262" LastEditDate="2017-01-26T12:29:01.100" LastActivityDate="2017-01-26T12:29:01.100" Title="Terminal Condition for American Put Option" Tags="&lt;american-options&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="32039" PostTypeId="2" ParentId="32037" CreationDate="2017-01-22T22:59:07.333" Score="2" Body="&lt;p&gt;There are different ways to define your clock. No matter how you do it, the key is that you use the same one for the calibration of your model to market data and for pricing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider for example the Black-Scholes model. When calibrating the model to the market prices of European plain vanilla options, you obtain the generally strike and time-to-maturity dependent implied volatility $\sigma_{\text{IV}}(T, K)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let $f: \mathbb{R}_+ \rightarrow \mathbb{R}_+$ be a non-decreasing function that that maps actual time into trading time. To get the intuition think of it as mapping a maturity instant into a year fraction - so something similar to the day counter that you refer to in your question. To not overcomplicate things, lets for the moment assume that rates are zero, i.e. $r = 0$. You can then write the Black-Scholes formula in terms of the clock as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;V_0 = \phi \left\{ S_0 \mathcal{N} \left( \phi d_+ \right) - K \mathcal{N} \left( \phi d_- \right) \right\},&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;d_\pm = \frac{1}{\sigma \sqrt{f(T)}} \left( \ln \left( \frac{S_0}{K} \right) \pm \frac{1}{2} \sigma^2 f(T) \right)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and $\phi \in \{ -1, +1 \}$ indicates a put or call option. The diffusion coefficient $\sigma$ never appears alone but only as the total volatility-to-maturity $\sigma \sqrt{f(t)}$. Using the trading time clock, you immediately see that different choices for $f$ yield different implied volatilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the real world, you model $f$ to incorporate things like weekends and special events like earning announcements or macroeconomic news. Again - the key is to be consistent in calibration and pricing. A well-defined clock allows you to obtain implied volatilities that are relatively stable as time passes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you directly receive implied volatility quotes instead of prices from a data vendor, it is crucial to know under which clock (usually a day count convention) these were computed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a reference for further reading: See Chapters 4.3 and 4.4 in Clark (2011) &quot;Foreign Exchange Option Pricing - A Practitioner's Guide&quot;.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-01-22T23:06:19.000" LastActivityDate="2017-01-22T23:06:19.000" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32040" PostTypeId="1" CreationDate="2017-01-22T23:54:53.443" Score="1" ViewCount="154" Body="&lt;p&gt;I am trying to understand how low-rank approximation techniques such as PCA, factor analysis, total least squares, orthogonal regression, etc could be used in portfolio optimisation. Say I have a portfolio of n assets, I could break these down into 2-3 principal components (using PCA) achieving say 95% of the variance. Why would this be useful though? (Other than reduced time complexity of subsequent calculations). It would tell me that asset A is important in my portfolio since I am able to see the correlation between assets via the covariance/correlation matrix. I could also use it in fundamental analysis to determine which factors drive the price of a stock, by looking at the company's revenue, EBITDA, p/e, rev growth, etc. Despite this, I don't see how PCA or other low-rank approximation fundamentally improve portfolio optimisation beyond what the covariance matrix does. Are there any uses for example in forecasting of the stock price? Also, how do different low-rank approximation techniques differ in their approximation accuracy? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot.&lt;/p&gt;&#xA;" OwnerUserId="26223" LastEditorUserId="20795" LastEditDate="2017-01-23T21:28:06.187" LastActivityDate="2017-01-23T21:28:06.187" Title="Low-rank approximation techniques for portfolio optimisation" Tags="&lt;trading&gt;&lt;portfolio-optimization&gt;&lt;forecasting&gt;&lt;pca&gt;&lt;principal-components&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32041" PostTypeId="1" CreationDate="2017-01-23T00:53:29.723" Score="1" ViewCount="163" Body="&lt;p&gt;Let $S_1$ and $S_2$ be two risky assets. The market also has a riskfree asset, and only one driving Wiener process. The parameters are as in the Black SCholes, with $\mu_1, \mu_2, \sigma_1, \sigma_2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS_i = \mu_1S_idt + \sigma_i S_idW^P$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wish to price the option at time $t$ which gives us $1$ if $S_1 &amp;gt; S_2$ at time $T$, otherwise $0$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My method: calculate $S_1(T) - S_2(T)$ explicitly. Then we need the $Q$-probability that this is strictly positive. However, assuming this is the correct method, I get stuck on calculating this $Q$-probability. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I got an answer, but it depends on the cumulative distribution of a normal distribution. Does this look right guys?&lt;/p&gt;&#xA;" OwnerUserId="26224" LastActivityDate="2017-01-23T08:48:56.727" Title="How to price options that depend on two assets in continuous time?" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32042" PostTypeId="1" AcceptedAnswerId="32067" CreationDate="2017-01-23T02:40:19.013" Score="8" ViewCount="834" Body="&lt;p&gt;I'm interested in portfolio optimization and there's a lot of modelizations out there using duality theory. Since I didn't study that yet, I searched around the net to understand what it means and kind of did. But I still have one issue : what does duality theory gives us ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I mean, from where I stand, here is how I see it : We have a &quot;primal&quot; optimization problem with some variables and some constraints, we then &quot;build&quot; a dual problem with new variables (each old constraint -&gt; one new variable) and new contraints. Then, in order to find a solution for our original problem, we solve the second one, the dual one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is : What characteristics does the dual problem have that makes it simpler or more useful to solve ? What's the differences between the primal problem and the dual one ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, if anyone has a good reference for the course, that explains what's behind it and gives practical examples, I would very much like to have it !&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you all.&lt;/p&gt;&#xA;" OwnerUserId="26218" LastEditorUserId="20795" LastEditDate="2017-01-24T11:38:25.800" LastActivityDate="2017-01-24T14:32:56.333" Title="What's the importance of duality theory in portfolio optimization?" Tags="&lt;optimization&gt;&lt;portfolio-optimization&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="32043" PostTypeId="2" ParentId="32040" CreationDate="2017-01-23T03:36:32.857" Score="2" Body="&lt;p&gt;I don't think that PCA works how you think it does. In coming up with orthogonal vectors (i.e. the eigenvectors of the covariance matrix), Principal Component Analysis generally ends up with each component as a linear combination of your original assets. So while you are reducing the dimension, it doesn't necessarily mean that you end up with fewer assets in the pool. My understanding is that the benefit of performing PCA for Asset Management is two-fold:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first was already mentioned: convenience in working with an otherwise costly covariance matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second is that the components output by PCA are orthogonal, so you have a diagonal covariance matrix and uncorrelated bundles of assets. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit: Just saw the second question, &quot;How do different approximation techniques differ in their approximation accuracy&quot; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the data lives on or near a linear subspace then PCA (or MDS, multi-dimensional scaling) should work perfectly well. If the data lives in a non-linear manifold then you might consider some other dimension reduction technique -- Locally Linear Embedding, Stochastic Neighborhood Embedding, and isoMap come to mind. The primary benefit of PCA (and MDS) is that they are exceptionally fast.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as approximation accuracy goes, it depends on what you're looking for. PCA attempts to account for a pre-specified amount of variance using fewer dimensions. MDS (and most of the others) attempt to maintain local structure in the data; i.e. points that are close in high-dimensional space are also close in low-dimensional space. Both have their uses provided you're clear on what you're looking for.&lt;/p&gt;&#xA;" OwnerUserId="26207" LastEditorUserId="26207" LastEditDate="2017-01-23T03:49:12.417" LastActivityDate="2017-01-23T03:49:12.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32044" PostTypeId="2" ParentId="32041" CreationDate="2017-01-23T08:48:56.727" Score="1" Body="&lt;p&gt;You should work in the numeraire of $S_1$ (if it is a tradable which doesn't pay dividends). In this numeraire $S_1$ has no drift and $S_2/S_1$ is a martingale. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should get a digital option on a log normal process which actually has a pricing formula in terms of the cumulative distribution of a normal distribution. &lt;/p&gt;&#xA;" OwnerUserId="6249" LastActivityDate="2017-01-23T08:48:56.727" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32045" PostTypeId="1" CreationDate="2017-01-23T09:30:48.257" Score="0" ViewCount="867" Body="&lt;p&gt;How do you implement industry neutralization in S&amp;amp;P top 3000/top200?&#xA;Market neutralization is straightforward but how do you assigns weights to the industries and then to stocks in it?&lt;/p&gt;&#xA;" OwnerUserId="26228" LastActivityDate="2017-03-24T11:06:12.767" Title="How to implement industry neutralization?" Tags="&lt;market-neutral&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32047" PostTypeId="2" ParentId="32045" CreationDate="2017-01-23T10:32:01.843" Score="1" Body="&lt;p&gt;For classifying companies into industries, a common approach is to use a benchmark classification like the &lt;a href=&quot;https://en.wikipedia.org/wiki/Industry_Classification_Benchmark&quot; rel=&quot;nofollow noreferrer&quot;&gt;Industry Classification Benchmark&lt;/a&gt; or &lt;a href=&quot;https://en.wikipedia.org/wiki/Thomson_Reuters_Business_Classification&quot; rel=&quot;nofollow noreferrer&quot;&gt;Thomson Reuters Business Classification&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These are generally multi-level classifications, from less granular to more granular. For example, the first level of the ICB (the &quot;Industry&quot; level) has categories Oil and Gas, Basic Materials, Consumer Goods etc. The fourth level (&quot;Subsector&quot;) has Oil Equipment and Services, Pipelines, Renewable Energy Equipment, Alternative Fuels etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These classifications are generally binary, but for some large companies it may make sense to classify them across multiple industries or sectors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To implement industry neutrality, one way is to consider your $n\times 1$ vector of positions $x$ (where $n$ is the number of stocks) and a $m\times n$ matrix $A$ (where $m$ is the number of industries) where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;A_{ij} = \begin{cases}&#xA;1 &amp;amp; \textrm{stock j is a member of industry i} \\&#xA;0 &amp;amp; \textrm{otherwise}&#xA;\end{cases}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have industry neutrality if&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;Ax = 0&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which you can use a constraint in your portfolio optimizer, or otherwise implement with heuristics.&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2017-01-23T10:32:01.843" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32048" PostTypeId="2" ParentId="32032" CreationDate="2017-01-23T10:48:48.190" Score="0" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;i'd say you are about right&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;the formula you gave shows the cashflow you receive, per unit notional, on the ois leg of an ois swap in 3 months time.&#xA;The ois rate is a rate whose term is just 1 day.&#xA;The 3m ois rate is actually a Swap rate , where you pay a fixed rate , and receive ois with daily compounding.  the value of this 3m ois swap rate can be observed in the OTC market.&#xA;Similarly for other ois swap rates.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;i am not sure exactly what you want to calculate?  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="17348" LastActivityDate="2017-01-23T10:48:48.190" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="32050" PostTypeId="2" ParentId="32038" CreationDate="2017-01-23T12:20:51.883" Score="0" Body="&lt;p&gt;It looks like r = S - X, or the strike price - stock price. Basically, if r &gt; 0, the put is out of the money and becomes worthless as it goes to expiration.&lt;/p&gt;&#xA;" OwnerUserId="26022" LastEditorUserId="26022" LastEditDate="2017-01-24T02:52:50.600" LastActivityDate="2017-01-24T02:52:50.600" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="32051" PostTypeId="2" ParentId="31919" CreationDate="2017-01-23T13:04:21.400" Score="0" Body="&lt;p&gt;Thanks for your Response SoltionK.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you be more precise on the Bloomberg Topic. If I could, f.e. find MBS Prices, would it be possible to extract prepayment rates on that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Despites this, I found following pages, but I could not verify, if this is the data I'm looking for:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cprcdralpha.com/alpha/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.cprcdralpha.com/alpha/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.fanniemae.com/portal/funding-the-market/data/loan-performance-data.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.fanniemae.com/portal/funding-the-market/data/loan-performance-data.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What do u think?&lt;/p&gt;&#xA;" OwnerUserId="24804" LastActivityDate="2017-01-23T13:04:21.400" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32052" PostTypeId="1" CreationDate="2017-01-23T15:17:35.380" Score="5" ViewCount="7694" Body="&lt;p&gt;I don't really understand the difference. Shouldn't roll down and pull to par be the same technically? If a bond is trading as a discount it &quot;increases&quot; in value because everyday gets closer to par, and it rolls into another issue which has gotten closer? I feel that pull to par is incorporated within roll down because of this.&lt;/p&gt;&#xA;" OwnerUserId="26232" LastActivityDate="2017-01-23T19:00:38.807" Title="What is the difference between pull to par and roll down in both mathematics and conceptual?" Tags="&lt;fixed-income&gt;&lt;finance&gt;&lt;finance-mathematics&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32053" PostTypeId="1" CreationDate="2017-01-23T16:39:45.863" Score="2" ViewCount="685" Body="&lt;p&gt;I'm trying to model GARCH volatility on electricity prices. Typically the first step is to use prices to obtain log returns to make them stationary. I have encountered a small problem however: electricity prices can go negative. So returns defined as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{array}{cc}&#xA;r_t:=\log(P_t / P_{t-1})&#xA;\end{array}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;will produce some undefined values. I have gotten around it by using differences &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{array}{cc}&#xA;r_t:=P_t - P_{t-1},&#xA;\end{array}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but I'm wondering if there is a better method out there.&lt;/p&gt;&#xA;" OwnerUserId="26234" LastEditorUserId="19645" LastEditDate="2017-01-26T12:28:51.470" LastActivityDate="2021-04-23T11:06:40.657" Title="How do you define returns when price may be negative (electricity price)?" Tags="&lt;returns&gt;&lt;commodities&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32054" PostTypeId="1" CreationDate="2017-01-23T17:29:38.457" Score="1" ViewCount="176" Body="&lt;p&gt;From this article, &lt;a href=&quot;http://www.zerohedge.com/news/2017-01-22/oil-speculators-have-never-been-long&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.zerohedge.com/news/2017-01-22/oil-speculators-have-never-been-long&lt;/a&gt;, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;I get what you're saying about the price risk which is always the danger of shorting crude oil it's always a bit of a negative gamma trade.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How is shorting crude oil (futures) a negative gamma trade? Im assuming there is some shadow gamma there somewhere.&lt;/p&gt;&#xA;" OwnerUserId="11723" LastActivityDate="2017-01-23T17:29:38.457" Title="Why is shorting (oil) futures a bit of a negative gamma trade?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;futures&gt;&lt;trading&gt;&lt;financial-engineering&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32055" PostTypeId="2" ParentId="32052" CreationDate="2017-01-23T17:40:15.090" Score="12" Body="&lt;p&gt;Pull-to-par says that the bond's price will gradually converge toward par (100% of face value) &lt;em&gt;when yield is unchanged&lt;/em&gt;. This process is also known as &lt;em&gt;accretion&lt;/em&gt; for a bond trading at a discount (since its price gradually goes higher toward par) and &lt;em&gt;amortization&lt;/em&gt; for a bond trading at a premium (since its price gradually declines toward par). Pull-to-par says nothing about the shape of the yield curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rolldown is all about the shape of the yield curve. If the yield curve is upward sloping, you &quot;roll down&quot; the yield curve (i.e., yield goes down) as time passes, resulting in capital gains.  If yield curve is downward sloping, you &quot;roll up&quot; the yield curve with the passage of time (i.e., yield goes up).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a 10-year zero coupon bond trading at a yield of 10%. Its initial price is $100 / (1 + 10\%)^{10} = 38.55$ (assuming annual compounding). After a year, its price, assuming the same yield, becomes $100 / (1 + 10\%)^9 = 42.41$. This increase is price is pull-to-par at work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now assume that the yield curve is upward sloping, such that the 9-year yield is 9%. Further, let's assume that the yield curve did not change over the year. Even though the yield curve is unchanged, because our original 10-year zero coupon bond has rolled down to the 9-year point, its yield is now 9% instead of 10%. The price is therefore $100 / (1 + 9\%)^9 = 46.04$. This is rolldown at work.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2017-01-23T17:40:15.090" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32056" PostTypeId="2" ParentId="32052" CreationDate="2017-01-23T18:49:08.900" Score="12" Body="&lt;p&gt;Pull-to-par just says that a bond's (clean) price will converge towards its face value as the bonds approaches maturity. There is nothing really interesting about pull-to-par - a bond's (clean) price has to converge to its face value, because a bond with just a few days to maturity is essentially a short-term cash deposit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Look at it this way - the price of an $n$-year zero coupon bond is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;p_n = 100/(1+y)^n\approx 100 \times (1 - ny)&#xA;$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The approximation is okay for small $n$, i.e. when we are close to maturity. This clearly converges to 100 as $n$ approaches zero, no matter what the yield is. This is pull-to-par.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Roll-down is a statement about the capital appreciation or depreciation on a bond, assuming that the shape of the yield curve doesn't change. For example, say that you have the yield curve below (for simplicity, say it is the yield curve for zero coupon bonds).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/plL0s.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/plL0s.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The yield of the five-year bond is 4.08%, and so its price is $100 / (1.048)^5 = \$79.10$. In a years time, assuming that the yield curve is unchanged, it will be a four-year bond, with a yield of 3.7%, so its price will be $100 / (1.037)^4 = \$86.47$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore the return from holding the bond, assuming that its yield doesn't change, is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;R = \frac{86.47}{79.10} - 1 = 9.32\%&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this is much higher than the bond's yield, which is $4.08\%$! The difference between the bond's yield, and the expected return assuming no change in the yield curve, is the &lt;em&gt;roll-down&lt;/em&gt;. In this case the roll-down is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;9.32\% - 4.08\% = 5.25\%&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so the roll-down can be a very significant contributor to the return on a bond, especially in environments with steep yield curves and low yield volatility.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;One way to understand carry, yield and roll-down is to look at the return on zero-coupon bonds. If the yield curve for a bond maturiting in $n$ years, at time $t$ is $y_{n,t}$ then the prices of zero coupon bonds are&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;p_{n,t} = \frac{1}{(1 + y_{n,t})^n}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One year later, at $t+1$, that bond is priced using the yield $y_{n-1,t+1}$ (because after one year has passed, the bond has a tenor one year shorter) so its price is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;p_{n-1,t+1} = \frac{1}{(1 + y_{n-1,t+1})^{n-1}}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The return from holding the bond over the year is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align}&#xA;R &amp;amp; = \frac{\frac{1}{(1 + y_{n-1,t+1})^{n-1}}}{\frac{1}{(1 + y_{n,t})^n}} - 1 \\&#xA;  &amp;amp; = \frac{(1 + y_{n,t})^n}{(1 + y_{n-1,t+1})^{n-1}} - 1 \\&#xA;  &amp;amp; \approx ny_{n,t} - (n-1)y_{n-1,t+1} \\&#xA;  &amp;amp; = y_{n,t} + (n-1)(y_{n,t} - y_{n-1,t}) - (n-1)(y_{n-1,t+1}-y_{n-1,t}) \\&#xA;  &amp;amp; = y_{n,t} + (n-1)(y_{n,t} - y_{n-1,t}) - (n-1)\Delta y_{n-1,t}&#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first term is the &lt;em&gt;yield return&lt;/em&gt;, the second is the &lt;em&gt;roll-down return&lt;/em&gt; and the final term is the &lt;em&gt;duration return&lt;/em&gt;, i.e. the return due to changes in yield between $t$ and $t+1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at the roll-down return, you can see that roll-down is larger for bonds that have higher duration (i.e. larger $n$) and larger for bonds that are on a steep part of the yield curve (i.e. $y_{n,t} - y_{n-1,t}$ is large).&lt;/p&gt;&#xA;" OwnerUserId="924" LastEditorUserId="924" LastEditDate="2017-01-23T19:00:38.807" LastActivityDate="2017-01-23T19:00:38.807" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32057" PostTypeId="1" AcceptedAnswerId="32058" CreationDate="2017-01-23T18:58:06.870" Score="2" ViewCount="431" Body="&lt;p&gt;Under the CEV model the stock price has the following dynamics:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS_t=\mu S_tdt+\sigma S_t^\gamma dW_t$, where $\sigma\geq0, $ $\gamma\geq0$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to Wikipedia, if $\gamma &amp;lt;1$ the volatility of the stock increases as the price falls. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But why is this true? Shouldn't be the exponent negative in order to have an inverse relationship between stock price and the volatility term?&lt;/p&gt;&#xA;" OwnerUserId="17775" LastActivityDate="2019-05-12T17:23:04.580" Title="Confusion about CEV model" Tags="&lt;implied-volatility&gt;&lt;local-volatility&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32058" PostTypeId="2" ParentId="32057" CreationDate="2017-01-23T19:02:57.570" Score="4" Body="&lt;p&gt;Note that&#xA;\begin{align*}&#xA;dS_t = S_t\left(\mu dt+\sigma S_t^{\gamma-1} dW_t \right).&#xA;\end{align*}&#xA;That is, the volatility function is defined by $\sigma S_t^{\gamma-1}$. Then, if $\gamma &amp;lt;1$, the volatility increases as the price falls.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2017-01-23T19:02:57.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32059" PostTypeId="1" AcceptedAnswerId="32069" CreationDate="2017-01-23T19:22:53.017" Score="0" ViewCount="122" Body="&lt;p&gt;Maybe the question I'm asking doesn't make sense-- but this is something I've wondered about since I learned about the Fed in high school.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The media typically talks about Fed interest rate changes as discrete &quot;hikes&quot;, as if the rate instantly changes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The graph in &lt;a href=&quot;http://www.npr.org/sections/thetwo-way/2016/12/14/505547771/interest-rate-hike-expected-wednesday-investors-await-move-by-federal-reserve&quot; rel=&quot;nofollow noreferrer&quot;&gt;this article&lt;/a&gt; (from NPR) depicts the rate changes as discrete (i.e. discontinuous). But &lt;a href=&quot;http://www.tradingeconomics.com/united-states/interest-rate&quot; rel=&quot;nofollow noreferrer&quot;&gt;this graph&lt;/a&gt; (included below) depicts the rate as continuous.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/W6npJ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/W6npJ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously the actual rate changes aren't continuous if you zoom in enough, but how discontinuous are they? And why wouldn't the Fed prefer continuous adjustments?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By announcing significant rate changes ahead of time, it seems like the Fed is just creating a short-lived information arbitrage opportunity for more-liquid traders that are set up to exploit it. Am I off-track or is this the right way to think about it? &lt;/p&gt;&#xA;" OwnerUserId="26236" LastActivityDate="2017-01-24T20:50:57.530" Title="Why can't/doesn't the Fed adjust the federal funds interest rate continuously?" Tags="&lt;interest-rates&gt;&lt;banks&gt;&lt;continuous-time&gt;&lt;central-banking&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32060" PostTypeId="1" CreationDate="2017-01-23T22:01:46.897" Score="1" ViewCount="39" Body="&lt;p&gt;Are there any introductions that show an academic proof or quantitative process for determining the proper asset allocations for a glide-path in a target date fund?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been trying to find something on the topic but it looks like a bunch of arbitrary asset allocations based on some made up &quot;risk aversion&quot; measure. &lt;/p&gt;&#xA;" OwnerUserId="19473" LastActivityDate="2017-01-23T22:01:46.897" Title="Target date funds - glide path quantitative foundations?" Tags="&lt;asset-allocation&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32061" PostTypeId="1" CreationDate="2017-01-24T01:16:50.480" Score="0" ViewCount="60" Body="&lt;p&gt;For the ADI in numerical method&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{U^{n+1/3}-U^n}{k/3} = \Delta^2_x U^{n+1/3} + \Delta^2_y U^n + \Delta^2_z U^{n+2/3}$$&#xA;$$....$$&#xA;$$....$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;don't like $U^{n+1/2} = \dfrac 1 2 (U^{n+1}+U^n),$ I can't find the definition of $U^{n+1/3},U^{n+2/3},$ can some one tell me he definition or it is just a intermedia variables?&lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-01-24T01:16:50.480" Title="what is the meaning of $U^{n+1/3}$ ADI method" Tags="&lt;numerical-methods&gt;&lt;finite-difference-method&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32063" PostTypeId="2" ParentId="32005" CreationDate="2017-01-24T13:40:38.903" Score="2" Body="&lt;p&gt;No need to overcomplexify things. The CVA gives you simply the amount that you expect to lose if and when your counterparty defaults, discounted to today. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, you are buying an option. So, you already paid a premium but still expect to receive the payoff at expiry. In a sense, your counterparty owes you the payoff and you can lose this amount in case of a default. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming the LGD is constant, and that the counteparty default probabilities and the call value are independant, the CVA can be expressed as follows:&#xA;$$&#xA;\mathrm{CVA} = LGD \int_0^T \mathbb{E} [ D(0,t) c(t,T) ] dPD(0,t)$$&#xA;Which can be discretized as follows ($t_0 = 0,\dots \ , t_n = T$):&#xA;$$&#xA;\mathrm{CVA} \approx LGD \sum_{i=0}^{n-1} \mathbb{E} [ D(0,t_i) c(t_i,T) ] PD(t_i,t_{i+1}) \\&#xA;$$&#xA;So it is equal to the sum of the expected call value at each time-step (until its expiry), weighted by the default probability of the counterparty during this time-step.&lt;/p&gt;&#xA;" OwnerUserId="26242" LastEditorUserId="26242" LastEditDate="2017-02-01T17:09:35.580" LastActivityDate="2017-02-01T17:09:35.580" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32065" PostTypeId="2" ParentId="21853" CreationDate="2017-01-24T14:00:05.087" Score="1" Body="&lt;p&gt;What GARP considered for the question is a &lt;em&gt;first-to-default&lt;/em&gt; CVA, meaning that the bank looks at what it expects to lose if its counterparty defaults before it does. In this case the formula would be: $\mathrm{CVA}=\left(Spread_{Counterparty} - Spread_{Bank} \right) \times EE$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a sense, the bank &quot;does not care&quot; about what happens after it defaults. So, all other things bein equal, the likelier the bank's default, the lesser its CVA with the counterparty.&lt;/p&gt;&#xA;" OwnerUserId="26242" LastActivityDate="2017-01-24T14:00:05.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32066" PostTypeId="2" ParentId="24413" CreationDate="2017-01-24T14:11:41.063" Score="4" Body="&lt;p&gt;CVA is a price. Just like any price, you compute its sensitivities (greeks) and then use financial products to bring them as close to zero as possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's not possible to derive a hedging strategy just by looking at the CVA figure,  it's like asking what the hedging strategy of a product is if its price is USD 1M... You need the CVA greeks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The particularity of CVA is that you always have a credit component (cf. &lt;a href=&quot;https://en.wikipedia.org/wiki/Credit_valuation_adjustment&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Credit_valuation_adjustment&lt;/a&gt;) and this one can be hedged using CDS as Olaf said.&lt;/p&gt;&#xA;" OwnerUserId="26242" LastActivityDate="2017-01-24T14:11:41.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32067" PostTypeId="2" ParentId="32042" CreationDate="2017-01-24T14:32:56.333" Score="6" Body="&lt;p&gt;That's a pretty heavy question for this forum, and its answer is worthy of a semester-long discussion in a university course. The short answer is that (for convex optimization) the dual problem can give you a lower bound on your objective function (for minimization). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, the values of the dual variables are related to the sensitivity of your objective function to your constraint values. Lastly, the nonzero dual variables indicate which primal constraints are &quot;tight&quot;. This is known as &quot;complementary slackness&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The dual problem is not necessarily any easier to solve than the primal, but it does give good information to solvers. LP solvers in particular will track the solution to both problems simultaneously. Then, since the dual problem gives a bound on the primal objective value, the solver has some idea of how close it is to a global optimum. In fact, for a linear program, the primal and dual have identical optima, so virtually all modern LP solvers use it to at least track solution progress.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a more in-depth discussion of the topic, I encourage you to pick up any linear/convex optimization text. I personally like &quot;Introduction to linear optimization&quot; by Bertsimas and Tsitsiklis. &lt;/p&gt;&#xA;" OwnerUserId="8097" LastActivityDate="2017-01-24T14:32:56.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32068" PostTypeId="2" ParentId="18294" CreationDate="2017-01-24T15:18:06.813" Score="0" Body="&lt;p&gt;Intuitively, I think you will end up with average beta over the period. This is like doing panel regression by first running cross sectional regression and then running time series regression.&lt;/p&gt;&#xA;" OwnerUserId="26245" LastActivityDate="2017-01-24T15:18:06.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32069" PostTypeId="2" ParentId="32059" CreationDate="2017-01-24T15:42:59.347" Score="2" Body="&lt;p&gt;The Fed (under the Yellen regime) has always stated that any adjustments to the Federal Funds rate are &quot;data dependent.&quot; These data points (CPI inflation, inflation expectations, non-farm payrolls, GDP, et cetera) are only available on a monthly or quarterly basis, (depending on the print) which would cause them to have to make an uninformed decision if the FOMC met more frequently than the current 6 weeks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remember that the Fed has the dual-mandate of moderating inflation and maintaining maximum employment. Both of these goals require economic data that is simply not available on a daily basis. Even if it were, given the Fed's long-term horizon, reacting on a daily, weekly or monthly basis would likely to cause them to become too speculative. Moving this quickly would also be self-defeating, as CEOs/market participants would likely begin to base their opinions on the Fed's actions, creating a circular issue. When viewed from this perspective, the ability to adjust rates every month and a half is quite sufficient from a reactionary standpoint, especially when adjustments can be made in any magnitude deemed necessary (something oft-forgotten since the financial crisis).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as the ability for arbitrageurs to profit off announced rate changes, it's important to take into account how far in advance the Yellen regime has announced their &lt;em&gt;expected&lt;/em&gt; hikes. During the two hikes since the financial crisis, the expectation was announced at the prior FOMC meeting; the resultant decision barring any unforeseen shocks or degradation of economic data. This caused a hike to be largely priced-in both times, limiting any major profits (and eliminating any risk-free ones). The volatility in equity and fixed income markets directly following an announcement is also quite high, meaning even the most-liquid traders will still need to endure a degree of speculation.&lt;/p&gt;&#xA;" OwnerUserId="17742" LastEditorUserId="17742" LastEditDate="2017-01-24T20:50:57.530" LastActivityDate="2017-01-24T20:50:57.530" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32070" PostTypeId="2" ParentId="24413" CreationDate="2017-01-24T15:49:14.607" Score="4" Body="&lt;p&gt;To continue from uness' answer (edit: just seen the OP was very old, but will leave here anyway!) . The greeks will be every element of market risk to which the the CVA is sensitive. Writing in words for celerity:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A CVA is a credit linked option on the underlying instrument. You are sensitive to the credit default- (specifically the swap obligation payment failure)- contingent +ve mark to market of the instrument, hence it is a credit linked option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the CVA on a receiver swap (receive fixed versus float). you are sensitive to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;interest rates (rates delta)&lt;/li&gt;&#xA;&lt;li&gt;credit default intensity (credit delta)&lt;/li&gt;&#xA;&lt;li&gt;interest rate vol (due to optional asymmetric exposure profile)&lt;/li&gt;&#xA;&lt;li&gt;credit vol (modelled using stochastic intensity)&lt;/li&gt;&#xA;&lt;li&gt;credit - interest rate correlation (if rates are low with credit intensity high your CVA increases naturally, so you are short this correlation on this position, and in this case short credit and interest rate vol).&lt;/li&gt;&#xA;&lt;li&gt;there is also potentially material credit / rates gamma. You would probably be short credit gamma (the wider the intensity, the more the risk is priced in), much as you would in selling a CDS, depending on potency of correlation.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So - the deltas can be hedged with linear instruments, credit vegas will also be partially hedged with CDS (buying a CDS is short credit gamma), rates vegas are hedgeable. Credit-rates correlation, well, you probably just wear that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just a quick verbal overview, but hope that helps.&lt;/p&gt;&#xA;" OwnerUserId="19239" LastEditorUserId="19239" LastEditDate="2017-01-24T15:55:19.000" LastActivityDate="2017-01-24T15:55:19.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32073" PostTypeId="2" ParentId="24413" CreationDate="2017-01-24T19:04:28.143" Score="1" Body="&lt;p&gt;This presentation from Citi might help a bit regarding CVA hedging. If you scroll through you will find some examples which show their hedge structures (sic. suggestions). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.boj.or.jp/announcements/release_2010/data/fsc1006a5.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.boj.or.jp/announcements/release_2010/data/fsc1006a5.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Me&lt;/p&gt;&#xA;" OwnerUserId="20172" LastActivityDate="2017-01-24T19:04:28.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32074" PostTypeId="1" CreationDate="2017-01-24T19:05:09.463" Score="2" ViewCount="141" Body="&lt;p&gt;Say I have a wiener process with $X(0) = X_0&amp;gt;0$ and the dynamics&#xA;\begin{equation}&#xA;dX(t) = &#xA;\begin{cases}&#xA;-\mu dt + \sigma X(t) dW(t)^{\mathbb{Q}} &amp;amp; \mathrm{for\ } X(t)&amp;gt;0\\&#xA;0 &amp;amp; \mathrm{otherwise}\\&#xA;\end{cases}&#xA;\end{equation}&#xA;Where $\mu \geq 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What can I say about the expected value of $E^{\mathbb{Q}}[X(T)]$ as $T \to \infty$? Naturally one would expect $X=0$ to happen eventually, but is it almost surely so?&lt;/p&gt;&#xA;" OwnerUserId="24306" LastEditorUserId="19663" LastEditDate="2017-01-25T07:53:03.557" LastActivityDate="2017-01-25T07:53:03.557" Title="Expected value of a wiener process on an infinite time horizon with a barrier" Tags="&lt;risk-neutral-measure&gt;&lt;martingale&gt;&lt;wienerprocess&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32076" PostTypeId="1" CreationDate="2017-01-24T20:02:44.170" Score="0" ViewCount="310" Body="&lt;p&gt;I'm somewhat new into the world of trading algo's, so bare with me. I've made a dataframe with 5 features say. I used preprocessing.scale to scale it. I checked the csv dump of it and it looks fine and dandy. Now, say I've just got todays open, high, low, close, volume data. I've calculated the indicators for it (used a 20 day history to get them). I'd excpect that I would have to scale these new input features so that they'd somewhat match up to what the model was trained with. How can I do that with just 1 row of numbers? Or should I scale the whole 20 day history and hope it works out close to the data scaled for training?&lt;/p&gt;&#xA;" OwnerUserId="26250" LastActivityDate="2017-02-25T06:58:47.743" Title="Scaling the data to train, then how to scale the input data?" Tags="&lt;algorithmic-trading&gt;&lt;machine-learning&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32078" PostTypeId="1" CreationDate="2017-01-24T20:04:00.947" Score="1" ViewCount="213" Body="&lt;p&gt;I am trying to do an analysis on time zones effect on intraday returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a first step, I collected hourly log returns for the past 3 years and bucketed them by hour  (so that I have 24 buckets with around 700 data points)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am now trying to see if for some hours of the day, the average log return is significantly different than 0. To do that, I performed a 1sample tstat test on each of the buckets. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any additional tests that I need to do to make sure the analysis is valid? (For each bucket, data looks normally distributed and there seems to be little autocorrelation)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for the help &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: the asset class is FX&lt;/p&gt;&#xA;" OwnerUserId="26249" LastEditorUserId="26249" LastEditDate="2017-01-25T01:14:04.183" LastActivityDate="2017-07-13T17:46:06.800" Title="Hourly Returns Statistical test" Tags="&lt;time-series&gt;" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32079" PostTypeId="2" ParentId="32078" CreationDate="2017-01-24T21:36:42.520" Score="2" Body="&lt;p&gt;You should consider adjusting your p-values for &lt;a href=&quot;https://en.wikipedia.org/wiki/False_discovery_rate#Controlling_procedures&quot; rel=&quot;nofollow noreferrer&quot;&gt;multiplicity&lt;/a&gt;. Otherwise you would expect 5% of your tests to come out significant even if the null hypothesis is true (assuming you use 5% as the significance level).&lt;/p&gt;&#xA;" OwnerUserId="20059" LastActivityDate="2017-01-24T21:36:42.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32080" PostTypeId="2" ParentId="32078" CreationDate="2017-01-24T21:36:59.807" Score="2" Body="&lt;p&gt;You would have to include a lot of variables here to actually isolate timing's effect on an index's returns. Given the most-influential variable on intraday returns is market news, this would be very, very difficult. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming you could correct for news, remember that equity returns as a whole are leptokurtic and therefore not perfectly normally-distributed. Also, the benchmarks you select for this will have to be carefully chosen for specific reasons and compared to each other just make sure you are working with an appropriate sample to begin with. You don't mention what they are or what the asset-class is, so I thought this was worth mentioning. Volume is another huge variable you're leaving out here. Markets opening and closing will also greatly affect returns. There are other things to look for as well within the data, but the fact that it's misspecified to begin with makes it a moot point, really.&lt;/p&gt;&#xA;" OwnerUserId="17742" LastEditorUserId="17742" LastEditDate="2017-07-13T17:46:06.800" LastActivityDate="2017-07-13T17:46:06.800" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32081" PostTypeId="2" ParentId="20924" CreationDate="2017-01-24T22:50:22.573" Score="3" Body="&lt;p&gt;Yes, lots of methods are still missing in the Python wrappers (the two in your question are now available, though).  That's because the declarations in the SWIG interfaces must be kept in sync with the C++ library manually; we make sure that they don't break as the library evolves, but other than that, the time we can give to this is limited and new stuff is only being added when someone needs it and does the work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case you want to give it a try, you can have a look at &lt;a href=&quot;http://www.implementingquantlib.com/2016/09/quantlib-and-swig.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.implementingquantlib.com/2016/09/quantlib-and-swig.html&lt;/a&gt;. It explains the reasons for some of the quirks of the wrappers, and hopefully will give you some general directions.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2017-01-24T22:50:22.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32083" PostTypeId="2" ParentId="21275" CreationDate="2017-01-25T01:31:16.920" Score="2" Body="&lt;p&gt;Consider industry returns, industry returns tend to move together due to many factors - technological innovation, regulation, etc - and this common variation can be captured by a factor. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, industry factors are not priced. Why? What matters is  risk (which I will define as covariation of returns with something that matters to the investor), as an investor I can invest in multiple industries and not have to worry about any one in particular. Competition among speculative investors will mean that I won't be compensated for this diversifiable risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, even if I buy stocks in multiple industries they will have some undiversifable common variation - like the market factor - which is the priced part. &lt;/p&gt;&#xA;" OwnerUserId="26256" LastActivityDate="2017-01-25T01:31:16.920" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32087" PostTypeId="2" ParentId="26173" CreationDate="2017-01-25T06:18:59.613" Score="1" Body="&lt;p&gt;Interactive Brokers hosted a webinar on Nov. 10 2016 about Implement Algo Trading coded in Python using Interactive Brokers API. The presenter gave a good explanation on the applicability of IBridgePy, which is an open-sourced software used to connect to Interactive Brokers C++ API for execution of python codes in live markets.The webinar is posted at youtube. &lt;a href=&quot;https://www.youtube.com/watch?v=hogXB07OJ_I&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.youtube.com/watch?v=hogXB07OJ_I&lt;/a&gt;.&#xA;You don't need to call reqPositions() in IBridgePy. The positions are saved at context.portofolio.positions in pandas dataFrame. It is pretty easy to use them in other parts of the code.&lt;/p&gt;&#xA;" OwnerUserId="25612" LastActivityDate="2017-01-25T06:18:59.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32088" PostTypeId="2" ParentId="26267" CreationDate="2017-01-25T06:22:23.290" Score="1" Body="&lt;p&gt;Interactive Brokers posted a webinar on Dec 13 2016 about using IBridgePy to connect to IB's API. &lt;a href=&quot;https://www.youtube.com/watch?v=hogXB07OJ_I&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.youtube.com/watch?v=hogXB07OJ_I&lt;/a&gt;. It is pretty easy to solve the problem you mentioned. You may check out the website of IBridgePy at www.IBridgePy.com To learn how to use it, you may refer to its documentation.&lt;/p&gt;&#xA;" OwnerUserId="25612" LastActivityDate="2017-01-25T06:22:23.290" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32089" PostTypeId="2" ParentId="31813" CreationDate="2017-01-25T11:39:15.487" Score="1" Body="&lt;p&gt;I made the next C++ conversion function.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;int Convert( Bar *bars, const Tick *tick, int tickCount, int lookback  )&#xA;{&#xA;    #define Normalize(a)    double((int((a)*m_scale+0.5))*m_point)&#xA;    unsigned int m_end = 0;&#xA;    int count = 0, i = 0;&#xA;    Bar *pBars = bars[count++];&#xA;&#xA;   // lookback - bar's timeframe in seconds&#xA;    const Tick &amp;amp;t = tick[i++];&#xA;    pBars-&amp;gt;Time = t.Time / lookback;&#xA;    pBars-&amp;gt;Time *= m_lookback;&#xA;    pBars-&amp;gt;Open = pBars-&amp;gt;Close = pBars-&amp;gt;High = pBars-&amp;gt;Low = Normalize(t.Bid);&#xA;    pBars-&amp;gt;Volume = t.Volume();&#xA;    m_end = pBars-&amp;gt;Time + lookback;&#xA;    while (i &amp;lt; tickCount)&#xA;    {&#xA;        const Tick &amp;amp;t = tick[i++];&#xA;&#xA;        if (t.Time &amp;lt; m_end)&#xA;        {&#xA;            double price = t.Bid;&#xA;&#xA;            if (pBars-&amp;gt;Low &amp;gt; price)&#xA;                pBars-&amp;gt;Low = price;&#xA;            else if (pBars-&amp;gt;High &amp;lt; price)&#xA;                pBars-&amp;gt;High = price;&#xA;&#xA;            pBars-&amp;gt;Close = price;&#xA;            pBars-&amp;gt;Volume += t.Volume();&#xA;        }&#xA;        else&#xA;        {&#xA;            pBars-&amp;gt;Close = Normalize(pBars-&amp;gt;Close);&#xA;            pBars-&amp;gt;High = Normalize(pBars-&amp;gt;High);&#xA;            pBars-&amp;gt;Low = Normalize(pBars-&amp;gt;Low);&#xA;&#xA;            pBars = bars[count++]&#xA;            pBars-&amp;gt;Time = t.Time / lookback;&#xA;            pBars-&amp;gt;Time *= m_lookback;&#xA;            pBars-&amp;gt;Open = pBars-&amp;gt;Close = pBars-&amp;gt;High = pBars-&amp;gt;Low = Normalize(t.Bid);&#xA;            pBars-&amp;gt;Volume = t.Volume();&#xA;            m_end = pBars-&amp;gt;Time + lookback;&#xA;        }&#xA;    }&#xA;    return barIdx;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="26264" LastActivityDate="2017-01-25T11:39:15.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32091" PostTypeId="1" CreationDate="2017-01-25T12:33:40.190" Score="0" ViewCount="35" Body="&lt;p&gt;I've got 5 minute interval data of the 500 most viewed tickers. I would like to try to correlate changes in place in ranking of given ticker with volatility of underlying asset (for given stock market) and see if it's meaningful predictor. Changes are measured in real time in comparison to last position in EoD rank. I wonder if the simplest approach is suitable (correlation of position delta in rank versus volatility), where any any papers about using such data ?&lt;/p&gt;&#xA;" OwnerUserId="2044" LastEditorUserId="12" LastEditDate="2017-02-17T17:09:53.533" LastActivityDate="2017-02-17T17:09:53.533" Title="Spot an activity of stock tickers" Tags="&lt;equities&gt;&lt;correlation&gt;&lt;reference-request&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32092" PostTypeId="2" ParentId="32053" CreationDate="2017-01-25T12:45:21.570" Score="0" Body="&lt;p&gt;are hyperbolic sine transformation, could also not to take log of p(t)/p(t-1),&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://mpra.ub.uni-muenchen.de/29958/1/MPRA_paper_29958.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://mpra.ub.uni-muenchen.de/29958/1/MPRA_paper_29958.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2044" LastActivityDate="2017-01-25T12:45:21.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32094" PostTypeId="1" AcceptedAnswerId="32106" CreationDate="2017-01-25T16:18:21.830" Score="2" ViewCount="1824" Body="&lt;p&gt;I need to construct a Trinomial Tree for Hull-White model.  Looking at the docs:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://quantlib.org/reference/modules.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://quantlib.org/reference/modules.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or &lt;a href=&quot;http://quantlib.org/reference/search.php?query=Trinomial&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://quantlib.org/reference/search.php?query=Trinomial&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see many modules or members that match trinomial.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would I know which to use?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or if I do something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;model = HullWhite(term_structure);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How would I know if the &lt;code&gt;TreeSwaptionEngine&lt;/code&gt; has selected a Trinomial tree and is it possible to print the tree or visualize with &lt;a href=&quot;http://www.graphviz.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Graphviz&lt;/a&gt;?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've looked at the examples &lt;a href=&quot;http://gouthamanbalaraman.com/blog/short-interest-rate-model-calibration-quantlib.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; but it is still not obvious how these map back to the C++&lt;/p&gt;&#xA;" OwnerUserId="24026" LastEditorUserId="24026" LastEditDate="2017-01-26T12:17:12.827" LastActivityDate="2017-02-25T12:20:55.740" Title="How to construct interest rate trinomial tree for Hull-White model using QuantLib and Python" Tags="&lt;python&gt;&lt;quantlib&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32095" PostTypeId="1" AcceptedAnswerId="32096" CreationDate="2017-01-25T18:09:06.070" Score="0" ViewCount="99" Body="&lt;p&gt;I'm looking at S&amp;amp;P PE ratio chart over time, and there is a large spike around 2008, and I'm trying to understand the reason for this change. Is it simply that earnings declined so sharply that P/E was quickly elevated?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For reference &lt;a href=&quot;http://www.macrotrends.net/2577/sp-500-pe-ratio-price-to-earnings-chart&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; is an example chart.&lt;/p&gt;&#xA;" OwnerUserId="26267" LastActivityDate="2017-01-25T18:30:59.457" Title="S&amp;P P/E Ratio 2008 Spike Explanation" Tags="&lt;valuation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32096" PostTypeId="2" ParentId="32095" CreationDate="2017-01-25T18:30:59.457" Score="3" Body="&lt;p&gt;Bank earnings specifically, but yes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.macrotrends.net/1324/s-p-500-earnings-history&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.macrotrends.net/1324/s-p-500-earnings-history&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26268" LastActivityDate="2017-01-25T18:30:59.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32097" PostTypeId="2" ParentId="32078" CreationDate="2017-01-25T18:36:41.433" Score="2" Body="&lt;p&gt;Agreed with @compwarrior. The Bonferroni correction, while conservative, is a reasonable way to test multiple hypotheses. Confidence regions are (to me) a more intuitive way of evaluating plausible values, and have a direct relationship with p-values. If what follows doesn't make sense, just consider that if zero is not in your interval than your returns are significantly different from zero&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where the (one-sided interval) t-statistic to test that the returns are greater than 0 is: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\bar{x} \pm t_{n-1}(\alpha) \sqrt{(s^2/n)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Bonferroni correction for your case (since you are testing your hypothesis on 24 data sets) would be :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\bar{x} \pm t_{n-1}(\alpha/24) \sqrt{(s^2/n)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, $\bar{x}$ are your returns, $\alpha$ is your significance level, $t_{n-1}(\alpha)$ is the t-statistic of level alpha with $n-1$ degrees of freedom, and $s$ is your sample standard deviation. &lt;/p&gt;&#xA;" OwnerUserId="26207" LastEditorUserId="26207" LastEditDate="2017-01-26T02:46:24.137" LastActivityDate="2017-01-26T02:46:24.137" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32099" PostTypeId="2" ParentId="32076" CreationDate="2017-01-25T19:11:58.193" Score="0" Body="&lt;p&gt;How do you implement a trading algorithm based on a predictive model? The algorithm is driven by a finite set of past data points, that I will call The History.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each day you observe new data in the financial markets (for example OHLC for that day). You scale this data by reference to the history that you have (for example you compare today's move to the standard deviation of historical points to conclude that &quot;today is a 2 standard deviation up  move&quot;). After this you make a prediction again with reference to historical values. Then the recently observed OHLC is added to the History File.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is up to you whether you let the history file grow indefinitely (eventually it will have some rather stale data) or whether you drop the oldest data point when you add the newest (sometimes called a moving window approach). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you trained your algo, you should have done the same thing, i.e. scale each point using only past data points (scale $x_t$ based on $x_{t-1},x_{t-2},\cdots$). Ideally the training should be done similar to the live operation, without &lt;em&gt;lookahead&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2017-01-25T19:11:58.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32100" PostTypeId="2" ParentId="31472" CreationDate="2017-01-25T19:24:30.003" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;Fit GARCH to data.&lt;/li&gt;&#xA;&lt;li&gt;Use obtained GARCH model and Monte Carlo simulation method for pricing options.&lt;/li&gt;&#xA;&lt;li&gt;Compare speed of classical and quasi-Monte Carlo algorithms.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2044" LastActivityDate="2017-01-25T19:24:30.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32101" PostTypeId="2" ParentId="31472" CreationDate="2017-01-25T19:56:15.523" Score="4" Body="&lt;p&gt;In option pricing, the entire game is fitting the skew with a fairly robust model. All the research right now is in LSV (Local Stochastic Vol) Models. Fitting these is a challenge (with PDE or Particle Methods), maybe a study on that will be ideal if you're looking for a derivatives job after.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternately, you could also test ML techniques in obtaining the vol surface (or even estimating vol models)&lt;/p&gt;&#xA;" OwnerUserId="13415" LastActivityDate="2017-01-25T19:56:15.523" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32104" PostTypeId="1" CreationDate="2017-01-26T05:34:01.090" Score="1" ViewCount="839" Body="&lt;p&gt;$&#xA;I_t = \int_0^t e^{i W_s} dWs&#xA;$&#xA;where $W_s$ is the standard brownian motion and $i$ is the complex number. Any help will be appreciated!&lt;/p&gt;&#xA;" OwnerUserId="26277" LastEditorUserId="19653" LastEditDate="2017-02-20T00:19:06.960" LastActivityDate="2017-02-20T17:48:04.923" Title="How to find the mean and variance of this stochastic process?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32105" PostTypeId="1" CreationDate="2017-01-26T06:23:56.400" Score="0" ViewCount="69" Body="&lt;p&gt;I can't understand one of the boundary conditions in Heston's model:&#xA;$$c(t,s,0) = (s-e^{-r(T-t)}K)^+$$&#xA;Why the current vol is zero can deduce such result. here $c(t,s,v)$ $s$ is current price and $v$ is current vol.&lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-01-26T06:23:56.400" Title="how to understand the zero vol condition in Heston stochastic vol model" Tags="&lt;pricing&gt;&lt;heston&gt;&lt;call&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32106" PostTypeId="2" ParentId="32094" CreationDate="2017-01-26T06:43:24.850" Score="2" Body="&lt;p&gt;Note: you can specify the mean reversion level and volatility for your HullWhite model with&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;model = HullWhite(term_structure, my_level, my_sigma);&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Once you establish your model with the &lt;code&gt;HullWhite&lt;/code&gt; constructor, there is a method you can use:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Z0SDV.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Z0SDV.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you see the &lt;code&gt;tree&lt;/code&gt; method? You will need to specify what grid you want for your lattice. The implementation for the method looks like what you're looking for:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/YGZnH.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/YGZnH.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The method returns a pointer to &lt;code&gt;Lattice&lt;/code&gt;. It defines the following methods:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;virtual void rollback(DiscretizedAsset&amp;amp;, Time to) const = 0;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This method rolls back the tree to your present date, and thus price your instrument. Please take a look at the section about Lattice in Luigi Ballabio's QuantLib book. It teaches you how to deal with lattice in QuantLib.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2017-01-26T06:43:24.850" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="32108" PostTypeId="1" CreationDate="2017-01-26T12:01:31.740" Score="1" ViewCount="49" Body="&lt;p&gt;I have constructed an adjusted Mean-Variance portfolio optimization method that optimizes the exposure in a set of X assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The portfolio works perfectly fine during normal periods (even when there are negative returns). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that I am using 2 years of data to construct the portfolio. If a crisis happens (e.g. during 2007-2009), then this affects my weights 2 years later.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/GOWOa.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/GOWOa.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Are there any known methods or techniques that I can think of to protect against such movements?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="13334" LastActivityDate="2017-01-26T12:01:31.740" Title="How to hedge a MV portfolio against crises" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;&lt;mean-variance&gt;&lt;financial-markets&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32109" PostTypeId="1" CreationDate="2017-01-26T12:18:29.920" Score="3" ViewCount="2289" Body="&lt;p&gt;Following Brigo$^1$ p.77, we can decompose the price of a swaption as a sum of Zero-Coupon bond options (Jamshidian's Trick).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To do so, the authors suggest to find $r^*$ the value of the spot rate at $t$ for which &#xA;$ \sum_{i=1}^n c_i P(t,T_i, r*)= 1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example they show this for the Vasicek Model, where $A()$ and $B()$ give the analytical ZCB Prices. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \sum_{i=1}^n  c_i A(t,T_i) e^{-B(t,T_i)r*} = 1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume we have a short-rate model for which we do &lt;strong&gt;not&lt;/strong&gt; have an analytical expression for the ZCB prices (e.g. Exponential Vasicek), how can we still find the value of $r^*$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See another $^2$ step-by-step explanation on the problem&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) &lt;a href=&quot;http://link.springer.com/book/10.1007%2F978-3-540-34604-3&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://link.springer.com/book/10.1007%2F978-3-540-34604-3&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) &lt;a href=&quot;https://papers.ssrn.com/sol3/papers2.cfm?abstract_id=2246054&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://papers.ssrn.com/sol3/papers2.cfm?abstract_id=2246054&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16376" LastActivityDate="2018-07-01T13:12:08.417" Title="Jamshidian's trick for Swaptions" Tags="&lt;options&gt;&lt;interest-rates&gt;&lt;fixed-income&gt;&lt;stochastic-calculus&gt;&lt;monte-carlo&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32110" PostTypeId="2" ParentId="18674" CreationDate="2017-01-26T12:34:50.217" Score="0" Body="&lt;p&gt;As subtly alluded in @Valtinho's answer, you should consider splitting your dataset into a training and test set. Use the training set to estimate your MA parameters. You could use, for example a grid search to find the best parameters. Usually you would optimize the absolute (and hence) relative performance. But you can get creative and try to optimize another quantity, for example drawdowns as you hint towards in your question. Note that eliminating negative returns completely is almost certainly impossible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the parameters found from the training set, you can check how the system performs out of sample, i.e. on the test set. This will give you an idea about what to expect in live trading. You may also consider adding more instruments to your backtest, both for diversification and for preventing you from overfitting your parameters on a single instrument. (Assuming your MA definition will be the same across the instruments)&lt;/p&gt;&#xA;" OwnerUserId="20059" LastActivityDate="2017-01-26T12:34:50.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32112" PostTypeId="2" ParentId="22593" CreationDate="2017-01-26T15:34:40.827" Score="1" Body="&lt;p&gt;&lt;strong&gt;Transformation to Heat PDE&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First define $T_1$ to be the call date and $T_2$ to be the maturity date. We start by making a change of variables. Let&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\tau = T_1 - t, \quad x = r - \frac{1}{2} \sigma^2 \tau^2, \quad g(t, r) = \exp \left\{ -r \tau + \frac{1}{6} \sigma^2 \tau^3 \right\} h(\tau, x).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\frac{\partial g}{\partial t} &amp;amp; = &amp;amp; \exp \left\{ -r \tau + \frac{1}{6} \sigma^2 \tau^3 \right\} \left( \left( r - \frac{1}{2} \sigma^2 \tau^2 \right) h(\tau, r) - \frac{\partial h}{\partial \tau} + \sigma^2 \tau \frac{\partial h}{\partial x} \right),\\&#xA;\frac{\partial g}{\partial r} &amp;amp; = &amp;amp; \exp \left\{ -r \tau + \frac{1}{6} \sigma^2 \tau^3 \right\} \left( -\tau h(\tau, r) + \frac{\partial h}{\partial x} \right),\\&#xA;\frac{\partial^2 g}{\partial r^2} &amp;amp; = &amp;amp; \exp \left\{ -r \tau + \frac{1}{6} \sigma^2 \tau^3 \right\} \left( \tau^2 h(\tau, x) - 2 \tau \frac{\partial h}{\partial x} + \frac{\partial^2 h}{\partial x^2} \right)&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and we get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\frac{\partial h}{\partial \tau} = \frac{1}{2} \sigma^2 \frac{\partial^2 h}{\partial x^2}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;subject to the initial condition&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;h(0, x) &amp;amp; = &amp;amp; \min \left\{ K, P \left( T_1, T_2; x \right) \right\}\\&#xA;&amp;amp; = &amp;amp; P \left( T_1, T_2; x \right) - \max \left\{ P \left( T_1, T_2; x \right) - K, 0 \right\}&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $P(t, T; r)$ is defined as in the question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Greens Function Solution&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fundamental solution is the heat kernel given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\phi(\tau, x) = \frac{1}{\sqrt{2 \pi \sigma^2 \tau}} \exp \left\{ -\frac{x^2}{2 \sigma^2 \tau} \right\}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We obtain $h(\tau, x)$ through the convolution&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;h(\tau, x) &amp;amp; = &amp;amp; \int_{-\infty}^\infty h(0, y) \phi(\tau, x - y) \mathrm{d}y\\&#xA;&amp;amp; = &amp;amp; \underbrace{\int_{-\infty}^\infty \exp \left\{ -y \left( T_2 - T_1 \right) + \frac{1}{6} \sigma^2 \left( T_2 - T_1 \right)^3 \right\} \phi(\tau, x - y) \mathrm{d}y}_{h_1(\tau, x)}\\&#xA;&amp;amp; &amp;amp; - \underbrace{\int_{-\infty}^\infty \left( \exp \left\{ -y \left( T_2 - T_1 \right) + \frac{1}{6} \sigma^2 \left( T_2 - T_1 \right)^3 \right\} - K \right)^+ \phi(\tau, x - y) \mathrm{d}y}_{h_2(\tau, x)}.&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some tedious computations show that for some $\alpha, \beta \in \mathbb{R}$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\int_{-\infty}^\alpha e^{\beta y} \phi(\tau, x - y) \mathrm{d}y = \exp \left\{\beta x + \frac{1}{2} \beta^2 \sigma^2 \tau \right\} \mathcal{N} \left( \frac{\alpha - x - \beta \sigma^2 \tau}{\sigma \sqrt{\tau}} \right).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Solution of $h_1(\tau, x)$&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, with $\alpha = \infty$ and $\beta = -\left( T_2 - T_1 \right)$, the first integral evaluates to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;h_1(\tau, x) &amp;amp; = &amp;amp; \exp \left\{ -x \left( T_2 - T_1 \right) + \frac{1}{2} \sigma^2 \left( T_2 - T_1 \right)^2 \tau + \frac{1}{6} \sigma^2 \left( T_2 - T_1 \right)^3 \right\}&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reversing the change of variables yields&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;g_1(t, r) &amp;amp; = &amp;amp; \exp \left\{ -r \left( T_2 - t \right) + \frac{1}{6} \sigma^2 \left( T_2 - t \right)^3 \right\}\\&#xA;&amp;amp; = &amp;amp; P \left( t, T_2; r \right)&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is, as expected, just the time $t$ price of a zero coupon bond with maturity in $T_2$. However, explicitly computing it servers as a good sanity check if something went wrong on the way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Solution of $h_2(\tau, x)$&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The integrand in $h_2(\tau, x)$ is positive when&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;y &amp;lt; \frac{-\ln (K) + \frac{1}{6} \sigma^2 \left( T_2 - T_1 \right)^3}{T_2 - T_1} =: \alpha&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, the integral evaluates to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;h_2(\tau, x) &amp;amp; = &amp;amp; h_1(\tau, x) \mathcal{N} \left( \frac{\alpha - x + \sigma^2 \left( T_2 - T_1 \right) \tau}{\sigma \sqrt{\tau}} \right) - K \mathcal{N} \left( \frac{\alpha - x}{\sigma \sqrt{\tau}} \right).&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reversing the change of variables and after &lt;em&gt;a lot&lt;/em&gt; of tedious algebra, you find&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;g_2(t, r) &amp;amp; = &amp;amp; P \left( t, T_2; r \right) \mathcal{N} \left( d_+ \right) - P \left( t, T_1; r \right) K \mathcal{N} \left( d_- \right),&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;d_\pm = \frac{1}{\sigma \left( T_2 - T_1 \right) \sqrt{\tau}} \left( \ln \left( \frac{P \left( t, T_2; r \right)}{P \left( t, T_1; r \right) K} \right) \pm \frac{1}{2} \sigma^2 \left( T_2 - T_1 \right)^2 \tau \right).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Putting everything together, you obtain the same expression as the one you provided in the question.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-01-26T16:32:26.033" LastActivityDate="2017-01-26T16:32:26.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32113" PostTypeId="1" CreationDate="2017-01-26T16:44:14.207" Score="0" ViewCount="38" Body="&lt;p&gt;Background: This is a follow up from &lt;a href=&quot;https://politics.stackexchange.com/q/14583/11552&quot;&gt;this question&lt;/a&gt;, regarding Obama's lowering of the mortgage insurance rates 11 days before Trump was inaugurated (not to go into effect until week after Trump became president), which was rejected by Trump within hours of his being sworn in. It is my understanding that Obama's lowering of the rate was a political move to try and damage Trump, and that the reduction makes no logical sense. That Trump's rejection of the reduction is arguably the right thing to do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, I want to make sure that I have the following correct. I have never had a mortgage, and have no financial background.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When the Federal Reserve raises its interest rates, that means that they are trying to discourage lending by making loans more expensive. It was only raised a half of a point in 2016 (hovering at near zero for almost 8 years since the housing crisis), which is perhaps more of a symbolic move, but still, it discourages potential new borrowers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This in turn makes new fixed rate mortgages more expensive (I'm not talking insurance here, I mean the mortgage itself), and existing variable rate mortgages more expensive. So people are more wary of taking out new mortgages of any kind, and people with variable rate mortgages now have higher payments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means that the FHA may have some more revenue coming in from existing mortgages, but (I'm guessing) lower overall income, because the rate of new mortgages being created decreases. And more importantly, defaults are likely to increase, meaning both less income, and that their solvency is put at risk (as it was in 2013 when they needed a bailout).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All of this implies that the FHA rates for mortgage insurance should go up, not down. Both to protect their solvency with more income, and to discourage (less wealthy or responsible?) people from taking out new mortgages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would appreciate any corrections or insight. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="26281" LastEditorUserId="-1" LastEditDate="2017-04-13T12:54:44.553" LastActivityDate="2017-01-26T17:38:36.233" Title="Obama's lowering mortgage ins rates makes no fiscal sense, because the Fed just raised its rates for the first time last year. Right?" Tags="&lt;interest-rates&gt;&lt;finance&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32114" PostTypeId="1" CreationDate="2017-01-26T17:52:09.387" Score="1" ViewCount="393" Body="&lt;p&gt;I need to extract expected future stock price from an option price. Could anyone please suggest me how I could do this?&lt;/p&gt;&#xA;" OwnerUserId="26283" LastEditorUserId="467" LastEditDate="2017-02-07T05:29:14.980" LastActivityDate="2017-02-07T09:48:40.340" Title="How to compute the expected stock price from option prices?" Tags="&lt;options&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32115" PostTypeId="1" CreationDate="2017-01-26T18:55:40.457" Score="1" ViewCount="62" Body="&lt;p&gt;I am looking for a credible study (i.e. a good/reputable source) into the correlation of returns on assets in Market Place Lending / Online Direct Lending / Alternative Finance with other major asset classes. Something from a major bank, central bank, asset manager etc. would be ideal. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far the only thing I was able to find was a report done by LendingRobot: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://d2qh2u5m1l6y4n.cloudfront.net/media/other/howmuchtoinvest.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://d2qh2u5m1l6y4n.cloudfront.net/media/other/howmuchtoinvest.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The post itself is great, but I need a better source and so far I could not find anything. &lt;/p&gt;&#xA;" OwnerUserId="25284" LastActivityDate="2017-01-26T18:55:40.457" Title="P2P lending and correlation with other major asset classes" Tags="&lt;portfolio-management&gt;&lt;correlation&gt;&lt;reference-request&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32117" PostTypeId="1" CreationDate="2017-01-26T22:26:32.183" Score="0" ViewCount="1654" Body="&lt;p&gt;In a GBM world with riskless domestic and foreign interest rates, what would be the correct model for a FX plain vanilla option given the statement that this option is priced on the forward? I guess it would be the Garman Kohlhagen model or the Black (76) model but I'm a bit confused between the two in the context of pricing on spot vs. pricing on forward. I would appreciate an answer that scetches the main differences.  &lt;/p&gt;&#xA;" OwnerUserId="20736" LastActivityDate="2021-04-29T01:20:22.113" Title="FX Option pricing on Forward vs. Spot" Tags="&lt;option-pricing&gt;&lt;fx&gt;&lt;forward&gt;&lt;black&gt;" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="32119" PostTypeId="1" CreationDate="2017-01-27T07:36:19.840" Score="0" ViewCount="31" Body="&lt;p&gt;I'm looking for a way to get cash-in-hand in exchange for future obligation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I can sell deep-in-the-money puts and buy out-of-the-money puts (for hedge) with expiration of 2 years, The problem here is that it can lead to a loss of more than double the received amount.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way for me to get paid with low risk of my obligation? (something like insurance policy)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="3514" LastActivityDate="2017-01-27T07:36:19.840" Title="Best strategy for generating floats with minimum amount of risk" Tags="&lt;equities&gt;&lt;arbitrage&gt;&lt;strategy&gt;&lt;put-call-parity&gt;&lt;insurance&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32120" PostTypeId="1" AcceptedAnswerId="32128" CreationDate="2017-01-27T10:02:20.870" Score="1" ViewCount="237" Body="&lt;p&gt;I have a hard time getting my head around this.&lt;br&gt;&#xA;Let's say you have a strategy that consists in buying one future spread, for instance CL Z7-Z8 (crude oil dec17 minus dec18). It's easy to calculate the PnL of that strategy:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;PnL = quantity * lot_size * (spread(t) - spread(0))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where spread(t) is the spread at time t and spread(0) is the level at which you entered.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, to calculate the return of that strategy, you'd have to assume that this corresponds to a certain capital that's at risk.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Return = PnL / InvestedCapital&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Given that entering the future spread will demand an initial margin call, and subsequent maintenance margins (potentially infinite), how does one &quot;assign&quot; a capital to that strategy?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it just a matter of choice? Can tell myself: I'm committing 100k to that strategy, and with that I can buy the amount of spreads that I think will not make me go bust, which I'm assessing corresponds to 10k of initial margin calls?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if that's the case then I could just as well commit 200k, and buy the same 10k of margin calls, which means I would be half as leveraged.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a usual way of doing this? For instance where we say that the capital that's at risk is the amount you would loose if the spreads goes 7 stddevs out, or something like that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sorry if I'm not being very clear, it's kind of messy in my head right now...&lt;/p&gt;&#xA;" OwnerUserId="13640" LastEditorUserId="19645" LastEditDate="2017-01-28T16:33:45.897" LastActivityDate="2017-01-28T16:33:45.897" Title="Return on investment in spreads" Tags="&lt;returns&gt;&lt;risk-management&gt;&lt;futures&gt;&lt;spread&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32121" PostTypeId="1" AcceptedAnswerId="32124" CreationDate="2017-01-27T10:23:08.630" Score="2" ViewCount="4690" Body="&lt;p&gt;I stumpled upon an exercise in an investments book:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The data below describe a three-stock financial market that satisfies&#xA;  the single-index model.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Stock Capitalization Beta Mean Excess Return Standard Deviation&#xA; A     $3,000         1.0  10%                40% &#xA; B     $1,940         0.2  2%                 30% &#xA; C     $1,360         1.7  17%                50%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The standard deviation of the market-index portfolio is 25%.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;a. What is the mean excess return of the index portfolio? &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;b. What is&#xA;  the covariance between stock A and stock B ?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;With the solution to the second question given as:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$Cov(R_A, R_B) = \beta_A \beta_B \sigma_M^2 =  1 * 0.2 * .25^2 = .0125$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This translates to $\beta_A \beta_B \sigma_M^2 = \frac{Cov(A,M)}{\sigma_M^2}*\frac{Cov(B,M)}{\sigma_M^2}*\sigma_M^2 = \frac{Cov(A,M)Cov(B,M)}{\sigma_M^2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I could not derive this formula, and mathematically, we do not know what the correlation is between two assets just from their covariance with a third asset (except that we can give upper and lower bounds, in some cases).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if $A,B$ i.i.d., and $M := A+B$, then &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Cov(A,B) = 0$ by construction, but $Cov(A,M) = Cov(B,M) = Cov(A,A+B) = Cov(A,A)+Cov(A,B) = Var(A)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I missing something? Are the assumptions of CAPM playing into this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are the sample solutions incorrect?&lt;/p&gt;&#xA;" OwnerUserId="1817" LastActivityDate="2017-01-27T14:18:26.590" Title="Using CAPM to find correlation of two assets with each other" Tags="&lt;capm&gt;&lt;covariance&gt;&lt;variance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32122" PostTypeId="2" ParentId="32117" CreationDate="2017-01-27T12:55:08.287" Score="0" Body="&lt;p&gt;Pricing on spot takes the mid price of all the bids and offers available in the market and then skews that mid according to any proprietary position (ie you're getting too long EUR so to maintain a less risky position you want to sell EUR so lower your price in the market and participants will be attracted to buy your EUR off you), and then adds a spread to cover hedging costs and client counterparty risks depending on the market venue. Pricing on the forwards takes that spot price and adds in money market interest rate differentials. You can see more at &lt;a href=&quot;http://www.webstersystems.co.uk/fxmm.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;FX / MM training&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2017-01-27T12:55:08.287" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32124" PostTypeId="2" ParentId="32121" CreationDate="2017-01-27T14:18:26.590" Score="4" Body="&lt;p&gt;The solution provided can be derived using the CAPM. For asset $A$ you have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R_A-R_f = \alpha_A +\beta_A(R_M-R_f)+\epsilon_A$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly for asset B:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R_B-R_f = \alpha_B +\beta_B(R_M-R_f)+\epsilon_B$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Calculate the covariance:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Cov}(R_A, R_B) = \text{Cov}(\beta_AR_M, \beta_BR_M)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here I have dispensed with all the constant terms, and also used the usual CAPM assumption that $\epsilon$ represents idiosyncratic volatility, so $\text{Cov}(\epsilon_A, \epsilon_B) = 0$, $\text{Cov}(R_M, \epsilon_A) = 0$ and $\text{Cov}(R_M, \epsilon_B) = 0$. So we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Cov}(R_A, R_B) = \beta_A\beta_B\text{Cov}(R_M, R_M) = \beta_A \beta_B\sigma_M^2$$&lt;/p&gt;&#xA;" OwnerUserId="20059" LastActivityDate="2017-01-27T14:18:26.590" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32125" PostTypeId="2" ParentId="20625" CreationDate="2017-01-27T14:45:01.443" Score="1" Body="&lt;p&gt;Take a look at &lt;a href=&quot;http://cassandra.apache.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Cassandra&lt;/a&gt;. Free and Open Source DB, noSQL. It almost perfectly fits your case.&lt;/p&gt;&#xA;" OwnerUserId="26284" LastEditorUserId="26284" LastEditDate="2017-04-22T18:32:50.173" LastActivityDate="2017-04-22T18:32:50.173" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32126" PostTypeId="1" CreationDate="2017-01-27T14:46:40.150" Score="-1" ViewCount="253" Body="&lt;p&gt;You can enter a forward swap to eliminate interest rate risk, but the spread risk still exists when the swap actually goes into effect.  My goal is to convert a floating rate credit facility that will be funded at a future date into a fixed rate facility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, suppose I take a loan today with a bank for $200mm at 1-Month Libor + 180bps (the &quot;spread&quot;), I can immediately enter into a swap paying 120bps and receiving 1-Month Libor, for an effective rate of 300bps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking this one step further, suppose I enter into a forward swap that begins in 2020 at the same rate, paying 120bps and receiving 1-Month Libor.  The only exposure I have left is the spread (The collateral is strong so I'm making the assumption there is no risk to funding the bank loan/credit facility at that time).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not aware of any instrument I can use to eliminate or hedge the spread risk, and no lender (that I know of) will commit to locking in a spread at a future date.  Is it possible to hedge this risk?&lt;/p&gt;&#xA;" OwnerUserId="2732" LastActivityDate="2017-07-27T03:03:28.650" Title="Is it possible to hedge Spread Risk on a Forward Swap?" Tags="&lt;forward&gt;&lt;interest-rate-swap&gt;&lt;spread&gt;&lt;spread-options&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32127" PostTypeId="1" CreationDate="2017-01-27T16:02:45.240" Score="1" ViewCount="29" Body="&lt;p&gt;So this is a pension framework. I am trying to code a system and I don't want to have to brute force this answer, but I can't figure out a clean solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Fund = \sum_{i=1}^t [\cfrac{I\cdot e^{\frac{\pi i}{12K}}}{12K} \cdot C \cdot e^{\frac{Ri}{12K}}]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$I = $, annual income,  $K = $ pay periods per month, $C =$ Contribution Rate (%), $R =$ expected annualized return (continuous), $\pi =$ expected annual income growth (continuous)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solving for the derivatives:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \cfrac{dFund}{dC} = \sum_{i=1}^t [\cfrac{I\cdot e^{\frac{\pi i}{12K}}}{12K} \ \cdot e^{\frac{Ri}{12K}}]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\cfrac{dFund}{dR} = \sum_{i=1}^t [\cfrac{I\cdot e^{\frac{\pi i}{12K}}}{12K} \cdot C  \cdot e^{\frac{Ri}{12K}} \cdot \frac{i}{12K}]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $\Delta C = 0.01$, $\Delta Fund_{C} = \Delta C \cdot \cfrac{dFund}{dC}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I solve for $\Delta R$ if I want $\Delta R \cdot \cfrac{dFund}{dR} = \Delta Fund_{C} = \Delta C \cdot \cfrac{dFund}{dC}$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, is there a way to extract the value of the $\cfrac{i}{12K}$ term within the summation so that it can be expressed outside the summation?&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Edit:&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;The goal is that by doing so, the problem would easily simplify to $\Delta R \cdot C \cdot \Sigma \frac{i}{12K} \cdot \frac{dFund}{dC} = \Delta Fund_C$, such that I could just solve for $\Delta R = (C \cdot \Sigma \frac{i}{12K})^{-1}$. Currently I using my code to calculate $\Delta Fund_R$ for a large sequence of $\Delta R$ values and then matching the closest $\Delta Fund_R$ to $\Delta Fund_C$. Incredibly inefficient from a resource standpoint.&lt;/p&gt;&#xA;" OwnerUserId="19473" LastEditorUserId="19473" LastEditDate="2017-01-27T18:27:57.260" LastActivityDate="2017-01-27T18:27:57.260" Title="Numerical method to extracting a piece of a summation function?" Tags="&lt;mathematics&gt;&lt;quantitative&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32128" PostTypeId="2" ParentId="32120" CreationDate="2017-01-27T16:08:03.037" Score="2" Body="&lt;p&gt;What is the return on a strategy which has no up-front cost to implement? I argue that it doesn't really make sense, and that the most sensible approach is to define a 'trading capital' that you are comfortable with, and measure returns against that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, to come up against this problem you don't even need to think about spread strategies. You might see the return on a futures contract priced at $F_t$ defined as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;R_{t+1} = \frac{F_{t+1} - F_t}{F_t}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but this is misleading, since it is zero cost to enter a futures contract (if you ignore initial margin). The quantity $F_t$ that you are measuring return against is the notional contract size, but it has no relation to the amount of capital required to run the strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Compare it to the return on a cash equities position with price $P_t$ and dividend $D_t$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;R_{t+1} = \frac{P_{t+1} + D_{t+1} - P_t}{P_t}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here it makes sense that the denominator is $P_t$ since this is the capital outlay required to buy the stock at time $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to think in terms of return rather than profit and loss, I would define a nominal 'trading capital' $X_t$ for the strategy, and measure returns against that,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;R_{t+1} = \frac{\textrm{PnL}_{t+1}}{X_t}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can choose whatever value of $X_t$ you are comfortable with. A common approach is to choose $X_t$ so that the annualized standard deviation of returns is some acceptable number (5%, 10%, 15% etc) or to choose it so that a certain sized drawdown (say \$10k) would result in a loss of a specific percentage of your capital (e.g. if you wanted a $10k drawdown to correspond to a 10% loss of capital, you choose your initial capital to be \$100k).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you say, you can choose your initial capital to be \$200k and size your positions exactly the same way as if you had committed \$100k, in which case you have half the risk (i.e. volatility is halved, drawdowns are halved etc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a general piece of advice, it is probably sensible risk management to actually hold your trading capital, whatever amount it is, in a money market account (or somewhere else safe) so that you earn a risk-free return on it, and you can use it to meet margin calls when they become necessary.&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2017-01-27T16:08:03.037" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32132" PostTypeId="2" ParentId="32126" CreationDate="2017-01-28T00:47:55.000" Score="0" Body="&lt;p&gt;You can take out a loan for the whole time from now until the end of the forward period, except that from now until 2020 the loan is unfunded, so you just pay an annual commitment fee.  Banks should be willing to commit to a spread on this arrangement.   &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-01-28T00:47:55.000" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32134" PostTypeId="1" AcceptedAnswerId="32136" CreationDate="2017-01-28T11:24:34.623" Score="1" ViewCount="318" Body="&lt;p&gt;Given money market rates such as USD LIBOR and EURIBOR and in the context of FX options valuation, I have been reading about the importance to include a so called basis adjustment to one of the respective mm rates. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Since interest rate parity seems to break down, what is the economical foundation of such an adjustment? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;With reference to my &lt;a href=&quot;https://quant.stackexchange.com/questions/32117/fx-option-pricing-on-forward-vs-spot&quot;&gt;previous question&lt;/a&gt;, if I use the Black model (in a GBM world) to value, say a one month call option on the EURUSD spot (priced on the forward), is it true that the basis adjustment is already included in the one month forward? So I can simply use the (unadjusted) one month EURIBOR for the domestic interest rate r (the discount factor)?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="20736" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2021-05-01T22:38:44.717" Title="FX Option Pricing Under Basis Adjustment" Tags="&lt;option-pricing&gt;&lt;fx&gt;&lt;black76&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32135" PostTypeId="1" CreationDate="2017-01-28T12:26:37.370" Score="8" ViewCount="11590" Body="&lt;p&gt;I'm building a spot curve for US Treasuries. My original selection of cash treasury include all the on-the-run bills, notes, bonds from 6 months to 30 years, as well as some selected off-the-run instruments to fill in-between the on-the-runs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because US treasury stopped issuing 30 year cash for around 5 years in the early 2000s, there is a gap in the yield curve roughly between 15 year and 20 year maturities. I did the best I can by providing 14 year and 20 year off-the-run in the original selection. My 14 selection is (in years): 0.5, 1, 1.5, 2, 3, 5, 7, 10, 12, 14, 20, 23, 27, 30.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, if I interpolate this curve, the method of interpolation will have a non-trivial effect on the shape of the curve due to the gap. Therefore when I bootstrap my spot curve based off of coupon yield, the interpolation technique on the long end of the coupon curve builds into the long end spot rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far I've tried Linear Interpolation and Piecewise Cubic Hermite Interpolating Polynomial. I think the Fed Reserve publish their daily yield curve off of the second kind.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly, can someone critique whatever I've said if they have any better idea? My spot curve using PCHIP method on coupon yield curve is drawn below. The spot curve was also interpolated into 1-month interval using PCHIP. I just feel odd looking at this because of the sudden curvature change around 12 year to 22 year sector. If someone thinks this is a good approximation for how the yield curve should look like fundamentally, I would love to hear your explanation. I sincerely apologize for so many questions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/oYWHl.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/oYWHl.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13375" LastEditorUserId="13375" LastEditDate="2017-01-28T12:31:38.160" LastActivityDate="2017-01-29T06:29:20.720" Title="Best method for interpolating yield curve? [Multiple questions]" Tags="&lt;interest-rates&gt;&lt;fixed-income&gt;&lt;yield-curve&gt;&lt;interpolation&gt;&lt;treasuries&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="32136" PostTypeId="2" ParentId="32134" CreationDate="2017-01-28T12:27:37.973" Score="5" Body="&lt;p&gt;If the forward fx price is available, it already includes any basis adjustment and you may use the Black model (in a GBM world) to value the option.  In that case the only usage of the interest rate input is to discount the payoff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason that the fx forward may not be consistent with the two risk-free interest rates (i.e. appearing to violate interest rate parity) is that in practice, you cannot actually borrow and lend at those two interest rates.  That's certainly true for individuals, but it's also true for banks.  A bank can't easily borrow dollars at Fed Funds (unsecured) and invest Euros at Eonia separately.  What it can do is simultaneously borrow dollars and invest in Euros, in the so called currency basis swap market.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-01-28T12:27:37.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32137" PostTypeId="1" CreationDate="2017-01-28T14:45:37.500" Score="1" ViewCount="107" Body="&lt;p&gt;I have been through the CITI Yield book paper and the OAS by Barclays. Is there is anything else that tackles this topic?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be much appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers!&lt;/p&gt;&#xA;" OwnerUserId="26300" LastActivityDate="2017-01-28T14:45:37.500" Title="Can someone suggest some good reads on OAS and Spread Duration?" Tags="&lt;fixed-income&gt;&lt;finance&gt;&lt;bond&gt;&lt;finance-mathematics&gt;&lt;financial-engineering&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32138" PostTypeId="1" CreationDate="2017-01-28T16:58:16.277" Score="1" ViewCount="978" Body="&lt;p&gt;I am calculating the hedge ratio using log prices:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\ln(A) = \text{hedge_ratio} \cdot \ln(B)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I convert the &lt;code&gt;hedge_ratio&lt;/code&gt; into a number of shares of A vs. a number of shares of B?&lt;/p&gt;&#xA;" OwnerUserId="26301" LastEditorUserId="24222" LastEditDate="2018-02-23T08:19:28.973" LastActivityDate="2018-06-23T09:38:22.907" Title="calculating the pair weights from log price hedge ratio" Tags="&lt;pairs-trading&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32139" PostTypeId="2" ParentId="32138" CreationDate="2017-01-28T19:35:41.737" Score="1" Body="&lt;p&gt;Think in terms of dollars invested, not shares. A hedge ratio of 2 for example means that Stock A will go up 2% (on a logarithmic basis, i.e. $\ln P_{t+1}=\ln P_t+0.02$) when Stock B goes up 1%. That means you need twice as many dollars invested in B as in A for the movements to offset each other in dollar terms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you decide what these amounts should be (based on a position size rule, say 10000 USD for the most volatile of the two stocks, or other more complicated rule) you just divide 10000 and 20000 by the respective prices to determine the number of shares (e.g. $10000/P_A$ and $20000/P_B$).&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2017-01-28T20:39:13.797" LastActivityDate="2017-01-28T20:39:13.797" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32142" PostTypeId="2" ParentId="32135" CreationDate="2017-01-29T05:50:04.373" Score="1" Body="&lt;p&gt;A few observations:  the coupon yield curve is never going to be smooth, because a high coupon Treasury and a low coupon Treasury with the same maturity do not yield the same.  That's because in an upward sloping yield curve, then one with the lower coupon has effectively a longer duration and therefore a higher yield.  Secondly, recently issued Treasuries often trade &quot;special&quot; in the repo market, meaning you can borrow cheaply to invest in them, so they will be relatively expensive and therefore have a lower yield.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To do this properly, you could graph the zero coupon yields instead of the par yields.  They will be somewhat smoother.  Alternatively, you could look at the swap curve, which is typically a lot smoother than the Treasury curve.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-01-29T05:50:04.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32143" PostTypeId="2" ParentId="32135" CreationDate="2017-01-29T06:29:20.720" Score="5" Body="&lt;p&gt;Typically, the yield curve used for performing relative value analysis should be built from off-the-run bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Different vendors select different bonds, but starting with all outstanding Treasury issues, you'd usually remove the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Treasury bills: Because of market segmentation concerns, bills are usually excluded, while short-term coupon bonds are preferred.&lt;/li&gt;&#xA;&lt;li&gt;On-the-run bonds: Most vendors remove all on-the-run issues (i.e., the most recently issued 2-, 3-, 5-, 7-, 10-, and 30-year issues) – these issues may command liquidity &amp;amp; financing advantages, so they trade richer than other issues. Some also remove first-off-the-runs and even double old issues for the same reason.&lt;/li&gt;&#xA;&lt;li&gt;Very seasoned issues: For example, original 30-year bonds with only 5 years to maturity would trade differently from recently issued 5-year bonds. Needless to say, the recently issued 5-year notes are likely to provide more meaningful information, so the old 30-year bonds should be removed.&lt;/li&gt;&#xA;&lt;li&gt;Ad-hoc filters: Some traders remove cheapest-to-delivers; others remove issues trading rich in the repo market.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The goal of the process is to retain issues that are likely to reflect the fair value of the Treasury market. Regardless of the filtering procedure you adopt, you're likely to be left with 150-200 notes/bonds that span the entire maturity spectrum.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A spline is then fit through all of these issues. You have the option of modeling the discount curve (by far the most common approach), zero coupon curve, or forward curve. Once you have a functional form for the yield curve, you choose parameters for your model so that it can fit all your input bonds reasonably well -- the fit won't be exact of course; otherwise, you'd have no relative value opportunity to speak of...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A good piece on bond curve construction is published by the Fed: &lt;a href=&quot;https://www.federalreserve.gov/pubs/feds/2006/200628/200628pap.pdf&quot; rel=&quot;noreferrer&quot;&gt;The U.S. Treasury Yield Curve: 1961 to the Present&lt;/a&gt;. Almost all the major banks also publish their curve methodologies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some additional comments that might be helpful:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Most textbooks ask you to interpolate between bond yields, and then bootstrap from that interpolated curve. That's great for pedagogical purposes, but no one does that in real life. Unless all the bonds are par bonds (coupon rate = yield, price = 100), you cannot just connect their yields.&lt;/li&gt;&#xA;&lt;li&gt;Regarding the dip you mentioned around the 15-year sector, there are two things of note: 1) are you plotting par yields? if you are merely plotting quoted bond yields, then remember that the 15-year bond is a high coupon issue, which would have lower yield (than a lower coupon bond, since the yield curve is upward sloping); 2) even the par yield curve have a dip there, because the 15-year part of the curve has indeed been trading very very rich.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2017-01-29T06:29:20.720" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32145" PostTypeId="1" AcceptedAnswerId="32162" CreationDate="2017-01-29T07:22:05.157" Score="1" ViewCount="165" Body="&lt;p&gt;Mainly the two ways I could find on currency hedging are using forwards (to lock in a future exchange rate) and options. However, I'm curious whether currency can be hedged via some commonly known trading strategies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I know that a trading strategy based on momentum can be used for FX, but how exactly can the momentum strategy be used for currency &lt;strong&gt;hedging&lt;/strong&gt;?&lt;/p&gt;&#xA;" OwnerUserId="19057" LastActivityDate="2017-01-30T09:53:35.113" Title="Currency/Forex Hedging using Momemtum Strategy" Tags="&lt;fx&gt;&lt;quant-trading-strategies&gt;&lt;hedging&gt;&lt;currency&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32147" PostTypeId="1" AcceptedAnswerId="32151" CreationDate="2017-01-29T10:52:21.307" Score="10" ViewCount="2301" Body="&lt;p&gt;Let the initial yield curve &lt;span class=&quot;math-container&quot;&gt;$T\mapsto y(0,T)$&lt;/span&gt; be given for a term structure family of bonds &lt;span class=&quot;math-container&quot;&gt;$B(0,T)$&lt;/span&gt; having different maturities. I am trying to figure out the geometric properties of the yield curve. Apparently, I cannot find any reference where the following questions are addressed in an exhaustive manner. For example: consider a fairly long interval &lt;span class=&quot;math-container&quot;&gt;$[0, T^*]$&lt;/span&gt; (say, &lt;span class=&quot;math-container&quot;&gt;$T^*$&lt;/span&gt; of the order of several years). Then:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Is it ture that the yield curve is always non-decreasing? Or non-increasing? More in general, what can we say about the monotonicity of &lt;span class=&quot;math-container&quot;&gt;$y(0,T)$&lt;/span&gt;?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is the yield curve convex? Non-convex? Or is simply not necessarily convex nor not-convex?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;More in general, what properties does the yield curve always have? How do you prove them?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What is a good book for reference about the properties of the yield curve, both mathematically and giving economic reasons for its behaviour?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="11960" LastEditorUserId="20795" LastEditDate="2019-09-08T08:01:13.633" LastActivityDate="2019-09-08T08:01:13.633" Title="Shape and geometry of the yield curve" Tags="&lt;interest-rates&gt;&lt;yield-curve&gt;&lt;reference-request&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="13" ContentLicense="CC BY-SA 4.0" />
  <row Id="32148" PostTypeId="2" ParentId="31983" CreationDate="2017-01-29T11:32:35.540" Score="1" Body="&lt;p&gt;I'll be using &lt;code&gt;tidyquant&lt;/code&gt; version 0.3.0 to answer this question, which changes from &lt;code&gt;x_fun&lt;/code&gt; to &lt;code&gt;ohlc_fun&lt;/code&gt; in &lt;code&gt;tq_mutate&lt;/code&gt; and &lt;code&gt;tq_transform&lt;/code&gt; and adds the new &lt;code&gt;col_rename&lt;/code&gt; argument to solve situations like yours with non-intuitive column names.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Part 1: How do I transform the Closing stock prices to weekly?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are using the &lt;code&gt;periodReturns&lt;/code&gt; function from &lt;code&gt;quantmod&lt;/code&gt;, and you more likely want to use the &lt;code&gt;to.period&lt;/code&gt; function from &lt;code&gt;xts&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's a couple of ways to do it. The first version is what you are attempting. The second is an alternative using the &lt;code&gt;quantmod&lt;/code&gt; OHLC notation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1A, Using &lt;code&gt;tq_transform_xy_&lt;/code&gt; which returns the closing prices only:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;tq_get(&quot;AAPL&quot;, get = &quot;stock.prices&quot;) %&amp;gt;% &#xA;    tq_transform_xy_(x = 'close', transform_fun = 'to.period', period = 'weeks')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;1B, Using &lt;code&gt;tq_transform&lt;/code&gt; which returns the open, high, low, close, and volume prices if you use &lt;code&gt;ohlc_fun = OHLCV&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;tq_get(&quot;AAPL&quot;, get = &quot;stock.prices&quot;) %&amp;gt;% &#xA;    tq_transform(ohlc_fun = OHLCV, transform_fun = to.period, period = 'weeks')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Part 2: How do I get the RSI and EMA in one tq_mutate line with RSI and EMA column names?&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code snippet you are using pipes (&lt;code&gt;%&amp;gt;%&lt;/code&gt;) the transformed period returns into the RSI and EMA mutations. This is probably not what you want to do. Rather, you first want to transform the data to weekly periodicity using the &lt;code&gt;xts&lt;/code&gt; function &lt;code&gt;to.period&lt;/code&gt; (ref. Part 1). Once you have the weekly periodicity, you can calculate the RSI and EMA using weekly closing prices with number of periods, &lt;code&gt;n = 14&lt;/code&gt; (note this is a 14 week interval because of the periodicity change, which may not be what you want). Here's how I would do this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;tq_get(&quot;AAPL&quot;, get = &quot;stock.prices&quot;) %&amp;gt;% &#xA;    tq_transform(ohlc_fun = OHLCV, transform_fun = to.period, period = &quot;weeks&quot;) %&amp;gt;%&#xA;    tq_mutate(ohlc_fun = Cl, mutate_fun = RSI, n = 14, col_rename = &quot;RSI.14&quot;) %&amp;gt;% &#xA;    tq_mutate(ohlc_fun = Cl, mutate_fun = EMA, n = 14, col_rename = &quot;EMA.14&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="26316" LastActivityDate="2017-01-29T11:32:35.540" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32149" PostTypeId="1" CreationDate="2017-01-29T13:20:57.983" Score="0" ViewCount="613" Body="&lt;p&gt;I'm running a valuation of a multinational company listed on the AEX (Amsterdam Eurononext). The company has operations in Europe (70%), US (25%)  and other (5%). I have historic stock data until from 2000.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to determine a risk profile I ran a regression of its returns against the AEX. As expected this yielded a beta &amp;lt;1.0 and an R-squared of &amp;lt; 0.5.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What would be a better index to run my regression against? Data does need to run back until at least 2000.&lt;/p&gt;&#xA;" OwnerUserId="24497" LastActivityDate="2017-02-02T08:06:41.967" Title="What is the best benchmark index for computing the beta of a multinational company?" Tags="&lt;regression&gt;&lt;beta&gt;&lt;valuation&gt;&lt;indexes&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32151" PostTypeId="2" ParentId="32147" CreationDate="2017-01-29T14:14:40.260" Score="22" Body="&lt;p&gt;You can't make any concrete statements about the monotonicity, convexity or even sign of the yield curve.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Yields are almost always positive, and in the past (2007 and earlier) you could find people who would argue that yields &lt;em&gt;must&lt;/em&gt; be positive, typically using a no-arbitrage argument. But recent history has shown us that it is possible for even 10Y yields to be negative (e.g. Switzerland, Germany).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The yield curve is normally upward sloping (I.e. Long rates are greater than short rates) but it is certainly possible for the yield curve to be downward sloping, particularly in a recession, or if interest rates are expected to fall. It is also possible for the yield curve to be non-monotonic, displaying one or more turning points (particularly on the short end). &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The yield curve is normally concave, but it is possible for it to be convex or even to be neither concave or convex. Convexity can reflect expectations of yield curve steepening. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In general, the shape of the yield curve is a combination of&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A. Expectations about future interest rate movements (including changes in the level and slope of the curve). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;B. Risk premiums (longer-dated bonds are more risky, so yields are generally higher to compensate for the additional risk).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;C. Supply and demand, both at the macro level (e.g. Pension funds may demand longer terms bonds, pushing down yields at the long end) and micro scale (reflecting e.g. preferences for on the run vs. off the run bonds, or deliverability into futures contracts). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;D. Convexity. Longer term bonds have a convexity advantage, and so their yields may be lower to compensate for this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will try to return to this answer with more mathematical detail later!&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here's the mathematical detail that I promised. A good source for this information (and much more) is the seven-part series &quot;Understanding the Yield Curve&quot; by Antti Ilmanen. This was a series published by Salomon Brothers in the 1990s. I don't know a good source for it, but you can reasonably easily find PDF copies available for download.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The scenario we'll work in is a market for zero coupon bonds, with one bond issued for each year &lt;span class=&quot;math-container&quot;&gt;$n = 1, \dots, N$&lt;/span&gt;. The yield curve we'll compute will be the annually compounded zero coupon curve - from this curve you can compute the par yield curve for coupon-paying bonds, and it's also easy to generalize to frequencies shorter than 1 year by assuming that &lt;span class=&quot;math-container&quot;&gt;$n$&lt;/span&gt; stands for the number of quarters, months or whatever.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The shortest holding period we'll consider is one year. The price of a one year zero is &lt;span class=&quot;math-container&quot;&gt;$p_1$&lt;/span&gt;, and the one year yield is defined by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;p_1 = \frac{1}{1 + y_1}&#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We assume that there is zero probability of default, so this is a risk-free investment - if you invest &lt;span class=&quot;math-container&quot;&gt;$p_1$&lt;/span&gt; now, you are guaranteed to get back 1 in a year's time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The price of an &lt;span class=&quot;math-container&quot;&gt;$n$&lt;/span&gt;-year zero defines the &lt;span class=&quot;math-container&quot;&gt;$n$&lt;/span&gt;-year yield,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;p_n = \frac{1}{(1 + y_n)^n}&#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's also very useful to define the forward rates &lt;span class=&quot;math-container&quot;&gt;$f_{m,n}$&lt;/span&gt; which are the implied rates for investment between years &lt;span class=&quot;math-container&quot;&gt;$m$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$n$&lt;/span&gt;. You can lock in this rate by shorting an &lt;span class=&quot;math-container&quot;&gt;$m$&lt;/span&gt;-year bond and buying &lt;span class=&quot;math-container&quot;&gt;$p_m/p_n$&lt;/span&gt; of an &lt;span class=&quot;math-container&quot;&gt;$n$&lt;/span&gt;-year bond, which costs you nothing up front. If you compound for &lt;span class=&quot;math-container&quot;&gt;$m$&lt;/span&gt; years at &lt;span class=&quot;math-container&quot;&gt;$y_m$&lt;/span&gt; and a further &lt;span class=&quot;math-container&quot;&gt;$n-m$&lt;/span&gt; years at &lt;span class=&quot;math-container&quot;&gt;$f_{m,n}$&lt;/span&gt; this must be the same as compounding for &lt;span class=&quot;math-container&quot;&gt;$n$&lt;/span&gt; years at &lt;span class=&quot;math-container&quot;&gt;$y_n$&lt;/span&gt;, so you have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;(1+y_m)^m (1+f_{m,n})^{n-m} = (1+y_n)^n&#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which you can solve for &lt;span class=&quot;math-container&quot;&gt;$f_{m,n}$&lt;/span&gt;, getting&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;\begin{align}&#xA;f_{m,n} &amp;amp; = \left[ \frac{(1+y_n)^n}{(1+y_m)^m} \right]^{1/(n-m)} - 1 \\&#xA;        &amp;amp; \approx y_n + \frac{m}{n-m}(y_n - y_m)&#xA;\end{align}&#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is often useful to invert your thinking, and consider the forward rates to be the fundamental quantities, and the zero coupon rates and par yield curve to be the derived quantities. In particular, the curve of one year forward rates &lt;span class=&quot;math-container&quot;&gt;$(n-1)$&lt;/span&gt; years forward are sufficient to reconstruct all the zero coupon rates, since&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;(1+y_n)^n = (1+f_{0,1})(1+f_{1,2})(1+f_{2,3}) \cdots (1+f_{n-1,n})&#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we need to think about return on holding an &lt;span class=&quot;math-container&quot;&gt;$n$&lt;/span&gt; year bond for one year. By the end of the year, it has become an &lt;span class=&quot;math-container&quot;&gt;$(n-1)$&lt;/span&gt; year bond, and it should be priced using the &lt;span class=&quot;math-container&quot;&gt;$(n-1)$&lt;/span&gt; year yield. Using a * to indicate quantities measured one year later, the holding period return is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;1 + r_n = \frac{p^*_{n-1}}{p_n}  = \frac{ (1+y_n)^n }{ (1+y^*_{n-1})^{n-1}} &#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice that if &lt;span class=&quot;math-container&quot;&gt;$y^*_{n-1}=y_{n-1}$&lt;/span&gt; (i.e. if the yield curve is unchanged) then the holding period return is equal to &lt;span class=&quot;math-container&quot;&gt;$f_{n-1,n}$&lt;/span&gt;, the one year forward rate (n - 1) years forward. If we express the (n - 1) year yield one year hence in terms of the old yield plus a delta,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;y^*_{n-1} = y_{n-1} + \Delta y_{n-1}&#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then we can expand the holding period return in powers of &lt;span class=&quot;math-container&quot;&gt;$\Delta y_{n-1}$&lt;/span&gt;, getting&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;\begin{align}&#xA;1 + r_n&#xA;&amp;amp; \approx \frac{p_{n-1}}{p_n} \left( 1 - D_{n-1} \Delta y_{n-1} + \frac{1}{2} C_{n-1} (\Delta y_{n-1})^2 + \cdots \right) \\&#xA;&amp;amp; \approx (1 + f_{n-1,n}) \left( 1 - D_{n-1} \Delta y_{n-1} + \frac{1}{2} C_{n-1} (\Delta y_{n-1})^2 + \cdots \right)&#xA;\end{align}&#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;span class=&quot;math-container&quot;&gt;$D_{n-1}$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$C_{n-1}$&lt;/span&gt; are the modified duration and convexity for the &lt;span class=&quot;math-container&quot;&gt;$n-1$&lt;/span&gt; year bond,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;\begin{align}&#xA;D_{n} &amp;amp; = \frac{n}{1+y_{n}} \\&#xA;C_{n} &amp;amp; = \frac{n(n+1)}{(1+y_{n})^2}&#xA;\end{align}&#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;em&gt;excess&lt;/em&gt; holding period return &lt;span class=&quot;math-container&quot;&gt;$1 + h_n$&lt;/span&gt; is the yield in excess of the risk-free rate, i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;1 + h_n = \frac{1 + r_n}{1 + y_1}&#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;1 + h_n \approx \frac{1 + f_{n-1,n}}{1+y_1} \left( 1 - D_{n-1} \Delta y_{n-1} + \frac{1}{2} C_{n-1} (\Delta y_{n-1})^2 + \cdots \right)&#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we are in a position to start making sense of the shape of the yield curve. Taking expectations of both sides of this equation gives us the relationship between holding period returns, yield curve shape, convexity and expected interest rate changes,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;\mathbb{E}(1 + h_n) =  \frac{1 + f_{n-1,n}}{1+y_1} \left( 1 - D_{n-1} \mathbb{E}(\Delta y_{n-1}) + \frac{1}{2} C_{n-1} \sigma_{n-1}^2 + \cdots \right)&#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;span class=&quot;math-container&quot;&gt;$\sigma_{n-1}$&lt;/span&gt; is the volatility of yield curve movements (which can be estimated empirically, inferred from option prices, or plugged in from a model). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Risk premiums can also influence the shape of the yield curve. The term risk premium is the additional expected return required to compensate for the increased risk of holding long-maturity bonds. The term risk premium &lt;span class=&quot;math-container&quot;&gt;$\xi_n$&lt;/span&gt; is therefore the expected excess holding period return,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;1 + \xi_n = \mathbb{E}(1 + h_n)&#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can now rearrange to find the forward rates in terms of the risk-free rate, term risk premium, expected interest rate changes and convexity advantage. Using the fact that &lt;span class=&quot;math-container&quot;&gt;$p_{n-1}/p_n = 1 + f_{n-1,n}$&lt;/span&gt; we get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;1 + f_{n-1,n} \approx \frac{ (1 + y_1) (1 + \xi_n)}{ 1 - D_{n-1} \mathbb{E}(\Delta y_{n-1}) + \frac{1}{2} C_{n-1} \sigma_{n-1}^2 }&#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can now reconstruct the zero coupon rates from these forward rates, and reconstruct the par yield curve from the zero coupon rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that although the expression for the forward rate &lt;span class=&quot;math-container&quot;&gt;$f_{n-1,n}$&lt;/span&gt; depends on durations and convexities, which in turn depends on yields, the yield dependence is such that &lt;span class=&quot;math-container&quot;&gt;$f_{n-1,n}$&lt;/span&gt; only depends on &lt;span class=&quot;math-container&quot;&gt;$y_{n-1}$&lt;/span&gt;. Therefore we can 'bootstrap' the curve from the inputs, first computing &lt;span class=&quot;math-container&quot;&gt;$f_{0,1} = y_1$&lt;/span&gt;, then computing &lt;span class=&quot;math-container&quot;&gt;$f_{1,2}$&lt;/span&gt; (which depends on &lt;span class=&quot;math-container&quot;&gt;$y_1$&lt;/span&gt;) and using that to compute &lt;span class=&quot;math-container&quot;&gt;$y_2$&lt;/span&gt;, which is used in the computation of &lt;span class=&quot;math-container&quot;&gt;$f_{2,3}$&lt;/span&gt; etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This discussion highlights several important intuitions when thinking about the yield curve -&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The fundamental quantities are the one year forward rates - they have the cleanest representation in terms of the term risk premium, expected interest rate changes and convexity.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Short rates drive the yield curve by increasing all the forward rates. The central bank typically only has the ability to move the short end of the yield curve, but this is transmitted to the rest of the yield curve by the above equation.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The term premium &lt;span class=&quot;math-container&quot;&gt;$\xi_n$&lt;/span&gt; is typically monotonically increasing in &lt;span class=&quot;math-container&quot;&gt;$n$&lt;/span&gt; which partly explains the persistent upward slope to the yield curve. It does not have to be the case, however, and in any case the term premium is not a directly measurable quantity.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Expectations of increasing interest rates mean that the yield curve is more steeply sloped (since &lt;span class=&quot;math-container&quot;&gt;$D_n$&lt;/span&gt; is a monotonically increasing function of &lt;span class=&quot;math-container&quot;&gt;$n$&lt;/span&gt;). Long maturity bonds lose more when interest rates rise, so their yields need to be higher to offset this.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Expectations of falling rates lead to a flatter curve, or even an inverted curve.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Expectations of yield curve steepening lead to a more convex yield curve, and expectations of yield curve flattening lead to a more concave yield curve.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The tendency of the yield curve to flatten at long maturities (or even to develop a hump) is explained by the convexity advantage of longer-term bonds. This hump is more pronounced when volatility of rates rises.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Since neither the term premium or interest rate expectations are directly measurable, it is a matter of taste how you assign weight between the expectations and risk-premium terms. This is important for investors, because you want to invest in bonds when the risk premium term is high (i.e. yields are high because expected returns are high) but not when rates are expected to rise (i.e. yields are high because capital losses are expected).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Two older and largely discredited theories of the yield curve are the &quot;pure expectations hypothesis&quot; which says that only expectations matter and there is no term premium (i.e. &lt;span class=&quot;math-container&quot;&gt;$\xi_n=0$&lt;/span&gt;) and the &quot;risk premium hypothesis&quot; which says that the yield curve contains no expectations about interest rates, and only encodes risk premium (i.e. &lt;span class=&quot;math-container&quot;&gt;$\mathbb{E}(\Delta y_{n-1}) = 0$&lt;/span&gt;). Neither of these is true, but in my (subjective and unquantified) opinion, the risk premium hypothesis is closer to being true.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I haven't talked about supply-demand effects, either on the micro or macro scale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the macro scale, these can be incorporated along with the term premium into expected returns. High demand for long term bonds will tend to decrease expected returns at the long end of the yield curve, for example (equivalently you would have a smaller term risk premium at the long end).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Micro structure effects do not fit into the above model since I have assumed zero coupon bonds with essentially infinite liquidity, a liquid market for borrowing and lending the bonds, and no taxes. However, micro effects can be important for measuring and building yield curves in the real world, for example&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;A bond which has high demand in the repo market can be financed very cheaply, which tends to decrease its yield.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Some bonds are generally in higher demand, for example newly issued 10Y and 5Y notes, which tends to decrease their yield.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Bonds with a low coupon will recognize more of their returns as capital gains, rather than as income, which can have a tax advantage. Therefore you might expect their yields to be lower to offset this advantage, depending on the aggregate income and capital gains tax rates of the investment community.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I thought it could be useful to illustrate my initial points with some examples of yield curves.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First a &quot;normal&quot; curve - the USD swap curve on 7th May 2001. The curve is positive, upward sloping and concave -&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/GwTmJ.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/GwTmJ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The EUR swap curve in December 2017 had negative swap rates out to seven years. It also displays a non-monotonic shape, with 1Y rates above 2Y rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/2fqgF.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/2fqgF.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In late December 2009, as the first inklings of the Eurozone debt crisis led to widespread expectations of rate cuts, the EUR swap curve became inverted, at least in the 1-10Y sector.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/wN1Ql.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/wN1Ql.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, in late 2008 the US swap curve displayed an unusual humped shape. Volatile interest rates increased the convexity value of long-dated swaps, so yields decreased to compensate. At the same time the front of the curve remained steep, reflecting both a belief that interest rate cuts were broadly done, and a risk premium for holding longer dated (5-10Y) duration risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/9rEw0.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/9rEw0.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="924" LastEditorUserId="924" LastEditDate="2018-12-10T10:20:14.967" LastActivityDate="2018-12-10T10:20:14.967" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="32152" PostTypeId="2" ParentId="32149" CreationDate="2017-01-29T16:39:54.517" Score="2" Body="&lt;p&gt;If you want to use a more global index for your regression, you should consider these two:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.msci.com/world&quot; rel=&quot;nofollow noreferrer&quot;&gt;MSCI World&lt;/a&gt; (Developed Markets)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.msci.com/acwi&quot; rel=&quot;nofollow noreferrer&quot;&gt;MSCI ACWI&lt;/a&gt; (Developed and Emerging Markets)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;EDIT: You might consider using global indices by other providers, for example, the &lt;a href=&quot;http://us.spindices.com/indices/equity/sp-global-1200&quot; rel=&quot;nofollow noreferrer&quot;&gt;S&amp;amp;P Global 1200&lt;/a&gt;. You can get 10 years of data from the link.&lt;/p&gt;&#xA;" OwnerUserId="20059" LastEditorUserId="20059" LastEditDate="2017-01-30T15:10:17.573" LastActivityDate="2017-01-30T15:10:17.573" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32154" PostTypeId="1" AcceptedAnswerId="32155" CreationDate="2017-01-29T22:20:31.137" Score="1" ViewCount="96" Body="&lt;p&gt;In &lt;a href=&quot;https://quant.stackexchange.com/questions/23267/delta-of-binary-option&quot;&gt;Delta of binary option&lt;/a&gt;,&#xA;I do not see how to prove that the limit of $\partial C_t/\partial S_t$ is equal to $+\infty$ as $t \rightarrow T$. Can someone help ? &lt;/p&gt;&#xA;" OwnerUserId="26306" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2017-01-30T13:11:13.900" Title="Computation of limit" Tags="&lt;delta-hedging&gt;&lt;binary-options&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32155" PostTypeId="2" ParentId="32154" CreationDate="2017-01-29T23:27:24.113" Score="1" Body="&lt;p&gt;The value of a bond binary call in the Black-Scholes model is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;B_t = e^{-r (T - t)} \mathcal{N} \left( d_- \right),&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;d_- = \frac{1}{\sigma \sqrt{T - t}} \left( \ln \left( \frac{S_t}{K} \right) + \left( r - \frac{1}{2} \sigma^2 \right) (T - t) \right). \nonumber&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The delta is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\frac{\partial B_t}{\partial S_t} = e^{-r (T - t)} \mathcal{N}' \left( d_- \right) \frac{1}{S_t \sigma \sqrt{T - t}}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We now want to take the limit as $t \rightarrow T$. First note that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\lim_{t \rightarrow T} d_- = \begin{cases} -\infty &amp;amp; \text{if } S_t &amp;lt; K\\ 0 &amp;amp; \text{if } S_t = K\\ +\infty &amp;amp; \text{if } S_t &amp;gt; K \end{cases}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\lim_{t \rightarrow T} \mathcal{N}' \left( d_- \right) = \begin{cases} 0 &amp;amp; \text{if } S_t \neq K\\ 1 / \sqrt{2 \pi} &amp;amp; \text{if } S_t = K \end{cases}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\lim_{t \rightarrow T} \frac{\partial B_t}{\partial S_t} = \begin{cases} 0 &amp;amp; \text{if } S_t \neq K\\ +\infty &amp;amp; \text{if } S_t = K \end{cases}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the last step we used that the exponential in $\mathcal{N}' \left( d_- \right)$ approaches zero faster than the $1 / \sqrt{T - t}$ approaches plus infinity in the limit when $S_t \neq K$.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2017-01-29T23:27:24.113" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32156" PostTypeId="1" CreationDate="2017-01-30T01:00:31.093" Score="3" ViewCount="158" Body="&lt;p&gt;Following Shreve's notation, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d(e^{-\int_{0}^tR(s)ds}X(t))=e^{-\int_0^tR(s)ds}\sigma(t)\Delta(t) S(t)(\frac{\alpha(t)-R(t)}{\sigma(t)}dt+dW_t)$. In order to make $d(e^{-\int_{0}^tR(s)ds}X(t))$ a martingale, he defines $d\tilde{W}_t=\frac{\alpha(t)-R(t)}{\sigma(t)}dt+dW_t$, and the new probability measure $\tilde{P}_t$ under which $d\tilde{W}_t$ is a brownian motion. But $\tilde{P}_t$ relies on $R(t),\alpha(t),\sigma(t)$. My question is, since $\tilde{p}_t$ is not determinant, what do you mean by the expectation under risk-neutral measure ($\tilde{E}(.|\mathcal{F}_t)$)?&lt;/p&gt;&#xA;" OwnerUserId="25086" LastActivityDate="2017-01-30T01:00:31.093" Title="how to define the risk neutral measure when the interest rate itself is stochastic?" Tags="&lt;interest-rates&gt;&lt;risk-neutral-measure&gt;" AnswerCount="0" CommentCount="0" ClosedDate="2017-02-13T18:08:42.923" ContentLicense="CC BY-SA 3.0" />
  <row Id="32157" PostTypeId="1" CreationDate="2017-01-30T02:13:26.840" Score="0" ViewCount="148" Body="&lt;p&gt;Is there any way to reduce Beta exposure to a single factor in the factor model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically I read somewhere that if in a single factor model, your beta, wrt to say SnP is B, you take a position of -BV in SnP to eliminate the beta component from your estimated returns. But it does not seem to add up. Can someone please explain why this would work out and if there is any other way to eliminate Beta exposure to a particular factor in the factor model.&lt;/p&gt;&#xA;" OwnerUserId="7991" LastActivityDate="2017-01-30T02:13:26.840" Title="Beta Hedging through factor model" Tags="&lt;hedging&gt;&lt;factor-models&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32159" PostTypeId="2" ParentId="31582" CreationDate="2017-01-30T08:34:17.557" Score="3" Body="&lt;p&gt;this paper may also be of interest: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Quanto Implied Volatility Smile&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cesarini et al&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://ssrn.com/abstract=2388093&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://ssrn.com/abstract=2388093&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26323" LastActivityDate="2017-01-30T08:34:17.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32160" PostTypeId="1" AcceptedAnswerId="32170" CreationDate="2017-01-30T08:42:03.897" Score="3" ViewCount="233" Body="&lt;p&gt;I was wondering about the following scenario: assume that you have a underlying which trades under a positive bid-ask spread $S^B \leq S^A$ and that there is also a European Call-Option on this underlying available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now assume that at maturity we have that $S^B=90\$, S^A=110\$$ and the strike of the option is given by $K=100\$$. Is this option exercised?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the one hand, the option gives me the right to buy the underlying for $100\$$ (instead of $S^A=110\$$) so the owner of the option would exercise the option and one could argue that the payoff at maturity is given by $(S^A-K)^+$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, if the owner of the option does not want to possess the underlying, then there is no reason to exercise the option: because once he/she pays $100\$$ to buy the underlying, he/she would only get back $S^B=90\$$ after selling the underlying. Thus, one could argue that the payoff at maturity is given by $(S^B-K)^+$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I realize that the question might not have only true answer. But I would be interested in how this is handled in practice: is there something like a mid-price $S^M \in [S^B,S^A]$ which determines the pay-off, i.e. is the payoff at maturity given by $(S^M-K)^+$? Or is there a completly different approach?&lt;/p&gt;&#xA;" OwnerUserId="25769" LastEditorUserId="25769" LastEditDate="2017-01-30T12:55:17.923" LastActivityDate="2017-01-30T17:08:38.750" Title="Payoff of European Call Option with Transactioncosts" Tags="&lt;finance-mathematics&gt;&lt;transaction-costs&gt;&lt;european-options&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32162" PostTypeId="2" ParentId="32145" CreationDate="2017-01-30T09:53:35.113" Score="0" Body="&lt;p&gt;The point of currency hedging is that the bid / offer spread paid by the client includes hedging costs. Having said that, in the interbank market spreads are so tight due to increased competition that it's difficult to cover hedging costs. So you have to take more risk.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2017-01-30T09:53:35.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32163" PostTypeId="2" ParentId="32154" CreationDate="2017-01-30T11:17:41.760" Score="1" Body="&lt;p&gt;Alternatively to LocalVolatility's already very nice answer, here's an approach to see that this result does not only hold under the Black-Scholes dynamics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The $t$-value of a binary call expiring at $T$ can be written as&#xA;$$ C_t = \Bbb{E}_t^\Bbb{Q} \left[ e^{-r(T-t)} {\bf{1}}\{S_T \geq K \} \right] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Its &quot;delta&quot; is defined as $$\Delta = \frac{\partial C_t}{\partial S_t}$$&#xA;Under some light conditions (discussed in e.g. &lt;em&gt;Monte Carlo Methods in Financial Engineering&lt;/em&gt;, Glasserman, 2004), you can permute the expectation and differential operators to write:&#xA;\begin{align}&#xA;\Delta_t &amp;amp;= \frac{\partial}{\partial S_t} \Bbb{E}_t^\Bbb{Q} \left[ e^{-r(T-t)} {\bf{1}}\{S_T \geq K \} \right] \\&#xA;&amp;amp;= \Bbb{E}_t^\Bbb{Q} \left[ e^{-r(T-t)} \frac{\partial}{\partial S_t}{\bf{1}}\{S_T \geq K \} \right] \\&#xA;&amp;amp;= \Bbb{E}_t^\Bbb{Q} \left[ e^{-r(T-t)} \delta(S_T-K) \frac{\partial S_T}{\partial S_t} \right] \tag{1}&#xA;\end{align}&#xA;where we've used the chain rule ($S_T$ functionally depends on $S_t$) and the fact that the derivative of the Heaviside function ${\bf{1}}(x \geq a)$ is a Dirac impulse at $a$, i.e. $\delta(x-a)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It should then clear that:&#xA;$$ \lim_{t \to T} \Delta_t = \delta(S_t-K) $$&#xA;hence the result.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2017-01-30T12:25:50.633" LastActivityDate="2017-01-30T12:25:50.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32165" PostTypeId="2" ParentId="16343" CreationDate="2017-01-30T12:25:03.750" Score="5" Body="&lt;p&gt;This is merely a question of notation, you should simply read&#xA;$$ \sigma(K,T) = \sigma(S_t=K, t=T) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For an easy to follow derivation see this &lt;a href=&quot;http://www.frouah.com/finance%20notes/Dupire%20Local%20Volatility.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;excellent note&lt;/a&gt; from Fabrice Rouah&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some intuition behind the developments:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The price of a European option, for instance a call, can be written in integral form:&#xA;$$ C(t, S_t, K, T) = e^{-r(T-t)} \int_0^\infty (S_T-K)^+ \phi(S_T,T; S_t, t) dS_T \tag{1} $$&#xA;where $\phi(S_T=S,T;S_t,t) := f(S,T)$ figures the pdf of moving from the known current state $(S_t,t)$ to some future state $(S_T=S,T)$. This is a &lt;strong&gt;model free&lt;/strong&gt; result.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Now, consider a &lt;strong&gt;local volatility&lt;/strong&gt; dynamics $$\frac{dS_t}{S_t} = \mu(S_t,t) dt + \sigma(S_t,t) dW_t$$ it is well-known that the conditional pdf $\phi(S_T=S,T;S_t,t) = f(S,T)$ in that case solves the following equation (Kolmogorov forward or Fokker-Planck equation):&#xA;$$ \frac{\partial}{\partial T}f(S,T) = -\frac{\partial}{\partial S} \left[ \mu(S,T) f(S,T) \right] + \frac{1}{2}  \frac{\partial^2}{\partial S^2} \left[ \sigma^2(S,T) f(T,S) \right] \tag{2} $$&#xA;with initial condition $$f(S,t) = \phi(S_T=S,T=t; S_t, t) = \delta(S-S_t)$$ where we used the notation&#xA;$$ \sigma^2(S,T) = \sigma^2(S_t=S,t=T) $$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Writing the time derivative of $(1)$ with respect to $T$, one can make $\frac{\partial}{\partial T}f(S,T)$ appear. This is useful, since we can now replace its expression given by $(2)$, meaning we have related some (time) derivative of the call price to our local volatility function $\sigma(.,.)$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The expression we get can be further simplified by identifying the spatial derivatives of the call price given by $(1)$. This involves computing space integrals, where the local volatility function ends up being evaluated at $S=K$, and finally yields the famous Dupire stripping formula&#xA;$$ \sigma^2(K,T) = ... $$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2018-05-23T11:22:41.777" LastActivityDate="2018-05-23T11:22:41.777" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="32166" PostTypeId="2" ParentId="32154" CreationDate="2017-01-30T13:04:10.583" Score="0" Body="&lt;p&gt;You're short a digital call struck at 100. Your payoff : -\$1 above 100, \$0 below. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 second before expiry, spot is 99.9999. If its stays there you owe nothing, if it goes a touch higher you owe $1 to the option's buyer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to replicate this payoff via delta hedging : how much of the underlying do you need to hold to generate a \$1 gain, and offset your \$1 loss, when the spot moves from 99.9999 to 100.0? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Answer : a lot of it. &lt;/p&gt;&#xA;" OwnerUserId="25460" LastEditorUserId="25460" LastEditDate="2017-01-30T13:11:13.900" LastActivityDate="2017-01-30T13:11:13.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32167" PostTypeId="1" AcceptedAnswerId="32197" CreationDate="2017-01-30T15:07:48.330" Score="2" ViewCount="554" Body="&lt;p&gt;I´m working on a stock app for iOS where I´m overlaying the diagram with the historical prices of a stock and the prices of the only commodity this company is producing. The commodities I'm interested in are &lt;strong&gt;iron ore&lt;/strong&gt;, &lt;strong&gt;copper&lt;/strong&gt;, &lt;strong&gt;nickl&lt;/strong&gt; and &lt;strong&gt;potash&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the stock prices I use Yahoo Finance API which is really easy to use. But now I have a problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can´t find an API where I can get the historical data from different raw materials in .csv or .json. I read through the description of the API of worldbank.org but it´s not clear how to create a URL where I get the data from.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does someone know a API to get this data from or a way to get it from the Yahoo Finance API?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot&lt;/p&gt;&#xA;&#xA;&lt;p&gt;N.F.M.&lt;/p&gt;&#xA;" OwnerUserId="25854" LastActivityDate="2017-02-01T13:26:59.687" Title="Yahoo Finance API Commodity Prices" Tags="&lt;yahoofinance&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32168" PostTypeId="1" AcceptedAnswerId="32169" CreationDate="2017-01-30T16:02:35.063" Score="-1" ViewCount="127" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Consider an equally weighted portfolio of three stocks, each of which&#xA;  is independently distributed of the others but have the same risk. I.e.,&#xA;  $cov(r_i, r_j) = 0$; $\forall i \neq j$, and $\sigma_i = \sigma$; $\forall i$. What fraction of each stock's risk is diversifed away by including it in this portfolio?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Attempted solution - I believe that the fraction of asset $i$'s risk that it contributes to a portfolio is given by $corr(r_i,r_p)$, where $r_p$ is the portfolio return. That is $$corr(r_i,r_p) = \frac{cov(r_i,r_p)}{\sigma_i \sigma_p}$$ Although, I am not sure if this is the case or how I would proceed further. Any suggestions are greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="19002" LastActivityDate="2017-02-03T06:40:53.187" Title="Given three stocks what is the fraction of each stock's risk is diversified away" Tags="&lt;modern-portfolio-theory&gt;&lt;mathematics&gt;&lt;math&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32169" PostTypeId="2" ParentId="32168" CreationDate="2017-01-30T17:06:17.447" Score="3" Body="&lt;p&gt;In general, the variance of a portfolio is just $$\sigma_p^2 = \sum_i \sum_j w_i w_j \sigma_i \sigma_j \rho_{ij},$$&#xA;which intuitively makes sense since we are summing over all weighted standard deviations and their correlations.&#xA;Since $w_i = \frac{1}{3}$ and $\sigma_i = \sigma$ for all $i = \{1,2,3\}$, and $\rho_{ij} = 0$ for all $i \neq j$, it simplifies to $$\sigma_p^2 = \frac{1}{3^2} \sum_i \sigma ^2 = \frac{1}{3^2} 3\sigma^2 = \frac{\sigma^2}{3} $$&#xA;where the summation over $j$ is dropped because of the correlation assumption. The fraction that is diversified away is then just $$\sigma^2 - \frac{\sigma^2}{3} = \frac{2\sigma^2}{3},$$&lt;/p&gt;&#xA;" OwnerUserId="13808" LastEditorUserId="13808" LastEditDate="2017-01-30T18:40:17.870" LastActivityDate="2017-01-30T18:40:17.870" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32170" PostTypeId="2" ParentId="32160" CreationDate="2017-01-30T17:08:38.750" Score="3" Body="&lt;p&gt;First let's note that in practice exercise notice (of US equity options) is given after the end of the trading day, when we may have a bid and offer coming in for after-hours trading with very wide spread.  That makes your example fairly important.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the situation you cite, where the bid and ask are $S^B=90\$$ and $S^A=110\$$, the true &quot;fair&quot; mid-market price of the underlying could really be anything in between, so there is no universal prescription for the exercise decision.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is common to consider the mid-market price $S^M$ to be some combination of the close price (when there was presumably significant volume to help trust it) and the present after-hours mid-price (which is likely to be based on extremely thin markets).  Portfolio risk calculations might also alter this subjective mid-price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you see, once the option holder has decided on a subjective $S^M$, the subjective exercise value is then $(S^M-K)$ and the option holder will consider themselves to have realized $(S^M-K)^+$ in profit, though only approximately.  The true eventual profit can only be determined once the shares have been sold.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interesting note: This contrasts with options on equity futures contracts, where settlement is into cash and therefore exercise value is far more objective.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2017-01-30T17:08:38.750" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32171" PostTypeId="1" CreationDate="2017-01-30T17:29:17.413" Score="4" ViewCount="994" Body="&lt;p&gt;I'm studying a BS derivation and I don't understand one part .We have a portfolio consisting of $\Delta(t)S(t)+B(t)$ where the first term is risky and the second is a riskless bond. The part i don't understand is why when we take the differential of this portfolio we obtain:&#xA;$\Delta dS +dB$. I understand the reason is related to the fact that this is the limit of a discrete model, so we can imagine $\Delta$ as a function of $t$ with more steps of lenght $\Delta t$ so in the limit $\Delta t \to0$. But this would mean that $\frac{\partial \Delta}{\partial S}=0$ that is $\frac{\partial^2 O}{\partial S^2}=0$ where $O$ is the derivative. Could anyone explain me this passage?&lt;/p&gt;&#xA;" OwnerUserId="26330" LastActivityDate="2017-02-22T16:38:34.467" Title="Black Scholes differential" Tags="&lt;black-scholes&gt;&lt;quantitative&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="32172" PostTypeId="1" AcceptedAnswerId="32183" CreationDate="2017-01-30T20:31:53.890" Score="2" ViewCount="397" Body="&lt;p&gt;Hi: I'm using R to start learning about quantitative finance. I'm good at R, just learning finance. &#xA;Some stocks on the TSX have periods in their names, usually indicating that it's a class B share, for example. The usual functions to download stock data seem to crash on these characters. Thoughts?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#load library&#xA;library(fImport)&#xA;library(quantmod)&#xA;#these work&#xA;yahooSeries(symbols='AQN')&#xA;getSymbols('AQN', src='yahoo')&#xA;#These don't&#xA;yahooSeries(symbols='ATD.B')&#xA;getSymbols('ATD.B', src='yahoo')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="26336" LastEditorUserId="16148" LastEditDate="2017-01-31T13:48:40.807" LastActivityDate="2017-01-31T13:48:40.807" Title="Yahoo: Downloading Stock data from symbols with a period (.)" Tags="&lt;programming&gt;&lt;data&gt;&lt;market-data&gt;&lt;market&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32173" PostTypeId="1" AcceptedAnswerId="32174" CreationDate="2017-01-30T21:28:58.130" Score="1" ViewCount="478" Body="&lt;p&gt;I would like to use the approach outlined &lt;a href=&quot;https://quant.stackexchange.com/questions/12592/is-there-a-step-by-step-guide-for-calculating-portfolio-var-using-monte-carlo-si&quot;&gt;here&lt;/a&gt; to calculate portfolio VaR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However in my case the portfolio also contains ETFs (where I don't necessarily know the fund's total composition. I usually have the top 10). Can I still apply the Monte-Carlo method? If yes how should I modelize the ETF?&lt;/p&gt;&#xA;" OwnerUserId="9249" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2017-01-30T22:42:36.823" Title="How to calculate the VaR of a portfolio containing Stocks and ETFs?" Tags="&lt;var&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32174" PostTypeId="2" ParentId="32173" CreationDate="2017-01-30T22:42:36.823" Score="2" Body="&lt;p&gt;you don't have to model the constituents of the ETF individually. You can consider it as a single asset and model it like any other stock in the portfolio. for example If you would have an index future, then I would also not model the constituents but just model the future as a single instrument.&lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2017-01-30T22:42:36.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32175" PostTypeId="1" CreationDate="2017-01-30T22:53:10.097" Score="1" ViewCount="324" Body="&lt;p&gt;I am testing a pair trading strategy. Every day I recalculate the hedge ratio using the past N prices of the 2 underlying. With the hedge ratio, I calculate the past N spreads and do an ADF test to check stationarity. I am wondering how I should treat the case of a negative result. Assuming I was invested in the pair, should I consider that a negative ADF test should trigger an unwind of the position?&lt;/p&gt;&#xA;" OwnerUserId="26301" LastActivityDate="2019-01-03T10:04:18.970" Title="pair trading - rolling adf test" Tags="&lt;pairs-trading&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32179" PostTypeId="1" CreationDate="2017-01-31T11:32:42.627" Score="1" ViewCount="78" Body="&lt;p&gt;i have exam coming on financial engineering, and need help asap with this thing.&#xA;Basically there's a European put option ex dividend. We know that the stock price is $S_t = 85$, the exercise price is $K = 90$, the annual continuously compounded interest rate is $r = 5\%$, End date is within 50 days ($T = t  + 50 / 365$) and that probability that the put option will be exercised is $\mathbb{P} \left( K &amp;gt; S_T \right) = 73.76\%$. &#xA;I have to estimate the put option using Cox-Ross-Rubinstein with 4 periods. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is... HOW do I get the volatility? &#xA;My guess would be from the $\mathbb{P} \left( K &amp;gt; S_T \right) = 73.76\%$, but really don't know how. In the previous part of the problem I estimated it with Black Scholes and got the volatility there, but it doesn't specify that I have the volatility from previous Black Scholes model application.&lt;/p&gt;&#xA;" OwnerUserId="26347" LastEditorUserId="24222" LastEditDate="2017-01-31T13:30:26.700" LastActivityDate="2017-01-31T13:30:26.700" Title="Cox-Ross-Rubinstein - getting volatility" Tags="&lt;volatility&gt;&lt;probability&gt;&lt;price&gt;&lt;european&gt;&lt;put&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32181" PostTypeId="1" AcceptedAnswerId="32199" CreationDate="2017-01-31T12:58:57.930" Score="0" ViewCount="118" Body="&lt;p&gt;I'm self studying and I'm having trouble with understanding the equivalent formulations of the volatility $\sigma$ of an asset $X$, as in the below problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the below the problem (and the first part of the solution that I posted), what is highlighted in red implies that the statement &quot;the volatility of a $6$-month prepaid forward on $X$ is $0.3$&quot; is equivalent to stating &quot;the volatility of $X$ is $0.3$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to convince myself of why that is true. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The volatility of an asset $X$ means the standard deviation of the return, or $\sqrt{\text{Var}(\ln X_t / X_0)} = \sqrt{\text{Var}(\ln{X_t})}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The standard deviation of the return on a $T - t$-month prepaid forward on $X$, $F^p_{t, T}(X)$, would be $\sqrt{\text{Var}(\ln X_T / F^p_{t, T}(X))} = \sqrt{\text{Var}(\ln{X_t})}$, since $F^p_{t, T}(X)$ is a known constant. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, the two formulations for volatility are equivalent. Is this reasoning correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/iyrVi.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/iyrVi.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5641" LastActivityDate="2017-02-01T14:14:39.483" Title="Why is the statement &quot;the volatility of a $T - t$-month prepaid forward on asset X is $\sigma$&quot; the same as &quot;the volatility of asset X is $\sigma$&quot;?" Tags="&lt;volatility&gt;&lt;forward&gt;&lt;self-study&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32183" PostTypeId="2" ParentId="32172" CreationDate="2017-01-31T13:31:29.177" Score="0" Body="&lt;p&gt;I believe your symbol ATD.B is returning not found. In Yahoo a dot usually precedes the Exchange (eg. AQN.TO refers to Algonquin, Toronto Exchange). A minus sign (or dash) precedes the class: e.g. RDS-B refers to Royal Dutch, class B. So Try using ATD-B or ATD-B.TO instead of ATD.B.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2017-01-31T13:31:29.177" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32185" PostTypeId="1" AcceptedAnswerId="32194" CreationDate="2017-01-31T17:25:49.960" Score="3" ViewCount="821" Body="&lt;p&gt;I'm trying to study the Merton Model for portfolio optimization and the document doesn't explain a quite important step : &#xA;if $$V(t,x)=\sup\{E[U(X_T(\phi))~|~X_t=x]~~ |~~\phi~~\text{an admissible  trading strategy}\}$$ is the value function then, &lt;strong&gt;&quot;under some regularity assumptions&quot;&lt;/strong&gt;, it will satisfy the Hamilton-Jacobi-Bellman equation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are those regularity assumptions ? How can we prove them ? &lt;/p&gt;&#xA;" OwnerUserId="26218" LastEditorUserId="16148" LastEditDate="2017-01-31T18:44:58.500" LastActivityDate="2017-02-02T08:12:46.310" Title="Hamilton-Jacobi-Bellman equation in Merton Model" Tags="&lt;portfolio-optimization&gt;&lt;merton-model&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32186" PostTypeId="2" ParentId="18851" CreationDate="2017-01-31T17:48:36.617" Score="3" Body="&lt;p&gt;To expand on Marcino's correct appraisal of the matter:&#xA;arbitrage was introduced with the 4 pieces of market data. i.e. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;JPY OIS = 10% per day, flat&lt;/li&gt;&#xA;&lt;li&gt;USD OIS = 0% per day, flat&lt;/li&gt;&#xA;&lt;li&gt;USDJPY spot = 100&lt;/li&gt;&#xA;&lt;li&gt;USDJPY Forward for tomorrow = 100&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;are not consistent with no-arbitrage.&#xA;Discounting is driven by how the trade is funded. e.g. if there is a collateral agreement where interest is paid at USD OIS, then USD OIS discounting is used. If there there is no collateral agreement agreement, then the trade is discounted at the institution's funding rate.&#xA;To use the example of a collateral agreement where daily collateral is posted and accrues USD OIS interest, the JPY cash flows must be discounted using the JPY equivalent of the USD OIS discount rate. This is implied by the FX Forward/Cross Currency market. In this case, we use&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;USD OIS = 0%&lt;/li&gt;&#xA;&lt;li&gt;USDJPY spot = 100&lt;/li&gt;&#xA;&lt;li&gt;USDJPY Forward for tomorrow = 100&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;and imply the JPY discounting rate that should be applied to JPY cash flows via an arbitrage argument. We do not use the JPY OIS rate. If instead the collateral agreement specified JPY OIS as the applicable interest rate, then we would indeed use JPY OIS to discount the JPY flows and, in a similar fashion, calculate the USD equivalent discount rate to discount the USD flows.&lt;/p&gt;&#xA;" OwnerUserId="26348" LastEditorUserId="24222" LastEditDate="2017-01-31T20:36:31.217" LastActivityDate="2017-01-31T20:36:31.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32187" PostTypeId="2" ParentId="32171" CreationDate="2017-01-31T18:40:04.673" Score="17" Body="&lt;p&gt;In general, you won't be able to replicate the option by a portfolio of the form $\Delta_t S_t + B_t$, though it is possible to do so with a portfolio of the form $\Delta_t^1 S_t + \Delta_t^2B_t$; see &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/B00DGER5JG&quot; rel=&quot;noreferrer&quot;&gt;Chapter 3 of this book&lt;/a&gt;. Here, $B_t=e^{rt}$ is the value of the money-market account, and $r$ is the risk-free interest rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, you can create a &lt;strong&gt;locally risk-free&lt;/strong&gt; self-financing portfolio of the form &#xA;\begin{align*}&#xA;X_t =\Delta_t^1 S_t + \Delta_t^2C_t, \tag{1}&#xA;\end{align*} &#xA;where $C_t$ is the option price (see also &lt;a href=&quot;https://quant.stackexchange.com/questions/26164/merton-model-riskless-self-financing-derivation/26298#26298&quot;&gt;this question&lt;/a&gt;). &#xA;Specifically, we assume that the stock price process $\{S_t, \, t &amp;gt; 0\}$ satisfies, under the probability measure $P$, an SDE of the form&#xA;\begin{align*}&#xA;dS_t = S_t(\mu dt + \sigma dW_t).&#xA;\end{align*}&#xA;As $X_t$ is self-financing, then&#xA;\begin{align*}&#xA;dX_t &amp;amp;= \Delta_t^1 dS_t + \Delta_t^2 dC_t\\&#xA;&amp;amp;= \Delta_t^1 S_t(\mu dt + \sigma dW_t) + \Delta_t^2\left(\frac{\partial C}{\partial t}dt + \frac{\partial C}{\partial S}dS_t + \frac{1}{2}\frac{\partial^2 C}{\partial S^2} \sigma^2S_t^2 dt\right)\\&#xA;&amp;amp;=\left[\mu \Delta_t^1 S_t + \Delta_t^2\left(\frac{\partial C}{\partial t} + \mu S_t \frac{\partial C}{\partial S} + \frac{1}{2}\frac{\partial^2 C}{\partial S^2} \sigma^2S_t^2   \right)\right]dt \\&#xA;&amp;amp;\qquad\qquad\qquad\qquad\qquad + \left(\sigma\Delta_t^1 S_t + \sigma \Delta_t^2 S_t \frac{\partial C}{\partial S}\right)dW_t.&#xA;\end{align*}&#xA;Since $X_t$ is locally risk-free, we assume that $X_t$ earns the risk-free interest rate $r$, that is,&#xA;\begin{align*}&#xA;dX_t = r X_t dt, \tag{2}&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;&amp;amp;\left[\mu \Delta_t^1 S_t + \Delta_t^2\left(\frac{\partial C}{\partial t} + \mu S_t \frac{\partial C}{\partial S} + \frac{1}{2}\frac{\partial^2 C}{\partial S^2} \sigma^2S_t^2   \right)\right]dt \\&#xA;&amp;amp;\qquad\qquad\qquad\qquad\qquad + \left(\sigma\Delta_t^1 S_t + \sigma \Delta_t^2 S_t \frac{\partial C}{\partial S}\right)dW_t= r X_t dt.&#xA;\end{align*}&#xA;Consequently,&#xA;\begin{align*}&#xA;\Delta_t^1  + \Delta_t^2\frac{\partial C}{\partial S}=0, \tag{3}&#xA;\end{align*}&#xA;and &#xA;\begin{align*}&#xA;\mu \Delta_t^1 S_t + \Delta_t^2\left(\frac{\partial C}{\partial t} + \mu S_t \frac{\partial C}{\partial S} + \frac{1}{2}\frac{\partial^2 C}{\partial S^2} \sigma^2S_t^2   \right) = r(\Delta_t^1 S_t + \Delta_t^2C_t),&#xA;\end{align*}&#xA;or, &#xA;\begin{align*}&#xA;\mu S_t\left(\Delta_t^1 +\Delta_t^2 \frac{\partial C}{\partial S}\right)  + \Delta_t^2\left(\frac{\partial C}{\partial t} + \frac{1}{2}\frac{\partial^2 C}{\partial S^2} \sigma^2S_t^2\right) &amp;amp;= r(\Delta_t^1 S_t + \Delta_t^2C_t)\\&#xA;&amp;amp;=r\Delta_t^2(-\frac{\partial C}{\partial S} S_t + C_t).&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;\Delta_t^2\left(\frac{\partial C}{\partial t} + \frac{1}{2}\frac{\partial^2 C}{\partial S^2} \sigma^2S_t^2\right) &amp;amp;= r\Delta_t^2(-\frac{\partial C}{\partial S} S_t + C_t). \tag{4}&#xA;\end{align*}&#xA;Canceling the term $\Delta_t^2$ from both sides of $(4)$, we obtain the Black–Scholes equation of the form&#xA;\begin{align*}&#xA;\frac{\partial C}{\partial t} + r S_t \frac{\partial C}{\partial S} + \frac{1}{2}\frac{\partial^2 C}{\partial S^2} \sigma^2S_t^2 -rC = 0. \tag{5}&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Comments&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Note that the quantity $\Delta_t^2$ is canceled from both sides of $(4)$, it is then tempting to set $\Delta_t^2=1$ and, consequently, $\Delta_t^1 = - \frac{\partial C}{\partial S}$. This is indeed adopted by some books, see, for example, &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/012384682X&quot; rel=&quot;noreferrer&quot;&gt;Introduction to the Mathematics of Financial Derivatives&lt;/a&gt;, by Hirsa and Neftci, and &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0133456315&quot; rel=&quot;noreferrer&quot;&gt;Options, Futures, and Other Derivatives&lt;/a&gt;, by John Hull. However, it is easy to see that the strategy $\left(- \frac{\partial C}{\partial S}, 1\right)$ is &lt;strong&gt;not self-financing&lt;/strong&gt;, and the replicating portfolio value, for a European exercise style vanilla call option,&#xA;\begin{align*}&#xA;X_t = - \frac{\partial C}{\partial S} S_t+C_t = -Ke^{-r(T-t)}N(d_2)&#xA;\end{align*}&#xA;does not satisfy $(2)$.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Existence of Self-financing Strategy&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;From $(1)$ and $(3)$ above, we have that&#xA;\begin{align*}&#xA;\Delta_t^1 = -\frac{\frac{\partial C}{\partial S} X_t}{C_t - \frac{\partial C}&#xA;{\partial S}S}, \quad&#xA;\Delta_t^2 =\frac{X_t}{C_t - \frac{\partial C}{\partial S}S}.&#xA;\end{align*}&#xA;In order for $(2)$ to be satisfied, we set&#xA;\begin{align*}&#xA;\Delta_t^1 = -\frac{\frac{\partial C}{\partial S} B_t}{C_t - \frac{\partial C}&#xA;{\partial S}S},\quad&#xA;\Delta_t^2 =\frac{B_t}{C_t - \frac{\partial C}{\partial S}S}.&#xA;\end{align*}&#xA;Then, using the Black–Scholes equation $(5)$, it is easy to see that&#xA;\begin{align*}&#xA;dB_t &amp;amp;= \Delta_t^1 dS_t + \Delta_t^2 dC_t.&#xA;\end{align*}&#xA;That is, $(\Delta_t^1, \Delta_t^2)$ is a self-financing strategy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, we can derive the existence using the martingale representation theorem; see &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/144192311X&quot; rel=&quot;noreferrer&quot;&gt;Shreve&lt;/a&gt;. &#xA;Specifically, let $\lambda = (\mu-r)/\sigma$, and define the risk-neutral probability measure $Q$ such that&#xA;\begin{align*}&#xA;\frac{dQ}{dP}\big|_t = e^{-\frac{1}{2}\lambda^2 t - \lambda W_t}.&#xA;\end{align*}&#xA;Then $\tilde{W}= \{\tilde{W}_t, t \ge 0\}$, where $\tilde{W}_t = W_t + \lambda t$ is a standard Brownian motion under $Q$. Moreover,&#xA;\begin{align*}&#xA;dS_t = S_t(r dt + \sigma d\tilde{W}_t),&#xA;\end{align*}&#xA;or &#xA;\begin{align*}&#xA;d\left(\frac{S_t}{B_t}\right) = \frac{S_t}{B_t}\sigma d\tilde{W}_t,&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $C_T$ be the option payoff at maturity $T$. Then&#xA;\begin{align*}&#xA;C_t = B_tE_Q\left(\frac{C_T}{B_T}\mid \mathcal{F}_t \right),&#xA;\end{align*}&#xA;where $E_Q$ is the expectation operator under the probability measure $Q$, and $\mathcal{F}_t$ is the information set at time $t$. Note that, $\{C_t/B_t, t \ge 0\}$ is a martingale. Therefore, by the martingale representation theorem, there exists an adapted process $\{\kappa_t, 0\le t \le T\}$ such that&#xA;\begin{align*}&#xA;\frac{C_t}{B_t} &amp;amp;= C_0 + \int_0^t \kappa_u d\tilde{W}_u\\&#xA;&amp;amp;=C_0 + \int_0^t \frac{B_u\kappa_u}{\sigma S_u} d\left(\frac{S_u}{B_u}\right) :\equiv C_0 + \int_0^t \gamma_u d\left(\frac{S_u}{B_u}\right),&#xA;\end{align*}&#xA;where $\gamma_t = \frac{B_t\kappa_t}{\sigma S_t}$, for $0\le t \le T$. Then&#xA;\begin{align*}&#xA;dC_t &amp;amp;= d\left(B_t \frac{C_t}{B_t} \right)\\&#xA;&amp;amp;=rC_t dt + B_t\gamma_t d\left(\frac{S_t}{B_t}\right)\\&#xA;&amp;amp;=r(C_t -\gamma_tS_t) dt + \gamma_t dS_t.\tag{6}&#xA;\end{align*}&#xA;We seek adapted processes $\{\Delta_t^1, 0\le t \le T\}$ and $\{\Delta_t^2, 0\le t \le T\}$ such that&#xA;\begin{align*}&#xA;B_t &amp;amp;=\Delta_t^1 S_t + \Delta_t^2C_t,\tag{7}&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;dB_t &amp;amp;= \Delta_t^1 dS_t + \Delta_t^2dC_t\\&#xA;&amp;amp;=\Delta_t^1 dS_t + r \Delta_t^2 (C_t -\gamma_tS_t) dt + \Delta_t^2\gamma_t dS_t.&#xA;\end{align*}&#xA;Then &#xA;\begin{align*}&#xA;\Delta_t^1 + \Delta_t^2\gamma_t=0. \tag{8}&#xA;\end{align*}&#xA;From $(7)$ and $(8)$,&#xA;\begin{align*}&#xA;\Delta_t^1 = -\frac{\gamma_t B_t}{C_t - \gamma_t S_t}, \quad&#xA;\Delta_t^2 =\frac{B_t}{C_t - \gamma_t S_t}.&#xA;\end{align*}&#xA;It is then clear that&#xA;\begin{align*}&#xA;\Delta_t^1 S_t + \Delta_t^2 C_t = B_t.&#xA;\end{align*}&#xA;Moreover, from $(6)$,&#xA;\begin{align*}&#xA;\Delta_t^1 dS_t + \Delta_t^2dC_t &amp;amp;=rB_t dt = dB_t.&#xA;\end{align*}&#xA;That is, $(\Delta_t^1, \Delta_t^2)$ is a self-financing trading strategy.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2017-02-22T16:38:34.467" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="32189" PostTypeId="1" CreationDate="2017-01-31T20:17:08.357" Score="3" ViewCount="1618" Body="&lt;p&gt;Most textbook examples, and resources online, talk about algorithmic trading of stocks, futures, forex, etc. They cover techniques like cointegration trading, ARIMA analysis, and many other more exotic ways to trade these instruments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, one thing I really never see is examples of doing this exactly same thing for options on, say, stocks. Obviously this will be a little more difficult due to the nature of options but it doesnt seem impossible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some examples I can (roughly) think of are trying to calculate better values for IV and such, and find mispricings in options that way. But there has to be some strategies based completely on the underlying, using the techniques above (such as ARIMA). What kind of examples of algorithmic trading of options exist?&lt;/p&gt;&#xA;" OwnerDisplayName="user20664" LastActivityDate="2017-02-01T10:38:24.723" Title="Examples of algorithmic trading strategies for options" Tags="&lt;options&gt;&lt;algorithmic-trading&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ClosedDate="2017-02-01T11:43:48.113" ContentLicense="CC BY-SA 3.0" />
  <row Id="32190" PostTypeId="1" AcceptedAnswerId="32201" CreationDate="2017-02-01T00:18:44.117" Score="3" ViewCount="411" Body="&lt;p&gt;Cash-settled options on the S&amp;amp;P 500 index existed before options on futures on that index. Where would the demand for options on futures have come from prompting the exchange to begin listing them, given the two types of contract appear superficially equivalent in terms of their risk profile and price? If one wants exposure to the index via options, what are the arguments for trading the option on the index future over the option on the index?&lt;/p&gt;&#xA;" OwnerUserId="17026" LastEditorUserId="17026" LastEditDate="2017-02-01T06:52:54.857" LastActivityDate="2017-02-01T15:17:47.613" Title="Option on index vs option on index future" Tags="&lt;options&gt;&lt;equities&gt;&lt;futures&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32191" PostTypeId="2" ParentId="1197" CreationDate="2017-02-01T01:25:38.217" Score="1" Body="&lt;p&gt;You may be interested in the closed form solution of &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2906522&quot; rel=&quot;nofollow noreferrer&quot;&gt;local volatility function&lt;/a&gt;, a paper I just finished. This can help you visualize what it looks like.&lt;/p&gt;&#xA;" OwnerUserId="19835" LastActivityDate="2017-02-01T01:25:38.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32194" PostTypeId="2" ParentId="32185" CreationDate="2017-02-01T09:32:11.640" Score="4" Body="&lt;p&gt;This is an &lt;em&gt;optimal control problem&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a self-financing strategy $\pi := (\pi_s)_{s\in[t,T]}$ over the horizon $[t,T]$ consisting in, over each infinitesimal period of time $[t,t+dt[$, investing a fraction $\pi_t$ of the current wealth in a risky asset $S_t$ and placing the remaining part in the risk free asset $B_t$. Given the following dynamics&#xA;$$ dS_t = S_t(\mu_t dt + \sigma_t dW_t)$$&#xA;$$ dB_t = B_t(r_t dt) $$&#xA;starting from an initial wealth $x$ is, the wealth at time $t$ of an investor following the strategy $\pi$ will be&#xA;$$ X_t^{\pi,x} = \frac{ \pi_t X_t^{\pi,x} }{ S_t } S_t + \frac{ (1-\pi_t) X_t^{\pi,x} }{B_t} B_t $$&#xA;and its evolution will be governed by the following SDE&#xA;$$ dX_t^{\pi,x} = X^{\pi,x} \left[ (r_t + \pi_t(\mu_t-r_t))dt + \pi_t \sigma_t dW_t \right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the &lt;em&gt;value function&lt;/em&gt;&#xA;$$ V(t,x;(\pi_s)_{s\in[t,T]}) = \Bbb{E}_t \left[ U(X_T^{\pi,x}) \right] $$  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;em&gt;optimal control&lt;/em&gt; $\pi_t^*$ is the stochastic process such that&#xA;$$ (\pi^*_s)_{s \in [t,T]} = \text{argsup}_{(\pi_s)_{s \in [t,T]}} V(t,x;(\pi_s)_{s \in [t,T]}) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;while the &lt;em&gt;optimal cost&lt;/em&gt; is&#xA;$$ V(t,x) = \Bbb{E}_t \left[ U(X_T^{\pi^*,x}) \right] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The optimal cost function solves the Hamilton-Jacobi-Bellman equations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The proof can be obtained by viewing the control problem as a &lt;em&gt;Dynamic Programming Problem&lt;/em&gt; and relying on Bellman's principle of optimality (see $(1)$  below).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As @noob2 mentions, at some point the Itô differential of the optimal cost $V(t,x)$ appears. Therefore regularity conditions are the usual conditions for Itô integration, both for $X_t$ and $V(t,x)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some intuition&#xA;\begin{align}&#xA;V(t,x) &amp;amp;= \Bbb{E}_t \left[ U(X_T^{\pi^*,x}) \right] \\&#xA;&amp;amp;= \Bbb{E}_t \left[ \Bbb{E}_{t+dt} \left[ U\left(X_T^{\pi^*,x+dX_t(\pi^*_t)}\right) \right] \right] \\&#xA;&amp;amp;= \Bbb{E}_t \left[ V(t+dt, x+dX_t(\pi^*_t)) \right] \tag{1}\\&#xA;&amp;amp;= \sup_{\pi_t} \Bbb{E}_t \left[ V(t+dt, x+dX_t(\pi_t)) \right]\\&#xA;&amp;amp;= \sup_{\pi_t} \Bbb{E}_t \left[ V(t,x) + \frac{dV(t,x)}{dt} dt + \frac{dV(t,x)}{dx}dX_t + \frac{d^2V(t,x)}{dx^2}d\langle X \rangle_t \right] \\&#xA;&amp;amp;= V(t,x) + \frac{dV(t,x)}{dt} dt + \sup_{\pi_t} \left( \frac{dV(t,x)}{dx} x (r_t + \pi_t(\mu_t-r_t)) + \frac{1}{2} \frac{d^2V(t,x)}{dx^2} x^2 \pi_t^2 \sigma_t^2 \right) dt&#xA;\end{align}&#xA;hence finally &#xA;$$ \frac{dV(t,x)}{dt} + \sup_{\pi_t} \left( \frac{dV(t,x)}{dx} x (r_t + \pi_t(\mu_t-r_t)) + \frac{1}{2} \frac{d^2V(t,x)}{dx^2} x^2 \pi_t^2 \sigma_t^2 \right) = 0 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[edit]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The DPP point of view consists in viewing the optimal control $(\pi^*_s)_{s \in [t,T]}$ as the &quot;union&quot; of what you choose to do over $[t,t+dt[$ and what you do over $[t+dt,T[$. Informally:&#xA;$$ (\pi^*_s)_{s \in [t,T]} = \pi^*_t \cup (\pi^*_s)_{s \in [t+dt,T]} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At this point, &lt;strong&gt;Bellman's optimality principle&lt;/strong&gt; tells you that the &lt;em&gt;restriction&lt;/em&gt; of the optimal control $(\pi^*_s)_{s \in [t+dt,T]}$ is itself the optimal policy over the horizon $[t+dt,T[$. This is why in $(1)$ you can write that &#xA;$$ \Bbb{E}_{t+dt} \left[ U\left(X_T^{\pi^*,x+dX_t(\pi^*_t)}\right) \right] = V(t+dt,x+dX_t(\pi^*_t)) $$&#xA;with $V$ the optimal cost (and not simply the value function).&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2017-02-02T08:12:46.310" LastActivityDate="2017-02-02T08:12:46.310" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32195" PostTypeId="2" ParentId="32189" CreationDate="2017-02-01T10:38:24.723" Score="0" Body="&lt;p&gt;One could use a non-normal GARCH model to forecast the unconditional volatility and compare it to the implied volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you believe that the market prices of European call and put options are too low and you should buy them. If your forecast of implied is less than the current implied volatility, then the market prices of European call and put options are too high and you should sell them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nonetheless, options depends on the volatility and the price of the underlying if you are not sure about the price of your stock let's say, one could trade ATM Straddle so you only trade the volatility&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope it helps&lt;/p&gt;&#xA;" OwnerUserId="24805" LastActivityDate="2017-02-01T10:38:24.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32197" PostTypeId="2" ParentId="32167" CreationDate="2017-02-01T13:26:59.687" Score="0" Body="&lt;p&gt;Not sure if that'd help but usually &lt;a href=&quot;http://www.indexmundi.com/commodities/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Index Mundi&lt;/a&gt; is a good source for physical commodities.&lt;/p&gt;&#xA;" OwnerUserId="25460" LastActivityDate="2017-02-01T13:26:59.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32198" PostTypeId="2" ParentId="32114" CreationDate="2017-02-01T13:44:00.323" Score="1" Body="&lt;p&gt;If by &quot;expected future stock price&quot; you mean the stock's &quot;forward price&quot; for a given maturity (eg 1 year forward), F, then look at the price of all puts and all calls for this maturity, find the strike K such as the price of the put for this strike equals the price of the call for the same strike, C(K) = P(K), and K should be the forward stock price you are looking for, F = K. This comes from the &lt;a href=&quot;https://en.wikipedia.org/wiki/Put%E2%80%93call_parity&quot; rel=&quot;nofollow noreferrer&quot;&gt;Put-Call parity&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="25460" LastActivityDate="2017-02-01T13:44:00.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32199" PostTypeId="2" ParentId="32181" CreationDate="2017-02-01T14:14:39.483" Score="2" Body="&lt;p&gt;Almost, indeed&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The volatility of an asset over a horizon $[t,T]$ indeed refers to the standard deviation of the log-return observed over that period:&#xA;$$ \sqrt{\text{Var}\left(\ln\left(\frac{X_T}{X_t}\right)\right)} = \sqrt{\text{Var}\left( \ln X_T - \ln X_t \right)} = \sqrt{\text{Var}\left( \ln X_T \right)} $$&#xA;because $X_t$ is a known constant at $t$&lt;/li&gt;&#xA;&lt;li&gt;The standard deviation of the log-return of a forward contract on $X$ signed at $t$ and expiring at $T$ would be:&#xA;$$ \sqrt{\text{Var}\left(\ln\left(\frac{F_{T,T}^P(X)}{F_{t,T}^P(X)}\right)\right)} = \sqrt{\text{Var}\left( \ln F_{T,T}^P(X) \right)} = \sqrt{\text{Var}\left( \ln X_T \right)} $$&#xA;because $F_{t,T}^P(X)$ is a known constant at $t$ but most of all because by absence of arbitrage opportunity $F_{T,T}^P(X) := X_T$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2017-02-01T14:14:39.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32201" PostTypeId="2" ParentId="32190" CreationDate="2017-02-01T14:25:55.047" Score="2" Body="&lt;p&gt;Margin requirements for futures work differently than on security products, both for historical reasons and because they are supervised by a different agency (CFTC cs. SEC). This allowed an opening for the Chicago Mercantile Exchange to get into the business of S&amp;amp;P 500 options that had been pioneered by the CBOE, in spite of CBOE objections. As a CME brochure says the options on futures allow &quot;capital efficient&quot; exposure to the index, i.e. essentially lower and more convenient margin requirements, especially when you combine a futures exposure with option exposure(s) (due to &quot;portfolio margining&quot; rules). One drawback is that they require a futures trading account, which some small or unsophisticated institutions may not have.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a strong rivalry between the CBOE and the CME, each has satisfied users, and each has friends among senators in Washington D.C. and the respective regulators which means that the situation is unlikely to change and both exchanges will go on to offer users their solution to achieve S&amp;amp;P 500 options exposure. (Of course there are also people who participate in both markets and help keep the prices inline). That customers have a choice is a (fortunate) side effect of U.S. financial regulatory complexity, with futures and securities regulated differently.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-02-01T15:17:47.613" LastActivityDate="2017-02-01T15:17:47.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32202" PostTypeId="2" ParentId="26016" CreationDate="2017-02-01T15:25:01.087" Score="0" Body="&lt;p&gt;Have you tried to simulate both processes together from US close -&gt; JP close -&gt; US close -&gt; JP close and so on? Where the correlation is fixed, but the volatility of each step is proportional to the square root of its length. And then pick US close and JP close points to build your two series. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will find that the correlation of the asynchronous ones is the input correlation scaled down by the non-overlap fraction. But you don't need to simulate to show that, you can do it analytically. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which means that you can directly simulate two series with correlation scaled down appropriately. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2017-02-01T15:25:01.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32205" PostTypeId="2" ParentId="26016" CreationDate="2017-02-01T19:00:52.000" Score="0" Body="&lt;p&gt;Brownian motion should be i.i.d, as you noted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Subsets of two correlated series are not necessarily correlated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The correlation of a correlated series with one lagged will simply yield the autocorrelation times the initial correlation of the lagged series. &lt;/p&gt;&#xA;" OwnerUserId="19473" LastActivityDate="2017-02-01T19:00:52.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32208" PostTypeId="1" CreationDate="2017-02-01T22:11:48.973" Score="2" ViewCount="3612" Body="&lt;p&gt;Are there any free data of DAX or DAX future in 1-second or 1-minute time resolution ? I would be happy to buy them but everywhere prices starts from 1k $ (minimum value of order), 2016 alone would be enought&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've read this : &lt;a href=&quot;https://quant.stackexchange.com/questions/141/what-data-sources-are-available-online&quot;&gt;What data sources are available online?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2044" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2020-04-02T20:10:11.043" Title="Are there any free data of DAX or DAX future in 1-second or 1-minute time resolution?" Tags="&lt;data&gt;&lt;market-data&gt;&lt;historical-data&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32210" PostTypeId="1" AcceptedAnswerId="32211" CreationDate="2017-02-01T23:45:20.790" Score="0" ViewCount="126" Body="&lt;p&gt;My algorithm needs to extract the forex data of the last 48h (hourly) to get the last close price and to calculate the MACD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use Google Finance api becouse is the only which provides free forex intraday data on-the-fly. But I realized that the close prices doesn't match with the binary.com service.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Futhermore, I tried to get the close price of a single day: 30st of January 2017. Here is the dramatic diference between binary.com, google, yahoo and wall street journal, on AUDJPY currency pair:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Binary.com -&amp;gt; 86.008   ¿?&#xA;Google     -&amp;gt; 85.9793&#xA;WSJ        -&amp;gt; 86.98&#xA;Yahoo      -&amp;gt; 86.6158&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What a huge difference, isn't it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And for instance, this is the difference when comparing an specific hour (EURGBP at 2017/02/01 09:00am):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Google     -&amp;gt; 0.858969&#xA;Binary.com -&amp;gt; 0.85573&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I've heard that some of providers uses Adj. Close and other don't,&#xA;but why there is a huge different between three of them?&lt;/li&gt;&#xA;&lt;li&gt;Those differences may gum up a prediction using linear regression algorithm? How much should I worry about that?&lt;/li&gt;&#xA;&lt;li&gt;How may I retrieve the closest data to binary.com?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="26373" LastActivityDate="2017-02-02T11:31:16.087" Title="Close prices discrepancy between binary.com, google, yahoo and wsj?" Tags="&lt;fx&gt;&lt;binary-options&gt;&lt;yahoofinance&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32211" PostTypeId="2" ParentId="32210" CreationDate="2017-02-02T04:30:12.897" Score="2" Body="&lt;p&gt;My actual area of research is equity securities, however, I was once called upon to evaluate an algorithm for fx trading as part of a due diligence.  FX isn't centrally traded.  There isn't a single feed.  They cannot match because there isn't a unified price.  It will gum up your regression.  It is probably impossible to find out where they are getting their quotes from except for binary.  US law does not regulate FX, generally, and so binary is free to quote any price they want, even if it is far from the prices the banks are quoting.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is somewhat common in the US because of the high leverage.  It allows them to sweep up a lot of extra money by capturing built up customer distortions.  So their quotes are canonical for the users of their system, which does not have to be strongly linked to the global system.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you were in Europe, however, there is a regulatory structure that provides oversight.  My guess, and it is purely a guess, is that the regulatory structure would impose price discipline and reporting discipline.  That is absent from any US data source.  Unlike the US stock market, which has a system for &quot;off the tape&quot; trades in the stock market, there is no similar structure in fx.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I suddenly had to trade FX in the US for some reason, I would do it by proxy through foreign and US dollar denominated bonds, options and forwards.  I would avoid direct trade like the plague.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are trying to model something where the data is being measured with error.  Use extra caution and be sure to use an &quot;errors-in-variable,&quot; model of some form or you will have attenuation bias.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can tell you that whatever you do, be certain you have a long set.  Quite a few models are sensitive to the starting point of the series.  Drop the same model in a different point in the series and it won't work at all.  Lots of models come apart under strict scrutiny.  This class of model is really hard to evaluate because of the data source limitations.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2017-02-02T04:30:12.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32212" PostTypeId="2" ParentId="32210" CreationDate="2017-02-02T07:12:57.057" Score="1" Body="&lt;p&gt;The FX market opens every Monday at 7am Wellington NZ time when the Kiwi value date rolls. It closes at 5pm NYK time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you can only get weekly closing price data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, there's no difference in spot pricing methodology between US, Europe or Asia. Why would there be? The same method works everywhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason for price differences between venues is the spread offered to different clients. Whereas the FX spot pricing methodology is the same everywhere because market makers lock in risk free arbitrage against anyone with off market prices. That player then either stops pricing or adjusts their prices to get back to the market pricing (buy low sell high) or they will soon lose their capital base because their bid is higher than the market offer (buy high sell low) or their offer is lower than the market bid (sell low buy high) and that's risk free arbitrage for everyone else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Further, like most financial asset classes you never know what the next deal is gonna be, so the next price is unpredictable.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastEditorUserId="7369" LastEditDate="2017-02-02T11:31:16.087" LastActivityDate="2017-02-02T11:31:16.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32213" PostTypeId="2" ParentId="32149" CreationDate="2017-02-02T08:06:41.967" Score="2" Body="&lt;p&gt;Matthias, I would create a bespoke index weighted on the percentages you mentioned above. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In that way you can be sure of capturing risk at the appropriate levels without overexposing your valuation to only one or if you use a global index, multiple markets with zero importance.&lt;/p&gt;&#xA;" OwnerUserId="13462" LastActivityDate="2017-02-02T08:06:41.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32214" PostTypeId="5" CreationDate="2017-02-02T10:44:28.033" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2017-02-02T10:44:28.033" LastActivityDate="2017-02-02T10:44:28.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32215" PostTypeId="4" CreationDate="2017-02-02T10:44:28.033" Score="0" Body="Questions about Interactive Brokers, a retail brokerage, and its API for automated trading." OwnerUserId="19333" LastEditorUserId="19333" LastEditDate="2017-02-02T11:49:22.123" LastActivityDate="2017-02-02T11:49:22.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32217" PostTypeId="1" CreationDate="2017-02-02T12:44:00.353" Score="0" ViewCount="347" Body="&lt;p&gt;There are many stochastic volatility option models not only require significant more computation/simulation comparing to the standard BSM model but also introdue large source of possible problems at model-calibration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A quick computation on some real stock option prices data give me the impression that stochastic volatility models fail to demonstrate superiority over BSM models in a statisically meaningful manner.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I get the wrong impression here?&lt;/p&gt;&#xA;" OwnerUserId="16104" LastActivityDate="2017-02-02T12:44:00.353" Title="Are there any papers measure the accuracy of various option pricing models against real market price?" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;monte-carlo&gt;&lt;stochastic-volatility&gt;" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="32219" PostTypeId="1" CreationDate="2017-02-02T18:31:08.583" Score="7" ViewCount="1054" Body="&lt;p&gt;So I have the following short-rate model &#xA;$$dX_t = a_1X_tdt + \sigma_1dW_t$$&#xA;$$dY_t = a_2Y_tdt + \sigma_2dB_t$$&#xA;$$r_t = X_t + Y_t + f(t)$$&#xA;with $X_0 = Y_0 = 0$ where $W$ and $B$ are Brownian motions with correlation $\rho$ and $f(t)$ is some deterministic function chosen to match the current term structure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to calibrate this model by matching the observed caplet prices to a parameter vector $(a_1,a_2,\sigma_1,\sigma_2,\rho)$. My approach is as follows. I first generate a random parameter vector and I compute the corresponding caplet prices for different expiries, strikes and tenor dates. Then I train a neural network (in Matlab, if that matters) that takes this vector of prices as input and outputs the corresponding parameter vector. I expect the function from the price vector to the parameter vector to be smooth so a single-layer neural network with a sufficient number of neurons should be able to approximate this function. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this method does not seem to work. The fitted values of $a_1$ and $a_2$ match their real values (the ones I gave to the neural network) reasonably well but $\sigma_1,\sigma_2,\rho$ are all over the place. If I fix $\sigma_2$ and $\rho$, then the fitted values of $a_1,a_2$ and $\sigma_1$ are quite good. On the other hand if I fix $a_1$ and $a_2$, then the fitted values of $\rho$ are good whereas the fitted values of $\sigma_1$ and $\sigma_2$ are just terrible. If I fix $a_1,a_2$ and $\rho$, then the fitted values of $\sigma_1$ and $\sigma_2$ are almost perfect. Is there some kind of identifiability issue inherent in this model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I generate about $10000$ samples. My input vector is 280-dimensional with expiry ranging from 1 week to 10 years, strike ranging from $-2\%$ to $1\%$ and tenor ranging from 3 months to 3 years. I went as high as 100 neurons with no visible improvement. I tried Matlab's different neural network optimization algorithms but again no improvement. It deteriorated in fact. I would appreciate it if someone could give some feedback on this approach.&lt;/p&gt;&#xA;" OwnerUserId="11597" LastActivityDate="2019-01-08T09:51:53.033" Title="Calibrating a two-factor Hull-White model using Neural Networks" Tags="&lt;calibration&gt;&lt;hullwhite&gt;&lt;neural-networks&gt;" AnswerCount="1" CommentCount="9" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32222" PostTypeId="2" ParentId="32032" CreationDate="2017-02-02T20:46:15.570" Score="0" Body="&lt;p&gt;if you want an equation connecting 3m ois swap rate with the current ois 1d rate and projected future ois 1d rates, then the eqn is just like in ibor swaps, keeping in mind that the float leg of the ois swap is always par because of the daily resets&lt;/p&gt;&#xA;" OwnerUserId="17348" LastActivityDate="2017-02-02T20:46:15.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32224" PostTypeId="1" AcceptedAnswerId="32242" CreationDate="2017-02-02T22:17:02.797" Score="0" ViewCount="323" Body="&lt;p&gt;&lt;strong&gt;Background Information:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say there are $s = 1,\ldots,S$ possible future outcomes (states) with known probabilities $\pi_s &amp;gt; 0$, $\sum_{s=1}^{S}\pi_s = 1$. Define the expected payoff as $\mathbb{E}_\pi\left[X\right] = \sum_s \pi_s x_s = \mu_x$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The CAPM is often used to compute fair market prices of assets. There&#xA;  are two commonly used pricing formulae derived from the CAPM for this&#xA;  purpose. One solves for the price as the discounted risk-adjusted expected&#xA;  payoff&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$$P = \frac{\mathbb{E}\left[\tilde{X} - \Pi\right]}{(1+r_f)}$$&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;and the other solves for the price as the expected payoff discounted by a risk adjusted discount rate $$P = \frac{\mathbb{E}\left[\tilde{X}\right]}{(1+r_f + \pi)}$$&#xA;  Derive both of these expression from the CAPM and identify the risk-adjustment returns.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Thoughts: I am not familiar with the notation above, and referring to the CAPM equation online I am not sure how to use that and derive the latter. Any thoughts or suggestions should help.&lt;/p&gt;&#xA;" OwnerDisplayName="user26356" LastActivityDate="2017-02-03T23:58:37.813" Title="Using CAPM to derive the following" Tags="&lt;modern-portfolio-theory&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;&lt;math&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32225" PostTypeId="2" ParentId="32168" CreationDate="2017-02-03T06:40:53.187" Score="-1" Body="&lt;p&gt;Just buy stock 1 and 2 and short stock 3 (sigma_1^2 + sigma_2^2)/sigma_3^2 times.&lt;/p&gt;&#xA;" OwnerUserId="6640" LastActivityDate="2017-02-03T06:40:53.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32226" PostTypeId="1" AcceptedAnswerId="32227" CreationDate="2017-02-03T07:49:15.693" Score="0" ViewCount="255" Body="&lt;p&gt;I hope the question is clear enough.&#xA;I know of intrinio.com, which lets you get each datapoint at a time, but not all at once.&lt;/p&gt;&#xA;" OwnerUserId="26389" LastActivityDate="2017-02-03T08:18:21.967" Title="How can I get all the financial ratios of all the companies listed on Nasdaq?" Tags="&lt;data&gt;&lt;ratio&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32227" PostTypeId="2" ParentId="32226" CreationDate="2017-02-03T08:18:21.967" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://www.quandl.com/api/v3/datatables/ZACKS/FC.csv?api_key=YOUR_API_KEY&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.quandl.com/api/v3/datatables/ZACKS/FC.csv?api_key=YOUR_API_KEY&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where YOUR_API_KEY is your api key from quandl.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more information: &lt;a href=&quot;https://www.quandl.com/docs/api&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.quandl.com/docs/api&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26389" LastActivityDate="2017-02-03T08:18:21.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32228" PostTypeId="1" AcceptedAnswerId="57262" CreationDate="2017-02-03T08:31:43.583" Score="1" ViewCount="82" Body="&lt;p&gt;Is there some source to have a XREF of various instruments codes as used by different providers ( IE Reuters Bloomberg others ) as well as ISIN, are there some sources/strategies already in place?&lt;/p&gt;&#xA;" OwnerUserId="26390" LastEditorUserId="16148" LastEditDate="2017-02-03T17:03:16.397" LastActivityDate="2020-08-11T16:56:04.360" Title="Financial instrument code crossreference" Tags="&lt;finance&gt;&lt;codes&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32230" PostTypeId="1" CreationDate="2017-02-03T09:24:17.737" Score="1" ViewCount="1009" Body="&lt;p&gt;I have a problem figuring out some of the calculations in the book: Fixed Income modelling&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the chapter on forwards the author makes an argument that the forward is a martingale under the T-forward martingale measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that the forward is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$F_t^T=\frac{P_t}{B_t^T}\;(1)$$     &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And that the price of a security under the risk-neutral probability measure, with no payments in the given period is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P_t=E_t^{Q}[e^{-\int\limits_t^Tr_udu}P_T]\;(2)$$    &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The T-forward martingale measure is: $E_t^{Q^T}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And in the book we have: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P_t=B_t^TE_t^{Q^T}[P_T]\;(3)$$   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First question: What is the difference between (2) and (3)? $B_t^T&#xA;=e^{-\int\limits_t^Tr_udu}$, so how do they differ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next he says that with $B_t^T$ as a numeraire we have that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{0}{B_t^T}=E_t^{Q^T}[\frac{P_T-F_t^T}{B_T^T}];(4)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does he get that? More specifically. Why is $B_T^T$ in the equation as that is equal to 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From (3) i have:&#xA;$P_t=B_t^TE_t^{Q^T}[P_T]$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Subtracting $P_t$ on both sides: &#xA;$0=B_t^TE_t^{Q^T}[P_T]-P_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dividing by $B_t^T$ and using (1) I get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{0}{B_t^T}=E_t^{Q^T}[P_T]-F_t^T$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So where does the $B_T^T$ come from in (4)?&#xA;It is equal to 1, so I know I can always divide by it. But why?&lt;/p&gt;&#xA;" OwnerUserId="26386" LastEditorUserId="26386" LastEditDate="2017-02-03T12:56:09.560" LastActivityDate="2017-02-03T12:56:09.560" Title="Forward price - T-forward martingale" Tags="&lt;probability&gt;&lt;forward&gt;&lt;martingale&gt;" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="32232" PostTypeId="1" CreationDate="2017-02-03T13:58:53.353" Score="2" ViewCount="352" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;The term duration has a special meaning in the context of bonds. It is a measurement of how long, in years, it takes for the &lt;strong&gt;price of a bond to be repaid by its internal cash flows&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I have read this statement from the textbook and try to use the mathematical way to proof (the bolded statement) that is true. Thus, I have made up an example as follow:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Take the discount rate as 7% per annum&#xA;&#xA;Term (yr)   Cash Flow   PV&#xA;1           100         93.45794393&#xA;2           100         87.34387283&#xA;3           1100        897.9276646&#xA;&#xA;Fair value = 93.45794393 + 87.34387283 + 897.9276646 = 1078.729481&#xA;Duration = 1*93.45794393/1078.729481 + 2*87.34387283/1078.729481&#xA;           3*897.9276646/1078.729481&#xA;         = 2.745756684&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I was getting stuck. When I try to add up the PV of cash flow at 2.7458 year, the result is not equal to the price of the bond (i.e. $1078.729481)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone explain (in mathematical sense) why duration is a measure that calculates the time it takes for the price of a bond to be repaid by its internal cash flows , by using the above example? Rigorous proof by formula is also appreciated. Thans!&lt;/p&gt;&#xA;" OwnerUserId="18468" LastEditorUserId="18468" LastEditDate="2017-02-03T14:03:53.920" LastActivityDate="2017-05-17T20:30:36.743" Title="Bond duration and the mathematical proof of 'bond price recovery'" Tags="&lt;bond&gt;&lt;duration&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32234" PostTypeId="2" ParentId="32232" CreationDate="2017-02-03T15:09:34.963" Score="1" Body="&lt;p&gt;Some of the PV is paid back after 1 year, some after 2 years, and the rest after 3 years. The time weighted average of these three numbers gives you the duration:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/68jY8.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/68jY8.png&quot; alt=&quot;pic&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Imagine a medical experiment done with rats. 8.66% of the rats lived for one year, 8.09% of the rats lived for 2 years and the rest (83.23%) survived for 3 years. What is the average survival of rats in this exeriment. The answer is 2.74 years. Duration is just the same except with &quot;dollars of present value&quot; instead of rats.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-02-03T15:28:31.427" LastActivityDate="2017-02-03T15:28:31.427" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32239" PostTypeId="1" CreationDate="2017-02-03T21:08:07.517" Score="5" ViewCount="15669" Body="&lt;p&gt;Sorry but i'm new in quantitative finance. According to BS derivation the risk-free interest rate is the rate to wich the rate of a particular investment tends when the risk tends to zero. Suppose i want to buy on option with fixed strike price and maturity, which rate i have to put into the equation? And why?&lt;/p&gt;&#xA;" OwnerUserId="26330" LastActivityDate="2018-03-01T12:51:14.067" Title="Which risk-free interest rate to use in Black-Scholes equation" Tags="&lt;black-scholes&gt;&lt;interest-rates&gt;&lt;risk&gt;&lt;black&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="32240" PostTypeId="1" CreationDate="2017-02-03T21:28:36.237" Score="0" ViewCount="66" Body="&lt;p&gt;Is there an open architecture API for calculating and adjusting bond prices?  I am looking to adjust bond pricing on OAS or adjusted spreads to various indices and need a tool to process large amounts of data.&lt;/p&gt;&#xA;" OwnerUserId="26404" LastActivityDate="2017-02-04T07:43:08.817" Title="Is there an open architecture API or excel solution for calculating and adjusting bond pricing?" Tags="&lt;interest-rates&gt;&lt;fixed-income&gt;&lt;data&gt;&lt;bond&gt;&lt;bond-yields&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32241" PostTypeId="2" ParentId="32240" CreationDate="2017-02-03T22:08:14.577" Score="-1" Body="&lt;p&gt;Yes, &lt;a href=&quot;/questions/tagged/quantlib&quot; class=&quot;post-tag&quot; title=&quot;show questions tagged &amp;#39;quantlib&amp;#39;&quot; rel=&quot;tag&quot;&gt;quantlib&lt;/a&gt; does that.&lt;br&gt;&#xA;&lt;a href=&quot;http://quantlib.org/index.shtml&quot; rel=&quot;nofollow noreferrer&quot;&gt;QuantLib.org&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26408" LastEditorUserId="18151" LastEditDate="2017-02-04T07:43:08.817" LastActivityDate="2017-02-04T07:43:08.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32242" PostTypeId="2" ParentId="32224" CreationDate="2017-02-03T23:58:37.813" Score="2" Body="&lt;p&gt;The standard formula for Capital Asset Pricing Model is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\bar{r} = r_f + \beta \cdot ( \bar{r_m} - r_f) \quad (1)&#xA;\end{equation}&#xA;in which:&#xA;\begin{equation}&#xA;\bar{r} \textit{ - expected return of an asset}&#xA;\end{equation}&#xA;\begin{equation}&#xA;\ r_f \textit{ - risk-free rate}&#xA;\end{equation}&#xA;\begin{equation}&#xA;\beta \textit{ - beta of an asset}&#xA;\end{equation}&#xA;\begin{equation}&#xA;\bar{r_m} \textit{ - expected market return}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Expected return of an asset is the simple formula of expected price of an asset and a current price of an asset. For example, if the current price is 2 and the expected price is 3, then expected return is 50%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\bar{r} = \frac{E( \tilde{X}  ) - P}{ P } \quad (2)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words the price is discounted expected price:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\ P = \frac{E( \tilde{X}  )}{ 1 + \bar{r} } \quad (3)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Combining the equations (1) and (3) we have your second equation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\ P = \frac{E( \tilde{X}  )}{ 1 + r_f + \beta \cdot ( \bar{r_m} - r_f) } \quad (4)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The formula for an asset beta is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\beta = \frac{Cov( \bar{r}, \bar{r_m} )}{ \sigma_m^2} \quad (5)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After a little modification of the equation (2) we can use it in the equation (5).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\beta = \frac{Cov( \frac{E( \tilde{X}  )}{ P } - 1, \bar{r_m} )}{ \sigma_m^2} = \frac{Cov( E( \tilde{X}  ), \bar{r_m} )}{ \sigma_m^2 \cdot P} \quad (6)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Going back to the equation (1)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\bar{r} = r_f + \frac{Cov( E( \tilde{X}  ), \bar{r_m} )}{ \sigma_m^2 \cdot P} \cdot ( \bar{r_m} - r_f) \quad (7)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After a little modification of the equation (3) and combining it with (7) we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\frac{E( \tilde{X}  )}{P} = 1 + r_f + \frac{Cov( E( \tilde{X}  ), \bar{r_m} )}{ \sigma_m^2 \cdot P} \cdot ( \bar{r_m} - r_f) \quad (8)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After multiplying by P, and ordering the elements of the equation we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\ P= \frac{E( \tilde{X}  ) - \frac{ ( \bar{r_m} - r_f)}{ \sigma_m^2} \cdot Cov( E( \tilde{X}  ), \bar{r_m} )}{1 + r_f}  \quad (9)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe you noticed that in the expression there is a market price of risk formula (how much market is willing to pay for the risk). We write it as lambda&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\lambda = \frac{ ( \bar{r_m} - r_f)}{ \sigma_m^2}  \quad (10)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\ P= \frac{E( \tilde{X}  ) - \lambda \cdot Cov( E( \tilde{X}  ), \bar{r_m} )}{1 + r_f}  \quad (11)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both (9) and (11) are your first formula written differently. We call them certainty-equivalent form of CAPM. It represents the price as the expression of present value of a risk-adjusted payoff. If the asset is uncorrelated with the market, then the result would be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\ P = \frac{E( \tilde{X}  )}{ 1 + r_f} \quad (12)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that exactly the same result would occur, for your second formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the asset is positively correlated with the market, then the adjustment expression (13) makes price lower. If the asset is negatively correlated with the market, then the price is higher. The value of the expression depends obviously also on the value market price of risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\ - \lambda \cdot Cov( E( \tilde{X}  ), \bar{r_m} ) \quad (13)&#xA;\end{equation}&lt;/p&gt;&#xA;" OwnerUserId="26405" LastActivityDate="2017-02-03T23:58:37.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32243" PostTypeId="2" ParentId="32239" CreationDate="2017-02-04T10:02:07.160" Score="-1" Body="&lt;p&gt;Conventionally you use the interest rate of a sovereign with same maturity, that is considered the virtually risk-free asset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for a call on AAPL (T = 6m), you would use 6m rate from t-bills and annualize it.&lt;/p&gt;&#xA;" OwnerUserId="20084" LastEditorUserId="20084" LastEditDate="2017-02-04T11:44:10.637" LastActivityDate="2017-02-04T11:44:10.637" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="32244" PostTypeId="1" AcceptedAnswerId="32254" CreationDate="2017-02-04T11:31:08.170" Score="5" ViewCount="1693" Body="&lt;p&gt;In classical calculus, we know that the limit of percentage return (ie $dS/S$) equals that of the log return (ie. $dln(S)$ ).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With uncertainty, we rely on Ito Lemma to draw a relationship between the two:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation*}&#xA;dS = \mu S dt + \sigma Sdz &#xA;\end{equation*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation*}&#xA;dln(S) = (\mu - \sigma^2/2) dt + \sigma dz &#xA;\end{equation*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand the mathematics behind but I would like to know more about the intuition, mainly&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with uncertainties, when we &quot;switch&quot; from percentage return to log return, why do we have a smaller drift $(\mu - \sigma^2/2)$? Is there any intuition or financial sense behind?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, when we discretize the process, can we draw the same relationship and say something like&#xA;\begin{equation*}&#xA;\Delta S = \mu S \Delta t + \sigma S \Delta z &#xA;\end{equation*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &#xA;\begin{equation*}&#xA;\Delta ln(S) = (\mu - \sigma^2/2) \Delta t + \sigma \Delta z &#xA;\end{equation*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance.&lt;/p&gt;&#xA;" OwnerUserId="26415" LastActivityDate="2017-02-05T19:07:11.693" Title="Geometric Brownian Motion: percentage returns vs log-returns" Tags="&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32245" PostTypeId="2" ParentId="31950" CreationDate="2017-02-04T14:08:24.307" Score="3" Body="&lt;p&gt;As stock price $S$ follows Geometric Brownian motion,we can use Ito's lemma to determine the  process followed by $S^a$. We obtain&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS^n=nS^{n-1}dS + \frac12 n(n-1)S^{n-2}(\sigma S)^2dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$L.H.S.=nS^n\frac{dS}{S}+\frac12 n(n-1)S^n\sigma^2dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dividing by $S^n$,we get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{dS^n}{S^n}=[n(\alpha-\delta) +\frac12 n(n-1)\sigma^2]dt + n\sigma dZ$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus $S^n$ follows same process as $S$ with drift $n(\alpha-\delta) + \frac12 n(n-1)\sigma^2$ and risk $n\sigma dZ$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E[S(T)^n]=S(t)^n e^{[n(\alpha-\delta)+0.5n(n-1)\sigma^2][T-t]}$&lt;/p&gt;&#xA;" OwnerUserId="15605" LastActivityDate="2017-02-04T14:08:24.307" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32246" PostTypeId="2" ParentId="32000" CreationDate="2017-02-04T15:50:49.583" Score="2" Body="&lt;p&gt;I am not an expert on the Bloomberg Terminal. But just looking at it now I see it knows the CUSIP, the ISIN, the SEDOL, the WPK (wertpapierkennummer) and the SICOVAM. I don't believe it knows the CSRP-permno as far as I know. It does not do a particularly good job of linking to other information systems, being more of a self contained system itself. But perhaps there are special functions for that purpose that I don't know .&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-02-04T15:50:49.583" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32247" PostTypeId="1" AcceptedAnswerId="32249" CreationDate="2017-02-04T18:28:03.713" Score="0" ViewCount="145" Body="&lt;p&gt;In finance, we often assume that the log-returns $\ln(1+R(t))$ follow a normal distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $\ln(1+R(t)) \approx R(t)$ when $R(t)$ is small,&#xA;\begin{equation*}&#xA;dS/S \sim \text{Normal}.&#xA;\end{equation*} &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I have seen sometimes people assuming that &#xA;\begin{equation*}&#xA;\Delta S/S \sim \text{Normal},&#xA;\end{equation*} &lt;/p&gt;&#xA;&#xA;&lt;p&gt;so I wonder if the result holds in general (e.g. for percentage returns over a long time period, my understanding is that percentage return will follow a Normal distribution only when its value is small, i.e. for $dS/S$ ). In particular, what conclusion can we draw about the distribution of $\Delta S/S$ if we assume that log-returns $d\ln(s)$ follow a Normal distribution?&lt;/p&gt;&#xA;" OwnerUserId="26415" LastEditorUserId="26415" LastEditDate="2017-02-05T11:34:33.153" LastActivityDate="2017-02-05T11:34:33.153" Title="What is the distribution of percentage return in general?" Tags="&lt;lognormal&gt;&lt;return&gt;&lt;normal&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32249" PostTypeId="2" ParentId="32247" CreationDate="2017-02-04T20:53:06.090" Score="1" Body="&lt;p&gt;What is the mapping between log return $r_l$ and arithmetic return $R_A$? It is $r_l=\ln(1+R_A)$ and $R_A=e^{r_l}-1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $r_l$ has the normal distribution then $e^{r_l}$ has the lognormal distribution (by definition) and $e^{r_l}-1=R_A$ has the &quot;lognormal distribution shifted to the left by 1&quot;. I don't think there is a name for this distribution, which has support on $-1\le R_A \le\infty$.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-02-04T20:53:06.090" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32250" PostTypeId="1" CreationDate="2017-02-05T07:17:19.903" Score="1" ViewCount="1534" Body="&lt;p&gt;This was asked to me in my product control interview. What factors contribute to the daily pnl of a bond, if you exclude daily carry, price change and interest rate change? There would still be a pnl, what does it consist of? &lt;/p&gt;&#xA;" OwnerUserId="26425" LastEditorUserId="16160" LastEditDate="2017-12-04T03:48:07.043" LastActivityDate="2017-12-04T11:23:02.817" Title="Product Control Fixed Income - Interview Question" Tags="&lt;fixed-income&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32251" PostTypeId="2" ParentId="24799" CreationDate="2017-02-05T11:05:49.623" Score="2" Body="&lt;p&gt;I have been using &lt;a href=&quot;https://pypi.python.org/pypi/Yahoo-ticker-downloader/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Yahoo-ticker-downloader.py&lt;/a&gt; to download tickers from Yahoo! It returns &lt;strong&gt;MOST&lt;/strong&gt; tickers from international exchanges and returns Ticker, Company Name, Exchange, Sector, and Category Number. Here are 1,500+ tickers form the Toronto &amp;amp; TSX Venture Exchanges: &lt;a href=&quot;https://drive.google.com/file/d/0B4DM1BWIv_-IaG9rMFBFdDdOTFE/view?usp=sharing&quot; rel=&quot;nofollow noreferrer&quot;&gt;You're Welcome&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13428" LastEditorUserId="1181" LastEditDate="2019-01-25T06:43:58.540" LastActivityDate="2019-01-25T06:43:58.540" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="32253" PostTypeId="1" AcceptedAnswerId="32255" CreationDate="2017-02-05T17:25:30.767" Score="1" ViewCount="2307" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Consider a world where there are only two risky stocks, $A$ and $B$, whose details are listed in the table below:&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/rPbkW.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/rPbkW.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, the correlation between the returns of stocks $A$ and $B$ is $\rho_{A B} = \frac{1}{3}$. There is also a risk-free asset and in this world the CAPM is satisfied exactly.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;a.) What is the expected rate of return of the market portfolio?&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;b.) What is the standard deviation of the market portfolio?&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;c.) What is the beta of stock A?&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;d.) What is the risk-free rate in this world?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Solution to a.): We have &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Cov(r_A, r_B) = \frac{1}{3}(.15)(.09) = .0045$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recall that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;\sigma^{2}_{P} &amp;amp;= \sigma^{2}_{A}W_A^{2} + \sigma^{2}_{B}W_B^{2} + 2\sigma_A \sigma_B cov(r_A,r_B)\\&#xA;&amp;amp;=  \sigma^{2}_{A}W_A^{2} + \sigma^{2}_{B}(1 - W_A)^{2} + 2\sigma_A \sigma_B cov(r_A,r_B)\\&#xA;&amp;amp;= .0306 W_A^{2} - .0162 W_A + .0082215\\&#xA;\frac{\partial \sigma^{2}_{P}}{\partial W_A} &amp;amp;= 0 \implies \boxed{W_A = .2647}&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\partial^2 \sigma^{2}_{P}}{\partial W_A^2} = .0612 &amp;gt; 0$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;thus the variance is at a minimum. Hence &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E[r_P] = W_A E[r_A] + W_B E[r_B] = .1279 \approx .13$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solution to b.): We have &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma^2{P} = .006074$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\boxed{\sigma_P =.0779}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For some reason that I don't fully understand, my professor in the homework has $9\%$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure how to get question part &lt;strong&gt;c.)&lt;/strong&gt; or &lt;strong&gt;d.)&lt;/strong&gt; because it seems that there isn't enough information.&lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="26432" LastEditDate="2017-02-05T23:44:02.013" LastActivityDate="2017-02-05T23:44:02.013" Title="Given two risky stocks calculate the rate of return, standard deviation, beta, and risk-free rate" Tags="&lt;modern-portfolio-theory&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;&lt;math&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32254" PostTypeId="2" ParentId="32244" CreationDate="2017-02-05T18:26:59.740" Score="6" Body="&lt;p&gt;The percentage return over the infinitesimal interval $[t, t+dt]$ is given by&#xA;\begin{align*}&#xA;\frac{S_{t+dt} - S_t}{S_t} \approx \mu dt + \sigma \sqrt{dt} \xi,&#xA;\end{align*}&#xA;where $\xi$ is a standard normal random variable. On the log-return,&#xA;note that, for $x$ sufficiently small,&#xA;\begin{align*}&#xA;\ln (1+x) \approx x -\frac{x^2}{2},&#xA;\end{align*}&#xA;then, by ignoring the higher order terms (relative to $dt$),&#xA;\begin{align*}&#xA;\ln \frac{S_{t+dt}}{S_t} &amp;amp;= \ln \left(1+ \frac{S_{t+dt} - S_t}{S_t} \right)\\&#xA;&amp;amp;\approx \frac{S_{t+dt} - S_t}{S_t} -\frac{1}{2} \left( \frac{S_{t+dt} - S_t}{S_t}\right)^2\\&#xA;&amp;amp;\approx \mu dt + \sigma \sqrt{dt} \xi -\frac{1}{2} \left(\mu dt + \sigma \sqrt{dt} \xi\right)^2\\&#xA;&amp;amp;\approx \mu dt + \sigma \sqrt{dt} \xi -\frac{1}{2}\sigma^2\xi^2 dt\\&#xA;&amp;amp;\approx \left(\mu - \sigma^2/2 \right)dt + \sigma \sqrt{dt} \xi.&#xA;\end{align*}&#xA;Here, we assume that&#xA;\begin{align*}&#xA;\xi^2 \approx E(\xi^2) = 1.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-02-05T19:07:11.693" LastActivityDate="2017-02-05T19:07:11.693" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32255" PostTypeId="2" ParentId="32253" CreationDate="2017-02-05T19:21:44.497" Score="3" Body="&lt;p&gt;a.) The market capitalization $m_{cap} = 100*\$1.50 + 150*\$2.0 = \$150 + \$300 = \$450$, so the weight of each asset is $1/3$ and $2/3$ respectively in the market portfolio. You don't need to find the minimum variance portfolio. If you plug in these values you get exactly $E[r_m] = 1/3*0.15 + 2/3*0.12 = 0.13.$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;b.) The formula is wrong, as you multiply your covariance with the standard deviations of the assets. &#xA;The correct formula is $$\sigma_P^2 = w_A^2\sigma_a^2 + w_B^2\sigma_b^2 + 2w_aw_b\sigma_a\sigma_b\rho_{ab} \\=1/3^2*0.15^2 + 2/3^2*0.09^2 + 2*1/3*2/3*0.0045 = 0.0080506$$&#xA;Taking the squareroot gives you a standard deviation of $9\%$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;c.) The Beta of an asset can be derived as $\beta_a = \frac{\sigma_a}{\sigma_{market}}\rho_{a,market}$. You thus need to find the correlation, or covariance, between the market and stock a.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;d.) The risk-free rate of the market can be considered as implicitly defined in the CAPM formula, $$E[R_a] = R_f + \beta_a(E[R_m] - R_f).$$&#xA;When you know $\beta_a$, you get $$R_f = \frac{1}{1-\beta_a}(E[R_a]-\beta_aE[R_m])$$&lt;/p&gt;&#xA;" OwnerUserId="13808" LastActivityDate="2017-02-05T19:21:44.497" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="32257" PostTypeId="1" CreationDate="2017-02-05T22:33:31.657" Score="-2" ViewCount="1397" Body="&lt;p&gt;I wonder for exponential discounting method to do the discount cash flow, may I doing it right as the following screenshot from Excel, assuming the discount rate is 4%?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/l5qeZ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/l5qeZ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/abSOE.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/abSOE.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26436" LastEditorUserId="16160" LastEditDate="2017-02-05T23:14:34.073" LastActivityDate="2017-02-05T23:57:40.393" Title="Exponential Discounting of Cash Flows" Tags="&lt;finance&gt;&lt;discounting&gt;" AnswerCount="1" CommentCount="5" ClosedDate="2017-02-06T13:13:29.527" ContentLicense="CC BY-SA 3.0" />
  <row Id="32258" PostTypeId="2" ParentId="32257" CreationDate="2017-02-05T23:57:40.393" Score="2" Body="&lt;p&gt;Then I suppose the following will be how it should be done?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/LH2wV.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/LH2wV.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26437" LastActivityDate="2017-02-05T23:57:40.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32260" PostTypeId="1" CreationDate="2017-02-06T05:16:07.487" Score="0" ViewCount="53" Body="&lt;p&gt;Let's say that I have a historical price trace of future prices. I convert this variable to get it normally distributed. (Let's assume that the random variable after this conversion turns out to become normally distributed.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The conversion is done as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say that we define these prices as Subscript[P, t], at time t. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\log \left(\frac{P_{t+1}}{P_t}\right)-\mu }{\sigma }$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I now have a random variable with mean zero and variance 1 that is normally distributed. (assumption)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\int e^{-\frac{(x-\mu )^2}{2 \sigma ^2}} \, dx}{\sqrt{2 \pi  \sigma ^2}}=\frac{\sigma  (\text{erf} (x-\mu ))}{\left(\sqrt{2} \sigma \right) \left(2 \sqrt{\sigma ^2}\right)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then setting $\sigma =1$ and $\mu =0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want this probability band to contain 90% of the distribution. Using fundamental theorem of calculus:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$F(x)-F(-\infty )=0.9$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From this I solve for x.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$F(x)=\frac{1}{2} \text{erf}\left(\frac{x}{\sqrt{2}}\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$F(x)=\frac{1}{2} \text{erf}\left(\frac{x}{\sqrt{2}}\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and limit as x approaches infinity is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\lim_{x\to -\infty } \, \frac{1}{2} \text{erf}\left(\frac{x}{\sqrt{2}}\right)=-\frac{1}{2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and is calculated as follow using the continuity of Erf(x) at x = -inf.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{1}{2} \text{erf}\left(-\frac{\infty }{\sqrt{2}}\right)=-1*\frac{1}{2}=-\frac{1}{2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now from these changes we have this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{1}{2} \text{erf}\left(\frac{x}{\sqrt{2}}\right)--\frac{1}{2}=0.9$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{x}{\sqrt{2}}=\text{erf}^{-1}(0.8)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then from this: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$x=\sqrt{2} \text{erf}^{-1}(0.8)$&#xA;$$x=1.28155$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My variable is in daily increments: and I want to scale this probability band as the timeframe increases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\log \left(\frac{P_{t+1}}{P_t}\right)-\mu }{\sigma }=1.28155$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then with mean = 0 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P_{t+1}=P_t e^{1.28155 \sigma  \sqrt{t}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would this scaling of z value by volatility and square root of time be correct? And if so which assumptios has to be satisfied for it to hold?&lt;/p&gt;&#xA;" OwnerUserId="26439" LastActivityDate="2017-02-06T05:16:07.487" Title="Scaling Z value/or voll with square root of time" Tags="&lt;stochastic-processes&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32261" PostTypeId="1" CreationDate="2017-02-06T13:29:10.170" Score="2" ViewCount="92" Body="&lt;p&gt;I am looking for a simple way to estimate price time series of downstream products based on price of the main &quot;raw&quot; commodity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, would like to estimate a price for wheat flour based on available wheat price data and wheat per unit weight flour conversion factor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some cursory googling seems to suggest that there is no standard way to do this. How would a quant go about such a task?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Incidentally, if anyone knows of a source for readily available flour price data, please let me know.&lt;/p&gt;&#xA;" OwnerUserId="26444" LastEditorUserId="467" LastEditDate="2017-02-07T04:55:45.907" LastActivityDate="2019-02-03T17:16:45.400" Title="How to derive the prices of downstream products from raw commodity prices?" Tags="&lt;pricing&gt;&lt;commodities&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32266" PostTypeId="2" ParentId="25359" CreationDate="2017-02-06T17:58:43.477" Score="1" Body="&lt;p&gt;Returns on the S&amp;amp;P 500, disseminated by S&amp;amp;P and other statistical firms are computed using closing prices. Institutional investors compare their own close to close returns between two dates to the S&amp;amp;P total return benchmark.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The standard phrase &quot;UDR will replace GMCR after close of trading on Friday March 4th&quot; simply means that in computing returns from March 3 to March 4th the price of GMCR on these two days is used. In computing S&amp;amp;P500 returns from March 4 to the next trading day March 7, 2016 the price of UDR will be used (and the GMCR price will &lt;em&gt;not&lt;/em&gt; be used).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are a trader who is trying to match the S&amp;amp;P500 performance, what you do is up to you (in terms of buying/selling). S&amp;amp;P is just telling you how they will compute the day-to-day performance that you are trying to match. The list of stocks used will change in the manner described.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the short answer to your question is yes: the substitution occurs at the close (never in the middle of the day or at the open; S&amp;amp;P does not publish. and no one would be interested in purchasing, total return figures computed at such strange times). &lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-05-08T14:54:40.340" LastActivityDate="2017-05-08T14:54:40.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32267" PostTypeId="1" AcceptedAnswerId="32270" CreationDate="2017-02-06T18:19:22.370" Score="0" ViewCount="220" Body="&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A share of non-dividend paying stock is trading at USD 30. The maturity&#xA;of both options is 1 year from now. A put with a strike of USD 28 is trading at USD 1 and call with a strike of USD 29 is trading at USD 8 The annual risk-free interest rate is 20%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an arbitrage opportunity? If so, demonstrate how an arbitrage profit&#xA;can be calculated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Answer&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From my calculations I cannot find an arbitrage opportunity. I have tried various payoff tables,but still unsuccessful. I am preparing for my exams and am still finding these problems very confusing. Is there any tricks or hints anyone can give me.&lt;/p&gt;&#xA;" OwnerUserId="26447" LastEditorUserId="24222" LastEditDate="2017-02-06T18:34:41.983" LastActivityDate="2017-02-06T21:49:26.327" Title="Arbitrage problem" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;arbitrage&gt;&lt;derivatives&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ClosedDate="2017-02-07T13:24:33.093" ContentLicense="CC BY-SA 3.0" />
  <row Id="32268" PostTypeId="1" AcceptedAnswerId="34638" CreationDate="2017-02-06T19:12:48.640" Score="6" ViewCount="286" Body="&lt;p&gt;I am wondering about implications of the speed of intra-daily trading on the wealth of an long-term investor. I am not necessarily asking about &lt;a href=&quot;https://quant.stackexchange.com/questions/1658/has-high-frequency-trading-hft-been-a-net-benefit-or-cost-to-society&quot;&gt;the costs of HFT trading to society&lt;/a&gt; but instead I wonder whether intra-daily price fluctuations or, in the extreme case, flash crashes should concern an investor who aims at holding a portfolio for a long time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can imagine that the following factors are certainly important:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Direct effect when setting up the portfolio (Costs of liquidity, e.g. Spread, Market Depth, Market impact are directly affected by high-frequency market microstructure)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Increased co-movement due to HFT-Traders: Serving as liquidity bridges between natural buyers and sellers, HFT-Traders may hedge their (market-maker like) positions with correlated assets and therefore may increase correlations in general which has an effect on the optimal portfolio structure (see, for example &lt;a href=&quot;http://www.worldscientific.com/worldscibooks/10.1142/8967&quot; rel=&quot;nofollow noreferrer&quot;&gt;this excellent book&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Obviously, intra-daily price movements determine the end-of-day price, and therefore the distribution of long-term returns depends on the intra-daily price fluctuations. However, fast price movements followed by recovery &lt;a href=&quot;http://www.cnbc.com/id/46835129&quot; rel=&quot;nofollow noreferrer&quot;&gt;such as during the Apple flash crash on BATS&lt;/a&gt; is probably nothing, I would care about if I added some stocks to my retirement plan - isn't this myopic and instead we should be worried if flash crashes occur? &lt;/p&gt;&#xA;" OwnerUserId="16249" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2017-06-10T15:49:54.243" Title="Why should long-term investors care about flash crashes/ intra-daily volatility/HFT?" Tags="&lt;high-frequency&gt;&lt;market-microstructure&gt;&lt;investment&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32269" PostTypeId="7" CreationDate="2017-02-06T20:05:14.320" Score="0" Body="&lt;p&gt;&#xA;    On Stack Exchange, we believe the core moderators should come &lt;i&gt;from&lt;/i&gt; the community, and be elected by the community itself through popular vote. We hold regular elections to determine who these community moderators will be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&#xA;    Community moderators are &lt;a href=&quot;http://blog.stackoverflow.com/2009/05/a-theory-of-moderation/&quot;&gt;accorded the highest level of privilege on our community&lt;/a&gt;, and should themselves be exemplars of positive behavior and leaders within the community.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&#xA;    Our general criteria for moderators is as follows:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;    &lt;li&gt;patient and fair&lt;/li&gt;&#xA;    &lt;li&gt;leads by example&lt;/li&gt;&#xA;    &lt;li&gt;shows respect for their fellow community members in their actions and words&lt;/li&gt;&#xA;    &lt;li&gt;open to some light but firm moderation to keep the community on track and resolve (hopefully) uncommon disputes and exceptions&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&#xA;    Every election has three phases:&#xA;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;    &lt;li&gt;Nomination&lt;/li&gt;&#xA;    &lt;li&gt;Primary&lt;/li&gt;&#xA;    &lt;li&gt;Election&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&#xA;    Please participate in the moderator elections by voting, and perhaps even by nominating yourself to be a community moderator!&#xA;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://chat.stackexchange.com/rooms/93885/2019-quantitative-finance-moderator-election-chat&quot;&gt;Election chat room&lt;/a&gt; - discuss the election, candidates, etc.&lt;/li&gt;&#xA;&lt;li&gt;For questions about the election process itself, visit &lt;a href=&quot;https://https://quant.meta.stackexchange.com/tags/election&quot; rel=&quot;nofollow noreferrer&quot;&gt;Meta&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;https://quant.meta.stackexchange.com/q/1600/15783&quot;&gt;The candidates answer your questions&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="-1" LastEditorUserId="15783" LastEditDate="2019-05-20T20:03:28.333" LastActivityDate="2019-05-20T20:03:28.333" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="32270" PostTypeId="2" ParentId="32267" CreationDate="2017-02-06T21:49:26.327" Score="1" Body="&lt;p&gt;You could buy one share, sell one call, and buy one put. That would cost you \$23 (= 30 - 8 + 1). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A year later, if the stock were higher than \$29, the call buyer would call away the stock for \$29. You would net \$6. (Same is true if the stock were exactly \$29.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A year later, if the stock were lower than \$28, you would exercise the put for \$28. You would net \$5. (Same is true if the stock were exactly \$28.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A year later, if the stock were between \$28.01 and \$28.99, both options would expire worthless, and you could sell the stock for a net between \$5.01 and \$5.99.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, you'd need to pay the piper. Your net would be reduced for borrowing the \$23 for a year. At 20%, this would be \$4.60. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You would be guaranteed \$0.40 (=\$5 - \$4.60). &lt;/p&gt;&#xA;" OwnerUserId="343" LastActivityDate="2017-02-06T21:49:26.327" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32271" PostTypeId="1" CreationDate="2017-02-06T22:49:56.317" Score="3" ViewCount="35" Body="&lt;p&gt;Are there ways to quantify which percentage of companies make a change to their quarterly earnings dates?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example company X was scheduled to report results on February 8 and the date is moved to February 15 instead. This would count as a move, or binary outcome of YES. Companies which report on their expected date, would be NO.&lt;/p&gt;&#xA;" OwnerUserId="19945" LastEditorUserId="467" LastEditDate="2017-02-07T04:09:43.263" LastActivityDate="2017-02-07T04:09:43.263" Title="How to calculate which companies moved their earnings dates?" Tags="&lt;earnings&gt;&lt;corporate-actions&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32273" PostTypeId="1" CreationDate="2017-02-07T03:00:32.747" Score="5" ViewCount="3611" Body="&lt;p&gt;I'm trying to calculate the price of a forward contract on a zero-coupon bond (ZCB).  The forward contract matures at $t_1$ and the ZCB matures at $t_2$.  So is the price of the forwards contract just the ratio of (price ZCB that matures at $t_2$) / (price ZCB that matures at $t_1$) ?&lt;/p&gt;&#xA;" OwnerUserId="26297" LastEditorUserId="24222" LastEditDate="2017-02-08T09:58:45.460" LastActivityDate="2021-04-16T16:13:15.983" Title="Price a forward contract on a zero-coupon bond" Tags="&lt;option-pricing&gt;&lt;forward&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32274" PostTypeId="6" CreationDate="2017-02-07T05:21:33.933" Score="0" Body="&lt;p&gt;I am SRKX and I have been one of the Quantitative Finance site's moderators for the past 4 years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I live in Hong Kong, which makes me a good candidate to interact in the APAC timezone while Europe and US are still asleep.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a mixed background between computer science and financial engineering, so I can understand questions which require both skills sets and help making sure they are formatted and classified as required to be answered properly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I worked in a quite broad number of environments: hedge fund, physical commodities trader, asset manager, private bank. Therefore, I am able to understand the point of view of many different users of this site and sometimes clarify what might be lost in translation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think I have shown over the past 4 years that I have been successful at minimizing arguments between users without being too restrictive and I would love to keep being one of your moderators.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find all my answers to the election questionnaire &lt;a href=&quot;http://meta.quant.stackexchange.com/a/1531/467&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="467" LastEditorUserId="467" LastEditDate="2017-02-07T05:21:33.933" LastActivityDate="2017-02-07T05:21:33.933" CommentCount="0" CommunityOwnedDate="2017-02-07T05:21:33.933" ContentLicense="CC BY-SA 3.0" />
  <row Id="32275" PostTypeId="1" CreationDate="2017-02-07T08:59:29.813" Score="0" ViewCount="85" Body="&lt;p&gt;I have seen two definitions of Beta&#xA;one is&#xA;$$\beta = \rho\dfrac{\sigma_{asset}}{\sigma_{market}}$$&#xA;Here $\rho$ is the correlated coeffient&lt;/p&gt;&#xA;&#xA;&lt;p&gt;another one is&#xA;$$\beta = \dfrac{r_{expect} - r_{risk\ free}}{r_{market} - r_{risk\ free}}$$&#xA;I don't know which one is correct or they are equivalent? By the way, here $\sigma_{asset}$ is the volatility of &lt;code&gt;historical return&lt;/code&gt; or &lt;code&gt;expected return&lt;/code&gt;? &lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-02-07T09:28:20.307" Title="Two definitions of Beta" Tags="&lt;capm&gt;&lt;beta&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32276" PostTypeId="2" ParentId="32275" CreationDate="2017-02-07T09:28:20.307" Score="3" Body="&lt;p&gt;As @Rosetta states in the comment above, I think the difference between the two formulas you represent can be explained by either focusing on estimating the coefficient $\beta$ or by taking into consideration expectations based on CAPM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the well-known framework&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_a = r_f +\beta (r_m-rf)+\varepsilon$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you take expectations you obtain&#xA;$$E(r_a-r_f) = \beta E(r_m-rf)+E(\varepsilon) \\ \text{ or } \frac{E(r_a)-r_f}{E(r_m)-r_f} = \beta $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to draw some inference and estimate $\hat{\beta}$, then you are probably going to take some time-series of past observations of the returns $r_a, r_f, r_m$ and compute the OLS estimate $\hat{\beta}$ which boils down to &#xA;$$\hat{\beta}=\hat{\rho}\frac{\hat{\sigma}^2 _a}{\hat{\sigma}^2 _m}.$$&lt;/p&gt;&#xA;" OwnerUserId="16249" LastActivityDate="2017-02-07T09:28:20.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32277" PostTypeId="2" ParentId="32114" CreationDate="2017-02-07T09:48:40.340" Score="1" Body="&lt;p&gt;As Janthelme said the Put-Call Parity is the best approach. Nevertheless if you have enough Information you can also use the Interest Rate and the Dividend Yield to come up with an expected Future Stock level.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But remarkt the convexity of an option. Hence the todays premium is not equal the discounted value of E[S]-K.&lt;/p&gt;&#xA;" OwnerUserId="24362" LastActivityDate="2017-02-07T09:48:40.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32278" PostTypeId="1" CreationDate="2017-02-07T10:24:47.807" Score="2" ViewCount="273" Body="&lt;p&gt;I am trying to get my hands on some historical commodity futures options data for about 35 commodity futures.&#xA;So far in my search the only way I can get the data seems to be through the Commodity Research Bureau.&#xA;I was wondering if anyone knows any other source readily available to academics such as through datastream or bloomberg, where I can get this data?&#xA;Alternatively, are there any other vendors who have historical commodity futures options data that I can access via an API for a reasonable fee?&lt;/p&gt;&#xA;" OwnerUserId="26453" LastActivityDate="2017-02-07T10:24:47.807" Title="commodity futures options data" Tags="&lt;options&gt;&lt;futures&gt;&lt;commodities&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="32279" PostTypeId="2" ParentId="31964" CreationDate="2017-02-07T11:43:12.737" Score="4" Body="&lt;p&gt;As a start: I am sure some asset managers don't know too much mathematical finance and do a good job. They exist.&#xA;On the other hand as a mathematician I see mathematics (and classicial mathematical finance - math.fin.) still in various areas and sometimes it is not that easy to draw the line. Let's look at examples:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If you think of stocks then mathematical finance is hardly needed in AM.&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you look at bonds then a proper notion of yield curve, forward curve and so forth is useful. You can do a lot of math with floating coupon bonds. Even more with callable bonds and financials like to issue callable bonds.&#xA;Even a yield-curve (OIS or similar) is much more complicated these days. Thus bonds and moneymarket still use math.finance.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Concerning derivatives we have the exchange traded derivatives. You can trade stock-futures with only little knowledge of math.fin.. Plain vanilla options are still there. You can &quot;live&quot; without math.fin. there - but it helps if you want to do further analyses. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;Concerning OTC derivatives &lt;a href=&quot;https://en.wikipedia.org/wiki/European_Market_Infrastructure_Regulation&quot; rel=&quot;nofollow noreferrer&quot;&gt;EMIR&lt;/a&gt; made it more complicated and expensive to trade them - thus the variety has decreased (though, we still use IR-swaps ;)). This is not bad in my mind as in the days back then people invented a lot of derivatives that nobody could handle. You needed a lot math.fin. but it often gave you a wrong feeling of control and security.&lt;/li&gt;&#xA;&lt;li&gt;newer derivatives: volatility itself is traded these days (exchange traded e.g. as VIX-futures and OTC as variance-swap) and you certainly need math.fin. in this area.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Summing up: For cash instruments you hardly need any mathematical finance. Bonds and moneymarket instruments are still best described using the notions of mathematical finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To understand derivatives  (which is the core of the subject) you still need it. However, OTC derivatives are much more regulated today and therefore less often implemented.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2017-02-07T15:55:52.857" LastActivityDate="2017-02-07T15:55:52.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32280" PostTypeId="1" AcceptedAnswerId="32354" CreationDate="2017-02-07T11:58:21.327" Score="1" ViewCount="501" Body="&lt;p&gt;Here's a toy example of a simple trading strategy that I just read about (from a book called &quot;Trading Alphas&quot;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say that we expect a stock that's been going up over the past week to now go down, since traders are expected to book profits and the price will accordingly decrease. Our trading universe has only 2 stocks - Google and Apple. We could have a trading strategy in which our position in a stock is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;position $ = - ($past week return$)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the above, we get positions in Google and Apple as $+2.5$ and $+7.5$ respectively. So far so good. Now, suppose we're expecting some bad event for the technology sector. A long position in these stocks could result in heavy losses. The book prescribes that one way to avoid such losses is to develop a &lt;strong&gt;sector-neutral strategy&lt;/strong&gt; - the sum of positions of individual stocks in that sector would be $0$, i.e., take a long position in either Google or Apple and an equal short position in the other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;This would change the old values of $+2.5$ and $+7.5$ to $-5.0$ and $+5.0$ for Google and Apple, respectively.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can understand that we go long in Apple since our previous strategy prescribed a higher positive position in it ($+7.5$ as against only $+2.5$ for Google). But we could just as easily have had a different prior strategy that similarly assigned a more positive position to Apple. So the end result would've been similar - a sector neutral strategy that assigns $+x$ to Apple and $-x$ to Google.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In that sense, doesn't the sector-neutral strategy make our previous trading strategy completely irrelevant (apart from the magnitude of $x$)?&lt;/p&gt;&#xA;" OwnerUserId="19057" LastEditorUserId="19057" LastEditDate="2017-02-07T12:31:54.413" LastActivityDate="2017-02-09T23:30:59.133" Title="Making a Trading Strategy Industry-Neutral" Tags="&lt;quant-trading-strategies&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32282" PostTypeId="1" AcceptedAnswerId="32370" CreationDate="2017-02-07T14:03:19.230" Score="1" ViewCount="237" Body="&lt;p&gt;I'm self-studying BDT and I'm having some difficulty with what is meant by the &quot;short-rate volatility parameter for the &lt;em&gt;first year&lt;/em&gt;&quot; and &quot;the short-rate volatility parameter for the &lt;em&gt;second year&lt;/em&gt;,&quot; as in the below problem (taken from an actuarial practice exam on models for financial economics):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/CVXdI.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/CVXdI.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The confusion is because, intuitively, I would think &quot;first year&quot; refers to time $t \in [0, 1)$, &quot;second year&quot; refers to $t \in [1, 2)$, etc. This is because I always think about time as measured starting from $t = 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I would think that if the author intended for $\sigma_1 = 0.5\ln{(r_u/r_d)}$ to be the short rate volatility for $t \in [1, 2)$, it would have been stated &quot;the short term volatility at the beginning of the second year.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The below quote is taken from my other study manual on models for financial economics by Abraham Weishaus:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/GI8Co.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/GI8Co.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems to confirm my thoughts, or I may just be confused. Am I thinking about this incorrectly?&lt;/p&gt;&#xA;" OwnerUserId="5641" LastActivityDate="2017-02-12T00:36:31.047" Title="Clarification on the Black-Derman-Toy model regarding measuring time and notation" Tags="&lt;interest-rates&gt;&lt;binomial-tree&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32284" PostTypeId="1" CreationDate="2017-02-07T14:30:20.893" Score="2" ViewCount="111" Body="&lt;p&gt;We consider one factor driving model of fixed income product say short-term interest $r(t)=\lim\limits_{T\rightarrow t} R(t,T),$  $R(t,T)$ is yield i.e &#xA;$$B(t,T)e^{(T-t)R(t,T)} = 1$$ Then we see several PDE of contingent claim&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Zero-coupon bond&lt;/code&gt; $B(t,T)$&#xA;$$\dfrac{\partial B}{\partial t} + LB -r(t)B = 0$$&#xA;here $L$ is the differential operator in Feynman-Kac equation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Swap of fixed rate&lt;/code&gt; $r^*$&#xA;$$\dfrac{\partial V}{\partial t} + LV -r(t)V + (r - r^*) = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Caplet at rate&lt;/code&gt; $r*$&#xA;$$\dfrac{\partial V}{\partial t} + LV -r(t)V + \min(r,r^*) = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Floorlet at rate&lt;/code&gt; $r*$&#xA;$$\dfrac{\partial V}{\partial t} + LV -r(t)V + \max(r,r^*) = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here $r = r(t)$&#xA;and $V(t,T,r(t))$ is the value of contingent claim which is the function of $t$ and $r$ e.g, for zero-coupon bond $V=B.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I couldn't understand when the dynamic of $r(t)$ is given, why there are some inhomogeneous terms in the Black-Scholes equation? Can some one explain one of later three?&lt;/p&gt;&#xA;" OwnerUserId="26165" LastEditorUserId="26165" LastEditDate="2017-02-08T01:58:23.307" LastActivityDate="2017-02-10T09:34:15.690" Title="Why there is some inhomogeneous term in the PDE of fixed income" Tags="&lt;fixed-income&gt;&lt;swaps&gt;&lt;black-scholes-pde&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32286" PostTypeId="2" ParentId="21169" CreationDate="2017-02-07T16:59:43.380" Score="1" Body="&lt;p&gt;I believe, that Bloomberg and Factset provide the most consistent data set out there. However, their solutions are quite pricey (unless you already have access). A friend of mine is working on a similar solution, which is offered for free. Check it out under www.simfin.com&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update 30.07.17: So he has just updated the site and now standardized company statements for over 2000 US equities and financial ratios are available (all based on SEC data with free download). If you are looking for a bulk data download feel free to reach out to him.&lt;/p&gt;&#xA;" OwnerUserId="22841" LastEditorUserId="22841" LastEditDate="2017-07-30T09:23:25.087" LastActivityDate="2017-07-30T09:23:25.087" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32287" PostTypeId="1" CreationDate="2017-02-07T17:11:50.793" Score="2" ViewCount="2770" Body="&lt;p&gt;Prime brokers offer what is called &quot;arranged financing&quot; which allows hedge funds to gain maximum leverage - more than allowed under the Portfolio Financing platform. I understand there is an element of stock lending where some or most of the Hedge Fund's long/short securities in the account are being transferred (lent out) to another legal entity (usually offshore), which leaves only a fraction of the portfolio in the main account, where a 15% HC is applied. The rest of the portfolio is collateralized as a stock loan....&#xA;I am just missing the exact details of how and what is trasfered and how is the additional leverage achieved? Thank you&lt;/p&gt;&#xA;" OwnerUserId="26459" LastActivityDate="2017-02-07T17:11:50.793" Title="How exactly does &quot;arranged financing&quot; work?" Tags="&lt;leverage&gt;&lt;hedge-fund&gt;&lt;banking-regulations&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32288" PostTypeId="2" ParentId="32273" CreationDate="2017-02-07T18:11:30.143" Score="3" Body="&lt;p&gt;Let $E^{t_1}$ be the expectation operator under the $t_1$-forwad probability measure $Q^{t_1}$, which takes the bond price process $\{P(t, t_1), \, 0\le t \le t_1\}$ as the numeraire. Then, the price of the forward contract, at time $t$, where $0\le t \le t_1$, is given by&#xA;\begin{align*}&#xA;E^{t_1}\big(P(t_1, t_2)\mid \mathcal{F}_t\big) &amp;amp;= E^{t_1}\left(\frac{P(t_1, t_2)}{P(t_1, t_1)}\mid \mathcal{F}_t\right)\\&#xA;&amp;amp;=\frac{P(t, t_2)}{P(t, t_1)},&#xA;\end{align*}&#xA;as $\left\{\frac{P(t, t_2)}{P(t, t_1)},  0\le t \le t_1\right\}$ is a martingale under the $t_1$-forwad probability measure $Q^{t_1}$. Here, $\mathcal{F}_t$ is the information set at time $t$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2017-02-07T18:11:30.143" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32289" PostTypeId="1" AcceptedAnswerId="32294" CreationDate="2017-02-07T20:49:19.753" Score="0" ViewCount="245" Body="&lt;p&gt;Quantitative Question – BLACK SCHOLES&#xA;Consider a call option on a stock. Assume that Black-Scholes prices the option correctly if all of the assumptions of Black-Scholes hold true. Assume in addition that these assumptions really are true save one: there is a chance that the stock could instantly plunge to zero sometime before expiry. Does Black-Scholes then misprice the option? Too high or too low? Why?&lt;/p&gt;&#xA;" OwnerUserId="26464" LastActivityDate="2017-02-08T17:48:29.687" Title="When a stock's price could suddenly drop to zero before expire. does black-scholes misprice the option? Too high or Too low?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;equities&gt;&lt;black-scholes&gt;&lt;call&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32291" PostTypeId="1" AcceptedAnswerId="32315" CreationDate="2017-02-07T21:27:03.717" Score="3" ViewCount="696" Body="&lt;p&gt;When valuing an FX option with some model M, e.g. Garman Kohlhagen for a call on GBPUSD spot, with a different premium currency, say CHF, is it correct to simply multiply the obtained option price (in GBP) with the current spot rate of the premium currency in order to obtain the option value in the premium currency, e.g:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;price_in_CHF = GBPCHF * GarmanKohlhagen(GBPUSD,...) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Would that affect the delta (in terms of GBPUSD) in the same way?&lt;/p&gt;&#xA;" OwnerUserId="20736" LastActivityDate="2017-02-08T20:42:14.307" Title="FX Option with Different Premium Currency" Tags="&lt;options&gt;&lt;fx&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32293" PostTypeId="6" CreationDate="2017-02-07T23:14:44.293" Score="0" Body="&lt;p&gt;Dear all, as I explain on the &lt;a href=&quot;http://meta.quant.stackexchange.com/questions/1530/2017-moderator-election-qa-questionnaire/1532#1532&quot;&gt;dedicated meta page&lt;/a&gt;, I candidate this year mostly to experience the process rather than to be chosen. I have a lot of respect for &lt;a href=&quot;http://meta.quant.stackexchange.com/users/467/srkx&quot;&gt;SRKX&lt;/a&gt;, my goal is to be ready when and if he will be bored by moderating. &lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2017-02-09T15:27:22.073" LastActivityDate="2017-02-09T15:27:22.073" CommentCount="6" CommunityOwnedDate="2017-02-07T23:14:44.293" ContentLicense="CC BY-SA 3.0" />
  <row Id="32294" PostTypeId="2" ParentId="32289" CreationDate="2017-02-08T00:07:44.937" Score="2" Body="&lt;p&gt;Black Scholes assumes the stock price follows Geometric Brownian Motion, which can approach but never hit zero. If it is possible that the stock price hits zero, then that is a very adverse scenario that will make the call worthless that is not taken into account by Black-Scholes. So the BS formula is clearly &lt;em&gt;overstating&lt;/em&gt; the value of the call.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can think of the true value of the call as being some convex combination of the BS value and 0, where the weights reflect the likelihood (in some probability measure) of the two scenarios:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C_{TRUE} = (1-p)*C_{BS} + p*0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the likelier the &quot;go to zero&quot; scenario the bigger p is.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-02-08T00:19:04.260" LastActivityDate="2017-02-08T00:19:04.260" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32295" PostTypeId="1" AcceptedAnswerId="32297" CreationDate="2017-02-08T00:08:33.820" Score="0" ViewCount="95" Body="&lt;p&gt;Some of the news regarding Unicredit indicate that the stock price was reduced by 50 percent from Friday (3 Feb 2017) to Monday (6 Feb 2017) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(e.g.: &lt;code&gt;&quot;The share price halved yesterday compared to the closing price of Friday&quot;&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;=&gt; &lt;code&gt;&quot;Der Aktienkurs halbierte sich gestern im Vergleich zum Schlusskurs vom Freitag&quot;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;see: Perspektiven am Morgen of Deutsche Bank, Germany, dated: 2017-02-07&#xA;(only availabe in German) - the web archive link is in my comment below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do understand it correctly, that the stock price in reality was &lt;em&gt;NOT&lt;/em&gt; reduced by 50 percent, right? That is at least what Deutsche Bank states later on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I look at some of the stockmarket internet platforms, in the longer perspective, I cannot see this 50 percent reduction in their charts:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/LCgLA.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/LCgLA.png&quot; alt=&quot;http://www.onvista.de/aktien/UNICREDIT-S-P-A-Aktie-IT0005239360 - long&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in the short term, they visualize it as a 50 percent drop:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/QPGK1.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/QPGK1.png&quot; alt=&quot;http://www.onvista.de/aktien/UNICREDIT-S-P-A-Aktie-IT0005239360 - short&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is correct? 50 % loss or only &lt;em&gt;&quot;daily business&quot;&lt;/em&gt;?&lt;/p&gt;&#xA;" OwnerUserId="26469" LastActivityDate="2017-02-08T03:00:36.827" Title="Unicredit February 2017: would I have Lost 50 Percent of my Money?" Tags="&lt;volatility&gt;&lt;equities&gt;&lt;risk&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32296" PostTypeId="2" ParentId="32261" CreationDate="2017-02-08T02:49:05.743" Score="1" Body="&lt;p&gt;This is a typical issue in physical commodities trading and I don't think you'll find free sources for such prices because it's precisely some firm's business to talk to market participant and perform surveys in order to come up with an approximate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As suggested by noob2, what I've seen in the industry is usually a regression, but you need at least historical data to perform this.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2017-02-08T02:49:05.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32297" PostTypeId="2" ParentId="32295" CreationDate="2017-02-08T03:00:36.827" Score="3" Body="&lt;p&gt;The answer is no.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Read the next sentence as well in the DB report: &quot;The share price halved yesterday compared to the closing price of Friday. Adjusted for the value of subscription rights, it fell only by three percent.&quot;. So you would have received 'subscription rights' which would have compensated for most of the loss. The price charts are adjusted for this distribution (just like they are adjusted for dividends, splits, etc.) so they don't show the drop.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-02-08T03:00:36.827" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32298" PostTypeId="1" AcceptedAnswerId="32300" CreationDate="2017-02-08T04:21:45.817" Score="1" ViewCount="5143" Body="&lt;p&gt;I was wondering what a negative coefficient of variation means when calculated from a set of daily returns for an index?&lt;/p&gt;&#xA;" OwnerUserId="26471" LastActivityDate="2017-02-08T07:32:08.823" Title="What does a negative coefficient of variation mean when calculated from daily returns during a period?" Tags="&lt;equities&gt;&lt;variance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32299" PostTypeId="1" AcceptedAnswerId="32301" CreationDate="2017-02-08T07:25:25.293" Score="1" ViewCount="118" Body="&lt;p&gt;In Properties of the most diversified portfolio by Choueifaty, he shows that the Most-Diversified portfolio (MDP) has three quantitative properties. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Paper: &lt;a href=&quot;http://www.tobam.fr/wp-content/uploads/2014/12/04.2013_JIS_TOBAM-Properties-of-the-Most-Diversified-Portfolio.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.tobam.fr/wp-content/uploads/2014/12/04.2013_JIS_TOBAM-Properties-of-the-Most-Diversified-Portfolio.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically for duplication invariance, he proves that it exists by stating that &quot;the introduction of a redundant asset leads to a redundant equation in the first-order equations associated to the MDP program&quot; [footnote 17].&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I dont really understand how having an extra asset (which changes the covariance matrix) introduce a redundant equation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope someone can clarify my doubts. Thank you!&lt;/p&gt;&#xA;" OwnerUserId="26474" LastActivityDate="2017-02-08T16:40:23.820" Title="Proof for the Duplication Invariance property for the Most-Diversified portfolio" Tags="&lt;portfolio-management&gt;&lt;portfolio-optimization&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32300" PostTypeId="2" ParentId="32298" CreationDate="2017-02-08T07:32:08.823" Score="2" Body="&lt;p&gt;With coefficient of variation you refer to the relative standard deviation &#xA;$\frac{\sigma}{\mu}$ I suppose? In this case, negative values occur, as your historical data exhibits a negative drift, which means your estimate of $\mu$ is negative. In my understanding, the coefficient of variation should only be used for data in a ratio scale, or, more general, for data which does not exhibit negative values - this is not really appropriate for return time series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of standard interpretation of the coefficient of variation, at least in my understanding, you cannot give any statements as soon as you apply this measure to data in a non-ratio scale (see also &lt;a href=&quot;https://en.wikipedia.org/wiki/Coefficient_of_variation&quot; rel=&quot;nofollow noreferrer&quot;&gt;Wikipedia&lt;/a&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why don't you consider the standard deviation itself? Or, if you are interested in relating standard deviation and returns, you can still interpret the magnitude of this value (although I am not sure what it tells you). In general, the coefficient of variation is closely related to the Sharpe-ratio, maybe this helps to find an appropriate measure for you.&lt;/p&gt;&#xA;" OwnerUserId="16249" LastActivityDate="2017-02-08T07:32:08.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32301" PostTypeId="2" ParentId="32299" CreationDate="2017-02-08T07:38:28.693" Score="1" Body="&lt;p&gt;The introduction of a redundant assets means, that one of the existing assets is duplicated. So, in other words, you do not introduce an extra asset which changes the covariance matrix, but instead you simply assume there is a new asset available which has the same return as one of the assets which are already available (in the paper asses A is duplicated). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the effect of duplicating an asset? Well, the MDP adjusts for that and recognizes that the duplicated asset is not adding anything and therefore adjusts the portfolio weights: The both assets (A and the duplicate A) obtain in sum the same fraction of wealth at would be the case if only A is existent and no duplicated asset exists to invest in. As the authors show in the Table on page 10, other methods may not recognize that the assets are duplicate and instead put more wealth in both of them. &lt;/p&gt;&#xA;" OwnerUserId="16249" LastActivityDate="2017-02-08T07:38:28.693" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32302" PostTypeId="1" AcceptedAnswerId="32307" CreationDate="2017-02-08T08:39:22.273" Score="2" ViewCount="98" Body="&lt;p&gt;I am trying to combine multiple forecasts on each of N assets in line with Grinold and Kahn's methodology, taken from &lt;em&gt;Active Portfolio Management, 2nd ed.&lt;/em&gt; On p.311, they suggest transforming the raw forecasts &lt;strong&gt;g&lt;/strong&gt; into a set of uncorrelated (orthogonal) forecasts &lt;strong&gt;y&lt;/strong&gt;. This is done as follows:&#xA;\begin{align*}&#xA;Var\{g\} = H^T\cdot H\\&#xA;y \equiv (H^T)^{-1}\cdot[g-E\{g\}]&#xA;\end{align*}&#xA;Can someone please explain what the matrix H is and what process is going on here?&lt;/p&gt;&#xA;" OwnerUserId="26475" LastActivityDate="2017-02-08T09:23:07.777" Title="Transform raw forecasts into orthogonal forecasts" Tags="&lt;correlation&gt;&lt;finance-mathematics&gt;&lt;covariance-matrix&gt;&lt;forecast&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32303" PostTypeId="1" CreationDate="2017-02-08T09:11:41.610" Score="1" ViewCount="1166" Body="&lt;p&gt;In my research, &lt;strong&gt;VaR&lt;/strong&gt; in risk reporting has regularly come under criticism for not capturing tail-risk adequately and for creating a false sense of confidence when taken literally as &quot;the maximum value that can be erased at a 1% event&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I have been asked to provide that metric now, I was wondering: Has the finance community already converged on a best-practice alternative?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are measurements that I could offer as a more sensible alternative?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know about &lt;strong&gt;Expected Shortfall&lt;/strong&gt; (&lt;a href=&quot;https://en.wikipedia.org/wiki/Expected_shortfall&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Expected_shortfall&lt;/a&gt;) also called &lt;strong&gt;CVaR&lt;/strong&gt;, so I would be grateful to hear about how widespread its usage is. I haven't looked at &lt;strong&gt;EVaR&lt;/strong&gt; yet, but I'm generally looking for any opinions and a debate about what measure has emerged to be considered robust and where the intuitive interpretation corresponds to it's mathematical properties.&lt;/p&gt;&#xA;" OwnerUserId="26476" LastEditorUserId="26476" LastEditDate="2017-02-08T10:32:45.937" LastActivityDate="2017-02-08T15:26:12.680" Title="Is there a recognized alternative to Value at Risk for risk reporting?" Tags="&lt;risk&gt;&lt;value-at-risk&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32304" PostTypeId="2" ParentId="32273" CreationDate="2017-02-08T09:11:52.363" Score="5" Body="&lt;p&gt;Another way to obtain this result is, as I mentioned in the comment, to think about how you would replicate the forward contract. It has the following cash-flow structure:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; type          | t                  | t1                      | t2&#xA;----------------------------------------------------------------------------&#xA; forward       | 0                  | +P(t1, t2) - K          | 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here, I also use $P(t_1, t_2)$ to denote the time $t_1$ price of the zero coupon bond with maturity in $t_2$. $K$ is the fair delivery price of the forward contract.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You replicate this contract by taking a long position in the zero-coupon with maturity $t_2$ and financing the purchase by selling the zero coupon bond with maturity in $t_1$ for a notional that yields a current cash-inflow of $P(t, t_2)$. You get&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; type          | t                  | t1                      | t2&#xA;-----------------------------------------------------------------------------&#xA; long ZCB t2   | -P(t, t2)          | +P(t1, t2)              | 0&#xA; short ZCB t1  | +P(t, t2)          | -P(t, t2) / P(t, t1)    | &#xA;-----------------------------------------------------------------------------&#xA; total         | 0                  | +P(t1, t2)              | 0&#xA;               |                    | -P(t, t2) / P(t, t1)    |&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The portfolio has the same cash-flows as the forward in both $t$ and $t_2$. It has the same random cash-flow in $t_1$ ($+P(t_1, t_2)$) and thus the non-random cash-flows at this time also have to agree, i.e. $K = P(t, t_2) / P(t, t_1)$.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-02-08T09:18:33.987" LastActivityDate="2017-02-08T09:18:33.987" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32305" PostTypeId="1" AcceptedAnswerId="34144" CreationDate="2017-02-08T09:22:02.820" Score="5" ViewCount="1879" Body="&lt;p&gt;According to the CAPM, the expected return of asset $i$ is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E(Z_i) = \beta_{im} E(Z_m)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Z_m$ is the excess return on the market portfolio, and $Z_i$ is the excess return of asset $i$ over the risk-free asset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fama-Macbeth (1973) propose to first estimate $\beta$'s using a time-series regression. But, we do not observe $E(Z_i)$ and $E(Z_m)$. So we substitute them with the realized counterparts, and estimate &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Z_{i,t} = \alpha + \beta_{i} Z_{m,t} + \epsilon_{i,t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand if we substitute $E(Z_i)$ with $Z_i$, the estimated parameters are still unbiased (measurement error is not be a problem). However, if we substitute $E(Z_m)$ with $Z_m$, the estimated parameters are in general biased. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the assumptions behind the first'step regression? Any reference? &lt;/p&gt;&#xA;" OwnerUserId="24566" LastEditorUserId="24566" LastEditDate="2017-02-09T19:05:31.063" LastActivityDate="2020-03-29T22:47:41.337" Title="What are the assumptions in the first-stage of Fama-MacBeth (1973)?" Tags="&lt;finance&gt;&lt;capm&gt;&lt;expected-return&gt;&lt;statistical-finance&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32306" PostTypeId="1" AcceptedAnswerId="32311" CreationDate="2017-02-08T09:22:29.700" Score="1" ViewCount="129" Body="&lt;p&gt;Is there any free source for S&amp;amp;P 500 historical data with exits for the last 10 -20 years? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can get free data from Yahoo, but it only has the currently traded tickers and NaN values before the date of the listing. Going back 2- years its more like S&amp;amp;P350 or S&amp;amp;P400 list at best... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to find a source which so de-listing and merge events and even better if it somehow shows ticker history. Meaning ticker XXXX was company xxxx not its company yyyy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this type of data source exist for free? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is for testing new idea and learning. I am not currently trading with real money. Just recently got interested algo trading, mainly while playing with Python neural networks. &lt;/p&gt;&#xA;" OwnerUserId="26443" LastActivityDate="2017-02-08T10:29:24.303" Title="S&amp;P 500 list for free with exits?" Tags="&lt;equities&gt;&lt;data&gt;&lt;market-data&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32307" PostTypeId="2" ParentId="32302" CreationDate="2017-02-08T09:23:07.777" Score="3" Body="&lt;p&gt;I do not have access to this book but I suppose the decomposition is the cholesky decomposition (if you use R, simply generate it with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;chol(cov(g))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where g is a matrix with forecasts.&lt;br&gt;&#xA;What the transformation is doing are essentially two steps:&#xA;1. You replace the forecasts g with the normalized forecasts g-E(g). This can be done by demeaning the matrix (R: demean)&#xA;2. Your normalize the variaton by 'dividing' with the part of the cholesky decompostion. Recall: In the univariate case the part $(H^T)^{-1}$ would correspond to the standard deviation.   &lt;/p&gt;&#xA;" OwnerUserId="16249" LastActivityDate="2017-02-08T09:23:07.777" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32309" PostTypeId="2" ParentId="32291" CreationDate="2017-02-08T10:05:48.423" Score="2" Body="&lt;p&gt;I don't see how settling the premium cashflow, whether it's in some currency or other, or paid on time or late, or rolled into the contract, or any other way of paying that you could think of, will affect the value of the option in its base currency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yeah so to express the option value in some other currency, then you use the spot rate. If you wanted to delta hedge using some other currency (not sure why?) then likewise for hedging cash flows.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastEditorUserId="7369" LastEditDate="2017-02-08T10:10:48.857" LastActivityDate="2017-02-08T10:10:48.857" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32311" PostTypeId="2" ParentId="32306" CreationDate="2017-02-08T10:29:24.303" Score="4" Body="&lt;p&gt;The wiki page on S&amp;amp;P 500 has quite a good list of index changes for the last ~5 years:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/List_of_S&amp;amp;P_500_companies#Recent_and_announced_changes_to_the_list_of_S.26P_500_Components&quot; rel=&quot;nofollow noreferrer&quot;&gt;Recent and announced changes to the list of S&amp;amp;P 500 Components&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, if you have access to Bloomberg terminal at uni/work/library, you can check:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;SPX Index MEMB &amp;lt;GO&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Changing the date will show you the constituents in the past.&lt;/p&gt;&#xA;" OwnerUserId="19615" LastActivityDate="2017-02-08T10:29:24.303" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32312" PostTypeId="2" ParentId="32303" CreationDate="2017-02-08T12:20:11.430" Score="1" Body="&lt;p&gt;In the banking sector, people is getting more and more concern about this topic. We are listening a lot about Espected Shortfall and TailVaR. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But there are also methods to take more into account the tails. For example, you can change your distribution to a T-Student. &lt;/p&gt;&#xA;" OwnerUserId="12089" LastActivityDate="2017-02-08T12:20:11.430" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32313" PostTypeId="2" ParentId="32305" CreationDate="2017-02-08T12:39:22.950" Score="0" Body="&lt;p&gt;It can, in my opinion be stated that your understanding of the situation is exactly backward. The CAPM &lt;strong&gt;model&lt;/strong&gt; should be stated as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \tag{CAPM model}&#xA;r_s = r_f + \beta_s (r_m - r_f) + \epsilon&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $r_f$ is a constant (or at least independent) risk free rate $r_s$ is the dependent variable, the return on the stock, and $r_m$ is the random variable representing the return on the market and $\epsilon$ is the idiosyncratic component of risk also a random variable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, taking expectations on both sides and re-shuffling terms we get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align} &#xA;\tag{CAPM expectation} E(r_s) &amp;amp;= r_f + \beta_sE(r_m - r_f) + E(\epsilon)\\&#xA;\implies E(r_s) - r_f &amp;amp;= \beta_sE(r_m - r_f) + \alpha&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Student&amp;#39;s_t-test#One-sample_t-test&quot; rel=&quot;nofollow noreferrer&quot;&gt;A simple t-test on the mean&lt;/a&gt; can be done on the residuals after estimation of the model to see if $\alpha$ is statistically significantly different from zero or not. Most packages will do this for you if you estimate an intercept as part of your regression. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems to me that your main confusion is about how we go from the CAPM model above to the regression. We observe an independent and identically distributed sample of $r_s(t_i)$ and $r_m(t_i)$. In this model $r_f$ is normally a constant which is also measurable (observable). We now estimate $\hat\beta_s$ using the maximum likelihood estimator and imply the unobservable idiosyncratic risk $\epsilon(t)$ by solving for $\epsilon$ in the CAPM model formula and plugging in our sample vectors.&lt;/p&gt;&#xA;" OwnerUserId="4910" LastActivityDate="2017-02-08T12:39:22.950" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32314" PostTypeId="2" ParentId="32303" CreationDate="2017-02-08T13:33:42.967" Score="1" Body="&lt;p&gt;Regarding your &amp;quot;false sense of confidence&amp;quot; statement: most of it has nothing to do with VaR as a framework itself, it's about how you implement it. Naive HS-VaR fails you? Sure thing, but who's to blame in the situation except yourself?&lt;/p&gt;&#xA;&lt;p&gt;Most of the pratitioners use VaR in its simplest form, which yields predictably poor results. For the sake of illustration let's consider one of the many ways of improvement: GARCH specification for conditional volatility paired with a distribution that allows for higher order (3rd and 4th) conditional moment dynamics (e.g. Normal Inverse Gaussian, Skewed Generalized t etc). This solves two problems: accounts both for heterosedastic structure of our series (volatility clustering) and fat tails. How great is the improvement? Time for backtesting.&lt;/p&gt;&#xA;&lt;p&gt;VaR is flawed in a sense that it is not a coherent risk measure (it is not subadditive), but it is still massively preferred in practice over Expected Shortfall, which is a coherent measure, due to great backtesting properties, and that already tells a lot. I will not cover the tests themselves, you can easily look them up (unconditional coverage test, conditional coverage test, Berkowitz tail test etc). What you will notice (&lt;a href=&quot;http://unstarched.net/2013/01/07/does-anything-not-beat-the-garch11/&quot; rel=&quot;nofollow noreferrer&quot;&gt;here, for example&lt;/a&gt;) when backtesting models based on normal distribution vs NIG, SGT etc, is that the former barely pass any tests while the latter perform fairly well (i.e. loss exceedances really occur at the specified confidence level, they do not cluster and fat tails are accounted for properly).&lt;/p&gt;&#xA;&lt;p&gt;tl;dr: VaR is still one of the best practices out there when implemented properly.&lt;/p&gt;&#xA;" OwnerUserId="18190" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2017-02-08T15:26:12.680" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32315" PostTypeId="2" ParentId="32291" CreationDate="2017-02-08T14:50:30.393" Score="6" Body="&lt;p&gt;Let $X_t^{gbp\rightarrow usd}$ and $X_t^{chf\rightarrow usd}$ be the respective exchanges rates from one unit of GBP and CHF to units of USD. Depending on the option contractual specification, the payoff in CHF at maturity $T$ can have a form of either &#xA;\begin{align*}&#xA;\frac{\left(X_T^{gbp\rightarrow usd} -K\right)^+}{X_T^{chf\rightarrow usd}}, \tag{1}&#xA;\end{align*}&#xA;or &#xA;\begin{align*}&#xA;\left(X_T^{gbp\rightarrow usd} -K\right)^+. \tag{2}&#xA;\end{align*}&#xA;Here, Payoff $(2)$ is of a quanto form. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $r^{chf}$, $r^{gbp}$, and $r^{usd}$ be the respective interest rates for currencies CHF, GBP, and USD, and $B_t^{usd}=e^{r^{usd} t}$, $B_t^{gbp}=e^{r^{gbp} t}$, and $B_t^{chf}=e^{r^{chf} t}$ be the corresponding money-market account values at time $t$.  Moreover, let $Q^{chf}$ and $Q^{usd}$ be the respective risk-neutral probability measures for currencies CHF and USD,  and $E^{chf}$ and $E^{usd}$ be the corresponding expectation operators. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We assume that, under the USD risk-neutral probability measure $Q^{usd}$,&#xA;\begin{align*}&#xA;dX_t^{gbp\rightarrow usd}&amp;amp;= X_t^{gbp\rightarrow usd}\left[(r^{usd}-r^{gbp})dt + \sigma_1 dW_t^1 \right],\\&#xA;dX_t^{chf\rightarrow usd}&amp;amp;= X_t^{chf\rightarrow usd}\left[(r^{usd}-r^{chf})dt + \sigma_2 \left(\rho dW_t^1 + \sqrt{1-\rho^2}dW_t^2\right) \right],&#xA;\end{align*}&#xA;where $\sigma^1$ and $\sigma^2$ are the volatility parameters, $\rho$ is the correlation, $\{W_t^1, t\ge 0\}$ and $\{W_t^2, t\ge 0\}$ are independent standard Brownian motions. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Payoff Form $(1)$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For a payoff of the form $(1)$, note that&#xA;\begin{align*}&#xA;\frac{dQ^{chf}}{dQ^{usd}}\big|_t = \frac{X_t^{chf\rightarrow usd}B_t^{chf}}{X_0^{chf\rightarrow usd}B_t^{usd}}.&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;E^{chf}\left(\frac{1}{B_T^{chf}}\frac{\left(X_T^{gbp\rightarrow usd} -K\right)^+}{X_T^{chf\rightarrow usd}} \right) &amp;amp;=E^{usd}\left(\frac{dQ^{chf}}{dQ^{usd}}\big|_T\frac{1}{B_T^{chf}}\frac{\left(X_T^{gbp\rightarrow usd} -K\right)^+}{X_T^{chf\rightarrow usd}} \right)\\&#xA;&amp;amp;=\frac{1}{X_0^{chf\rightarrow usd}}E^{usd}\left(\frac{\left(X_T^{gbp\rightarrow usd} -K\right)^+}{B_T^{usd}}\right).&#xA;\end{align*}&#xA;That is, the payoff value is indeed the normal option value adjusted by the spot exchange rate.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Payoff Form $(2)$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For a quanto style payoff of the form $(2)$, note that&#xA;\begin{align*}&#xA;\frac{dQ^{chf}}{dQ^{usd}}\big|_t &amp;amp;= \frac{X_t^{chf\rightarrow usd}B_t^{chf}}{X_0^{chf\rightarrow usd}B_t^{usd}}\\&#xA;&amp;amp;=e^{-\frac{1}{2}\sigma_2^2 t + \sigma_2 \left(\rho W_t^1 + \sqrt{1-\rho^2}W_t^2\right)}.&#xA;\end{align*}&#xA;Let $\tilde{W}_t^1 = W_t^1-\rho\sigma_2 t$ and $\tilde{W}_t^2 = W_t^2-\sqrt{1-\rho^2}\sigma_2 t$. Then $\{\tilde{W}_t^1, t\ge 0\}$ and $\{\tilde{W}_t^2, t\ge 0\}$ are two independent standard Brownian motions. Moreover, under the CHF risk-neutral probability measure $Q^{chf}$,&#xA;\begin{align*}&#xA;dX_t^{gbp\rightarrow usd}&amp;amp;= X_t^{gbp\rightarrow usd}\left[(r^{usd}-r^{gbp}+\rho\sigma_1\sigma_2)dt + \sigma_1 d\tilde{W}_t^1 \right]\\&#xA;&amp;amp;=X_t^{gbp\rightarrow usd}\left[\Big(r^{chf} - (r^{chf} - r^{usd}+r^{gbp}-\rho\sigma_1\sigma_2)\Big)dt + \sigma_1 d\tilde{W}_t^1 \right].&#xA;\end{align*}&#xA;That is, we can treat $X_t^{gbp\rightarrow usd}$ as the exchange rate from a foreign currency to CHF, where the foreign currency has interest rate $r^{chf} - r^{usd}+r^{gbp}-\rho\sigma_1\sigma_2$.&#xA;The value of Payoff $(2)$ is then given by&#xA;\begin{align*}&#xA;E^{chf}\left(\frac{\left(X_T^{gbp\rightarrow usd} -K\right)^+}{B_T^{chf}} \right),&#xA;\end{align*}&#xA;which can be computed using the Garman Kohlhagen formula with domestic interest rate $r^{chf}$, foreign interest rate $r^{chf} - r^{usd}+r^{gbp}-\rho\sigma_1\sigma_2$, and spot FX rate $X_0^{gbp\rightarrow usd}$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-02-08T20:42:14.307" LastActivityDate="2017-02-08T20:42:14.307" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="32317" PostTypeId="2" ParentId="32299" CreationDate="2017-02-08T16:40:23.820" Score="1" Body="&lt;p&gt;Ah nvm, I'm embarrassed that this actually took me so long to understand.. but adding a repeated asset basically adds a row identical to the original asset in the covariance matrix, thus introducing a redundant equation in the programming problem.&lt;/p&gt;&#xA;" OwnerUserId="26474" LastActivityDate="2017-02-08T16:40:23.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32318" PostTypeId="1" CreationDate="2017-02-08T16:40:45.873" Score="1" ViewCount="613" Body="&lt;p&gt;Does anyone know a datasource for retrieving the historical index member weights for the two major commodity indices S&amp;amp;P GSCI and Bloomberg Commodity Index?&#xA;My institution provides access to Bloomberg and Thomson Reuters Eikon &amp;amp; Datastream but none of them has the respective data. Also, Google didn't deliver adequate results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help is greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="26481" LastActivityDate="2017-02-08T16:40:45.873" Title="Commodity index member weights (historical) for S&amp;P GSCI and BCOM" Tags="&lt;data&gt;&lt;bloomberg&gt;&lt;index&gt;&lt;commodities&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32319" PostTypeId="2" ParentId="4599" CreationDate="2017-02-08T17:24:19.003" Score="0" Body="&lt;p&gt;BS assumptions of accruing pl from delta hedging (long gamma) applies nicely within the theoretical model - you need spot to behave like a random process. Take the example provided by @Strange. If the spot keeps dropping monotonically you would keep buying spot at lower levels and eventually unwind the hedge at a loss. If the market behaved as a random process (going up and down possibly with some drift) your long gamma means that you would buy more delta on up moves and sell more delta on down moves, making you PL (gamma PL).&#xA;Even sell side (risk-managed) vol desks run a large delta on short dated options.&lt;/p&gt;&#xA;" OwnerUserId="26482" LastActivityDate="2017-02-08T17:24:19.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32321" PostTypeId="2" ParentId="32289" CreationDate="2017-02-08T17:48:29.687" Score="0" Body="&lt;p&gt;If the probability of stock going to 0 is reasonably high the BS implied vol you would pay for the option will reflect that. BS equation does not decide the market price of the option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Strictly speaking such names would be priced as a credit instrument with appropriate default model.&lt;/p&gt;&#xA;" OwnerUserId="26482" LastActivityDate="2017-02-08T17:48:29.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32322" PostTypeId="2" ParentId="32239" CreationDate="2017-02-08T17:59:12.830" Score="1" Body="&lt;p&gt;If you are doing this for fun then use Treasury/LIBOR rates. Otherwise the 'risk-free' rate in BS is the rate at which you can borrow/lend cash. If you have a brokerage account the broker should pay you an interest on any cash in your account or charge you interest for lending you cash.&lt;/p&gt;&#xA;" OwnerUserId="26482" LastActivityDate="2017-02-08T17:59:12.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32323" PostTypeId="2" ParentId="32284" CreationDate="2017-02-08T18:32:07.007" Score="2" Body="&lt;p&gt;Check out &lt;a href=&quot;https://en.wikipedia.org/wiki/Feynman%E2%80%93Kac_formula&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Feynman%E2%80%93Kac_formula&lt;/a&gt;, it is the $f(X_r,r)$ in the formula. For the swap you receive $(r-r^*) dt$ (assume notional of 1) which translates into your $f$ (inhomogeneous term). &lt;/p&gt;&#xA;" OwnerUserId="26484" LastEditorUserId="19887" LastEditDate="2017-02-10T09:34:15.690" LastActivityDate="2017-02-10T09:34:15.690" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32324" PostTypeId="1" CreationDate="2017-02-08T19:19:14.643" Score="-1" ViewCount="1222" Body="&lt;p&gt;When the Black scholes formula is derived, $T$ is just some time in the future. We don't specify what it is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So why is it that if you go to an option pricing calculator, it asks specifically for &lt;strong&gt;days&lt;/strong&gt; until expiration? When these calculators then use the formula, do they just plug in these number of days remaining for $T$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If they do this, then what if instead of saying 10 days, I said 1440 hours. That's still 10 days, yet plugging in 1440 for T obviously gives a different answer than if we plugged in 10 ..... &lt;/p&gt;&#xA;" OwnerUserId="26485" LastEditorUserId="467" LastEditDate="2017-02-09T04:58:35.993" LastActivityDate="2017-02-09T04:58:35.993" Title="What is the unit of $T$ in the Black-Scholes formula?" Tags="&lt;black-scholes&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32325" PostTypeId="1" AcceptedAnswerId="32332" CreationDate="2017-02-08T19:55:04.310" Score="0" ViewCount="707" Body="&lt;p&gt;I'm new to credit risk. I wanted to know what is the meaning of reservable/non-reservable criticized exposure?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone please help.&lt;/p&gt;&#xA;" OwnerUserId="26486" LastEditorUserId="467" LastEditDate="2017-02-09T05:40:12.507" LastActivityDate="2017-02-09T05:40:12.507" Title="What is non-reservable criticized exposure?" Tags="&lt;banking-regulations&gt;&lt;exposure&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32326" PostTypeId="1" CreationDate="2017-02-08T20:11:15.640" Score="-1" ViewCount="72" Body="&lt;p&gt;We have $dB_t = rB_tdt$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We are told that this corresponds to a &quot;bank&quot;..... how? When I insert money into a bank, how does this correspond to buying an asset for the price $B_t$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would make more sense to say it is a bond, yet my book insists this is a &quot;bank&quot;. &lt;/p&gt;&#xA;" OwnerUserId="26485" LastActivityDate="2017-02-08T20:28:07.577" Title="What is the risk-free asset?" Tags="&lt;banks&gt;&lt;risk-free&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32327" PostTypeId="6" CreationDate="2017-02-08T20:14:12.700" Score="0" Body="&lt;p&gt;This site is lost. It's a disaster. We're losing users so badly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When universities send their people, they're not sending their best. &lt;a href=&quot;http://quant.stackexchange.com/help/on-topic&quot;&gt;They're bringing off-topic questions. They're bringing questions on career advice.&lt;/a&gt; They're &lt;strike&gt;ra&lt;/strike&gt;college kids. And some, I assume, are grad students.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will build the greatest firewall - and nobody builds firewalls better than me, believe me. I will build a great, great firewall on our network border. I will build a firewall and I will make universities pay for that firewall.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will get my people to look into voter fraud. At least 30,000 of the downvotes I received were illegal. I have the highest reputation if you deduct the thousands of people who downvoted illegally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, look at &lt;a href=&quot;https://www.gravatar.com/avatar/2e23a8cb28b986becbed577221c6467d?s=328&amp;amp;d=identicon&amp;amp;r=PG&quot; rel=&quot;nofollow noreferrer&quot;&gt;SRKX's face&lt;/a&gt;! Would anyone vote for that? Can you imagine that, the face of our next moderator? But &lt;a href=&quot;http://quant.stackexchange.com/users/2299/lehalle&quot;&gt;lehalle&lt;/a&gt; - if lehalle wasn't my father, perhaps I'd be dating him. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Together, we will make Quant Stack Exchange great again.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="4660" LastEditDate="2017-02-08T20:19:43.357" LastActivityDate="2017-02-08T20:19:43.357" CommentCount="8" CommunityOwnedDate="2017-02-08T20:14:12.700" ContentLicense="CC BY-SA 3.0" />
  <row Id="32328" PostTypeId="2" ParentId="32326" CreationDate="2017-02-08T20:28:07.577" Score="3" Body="&lt;p&gt;Well, I do not think there is a large difference:&#xA;Given you deposit money at a Bank the value of this deposit changes according to &#xA;$$\frac{dB_t}{B_t} = r dt$$&#xA;which simply means there is no uncertainty with respect to this evolution (instead of incorporating a risky component $dW_t$. If you really want to interpret the risk-less asset as a bond you are probably faced to some issues (the bond should not exhibit a maturity but instead should only pay interest). Therefore I would agree that it is best to interpret the risk-less term as a bank deposit.&lt;/p&gt;&#xA;" OwnerUserId="16249" LastActivityDate="2017-02-08T20:28:07.577" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32330" PostTypeId="1" CreationDate="2017-02-08T23:31:23.850" Score="1" ViewCount="88" Body="&lt;h2&gt;Setup and Definition of Terms&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Supposed that we have a universe of possible securities $\mathcal{S}$. We wish to construct an &quot;optimal&quot; portfolio, which will be represented by proportional weights $\{w_i\}_{i\in\mathcal{S}}$. The word &quot;proportional&quot; simply means that the weights sum to one:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sum_i w_i = 1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose further that we have some past price data on each stock from time $t=0$ to time $t=t_f$, and the data are sampled at discrete points $t_n$. We thus have, for each security, and at each timepoint $n$, a price value&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P_{i,n} = P_i(t_n).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us define the &quot;floating&quot; returns of security $i$ as the fractional difference in price between timesteps:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R^{(f)}_{i,n} = \frac{P_{i,n}-P_{i,n-1}}{P_{i,n-1}}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us define &quot;cumulative&quot; returns as the fractional difference in price &lt;em&gt;since the beginning of our data&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R^{(c)}_{i,n} = \frac{P_{i,n}-P_{i,0}}{P_{i,0}}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $V_0$ denote the initial investment put into the portfolio, and $V_n$ denote the value of the portfolio at time $t_n$. Note that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V_n = V_0 \sum_{i\in\mathcal{S}}w_i\frac{P_{i,n}}{P_{i,0}} = V_0 + V_0 \sum_{i\in\mathcal{S}}w_iR^{(c)}_n.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We will reserve the subscript $p$ to refer to our total portfolio. Using this convention, the floating returns of the portfolio are denoted by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ R^{(f)}_{p,n} = \frac{V_n-V_{n-1}}{V_{n-1}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the cumulative returns are denoted by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R^{(c)}_{p,n} = \frac{V_n-V_0}{V_0}.$$&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;The Essential Observation&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Observe the following important fact: &lt;strong&gt;the floating returns of the portfolio are not linear in the weights.&lt;/strong&gt; That is to say, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R^{(f)}_{p,n} \neq \sum_{i}w_i R^{(f)}_{i,n}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be seen by expanding the expressions for portfolio and individual security-level floating returns. In contrast, &lt;strong&gt;the cumulative returns ARE linear in the weights:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R^{(c)}_{p,n} = \sum_{i} w_i R^{(c)}_{i,n}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be easily seen from our definition of portfolio cumulative returns. &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Statement of the Optimization Problem&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;In order to use linear algebra notation, we'll let $w$ refer to the column vector of weights, $\overline{R}$ refer to the column vector of time-averaged returns (I'm being intentionally ambiguous here) and $\Sigma$ the covariance matrix of the same returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To my understanding, the major idea behind Markowitz optimization is to minimize the objective function&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f(w) = w^T\Sigma w - \gamma \,w^T\overline{R}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;subject to the constraints $\sum w = 1$ and $w_i &amp;gt;0$. Here, $\gamma$ is some real parameter that accounts for risk tolerance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is the following: &lt;strong&gt;do we use cumulative returns $R^{(c)}_n$ or floating returns $R^{(f)}_n$ in computing $\overline{R}$ and $\Sigma$?&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems the most likely choice would be floating returns. Since the distribution of the cumulative returns is highly autocorrelated, we are not making independent draws from a sample, so the interpretation of the sample mean and variance $\overline{R}$ and $\Sigma$ is not clear to me. However, if we use floating returns, we run into the problem that &lt;strong&gt;our objective function does not represent the expected returns (or variance) of the portfolio!&lt;/strong&gt; Instead it represents some statistical property of the portfolio, the mean expected returns and variance. This seems strange to me, as I assume we would want to optimize the actual returns of our portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone clear this up for me? I've been banging my head against this for a while now and haven't found anything that has clarified things for me. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a side question, the terms &quot;floating returns&quot; and &quot;cumulative returns&quot; are things that I use to keep things straight for myself; are there standard terms for these objects?&lt;/p&gt;&#xA;" OwnerUserId="26160" LastActivityDate="2017-02-08T23:31:23.850" Title="Confusion about Assumptions in Markowitz Optimization" Tags="&lt;modern-portfolio-theory&gt;&lt;optimization&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32331" PostTypeId="2" ParentId="32280" CreationDate="2017-02-08T23:55:37.910" Score="3" Body="&lt;p&gt;Yes, your initial strategy would be rendered irrelevant since all that is saying is that you constrain&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$w_1 + w_2 = 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and so your solution is undefined if $w_1,w_2&amp;gt;0$. One way you could make your strategy useful under a sector-neutral constraint is to change it into an optimization that minimizes the differences between actual weights and unconstrained weights, subject to the above constraint. e.g. Find&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\underset{w_1',w_2'}{\min} \left(w_1'-w_1\right)+\left(w_2'-w_2\right)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;subject to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$w_1 + w_2 = 0$&lt;/p&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="4660" LastEditDate="2017-02-09T19:16:40.170" LastActivityDate="2017-02-09T19:16:40.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32332" PostTypeId="2" ParentId="32325" CreationDate="2017-02-09T02:18:29.963" Score="0" Body="&lt;p&gt;When regulators (such as the FDIC) examine a Bank, they look at the quality of a sample of loans (assets) and assign each a &quot;grade&quot; (to use a term used in schools) or classification as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pass - Everything OK with this loan. No need to do anything.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Special Mention - Everything OK for now but we have some concern about weaknesses that could cause problems in the future. Management should keep an eye on this loan and we may need to review it again in the future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Substandard - some problems apparent. There is a &quot;distinct possibility&quot; that the bank may sustain some loss on this loan.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Doubtful- problems and facts sufficient to make the full recovery of this loan &quot;highly questionable and improbable&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Loss - this loan is uncollectable and does not belong on the balance sheet of a Bank. This loan must be written off immediately (although you may make efforts afterwards to sell it to recover what little value if any it has left if you wish).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As my colleague pointed out above, &quot;criticized&quot; loans are the union of: Special Mention, Substandard, and Doubtful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What must the Bank do about &quot;criticized&quot; loans? Generally they will need to set up a reserve to allow for the fact that this loan is no longer worth 100 cents on the dollar. This will hit the income statement and the balance sheet. These are the &quot;reserveable criticized loans&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However there are some legitimate reasons why some of these loans may not need to go through this. Good and sufficient reasons to make a loan a &quot;non-reservable criticized&quot; loan include:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The loan is already in the process of being sold &lt;/li&gt;&#xA;&lt;li&gt;The loan is accounted for under the &quot;fair value&quot; method which already takes onto account its problems&lt;/li&gt;&#xA;&lt;li&gt;Some other special situations&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-02-09T02:18:29.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32333" PostTypeId="1" CreationDate="2017-02-09T02:26:57.950" Score="1" ViewCount="226" Body="&lt;p&gt;I would like to have your opinions about how to calculate the VaR of a hedged portfolio using futures contracts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried several &quot;black box&quot; softwares and none of them make too much sense. The idea is that I have a 100% Equity Portfolio and a 100% coverage with futures that might no be very well correlated to the Portfolio itself. How would you calculate the VaR? With what model?&lt;/p&gt;&#xA;" OwnerUserId="26492" LastEditorUserId="467" LastEditDate="2017-02-09T05:34:06.907" LastActivityDate="2017-02-09T05:34:06.907" Title="How to compute the Value-at-Risk of an equity portfolio hedged using futures contracts?" Tags="&lt;futures&gt;&lt;var&gt;&lt;models&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32335" PostTypeId="2" ParentId="32324" CreationDate="2017-02-09T02:45:40.237" Score="2" Body="&lt;p&gt;You describe an online calculator that takes input in days. Days is just convenient for some people, although I have seen other calculators using other units for time to maturity. Internally the calculator is translating the number of days into years before plugging it into the BSM formula. That is because mathematically the units used in the formula have to be consistent for 3 variables $r$,$\sigma$ and $T$. It just turns out $r$ and $\sigma$ are usually expressed on a yearly basis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would add that the calculators used professionally allow you to enter exact dates (e.g. 2017 02 08 to 2017 05 19)(maybe even the hour) rather than days or years when specifying $T$.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="467" LastEditDate="2017-02-09T04:57:41.697" LastActivityDate="2017-02-09T04:57:41.697" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32337" PostTypeId="2" ParentId="32333" CreationDate="2017-02-09T03:52:58.077" Score="2" Body="&lt;p&gt;There are 3 main methods for VaR Calculation: Historical, Parametric and Monte Carlo (&lt;a href=&quot;http://www.investopedia.com/articles/04/092904.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;see here&lt;/a&gt;). All 3 can be performed on simple softwares like Excel or Matlab.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Parametric and Monte Carlo requires a few assumptions including return distribution on equity, futures and rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A Simple parametric VaR and Historical VaR can be done in one small page of spreadsheet, really. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will present an example on &lt;strong&gt;Historical VaR&lt;/strong&gt;, as I'm most familiar with.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Choose number of windows. For example, 250 cases (1 year)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;VaR of today position (t) is based on historical data&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;collect historical return of equity and return of futures on t-1&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;apply that return of equity on t-1 to today equity position and return of futures on t-1 to today futures position  and record dollar P&amp;amp;L&lt;/li&gt;&#xA;&lt;li&gt;repeat 2-3 but change t-1 to t-2&lt;/li&gt;&#xA;&lt;li&gt;do 4 (by changing t-2 to t-3 and so on) until you have 250 cases&lt;/li&gt;&#xA;&lt;li&gt;Choose your significance level, say 5%&lt;/li&gt;&#xA;&lt;li&gt;Rank those 250 P&amp;amp;L and get 5%th lowest percentile (top 5% most negative P&amp;amp;L)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This method doesn't require assumption on return distributions or correlation of equity and futures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It, though, assumes that past characteristic and relationship will keep continuing in the future. &lt;/p&gt;&#xA;" OwnerUserId="13991" LastActivityDate="2017-02-09T03:52:58.077" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32338" PostTypeId="1" CreationDate="2017-02-09T04:25:41.590" Score="7" ViewCount="11952" Body="&lt;p&gt;If I know all the economics of a CDS trade included the Upfront Settlement Fee from the ISDA CDS Model, how can I convert that amount back to Traded Spead? Can some help explain the process? &lt;/p&gt;&#xA;" OwnerUserId="26494" LastEditorUserId="12240" LastEditDate="2020-11-12T12:57:44.043" LastActivityDate="2020-11-12T12:57:44.043" Title="How to convert the CDS Upfront Fee into the Traded Spread?" Tags="&lt;spread&gt;&lt;cds&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="32339" PostTypeId="2" ParentId="18905" CreationDate="2017-02-09T06:57:11.590" Score="3" Body="&lt;p&gt;Too many people think implied vol is the &quot;volatility&quot; that you think it is. Normally we talk about &quot;volatility&quot; as the measure of how unpredictable the stock movement will be in its magnitude. True.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, detach &quot;implied vol&quot; from the definition of &quot;volatility&quot;. Now, just imagine that &quot;implied vol&quot; is just a parameter of B-S model. What trades in the market are option prices. There is a relationship between these prices and &quot;implied vol&quot; and this relationship is important when you use B-S model. When you are fixated on the B-S model and you believe this is your bible, then the market prices dictate that there is a smile. This is the reason for the smile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But seriously what is implied vol? it's just a concept, you can call it anything whatever. It is not the same as real volatility.&lt;/p&gt;&#xA;" OwnerUserId="26496" LastActivityDate="2017-02-09T06:57:11.590" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32340" PostTypeId="1" CreationDate="2017-02-09T08:15:37.500" Score="2" ViewCount="81" Body="&lt;p&gt;Suppose we are doing a delta hedging simulation according to Black Scholes, where the initial condition are [stockPrice, strike, timeToExpire ,riskFreeRate, dividend, sigma, isCall] = [100, 100, 1, 0, 0, 0.2, True]. Let's say they are denoted as [S, K, t, r, q, $\sigma$, ] in Black Scholes. Hence particularly we haver=0&#xA;Black Scholes is usually written as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r\frac{\partial V}{\partial S}S+\frac{1}{2}\sigma^2S^2\frac{\partial^2 V}{\partial S^2}+ \frac{\partial V}{\partial t}-rV=0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where V is the value of option. Rewriting it gives&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$rdt(V-\frac{\partial V}{\partial S}S)=(\frac{1}{2}\sigma^2S^2\frac{\partial^2 V}{\partial S^2}+\frac{\partial V}{\partial t})dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By assumption of Geometric Brownian Motion and approximations of Wiener process we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{1}{2}\frac{\partial^2 V}{\partial S^2}(dS)^2=\frac{1}{2}\frac{\partial^2 V}{\partial S^2}\sigma^2S^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS=\mu Sdt+\sigma SdW$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence equivalently,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$rdt(V-\frac{\partial V}{\partial S}S)=(\frac{1}{2}\frac{\partial^2 V}{\partial S^2}(dS)^2+\frac{\partial V}{\partial t})dt------(1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By no arbitrage assumption, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$rdt(V-\frac{\partial V}{\partial S}S)=dV-\frac{\partial V}{\partial S}dS ------(2)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let's say on a certain step of hedging, we found that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS=0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;such that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{1}{2}\frac{\partial^2 V}{\partial S^2}(dS)^2=0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And it always holds that $\frac{\partial V}{\partial t}&amp;lt;0$, by (1) and (2) (or simply Itō's lemma) we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dV-\frac{\partial V}{\partial S}dS = (\frac{1}{2}\frac{\partial^2 V}{\partial S^2}(dS)^2+\frac{\partial V}{\partial t})dt&amp;lt;0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whereas since $r=0$, we have  $rdt(V-\frac{\partial V}{\partial S}S)=0$. By (2) we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dV-\frac{\partial V}{\partial S}dS=rdt(V-\frac{\partial V}{\partial S}S)=0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at the above two equations we find a contradiction. So what's the problem out there?&lt;/p&gt;&#xA;" OwnerUserId="26498" LastActivityDate="2017-02-09T19:06:28.000" Title="A bug in delta hedging, when for a certain step dS=0" Tags="&lt;black-scholes&gt;&lt;simulations&gt;&lt;delta-hedging&gt;&lt;black-scholes-pde&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32341" PostTypeId="1" AcceptedAnswerId="32344" CreationDate="2017-02-09T09:04:06.773" Score="4" ViewCount="132" Body="&lt;p&gt;I would expect that many traders hedge their exposure before market closing based on their positions. In order to determine the timing of readjustment, there should probably two channels affect the decision:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You want to take as much information as possible into consideration, therefore waiting as long as possible in order to determine delta-neutral positions.&lt;/li&gt;&#xA;&lt;li&gt;It costs time to readjust especially large portfolio and the costs of immediacy increase the less time is available until the market closes&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Combining these two channels would suggest one can optimally choose the rebalancing schedule. However, if we consider that there is a large mass of traders which are themselves affecting the market I suppose, the simple trade-off stated above is somewhat myopic. So, &lt;strong&gt;is there some documented evidence that hedging needs affect markets in the afternoon&lt;/strong&gt;? Is there any evidence on how large institutional investors time their hedging decisions?&lt;/p&gt;&#xA;" OwnerUserId="16249" LastActivityDate="2017-02-09T12:37:22.073" Title="Is there evidence that delta-hedging of large investors affects markets?" Tags="&lt;hedging&gt;&lt;reference-request&gt;&lt;market-microstructure&gt;&lt;liquidity&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32342" PostTypeId="1" AcceptedAnswerId="32343" CreationDate="2017-02-09T09:57:14.143" Score="4" ViewCount="174" Body="&lt;p&gt;&lt;em&gt;I am not sure, whether this question is on-topic here, but it is microstructure related, is of concern to practitioners and addresses a question which is often debated in academia.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When it comes to discussing blockchains, I often encounter the argument that blockchains technology helps to improve liquidity, especially as it speeds up settlement time &lt;a href=&quot;https://academic.oup.com/rof/article/doi/10.1093/rof/rfw074/2888422/Corporate-Governance-and-Blockchains&quot; rel=&quot;noreferrer&quot;&gt;(see for example this paper)&lt;/a&gt;. I admit that I do not know how settlement of, say, equity trades, is really working on financial markets so I have to relay on what I read in papers and books:&#xA;- Often it is said, that the settlement of a stock trade in the USA generally requires three business days to pass between brokers and theirs clients and to formally move ownership from seller and buyer. &#xA;Clearly, recording transactions via blockchains could speed up things extremely (the bitcoin blockchain is updated roughly every 10th minute). &#xA;However, I am not sure whether this really affects liquidity: Aren't these 3 days to fix the settlement just some form of administration which are not relevant for the trader anymore? Or do these tasks produce such severe costs that fixing everything much faster and elegant via a blockchain benefits the trader?&lt;/p&gt;&#xA;" OwnerUserId="16249" LastActivityDate="2017-06-21T05:50:54.553" Title="Liqudity and Blockchains: How does settlement time affect real trading?" Tags="&lt;trading&gt;&lt;market-microstructure&gt;&lt;exchange&gt;&lt;blockchain&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32343" PostTypeId="2" ParentId="32342" CreationDate="2017-02-09T11:53:18.923" Score="3" Body="&lt;p&gt;i am not an expert in equity settlement, but through example you will be able to grasp the idea. there are few separate parties involved - for example client, broker and third party register where equity ownership is registered. let's say client buys equities through broker. now broker needs to collect funds from the client and deliver ownership of asset (register in clients name the asset). broker takes client funds, buys equity and records this transaction in its own books and later transmits information to third party register. what happens here is that information goes from broker to third party register. it might be in paper form or electronic form. then actual funds go from client buying equities to broker and from broker to client selling equities. so currently there is information exchange which is being recorded in one system, transmitted to other etc. also each party will be double checking if transaction is correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;now let's simplify blockchain, assume that it is just a shared database between some parties. meaning that there is one database, which is shared by client, broker and third party register, each having their own key to access the database and their information. this database is immutable (you can't change information once it is confirmed and approved), all related parties can access information immediately when it is added. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;so regarding liquidity, currently funds and ownership are settled in 3 days, meaning funds are locked up for this period of time. with blockchain, paper work is done instantly and funds can be released instantly as well. this increases liquidity as funds are released much quicker. though the benefits are mostly for broker and third party register. they will save up a lot of time and resources needed for record keeping, sharing/transmitting information between each other. settlement becomes almost instant, removes fraud, and all parties involved can access same information when needed.&lt;/p&gt;&#xA;" OwnerUserId="26499" LastActivityDate="2017-02-09T11:53:18.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32344" PostTypeId="2" ParentId="32341" CreationDate="2017-02-09T12:37:22.073" Score="1" Body="&lt;p&gt;Leveraged ETF rebalancing is one good example, here's a couple of papers on that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2506322&quot; rel=&quot;nofollow noreferrer&quot;&gt;Predictable ETF Order Flow and Market Quality&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2161057&quot; rel=&quot;nofollow noreferrer&quot;&gt;Intraday Share Price Volatility and Leveraged ETF Rebalancing&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19615" LastActivityDate="2017-02-09T12:37:22.073" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32345" PostTypeId="1" AcceptedAnswerId="32363" CreationDate="2017-02-09T13:07:20.547" Score="3" ViewCount="5790" Body="&lt;p&gt;Apologies if this has been asked in the forum (I couldn't find any examples)- Can someone please point me to a worked example in python using Quantlib for dual curve bootstrapping (using EONIA for discounting and EUR 3M Libor as forecasting).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also using the bootstrapped curve, I would then call the fair swaprate / forwardRate() / zeroRate() etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If someone can point me to some examples, that would be great.&#xA;I have looked at : &lt;a href=&quot;https://quant.stackexchange.com/questions/31073/quantlib-python-swap-yield-curve-bootstrapping-dates-and-maturities&quot;&gt;QuantLib Python Swap Yield Curve Bootstrapping Dates and Maturities&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, not too sure how to use this OIS bootstrapped curve into my forecasting curve bootstrapping&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&#xA;Sumit&lt;/p&gt;&#xA;" OwnerUserId="24131" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2017-02-21T13:51:44.327" Title="Quantlib python dual curve bootstrapping example" Tags="&lt;python&gt;&lt;quantlib&gt;&lt;ois-discounting&gt;&lt;ois&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="32348" PostTypeId="2" ParentId="29811" CreationDate="2017-02-09T16:27:50.163" Score="2" Body="&lt;p&gt;From the book mentioned in the question, the &lt;strong&gt;short hedging option portfolio&lt;/strong&gt; is used to replicate the option value with investment in the stock and money market account so that the portfolio value&#xA;$X(t)$ at each time $t \in [0, T]$ agrees with the option value $c(t, S(t))$. That is,&#xA;\begin{align*}&#xA;c(t, S(t)) = \Delta(t) S_t + \Delta_t^1 B_t,&#xA;\end{align*}&#xA;where $B_t = e^{rt}$ is the money market account value, and &#xA;\begin{align*}&#xA;\Delta_t^1 = \frac{c- \Delta(t) S_t}{B_t}&#xA;\end{align*}&#xA;is the units invested in the money market account. We require that the change, over the infinitesimal interval $[t,\, t+dt]$, of the option value is from the change of the invested securities, that is,&#xA;\begin{align*}&#xA;dc(t, S_t) = \Delta(t)dS_t+\Delta_t^1 dB_t.\tag{1}&#xA;\end{align*}&#xA;In other words, it is self-financing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From $(1)$, we obtain that&#xA;\begin{align*}&#xA;\left(\frac{\partial c}{\partial t}+\frac{1}{2}\frac{\partial^2 c}{\partial S^2}\sigma^2 S_t^2 \right)dt + \frac{\partial c}{\partial S}dS_t = \Delta(t)dS_t+r(c- \Delta(t) S_t) dt.&#xA;\end{align*}&#xA;Then &#xA;\begin{align*}&#xA;\Delta(t) = \frac{\partial c}{\partial S},\tag{2}&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;\frac{\partial c}{\partial t}+rS_t\frac{\partial c}{\partial S} + \frac{1}{2}\frac{\partial^2 c}{\partial S^2}\sigma^2 S_t^2 = rc.&#xA;\end{align*}&#xA;Here, $(2)$ is called the &lt;em&gt;delta hedging rule&lt;/em&gt; in the book.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-02-09T16:40:08.607" LastActivityDate="2017-02-09T16:40:08.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32349" PostTypeId="1" AcceptedAnswerId="32352" CreationDate="2017-02-09T17:50:15.290" Score="0" ViewCount="56" Body="&lt;p&gt;I am looking for the returns of an European financial index as it is the Dow Jones U.S. Financials Index (DJUSFN) for the US. Do you know if such an index exists and if it is available on yahoo finance database? It will be better if it is an European index (UK included) and not an Eurozone index.&lt;/p&gt;&#xA;" OwnerUserId="22108" LastActivityDate="2017-02-09T19:06:42.237" Title="European Financials Index" Tags="&lt;data&gt;&lt;market-data&gt;&lt;historical-data&gt;&lt;index&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32350" PostTypeId="1" CreationDate="2017-02-09T18:39:50.177" Score="4" ViewCount="3300" Body="&lt;p&gt;I am using the arch package in python to fit a GARCH(1,1) to fit daily S&amp;amp;P 500 returns from 1990 to 2017 (about 6800 data points). The code I am using is as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sp500 = pd.read_csv('sp.csv', index_col=0, parse_dates=True, squeeze=True)&#xA;sp500 = (np.log(sp500) - np.log(sp500.shift(1))).dropna()[::-1]&#xA;&#xA;from arch import arch_model&#xA;garch11 = arch_model(sp500, p=1, q=1)&#xA;res = garch11.fit(update_freq=10)&#xA;print res.summary()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Even for just 50 data points, the solver fails to converge, citing &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;The optimizer returned code 8. The message is:&#xA;Positive directional derivative for linesearch&#xA;See scipy.optimize.fmin_slsqp for code meaning. ConvergenceWarning)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems ridiculous that it can't fit 50 data points. Are there any tweaks to get this working?&lt;/p&gt;&#xA;" OwnerUserId="26509" LastActivityDate="2017-06-13T11:46:27.307" Title="Fitting GARCH(1,1) in Python for moderately large data sets" Tags="&lt;garch&gt;&lt;optimization&gt;&lt;python&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32351" PostTypeId="2" ParentId="32340" CreationDate="2017-02-09T19:06:28.000" Score="2" Body="&lt;p&gt;This is a common misunderstanding. Note that $(dS_t)^2$ is just a short hand or heuristic notation for $d[S, S]_t$. Here $[S, S]_t$ is the quadratic variation. You should not literally take $(dS_t)^2$ as the algebraic product of $dS$ and $dS$. In fact, note that&#xA;\begin{align*}&#xA;d[S, S]_t = \sigma^2 S^2 dt.&#xA;\end{align*}&#xA;Then, even if $dS=0$, it does not mean $d[S, S]_t=0$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2017-02-09T19:06:28.000" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32352" PostTypeId="2" ParentId="32349" CreationDate="2017-02-09T19:06:42.237" Score="2" Body="&lt;p&gt;How long a sample are you looking for?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could look for EUFN on Yahoo finance. It tracks 95 financial firms in europe (UK included) and has data since 2010.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;how can find holdings specifically here:&#xA;&lt;a href=&quot;https://www.ishares.com/us/products/239645/ishares-msci-europe-financials-etf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.ishares.com/us/products/239645/ishares-msci-europe-financials-etf&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="26454" LastActivityDate="2017-02-09T19:06:42.237" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32353" PostTypeId="6" CreationDate="2017-02-09T20:11:10.823" Score="0" Body="&lt;p&gt;I'm Bob Jansen and have been moderating Quant.SE for about two and a half years now. I have Bachelor in Econometrics, a Master in Quantitative Finance and am currently a 2017 Level III Candidate in the CFA Program .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've mostly worked in Insurance, building models and analysing their inputs and results. I try to stay current on developments in (Quantitative) Finance and Programming and that was how I got involved here in the first place. Something I still very much enjoy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe that in the time that I was a pro tem moderator I have succeeded in being reasonable in what is allowed on this site and have been sufficiently strict but still polite when it was necessary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to continue this and so I you will be elect me as a moderator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find &lt;a href=&quot;http://meta.quant.stackexchange.com/a/1533/848&quot;&gt;my answers to the questions on Meta here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="848" LastEditDate="2017-02-09T20:56:16.110" LastActivityDate="2017-02-09T20:56:16.110" CommentCount="0" CommunityOwnedDate="2017-02-09T20:11:10.823" ContentLicense="CC BY-SA 3.0" />
  <row Id="32354" PostTypeId="2" ParentId="32280" CreationDate="2017-02-09T23:30:59.133" Score="2" Body="&lt;p&gt;One thing you could do is make your trading signal sector neutral. For example, you can z-score your signals within each sector. For your example, your signals would be transformed from $(2.5,7.5)$ to $(-1.0,1.0)$. Your portfolio construction methodology is to take weights directly proportional to the signals, so in this case, having symmetrical weights makes sense. If you have more stocks, the signals will be transformed differently, for example $(2.5, 4.0, 7.5)$ is transformed to $(-1.03, -0.32, 1.35)$. Now you can see the situation is not symmetrical, and the strong signals are penalized less than the weak ones. So the information of your strategy is not 'lost' under the ranking operation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An alternative would be to think of different ways to construct your portfolio. For example, you can think of explicit sector weight constraints in a Markowitz type optimization.&lt;/p&gt;&#xA;" OwnerUserId="20059" LastActivityDate="2017-02-09T23:30:59.133" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="32356" PostTypeId="1" CreationDate="2017-02-10T03:43:19.827" Score="3" ViewCount="1490" Body="&lt;p&gt;Assume that I long ATM Call option on a stock at 20% implied volatility. This Call option will expire in 1 month. If, over this coming month, the underlying moves with 30% volatility and I delta-hedge this option. I expect to get profit from Gamma scalping. My expected P&amp;amp;L would be positive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would my P&amp;amp;L accumulate, on average,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does P&amp;amp;L grow linearly over time, or does P&amp;amp;L grow exponentially over time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does moneyness of option affect accumulated P&amp;amp;L shape?&lt;/p&gt;&#xA;" OwnerUserId="13991" LastActivityDate="2017-02-10T03:43:19.827" Title="How does P&amp;L of delta hedged option position accumulate over time?" Tags="&lt;delta-hedging&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32357" PostTypeId="1" CreationDate="2017-02-10T04:04:38.843" Score="2" ViewCount="803" Body="&lt;p&gt;I've been studying various aspects of utility function and I came across the definition of risk premium and insurance, which are mathematically very different from each other. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the book &lt;strong&gt;&quot;Theory of Asset pricing&quot;, page 17&lt;/strong&gt;, risk premium $\pi$ is defined as the amount that would satisfy $E[U(W+X)]=U(W-\pi)$ where $W$ is the investor's wealth and $X$ is a a zero-mean risk. If we consider the case of small risks, we then get that $\pi=-\frac{1}{2}E[X^2]\frac{U&quot;(W)}{U'(W)}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For me, this means that risk premium is an amount of money that we could be ready to pay to get rid of a risk / loss. Isn't that the core of insurance ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What does each of these two really mean ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks !&lt;/p&gt;&#xA;" OwnerUserId="26218" LastEditorUserId="26218" LastEditDate="2017-02-14T23:05:42.293" LastActivityDate="2017-02-14T23:05:42.293" Title="Are Insurance and Risk premium totally different?" Tags="&lt;risk&gt;&lt;utility-theory&gt;&lt;insurance&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32358" PostTypeId="2" ParentId="32338" CreationDate="2017-02-10T04:21:13.460" Score="3" Body="&lt;p&gt;You should check this answer: &lt;a href=&quot;https://quant.stackexchange.com/questions/30258/how-to-interpret-the-price-of-a-cds/30263#30263&quot;&gt;How to interpret the &amp;#39;price&amp;#39; of a CDS?&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;It explains the relation between spread and upfront.&#xA;In your particular case you might consider using a simple model mentioned at the end of that answer:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;A simple model for the value of a short protection CDS can be found if you write&lt;/p&gt;&#xA;&lt;p&gt;V = (C-S) x RPV01&lt;/p&gt;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&lt;p&gt;RPV01 = (1−exp(−gT))/g&lt;/p&gt;&#xA;&lt;p&gt;and C is the coupon, S is the par CDS spread, T is the remaining life in years and&lt;/p&gt;&#xA;&lt;p&gt;g=r+S/(1−R)g=r+S/(1−R)&lt;/p&gt;&#xA;&lt;p&gt;where r is the risk-free (Libor) rate and R is the expected recovery rate, usually set to 40%.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="15454" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2018-12-21T09:36:21.547" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="32359" PostTypeId="2" ParentId="29913" CreationDate="2017-02-10T04:58:04.490" Score="0" Body="&lt;p&gt;Binary Option on stock is not a pure gamble if you can incorporate new proven information on stock that improve change of winning.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Flipping a coin, is just pure luck. Probability of winning is not changed no matter what opinion you think about it or how smart you are or what information you have.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But for binary option, if you think that stock price will go up because you have economic reasons or inside information to support your believe. Binary Option is not a pure gamble anymore.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have advantage on information, given that information, it will improve probability that you will win. I'm talking about Conditional Probability.&lt;/p&gt;&#xA;" OwnerUserId="13991" LastActivityDate="2017-02-10T04:58:04.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32360" PostTypeId="1" CreationDate="2017-02-10T05:15:23.580" Score="1" ViewCount="334" Body="&lt;p&gt;Say, an investment bank sell Digital Call Option to its client at strike 100.&#xA;But trader at the bank want to book the deal with a call spread at 99/100 (price&amp;amp;hedge Digital Option like price&amp;amp;hedge a call spread) because trader believe that it will help smoothing hedging.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How should risk manager at the bank measure the risk? &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;a digital option as it is an actual contingent obligation? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;or a call spread as it is what trader book the deal?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="13991" LastActivityDate="2017-02-10T05:15:23.580" Title="Risk management for Digital Option at large Bank" Tags="&lt;delta-hedging&gt;&lt;exotics&gt;&lt;binary-options&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32362" PostTypeId="1" CreationDate="2017-02-10T09:59:00.400" Score="2" ViewCount="186" Body="&lt;p&gt;Lets say we are receiving tradable FX market depth(bid/ask prices and amounts for each level) from several Liquidity Providers and we want to aggregate the market depths in to a single bigger market depth. It is possible to sort the bid prices descending and ask prices ascending to give the best price for each but in this case, max(bid) &gt; min(ask) situation can occur.&lt;br&gt;&#xA;Sorting the price lists as above seemed trivial to me. Can you suggest another method?&lt;br&gt;&#xA;Thanks&lt;/p&gt;&#xA;" OwnerUserId="15349" LastEditorUserId="15349" LastEditDate="2017-02-12T08:00:29.207" LastActivityDate="2017-02-12T08:00:29.207" Title="FX Price aggregation method" Tags="&lt;market-data&gt;&lt;fx&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32363" PostTypeId="2" ParentId="32345" CreationDate="2017-02-10T10:25:50.787" Score="9" Body="&lt;p&gt;I reproduce the Ametrano-Bianchetti paper on dual-curve bootstrapping in Python with QuantLib in a chapter of the &lt;a href=&quot;https://leanpub.com/quantlibpythoncookbook&quot; rel=&quot;noreferrer&quot;&gt;QuantLib Python Cookbook&lt;/a&gt;.  (Note: I'm not sure what the etiquette is about plugging one's own for-sale book. Moderators, please let me know if that's out of line.)  That includes both OIS and LIBOR bootstrapping with different tenors, and it's way too long to describe here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the gist of it is that the swap-rate helpers used to bootstrap the LIBOR curve can take a discount curve to use.  In the old single-curve examples, a &lt;code&gt;SwapRateHelper&lt;/code&gt; instance would be created as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;helper = SwapRateHelper(quoted_rate, tenor, calendar,&#xA;                        fixedLegFrequency, fixedLegAdjustment,&#xA;                        fixedLegDayCounter, Euribor6M())&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and use the curve being bootstrapped for both forecast and discounting. To use dual-curve bootstrapping, instead, you'll have to build it as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;helper = SwapRateHelper(quoted_rate, tenor, calendar,&#xA;                        fixedLegFrequency, fixedLegAdjustment,&#xA;                        fixedLegDayCounter, Euribor6M(),&#xA;                        QuoteHandle(), Period(0,Days),&#xA;                        discountCurve)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the above, the additional &lt;code&gt;QuoteHandle()&lt;/code&gt; and &lt;code&gt;Period(0,Days)&lt;/code&gt; arguments are, unfortunately, needed because the SWIG wrappers don't support keyword arguments for this constructor; and the &lt;code&gt;discountCurve&lt;/code&gt; argument would be a handle to the OIS curve that you bootstrapped previously.  When the swap-rate helpers are instantiated as above, they will use the LIBOR curve being bootstrapped for forecast and the OIS curve for discounting.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2017-02-10T10:25:50.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32364" PostTypeId="2" ParentId="16793" CreationDate="2017-02-10T19:44:06.943" Score="0" Body="&lt;p&gt;The spread is determined by how much the notional value of the swap is collateralized. If the swap is 0% collateralized, your rate can be as high as L+600. If it's fully collateralized, as low as L+50. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you keep 10% of the notional amount as pledged collateral, then any single day loss over 10% in SPTR would require additional margin to be posted above the collateral pool. The spread is a function of the credit-worthiness of the counterparty, the notional amount, the percentage of pledged collateral, and the assumed distribution of returns on the swapped instrument. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;None of this walks through the exact method, and the ranges on the spreads of LIBOR are neighborhood figures, but that is how they approach it. &lt;/p&gt;&#xA;" OwnerUserId="19473" LastActivityDate="2017-02-10T19:44:06.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32365" PostTypeId="2" ParentId="32362" CreationDate="2017-02-10T20:12:01.307" Score="3" Body="&lt;p&gt;Are these tradeable prices or indicative feeds from brokers? Or on different e-platforms? If they are tradeable, what other information do you have, like available size, period of validity...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All of that information is needed to tell you what those numbers mean. From indicative numbers you may only be able to get an indication, so significant analysis might be misleading.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastActivityDate="2017-02-10T20:12:01.307" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32366" PostTypeId="1" AcceptedAnswerId="32368" CreationDate="2017-02-11T11:14:46.840" Score="2" ViewCount="389" Body="&lt;p&gt;How is the option price of an plain vanilla option (in a Black Scholes setting) derived, which is written on, say XAGGBP but practically hedged with XAGUSD and GBPUSD (because these are more liquid)? Eventually, I am interested in the delta(s) and correlation risk with respect to XAGUSD and GBPUSD.  &lt;/p&gt;&#xA;" OwnerUserId="20736" LastActivityDate="2017-02-11T21:24:09.437" Title="Pricing and Hedging an Option through a Currency Triangle" Tags="&lt;fx&gt;&lt;correlation&gt;&lt;delta-hedging&gt;&lt;black76&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32367" PostTypeId="2" ParentId="32357" CreationDate="2017-02-11T18:15:55.803" Score="2" Body="&lt;p&gt;An Insurance premium typically focuses solely on the downside of your Risk. An Insurance pays if you suffered some damage, but you do not give them some share of your profit if things are good.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That means you have to get rid of the positive part of X, which has than of course a non-zero mean.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apart from that, I think you are correct, in that you can see $\pi$ in your formula as the amount an insurance customer is willing to pay to insure herself against the downside risk X.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The insurer on the other hand has of course a totally different view and utility, when calculating the premium. For example she can't calculate each contract separatly because she has to factor in correlations.&lt;/p&gt;&#xA;" OwnerUserId="22686" LastActivityDate="2017-02-11T18:15:55.803" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32368" PostTypeId="2" ParentId="32366" CreationDate="2017-02-11T21:24:09.437" Score="1" Body="&lt;p&gt;Let $X_t^{xag\rightarrow gbp}$ be the exchange rate from one unit of XAG to units of GBP. Moreover, let&#xA;$X_t^{xag\rightarrow usd}$, and $X_t^{gbp\rightarrow usd}$ be the respective exchanges rates from one unit of XAG and GBP to units of USD. We consider an option payoff, in GBP, at maturity $T$ of the form&#xA;\begin{align*}&#xA;\left(X_T^{xag\rightarrow gbp} -K\right)^+. \tag{1}&#xA;\end{align*}&#xA;Note that&#xA;\begin{align*}&#xA;\left(X_T^{xag\rightarrow gbp} -K\right)^+ = \left(\frac{X_T^{xag\rightarrow usd}}{X_T^{gbp\rightarrow usd}} -K\right)^+. &#xA;\end{align*}&#xA;We assume that, under the USD risk-neutral probability measure $Q_{usd}$, &#xA;\begin{align*}&#xA;dX_t^{xag\rightarrow usd} &amp;amp;= X_t^{xag\rightarrow usd}\left[\left(r^{usd}-r^{xag} \right)dt +\sigma_1 dW_t^1 \right],\\&#xA;dX_t^{gbp\rightarrow usd} &amp;amp;= X_t^{gbp\rightarrow usd}\left[\left(r^{usd}-r^{gbp} \right)dt +\sigma_2\left(\rho dW_t^1 +\sqrt{1-\rho^2}dW_t^2\right)\right],&#xA;\end{align*} &#xA;where $r^{usd}$, $r^{gbp}$, and $r^{xag}$ are interest rates, $\sigma_1$ and $\sigma_2$ are volatilities, $\rho$ is the correlation, and $\{W_t^1, \, t\ge 0\}$ and $\{W_t^2, \, t\ge 0\}$ are two standard independent Brownian motions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $B_t^{usd}=e^{r^{usd} t}$ and $B_t^{gbp}=e^{r^{gbp} t}$ be the respective USD and GBP money market account values at time $t$.  Moreover, let $Q^{gbp}$ be the GBP risk-neutral probability measure. Note that&#xA;\begin{align*}&#xA;\frac{dQ^{gbp}}{dQ^{usd}}\big|_t &amp;amp;= \frac{B_t^{gbp}X_t^{gbp\rightarrow USD}}{B_t^{usd}X_0^{gbp\rightarrow USD}}\\&#xA;&amp;amp;=e^{-\frac{1}{2}\sigma_2^2 t + \sigma_2\left(\rho W_t^1 +\sqrt{1-\rho^2}W_t^2\right)}.&#xA;\end{align*}&#xA;Then, $\{\tilde{W}_t^1, \, t\ge 0\}$ and $\{\tilde{W}_t^2, \, t\ge 0\}$, where &#xA;\begin{align*}&#xA;\tilde{W}_t^1 &amp;amp;= W_t^1 - \sigma_2\rho t, \\&#xA;\tilde{W}_t^2 &amp;amp;= W_t^2 - \sigma_2\sqrt{1-\rho^2} t,&#xA;\end{align*}&#xA;are two standard independent Brownian motions under $Q_{gbp}$. Furthermore, under $Q^{gbp}$, &#xA;\begin{align*}&#xA;dX_t^{xag\rightarrow usd} &amp;amp;= X_t^{xag\rightarrow usd}\left[\left(r^{usd}-r^{xag} +\rho\sigma_1\sigma_2\right)dt +\sigma_1 d\tilde{W}_t^1 \right],\\&#xA;dX_t^{gbp\rightarrow usd} &amp;amp;= X_t^{gbp\rightarrow usd}\left[\left(r^{usd}-r^{gbp} +\sigma_2^2\right)dt +\sigma_2\left(\rho d\tilde{W}_t^1 +\sqrt{1-\rho^2}d\tilde{W}_t^2\right)\right].&#xA;\end{align*} &#xA;Then&#xA;\begin{align*}&#xA;X_t^{xag\rightarrow gbp} &amp;amp;= \frac{X_t^{xag\rightarrow usd}}{X_t^{gbp\rightarrow usd}} \\&#xA;&amp;amp;=\frac{X_0^{xag\rightarrow usd}}{X_0^{gbp\rightarrow usd}} e^{\left(r^{gbp}-r^{xag}+\rho\sigma_1\sigma_2-\frac{1}{2}\sigma_1^2 -\frac{1}{2}\sigma_2^2\right)t + (\sigma_1-\rho\sigma_2)\tilde{W}_t^1 -\sigma_2\sqrt{1-\rho^2}\tilde{W}_t^2}\\&#xA;&amp;amp;=X_0^{xag\rightarrow gbp} e^{\left(r^{gbp}-r^{xag}-\frac{\sigma_1^2+\sigma_2^2-2\rho\sigma_1\sigma_2}{2}\right)t + \sqrt{\sigma_1^2+\sigma_2^2 - 2\rho\sigma_1\sigma_2 }\frac{(\sigma_1-\rho\sigma_2)\tilde{W}_t^1 -\sigma_2\sqrt{1-\rho^2}\tilde{W}_t^2}{\sqrt{\sigma_1^2+\sigma_2^2 - 2\rho\sigma_1\sigma_2 }} }.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let &#xA;\begin{align*}&#xA;\sigma = \sqrt{\sigma_1^2+\sigma_2^2 - 2\rho\sigma_1\sigma_2 },&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;W_t^3 = \frac{(\sigma_1-\rho\sigma_2)\tilde{W}_t^1 -\sigma_2\sqrt{1-\rho^2}\tilde{W}_t^2}{\sqrt{\sigma_1^2+\sigma_2^2 - 2\rho\sigma_1\sigma_2 }}.&#xA;\end{align*}&#xA;Then $\{W_t^3, \, t \ge 0\}$ is a standard Brownian motion under $Q^{gbp}$, by Levy's characterization. Moreover,&#xA;\begin{align*}&#xA;d X_t^{xag\rightarrow gbp} = X_t^{xag\rightarrow gbp}\left[\left(r^{gbp}-r^{xag} \right)dt +\sigma dW_t^3 \right].&#xA;\end{align*}&#xA;Therefore, the option payoff $(1)$ can be valued using the Garman Kohlhagen formula, while replace the initial exchange rate $X_0^{xag\rightarrow gbp}$ by $\frac{X_0^{xag\rightarrow usd}}{X_0^{gbp\rightarrow usd}}$. The respective hedge ratios can be computed subsequently.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2017-02-11T21:24:09.437" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="32369" PostTypeId="1" AcceptedAnswerId="32371" CreationDate="2017-02-12T00:20:06.000" Score="2" ViewCount="603" Body="&lt;p&gt;I have derived the convexity adjustment expression for futures rates using the Ho-Lee model, to arrive at the following:&#xA;$$&#xA;ForwardRate = FuturesRate - \frac{1}{2}\sigma^2T_1T_2&#xA;$$&#xA;where $T_1$ refers to the time when the forward rate starts, $T_2$ when it finishes and $\sigma$ refers to the volatility of the short rate process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have derived the above expression in continuous time assuming continuous compounding, but my futures rate is a simply compounded rate. Is the following conversion to simple compounding correct?&#xA;$$&#xA;\left(1 + ForwardRate\times(T_2-T_1)\right)^{(T_2-T_1)} = \left(1 + FuturesRate\times(T_2-T_1)\right)^{(T_2-T_1)} - \frac{1}{2}\sigma^2T_1T_2&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am under the impression I'm terribly wrong!&lt;/p&gt;&#xA;" OwnerUserId="15099" LastActivityDate="2017-02-12T13:22:33.517" Title="From continuous compounding to simple compounding - convexity adjustment" Tags="&lt;interest-rates&gt;&lt;fixed-income&gt;&lt;convexity&gt;&lt;compounding&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32370" PostTypeId="2" ParentId="32282" CreationDate="2017-02-12T00:36:31.047" Score="1" Body="&lt;p&gt;To start the numbering of years with 0 is weird, but from the answer its clear, that the next three years are meant.&#xA;Since we discount the bond with $\frac{1}{(1+r_{0})}$ it's clear, that $r_{0}$ is the rate for the timeperiod starting now and ending in one year. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Than we discount with all possible combinations of $r_{u}$, $r_{d}$ and $r_{uu}$, $r_{ud}$, $r_{dd}$ which means these are the rates for the following two years&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That the author calls the first year $y_{0}$, the second year $y_{1}$ and the third year $y_{2}$ seems unusal. If he has a reason for it, it's not apparent from the excerpt you posted.&lt;/p&gt;&#xA;" OwnerUserId="22686" LastActivityDate="2017-02-12T00:36:31.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32371" PostTypeId="2" ParentId="32369" CreationDate="2017-02-12T01:16:59.410" Score="1" Body="&lt;p&gt;Since the simple interest $r_{s}$ and the continuous compounded interest $r_{c}$ are connected by&#xA;$$(1 + r_{s} \cdot (T_{2}-T_{1})) = e^{r_{c} \cdot (T_{2}-T_{1})}$$&#xA;it follows for the continuous compounded interest:&#xA;$$r_{c} = \frac{1}{T_{2}-T_{1}} \cdot \ln{(1+r_{s} \cdot (T_{1}-T{2}))}$$&#xA;your convexity formula becomes than:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{1}{T_{2}-T_{1}} \cdot \ln{(1 + ForwardRate \cdot (T_{2}-T_{1}))} = \frac{1}{T_{2}-T_{1}} \cdot \ln{(1+FutureRate \cdot (T_{2}-T_{1}))} - \frac{1}{2}\sigma^{2}T_{1}T{2}  $$&#xA;This is your formula with $ForwardRate$ und $FutureRate$ expressed as simple interest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your calculation you seem to think of annual compounding.&lt;/p&gt;&#xA;" OwnerUserId="22686" LastEditorUserId="22686" LastEditDate="2017-02-12T13:22:33.517" LastActivityDate="2017-02-12T13:22:33.517" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32372" PostTypeId="1" CreationDate="2017-02-12T07:36:14.363" Score="0" ViewCount="2572" Body="&lt;p&gt;Can anyone tell me more about PRDC products. I've heard it is a popular product among Japanese investors. One popular product is the 10Y BRL/JPY paying a coupon of 20%*PerfFX-15% with callable options for the bank. I am a bit confused about the sensitivities (fx and rates), from my understanding the client thinks the BRLJPY forward is too low so he is long the forward =&gt; short BRL rate and long JPY rate. Correct? What about the correlation between fx spot and rates? It is confusing for me. &#xA;Also, every year the bank can call the product. How does the trader decide if he should call it back or not? &#xA;Thanks for your help&lt;/p&gt;&#xA;" OwnerUserId="26538" LastEditorUserId="16160" LastEditDate="2017-02-12T16:49:46.463" LastActivityDate="2017-02-13T20:13:44.837" Title="FX: PRDC (Power Reverse Dual-Currency Notes): key risks and callability" Tags="&lt;options&gt;&lt;fx&gt;&lt;structured-finance&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32375" PostTypeId="1" CreationDate="2017-02-12T11:51:00.373" Score="1" ViewCount="335" Body="&lt;p&gt;Given a price vector $(p_1,p_2,...,p_n)$ for some stock, then the corresponding return at $k$th day is described by&#xA;$$&#xA;R_k = \frac{p_{k+1} - p_k}{p_k}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, let $W_k$ be wealth at day $k$ induced by some trading algorithm. Then I have another ''return&quot; (under some trading algorithm) given by&#xA;$$&#xA;r_k = \frac{W_{k+1} - W_k}{W_k}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming no risk-free rate. I want to use annualized Sharpe ratio to characterize my trading performance, then I got huge confusion for the following two possibilities: [The Sharpe Ratio formula below are fixed. ] &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$SR_1 = \sqrt{252} \frac{E[R_k] }{Std(R_k)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$SR_2 = \sqrt{252} \frac{E[r_k] }{Std(r_k)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which one is the correct annualized Sharpe ratio? Any suggestion is appreciated.&lt;/p&gt;&#xA;" OwnerUserId="26540" LastEditorUserId="26540" LastEditDate="2017-02-13T01:04:51.573" LastActivityDate="2017-02-13T01:04:51.573" Title="Simple Sharpe Ratio Question Related to Trading Strategy" Tags="&lt;portfolio-management&gt;&lt;quant-trading-strategies&gt;&lt;trading&gt;&lt;sharpe-ratio&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32376" PostTypeId="2" ParentId="32375" CreationDate="2017-02-12T15:13:27.347" Score="4" Body="&lt;p&gt;First, you do not divide by the variance, but the standard deviation when calculating Sharpe ratios. Secondly, none of them are wrong, but $SR_1$ is the expected Sharpe ratio of the asset you are trading, and the second is the expected Sharpe ratio of your strategy. As a trader you care about the latter, but the first can be interesting to see if you actually beat just buying and holding the instrument in question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What this means is that, notationally, you don't input the &lt;em&gt;ex ante&lt;/em&gt; (expected) return in your Sharpe ratio calculation if you want to evaluate your results &lt;em&gt;ex post&lt;/em&gt; (after they happened.) So you calculate your return series $r = \{r_1, r_2, r_3, \ldots, r_t\}$ and calculate the sample mean, $\hat{\mu}_{r}$ and similarly with the standard deviation $\hat{\sigma}_r$. This gives you the realized or ex post Sharpe ratio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make it explicit per Alex C's suggestion, calculating the ex post Sharpe ratios for both the strategy and the asset can be used to do what I describe in the first paragraph. &lt;/p&gt;&#xA;" OwnerUserId="13808" LastEditorUserId="13808" LastEditDate="2017-02-12T20:49:42.527" LastActivityDate="2017-02-12T20:49:42.527" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32379" PostTypeId="1" AcceptedAnswerId="32382" CreationDate="2017-02-12T18:20:00.083" Score="2" ViewCount="250" Body="&lt;p&gt;As a beginner, I'm learning how to make good trading strategies. One of the things to consider for reliable backtesting is the Minimum Backtest Length, whose selection is basically a tradeoff:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Too short a backtest duration $\implies$ statistically unreliable backtest&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Too long a backtest duration $\implies$ underlying dynamics of the market may have changed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't have a concrete idea of what &quot;underlying dynamics of the market&quot; means in the context of trading strategies. Secondly, from the first answer to this question: &lt;a href=&quot;https://quant.stackexchange.com/questions/10666/backtesting-period&quot;&gt;Backtesting Period&lt;/a&gt;, I gathered that the &quot;market dynamics&quot; are different for trading strategies of different frequencies. So the underlying dynamics relevant to an HFT strategy change more frequently than those relevant to a strategy with weekly turnover.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Firstly, what exactly is meant/covered by market dynamics that affect a particular trading strategy?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;More importantly, could someone please explain exactly &lt;strong&gt;how&lt;/strong&gt; one can identify when and why the underlying dynamics of the market changed?&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="19057" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2017-02-12T20:46:44.200" Title="How to identify a change in market dynamics?" Tags="&lt;quant-trading-strategies&gt;&lt;backtesting&gt;&lt;market-microstructure&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32380" PostTypeId="6" CreationDate="2017-02-12T19:20:19.703" Score="0" Body="&lt;h2&gt;Who?&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I am &lt;strong&gt;olaker&lt;/strong&gt; and I have been around since the commitment phase of the Quantitative Finance site which arguably qualifies me as a relict. I have PhD in mathematics. My professional interests include quantitative portfolio management (equity, futures, FX) and option pricing. My career has shifted over the years from the relatively pure and unselfish pursuit of academic diversions to brutal tribulations of a hedge fund combat zone. &lt;a href=&quot;http://meta.quant.stackexchange.com/questions/1530/2017-moderator-election-qa-questionnaire/1536#1536&quot;&gt;&lt;strong&gt;I answered the Election Questionnaire here&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Why me?&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;I &lt;em&gt;love&lt;/em&gt; handling flags and review queues. Moderation has made up most of my QF activity in recent years.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I constantly seek to improve and will take negative feedback well.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I expect my actions to stand to scrutiny.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;Availability&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I am usually logged in and active from 8 AM to 10 PM EST.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;Some random stats&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;1670 First Post reviews (all-time Top Reviewer)&lt;/li&gt;&#xA;&lt;li&gt;1k Close/Leave Open votes (all-time Top Reviewer)&lt;/li&gt;&#xA;&lt;li&gt;376 Suggested Edit reviews (all-time Top Reviewer)&lt;/li&gt;&#xA;&lt;li&gt;283 Low Quality Post reviews (all-time Top Reviewer)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="70" LastEditorUserId="70" LastEditDate="2017-02-13T09:22:01.643" LastActivityDate="2017-02-13T09:22:01.643" CommentCount="0" CommunityOwnedDate="2017-02-12T19:20:19.703" ContentLicense="CC BY-SA 3.0" />
  <row Id="32381" PostTypeId="1" CreationDate="2017-02-12T19:50:55.290" Score="0" ViewCount="338" Body="&lt;p&gt;I want a dependable stream of second-by-second stock data. I have looked into &lt;a href=&quot;http://quantgo.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;quantgo&lt;/a&gt;, &lt;a href=&quot;https://www.iqfeed.net&quot; rel=&quot;nofollow noreferrer&quot;&gt;iqFeed&lt;/a&gt; and QuantHouse. Quantgo and iqFeed seem decent. QuantHouse with its ultra low latency speeds seems like overkill for what I am looking for but may be of some use later. I am not looking for the cheapest, but for the most dependable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have either any experience with any of them or know of a company that offers such real time date feeds. &lt;/p&gt;&#xA;" OwnerUserId="26546" LastEditorUserId="16160" LastEditDate="2017-02-13T01:00:13.837" LastActivityDate="2017-02-13T23:12:07.170" Title="Where can I get a dependable data stream of stock prices?" Tags="&lt;equities&gt;&lt;tick-data&gt;&lt;latency&gt;&lt;feed&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32382" PostTypeId="2" ParentId="32379" CreationDate="2017-02-12T20:39:54.807" Score="1" Body="&lt;p&gt;Markets are adaptive, highly dynamic systems that depend on the input of a multitude of risk attitudes, investment ideas, trading frequencies, economic expectations and much more. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way of understanding market dynamics is through assuming you have a parameterized model for explaining or trading the market, $m$, that depends on a set of parameters $\eta_i$, $i \in \{1,2,\ldots, n\}$. Such a model could be the CAPM model where the interest rate of an asset $r$ is decided via $$r = \alpha + \beta r_{market} + \epsilon, \quad\epsilon \sim N(0,\sigma)$$&#xA;where your set of parameters is $\{\alpha, \beta, \sigma\}$. If you go on to estimate this model (via OLS, for example), you have an implicit assumption that your parameter set won't change significantly in the out-of-sample period, otherwise the model is not usable for trading as the world you have looked at is very different than the world in the future, and it is only good for explaining the past. If you are using daily return data and you estimate the $\beta$ variable for the last 30 years, chances are you will have gone through a number of different market-types that all are lumped together in your static parameter estimate. Thus you often want to create models that change dynamically over time, such as using rolling estimation of $\beta$. And of course, the above model is pretty much useless at extremely high frequencies, and you will not care too much about the interest rate policy when you are working with tick data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It also boils down to what a trading strategy is supposed to $do$. If we assume you aren't market making, then you will be exploiting some regularly occurring pattern or anomaly via some sort of indicator that gives you signals. This pattern can disappear if other traders latch onto it, or if the market dynamics change due to an external event. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to detect regime shifts in the parameters, there are a number of methods. &lt;a href=&quot;http://www.beringclimate.noaa.gov/regimes/rodionov_overview.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;This paper&lt;/a&gt; gives a very large number of different methods developed for this purpose. Some of the most popular in finance are (Hidden) Markov Models and changepoint analysis. You can find good questions on this under the market-regime tag here. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will note that I don't believe that a backtest can be too long if you are at lower frequencies, as the longer data will just give you more confidence that your model actually could be useful in a multitude of market regimes rather than just the recent past. Many people go to great lengths to generate artificial data with particular properties to vastly increase their backtest length, synthetically. &lt;/p&gt;&#xA;" OwnerUserId="13808" LastEditorUserId="13808" LastEditDate="2017-02-12T20:46:44.200" LastActivityDate="2017-02-12T20:46:44.200" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="32383" PostTypeId="2" ParentId="27673" CreationDate="2017-02-12T21:41:56.410" Score="6" Body="&lt;p&gt;In case of NYSE equities &lt;a href=&quot;http://wallstreet.cch.com/PCXtools/PlatformViewer.asp?SelectedNode=chp_1_1&amp;amp;manual=/PCX/pcxe/pcxe-rules/&quot; rel=&quot;noreferrer&quot;&gt;rule&lt;/a&gt; 7.6 reads: &quot;&lt;em&gt;The minimum price variation (&quot;MPV&quot;) for quoting and entry of orders in securities traded on the NYSE Arca Marketplace is USD 0.01, with the exception of securities that are priced less than USD 1.00 for which the MPV for quoting and entry of orders is USD 0.0001.&lt;/em&gt;&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For NASDAQ equities &lt;a href=&quot;http://nasdaq.cchwallstreet.com/NASDAQTools/PlatformViewer.asp?selectednode=chp_1_1_4_1&amp;amp;manual=%2Fnasdaq%2Fmain%2Fnasdaq-equityrules%2F&quot; rel=&quot;noreferrer&quot;&gt;rule&lt;/a&gt;  4701 (k) reads: &quot;&lt;em&gt;The term &quot;minimum price increment&quot; means USD 0.01 in the case of a System Security priced at USD 1 or more per share, and USD 0.0001 in the case of a System Security priced at less than USD 1 per share.&lt;/em&gt;&quot; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition there is the SEC tick size pilot program (&lt;a href=&quot;http://www.finra.org/investors/tick-size-pilot-program&quot; rel=&quot;noreferrer&quot;&gt;FINRA&lt;/a&gt;, &lt;a href=&quot;https://www.sec.gov/oiea/investor-alerts-bulletins/ia_ticksize.html&quot; rel=&quot;noreferrer&quot;&gt;SEC&lt;/a&gt;) which you can find embedded in the rule books as well.&lt;/p&gt;&#xA;" OwnerUserId="2284" LastActivityDate="2017-02-12T21:41:56.410" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32384" PostTypeId="1" CreationDate="2017-02-12T22:30:49.440" Score="4" ViewCount="81" Body="&lt;p&gt;In Carr's 1998 paper &lt;a href=&quot;https://pdfs.semanticscholar.org/8992/0704c2a16137c82354939cb0307abd0f562c.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Randomization and the American Put&lt;/a&gt;, he sets up the following ODE for the value of an American put with expiration given by the first jump time of a Poisson process with rate $\lambda = 1/T$ (Eq. 10 in link):&#xA;$$&#xA;\frac{\sigma^2}{2}S^2 P^{(1)}_{SS}(S) + rSP^{(1)}_S(S) - rP^{(1)}(S) = \lambda[P^{(1)}(S) - (K - S)^+], \qquad S &amp;gt; \underline{S}_1 \quad (1)&#xA;$$&#xA;subject to the boundary conditions&#xA;$$&#xA;\lim_{S \, \uparrow \infty} P^{(1)}(S) = 0, \qquad \lim_{S \, \downarrow \underline{S}_1} P^{(1)}(S) = K - \underline{S}_1, \qquad \lim_{S \, \downarrow \underline{S}_1} P^{(1)}_S(S) = -1\;.&#xA;$$&#xA;Here $P^{(1)}(S)$ is the randomized American put value and $\underline{S}_1 &amp;lt; K$ is the (unknown) optimal exercise boundary.  Carr gives the following solution, which I am struggling to derive myself:&#xA;\begin{align*}&#xA;P^{(1)}(S) = &#xA;\begin{cases}&#xA;p^{(1)}(S) + b^{(1)}(S) \qquad &amp;amp; \text{if } S &amp;gt; K \\&#xA;KR - S + c^{(1)}(S) + b^{(1)}(S) \qquad &amp;amp; \text{if } S \in (\underline{S}_1, K) \\&#xA;K - S \qquad &amp;amp; \text{if } S \leq \underline{S}_1&#xA;\end{cases}&#xA;\end{align*}&#xA;Here, $p^{(1)}(S)$ is the randomized value of a European put paying $(K-S)^+$ at the first jump:&#xA;$$&#xA;p^{(1)}(S) = \left(\frac{S}{K}\right)^{\gamma - \epsilon} (qKR - \hat{q}K), \qquad S &amp;gt; K&#xA;$$&#xA;where&#xA;$$&#xA;\gamma = \frac{1}{2} - \frac{r}{\sigma^2}, \qquad R = \frac{1}{1 + rT}, \qquad \epsilon = \sqrt{\gamma^2 + \frac{2}{R\sigma^2 T}}&#xA;$$&#xA;and&#xA;$$&#xA;p = \frac{\epsilon - \gamma}{2\epsilon}, \qquad q = 1-p, \qquad \hat{p} = \frac{\epsilon - \gamma + 1}{2\epsilon}, \qquad \hat{q} = 1 - \hat{p} \;.&#xA;$$&#xA;The quantity $b^{(1)}(S)$ is described as the present value of interest received below the critical stock price $\underline{S}_1$ until the first jump,&#xA;$$&#xA;b^{(1)}(S) = \left(\frac{S}{\underline{S}_1}\right)^{\gamma - \epsilon} qKRrT \;.&#xA;$$&#xA;Finally, $c^{(1)}(S)$ is the randomized value of a European call paying $(S - K)^+$ at the first jump time,&#xA;$$&#xA;c^{(1)}(S) = \left(\frac{S}{K}\right)^{\gamma + \epsilon} (\hat{p}K - pKR), \qquad S &amp;lt; K\;.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's what I did for the case $S \in (\underline{S}_1, K)$, for which I'm not arriving at Carr's solution.  Using the change of variables $x \mapsto \log S$, it's easy to show the homogeneous solution to $(1)$ is&#xA;$$&#xA;P^{(1)}_{homo}(S) = c_1 S^{\gamma + \epsilon} + c_2 S^{\gamma - \epsilon}&#xA;$$&#xA;and that the particular solution is&#xA;$$&#xA;P^{(1)}(S) = c_1 S^{\gamma + \epsilon} + c_2 S^{\gamma - \epsilon} + RK - S\;.&#xA;$$&#xA;Using the boundary conditions $\lim_{S \, \downarrow \underline{S}_1} P^{(1)}(S) = K - \underline{S}_1$ and $\lim_{S \, \downarrow \underline{S}_1} P^{(1)}_S(S) = -1$, I get that&#xA;\begin{align*}&#xA;c_1 &amp;amp; = \underline{S}_1^{-\gamma - \epsilon}(pK - pKR), \\&#xA;c_2 &amp;amp; = \underline{S}_1^{\epsilon - \gamma}qKRrT&#xA;\end{align*}&#xA;This is &lt;em&gt;almost&lt;/em&gt; the correct solution, if only we had $c_1 = K^{-\gamma - \epsilon}(\hat{p}K - pKR)$.  That is, replacing $\underline{S}_1$ with $K$ and the first $p$ with $\hat{p}$.  Can anyone spot where I may have made a mistake?&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2017-02-12T22:30:49.440" Title="ODE Solution in Carr's Randomized American Put" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;american-options&gt;&lt;differential-equations&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32385" PostTypeId="2" ParentId="32372" CreationDate="2017-02-13T01:53:32.653" Score="1" Body="&lt;p&gt;In your example, the buyer of the PRDC security is a Yen-based investor who gets long the BRL on a forward basis, on each coupon date and on the final maturity date.  Because BRL is a lot cheaper forward than spot, the investor gets a high coupon for taking this risk. You can think of the risk taken by the investor in 2 ways, either (a) long the BRL forward or (2) long the BRL spot + long a BRL fixed rate bond + short a Yen fixed rate bond.  These are equivalent.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The dealer usually had an option to mature the bonds early.  They will do this if the trade is moving sufficiently in the investor's favor:  either spot BRL has appreciated , or BRL rates have gone down , or Yen rates have gone up, or some combination.   As with any Bermudan option , the early options will only be exercised if the markets have moved heavily in the investor's favor.  The later options require to be less 'in the money' to be exercised.  The models used to determine exercise are complex , containing the dynamics of the fx rate and the two rate markets, and their correlations. &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-02-13T01:53:32.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32386" PostTypeId="2" ParentId="32381" CreationDate="2017-02-13T06:00:14.803" Score="3" Body="&lt;p&gt;If you don't have strict low latency requirements and don't care if the provider is conflating tick data, then I would recommend using a broker's market data feed. Many electronic brokers offer access to connect to streaming market data alongside their other services. This will be the cheapest option in terms of cost, and will also likely be the easiest to develop on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you need an enterprise solution, and can afford to pay several thousand dollars a month, then the likes of Bloomberg, ActiveX, SR Labs, IDC, S&amp;amp;P's Quanthouse, are some of the big providers out there that I am acquainted with.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For high fidelity, ultra low latency requirements, I would recommend either MayStreet's Bellport or SR Labs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition to factors such as latency, data fidelity, and cost, I would also consider the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;How easy is it to develop on their api ? Does their api service model satisfy your application's requirements ?&lt;/li&gt;&#xA;&lt;li&gt;In terms of tick data, do they provide only the inside market ? Level 1 data ? Level 2 data ? What other auxiliary data do they offer ?&lt;/li&gt;&#xA;&lt;li&gt;What options are there to connect into their feeds ? Internet ? Collocate ? Vpn ? Something else ?&lt;/li&gt;&#xA;&lt;li&gt;What is the universe of securities they support ?&lt;/li&gt;&#xA;&lt;li&gt;In addition to raw tick data, what sorts of aggregate and summary data do they offer ?&lt;/li&gt;&#xA;&lt;li&gt;How capable is their IT ? Do they respond quickly and with useful answers or no ?&lt;/li&gt;&#xA;&lt;li&gt;Does their api have methods to recover from connection drops, session corrupted, server failover, etc ? How robust are these procedures ?&lt;/li&gt;&#xA;&lt;li&gt;What symbology schema do they use to lookup and request data ? Is it consistent with your system's symbology ?&lt;/li&gt;&#xA;&lt;li&gt;What sort of data limits do they impose ? Do they offer a test server to develop on ?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Hope that helps.&lt;/p&gt;&#xA;" OwnerUserId="17414" LastEditorUserId="17414" LastEditDate="2017-02-13T06:15:12.123" LastActivityDate="2017-02-13T06:15:12.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32389" PostTypeId="1" CreationDate="2017-02-13T14:51:21.983" Score="0" ViewCount="109" Body="&lt;p&gt;suppose&#xA;$$dA = \mu Adt + \sigma AdX.$$&#xA;is a geometric Brownian motion. One says that the Probability  $P(A,t)$ of $A$ reashing the critical level $K(t)$ before maturity:&#xA;$$\dfrac{\partial P}{\partial t} + \dfrac{1}{2}\sigma^2A^2\dfrac{\partial^2 P}{\partial A^2}+\mu \dfrac{\partial P}{\partial A} = 0$$&#xA;I know this  is the &lt;code&gt;Kolomogorov backward equation&lt;/code&gt; for transition density, but why this is true for probability function here? It seems we should replace CDF by PDF i.e replace $P$ by $\dfrac{\partial P}{\partial x}$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually the background is the probability of default, &lt;code&gt;Paul Wilmott on Quantitative Finance Volumne II&lt;/code&gt; Page641 39.2.2&#xA;&lt;a href=&quot;https://i.stack.imgur.com/cWzaI.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/cWzaI.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26165" LastEditorUserId="26165" LastEditDate="2017-02-14T09:26:41.700" LastActivityDate="2017-02-14T11:27:27.350" Title="probability of default for Kolomogorov backward equation" Tags="&lt;black-scholes-pde&gt;&lt;default&gt;" AnswerCount="0" CommentCount="9" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32390" PostTypeId="1" AcceptedAnswerId="32397" CreationDate="2017-02-13T15:40:35.193" Score="2" ViewCount="135" Body="&lt;p&gt;What are the transition  distribution (or density) functions of processes defined by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dX_t=\mu dt +\sigma dW_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dX_t= \theta(\mu-X_t) dt +\sigma dW_t,$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\theta&amp;gt;0$,  $\mu$ is a real number, $\sigma&amp;gt;0$, and $W_t$ is a standard Brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know it is a solved problem, but I cannot find a reference that presents the detailed steps of the derivations. Could you please provide some good references? Or, could you please come with the derivations?&lt;/p&gt;&#xA;" OwnerUserId="25437" LastEditorUserId="11678" LastEditDate="2017-02-15T14:02:47.280" LastActivityDate="2017-02-15T14:02:47.280" Title="How to find the transition distribution functions of these two processes?" Tags="&lt;brownian-motion&gt;&lt;reference-request&gt;&lt;vasicek&gt;&lt;transition-distribution&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32392" PostTypeId="1" AcceptedAnswerId="32394" CreationDate="2017-02-13T16:02:20.717" Score="2" ViewCount="106" Body="&lt;p&gt;I'm self-studying for an actuarial exam on financial economics and encountered the below practice exam problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An exam problem should typically take 5-6 minutes to complete, so I'm wondering if there is a &quot;quick&quot; way to confirm that answer choice (D) does not satisfy the Black-Scholes PDE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/cApuY.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/cApuY.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming for the moment that $C(S, t)$ does not pay dividends (which in my opinion cannot be assumed just from the information provided), the PDE implies that $r = 0.04$, $\delta = 0.02$ and $\sigma = 0.3$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I would think that any asset that has these parameters will satisfy the PDE. Let's check:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(A) is the price of a risk-free bond with maturity value 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(B) is the price of a cash-or-nothing call that pays 1 when the stock price is above 100.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(C) is the price of a cash-or-nothing put that pays 1 when the stock is below 100.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(E) is the price of an asset-or-nothing put that pays the stock when the stock price is below 100.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By elimination, that leaves (D) as the claim that does not satisfy the PDE. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what if I wanted to show that (D) cannot satisfy the PDE? I can only think to find $C_s$, $C_{ss}$ and $C_t$. However, this would be messy as $C(S, t)$ would require differentiating $N(d_1)$. Is there an quicker or better way of convincing myself that (D) cannot satisfy the equation?&lt;/p&gt;&#xA;" OwnerUserId="5641" LastEditorUserId="70" LastEditDate="2017-02-13T19:33:32.060" LastActivityDate="2017-02-13T19:33:32.060" Title="Is there a quick way to see why this claim $C(S, t)$ on $S$ does not satisfy the Black-Scholes PDE?" Tags="&lt;finance-mathematics&gt;&lt;self-study&gt;&lt;black-scholes-pde&gt;&lt;exotics&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32394" PostTypeId="2" ParentId="32392" CreationDate="2017-02-13T17:40:05.260" Score="2" Body="&lt;p&gt;You already associated the valuation function ins A, B, C and E with the corresponding products. In order to explicitly exclude D, you don't have to compute all the derivatives but just note that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;C_S &amp;amp; = &amp;amp; e^{-0.02 (T - t)} \mathcal{N}' \left( d_1 \right) \frac{\partial d_1}{\partial S}\\&#xA;C_t &amp;amp; = &amp;amp; 0.02 \underbrace{e^{-0.02 (T - t)} \mathcal{N} \left( d_1 \right)}_{=C(S, t)} + e^{-0.02 (T - t)} \mathcal{N}' \left( d_1 \right) \frac{\partial d_1}{\partial t}.&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the expression for $C_S$ you can infer that the expression for $C_{SS}$ does not contain a $C(S, t)$-term. Thus, you can conclude that the $C(S, t)$-terms in the PDE coming from $C_t$ and the r.h.s. don't cancel each other out and you are done.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2017-02-13T17:40:05.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32395" PostTypeId="2" ParentId="30123" CreationDate="2017-02-13T18:01:53.943" Score="1" Body="&lt;p&gt;On Bloomberg, you can do this through the TRACE reporting system, which requires dealers to publish prices soon after completing a trade. A summary of recent price and volume activity can be accessed via Bloomberg using the TDH (Trade History) command. However, this doesn't list down all instruments but mainly gives you a way to analyse the market trend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition to TDH, Bloomberg also provides, Corporate Bond Analysis &amp;amp; Valuation Function (TACT) function via which you can analyse the bonds, it's pricing, marker data along with other indicators. As you would already know, Bloomberg HELP is always available instantly if you need any further information on these commands.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Last but not the least, the &lt;a href=&quot;http://www.finra.org/marketdata&quot; rel=&quot;nofollow noreferrer&quot;&gt;FINRA MarketData&lt;/a&gt; provides this and other related information on its website, and is quite useful. It also provides a way to search for different asset classes using identifiers (e.g. ticker, etc.). Hth.&lt;/p&gt;&#xA;" OwnerUserId="26555" LastActivityDate="2017-02-13T18:01:53.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32396" PostTypeId="1" AcceptedAnswerId="32406" CreationDate="2017-02-13T19:40:39.670" Score="0" ViewCount="203" Body="&lt;p&gt;I've seen this video which talks about how to compress different indicators into a sin&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=sDu6CudKa0Q&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.youtube.com/watch?v=sDu6CudKa0Q&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to do the same by this way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;data_hist['sma10']  = talib.SMA(data_hist['close'].values, 10)  &#xA;data_hist['difsma'] = data_hist['close'] - data_hist['sma10']  &#xA;data_hist['cci10']  = talib.CCI(data_hist['high'].values, data_hist['low'].values, data_hist['close'].values, 10)  &#xA;data_hist['mom5']   = talib.MOM(data_hist['close'].values, 5)&#xA;&#xA;&#xA;data_hist.dropna(inplace=True)  &#xA;&#xA;cols = ['cci10', 'mom5', 'difsma']  &#xA;data_hist['norm'] = ( data_hist[cols].sum(axis=1) - data_hist[cols].mean(axis=1) ) / data_hist[cols].std(axis=1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But this is an example of output data (it's not between -1 and 1...)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;2013-09-11 00:00:00+00:00   -1.557247&#xA;2013-09-12 00:00:00+00:00   -1.686368&#xA;2013-09-13 00:00:00+00:00   -2.160459&#xA;2013-09-16 00:00:00+00:00   -2.805381&#xA;2013-09-17 00:00:00+00:00   -2.770916&#xA;2013-09-18 00:00:00+00:00   -1.726371&#xA;2013-09-19 00:00:00+00:00   -1.610760&#xA;2013-09-20 00:00:00+00:00   -1.645410&#xA;2013-09-23 00:00:00+00:00    2.143846&#xA;2013-09-24 00:00:00+00:00    1.863802&#xA;2013-09-25 00:00:00+00:00    1.847545&#xA;2013-09-26 00:00:00+00:00    1.956981&#xA;2013-09-27 00:00:00+00:00    2.507031&#xA;2013-09-30 00:00:00+00:00   -0.856816&#xA;2013-10-01 00:00:00+00:00    1.422277&#xA;2013-10-02 00:00:00+00:00    1.604809 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What am I missing out? Any alternative to compress various indicators in a single column?&lt;/p&gt;&#xA;" OwnerUserId="26373" LastEditorUserId="26373" LastEditDate="2017-02-14T07:35:15.440" LastActivityDate="2017-02-14T07:35:15.440" Title="How to normalize various indicators into one column?" Tags="&lt;programming&gt;&lt;machine-learning&gt;&lt;indicator&gt;&lt;normalization&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32397" PostTypeId="2" ParentId="32390" CreationDate="2017-02-13T19:46:33.800" Score="4" Body="&lt;p&gt;We consider the first one, that is, $X_t = X_s + \mu (t-s) + \sigma (W_t-W_s)$, for $t&amp;gt;s$. Then, &#xA;\begin{align*}&#xA;P(X_t \le y \mid X_s) &amp;amp;= P(X_t-\mu(t-s)-X_s \le y-\mu(t-s)-X_s \mid X_s)\\&#xA;&amp;amp;=P(\sigma(W_t-W_s) \le y-\mu(t-s)-X_s\mid X_s)\\&#xA;&amp;amp;=\Phi\left(\frac{y-\mu (t-s) -X_s}{\sigma\sqrt{t-s}}\right).&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;P(X_t \le y \mid X_s=x) &amp;amp;=\Phi\left(\frac{y-\mu (t-s) -x}{\sigma\sqrt{t-s}}\right).&#xA;\end{align*}&#xA;Here, $\Phi$ is the cumulative distribution function of a standard normal random variable.  The transition density function can be obtained subsequently by taking the derivative with respect to $y$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the second one, note that, for $t&amp;gt;s$,&#xA;\begin{align*}&#xA;X_t = e^{-\theta(t-s)}X_s + \mu\left(1-e^{-\theta(t-s)} \right)+\sigma\int_s^te^{-\theta(t-v)}dW_v.&#xA;\end{align*}&#xA;Then, &#xA;\begin{align*}&#xA;&amp;amp;\ P(X_t \le y \mid X_s)\\&#xA;=&amp;amp;\ P\left(X_t-e^{-\theta(t-s)}X_s - \mu\big(1-e^{-\theta(t-s)} \big) \le y-e^{-\theta(t-s)}X_s - \mu\big(1-e^{-\theta(t-s)} \big) \mid X_s\right)\\&#xA;=&amp;amp;\ P\left(\sigma\int_s^te^{-\theta(t-v)}dW_v \le y-e^{-\theta(t-s)}X_s - \mu\big(1-e^{-\theta(t-s)} \big) \mid X_s\right)\\&#xA;=&amp;amp;\ \Phi\left(\frac{y-e^{-\theta(t-s)}X_s - \mu\big(1-e^{-\theta(t-s)} \big)}{\sigma\sqrt{\frac{1}{2\theta}\big(1-e^{-2\theta(t-s)} \big)}} \right).&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;P(X_t \le y \mid X_s=x) &amp;amp;=\Phi\left(\frac{y-e^{-\theta(t-s)}x - \mu\big(1-e^{-\theta(t-s)} \big)}{\sigma\sqrt{\frac{1}{2\theta}\big(1-e^{-2\theta(t-s)} \big)}} \right).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-02-14T13:53:12.833" LastActivityDate="2017-02-14T13:53:12.833" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32398" PostTypeId="2" ParentId="32372" CreationDate="2017-02-13T20:13:44.837" Score="0" Body="&lt;p&gt;Per &lt;a href=&quot;http://www.webstersystems.co.uk/fxmm.htm#forward%20fx&quot; rel=&quot;nofollow noreferrer&quot;&gt;my FX / MM training&lt;/a&gt; the relationship between FX and rates is built into the forward when the price is agreed. Your PRDC uses whatever the 10 year interest rates are for BRL and JPY on trade date. There isn't any other &quot;correlation&quot; because once the forward price is set then the cash flows are set for value date, with some percentage collateral upfront (like a premium). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not directly familiar with PRDC but it sounds like if the investor is long the BRL/JPY then in 10 years time he will be giving X JPY to take Y BRL. If he is short, then he'll be taking X JPY for giving Y BRL. The risk today is how much do the future cash flows cost compared to structuring the PRDC as a set of money market deposits / loans in BRL / JPY over 10 years? That will presumably involve variable underlying interest rates on both currencies, and then the FX risk is the final spot deal to get the PnL currency in 10 years time. Whereas the forward locks in all those variables today! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same data has to underwrite a decision whether to &quot;call back&quot; the deal. It would be about the rates available in depos / loans on the 2 currencies, and the interest rate differentials, and then the FX spot rate for maturity. I would say the trader doesn't call back anything but resells it if various PnL risks are breached on his side, or if the client doesn't post margin.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2017-02-13T20:13:44.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32400" PostTypeId="2" ParentId="32381" CreationDate="2017-02-13T23:12:07.170" Score="3" Body="&lt;p&gt;Cheap, accurate, fast: choose two.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IQFeed is the cheapest broker-neutral feed that I know of for this and they have reasonable accuracy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise, brokers often package in a data feed for free.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;QuantHouse's feed etc. are about 2 orders of magnitude more expensive.&lt;/p&gt;&#xA;" OwnerUserId="4614" LastActivityDate="2017-02-13T23:12:07.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32402" PostTypeId="1" CreationDate="2017-02-13T23:55:32.327" Score="2" ViewCount="330" Body="&lt;p&gt;In terms of books on predictive models, I find ESL (elements of statistical learning) trying to cover too much and serves more like a reference, instead of explaining and developing the theories for successful research. Or they just assume a background which I don't have yet. So I am looking for a more theoretical and well-explained book in predictive modeling (hopefully with application in finance as well). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please recommend good books that develop one's skill in predictive modeling (hopefully for alpha signal research).  There might be few, but please recommend your favorites and provide some comments as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. how is this book: &quot;Applied Predictive Modeling&quot; by Max Kuhn?&lt;/p&gt;&#xA;" OwnerUserId="24835" LastEditorUserId="24835" LastEditDate="2017-02-14T05:00:22.090" LastActivityDate="2017-02-14T05:00:22.090" Title="Good books on predictive modeling (for alpha signal research)" Tags="&lt;modeling&gt;&lt;machine-learning&gt;&lt;prediction&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32403" PostTypeId="2" ParentId="4738" CreationDate="2017-02-14T03:55:54.587" Score="4" Body="&lt;p&gt;You may find my recent paper helpful. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://doi.org/10.1002/fut.21909&quot; rel=&quot;nofollow noreferrer&quot;&gt;Choi (2018)&lt;/a&gt; Sum of All Black-Scholes-Merton Models: An Efficient Pricing Method for Spread, Basket, and Asian Options (&lt;a href=&quot;http://arxiv.org/abs/1805.03172&quot; rel=&quot;nofollow noreferrer&quot;&gt;arxiv&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The method can handle the options on any linear combination of assets such as spread, basket and Asian options. You can obtain fairly accurate deterministic (i.e., not Monte Carlo) values with very light computation. &lt;/p&gt;&#xA;" OwnerUserId="26559" LastEditorUserId="26559" LastEditDate="2018-08-03T07:21:03.240" LastActivityDate="2018-08-03T07:21:03.240" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="32404" PostTypeId="1" CreationDate="2017-02-14T04:48:14.007" Score="2" ViewCount="190" Body="&lt;p&gt;I am interested in Relative Value Trading of American style options on futures and have not found a whole lot of literature on it. The best resource I have discovered so far is a few pages in Colin Bennett's Trading Volatility, which is about equities.  He mentions 3 methods: Theta Weighted, Vega-weighted, and dollar gamma-weighted. However no workable examples. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For 2 American options of the same expiry, but different underlying futures contracts which may be in different currencies. How would you go about determining the hedging ratio between the two legs of a spread?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example: If A has higher implied vol then B on a similar underlying (a commodity future in different currencies), I would like to short A's Volatility and Long B's Volatility. Lets assume we are using ATM straddles. For every 1 contract of A I want to be short, i should buy X contracts of B. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is X? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I have any worked examples of the Theta/Vega/Dollar Gamma type weightings? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Point me to any papers or other resources regarding this topic. Everything is appreciated. Thank you&lt;/p&gt;&#xA;" OwnerUserId="24873" LastActivityDate="2017-02-14T04:48:14.007" Title="Relative Value Trading of American Style Options on Futures, Calcuating hedging ratios?" Tags="&lt;volatility&gt;&lt;hedging&gt;&lt;greeks&gt;&lt;american-options&gt;&lt;pairs-trading&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32406" PostTypeId="2" ParentId="32396" CreationDate="2017-02-14T06:46:15.333" Score="1" Body="&lt;p&gt;Normalized data are not supposed to be in $[-1,1]$, but they're supposed to be &quot;centered&quot; around 0 (because you subtract the mean of the sample) and with values spread from 0 in a way which makes it comparable between different variable size (because you divide by the standard deviation of the sample).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A quick example is let's say you compare two random sample $X$ and $Y=7 \cdot X$. It could be somewhat &quot;difficult&quot; to see that the points in $X$ and $Y$ are in fact distributed in a same way but for a scaling factor, just by looking at the values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the normalized data will show that they're actually exactly the same:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X_\text{normalized} = \frac{X-\mu_X}{\sigma_X}$$&#xA;$$\begin{align}&#xA;Y_\text{normalized} &amp;amp;= \frac{Y-\mu_Y}{\sigma_Y} \\&#xA;&amp;amp;= \frac{7X-7\mu_X}{7\sigma_X} \\&#xA;&amp;amp;= \frac{X-\mu_X}{\sigma_X}  \\&#xA;&amp;amp; = X_\text{normalized}&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This, however, does not imply it will be contained between -1 and 1.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2017-02-14T06:46:15.333" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32407" PostTypeId="1" AcceptedAnswerId="32424" CreationDate="2017-02-14T09:43:31.840" Score="0" ViewCount="484" Body="&lt;p&gt;I use &lt;code&gt;backtrader&lt;/code&gt; &lt;code&gt;python&lt;/code&gt; framework to backtest &lt;code&gt;ML&lt;/code&gt; classification algorithms to make decision to buy or to sell.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I use &lt;code&gt;RandomForest&lt;/code&gt; or other algorithms in &lt;code&gt;scikit-learn&lt;/code&gt; packages it gives up to 55% of profit:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/pAOrU.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/pAOrU.png&quot; alt=&quot;PROFIT&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The next run of absolutely &lt;strong&gt;the same code and data&lt;/strong&gt; (just next run) gives 22% of loss:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/iSffW.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/iSffW.png&quot; alt=&quot;LOSS&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is that? And what are the methods to avoid such a big range of results? Less, but more stable profit is better :)&lt;/p&gt;&#xA;" OwnerUserId="26272" LastEditorUserId="70" LastEditDate="2017-02-14T11:39:17.487" LastActivityDate="2017-02-14T22:29:32.690" Title="ML classification algorithms give random profit" Tags="&lt;backtesting&gt;&lt;python&gt;&lt;machine-learning&gt;" AnswerCount="1" CommentCount="2" ClosedDate="2017-02-16T13:22:11.527" ContentLicense="CC BY-SA 3.0" />
  <row Id="32408" PostTypeId="1" CreationDate="2017-02-14T10:29:08.427" Score="-1" ViewCount="143" Body="&lt;p&gt;Say, an investment bank want to hedge its Long Gamma position on its Long Call option by placing limit orders in the exchange.&#xA;Limit orders result in increasing volume depth.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Empirically, what is the effect to stock volatility?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does the increasing depth make it harder for stock to move up or down?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does the increasing depth attract other market participants to trade stocks and improve price discovery?&lt;/p&gt;&#xA;" OwnerUserId="13991" LastEditorUserId="13991" LastEditDate="2017-02-15T02:35:53.633" LastActivityDate="2017-02-16T01:48:46.617" Title="What is the effect of increasing volume depth to stock volatility?" Tags="&lt;delta-hedging&gt;&lt;liquidity-risk&gt;" AnswerCount="4" CommentCount="0" ClosedDate="2017-02-21T06:23:12.497" ContentLicense="CC BY-SA 3.0" />
  <row Id="32413" PostTypeId="1" CreationDate="2017-02-14T13:29:22.490" Score="2" ViewCount="104" Body="&lt;p&gt;Say I have a portfolio, $X_t$, using a leverage of $f$, such that the dynamics are given by&#xA;\begin{equation}&#xA;dX_t = \mu f X_t dt + \sigma f X_t dW_t&#xA;\end{equation}&#xA;I want to optimize the expected utility after some time $T$, $E[U(V_T)]$, and find the optimal leverage $f$. With the utility function $U(x)=\frac{x^\gamma}{\gamma}$ this is fairly easy. The SDE can be solved and the expected utility is maximized with $f^* = \frac{\mu}{\sigma^2 (1-\gamma)}$. With $\gamma=0$ and log-utility this is just the Kelly criterion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what if I also have to pay a constant cost $C$ such that the dynamics are&#xA;\begin{equation}&#xA;dX_t = (\mu f X_t - C) dt + \sigma f X_t dW_t, \quad X_t &amp;gt; 0&#xA;\end{equation}&#xA;and $dX_t = 0$ when $X_t=0$ (i.e., I go bankrupt). The utility function would need to be altered to account for the non-zero probability of bankruptcy, so $U(x)=\frac{(x + b)^\gamma}{\gamma}$ with some $b&amp;gt;0$ so that the utility is bounded at bankruptcy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way I can formulate the problem such that I can get an expression for the optimal $f^*$ that maximizes the expected utility $E[U(V_T)]$ when costs are included?&lt;/p&gt;&#xA;" OwnerUserId="24306" LastEditorUserId="24306" LastEditDate="2017-02-15T14:37:40.323" LastActivityDate="2017-02-16T14:15:30.773" Title="Utility-optimal leverage with costs" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;utility-theory&gt;&lt;kelly-criterion&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32415" PostTypeId="1" AcceptedAnswerId="32418" CreationDate="2017-02-14T16:02:20.600" Score="-1" ViewCount="129" Body="&lt;p&gt;I am new to finance math and I would like to know if my approach to this problem is correct&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the following three European call options, all with expiration at time $T$ = 1: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Option $A$ has strike option ($K$) of $10 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Option $B$ has strike $15 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Option $C$ has strike $20. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Create a bull spread from options A and B.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My understanding is that the spread for this would be buying A, because it is a lower K and selling B because it has a higher K.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a better way to answer this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, how would it work for 3 options, such as A, B,C?&lt;/p&gt;&#xA;" OwnerUserId="26350" LastActivityDate="2017-02-14T17:03:29.573" Title="Bull spread problem" Tags="&lt;spread-options&gt;" AnswerCount="2" CommentCount="0" ClosedDate="2017-02-19T21:23:41.747" ContentLicense="CC BY-SA 3.0" />
  <row Id="32417" PostTypeId="2" ParentId="32415" CreationDate="2017-02-14T16:42:19.927" Score="0" Body="&lt;p&gt;I would suggest going through &lt;a href=&quot;http://www.theoptionsguide.com/bull-call-spread.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bull Spread Explained&lt;/a&gt; to understand the bull spread better. Theoretically, your understanding is correct when you say that the spread would be buy A and sell B based on the strike price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.fidelity.com/viewpoints/bull-call-spread&quot; rel=&quot;nofollow noreferrer&quot;&gt;This&lt;/a&gt; is also a good reference which help you understand the concept nicely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case of 3 instruments, I would think of doing either a buy-sell-buy or a sell-buy-sell strategy, which is typically how 3 legged instruments are traded.&lt;/p&gt;&#xA;" OwnerUserId="26555" LastActivityDate="2017-02-14T16:42:19.927" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32418" PostTypeId="2" ParentId="32415" CreationDate="2017-02-14T17:03:29.573" Score="0" Body="&lt;p&gt;Yes, one way to think of it is to equate the traditional concept of &quot;bullishness&quot; to the modern BSM concept of &quot;delta&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You buy the call at A, so you are &quot;bullish&quot; (positive Delta), now you sell the call at B. The Call at B is less &quot;bullish&quot; than A (smaller Delta) so when you sell it you &quot;lower your bullishness, but stay overall bullish&quot; (reduce Delta by subtracting a smaller number, so the overall Delta stays positive).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The opposite, sell A and buy B, would by definition be called a &quot;bear spread&quot; (negative overall Delta).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This way of thinking also generalizes to 3 options.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2017-02-14T17:03:29.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32420" PostTypeId="1" AcceptedAnswerId="32440" CreationDate="2017-02-14T20:50:16.607" Score="3" ViewCount="611" Body="&lt;p&gt;There are some von-Neumann utility functions that I come across quite often in different articles / books like: $ U(x)=\ln(x)$, $U(x)= \frac {1}{\gamma}x^\gamma$ with $\gamma &amp;lt;1$ and $U(x)=\frac {1-\gamma}{\gamma}(\frac{\alpha x}{1-\gamma} +\beta)^{\gamma}$ subject to the restrictions $\gamma \neq 1, \frac{\alpha x}{1-\gamma} +\beta &amp;gt;0$, and $\beta=1$ if $\gamma=-\infty$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: Why are those functions used that often? It's not like they are the only &quot;simple&quot; concave and increasing functions out there?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I guess there must be some specific properties that make them interesting?&lt;/p&gt;&#xA;" OwnerUserId="26218" LastEditorUserId="24222" LastEditDate="2017-02-15T00:24:46.157" LastActivityDate="2017-02-15T12:56:14.167" Title="Why are some utility functions widely used?" Tags="&lt;finance-mathematics&gt;&lt;utility-theory&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32422" PostTypeId="2" ParentId="32420" CreationDate="2017-02-14T21:33:58.263" Score="2" Body="&lt;p&gt;The functions are set up so that maximizing the expectation of the utility function will obey the von Neumann-Morgenstern axioms (completeness, transitivity, independence, continuity). As you've pointed out, convexity is also a desired behavior and certainly you can come up with other functions.&lt;/p&gt;&#xA;" OwnerUserId="4614" LastActivityDate="2017-02-14T21:33:58.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32424" PostTypeId="2" ParentId="32407" CreationDate="2017-02-14T22:29:32.690" Score="3" Body="&lt;p&gt;Set the random_state = 0 as a parameter in the model and retry this.&lt;/p&gt;&#xA;" OwnerUserId="26573" LastActivityDate="2017-02-14T22:29:32.690" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32425" PostTypeId="2" ParentId="32408" CreationDate="2017-02-14T22:41:26.160" Score="1" Body="&lt;p&gt;limit orders (buy orders below the market, sell orders above the market) obviously reduce volatility all other things constant, by acting as a kind of partially absorbing barrier against incoming trades (i.e. makes it harder for noise traders to move the price up or down).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the second question liquidity is to some extent self-reinforcing, more depth means lower transactions costs, which attract more traders, which further increases depth and liquidity and at least in theory leads to better price discovery (now we are taking about the information traders).&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-02-15T13:01:48.453" LastActivityDate="2017-02-15T13:01:48.453" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32426" PostTypeId="1" AcceptedAnswerId="32430" CreationDate="2017-02-14T22:43:36.930" Score="1" ViewCount="1324" Body="&lt;p&gt;Is there a more cost-effective alternative to Bloomberg Excel Add-In? 90% of the time I only use Bloomberg to download security (hundreds of U.S. and international stocks) historical price data. The formula I use is &lt;code&gt;=BDH(security, field,start date [mm/dd/yyyy], end date [mm/dd/yyyy], optional arguments)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did some research online and found a few platforms like Factset. They provide analytical solutions which are more than what I needed. I am simply looking for alternative Excel Add-Ins to Bloomberg's or R packages that can download historical price data. Thanks a lot!&lt;/p&gt;&#xA;" OwnerUserId="26571" LastEditorUserId="16160" LastEditDate="2017-02-15T00:31:32.197" LastActivityDate="2021-04-19T13:08:58.103" Title="Alternative to Bloomberg Excel Add-In for EOD Stock Prices" Tags="&lt;data&gt;&lt;market-data&gt;&lt;historical-data&gt;&lt;bloomberg&gt;" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32427" PostTypeId="2" ParentId="4738" CreationDate="2017-02-15T02:04:47.383" Score="3" Body="&lt;p&gt;To add (and contradict a bit) to what Brian B said. The exo desks that have multiple positions in basket options frequently price and manage these positions using the moment matching models (for efficiency reasons). For baskets with a lot of stocks, most desks would use a single vol, usually using a proxy like a liquid index with a spread or a multiplier. &lt;/p&gt;&#xA;" OwnerUserId="26574" LastActivityDate="2017-02-15T02:04:47.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32428" PostTypeId="2" ParentId="32426" CreationDate="2017-02-15T02:28:43.940" Score="2" Body="&lt;p&gt;I also heavily rely on Bloomberg for price data at work.  For single stock price history I leveraged &lt;strong&gt;Yahoo Finance&lt;/strong&gt; in the past.  The quantmod() R package has some functions that can pull Yahoo Finance equity quotes.  I'm sure there are others, too.  I would try that route first.&lt;/p&gt;&#xA;" OwnerUserId="26575" LastActivityDate="2017-02-15T02:28:43.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32429" PostTypeId="1" CreationDate="2017-02-15T03:10:21.390" Score="1" ViewCount="67" Body="&lt;p&gt;Using this query&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(&quot;SDV.L&quot;)&amp;amp;format=xml&amp;amp;env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can get the basic price today of SDV* (and high. low, volume, last close price, etc.) in XML, JSON, etc..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know a currently working way of retrieved this data in XML, JSON, a webservice etc. from Yahoo or elsewhere (for free, or with a free, ideally, or on a long, trial - the free data can be wrong or corrupted, or absent in places until I pay).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am aware of&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/16949/historical-daily-nav-for-closed-end-funds&quot;&gt;Historical Daily NAV for Closed End Funds&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and I tried replacing SDV.L with XSDVX.L or XSDV.LX above but both returned empty XML, accept for the quote symbol?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Chelverton Small Companies Dividend Trust PLC on the UK LSE &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="26495" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2017-02-16T00:34:51.390" Title="Historical Daily/Monthly NAV for Closed End Funds - known duplicate but unanswered previously" Tags="&lt;equities&gt;&lt;time-series&gt;&lt;programming&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32430" PostTypeId="2" ParentId="32426" CreationDate="2017-02-15T05:24:32.320" Score="3" Body="&lt;p&gt;Quandl - you can use Excel, R python addin/code to pull data&lt;/p&gt;&#xA;" OwnerUserId="15428" LastActivityDate="2017-02-15T05:24:32.320" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32434" PostTypeId="1" AcceptedAnswerId="32448" CreationDate="2017-02-15T10:52:36.970" Score="3" ViewCount="1133" Body="&lt;p&gt;Think of Sharpe ratio, Treynor ratio, or anything where (excess) returns $r$ are divided by something that represents risk, $\sigma$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathrm{performance} = \frac{r}{\sigma}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the returns are negative (let's say for a short period), a performance indicator based on such a ratio is better (=less negative), the higher the risk (e.g. volatility) is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First question: Does this make sense? I would not say the true performance is better (less poor), if the risk increases – even when the returns are negative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second question: Are there established (or even proposed) risk-adjusted return measures that penalize (or at least don't reward) high risk even for negative returns? I'd be quite happy to derive one, but I would expect that someone has already figured this out.&lt;/p&gt;&#xA;" OwnerUserId="26580" LastActivityDate="2017-09-07T10:37:26.777" Title="Risk-adjusted returns ratio that does not reward high risk for negative returns" Tags="&lt;returns&gt;&lt;risk-neutral-measure&gt;&lt;performance-evaluation&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32435" PostTypeId="2" ParentId="32413" CreationDate="2017-02-15T11:00:02.877" Score="1" Body="&lt;p&gt;I hope my computations are correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $u(t,x)=\max_{(f_s)_{s\geq t}}\mathbb{E}[(b+X^{f_.}_T)^\gamma]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using HJB &lt;strong&gt;(you have to prove that it is ok to use it).&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$0=\max_{f}\partial_t u(t,x)+(\mu f x - C)\partial_x u(t,x)+\frac{\sigma^2}{2}f^2x^2\partial_{xx}u(t,x)$$&#xA;Since $\partial_{xx}u(t,x)&amp;lt;0$ &lt;strong&gt;(prove it)&lt;/strong&gt;, maximum is hit at $f=\frac{\mu x \partial_xu(t,x)}{\sigma^2 x^2\partial_{xx}u(t,x)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$0=\partial_t u(t,x)- C\partial_x u(t,x)-\frac{\mu^2}{2\sigma^2}\frac{(\partial_x u(t,x))^2}{\partial_{xx}u(t,x)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We postulate $u(t,x)=f(t)(b+x)^{\gamma(t)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;one has :&#xA;$$ 0 = f'(t)(b+x)^{\gamma(t)}+\gamma'(t)(b+x)^{\gamma(t)-1} - C \gamma(t) (b+x)^{\gamma(t)-1}-\frac{\mu^2}{2\sigma^2}\frac{(b+x)^{\gamma(t) } }{\gamma(t)-1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And finally we have :&#xA;$$0=\gamma'(t) - C \gamma(t)\text{ and }\gamma(T)=\gamma$$ and $$f'(t)= \frac{\mu^2}{2\sigma^2(\gamma(t)-1)}\text{ and }f(T)=1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which leads to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$u(t,x)= (b+x)^{\gamma e^{-C(T-t)}}\left(1-\int_{t}^T\frac{\mu^2}{2\sigma^2(\gamma e^{-C(T-s)}-1)}ds\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Post in comments, if you see computation mistakes.&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="20201" LastEditorUserId="20201" LastEditDate="2017-02-16T14:15:30.773" LastActivityDate="2017-02-16T14:15:30.773" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32436" PostTypeId="2" ParentId="32408" CreationDate="2017-02-15T11:15:48.243" Score="1" Body="&lt;p&gt;Consider this: If there is infinite volume available at both bid and ask, then the price of the asset will never move irrespective of the size of the incoming market order, the mid will always be the same. 0 volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are traders who use quantity available at a price as a resistance and support and trade accordingly.&lt;/p&gt;&#xA;" OwnerUserId="15428" LastActivityDate="2017-02-15T11:15:48.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32437" PostTypeId="1" AcceptedAnswerId="32438" CreationDate="2017-02-15T11:20:25.673" Score="2" ViewCount="324" Body="&lt;p&gt;I was thinking, what would happen if I wrote a script constantly spamming small quantity 1 dollar or maybe 0.1 dollar bids on less liquid stocks (not penny stocks) just hoping to see a situation where someone sells me on the market price?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am also curious if dark pool/broker (would make sense for broker to fill orders way below market level if they are allowed to do so) level actually do something like this before order ever hitting to exchanges, as I am sure some people trading manually (they still exist) make keying errors, yet I never seen any bids or asks absurdly out of normal spread. Or is it that they are cleaned from market data by data providers?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not going to do this in real life as I would expect some issues with my broker. Plus this doesn't seem really morally sound strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What got me thinking about this was reading a story about Japanise day trader called CIS and his massive win on J-Com stocks caused by a typing error. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Link to the story &gt; &lt;a href=&quot;https://www.bloomberg.com/news/articles/2014-09-25/mystery-man-moving-japan-made-more-than-1-million-trades&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.bloomberg.com/news/articles/2014-09-25/mystery-man-moving-japan-made-more-than-1-million-trades&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;CIS’s first big score came on Dec. 8, 2005, when someone at Mizuho Securities Co. made a costly typing mistake. Rather than selling a single share of a small recruiting company called J-Com Co. for 610,000 yen, Mizuho offered 610,000 shares for 1 yen each. The order was for 42 times the number of outstanding shares. CIS saw it had to be an error and was among a small number of day traders and institutional investors who pounced. CIS says he bought 3,300 shares, about a quarter of the actual total, at the limit-low price.&#xA;By the time everything was sorted out, Mizuho’s quarterly profit was gone and CIS was, as he tells it, 600 million yen richer. (Another day trader, Takashi Kotegawa, who’s known as BNF, made more than 2 billion yen, according to a Bloomberg News report at the time. Efforts to reach Kotegawa were unsuccessful, and it isn’t clear whether he still trades.)&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="26443" LastEditorUserId="26443" LastEditDate="2017-02-15T11:28:15.393" LastActivityDate="2017-02-15T11:29:10.023" Title="What happens when someone makes absurdly high or low bid or ask on a stock?" Tags="&lt;equities&gt;&lt;market-making&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32438" PostTypeId="2" ParentId="32437" CreationDate="2017-02-15T11:29:10.023" Score="2" Body="&lt;p&gt;Depends on the exchange and the regulator I think. In India we have something of a limit defined for normal trading. If the stock closed at x, then unless the exchange changes the numbers explicitly, the stock can only trade in 0.9*x to 1.1 *x. if the market moves, the exchange dynamically changes these numbers. It rejects orders beyond this price range. There are workaround to these things as well.&lt;/p&gt;&#xA;" OwnerUserId="15428" LastActivityDate="2017-02-15T11:29:10.023" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32439" PostTypeId="1" CreationDate="2017-02-15T11:39:46.717" Score="0" ViewCount="33" Body="&lt;p&gt;I use &lt;code&gt;python DataReader&lt;/code&gt; for getting past stock data.&lt;/p&gt;&#xA;&lt;p&gt;I heard that &lt;code&gt;Adj Close&lt;/code&gt; data could be different each other if data range is different between datas. This is because (as I know of) &lt;code&gt;Close&lt;/code&gt; data is adjusted based on the LAST DATE of period.&lt;/p&gt;&#xA;&lt;p&gt;For example,&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;APPL1_data : 2010-01-01 ~ 2016-01-01 adj close data&lt;/p&gt;&#xA;&lt;p&gt;APPL2_data : 2014-01-01 ~ 2016-01-01 adj close data&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;But as I compare these datas by myself, both have same &lt;code&gt;Adj close&lt;/code&gt; datas even though ex-dividend, stock split have happend during this period.&lt;/p&gt;&#xA;&lt;p&gt;Did I miss something?&lt;/p&gt;&#xA;" OwnerUserId="26582" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2017-02-15T11:39:46.717" Title="&quot;Adj Close&quot; data could be different in different data range?" Tags="&lt;market-data&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32440" PostTypeId="2" ParentId="32420" CreationDate="2017-02-15T12:56:14.167" Score="5" Body="&lt;p&gt;These are a natural and easiest (most tractable mathematically) choice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A utility function is defined up to a positive affine transformation: economically there is no difference between the utility functions $U(x)$ and $\tilde{U}(x)=Au(x)+B$. Hence, a measure of risk aversion that remains constant w.r.t. affine transformations would be useful. How does one construct such a measure? Well, the easiest way is to consider the expression&#xA;$$A(x)= -\frac{U''(x)}{U'(x)}$$&#xA;a.k.a. ARA (Arrow–Pratt measure of &lt;em&gt;absolute risk aversion&lt;/em&gt;). ARA stays the same under affine transformations and measures the degree of risk aversion - the curvature of the utility function. The reciprocal of ARA measures the level of risk tolerance, and a simple special case is when it is a linear function of wealth:&#xA;$$T(x)=\frac{1}{A(x)}=\frac{x}{1-\gamma}+\frac{b}{a}.$$&#xA;Now, what are the utility functions such that the corresponding level of risk tolerance is linear?  These are solutions to the ODE&#xA;$$-\frac{U'(x)}{U''(x)}=\frac{x}{1-\gamma}+\frac{b}{a}$$&#xA;which is known to be solvable in closed form. The unique solution (up to affine transformation!) to the equation has the form &#xA;$$\qquad U(x)=\frac{1-\gamma}{\gamma}\left(\frac{ax}{1-\gamma}+b \right)^\gamma.\qquad(1)$$&#xA;There are other solutions which differ from (1) by additive and/or multiplicative constants but these do not affect the behavior implied by the utility function. (1) is known as the hyperbolic absolute risk aversion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other utility functions that you've mentioned are just specifications of (1). In particular, assuming $b=0$ one gets the &lt;a href=&quot;https://en.wikipedia.org/wiki/Isoelastic_utility&quot; rel=&quot;noreferrer&quot;&gt;isoelastic utility&lt;/a&gt;:&#xA;$$\quad\qquad U(x) = \begin{cases}\frac{x^\gamma-1}{\gamma},\quad \gamma\neq 0 \\ \ln(x), \quad \gamma =0 \end{cases}\qquad\quad (2)$$&#xA;(2) is also the only example of utility functions with the constant &lt;em&gt;relative risk aversion&lt;/em&gt;&#xA;$$R(x)=xA(x)=1-\gamma.$$&lt;/p&gt;&#xA;" OwnerUserId="70" LastActivityDate="2017-02-15T12:56:14.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32441" PostTypeId="1" AcceptedAnswerId="32443" CreationDate="2017-02-15T13:46:57.580" Score="2" ViewCount="98" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;This question was asked by another user, but was deleted. As it may be useful for others, I re-post it here.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What are the transition distribution (or density) functions of two processes defined by&#xA;\begin{align*}&#xA;dX_t = \mu dt + \sigma dW_t&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;dX_t = \theta(\mu-X_t) dt + \sigma dW_t,&#xA;\end{align*}&#xA;where $\theta&amp;gt;0$, $\mu$ is a real number, $\sigma &amp;gt;0$, and $\{W_t,\, t \ge 0\}$ is a standard Brownian motion.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-02-15T14:06:37.397" LastActivityDate="2017-02-15T14:52:45.263" Title="How to find the transition distribution functions of these two processes?" Tags="&lt;brownian-motion&gt;&lt;vasicek&gt;&lt;transition-distribution&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32442" PostTypeId="2" ParentId="32408" CreationDate="2017-02-15T14:41:51.470" Score="3" Body="&lt;p&gt;Answers to your 3 questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Empirically, there is no effect.  I understand that this is not logical but it is reality.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Adding thickness to an order book does not necessarily make it harder or easier for a stock to move.  If your order is static it will be recognized quite quickly and used by other participants for liquidity.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It will attract participants but not necessarily to improve price discovery.  It may attract predatory traders as well that could increase short term volatility.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Regarding the first sentence of your post...if you are concerned about the long gamma exposure of a long call option you must be holding an option that is very close to expiry and very close to being at-the-money.  There are far more effective ways to hedge/mitigate that risk rather then trying to stack an order book at an expiration to make a stock appear stable.  &lt;/p&gt;&#xA;" OwnerUserId="26556" LastActivityDate="2017-02-15T14:41:51.470" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32443" PostTypeId="2" ParentId="32441" CreationDate="2017-02-15T14:47:14.007" Score="2" Body="&lt;p&gt;Here is a derivation for the Ornstein-Uhlenbeck process. Solution to the SDE&#xA;$$dX_t = \theta(\mu-X_t) dt + \sigma dW_t$$&#xA;subject to the initial condition $X_0=x$ has the form&#xA;$$X_t= \mu + (x - \mu)e^{-\theta t} + \sigma\int_0^t e^{-\theta (t-s)}dW_s.\qquad$$&#xA;We need to calculate density function $p(t,x,y)$ of the conditional distribution $(X_t|X_0=x)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_t$ is normally distributed for each $t&amp;gt;0$. The conditional expectation is&#xA;$$E[X_t|X_0=x]=\mu + (x - \mu)e^{-\theta t}.$$&#xA;The conditional variance is &#xA;$$Var[X_t|X_0=x] = \sigma^2E\left[(\int_0^t e^{-\theta (t-s)}dW_s)^2 \right] = \sigma^2 E\left[\int_0^t e^{-2\theta (t-s)}ds \right]$$&#xA;$$=\frac{\sigma^2}{2\theta}(1-e^{-2\theta t}).$$&#xA;Hence, we have that&#xA;$$(X_t|X_0=x)\sim N\left(\mu + (x - \mu)e^{-\theta t},\frac{\sigma^2}{2\theta}(1-e^{-2\theta t})\right),$$&#xA;and, finally,&#xA;$$p(t,x,y)=\frac{1}{\sqrt{\pi\sigma^2(1-e^{-2\theta t})/\theta}}\exp&#xA;\left[-\frac{(-y-\mu-(x - \mu)e^{-\theta t})^2}{\sigma^2(1-e^{-2\theta t})/\theta}\right].$$&lt;/p&gt;&#xA;" OwnerUserId="70" LastEditorUserId="70" LastEditDate="2017-02-15T14:52:45.263" LastActivityDate="2017-02-15T14:52:45.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32444" PostTypeId="1" CreationDate="2017-02-15T14:53:25.440" Score="0" ViewCount="4985" Body="&lt;p&gt;How can I estimate a private company's market cap? What records do I need to consider and how would I go about it? &lt;/p&gt;&#xA;" OwnerUserId="26585" LastEditorUserId="70" LastEditDate="2017-02-15T15:05:43.203" LastActivityDate="2017-02-15T15:59:39.963" Title="How do I value a private company's market cap?" Tags="&lt;market-data&gt;&lt;market-capitalization&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32445" PostTypeId="1" AcceptedAnswerId="32447" CreationDate="2017-02-15T15:54:22.420" Score="1" ViewCount="195" Body="&lt;p&gt;I believe that at 45B$ Tesla is massively overpriced.&#xA;The thing is that I don't know how long it will take it to trade on fundamentals, maybe a couple of years after launching model 3.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I want to short it, but not to suffer from the excessive cost of holding a short position for many years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What do you suggest is a good way to implement such a short?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="3514" LastActivityDate="2017-02-15T16:11:46.857" Title="Efficient way to short Tesla" Tags="&lt;equities&gt;&lt;fundamentals&gt;&lt;short-selling&gt;&lt;implementation-shortfall&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32446" PostTypeId="2" ParentId="32444" CreationDate="2017-02-15T15:59:39.963" Score="3" Body="&lt;p&gt;Market cap is just the stock price times outstanding shares. The number of outstanding shares is decided by the issuer so the remaining question is how do you value a private company's stock price. There's 3 general classes of methods:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Book-based (e.g. discounted cash flow, multiple of LTM revenue)&lt;/li&gt;&#xA;&lt;li&gt;Relative comps &lt;/li&gt;&#xA;&lt;li&gt;Private market demand&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The first approach is not very different from how public companies are valued by analysts. However, this becomes a problem for early stage companies that may be cash flow negative or pre-revenue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's where relative valuation come in. This is where the company's market cap is valued based on other companies that are similar to it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Relative comps provide very noisy estimates, so investors in private companies also price the companies based on what other investors have been willing to buy and sell the stock at.&lt;/p&gt;&#xA;" OwnerUserId="4614" LastActivityDate="2017-02-15T15:59:39.963" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32447" PostTypeId="2" ParentId="32445" CreationDate="2017-02-15T16:11:46.857" Score="2" Body="&lt;p&gt;As LocalVolatility pointed out, the cost should be priced into the derivatives as well so you cannot do better than that unless you have an execution alpha, &lt;em&gt;provided you want the exposure of a naked short&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can offset some of the cost of your short position with option premium, e.g. a vertical spread where you buy 1 or more puts at higher strike price(s) and offset their costs by selling put(s) at lower strike price(s). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if you just want to take a short position but don't necessarily want the complete upside of a naked short, you can construct a position that gives up something of equivalent value, e.g. capping your upside in exchange for lower cost.&lt;/p&gt;&#xA;" OwnerUserId="4614" LastActivityDate="2017-02-15T16:11:46.857" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32448" PostTypeId="2" ParentId="32434" CreationDate="2017-02-15T17:49:40.437" Score="6" Body="&lt;p&gt;Yes, you are correct on both terms - it doesn't make much sense, and there exists a well-cited solution by C. Israelsen: &quot;A refinement to the Sharpe ratio and information ratio.&quot; Journal of Asset Management 5.6 (2005): 423-427.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The adjustment he gives is to define $$SR_{adj} = \frac{r}{\sigma^{\frac{r}{abs(r)}}},$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which solves the ranking problem during periods of negative (excess) return. &lt;/p&gt;&#xA;" OwnerUserId="13808" LastEditorUserId="13808" LastEditDate="2017-02-15T18:00:56.310" LastActivityDate="2017-02-15T18:00:56.310" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32449" PostTypeId="2" ParentId="32434" CreationDate="2017-02-15T19:17:24.980" Score="1" Body="&lt;p&gt;1) In a certain, theoretical sense, it does make sense: suppose two&#xA;   portfolio managers delivered negative returns (-1%, say), and one&#xA;   had a higher volatility (&quot;risk&quot;) than the other. Then the high-risk fund did better,&#xA;   in a way: despite higher risk, the portfolio manager succeeded in&#xA;   providing the same small loss as the low-risk manager.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) I agree that this implies a perverse effect: maximise risk for a&#xA;   given negative return. In numerical portfolio&#xA;   optimisation, one may rather prefer a linear combination of risk and&#xA;   return instead of a ratio, or simply put a 'safeguard' into the&#xA;   objective function: when return turns negative, change the&#xA;   selection criterion (e.g. select only based on risk).&lt;/p&gt;&#xA;" OwnerUserId="6857" LastActivityDate="2017-02-15T19:17:24.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32450" PostTypeId="2" ParentId="32434" CreationDate="2017-02-15T19:26:13.913" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Does this make sense?  Consider this:  You are an investor.  You have 2 investments.  1 high risk (hr) and the other low risk (lr).  You expect the hr to be volatile and expect the opposite from lr.  If the hr has a small loss and the lr has an equal small loss shouldn't the hr have a better ratio?  It should.  It performed better based on it's volatility and return potential.  &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Yes.  You might consider something like an Omega ratio.  Omega does not assume a normalized distribution of returns and allows you to set a minimum acceptable return.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Using Omega to optimize a portfolio (i.e. assign weightings to each investment) is far more effective than other metrics in helping a manager achieve an expected return of a group of assets.&lt;/p&gt;&#xA;" OwnerUserId="26556" LastActivityDate="2017-02-15T19:26:13.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32451" PostTypeId="2" ParentId="32208" CreationDate="2017-02-15T20:37:47.650" Score="2" Body="&lt;p&gt;If you shop &lt;a href=&quot;http://www.eurexchange.com/exchange-en/market-data/historical-data&quot; rel=&quot;nofollow noreferrer&quot;&gt;Eurex&lt;/a&gt; for 1-minute bars, it's actually fairly cheap: comes down to 37 euro for month of data for DAX futures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/D1Qqk.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/D1Qqk.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2909" LastActivityDate="2017-02-15T20:37:47.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32452" PostTypeId="1" AcceptedAnswerId="32454" CreationDate="2017-02-15T22:07:25.717" Score="0" ViewCount="283" Body="&lt;p&gt;I just read the following and i am having some difficulty to interpret it:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We begin our analysis in the standard Black-Scholes world consisting of a bank account process of price denoted by $B_t$, and a risky stock process $S_t$, both defined on a filtered probability space $(0, \mathbb{F}, \mathfrak{F}_t, \mathbb{P})$, with the filtration $\mathfrak{F}_t$ generated by the standard Brownian motion $W_t$. Both asset processes are therefore adapted to the filtration $\mathfrak{F}_t$, with local dynamics shown below &#xA;  \begin{eqnarray} \mathrm{d}S_t &amp;amp; = &amp;amp; \mu S_t \mathrm{d}t + \sigma S_t \mathrm{d}W_t,\\ \mathrm{d}B_t &amp;amp; = &amp;amp; r B_t \mathrm{d}t. \end{eqnarray}&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The problem is the last sentence in connection with the two equations?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; How is $B_t$ adapted to the same filtration $\mathfrak{F}_t$ as $S_t$ since $B_t$ is not driven by any Brownian motion?&lt;/p&gt;&#xA;" OwnerUserId="26589" LastEditorUserId="24222" LastEditDate="2017-02-16T16:20:41.463" LastActivityDate="2017-02-16T16:20:41.463" Title="Stochastic process and brownian motion" Tags="&lt;black-scholes&gt;&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32453" PostTypeId="1" AcceptedAnswerId="32464" CreationDate="2017-02-15T23:17:44.577" Score="1" ViewCount="86" Body="&lt;p&gt;Sorry if this is the wrong place for this, but I've Googled around quite a bit and can't find this spelled out anywhere. Most of the common indicators&#xA;seem to be based on daily periods. If I want to incorporate an indicator value while backtesting bid/ask tick data - say a 10 day moving average - do I need to resample the ticks into 1-day data, run the indicator on it, and then merge the daily indicator values back in with my tick data?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since Forex is a 24 hour market, what time should I consider the &quot;Close&quot; for the day? 11:59:59pm GMT?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, if they are only updated on &quot;Close&quot;, does this really mean that most of the commonly used indicator values are constant for the entire trading day, or have I just not looked into enough indicators?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your help.&lt;/p&gt;&#xA;" OwnerUserId="26590" LastActivityDate="2017-02-16T16:17:01.507" Title="Beginner question: how do I use common indicators in backtesting with tick data? Do I resample to 1-day data?" Tags="&lt;fx&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32454" PostTypeId="2" ParentId="32452" CreationDate="2017-02-15T23:20:52.593" Score="2" Body="&lt;p&gt;I am not sure I understand your question. If not - then please clarify.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The process for $S$ follows from the Black-Scholes assumption of the risky asset price following a constant coefficient geometric Brownian motion.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The process for $B$ follows from the instantaneous interest rate being constant.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The process being adapted to the filtration $\left( \mathfrak{F}_t \right)_{t \in \mathbb{R}_+}$ simply means that for every $t \in \mathbb{R}_+$, the random variable $S_t$ is $\mathfrak{F}_t$-measurable. Think of this as the information in $\mathfrak{F}_t$ being sufficient to determine the value of $S_t$. Further think of the natural filtration $\mathfrak{F}_t$ of the Brownian motion $W$ as containing all the information of observing $W$ up until time $t$. Given that the process $S$ has only one driving source of uncertainty $W$, it follows that knowing the path of $W$ up to time $t$ is sufficient to determine the path of $S$ up to that time. Consequently, $S$ is adapted to the natural filtration generated by $W$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Answer to your update:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As Quantuple remarked, the non-random process $B$ is adapted to any filtration. You don't need to know anything about the path of $W$ in order to know the value of $B_t$ for any $t \in \mathbb{R}_+$. I.e., even the information in $\mathfrak{F}_0$ (the trivial sigma-algebra) is sufficient to determine $B_t$. Since $\mathfrak{F}_0 \subseteq \mathfrak{F}_t$ it follows that $B$ is adapted.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-02-16T15:37:19.533" LastActivityDate="2017-02-16T15:37:19.533" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="32455" PostTypeId="2" ParentId="32408" CreationDate="2017-02-16T01:48:46.617" Score="1" Body="&lt;p&gt;Once your daily gamma start approaching a reasonable fraction of DV, those resting order will start killing vol (if anyone tells you otherwise, they just haven't reached that threshold). Usually you see this effect on large corporate trades such as ASRs or large stake acquisitions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an curiosity, one of the HF traders used to be called &quot;the put bomber&quot;. He'd quote a high gamma put (gently OTM) on a semi-liquid stock and hit a few desks at once. Obviously, once the size in the market was meaningful, the vol would be squashed from delta hedging. Eventually, most people cut him off, of course.&lt;/p&gt;&#xA;" OwnerUserId="26574" LastActivityDate="2017-02-16T01:48:46.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32456" PostTypeId="1" CreationDate="2017-02-16T01:50:39.573" Score="3" ViewCount="5221" Body="&lt;p&gt;Assume we have all available information and contract specifications for a fixed income instrument, except if the price is quoted as a dirty or clean price. How can we determine if the price given is a dirty price or clean price?&lt;/p&gt;&#xA;" OwnerUserId="1764" LastActivityDate="2017-02-16T10:18:45.513" Title="Determining if a bond is quoted dirty or clean" Tags="&lt;fixed-income&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32457" PostTypeId="2" ParentId="32456" CreationDate="2017-02-16T02:03:25.673" Score="6" Body="&lt;p&gt;It is extremely rare for a bond to be quoted on a dirty-price basis. Off the topic of my head, I can only think of Chilean &amp;amp; Korean bonds...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have yield, you can calculate the price from yield and see whether they match. If you have the history of prices, try calculating mod duration and see whether the time series jumps every few months.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2017-02-16T02:03:25.673" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="32458" PostTypeId="2" ParentId="20812" CreationDate="2017-02-16T02:21:09.987" Score="3" Body="&lt;p&gt;Since all your options have the &lt;strong&gt;same strike&lt;/strong&gt;, you do not have any &quot;explicit&quot; skew or smile exposure in your portfolio. If I had to guess, almost all of your P&amp;amp;L can be explained by primary exposures, with some Theta losses offset by your Gamma scalping and Vega gains.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example of a book with an explicit smile exposure would be a vega-neutral fly - you are long an OTM call, long an OTM put and short an ATM straddle. The sizes on the three legs are selected to give you a net vega neutral portfolio. If the &quot;edges&quot; of the volatility surface move, but the ATM remains the same, you will experience P&amp;amp;L due to the volatility smile. &lt;/p&gt;&#xA;" OwnerUserId="26574" LastActivityDate="2017-02-16T02:21:09.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32461" PostTypeId="1" CreationDate="2017-02-16T05:21:36.263" Score="-2" ViewCount="88" Body="&lt;ol&gt;&#xA;&lt;li&gt;What does dollar option position from $$ strike \ price \times option \ unit \times multiplier $$ actually infer? Particularly for Digital Option.&lt;/li&gt;&#xA;&lt;li&gt;Do investment banks impose some kind of position limit on their positions? &lt;/li&gt;&#xA;&lt;li&gt;If yes, why should such limit exist, apart from Limit on Greeks and VaR?&lt;/li&gt;&#xA;&lt;li&gt;How does investment bank calculate its position size?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="13991" LastActivityDate="2017-02-16T16:50:08.903" Title="Option Position Limit in Investment Bank" Tags="&lt;options&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2017-02-17T00:23:09.200" ContentLicense="CC BY-SA 3.0" />
  <row Id="32462" PostTypeId="2" ParentId="32456" CreationDate="2017-02-16T10:18:45.513" Score="-1" Body="&lt;p&gt;Dirty Price = Clean Price + Accrued Interest&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When bond prices are quoted on a Bloomberg Terminal or Reuters they are quoted using the clean price. The clean price is mostly quoted in the US bond markets. The dirty price is mostly quoted in the European bond markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if you want to find out whether a price is clean or dirty, you can take that price as an input and find out the corresponding yield from BBG YA (or YAS) page. If the yield matches, then it's a clean price. If not, then try deducting the Accrued Interest (available on YAS page) from your price and then do the same P2Y check, if it matches then it's the dirty price.&lt;/p&gt;&#xA;" OwnerUserId="26555" LastActivityDate="2017-02-16T10:18:45.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32463" PostTypeId="2" ParentId="32452" CreationDate="2017-02-16T13:32:29.403" Score="1" Body="&lt;p&gt;Your problem seems to lie in the fundamentals of stochastic processes, so you should probalby refresh your knowledge in this field.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Every process, also $W_t$ comes with a &quot;natural&quot; filtration $\mathfrak{F}_t$. It's the minimal (in a certain sense) filtration for which the process is adapted. Adapted means for a process $X_t$ that for every $t$, $X_t$ is measurable on $\mathfrak{F_t}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now to your sentence in question: With the Ito calculus, under certain conditions (basically the stochastic integrals have to be well defined and itos lemma has to hold), you can also &quot;define&quot; a process using its dynamics (also called Ito processes). Thats what the autor does for $S_t$ and $B_t$. Also, the result is an adapted process.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2017-02-16T13:32:29.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32464" PostTypeId="2" ParentId="32453" CreationDate="2017-02-16T14:25:00.353" Score="0" Body="&lt;p&gt;Regarding your first question on the Closing time for the FX market, this is correct, you should consider the 11:59:59 pm GMT as the close. This approach is the most intuitive one and is also the one used by Bloomberg when displaying the graph price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the second question, if the indicator you want to compare to uses daily data, then you need to sample daily data from your dataset as well (by taking the closing daily FX values for instance). With this approach you would lose the information contained in your intraday data though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would recommend you compute your indicator on your tick data and then normalize it to get daily / weekly / yearly data so that you capitalize on your available tick data.&lt;/p&gt;&#xA;" OwnerUserId="26595" LastActivityDate="2017-02-16T14:25:00.353" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32466" PostTypeId="1" CreationDate="2017-02-16T15:53:15.910" Score="0" ViewCount="331" Body="&lt;p&gt;Apparently this trade may have caused MF Global to go under!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I understand, this trade is simply a repo that ends at maturity of the bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And so, I think that the repo rate (assuming zero haircut) must equal the bond yield to maturity?&lt;/p&gt;&#xA;" OwnerUserId="17348" LastEditorUserId="17348" LastEditDate="2017-02-16T16:48:11.050" LastActivityDate="2017-02-16T18:21:17.103" Title="Understanding the repo to maturity trade" Tags="&lt;bond-yields&gt;" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="32467" PostTypeId="2" ParentId="32453" CreationDate="2017-02-16T16:17:01.507" Score="0" Body="&lt;p&gt;You can also adjust your statistics so they match a smaller time frame. For example, you could create Open, High, Low, Closing statistics for 5 minute chunks of tick data, and from then, calculate a moving average from that data set. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It really depends on the granularity you want to look at. If you go too small, you'll start picking up micro structure noise like the bid-ask bounce - i'd recommend for a few trades a day, use 15 minute data (at the smallest) but if you want to research at a higher granularity, then you're probably best off using other metrics/methods. &lt;/p&gt;&#xA;" OwnerUserId="26598" LastActivityDate="2017-02-16T16:17:01.507" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32468" PostTypeId="2" ParentId="12729" CreationDate="2017-02-16T16:24:56.983" Score="0" Body="&lt;p&gt;To distinguish yourself as a quant (in terms of performance), it's good to know a bit more about everything than everyone else. For example, some insights into accounting rules can used alongside traditional mathematical methods, which, under normal circumstances, may be smoothed over. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, knowing why EPS to compare and rank value stocks is flawed, because for example, what if a company has no earning? &lt;/p&gt;&#xA;" OwnerUserId="26598" LastActivityDate="2017-02-16T16:24:56.983" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32469" PostTypeId="2" ParentId="32461" CreationDate="2017-02-16T16:50:08.903" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;It infers the potential notional value of the underlying security assuming the option gets exercised.  i.e. Strike price 100, Stock XYZ, 100 share multiplier.  Notional Value of the option, if exercised, is 10,000.  This is an amount you would need in an account if you chose to exercise your right as the option holder (margin not being considered for the sake of simplicity).  All options are 'digital' nowadays.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;IB's have constraints imposed upon them by regulators.  IB's may also impose limits on customer accounts regardless of the size of the customer account.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Systemic risk.  If you lived through 2008 and have heard of Lehman Brothers and/or Bear Sterns you should understand.  IF not, Google has plenty of info on that.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;They calculate in several ways.  Notional position value is kept track of as well as net position value which is where the actual risk lies when dealing with exchange traded options that are cleared by an intermediary.  They may also use more complex methods internally such as VaR.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="26556" LastActivityDate="2017-02-16T16:50:08.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32472" PostTypeId="1" CreationDate="2017-02-16T18:06:37.720" Score="0" ViewCount="102" Body="&lt;p&gt;Getting an error when trying to rename columns of a transformed tibble via tq_transform. Checked the documentation and I think I am following the syntax correctly. Below is a reproducible example along with the error messages. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(tidyquant)&#xA;&#xA;tickers &amp;lt;- c(&quot;SPY&quot;, &quot;XLY&quot;, &quot;XLP&quot;)&#xA;&#xA;prices &amp;lt;- tickers %&amp;gt;%&#xA;          tq_get(&quot;stock.prices&quot;) %&amp;gt;%&#xA;          group_by(symbol.x)&#xA;&#xA;returns &amp;lt;- tq_transform(prices, &#xA;                        ohlc_fun = Ad, &#xA;                        transform_fun = periodReturn,&#xA;                        period = &quot;monthly&quot;, &#xA;                        type = &quot;arithmetic&quot;, &#xA;                        col_rename = c(&quot;ticker&quot;, &quot;date&quot;, &quot;returns&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Warning messages:&#xA;1: In coerce_to_tibble(ret, date_col_name, time_zone, col_rename) :&#xA;  Could not rename columns&#xA;2: In coerce_to_tibble(ret, date_col_name, time_zone, col_rename) :&#xA;  Could not rename columns&#xA;3: In coerce_to_tibble(ret, date_col_name, time_zone, col_rename) :&#xA;  Could not rename columns&lt;/p&gt;&#xA;" OwnerUserId="25945" LastActivityDate="2017-02-16T20:43:29.420" Title="R tidyquant - problem with col_rename in tq_transform" Tags="&lt;programming&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32473" PostTypeId="2" ParentId="32232" CreationDate="2017-02-16T18:53:17.103" Score="0" Body="&lt;p&gt;i have an excel that i made a while back, that i can neaten up and attach to show you exactly how one can see that it is like a payback period measure , ie , irrespective of what the price is at that future time , assuming you reinvested all coupons back in the bond , and yield curve is flat with only parallel shifts in yield curve , then your investment cost by that time should have been recouped.  but , is it at all possible to post my excel here, i dont see how?!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;it seems like value at future time @ current yield (y0) = value at future time @ any other yield  (future time = current time + duration , value at future time = accumulation of coupons between now and then at y , and pv of coupons between then and maturity at y)&lt;/p&gt;&#xA;" OwnerUserId="17348" LastEditorUserId="17348" LastEditDate="2017-02-16T19:05:58.883" LastActivityDate="2017-02-16T19:05:58.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32474" PostTypeId="1" CreationDate="2017-02-16T19:56:46.097" Score="0" ViewCount="97" Body="&lt;p&gt;In a typical say 1 week bond repo deal , as i understand , typically X units of bonds are exchanged for P.X cash at spot date (P=dirty price of bond) , and in 1 week , X units of bonds are returned, and cash of P.(1 + repo*T).X is paid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;BUT , sometimes , a haircut / &quot;overcollateralisation&quot; is done , and so actually at inception 1.05X units are exchanged for P.X cash , and at maturity 1.05Xunits are rturned for P.(1+repo*T).1.05X&#xA;(like in Lehmans repo105 deal)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What i dont understand here is a) why is it always that it's OVERcollateralisation thats done - and its never UNDercollateralisation?  after all , in the repo deal , it can be thought of as an exchange of 2 loans, 1 party borrowing cash and posting bond collateral and the other party borrowing bonds and posting cash collateral, and which ever party is riskier should put up more collateral, so if the party that borrows bonds is riskier, then the deal should be UNDercollateralised - ie P.X cash should be exchanged for 0.95 X units of bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) the repo rate must depend on the degree of overcollateralisation , ie on how off market the spot deal is , since for the whole repo deal to be fair  , the forward deal must be sufficiently out of the-money to compensate for how much the spot deal is in the money.  so , when repo rates are reported , why is the degree of collateralisation not indicated?  perhaps the answer is that everyone knows the degree of collateralisation, and that it does not change much between dealers , and doesnt have much impact on the rate ?&lt;/p&gt;&#xA;" OwnerUserId="17348" LastEditorUserId="17348" LastEditDate="2017-02-16T20:22:13.273" LastActivityDate="2017-02-16T20:22:13.273" Title="bond repo - credit risk management with haircut" Tags="&lt;bond-yields&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32475" PostTypeId="2" ParentId="32472" CreationDate="2017-02-16T20:43:29.420" Score="1" Body="&lt;p&gt;Apologies, misinterpreted the exact function of col_rename. Originally thought this would work as dplyr::rename and rename &lt;strong&gt;all&lt;/strong&gt; columns in the resulting tbl, but now understand that it seems to only work for the transformed column.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The below amendment to the code works fine. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;returns &amp;lt;- tq_transform(prices, ohlc_fun = Ad, transform_fun = periodReturn,&#xA;                    period = &quot;monthly&quot;, type = &quot;arithmetic&quot;, &#xA;                    col_rename = &quot;returns&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25945" LastActivityDate="2017-02-16T20:43:29.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32477" PostTypeId="1" AcceptedAnswerId="32479" CreationDate="2017-02-16T21:57:51.657" Score="1" ViewCount="51" Body="&lt;p&gt;Has it always been possible to buy shares of NASDAQ listed companies on the NYSE? If not, what piece of legislation amended that?&lt;/p&gt;&#xA;" OwnerUserId="11874" LastActivityDate="2017-02-16T22:12:50.523" Title="Buying shares of NASDAQ listed companies on the NYSE" Tags="&lt;equities&gt;&lt;trading&gt;&lt;nasdaq&gt;&lt;nyse&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32478" PostTypeId="1" CreationDate="2017-02-16T22:00:07.307" Score="2" ViewCount="828" Body="&lt;p&gt;I have a problem with my R code not producing accurate results. I am trying to implement the Carr-Madan approach to option pricing, using the Black-Scholes model. The formula can be found in equation (6)on page 64 here:&lt;a href=&quot;http://engineering.nyu.edu/files/jcfpub.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://engineering.nyu.edu/files/jcfpub.pdf&lt;/a&gt;. I am using the FFT with simpson weights (eq(22)) to try and approximate the integral, however the results aren't as near as they should be. My question is can you tell me where I have gone wrong with my code, or if I have made an error? &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#The characteristic function of Black-Scholes model&#xA;cf=function(S_0,mu,sigma,T,u){&#xA;  im=complex(real=0,imaginary=1)&#xA;  x=exp(im*u*(log(S_0)+(mu-((sigma**2)/2))*T)-(((sigma**2)*T*(u**2))/2))&#xA;  x&#xA;}&#xA;#The psi function (eq(4) in link)&#xA;psim=function(r,S_0,mu,sigma,T,alpha,v){&#xA;  im=complex(real=0,imaginary=1)&#xA;  u=v-(alpha+1)*im&#xA;  x=(exp(-r*T)*cf(S_0,mu,sigma,T,u))/(alpha**2+alpha-v**2+im*(2*alpha+1)*v)&#xA;  x&#xA;}&#xA;#function used in the simpson weights &#xA;kdf=function(x){&#xA;  if(x==0){&#xA;    result=1&#xA;  }&#xA;  else{&#xA;    result=0&#xA;  }&#xA;  result&#xA;}&#xA;#function used in simpson weights&#xA;kdfn=function(x,N){&#xA;  if(x==N){&#xA;    result=3&#xA;  }&#xA;  else{&#xA;    result=0&#xA;  }&#xA;  result&#xA;}&#xA;#FFT of the eq(6) in the link&#xA;callcm=function(r,S_0,mu,sigma,T,alpha,N,h){&#xA;  im=complex(real=0,imaginary=1)&#xA;  v=seq(0,((N-1)*h),by=h)&#xA;  eta=h&#xA;  b=pi/eta&#xA;  lambda=(2*pi)/(N*eta)&#xA;  u=seq(1,N,by=1)&#xA;  k_u=-b+lambda*(u-1)&#xA;  f=function(i){&#xA;    sum=0&#xA;    for(j in 1:N){&#xA;      sum=sum+((exp((-im*lambda*eta*(j-1)*(i-1))+im*v[j]*b)*&#xA;                        psim(r,S_0,mu,sigma,T,alpha,v[j]))*(eta/3)*(3+(-1)**(j)-kdf(j-1)-kdfn(j,N)))&#xA;    } &#xA;    sum&#xA;  }&#xA;  result=sapply(u,f)&#xA;  result=((exp(-alpha*k_u))/(pi))*Re(result)&#xA;  result&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The error is that say if the parameter values are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;N=2^11&#xA;h=0.01&#xA;S_0=210.59&#xA;T=4/365&#xA;r=0.002175&#xA;alpha=1&#xA;mu=r&#xA;sigma=0.1404&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The function:&#xA;   callcm(r,S_0,mu,sigma,T,alpha,N,h)&#xA;Will return values which are not extremely accurate (looking at papers i've seen i should get results in the region of x10^-14, and I am getting at most within 2 decimal places with playing with the alpha values). All code can be copied and pasted and ran. Hard to put up my data as N=2048, so a lot of values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit 2: I have achieved better results, using the fft function in R with this code, but still doesn't give the results I should be getting:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;callcm=function(r,S_0,mu,sigma,T,alpha,N,h){&#xA;  im=complex(real=0,imaginary=1)&#xA;  v=seq(0,((N-1)*h),by=h)&#xA;  eta=h&#xA;  lambda=(2*pi)/(N*eta)&#xA;  b=N*lambda/2&#xA;  u=seq(1,N,by=1)&#xA;  k_u=-b+lambda*(u-1)&#xA;  w=vector()&#xA;  for(i in 1:N){&#xA;    w[i]=(3+(-1)^(i))&#xA;  }&#xA;  w=w-c(1,rep(0,N-1))&#xA;  w=1/3*w&#xA;  f=function(v){&#xA;    psim(r,S_0,mu,sigma,T,alpha,v)&#xA;  }&#xA;  result=exp(im*b*v)*(sapply(v,f)*eta)*w&#xA;  result=Re(fft(result))&#xA;  result=((exp(-alpha*k_u))/(pi))*result&#xA;  result&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Edit 3:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have managed to obtain accurate results(error of order 10^-9) but with single strike prices, using the pracma package in R, specifically using the adapted Simpsons numerical approximation method.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;callp=function(r,S_0,mu,sigma,T,alpha,k){&#xA;  im=complex(real=0,imaginary=1)&#xA;  fr=function(v){&#xA;    Re(exp(-im*v*k)*psim(r,S_0,mu,sigma,T,alpha,v))&#xA;  }&#xA;  resultr=simpadpt(fr,0,2^11,tol=0.00001)&#xA;  result=resultr*(exp(-alpha*k))/(pi)&#xA;  result&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="26604" LastEditorUserId="26605" LastEditDate="2017-02-21T02:10:01.950" LastActivityDate="2017-02-21T02:10:01.950" Title="Problem with R code, with option pricing" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;programming&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32479" PostTypeId="2" ParentId="32477" CreationDate="2017-02-16T22:12:50.523" Score="1" Body="&lt;p&gt;Since NYSE merged with ARCA about 10 years ago.  No specific legislation.  All stocks may be traded on ECN's as well as their primary markets.  The line that distinguishes them nowadays is quite obscured.  The main differences are liquidity (create/take) fees, order types accepted, opening/closing auctions, etc.  For the average person the differences are insignificant.  However, for a high volume quantitative trader they may make large differences in P&amp;amp;L over time.&lt;/p&gt;&#xA;" OwnerUserId="26556" LastActivityDate="2017-02-16T22:12:50.523" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32480" PostTypeId="1" AcceptedAnswerId="32483" CreationDate="2017-02-16T23:02:35.570" Score="0" ViewCount="116" Body="&lt;p&gt;Is there anywhere that reports open interests or the max pain on futures such as Crude (CL), Natural Gas (NG), or E-Minis (ES)? I cannot seem to find this data, though I have seen it listed on trading screens. The closest I have found is on the CME's website: &lt;a href=&quot;http://www.cmegroup.com/tools-information/quikstrike/options-open-interest-profile-energy.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.cmegroup.com/tools-information/quikstrike/options-open-interest-profile-energy.html&lt;/a&gt;, but how can I get it in a report or data format of each strike's OI for all expiries? . ICE has reports such as &lt;a href=&quot;https://www.theice.com/marketdata/reports/143&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.theice.com/marketdata/reports/143&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="5058" LastEditorUserId="5058" LastEditDate="2017-02-16T23:19:57.283" LastActivityDate="2017-02-17T01:47:39.957" Title="Open Interest on Options on Futures" Tags="&lt;futures&gt;&lt;open-interest&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32481" PostTypeId="2" ParentId="31675" CreationDate="2017-02-16T23:40:21.963" Score="1" Body="&lt;p&gt;I ran into the same issue. I do not know what causes it, but I noticed that you have this error if you use the latest ROI infrastructure (released in June 2016), while the function works correctly if you use the old (2013) ROI infrastructure (and old plug-ins) still available on CRAN (see archives).&lt;/p&gt;&#xA;" OwnerUserId="26607" LastActivityDate="2017-02-16T23:40:21.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32482" PostTypeId="2" ParentId="3783" CreationDate="2017-02-17T00:39:28.457" Score="34" Body="&lt;p&gt;The specifics depend on if you're implementing for equities (order-based) or futures (level-based). I recommend &lt;a href=&quot;https://web.archive.org/web/20110219163448/http://howtohft.wordpress.com/2011/02/15/how-to-build-a-fast-limit-order-book/&quot; rel=&quot;noreferrer&quot;&gt;https://web.archive.org/web/20110219163448/http://howtohft.wordpress.com/2011/02/15/how-to-build-a-fast-limit-order-book/&lt;/a&gt; for a general overview of a good architecture for the former.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Building off of that, though, I have found that using array-based over pointer-based data structures provides faster performance. This is because for modern pipelining, caching CPUs, branching and dereferences (especially from uncached memory) are the biggest performance killers because they introduce data dependencies resulting in pipeline / memory stalls.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you can, you should also optimize for the particular exchange. For instance, it turns out that, last I checked, Nasdaq generates order IDs incrementally starting from a small number, so you can store all the orders in a giant array instead of a hashtable. This is really cache- and TLB-friendly compared to a hashtable because most updates tend to happen to recently-dereferenced orders.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Speaking from experience with equities (order-based), my preferred architecture is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;A large associative array from order ids to order metadata (&lt;code&gt;std::unordered_map&lt;/code&gt; or &lt;code&gt;std::vector&lt;/code&gt; if you can swing it such as in the case of Nasdaq).&lt;/li&gt;&#xA;&lt;li&gt;The order metadata includes pointers to the order book (essentially consisting of the price-levels on both sides) and price-level it belongs to, so after looking up the order, the order book and price level data structures are a single dereference away. Having a pointer to the price allows for a &lt;code&gt;O(1)&lt;/code&gt; decrement for an &lt;code&gt;Order Execute&lt;/code&gt; or &lt;code&gt;Order Reduce&lt;/code&gt; operation. If you want to keep track of time-priority as well, you can keep pointers to the &lt;code&gt;next&lt;/code&gt; and &lt;code&gt;previous&lt;/code&gt; orders in the queue.&lt;/li&gt;&#xA;&lt;li&gt;Since most updates happen near the inside of the book, using a &lt;code&gt;vector&lt;/code&gt; for the price levels for each book will result in the fastest &lt;em&gt;average&lt;/em&gt; price lookup. Searching linearly from the end of the &lt;code&gt;vector&lt;/code&gt; is on average faster than a binary search, too, because most of the time the desired price is only a few levels at most from the inside, and a linear search is easier on the branch predictor, optimizer and cache. Of course, there can be pathological orders far away from the inside of the book, and an attacker could conceivably send a lot of updates at the end of the book in order to slow your implementation down. In practice, though, most of the time this results in a cache-friendly, nearly &lt;code&gt;O(1)&lt;/code&gt; implementation for &lt;code&gt;insert&lt;/code&gt;, &lt;code&gt;lookup&lt;/code&gt;, &lt;code&gt;update&lt;/code&gt; and &lt;code&gt;delete&lt;/code&gt; (with a worst-case &lt;code&gt;O(N)&lt;/code&gt; memcpy). Specifically for a Best Bid / Offer (BBO) update, you can get an implementation to calculate the update in just a few instructions (essentially appending or deleting an element from the end of the &lt;code&gt;vector&lt;/code&gt;), or about three dereferences.&lt;/li&gt;&#xA;&lt;li&gt;The behavior of this is &lt;code&gt;O(1)&lt;/code&gt; best-case behavior for insertion, lookup, delete and update with very low constants (I've clocked it to be on average the cost of a single fetch from main memory - roughly 60ns). Unfortunately you can get &lt;code&gt;O(N)&lt;/code&gt; worst case behavior, but with low probability and still with very good constants due to the cache-, TLB- and compiler-friendliness. It is also very fast, nearly optimally so, in the case of BBO updates which is what you are usually interested in anyways.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I have a &lt;a href=&quot;https://github.com/charles-cooper/itch-order-book&quot; rel=&quot;noreferrer&quot;&gt;reference implementation here&lt;/a&gt; for Nasdaq's ITCH protocol which illustrates these techniques and more. It clocks in at a mean of just over 61ns / tick (about 16 million ticks / second) by only keeping track of the quantity at each price-level and not the order queue, and uses almost no allocation besides &lt;code&gt;std::vector&lt;/code&gt; resizing.&lt;/p&gt;&#xA;" OwnerUserId="26608" LastActivityDate="2017-02-17T00:39:28.457" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32483" PostTypeId="2" ParentId="32480" CreationDate="2017-02-17T01:47:39.957" Score="1" Body="&lt;p&gt;Every day the CME publishes daily settlement information, which includes Open Interest&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Go here &lt;a href=&quot;http://cmegroup.com/settlements.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://cmegroup.com/settlements.html&lt;/a&gt; and click on for example COMEX Options. There are two formats for the file, .csv or plain text. In the .csv file look for the column 'prev int' which refers to Previous Day's Open Interest&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The file(s) can also be downloaded automatically via ftp if you wish&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-02-17T01:47:39.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32484" PostTypeId="1" CreationDate="2017-02-17T03:23:15.570" Score="1" ViewCount="263" Body="&lt;p&gt;Lets say that I have a stock with annual returns, $a_i $ for year $i\in \left\{1,...n\right\}$ and monthly returns $m_{i,j}$ for month $j\in \left\{1,...12\right\}$. Lets define monthly returns to be equal each month within a year so $m_{i,j} = \frac{a_i}{12}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\bar{a}$ and $\bar{m}$ denote the means of yearly and monthly returns respectively so $$\bar{a}=\frac{1}{n}\sum_{i=1}^na_i\quad\text{and}\quad{}\bar{m}=\frac{1}{12n}\sum_{i=1}^n\sum_{j=1}^{12} m_{i,j}=\frac{1}{12n}\sum_{i=1}^n\sum_{j=1}^{12}\frac{a_i}{12}=\frac{1}{12n}\sum_{i=1}^na_i=\frac{\bar{a}}{12}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the monthly volatlity of returns is:&#xA;$$\begin{align*}&#xA;\sigma_{m} &amp;amp;= \sqrt{\frac{1}{12n}\sum_{i=1}^n\sum_{j=1}^{12} \left(m_{i,j}-\bar{m} \right)^2}\\&#xA;&amp;amp;= \sqrt{\frac{1}{12n}\sum_{i=1}^n\sum_{j=1}^{12} \left(\frac{a_i}{12}-\frac{\bar{a}}{12}\right)^2 }\\&#xA;&amp;amp;= \sqrt{\frac{1}{12n}\left(\frac{1}{144}\right)\sum_{i=1}^n\sum_{j=1}^{12} \left(a_i-\bar{a}\right)^2 }\\&#xA;&amp;amp;= \sqrt{\frac{1}{12n}\left(\frac{1}{144}\right) \sum_{i=1}^n12\left(a_i-\bar{a}\right)^2 }\\&#xA;&amp;amp;= \sqrt{\frac{1}{n}\left(\frac{1}{144}\right) \sum_{i=1}^n\left(a_i-\bar{a}\right)^2 }\\&#xA;&amp;amp;= \frac{1}{12}\sqrt{\frac{1}{n} \sum_{i=1}^n\left(a_i-\bar{a}\right)^2 }\\&#xA;&amp;amp;= \frac{\sigma_a}{12}&#xA;\end{align*}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in other words $$\sigma_a = 12\sigma_m$$. This seems to contradict &lt;a href=&quot;https://en.wikipedia.org/wiki/Volatility_(finance)&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Volatility_(finance)&lt;/a&gt; where they say generalized volatility in $T$ time periods is $\sigma_T = \sigma \sqrt{T}$. What am I doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="17136" LastActivityDate="2017-02-17T07:10:05.727" Title="Monthly returns annualized vs annual returns" Tags="&lt;volatility&gt;&lt;finance&gt;&lt;finance-mathematics&gt;&lt;random-walk&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2017-02-19T13:58:56.097" ContentLicense="CC BY-SA 3.0" />
  <row Id="32486" PostTypeId="2" ParentId="32484" CreationDate="2017-02-17T07:10:05.727" Score="1" Body="&lt;p&gt;i think you are assuming 100% correlation between returns, whereas for a stochastic process, increments are independent&lt;/p&gt;&#xA;" OwnerUserId="17348" LastActivityDate="2017-02-17T07:10:05.727" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32487" PostTypeId="1" CreationDate="2017-02-17T07:43:12.627" Score="0" ViewCount="168" Body="&lt;p&gt;I know that implied volatility is the result of backing volatility out of any one of the many options pricing calculations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I've noticed that on ThinkorSwim and other platforms they also have implied volatility, and historical volatility of the stock itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this a weighted average of IV of all active contracts, or do they actually mean a rolling volatility like yang-zhang? &quot;Implied Volatility&quot; of a stock itself seems like a weird concept to me, mostly because you can trivially calculate volatility directly.&lt;/p&gt;&#xA;" OwnerDisplayName="user20664" LastActivityDate="2017-02-17T07:49:02.080" Title="Implied Volatility of a stock?" Tags="&lt;volatility&gt;&lt;equities&gt;&lt;implied-volatility&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32488" PostTypeId="2" ParentId="32487" CreationDate="2017-02-17T07:49:02.080" Score="3" Body="&lt;p&gt;Implied Vol is model dependent, generally the black scholes model. If you have many options, with the same expiry, you get vol curve. you can also get vol surface if you have options with different expiry in addition to strikes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Realized vol generally is the standard deviation of closing prices of the stock for a number of days. So you can have 1-month realized vol or 1 year realized vol. These numbers are annualized. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, implied vol is not equal to realised vol. IV is sort of a forward looking measure. Imagine what happens during results season when the IV of options increase due to uncertainty of the announcement. &lt;/p&gt;&#xA;" OwnerUserId="15428" LastActivityDate="2017-02-17T07:49:02.080" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32489" PostTypeId="2" ParentId="28186" CreationDate="2017-02-17T08:28:45.270" Score="3" Body="&lt;p&gt;Although it's a bit different story, there are VERY accurate approximation formulas for the implied volatility under normal model (so-called basis point volatility). Using them, you can obtain the implied vol directly without numerical root-finding like Newton's method.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my paper &lt;a href=&quot;https://ssrn.com/abstract=990747&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://ssrn.com/abstract=990747&lt;/a&gt;&#xA;and an improvement &lt;a href=&quot;https://ssrn.com/abstract=2420757&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://ssrn.com/abstract=2420757&lt;/a&gt; .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is some discussion on blogs:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.clarusft.com/analytic-implied-basis-point-volatility/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.clarusft.com/analytic-implied-basis-point-volatility/&lt;/a&gt;&#xA;&lt;a href=&quot;https://www.clarusft.com/bachelier-model-fast-accurate-implied-volatility/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.clarusft.com/bachelier-model-fast-accurate-implied-volatility/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26559" LastActivityDate="2017-02-17T08:28:45.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32490" PostTypeId="2" ParentId="21483" CreationDate="2017-02-17T08:33:01.047" Score="1" Body="&lt;p&gt;FYI, &#xA;Unlike Black (lognormal) implied volatility, Bachelier (normal) implied volatility can be VERY accurately approximated. See &#xA;&lt;a href=&quot;https://quant.stackexchange.com/a/32489/26559&quot;&gt;https://quant.stackexchange.com/a/32489/26559&lt;/a&gt;&#xA;if you're interested.&lt;/p&gt;&#xA;" OwnerUserId="26559" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2017-02-17T08:33:01.047" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32491" PostTypeId="2" ParentId="24523" CreationDate="2017-02-17T08:39:26.073" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;The vols do not have the same order of magnitude. To get an idea, at the money, a 30% lognormal vol can correspond to a 0.60% normal vol. Normal vols are usually quoted in bps = 0.01%.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The approximate relation should be &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nvol = S * Bvol&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to be more accurate, you can invert the price obtained from the BS model into the normal implied volatility. See here for direct approximation &lt;a href=&quot;https://quant.stackexchange.com/a/32489/26559&quot;&gt;https://quant.stackexchange.com/a/32489/26559&lt;/a&gt; . &lt;/p&gt;&#xA;" OwnerUserId="26559" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2017-02-17T08:39:26.073" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32492" PostTypeId="2" ParentId="15961" CreationDate="2017-02-17T08:51:25.240" Score="2" Body="&lt;p&gt;The best approximation that I know is &#xA;&lt;a href=&quot;https://ssrn.com/abstract=952747&quot; rel=&quot;nofollow noreferrer&quot;&gt;Li, Deng and Zhou, 2006&lt;/a&gt;. It's an analytic approximation where the price is expressed as a direct formula, so easy to implement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to be VERY accurate, here's my paper,&#xA;&lt;a href=&quot;https://doi.org/10.1002/fut.21909&quot; rel=&quot;nofollow noreferrer&quot;&gt;J Choi (2018)&lt;/a&gt; (&lt;a href=&quot;http://arxiv.org/abs/1805.03172&quot; rel=&quot;nofollow noreferrer&quot;&gt;Arxiv&lt;/a&gt;). It handles the options on any linear combination of assets such as basket and Asian options as well as spread option. There is some discussion on the performances of other analytic approximations.  &lt;/p&gt;&#xA;" OwnerUserId="26559" LastEditorUserId="26559" LastEditDate="2018-08-03T07:40:45.967" LastActivityDate="2018-08-03T07:40:45.967" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="32493" PostTypeId="1" CreationDate="2017-02-17T09:08:08.300" Score="3" ViewCount="1300" Body="&lt;p&gt;The risk-free rate of a x-currency denominated instrument can be determined from treasury bills, interbank borrowing rates (e.g. LIBOR), overnight index rates or interest rate swaps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What instrument may be indicative for a risk-free rate of an instrument, which is denominated in a precious metal, specifically in gold? That is, the counterparties to such an instrument pay and receive payments directly in gold. The risk-free rate for gold is primarily needed for discounting reasons to discount an amount of gold from the future to the present date. For instance, 1 XAU (i.e. 1 ounce) in 3 months is actually 0.9998 XAU today for a positive discount rate. Something like that.&lt;/p&gt;&#xA;" OwnerUserId="24076" LastEditorUserId="24076" LastEditDate="2017-02-17T11:20:25.577" LastActivityDate="2017-02-18T16:56:20.633" Title="What is the risk-free rate of a precious metal, e.g. gold?" Tags="&lt;interest-rates&gt;&lt;risk-free&gt;" AnswerCount="6" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32496" PostTypeId="2" ParentId="32493" CreationDate="2017-02-17T10:40:42.430" Score="1" Body="&lt;p&gt;In my opinion, settling your risk-free rate it is just a matter of convention. &#xA;It is just what you consider to be safe. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Years ago, most people considered gold because most of the currencies where based on the gold pattern, but not any more. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In US usually paper (e.g. treasury bills) and in Europe usually German paper (e.g. German Bund). &lt;/p&gt;&#xA;" OwnerUserId="12089" LastActivityDate="2017-02-17T10:40:42.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32497" PostTypeId="2" ParentId="32493" CreationDate="2017-02-17T10:55:36.837" Score="1" Body="&lt;p&gt;Risk free rate is the rate of interest you earn of an asset which is virtually default free. Like the US dollar denominated bond guaranteed by the US govt. So essentially it can't fail and thus the person invested in such an instrument has no risk and earns the risk free rate. There is some debate at times as to the tenor, but I think if you want a 7.25 year rfr, you can find it from the US govt yield curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as gold is concerned, I dont think there is any entity which would backstop the metal. So I cant be sure that such a rate exists. But generally we use rfr for (relative) pricing of securities and in such cases you can use rfr off the yield curve and use it in your calculations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: I've never traded commodities. &lt;/p&gt;&#xA;" OwnerUserId="15428" LastActivityDate="2017-02-17T10:55:36.837" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32498" PostTypeId="2" ParentId="32493" CreationDate="2017-02-17T11:19:57.617" Score="1" Body="&lt;p&gt;The technical definition of a risk-free asset is an asset that pays out the same value in all states of nature.  Obviously, none exist, if for no other reason that a meteor could hit the Earth tomorrow and there would be no one to pay out.  There are a number of potential very low-risk assets you could use as a proxy, but there is no risk-free asset.  Consequently, it doesn't matter which one you use as long as it is reasonable to believe that it will pay out the same amount of money in all states of nature.  Indeed, it couldn't be a risk-free asset if it was contingent on the asset class you were using as the risk-free rate can have no contingencies.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2017-02-17T11:19:57.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32499" PostTypeId="2" ParentId="8371" CreationDate="2017-02-17T11:56:32.533" Score="3" Body="&lt;p&gt;I thought I would answer the question of &quot;what am I using.&quot;  All shrinkage estimators map to a Bayesian estimator that differs only in the prior distributions.  In other words, you get a point estimate that is indistinguishable from a Bayesian estimate except that the calculation rule determines the prior distribution.  Stein estimators for the Gaussian are nothing more than the ordinary estimator with an empirical prior distribution based off of the grand mean.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I usually have real prior information, and so does everybody else, I use Bayesian estimators as I get the shrinkage for free.  Bayesian estimators have the nice property that they are &quot;coherent,&quot; which means fair gambles can be placed on them, whereas this is not true for Frequentist estimators.  In fact, I once did a talk on how you could always game someone using a Frequentist estimator in the right circumstances guaranteeing a sure win no matter how the universe came out. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The downside of a Bayesian estimator is computation time.  This is less serious than it appears because Bayesian updating allows you to do the calculations one data point at a time.  If you have calculated the solution for every data point up to today, then you can add today's data in and ignore all prior data, reducing the calculation size tremendously.  You can do this because yesterday's &quot;posterior density&quot; becomes today's &quot;prior density.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Speed is your enemy here, though.  Speed requires compromises if you use a Bayesian method.  Although Bayesian predictions are coherent and Frequentist predictions are not, you have to do some compromises or you will not run fast enough if time is of the essence.  In particular, the impact of one day's data on the posterior is negligible.  Unlike a Frequentist method, you do not really have to update in real time, you can use the data up to yesterday and get nearly identical results.  This is because Bayesian methods use the &lt;em&gt;unique&lt;/em&gt; information in the data that is not in the prior.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To understand this, imagine you have two data sets and a prior and you merge one data set with the prior to get a posterior density.  When you merge the second set into this density, the only changes that will happen in the second posterior density will be from information that is unique to the second set that is neither in the first set nor the prior.  Bayes rule ignores redundant information.  In essence, this is saying that the unique information content of a single trade is negligible when compared to the joint information content of the set of all trades that have ever happened.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you do not need to run it in real time unless you believe today is the one day that is unique in the history of trading.  You can run with a lag because there is trivial information loss.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2017-02-17T11:56:32.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32500" PostTypeId="2" ParentId="32493" CreationDate="2017-02-17T12:23:20.880" Score="1" Body="&lt;p&gt;i would say the standard way to pv such a cashflow is to assume settlement in usd (multiply by forward xau/usd rate) and then discount on usd curve thats appropriate for how its collateralised/funded eg 3m libor or ois&lt;/p&gt;&#xA;" OwnerUserId="17348" LastActivityDate="2017-02-17T12:23:20.880" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32502" PostTypeId="2" ParentId="8348" CreationDate="2017-02-17T13:56:19.380" Score="3" Body="&lt;p&gt;If you have an American-exercise option and want to treat discrete dividends properly, you will have to apply some sort of technique for determining the exercise strategy.  Mathematically this is phrased in terms of an &lt;a href=&quot;https://www.ma.utexas.edu/mediawiki/index.php/Optimal_stopping_problem&quot; rel=&quot;nofollow noreferrer&quot;&gt;optimal stopping time&lt;/a&gt;.  Computationally it is handled in a grid technique like a tree or other PDE solver.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, you set up a finite grid of potential stock prices $S_{n,t}$ and corresponding options values $V_{n,t}$, where $V$ starts out unknown.  You know what $V$ looks like at the option expiration time $T$, and so you fill that in and then work backwards from $T$, filling in $V$ values as you go.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The American exercise comes in when you figure out for which cases $V_{n,t}$ would be &lt;em&gt;bigger&lt;/em&gt; by exercising early.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without discrete dividends, this all well-handled in the Leisen-Reimer trees that Matt Wolf points to in &lt;a href=&quot;https://quant.stackexchange.com/a/1923/254&quot;&gt;this answer&lt;/a&gt; to a question about real-time pricing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;With&lt;/em&gt; discrete dividends, things get a lot trickier.  If you are willing to assume a completely fixed value for each dividend, then &lt;a href=&quot;http://www.bnikolic.co.uk/blog/ql-american-disc-dividend.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;this example&lt;/a&gt; appears to show how to treat the option in QuantLib.  If you want the dividends to be partially fixed and partially proportional, I think the only choice is &lt;a href=&quot;https://github.com/brianboonstra/ragtop&quot; rel=&quot;nofollow noreferrer&quot;&gt;this R package&lt;/a&gt; I wrote.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2017-02-17T13:56:19.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32503" PostTypeId="1" CreationDate="2017-02-17T14:31:59.540" Score="4" ViewCount="1317" Body="&lt;p&gt;I want to know the expectation and the variance of the Gamma PnL for different hedging frequencies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say the return of the underlying follow a normal process:&#xA;$dr= \sigma*dW$, the market trades 24hours and there is no transaction cost. I consider I have a constant dollar $\Gamma$ position (-r% or +r%, r $\in$ $\mathbb{R}$), provide the same $\Gamma$) with a stripe of options. I also assume, there is no change in implied vol during the day, therefore the vega PnL is zero. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The daily volatility is $s = \frac{\sigma}{\sqrt{365}}$ therefore $dr \sim \mathcal{N}(0,s^2)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the Gamma PnL if we hedge every seconds, hours ... every time period $t$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we hedge every time $t$ (to simplify I normalize $t$ to a day, for instance every hour would be $t$ = 1/24), using the properties of Brownian motions, I can consider I have $1/t$ independent return processes $dr_{t} \sim \mathcal{N}(0, s^2*t)$, the Gamma PnL process is then for a day:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$PnL_{\Gamma}=  \frac{1}{t}*\Gamma*\frac{dr_{t}^2}{2}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and then follows $PnL_{\Gamma}\sim \chi^2_{1}$, with mean $E =\Gamma*s^2*t/t = \Gamma*s^2$ and variance $V = \Gamma^2*s^4*t^2/t^2 = \Gamma^2*s^4$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I do not understand is that there is no dependency of the Gamma PnL to the hedging frequency. As we increase the hedging frequency we should have less variance and less return on the gamma and the reciprocal should be true? Where is my math failing? I do not see it.&lt;/p&gt;&#xA;" OwnerUserId="26616" LastActivityDate="2017-09-16T13:26:25.357" Title="Delta hedging frequency, Gamma PnL" Tags="&lt;hedging&gt;&lt;delta&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32507" PostTypeId="1" CreationDate="2017-02-17T15:53:53.357" Score="0" ViewCount="533" Body="&lt;p&gt;I am having hard time understanding the price difference of yahoo option chains. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&#xA;Yahoo shows for TWTR FEB 17, 2017 CALL @16.50 option&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Strike Last Price    Bid      Ask&#xA;16.50    0.10          0.09   0.10&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Whereas at a stock broker (ex: tastyworks)&#xA;for TWTR FEB 17, 2017 CALL @16.50 option&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Strike    Bid    Ask&#xA;16.50     0.30   0.31&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Whereas at a stock broker (ex: thinkorswim)&#xA;for TWTR FEB 17, 2017 CALL @16.50 option&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Strike    Bid    Ask&#xA;16.50     0.28   0.29&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can understand the difference between thinkorswim vs tastyworks but not yahoo. Where does the difference between comes from ?&#xA;Is yahoo delayed ? If that's the case why people bother reading yahoo options? &lt;/p&gt;&#xA;" OwnerUserId="26621" LastEditorUserId="18030" LastEditDate="2017-02-18T22:41:15.523" LastActivityDate="2017-02-18T22:41:15.523" Title="Yahoo options chain pricing vs stock broker pricing" Tags="&lt;options&gt;&lt;finance&gt;&lt;algorithmic-trading&gt;&lt;yahoofinance&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32510" PostTypeId="2" ParentId="32503" CreationDate="2017-02-17T19:51:29.410" Score="2" Body="&lt;p&gt;From a quant perspective (I am sure more quants will chime in), delta hedging is a physical representation of a stochastic integral, which is inherently independent of the step size (in both time and price dimension). All you can really say there is that the closer to continuous hedging you get, the lower your hedging error will be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a traders perspective re-balancing frequency will indeed come into play if you leave the perfect BS world. For example, in real life, you are usually trying to optimize your hedging for a balance of (a) smoothness of P&amp;amp;L, (b)  transaction costs, (c) vol dampening or amplifying (d) mean reversion found in the asset you're trading and (e) your risk limits. &lt;/p&gt;&#xA;" OwnerUserId="26574" LastActivityDate="2017-02-17T19:51:29.410" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32511" PostTypeId="1" CreationDate="2017-02-17T21:13:20.860" Score="0" ViewCount="66" Body="&lt;p&gt;I've been studying portfolio optimization trying to go step by step.&#xA;After seeing much of Markowitz and Merton's work (Although I still don't get all of it), I would like to have acquire more knowledge about theories that introduce transaction costs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've read somewhere that it first begun with Magill and Constantinides ? &#xA;Is it the simplest one out there ? Should I start by that or would you advise me to see something else ?&#xA;Can anyone recommend a reference where I could study the Magill model ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you !&lt;/p&gt;&#xA;" OwnerUserId="26218" LastEditorUserId="26218" LastEditDate="2017-02-18T11:18:02.383" LastActivityDate="2017-02-18T11:18:02.383" Title="Simplest portfolio optmization under transaction costs" Tags="&lt;finance&gt;&lt;portfolio-optimization&gt;&lt;transaction-costs&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32512" PostTypeId="2" ParentId="32104" CreationDate="2017-02-17T21:47:39.063" Score="1" Body="&lt;p&gt;This process is martingale and we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;E[I_t|t=0]=0&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To find the variance, let's write it into differential form&#xA;$$&#xA;dI_t =e^{iW_t}dW_t&#xA;$$&#xA;Apply Ito's isometry&#xA;$$&#xA;Var(I_t)=\int_0^tE[e^{2iW_s}]ds&#xA;$$&#xA;Apply MGF of normal&#xA;$$&#xA;Var(I_t)=\int_0^te^{\frac{1}{2}(2i)^2s}ds=\int_0^te^{-2s}ds=\frac{1-e^{-2t}}{2}&#xA;$$&#xA;Please  let me know if anything is incorrect.&lt;/p&gt;&#xA;" OwnerUserId="19653" LastActivityDate="2017-02-17T21:47:39.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32513" PostTypeId="1" CreationDate="2017-02-17T22:41:02.623" Score="1" ViewCount="7296" Body="&lt;p&gt;I feel like an idiot asking this but i haven't found the answer anywhere. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have backtestest a paris trading strategy, while calculating the returns of the strategy I run into some problems when the P&amp;amp;L just gets more negative. Lets take for example the data above. From &lt;code&gt;2005-02-16&lt;/code&gt; to &lt;code&gt;2005-02-17&lt;/code&gt; the arithmetic return is &lt;code&gt;39.13%&lt;/code&gt; or for the dates &lt;code&gt;2005-02-23&lt;/code&gt; to &lt;code&gt;2005-02-24&lt;/code&gt; the return is &lt;code&gt;-16311.20%&lt;/code&gt; which isn't right obviously. So my question is how do I calculate the returns when I have a P&amp;amp;L which allows negative negative values. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;2005-02-14    5010&#xA;2005-02-15   -23315&#xA;2005-02-16   -14371&#xA;2005-02-17   -19995&#xA;2005-02-18   -17064&#xA;2005-02-21   -25018&#xA;2005-02-22      736&#xA;2005-02-23     -125&#xA;2005-02-25    20264&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="18443" LastActivityDate="2017-03-20T13:21:58.233" Title="Calculating the returns of a long/short strategy" Tags="&lt;quant-trading-strategies&gt;&lt;returns&gt;&lt;pairs-trading&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32517" PostTypeId="2" ParentId="32503" CreationDate="2017-02-18T06:06:26.747" Score="2" Body="&lt;p&gt;The problem with what I do above is that I change the unit of time, as opposed to keeping the same unit of time and comparing the different frequencies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We want to compare the returns over different hedging frequencies, the easy way is to use log return over different frequencies:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dr_{t}=-\frac{s^2*t}{2} + s*\sqrt{t}*\epsilon∼N(-\frac{s^2∗t}{2},s^2∗t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do the rest of the math you will get the effect of the expected Gamma PnL and its variance. &lt;/p&gt;&#xA;" OwnerUserId="26616" LastEditorUserId="26616" LastEditDate="2017-02-18T09:39:37.830" LastActivityDate="2017-02-18T09:39:37.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32518" PostTypeId="1" AcceptedAnswerId="32537" CreationDate="2017-02-18T07:54:05.643" Score="2" ViewCount="355" Body="&lt;p&gt;I am trying to store incoming tick data from the US equity markets on a database.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the most common problems that come up with respect to storing and managing such a large data set. A few that I already know are:&lt;br&gt;&#xA;1) Missing data - you can add some dummy data or not include this in backtest.&lt;br&gt;&#xA;2) Timestamp doesn't match.&lt;br&gt;&#xA;3) Block trades/Cleaning the data.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anything else I might be missing and if so how can I go about resolving them.&lt;br&gt;&#xA;The main purpose is to backtest strategies. The data will not be huge - only Level 1 data for around 20 stocks.&lt;/p&gt;&#xA;" OwnerUserId="7991" LastActivityDate="2017-02-19T22:59:18.437" Title="Practical challenges in storing and managing market data" Tags="&lt;data&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32519" PostTypeId="2" ParentId="32513" CreationDate="2017-02-18T13:08:16.450" Score="3" Body="&lt;p&gt;There are two ways to calculate the returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way is to calculate the net asset value (NAV) of your portfolio.&lt;br&gt;&#xA;For the long side the NAV is the value of your stock holdings.&lt;br&gt;&#xA;For the short side the initial NAV is zero since the cash proceeds from the sale balances the liabilities of the short holdings.&lt;br&gt;&#xA;The portfolio NAV is hence initially equal to the value of the long holdings.&lt;br&gt;&#xA;At a future date the short NAV is equal to the initial cash proceed from the sale minus the current liability of the short position, which is the negative value of the stocks that are shorted. The portfolio NAV is hence the value of the long stocks + cash proceeds from the sales - value of the short stocks. To find the return $R(t_1,t_2)$ between dates $t_1$ and $t_2$ one takes $R(t_1,t_2) = NAV(t_2)/NAV(t_1) -1 $.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way is to calculate the period return (say one week) of the long stocks and the negative returns of the short stocks and average them (assuming equal weighting) giving the long/short return over the period.&lt;/p&gt;&#xA;" OwnerUserId="5107" LastActivityDate="2017-02-18T13:08:16.450" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32520" PostTypeId="2" ParentId="32493" CreationDate="2017-02-18T15:34:49.260" Score="4" Body="&lt;p&gt;The current price of future access to any asset is its current forward price. This is true for any asset and true for whatever currency you use to measure price. Once you have the forward prices it is clear how to discount:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Call the period $T$ (e.g. 3 months) the forward price of you asset $P(T)$ and the current rate for exchanging your asset for currency i.e. the spot price $P(0)$. Then $P(T)$ is the current price of 1 unit of your asset at time $T$ measured in currency units. To get the price in terms of your asset you need to apply the spot rate, i.e. the discount factor is $\frac{P(T)}{P(0)}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the actual currency which is used to quote the prices does not matter, since it cancels in the quotient. Hence this formula is always the same no matter what asset, currency or commodity you're interested in. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you can rely on quoted forward prices you are pretty much done. If you want to mark to model and do not have forward prices available, then of course you need to worry about real world issues for your arbitrage pricing such as cost of carry, transaction costs and risk premia for financing or default.&lt;/p&gt;&#xA;" OwnerUserId="482" LastActivityDate="2017-02-18T15:34:49.260" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32521" PostTypeId="1" CreationDate="2017-02-18T16:01:15.467" Score="1" ViewCount="122" Body="&lt;p&gt;I have been trying to get my head around pricing an option none of the traditional option types fit the structure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to get a loan of $100 , 5Y maturity . The lender gives me the following terms. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;On day 1 there is a fixed rate offer on the table . Lets say 2.5% . &lt;/li&gt;&#xA;&lt;li&gt;Once locked in I have 6 months to decide if I want the loan. &lt;/li&gt;&#xA;&lt;li&gt;End of this period I can either accept the terms or reject it. No penalty. &lt;/li&gt;&#xA;&lt;li&gt;If I accept it , I have a 30 day option(European for simplicity sake)  where I can either take this loan at 2.5% , take the prevailing USD Libor + 50 bps or pay a penalty and cancel the facility. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Essentially it is 30 day option on Loan rate , of notional $100 and tenor 5Y and the penalty is the embedded option premium and option can be represented as  &lt;strong&gt;min(2.5%,3M Libor+50)&lt;/strong&gt; . Whats the best way of pricing this penalty i.e the embedded option premium. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will update if I find a solution , in the meantime any thoughts will great.&lt;/p&gt;&#xA;" OwnerUserId="1386" LastActivityDate="2017-11-17T07:51:24.457" Title="Option on Loan rate" Tags="&lt;option-pricing&gt;&lt;interest-rates&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32522" PostTypeId="2" ParentId="32493" CreationDate="2017-02-18T16:56:20.633" Score="1" Body="&lt;p&gt;If the question is about pricing an option on an asset denominated in gold, then the answer is that the asset denominated in gold will follow a martingale (by extensions to the &lt;a href=&quot;https://en.wikipedia.org/wiki/Fundamental_theorem_of_asset_pricing&quot; rel=&quot;nofollow noreferrer&quot;&gt;first fundamental theorem of asset pricing&lt;/a&gt;).  The price process of the asset denominated by gold will have to be modeled by some process and the choice of model will be key to pricing the option.  However, the risk free rate need not be considered in such a problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the question is about discounting some future cash flow then use a swap curve between the asset and gold if one exists.  Depending on the terms of the swap some additional work may need to be done to tease a zero rate from the swap curve. The important thing is to try to ignore dollars completely unless the final payoff will be converted into dollars, though if the final payoff is in dollars then why bother with gold in the first place.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;@g g:  The forward price of gold will determine the zero rate for dollars, not for gold.&lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2017-02-18T16:56:20.633" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="32523" PostTypeId="1" CreationDate="2017-02-18T18:00:47.503" Score="1" ViewCount="280" Body="&lt;p&gt;In the article about Exercise boundaries of American options by F.AitSahlia and T.L.Lai the closed-form formulas for lower and upper bounds of the exercise boundaries are given as follows:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/5eHb7.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/5eHb7.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt; &#xA;It appears that lower bound is always above the upper bound, which seems to be wrong. Let's assume parameters: &lt;code&gt;rho&lt;/code&gt; = 0.5, &lt;code&gt;alpha&lt;/code&gt;= 0.1 and &lt;code&gt;s&lt;/code&gt; = -2.5. Hence, &lt;code&gt;theta&lt;/code&gt; = -0.95. It leads to ln[theta/(theta-1)] entering the second formula as a positive term. Therefore the lower bound is above the upper bound. &#xA;The question is whether the reasoning above has a flaw?&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;Exercise boundaries and efficient approximations to American option prices and hedge parameters&quot; by F.AitSahlia and T.L.Lai&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="24076" LastEditorUserId="24222" LastEditDate="2017-02-18T19:12:33.867" LastActivityDate="2017-02-18T19:12:33.867" Title="Upper and lower bounds of the early exercise boundary for American option" Tags="&lt;option-pricing&gt;&lt;american-options&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32524" PostTypeId="1" AcceptedAnswerId="32525" CreationDate="2017-02-18T22:00:47.553" Score="0" ViewCount="1409" Body="&lt;p&gt;For a binomial tree, everywhere in Hull and other literature, we have found the formulas for&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$u = \exp(\sigma \sqrt{h})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but for binomial trees based on forward prices, we get a different formula&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$u=\exp((r−\delta)h+\sigma\sqrt{h})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anyone please provide an explanation of why there is this extra term of $\exp(r-\delta)$ multiplied here?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that $\delta$ is for the constant dividend yield but why is there a difference in formulas for $u$ when binomial tress are constructed using forward prices?&lt;/p&gt;&#xA;" OwnerUserId="26635" LastEditorUserId="-1" LastEditDate="2017-02-19T14:02:18.633" LastActivityDate="2017-02-19T14:02:18.633" Title="Difference in formulas for u &amp; d in Binomial trees" Tags="&lt;binomial-tree&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32525" PostTypeId="2" ParentId="32524" CreationDate="2017-02-18T22:15:07.870" Score="4" Body="&lt;p&gt;there are many different trees. The first one, the CRR tree, used &#xA;$$&#xA;u = e^{\sigma\sqrt{h}}&#xA;$$&#xA;and $d = 1/u.$ However, you can take any real-world drift and still get the same &#xA;prices in the limit so you can put&#xA;$$&#xA;u = e^{\mu h +\sigma\sqrt{h}}, \text{ and } d = e^{\mu h -\sigma\sqrt{h}}&#xA;$$&#xA;for any fixed $\mu.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mu = 0$ is a poor choice for convergence. Better choices are &#xA;$$&#xA;\mu = r - d - 0.5\sigma^2&#xA;$$&#xA;and&#xA;$$&#xA;\mu = \frac{1}{T}(\log K - \log S_0).&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There has been a huge amount of work on binomial trees in the last 40 years and &#xA;there is now over 30 of them. More sophisticated trees achieve higher order convergence for European options. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I give a comprehensive survey in my book, More Mathematical Finance.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2017-02-18T22:15:07.870" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32526" PostTypeId="1" AcceptedAnswerId="32620" CreationDate="2017-02-18T22:52:23.603" Score="0" ViewCount="206" Body="&lt;p&gt;YQL has different companies that are listed under an industry:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e.g. select * from yahoo.finance.industry where id=&quot;112&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to query the table for a ticker symbol and find out to which industry the company belongs?&lt;/p&gt;&#xA;" OwnerUserId="26636" LastActivityDate="2017-02-22T22:39:04.720" Title="yahoo YQL to find industry that a ticker belongs to" Tags="&lt;yahoofinance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32527" PostTypeId="1" AcceptedAnswerId="32533" CreationDate="2017-02-19T09:23:31.580" Score="1" ViewCount="116" Body="&lt;p&gt;Quote&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;Hedging with variance is not comparable to puts&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Due to the lack of convexity of a variance swap hedge, we believe it is best to compare long variance hedges to hedging with futures rather than hedging with puts. Although variance hedges might be cheaper than put hedges, the lack of convexity for long volatility makes this&#xA;an unfair comparison, in our view.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;End Quote&lt;/p&gt;&#xA;&lt;p&gt;Source: Santander Volatility Trading Primer, Page 92&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.globalvolatilitysummit.com/wp-content/uploads/2015/10/Santander-Volatility-Trading-Primer-Part-I.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.globalvolatilitysummit.com/wp-content/uploads/2015/10/Santander-Volatility-Trading-Primer-Part-I.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Why does a var swap hedge have a lack of convexity? (I guess for long vol).&lt;/p&gt;&#xA;&lt;p&gt;Also I do not understand why they are comparing this to futures and puts hedges.&lt;/p&gt;&#xA;" OwnerUserId="11723" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2017-02-19T18:07:48.057" Title="Hedging equities portfolios with vol products" Tags="&lt;options&gt;&lt;volatility&gt;&lt;hedging&gt;&lt;variance&gt;&lt;convexity&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32529" PostTypeId="1" AcceptedAnswerId="32530" CreationDate="2017-02-19T14:01:01.190" Score="0" ViewCount="5771" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;The presence of skew causes a correlation between volatility and spot. This correlation produces a negative shadow delta for all forward starting products (forward starting options have a theoretical delta of zero). &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How does this produce a negative shadow delta? The exact mechanism is not clear to me.&lt;/p&gt;&#xA;" OwnerUserId="11723" LastActivityDate="2017-02-19T14:35:13.353" Title="Skew and shadow delta" Tags="&lt;options&gt;&lt;volatility&gt;&lt;delta&gt;&lt;skew&gt;&lt;forward-start&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32530" PostTypeId="2" ParentId="32529" CreationDate="2017-02-19T14:35:13.353" Score="6" Body="&lt;p&gt;Basically, the author is saying that the delta of an option, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dC/dS = \frac{\partial C}{\partial S} + \frac{\partial C}{\partial v}\frac{\partial v}{\partial S}$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the $\frac{\partial C}{\partial S}$ is the delta assuming constant volatility,  the $\frac{\partial C}{\partial v}$ is the vega of the option, and the $\frac{\partial v}{\partial S}$ describes how the implied volatility of the option moves as the spot price moves.  This second term is the &quot;shadow delta&quot; being referred to.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-02-19T14:35:13.353" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32531" PostTypeId="2" ParentId="25407" CreationDate="2017-02-19T15:24:18.667" Score="2" Body="&lt;p&gt;One more reference that I know is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://dx.doi.org/10.1080/14697680902849361&quot; rel=&quot;nofollow noreferrer&quot;&gt;Li and Lee (2009)&lt;/a&gt;&#xA;&lt;a href=&quot;https://ssrn.com/abstract=1027282&quot; rel=&quot;nofollow noreferrer&quot;&gt;[download]&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An adaptive successive over-relaxation method for computing the Black–Scholes implied volatility&lt;/p&gt;&#xA;" OwnerUserId="26559" LastActivityDate="2017-02-19T15:24:18.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32532" PostTypeId="2" ParentId="7761" CreationDate="2017-02-19T15:30:22.660" Score="6" Body="&lt;p&gt;There are some references on this topic. You may find them helpful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.jaeckel.org/&quot; rel=&quot;noreferrer&quot;&gt;Peter Jaeckel&lt;/a&gt; has articles named &quot;By Implication (2006)&quot; and &quot;Let's be rational (2013)&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://dx.doi.org/10.1080/14697680902849361&quot; rel=&quot;noreferrer&quot;&gt;Li and Lee (2009)&lt;/a&gt;&#xA;&lt;a href=&quot;https://ssrn.com/abstract=1027282&quot; rel=&quot;noreferrer&quot;&gt;[download]&lt;/a&gt;&#xA; An adaptive successive over-relaxation method for computing the Black–Scholes implied volatility&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://ssrn.com/abstract=2908494&quot; rel=&quot;noreferrer&quot;&gt;Stefanica and Radoicic (2017)&lt;/a&gt; An Explicit Implied Volatility Formula&lt;/p&gt;&#xA;" OwnerUserId="26559" LastEditorUserId="26559" LastEditDate="2017-02-21T13:53:58.480" LastActivityDate="2017-02-21T13:53:58.480" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32533" PostTypeId="2" ParentId="32527" CreationDate="2017-02-19T16:58:28.580" Score="2" Body="&lt;p&gt;Short Futures and Long Puts are the main hedging strategies for hedging an equity p'folio against a drop, so it is natural that a proposed new technique, going Long a VarSwap, is being compared to the 2 traditional techniques.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do the 2 traditional techniques differ ? When you hedge an equity p'folio with short futures, you have a constant delta. As S goes down, the amount of protection per drop in S stays constant. When you hedge with a put, the delta increases as S goes down, affording you more protection for the next drop; after S reaches K the protection is 100%. &quot;Convexity&quot; is being used synonimously with Gamma and refers to this &quot;curvature&quot; or second order change in delta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question then is does Long VarSwap resemble the Short Futures case or the Long Put case, for the purpose of comparison. The author argues that the &quot;additional protection kicking in as S goes down&quot; (the convexity) is absent in the case of VarSwap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my experience when the market is already down a lot the increases in Var become somewhat larger, so I am not sure I completely agree with the author. But it is true that the protection never becomes total, there is no guaranteed floor like with a Put. So the VarSwap is more comparable to the Future, it is an incomplete hedge.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2017-02-19T18:07:48.057" LastActivityDate="2017-02-19T18:07:48.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32534" PostTypeId="2" ParentId="32518" CreationDate="2017-02-19T19:45:48.630" Score="2" Body="&lt;p&gt;A couple engineering issues I have encountered when persisting high frequency tick data:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The database can grow quickly. For example, a busy symbol like SPY can have a couple hundred thousand trade events on an typical day. If you track all NBBO quote changes, these are about 2 to 4 times more numerous than trade events. If you track all BBO quote changes (which is included in Level 1 data) then multiply the number of events by the number of market data centers you are tracking. This can be a few million records for one symbol for one day. And on high volatility days, this traffic can double, triple, or more. &lt;/li&gt;&#xA;&lt;li&gt;There may be times when tick data is arriving faster than you can persist it to the database. Streaming tick data arrives in bursts, and is particularly busy at the market open and close. I have found that a queue processor implementing the producer consumer pattern is the best design to represent this work flow.&lt;/li&gt;&#xA;&lt;li&gt;In cases where tick data is arriving too quickly and your processor is falling behind, you will want to have bulk insert methods to help your processor catch up.&lt;/li&gt;&#xA;&lt;li&gt;Designing the data model for intraday data can be tricky. Intraday tick data is different than interday data. On the one hand this is obvious. On the other hand, I find most engineers first work with interday data and encounter intraday data problems second (myself included). Hence they bring their data models from what has worked on interday data, which is natural. Although there are similarities, intraday data often violates many of the assumptions that go into interday data models. My suggestion is in the beginning keep this code as agile as possible. Be deliberate about committing to a data model design. Where possible, leave yourself flexibility to refactor.  &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="17414" LastEditorUserId="17414" LastEditDate="2017-02-19T19:51:26.873" LastActivityDate="2017-02-19T19:51:26.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32537" PostTypeId="2" ParentId="32518" CreationDate="2017-02-19T22:56:37.573" Score="8" Body="&lt;p&gt;I've designed large data stores (sitting on about $3-10M of hardware). The challenges that @jharonfe brought up are valid, but I don't feel they're the most interesting challenges in your case (20 stocks, L1).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, there's no reason why your system, even it's very naively designed and unoptimized, should fall behind on 20 symbols.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You also mentioned missing data - you might have seen that issue brought up by some of the older, publicly available texts on how to store market data. Bear in mind these were written years ago - that's not really an issue nowadays when the exchange networks are highly overprovisioned.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a few that are worth thinking about:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Non-homogenous trade sessions.&lt;/strong&gt; For example, IBM still trades today but there was a period when its ticker stopped trading because of anti-trust investigations. People who design their data storage to handle expirations (e.g. options) tend to think about these issues more, but equities have their own peculiarities. Also, if your equities originate from different exchanges, different markets have different holiday schedules.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Survivorship bias&lt;/strong&gt;. This is a pretty obvious one. If you know after-the-fact today that you cannot trade XYZ and that's left out from your symbol universe, yet you were collecting data for XYZ 1 year ago, you're incurring survivorship bias by allowing your backtesting engine to be aware of this and be unable to backtest on XYZ 1 year ago or exclude XYZ from your search universe 1 year ago. The reason this gets challenging is that it's easy to describe but it involves interfacing several pieces of software, which people tend to avoid in the first pass of architecting their platform.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Trade breaks&lt;/strong&gt;. In certain venues, you can get info after-the-print that a trade has become nullified. This poses issues in deciding how to handle the fill in your backtest but people often ignore this type of edge case in their first pass design.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Lossiness and transactional history.&lt;/strong&gt; As you can see in a common theme between my above 3 points, the solution is often just to ignore the problem and worry about it later. This is fine so long as you don't lose the data when you come around to deal with the problem. This is one of the reasons why using a DBMS can be superior to a flat store, because many DBMSes are transactional and have a commit history.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Corporate actions.&lt;/strong&gt; Equities go through mergers and acquisitions, stock splits etc.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="4660" LastEditDate="2017-02-19T22:59:18.437" LastActivityDate="2017-02-19T22:59:18.437" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32538" PostTypeId="2" ParentId="32521" CreationDate="2017-02-20T01:19:01.593" Score="2" Body="&lt;p&gt;&lt;strong&gt;Combining the 2 Options&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The option on the floating rate loan is comparable to an option to sell credit protection on yourself (or your collateral). &lt;/li&gt;&#xA;&lt;li&gt;To value the option on the fixed loan you have to take interest and credit spread into consideration. It's comparable to a call option on a bond.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;These two options are not independent since you can exercise maximal one of them and never both. As an approximation you can simply use the higher value of the two options as joint option value. Note that this will always underestimate the real value.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Payouts:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the first 6 month your payout is &#xA;$$\max(NPV(250bp), NPV(Libor + 50bp), 0)$$&#xA;where $NPV(250bp)$ is meant to be the present value of the loan with 2.5% fixed rate and $NPV(Libor + 50bp)$ the present value of the floating rate loan. Note that I understand the $NPV$ from your perspective. Hence I used maximum and not minimum to describe the payout.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After you agreed to the loan in the 30 days period the payout becomes &#xA;$$\max(NPV(250bp), NPV(Libor + 50bp), -p) = \max(NPV(250bp+s_{p}), NPV(Libor + 50bp+s_{p}), 0) - p$$&#xA;with $s_{p}$ being the penalty $p$ expressed as a running spread. &#xA;So I think you are right, in that you can see $p$ as an option premium, but it is an premium that is payed at maturity and you have to add $s_{p}$ on the coupon of the underlying loan.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Price option 1&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www-2.rotman.utoronto.ca/~hull/DownloadablePublications/HullWhiteCDSoptionspaper.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Pricing of CDS Options&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To price a CDS Option you need to know &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;credit spread or CDS spread of yourself (or of your collateral). &lt;/li&gt;&#xA;&lt;li&gt;determine a volatility of your credit spread&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The first bullet point seems the more inmportant one, it allows you to calculate the intrinsic value of the option. You can get an idea of your credit spread if you shop around a bit and get some offers without optional components.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second part is more challenging, you need some history to determine a volatility. Otherwise you can not calculate a time value.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Price option 2&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To value an option on a fixed bond you also need your current credit spread to determine the intrinsic value and some volatility of the bond price, which is determined by credit spread and interest movement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.riskworx.com/resources/Bond%20Option%20Pricing.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Calculate Bond price volatility&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Often in these cases the credit spread is assumed to be constant, which reduces option 1 to it's intrinsic value and option 2 can be calculated with the black model using available volatilities for swaptions.&lt;/p&gt;&#xA;" OwnerUserId="22686" LastEditorUserId="22686" LastEditDate="2017-02-20T01:50:11.847" LastActivityDate="2017-02-20T01:50:11.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32539" PostTypeId="1" AcceptedAnswerId="32550" CreationDate="2017-02-20T04:33:02.210" Score="8" ViewCount="3222" Body="&lt;p&gt;I am new to QuantLib and am trying to get it to replicate some simple bond math.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose we have a 5-year bond with annual coupon payments of \$5 and face value of \$100, and interest rate of 4%. Classic calculations yield that the present value of the bond is \$104.45. When I try to do this simple example in QuantLib-Python, I get $104.70--despite my attempts to strip out calendar conventions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I use QuantLib to line up with this simple bond math?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;from QuantLib import *&#xA;&#xA;# Construct yield curve&#xA;calc_date = Date(1, 1, 2017)&#xA;Settings.instance().evaluationDate = calc_date&#xA;&#xA;spot_dates = [Date(1,1,2017), Date(1,1,2018), Date(1,1,2027)]&#xA;spot_rates = [0.0, 0.04, 0.04]&#xA;&#xA;day_count = SimpleDayCounter()&#xA;calendar = NullCalendar()&#xA;interpolation = Linear()&#xA;compounding = Compounded&#xA;compounding_frequency = Annual&#xA;spot_curve = ZeroCurve(spot_dates, spot_rates, day_count, calendar, interpolation, compounding, compounding_frequency)&#xA;&#xA;spot_curve_handle = YieldTermStructureHandle(spot_curve)&#xA;&#xA;# Construct bond schedule&#xA;issue_date = Date(1, 1, 2017)&#xA;maturity_date = Date(1, 1, 2022)&#xA;tenor = Period(Semiannual)&#xA;calendar = NullCalendar()&#xA;business_convention = Unadjusted&#xA;date_generation = DateGeneration.Backward&#xA;month_end = False&#xA;&#xA;schedule = Schedule(issue_date, maturity_date, tenor, calendar, business_convention, business_convention, date_generation, month_end)&#xA;&#xA;# Create FixedRateBond Object&#xA;&#xA;coupon_rate = 0.05&#xA;coupons = [coupon_rate]&#xA;settlement_days = 0&#xA;face_value = 100&#xA;&#xA;fixed_rate_bond = FixedRateBond(settlement_days,&#xA;                                face_value,&#xA;                                schedule,&#xA;                                coupons,&#xA;                                day_count)&#xA;&#xA;# Set Valuation engine&#xA;bond_engine = DiscountingBondEngine(spot_curve_handle)&#xA;fixed_rate_bond.setPricingEngine(bond_engine)&#xA;&#xA;# Calculate present value&#xA;value = fixed_rate_bond.NPV()&#xA;print(value)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="17936" LastActivityDate="2019-11-20T03:06:37.020" Title="Simple QuantLib Bond Math" Tags="&lt;bond&gt;&lt;python&gt;&lt;quantlib&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="32540" PostTypeId="2" ParentId="4687" CreationDate="2017-02-20T06:45:24.483" Score="2" Body="&lt;p&gt;@Matt Wolf has some good information.&lt;/p&gt;&#xA;&lt;p&gt;In regards to your comment of 'trading against other clients'; to avoid this you will want to participate in a &amp;quot;true ECN&amp;quot;.  Believe it or not, that might require expensive setup (minimum flow requirements, minimum order sizes, etc) especially if the flow is anonymous. &lt;a href=&quot;https://www.hotspotfx.com/products/the_hotspot_ecn.jsp&quot; rel=&quot;nofollow noreferrer&quot;&gt;HotspotFx&lt;/a&gt; might offer some insight.   according to their own faq and also talking with brokers who actually connect to Hotspot, it is not very useful if you are not going to trade avg 100k minimum sizes (1.00 lot on mt4).  You can customize feeds to get avg 1-10Mil top of book, but it would cost you.  If you are looking to 'test' then you need to start with a quality retail broker who can give you PoP access.&lt;/p&gt;&#xA;&lt;p&gt;I think your search of the avg retail fx broker revealed &lt;strong&gt;brokers who internalize nearly 100% of their flow, with no intention of actually making a market legitimately&lt;/strong&gt; (the proverbial '&lt;a href=&quot;https://www.bloomberg.com/view/articles/2013-01-10/how-bucket-shops-lured-the-masses-into-the-market&quot; rel=&quot;nofollow noreferrer&quot;&gt;bucketshop&lt;/a&gt;') The OTC retail forex community does indeed have numerous conflicts of interest for the beginner trader.  It's kind of like asking the casino how to blackjack is played.  They can only provide the most basic rules.  If they were to go in depth into how the cards were shuffled, why they serve you 'free' alcoholic beverages, etc. you could use that to develop an informed strategy (play to win against the house).  Since the majority of casino games operate on a 'you lose, I win' profit model, the best way to manage the conflict of interest is &lt;em&gt;to avoid playing at such venues&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;A [bucket shop] retail forex broker has a similar 'broker profits = client loses' business model.  So they have every incentive to give you information that makes you trade against yourself; your 'losses' become their 'profit', your profits = broker losses; and in some cases they will just cancel your trades and send you on your way.  The correct way to make the market is to emulate market prices from Prime Broker/PoP add to spread or charge commission, match orders internally, and then send net exposure off to a wholesaler.  &lt;strong&gt;In some rare cases, a retail broker will have a 100% agency model in place, and can prove so with proper post-trade reporting and a willingness to elaborate on specifics of the technology and practices they use to actually broker your order flow&lt;/strong&gt;.  To compare to a casino running a 100% agency model, it would be like a tournament or cash game where casino earns a rake for each game played.   The casino doesn't worry about the edge of the players as they are playing against themselves. Casino only needs to provide the venue, dealer, etc for the event and take a commission for doing so.&lt;/p&gt;&#xA;&lt;p&gt;To be fair, most retail brokers do not attract enough volume to operate profitably enough with pure agency model, or to completely offset (match) all orders in-house.  Especially with increasing regulatory costs.  Don't count on them telling you this though; they go through great lengths to mask their true business model and in some cases outright lie to their clients that they do not run a b-book, are STP/ECN/NDD, etc. They can easily create an offshore or hidden entity to STP their flow to or have deal with LP to receive rebate of losses. FXCM is the most high profile example of this (google &lt;code&gt;fxcm trades against clients&lt;/code&gt;; FinanceFeeds article).&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;For USA residents, &lt;code&gt;Interactive Brokers&lt;/code&gt; &lt;em&gt;was&lt;/em&gt; the last hope for&#xA;cheap, direct market access; FXCM had active trader acct (raw&#xA;spreads), but you read what happened.  Gain Capital (forex.com) and&#xA;Oanda is all that is left [huge sigh].  You could ask for a 'raw&#xA;spreads' account if you meet certain minimum deposits or volume, but&#xA;&lt;em&gt;can you be sure&lt;/em&gt; they are not 'trading against you'?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Non US residents still have &lt;code&gt;LMAX&lt;/code&gt;, &lt;code&gt;Global Prime Au&lt;/code&gt;, &lt;code&gt;FxPIG&lt;/code&gt;, and a few&#xA;others to pick from (I keep a private list).  Most public lists end&#xA;up spammy or blatantly advertise numerous bucket shops anyway because&#xA;advertising dollars trump honest information (yet another conflict of&#xA;interest). Pretty much you have either &lt;code&gt;Metatrader 4&lt;/code&gt; or &lt;code&gt;FIX API + your own platform&lt;/code&gt;, but honestly a good broker could customize your mt4 feed so&#xA;you can avoid having to dabble with FIX messaging protocols which can&#xA;actually vary from broker to broker.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Once you get an honest broker sorted, then you focus on actual trading and algo development.  &lt;strong&gt;&lt;em&gt;Algo development&lt;/em&gt; and &lt;em&gt;actual trading&lt;/em&gt; are what should be consuming the majority of your time.&lt;/strong&gt;   Avoid &lt;a href=&quot;https://www.forexpeacearmy.com/community/threads/resolved-ic-markets-dont-trust-them-with-your-trading.60160/post-349279&quot; rel=&quot;nofollow noreferrer&quot;&gt;fake ECNs&lt;/a&gt; at all cost.....and there are a lot of them out there waiting to pounce on retail money.&lt;/p&gt;&#xA;" OwnerUserId="2566" LastEditorUserId="2566" LastEditDate="2020-07-14T05:03:40.610" LastActivityDate="2020-07-14T05:03:40.610" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="32541" PostTypeId="2" ParentId="9527" CreationDate="2017-02-20T07:46:07.273" Score="1" Body="&lt;p&gt;&lt;strong&gt;The larger fear is always trading against a more informed player than yourself.&lt;/strong&gt;  &lt;strong&gt;&lt;code&gt;Informed&lt;/code&gt;&lt;/strong&gt;&lt;code&gt;=&lt;/code&gt;&lt;em&gt;&lt;code&gt;right knowledge&lt;/code&gt;&lt;/em&gt;&lt;code&gt;of market direction +&lt;/code&gt;&lt;em&gt;&lt;code&gt;willingness&lt;/code&gt;&lt;/em&gt;&lt;code&gt;to act/react timely to capitalize on momentum.&lt;/code&gt;  This includes taking into account unexpected volatility of flash crashes, news announcements, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your example, yes, it is possible to already hold a position on your books OR be obligated to hold a position (resting limit order, minimum avg daily/monthly volume requirements, etc), and then get caught in a sharp price move, resulting in &lt;em&gt;individual&lt;/em&gt; trade losses.  But part of inventory management that @pteetor eludes to requires that you strategically hold losing positions until you can offset them at a &lt;strong&gt;&lt;em&gt;net&lt;/em&gt;&lt;/strong&gt; gain (see &lt;a href=&quot;http://www.investopedia.com/terms/l/lossleader.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;loss leadership&lt;/a&gt;).  So it is common for market makers (stated or de-facto) to use some sort of cost averaging so that they spread the risk out over several trades.   Maybe this screenshot will help illustrate:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/3iw3o.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/3iw3o.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In theory, it is unlikely that the market will go to &quot;ZERO&quot;; so the fundamental value must eventually revert.   But remember SNB?  It's the holding of the positions in between reversions that could be &quot;scary&quot; and requires proper risk management.&lt;/p&gt;&#xA;" OwnerUserId="2566" LastActivityDate="2017-02-20T07:46:07.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32542" PostTypeId="1" CreationDate="2017-02-20T10:34:52.523" Score="2" ViewCount="836" Body="&lt;p&gt;As we all know, all affine term-structure models are members of HJM model. Under HJM model, there is a unique risk-neutral measure in both forward-rate process and bond evolving process. Hence, the model is complete. However, there is no unique risk-neutral measure in short rate models like Vasicek, CIR model (the measure is adjusted by the parameter lambda). Thus, the model is incomplete. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is: How to justify the existence and absence of a unique risk-neutral measure in forward rate models (HJM) and short-rate models (Vasicek) respectively? Are there any contradictions?&lt;/p&gt;&#xA;" OwnerUserId="26649" LastEditorUserId="24222" LastEditDate="2017-02-20T11:07:49.787" LastActivityDate="2017-10-20T20:48:27.697" Title="Risk neutral measure of short rate model" Tags="&lt;bond&gt;&lt;risk-neutral-measure&gt;&lt;forward-rate&gt;&lt;short-rate&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32543" PostTypeId="1" CreationDate="2017-02-20T13:22:36.917" Score="2" ViewCount="1265" Body="&lt;p&gt;For a vanilla bond, as coupon goes down ,absolute duration goes up, but absolute dv01(absolute change in price for a 1bp increase in rates ) goes down.  so ... what is the message to take away from this...   which is riskier!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps the answer to my question is , that it depends on what matters to you: your % return on investment, or your dollar P&amp;amp;L. For % ROI , duration is the measure to use , and for dollar P&amp;amp;L, DV01 is the one to use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would think that traders would care more about dollar P&amp;amp;L since the traders job is to hedge the market risk over the life of the trade , so my follow up q is - why do Bond traders look at duration rather than DV01 ?&lt;/p&gt;&#xA;" OwnerUserId="17348" LastEditorUserId="848" LastEditDate="2017-02-21T13:17:03.297" LastActivityDate="2017-02-23T15:27:33.733" Title="Duration and DV01 vs coupon rate" Tags="&lt;duration&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32544" PostTypeId="1" AcceptedAnswerId="32715" CreationDate="2017-02-20T13:44:55.930" Score="2" ViewCount="779" Body="&lt;p&gt;For learning purpose, I'm trying to price, with &lt;a href=&quot;http://quantlib.org/index.shtml&quot; rel=&quot;nofollow noreferrer&quot;&gt;quantlib&lt;/a&gt;, an European option using the &lt;em&gt;Cox-Ross-Rubinstein tree approach&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some examples are provided in the file &lt;code&gt;EquityOption.cpp&lt;/code&gt; that is part of the library.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I would like to price it, &lt;strong&gt;without&lt;/strong&gt; using dates (that is to say, without any day convention, calendar, expiration date ...) but using &lt;em&gt;only&lt;/em&gt; a fraction of year as maturity  (ex : with &lt;code&gt;T = 0.5&lt;/code&gt; ). &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;As far I read, all examples only consider the case with dates&#xA;  expressed as &quot;real&quot; dates (ex : 11/01/2016) and not expressed as time&#xA;  to maturity (ex: T= 0.1), i.e. the standard textbook case.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Since the library relies heavily on engines, and that those engines are mainly designed with dates, I have some difficulties to get rid off the dates.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the BS analytical formula, it is easy since the core of the engine relies on the &lt;a href=&quot;http://quantlib.org/reference/class_quant_lib_1_1_black_scholes_calculator.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;BlackScholesCalculator&lt;/a&gt; that is dates independent (see a &lt;a href=&quot;https://mhittesdorf.wordpress.com/2013/07/29/introducing-quantlib-black-scholes-and-the-greeks/&quot; rel=&quot;nofollow noreferrer&quot;&gt; full example here&lt;/a&gt;) . &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However for the binomial case, there is no such date-independent routine (no BinomialCalculator..),  and the &lt;code&gt;DiscretizedVanillaOption&lt;/code&gt; class requires an engine's variable as input to instantiate it..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One plausible solution that came to my mind is to find two &quot;fakes&quot; dates, by playing with a pseudo &lt;code&gt;.yearFraction(FakeStartDate, FakeEndDate);&lt;/code&gt; function to find two optimal dates that match the fraction I want. Then to use these two dates to compute the price. However this strategy seems quiet cumbersome for a such simple request.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I compute the value of an option using the binomial approach with a maturity expressed as a fraction of year in quantlib ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please see below what I have done so far, I'm stuck to the line that instantiate the &lt;code&gt;DiscretizedVanillaOption&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    Calendar calendar      = NullCalendar();             &#xA;    DayCounter dayCounter  = SimpleDayCounter();&#xA;    Date t0(1);     &#xA;    Option::Type type = Option::Put;&#xA;    Real S0 = spot_;&#xA;    Real K = strike_;&#xA;    Spread q =  dividendYield_;&#xA;    Rate r = interestRate_;&#xA;    Volatility sigma = volatility_;&#xA;&#xA;    Settings::instance().evaluationDate() = t0;&#xA;    Handle&amp;lt;Quote&amp;gt; underlyingH((boost::static_pointer_cast&amp;lt;Quote&amp;gt;(boost::make_shared&amp;lt;SimpleQuote&amp;gt;(S0))));&#xA;    Handle&amp;lt;YieldTermStructure&amp;gt; flatDividendTS((boost::static_pointer_cast&amp;lt;YieldTermStructure&amp;gt;(boost::make_shared&amp;lt;FlatForward&amp;gt;(t0, q, dayCounter))));&#xA;    Handle&amp;lt;YieldTermStructure&amp;gt; flatTermStructure((boost::static_pointer_cast&amp;lt;YieldTermStructure&amp;gt;(boost::make_shared&amp;lt;FlatForward&amp;gt;(t0, r, dayCounter))));&#xA;    Handle&amp;lt;BlackVolTermStructure&amp;gt; flatVolTS((boost::static_pointer_cast&amp;lt;BlackVolTermStructure&amp;gt;(boost::make_shared&amp;lt;BlackConstantVol&amp;gt;(t0, calendar, sigma, dayCounter))));&#xA;    boost::shared_ptr&amp;lt;BlackScholesMertonProcess&amp;gt; bsmProcess(new BlackScholesMertonProcess(underlyingH, flatDividendTS, flatTermStructure, flatVolTS));&#xA;    boost::shared_ptr&amp;lt;StrikedTypePayoff&amp;gt; payoff(new PlainVanillaPayoff(type, K));&#xA;&#xA;    Size timeSteps_ = 200;&#xA;    Time maturity = 0.2;&#xA;    TimeGrid grid(maturity, timeSteps_);    &#xA;    boost::shared_ptr&amp;lt;CoxRossRubinstein&amp;gt; tree(new CoxRossRubinstein(bsmProcess, maturity, timeSteps_,  payoff-&amp;gt;strike()));&#xA;    boost::shared_ptr&amp;lt;BlackScholesLattice&amp;lt;CoxRossRubinstein&amp;gt; &amp;gt; lattice( new BlackScholesLattice&amp;lt;CoxRossRubinstein&amp;gt;(tree, r, maturity, timeSteps_));&#xA;&#xA;    DiscretizedVanillaOption option(/* ????*/,bsmProcess, grid);//&amp;lt;--------- First argument Here ?&#xA;&#xA;    option.initialize(lattice, maturity);&#xA;    double price = option.presentValue();&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2017-02-27T14:24:53.997" LastActivityDate="2017-02-27T14:24:53.997" Title="Using the binomial-tree approach to price an option in quantlib - with time expressed as a fraction of year" Tags="&lt;quantlib&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32546" PostTypeId="1" CreationDate="2017-02-20T14:59:08.037" Score="-1" ViewCount="1115" Body="&lt;p&gt;I need data such as Net Income, ROA, ROE, etc. for companies in S&amp;amp;P 500 Index. I would like to see the values also for other years, e.g., since 2010. However, when I log-in to Thomson Reuters Eikon and click on S&amp;amp;P 500 Index -&gt; constituents analysis -&gt; fundamentals, I see only a snapshot of current values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I obtain also historical data? If yes, how?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Aneta&lt;/p&gt;&#xA;" OwnerUserId="26652" LastActivityDate="2017-10-20T05:46:37.447" Title="Where to find historical fundamental data of S&amp;P constituents in Thomson Reuters database?" Tags="&lt;time-series&gt;&lt;historical-data&gt;&lt;database&gt;&lt;fundamentals&gt;&lt;reuters&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32547" PostTypeId="2" ParentId="32543" CreationDate="2017-02-20T15:01:03.630" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;Per USD invested, the lower coupon bond is risker. &lt;/li&gt;&#xA;&lt;li&gt;Per USD face value, the higher coupon bond is riskier. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;2.) is trivial because the higher coupon bond constitutes of the original bond plus a series of positive coupons. The two has the same sign of their its risk, i.e. they lose present value with higher yield. So the higher coupon bond is riskier, it has the risk of the lower coupon bond plus the risk of the extra coupons.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at 1.) and partitioning it into the repayment and the coupons; consider that that the repayment is riskier per amount invested as it is longer than the coupons. Then a reallocation towards the repayment through decreasing the coupons is a reallocation towards the riskier constituent, hence lower coupons increse the relative risk. &lt;/p&gt;&#xA;" OwnerUserId="23886" LastEditorUserId="23886" LastEditDate="2017-02-22T09:05:47.333" LastActivityDate="2017-02-22T09:05:47.333" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32548" PostTypeId="2" ParentId="32542" CreationDate="2017-02-20T15:02:23.890" Score="2" Body="&lt;p&gt;The Vasicek and other short rate models are only &quot;incomplete&quot; until they are calibrated to market data.  If rates actually followed Vasicek processes, it would be trivial to estimate the &quot;Real world&quot; parameters from historical data and compute the &quot;Risk neutral&quot; parameters from the yield curve.  In such a case the HJM and Vasicek models are simply two way of looking at the same thing: there is no contradiction.  HJM is a &quot;family&quot; of models in which Vasicek fits nicely.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, it is pretty easy to see that the Vasicek model does not, in fact, fit the empirical yield curve.  In this case the HJM model will disagree with the Vasicek model since HJM perfectly fits the initial term structure.  &lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2017-02-20T15:02:23.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32550" PostTypeId="2" ParentId="32539" CreationDate="2017-02-20T15:42:34.097" Score="11" Body="&lt;p&gt;To begin with, as Student T suggested, you can check that the cashflows are those you expect:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for c in fixed_rate_bond.cashflows():&#xA;    print '%20s %12f' % (c.date(), c.amount())&#xA;&#xA;      July 1st, 2017     2.500000&#xA;   January 1st, 2018     2.500000&#xA;      July 1st, 2018     2.500000&#xA;   January 1st, 2019     2.500000&#xA;      July 1st, 2019     2.500000&#xA;   January 1st, 2020     2.500000&#xA;      July 1st, 2020     2.500000&#xA;   January 1st, 2021     2.500000&#xA;      July 1st, 2021     2.500000&#xA;   January 1st, 2022     2.500000&#xA;   January 1st, 2022   100.000000&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;They seem ok, so the problem must be in the discount curve.  One problem is that you're instantiating it as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;spot_dates = [Date(1,1,2017), Date(1,1,2018), Date(1,1,2027)]&#xA;spot_rates = [0.0, 0.04, 0.04]&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But that means that zero rates will be interpolated between 0.0 and 0.04 during the first year, and of course that gives you wrong discount factors; so you should use&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;spot_dates = [Date(1,1,2017), Date(1,1,2018), Date(1,1,2027)]&#xA;spot_rates = [0.04, 0.04, 0.04]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;instead.  That gives a price of \$104.67, though, which is still not what you want.  The next issue is that you're initializing the curve with a 4% rate and an annual compounding frequency; this gives you discount factors equal to $B(T) = 1/(1+R)^T$, which you can verify:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for i, c in enumerate(fixed_rate_bond.cashflows()):&#xA;    T = day_count.yearFraction(calc_date, c.date())&#xA;    B = 1/math.pow(1.04, T)&#xA;    print '%20s %12f %12f %12f %12f' % (c.date(), c.amount(), T,&#xA;                                        B, spot_curve.discount(c.date()))&#xA;&#xA;      July 1st, 2017     2.500000     0.500000     0.980581     0.980581&#xA;   January 1st, 2018     2.500000     1.000000     0.961538     0.961538&#xA;      July 1st, 2018     2.500000     1.500000     0.942866     0.942866&#xA;   January 1st, 2019     2.500000     2.000000     0.924556     0.924556&#xA;      July 1st, 2019     2.500000     2.500000     0.906602     0.906602&#xA;   January 1st, 2020     2.500000     3.000000     0.888996     0.888996&#xA;      July 1st, 2020     2.500000     3.500000     0.871733     0.871733&#xA;   January 1st, 2021     2.500000     4.000000     0.854804     0.854804&#xA;      July 1st, 2021     2.500000     4.500000     0.838204     0.838204&#xA;   January 1st, 2022     2.500000     5.000000     0.821927     0.821927&#xA;   January 1st, 2022   100.000000     5.000000     0.821927     0.821927&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since you have semiannual coupons, you probably wanted to use a semiannual compounding frequency, too. That gives you discount factors $B(t) = 1/\left(1+\frac{R}{2}\right)^{2T}$:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for i, c in enumerate(fixed_rate_bond.cashflows()):&#xA;    T = day_count.yearFraction(calc_date, c.date())&#xA;    B = 1/math.pow(1.02, 2*T)&#xA;    print '%20s %12f %12f %12f %12f' % (c.date(), c.amount(), T,&#xA;                                        B, spot_curve.discount(c.date()))&#xA;&#xA;      July 1st, 2017     2.500000     0.500000     0.980392     0.980392&#xA;   January 1st, 2018     2.500000     1.000000     0.961169     0.961169&#xA;      July 1st, 2018     2.500000     1.500000     0.942322     0.942322&#xA;   January 1st, 2019     2.500000     2.000000     0.923845     0.923845&#xA;      July 1st, 2019     2.500000     2.500000     0.905731     0.905731&#xA;   January 1st, 2020     2.500000     3.000000     0.887971     0.887971&#xA;      July 1st, 2020     2.500000     3.500000     0.870560     0.870560&#xA;   January 1st, 2021     2.500000     4.000000     0.853490     0.853490&#xA;      July 1st, 2021     2.500000     4.500000     0.836755     0.836755&#xA;   January 1st, 2022     2.500000     5.000000     0.820348     0.820348&#xA;   January 1st, 2022   100.000000     5.000000     0.820348     0.820348&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this further correction, the price is \$104.49, which is still 4 bps higher than you expect.  But at this point, you might want to check your classic calculations, too...&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2017-02-20T15:42:34.097" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32551" PostTypeId="2" ParentId="32104" CreationDate="2017-02-20T17:48:04.923" Score="-2" Body="&lt;p&gt;The expectation of an Itô integral (and a Wiener integral) is always zero.&lt;/p&gt;&#xA;" OwnerUserId="26572" LastActivityDate="2017-02-20T17:48:04.923" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32555" PostTypeId="1" CreationDate="2017-02-20T21:33:21.350" Score="2" ViewCount="355" Body="&lt;p&gt;Could someone explain to me why the regular call pricing formula works, just with $\sigma$ replaced by $\|\sigma\|$ in the case where the underlying asset depends on two Wiener processes?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, we might have had a model with two risky assets, and therefore two Wiener processes, in order to ensure no-arbitrage and completeness. And then we may be interested in a call option on only one of these stocks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am reading my textbook, and in it, it merely uses the regular formula for call option pricing, except it takes a norm of the two-dimensional volatility vector. But, it does not prove why this is the correct approach. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Here's the picture of the text:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ExI1g.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ExI1g.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;As you can see, he merely plugs in $\sigma_{S^f}$ (two-dimensional) in place of $\sigma$, in the regular call price formula, which is given as follows:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/91z14.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/91z14.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26651" LastEditorUserId="467" LastEditDate="2017-02-21T02:40:07.580" LastActivityDate="2017-02-21T02:40:07.580" Title="How to price a call option which depends on two Wiener processes?" Tags="&lt;options&gt;&lt;stochastic-calculus&gt;&lt;call&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32556" PostTypeId="2" ParentId="17330" CreationDate="2017-02-20T22:15:18.207" Score="1" Body="&lt;p&gt;There could be a number of reasons, let go over this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, your sample (the 10 portfolios) might differ from the sample FF used to compute the SMB factor. May be you're using a smaller market or sector? To check this look at the average beta's of your regressions or regress your full sample on the SMB factor. If your market consists of smaller stocks than used by FF it's likely that you have SMB exposure on all your portfolios &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, equally weighting introduces a small cap bias as small companies have a similar influence on the portfolio as large firms. Of course you can download the equally weighted SMB factor from French's website but my experience is that doesn't work very well unless your sample is similar to theirs&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Third, the presence of the SMB factor varies over time so plot the FF SMB factor and select a period in which the SMB factor performed well and then use that period as window for your regressions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution would be to create your own SMB factor specific to your sample. &lt;/p&gt;&#xA;" OwnerUserId="18070" LastActivityDate="2017-02-20T22:15:18.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32557" PostTypeId="2" ParentId="32555" CreationDate="2017-02-20T22:29:06.740" Score="3" Body="&lt;p&gt;Let $\sigma \in \mathbb{R}_n^n$ and let $W$ be an n-dimensional standard Brownian motion. Define a new one-dimensional process $\tilde{W}$ by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\tilde{W}_t = \frac{1}{\vert \vert \sigma \vert \vert} \sum_{i = 1}^n \sigma_i W_t^{(i)}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then it is easy to show that $\tilde{W}$ is a continuous martingale, starting at $\tilde{W}_0 = 0$ and with quadratic variation $\mathrm{d} \langle \tilde{W} \rangle_t = \mathrm{d}t$. It follows by Levy's characterization theorem that $\tilde{W}$ is a standard one-dimensional Brownian motion. Consequently, $S$ follows a geometric Brownian motion with respect to $\tilde{W}$ and diffusion coefficient $\vert \vert \sigma \vert \vert$, i.e&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\mathrm{d}S_t &amp;amp; = &amp;amp; r S_t \mathrm{d}t + S_t \sum_{i = 1}^n \sigma_i \mathrm{d}W_t^i\\&#xA;&amp;amp; = &amp;amp; r S_t \mathrm{d}t + \vert \vert \sigma \vert \vert S_t \mathrm{d}\tilde{W}_t,&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the usual Black-Scholes result applies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you could note that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\sum_{i = 1}^n \sigma_i W_t^{(i)}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is a sum of $n$ independent normal random variables. Thus, it is normally distributed with mean zero and variance&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\sum_{i = 1}^n \sigma_i^2 t = \vert \vert \sigma \vert \vert^2 t.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consequently,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\ln S_t \sim \mathcal{N} \left( S_0 + \left( r - \frac{1}{2} \vert \vert \sigma \vert \vert^2 \right) t, \vert \vert \sigma \vert \vert^2 t\right)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and again the usual Black-Scholes analysis applies.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2017-02-20T22:29:06.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32559" PostTypeId="2" ParentId="11224" CreationDate="2017-02-20T23:52:29.003" Score="3" Body="&lt;p&gt;What about frontend like &lt;a href=&quot;https://www.multicharts.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;MultiCharts&lt;/a&gt; or &lt;a href=&quot;https://ninjatrader.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;NinjaTrader&lt;/a&gt;? Or even a cheaper one like &lt;a href=&quot;https://www.sierrachart.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;SierraChart&lt;/a&gt; or &lt;a href=&quot;https://www.amibroker.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;AmiBroker&lt;/a&gt;?  There is also &lt;a href=&quot;https://spotware.com/ctrader/trading/ctrader-automated-trading-platform&quot; rel=&quot;nofollow noreferrer&quot;&gt;cTrader Automate (cAlgo)&lt;/a&gt; and &lt;a href=&quot;https://protrader.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;ProTrader PTMC&lt;/a&gt;.  All of these are specifically built for real time trading of derivatives, including hooking up to a broker like Interactive Brokers, Lmax, etc. And they have their own programming language with built-in backtesting capabilities.  Since you mentioned stocks, MC lifetime license is likely the better investment long term.  Sierra Chart is also very stable and has lots of integration already.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Retail Fx is currently dominated by &lt;a href=&quot;https://www.metatrader4.com/en/trading-platform&quot; rel=&quot;nofollow noreferrer&quot;&gt;Metatrader 4&lt;/a&gt;....but if the broker allows FIX or other api, you can still use MultiCharts or the other charting apps.  The worst that can happen is that you have to switch brokers, but you should be able to reconnect the algo (which will run a similar trading platform) to the new broker.  In the case of mt4/mt5, you just move your strategy (called Expert Advisor or EA) to the new broker's mt4/mt5 instance (or just copy the new broker's &lt;code&gt;[server].SRV file&lt;/code&gt; to the existing mt4/5 and &quot;open an account&quot;  add new &lt;code&gt;[server]&lt;/code&gt; name and it should ping after a few seconds.&lt;br&gt;&#xA;Yeah, just easier to do a new mt4 installation with new broker's setup file) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's worth mentioning that &lt;a href=&quot;https://www.metatrader5.com/en/trading-platform&quot; rel=&quot;nofollow noreferrer&quot;&gt;metatrader 5&lt;/a&gt; (five) may eventually overtake mt4, and it is setup to handle multiple asset classes (stocks, futures, forex, etc).  Like mt4, it is free to the end user.  Unfortunately, MQL5 is not backwards compatible with MQL4 and MT5 cannot import or run compiled mql4 strategies.  You could actually rig mt4 to backtest stocks/futures if you have tick data available (or 1 min bars if tick data is unimportant); so basically making your platform investment minimal as mt4 is free.  Also, mt4/mt5 is configured on the broker side.  So the trader only has to open the platform and begin their analysis or trading.  And it is incredibly easy to migrate from one broker to another.  Of course, choosing a trustworthy broker is much more important, but that's a separate topic of discussion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many of the answers put forward so far seem to focus on the user spending a lot of time either building their own trading platform or having to spend a lot of time to connect a platform.  Maintaining an independent trading platform is a complex, expensive endeavor. IMO there is no reason to reinvent the wheel &lt;strong&gt;&lt;code&gt;^^&lt;/code&gt;&lt;/strong&gt;; &lt;strong&gt;spend that time developing and testing your algos in a deployable environment.&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;^^&lt;/code&gt;(not recommended) &lt;/p&gt;&#xA;&#xA;&lt;blockquote class=&quot;spoiler&quot;&gt;&#xA;  &lt;p&gt; But if you want to have a go at your own proprietary platform consider &lt;a href=&quot;http://www.modulusfe.com/products/trading-platforms/m4-winform/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Modulus M4 platform + source code&lt;/a&gt; to get you going. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Updated 06 June 2018 to add urls and mention a few more platforms.&lt;/p&gt;&#xA;" OwnerUserId="2566" LastEditorUserId="2566" LastEditDate="2018-06-06T04:46:08.080" LastActivityDate="2018-06-06T04:46:08.080" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="32560" PostTypeId="1" CreationDate="2017-02-21T03:54:32.003" Score="1" ViewCount="598" Body="&lt;p&gt;I am trying to do a financial time series forecast in order to build a portfolio. I already have some code running rugarch library and I am not sure if I am forecasting correctly, after that I would like to use the sigmas (or maybe the fitted values) in order to calculate a covariance matrix so I can build a portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;R code for forecasting&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  gcarso.prices=get.hist.quote(&#xA;  instrument=&quot;GCARSOA1.MX&quot;,&#xA;  start=&quot;2000-01-01&quot;,&#xA;  end=&quot;2016-08-03&quot;,&#xA;  quote = &quot;Close&quot;,&#xA;  provider = c(&quot;yahoo&quot;), method = NULL,&#xA;  origin = &quot;1899-12-30&quot;, compression = &quot;d&quot;,&#xA;  retclass = c(&quot;zoo&quot;), quiet = FALSE, drop = FALSE&#xA;)&#xA;gcarso=as.data.frame(gcarso.prices)&#xA;&#xA;N=length(gcarso[,1])&#xA;gcarso.returns=100*(log(gcarso[2:N,])-log(gcarso[1:(N-1),]))&#xA;time &amp;lt;- index(gcarso.prices[2:N])&#xA;gcarso.xts &amp;lt;- na.omit(xts(x = gcarso.returns, order.by = time))&#xA;&#xA;#Model and forecast    &#xA;model=ugarchspec (&#xA;  variance.model = list(model = &quot;sGARCH&quot;, garchOrder = c(1, 1)),&#xA;  mean.model = list(armaOrder = c(1, 1)),&#xA;  distribution.model = &quot;norm&quot;&#xA;)&#xA;modelfit=ugarchfit(model,data=gcarso.xts,out.sample=10)&#xA;modelfor=ugarchforecast(modelfit, data = NULL, n.ahead = 1, n.roll&#xA;                        = 10, out.sample = 10)&#xA;fitted(modelfor)&#xA;sigma(modelfor)&#xA;fpm(modelfor)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; fitted(modelfor)&#xA;    2016-07-20 2016-07-21 2016-07-22 2016-07-25 2016-07-26 2016-07-27 2016-07-28 2016-07-29 2016-08-01 2016-08-02 2016-08-03&#xA;T+1  -0.245073 0.03921982  0.0120029  0.1588765  0.4137586  0.4635337  0.3734044  0.3273671  0.2226516  0.3274746  0.2945644&#xA;&amp;gt; sigma(modelfor)&#xA;    2016-07-20 2016-07-21 2016-07-22 2016-07-25 2016-07-26 2016-07-27 2016-07-28 2016-07-29 2016-08-01 2016-08-02 2016-08-03&#xA;T+1   1.607644    1.65467   1.601347   1.593421   1.733585   1.718388   1.656873   1.603244   1.554496    1.56264   1.517701&#xA;&amp;gt; fpm(modelfor)&#xA;       MSE       MAE DAC&#xA;1 1.368462 0.9172632 0.6&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I calculated MAPE (Mean Average Percentage Error) and it was very high (more than 100%), I would like to know if I am doing something wrong at the forecast or if its just normal to have a very bad accuracy?.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, if I were to use the sigmas how should I use them in order to build a covariance matrix (I am doing the same procedure as above with 5 more time series)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="20720" LastActivityDate="2017-02-21T03:54:32.003" Title="Forecasting volatility with rugarch and Covariance Matrix" Tags="&lt;time-series&gt;&lt;programming&gt;&lt;garch&gt;&lt;portfolio&gt;&lt;forecast&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32561" PostTypeId="2" ParentId="7527" CreationDate="2017-02-21T04:39:03.047" Score="0" Body="&lt;p&gt;The use case for a perpetual option that I familiar with is equity. In the analogy, equity is a call on the value of a firm. The problem is that the underlying (firm value) is not directly &quot;trade-able&quot;, which is a requirement for the no-arbitrage principle, which is turn a fundamental precept of risk-neutral hedging. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can infer the value of a firm by summing the value of equity, debt, capital/operating leases, and non-controlling interests. But even then, the analogy is not perfect since it assumes that the stochasticity of the underlying can be described by a Levy Flight (i.e., following Geometric Brownian Motion in continuous time). This may not be the case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you can somehow: a) isolate the risky part of the business which has properties of a Levy Flight; and, b) determine a terminal time value at which the underlying cash flow reach an economic limit (independent of the uncertainty), you can then use the Black and Scholes as is. It is when you cannot determine the terminal time that one must adjust the formula for infinite expiry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think it's key to keep in mind that a perpetual option is just a model which is useful in as far it describes reality; is not necessarily a perfect representation of reality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope that helps. If you want more, I would suggest the following paper as a reference: &lt;a href=&quot;http://people.stern.nyu.edu/plakner/papers/perpetual.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://people.stern.nyu.edu/plakner/papers/perpetual.pdf&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastActivityDate="2017-02-21T04:39:03.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32562" PostTypeId="1" CreationDate="2017-02-21T04:52:51.907" Score="2" ViewCount="79" Body="&lt;p&gt;Can anyone tell me why we can neglect the mean in the variance when the time step is very small? See the following picture:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/AHrr1.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/AHrr1.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually, we choose a time step of one day. Is it small enough?&lt;/p&gt;&#xA;" OwnerUserId="26165" LastEditorUserId="19645" LastEditDate="2017-02-21T19:16:04.860" LastActivityDate="2017-02-21T19:16:04.860" Title="Why can we neglect the mean in the variance when the time step is very small?" Tags="&lt;high-frequency&gt;&lt;variance&gt;&lt;mean&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32564" PostTypeId="2" ParentId="32544" CreationDate="2017-02-21T08:42:47.030" Score="4" Body="&lt;p&gt;I'm afraid you'll have to use fake dates, as you mentioned.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To make the process less cumbersome, you can use a day counter with a simple formula such as Act/360.  Given a start date, it will make it easier to determine the corresponding end date (&lt;code&gt;startDate+36&lt;/code&gt; for T=0.1, &lt;code&gt;startDate+180&lt;/code&gt; for T=0.5 and so on) without having to play with candidates.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2017-02-21T08:42:47.030" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32566" PostTypeId="1" CreationDate="2017-02-21T10:03:12.507" Score="-1" ViewCount="351" Body="&lt;p&gt;Is there a way to go from this&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\ln S_t=\ln S_0+(\mu-\sigma^2/2)t+\sigma W_t $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\ln S_t\sim N[\ln S_0+(\mu-\sigma^2/2)t, (\sigma^2)t]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To the Black-Scholes partial differential equation?&lt;/p&gt;&#xA;" OwnerUserId="26661" LastEditorUserId="467" LastEditDate="2017-02-22T09:24:39.633" LastActivityDate="2017-02-22T09:36:33.767" Title="How to derive the Black Scholes partial differential equation from a stock log-normal distribution?" Tags="&lt;black-scholes&gt;" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="32567" PostTypeId="1" CreationDate="2017-02-21T10:26:01.490" Score="2" ViewCount="186" Body="&lt;p&gt;I need to understand how will my option price change if the price of underlying asset changes by, for example, 15% in 30 days. I would like to use BS formula, but in this case I know all parameters except implied volatility. The problem is that IV today will differ from IV in 30 days. How can I model that? Should I use local volatility model?&lt;/p&gt;&#xA;" OwnerUserId="24771" LastActivityDate="2017-11-20T01:57:56.163" Title="Modelling option price change in N days" Tags="&lt;volatility&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32568" PostTypeId="2" ParentId="9858" CreationDate="2017-02-21T11:27:41.590" Score="2" Body="&lt;p&gt;Excluding an autoregressive term from a regression (a regular univariate time series regression or as in your case a static panel data regression) is not an omitted variables problem. For the univariate case most standard textbooks in statistics cover that autocorrelation in the residuals still leaves the OLS estimate unbiased and consistent (but inference will be incorrect) see e.g. p. 265 in Greene (2002). This also holds true for static panel data models, see e.g. p. 92 in Baltagi (2008). More technically leaving out the AR(1) term leads to cov(e_it,e_it-1)≠0 but not to cov(X_it,e_it)≠0 which is the endogeneity problem caused by omitted variables. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you should do is to allow for clustering of standard errors wihtin firms (over time) that will take care of your inference problem. Clustering across firms should not be a problem since you include time fixed effects, see Pedersen (2009) for more on calculating standard errors in panel data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you include lagged liquidity you will have a dynamic panel data model which will have biased estimated with firm or time fixed effects are included. This bias is called the Nickell bias after Nickell (1981) and when you have time fixed effects the bias is of magnitude O(1/N). One important thing to consider is that if you go for a dynamic model and you specify the dynamics incorrectly (say the true time series structure is not an AR(1) model) then you will have introduced an additional source of bias from dynamic misspecification, see (Lee, 2012). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To sum up: If you go for the static model at least your estimates will be unbiased but inefficent and inference will be incorrect (but easily fixed by allowing for clustering).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Refs&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Baltagi, Badi H. (2008). &quot;Econometric Analysis of Panel Data.&quot; Fourth edition, Wiley.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Greene, William (2002). “Econometric Analysis”. Sixth edition, Prentice Hall.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lee, Yoonseok. (2012). &quot;Bias in Dynamic Panel Models under Time Series Misspecification.&quot; Journal of Econometrics 169, 54-60.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nickell, Stephen. &quot;Biases in dynamic models with fixed effects.&quot; Econometrica: Journal of the Econometric Society (1981): 1417-1426.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Petersen, Mitchell A. &quot;Estimating standard errors in finance panel data sets: Comparing approaches.&quot; Review of financial studies 22.1 (2009): 435-480.&lt;/p&gt;&#xA;" OwnerUserId="26662" LastActivityDate="2017-02-21T11:27:41.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32569" PostTypeId="1" CreationDate="2017-02-21T11:36:09.603" Score="0" ViewCount="192" Body="&lt;p&gt;I am looking for an explanation of the following fact, which seems to be rather simple yet I am missing something. Say that $S_t$ is a stock following GBM &#xA;$$ dS_t = r S_td_t + \sigma S_t dW_t,$$&#xA;and I want to price a derivative with payoff $max(S_T^2-K,0)$. I know how to do this using the risk-neutral expectation, but it's rather long and apparently unnecessary. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I read in a book (Mark Joshi's &lt;em&gt;Concepts&lt;/em&gt;...) another solution which uses the forward price. If $F_T(t)$ is the forward price of $S$ at time $t$, then one can write&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ F_T(T)^2 = (F_T(0)^2 e^{\sigma^2 T})e^{-\frac{\sigma'^2}{2} T + \sigma'\sqrt{T}N(0,1)},$$&#xA;with $\sigma'=2\sigma$, so then one can use Black's formula with forward equal to $F_T(0)^2 e^{\sigma^2T}$ and volatility $\sigma'$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But how is Black's formula justified here exactly? I assume that the formula can be applied for a call option on the forward price of an asset, but how do we know there exists a tradable asset with volatility $\sigma'$, for instance? Or is this even necessary? &lt;/p&gt;&#xA;" OwnerUserId="25227" LastActivityDate="2017-02-21T11:36:09.603" Title="Black's formula for a call option on a non-tradable underlying" Tags="&lt;black-scholes&gt;&lt;black&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32570" PostTypeId="1" AcceptedAnswerId="32579" CreationDate="2017-02-21T12:01:34.090" Score="4" ViewCount="231" Body="&lt;p&gt;EDIT: As pointed out by Gordon in the comments, the portfolio I considered in my original post is neither self-financing nor (locally) risk-free.&#xA;Though the central question is still open. Suppose that we have a portfolio $P_t$ satisfying&#xA;$$dP_t=a(W_t,t)dt+b(W_t,t)dW_t.$$&#xA;Then, apparently, the portfolio is called (locally) risk-free iff $b(W_t,t)$ vanishes. My question is why this definition makes sense. After all, the coefficient $a(W_t,t)$ might depend on the Wiener process, and thus on the path we are given.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This was the original post:&#xA;I'm trying to understand the derivation of the Black-Scholes equation for an option by arbitrage considerations, and feel puzzled by the notion of  a risk-free portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As usual, let the price of the underlying stock be given by the Ito-process&#xA;$$dS_t=\mu S_t dt+\sigma S_t dW_t,$$&#xA;and let $V$ denote the price of the option. We then consider the portfolio&#xA;$$P_t=V_t+\Delta S_t.$$&#xA;If we assume that this portfolio is self-financing it satisfies&#xA;$$dP_t=\left(\frac{\partial V}{\partial t}+\frac{1}{2}\sigma^2 S_t^2 \frac{\partial^2 V}{\partial S^2}\right)dt+\left(\frac{\partial V}{\partial S}+\Delta\right)dS.$$&#xA;Then it is claimed that the choice $\Delta=-\frac{\partial V}{\partial S}$ makes the portfolio risk-free because the $dS$ term vanishes. Hence it must grow at the risk-free rate&#xA;$$dP_t=rP_tdt.~(1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have some problem understanding why such a portfolio is considered to be risk-free. After all in the equivalent integral equation&#xA;$$P_t-P_0=\int_0^t a(W_s,s)ds,$$&#xA;where $a$ is the first bracket, we still integrate over the paths of the Wiener process (or some function thereof). So it still depends on the path we are given.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I came up with the following (heuristic) idea: since the paths of the Wiener process are continuous (almost surely), on a very small interval $[t_0-\epsilon,t_0+\epsilon]$ the term $a$ is bounded&#xA;$$a_0-k\leq a(W_t(\omega),t)\leq a_0+k.$$&#xA;By monotony of the integral the growth of $P_t$ is thus approximately linear in $t$ with rate between $a_0-k$ and $a_0+k$ (where $k$ may be arbitrarily small). Hence at this small time scale the portfolio should be approximately risk-free, and taking the limit should give equation $(1)$.&#xA;Such an argument does not seem to work for a potential $dS$ term because integration with respect to the Wiener process lacks monotony.&lt;/p&gt;&#xA;" OwnerUserId="26587" LastEditorUserId="26587" LastEditDate="2017-02-21T15:15:55.620" LastActivityDate="2017-02-22T14:57:23.463" Title="Notion of risk-less portfolio in derivation of Black-Scholes" Tags="&lt;black-scholes&gt;&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32572" PostTypeId="2" ParentId="32562" CreationDate="2017-02-21T12:29:51.613" Score="0" Body="&lt;p&gt;it is because &quot;R-bar&quot; over 1 day is a very tiny number , virtually zero&lt;/p&gt;&#xA;" OwnerUserId="17348" LastActivityDate="2017-02-21T12:29:51.613" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32574" PostTypeId="2" ParentId="30362" CreationDate="2017-02-21T13:32:01.953" Score="2" Body="&lt;p&gt;&lt;a href=&quot;http://dx.doi.org/10.1016/0378-4266(90)90039-5&quot; rel=&quot;nofollow noreferrer&quot;&gt;Kemna and Vorst (1990)&lt;/a&gt; [&lt;a href=&quot;http://www.javaquant.net/papers/Kemna-Vorst.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt; download&lt;/a&gt; ] is a classic in Monte Carlo method for Asian option. Geometric mean, which can be analytically computed, is used as a control variate to reduce MC noise.&lt;/p&gt;&#xA;" OwnerUserId="26559" LastActivityDate="2017-02-21T13:32:01.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32575" PostTypeId="2" ParentId="21628" CreationDate="2017-02-21T13:46:46.723" Score="2" Body="&lt;p&gt;Yes, AFAIK, they used Edgeworth expansions&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[ &lt;a href=&quot;https://www.cambridge.org/core/services/aop-cambridge-core/content/view/S0022109000007687&quot; rel=&quot;nofollow noreferrer&quot;&gt;download&lt;/a&gt; ]&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The objective of this paper is to describe a quick way to price European&#xA;  average options. While it is very difficult to determine the probability distribution for the average, all of its moments can be readily determined. Thus, an Edgeworth series expansion can be used to approximate the distribution&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="26559" LastActivityDate="2017-02-21T13:46:46.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32576" PostTypeId="1" CreationDate="2017-02-21T15:12:06.170" Score="5" ViewCount="389" Body="&lt;p&gt;I'm starting investigating the properties of the fractionally integrated brownian motion, yet I'm not able to figure out what kind of distribution should an increment of a fBM process follow, conditioned on the previous observations...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, when studying an ARMA(1,1) model whose variance follows a GARCH(1,1), we know that the distribution of the next innovation $\epsilon_t$, &lt;em&gt;conditioned&lt;/em&gt; on the previous observations, will be &lt;em&gt;gaussian&lt;/em&gt;, and it will depend obviously on previous innovations and realizations of the process; by the way, I'm still not able to figure out the conditional distribution for fBM, or even ARFIMA, for that matter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anybody who can help me with this - or even suggest a reference - that covers the distributional properties of these fractionally integrated models?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot! :)&lt;/p&gt;&#xA;" OwnerUserId="16045" LastEditorUserId="16045" LastEditDate="2017-02-21T15:41:20.233" LastActivityDate="2017-11-20T03:57:57.000" Title="Fractional Brownian motion - probability density function of the increments" Tags="&lt;time-series&gt;&lt;stochastic-processes&gt;&lt;fractals&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32578" PostTypeId="1" CreationDate="2017-02-21T15:36:01.277" Score="2" ViewCount="162" Body="&lt;p&gt;Any discussion boards for energy related quant topics? Like VaR in energy portfolio, and pipeline option pricing.. just want to know where is the best discussion board for such energy specific topics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="26668" LastActivityDate="2017-08-21T22:26:31.543" Title="Energy Risk Quant--Any discussion boards for energy related quant topics?" Tags="&lt;option-pricing&gt;&lt;risk-management&gt;&lt;var&gt;&lt;value-at-risk&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32579" PostTypeId="2" ParentId="32570" CreationDate="2017-02-21T15:54:04.137" Score="4" Body="&lt;p&gt;Regarding the self-financing and locally risk-free issues of the portfolio $P_t= V_t +\Delta S_t$, see &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1852333766&quot; rel=&quot;nofollow noreferrer&quot;&gt;this question&lt;/a&gt; and also discussions on Page 100 of the book &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1852333766&quot; rel=&quot;nofollow noreferrer&quot;&gt;Mathematical Methods for Financial Markets&lt;/a&gt; by Jeanblanc, Yor, and Chesney.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that a portfolio is locally risk-free means that it earns the risk free rate $r$ over the infinitesimal interval $[t, t+dt]$ (see the bottom part on Page 99 of &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1852333766&quot; rel=&quot;nofollow noreferrer&quot;&gt;the above book&lt;/a&gt;). That is,&#xA;\begin{align*}&#xA;dP_t = rP_t dt.&#xA;\end{align*}&#xA;In other words,&#xA;\begin{align*}&#xA;a(W_{t}, t) dt + b(W_{t}, t)dW_t =  rP_t dt.&#xA;\end{align*}&#xA;Consequently, $b(W_{t}, t)=0$ and&#xA;\begin{align*}&#xA;a(W_{t}, t) = rP_t.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-02-22T14:57:23.463" LastActivityDate="2017-02-22T14:57:23.463" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32580" PostTypeId="2" ParentId="32543" CreationDate="2017-02-21T16:01:54.963" Score="1" Body="&lt;p&gt;Edit: I've got a chance to talk with a risk manager. The conclusion is that DV01 is used more by traders simply because they care more about the actual dollar value. Portfolio managers may use duration instead because they get compensated in a different way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some relevant discussions are available on this &lt;a href=&quot;https://en.wikipedia.org/wiki/Talk%3ABond_duration&quot; rel=&quot;nofollow noreferrer&quot;&gt;Wikipedia&lt;/a&gt; page.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;According to &lt;a href=&quot;https://en.wikipedia.org/wiki/Bond_duration#Dollar_duration.2C_DV01.2C_BPV.2C_Bloomberg_.22Risk.22&quot; rel=&quot;nofollow noreferrer&quot;&gt;Wikipedia&lt;/a&gt;, dollar duration and DV01 are essentially the same thing. Dollar duration is a common risk measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your question &quot;why do Bond traders look at duration rather than DV01 ?&quot; is a little mis-postulated. Bond traders do look at DV01 aka dollar duration. Other durations (Modified, Macauley, etc.) are different concepts. &lt;/p&gt;&#xA;" OwnerUserId="17835" LastEditorUserId="17835" LastEditDate="2017-02-23T15:27:33.733" LastActivityDate="2017-02-23T15:27:33.733" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32582" PostTypeId="2" ParentId="28272" CreationDate="2017-02-21T17:50:40.583" Score="0" Body="&lt;p&gt;To get this term you need to take the log of S and to use Ito’s lemma, you can find a detailed explanation in &lt;a href=&quot;https://quant.stackexchange.com/a/10072/7008&quot;&gt;this answer&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2017-02-21T17:57:17.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32583" PostTypeId="1" CreationDate="2017-02-21T17:52:18.190" Score="0" ViewCount="167" Body="&lt;p&gt;In a job description, it lists the sub categories of fixed income products: cash, swap, futures and options. I understand what other three mean but what's &quot;cash&quot; in this context?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In another occasion I came across this term when I worked with &quot;muni cash&quot;, which is a team having something to do with munibonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I couldn't, however, find &quot;cash&quot; as an asset class type in any fixed income text book.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;please advise.&lt;/p&gt;&#xA;" OwnerUserId="20317" LastActivityDate="2017-02-21T18:15:44.683" Title="What does cash mean in the fixed income context?" Tags="&lt;fixed-income&gt;&lt;finance&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32584" PostTypeId="2" ParentId="32583" CreationDate="2017-02-21T18:00:18.580" Score="2" Body="&lt;p&gt;Cash means taking possession (usually in a brokerage account) of actual bonds, such as treasuries, munis, or corporates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually this is no big deal, but the brokerage may have requirements for accounts that trade cash, for example that you be a &lt;a href=&quot;https://en.wikipedia.org/wiki/Qualified_institutional_buyer&quot; rel=&quot;nofollow noreferrer&quot;&gt;qualified institutional buyer&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2017-02-21T18:00:18.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32585" PostTypeId="2" ParentId="32562" CreationDate="2017-02-21T18:09:36.327" Score="2" Body="&lt;p&gt;The average return scales linearly with the time period, i.e. $R_N = N R_1$, while the standard deviation scales with the square root, i.e. $\sigma_N = \sqrt{N}\sigma_1$. As the period becomes really small, $\sqrt{N}$ becomes much bigger than $N$. &lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2017-02-21T18:09:36.327" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32586" PostTypeId="2" ParentId="32583" CreationDate="2017-02-21T18:15:44.683" Score="0" Body="&lt;p&gt;Among people who trade bond options or bond futures, the term &quot;cash&quot; or &quot;the cash market&quot; is used to refer to the actual bonds.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2017-02-21T18:15:44.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32587" PostTypeId="2" ParentId="32576" CreationDate="2017-02-21T19:36:24.263" Score="2" Body="&lt;p&gt;There is a full derivation of the conditional distribution of fBM in Fink et al: &quot;Conditional distributions of processes related to fractional Brownian motion&quot;, J. Appl. Probab. Volume 50, Number 1 (2013), 166-183. The particular theorem you need is 3.1. &lt;/p&gt;&#xA;" OwnerUserId="13808" LastActivityDate="2017-02-21T19:36:24.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32588" PostTypeId="1" CreationDate="2017-02-21T21:35:19.207" Score="-2" ViewCount="777" Body="&lt;p&gt;I have a normal high school level of mathematics including some statistics and find the world of Quantitative Finance both alien and invigorating at the same time so, would like to learn more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What book recommendations would people suggest for me to take me from lets say beginner to advanced including stochastic calculus and Ito's lemma etc. Ideally, a maths reminder book to start me off as lets say a number of years have passed since I was at high school :-)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm thinking less theoretical, interesting and easy reading if at all possible.&lt;/p&gt;&#xA;" OwnerUserId="26669" LastEditorUserId="467" LastEditDate="2017-02-22T08:28:22.693" LastActivityDate="2017-02-22T08:28:22.693" Title="Which book would you recommend for beginners in Quantitative Finance?" Tags="&lt;finance-mathematics&gt;&lt;quantitative&gt;&lt;statistical-finance&gt;&lt;books&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2017-02-22T08:34:02.607" ContentLicense="CC BY-SA 3.0" />
  <row Id="32589" PostTypeId="2" ParentId="2841" CreationDate="2017-02-21T22:08:25.123" Score="0" Body="&lt;p&gt;I think the simplest answer is just to understand that Black and Scholes uses risk neutral probabilities, vis-a-vis &quot;d1&quot; and &quot;d2&quot; in commonly cited derivations. These are very similar to &quot;Z-scores&quot; in statistics, but they are derived with the assumption that a dynamically risk-free portfolio can be constructed -- this allows us to derive a closed form solution for the differential equation. Just as how a standard Z-score can be converted to a probability, the Black and Scholes converts d1 and d2 to a &quot;risk neutral&quot; probabilities through the cumulative distribution function (CDF) of the standard normal (&quot;i.e., Gaussian) variety.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to find the raw probability of an options expiring above or below a given strike, it would be so much easier to just utilize the Z-score formula, as in: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Z = \frac{\ln(S / K) - m(T-t)}{s \sqrt{T-t}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$p = \phi(Z)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $S$ is the stock price, $K$ is the arbitrary strike price, $m$ is expected annualized drift, $s$ is the annualized volatility, and $T - t$ is the time till expiration in years, $p$ is the probability that the underlying will expire at or above the strike at time $T - t$, and $\phi$ is the CDF of the Gaussian distribution.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2017-03-29T16:16:50.200" LastActivityDate="2017-03-29T16:16:50.200" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32590" PostTypeId="2" ParentId="32578" CreationDate="2017-02-21T22:55:41.493" Score="-1" Body="&lt;p&gt;Take a shot, probe around in this one. I don't know how well it is maintained. I saved it to favorites a while back, don't remember why.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://marcoagd.usuarios.rdc.puc-rio.br/main.html#contents&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://marcoagd.usuarios.rdc.puc-rio.br/main.html#contents&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26670" LastActivityDate="2017-02-21T22:55:41.493" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32591" PostTypeId="1" CreationDate="2017-02-21T23:32:02.660" Score="0" ViewCount="729" Body="&lt;p&gt;Since FF library is for US. How can I get the SMB and HML fators for European markets (UK, France, Germany, etc)?&lt;/p&gt;&#xA;" OwnerUserId="26672" LastActivityDate="2017-02-21T23:56:53.353" Title="FF 3 Factor Data for Europe" Tags="&lt;factor-models&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32592" PostTypeId="2" ParentId="32591" CreationDate="2017-02-21T23:56:53.353" Score="2" Body="&lt;p&gt;You can get a pooled European market at Kenneth French's website, you just have to scroll down. These are current.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;German factors are here, but I think they might have stopped updating them in 2016: &#xA;&lt;a href=&quot;https://www.wiwi.hu-berlin.de/de/professuren/bwl/bb/data/fama-french-factors-germany/fama-french-factors-for-germany&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.wiwi.hu-berlin.de/de/professuren/bwl/bb/data/fama-french-factors-germany/fama-french-factors-for-germany&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Stefano Marni has a large set of monthly factors, including France, however, they stop in 2013. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://homepage.sns.it/marmi/Data_Library.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://homepage.sns.it/marmi/Data_Library.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, Tharayan and Christidis offer daily UK factors, they stop in June 2015.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://business-school.exeter.ac.uk/research/centres/xfi/famafrench/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://business-school.exeter.ac.uk/research/centres/xfi/famafrench/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13808" LastActivityDate="2017-02-21T23:56:53.353" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32594" PostTypeId="2" ParentId="14706" CreationDate="2017-02-22T00:15:36.780" Score="4" Body="&lt;p&gt;There are some other references:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;http://dx.doi.org/10.1080/14697680902849361&quot; rel=&quot;nofollow noreferrer&quot;&gt;Li and Lee (2009)&lt;/a&gt;&#xA;&lt;a href=&quot;https://ssrn.com/abstract=1027282&quot; rel=&quot;nofollow noreferrer&quot;&gt;[download]&lt;/a&gt;&#xA;An adaptive successive over-relaxation method for computing the Black–Scholes implied volatility&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://ssrn.com/abstract=2908494&quot; rel=&quot;nofollow noreferrer&quot;&gt;Stefanica and Radoicic (2017)&lt;/a&gt; An Explicit Implied Volatility Formula&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Related discussions on the implied volatility inversion:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/7761/how-to-compute-implied-volatility-calculation&quot;&gt;How can the implied volatility be calculated?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/15198/what-is-an-efficient-method-to-find-implied-volatility&quot;&gt;What is an efficient method to find implied volatility?&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For the normal (or Bachelier) implied volatility, there's an improvement to Choi et al (2009) [&lt;a href=&quot;http://dx.doi.org/10.1080/13504860802583436&quot; rel=&quot;nofollow noreferrer&quot;&gt;paper&lt;/a&gt; / &lt;a href=&quot;https://ssrn.com/abstract=990747&quot; rel=&quot;nofollow noreferrer&quot;&gt;SSRN&lt;/a&gt;] mentioned in the question:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://ssrn.com/abstract=2420757&quot; rel=&quot;nofollow noreferrer&quot;&gt;Fabien Le Floc'h (2016)&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="26559" LastEditorUserId="26559" LastEditDate="2018-10-13T17:31:54.843" LastActivityDate="2018-10-13T17:31:54.843" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="32595" PostTypeId="2" ParentId="1891" CreationDate="2017-02-22T01:41:19.193" Score="3" Body="&lt;p&gt;Surprisingly, no one mentioned the need to ensure that the trading strategy can survive different types of market conditions. Suppose that you use @chrisaycock's formula and came up with 5000 trades.  Well, you could make 5000 trades in a few hours or a  1-2 months with the original criteria.  Putting aside amount of data to test on, it could just so happen that the time period you selected to test and collect 5000 trades worth of data 'fit' your strategy well.  What about 5001th trade or 6000th trade?  I would be asking how would you have handled a '&lt;a href=&quot;https://www.bloomberg.com/news/articles/2016-10-07/what-we-know-about-the-pound-s-friday-flash-crash-quicktake-q-a&quot; rel=&quot;nofollow noreferrer&quot;&gt;flash crash&lt;/a&gt;' or sudden change in product value?  A &lt;a href=&quot;http://www.cftc.gov/PressRoom/PressReleases/pr7528-17&quot; rel=&quot;nofollow noreferrer&quot;&gt;regulator report&lt;/a&gt; that a key license required to legally operate the primary business function has been suspended or revoked effective immediately?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A more precise answer in my opinion and experience is to make sure that you &lt;strong&gt;sample enough tick data to cover a variety of market conditions&lt;/strong&gt;.  Pay close attention to volatility surrounding sudden events as well as economic calendar announcements  (mainly sharp moves in prices).  The algo would need to know how to adjust to handle these moves.  So you might initially run it over a couple of years of tick data and note these sharp moves and different flavors of volatility. Then on subsequent runs you can focus on the sharp moves first, then replay on the remaining data to further validate the strategy.&lt;/p&gt;&#xA;" OwnerUserId="2566" LastActivityDate="2017-02-22T01:41:19.193" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32597" PostTypeId="1" CreationDate="2017-02-22T04:54:36.757" Score="0" ViewCount="83" Body="&lt;p&gt;I am wondering why the return on asset (ROA) is so much different for a company when reported on Yahoo finance and Market watch website.&#xA;Here is Yahoo finance link: &lt;a href=&quot;https://finance.yahoo.com/quote/IESC/key-statistics?p=IESC&quot; rel=&quot;nofollow noreferrer&quot;&gt;Yahoo Finance&lt;/a&gt;&#xA;and here is Marketwatch link: &lt;a href=&quot;http://www.marketwatch.com/investing/Stock/IESC/profile?CountryCode=US&quot; rel=&quot;nofollow noreferrer&quot;&gt;MarketWatch&lt;/a&gt;&#xA;The ROA on Yahoo finance for IESC is 5.75% and on MarketWatch is 38.89%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why there is this huge difference?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am wondering if there are other free online resources I can check ROA and see what majority report?&lt;/p&gt;&#xA;" OwnerUserId="15612" LastEditorUserId="15612" LastEditDate="2017-02-22T13:58:25.427" LastActivityDate="2017-02-22T13:58:25.427" Title="Return on asset value for one company different on Yahoo Finance and on Market watch" Tags="&lt;return&gt;&lt;yahoofinance&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32598" PostTypeId="2" ParentId="32588" CreationDate="2017-02-22T05:04:39.103" Score="1" Body="&lt;p&gt;I think it is really hard (nearly impossible) to pursue a career in quantitative finance provided you only have high school level of math knowledge. I am sorry to say so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;College level math major courses would be helpful for you now. Try to learn calculus series and linear algebra would be your initial step.&lt;/p&gt;&#xA;" OwnerUserId="19653" LastActivityDate="2017-02-22T05:04:39.103" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32599" PostTypeId="2" ParentId="17820" CreationDate="2017-02-22T06:17:34.357" Score="0" Body="&lt;p&gt;To run local tests, particularly tick data tests, you want to use SSD drive.  Intel i5 processor or better.  You can get away with i3 processor.  But 2 cores is the absolute minimum, with 4+ processors or higher recommended. You said you were using IB, so perhaps you are coding in MultiCharts?  If you want to only run simulations, you could use MT4 and import dukascopy data.  I recommend Birt's Tick Data Suite v2 to make your life a lot easier.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally this would be a separate laptop that you can run tests on and maybe run some music or a movie on also.  But more processors mean you can run more tests simultaneously.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And not a bad idea to consider using an external vacuum fan, like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Xhss1.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Xhss1.jpg&quot; alt=&quot;usb external vacuum suction fan&quot;&gt;&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Help to take off the excess heat while using more processing power.&lt;/p&gt;&#xA;" OwnerUserId="2566" LastEditorUserId="2566" LastEditDate="2017-02-22T06:23:30.983" LastActivityDate="2017-02-22T06:23:30.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32600" PostTypeId="2" ParentId="32567" CreationDate="2017-02-22T09:01:38.160" Score="1" Body="&lt;p&gt;First you have to assume that the main drivers of your option price are its underlying value and implied volatility, meaning that greeks like rho and theta are negligible with reference to delta and vega. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, could you enlighten us on how you determine the underlying change?&#xA;If your approach is sound for the underlying, and the one used to find the implied vol changes is sound as well, you can find the change in the option price by plugging these &quot;stress&quot; parameters into BS formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise just compute the delta and vega of your option today and deduce the new option price my multiplying the greeks with the variations of the underlying and implied vol of your choice (this assumes a linearization of the option price around the spot and the current implied vol).    &lt;/p&gt;&#xA;" OwnerUserId="26595" LastActivityDate="2017-02-22T09:01:38.160" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="32601" PostTypeId="2" ParentId="17820" CreationDate="2017-02-22T09:05:15.773" Score="0" Body="&lt;p&gt;You absolutely do not need to build a computer to do this. Certainly not to do research, and probably not even to trade. A more sensible approach might be&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Acquire some data (store it on your laptop's SSD, or on an external drive if too large)&lt;/li&gt;&#xA;&lt;li&gt;Start experimenting with simulated trading on historical data, either by writing your own back-testing engine or using one provided by your broker.&lt;/li&gt;&#xA;&lt;li&gt;If you have something that looks profitable, start paper trading it in real time. Is it profitable in paper trading? If not, why not? If you can determine that the problem is the speed of your computer or the speed of your connection, then you may need to upgrade these (but as suggested in another post, you can run your algorithms on AWS without going to the expense of building a new computer).&lt;/li&gt;&#xA;&lt;li&gt;Once you are profitable in paper trading, start trading small amounts of money live. Again, if you are not profitable, you need to analyse why. You only need to upgrade your hardware if you can convince yourself that the speed of your computer or connection is the problem.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="924" LastActivityDate="2017-02-22T09:05:15.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32602" PostTypeId="2" ParentId="32566" CreationDate="2017-02-22T09:36:33.767" Score="0" Body="&lt;p&gt;What you wrote in your question is simply one of the assumptions of the Black-Scholes framework.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The whole interesting part about getting to the Black-Scholes PDE (i.e. constructing a replicating portfolio) comes next and is the most common derivation of the Black-Scholes formula, which you can find the derivation on the Wikipedia &lt;a href=&quot;https://en.wikipedia.org/wiki/Black%E2%80%93Scholes_equation&quot; rel=&quot;nofollow noreferrer&quot;&gt;page&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2017-02-22T09:36:33.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32604" PostTypeId="2" ParentId="32576" CreationDate="2017-02-22T11:04:16.880" Score="2" Body="&lt;p&gt;You can think of the fractional difference operation as a filtering procedure that &quot;removes&quot; the long memory feature of a serie. However the mathematics for the innovations are the same than for any other ARMA models, and their distributions may be Gaussian, student t or whatever distributions.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The ARMA model is given by :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Psi(L) X_{t} = \Phi(L) \epsilon_{t} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the ARFIMA by :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Psi(L) (1-L)^d X_{t} = \Phi(L) \epsilon_{t} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only difference is that the $(1-L)^{d}$ fractional difference operation is applied on $X_{t}$. The innovations $\epsilon_{t}$ are still IID and this permits the MLE method to be used to infers parameters. The &#xA;$(1-L)^{d}$ can be seen as an AR filtering with infinite lags. Once the fractional difference is applied on the serie, you are left with a standard ARMA model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A really good  reference, easy to follow, on long memory is the book :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Statistics for Long-Memory Processes by Jean Baran - 1994&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2017-02-22T11:04:16.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32605" PostTypeId="2" ParentId="18185" CreationDate="2017-02-22T12:16:30.137" Score="2" Body="&lt;p&gt;The definition of a risk-neutral probability measure depends on the model. The (one factor) Interest Rate Model in Shreve II consists of a single zero-coupon bond $B(t,T)$ with maturity $T$ and of a money market account. So we want &lt;em&gt;discounted bond price to be a martingale&lt;/em&gt; under risk-neutral probability measure. We define it as usual (i.e. Shreve II, 5.2.2.):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume that the interest rate $R(t)$ and the bond $B(t,T)$ processes satisfy their respective  stochastic differential equations under the actual probability: $$ dR(t) = \xi(t,R(t))dt + \phi(t, R(t))dW(t)$$&#xA;$$ dB(t,T) = \mu(t,T)B(t,T)dt + \sigma(t,T)B(t,T)dW(t)$$&#xA;where $W(t)$ is a Brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The discount process $D(t) = e^{-\int_0^t R(s)ds}$ so as usual $ dD(t) = -R(t)D(t)dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We want the discounted bond price to be a martingale:&#xA;$$ d(D(t)B(t,T)) = D(dB(t,T) - R(t)B(t,T)dt) =  D(t)B(t,T)\sigma(t,T)\Big(\frac{\mu(t,T) -R(t)}{\sigma(t,T)}dt + dW(t)\Big) = D(t)B(t,T)\sigma(t,T)\Big(\theta(t)dt + dW(t)\Big)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where we defined the market price of risk $\theta(t) = \frac{\mu(t,T) -R(t)}{\sigma(t,T)}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We introduce risk-neutral probability measure $\tilde{\mathbb{P}}$ using Girsanov's theorem as usual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above considerations do not depend on the form of SDE for the interest rate process $R(t)$ so it is ok to start right from the riks-neutral probability measure as it is done in Shreve's book.&lt;/p&gt;&#xA;" OwnerUserId="15154" LastActivityDate="2017-02-22T12:16:30.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32607" PostTypeId="1" AcceptedAnswerId="32609" CreationDate="2017-02-22T13:25:41.293" Score="3" ViewCount="4857" Body="&lt;p&gt;I need to prove that the butterfly condition is always positive under no arbitrage theorem. We are constructing a long butterfly using European call options&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C(T,K+∆K) - 2C(K) + C(T,K-∆K) &amp;gt; 0 where ∆K &amp;lt; K&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have managed to prove for greater than or equal to zero using the following steps:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lower bound of a European call option of a non-divided paying stock is as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C(T,K) &amp;gt;= S(0) - Ke^-rT&#xA;K = strike price, T = time to maturity, r = interest rate, S(0) = stock price at time=0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hence for options in the butterfly this evaluates to &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C(T,K+∆K) &amp;gt;= S(0) - (K+∆K)e^-rT  --- (Eq:1)&#xA;C(T,K) &amp;gt;= S(0) - (K)e^-rT --- (Eq:2)&#xA;C(T,K-∆K) &amp;gt;= S(0) - (K-∆K)e^-rT --- (Eq:3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Doing &lt;code&gt;(Eq:1) - 2*(Eq:2) + (Eq:3)&lt;/code&gt;, I get the following&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C(T,K+∆K) - 2C(T,K) + C(T,K-∆K) &amp;gt;= 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, how do i go further and prove that the above inequality is not equal to zero under no arbitrage.&lt;/p&gt;&#xA;" OwnerUserId="19401" LastActivityDate="2017-02-23T03:17:40.733" Title="Prove that the butterfly condition is always greater than zero" Tags="&lt;options&gt;&lt;european-options&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32608" PostTypeId="2" ParentId="32607" CreationDate="2017-02-22T13:42:45.477" Score="1" Body="&lt;p&gt;I think the proof should go like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The payout of the option butterfly is always non-negative. See the graph in &lt;a href=&quot;https://en.wikipedia.org/wiki/Butterfly_(options)&quot; rel=&quot;nofollow noreferrer&quot;&gt;wikipedia&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The no-arbitrage condition is equivalent to that the probability density is always non-negative for any state. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, the (discounted) expected payout, i.e., the option premium, should be non-negative.&lt;/p&gt;&#xA;" OwnerUserId="26559" LastActivityDate="2017-02-22T13:42:45.477" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32609" PostTypeId="2" ParentId="32607" CreationDate="2017-02-22T13:52:22.060" Score="11" Body="&lt;p&gt;You generally can't simply subtract two inequalities as you did in your attempt. Here are two approaches to solve your problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;No-Arbitrage Argument&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume that the initial value of the Butterfly spread was strictly negative $V_0 &amp;lt; 0$. Buying the butterfly spread would thus yield a strictly positive cash-flow at time $t = 0$. Next note that the terminal payoff $V_T$ is non-negative. It is zero when $S_T \in [0, K - \Delta] \cup [K + \Delta, \infty)$ and strictly positive when $S_T \in (K - \Delta, K + \Delta)$. This is a free lunch (you get cash now and have a non-negative payoff in the future) and thus contradicts the absence of arbitrage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now assume that $V_0 = 0$. In this case the initial cash-flow from buying the butterfly spread is zero. In the future you have a non-negative cash-flow. If this cash-flow has a non-zero probability of occurrence, then this represents a free lottery and again contradicts no-arbitrage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;State Price Density&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the Breeden-Litzenberger result, we know that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;C_0(K) = e^{-r T} \int_K^\infty (x - K) f(x) \mathrm{d}x \qquad \Leftrightarrow \qquad \frac{\partial^2 C_0}{\partial K^2} = e^{-r T} f(K).&#xA;\end{equation} &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e. the compounded second derivative of the call price w.r.t. the strike is equal to the risk-neutral probability density. For $f$ to be valid, we thus require that the second derivative is non-negative everywhere. Now consider a finite difference approximation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\frac{\partial^2 C_0}{\partial K^2} = \lim_{\Delta \downarrow 0} \frac{C_0(K - \Delta) - 2 C_0(K) + C_0(K + \Delta)}{\Delta^2}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The numerator is just the butterfly spread and it follow that is has to be non-negative as well. The argument for it being strictly positive again depends on whether you allow for regions with zero probability mass or not.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2017-02-22T13:52:22.060" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32610" PostTypeId="2" ParentId="31544" CreationDate="2017-02-22T14:00:45.823" Score="2" Body="&lt;p&gt;I agree with dm63 in that cross-currency swap (CCS) is essential for building FX forward curve. Let me add/correct two things:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;FX curve &amp;lt; 1 year can be backed out by FX forward contract. CCS is typically longer than 1 year, so you need it for the long-end of the FX curve.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;CCS swap is typically exchange of 3m USD LIBOR vs 3m FOREIGN LIBOR (or equivalent) + BASIS on top of the notional exchange at the start and end of the swap. (CCS against non-deliverable currencies are a bit different.) Anyway, CCS doesn't involve central bank rate like OIS. The BASIS is determined by market force depending on the need for the USD funding from the foreign counterpart (or vice versa). Given the BASIS, you solve the FX forward at the swap maturity which make the exchange of the two cashflows zero value. Starting from the shorter maturity CCS, you can boot-strap to the longer end.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="26559" LastActivityDate="2017-02-22T14:00:45.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32612" PostTypeId="2" ParentId="32607" CreationDate="2017-02-22T14:28:55.983" Score="1" Body="&lt;p&gt;Alternatively, note that the dual gamma (see &lt;a href=&quot;https://en.wikipedia.org/wiki/Greeks_(finance)&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;) for a vanilla call is given by&#xA;\begin{align*}&#xA;\frac{\partial^2 C}{\partial K^2} = e^{-r(T-t)}\frac{\phi(d_1)}{K\sigma \sqrt{T-t}},&#xA;\end{align*}&#xA;where $\phi$ is the density function of a standard normal random variable.&#xA;That is, $C(K)$, as a function of $K$, is strictly convex. Then&#xA;\begin{align*}&#xA;C(K) &amp;amp;= C\left(\frac{K+\Delta K + K-\Delta K}{2}\right)\\&#xA;&amp;amp;&amp;lt;\frac{1}{2}\Big(C(K+\Delta K)+ C(K-\Delta K)\Big).&#xA;\end{align*}&#xA;In other words, &#xA;\begin{align*}&#xA;C(K+\Delta K)-2C(K)+ C(K-\Delta K)&amp;gt;0&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-02-22T18:06:45.373" LastActivityDate="2017-02-22T18:06:45.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32614" PostTypeId="2" ParentId="17820" CreationDate="2017-02-22T14:39:04.893" Score="0" Body="&lt;p&gt;I agree that you should write a server program for this. It's cheaper, and most of the bottleneck will reside on the network connection anyway, and something like AWS will likely have a better WAN infrastructure and locality than you can at your university or home.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You haven't given us enough information to answer this question properly for you but:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;FX ECNs or dealers generally require much lower bandwidth and storage space for their market data. 4 TB should give you excess space for a year. If you use AWS/Azure, you can always increase the amount of storage you're using as your needs increase so I would start small (&amp;lt;=100GB).&lt;/li&gt;&#xA;&lt;li&gt;You can handle real-time data with 1 GB of memory and any modern processor on a server (minimal background programs) really. If you're asking this question, you probably don't need to think about upgrading this yet.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2017-02-22T14:39:04.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32615" PostTypeId="1" CreationDate="2017-02-22T15:02:36.033" Score="1" ViewCount="798" Body="&lt;p&gt;In Stochastic Volatility Modeling (Lorenzo Bergomi) the Dupire's formula is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma (t,S)^2$ $=$ $2$${dC\over dT}$ $+$ $qC$ $+(r-q)K$${dC \over dK}$ $x$ ${1 \over K^2 {d^2C \over dK^2}}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $K=S$ and $T=t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then he says this equation expresses that the local volatility for the spot S and time t is reflected in the differences of option prices with strikes straddling S and maturities straddling T.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't understand why he uses the term straddling &lt;/p&gt;&#xA;" OwnerUserId="24805" LastEditorUserId="24805" LastEditDate="2017-02-22T15:05:25.447" LastActivityDate="2017-02-22T15:05:25.447" Title="Dupire's formula explanation" Tags="&lt;local-volatility&gt;" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="32617" PostTypeId="1" CreationDate="2017-02-22T17:16:18.247" Score="2" ViewCount="65" Body="&lt;p&gt;I learned some of the basic theory of Bjork (chap 1-9)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and would now like to study some (discrete delta) hedging using programming software. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We had an exercise in school where we hedged a call option by investing its delta in the underlying stock, and keeping the portfolio self-financing using the bank. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought this was very interesting, and liked the programming aspect of it, and would like to know if there is some reference that studies this a bit more professionally and rigorously, studying convergence issues, optimal hedging strategies, applications to more exotic options, etc.&lt;/p&gt;&#xA;" OwnerUserId="26681" LastActivityDate="2017-02-22T17:16:18.247" Title="Reference for delta hedging programmatically" Tags="&lt;reference-request&gt;&lt;delta-hedging&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32618" PostTypeId="2" ParentId="2516" CreationDate="2017-02-22T17:19:21.383" Score="1" Body="&lt;p&gt;@hroptatyr, @Steve, @Tal Fishman, and others here have alluded to the main problem of evaluating backtests.  First we have to &lt;strong&gt;define what constitutes a backtest&lt;/strong&gt;, which is simply an ability to simulate market activity and how specific instructions (algo) would perform in that environment.  The simulation is supposed to best reconstruct how the market would have behaved at the time.  Tick level simulation is the most precise way to do this, but ms, second, and minute data is increasingly less precise, but faster to process.  A strategy where intraday timing may be able to get away with minute backtesting, but more than likely you would have to at least use seconds interval as minimum to properly simulate what &lt;em&gt;would have happened&lt;/em&gt;.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you need to know what the algo system is supposed to do.  In other words, &lt;strong&gt;&lt;em&gt;What category of speculation is it?&lt;/em&gt;&lt;/strong&gt; (e.g. news trading, arbitrage, value trading, dealer, etc) &lt;strong&gt;&lt;em&gt;did the algo actually perform (execute its functions) as advertised&lt;/em&gt;&lt;/strong&gt;.  A lot of investors who are not actually owners of the algo (black box) or have insight as to how the inputs work (grey box) will only have the usual results from the backtest (equity, total trades, sharpe ratios, etc).  There is a structural conflict of interest there; you are just hoping that the live results will be similar without knowing why you were profitable.  Easy to succumb to &lt;a href=&quot;http://www.investopedia.com/terms/s/sample_selection_basis.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;sample selection bias&lt;/a&gt; without covering the basics.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Then&lt;/em&gt;&lt;/strong&gt; you can determine the adequate starting capital and see if the returns net of estimated trading costs make it worthwhile.&lt;/p&gt;&#xA;" OwnerUserId="2566" LastActivityDate="2017-02-22T17:19:21.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32620" PostTypeId="2" ParentId="32526" CreationDate="2017-02-22T18:33:34.607" Score="0" Body="&lt;p&gt;the package pandas_finance does the job :-)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;from pandas_finance import Equity&#xA;aapl = Equity('AAPL')&#xA;aapl.industry&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="26636" LastEditorUserId="26636" LastEditDate="2017-02-22T22:39:04.720" LastActivityDate="2017-02-22T22:39:04.720" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32621" PostTypeId="2" ParentId="12741" CreationDate="2017-02-22T19:28:59.890" Score="1" Body="&lt;p&gt;My preferred narrative is that the psychology of heretofore positive returns and the prospect of improving earnings, together with brokerage cheering leads otherwise smart people to ignore the price/rate fundamental inversion. Until they don't!&lt;/p&gt;&#xA;" OwnerUserId="26683" LastActivityDate="2017-02-22T19:28:59.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32623" PostTypeId="1" CreationDate="2017-02-22T20:20:14.083" Score="3" ViewCount="468" Body="&lt;p&gt;I'm new here and I hope you guys can help me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to calculate/simulate the Vega for my Asian option in the Heston model. The only source I found is the paper of Broadie/Kaya (2004) but they just mentioned the other greeks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do someone know other sources or a method how I can simulate the Vega precisly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you a lot!!!&lt;/p&gt;&#xA;" OwnerUserId="26680" LastActivityDate="2017-02-23T03:05:44.187" Title="Simulation of the Vega in Heston model (for Asian Option)" Tags="&lt;options&gt;&lt;greeks&gt;&lt;heston&gt;&lt;vega&gt;&lt;asian-option&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32624" PostTypeId="1" CreationDate="2017-02-23T00:04:24.903" Score="3" ViewCount="1871" Body="&lt;p&gt;I'm interested in calculating what a theoretical price of the ZB or UB(Ultra Bond) futures would be priced at, given an interest rate of 1%.  Or 0%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the 30Y interest rate is around 1%, what will the ZB or UB be priced at?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the 30Y interest rate is around 0%, what will the ZB, or UB be priced at&lt;/p&gt;&#xA;" OwnerUserId="26686" LastActivityDate="2017-02-23T08:51:40.897" Title="Price of bond future, given a specific interest rate?" Tags="&lt;interest-rates&gt;&lt;fixed-income&gt;&lt;futures&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32625" PostTypeId="1" AcceptedAnswerId="32637" CreationDate="2017-02-23T02:38:08.487" Score="1" ViewCount="761" Body="&lt;p&gt;I need to prove that vertical spread is bounded, by using no arbitrage condition.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  0 &amp;gt; (C(T,K1 )- C(T,K2))/(K1- K2 )  &amp;gt;-e^(-r*T )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have documented my solution below. Can you kindly review it and comment on my approach. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to prove vertical spread condition, I am using following inequality, which is lower bound on option value:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; C  ≥ S(0) − Ke^(−rT)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Vertical spread is created by going long (1) call at strike (K1) and going short (-1) call at strike (K2), where K2 ≥  K1. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;C(T,K1) ≥ S(0) – K1e^(−rT)  and C(T,K2) ≥ S(0) – K2e^(−rT)  , when I calculate difference in call price I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C(T,K1) - C(T,K2) ≥ K2e^(−rT) - K1e^(−rT)             --(1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;C(T,K1) - C(T,K2) ≥ e^(−rT)* (K2 - K1), and as K2 ≥  K1 , I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C(T,K1) - C(T,K2) ≥ 0  --(2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I rearrange following inequality K2 ≥  K1 , I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;K1 - K2  ≤ 0    -- (3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I divide (2) by (3), I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(C(T,K_1 )- C(T,K_2))/(K1- K2 )  &amp;lt;0   --(4) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As dividing positive numerator with negative numerator gives a negative number. You may notice that I have removed equals to symbol from the inequality. Reason being, when K1= K2  , then the numerator is equal to zero and so is the denominator, leading to undefined state of solution. (4) satisfies the upper bound of inequalities. &#xA;By rearranging inequality (1), I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;C(T,K1 )-C(T,K2 )≥ -e^(-rT ) (K1- K2) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Dividing above inequality by (3.3), I get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; (C(T,K1 )- C(T,K2))/(K1- K2 )  &amp;gt;-e^((-r)T )          --(5)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Combining inequality (4) and (5), gives me required vertical spread condition&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;0 &amp;gt; (C(T,K1 )- C(T,K2))/(K1- K2 )  &amp;gt;-e^((-rT )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="26689" LastActivityDate="2017-02-23T18:58:44.710" Title="Prove that the vertical spread condition is bounded" Tags="&lt;option-pricing&gt;&lt;equities&gt;&lt;derivatives&gt;&lt;put-call-parity&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32626" PostTypeId="2" ParentId="32623" CreationDate="2017-02-23T03:05:44.187" Score="3" Body="&lt;p&gt;Chan, Jiun Hong and Joshi, Mark S. and Zhu, Dan, First and Second Order Greeks in the Heston Model (December 26, 2010).  Available at SSRN: &lt;a href=&quot;https://ssrn.com/abstract=1718102&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://ssrn.com/abstract=1718102&lt;/a&gt; or &lt;a href=&quot;http://dx.doi.org/10.2139/ssrn.1718102&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://dx.doi.org/10.2139/ssrn.1718102&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;should just about cover it. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2017-02-23T03:05:44.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32627" PostTypeId="2" ParentId="32607" CreationDate="2017-02-23T03:17:40.733" Score="2" Body="&lt;p&gt;it's a model-free result. The pay-off is non-negative everywhere and positive somewhere. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since it's non-negative everywhere, if its price was negative there would be a clear arbitrage. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have to show positive. We assume that there is a positive probability that the stock lands in the region where the pay-off is positive. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if the contract is worth zero then it has zero value today , and positive value with positive probability and negative nowhere so it defines an arbitrage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, no arbitrage implies the value is positive today, provided there is a positive probability of reaching the area where the pay-off is positive. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(see my book concepts etc for more discussion)&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2017-02-23T03:17:40.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32630" PostTypeId="2" ParentId="32624" CreationDate="2017-02-23T08:51:40.897" Score="9" Body="&lt;p&gt;Treasury bond futures are surprisingly complicated - this is an attempt at a short explanation, it will obviously gloss over some details, but hopefully gives you a flavour of how they are priced.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most important fact is that the underlying is not a single bond, but a basket of bonds. For example, the &lt;a href=&quot;http://www.cmegroup.com/trading/interest-rates/us-treasury/30-year-us-treasury-bond_contract_specifications.html&quot; rel=&quot;noreferrer&quot;&gt;US Treasury Bond Futures contract spec&lt;/a&gt; says that you can deliver&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;U.S. Treasury bonds that have remaining term to maturity of at least 15 years and less than 25 years from the first day of the futures delivery month.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is generally around 40 different bonds (assuming four new issues per year for a ten year period). Obviously, when it comes to delivery, the short will want to deliver whichever bond costs them the least - this bond is known as the cheapest-to-deliver, and one way to understand the bond futures contract is as a forward on the cheapest-to-deliver bond (where the relevant risk-free rate is the term repo rate to delivery, since bonds can generally be financed more cheaply than stocks).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The ~40 bonds deliverable into the futures contract all have different coupons. In the absence of other factors, the cheapest bond to deliver would simply be the one with the the lowest coupon - so there wouldn't be much point having a basket of deliverables at all. To get around this, each bond with price $p_i$ has an associated &lt;em&gt;conversion factor&lt;/em&gt; $c_i$, which is roughly the price of the bond, per $1 of face value, if its yield was 6%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The contract specification says that the amount paid by the long on delivery of the bonds is&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The delivery invoice amount equals the futures settlement price times a conversion factor, plus accrued interest.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;i.e. if the futures finally settle at $f$, the amount paid is $f\times c_*$ where $c_*$ is the conversion factor for the cheapest to deliver bond. In mathematical terms,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;f = \min_i (p_i/c_i)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this was all there was to it, the futures price would closely track the forward price of the cheapest-to-deliver. However, there are several other factors that need to be taken into account -&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The cheapest-to-deliver bond might change over the life of the contract, representing an even better deal for the short (who can now deliver a cheaper bond). The option to change the bond you are going to deliver is the &lt;em&gt;switch option&lt;/em&gt; or &lt;em&gt;quality option&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li&gt;The short can deliver the bond on any day of the delivery month. Generally there is one day which is most effective to deliver on (typically the last day of the month, unless the carrying cost of the position is very negative) but it may change. This option is known as the &lt;em&gt;timing option&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li&gt;The bond futures contract settles about a week before the last delivery day, at which point the settlement price (which is one component of the invoice price) is fixed. However, the cheapest-to-deliver bond can still change, to the advantage of the short. This is known as the &lt;em&gt;end-of-month option&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li&gt;The close of trading in the futures market is about 2 hours before the close of trading in the cash bond market. Generally the short will have to buy/sell some additional bonds, over and above the ones they already hold as a futures hedge, in order to make delivery. If there is a sufficiently large move in the cash market after the futures have settled, the short may be able to get a good discount on these additional bonds. This is known as the &lt;em&gt;wild-card option&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Notice that all of these options are in the favour of the short. Therefore, to compensate the long for selling all of these options, the futures need to trade at a discount to the forward price of the cheapest-to-deliver. Roughly,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Futures Price = (Forward Price of Cheapest-to Deliver) / (Conversion factor) - Option Value&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The one thing that we haven't talked about here is the yield of the 30 year bond! Obviously this is a factor, but the yield is taken into account in the price of the bonds in the deliverable basket. Other factors can be more important in the determining the futures price, like the level and slope of the yield curve (which determines the cheapest-to-deliver), repo rates (which determine the forward values, and whether the carry is positive or negative) and yield volatilities (which influence the price of the various options).&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2017-02-23T08:51:40.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32635" PostTypeId="1" AcceptedAnswerId="32660" CreationDate="2017-02-23T12:56:31.450" Score="4" ViewCount="878" Body="&lt;p&gt;I have been working through &quot;C++ Design Patterns and Derivatives Pricing&quot; by Mark Joshi. In chapter 4 the &lt;code&gt;Parameters&lt;/code&gt; class uses a bridge pattern and employs a &lt;code&gt;clone()&lt;/code&gt; method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The justification of the pattern mentions that it allows the extension of the parameters class by inheriting from &lt;code&gt;ParametersInner&lt;/code&gt; and providing that class with &lt;code&gt;virtual&lt;/code&gt; &lt;code&gt;clone()&lt;/code&gt;, &lt;code&gt;Integral(double time1, double time2)&lt;/code&gt;, and &lt;code&gt;IntegralSquare(double time1, double time2)&lt;/code&gt; methods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can however acheive the same with simple inherritance. I can also avoid having to use the clone method by using &lt;code&gt;std::make_unique&lt;/code&gt; outside of the class.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My version of this is as follows. (I use a &lt;code&gt;curve&lt;/code&gt; class instead of a &lt;code&gt;parameters&lt;/code&gt; class)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#include &amp;lt;vector&amp;gt;&#xA;#include &amp;lt;memory&amp;gt;&#xA;&#xA;class curve&#xA;{&#xA;public:&#xA;&#xA;    virtual double Integral(double time1, double time2) const = 0;&#xA;    virtual double IntegralSquare(double time1, double time2) const = 0;&#xA;&#xA;    virtual double Mean(double time1, double time2) const {&#xA;        return Integral(time1, time2) / (time2 - time1);&#xA;    }&#xA;&#xA;    virtual double RootMeanSquare(double time1, double time2) const {&#xA;        return IntegralSquare(time1, time2) / (time2 - time1);&#xA;    }&#xA;};&#xA;&#xA;class constant_curve : curve&#xA;{&#xA;public:&#xA;&#xA;    constant_curve() = default;&#xA;    constant_curve(const constant_curve &amp;amp;) = default;&#xA;    constant_curve &amp;amp; operator=(const constant_curve &amp;amp;) = default;&#xA;&#xA;    constant_curve(double value):&#xA;        m_val{value}&#xA;    {}&#xA;&#xA;    virtual double Integral(double time1, double time2) const override{&#xA;        return (time2 - time1)*m_val;&#xA;    }&#xA;&#xA;    virtual double IntegralSquare(double time1, double time2) const  override{&#xA;        return (time2 - time1)*m_val*m_val;&#xA;    }&#xA;&#xA;private:&#xA;    double m_val;&#xA;};&#xA;&#xA;int main()&#xA;{&#xA;    std::vector&amp;lt;std::unique_ptr&amp;lt;curve&amp;gt;&amp;gt; curves;&#xA;    curves.emplace_back(std::make_unique&amp;lt;constant_curve&amp;gt;(10));&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My Question is this:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the reasons to use the bridge pattern as used in the book as apposed to the more simple pattern above?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure if I am allowed to copy the code to this forum, so here is a link to the code. &lt;a href=&quot;http://www.markjoshi.com/design/DesignCPP.zip&quot; rel=&quot;noreferrer&quot;&gt;Design Patterns and Derivatives Pricing 2nd Edition&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="15457" LastActivityDate="2017-02-24T18:15:15.107" Title="Mark Joshi, C++ Design Patterns and Derivatives Pricing : Bridge Pattern vs More Simple Inheritance" Tags="&lt;programming&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32637" PostTypeId="2" ParentId="32625" CreationDate="2017-02-23T13:20:16.920" Score="1" Body="&lt;p&gt;We want to show that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;0 \leq C_0 \left( K_2 \right) - C_0 \left( K_1 \right) \leq e^{-r T} \left( K_2 - K_1 \right)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $K_1 &amp;lt; K_2$. For the moment we don't worry about strict inequality but I will get back to that later. We also need to assume that there are no holding returns to the underlying asset (e.g. dividends, repos, ...).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To show the first inequality, it is sufficient to note that the portfolio $C_0 \left( K_2 \right) - C_0 \left( K_1 \right)$ has a non-negative payoff at maturity&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;V_T = \begin{cases} 0 &amp;amp; \text{if } S_T &amp;lt; K_1\\ S_T - K_1 &amp;amp; \text{if } S_T \in \left( K_1, K_2 \right)\\ K_2 - K_1 &amp;amp; \text{otherwise} \end{cases}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, if the current value of this portfolio would be negative, we'd have an arbitrage of the type &quot;free lunch&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the second inequality, note that the payoff is bounded from above by $\Delta = K_2 - K_1$. If the current value $V_0$ of the spread was greater than $e^{-r T} \Delta$, then we would sell it now, invest the proceeds in the risk-free asset and have a terminal value of strictly more than $\Delta$ for an obligation of at most $\Delta$. Again, this is a free lunch.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the strictly inequality: In the first case if $V_0 = 0$ and there is a non-zero probability of $S_T &amp;gt; K_1$, then we'd have a &quot;free lottery&quot; arbitrage. I.e. you pay nothing for something that gives you a non-negative payoff with probability one and a strictly positive payoff with a strictly positive probability. In the second case if the probability of $S_T &amp;lt; K_2$ is also non-zero, then you can make the same argument for receiving $e^{-r T} \Delta$ now for a future obligation that is never bigger than $\Delta$ but has a strictly positive probability of being smaller.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2017-02-23T13:20:16.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32640" PostTypeId="1" CreationDate="2017-02-23T16:33:23.403" Score="0" ViewCount="6463" Body="&lt;p&gt;What is the difference between &lt;em&gt;performance fees&lt;/em&gt; and &lt;em&gt;carried interest&lt;/em&gt; when talking about funds and compensation schemes?&lt;/p&gt;&#xA;" OwnerUserId="26707" LastEditorUserId="467" LastEditDate="2017-02-26T04:30:46.873" LastActivityDate="2018-02-28T18:54:03.347" Title="What is the difference between performance fees and carried interest?" Tags="&lt;funds&gt;&lt;fees&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32641" PostTypeId="1" CreationDate="2017-02-23T17:02:46.777" Score="1" ViewCount="102" Body="&lt;p&gt;I meant the method in this paper: &#xA;&lt;a href=&quot;https://www.jstor.org/stable/2329348&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.jstor.org/stable/2329348&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5667" LastEditorUserId="24222" LastEditDate="2017-02-23T17:14:29.560" LastActivityDate="2017-02-23T17:14:29.560" Title="Is Hasbrouck's information share measure a good indicator of whether a price leads others, and are there alternative indicators?" Tags="&lt;high-frequency&gt;&lt;market-microstructure&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32642" PostTypeId="2" ParentId="18294" CreationDate="2017-02-23T17:47:42.923" Score="6" Body="&lt;p&gt;What you're describing sounds like the reverse of a &lt;a href=&quot;https://en.wikipedia.org/wiki/Fama%E2%80%93MacBeth_regression&quot; rel=&quot;noreferrer&quot; title=&quot;Fama-Macbeth regression&quot;&gt;Fama-Macbeth regression&lt;/a&gt;. The original Fama-Macbeth approach estimated rolling time series regressions to get CAPM betas and then doing a cross-sectional regression to estimate the overall sensitivity of returns to beta. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I were to write down what the model looks like, I think you're talking about something like below&#xA;$$y_{it}=\alpha_{i}+G_{it}F_{t}\beta_{i}+\varepsilon_{i}&#xA; $$&#xA;where $G$ are firm characteristics, $F$ are the cross-sectional factor estimates and $\beta$ are the time series betas. One thing that stands out is that $F$ and $\beta$ are only identified because you're talking a two-step approach. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Offhand, I know of no papers that take the approach you describe. I would be more worried about some of the issues with Fama-Macbeth, like getting the standard errors right. For the errors in variables issue, I can't say for sure, but my hunch is that most finance data is wide so the standard error on cross-sectional regressions should be low enough that it isn't a huge issue. Further, I would expect the betas to be strongly correlated with the average level of the firm characteristics over time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A better question is why you would want to take this approach. Using firm characteristics means that the exposure of each stock to the factor changes over time. It is more responsive than the time series beta will be. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It makes more sense to me to do the cross-sectional regressions &#xA;$$&#xA;y_{i}=\alpha+G_{i}F+\varepsilon_{i}&#xA;$$&#xA;and get the residuals&#xA;$$&#xA;\varepsilon_{i,t}=y_{i,t}-\alpha_{i}-G_{i,t}F_{i}&#xA;$$&#xA;and then do a time series regression of the residuals against the factors to see if there is any lingering exposure&#xA;$$&#xA;\varepsilon_{t}=\alpha_{t}+\beta F_{t}+\eta_{t}&#xA; $$&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2017-02-23T17:47:42.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32643" PostTypeId="2" ParentId="32625" CreationDate="2017-02-23T18:21:08.123" Score="1" Body="&lt;p&gt;Let $x^+ = \max(x, 0)$. Note that, for any two real numbers $x$ and $y$,&#xA;\begin{align*}&#xA;(x+y)^+ \le x^+ + y^+.&#xA;\end{align*}&#xA;Then, for $K_1 &amp;lt; K_2$,&#xA;\begin{align*}&#xA;(S_T-K_1)^+ &amp;amp;= (S_T-K_2+ K_2-K_1)^+\\&#xA;&amp;amp;\le (S_T-K_2)^+ + K_2-K_1,&#xA;\end{align*}&#xA;and, consequently,&#xA;\begin{align*}&#xA;(S_T-K_1)^+ -(S_T-K_2)^+ \le K_2-K_1.&#xA;\end{align*}&#xA;Therefore,&#xA;\begin{align*}&#xA;C(T, K_1) -C(T, K_2) \le (K_2-K_1)e^{-rT}.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-02-23T18:58:44.710" LastActivityDate="2017-02-23T18:58:44.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32644" PostTypeId="1" CreationDate="2017-02-23T21:59:22.377" Score="4" ViewCount="1869" Body="&lt;p&gt;Say we plot the implied volatility against strike price and moneyness for some options. As the implied volatility depends on the option pricing model it is reasonable to expect some differences here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What do the curves look like for the Bachelier model and the Black-Scholes model, respectively? What is the difference, where is it located (in terms of term and moneyness) and why is it there?&lt;/p&gt;&#xA;" OwnerUserId="26708" LastEditorUserId="467" LastEditDate="2017-02-26T04:21:50.857" LastActivityDate="2017-02-26T04:21:50.857" Title="Is the Implied Volatility Curve different under the Black-Scholes and Bachelier models?" Tags="&lt;implied-volatility&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32646" PostTypeId="1" AcceptedAnswerId="32647" CreationDate="2017-02-24T00:30:10.423" Score="3" ViewCount="1895" Body="&lt;p&gt;I am calculating the historical portfolio variance of various long-short equity portfolios.  For simplicity, assume the portfolio is long stock A with weight 1.0 and short stock B with weight -0.5.  So cash/risk free is 0.5 for an overall portfolio weight of 1.0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $\sigma^2_\text{risk free} = 0$ and $\sigma^2_{\text{risk free}, X} = 0$, I reduce the portfolio to a 2x2 covariance matrix for A and B with weights [1.0, -0.5]. However, the weights don't total 1 for this portfolio and I thought the weights have to total one?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I thinking about this correctly?&lt;/p&gt;&#xA;" OwnerUserId="26709" LastEditorUserId="467" LastEditDate="2017-02-24T02:27:39.073" LastActivityDate="2017-02-24T02:27:39.073" Title="How to compute the variance of a Long-Short Equity Portfolio?" Tags="&lt;portfolio&gt;&lt;variance&gt;&lt;covariance-matrix&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32647" PostTypeId="2" ParentId="32646" CreationDate="2017-02-24T00:50:42.677" Score="5" Body="&lt;p&gt;We have weights $w_A$, $w_B$ and $w_C = 1 - w_A - w_B$ that sum to $1$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With de-meaned returns $r_A$, $r_B$, and $r_C$, the portfolio variance is&#xA;$$E\{[w_A r_A + w_B r_B + (1 - w_A - w_B)r_C]^2 \} = w_A^2\sigma_A^2 + w_B^2\sigma_B^2 + 2 w_A w_B\rho_{AB}\sigma_A \sigma_B,$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;assuming the cash volatility $\sigma_C$ is zero.&lt;/p&gt;&#xA;" OwnerUserId="8153" LastActivityDate="2017-02-24T00:50:42.677" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32649" PostTypeId="2" ParentId="32640" CreationDate="2017-02-24T01:27:10.860" Score="3" Body="&lt;p&gt;I am not a tax lawyer or a CPA.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Carried interest&quot; is a specific type of &quot;performance fee&quot; that is charged by the General Partner of an investment fund as an incentive/reward for good performance of the fund. They are common in Private Equity, some Hedge Funds, maybe VC. (Keep in mind that performance fee arrangements differ, not all funds are partnerships (LLCs, Investment Companies (or 1940 Act companies), etc. also exist), and even partnerships can have different setups.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose a partnership manages 100 million dollars, the general partner owns 10% and 18 limited partners own 5% each; you are one of these 18 partners. Suppose a year later the fund is worth 110 million dollars. You say great, everyone made 10% on their money. But not so fast, the fund made 10 million,but we have to take into account a performance fee of 20% of profits for the general partner. To do this, the accountant assigns the GP an additional &quot;interest&quot; (or quota, or share) in the fund so he now owns 11.636% of the fund, and the limited partners own 4.909% each.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's going on? Your share is now worth 110*0.04909 or 5.4 million, which is a profit of 0.4 and a return of 6.2% on your initial capital of 5. The GP's share is 110*0.11636 or 12.8 million, a gain of 2.8 million. This 2.8 million can also be explained as follows: 1 million as a 10% partner, plus 20% of the other partners profit, i.e 0.2*9.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The beauty of this arrangement is that the IRS treats this as a capital gain for the GP. The GP argues that &quot;I didn't take any money out, I am just reinvesting in the business, like a rancher who has more cattle at the end of the year than at the beginning. I am not going to be able to spend the money until I close out the fund [or sell the cattle to the slaughterhouse]. Until then I am just &quot;carrying&quot; my additional interest in the business forward&quot;. The critics disagree with this tax treatment, they say that a &quot;capital gain&quot; is when your shares of Exxon increase in value through no effort of your own; on the other hand the GP is receiving a reward for his efforts, which is the definition of compensation, and should be taxed as such. It is a complicated controversy and I have changed my mind over time as to who is right about the tax issue. But this is how it works as I understand it.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-02-24T01:27:10.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32650" PostTypeId="2" ParentId="32644" CreationDate="2017-02-24T07:16:46.423" Score="2" Body="&lt;p&gt;For the Black Scholes model, the smile depends on the asset is what I've found. The smile is also different for equity and equity index options. &#xA;For equity index, the part of the smile is on the downside, lower than the current price, is more or less a straight line and on the upside resembles the definition of smile that you see. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For equity options, the smile for most times is fairly simple as in the definition would say, but I have seen times when the ATM vols were higher than the vols on either side of the curve. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This of course is true for the market I trade, different markets would have their own idiosyncrasy.&lt;/p&gt;&#xA;" OwnerUserId="15428" LastActivityDate="2017-02-24T07:16:46.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32652" PostTypeId="1" CreationDate="2017-02-24T11:38:25.753" Score="2" ViewCount="117" Body="&lt;p&gt;It is known that if the numeraire is the bank account, then the martingale measure is determined by the fact that every asset has $r$ as its local rate of return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the local rate of return is the &quot;multiplier&quot; of the stock price in the dt-term of the SDE. That is, if $$dS_t = S_t\alpha dt + S_t\sigma dW$$&#xA;then $\alpha$ is the local rate of return, which must be equal to $r$ under the martingale measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, imagine if under the $P$-measure, $S_t$ satisfied the SDE$$dS_t = \alpha dt + \sigma dW,$$&#xA;in this case, what is the equivalent martingale measure requirement? &lt;/p&gt;&#xA;" OwnerUserId="26715" LastActivityDate="2017-02-24T14:36:50.660" Title="What is the martingale measure requirement when $\mu(t,S(t)) = \mu(t)$?" Tags="&lt;martingale&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32653" PostTypeId="2" ParentId="32644" CreationDate="2017-02-24T12:27:56.127" Score="5" Body="&lt;p&gt;As @nimbus3000 mentions, the shape of the vol curve differs by markets so I won't comment on that here. I'll restrict my comments to the Black(-Scholes) vs. Bachelier section of the question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can approximate Normal (Bachelier) vols from Black vols by (there is a second order effect related to the product of the square of the Black vol and the maturity but ignored here):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\sigma_N = \sigma_B \sqrt{F\times K}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $F$ and $K$ are the forward and strike, respectively. Since you're interested in moneyness, consider $K = F\times k$ for some %-moneyness $k$. Then &#xA;$$&#xA;\sigma_N = \sigma_B \times F \sqrt{k}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From this I have 2 observations:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Bachelier vols are not independent of the level of the underlying (unlike Black vols).&lt;/li&gt;&#xA;&lt;li&gt;The transformation is almost linear in F, so the shape of the Bachelier vol skew for a given maturity will roughly mimic the shape of the Black curve.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="7166" LastActivityDate="2017-02-24T12:27:56.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32654" PostTypeId="1" CreationDate="2017-02-24T13:21:01.667" Score="2" ViewCount="43" Body="&lt;p&gt;In a foreign currency model, domestic and foreign stocks + exchange rate is modelled via 3 Wiener processes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to price options in this model, however, I am unsure what some realistic values for the volatility vectors are? I am noticing in particular that the value of my price ranges wildly (mainly it goes to 0) for certain volatility choices. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is because the pricing function contains an exponential to the power of the negative of a dot product of volatility vectors.... so a poor choice of volatilities leads to an incredibly low value due to this exponential factor.&lt;/p&gt;&#xA;" OwnerUserId="26716" LastActivityDate="2017-02-24T15:11:09.203" Title="What are some reasonable parameters with three Wiener processes?" Tags="&lt;parameter-estimation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32655" PostTypeId="2" ParentId="32654" CreationDate="2017-02-24T14:09:38.827" Score="1" Body="&lt;p&gt;Using weekly data for the last 5 years for DAX (german equity index), S&amp;amp;P (US equity index) and EUR (value of &quot;german&quot; currency priced in US dollars) we have the following results:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EUR fluctuates with an annualized volatility of 8.8% a year, DAX with vol of 18% a year and S&amp;amp;P vol 12% a year. In my experience it is generally true that a currency is  less volatile than a major stock index (as a rough guide about half as volatile). I am a little surprised by how low S&amp;amp;P vol has been, my guess would have been 14 or 15%; DAX typically a little more volatile than S&amp;amp;P and this is confirmed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The correlations of the currency with the two stock indexes are as follows: EUR with DAX is -0.23. This is in agreement with a general observation I/many people made over the years: when American investors see a foreign stock market go up, they usually see the currency of that country go down and vice versa (not always true of course). Between EUR and S&amp;amp;P correlation is -0.05, perhaps a little surprising to me, I would have expected it slightly positive. But generally these correlations are between -0.25 and 0.25 in my experience, i.e. not very large.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[I left out the correlation between DAX and S&amp;amp;P: it is 0.725. Major world stock markets are always positively correlated].&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course for a stock (as opposed to a stock index) the volatilities would be much higher (maybe double).&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-02-24T15:11:09.203" LastActivityDate="2017-02-24T15:11:09.203" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32656" PostTypeId="2" ParentId="32652" CreationDate="2017-02-24T14:31:04.963" Score="2" Body="&lt;p&gt;Let $B_t$ denote the $t$-value of a riskless money market account in which 1 unit of currency has been invested at time $t=0$. We have $B_t = e^{rt}$, where $B_t$ solves &#xA;$$dB_t = B_trdt,\quad B_0=1 \tag{0} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $S_t$ represents the $t$-value of a tradable asset, then in the &lt;em&gt;absence of arbitrage opportunity&lt;/em&gt; we must have that (fundamental theorem of asset pricing):&#xA;$$ \frac{S_t}{B_t} \text{ is a } \Bbb{Q} \text{-martingale} $$&#xA;in other words&#xA;\begin{align}&#xA;d\left(\frac{S_t}{B_t}\right) &amp;amp;= \frac{dS_t}{B_t} - \frac{S_t}{B_t^2} dB_t + 0  \tag{Itô} \\ &amp;amp;= \frac{1}{B_t} \left( dS_t - S_t r dt \right) \tag{using $(0)$} \\&#xA;&amp;amp;= \dots dW_t^\Bbb{Q} \tag{1} &#xA;\end{align}&#xA;by the &lt;em&gt;martingale representation theorem&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that for $(1)$ to hold it is necessary to have:&#xA;$$ dS_t = \color{blue}{rS_t} dt + \dots dW_t^\Bbb{Q} $$&#xA;This is the equivalent martingale measure requirement you're looking for.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Now, to reach that $rS_t$ drift under $\Bbb{Q}$, you shall not use the same Girsanov kernel depending on whether $S_t$ follows a GBM or an ABM under $\Bbb{P}$ but that's another question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the first case you'll have: $$dS_t = \alpha S_t dt + \sigma S_t dW_t^\Bbb{P} \to dS_t = \color{blue}{rS_t} dt + \sigma S_t dW_t^\Bbb{Q} $$&#xA;with $$\left. \frac{d\Bbb{Q}}{d\Bbb{P}} \right\vert_{\mathcal{F}_t} = \mathcal{E}\left[ -\lambda W_t^\Bbb{P}\right], \quad \lambda=\frac{\alpha-r}{\sigma}$$&#xA;In the second:&#xA;$$dS_t = \alpha dt + \sigma dW_t^\Bbb{P} \to dS_t = \color{blue}{rS_t} dt + \sigma dW_t^\Bbb{Q} $$&#xA;with $$\left. \frac{d\Bbb{Q}}{d\Bbb{P}} \right\vert_{\mathcal{F}_t} = \mathcal{E}\left[ -\lambda W_t^\Bbb{P}\right], \quad \lambda=\frac{\alpha-rS_t}{\sigma}$$&#xA;See this &lt;a href=&quot;https://pdfs.semanticscholar.org/2315/bbe439680db469a8f0519bebd9b07c68f384.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;paper&lt;/a&gt; if you want more mathematical details.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2017-02-24T14:36:50.660" LastActivityDate="2017-02-24T14:36:50.660" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32657" PostTypeId="1" CreationDate="2017-02-24T15:12:53.873" Score="7" ViewCount="561" Body="&lt;p&gt;LIBOR - rate at which banks in LONDON would lend to each other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a similar index for banks in New York (or any other major financial city) would lend to each other? For example, what is the rate that JPMorgan would lend to Bank of America in New York, is it still LIBOR or somethign else? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is 'LONDON' here just for legacy purposes, and LIBOR today really means the rate at which major banks would lend to each  other, regardless of city? eg, USD Libor is the rate bank would lend money in USD to each other, TIBOR is the rate at which banks would lend money in JPY to each other. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the answer to the above is NO: it is still specific to banks in london. Then why would say a swap contract made purely between 2 US counterparties still be based no LIBOR rate? How is it got anything to do with London? Simialr, why would US mortgages, which are purely domestic, be based on LIBOR?&lt;/p&gt;&#xA;" OwnerUserId="26718" LastActivityDate="2017-02-26T01:45:26.923" Title="What does LIBOR really represent?" Tags="&lt;libor&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32658" PostTypeId="2" ParentId="32657" CreationDate="2017-02-24T16:43:00.103" Score="5" Body="&lt;p&gt;Good questions!  Libor is indeed specific to London, Tibor is specific to Tokyo.  In New York banks lend to each other overnight in the Federal Funds market (confusingly, the Fed is not a counterparty to those trades; they are overnight  interbank trades).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The interest rate swap market started in London in the 1980s , and spread worldwide.  As it spread, some local markets changed the index to a local one (eg Tibor for Yen swaps, or Euribor for Euro swaps).  Some retained the Libor (eg in New York for USD swaps).  Why are some US mortgages based on Libor?  Here I am guessing a bit, but I would say (1) when the mortgages are sold to investors, they need an index that is familiar to those investors (2) lack of a comparable US index - there is Fed funds, but that is an overnight rate rather than a 3 month lending rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your questions are highly relevant at the current time.  Following the Libor scandals of recent years, regulators are hoping an that alternative indices will be developed, in the US and elsewhere. &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-02-24T16:43:00.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32659" PostTypeId="2" ParentId="32657" CreationDate="2017-02-24T16:45:46.393" Score="4" Body="&lt;p&gt;Many major currencies/money markets have both an onshore money market and an offshore market. London is the offshore market for the USA. All major US banks have a branch in London. Historically this offshore market developed to escape US domestic regulations in the 1960's, but it still survives and even thrives, despite major changes (for example the volume of interbank borrowing nowadays is very very small, and the regulations of the 1960's have been largely abolished). Nowadays Libor is useful mainly as a benchmark because it is (was thought to be) an objective standard, free of government regulation and difficult to manipulate (ha!). The skill and creativity of the London banking community also played a role in keeping London important (can this continue after Brexit?).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the US banks can lend/borrow from each other through the intermediary of the Federal Reserve: the Federal Funds market, and in some other ways also (but again this activity is very low right now).&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-02-24T16:53:38.823" LastActivityDate="2017-02-24T16:53:38.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32660" PostTypeId="2" ParentId="32635" CreationDate="2017-02-24T17:54:41.890" Score="1" Body="&lt;p&gt;Here are my thought, it is more an attempt to answer than a proper answer, I may be wrong :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Page 54 of the book it is written :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[...] &lt;em&gt;What we&#xA;would really like is a pay-off class that has the nice polymorphic features that&#xA;our class does, whilst &lt;strong&gt;taking care of its own memory management&lt;/strong&gt;. There are a&#xA;couple of approaches to solving this problem. &lt;strong&gt;One is to use a wrapper class&lt;/strong&gt; that has Bridging with a virtual constructor&#xA;been templatized: this is really generic programming rather than object-oriented&#xA;programming, and we explore this approach in Section 5.4. &lt;strong&gt;The other is known&#xA;as the bridge pattern.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I understand that the bridge patterns aims to take care of memory . In the code, the only member of the &lt;code&gt;parameter&lt;/code&gt; class is a pointer to the abstract class &lt;code&gt;ParametersInner&lt;/code&gt;. And the role of the &lt;code&gt;parameter&lt;/code&gt; class is to manage memory associated to the &lt;code&gt;ParametersInner&lt;/code&gt; by encapsulating the &lt;code&gt;new&lt;/code&gt; (trough the clone) and &lt;code&gt;delete&lt;/code&gt; inside its constructor/destructor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I believe that this extra level of inheritance acts exactly has a smart pointer does. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second approach, the wrapper class presented in 5.4 is in essence a smart pointer, but I believe that the use of smart pointer wasn't really common at the time the author wrote the book (2004 for the first edition, and 2007 for the second) and this is probably the reason why he mainly considers the bridge patterns that seems a bit outdated to me. Note that &lt;code&gt;std::make_unique&lt;/code&gt; is a c++14 feature that has only been officially released in 2014 and  &lt;code&gt;std::make_shared&lt;/code&gt; is a feature of c++11 introduced in 2011 .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A short chapter has been added in the second edition to present smart pointer. The author briefly present smart pointer in chapter 13.3, but it seems more like a last minute addition to an already written book  (first edition) than a real consideration. As you said, I believe that most of the code's book could have been redesigned in a simplest way thanks to smart pointers. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So to sum up, despite that it is, according to me, an essential book about c++ derivatives, I think it is now a bit outdated, the use of smart pointer, common nowadays, would considerably ease the design. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So finally :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the reasons to use the bridge pattern as used in the book as opposed to the more simple pattern above?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because smart pointers weren't really available at this time (except with the boost library..) , history matters. &lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2017-02-24T18:15:15.107" LastActivityDate="2017-02-24T18:15:15.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32661" PostTypeId="2" ParentId="27543" CreationDate="2017-02-24T18:43:41.810" Score="1" Body="&lt;p&gt;The new curve will look a bit strange no matter how you do it, although 1bp is not such a big move that will render it &quot;useless&quot;.  Two ways of doing it, as you point out, are (a) use a spline method, which will do whatever it will do, including moving some points that are far away from the point in question, and (b) do some linear interpolation, as you specify.   The practical effect of this choice is that your hedges look very different.  For example, if you do a swap with maturity t(i-0.5), under the second method the hedge will be a mixture of t(i-1) swaps and t(i) swaps, whereas under the first method the hedge could contain swaps from all over the curve in various amounts.  This is a matter of preference.  Some poeple like the simplicity of (b), but I like (a) better myself.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-02-24T18:43:41.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32663" PostTypeId="1" AcceptedAnswerId="32680" CreationDate="2017-02-24T22:28:44.997" Score="0" ViewCount="301" Body="&lt;p&gt;Based on &lt;a href=&quot;http://www.quantonline.co.za/documents/FxDerivativesAdvFinT1.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;this text about FX options&lt;/a&gt; on pages 139, 141 and 145 I'm trying to compute the delta of a down and out call with the strike below the barrier. Here is a quick and dirty Python code (I assume 0 interest rates and ignore the rebate for simplicity):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;from scipy.stats import norm&#xA;from math import log, sqrt&#xA;def delta(ttm,S,K,H,sig):&#xA;    x1  = ((sig*sqrt(ttm))**-1) * (log(S/H)+(0.5*sig**2)*ttm)&#xA;    y1  = ((sig*sqrt(ttm))**-1) * (log(H/S)+(0.5*sig**2)*ttm)&#xA;    mu  = -0.5*sig**2    &#xA;    lam = 1+(mu*sig**-2)&#xA;&#xA;    E   = S*((H/S)**(2*lam))*norm.cdf(y1)-K*((H/S)**(2*lam-2))*norm.cdf(y1-sig*sqrt(ttm))     &#xA;&#xA;    dDdS = norm.cdf(x1)-K*(norm.pdf(x1)/(sig*sqrt(ttm)))*(1-(K/H))&#xA;&#xA;    dEdS = (2/S)*(1-lam)*E-((H/S)**(2*lam))*norm.cdf(y1) \&#xA;                         - ((H/S)**(2*lam))*(norm.pdf(y1)/(sig*sqrt(ttm)))*((K/H)-1)             &#xA;    return dDdS -dEdS&#xA;&#xA;#args: ttm,spot,strike,barrier,vol&#xA;delta(0.2,1400,1300,1350,0.2) &#xA;&amp;gt;&amp;gt; -193.12173389762643        #this looks bad&#xA;delta(0.2,1.400,1.300,1.350,0.2) &#xA;&amp;gt;&amp;gt; 0.6447696223910977&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;a href=&quot;http://www.quantonline.co.za/documents/FxDerivativesAdvFinT1.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.quantonline.co.za/documents/FxDerivativesAdvFinT1.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My question is not about the code. I'm pretty sure it is correct but really wonder why the results are so strange? Can this delta really become negative (I think no), or is the formula wrong? Maybe someone else already read the mentioned text and can comment? &lt;/p&gt;&#xA;" OwnerUserId="20736" LastEditorUserId="20736" LastEditDate="2017-02-25T13:31:54.890" LastActivityDate="2017-02-26T03:57:12.443" Title="Strange Delta for FX Down And Out Call, Strike below Barrier" Tags="&lt;fx&gt;&lt;delta&gt;&lt;barrier&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="32664" PostTypeId="2" ParentId="9002" CreationDate="2017-02-24T23:13:12.487" Score="4" Body="&lt;p&gt;Using Andy Flury answer and bit polishing it gives following Python class for PnL calculator:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;class PnLCalculator:&#xA;    def __init__(self):&#xA;        self.quantity = 0&#xA;        self.cost = 0.0&#xA;        self.market_value = 0.0&#xA;        self.r_pnl = 0.0&#xA;        self.average_price = 0.0&#xA;&#xA;    def fill(self, n_pos, exec_price):&#xA;        pos_change = n_pos - self.quantity&#xA;        direction = np.sign(pos_change)&#xA;        prev_direction = np.sign(self.quantity)&#xA;        qty_closing = min(abs(self.quantity), abs(pos_change)) * direction if prev_direction != direction else 0&#xA;        qty_opening = pos_change if prev_direction == direction else pos_change - qty_closing&#xA;&#xA;        new_cost = self.cost + qty_opening * exec_price&#xA;        if self.quantity != 0:&#xA;            new_cost += qty_closing * self.cost / self.quantity&#xA;            self.r_pnl += qty_closing * (self.cost / self.quantity - exec_price)&#xA;&#xA;        self.quantity = n_pos&#xA;        self.cost = new_cost&#xA;&#xA;    def update(self, price):&#xA;        if self.quantity != 0:&#xA;            self.average_price = self.cost / self.quantity&#xA;        else: &#xA;            self.average_price = 0&#xA;        self.market_value = self.quantity * price&#xA;        return self.market_value - self.cost&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and using it :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;positions = np.array([200, 100, -100, 150, 50, 0])&#xA;exec_prices = np.array([50.0, 51.0, 49.0, 51.0, 53.0, 52.0])&#xA;pnls = []&#xA;print('Pos\t|\tR.P&amp;amp;L\t|\tU P&amp;amp;L\t|\tAvgPrc')&#xA;print('-' * 55)&#xA;pos = PnLCalculator()&#xA;pnls = []&#xA;for (p,e) in zip(positions, exec_prices):&#xA;    pos.fill(p, e)&#xA;    u_pnl = pos.update(e)&#xA;    print('%+d\t|\t%.1f\t|\t%.1f\t|\t[%.1f]' % (pos.quantity, pos.r_pnl, u_pnl, pos.average_price))&#xA;    pnls.append(u_pnl + pos.r_pnl)&#xA;print('-' * 55)&#xA;print(pnls)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Pos     |   R.P&amp;amp;L   |   U P&amp;amp;L   |   AvgPrc&#xA;-------------------------------------------------------&#xA;+200    |   0.0     |   0.0     |   [50.0]&#xA;+100    |   100.0   |   100.0   |   [50.0]&#xA;-100    |   0.0     |   0.0     |   [49.0]&#xA;+150    |   -200.0  |   0.0     |   [51.0]&#xA;+50     |   0.0     |   100.0   |   [51.0]&#xA;+0      |   50.0    |   0.0     |   [0.0]&#xA;-------------------------------------------------------&#xA;[0.0, 200.0, 0.0, -200.0, 100.0, 50.0]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13348" LastEditorUserId="20281" LastEditDate="2020-02-25T15:50:07.160" LastActivityDate="2020-02-25T15:50:07.160" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="32669" PostTypeId="2" ParentId="32076" CreationDate="2017-02-25T06:58:47.743" Score="1" Body="&lt;p&gt;Think of whatever scaling operation that you're using as a model whose parameters were fitted on historical data. The estimated parameters are static.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, say one of your features has a minimum value of -3 and maximum value of 5 in your 20 day history, so min-max scaling of 0-1 would take the form:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\hat{f}: x \mapsto \dfrac{x-x_{min}}{x_{max}-x_{min}},\ x_{min}=-3,\ x_{max}=5$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And you can handle new data points $x$. If you encounter a new feature value of 11 in the future, $\hat{f}\left(11\right)=1.75$. Whether it's valid for your value to fall outside $\left[0,1\right]$ is another issue that depends on your model assumptions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other answer before me details the other issue pretty well - how you let the history grow is both a statistical and algorithm design problem. Back to the example I've given, you could let a mix-max scaler scale indefinitely as it requires both $\mathbb{O}\left(1\right)$ memory and amortized $\mathbb{O}\left(1\right)$ time.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2017-02-25T06:58:47.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32670" PostTypeId="1" CreationDate="2017-02-25T07:44:13.177" Score="0" ViewCount="76" Body="&lt;p&gt;Why is Yahoo finance's historical prices so high. For example, IBM's prices in the 70s are in the $300 range. I know that there are some errors in this data, but this a trend in many of their charts. What is this price reflect? I'm sure it's not the market price in 70s dollars. Is this also an error in data before they started collecting it or does it take into account of splits or something else?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.quandl.com/data/YAHOO/IBM-IBM-International-Business-Machines&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.quandl.com/data/YAHOO/IBM-IBM-International-Business-Machines&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6663" LastActivityDate="2017-02-25T09:24:04.543" Title="Why is Yahoo finance's historical prices so high" Tags="&lt;data&gt;&lt;market-data&gt;&lt;yahoofinance&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32671" PostTypeId="2" ParentId="32670" CreationDate="2017-02-25T09:11:18.627" Score="2" Body="&lt;p&gt;Prices (and potentially volumes) have been adjusted for historical corporate actions. For example, if there was a 10:1 split in the past, then todays share is equivalent to 1/10th of a share before the split. This is the correct way to view price/volume time series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here it seems that corporate adjustments before a point were not applied. When you look at the IBM splits, you can see that the split in '66, '68, '73 and '79 have not been applied in Yahoo finance. &#xA;&lt;a href=&quot;http://www.ibm.com/investor/pdf/ibm_ir_stock_splits_2008.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.ibm.com/investor/pdf/ibm_ir_stock_splits_2008.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11610" LastEditorUserId="11610" LastEditDate="2017-02-25T09:24:04.543" LastActivityDate="2017-02-25T09:24:04.543" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32672" PostTypeId="1" AcceptedAnswerId="33344" CreationDate="2017-02-25T10:14:07.583" Score="5" ViewCount="688" Body="&lt;p&gt;Having done FX trading as a hobby for nearly two years now (and having made some profit overall), I now have got a fundamental question which I &lt;em&gt;think&lt;/em&gt; I already have the answer to, but I would like to know for sure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is if the risk for long positions is higher than for short positions or vice versa in FX trading. I am &lt;em&gt;not&lt;/em&gt; talking about the risk which is caused by economic or political situations or changes, but about the amount of money I could loose if the market goes to the wrong direction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think I can't make my question clear without an example. Suppose the following situation:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I am trading EUR/USD.&lt;/li&gt;&#xA;&lt;li&gt;My trading account currency (eventually the right term is home currency) is EUR.&lt;/li&gt;&#xA;&lt;li&gt;I have 1,100,000 EUR available at my trading account.&lt;/li&gt;&#xA;&lt;li&gt;My broker is a market maker.&lt;/li&gt;&#xA;&lt;li&gt;The leverage is 1:1.&lt;/li&gt;&#xA;&lt;li&gt;The spread is always 0.&lt;/li&gt;&#xA;&lt;li&gt;The margin is always 0.&lt;/li&gt;&#xA;&lt;li&gt;The rollover fee is always 0.&lt;/li&gt;&#xA;&lt;li&gt;1 EUR is worth exactly 1 USD when opening a position.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I know that these conditions are not realistic, but they will simplify the answer to my question drastically and help us concentrate on the crux of the matter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Long EUR position (&quot;buy&quot;)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I am opening a long position of 100,000 EUR. Technically, as far as I have understood, that means that I am taking a credit of 100,000 USD (exchange rate when opening is 1:1 as defined above) from my broker and immediately am exchanging that money to 100,000 EUR. Thus, I now have 100,000 EUR available at some virtual place, but I am owing my broker 100,000 USD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now lets assume that the exchange rate becomes 1 EUR = 0.1 USD (i.e. 10 EUR = 1 USD), i.e. the market changes in the wrong direction (from my point of view) by a factor of 10.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, when closing the position, I must give my broker his credit (100,000 USD) back. When doing so, I am first taking the 100,000 EUR from their virtual place, exchange them into USD and give them back to my broker. Since the exchange rate now is 1 EUR = 0.1 USD, I give my broker only 10,000 USD back that way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That means that I am still owing my broker 90,000 USD. Given the exchange rate of 10 EUR = 1 USD, I have to use 900,000 EUR from my trading account for doing so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, I have lost 900,000 EUR during that trade which has been worth 100,000 EUR. Please note that this loss does not have anything to do with leverage! Of course, I know that it is a fundamental principle of FX trading that you could lose more money than you have available due to the leverage, but once again, we have assumed a leverage of 1:1 for that example!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Short EUR position (&quot;sell&quot;)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mentally going back to the initial situation, I now open a short position of 100,000 EUR. Technically, as far as I have understood, that means that I am taking a credit of 100,000 EUR from my broker and immediately am exchanging that money to 100,000 USD (exchange rate when opening is 1:1 as defined above). Thus, I now have 100,000 USD available at some virtual place, but I am owing my broker 100,000 EUR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, let's assume that the exchange rate becomes 1 EUR = 10 USD (i.e. 0.1 EUR = 1 USD), i.e. the market changes in the wrong direction (from my point of view) by a factor of 10.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, when closing the position, I have to give my broker his credit back (100,000 EUR). When doing so, I am first taking the 100,000 USD from their virtual place, exchange them into EUR and give them back to my broker. Since the exchange rate is now 1 USD = 0.1 EUR, I give my broker only 10,000 EUR back that way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That means that I am still owing my broker 90,000 EUR. This is bad, but I knew that I could lose 100,000 EUR if I would use 100,000 EUR for trading, and it is by far less surprising than the situation after the long trade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Final question&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Did I correctly understand what opening a trade technically is?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If yes, then we have seen that long EUR/USD trades are by far more dangerous than short ones, provided that your trading account currency is EUR (it would be the other way around if the trading account currency would be USD).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have seen that (assuming the unrealistic preconditions of our examples) &lt;strong&gt;your loss with a long trade is 900%&lt;/strong&gt; of the money you have used if the exchange rate goes into wrong direction by a factor of 10, but &lt;strong&gt;your loss with a short trade is only 90%&lt;/strong&gt; of the money you have used if the exchange rate goes into wrong direction by a factor of 10 (or vice versa, depending on your trading account currency).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, there is a leverage effect even when the leverage is 1:1 as assumed in our examples.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Did I get this right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Please note that I have consequently used stop loss in the past, so I never have suffered from drastic and fast market changes, but nevertheless, I am highly interested in completely understanding that issue).&lt;/p&gt;&#xA;" OwnerUserId="26730" LastEditorUserId="26730" LastEditDate="2017-02-25T16:06:37.147" LastActivityDate="2019-09-01T14:02:00.930" Title="In FX trading, is the risk for long positions higher than for short positions, or vice versa?" Tags="&lt;fx&gt;&lt;leverage&gt;&lt;longshort&gt;" AnswerCount="4" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32673" PostTypeId="1" CreationDate="2017-02-25T10:30:05.893" Score="2" ViewCount="40" Body="&lt;p&gt;I re-post my question from the Cross Validated section as requested by another user.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using the beautiful &quot;rugarch&quot; package and presently have an issue concerning the interpretation of two asymmetry parameters: &lt;code&gt;eta11&lt;/code&gt; and &lt;code&gt;eta21&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As per the package documentation (&lt;a href=&quot;https://cran.r-project.org/web/packages/rugarch/rugarch.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://cran.r-project.org/web/packages/rugarch/rugarch.pdf&lt;/a&gt;), &lt;code&gt;eta11&lt;/code&gt; and &lt;code&gt;eta21&lt;/code&gt; stand for the rotation and the shift parameters respectively of the family-GARCH nested model news impact curve (NIC). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The package vignette &lt;a href=&quot;https://cran.r-project.org/web/packages/rugarch/vignettes/Introduction_to_the_rugarch_package.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;Introduction to the rugarch package&quot;&lt;/a&gt; says that rotations are the main source of asymmetry for big shocks while shifts are the main source of asymmetry for small shocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose then this is the coefficient matrix of my estimated MA(1)+AVGARCH(1,1) model with GED errors.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;         Estimate   Std. Error     Pr(&amp;gt;|t|)&#xA;mu      0.007389067 0.0003317894 0.000000e+00&#xA;ma1    -0.039530532 0.0050175914 3.330669e-15&#xA;omega   0.003378155 0.0011845764 4.347480e-03&#xA;alpha1  0.312554942 0.0486658077 1.340761e-10&#xA;beta1   0.772007322 0.0304194057 0.000000e+00&#xA;eta11  -0.480489955 0.1109057794 1.474820e-05&#xA;eta21   0.415200036 0.0645903270 1.291172e-10&#xA;shape   0.837323483 0.0760468102 0.000000e+00&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I cannot post the plot of the NIC since presently I do not have at least 10-point reputation on the Quantitative Finance section.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, my questions are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) What is the financial interpretation of the eta11 and eta21 asymmetry coefficients that I estimated for the above model? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) How can I compute the impact of positive vs. negative shocks on the volatility of the above model since there appears to be some asymmetry?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know this may sound a trivial question to you. But I am a statistical modelling rookie and sometimes I cannot find my answers but through your help. So, thank you in advance for your comments. &lt;/p&gt;&#xA;" OwnerUserId="25318" LastActivityDate="2017-02-25T10:30:05.893" Title="Rotations and Shifts in the f-GARCH News Impact Curve" Tags="&lt;time-series&gt;&lt;garch&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32674" PostTypeId="1" CreationDate="2017-02-25T11:26:13.893" Score="-2" ViewCount="39" Body="&lt;p&gt;I'm starting to learn corporate finance on my own and have read about this question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You sell the rights to screen a film on TV once every two years for €0.8m. The film has just been screened. You make the assumption that screenings will be possible for 30 years or in perpetuity. The discount rate is 6%. What is the value of your asset?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answers to this questions are:&#xA;€5.34m for the 30-year period&#xA;€6.47m if it's a perpetuity&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the 30-year period, I have used an excel sheet to discount each cashflow to find 5.34m. I would like to know if there's a formula that I could have used for both situations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="26733" LastActivityDate="2017-02-26T01:06:25.033" Title="How to come up with this present value in this question?" Tags="&lt;discounting&gt;&lt;present-value&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2017-02-25T12:45:17.927" ContentLicense="CC BY-SA 3.0" />
  <row Id="32675" PostTypeId="1" AcceptedAnswerId="32737" CreationDate="2017-02-25T11:34:44.113" Score="3" ViewCount="1566" Body="&lt;p&gt;From &lt;a href=&quot;http://www.globalvolatilitysummit.com/wp-content/uploads/2015/10/Santander-Volatility-Trading-Primer-Part-II.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.globalvolatilitysummit.com/wp-content/uploads/2015/10/Santander-Volatility-Trading-Primer-Part-II.pdf&lt;/a&gt; it states that there are the four idealised regimes of volatility surface.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;1) Sticky delta (or sticky moneyness). Sticky delta assumes a constant volatility for options of the same strike as a percentage of spot. For example, ATM or 100% strike volatility has constant volatility. As this model implies there is a positive correlation between volatility and spot, the opposite of what is usually seen in the market, it is not a particularly realistic model (except over a very long time horizon).&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(2) Sticky strike. A sticky strike volatility surface has a constant volatility for options with the same fixed currency strike. Sticky strike is usually thought of as a stable (or unmoving) volatility surface as real-life options (with a fixed currency strike) do not change their implied volatility.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(3) Sticky local volatility. Local volatility is the instantaneous volatility of stock at a certain stock price. When local volatility is static, implied volatility rises when markets fall (ie, there is a negative correlation between stock prices and volatility). Of all the four volatility regimes, it is arguably the most realistic and fairly prices skew.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(4) Jumpy volatility. We define a jumpy volatility regime as one in which there is an excessive jump in implied volatility for a given movement in spot. There is a very high negative correlation between spot and volatility. This regime usually occurs over a very short time horizon in panicked markets (or a crash).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The chapter then goes on to explain the four regimes in more detail, however, I am unclear as to how this can be used in a practical sense? If not, why did the author introduce these regimes? Moreover, it states that skew and the effects of remarking the volatility surface is very different in each regime (see pg 221). Therefore I would have thought it would be very hard to trade skew as you may have to change between the regimes?&lt;/p&gt;&#xA;" OwnerUserId="11723" LastEditorUserId="11723" LastEditDate="2017-03-06T23:15:56.950" LastActivityDate="2017-03-06T23:15:56.950" Title="Spot and Vol Correlation in Idealised Regimes of the Volatility Surface" Tags="&lt;options&gt;&lt;volatility&gt;&lt;volatility-smile&gt;&lt;skew&gt;&lt;volatility-surface&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32677" PostTypeId="2" ParentId="32674" CreationDate="2017-02-25T11:54:23.123" Score="1" Body="&lt;p&gt;So, you have this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \sum_{k=1}^{k=15} 0.8 \cdot 1.06^{2k} = 5.3456\ldots $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And you want to know if there's a &lt;em&gt;formula&lt;/em&gt;, or closed form. Yes there is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \sum_{k=1}^{k=n} x^{k} = x \frac{x^{n+1}-1}{x-1} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where, we're going to set $x=1.06^{-2}$, and sum from 1 to 15 (since you're not including the first period in the valuations).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ 0.8 \sum_{k=1}^{k=15} (1.06^{-2})^{k} = 0.8 \cdot 1.06^{-2}\frac{(1.06^{-2})^{n+1}-1}{(1.06^{-2})-1} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see it &lt;a href=&quot;https://www.wolframalpha.com/input/?i=0.8*(1.06%5E%7B-2%7D)((1.06%5E-2)%5E15-1)%2F(1.06%5E-2-1)&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the perpetuity, just set $n=\infty$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ 0.8 \sum_{k=1}^{k=\infty} (1.06^{-2})^{k} = 0.8 \cdot 1.06^{-2}\frac{(1.06^{-2})^{\infty}-1}{1.06^{-2}-1} = 0.8 \cdot 1.06^{-2} \frac{0-1}{1.06^{-2}-1} = -\frac{0.8 \cdot 1.06^{-2}}{1.06^{-2}-1} = 6.4729$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;again, with a &lt;a href=&quot;https://www.wolframalpha.com/input/?i=0.8*Sum%5B(1.06%5E-2)%5Ek,%7Bk,1,infinity%7D%5D&quot; rel=&quot;nofollow noreferrer&quot;&gt;link&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be honest though, this question probably doesn't belong here, it's fairly basic.&lt;/p&gt;&#xA;" OwnerUserId="19663" LastEditorUserId="19663" LastEditDate="2017-02-26T01:06:25.033" LastActivityDate="2017-02-26T01:06:25.033" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32679" PostTypeId="1" CreationDate="2017-02-25T12:34:46.700" Score="10" ViewCount="640" Body="&lt;p&gt;In the paper &lt;a href=&quot;https://oup.silverchair-cdn.com/oup/backfile/Content_public/Journal/rfs/25/10/10.1093/rfs/hhs087/3/hhs087.pdf?Expires=1488371384&amp;amp;Signature=GPnt2jzG4pgvOiYgLxlywSoe5l3MltwhRunMq7YxbXQecxm2zA0mSpcOdBW-YN81TYmqj3yo4-iwB2AAat2TBOUJ4SOcJFpC8ATS79nTQ6TejDzSzuEq7ap2Rg4bntsyCy~q2sNoqA0rwGE8tCXvo1tCduSuhDQ4GBgz~aMrilImTK5J0bbvhMlFmGPVgdwwp9lwr~UrpoXgaj7~8rqgJ18QQTzbGm0JdaHj6YkmLHTZVEuGXViQ6ds46oHmcGNuobItxuO5rCKOQCOPK31cj--3JoPA83fYJmOoynid4-qA1w0B~toFGpB3ulViX51JNESIfsvyvA3H27swaTT5vA__&amp;amp;Key-Pair-Id=APKAIUCZBIA4LVPAVW3Q&quot; rel=&quot;noreferrer&quot;&gt;Measuring Equity Risk with Option-implied Correlations&lt;/a&gt;, Buss and Vilkov replace the standard CAPM beta:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\beta_{iM,t}^P=\frac{\sigma_{i,t}^P\sum_{j=1}^N w_j \sigma_{j,t}^P\rho_{ij,t}^P}{(\sigma_{M,t}^P)^2}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With a risk-neutral beta: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA; \beta_{iM,t}^Q=\frac{\sigma_{i,t}^Q\sum_{j=1}^N w_j \sigma_{j,t}^Q\rho_{ij,t}^Q}{(\sigma_{M,t}^Q)^2}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And show that the later works better in explaining the cross-section of returns. &#xA;My question is whether there is any simple model that would deliver the second expression. There are several models that deliver the formula for beta under $P$, but I am not sure if there is any that could deliver the one under $Q$. &lt;/p&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="16472" LastEditDate="2017-02-27T14:24:32.597" LastActivityDate="2021-05-11T06:02:40.290" Title="Risk-Neutral CAPM" Tags="&lt;risk-neutral-measure&gt;&lt;capm&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32680" PostTypeId="2" ParentId="32663" CreationDate="2017-02-25T13:40:38.423" Score="1" Body="&lt;p&gt;&lt;strong&gt;Pricing&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to answer you question regarding the computation of the delta, I need to take a brief detour into pricing first. When the underlying asset follows a geometric Brownian motion, then barrier options can be easily priced using the method of images; see e.g. Buchen (2001). The notation I use is very similar to the one in my paper Zhang and Thul (2017) and I refer to its appendix A and B for details (sorry for the plug).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using this approach, we can show that the price of a down-and-out call option with a barrier above the strike is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\tilde{V}(S, \tau) = \mathcal{A}_B^+(S, \tau) - K \mathcal{B}_B^+(S, \tau) - \stackrel{B}{\mathcal{I}} \left\{ \mathcal{A}_B^+(S, \tau) - K \mathcal{B}_B^+(S, \tau) \right\},&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\mathcal{A}_\xi^s (S, \tau) &amp;amp; = &amp;amp; S e^{-\delta \tau} \mathcal{N} \left( s d_1 \right),\\&#xA;\mathcal{B}_\xi^s (S, \tau) &amp;amp; = &amp;amp; e^{-r \tau} \mathcal{N} \left( s d_0 \right),\\&#xA;d_\eta &amp;amp; = &amp;amp; \frac{1}{\sigma \sqrt{\tau}} \left( \ln \left( \frac{S}{\xi} \right) + \left( r - \delta + \left( \eta - \frac{1}{2} \right) \sigma^2 \right) \tau \right),\\&#xA;\stackrel{B}{\mathcal{I}} \left\{ \tilde{V}(S, \tau) \right\} &amp;amp; = &amp;amp; \left( \frac{S}{B} \right)^{2 \alpha} \tilde{V} \left( \frac{B^2}{S}, \tau \right),\\&#xA;\alpha &amp;amp; = &amp;amp; \frac{1}{2} - \frac{r - \delta}{\sigma^2}.&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, $\mathcal{A}_\xi^s(S, \tau)$ if the valuation function of an asset binary option that pays off one unit of the underlying asset if $s S_T &amp;gt; s \xi$ where $s \in \{ -1, +1 \}$ indicates a put or call. Similarly, $\mathcal{B}_\xi^s(S, \tau)$ is the valuation function of a bond binary option that pays off one currency unit. $\stackrel{B}{\mathcal{I}}$ is called the image operator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get the derivatives, we use that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\frac{\partial}{\partial S} \mathcal{A}_\xi^s(S, \tau) &amp;amp; = &amp;amp; e^{-\delta \tau} \mathcal{N} \left( s d_1 \right) + s S e^{-\delta \tau} \mathcal{N}' \left( s d_1 \right) \frac{\partial d_1}{\partial S},\\&#xA;\frac{\partial}{\partial S} \mathcal{B}_\xi^s(S, \tau) &amp;amp; = &amp;amp; s e^{-r \tau} \mathcal{N}' \left( s d_0 \right) \frac{\partial d_0}{\partial S},\\&#xA;\frac{\partial}{\partial S} d_\eta &amp;amp; = &amp;amp; \frac{1}{S \sigma \sqrt{\tau}},\\&#xA;\frac{\partial}{\partial S} \stackrel{B}{\mathcal{I}} \left\{ \tilde{V}(S, \tau) \right\} &amp;amp; = &amp;amp; \left( \frac{S}{B} \right)^{2 \alpha} \left( \frac{2 \alpha}{S} \tilde{V} \left( \frac{B^2}{S}, \tau \right) - \frac{B^2}{S^2} \frac{\partial \tilde{V}}{\partial S} \left( \frac{B^2}{S}, \tau \right) \right).&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did not go through the tedious task of checking if this actually agrees with the formula that you referenced.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Code&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import numpy&#xA;import scipy.stats as stats&#xA;&#xA;def assetBinary1D(maturity, xi, phi, spot, rate, dividend, volatility):&#xA;    totalVolatility = volatility * numpy.sqrt(maturity)&#xA;    dPlus = (numpy.log(spot / xi) + (rate - dividend + 0.5 * volatility**2) * maturity) / totalVolatility&#xA;    dPlusCDF = stats.norm.cdf(phi * dPlus)&#xA;    discountFactorDividend = numpy.exp(-dividend * maturity)&#xA;    value = spot * discountFactorDividend * dPlusCDF&#xA;    derivative = discountFactorDividend * (dPlusCDF + phi * spot * stats.norm.pdf(phi * dPlus) / (spot * totalVolatility))&#xA;    return (value, derivative)&#xA;&#xA;def bondBinary1D(maturity, xi, phi, spot, rate, dividend, volatility):&#xA;    totalVolatility = volatility * numpy.sqrt(maturity)&#xA;    dMinus = (numpy.log(spot / xi) + (rate - dividend - 0.5 * volatility**2) * maturity) / totalVolatility&#xA;    discountFactorRate = numpy.exp(-rate * maturity)&#xA;    value = discountFactorRate * stats.norm.cdf(phi * dMinus)&#xA;    derivative = phi * discountFactorRate * stats.norm.pdf(phi * dMinus) / (spot * totalVolatility)&#xA;    return (value, derivative);&#xA;&#xA;def imageOperator(valueFunction, barrier, spot, rate, dividend, volatility):&#xA;    alpha = 0.5 - (rate - dividend) / volatility**2&#xA;    imageFactor = (spot / barrier)**(2.0 * alpha)&#xA;    value, derivative = valueFunction(barrier**2 / spot)&#xA;    value2 = imageFactor * value&#xA;    derivative2 = imageFactor * (2.0 * alpha / spot * value - (barrier / spot)**2 * derivative)&#xA;    return (value2, derivative2)&#xA;&#xA;# attention: only for barriers above the strike!&#xA;def downAndOutCall(maturity, strike, barrier, spot, rate, dividend, volatility):&#xA;    def valueFunction(spot):&#xA;        value, derivative = assetBinary1D(maturity, barrier, 1.0, spot, rate, dividend, volatility)&#xA;        value2, derivative2 = bondBinary1D(maturity, barrier, 1.0, spot, rate, dividend, volatility)&#xA;        return (value - strike * value2, derivative - strike * derivative2)&#xA;    value, derivative = valueFunction(spot)&#xA;    value2, derivative2 = imageOperator(valueFunction, barrier, spot, rate, dividend, volatility)&#xA;    return (value - value2, derivative - derivative2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This yields&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;downAndOutCall(0.2, 1300.0, 1350.0, 1400.0, 0.0, 0.0, 0.2)&#xA;&amp;gt;&amp;gt; (65.16660154600855, 1.2863311571074099)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Delta&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/6tktA.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/6tktA.png&quot; alt=&quot;Down-and-out call delta.&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The delta is, just like the slope of the payoff function, non-negative everywhere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Full source code can be found on &lt;a href=&quot;https://github.com/MatthiasThul/BarrierOptionPricing&quot; rel=&quot;nofollow noreferrer&quot;&gt;GitHub&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Buchen, Peter W. (2001) &quot;Image Options and the Road to Barriers,&quot; &lt;em&gt;Risk Magazine&lt;/em&gt;, Vol. 14, No. 9, pp. 127-130&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Zhang, Ally Quan and Matthias Thul (2017) &quot;How Much is the Gap? Efficient Jump-Risk Adjusted Valuation of Leverage Certificates,&quot; &lt;em&gt;Quantitative Finance&lt;/em&gt;, forthcoming, &lt;a href=&quot;https://papers.ssrn.com/sol3/papers2.cfm?abstract_id=2388734&quot; rel=&quot;nofollow noreferrer&quot;&gt;available on SSRN&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-02-26T03:57:12.443" LastActivityDate="2017-02-26T03:57:12.443" CommentCount="21" ContentLicense="CC BY-SA 3.0" />
  <row Id="32682" PostTypeId="2" ParentId="32672" CreationDate="2017-02-25T17:55:00.413" Score="3" Body="&lt;p&gt;I you take a long position in a stock the worst that can happen is the stock goes to zero, and you lose your investment. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you take a short position in a stock, you have the potential for unlimited loss (since there is no limit to how high the stock can go). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Exactly the same principle pertains in FX. If your quote currency (or home currency) is EUR and you are buying USD, then long positions in USD (short positions in EUR/USD) can only lose your investment, but short positions in USD (long positions in EUR/USD) can lose multiples of your investment&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It may help to think of a position in a stock, e.g. MSFT, as a MSFT/USD trade, since you are buying Microsoft stock for USD. Or to think of a position in a European stock (e.g. VOD) as a VOD/EUR position, to make the analogy clear. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, thinking about the maximum amount of money you can lose on an investment is only one dimension of risk. I'd argue that it's not a particularly useful dimension, because the chances of a currency going to zero, or doubling, over any reasonable-length period (say a month) are close to zero. Instead, I would want to know what the typical size of movements in a currency are (its volatility), how does it co-move with other currencies I am holding (its correlation) and what is the relative size of up moves versus down moves (its skewness). I'd also look at macro risks (e.g. correlation with the stock market, likelihood of central bank interventions) before I started worrying about the risk asymmetry of long vs short positions in a currency.&lt;/p&gt;&#xA;" OwnerUserId="924" LastEditorUserId="924" LastEditDate="2017-02-25T19:02:24.500" LastActivityDate="2017-02-25T19:02:24.500" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32684" PostTypeId="1" CreationDate="2017-02-25T21:34:46.327" Score="3" ViewCount="1047" Body="&lt;p&gt;Presentations of the CAPM often include statements similar to this:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;While idiosyncratic risk can be &quot;diversified away&quot;, systematic risk cannot, which is also expressed in the CAPM, which states that in equilibrium, asset returns are fully determined by systematic risk.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However, it seems that the CAPM can be derived even in a market with only two risky assets:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The crucial step, which proves the equilibrium — i.e. that it is optimal for any market participant not to change their portfolio — does not rely on the number of assets being large or the possibility to eliminate idiosyncratic risks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can this be?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would imply that most texts (esp. ones aimed at non-mathematical/business audience) give a wrong impression of the connection between CAPM and diversification in portfolio theory... &lt;/p&gt;&#xA;" OwnerUserId="15562" LastEditorUserId="24222" LastEditDate="2017-02-26T14:51:09.050" LastActivityDate="2018-02-23T15:05:13.237" Title="Does CAPM hold for markets with two risky assets?" Tags="&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;&lt;capm&gt;&lt;asset-allocation&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32686" PostTypeId="1" AcceptedAnswerId="32696" CreationDate="2017-02-25T22:27:48.733" Score="2" ViewCount="1479" Body="&lt;p&gt;Can Tobin's Q value for a firm be negative?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am calculating Tobin's Q value using Compustat data for firm i and year t. I am using the formula presented in Chung and Pruitt(1994) -&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q = (Market value of equity + liquidation value of prefd stock + DEBT) / Totl Assets&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where DEBT =  sh term liabilities - short term assets + book value of lg term debt&lt;/p&gt;&#xA;" OwnerUserId="26740" LastEditorUserId="16160" LastEditDate="2017-02-26T04:27:17.640" LastActivityDate="2017-09-24T09:54:04.667" Title="Can tobin's Q value for a firm be negative?" Tags="&lt;finance&gt;&lt;economics&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32687" PostTypeId="1" CreationDate="2017-02-25T23:07:49.690" Score="1" ViewCount="268" Body="&lt;p&gt;I hope you can help me again regarding pricing an arithmetic Asian option.&lt;/p&gt;&#xA;&lt;p&gt;Assume we have a time grid &lt;span class=&quot;math-container&quot;&gt;$(0=t_0,t_1,t_2=T)$&lt;/span&gt; and we buy an Asian option at time 0 and the maturity is at T. Now we would like to price the option at each time with a Monte-Carlo simulation.&#xA;Now assume the risk-free rate and the strike &lt;span class=&quot;math-container&quot;&gt;$K=0$&lt;/span&gt; and we just do one simulation (a simplification for this example) .&lt;/p&gt;&#xA;&lt;p&gt;At &lt;span class=&quot;math-container&quot;&gt;$ t=t_0$&lt;/span&gt;: Clear. First of all simulate the future price at &lt;span class=&quot;math-container&quot;&gt;$t_1$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$ t_2$&lt;/span&gt;. Then &lt;span class=&quot;math-container&quot;&gt;$$ \text{Asian} =\max\left(0,\frac{S(t_0)+S(t_1)+S(t_2)}{3}\right)$$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;At &lt;span class=&quot;math-container&quot;&gt;$ t=t_1$&lt;/span&gt;: Here is now my problem. We still have the information at time &lt;span class=&quot;math-container&quot;&gt;$t_0$&lt;/span&gt;. I think just simulate a new price at &lt;span class=&quot;math-container&quot;&gt;$t_2$&lt;/span&gt; and hence &lt;span class=&quot;math-container&quot;&gt;$$ \text{Asian} =\max\left(0,\frac{S(t_0)+S(t_1)+S_{\text{new}}(t_2)}{3}\right)$$&lt;/span&gt; &lt;span class=&quot;math-container&quot;&gt;$S(t_0),S(t_1)$&lt;/span&gt;  are from &lt;span class=&quot;math-container&quot;&gt;$t_0$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Is that correct? Thank you very much!!!!&lt;/p&gt;&#xA;" OwnerUserId="26680" LastEditorUserId="49542" LastEditDate="2021-03-30T06:07:02.933" LastActivityDate="2021-03-30T06:07:02.933" Title="Pricing Asian option at discrete times" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;asian-option&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="32688" PostTypeId="2" ParentId="32684" CreationDate="2017-02-25T23:59:49.960" Score="0" Body="&lt;p&gt;I am not totally sure about this, but I guess the General Equilibrium derivation of CAPM with a representative agent needs no more than two assets, i.e. a risky asset perfectly correlated with consumption and a risk-free asset.&#xA;The first order condition of the representative investor states that the expected return of any asset $i$ depends on the covariance with $R^C_{t+1}$, i.e. the return on the claim on aggregate consumption:&#xA;$$E_{t}[R^i_{t+1}-R^f]=-R^fCov_t(R^i_{t+1},R^C_{t+1})$$&#xA;If you interpret $C$ as the market M, then you obtain:&#xA;$$E_{t}[R^M_{t+1}-R^f]=-R^fCov_t(R^C_{t+1},R^M_{t+1})=-R^fVar_t(R^M_{t+1})$$&#xA;taking a ratio between the two equations, it collapses to CAPM:&#xA;$$E_{t}[R^i_{t+1}-R^f]=\frac{Cov_t(R^i_{t+1},R^C_{t+1})}{Var_t(R^M_{t+1})}E_{t}[R^M_{t+1}-R^f]=\beta_{t}^iE_{t}[R^M_{t+1}-R^f]$$&#xA;The whole derivation requires a representative agent and two assets.&lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2017-02-25T23:59:49.960" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32689" PostTypeId="2" ParentId="32657" CreationDate="2017-02-26T01:45:26.923" Score="3" Body="&lt;p&gt;The other answers have answered why swaps are based on LIBOR (historical reasons). The reason mortgages are based on LIBOR given this is a bit easier to understand. Swaps are traded instruments with market prices, and we can use the prices to infer a yield curve for, say, 1M LIBOR. This allows for more intelligent pricing of other derivatives based on LIBOR. A mortgage would be based on 1M LIBOR specifically because this is determined by the market with one month of credit risk built in.&lt;/p&gt;&#xA;" OwnerUserId="16684" LastActivityDate="2017-02-26T01:45:26.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32693" PostTypeId="1" CreationDate="2017-02-26T14:38:07.980" Score="1" ViewCount="1720" Body="&lt;p&gt;I would like to obtain an explicit solution to $X$ when it satisfies&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dX_t = \mu X_t dt + \sigma dW_t, X_S = x$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, $S &amp;gt; 0$, and we want an explicit solution for $X_T$, $T &amp;gt; S$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure how to approach the problem. Seems more difficult than regular brownian motion!&lt;/p&gt;&#xA;" OwnerUserId="26746" LastActivityDate="2021-05-05T14:06:24.113" Title="The solution to arithmetic brownian motion" Tags="&lt;stochastic-processes&gt;&lt;differential-equations&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32694" PostTypeId="1" AcceptedAnswerId="32704" CreationDate="2017-02-26T15:15:17.310" Score="0" ViewCount="315" Body="&lt;p&gt;With reference to my &lt;a href=&quot;https://quant.stackexchange.com/questions/32663/strange-delta-for-fx-down-and-out-call-strike-below-barrier/32680?noredirect=1#comment45290_32680&quot;&gt;previous question&lt;/a&gt; about the computation of a barrier option delta, @LocalVolatility referenced a nice closed form solution to value barrier options on a stock paying a dividend yield. Out of curiosity, I wonder wether this model could &quot;be abused&quot; to value a similar barrier option on a commodities future? To value an FX option I would simply exchange the dividend yield with the foreign exchange rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say I want to value an option on some commodites future, I understand that for a Vanilla option I could use the Black model (which is related to the Garman Kohlhagen model). The thought was, could I possibly &quot;abuse&quot; the model above to value a respective barrier option on a commodities future? My &quot;idea of abusal&quot; here would be, given the future, to extract the spot from the future via the interest rate parity relation and use this as input to the model. I know this is really vague, especially since it ignores things like storage costs in the cost of carry, just wondering?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As mentioned in a comment below, I wonder wether I could also just exchange the dividend yield for the risk free rate and then price on the future. Intuitively, I got the idea from the derivation of the Black model, but I'm not sure at all.&lt;/p&gt;&#xA;" OwnerUserId="20736" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2017-02-26T22:48:05.230" Title="Valuation of FX vs. Commodities Barrier Options" Tags="&lt;barrier&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32695" PostTypeId="2" ParentId="16365" CreationDate="2017-02-26T15:38:24.247" Score="1" Body="&lt;p&gt;When looking at the volatility of the contract Ito's lemma gives that the volatility of the future contract is the same as the volatility of the underlying (in the future contract). Is it correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CORRECT&lt;/p&gt;&#xA;" OwnerUserId="26747" LastActivityDate="2017-02-26T15:38:24.247" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32696" PostTypeId="2" ParentId="32686" CreationDate="2017-02-26T16:38:33.420" Score="3" Body="&lt;p&gt;No, it is not possible for Tobin's Q to be negative in any normal situation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mathematically it is true that if the 'short term assets' figure is very large (because of a data error or otherwise) the numerator of the fraction could become negative. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To protect against this you might consider only the excess of short term liabilities over short term assets to be included in debt.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words I would take&lt;/p&gt;&#xA;&#xA;&lt;p&gt;DEBT = MAX(0,sh term liabilities-short term assets)+liq preferred+bk value long term debt&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may want to ask your accounting professor if this seems like an acceptable solution.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-02-26T16:38:33.420" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32697" PostTypeId="2" ParentId="32684" CreationDate="2017-02-26T18:18:33.747" Score="1" Body="&lt;p&gt;The answer depends on whether you think that the risk free rate is zero or unknown.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it is unknown, then there is no way to determine the optimal portfolio from an efficient frontier of risky assets. Technically, any tangency point on that frontier (with slope $\ge 0$) can be considered efficient, so none is optimal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If, however, you assume that the risk free rate is 0, then the equation reduces to a linear regression model with an intercept equal to 0. I will explain.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The CAPM is a linear regression which is intended to infer an asset's expected return. It is guided by the intuition that investors prefer returns which are commensurate with risk. In this case, CAPM assumes a quadratic utility function in which investors only care about the first and second moments of the joint distribution of returns (i.e., mean = expected returns; portfolio variance = risk proxy). Solving the utility function gives a slope which is equal to &quot;beta&quot; and a y-intercept which is equal to the risk free rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The formula for a linear regression with a zero intercept  is readily tractable. Whereas the beta coefficient in a normal regression is found by minimizing the covariance, this is easily done in a  zero intercept model by taking the average rise over average run.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I..e., The CAPM without a risk free asset would simply say that the expected return on a riskless asset is zero, and the required return of a risky asset is proportional to its variance$ \ge 0$. &lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2018-02-23T15:05:13.237" LastActivityDate="2018-02-23T15:05:13.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32698" PostTypeId="2" ParentId="24497" CreationDate="2017-02-26T18:30:15.623" Score="-3" Body="&lt;p&gt;when the numerator is positive, then you get rho.&lt;/p&gt;&#xA;" OwnerUserId="26749" LastActivityDate="2017-02-26T18:30:15.623" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32699" PostTypeId="1" CreationDate="2017-02-26T18:39:23.397" Score="3" ViewCount="654" Body="&lt;p&gt;I understand that time-varying interest rates, “cost of carry” and&#xA;“convenience yield” will have an effect on forward and futures prices but why would it affect the prices of forwards relative to futures, and how would it effect their relative prices to each other?&lt;/p&gt;&#xA;" OwnerUserId="26750" LastActivityDate="2017-02-26T18:39:23.397" Title="The effects of “cost of carry” and “convenience yield” in pricing futures and forwards" Tags="&lt;futures&gt;&lt;forward&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32700" PostTypeId="2" ParentId="24497" CreationDate="2017-02-26T19:18:00.687" Score="1" Body="&lt;p&gt;There are two conditions: $W_1=s_0$ has to be non-negative, which means $\sigma_2^2 - \sigma_1\sigma_2\rho \ge 0$, which simplifies to $\sigma_2 \ge \sigma_1 \rho$. (I assumed $\sigma_2 \ne 0$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second condition is that $W_2=1-s_0$ also has to be non-negative, i.e. $s_0 \le 1$. So $\sigma_2^2 - \sigma_1\sigma_2\rho \le \sigma_1^2+\sigma_2^2-2\sigma_1\sigma_2\rho$. Which reduces to $\sigma_1 \ge \sigma_2 \rho$. (Again assuming $\sigma_1 \ne 0$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The two conditions are nicely symmetric, and can be combined into the following statement&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \rho\le \frac{\sigma_2}{\sigma_1}, \rho\le \frac{\sigma_1}{\sigma_2} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Only one of these two conditions, the one with the lower ratio, will be binding. We could say $\rho \le \frac{\sigma_{small}}{\sigma_{big}}$ once we know which vol is bigger and which is smaller).&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2017-02-26T21:50:56.703" LastActivityDate="2017-02-26T21:50:56.703" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32702" PostTypeId="2" ParentId="32694" CreationDate="2017-02-26T21:23:34.067" Score="1" Body="&lt;p&gt;I assume you mean a barrier option on a futures contract? It's not a straight forward thing to do analytically because of the Samuelson effect (futures tend to ramp up in volatility as they approach maturity). Most people build a dedicated vol surface for the futures contract and use a local vol based solution. &lt;/p&gt;&#xA;" OwnerUserId="26574" LastActivityDate="2017-02-26T21:23:34.067" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32703" PostTypeId="2" ParentId="29536" CreationDate="2017-02-26T21:33:01.153" Score="1" Body="&lt;p&gt;Actually, you are going to find that the vol premium on the wings is lower in volatile markets, purely due to the &quot;cabinet effect&quot; when vol is very low. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think, however, that you are mixing up smile (aka kurtosis premium) with skew (risk direction premium). When a specific side of the vol surface moves that usually means people are trying to protect against a specific direction move, either due to perception or due to market position &lt;/p&gt;&#xA;" OwnerUserId="26574" LastActivityDate="2017-02-26T21:33:01.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32704" PostTypeId="2" ParentId="32694" CreationDate="2017-02-26T22:48:05.230" Score="1" Body="&lt;p&gt;If I understand your question correctly, then you have a barrier option pricer for spot model dynamics of the form&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathrm{d}S_t = (r - \delta) S_t \mathrm{d}t + \sigma S_t \mathrm{d}W_t.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you are wondering whether you can abuse the input parameters in a way such as to use the same model to price options on a forward contract. Normally, the forward dynamics under the Black-Scholes model are given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathrm{d}F_t = \sigma F_t \mathrm{d}W_t.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could thus set $S_0 = F_0$ and $\delta = r$ in your model and get the correct price.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2017-02-26T22:48:05.230" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32705" PostTypeId="1" AcceptedAnswerId="32718" CreationDate="2017-02-26T22:49:34.413" Score="1" ViewCount="1914" Body="&lt;p&gt;I'm looking for P/E ratio of &lt;code&gt;IBM&lt;/code&gt; or &lt;code&gt;APPL&lt;/code&gt; (American nasdaq stock(?)) for past few years but I can not find it even I searched it in Google.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I read API docs of &lt;code&gt;quandl&lt;/code&gt; but can not find it, either. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since my native language is not an English, I wrote this post to getting some help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks &lt;/p&gt;&#xA;" OwnerUserId="26582" LastEditorUserId="16160" LastEditDate="2017-02-27T02:52:21.900" LastActivityDate="2017-02-27T16:14:17.897" Title="Where can I get historical P/E ratio data of american stock?" Tags="&lt;data&gt;&lt;market-data&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32709" PostTypeId="1" CreationDate="2017-02-27T07:13:15.477" Score="-2" ViewCount="369" Body="&lt;p&gt;I'm getting my FX rate information from a provider that only provides me one direction THB =&gt; CHF.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I want to calculate the inverse: CHF =&gt; THB.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see two possibilities:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Take the middle of the rate THB =&gt; CHF and compute the inverse&lt;/li&gt;&#xA;&lt;li&gt;Go over the USD: CHF =&gt; USD =&gt; THB&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;What is the correct way? Consider two scenarios:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I only want the middle of the rate&lt;/li&gt;&#xA;&lt;li&gt;I want the bid and ask&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="26765" LastActivityDate="2017-02-28T09:19:14.590" Title="How do I calculate the inverse rate of an exotic?" Tags="&lt;fx&gt;" AnswerCount="1" CommentCount="5" ClosedDate="2017-02-28T11:33:36.960" ContentLicense="CC BY-SA 3.0" />
  <row Id="32710" PostTypeId="2" ParentId="19560" CreationDate="2017-02-27T08:24:45.843" Score="0" Body="&lt;p&gt;I hope you can find the answer to your question here:&#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/8724/how-to-calibrate-hull-white-from-zero-curve&quot;&gt;How to calibrate Hull-White from zero curve?&lt;/a&gt;&#xA;However if you want a step-by-step procedure I would resume it like that:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Calibrate your parameter $\theta(t)$ starting from the forward curve and using the formula in the link above.&lt;/li&gt;&#xA;&lt;li&gt;Calibrate volatility from the historical series of the forward curve&lt;/li&gt;&#xA;&lt;li&gt;Similarly estimate the mean reversion speed &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="26657" LastActivityDate="2017-02-27T08:24:45.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32711" PostTypeId="1" AcceptedAnswerId="32712" CreationDate="2017-02-27T09:32:20.167" Score="0" ViewCount="203" Body="&lt;p&gt;I am using a vendor system to stress a portfolio which contains (among others) derivatives with implied volatility exposure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The issue is that when using a 1000 bps implied volatility stress upwards and downwards the result is really close in both cases (with an opposite sign obviously)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this expected?&lt;/p&gt;&#xA;" OwnerUserId="22383" LastEditorUserId="19887" LastEditDate="2017-02-27T10:08:43.513" LastActivityDate="2017-02-27T10:08:43.513" Title="Should price impact be the same for positive/negative implied volatility shocks?" Tags="&lt;implied-volatility&gt;&lt;portfolio&gt;&lt;vega&gt;&lt;stress-testing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32712" PostTypeId="2" ParentId="32711" CreationDate="2017-02-27T09:58:25.647" Score="2" Body="&lt;p&gt;It may help you to notice that, for a bump in implied volatility $\delta \sigma$, the impact on the price of the derivative $V$ is given by:&#xA;$$ \delta V = \underbrace{\frac{\partial V}{\partial \sigma}}_{\text{Vega}} \delta \sigma + \frac{1}{2} \underbrace{\frac{\partial^2 V}{\partial \sigma^2}}_{\text{Volga, Vomma}} (\delta \sigma)^2 + o((\delta \sigma)^2) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, the positive ($\delta V^P$) and negative ($\delta V^N$) price impacts for respective bumps $\delta \sigma^P= \vert\delta\sigma\vert$ and $\delta\sigma^N = - \vert\delta\sigma\vert$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \delta V^P = \frac{\partial V}{\partial \sigma} \mid \delta \sigma \mid + \frac{1}{2} \frac{\partial^2 V}{\partial \sigma^2} (\delta \sigma)^2 $$&#xA;$$\delta V^N = -\frac{\partial V}{\partial \sigma} \mid \delta \sigma \mid + \frac{1}{2} \frac{\partial^2 V}{\partial \sigma^2} (\delta \sigma)^2 $$&#xA;hence&#xA;$$ \delta V^P = -\delta V^N + \frac{\partial^2 V}{\partial \sigma^2} (\delta \sigma)^2 + o((\delta \sigma)^3) $$&#xA;and when no Volga (also called Vomma):&#xA;$$ \delta V^P = - \delta V^N $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For illustration purpose here is the Volga curve of a vanilla option of time to maturity $\tau$ as a function of forward moneyness $m=K/F(0,\tau)$. Observe how an ATM option has no Volga and how this changes as you move away from the money.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Yrn3H.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Yrn3H.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2017-02-27T10:04:47.140" LastActivityDate="2017-02-27T10:04:47.140" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32715" PostTypeId="2" ParentId="32544" CreationDate="2017-02-27T14:23:36.440" Score="2" Body="&lt;p&gt;Finally, thanks to Luigi's answer and by observing the examples in the &lt;code&gt;testsuite&lt;/code&gt; I have been able to achieve it. The fake starting date is setted to today's date and the exercise date as follow :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; Date exDate = today + Integer(timeToMaturity_*360+0.5);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;See below a working example for pricing an american option with CRR :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;double American_CoxRossRubinstein_T(bool IsCall /*if false= put*/,&#xA;                                    double underlying_,&#xA;                                    double strike_,&#xA;                                    double riskfree_,&#xA;                                    double volatility_,&#xA;                                    double dividendYield_,&#xA;                                    double timeToMaturity_)&#xA;{&#xA;    /*----------------------------------------------------*/&#xA;    Option::Type optionType =IsCall ? Option::Call : Option::Put ;&#xA;    QuantLib::Date today = QuantLib::Date::todaysDate();&#xA;    QuantLib::Settings::instance().evaluationDate() = today;&#xA;    QuantLib::DayCounter dayCounter = QuantLib::Actual360();&#xA;    Calendar calendar  = NullCalendar(); &#xA;    Date exDate = today + Integer(timeToMaturity_*360+0.5);&#xA;    Handle&amp;lt;Quote&amp;gt; underlyingH((boost::static_pointer_cast&amp;lt;Quote&amp;gt;(boost::make_shared&amp;lt;SimpleQuote&amp;gt;(underlying_))));&#xA;    Handle&amp;lt;YieldTermStructure&amp;gt; flatDividendTS((boost::static_pointer_cast&amp;lt;YieldTermStructure&amp;gt;(boost::make_shared&amp;lt;FlatForward&amp;gt;(today, dividendYield_, dayCounter))));&#xA;    Handle&amp;lt;YieldTermStructure&amp;gt; flatTermStructure((boost::static_pointer_cast&amp;lt;YieldTermStructure&amp;gt;(boost::make_shared&amp;lt;FlatForward&amp;gt;(today,riskfree_, dayCounter))));&#xA;    Handle&amp;lt;BlackVolTermStructure&amp;gt; flatVolTS((boost::static_pointer_cast&amp;lt;BlackVolTermStructure&amp;gt;(boost::make_shared&amp;lt;BlackConstantVol&amp;gt;(today, calendar, volatility_, dayCounter))));&#xA;    boost::shared_ptr&amp;lt;Exercise&amp;gt; americanExercise(new AmericanExercise(today, exDate));&#xA;    boost::shared_ptr&amp;lt;StrikedTypePayoff&amp;gt; payoff(new PlainVanillaPayoff(optionType, strike_));&#xA;    VanillaOption americanOption(payoff, americanExercise);&#xA;    boost::shared_ptr&amp;lt;BlackScholesMertonProcess&amp;gt; bsmProcess(new BlackScholesMertonProcess(underlyingH, flatDividendTS, flatTermStructure, flatVolTS));&#xA;    Size timeSteps = static_cast&amp;lt;int&amp;gt;(std::max(700 * timeToMaturity_, 20.0));&#xA;    americanOption.setPricingEngine(boost::static_pointer_cast&amp;lt;PricingEngine&amp;gt;(boost::make_shared&amp;lt;BinomialVanillaEngine&amp;lt;CoxRossRubinstein&amp;gt;&amp;gt;(bsmProcess, timeSteps )));&#xA;    Real OptionPrice = americanOption.NPV();&#xA;    std::cout &amp;lt;&amp;lt; std::setprecision(9) &amp;lt;&amp;lt; &quot;American_CoxRossRubinstein_T = &quot; &amp;lt;&amp;lt; OptionPrice &amp;lt;&amp;lt; std::endl;&#xA;    return OptionPrice;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2017-02-27T14:23:36.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32716" PostTypeId="2" ParentId="30298" CreationDate="2017-02-27T14:39:49.900" Score="2" Body="&lt;p&gt;Of course, it depends on the weights of your 'ensemble'. The optimal combination will have the following Sharpe ratio:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;S_{opt} = \sqrt{S_1^2+S_2^2}&#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i.e. &lt;span class=&quot;math-container&quot;&gt;$S_{opt} = \sqrt{2} \approx 1.414$&lt;/span&gt; in you example&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Proof:&lt;/strong&gt;&#xA;Let &lt;span class=&quot;math-container&quot;&gt;$x$&lt;/span&gt; be the expectation, and &lt;span class=&quot;math-container&quot;&gt;$V$&lt;/span&gt; the covariance matrix of a vector of assets. The Sharpe ratio of a portfolio with weights &lt;span class=&quot;math-container&quot;&gt;$w$&lt;/span&gt; is defined by &lt;span class=&quot;math-container&quot;&gt;$S_w=\frac{x^Tw}{\sqrt{w^TVw}}$&lt;/span&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, we transform the problem in a simpler one:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It follows that if &lt;span class=&quot;math-container&quot;&gt;$w_1$&lt;/span&gt; has an optimal Sharpe ratio &lt;span class=&quot;math-container&quot;&gt;$S^*$&lt;/span&gt;, which is always positive, then &lt;span class=&quot;math-container&quot;&gt;$a \: w_1$&lt;/span&gt; has the same Sharpe ratio for any positive real number &lt;span class=&quot;math-container&quot;&gt;$a$&lt;/span&gt;. Setting &lt;span class=&quot;math-container&quot;&gt;$a=1/x^Tw_1$&lt;/span&gt;, shows that there exists a portfolio &lt;span class=&quot;math-container&quot;&gt;$w$&lt;/span&gt; with optimal Sharpe ratio and &lt;span class=&quot;math-container&quot;&gt;$x^Tw=1$&lt;/span&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, we can find &lt;span class=&quot;math-container&quot;&gt;$S^*$&lt;/span&gt; by maximizing &lt;span class=&quot;math-container&quot;&gt;$S_w$&lt;/span&gt; subject to &lt;span class=&quot;math-container&quot;&gt;$x^Tw=1$&lt;/span&gt;, i.e. minimize &lt;span class=&quot;math-container&quot;&gt;$w^TVw$&lt;/span&gt; subject to &lt;span class=&quot;math-container&quot;&gt;$x^Tw=1$&lt;/span&gt;. Using one Lagrange multiplyer &lt;span class=&quot;math-container&quot;&gt;$\lambda$&lt;/span&gt; gives the following conditions: &lt;span class=&quot;math-container&quot;&gt;$$&#xA;\nabla_w(w^TVw+\lambda x^Tw)=2 Vw + \lambda x\stackrel{!}{=}0&#xA;$$&lt;/span&gt;&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;x^Tw=1$$&lt;/span&gt;&#xA;The solution is &lt;span class=&quot;math-container&quot;&gt;$w=\frac{V^{-1}x}{x^TV^{-1}x}$&lt;/span&gt; and the optimal Sharpe ratio is thus&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;S^*=\sqrt{x^TV^{-1}x}$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Application to your case:&#xA;Two uncorrelated assets with volas &lt;span class=&quot;math-container&quot;&gt;$\sigma_1$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$\sigma_2$&lt;/span&gt; i.e. &lt;span class=&quot;math-container&quot;&gt;$V^{-1}=\left(\begin{array}&#xA;c\sigma_1^{-2}&amp;amp; 0\\0&amp;amp;\sigma_2^{-2}\end{array}\right)$&lt;/span&gt;, and Sharpe ratios &lt;span class=&quot;math-container&quot;&gt;$S_i=x_i/\sigma_i$&lt;/span&gt; gives the above result.&lt;/p&gt;&#xA;" OwnerUserId="15562" LastEditorUserId="15562" LastEditDate="2020-04-30T21:36:46.290" LastActivityDate="2020-04-30T21:36:46.290" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="32717" PostTypeId="2" ParentId="32672" CreationDate="2017-02-27T14:54:41.077" Score="0" Body="&lt;p&gt;No you've not got your funding for a long or short position correct. An FX position is already fully funded from the start. Then at the end you simply own the PnL. Whereas what you're doing is adding in a kind of money market deposit or loan from the broker to fund your FX position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What happens in FX:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long: If you buy 100,000 EUR (go long) then you pay for that now (at the spot rate) using 100,000 USD (or simply 100,000 EUR). It doesn't really matter the funding currency but you have pay your broker now otherwise you don't get the EUR. From then on if the value of EUR goes up or down that's simply the value of the EUR that you already own. There's nothing more to pay.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Short: If you sell 100,000 EUR (go short) then you pay for that position now by giving the EUR to your broker, for which you take 100,000 USD (at the spot rate) in return. Then whether USD (or some other currency) goes up or down is just the inverse of long EUR. You can say you're actually long USDEUR. You're short EURUSD. When you want to &quot;close&quot; that position then your 100,000 USD (that you've also got on deposit somewhere at 1%) only gets you back 10,000 EUR so in your scenario you've lost the 90,000 but no more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your scenario you're imagining that to fund your FX position you've borrowed from the broker (via the money markets) as if you have no money in your trading account to fund a position yourself. So yes, if your broker lent you 1,100,000 EUR that you had to pay back and EURUSD lost 90% of it's value then you'd still have at least 1,000,000 EUR (which you would pay back) but that loan would only be worth 10% as many USD as before so actually your broker would have &quot;lost&quot; 900,000 from the EUR that they lent you. When you borrow a currency you repay it in the same currency you borrowed it, not in some other currency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your &quot;short&quot; scenario your broker lent you 1,100,000 EUR and then you used 100,000 EUR to buy 100,000 USD. Then the rate went to 1 EUR = 10 USD so yes  EUR loses 90% of it's value. Your bet went wrong and you lost 90,000 USD but the thing is that you pay back your broker 1,010,000 EUR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you're getting confused about funding currencies, and loans, and PnL currencies for loans. Your broker lost big time on their EUR loan supposing their own PnL currency is USD. However, in reality they would have hedged that loan a long time before EURUSD lost 90% of its value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take a look at &lt;a href=&quot;http://www.webstersystems.co.uk/fxmm.htm#interest%20arbitrage&quot; rel=&quot;nofollow noreferrer&quot;&gt;this explanation of the connection between FX and Money Markets&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7369" LastEditorUserId="7369" LastEditDate="2017-02-27T15:25:42.120" LastActivityDate="2017-02-27T15:25:42.120" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="32718" PostTypeId="2" ParentId="32705" CreationDate="2017-02-27T16:14:17.897" Score="2" Body="&lt;p&gt;WolframAlpha has free historical P/E ratios (with Facebook as example stock).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.wolframalpha.com/input/?i=p%2Fe%20facebook&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.wolframalpha.com/input/?i=p%2Fe+facebook&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's also YCharts which has a free week trial and very good historical P/E graphs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://ycharts.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://ycharts.com&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19945" LastActivityDate="2017-02-27T16:14:17.897" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32719" PostTypeId="1" AcceptedAnswerId="32788" CreationDate="2017-02-27T16:22:53.960" Score="2" ViewCount="222" Body="&lt;p&gt;Where can I find the most accurate closing and opening prices for the S&amp;amp;P500 and other major indices?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been reading in a book called Machine Learning (author Ernest Chan) that many places are using &quot;consolidated closing prices&quot; at the end of the day which distorts the closing price.&lt;/p&gt;&#xA;" OwnerUserId="19945" LastActivityDate="2017-03-02T18:54:10.273" Title="Accurate closing and opening prices" Tags="&lt;data&gt;&lt;historical-data&gt;&lt;tick-data&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32723" PostTypeId="1" CreationDate="2017-02-27T21:06:30.233" Score="0" ViewCount="138" Body="&lt;p&gt;I have to use simple no arbitrage arguments to find the price of a barrier option where initial stock price $S_0 = 100$ and barrier/strike $B = K = 80$. Here we don't assume geometric Brownian motion for the stock price. What should be the approach for this problem? The problem I'm facing is at time $T$ the stock price can be above the barrier or below the barrier. But in the second possibility, both the prices can be above the barrier.&lt;/p&gt;&#xA;" OwnerUserId="26778" LastEditorUserId="467" LastEditDate="2017-03-02T03:37:00.583" LastActivityDate="2017-03-02T03:37:00.583" Title="How to price barrier options with making in model-independent way?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;barrier&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32724" PostTypeId="2" ParentId="32693" CreationDate="2017-02-27T21:49:24.833" Score="7" Body="&lt;p&gt;To solve the SDE you should use the so called variation of constant method.&#xA;Define a process $Y_t=e^{-\mu t}X_t$, so that using Itô we obtain:&#xA;$$dY_t=-\mu Y_t dt+ e^{-\mu t}X_t=e^{-\mu t} \sigma dW_t $$&#xA;Therefore by integrating we have:&#xA;$$Y_T=Y_S+\int_S^T e^{-\mu t}  \sigma dW_t=e^{-\mu S} X_S +\sigma \int_S^T e^{-\mu t} dW_t$$&#xA;$$\Rightarrow \quad X_T=e^{\mu (T-S)} X_S +\sigma \int_S^T e^{\mu (T-t)} dW_t$$&#xA;This is a simple Ornstein Uhlenbeck process with mean reversion towards 0 if the coefficient $\mu$ is negative. I think you can easily find it in your Stochastic Calculus reference book.&lt;/p&gt;&#xA;" OwnerUserId="26657" LastEditorUserId="26657" LastEditDate="2017-03-01T11:07:15.073" LastActivityDate="2017-03-01T11:07:15.073" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32725" PostTypeId="1" AcceptedAnswerId="32742" CreationDate="2017-02-27T23:03:25.617" Score="6" ViewCount="3259" Body="&lt;p&gt;Can anybody explain to me step-by-step how can I dynamically hedge and/or replicate a quanto option with the foreign underlying asset, the foreign cash account and the domestic cash account as detailed as possible? And if you could recommend books or articles that would be also great. Thanks&lt;/p&gt;&#xA;" OwnerUserId="26780" LastActivityDate="2017-03-01T21:11:22.740" Title="Dynamic Hedge of Quanto Options" Tags="&lt;options&gt;&lt;hedging&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="32728" PostTypeId="2" ParentId="32679" CreationDate="2017-02-28T02:50:10.123" Score="0" Body="&lt;p&gt;I do not have a good intuition about the meaning of implied correlation. Is this supposed to be correlation between some asset, $i$, and the index, $M$? Perhaps , maybe one way to think of risk-neutral beta is as the &quot;correlated co-implied volatilities&quot; of $M$ and $i$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Beta^Q_{M,i} = \rho^Q_{M,i} * \frac{\sigma^Q_{i}}{\sigma^Q_{M}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Getting the implied variances should be easy, a-la some model. Getting the implied correlations seems to a little more complex. The paper you reference defines implied correlation as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\rho_{ij_t}^Q = \rho_{ij,t}^P - a(1-rho_{i,j,t}^P)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $a$ appears to be some factor which is bounded between 0 and -1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's all I got. I wish I had a better intuition of what implied correlation was attempting to measure. &lt;/p&gt;&#xA;" OwnerUserId="26547" LastActivityDate="2017-02-28T02:50:10.123" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32730" PostTypeId="2" ParentId="14274" CreationDate="2017-02-28T06:41:50.277" Score="-1" Body="&lt;p&gt;&lt;a href=&quot;http://tradingtuitions.com/category/categories/trading-excel-sheets/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Trading Tuitions&lt;/a&gt; has some nice examples of complete Trading systems in Excel sheet. There are some downloadable excel sheets with real time price/options data with backtesting option. I have been using &lt;a href=&quot;http://tradingtuitions.com/intraday-open-high-low-strategy-live-signals/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Open=High, Open=Low&lt;/a&gt; Excel sheet from last few months and the signals are pretty accurate.&lt;/p&gt;&#xA;" OwnerUserId="26787" LastActivityDate="2017-02-28T06:41:50.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32731" PostTypeId="2" ParentId="32709" CreationDate="2017-02-28T09:19:14.590" Score="1" Body="&lt;p&gt;What you want is option 1 (simplier). In the other case you will loose money because of spreads&lt;/p&gt;&#xA;" OwnerUserId="12089" LastActivityDate="2017-02-28T09:19:14.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32733" PostTypeId="1" CreationDate="2017-02-28T13:35:04.433" Score="1" ViewCount="155" Body="&lt;p&gt;In the simple Black-Scholes model, we can replicate an option by investing its $\Delta$ in the underlying, and keeping that portfolio self-financing via the bank account. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have two questions. I don't necessarily expect answers served on a platter, some references that I can read on my own would be okay too:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Why does that strategy work? I understand it on an intuitive basis, but I don't know how to prove it via the math.&lt;/li&gt;&#xA;&lt;li&gt;What would you do in more general situations where the payoff of the option depends on something other than the domestic stock asset? Say it was a foreign stock asset. If the exchange rate is X (stochastic), what is the corresponding replicating portfolio? &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="26148" LastActivityDate="2017-02-28T21:31:56.573" Title="Why does this delta hedge work, and what to do in more general circumstances?" Tags="&lt;replication&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32735" PostTypeId="1" CreationDate="2017-02-28T15:53:00.817" Score="2" ViewCount="188" Body="&lt;p&gt;I would like to compute the price for a Call option written on a defaultable bond as underlying.&#xA;Suppose you have the following dynamic under the risk free measure $\mathcal{Q}$ for the interest rate:&#xA;$$&#xA;d r_t  = ( a^r - b^r r_t) \, dt + \sigma^r dW^r_t \\&#xA;$$&#xA;with initial point $r_0$,&#xA;and the following dynamic for the hazard rate:&#xA;$$&#xA;d \gamma_t = ( a^\gamma - b^\gamma \gamma_t) \, dt + \sigma^\gamma dW^\gamma_t \\&#xA;$$&#xA;with initial point $\gamma_0$.&#xA;I'm gonna call $p_1(T_1, T_2)$ the price at time $T_1$ for a defaultable bond with maturity $T_2$ and interest rate $r_t$.&#xA;We can also suppose that there exists a risk-free bond $p_0(T_1, T_2)$ (again with interest rate $r_t$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will write $\tau$ in order to denote the random variable of the default time so that its density is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\gamma_t e^{-\int_0^t \gamma_s \, ds}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The very classical formula for the price of the call option in this case is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;E^{Q} \left[ I_{\tau &amp;gt; T_1}  e^{-\int_0^{T_1} r_s \, ds}  \left( p_1(T_1, T_2) - K  \right)^+ \right]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By using a classical theorem (Theorem 9.23; Quantitative Risk Management; McNeil, Frey, Embrechts) we have the following result:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA; = E^{Q} \left[  e^{\int_0^{T_1} r_s + \gamma_s \, ds } \left( p_1(T_1, T_2) - K  \right)^+  \right] I_{\tau &amp;gt; 0} .&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here I have some trouble: I would like to do a change of numeraire (the really standard technique) and use the Black-Scholes formula. The problem is the &quot;spred term&quot;, i.e. the exponential with $\gamma$. Infact let me do the usual splitting of the Call payoff:&#xA;$$&#xA;=  E^{Q} \left[  e^{-\int_0^{T_1} r_s + \gamma_s \, ds } p_1(T_1, T_2)  I_{ p_1(T_1, T_2) - K &amp;gt;0}  \right] - K E^{Q} \left[  e^{-\int_0^{T_1} r_s + \gamma(s) \, ds } I_{ p_1(T_1, T_2) - K &amp;gt;0} \right]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to compute the first term I will change the numeraire by using $p_0$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;p_0(0, T_1)E^{Q^{p_0}} \left[ e^{-\int_0^{T_1}  \gamma_s \, ds } I_{ p_1(T_1, T_2) - K &amp;gt;0}  \right] = p_0(0, T_1)E^{Q^{p_0}} \left[ e^{-\int_0^{T_1}  \gamma(s) \, ds } I_{ \frac{p_1(T_1, T_2)}{p_0(T_1, T_1)} - K &amp;gt;0}  \right]&#xA;$$&#xA;where in the last passage I've used the fact that $p_0(T_1, T_1) = 1$. At this point I'm little bit lost. Infact in the case of non defaultable bond everything is fine since there is no $\gamma$-term and I can use the Black-Scholes formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question is: what is, more or less, the idea to compute the price in the defaultable framework?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ciao!&#xA;AM&lt;/p&gt;&#xA;" OwnerUserId="26793" LastActivityDate="2017-02-28T15:53:00.817" Title="Price of a Bond-Call option in the defaultable framework" Tags="&lt;option-pricing&gt;&lt;bond&gt;&lt;default-probability&gt;&lt;vasicek&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32736" PostTypeId="1" AcceptedAnswerId="32760" CreationDate="2017-02-28T16:35:45.670" Score="0" ViewCount="753" Body="&lt;p&gt;Most paid end-of-day data packages are available in metastock format. For analytics purposes, it will be nice if one can read the metastock data and load them into Python panda data frames. Is it possible to do this today?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The metastock format I am referring to is the legacy (pre-12.0) MetaStock file format. It is a binary file format and originated from the Computrac file format. There are four files associated with the format: MASTER, EMASTER, XMASTER, F&lt;em&gt;DAT, and F&lt;/em&gt;.MWD.&lt;/p&gt;&#xA;" OwnerUserId="6190" LastEditorUserId="6190" LastEditDate="2017-03-01T13:13:35.793" LastActivityDate="2017-03-01T13:13:35.793" Title="Loading metastock data into panda data frames" Tags="&lt;equities&gt;&lt;python&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32737" PostTypeId="2" ParentId="32675" CreationDate="2017-02-28T17:03:10.010" Score="2" Body="&lt;p&gt;In black-scholes world, correlation between volatility and spot is zero. From the above details you can estimate how the implied volatility for a given option (note options have FIXED strikes) might change for a given move in spot. If when stock goes up, the option's implied vol goes down, this would be a violation of the black-scholes model (which scenario 1/2/3/4 would the correlation be negative?). In particular, your black scholes delta will be biased. Given the option's vega, can you tell me in what way the delta would be biased? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;specifically what is dBS(S, sigma(S))/dS ? where dsigma(s)/ds &amp;lt; 0&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This might give you some intuition for how this information would be used in a practical sense.&lt;/p&gt;&#xA;" OwnerUserId="1105" LastActivityDate="2017-02-28T17:03:10.010" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32738" PostTypeId="1" CreationDate="2017-02-28T17:47:08.420" Score="1" ViewCount="225" Body="&lt;p&gt;I am looking for an analytical proof, that the sum of two log normal random variables is not log-normal. Couldn't find it anywhere, does somebody know where to find it or know how to do it?&lt;/p&gt;&#xA;" OwnerUserId="26565" LastEditorUserId="2587" LastEditDate="2017-03-01T07:28:19.343" LastActivityDate="2017-03-01T07:28:19.343" Title="How can I prove that the sum of two log-normal variable is not log-normal?" Tags="&lt;lognormal&gt;&lt;proof&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32739" PostTypeId="2" ParentId="32738" CreationDate="2017-02-28T18:30:57.617" Score="1" Body="&lt;p&gt;Let lnA be N(0,1) and lnB be N(0,k) where we will let k tend to zero.  Then B has all of its density at 1, so A+B&gt;1 in the limit.  Hence A+B is not lognormal.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-02-28T18:30:57.617" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="32740" PostTypeId="1" AcceptedAnswerId="32773" CreationDate="2017-02-28T19:35:47.623" Score="0" ViewCount="615" Body="&lt;p&gt;I'm reading about Binomial Model on &quot;Arbitrage Theory in Continuous Time&quot; by Tomas Bjork. I found an important result which allow us to state that in a one period model $q_u$ and $q_d$ are actually probabilities. The following theorem holds:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;The model is arbitrage-free if and only if &#xA;$$d\le(1+R)\le u.&quot;$$&#xA;At the same time I'm reading &quot;The Bible&quot; by Hull where the author deals with the model but using continuous compounding of interest rates. I'm wondering if an analogous of Bjork'sresult holds, such as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The model is arbitrage-free if and only if&#xA;$$d\le e^{rt} \le u,$$&#xA;where $t$ is the option maturity (I'm taking into account maturities which are different from 1).&#xA;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="22470" LastActivityDate="2017-04-01T02:31:32.297" Title="Binomial Model for options pricing with continuous compounding" Tags="&lt;option-pricing&gt;&lt;binomial-tree&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32741" PostTypeId="1" CreationDate="2017-02-28T19:36:02.873" Score="1" ViewCount="84" Body="&lt;p&gt;I have future contracts from 10 years back that are combined in one file. There is a gap in the data every month due to rolling of the contracts. How do I remove this gap ad get a smooth time series that I can perform backtesting on. &lt;/p&gt;&#xA;" OwnerUserId="26799" LastActivityDate="2017-02-28T19:36:02.873" Title="Combine future contracts into time series" Tags="&lt;time-series&gt;&lt;programming&gt;&lt;futures&gt;&lt;backtesting&gt;" AnswerCount="0" CommentCount="6" ClosedDate="2017-03-01T09:37:44.083" ContentLicense="CC BY-SA 3.0" />
  <row Id="32742" PostTypeId="2" ParentId="32725" CreationDate="2017-02-28T21:17:43.447" Score="7" Body="&lt;p&gt;Your simulation is basically fine, though you need to discount in USD. For hedging purpose, you need to use the instruments available in USD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $S=\{S_t, \, t\ge 0\}$ be the stock price process in EUR, $X=\{X_t, \, t\ge 0\}$ be the exchange rate process from one unit EUR to units USD, $r_f$ and $r_d$ be interest rates in EUR and USD. Moreover, let $B_t^f=e^{r_f t}$ and $B_t^d=e^{r_d t}$ be respectively the money market account values in EUR and USD. Then the available instruments in USD are $XS$, $B^d$, and $B^fX$. Specifically, we assume that $X$ and $S$ satisfy a system of SDEs of the form&#xA;\begin{align*}&#xA;dS_t &amp;amp;= S_t\left(\mu_s dt + \sigma_s dW_t^1 \right),\\&#xA;dX_t &amp;amp;= X_t\left[\mu_x dt + \sigma_x \left(\rho dW_t^1 + \sqrt{1-\rho^2}dW_t^2\right) \right],&#xA;\end{align*}&#xA;where $\mu_s$ and $\mu_x$ are drift terms, $\rho$ is the correlation, $\{W_t^1, t\ge0\}$ and $\{W_t^2, t\ge0\}$ are two independent standard Brownian motions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $C(t, S_t)$ be the quanto option price at time $t$. We seek a self-financing portfolio such that&#xA;\begin{align*}&#xA;C(t, S_t) = \Delta_t^1 X_tS_t + \Delta_t^2 X_t B_t^f + \Delta_t^3 B_t^d.\tag{1}&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;dC &amp;amp;= \Delta_t^1 d\left(X_tS_t\right) + \Delta_t^2 d\left(X_t B_t^f\right) + \Delta_t^3 d\left(B_t^d\right)\\&#xA;&amp;amp;=\Delta_t^1X_tS_t\left[\left(\mu_s + \mu_x + \rho\sigma_s\sigma_x \right) dt + \sigma_s dW_t^1 + \sigma_x \left(\rho dW_t^1 + \sqrt{1-\rho^2}dW_t^2\right) \right]\\&#xA;&amp;amp;\quad + \Delta_t^2 X_t B_t^f\left[(\mu_x + r_f) dt + \sigma_x \left(\rho dW_t^1 + \sqrt{1-\rho^2}dW_t^2\right) \right] + r_d\Delta_t^3 B_t^d dt.&#xA;\end{align*}&#xA;On the other hand&#xA;\begin{align*}&#xA;dC &amp;amp;= \frac{\partial C}{\partial t}dt + \frac{\partial C}{\partial S}S_t \left(\mu_s dt + \sigma_s dW_t^1 \right) + \frac{1}{2}\frac{\partial^2 C}{\partial S^2}S_t^2 \sigma_s^2 dt.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;\frac{\partial C}{\partial S}S_t\sigma_s dW_t^1 &amp;amp;= \Delta_t^1X_tS_t\left[\sigma_s dW_t^1 + \sigma_x \left(\rho dW_t^1 + \sqrt{1-\rho^2}dW_t^2\right) \right]\\&#xA;&amp;amp;\qquad\qquad\qquad + \Delta_t^2 X_t B_t^f \sigma_x \left(\rho dW_t^1 + \sqrt{1-\rho^2}dW_t^2\right),\tag{2}&#xA;\end{align*}&#xA;and &#xA;\begin{align*}&#xA;&amp;amp;\ \frac{\partial C}{\partial t}dt + \frac{\partial C}{\partial S}S_t \mu_s dt + \frac{1}{2}\frac{\partial^2 C}{\partial S^2}S_t^2 \sigma_s^2 dt \\&#xA;=&amp;amp;\ \Delta_t^1X_tS_t\left(\mu_s + \mu_x + \rho\sigma_s\sigma_x \right) dt+\Delta_t^2 X_t B_t^f(\mu_x + r_f) dt+r_d\Delta_t^3 B_t^d dt.\tag{3}&#xA;\end{align*}&#xA;From $(2)$, &#xA;\begin{align*}&#xA;&amp;amp;\Delta_t^1X_tS_t \sigma_x + \Delta_t^2 X_t B_t^f \sigma_x =0,\\&#xA;&amp;amp;\frac{\partial C}{\partial S}S_t\sigma_s = \Delta_t^1X_tS_t\left(\sigma_s+ \sigma_x \rho\right) + \Delta_t^2 X_t B_t^f \sigma_x \rho.&#xA;\end{align*}&#xA;Combining with $(1)$ above,&#xA;\begin{align*}&#xA;\Delta_t^1 &amp;amp;= \frac{1}{X_t}\frac{\partial C}{\partial S}, \\&#xA;\Delta_t^2 &amp;amp;= -\frac{S_t}{B_t^f}\Delta_t^1, \\&#xA;\Delta_t^3 &amp;amp;=\frac{C(t, S_t)}{B_t^d}.&#xA;\end{align*}&#xA;From $(3)$, we obtain the Black-Scholes type PDE&#xA;\begin{align*}&#xA;\frac{\partial C}{\partial t} + \left(r_f - \rho\sigma_s\sigma_x \right)S_t \frac{\partial C}{\partial S} + \frac{1}{2}\frac{\partial^2 C}{\partial S^2}S_t^2 \sigma_s^2 = r_d C.&#xA;\end{align*}&#xA;See also the notes &lt;a href=&quot;http://wwwf.imperial.ac.uk/~mdavis/course_material/MOP/MOP_NOTES.PDF&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-03-01T14:49:40.577" LastActivityDate="2017-03-01T14:49:40.577" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32743" PostTypeId="2" ParentId="32738" CreationDate="2017-02-28T21:20:04.580" Score="0" Body="&lt;p&gt;Let $Z_1$ and $Z_2$ be normal random variables. Therefore, $e^{Z_1}$ and $e^{Z_2}$ are log-normal random variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The central limit theorem says that the sum of random variables tends toward a normal distribution even if their sampling distributions are not normally distributed. Therefore $Z_1$ + $Z_2$ will tend toward normally distributed. However, $e^{Z_1} + e^{Z_2} \ne e^{Z_1+Z_2}.$ &lt;/p&gt;&#xA;" OwnerUserId="26547" LastActivityDate="2017-02-28T21:20:04.580" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32744" PostTypeId="2" ParentId="32733" CreationDate="2017-02-28T21:31:56.573" Score="1" Body="&lt;p&gt;In the Black-Scholes world, one assumes that there is only one source of uncertainty in the model (namely the value of the underlying asset). So, to hedge, you only need to invest in a risk free asset and the underlying. In general, if your payoff dépends on other sources of risk, your hedging portfolio would also have to depend on those sources of risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One can think of a hedging portfolio as a Taylor approximation of the value of the asset. So, if the value of your asset is dépendent on several variables, your Taylor expansion (i.e. your hedge portfolio) will have to also depend on those variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as litterature on the subject goes.......I can't think of one in particular. Bjork's book &quot;Arbitrage theory in continuous time&quot; might be a good place to look.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps!&lt;/p&gt;&#xA;" OwnerUserId="26801" LastActivityDate="2017-02-28T21:31:56.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32745" PostTypeId="1" AcceptedAnswerId="32749" CreationDate="2017-02-28T21:47:54.960" Score="3" ViewCount="204" Body="&lt;p&gt;Assume constant interest rate $r$ and a stock with current price at $S_0$ that pays no dividend (assume $S_t\ge0$). When the stock price hits the barrier $B$ (where $B&amp;lt;S_0$) you receive \$$1$ and the derivative would terminate. This derivative doesn't have a maturity date. $S_t$ follows geometric Brownian motion with constant volatility $\sigma$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the present value of this derivative?&lt;/p&gt;&#xA;" OwnerUserId="6428" LastEditorUserId="6428" LastEditDate="2017-02-28T22:03:37.747" LastActivityDate="2017-03-01T01:26:13.793" Title="Barrier Derivative Pricing" Tags="&lt;black-scholes&gt;&lt;barrier&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32749" PostTypeId="2" ParentId="32745" CreationDate="2017-03-01T00:50:46.497" Score="1" Body="&lt;p&gt;As is often the case, there are generally two solution strategies here.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;(Probabilistic)&lt;/strong&gt; You explicitly solve for the expected discount factor at the first passage time $\nu$ of $S$ to the level $B$ under the risk-neutral probability measure $\mathbb{P}^*$, i.e.&#xA;\begin{equation}&#xA;V_0 = \mathbb{E}_{\mathbb{P}^*} \left[ e^{-r \nu} \right].&#xA;\end{equation}&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;(Differential Equation)&lt;/strong&gt; The option value $V$ satisfies the ODE&#xA;\begin{equation}&#xA;\frac{1}{2} \sigma^2 S^2 \frac{\mathrm{d} V^2}{\mathrm{d} S^2} + r S \frac{\mathrm{d} V}{\mathrm{d} S} - r V = 0&#xA;\end{equation}&#xA;subject to the contract-specific boundary conditions.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I will outline the second approach here and refer to e.g. Chapter 9 in Wilmott (2006) for further details. See e.g. &lt;a href=&quot;http://www.matthiasthul.com/wordpress/2010/06/10/american-digital-call-option/&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; blog post for a solution to the finite-maturity American digital call option valuation problem using the first approach. In order to obtain the solution for the perpetual case, simply take the limit $T \rightarrow \infty$. The solution to the put is fully analogous.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;ODE Approach&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The ODE can be rearranged to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;S^2 \frac{\mathrm{d} V^2}{\mathrm{d} S^2} + \lambda S \frac{\mathrm{d} V}{\mathrm{d} S} - \lambda V = 0,&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\lambda = 2r / \sigma^2$. This equation is of the Euler-Cauchy type and we thus try the solution&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;V(S) = S^\beta&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\beta (\beta - 1) S^\beta + \beta \lambda S^\beta - \lambda S^\beta = 0.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This equation holds for all values of $S$ if&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\beta^2 + \beta (\lambda - 1) - \lambda = 0.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solving for $\beta$ yields&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\beta_\pm = \frac{1}{\sigma^2} \left( -\left( r - \frac{1}{2} \sigma^2 \right) \pm \left( r + \frac{1}{2} \sigma^2 \right) \right)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and we notice that $\beta_+ = 1$ and $\beta_- = -\lambda$. The general solution to the ODE is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;V(S) = c_- S^{-\lambda} + c_+ S,&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $c_\pm$ depend on the boundary conditions of the contract. In case of a put option we have the upper boundary condition $\lim_{S \rightarrow \infty} V(S) = 0$, which implied that $c_+ = 0$. The value matching condition at the lower boundary is $U(B) = 1$ and we thus obtain $c_- = B^\lambda$. Consequently,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;V(S) = \left( \frac{S}{B} \right)^{-\lambda}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wilmott, Paul (2006) &lt;em&gt;Paul Wilmott on Quantitative Finance&lt;/em&gt;, Vol. 1: Wiley, 2nd edition.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-03-01T01:26:13.793" LastActivityDate="2017-03-01T01:26:13.793" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32750" PostTypeId="1" CreationDate="2017-03-01T04:35:48.950" Score="4" ViewCount="247" Body="&lt;p&gt;We know that by changing the variables we can obtain the &lt;code&gt;Black-Scholes&lt;/code&gt; formula of &lt;code&gt;vanilla call&lt;/code&gt; through solving the &lt;code&gt;heat equation&lt;/code&gt;:&#xA;$$S = Be^{x},\quad t = T - \tau/\dfrac{1}{2}\sigma^2,\quad C(t,S) = Bu(\tau, x),\quad v(\tau,x)=e^{\alpha x+\beta\tau}u(\tau,x)$$&#xA;$$\dfrac{\partial v}{\partial \tau} = \dfrac{\partial^2 v}{\partial x^2}$$&#xA;with boundary and initial conditions:&#xA;$$v(\tau,x)=0, x\rightarrow -\infty;$$&#xA;$$v(\tau,x)\sim (e^x-e^{-r\tau}), x\rightarrow \infty;$$&#xA;$$v(0,x) = u_0(x).$$&#xA;And, for the &lt;code&gt;down-out-call&lt;/code&gt;, only the boundary conditions change:&#xA;$$v(\tau,x)=0, x=0;$$&#xA;$$v(\tau,x)\sim (e^x-e^{-r\tau}), x\rightarrow \infty;$$&#xA;$$x\in(0,\infty)$$&#xA;then we can use the &lt;code&gt;reflection property&lt;/code&gt; of &lt;code&gt;heat equation&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let&#xA;$$v(\tau,x) = V(\tau,x)-V(\tau,-x)$$&#xA;here $V(\tau,x)$ is the solution in the first &lt;code&gt;vanilla call heat equation&lt;/code&gt;, to extend $v(\tau,x)$ to $x\in(-\infty,\infty);$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, for the &lt;code&gt;up-out-call&lt;/code&gt;, the boundary conditions become:&#xA;$$v(\tau,x)=0, x\rightarrow-\infty;$$&#xA;$$v(\tau,x)=0,x=0;$$&#xA;$$x\in(-\infty,0)$$&#xA;I don't how to use $V(\tau,x)$ to construct the above conditions(surely, include the initial condition)？&lt;/p&gt;&#xA;" OwnerUserId="26165" LastEditorUserId="26165" LastEditDate="2017-03-01T04:45:36.627" LastActivityDate="2017-11-26T15:03:32.623" Title="How to price up-out-call by solving heat equation like down-out-call" Tags="&lt;derivatives&gt;&lt;black-scholes-pde&gt;&lt;barrier&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32751" PostTypeId="1" CreationDate="2017-03-01T06:46:19.373" Score="0" ViewCount="54" Body="&lt;p&gt;Let say I develop &lt;a href=&quot;https://en.wikipedia.org/wiki/Q-learning&quot; rel=&quot;nofollow noreferrer&quot;&gt;Q-learning&lt;/a&gt; strategy to predict IBM's stock price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, it means that Q-table is created based on past IBM stock price data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, this Q-table could be applied only to &lt;code&gt;IBM&lt;/code&gt; future price prediction?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What about applying it to &lt;code&gt;APPLE&lt;/code&gt;? Would it be possible?&lt;/p&gt;&#xA;" OwnerUserId="26582" LastEditorUserId="848" LastEditDate="2017-03-01T09:38:49.427" LastActivityDate="2017-03-01T09:38:49.427" Title="Can Q-table learned by specific stock be applied to only that stock?" Tags="&lt;machine-learning&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32752" PostTypeId="1" AcceptedAnswerId="32757" CreationDate="2017-03-01T06:50:02.947" Score="2" ViewCount="91" Body="&lt;p&gt;I have learnt two versions of Monte Carlo simulations to do stock price, and can someone help check if I am thinking this right.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first one is the most common one: $\frac{\Delta S_t}{St}-1 = \mu dt + \sigma dW$, where the $\mu$ is average of stock return, $\sigma$ is also for return, not price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second one: $S_t = S_{t-1} \exp\left[(r- \frac{1}{2} \sigma^2) dt + \sigma dW\right]$, where $r$ is the return of stock and $\sigma$ is for return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From my perspective, the first one is based on the return of stock, where return is normal distributed under BS. However the second one is from a price point, because the price is lognormal distributed according to BS. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I thinking this right? Are they actually same?&lt;/p&gt;&#xA;" OwnerUserId="26804" LastEditorUserId="467" LastEditDate="2017-03-02T01:23:12.663" LastActivityDate="2017-03-02T01:23:12.663" Title="Doing MC simulation using two different methods, are they the same?" Tags="&lt;equities&gt;&lt;black-scholes&gt;&lt;monte-carlo&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32754" PostTypeId="1" CreationDate="2017-03-01T08:14:34.080" Score="2" ViewCount="186" Body="&lt;p&gt;I'm reading a paper on order anticipation strategy and came across this line in the paper:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We assume that all model parameters, including &lt;code&gt;n&lt;/code&gt; and &lt;code&gt;∆ := (∆0 , . . .&#xA;  , ∆n )&lt;/code&gt;, are known to all strategic traders. Hence all traders&#xA;  anticipate the net orders of all other traders.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I have read similar arguments made in some other papers as well. I wonder if it is fair to make such an assumption. I havent read the entire paper because this line left me puzzled. Can someone please share some insights on this points. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Link to the &lt;a href=&quot;https://arxiv.org/pdf/1609.00599.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;paper&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;---EDIT----&#xA;In the above comment. n is the number of strategic participants and ∆i is the number of shares that the ith participants want to buy/sell.&lt;/p&gt;&#xA;" OwnerUserId="15428" LastActivityDate="2017-04-02T20:25:55.453" Title="How do market participants know intentions of other players" Tags="&lt;high-frequency&gt;&lt;market-microstructure&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32755" PostTypeId="1" CreationDate="2017-03-01T09:52:37.720" Score="0" ViewCount="770" Body="&lt;p&gt;I have a covariance matrix and vector of expected returns as my inputs. I have used optim to solve for the weights that maximize the portfolio's return/volatility. I like optim as you can create your own function which you enter into the optimization. I have checked the results against Excel's solver and it works fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the next step I want to maximize the portfolio return for a given target volatility. I am struggling with this as optim only allows one to place constraints on the solved parameters (weights in my case) using method=&quot;L-BFGS-B&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought I could get around this by using IF statements in my function (which is going to be maximized) such that if the absolute difference between my portfolio volatility and my target volatility is more than a specific threshold, make the portfolio return = 0, otherwise use the calculated portfolio return. I’ve defined how to calculate the portfolio volatility and return in my function. I was hoping that as the optimizer solved the weights it would essentially discard all the solutions I don’t want as their returns would be zero. Unfortunately this didn’t happen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my coding. Does anyone know how I can achieve this using optim or what I am doing wrong?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#generate data set&#xA;set.seed(1)&#xA;A &amp;lt;- runif(100);head(A)&#xA;B &amp;lt;- runif(100);head(B)&#xA;C &amp;lt;- runif(100);head(C)&#xA;D &amp;lt;- runif(100);head(D)&#xA;&#xA;returns &amp;lt;- cbind(A,B,C,D)&#xA;cov(returns)&#xA;&#xA;&#xA;Weights &amp;lt;-cbind(0.25,0.25,0.25,0.25) #starting point is an equally weighted portfolio&#xA;EReturns &amp;lt;- cbind(0.0064,0.0045,-0.0050,0.0028);  #Expected Returns&#xA;VCV &amp;lt;- cov(returns) #Sample covariance matrix&#xA;&#xA;TargetVol &amp;lt;- 0.01&#xA;&#xA;OptWeightE &amp;lt;- function(Weights, ExpectedReturns, VCV, TargetVol){&#xA;  Weights &amp;lt;- abs(Weights)/sum(abs(Weights)) #ensures all the weights will be positive and sum to 100%&#xA;  PReturn &amp;lt;- Weights %*% t(EReturns)               &#xA;  PVol &amp;lt;- ((Weights %*% VCV) %*% Weights)^0.5&#xA;  if (abs(PVol- TargetVol) &amp;gt; 0.005) { &#xA;    PReturn &amp;lt;- 0&#xA;  }&#xA;  if (abs(PVol - TargetVol) &amp;lt; 0.005) { &#xA;    PReturn &amp;lt;- Weights %*% t(EReturns)&#xA;  }&#xA;  -PReturn #negative the default is to minimise&#xA;}&#xA;&#xA;solE &amp;lt;- optim(par = Weights, fn =OptWeightE,ExpectedReturns = EReturns, VCV = VCV, TargetVol = 0.01)&#xA;&#xA;optWE &amp;lt;- abs(solE$par)/sum(solE$par); optWE&#xA;sum(optWE)&#xA;&#xA;optVolWE &amp;lt;- ((optWE %*% VCV) %*% t(optWE))^0.5; optVolWE&#xA;optRE &amp;lt;- optWE %*% t(EReturns); optRE&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="26713" LastEditorUserId="12" LastEditDate="2017-03-01T12:58:21.113" LastActivityDate="2017-03-01T13:41:42.487" Title="R optimization using OPTIM" Tags="&lt;optimization&gt;&lt;markowitz&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32756" PostTypeId="2" ParentId="32750" CreationDate="2017-03-01T10:12:04.740" Score="1" Body="&lt;p&gt;What you seem to omit is the initial condition for $v(\tau, x)$? Assume you have an up-and-out barrier option for which $v$ satisfies the initial boundary value problem&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\mathcal{H} \{ v \} (\tau, x) &amp;amp; = &amp;amp; 0 \qquad \text{for } (\tau, x) \in \mathbb{R}_+ \times \mathbb{R}_-\\&#xA;v(0, x) &amp;amp; = &amp;amp; f(x)\\&#xA;v(\tau, 0) &amp;amp; = &amp;amp; 0 \qquad \text{for } \tau \in [0, \infty).&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, $\mathcal{H}$ is the heat equation operator and $f(x)$ is the payoff specific initial condition - in your case that of a call option. Then you define the auxiliary initial value problem $V(\tau, x)$ which satisfies&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\mathcal{H} \{ V \} (\tau, x) &amp;amp; = &amp;amp; 0 \qquad \text{for } (\tau, x) \in \left( \mathbb{R}_+, \mathbb{R} \right)\\&#xA;V(0, x) &amp;amp; = &amp;amp; f(x) \mathrm{1} \{ x &amp;lt; 0 \}.&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V(\tau, x)$ is the corresponding full-range problem where you keep the initial condition but restrict it to the active domain of the barrier option via the indicator. You solve for $V(\tau, x)$ by e.g. a convolution of the initial condition with the heat kernel.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-03-01T10:17:07.453" LastActivityDate="2017-03-01T10:17:07.453" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32757" PostTypeId="2" ParentId="32752" CreationDate="2017-03-01T10:17:00.497" Score="4" Body="&lt;p&gt;As the name indicates, the purpose of your Monte Carlo simulation is to &lt;em&gt;simulate&lt;/em&gt; the solution $(S_t)_{t\geq 0}$ of the following SDE (dynamics of the risky-asset under Black-Scholes)&#xA;$$ dS_t/S_t = \mu dt + \sigma dW_t;\quad S(0)=S_0 \tag{1} $$&#xA;at discrete points in time, typically a uniform partition of the interval $[0,T]$ with time step $\Delta t$,&#xA;$$ t_0=0,\,\dots, t_i=i\Delta t,\,\dots,\, t_N = T $$&#xA;Let's denote the simulated values at the different times $t_i$ by $(\tilde{S}_{t_i})_{i=0,\dots,N}$&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The second approach you mention, i.e.&#xA;$$\tilde{S}_{t_i} = \tilde{S}_{t_{i-1}} \exp\left( (\mu - \sigma^2/2)\Delta t + \sigma \sqrt{\Delta t} z \right) \tag{2} $$&#xA;simulates the &lt;em&gt;exact solution&lt;/em&gt; of the SDE, expressed at discrete times, hence $$\tilde{S}_{t_i} = S_{t_i} $$ &#xA;It can be obtained by applying Itô's lemma to the function $\ln(S_t)$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The first approach you mention relies on what's called an &lt;a href=&quot;https://en.wikipedia.org/wiki/Euler%E2%80%93Maruyama_method&quot; rel=&quot;nofollow noreferrer&quot;&gt;Euler-Maruyama&lt;/a&gt; discretisation of the stochastic differential equation $(1)$ and indeed simulates&#xA;$$ \tilde{S}_{t_i} = \tilde{S}_{t_{i-1}} \left( 1 + \left( \mu \Delta t + \sigma \sqrt{\Delta t} z \right) \right) \tag{3} $$&#xA;Because of the discretisation, the sequence of simulated values will merely constitute an &lt;em&gt;approximation&lt;/em&gt; of the exact solution to $(1)$ which is $(2)$, i.e.&#xA;$$ \tilde{S}_{t_i} \approx S_{t_i} $$&#xA;This approximate solution will converge to the true one as the time step of the simulation tends towards zero though ($\Delta t \to 0$). &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You might ask yourself, why would one use the second approach above while we could directly use the first which is exact.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answer is obviously that not all SDEs admit analytical solutions. This means that in general SDEs needs to be &lt;em&gt;discretised&lt;/em&gt; to numerically simulate their solutions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition to the simple Euler-Maruyama method, plenty of different discretisation schemes exist, notably the famous Milstein family. They essentially differ by their convergence properties as $\Delta t \to 0$.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2017-03-01T14:10:39.137" LastActivityDate="2017-03-01T14:10:39.137" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32758" PostTypeId="1" CreationDate="2017-03-01T10:45:17.797" Score="2" ViewCount="1041" Body="&lt;p&gt;Anyone knows why the OIS leg for basis swaps pays the average rate instead of the geometric average compounding rate as expected for a regular OIS swap leg? &lt;/p&gt;&#xA;" OwnerUserId="19764" LastEditorUserId="19764" LastEditDate="2017-03-01T11:19:43.543" LastActivityDate="2017-03-31T12:16:55.647" Title="USD-Federal Funds for OIS swaps vs USD-Federal Funds for Basis swaps" Tags="&lt;swaps&gt;&lt;interest-rate-swap&gt;&lt;ois&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32759" PostTypeId="2" ParentId="32758" CreationDate="2017-03-01T11:30:27.980" Score="3" Body="&lt;p&gt;As far as I know, it's a market convention. The two products, namely OIS swap (fixed vs floating) and Fed Fund Libor basis swap, are developed differently, so they follow different conventions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My only guess is that it's because of the difference in maturity and period: OIS swap is typically a single-period swap (i.e. zero coupon swap) on short-end (&amp;lt; 2 yrs) while FF Libor basis swap is multiple period swap on long-end (&gt; 2 yrs). The geometric compounding is for mimicking the daily reinvestment, so it makes sense for the single period. However, the daily reinvestment is not in line with multiple period swap because the notional is reset at every period, so you don't have to stick to the geometric compounding. In fact, arithmetic averaging is a much simpler computing choice to layman.&lt;/p&gt;&#xA;" OwnerUserId="26559" LastActivityDate="2017-03-01T11:30:27.980" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32760" PostTypeId="2" ParentId="32736" CreationDate="2017-03-01T12:32:03.730" Score="1" Body="&lt;p&gt;The binary data from MetaStock cannot be directly read into a pandas dataframe, or for the matter of fact, into any python library commonly known. For this you would need to convert it into text and then import, which simply complicates the process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The easier way to do this, would be to use Quandl - although it costs slightly higher than MetaStock, it ties in very well to Python, and you can import the requisite data in a jiffy.&lt;/p&gt;&#xA;" OwnerUserId="26170" LastActivityDate="2017-03-01T12:32:03.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32761" PostTypeId="2" ParentId="32755" CreationDate="2017-03-01T13:41:42.487" Score="2" Body="&lt;p&gt;This is not a complete answer, just a few pointers regarding your code (can't post it as a comment, as I'm a new member, too):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;This part can be omitted, as you have specified PReturn before:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if (abs(PVol - TargetVol) &amp;lt; 0.005) {&#xA;PReturn &amp;lt;- Weights %*% t(EReturns)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In you optimization you don't specify any bounds on the weights. In particular, we can get negative weights and a total sum of the weights that exceeds 1 - rescaling doesn't correct that error.&lt;br&gt;&#xA;My suggestion is that you omit the part&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;if (abs(PVol- TargetVol) &amp;gt; 0.005) { &#xA;PReturn &amp;lt;- 0&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in the OptWeightE function and instead use another minimizing function that allows for the condition&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sum(Weights)=1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in the optimization process. This can be done easily with the &quot;solnp&quot; function in the &quot;Rsolnp&quot; package.&lt;br&gt;&#xA;Here's the code for the solnp optimization:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#generate data set&#xA;set.seed(1)&#xA;A &amp;lt;- runif(100);head(A)&#xA;B &amp;lt;- runif(100);head(B)&#xA;C &amp;lt;- runif(100);head(C)&#xA;D &amp;lt;- runif(100);head(D)&#xA;&#xA;returns &amp;lt;- cbind(A,B,C,D)&#xA;cov(returns)&#xA;&#xA;&#xA;Weights &amp;lt;-c(0.25,0.25,0.25,0.25) #starting point is an equally weighted portfolio&#xA;EReturns &amp;lt;- c(0.0064,0.0045,-0.0050,0.0028);  #Expected Returns&#xA;VCV &amp;lt;- cov(returns) #Sample covariance matrix&#xA;&#xA;TargetVol &amp;lt;- 0.01&#xA;&#xA;OptWeightE &amp;lt;- function(Weights, ExpectedReturns, VCV, TargetVol){&#xA;  Weights &amp;lt;- abs(Weights)/sum(abs(Weights)) #ensures all the weights will be positive and sum to 100%&#xA;  PReturn &amp;lt;- sum(Weights*EReturns)               &#xA;  -PReturn #negative the default is to minimise&#xA;}&#xA;&#xA;eqf&amp;lt;-function(Weights,ExpectedReturns,VCV,TargetVol)(sum(Weights))&#xA;&#xA;ineqf&amp;lt;-function(Weights,ExpectedReturns,VCV,TargetVol)&#xA;{&#xA;    PVol &amp;lt;- ((Weights %*% VCV) %*% Weights)^0.5;&#xA;    return(PVol)&#xA;}&#xA;&#xA;solE2&amp;lt;-solnp(pars=Weights, ExpectedReturns = EReturns, VCV = VCV,&#xA;TargetVol = 0.01, fun=OptWeightE, LB=rep(0,4),UB=rep(1,4),&#xA;ineqfun=ineqf, ineqUB=0.5, ineqLB=0, eqfun&amp;lt;-eqf, eqB=1)&#xA;solE2$pars&#xA;sum(solE2$pars)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The Matrix terminology wasn't necessary, so I replaced it with vectors.&lt;br&gt;&#xA;The optimization problem is specified as:&lt;br&gt;&#xA;$$\underset{weights}{\min} \text{OptWeightE, s.t.}$$&#xA;$$\text{sum(weights)}=1\text{ and}$$&#xA;$$0\le\text{PVol}\le0.5$$&#xA;This yields the result that the whole weight should be placed on the first factor (which has the highest expected return), if we take e.g. $0.5$ as an upper bound. $0.005$, as you wrote in your question, was not feasible for PVol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I did, was give you the optimization framework. Hence, what you have to do now, to get a valid result, is:&lt;br&gt;&#xA;Check, whether you correctly specified your functions. So far &lt;em&gt;PReturn&lt;/em&gt; simply is the vector product of &lt;em&gt;weights&lt;/em&gt; and the &lt;em&gt;EReturns&lt;/em&gt;.&#xA;This puts all the weight in the factor with the highest expected return (here the first factor), which is clearly not what you intended.&lt;br&gt;&#xA;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="26503" LastActivityDate="2017-03-01T13:41:42.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32762" PostTypeId="1" AcceptedAnswerId="32769" CreationDate="2017-03-01T15:31:31.160" Score="3" ViewCount="873" Body="&lt;p&gt;I have been asked to prove mathematically that a binary option close to maturity should be hedged using a call spread with the same maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that far from maturity, one would use delta hedging to sell or purchase the underlying asset. Yet as time to expiry tends to zero the delta profile tends towards a dirac delta function and so renders the hedge impractical.&#xA;See: &lt;a href=&quot;https://quant.stackexchange.com/questions/23267/delta-of-binary-option/23272&quot;&gt;delta of a binary option&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other than calculus to derive delta, are there any other rigorous ways to construct hedges of this kind?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As this is a homework question, hints rather than full answers are most welcome.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance,&lt;/p&gt;&#xA;" OwnerUserId="26809" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2017-03-01T21:21:59.243" Title="Hedging a binary option close to expiry" Tags="&lt;options&gt;&lt;delta-hedging&gt;&lt;binary&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32763" PostTypeId="1" AcceptedAnswerId="32764" CreationDate="2017-03-01T17:01:10.747" Score="0" ViewCount="505" Body="&lt;p&gt;Say I randomly simulate a one-year pathway of 252 prices, where the underlying price model is driven by geometric brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/73jrO.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/73jrO.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $t = (1 / 252)$, $mu = 5$% and annual $st.dev = 10%$%. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My understanding is that since the returns will be normally distributed, I can calculate the annual volatility by taking the standard deviation of the daily returns and scaling it by $√(252)$, and this should equal exactly 10%. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: say I take the same vector of prices but now only measures prices at weekly intervals, and only calculate the weekly return instead of the daily return. Will the standard deviation of the weekly returns, scaled by $√(52)$, still equal 10%? Or will it be lower due to a smoothing effect from the lower frequency? If so, how can I prove that mathematically?&lt;/p&gt;&#xA;" OwnerUserId="17712" LastActivityDate="2017-03-01T18:00:21.300" Title="Will volatility smoothing effects exist for returns driven by geometric brownian motion?" Tags="&lt;volatility&gt;&lt;stochastic-processes&gt;&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32764" PostTypeId="2" ParentId="32763" CreationDate="2017-03-01T18:00:21.300" Score="1" Body="&lt;p&gt;Just a quibble, but you say that you &quot;can calculate the annual volatility by taking the standard deviation of the daily returns and scaling it by $\sqrt{252}$, and this should equal exactly 10%.&quot; I think it should read that the &quot;annualized standard deviation will tend towards 10%&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &quot;tends&quot; is actually important, thus &quot;central tendency&quot;. The central limit theorem (CLT) states that as sample size $N$ increases from a random sampling of i.i.d. variables, with sample mean ($\mu_s$) and variance ($\sigma^2_s$), that sampling will converge with the population mean ($\mu_p$) and variance ($\sigma^2_p$). This idea is classically demonstrated through the Lindeberg–Lévy CLT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sqrt{n}((\frac{1}{n}\sum_{i=1}^nX_i)-\mu)\to $ distribution $N(0,\sigma^2)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sqrt{n}$ is sample size&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_i = \{X_1,X_2...\}$ is a sequence of i.i.d. variables with with an expected value equal to $\mu_p$ and expected variance equal $\sigma_p^2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$N(0,\sigma^2)$ is the cumulative distribution function &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, actually, your daily sampling will give you the smoother estimate of your actual variation and will converge to &quot;$\mu_p=5\%$ and annual $\sigma_p=10\%$&quot; quicker than your weekly sampling. In either case, the expected values of sample mean and variance are the same; weekly sampling should not result in smoothing if your underlying distribution is, indeed, normal. Note: the &quot;root time&quot; rule works  because the variance scales linearly with respect to time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If, however, the underlying stochastic process is mean-reverting -- as may exist in stock prices -- your intuition about smoothing of longer time periods actually will bear out (i.e., annualized daily variance will over-state actual annual variance).&lt;/p&gt;&#xA;" OwnerUserId="26547" LastActivityDate="2017-03-01T18:00:21.300" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32766" PostTypeId="1" CreationDate="2017-03-01T19:36:50.617" Score="3" ViewCount="300" Body="&lt;p&gt;how can we estimate the impact of a exchange rate regime switch ( from fixed to float) on the options prices i'm talking about the moroccan case (EUR/MAD USD/MAD) options OTC , is there any stochastic model for this ? &#xA;thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="26814" LastActivityDate="2018-05-26T13:25:29.830" Title="FX options pricing exchange rate regimes" Tags="&lt;options&gt;&lt;fx&gt;&lt;derivatives&gt;&lt;exchange&gt;&lt;stochastic&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32768" PostTypeId="2" ParentId="32725" CreationDate="2017-03-01T21:11:22.740" Score="0" Body="&lt;p&gt;fx options and smile risk by castagna is also a great book that explains quanto&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://books.google.co.il/books?id=8ma0ceIDk38C&amp;amp;pg=SA8-PA92&amp;amp;lpg=SA8-PA92&amp;amp;dq=mercurio+fx+optionsbook&amp;amp;source=bl&amp;amp;ots=0zosR_agBu&amp;amp;sig=_7M3znFK6wgBl19IWharjsos4kA&amp;amp;hl=en&amp;amp;sa=X&amp;amp;ved=0ahUKEwiN_Kz-mrbSAhXsLcAKHR5VBMkQ6AEIQDAI#v=onepage&amp;amp;q=quanto&amp;amp;f=false&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://books.google.co.il/books?id=8ma0ceIDk38C&amp;amp;pg=SA8-PA92&amp;amp;lpg=SA8-PA92&amp;amp;dq=mercurio+fx+optionsbook&amp;amp;source=bl&amp;amp;ots=0zosR_agBu&amp;amp;sig=_7M3znFK6wgBl19IWharjsos4kA&amp;amp;hl=en&amp;amp;sa=X&amp;amp;ved=0ahUKEwiN_Kz-mrbSAhXsLcAKHR5VBMkQ6AEIQDAI#v=onepage&amp;amp;q=quanto&amp;amp;f=false&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17348" LastActivityDate="2017-03-01T21:11:22.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32769" PostTypeId="2" ParentId="32762" CreationDate="2017-03-01T21:21:59.243" Score="3" Body="&lt;p&gt;The key point here is that when &lt;strong&gt;close to maturity&lt;/strong&gt; a binary option should be hedged with a call spread. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that, for a binary option with a payoff at maturity $T$ of the form $\mathbb{1}_{S_T&amp;gt;K}$, the value at time $0\le t &amp;lt; T$ is given by&#xA;$$e^{-r(T-t)}N(d_2), $$&#xA;where $$d_2 = \frac{\ln \frac{S_t}{K}+(r-\frac{1}{2}\sigma^2)(T-t)}{\sigma\sqrt{T-t}}.$$&#xA;Since&#xA;\begin{align*}&#xA;\frac{\partial N(d_2)}{\partial S_t} = \frac{\phi(d_2)}{\sigma S_t \sqrt{T-t}}\rightarrow \infty,&#xA;\end{align*}&#xA;as $t\rightarrow T$, the delta based hedging is not applicable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, with a call spread approximation of the form&#xA;\begin{align*}&#xA;\mathbb{1}_{S_T&amp;gt;K} \approx \frac{1}{\varepsilon}\Big[\big(S_T-(K-\varepsilon)\big)^+ - \big(S_T-K\big)^+\Big].&#xA;\end{align*}&#xA;The delta at time $0\le t &amp;lt; T$ is given by&#xA;$$\frac{1}{\varepsilon}\big[N(d_1^{-\varepsilon})-N(d_1^0)\big], $$&#xA;which is finite as $t\rightarrow T$. Here, &#xA;\begin{align*}&#xA;d_1^{\alpha} = \frac{\ln \frac{S_t}{K+\alpha}+(r+\frac{1}{2}\sigma^2)(T-t)}{\sigma\sqrt{T-t}}.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2017-03-01T21:21:59.243" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32770" PostTypeId="1" CreationDate="2017-03-01T23:00:51.573" Score="4" ViewCount="767" Body="&lt;p&gt;I've been really enjoying Ed Thorp's autobiography, and it makes me want to revisit some of his old Wilmott articles, listed here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.wilmottwiki.com/wiki/index.php?title=Thorp,_Edward&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.wilmottwiki.com/wiki/index.php?title=Thorp,_Edward&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wilmott columns &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;What I Knew and When I Knew It – Part 1, September 2002, pp. 44-45. Reprinted in Noesis, the Journal of the Mega Society, Issue #177, June 2005. &lt;/li&gt;&#xA;&lt;li&gt;What I Knew and When I Knew It – Part II, December 2002, pp. 44-45. Reprinted in Noesis, the Journal of the Mega Society &#xA;What I Knew and When I Knew It – Part II , January 2003, pp. 42-43. Reprinted in Noesis, the Journal of the Mega Society &lt;/li&gt;&#xA;&lt;li&gt;The Distribution of Stock Price Changes – Part I, March 2003, pp. 26-27. &lt;/li&gt;&#xA;&lt;li&gt;The Distribution of Stock Price Changes – Part II, May 2003, pp. 42-43. &lt;/li&gt;&#xA;&lt;li&gt;How Rich is Rich? – Part 1, July 2003, pp. 44-45. &lt;/li&gt;&#xA;&lt;li&gt;How Rich is Rich? – Part II, September 2003, pp. 32-33. &lt;/li&gt;&#xA;&lt;li&gt;A Million Dollars for Mathematics – Part I, November 2003, pp. 34-35. &lt;/li&gt;&#xA;&lt;li&gt;A Million Dollars for Mathematics – Part II, January 2004, pp. 38-40. &lt;/li&gt;&#xA;&lt;li&gt;A Million Dollars for Mathematics – Part III, March 2004, pp. 32-33. &lt;/li&gt;&#xA;&lt;li&gt;A Theory of Inefficient Markets – Part I, May 2004, pp. 38-40. &lt;/li&gt;&#xA;&lt;li&gt;A Theory of Inefficient Markets – Part II, July 2004, pp. 46-47. &lt;/li&gt;&#xA;&lt;li&gt;Statistical Arbitrage – Part I, August 2004, pp. 44-45. &lt;/li&gt;&#xA;&lt;li&gt;Statistical Arbitrage – Part II, November 2004, pp. 48-49. &lt;/li&gt;&#xA;&lt;li&gt;Statistical Arbitrage – Part III, January 2005, pp. 36-37 &lt;/li&gt;&#xA;&lt;li&gt;Statistical Arbitrage – Part IV, March 2005, pp. 66-67 &lt;/li&gt;&#xA;&lt;li&gt;Statistical Arbitrage – Part V, May 2005, pp. 46-47 &lt;/li&gt;&#xA;&lt;li&gt;Statistical Arbitrage – Part VI, July 2005, pp. 34-36 &lt;/li&gt;&#xA;&lt;li&gt;Inefficient Markets, September 2005, pp. 36-38 &lt;/li&gt;&#xA;&lt;li&gt;Bridge With Buffett. November 2005 &lt;/li&gt;&#xA;&lt;li&gt;Berkshire Hathaway. January 2006&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;A couple of the later ones are still available on the Wilmott website, and he has the one on start arb on his own website, but the rest are very hard to find can anyone point me to some online copies?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kind Regards&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Baz&lt;/p&gt;&#xA;" OwnerUserId="7077" LastEditorUserId="924" LastEditDate="2017-03-02T19:35:20.497" LastActivityDate="2017-03-02T19:35:20.497" Title="Ed Thorp Wilmott Articles" Tags="&lt;quant-trading-strategies&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32771" PostTypeId="2" ParentId="32766" CreationDate="2017-03-02T00:25:23.767" Score="1" Body="&lt;p&gt;MAD has been pegged to a basket of EUR and USD. Recently the weight of EUR in the basket has been decreased in favor of USD, and there is discussion of making the exchange rate float more freely still.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A regime change often involves a jump of the spot exchange rate simultaneously to a jump in the volatility.  There are some such models even with analytic tractability : see the Duffie, Pan, &amp;amp; Singleton SVJ-Y-V model [1] for instance.  Estimating or calibrating such a complicated model for MAD may be unrealistic however.  There are lots of parameters and not so much good data to estimate from.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A simpler model that might do well is the Merton jump diffusion [2].  That has only jumps in spot, not vol, but the impact of spot jumps is bigger on vanillas anyway.  And that model is only 4 parameters to estimate, something you might calibrate to some vanilla quotes maybe with a fixed guess for the jump arrival rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;[1] &#xA;&lt;a href=&quot;http://pages.stern.nyu.edu/~dbackus/Disasters/DuffiePanSingleton%20jumps%20Econometrica%2000.PDF&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://pages.stern.nyu.edu/~dbackus/Disasters/DuffiePanSingleton%20jumps%20Econometrica%2000.PDF&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[2] &lt;a href=&quot;http://www.qfrc.uts.edu.au/research/research_papers/rp287.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.qfrc.uts.edu.au/research/research_papers/rp287.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2017-03-02T00:25:23.767" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32773" PostTypeId="2" ParentId="32740" CreationDate="2017-03-02T01:34:52.880" Score="0" Body="&lt;p&gt;If the first statement is true then the second is also as you essentially just convert between the different compounding frequencies - i.e. from the one-period rate $R$ to the continuously compounded rate $r$. If the second result didn't hold then the up-probability&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;p = \frac{e^{r \Delta t} − d}{u − d}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;would not be in $[0,1]$.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2017-03-02T01:34:52.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32775" PostTypeId="2" ParentId="32723" CreationDate="2017-03-02T03:03:32.323" Score="1" Body="&lt;p&gt;You need a couple more assumptions and it becomes doable.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) no arbitrage&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) no interest rates or dividends&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(3) spot price moves continuously&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then there is a replication possible.  Buy the forward struck at $K$ expiring at the same time as the barrier option.  If the barrier is ever hit, the forward is at-the-money so has value zero.  In that case sell the forward and have zero value at expiry.  If the barrier is never hit, hold the forward until expiry, at which time it has value $S(T)-K$, the same as the barrier option.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In every case the replicating portfolio gives the same final value as the barrier option, so it must have the same initial value as well.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus the barrier option value is $S(0)-K $.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking back thru the argument,  we can actually weaken the assumptions slightly.  There can be an interest rate, IF it is exactly equal to the dividend rate.  Then the replication succeeds and the price is now $exp (-r T)(S (0)-K) $.  And jumps in the spot are allowable, IF it is guaranteed that a jump will not cross the barrier.  For instance, upward jumps would be fine.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2017-03-02T03:03:32.323" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32777" PostTypeId="2" ParentId="881" CreationDate="2017-03-02T06:51:05.577" Score="1" Body="&lt;p&gt;...starts thinking about sexual encounters in term of their Sharpe Ratios.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2018-03-20T20:59:27.403" LastActivityDate="2018-03-20T20:59:27.403" CommentCount="0" CommunityOwnedDate="2017-03-02T06:51:05.577" ContentLicense="CC BY-SA 3.0" />
  <row Id="32780" PostTypeId="2" ParentId="881" CreationDate="2017-03-02T09:11:18.210" Score="4" Body="&lt;p&gt;A Banker explains another banker why he is not getting married ...&#xA;&quot;She is hot, but not half my fortune hot&quot;.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2017-03-02T09:11:18.210" CommentCount="0" CommunityOwnedDate="2017-03-02T09:11:18.210" ContentLicense="CC BY-SA 3.0" />
  <row Id="32781" PostTypeId="1" AcceptedAnswerId="32782" CreationDate="2017-03-02T10:26:59.757" Score="5" ViewCount="2503" Body="&lt;p&gt;In &lt;em&gt;Options, Futures and Other Derivatives&lt;/em&gt; when Hull introduces the risk-neutral approach to pricing European options in the one-step binomial model, he claims that&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Riskless portfolio must, in the absence of arbitrage opportunities, earn the risk-free rate of interest.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;By riskless portfolio, he means a portfolio with totally predictable payoff. He then uses this argument to give the correct current price of the option which makes arbitrage impossible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I understand why the risk-neutral price of the call option is the only arbitrage-free price. If the call were overpriced an arbitrageur would long a replicating portfolio (which easily exists in this model by some elementary linear algebra) and short the call and if it were underpriced he or she would do the opposite. In fact this is just the simplest version of the universal principle that the arbitrage-free value of any replicable contingent claim is just the discounted expectation of its payoff under the risk neutral probability measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I just don't understand Hull's principle I quoted above. There should be an obvious arbitrage opportunity if the return on a riskless portfolio doesn't match the risk-free rate, but since I have very poor finance intuition (I'm from math background), I can't construct one by myself. Forgive my ignorance but I still hope someone can help, thanks.&lt;/p&gt;&#xA;" OwnerUserId="19004" LastActivityDate="2017-03-02T15:16:13.200" Title="Why must a riskless portfolio earn the risk-free rate?" Tags="&lt;arbitrage&gt;&lt;risk-neutral-measure&gt;&lt;valuation&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32782" PostTypeId="2" ParentId="32781" CreationDate="2017-03-02T10:31:29.093" Score="7" Body="&lt;p&gt;If you imagine you have two risk-less assets that have a unit payoff at maturity $V_1(T) = V_2(T) = 1$ but their present value is not equal, e.g. $V_1(t) &amp;lt; V_2(t)$. You buy the cheaper, sell the more expensive, have a strictly positive cash-flow today and at maturity the cash-flows cancel out with certainty. This is a free lunch arbitrage. The same argument is used in the Black-Scholes PDE derivation where you construct a locally risk-free portfolio.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="-1" LastEditDate="2017-03-02T15:16:13.200" LastActivityDate="2017-03-02T15:16:13.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32783" PostTypeId="1" CreationDate="2017-03-02T11:16:29.603" Score="2" ViewCount="257" Body="&lt;p&gt;Suppose:&#xA;$$d S=\mu S dt+\sigma Sd W$$&#xA;$Q(t,S)$ is the probability that $S$ hit the barrier $B(S_t&amp;lt;B)$ before $T,$ then $Q$ satisfies following &lt;code&gt;PDE&lt;/code&gt;&#xA;$$Q_t+\dfrac{1}{2}\sigma^2S^2_{SS}Q+\mu S Q_S=0.$$&#xA;Could I prove that this way&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Proof:&lt;/code&gt;&#xA;$$Q(t,S)=\mathbb{P}(\tau_B\leq T)$$&#xA;here $\tau_B$ is the &lt;code&gt;first passage time&lt;/code&gt; at level $B$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then use the &lt;code&gt;reflection principle&lt;/code&gt; for a Wiener process:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have&#xA;$$\mathbb{P}(\tau_B\leq T)=2\mathbb{P}(S_T&amp;gt;B)=2\int^{\infty}_Bp(t,S,T,y)d y$$&#xA;Here $p(t,S,T,y)$ is the &lt;code&gt;transition function&lt;/code&gt; of $S_T$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From &lt;code&gt;Kolmogorov backward equation&lt;/code&gt; we know&#xA;$$p_t+\dfrac{1}{2}\sigma^2S^2p_{SS}+\mu S p_S=0.$$&#xA;then take the derivatives into the integral, we done.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure is the whole process correct? And is there any standard way to calculate the such PDE of probability, since the default probability also meet this pde&lt;/p&gt;&#xA;" OwnerUserId="26165" LastEditorUserId="26595" LastEditDate="2017-05-04T14:12:50.350" LastActivityDate="2017-05-04T14:12:50.350" Title="The PDE of the probability hitting the barrier before T" Tags="&lt;black-scholes-pde&gt;&lt;exotics&gt;&lt;differential-equations&gt;&lt;barrier&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32786" PostTypeId="2" ParentId="32783" CreationDate="2017-03-02T13:27:03.437" Score="1" Body="&lt;p&gt;Reflection principal ? Reflection principle.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It holds for the Brownian process, not the GBM. [Reflection principle is quite specific to symmetric random walks].&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By chance, if $\mu-\frac{\sigma^2}{2}=0$ and $\sigma&amp;gt;0$, then you have : &#xA;$$\mathbb{P}(\tau^S_B&amp;lt;T)=\mathbb{P}(\tau^W_{\frac{1}{\sigma}\ln(B)}&amp;lt;T)$$ and you can apply reflection principle.&lt;/p&gt;&#xA;" OwnerUserId="20201" LastEditorUserId="16148" LastEditDate="2017-05-01T14:08:54.080" LastActivityDate="2017-05-01T14:08:54.080" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32787" PostTypeId="2" ParentId="32770" CreationDate="2017-03-02T17:10:29.763" Score="3" Body="&lt;p&gt;I too have been reading Ed's book. I bacame a big fan after reading his segment in Hedge Fund Market Wizards. He use to have these articles on his site, but i just checked back and they were removed but you can find some useful articles: &lt;a href=&quot;http://www.edwardothorp.com/articles/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.edwardothorp.com/articles/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13428" LastActivityDate="2017-03-02T17:10:29.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32788" PostTypeId="2" ParentId="32719" CreationDate="2017-03-02T18:54:10.273" Score="2" Body="&lt;p&gt;Tldr: Any broker can give you after-hours trading, but consolidated data probably works fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is actually something of a tricky question - it's often not clear when a data provider is using consolidated data, and what the actual &quot;closing price&quot; is tends to vary between exchanges, and it's also unlikely to matter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From an &lt;a href=&quot;https://www.sec.gov/answers/closepr.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;SEC webpage&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A number of markets offer after-hours trading trading and some financial publications and market data vendors use the last trade in these after-hours markets as the closing price for the day. Others use the 4:00 p.m. price as the closing price and display prices for after-hours trading separately.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;They go on to mention consolidated information:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;To avoid confusion, the central distributor of transaction prices for exchange-traded securities - the Consolidated Tape Association - implemented a system designed to make closing prices uniform. Under this system, the regular session closing price for stocks is the 4:00 p.m. price. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It's really up to you as to what you want your closing price to be, but the consolidated close price makes all close prices across every exchange &lt;strong&gt;comparable&lt;/strong&gt; which, often times, may be more important, and it's unlikely that any variance caused by after-hours trading will skew your trading significantly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The SEC also states that the NASDAQ close price uses similar rules to the consolidated tape close price, so it stands to reason that any close price from the NASDAQ is an &quot;accurate&quot; close price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the most important thing to do is to define &lt;em&gt;why&lt;/em&gt; you want unconsolidated tape data. I would be interesting in seeing specifically what Dr. Chan says about consolidated tape data, because it strikes me as odd - there are a million reasons I can think of to simply use the consolidated close price over trying to work out what the &quot;real&quot; close price is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this is not really a simple question, because the concept of a close price, if you reject the consolidated price, is highly malleable. Is it:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The last trade of the trading day (4pm)? &lt;/li&gt;&#xA;&lt;li&gt;The last trade of the calendar day (midnight)?&lt;/li&gt;&#xA;&lt;li&gt;The last trade processed in the market (because this may differ)?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I also performed a brief search of academic literature on this topic, and I didn't turn anything up on close price and the consolidated tape or close price in &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are still interested in getting all information on the close price, any data provider like &lt;a href=&quot;https://www.interactivebrokers.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;Interactive Brokers&lt;/a&gt; should be able to provide you with after-market data you can use to cherry-pick the closing price that works best for your analyses.&lt;/p&gt;&#xA;" OwnerUserId="19823" LastActivityDate="2017-03-02T18:54:10.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32789" PostTypeId="1" CreationDate="2017-03-02T22:41:24.797" Score="1" ViewCount="118" Body="&lt;p&gt;I know what given stocks $S_1, ..., S_N$ with SDE's, a portfolio must have a particular value dynamics shape (which depends on the dynamics of $S_1,...,S_N$), if that portfolio is to be self-financing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, does this have to hold under every probability measure? Usually we are given dynamics of stocks in P-world, but we also later study the martingale measure $Q$, and we know that the stocks have some known $Q$-dynamics as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, given a portfolio, do the same restrictions on its value dynamics apply in $Q$-world?&lt;/p&gt;&#xA;" OwnerUserId="26833" LastActivityDate="2017-03-03T08:37:17.520" Title="Self-financing portfolio under $Q$-dynamics" Tags="&lt;portfolio&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32790" PostTypeId="1" CreationDate="2017-03-02T23:17:55.987" Score="1" ViewCount="209" Body="&lt;p&gt;I have a cancellable swap to value, with the float leg payer being a clearing house.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The cancellable term sheet states the interest rate swap has a Bermudan style optionality for early termination but doesn't specify which party is long the option. Hence I cannot value this swap. The owner of this swap suggested that this is not relevant given it is a cleared swap - and i don't understand why.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the difference in valuation approach to a cleared and non-cleared cancellable swap?&lt;/p&gt;&#xA;" OwnerUserId="26834" LastActivityDate="2017-03-02T23:17:55.987" Title="Valuing cleared cancellable swap" Tags="&lt;derivatives&gt;&lt;interest-rate-swap&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32791" PostTypeId="1" AcceptedAnswerId="32930" CreationDate="2017-03-03T03:17:18.853" Score="0" ViewCount="348" Body="&lt;p&gt;I am trying to find a closed form solution to a stochastic integral -- which is really just a generalized expression for the expected net present value, $E^*[V_t]$, of an annuity (or perpetuity if $T \to \infty$), when cash flows are the result of some stochastic process. $V_t$ is defined by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) $$V_t =Max(L_t, \int_t^{T} (G_0e^{(m-d+W_t\sigma)t}-B_0e^{-d*t}-F)\frac{1}{e^{r*t}}dt)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$T$ is arbitrarily set to the value which maximizes expected value, $E^*[V_t]$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$0 \le t \le \infty$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$G_0$, $B_0$, and $F$ are constants $\gt 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$L_t$ is some arbitrary value representing the liquidation value of $V_t$; assume it's $0$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$m$ and $d$ are constant rates $\gt 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma^2$ is variance&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$W_t$ is Brownian Motion such that $\frac{dG}{G} = (\mu - d)dt + \sigma dW_t$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$G_t = G_0*e^{((\mu-\frac{\sigma^2}{2})-d)t+\sigma W_t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;subject to the boundary conditions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(condition i) $-\infty \ge T \ge 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(condition ii) $\frac{dV}{dt} \to G_t$ as $G_t \to \infty$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(condition iii) $\frac{dV}{dt} \to 0$ as $G \to 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(condition iv) $\frac{dV}{dt} \to 0$ as $t \to \infty$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(condition v) $V_t \ge 0$ for all $t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As $t \to \infty$, $E^*[\frac{dV}{dt}] \to -F*e^{-r*t} \to 0$. So I am fairly confident that the integral will converge and that a finite $T$ will satisfy the constraint. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am also assuming that $G_t$ can be delta-hedged -- I am treating $\frac{dG_t}{dt}$ as a martingale with $\mu = 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to evaluate this problem with standard option pricing models, but they all assume that pay-offs are a one-time deal -- even perpetual American options are built on the assumption of a single period pay-off. The assumption that pay-offs accrue continuously results in risk-neutral probabilities (vis-a-vis $N(d_1)$ and $N(d_2)$ in common derivations of Black-Scholes) which instantaneously change as a function of $dt$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems fairly straightforward to solve this problem using discrete, iterative methods (i.e., binomial trees, Monte Carlo simulations, etc) which discretize risk-neutral probabilities. However, I am not able to use any of those methods in the current setting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I missing? Your help is much appreciated. Let me know if you'd like to get more background on what equation (1) is attempting to model.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2017-03-08T05:49:37.290" LastActivityDate="2017-03-13T16:29:25.453" Title="Net present value when cash flows accrue continuously and are stochastic" Tags="&lt;options&gt;&lt;stochastic-processes&gt;&lt;valuation&gt;&lt;discounting&gt;&lt;dcf&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32793" PostTypeId="1" CreationDate="2017-03-03T05:19:14.453" Score="1" ViewCount="113" Body="&lt;p&gt;Suppose I have weights&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; 6.250000e-02  1.250000e-01  1.250000e-01 -9.375000e-02&#xA;-6.250000e-02 -1.250000e-01  1.562500e-01  9.375000e-02&#xA; 1.562500e-01  3.125000e-01  3.125000e-01 -3.125000e-02&#xA;-5.421011e-18 -6.250000e-02 -9.375000e-02  1.250000e-01&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now the sum of all these weights is &lt;code&gt;1&lt;/code&gt;, but I want to add a constraint that the minimum weight should be &lt;code&gt;0.02&lt;/code&gt; and max &lt;code&gt;0.20&lt;/code&gt; and also the sum should be one&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone help?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I code in R and have got the weights by making a portfolio optimization without using &lt;code&gt;fportfolio&lt;/code&gt; or &lt;code&gt;portfolioAnalytics&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="26837" LastEditorUserId="18030" LastEditDate="2017-03-03T20:55:32.177" LastActivityDate="2017-03-03T20:55:32.177" Title="Assigning Constraints to weights" Tags="&lt;portfolio&gt;&lt;portfolio-optimization&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32794" PostTypeId="2" ParentId="3040" CreationDate="2017-03-03T06:32:03.123" Score="0" Body="&lt;p&gt;This is an old question but considering there isn't an accepted answer, I suggest you have a look at &lt;a href=&quot;https://www.diversifyportfolio.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;DiversifyPortfolio&lt;/a&gt;. They provide various tools and visualizations related to correlation and stock portfolio diversification.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They also provide a portfolio allocation tool which takes position sizes and portfolio position correlations into account when determining optimal position sizes.&lt;/p&gt;&#xA;" OwnerUserId="16304" LastActivityDate="2017-03-03T06:32:03.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32795" PostTypeId="2" ParentId="32789" CreationDate="2017-03-03T08:37:17.520" Score="3" Body="&lt;p&gt;Infinitesimally, a self-financing portfolio is a portfolio &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ V_t = \sum_{i=1}^N \phi_i(t) S_{t,i} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;whose value changes only because the values of the assets in which it invests change (no in/out exogenous cash flows, hence its name), i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dV_t = \sum_{i=1}^N \phi_i(t) dS_{t,i} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whether these price changes $dS_{t,i}$ are described under this or that probability measures does not matter.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2017-03-03T08:37:17.520" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32796" PostTypeId="1" CreationDate="2017-03-03T12:11:25.913" Score="2" ViewCount="2506" Body="&lt;p&gt;Please help me find the fault in my reasoning!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems to me that when a bond is trading special , it is in short supply and high demand , and so excessive number of people are borrowing money to buy it , and so these people would be willing to pay a HIGH interest rate (= repo rate) in order to get it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But , the reasoning somehow should be that the repo goes DOWN when bond is special. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please in your answer actually refute my above reasoning and also please explain without using unclear jargon.&lt;/p&gt;&#xA;" OwnerUserId="17348" LastEditorUserId="17348" LastEditDate="2017-03-03T18:07:36.190" LastActivityDate="2018-11-14T08:13:12.283" Title="Why repo goes negative for bonds trading special" Tags="&lt;bond&gt;&lt;bond-futures&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32797" PostTypeId="1" CreationDate="2017-03-03T12:48:58.943" Score="2" ViewCount="121" Body="&lt;p&gt;Is there any resource containing the &lt;strong&gt;tick increment values&lt;/strong&gt; of &lt;code&gt;NASDAQ/NYSE&lt;/code&gt; equities (&lt;code&gt;.0001&lt;/code&gt;, &lt;code&gt;.01&lt;/code&gt;, &lt;code&gt;.05&lt;/code&gt;), or way to programmatically determine it (rule or formula) ?&lt;/p&gt;&#xA;" OwnerUserId="26550" LastActivityDate="2017-04-20T22:59:28.440" Title="Find the tick increment value of an equity" Tags="&lt;equities&gt;&lt;tick-data&gt;&lt;nasdaq&gt;&lt;nyse&gt;&lt;tick&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32798" PostTypeId="2" ParentId="32797" CreationDate="2017-03-03T13:11:48.213" Score="1" Body="&lt;p&gt;From a feed perspective, you can take a look at the feed spec, it should be mentioned among descriptions of the data types e.g. fixed point integer with 4 implied decimal places and be applied across all symbols. This should be universal so you could hardcode it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thereafter, you can look up the MPV in the rule books - see this answer: &lt;a href=&quot;https://quant.stackexchange.com/a/32383/4660&quot;&gt;https://quant.stackexchange.com/a/32383/4660&lt;/a&gt; This would again be hardcoded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, you would want to adjust this for the tick pilot: here's the lists for &lt;a href=&quot;ftp://ftp.nyxdata.com/Tick_Pilot/Tick_Pilot_Historical/&quot; rel=&quot;nofollow noreferrer&quot;&gt;NYSE&lt;/a&gt; and &lt;a href=&quot;ftp://ftp.nasdaqtrader.com/files/ticksizepilot/Historicalfiles/&quot; rel=&quot;nofollow noreferrer&quot;&gt;NASDAQ&lt;/a&gt;. This is the part where you would parse and programmatically determine the tick sizes.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2017-03-03T13:11:48.213" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32799" PostTypeId="2" ParentId="32796" CreationDate="2017-03-03T13:12:17.780" Score="2" Body="&lt;p&gt;In repo/securities lending one person lends money (cash) and the other person lends securities. It is easier to understand if you think of the cash lender, who requires compensation for supplying the liquid asset (cash). If the cash lender supplies cash and receives ordinary (&quot;general&quot;) collateral he receives one interest rate (usually clse to the FF rate), but if he insists on receiving a specific collateral which is scarce in the market (&quot;special collateral&quot;) then he must accept a LOWER interest rate for lending his cash. At some point the &quot;rebate rate&quot; may even go negative, meaning the cash lender is actually paying interest to borrow the securities.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2017-03-03T13:12:17.780" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="32800" PostTypeId="1" AcceptedAnswerId="32807" CreationDate="2017-03-03T13:18:17.630" Score="2" ViewCount="7716" Body="&lt;p&gt;I was reading this article on Tenor basis spreads(&lt;a href=&quot;http://www.garp.org/media/1160302/052913_tenorbasisspread.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.garp.org/media/1160302/052913_tenorbasisspread.pdf&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/NKVqY.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/NKVqY.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is the tenor basis spread for NUSD for 1mv3m negative and NUSD for 3Mv6m positive? How do u know it will be positive and when it will be negative?&lt;/p&gt;&#xA;" OwnerUserId="5839" LastActivityDate="2017-03-05T14:09:27.810" Title="Tenor basis spreads 1mv3m vs 3mv6m" Tags="&lt;basis&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32801" PostTypeId="1" AcceptedAnswerId="32802" CreationDate="2017-03-03T13:41:44.290" Score="2" ViewCount="116" Body="&lt;p&gt;See this question for context:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/32725/dynamic-hedge-of-quanto-options#_=_&quot;&gt;https://quant.stackexchange.com/questions/32725/dynamic-hedge-of-quanto-options#&lt;em&gt;=&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In there, I expressed interest in how well the &lt;em&gt;usual&lt;/em&gt; strategy of replicating an underlying stock would work in this case. This strategy would consist of investing Delta (derivative of the option's price wrt stock price) in the foreign stock, and borrowing domestically. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there some market conditions under which that strategy actually would work? An idea of one such condition could be that the exchange rate remains constant over the relevant period?&lt;/p&gt;&#xA;" OwnerUserId="26148" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2017-03-03T16:29:09.650" Title="How bad off are we when we use the &quot;regular delta replication&quot; strategy in an FX market on a Quanto?" Tags="&lt;replication&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32802" PostTypeId="2" ParentId="32801" CreationDate="2017-03-03T15:14:29.373" Score="1" Body="&lt;p&gt;You can borrow domestically. However, we note the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;You can not use your domestic cash to buy foreign stock directly, instead, you also need a foreign cash account. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Moreover, for the replicating portfolio to be self-financing, the capital gain from the foreign stock and the cash account need to properly adjusted, that is, the foreign cash account is necessary.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;Since you are replicating a domestic payoff, all the foreign asset values need to be converted to domestic currency.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In summary, you need instruments $XS$, $XB^f$, and $B^d$. By missing any of them, you won't be able to have a self-financing replicating portfolio.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-03-03T16:29:09.650" LastActivityDate="2017-03-03T16:29:09.650" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32804" PostTypeId="1" AcceptedAnswerId="32806" CreationDate="2017-03-03T18:56:58.363" Score="5" ViewCount="438" Body="&lt;p&gt;From a philosophical standpoint, I'm trying to figure out where the intrinsic value of stock derives from, in the case of a stock that doesn't pay out dividends. That is, what is the value just in owning a stock, ignoring trading it on the market? There must be some reason, otherwise non-dividend stocks would be worthless, but I can't quite get to the bottom of this.&lt;/p&gt;&#xA;" OwnerUserId="13959" LastActivityDate="2018-01-31T06:00:05.840" Title="What is the intrinsic value of a stock that doesn't give dividends?" Tags="&lt;equities&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32805" PostTypeId="2" ParentId="32804" CreationDate="2017-03-03T20:45:17.977" Score="5" Body="&lt;p&gt;The intrinsic value of a stock is derived from a combination of&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;assets on the balance sheet and&lt;/li&gt;&#xA;&lt;li&gt;the promise of continued earnings.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Think of a company that has no debt, \$1,000,000 in the bank, and 5000 shares outstanding. Each share has an intrinsic value of \$200 (=\$1M / 5000). (That's if it earns nothing.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the company generates a revenue stream, then retained earnings will show up in the balance sheet. Lets say that in the above case, the company earns 10% on its assets. That \$100,000 will eventually end up on the asset side of the balance sheet. The intrinsic value of each share would go up to $220.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course steady or increasing earnings are exciting to both researchers and investors, regardless of whether dividends are paid. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To take an example, &lt;a href=&quot;http://usatoday30.usatoday.com/money/perfi/stocks/story/2012-03-19/apple-shares-dividend-payment/53654136/1&quot; rel=&quot;noreferrer&quot;&gt;Apple stock&lt;/a&gt; did not pay a dividend before 2012. Was it intrinsically worthless before then? No, of course not. They plowed their profits back into R&amp;amp;D, marketing, and increasing market share. The earnings helped propel the stock higher (much higher than the intrinsic value). For Apple, the promise of continued earnings loomed large. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The classic reference in this arena is &lt;a href=&quot;https://en.wikipedia.org/wiki/The_Intelligent_Investor&quot; rel=&quot;noreferrer&quot;&gt;The Intelligent Investor&lt;/a&gt;, by Benjamin Graham. The author draws the connection between tangible bond interest and less-tangible company earnings. &lt;/p&gt;&#xA;" OwnerUserId="343" LastActivityDate="2017-03-03T20:45:17.977" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="32806" PostTypeId="2" ParentId="32804" CreationDate="2017-03-03T23:07:41.903" Score="6" Body="&lt;p&gt;In order to simplify my answer, &quot;stock&quot; refers specifically to common equity. Publicly traded shares which are not common equity entitle their owners to fundamentally different economic interests. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equity values are based on economic and voting interests in a firm. These rights and interests can vary significantly among publicly traded stocks. In general, common equity is senior claim on ownership and a junior claim on cash flows and assets. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ownership rights entitle stock holders to vote in corporate actions, annually vote on board members, and bring issues to the board of directors. Traditionally, board of directors are beholden to maximize the value of common shareholders over all other stakeholders, including employees, bondholders, and the general public (although exceptions to this rule are frequent). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Common stock provides the junior-most claim on assets and cash-flows. The claim on assets is relevant in bankruptcy or liquidation during which all senior claims must be paid before stock-holders; stock-holders, however, are entitled to the leftovers (which in a liquidation event usually is not a lot). This contingent claim on assets is represented on the balance sheet as book value; i.e., assets less liabilities. Accounting book value, however, is not necessarily a good estimate of intrinsic and/or market value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet, this results in a chicken and egg predicament. If assets are simply worth the discounted sum of future cash flows, then it stands to reason that stocks are also worth the discounted sum of future cash flows in excess of senior liabilities (or what someone else would pay for them). Thus, the importance of earnings in assessing fair value.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Common stock's junior entitlement to cash flows is realized through either dividends and/or capital appreciation. For example, dividends are the most discretionary business expense; as such, they are paid after all other senior and operating liabilities. Because senior liabilities tend to be relatively fixed, equity-holders are entitled to theoretically unlimited upside if/when the business &quot;strikes gold&quot;. However, when a business is not able to meet senior obligations, dividends are the first expense to be cut.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dividends are not the only way a business can return capital to shareholders. A business can also grow the value of its equity by compounding capital gains (increasing market and/or book value) and returning capital to shareholders through buybacks. According to time value of money concept, investors should be indifferent to receiving the present value of a sum now or the future value at some time in the future. In other words, (assuming no taxes, no slippage, and no fees), a rational investor is indifferent receiving a \$1 dividend and selling his/her stock for a \$1 capital gain within the same holding period. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The time value of money also suggest another important intuition: if a business can compound equity capital more efficiently and at a higher rate than shareholders, investors should prefer that management reinvests earnings rather than pay out dividends. Sic, dividends tend to the least tax efficient way of returning capital shareholders. If/when management believes that it cannot achieve attractive marginal returns on marginal capital invested, only then should it consider paying dividends.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Earnings and expected future earnings, in turn, are the most common proxy for gauging a company's ability to pay dividends and/or compound capital gains.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, stock that does not pay a dividend may still have intrinsic value due to its ability: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;pay dividends and/or finance returns of capital in the future,&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;result in capital appreciation through the accrual of earnings (which over time should result in an increase of the market value of book value); and&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;sell itself and/or liquidate.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Anyway, that's my take on the philosophical utility of owning shares of common equity. I hope that's useful....&lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2018-01-31T06:00:05.840" LastActivityDate="2018-01-31T06:00:05.840" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="32807" PostTypeId="2" ParentId="32800" CreationDate="2017-03-04T00:08:07.773" Score="2" Body="&lt;p&gt;In the presented method we have one main tenor, which is 3M in the case of USD. The Adjustment is negative if we want to adjust a tenor shorter than 3M e.g. 1M. It is positive for greater tenors like 6M or 1Y.&lt;/p&gt;&#xA;" OwnerUserId="22686" LastActivityDate="2017-03-04T00:08:07.773" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="32808" PostTypeId="2" ParentId="32796" CreationDate="2017-03-04T07:57:43.373" Score="2" Body="&lt;p&gt;Treasury bonds go &quot;special&quot; when many participants want to short them (playing for s higher yield).  The person who shorts the bond needs to deliver it to the counterparty, so must borrow that exact bond (versus investing cash) in the repo market.  If lots of people want to do that , the repo rate goes down. &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-03-04T07:57:43.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32811" PostTypeId="1" CreationDate="2017-03-04T11:23:50.813" Score="1" ViewCount="56" Body="&lt;p&gt;A lot of large firms are predicting that the 10 year treasury yield is going to rise. My question is that if such prediction has any substance, shouldn't the current 10 year yield rise accordingly, as people anticipate the higher rates? Shouldn't the current 10 year yield the best prediction of its future value?&lt;/p&gt;&#xA;" OwnerUserId="19437" LastActivityDate="2017-03-04T15:51:20.143" Title="Why 10 year treasury yield expectation note priced in bond prices?" Tags="&lt;yield-curve&gt;&lt;bond-yields&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32812" PostTypeId="2" ParentId="29977" CreationDate="2017-03-04T11:41:35.053" Score="0" Body="&lt;p&gt;I think if $X(T)=V(T)$ but $X(t) \ne V(t)$, you would have found an arbitrage. Congrats to be on the way of riches. &lt;/p&gt;&#xA;" OwnerUserId="19437" LastActivityDate="2017-03-04T11:41:35.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32813" PostTypeId="2" ParentId="32811" CreationDate="2017-03-04T15:51:20.143" Score="1" Body="&lt;p&gt;Loosely speaking, we use forward yields, not spot yields, to identify the market's estimate of yields in the future.  Right now, the forward yields are higher than the spot yields, because the yield curve is upward sloping.  So the market is not necessarily inconsistent with the analysts' predictions.   &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-03-04T15:51:20.143" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32814" PostTypeId="1" AcceptedAnswerId="32822" CreationDate="2017-03-04T16:10:14.183" Score="6" ViewCount="1481" Body="&lt;p&gt;So I'm reading through Dynamic Hedging to start trying to learn option theory better. I hit Chapter 8 on Delta and am completely lost on a certain example he gives.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The example is from Page 119 and is labeled &quot;A Misleading Delta&quot; - He posits the following scenario - &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A trader has the following position, yield curve is flat and forward is same as spot. European options with one month maturity:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long 1M 96x calls delta of 82.4&lt;br&gt;&#xA;Short 1M 104x calls delta of 19.8&lt;br&gt;&#xA;Net delta is 62.6  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taleb says that the trader &quot;could hedge it by selling $626,000 of forward&quot; which makes it unclear whether or not this is included in the position (though it makes even less sense if it isn't included).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;He then posts a table which shows a flat delta and P&amp;amp;L at 100 (so assuming position was put on at 100 and delta hedged). However, it also shows the delta increasing for price movements in either direction. A graph is also shown that shows the position as hedged to some extent around 100 (the origin) i.e. flat P&amp;amp;L, with positive P&amp;amp;L accruing with higher prices and losses at lower prices. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How is this possible? My limited understanding suggests that this would result in the opposite exposure - decreasing P&amp;amp;L to the upside and gains to the downside as the delta of the net option position would be near or at its max at 100 and decreasing in either direction. So due to the forward hedge, you'd have a net short position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, from what I can tell the data output provided in the book shows the opposite position:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;long 104 put&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;short 96 put&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;long ~$626,000 fwd. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Can anyone help me understand what I'm missing?&lt;/p&gt;&#xA;" OwnerUserId="11806" LastEditorUserId="31748" LastEditDate="2020-05-20T23:48:13.977" LastActivityDate="2020-05-20T23:48:13.977" Title="Question on an example from &quot;Dynamic Hedging&quot; by Nassim Taleb" Tags="&lt;option-pricing&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="32815" PostTypeId="1" CreationDate="2017-03-04T19:48:55.153" Score="2" ViewCount="1820" Body="&lt;p&gt;I would like to conduct a variance ratio test for a financial time series in order to examine whether I can apply the square root rule for the variance with the software R.&#xA;I used the Automatic Variance Ratio Test &lt;code&gt;vrtest::Auto.Vr&lt;/code&gt; and got a statistic of &lt;code&gt;-0.01&lt;/code&gt;. Now I am wondering, is that the z-score, which is distributed standard normal under the Null hypothesis, that this ratio is &lt;code&gt;1&lt;/code&gt; (or equivalent that there is no autocorrelation)? It is not specified in the describtion, I just found this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Usage:&#xA;Auto.VR(y)&#xA;Arguments:&#xA;y financial return time series&#xA;Value:&#xA;stat Automatic variance ratio test statistic&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="26565" LastEditorUserId="848" LastEditDate="2017-03-05T16:09:01.533" LastActivityDate="2017-03-05T16:09:01.533" Title="Variance Ratio Test in R" Tags="&lt;programming&gt;&lt;variance&gt;&lt;auto-correlation&gt;&lt;ratio&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32816" PostTypeId="2" ParentId="32815" CreationDate="2017-03-04T20:45:45.803" Score="3" Body="&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;: the test statistic's distribution is $N(0,1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;A bit more information about the Automatic Variance Ratio Test:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$H_0$: ${\Delta}r_t$ is serially &lt;strong&gt;un&lt;/strong&gt;correlated (where ${\Delta}r_t=r_t-r_{t-1}$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$H_1$: ${\Delta}r_t$ &lt;strong&gt;is&lt;/strong&gt; serially correlated&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The test statistic is $VR=\sqrt{T/l}[\hat{VR}(l)-1]/\sqrt{2} \quad {\xrightarrow{d}} \quad N(0,1)$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The $d$ over the arrow is important, i.e. the $VR$ &lt;em&gt;converges&lt;/em&gt; in distribution to standard normal (hence $d$ does not imply the convergence in mean square or convergence in probability) as $T$, $l$ and $T/l$ approach infinity.&#xA;The $l$ is the lag truncation point. The paper has detail on formulae for both $VR$ and $l$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Final note: the test is two sided.&lt;/p&gt;&#xA;" OwnerUserId="18030" LastEditorUserId="18030" LastEditDate="2017-03-05T12:14:02.100" LastActivityDate="2017-03-05T12:14:02.100" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32817" PostTypeId="1" CreationDate="2017-03-04T21:19:02.983" Score="1" ViewCount="41" Body="&lt;p&gt;I was reading an article today and I came across a new expression: &quot;normalized 15-min absolute returns&quot;. I know what returns mean but I don't have any idea how I can normalize them ( I am not sure if they are talking here about the statistical normalization or not !!).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thank you guys ^^.&lt;/p&gt;&#xA;" OwnerUserId="25163" LastActivityDate="2017-03-04T21:19:02.983" Title="normalized 15-min absolute returns" Tags="&lt;return&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32818" PostTypeId="1" CreationDate="2017-03-04T21:33:08.373" Score="0" ViewCount="423" Body="&lt;p&gt;I've been trying to calculate returns for different stocks but using Yahoo Fiance Historical price data seems to be weird. For instance, looking up the March 5th 2012 Price for &lt;a href=&quot;https://finance.yahoo.com/quote/AAPL/history?period1=1330923600&amp;amp;period2=1330923600&amp;amp;interval=1d&amp;amp;filter=history&amp;amp;frequency=1d&quot; rel=&quot;nofollow noreferrer&quot;&gt;APPL on the online interface&lt;/a&gt; gives:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Open    High    Low     Close   Adj Close&#xA;77.92   78.21   75.14   533.16  76.17&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This in itself doesn't make sense, why is the close so much higher than the high/low?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To add to my confusion if I download the csv it gives different numbers entirely (except for the close):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Open    High    Low     Close   Adj Close&#xA;545.42  547.48  526.00  533.16  69.08&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Am I doing something wrong and if not where can I get somewhat accurate financial data?&lt;/p&gt;&#xA;" OwnerUserId="26855" LastActivityDate="2017-03-06T21:22:42.963" Title="How can I get reliable Yahoo Finance stock information?" Tags="&lt;equities&gt;&lt;data&gt;&lt;yahoofinance&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2017-05-08T12:33:50.837" ContentLicense="CC BY-SA 3.0" />
  <row Id="32819" PostTypeId="2" ParentId="32818" CreationDate="2017-03-04T21:44:21.930" Score="1" Body="&lt;p&gt;You really care about the adjusted close. The difference you're seeing is caused by the stocks split, see e.g.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Dl2DA.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Dl2DA.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18030" LastActivityDate="2017-03-04T21:44:21.930" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32820" PostTypeId="1" CreationDate="2017-03-05T05:51:56.500" Score="2" ViewCount="462" Body="&lt;p&gt;I know that an American call option on a non-dividend paying stock is never optimal to early exercise, but I wonder why would an American option ever even be optimal to early exercise?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My rationale is as below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given an option with an intrinsic value of $S-K$, the decision is one choosing between early exercising and selling the option in the market. The value of the option should always be greater than the intrinsic value, or else, one can always buy the option and exercise it to make an immediate profit. It would always be better to sell the option instead of exercising it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Appreciate if anyone could point out the mistakes in my argument.&lt;/p&gt;&#xA;" OwnerUserId="26415" LastEditorUserId="24222" LastEditDate="2017-03-05T12:47:12.200" LastActivityDate="2017-03-05T16:45:15.070" Title="Would a cash-settled American Option ever be optimal to early exercised?" Tags="&lt;options&gt;&lt;american-options&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32821" PostTypeId="2" ParentId="31766" CreationDate="2017-03-05T07:48:02.513" Score="1" Body="&lt;p&gt;I believe the confusion is due to indexes. $D(t_{j+1})$ is $\mathcal{F}(t_j)$ measurable, so it is known on the left-hand endpoint. If you substitute the formula (6.2.2) for $D(t_{j+1})$: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$D(t_{j+1}) = \frac{1}{(1+R(t_0))(1+R(t_1)+ \cdots + (1+R(t_j))}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you will recognize an Ito integral: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\dfrac{1}{D(t)}E\Big[\sum\limits_{j=k}^{n-1}\frac{1}{(1+R(t_0))+ \cdots + (1+R(t_j))}(\textrm{Fut}_S(t_{j+1},T)-\textrm{Fut}_S(t_j,T))\Big|\mathcal{F}(t)\Big]$$&lt;/p&gt;&#xA;" OwnerUserId="15154" LastActivityDate="2017-03-05T07:48:02.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32822" PostTypeId="2" ParentId="32814" CreationDate="2017-03-05T08:21:08.550" Score="6" Body="&lt;p&gt;Taleb's explanations are correct, ONLY if you replace &quot;short&quot; with &quot;long&quot;, &quot;sell&quot; with &quot;buy&quot; and vice versa in the text on page 119. In this case the narrative will correspond to pictures and Taleb's explanations will be reasonable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the position is actually short 96 calls, long 104 calls, total continuous delta is short.  Then &quot;could hedge&quot; means that the position is hedged by &quot;buying&quot; (not selling as in the text) forwards. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should think of &quot;delta&quot; as an equivalent position in the underlying security. So when the underlying price is 100, your equivalent position is 0. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When price goes down to 98, long 104 calls and long forwards are loosing value faster than short 96 calls are gaining it, so you are incurring some loss (-2). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, due to non-convexity, your position is no more delta-neutral, but equivalent of 39 in underlying, i.e. long position. You may expect that you will now be losing value faster if the price continues to go down. In fact, this is confirmed by the data in the table: price 97 your loss is -9 etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similar logic works if the price goes up from 100. Long calls and long forwards will be gaining value faster than short calls are losing it etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is obviously a typo because already on the next page Taleb is saying &quot;The trader in the example buys \$550,000 cash instead of \$626,000&quot;&lt;/p&gt;&#xA;" OwnerUserId="15154" LastEditorUserId="15154" LastEditDate="2017-03-06T15:19:04.253" LastActivityDate="2017-03-06T15:19:04.253" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="32823" PostTypeId="2" ParentId="32820" CreationDate="2017-03-05T08:50:20.163" Score="3" Body="&lt;p&gt;if it's at a point of optimal exercise its value is the exercise value so your statement that the value is more than the intrinsic is wrong.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2017-03-05T08:50:20.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32826" PostTypeId="1" CreationDate="2017-03-05T12:00:11.080" Score="1" ViewCount="31" Body="&lt;p&gt;&lt;a href=&quot;http://www.darrellduffie.com/uploads/pubs/DuffieKan1996.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.darrellduffie.com/uploads/pubs/DuffieKan1996.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was trying to read above paper on the topic of multi-factor affine models, but I presume the contents have been dealt with more thoroughly in perhaps a textbook aimed at a broader audience. Does anybody know of such a reference?&lt;/p&gt;&#xA;" OwnerUserId="26864" LastActivityDate="2017-03-05T12:00:11.080" Title="Multi-factor affine yield models reference (a la Duffie and Kan)" Tags="&lt;yield-curve&gt;&lt;reference-request&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32827" PostTypeId="1" AcceptedAnswerId="32829" CreationDate="2017-03-05T13:15:10.620" Score="2" ViewCount="266" Body="&lt;p&gt;In one of my lecture notes, I stumble across this exercise question:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Consider Low Exercise Price Options, LEPOs, (with dividends) in&#xA;  Australia. Using the value at the outset, explain why such&#xA;  options are sometimes priced above $S_0$.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I am confused how to continue to answer the above question.&#xA;Is the following is the statement we are trying to show?$$(S_0 - D)e^{rt}&amp;gt;&amp;gt;S_0$$&#xA;If yes, how do I show such statement holds? In case of $D=0$ it is obvious that the above holds, but how to prove such statement for some $D&amp;gt;0$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On a side note, I am also confused with this question, isn't it violating the upper bound of call options, i.e. $c_t \leq S_t$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you, any help is highly appreciated&lt;/p&gt;&#xA;" OwnerUserId="26863" LastEditorUserId="26863" LastEditDate="2017-03-05T17:06:16.137" LastActivityDate="2017-03-05T17:06:16.137" Title="Fair value for a LEPO (Low Exercise Price Options)" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;call&gt;&lt;european-options&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32829" PostTypeId="2" ParentId="32827" CreationDate="2017-03-05T13:58:10.657" Score="1" Body="&lt;p&gt;From&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\left( S_0 - D \right) e^{r T} &amp;gt; S_0,&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you see that this is true when&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;r &amp;gt; \frac{1}{T} \ln \left( \frac{S_0}{S_0 - D} \right),&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i.e. when the interest rate is sufficiently large relative to the present value of future dividends.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you replicate the LEPO, and ignoring that $X$ is not actually equal to 0, you buy one stock initially. The cost of financing this position until maturity is $S_0 \left( e^{r T} - 1 \right)$ and the returns for holding it is $D e^{r T}$. When the former is higher than the latter, then the overall cost of replication are positive and the initial price of the LEPO is above $S_0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having the LEPO priced above $S_0$ is &lt;em&gt;not&lt;/em&gt; a contradiction to the no-arbitrage bounds of a call option $C_0 &amp;lt; S_0$. The latter applies to call options where the premium is paid upfront i.e. at $t = 0$. In case of the LEPO (ignoring margining) the premium is settled forward-style at the maturity date $t = T$.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-03-05T14:10:46.537" LastActivityDate="2017-03-05T14:10:46.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32830" PostTypeId="2" ParentId="32800" CreationDate="2017-03-05T14:09:27.810" Score="2" Body="&lt;p&gt;I would explain it slightly differently.  The data shown indicates the market price of basis swaps.  The spreads shown are to be added to the 3 mo libor leg of the basis swap. For example , the 5yr basis swap price is 3m libor minus 13bp versus 1m libor , and also 3m libor plus 14bp versus 6m libor.   The spread is usually negative if you are swapping to a shorter rate, and positive if you are swapping to a longer rate. That's because the rate for a 3 month loan is usually higher than a chain of 1 month loans, and the rate for a 6 month loan is usually higher than two 3 month loans made consecutively.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-03-05T14:09:27.810" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32831" PostTypeId="1" AcceptedAnswerId="34918" CreationDate="2017-03-05T15:59:11.577" Score="4" ViewCount="630" Body="&lt;p&gt;Suppose an option is defined as follows. There is an upper barrier at&#xA;$H$ and a lower barrier at $0$. If the stock price touches the upper barrier&#xA;you get a payoff of $1$ and the trade terminates immediately. Likewise if the&#xA;stock price touches the lower barrier, you get a payoff of $0$ and the trade&#xA;terminates. What is the price of the option? (Assume zero interest rates and the usual Geometric Brownian motion for the underlying)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure how this option should be dealt with, any solution to this problem is greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="11960" LastEditorUserId="20454" LastEditDate="2017-06-29T14:25:31.123" LastActivityDate="2017-07-09T19:17:57.770" Title="Price of a double barrier option" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;barrier&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32832" PostTypeId="2" ParentId="32820" CreationDate="2017-03-05T16:45:15.070" Score="0" Body="&lt;p&gt;If the underlying is a dividend paying stock, your early-ex decision should be identical to physical, as you can buy the stock in the open market and collect the dividend.&#xA; Also, your statement that an American call on zero div stock should never be early exercised is wrong. If the stock borrow net of interest on cash is higher then your residual optionality, that would be one exception.&lt;/p&gt;&#xA;" OwnerUserId="26574" LastActivityDate="2017-03-05T16:45:15.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32833" PostTypeId="1" CreationDate="2017-03-05T17:21:17.987" Score="1" ViewCount="41" Body="&lt;p&gt;i'm trying to do some tests on exchange market pressure of morocco &#xA;Where can i find data on morocco exchange reserves&#xA; thanks &lt;/p&gt;&#xA;" OwnerUserId="26814" LastActivityDate="2017-03-05T18:38:07.843" Title="Data on morocco exchange reserves" Tags="&lt;options&gt;&lt;time-series&gt;&lt;data&gt;&lt;fx&gt;&lt;exchange&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32834" PostTypeId="2" ParentId="32833" CreationDate="2017-03-05T18:38:07.843" Score="2" Body="&lt;p&gt;Morocco central bank should have an estimation of their reserves. &lt;a href=&quot;http://www.bkam.ma/Publications-statistiques-et-recherche/Documents-d-information-et-de-statistiques/Statistiques-monetaires&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.bkam.ma/Publications-statistiques-et-recherche/Documents-d-information-et-de-statistiques/Statistiques-monetaires&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7693" LastActivityDate="2017-03-05T18:38:07.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32837" PostTypeId="1" CreationDate="2017-03-06T00:43:31.370" Score="2" ViewCount="129" Body="&lt;p&gt;I am reading Bjork. In it, he says that the martingale measure $Q$ is characterized by the property that all stocks have the short rate as their local rate of return under the $Q$-dynamics. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it just stocks, or really all assets that we could imagine pricing in this market?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally speaking, say I price an asset with $\pi(t)$. Say this depends on some vector of variables $\textbf{X}$ whose dynamics are known under $Q$ (for example, it could be some stocks). Can I then always proceed by using Ito's formula to compute $$d\pi(t)$$ and then take the drift term and set it equal to $\pi r$? This would give me an equation wich sort of looks like the black scholes pde. Will that PDE always hold if we want to price with no arbitrage?&lt;/p&gt;&#xA;" OwnerUserId="26148" LastActivityDate="2017-03-06T06:07:42.523" Title="Do all assets satisfy the &quot;black scholes type PDE&quot;, or just the stocks?" Tags="&lt;arbitrage&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32838" PostTypeId="2" ParentId="32837" CreationDate="2017-03-06T01:13:16.877" Score="-3" Body="&lt;p&gt;No stock satisfies the requirements of Black-Scholes although some single period bonds probably do.  The assumption of Black-Scholes is that all parameter values are known perfectly.  This, of course, is not the case.  There is a 1958 proof showing that these types of problems lack a Frequentist solution.  This does not mean that there is no solution, merely that there is no solution using maximum likelihood or Frequentist solutions.  The Bayesian solution does not match the Black-Scholes solution so the Black-Scholes solution is not an admissible solution.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2017-03-06T01:13:16.877" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32839" PostTypeId="1" CreationDate="2017-03-06T01:19:55.957" Score="0" ViewCount="56" Body="&lt;p&gt;Can someone clarify differences between $dX_t,\frac{\partial X_t}{\partial t},\int_0^t X_{t'}dt',\int_0^tdX_{t'}$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does $\int_0^t\frac{\partial X_{t'}}{\partial{t'}}d{t'}=X_t$?&lt;/p&gt;&#xA;" OwnerUserId="25876" LastActivityDate="2017-03-06T16:37:42.390" Title="Notation clarity on continous proesses" Tags="&lt;stochastic-calculus&gt;" AnswerCount="1" CommentCount="2" ClosedDate="2017-03-06T16:42:49.903" ContentLicense="CC BY-SA 3.0" />
  <row Id="32840" PostTypeId="2" ParentId="32837" CreationDate="2017-03-06T06:07:42.523" Score="2" Body="&lt;p&gt;The martingale (risk-neutral) measure is always defined for some (complete) particular model. This model includes stocks and/or bonds. And by definition of $Q$, discounted prices of all assets in the model are matrtingales under $Q$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the answer to your question is yes, you can say that all assets in the model have the short rate as their local rate of return under the $Q$.&lt;/p&gt;&#xA;" OwnerUserId="15154" LastActivityDate="2017-03-06T06:07:42.523" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32841" PostTypeId="2" ParentId="30941" CreationDate="2017-03-06T06:30:29.580" Score="0" Body="&lt;p&gt;Another option is to look at the sovereign credit spreads over time for the country - this gives a fine grained and more market based view of its credit quality over time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.dbresearch.com/servlet/reweb2.ReWEB?rwnode=DBR_INTERNET_EN-PROD$EM&amp;amp;rwobj=CDS.calias&amp;amp;rwsite=DBR_INTERNET_en-PROD&quot; rel=&quot;nofollow noreferrer&quot;&gt;Deutsche Bank Research&lt;/a&gt; for example shows the default probabilities over time for various countries (backed out from the credit spreads).&lt;/p&gt;&#xA;" OwnerUserId="26229" LastActivityDate="2017-03-06T06:30:29.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32842" PostTypeId="1" CreationDate="2017-03-06T07:14:40.603" Score="4" ViewCount="221" Body="&lt;p&gt;I am trying to find a list of all publicly traded companies worldwide along with their annual revenue.  I can get the list of stock symbols but is there a way to get their annual revenue without looking them up one at a time? &lt;/p&gt;&#xA;" OwnerUserId="26871" LastEditorUserId="743" LastEditDate="2018-01-11T20:57:21.690" LastActivityDate="2018-07-11T00:31:41.470" Title="I am looking for a list of all companies worldwide with their annual revenue" Tags="&lt;data&gt;&lt;market-data&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32843" PostTypeId="1" CreationDate="2017-03-06T12:45:01.240" Score="4" ViewCount="192" Body="&lt;p&gt;I am working on the equity premium. Does anybody know one or two authors who address the relationship between volatility and equity premium? I.e. how does vola influence the equity premium?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, I am looking for a paper which summarizes the stylized facts on equity premium such as the reactions to vola changes or fluctuations in returns. Is there an author addressing this topic?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="25692" LastActivityDate="2018-12-05T19:04:35.390" Title="relationship between volatility and equity premium" Tags="&lt;volatility&gt;&lt;returns&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32844" PostTypeId="2" ParentId="29470" CreationDate="2017-03-06T13:03:58.860" Score="1" Body="&lt;p&gt;If &#xA;$$&#xA;\Lambda = S + K &#xA;$$&#xA;then you can look at samples of $S+K$ and estimate the variance of $\Lambda$ by the variance of $S+K$. If $\theta$ and $\kappa$ are known constants then you can do the algebra to derive $\sigma^2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is how the above equality holds. If it holds almost surely, then you are done. If it holds in probability then you are done too. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe it helps to look at&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\Lambda_t = S_t + K_t + \epsilon_t&#xA;$$&#xA;and model that resiudal $\epsilon$.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2017-03-06T13:03:58.860" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32846" PostTypeId="1" CreationDate="2017-03-06T14:29:37.420" Score="8" ViewCount="850" Body="&lt;p&gt;I'd like to estimate the &lt;em&gt;drift&lt;/em&gt; of a continuous-paths, &lt;em&gt;non-stationary&lt;/em&gt;, stochastic process $X_t$ from a time series of values $\{X_{i\Delta t}\}_{i=1,\dots,N}$ sampled from a single realisation of that process over $t \in [0,T]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although the objective is to calibrate a pricing model (specified under $\Bbb{Q}$) based on historical series (observed under $\Bbb{P})$, we can forget about this and assume we're working under a single measure $\Bbb{P}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've bumped into a &lt;a href=&quot;https://quant.stackexchange.com/questions/2955/estimation-of-geometric-brownian-motion-drift&quot;&gt;similar question&lt;/a&gt;, but unfortunately the references provided apply to processes admitting a &lt;em&gt;stationary distribution&lt;/em&gt; (= linear drift Ornstein-Uhlenbeck processes used for interest rates modelling) an assumption which I'd like to move away from.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually, my assumptions could even be further simplified to the case of a simple Arithmetic Brownian motion with drift&#xA;$$ dX_t = \mu dt + \sigma dW_t $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: can someone point me towards a &quot;nice&quot; method to obtain an estimator $\hat{\mu}$ of $\mu$ from the observation of a $N$-sample $\{X_i\}_{i=1,...,N}$, where by &quot;nice&quot; I mean that the finite sample properties of the latter estimator should be better than the usual MLE (= LSE) estimator $$\hat{\mu} = \frac{1}{N-1} \sum_{i=1}^{N-1} \Delta X_i $$&#xA;whose relative error is proportional to $1/\sqrt{N\Delta t}$ i.e. to the time horizon $T=N \delta t$ over which the data sample is collected but not to the number of data points $N$ itself making it almost useless in practice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm particularly interested in answers where the answerer has had a successful experience in implementing the method he/she proposes in practice.  Because I've already come across different approaches/algorithms myself, but none were satisfying as far as I am concerned.&lt;/p&gt;&#xA;" OwnerUserId="26877" LastEditorUserId="24222" LastEditDate="2017-05-07T11:37:35.807" LastActivityDate="2018-08-30T19:02:41.400" Title="Estimation of the drift of a non-stationary process" Tags="&lt;stochastic-processes&gt;&lt;parameter-estimation&gt;" AnswerCount="2" CommentCount="9" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="32847" PostTypeId="2" ParentId="19043" CreationDate="2017-03-06T15:46:32.343" Score="3" Body="&lt;p&gt;Whether you should currency hedge or not (from a mean-variance perspective) depends on the relative volatility of the asset and the currency, and on how correlated they are.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider an investment in a foreign-denominated asset, with a currency hedge of $w$ (where $w=0$ is unhedged, and $w=1$ is fully hedged).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the return of the asset in local currency is $r_{\rm asset}$ and the return of a holding in the foreign currency is $r_{\rm ccy}$, then the return of this position is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;r_{\rm total} = r_{\rm asset} + (1 - w) r_{\rm ccy}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore the expected return is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\mu_{\rm total} = \mu_{\rm asset} + (1 - w)\mu_{\rm ccy}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the variance is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\sigma^2_{\rm total} = \sigma^2_{\rm asset} + 2(1-w)\rho\sigma_{\rm asset}\sigma_{\rm ccy} + (1 - w)^2\sigma^2_{\rm ccy}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's not unreasonable to assume that the expected return on the currency is zero, in which case you want to know what currency hedge would minimize your total variance. The hedge which minimizes the variance is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;w^* = 1 + \rho \frac{\sigma_{\rm asset}}{\sigma_{\rm ccy}}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i.e. it depends on the ratio of volatilities of the asset and the currency, and on their correlation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can therefore distinguish three possible scenarios -&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The asset and currency are uncorrelated, in which case it is optimal to fully hedge the currency return.&lt;/li&gt;&#xA;&lt;li&gt;The asset is positively correlated with the currency (often the case for emerging market or commodity currencies) in which case it is optimal to over-hedge. Since for the typical stock you have $\sigma_{\rm asset} &amp;gt; \sigma_{\rm ccy}$ you may actually want to overhedge by quite a bit!&lt;/li&gt;&#xA;&lt;li&gt;The asset is negatively correlated with the currency (often the case for safe-haven currencies like JPY or CHF) in which case it is optimal to under-hedge, and in some extreme cases it might be optimal to not hedge at all.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The above assumes that the investor's base currency is USD. We might also consider base currencies which are not USD, e.g. an Australia-domiciled investor considering whether to hedge her exposure to a USD-denominated stock. In this case the long-run correlation between US stocks and the USD/AUD rate is about -50%, so a substantially reduced currency hedge could be appropriate.&lt;/p&gt;&#xA;" OwnerUserId="924" LastEditorUserId="924" LastEditDate="2017-03-07T18:22:59.267" LastActivityDate="2017-03-07T18:22:59.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32848" PostTypeId="2" ParentId="9054" CreationDate="2017-03-06T15:55:39.893" Score="1" Body="&lt;p&gt;The history of option returns is not always relevant to what the performance will be in the future. So what you really want to do is find the underlying drivers of the portfolio returns. This leads you to a bottom-up approach. You can still apply EVT to any of the underlying drivers, but you wouldn't be fitting the portfolio returns or the individual option returns with an extreme value distribution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are many variations, but here is one potential approach (based on &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1753788&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;Meucci&amp;#39;s approach&quot;&gt;Meucci's approach&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Begin by modelling stock returns. Regress each stock's return on some benchmark returns. Then, for the benchmark and the residuals, you can fit a GARCH model and get standardized residuals. You can then fit Extreme Value Distributions to the standardized residuals. You would then be able to use Monte Carlo to simulate from the relevant distributions to get the distributions of the stocks at the relevant horizon. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The next step would be modelling the option prices. Simulating option prices in the future depends on future values of stock prices and implied volatility (ignoring changes in interest rates). What you really need to model is changes in implied volatility. Again, here you fit some kind of model to changes in implied volatility (and here you would probably need to build up a volatility surface) and use that to forecast implied volatility at the horizon. Lots of variations. You might consider that there is a correlation between stocks and that the implied volatility has a relationship with the above GARCH volatility. Anyway, then you use the stock price distributions and the implied volatility distributions to price the options at the horizon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, you would use the weights at the initial period you could the portfolio returns at the horizon. You would then be able to calculate VaR or CVaR. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2017-03-06T15:55:39.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32849" PostTypeId="2" ParentId="32839" CreationDate="2017-03-06T16:11:58.237" Score="3" Body="&lt;p&gt;$X_t$ is the observable state of a physical system, it could be the price of a stock, the position of one leaf of a tree as it shakes during a storm, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dX_t$ the &quot;increments of $X_t$&quot; is an abstract notion representing the tiny little random and nonrandom changes that affect $X_t$ from moment to moment. It cannot be drawn or visualized, but when artists try to represent it they usually show a messy spiky blur like this &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/e5d6g.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/e5d6g.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is not really accurate mathematically, it is a attractive fiction. $dX_t$ can be used in 2 ways: in an SDE, in which case it will be usually accompanied by other differentials such as $dt$ or $dW_t$ etc. Or under an integral sign for example $X_t = \int_0^tdX_{t}$, which by the way is essentially the &lt;em&gt;definition&lt;/em&gt; of $dX_t$. It is considered bad form (unacceptable in polite company) to put it in a fraction like this $\frac{\partial X_t}{\partial t}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The two integrals you show are rather distinct. $\int_0^t X_{t}dt$ just computes the area under the curve $X_t$, for example the area between the stock price and the x axis. Of course because the stock price is random the area is also a random variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other integral is the famous Ito integral, invented in Japan less than 100 years ago, relativelly recenty in the history of Maths. $\int_0^t \phi(t)dX_{t}$ essentailly means that when adding up the $dX_t$ together we enhance or dilute them according to the &quot;amplitude&quot; function $\phi(t)$ thus we will probably get something different from the $X_t$ that we started with. If $\phi(t)$ represents the number of shares of stock you own then the integral is computing your cumulative profit from time 0. To become rich, just make $\phi(t)$ big when the upcoming increments are likely to be positive.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-03-06T16:37:42.390" LastActivityDate="2017-03-06T16:37:42.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32850" PostTypeId="1" CreationDate="2017-03-06T16:27:48.447" Score="1" ViewCount="26" Body="&lt;p&gt;The model here is affine two-factor model for interest rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $p = p(r, \sigma)$ denote bond prices which take the usual exponential form.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $r$ have some $Q$ dynamics, and let $\sigma$ be the stochastic (!) volatility. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Are there known conditions one can impose on the dynamics such that $p$ does not depend on $\sigma$?&lt;/li&gt;&#xA;&lt;li&gt;Given those conditions, would $\sigma$ still make  have its say in the determination of option prices (e.g., a call), and if so, why?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For the first, I am thinking something there may be some particular unspanned stochastic volatility model? For the second, I am not sure. &lt;/p&gt;&#xA;" OwnerUserId="26880" LastActivityDate="2017-03-06T16:27:48.447" Title="$\sigma$-indepencene in affine multi-factor model for interest rate derivatives" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;bond&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32851" PostTypeId="1" AcceptedAnswerId="32852" CreationDate="2017-03-06T17:40:59.770" Score="0" ViewCount="912" Body="&lt;p&gt;I want to buy put options on the newly issued SNAP stock (Snapchat).&#xA;How come the option chain is still empty? it's been a few days since the IPO.&lt;/p&gt;&#xA;" OwnerUserId="3514" LastEditorUserId="3514" LastEditDate="2017-03-06T19:48:26.500" LastActivityDate="2017-03-06T19:48:26.500" Title="How come SNAP does not have option chain?" Tags="&lt;options&gt;&lt;equities&gt;&lt;short-selling&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32852" PostTypeId="2" ParentId="32851" CreationDate="2017-03-06T19:11:27.763" Score="4" Body="&lt;p&gt;Options will be listed this Friday, &lt;a href=&quot;http://www.cboe.com/blogs/options-hub/2017/03/02/snapchat-(snap)-ipo-is-here!&quot; rel=&quot;nofollow noreferrer&quot;&gt;source&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="848" LastEditDate="2017-03-06T19:18:51.603" LastActivityDate="2017-03-06T19:18:51.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32856" PostTypeId="1" AcceptedAnswerId="32871" CreationDate="2017-03-06T22:12:26.320" Score="1" ViewCount="90" Body="&lt;p&gt;I understand the author's intended solution to the below problem, but I thought I would see if I could solve this using first principles and Ito's Lemma instead for practice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $V(S(t), t) = e^{rt}\ln{[S(t)]}$. Then &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}V_S &amp;amp;= \frac{e^{rt}}{S(t)},\\ V_{SS} &amp;amp;= \frac{-e^{rt}}{[S(t)]^2} \text{, and}\\ V_t &amp;amp;= re^{rt}\ln[S(t)].\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming the Black-Scholes framework, $dS(t) = (\alpha - \delta)S(t) dt + \sigma S(t) dZ(t)$. By Ito's Lemma,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}dV &amp;amp;= (\alpha - \delta)e^{rt} dt +e^{rt}\sigma dZ(t) - \frac{1}{2}e^{rt}\sigma^2 dt + re^{rt}\ln[S(t)]dt\\&#xA;&amp;amp;=[(\alpha - \delta)e^{rt} - 0.5e^{rt}\sigma^2 + re^{rt}\ln[S(t)]dt + e^{rt}\sigma dZ(t).\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would appear that without knowing anything about $\delta$ or $\sigma$, we have no where to go. So is there not a way to solve this problem from first principles without knowing that since the Sharpe ratios of the asset and the derivative are perfectly (positively) correlated, they are equal? I.e., &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\gamma_V - r}{\sigma_V} = \frac{\gamma - r}{\Omega_V\sigma} = \frac{\alpha - r}{\sigma},$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\gamma_V$ is the continuously compounded return on the derivative and $\Omega_V$ is the elasticity of the derivative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/dtbU0.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/dtbU0.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5641" LastActivityDate="2017-03-07T09:44:00.997" Title="Is it possible to approach finding the risk premium of this derivative using Ito's Lemma?" Tags="&lt;derivatives&gt;&lt;itos-lemma&gt;&lt;self-study&gt;&lt;risk-premium&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32857" PostTypeId="1" AcceptedAnswerId="32858" CreationDate="2017-03-07T00:13:29.983" Score="2" ViewCount="79" Body="&lt;p&gt;I'm trying to do a value analysis within a group of companies with very different growth rate, here are some method I've explored:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;P/E ratio. By this measurement most top value companies are those with declining revenue (which make sense why they have a low PE). Example is WDR in 2017, which has a low P/E of 10 but revenue is declining for three consecutive years.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;PEG ratio. This works for high growth companies but for very stable business like Walmart the PEG ratio doesn't work.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Are there any recommendations, preferably with a link to a research paper, about the consistent method to evaluate these companies?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="20161" LastActivityDate="2017-03-08T05:57:10.090" Title="How to evaluate companies with different rate of growth rate?" Tags="&lt;valuation&gt;&lt;value-investing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32858" PostTypeId="2" ParentId="32857" CreationDate="2017-03-07T00:50:31.000" Score="1" Body="&lt;p&gt;The annuity formula. It's the best and easiest way to approximate a discounted cash flow analysis (DCF) using minimal data. PE is a decent &quot;first&quot; approximation that compares cash flow to price, but totally ignores the growth component. The PEG is a convenient tool for standardizing PEs to growth rates. PEG, however, has no mathematical basis in the time value of money principle (and/or no-arbitrage theory of pricing model) and it goes totally asymptotic (i.e., meaningless) for a large range of values for P, E, and G. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although imperfect, the &quot;gold standard&quot; of valuation methods is still the DCF analysis. Involved DCF analyses can become very complex and ornate, and still don't solve the &quot;forever&quot; problem -- it is common therefore to just assume an exit multiple of EBIT or EBITDA. Moreover, with increasing complexity, the risk of utilizing garbage data increases as does the likelihood of getting a garbage result (i.e., garbage-in, garbage-out). Fortunately, you can approximate a DCF pretty closely and with far less complexity if you utilize the annuity formula given only an initial cash flow, a growth rate, and a discount factor. Moreover, you can compare the resultant expected present value of an annuity to its market value, much like the PE and PEG ratios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Working with continuous time is easiest -- it is also usually sufficient for modeling purposes. If we assume that an investor receives continuously accruing annualized cash flows, $C_t$, which grow at a continuous annualized rate, $g_t$, then the present value of those cash flows is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V_t = \int_t^T C_t e^{g*t} \frac{1}{e^{r*t}} =  \int_t^T C_t e^{(g-r)*t} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r$ is the force of interest&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a finite $T$, this becomes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V_t = C * (e^{T(g-r)}-e^{t(g-r)})\frac{1}{g-r}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[EDIT: intial formula had error; apologies]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As $T$ goes to $\infty$, this becomes the perpetuity formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V_t = C * (e^{-r*t})\frac{1}{r-g}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that $t$ is usually set to $0$ -- a thing to the $0^{th}$ power equals $1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note that the perpetuity will go asymptotic to $\infty$ if the growth rate exceeds the force of interest rate. Fortunately, you mix and match any combination of finite and infinite annuities which achieves your desired end-state. For a growing annuity, it is often reasonable to sum the values of an annuity (initial growth period) plus a discounted perpetuity (terminal value), i.e.,:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V_t = (C * (e^{T(g-r)}-e^{t(g-r)})\frac{1}{g-r}) + (C*e^{(g-r)*T}\frac{1}{r+d})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $d$ now equals the terminal exponential decline rate of $C$ starting at time, $T$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If future cash flows are known and discrete, more accurate results can be had by using discrete time models. There are plenty of discrete annuity models to choose from... just be careful on the difference between annuities and annuities due. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as references, I'll just point you to Aswath Damodoran: &lt;a href=&quot;http://seekingalpha.com/article/4027440-myth-5_1-believe-forever-dcf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://seekingalpha.com/article/4027440-myth-5_1-believe-forever-dcf&lt;/a&gt;. He says basically the same things.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2017-03-08T05:57:10.090" LastActivityDate="2017-03-08T05:57:10.090" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32859" PostTypeId="1" CreationDate="2017-03-07T02:05:08.130" Score="1" ViewCount="447" Body="&lt;p&gt;One book said &lt;code&gt;hedging variance swaps&lt;/code&gt;&#xA;$$I= \sqrt{\dfrac{1}{t}\int^t_0\sigma^2(S,t)}d t$$&#xA;by &lt;code&gt;vanilla option&lt;/code&gt;，say value $V(S,E;\sigma)$(&lt;code&gt;Black-Scholes&lt;/code&gt; fomula) where $S$ is &lt;code&gt;underlying asset&lt;/code&gt;, $E$ is the &lt;code&gt;strike price&lt;/code&gt;. Then he constructed a &lt;code&gt;portfolio&lt;/code&gt; with value&#xA;$$P=\int^{\infty}_0f(E)V(S,E;\sigma)d E$$&#xA;then compute the &lt;code&gt;vega&lt;/code&gt; of portfolio: $\textrm{Vega}_P= \dfrac{\partial P}{\partial\sigma},$&#xA;then let&#xA;$$\dfrac{\partial \textrm{Vega}_P }{\partial S}=0$$&#xA;obtain $f(E) = \dfrac{k}{E^2}.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;His conclusion is &lt;code&gt;variance swaps can be hedged with vanilla option, using the 'one over strike squared' rule.&lt;/code&gt;&#xA;I can not understand:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1.What's the meaning of the representation of $P$(why take the integral) i.e how do we implement this portfolio by vanilla option, hold $F(E)$ share?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2.Why we need constant vega against $S$ i.e how to hedge?&lt;/p&gt;&#xA;" OwnerUserId="26165" LastEditorUserId="26165" LastEditDate="2017-03-07T02:22:41.377" LastActivityDate="2017-03-07T08:54:36.647" Title="Hedge variance swapping by vanilla option(constant vega portfolio against underlying asset)" Tags="&lt;options&gt;&lt;volatility&gt;&lt;swaps&gt;&lt;variance&gt;&lt;exotics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32860" PostTypeId="2" ParentId="32843" CreationDate="2017-03-07T02:06:18.540" Score="2" Body="&lt;p&gt;In general, if you're looking for papers on the topics involving statistical anomalies, such as this, I highly recommend Quantpedia.com's &lt;a href=&quot;http://quantpedia.com/Screener/Details/20&quot; rel=&quot;nofollow noreferrer&quot;&gt;section on the implied volatility premium&lt;/a&gt;. I think access to the full site is well worth the price tag.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, I wrote a paper on this a few years back based on my own research. The volatility risk premium papers with which I familiar deal mostly with the options premia, and not specifically with regards to the equity indices themselves.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my experience, you basically to want to compare the implied volatilty (IV) (i.e., VIX for the indices) with the best possible estimate of the historical realized standard deviation (RV). The delta is slightly indicative of next-day equity returns. This appears to be a day-trading signal that collapses quickly. A relatively positive delta -- where IV less RV exceeds historical norms -- indicates the presence of positive premium (i.e., the market is risk-averse) in which rising equity prices are more likely. A relatively narrow delta indicates, on the other hand, that a sentiment has gotten over-confident and that a downside correction is likely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The delta relative to historical norms can be measured using various standardization methods and over various time-frames while retaining a statistically significant ability to forecast next-day index returns. However, it wasn't a strong enough correlation to overcome fees and slippage within a day-trading context.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it did become sufficiently attractive to trade VIX Futures when I applied the risk premium concept to the the term structure of VIX Futures. The term structure is historically indicative of the VIX Futures roll-returns. Shorting VIX Futures on a steep futures contango contango is consistently profitable. Going long the VIX Futures on steeply backwardated term structure hi&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One simple method for distilling the IV equity premium may proceed as follows:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The first step is to determine instantaneous market variance. Yhang and Zhang give an efficient method for estimating variance using freely available OHLC data: &lt;a href=&quot;http://ftp.ams.sunysb.edu/papers/2000/susb00_25.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://ftp.ams.sunysb.edu/papers/2000/susb00_25.pdf&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Combine the instantaneous estimate of variance with one of the ARCH (i.e. G-ARCH, E-ARCH) models for combining exponential time weighting with mean reversion.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Take the difference between the annualized square root of the ARCH model and implied volatility. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2018-12-05T19:04:35.390" LastActivityDate="2018-12-05T19:04:35.390" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="32861" PostTypeId="1" AcceptedAnswerId="32862" CreationDate="2017-03-07T02:33:39.757" Score="2" ViewCount="649" Body="&lt;p&gt;I keep hearing things like &#xA;\begin{align*}&#xA;``\text{Traders make their book delta-neutral at the end of each trading day''}&#xA;\end{align*}&#xA;I am wondering what this means, and why this is supposed to give the traders some peace of mind. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;More specifically: How do the traders compute delta and decide how to hedge an option position? Do they assume the Black-Scholes model (or some other model) and then compute delta? In that case, what about model error (delta is the partial derivative w.r.t. price and is model-specific)? Thus, the delta they compute may be completely wrong! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, I have some market data from a financial data vendor, containing S&amp;amp;500 call and put option prices, as well as the delta, gamma, etc. of the options. In general situations like that, how are those quantities computed? Is it simply under Black-Scholes assumptions? &lt;/p&gt;&#xA;" OwnerUserId="26887" LastActivityDate="2017-03-07T03:49:42.420" Title="How to compute delta and delta-hedge in practice?" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;delta-hedging&gt;&lt;delta&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32862" PostTypeId="2" ParentId="32861" CreationDate="2017-03-07T03:49:42.420" Score="3" Body="&lt;p&gt;Yes, you are right. There might be model errors. It depends on experience, personal choice and the mandate of the desk which model they use. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the model you use, you calculate your delta and hedge. You of hedge your delta but you are exposed to higher order greeks which would give you a delta exposure when the market moves. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far market data goes, you should check the documentation. But most likely it would be black-scholes.&lt;/p&gt;&#xA;" OwnerUserId="15428" LastActivityDate="2017-03-07T03:49:42.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32863" PostTypeId="1" CreationDate="2017-03-07T04:09:44.380" Score="11" ViewCount="32745" Body="&lt;p&gt;Does anybody have the Bachelier model call option pricing formula for $r &amp;gt; 0$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All the references I've read assume $r = 0$. I don't speak French, so I can't read Bachelier's original paper.&lt;/p&gt;&#xA;" OwnerUserId="26889" LastActivityDate="2020-02-27T14:49:24.660" Title="Bachelier model call option pricing formula" Tags="&lt;option-pricing&gt;&lt;call&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="32864" PostTypeId="2" ParentId="2955" CreationDate="2017-03-07T07:11:14.593" Score="-4" Body="&lt;p&gt;hope the following codes help you &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Z = normrnd(0.00112, 0.01525, 15000, 52);&#xA;R = Z';&#xA;m = sum(R)/52;&#xA;p = m';&#xA;for k = 1:15000;&#xA;    for j = 1:52;&#xA;        D(k,j) = (Z(k,j)-p(k,1)).^2;&#xA;    end;&#xA;end;&#xA;V = sum(D')/52;&#xA;V = V';&#xA;t = 1/52;&#xA;S = sqrt(V/t)&#xA;A = 0.5 * S.^2 + (1/t)*p&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="26890" LastEditorUserId="848" LastEditDate="2017-03-07T08:13:42.223" LastActivityDate="2017-03-07T08:13:42.223" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32865" PostTypeId="1" AcceptedAnswerId="32875" CreationDate="2017-03-07T07:45:33.327" Score="3" ViewCount="492" Body="&lt;p&gt;I want to implement an algorithm that calculates an account's 95% value at risk on a monthly return base. The case I want to describe in this question is rather academic and will probably never happen in real life.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am wondering what happens if an account has never suffered a negative return, i.e. has always made money instead of loosing. Is the VaR 0 in this edge case (since the account never lost money, hence there is NO value at risk), or is the VaR negative (since the account always won money, hence the account's capital being at risk is negative and therefore is expected to grow, even in the worst case)?&lt;/p&gt;&#xA;" OwnerUserId="26891" LastActivityDate="2017-03-07T16:24:50.940" Title="Value at Risk - What if an account has never suffered from a negative return" Tags="&lt;statistics&gt;&lt;var&gt;&lt;value-at-risk&gt;&lt;statistical-finance&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32868" PostTypeId="2" ParentId="32863" CreationDate="2017-03-07T08:52:45.197" Score="5" Body="&lt;p&gt;It's pretty simple to derive with basic knowledge of stochastic calculus. But since you are looking for the easy answer here it is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C_t=e^{-r(T-t)}\sigma\sqrt{T-t} (D \Phi(D)+\phi(D))$$ &#xA;where $D=\frac{F_{t,T}-K}{\sigma \sqrt{T-t}}$ and $\Phi(\cdot)$ and $\phi(\cdot)$ are respectively the normal cdf and pdf. $F_{t,T}=S_te^{r(T-t)}$ is the forward price.&lt;/p&gt;&#xA;" OwnerUserId="26657" LastEditorUserId="26657" LastEditDate="2017-03-07T09:42:10.953" LastActivityDate="2017-03-07T09:42:10.953" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="32869" PostTypeId="2" ParentId="32859" CreationDate="2017-03-07T08:54:36.647" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;An integral is used because the portfolio contains an &lt;em&gt;infinite&lt;/em&gt; number of instruments. More specifically, the idea is to hold a continuous strip of $f(E)$ units of European vanilla options struck at $E$ for each $E \in [0,\infty[$. Of course this remains a theoretical concept: to build a similar portfolio in practice, one must consider a partition of the truncated strike domain (hence a finite number of options):&#xA;$$ P = \sum_{i=1}^N f(E_i) V(S,E_i;\sigma) $$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You need a constant, non-zero, Vega against $S$ because you would like a product which is sensitive to volatility and independent of the path the asset will take, i.e. a pure volatility bet.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Have a look at this well-known deck by JP Morgan &lt;a href=&quot;http://www.trade2win.com/boards/attachments/f112/28465d1184429346-gamma-variance-swaps.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;. It may help you better understand the practical implications.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2017-03-07T08:54:36.647" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32871" PostTypeId="2" ParentId="32856" CreationDate="2017-03-07T09:44:00.997" Score="2" Body="&lt;p&gt;Assume that under the real world measure&#xA;$$ dS_t/S_t = (\alpha-\delta) dt + \sigma dZ_t^\Bbb{P} \tag{1} $$&#xA;Under the EMM $\Bbb{Q}$ one then needs to have (fundamental theorem of asset pricing: in the absence of arbitrage the discounted value of any self-financing portfolio should be a martingale):&#xA;$$ dS_t/S_t = (r-\delta) dt + \sigma dZ_t^\Bbb{Q} \tag{2} $$&#xA;Examining $(1)$ and $(2)$ the (instantaneous) excess return per unit of volatility risk is therefore:&#xA;$$ \pi_S = \frac{\alpha-\delta}{\sigma} - \frac{r-\delta}{\sigma} := \frac{\alpha-r}{\sigma} $$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Now assume $V(t,S_t) = e^{rt} \ln(S_t)$. As you noted, applying Itô's lemma yields:&#xA;$$ dV_t = e^{rt}\left[ r\ln(S_t) dt + \frac{dS_t}{S_t} - \frac{1}{2} \sigma^2 dt \right] \tag{3} $$&#xA;Writing $dV_t$ under real world and risk-neutral measures respectively plugging $(1)$ and $(2)$ then gives:&#xA;$$  dV_t = e^{rt}\left[ (\alpha-\delta) + r\ln(S_t) - \frac{1}{2} \sigma^2 \right] dt + e^{rt} \sigma dZ_t^\Bbb{P} \tag{4} $$&#xA;$$  dV_t = e^{rt}\left[ (r-\delta) + r\ln(S_t) - \frac{1}{2} \sigma^2 \right] dt + e^{rt} \sigma dZ_t^\Bbb{Q} \tag{5} $$&#xA;The (instantaneous) excess return per unit of volatility risk is now:&#xA;$$ \pi_V = \frac{e^{rt}\left((\alpha-\delta) + r\ln(S_t) - \frac{1}{2} \sigma^2 \right)}{e^{rt}\sigma} - \frac{e^{rt}\left( (r-\delta) + r\ln(S_t) - \frac{1}{2} \sigma^2 \right)}{e^{rt}\sigma} := \frac{\alpha-r}{\sigma} = \pi_S $$&#xA;So you see that you fall back on the result that the Sharpe ratios are the same without any prior knowledge.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2017-03-07T09:44:00.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32872" PostTypeId="1" AcceptedAnswerId="32873" CreationDate="2017-03-07T09:48:06.623" Score="1" ViewCount="176" Body="&lt;p&gt;My problem boils down the  the classical&#xA;$$&#xA;a \cdot w - \lambda w \Sigma w \rightarrow Max&#xA;$$&#xA;under the constraints&#xA;$$&#xA;A \cdot w \le b,&#xA;$$&#xA;where the above constraints also contain information about my benchmark weights. I also have constraints in place about minimum investment if invested and maxinal over- resp. underweights.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However due to the nature of my constraints I see a strong concentration of the resulting portfolio either on the large cap segment or on the small cap segment of the market I work on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an elegant constraint such that I can neutralize a small cap bias. Maybe an elegant way to neutralize any capitalization bias?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: we can assume that the capitalization information is contained in the BM-weights. The stocks of the largest weights are the large caps. Can we apply some entropy approach?&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2017-03-07T10:18:22.793" LastActivityDate="2017-03-07T10:58:13.463" Title="Capitalization constraint in portfolio optimization" Tags="&lt;portfolio-management&gt;&lt;portfolio-optimization&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32873" PostTypeId="2" ParentId="32872" CreationDate="2017-03-07T10:13:55.443" Score="2" Body="&lt;p&gt;You can introduce equality constraints&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$a^Tw = b$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the matrix $a$ contains information about the capitalization of each stock, and $b$ contains information about your benchmark.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, say you have six stocks, of which 1, 2 and 3 are small cap and 4, 5 and 6 are large cap. You also know that your benchmark has 80% of its market value as large caps, and 20% as small caps. Then you can use&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;a = \left[ \begin{array}&#xA;11 &amp;amp; 1 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\&#xA;0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 1 &amp;amp; 1 \\&#xA;\end{array} \right], \quad &#xA;b = \left[\begin{array}&#xA;00.2 \\ 0.8&#xA;\end{array}\right]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;this ensures that whatever weights are selected, you will match your benchmark's investment in both small and large caps, thereby neutralizing any capitalization bias relative to your benchmark.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;An alternative approach is to allow $a$ to contain both positive and negative values, where large cap stocks have generally positive values and small cap stocks have generally negative values, and demand that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;a^Tw = 0&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is how to select the weights in $X$. You certainly want your benchmark weights, $w_0$, to have no capitalization bias -&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;a^Tw_0 = 0&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Beyond that you are free to choose the weights in any fashion that you wish. One example might be to choose the weights to co-vary with some measure $v$ of market capitalization which has a roughly normal distribution, for example the logarithm of market cap -&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;v = \log V&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you could solve&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\min_a \; (a-v)^T(a-v) \; \textrm{s.t.} \; a^Tw_0 = 0&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which gives&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;a = v - \frac{w_0^T v}{w_0^T w_0} w_0&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now enforcing $a^Tw=0$ in your portfolio optimization ensures that your selected weights are free of capitalization bias in the same way that the benchmark is free of capitalization bias. Of course, what you mean by &quot;capitalization bias&quot; is encoded in the choice of weights in $a$, and there are multiple valid ways to choose this.&lt;/p&gt;&#xA;" OwnerUserId="924" LastEditorUserId="924" LastEditDate="2017-03-07T10:58:13.463" LastActivityDate="2017-03-07T10:58:13.463" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32875" PostTypeId="2" ParentId="32865" CreationDate="2017-03-07T11:44:43.483" Score="4" Body="&lt;p&gt;By definition, your &lt;em&gt;loss&lt;/em&gt; cannot be positive, so you'd set the VaR to zero.&#xA;But it really depends, on &lt;em&gt;how&lt;/em&gt; you calculate your VaR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you calculate your returns, sort them and look at the 5% quantile (which, as you say, may be positive), then you'd simply set your VaR to zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you treat your returns as realizations of some (unknown) random variable, then just because you don't have any negative returns, that doesn't strictly mean that the random variable cannot be negative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A simple example follows: we get 250 &lt;code&gt;N(0,1)&lt;/code&gt; samples and make them all positive (via &lt;code&gt;abs&lt;/code&gt;) and try to estimate the density of the data and plot the density curve:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;set.seed(11)&#xA;returns &amp;lt;- abs(rnorm(250))&#xA;# no negative returns - all are positive&#xA;min(returns)&#xA;kde &amp;lt;- density(returns)&#xA;plot(density(returns))&#xA;abline(v=0, col=2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;gives&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; # no negative returns - all are positive&#xA;&amp;gt; min(returns)&#xA;[1] 0.006010746&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/d2QPY.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/d2QPY.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which as you can see also has data for negative values, and you'd probably want to use that to calculate VaR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(note1: this is a very simply example, the &lt;code&gt;density&lt;/code&gt; is not calibrated in any way)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(note2: also you shouldn't care about VaR, but about expected shortfall)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(note3: and you'd also probably want to run MC sims)&lt;/p&gt;&#xA;" OwnerUserId="18030" LastActivityDate="2017-03-07T11:44:43.483" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="32876" PostTypeId="2" ParentId="32865" CreationDate="2017-03-07T12:53:32.980" Score="1" Body="&lt;p&gt;Further to my comment on rbm's answer regarding negative VaR, consider a distribution with mean return = 7% and standard deviation 2%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a typical sample the returns are all positive, as the OP describes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking the normally distributed 5% quantile as -1.645, the 5% tail extends to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;0.07 + (-1.645 * 0.02) = 0.0371&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The 5% quantile return is 3.71% so the VaR is -3.71% of the total asset value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quoting &lt;a href=&quot;https://en.wikipedia.org/wiki/Value_at_risk#Details&quot; rel=&quot;nofollow noreferrer&quot;&gt;Wikipedia&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A negative VaR would imply the portfolio has a high probability of&#xA;  making a profit.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;5% VaR on sample and ideal distributions with μ = 0.07 &amp;amp; σ = 0.02&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/cUBFY.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/cUBFY.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7178" LastEditorUserId="7178" LastEditDate="2017-03-07T16:24:50.940" LastActivityDate="2017-03-07T16:24:50.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32877" PostTypeId="1" AcceptedAnswerId="32878" CreationDate="2017-03-07T13:28:02.743" Score="1" ViewCount="174" Body="&lt;p&gt;I would like to ask:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let assume that the mid-price now is &lt;code&gt;m0&lt;/code&gt;,&#xA;then a trade happens and the new mid-price is &lt;code&gt;m1&lt;/code&gt;. Is it possible to have &#xA;&lt;code&gt;m1 = m0&lt;/code&gt; or it should be always different?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance.&lt;/p&gt;&#xA;" OwnerUserId="11629" LastActivityDate="2017-03-07T13:41:31.933" Title="Does a trade always change the mid-price?" Tags="&lt;price&gt;&lt;trade&gt;&lt;bid&gt;&lt;ask&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32878" PostTypeId="2" ParentId="32877" CreationDate="2017-03-07T13:34:19.820" Score="1" Body="&lt;p&gt;If you define &lt;a href=&quot;https://en.wikipedia.org/wiki/Mid_price&quot; rel=&quot;nofollow noreferrer&quot;&gt;the mid price&lt;/a&gt; as the average of the best bid and best ask price the answer is no. If there are bids for 10 lots @ 10.00 and asks for 10 lots @ 10.10 markets orders smaller than 10 lots will not affect the mid price. The mid is 10.05 before and after.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This also implies that no trade is necessary to change the price. If the best bid or ask changes, the result of $$\frac{\mathrm{best\,bid} + \mathrm{best\,ask}}{2}$$ will also change.&lt;/p&gt;&#xA;" OwnerUserId="848" LastEditorUserId="848" LastEditDate="2017-03-07T13:41:31.933" LastActivityDate="2017-03-07T13:41:31.933" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32880" PostTypeId="1" CreationDate="2017-03-07T15:11:56.183" Score="1" ViewCount="59" Body="&lt;p&gt;Quandl is perfect for US equities, but lacks data for Europe/France.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to find the equivalent of the following data for Europe/France:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.quandl.com/databases/ZDM&quot; rel=&quot;nofollow noreferrer&quot;&gt;Zacks Daily Maintenance&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.quandl.com/databases/ZCP&quot; rel=&quot;nofollow noreferrer&quot;&gt;Zacks Company Profiles&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.quandl.com/data/SF1-Core-US-Fundamentals-Data&quot; rel=&quot;nofollow noreferrer&quot;&gt;Core US Fundamentals Data&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.quandl.com/data/WIKI-Wiki-EOD-Stock-Prices&quot; rel=&quot;nofollow noreferrer&quot;&gt;Wiki EOD Stock Prices&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So basically: company profiles, maintenance data, historical daily prices with dividends and splits updated daily, historical fundamentals updated daily.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the alternatives except an expensive morningstar direct membership?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Edit:&#xA;The other question does not include the data I am looking for. It is only vaguely related.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are the sources provided in the other question:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://finance.yahoo.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://finance.yahoo.com/&lt;/a&gt; : only includes prices. No API for dividends or splits or fundamentals or anything else.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.iasg.com/managed-futures/market-quotes&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.iasg.com/managed-futures/market-quotes&lt;/a&gt; : not a data provider.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://kumo.swcp.com/stocks/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://kumo.swcp.com/stocks/&lt;/a&gt; : only for S&amp;amp;P 500.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html&lt;/a&gt; : not providing the data I'm looking for.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://unicorn.us.com/advdec/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://unicorn.us.com/advdec/&lt;/a&gt; : only US.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://siblisresearch.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://siblisresearch.com/&lt;/a&gt; : not providing the data i am looking for.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://usfundamentals.com/download&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://usfundamentals.com/download&lt;/a&gt; : only US.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Did I miss anything?&lt;/p&gt;&#xA;" OwnerUserId="26895" LastEditorUserId="26895" LastEditDate="2017-03-10T15:08:18.997" LastActivityDate="2017-03-10T15:08:18.997" Title="Alternative to Quandl for Europe or France equities?" Tags="&lt;equities&gt;&lt;data&gt;" AnswerCount="0" CommentCount="2" ClosedDate="2017-03-11T08:21:08.063" ContentLicense="CC BY-SA 3.0" />
  <row Id="32881" PostTypeId="1" CreationDate="2017-03-07T17:57:00.340" Score="1" ViewCount="83" Body="&lt;p&gt;I am reading a math-heavy book on option pricing in cont-time, but I am embarrassed to say that I have little intuition of how hedging works in practice, how the Greeks are used,  and so on.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's a good reference for hedging strategies which is practical but not...  &quot;soft&quot;,  like say Investopedia?  &lt;/p&gt;&#xA;" OwnerUserId="26898" LastActivityDate="2017-03-07T17:57:00.340" Title="Reference request: hedging options and The Greeks" Tags="&lt;reference-request&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="32882" PostTypeId="2" ParentId="32863" CreationDate="2017-03-07T19:47:52.753" Score="13" Body="&lt;p&gt;We assume that, under the risk-neutral measure, the stock process &lt;span class=&quot;math-container&quot;&gt;$\{S_t, t \ge 0\}$&lt;/span&gt; satisfies an SDE of the form&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}&#xA;dS_t = r S_t dt + \sigma dW_t,&#xA;\end{align*}&lt;/span&gt;&#xA;where &lt;span class=&quot;math-container&quot;&gt;$r$&lt;/span&gt; is the constant interest rate, &lt;span class=&quot;math-container&quot;&gt;$\sigma$&lt;/span&gt; is the constant volatility, and &lt;span class=&quot;math-container&quot;&gt;$\{W_t, t \ge 0\}$&lt;/span&gt; is standard Brownian motion. For &lt;span class=&quot;math-container&quot;&gt;$0 \le t \le T$&lt;/span&gt;, &#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}&#xA;S_T = S_t e^{r(T-t)} + \sigma\int_t^T e^{r(T-s)}dW_s.&#xA;\end{align*}&lt;/span&gt;&#xA;That is,&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}&#xA;S_T \mid S_t &amp;amp;\sim N\left(S_t e^{r(T-t)},\, \frac{\sigma^2}{2r}\left(e^{2r(T-t)}-1 \right) \right)\\&#xA;&amp;amp;\sim S_t e^{r(T-t)} + \sqrt{\frac{\sigma^2}{2r}\left(e^{2r(T-t)}-1 \right)}\,\xi,&#xA;\end{align*}&lt;/span&gt;&#xA;where &lt;span class=&quot;math-container&quot;&gt;$\xi$&lt;/span&gt; is standard normal random variable. Then&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}&#xA;C_t &amp;amp;= e^{-r(T-t)}E\left(\left(S_T-K\right)^+ \mid \mathcal{F}_t \right)\\&#xA;&amp;amp;=e^{-r(T-t)}E\left(\left(S_t e^{r(T-t)} + \sqrt{\frac{\sigma^2}{2r}\left(e^{2r(T-t)}-1 \right)}\,\xi-K\right)^+ \mid \mathcal{F}_t \right)\\&#xA;&amp;amp;=e^{-r(T-t)}\sqrt{\frac{\sigma^2}{2r}\left(e^{2r(T-t)}-1 \right)}E\left(\left(\xi -\frac{K-S_t e^{r(T-t)}}{\sqrt{\frac{\sigma^2}{2r}\left(e^{2r(T-t)}-1 \right)}}\right)^+ \mid \mathcal{F}_t \right)\\&#xA;&amp;amp;=e^{-r(T-t)}\left(S_t e^{r(T-t)}-K\right)\Phi\left(\frac{S_t e^{r(T-t)}-K}{\sqrt{\frac{\sigma^2}{2r}\left(e^{2r(T-t)}-1 \right)}}\right) \\&#xA;&amp;amp;\qquad + e^{-r(T-t)}\sqrt{\frac{\sigma^2}{2r}\left(e^{2r(T-t)}-1 \right)}\,\phi\left(\frac{S_t e^{r(T-t)}-K}{\sqrt{\frac{\sigma^2}{2r}\left(e^{2r(T-t)}-1 \right)}}\right),&#xA;\end{align*}&lt;/span&gt;&#xA;where &lt;span class=&quot;math-container&quot;&gt;$\Phi$&lt;/span&gt; is the cumulative distribution function of a standard normal random variable, and &lt;span class=&quot;math-container&quot;&gt;$\phi$&lt;/span&gt; is the corresponding density function.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Comments&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Let &lt;span class=&quot;math-container&quot;&gt;$K^*=e^{-r(T-t)}K,$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$$v^2(t, T) = \frac{\sigma^2}{2r}\left(1-e^{-2r(T-t)}\right).$$&lt;/span&gt; Then, we can re-express the price as&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}&#xA;C_t &amp;amp;= \left(S_t-K^*\right)\Phi\left(\frac{S_t-K^*}{v(t, T)}\right) +v(t, T)\,\phi\left(\frac{S_t-K^*}{v(t, T)}\right).&#xA;\end{align*}&lt;/span&gt;&#xA;See also Section 3.3 of the book &lt;a href=&quot;https://rads.stackoverflow.com/amzn/click/3540209662&quot; rel=&quot;noreferrer&quot;&gt;Martingale Methods in Financial Modeling&lt;/a&gt;; however, note that there are a few typos in this book.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One other possibility is to assume that &#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}&#xA;S_t = e^{rt}(S_0 + \sigma W_t).&#xA;\end{align*}&lt;/span&gt;&#xA;Then the corresponding option price can be similarly obtained. See also the book mentioned above.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="-1" LastEditDate="2018-11-26T15:41:08.297" LastActivityDate="2018-11-26T15:41:08.297" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="32884" PostTypeId="1" CreationDate="2017-03-07T21:18:03.377" Score="1" ViewCount="55" Body="&lt;p&gt;i'm an intern in bank at Morocco that sells vanilla options on EUR/USD  , EUR/MAD , USD/MAD , it s using delta hedging strategy to cover they're position . But because of the switch to floating exchange rate of morocco in the next months  , the bank is wondering how it will be cover its book of options and which strategy is optimal in this case , is there any technique to simulate this ? What volatility should i consider in this case ?&#xA;PS : Options are sold OTC &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="26814" LastActivityDate="2017-03-08T21:11:19.437" Title="book of options hedging case of floating rate" Tags="&lt;options&gt;&lt;fx&gt;&lt;hedging&gt;&lt;currency&gt;&lt;floating-rate&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32885" PostTypeId="1" AcceptedAnswerId="32886" CreationDate="2017-03-07T21:22:30.423" Score="3" ViewCount="652" Body="&lt;p&gt;In this document, &lt;a href=&quot;https://www.eurexgroup.com/blob/2435406/f1b0086a8c6d05954c58a8dc24308c81/data/20160304_Colin-Bennent-Trading-Volatility-.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.eurexgroup.com/blob/2435406/f1b0086a8c6d05954c58a8dc24308c81/data/20160304_Colin-Bennent-Trading-Volatility-.pdf&lt;/a&gt;, it states that &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;&lt;strong&gt;This is because the dividend risk of an option is equal to its delta&lt;/strong&gt;, and the dividend used in quanto pricing increases as correlation increases. &quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Why is the dividend risk of an option equal to its delta? I am also not sure whether this is just for quanto options.&lt;/p&gt;&#xA;" OwnerUserId="11723" LastEditorUserId="24222" LastEditDate="2017-03-07T22:12:54.267" LastActivityDate="2017-03-07T22:12:54.267" Title="Why is the dividend risk of an option equal to its delta?" Tags="&lt;options&gt;&lt;greeks&gt;&lt;delta&gt;&lt;dividends&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32886" PostTypeId="2" ParentId="32885" CreationDate="2017-03-07T21:52:15.583" Score="2" Body="&lt;p&gt;Assume that the time $t$ forward for the maturity $T &amp;gt; t$ is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;F_t(T) = \left( S_t - D_t(T) \right) e^{r (T - t)},&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $D_t(T)$ is the time $t$ value of all dividends paid over $(t, T]$. Consider a European contingent claim with time $t$ value $V_t$. Then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\frac{\partial V_t}{\partial S_t} = \frac{\partial V_t}{\partial F_t(T)} \frac{\partial F_t(T)}{\partial S_t} = -\frac{\partial V_t}{\partial F_t(T)} \frac{\partial F_t(T)}{\partial D_t(T)} = -\frac{\partial V_t}{\partial D_t(T)}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e. the derivative of the option price w.r.t. to the spot is minus that of the option price w.r.t. changes in the present value of dividends.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2017-03-07T21:52:15.583" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32887" PostTypeId="2" ParentId="31783" CreationDate="2017-03-07T22:04:36.387" Score="1" Body="&lt;p&gt;From the SDE $dX_t=\sigma dW_t$, &#xA;\begin{align*}&#xA;X_{n+1} - X_n =\sigma \sqrt{t_{n+1}-t_n} Z_n.&#xA;\end{align*}&#xA;That is, &#xA;\begin{align*}&#xA;X_{n+1}\mid X_n \sim N\left(X_n, \, \left(\sigma \sqrt{t_{n+1}-t_n}\,\right)^2 \right),&#xA;\end{align*}&#xA;and the conditional density function is given by&#xA;\begin{align*}&#xA;\phi(x\mid X_n) = \frac{1}{\sqrt{2\pi}\sigma \sqrt{t_{n+1}-t_n}}e^{-\frac{(x-X_n)^2}{2 \sigma^2 (t_{n+1}-t_n)}}.&#xA;\end{align*}&#xA;Then, the conditional log-likelihood function is given by&#xA;\begin{align*}&#xA;L(X_1, \ldots, X_{n+1}) &amp;amp;= \sum_{i=1}^n\ln \Big(\phi(X_{i+1}\mid X_i)\Big)\\&#xA;&amp;amp;=-\frac{n}{2}\ln(2\pi) -\frac{n}{2}\ln(t_{i+1}-t_i)-n\ln\sigma - \sum_{i=1}^n\frac{(X_{i+1}-X_i)^2}{2 \sigma^2 (t_{n+1}-t_n)}.&#xA;\end{align*}&#xA;Now, you can minimize the function to obtain the $\sigma$ estimation.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2017-03-07T22:04:36.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32889" PostTypeId="2" ParentId="32846" CreationDate="2017-03-07T23:24:40.097" Score="2" Body="&lt;p&gt;I see... the problem with too long a time frame is that most time-series are not stationary -- the means and the variances will tend to fluctuate. Given non-stationary in our time-series, and given that no uncertainty is never possible, we are damned if we wait for a larger sample size, and damned if we don't.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But assuming that you know what the underlying moment-generating function looks like (ABM in this case), you can make some simplifying assumptions which let you determine p-values for rejecting a null hypothesis (i.e., that $\mu_s = \mu_p$) and the statistical power of a given $T$. In other words, if you know that it's AGM and you can define acceptable levels of sensitivity (Type II errors rates) and specificity (Type I error rates), you can then choose a $T$ that balances the ideal of certainty with practicality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, if we know that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sqrt{N}(\frac{1}{N}\sum_{i=1}^{N}(X_{i}-X_{i-1}) - \mu) \to ^d N(0,\sigma^2)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;we can also deduce that the LSS technique for the estimating $\mu_p$ of ABM converges to the arithmetic mean. Download this discrete model for proof of that assertion: &lt;a href=&quot;http://the-world-is.com/blog/wp-content/uploads/2017/03/AGM-Estimators-with-LSS.xlsm&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://the-world-is.com/blog/wp-content/uploads/2017/03/AGM-Estimators-with-LSS.xlsm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An alternative to the arithmetic mean includes a class of estimators known as the maximum likelihood estimators (MLEs). MLEs tend to be biased... eliminating that bias is somewhat involved. Still, they provide a general purpose way of fitting parameters to observations. Personally, I use these only when trying to develop an intuition regarding whether a given set of parameters is reasonable.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Exponentially weighted functions and regressions are another option. Exponential weighting reflects the intuition that recent observation carry more weight, but that time-series do in practice tend to have long-term memories. If you know you're dealing with ABM, but you don't know if the moments are non-stationary, time-weighted regressions will produce better estimates of the present underlying moments than other methods. MLEs can be used to calibrate the weights -- I usually use just figure that I want to build in a 10% annual decline in weightings, so the actual discrete factor depends on sampling frequency and sample size. Personally, I've had a lot of success &quot;setting and forgetting&quot; these in the real world. Moreover, it is relatively simple to come up with a class of functions such that discrete weights sum to one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;G-ARCH models combine exponential weighting with a long-term mean reversion process. MLEs are typically used to estimate the parameters. If you assume you're dealing with ABM without mean reversion, there is no reason to use any of the ARCH family of models. Even if you're testing for stationarity, unit root tests are far simpler.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope that response is apropos!&lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2017-03-07T23:58:21.410" LastActivityDate="2017-03-07T23:58:21.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32890" PostTypeId="2" ParentId="32846" CreationDate="2017-03-08T02:50:24.377" Score="1" Body="&lt;p&gt;There is a simple Bayesian model, that is only slightly less simple if there is a stochastic budget constraint.  The likelihood would be $$\mathcal{L}(x_1\dots{x_{n}}|\mu;\sigma)=\frac{1}{\pi}\frac{\sigma}{\sigma^2+(x_{t+1}-\beta{x_t}-\alpha)^2}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have successfully implemented this.  If you want to test this, you should use the Bayesian predictive distribution as your test using a scoring method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Bayesian posterior density, which is $$p(\mu;\sigma|\mathbf{X})\frac{\mathcal{L}(\mathbf{X}|\mu;\sigma)p(\mu;\sigma)}{\int_{-\infty}^\infty\int_0^\infty\mathcal{L}(\mathbf{X}|\mu;\sigma)p(\mu;\sigma)\mathrm{d}\sigma\mathrm{d}\mu},\forall\mu;\sigma\in\Theta$$ is the basis for the prediction,where $\Theta$ is the parameter space.  This is converted to a predictive distribution by integration as $$p(\tilde{x}_{t+1}|\mathbf{X})=\int_{-\infty}^\infty\int_0^\infty\mathcal{L}(\tilde{x}_{t+1}|\mu;\sigma)p(\mu;\sigma)\mathrm{d}\sigma\mathrm{d}\mu,\forall{x_{t+1}\in\chi},$$ where $\chi$ is the future sample space. Notice that the predictions, the distribution on the left, no longer depend upon the estimates for the parameter that are on the right and now depend only on your observed data.  You will want to apply a scoring function that is less than quadratic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is an existing proof by White in 1958 that there is no non-Bayesian solution to this problem.  FYI this was for your arithmetic time series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will want to think through your prior, for example, if $\beta&amp;gt;1$ then it must be the case that the prior distribution is zero at values less than or equal to one.  As a Bayesian method, it is impossible to find a more efficient estimator anyway as Bayesian methods with a prior that reasonably addresses your beliefs are intrinsically an admissible estimator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note that $\sigma$ is not a standard deviation and there is no expectation in this model.  $\beta$ is not like the OLS estimator.  It is a weaker construction.  It does satisfy the linear absolute loss function.  This model appears to have heteroskedasticity, but that is incorrect.  It is an askedastic model, not a heteroskedastic model.  Sample heteroskedasticity is what you get, with volatility clustering.  Ignore it.  That is predicted by the math for a fixed value solution.  In fact, in this case, $\sigma$ is actually a direct measure of price heteroskedasticity and simultaneously a scale parameter for the model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To test it out, download the Dow and make adjustments for the number of days that the market is closed.  Compare it to any fancy method you can think of.  You will probably want to construct your own Metropolis-Hastings algorithm.  Start with a hill climbing program and allow tens of millions of iterations and build a method to get out of local maxima.  If you get near enough to the global maximum a posteriori estimate then there is no MCMC burn in when you run the M-H algorithm.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2017-03-08T02:50:24.377" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32891" PostTypeId="1" AcceptedAnswerId="32892" CreationDate="2017-03-08T07:01:44.093" Score="2" ViewCount="142" Body="&lt;p&gt;Trading strategies often have many degrees of freedom. As a toy example let's say you have two moving averages (MA) which trigger a trade each time they cross each other: There are at least two parameters which could be optimized, namely the length of each MA.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, you would not want to bet your money on a strategy that just by chance found that you have to take 57 days for one and 243 days for the other MA (see &lt;a href=&quot;https://en.wikipedia.org/wiki/Data_dredging&quot; rel=&quot;nofollow noreferrer&quot;&gt;data snooping bias&lt;/a&gt;). What you want to see is that the strategy as such is sound per se, i.e. robust und not dependant on the exact parameter settings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way to go for two parameters is to plot a heatmap with the two parameters as axes and a colour coding for the respective return of the strategy in a backtest. If you only see noise and many convoluted regions of different return levels this is a good sign that this is not a robust strategy. If there are bigger regions of positive returns these regions merit further investigation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question&lt;/strong&gt;&lt;br&gt;&#xA;What are established methods to find robust regions of multidimensional parameter combinations in trading strategies? The challenge here: You obviously cannot visualize more than three degrees of freedom and you have to make these ideas mathematically rigorous. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Multivariate_kernel_density_estimation&quot; rel=&quot;nofollow noreferrer&quot;&gt;Multivariate kernel density estimation&lt;/a&gt; comes to mind but this is just my first idea. I am thankful for every lead, reference and code example (preferably in R).&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2017-03-08T08:29:56.997" Title="Finding robust regions of multidimensional parameter combinations in trading strategies" Tags="&lt;programming&gt;&lt;quant-trading-strategies&gt;&lt;reference-request&gt;&lt;robust-optimization&gt;&lt;kernel&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32892" PostTypeId="2" ParentId="32891" CreationDate="2017-03-08T08:21:28.317" Score="1" Body="&lt;p&gt;Not exactly the answer you're looking for: It's not obvious that a region of stability is a desirable property.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One can trivially construct an example where this is true: suppose the actual generation function of your target is $f: x_t \mapsto 2x_t+1$ over $\mathbb{R}$, and you have a signal $s$ of one parameter  $s\left(p,x_t\right)=\left(p^{e} \mod 3\right) \cdot \left(2x_t+1\right)$ where $s$ is defined over the domain of $\mathbb{R}^{+} \times \mathbb{R}$. If you try to learn some $\hat{f}\left(p,\cdot \right)=s\left(p,\cdot \right)\approx f(\cdot)$ by brute force grid search of $p$ that minimizes the RMSE followed by some smoothing transformation of your grid, you will easily end up with a model that doesn't generalize well, even though a naive optimizer might converge to $p=1$ easily.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So whatever fanciful stability function that you choose, I would test your hypothesis first.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="4660" LastEditDate="2017-03-08T08:29:56.997" LastActivityDate="2017-03-08T08:29:56.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32893" PostTypeId="1" CreationDate="2017-03-08T09:41:06.893" Score="3" ViewCount="431" Body="&lt;p&gt;since a long time I'm struggling with a particular question regarding the parametric estimation of the risk-neutral density (or implied probability) from option prices. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to pursue the parametric approach of minimizing the squared deviations from theoretical and observed prices as it is described e.g. in Bahra (1997, p. 22 and the following)  (&lt;a href=&quot;http://www.bankofengland.co.uk/archive/Documents/historicpubs/workingpapers/1997/wp66.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.bankofengland.co.uk/archive/Documents/historicpubs/workingpapers/1997/wp66.pdf&lt;/a&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As we know and as stated in equation (10) and (11) of Bahra (1997), the theoretical call and put prices are given by the discounted expected pay-offs, i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;c(X, \tau) = e^{-r\tau}\int_{S_T = K}^{\infty} q(S_{T})(S_{T} - X)dS_{T} \\&#xA;p(X, \tau) = e^{-r\tau}\int_{S_T = K}^{\infty} q(S_{T})(X - S_{T} )dS_{T},&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $X$ as the strike price, $\tau$ the time to maturity, $r$ the risk-free interest rate, $S_{T}$ the underlying asset price at maturity and $q(S_{T})$ the risk-neutral density with some specific functional form (log-normal, mixture of log-normals etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The parameters $\theta$ of the risk-neutral density are obviously unknown, and that's why we minimize the squared distance between the theoretical and the real-world call/put prices, $\hat{c}_{i},\hat{p}_{i}$ w.r.t. $\theta$, i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;min_{\theta} ( \sum_{i=1}^{n} (c(X, \tau) - \hat{c}_{i})^2 + \sum_{i}^{m}(p(X, \tau) - \hat{p}_{i})^2   )&#xA;\end{equation}  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a simplified version of eq. (17) in Bahra. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say we assume $q(S_{T})$ to be lognormal with expectation $\alpha$ and variance $\beta$. Personally, I would now use some sort of optimizer to obtain these parameters. However, in the literature of estimating the risk-neutral density, one usually further assumes that $\alpha = ln S_{t} + (\mu - 0.5\sigma^2)\tau$ and $\beta = \sigma\sqrt\tau$, where $\mu, \sigma$ are parameters of the Black-Scholes model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question now is whether we actually need to make this assumption or if we can simply optimize over two parameters that are free of any assumption?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have this concern, because in my specific case, my underlying of the option is not an asset, but interest rates, i.e. an index (this type of options is called caps and floors). Otherwise, the approach is the same, but I'm wondering whether it would make sense to assume $\alpha = ln S_{t} + (\mu - 0.5\sigma^2)\tau$ and $\beta = \sigma\sqrt\tau$ (for instance, interest rates, i.e. $S_{t}$, could be negative, which would cause a problem)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would appreciate any remarks.&lt;/p&gt;&#xA;" OwnerUserId="26908" LastActivityDate="2017-03-08T15:57:26.073" Title="Parametric estimation of risk-neutral density/implied distribution" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;interest-rates&gt;&lt;risk-neutral-measure&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32894" PostTypeId="2" ParentId="32893" CreationDate="2017-03-08T10:28:31.993" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;If you assume that, under $\Bbb{Q}$, you have the following parameteric distribution for asset prices&#xA;$$ S_T \sim logN(\alpha,\beta) $$&#xA;you can indeed directly optimise for $\alpha$ and $\beta$. However, since your objective function involves call/put &lt;em&gt;prices&lt;/em&gt; and not the density itself, you should express these prices as functions of $\alpha$ and $\beta$(*). Given the lognormal assumption, you fall-back onto the famous Black-Scholes modelling framework, hence the established link between $(\alpha,\beta)$ and $(\mu=r-q, \sigma)$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The lognormal assumption does not make sense if you are to model negative interest rates indeed. You can postulate any distribution whose support is $\Bbb{R}$ instead of $\Bbb{R}^+$ e.g.&#xA;$$ S_T \sim N(\alpha, \beta) $$&#xA;and optimise for $\alpha$,$\beta$. Again, the only thing left to be done is to find the expression call/put prices under the postulated modelling assumptions (here normal distribution, hence Bachelier model).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;(*) Actually, you could simply express the prices using the integral forms you mention in your original post, but this is less computationally efficient (requires a numerical integration) than if you use a closed-form formula, obviously.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2017-03-08T10:38:03.610" LastActivityDate="2017-03-08T10:38:03.610" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32895" PostTypeId="2" ParentId="32426" CreationDate="2017-03-08T11:36:47.247" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://www.money.net/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Money.net&lt;/a&gt; also provides an Excel add-in (details see &lt;a href=&quot;https://moneynet.atlassian.net/wiki/display/reference/Excel+Add-in+User+Guide&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="25548" LastActivityDate="2017-03-08T11:36:47.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32896" PostTypeId="1" AcceptedAnswerId="32897" CreationDate="2017-03-08T12:57:27.037" Score="1" ViewCount="812" Body="&lt;p&gt;I am having troubles with deriving the upper bounds on option prices. For example, I am trying to determine the upper bound on a European put option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I define the put price as $P$, the terminal stock price as $S_T$, the strike as $X$, the risk free rates as $r$, and the time to expiry as $T$, I am able to create the following portfolio;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Short 1 Put, and invest the proceeds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So at the outset, from the short put position I gain $P$, and I invest an equal amount at the risk free rate, giving me a net position of $0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At expiry, if $S_T &amp;gt; X$, I have zero cash flow from the short put position, and have positive cash flow of $P\text{e}^{rT}$. My net position is $P\text{e}^{rT}$, which is a non negative amount.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If however at expiry $S_T &amp;lt; X$, I have a cash flow of $-(X-S_T)$ from the short position and $P\text{e}^{rT}$ from the invested proceeds. This is a net position of $P\text{e}^{rT} - X + S_T$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From my understanding, for this to satisfy a no arbitrage condition, we need to have $P\text{e}^{rT} - X + S_T &amp;lt; 0$. Rearranging this should show that the upper bound for the put option needs to be $P &amp;lt; X\text{e}^{rT} - S_T\text{e}^{rT}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I consult sources (such as Hull), I am told the upper bound is $P &amp;lt; X\text{e}^{rT}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where is the mistake in my work? This will also help me understand the upper bounds for European call options! Thanks!&lt;/p&gt;&#xA;" OwnerUserId="26911" LastActivityDate="2017-03-11T19:02:09.893" Title="Upper bounds on option prices" Tags="&lt;options&gt;&lt;option-pricing&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32897" PostTypeId="2" ParentId="32896" CreationDate="2017-03-08T13:42:32.947" Score="2" Body="&lt;p&gt;First, I think you got discounting and compounding wrong. The upper bound for the put price is $P_0 &amp;lt; X e^{-r T}$. This has to hold as long as $S_0 &amp;gt; 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your approach is generally correct though. Assume that $P_0 = X e^{-r T}$. Then you invest $P_0$ at time $t = 0$ and have $P_0 e^{r T} = X$ at time $t = T$. Now there are three possible states in time $t = T$:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The put option expires worthless. You you have no further obligations and are left with $V_T = X$.&lt;/li&gt;&#xA;&lt;li&gt;The option expires in-the-money but $S_T &amp;gt; 0$. Then you have to pay out $P_T &amp;lt; X$ from your short put position, leaving you again with a strictly positive cash-flow $V_T &amp;gt; 0$.&lt;/li&gt;&#xA;&lt;li&gt;We have $S_T = 0$ and thus $P_T = X$. Your net cash-flow is now zero - $V_T = 0$.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;As long as $\mathbb{P} \left\{ S_T = 0 \right\} &amp;lt; 1$, this represents a free lottery arbitrage. I.e. you have a zero initial cash-flow $V_0 = 0$, a non-negative terminal cash-flow with probability one $\mathbb{P} \left\{ V_T \geq 0 \right\} = 1$ and a strictly positive terminal cash-flow with a strictly positive probability $\mathbb{P} \left\{ V_T &amp;gt; 0 \right\} &amp;gt; 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when $\mathbb{P} \left\{ S_T = 0 \right\} = 1$, then any $S_0 \neq 0$ would already represent an arbitrage by itself.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2017-03-08T13:42:32.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32898" PostTypeId="1" AcceptedAnswerId="32908" CreationDate="2017-03-08T14:20:09.243" Score="2" ViewCount="113" Body="&lt;p&gt;We have a stock price binomial tree model of $n$ steps, with step length $\Delta t=T/n$, stock price volatility $\sigma$ s.t. $u_n=e^{\sigma\Delta t}$ and $d_n=1/u_n$, and the risk neutral probability for each &quot;up&quot; movement is $p_n=(e^{r\Delta t}-d_n)/(u_n-d_n)$. It is claimed that with increasing $n$, the stock price process will in some sense approach a geometric brownian motion. The most important bridge between this discrete time model and the continuous time stochastic process is the following claim:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Let $U_n$ be the total number of &quot;up&quot;s throughout the whole period $[0,T]$, then clearly $U_n\sim B(n,p_n)$ (Bernoulli). &lt;strong&gt;By CLT&lt;/strong&gt; we have that&#xA;  $$\frac{U_n-np_n}{\sqrt{np_n(1-p_n)}}\xrightarrow{\mathrm d} N(0,1).$$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Here's how the application of CLT works &lt;em&gt;as I interpret it&lt;/em&gt;: let $X_{1,\cdots,n}^{(n)}\sim_{\text{i.i.d.}} B(1,p_n)$, then $\Bbb EX_i^{(n)}=p_n$ and $\DeclareMathOperator{\Var}{Var}\Var(X_i^{(n)})=p_n(1-p_n)$, then &lt;em&gt;pretend&lt;/em&gt; CLT is applicable here we should anticipate something like&#xA;$$\sqrt{\frac n{\Var(X_i^{(n)})}}\left(\frac{\sum_{i=1}^nX_i^{(n)}}{n}-\Bbb E(X_i^{n})\right)\xrightarrow{\mathrm d}N(0,1).$$&#xA;Acute readers may have noticed the weird superscript $(n)$ of my $X_i^{(n)}$ here - this is also exactly where I think things go wrong: I superscript $X_i$ by $n$ because they each depend on $n$, not on $i$. In other words, when $n$ increases, the distributions of &lt;em&gt;all&lt;/em&gt; members of the list $X_{1,\cdots,n}^{(n)}$ change simultaneously - not just the new coming ones but even the already existsing ones like $X_1^{(n)}$. This doesn't satisfy the conditions of any common version of CLT, which all require the members of the independent process depends only on its own its index but not any unspecified $n$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Admittedly, $X_1^{(n)}$ does converge to $B(1,\frac12)$ in probability hence in distribution, since it can be shown $p_n\to\frac12$. This however is insufficient to justify applying any CLT here. So could anybody please identify which theorem (perhaps a variant of CLT) is used in proving the convergence to standard normal?&lt;/p&gt;&#xA;" OwnerUserId="19004" LastEditorUserId="19004" LastEditDate="2017-03-08T14:30:59.827" LastActivityDate="2017-03-10T02:27:56.337" Title="Explanation on the application of CLT in bionomial tree model" Tags="&lt;stochastic-processes&gt;&lt;brownian-motion&gt;&lt;probability&gt;&lt;binomial-tree&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32899" PostTypeId="1" CreationDate="2017-03-08T15:01:23.417" Score="2" ViewCount="227" Body="&lt;p&gt;I am calculating GMV and TAN mu and sigma as well as weights using the straightforward derivations, such as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mu_{gmv}=\frac{\mathbf{1}'\boldsymbol{\Sigma}^{-1}\boldsymbol{\mu}}{\boldsymbol{\mu}'\boldsymbol{\Sigma}^{-1}\boldsymbol{\mu}},&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\sigma_{gmv}=\frac{1}{\sqrt{\boldsymbol{\mu}'\boldsymbol{\Sigma}^{-1}\boldsymbol{\mu}}},&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathbf{w}_{gmv}=\frac{\boldsymbol{\Sigma}^{-1}\mathbf{1}}{\mathbf{1}'\boldsymbol{\Sigma}^{-1}\mathbf{1}},&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mu_{tan}=\frac{\boldsymbol{\mu}'\boldsymbol{\Sigma}^{-1}\boldsymbol{\mu}}{\mathbf{1}'\boldsymbol{\Sigma}^{-1}\boldsymbol{\mu}},&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\sigma_{tan}=\frac{\sqrt{\boldsymbol{\mu}'\boldsymbol{\Sigma}^{-1}\boldsymbol{\mu}}}{|\mathbf{1}'\boldsymbol{\Sigma}^{-1}\boldsymbol{\mu}|},&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathbf{w}_{tan}=\frac{\boldsymbol{\Sigma}^{-1}\boldsymbol{\mu}}{\mathbf{1}'\boldsymbol{\Sigma}^{-1}\boldsymbol{\mu}}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we let &#xA;\begin{equation}&#xA;\begin{split}&#xA;        a &amp;amp;= \mathbf{1}'\boldsymbol{\Sigma}^{-1}\mathbf{1}\\              % ones(j) * UTU(j, k) * ones(k)&#xA;        b &amp;amp;= \mathbf{1}'\boldsymbol{\Sigma}^{-1}\boldsymbol{\mu}\\        % ones(j) * UTU(j, k) * fbar(k)&#xA;        c &amp;amp;= \boldsymbol{\mu}'\boldsymbol{\Sigma}^{-1}\boldsymbol{\mu}\\  % fbar(j) * UTU(j, k) * fbar(k)&#xA;        d &amp;amp;= ac - b ^ 2,\\&#xA;\end{split}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then the $\sigma_{eff}$ for each mean, $\mu_{eff}$, in the orthogonal portfolios on the efficient frontier line is &#xA;\begin{equation}&#xA;\sigma_{eff} =\sqrt{\frac{a \mu_{eff}^2 - 2 b \mu_{eff} + c}{d}}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I plot the efficient frontier of the daily log-returns for the DOW30 for the last two years (plotted log-scale on returns just to show the GMV mean), I noticed the mean and sigma for the tangency portfolio are much greater than the mean and sigma for the stocks themselves.   The tangency weights are also quite large as well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, the sum of the stock-specific weights for the GMV and tangency portfolios are both one, respectively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should I not use log-returns, but rather use the straightforward price returns to generate the covariance matrix $\boldsymbol{\Sigma}$ and the stock-specific mean return $\mu$? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/cnEx2.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/cnEx2.png&quot; alt=&quot;mean and sigma&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/LaVjc.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/LaVjc.gif&quot; alt=&quot;weights&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user6430" LastEditorDisplayName="user6430" LastEditDate="2017-03-08T16:56:22.730" LastActivityDate="2017-03-09T15:49:46.940" Title="Return $\mu$ and volatility $\sigma$ for tangency portfolio of DOW30 too large?" Tags="&lt;markowitz&gt;" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="32900" PostTypeId="1" CreationDate="2017-03-08T15:03:57.577" Score="2" ViewCount="1725" Body="&lt;p&gt;in the linked paper&#xA;&lt;a href=&quot;https://www.google.co.il/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0ahUKEwjfyYTZk8fSAhXjJ8AKHeuWAK4QFggYMAA&amp;amp;url=https%3A%2F%2Fwww.math.ust.hk%2F~maykwok%2Fresearch_seminars%2FTaiwan_06%2FKwok_part2_exotic_swaps-1.ppt&amp;amp;usg=AFQjCNEwe4XQPEpE3q7nkRY0yCZHhYBObg&amp;amp;sig2=WSiK5hGpEUlIQCLNH80Dww&amp;amp;bvm=bv.148747831,d.ZGg&quot; rel=&quot;nofollow noreferrer&quot;&gt;kwok_part2_exotic_swaps&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;it says the following:&#xA;&lt;em&gt;A Swedish company has recently embraced the concept of duration and is keen to manage the duration of its debt portfolio. &#xA;In the past, the company has used the Interest Rate Swap market to convert LIBOR based funding into fixed rate and as swap transactions mature has sought to replace them with new 3, 5 and 7yr swaps. &#xA;The debt duration of the company is therefore quite volatile as it continues to shorten until new transactions are booked when it jumps higher. &#xA;The Constant Maturity Swap can be used to alleviate this problem.   If the company is seeking to maintain duration at the same level as say a 5 year swap, instead of entering into a 5 yr swap,  they can enter the following Constant Maturity swap:   &#xA;The tenor of the swap is not as relevant, and in this case could be for say 5 years. The &quot;duration&quot; of the transaction is almost always at the same level as a 5yr swap and as time goes by, the duration remains the same unlike the traditional swap. &#xA;So here, the duration will remain around 5yrs for the life of the Constant Maturity Swap, regardless of the tenor of the transaction.&lt;/em&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;it is not clear to me how this can be true.  i think that both the net (outright) duration, and the key rate duration on the 5y rate will still be proportionate to how much life is left in the swap, and so on a swap with term of 10y, it would be 10 times higher than on a swap with term 1y.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any explanation much appreciated!&lt;/p&gt;&#xA;" OwnerUserId="17348" LastActivityDate="2017-03-27T20:23:09.463" Title="duration of a cms swap" Tags="&lt;duration&gt;&lt;cms&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32902" PostTypeId="1" AcceptedAnswerId="32924" CreationDate="2017-03-08T18:01:29.247" Score="1" ViewCount="139" Body="&lt;p&gt;I am just learning quantitive finance and most likely missing something really obvious here, but why is S&amp;amp;P500 gaining value outside of trading hours? Or is it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I took following data from Yahoo Finance API&lt;/p&gt;&#xA;&#xA;&lt;p&gt;SPY First Open 2010.1.1 value = 112.370003&#xA;SPY Last Close 2017.1.1 value = 223.52999900000003&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Last Close - First Open = 111.15999600000004&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next, I created series for daily value change. &#xA;Series is Close - Open for each day between 2010.1.1 - 2017.1.1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ran a sum() for my daily change for this time periods. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's sum of all daily change values and it's value = 73.64011700000037&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why it's not equal to 111.15999600000004?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below my link to my iPython notebook with the code. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://nbviewer.jupyter.org/gist/HintikkaKimmo/1ca2fe904eb504641eb7d137976d0208&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://nbviewer.jupyter.org/gist/HintikkaKimmo/1ca2fe904eb504641eb7d137976d0208&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26443" LastActivityDate="2017-03-10T00:45:01.070" Title="Why SPY gaining value overnight?" Tags="&lt;equities&gt;&lt;python&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="32903" PostTypeId="2" ParentId="32884" CreationDate="2017-03-08T21:11:19.437" Score="1" Body="&lt;p&gt;The question of how to hedge an option portfolio on multiple underlyings against tail risks is not an easy one, nor what with a single answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are probably two big risks:&#xA; - a period of increased volatility in all currencies versus MAD until the MAD settles down that the market believes to be right&#xA; - a big one-off P&amp;amp;L on a big move on MAD versus all other currencies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the latter, you could do an analysis where you assume all non-MAD exchange rates fixed and you let EUR/MAD vary from -20% to +20% (or whatever bounds people are expecting). Reevaluating the book with all xxx/MAD implied levels from those and then looking at the P&amp;amp;L and greeks versus the level should give you an idea of whether you're comfortable with the risks. You could look at vega here and estimate the impact of that on your P&amp;amp;L, but my expectation (without knowing anything of your book) is that the gamma impact from a big one-off move to a new level of trading might dwarf whatever your vega P&amp;amp;L might do.&lt;/p&gt;&#xA;" OwnerUserId="11851" LastActivityDate="2017-03-08T21:11:19.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32904" PostTypeId="2" ParentId="25370" CreationDate="2017-03-08T21:32:46.690" Score="0" Body="&lt;p&gt;There is also a version in the AQR website based on papers written by affiliated authors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.aqr.com/library/data-sets/value-and-momentum-everywhere-factors-monthly&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.aqr.com/library/data-sets/value-and-momentum-everywhere-factors-monthly&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="25458" LastActivityDate="2017-03-08T21:32:46.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32905" PostTypeId="2" ParentId="7910" CreationDate="2017-03-08T21:39:37.707" Score="1" Body="&lt;p&gt;Have you looked at Kenneth French's website or the AQR data library ? They do a good job of tracking the classic ones.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are looking for paid content, such as the one pointed out below there are plenty of vendors that provide that data although most of them are for institutional clients - look at factset, s&amp;amp;p capital iq, thomson reuters starmine, qsg, apt. Also Barra and Axioma. It is a highly commoditized product at this point.&lt;/p&gt;&#xA;" OwnerUserId="25458" LastEditorUserId="25458" LastEditDate="2017-03-09T18:12:21.977" LastActivityDate="2017-03-09T18:12:21.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32906" PostTypeId="2" ParentId="7910" CreationDate="2017-03-08T23:03:05.487" Score="0" Body="&lt;p&gt;I use &lt;a href=&quot;http://www.portfolio123.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;Portfolio123&lt;/a&gt;. It is a North American-focused equity research and trading platform targeted towards retail investors. There are tools for researching and tracking factors, designing and testing systems, screening, performance tracking, portfolio simulation, and even trading live algorithms. Some users follow others' strategies, others adapt off-the-shelf systems, while more advanced users can define their own unique systems. The focus is on North American (US and Canadian) equities and ETFs, but there are additional tools for macro-factor research and back-testing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A major selling point is that the company fundamental data, coming from S&amp;amp;P Capital IQ, is institutional quality and designed for point-in-time back-testing. Data quality makes a huge difference in mitigating look-back and survivor bias. Premium fundamental data is also, arguably, much richer in alpha than commodity fundamental data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be more work to setup a factor tracking system than a pre-configured off-the-shelf dashboard. But within a few weeks, you could easily design your own tracking system for a number of factors and using a number of tools. And you also might find something unique and therefore be able to fend off market efficiency longer than many other better known quant factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a range of user types and prices. Basic membership is intended to let user follow others and tinker around with ideas. More premium membership allows access to more advanced tools, a larger repository of systems, and longer back-test periods. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, +1 on @Cristina-Dima's suggestions regarding Quantopian and Quantpedia. Quantopian is more of a competitor with Portfolio123, while Quantpedia is surely a supplement -- I use it frequently for idea generation.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2017-03-09T01:18:23.823" LastActivityDate="2017-03-09T01:18:23.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32907" PostTypeId="1" CreationDate="2017-03-08T23:40:48.910" Score="2" ViewCount="280" Body="&lt;p&gt;i am currently analyzing a time series of portfolio log returns and have conducted a ADF test with the result, that the series is stationary, but also found significant autocorrelation in the squared return series. Is that not a contradiction, because if the series is stationary, the distribution of the returns should be independent of time and thus have a stable variance over time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My goal is to find out whether i can use the square root rule to extrapolate the standard deviation from a 1 day to a 10 day. This rule requires zero-autocorrelation in the returns ( which is given) and variance-stationarity. I am not sure, given my test results, whether this is valid. Another question is, whether this square root rule depends on the distribution, does it have to a normal one or is it independent of the distribution?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks. &lt;/p&gt;&#xA;" OwnerUserId="26565" LastEditorUserId="24222" LastEditDate="2017-06-08T19:41:20.650" LastActivityDate="2017-06-08T19:41:20.650" Title="Stationary Process with autocorrelation in Variance; square root rule" Tags="&lt;auto-correlation&gt;&lt;stationarity&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32908" PostTypeId="2" ParentId="32898" CreationDate="2017-03-09T00:08:55.007" Score="3" Body="&lt;p&gt;Thanks to  P.Windridge's comment, I can now answer my own question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed the convergence to standard normal in question can follow from a triangular array version of CLT called the Lindeberg-Feller CLT. Proof can be found on Durrett's &lt;em&gt;Probability: Theory and Examples&lt;/em&gt; (freely available online). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I reference the statement of the theorem from Durrett:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/hKVdL.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/hKVdL.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;To arrive at our desired result, simply let $X_{n,m}:=\dfrac{X_m^{( n )} - p_n}{\sqrt{n p_n (1-p_n)}}$.&lt;/p&gt;&#xA;" OwnerUserId="19004" LastEditorUserId="19004" LastEditDate="2017-03-10T02:27:56.337" LastActivityDate="2017-03-10T02:27:56.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32909" PostTypeId="1" CreationDate="2017-03-09T01:10:18.473" Score="8" ViewCount="1598" Body="&lt;p&gt;I'm a bit confused about repo settlement conventions, and let's say repos on US Treasuries (USTs).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;USTs settle $T+1$ where $T$ is the trade date.  So if today is Wed 3/8/17 and I execute a trade with someone to buy a UST, then that UST will be available in my securities account on 3/9/17 and cash to cover the purchase in theirs on 3/9/17 as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With this settlement lag of 1 day, it stands to reason that a one day repo agreement on a UST must work as follows: you negotiate with a repo dealer to borrow cash and post the UST as collateral sometime on day $T$.  On day $T+1$ collateral and cash settle in the respective accounts, and on that same day (at some point before close of business) instructions are made to execute the unwind of the repo.  That is, on $T+1$ the reverse transactions are ordered (the cash receiver remits cash back plus interest and the collateral receiver remits the UST back to the customer initiating the repo) and at the beginning of $T+2$ the unwind is settled, and thus the repo.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Viewed another way, on day $T_0$ quoted overnight repo rates are more like 1-day forward overnight rates.  That is, we could express them as $R_{t_{0}}^{[t_1, t_2)}$ (read: repo rate observed at time $t_0=0$ corresponding to accrual period $[t_1, t_2)$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To summarize and generalize a bit, if collateral underlying a repo settles on a lag of $\delta$ days, then a repo negotiated on day $T_0$ will settle on day $T_{\delta}$ (where transfers effecting the repo are executed before close of business on the trade date $T_0$) and the reverse repo will settle on $T_{2\delta}$ (where transfers effecting the repo are executed before close of business on $T_{\delta}$).  Then the repo rate quoted at $t_0$ is $R_{t_0}^{t_0+\delta, t_0+2\delta}$.  In particular, the rate is a $\delta$-forward rate of tenor $\delta$ (conclusion: you can't have a repo of term less than $\delta$ where $\delta$ is the settlement lag for the collateral.)  $\delta=3$ comes to mind for equities. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone with experience in repo markets/trading help clarify this for me?  Does collateral post immediately by special wire for repos and other overnight collateralized transactions?  One thing that occurred to me: maybe settlement is ignored and it's just the trade/execution dates that are considered---but this seems unlikely since this could lead to serious risk and clearing issues and since one repo is usually part of a long sequence of repos between multiple counterparties, one &quot;bad faith&quot; repo transaction (i.e., taking advantage of the fact that people will operate under the assumption that the collateral will clear later on when the lag is up) could cause a lot of disruption.&lt;/p&gt;&#xA;" OwnerUserId="26918" LastActivityDate="2017-10-05T15:08:04.083" Title="Repo Settlement v. Collateral Settlement" Tags="&lt;trading&gt;&lt;treasuries&gt;&lt;overnight-index&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32911" PostTypeId="2" ParentId="32907" CreationDate="2017-03-09T09:12:32.140" Score="0" Body="&lt;p&gt;for the square-root of time rule you just need uncorrelated returns. Then&#xA;$$&#xA;VAR[R_1 + \cdots + R_N] = VAR[R_1] + \cdots + VAR[R_N],&#xA;$$&#xA;then if $ VAR[R_i] =  VAR[R_j] = \sigma^2$ for $i,j = 1, \ldots, N$ then&#xA;$$&#xA;VAR[R_1] + \cdots + VAR[R_N] = N \sigma^2&#xA;$$&#xA;and&#xA;$$&#xA;\sqrt{VAR[R_1 + \cdots + R_N]} = \sigma \sqrt{N}.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fact that $R^2_i$ is not uncorrelated shows that the returns are not independent - which is not needed for the above derivation.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2017-03-09T09:12:32.140" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32912" PostTypeId="1" CreationDate="2017-03-09T11:15:04.563" Score="1" ViewCount="68" Body="&lt;p&gt;I am looking for a currency exchange rate provider (preferrably) JSON format ,  that is free/open and also reliable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anybody here have any experiences working with some solutions like this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers!!&lt;/p&gt;&#xA;" OwnerUserId="26925" LastActivityDate="2021-05-20T05:01:30.140" Title="Is there a reliable International Currency Exchange rates provider in JSON format" Tags="&lt;programming&gt;&lt;finance&gt;&lt;currency&gt;&lt;exchange&gt;&lt;rates&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32913" PostTypeId="1" AcceptedAnswerId="32922" CreationDate="2017-03-09T12:30:19.877" Score="2" ViewCount="1618" Body="&lt;p&gt;CME has a gold future expiration calendar: &lt;a href=&quot;http://www.cmegroup.com/trading/metals/precious/gold_product_calendar_futures.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.cmegroup.com/trading/metals/precious/gold_product_calendar_futures.html&lt;/a&gt; , which lists future contracts and their corresponding expiration date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to calculate the expiration dates by a set of rules, without reading this calendar page?&lt;/p&gt;&#xA;" OwnerUserId="15747" LastActivityDate="2018-09-22T11:02:47.243" Title="CME gold futures, do expiries follow any rule?" Tags="&lt;futures&gt;&lt;expiration&gt;" AnswerCount="4" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32914" PostTypeId="1" AcceptedAnswerId="32916" CreationDate="2017-03-09T12:38:52.880" Score="5" ViewCount="2243" Body="&lt;p&gt;I've recently found out about the BUS/252 accrual method used in Brazil, where, to calculate how much of the yearly accrual falls on a given period by calculating the number of business days during that period and then dividing by 252.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming a week has 5 business days we get at least 260, at most 262 business days during a calendar year. What is the reason for 252 being used - is average number of weekday bank holidays in Brazil during calendar year 9? Is there any place online where I can read more on what exactly is considered &quot;business days&quot; for this accrual method?&lt;/p&gt;&#xA;" OwnerUserId="26926" LastActivityDate="2019-02-10T00:45:12.347" Title="BUS/252 accrual - why 252?" Tags="&lt;bond&gt;&lt;accrued-interest&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32915" PostTypeId="1" AcceptedAnswerId="32918" CreationDate="2017-03-09T12:46:24.757" Score="2" ViewCount="245" Body="&lt;p&gt;I want to solve the one-touch American call at $t = 0$ with level $B,$ maturity $T$ under the following assumption:&#xA;$$d S= rSd t + \sigma SdW,\quad S_0&amp;lt;B.$$&#xA;We have following formula:&#xA;$$V(S_0,0) = \left(\dfrac{B}{S_0}\right)^{2r/\sigma^2}N(d_2)+\dfrac{S}{B}N(d_1),$$&#xA;where we ormit $d_1,d_2.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there any easy way or reference to obtain above formula?&lt;/strong&gt; I solve as this the following way, but it is very complicated:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S(t)=S_0\exp^{\sigma W(t)+(r-\dfrac{1}{2}\sigma^2)t}=S_0\exp^{\sigma \hat{w}(t)},$$&#xA;where $\hat{w}(t) = W(t) + \alpha t,\ \alpha = \dfrac{1}{\sigma}(r-\dfrac{1}{2}\sigma^2).$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then first passage time is given by&#xA;$$\tau_m = \min\{t\geq 0; W(t) = B\}=\min\{t\geq 0; \hat{w} = \hat{B}\}$$&#xA;and we have the value&#xA;$$V(S_0,0) = E[e^{-r\tau_m}\textrm{II}_{\{\tau_m\leq T\}}].$$&#xA;Here, $\textrm{II}$ is the indicator function. Then change the measure to make $\hat{W}(t)$ be a Brownian motion:&#xA;$$\hat{E}[\dfrac{1}{\hat{Z(T)}}e^{-r\tau_m}\textrm{II}_{\{\tau_m\leq T\}}] =  E[e^{-r\tau_m}\textrm{II}_{\{\tau_m\leq T\}}]$$&#xA;Here, $Z(T) = \exp(-\alpha W(t)-\dfrac{1}{2}\alpha^2)$ is the transition function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And we know the joint CDF of first passage time $\tau_m$ and $\hat{W}(t)$ under $\hat{P}$ ,finally we solve this double integral.&lt;/p&gt;&#xA;" OwnerUserId="26165" LastEditorUserId="24222" LastEditDate="2017-03-09T12:51:22.520" LastActivityDate="2017-03-09T13:29:05.923" Title="How to solve one-touch American call" Tags="&lt;stochastic-calculus&gt;&lt;american-options&gt;&lt;exotics&gt;&lt;stopping-time&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32916" PostTypeId="2" ParentId="32914" CreationDate="2017-03-09T12:46:36.940" Score="6" Body="&lt;p&gt;Business days are all weekdays excluding holidays under the respective settlement calendar. The &quot;252 business days per year&quot; rule of thumb is quite common not only in Brazil - see e.g. &lt;a href=&quot;https://en.wikipedia.org/wiki/Trading_day&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;. The reason is, as you suspected, that the average number of business days over a year are often around 252.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-03-09T16:21:10.277" LastActivityDate="2017-03-09T16:21:10.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32917" PostTypeId="1" CreationDate="2017-03-09T13:09:34.097" Score="1" ViewCount="45" Body="&lt;p&gt;&lt;code&gt;fGarch::garchSim&lt;/code&gt; provides only realizations of &lt;code&gt;y&lt;/code&gt; variable, is there way to obtain also conditional variance and time series of errors ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;garchSim(extended=TRUE)&lt;/code&gt; makes the case&lt;/p&gt;&#xA;" OwnerUserId="2044" LastEditorUserId="2044" LastEditDate="2017-03-09T14:21:05.007" LastActivityDate="2017-03-09T14:21:05.007" Title="R GARCH simulation providing whole components (y, cond.vol. etc.)" Tags="&lt;programming&gt;&lt;garch&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32918" PostTypeId="2" ParentId="32915" CreationDate="2017-03-09T13:21:37.967" Score="2" Body="&lt;p&gt;As is often the case, there are at least two solution strategies here.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;(Probabilistic)&lt;/strong&gt; You explicitly solve for the expected discount factor at the first passage time $\nu$ of $S$ to the level $B$ under the risk-neutral probability measure $\mathbb{P}^*$, i.e.&#xA;\begin{equation}&#xA;V_0 = \mathbb{E}_{\mathbb{P}^*} \left[ e^{-r \nu} \mathrm{1} \left\{ \nu \leq T \right\} \right],&#xA;\end{equation}&#xA;where $\nu$ is the first hitting time of $S$ to $B$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;(Differential Equation)&lt;/strong&gt; The option value $\tilde{V}(S, \tau)$ (as a function of the time-to-maturity $\tau$) satisfies the initial boundary value problem&#xA;\begin{eqnarray}&#xA;\mathcal{L} \left\{ \tilde{V} \right\} &amp;amp; = &amp;amp; 0 \qquad \text{for } (S, \tau) : S &amp;lt; B, \tau \in (0, \infty),\\&#xA;\tilde{V}(S, 0) &amp;amp; = &amp;amp; 0,\\&#xA;\tilde{V}(B, \tau) &amp;amp; = &amp;amp; 1, \qquad \text{for } \tau \in [0, \infty),&#xA;\end{eqnarray}&#xA;where $\mathcal{L}$ is the Black-Scholes forward operator.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You attempted the first approach. Note however, that you don't need the joint CDF of the first passage time and the terminal value of the Brownian motion as the payoff doesn't depend on the latter. So you only have a single integral to solve. See &lt;a href=&quot;http://www.matthiasthul.com/wordpress/2010/06/10/american-digital-call-option/&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; blog post for all details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, I will outline the second solution strategy. Let $U(S)$ be the valuation function of a perpetual pay-at-hit binary option. You can find the derivation of its valuation function in the answer to &lt;a href=&quot;https://quant.stackexchange.com/questions/32745&quot;&gt;this&lt;/a&gt; other question. We now notice that the solution to $\tilde{V}(S, \tau)$ can be decomposed as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\tilde{V}(S, \tau) = U(S) - \tilde{V}^1(S, \tau),&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\tilde{V}^1(S, \tau)$ satisfies the initial boundary value problem&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\mathcal{L} \left\{ \tilde{V}^1 \right\} \left( S, \tau^* \right) &amp;amp; = &amp;amp; 0 \qquad \text{for } \left( S, \tau^* \right) : S &amp;lt; B, \tau^* \in (0, \tau),\\&#xA;\tilde{V}^1(S, 0) &amp;amp; = &amp;amp; U(S),\\&#xA;\tilde{V}^1 \left( B, \tau^* \right) &amp;amp; = &amp;amp; 0 \qquad \text{for } \tau^* \in [0, \tau].&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e. the value of the pay-at-hit binary option with a finite maturity is equal to a long position in the otherwise identical perpetual option plus a short position in a knock-out barrier option on the latter. The advantage of this approach is that you can now apply the method of images to solve the auxiliary problem $\tilde{V}^1(S, \tau)$. See Wilmott et al. (1995) for details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wilmott, Paul, Sam Howison, and Jeff Dewynne (1995) &lt;em&gt;The Mathematics of Financial Derivatives&lt;/em&gt;: Cambridge University Press.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2017-03-09T13:29:05.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32919" PostTypeId="1" CreationDate="2017-03-09T13:46:15.533" Score="2" ViewCount="60" Body="&lt;p&gt;I know markets are by large anonymous, is there any current research or data sources publicly available across different exchanges and/or investment instruments on the profiles of their investors? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think any information like this will likely be an approximation, but still be interesting to see how it correlates to human behavior based strategies like momentum or mean reversal.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am looking for information like &gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the average portfolio size?&#xA;What is the average asset holding time?&#xA;% of assets hold by institutional investors?&#xA;% of trades executed by algorithms?&#xA;% trades executed by hedge funds?&#xA;What is the ratio of short vs long positions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My alternative idea is to combine several sources like 13F reports, CFTC reports for the futures to build this data. What would be good reports to look at for building this? I can handle the data cleaning and merging I just don't know the industry. &lt;/p&gt;&#xA;" OwnerUserId="26443" LastActivityDate="2017-03-09T13:46:15.533" Title="Is there any research available on profile of the market participants in different markets?" Tags="&lt;data&gt;&lt;market-data&gt;&lt;historical-data&gt;&lt;market-microstructure&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32920" PostTypeId="1" CreationDate="2017-03-09T14:55:51.160" Score="3" ViewCount="242" Body="&lt;p&gt;As far as I understand, Variance Swap (VS for short) function as follows :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;no payment when entering the contract&lt;/li&gt;&#xA;&lt;li&gt;at maturity the VS buyer pays a strike $K^2$ and is paid (by the VS seller) the realized variance over $[\textrm{today} = 0, \textrm{expiry}=T_N]$ (with prescribed constat. dates $T_i$'s), and &quot;the strike is set according to prevailing market levels so that the swap initially has zero value&quot;, that is, $\mathbf{Q}^{T_N}$ being the forward $T$ measure, so that : $$K^2 = \mathbf{E}^{\mathbf{Q}^{T_N}}\left[\frac{252}{N} \sum_{i=0}^{N-1} \left( \ln\left(\frac{S_{T_{i+1}}}{T_i}\right) \right)^2\right]$$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(Yes,to be correct the $\frac{252}{T}$ should be replaced by $1/y$ where $y$ is the year fraction represented by the time period $[\textrm{today}, \textrm{expiry}]$ but I ignore calendar effects.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously if $S$ is the S&amp;amp;P (having quite a liquid VS market), for a given &quot;standard&quot; expiry $T_N$, the strike is quoted by market, that is determined by the law of the supply and demand, without any model. Right ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, still for liquid names like the S&amp;amp;P but for non-standard strikes or expiries, I can see how we could infer strikes without a model, for instance by interpolation, I guess that it's enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But at some point, we'll need a model. My questions is : what are models used to prices VS (approximations authorized) and options on realized variance (square root payoff vol swaps for instance) in the context of algorithmic trading were we potentially have to price a lot of them as well as options on them, quite fast ?&lt;/p&gt;&#xA;" OwnerUserId="13470" LastEditorUserId="13470" LastEditDate="2017-03-10T07:22:38.337" LastActivityDate="2017-03-10T07:22:38.337" Title="Variance swap &quot;fast&quot; models" Tags="&lt;volatility&gt;&lt;swaps&gt;&lt;algorithmic-trading&gt;&lt;variance&gt;&lt;market&gt;" AnswerCount="0" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="32921" PostTypeId="2" ParentId="32899" CreationDate="2017-03-09T15:49:46.940" Score="1" Body="&lt;p&gt;Here is a solution which I discovered via comparison of using log-returns vs. returns.  I also trimmed down the number of stocks.  When using log-returns vs returns we get the following efficient frontiers.  The log-returns results in the most textbook looking plot, but note that the TAN point is way out to the right -- and that the slope of the CAPM line is low.  Whereas, the returns results in the TAN point intersecting the CAPM line near the GMV point, and the CAPM line has a very steep slope.  Overall, I think using log-returns is the way to go.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/4p5hW.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/4p5hW.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/QJtvy.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/QJtvy.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user6430" LastActivityDate="2017-03-09T15:49:46.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32922" PostTypeId="2" ParentId="32913" CreationDate="2017-03-09T17:15:43.023" Score="2" Body="&lt;p&gt;I believe the Settlement date is the &quot;minus three&quot; business day of the month. Last business day of the month is -1, day before that -2, and day before is -3. Business day means weekday (Mon-Fri) but excluding business holidays. (For example May has 31 days, but Monday 2017 May 29 is Holiday, that is why Settlement date is Friday May 26). It can be calculated by a program but you may need to enter, at the start of each year, a list of holidays for the coming year.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what about months? No contracts for July, September, and November in 2017. It appears 2018 has an inconsistent schedule.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are rules for this as well, although I don't know the details. The rules are of the form &quot;at time T such and such contracts must exist&quot;. As time moves forward new contracts are introduced. That is why the far months are sparse, those contracts do not exist yet, will be introduced later. My guess is that when March expires the JULY contract will be introduced, and will expire July 27, 2017 But that is only MY GUESS. I don't know the details of the rules, sorry. You can probably find them somewhere on the Cmegroup web site.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2017-03-09T17:15:43.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32923" PostTypeId="2" ParentId="32913" CreationDate="2017-03-09T17:43:27.950" Score="6" Body="&lt;p&gt;The rules are pretty straightforward.  I keep this rulebook on my office computer as a reference but it can be found on the CME website in the NYMEX area I believe.  Below is straight from the rulebook.  &lt;a href=&quot;http://www.cmegroup.com/rulebook/NYMEX/&quot; rel=&quot;noreferrer&quot;&gt;http://www.cmegroup.com/rulebook/NYMEX/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;113102&quot;&gt;&#xA;&lt;li&gt;TRADING SPECIFICATIONS&#xA;Trading in Gold futures is regularly conducted in the following months: (1) the current calendar &#xA;month; (2) &#xA;the next two calendar months; (3) each February, April, August and October falling &#xA;within  a  23-month  period  beginning  with  the  current  calendar  month;  and  (4)  each  June  and&lt;br&gt;&#xA;December  falling  within  a  72-&#xA;month  period  beginning  with  the  current  calendar  month&#xA;.  The&lt;br&gt;&#xA;number of months open for trading at a given time shall be determined by the Exchange.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="26556" LastActivityDate="2017-03-09T17:43:27.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32924" PostTypeId="2" ParentId="32902" CreationDate="2017-03-09T18:32:59.967" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Next, I created series for daily value change. Series is Close - Open for each day between 2010.1.1 - 2017.1.1&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;I ran a sum() for my daily change for this time periods.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;It's sum of all daily change values and it's value = 73.64011700000037&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Why it's not equal to 111.15999600000004?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;By summing Close - Open for each day you are missing several things: (1) dividends, (2)fund expense fees and (3)any other fees associated with the fund (4) extended hours trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using Close - Previous Close will capture dividend accruals as well as any fund expense accruals and any gap openings that are the result of extended hours trading.&lt;/p&gt;&#xA;" OwnerUserId="26556" LastEditorUserId="26556" LastEditDate="2017-03-10T00:45:01.070" LastActivityDate="2017-03-10T00:45:01.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32925" PostTypeId="1" CreationDate="2017-03-09T18:42:44.837" Score="3" ViewCount="825" Body="&lt;p&gt;I am a little bit confusded with respect to the PnL of a delta-neutral portfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have $$d\Pi = \Theta dt + \frac{1}{2} \Gamma \Delta S^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, if our portfolio consists of 1 call options, and we dynamically short delta in the underlying + borrow/lend whenever needed via the bank account .... what is the theta and gamma of such a portfolio? &lt;/p&gt;&#xA;" OwnerUserId="26929" LastActivityDate="2017-04-13T16:29:00.180" Title="Greeks for a portfolio? PnL for gamma trading" Tags="&lt;portfolio-management&gt;&lt;greeks&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32926" PostTypeId="1" CreationDate="2017-03-09T19:29:43.453" Score="1" ViewCount="88" Body="&lt;p&gt;I have calculated the confidence intervals of the VaR for two assets using iid bootstrap. I compute VaR using historical simulation (non-parametric). So I have two bootstrap confidence intervals (in my case percentile intervals). How can I infer on them? For example, let's say that the two intervals are overlapped: can I say that they represent the same VaR (thus the same risk)? And if they are not overlapped? Do you know if there is some statistical test useful in this case?&lt;/p&gt;&#xA;" OwnerUserId="22108" LastActivityDate="2017-03-09T19:29:43.453" Title="Inference on bootstrap confidence intervals for VaR" Tags="&lt;risk-management&gt;&lt;var&gt;&lt;bootstrapping&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32927" PostTypeId="1" AcceptedAnswerId="32963" CreationDate="2017-03-09T19:42:55.177" Score="2" ViewCount="233" Body="&lt;p&gt;A problem asks whether the following statement is true assuming the Black-Scholes Framework:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The expected return on a call option goes up as the stock price goes up.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;The solution is:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The statement is false.&lt;/p&gt;&#xA;&lt;p&gt;As the stock price increases, the call option becomes less risky, so the expected return on the call option decreases.&lt;/p&gt;&#xA;&lt;p&gt;As the stock price decreases, the call option becomes more risky, so the expected return on the call option increases.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I was hoping for a more satisfying answer, so I was wondering how I would convince myself of this mathematically.&lt;/p&gt;&#xA;&lt;p&gt;We know that &lt;span class=&quot;math-container&quot;&gt;$\gamma_\text{Call} = \Omega_\text{Call}(\alpha - r) + r$&lt;/span&gt;, where &lt;span class=&quot;math-container&quot;&gt;$\gamma_\text{Call}$&lt;/span&gt; is the continuously compounded return on the Call and &lt;span class=&quot;math-container&quot;&gt;$\Omega_\text{Call}$&lt;/span&gt; is the elasticity of the Call.&lt;/p&gt;&#xA;&lt;p&gt;We also know that &lt;span class=&quot;math-container&quot;&gt;$\Omega_\text{Call} = \frac{\Delta_\text{Call} \cdot S_0}{\text{Call Premium}}$&lt;/span&gt;. Now in the Black-Scholes model, &lt;span class=&quot;math-container&quot;&gt;$\alpha$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$r$&lt;/span&gt; are constant.&lt;/p&gt;&#xA;&lt;p&gt;So I think we only need to consider &lt;span class=&quot;math-container&quot;&gt;$\Omega_\text{Call}$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;As &lt;span class=&quot;math-container&quot;&gt;$S_0 \rightarrow \infty$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$\Delta_\text{Call} \rightarrow 1$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$\text{Call Premium} \rightarrow \infty$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Similarly, as &lt;span class=&quot;math-container&quot;&gt;$S_0 \rightarrow 0$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$\Delta_\text{Call} \rightarrow 0$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$\text{Call Premium} \rightarrow 0$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;So I think we either have an indeterminate of the form &lt;span class=&quot;math-container&quot;&gt;$\frac{\infty}{\infty}$&lt;/span&gt; or &lt;span class=&quot;math-container&quot;&gt;$\frac{0}{0}$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;For the first indeterminate, applying L'Hôpital's rule (multiple times):&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}\lim_{S_0 \rightarrow \infty} \Omega_\text{Call} &amp;amp;= \lim_{S_0 \rightarrow \infty} \frac{\Delta_\text{Call} S_0}{\text{Call Premium}} = \lim_{S_0 \rightarrow \infty} \frac{\Gamma_\text{Call} S_0 + \Delta_\text{Call}}{\Delta_\text{Call}}\\ &amp;amp;= \lim_{S_0 \rightarrow \infty} \frac{\Gamma_\text{Call} S_0 + 1}{1} = \infty.\end{align*}&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;For the second indeterminate, applying L'Hôpital's rule (multiple times):&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}\lim_{S_0 \rightarrow 0} \Omega_\text{Call} &amp;amp;= \lim_{S_0 \rightarrow 0} \frac{\Delta_\text{Call} S_0}{\text{Call Premium}} = \lim_{S_0 \rightarrow 0} \frac{\Gamma_\text{Call} S_0 + \Delta_\text{Call}}{\Delta_\text{Call}}\\ &amp;amp;= \lim_{S_0 \rightarrow 0} \frac{\Gamma_\text{Call}}{\Gamma_\text{Call}} = 1.\end{align*}&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;So, if my work is correct, as &lt;span class=&quot;math-container&quot;&gt;$S_0 \rightarrow 0$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$\Omega_\text{Call} \rightarrow 1$&lt;/span&gt; and as &lt;span class=&quot;math-container&quot;&gt;$S_0 \rightarrow \infty$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$\Omega_\text{Call} \rightarrow \infty$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Then as &lt;span class=&quot;math-container&quot;&gt;$S_0 \rightarrow 0$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$\gamma_\text{Call} = \Omega_\text{Call}(\alpha - r) + r \rightarrow \alpha$&lt;/span&gt; and  &lt;span class=&quot;math-container&quot;&gt;$S_0 \rightarrow \infty$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$\gamma_\text{Call} = \Omega_\text{Call}(\alpha - r) + r \rightarrow \infty$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;This seems to be the opposite of what the author states, so I don't know where I made my mistake.&lt;/p&gt;&#xA;" OwnerUserId="5641" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2017-03-11T23:40:03.473" Title="A more mathematically rigorous explanation for why in the B-S model, the expected return on a call goes down as the stock price goes up" Tags="&lt;black-scholes&gt;&lt;greeks&gt;&lt;self-study&gt;&lt;elasticity&gt;" AnswerCount="3" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32929" PostTypeId="1" CreationDate="2017-03-09T22:57:38.863" Score="3" ViewCount="58" Body="&lt;p&gt;I am trying to determine the pricing formula for a given claim inspired in prepayment obligations backed by mortgage portfolios $-$ I believe these were popular in the eighties. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The product mechanism is the following: consider an underlying mortgage of principal $N$ which is contracted at $t=0$ and which must be reimbursed at $t=T$, from which the principal payment has been stripped from the interest payments $-$ hence we are essentially considering a zero-coupon bond paying $N$ at $T$. However, the borrower has also the option to prepay the full amount at any time $t$ between $0$ and $T$. The buyer of the product will then get the amount $N$ when the borrower decides to pay. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, let's define the stopping time $\tau$ as the time at which the borrower decides to prepay. For example, you could assume that the borrower will prepay and subsequently refinance its mortgage if the mortgage's reference interest rate $r(t)$ decreases below a certain level $L$. In such a case, we would have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\tau = \min\{t: r(t) \leq L, \: 0\leq t\leq T\}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: &lt;strong&gt;is the price of this claim at $0$, $P_0$, given by the following risk-neutral expectation?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P_0 = \mathbb{E}^{\mathbb{Q}}\left[N\left(\mathbb{I}_{\{\tau&amp;lt;T\}}e^{-\int_0^{\tau}r(t)dt}+\mathbb{I}_{\{\tau\geq T\}}e^{-\int_0^{T}r(t)dt}\right)\right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My doubt is mainly related to the first discount factor, which goes from $0$ to $\tau$.&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-03-15T11:12:07.210" LastActivityDate="2017-03-15T11:12:07.210" Title="Price of a prepayment-based claim" Tags="&lt;pricing&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32930" PostTypeId="2" ParentId="32791" CreationDate="2017-03-09T23:10:46.567" Score="0" Body="&lt;p&gt;I believe I can answer my own question... mostly. Thank you to all who gave valuable input!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was able to demonstrate sufficiently to myself that convolution of an expected range of outcomes around a known probability distribution of outcomes converges with conventional asset and options pricing theory. I am pleased to learn that the methodology applies generally to all process in which a stochastic variable is present. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similar approaches are enumerated in several papers:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;T. Artikis, A. Voudouri. &lt;em&gt;&lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S0893965999002141&quot; rel=&quot;nofollow noreferrer&quot;&gt;A stochastic integral arising in discounting continuous cash flows and certain transformed characteristic functions&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;M. Schmelzle. &lt;em&gt;&lt;a href=&quot;https://pdfs.semanticscholar.org/ac25/a70209eeaca577c2a03c30d09d9c2275c6e2.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Option Pricing Formulae using Fourier&#xA;Transform: Theory and Application&lt;/a&gt;&lt;/em&gt; &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;and more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, if you have a known probability density function, such as a normal distribution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\phi(Z) = \frac{1}{\sqrt{2\pi}}e^{-\frac{Z^2}{2}} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi}}e^{-\frac{Z^2}{2}} = 1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ Z = \frac{1}{\sigma\sqrt{\Delta T}}(-r+\mu+\frac{(\sigma^2)}{2})(\Delta T)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma^2$ is the variance&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Delta T$ is the change in time, $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mu$ is instanteous drift, and; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r$ is the force of interest&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can be shown that for some stochastic price process, $P_t$, with a known a distribution, that convolution around a transformed risk-neutral probability density function, $\theta$, equals the expected future value at $P_T$. Let the expected $P$ at time, $T$, equal:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2)$$E^*[P_T] =f(P * \theta)(T) = \int_{-\infty}^{\infty}\theta(Z(T-\tau)) (P_0e^{\sigma*Z(T-\tau)}) {d \tau} \to P_0e^{r*T}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\theta$ is the transformation of the risk-neutral probability density function of the normal distribution such that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\theta_t = \phi(Z) (\int_{-x}^{x}{\phi(Z)dt})^{-1}$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Convolution under the risk-free distribution converges therefore with the no-arbitrage theory of asset pricing under the correct assumptions regarding the future disribution. It's a chicken and egg thing, I know, but it's still neat!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe that this approach can be adopted for pricing general quantities under uncertainty. Applying this concept to equation (1) in the original question would then yield the following relationship:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E^*[V_t] = \int_{t=0}^{T}\theta(Z(t-\tau)) \frac{dV_t}{dt}e^{r*t} d\tau $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, this approach has provided me with satisfactory results that converge with a modified Black-Scholes and discrete binomial-probability models. The convolution approach can, in fact, be used to derive risk-neutral probabilities of the cumulative density function, $\Phi$, which satisfy parameters used in closed-form solutions resembling the Black-Scholes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It should be noted that although the distribution of $\phi$ is normal, the resultant convolution around an exponential process is log-normal. Due to the resultant log-normal distribution of outcomes, this approach will result in higher present valuations when cost functions are fixed than straight DCFs. It seems that the convolution approach could be adapted for mean reverting Ornstein–Uhlenbeck processes. This would temper the upward bias somewhat, but would still assign significantly higher values to marginal projects and/or positive values to unprofitable projects in which a straight DCF would assign $0$ or negative value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, my only problem is choosing an optimal $T$. If I choose $T$ such that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$G_0e^{-d*t} - B_0^{-d*t} - F = 0 \to T = \frac{Ln(\frac{G_0-B_0}{F})}{d}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I feel like I am leaving something out because there is often some residual value to gained by increasing the $T$, yet setting $T \to \infty$ results in value destruction. Another way to see this problem is at the terminal time-node, there is still a expected positive value for running time forward. I could discretely iterate through $t$s... I could also estimate $T$ by optimizing $V_t$,.. but all that is yucky. Any ideas for a closed-form approach?&lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2017-03-13T16:29:25.453" LastActivityDate="2017-03-13T16:29:25.453" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32932" PostTypeId="1" AcceptedAnswerId="32934" CreationDate="2017-03-10T00:26:07.810" Score="3" ViewCount="1782" Body="&lt;p&gt;Stock data retrieval form Google. Example: I want to retrieve the stock data for Infosys. Infosys has two listings with the same ticker symbol but on a different exchange and in different currencies (ADR and ADS). &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;exchange: NYSE&#xA;ticker: INFY&#xA;google company id: 663089&#xA;ccy: USD&#xA;exchange timezone: America/New_York&#xA;&#xA;exchange: EPA&#xA;ticker: INFY&#xA;google company id: 853018699393258&#xA;ccy: EUR&#xA;exchange timezone: Europe/Paris&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using the google finance API in python it returns me the values for the NYSE listing. Is there a way to call the information for the other ticker in Europe as well?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;df = web.DataReader(name='INFY', data_source='google', start='20170308', end='20170308')&#xA;print(df)&#xA;&#xA;      Open   High    Low  Close   Volume&#xA;Date                                          &#xA;2017-03-08    15  15.09  14.93  14.97  5673225&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="26636" LastActivityDate="2017-03-10T22:24:57.140" Title="Google Finance API, how to retrieve identical ticker symbols in python on two exchanges" Tags="&lt;equities&gt;&lt;python&gt;&lt;google&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32933" PostTypeId="2" ParentId="32913" CreationDate="2017-03-10T00:44:03.507" Score="2" Body="&lt;p&gt;Futures contracts become physically deliverable or cash settled upon expiration.  Gold is a physically deliverable contract.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There two two very important dates for traders:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;First notice date&lt;/strong&gt; - this is the date on which the counterparty to your contract can request delivery.  Unless you are involved in the physical production/consumption of the commodity, most traders avoid this trading period.  There is a lot of additional paperwork and costs required to avoid physical delivery and most futures brokers will automatically keep you away from this period anyway.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Last trading date&lt;/strong&gt; - this is the last date on which trading can occur on the exchange.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where do you find this information?  It's in the contract specifications and trading rules published by the exchange.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For gold, the first notice date is determined by:&#xA;&lt;a href=&quot;http://www.cmegroup.com/rulebook/NYMEX/1/7.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.cmegroup.com/rulebook/NYMEX/1/7.pdf&lt;/a&gt;&#xA;&quot;The first day during which an Assignment Notification can be issued shall be the last business day of the month prior to the delivery month and shall be referred to as “First Notice Day”&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of Gold, last trading date is determined by:&#xA;&lt;a href=&quot;http://www.cmegroup.com/rulebook/NYMEX/1a/113.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.cmegroup.com/rulebook/NYMEX/1a/113.pdf&lt;/a&gt;&#xA; &quot;No trades in Gold futures deliverable in the current month shall be made after the third last business day of that month&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To determine business days you'll need a trading holiday calendar.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's possible to do all of this algorithmically - however, it's quite a job doing this across many markets with differing holidays.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CME publish their holiday schedule here:&#xA;&lt;a href=&quot;http://www.cmegroup.com/tools-information/holiday-calendar.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.cmegroup.com/tools-information/holiday-calendar.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that trading holidays vary by market.  For example, some futures will trade on certain holidays.&lt;/p&gt;&#xA;" OwnerUserId="13859" LastActivityDate="2017-03-10T00:44:03.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32934" PostTypeId="2" ParentId="32932" CreationDate="2017-03-10T01:11:23.850" Score="3" Body="&lt;p&gt;Technically speaking, you can include the exchange code along with the symbol. For example, for INFY on NYSE, you can do:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;web.DataReader('NYSE:INFY', 'google')&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it appears that Google Finance does not allow you to export EPA data, so &lt;code&gt;EPA:INFY&lt;/code&gt; wouldn't work and you'll need to find a different data provider.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2017-03-10T01:11:23.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32935" PostTypeId="2" ParentId="7000" CreationDate="2017-03-10T12:50:05.830" Score="1" Body="&lt;p&gt;Also, often we can assume the average of short-term returns in the long run to be zero, the historic volatility is equal to &#xA;     $\hat{\sigma_T^2}=\frac{\sum_{i=1}^T{r_i^2}}{T-1}$. Sp to study the volatility process we therefore study the squared return process, which is a good proxy.&lt;/p&gt;&#xA;" OwnerUserId="26565" LastActivityDate="2017-03-10T12:50:05.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32937" PostTypeId="1" AcceptedAnswerId="32939" CreationDate="2017-03-10T14:52:51.767" Score="2" ViewCount="373" Body="&lt;p&gt;It always says if the intrinsic value is greater than European call value, there will be a arbitrage opportunity，but how to construct the portfolio $(S_t - K)^+$ or how to make this arbitrage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, is it true for every derivatives?&lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-09-13T14:45:27.620" Title="How to make the arbitrage if intrinsic value is greater than European call value" Tags="&lt;arbitrage&gt;&lt;derivatives&gt;&lt;call&gt;&lt;european-options&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32938" PostTypeId="2" ParentId="32937" CreationDate="2017-03-10T15:26:15.523" Score="4" Body="&lt;p&gt;The intrinsic value of a call is the price of the underlying minus the strike (&lt;code&gt;S0-K&lt;/code&gt;), so if you find a european call whose value is &lt;em&gt;less&lt;/em&gt; that that you would:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Sell (or short) the underlying at &lt;code&gt;S0&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Use the proceeds to buy the call at &lt;code&gt;C&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;and wait.  At maturity, the price of the underlying is &lt;code&gt;Sm&lt;/code&gt;, and you will make a profit in either case:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If &lt;code&gt;Sm &amp;lt; K&lt;/code&gt;, the call is out of the money, buy you would buy Sm (to close out your short position) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;profit = &lt;code&gt;S0 - Sm - C&lt;/code&gt;, which is &gt; 0 since &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;S0 - Sm - C &amp;gt; S0 - Sm - (S0 - K)     since C &amp;lt; S0 - K&#xA;            &amp;gt; -Sm + K&#xA;            &amp;gt; 0                      since Sm &amp;lt; K , K - Sm &amp;gt; 0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If &lt;code&gt;Sm &amp;gt;= K&lt;/code&gt;, the call is in the money, and you exercise the call (which closes out your short position.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;profit = &lt;code&gt;S0 - K - C&lt;/code&gt;, which is &gt; 0 since &lt;code&gt;C &amp;lt; S0 - K&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;By the way, is it true for every derivatives?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This does not take borrowing costs (since you do not need to borrow money in this scenario) or dividends into account, but it will work on non-dividend paying equities, commodities, etc.&lt;/p&gt;&#xA;" OwnerUserId="20213" LastEditorUserId="20213" LastEditDate="2017-09-13T14:45:27.620" LastActivityDate="2017-09-13T14:45:27.620" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32939" PostTypeId="2" ParentId="32937" CreationDate="2017-03-10T15:26:53.323" Score="4" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;how to construct the portfolio (St−K)+ or how to make this arbitrage&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you have this scenario on your hands then you construct the portfolio by putting as much capital as you can into the trade.  It's an all reward and no risk scenario.  Max it out!  You &quot;make&quot; the arb by buying the call, shorting the equivalent amount the underlying at the current price and wait for expiry to realize the profit.  Beware of a pending dividend or other corporate events though!&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;By the way, is it true for every derivatives?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;No.  This will not be true for Volatility derivatives (VIX futures and options).&lt;/p&gt;&#xA;" OwnerUserId="26556" LastEditorUserId="26556" LastEditDate="2017-03-10T15:28:23.750" LastActivityDate="2017-03-10T15:28:23.750" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="32941" PostTypeId="2" ParentId="32932" CreationDate="2017-03-10T22:24:57.140" Score="1" Body="&lt;p&gt;interestingly enough, using yahoo with the right ticker symbol does give you the European prices&lt;/p&gt;&#xA;&#xA;&lt;p&gt;web.DataReader('INFY.PA', 'yahoo')&lt;/p&gt;&#xA;" OwnerUserId="26636" LastActivityDate="2017-03-10T22:24:57.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32942" PostTypeId="1" AcceptedAnswerId="32945" CreationDate="2017-03-10T22:47:59.060" Score="-1" ViewCount="231" Body="&lt;p&gt;&lt;strong&gt;Background Information:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Random-shift Halton sequence: Consider the first six Halton vectors in dimension $2$, using base $2$ and $3$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{bmatrix}&#xA;1/2\\&#xA;1/3&#xA;\end{bmatrix}, \begin{bmatrix}&#xA;1/4\\&#xA;2/3&#xA;\end{bmatrix},\begin{bmatrix}&#xA;3/4\\&#xA;1/9&#xA;\end{bmatrix},\begin{bmatrix}&#xA;1/8\\&#xA;4/9&#xA;\end{bmatrix},\begin{bmatrix}&#xA;5/8\\&#xA;7/9&#xA;\end{bmatrix}, \begin{bmatrix}&#xA;3/8\\&#xA;2/9&#xA;\end{bmatrix}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To obtain independent randomization of this set, generate two random numbers $u_1$,$u_2$ from $U(0,1)$, say, $u_1 = 0.7$ and $u_2 = 0.1$. Add the vector $u = \begin{bmatrix}&#xA;u_1\\&#xA;u_2&#xA;\end{bmatrix}$&#xA;to each vector above, componentwise, and take the fractional part of the sum. For example, the first vector becomes $$\begin{bmatrix}&#xA;\{1/2 + 0.7\}\\&#xA;\{1/3 + 0.1\}&#xA;\end{bmatrix}= \begin{bmatrix}&#xA;0.2\\&#xA;0.4\overline{3}&#xA;\end{bmatrix}$$&#xA;(here $\{x\}$ denotes the fractional part of $x$). Similarly, add $u$ to the rest of the vectors.&#xA;Here is the Pseudocode for simulating the geometric Brownian motion model:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/VZ3qr.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/VZ3qr.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Consider a European call option with parameters: $T = 1$, $K = 50$, $r = 0.1$, $\sigma = 0.3$, and $S_0 = 50$&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Use random-shift Halton sequences to obtain $40$ &quot;independent&quot; estimates for the price of the option. For each estimate, use $N = 10,000$ price paths. To simulate a path, you will simulate the geometric Brownian motion model with $\mu = r$, and using $10$ time steps $t_0 = 0$, $t_1 = \Delta t$, $t_2 = 2\Delta t,\ldots,t_{10} = 10\Delta t = T$. Use the Box-Muller method to generate the standard normal numbers.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I have been able to sucessfully use the Box-Muller method to generate the standard normal numbers which I checked are correct. I also have simulate the geometric Brownian motion model with $\mu = r$ but I am not completely sure it is correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The part that I am confused about is assuming the geometric Brownian motion model is correct how I apply the random-shift Halton sequences to obtain the $40$ &quot;independent&quot; estimates for the price of the option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I programmed the latter in C++. Here is the code which should be pretty easy to read:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#include &amp;lt;iostream&amp;gt;&#xA;#include &amp;lt;cmath&amp;gt;&#xA;#include &amp;lt;math.h&amp;gt;&#xA;#include &amp;lt;fstream&amp;gt;&#xA;#include &amp;lt;random&amp;gt;&#xA;&#xA;using namespace std;&#xA;&#xA;&#xA;double phi(long double x);&#xA;double Black_Scholes(double T, double K, double S0, double r, double sigma);&#xA;double Halton_Seq(int index, double base);&#xA;double Box_MullerX(int n, int N,double u_1, double u_2);&#xA;double Box_MullerY(int n, int N,double u_1, double u_2);&#xA;double Random_Shift_Halton(int n,int N,double mu, double sigma, double T, double S0);&#xA;&#xA;int main(){&#xA;    int n = 10;&#xA;    int N = 10000;&#xA;&#xA;    // Calculate BS&#xA;    double T = 1.0;&#xA;    double K = 50.0;&#xA;    double r = 0.1;&#xA;    double sigma = 0.3;&#xA;    double S0 = 50.0;&#xA;    double price = Black_Scholes(T,K,S0,r,sigma);&#xA;    //cout &amp;lt;&amp;lt; price &amp;lt;&amp;lt; endl;&#xA;&#xA;    // Random-shift Halton Sequence&#xA;    Random_Shift_Halton(n,N,r,sigma,T, S0);&#xA;&#xA;&#xA;}&#xA;&#xA;double phi(double x){&#xA;    return 0.5 * erfc(-x * M_SQRT1_2);&#xA;}&#xA;&#xA;double Black_Scholes(double T, double K, double S0, double r, double sigma){&#xA;    double d_1 = (log(S0/K) + (r+sigma*sigma/2.)*(T))/(sigma*sqrt(T));&#xA;    double d_2 = (log(S0/K) + (r-sigma*sigma/2.)*(T))/(sigma*sqrt(T));&#xA;    double C = S0*phi(d_1) - phi(d_2)*K*exp(-r*T);&#xA;    return C;&#xA;}&#xA;&#xA;double Halton_Seq(int index, double base){&#xA;    double f = 1.0, r = 0.0;&#xA;    while(index &amp;gt; 0){&#xA;        f = f/base;&#xA;        r = r + f*(fmod(index,base));&#xA;        index = index/base;&#xA;    }&#xA;    return r;&#xA;}&#xA;&#xA;double Box_MullerX(int n, int N,double u_1, double u_2){&#xA;    double R = -2.0*log(u_1);&#xA;    double theta = 2*M_PI*u_2;&#xA;    double X = sqrt(R)*cos(theta);&#xA;&#xA;    return X;&#xA;}&#xA;&#xA;double Box_MullerY(int n, int N,double u_1, double u_2){&#xA;    double R = -2.0*log(u_1);&#xA;    double theta = 2*M_PI*u_2;&#xA;    double Y = sqrt(R)*sin(theta);&#xA;&#xA;    return Y;&#xA;}&#xA;&#xA;double Random_Shift_Halton(int n,int N,double mu, double sigma, double T, double S0){&#xA;    //  Generate the Halton_Sequence&#xA;    double hs[N + 1];&#xA;    for(int i = 0; i &amp;lt;= N; i++){&#xA;        hs[i] = Halton_Seq(i,2.0);&#xA;    }&#xA;    // Generate two random numbers from U(0,1)&#xA;    double u[N+1];&#xA;    random_device rd;&#xA;    mt19937 e2(rd());&#xA;    uniform_real_distribution&amp;lt;double&amp;gt; dist(0, 1);&#xA;    for(int i = 0; i &amp;lt;= N; i++){&#xA;        u[i] = dist(e2);&#xA;    }&#xA;    // Add the vector u to each vector hs and take fraction part of the sum&#xA;    double shifted_hs[N+1];&#xA;    for(int i = 0; i &amp;lt;= N; i++){&#xA;        shifted_hs[i] = hs[i] + u[i];&#xA;        if(shifted_hs[i] &amp;gt; 1){&#xA;            shifted_hs[i] = shifted_hs[i] - 1;&#xA;        }&#xA;    }&#xA;&#xA;    // Use Geometric Brownian Motion&#xA;    double Z[N];&#xA;    for(int i = 0; i &amp;lt; N; i++){&#xA;        if(i % 2 == 0){&#xA;            Z[i] = Box_MullerX(n,N,shifted_hs[i+1],shifted_hs[i+2]);&#xA;        }else{&#xA;            Z[i] = Box_MullerY(n,N,shifted_hs[i],shifted_hs[i+1]);&#xA;        }&#xA;    }&#xA;    double ZZ[N + 1];&#xA;    ZZ[0] = 0.0;&#xA;    for(int i = 1; i &amp;lt;= N; i++){&#xA;            ZZ[i] = Z[i-1];&#xA;    }&#xA;&#xA;    for(int i = 1; i &amp;lt;= N; i++){&#xA;        //cout &amp;lt;&amp;lt; ZZ[i] &amp;lt;&amp;lt; endl;&#xA;    }&#xA;&#xA;    double S[N + 1];&#xA;    S[0] = S0;&#xA;    double t[n+1];&#xA;    for(int i = 0; i &amp;lt;= n; i++){&#xA;        t[i] = (double)i*T/(n-1);&#xA;    }&#xA;    for(int j = 1; j &amp;lt;= N; j++){&#xA;        for(int i = 1; i &amp;lt;= n; i++){&#xA;            S[i] = S[i-1]*exp((mu - sigma/2)*(t[i] - t[i-1]) + sqrt(sigma)*sqrt(t[i] - t[i-1])*ZZ[i]);&#xA;        }&#xA;    }&#xA;&#xA;    for(int i = 1; i &amp;lt;= n; i++){&#xA;        //cout &amp;lt;&amp;lt; S[i] &amp;lt;&amp;lt; endl;&#xA;    }&#xA;&#xA;    // Use random-shift halton sequence to obtain 40 independent estimates for the price of the option&#xA;&#xA;}&#xA;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If any one has any suggestions on what I do from here I would greatly appreciate it.&lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="19002" LastEditDate="2017-03-11T16:49:01.707" LastActivityDate="2017-03-11T16:49:01.707" Title="Use random-shift Halton sequence to obtain 40 independent estimates for the price of a European call" Tags="&lt;programming&gt;&lt;monte-carlo&gt;&lt;homework&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32943" PostTypeId="1" CreationDate="2017-03-10T23:36:36.877" Score="1" ViewCount="590" Body="&lt;p&gt;Could somebody explain the following to me:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/eXTwe.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/eXTwe.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially, an approximative (ignoring higher-order terms) formula for the change in a call-price is computed. If we delta-hedge, then delta is set to 0, giving us the last formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's what I don't get: The $\Delta$ for the call is not zero. So you can't just set it to 0, right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's true that the &quot;overall delta&quot; is 0 .... but that's not equivalent to the $\Delta$ that appears in the first and second equations in the picture. So I don't see how the text can argue that the 'overall delta' is 0, which is true, and then proceed to set the Call's $\Delta$ equal to 0?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More generally, I am looking for the theoretical PnL formula for a simple delta-hedge where 1 call option is bought, and we short delta in the underlying.&lt;/p&gt;&#xA;" OwnerUserId="26939" LastEditorUserId="16160" LastEditDate="2017-03-11T03:09:00.397" LastActivityDate="2017-03-11T03:09:00.397" Title="What is the profit and loss of a hedged call option portfolio?" Tags="&lt;portfolio-management&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32945" PostTypeId="2" ParentId="32942" CreationDate="2017-03-11T05:33:52.413" Score="1" Body="&lt;p&gt;&lt;strong&gt;Actual Question&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suppose this is homework, so I will only outline the steps. The way I understand this question is as follows:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Build a function that simulates different 10,000 sample paths of your underlying asset with 10 equidistant time steps each.&lt;/li&gt;&#xA;&lt;li&gt;For each of these paths, compute the terminal European call option payoff. Their discounted sample mean is your estimate for the European call price.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Repeat steps 1 and 2 for a total of 40 times with different randomized offset for the Halton sequences to get 40 different estimates and record the results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Other Code&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at your code, I can see quite a few issues. Here are some hints to get you started:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;You don't carry out the randomization of the Halton sequence at all. This should happen between generating standard Halton sequences and using them in the Box-Muller transform to generate random normals. The excerpt you posted is very clear on how it is done.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;This code fragment&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for(int i = 0; i &amp;lt; N; i++){&#xA;    if(i % 2 == 0){&#xA;        Z[i] = Box_MullerX(n,N,hs[i+1],hs[i+2]);&#xA;    }else{&#xA;        Z[i] = Box_MullerY(n,N,hs[i],hs[i+1]);&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;only happens to not go out-of-bounds because &lt;code&gt;N&lt;/code&gt; is even in your main.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you want to generate &lt;code&gt;N&lt;/code&gt; sample paths, then you'd want &lt;code&gt;S&lt;/code&gt; to have dimension &lt;code&gt;N&lt;/code&gt; if you just want to keep track of the current spot of each path (which is enough). I.e. &lt;code&gt;S[j]&lt;/code&gt; is the current spot of the $j$-th path and you'd have to initialize all entries in &lt;code&gt;S&lt;/code&gt; to &lt;code&gt;S0&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Consider your code fragment&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for(int j = 1; j &amp;lt;= N; j++){&#xA;    for(int i = 1; i &amp;lt;= n; i++){&#xA;        S[i] = S[i-1]*exp((mu - sigma/2)*(t[i] - t[i-1]) + sqrt(sigma)*sqrt(t[i] - t[i-1])*ZZ[i]);&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The outer loop does nothing except for heating up your CPU. You never use the loop variable &lt;code&gt;j&lt;/code&gt; but simply run the exact same inner loop &lt;code&gt;N&lt;/code&gt; times. Put differently, you simulate a single path only instead of &lt;code&gt;N&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The Box-Muller transform needs independent uniform on the unit square. You use two successive items from the same Halton sequence. If you create a scatterplot of the supposedly normal variates, you get something like the first of the below plots. The second was produced using two Halton sequences with different bases. See also the corresponding discussion in Chapter 9.3.1 of Jaeckel (2002).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/S8RTv.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/S8RTv.png&quot; alt=&quot;Halton Box-Muller gone wrong&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/eIDsp.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/eIDsp.png&quot; alt=&quot;Halton Box-Muller done right&quot;&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Jaeckel, Peter (2002) &lt;em&gt;Monte Carlo Methods in Financial Engineering:&lt;/em&gt; John Wiley &amp;amp; Sons&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-03-11T15:18:45.250" LastActivityDate="2017-03-11T15:18:45.250" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="32946" PostTypeId="2" ParentId="32929" CreationDate="2017-03-11T09:34:58.350" Score="1" Body="&lt;p&gt;What looks odd to me is that r(t) is used in two places.   First, as the mortgage reference rate , and second as the short rate ( for discounting). I would have expected these rates to differ. In the US, the reference mortgage rate is more of a long dated rate, for example.   So the formula should refer to r1(t) and r2(t) in my opinion.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-03-11T09:34:58.350" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32947" PostTypeId="1" CreationDate="2017-03-11T12:08:22.933" Score="1" ViewCount="30" Body="&lt;p&gt;Suppose&#xA;$$L(v) = \dfrac{\partial v}{\partial t} + rS\dfrac{\partial v}{\partial S} + \dfrac{1}{2}\sigma^2S^2$\dfrac{\partial^2 v}{\partial S^2} -rv$$&#xA;is Black-Scholes operator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;First version&lt;/code&gt; is &#xA;$$P = K - S, L(P)&amp;lt;0\quad 0\leq S&amp;lt; B(t).$$&#xA;$$P&amp;gt;K - S,\ L(P) =0\quad S&amp;gt; B(t)$$&#xA;$$P = \max\{K - S, 0 \},\ \dfrac{\partial P}{\partial S} = -1\quad S = B(t).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Second version&lt;/code&gt;:&#xA;$$P = \max\{K - S\}\quad 0\leq S&amp;lt; B(t).$$&#xA;$$L(P) = 0,\quad S&amp;gt;B(t)$$&#xA;$$P(S,T) = \max(K-S,0),\quad \lim\limits_{S\rightarrow\infty}P = 0;$$&#xA;$$P = K-S,\ \dfrac{\partial P}{\partial S} = -1\quad S = B(t),\ B(T) = K$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could any one tell the lack or repeat conditions in each version? Give me a correct version.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, do we need the condition $B(t) \leq K？$&lt;/p&gt;&#xA;" OwnerUserId="26165" LastEditorUserId="26165" LastEditDate="2017-03-11T12:13:26.727" LastActivityDate="2017-03-11T12:13:26.727" Title="Some confusion on american put pde" Tags="&lt;american-options&gt;&lt;differential-equations&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32948" PostTypeId="1" CreationDate="2017-03-11T13:37:22.103" Score="3" ViewCount="386" Body="&lt;p&gt;Usually, I find the units of the mean and the standard deviation of a distribution to be (quite obviously) the same. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone come up with a &lt;strong&gt;&lt;em&gt;really simple explanation&lt;/strong&gt;&lt;/em&gt; (for MBA students, some of whom are essentially “poets”, taught the absolute minimum of statistics), of the seeming paradox &lt;strong&gt;&lt;em&gt;specifically as regards the units involved&lt;/em&gt;&lt;/strong&gt;, of the subtraction of half the square of SD in calculating  the geometric rate of return: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(r-0.5*σ^2)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I should add that I have already checked the origin of this expression, via the application of Ito’s Lemma, and its relationship to the difference between the arithmetic and geometric mean in relation to the lognormal distribution, including a variety of Wikipedia entries – and even asked a couple of experts to explain, but none has been able to make clear the answer to this apparently simple question about the units involved. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Answer &lt;a href=&quot;https://quant.stackexchange.com/questions/15883/what-are-the-units-of-the-variables-appearing-in-a-standard-stochastic-different&quot;&gt;What are the units of the variables appearing in a standard stochastic differential equation for a Wiener process?&lt;/a&gt; comes close, but doesn't quite answer it sufficiently for my target audience.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best source on this seem to be &lt;a href=&quot;http://www.timworrall.com/eco-30004/bscholes.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.timworrall.com/eco-30004/bscholes.pdf&lt;/a&gt; in which Tim Worrall makes clear on p. 17 that this correction factor is in fact an approximation &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  geometric mean ≈ arithmetic mean – 0.5 variance&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I'd rather not give the students an unsatisfying “hand-waving” answer that &quot;It's a small number and the seeming difference in the units doesn’t really matter at the end of the day.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Help greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="26942" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2017-03-15T12:32:09.333" Title="How do the units compare inside the (rate - 0.5*sigma-squared) correction?" Tags="&lt;volatility&gt;&lt;statistics&gt;&lt;standard-deviation&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="32951" PostTypeId="1" CreationDate="2017-03-11T18:19:48.037" Score="2" ViewCount="1242" Body="&lt;p&gt;Probably an easy question for some, but I noticed most of my co-workers call the fair strike of a variance swap implied volatility. Why is that ?&lt;/p&gt;&#xA;" OwnerUserId="19693" LastActivityDate="2018-09-09T13:53:17.347" Title="Why is the fair strike of a variance swap called implied volatility?" Tags="&lt;options&gt;&lt;swaps&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32952" PostTypeId="1" AcceptedAnswerId="32958" CreationDate="2017-03-11T18:34:40.547" Score="1" ViewCount="1198" Body="&lt;p&gt;From this document, &lt;a href=&quot;http://quantlabs.net/academy/download/free_quant_instituitional_books_/[JP%20Morgan]%20Variance%20Swaps.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://quantlabs.net/academy/download/free_quant_instituitional_books_/[JP%20Morgan]%20Variance%20Swaps.pdf&lt;/a&gt;, on page 56, it states that &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Losses from short correlation through variance dispersion can occasionally be very large, especially since the trade becomes short volatility&#xA;  following adverse moves in correlation.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I cannot see how short correlation through variance dispersion becomes short volatility.&lt;/p&gt;&#xA;" OwnerUserId="11723" LastEditorUserId="11723" LastEditDate="2017-03-11T20:19:45.043" LastActivityDate="2017-03-11T20:19:45.043" Title="How variance dispersion trades become short volatility" Tags="&lt;options&gt;&lt;volatility&gt;&lt;correlation&gt;&lt;variance&gt;&lt;short-selling&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32953" PostTypeId="2" ParentId="24789" CreationDate="2017-03-11T18:45:52.067" Score="-2" Body="&lt;p&gt;There is, but it is rarely used, for reasons that are beyond me.  The Kelly criterion or the Kelly bet is in real world use.  You can find the original article at:&#xA;Kelly, J. L. (1956). &quot;A New Interpretation of Information Rate&quot;. Bell System Technical Journal. 35 (4): 917–926. doi:10.1002/j.1538-7305.1956.tb03809.x.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a small body of literature built around this and this is the optimal stochastic calculus solution.  The difficulty, that is generally ignored in option pricing, is determining the limiting distributions for assets, though this problem may have been solved recently.  See the proceedings of the Southwestern Finance Association conference at &lt;a href=&quot;https://editorialexpress.com/cgi-bin/conference/download.cgi?db_name=SWFA2017&amp;amp;paper_id=144&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://editorialexpress.com/cgi-bin/conference/download.cgi?db_name=SWFA2017&amp;amp;paper_id=144&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A Kelly bet is always the optimal intertemporal bet for both continuous and for discrete time-based portfolios.  Note that due to Donsker's scale invariance, it doesn't actually matter which way you conceptualize the problem.  Warren Buffet is one of the few advocates for it, and you can check to see how poorly that has worked out for Berkshire Hathaway, having taken it from $\$19$ per share to $\$262,491$ per share over 52 years.  Of course, Berkshire has to adjust for liquidity costs and that results in a smaller bet than the costless method advocated by pure stochastic calculus.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2017-03-11T18:45:52.067" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="32954" PostTypeId="1" CreationDate="2017-03-11T18:49:07.437" Score="3" ViewCount="854" Body="&lt;p&gt;I am quite new to finance and I often hear people say 'I have 2 bps of alpha' or 'I have an alpha of two bps'&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't quite understand what does this mean &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For me alpha is about predicting power. At run time have a set of measurements/features X then I have a (linear) model f()&lt;/p&gt;&#xA;&#xA;&lt;p&gt;f(X) -&gt;y gives me my estimated forward return y , which is in bps&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When people say 2 bps of alpha. Does it mean y has normal distribution whose mean is 2 bps?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am a newbie here , can anyone provide any insight? Thanks &lt;/p&gt;&#xA;" OwnerUserId="6272" LastEditorUserId="24222" LastEditDate="2017-03-12T01:02:47.747" LastActivityDate="2017-03-12T03:14:36.560" Title="What's the exact definition of alpha?" Tags="&lt;equities&gt;&lt;time-series&gt;&lt;portfolio-management&gt;&lt;performance-evaluation&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32955" PostTypeId="1" AcceptedAnswerId="32966" CreationDate="2017-03-11T18:53:57.857" Score="3" ViewCount="467" Body="&lt;p&gt;I am trying to understand a simple thing about Delta hedging in the Black-Scholes world. I know I'm doing something blatantly wrong, I just can't see it now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say I write a call option and sell it to someone. With that money, and whatever else I need to borrow, I can set-up a self-financing portfolio of stock and bond, where the amount of stock I hold at all times is Delta. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;At maturity, the value of this portfolio is exactly the payoff of the option. So if the buyer exercises the option, I can cover the pay exactly with this portfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, there's something bugging me: the final value of the portfolio is obviously calculated using the final value of the stock. Suppose that $S_T&amp;gt;K$, so the buyer exercises. In this case, I can just give him the stock I've been holding (will most likely be one unit), and receive $K$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For concreteness, I've run a simulation of daily Delta-hedging, with $S_0=49$, $K=50$ and maturity 3 months. In this particular sample path, the final price of the stock is $S_T=50.277668$. I also have at maturity Delta=1, so I hold one unit of stock, and I am short $49.37889$ bonds, so that's what I owe in dollars. This is consistent with the above: the total value of the portfolio is $(S_T-K)_+$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The option buyer thus ends up with a position of $0.2776678$. This is the value of my portfolio, so I can just give it to him and we're even. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I can also sell the stock to him for $50$, so he gets his stock at his price, I get $50$, pay back the $49.37889$ I owe, and I end up with some money. Where did this come from? &lt;/p&gt;&#xA;" OwnerUserId="25227" LastEditorUserId="24222" LastEditDate="2017-03-12T01:00:49.143" LastActivityDate="2017-03-12T01:00:49.143" Title="Basic practical question about Delta hedging" Tags="&lt;black-scholes&gt;&lt;monte-carlo&gt;&lt;delta-hedging&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="32956" PostTypeId="2" ParentId="32896" CreationDate="2017-03-11T19:02:09.893" Score="-2" Body="&lt;p&gt;Have you considered implied volatility ? It might be really high for some volatile stocks, so put price might goes to extremely high values due to iv ...&lt;/p&gt;&#xA;" OwnerUserId="26947" LastActivityDate="2017-03-11T19:02:09.893" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32958" PostTypeId="2" ParentId="32952" CreationDate="2017-03-11T19:46:04.263" Score="2" Body="&lt;p&gt;Suppose you are short the index option, and long the single stock options (all vanillas). You size it in such a way that at inception you have flat vega, you hedge out all your deltas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now assume the market moves down. All your options move away from ATM and they all have less vega (both your long single stock options, as well as ur short index option).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OTM options are long vega convexity: when implied moves up, vega moves up.&#xA;So while all your options lost vega due to moving away from the money. They will gain incremental vega due to a higher vol (assuming vol moves along the smile).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Index smile is steeper than single stock smile. So the index option - which you are short- gains more vegas relative to the single due to vega convexity. Combining it all, you are short vegas now. (both index and single lost vega due to spot move, but index lost less due to steeper smile).&lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2017-03-11T19:46:04.263" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32960" PostTypeId="2" ParentId="32954" CreationDate="2017-03-11T22:06:33.567" Score="3" Body="&lt;p&gt;In Quant Finance we start with the assumption that (until shown otherwise) no one can outperform a simple, passive benchmark. Such a benchmark might be for example the S&amp;amp;P 500 index leveraged up or down by borrowing/lending. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To calculate your alpha we would obtain your monthly returns [actually excess returns $r-r_f$] for the past N months and regress them against the benchmark return, producing two estimated coefficients, Alpha (the constant) and Beta (the linear coefficient). Beta measures the degree of leverage implicit in your strategy. A positive Alpha of say 2bps per month implies that in the past you outperformed the passive strategy by 2bps on average. Alpha is also called &quot;Jensen's Alpha&quot; and you will find ample discussion of it under this name. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice the term Alpha is used widely and sometimes indiscriminately to refer to the ability to outperform &quot;the market&quot; and everyone claims to have it even when they don't have the mathematical background to explain what it means. (Try not to be such a person).&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2017-03-12T00:26:01.383" LastActivityDate="2017-03-12T00:26:01.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32961" PostTypeId="2" ParentId="32927" CreationDate="2017-03-11T23:02:46.773" Score="0" Body="&lt;p&gt;I have a different take on this:  in the Black Scholes framework,  the expected return on all tradeable assets is the risk free rate.  It doesn't matter what the stock price is.  That's because the Black Scholes framework is an example of a risk-neutral pricing system (one in which the underlying asset has a lognormal distribution).  Hence , the expected return on any call option is the risk free rate.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-03-11T23:02:46.773" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="32962" PostTypeId="1" CreationDate="2017-03-11T23:08:33.813" Score="3" ViewCount="70" Body="&lt;p&gt;Imagine buying a call option and shorting the delta. After some time $dt$, the stock price changes, and so does the delta and the call option value. We re-adjust our hedge using this new delta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; What is the (formula for the) &lt;strong&gt;theoretical&lt;/strong&gt; change in value of such a portfolio, from one period to the very next? What is the &lt;strong&gt;actual&lt;/strong&gt; change in value? And how are those two related?&lt;/p&gt;&#xA;" OwnerUserId="26948" LastActivityDate="2017-03-11T23:08:33.813" Title="Delta hedging and PF-value" Tags="&lt;options&gt;&lt;hedging&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32963" PostTypeId="2" ParentId="32927" CreationDate="2017-03-11T23:34:39.910" Score="2" Body="&lt;p&gt;I think you nearly got there but made a few mistakes in the application of l'Hopital's rule.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;First Limit&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the first case, you got&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\lim_{S_0 \rightarrow \infty} \Omega &amp;amp; = &amp;amp; \lim_{S_0 \rightarrow \infty} \frac{\Gamma_{\text{call}} S_0 + \Delta_{\text{call}}}{\Delta_{\text{call}}}\\&#xA;&amp;amp; = &amp;amp; \lim_{S_0 \rightarrow \infty} \frac{\Gamma_{\text{call}} S_0 + 1}{1}&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and you seem to conclude that $\lim_{S_0 \rightarrow \infty} \Gamma_{\text{call}} S_0 = \infty$ and thus $\lim_{S_0 \rightarrow \infty} \Omega = \infty$. This is not true however. Remember that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\Gamma_{\text{call}} = \frac{\mathcal{N}' \left( d_+ \right)}{S_0 \sigma \sqrt{T}}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and thus&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\lim_{S_0 \rightarrow \infty} \Gamma_{\text{call}} S_0 = \lim_{S_0 \rightarrow \infty} \frac{\mathcal{N}' \left( d_+ \right)}{\sigma \sqrt{T}} = 0.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consequently $\lim_{S_0 \rightarrow \infty} \Omega_{\text{call}} = 1$ as postulated by the sample solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Second Limit&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I agree with you up to the point where you have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\lim_{S_0 \rightarrow 0} \Omega_{\text{call}} = \frac{\Gamma_{\text{call}} S_0 + \Delta_{\text{call}}}{\Delta_{\text{call}}}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which results in a $0 / 0$ situation. However, when you apply l'Hopital's rule again now, you don't apply the chain rule correctly and forgot to differentiate gamma. I get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\ldots = \lim_{S_0 \rightarrow 0} \frac{\mathcal{S}_{\text{call}} S_0 + 2 \Gamma_{\text{call}}}{\Gamma_{\text{call}}}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where I use $\mathcal{S}_{\text{call}}$ to denote the third derivative w.r.t. the spot (the speed). It is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathcal{S}_{\text{call}} = -\frac{\Gamma_{\text{call}}}{S_0} \left( \frac{d_+}{\sigma \sqrt{T}} + 1 \right).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We thus get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\ldots = \lim_{S_0 \rightarrow 0} \left\{ -\left( \frac{d_+}{\sigma \sqrt{T}} + 1 \right) + 2 \right\}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, since $\lim_{S_0 \rightarrow 0} d_+ = -\infty$, this yields $\lim_{S_0 \rightarrow 0} \Omega_{\text{call}} = \infty$ as postulated by the sample solution.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-03-11T23:40:03.473" LastActivityDate="2017-03-11T23:40:03.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32964" PostTypeId="2" ParentId="32927" CreationDate="2017-03-11T23:37:50.367" Score="0" Body="&lt;p&gt;I'll define expected return as $\mathbb{E}\left[\frac{H(T)-V(0)}{V(0)T}\right]$ where $V(0)$ is the current Black Scholes price and $H(T)$ is the payoff function.  The expectation is under the real world measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $V(0)$ is known, the only stochastic element in the expectation is the expected value of the payoff.  This is $$S_0 e^{\alpha T} N\left(\hat{d_1}\right)-KN\left(\hat{d_2}\right)$$ where $\hat{d_1}=\frac{log\left(\frac{S_0}{K}\right)+(\alpha+\sigma^2 /2 )T }{\sigma \sqrt{T}}$ and $\hat{d_2}=\hat{d_1}-\sigma \sqrt{T}$.  Putting the equations together, the expected return is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{S_0 \left(e^{\alpha T}N\left(\hat{d_1}\right)-N\left(d_1\right)\right)-K\left(N\left(\hat{d_2}\right)-e^{-rT} N\left(d_2\right)\right)}{\left(S_0 N\left(d_1 \right)-Ke^{-rT}N\left(d_2\right)\right)T}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At first glance this would seem to confirm that the expected value declines since the term multiplying $S_0$ in the numerator will be close to zero while the term in the denominator moves quite strongly with $S_0$.  &lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2017-03-11T23:37:50.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32966" PostTypeId="2" ParentId="32955" CreationDate="2017-03-12T00:45:36.057" Score="4" Body="&lt;p&gt;As has been remarked in the comments already, the standard deviation of your hedging error should approach zero as your re-hedging frequency (the number of time steps) increases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a sample plot of how it should behave like. It was generated using $T = 1$, $K = 100$, $S_0 = 100$, $r = 5\%$, $\sigma = 20\%$ and 1,000 sample paths.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/IKc1J.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/IKc1J.png&quot; alt=&quot;convergence of the hedging error&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just as a sanity check - here is the same plot but with the mean hedging error, which fluctuates around zero with decreasing deviations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/pmDsB.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/pmDsB.png&quot; alt=&quot;unbiasedness of the hedging error&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you didn't provide your code, I created a simple Jupyter notebook for this that you can clone from &lt;a href=&quot;https://github.com/MatthiasThul/DeltaHedgingSimulation&quot; rel=&quot;nofollow noreferrer&quot;&gt;GitHub&lt;/a&gt;. This should hopefully help you debug your own program.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2017-03-12T00:45:36.057" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32967" PostTypeId="2" ParentId="32954" CreationDate="2017-03-12T00:46:04.030" Score="3" Body="&lt;p&gt;As @Alex C had pointed out, the CAPM and subsequently Jensen were probably the original motivations of the term $\alpha$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bear in mind that $\alpha$ and $\beta$ are conventional notation for coefficients in a linear regression model, and quite easily as that, we can understand the intuition by thinking of this as an explanatory linear model of portfolio returns against market return. If you rewrite the conventional expression of $\alpha$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\underset{y}{\underbrace{r_p}} = \underset{c}{\underbrace{\left(\alpha + r_f\right)}} + \underset{m}{\underbrace{\beta}}\cdot\underset{x}{\underbrace{\left(r_m-r_f\right)}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $r_p$, $r_f$, $r_m$ are your portfolio, risk-free and market rates of return. As you can see underneath my equation, this is really just the conventional linear model that we are familiar with.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea here is that you are trying to explain how much of your portfolio performance comes from simple market exposure, the risk-free rate and 'outperformance' of the market. Your outperformance should be a constant function of the market return so it should go into the intercept term. Here, we abuse the notation slightly and say that $\alpha$ is the amount by which the intercept that exceeds the risk-free rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This brings us to your question:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Does it mean y has normal distribution whose mean is 2 bps?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;No, this just means that we assume (by prescribing a linear model) that the residual $\epsilon$ is normally distributed:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\hat{r}_p = \left(\alpha + r_f\right) + \beta\left(r_m-r_f\right) + \mathbb{O}\left(\epsilon\right)$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and $\alpha = 0.02\%$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is all quite simple, this leaves us remaining problem - why do people seem to refer to different things when they use the term nowadays?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason there's confusing definitions of $\alpha$ is that subsequently, people tried explaining $r_p$ with multiple regressors that we consider public information and should be priced into assets, e.g. price-to-book ratio (value factor), market capitalization (size factor), momentum etc. One would argue just as it requires no skill to operate a portfolio that has high return simply because of 1:1 exposure to a high market return, it requires no skill if your portfolio returns can be explained by these commonly accessible data points, so now $\alpha$ should be redefined as what additional 'secret sauce' you have modulo all these terms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To take this to the extreme, one might argue that famed value investors like Warren Buffett have no skill at all as their alpha term would be close to 0 if they are concentrated on buying value stocks.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="4660" LastEditDate="2017-03-12T03:14:36.560" LastActivityDate="2017-03-12T03:14:36.560" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32968" PostTypeId="1" CreationDate="2017-03-12T01:18:06.730" Score="4" ViewCount="835" Body="&lt;p&gt;How does the change in FX volatility affect the counterparty risk of an FX-forward? &#xA;Should it not be riskless since the forward itself is &quot;protecting&quot; the exchange rate fluctuations?&lt;/p&gt;&#xA;" OwnerUserId="18211" LastEditorUserId="24222" LastEditDate="2017-03-12T01:30:07.520" LastActivityDate="2017-04-15T15:45:23.773" Title="Volatility and Counterparty risk for FX Forward" Tags="&lt;volatility&gt;&lt;risk&gt;&lt;fx&gt;&lt;forward&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32970" PostTypeId="2" ParentId="24414" CreationDate="2017-03-12T02:56:56.983" Score="0" Body="&lt;p&gt;Correct me if I am mistaken but since you are trying to price a forex option, wouldn't it be more appropriate to use the Garman and Kohlhagen extended Black-Scholes model since it better copes with the presence of the two interest rates associated with each currency respectively?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Also, LIBOR rates were considered a useful measure of the risk free rate (the rate taken closest to option expiration) due to its proximity to the overnight indexed swap (OIS) rates. Since 2007 however (and as a result of the financial crisis), the LIBOR-OIS spread has spiked and become unstable . John Hull has a very popular paper on this topic.&quot;&#xA;&lt;a href=&quot;http://www-2.rotman.utoronto.ca/~hull/DownloadablePublications/LIBORvsOIS.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www-2.rotman.utoronto.ca/~hull/DownloadablePublications/LIBORvsOIS.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;John Hull said: &quot;Most derivatives dealers now use interest rates based on overnight indexed swap (OIS) rates rather than LIBOR when valuing collateralized derivatives. For non-collateralized transactions, most dealers continue to use LIBOR rates for valuation.&quot; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most of this information was taken from a thread with the link below: &#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/28287/risk-free-rate-vs-libor&quot;&gt;Risk Free Rate vs LIBOR&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26952" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2017-03-12T02:56:56.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32971" PostTypeId="2" ParentId="31800" CreationDate="2017-03-12T07:11:46.797" Score="0" Body="&lt;p&gt;Yes, the 'delta' has correlation with 'theta'. It is called 'second-order greek Charm' .  For OTM options, the delta in last few days of trading is approaching 0(zero), while for ITM options delta approaching 1(one) in last few days of trading. &#xA;here few examples:&#xA;example_1: &#xA;price of underlying = $100, strike = 110, interest rate = 1, implied volatility = 100 . (out of the money call option)&#xA;&lt;a href=&quot;https://i.stack.imgur.com/JviE9.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/JviE9.png&quot; alt=&quot;delta tends to move closer to 0&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;example_2:&#xA;price of underlying = $100, strike = 90, interest rate = 1, implied volatility = 100 . (in the money call option) &#xA;&lt;a href=&quot;https://i.stack.imgur.com/lTTGP.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/lTTGP.png&quot; alt=&quot;delta tends to move closer to 1&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;more details could be found at this article:&#xA;&lt;a href=&quot;https://optionstrade.info/delta-vs-time-decay/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://optionstrade.info/delta-vs-time-decay/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26947" LastEditorUserId="26947" LastEditDate="2017-03-14T18:15:18.213" LastActivityDate="2017-03-14T18:15:18.213" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32972" PostTypeId="1" CreationDate="2017-03-12T11:55:08.440" Score="2" ViewCount="62" Body="&lt;p&gt;analyzing the correlation between soybean and soybean meal futures in ECBOT, and making a linear regression in R between them I check with an ADF Test that the residuals are not stationary, so theoretically both series are not cointegrated, else they have a spurious relationship.&#xA;But, has this sense? They are over the same underlying and highly correlated (not like Soybean Oil and Soybean futures that have poor correlation).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers,&#xA; Gonzalo.&lt;/p&gt;&#xA;" OwnerUserId="22739" LastActivityDate="2017-03-12T11:55:08.440" Title="Spurious regression between two futures with the same underlying highly correlated (cor=0.9)" Tags="&lt;programming&gt;&lt;futures&gt;&lt;regression&gt;&lt;cointegration&gt;&lt;spread&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32973" PostTypeId="1" CreationDate="2017-03-12T12:48:55.407" Score="4" ViewCount="217" Body="&lt;p&gt;I want to thoroughly learn about technical analysis, or more exactly, how technical indicators or overlays are used in quantitative trading strategies. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Being a beginner to the area, I can't understand most of the terminology when I read up about indicators (e.g. on stockcharts.com), and just google the terms that I can't understand. But this way of learning seems too haphazard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anyone please suggest an intro-level book that explains not only the technical indicators/overlays, but also the basic concepts (like whipsaw, short/long stop, retracement, divergence, breakout, etc.) that are essential to understand while learning technical analysis?&lt;/p&gt;&#xA;" OwnerUserId="19057" LastActivityDate="2018-07-02T16:37:49.303" Title="Reference request : Introductory technical analysis" Tags="&lt;trading&gt;&lt;reference-request&gt;&lt;technical-analysis&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32974" PostTypeId="1" AcceptedAnswerId="32975" CreationDate="2017-03-12T14:18:53.683" Score="6" ViewCount="9856" Body="&lt;p&gt;&lt;a href=&quot;http://www.volcube.com/resources/options-articles/gamma-hedging-trading-strategies-part-i/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.volcube.com/resources/options-articles/gamma-hedging-trading-strategies-part-i/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to have proven to me the above formula, mostly because I don't quite understand it. The formula is an approximation of the profit from gamma trading/gamma hedging, $$0.5 \Gamma (\Delta S)^2$$&#xA;So, my questions are, how to prove that, and secondly, what does it mean &lt;em&gt;exactly&lt;/em&gt; by &quot;profit&quot;?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Today, an ATM 1-year 25 % volatility call is bought for 10, and we short $\Delta = 0.5$ in the underlying, which is worth 100. So working that out, we get portfolio value $\Pi = 10 - 50 = -40$, our portfolio value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some time later, the spot goes up to 105. The call goes up in value, from 10 to 13. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently we have shorted $0.5$ of the underlying, so we owe $0.5 \cdot 105 = 52.5$, so we have $\Pi = -39.5$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So profit is 0.5. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then we perform our re-hedge: if delta moved from 0.5 to 0.6, then we need to short 0.1 of the underlying. So, we add $-10.5$ to $\Pi$, i.e, $\Pi = -50$.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Where does the formula from above come into the picture here?&lt;/p&gt;&#xA;" OwnerUserId="26148" LastEditorUserId="24222" LastEditDate="2017-03-12T15:49:50.300" LastActivityDate="2017-03-12T15:49:50.300" Title="Proof of gamma profit formula" Tags="&lt;delta-hedging&gt;&lt;gamma&gt;&lt;delta-neutral&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="32975" PostTypeId="2" ParentId="32974" CreationDate="2017-03-12T15:07:01.117" Score="7" Body="&lt;p&gt;Assume you buy a plain vanilla call option at the price $V$ and the spot $S$. You immediately delta hedge buy selling $\partial V / \partial S$ units of the underlying asset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The underlying asset now &lt;em&gt;instantaneously&lt;/em&gt; jumps form $S$ to $S' = S + \Delta S$. The new value of the call option is $V'$. Your total p&amp;amp;l is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\text{P&amp;amp;L} = V' - V - \frac{\partial V}{\partial S} \Delta S.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can expand the change in the option price to the second order as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;V' = V + \frac{\partial V}{\partial S} \Delta S + \frac{1}{2} \frac{\partial^2 V}{\partial S^2} (\Delta S)^2 + \mathcal{O} \left( (\Delta S)^3 \right).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Substituting back yields&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\text{P&amp;amp;L} = \frac{1}{2} \frac{\partial^2 V}{\partial S^2} (\Delta S)^2 + \mathcal{O} \left( (\Delta S)^3 \right).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is visualized in the below plots. They are based on $T = 1 / 12$, $K = 100$, $S = 100$, $r = 0\%$, $\sigma = 20\%$. The blue (green) line is the p&amp;amp;l of holding a long (short) position in the call option (underlying asset). The red line is the actual net portfolio p&amp;amp;l and the yellow one is the second order approximation of the latter using the gamma.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/gzoIQ.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/gzoIQ.png&quot; alt=&quot;delta hedging p&amp;amp;l&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-03-12T15:23:21.640" LastActivityDate="2017-03-12T15:23:21.640" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="32977" PostTypeId="2" ParentId="32797" CreationDate="2017-03-12T19:12:27.913" Score="2" Body="&lt;p&gt;The way I managed to solve this was by scrapping the broker website and compile a list containing  &lt;code&gt;Symbol&lt;/code&gt;, &lt;code&gt;Primary Exchange&lt;/code&gt;, &lt;code&gt;Tick Increment&lt;/code&gt;, &lt;code&gt;ISIN&lt;/code&gt;, &lt;code&gt;CONID&lt;/code&gt;, &lt;code&gt;ASSETID&lt;/code&gt; of 6589 Equities from &lt;strong&gt;NASDAQ&lt;/strong&gt;, &lt;strong&gt;NYSE&lt;/strong&gt; and &lt;strong&gt;AMEX&lt;/strong&gt;.&lt;br&gt;&#xA;   Here's a &lt;a href=&quot;https://gist.githubusercontent.com/x011/f43cb959845fcc24aad6ab18325c49b0/raw/834391b6a822419e86ee793ad5f16bbe354429c9/Interactive%2520Brokers%2520Equities%2520(NASDAQ,%2520NYSE,%2520AMEX)%2520-%2520Symbol,%2520Primary%2520Exchange,%2520Tick%2520Increment,%2520ISIN,%2520CONID,%2520ASSETID.txt&quot; rel=&quot;nofollow noreferrer&quot;&gt;gist&lt;/a&gt; of the list:&lt;/p&gt;&#xA;" OwnerUserId="26550" LastEditorUserId="26550" LastEditDate="2017-03-12T19:48:13.523" LastActivityDate="2017-03-12T19:48:13.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32979" PostTypeId="2" ParentId="18004" CreationDate="2017-03-13T01:53:42.060" Score="1" Body="&lt;p&gt;If you want to test actually trading functions (simulate indicator's visual calculations) in a simulated market environment, then you need to use the built-in 'Tester' function to backtest your strategy or indicator (indicator backtesting is limited to &lt;code&gt;visual mode&lt;/code&gt; only).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit:  to maximize the accuracy of the test, consider running the test using the &lt;code&gt;every tick&lt;/code&gt; Model.  Now mt4 will generate its own simulated ticks based on the OHLC of the bars of the data range.  This could take a while.  Much more accurate to use actual ticks.  Mt4 does not support direct import of sub-minute/tick data, but this can be &quot;injected&quot; using &lt;a href=&quot;https://eareview.net/tick-data-suite&quot; rel=&quot;nofollow noreferrer&quot;&gt;Birt's Tick Data Suite&lt;/a&gt;. v2 has pretty much automated the tick collection, and integration into mt4 tester process.  Before, you had to manually create the fxt files by hand, copy them to the terminal(s) you wanted to test on.  And you had to recreate the fxt files anytime you want to run on more recent data than the existing fxt had..  That could be every day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to make sure EA can initialize properly, you can use a fake tick sender program like &lt;a href=&quot;https://fx1.net/mt4ticker.php&quot; rel=&quot;nofollow noreferrer&quot;&gt;Ticker&lt;/a&gt; or &lt;a href=&quot;https://fx1.net/mt4bar.php&quot; rel=&quot;nofollow noreferrer&quot;&gt;MT4Bar&lt;/a&gt;.  It simulates ticks being sent to mt4 client so the EA can initialize properly and run certain calculations that require onTick().&lt;/p&gt;&#xA;" OwnerUserId="2566" LastEditorUserId="2566" LastEditDate="2018-06-05T16:12:12.660" LastActivityDate="2018-06-05T16:12:12.660" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="32980" PostTypeId="1" CreationDate="2017-03-13T09:42:55.343" Score="1" ViewCount="262" Body="&lt;p&gt;I am an economic last year student trying to figure out how to backtest my model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It consist on several requirements imposed to the stocks before buying them and a very simple exit strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I first impose the condition to the stocks of showing improvement in the following parameters:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Return on Equity &lt;/li&gt;&#xA;&lt;li&gt;Gross margin&lt;/li&gt;&#xA;&lt;li&gt;Sales&lt;/li&gt;&#xA;&lt;li&gt;Leverage&lt;/li&gt;&#xA;&lt;li&gt;Being above its 200 daily arithmetic mean&lt;/li&gt;&#xA;&lt;li&gt;Achieve at least three increasing minimums&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Each company receives one point for each requirement accomplished, ranging from zero to six.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My idea is to make a regression between the returns of the stocks and the punctuation obtained in the test to see if there is a positive correlation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think that it may be very simple but since I just started in the quant finance it would be great to have some feedback and recommendations about how to improve my backtesting.&lt;/p&gt;&#xA;" OwnerUserId="26970" LastEditorUserId="24222" LastEditDate="2017-03-13T10:13:15.617" LastActivityDate="2017-03-15T14:15:36.310" Title="Backtesting of value and technical analysis" Tags="&lt;backtesting&gt;&lt;fundamentals&gt;&lt;technical-analysis&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32981" PostTypeId="1" CreationDate="2017-03-13T09:45:50.980" Score="3" ViewCount="236" Body="&lt;p&gt;let's assume that interest rates are constant, $r$. When $r\geq 0$, we can see that if $T_1&amp;lt;T_2$ and $C_1$ (resp. $C_2$) is the price of a call option on a non-dividend paying stock with maturity $T_1$ (resp. $T_2$), then $C_1&amp;lt;C_2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to understand what happens when $r&amp;lt;0$. But all I have are the optimal bounds $S_0-KB_i &amp;lt; C_i &amp;lt; S_0$, where $K$ is the strike price and $B_i=e^{-rT_i}$. I can't seem to deduce any consequences from this alone. &lt;/p&gt;&#xA;" OwnerUserId="25227" LastActivityDate="2018-01-17T16:07:41.187" Title="Call option prices in terms of maturity with negative interest rates" Tags="&lt;interest-rates&gt;&lt;call&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32982" PostTypeId="2" ParentId="32968" CreationDate="2017-03-13T10:23:42.080" Score="1" Body="&lt;p&gt;Well yeah the whole point of an &lt;a href=&quot;http://www.webstersystems.co.uk/fxmm.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;FX forward&lt;/a&gt; is to insure the counterparty from FX and interest rate risk. The future cashflows are fixed whatever the FX and interest rate volatility. However, since no cashflows actually take place until value date then to deal with counterparty risk then collateral is usually required. I think that's going to be a &lt;a href=&quot;http://www.euromoney.com/Article/3545686/FX-The-missing-piece-in-the-margin-puzzle.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;requirement in Mifid II&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2017-03-13T10:23:42.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32983" PostTypeId="2" ParentId="32968" CreationDate="2017-03-13T10:30:08.607" Score="2" Body="&lt;p&gt;I think the misunderstanding here is that the 'protection' that the FX Forward offers can turn into a counterparty risk in the end of the day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To put it simply, if you lock for yourself a nice rate and the market moves downwards then are you sure that your counterparty will be able to pay you on the maturity date?&lt;/p&gt;&#xA;" OwnerUserId="22383" LastActivityDate="2017-03-13T10:30:08.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32984" PostTypeId="1" CreationDate="2017-03-13T10:43:59.107" Score="2" ViewCount="3247" Body="&lt;p&gt;Can any one tell me, why &lt;code&gt;futures contract has no value&lt;/code&gt;? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know that the value of  future(Maybe I confuse the concept of &lt;code&gt;future value&lt;/code&gt; and &lt;code&gt;future price&lt;/code&gt;):&#xA;$$\textrm{Fut}(t,T) = \widetilde{E}[S(T)|\mathcal{F}_t]$$&#xA;How can it be zero? We only have the discounted value of cash flow is zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/7iiw7.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/7iiw7.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And why in the forward contract, $F$ is not zero in the $\Pi = V(S,t) - \delta S - \delta_1 Z.$ But just set $V = 0$ to obtain the forward price, it is unreasonable.&#xA;&lt;a href=&quot;https://i.stack.imgur.com/PPzmw.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/PPzmw.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26165" LastEditorUserId="26165" LastEditDate="2017-03-13T11:14:43.297" LastActivityDate="2017-03-13T12:51:40.717" Title="why futures contract has no value" Tags="&lt;futures&gt;&lt;derivatives&gt;&lt;differential-equations&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32985" PostTypeId="2" ParentId="32984" CreationDate="2017-03-13T11:03:32.113" Score="1" Body="&lt;p&gt;The &lt;em&gt;value&lt;/em&gt; of a futures contract is the forward value of the payment, discounted back to today -&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;V(t,T) = e^{-r(T-t)} \mathbb{E} \left[ S(T) - F | \mathcal{F}_t \right]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the &lt;em&gt;price&lt;/em&gt; of a futures contract is the price $F$ that gives the contract zero present value -&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align}&#xA;F &amp;amp; = \mathbb{E}\left[ S(T) | \mathcal{F}_t\right] \\&#xA;  &amp;amp; = S(t)e^{r(T-t)}&#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that as soon as you have entered a futures contract, the price $F$ is now fixed, which means that in general the futures contract no longer has zero present value (the same is true of a forward contract).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your margin account at the exchange is credited or debited at the end of every day to take account of your profit/loss on the contract. This is the primary difference between futures and forwards - on a forward contract, you accumulate a non-zero present value on the contract over time, which is all realized at maturity. On a futures contract you realize your profit/loss as you go, and this requires financing (you need to fund your losses, and can invest your gains).&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2017-03-13T11:03:32.113" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="32986" PostTypeId="1" AcceptedAnswerId="32998" CreationDate="2017-03-13T11:29:39.963" Score="1" ViewCount="52" Body="&lt;p&gt;I am building a simple stock model with Pandas and part of that is calculating moving averages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to understand what are and how to measure accuracy implications of using strict vs dynamic time window size when calculating long-term moving averages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example what I mean:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a csv file with TLSA stock history between 1.1.2000 - 28.2.2017&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;df = pd.read_csv('TSLA.csv', index_col=0, parse_dates=True)&#xA;# add new col to dataframe consisting of a 100 day moving avarage&#xA;df['100ma'] = df['Adj Close'].rolling(window=100, min_periods=0).mean()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;min_periods=0 allows me to calculate moving average for the first 100 days where don't have 100 days using first 0, 1, 2, 3... moving average.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My alternative to this is call &lt;code&gt;df.dropna()&lt;/code&gt; it would drop first 100 rows that don't have a 100-day moving average. Downside I would have exact average but fewer data points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am building a tool using a large number of moving averages. What would be a correct method to figure which data frame to use? Correlation to a moving average of a representing stock index? Also which technique is usually applied in the quant world? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuitively I think dynamic version is more representing but is that true also with minute and shorter timeframe data? &lt;/p&gt;&#xA;" OwnerUserId="26443" LastActivityDate="2017-03-13T16:09:02.520" Title="How a chose between strict vs dynamic measurement of moving average" Tags="&lt;statistics&gt;&lt;python&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32987" PostTypeId="1" CreationDate="2017-03-13T11:44:23.947" Score="3" ViewCount="5966" Body="&lt;p&gt;I have been calculating daily carry on a normal bond as the difference in yields from one day to the next (roll down basically), interpolating the yield on one day, and interpolating it for the previous business day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, how do we calculate this for a bond future? Is it sufficient to take the Cheapest To Deliver (CTD) and do the same calculation as above?&lt;/p&gt;&#xA;" OwnerUserId="20531" LastActivityDate="2018-01-18T14:38:55.880" Title="How to calculate the daily carry on a bond future?" Tags="&lt;bond&gt;&lt;bond-futures&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32988" PostTypeId="1" CreationDate="2017-03-13T11:51:56.340" Score="3" ViewCount="1030" Body="&lt;p&gt;I have to calculate probability of default (PD) rates for our clients (I am working in a Bank) based on clients' financials. Could you, please, advise me how to do that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think we have two Options:&#xA; 1. Calculate PDs for each client based on their financial Statements,&#xA; 2. We have internal ratings (again based on financials) that we are using for assessment of the clients, and we can calculate PD for every internal rating.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you please advise, is it possible to do that with one of the above-mentioned Options and how?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance, &lt;/p&gt;&#xA;" OwnerUserId="26972" LastActivityDate="2019-09-10T17:21:39.693" Title="Probability of default" Tags="&lt;probability&gt;&lt;credit-ratings&gt;&lt;default&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="32989" PostTypeId="2" ParentId="32988" CreationDate="2017-03-13T12:16:43.160" Score="1" Body="&lt;p&gt;Take a look at the Altman Z Score, sounds like it is what you are looking for - &lt;a href=&quot;https://en.wikipedia.org/wiki/Altman_Z-score&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Altman_Z-score&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12142" LastActivityDate="2017-03-13T12:16:43.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32991" PostTypeId="2" ParentId="32984" CreationDate="2017-03-13T12:51:40.717" Score="2" Body="&lt;p&gt;The mathematical analysis above is correct, but to understand WHY we say that &quot;a futures has no value&quot; it is helpful to understand how a Futures Exchange works.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you enter into a position (for example go long 1 crude oil contract at 45.25) you do not have to pay anything, nor does the seller of the contract receive any money from you. So it is correct that the futures contract at inception has no value. As the price of oil fluctuates during the day however, the contract does acquire a positive or negative value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the close of business on that day (2:30 pm New York Time) a Settlement  Price of say 45.35 is declared by the exchange. This is based on the price the contract was trading for at that time. Your contract is now worth 1000*(45.35-45.25) = 100 dollars since there are 1000 bbl in one contract. During the night, you will be paid this amount in cash, thus resetting the value of the contract to zero. This is called the daily Mark to Market process. The next day the price will change again, but again this gain or loss will be settled in cash during the night.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is why we say that a futures contract at inception or at the close of business has no value. It is being reset to zero each day, and we are analyzing the situation at the time of the reset.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2017-03-13T12:51:40.717" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32992" PostTypeId="1" AcceptedAnswerId="32994" CreationDate="2017-03-13T13:50:12.883" Score="2" ViewCount="93" Body="&lt;p&gt;Apart from selling options , what other instruments can I trade(sell) to collect a premium ? The main problem that I face is as follows :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am buying a Call option which I would like to fund by selling something else . I want to avoid selling an option in the same underlying or a correlated underlying . A solution to this would be to go for Commodity or Currency options (since the call option I am buying is in Equity markets) . Apart from options is there any other instrument that can be sold to collect the premium (to fund the call) ?&lt;/p&gt;&#xA;" OwnerUserId="24269" LastActivityDate="2017-03-13T14:24:37.033" Title="What instruments help me receive a premium?" Tags="&lt;options&gt;&lt;portfolio-management&gt;&lt;quant-trading-strategies&gt;&lt;risk-management&gt;&lt;option-strategies&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32993" PostTypeId="1" CreationDate="2017-03-13T14:00:44.113" Score="5" ViewCount="1240" Body="&lt;p&gt;I am thinking of using SABR for non-rate underlyings (eg FX and equity underlyings). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typically one finds the beta via a regression of historical implied vols vs forwards, since &#xA;$$\ln(\textrm{atm vol}) = \ln(\alpha) - (1-\beta) \times \ln(\textrm{forward}).$$ &#xA;However for FX and equity underlyings, it is not uncommon to find a resulting beta either negative or above 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question : is the SABR model still valid for beta values outside the typical [0,1] range?&lt;/p&gt;&#xA;" OwnerUserId="25460" LastEditorUserId="848" LastEditDate="2017-03-13T15:28:16.043" LastActivityDate="2019-09-18T19:18:06.000" Title="SABR beta range" Tags="&lt;stochastic-volatility&gt;&lt;sabr&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="32994" PostTypeId="2" ParentId="32992" CreationDate="2017-03-13T14:24:37.033" Score="4" Body="&lt;p&gt;no, generally speaking only options has time premium. I strongly advise you to avoid mixing 2 positions (short 1 option, long another one) in your mind just because they are independent, so just consider each leg as an independent trade which should be profitable by itself, without other legs.&lt;/p&gt;&#xA;" OwnerUserId="26947" LastActivityDate="2017-03-13T14:24:37.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32995" PostTypeId="2" ParentId="32987" CreationDate="2017-03-13T15:21:10.610" Score="6" Body="&lt;p&gt;There are three sources of carry for bond futures - &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Carry on the underlying (coupon accrual and yield roll-down) for which you just compute the carry on the cheapest-to-deliver as you suggest.&lt;/li&gt;&#xA;&lt;li&gt;Implied financing rate, for which you need the term repo rate for the CTD.&lt;/li&gt;&#xA;&lt;li&gt;Theta on the various short options inherent in a long futures position (switch option, end-of-month option, wild-card option)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Of these, the first two are generally the dominant effects, but you can't always ignore the third. There have certainly been periods in the past where the yield pick-up on a long futures position compared to a position in the CTD has been worth 50-100 basis points annually.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to go into more detail, I suggest that you take a look at one of the many questions on treasury futures on this site, e.g. &lt;a href=&quot;https://quant.stackexchange.com/questions/26315/how-to-compute-the-yield-on-the-ultra-bond-treasury-futures?rq=1&quot;&gt;here&lt;/a&gt; or &lt;a href=&quot;https://quant.stackexchange.com/questions/32624/price-of-bond-future-given-a-specific-interest-rate?noredirect=1&amp;amp;lq=1&quot;&gt;here&lt;/a&gt; or &lt;a href=&quot;https://quant.stackexchange.com/questions/32624/price-of-bond-future-given-a-specific-interest-rate?noredirect=1&amp;amp;lq=1&quot;&gt;here&lt;/a&gt;, or the book &lt;a href=&quot;https://www.amazon.co.uk/Treasury-Bond-Basis-Depth-Arbitrageurs/dp/0071456104/ref=sr_1_1?ie=UTF8&amp;amp;qid=1489418361&amp;amp;sr=8-1&amp;amp;keywords=treasury+bond+basis&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Treasury Bond Basis&lt;/a&gt; which is probably the best reference on the subject.&lt;/p&gt;&#xA;" OwnerUserId="924" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2017-03-13T15:21:10.610" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32997" PostTypeId="2" ParentId="32980" CreationDate="2017-03-13T15:50:02.327" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I think that it may be very simple but since I just started in the&#xA;  quant finance it would be great to have some feedback and&#xA;  recommendations about how to improve my backtesting.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;From my experience, most who begin testing a model straight from academia overlook several things that are quite different in the real world.  Factoring them in will help to make your model's test more accurate and will help you experience less variance when you take the step from simulation to live trading.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Clean your data.  In all my years I have never found a data source that is always clean.  Have some code that combs through your data before you put it into a database.  You will have to correct errant pieces of data by hand at times and it can be tedious and annoying but it is necessary.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Factor in liquidity, slippage, commissions and financing costs to all your models.  Portfolio's don't finance themselves, leverage is not free, commissions add up and you can't just buy or sell $1B of a security at a specific price just because your model wants to.  Your execution price is the one at which someone else is willing to take the other side of your trade and it is often not your model's price.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you become satisfied with a model, congratulations but you are only half way done.  You now have to determine how you are going to deploy it.  By this I mean that you will need to determine how much of your portfolio you will put to work with this model.  Will this model run 100% of your portfolio?  Will it be mixed with other models?  Does the risk/return/volatility profile of this model fit in with what you are trying to accomplish?  These are questions that only you can answer personally and the answer will come via an optimization process that you choose or create.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Best of luck!&lt;/p&gt;&#xA;" OwnerUserId="26556" LastEditorUserId="26556" LastEditDate="2017-03-15T14:15:36.310" LastActivityDate="2017-03-15T14:15:36.310" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="32998" PostTypeId="2" ParentId="32986" CreationDate="2017-03-13T16:03:37.320" Score="1" Body="&lt;p&gt;What I do in my code is to calculate the MA for &quot;whatever number of days is available or 100 whichever is smaller&quot;. But that is just a pragmatic hack to make sure my program produces some value instead of dying of unexplained causes, and matches the &quot;correct&quot; values once T&gt;= 100. I would not claim that this is the definitive solution by any means. The routine should probably return a Warning Code that the full MA cannot yet be computed, so the caller can disregard those fake values if he wants. Of course before the date of TSLA IPO I return a Hard Error code saying &quot;can't do it&quot;. This is programming style rather than Quant Finance.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-03-13T16:09:02.520" LastActivityDate="2017-03-13T16:09:02.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="32999" PostTypeId="2" ParentId="32993" CreationDate="2017-03-13T16:20:01.727" Score="0" Body="&lt;p&gt;The beta is handing the underlying distribution ie Beta = 0 as Stochastic Gaussian ( Normal ) Model, as 0.5 for Stochastic CIR model and 1 as Stochastic Lognormal Model.&#xA;So outside of this witch kind of distribution you will have?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Never heard about this&lt;/p&gt;&#xA;" OwnerUserId="24915" LastActivityDate="2017-03-13T16:20:01.727" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33001" PostTypeId="1" CreationDate="2017-03-13T17:28:21.113" Score="1" ViewCount="308" Body="&lt;p&gt;I am having difficulties trying to set up the rebalancing period to semi-annual or every 9 months in the &lt;code&gt;optimize.portfolio.rebalancing&lt;/code&gt; function in the package PortfolioAnalytics (R). Is it possible to add the factor $k=1,2$ (endpoints) in the rebalancing function?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried &lt;code&gt;optimize.portfolio.rebalancing(...rebalance_on=list(&quot;quarters&quot;,k=2)...)&lt;/code&gt; and &lt;code&gt;optimize.portfolio.rebalancing(... ,rebalance_on=&quot;quarters&quot;, k=2, ...)&lt;/code&gt;. However, I did not obtain semi-annual rebalancing periods and I only got the standard quarterly rebalancing period.&lt;/p&gt;&#xA;" OwnerUserId="26976" LastEditorUserId="848" LastEditDate="2017-03-13T18:57:27.927" LastActivityDate="2021-04-30T10:08:00.693" Title="PortfolioAnalytics [R] - optimize.portfolio.rebalancing / rebalancing period" Tags="&lt;optimization&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33002" PostTypeId="1" AcceptedAnswerId="33003" CreationDate="2017-03-13T17:57:01.177" Score="1" ViewCount="363" Body="&lt;p&gt;I ran this code in R&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;vGK &amp;lt;- volatility(ohlc, n = 10, calc=&quot;garman&quot;, N = 260, mean0 = FALSE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and the ten first values appeared like this: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[1]         NA         NA         NA         NA&#xA;[5]         NA         NA         NA         NA&#xA;[9]         NA&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it because the TTR package estimates the average over last 10 days (hence the n=10)? And that's why the values are smoothed? &lt;/p&gt;&#xA;" OwnerUserId="26935" LastEditorUserId="848" LastEditDate="2017-03-13T18:30:37.867" LastActivityDate="2017-03-13T18:41:40.307" Title="When computing Garman-Klass volatility in R why does it leave out the ten first values?" Tags="&lt;volatility&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33003" PostTypeId="2" ParentId="33002" CreationDate="2017-03-13T18:41:40.307" Score="1" Body="&lt;p&gt;Use the source Luke:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; library(TTR)&#xA;&amp;gt; volatiliy&#xA;&#xA;function (OHLC, n = 10, calc = &quot;close&quot;, N = 260, mean0 = FALSE, ...) &#xA;{&#xA;    OHLC &amp;lt;- try.xts(OHLC, error = as.matrix)&#xA;    calc &amp;lt;- match.arg(calc, c(&quot;close&quot;, &quot;garman.klass&quot;, &quot;parkinson&quot;, &#xA;        &quot;rogers.satchell&quot;, &quot;gk.yz&quot;, &quot;yang.zhang&quot;))&#xA;&#xA;    &amp;lt;snip&amp;gt;&#xA;&#xA;    if (calc == &quot;garman.klass&quot;) {&#xA;        s &amp;lt;- sqrt(N/n * runSum(0.5 * log(OHLC[, 2]/OHLC[, 3])^2 - &#xA;            (2 * log(2) - 1) * log(OHLC[, 4]/OHLC[, 1])^2, n))&#xA;    }&#xA;&#xA;    &amp;lt;snip&amp;gt;&#xA;&#xA;    reclass(s, OHLC)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;clearly the &lt;code&gt;TTR&lt;/code&gt; package is using &lt;code&gt;runSum&lt;/code&gt; which seems to be rather complicated on it own. However, we can simply do &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; runSum(1:11, n = 10)&#xA;NA NA NA NA NA NA NA NA NA 55 65&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to see that indeed the first 9 values of &lt;code&gt;runSum&lt;/code&gt; called with &lt;code&gt;n = 10&lt;/code&gt; generate 9 &lt;code&gt;NA&lt;/code&gt; values. In R those &lt;code&gt;NA&lt;/code&gt;'s will propagate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This intuitively makes sense for the reason you suggest in your question.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2017-03-13T18:41:40.307" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33004" PostTypeId="1" AcceptedAnswerId="33016" CreationDate="2017-03-13T18:42:58.243" Score="5" ViewCount="754" Body="&lt;p&gt;I have never seen a formula browsing the web for an asset or nothing option price when skew is accounted for.  I am surprised I do not see something for this which should be standard in FX since digital payoffs are typically in the foreign currency (LHS).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a cash-or-nothing style payoff in FX, the payoff would be the domestic currency (RHS).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $C$ be the price of a vanilla call option with the usual parameters suppressed in the notation.  Also, I prefer never to mention spot when in European pricings, so I use the formulas based on forwards below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the flat vol Black-Scholes world using the usual BS notation, the price of the cash or nothing option is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$e^{-rt}N(d2)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, the asset-or-nothing call in the Black Scholes framework will be the well established formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$e^{-rt}FN(d1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When skew needs to be accounted for, the usual limit of a tight call spread argument and the chain rule will yield for the cash-or-nothing:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$e^{-rt}(N(d2) - \frac{\partial \sigma}{\partial K}  \frac{\partial C}{\partial \sigma})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, we also have the usual price of the vanilla call which is long one unit of an asset or nothing call and short K units of a cash or nothing call in the Black-Scholes world:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C=e^{-rt}(FN(d1)-KN(d2))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since being long the call will still be long one unit of an asset-or-nothing call and short K units of a cash-or-nothing call in a model independent way, we can then rewrite the vanilla call formula as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C=e^{-rt}(F(N(d1) - X) -K(N(d2)-\frac{\partial \sigma}{\partial K}  \frac{\partial C}{\partial \sigma}))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where we have the skew correction factor in the cash-or-nothing portion and we call $X$ the skew correction factor for the asset-or-nothing call.  Since the vanilla call is correctly priced by both formulas, we can solve for X and we see that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X=\frac{K}{F}\frac{\partial \sigma}{\partial K}\frac{\partial C}{\partial \sigma}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This should yield my final answer of the asset-or-nothing price with skew as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C=e^{-rt}(FN(d1)-K\frac{\partial \sigma}{\partial K}\frac{\partial C}{\partial \sigma})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or in terms of percentage of one unit of foreign currency notional:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$e^{-rt}(N(d1)-\frac{K}{F}\frac{\partial \sigma}{\partial K}\frac{\partial C}{\partial \sigma})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this a standard formula that I have not been able to find?  Did I make an error?&lt;/p&gt;&#xA;" OwnerUserId="26977" LastEditorUserId="26977" LastEditDate="2017-03-13T20:43:25.780" LastActivityDate="2017-03-16T19:12:21.503" Title="Asset-Or-Nothing call option price with skew" Tags="&lt;binary-options&gt;&lt;skew&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33007" PostTypeId="1" CreationDate="2017-03-13T22:28:43.397" Score="3" ViewCount="2675" Body="&lt;p&gt;I'm trying to find all of the historical earnings dates (just the dates is good enough) for certain stocks ranging back to their IPOs. I'm plan to use it for my machine learning project.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yahoo and Nasdaq seem to only list the earnings  dates for the last four quarters. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="25040" LastActivityDate="2020-12-27T13:01:16.600" Title="Where I can find historical earnings dates for stocks?" Tags="&lt;machine-learning&gt;&lt;earnings&gt;" AnswerCount="5" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33008" PostTypeId="2" ParentId="33004" CreationDate="2017-03-13T22:35:49.570" Score="0" Body="&lt;p&gt;it seems OK. Alternatively, just write it as a vanilla call plus the appropriate amount of digital calls, and add together their formulas. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2017-03-13T22:35:49.570" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33009" PostTypeId="1" CreationDate="2017-03-14T00:01:00.473" Score="0" ViewCount="212" Body="&lt;p&gt;I am new to Black Scholes, and trying to use it to model a clawback in private equity. Essentially, a clawback gives the &quot;limited&quot; partners in the deal the option to pull some funds away from the &quot;general&quot; partner. I am essentially trying to value a put option, to assess the likelihood of the put option being in the money (i.e. $\mathcal{N} \left( -d_2 \right)$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe the option in this case would rely on:&#xA;Underlying value (i.e. &quot;S&quot;): net asset value of the investments + the distributions earned by the &quot;limited&quot; partners&#xA;Exercise (&quot;K&quot;): the capital contributions (with a preferred growth rate) of the &quot;limited&quot; partners&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My concern is primarily with the portion of &quot;S&quot;, and not as much with &quot;K&quot;. &quot;S&quot; has 2 separate components: the net asset value which has a volatility, and the distributions which does not have a volatility. I'm essentially trying to figure out how to model using Black Scholes when my &quot;S&quot; has a component with and without volatility. Has anyone had to deal with this before? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;b&gt;Update to question: &lt;/b&gt;thanks LocalVolatility! (I am now logged in using my own account). &lt;br&gt;Two clarifications:&#xA;&lt;br&gt;1) I do not understand what the &quot;+&quot; after the brackets mean in your answer below? Thought maybe it would help that I understood it moving forward. Example: $\left( \hat{K} - X_T \right)^+$&#xA;&lt;br&gt;2) Also, there will be times when the distribution $Y$ is larger than $K e^{\gamma T}$; so $\hat{K}$ will be less than 0. I think this is OK. $X$ (in this case the net present value, which follows a Brownian motion) is never less than 0. So, when $\hat{K}$ is less than 0 because $Y$ is larger than $K e^{\gamma T}$, the payoff $\left( \hat{K} - X_T \right)^+$ will end up being negative. We can just interpret this payoff as being 0. Further, the actual calculation of $\mathcal{N} \left( -d_2 \right)$ would just lead to an error. So, we can also interpret $\mathcal{N} \left( -d_2 \right)$ as being 0. This is because the likelihood of being in the money in this case is just 0. Does this align with your thinking?&#xA;&lt;/p&gt;&#xA;" OwnerUserId="26981" LastEditorUserId="26981" LastEditDate="2017-03-15T12:10:25.350" LastActivityDate="2017-05-14T13:35:54.380" Title="Using black scholes to model a clawback in private equity" Tags="&lt;black-scholes&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33010" PostTypeId="2" ParentId="33004" CreationDate="2017-03-14T02:05:15.167" Score="0" Body="&lt;p&gt;In RL, you'd replicate the option as a tight call spread plus one more unit of call at the upper strike. &lt;/p&gt;&#xA;" OwnerUserId="26574" LastActivityDate="2017-03-14T02:05:15.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33012" PostTypeId="1" AcceptedAnswerId="33092" CreationDate="2017-03-14T07:11:41.883" Score="3" ViewCount="242" Body="&lt;p&gt;I know following PDE is the &lt;code&gt;continuous payment case&lt;/code&gt;, but a caplet pays as  rate: $\max(r - r^*,0),$ use the hedge portfolio $\Pi = V- \Delta Z$ &#xA;$$d\Pi =  dV- \Delta dZ +\max(r - r^*,0)dt = r\Pi dt $$&#xA;then the result PDE should be&#xA;$$\dfrac{\partial V}{\partial t} + LV -rV + \max(r - r^*,0) = 0$$&#xA;Here $L$ is Black-Scholes operator, and $Z$ is zero=coupon bond respect to interest rate $r.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, why in the following book, the constant term is $\min(r,r^*)$ I can't understand that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/exmM7.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/exmM7.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-03-18T19:10:41.160" Title="The PDE of caplet and floors" Tags="&lt;fixed-income&gt;&lt;derivatives&gt;&lt;differential-equations&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33014" PostTypeId="1" CreationDate="2017-03-14T10:19:23.633" Score="1" ViewCount="175" Body="&lt;p&gt;So, I'm trying to compute the daily yielt to maturity on basis of data retrieved from Datastream. The data comprises EMU Treasury bonds with Prices, Coupon and Maturity date. In R the matrices are constructed that daily all prices, coupons and time-to maturites are arranged corresponding to their date. When matured, all three variables are 0 (zero).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the bondvalue function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bondvalue = function(c,T,r,par)  { bv = c/r + (par - c/r) * (1+r)^(-2*T) bv }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I essentially use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Yields = c(Yields,  uniroot(function(r) bondvalue(Coupon*100, Prices, r, 100) - Prices,  c(-1, 1))$root)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to find yield to maturities. However, as stated before I would like to compute daily yield to maturities. Therefore I use a for loop:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;daily_ytm &amp;lt;- matrix(NA,ncol = ncol(Prices), nrow = nrow(Prices))&#xA;for (i in 1:nrow(Prices)) {&#xA;for (j in 1:ncol(Prices)) {&#xA; if (Prices[i,j] == 0){&#xA;  daily_ytm[i,j]=0&#xA;}  &#xA;else if (Prices &amp;gt; 0){&#xA;daily_ytm[i,j]=c(daily_ytm, &#xA;            uniroot(function(r) bondvalue(Coupon*100, Prices, r, 100)&#xA;            - Prices, &#xA;            c(-1, 1))$root)&#xA;}&#xA;}&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where I would like to get a 0 (zero) in the new matrix, whenever the Price/Coupon/Maturity is zero (or NA originally), otherwise it should find the ytm using uniroot().&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I receive the error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;Error in pmax.int(pmin(x, .Machine$double.xmax), -.Machine$double.xmax) :  invalid input type In addition: Warning messages:&#xA;&amp;gt;1: In if (Prices &amp;gt; 0) { : the condition has length &amp;gt; 1 and only the first element will be used&#xA;&amp;gt;2: In if (is.na(f.lower)) stop(&quot;f.lower = f(lower) is NA&quot;) : the condition has length &amp;gt; 1 and only the first element will be used&#xA;&amp;gt;3: In if (is.na(f.upper)) stop(&quot;f.upper = f(upper) is NA&quot;) : the condition has length &amp;gt; 1 and only the first element will be used&#xA;&amp;gt;4: In cbind(is.na(mmm), is.na(each)) : number of rows of result is not a multiple of vector length (arg 2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What am I doing wrong here?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; head(Prices)&#xA;              PTOTEAOE0013 PTOTEMOE0001 DE0004109103 PTOTEOOE0009&#xA;1999-12-31       105.88       100.13      120.033        108.4   &#xA;2000-01-03       105.75       100.13      120.033        108.4 &#xA;2000-01-04       105.85       100.13      120.033        108.4          &#xA;2000-01-05       105.92       100.13      120.033        108.4          &#xA;2000-01-06       105.92       100.13      120.033        108.4          &#xA;2000-01-07       106.20       100.13      120.033        108.4          &#xA;&#xA;&amp;gt; head(Coupon[,1:4])&#xA;       PTOTEUOE0001 PTOTEAOE0013 PTOTEMOE0001 DE0004109103&#xA;1999-12-31       0.0875     0.048125      0.10625      0.07125&#xA;2000-01-03       0.0875     0.048125      0.10625      0.07125&#xA;2000-01-04       0.0875     0.048125      0.10625      0.07125&#xA;2000-01-05       0.0875     0.048125      0.10625      0.07125&#xA;2000-01-06       0.0875     0.048125      0.10625      0.07125&#xA;2000-01-07       0.0875     0.048125      0.10625      0.07125&#xA;&#xA;&amp;gt; head(ttm_y[,1:4])&#xA;PTOTEUOE0001 PTOTEAOE0013 PTOTEMOE0001 DE0004109103&#xA;1      1.16667         3.25      3.41667      3.50000&#xA;2      1.16667         3.25      3.41667      3.41667&#xA;3      1.16667         3.25      3.41667      3.41667&#xA;4      1.16667         3.25      3.41667      3.41667&#xA;5      1.16667         3.25      3.41667      3.41667&#xA;6      1.16667         3.25      3.41667      3.41667&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="26987" LastEditorUserId="19645" LastEditDate="2017-03-15T22:02:11.553" LastActivityDate="2017-03-15T22:02:11.553" Title="Daily yield to maturity using `uniroot` in R: error" Tags="&lt;fixed-income&gt;&lt;programming&gt;&lt;bond&gt;&lt;yield-curve&gt;&lt;bond-yields&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33015" PostTypeId="2" ParentId="33007" CreationDate="2017-03-14T10:47:15.540" Score="3" Body="&lt;p&gt;You can use Bloomberg terminal BDH formula on Excel. If you go through the wizard, you'll have to click:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Import data -&gt; Historical End of Day -&gt; Select securities from spreadsheet -&gt; select &quot;LATEST_ANNOUNCEMENT_DT&quot; -&gt; select dates -&gt; finish.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't have access to Bloomberg terminal, try asking some friends if they do. Many university libraries have one, as do most bigger financial companies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Word of caution: I don't know about other sources, but Bloomberg data is not exactly correct - it doesn't differentiate whether a company reports before, during or after the market hours. To get around this I would measure the price move over 2-3 days around earnings instead of a single day.&lt;/p&gt;&#xA;" OwnerUserId="19615" LastActivityDate="2017-03-14T10:47:15.540" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33016" PostTypeId="2" ParentId="33004" CreationDate="2017-03-14T12:56:49.577" Score="1" Body="&lt;p&gt;Seems my post did have the correct answer - I was just doubting myself because I had never seen the formula before and it seems like something I should have seen by now.&lt;/p&gt;&#xA;" OwnerUserId="26977" LastActivityDate="2017-03-14T12:56:49.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33017" PostTypeId="1" CreationDate="2017-03-14T13:28:19.910" Score="2" ViewCount="377" Body="&lt;p&gt;I want to simulate a VARMA-GARCH process in R. Unfortunately, I found no package to help me with that.&#xA;I tried modelling the MGARCH part on itw own and combine it with the VARMA simulation using MTS package but the variance/ covariance matrix of the MGARCH model can't be included there.&#xA;Does anybody have an idea about how to do that?&#xA;Thanks&lt;/p&gt;&#xA;" OwnerUserId="26989" LastActivityDate="2017-03-14T13:28:19.910" Title="VARMA GARCH modelling in R" Tags="&lt;programming&gt;&lt;garch&gt;&lt;arma&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33018" PostTypeId="1" CreationDate="2017-03-14T14:40:20.267" Score="1" ViewCount="574" Body="&lt;p&gt;I am approaching you with one important for me question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a task to calculate probability of default for our clients. I used an Altman Z-Score model to calculate the Z-Scores for each client.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question N 1: Could you advise me how can I transform this Z-score to Probability of Default rate(%)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second, I am not fully satisfied with the results of Altman model, because, for example, one of our clients has an internal risk class 5 (it means, that it is in a risky zone), but the Z-Score I calculate for this client is quite high, and vice versa.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question N 2: Can I transform our internal risk classifications (1,2,3....8) to probability of default rate (%)? If I can, how? If it is possible, I will write on which criterias we define our internal risk classifications.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot.&lt;/p&gt;&#xA;" OwnerUserId="26991" LastActivityDate="2017-03-14T14:40:20.267" Title="Altman Z-Score model for PD calculation" Tags="&lt;risk&gt;&lt;risk-models&gt;&lt;credit&gt;&lt;default-probability&gt;&lt;credit-ratings&gt;" AnswerCount="0" CommentCount="7" ClosedDate="2017-03-14T15:21:22.417" ContentLicense="CC BY-SA 3.0" />
  <row Id="33019" PostTypeId="1" AcceptedAnswerId="33025" CreationDate="2017-03-14T14:59:37.257" Score="1" ViewCount="173" Body="&lt;p&gt;On Page 24 of N. Taleb's &quot;Dynamic Hedging&quot; the author gives the following example&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;: Assume that an asset trades at \$100, with interest rates at 6%&#xA;  (annualized) and volatility at 15.7%. Assume also that the 3-month 80 call is worth \$20, at least if it is American. Forgoing early exercise would create an opportunity cost of 20 x 90/360 x .06 = .30 cents, the financing of \$20 premium for 3 months. The time value of the equivalent put is close to zero (by put-call parity), so the intelligent operator can swap the call into the underlying asset and buy the put to replicate the same initial structure at a better cost. He would end up long the put and long the underlying asset.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The possible position of the operator before swap:  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;1 call worth of \$20 a&lt;/li&gt;&#xA;&lt;li&gt;\$80 in cash. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The position after the swap:  &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;1 asset worth of $100 at the current spot price&lt;/li&gt;&#xA;&lt;li&gt;1 put worth of almost zero&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If I could earn 6% both on \$80 in cash and on 1 asset (i.e. if the asset is another currency for example) and the spot price would remain the same \$100 then I would agree with the calculations of the author: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 asset x 90/360 x .06 -  \$80 x 90/360 x .06 = (100 - 80) x 90/360 x .06 = 30 cents&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if the price of the asset will go down to say \$75, then I'd better stay with the call because: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 asset x 90/360 x .06 -  \$80 x 90/360 x .06 = (75 - 80) x 90/360 x .06 = -7.5  cents&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So,how far the spot price is likely to go from the current level in three months if its volatility is 15.7%?&lt;/p&gt;&#xA;" OwnerUserId="15154" LastActivityDate="2017-03-14T18:50:06.270" Title="How far the spot price is likely to go from the current level in three months if its volatility is 15.7%" Tags="&lt;american-options&gt;&lt;put-call-parity&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33021" PostTypeId="2" ParentId="33009" CreationDate="2017-03-14T15:35:00.183" Score="1" Body="&lt;p&gt;This answer is an extended version of my comment on your question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is how I understand you setup: The underlying value $S$ is given by the sum of two components: $S_t = X_t + Y$. Here $X$ is the net asset value following a geometric Brownian motion&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathrm{d}X_t = \mu X_t \mathrm{d}t + \sigma X_t \mathrm{d}W_t.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with drift $\mu$ and volatility $\sigma$. $Y$ is the value of the distributions which is fixed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You want to price a European put option with maturity in $T$ and strike price $K e^{\gamma T}$ where $\gamma$ is the growth rate of the strike. The terminal payoff of this option is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;V_T &amp;amp; = &amp;amp; \left( K e^{\gamma T} - S_T \right)^+\\&#xA;&amp;amp; = &amp;amp; \left( K e^{\gamma T} - X_T - Y \right)^+\\&#xA;&amp;amp; = &amp;amp; \left( \hat{K} - X_T \right)^+,&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\hat{K} = K e^{\gamma T} - Y$. I.e. the value of this option is the value of European plain vanilla put option on the asset $X$. The exercise probability is $\mathcal{N} \left( -d_- \right)$ as usual, where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;d_- = \frac{1}{\sigma \sqrt{T}} \left( \ln \left( \frac{X_0}{\hat{K}} \right) + \left( \mu - \frac{1}{2} \sigma^2 \right) T \right).&#xA;\end{equation}&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2017-03-14T15:35:00.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33023" PostTypeId="2" ParentId="33012" CreationDate="2017-03-14T15:51:08.760" Score="0" Body="&lt;p&gt;How exactly did you find the first equation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;d\Pi = dV-\Delta dZ + max(r-r^*,0) dt = r \Pi dt\,?&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I mean how does the term $max(r-r^*,0) dt$ pops up?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, it is worth mentioning that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;min(r,r^*) = - max(-r^*,-r) = -(max(r-r^*,0) - r) = r - max(r-r^*,0)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe the latter can help.&lt;/p&gt;&#xA;" OwnerUserId="26595" LastActivityDate="2017-03-14T15:51:08.760" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33025" PostTypeId="2" ParentId="33019" CreationDate="2017-03-14T18:50:06.270" Score="1" Body="&lt;p&gt;Keep in mind that there is nothing dynamic about this at all...it is only a snapshot and it is only a 1 sigma range.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;High side:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;([Price] * (1 + ([Vol] * SQRT[days to expiry]/365)))&#xA;(100 * (1 + (.157 * sqrt(90/365)))&#xA;107.7960&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Low side:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;([Price] * (1 - ([Vol] * SQRT[days to expiry]/365)))&#xA;(100 * (1 - (.157 * sqrt(90/365)))&#xA;92.2040&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="26556" LastActivityDate="2017-03-14T18:50:06.270" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="33026" PostTypeId="1" CreationDate="2017-03-15T09:35:20.267" Score="1" ViewCount="217" Body="&lt;p&gt;I'm a math major and I've always been really interested in Finance; however, I'm starting to enjoy math more and more and would like to know which jobs in Finance use the most/more advanced math. Also, what kind of path would lead to those jobs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance! &lt;/p&gt;&#xA;" OwnerUserId="27004" LastActivityDate="2017-03-15T09:35:20.267" Title="What jobs in Finance are most math intensive?" Tags="&lt;mathematics&gt;&lt;finance-mathematics&gt;&lt;math&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="0" ClosedDate="2017-03-15T09:42:40.473" ContentLicense="CC BY-SA 3.0" />
  <row Id="33027" PostTypeId="2" ParentId="31284" CreationDate="2017-03-15T10:40:36.337" Score="0" Body="&lt;p&gt;If the book values and market values of each company are $B_i$ and $M_i$ respectively, then the book-to-market ratio for the sector is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align}&#xA;B/M &amp;amp; = \frac{\sum_i B_i}{\sum_i M_i} \\&#xA;    &amp;amp; = \frac{\sum_i M_i (B_i/M_i)}{\sum_i M_i} \\&#xA;    &amp;amp; = \sum_i \frac{M_i}{\sum_j M_j} \frac{B_i}{M_i} \\&#xA;    &amp;amp; = \sum_i W_i \frac{B_i}{M_i}&#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W_i=M_i/\sum_jM_j$, i.e. the book-to-market ratio for the sector is the market-weighted average of the book-to-market ratios for the individual stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The price-to-book ratio for the sector is the inverse of this, i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align}&#xA;M/B &amp;amp; = \frac{1}{\sum_i W_i \frac{B_i}{M_i}} \\&#xA;    &amp;amp; = \left( \sum_i W_i \left(\frac{M_i}{B_i}\right)^{-1}\right)^{-1}&#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so the price-to-book ratio is the &lt;em&gt;weighted harmonic mean&lt;/em&gt; of the price-to-book ratios for the individual stocks, where the weights are the market values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can use the equivalent definition&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align}&#xA;M/B &amp;amp; = \frac{\sum_i M_i}{\sum_i B_i} \\&#xA;    &amp;amp; = \frac{\sum_i B_i (M_i/B_i)}{\sum_i B_i} \\&#xA;    &amp;amp; = \sum_i \frac{B_i}{\sum_j B_j} \frac{M_i}{B_i} \\&#xA;    &amp;amp; = \sum_i W^B_i \frac{M_i}{B_i}&#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W^B_i = B_i/\sum_j B_j$, so the price-to-book ratio for the sector can also be expressed as the book-weighted average of the price-to-book ratios of the individual stocks.&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2017-03-15T10:40:36.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33028" PostTypeId="1" AcceptedAnswerId="33680" CreationDate="2017-03-15T11:23:11.047" Score="2" ViewCount="2024" Body="&lt;p&gt;Reading about Yield-to-Maturity (YTM) I found out that two assumptions have to be made:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the bond holder must keep the bond until maturity;&lt;/li&gt;&#xA;&lt;li&gt;coupons must be reinvested at the same YTM.&#xA;Violating those hypotheses causes the bond holder incurring in two types of risks: the price risk and the reinvestment risk.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So I was wondering: since interest rates are ever-changing, will a bond holder be automatically subject to the reinvestment risk? It is hard for me envisaging that he can still reinvest his coupons at the same YTM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I kindly ask you where my reasoning fails.&lt;/p&gt;&#xA;" OwnerUserId="22470" LastEditorUserId="848" LastEditDate="2017-03-15T11:27:44.723" LastActivityDate="2017-04-15T14:50:02.063" Title="Yield-to-Maturity and its assumption" Tags="&lt;bond&gt;&lt;yield&gt;" AnswerCount="4" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33029" PostTypeId="1" CreationDate="2017-03-15T11:27:52.827" Score="1" ViewCount="96" Body="&lt;p&gt;What is the risk that occurs if an investor hedges a short OTC foreign exchange forward sale with a long exchange traded foreign exchange futures with different maturities. And how can the residual risk be hedged?&lt;/p&gt;&#xA;" OwnerUserId="27005" LastEditorUserId="16148" LastEditDate="2017-03-15T12:43:04.477" LastActivityDate="2017-03-15T13:01:25.483" Title="Futures hedging for FX" Tags="&lt;fx&gt;&lt;hedging&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33030" PostTypeId="2" ParentId="33028" CreationDate="2017-03-15T11:28:50.400" Score="0" Body="&lt;p&gt;Yes, its called yield to maturity because you hove to hold it till maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the reinvestment risk, suppose the day you get the coupon the coupon the day bond is trading at x%. Now with the money you get from the coupon, you can buy these bonds and realize x%. So the reinvestment risk is eliminated to the extent of the liquidity in the market. &lt;/p&gt;&#xA;" OwnerUserId="15428" LastActivityDate="2017-03-15T11:28:50.400" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33031" PostTypeId="1" AcceptedAnswerId="33039" CreationDate="2017-03-15T11:38:09.307" Score="5" ViewCount="241" Body="&lt;p&gt;This is a follow-up question on &lt;a href=&quot;https://quant.stackexchange.com/questions/32929/price-of-a-prepayment-based-claim&quot;&gt;Price of a prepayment-based claim&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a zero-coupon bond of maturity $T$ with price $P_0$ for which the borrower can reimburse the principal $N$ at any time $\tau$ between $0$ excluded and $T$ included. Assuming a constant risk-free interest rate $r$, the price of this claim is given by the risk-neutral expectation of its payoff: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P_0 = \mathbb{E}^{\mathbb{Q}}\left[N\left(\mathbb{I}_{\{\tau \leq T\}}e^{-r\tau}+\mathbb{I}_{\{\tau&amp;gt;T\}}e^{-rT}\right)\right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To model the stopping time $\tau$, we introduce a homogenous Poisson process $N(t)$ parameterised by $\lambda &amp;gt; 0$ such that for $t \in \mathbb{R}_+^*$ and $n \in \mathbb{N}$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbb{P}(N(t) = n) = \frac{(\lambda t)^n}{n!}e^{-\lambda t}$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $(\mathcal{F}_t)_{t \geq 0}$ be the natural filtration associated to the process $N(t)$. The stopping time $\tau$ with respect to filtration $(\mathcal{F}_t)_{t \geq 0}$ is then defined as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \tau = \min \{t&amp;gt;0 : N(t)&amp;gt;0 \}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We derive the stopping time distribution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;&amp;amp; \mathbb{P}(\tau &amp;gt; t) = \mathbb{P}(N(t) = 0) = e^{-\lambda t}&#xA;\\[8pt]&#xA;&amp;amp; \mathbb{P}(\tau \leq t) = 1 - e^{-\lambda t}&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence as expected:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \tau \sim \mathcal{E}(\lambda) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, my question concerns the effect of a change of measure $-$ from the real-world probability $\mathbb{P}$ to the risk-neutral measure $\mathbb{Q}$ $-$ on the parameter $\lambda$. For example, under the Black-Scholes model, the canonical change of measure modifies the asset $S_t$ drift from $\mu$ to $r$ but it does not have any impact on the diffusion coefficient $\sigma$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am familiar with the theory but not very familiar with the practicalities of the change of measure technique, so I do not really know how to tackle this issue here. Could someone please explain whether:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;There would be any impact on $\lambda$ when passing from $\mathbb{P}$ to $\mathbb{Q}$?&lt;/li&gt;&#xA;&lt;li&gt;Is my pricing problem sufficiently specified above or should there be any additional information to answer question 1?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: please if you think there is an impact &lt;em&gt;do not&lt;/em&gt; post the derivation but a hint on how to proceed. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;A first try&lt;/em&gt;&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fundamental property of the risk-neutral measure is that (Brigo &amp;amp; Mercurio, 2007):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The price of any asset divided by a reference positive non dividend-paying asset (called numeraire) is a martingale (no drift) under the measure associated with that numeraire.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now, in my setting I am not quite sure what would be considered the &quot;asset&quot;: my guess is that it would be the Poisson process $N(t)$. Hence, letting $s&amp;lt;t$ we would have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;\mathbb{E}^{\mathbb{Q}}\left[e^{-rt}N(t)|\mathcal{F}_s\right] &amp;amp; = \mathbb{E}^{\mathbb{Q}}\left[e^{-rt}N(s)|\mathcal{F}_s\right] + \mathbb{E}^{\mathbb{Q}}\left[e^{-rt}(N(t)-N(s))|\mathcal{F}_s\right]&#xA;\\[10pt]&#xA;&amp;amp; = e^{-rt}N(s) + \mathbb{E}^{\mathbb{Q}}\left[e^{-rt}(N(t)-N(s))\right]&#xA;\\[10pt]&#xA;&amp;amp; = e^{-rt}N(s) + e^{-rt}\lambda(t-s)&#xA;\\[10pt]&#xA;&amp;amp; = e^{-rt}\left(N(s) + \lambda (t-s)\right)&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where the second step follows from the independent increments property of the Poisson process. Given that we want:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbb{E}^{\mathbb{Q}}\left[e^{-rt}N(t)|\mathcal{F}_s\right] = e^{-rs}N(s) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the impression that the &lt;em&gt;implied&lt;/em&gt; - &lt;em&gt;i.e.&lt;/em&gt; under the risk-neutral measure - lambda parameter $\tilde{\lambda}$ should be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \tilde{\lambda} \equiv \tilde{\lambda}(r,s,t) = N(s)\frac{e^{r(t-s)}-1}{t-s} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few questions come to mind:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Is my reasoning correct here? &lt;/li&gt;&#xA;&lt;li&gt;Does it make sense to define the parameter in terms of the process? My guess is no given that $\tilde{\lambda}(r,0,t) = 0$ because $N(0)=0$...&lt;/li&gt;&#xA;&lt;li&gt;Does it pose a problem to go from a constant $\lambda$ under the real-world measure $\mathbb{P}$ to a functional $\tilde{\lambda}(r,s,t)$ under the real-world measure $\mathbb{Q}$?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;A second try&lt;/em&gt;&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the same logic, I now leverage the property than the &lt;em&gt;compensated Poisson process&lt;/em&gt; is a martingale:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;&amp;amp; N_c(t) \equiv N(t) - \lambda t&#xA;\\[10pt]&#xA;&amp;amp; \mathbb{E}^{\mathbb{Q}}\left[N_c(t)|\mathcal{F}_s\right] = N_c(s)&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However when I discount I (obviously) get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbb{E}^{\mathbb{Q}}\left[e^{-rt}N_c(t)|\mathcal{F}_s\right] = e^{-rt}N_c(s) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And hence I am stuck again.&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2017-03-15T18:32:07.513" Title="Change of measure's impact on parameter value" Tags="&lt;pricing&gt;&lt;numerairechange&gt;" AnswerCount="1" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="33032" PostTypeId="2" ParentId="21701" CreationDate="2017-03-15T11:55:31.360" Score="0" Body="&lt;p&gt;To add to the above answers , there is also an overnight risk which can expose you to unlimited loss . If the market opens way beyond beyond your strike/breakeven you will  not be able to implement the hedge the way you earlier thought you could.&lt;/p&gt;&#xA;" OwnerUserId="24269" LastActivityDate="2017-03-15T11:55:31.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33033" PostTypeId="1" CreationDate="2017-03-15T12:22:02.607" Score="2" ViewCount="314" Body="&lt;p&gt;Reading about CDOs and calibration to find the implied correlation, I came up with the following question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose we are pricing a CDO over a pool of $N=125$ names, using the usual Gaussian copula structure, with constant recovery rate, constant hazard rates and a unique value $\rho$ for the default times of the 125 names in the pool. This CDO has standard tranches $(l_k, u_k)$, with $k=1,\ldots n$. This is how the implied correlation algorithm is explained in several articles I read:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) The market quotes thefair spread $x^*_k$ for each CDO tranche, $k=1,\ldots n$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) We can then plug these values $x^*_k$ in an algorithm and calculate an implied (base) correlation parameter $\rho_k$ corresponding to each tranche $(l_k, u_k)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; Now that I have found each tranche correlation $\rho_k$, how do I &quot;use&quot; it? What's its purpose? I mean, shall I use this parameter $\rho_k$ to price (for example) other CDOs on the same pool of 125 names, perhaps with different maturities/premium dates? Or what else?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question came up because when we determine the implied volatility out of a set of vanilla call options, we shall use those implied volatilities to price more complex instruments (on the same underlying) having equal strike/expiry: then, implied volatility is &quot;extracted&quot; from one class of instruments (vanilla call options) to be &quot;used&quot; in other classes of instruments (e.g., exotic options, etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But here? Do we also use implied correlation for pricing/evaluating any other imstruments? Which ones, exactly? How?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, what is exactly the use of implied correlation of a CDO?? Thanks in advance for your help.&lt;/p&gt;&#xA;" OwnerUserId="11960" LastActivityDate="2017-03-15T12:22:02.607" Title="CDO Implied correlation: what for?" Tags="&lt;implied-volatility&gt;&lt;correlation&gt;&lt;credit-risk&gt;&lt;cdo&gt;" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="33034" PostTypeId="1" CreationDate="2017-03-15T12:24:22.953" Score="1" ViewCount="354" Body="&lt;p&gt;I don't know whether this question should have better been asked on Quantitative Finance's forum or Cross Validated or Super-User.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to minimize a risk indicator given a fixed profitability I want to make from five financial shares. Therefore I applied the solver from Excel to get the weight in percentage I should use from my constraints and objective function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet after a few turns it always gives me a wrong output as far as I get negative weights for these actions even though I specified I only wanted positive weights (I am not considering to borrow money to sold this share without having it).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Therefore how to use excel solver to get the shares weights minimize a risk indicator given a fixed profitability I want to make?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/oZvrm.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/oZvrm.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="27006" LastActivityDate="2017-03-15T12:24:22.953" Title="how to use excel solver to get the shares weights minimize a risk indicator given a fixed profitability I want to make?" Tags="&lt;excel&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33035" PostTypeId="2" ParentId="33029" CreationDate="2017-03-15T13:01:25.483" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;What is the risk that occurs if an investor hedges a short OTC foreign&#xA;  exchange forward sale with a long exchange traded foreign exchange&#xA;  futures with different maturities.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Counter-party risk.  If the OTC counter party defaults on its obligation to deliver (this means the main leg of the trade has gone in your favor) you are left with the exchange traded part that is in a regulated account being marked-to-market with a loss.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Different maturities gives you an obvious risk.  When the hedge expires you are left with you short forward contract uncovered.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;And how can the residual risk be hedged?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The residual risk for #1 could be hedged with a CDS that you enter into with 3rd party but then you are exposed to the risk of them defaulting on their obligation as well.  It also cuts into your profit margin.  For #2, just roll your futures contract to the next expiry.  This will also cut into your profit margin--assuming the futures curve is in contango.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of having an fx forward with a hedge you may consider just reducing the size of the fx forward trade in the first place.  This may not be an option for you but if it is it gets rid of the need to hedge and reduces the counter-party risk.  Oftentimes an easier, less complex (and always overlooked) way to reduce exposure is to reduce the size of a base position rather than to hedge and re-hedge and re-hedge a position that is clearly uncomfortably large in size.&lt;/p&gt;&#xA;" OwnerUserId="26556" LastActivityDate="2017-03-15T13:01:25.483" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33036" PostTypeId="1" CreationDate="2017-03-15T13:42:44.400" Score="1" ViewCount="230" Body="&lt;p&gt;The dynamics of a zero coupon bond under the risk neutral probability are:&#xA;$$\frac{dP(t,T)}{P(t,T)}=rdt+\sigma(t,T) dW_t$$&#xA;What happens if I take the limit for the maturity $T$ going to small $t$? Do I obtain $$\frac{dP(t,t)}{P(t,t)}=rdt$$ even if I know that $P(t,t)$ is always equal to 1?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This probably has a very simple answer that I can't see at the moment.&lt;/p&gt;&#xA;" OwnerUserId="26657" LastActivityDate="2017-03-15T13:42:44.400" Title="Zero coupon bonds dynamics" Tags="&lt;fixed-income&gt;&lt;zero-coupon&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33038" PostTypeId="1" CreationDate="2017-03-15T17:28:52.010" Score="1" ViewCount="368" Body="&lt;p&gt;I am currently reading the paper of Derman and al for my master thesis on Variance Swap.&#xA;At one point one says that &quot;The variance vega is largest when the option is ATM&quot;, considering here a call option on a stock. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I must say, I am having some difficulties to understand that. The only reason I came up with is that vanilla option are almost linear in volatility at ATM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to clarify my questions which is not clearly explicit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/1S9dS.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/1S9dS.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="24805" LastEditorUserId="848" LastEditDate="2017-03-16T09:05:53.070" LastActivityDate="2017-03-16T09:05:53.070" Title="Variance Swap Vega" Tags="&lt;swaps&gt;&lt;vega&gt;" AnswerCount="0" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="33039" PostTypeId="2" ParentId="33031" CreationDate="2017-03-15T17:53:52.033" Score="3" Body="&lt;h2&gt;Theory&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Define a single currency economy with $N+1$ tradable assets. Further assume that individually investing in each of these assets  constitutes a self-financing strategy. Simply put, this amounts to considering that the assets of our model economy do not distribute capital in the form of dividends or coupons.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $S_1, \dots, S_N$ represent $N$ risky assets and $S_0$ a risk-free one. A common practice is to pick $S_0$ as the reference asset to define the pricing framework. We say that $S_0$ is chosen as the pricing &quot;numéraire&quot; (but we could pick any other traded asset price as numéraire without loss of generality).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pricing theory then tells us that, in the absence of arbitrage opportunities, the processes $$ S_{1,t}/S_{0,t}, \dots, S_{N,t}/S_{0,t} $$ should all emerge as &lt;strong&gt;martingales&lt;/strong&gt; under a measure $\Bbb{Q}$ which is &lt;strong&gt;equivalent&lt;/strong&gt; to the physical measure $\Bbb{P}$ under which we observe the realisations of the prices of the assets of our model economy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuitively, this means that the &lt;strong&gt;relative value&lt;/strong&gt; of all the assets with respect to some reference asset (the numéraire) need to be martingales which is a model of a &quot;fair evolution&quot; of the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because we picked $S_0$ (risk-free asset) as numéraire, the measure $\Bbb{Q}$ is known as the risk-neutral measure.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Your problem&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Suppose a principal $N=1$ to keep notations uncluttered. You have 2 traded assets:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Risk-free asset, $dP_t/P_t = r dt$&lt;/li&gt;&#xA;&lt;li&gt;Instrument to be priced, $V_t$, characterised by its payout, which is 1 unit of currency and which occurs either at maturity $T$ or when a certain event occurs at $\tau &amp;lt; T$. By absence of arbitrage this means that $V_\tau=1$ if early redemption occurs and $V_T=1$ otherwise.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Applying the pricing theory described earlier $V_t/P_t$ (or actually here the &lt;em&gt;stopped process&lt;/em&gt; $V_t^\tau/P_t^\tau$ but this is a technicality) should be a martingale (see also &lt;em&gt;optimal stopping theorem&lt;/em&gt;) i.e.&#xA;\begin{align}&#xA;V_0 &amp;amp;= \Bbb{E}_0^\Bbb{Q} \left[ V_\tau/P_\tau \mathbb{I}_{\{\tau \leq T\}} + V_T/P_T \mathbb{I}_{\{\tau &amp;gt; T\}} \right] \\&#xA;    &amp;amp;= \Bbb{E}_0^\Bbb{Q}  \left[ e^{-r\tau} \mathbb{I}_{\{\tau \leq T\}} + e^{-rT} \mathbb{I}_{\{\tau &amp;gt; T\}} \right]&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Remarks&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;As far as your side questions go, all depends on where the counting process $N_t$ intervenes. In your case, it is used to specify a stopping time. Hence it is &lt;em&gt;exogenous to the specification of the model economy&lt;/em&gt;. This is why we reach the conclusion above that $\lambda$ is the same under $\Bbb{P}$ and $\Bbb{Q}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, one could consider that your payoff is &quot;degenerate&quot;, in the sense that we could build a more general version of it which would deliver a payoff proportional to the value of some other asset $S$ rather than just $1$ unit of currency. From there, let us further distinguish 2 situations:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Situation 1&lt;/strong&gt;: $dS_t/S_t = \mu dt + \sigma dW_t^\Bbb{P}$. Applying the theory described earlier gets to a very similar pricing equation namely:&#xA;$$ V_0 = \Bbb{E}_0^\Bbb{Q} \left[ e^{-r\tau} S_{\tau} \mathbb{I}_{\{\tau \leq T\}} + e^{-rT} S_T \mathbb{I}_{\{\tau &amp;gt; T\}} \right] $$&#xA;and similarly, because now $S$ is also a traded asset, under $\Bbb{Q}$ you'll have:&#xA;$$ dS_t/S_t = r dt + \sigma dW_t^\Bbb{Q} $$&#xA;which the basically the SDE form of the relationship (see martingale representation theorem + Itô's lemma)&#xA;$$ S_t/P_t \text{ is a } \Bbb{Q} \text{ martingale } $$&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Situation 2&lt;/strong&gt;: $dS_t/S_t = \mu dt + \sigma dW_t^\Bbb{P} + J dN_t^\Bbb{P}$. Now you see that the Poisson process becomes &lt;em&gt;part of the specification of the asset price dynamics in the model economy&lt;/em&gt; (endogenous). In that case, because $S_t/P_t$ should be a $\Bbb{Q}$ martingale in our pricing framework, we have:&#xA;$$ dS_t/S_t = (r-\lambda\Bbb{E}[J])dt + \sigma dW_t^\Bbb{Q} + J dN_t^\Bbb{Q} $$ so indeed the drift of the risky asset will have changed (Girsanov theorem -&gt; both the drift parameter of the Brownian motion and the intensity parameter of the Poisson process are altered by the change of measure). And, still,&#xA;$$ V_0 = \Bbb{E}_0^\Bbb{Q} \left[ e^{-r\tau} S_{\tau} \mathbb{I}_{\{\tau \leq T\}} + e^{-rT} S_T \mathbb{I}_{\{\tau &amp;gt; T\}} \right] $$&#xA;But now $S_t$ has a different dynamics than in situation 1.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2017-03-15T18:32:07.513" LastActivityDate="2017-03-15T18:32:07.513" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="33040" PostTypeId="2" ParentId="12830" CreationDate="2017-03-15T19:03:11.493" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://jgscott.github.io/SDS325H_Spring2015/files/logit_poisson_cox.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://jgscott.github.io/SDS325H_Spring2015/files/logit_poisson_cox.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on my understanding from reading the above document, I think it could be because Poisson is used for count data and Logistic is used for categorical data and we have a categorical data while doing Probability of Default (PD) modelling. &lt;/p&gt;&#xA;" OwnerUserId="27010" LastActivityDate="2017-03-15T19:03:11.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33041" PostTypeId="2" ParentId="3607" CreationDate="2017-03-15T20:33:35.330" Score="1" Body="&lt;p&gt;I didn't understand this either but after some googleing I understood the importance of geometric mean returns! The most stuff on the internet is in text form which is not easy to understand. So I visualized this discrepancy&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Gr19o.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Gr19o.png&quot; alt=&quot;Why you should use geometric mean returns&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26899" LastActivityDate="2017-03-15T20:33:35.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33043" PostTypeId="1" CreationDate="2017-03-15T21:20:24.550" Score="2" ViewCount="288" Body="&lt;p&gt;I wonder if anybody has code for the HN-GARCH model where the parameters is NOT estimated with maximum likelihood and instead estimated by looking at the option data where an loss function is chosen and is minimized, so the parameters in the model deliver a call price that is close as possible to the market price? Similar approach is common to use to estimate the parameters in the Heston stochastic volatility model. &lt;/p&gt;&#xA;" OwnerUserId="27011" LastEditorUserId="24222" LastEditDate="2017-03-16T12:42:37.033" LastActivityDate="2017-03-16T12:42:37.033" Title="Heston &amp; Nandi GARCH model, parameters estimation from option data" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;garch&gt;&lt;heston&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33045" PostTypeId="1" CreationDate="2017-03-15T23:06:41.120" Score="1" ViewCount="53" Body="&lt;p&gt;Is there a good practitioners guide to time-dependent and local volatility models?&lt;/p&gt;&#xA;" OwnerUserId="26148" LastActivityDate="2017-03-15T23:06:41.120" Title="Reference request: local volatility and time-dependent volatility" Tags="&lt;local-volatility&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33046" PostTypeId="1" AcceptedAnswerId="33149" CreationDate="2017-03-15T23:39:03.277" Score="1" ViewCount="45" Body="&lt;p&gt;Where can I input a stock ticker and get back a list of the top 3-5 competitors of the stock? E.g. if I input F, I get GM, etc. It would be great if this could also give me data for delisted stocks.&lt;/p&gt;&#xA;" OwnerUserId="27012" LastActivityDate="2017-03-21T19:22:52.223" Title="Public Company Competitors?" Tags="&lt;equities&gt;&lt;data&gt;&lt;market-data&gt;&lt;historical-data&gt;&lt;fundamentals&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33047" PostTypeId="1" CreationDate="2017-03-16T03:13:06.543" Score="1" ViewCount="582" Body="&lt;p&gt;After fit the GARCH model, I want to plot the volatility forecast sigma series. I use ugarchforecast as follow: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;fit = ugarchfit(spec, return)`&#xA;&#xA;fore &amp;lt;- ugarchforecast(fit, n.ahead=1, n.roll = 2517, out.sample = 2517)&#xA;sigma &amp;lt;- fore@forecast$sigmaFor&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But there always an error: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Error in .sgarchforecast(fitORspec = fitORspec, data = data, n.ahead = n.ahead,  : &#xA;&#xA;ugarchforecast--&amp;gt;error: n.roll must not be greater than out.sample!&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;what's wrong with it?&lt;/p&gt;&#xA;" OwnerUserId="27014" LastEditorUserId="24222" LastEditDate="2017-03-16T12:54:27.713" LastActivityDate="2017-03-16T12:54:27.713" Title="forecast using rugarch in r" Tags="&lt;time-series&gt;&lt;programming&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33048" PostTypeId="1" CreationDate="2017-03-16T03:27:51.133" Score="2" ViewCount="422" Body="&lt;p&gt;I want to optimise a portfolio of assets from different countries (A,B,C...) where the set of all country-asset combinations is (A1, A2, A3, A4.... B1, B2, B3... C1...). I want to include a restriction such that I can only invest in one asset from a given country. For example, if I invest in asset A1, then I cannot invest in any other &quot;A&quot; asset. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am new to portfolio optimisation and wanted to ask if there is any package in R perhaps that can efficiently solve this problem? Is this called nonlinear integer constrained optimisation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would appreciate any references that deal with this problem and any links to R packages that might be useful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="5190" LastActivityDate="2017-03-17T20:25:38.607" Title="Portfolio optimisation with conditional weight restrictions among asset" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;&lt;portfolio-selection&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33049" PostTypeId="2" ParentId="33048" CreationDate="2017-03-16T04:45:30.403" Score="1" Body="&lt;p&gt;Since you'd specified the objective function is mean-variance, then this is an easy problem to tackle. Let $R = (R_{A1}, \ldots, R_{An}, \ldots, R_{Z1}, \ldots, R_{Zn})$ be the vector of returns for all $A$ to $Z$ countries, and for simplicity in notation, let's just say each country has the same number of stocks (just adjust the notations and dimensions accordingly if it were not the case). Let $dim(R) = N$, and let $\mu = E[R]$ be the mean return vector, and $\Sigma = Var(R)$ be the variance-covariance matrix. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The usual mean-variance optimization problem (can be written in a several different ways, but this is one way): &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ &#xA;     \max_{\pi} \; \pi^\top \mu - \frac{\eta}{2} \pi^\top \Sigma \pi &#xA;\tag{O} &#xA;$$&#xA;where $\eta &amp;gt; 0$ can be thought of as the risk aversion of the investor. Here, $\pi$ is the $N$-dimensional vector representing the portfolio weights, and so we have the budget constraint that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\pi^\top \iota = 1 \tag{1} &#xA;$$, &#xA;where $\iota$ is the $N$-dimensional vector of one's. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without any further constraints, the solution to the above optimization problem is the mean-variance solution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you are looking for is a problem with additional constraints. Without loss of generality, reorder the indexing if necessary, let's just say you want to only invest into stock number 1 of each country. Define an $n \times n$ matrix $K$ of the form, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;K = &#xA;\begin{bmatrix} &#xA;1 &amp;amp; 0 &amp;amp; \ldots &amp;amp; 0 \\ &#xA;1 &amp;amp; 0 &amp;amp; \ldots &amp;amp; 0 \\ &#xA;  &amp;amp;   &amp;amp; \ddots &amp;amp;   \\  &#xA;1 &amp;amp; 0 &amp;amp; \ldots &amp;amp; 0  &#xA;\end{bmatrix}&#xA;$$&#xA;then you define the constraints on countries A through Z as, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ &#xA;K\pi_A = e_1, \ldots, K\pi_Z = e_1 &#xA;\tag{2} &#xA;$$&#xA;where $\pi_j = (\pi_{j1}, \ldots, \pi_{jn} )^\top$ is the portfolio vector for country $j$. (there's clearly a way to stack all of this into one big matrix equation, but the dimensions and notation will get messy and I'm too lazy to rewrite the OP's notation for countries A through Z). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In all, we have a concave objective function $(O)$, subject to two linear constraints, where $(1)$ is a (linear) budget constraint, and $(2)$ is a (linear) country constraint. The solution exists and is unique. Moreover, at this time, any quadratic programming solver can solve this (indeed, one can even setup the Lagrangian and all and solve this almost explicitly). &lt;/p&gt;&#xA;" OwnerUserId="17332" LastEditorUserId="17332" LastEditDate="2017-03-16T11:13:48.767" LastActivityDate="2017-03-16T11:13:48.767" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="33050" PostTypeId="2" ParentId="31284" CreationDate="2017-03-16T06:03:11.813" Score="1" Body="&lt;p&gt;This is a question of how to aggregate ratios. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see your two options, and raise you one more.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Method 1: The mean (or median) value of Price-to-Book values for individual securities&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;$$f(E[x]) = \frac{\sum_{i}^{n} \frac{P_i}{B_i}}{n} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pros: Relatively simple to calculate and gives an idea of what the typical company's Price-to-Book is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cons: Individual company values can tend towards extremes. Because it is a ratio, you will get asymtpotically small and large numbers in your data-set which skew the results. For example, a relatively large cap company can have an extremely high or even negative book value. Likewise, relatively small cap companies, through any number of accounting anomalies (anyone remember Chinese reverse take-overs and variable interest entities?), can have very large book values.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;Method 2: The aggregate value&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;$$E[f(x)] = \frac {\sum_{i}^{n} {P_i}}{\sum_i^n B_i} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pros: Also relatively simple to calculate. Resilient to outliers and small-cap anomalies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cons: Tends to be skewed towards larger cap companies which may not give a good idea of the typical company's price-to-book.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;Method 3: The harmonic mean defined by:&#xA;$$\frac{1}{f(E[x^{-1}])} = \frac{n}{(\frac{1}{x_1}+\frac{1}{x_2}+\frac{1}{x_3}+...\frac{1}{x_n})} $$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Pros: useful for taking the average of certain ratios. In this case, where $x_i$ represents a security's price-to-book, it is essentially taking the mean of the inverse of price-to-book (i.e., book-to-market). Taking the mean of the book-to-market will be more resilient to outliers since market caps are on the denominator and cannot be zero or less than zero. You will thereby eliminate the problem of asymptotic values.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cons: It may be inappropriate in certain situations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally, I prefer the sector aggregate method because it gives an unbiased estimate of the actual mean. In certain cases, when I am trying to get an idea of the typical company's multiple, I will take the median value. In situations where it seems to appropriate to take the harmonic average, I can't help but to think that I should've just started with the inverse as my baseline.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2017-03-30T22:59:25.117" LastActivityDate="2017-03-30T22:59:25.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33051" PostTypeId="2" ParentId="26302" CreationDate="2017-03-16T06:28:46.343" Score="2" Body="&lt;p&gt;I've posted on &lt;a href=&quot;https://sites.google.com/site/waynelinchang/r-code&quot; rel=&quot;nofollow noreferrer&quot;&gt;my website&lt;/a&gt; R code that replicates the Fama-French factors (plus momentum) from scratch. It assumes you have access to WRDS but if you have your own data, you can begin using the code where ever you see fit. In your case, you'd want to start in the Construct Fama-French Factors section of my Main_Fama_French file and also look at the Form_CharSizePorts2 function in the Support_Functions file.&lt;/p&gt;&#xA;" OwnerUserId="27015" LastActivityDate="2017-03-16T06:28:46.343" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33052" PostTypeId="1" AcceptedAnswerId="33054" CreationDate="2017-03-16T07:19:10.237" Score="1" ViewCount="46" Body="&lt;p&gt;How does a hike in interest rate results in drop in yields of treasuries?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My understanding was that when interest rate rises, investors would sell-off bonds, which would result in increase in yields.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/MI5Zn.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/MI5Zn.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26689" LastActivityDate="2017-03-16T08:30:51.577" Title="Relationship between hike in interest rate and drop in treasuries yields" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;bond-yields&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33054" PostTypeId="2" ParentId="33052" CreationDate="2017-03-16T08:30:51.577" Score="2" Body="&lt;p&gt;What happened was that the Fed indeed hiked by 25bp (as expected) but also conveyed the message that future hikes would be quite gradual (this was not expected).  The market therefore altered its expected path of Fed funds downwards and hence the yield of Treasuties downwards.  It's all about what happened versus previous expectations.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-03-16T08:30:51.577" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33055" PostTypeId="1" CreationDate="2017-03-16T09:34:26.800" Score="2" ViewCount="793" Body="&lt;p&gt;I am trying to compute quarterly returns with daily stock prices. However, I don't want to use the quantmod function &quot;quarterlyReturn(x)&quot; for each single stock but instead for the whole list of stocks...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would be happy about any advice on how to get there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The beginning looks like this: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; TickerList &amp;lt;- c(&quot;SPG&quot;, &quot;AKR&quot;,&quot;AIV&quot;, &quot;ARE&quot;, &quot;AAT&quot;, &quot;AMT&quot;, &quot;ARI&quot;, &quot;ABR&quot;, &quot;ARR&quot; )&#xA;&#xA; ClosingPricesRead &amp;lt;- NULL for (Ticker in TickerList)  ClosingPricesRead &amp;lt;- cbind(ClosingPricesRead,&#xA;                  getSymbols(Ticker, from=&quot;1950-01-01&quot;, &amp;gt;verbose=FALSE, auto.assign=FALSE)[,6]) &#xA;&#xA;    ClosingPrices &amp;lt;- ClosingPricesRead[apply(ClosingPricesRead,1,function(x)&#xA;                     all(!is.na(x))),]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I would like to convert my daily closing Prices to quarterly returns, in such a way that I get a new dataframe with the returns for all Stocks. &#xA; I tried to use the quantmod package so that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;apply(ClosingPrices, 2, function(x),quarterlyReturn(x))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;But I am just receiving error messages... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since I am fairly new to R, I would really appreciate your help!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks&lt;/p&gt;&#xA;" OwnerUserId="27019" LastEditorUserId="27019" LastEditDate="2017-03-16T09:40:48.647" LastActivityDate="2017-05-19T13:03:02.607" Title="Calculating Quarterly Returns using Daily Prices in R" Tags="&lt;programming&gt;&lt;returns&gt;&lt;quantmod&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33057" PostTypeId="1" AcceptedAnswerId="33058" CreationDate="2017-03-16T10:29:47.957" Score="4" ViewCount="205" Body="&lt;p&gt;This is the derivative security (its underlying index is the S&amp;amp;P 500):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;time to expiry $=4.8$Y;&lt;/li&gt;&#xA;&lt;li&gt;payoff calculation (0): on the expiry date, give a look at S&amp;amp;P 500 and let its price to be $S_{T}$. Furthermore, let S&amp;amp;P 500 price on issue date was $S_{0}=2,078.36$;&lt;/li&gt;&#xA;&lt;li&gt;payoff calculation (scenario 1): if $S_{T}&amp;lt;2,078.36$, you will get a nominal amount equal to \$$2,000$;&lt;/li&gt;&#xA;&lt;li&gt;payoff calculation (scenario 2): if $2,078.36&amp;lt;S_{T}&amp;lt;3,034.4056$, you will get a nominal amount equal to \$$2,000(\frac{S_{T}}{S_{0}})$, that is, \$$2,000$ times S&amp;amp;P 500 performance from $t=0$ to $t=T$;&lt;/li&gt;&#xA;&lt;li&gt;payoff calculation (scenario 3): if $S_{T}&amp;gt;3,034.4056$, you will get a nominal amount equal to \$$2,920$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Practical example of payoff: let you paid it \$$2,000$ on $t=0$ and today $S_{t}=2,372.6$, you would have following payoffs in each scenario...&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;(scenario 1) \$$[2,000 - 2,000=0]$;&lt;/li&gt;&#xA;&lt;li&gt;(scenario 2) \$$[2,000(\frac{2,372.6}{2,078.36})-2,000=283.15]$ if $S_{t}=S_{T}$;&lt;/li&gt;&#xA;&lt;li&gt;(scenario 3) \$$[2,920-2,000=920]$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What kind of security is this? Very straightforward to describe: a zero coupon bond plus a vertical spread, the latter being made up by a long Call struck @ $2,078.36$ and a short Call struck @ $3,034.4056$ that acts like a &quot;cap&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Forgive Italian language and give a look at following image to clarify:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/SWuAB.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/SWuAB.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I thought this was easy to price:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;discount \$$2,000$ by a swap curve and issuer's Z-spread;&lt;/li&gt;&#xA;&lt;li&gt;transform underlying price $S_{t}$ to this security's &quot;price&quot; $S^{*}_{t}$: if $t=$ today you would have \$$2,000(\frac{2,372.6}{2,078.36})=2,283.15$;&lt;/li&gt;&#xA;&lt;li&gt;price a $4.8$Y Call struck @ $2,000$ using $S^{*}_{t}$;&lt;/li&gt;&#xA;&lt;li&gt;price a $4.8$Y Call struck @ $2,920$ using $S^{*}_{t}$;&lt;/li&gt;&#xA;&lt;li&gt;sum 1 to 3 and subtract 4.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Some kind of bicubic interpolation yields an S&amp;amp;P 500 implied volatility roughly equal to $22\%$ for 3 and $18\%$ for 4, hence Black &amp;amp; Scholes Call options NPVs should be \$$563$ and \$$158$; moreover, zero coupon clean price should be \$$1,850$ @ Z$+142$ bps (issuer's $5$Y CDS spread).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instrument NPV$=$\$$[1,850+563-158=2,255]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Questions&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Do you think my reasoning is correct? If not, why?&lt;/li&gt;&#xA;&lt;li&gt;If it is correct, how would you explain that its market maker sells it @ \$$2,016$? I know who the market maker is, I would find extremely difficult that they're mispricing it.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Note: Call options have been priced according to a generalized Black &amp;amp; Scholes process assuming $0\%$ risk free rate and dividend yield.&lt;/p&gt;&#xA;" OwnerUserId="3058" LastEditorUserId="3058" LastEditDate="2017-03-16T14:36:35.150" LastActivityDate="2017-03-16T14:36:35.150" Title="Pricing an &quot;equity protection&quot; derivative: a practical example" Tags="&lt;option-pricing&gt;&lt;derivatives&gt;&lt;numerairechange&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33058" PostTypeId="2" ParentId="33057" CreationDate="2017-03-16T11:28:15.913" Score="4" Body="&lt;p&gt;The payoff you mention writes:&#xA;$$ V_T = N \left( 1 + \frac{1}{S_0}(S_T - K_1)^+ - \frac{1}{S_0}(S_T - K_2)^+ \right) $$&#xA;with $K_1=S_0=2078.36 &amp;lt; K_2 = 3034.4056$ and $N=2000$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus taking a risk-neutral discounted expectation of the payoff yields the price at time $t$:&#xA;$$ V_t = N B(t,T) + \frac{N}{S_0} C(K_1, T-t) - \frac{N}{S_0}C(K_2, T-t) $$&#xA;hence&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$N$ times the price of a zero coupon bond with time to expiry $\tau=T-t=4.8Y$&lt;/li&gt;&#xA;&lt;li&gt;plus, $N/S_0$ times the price of a call on the S&amp;amp;P struck at $K_1=S_0=2078.36$, $\tau=4.8Y$&lt;/li&gt;&#xA;&lt;li&gt;minus, $N/S_0$ times the price of a call on the S&amp;amp;P struck at $K_2=3034.4056$, $\tau=4.8Y$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2017-03-16T11:45:50.157" LastActivityDate="2017-03-16T11:45:50.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33059" PostTypeId="2" ParentId="33048" CreationDate="2017-03-16T11:34:50.460" Score="2" Body="&lt;p&gt;You could try a heuristic approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem can be split into two nested optimisations: i) in the inner optimisation, given a set of selected assets, compute mean--variance efficient weights; ii) in the outer optimisation, you iterate through combinations of assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The inner optimisation can be solved via a quadratic&#xA;programme (QP). For the outer optimisation, you could&#xA;use a local-search technique. To sketch how such a&#xA;method could be applied, I create some random data. I&#xA;will assume that for every asset, there are 60 return&#xA;observations (for intuition, think of them&#xA;as monthly returns).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;set.seed(75578)&#xA;&#xA;I &amp;lt;- cbind(0:15*1440+1, 1:16*1440)&#xA;rownames(I) &amp;lt;- LETTERS[1:nrow(I)]&#xA;colnames(I) &amp;lt;- c(&quot;first&quot;, &quot;last&quot;)&#xA;&#xA;R &amp;lt;- rnorm(60*max(I), sd = 0.02)&#xA;dim(R) &amp;lt;- c(60, max(I))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The returns matrix &lt;code&gt;R&lt;/code&gt; is of size 60 times 23040, as per your comment: 16 countries with 1440 assets each. The&#xA;columns of &lt;code&gt;R&lt;/code&gt; are assigned to countries A, B, ...  and the &#xA;start and end indices for each country are in matrix &lt;code&gt;I&lt;/code&gt;. This latter matrix looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   first   last&#xA;A      1   1440&#xA;B   1441   2880&#xA;C   2881   4320&#xA;D   4321   5760&#xA;E   5761   7200&#xA;F   7201   8640&#xA;G   8641  10080&#xA;H  10081  11520&#xA;I  11521  12960&#xA;J  12961  14400&#xA;K  14401  15840&#xA;L  15841  17280&#xA;M  17281  18720&#xA;N  18721  20160&#xA;O  20161  21600&#xA;P  21601  23040&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I collect all these data in a single list, which makes&#xA;it easier to pass the information to a function.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Data &amp;lt;- list(I = I,&#xA;             nc = nrow(I),&#xA;             R = R)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now suppose we have some set of assets:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x &amp;lt;- Data$I[,1]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;x&lt;/code&gt; looks as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    A     B     C     D     E     F     G     H &#xA;    1  1441  2881  4321  5761  7201  8641 10081 &#xA;    I     J     K     L     M     N     O     P &#xA;11521 12961 14401 15841 17281 18721 20161 21601&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To compute the solution to the inner problem, I use the&#xA;function &lt;code&gt;mvar&lt;/code&gt;. To keep things simple, it computes the long-only&#xA;minimum-variance portfolio. The function makes use of the NMOF package. (I am the author of the package. You will need the latest version, which can be installed as shown below or from GitHub; with the CRAN version, you will have to write &lt;code&gt;NMOF:::minvar&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;## install.packages('NMOF', type = 'source',&#xA;##                  repos = c('http://enricoschumann.net/R',&#xA;##                            getOption('repos')))&#xA;require(&quot;NMOF&quot;)&#xA;&#xA;mvar &amp;lt;- function(x, Data) {&#xA;    cv &amp;lt;- cov(Data$R[ ,x])&#xA;    w &amp;lt;- minvar(cv, wmin = 0, wmax = 0.5)&#xA;    c(sqrt(w %*% cv %*% w))&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We check how good the portfolio &lt;code&gt;x&lt;/code&gt; is by computing its objective function value.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mvar(x, Data)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which, with the given seed, is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;0.003645508&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Actually, before we use a local search, let us try&#xA;a 'constructive' solution as a benchmark: select the asset with the&#xA;lowest volatility from every country, and then compute the&#xA;minimum-variance weights for this selection.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x_sort &amp;lt;- numeric(Data$nc)&#xA;for (i in 1:nrow(Data$I)) {&#xA;    cols  &amp;lt;- Data$I[i,1]:Data$I[i,2]&#xA;    x_sort[i] &amp;lt;- cols[order(apply(Data$R[ ,cols ], 2, sd))[1]]&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We can compute this solution's objective function value&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mvar(x_sort, Data)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is better: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;0.002234832&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note that the volatility (0.2%) is an&#xA;order of magnitude lower than the average volatility in the&#xA;random data set, which was 2%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, in a local search, we start with some solution and&#xA;try to improve it iteratively. For this, we need a&#xA;neighbourhood function that takes a solutions and&#xA;returns a slightly changed solution. Here is one way to&#xA;write such a function.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;nb &amp;lt;- function(x, Data) {&#xA;&#xA;    ## randomly pick one country &#xA;    i &amp;lt;- sample(Data$nc, 1)&#xA;&#xA;    ## randomly pick one asset &#xA;    x[i] &amp;lt;- sample(Data$I[i,1]:Data$I[i,2], 1)&#xA;&#xA;    x&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I try two local-search algorithms: a simple&#xA;stochastic local search (&lt;code&gt;LSopt&lt;/code&gt;) and Threshold Accepting (&lt;code&gt;TAopt&lt;/code&gt;). I&#xA;use the implementations in the NMOF package. The difference between the two algorithms is that &lt;code&gt;LSopt&lt;/code&gt; will&#xA;only accept neighbours that are not worse than the&#xA;current solution, whereas &lt;code&gt;TAopt&lt;/code&gt; is more forgiving and will&#xA;even accept solutions that are slightly worse than the&#xA;current solution. In this way, &lt;code&gt;TAopt&lt;/code&gt; may escape from local&#xA;minima. Both methods use 100000 iterations.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;steps &amp;lt;- 100000&#xA;sol_LS &amp;lt;- LSopt(mvar, list(x0 = Data$I[,1],&#xA;                           neighbour = nb,&#xA;                           nS = steps),&#xA;                Data = Data)&#xA;&#xA;sol_TA &amp;lt;- TAopt(mvar, list(x0 = Data$I[,1],&#xA;                           neighbour = nb,&#xA;                           nS = steps/10),&#xA;         Data = Data)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;We can compare the results of both methods with our&#xA;benchmark solution, which I add as a blue horizontal&#xA;line. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;par(mar = c(5,5,1,1), las = 1, mgp = c(3,0.25,0), tck = 0.01)&#xA;plot(x = seq(1, steps, length.out = 1000),&#xA;     y = sol_TA$Fmat[seq(1, steps, length.out = 1000),2], log = &quot;y&quot;,&#xA;     xlab = &quot;iteration&quot;, ylab = &quot;portfolio vol&quot;, type = &quot;l&quot;)&#xA;lines(x = seq(1, steps, length.out = 1000),&#xA;     y = sol_LS$Fmat[seq(1, steps, length.out = 1000),2], col = grey(.4))&#xA;abline(h = mvar(x_sort, Data), col = &quot;blue&quot;)&#xA;legend(&quot;topright&quot;, &#xA;       legend = c(&quot;Local Search&quot;, &quot;Threshold Accepting&quot;),&#xA;       col = c(grey(.4), &quot;black&quot;), lwd = 4, lty =1)&#xA;text(x = steps*0.8, y = mvar(x_sort, Data), pos = 3,&#xA;     &quot;lowest-vol asset per country&quot;, col = &quot;blue&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/WhOci.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/WhOci.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;LSopt&lt;/code&gt; (grey) and &lt;code&gt;TAopt&lt;/code&gt; (black) both achieve solutions of around 0.1%, so substantially better than the constructive solution. Threshold Accepting performs slightly better than a simple local search.&lt;/p&gt;&#xA;" OwnerUserId="6857" LastEditorUserId="6857" LastEditDate="2017-03-17T20:25:38.607" LastActivityDate="2017-03-17T20:25:38.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33060" PostTypeId="1" AcceptedAnswerId="33064" CreationDate="2017-03-16T15:05:23.013" Score="7" ViewCount="738" Body="&lt;p&gt;I'm reading Nassim Taleb's book &quot;Dynamic Hedging&quot;, on page 22 he says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Consequently, a straddle will be qual to two calls delta neutral or&#xA;  two puts delta neutral (of the same strike). Assume that the forward&#xA;  delta of a put is 30%, &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$$Straddle = 2P + .6F = 2(C-F) + .6F = 2C - 2F + .6F = 2C - 1.4F$$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I really couldn't understand this, according to &lt;a href=&quot;https://en.wikipedia.org/wiki/Straddle&quot; rel=&quot;noreferrer&quot;&gt;wiki straddle page&lt;/a&gt; &quot;A straddle involves buying a call and put with same strike price and expiration date&quot;, so &#xA;$$Straddle = P + C$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Taleb's example, he's assuming $C = 0.3F$ and $P = -0.7$, so &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Straddle = P + C = -0.7F + 0.3 F = 0.4F $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This doesn't tally with his equation $Straddle = 2P + .6F = 2(C-F) + .6F = 2C - 2F + .6F = 2C - 1.4F$. What's the catch?&lt;/p&gt;&#xA;" OwnerUserId="2161" LastEditorUserId="2161" LastEditDate="2017-03-16T15:22:04.083" LastActivityDate="2017-03-17T08:26:43.323" Title="&quot;a straddle will be equal to two calls delta neutral or two puts delta neutral&quot;?" Tags="&lt;options&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33061" PostTypeId="1" CreationDate="2017-03-16T16:33:51.670" Score="1" ViewCount="51" Body="&lt;p&gt;I'm using a service provider to access FX data, and when requesting the ticker &lt;code&gt;SWEUBOE&lt;/code&gt; which is the Bank of England's exchange rate for EUR and CHF, I get the following meta information:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;From Currency Swiss Franc &#xA;To Currency   Euro &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Yet the value of this rate for today(2017.03.16) is 1.0716 (EUR) which is clearly the other way round, i.e. it's from EUR to Swiss francs(i.e. 1 EUR = 1.0716 CHF).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the service provider giving me incorrect information or did I misunderstand something about the &quot;from&quot; and &quot;to&quot; currency?&lt;/p&gt;&#xA;" OwnerUserId="26765" LastEditorUserId="24222" LastEditDate="2017-03-16T17:57:17.013" LastActivityDate="2017-03-16T17:57:17.013" Title="Definition of &quot;From Currency&quot; and &quot;To Currency&quot;?" Tags="&lt;fx&gt;" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="33064" PostTypeId="2" ParentId="33060" CreationDate="2017-03-16T18:38:04.057" Score="7" Body="&lt;p&gt;To clarify Taleb's example, let's draw how the value of the position $2*P + 0.6*F$ depends on spot $S$. Assume that strike is $K=50$ for both put and forward, and interest rate is zero, so $F = S - K$:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/lAHgJ.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/lAHgJ.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose that current spot price is $S= 55.8$ as shown by black dotted line. Then delta of $P$ will be $-0.3$ and delta of $2*P$ will be $-0.6$. Delta of (long) $F$ is always $1$, so delta of $0.6F$ is $0.6$. Thus, the position is delta neutral around current spot price and you can see in the picture that the value &quot;2*P + 0.6F now&quot; is almost flat there and looks similar to value of straddle (with strike $K_1 = 55.8$). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is important to understand that Taleb is not saying that $P = 0.3F$ where $P$ and $F$ are values of put and forward. But he is saying that at some spot price ($S=55.8$ in our case) the delta of $P$ is $-0.3F$ and the postion behaves like straddle. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To finish, let's also look at the value of the equivalent position $2*C - 1.4*F$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/bH3u6.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/bH3u6.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;As you can see the value of the position is the same.&lt;/p&gt;&#xA;" OwnerUserId="15154" LastEditorUserId="15154" LastEditDate="2017-03-17T08:26:43.323" LastActivityDate="2017-03-17T08:26:43.323" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33065" PostTypeId="2" ParentId="31048" CreationDate="2017-03-16T19:08:43.277" Score="1" Body="&lt;p&gt;Most French website data contains annual factors too. You just have to scroll to the bottom of the text file after the monthly data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, this is a &lt;a href=&quot;https://quant.stackexchange.com/questions/18808/french-data-from-daily-to-monthly-returns&quot;&gt;related question&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="27015" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2017-03-16T19:08:43.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33066" PostTypeId="2" ParentId="33004" CreationDate="2017-03-16T19:12:21.503" Score="1" Body="&lt;p&gt;remember that a asset or nothing call on eurusd = cash or nothing put on usdeur&lt;/p&gt;&#xA;" OwnerUserId="17348" LastActivityDate="2017-03-16T19:12:21.503" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33067" PostTypeId="2" ParentId="18808" CreationDate="2017-03-16T19:18:53.583" Score="5" Body="&lt;p&gt;You're compounding correctly but the discrepancy is not just because of rounding. SMB and HML are formed as averages of 6 and 4 different portfolios, respectively. As French's website explains, this results from cutting all stocks into 2x3 SizexBook portfolios. French compounds each of these portfolios to the proper horizon (eg monthly) and then averages these portfolios to get SMB and HML. This is not the same as directly compounding SMB and HML from daily data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is because compounding SMB and HML daily data assumes daily rebalancing to equal weights of the portfolios that constitute them. French does not assume this rebalancing for longer horizons but instead, holds the constituent portfolios to the proper horizon before SMB and HML are formed at the end of the horizon. This applies to the weekly, monthly and annual factors he posts.&lt;/p&gt;&#xA;" OwnerUserId="27015" LastEditorUserId="27015" LastEditDate="2017-04-16T18:12:06.793" LastActivityDate="2017-04-16T18:12:06.793" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33068" PostTypeId="2" ParentId="25897" CreationDate="2017-03-16T19:28:13.363" Score="2" Body="&lt;p&gt;Size uses June market-cap data because market prices, unlike accounting data, is publicly available immediately. Book-to-market uses market-cap data from December to align with December book-value data. &lt;a href=&quot;http://www.iijournals.com/doi/abs/10.3905/jpm.2013.39.4.049&quot; rel=&quot;nofollow noreferrer&quot;&gt;Asness, Frazzini (2013) The Devil in HML's Details&lt;/a&gt; argues for calculating a more up-to-date book-to-market by using June market-cap data (even though it is no long aligned to December book-value). Still, how Fama-French does it remains the standard approach in the literature.&lt;/p&gt;&#xA;" OwnerUserId="27015" LastActivityDate="2017-03-16T19:28:13.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33069" PostTypeId="1" AcceptedAnswerId="33073" CreationDate="2017-03-16T21:37:19.170" Score="2" ViewCount="90" Body="&lt;p&gt;I'm calculating the P/E ratio of some International stocks and found a problem. Please look at this paticular stock:&lt;a href=&quot;http://finance.yahoo.com/quote/Y92.SI/financials?p=Y92.SI&quot; rel=&quot;nofollow noreferrer&quot;&gt;Thai Beverage Public Company Limited&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The p/e calculated by yahoo finance is 31.33. Similar results can be found at &lt;a href=&quot;https://www.google.com/finance?q=SGX%3AY92&quot; rel=&quot;nofollow noreferrer&quot;&gt;google finance&lt;/a&gt; and &lt;a href=&quot;https://www.bloomberg.com/quote/Y92:SP&quot; rel=&quot;nofollow noreferrer&quot;&gt;bloomberg&lt;/a&gt; which are all over 20.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you look at &lt;a href=&quot;http://finance.yahoo.com/quote/Y92.SI/financials?p=Y92.SI&quot; rel=&quot;nofollow noreferrer&quot;&gt;income statement&lt;/a&gt; of this company, the net income is 25,226,000 thousands ~ 25 billions, and the market cap is 23.6 billion, which suggests p/e less than 1 (0.94)! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And I believe the net income data is correct on yahoo finance, because I have cross validated it with compustats global data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I missing something here? Why the discrenpency? Thank you!&lt;/p&gt;&#xA;" OwnerUserId="20161" LastActivityDate="2017-03-17T03:22:10.667" Title="How to correctly calculate P/E ratio of Singapore stocks?" Tags="&lt;valuation&gt;&lt;fundamentals&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33070" PostTypeId="1" CreationDate="2017-03-16T22:14:41.323" Score="1" ViewCount="95" Body="&lt;p&gt;I have seen marketing materials advertising ETCs on single commodities futures to track the commodities performance (or better the corresponding front month future contract) as Delta 1 products. However, as time goes by the underlying future contract needs to be rolled, which means we leave the current (soon to expire) contract and enter into the upcoming front month contract. This in turn is likely to change the participation rate (the number of underlying future contracts which the ETC holds). Is it correct that the delta of the ETC equals the participation rate and, thereby, could be quite different from 1? What other risk factors can be relevant here from a hedging perspective?   &lt;/p&gt;&#xA;" OwnerUserId="20736" LastActivityDate="2017-03-16T22:14:41.323" Title="Delta of a Single Future Commodities ETC" Tags="&lt;delta&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33071" PostTypeId="1" CreationDate="2017-03-17T01:46:51.163" Score="0" ViewCount="254" Body="&lt;p&gt;Forgive my ignorance about my question. I understand a Monte Carlo simulation to basically be &lt;code&gt;n&lt;/code&gt; times that the truth is checked in some historic data set. For stock prices, if I buy some symbol at say \$100 and I want to predict the probability that the price will reach \$105 within 30 days.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I use a MC simulation to look at historic prices and see what the percent gain / loss was over a 30 day period from random starting points and use that to build my probability curve?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is that too naive or will that yield decent results?&lt;/p&gt;&#xA;" OwnerUserId="2928" LastActivityDate="2017-03-17T01:46:51.163" Title="Is using a Monte Carlo simulation sufficient for predicting probabilities that a stock will hit a certain price by a certain date?" Tags="&lt;monte-carlo&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33072" PostTypeId="2" ParentId="33069" CreationDate="2017-03-17T02:35:32.567" Score="0" Body="&lt;p&gt;There are two things I could think of. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, when a stock has preferred shares, you have to subtract out the dividends to preferred share to get earnings available to common stockholders. I don't think Thai Beverage has preferred stock, but you should be able to check that on Bloomberg. If they are, then this would reduce earnings per share and increase the P/E.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other correction is account for dilution in earnings per share. Diluted earnings per share takes into account the ability of some securities to convert into common stock. Some examples of these are convertible bonds, options, or preferred stock. If they are converted to common stock, then there will be more shares and thus less earnings per share, which would mean a higher P/E.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2017-03-17T02:35:32.567" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33073" PostTypeId="2" ParentId="33069" CreationDate="2017-03-17T03:22:10.667" Score="4" Body="&lt;p&gt;Just figured it out with the help from someone else... The market cap is in Singapore dollar because it's traded on Singapore exchange, but their income statement is in Thai Baht... That's why :)&lt;/p&gt;&#xA;" OwnerUserId="20161" LastActivityDate="2017-03-17T03:22:10.667" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33074" PostTypeId="1" AcceptedAnswerId="33110" CreationDate="2017-03-17T04:34:35.803" Score="1" ViewCount="325" Body="&lt;p&gt;Short version: How do I evaluate models that predict stock performance?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Back story: I'm working for a stock analyst, writing an application to sort through stocks and find candidates that fit the criteria he is looking for. The point is to bring stocks to his attention so he can do fundamental analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, he has a mechanism for calculating the expected price range, then we look at where it is currently in that range.&#xA;There are various factors that might put pressure on the stock to move up or down.&#xA;Each of his models gives the various factors a different weighting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We want to backtest the models against the last ten years of data, including the recession.&#xA;For the top and bottom 25 stocks for a given model projection, I need to score how the stocks did over the next period. Repeat. I cumulatively score the models and see which give the best predictions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is how best to score the stock performance.&lt;br&gt;&#xA;Do I take into account that they should sell if the stock price goes down e.g. &gt; 10% of the price range or that the stop-loss should ratchet up?&#xA;But those have more to do with the buying/selling scheme, nothing to do with the projection model.&lt;br&gt;&#xA;In this case, I just want to evaluate model against model.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I compare price rise to change of the entire market?&#xA;Or just within industry?&#xA;Or compare against the price range for that stock?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are lots of sites that allow you to do backtesting, but that doesn't answer my question about how to score the models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2230499&quot; rel=&quot;nofollow noreferrer&quot;&gt;article on evaluating Bollinger Bands&lt;/a&gt; comes the closest of anything I've seen to touching on the topic but still manages to avoid it.&lt;/p&gt;&#xA;" OwnerUserId="27032" LastActivityDate="2017-03-19T17:32:49.713" Title="strategy for backtesting" Tags="&lt;backtesting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33076" PostTypeId="1" CreationDate="2017-03-17T10:33:07.267" Score="0" ViewCount="7300" Body="&lt;p&gt;I want to calculate excess return for AAPL plus the S&amp;amp;P 500. I have computed monthly and daily logarithmic returns for every stock and for the market, I now need to calculate the risk free interest rate in order to be able to compute the excess return for every stock and the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interest rates on three months T-Bills are a good proxy for the risk-free rate of return, but I have a lot of doubts on how to use data provided by Yahoo! Finance in order to compute the daily risk-free. I use the 13 week treasury bill (ticker: ^IRX) historical quotes provided by Yahoo! Finance. I divided t-bill rate by 100 and calculate the daily excess returns. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;             t-bill         AAPL           Excess&#xA;2017-01-31    0.500     -0.00230205    -0.00730020&#xA;2017-01-30    0.495     -0.00262402    -0.00762402&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I realized that monthly t-bill rate units are the same as daily rates.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;              t-bill      AAPL          &#xA;Jan 2017      0.500      0.0477  &#xA;Dec 2016      0.480      0.0479 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am making a mistake while computing daily and monthly t-bill rate units. The Federal Reserve (&lt;a href=&quot;https://fred.stlouisfed.org/series/DTB3&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://fred.stlouisfed.org/series/DTB3&lt;/a&gt;) also provide the same t-bill rates for daily and monthly frequency as in Yahoo Finance. How can I correctly calculate the excess returns? Thanks for any answer.  &lt;/p&gt;&#xA;" OwnerUserId="27034" LastActivityDate="2018-08-09T05:24:02.807" Title="how to calculate daily risk free rate using 13 week treasury bill" Tags="&lt;equities&gt;&lt;portfolio&gt;&lt;risk-free&gt;&lt;treasuries&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33077" PostTypeId="1" AcceptedAnswerId="33088" CreationDate="2017-03-17T13:40:36.120" Score="3" ViewCount="595" Body="&lt;p&gt;Almost spent the whole day. Could anyone give a link to the Gsr model specification that is implemented in QuantLib? Or give an explanation? Any help is highly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="26188" LastEditorUserId="26188" LastEditDate="2017-03-17T13:47:10.633" LastActivityDate="2017-03-18T13:05:42.243" Title="QuantLib Gsr model" Tags="&lt;stochastic-processes&gt;&lt;python&gt;&lt;quantlib&gt;&lt;short-rate&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33080" PostTypeId="2" ParentId="33076" CreationDate="2017-03-17T14:47:06.493" Score="2" Body="&lt;p&gt;If you want to do it super precisely, the convention for building fixed-income total return index is as follows:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You assume at the end of the month, you buy the instrument (in this case a 3-month T-bill).&lt;/li&gt;&#xA;&lt;li&gt;You hold this exact T-bill over the course of the next month and mark it to market daily and calculate the daily returns ($P_t / P_{t-1} - 1$, which is standard performance calculation).&lt;/li&gt;&#xA;&lt;li&gt;At the end of the month, you sell the T-bill and buy the next 3-month bill.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This of course requires that you have accurate bill pricing data. You can also look at the Bloomberg Barclays 3-Month Treasury Bellwether Index, or the BofA Merrill Lynch 3-Month Bill Index. Both are calculated this way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, a lot of people just use the previous month-end bill rate, divide it by 252, and use that as the daily bill return for the current month. Not as precise, but more than sufficient for most purposes.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2017-03-17T15:23:48.903" LastActivityDate="2017-03-17T15:23:48.903" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33081" PostTypeId="1" AcceptedAnswerId="33082" CreationDate="2017-03-17T17:36:53.467" Score="0" ViewCount="446" Body="&lt;p&gt;for a Quantitative project in Asset Management, I need to obtain for each year -on a long period (20 years) - the different historical constituents and their prices on a monthly basis for a given stock index (S&amp;amp;P 500 or CAC 40). &#xA;How should I proceed? I have try with Bloomberg but it's not possible since I don't have full access. &#xA;I do have access to Datastream but I only manage to have the historical prices on a monthly basis for the current constituents of the Index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="27042" LastEditorUserId="27042" LastEditDate="2017-03-17T18:08:40.660" LastActivityDate="2021-05-17T04:38:51.637" Title="How to download historical composition of a Stock Index with monthly prices" Tags="&lt;equities&gt;&lt;market-data&gt;&lt;historical-data&gt;&lt;indexes&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33082" PostTypeId="2" ParentId="33081" CreationDate="2017-03-17T18:22:32.177" Score="4" Body="&lt;p&gt;This is very difficult.  S&amp;amp;P actually wants you to pay for weightings that currently exist - they started charging for the weightings 8 years ago or so - used to be free.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Historical constituents seem like something you will have to pay S&amp;amp;P for - especially with all the quant traders out there who would love such info.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Happy to delete this answer if someone proves me wrong, but I expect you have to pay for this.&lt;/p&gt;&#xA;" OwnerUserId="26977" LastActivityDate="2017-03-17T18:22:32.177" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33085" PostTypeId="1" AcceptedAnswerId="33127" CreationDate="2017-03-17T22:18:31.417" Score="0" ViewCount="190" Body="&lt;p&gt;I want to prove that the following determinant, that appears in the markowitz method of portfolio allocation is greater than zero.&#xA;($\mu$ is the vector of returns and $\sum$ is the covariance matrix)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/JSjxX.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/JSjxX.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="25437" LastActivityDate="2017-03-20T17:42:57.350" Title="Prove that a determinant in markowitz method derivation is greater than zero" Tags="&lt;markowitz&gt;&lt;covariance-matrix&gt;&lt;proof&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33086" PostTypeId="1" AcceptedAnswerId="33125" CreationDate="2017-03-18T00:58:07.387" Score="3" ViewCount="1114" Body="&lt;p&gt;I will be using Eviews and am looking to forecast volatility of stock index returns using ARCH/GARCH models. I've generated the logarithmic returns and done the unit root tests. I then proceeded to plot the ACF and PAC functions of returns and squared returns to get an indication of the lags to include in my mean equation to remove autocorrelation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Eviews has a way to to do ARIMA forecasting using multiple combinations to get the appropriate AR and MA terms for my mean equation using a pre-selected criteria such as lowest AIC. When you run this, it shows all the combinations and the respective AICS's. Therefore I do this, and obtain the relevant AR and MA terms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I ran a Least Squares regression using these AR and MA terms from the automatic ARIMA forecasting, and after this I was able to see if there were ARCH effects using the residual diagnostics ARCH-LM test. I also run some other diagnostics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having seen that there are ARCH effects I proceed to estimate a GARCH(1,1). In my mean equation I used the same AR and MA terms generated in the Automatic ARIMA forecasting. After estimating, I check for significance, and run some residual diagnostics as well as checking fit for my model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question then is: Is there a need to do this ARIMA forecasting to find the most suitable AR and MA terms to use in the GARCH estimation? This procedure obviously will allow me to do a Least Squares regression for the AR and MA terms I get prior to estimating GARCH. It allows me to run Engle's ARCH-LM test for presence of ARCH effects, thus acting as a trigger for me to use GARCH models. Would the above procedure of running a Least Squares regression first be satisfactory, even if perhaps not optimal?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, however, I have read a bit on this site (correct me if I'm wrong please) that one could skip the Automatic ARIMA forecasting and jump straight to GARCH estimation after plotting the ACF and PAC (i.e. joint estimation)? I believe this would entail entering different AR and MA combinations in the mean equation when estimating GARCH, recording the AIC's and log-likelihood function of every combination run and then selecting the GARCH estimation with the lowest AIC. After this one would then run the standard residual diagnostic tests on the optimal model, and proceed to the forecasting stage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any detailed explanation of this would be most appreciated, as I'm struggling to get my head round the concept. Preferably if anyone could provide an Eviews-centric step-by-step guide to modelling and forecasting volatility that would be even better.&lt;/p&gt;&#xA;" OwnerUserId="27046" LastActivityDate="2017-03-20T15:33:08.147" Title="Correct procedure for modelling GARCH for forecasting volatility of stock Index returns" Tags="&lt;volatility&gt;&lt;time-series&gt;&lt;garch&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33088" PostTypeId="2" ParentId="33077" CreationDate="2017-03-18T13:05:42.243" Score="6" Body="&lt;p&gt;the model is described in Andersen, Piterbarg: Interest Rate Modeling. The formulas that are acutally implemented are derived here&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://ssrn.com/abstract=2246013&quot; rel=&quot;noreferrer&quot;&gt;https://ssrn.com/abstract=2246013&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best&#xA;Peter &lt;/p&gt;&#xA;" OwnerUserId="27051" LastActivityDate="2017-03-18T13:05:42.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33089" PostTypeId="1" AcceptedAnswerId="33091" CreationDate="2017-03-18T14:10:29.503" Score="13" ViewCount="11154" Body="&lt;p&gt;A number of quantitative finance textbooks mention something along the following lines, without further explanation:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A typical feature of implied volatility from stock index options is that it is higher than the historical/realized volatility of the index. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Here I assume that something like the VIX index or short-term ATM implied volatility is used as a measure of the overall level of implied volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above phenomenon seems to be referred to as the &quot;volatility risk premium&quot;, defined on Wikipedia as &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;...a measure of the extra amount investors demand in order to hold a volatile security, above what can be computed based on expected returns.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question 1:&lt;/strong&gt; Can someone elaborate on this argument? Do seller of options overcharge because of the inherent volatility risk that cannot be hedged away? Is this related to the market price of volatility risk? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, this consistent overpricing of options can be taken advantage of, e.g. by taking a short position in an ATM straddle (sell ATM call and put), i.e. sell volatility. This seems to be a profitable strategy, see e.g. &lt;a href=&quot;http://quantpedia.com/Screener/Details/20&quot; rel=&quot;noreferrer&quot;&gt;http://quantpedia.com/Screener/Details/20&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question 2:&lt;/strong&gt; Why don't simple strategies like these eliminate the fact that implied volatility is consistently higher than realized volatility? &lt;/p&gt;&#xA;" OwnerUserId="26887" LastActivityDate="2017-03-23T04:18:19.350" Title="Why is realized volatility typically lower than implied volatility?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;black-scholes&gt;&lt;implied-volatility&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="33091" PostTypeId="2" ParentId="33089" CreationDate="2017-03-18T17:22:10.130" Score="9" Body="&lt;p&gt;Consider what happens when IV is lower than realised vol. The person long the IV would make money. So there would ideally be no one selling IV if it's lower than realised vol on an average.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next if IV is equal to RV, then the guy selling the option has no incentive to sell since he won't make money on average. Also he has considerable risk in case RV turns out to be higher. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So IV is generally higher so as to compensate  the seller for the risks he is taking. Also not only is the seller short Vega, he is also short gamma which is another risk for which the seller need to be compensated. The reverse argument can be made for the guy buying the option. &lt;/p&gt;&#xA;" OwnerUserId="15428" LastActivityDate="2017-03-18T17:22:10.130" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="33092" PostTypeId="2" ParentId="33012" CreationDate="2017-03-18T18:57:07.633" Score="3" Body="&lt;p&gt;It must be a typo for the equation in the book. That is, the equation for a caplet is of the form&#xA;\begin{align*}&#xA;\frac{\partial V}{\partial t} + LV - r_t V +\max(r_t-r^*, 0) = 0,&#xA;\end{align*}&#xA;which can also be derived using the martingale approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, note that the accumulated payments from time $t$ up to maturity $T$ is given by&#xA;\begin{align*}&#xA;\int_t^T \max(r_s-r^*, 0)e^{\int_s^T r_u du} ds.&#xA;\end{align*}&#xA;Let $B_t=e^{\int_0^t r_udu}$ be the money market account value at time $t$. Then, the option value at time $t$ is given by&#xA;\begin{align*}&#xA;V_t &amp;amp;= B_tE\left(\frac{\int_t^T \max(r_s-r^*, 0)e^{\int_s^T r_u du} ds}{B_T} \mid \mathcal{F}_t \right)\\&#xA;&amp;amp;=B_tE\left(\frac{\int_0^T \max(r_s-r^*, 0)e^{\int_s^T r_u du} ds - \int_0^t \max(r_s-r^*, 0)e^{\int_s^T r_u du} ds}{B_T} \mid \mathcal{F}_t \right)\\&#xA;&amp;amp;=B_tE\left(\frac{\int_0^T \max(r_s-r^*, 0)e^{\int_s^T r_u du} ds}{B_T} \mid \mathcal{F}_t\right) \\&#xA;&amp;amp;\qquad- B_tE\left(\frac{\int_0^t \max(r_s-r^*, 0)e^{\int_s^T r_u du} ds}{B_T} \mid \mathcal{F}_t \right)\\&#xA;&amp;amp;=B_tE\left(\frac{\int_0^T \max(r_s-r^*, 0)e^{\int_s^T r_u du} ds}{B_T} \mid \mathcal{F}_t\right) -B_t\int_0^t \max(r_s-r^*, 0)e^{-\int_0^s r_u du} ds.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;M_t \equiv e^{-\int_0^t r_udu} V_t + \int_0^t \max(r_s-r^*, 0)e^{-\int_0^s r_u du} ds&#xA;\end{align*}&#xA;is a martingale. We assume that&#xA;\begin{align*}&#xA;dr_t = \mu(t, r_t) dt + \sigma(t, r_t) dW_t,&#xA;\end{align*}&#xA;where $\{W_t, t \ge 0\}$ is a standard Brownian motion. Then&#xA;\begin{align*}&#xA;dM_t &amp;amp;= -r_t e^{-\int_0^t r_udu} V dt + e^{-\int_0^t r_udu}\left(\frac{\partial V}{\partial t} + LV\right)dt\\&#xA;&amp;amp;\qquad + e^{-\int_0^t r_udu}\frac{\partial V}{\partial r}\sigma(t, r_t) dW_t + \max(r_t-r^*, 0)e^{-\int_0^t r_u du} dt.&#xA;\end{align*}&#xA;Consequently, &#xA;\begin{align*}&#xA;\frac{\partial V}{\partial t} + LV - r_t V +\max(r_t-r^*, 0) = 0.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-03-18T19:10:41.160" LastActivityDate="2017-03-18T19:10:41.160" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33093" PostTypeId="1" AcceptedAnswerId="33201" CreationDate="2017-03-18T19:04:38.517" Score="1" ViewCount="254" Body="&lt;p&gt;I am trying to implement the forward Monte Carlo algorithm from the paper &quot;A Forward Monte Carlo Method for American Options Pricing&quot; by Daniel Wei-Chung Miao and Yung-Hsin Lee. I am a little bit confused by the following notation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under the Pseudo-Critical Prices section, the authors state:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, consider an American call option. According to Barone-Adesi and Whaley (1987) (BAW), the optimal exercise boundary $S_c^{*}$ for the call option should solve the nonlinear equation at any time $t\in[0,T]$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation} \label{eq:2}&#xA;S_c^{*} = \frac{Q_2(C_e(S_c^{*}) + K)}{Q_2 - (1-C_e^{'}(S_c^{*}))}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $C_e(S)$ is the European call option price calculated by the Black-Scholes (1973) formula, $K$ is the strike price, together with the notation $Q_2 = \frac{-(n-1)+\sqrt{(n-1)^2 + 4m/k}}{2} &amp;gt; 0$ in which $m = \frac{2r}{\sigma^2}$, $n = \frac{2(r-q)}{\sigma^2}$, and $k = 1 - e^{-r(T-t)}$. Note that this study used more streamlined notations such as $S_e^{*} = S_c^{*}(t)$, $C_e(S) = C_e(S,t)$ when some dependent parameters are not stressed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Replacing the critical price $S_c^{*}$ on the right-hand side of the equation above with the current stock price $S$ yields a new but closely related function $f_c(\cdot)$. $$\hat{S_c} = f_c(S) = \frac{Q_2(C_e(S) + K)}{Q_2 - (1-C_e^{'}(S))}$$&#xA;where $\hat{S_c}$ represents the pseudo-critical price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the algorithm I need to compute $\hat{S_c}$ but what I am not understanding is it seems that $Q_2$ will just equal some number but then the formula for $\hat{S_c}$ has $Q_2$ acting as some function which does not make sense since it is just a number. Any suggestions or comments on the matter are greatly appreciated. &lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="24222" LastEditDate="2017-03-23T23:52:09.417" LastActivityDate="2017-03-23T23:52:09.417" Title="A forward Monte Carlo method for American Options Pricing" Tags="&lt;programming&gt;&lt;monte-carlo&gt;&lt;finance-mathematics&gt;&lt;homework&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33095" PostTypeId="1" AcceptedAnswerId="33101" CreationDate="2017-03-18T20:20:52.637" Score="2" ViewCount="374" Body="&lt;p&gt;I am using &lt;a href=&quot;https://en.wikipedia.org/wiki/Exponential_smoothing&quot; rel=&quot;nofollow noreferrer&quot;&gt;simple exponential smoothing&lt;/a&gt; on historical market prices. There is a commonly held view (among market practitioners), that there is a simple relation between the period over which the data is being smoothed - and the smoothing factor (alpha).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The formula is often given (for simple exponential smoothing) as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;alpha = 2/(period + 1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is there any literature out there that proves this relationship? &lt;/p&gt;&#xA;" OwnerUserId="1733" LastActivityDate="2017-03-19T02:45:45.383" Title="Derivation (or proof) of commonly used formula showing relationship between time and smoothing factor in exponential smoothing" Tags="&lt;market-data&gt;&lt;moving-average&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33098" PostTypeId="2" ParentId="33089" CreationDate="2017-03-18T21:25:54.910" Score="3" Body="&lt;p&gt;The main reason, from what I understand, is that it has to do with behavioral finance. The difference between implied volatility and realized volatility is sort of like a measure of risk aversion. Even if the computed expected return is X, investors may demand a small premium on top of it to compensate for the risk.&lt;/p&gt;&#xA;" OwnerUserId="26931" LastActivityDate="2017-03-18T21:25:54.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33099" PostTypeId="1" CreationDate="2017-03-18T23:14:23.470" Score="1" ViewCount="161" Body="&lt;p&gt;In Linear Regression for time series stock prediction, instead of using the cost function and minimizing the cost function, why can't we use the final portfolio value? Assume we are doing a time series prediction, where each day we are either long or short a particular stock or index, and never in cash (this could be a logistic regression but let's use linear regression).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, start with $10k, and run regression using 5 years of data. We are doing a linear regression on daily returns (or we could cube root the returns to transform them to reduce the affect of crashes, etc, on the data, that are caused by factors that are probably not in the features used as predictors).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In any case, we minimize the cost of each day's prediction. For example, assume the prediction predicts +0.030, then we would be long, if it predicts -0.001 (slightly negative), then we should be short, always the entire portfolio value. We minimize the cost function which is just the error, (H(x)-y)^2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, we can take each day's prediction, and the actual outcome had we followed that prediction, and starting with say, $10k, simulate what the final portfolio value would be (we can add slippage for commission, etc, but I don't think that would matter here). Then, instead of minimizing the cost function, we maximize the final portfolio value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the pros/cons of doing it the second way? I know we wouldn't be able to use gradient descent, for one thing. Also it is probably more susceptible to overfitting, but the transform can/should help with that, right? By transform, I mean say system predicted &quot;0.040&quot; which is a buy or long. The actual &quot;cost&quot; is that by being long, we gained 9.0%, which is out of the ordinary (some news came out, earnings, etc, that system doesn't predict or can't predict, and we don't want to &quot;over-fit&quot; this). By doing a cube root transform, we use 0.09^(1/3)=0.448. We can divide by 100 to avoid too high of returns, and assume today's return was 0.448% instead of 9%. We would tabulate final portfolio value using the transformed returns from our predictions, instead of actual returns. This has the affect of making outliers (like the 9% gain in one day) have a lower affect on the &quot;cost&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, what are the reasons we don't use final portfolio value maximization as the &quot;cost function&quot;, instead of the normal 12m∑i=1m(hθ(X(i))−Y(i))2?&lt;/p&gt;&#xA;" OwnerUserId="27056" LastActivityDate="2017-03-18T23:14:23.470" Title="In Linear Regression for time series stock prediction, instead of cost function, use final portfolio value?" Tags="&lt;regression&gt;&lt;time&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33100" PostTypeId="1" CreationDate="2017-03-19T00:29:34.023" Score="1" ViewCount="361" Body="&lt;p&gt;i want to build an implied volatility binomial tree with American input options, so the setup is the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) We know the market Price P of the American Put $P_{am}(t_i,K)$, where $t_i$ is the expiration date and K the strike price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) $S_{i,j}$ is the value of the stock at node (i,j), where i is the time and j the displacement on the tree&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) $v^{put}_{i-1,j}$ is the value of  $P_{am}(t_i,S_{i-1,j})$ at node (i-1,j), so we set the the strike $K=S_{i-1,j}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4)$\lambda_{i-1,m}$ the Arrow-Debreu price of node  (i-1,m)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5) r the risk free rate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;6) $D_i$ is the dividend payment wit ex-dividend date $t_i$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets assume we are at some arbitrary point (i-1,j) in the tree and want to determine the value $v^{put}_{i-1,j}$ (we take the put, because we are below the center). Then:&#xA;1) All nodes at time $t_{i-1}$ that are above the strike $K=S_{i-1,j}$ have value zero, because the payout of the put option is zero at all those nodes &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2)According to a formula, which i don't want to derive here, it holds &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$v^{put}_{i-1,k}=max[e^{-r\Delta t} K - S_{i-1,k} +e^{-r\Delta t}D_i,K-S_{i-1,k}]  $ for $k&amp;lt;j$ (intrinsic vs time value)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then my source follows, that the only node in the option value tree for $P_{am}(t_i,K)$ we do not know is (i-1,j).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It offers the solution of the false position method to determine a root for &#xA;$P(v):=\pi(v)-P$ with $\pi(v)$ defined as the tree value and P the market price of the American option. It takes two guesses $v_0$ and $v_1$ with $P(v_0)\leq P \leq P(v_1)$ and gives the following formula for the next guess:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;v_2=\frac{v_1 m + P(v_1)}{m}, \enspace \enspace m=\frac{P(v_1)-P(v_0)}{v_1-v_0}.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now i wonder, how do i calculate $P(v_1)$, because i am not sure what the function $\pi(v)$ exactly is. In the European case, this tree value $\sum^j_{k=0}\lambda_{i-1,k}v^{put}_{i-1,k} = \sum^{j-1}_{k=0}\lambda_{i-1,k}(e^{-r\Delta t}K -S_{i-1,k}+e^{-r\Delta t}D_i) + \lambda_{i-1,j}v^{put}_{i-1,j}$ is set equal to the market price $P^{eu}(t_i,K)$ and solved for $v^{put}_{i-1,j}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why can't we do that in the American case, as we know all values $v_{i-1,k}$ for $k&amp;lt;j$ ?? It must be somehow related to the non linearity of the max operator, but i don't see how...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe the notation is confusing or i didn't explain the problematic good enough, still in any case i would also be very grateful for any literature or example of building such a tree for American input options with dividends, because i could only find proper examples for the case of Europeans.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="26565" LastEditorUserId="24222" LastEditDate="2017-03-19T00:45:39.053" LastActivityDate="2018-03-11T16:12:30.377" Title="Building implied binomial tree with American input options" Tags="&lt;implied-volatility&gt;&lt;american-options&gt;&lt;binomial-tree&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33101" PostTypeId="2" ParentId="33095" CreationDate="2017-03-19T02:45:45.383" Score="3" Body="&lt;p&gt;The current data point is said to have age 0, the previous has age 1, and so on going backwards.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a straight N period moving average of the form $\frac{1}{N}(x_t+x_{t-1}+\cdots+x_{t-N+1})$ it is easy to see that the average age of the data is $\frac{N-1}{2}$. Sometimes this is stated in term of &quot;centering&quot;: a 3 period moving average is centered on the period $t-1$, i.e the period with age $1=\frac{3-1}{2}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A slightly more elaborate calculation shows that for an exponential moving average with constant $\alpha$, the average age of the data is $\frac{1-\alpha}{\alpha}$. (The EMA is of the form $\sum_{k=0}^\infty\alpha(1-\alpha)^k x_{t-k}$ and the average age is $\sum_{k=0}^\infty\alpha(1-\alpha)^k k$ which can be show to converge to $\frac{1-\alpha}{\alpha}$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To find the EMA most similar to a given MA, we set these two expressions for average age equal, giving the equation $\frac{N-1}{2}=\frac{1-\alpha}{\alpha}$. Solving this for alpha we get $\alpha=\frac{2}{N+1}$ . QED.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This proof was given by Brown in his 1963 book 'Smoothing, Forecasting and Prediction'&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-03-19T02:45:45.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33102" PostTypeId="1" AcceptedAnswerId="33109" CreationDate="2017-03-19T08:35:21.113" Score="1" ViewCount="646" Body="&lt;p&gt;Consider the Black-Scholes model and the derivative asset:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;X = &#xA;\begin{cases}&#xA;K, \qquad \qquad \qquad \quad S_T\leq A, \\&#xA;K+A-S_T, \qquad A\leq S_T &amp;lt; K+A, \\&#xA;0, \qquad \qquad \qquad \quad S_T&amp;gt;K+A.&#xA;\end{cases}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Replicate this derivative using portfolio consisting of bond, asset S and European call option. Find the arbitrage free price for X.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anybody explain to me how to solve this exercise? I can't seem to grasp the concept of it. Thanks!&lt;/p&gt;&#xA;" OwnerUserId="27057" LastActivityDate="2017-03-19T19:53:04.460" Title="Black-Scholes model and arbitrage free price" Tags="&lt;black-scholes&gt;&lt;portfolio&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33103" PostTypeId="2" ParentId="33102" CreationDate="2017-03-19T11:24:22.447" Score="1" Body="&lt;p&gt;This position is equivalent to a combination of bond and &lt;a href=&quot;http://www.investopedia.com/articles/active-trading/030414/what-bear-call-spread.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;bear vertical call spread&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Imagine that at time $t$ you own $Ke^{-r(T-t)}$ zero-coupon bonds. Then at time T you will receive K in cash.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The spread consists of 1 short European call option with strike A and 1 long European option with strike A+K.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $S_T &amp;lt; A $ both options are out of money, so their payoffs are zero. Thus you'll receive only $K$ from your bond position. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $ A \leq S_T &amp;lt; K+A$, 1 short European call with generate you losses of $A - S_T$ and 1 long will generate nothing. Thus you'll receive $K$ from bond and $A - S_T$ from the spread, $K + A - S_T$ in total. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case $ S_T \geq K+A$, you will receive $A - S_T$ from the short option and $S_T - (K+A) $ from the long option or $-K$ from the spread. Together with your bond position you will receive zero in total.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the Law of One Price, the arbitrage free price of $X$ will be : $$ X(t) = Ke^{-r(T-t)} + C(K+A, t) - C(A, t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $C(L,t)$ the price at time $t$ of European option with strike $L$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example,  if you could sell your derivative security for the price $M &amp;gt; X(t)$, then you could use $X(t)$ to replicate the position by purchasing the bond and the spread as desribed above and keep $M - X(t)$ as your risk-free profit. This is an arbitrage. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also Chapter 3 &quot;Static and Dynamic Replication&quot; in &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1118959167&quot; rel=&quot;nofollow noreferrer&quot;&gt;E. Derman's &quot;The Volatility Smile&quot;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15154" LastActivityDate="2017-03-19T11:24:22.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33104" PostTypeId="1" CreationDate="2017-03-19T11:53:41.283" Score="1" ViewCount="307" Body="&lt;p&gt;I have intuition that cointegration between elements of pair of equities somehow contradicts pairs trading strategies. Because the better is linear fit of the model the less opportunities we have for arbitrage (with still holding assumption of stationarity of residuals). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For me it seems that it would be better (from trading point of view) to fit model which assumes that residuals follow autoregressive mean-reverting process (which looks like sinusoid or randomly alternating version of it)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;primary school justification of my question in R : &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;set.seed(123)&#xA;N=120&#xA;&#xA;x1 &amp;lt;- cumsum(rnorm(N, sd=0.24))&#xA;SIN &amp;lt;- sin(seq(0, 20, length.out=N))&#xA;x2 &amp;lt;- x1+SIN+rnorm(N, sd=.2)&#xA;&#xA;matplot(cbind(x1, x2, SIN), t=&quot;l&quot;)&#xA;abline(h=0, col=3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;if residuals are not correlated isn't it harder to select entry and closing points of pairs trading strategy ?&lt;/p&gt;&#xA;" OwnerUserId="2044" LastEditorUserId="2044" LastEditDate="2017-03-19T16:20:58.737" LastActivityDate="2017-03-19T16:20:58.737" Title="Cointegration and pairs trading" Tags="&lt;cointegration&gt;&lt;pairs-trading&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33105" PostTypeId="1" CreationDate="2017-03-19T13:19:55.980" Score="-1" ViewCount="49" Body="&lt;p&gt;Option value being expressed:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$OV=e^{-rT}E[max(V-K,0)] \tag{1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $V$ is the price of the underlying security, $K$ is the strike price, and $r,T$ are discount rate and time to exercise date, as usual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the &quot;Key Result&quot; on pg. 352 of &lt;a href=&quot;http://accountingpdf.com/download/?file=6507&quot; rel=&quot;nofollow noreferrer&quot;&gt;this edition&lt;/a&gt; of Hull's book, Hull shows how the Black Scholes Merton formula for call option pricing results from $(1)$ if $V$ is lognormally distributed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: How can I deduce the mode (i.e., the most likely value, as opposed to the expected value) of the distribution implicit in $(1)$?&lt;/p&gt;&#xA;" OwnerUserId="26444" LastActivityDate="2017-03-20T01:17:17.573" Title="How to deduce the mode associated with a call option value?" Tags="&lt;options&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33107" PostTypeId="2" ParentId="33105" CreationDate="2017-03-19T13:54:00.763" Score="1" Body="&lt;p&gt;If the question is about the underlying, Wikipedia has the answer. If the log of a variable is normal $N(\mu,\sigma)$ then the variable itself is lognormal with mode at $e^{\mu-\sigma^2}$ and mean at $e^{\mu+\frac{1}{2}\sigma^2}$. The Median (or 50% point) is at $e^\mu$. &lt;a href=&quot;https://en.wikipedia.org/wiki/Log-normal_distribution#Arithmetic_moments&quot; rel=&quot;nofollow noreferrer&quot;&gt;Wikipedia link&lt;/a&gt; that I find very useful in working with option maths.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the question is about the call option, we can analyze it in terms of different cases depending how high the strike price is. I'll assume $r=0$ for simplicity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $K &amp;lt; e^{\mu-\sigma^2}$ then the cutoff is at a point on the curve where the density is still increasing (i.e. we are to the left of the mode). In this case the most likely value for the option is the excess of the mode over the strike: $e^{\mu-\sigma^2}-K$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the opposite case, the density for the stock declines monotonically to the right of K. So the most likely value for the stock is K, and after subtracting K we are left with a most likely option value of 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But TBH I am not sure why anyone cares what the most likely case is. It makes more sense to analyze the situation based on the expectation.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2017-03-20T01:17:17.573" LastActivityDate="2017-03-20T01:17:17.573" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33109" PostTypeId="2" ParentId="33102" CreationDate="2017-03-19T16:24:22.067" Score="2" Body="&lt;p&gt;To replicate this payoff, we note that&#xA;\begin{align*}&#xA;X &amp;amp;= K\,\mathbb{I}_{S_T \le A} + (K+A-S_T)\, \mathbb{I}_{A&amp;lt; S_T \le K+A}\\&#xA;&amp;amp;=K\,\mathbb{I}_{S_T \le A} + (K+A-S_T)\, \mathbb{I}_{S_T&amp;gt;A} - (K+A-S_T)\, \mathbb{I}_{S_T &amp;gt; K+A}\\&#xA;&amp;amp;= K - (S_T-A)\, \mathbb{I}_{S_T&amp;gt;A} + (S_T-(K+A))\, \mathbb{I}_{S_T &amp;gt; K+A}\\&#xA;&amp;amp;= K - (S_T-A)^+ + (S_T-(K+A))^+.&#xA;\end{align*}&#xA;That is, long a zero coupon bond, short a call option with strike $A$, and long a call option with strike $K+A$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-03-19T19:53:04.460" LastActivityDate="2017-03-19T19:53:04.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33110" PostTypeId="2" ParentId="33074" CreationDate="2017-03-19T17:32:49.713" Score="1" Body="&lt;p&gt;Split the strategy into predictors and outcomes, then evaluate how well the predictor predicts the outcome. Don't backtest a trading strategy, evaluate an estimator/predictor using typical machine learning/stats.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the position within a range is supposed to predict whether a stock will go up or down after 10 days then just test that; measure the rank correlations between range decile and 10 day future return decile or whatever.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't try and mix an entire trading strategy and backtest repeatedly; you won't know what you are measuring and you'll overfit to the historical data.&lt;/p&gt;&#xA;" OwnerUserId="3491" LastActivityDate="2017-03-19T17:32:49.713" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33112" PostTypeId="1" AcceptedAnswerId="33454" CreationDate="2017-03-19T19:49:26.113" Score="0" ViewCount="248" Body="&lt;p&gt;I think the question is simple enough. I have been using Eviews, but it is unable to do recursive one step ahead forecasting directly and requires me to use coding, which I'm not very good at.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need to know which is the best software which will allow me to do recursive one step ahead forecasts, whereby coefficients are re-estimated at each step, and these are used for forecasts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally if anyone can also answer the following question linked, it would be highly appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/33086/correct-procedure-for-modelling-garch-for-forecasting-volatility-of-stock-index&quot;&gt;Correct procedure for modelling GARCH for forecasting volatility of stock Index returns&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="27046" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2017-04-03T13:04:53.627" Title="Most GUI user friendly Time series Econometrics software for modelling and Forecasting GARCH models" Tags="&lt;time-series&gt;&lt;garch&gt;&lt;forecasting&gt;&lt;econometrics&gt;&lt;software&gt;" AnswerCount="1" CommentCount="6" ClosedDate="2017-04-03T13:07:36.183" ContentLicense="CC BY-SA 3.0" />
  <row Id="33113" PostTypeId="1" CreationDate="2017-03-19T20:25:41.273" Score="1" ViewCount="795" Body="&lt;p&gt;I am kind of confused about how to approach the following question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose I enter into a interest rate swap (IRS) with counter party C.&#xA;Details are : Fixed rate rate receiver, floating rate payer :C;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;          Duration : 5 years,&#xA;          Coupon payments: quarterly,&#xA;          Notional Principal: 100 million&#xA;          Fixed Rate: 4% per annum quaterly basis.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Given the interest rates follows a normal distribution with mean standard deviation 10perecent;&#xA;and 95 percent confidence interval.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the pre settlement risk of counterpart C at each payment date over the tenure, and plot the risk of 20 potential credit exposure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Answer: Shouldn't all the payment from Counter party C should all be the same? I am not getting the concept or how to approach this question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="26447" LastEditorUserId="16148" LastEditDate="2017-04-06T12:59:31.803" LastActivityDate="2017-04-06T12:59:31.803" Title="Interest Rate Swap Pre-Settlement Risk" Tags="&lt;risk&gt;&lt;credit-risk&gt;&lt;interest-rate-swap&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="33115" PostTypeId="1" AcceptedAnswerId="33123" CreationDate="2017-03-20T04:17:24.407" Score="1" ViewCount="968" Body="&lt;p&gt;First, is the yield of &lt;code&gt;dirty price&lt;/code&gt; is same as the yield of this bond at beginning?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If they are same, then the &lt;code&gt;dirty price&lt;/code&gt; is already the current price of this bond, why do we again minus the &lt;code&gt;arraccrued interest&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems the seller received extra percentage of the next coupon, but actually he didn't get any of next coupon? So I really confuse here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have the &lt;code&gt;jump condition&lt;/code&gt; for the discrete coupon paying bond: $V(t_i^-, r) = V(t_i^+,r) - C_i,$ here $t_i$ is the $i$-th coupon paying, so this $V(t,r)$ should correspond which price?&lt;/p&gt;&#xA;" OwnerUserId="26165" LastEditorUserId="26165" LastEditDate="2017-03-21T06:14:45.630" LastActivityDate="2017-03-21T06:14:45.630" Title="Why we need compute the clean price" Tags="&lt;bond&gt;&lt;yield&gt;" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="33116" PostTypeId="1" AcceptedAnswerId="33118" CreationDate="2017-03-20T04:49:30.877" Score="0" ViewCount="304" Body="&lt;p&gt;Why when we are using self-financing portfolios to replicate some external payoff we do not consider the quadratic variation of the portfolio weights? Say, in Black-Scholes world, when we are using $W_t = h_1(t)S_t + h_2(t)B_t $ where $S_t$ is the underlying stock which follows GBM and $B_t$ is the value of simple risk-free asset, we write the law of motion as follows?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dW = h_1(t)dS_t + h_2(t)dB_t $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why we have no $dh $ or $(dS)(dh)$ term here?&lt;/p&gt;&#xA;" OwnerUserId="27067" LastActivityDate="2017-03-20T10:33:27.593" Title="Self-Financing Portfolio" Tags="&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33117" PostTypeId="1" AcceptedAnswerId="33122" CreationDate="2017-03-20T07:56:08.220" Score="4" ViewCount="277" Body="&lt;p&gt;In this paper &lt;a href=&quot;http://www.math.ku.dk/~rolf/teaching/thesis/B-AWhaley.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Efficient Analytic Approximation of American Option Values&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in the first several lines of page 306, the author dropped the last term in equation 11, he explained that when $T\to 0$, we have $f_K\to 0$, but I don't know why.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone explain it?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;$\epsilon$ is the early exercise premium, and $T$ is the time to maturity. Define $K(T):=1-e^{-rT}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;write $\epsilon$ as $\epsilon(S,K)=K(T)f(S,K)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the equation 11 is&#xA;$$S^2f_{SS}+NSf_S-(M/K)f-(1-K)Mf_K=0$$&lt;/p&gt;&#xA;" OwnerUserId="15232" LastEditorUserId="23872" LastEditDate="2017-10-16T16:24:43.617" LastActivityDate="2017-10-16T16:24:43.617" Title="why we drop the last term in the Barone-Adesi Whaley formula" Tags="&lt;american-options&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33118" PostTypeId="2" ParentId="33116" CreationDate="2017-03-20T10:27:41.110" Score="2" Body="&lt;p&gt;As Quantuple implies in the comment, you do need to take all these terms into account. However, &lt;em&gt;by the definition of a self-financing portfolio&lt;/em&gt;, they vanish. Using your notation, we generally have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathrm{d}W_t = h_1(t) \mathrm{d}S_t + S_t \mathrm{d}h_1(t) + \mathrm{d} \langle h_1, S \rangle_t + h_2(t) \mathrm{d}B_t + B_t \mathrm{d}h_2(t) + \mathrm{d} \langle h_2, B \rangle_t.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We require that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathrm{d}W_t = h_1(t) \mathrm{d}S_t + h_2 \mathrm{d}B_t.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The self-financing condition thus is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;S_t \mathrm{d}h_1(t) + \mathrm{d} \langle h_1, S \rangle_t + B_t \mathrm{d}h_2(t) + \mathrm{d} \langle h_2, B \rangle_t = 0.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that in a Black-Scholes world, you'd always have $\mathrm{d} \langle h_2, B \rangle_t = 0$ anyways as $B$ is non-random.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Go gain some intuition for what this means economically, it is useful to re-write the self-financing condition as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\left( S_t + \mathrm{d}S_t \right) \mathrm{d}h_1(t) + \left( B_t + \mathrm{d}B_t \right) \mathrm{d}h_2(t) = 0.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e. we require that the value of the changes in the positions in $S$ and $B$ (at the new prices) cancel out.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-03-20T10:33:27.593" LastActivityDate="2017-03-20T10:33:27.593" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33120" PostTypeId="2" ParentId="33055" CreationDate="2017-03-20T11:48:03.467" Score="1" Body="&lt;p&gt;It turns out the answer is quite simple!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just needed to adjust the &quot;lapply&quot; function correctly such that: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;QuarterlyReturns &amp;lt;- lapply(Prices, quarterlyReturn, USE.NAMES = TRUE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now the calculation works perfectly fine. &lt;/p&gt;&#xA;" OwnerUserId="27019" LastActivityDate="2017-03-20T11:48:03.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33121" PostTypeId="1" CreationDate="2017-03-20T13:03:31.110" Score="6" ViewCount="598" Body="&lt;p&gt;On Page 24-25 of N. Taleb's &quot;Dynamic Hedging&quot; the author talks about &quot;Soft American Options&quot;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A &lt;strong&gt;soft American option&lt;/strong&gt; (also called a pseudo-European option) is only&#xA;  subjected to early exercise from the standpoint of the financing of&#xA;  the intrinsic value.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;An &lt;strong&gt;extension&lt;/strong&gt; of this definition is that only one interest rate, that&#xA;  affecting the the financing of the premium for the operator, impacts&#xA;  the decision to early exercise.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;For risk management and trading purposes, soft American options will&#xA;  be largely similar to the European options, except when interest rates&#xA;  become very high relative to volatility. The reason they are often&#xA;  called pseudo-European options is that they behave in general like&#xA;  European options, except when very deep in the money. The test of&#xA;  early exercise is whether the total option value is less than the time&#xA;  value of the money between the time of consideration and expiration.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Example: Assume that an asset trades at \$100, with interest rates at&#xA;  6% (annualized) and volatility at 15.7%. Assume also that the 3-month&#xA;  80 call is worth \$20, at least if it is American. Forgoing early&#xA;  exercise would create an opportunity cost of 20 x 90/360 x .06 = .30&#xA;  cents, the financing of \$20 premium for 3 months. The time value of&#xA;  the equivalent put is close to zero (by put-call parity), so the&#xA;  intelligent operator can swap the call into the underlying asset and&#xA;  buy the put to replicate the same initial structure at a better cost.&#xA;  He would end up long the put and long the underlying asset.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I have three questions here&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q1. My understanding is, &quot;soft american options&quot; are in general call options, that the option's value is due to the increasing of the stock value. Since stock value grows faster than interest rate, it's not advisable to early execute, unless, the interest rate is too high. The other case is put options, as time goes by, stock price increases and option's intrinsic value decreases, it's more advisable to early execute. Is my understanding correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q2. How did Taleb come to the conclusion that &quot;Forgoing early exercise would create an opportunity cost of 20 x 90/360 x .06 = .30 cents, the financing of \$20 premium for 3 months. &quot;? I couldn't figure out why the financing cost of an American options, is the difference between an American and an European option's price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q3. Taleb says &quot;so the intelligent operator can swap the call into the underlying asset and buy the put to replicate the same initial structure at a better cost&quot;, I do agree that call = asset + put, i.e. a call option can be replicated by an asset and a put, but why such replication has a better cost?&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2017-04-12T11:50:49.880" Title="Soft American Options" Tags="&lt;american-options&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33122" PostTypeId="2" ParentId="33117" CreationDate="2017-03-20T13:14:40.810" Score="4" Body="&lt;p&gt;Below is a hand-wavy way to reach the above result. I suspect there is a more elegant way to show it though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;em&gt;early exercise premium&lt;/em&gt; is defined as the difference between the American and European option prices&#xA;$$ \epsilon(S,T) := C(S,T)-c(S,T) \tag{0}$$&#xA;In the paper it is further rewritten as&#xA;$$ \epsilon(S,T) = K(T) f(S,K(T)) = \epsilon^*(S,K(T)) \tag{1} $$&#xA;for some function $K: T \to 1-e^{-rT}$ and where we have let&#xA;$$\epsilon^* : (S,K) \to K f(S,K)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the above expression&#xA;$$ f(S,K) = \frac{\epsilon^*(S,K)}{K} $$&#xA;hence &#xA;$$ f_K(S,K) = -\frac{\epsilon^*(S,K)}{K^2} + \frac{\epsilon^*_K(S,K)}{K} $$&#xA;We would like to compute &#xA;$$ \lim_{T \to 0} f_K(S,K(T)) = \lim_{K \to 0} f_K(S,K) = \lim_{K \to 0} -\frac{\epsilon^*(S,K)}{K^2} + \frac{\epsilon^*_K(S,K)}{K} \tag{2} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To help us in our computations, we note that:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;As the time to maturity tends towards 0 an American option becomes &lt;em&gt;strictly equivalent&lt;/em&gt; to its European counterpart (i.e. same price + same Greeks), hence we notably have:&#xA;  $$\lim_{T \to 0} \epsilon(S,T) = 0 \tag{A}$$&#xA;  $$\lim_{T \to 0} \epsilon_T(S,T) = 0 \tag{B}$$&#xA;  $$\lim_{T \to 0} \epsilon_{TT}(S,T) = 0 \tag{C}$$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Using (A) and noting that&#xA;$$ \lim_{T \to 0} \epsilon(S,T) = 0 \iff \lim_{K \to 0} \epsilon^*(S,K) = 0 $$&#xA; we can rewrite (2) using l'Hôpital rule as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \lim_{K \to 0} f_K(S,K) = \lim_{K \to 0} -\frac{\epsilon^*_K(S,K)}{2K} + \frac{\epsilon^*_K(S,K)}{K} = \lim_{K \to 0} \frac{\epsilon^*_K(S,K)}{2K} \tag{3} $$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;From (1) $$\epsilon_T(S,T) = \epsilon^*_K K_T = \epsilon_K^*(S,K(T)) re^{-rT} $$&#xA;Using (B) along with the above equation yields&#xA;$$ \lim_{T\to 0} \epsilon_T = 0 \iff \lim_{T \to 0} \epsilon_K^*(S,K(T)) r = 0 $$&#xA;hence $$ \lim_{K \to 0} \epsilon_K^*(S,K) = 0 \tag{4} $$&#xA;Plugging this into (2) and using l'Hôpital rule gives &#xA;$$ \lim_{T \to 0} f_K(S,K(T)) = \lim_{K \to 0} \frac{\epsilon^*_{KK}(S,K)}{2} $$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;From (1)&#xA;$$ \epsilon_{TT}(S,T) = \epsilon^*_{KK} K_T^2 + \epsilon_K^* K_{TT} $$&#xA;Simarly to what we did earlier, using (C) along with (3) will lead to &#xA;$$ \lim_{K \to 0} \epsilon^*_{KK} = 0 \tag{5} $$&#xA;and plugging that back into our expression for $\lim_{T\to 0} f_K$ finally yields&#xA;$$ \lim_{T\to 0} f_K =  \frac{1}{2} \lim_{K \to 0}\epsilon^*_{KK}(S,K) = 0$$&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2017-03-20T13:14:40.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33123" PostTypeId="2" ParentId="33115" CreationDate="2017-03-20T13:27:44.880" Score="2" Body="&lt;p&gt;When you read a Bond price in the newspaper, on a web site, in a database of bond prices it is always the Clean Price. [You don't have to compute anything! The clean price is there!]. When you actually buy the bond you receive an invoice asking you to pay the Clean Price plus the Accrued Interest, which are added together for your convenience and are called the Dirty Price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is similar to a restaurant, where a hamburger is listed for 1,99 EUR but when you get the bill at the end of the meal there is is a service charge,a tax, and maybe other unexpected items which bring the bill to 2,07 EUR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The service charge compensates the waiter who brought the meal to you, the accrued interest compensates the seller of the bond who is ethically entitled to a portion of the next coupon you will receive (if he held the bond for a part of the coupon period, for example if he held for 1/2 the coupon period he is entitled to half the next coupon under accounting &quot;accrual&quot; principles). Essentially the accrued interest is a mechanism for sharing the value of the next coupon (which the buyer will receive) in a fair way between buyer and seller based on when in the coupon period the bond changed hands.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-03-20T14:01:14.517" LastActivityDate="2017-03-20T14:01:14.517" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33125" PostTypeId="2" ParentId="33086" CreationDate="2017-03-20T15:33:08.147" Score="1" Body="&lt;p&gt;I believe your question is closely related to this question  : &lt;a href=&quot;https://quant.stackexchange.com/q/10029/7008&quot;&gt;How should we select efficiently orders parameters in time series modelling?&lt;/a&gt; . (ps : the accepted answer did not really answer it...)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When modelling both the mean and variance process together, we must choose either to determine the order of lags in the mean process first and the conditional variance in a second step (what I called a &lt;em&gt;two step approach&lt;/em&gt;) or to determine orders of lag for the mean and variance process together (&lt;em&gt;direct approach&lt;/em&gt;). And you are right, depending of the method you use, you'll end up with different combinations. I believe the current literature is not clear about this issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't have a solid economical reason to choose one method over the other one, and with a pure econometric point of view I would recommand you to employ the direct approach as it covers a much larger parameter space (i.e you test more combinations with the direct approach than with the two step approach).  &lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2017-03-20T15:33:08.147" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="33126" PostTypeId="1" AcceptedAnswerId="33140" CreationDate="2017-03-20T15:34:35.270" Score="3" ViewCount="290" Body="&lt;p&gt;I'm looking for references on the stochastic calculus of Poisson processes. My books tend to focus on derivative pricing, where Brownian motion reigns supreme. Maybe some jump-diffusion models thrown in in chapter 10, but that's not what I'm looking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to read a book that covers the Ito calculus of Poisson processes with random intensity and jump sizes, in a detailed way like all the derivatives books present Ito calculus. (Stochastic control would be a plus, but isn't necessary)&lt;/p&gt;&#xA;" OwnerUserId="23872" LastActivityDate="2017-03-21T14:06:48.997" Title="How do I learn the stochastic calculus of Poisson processes?" Tags="&lt;reference-request&gt;&lt;poisson-process&gt;" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="33127" PostTypeId="2" ParentId="33085" CreationDate="2017-03-20T16:21:40.563" Score="2" Body="&lt;p&gt;The comments above re all the entries of $\mu$ not being the same is true, but can be removed if you make the 2x2 determinant in question $\ge 0$ instead of $&amp;gt; 0$.  The commenters know this of course.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answer to your question can be obtained by an application of the Cauchy-Schwartz inequality along with knowledge that a symmetric positive definite matrix has a square root.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $\Sigma^{-1}$ is positive definite, there exists a symmetric matrix $A$ such that $A^2=\Sigma^{-1}$. One might say that $A=\Sigma^{-1/2}$.  The existence of $A$ can be seen by noting that $\Sigma^{-1}$ is diagonalizable.  Look that up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's call your 2x2 determinant $D$. Note that $D$ can be expressed as a bunch of inner products as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&amp;lt;\Sigma^{-1}\mu, \mu&amp;gt;&amp;lt;\Sigma^{-1}1_n,1_n&amp;gt;-&amp;lt;\Sigma^{-1}\mu,1_n&amp;gt;&amp;lt;\Sigma^{-1}1_n, \mu&amp;gt;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $\Sigma^{-1}$ is symmetric and real, it is self-adjoint, which means that the product in the second term is of equal numbers (the second equality is because we are in a real vector space - in a complex vector space, we would need to take the complex conjugate to retain equality):&#xA;$$&amp;lt;\Sigma^{-1}\mu,1_n&amp;gt;=&amp;lt;\mu,\Sigma^{-1}1_n&amp;gt;=&amp;lt;\Sigma^{-1}1_n,\mu&amp;gt;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's rewrite in terms of $A$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&amp;lt;A^2\mu,\mu&amp;gt;&amp;lt;A^21_n,1_n&amp;gt;-&amp;lt;A^2\mu, 1_n&amp;gt;^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Again, A is symmetric and real, so it is also self-adjoint and this becomes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&amp;lt;A\mu,A\mu&amp;gt;&amp;lt;A1_n,A1_n&amp;gt;-&amp;lt;A\mu,A1_n&amp;gt;^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Cauchy-Schwarz inequality finishes us off.  As a reminder, the Cauchy-Schwarz inequality states that using the usual inner product in $R^n$ or $C^n$, we get that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$|&amp;lt;x,y&amp;gt;| \le &amp;lt;x,x&amp;gt;^{1/2}&amp;lt;y,y&amp;gt;^{1/2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So we get that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&amp;lt;A\mu,A1_n&amp;gt;^2 \le &amp;lt;A\mu,A\mu&amp;gt;&amp;lt;A1_n,A1_n&amp;gt;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then subtracting the left handside on both sides of this inequality gives us $D \ge 0$.&lt;/p&gt;&#xA;" OwnerUserId="26977" LastActivityDate="2017-03-20T16:21:40.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33129" PostTypeId="2" ParentId="33089" CreationDate="2017-03-20T17:39:54.900" Score="7" Body="&lt;p&gt;Another theory is that stock indexes do not follow a the lognormal distribution assumption of Black-Scholes. For example U.S. equities measured by the Russell 3000 or S&amp;amp;P 500 have a negative skew and excess kurtosis (above a normal or log-normal distribution). The empirical distribution of stock returns has larger losses than a normal or log-normal model using ex-post mean and standard deviation would predict. In other words the realized volatility understates the risk or potential for loss. Therefore in addition to the other reasons mentioned above the implied volatility the option writer charges ought to be higher than ex-post volatility.  &lt;/p&gt;&#xA;" OwnerUserId="26535" LastActivityDate="2017-03-20T17:39:54.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33131" PostTypeId="2" ParentId="21744" CreationDate="2017-03-20T21:18:17.970" Score="1" Body="&lt;p&gt;I don't see such a package in pandas, but MSFT options are American, so you need a PDE grid to solve for the IV.  Black Scholes is for European options.  MSFT has dividends so American Price &gt; European Price.  If it did not have dividends, then it would be safe to say that MSFT is very easy to borrow, so the European should be very close to the American price barring any weird funding irregularities (I once saw AAPL imply a negative dividend before they had dividends mostly due to strange stuff with funding).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case MSFT did have a 0.36 dividend that went ex on Nov 17, 2015 - that must factor into the price - especially since your option is fairly deep ITM.  The likelihood of early expiry is very high and would occur on Nov 16, 2015 - so almost as if this is a 3 day option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try to back out the European implied vol as if this were a three day option - should get you closer.  Really you want the expected time to exercise which should be slightly longer than 3 days.&lt;/p&gt;&#xA;" OwnerUserId="26977" LastActivityDate="2017-03-20T21:18:17.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33132" PostTypeId="1" AcceptedAnswerId="33155" CreationDate="2017-03-20T21:42:38.190" Score="7" ViewCount="405" Body="&lt;p&gt;Books similar to Options, Futures, and Other Derivatives by John C. Hull. I need another academic book that explains the basics of quantitative finance derivatives (forward, futures, options)&lt;/p&gt;&#xA;" OwnerUserId="27078" LastEditorUserId="11723" LastEditDate="2017-03-22T07:25:34.397" LastActivityDate="2017-03-22T07:25:34.397" Title="What are the books in which to study the basics of the derivative financial instruments?" Tags="&lt;finance&gt;&lt;derivatives&gt;&lt;reference-request&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33135" PostTypeId="1" AcceptedAnswerId="33148" CreationDate="2017-03-21T05:35:57.347" Score="2" ViewCount="199" Body="&lt;p&gt;I run a MVP on 10 ETFs: SPY, SDY, IWB, XLP, VGT, BND, XLF, IJR, XLY, XLI from 2008 to 2016 on monthly return data.  The weighs array (I am using a MATLAB function &quot;Portfolio&quot; - constraints are simple: no shorts + weights sum to 1) gives me only 1-3 of the 10 ETFs only - the rest are zero weight.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this seem intuitive?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Andrew&lt;a href=&quot;https://i.stack.imgur.com/vsg3P.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/vsg3P.jpg&quot; alt=&quot;weights&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="27044" LastActivityDate="2017-03-21T21:48:58.653" Title="Help on minimum variance optimization on U.S. Equity/Bond ETFs - Intuition" Tags="&lt;programming&gt;&lt;mean-variance&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33136" PostTypeId="2" ParentId="33135" CreationDate="2017-03-21T07:57:00.773" Score="1" Body="&lt;p&gt;The output you have given looks more like an 'efficient&#xA;frontier' than a minimum-variance portfolio, but in&#xA;general, long-only&#xA;minimum-variance portfolios tend to be concentrated in only a&#xA;few assets, in particular when i) the marginal&#xA;volatilities in the asset universe are very different&#xA;(then, the low-vol assets will be included) and ii)&#xA;when correlation between the assets is high.&lt;/p&gt;&#xA;" OwnerUserId="6857" LastActivityDate="2017-03-21T07:57:00.773" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33137" PostTypeId="2" ParentId="33121" CreationDate="2017-03-21T08:45:45.277" Score="5" Body="&lt;p&gt;It is easier to understand Taleb's distinction between 'soft' and 'hard' American options if we understand from the beginning that he is talking about FX options or behaving similarly options on another assets. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under &lt;a href=&quot;https://en.wikipedia.org/wiki/Foreign_exchange_option&quot; rel=&quot;nofollow noreferrer&quot;&gt;Garman-Kohlhagen model&lt;/a&gt; for valuation, the price of &lt;strong&gt;European&lt;/strong&gt; FX call is: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ C_{e}(S(\tau), K, \tau, r, r^f, \sigma ) = e^{-r^{f}\tau}S(\tau)N(d_+) - e^{-r\tau}KN(d_{\_}) \\&#xA;d_{+} = \frac{1}{\sigma \sqrt{\tau}}\Big[\log{\frac{S(\tau)}{K}}+(r-r^f+\frac{1}{2}\sigma^2)\tau\Big] \\&#xA;d_{\_} = d_{+} - \sigma \sqrt{\tau}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$S(\tau)$ is an exchange rate in units of domestic currency($\$$) per $N_f$  units of foreign currency&lt;/li&gt;&#xA;&lt;li&gt;$N_f$ is a foreign notional amount, its actual value is not important&lt;/li&gt;&#xA;&lt;li&gt;$K = \$80$ is an option strike price in units of domestic currency per $N_f$ units of foreign currency&lt;/li&gt;&#xA;&lt;li&gt;$\sigma = 0.157$  is the volatility of the exchange rate $S(\tau)$&lt;/li&gt;&#xA;&lt;li&gt;$\tau$  is time to expiration&lt;/li&gt;&#xA;&lt;li&gt;$r = 0.06$ is a domestic currency risk-free rate&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;American&lt;/strong&gt; FX call price $C_a$ is higher or equal than $C_e$ for any type of options. But for FX options this boundary can be  augmented further because  under Garman-Kohlhagen model European call may have &lt;em&gt;negative time value&lt;/em&gt; or cost less than its &lt;em&gt;intrinsic value&lt;/em&gt;. Obviously, American option can't cost less than intrinsic value due to early exercise feature, so:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ C_{a}(S, K, \tau, r, r^f, \sigma ) \geq \max (C_{e}(S, K, \tau, r, r^f, \sigma ), S-K)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is instructive to see how the low boundary of the price of the American option depends on $r^f$ assuming the other parameters fixed as in Taleb's 'soft' American option example, i.e. $\tau= \tau_0 = \frac{90}{360}$, $S(\tau_0) = \$100$:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/vMnF6.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/vMnF6.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When foreign risk-free rate rate $r^f$ is less than $\approx 5\%$, time-value of both American and European option is greater than zero. This value is lost when the American option is exercised early and generally speaking we would have to take this into consideration, but we will not since Taleb most likely assumes that this is not the case (see below).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead, if foreign interest rate is greater than $5\%$, European FX call costs less than its intrinsic value while cost of American one is equal to its intrinsic value. That's what Taleb probably refer to when he emphasizes that the option is an American one: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Assume also that the 3-month 80 call is worth $20, &lt;strong&gt;at least if it is American.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Assume (as Taleb does) that the price of put available on the market is negligible and $r^f$ is greater than $5\%$. Compare final payoffs in domestic currency for two scenarious proposed by Taleb: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;We keep the call till expiration and receive payoff $V_{call}$&lt;/li&gt;&#xA;&lt;li&gt;We exercise the call borrowing $K$ and receiving $N_f$ units of foreign currency, buy put with strike $K$ and keep this position till expiration of put and then exchange $N_f$ back to domestic currency. The received payoff is $ V_{N_f + \text{put}}$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thus: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V_{call} = \max(S(0) - K,0) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here $S(0)$ is the exchange rate at the time of expiration ($\tau = 0$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ V_{N_f + \text{put}} = \underbrace{N_f\frac{\max(S(0), K)}{N_f} - K}_{N_f + \text{put} =  \max(S(0) - K,0) = V_\text{call}} + \underbrace{N_f (e^{r^f \tau_0}-1)\frac{S(0)}{N_f} - K(e^{r\tau_0}-1)}_\text{the interest earned} \tag{1} \label{one}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here $N_f (e^{r^f \tau_0}-1)$ is the interest earned in units of foreign currency and $\frac{S(0)}{N_f}$ is an exchange rate in units of domestic currency per &lt;strong&gt;1&lt;/strong&gt; (not $N_f$!) unit of foreign currency&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is &quot;the interest earned&quot; part of $ V_{N_f + \text{put}}$ which is used by Taleb to gauge 'hardness' of the FX option. In turn, we can further split it into: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ N_f(e^{r^f \tau_0}-1)\frac{S(0)}{N_f} - K(e^{r\tau_0}-1) = S(0)(e^{r^f \tau_0}-1) - K(e^{r\tau_0}-1) \\ \approx \tau_0 S(0)r^f - \tau_0 Kr = \underbrace{\tau_0 (S(0) - K)r}_\text{financing of intrinsic value} + \underbrace{\tau_0 S(0)(r^f-r)}_\text{carry cost of the underlying } \tag{2} \label{two} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if &quot;financing of intrinsic value&quot; is much greater than &quot;carry costs of the underlying&quot;:  $$\tau_0 (S(0) - K)r \gg \tau_0 S(0)(r^f-r)$$ then American option is 'soft'. Otherwise it is 'hard'. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now everything is ready to answer your questions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q1. Taleb's distinction between 'soft' and 'hard' options is easier to understand assuming that he is talking about FX options. An FX option is a 'call' option in one currency and 'put' in the other simultaneously, so you can assume that 'Soft American Option' may be 'put' as well as 'call'. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is relationship between &lt;em&gt;foreign&lt;/em&gt; and &lt;em&gt;domestic interest rates&lt;/em&gt;, not the growth or change of the exchange rate, that defines 'softness' of the American option as described above. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is interesting that &lt;a href=&quot;https://www.pearsonhighered.com/program/Hull-Options-Futures-and-Other-Derivatives-9th-Edition/PGM286628.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Hull's&lt;/a&gt; appreciate this fact:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In general, call options on high-interest currencies and put options on low-interest currencies are the most likely to be exercised prior to maturity. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;but then gives what appears to be an incorrect explanation to this fact:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The reason is that a high-interest currency is expected to depreciate and a&#xA;  low-interest currency is expected to appreciate.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Q2. Taleb assumes that &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;foreign and domestic interest rates are the same ($r^f \approx r =&#xA;    0.06$)  &lt;/li&gt;&#xA;&lt;li&gt;final exchange rate $S(0)$ is equal \$100 per $N_f$ units of foreign currency.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Then he calculates &quot;financing of intrinsic value&quot; as in formula $\eqref{two}$ above. &quot;carry cost of the underlying&quot; is zero in this case. Forgoing early exercise would lost this interest. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q3. Replication &lt;em&gt;might&lt;/em&gt; have better costs if &quot;the interest earned&quot; component in $\eqref{one}$ is positive.  It is likely the case when the call is very deep in-the-money, volatility is low and $r^f \geq r$. If $r^f &amp;lt; r$ &quot;the intelligent operator&quot; will need to take into consideration the loss of time value due to early exercise (i.e. difference between intrinsic value and the market price of the exercised option). &lt;/p&gt;&#xA;" OwnerUserId="15154" LastEditorUserId="15154" LastEditDate="2017-04-12T11:50:49.880" LastActivityDate="2017-04-12T11:50:49.880" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="33138" PostTypeId="1" CreationDate="2017-03-21T10:30:53.497" Score="1" ViewCount="202" Body="&lt;p&gt;I'm reading &lt;em&gt;The Capital Asset Pricing Model: Theory and Evidence&lt;/em&gt; (Fama and French, 2004) and came across the following statement:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;A risky asset’s return is uncorrelated with the market&#xA;return—its beta is zero—when the average of the asset’s covariances with the&#xA;returns on other assets just offsets the variance of the asset’s return. Such a risky&#xA;asset is riskless in the market portfolio in the sense that it contributes nothing to the&#xA;variance of the market return.&quot; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To express this statement algebraically would it be sufficient to show that if $Cov(R_i, R_M) = 0$, then the variance of a portfolio made up of risky asset i and the market portfolio would be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma_p^2 = \sigma_i^2 + \sum_{t=1}^{n} x_{i}Cov(R_i, R_M) = \sigma_i^2 + \sum_{i=1}^{n}\sum_{j=1}^{n} x_{i}x_{j}Cov(R_i, R_j) $$, where $x_i$ is the weight of asset i in the market portfolio?&lt;/p&gt;&#xA;" OwnerUserId="3351" LastActivityDate="2017-03-21T10:30:53.497" Title="Zero-beta assets and the Sharpe-Lintner CAPM" Tags="&lt;modern-portfolio-theory&gt;&lt;capm&gt;&lt;diversification&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33139" PostTypeId="1" CreationDate="2017-03-21T13:44:27.947" Score="1" ViewCount="99" Body="&lt;p&gt;I'm trying to derive a specific relationship about the relationship between forwards and futures from &quot;The relationship between forward and futures prices&quot;, written 1981 by Cox, Ingersoll and Ross (not the interest rate model!). The relationship has basically been empirically debunked, but nonetheless provides relevant info to me. I have issues understanding some steps in the proof. Basically, Cox, Ingersoll and Ross go from: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ -\frac{1}{B(t)}\sum_{i=t}^{T-1} \left[f(i+1) -f(i)\right]\left[\frac{B(i)}{B(i+1)} -1 \right] \tag 1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;directly to &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{1}{B(t)}\int_{t}^{T} f(w)\text{Cov}[\tilde{f}(w),\tilde{B}(w)]dw  \tag 2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;by assuming a continuous-state  where the covariance of $\tilde{f}$ and $\tilde{B}$ refers to the local covariance of the percentage change of $B$ and $f$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can easily write $(1)$ as: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{1}{B(t)}\sum_{i=t}^{T-1} f(i+1) \left[\frac{f(i+1) -f(i)}{f(i+1)}\right]\left[\frac{B(i)-B(i+1)}{B(i+1)} \right]  \tag 3$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which, with &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Cov}(X,Y) = \frac{1}{n^2}\sum_{i=1}^{n-1}\sum_{j&amp;gt;i}^{n} (x_i - x_j)(y_i - y_j)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;will get me to: (right??) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$-\frac{T^2\text{Cov}_{t,T}[\tilde{f},\tilde{B}]}{B(t)}\int_{t}^{T} f(w)dw  \tag 4$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, this is not very close to $(2)$. For example, my covariance is a constant, and I do not know how to get $T^2$ to disappear. What I do know: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\text{Cov}(f,B) \int f(w) dw = \int \text{Cov}(f,B) f(w) dw $, because $\text{Cov}(f,B)$ is a constant (and $f,B$ are vectors of timeseries). In $(2)$ however, $\text{Cov}(f(w),B(w))$ means the covariance of $f(w)$ and $B(w)$, where $w$ will change with $dw$ from $t$ to $T$. But, at a discrete point in time ($t=w$), $f(w)$  and $B(w)$ are only two values, not a time-series!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where do I go wrong when I go from $(3)$ to $(4)$, i.e., how do Cox, Ingersoll and Ross go from $(1)$ to $(2)$?&lt;/p&gt;&#xA;" OwnerUserId="27089" LastActivityDate="2017-03-21T13:44:27.947" Title="Deriving Cox, Ingersoll and Ross expression for the relationship between forwards and futures, how do they conclude a specific step?" Tags="&lt;futures&gt;&lt;mathematics&gt;&lt;forward&gt;&lt;covariance&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33140" PostTypeId="2" ParentId="33126" CreationDate="2017-03-21T14:06:48.997" Score="3" Body="&lt;p&gt;Summarizing the suggestions in comments:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nicolas Privault's chapter  Stochastic Calculus of Jump Processes [available online] provides only a very brief overview.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Chapter 11 of Shreve's II volume (Stochastic Calculus for Finance II: Continuous Time Models), called &quot;Introduction to Jump Processes&quot; is a good starting point. Then  Cont and Tankov &quot;Financial Modelling with Jump Processes&quot; provides more material, with an entire volume on the subject.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another suggestion was chapters 8-11 of the book &quot;mathematical methods for financial markets&quot; by Jeanblanc et al.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Contributors were @LocalVolatility, @Gordon, @user357269, @DaneelOlivaw&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2017-03-21T14:06:48.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33141" PostTypeId="1" AcceptedAnswerId="33156" CreationDate="2017-03-21T14:43:33.690" Score="10" ViewCount="6254" Body="&lt;p&gt;Let $B_t$ be the cash account numeraire. The future and forward prices at time t are expressed as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ Fut = E_t^Q\left[S_T\right],$$&#xA;$$ Fwd = \frac{E_t^Q[S_T/B_T]}{E_t^Q[1/B_T]}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where &#xA;$$ \frac{dS(t)}{S(t)} = \mu dt + \sigma dW_s^Q(t),$$&#xA;$$dr(t) = -Kr(t)dt+ \alpha dW_r^Q(t),$$&#xA;$$&amp;lt;dW_sdW_r&amp;gt; = \rho dt.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $K$ is the mean reversion of the short interest rate $r$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How is the convexity adjustment calculated in order to express the forward price in terms of the future price?&lt;/p&gt;&#xA;" OwnerUserId="6499" LastEditorUserId="6499" LastEditDate="2017-03-21T20:43:42.027" LastActivityDate="2018-08-29T12:49:21.853" Title="Convexity Adjustment for Futures" Tags="&lt;futures&gt;&lt;forward&gt;&lt;martingale&gt;" AnswerCount="1" CommentCount="14" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="33142" PostTypeId="1" CreationDate="2017-03-21T16:35:33.630" Score="-2" ViewCount="84" Body="&lt;p&gt;I have been trying to resolve this problem, under (b), but I cannot find the correct answer. For i=1, my ultimate answer (P=1) deviates from the correct answer (P=0.7580). Please let me know whether my computations are wrong or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In blue is the solution according to the solution manual; my computations start at &lt;em&gt;For i=1&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/gyKJo.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/gyKJo.png&quot; alt=&quot;BS vs real world prolbem&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13681" LastActivityDate="2017-04-20T18:44:34.213" Title="How to compute Pr(S&gt;100) when S follows Geometric Brownian Motion?" Tags="&lt;black-scholes&gt;&lt;distribution&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33143" PostTypeId="2" ParentId="24789" CreationDate="2017-03-21T17:48:29.723" Score="1" Body="&lt;p&gt;SPT refines MPT by introducing the notion of stochastic variation into expected returns, whereby allocators can determine optimal bet sizes that maximize the long-run rate of return. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Previously, under MPT, allocators operated under the assumption that the mean rate of return would equivocate to the expected long run logarithmic rate. SPT refines this understanding by demonstrating that observed (arithmetic) rates of return overestimate the long-run rate. This ties back into the idea of discrete measurement error and anticipates the observed phenomenon of &quot;volatility drag&quot;(not coincidentally, SPT provides an explanation here as to why low beta and low volatility portfolios are likely out perform). Also, the stochastic drag is basically a restatement of Jensen's Inequality which states that the a secant line drawn on a convex curve overestimates its value.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a real-world portfolio with continuous and stochastic pay-offs, the arithmetic expected return over-states the long-run expected return of a risky payoff. This result can be recovered from Ito's Lemma. For a single pay-off of $X$ with expected long-run growth, $\gamma$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\gamma = \mu - \frac{\sigma^2}{2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X_t = X_0e^{\gamma t + \sigma W_t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;SPT expands on the single-case by defining the expected long-run growth for a logarithmic portfolio of continuous semi-martingales under the risk-neutral measure as $\gamma^*$; securities weights are given by $\pi$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) $$\gamma _{{\pi }}^{*}(t):={\frac  {1}{2}}\sum _{{i=1}}^{n}\pi _{i}(t)\sigma _{{ii}}(t)-{\frac  {1}{2}}\sum _{{i,j=1}}^{n}\pi _{i}(t)\pi _{j}(t)\sigma _{{ij}}(t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Function (1) can be used to optimize bet-sizes within a portfolio in order to maximize the long-run expected return as a function of securities' individual variances. Under the special case that long-term expected returns are optimized with respect to the logarithmic utility function, function (1) leads to convergence with Kelly betting for a stochastic portfolio. For more on Kelly convergence, I recommend &lt;a href=&quot;https://rads.stackoverflow.com/amzn/click/9814383139&quot; rel=&quot;nofollow noreferrer&quot;&gt;Kelly Capital Growth Criterion&lt;/a&gt;, for which Ed Thorp is an editor. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, from here, it is easy to see that the goals of SPT are aligned with those MPT, except that SPT uses much milder assumptions regarding the optimal risk vs reward, asset comovement, etc. In SPT, the long run logarithmic rate of return discounts all other decision criteria (including gambler's ruin). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as practical applications, formula (1) suggests a variety of portfolio construction schemes which are likely to outperform the market portfolio. The intuition that security size is inversely proportional to variance leads to the case in which inverting market weights optimizes formula (1) which could be interpreted as a form of arbitrage. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After accounting for slippage, impact and trading costs, I do not believe that something as simple as inverting market weights will lead to an arbitrage with a unitary probability of outperforming the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another, more practical approach is to optimize expected return under formula (1) given forward looking assumptions (e.g., regarding factor-based and/or fundamentally derived estimates for expected returns and variance). &lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2018-01-29T09:09:23.730" LastActivityDate="2018-01-29T09:09:23.730" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="33145" PostTypeId="1" AcceptedAnswerId="33495" CreationDate="2017-03-21T18:23:31.067" Score="0" ViewCount="151" Body="&lt;p&gt;I am asking a question related to some comments and answers I have seen in the site while investigating characteristics of &lt;em&gt;incomplete markets&lt;/em&gt; $-$ see for example @AFK 's answer in &lt;a href=&quot;https://quant.stackexchange.com/questions/9562/how-to-choose-a-risk-neutral-measure-when-the-market-is-incomplete&quot;&gt;How to choose a risk-neutral measure when the market is incomplete?&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's assume we have a market $\mathcal{M}$ with $n$ tradeable assets $S \equiv (S^{(1)}, \cdots, S^{(n)})$ and $n+1$ sources of risk, &lt;em&gt;e.g.&lt;/em&gt; Brownian motions $W \equiv (W^{(1)}, \cdots, W^{(n+1)})$ $-$ for example assets up to $n-1$ might follow a straightforward Geometric Brownian Motion (GBM), while the $n^{th}$ asset has Heston-like stochastic volatility dynamics. This market is incomplete because the number of (tradeable) assets is lower than the number of (sources of) risks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, WLOG let's assimilate risk sources to Brownian motions and let $W^{(n+1)}$ be the &quot;extra&quot; source of risk. Assume we have built the market model to price a derivative security $f \equiv f(W^{(n+1)})$, meaning that the derivative payoff depends on the risk source $W^{(n+1)}$:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;If we now extend our market, let's call it $\mathcal{M}_{+f}$, by including $f$ as a tradeable asset, then is $\mathcal{M}_{+f}$ complete?&lt;/strong&gt; &lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Is it as simple as saying: &quot;&lt;em&gt;by including $f$, the number of assets is equal to the number of risk factors hence the market $\mathcal{M}_{+f}$ is complete&lt;/em&gt;&quot;?&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For example, as mentioned above, AFK says in his answer:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A stochastic volatility model for a single risky asset can't be complete because you have two sources of randomness. But you can easily make it complete by adding a derivative whose value depends on the volatility. For example, if you add a variance swap in the Heston model then it becomes complete. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Another example is this post, &lt;a href=&quot;https://quant.stackexchange.com/questions/7994/how-to-prove-that-markets-are-incomplete-under-the-stochastic-volatility-model/10462#10462&quot;&gt;How to prove that markets are incomplete under the Stochastic Volatility model?&lt;/a&gt;, see @pbr142 's answer $-$ &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.407.6122&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;link&lt;/a&gt; to the paper mentioned:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The paper by Marc Romano and Nizar Touzi, Section 3, contains a general proof that a stochastic volatility model cannot be complete in the sense that the addition of the option completes the market (in the sense of Harrison and Pliska) generated by the underlying and risk-free borrowing/lending.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2017-04-04T16:59:17.800" Title="Extending an incomplete market to generate a complete one" Tags="&lt;option-pricing&gt;&lt;risk-neutral-measure&gt;&lt;market-model&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33146" PostTypeId="2" ParentId="33142" CreationDate="2017-03-21T18:24:45.840" Score="0" Body="&lt;p&gt;I wrongly assumed that that a random normal variable's distribution was described by its mean and volatility. It is, however, described by its mean and &lt;em&gt;variance&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for the denominator in the Z computation I now use 0.1 (volatility) instead of 0.01 (the variance, which I had mistaken to be volatility), which results in the right answer. &lt;/p&gt;&#xA;" OwnerUserId="13681" LastActivityDate="2017-03-21T18:24:45.840" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33147" PostTypeId="1" CreationDate="2017-03-21T18:50:37.080" Score="1" ViewCount="771" Body="&lt;p&gt;It is understood that a hobbyist algorithmic trader will have a difficult time to compete against professional algorithmic traders in finding market ineffectivities to exploit in the general case.  However, I would assume those professional algorithmic traders must target higher-value inefficiences (high liquidity, higher volume) to make it worth their time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a hobbyist working with much smaller capital and yield requirements, are there opportunities left over for them to exploit, with the assumption that the professional traders have chosen to not pursue them due to the value of the opportunity being too low for them?&lt;/p&gt;&#xA;" OwnerUserId="1581" LastActivityDate="2017-05-11T22:33:47.840" Title="Are there opportunities in the market for low volume hobbyist algorithmic traders?" Tags="&lt;algorithmic-trading&gt;" AnswerCount="4" CommentCount="4" ClosedDate="2017-05-14T07:00:49.093" ContentLicense="CC BY-SA 3.0" />
  <row Id="33148" PostTypeId="2" ParentId="33135" CreationDate="2017-03-21T19:15:59.897" Score="3" Body="&lt;p&gt;The long only minimum variance portfolio is either equal to the unconstrained minimum variance portfolio, which is usually dense, or it is guaranteed to be sparse - in the sense that there are only few nonzero coefficients. This is a consequence of the fact that the minimum is either achieved at the global minimum or at one of the corners of a convex polyhedron. A typical example for a dense long only portfolio result is from a diagonal covariance matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At first this looks counterintiutive, as one intuitively equates low variance with low risk, and low risk and a sparse portfolio seems like a contradiction. But this method only looks at volatility - other aspects like default risk or so are ignored.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The usual trick is to increase the density of the resulting portfolio is to add a constant to the diagonal of the covariance matrix, thus making it more diagonal. The effect is to make the resulting portfolio more similar to the equal weight portfolio and thus less sparse. &lt;/p&gt;&#xA;" OwnerUserId="27095" LastEditorUserId="27095" LastEditDate="2017-03-21T21:48:58.653" LastActivityDate="2017-03-21T21:48:58.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33149" PostTypeId="2" ParentId="33046" CreationDate="2017-03-21T19:22:52.223" Score="0" Body="&lt;p&gt;Sure: Thompson Reuters Eikon and Bloomberg. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess you are asking for a free version of this and it this point I have to say to the best of my knowledge that there is no such service.&lt;/p&gt;&#xA;" OwnerUserId="26899" LastActivityDate="2017-03-21T19:22:52.223" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33152" PostTypeId="2" ParentId="33132" CreationDate="2017-03-21T20:23:10.717" Score="2" Body="&lt;p&gt;Seconded Shreve's Stochastic Calculus for Finance I and II, if you have the mathematical background.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The one I worked with is Introduction to the Mathematics of Finance, by Roman. About a senior undergraduate/first year graduate level, most of it will be setting up discrete time probability spaces (for the lattice model) and then briefly extending that into stochastics/Black-Scholes.&lt;/p&gt;&#xA;" OwnerUserId="26931" LastActivityDate="2017-03-21T20:23:10.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33153" PostTypeId="2" ParentId="33147" CreationDate="2017-03-21T20:32:01.250" Score="2" Body="&lt;p&gt;The primary differences between a hobbyist and a professional firm is 1) Transaction costs 2) Access to information. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first one you can't do anything about, since that relies on cutting-edge hardware or having your firm right next to the stock exchange, so any sort of low-latency/high-frequency trading strategies won't work as it'll be too expensive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second one you also can't do anything about, and especially for market-making firms they will have access to more information than you and can come up with more sophisticated strategies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can, however, be more creative and think outside the box. Just be aware that there are often &quot;sniffer&quot; algorithms that detect systematic trades (i.e. your algorithm you made in 30 minutes) and capitalize on it.&lt;/p&gt;&#xA;" OwnerUserId="26931" LastEditorUserId="24222" LastEditDate="2017-05-10T21:22:09.487" LastActivityDate="2017-05-10T21:22:09.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33155" PostTypeId="2" ParentId="33132" CreationDate="2017-03-21T21:11:36.477" Score="6" Body="&lt;p&gt;As mentioned by @Adam, &lt;em&gt;Stochastic Calculus for Finance&lt;/em&gt; by Shreve is a good start if you have a reasonably strong mathematical background. Volume I is simpler, as it presents derivative pricing methods in discrete time; Volume II tackles the continuous case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also mentioned by @noob2, &lt;em&gt;Financial Calculus: An Introduction to Derivative Pricing&lt;/em&gt;, by Baxter and Rennie, is an excellent choice. Both authors were working at banks at the time of the writing (Merrill Lynch and Nomura), so they present the whole theory in very intuitive terms, while keeping the math level to a reasonably standard.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you read French, another good option is &lt;em&gt;Finance de Marché&lt;/em&gt; by Poncet and Portait. It is an excellent book, striking a right balance between &lt;em&gt;Options, Futures, and Other Derivatives&lt;/em&gt; and &lt;em&gt;Stochastic Calculus for Finance&lt;/em&gt;. It is a pity it is not translated.&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-03-21T21:17:53.950" LastActivityDate="2017-03-21T21:17:53.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33156" PostTypeId="2" ParentId="33141" CreationDate="2017-03-21T22:21:05.173" Score="12" Body="&lt;p&gt;We assume that, under the probability measure $Q$,&#xA;\begin{align*}&#xA;dS_t &amp;amp;= S_t\big(r_t dt + \sigma dW_s(t)\big),\\&#xA;dr_t &amp;amp;= -k\, r_t dt + \alpha dW_r(t),\tag{1}&#xA;\end{align*}&#xA;where $d\langle W_s(t), W_r(t)\rangle_t = \rho dt$. From $(1)$, for $s\ge t$,&#xA;\begin{align*}&#xA;r_s = e^{-k(s-t)}r_t + \alpha\int_t^s e^{-k(s-u)} dW_r(u).&#xA;\end{align*}&#xA;Then, for $T\ge t$,&#xA;\begin{align*}&#xA;\int_t^T r_s ds &amp;amp;=\frac{r_t}{k}\left(1-e^{-k(T-t)} \right)+\alpha \int_t^T\!\!\!\int_t^s e^{-k(s-u)} dW_r(u) ds\\&#xA;&amp;amp;=\frac{r_t}{k}\left(1-e^{-k(T-t)} \right)+\alpha \int_t^T\!\!\!\int_u^T e^{-k(s-u)} ds dW_r(u) \\&#xA;&amp;amp;=\frac{r_t}{k}\left(1-e^{-k(T-t)} \right)+\alpha \int_t^T\frac{1}{k}\left(1-e^{-k(T-u)} \right) dW_r(u)\\&#xA;&amp;amp;=r_t\beta(t, T)+\alpha \int_t^T \beta(u, T) dW_r(u),&#xA;\end{align*}&#xA;where $$\beta(t, T)=\frac{1}{k}\left(1-e^{-k(T-t)} \right).$$ &#xA;Therefore,&#xA;\begin{align*}&#xA;E^Q\left(\frac{1}{B_T} \mid \mathcal{F}_t\right) &amp;amp;=\frac{1}{B_t}E^Q\left(e^{-\int_t^T r_s ds} \mid \mathcal{F}_t \right)\\&#xA;&amp;amp;=\frac{1}{B_t} e^{-r_t\beta(t, T) + \frac{\alpha^2}{2} \int_t^T \beta^2(u, T) du}.&#xA;\end{align*}&#xA;Moreover,&#xA;\begin{align*}&#xA;E^Q\left(S_T \mid \mathcal{F}_t\right) &amp;amp;= S_t E^Q\left(e^{\int_t^T r_s ds - \frac{\sigma^2}{2} (T-t) + \sigma \int_t^T dW_s(u)} \right)\\&#xA;&amp;amp;=S_t E^Q\left(e^{r_t\beta(t, T)+\alpha \int_t^T \beta(u, T) dW_r(u) - \frac{\sigma^2}{2} (T-t) + \sigma \int_t^T dW_s(u)} \right)\\&#xA;&amp;amp;=S_te^{r_t\beta(t, T)+ \frac{\alpha^2}{2} \int_t^T \beta^2(u, T) du +\alpha \sigma \rho \int_t^T\beta(u, T) du}.&#xA;\end{align*}&#xA;Consequently,&#xA;\begin{align*}&#xA;C(t, T) &amp;amp;= \frac{Fut}{Fwd}\\&#xA;&amp;amp;=\frac{E^Q\left(S_T \mid \mathcal{F}_t\right)}{E\left(\frac{S_T}{B_T} \mid \mathcal{F}_t\right)/E^Q\left(\frac{1}{B_T} \mid \mathcal{F}_t\right)}\\&#xA;&amp;amp;=\frac{S_te^{r_t\beta(t, T)+ \frac{\alpha^2}{2} \int_t^T \beta^2(u, T) du +\alpha \sigma \rho \int_t^T\beta(u, T) du}}{\frac{S_t}{B_t} B_t e^{r_t\beta(t, T) - \frac{\alpha^2}{2} \int_t^T \beta^2(u, T) du}}\\&#xA;&amp;amp;=e^{\alpha^2\int_t^T \beta^2(u, T) du +\alpha \sigma \rho \int_t^T\beta(u, T) du}.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Don't forget the 1/2 in normal variable's characteristic function.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="-1" LastEditDate="2018-08-29T12:49:21.853" LastActivityDate="2018-08-29T12:49:21.853" CommentCount="6" ContentLicense="CC BY-SA 4.0" />
  <row Id="33160" PostTypeId="1" CreationDate="2017-03-22T00:57:42.217" Score="0" ViewCount="80" Body="&lt;p&gt;Why is $$\frac{ \left(\frac{ \Delta S}{S}\right)^2} {dt}$$&#xA;an estimator of volatility squared (as claimed by my book)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I understand it, we estimate volatitility squared as &#xA;$$\frac{ Var( \text{Return})} {dt}$$&#xA;where $\text{Return} = \Delta S/S$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how does one justify the first formula? Is it the volatility of just a single change in price?&lt;/p&gt;&#xA;" OwnerUserId="26835" LastActivityDate="2017-03-22T00:57:42.217" Title="Estimating volatility" Tags="&lt;volatility&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33162" PostTypeId="1" AcceptedAnswerId="33163" CreationDate="2017-03-22T03:00:22.133" Score="0" ViewCount="294" Body="&lt;p&gt;I have been told that the Euler discretisation is exact for the GBM process.Is it true and how can I proof this?  This would mean, for a GBM process, if I am increasing my discretisation step, the value is unaffected. However, in many application, the error for discretisation of GBM decreases with increasing steps. What is true?&lt;/p&gt;&#xA;" OwnerUserId="25867" LastActivityDate="2017-03-22T04:00:04.087" Title="Euler discretization" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;monte-carlo&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33163" PostTypeId="2" ParentId="33162" CreationDate="2017-03-22T04:00:04.087" Score="4" Body="&lt;p&gt;It is exact if you shift to log coordinates first. In that case, you are discretising Brownian motion with drift i.e.&#xA;$$&#xA;d\log S_t = (\mu-0.5\sigma^2 )dt + \sigma dW_t&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is definitely not exact in the original coordinates, since the probability of going negative is positive for this discretization.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2017-03-22T04:00:04.087" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33164" PostTypeId="2" ParentId="20944" CreationDate="2017-03-22T07:52:59.897" Score="-4" Body="&lt;p&gt;you can use opinion finder tool or gpoms tool to conduct sentimental analysis&lt;/p&gt;&#xA;" OwnerUserId="27104" LastActivityDate="2017-03-22T07:52:59.897" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33165" PostTypeId="1" CreationDate="2017-03-22T10:22:25.843" Score="0" ViewCount="97" Body="&lt;p&gt;In my problem I have a liquid underlying, whose derivatives are not quoted and therefore the option market is illiquid. For this reason I can't get the implied volatilities and calibrate my model in order to obtain the fair value of derivatives.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is often the case in the commodities industry. How can I estimate the implied volatilities?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just make a fictitious example to better explain:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I am trading palm oil in Thailand, which is very liquid and is quoted in real time.&lt;/li&gt;&#xA;&lt;li&gt;I would like to buy and sell simple European Calls or Puts in order to hedge myself. However they are not quoted in the market, and I have to decide their fair price. How do I do?&lt;/li&gt;&#xA;&lt;li&gt;The futures are quoted.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="26657" LastActivityDate="2017-03-22T10:22:25.843" Title="Option valuation in illiquid markets" Tags="&lt;option-pricing&gt;&lt;commodities&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33166" PostTypeId="1" AcceptedAnswerId="33167" CreationDate="2017-03-22T11:30:15.760" Score="1" ViewCount="239" Body="&lt;p&gt;I would like to find a step by step solutionfor the following Markowitx problem.&#xA;It is a standard markowitz problem. The unique detail (wich is why I am posting this question here) is that there is a upper bound and a lowerbound for the weights vector.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem I want to solve:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/HHQjx.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/HHQjx.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The detail:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/pOYZE.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/pOYZE.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Definitions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;$w$&lt;/strong&gt; is the weight vector, &lt;strong&gt;$\Sigma$&lt;/strong&gt; is the covariance matrix, and $\mu$ is the returns vector.&lt;/p&gt;&#xA;" OwnerUserId="25437" LastEditorUserId="2587" LastEditDate="2017-03-22T11:32:18.920" LastActivityDate="2017-03-22T11:41:24.447" Title="Solving a Markowitz problem with restrictions (lower and upper bound) to the weights vector" Tags="&lt;portfolio-management&gt;&lt;optimization&gt;&lt;portfolio-optimization&gt;&lt;markowitz&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33167" PostTypeId="2" ParentId="33166" CreationDate="2017-03-22T11:41:24.447" Score="2" Body="&lt;p&gt;The constraints&#xA;$$&#xA;w \le b_u&#xA;$$&#xA;and&#xA;$$&#xA;b_l \le w \Leftrightarrow-w \ge - b_l&#xA;$$&#xA;can all be handled using the &lt;a href=&quot;https://en.wikipedia.org/wiki/Karush%E2%80%93Kuhn%E2%80%93Tucker_conditions&quot; rel=&quot;nofollow noreferrer&quot;&gt;Kuhn–Tucker conditions&lt;/a&gt;. Numerical solvers exist for these linear constraints too (e.g. &lt;a href=&quot;https://stat.ethz.ch/R-manual/R-devel/library/stats/html/constrOptim.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;this is in R&lt;/a&gt;). See als &lt;a href=&quot;https://en.wikipedia.org/wiki/Quadratic_programming&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, with the lower bound you often want the optomizer to choose some assets to be zero and if greater zero then greater than some lower bound.&#xA;In this case you get a mixed-integer problem which are much harder to handle (I have sucessfully applied LINDO to this class of problems).&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2017-03-22T11:41:24.447" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33168" PostTypeId="1" AcceptedAnswerId="33170" CreationDate="2017-03-22T12:39:15.390" Score="0" ViewCount="125" Body="&lt;p&gt;First, I have to say sorry - my question is very basic. I do not have a good understanding of math and statistics. I did a lot of research before posting here, but I could not come to a 100% satisfying answer to my problem. Here is my situation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So there is this pretty neat financial website which shows me the 250 and 30 day Volatility in % of a certian stock on a certain stock exchange.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And I have this pretty neat C# code which calculates the Standard Variation for a given return array.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also have all CLOSE prices of the last 250 trading days for this asset on that stock exchange. When I run my C# logic over all calculated returns the result matches exactly the figure I can see on that website - 40.8 % for the 250d Volatiliy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far so good.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I run the same Code handing over the returns of only the last 30 trading days, it comes up with 6.6% - instead of the figure for 30d on that website which is around 20.07%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I guess I am doing something wrong. I searched many websites to find the correct approach to calculate the figure correctly, but I did not manage to get a result which is close to 20.07%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The closest approach I have is this: &#xA;I am guessing the 30d figure on that website is the annualized volatility. So I thought I have to multiply my result of 6.6% with the the respective multiplier which I learned should be the Square Root of 250 / 30. The result in this case is 19.05% - which is not 20.07% obviously. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could someone please tell me if my approach is correct or not? It could of course be that the website does not take the CLOSE prices to calculate the volatilites, that would be an explanation. I just want to know if my approach is correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Code for calculation of Volatility (not written by me):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    public static class Volatility&#xA;{&#xA;    public static double stdDeviation;&#xA;    public static double semiDeviation;&#xA;&#xA;    public static void CalcVolatility(List&amp;lt;float&amp;gt; returns, Predicate&amp;lt;int&amp;gt; filter)&#xA;    {&#xA;        double tempStandard = 0;&#xA;        double tempSemi = 0;&#xA;        int count = 0;&#xA;&#xA;        double averageLogReturn = logAverage(returns, filter);&#xA;&#xA;        for (int ii = 0; ii &amp;lt; returns.Count; ii++)&#xA;        {&#xA;            if (!filter.Invoke(ii))&#xA;                continue;&#xA;&#xA;            double logReturn = Math.Log(1 + returns[ii]);&#xA;            double add = Math.Pow(logReturn - averageLogReturn, 2);&#xA;&#xA;            tempStandard = tempStandard + add;&#xA;            count++;&#xA;&#xA;            if (logReturn &amp;lt; averageLogReturn)&#xA;                tempSemi = tempSemi + add;&#xA;        }&#xA;&#xA;        stdDeviation = Math.Sqrt(tempStandard/(count - 1)*count);&#xA;        semiDeviation = Math.Sqrt(tempSemi/(count - 1)*count);&#xA;    }&#xA;&#xA;    private static double logAverage(List&amp;lt;float&amp;gt; returns, Predicate&amp;lt;int&amp;gt; filter)&#xA;    {&#xA;        double sum = 0;&#xA;        int count = 0;&#xA;&#xA;        for (int ii = 0; ii &amp;lt; returns.Count; ii++)&#xA;        {&#xA;            if (!filter.Invoke(ii))&#xA;                continue;&#xA;&#xA;            sum += Math.Log(1 + returns[ii]);&#xA;            count++;&#xA;        }&#xA;&#xA;        return sum/count;&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here is the list of returns, starting with the oldest:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-0.02970294,-0.03061228,0.03157898,-0.0204082,-0.05208328,-0.02197807,-0.02247189,-0.02298848,0,0.03529408,0.01477274,-0.04703247,0.04347826,0.007882848,-0.002234608,-0.03919376,0.04895104,0.00777781,-0.0154355,0.003359486,-0.03236612,0.00922724,-0.03428568,0.02958577,-0.00114941,-0.02991947,-0.007117417,0.01194742,-0.005903182,0.01781471,0.002333762,0,-0.01979048,0.00356297,-0.004733737,0.009512433,-0.01295639,-0.002386604,-0.01315794,-0.001212106,-0.01820387,0.0321384,0.03113775,0.00464577,0.004624287,-0.01726127,-0.02341918,-0.002398051,0.01322113,-0.01542113,0.03734942,-0.01858301,-0.002366904,-0.03084226,-0.02692773,-0.04905665,-0.003968203,-0.01859229,0.04194852,0.02987013,-0.001261018,0.003787905,0.04402512,-0.1638554,-0.03458212,0.04626859,0.03708991,0.01100415,-0.0122449,0.0247934,-0.001344149,-0.1184388,-0.0396946,0.02543716,0.007751931,-0.01230763,0.01713392,0.02143951,0.001499231,0.002994063,0.03432836,-0.01731605,0.005873727,0.01605836,-0.02586208,0.07669624,0.04931501,-0.03263704,0.0202429,0.002645548,-0.02506595,-0.01082546,0.02188779,0.02275772,0.003926729,-0.01434164,0.001322813,0.03698811,-0.003821683,0.003836344,-0.02929937,0.02362198,0.03076929,-0.01368164,-0.01639346,0.001282111,0.03072982,-0.004968954,0.008739113,-0.001237682,0.01239156,0.002448022,-0.006105,0.001228485,-0.007361942,-0.00247223,-0.001239141,0.003722111,-0.01606924,-0.006281401,0,-0.05183313,-0.009333372,-0.0107671,-0.01360543,-0.001379375,0.02762437,0.03494618,-0.012987,-0.02894739,-0.009485054,0.02462381,0.005340465,-0.04913678,0.03212291,-0.01894452,-0.001379375,-0.006906071,0.02503478,-0.02713702,-0.01394699,-0.01414426,0.02439019,0.02380955,0.03146375,-0.007957536,0.01069513,0.02116407,0.01295335,0.0102302,0.01012653,-0.03007518,0.01162791,0.00638569,0.001269019,0.001267486,-0.02151901,-0.03104785,0.01068093,0,-0.02113611,-0.01349526,-0.02872781,-0.02535212,0.008670582,0.007163317,-0.004267455,-0.01714281,-0.03052329,0.04647679,0.002865293,0,0.01571434,-0.02531646,0.007215,0.01575928,-0.004231341,0.01558079,-0.009762942,-0.02957742,0.08708273,0.01735649,-0.001312397,-0.01314059,0.01597873,0.009174271,0.02337663,0.0177665,0.03241898,0.01086957,0.001194728,-0.0250597,0.04406366,0.01992968,-0.04022992,0.008383268,0,0.01068884,0.003525219,0.00234196,-0.003504697,-0.01289564,-0.02969125,0.01223996,0.02055618,-0.005924165,0.01549465,-0.01877931,-0.01196178,0.01089589,0.007185679,-0.007134413,-0.001197589,-0.01678657,0.001219496,-0.02436051,-0.02996253,0.01673103,0.005063301,0,0.0201511,0.02962962,-0.02637891,0.01354684,-0.01579588,0.007407385,-0.006127445,-0.01356347,-0.01125,0.002528413,-0.01513236,-0.007682512,-0.006451607,-0.012987,0.01710528,-0.02328591,0.01456951,-0.006527409,0.01445471,0.01683939,0.001273869,-0.007633641,0.002564146,-0.01406647,0.01426716,0.007672612,-0.002538038,-0.008905889,0.005134799,0.02043427,0.01376718,0.004938282,0.002456971,0.007352993&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="25552" LastEditorUserId="25552" LastEditDate="2017-03-22T19:11:47.283" LastActivityDate="2017-03-23T00:57:36.867" Title="Historic Volatility calculation does not fit to given figures" Tags="&lt;volatility&gt;" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="33169" PostTypeId="1" AcceptedAnswerId="33180" CreationDate="2017-03-22T12:54:44.433" Score="0" ViewCount="395" Body="&lt;p&gt;Given the following model$$dS_t=S_t(\mu dt+\sigma(t,S_t)dW_t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using Monte Carlo Pricing method, I want to determine the price of the option. However I have been encountered the following problems:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;How would I choose the coordinate? Log return or normal $S_t$, which is more appropriate here?&lt;/li&gt;&#xA;&lt;li&gt;How can I tame the discretization error? I am using Euler-Scheme for the discretisation of the stochastic differential equation. The discretization is bounded strongly by $E[|X_t-\bar X_t|]&amp;lt;K\delta^{1/2}$ and weakly by $K\delta$. I want choose the stepsize $\delta$ such that the scheme converges. But I dont know how to verify this. As the exact $X_t$ is not know, I cannot simulate the error $E[|X_t-\bar X_t|]$. I can only compute $E[\bar X_t^{\delta}]$ for different step size. I have tried to compute $E[\bar X_t^{\delta}]-E[\bar X_t^{1/2\delta}]$, but the result doesn't show the weak convergence of order 1. The result jumps from one to other value. I assume this is caused by statistical error(standard error of monte carlo simulation) and rounding off error. Therefore what is the appropriate way to find the accuracy of my scheme.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Edit&lt;a href=&quot;https://i.stack.imgur.com/j6fcx.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/j6fcx.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I plotted the $E[\bar X_t^{\delta}]-E[\bar X_t^{1/2\delta}]$ on the graph. The horizontal axis shows the number of steps and the vertical axis shows $E[\bar X_t^{\delta}]-E[\bar X_t^{1/2\delta}]$. For example, for the point 100 on the horizontal axis, I calculated $|E[\bar X_t^{T/50}]-E[\bar X_t^{T/100}]|$. How can I explain the peak in the beginning and the graph doesn't really show a convergence as one would expect from weak convergence of Euler Scheme&lt;/p&gt;&#xA;" OwnerUserId="25867" LastEditorUserId="25867" LastEditDate="2017-03-22T16:37:06.703" LastActivityDate="2017-03-22T23:08:52.887" Title="Euler discretisation error for stochastic volatility model" Tags="&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;stochastic-volatility&gt;&lt;numerical-methods&gt;&lt;euler&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33170" PostTypeId="2" ParentId="33168" CreationDate="2017-03-22T13:24:17.787" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Could someone please tell me if my approach is correct or not? It&#xA;  could of course be that the website does not take the CLOSE prices to&#xA;  calculate the volatilites, that would be an explanation. I just want&#xA;  to know if my approach is correct.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The correct approach is as follows: For 1 month historical volatility using a 250 (I use 252) day trading year you would not use the past 30 trading days.  30 days would correspond with a 360 or 365 day trading year.  You should use 20 trading days.  This is an Excel formula that I just so happen to have open on my desktop right now.  Hope it helps.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[Std Dev of Daily Returns of the last 20 trading days]*[Square Root of 252]&#xA;=(STDEV.P(I2807:I2826))*SQRT(252)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To calculate HV you need daily % changes.  If your source isn't using the closing price to derive their daily % change then they do not have correct HV for the security you are referencing and you will not come up with the same number.&lt;/p&gt;&#xA;" OwnerUserId="26556" LastEditorUserId="26556" LastEditDate="2017-03-22T13:48:01.207" LastActivityDate="2017-03-22T13:48:01.207" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="33171" PostTypeId="1" AcceptedAnswerId="33172" CreationDate="2017-03-22T15:42:16.030" Score="2" ViewCount="1063" Body="&lt;p&gt;I would like to find a Derivation of the efficient frontier set for the markowitz problem:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/Ydqn9.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Ydqn9.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="25437" LastActivityDate="2017-03-22T16:23:08.723" Title="Derivation of the efficient frontier set (markowitz problem)" Tags="&lt;optimization&gt;&lt;portfolio-optimization&gt;&lt;markowitz&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33172" PostTypeId="2" ParentId="33171" CreationDate="2017-03-22T16:23:08.723" Score="5" Body="&lt;p&gt;To solve this constraint minimization problem, first form the Lagrangian Function&#xA;\begin{align}&#xA;L(w,\lambda_1,\lambda_2)=w'\Sigma w + \lambda_1(w'\boldsymbol{\mu}-m) + \lambda_2 (w'\boldsymbol{1}-1).&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first order conditions for a minimum are then given by&#xA;\begin{align}&#xA;\frac{\delta L(w,\lambda_1,\lambda_2)}{\delta w}&amp;amp;=2 \Sigma w + \lambda_1 \boldsymbol{\mu} + \lambda_2 \boldsymbol{1}=\boldsymbol{0} \\&#xA;\frac{\delta L(w,\lambda_1,\lambda_2)}{\lambda_1}&amp;amp;=w'\boldsymbol{\mu}-m=0 \\&#xA;\frac{\delta L(w,\lambda_1,\lambda_2)}{\lambda_2}&amp;amp;=w'\boldsymbol{1}-1=0.&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This system of linear equations using matrix algebra can be represented as&#xA;\begin{align}&#xA; \begin{bmatrix} &#xA;2\Sigma &amp;amp; \boldsymbol{\mu} &amp;amp; \boldsymbol{1} \\&#xA;\boldsymbol{\mu}' &amp;amp; 0 &amp;amp; 0 \\&#xA;\boldsymbol{1}' &amp;amp; 0 &amp;amp; 0&#xA;\end{bmatrix}&#xA; \begin{bmatrix} &#xA;w  \\&#xA;\lambda_1 \\&#xA;\lambda_2 &#xA;\end{bmatrix}=&#xA;\begin{bmatrix} &#xA;\boldsymbol{0}  \\&#xA;m \\&#xA;1&#xA;\end{bmatrix},&#xA;\end{align}&#xA;or &#xA;\begin{align}&#xA;\boldsymbol{A}\boldsymbol{z}=\boldsymbol{b},&#xA;\end{align}&#xA;where &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA; \boldsymbol{A}:=\begin{bmatrix} &#xA;2\Sigma &amp;amp; \boldsymbol{\mu} &amp;amp; \boldsymbol{1} \\&#xA;\boldsymbol{\mu}' &amp;amp; 0 &amp;amp; 0 \\&#xA;\boldsymbol{1}' &amp;amp; 0 &amp;amp; 0&#xA;\end{bmatrix},&#xA;\boldsymbol{z}:=&#xA; \begin{bmatrix} &#xA;w  \\&#xA;\lambda_1 \\&#xA;\lambda_2 &#xA;\end{bmatrix}&#xA;\boldsymbol{b}:=&#xA;\begin{bmatrix} &#xA;\boldsymbol{0}  \\&#xA;m \\&#xA;1&#xA;\end{bmatrix}.&#xA;\end{align}&#xA;The solution for $\boldsymbol{z}$ is then given by (A has full rank and is thus invertible)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;\boldsymbol{z}=\boldsymbol{A}^{-1} \boldsymbol{b}&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first element of $\boldsymbol{z}$ gives you the set of efficient portfolios varying m. &lt;/p&gt;&#xA;" OwnerUserId="26565" LastActivityDate="2017-03-22T16:23:08.723" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33174" PostTypeId="1" CreationDate="2017-03-22T16:57:02.187" Score="0" ViewCount="219" Body="&lt;p&gt;I want to estimate the historical price of out of the money puts on equities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do have about 10 years history of implied volatility (IV) but I would like more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had the naïve idea modeling the IV with historical vol (HV) and calibrate my model on the 10 year data I have.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any better suggestions / ideas?&lt;/p&gt;&#xA;" OwnerUserId="27109" LastEditorUserId="467" LastEditDate="2017-03-23T03:42:46.907" LastActivityDate="2017-04-22T04:09:16.733" Title="How to estimate historical implied volatility?" Tags="&lt;implied-volatility&gt;&lt;parameter-estimation&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="33177" PostTypeId="1" CreationDate="2017-03-22T19:32:20.687" Score="1" ViewCount="109" Body="&lt;p&gt;I was wondering if someone familiar with the RQuantLib library can have a look and let me know if this makes sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to get total return of a 5 year constant maturity treasury bond. Does the below make sense? &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;### Bonds&#xA;# Calculate total returns from the yield of 5 year constant matury bond    &#xA;getSymbols(&quot;DGS5&quot;, src=&quot;FRED&quot;) #load US Treasury 5y yields from FRED&#xA;data &amp;lt;-DGS5&#xA;ret[1]&amp;lt;-0&#xA;for (i in 1:(nrow(data)-1)) {&#xA;temp &amp;lt;- FixedRateBondPriceByYield(yield=data[i+1,1]/100, issueDate=Sys.Date(), maturityDate=advance(&quot;UnitedStates/GovernmentBond&quot;, Sys.Date(), 10, 3),  rates=data[i,1]/100,period=2)[1]/100-1                         &#xA;ret[i+1]&amp;lt;-temp&#xA;&#xA;}&#xA;#total return will be the price return + yield/360&#xA;tret &amp;lt;- ret + lag(data,k=1)/360/100&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13527" LastActivityDate="2017-03-22T19:32:20.687" Title="compute return from yield" Tags="&lt;fixed-income&gt;&lt;programming&gt;&lt;rquantlib&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33179" PostTypeId="1" AcceptedAnswerId="33181" CreationDate="2017-03-22T22:22:59.040" Score="-3" ViewCount="115" Body="&lt;p&gt;I would like to solve (as mathematically and formally as possible) that the following Markowitz problems are equivalent.&#xA;The big point is: I want to show that it is equivalent to constrain the return of the portfolio to be greater than $m$ or equal to $m$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Formulation I&#xA;&lt;a href=&quot;https://i.stack.imgur.com/2U2ql.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/2U2ql.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Formulation II&#xA;&lt;a href=&quot;https://i.stack.imgur.com/jbh7n.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/jbh7n.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="25437" LastEditorUserId="24222" LastEditDate="2017-03-22T23:28:44.290" LastActivityDate="2017-03-23T00:20:34.920" Title="Show that two formulations of Markowitz problem are equivalent" Tags="&lt;portfolio-management&gt;&lt;portfolio-optimization&gt;&lt;markowitz&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33180" PostTypeId="2" ParentId="33169" CreationDate="2017-03-22T23:08:52.887" Score="1" Body="&lt;p&gt;I figured it out. The problem is just, that I am not taking the same driving brownian motion. That would mean, if I am calculating $E[\bar X^{\delta}]$ and $E[\bar X^{1/2\delta}]$. The sample of path is complete different and thus not comparable. For weak convergence, one need to be sure, that the sample path are almost surely the same. As a result, the variance of the sample of data will dominate the discretisation error. For that purpose, one might need to use the same driving brownian motion. I generate 2 random variables for $1/2\delta$ and add them in pairs in order to compute the brownian motion for the $\delta$. As the path are close to each other, the variance is also reduced.&lt;/p&gt;&#xA;" OwnerUserId="25867" LastActivityDate="2017-03-22T23:08:52.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33181" PostTypeId="2" ParentId="33179" CreationDate="2017-03-22T23:11:23.767" Score="2" Body="&lt;p&gt;I guess it amounts to saying that you want to exclude the case when the optimal portfolio $w_*$ is such that $\mu'w_{*}&amp;gt;m$. Notice that, given that $\Sigma$ is positive definite, you can choose another portfolio $w_{**}=w_{*}-1\epsilon$, with $\epsilon&amp;gt;0$ and small enough, such that $\mu'w_{**}=\mu'w_* - \mu'1\epsilon&amp;gt;m$, but clearly $w_{**} {'}\Sigma w_{**}=w_{*} {'}\Sigma w_{*} - 1{'}\Sigma 1 \epsilon &amp;lt;w_{*} {'}\Sigma w_{*}$, because $1{'}\Sigma 1&amp;gt;0$. This contradicts the optimality of $w_*$&lt;/p&gt;&#xA;" OwnerUserId="8028" LastEditorUserId="8028" LastEditDate="2017-03-23T00:20:34.920" LastActivityDate="2017-03-23T00:20:34.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33182" PostTypeId="1" CreationDate="2017-03-23T00:28:19.750" Score="1" ViewCount="656" Body="&lt;p&gt;I am looking for a reference on how to approximate implied volatility in a stochastic model vis-a-vis vanna, volga, vega, and other model parameters, in particular the derivation of such equations and the underlying intuition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any good articles/books out there?&lt;/p&gt;&#xA;" OwnerUserId="27113" LastEditorUserId="26559" LastEditDate="2018-10-27T19:16:37.843" LastActivityDate="2018-10-27T19:16:37.843" Title="Reference: Vanna, volga, vega approximations" Tags="&lt;reference-request&gt;&lt;volatility-smile&gt;&lt;volatility-interpolation&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33183" PostTypeId="1" CreationDate="2017-03-23T00:49:40.277" Score="1" ViewCount="174" Body="&lt;p&gt;What is the solution for the following markowitz &lt;strong&gt;unconstrained&lt;/strong&gt; problem?&#xA;The sum of the entries of the weights vector $w$ should always be requied to sum one? Or if we use the risk-free asset it can be let unconstrained? I thought we should always have the constraint $1^{T}w = 1$. Am I wrong? Anyway I would like the solution for the unconstrained and the constrained problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/nLZnO.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/nLZnO.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/r9g5o.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/r9g5o.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="25437" LastEditorUserId="16148" LastEditDate="2017-03-23T14:21:59.577" LastActivityDate="2017-03-23T14:21:59.577" Title="Solution for Markowitz problem with Safety-First Ratio" Tags="&lt;optimization&gt;&lt;portfolio-optimization&gt;&lt;markowitz&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33184" PostTypeId="2" ParentId="33168" CreationDate="2017-03-23T00:57:36.867" Score="0" Body="&lt;p&gt;It's quite difficult to replicate without the data and the website you mentioned.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is likely that the 20% is annualized (since that is a rather standard way of presenting it), so your 19% isn't too far off. Some possible reasons there's a difference may be:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Your data is using EOD close price while the website isn't&lt;/li&gt;&#xA;&lt;li&gt;One dataset adjusts for stock splits, shares, repos, etc while the other doesn't&lt;/li&gt;&#xA;&lt;li&gt;Possible error in the C code&lt;/li&gt;&#xA;&lt;li&gt;Possible error in the website code&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="26931" LastActivityDate="2017-03-23T00:57:36.867" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33185" PostTypeId="2" ParentId="33174" CreationDate="2017-03-23T01:01:18.497" Score="1" Body="&lt;p&gt;You can't estimate historical prices because they are given to you already. If you're trying to estimate future implied volatility based on historical implied volatility &lt;strong&gt;and&lt;/strong&gt; historical volatility, then that is possible.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Use any statistical package or code to calculate HV based on underlying asset&lt;/li&gt;&#xA;&lt;li&gt;Take your IV data and calibrate your HV model somehow (this part is up to you)&lt;/li&gt;&#xA;&lt;li&gt;Project new IV into the future via Black-Scholes&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="26931" LastActivityDate="2017-03-23T01:01:18.497" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33186" PostTypeId="2" ParentId="33089" CreationDate="2017-03-23T04:18:19.350" Score="4" Body="&lt;p&gt;Because implied vol takes into account very large but rare events, while realized vol will only take into account such events if they have occured in the period over which the realized vol was calculated (unlikely, since large low probability events are, by definition, rare).  If not convinced, consider an extreme case of say USDHKD (HKD is pegged to the USD).  The realized vol is close to zero, while the implied vol is greater than zero reflecting the (very low) risk that the peg breaks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly, returning to equities, there is a natural appetite to purchase protection against adverse events (ie buy OTM puts) which is not matched by the appetite for selling protection, possibly because the later can only be sustained to a certain point when a crisis hits (when margins can't be met the position is stopped out).&lt;/p&gt;&#xA;" OwnerUserId="3297" LastActivityDate="2017-03-23T04:18:19.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33187" PostTypeId="1" AcceptedAnswerId="33192" CreationDate="2017-03-23T09:23:50.080" Score="2" ViewCount="235" Body="&lt;p&gt;once I read about the wise banker's aphorism. It says:&#xA;&quot;Too little liquidity may kill the bank suddenly, but too much liquidity kills&#xA;the bank slowly and surely&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first part of this sentence is pretty clear, but I don't get the meaning of the second one. Why should too much liquidity put at risk a bank's stability?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance.&lt;/p&gt;&#xA;" OwnerUserId="22470" LastActivityDate="2017-03-23T12:30:06.947" Title="Liquidity Risk - &quot;The wise banker's aphorism&quot;" Tags="&lt;liquidity-risk&gt;" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="33189" PostTypeId="1" CreationDate="2017-03-23T10:15:44.753" Score="2" ViewCount="3737" Body="&lt;p&gt;What do you call options which behave like barrier options but for a digital option?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, given $0 &amp;lt; t &amp;lt; T$, then if $S_t &amp;gt; K_t$, the binary option $B(K_T,T)$ comes into play, i.e. which pays out 1 unit if $S_T &amp;gt; K_T$. If however $S_t &amp;lt; K_t$, then we get nothing ,and of coruse if $S_t &amp;gt; K_t$but $S_T &amp;lt; K_T$, then we get nothing as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are these options called, and where can I find their prices? For example, in a Black Scholes setting? &lt;/p&gt;&#xA;" OwnerUserId="27118" LastActivityDate="2017-05-25T11:05:35.580" Title="Barrier digital options and pricing" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;binary-options&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33190" PostTypeId="2" ParentId="33187" CreationDate="2017-03-23T10:31:02.980" Score="1" Body="&lt;p&gt;My interpretation of this statement is that abundant availability of liquidity and funding will push banks to adopt reckless strategies, especially in terms of &lt;a href=&quot;https://en.wikipedia.org/wiki/Maturity_transformation&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;em&gt;maturity transformation&lt;/em&gt;&lt;/a&gt; $-$ &lt;em&gt;i.e.&lt;/em&gt; borrowing short-term and lending long-term to earn a spread $-$, leaving them exposed to a sudden liquidity impact which could dry their short-term financing sources and plunge them into a liquidity crisis. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take for example the years preceding the 2008-2009 Financial Crisis. At the start of the 2000's, commercial and investment banks became more and more dependent on &lt;a href=&quot;https://en.wikipedia.org/wiki/Wholesale_funding&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;em&gt;wholesale funding&lt;/em&gt;&lt;/a&gt;, provided primarily by institutional investors (pension funds, insurance companies, investment funds, etc.). Compared to the relative stickiness of retail deposits, wholesale liquidity tends to be short-term, highly volatile and sensitive to the credit profile of the borrower: as soon as doubts arise concerning the solvability or liquidity position of the borrower, participants in the wholesale funding market might abruptly withdrawn, leaving the borrower exposed to a liquidity shortage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Banks dependence on the wholesale funding market kept increasing during the 2000's, as it was a cheap financing source allowing them to earn profitable spreads between their short-term borrowing and their long-term lending. One of the offspring of this trend were &lt;a href=&quot;https://en.wikipedia.org/wiki/Structured_investment_vehicle&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;em&gt;Structured Investment Vehicles&lt;/em&gt; (SIV)&lt;/a&gt;: you might have heard about Mortgage Backed Securities (MBS) and Collateralized Debt Obligations (CDO) and how they contributed to the Financial Crisis; well, large part of their impact was through the SIV channel. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A SIV is similar to a MBS or a CDO: instead of mortgages, SIV package together other MBSs and CDOs into a legal shell; the shell then issues short-term notes (&lt;a href=&quot;https://en.wikipedia.org/wiki/Commercial_paper&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;em&gt;commercial paper&lt;/em&gt;&lt;/a&gt;) to investors, which interest is paid through the coupons received from the underlying MBSs and CDOs. Because maturities were very short, the SIV required refinancing very regularly: new short-term notes would be issued, which would allow to repay preceding investors. In case of financing gaps, the bank backing the SIV $-$ &lt;em&gt;i.e.&lt;/em&gt; setting up and managing the SIV $-$ would be standing to refinance the structure and repay the notes' principal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you might have guessed, during the Crisis, uncertainty about the liquidity and solvability position of some banks led institutional investors to withdrawn from the wholesale funding market, and one consequence was that banks were left exposed to their off-balance sheet SIV and the resulting financing needs; some of these institutions (Bear Stearns, Lehman Brothers) didn't manage to survive the crisis and were indeed &quot;&lt;em&gt;killed [...] slowly and surely&lt;/em&gt;&quot;. &lt;/p&gt;&#xA;" OwnerUserId="20454" LastActivityDate="2017-03-23T10:31:02.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33191" PostTypeId="1" CreationDate="2017-03-23T12:30:03.613" Score="0" ViewCount="504" Body="&lt;p&gt;I am looking to see on a monthly basis, what the market is pricing in in terms of rate hikes in the OIS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would it be sufficient to look at fed funds futures at those monthly dates? My gut says not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be great to understand better how the OIS (and OIS futures curve?) could be used to see how many hikes are priced in at any frequency out to any horizon&lt;/p&gt;&#xA;" OwnerUserId="20531" LastActivityDate="2018-04-17T23:26:10.710" Title="How to Calculate (month by month) what hikes are priced into OIS?" Tags="&lt;funds&gt;&lt;ois&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33192" PostTypeId="2" ParentId="33187" CreationDate="2017-03-23T12:30:06.947" Score="0" Body="&lt;p&gt;In my interpretation &quot;liquidity&quot; is a reference to the amount of liquidity on the balance sheet of the Bank. (Not to the external environment, or to financial innovation). A Bank can reduce risk by avoiding lending and keeping lots of short term government securities on the left side of its balance sheet. By doing this it will sail through crises like those that took down Barings in 1890 or Lehman Bros. in 2008. But in the long run it will earn very little or nothing for its shareholders and will be outcompeted by banks that deploy their capital more intelligently. Yes, maturity transformation is dangerous, but without it you earn the T-Bill rate which is in the long run only a few basis points higher than the rate of inflation. So my answer is the same as Nimbus 3000, you have to take &lt;em&gt;some&lt;/em&gt; risk or you won't earn a decent return.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2017-03-23T12:30:06.947" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33195" PostTypeId="2" ParentId="33191" CreationDate="2017-03-23T15:09:02.120" Score="1" Body="&lt;p&gt;Fed funds futures are nearly sufficient.  You need to know the precise way in which Fed Fund futures are calculated for settlement purposes - e.g. that it is an arithmetic average of the fed funds fixings where a fixing is weighted by the number of days between the fix and the next fix (i.e. a Friday fix will be weighted 3 times if there is no holiday on Monday).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;OIS curves are great too.  Easiest thing to do would be to assume that on average, the fix will be constant between CB meeting dates (or the effective dates of rate changes really - In Europe, the effective date can be 6 or 7 days after the meeting, but otherwise effective date is usually the next day).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, good to keep track of where the fixes are relative to the benchmark rate as there can be a few bps difference at times.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then if you make the assumption that there will be no inter-meeting rate changes and that rate changes can only be 25 bps (for the US) - then if the forward rate between a given central bank meeting date and the next meeting date is $n$ bps higher than previous such forward rate, you might say that the market is implying an $n/25%$  chance of a rate change during that meeting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In EUR, GBP, AUD, NZD, and CAD, there are reasonably liquid forward OIS contracts that do exactly this - they start on one meeting date and end at the next meeting date so they purely capture the central bank's implied prob without you having to do any interpolation or handling of the evil interest rate conventions,&lt;/p&gt;&#xA;" OwnerUserId="26977" LastActivityDate="2017-03-23T15:09:02.120" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33196" PostTypeId="1" CreationDate="2017-03-23T17:05:08.707" Score="1" ViewCount="2493" Body="&lt;p&gt;I'm newbie user of Websim (&lt;a href=&quot;https://websim.worldquantchallenge.com/en/cms/wqc/websim/&quot; rel=&quot;nofollow noreferrer&quot;&gt;websim&lt;/a&gt;), given&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alpha Expression : (est_eps * (cashflow/sharesout) * (est_sales/sharesout))/est_dividend_ps&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Settings-Region:USA, Universe:TOP3000, delay:1,MAX stock weight : 0.05, decay:5.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the problem is the error message&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alpha weight is too strongly concentrated or too a few stocks are assigned weight.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to remedy this?&lt;/p&gt;&#xA;" OwnerUserId="27128" LastEditorUserId="27128" LastEditDate="2017-03-25T19:42:14.823" LastActivityDate="2017-03-25T19:42:14.823" Title="Improvement of Alpha Expression" Tags="&lt;finance&gt;&lt;quant-trading-strategies&gt;&lt;optimization&gt;" AnswerCount="0" CommentCount="7" ClosedDate="2017-03-24T14:12:35.013" ContentLicense="CC BY-SA 3.0" />
  <row Id="33198" PostTypeId="1" AcceptedAnswerId="33236" CreationDate="2017-03-23T18:42:54.553" Score="0" ViewCount="76" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Consider an economy with $J = 2$ assets and $S = 3$ states. The $J\times S$ payoff matrix for the two assets is $$X = \begin{pmatrix}&#xA;0 &amp;amp; 3 &amp;amp; 3\\&#xA;1 &amp;amp; 1 &amp;amp; 0\\&#xA;\end{pmatrix}$$&#xA;  and the asset prices $P' = (5/9,2)$.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Determine whether there are arbitrage opportunities in this market. In addition, find the minimum and maximum prices for the risk free asset.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Attempted solution: We have $$P = X q =  \begin{pmatrix}&#xA;0 &amp;amp; 3 &amp;amp; 3\\&#xA;1 &amp;amp; 1 &amp;amp; 0\\&#xA;\end{pmatrix} \begin{pmatrix}&#xA;q_1\\&#xA;q_2\\&#xA;q_3 &#xA;\end{pmatrix}&#xA;= \begin{pmatrix}&#xA;3q_2 + 3 q_3\\&#xA;q_1 + q_2&#xA;\end{pmatrix}$$&#xA;I believe we need to fix $q_2$ but the solution states that $q = (5/9 - q_2,q_2,6/9 - q_2)$. For $q_2\in (0,5/9)$ all $q$'s are positive so there is no arbitrage. $q_f \in (6/9,11/9)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure how we arrive at this solution any suggestions are greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="19002" LastActivityDate="2017-03-25T16:53:10.940" Title="Valuation functional" Tags="&lt;arbitrage&gt;&lt;finance-mathematics&gt;&lt;economics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33199" PostTypeId="1" AcceptedAnswerId="33202" CreationDate="2017-03-23T19:12:49.617" Score="2" ViewCount="196" Body="&lt;p&gt;Where, the conversion factor for a bond (by John C. Hull) is set equal to the quoted price the bond would have per dollar of principal on the first day of the delivery month on the assumption that the interest rate for all maturities equals 6% per annum (with semiannual compounding)&lt;/p&gt;&#xA;" OwnerUserId="27078" LastActivityDate="2017-03-23T20:32:14.260" Title="When a particular bond is delivered, why there is the need to define a conversion factor? What is its utility?" Tags="&lt;finance&gt;&lt;futures&gt;&lt;derivatives&gt;&lt;economics&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33200" PostTypeId="1" AcceptedAnswerId="33241" CreationDate="2017-03-23T19:26:33.733" Score="-1" ViewCount="305" Body="&lt;p&gt;Ok so I got this idea, it's very simple so I know I'm not the only one who has thought about it. It is a pairs trade between long and short term treasury swaps, and goes as follows:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Going by current market rates:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;USD Libor is 92bps&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;US 30 Year is 210 over libor&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;US 5 year is 102 over libor&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Long 6 bonds of five year treasury swaps for every 1 short&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(More dynamic alteration) Long 1/beta bonds of five year treasury swaps for every 1 short T Bond swap&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;6 x 102 - 210&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;612 - 210 = 402 bps profit&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;4.02% ROI ---&gt; profitable&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Earn the risk premium with less default risk.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;basis risk exists resulting in some volatility, but still hedges exposure to treasuries, leverage till you reach your volatility target.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It should yield a profit, I don't know whether banks, pensions, or HFs are already doing this. Maybe there is something obvious i'm missing as to why it won't work.&lt;/p&gt;&#xA;" OwnerUserId="18578" LastEditorUserId="18578" LastEditDate="2017-03-23T20:20:19.220" LastActivityDate="2017-03-25T20:34:23.233" Title="Does this trade have a name?" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;swaps&gt;&lt;libor&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="33201" PostTypeId="2" ParentId="33093" CreationDate="2017-03-23T20:20:24.580" Score="1" Body="&lt;p&gt;To simply answer this question the author is just multiplying the numbers.&lt;/p&gt;&#xA;" OwnerUserId="19002" LastActivityDate="2017-03-23T20:20:24.580" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33202" PostTypeId="2" ParentId="33199" CreationDate="2017-03-23T20:23:40.920" Score="2" Body="&lt;p&gt;The purpose of conversion factor is to make bonds in the delivery basket more equally deliverable (theoretically anyways, but the process is not perfect). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is an important design decision for bond futures. Without conversion factor, bonds with low coupon rates will have significantly lower prices than their high coupon peers in the delivery basket, making them &lt;em&gt;de facto&lt;/em&gt; cheapest-to-deliver (CTD) issues. A smart investor can buy up all available supply of these low coupon bonds, making it impossible for other market participants to make delivery (&quot;delivery squeeze&quot;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With conversion factors, the bonds become much more similar from a delivery price perspective. If the CTD is cornered by one investor and not obtainable, we simply move to the next possible CTD without incurring too significant a penalty.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this chart below, I'm drawing the delivery prices of three bonds under various parallel yield shifts, WITHOUT the conversion factor adjustment:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ay69a.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ay69a.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly the 4% coupon issue is dominantly cheap. If that issue is not available, I'd have to deliver the next cheapest bond (the 6% issue), whose price is much much higher.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The next chart shows delivery prices for the same three bonds WITH conversion factor adjustments:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/uawit.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/uawit.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As said, the process is not perfect, but the differences are now much more tolerable.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2017-03-23T20:32:14.260" LastActivityDate="2017-03-23T20:32:14.260" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33203" PostTypeId="1" CreationDate="2017-03-23T21:23:46.993" Score="0" ViewCount="37" Body="&lt;p&gt;here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.nrc.gov/docs/ML1208/ML12088A329.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.nrc.gov/docs/ML1208/ML12088A329.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Campbell, Lo, Mackinlay: The Econometrics of Financial Markets&lt;/p&gt;&#xA;&#xA;&lt;p&gt;on page 159 i am looking at equation 4.4.9 in the last line,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;= $I\sigma_{\epsilon_i}^2+X_i^*(X_{i}^{T}X_i)^{-1}(X_i^*)^T\sigma_{\epsilon_i^*}^2  $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to estimate $V_i$  and I am wondering what the terms $\sigma^2_{\epsilon_i}$ and $\sigma^2_{\epsilon_i^*}$ are?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first term does not have a * and the second one does but neither term seems to be defined. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also shouldn't the X matricies here:  $(X_{i}^{T}X_i)$ have stars * because they are in the event window?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FYI - I already have the $X_i^*$ matrix. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="18320" LastEditorUserId="16148" LastEditDate="2017-03-23T21:55:44.393" LastActivityDate="2017-03-23T21:55:44.393" Title="Variance Equations is missing definition" Tags="&lt;stochastic-calculus&gt;&lt;regression&gt;&lt;expected-return&gt;&lt;event-study&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33204" PostTypeId="1" CreationDate="2017-03-23T21:37:29.030" Score="3" ViewCount="194" Body="&lt;p&gt;Very probably this question has been posed before, so if someone can pose the link to the relevant question, it would be appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the relationship between the implied volatility skew and the skewness and kurtosis of underlying, or more generally the relationship between implied volatility curve derivatives (slope, curvature,...) with respect to the strike and the moments of the underlying? Does &lt;a href=&quot;https://en.wikipedia.org/wiki/Edgeworth_series&quot; rel=&quot;nofollow noreferrer&quot;&gt;Edgeworth expansion&lt;/a&gt; provides the answer?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;After posting this question, I found &lt;a href=&quot;http://faculty.baruch.cuny.edu/lwu/papers/bias.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;this paper&lt;/a&gt; (Backus, Foresi, Wu 2004) dealing with just this topic and using precisely the Edgeworth/Gram-Charlier expansion. Other references on similar topics would be most welcome.&lt;/p&gt;&#xA;" OwnerUserId="6686" LastEditorUserId="6686" LastEditDate="2017-09-13T18:36:47.400" LastActivityDate="2017-09-13T18:36:47.400" Title="Relationship between Implied Volatility Curve Derivatives and the Underlying's Moments" Tags="&lt;option-pricing&gt;&lt;implied-volatility&gt;&lt;skew&gt;&lt;moments&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33205" PostTypeId="1" CreationDate="2017-03-23T23:53:32.773" Score="5" ViewCount="673" Body="&lt;p&gt;When we delta hedge with implied volatility, and dynamically adjust every day, I believe the PnL theoretically is $$PnL = 0.5 \Gamma S^2 (\sigma_r^2 - \sigma_i^2)dt$$&#xA;where $\sigma_r$ is realized volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, how accurate is this? I am trying to do a delta hedge experiment, and I find that my daily PnLs range wildly, yet the values given by above formula remain somewhat small (&amp;lt; 1)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I compute my daily PnL as $$'\text{change in call price'} +  \Delta \cdot '\text{change in spot price}'$$&#xA;since the first term gives us what we lost/gained through the call, and the second gives us what we earned shorting the stock. But these two formulas don't match .... however the aggregate results do?&lt;/p&gt;&#xA;" OwnerUserId="27131" LastActivityDate="2017-03-24T07:41:01.637" Title="Delta hedge value formula" Tags="&lt;portfolio-management&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33206" PostTypeId="2" ParentId="33189" CreationDate="2017-03-24T00:18:21.533" Score="3" Body="&lt;p&gt;&lt;em&gt;Disclaimer: This answer derives the prices of two different binary options within the Black/Scholes framework. Note that this is not an appropriate valuation model to use for non-European contracts in most real-world markets.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Up-and-In Binary Call&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After reading your question for a second time, I agree with Quantuple's comment that you seem to be looking for the solution to an up-and-in binary call option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Formally, let&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\nu = \inf \left\{ t \in \mathbb{R}_+ : S_t \geq K \right\}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;be the first hitting time of $S$ to the strike $K$. The option has a unit payoff conditional on $\nu \leq T$ and $S_T \geq K$, i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;V_T = \mathrm{1} \left\{ S_T \geq K \right\} \mathrm{1} \left\{ \nu \leq T \right\}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note however that $S_T \geq K \; \Rightarrow \; \nu \leq T$ and thus $\left\{ S_T \geq K \right\} \subseteq \left\{ \nu \leq T \right\}$. Consequently, we can skip the second indicator and your payoff is just&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;V_T = \mathrm{1} \left\{ S_T &amp;gt; K \right\}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e. the price of an up-and-in binary call option is the same of that of a normal binary call option. You thus have the standard result that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;V_0 = e^{-r T} \mathcal{N} \left( d_- \right),&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;d_- = \frac{1}{\sigma \sqrt{T}} \left( \ln \left( \frac{S_0}{K} \right) + \left( r - \frac{1}{2} \sigma^2 \right) T \right).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Down-and-Out Binary Call&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A more interesting case is the down-and-out binary call. This is how I initially understood your question. Now let&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\nu = \inf \left\{ t \in \mathbb{R}_+ : S_t \leq K \right\}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;V_T = \mathrm{1} \left\{ S_T \geq K \right\} \mathrm{1} \left\{ \nu &amp;gt; T \right\}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This option knocks out, should the spot price breach the barrier before maturity. Otherwise it has a digital payoff of one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\tau = T - t$ be the time-to-maturity. The valuation function $\tilde{V}(S, \tau)$ of this option satisfies the initial boundary value problem&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\mathcal{L} \left\{ \tilde{V} \right\} (S, \tau) &amp;amp; = &amp;amp; 0 \qquad (S, \tau) \in \mathcal{D},\\&#xA;\tilde{V}(K, \tau) &amp;amp; = &amp;amp; 0, \qquad \forall \tau \in \mathbb{R}_+\\&#xA;\tilde{V}(S, 0) &amp;amp; = &amp;amp; \mathrm{1} \{ S \geq K \},&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\mathcal{L}$ is the Black/Scholes forward operator and $\mathcal{D} = \left\{ (S, \tau): S &amp;gt; K, \tau \in \mathbb{R}_+ \right\}$. Using the method of images, see e.g. Buchen (2001), the solution can be shown to be&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\tilde{V}(S, \tau) = \mathcal{B}_K^+(S, \tau) - \stackrel{K}{\mathcal{I}} \left\{ \mathcal{B}_K^+(S, \tau) \right\},&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\mathcal{B}_K^+ (S, \tau) &amp;amp; = &amp;amp; e^{-r \tau} \mathcal{N} \left( d_- \right),\\&#xA;d_- &amp;amp; = &amp;amp; \frac{1}{\sigma \sqrt{\tau}} \left( \ln \left( \frac{S}{K} \right) + \left( r - \frac{1}{2} \sigma^2 \right) \tau \right),\\&#xA;\stackrel{K}{\mathcal{I}} \left\{ \mathcal{B}_K^+ (S, \tau) \right\} &amp;amp; = &amp;amp; \left( \frac{S}{K} \right)^{2 \alpha} \mathcal{B}_K^+ \left( \frac{K^2}{S}, \tau \right),\\&#xA;\alpha &amp;amp; = &amp;amp; \frac{1}{2} - \frac{r}{\sigma^2}.&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Buchen, Peter W. (2001) &quot;Image Options and the Road to Barriers,&quot; &lt;em&gt;Risk Magazine&lt;/em&gt;, Vol. 14, No. 9, pp. 127-130&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-05-25T11:05:35.580" LastActivityDate="2017-05-25T11:05:35.580" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33207" PostTypeId="2" ParentId="33205" CreationDate="2017-03-24T00:48:15.190" Score="4" Body="&lt;p&gt;$$PnL = 0.5 \Gamma S^2 (\sigma_r^2 - \sigma_i^2)dt&#xA;$$&#xA;this is an average P&amp;amp;L rather than an exact one. So it should agree with your other formula on average but not each day. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2017-03-24T00:48:15.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33208" PostTypeId="2" ParentId="17349" CreationDate="2017-03-24T01:43:25.130" Score="1" Body="&lt;p&gt;There are two questions packed in here. I will attempt to answer one at a time. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Does anyone have an idea of how this estimator works?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;A much more concise practical guide to this estimator is found here: &lt;a href=&quot;http://corp.bankofamerica.com/publicpdf/equities/Equity_Mkt_impact.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://corp.bankofamerica.com/publicpdf/equities/Equity_Mkt_impact.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I will try to break it down anyway. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This estimator appears to be a specialized form of a general slippage model in which market impact is proportionate to the b/a spread, trade size as fraction of the total liquidity, shares outstanding, and price variation: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$I  \propto s + \alpha \cdot \sigma_n \cdot (rate_\text{participation})^\beta$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $I$ is the impact function, $s$ is the b/a spread as percentage, $\sigma_n$ is the daily price volatility, and $\alpha$ and $\beta$ are constants. This is of the form of a generalized power function regression. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typically, market impact models are expressed as square root functions; see: &lt;a href=&quot;https://quant.stackexchange.com/questions/7049/typical-coefficients-uses-in-square-root-model-for-market-impact&quot;&gt;Typical coefficients uses in square-root model for market impact&lt;/a&gt;. Almgren added some refinements to fit empirical impact and to express the intuitions that selling provides liquidity and that impact is proportionate to volume intensity with respect to time. Notably, he removed the term for the b/a spread since it didn't fit the data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first term of the expression, $\gamma\sigma\frac{X}{V}\left(\frac{\Theta}{V}\right)^{\frac{1}{4}}$, is intended to model the permanent price change due to a trade. It is also of a generalized power function, but adds a term $\frac{\theta}{V}$ to express the expected long-term impact of removing shares from the market. $\frac{X}{V}$ is the standard expression for participation rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second term, ${ \text{sign}(X)\eta\sigma\left|\frac{X}{VT}\right|^{\frac{3}{5}}}$, is intended to express the temporary impact. The term reflects two intutions: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;a long-trade (X is positive) removes liquidity and therefore result in additional impact; vice versa, a short trade (X is negative) provides liquidity; and&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Trades spread out over longer periods of time result in less impact, thus: $I \propto \frac{1}{T}$. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Combining these intuitions together yields the following statement regarding trading costs: expected total cost from trading are $\frac{1}{2}$ of permanent market impact (assuming you VWAP into the position) plus the temporary impact.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interestingly, it appears feasible under this model to have negative slippage. There is also an peculiar outcome in which selling over very short intervals of time results in very negative slippage. It seems intuitive to me that you could avoid most cases of asymptotic or non-sensical values by assuming both terms following square root laws, but this obviously didn't fit the data as well. I guess models are just models.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I'm using a 40 day moving standard deviation of daily returns in my simulations, since I don't have intraday data. Do you think this provides an overestimate or underestimate of the appropriate volatility in the slippage formula?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Whether or not standard deviation of daily returns under or over-estimates actual variance is idiosyncratic; it depends on how closely the underlying stochastic process follows the &quot;root time&quot; rule. For example, daily sampling of mean-reverting processes will tend to understate the intraday volatility; i.e., the close-to-close sample variance understates the intraday variation for choppy price action (vis-a-vis &quot;penny stocks&quot; in which the tick size is large compared to price). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, the opposite tends to be true for trending processes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recommend that those interested in making the most out of OHLC data check out intraday volatility estimators. I've had much success with the Yhang Zhang estimator found here: &lt;a href=&quot;https://quant.stackexchange.com/questions/27741/understanding-yang-zhang-volatility-estimator&quot;&gt;Understanding Yang-Zhang Volatility Estimator&lt;/a&gt;.  &lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2017-03-27T20:41:02.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33211" PostTypeId="2" ParentId="33205" CreationDate="2017-03-24T07:41:01.637" Score="3" Body="&lt;p&gt;At the order 1 in $dt$ you should rather use $0.5 \Gamma(S, \sigma_i) S^2 ((dS/S)^2 - \sigma_i^2 dt)$ to get the true P&amp;amp;L increment, not the average one (see Mark Joshi's answer).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also this gives you the replication error i.e. difference between the option price evolution (which you are &lt;em&gt;long&lt;/em&gt;) and that of your &lt;em&gt;self-financing&lt;/em&gt; delta hedge (= assumes you hedge in a self-financing fashion by transferring cash between stock and cash account with no exogenous infusion/withdrawal of cash).&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2017-03-24T07:41:01.637" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33212" PostTypeId="2" ParentId="33182" CreationDate="2017-03-24T08:36:28.757" Score="0" Body="&lt;p&gt;perhaps this is what you're looking for? - lookup Mercurio Vanna VOlga&#xA;&lt;a href=&quot;http://www.fabiomercurio.it/consistentfxsmile.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;Consistent Pricing of FX Options&#xA;&quot;  this paper derives a formula for the vol smile in terms of atm vol and 25 delta call and put vols&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17348" LastActivityDate="2017-03-24T08:36:28.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33213" PostTypeId="2" ParentId="33182" CreationDate="2017-03-24T10:44:43.047" Score="2" Body="&lt;p&gt;I find Dimitri Reiswich's Ph.D. thesis quite useful when it comes to FX smile construction and market conventions. Section 3.3 is on vanna/volga method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also have a look at Uwe Wystup's book, especially Section 3.1 &quot;The Trader's Rule of Thump&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reiswich, Dimitri (2010) &quot;The Foreign Exchange Volatility Surface&quot;, Ph.D. Dissertation, Frankfurt School of Finance &amp;amp; Management&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wystup, Uwe (2006) &quot;FX Options and Structured Products&quot;, John Wiley &amp;amp; Sons&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2017-03-24T10:44:43.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33214" PostTypeId="1" CreationDate="2017-03-24T12:13:13.860" Score="0" ViewCount="319" Body="&lt;p&gt;let's say we have a GBM $dS_t = r S_t dt + \sigma S_t dW_t$, where $W_t$ is standard Brownian motion, and we have an European option $C$ with payoff $f(S_T)$. I want to use an Euler discretization scheme to compute the price of $C$. So let's say we fix $N$ (number of time steps), $T$ (final time), and we let $\Delta t= T/N$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So we can write&#xA;$$ S_{(j+1)\Delta t}=S_{j\Delta t}(1 + r\Delta t + \sigma\sqrt{\Delta t}Z_j),$$&#xA;where $Z_j$ are independent standard normal variables. Using a simple Monte Carlo method, we can compute the price of $C$ by averaging the discounted $f(S_T)$, as usual. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I wanted to do was to use antithetic sampling to reduce the variance of the Monte Carlo simulation. Thus, I have a generator that returns independent normal variables $Z$, and in antithetic sampling, I sample $-Z$ after each $Z$. When I do this I get a completely incorrect price using the above scheme (this works fine when using Monte Carlo simulation with the explicit solution of the SDE instead of Euler discretization).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is wrong? I'm guessing that antithetic sampling should be done on the whole family $(Z_0,Z_1,...,Z_{N})$ instead of doing it on each individual normal, but I'm having troubles understanding the theory behind this. Any help is appreciated!&lt;/p&gt;&#xA;" OwnerUserId="25227" LastActivityDate="2017-03-24T12:13:13.860" Title="Euler discretization of SDE, combined with antithetic sampling" Tags="&lt;monte-carlo&gt;&lt;euler&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="33215" PostTypeId="1" CreationDate="2017-03-24T13:14:42.030" Score="1" ViewCount="328" Body="&lt;p&gt;this is my 1st post, and I hope someone can help me! I have been searching for a week now without any luck&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have built a Portfolio Allocation model based on Modern Portfolio Theory (MPT). I now need to validate the model, by matching my model to empirical results from an academic paper/textbook/online article. I would like my model to give the same backtest results, as shown in the external source.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem I have, is that I cannot find any suitable results to match anywhere. I have looked in many places (Google, Google Scholar, old questions on Stack Exchange, quant blogs etc.). The empirical results I have seen, have come from sources such as BSc thesis or using obscure data, such as the Colombo or Zimbabwe stock exchange! I cannot validate my model to the sources, as my employer would not find these sources to be credible&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If someone knows of any empirical MPT results on credible data (S&amp;amp;P stocks, European stocks, Corporate/Govvie bonds etc.) then pls let me know. I would appreciate it, as I am very much at a loss!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is a paper on the Colombo stock exchange&#xA;-   &lt;a href=&quot;http://www.matematika.utm.my/index.php/matematika/article/viewFile/592/585&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.matematika.utm.my/index.php/matematika/article/viewFile/592/585&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="27133" LastEditorUserId="27133" LastEditDate="2017-03-24T15:30:39.870" LastActivityDate="2017-03-25T01:19:56.327" Title="Backtest Results needed to Model Validate my Modern Portfolio Theory model" Tags="&lt;backtesting&gt;&lt;modern-portfolio-theory&gt;&lt;markowitz&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33216" PostTypeId="2" ParentId="16670" CreationDate="2017-03-24T14:11:17.757" Score="4" Body="&lt;p&gt;If skew is too high, then you can have call/put spread arbitrage.  An easy way to see put spread arbitrage would be to price a digital put when using skew.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When using skew, the price of a digital put is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$DP=N(-d_2)+\frac{d\sigma}{dK}\frac{\partial V}{\partial \sigma}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the price is the black scholes price of the digital put plus skew times vega of a vanilla options (puts/calls have the same vega).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, as time to expiry gets longer, vega increases roughly with $\sqrt T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\partial V}{\partial \sigma}=e^{-rT}F\sqrt{T}n(d1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the skew is very steeply negative with a long time to expiry, that skew correction factor could take the price of a digital negative when skew is negative (as it would be for SPX puts).  Probably can also prove with a little bit of work that the implied risk neutral probability density function can go negative if the skew is too high - i.e. butterfly arbitrage.  If I have time later, I might work that out, but I have to get back to work!&lt;/p&gt;&#xA;" OwnerUserId="26977" LastEditorUserId="26977" LastEditDate="2017-03-31T17:55:42.170" LastActivityDate="2017-03-31T17:55:42.170" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33220" PostTypeId="1" CreationDate="2017-03-24T17:50:50.143" Score="0" ViewCount="125" Body="&lt;p&gt;I was trying to read the triumph of the optimist, but it was almost impossible to see a well-written formula to show how the returns have been computed. In a simple sense, I do not know how the annual return index have been computed? I am also not sure whether natural logarithm has been applied to say (P(t)-P(t-1))/ln(p(t-1)). If anyone has encountered this argument please refer me to a page or help us understand whether the returns found in Ibbotson associate is natural logarithm or simply simple returns? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;These data are commonly used for long-term investors such as in pension funds, They also seem to have been called low-frequency returns. &lt;/p&gt;&#xA;" OwnerUserId="12027" LastActivityDate="2017-04-10T14:04:44.847" Title="How did Dimson, Marsh and Staunton (2002) computed the equity index annual real return?" Tags="&lt;log-returns&gt;&lt;investment&gt;&lt;asset-returns&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33223" PostTypeId="1" AcceptedAnswerId="33275" CreationDate="2017-03-24T19:30:15.327" Score="0" ViewCount="2037" Body="&lt;p&gt;I am studying binomial trees and I'm implementing them in VBA to see their convergence to the BS model.&#xA;I searched 3-4 hours in the web; the only good site I know is Volopta.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Very simply question by a beginner: where can I find the VBA function code for the trinomial tree?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; I found the VBA function code for the trinomial tree in the &lt;a href=&quot;http://eu.wiley.com/WileyCDA/WileyTitle/productCd-0471794643.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Rouah-Veinberg book&lt;/a&gt;; I reported it on VBA as follows&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Function Trinomial(Spot, K, T, r, v, n, PutCall As String, EuroAmer As String)&#xA;&#xA;dt = T / n: u = Exp(v * Sqr(2 * dt)): d = 1 / u&#xA;pu = (Exp(r * dt / 2) - Exp(-v * Sqr(dt / 2))) ^ 2 / (Exp(v * Sqr(dt / 2)) - Exp(-v * Sqr(dt / 2))) ^ 2&#xA;&#xA;pd = (Exp(v * Sqr(dt / 2)) - Exp(r * dt / 2)) ^ 2 / (Exp(v * Sqr(dt / 2)) - Exp(-v * Sqr(dt / 2))) ^ 2&#xA;pm = 1 - pu - pd&#xA;S(1, 1) = Spot&#xA;For j = 2 To (n + 1)&#xA;For i = 1 To (2 * j - 1)&#xA;S(i, j) = S(1, 1) * u ^ j * d ^ i&#xA;Next i&#xA;Next j&#xA;&#xA;&#xA;For i = 1 To (2 * n + 1)&#xA;Select Case PutCall&#xA;Case &quot;Call&quot;&#xA;Op(i, n + 1) = Application.Max(S(i, n + 1) - K, 0)&#xA;Case &quot;Put&quot;&#xA;Op(i, n + 1) = Application.Max(K - S(i, n + 1), 0)&#xA;End Select&#xA;Next i&#xA;&#xA;For j = n To 1 Step -1&#xA;For i = 1 To (2 * j - 1)&#xA;Select Case EuroAmer&#xA;Case &quot;Amer&quot;:&#xA;If PutCall = &quot;Call&quot; Then&#xA;Op(i, j) = Application.Max(S(i, j) - K, Exp(-r * dt) * (pu * Op(i, j + 1) + pm * Op(i + 1, j + 1) + pd * Op(i + 2, j + 1)))&#xA;ElseIf PutCall = &quot;Put&quot; Then&#xA;Op(i, j) = Application.Max(K - S(i, j), Exp(-r * dt) * (pu * Op(i, j + 1) + pm * Op(i + 1, j + 1) + pd * Op(i + 2, j + 1)))&#xA;End If&#xA;Case &quot;Euro&quot;:&#xA;Op(i, j) = Exp(-r * dt) * (pu * Op(i, j + 1) + pm * Op(i + 1, j + 1) + pd * Op(i + 2, j + 1))&#xA;End Select&#xA;Next i&#xA;Next j&#xA;&#xA;End Function&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but when I come back to Excel and insert the parameters into the function and I press Enter, the following window appears&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Compiling error&#xA;Sub or Function not defined&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's wrong with this code?&#xA;I doubt the error is into the data I submit, because I've already implemented two different binomial trees with success with the same datas.&#xA;However, I repeat, I'm a beginner, so any help would be appreciated.&#xA;Maybe somewhere on the web in which I can copy-paste the code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT2&lt;/strong&gt; I changed the beginning of my code as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Function Trinomial(Spot As Double, K As Double, T As Double, r As Double, v As Double, n As Integer, PutCall As String, EuroAmer As String)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and then, before the line &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dt = T / n: u = Exp(v * Sqr(2 * dt)): d = 1 / u&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I added&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Dim S() As Double&#xA;ReDim S(i, j) As Double&#xA;&#xA;Dim Op() As Double&#xA;ReDim Op(n + 1, n + 1) As Double&#xA;&#xA;Dim dt As Double&#xA;Dim Pu As Double&#xA;Dim Pd As Double&#xA;Dim Pm As Double&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;without touching anything else.&#xA;In this way I have no more problem on the VBA side (in particular, the message &#xA;&quot;Compiling error Sub or Function not defined&quot; doesn't appear anymore); and this is good.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem now is on EXCEL side: when I use this function, something goes wrong; in the cell, instead of the number resulting from this function, it appears&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;#VALUE!&quot;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;but I have no idea at all, of what is going wrong.&lt;/p&gt;&#xA;" OwnerUserId="27143" LastEditorUserId="27143" LastEditDate="2017-03-27T14:15:07.820" LastActivityDate="2017-03-27T14:52:15.697" Title="Trinomial tree VBA code" Tags="&lt;binomial-tree&gt;" AnswerCount="2" CommentCount="13" ClosedDate="2017-03-27T14:58:43.960" ContentLicense="CC BY-SA 3.0" />
  <row Id="33224" PostTypeId="2" ParentId="33215" CreationDate="2017-03-24T19:52:17.080" Score="3" Body="&lt;p&gt;There is a recent a paper recently using a population test of all CRSP data from 1925-2013 as a test of whether a mean and a variance exist versus they do not exist.  It overwhelmingly excluded mean-variance finance as not possible.  It is also a population study so for mean-variance to be valid, there would have to be radically different behavior before and after the study period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason you do not see supporting papers to validate from is that they do not exist.  The origin of the Fama-French work was not to create a model, but to falsify the CAPM.  The population test paper is at &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2653151&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2653151&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It follows from work by Mandelbrot and Fama in the 1960s.  You can find Mandelbrot's seminal paper on the topic at &lt;em&gt;Mandelbrot B. The variation of certain speculative prices. Journal of Business, 1963,36(4): 394-419&lt;/em&gt;  There is a long literature after this paper that thinned out for two reasons. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, in the 1960s computers used punch cards.  If Mandelbrot's observations are correct, which the above study confirms overwhelmingly, then all mean-variance solutions including the Fama-French models are not possibly true models.  They are excluded by the laws of general summation in mathematics.  It isn't an issue of opinion, they violate known mathematical laws, if Mandelbrot's paper is valid.  Unfortunately, if you live in a world of punch card computing, then you cannot do anything with Mandelbrot's work and it was perceived that an assumption of normality would be close enough.  At that point in time, only a few mathematicians or statisticians would have been able to discuss it so the necessary conversations never happened.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, Mandelbrot and subsequent papers by Fama didn't allow anyone to create actual economics, all they really did was provide broad rules of the road for statisticians.  Whereas Markowitz's and Roy's papers allow you to do economics, Mandelbrot's papers did not.  It is only recently that there are papers on what to do as an economist if you live in Mandelbrot's world instead of Markowitz's world.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The source of the mathematical failure can be thought of in two forms.  The first is that returns on investment are the ratio of a future value divided by a present value minus one.  We can ignore the minus one because it translates the solution but has no distributional effect except to move the location.  Let us assume we are making a decision, this makes the buy and the sell future events WHEN you are deciding.  So a return is a ratio variable, which would be the ratio of the distribution of two future prices.  Under Markowitzian assumptions it has been shown in a paper that the distribution of returns must be $$\frac{1}{\pi}\frac{\sigma}{\sigma^2+(r-\mu)^2}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under realistic assumptions this is not true, but under Markowitzian assumptions this must be true.  It is also consistent with the laws of mathematics.  If you try to find the return for the above formula as $$E(r)=\int_{-\infty}^{\infty}\frac{1}{\pi}\frac{r\sigma}{\sigma^2+(r-\mu)^2}\mathrm{d}r$$ you will quickly observe that the integral diverges and so no expectation can exist.  You can plug it into Wolfram Alpha if you are unconvinced.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nonetheless, under realistic assumptions you can show that except for two special cases, all returns must be some transformation of the above formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second way to show this is to note that if $w_{t+1}=rw_t+\epsilon_{t+1}$ or its static equivalent, where $\epsilon$ is drawn from any distribution with zero mean and with a positive, finite variance, then the distribution of the uncertainty about $r$ will be the above formula.  As a consequence, it follows that no maximum likelihood solution exists and that the minimum variance unbiased estimator is the median slope and the scale parameter is the interquartile range.  This kills mean-variance finance as you would have median-interquartile range finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As noted in the literature, however, there is a Bayesian solution.  The above solution is from a paper in 1958 by John White, completing work by Mann and Wald and it has a Bayesian interpretation.  While it acts as a non-existence proof for null hypothesis methods, it actually defines the likelihood function in Bayesian regression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are mentally rejecting the above explanation, then ask yourself, why, sixty-five years later, the most obvious thing you would expect to see is not found in the literature.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can do a quick validation test yourself, it will take you twenty minutes of coding.  Grab your data set of prices, do not use pre-built returns because they often have normalizations you won't be able to control, and solve $p_{t+1}/p_t$ for every security that is not soon to merge out or declare bankruptcy.  They have very different mathematical properties.  Also do not use the log difference because the issues are more subtle and that will be discussed below.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The easiest solution since this is quick and dirty, is to exclude any trades that don't exactly fit.  For example, if you do one day returns, exclude Friday trades since they have three or four days until the next trade.  You can segregate them and run the same thing on them if it makes you feel better.  The result will be the same.  If you run 1 year returns, just drop all trades that do not happen exactly 365 days apart.  It will really drop your sample size, but you will still have tens of millions of trades.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Find the sample mean and the sample standard deviation.  Then plot a histogram of the data in about 3% bin widths about either 0% if you subtracted 1 or around 1 if you just divided.  Now overlay the implied normal distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It won't fit and the parameters won't make sense economically.  It still will not work if you adjust the implied distribution for the fact that negative prices are not allowed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Leaving the quick and dirty, if you used a Metropolis-Hastings algorithm for a truncated likelihood in lieu of the above untruncated likelihood, you would find it fits very well, though there is a bit of skew in the data.  The argument put forth is that it is due to the stochastic budget constraint.  Because anyone would accept 100 shares of any stock for free and because there is a zero probability people would pay infinity, there is a sigmoid survival function that describes the probability a trade will happen at all at each price level, which is what creates a return.  Because you did not model this, you see it as skew.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use log returns then you will have a mean and a variance, but no covariance.  The likelihood is the hyperbolic secant distribution.  It is a fat-tailed, finite-variance distribution with the unpleasant property that as you add assets you do not add covariance factors.  Instead, you have a group of assets that cannot be independent of each other, but cannot covary asymptotically though they can covary locally.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Everyone still uses mean-variance finance, but it is about to disappear because it is unsound.  This isn't an opinion, this is math combined with a population test as verification that it is unsound.  If you have a PhD statistician at your work, just show them this.  They will tell you it is correct or at least probably correct and want to see the underlying papers to verify it.  Tell them they can derive normality as the distribution of the limit book for stocks under Markowitz because there are many buyers and sellers and a market in equilibrium is not subject to the winner's curse.  The rational behavior in a double auction in equilibrium is to bid your expectation.  The distribution of the expectations will converge to normality for the limit book.  Prices will follow a normal shock and returns will follow as above.  Then they will agree that the above is obviously correct.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastEditorUserId="25459" LastEditDate="2017-03-24T20:33:19.417" LastActivityDate="2017-03-24T20:33:19.417" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="33226" PostTypeId="1" CreationDate="2017-03-24T20:40:49.730" Score="2" ViewCount="98" Body="&lt;p&gt;If a stock has zero vol and some positive drift $\alpha$ (in a BS-setting) and we delta hedge a long call option dynamically over a year with some positive implied volatility.... how would that work out for us? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would the answer depend on how often we hedge, i.e. every day, month, week?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In usual circumstances, when we delta hedge, we make money everytime we get significant $\Delta S$s, due to the call options $\Gamma$ (gamma). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However in the case of positive $\alpha$, zero $\sigma$, $\Delta S$ is going to be huge, but .... do we then make huge amounts of money off of $\Gamma$?&lt;/p&gt;&#xA;" OwnerUserId="27145" LastActivityDate="2017-03-24T22:45:56.897" Title="Delta-hedging non-volatile stock" Tags="&lt;delta-hedging&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33227" PostTypeId="2" ParentId="33226" CreationDate="2017-03-24T22:45:56.897" Score="1" Body="&lt;p&gt;If vol is zero, then the stock S is riskless. If it is riskless its drift should equal the risk free rate r. Therefore, if T is the expiry of your call option then at expiry value of stock should be S_T = S_0 exp(rT).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your strike K &amp;lt;= S0 exp(rT) then you know for sure your call will expire worthless and your delta hedge = 0 stocks. If K &gt; forward, then for sure you will get stock delivered at expiry. So your delta hedge is 1 stock short.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that your delta is binary depending on K. The gamma however is 0 because the delta never changes. (had gamma been different from 0, your vol would not be 0).&lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2017-03-24T22:45:56.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33228" PostTypeId="2" ParentId="33215" CreationDate="2017-03-25T01:19:56.327" Score="1" Body="&lt;p&gt;In &lt;/p&gt;&#xA;&#xA;&lt;p&gt;H. M. Markowitz: Mean Variance Analysis in Portfolio Choice and&#xA;            Capital Markets, Ch. 13, Basil Blackwell (1987)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you will find an example of a 10 securities Markowitz optimization problem with 10 securities, with the solution. I (and many others) have used this problem to test our code. The problem includes upper and lower bounds on the portfolio weights i.e $l_i \le w_i \le u_i$ (can your code handle upper/lower bounds?).&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2017-03-25T01:19:56.327" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33230" PostTypeId="1" AcceptedAnswerId="33231" CreationDate="2017-03-25T12:09:48.367" Score="2" ViewCount="98" Body="&lt;p&gt;The BS formula gives, as quoted from Wikepdia:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$${\displaystyle {\begin{aligned}C(S_{t},t)&amp;amp;=N(d_{1})S_{t}-N(d_{2})Ke^{-r(T-t)}\\d_{1}&amp;amp;={\frac {1}{\sigma {\sqrt {T-t}}}}\left[\ln \left({\frac {S_{t}}{K}}\right)+\left(r+{\frac {\sigma ^{2}}{2}}\right)(T-t)\right]\\d_{2}&amp;amp;=d_{1}-\sigma {\sqrt {T-t}}\\\end{aligned}}}$$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;in which all notations are standard (I don't think any notational ambiguity exists; otherwise please refer to &lt;a href=&quot;https://en.wikipedia.org/wiki/Black%E2%80%93Scholes_model#Black.E2.80.93Scholes_formula&quot; rel=&quot;nofollow noreferrer&quot;&gt;this article&lt;/a&gt; directly.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to show that when everything else is fixed, $C$ will go up with $r$. Or alternatively, that $\partial C/\partial r\ge 0$. But it turns out the sign of the partial derivative is not that obvious.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To convince myself somehow, I drew a couple of $C$-$r$ plots on my computer using various sets of parameters and found out the curve always went upwards as expected. But I still want a rigorous proof in the mathematical sense. So am I missing something here? Is there anybody who can help? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="19004" LastActivityDate="2017-03-25T16:34:08.340" Title="From BS formula how to show Euro-call values go up and Euro-put values go down with interest rates?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;interest-rates&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33231" PostTypeId="2" ParentId="33230" CreationDate="2017-03-25T13:07:59.040" Score="2" Body="&lt;p&gt;For a call, the rho is given by&#xA;\begin{align*}&#xA;\frac{\partial C_t}{\partial r} &amp;amp;= \frac{\sqrt{T-t}}{\sigma}\left(S_t\phi(d_1)&#xA;-Ke^{-r(T-t)}\phi(d_2)\right)+K\,(T-t)e^{-r(T-t)}N(d_2)\\&#xA;&amp;amp;=\frac{\sqrt{T-t}}{\sigma}\left(S_t\phi(d_1)&#xA;-Ke^{-r(T-t)}\phi(d_1-\sigma\sqrt{T-t})\right)+K\,(T-t)e^{-r(T-t)}N(d_2)\\&#xA;&amp;amp;=\frac{\sqrt{T-t}}{\sigma}\left(S_t\phi(d_1)&#xA;-Ke^{-r(T-t)}\phi(d_1)e^{d_1\sigma \sqrt{T-t}-\frac{\sigma^2}{2}(T-t)}\right)+K\,(T-t)e^{-r(T-t)}N(d_2)\\&#xA;&amp;amp;=K\,(T-t)e^{-r(T-t)}N(d_2).&#xA;\end{align*}&#xA;where &#xA;\begin{align*}&#xA;d_1 &amp;amp;= \frac{\ln \frac{S_t}{K}+\left(r+\frac{1}{2}\sigma^2\right)(T-t)}{\sigma\sqrt{T-t}}, \&#xA;d_2 = d_1-\sigma\sqrt{T-t}.&#xA;\end{align*}&#xA;Similarly, for a put, the  rho is given by&#xA;\begin{align*}&#xA;\frac{\partial P_t}{\partial r} =- K\,(T-t)e^{-r(T-t)}N(-d_2).&#xA;\end{align*}&#xA;It is now obvious that the call is an increasing function of the interest rate, while the put is a decreasing function. See &lt;a href=&quot;https://en.wikipedia.org/wiki/Black%E2%80%93Scholes_model&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Black%E2%80%93Scholes_model&lt;/a&gt; for a reference.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-03-25T16:34:08.340" LastActivityDate="2017-03-25T16:34:08.340" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="33232" PostTypeId="1" AcceptedAnswerId="33251" CreationDate="2017-03-25T15:27:12.990" Score="4" ViewCount="180" Body="&lt;p&gt;I am working on a commodity-exchange rate model as part of my thesis. My dependent variable is log of first difference of exchange rate of Colombia and my independent variable is log of first difference of crude petroleum price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have daily data for last 20 years for both the variable. I am interested in looking whether the relationship (i.e. the effect of crude petroleum prices on Colombia's exchange rate) between the two variables changes over time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So let say i want to check whether effect of crude petroleum prices on Colombia's exchange rate in the last 5 years ( 2012-2017) is different from that in 2007-2012.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was thinking of creating dummy variables for 5 years ( 1 if the data is from 2012-2017, 0 otherwise) and then creating an interaction variable of the dummy and crude petroleum prices. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure whether this is the right thing to do. also can i use any other model or test for the same. Any advice is appreciated. Please let me know if my question is unclear. I can try to modify it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="25497" LastActivityDate="2017-03-26T10:10:12.320" Title="How to check if relationship between two variable changes over time?" Tags="&lt;time-series&gt;&lt;fx&gt;&lt;commodities&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33234" PostTypeId="2" ParentId="24657" CreationDate="2017-03-25T16:37:59.613" Score="1" Body="&lt;p&gt;For anyone looking for an answer to a similar question as the OP:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;MS-VAR works only for &lt;em&gt;stationary&lt;/em&gt; time series (as far as I understand). You need to de-trend your time series: either by subracting the mean, subtracting the linear trend, the moving average, a smoothed curve, etc - whatever works best for your current problem or is backed by theory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The errors the code gives are very cryptic, but the basic idea is that the log-loss function (for ML estimation of the parameters) in your case was uninitialized because the model assumptions didn't hold.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following R code does you what you want, it seems. I have only recently started working with MS-VAR models, so take this with a grain of salt, however this is at least an actual answer... (Subtracting linear trend gives a much more understandable Regime variable than just subtracting the mean).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(&quot;MSBVAR&quot;)&#xA;a &amp;lt;- c(1.998513, 1.995302, 2.030693, 2.122130, 2.236770, 2.314639, 2.365214, 2.455784, 2.530696, 2.596537, 2.647573, 2.735317, 2.705269, 2.699783, 2.659748, 2.641353, 2.641825, 2.613648, 2.627755, 2.627383)&#xA;b &amp;lt;- c(0.6421369, 0.6341437, 0.6494933, 0.6760939, 0.7113511, 0.7173038, 0.7250545, 0.7812490, 0.7874657, 0.8275209, 0.9079720, 0.9455602, 0.9426856, 0.9234943, 0.9072791, 0.9194827, 0.9021116, 0.8971606, 0.9047334, 0.8965786)&#xA;&#xA;library(&quot;pracma&quot;)&#xA;xa = detrend(a) #a - mean(a) #detrend this&#xA;xb = detrend(b) #b - mean(b) #detrend this&#xA;&#xA;x &amp;lt;- matrix (NA,20,2)&#xA;x[,1] &amp;lt;- xa&#xA;x[,2] &amp;lt;- xb&#xA;ts_x &amp;lt;- ts(x)&#xA;&#xA;set.seed(1)&#xA;m_x &amp;lt;- msvar(ts_x, p = 2, h = 2, niterblkopt = 10)&#xA;fp &amp;lt;- ts(m_x$fp)&#xA;&#xA;plot(ts_x)&#xA;plot(fp)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="27156" LastActivityDate="2017-03-25T16:37:59.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33235" PostTypeId="1" AcceptedAnswerId="33292" CreationDate="2017-03-25T16:47:00.877" Score="2" ViewCount="1845" Body="&lt;p&gt;Is there a reason or some reference somewhere why the Fama/French Momentum Factors (WML) were discontinued at June 30, 2016, see e.g. here: &lt;br&gt;&lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/Data_Library/f-f_developed_daily_mom.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/Data_Library/f-f_developed_daily_mom.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2017-03-27T22:35:04.123" Title="Why were Fama/French Momentum Factors discontinued in 2016?" Tags="&lt;market-data&gt;&lt;historical-data&gt;&lt;factor-models&gt;&lt;fama-french&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="33236" PostTypeId="2" ParentId="33198" CreationDate="2017-03-25T16:53:10.940" Score="2" Body="&lt;p&gt;There was an error in my professors question he changed $$P = \begin{pmatrix}&#xA;2\\&#xA;5/9&#xA;\end{pmatrix}$$&#xA;Thus when we fix $q_2$ we get $$q = (5/9 - q_2,q_2,6/9 - q_2)$$ Thus for $q_2\in (0,5/9)$ all $q$'s are positive so there is no arbitrage. Then clearly $q_f = (6/9,11/9)$&lt;/p&gt;&#xA;" OwnerUserId="19002" LastActivityDate="2017-03-25T16:53:10.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33240" PostTypeId="1" AcceptedAnswerId="33243" CreationDate="2017-03-25T19:57:15.530" Score="0" ViewCount="5130" Body="&lt;p&gt;I've written code below that simulates GBM paths for determining the price of a given European call option and put option. The stock is priced at 150 USD, strike price at 155 USD, risk-free rate was assumed to be 0.02, expected return was equal to 0.05, volatility at 0.1 and it's one year to maturity.&lt;br&gt;&#xA;&lt;br&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;function [call, put] = monte_carlo_price(S_init, K, T, r, mu, sigma, n)&lt;br&gt;&#xA;% Computes European call and put options using Monte Carlo simulations&lt;br&gt;&#xA;% 'S_init' is the current underlying stock price&lt;br&gt;&#xA;% 'K' is the strike price&lt;br&gt;&#xA;% 'T' is years to maturity&lt;br&gt;&#xA;% 'r' is the risk-free rate&lt;br&gt;&#xA;% 'mu' is the expected return&lt;br&gt;&#xA;% 'sigma' is the volatility&lt;br&gt;&#xA;%----------------------------------------------------------------------&lt;br&gt;&lt;br&gt;&#xA;Paths = n;&lt;br&gt;&#xA;Steps = T*365;&lt;br&gt;&#xA;MC_scenes = zeros(Steps+1, Paths);&lt;br&gt;&#xA;dT = T/Steps;&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;% First asset price is the initial price&lt;br&gt;&#xA;MC_scenes(1,:) = S_init;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;% Generate paths&lt;br&gt;&#xA;for iPath = 1:Paths&lt;br&gt;&#xA;    for iStep = 1:Steps&lt;br&gt;&#xA;        MC_scenes(iStep+1, iPath) = MC_scenes(iStep, iPath) * exp((mu - 0.5*sigma^2)*dT + sigma * sqrt(dT)*normrnd(0,1));&lt;br&gt;&#xA;    end&lt;br&gt;&#xA;end &lt;/p&gt;&#xA;&#xA;&lt;p&gt;% Calculate put and call option payoffs&lt;br&gt;&#xA;putPayoff = max(K-MC_scenes(end,:),0);&lt;br&gt;&#xA;callPayoff = max(MC_scenes(end,:)-K,0);&lt;/p&gt;&#xA;&#xA;&lt;p&gt;% Discount prices back to present day&lt;br&gt;&#xA;put = mean(putPayoff)* exp(-r*T) ;&lt;br&gt;&#xA;call = mean(callPayoff) * exp(-r*T);&lt;/p&gt;&#xA;&#xA;&lt;p&gt;end&lt;br&gt;&lt;br&gt;&lt;br&gt;&#xA;My problem is that I'm trying to come up with an efficient way to get my simulation results to within 10 cents of the Black-Scholes output (5.10 USD for the call and 7.04 USD for the put). I tried increasing my 'Paths' (number of scenarios) through iterating and I got what I needed, but it took way too long to run. Is there way I can optimize setting the 'Paths' and even 'Steps' get to within the Black-Scholes outputs??&lt;br&gt;Thanks.   &lt;/p&gt;&#xA;" OwnerUserId="26421" LastEditorUserId="26421" LastEditDate="2017-03-25T22:51:25.953" LastActivityDate="2017-03-25T23:31:11.963" Title="Monte Carlo European Option Pricing" Tags="&lt;black-scholes&gt;&lt;programming&gt;&lt;monte-carlo&gt;&lt;european-options&gt;&lt;homework&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33241" PostTypeId="2" ParentId="33200" CreationDate="2017-03-25T20:34:23.233" Score="2" Body="&lt;p&gt;This trade is called a 5s-30s Treasury curve steepener, duration neutral.  It is positive carry i.e. if 5yr Treasury yields and 30yr Treasury yields remain the same, it makes money.  However, there are scenarios where it loses money.  For example, the Fed hikes, causing 5yr yields to rise substantially, but 30yr yields dont rise as much.  Some investors are currently doing this trade (hedge funds, money managers).  It has had mixed success recently.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-03-25T20:34:23.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33242" PostTypeId="1" CreationDate="2017-03-25T21:15:15.373" Score="0" ViewCount="51" Body="&lt;p&gt;I am interested to ask about how to interpret option open interest. For small cap stock options, it makes sense to see open interest as liquidity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, for big name stock options where liquidity is not really a concern, open interest seem better to be interpreted as a measure of attention. wonder how these option signals would do if controlled open interest&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="25885" LastActivityDate="2017-03-25T21:15:15.373" Title="to interpret open interest" Tags="&lt;options&gt;&lt;open-interest&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33243" PostTypeId="2" ParentId="33240" CreationDate="2017-03-25T21:52:47.900" Score="1" Body="&lt;p&gt;A few suggestions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;As your underlying follows a geometric Brownian motion and you are solely interested in pricing European options, there is no need to simulate intermediate steps. Since your solution is exact, you can directly sample $S_T$ as&#xA;\begin{equation}&#xA;    S_T = S_0 \exp \left\{ \left( r - \frac{1}{2} \sigma^2 \right) T + \sigma \sqrt{T} Z \right\},&#xA;\end{equation}&#xA;where $Z \sim \mathcal{N}(0, 1)$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Try replacing the remaining &lt;code&gt;for&lt;/code&gt;-loop with matrix operations. Vectorized code tends to be significantly faster in MATLAB.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Regarding stopping criterion. In general you don't know the closed-form solution for the option that you are pricing via the Monte Carlo simulation. Otherwise you wouldn't do it in the first place, except for as an exercise. So using the distance to the true analytical solution as a stopping criterion is off the table. Instead, I suggest to compute the Monte Carlo standard error&#xA;\begin{equation}&#xA;s_n = \sqrt{\frac{1}{n - 1} \sum_{i = 1}^n \left( X_i - \bar{X}_n \right)^2},&#xA;\end{equation}&#xA;where $\left\{ X_i \right\}_{i = 1}^n$ are the sequence of sample prices for your $n$ paths. You can then construct a confidence interval for your Monte Carlo estimate for some probability and stop your simulation once it is sufficiently small.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To see why your distance-based stopping criterion is problematic, consider a very small number of sample paths that happen to be such that the corresponding average discounted payoff is very close to the analytical price. This is by pure chance and the standard error of your estimate will be very large.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Note that you should be simulation the asset under the risk-neutral probability measure. Here, the drift of the asset is $r$ and not $\mu$ as in your code. The latter is irrelevant.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In order to further improve the convergence, you could use antithetics. I.e. for a sample of $S_T$ generated using the random normal variate $Z$, you generate a second sample of $S_T$ using $-Z$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-03-25T23:31:11.963" LastActivityDate="2017-03-25T23:31:11.963" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="33244" PostTypeId="1" AcceptedAnswerId="33245" CreationDate="2017-03-26T01:13:23.983" Score="0" ViewCount="163" Body="&lt;p&gt;One of the reason the Black-Scholes can be transformed into the heat equation is that calls and puts have a zero boundary condition on their contingent payoffs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Define the terminal payoff condition of a call, $C_T$, and put, $P_T$, as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C_T = max(0, S_T-K)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P_T = max(0, K-S_T)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what if the contingent pay-off is not bounded at zero. For example, what if the lower boundary condition is defined arbitrarily as $-K$? The expected value for such a condition would be given as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E[V_t] = E[Max(-K,S_T - K)] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to use some variation of the (heat) diffusion equation for non-zero boundary conditions? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The intended use case is for valuing corporate liabilities whose cash flows don't have the same sort of conveniently defined boundary conditions as traditional financial options. The economic intuition behind this is to model a rational firm which may continue to operate at a loss until it exercises the option to discontinue operations in order to not lose more money than its overhead, represented here as $K$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, I can brute force the expected value by using convolution methods and fast Fourier Transforms, but those methods are computationally expensive. Transformation into a closed form solution would be much more efficient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2017-03-26T02:08:51.983" LastActivityDate="2017-03-26T11:43:47.453" Title="Possible to use diffusion equation(s) to price derivatives with non-zero boundary conditions?" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;valuation&gt;&lt;dcf&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33245" PostTypeId="2" ParentId="33244" CreationDate="2017-03-26T01:32:28.703" Score="2" Body="&lt;p&gt;Assuming you mean $P_t=S_T$, that you are pricing under the risk neutral measure $\mathbb{Q}$ and introducing a discount factor $e^{-\int_0^T{r(t)dt}}$, your equation can be rewritten $-$ where $\{\mathcal{F}_n\}_{n\geq0}$ is an appropriate filtration:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;\mathbb{E}^{\mathbb{Q}}\left[V_T|\mathcal{F}_0\right]=\mathbb{E}_0^{\mathbb{Q}}\left[V_T\right]&amp;amp;=\mathbb{E}_0^{\mathbb{Q}}\left[e^{-\int_0^T{r(t)dt}}\max(-K,S_T-K)\right]&#xA;\\[12pt]&#xA;&amp;amp;=\mathbb{E}_0^{\mathbb{Q}}\left[e^{-\int_0^T{r(t)dt}}\left(\max(0,S_T)-K\right)\right]&#xA;\\[12pt]&#xA;&amp;amp;=\mathbb{E}_0^{\mathbb{Q}}\left[e^{-\int_0^T{r(t)dt}}\max(0,S_T)\right]-KP(0,T)&#xA;\\[12pt]&#xA;&amp;amp;=\mathbb{E}_0^{\mathbb{Q}}\left[e^{-\int_0^T{r(t)dt}}S_T\right]-KP(0,T)&#xA;\\[12pt]&#xA;&amp;amp;=S_0-KP(0,T)&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $P(0,T)$ is the price of a zero-coupon bond of maturity $T$ $-$ by definition equal to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ P(0,T) = \mathbb{E}_0^{\mathbb{Q}}\left[e^{-\int_0^T{r(t)dt}}\right] $$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If now you have two distinct values $K_1 \not= K_2$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbb{E}_0^{\mathbb{Q}}\left[V_T\right]=\mathbb{E}_0^{\mathbb{Q}}\left[e^{-\int_0^T{r(t)dt}}\max(-K_1,S_T-K_2)\right] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using equivalent arguments as above, the value can be rewritten:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbb{E}_0^{\mathbb{Q}}\left[V_T\right]=\mathbb{E}_0^{\mathbb{Q}}\left[e^{-\int_0^T{r(t)dt}}\max(0,S_T-(K_2-K_1))\right]-K_1P(0,T) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This 2nd risk neutral expectation is simply the price of a European call option of strike $K_2-K_1$ so you can use standard formulas to price it.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;If you now introduce time-dependency to your &quot;strike&quot; $K$ $-$ as one of your comments below does $-$, we get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;\mathbb{E}_0^{\mathbb{Q}}\left[V_T\right]&amp;amp;=\mathbb{E}_0^{\mathbb{Q}}\left[e^{-\int_0^T{r(t)dt}}\max(-K_T,S_T-K_T)\right]&#xA;\\[12pt]&#xA;&amp;amp;=\mathbb{E}_0^{\mathbb{Q}}\left[e^{-\int_0^T{r(t)dt}}\max(0,S_T)\right]-\mathbb{E}_0^{\mathbb{Q}}\left[e^{-\int_0^T{r(t)dt}}K_T\right]&#xA;\\[12pt]&#xA;&amp;amp;=S_0-\mathbb{E}_0^{\mathbb{Q}}\left[e^{-\int_0^T{r(t)dt}}K_T\right]&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here the price and the complexity of the calculations will depend on the dynamics of $K_t$, but in a Black-Scholes world, assuming a geometric Brownian motion diffusion process for $K_t$ and that this asset is tradeable, we simply get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbb{E}_0^{\mathbb{Q}}\left[V_T\right]=S_0-K_0 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because the discounted price of any tradeable asset under the risk neutral measure is a martingale. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The takeaway is that the complexity of the solution and the numerical techniques needed if no closed-form exists depend on the setting you specify $-$ &lt;em&gt;i.e.&lt;/em&gt; diffusion equation followed by your asset, specification of the interest-rate process, etc. In a Black-Scholes framework, the price of the derivatives above are readily derived.&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-03-26T11:43:47.453" LastActivityDate="2017-03-26T11:43:47.453" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="33246" PostTypeId="1" AcceptedAnswerId="33270" CreationDate="2017-03-26T02:34:05.723" Score="1" ViewCount="222" Body="&lt;p&gt;I came across the following statement regarding the realized 10-year maturity bond's return over a year: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The realized bond return (H) over a year has two components: the yield income earned over time and the capital gain or loss due to yield changes:&#xA;  $$H_{10} \approx Y_{10}-\text{Duration}_{10} \times \Delta Y_{10}.$$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I am a complete economics rookie and I'm trying to understand what's going on here from the mathematical point of view, which I'm gonna present here, but my calculations don't seem to add up. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we denote the bond's coupon with $C$, and the bond's time $t=0$ yield to maturity with $y_0$, then the bond's value at time $t=0$ equals:&#xA;$$V_0=\frac{C}{1+y_0}+\frac{C}{(1+y_0)^2}+\dots+\frac{C}{(1+y_0)^9}+\frac{F+C}{(1+y_0)^{10}}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At time $t=1$, we can express the bond's value as the function of the time $t=1$ yield to maturity $y$, so we have&#xA;$$V_1(y)=\frac{C}{1+y}+\frac{C}{(1+y)^2}+\dots+\frac{C}{(1+y)^8}+\frac{F+C}{(1+y)^{9}}.$$&#xA;Derivative of $V_1$ with respect to $y$ is equal to:&#xA;$$\frac{dV_1}{dy}=-1\cdot\frac{C}{(1+y)^2}-2\cdot\frac{C}{(1+y)^3}-\dots-8 \cdot \frac{C}{(1+y)^9}-9 \cdot\frac{F+C}{(1+y)^{10}} .$$&#xA;Now, we can apply some basic calculus here and state that for $\Delta y$ small &quot;enough&quot;, we have that&#xA;$$ V_1(y_0+\Delta y)\approx V_1(y_0)+\frac{d V_1}{dy}(y_0)\cdot \Delta y. $$&#xA;So now, if we consider the absolute return on our position (buying this bond at time $t=0$, selling it at $t=1$) from the time $t=0$ perspective, under the assumption that the time $t=1$ bond's yield to maturity is $y_1=y_0+\Delta y$, we have that:&#xA;$$\text{AbsReturn} \approx-V_0+\frac{C}{1+y_0}+\frac{V_1(y_0)+\frac{d V_1}{dy}(y_0)\cdot \Delta y}{1+y_0}.$$&#xA;That is - we buy the bond for $V_0$, at the end of the first year we are paid the coupon which discounted value is $\frac{C}{1+y_0}$, and the approximation of the time $t=1$ bond's value taking into the account the YTM change is $V_1(y_0)+\frac{d V_1}{dy}(y_0)\cdot \Delta y$ and we also discount it to time $t=0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, we can simplify the expression for AbsReturn since $-V_0+\frac{C}{1+y_0}+\frac{V_1(y_0)}{1+y_0}=0$ and we get:&#xA;$$ \text{AbsReturn}= \frac{\frac{d V_1}{dy}(y_0)\cdot \Delta y}{1+y_0} ,$$&#xA;which I guess we can also divide with our initial investment of $V_0$ to get the rate of return so we get:&#xA;$$ \text{RateOfReturn}= \frac{\frac{d V_1}{dy}(y_0)\cdot \Delta y}{V_0(1+y_0)} ,$$&#xA;aaand this is where I completely lose it. I can't seem to understand the connection between the original expression and the thing I end up with. What does the term $\text{Duration}_{10}$ in the original formula even stand for - I guess it is the derivation of bond's value with respect to yield - but bond's value at what time: $t=0$ or $t=1$? Does it even make any difference? If it is at time $t=0$, how can we be using linear approximation of that function for approximating bond's value change at time $t=1$? I'm completely puzzled over this. Am I doing something completely wrong in this derivation? I appreciate any insights on this. Thanks!&lt;/p&gt;&#xA;" OwnerUserId="23864" LastEditorUserId="23864" LastEditDate="2017-03-26T17:28:42.973" LastActivityDate="2017-03-27T13:27:29.427" Title="Making mathematical sense of the expression for realized bond return" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;bond-yields&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33247" PostTypeId="2" ParentId="3319" CreationDate="2017-03-26T06:28:16.157" Score="0" Body="&lt;p&gt;For an Option Free bond &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Option Adjusted Spread = Z spread &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a bond with embedded Call options &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Option Adjusted Spread + Option Spread = Z spread ( For Callable Bonds) ... Why Option Spread is Positive ? Ans - This is because Investors are to be compensated for additional risk of having callable bonds in their portfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Bonds with Embedded Put Options &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Option Adjusted Spread - Option Spread = Z spread Why option spread is Negative ? - This is because the issuer is to be compensated for the risk of issuing bonds with put option. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in exam &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Z spread &gt; OAS   - The bond has an embedded Call option&#xA;Z spread &amp;lt; OAS   - The bond has an embedded Put option&#xA;Z Spread = OAS  - The bond has no embedded options, it is a straight bond&lt;/p&gt;&#xA;" OwnerUserId="27161" LastActivityDate="2017-03-26T06:28:16.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33248" PostTypeId="2" ParentId="33246" CreationDate="2017-03-26T08:20:07.607" Score="0" Body="&lt;p&gt;I don't agree with your expression for AbsReturn.   It contains two terms which have been divided by (1+y0).  Why have these been discounted?  The AbsReturn is just value(t=1) - value(t=0) with no discounting.  I believe that correction explains your dilemma.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-03-26T08:20:07.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33249" PostTypeId="1" CreationDate="2017-03-26T09:50:12.680" Score="1" ViewCount="83" Body="&lt;p&gt;I am looking at NYSE sample TAQ Quote data for Apple stock (link at the bottom of the post) and I have noticed large discontinuities in the data intervals. For example, these two are two succesive quotes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[Time (nanoseconds precision) | Exchange symbol | Stock | ... | Sequence Number | ...]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;094208987952143|J|AAPL|...|1131087|... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;094209180767665|K|AAPL|...|1131237|...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The time difference is in the order of hundreds of milliseconds and the sequence numbers are far apart. However, for a lot of quotes, the difference in time between succesive quotes is in the order of dozens of microseconds and the sequence numbers are successive numbers. For example, it can look like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;094209274082928|Y|AAPL|...|1131276|...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;094209274087908|Q|AAPL|...|1131277|...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Is there any reason behind this data irregularity?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source: NYSE TAQ sample data available here &lt;a href=&quot;ftp://ftp.nyxdata.com/Historical%20Data%20Samples/Daily%20TAQ%20Sample/&quot; rel=&quot;nofollow noreferrer&quot;&gt;ftp://ftp.nyxdata.com/Historical%20Data%20Samples/Daily%20TAQ%20Sample/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="27163" LastActivityDate="2017-03-26T09:50:12.680" Title="Missing sequence numbers in TAQ Quote data" Tags="&lt;market-data&gt;&lt;historical-data&gt;&lt;high-frequency&gt;&lt;tick-data&gt;&lt;nyse&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33250" PostTypeId="2" ParentId="32900" CreationDate="2017-03-26T09:54:25.223" Score="2" Body="&lt;p&gt;Your intuition is correct and the paper seems to misunderstand the exposure of a swap based on CMS.  The term &quot;Constant Maturity Swap&quot; or CMS, refers to the name of an index (the prevailing swap rate at the time of observation).  A swap based on the CMS can be versus either a fixed rate or Libor.  In the context of this question, consider a USD100mm 5yr swap consisting of a fixed rate versus 5 year CMS.  Each quarter, the company will pay fixed and receive 5 yr CMS.  For a given swaplet (say the one with the next upcoming reset date), indeed the exposure is approximately the same as a 5 year swap with a notional equal to 0.25/5 *USD100mm.  However the swap also has future reset dates.  Looking at the reset date in 5 years' time, this is economically equivalent to a forward swap, in 5 years for 5 years, on the same adjusted notional.  But this forward swap is equivalent to being short 10 year duration versus long 5 year duration, which does not necessarily behave like a simple 5 year liability at all.  Representing the exposure of a swap on 5yr CMS as wholly in the 5 year bucket is wrong.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-03-26T09:54:25.223" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33251" PostTypeId="2" ParentId="33232" CreationDate="2017-03-26T10:10:12.320" Score="2" Body="&lt;p&gt;One way is to check their (linear) dependency with Pearson's correlation coefficient. If you rather want to check for sign dependency, you can use Spearman's correlation coefficient.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could for example take the yearly data, calculate the correlation coefficient between the two data sets for every year and then check, whether the coefficient changed substantially.&lt;br&gt;&#xA;Before comparing the values, I would firstly test for their significance, though, to test whether there is any dependency to speak of.&lt;/p&gt;&#xA;" OwnerUserId="26503" LastActivityDate="2017-03-26T10:10:12.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33252" PostTypeId="1" CreationDate="2017-03-26T13:30:37.147" Score="2" ViewCount="266" Body="&lt;p&gt;I am bit confused by Carr and Madan's paper. In it the authors write that the Fourier transform $ c_T(k)$ is defined by &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align} &#xA;\psi_T(v) = \int_{ - \infty}^{\infty} e^{ivk} c_T(k)dk &#xA;\end{align} &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet traditionally it is know that the Fourier Transform formula is &#xA;\begin{align} &#xA;X( \omega) = \int_{- \infty}^{\infty} x(t) e^{ - i \omega t} dt &#xA;\end{align} &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The negative being the difference between the two.  &lt;/p&gt;&#xA;" OwnerUserId="8036" LastEditorUserId="24222" LastEditDate="2017-03-26T13:55:33.200" LastActivityDate="2017-03-26T13:55:33.200" Title="Carr and Madan Fourier Transform" Tags="&lt;option-pricing&gt;&lt;risk-neutral-measure&gt;&lt;characteristic-function&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33253" PostTypeId="2" ParentId="33252" CreationDate="2017-03-26T13:51:59.517" Score="1" Body="&lt;p&gt;Different fields use different conventions to define the Fourier transform. The one in Carr and Madan is often referred to as the &quot;probabilist's Fourier transform&quot;. It coincides with the definition of the characteristic function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://www.johndcook.com/blog/fourier-theorems/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.johndcook.com/blog/fourier-theorems/&lt;/a&gt; for a nice overview and the link between the different definitions.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2017-03-26T13:51:59.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33255" PostTypeId="1" CreationDate="2017-03-26T14:43:56.403" Score="2" ViewCount="194" Body="&lt;p&gt;If $dS = S\mu dt + S \sigma(t) dW$, then we know that the implied volatility is $\int_0^T \sigma^2(s)/T \ ds$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if $\sigma(t)$ is a piecewise constant function, i.e. constant between $T_1, T_2$ and between $T_2, T_3$, and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, according to some lecture notes, the implied vols are &#xA;&lt;a href=&quot;https://i.stack.imgur.com/2c7Nh.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/2c7Nh.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That, I don't quite understand. Where does this formula come from? If $T$ is the expiry, then how can there be a $T_{i+1} &amp;gt; T$? I thought the expiry was the final such $T$ value?&lt;/p&gt;&#xA;" OwnerUserId="27166" LastActivityDate="2017-03-26T15:25:28.480" Title="Explanation of formula for implied volatility given $\sigma(t)$" Tags="&lt;volatility&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33256" PostTypeId="2" ParentId="33255" CreationDate="2017-03-26T15:25:28.480" Score="2" Body="&lt;p&gt;Note that the implied volatility is given by &#xA;\begin{align*}&#xA;\hat{\sigma}(T)=\sqrt{\frac{1}{T}\int_0^T \sigma^2(t) dt},&#xA;\end{align*} &#xA;while $\frac{1}{T}\int_0^T \sigma^2(t) dt= \hat{\sigma}^2(T)$ is the implied variance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a piecewise constant volatility function $\sigma$, the implied variance for option with maturity $T$, where $T_i \le T \le T_{i+1}$, is given by&#xA;\begin{align*}&#xA;\hat{\sigma}^2(T)&amp;amp;=\frac{1}{T}\int_0^T \sigma^2(t) dt \\&#xA;&amp;amp;= \frac{1}{T}\left(\int_0^{T_i}\sigma^2(t) dt + \int_{T_i}^T\sigma^2(t) dt \right)\\&#xA;&amp;amp;=\frac{1}{T}\left(T_i\, \hat{\sigma}^2(T_i) + (T-T_i)\, \sigma_{i+1}^2\right),&#xA;\end{align*}&#xA;where&#xA;\begin{align*}&#xA;\hat{\sigma}^2(T_i) = \frac{1}{T_i}\int_0^{T_i}\sigma^2(t) dt&#xA;\end{align*}&#xA;is the implied variance for option with maturity $T_i$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2017-03-26T15:25:28.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33257" PostTypeId="1" AcceptedAnswerId="33258" CreationDate="2017-03-26T17:57:42.400" Score="1" ViewCount="64" Body="&lt;p&gt;Where can I find expiration dates of WTI options like this: &lt;a href=&quot;http://www.cmegroup.com/trading/energy/crude-oil/light-sweet-crude_product_calendar_options.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.cmegroup.com/trading/energy/crude-oil/light-sweet-crude_product_calendar_options.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I need dates in 2012-2016 years. &#xA;Thank you for your attention!&lt;/p&gt;&#xA;" OwnerUserId="27169" LastActivityDate="2017-03-26T18:16:07.360" Title="Expirations of WTI options" Tags="&lt;market-data&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33258" PostTypeId="2" ParentId="33257" CreationDate="2017-03-26T18:05:44.160" Score="2" Body="&lt;p&gt;You can calculate the past expiry dates yourself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the &lt;a href=&quot;http://www.cmegroup.com/trading/energy/crude-oil/light-sweet-crude_contract_specifications.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;future contract specs&lt;/a&gt; you can see that the last trading day of the futures contracts is always three business days before the 25th calendar day of the month preceding the delivery month. If the 25th is not a business day itself, then the trading ceases three business days before the last business preceding the 25th.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the &lt;a href=&quot;http://www.cmegroup.com/trading/energy/crude-oil/light-sweet-crude_contractSpecs_options.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;option contract specs&lt;/a&gt; you can see that the last trading day of the options is three business days before that of the underlying futures contract.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-03-26T18:16:07.360" LastActivityDate="2017-03-26T18:16:07.360" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33259" PostTypeId="1" CreationDate="2017-03-26T18:07:26.520" Score="3" ViewCount="639" Body="&lt;p&gt;Assume it to be known that the volatility of a stock at any point in time is $\sigma(t)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, if we have a number of options priced using some implied volatilities $\sigma_1, ..., \sigma_i$ on the same underlying, different maturities, how do we determine whether this is an exploitable situation, e.g. using gamma trading? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I compare my knowledge of $\sigma(t)$ to the multiple $\sigma_i$s and determine what to do?&lt;/p&gt;&#xA;" OwnerUserId="27170" LastActivityDate="2017-03-26T18:07:26.520" Title="When is implied volatility greater than realized volatility?" Tags="&lt;volatility&gt;&lt;arbitrage&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33260" PostTypeId="1" CreationDate="2017-03-26T19:48:02.053" Score="1" ViewCount="144" Body="&lt;p&gt;When could we expect consistent profitability of a call options buying strategy given specific statistical assumptions about X% chance of a stock price moving up by Y% within 1-5 days (or Z number of days).&#xA;And what call options buying trading strategy parameters would be recommended to utilize to achieve such expected profitability?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example an average casino would have 50.5% - 55.9% odds on Blackjack and be consistently profitable. Not sure if similar expectations can be applied to stock trading (winning average x% y% of the time vs losing average z%) because of large swings in loss percentages unless using stop-loss which then limits the number of times we may win. However, as options can be used to limit losses, I’m assuming there may be a specific way to calculate expected break even point and profitability when trading stock options based on statistically predicting specific stock price increase.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Examples:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Can I expect profitably when buying call options given statistical&#xA;50% chance of stock A moving up by 6% vs 50% chance of moving down by&#xA;3% within 2 days.&lt;/li&gt;&#xA;&lt;li&gt;Can I expect profitably when buying call options given statistical 60% chance of stock A moving up by 3% vs 40% chance of moving down by&#xA;3% within 5 days.&lt;/li&gt;&#xA;&lt;li&gt;Can I expect profitably when buying call options given statistical 60% chance of stock A moving up by 3% vs 40% chance of moving down by&#xA;5% within 5 days.&lt;/li&gt;&#xA;&lt;li&gt;Can I expect profitably when buying call options given statistical 75% chance of stock A moving up by 3% vs 25% chance of moving down by&#xA;10% within 5 days.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;As an example of specific stock we can use FB, currently priced at $140.34, with the following options chain:&#xA;&lt;a href=&quot;https://finance.yahoo.com/quote/FB/options?p=FB&amp;amp;date=1490918400&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://finance.yahoo.com/quote/FB/options?p=FB&amp;amp;date=1490918400&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/rDSNC.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/rDSNC.jpg&quot; alt=&quot;Facebook options chain&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, because of short-term expectations, I’d like to consider multiple options strike selection approaches:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a) In-the-money, with intent to sell purchased calls within several&#xA;days&lt;/li&gt;&#xA;&lt;li&gt;b) In-the-money, with intent to exercise them&lt;/li&gt;&#xA;&lt;li&gt;c) Near-the-money&lt;/li&gt;&#xA;&lt;li&gt;d) Far out-of-the-money, with intent to sell them within several&#xA;days, for example expecting a \$0.10 option to raise in price above $0.20 (100%) when stock price approaches in-the-money level.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;NOTE:&#xA;I'm looking for layman-level answers in a way similar to casinos explaining their odds.  I was thinking about posting this question in &lt;a href=&quot;http://money.stackexchange.com&quot;&gt;http://money.stackexchange.com&lt;/a&gt;, but as an answer may require some math and degree of quantitative experience, I decided to post it here with hope that I can still get an answer in the form of basic math vs advanced quant formulas, especially as the answer could be helpful to anyone starting trading options.&lt;/p&gt;&#xA;" OwnerUserId="27148" LastActivityDate="2017-03-26T19:48:02.053" Title="When to expect profitability of a call options buying strategy" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;option-strategies&gt;" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="33261" PostTypeId="1" CreationDate="2017-03-26T19:59:25.023" Score="2" ViewCount="275" Body="&lt;p&gt;Payout of a variance swap at maturity $T$ is proportional to $\left(\frac{252}{N} \sum_{i=0}^{N-1} R_i^2 \right) - \sigma_{\textrm{VS}}^2$ where $R_i \equiv \ln\left( \frac{S_{T_{i+1}}}{S_{T_i}} \right)$ and where strike $\sigma_{\textrm{VS}}^2$ is set such that the payout discounted at inception is equal to $0$. Fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the variance swap denomination come from the fact that, the normalizing factor $252$ apart, $\sum_{i=0}^{N-1} R_i^2$ is the realized &lt;em&gt;variance&lt;/em&gt; of the logarithmic returns (in sampling terms). By definition, I would have rather expected to see a $\frac{1}{N} \sum_{i=0}^{N-1} R_i^2 - \left( \frac{1}{N} \sum_{i=0}^{N-1} R_i \right)^2$, and not seeing the $\left( \frac{1}{N} \sum_{i=0}^{N-1} R_i \right)^2$ bit shows that $\frac{1}{N} \sum_{i=0}^{N-1} R_i$ must have been assumed (for all underlying VSs are written on : liquid stocks, indexes, FX rates etc) equal to $0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why are logarithmic returns supposed to have zero-expectation, &lt;em&gt;i.e.&lt;/em&gt; are centered ? Is it really true ? On which time scales is this true if it is ? (Here the VS was daily, but under which other scales do logarithmic returns have zero expectation ?)&lt;/p&gt;&#xA;" OwnerUserId="13470" LastEditorUserId="13470" LastEditDate="2017-04-07T14:52:38.143" LastActivityDate="2017-04-07T14:52:38.143" Title="Variance swap : ok for variance, but where's the square expectation?" Tags="&lt;swaps&gt;&lt;variance&gt;" AnswerCount="2" CommentCount="7" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33262" PostTypeId="1" CreationDate="2017-03-26T20:09:50.533" Score="1" ViewCount="176" Body="&lt;p&gt;I understand that single name liquid CDSs are (roughly speaking) quoted through either upfront+coupon, spread or price, and that for the pricing, the ISDA standard model is used : among other hypotheses the default intensity $\lambda$ is supposed constant.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How are quoted cds indexes ? Are only tranches of cds indexes quoted ?&lt;/li&gt;&#xA;&lt;li&gt;I saw a (maturity, tranche) quotation, what does it mean ? That's, which market model is used ? I heard the same standard model than the one for single names is used : what does that mean ?&lt;/li&gt;&#xA;&lt;li&gt;As far as I understand no correlation is involved for cds indexes, does the &quot;cds index ISDA standard model&quot; assume that all default time are independant with the same constant default intensity ?&lt;/li&gt;&#xA;&lt;li&gt;As far as I understand, for CDOs (standard or bespoke), the correlation comes into play : how are they quoted, and through which market model ?&lt;/li&gt;&#xA;&lt;li&gt;options on cds index tranches : od they exist ? how are they quoted ? which market model is used ?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="13470" LastEditorUserId="13470" LastEditDate="2018-04-05T15:29:14.397" LastActivityDate="2018-04-05T15:29:14.397" Title="Credit quotations with which ISDA models?" Tags="&lt;cds&gt;&lt;credit&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33263" PostTypeId="1" CreationDate="2017-03-26T21:50:26.110" Score="7" ViewCount="731" Body="&lt;p&gt;I am trying to calibrate a local volatility model to observed implied volatility smiles (not surfaces!, just a smile given for fixed maturity).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ran into the following approximation, and thought I could plug in my implied volatility formula, and solve for local volatility;&#xA;$$\sigma_{i}^2(K,T) = \frac{\sigma^2(S(0), 0) + \sigma^2(K,T)}{2}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma_i$ is implied volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question however is, where does this approximation come from?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know Dupire's formula, you know the one that is a fraction of two integrals. I can't quite find it, but is it from that the approx is derived? If so, how?&lt;/p&gt;&#xA;" OwnerUserId="27170" LastActivityDate="2019-01-23T15:11:49.423" Title="Proof of approximation formulas for implied volatilities" Tags="&lt;volatility&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="33264" PostTypeId="2" ParentId="33261" CreationDate="2017-03-27T01:00:53.370" Score="2" Body="&lt;p&gt;By market convention, the &quot;variance&quot; in Variance Swaps is computed by the above formula which assumes that the average return is zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two reasons (at least) why this convention is used:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) The expected return for the S&amp;amp;P 500, from historical data, is about 10% per year or a little less, which amounts to about 4 basis points per day. This is small compared to the standard deviation of daily returns which is on the order of 1% per day. So failing to subtract the average return squared introduces a fairly small error in the calculation of variance. It is &quot;close enough&quot; for most purposes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) Perhaps more important, as pointed out by dm63 in a comment above, if the swap had been defined with non zero expected value version of the formula, using actual returns, it would be more difficult to hedge because your exposure to the variance on any individual day depends in some complex way on the sum of returns so far, whereas in the zero version your exposure to the variance is the same on all the days.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-03-27T01:00:53.370" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33267" PostTypeId="2" ParentId="33263" CreationDate="2017-03-27T08:19:55.303" Score="8" Body="&lt;p&gt;Assume the local volatility dynamics is:&#xA;$$dS_t/S_t = \sigma(S_t) dW_t^\Bbb{Q} $$&#xA;where we have just assumed $r=0$ without loss of generality (if $r$ is not zero, you just need a change of measure to the $T$-forward measure). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose you would like to fit the market implied volatility smile $\Sigma(T,K)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is &lt;strong&gt;no closed-form formula&lt;/strong&gt; to express $\Sigma(T,K)$ as a function of $\sigma(S_t)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are however a bunch of &lt;strong&gt;approximations&lt;/strong&gt; available in the literature:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;For short term options ($T \to 0$), we have&#xA;$$ \Sigma(T,K) \approxeq \frac{\ln(S_0/K)}{\int_K^{S_0} (s\sigma(s))^{-1} ds} $$&#xA;known as the BFF approximation (Berestycki, Busca &amp;amp; Florent - 2001). You can obtain this formulation by (1) expanding Dupire local volatility in time (2) assuming that the implied volatility can also be expanded in powers of time and identifying zero-th order in $T$ terms.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;For longer term options, one can expand the latter formula to obtain:&#xA;$$ \Sigma(T,K) \approxeq \Sigma_0(K) + \Sigma_1(K) T $$&#xA;with&#xA;$$ \Sigma_0(K) = \frac{\ln(S_0/K)}{\int_K^{S_0} (s \sigma(s))^{-1} ds} $$&#xA;$$ \Sigma_1(K) = -\frac{\Sigma_0(K)}{\left( \int_K^{S_0} (s\sigma(s))^{-1} ds \right)^2} \ln \left( \frac{\Sigma_0(K)}{\sqrt{\sigma(S_0)\sigma(K)}} \right) $$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;For short term options another approximation is due to Pat Hagan (Hagan, Kumar, Lesniewski &amp;amp; Woodward - 2002) it reads:&#xA;$$ \Sigma(T,K) \approxeq \sigma(\sqrt{S_0 K} ) $$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Berestycki, Busca, Florent. (2001). Asymptotics and calibration of local volatility models. Electronic copy available &lt;a href=&quot;http://www.math.nyu.edu/phd_students/frizpete/finance/asymptotic_locvol.pdf&quot; rel=&quot;noreferrer&quot; title=&quot;here&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Hagan, Kumar, Lesniewski, Woodward. (2002). Managing smile risk. &lt;em&gt;Wilmott Magazine&lt;/em&gt;, 84-108. Electronic copy available &lt;a href=&quot;http://www.javaquant.net/papers/managing_smile_risk.pdf&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2017-03-27T09:42:28.427" LastActivityDate="2017-03-27T09:42:28.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33268" PostTypeId="1" CreationDate="2017-03-27T10:25:40.967" Score="0" ViewCount="914" Body="&lt;p&gt;I'm trying to convert daily data into weekly data, but with the time interval from monday to monday. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First I download historical prices from Yahoo: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tickername&amp;lt;-getSymbols(&quot;Tickeername&quot;,from=&quot;2011-12-31&quot;,to=&quot;2017-01-03&quot;,auto.assign = FALSE)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I convert the data into weeklY:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to.weekly(Tickername)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I want the weekly data start from monday 9th January 2012 (monday to monday weekly data), how can I change the time interval?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your help is fully appreciated!&lt;/p&gt;&#xA;" OwnerUserId="26935" LastActivityDate="2017-03-27T10:25:40.967" Title="Quantmod - converting daily data to weekly data (changing time intervals from monday to monday)" Tags="&lt;time-series&gt;&lt;quantmod&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33269" PostTypeId="2" ParentId="33223" CreationDate="2017-03-27T11:47:41.377" Score="2" Body="&lt;p&gt;You need to declare the size of the matrix S(.,.). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example Dim S(50, 50) As Double&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is an elementary VBA question not suitable for QuantStackExchange.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also you shouold ask new questions separately, not trash an existing question by changing it.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2017-03-27T11:47:41.377" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33270" PostTypeId="2" ParentId="33246" CreationDate="2017-03-27T13:27:29.427" Score="5" Body="&lt;p&gt;Let's go back to basics. In terms of its yield $y$, the price of a bond maturing in $n$ years is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;P_n(y) =   \sum_{i=1}^n\frac{c}{(1+y)^i} + \frac{100}{(1+y)^n}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One year later, the yield is now $y^*$ and the bond now matures in $(n-1)$ years, and its price is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;P_{n-1}(y^*) = \sum_{i=1}^{n-1}\frac{c}{(1+y^*)^i} + \frac{100}{(1+y^*)^{n-1}}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can write $y^* = y + \Delta y$ and expand in powers of $\Delta y$ to get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;P_{n-1}(y^*) \approx P_{n-1}(y) + \frac{\partial P_{n-1}}{\partial y}\Delta y + O(\Delta y^2)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The duration of this bond is defined to be&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;-D_{n-1}(y) = \frac{1}{P_{n-1}(y)}\frac{\partial P_{n-1}}{\partial y}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The total return of the bond, including the cashflow of $c$ received, is therefore&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;R = \frac{c + P_{n-1}(y) - D_{n-1}(y)P_{n-1}(y)\Delta y - P_n(y)}{P_n(y)} + O(\Delta y^2)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Noting that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;c + P_{n-1}(y) = (1+y)P_{n}(y)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;we can write the total return as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;R = y - \frac{P_{n-1}(y)}{P_n(y)}D_{n-1}(y) \Delta y + O(\Delta y)^2&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the only approximation that has been made is in approximating the price of the bond $P_{n-1}(y + \Delta y)$ as a linear function of $\Delta y$. Other than that, we have used exact formulas throughout. The expression that you often see, and that you quoted in your question,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;R = y - D_n(y) \Delta y + O(\Delta y^2)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is incorrect when we consider returns over finite time periods - it is only valid for an &lt;em&gt;instantaneous&lt;/em&gt; change in yields. In particular, as you found out, it obscures the choice of which duration to use - the correct answer is neither the duration $D_n(y)$ nor the forward duration $D_{n-1}(y)$, but instead the forward duration adjusted by the ratio of bond prices assuming an unchanged yield. &lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2017-03-27T13:27:29.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33271" PostTypeId="1" CreationDate="2017-03-27T13:38:51.427" Score="1" ViewCount="54" Body="&lt;p&gt;Consider a model measuring the EVE risk (change in the economic value by shocking the rates; PV01) of a portfolio of vanilla interest rate floor options. Is there any reason for the EVE risk of a floor option under 1bp parallel shock of the rates being equal to the sum of EVE risks resulting from the 1bp shock of the key rates?&lt;/p&gt;&#xA;" OwnerUserId="25293" LastActivityDate="2017-03-27T13:38:51.427" Title="Floor option EVE risk: Sum of key rate shocks risks vs. the rates parallel shock risk" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;derivatives&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33272" PostTypeId="1" CreationDate="2017-03-27T13:38:58.760" Score="4" ViewCount="172" Body="&lt;p&gt;What are some quantitative approaches to estimating credit risk for investments that aren't publicly traded, such as private equity and direct real estate? I'm particularly interested in estimating incremental changes in credit quality and probability of bankruptcy, and its implications for issuer risk. While I am familiar with approaches to this for publicly traded assets, such as structural models and stress tests, I haven't come across any literature applying these quantitative techniques to private investments. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How is this done in actual practice? I would be interested in any papers or literature reviews you've come across that tackle this problem.&lt;/p&gt;&#xA;" OwnerUserId="17712" LastEditorUserId="467" LastEditDate="2017-03-28T07:50:34.877" LastActivityDate="2019-07-05T14:39:43.557" Title="What are the quantitative approaches to quantify credit risk for Private Equity and Real Estate?" Tags="&lt;reference-request&gt;&lt;credit-risk&gt;&lt;private-equity&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33273" PostTypeId="2" ParentId="9798" CreationDate="2017-03-27T13:52:57.450" Score="5" Body="&lt;p&gt;Vanguard S&amp;amp;P 500 index fund tracks the index and not the total return because it pays dividends out to the owners of the fund... some investors reinvest the dividends, some investors spend their dividends, etc., so, because they cannot control the reinvestment and distribute the dividends, they benchmark against the S&amp;amp;P 500 index and not the total return equivalent&lt;/p&gt;&#xA;" OwnerUserId="27180" LastActivityDate="2017-03-27T13:52:57.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33274" PostTypeId="1" CreationDate="2017-03-27T14:39:47.617" Score="3" ViewCount="171" Body="&lt;p&gt;The Martingale Method for utility maximization (seen in e.g. Björk's book) is based on separating the optimization problem $E^\mathbb{P}[U(X_T)]$ over a class of admissible strategies into the static problem of determining the optimal wealth profile $\hat{X}_T$. If the inital capital is $x$ the constraint is $E^\mathbb{Q}[X_T]=x$ hence the problem turns into maximizing the Lagrangian&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;E^\mathbb{P}[U(X_T) - \lambda(L_T X_T - x)]&#xA;\end{equation}&lt;br&gt;&#xA;where $L_T$ is the Radon–Nikodym derivative and $\lambda$ is the lagrange multiplier. Solving this gives the optimal wealth as some function of $L_T$, $X_T = X_T(L_T)$, and since the martingale dynamics is $d\hat{X}_t = \hat{u}_t dW_t^\mathbb{Q}$ (for some predictable $\hat{u}_t$) all that is left is to determine $\hat{u}_t$ (e.g. by Ito's lemma). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now to my question: I have noticed that for the problems I have encountered $\hat{u}_t$ is also a $\mathbb{Q}$-martingale. For example it might be easy to determine $\hat{u}_T$ close to the terminal date $T$, and then it is evident that $\hat{u}_t = E^\mathbb{Q}[\hat{u}_T | \mathcal{F}_t]$ after the problem has been solved. Is it possible to prove that this is true? If $\hat{u}_t$ is known this is obviously easy to check, but what can be said about the general case?&lt;/p&gt;&#xA;" OwnerUserId="24306" LastActivityDate="2017-03-27T14:39:47.617" Title="Martingale method for utility maximization - is the optimal strategy also a martingale?" Tags="&lt;portfolio-optimization&gt;&lt;martingale&gt;&lt;utility-theory&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33275" PostTypeId="2" ParentId="33223" CreationDate="2017-03-27T14:52:15.697" Score="3" Body="&lt;p&gt;Joe,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wrote this a while ago and it could be cleaned up a little.  It is for European Calls and Puts.  I have a couple of lines commented out.  I was probably going to add American pricing in but never did so.  I just tested it out and it still works for me.  Note that my input on the spreadsheet is in days and not years.  I convert to years in the VBA.  See below.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Function TrinomialTree(OptionType As String, S As Double, K As Double, _&#xA;                sigma As Double, rfr As Double, T As Double, _&#xA;                div As Double, n As Integer)&#xA;&#xA;Dim Val() As Double&#xA;Dim up As Double&#xA;Dim dn As Double&#xA;Dim pUp As Double&#xA;Dim pDn As Double&#xA;Dim pStat As Double&#xA;Dim cst As Double&#xA;Dim dt As Double&#xA;Dim df As Double&#xA;Dim T1 As Double&#xA;Dim i As Integer&#xA;Dim j As Integer&#xA;Dim x As Integer&#xA;Dim OpType As Integer&#xA;&#xA;ReDim Val(n * 2 + 1)&#xA;&#xA;T1 = T / 365&#xA;dt = T1 / n&#xA;df = Exp(-rfr * dt)&#xA;cst = rfr - div&#xA;&#xA;Select Case OptionType&#xA;    Case &quot;EC&quot;&#xA;        OpType = 1&#xA;    Case &quot;EP&quot;&#xA;        OpType = -1&#xA;'        Case &quot;AC&quot;&#xA;'            OpType = 1&#xA;'        Case &quot;AP&quot;&#xA;'            OpType = -1&#xA;End Select&#xA;&#xA;up = Exp(sigma * Sqr(2 * dt))&#xA;dn = Exp(-sigma * Sqr(2 * dt))&#xA;&#xA;pUp = ((Exp(cst * dt / 2) - Exp(-sigma * Sqr(dt / 2))) / _&#xA;        (Exp(sigma * Sqr(dt / 2)) - Exp(-sigma * Sqr(dt / 2)))) ^ 2&#xA;pDn = ((Exp(sigma * Sqr(dt / 2)) - Exp(cst * dt / 2)) / _&#xA;        (Exp(sigma * Sqr(dt / 2)) - Exp(-sigma * Sqr(dt / 2)))) ^ 2&#xA;pStat = 1 - (pUp + pDn)&#xA;&#xA;For i = 0 To (n * 2)&#xA;    Val(i) = Application.WorksheetFunction.Max(0, OpType * (S * up ^ _&#xA;                Application.WorksheetFunction.Max(i - n, 0) * dn ^ _&#xA;                Application.WorksheetFunction.Max(n * 2 - n - i, 0) - K))&#xA;Next i&#xA;&#xA;For x = n - 1 To 0 Step -1&#xA;    For i = 0 To (x * 2)&#xA;        Val(i) = (pUp * Val(i + 2) + pStat * Val(i + 1) + pDn * Val(i)) * df&#xA;    Next i&#xA;Next x&#xA;&#xA;TrinomialTree = Val(0)&#xA;&#xA;End Function&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Being that this has drifted off topic, feel free to contact me off the forum if you are stuck and I will try to help you out. &lt;/p&gt;&#xA;" OwnerUserId="26556" LastActivityDate="2017-03-27T14:52:15.697" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33276" PostTypeId="1" CreationDate="2017-03-27T14:55:53.117" Score="2" ViewCount="118" Body="&lt;p&gt;If we think realized vol &gt; implied vol, then we might go ahead and delta hedge a call, hoping that profits from gamma outweigh the decay.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; What should $K$ be on the call? ATM? If so, why? What happens if its OTM/ITM?&lt;/p&gt;&#xA;" OwnerUserId="27181" LastActivityDate="2017-03-27T16:48:53.030" Title="How does gamma trading depend on $K$?" Tags="&lt;hedging&gt;&lt;call&gt;&lt;gamma&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33277" PostTypeId="2" ParentId="33276" CreationDate="2017-03-27T15:26:09.407" Score="2" Body="&lt;p&gt;There is much more to exploit when gamma is highest. Your daily gamma PnL is $0.5\Gamma(X_t-X_{t-1})^2$, so you would probably prefer to have $\Gamma$ highest which is near the money. To be precise, $\Gamma$ is highest when $d1=0$ which occurs for $K=Fe^{0.5\sigma^2t}$. Of course, I am assuming a European option and that the Black Scholes model is correct of course - either way, close to ATM is what you want.&lt;/p&gt;&#xA;" OwnerUserId="26977" LastEditorUserId="26977" LastEditDate="2017-03-27T16:48:53.030" LastActivityDate="2017-03-27T16:48:53.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33278" PostTypeId="1" CreationDate="2017-03-27T15:49:00.587" Score="1" ViewCount="150" Body="&lt;p&gt;I was multiplying the popular calculation w' * Σ * w and got the idea of generating a beta matrix. multiplying Co-variance by inverse variance. Would this work? generating the beta of each asset to the portfolio consistently? Or would this generate something useless?&lt;/p&gt;&#xA;" OwnerUserId="18578" LastActivityDate="2017-03-28T14:16:46.573" Title="would multiplying a co-variance matrix by the inverse of a variance matrix generate a beta matrix?" Tags="&lt;portfolio-management&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33279" PostTypeId="1" CreationDate="2017-03-27T16:59:55.703" Score="1" ViewCount="5157" Body="&lt;p&gt;I have a project at school were we are supposed to find the &lt;strong&gt;generic series&lt;/strong&gt; for US treasury bonds, and then download daily data for 3 years. I have found the bb ticker, but i don't understand the difference between regular and generic series? I have managed to download daily last price data for multiple maturities. After the data is downloaded, I am supposed to calculate the average return, either by yield to maturity or total return. This is were I'm stuck. I know how to calculate YTM, but am i really supposed to calculate the YTM for every single day (Prices changes) and then take the average of all of these YTMs? Is there something I'm missing? The problem set really doesn't specify what kind of data we are supposed to download for the series, but I couldn't find any thing called YTM when importing the data to excel. If I could do that, i presume that i could just have taken the average of all the YTMs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="27184" LastEditorUserId="16148" LastEditDate="2017-03-27T18:49:54.223" LastActivityDate="2017-03-27T18:49:54.223" Title="What are Generic government treasury bonds? (Bloomberg terminal)" Tags="&lt;fixed-income&gt;&lt;bloomberg&gt;&lt;excel&gt;&lt;yield&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33280" PostTypeId="2" ParentId="33278" CreationDate="2017-03-27T17:10:15.507" Score="2" Body="&lt;p&gt;The ordinary least squares regression &lt;a href=&quot;https://en.wikipedia.org/wiki/Ordinary_least_squares#Simple_regression_model&quot; rel=&quot;nofollow noreferrer&quot;&gt;estimate of beta&lt;/a&gt; of $y$ to $x$ is given by&#xA;$$&#xA;\beta = \frac{\textrm{cov}(x, y)}{\textrm{var}(x)}.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, you want to calculate the beta of asset $i$ to your portfolio $p=\sum_j w_j x_j$.&#xA;$$&#xA;\beta_i = \frac{\textrm{cov}(x_i, p)}{\textrm{var}(p)} = \frac{\textrm{cov}(x_i, \sum_j w_j x_j)}{w^T\Sigma w} = \frac{\sum_j w_j\textrm{cov}(x_i, x_j)}{w^T\Sigma w}&#xA;$$&#xA;For the last step, we use the property of &lt;a href=&quot;https://en.wikipedia.org/wiki/Covariance#Properties&quot; rel=&quot;nofollow noreferrer&quot;&gt;covariance&lt;/a&gt; that $$\textrm{cov}(X,aY+bZ) = a\,\textrm{cov}(X,Y)+b\,\textrm{cov}(X,Z).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to calculate all the betas at once, you can do so in matrix form.&#xA;$$&#xA;\beta = \frac{\Sigma w}{w^T\Sigma w}&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="5617" LastEditorUserId="5617" LastEditDate="2017-03-28T14:16:46.573" LastActivityDate="2017-03-28T14:16:46.573" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33281" PostTypeId="2" ParentId="33279" CreationDate="2017-03-27T17:41:46.357" Score="1" Body="&lt;p&gt;You can see all the US generic yield indices by typing &lt;code&gt;ALLX USGG&lt;/code&gt; into your terminal. This will give the generic indices for multiple maturities. From there just pick the maturities you need.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This index is quoted in YTM, so if you want the average yield, you can export the last price series (&lt;code&gt;PX_LAST&lt;/code&gt;) from the terminal or pull the series into Excel and take the simple average.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;=BDH(&quot;USGG10YR Index&quot;, &quot;PX_LAST&quot;, start_date, end_date)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="5617" LastActivityDate="2017-03-27T17:41:46.357" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="33282" PostTypeId="1" CreationDate="2017-03-27T18:14:08.773" Score="2" ViewCount="465" Body="&lt;p&gt;For a stock that pays no dividends, and has constant interest rates, I know that the relationship can be described with:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$F(t) = s(t). e^{r(T-t)}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;F(t) = Forward price,&#xA;S(t) = Stock price,&#xA;r = risk free rate,&#xA;T = maturity date,&#xA;t = time now&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does the equation change, when rates are stochastic?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;edit&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From another textbook, it appears the relationship can be modeled as: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ F(t) = s(t) / P(t) $ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $ P(t) = e^{-\int_{t}^{T} r(s) ds} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;does this look right?  &lt;/p&gt;&#xA;" OwnerUserId="27186" LastEditorUserId="27186" LastEditDate="2017-03-27T19:05:28.757" LastActivityDate="2017-04-16T13:34:47.397" Title="Stochastic Interest rate spot forward relationship" Tags="&lt;forward&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33283" PostTypeId="1" CreationDate="2017-03-27T19:07:43.377" Score="1" ViewCount="196" Body="&lt;p&gt;As we all know, the GARCH model is stated as&lt;br&gt;&#xA;$\epsilon_t = \sigma_tz_t$&lt;br&gt;&#xA;$\sigma_t^2 = w + \sum^q_{i=1}\alpha_i\epsilon_{t-i}^2 + \sum^q_{i=1}\beta_i\sigma_{t-i}^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In application, the estimate $\hat{\epsilon}_t^2$ is just the squared of the residuals. My question is what is the estimate of $\hat{\sigma}_t^2$ and how can it be obtained from the time series when using the GARCH estimation?&lt;/p&gt;&#xA;" OwnerUserId="26649" LastActivityDate="2017-03-27T19:07:43.377" Title="Questions on the concept of GARCH model" Tags="&lt;time-series&gt;&lt;garch&gt;" AnswerCount="0" CommentCount="5" ClosedDate="2017-05-20T04:33:43.993" ContentLicense="CC BY-SA 3.0" />
  <row Id="33284" PostTypeId="1" AcceptedAnswerId="33290" CreationDate="2017-03-27T19:25:21.870" Score="9" ViewCount="2033" Body="&lt;p&gt;and thank you for answering me ! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;While I was recently testing a delta-hedging on a few products, I got a P&amp;amp;L result of 20% for some of them. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, I thought that the implementation was incorrect. But I couldn't find an outright error. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After a deeper look in my (back)test-data, I found that delta-hedging might not be enough even for simple products like 'vanilla calls'. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's an example (with payoff = (S(T) - K )+): (T = 20 days, K =50.5, (hypothesis : Black-Scholes model))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;S:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;day 0 = 50 ; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;day 1 = 50.5 ; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;day 2 = 50.3 ;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;... ;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;day 15 = 52.7 ;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;day 16 = 49.3 ;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;day 17 = 37.5 ;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;day 18 = 36.4 ;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;day 19 =  36.8;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;day 20 = 37.7.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I rebalance every day and because of the huge price fall on day 17, and because my delta was close to 1, I lost a lot of money (call price is almost 0, while my porfolio is about -15), causing a big P&amp;amp;L.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;So, my questions are :&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1/ Is it correct that :&#xA;&quot;delta-hedging is ok for continuous data (and continuous heding). Price-jumps are not hedged with delta-hedging&quot;..?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2/ Assuming that we can't hedge more than once a day, and having recurrent (there are a few) prices falls in my data,  what do you suggest for a hedging ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot,&#xA;Guillaume&lt;/p&gt;&#xA;" OwnerUserId="25844" LastActivityDate="2017-03-29T09:06:35.447" Title="delta-hedging is failing" Tags="&lt;black-scholes&gt;&lt;delta-hedging&gt;&lt;replication&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33285" PostTypeId="2" ParentId="32900" CreationDate="2017-03-27T19:42:09.663" Score="1" Body="&lt;p&gt;The cash flows on CMS leg reset based on some index, let's say the 5y swap rate. Duration measures sensitivity to different parts of the yield curve. The amount paid is based on that rate as of the last reset date, so essentially your duration should be close to 5 as your exposure is concentrated at the 5yr point on the yield curve (could be a bit higher/lower as the swap gains/loses premium).&lt;/p&gt;&#xA;" OwnerUserId="5617" LastEditorUserId="5617" LastEditDate="2017-03-27T20:23:09.463" LastActivityDate="2017-03-27T20:23:09.463" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33286" PostTypeId="1" AcceptedAnswerId="33297" CreationDate="2017-03-27T19:42:45.300" Score="3" ViewCount="154" Body="&lt;p&gt;I am actually reading Lorenzo Bergomi's &quot;Stochastic Volatility Modelling&quot; book, and came across this bit :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/6RAbu.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/6RAbu.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand everything up to (5.5) included. But I don't see the point in mentioning the vanishing pricing drift. What is &quot;pricing drift&quot; ? After that he defines continuous (instantaneous in fact) VS forward variance and writes that they are driftless as well (same argument as for discrete VS forward variance), and write that in a diffusive setting they are equal to $\left(\ldots\right) dW_t^T$ where I guess $W^T$ is a standard Brownian motion under the forward $T$ measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is pricing drift defined outside a diffusive setting or does everything here takes place in a diffusive setting ? (The &quot;in a diffusive setting&quot; is unsettling.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is general in Bergomi's remark about pricing drift ? I mean, is there a way to define being a martingle through linearity of a certain P&amp;amp;L or ?&lt;/p&gt;&#xA;" OwnerUserId="13470" LastEditorUserId="13470" LastEditDate="2017-03-27T20:45:54.587" LastActivityDate="2017-03-29T07:48:38.697" Title="Generating a P&amp;L that is linear in the variation on an underlying at no cost" Tags="&lt;pricing&gt;&lt;pnl&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33287" PostTypeId="5" CreationDate="2017-03-27T19:44:38.067" Score="0" Body="&lt;p&gt;P&amp;amp;L, or pnl, is a short hand for &quot;profit and loss&quot;. which denote the balance sheet of a position in assets over a period of time.&lt;/p&gt;&#xA;" OwnerUserId="13470" LastEditorUserId="13470" LastEditDate="2017-03-28T05:54:07.220" LastActivityDate="2017-03-28T05:54:07.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33288" PostTypeId="4" CreationDate="2017-03-27T19:44:38.067" Score="0" Body="P&amp;L, or pnl, is a short hand for &quot;profit and loss&quot;. which denote the balance sheet of a position in assets over a period of time." OwnerUserId="13470" LastEditorUserId="13470" LastEditDate="2017-03-28T05:53:54.677" LastActivityDate="2017-03-28T05:53:54.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33289" PostTypeId="1" CreationDate="2017-03-27T19:50:11.390" Score="1" ViewCount="29" Body="&lt;p&gt;I'm trying to adapt the code below in Multicharts .NET version to accomplish the following task:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Calculate, at the time of the signal, the correct option code for a call option that has the least number of days to expiration and is closest to, but not higher than .90 delta. Then, use that calculated value in the trade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The documentation on this platform is here &lt;a href=&quot;https://drive.google.com/drive/search?q=multicharts&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://drive.google.com/drive/search?q=multicharts&lt;/a&gt; but I am not finding what I need to do to make this happen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[code]namespace PowerLanguage.Strategy&#xA;{&#xA;    [IOGMode(IOGMode.Disabled)]&#xA;    public class Key_Reversal_LE_data2 : SignalObject&#xA;    {&#xA;        private IOrderMarket m_KeyRevLE;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    public Key_Reversal_LE_data2(object ctx) :&#xA;        base(ctx)&#xA;    {&#xA;        Length = 1;&#xA;    }&#xA;&#xA;    [Input]&#xA;    public int Length { get; set; }&#xA;&#xA;    protected override void Create(){&#xA;        m_KeyRevLE =&#xA;            OrderCreator.MarketNextBar(new SOrderParameters(Contracts.Default, &quot;KeyRevLE&quot;, EOrderAction.Buy));&#xA;    }&#xA;&#xA;    protected override void CalcBar(){&#xA;        if (PublicFunctions.DoubleLess(BarsOfData(2).Low[0], BarsOfData(2).Low.Lowest(Length, 1))&#xA;            &amp;amp;&amp;amp; PublicFunctions.DoubleGreater(BarsOfData(2).Close[0], BarsOfData(2).Close[1]))&#xA;          m_KeyRevLE.Send();&#xA;    }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;}[/code]&lt;/p&gt;&#xA;" OwnerUserId="22836" LastActivityDate="2017-03-27T19:50:11.390" Title="Lookup option code at the time of the signal" Tags="&lt;programming&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33290" PostTypeId="2" ParentId="33284" CreationDate="2017-03-27T19:57:09.580" Score="11" Body="&lt;p&gt;Regarding your 1st question, jumps are indeed unhedgeable. From a theoretical point of view, you might want to look at Merton's &lt;a href=&quot;http://www.people.hbs.edu/rmerton/optionpricingwhenunderlingstock.pdf&quot; rel=&quot;noreferrer&quot;&gt;&quot;Option pricing when underlying stock returns are discontinuous&quot;&lt;/a&gt;, the original paper that adapted Black-Scholes framework to include jumps. If you look at page 7, just after equation $(9)$:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Unfortunately, in the presence of the jump process, $dq$, the return on the [hedging] portfolio [...] will not be riskless. Moreover, inspection of [equation] $(7c)$ shows that there does not exist a set of portfolio weights [...] that will eliminate the 'jump' risk [...].&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;[...]&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Note: the return on the portfolio is a 'pure' jump process because the continuous parts of the stock and the option price movements have been 'hedged' out.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So, as regards to question 2, you can for example increase the frequency of your hedging portfolio reallocation to get closer to purely continuous trading; but even there, if you assume  a Merton framework, you will still be exposed to the jump risk.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: jump risk is unhedgeable because there isn't a tradeable asset allowing to hedge against it. For example, Heston's original stochastic volatility model was incomplete (as is Merton's) because the volatility risk couldn't be hedged out. However, if you include a volatility derivative in your model, then volatility risk becomes hedgeable. If you had at your disposal a tradeable asset allowing you to hedge against jump risk, then the 'model' would be complete and you could hedge out the risk.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 2&lt;/strong&gt;: I am writing down some additional thoughts related to your comment &lt;em&gt;&quot;[...] how banks hedge their (for instance) long term structured products [...]?&lt;/em&gt;&quot; @StudentInFinance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Going back to Merton's article, consider equation $(10)$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{dP}{P} = \left(\alpha_P - \lambda k_P \right)dt + dq $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{dP}{P}$ is the return of the hedging portfolio (stock, option and zero-coupon bond), $\alpha_P$ its instantaneous return, $\lambda$ the mean number of jumps per unit of times, $k_P$ the expected percentage change in the portfolio value if a jump occurs and $q$ the Poisson process modelling jumps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The key feature is that Merton argues that the random jump component of the portfolio is uncorrelated to the market. Emphasis mine:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The total change in the stock price is posited to be the composition of two types of changes: (1) the 'normal' vibrations in price, [...]. (2) The 'abnormal' vibrations in price are due to the arrival of important new information about the stock that has more than a marginal effect on price. Usually, &lt;strong&gt;such information will be specific to the firm or possibly its industry&lt;/strong&gt;.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;[...]&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;[...] the stock price dynamics were described as the result of two components: the continuous part [...] and the jump part which is a reflection of important new information that has an instantaneous, non-marginal impact on the stock. &lt;strong&gt;If the latter information is usually firm&lt;/strong&gt; [...] &lt;strong&gt;specific, then it may have little impact on stocks in general&lt;/strong&gt; (i.e. the 'market'). [...]&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If the source of the jumps is such information, &lt;strong&gt;then the jump component of the stock's return will represent 'non-systematic' risk&lt;/strong&gt;, i.e. &lt;strong&gt;&lt;em&gt;the jump component will be uncorrelated with the market&lt;/em&gt;&lt;/strong&gt;. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now, consider that some investment bank has a position in 2 different options written on 2 different stock prices, $S_t^{(1)}$ and $S_t^{(2)}$, with different jump risk sources. The return of each hedging portfolio will be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align} &#xA;&amp;amp; R_1 \equiv \frac{dP_1}{P_1} = \left(\alpha_{P,1} - \lambda_1 k_{P,1} \right)dt + dq_1&#xA;\\[12pt]&#xA;&amp;amp; R_2 \equiv \frac{dP_2}{P_2} = \left(\alpha_{P,2} - \lambda_2 k_{P,2} \right)dt + dq_2&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbb{C}\text{ov}\left[R_1,R_2\right] = \mathbb{C}\text{ov}[dq_1,dq_2] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From Merton's comments we can posit that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbb{C}\text{ov}[dq_1,dq_2]=0 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, letting $\sigma_i^2 \equiv \mathbb{V}\text{ar}[R_i]$, $i \in \{1,2\}$, the bank's return variance of these 2 portfolios is $-$ if held in proportions $w_1, w_2$ of its total book, such that $w_1, w_2&amp;gt;0$ and $w_1+w_2=1$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbb{V}\text{ar}\left[w_1R_1+w_2R_2 \right] = w_1^2\sigma_1^2 + w_2^2\sigma_2^2 &amp;lt; w_1\sigma_1^2 + w_2\sigma_2^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You see there is some &quot;diversification effect&quot; kicking in: the book's risk is lower than the weighted risk of each individual portfolio. Non-systematic risk is lowered by including additional (uncorrelated) jump risks in your portfolio, hence based on this interpretation banks, by writing options on multiple stock underlying, are &quot;naturally&quot; hedging out part of their jump risk.&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-03-29T09:06:35.447" LastActivityDate="2017-03-29T09:06:35.447" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33291" PostTypeId="2" ParentId="33282" CreationDate="2017-03-27T20:25:21.370" Score="5" Body="&lt;p&gt;The forward price $K$, determined at time  $t$, is the amount such that the payoff at time $T$ is $S_T-K$, while the value at time  $t$ is zero. That is,&#xA;\begin{align*}&#xA;B_t E\left(\frac{S_T-K}{B_T}\mid \mathcal{F}_t \right)= 0,&#xA;\end{align*}&#xA;Where $E$ is the risk-neutral expectation operator. Then,&#xA;\begin{align*}&#xA;K&amp;amp;=\frac{E\left(\frac{S_T}{B_T}\mid \mathcal{F}_t \right)}{E\left(\frac{1}{B_T}\mid \mathcal{F}_t \right)}\\&#xA;&amp;amp;=\frac{E\left(\frac{S_T}{B_T}\mid \mathcal{F}_t \right)}{\frac{1}{B_t}E\left(\frac{B_t}{B_T}\mid \mathcal{F}_t \right)}\\&#xA;&amp;amp;=\frac {\frac{ S_t}{ B_t} }{\frac{1}{B_t}P (t,T)}\\&#xA;&amp;amp;=\frac{S_t}{P(t,T)},&#xA;\end{align*}&#xA;where &#xA;\begin{align*}&#xA;P (t,T) &amp;amp;= E\left(\frac{B_t}{ B_T}\mid \mathcal {F}_t \right)\\&#xA;&amp;amp;=E\left(e^{-\int_t^T r_s ds}\mid \mathcal {F}_t \right)&#xA;\end{align*}&#xA;is the price at time $t$ of a zero-coupon bond with maturity $T$ and unit face value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, at time $t$,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;enter into a forward contract with forward price $K$, which has zero cost at time $t$,&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;short one share with income $S_t$, and&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;long $\frac{S_t}{P (t,T)}$ units of zero-coupon bond with maturity $T$. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The net cost at time $t$ is zero. At maturity  $T$, &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;the forward contract has value $S_T-K$,&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;the short position of one share has value $-S_T$, and&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;the zero-coupon bond has value $\frac{S_t}{P (t,T)}$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Assuming arbitrage free, the value at time $T$ is then&#xA;\begin{align*}&#xA;S_T-K - S_T + \frac{S_t}{P (t,T)} = \frac{S_t}{P (t,T)}-K =0,&#xA;\end{align*}&#xA;that is,&#xA;\begin{align*}&#xA;K=\frac{S_t}{P (t,T)}.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-04-16T13:34:47.397" LastActivityDate="2017-04-16T13:34:47.397" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="33292" PostTypeId="2" ParentId="33235" CreationDate="2017-03-27T22:13:51.187" Score="6" Body="&lt;p&gt;To preface, just a minor quibble: French still tracks the momentum anomaly elsewhere on his library, under &amp;quot;&lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html&quot; rel=&quot;noreferrer&quot;&gt;Sorts involving Prior Returns&lt;/a&gt;&amp;quot;; it's just no longer part of the core FF framework for invalidating the mean-variance-covariance optimized portfolio implied by the CAPM.&lt;/p&gt;&#xA;&lt;p&gt;Originally, Fama-French (FF) developed a three-factor model to invalidate the single factor Capital Asset Pricing Model (CAPM). CAPM implies that a mean-covariance optimized portfolio determines the optimal risk-adjusted weightings for the market portfolio. If the market is efficient, then the market portfolio's weights are reflexively the optimal weights. Although FF does not question the premise of market efficiency, it simply shows that efficient portfolios cannot possibly be those implied by CAPM. More recently, Stochastic Portfolio Theory (SPT), which converges with continuous optimal Kelly under certain special cases, also shows that market weights cannot possibly be the optimal mix with some light assumptions.&lt;/p&gt;&#xA;&lt;p&gt;Carhart added a fourth factor for momentum which, while statistically significant, did not fit into Fama-French framework for invalidating the CAPM. Momentum is perhaps the most vexing market anomaly because it exists, but normative models for rational agent behavior cannot explain why it exists. Behavioral economics is just beginning to uncover the nexus of human irrationality which causes people to &amp;quot;buy higher&amp;quot; and &amp;quot;sell lower&amp;quot; -- presumably the roots for the momentum phenomenon.&lt;/p&gt;&#xA;&lt;p&gt;Carhart's Momentum was once part of the FF framework, but it proved problematic for the efficient market hypothesis (EMH). If momentum is actually real, then it indicates the presence of a return spread which is not related to trading risk or cost -- it looks like a classical &lt;em&gt;free lunch&lt;/em&gt;. Since FF does not question the EMH, momentum has been abandoned in favor of the more explicable RMW (return spread of the most profitable firms minus the least profitable) and CMA (return spread of firms that invest conservatively minus aggressively) anomalies.&lt;/p&gt;&#xA;&lt;p&gt;Perhaps notable is that Cliff Asness’ firm, AQR, adds back a sixth factor for &lt;a href=&quot;https://www.aqr.com/cliffs-perspective/our-model-goes-to-six-and-saves-value-from-redundancy-along-the-way&quot; rel=&quot;noreferrer&quot;&gt;momentum&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2017-03-27T22:35:04.123" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33293" PostTypeId="1" CreationDate="2017-03-27T23:16:44.920" Score="8" ViewCount="1485" Body="&lt;p&gt;Assume $dS = S_t\sigma(S_t,t)dW$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given a implied volatility smile which is linear in, say, $(K - S_0)$, (we know its intercept and slope), we wish to calibrate $\sigma(S_t, t)$ to it. Will it too be linear? If so, with what intercept and slope?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, what will it be?&lt;/p&gt;&#xA;" OwnerUserId="27189" LastActivityDate="2019-04-23T23:37:31.080" Title="Is the local volatility linear if smile is linear?" Tags="&lt;local-volatility&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="33294" PostTypeId="2" ParentId="22819" CreationDate="2017-03-28T03:18:20.480" Score="3" Body="&lt;p&gt;Because CDS theoretically represent a credit risk to the dealer (i.e. the dealer accepts the credit risk of a borrower in exchange for premium payments), a CDS is essentially priced by assuming that the dealer of the CDS is compensated for this credit risk through a credit spread over a risk-free security. In other words, assuming perfectly efficient markets, CDS are priced based on premiums that are equal to the difference between the underlying debt obligation and a risk-free security of the same term to maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;TL;DR: You should be able to solve for the price of a CDS using the yield on the underlying and the yield on a U.S. treasury of the same maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case you're interested: this is how synthetic CDO's and other synthetic debt obligations are created (which you probably know about thanks to the recent Financial Crisis). Basically, if you run out of securities to give to investors (e.g., mortgages, corporate bonds, etc.), you can make a synthetic version of these bonds by issuing a CDS on the underlying security with an attached treasury security of the same maturity.&lt;/p&gt;&#xA;" OwnerUserId="27192" LastActivityDate="2017-03-28T03:18:20.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33295" PostTypeId="2" ParentId="33272" CreationDate="2017-03-28T04:31:14.310" Score="1" Body="&lt;p&gt;You could calculate Z-score of a privately owned company and compare it with its publicly traded peers. Z-score is based on the financial ratios of the company and you will have to apply some sort of weighting. You can take a look at &lt;a href=&quot;http://www.investopedia.com/articles/fundamental/04/021104.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; to get a basic idea about this technique. &lt;/p&gt;&#xA;" OwnerUserId="19096" LastActivityDate="2017-03-28T04:31:14.310" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33297" PostTypeId="2" ParentId="33286" CreationDate="2017-03-28T07:57:52.000" Score="1" Body="&lt;p&gt;&lt;strong&gt;Short answer&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;He's basically making a parallel between a forward variance trade and a futures trade. In both cases you should have that the underlying quotes are martingales in the absence of arbitrage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Long(er) answer&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under the physical measure $\Bbb{P}$, an arbitrage is a (self-financing) trading strategy $V$ - or rather the value of a portfolio implementing this strategy - for which there exists a time $T &amp;gt; 0$ such that&#xA;$$ V_0=0,\,\, V_T \geq 0\,\, \Bbb{P}-\text{a.s. and } \Bbb{P}(V_T \ne 0) &amp;gt; 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose you define an &lt;strong&gt;equivalent&lt;/strong&gt; probability measure $\Bbb{Q}\equiv\Bbb{P}$. Since by definition, both measures agree on null events, our arbitrage definition translates to&#xA;$$ V_0=0,\,\, V_T \geq 0\,\, \Bbb{Q}-\text{a.s. and } \Bbb{Q}(V_T \ne 0) &amp;gt; 0 \tag{A}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice that if $\Bbb{Q}$ is further a &lt;strong&gt;martingale&lt;/strong&gt; measure, that is if $(V_t)_{t\geq0}$ emerges as a $\Bbb{Q}$-martingale:&#xA;$$ V_0 = \Bbb{E}_0^\Bbb{Q} [ V_T ] $$&#xA;then $(A)$ will never happen. This explains the central role of &lt;em&gt;equivalent martingale measures&lt;/em&gt; in arbitrage pricing theory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Putting that back into context, you've managed to identify a (self-financing) strategy (i.e. buying and selling forward variance swaps), which at no cost ($V_t=0$), allows you to earn a quantity $$V_{t'} = (T_2-T_1) \left( \hat{\sigma}_{VS,T_1T_2}^2(t') - \hat{\sigma}_{VS,T_1T_2}^2(t)\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on what we've said earlier, in the absence of arbitrage, there should exist a measure $\Bbb{Q} \equiv \Bbb{P}$ such that&#xA;$$ \Bbb{E}^\Bbb{Q}_{t}[V_{t'}] = V_t$$&#xA;hence, using the definitions of $V_t$ and $V_{t'}$,&#xA;$$ \Bbb{E}^\Bbb{Q}_{t}\left[ \hat{\sigma}_{VS,T_1T_2}^2(t') \right] = \hat{\sigma}_{VS,T_1T_2}^2(t) $$&#xA;hence forward variance swap quotes are martingales. Assuming a &lt;em&gt;continuous paths&lt;/em&gt; process (= in a &lt;em&gt;diffusive setting&lt;/em&gt;), by the &lt;strong&gt;martingale representation theorem&lt;/strong&gt; we should then have&#xA;$$ \hat{\sigma}_{VS,T_1T_2}^2(t) = ... dW_t^\Bbb{Q} $$&#xA;hence no pricing drift under $\Bbb{Q}$.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2017-03-29T07:48:38.697" LastActivityDate="2017-03-29T07:48:38.697" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="33298" PostTypeId="1" CreationDate="2017-03-28T09:54:20.033" Score="2" ViewCount="283" Body="&lt;p&gt;In the recent regulation (&lt;a href=&quot;https://www.esma.europa.eu/sites/default/files/library/jc_2016_21_final_draft_rts_priips_kid_report.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;link&lt;/a&gt; pag 31 point 12) is reported the VaR according to Cornish Fisher. Is this a real world measure?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By making computation I have seen that they assume an average return that is null. But this formula is still real world? Why?&lt;/p&gt;&#xA;" OwnerUserId="27194" LastActivityDate="2017-03-28T19:57:37.597" Title="Risk neutrality in the recent PRIIPs regulation" Tags="&lt;risk-neutral-measure&gt;&lt;var&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33299" PostTypeId="1" CreationDate="2017-03-28T11:01:14.640" Score="1" ViewCount="360" Body="&lt;p&gt;&lt;strong&gt;Disclosure: I have 0 background in economics, finance or any directly related field.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;I have been given multiple sets of supposedly daily tick data (I say supposedly because I could not tell if it wasn't), that I would like to simplify for analysis. I have spent the last couple of hours trying to squeeze the necessary information out of google, but what I found is either too high level or the data in the examples were already pre-filtered/-aggregated.&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;If possible I would like to simplify the dataset so that I get a relatively accurate representation of inter-day change in ask and bid price&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;The data I have currently looks like this (top rows of ~1.5 Million):&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/orZ8p.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/orZ8p.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;The results should, if possible, looks similar to this:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/1hlN3.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/1hlN3.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h1&gt;Thanks!&lt;/h1&gt;&#xA;&lt;p&gt;PS: The images are not from the same datasets or source, so they will not match (column names, volume, prices, etc.)&lt;/p&gt;&#xA;&lt;p&gt;PPS: I'm more than happy to provide additional information, if necessary.&lt;/p&gt;&#xA;" OwnerUserId="27195" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2017-03-28T15:22:02.337" Title="Aggregating/Simplifying Tick Data" Tags="&lt;tick-data&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="33300" PostTypeId="1" CreationDate="2017-03-28T11:33:01.667" Score="1" ViewCount="200" Body="&lt;p&gt;My apologies if this question might be better suited elsewhere, however it regards probability and mathematical finance, so I thought I would post it here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume a universe where Black-Scholes is valid and Alice wants to sell a basket of $X$ call options to Bob on $Y$ different stocks with weights given by the vector $W$, subject to $X&amp;gt;Y$ and that the sum of $W=1$. She is given a vector of strike prices $K$ which she is unable to change, additionally she is given a co-variance matrix $\Sigma$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If she wants to minimize the expected amount she has to pay at expiration to Bob by only changing the weights in the vector $W$ then how would you go about calculating this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My own take is that I would just use the Markowitz minimum variance portfolio, but I am actually unsure whether this would yield a valid result.&lt;/p&gt;&#xA;" OwnerUserId="27196" LastEditorUserId="27196" LastEditDate="2017-03-28T14:38:18.713" LastActivityDate="2017-03-28T14:47:51.657" Title="Minimum variance in a portfolio of call options" Tags="&lt;options&gt;&lt;variance&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33301" PostTypeId="1" CreationDate="2017-03-28T11:37:43.747" Score="1" ViewCount="100" Body="&lt;p&gt;Does anyone have an approximate idea how much Numerix CrossAsset (for excel) costs for a single user?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm interested in capabilities and coverage for IR/credit exotic/semi-exotic.&lt;/p&gt;&#xA;" OwnerUserId="26367" LastActivityDate="2017-03-28T11:37:43.747" Title="Numerix CrossAsset cost and coverage" Tags="&lt;software&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33303" PostTypeId="2" ParentId="33299" CreationDate="2017-03-28T13:05:00.423" Score="1" Body="&lt;p&gt;It is worthwhile to understand what the best bid/best ask are. They are prices at which people are ready to trade. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume that the present best bid and best ask are at 43.234 and 43.288 with a 100 lots at each level. Now a new buy order comes. A few things can happen:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Buy order price is less than the best bid, so this order doesnt change the best bid price or quantity.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Buy order price = the best bid price. In this case, you update the quantity. If the new order had 5 lots, the quantity changes to 105 lots and the best bid remains same&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;The new order price &gt; best bid*, so the new best bid becomes this order. Order price = the price of this order and order quantity = this orde quantity.&lt;/li&gt;&#xA;&lt;li&gt;If the order price in point 3 above is more than the best ask, then a trade happens. Now, the bid side of the book doesnt change but the best ask quantity reduces by a size equal to that of the incoming order.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You can use a similar logic for an incoming sell order.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;---Edit for the 4th point above---&lt;/p&gt;&#xA;&#xA;&lt;p&gt;there are two aspects &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;if there is not price specified in the order and the order has a large size. In this case, assume that there are only 1000 lots available to be sold, across the entire order book and the incoming buy order wants to buy 1100 lots. So the guy would buy 1000 lots and clear up the order book. What happens to the rest of the 100 lots is what is decided by the regulator/exchange. In my case, the exchange i trade on, the 100 lots would  become standing buy orders at the last trade price. If the incoming order size is less than the total quantity available in the order book, the entire order is filled at the respective prices at which sell orders were available. So is there were 100 lots to be sold at price x, x+1 and so no, the orders will be filled accordingly.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If the orders specified a price and a quantity where the quantity is larger than what is available at best ask. So assume that best bid is 100 and best ask is 101 both have 100 lots available. the level on the buy side has 50 lots with price of 102 and 50 lots with price of 104. The incoming order has a price of 103 and order size of 175. So this guy is ready to buy upto a max price of 103. So this guy would buy 100 lots at 101, 50 lots at 102 and the rest of his order would become a limit order at a price of 103 and size of 25. So L1 order book would look like: best bid at 103, qty at 25 and best ask at 104, qty at 50&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;@amdopt: thanks for pointing out the flaws. &lt;/p&gt;&#xA;" OwnerUserId="15428" LastEditorUserId="15428" LastEditDate="2017-03-28T13:51:59.640" LastActivityDate="2017-03-28T13:51:59.640" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33304" PostTypeId="2" ParentId="33300" CreationDate="2017-03-28T14:47:51.657" Score="3" Body="&lt;p&gt;You probably meant to specify that all $w_i&amp;gt;0$ and that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sum w_i=1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;otherwise it is tough to make sense of the question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The expected payout of any one of these options is given by the Black-Scholes formula.  The expectation of a sum is the sum of expectations, so we have that this expected payout is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\sum w_i BS(k_i, x_i, \Sigma)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where I am taking $x_i$ to be the $i^{th}$ stock chosen from $y_i$ and $k_i$ to be the strike.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is easy to see that this sum is minimized when we take the cheapest option at index $i_{\mathrm{min}}$, set &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$w_{i_{\mathrm{min}}}=1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and all other $w_i=0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Markowitz minimum variance portfolio will be quite different.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2017-03-28T14:47:51.657" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="33305" PostTypeId="1" CreationDate="2017-03-28T15:03:30.760" Score="1" ViewCount="1354" Body="&lt;p&gt;Suppose I have a swap contract to exchange 1 mio USD with 66.15 mio INR, 3 months later, current Spot is 65.04, how could I calculate the theta of this deal?&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2017-03-28T15:03:30.760" Title="how to calculate the theta of a swap?" Tags="&lt;swaps&gt;&lt;theta&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33306" PostTypeId="1" CreationDate="2017-03-28T15:06:03.640" Score="2" ViewCount="1136" Body="&lt;p&gt;how could I calculate the forward delta of of a cross currency swap?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose I have a swap contract to exchange 1 mio USD with 66.15 mio INR, 3 months later, current Spot is 65.04, how can i calculate the forward delta? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;pls be noted it's not about the spot delta.&lt;/p&gt;&#xA;" OwnerUserId="2161" LastActivityDate="2017-03-28T15:06:03.640" Title="how to calculate forward delta (not spot delta) of a swap?" Tags="&lt;swaps&gt;&lt;delta&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33307" PostTypeId="1" CreationDate="2017-03-28T15:45:57.340" Score="2" ViewCount="154" Body="&lt;p&gt;I am thinking of the cashflows structure of zero-coupon bonds. I am wondering whether they are usually issued below par or at par. It's more natural for me thinking that they are priced below par, but maybe I'm wrong.&#xA;Thank you in advance.&lt;/p&gt;&#xA;" OwnerUserId="22470" LastActivityDate="2017-04-27T21:20:38.430" Title="How are zero-coupon bonds issued?" Tags="&lt;zero-coupon&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33308" PostTypeId="2" ParentId="33307" CreationDate="2017-03-28T15:55:20.590" Score="1" Body="&lt;p&gt;There is only one cashflow for the zero-coupon bond. At maturity, it pays the par value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They are always issued below par, as the buyer is paying the NPV for the bond that matures in the future. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a brief reference at &lt;a href=&quot;http://www.investopedia.com/terms/z/zero-couponbond.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;Investopedia&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A zero-coupon bond, also known as an &quot;accrual bond,&quot; is a debt security that doesn't pay interest (a coupon) but is traded at a deep discount, rendering profit at maturity when the bond is redeemed for its full face value.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="343" LastActivityDate="2017-03-28T15:55:20.590" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33311" PostTypeId="2" ParentId="1489" CreationDate="2017-03-28T18:50:37.223" Score="3" Body="&lt;p&gt;I like the fast calibration versus slow calibration method which should suffice for your purposes. The slow calibration method calculates the implied vol and the Greeks in the usual way.  Then a fast calibration method can use the prior slow calculation's implied vol, delta, gamma and vega - we can assume rho/theta are zero over your timespan.  Then use the price from the slow calibration and this approximation ($P$ is for the option price, $S$ for the underlying, and $\nu$ for vega:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P_{t}\approx P_{t-1}+\Delta(S_t-S_{t-1})+0.5\Gamma(S_t-S_{t-1})^2+\nu(\sigma_t-\sigma_{t-1})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Everything you need is there to solve for $\sigma_t$ in the fast calibration.  Have the slow calibration run in the background and each time it completes, use it as the new benchmark for the fast calibration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is still a significant amount of technical work, but doable and almost certainly sufficient for the application.  You can probably omit the use of $\Gamma$ over such a short time step, but it is there if you want it.  Watch out for bid/ask anomalies too (i.e. pulling bid and putting them back can make the mid vols look like they move a lot when they don't really), but that goes for any method and not just this one.&lt;/p&gt;&#xA;" OwnerUserId="26977" LastEditorUserId="26977" LastEditDate="2017-03-28T22:34:45.957" LastActivityDate="2017-03-28T22:34:45.957" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33312" PostTypeId="2" ParentId="33298" CreationDate="2017-03-28T19:57:37.597" Score="1" Body="&lt;p&gt;Point 9. above seems to imply it's a real world measure based on 5 years worth of historical returns.&lt;/p&gt;&#xA;" OwnerUserId="27203" LastActivityDate="2017-03-28T19:57:37.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33313" PostTypeId="1" CreationDate="2017-03-28T20:24:57.083" Score="4" ViewCount="572" Body="&lt;p&gt;From what I have read, digital options are difficult to hedge near expiration because, around the strike, small moves in the underlying asset price can have very large effects on the value of option and the option delta. This means we would have to buy/sell large amounts of shares frequently to stay well hedged when using dynamic delta hedging.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that near expiration of the option it is better to use a static call-spread hedge.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;When is the best time to switch from dynamic hedging to a call-spread hedge? For example one example question I am reading asks &quot;would you build your call spread hedge the day prior to maturity&quot;?&lt;/li&gt;&#xA;&lt;li&gt;Is there anyway to prove that it is more beneficial to use static hedging near expiry?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="27186" LastActivityDate="2017-06-27T00:56:13.980" Title="Hedging digital calls" Tags="&lt;options&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33314" PostTypeId="2" ParentId="33307" CreationDate="2017-03-28T20:42:18.630" Score="1" Body="&lt;p&gt;If you have a negative yield which cannot be ruled out nowadays the issueprice will be above par.&lt;/p&gt;&#xA;" OwnerUserId="24192" LastActivityDate="2017-03-28T20:42:18.630" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="33315" PostTypeId="1" CreationDate="2017-03-28T20:47:58.330" Score="1" ViewCount="152" Body="&lt;p&gt;I am currently a senior in high school who has been tasked with writing a research paper on a math topic of our choice. I knew I wanted to research some sort of financial model but I was told most company models such as the DCF and CAPM were not advanced enough to research.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Que the Black-Scholes Option Pricing Equation. I started researching derivative equations and one of the most widely used models that I could find was the BS. I just have a couple questions regarding this model for anyone who has experience working with it.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;From my research I've gathered that the BS is used to find the appropriate price of a call premium, is this correct?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What do d1 and d2 represent in the equation, I believe I have found that d2 represents the risk-free rate of the option but I could use some clarity here.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;3.I have to set up a series of examples that apply the BS equation. I have read that the BS reflects the theoretical price of a call premium and not that practical one, would it be wrong to set up an example solving for the call premium using the BS, what other processes does this value have to go through to accurately reflect the market value of a call option?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've only been reading over this topic for a couple of days now but it is quite interesting and I apologize if I incorrectly used some of the terminology or do not fully have a grasp of this concept.&lt;/p&gt;&#xA;" OwnerUserId="27206" LastActivityDate="2017-03-29T02:27:58.373" Title="Help with a research paper on the Black-Scholes equation" Tags="&lt;black-scholes&gt;&lt;european-options&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2017-03-29T14:13:58.337" ContentLicense="CC BY-SA 3.0" />
  <row Id="33317" PostTypeId="1" AcceptedAnswerId="33319" CreationDate="2017-03-28T21:19:26.657" Score="3" ViewCount="68" Body="&lt;p&gt;Question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We suppose that the Toyota is traded in Tokyo in Japanese yen and represented by the price process $(S_t)$ t≥0, and in New York in US dollars and represented by the price process $(U_t)$ t≥0. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the sources of risk faced by an American investor who has bought the Toyota stock in New York at the price Ut?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My attempt:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Market Risk - Toyota share pricing falling&#xA;Systemic Risk - Collapse of entire financial system&#xA;Liquidity risk - Not being able to exit position&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just wanted to check that there is &lt;em&gt;not&lt;/em&gt; any FX risk here, as the US investor has bought $ donimated stock, so it is irrelevant that Toyota is also traded in Japanese markets in Yen.&lt;/p&gt;&#xA;" OwnerUserId="27186" LastActivityDate="2017-03-28T21:50:32.843" Title="Types of risk for stock investing" Tags="&lt;risk-management&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33318" PostTypeId="2" ParentId="33313" CreationDate="2017-03-28T21:29:24.020" Score="3" Body="&lt;p&gt;You theoretically could just trade the call spread at the beginning and more or less forget about it - theoretically.  In reality, what counterparty would be willing to trade a very tight call spread with you close to expiration?  Why would they want to take on the gamma risk you are trying to unload?  Maybe they are already loaded with gamma, so you maybe can come to them with the trade that will help them unload some gamma - but you might as well just try to trade out of your digital call and call it a day.  The pin risk around the money near expiration is something nobody wants.  Best bet is to call the bank you traded with and ask if they would like to take off the trade - they would probably love to get rid of that kind of toxic waste.  &lt;/p&gt;&#xA;" OwnerUserId="26977" LastActivityDate="2017-03-28T21:29:24.020" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33319" PostTypeId="2" ParentId="33317" CreationDate="2017-03-28T21:33:44.923" Score="4" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Just wanted to check that there is not any FX risk here, as the US&#xA;  investor has bought $ donimated stock, so it is irrelevant that Toyota&#xA;  is also traded in Japanese markets in Yen.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;An American investor stills has currency risk.  A simple way of thinking about it might be to consider what would happen if Toyota share price went up 1% but USD declined by 1% vs JPY.  The US ADR (American Depository Receipt--this is what is listed in the US and what the American investor buys in your example) will not move the same way as it's Tokyo traded counterpart would because of the currency fluctuation baked into the ADR.  On the flip side, if the American investor bought the ADR and the USD appreciated vs JPY the American investor could outperform the Japanese listed stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: After posting an answer I did a quick search of SE and saw that this question has already been asked and answered here as well: &lt;a href=&quot;https://money.stackexchange.com/questions/22309/am-i-exposed-to-currency-risk-when-i-invest-in-shares-of-a-foreign-company-that&quot;&gt;https://money.stackexchange.com/questions/22309/am-i-exposed-to-currency-risk-when-i-invest-in-shares-of-a-foreign-company-that&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26556" LastEditorUserId="-1" LastEditDate="2017-04-13T12:25:30.743" LastActivityDate="2017-03-28T21:50:32.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33321" PostTypeId="1" AcceptedAnswerId="33323" CreationDate="2017-03-28T23:09:34.657" Score="1" ViewCount="133" Body="&lt;p&gt;I am sorry in advance if this question seems a bit stupid but during my class my lecturer said that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&quot;The traditional estimator of the variance-covariance matrix is the sample covariance. However variance- covariance matrices computed in this way display poor out-of-sample performances, i.e. their predictive power regarding the future variances and covariances of stock returns is generally small.&quot;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you have any idea what may have led him to affirm that  ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for your help &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kindest Regards&lt;/p&gt;&#xA;" OwnerUserId="27208" LastActivityDate="2017-03-29T00:22:13.133" Title="Explanations regarding Minimum Variance Portfolio" Tags="&lt;modern-portfolio-theory&gt;&lt;covariance&gt;&lt;covariance-matrix&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33322" PostTypeId="2" ParentId="33321" CreationDate="2017-03-28T23:39:17.267" Score="0" Body="&lt;p&gt;Variance-Covariance matrices are too unstable - whatever happened last year will change going forward (correlations, volatilities, etc). It's better to use implied parameters (if available) to build the covariance matrix. And even so you may imply different parameters on different days, depending on market conditions.&lt;/p&gt;&#xA;" OwnerUserId="27080" LastActivityDate="2017-03-28T23:39:17.267" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33323" PostTypeId="2" ParentId="33321" CreationDate="2017-03-29T00:15:15.380" Score="2" Body="&lt;p&gt;Unless you have an infinite amount of data any estimator only provides an &quot;estimate&quot; (an approximate measurement) of any parameter (such as covariances).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the Markowitz Problem, the seriousness of the issue was realized as soon as 1974: Barry, C.B. &quot;Portfolio Analysis under Uncertain Means, Variances and &#xA;Covariances&quot;,Journal of Finance, 1974. The problem arises because the number of covariances to be estimated tends to be large compared to the number of observations available (for example with 500 stocks you have 125,250 covariances to be estimated, but since 1929 there have only been 1056 months of stock market data). As a result each element of the estimated matrix is highly uncertain (this can be shown theoretically as well as empirically).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Two somewhat more recent references on this problem are Broadie&#xA; “Computing Efficient Frontiers with Estimated Parameters”, &#xA;Annals of Operations Research, 1993 and Chopra and Ziemba &quot;The Effects of Errors in Means, Variances and Covariances on Optimal Portfolio Choice&quot;, &#xA;Journal of Portfolio Management, 1993. In a word, the effect is drastic, with very different optimal portfolios found if the inputs vary a plausible amount. A technique called the Resampled Frontier by Michaud can be used to illustrate the problem by solving the Markowitz problem over and over with the covariance matrix perturbed at random by a judicious amount.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Attempts have been made to come up with alternatives to the &quot;traditional estimator&quot;. The main one is the Bayes Stein estimator Jorion &quot;Bayes-Stein Estimation for Portfolio Analysis&quot;, Journal of Financial and Quantitative Analysis, September 1986. There are also Factor Models of the covariance. All these solutions attempt to impose some structure on the covariance matrix instead of attempting to estimate each entry independently.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition to this, there is also the problem mentioned by Eduardo that the covariance matrix may change due to changes in the economy. But the &quot;estmation problem&quot; for large covariance matrices is serious even in the absence of long term economic changes.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-03-29T00:22:13.133" LastActivityDate="2017-03-29T00:22:13.133" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33324" PostTypeId="2" ParentId="33315" CreationDate="2017-03-29T02:27:58.373" Score="0" Body="&lt;p&gt;1) If all the assumptions of Black-Scholes held in nature, then yes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2)The answer to this can be rather long, so I found someone who already wrote something about it.  It can be found at &lt;a href=&quot;https://financetrainingcourse.com/education/wp-content/uploads/2011/03/Understanding.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://financetrainingcourse.com/education/wp-content/uploads/2011/03/Understanding.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3)  Black-Scholes assumes log-normality.  This is not even remotely true.  It also assumes &lt;em&gt;infinite liquidity&lt;/em&gt;, that is the bid-ask spread is zero, always.  There is also an assumption that the markets are in equilibrium inherited from the Capital Asset Pricing Model from which it can be derived.  As such, when markets are not in equilibrium the model is silent about appropriate pricing.  In the immediate future, you need to solve for a risk-free rate, but it is quite possible that Congress will close the government next month due to an inability to decide on spending.  It is not impossible that it will default on the national debt.  You would need an alternate asset, one likely not denominated in dollars.  The only US companies with nearly risk-free status is Microsoft and Johnson &amp;amp; Johnson, but the debt has maturity risk and inflation risk because it is not immediately due.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2017-03-29T02:27:58.373" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33325" PostTypeId="1" CreationDate="2017-03-29T02:54:01.913" Score="2" ViewCount="390" Body="&lt;p&gt;Suppose once every 2-3 weeks I have a way to select a few equities that are likely to exhibit higher realized volatility in the future month (relative to the past month). Historically, the average realized vol relative increase on such selections is about 50%, and about 60-70% of the time the selection is correct (i.e. volatility indeed increases).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is nothing in the forecast about the future implied vol.; the current implied vol. (at the time when a selection is made) is typically somewhat less than the past 30 days historical vol. (stocks being selected are in an up-trend; the methodology anticipates either a strong reversal or some range-bound oscillations in advance, before they happen).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A long straddle would be one of the simplest strategies in this context; however, sometimes there are no dramatic price moves, and the onset of higher vol. happens over 2-3 weeks, making the straddles nearly worthless due to their theta-decay. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What other trading strategies utilizing listed options could help exploit this situation? The underlying equities have modest option interest, thus liquidity constraints are relevant.&lt;/p&gt;&#xA;" OwnerUserId="27209" LastEditorUserId="12" LastEditDate="2017-03-29T19:37:06.383" LastActivityDate="2017-03-29T19:37:06.383" Title="Trading strategies for increased realized volatility" Tags="&lt;options&gt;&lt;volatility&gt;&lt;quant-trading-strategies&gt;&lt;algorithmic-trading&gt;&lt;option-strategies&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33326" PostTypeId="1" AcceptedAnswerId="33329" CreationDate="2017-03-29T03:08:37.330" Score="1" ViewCount="1503" Body="&lt;p&gt;How do I compute VaR of a simple equity portfolio?  I know current weights and can easily access the history of the stocks' daily returns.&lt;/p&gt;&#xA;" OwnerUserId="27210" LastActivityDate="2017-03-29T06:08:33.980" Title="How to compute VaR of a simple equity portfolio?" Tags="&lt;equities&gt;&lt;portfolio-management&gt;&lt;var&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33327" PostTypeId="1" CreationDate="2017-03-29T03:08:43.353" Score="5" ViewCount="2592" Body="&lt;p&gt;I have been observing the data for US stock options. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, it seem like there are more open interest for call rather than for put, is there a reason people like to write more call? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;at the same time, some stocks have rather sharp ratio of put to call open interest (5:1 or 1:5), why would these happen? would market maker be rather exposed?&lt;/p&gt;&#xA;" OwnerUserId="25885" LastActivityDate="2017-03-29T13:10:26.820" Title="call vs put open interest" Tags="&lt;options&gt;&lt;equities&gt;&lt;open-interest&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33328" PostTypeId="2" ParentId="33327" CreationDate="2017-03-29T03:40:11.427" Score="-2" Body="&lt;p&gt;At the index levels, it would make sense having more calls than puts, however at these index levels it would also make sense to see higher put to call ratios lol its just sentiment imho&lt;/p&gt;&#xA;" OwnerUserId="13428" LastActivityDate="2017-03-29T03:40:11.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33329" PostTypeId="2" ParentId="33326" CreationDate="2017-03-29T05:16:02.030" Score="5" Body="&lt;p&gt;There are a few different ways to calculate VaR.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Historical Method&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;For this method, you calculate the return of your portfolio each day, and get a list of daily returns over your calibration period. Once you have this, then you find the 5th percentile to give the 95% VaR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The advantage of this method is that it is the most straightforward to compute, and you don't need to make any assumptions on the distribution of returns to make this calculation, and it can handle nonlinear assets.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Covariance Method&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;For this method, you assume returns are normally distributed. First compute the mean and covariance matrix of your assets, then using the weights of your portfolio you can compute the distribution of portfolio returns. Calculate the 5% point of the CDF to get the 95% VaR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The advantage of this method is that you can calculate a &quot;forward looking&quot; VaR by incorporating a different return/covariance matrix. Care must be taken to estimate the covariance matrix for this method.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Monte Carlo Simulation&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;For this method, you specify the stochastic process for your assets and run a bunch of simulations. The VaR is calculated based on all the sample paths.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be computationally expensive, but the good thing about this method is that you have complete freedom to define the underlying dynamics and it can handle nonlinear assets.&lt;/p&gt;&#xA;" OwnerUserId="5617" LastEditorUserId="5617" LastEditDate="2017-03-29T05:35:52.140" LastActivityDate="2017-03-29T05:35:52.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33332" PostTypeId="1" AcceptedAnswerId="33333" CreationDate="2017-03-29T09:03:02.460" Score="2" ViewCount="649" Body="&lt;p&gt;Not sure if this is the right place to ask such question.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;How close to 1 should the delta be in order for the product to be classified as delta one.&#xA;2.What examples of delta one products are there?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="6499" LastActivityDate="2017-03-29T09:17:10.543" Title="Example of delta one products" Tags="&lt;quant-trading-strategies&gt;&lt;hedging&gt;&lt;delta-hedging&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33333" PostTypeId="2" ParentId="33332" CreationDate="2017-03-29T09:17:10.543" Score="4" Body="&lt;p&gt;As indicated by the name, delta one products have a delta of exactly 1 (at least theoretically) with respect to the underlying; moreover, AFAIK the delta has to be constant, &lt;em&gt;i.e.&lt;/em&gt; a product with optionality that happens to have $\Delta = 1$ for some period won't be classified as delta one (otherwise it would be a nightmare for traders to manage their books!). Some products that come to mind are forwards, futures, &lt;a href=&quot;https://en.wikipedia.org/wiki/Exchange-traded_fund&quot; rel=&quot;nofollow noreferrer&quot;&gt;ETFs&lt;/a&gt;... You might want to take a look at &lt;a href=&quot;https://en.wikipedia.org/wiki/Delta_One&quot; rel=&quot;nofollow noreferrer&quot;&gt;Wikipedia's page&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="20454" LastActivityDate="2017-03-29T09:17:10.543" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33335" PostTypeId="1" CreationDate="2017-03-29T10:44:24.860" Score="-1" ViewCount="358" Body="&lt;p&gt;Pearson correlation coefficient based on OHLC data&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've found only this article &quot;Estimating correlation from high, low, opening and closing prices&quot; by L. C. G. Rogers and Fanyin Zhou (2007) &#xA;&lt;a href=&quot;http://www.skokholm.co.uk/wp-content/uploads/2013/02/RZdraft.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.skokholm.co.uk/wp-content/uploads/2013/02/RZdraft.pdf&lt;/a&gt; about the topic of question, so I would like to ask if there is standard approach of using OHLC data which incorporates high and low prices into estimation process ?&lt;/p&gt;&#xA;" OwnerUserId="2044" LastEditorUserId="16148" LastEditDate="2017-03-29T12:21:14.303" LastActivityDate="2017-07-29T03:25:56.407" Title="Pearson correlation coefficient based on OHLC data" Tags="&lt;correlation&gt;&lt;ohlc&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33339" PostTypeId="2" ParentId="19560" CreationDate="2017-03-29T12:31:55.413" Score="1" Body="&lt;p&gt;You can find Matlab code in these notes: &#xA;&lt;a href=&quot;http://cosweb1.fau.edu/~jmirelesjames/MatLabCode/Lecture_notes_2008d.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://cosweb1.fau.edu/~jmirelesjames/MatLabCode/Lecture_notes_2008d.pdf&lt;/a&gt;&#xA;I wrote them 10 years ago and have not revisited since, but it should work. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2017-03-29T12:31:55.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33340" PostTypeId="2" ParentId="33327" CreationDate="2017-03-29T13:10:26.820" Score="4" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;In general, it seem like there are more open interest for call rather&#xA;  than for put, is there a reason people like to write more call?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In general, it is easier for most people to justify a bet on something going up rather than going down when talking about stocks and/or the stock market.  Investor psychology is a very broad subject and there is plenty of information that can be found on the basics of it with a simple google search.  While money can be made using puts in an uptrend almost as easily as calls, this is not something that is considered by most looking to make such a bet.  For this reason, more call option contracts are traded and held onto (Open Interest) more than puts.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;at the same time, some stocks have rather sharp ratio of put to call&#xA;  open interest (5:1 or 1:5), why would these happen? would market maker&#xA;  be rather exposed?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;A high ratio of Call OI to Put OI (or vice versa) won't tell you a whole lot.  You might consider it a measure of liquidity especially if you are looking to do some gamma trading close to expiration.  The high OI strikes will likely (but not always, per my example) have decent volume due to people adjusting positions to avoid pin risk.  An excessively high ratio could occur for a number of reasons.  I'll give one example:  Suppose I had a 1M share equity position in a stock that only averages 1M shares traded per day and I know I have to get out of it by Friday's close and I also know that I want to hold onto it for as long as I can.  I could (1) sell calls that are in the money to try to pick up a few cents of premium with the intention of allowing them to get exercised and thus selling my stock or (2) buy puts that are deep in the money and exercising them at Friday's close to get rid of my stock (I would buy them deep in the money to avoid purchasing any Theta).  If the call:put OI ratio was fairly even before that, it will be quite skewed afterwards because of my new position but this won't necessarily translate into a higher amount of liquidity or volume for that strike into expiry.  It will actually be stagnant and meaningless because of my intention to not trade them further and take them into expiry for other purposes.  Long story short: it's very tough to get info from this data that consistently means something.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a market maker, the large OI ratio is meaningless.   When a market maker takes the other side of a call trade they don't necessarily hedge with opposing puts.  It might be much easier to continuously hedge their (always changing) inventory with the underlying equity or an equity swap.  &lt;/p&gt;&#xA;" OwnerUserId="26556" LastActivityDate="2017-03-29T13:10:26.820" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33343" PostTypeId="1" CreationDate="2017-03-29T15:07:21.253" Score="0" ViewCount="194" Body="&lt;p&gt;I understand the basic workflow of MBS, such as securitization, and.etc. &#xA;I was wondering the following things:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The relationship between agency product, securities, and pools:&#xA;Is ONE security exactly backed by ONE underlying pool? How are securities combined together to become a product, such as “FNM30”,”FHL30”.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Approximately how many pools are there from agencies such as Fannie Mae, Freddie Mac, Ginnie Mae, and FHLC?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="27219" LastEditorUserId="848" LastEditDate="2017-03-31T13:00:59.273" LastActivityDate="2020-09-21T19:48:23.017" Title="General Mortgage Backed Securities" Tags="&lt;fixed-income&gt;&lt;mbs&gt;&lt;abs&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33344" PostTypeId="2" ParentId="32672" CreationDate="2017-03-29T16:47:07.927" Score="2" Body="&lt;p&gt;[Your] analysis is correct. The long trade is worth 100 - 100/FX, and the short trade is worth 100/FX -100, where FX=ending EURUSD exchange rate. The first expression has unlimited downside as FX -&gt; 0, and the second expression is always &gt; -100. ––– dm63 Feb 25, 2017 at 12:52 &lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-03-29T16:47:07.927" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33345" PostTypeId="1" CreationDate="2017-03-29T18:58:39.697" Score="1" ViewCount="214" Body="&lt;p&gt;Assume it to be true that $dS = S\mu dt + \sigma(t)S dW$&#xA;where $\sigma$(t) is known.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a call option with expiry $T$, currently $t = 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For all $t \in [0,T]$, $\sigma(t) &amp;lt; \sigma_{impv}$ where $\sigma_{impv}$ is the implied volatility used to price the option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do we arbitrage? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first thoughts were to go short gamma, since realized volatility is less than implied volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there another way?&lt;/p&gt;&#xA;" OwnerUserId="27222" LastActivityDate="2017-03-29T18:58:39.697" Title="How would you arbitrage this?" Tags="&lt;volatility&gt;&lt;arbitrage&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33346" PostTypeId="1" CreationDate="2017-03-29T21:34:23.117" Score="3" ViewCount="187" Body="&lt;p&gt;I am trying to reconstruct the limit order book from the NASDAQ Historical TotalView -ITCH data. After I decode the raw data, I can successfully generate whole messages flow from ITCH data. However,in the messages flow there are some limit price buy order which has bid price higher than the current best ask price on the LOB, same as the limit price sell order which has ask price lower than the current best bid price. I just wondering how can I deal with this type of messages during the reconstructing LOB, since if I just directly update these limit orders, in the LOB the best bid price will be higher than the best ask price which doesn't make any sense to me. I find online, these type of the messages seems are market price order. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now I only consider messages with type: T,S,A,F,E,C,X,D,U,P &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you so much&lt;/p&gt;&#xA;" OwnerUserId="27225" LastActivityDate="2017-03-29T21:34:23.117" Title="reconstruct LOB from NASDAQ ITCH -how to handle market price order" Tags="&lt;quant-trading-strategies&gt;&lt;nasdaq&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33349" PostTypeId="2" ParentId="11103" CreationDate="2017-03-29T23:00:03.670" Score="1" Body="&lt;p&gt;Not as much on origin of this, but some analogy that I find helpful:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Call&lt;/strong&gt; - think of an open auction when bidders call out their prices for an auctioned item. So with a call option you've got a privilege to &lt;em&gt;call the strike price&lt;/em&gt;, effectively having a right &lt;strong&gt;to buy&lt;/strong&gt; the underlying asset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Put&lt;/strong&gt; - think that you own a privilege to &lt;em&gt;put the asset for sale at the strike price&lt;/em&gt;, effectively having a right &lt;strong&gt;to sell&lt;/strong&gt; the underlying asset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mind that for an option buyer this is optional to exercise it, yet for the option writer it's an &lt;strong&gt;obligation&lt;/strong&gt; to transact, should the buyer opt to exercise it.&lt;/p&gt;&#xA;" OwnerUserId="27228" LastActivityDate="2017-03-29T23:00:03.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33350" PostTypeId="1" AcceptedAnswerId="33352" CreationDate="2017-03-29T23:09:36.270" Score="0" ViewCount="169" Body="&lt;p&gt;For a simple equity portfolio, I need to compute historical 1-year simulation VaR with a &quot;1-month horizon&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I imagine this means I need to compute the 1-month return of the portfolio at each point in my 1-year history, eg. what is the 1-month return on the 1st of January, on the 2nd of January, on the 3rd, 4th, etc.  Is that correct?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And if yes, does it make sense to use a 22-day horizon to eliminate any silly biases such as some months having more work days than others?  &lt;em&gt;(I get the 22-day window because there are roughly 260 business days in a year, divide that by 12 to get roughly 22)&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="27210" LastActivityDate="2017-03-30T00:44:59.637" Title="What does &quot;1-month horizon&quot; mean in VaR calculations" Tags="&lt;portfolio-management&gt;&lt;var&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33352" PostTypeId="2" ParentId="33350" CreationDate="2017-03-30T00:44:59.637" Score="1" Body="&lt;p&gt;yes it is correct and yes it makes sense and is fairly standard to use 22 days for &quot;1 month&quot;.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-03-30T00:44:59.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33353" PostTypeId="1" AcceptedAnswerId="33354" CreationDate="2017-03-30T02:07:12.710" Score="0" ViewCount="556" Body="&lt;p&gt;I have a question regarding the BS 1976 formula for futures options. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.glynholton.com/notes/black_1976/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.glynholton.com/notes/black_1976/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I deal with dividends under this model, assuming that the dividend yield is continously compunded? Background is that I want to model the implied volatility of options on index futures given a deterministic continously compounded dividend yield! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much in advance, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best regards,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;John&lt;/p&gt;&#xA;" OwnerUserId="27230" LastActivityDate="2017-03-30T04:57:04.283" Title="Dividend yield under Black 1976 formula for futures options?" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;finance&gt;&lt;futures&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33354" PostTypeId="2" ParentId="33353" CreationDate="2017-03-30T04:57:04.283" Score="3" Body="&lt;p&gt;For most index futures I am familiar with (for example S&amp;amp;P 500 futures) the holder of the future does NOT receive the dividends. The interest rate $r$ and the dividend rate $d$ on the cash index determine the relationship between the future $F$ and the spot $S$ (i.e. $F= S e^{(r-d)T}$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Black 1976 formula for options on futures is based on F, the observable future price, and since the future does not receive the dividend there is no need for a dividend adjustment in that formula.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-03-30T04:57:04.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33355" PostTypeId="1" CreationDate="2017-03-30T06:17:19.473" Score="-1" ViewCount="153" Body="&lt;p&gt;I need to compute a covariance matrix using three years of stock returns from a portfolio which has a couple of stocks with only one or two years of history (being relatively new stocks).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should I replace the missing data with zeroes, or should I omit the offending stocks from my VaR calc?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;edit: I'm interested in knowing how other quants deal with this common occurrence.  To put it in context, I'm the sole quant at an old-school, long-only stock-picking firm.  I like to keep risk metrics like VaR simple enough to explain to my bosses, but they still need to be correct.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="27210" LastEditorUserId="27210" LastEditDate="2017-03-30T22:15:18.097" LastActivityDate="2017-04-25T05:03:36.890" Title="Covariance matrix for VaR: what to do with missing data?" Tags="&lt;portfolio-management&gt;&lt;var&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33360" PostTypeId="1" CreationDate="2017-03-30T13:01:59.257" Score="-2" ViewCount="2626" Body="&lt;p&gt;I recently read this from a book:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The canonical SDE in financial math, the geometric Brownian motion, &#xA;  ${{d{S_t}} \over {{S_t}}} = \mu dt + \sigma d{W_t}$ has solution&#xA;  $${S_t} = {S_0}{e^{(\mu  - {1 \over 2}{\sigma ^2})t + \sigma {W_t}}}$$&#xA;  which is always positive. Again verify with Ito's lemma. Also try&#xA;  Ito's lemma on log $(S_{t})$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and was curious about what would it look like if you tried Itos lemma on log (St)?&lt;/p&gt;&#xA;" OwnerUserId="27241" LastEditorUserId="27241" LastEditDate="2017-03-30T13:14:52.133" LastActivityDate="2017-03-30T13:23:31.387" Title="On the application of Itos lemma to Geometric Brownian motion" Tags="&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2017-04-03T16:43:20.613" ContentLicense="CC BY-SA 3.0" />
  <row Id="33361" PostTypeId="2" ParentId="33360" CreationDate="2017-03-30T13:23:31.387" Score="4" Body="&lt;p&gt;We have that&#xA;\begin{equation} dS_t=\mu S_t dt + \sigma S_t dW_t \end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now apply Itô&#xA;$$ d\log S_t= \frac{\partial\log S_t}{\partial t} +\frac{\partial \log S_t}{\partial S_t} dS_t + \frac12 \frac{\partial^2 \log S_t}{\partial S_t^2}d\langle S_t,S_t\rangle $$&#xA;We have that $\frac{\partial\log S_t}{\partial t}=0$ because the function $f(S_t,t)=\log S_t$ doesn't directly depend on $t$. Moreover, since $\frac{d}{dx} \log x=\frac{1}{x}$ and  $\frac{d^2}{dx^2} \log x=-\frac{1}{x^2}$, we obtain the following formula:&#xA;$$ d\log S_t= \frac{1}{S_t} dS_t  -\frac12 \frac{1}{S_t^2}d\langle S_t,S_t\rangle $$&#xA;Just use the fact that the quadratic variation of $S_t$ is simply $\langle S_t,S_t\rangle =\sigma^2 S_t^2$ and the first equation to obtain:&#xA;$$d \log S_t = \left(\mu -\frac{\sigma^2}{2}\right) dt +\sigma dW_t $$&#xA;Integrate and obtain &#xA;$$\log S_t = \log  S_0 + (\mu-\frac12 \sigma^2)t +\sigma W_t$$&#xA;If you apply Itô's lemma you get back to the previous point.&#xA;If you use the exponential you finally have your result:&#xA;$$S_t=S_0 e^{(\mu-\frac12 \sigma^2)t +\sigma W_t}$$&#xA;Tadaaa&lt;/p&gt;&#xA;" OwnerUserId="26657" LastActivityDate="2017-03-30T13:23:31.387" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33364" PostTypeId="1" AcceptedAnswerId="33367" CreationDate="2017-03-30T15:35:29.607" Score="-1" ViewCount="739" Body="&lt;p&gt;I need to compare (get correlation between) different financial instruments (stocks).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The problem is that different stocks will have different price scales.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was thinking of using &lt;strong&gt;z-score standardization&lt;/strong&gt; on my price time series vectors $\boldsymbol{x_{j}}$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\boldsymbol{x_{j}'} = \frac{\boldsymbol{x_{j}} - \bar{\boldsymbol{x_{j}}}}{\sigma} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now a paper I read uses natural &lt;strong&gt;log standardization&lt;/strong&gt; to achieve the same goal:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\boldsymbol{x_{j}''} = ln(\boldsymbol{x_{j}})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is one approach correct and the other incorrect; are both usable, if so which one is preferred and what are the nuances?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Additional info based on answers and comments:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Let me add some context where this is coming from (more of a statistics / machine learning perspective). I want to do classification of different equity markets. Standardisation is a &quot;standard&quot; part of data pre-processing for forecasting or clustering (this is a clustering problem). And I am guessing if I were to use things like expected return and volatility AND Euclidean distance as my measure, it would make sense. However, I have chosen to use correlation as my distance measure. And this is where the question arises. I do not understand why, statistically I should use returns. I can kind of see how z-score is already incorporated into correlation (rather than covariance), although not 100%, not quite sure about log transformation. Since I am doing correlation I am measuring by default the linear relationship; I thought there would be no difference in the linear relationship between X and Y or ln(X) and ln(Y), it just makes sure the scales are the same. But then again the scales do not matter here since we are &quot;standardizing&quot; in the denominator of the correlation equation. Here is the &lt;a href=&quot;http://www.diva-portal.org/smash/get/diva2:196577/FULLTEXT01.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;link&lt;/a&gt; to the paper that used ln(price).&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="11655" LastEditorUserId="11655" LastEditDate="2017-03-31T09:07:36.367" LastActivityDate="2017-03-31T09:07:36.367" Title="z-score versus log standardisation of stock prices for calculating correlation; which to use (in ML clustering, distance measure)?" Tags="&lt;time-series&gt;&lt;correlation&gt;&lt;machine-learning&gt;&lt;log-returns&gt;&lt;cluster&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33365" PostTypeId="2" ParentId="33343" CreationDate="2017-03-30T15:53:17.647" Score="1" Body="&lt;p&gt;If by pool you mean the distinct list of loans on which the performance of the mortgage bond depends on, then yes. One underlying pool, a specific list of loans with specific characteristics at certain notionals, maps to one MBS bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On your second question, is really hard to answer, let's say many, with unique characteristics each one or different allocation of capital.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having said the above, please note that, say for a CLO, it is possible that different CLOs, managed by different managers, have potentially, similar pools. The reason is, that the notionals on leveraged loan deals (CLO undelyings) are very big (100mio+) and hence many manager could buy exposure to any particular loan or loans.&lt;/p&gt;&#xA;" OwnerUserId="13462" LastEditorUserId="13462" LastEditDate="2017-03-30T16:59:15.270" LastActivityDate="2017-03-30T16:59:15.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33367" PostTypeId="2" ParentId="33364" CreationDate="2017-03-30T16:17:09.473" Score="0" Body="&lt;p&gt;First let me say that correlation between two stocks is almost always taken in return space. First you would transform your price series to a return series and take the correlation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let me address your question about correlations in general. Note the formula for correlation:&#xA;$$&#xA;\rho_{XY} = \frac{E[(X-\mu_X)(Y-\mu_Y)]}{\sigma_X\sigma_Y}&#xA;$$&#xA;From this, you can see that correlation is a normalized value that is invariant to scaling/shifting of the inputs. So using your &quot;z-score standardization&quot; method, will actually give you the exact same correlations!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The log standardization will measure the linear relationship between the log transformed variables. You only want to do this if you think there should be a linear relationship between $\textrm{ln}(X)$ and $\textrm{ln}(Y)$.&lt;/p&gt;&#xA;" OwnerUserId="5617" LastActivityDate="2017-03-30T16:17:09.473" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33368" PostTypeId="1" CreationDate="2017-03-30T16:31:40.217" Score="4" ViewCount="1662" Body="&lt;p&gt;I recently read this from a book on mathematical finance&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The important example for finance the (unique) EMM for the geometric&#xA;  Brownian. Let $S_{t}$ be the price of an asset, $${{d{S_t}} \over&#xA; {{S_t}}} = \mu dt + \sigma d{W_t}$$ and let  $r \ge 0$ be the&#xA;  risk-free rate of interest. For the exponential martingale $${Z_t} =&#xA; \exp \left( { - {t \over 2}{{\left( {{{r - \mu } \over \sigma }}&#xA; \right)}^2} + {{r - \mu } \over \sigma }{W_t}} \right)$$ the process &#xA;   $W_t^Q \buildrel\textstyle.\over= {{\mu  - r} \over \sigma }t + {W_t}$&#xA;   is Q-brownian motion, and the price process satisfies, $${{d{S_t}}&#xA; \over {{S_t}}} = rdt + \sigma dW_t^Q$$ Hence, $${S_t} = {S_0}\exp&#xA; \left( {\left( {r - {1 \over 2}{\sigma ^2}} \right)t + \sigma W_t^Q}&#xA; \right)$$ and ${S_t}{e^{ - rt}}$  is a Q-martingale&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;but why is this so important , the result is just the solution to the ${{d{S_t}} \over {{S_t}}} = \mu dt + \sigma d{W_t}$?&lt;/p&gt;&#xA;" OwnerUserId="27241" LastActivityDate="2018-03-22T19:28:25.193" Title="Girsanov Theorem application to Geometric Brownian Motion" Tags="&lt;brownian-motion&gt;&lt;martingale&gt;&lt;girsanov&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33369" PostTypeId="2" ParentId="31057" CreationDate="2017-03-30T16:42:16.870" Score="1" Body="&lt;p&gt;Your broker will keep track of this information. Each order creates what is called a tax lot. &lt;a href=&quot;https://www.tdameritrade.com/education/taxes/cost-basis/understanding-cost-basis.page&quot; rel=&quot;nofollow noreferrer&quot;&gt;TD Ameritrade&lt;/a&gt; explains it as follows:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Each time you purchase a security, the new position is a distinct and&#xA;  separate tax lot — even if you already owned shares of the same&#xA;  security. (A tax lot is a record of a transaction and its tax&#xA;  implications, including the purchase date and number of shares.)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;A tax lot identification method is the way we determine which tax lots&#xA;  are to be sold when you have a position consisting of multiple&#xA;  purchases made on different dates at differing prices, and you enter a&#xA;  trade to sell only part of the position.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;When you sell or cover, you are actually doing so on specific tax lots. Generally FIFO is used (so you are operating on the oldest lots), but you can specify specific lots if you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whether you need to care about this is highly dependent on your strategy. This does have tax implications, for example whether your profits are taxed as long-term or short-term capital gains. This information is also needed to calculate things like cost basis and realized/unrealized P&amp;amp;L.&lt;/p&gt;&#xA;" OwnerUserId="5617" LastEditorUserId="5617" LastEditDate="2017-03-30T16:50:14.703" LastActivityDate="2017-03-30T16:50:14.703" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33370" PostTypeId="2" ParentId="33368" CreationDate="2017-03-30T16:44:47.610" Score="3" Body="&lt;p&gt;Denote $B_t=e^{rt}$ the discount factor. Requiring $S_t/B_t$ to be a martingale it would mean the equation $S_0/B_0=E[S_t/B_t]$ hold. Therefore we can calculate the price of an option by discounting the expectation value at the maturity. If $S_t/B_t$ is not a Q-martingale, then we cannot discount the expectation value, which make calculation of $S_0$ extremely difficult.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another thing to mention: it is not a solution to $dS_t/S_t=\mu*dt+\sigma*dW$. It is a solution to $dS_t/S_t=r*dt+\sigma*dW^Q$. The first dynamic doesn't satisfy risk-neutral-pricing assumption, namely no-arbitrage assumption. The second dynamic is the right dynamic for risk-neutral-pricing. That's why we need girsanov theorem to transform the dynamic.&lt;/p&gt;&#xA;" OwnerUserId="25867" LastEditorUserId="25867" LastEditDate="2017-03-31T08:24:54.580" LastActivityDate="2017-03-31T08:24:54.580" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33371" PostTypeId="1" CreationDate="2017-03-30T17:34:01.543" Score="5" ViewCount="2819" Body="&lt;p&gt;When we buy a call and continuously delta hedge using some implied volatility $\sigma_i$, what is the formula for our aggregate profit given that the actual realized volatility is $\sigma_r$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say $S_0 = 1000, \sigma_i = 0.25, \mu = 0.10$, and the call has expiry a year from now. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does the formula look like in terms of $\sigma_r$? What happens if $\sigma_r =0$? $&amp;gt; \sigma_i$? $&amp;lt; \sigma_i$?&lt;/p&gt;&#xA;" OwnerUserId="27246" LastActivityDate="2017-06-09T12:08:29.717" Title="Continuous delta hedge formula" Tags="&lt;volatility&gt;&lt;black-scholes&gt;&lt;implied-volatility&gt;&lt;hedging&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33372" PostTypeId="1" CreationDate="2017-03-30T18:09:08.323" Score="2" ViewCount="326" Body="&lt;p&gt;For one period, $dS/S$ is an estimate of realized volatility, which we can annualize by dividing with $\sqrt{\Delta t}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But.... why? How is $dS/S$ an estimate of &lt;strong&gt;volatility&lt;/strong&gt;? Volatility is, to me, how big the random fluctuations are. But if I have a stock price that goes 100, 110, 120, 130, 140, 150, 160, every day, then that's not a random fluctuation, and the volatility is &lt;strong&gt;0&lt;/strong&gt; .... yet, using above formula we get that the volatility is 0.1 for the first day. &lt;/p&gt;&#xA;" OwnerUserId="26148" LastActivityDate="2017-04-30T14:33:50.393" Title="Why is $dS/S$ an estimate of realized volatility?" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33373" PostTypeId="1" AcceptedAnswerId="33382" CreationDate="2017-03-30T18:39:42.837" Score="0" ViewCount="570" Body="&lt;p&gt;Question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Vasicek interest rate model:&#xA;$$dr_t = α(θ−r_t)dt + σdW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Price at time t of a 0-coupon bond maturing at T is given by:&#xA;$$dp(t,T) = α_{t,T} . p(t,T)d_t + β_{t,T} . p(t,T)dW_t$$&#xA;$$βt,T = −σB(t,T).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;T-forward price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ F_t = \frac{P_{t,S}}{P_{t,T}} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Show that the dynamics of the T-forward $F_t$ price with respect to the T-forward measure in the Vasicek model is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dF_t = σ (B(t,T)−B(t,S))F_tdW_t$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solution provided:&#xA;$$ d(\frac{P_{t,S}}{P_{t,T}}) = \frac{dP_{t,S}}{P_{t,T}} + P_{t,S} d(\frac{1}{P_{t,T}}) + (dP_{t,S})  d( \frac{1}{P_{t,T}} ) $$&#xA;$$= \frac{dP_{t,S}}{P_{t,T}} −P_{t,S}\frac{dP_{t,T}}{P^2_{t,T}} + (···)dt$$&#xA;$$= (β_{t,S} −β_{t,T}) \frac{P_{t,S}}{P_t}dW_t + (···)d_t. $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone explain how to obtain the first line of the solution please. Initially I thought you could just use the product rule here i.e $u (dv/dx) + v (dv/dy)$ but if I use that I don't get the first term $\frac{dP_{t,S}}{P_{t,T}}$&lt;/p&gt;&#xA;" OwnerUserId="27186" LastEditorUserId="27186" LastEditDate="2017-03-30T21:15:05.147" LastActivityDate="2017-03-31T08:35:20.053" Title="Forward pricing using Vasicek model" Tags="&lt;interest-rates&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33374" PostTypeId="2" ParentId="11103" CreationDate="2017-03-30T19:40:23.653" Score="0" Body="&lt;p&gt;My Hull textbook, &lt;em&gt;Options, Futures, and other derivatives&lt;/em&gt;, has no etymology for &lt;em&gt;call&lt;/em&gt; or &lt;em&gt;put&lt;/em&gt;. It introduces the topic with &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A &lt;em&gt;call option&lt;/em&gt; gives the holder of the option the right to buy an asset by a certain date for a certain price. (p. 194).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The sense of &lt;em&gt;call&lt;/em&gt; and &lt;em&gt;put&lt;/em&gt; may become clearer if one thinks of the writer of these options. Let's imagine an investor who owns 100 shares of XYZ and has written a call with a strike of \$50. And let's suppose that XYZ is at \$52 on expiration day. What happens?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;XYZ gets &lt;strong&gt;called away&lt;/strong&gt; from the investor at \$50. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;DEFINITION of 'Called Away': &#xA;  A term used to describe the elimination of a contract due to the obligation of delivery. This occurs if an option is exercised, if a redeemable bond is called before maturity or if a short position held in a security requires delivery. (&lt;a href=&quot;http://www.investopedia.com/terms/c/calledaway.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;Investopedia&lt;/a&gt;)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Let's further imagine an investor who has written a cash-covered put on stock ABC with a strike of \$25. And let's suppose that ABC falls to \$20.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ABC will be &lt;strong&gt;put&lt;/strong&gt; to the investor at \$25. (Sorry, no link for this use of &lt;em&gt;put&lt;/em&gt; as a verb. It's what I've heard AMEX traders use.)&lt;/p&gt;&#xA;" OwnerUserId="343" LastActivityDate="2017-03-30T19:40:23.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33375" PostTypeId="1" CreationDate="2017-03-30T22:34:56.393" Score="1" ViewCount="1477" Body="&lt;p&gt;I hope you can help me again. &#xA;It is clear how to simulate the GBM: &#xA;$S_{t_{k}}=S_{t_{k}}exp[(\mu-\frac{\sigma^2}{2})\Delta t_{k+1}+\sigma\sqrt{\Delta t_{k+1}}Z]$, where Z is a stand. norm. dis. RV. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By Girsanov define the BM: $\tilde{W}_t=W_t+\frac{\mu-r}{\sigma}t.$ The dynamic under Q is then given by $dS_t=S_trdt+S_t\sigma d\tilde{W}_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But how do I simulate S under the risk-neutral measure Q?&#xA;My idea is $S_{t_{k}}=S_{t_{k}}exp[(r-\frac{\sigma^2}{2})\Delta t_{k+1}+\sigma\sqrt{\Delta t_{k+1}}Z_1]$. But should I take a new RV $Z_1$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your help!&lt;/p&gt;&#xA;" OwnerUserId="26680" LastEditorUserId="26680" LastEditDate="2017-03-31T08:15:43.830" LastActivityDate="2017-03-31T08:15:43.830" Title="Simulation of the geometric Brownian motion under risk-neutral measure" Tags="&lt;brownian-motion&gt;&lt;risk-neutral-measure&gt;&lt;risk-neutral&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33376" PostTypeId="1" CreationDate="2017-03-31T00:41:28.043" Score="2" ViewCount="65" Body="&lt;p&gt;I am studying some gamma trading, and there's one thing I don't understand. On the option we are hedging, what should its expiry $T$ be, and for how long should we do the trade?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I mean is, is it normal to do the trade until expiry $T$, or do we usually only do it in the period $[0,t], t &amp;lt;&amp;lt;T$ and then at time $t$ we stop?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What should that decision be based on?&lt;/p&gt;&#xA;" OwnerUserId="27250" LastActivityDate="2017-03-31T00:41:28.043" Title="What should $T$ be when gamma trading?" Tags="&lt;gamma&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33377" PostTypeId="2" ParentId="33335" CreationDate="2017-03-31T01:05:08.013" Score="2" Body="&lt;p&gt;Given only OHLC information, with no timing information as when H and L occured in relation to one another, the covariance between any two assets is only defined for O and C since you know when these occurred in relation to one another. If you use H and L in a co-movement estimator, it must be assumed that H and L of any two assets occured simultaneously. This is a very weak assumption. Therefore, it seems inappropriate to estimate correlation using OHLC. However, it is possible to estimate variance more efficiently using OHLC data than the standard $C_{t}$ to $C_{t-1}$ method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to estimate variance using OHLC data, I highly recommend Yhang Zhang's (YZ) estimator for intraday variance. Please see: &lt;a href=&quot;https://quant.stackexchange.com/questions/27741/understanding-yang-zhang-volatility-estimator&quot;&gt;Understanding Yang-Zhang Volatility Estimator&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In numerous tests on simulated data, the YZ estimator converges to the actual variance process more efficiently than any other estimator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;${\displaystyle \rho _{XY}= \frac{\sigma_{X,Y}}{(\sigma _{X}\sigma _{Y})}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you could use YZ to estimate $\sigma_X$ and $\sigma_Y$. However, the correlation may no longer be bounded between $-1$ and $1$. Still, since we know that the realized variances are more likely to estimate the true variance, we can constrain  the covariance such that an estimator is bounded appropriately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, if its possible to determine when H and L happened in relation to one another, you could use the YZ framework to develop a co-movement estimator than should also converge more efficiently than close-to-close estimators.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2017-03-31T01:05:08.013" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33378" PostTypeId="1" CreationDate="2017-03-31T02:05:44.027" Score="1" ViewCount="509" Body="&lt;p&gt;Let $dS/S = \sigma(S,t) dW$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let the local volatility be known, i.e, we know the formula $\sigma(S,t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I derive $\Delta$ of a regular call in this model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let BS be the Black Scholes price, and let $\sigma_{imp}$ be the implied volatility induced by above local volatility. Then, does $\sigma_{imp}$ depend on $S$ as well? &lt;/p&gt;&#xA;" OwnerUserId="27251" LastEditorUserId="2587" LastEditDate="2017-03-31T06:08:29.757" LastActivityDate="2017-03-31T06:08:29.757" Title="How to calculate Delta of an option in the Local Volatility model?" Tags="&lt;delta&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33380" PostTypeId="2" ParentId="33375" CreationDate="2017-03-31T07:38:26.137" Score="4" Body="&lt;p&gt;I suspect your expression of Gisanov has the wrong sign and should rather read:&#xA;$$ \tilde{W}_t = W_t + \frac{\mu-r}{\sigma} t $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equivalently, in differential form&#xA;$$ d\tilde{W}_t = dW_t + \frac{\mu-r}{\sigma} dt \tag{1} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Such that the dynamics under the physical measure&#xA;$$ \frac{dS_t}{S_t} = \mu dt + \sigma dW_t $$&#xA;becomes, under the risk-neutral measure&#xA;\begin{align}&#xA;\frac{dS_t}{S_t} &amp;amp;= \mu dt + \sigma (d\tilde{W}_t - \frac{\mu-r}{\sigma} dt) \tag{see (1)} \\&#xA;&amp;amp;= (\mu - \mu + r) dt + \sigma d\tilde{W}_t \\&#xA;&amp;amp;= r dt + \sigma d\tilde{W}_t&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The discretised version of $(1)$ is&#xA;\begin{align}&#xA;\Delta \tilde{W}_t &amp;amp;= \Delta W_t + \frac{\mu-r}{\sigma} \Delta \\&#xA;                   &amp;amp;= Z \sqrt{\Delta} t + \frac{\mu-r}{\sigma} \Delta &#xA;\end{align}&#xA;with $Z \sim N(0,1)$. So yes if you're looking at the same realisation $\omega \in \Omega$ you should use the same draw from the standard normal $Z$. If you're only looking at statistical properties then it does not matter as long as your draws $Z_i$ are i.i.d.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2017-03-31T07:38:26.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33381" PostTypeId="1" AcceptedAnswerId="33385" CreationDate="2017-03-31T08:25:31.160" Score="1" ViewCount="1343" Body="&lt;p&gt;One of the applications of Principal Component Analysis in Finance is to analyse the shape of the yield curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what conclusions can be drawn exactly from performing this exercise? Does it help us to build a better yield curve? How are we able to better manage risk if we do it?&lt;/p&gt;&#xA;" OwnerUserId="13458" LastActivityDate="2017-03-31T12:45:14.750" Title="Applications of PCA to yield curve analysis" Tags="&lt;interest-rates&gt;&lt;yield-curve&gt;&lt;pca&gt;&lt;principal-components&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33382" PostTypeId="2" ParentId="33373" CreationDate="2017-03-31T08:35:20.053" Score="0" Body="&lt;p&gt;For the first line of the solution it's just Ito's lemma.&#xA;\begin{align} d f(X_t,Y_t,t)&amp;amp;= \frac{\partial }{\partial t} f(X_t,Y_t,t)dt+\frac{\partial }{\partial X_t} f(X_t,Y_t,t) dX_t +\frac{\partial }{\partial Y_t} f(X_t,Y_t,t) dY_t \\&#xA;&amp;amp;+\frac12 \frac{\partial^2 }{\partial X_t^2} f(X_t,Y_t,t) d\langle X_t,X_t\rangle+\frac12 \frac{\partial^2 }{\partial Y_t^2} f(X_t,Y_t,t) d\langle Y_t,Y_t\rangle\\&#xA;&amp;amp;+ \frac{\partial^2 }{\partial X_t\partial Y_t} f(X_t,Y_t,t) d\langle X_t,Y_t\rangle&#xA;\end{align}&#xA;In your case you have $X_t=P_{t,S}$ and $Y_t=\frac{1}{P_{t,T}}$ so that the first derivative of $f(X_t,Y_t,t)=X_tY_t$ in $t$ and second derivatives in $X_t$ or $Y_t$ are all 0. So you are left with the first line of the solution.&#xA;\begin{align}dX_tY_t&amp;amp;=Y_t dX_t + X_t dY_t +d\langle X_t,Y_t \rangle\\&#xA;&amp;amp;= \frac{1}{P_{t,T}}dP_{t,S}+P_{t,S}d\left(\frac{1}{P_{t,T}}\right)+d\langle P_{t,S},\frac{1}{P_{t,T}}\rangle \end{align}&#xA;By the way I suggest you go back to your stochastic calculus class notes because Ito's lemma is a must in quantitative finance.&lt;/p&gt;&#xA;" OwnerUserId="26657" LastActivityDate="2017-03-31T08:35:20.053" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33383" PostTypeId="2" ParentId="33372" CreationDate="2017-03-31T09:13:25.707" Score="0" Body="&lt;p&gt;The basic assumption behind this estimate is that the stock price has to be lognormally distributed:&#xA;$$dS_t/S_t=\mu dt+ \sigma dW_t$$&#xA;Therefore if you estimate the standard deviation of the time series you would get an estimate of $\sigma \sqrt{\Delta t}$, then to get the annualized volatility just divide by $\sqrt{\Delta t}$.&#xA;The problem of your stock is that the distribution is not lognormal. You have a process normally distributed :&#xA;$$dS_t=\mu dt+ \sigma dW_t$$&#xA;with $\sigma=0$ and $\mu=3650$ so that in one day you go up by 10.&#xA;However you have $$dS_t/S_t=1/S_t(\mu dt+ \sigma dW_t)$$&#xA;Therefore you cannot estimate volatility using $\Delta S_t/S_t$ but you should just use $\Delta S_t$ in this case.&lt;/p&gt;&#xA;" OwnerUserId="26657" LastActivityDate="2017-03-31T09:13:25.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33384" PostTypeId="1" CreationDate="2017-03-31T10:18:26.523" Score="1" ViewCount="13311" Body="&lt;p&gt;I understand that (interest payment)×(corporation tax) is the cash flow saving (assumed to go on in perpetuity) and it can be written as (debt)×(cost of debt capital)×(corporation tax). But why is it discounted with cost of debt capital? If it is a cash outflow saving on the whole operation of the company, why isn't is discounted with WACC?&lt;/p&gt;&#xA;" OwnerUserId="27257" LastActivityDate="2018-02-01T14:32:59.540" Title="Why is PV(tax shield) calculated using cost of debt capital for discounting?" Tags="&lt;present-value&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33385" PostTypeId="2" ParentId="33381" CreationDate="2017-03-31T12:45:14.750" Score="4" Body="&lt;p&gt;You can see my remark above for some more words on PCA for the yield curve and an interesting paper.&#xA;About the question whether it helps us to creat a risk model:&#xA;PCA on the yield curve changes (!) tells us:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;what are dominant moves (it turn out it is a pralell-shift, steepening and curvature change)? This gives us a picture and language to think and speak about yield curve changes. Recall those structured products that were sold before 2008 and mabye some still are sold: steepeners and such.&lt;/li&gt;&#xA;&lt;li&gt;this moves are uncorrelated. Thus is makes sense to think of the current yield curve and then of scenarios when uncorrelated changes act on it. You might want to have this invariant element in your model.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;These are the main points: uncorrelated shape changes.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2017-03-31T12:45:14.750" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33388" PostTypeId="2" ParentId="33384" CreationDate="2017-03-31T14:06:47.250" Score="2" Body="&lt;p&gt;We are comparing two situations: (1) an all equity firm, versus (2) the same firm which has decided to do a predefined amount of borrowing. Because the tax shields arise as a result of the borrowing decision (i.e. they are a potential advantage of borrowing) they are discounted at the borrowing rate. It is treated almost as a separate project: to borrow money for the purpose of saving on future taxes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Note: here we are assuming a firm with flexibility about whether it borrows or not and on what time frame. In the case of a highly indebted LBO, where the repayment schedule of the debt depends on the future earnings of the firm, it may make more sense to discount the tax shields at the WACC of the whole firm. See &lt;a href=&quot;http://finance.wharton.upenn.edu/~acmack/Chapter_17_app.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;The APV approach to Leveraged Buyouts&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-03-31T16:44:12.210" LastActivityDate="2017-03-31T16:44:12.210" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33393" PostTypeId="1" CreationDate="2017-03-31T21:35:40.560" Score="0" ViewCount="102" Body="&lt;p&gt;I apologize if this isn't the correct place to post this. I'm not quite sure where else I should post on stackexchange. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to preface this by saying I'm not actually planning on trading. This is more of a thought experiment carried out in my own free time. I have a very basic trend-following model that looks at several technical indicators. The model returns signals that indicate whether to take a long (1) or short position (-1). I'm interested in calculating some sort of simple win% to see how many times this model has potentially made a good trade signal. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not quite sure how to go about this. For instance, I have something like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   Position    High    Low   Close     Open&#xA;   `1           3.375   3.3545  3.375   3.355   3.3985&#xA;&#xA;   0&#xA;   0&#xA;   0&#xA;   1          3.4075    3.3935  3.397   3.4065  3.4134&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Would I then look at prices (3.375 close) at the first signal and prices when at the signal changed (3.3935 close)? Since prices increase on a long signal, then this would count as a win. Let's call this $W_1$. If I repeated the same calculation throughout my series and got the number of wins $\sum_{i=1}^{n} W_i$, would it then make sense to divide this by number of long signals to get a win% $\frac{\sum_{i=1}^{n} W_i}{\text{# long signals}} $. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems a little silly and naive to me, so I'm open to feedback!&lt;/p&gt;&#xA;" OwnerUserId="22135" LastActivityDate="2017-03-31T21:35:40.560" Title="Calculating basic win% of simple trend-following strategy?" Tags="&lt;algorithmic-trading&gt;&lt;strategy&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="33394" PostTypeId="1" AcceptedAnswerId="33461" CreationDate="2017-03-31T22:04:51.920" Score="2" ViewCount="286" Body="&lt;p&gt;&lt;strong&gt;Background Information:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The crude Monte Carlo algorithm for the arithmetic Asian call option is $$Y = e^{-rT}(\overline{S}_A - K)^{+}$$ and the control is $$C e^{-rT}(\overline{S}_G - K)^{+}$$&#xA;The control variate estimator is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;Y(\beta) &amp;amp;= Y - \beta(C - \mu_C)\\&#xA;&amp;amp;= e^{-rT}(\overline{S}_A - K)^{+} - \beta(e^{-rT}(\overline{S}_G - K)^{+} - \mathbb{E}[C])&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We estimate $\mathbb{E}[Y(\beta)]$ using the sample mean $$\frac{1}{N}\sum Y_i - \hat{\beta}_N^{*}(C_i - \mathbb{E}[C])$$ where $$\hat{\beta}_N^{*} = \frac{\sum_{i=1}^{n}(Y_i - \overline{Y})(C_i - \overline{C})}{\sum_{i=1}^{n}(C_i - \overline{C})^{2}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Arithmetic Asain option with discrete monitoring have payoff functions &#xA;\begin{align*}&#xA;\text{call payoff} &amp;amp;: \ (\overline{S}_A - K)^{+}\\&#xA;\text{put payoff} &amp;amp;: \ (K - \overline{S}_A)^{+}&#xA;\end{align*}&#xA;where $$\overline{S}_A = \frac{1}{n}\sum_{i=1}^{n}S(t_i)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Geometric Asain options have the same payoff functions but the arithmetic Asain options have the same payoff function but the arithmetic average $\overline{S}_A$ is replaced by the geometric average $$\overline{S}_G = \left(\prod_{i=1}^{n}S(t_i)\right)^{1/n}$$&#xA;The stock price model is the GBM model:&#xA;$$S(t_i) = S(0)\exp((r-\sigma^2/2)t_i + \sigma W(t_i))$$&#xA;where $W(t)$ is the standard Brownian motion on $[0,T]$. Multiplying the GBM model as $i = 1,\ldots,n$ we obtain $$\overline{S}_G = \left(\prod_{i=1}^{n}S(t_i)\right)^{1/n} = S(0)\exp\left(\left(r - \frac{\sigma^2}{2}\right)\left(\frac{1}{n}\sum_{i=1}^{n}t_i\right) + \frac{\sigma}{n}\sum_{i=1}^{n}W(t_i)\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Consider an Asain arithmetic call option with $K = 100$, $r = 0.2$, $S_0 = 100$, $\sigma = 0.4$, using the lognormal model for the underlying stock process. Let the expiry $T = 0.1$ with $n = 10$ prices in the average. Generate $40$ estimates for the option price, using $N = 100,1000,10000$ price paths, with crude Monte Carlo.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My question in regards to this problem is the following. I know that when I generate my time vector $t$ it is going to be of size $10$. Now, my confusion is in regards to the stock price model $$S(t_i) = S(0)\exp((r-\sigma^2/2)t_i + \sigma W(t_i))$$&#xA;What is the size $S(t_i)$? We want to generate $N = 100,1000,10000$ price paths but my time vector $t$ is only of size $10$ so what will be the size of $S(t_i)$? I have the same question for $W(t_i)$. Any suggestions on the following are greatly appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe that the size of $S(t_i)$ and $W(t_i)$ will be of size $10$ but I do not understand how we will generate the $N$ paths size the size of $N$ is much larger than $10$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The lognormal model is $$S(t_n) = S(0)\exp\left((r-\sigma^2/2)t_n \sigma\sqrt{t_n}Z\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure how to still to generate this because of what size I need to set $Z$, etc...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the code I have done so far, it would be great if someone can just tell me how I generate the $40$ estimates for the option price using $N = 100,1000,10000$ price paths.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;// Create time vector&#xA;VectorXd tt = time_vector(0.0,T,n);&#xA;VectorXd t(n);&#xA;for(int i = 0; i &amp;lt; n; i++){&#xA;        t(i) = tt(i+1);&#xA;}&#xA;&#xA;// Generate standard normal Z matrix&#xA;MatrixXd Z = generateGaussianNoise(N,n);&#xA;&#xA;// Generate N paths of stock prices&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is my complete code, I was able to figure it out myself:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#include &amp;lt;iostream&amp;gt;&#xA;#include &amp;lt;cmath&amp;gt;&#xA;#include &amp;lt;math.h&amp;gt;&#xA;#include &amp;lt;Eigen/Dense&amp;gt;&#xA;#include &amp;lt;Eigen/Geometry&amp;gt;&#xA;#include &amp;lt;random&amp;gt;&#xA;#include &amp;lt;time.h&amp;gt;&#xA;&#xA;using namespace Eigen;&#xA;using namespace std;&#xA;&#xA;void crudeMonteCarlo(int N,double K, double r, double S0, double sigma, double T, int n);&#xA;VectorXd time_vector(double min, double max, int n);&#xA;&#xA;int main(){&#xA;    int N = 100;&#xA;    double K = 100;&#xA;    double r = 0.2;&#xA;    double S0 = 100;&#xA;    double sigma = 0.4;&#xA;    double T = 0.1;&#xA;    int n = 10;&#xA;&#xA;    crudeMonteCarlo(N,K,r,S0,sigma,T,n);&#xA;&#xA;    return 0;&#xA;}&#xA;&#xA;VectorXd time_vector(double min, double max, int n){&#xA;    VectorXd m(n + 1);&#xA;     double delta = (max-min)/n;&#xA;     for(int i = 0; i &amp;lt;= n; i++){&#xA;             m(i) = min + i*delta;&#xA;     }&#xA;    return m;&#xA;}&#xA;&#xA;MatrixXd generateGaussianNoise(int M, int N){&#xA;    MatrixXd Z(M,N);&#xA;    static random_device rd;&#xA;    static mt19937 e2(time(0));&#xA;    normal_distribution&amp;lt;double&amp;gt; dist(0.0, 1.0);&#xA;    for(int i = 0; i &amp;lt; M; i++){&#xA;        for(int j = 0; j &amp;lt; N; j++){&#xA;            Z(i,j) = dist(e2);&#xA;        }&#xA;    }&#xA;    return Z;&#xA;}&#xA;&#xA;void crudeMonteCarlo(int N,double K, double r, double S0, double sigma, double T, int n){&#xA;    // Create time vector&#xA;    VectorXd tt = time_vector(0.0,T,n);&#xA;    VectorXd t(n);&#xA;    double dt = T/n;&#xA;    for(int i = 0; i &amp;lt; n; i++){&#xA;            t(i) = tt(i+1);&#xA;    }&#xA;&#xA;    // Generate standard normal Z matrix&#xA;    //MatrixXd Z = generateGaussianNoise(N,n);&#xA;&#xA;    // Generate 40 estimates for the option price, using N paths&#xA;    int m = 40;&#xA;    MatrixXd SS(N,n+1);&#xA;    VectorXd S(m);&#xA;    for(int k = 0; k &amp;lt; m; k++){&#xA;        MatrixXd Z = generateGaussianNoise(N,n);&#xA;        for(int i = 0; i &amp;lt; N; i++){&#xA;            SS(i,0) = S0;&#xA;            for(int j = 1; j &amp;lt;= n; j++){&#xA;                SS(i,j) = SS(i,j-1)*exp((double) (r - pow(sigma,2.0))*dt + sigma*sqrt(dt)*(double)Z(i,j-1));&#xA;            }&#xA;        }&#xA;        S(k) = SS.mean();&#xA;    }&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="19002" LastEditDate="2017-04-03T22:23:43.270" LastActivityDate="2017-04-03T22:23:43.270" Title="Using crude Monte Carlo" Tags="&lt;programming&gt;&lt;monte-carlo&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;&lt;homework&gt;" AnswerCount="1" CommentCount="10" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33395" PostTypeId="1" CreationDate="2017-03-31T23:51:12.580" Score="0" ViewCount="164" Body="&lt;p&gt;In an article i recently read (The American Put Option and Its Critical Stock Price by David S. Bunch and Herb Johnson &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.555.9191&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;link&lt;/a&gt;) the authors presented this formula as something very general and as common knowledge&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$$P = \mathop {\max }\limits_{{S_c}} \int\limits_0^T {{e^{ - rt}}(X - S_c)} fdt,\quad (S &amp;gt; {S_C})$$  &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;where $P, r, T, X,$ and $Sc$ are the American put price, risk-free rate,&#xA;  time to maturity, exercise price, and critical stock price,&#xA;  respectively.Let S be the current stock price (at time $ t= 0).$ $f$,&#xA;  is the first-passage probability,&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However i cant recall that i have seen this formula AND $f$ in the same formula, what am I missing? Where did this formula come from?&lt;/p&gt;&#xA;" OwnerUserId="27241" LastEditorUserId="16160" LastEditDate="2017-04-01T02:31:31.847" LastActivityDate="2017-04-01T04:54:24.057" Title="First passage probability in american option pricing" Tags="&lt;probability&gt;&lt;american-options&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33397" PostTypeId="2" ParentId="33395" CreationDate="2017-04-01T03:32:35.763" Score="2" Body="&lt;p&gt;This is more or less the definition of the Critical Exercise Boundary in its relation to the put price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume $S_0(t)$ is an arbitrary exercise curve from 0 to T. Then $e^{-rt}(X-S_0)$ is the discounted payoff of exercising at time t. This is then multiplied by the probability of reaching $S_0$ for the first time at time t, which is f, to get an expected value. We integrate over all possible times from 0 to T to get the overall value of this exercise strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can try this again for another hypothesized exercise strategy $S_1(t)$, then $S_2(t)$ and so on, each time getting a different value of the integral. The best curve we call $S_c(t)$, i.e  the one which produces the largest value of this integral. This value is also the put price P.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words this equation describes the optimization process through which the critical exercise boundary is obtained: you have to select a curve, such that if you exercise the first time the curve is hit, you get the best possible value. (But of course it is more definitional than computational: it doesn't tell you how to find such an $S_c(t)$).&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2017-04-01T04:54:24.057" LastActivityDate="2017-04-01T04:54:24.057" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="33398" PostTypeId="1" CreationDate="2017-04-01T07:29:23.233" Score="-1" ViewCount="505" Body="&lt;p&gt;I was wondering if there's a rule of thumb regarding the value of alpha used when performing exponential smoothing. I plan to use this technique to preprocess my data before feeding them into my machine learning algorithm. &lt;/p&gt;&#xA;" OwnerUserId="27275" LastActivityDate="2017-10-28T20:48:46.547" Title="How to use exponential smoothing for trading?" Tags="&lt;time-series&gt;&lt;data&gt;&lt;quant-trading-strategies&gt;&lt;algorithmic-trading&gt;&lt;machine-learning&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33399" PostTypeId="1" AcceptedAnswerId="33477" CreationDate="2017-04-01T07:34:22.817" Score="1" ViewCount="694" Body="&lt;p&gt;Suppose that there are two currencies INR(domestic) and USD(foreign). Let the for exchange rate be S_inr. Using historical data, one can find out the volatility. For example, assume that, S_inr=60,σ=0.2,T=1,r_inr=0.1,r_usd=0 (the usual notation); I constructed the tree and found out Risk Neutral probability(RN1). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/KjwVC.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/KjwVC.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also constructed the tree from an American investor perspective and found out the Risk Neutral probability(RN2). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/cXTUG.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/cXTUG.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;RN1 and RN2 are not the same. I understand that it gives mathematically inconsistent trees when we use the same risk-neutral probability &quot;p&quot; for an American Investor and for an Indian Investor.  However, I fail to comprehend the following:&#xA;Why is that the risk neutral(RN) probabilities change depending on whether we consider an Indian or an American perspective? RN probability is simply the probability, as anticipated by a Risk Neutral investor, on whether the exchange rate moves in a certain way. In other words, it is the probability expected by an RN investor that the currency appreciates or depreciates. So, it should not matter whether we consider USD to INR or INR to USD. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am sure that there is something I am missing.&lt;/p&gt;&#xA;" OwnerUserId="27273" LastActivityDate="2017-04-10T10:22:56.370" Title="Risk neutral probabilities for foreign currency exchange rate" Tags="&lt;risk-neutral-measure&gt;&lt;binomial-tree&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33407" PostTypeId="2" ParentId="33399" CreationDate="2017-04-01T16:07:14.663" Score="1" Body="&lt;p&gt;The explanation that works for me is that what constitutes risk for a US investor (i.e. Making or losing money measured in dollars) is different from what constitutes risk for an Indian investor ( i.e. Making or losing money measured in INR).  Hence there is no paradox.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-04-01T16:07:14.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33411" PostTypeId="2" ParentId="24627" CreationDate="2017-04-01T19:27:53.467" Score="0" Body="&lt;p&gt;WACC formula: E/v * Re + D/V * Rd * (1-Tc)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First thing you have to calculate Cost of equity (Re) in the WACC formula above.&#xA;To calculate cost of equity you use CAPM formula = rf + Beta * (rm-rf).&lt;/p&gt;&#xA;" OwnerUserId="27264" LastActivityDate="2017-04-01T19:27:53.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33412" PostTypeId="1" AcceptedAnswerId="33431" CreationDate="2017-04-01T22:23:28.513" Score="2" ViewCount="420" Body="&lt;p&gt;From this book, &lt;a href=&quot;http://docs.finance.free.fr/Options/Exotic_Options_Trading.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://docs.finance.free.fr/Options/Exotic_Options_Trading.pdf&lt;/a&gt;, &#xA;it states that&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The gamma profile of a Max lookback option becomes intuitive when&#xA;  viewing it as a ladder option. Indeed, as long as the stock goes up there&#xA;  will be gamma on the lookback option and the gamma will decrease&#xA;  quickly when the stock goes down, as the options below have already&#xA;  knocked out and therefore have no gamma on them any more.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I just cannot see how this is intuitive nor why there will be gamma on the lookback option as long as the stock goes up. What I am missing here? I cant picture how this gamma would change with spot and time, moreover I could not be sure through this explanation above the curves would even be continuous.&lt;/p&gt;&#xA;" OwnerUserId="11723" LastEditorUserId="11723" LastEditDate="2017-04-01T22:35:29.450" LastActivityDate="2017-04-09T10:56:56.713" Title="Gamma of a Lookback Option" Tags="&lt;options&gt;&lt;volatility&gt;&lt;greeks&gt;&lt;exotics&gt;&lt;gamma&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33414" PostTypeId="1" CreationDate="2017-04-01T22:55:48.267" Score="0" ViewCount="43" Body="&lt;p&gt;I am looking at the following quotes of the futures prices of the S&amp;amp;P 500:&lt;br&gt;&#xA;         &lt;a href=&quot;http://finance.yahoo.com/q/fc?bypass=true&amp;amp;s=ESM16.CME&amp;amp;ltr=1&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://finance.yahoo.com/q/fc?bypass=true&amp;amp;s=ESM16.CME&amp;amp;ltr=1&lt;/a&gt;&lt;br&gt;&#xA;The way I read this, the market thinks that there will no increase in the S&amp;amp;P 500 for the next year. That does not seem right to me. Is there something I am missing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bob&lt;/p&gt;&#xA;" OwnerUserId="18353" LastActivityDate="2017-04-01T22:55:48.267" Title="Future Quotes on the S&amp;P 500 Index" Tags="&lt;portfolio-management&gt;&lt;futures&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33415" PostTypeId="1" CreationDate="2017-04-02T00:40:56.580" Score="2" ViewCount="8803" Body="&lt;p&gt;I'm very confused about the terms regarding libor curves in general.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When people talk about libor curve, I picture it as a curve with different libor maturities (i.e. 1 week, 1 month, 3-month and 6-month etc.). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I can't picture what a 3-month or 6-month libor curve look like, isn't that just a single value at that time? can someone please kindly explain?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And also when people talk about forecasting a libor, what do they mean? How is it connected with bootstrapping method?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks so much in advance for helping!&lt;/p&gt;&#xA;" OwnerUserId="26175" LastActivityDate="2017-04-02T18:48:12.063" Title="A libor curve VS A 3-month or 6-month libor curve" Tags="&lt;finance&gt;&lt;libor&gt;&lt;central-banking&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33416" PostTypeId="1" AcceptedAnswerId="33418" CreationDate="2017-04-02T10:23:15.247" Score="2" ViewCount="4116" Body="&lt;p&gt;Ref: &lt;a href=&quot;https://en.wikipedia.org/wiki/Forward_measure&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Forward_measure&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to understand how to move from risk neutral measure $Q$ to T-Forward measure $Q_T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It appears we can move from one measure to another using the &quot;Radon-Nikodym derivative $\frac{dQ_T}{dQ}$, i.e&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P(t,T) = E_Q [ \frac{B(t)}{B(T)} ]  = E_{Q_T} [\frac{B(t)}{B(T)} \frac{dQ_T}{dQ} ] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I dont understand is how you deduce what $\frac{dQ_T}{dQ}$ is. Wikipedia states it is the following, but im not sure how?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{dQ_T}{dQ} = \frac{B(t)P(T,T)}{B(T)P(t,T)} = 1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this example P(t,T) is the price of a zero coupon bond at time t for maturity T&lt;/p&gt;&#xA;" OwnerUserId="27186" LastActivityDate="2017-04-02T12:24:30.703" Title="T-Forward measure" Tags="&lt;forward&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33418" PostTypeId="2" ParentId="33416" CreationDate="2017-04-02T12:24:30.703" Score="3" Body="&lt;p&gt;I think your statement has a typo.  I can't find the statement you made in the article you cite.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The forward measure is the measure induced by using a bond as the numeraire instead of the risk free asset. Letting $H(X_T)$ be the payoff function for an asset $X_t$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \tilde{\mathbb{E}}\left[\frac{B(t)H(X_T)}{B(T)}\right]=P(t, T)\tilde{\mathbb{E}}\left[\frac{B(t)}{B(T)P(t, T)} H(X_T) \right] $$&#xA;$$=P(t, T)\tilde{\mathbb{E}}\left[\frac{B(t)P(T, T)}{B(T)P(t, T)} H(X_T) \right]$$&#xA; $\frac{P(s, T)}{B(s)}$ is a martingale under the risk neutral measure,and so the following holds:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\tilde{\mathbb{E}}\left[\frac{P(T, T)}{B(T)}\right]=\frac{P(t, T)}{B(t)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rearranging, it becomes clear that  $\frac{B(t)P(T, T)}{B(T)P(t, T)} $ is a martingale with expectation one and is thus mathematically able to be a Radon-Nikodym derivative.  Hence the pricing formula can be written as follows:&#xA; $$g(X_t, t)=P(t, T)\hat{\mathbb{E}}\left[H(X_T) \right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, the dynamics of $X_T$ are often postulated under the T-Forward measure without the intermediary risk-neutral step.  &lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2017-04-02T12:24:30.703" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33421" PostTypeId="2" ParentId="33415" CreationDate="2017-04-02T13:44:07.930" Score="5" Body="&lt;p&gt;A 3 month libor curve is a set of forward rates for 3 month libor.  Thus, the curve begins at where 3 month libor is today , and takes different values for each possible forward observation date.  Loosely speaking, this curve represents where the market thinks 3 month libor will set in the future.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The analogous statement holds for 1mo libor , 6 month libor , etc.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A curve consisting of lending rates for various tenors 1 week, 1 month, 3 month etc is an interbank lending curve but this is not normally referred to as &quot;the libor curve&quot;.   &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-04-02T13:44:07.930" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33422" PostTypeId="1" CreationDate="2017-04-02T14:19:10.787" Score="1" ViewCount="107" Body="&lt;p&gt;We are looking for historical overnight stock data of large US stocks and it's main indexes for a thesis project. While some websites offer partial data, such as nasdaq offering the last 100 trades, none of them offers historical information on i.e. 1min or 5min time frames.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We've been looking at both open and commercial parties but haven't spotted any with this kind of data - is it even available? If so, where can we find it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="27293" LastActivityDate="2017-04-14T21:06:35.377" Title="Historical overnight stock data" Tags="&lt;data&gt;&lt;market-data&gt;&lt;historical-data&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33423" PostTypeId="1" CreationDate="2017-04-02T14:49:41.300" Score="2" ViewCount="125" Body="&lt;p&gt;Just struggling with a question here, any help would be appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For its deposits, a bank offers a force of interest per annum over a given year,&#xA;which equals 4.99% at the beginning of the year, 5.33% after three months,&#xA;5.75% after six months, and 6.53% after nine months. Calculate the&#xA;accumulated amount at the end of the year of a deposit of $78,000 at the&#xA;beginning of the year, assuming the force of interest per annum is a third&#xA;degree polynomial function of time over the year.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any helpful tips or advice would be great, I'm not looking for the answer just a method that I can remember.&lt;/p&gt;&#xA;" OwnerUserId="27282" LastActivityDate="2017-10-26T07:15:41.057" Title="Force of interest third degree polynomial" Tags="&lt;finance-mathematics&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33426" PostTypeId="2" ParentId="8501" CreationDate="2017-04-02T17:11:58.747" Score="2" Body="&lt;p&gt;A good article on adaptive Kalman filter tuning is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://arxiv.org/pdf/1503.04313.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Introduction to the Kalman Filter and Tuning its Statistics for Near Optimal Estimates and Cramer Rao Bound&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The authors present an adaptive approach, which means that you make initial estimates of the noise covariances, and iterate the Kalman filter and the noise covariance estimates until all the parameters converge to fixed values. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Something to be aware of is whether your data is stationary or non-stationary. If stationary, you have to use a different state equation than in the non-stationary case, and this affects the calculation of the noise covariances and initial state and state covariance. &lt;/p&gt;&#xA;" OwnerUserId="27297" LastActivityDate="2017-04-02T17:11:58.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33427" PostTypeId="2" ParentId="33423" CreationDate="2017-04-02T17:47:51.960" Score="2" Body="&lt;p&gt;If the force of interest (or instantaneous interest rate) is $r(t)$ then the accumulation function is $a(t)=e^{\int_0^t r(t)dt}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case $r(t)$ is a third degree polynomial in $t$ which is not given explicitly, but is uniquely defined by the fact that it passes through 4 points: (0.0499,0),(0.0533,0.25),(0.0575,0.50),(0.0653,0.75). Using the Newton Interpolation Formula or the Lagrange Interpolation Formula you would explicitly compute what $r(t)$ is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After integrating this polynomial you get a 4th degree polynomial, which you evaluate at t=1 and take the exponential to find $a(1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The final answer is $78000*(a(1)-a(0))=78000*(a(1)-1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Needless to say it is a LOT of computation, especially when you have to do it with pencil and paper under time pressure of an exam. [If you have access to a computer with Mathematica or similar math program then it becomes doable.]&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2017-04-02T17:59:21.607" LastActivityDate="2017-04-02T17:59:21.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33428" PostTypeId="1" AcceptedAnswerId="33434" CreationDate="2017-04-02T17:47:57.383" Score="1" ViewCount="1484" Body="&lt;p&gt;Let's say I have 2 time-series, how would I &quot;standard beta hedge&quot; them against each other? For example, what if the position in 1 timeseries is 100 shares at 16 USD per share. Another time-series is 25 USD per share. Covariance of the two is 50 and the standard deviation of time-series 1 is 5 and of time-series 2 is 7. So I know that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;beta = Cov(ts_1, ts_2)/(SD(ts_1)*SD(ts_2))&#xA;beta = 50/(7*5)&#xA;beta = 1.428&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How would I determine the position of ts_2 that I should short?&lt;/p&gt;&#xA;" OwnerUserId="6766" LastEditorUserId="6766" LastEditDate="2017-04-02T18:00:13.543" LastActivityDate="2017-04-02T20:26:00.483" Title="How to &quot;Standard Beta Hedge&quot;?" Tags="&lt;hedging&gt;&lt;beta&gt;&lt;pairs-trading&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33430" PostTypeId="2" ParentId="33415" CreationDate="2017-04-02T18:48:12.063" Score="3" Body="&lt;p&gt;There are a lot of intricacies involved, and I'll focus on high-level stuff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's go back to the basics. If we have the 3-month LIBOR rate and the 6-month LIBOR rate, can we calculate the 3-month forward 3-month LIBOR rate? Before the financial crisis, the answer was typically assumed to be yes. The math is simple:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\left(1 + \frac{\text{3-month LIBOR}}{4}\right)\left(1 + \frac{\text{3-month forward 3-month LIBOR}}{4}\right) = 1 + \frac{\text{6-month LIBOR}}{2}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can apply similar math to calculate &lt;em&gt;any&lt;/em&gt; forward rate, be it an $x$-year forward 3-month rate, or an $x$-year forward 12-month rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But going back to the formula above, it assumes that after the first three months, your counterparty will be there to roll your maturing loan into another three-month loan. During the financial crisis, rolling these short-term loans became a serious issue, and people woke up to realize that LIBOR was not as risk free as they thought. The implications are profound and extend beyond short-term loans. For longer maturity swaps, for example, people realized that discounting cash flows using LIBOR resulted in them holding insufficient collateral to cover losses.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So nowadays, we have to account for the fact that LIBORs of different tenors are not only NOT risk-free, but carry different degrees of risk. A three-month LIBOR and a six-month LIBOR no longer belong to the same curve, and the 3-month forward 3-month LIBOR cannot be imputed from them (there are in fact traded instruments, 3s6s basis, that tell us how much this risk is worth). Accordingly, we build 1-month LIBOR curves for $x$-year forward 1-month curve,  3-month LIBOR curve for $x$-year forward 3-month rate, etc. None of these curves are used to discount cash flows; for that, yet another curve, typically the OIS curve, is required.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See &lt;a href=&quot;https://developers.opengamma.com/quantitative-research/Multiple-Curve-Construction-OpenGamma.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;MULTIPLE CURVE CONSTRUCTION&lt;/a&gt; for a discussion of how modern yield curves are constructed.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2017-04-02T18:48:12.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33431" PostTypeId="2" ParentId="33412" CreationDate="2017-04-02T19:51:03.187" Score="1" Body="&lt;p&gt;In the book of De Weert he approximates the price with a strip of knock-outs. For example the lookback call with fixed strike pays the (max(S) - K)+, is approximated by a strip of knockout calls with a rebate. So whenever the stock sets a new high, another call knocks out and you receive your rebate. In his example the rebates are 1 cent apart. So if the stock moves from $\$45$ to $\$50$, you will have collected $\$5$ in rebates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyways:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;do you agree that a knock-out call while it is a live is long gamma?&lt;/li&gt;&#xA;&lt;li&gt;do you agree that a barrier option that is knocked out has no gamma?&lt;/li&gt;&#xA;&lt;li&gt;do you agree that a barrier option has more gamma when spot is closer to the strike?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Assuming you agree with the 3 bullets above. you can see that once the stock goes up and knocks out a few barrier options. and then spot drops, the strip of barriers will have less gamma.&lt;/p&gt;&#xA;" OwnerUserId="17316" LastEditorUserId="17316" LastEditDate="2017-04-09T10:56:56.713" LastActivityDate="2017-04-09T10:56:56.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33432" PostTypeId="1" CreationDate="2017-04-02T19:58:29.197" Score="1" ViewCount="500" Body="&lt;p&gt;My question is related to an article which use predictive linear regression for the stock returns. There is told that R squared statistic of 1.6% is high. How can we measure which R squared is high? I am confused because I know that R squared statistic should be between 0 and 100 percents. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot!&lt;/p&gt;&#xA;" OwnerUserId="22521" LastActivityDate="2017-04-02T19:58:29.197" Title="R squared statistic in predictions of returns" Tags="&lt;returns&gt;&lt;regression&gt;&lt;prediction&gt;&lt;statistical-significance&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33433" PostTypeId="2" ParentId="32754" CreationDate="2017-04-02T20:25:55.453" Score="3" Body="&lt;p&gt;First of all, you may have a look at two other papers &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2578733&quot; rel=&quot;nofollow noreferrer&quot;&gt;Mean-Field Game Strategies for Optimal Execution&lt;/a&gt; by Huang, Jaimungal and Nourian.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://arxiv.org/abs/1610.09904&quot; rel=&quot;nofollow noreferrer&quot;&gt;Mean Field Game of Controls and An Application To Trade Crowding&lt;/a&gt; by Cardaliaguet and L&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In the second one, we explain how on the long run, market participants try to anticipate price pressure. For instance intermediaries (ie investment banks and brokers) often publish analysis on the &quot;current trends&quot; in term of flows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, on the short term, you can have a look at this other paper&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://arxiv.org/abs/1610.00261&quot; rel=&quot;nofollow noreferrer&quot;&gt;Limit Order Strategic Placement with Adverse Selection Risk and the Role of Latency&lt;/a&gt; by Mounjid and L.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;We give in it the example of the predictive power of the liquidity imbalance. This &quot;signal&quot; is often used in intraday. At my knowledge, it has been popularized by &lt;a href=&quot;https://arxiv.org/abs/1312.0514&quot; rel=&quot;nofollow noreferrer&quot;&gt;Trade arrival dynamics and quote imbalance in a limit order book&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2017-04-02T20:25:55.453" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33434" PostTypeId="2" ParentId="33428" CreationDate="2017-04-02T20:26:00.483" Score="1" Body="&lt;p&gt;To &quot;standard beta hedge&quot; you would make your positions dollar values inversely proportional to their Betas. So if your standard position is 1000 USD long vs 1000 USD short when the Betas are 1, then you would have 909 long vs 1000 short when the betas are 1.1 and 1. In general $1000/\beta_1$ long of security 1 vs $1000/\beta_2$ short of security 2..&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2017-04-02T20:26:00.483" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33435" PostTypeId="1" AcceptedAnswerId="33500" CreationDate="2017-04-02T23:13:55.117" Score="0" ViewCount="596" Body="&lt;p&gt;I'm getting confused about how I should price the current price of a zero coupon bond when there are several yields to choose from. For instance, lets say that there is an upward sloping yield curve. The rates are $r_1 &amp;lt; r_2 &amp;lt; \cdots &amp;lt; r_{10}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typically, when we price the current price of zero coupon bond that matures in 1 year, the calculation is simply&#xA;$$&#xA;P = \frac{100}{1 + r_1}&#xA;$$&#xA;However, when we price the current price of a 10 year zero coupon bond, I feel that it is overly simplistic to calculate the price as&#xA;$$&#xA;P = \frac{100}{(1+r_{10})^{10}}&#xA;$$&#xA;Rather, I feel that the correct way to price this is to think the rates as forward rates for each year so that&#xA;$$&#xA;P = \frac{100}{(1+r_1)(1+r_2) \cdots (1+r_{10})}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any input will be much appreciated. Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="27302" LastActivityDate="2017-04-04T18:44:47.287" Title="Pricing zero coupon bonds on a yield curve" Tags="&lt;bond&gt;&lt;yield-curve&gt;&lt;zero-coupon&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33436" PostTypeId="1" CreationDate="2017-04-03T00:14:58.663" Score="2" ViewCount="276" Body="&lt;p&gt;Trying to implement some monte carlo simulation for the first time. For the sabr model (&lt;a href=&quot;http://www.javaquant.net/papers/managing_smile_risk.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.javaquant.net/papers/managing_smile_risk.pdf&lt;/a&gt;), would this work?&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/9h4dN.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/9h4dN.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Here, a = volatility of volatility, and s = volatility, and r = correlation of wiener processes.&lt;/p&gt;&#xA;&lt;p&gt;If its ok, then why does it not produce the same results as the SABR formula does?&lt;/p&gt;&#xA;&lt;p&gt;What I do is that I simulate S_T, then I compute max(S_T - K,0) for every simulation, and then calculate average. For some parameter choices, I get the same as SABR, but for others, I get the wrong number, even if I ramp up the sample and time steps.&lt;/p&gt;&#xA;&lt;p&gt;So it my code wrong? Is the SABR formula wrong? Which technique produces correct results?&lt;/p&gt;&#xA;" OwnerUserId="27299" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2018-11-03T09:04:16.370" Title="Non-convergence in Monte Carlo" Tags="&lt;monte-carlo&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33437" PostTypeId="1" CreationDate="2017-04-03T01:55:20.563" Score="-1" ViewCount="94" Body="&lt;p&gt;I am trying to compute VaR for a long-only equity portfolio, under the assumption that all stock returns are normally distributed, using a &quot;1-month horizon&quot; methodology.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I do it?  Do I compute my covariance using my daily 1-month returns?  Or do I compute in the normal way using my daily returns, and then adjust for the different timespans?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the gaussian version of &lt;a href=&quot;https://quant.stackexchange.com/questions/33350/what-does-1-month-horizon-mean-in-var-calculations&quot;&gt;this question&lt;/a&gt; about 1-month horizons in VaR.&lt;/p&gt;&#xA;" OwnerUserId="27210" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2017-05-09T01:10:48.610" Title="Compute gaussian VaR with a &quot;1-month horizon&quot;" Tags="&lt;portfolio-management&gt;&lt;var&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33438" PostTypeId="1" CreationDate="2017-04-03T03:14:21.033" Score="2" ViewCount="196" Body="&lt;p&gt;Let's say I believe that $ts_1$ and $ts_2$ move together and I would like to pairs trade them. Am I correct in understanding that to hedge them against each other I would get their $Var_1$, $Var_2$, and $Cov_1,_2$ all in USD, then I would buy 1000 USD worth of $ts_1$ and then find how much money to put into shorting $ts_2$ by doing $\beta =  Cov_1,_2$/$Var_1$, and then doing $\$\_position\_ts_2 = $\$1000* $\beta$?&lt;/p&gt;&#xA;" OwnerUserId="6766" LastEditorUserId="6766" LastEditDate="2017-04-03T19:24:38.173" LastActivityDate="2017-04-03T19:24:38.173" Title="Is this the correct way to hedge two securities against each other?" Tags="&lt;hedging&gt;&lt;beta&gt;&lt;pairs-trading&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33439" PostTypeId="1" AcceptedAnswerId="33474" CreationDate="2017-04-03T03:39:57.983" Score="0" ViewCount="470" Body="&lt;p&gt;i am currently running linear optimization and maximizing summation of (weight*score) for each assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am running it on assets that are difficult to trade and the universe is easily about 2000 of them every month. My firm has capacity to trade only about 100 of them..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do i introduce a max number of trade constraints for the assets ? I am thinking of introducing binary variables to indicate whether to trade for each assets but i am not sure how to link it back to the original objective function &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards&#xA;James&lt;/p&gt;&#xA;" OwnerUserId="6131" LastActivityDate="2017-04-04T06:47:38.890" Title="Portfolio Optimization with maximum number of Trades constraint" Tags="&lt;optimization&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33440" PostTypeId="2" ParentId="33436" CreationDate="2017-04-03T04:17:07.967" Score="-1" Body="&lt;p&gt;The SABR formula is wrong.  There is a set of papers that begins with a solution for the distribution that must be present for all asset classes and a paper to verify the distribution present.  It provides a mathematical reason for Mandelbrot's 1963 paper, &lt;em&gt;On the Variation of Certain Speculative Prices&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The difficulty with a Bayesian method is that if your model is wrong, it should get flat and then it will take much much longer to converge.  The distribution of returns for a stock that is a going concern is $$\left[\frac{\pi}{2}+\tan^{-1}\left(\frac{\mu}{\gamma}\right)\right]^{-1}\frac{\gamma}{\gamma^2+(r-\mu)^2}$$ in a world with no liquidity concerns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This would be multiplied either by an adjustment for the bid-ask spread or for the probability that a trade would happen given the budget constraint of the counter-party was met.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The big issue here is that $\gamma$ does not satisfy the definition of variance.  If you try to solve the integral for the first or second moment, it diverges.  This is the source of the heavy tails.  The logic is that a return is a future value divided by a present value minus one.  Ignoring the minus one component since it is just a translation, this implies that a return is a ratio distribution.  Under suitable circumstances, the distribution above would be that ratio distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you were to do it as a multiplication instead, that is $p_{t+1}=\beta{p_t}+\epsilon_{t+1}$ then by a proof by White in 1958 the residuals diverge hopelessly and there is no non-Bayesian solution as a result.  The Bayesian solution is $$\frac{1}{\pi}\frac{\gamma}{\gamma^2+(r-\mu)^2}.$$  This also has no moments.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are associated with a statistician, you can verify this.  You can also verify it at &lt;a href=&quot;http://mathworld.wolfram.com/RatioDistribution.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://mathworld.wolfram.com/RatioDistribution.html&lt;/a&gt;  and at  &lt;a href=&quot;http://mathworld.wolfram.com/CauchyDistribution.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://mathworld.wolfram.com/CauchyDistribution.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2017-04-03T04:17:07.967" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33441" PostTypeId="1" CreationDate="2017-04-03T05:59:52.740" Score="-3" ViewCount="381" Body="&lt;p&gt;We know the payment function of Spread option is&#xA;$$\max\{X_T - Y_T-K,0\}$$&#xA;here&#xA;$$d X_t = (\mu_x - D_x)X_t dt + \sigma_xX_td W^x_t$$&#xA;$$d Y_t = (\mu_y - D_y)Y_t dt + \sigma_yY_td W^y_t$$&#xA;$$d W^x_td W^y_t = \rho dt$$&#xA;and we know the the increasing of $\rho$ will reduce the value of spread option, but how to explain this result without deducing the mathematical formula?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know the &lt;code&gt;Kirk’s approximation formula,&lt;/code&gt; $\rho$ only contribute to the equivalent volatility&#xA;$$\sigma^2 = \sigma^2_x - 2\rho\sigma_x\sigma_z + \sigma^2_z$$&#xA;here $\sigma_z$ is a transformation of $\sigma_y$ which is fixed. Then increasing of $\rho$ will reduce the $\sigma,$ and will reduce the value of option.&lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-04-03T09:32:16.410" Title="Increasing the correlation of two asset reduce the value of spread option." Tags="&lt;black-scholes&gt;&lt;derivatives&gt;&lt;exotics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33442" PostTypeId="1" CreationDate="2017-04-03T06:06:10.937" Score="1" ViewCount="209" Body="&lt;p&gt;Consider a credit-rating system, with two solvency states (A &amp;amp; B) and a default state (D), and assuming recovery rate and interest rate are 0%.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The one year credit spread for an A-rated company is 0.1% and for a B-rated company is 0.22%.&lt;/li&gt;&#xA;&lt;li&gt;The two year credit spread for an A-rated company is 0.12% and for a B-rated company is 0.2%.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What is the one-year transition probability matrix? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;[My attempt: ]&lt;br&gt;&#xA;I used the 1 year credit spreads to obtain the respective elements of the matrix, that is the probabilities of default for both states A &amp;amp; B. So, my one-year transition matrix is as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;      A            B              D&#xA;A     x      0.9990005-x      0.0009995&#xA;B     y      0.9978024-y      0.0021976&#xA;D     0           0               1     &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How do I use the two year credit spread to obtain the missing values, x &amp;amp; y? &lt;/li&gt;&#xA;&lt;li&gt;Am I on the right track?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="27305" LastActivityDate="2017-04-03T06:06:10.937" Title="Three-state Markov Chain: Credit rating question" Tags="&lt;default-probability&gt;&lt;credit-ratings&gt;&lt;markov&gt;&lt;transition-matrix&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33443" PostTypeId="1" AcceptedAnswerId="33526" CreationDate="2017-04-03T06:19:33.330" Score="1" ViewCount="210" Body="&lt;p&gt;I usually write my backtests in Python or a dedicated backtesting environment, but I wanted to experiment with some of R's predictive analytics functionality. I wrote an extremely simple backtester for doing some quick and dirty research, but wind up with some obvious bias in my results. I assume the bias is related to future-peeking, but I am not sure.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code uses a rolling window approach and creates a list of adjacent training/testing windows, as per a standard walk-forward approach. For each training window, it fits a simple linear regression model based on some lagged variables and the next-day's return. It then tests the model on the adjacent testing window. After looping through the list of windows, the results are aggregated and plotted. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on my code and output shown below, is it obvious where the bias is coming from? Looking at the results, I must have somehow mixed my training and testing windows, or possibly I am not understanding the correct way to lag the dependent variables. Either way, I am stuck and any advice would be greatly appreciated.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;## Libraries&#xA;library(caret);library(quantmod);library(TTR);require(ggplot2);require(reshape)&#xA;&#xA;## Data Acquisition and Wrangling&#xA;&#xA;# download data from yahoo/google&#xA;getSymbols(&quot;SPY&quot;, from=&quot;2010-01-01&quot;)&#xA;&#xA;# create returns series and some indicators&#xA;# remember to lag indicators to prevent look-ahead bias!&#xA;ret &amp;lt;- Delt(Op(SPY), Cl(SPY)) #day session return&#xA;atr &amp;lt;- ATR(SPY[, c(2:4)], 14)$atr&#xA;rsi &amp;lt;- RSI(Cl(SPY), n=14, maType=&quot;SMA&quot;) #relative strength index&#xA;dpo &amp;lt;- DPO(Cl(SPY)) #de-trended price oscillator&#xA;&#xA;dat &amp;lt;- cbind(ret, lag(atr, 1), lag(rsi, 1), lag(dpo, 1))&#xA;colnames(dat) &amp;lt;- c(&quot;ret&quot;, &quot;atr&quot;, &quot;rsi&quot;, &quot;dpo&quot;)&#xA;dat &amp;lt;- as.data.frame(dat[complete.cases(dat), ]) #get rid of rows with NA, NaN etc&#xA;&#xA;## Set up train-test windows&#xA;&#xA;# create indexes for TSCV windows&#xA;init = 200 #initial window &#xA;horiz = 50 #prediction horizon &#xA;wdw &amp;lt;- createTimeSlices(1:nrow(dat), initialWindow = init, horizon = horiz, &#xA;                        skip = horiz-1, fixedWindow = TRUE)&#xA;&#xA;trainSlices &amp;lt;- wdw[[1]]&#xA;testSlices &amp;lt;- wdw[[2]]&#xA;&#xA;# verify visually correct window setup:&#xA;trainSlices[[length(trainSlices)]]&#xA;testSlices[[length(testSlices)]]&#xA;&#xA;# train and test linear regression model on rolling window&#xA;ModelReturn &amp;lt;- list() #store return of each out-of-sample window&#xA;BHReturn &amp;lt;- list() #store buy and hold returns for comparison&#xA;for(i in c(1:length(testSlices)))&#xA;{&#xA;  model &amp;lt;- lm(ret ~., data=dat[trainSlices[[i]], ])&#xA;  preds &amp;lt;- predict(model, newdata=dat[testSlices[[i]], -1])&#xA;  returns &amp;lt;- ifelse(preds&amp;gt;0, dat[testSlices[[i]], 1], -dat[testSlices[[i]], 1])&#xA;&#xA;  ModelReturn[[i]] &amp;lt;- returns&#xA;  BHReturn[[i]] &amp;lt;- dat[testSlices[[i]], &quot;ret&quot;]&#xA;}&#xA;&#xA;# plot results&#xA;results &amp;lt;- data.frame(unlist(ModelReturn), unlist(BHReturn))&#xA;colnames(results) &amp;lt;- c(&quot;Model&quot;, &quot;BuyHold&quot;)&#xA;plot(cumprod(1+results$Model)-1, type='l', col='blue', ylab=&quot;Cum.Return&quot;)&#xA;lines(cumprod(1+results$BuyHold)-1, col='red')&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And the output:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/cAlXy.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/cAlXy.png&quot; alt=&quot;Output&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17328" LastActivityDate="2017-04-06T01:27:05.560" Title="Where is the bias in this simple backtesting framework?" Tags="&lt;programming&gt;&lt;backtesting&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33444" PostTypeId="1" CreationDate="2017-04-03T07:33:19.780" Score="0" ViewCount="167" Body="&lt;p&gt;In John Hull's &lt;em&gt;The Book&lt;/em&gt;, section 18.3 he briefly discussed a stop-loss strategy for writing a call option: buy one share of stock whenever $S_t&amp;gt;K$ and sell it otherwise (except at time $0$: if $S_0\le K$ we do nothing), and hence the call writer will own the stock in case $S_T&amp;gt;K$ and not otherwise, making an overall profit of $c_0 - \max(S_0 - K, 0)\ge 0$. However, he pointed out two reasons why this isn't the case: 1). it ignores the time value of money; 2). it is impossible to buy/sell exactly at $K$; also, if the stock price follows the Wiener process it can happen that $\#\{t\mid S_t=K, t\in[0,T]\}=\infty$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, let's temporarily ignore the problem 2) and assume we have a super trader who can carry out the order at the exact price we want. The main problem is then the first one. However, I think it can easily be circumvented by &quot;discounting&quot; our stop-loss rule towards time $T$: whenever $S_t&amp;gt; Ke^{-r(T-t)}$, buy one share and sell it otherwise (except at time $0$: if $S_0\le Ke^{-rT}$ we do nothing). Thus, in the absence of transaction costs, it can be verified that our net profit discounted towards $T$ is &#xA;$$e^{rT}\cdot\text{BS Price}-\max(S_0e^{rT}-K,0)=S_0e^{rT}\Phi(d_1)-K\Phi(d_2)-\max(S_0e^{rT}-K,0).$$&#xA;Although its sign is not obvious, by experimenting with several sets of parameters I become fairly convinced that it is non-negative. But then such a strategy would in effect become an arbitrage in this BS world. What goes wrong?&lt;/p&gt;&#xA;" OwnerUserId="19004" LastActivityDate="2017-04-03T07:33:19.780" Title="Isn't this modified stop-loss strategy an arbitrage?" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;arbitrage&gt;&lt;hedging&gt;" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="33445" PostTypeId="1" CreationDate="2017-04-03T07:52:09.433" Score="1" ViewCount="1599" Body="&lt;p&gt;Given return of a portfolio or a single asset modeled as a continuous, but not necessarily gaussian, probability distribution, what's the Kelly criterion equation? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've heard that it's simply the the ratio of the sharpe ratio to the standard deviation. Is it true?&lt;/p&gt;&#xA;" OwnerUserId="25307" LastActivityDate="2017-04-03T07:52:09.433" Title="What is the Kelly Criterion for continuous probability case?" Tags="&lt;sharpe-ratio&gt;&lt;kelly-criterion&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="33448" PostTypeId="2" ParentId="33441" CreationDate="2017-04-03T09:32:16.410" Score="3" Body="&lt;p&gt;the payoff is max(X-Y-K,0). so this option pays you the most if X goes up and Y goes down. So you need X and Y to move in opposite directions. The more X and Y move in the same direction (high rho) the less you get paid.&lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2017-04-03T09:32:16.410" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33449" PostTypeId="2" ParentId="11103" CreationDate="2017-04-03T10:41:29.900" Score="7" Body="&lt;p&gt;In his article about Paul A. Samuelson, Robert C. Merton gives the following story:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In modern times, the standard terms for options and warrants permit the option holder to exercise on or before the expiration date. Samuelson coined the terms European option to refer to the former and American option to refer to the latter. As he tells the story, to get a practitioner’s perspective in preparation for his research, he went to New York to meet with a&#xA;  well-known put and call dealer (there were no traded options exchanges until 1973) who happened to be Swiss. Upon his identifying himself and explaining what he had in mind, Samuelson was quickly told, “You are wasting your time—it takes a European mind to understand options.” Later on, when writing his paper, Samuelson thus chose the term European for the relatively simple(-minded)-to-value option contract that can only be exercised at expiration and American for the considerably more-(complex)-to-value option contract that could be exercised early, any time on or before its expiration date.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The article can be found in &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470057564&quot; rel=&quot;noreferrer&quot;&gt;Encyclopedia of Quantitative Finance&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15154" LastActivityDate="2017-04-03T10:41:29.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33450" PostTypeId="2" ParentId="33436" CreationDate="2017-04-03T10:55:58.460" Score="1" Body="&lt;p&gt;I can see two potential issues here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Discretization Scheme&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, you should consider different simulation schemes. In the special case of constant volatility ($\alpha = 0$), the SABR model reduces to the CEV model. The basic Euler scheme that you employ for the spot process has been show to exhibit a significant bias for this process. See Lord (2014) and Chen et al. (2011) for an in depth-discussion and comparison of more advanced simulation schemes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&quot;SABR Formula&quot;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suppose that you refer to the second order expansion in Equation (2.17) of Hagan et. al (2002) as the &quot;SABR Formula&quot;. As the name suggests this is only an &lt;em&gt;approximation&lt;/em&gt; for the implied volatility. Furthermore, it is known to not be free of arbitrage (e.g. for very low strikes).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lord, Roger (2014) &quot;Fifty Shades of SABR Simulation,&quot; 10th Fixed Income Conference, Barcelona, available &lt;a href=&quot;http://www.rogerlord.com/fiftyshadessabrwbs.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Chen, Bin, Cornelis W. Oosterlee and Hans van der Weide (2011) &quot;Efficient Unbiased Simulation Scheme for the SABR Stochastic Volatility Model,&quot; Working Paper, TU Delft, available &lt;a href=&quot;http://ta.twi.tudelft.nl/mf/users/oosterle/oosterlee/SABRMC.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hagan, Patrick S, Deep Kumar, Andrew S. Lesniewski and Diana E. Woodward (2002) &quot;Managing Smile Risk,&quot; Wilmott Magazine&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-04-03T16:54:41.010" LastActivityDate="2017-04-03T16:54:41.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33452" PostTypeId="2" ParentId="33371" CreationDate="2017-04-03T12:05:55.523" Score="6" Body="&lt;p&gt;This is a slightly extended version of my comment that summarizes the main result of the reference that I provided.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This problem is discussed in detail in Chapter 12 of Wilmott (2006), which is based on the paper Ahmad and Wilmott (2005). See also the related Question 9 in Carr (2005).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, you are selling and delta hedging the option using the implied volatility $\sigma_{(i)}$ while the actual volatility of the underlying asset is $\sigma_{(r)}$. Your portfolio profit and loss is given by the sum of value changes of (i) the derivative and (ii) the hedging position, both using the implied volatility. We have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathrm{d} \Pi_t = \mathrm{d}V_t^{(i)} - \Delta_t^{(i)} \mathrm{d}S_t - r \left( V_t^{(i)} - \Delta_t^{(i)} S_t \right) \mathrm{d}t.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathrm{d}V_t^{(i)} = \frac{\partial V^{(i)}}{\partial t} \mathrm{d}t + \underbrace{\frac{\partial V^{(i)}}{\partial S}}_{= \Delta^{(i)}} \mathrm{d}S_t + \frac{1}{2} \underbrace{\frac{\partial^2 V^{(i)}}{\partial S}}_{=\Gamma^{(i)}} \mathrm{d} \langle S \rangle_t,&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;we get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathrm{d}\Pi_t = \left( \frac{\partial V^{(i)}}{\partial t} + \frac{1}{2} \sigma_{(r)}^2 S_t^2 \frac{\partial^2 V^{(i)}}{\partial S^2} - r \left( V_t^{(i)} - \Delta_t^{(i)} S_t \right) \right) \mathrm{d}t.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we use that $V^{(i)}$ satisfies the Black-Scholes PDE&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\frac{\partial V^{(i)}}{\partial t} + r S_t \underbrace{\frac{\partial V^{(i)}}{\partial S}}_{=\Delta^{(i)}} + \frac{1}{2} \sigma_{(i)}^2 S_t^2 \underbrace{\frac{\partial^2 V^{(i)}}{\partial S^2}}_{=\Gamma^{(i)}} - r V^{(i)} = 0&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to obtain&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathrm{d}\Pi_t = \frac{1}{2} \left( \sigma_{(r)}^2 - \sigma_{(i)}^2 \right) S_t^2 \Gamma^{(i)} \mathrm{d}t.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e. over each short interval, your profit and loss is proportional to the difference in realized to implied variance times the current gamma (computed using the implied volatility). While $\mathrm{d}\Pi_t$ is deterministic, the overall hedging profit and loss over the lifetime of the option is path-dependent. Its absolute value is higher for paths that fluctuate around the strike (where the gamma is higher).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ahmad, Riaz and Paul Wilmott (2005) &quot;Which Free Lunch Would You Like Today, Sir? Delta Hedging, Volatility Arbitrage and Optimal Portfolios,&quot; Wilmott Magazine, available &lt;a href=&quot;https://wwwf.imperial.ac.uk/~ajacquie/IC_AMDP/IC_AMDP_Docs/Literature/Wilmott.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Carr, Peter (2005) &quot;FAQs in Option Pricing Theory&quot;, Working Paper, available &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.27.896&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wilmott, Paul (2006) &lt;em&gt;Paul Wilmott on Quantitative Finance&lt;/em&gt;, Vol. 1: Wiley, 2nd Edition&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-06-09T12:08:29.717" LastActivityDate="2017-06-09T12:08:29.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33454" PostTypeId="2" ParentId="33112" CreationDate="2017-04-03T13:04:53.627" Score="0" Body="&lt;p&gt;I will answer the part of your question on&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;...software which will allow me to do recursive one step ahead forecasts, whereby coefficients are re-estimated at each step, and these are used for forecasts.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Automated recursive GARCH estimation and forecasting is available in R package &lt;code&gt;rugarch&lt;/code&gt; via function &lt;a href=&quot;https://www.rdocumentation.org/packages/rugarch/versions/1.3-6/topics/ugarchroll-methods&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;ugarchroll&lt;/code&gt;&lt;/a&gt; (you will find an example in the link, too). See also the package &lt;a href=&quot;https://cran.r-project.org/web/packages/rugarch/vignettes/Introduction_to_the_rugarch_package.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;vignette&lt;/a&gt; for details and examples.&lt;/p&gt;&#xA;" OwnerUserId="19645" LastActivityDate="2017-04-03T13:04:53.627" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33455" PostTypeId="1" AcceptedAnswerId="33462" CreationDate="2017-04-03T13:31:38.580" Score="-1" ViewCount="60" Body="&lt;p&gt;I am working on a problem in Davidson and Herskovitz workbook titled the Mortgage-Backed Securities Workbook. The questions asks to find the total opportunity cost to the investor of having a $1 million cashflow delayed for 15 days and the current risk free interest rate is 6.5% actual/actual. I first converted 6.5% into a daily rate and then tried to compound the interest on 1 million dollars, but it was deemed incorrect. The correct answer is 2671.23.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Their is also an example, but this time the current risk free rate is 6.25% and the book tells us each delay costs 171.23. The investor is still supposed to receive 1 million. I am assuming one could take the 171 multiply it by 15 to get the total, but why not 14 to account for timing?&lt;/p&gt;&#xA;" OwnerUserId="24338" LastActivityDate="2017-04-03T17:43:27.557" Title="Calculating the Cost of Delay" Tags="&lt;fixed-income&gt;&lt;mbs&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33456" PostTypeId="1" CreationDate="2017-04-03T14:38:30.173" Score="0" ViewCount="47" Body="&lt;p&gt;I am looking for a clean and efficient way to obtain the portfolio returns from a list of activity records.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, the activity file consist of BUY, SELL, COVER, SHORT, etc. records with additional referential data (e.g. SecurityID, Quantity, Fees, BaseAmount, etc.). Here is an &lt;a href=&quot;https://www.interactivebrokers.com/en/software/ibrit/topics/activity_file_sample.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;example file&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A possible layout for a security:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;t    TransactionType     Quantity    Price&#xA;1    BUY                 100         5&#xA;2    BUY                 50          4&#xA;...&#xA;3    SELL                50          6&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So what I thought would be the best to do is to create a time series of the portfolio value over time. Hence, for each date, I take the current stock price and I check all the past records up to that date to determine the quantity that the user has in its portfolio of that particular security.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the previous example, this would give the following evolution:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;t   Quantity_Portfolio     Return&#xA;1   100                    -&#xA;2   150                    150*4 / ( (50*4)+(100*5) ) &#xA;...&#xA;3   100                    ...? &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see it becomes quite complex to calculate the portfolio value at time 3, as then - even in this simple example. What is the return at t=3? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was therefore wondering whether there are some sets of rules or resources that I could use (preferably Matlab or Python) to parse such activity records, instead of reinventing the wheel and trying to think of all possible situations?&lt;/p&gt;&#xA;" OwnerUserId="13334" LastActivityDate="2017-04-03T14:38:30.173" Title="Portfolio returns from activity records" Tags="&lt;trading&gt;&lt;portfolio&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33457" PostTypeId="1" AcceptedAnswerId="33459" CreationDate="2017-04-03T16:42:24.750" Score="0" ViewCount="76" Body="&lt;p&gt;Im looking for live data feed of Bond Yield and DXY.&#xA;I like to use it in R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks! &lt;/p&gt;&#xA;" OwnerUserId="27315" LastActivityDate="2017-04-03T16:59:04.183" Title="Live data for: Bond Yield and Dollar Index" Tags="&lt;market-data&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33458" PostTypeId="1" CreationDate="2017-04-03T16:51:37.943" Score="2" ViewCount="134" Body="&lt;p&gt;does it make sense to regress the changes in a bonds YTM against changes in the YTM of a bond index to get som measure of a bonds beta?&lt;/p&gt;&#xA;" OwnerUserId="27184" LastActivityDate="2017-08-01T19:16:32.053" Title="Regress the changes in a bonds YTM against the changes in YTM of a bond index?" Tags="&lt;bond&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33459" PostTypeId="2" ParentId="33457" CreationDate="2017-04-03T16:59:04.183" Score="-2" Body="&lt;p&gt;You can check on Quandl.. One of the best free financial data source&lt;/p&gt;&#xA;" OwnerUserId="27274" LastActivityDate="2017-04-03T16:59:04.183" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33460" PostTypeId="2" ParentId="33438" CreationDate="2017-04-03T17:01:17.893" Score="1" Body="&lt;p&gt;This is (one way) how to hedge two securities against each other. I am synthesizing the material from &lt;a href=&quot;https://www.fool.com/knowledge-center/how-to-calculate-the-beta-coefficient-for-a-single.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;http://thereformedbroker.com/2011/03/10/the-right-way-to-hedge/&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's call one security the $security_{market}$, and another $security_{unique}$. I'm taking for granted that you have done your research and believe that you found a good pair of securities for hedging.  &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Convert each security time-series from a price to a daily percent change. Call this $pct\_change_{market}$ and $pct\_change_{unique}$.&lt;/li&gt;&#xA;&lt;li&gt;Get $Var(pct\_change_{market}$), $Var(pct\_change_{unique})$ and $Cov(pct\_change_{market}, pct\_change_{unique}$).&lt;/li&gt;&#xA;&lt;li&gt;$\beta$ = $Cov(pct\_change_{market}, pct\_change_{unique}$)/$Var(pct\_change_{market}$).&lt;/li&gt;&#xA;&lt;li&gt;Buy \$100,000 (or whatever amount) of $security_{unique}$. Now you need to know how many dollars to sink into $security_{market}$.&lt;/li&gt;&#xA;&lt;li&gt;Multiply \$100,000 by the  $\beta$, this will be the amount of dollars to spend on your hedge. &lt;/li&gt;&#xA;&lt;li&gt;Divide the number of dollars you came up with in step 5 by the price of $security_{market}$. Just to be clear, numerator is number of dollars, denominator is price of $security_{market}$. This will be your position for the hedge. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Note: Obviously, if you want to long one security then you will short the other security. &lt;/p&gt;&#xA;" OwnerUserId="6766" LastEditorUserId="6766" LastEditDate="2017-04-03T18:24:11.043" LastActivityDate="2017-04-03T18:24:11.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33461" PostTypeId="2" ParentId="33394" CreationDate="2017-04-03T17:03:28.070" Score="4" Body="&lt;p&gt;Here's some pseudo code to generate your valuations:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Asset asset(); //some asset object that holds all the data.&#xA;&#xA;vector&amp;lt;double&amp;gt; timeline; //this is your vector of times.&#xA;size_t nTimes = timeline.size();&#xA;vector&amp;lt;double&amp;gt; dts(nTimes); //vector of fwd prices on the same timeline.&#xA;vector&amp;lt;double&amp;gt; fwds(nTimes); //vector of fwd prices on the same timeline.&#xA;vector&amp;lt;double&amp;gt; fwdRatios(nTimes); //vector of fwd prices on the same timeline.&#xA;double vol = 0.2; //Your BS vol.    &#xA;&#xA;for(size_t iTimeline=0; iTimeline&amp;lt;nTimes; iTimeline++){&#xA;    fwds(i) = asset.getForward(timeline[iTimeline]);&#xA;    if(iTimeline==0){&#xA;        fwdRatios(0) = fwds(i) / asset.getSpot();&#xA;        dts(0) = timeline(0);&#xA;    }else{&#xA;        fwdRatios(i) = fwds(i) / fwds(i-1);&#xA;        dts(i) = timeline(i) - timeline(i-1);&#xA;    }&#xA;}&#xA;&#xA;//Some random number generator - &#xA;PRNG&amp;lt;Distribution::Normal&amp;gt; prng();&#xA;&#xA;size_t nTrajectories = 100000;&#xA;&#xA;Matrix&amp;lt;double&amp;gt; trajectories(nTimes, nTrajectories);&#xA;for(size_t iTrajectory=0; iTrajectory&amp;lt;nTrajectories ; iTrajectory++){&#xA;    trajectories(0, iTrajectory) = asset.getSpot() * fwdRatios(0) * exp(-0.5*vol*vol*dts(0) + vol*sqrt(dts(0)*prng.next());&#xA;&#xA;    for(size_t iTimeline=1; iTimeline&amp;lt;nTimes; iTimeline++){&#xA;        trajectories(iTimeline, iTrajectory) = trajectories(iTimeline-1, iTrajectory) * fwdRatios(iTimeline) * exp(-0.5*vol*vol*dts(iTimeline) + vol*sqrt(dts(iTimeline))*prng.next());&#xA;    }&#xA;}&#xA;&#xA;vector&amp;lt;double&amp;gt; payoffs(nTrajectories);&#xA;for(size_t iTrajectory=0; iTrajectory&amp;lt;nTrajectories ; iTrajectory++){&#xA;    payoffs(iTrajectory) = calculatePayoff(trajectories.row(iTrajectory));&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That'll give you one sample price. If you want to do it 40 times, just put another foor loop around it to do it 40 times.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll not be able to copy paste that and compile it though, because i just typed it out and made up functions...&lt;/p&gt;&#xA;" OwnerUserId="19663" LastEditorUserId="19663" LastEditDate="2017-04-03T18:37:03.740" LastActivityDate="2017-04-03T18:37:03.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33462" PostTypeId="2" ParentId="33455" CreationDate="2017-04-03T17:43:27.557" Score="1" Body="&lt;p&gt;These calculations are a matter of convention and standard practice (which are somewhat arbitrary, and not necessarily the way I would have defined it).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A compounding period is defined, which is by default 1 year (except for US treasuries where it is 6 months). For periods shorter than this, compounding is not used, but rather &quot;simple interest&quot; is used, which amounts to a linear interpolation.  So for &quot;15 days and the current risk free interest rate is 6.5% actual/actual&quot; we would do (15/365)*0.065 = 0.0267123 . On 1 million it is 2671.23&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2017-04-03T17:43:27.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33463" PostTypeId="1" AcceptedAnswerId="33541" CreationDate="2017-04-03T17:49:05.753" Score="3" ViewCount="2898" Body="&lt;p&gt;I want to get data of Overnight Index Swap, also known as OIS rate, there is any public why to get this always from yesterday?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I want to get EFFR(Effective Federal Funds Rate), I can get here:&#xA;&lt;a href=&quot;https://fred.stlouisfed.org/series/EFFR&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://fred.stlouisfed.org/series/EFFR&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some one give a light of how to solve my problem. I am trying to solve price for FX Option, what I did, I just have to adjust the OIS rate for differal time and I done my job.&lt;/p&gt;&#xA;" OwnerUserId="27313" LastActivityDate="2020-07-19T02:36:15.613" Title="Is there any public data to get OIS for differal time (1d, 1W, 1M, ..., 10Y)?" Tags="&lt;black-scholes&gt;&lt;market-data&gt;&lt;quants&gt;&lt;risk-free&gt;&lt;ois&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33464" PostTypeId="2" ParentId="29977" CreationDate="2017-04-03T17:49:33.357" Score="0" Body="&lt;p&gt;When a hedging portfolio $X(t)$ is used to price an asset $V(t)$ expiring at time $T$, it is required that a.s. $$ X(t) = V(t) \quad  t\in [0, T]  \tag{1} \label{one}$$ Otherwise you'll have an arbitrage, as answered &lt;a href=&quot;https://quant.stackexchange.com/a/32812/15154&quot;&gt;already&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suspect, it is the notation (probably intentionally) used by Shreve in this exercise that causes confusion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As correctly noted &lt;a href=&quot;https://quant.stackexchange.com/a/29981/15154&quot;&gt;already&lt;/a&gt;, $C(t)$ represents a payout rate, NOT an asset value as usual. The asset hedged by portofolio $X(t)$ is actually: $$V(t) = \tilde{\mathrm{E}} \int_t^T D(u) C(u) du \tag{2} \label{two}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\eqref{one}$ holds for the asset defined by $\eqref{two}$. In particular, $$X(0) = \tilde{\mathrm{E}} \int_0^T D(u) C(u) du \\ X(T) = \tilde{\mathrm{E}} \int_T^T D(u) C(u) du  = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuitively, $X(t)$ is equal to the expected remaining amount of money an agent must pay till time $T$ as calculated by $\eqref{two}$. &lt;/p&gt;&#xA;" OwnerUserId="15154" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2017-04-03T17:49:33.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33465" PostTypeId="2" ParentId="33458" CreationDate="2017-04-03T18:11:01.020" Score="1" Body="&lt;p&gt;The beta concept is rather easy for stocks, but more complex for bonds. We know that  stocks tend to grow long term and rise in price, which compensates investors for their risk. So generally investors want a positive beta to the stock market, to capture this long-run price appreciation tendency.&#xA;For bonds, there is no long-term appreciation observable and the main source of risk is not a bond index, but interest rate risk, therefore no one uses betas to hedge bonds, but duration and convexitiy. (if its about hedging: Alternatively regress your (portfolio) bond return against the return of a bond-futures contract as they are more liquid to e.g. conduct a minimum variance hedge. &#xA;Also it is important to note that if you do such a regression to take comparabale bonds in terms of credit rating, i.e. if you hedge a corporate bond portfolio with a gilt futures, you are exposed to an increase in the credit spread.)&lt;/p&gt;&#xA;" OwnerUserId="26565" LastActivityDate="2017-04-03T18:11:01.020" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="33466" PostTypeId="1" CreationDate="2017-04-03T18:56:22.050" Score="0" ViewCount="59" Body="&lt;p&gt;This is a bit of a naive question, but I figured it couldn't hurt to ask. I have time series data that looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;PHP HIGH DATE PHP HIGH  PHP.OPENDATE PHP OPEN  PHP.CLOSEDATE PHP.CLOSE&#xA;8/28/2003     2.935     9/2/2003    2.9855     9/1/2003     2.9865&#xA;8/27/2003     2.9503    9/1/2003    2.979      8/29/2003    2.976&#xA;8/26/2003     2.9813    8/29/2003   2.957      8/28/2003    2.955&#xA;8/25/2003     2.978     8/28/2003   2.9561     8/27/2003    2.9561&#xA;8/22/2003     2.984     8/27/2003   2.9748     8/26/2003    2.987&#xA;8/21/2003     2.992     8/26/2003   2.9915     8/25/2003    2.9955&#xA;8/20/2003     2.9825    8/25/2003   2.988      8/22/2003    2.9865&#xA;8/19/2003     2.976     8/22/2003   3.0035     8/21/2003    2.999&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The dates are misaligned, and I was wondering what the best way of dealing with this would be. I already have 20MA,50MA downloaded from the source, which adjusts the moving averages to account for these inconsistencies. However, I run into problems if I want to compare last prices to 20-day highs/lows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm thinking of implementing either the two following options:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Should I omit the variables that are misaligned by the dates? &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In this case, I would omit the observed values for 9/2,9/1,29 for PHP open prices and 8/29 for PHP Close.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;Should I fill in the missing values with the previous value?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="22135" LastActivityDate="2017-04-03T18:56:22.050" Title="Dealing with misaligned dates for trend-following strategy?" Tags="&lt;time-series&gt;&lt;data&gt;" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="33467" PostTypeId="1" CreationDate="2017-04-03T19:13:20.527" Score="2" ViewCount="679" Body="&lt;p&gt;I know how to find the mean of an SDE: write it on integral form, take derivative, solve a simple ODE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what to do when we want a variance? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my case, $$X_{T + \delta t} = X_T + \int_T^{T + \delta t} \lambda ( 1 -X)dt + \int_T^{T + \delta t} \sigma \sqrt{X} dW$$&#xA;and I want the variance, conditional on $X_T$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a simple approach?&lt;/p&gt;&#xA;" OwnerUserId="27319" LastActivityDate="2017-04-04T07:56:56.263" Title="How do you find variance of a sde?" Tags="&lt;variance&gt;&lt;sde&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33468" PostTypeId="1" AcceptedAnswerId="33470" CreationDate="2017-04-03T19:34:10.563" Score="0" ViewCount="45" Body="&lt;p&gt;I'm building an algorithm which uses a live market data feed to updates its P&amp;amp;L and other metrics. I've been noticing that sometimes in the time and sales there are anomalous prints - prices many standard deviations above or below the best bid/offer on the level 2. Where are these sales coming from? And is there a good method to filter them from the time and sales prints my algorithm is reading? As currently, these anomalous prints are throwing my algo's P&amp;amp;L way off and leading to unnecessary stops.&lt;/p&gt;&#xA;" OwnerUserId="27320" LastActivityDate="2017-04-03T20:09:28.050" Title="Filtering &quot;anomalous&quot; time and sales prints" Tags="&lt;programming&gt;&lt;market-data&gt;&lt;tick-data&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33470" PostTypeId="2" ParentId="33468" CreationDate="2017-04-03T20:09:28.050" Score="1" Body="&lt;p&gt;There should be a code attached to all trades that your program receives from a data feed.  This code tells you the condition of the trade like a cross trade, an out of sequence trade (your problem above), etc.  You need to make these codes part of your program so that your program knows how to handle the info it is getting from the data feed.  I have attached a link to info from SIAC on the NYSE website.  It's an exciting read.  Good luck!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.nyse.com/publicdocs/ctaplan/notifications/trader-update/cts_output_spec.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.nyse.com/publicdocs/ctaplan/notifications/trader-update/cts_output_spec.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26556" LastActivityDate="2017-04-03T20:09:28.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33472" PostTypeId="2" ParentId="33467" CreationDate="2017-04-03T22:11:52.153" Score="6" Body="&lt;p&gt;Here are two approaches that you could take to compute the variance of $X_t$. I am not making the conditioning explicit as it just complicates the notation but doesn't really add any additional insights.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Compute $\mathbb{E} \left[ X_t \right]$ and $\mathbb{E} \left[ X_t^2 \right]$. You can then you use that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;    \text{Var} \left( X_t \right) = \mathbb{E} \left[ X_t^2 \right] - \mathbb{E} \left[ X_t \right]^2.&#xA;\end{equation}&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Compute the cumulant generating function&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;    \psi_{X_t}(\omega) = \ln \left( \mathbb{E} \left[ e^{\mathrm{i} \omega X_t} \right] \right).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then use that the $n$-th cumulant is linked to the $n$-th derivative of the cumulant generating function at $\omega = 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;    c_n \left( X_t \right) = \frac{1}{\mathrm{i}^n} \frac{\partial^n}{\partial \omega^n} \psi_{X_t}(0).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first two cumulants are equal to the mean and variance, respectively.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In what follows, I am working out the first approach. In your case, the dynamics of $X$ are given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathrm{d}X_t = \lambda \left( 1 - X_t \right) \mathrm{d}t + \sigma \sqrt{X}_t \mathrm{d}W_t.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this is a special case of a square-root process with mean reversion speed $\lambda$ and a long-term mean of one. The solution here is thus a special case of the more general solution given e.g. in the context of the Cox-Ingersoll-Ross interest rate model or the Heston stochastic volatility model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, we remove the geometric drift term $-\lambda X_t \mathrm{d}t$ by setting $Y_t = e^{\lambda t} X_t$. Its differential is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\mathrm{d}Y_t &amp;amp; = &amp;amp; \lambda e^{\lambda t} X_t \mathrm{d}t + e^{\lambda t} \mathrm{d}X_t\\&#xA;&amp;amp; = &amp;amp; \lambda e^{\lambda t} \mathrm{d}t + \sigma e^{\lambda t} \sqrt{X_t} \mathrm{d}W_t\\&#xA;&amp;amp; = &amp;amp; \lambda e^{\lambda t} \mathrm{d}t + \sigma e^{\lambda t / 2} \sqrt{Y_t} \mathrm{d}W_t.&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Integrating yields&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;Y_t &amp;amp; = &amp;amp; Y_0 + \lambda \int_0^t e^{\lambda u} \mathrm{d}u + \sigma \int_0^t e^{\lambda u / 2} \sqrt{Y_u} \mathrm{d}W_u\\&#xA;&amp;amp; = &amp;amp; Y_0 + e^{\lambda t} - 1 + \sigma \int_0^t e^{\lambda u / 2} \sqrt{Y_u} \mathrm{d}W_u.&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $\mathbb{E} \left[ X_t \right] = e^{-\lambda t} \mathbb{E} \left[ Y_t \right]$, we conclude that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathbb{E} \left[ X_t \right] = e^{-\lambda t} X_0 + \left( 1 - e^{-\lambda t} \right).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next, we compute the differential of $Y_t^2$ and get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\mathrm{d} Y_t^2 &amp;amp; = &amp;amp; 2 Y_t \mathrm{d}Y_t + \mathrm{d} \langle Y \rangle_t\\&#xA;&amp;amp; = &amp;amp; 2 \lambda e^{\lambda t} Y_t \mathrm{d}t + 2 \sigma e^{\lambda t / 2} Y_t \sqrt{Y_t} \mathrm{d}W_t + \sigma^2 e^{\lambda t} Y_t \mathrm{d}t.&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Integrating again gives&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;Y_t^2 = Y_0^2 + \left( 2 \lambda + \sigma^2 \right) \int_0^t e^{\lambda u} Y_u \mathrm{d}u + 2 \sigma \int_0^t e^{\lambda u / 2} Y_u \sqrt{Y_u} \mathrm{d}W_u.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The expectated value is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\mathbb{E} \left[ Y_t^2 \right] &amp;amp; = &amp;amp; Y_0^2 + \left( 2 \lambda + \sigma^2 \right) \int_0^t e^{\lambda u} \mathbb{E} \left[ Y_u \right] \mathrm{d}u\\&#xA;&amp;amp; = &amp;amp; Y_0^2 + \left( 2 \lambda + \sigma^2 \right) \int_0^t e^{\lambda u} \left( Y_0 + e^{\lambda u} - 1 \right) \mathrm{d}u\\&#xA;&amp;amp; = &amp;amp; Y_0^2 + \left( 2 \lambda + \sigma^2 \right) \left( \frac{1}{\lambda} \left( Y_0 - 1 \right) \left( e^{\lambda t} - 1 \right) + \frac{1}{2 \lambda} \left( e^{2 \lambda t} - 1 \right) \right)&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $\mathbb{E} \left[ X_t^2 \right] = e^{-2 \lambda t} \mathbb{E} \left[ Y_t^2 \right]$, we get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\mathbb{E} \left[ X_t^2 \right] &amp;amp; = &amp;amp; e^{-2 \lambda t} X_0^2 + \left( 2 \lambda + \sigma^2 \right) \left( \frac{1}{\lambda} \left( X_0 - 1 \right) \left( e^{-\lambda t} - e^{-2 \lambda t} \right) + \frac{1}{2 \lambda} \left( 1 - e^{-2 \lambda t} \right) \right)\\&#xA;&amp;amp; = &amp;amp; e^{-2 \lambda t} X_0^2 + 2 X_0 \left( e^{-\lambda t} - e^{-2 \lambda t} \right) + \frac{\sigma^2}{\lambda} X_0 \left( e^{-\lambda t} - e^{-2 \lambda t} \right)\\&#xA;&amp;amp; &amp;amp; + \left( 1 - e^{-\lambda t} \right)^2 + \frac{\sigma^2}{2 \lambda} \left( 1 - e^{-\lambda t} \right)^2.&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\left( \mathbb{E} \left[ X_t \right] \right)^2 = e^{-2 \lambda t} X_0^2 + 2 X_0 \left( e^{-\lambda t} - e^{-2 \lambda t} \right) + \left( 1 - e^{-\lambda t} \right)^2,&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;it follows that the variance of $X_t$ is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\text{Var} \left( X_t \right) = \frac{\sigma^2}{\lambda} X_0 \left( e^{-\lambda t} - e^{-2 \lambda t} \right) + \frac{\sigma^2}{2 \lambda} \left( 1 - e^{-\lambda t} \right)^2.&#xA;\end{equation}&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-04-04T07:56:56.263" LastActivityDate="2017-04-04T07:56:56.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33473" PostTypeId="1" CreationDate="2017-04-04T06:42:16.807" Score="1" ViewCount="478" Body="&lt;p&gt;Supposing I am using the following models to forecast conditional volatility of index returns, whereby In-sample data is 1996-2007 and out of sample data is 2007-2012, using GARCH type models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have 3 indexes for South Africa (JSETop40), Australia (ASX200) and United States (S&amp;amp;P500 Composite).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Starting with South Africa, as I seem to have less doubts with this:&lt;/strong&gt; &#xA;1) If I plot the squared returns of this index, I get a plot highly suggestive of AR(1) for the in-sample period, and out of sample period. See below.&#xA;&lt;a href=&quot;https://i.stack.imgur.com/rQOlF.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/rQOlF.jpg&quot; alt=&quot;SA-fullsample&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://i.stack.imgur.com/GkPG6.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/GkPG6.jpg&quot; alt=&quot;SA-insample&quot;&gt;&lt;/a&gt;&#xA;2) Using the Information criteria for the returns, suggests AR(1) as having the lowest SIC. The only other possible option from analysing the information criteria and plots is an AR(3).&#xA;3) Next, having done the OLS, I can proceed to do my ARCH test.&#xA;4) I next proceed to see if my AR(1) will be ok in doing the joint estimation of my GARCH models. I find AR(1) when used in the mean specification gives significant terms in the mean and variance. I try some other combinations (as a confirmation check) which give significance and note down their AIC's and SIC's. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I find an AR(1) to have one of the lowest SIC's and the third best AIC, therefore I conclude I can model the JSEtop40 Index returns with an AR(1)-GARCH(1,1) model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Does this sound reasonale?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem comes with Australia (ASX200) and the United States (S&amp;amp;P500)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Australia&lt;/strong&gt;&#xA;I repeat the steps in much the same way as South Africa.&#xA;1) Plot the ACF's and PACF's of squared returns - In-sample period and Full sample. The plots seem to suggest something in the range of 0&amp;lt;=p,q&amp;lt;=3&#xA;&lt;a href=&quot;https://i.stack.imgur.com/WE5SM.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/WE5SM.jpg&quot; alt=&quot;Aus-fullsample&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://i.stack.imgur.com/3K5MS.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/3K5MS.jpg&quot; alt=&quot;Aus-insample&quot;&gt;&lt;/a&gt;&#xA;2) I then calculate the AIC's and SIC's of the returns series for the full sample and in-sample period. The SIC suggests an ARMA (0,0) specification both for the in-sample and full-sample periods. However the ARMA(1,1) model does perform reasonably well across the board.&#xA;3) Proceed to do the OLS and ARCH-LM tests&#xA;4) I check if indeed an ARMA(1,1)-GARCH(1,1) is appropriate. It is found that it isn't. I try all other different combinations and none yield significant terms execept an ARMA(0,0)-GARCH(1,1). Therefore I am forced to settle with this model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Does this sound reasonable?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;United States&lt;/strong&gt;&#xA;I repeat the steps in much the same way as South Africa and Australia.&#xA;1) Plot the ACF's and PACF's of squared returns - In-sample period and Full sample. The plots are harder to interpret and not really suggestive of a pattern. See below.&#xA;&lt;a href=&quot;https://i.stack.imgur.com/P4aup.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/P4aup.jpg&quot; alt=&quot;US-fullsample&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://i.stack.imgur.com/QW0vn.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/QW0vn.jpg&quot; alt=&quot;US-insample&quot;&gt;&lt;/a&gt;&#xA;2) I then calculate the AIC's and SIC's of the returns series for the full sample and in-sample period. The SIC suggests an ARMA (1,1) specification for the full sample period and an ARMA(0,0) for the in-sample period. However, The ARMA(1,1) does perform really well across the board for both AIC and SIC and for both full sample and in-sample.&#xA;3) Proceed to do the OLS and ARCH-LM tests&#xA;4) I check if indeed an ARMA(1,1)-GARCH(1,1) is appropriate. It is found that it isn't. I try all other different combinations and none yield significant terms execept an ARMA(0,0)-GARCH(1,1) and an ARMA(2,2)-GARCH(1,1). Therefore I choose the ARMA(2,2) for GARCH(1,1) and for GARCH-M. I am forced to choose ARMA(0,0) for EGARCH and GJR-GARCH.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Does this sound reasonable?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am aware SIC tends to underestimate while AIC will generally overestimate. But in this case it does appear SIC is more accurate. Using AR and MA terms when doing joint estimation of my GARCH models does not give me significant terms, therefore surely it can't be correct, and I am left with no option but to use ARMA(0,0) for the mean specification for both Australia and the United States. However, is this not inconsistent with what the ACF and PACF plots show at the very beginning?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can one model stock index returns with no AR and MA terms? If so what is the logic. A comment would be appreciated as to what would be best/what ARMA terms are usually selected for the S&amp;amp;P500 and ASX200.&lt;/p&gt;&#xA;" OwnerUserId="27046" LastActivityDate="2017-05-04T14:09:01.807" Title="Joint estimation of GARCH models with ARMA terms in the conditional mean: a necessity?" Tags="&lt;garch&gt;&lt;estimation&gt;&lt;arma&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33474" PostTypeId="2" ParentId="33439" CreationDate="2017-04-04T06:47:38.890" Score="2" Body="&lt;p&gt;This is a class of problems called Mixed-Integer Linear Programming (MILP). You can link the limit on the number of assets (cardinality) back to the objective function through boundary constraints on your weights.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $w_i$ be the weights and $s_i$ the scores. Let $w_i^{max}$ and $w_i^{min}$ be the maximum and minimum allowed weight for asset $i$. Introduce the variables $z_i\in{0,1}$ to indicate whether asset $i$ is in the portfolio, and let $K$ be the maximum number of assets in the portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The maximization objective is &#xA;$$max(w_i) \sum_i w_is_i$$&#xA;under the weight constraint&#xA;$$ z_iw_i^{min}\leq w_i \leq z_iw_i^{max}$$&#xA;and the cardinality constraint&#xA;$$ \sum_i z_i \leq K$$&#xA;The weight constraint guarantees that $w_i$ is zero when $z_i$ is zero. There are several numerical packages available to solve this class of optimizations, for example CVXOPT in Python or intlinprog in Matlab.&lt;/p&gt;&#xA;" OwnerUserId="5107" LastActivityDate="2017-04-04T06:47:38.890" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33476" PostTypeId="1" AcceptedAnswerId="33479" CreationDate="2017-04-04T08:50:06.883" Score="0" ViewCount="238" Body="&lt;p&gt;I was trying to solve the following exercise:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Stocks A have $\mu_A=8\%$, $\sigma_A=2,5\%$ and stocks B have $\mu_B=6\%$, $\sigma_B=1,2\%$. Let us suppose that expexted returns are independent. What is the standard deviation of a portfolio made up of one stock A and one stock B?&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since expected returns are independent, I immediately thought of the formula &#xA;$$\sigma_P^2=w\sigma_A^2+(1-w)\sigma_B^2,$$&#xA;where $w$ represents the weight of stock A in the portfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I was wondering whether in the text there is a missing value, such as the weight of one stock in the portfolio. I don't think I can assume stocks are equally weighted. Anyway the final result is $2.77\%$. &#xA;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="22470" LastActivityDate="2017-04-04T13:06:32.387" Title="A portfolio with two risky assets - Simple exercise" Tags="&lt;portfolio&gt;&lt;standard-deviation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33477" PostTypeId="2" ParentId="33399" CreationDate="2017-04-04T09:15:09.893" Score="0" Body="&lt;p&gt;Actually, I ran the model with higher number of time periods and RN probabilities from both, USD and INR, perspectives seem to converge to the real RN probability associated with a lognormal model. So, the apparent paradox is because binomial approximation to Lognormal model works only when the duration of each time period is very small(or high number of time periods. When we use fewer number of time periods, the binomial model is at most a good approximation. So, the approximations are bound to differ from the real RN probability when viewed from INR or USD perspectives.&lt;/p&gt;&#xA;&lt;p&gt;Thanks everyone for trying it out and helping me.&lt;/p&gt;&#xA;&lt;p&gt;For others, just an update: Here is the mathematics behind the convergence of RN probability when you increase the number of time periods. The final value remains the same whether you approach from USD or INR perspective.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Pfiai.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Pfiai.png&quot; alt=&quot;Risk Neutral Probability for a n-period model&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;When n tends to infinity, use L-hospitols rule for finding the limit&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Q9VK7.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Q9VK7.png&quot; alt=&quot;When n tends to infinity, use L-hospitols rule for finding the limit&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;You can checkout this link as well: &lt;a href=&quot;http://www.columbia.edu/%7Eks20/FE-Notes/4700-07-Notes-GBM.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;PDF&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;The same can be repeated and verified from USD perspective.&lt;/p&gt;&#xA;" OwnerUserId="27273" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2017-04-10T10:22:56.370" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="33478" PostTypeId="1" AcceptedAnswerId="33483" CreationDate="2017-04-04T09:27:02.417" Score="2" ViewCount="771" Body="&lt;p&gt;Assume I have M portfolios, each of them can be represented as a T by N matrix, where N represents number of stocks traded and T represents number of days. For each portfolio matrix, each row is under the following constraints:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Absolute values for each row entries sum up to one which represents the weight of money allocation.&lt;/li&gt;&#xA;&lt;li&gt;Sum of all entries on each row is zero which means a dollar neutral portfolio.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;My question is that is there a mathematical solution of finding weights &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;w_1, w_2, ... w_M &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;such that &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;w_i&amp;gt;=0 for i in 1,2, ... M&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;w_1 + w_2 + ... + w_M = 1 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;such that the combined portfolio has minimum overall turnover.&lt;/p&gt;&#xA;" OwnerUserId="16940" LastActivityDate="2017-04-04T16:00:09.170" Title="Minimize overall portfolio turnover under constraints" Tags="&lt;portfolio-management&gt;&lt;portfolio-optimization&gt;&lt;asset-allocation&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33479" PostTypeId="2" ParentId="33476" CreationDate="2017-04-04T13:06:32.387" Score="0" Body="&lt;p&gt;If you buy a position in stock A, the variance is $0.025^2$. If now you buy an additional position of the same size in stock B, the variance is $0.025^2+0.012^2=0.000769$. Independent variances can be added. However I have to say this is not well explained in the problem statement, which is very unclear. We are adding a new position with additional money, not splitting a given amount of money between the 2 stocks. $\sqrt{0.00769}=0.02773$&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2017-04-04T13:06:32.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33480" PostTypeId="1" CreationDate="2017-04-04T13:17:54.010" Score="0" ViewCount="204" Body="&lt;p&gt;Suppose we have $N$ risky assets $r_1$, $r_2$, ... , $r_N$ with a covariance matrix C. If we want to build a portfolio $\omega = (\omega_1, \ldots, \omega_N)^t$ (I loosely denote the portfolio with the weights vector $\omega$) with a minimum variance we solve the following optimization problem:&#xA;$$&#xA;  \omega^tC\omega \longrightarrow \min&#xA;$$&#xA;subject to&#xA;$$&#xA;\omega^t.1_N = 1&#xA;\\ &#xA;\omega \geq 0_N&#xA;$$&#xA;where $1_N$ and $0_N$ are column vectors of dimension $N$ with ones and zeros, respectively. This problem could be solved, for example, with Lagrange multipliers and the problem is a convex optimization problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let us add a risk-free asset $r_f$. If we now want to build a portfolio how does the optimization problem change? In my research I've seen that people refer to Sharpe ratio optimization but I couldn't identify the rigorous mathematical formulation, only strategies for a solution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how is the model above adapted?  &lt;/p&gt;&#xA;" OwnerUserId="27329" LastEditorUserId="24222" LastEditDate="2017-04-04T18:32:33.080" LastActivityDate="2017-04-04T18:32:33.080" Title="Portfolio with several risky assets and one risk-free" Tags="&lt;portfolio-optimization&gt;&lt;finance-mathematics&gt;&lt;sharpe-ratio&gt;&lt;risk-free&gt;" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="33481" PostTypeId="2" ParentId="33473" CreationDate="2017-04-04T13:18:50.813" Score="1" Body="&lt;p&gt;You are confusing the cond. mean process and cond. variance process : the autocorrelation plot of the squared returns gives you information about the cond. variance process (not the ARMA part !)  .  So you can't draw conclusion on the mean process. The squared returns are almost always autocorrelated since volatility is know to be time-varying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to observe the autocorrelations of the &lt;strong&gt;raw&lt;/strong&gt; logs returns, if there are significant you need to model the cond mean, otherwise you can directly model the variance process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can read the following book for more information :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;Tsay, R. S. (2005). Analysis of Financial Time Series Second Edition (Second Edition).&lt;/em&gt;  &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2017-04-04T13:18:50.813" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33482" PostTypeId="1" AcceptedAnswerId="33487" CreationDate="2017-04-04T13:25:39.587" Score="1" ViewCount="1860" Body="&lt;p&gt;Suppose $C_i$ is i-day's closed price, when drift is small,&#xA;we have the close to close variance&#xA;$$\sigma^2 =\dfrac{1}{n}\sum\limits^n_{i = 1}\left(\log\left(\dfrac{C_i}{C_{i-1}}\right)\right)^2.$$&#xA;If we adjust this for the drift,&#xA;$$\sigma^2 =\dfrac{1}{n-1}\sum\limits^n_{i = 1}\left(\left(\log\left(\dfrac{C_i}{C_{i-1}}\right)\right)^2 - \dfrac{\log\left(\left(\dfrac{C_n}{C_0}\right)\right)^2}{n(n-1)}\right).$$&#xA;I don't know how to obtain the later one in the bracket? I know the original one should be&#xA;$$\left(\log\left(\dfrac{C_i}{C_{i-1}}\right) - \dfrac{\log\left(\dfrac{C_n}{C_0}\right)}{n}\right)^2$$&lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-04-04T15:28:10.147" Title="variance of log return" Tags="&lt;variance&gt;&lt;return&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33483" PostTypeId="2" ParentId="33478" CreationDate="2017-04-04T14:11:50.753" Score="2" Body="&lt;p&gt;I'm not entirely sure what you mean in your set-up. Typically, what one wants to do is maximize utility given some turnover constraint. I believe what you're talking about is optimizing several portfolios and minimizing the turnover across all of them. Hence, if you understand the simple case, then it should be easy to adapt it to your problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, consider a booksize constraint&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sum\left|w_{i}\right|=K$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;that ensures that the absolute value of each position sums to some value $K$. Convex optimizers can't handle this because of the discontinuity. The trick  is to re-write it with slack variables $x_{i}\geq0$ and $y_{i}\geq0$ with the constraints&#xA;$$w_{i}=x_{i}-y_{i}$$&#xA;$$\sum\left(x_{i}+y_{i}\right)=K$$ &#xA;So for instance, if $w_{1}=-0.1$, then $x_{1}=0$ and $y_{1}=0.1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This analysis extends easily to handle turnover constraints of the form&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sum\left|w_{i} - w_{0}\right|=K$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so all that is required is changing the constraint restricting $x$ and $y$ to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$w_{i} - w_{0}=x_{i}-y_{i}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes when dealing with transaction costs, it can also be helpful to add in the constraint&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$x_{i}y_{i}=0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to ensure that $x$ or $y$ and identified and one is fixed to zero. It may not be necessary because the optimizer should force one to be zero as a result of finding the optimal portfolio, but if you see something like if $w_{1}=-0.1$ and $x_{1}=0.1$ and $y_{1}=0.2$, then you would want to add it. This would require an optimizer that handles non-linear constraints, whereas above only requires inequality constraints.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, an alternate approach would be to place a constraint on the L2-norm&#xA;$$\left\Vert w_{i}-w_{0}\right\Vert \leq K$$&#xA;which can be re-written&#xA;$$\left(w_{i}-w_{0}\right)'\left(w_{i}-w_{0}\right)\leq K&#xA; $$ and included in any optimizer that handles non-linear constraints. The downside of this is that it's a little less intuitive than a proper turnover constraint and you may have to test out different values of $K$.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastEditorUserId="2379" LastEditDate="2017-04-04T16:00:09.170" LastActivityDate="2017-04-04T16:00:09.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33484" PostTypeId="1" AcceptedAnswerId="33486" CreationDate="2017-04-04T14:31:47.050" Score="2" ViewCount="209" Body="&lt;p&gt;as stated: why other assets' value can be determined by taking into consideration their expected cash flow (CF)? I read an argument which refers to arbitrage, but I wonder is there an additional simple argument from a theoretical point of view. &#xA;thanks, &lt;/p&gt;&#xA;" OwnerUserId="17024" LastActivityDate="2017-04-05T06:51:44.603" Title="Why is option value different from discounted CF" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;derivatives&gt;" AnswerCount="2" CommentCount="1" ClosedDate="2017-04-05T17:14:59.000" ContentLicense="CC BY-SA 3.0" />
  <row Id="33485" PostTypeId="1" AcceptedAnswerId="33488" CreationDate="2017-04-04T14:58:33.550" Score="0" ViewCount="260" Body="&lt;p&gt;I have several activity records which include several transaction types: &lt;code&gt;buy&lt;/code&gt;, &lt;code&gt;sell&lt;/code&gt;, &lt;code&gt;short&lt;/code&gt;, &lt;code&gt;cover&lt;/code&gt;, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand the impact of &lt;code&gt;buy&lt;/code&gt; and &lt;code&gt;sell&lt;/code&gt; on the Unrealized, Daily and Realized P&amp;amp;L of a security or Portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, how do you deal with a &lt;code&gt;short&lt;/code&gt; position in a security? Is everything just in reverse (i.e. &lt;code&gt;buy * -1&lt;/code&gt;)?&lt;/p&gt;&#xA;" OwnerUserId="13334" LastActivityDate="2017-04-04T15:17:06.833" Title="How does a Short position impact the PnL?" Tags="&lt;portfolio&gt;&lt;accounting&gt;&lt;pnl&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33486" PostTypeId="2" ParentId="33484" CreationDate="2017-04-04T15:16:33.573" Score="1" Body="&lt;p&gt;Discouting a cash-flow to get its present value only works for non random cash-flows. In the option case, the cash-flow (the option's pay-off) is unknown as it depends on the value of the underlying at maturity, value that you don't know. Therefore you can't simply discount the option pay-off/cash-flow to get the option price/present value of the cash-flow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have to discount first indeed and then take an expectation (with respect to the risk neutral measure) of the discounted payoff to get the option's price. This is general, and for non-random future cash-flow (fix payments) you recover the discounting method. That is what essentialy states the &lt;a href=&quot;https://en.wikipedia.org/wiki/Fundamental_theorem_of_asset_pricing&quot; rel=&quot;nofollow noreferrer&quot;&gt;fundamental theorem of asset pricing&lt;/a&gt; which is connected to the notion of arbitrage (to the non existence of it, precisely).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be more theoretical, under the hypothesis that arbitrage do not exist, there exists a numéraire $N$ and a probability measure $\mathbf{Q}^N$ associated to it such that each tradable asset (of expiry $T$) price $X$ is a (local) martingale under the numéraire $N$, that is $X/N$ is a (local) martingale : $$\forall t\in [0,T], X_t = N_t \mathbf{E}^{\mathbf{Q}^N}\left[ \left.\frac{X_T}{N_T}\right| \mathscr{F}_t\right].$$ (Please note I don't give full precision here, just rough ideas allowing to get a formula for the price.) In particular, today's price at $t=0$ is the expectation $$X_0 = N_0 \mathbf{E}^{\mathbf{Q}^N}\left[ \frac{X_T}{N_T}\right].$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your asset pays a &lt;em&gt;known&lt;/em&gt; cash-flow $c$ at $T$ then $$X_0 = N_0 c \mathbf{E}^{\mathbf{Q}^N}\left[ \frac{1}{N_T}\right].$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Often the measure $N$ is the bank-account numéraire measure (also called risk neutral measure), the numéraire being $N_t = e^{\int_0^t r_s ds}$ where $r_s$ is the time $s$ instantaneous interest rate, and then $$X_0 = c\mathbf{E}^{\mathbf{Q}^N}\left[ e^{-\int_0^T r_s ds}\right].$$ In this case $\mathbf{E}^{\mathbf{Q}^N}\left[ e^{-\int_0^T r_s ds}\right]$ is the price today of the zero-coupon of maturity $T$ (the product that pays you $1$ at $T$), this price is noted $P_{0,T}$ and called the discount factor of maturity $T$, so that simply $$X_0 = c P_{0,T}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You see : to get the price today of a &lt;em&gt;known&lt;/em&gt; (that is, non random) cash-flow $c$ payed at $T$, you simply multiply $c$ by the discount factor $P_{0,T}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, it can be more complex, think of call options for instance, for which for a strike $K$ you'd have $$\textrm{Call price}_{t=0} = k\mathbf{E}^{\mathbf{Q}^N}\left[ e^{-\int_0^T r_s ds}\left( S_T - K \right)_{+}\right]$$ would $S$ be the underlying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a neat introduction to all of this and to quantitative finance, you have the following references :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;chapter 2 of Pierre Henry-Labordère's &quot;Analysis, Geometry, and Modeling in Finance: Advanced Methods in Option Pricing&quot;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;chapter 1 of volume 1 (&quot;Foundations and Vanilla Models&quot;) of Andersen's and Piterbarg's &quot;Interest Rate Modeling&quot;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;They can be a bit &quot;rough&quot;, but there are really worth the pain.&lt;/p&gt;&#xA;" OwnerUserId="13470" LastEditorUserId="13470" LastEditDate="2017-04-05T06:51:44.603" LastActivityDate="2017-04-05T06:51:44.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33487" PostTypeId="2" ParentId="33482" CreationDate="2017-04-04T15:16:59.387" Score="3" Body="&lt;p&gt;You have the parentheses in the wrong place! The correct formula is&#xA;$$&#xA;\sigma^2 = \frac{1}{n-1}\left(\sum_{i=1}^n\ln^2\left(\frac{C_i}{C_{i-1}}\right)\right)-\frac{1}{n(n-1)}\ln^2\left(\frac{C_n}{C_{0}}\right)&#xA;$$&#xA;To see this, start with your original formula and expand.&#xA;$$&#xA;\begin{align}&#xA;\sigma^2 &amp;amp;= \frac{1}{n-1}\sum\left[\ln\left(\frac{C_i}{C_{i-1}}\right)-\frac{1}{n}\ln\left(\frac{C_n}{C_0}\right)\right]^2 \\&#xA;&amp;amp;= \frac{1}{n-1}\left[\sum\ln^2\left(\frac{C_i}{C_{i-1}}\right)-\sum\frac{2}{n}\ln\left(\frac{C_n}{C_0}\right)\ln\left(\frac{C_i}{C_{i-1}}\right)+\sum\frac{1}{n^2}\ln^2\left(\frac{C_n}{C_0}\right)\right] \\&#xA;&amp;amp;= \frac{1}{n-1}\left[\sum\ln^2\left(\frac{C_i}{C_{i-1}}\right)-\frac{2}{n}\ln^2\left(\frac{C_n}{C_0}\right)+\frac{1}{n}\ln^2\left(\frac{C_n}{C_0}\right)\right] \\&#xA;&amp;amp;= \frac{1}{n-1}\left[\sum\ln^2\left(\frac{C_i}{C_{i-1}}\right)-\frac{1}{n}\ln^2\left(\frac{C_n}{C_0}\right)\right] \\&#xA;&amp;amp;= \frac{1}{n-1}\sum_{i=1}^n\ln^2\left(\frac{C_i}{C_{i-1}}\right)-\frac{1}{n(n-1)}\ln^2\left(\frac{C_n}{C_{0}}\right)&#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="5617" LastEditorUserId="5617" LastEditDate="2017-04-04T15:28:10.147" LastActivityDate="2017-04-04T15:28:10.147" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33488" PostTypeId="2" ParentId="33485" CreationDate="2017-04-04T15:17:06.833" Score="2" Body="&lt;p&gt;Lots of ways to do this.  Below is a pretty simple example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Side    Position (Shares)   Entry Price Current Price   Open PnL&#xA;Long    1000                100         90              -10,000&#xA;Short   -1000               100         90               10,000&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You don't need the Side and Position if you are going to use -ve values for Short positions.  I just put both in for your benefit.  Having Short and a -ve Position size is redundant and/or a double negative.  Using either one to adjust your PnL formula will work.  I personally use -ve numbers for Short positions and don't use an actual Short label.&lt;/p&gt;&#xA;" OwnerUserId="26556" LastActivityDate="2017-04-04T15:17:06.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33489" PostTypeId="1" CreationDate="2017-04-04T15:23:03.980" Score="0" ViewCount="404" Body="&lt;p&gt;I wish to calibrate the Heston model parameters to a given smile. Trouble is, I have Heston implemented as a Monte Carlo simulation, and not some deterministic pricing function. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, how do we calibrate a monte carlo simulation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My idea was to generate all the random numbers I need in the monte carlo simulation, and then create a new pricing function which always uses these same numbers, so its deterministic. Then, we can run regular calibration on this function. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would that be ok? Is there another method?&lt;/p&gt;&#xA;" OwnerUserId="27332" LastActivityDate="2017-04-04T18:46:18.710" Title="Calibration of Monte Carlo value?" Tags="&lt;calibration&gt;&lt;heston&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33490" PostTypeId="2" ParentId="33484" CreationDate="2017-04-04T15:38:49.863" Score="0" Body="&lt;p&gt;I guess the existence of a market is the gist of the question. It is easier to understand if you compare the &lt;em&gt;insurance&lt;/em&gt; industry with the &lt;em&gt;investment banking&lt;/em&gt; industry:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Broadly speaking, when an insurer underwrites an insurance policy, it is unable to hedge its risk by subscribing the same insurance policy it just underwrote $-$ there exists reinsurance treaties that allow insurers to offload part of their risk, but they tend to be aggregate (&lt;em&gt;i.e.&lt;/em&gt; on a portfolio of policies basis) and non-linear (see &lt;a href=&quot;https://en.wikipedia.org/wiki/Reinsurance#Non-proportional&quot; rel=&quot;nofollow noreferrer&quot;&gt;non-proportional reinsurance&lt;/a&gt; article in Wikipedia if you are interested). Hence, a risk management approach based on expected cash flows and the law of large numbers is a sensible approach.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;On the contrary, investment banks can hedge their derivative exposure by entering a trade which corresponds to a contrary, offsetting position to the one they just underwrote.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The main difference between these 2 situations is the existence of a (reasonably) complete, (reasonably) liquid and (reasonably) well-functioning market, which leads to the following claims:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;When there is a functioning market in the risk you trade, your price must be determined by the &lt;strong&gt;absence of arbitrage&lt;/em&gt;&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;When there is no functioning market for this risk, your price must rely on your &lt;strong&gt;expected cash flows&lt;/strong&gt; and the &lt;strong&gt;law of large numbers&lt;/em&gt;&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So, getting back to the purely financial realm and forgetting about insurance, I guess you can apply this type of reasoning to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Other assets for which there is no sufficiently liquid market for them, such as Commercial Real Estate;&lt;/li&gt;&#xA;&lt;li&gt;In general, corporate finance projects, companies investment plans, etc. which have traditionally been evaluated through the discounted cash flows method.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;To finish off, I will include some excerpts from the introduction (Chapter 1) of Baxter's and Rennie's excellent book &lt;em&gt;Financial Calculus&lt;/em&gt;':&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;With markets where the stock can be bought and sold freely and arbitrarily positive and negative amounts of stock can be maintained without cost, trying to trade forward using the strong law would lead to disaster […].&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;[…]&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;But the existence of an arbitrage price, however surprising, overrides the strong law. To put it simply, if there is an arbitrage price, any other price is too dangerous to quote.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;[…]&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The strong law and expectation give the wrong price for forwards. But in a certain sense, the forward is a special case. The construction strategy $-$ buying the stock and holding it $-$ certainly wouldn’t work for more complex claims. The standard call option which offers the buyer the right but not the obligation to receive the stock for some strike price agreed in advance certainly couldn’t be constructed this way. If the stock price ends up above the strike, then the buyer would exercise the option and ask to receive the stock – having it salted away in a drawer would then be useful to the seller. But if the stock price ends up below the strike, the buyer will abandon the option and any stock owned by the seller would have incurred a pointless loss.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Thus maybe a strong-law price would be appropriate for a call option, and until 1973, many people would have agreed. Almost everything appeared safe to price via expectation and the strong law, and only forwards and close relations seemed to have an arbitrage price. Since 1973, however, and the infamous Black-Scholes paper, just how wrong this is has slowly come out. Nowhere in this book will we use the strong law again. […] All derivatives can be built from the underlying $-$ arbitrage lurks everywhere.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="20454" LastActivityDate="2017-04-04T15:38:49.863" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="33491" PostTypeId="1" CreationDate="2017-04-04T15:39:12.337" Score="2" ViewCount="88" Body="&lt;p&gt;I note $L_{t}^{[T_s, T_e]}$ the forward rate at time $t$ for the period $[T_s, T_e]$. Recall it is the strike making equal to $0$ the value at time $t$ of a forward contract for the period $[T_s, T_e]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The strategy I am looking at is the following : I enter (for $0$) at time $t$ in a payer (I pay the strike) forward contract for the period $[T_s, T_e]$ and at a later time $t'$ I unwind my position by entering in a receiver (I receive the strike) forward contract for the period $[T_s, T_e]$. Noting $X$ the notional and $\delta$ the year fraction represented by the period $[T_s, T_e]$, my payout at time $T_e$ is $$X\delta\left( L_{T_s}^{[T_s, T_e]}&#xA; - L_{t}^{[T_s, T_e]}\right) - X\delta\left( L_{T_s}^{[T_s, T_e]}&#xA; - L_{t'}^{[T_s, T_e]}\right) = X\delta \left(L_{t'}^{[T_s, T_e]} - L_{t}^{[T_s, T_e]}\right).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(From two times nothing I have generated a non zero P&amp;amp;L.) From there, assuming non arbitrage and therefore the existence of a local martingale numéraire $N$ and an associated local martingale measure $\mathbf{Q}^N$, I basically want to apply the $\mathbf{E}^{\mathbf{Q}^N} \left[ \bullet | \mathscr{F}_t\right]$ operator and conclude that $L_{t}^{[T_s, T_e]}$ is a martingale under $\mathbf{Q}^N$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dividing $X\delta \left(L_{t'}^{[T_s, T_e]} - L_{t}^{[T_s, T_e]}\right)$ by $N_t$ leads by for the &quot;$L_{t'}^{[T_s, T_e]}$ part&quot; with a $\frac{N_{t'}}{N_t}$ factor I can get rid of.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I do this properly ? (I voluntarily stay in a non-diffusive setting.) &lt;/p&gt;&#xA;" OwnerUserId="13470" LastEditorUserId="13470" LastEditDate="2017-04-04T22:06:27.627" LastActivityDate="2017-04-04T22:06:27.627" Title="An arbitrage strategy involving forward contracts to show that LIBOR rates are martingales" Tags="&lt;arbitrage&gt;&lt;risk-neutral-measure&gt;&lt;martingale&gt;&lt;numerairechange&gt;&lt;pnl&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33492" PostTypeId="1" CreationDate="2017-04-04T15:39:29.633" Score="2" ViewCount="124" Body="&lt;p&gt;I think I'm having some trouble understanding what trading futures/forward contracts means. Assuming a market over the period $[0,T]$, for a European contingent claim $X_T$, my naive understanding is that: Bob buying such a contingent claim at time $t\in [0,T)$ from Alice means Bob paying Alice $V(t,\omega)$, the value of this contingent claim at $(t,\omega)$, and Alice giving the contingent claim to Bob so that now Bob owns it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For forwards I think they are essentially a very simple type of European contingent claims, so they should also be traded in the above manner: the buyer pays the seller the value of the forward contract and the seller becomes the new owner of the contract. Is my understanding correct so far?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For futures things become more complicated due to the margin account mechanism. Let's say Bob establishes one long futures contract to buy the underlying (whose price process is, say, $S_t$) at the arbitrage-free futures price $F_0=S_0e^{rT}$ in time $T$. Now, at some time $t\in (0, T)$, Bob wants to sell the contract to Alice. Then &lt;br&gt;&#xA;1). is it possible to do so in the real world financial market?&lt;br&gt;&#xA;2). If such a trade is legitimate, is there any conventional way to do this? For example, &lt;em&gt;how much&lt;/em&gt; should Alice pay Bob? This is now ambiguous because unlike forwards the value of a futures is automatically set to zero in its daily settlement. So I'm essentially asking are futures contracts traded prior or posterior to the daily marking to market.&lt;/p&gt;&#xA;" OwnerUserId="19004" LastActivityDate="2017-04-04T15:39:29.633" Title="Are futures/forward contracts tradable in the middle of its life? If yes, how?" Tags="&lt;futures&gt;&lt;trading&gt;&lt;forward&gt;" AnswerCount="0" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="33493" PostTypeId="1" AcceptedAnswerId="33659" CreationDate="2017-04-04T15:57:41.147" Score="7" ViewCount="1755" Body="&lt;p&gt;What might be the reason for a futures price on a stock being much lower than the spot, i.e. stock price?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Spot = 8.30&#xA;Futures &#xA;M17 = 7.45&#xA;U17 = 7.23&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The company does not pay dividends.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No-arbitrage pricing would suggest negative financing cost:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;F(t) = S(t) * exp((risk-free_rate - dividend_yield)*(T-t))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can this be explained by an extraordinary demand for hedging spot positions via shorting futures?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Completing the answer with stock quotes (this is a very popular Polish company with around 6 bn USD of asset value):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stooq.pl/q/?s=pxm&amp;amp;c=10d&amp;amp;t=b&amp;amp;a=lg&amp;amp;b=0&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://stooq.pl/q/?s=pxm&amp;amp;c=10d&amp;amp;t=b&amp;amp;a=lg&amp;amp;b=0&lt;/a&gt;        8,19&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stooq.pl/q/?s=fpxmm17&amp;amp;c=10d&amp;amp;t=b&amp;amp;a=lg&amp;amp;b=0&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://stooq.pl/q/?s=fpxmm17&amp;amp;c=10d&amp;amp;t=b&amp;amp;a=lg&amp;amp;b=0&lt;/a&gt;    7,67&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://stooq.pl/q/?s=fpxmu17&amp;amp;c=10d&amp;amp;t=b&amp;amp;a=lg&amp;amp;b=0&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://stooq.pl/q/?s=fpxmu17&amp;amp;c=10d&amp;amp;t=b&amp;amp;a=lg&amp;amp;b=0&lt;/a&gt;    7.45&lt;/p&gt;&#xA;" OwnerUserId="27334" LastEditorUserId="27334" LastEditDate="2017-04-08T12:45:46.100" LastActivityDate="2017-04-12T21:36:47.640" Title="Why is stock futures price much lower than spot?" Tags="&lt;equities&gt;&lt;futures&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33494" PostTypeId="1" AcceptedAnswerId="33496" CreationDate="2017-04-04T16:52:55.807" Score="-1" ViewCount="129" Body="&lt;p&gt;when I attended fixed-income classes, my Professor used to say that yield-to-maturity determines bond price and not viceversa. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering the meaning of this statement since the definition of yield-to-maturity is &quot;the rate which makes the discounted bond cashflows equal to the bond price&quot;. So, from this statement, it seems to me that bond price is &quot;given&quot;, in a certain sense, and then we can calculate yield-to-maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My impression is that this topic is more or less something like &quot;who came first? The egg or the chicken?&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you please help me to solve this &quot;philosophical&quot; question?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="22470" LastActivityDate="2017-04-04T17:01:07.653" Title="Yield-to-maturity determines bond price or viceversa?" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;bond-yields&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33495" PostTypeId="2" ParentId="33145" CreationDate="2017-04-04T16:59:17.800" Score="0" Body="&lt;p&gt;I believe I have found an exact answer to my question in Thomas Bjork's book, &lt;em&gt;Arbitrage Theory in Continuous Time&lt;/em&gt;, on page 122 (third edition):&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;Meta-theorem 8.3.1&lt;/strong&gt; &lt;em&gt;Let&lt;/em&gt; &lt;span class=&quot;math-container&quot;&gt;$M$&lt;/span&gt; &lt;em&gt;denote the number of underlying&lt;/em&gt; &lt;strong&gt;traded&lt;/strong&gt; &lt;em&gt;assets in the model&lt;/em&gt; &lt;strong&gt;excluding&lt;/strong&gt; &lt;em&gt;the risk free asset, and let&lt;/em&gt; &lt;span class=&quot;math-container&quot;&gt;$R$&lt;/span&gt; &lt;em&gt;denote the number of random sources. Generically we then have the following relations:&lt;/em&gt;&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;em&gt;The model is arbitrage free if and only if&lt;/em&gt; &lt;span class=&quot;math-container&quot;&gt;$M \leq R$&lt;/span&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;The model is complete if and only if&lt;/em&gt; &lt;span class=&quot;math-container&quot;&gt;$M \geq R$&lt;/span&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;The model is complete and arbitrage free if and only if&lt;/em&gt; &lt;span class=&quot;math-container&quot;&gt;$M=R$&lt;/span&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2017-04-04T16:59:17.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33496" PostTypeId="2" ParentId="33494" CreationDate="2017-04-04T17:01:07.653" Score="1" Body="&lt;p&gt;I can only imagine that you professor meant by 'yield-to-maturity' the general yield curve shape changes which indeed affect the prices of bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Normally, 'yield-to-maturity' is one of possible return measures of a bond; practitioners prefer to quote certain class of bonds in terms of yield-to-maturity instead of prices but normally bond prices and yield-to-maturity are just equivalent measures of a bond value.&lt;/p&gt;&#xA;" OwnerUserId="27334" LastActivityDate="2017-04-04T17:01:07.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33497" PostTypeId="1" CreationDate="2017-04-04T17:51:24.517" Score="4" ViewCount="1000" Body="&lt;p&gt;What is the relationship between SABR parameters $\sigma, \alpha, \beta, \rho$ and heston parameters $\nu, \kappa, \theta, \xi, \rho$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do they influence the smile; skewness, kurtosis, etc? And how are they related to one another, i.e., if I calibrate Heston to SABR for some fixed SABR-parameters, how will the estimated Heston parameters depend on the fixed SABR parameters?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there some good literature on the relationship between these two?&lt;/p&gt;&#xA;" OwnerUserId="27335" LastActivityDate="2019-09-26T11:01:10.120" Title="Relationship between SABR and Heston" Tags="&lt;stochastic-volatility&gt;&lt;heston&gt;&lt;sabr&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33498" PostTypeId="1" AcceptedAnswerId="33517" CreationDate="2017-04-04T18:21:49.163" Score="4" ViewCount="845" Body="&lt;p&gt;I was now reading a book on interest rate modelling, and I am having trouble picturing the practical issues of model calibration with the Ho-Lee model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apparently, one of the drawbacks of this model is the following:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The Ho-Lee model effectively has two parameters $-$ $r(0)$ and $\sigma_r$ $-$ with which one can attempt to fit the initial yield curve. It should be clear that this is insufficient to properly match observable discount bond prices, which effectively disqualifies the model from practical pricing applications&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Right after that, the book states the following&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Fortunately, a remedy is quite straightforward: simply introduce a deterministic function $a(t)$ and alter the model to be $r(t) = r(0) + a(t) + \sigma_rW(t)$ with $a(0) = 0$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Two questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;On calibrating this model, how should I go about it? Any particular method that is most popular?&lt;/li&gt;&#xA;&lt;li&gt;Why, according to the first quote, can't we fit term structures with Ho-Lee at all? Is this always the case? And specifically how exactly does a time-dependent parameter improve things so much? &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="13458" LastEditorUserId="13458" LastEditDate="2017-04-05T11:40:29.707" LastActivityDate="2017-04-05T14:01:37.673" Title="Fitting the Term structure of Discount Bonds with Ho-Lee" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;yield-curve&gt;&lt;term-structure&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33500" PostTypeId="2" ParentId="33435" CreationDate="2017-04-04T18:44:47.287" Score="0" Body="&lt;p&gt;Your approach is correct, but the practical difficulty is that you do not see zero-coupon spot rates for maturities longer then 1 year; and zero-coupon spot rates are the relevant rates for pricing zero-coupon bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So 10 year zero-coupon spot rate curve needs to be bootstrapped from other bonds but in practice there are no 10 year zero-coupon bonds traded so this exercise has only theoretical meaning.&lt;/p&gt;&#xA;" OwnerUserId="27334" LastActivityDate="2017-04-04T18:44:47.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33501" PostTypeId="2" ParentId="33489" CreationDate="2017-04-04T18:46:18.710" Score="2" Body="&lt;p&gt;This should generally work but will probably take a very long time as you are running a Monte Carlo simulation within a non-convex optimization problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you are calibrating to European implied volatilities, I would suggest you have a look at Fang and Oosterlee (2008) Fourier cosine method as an alternative to the Monte Carlo simulation. This algorithm is relatively easy to implement (as opposed to the potentially involved scheme you are currently using for the discretization of the Heston process).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you stick to your Monte Carlo approach, then you should try to &quot;recycle&quot; your paths as much as possible. For a given parameter vector, you can e.g. price all European plain vanilla options of the same maturity using the same set of paths.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Further, note that instead of storing all the random numbers, you could also fix the seed of your random number generator (and reset it at each optimization iteration).&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2017-04-04T18:46:18.710" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="33502" PostTypeId="1" AcceptedAnswerId="33848" CreationDate="2017-04-04T19:45:01.637" Score="2" ViewCount="867" Body="&lt;p&gt;I need to calculate Var with 1 year horizon. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the correct way to do it is to calculate standard deviation of daily log returns, then calculate daily Var and multiply it by sqrt(250).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in our company there is another formula: &#xA; 1. so at to calculate returns they divide today's level by level that was one year ago; &#xA; 2. then take standard deviation of these returns&#xA; 3. calculate Var using this standard deviation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe that this approach is not correct, but I can't find how to prove my point of view.. could you please help)&lt;/p&gt;&#xA;" OwnerUserId="27337" LastActivityDate="2017-05-23T15:41:47.893" Title="1-year Var calculated from 1 year volatility" Tags="&lt;volatility&gt;&lt;var&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33505" PostTypeId="2" ParentId="26435" CreationDate="2017-04-04T22:25:20.743" Score="7" Body="&lt;p&gt;I don't know about sticky implied tree, but for sticky strike and sticky implied delta the classification is not that dead end as &lt;a href=&quot;https://quant.stackexchange.com/users/185/onlyvix-blogspot-com&quot;&gt;onlyvix.blogspot.com&lt;/a&gt; might think. Look at Lorenzo Bergomi's &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1520443&quot; rel=&quot;nofollow noreferrer&quot;&gt;Smile Dynamics IV&lt;/a&gt; paper. He defines the &lt;em&gt;skew stickiness ratio&lt;/em&gt; SSR which roughly quantifies how much the ATMF volatility moves conditional on a move of the underlying.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The sticky-strike regime corresponds to SSR = 1 : as the spot moves, implied volatilities for fixed strikes near the money stay frozen – the ATMF volatility&#xA;slides along the smile.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The sticky-delta regime corresponds to SSR = 0. The whole smile experiences&#xA;a translation alongside the spot: volatilities for fixed log-moneyness are&#xA;frozen.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The paper is a bit technical but worth reading as he classifies stochastic volatility models according to SSR's.&lt;/p&gt;&#xA;" OwnerUserId="13470" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2017-04-08T21:52:30.813" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33506" PostTypeId="1" CreationDate="2017-04-05T00:03:10.507" Score="2" ViewCount="311" Body="&lt;p&gt;i want to verify the theoretical VaR 99% for the following Random Variable:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;X=\epsilon + \nu,&#xA;\end{align*}&#xA;$\epsilon \sim \mathcal{N}(0,1)$,&#xA;\begin{align*}&#xA;\nu= \begin{cases}\begin{array}{ll}0 &amp;amp; \text{with prob.}\enspace 0.991 \\&#xA;              -10&amp;amp; \text{with prob.}\enspace 0.009 \end{array} \end{cases}.&#xA;\end{align*}&#xA;So i poved that the theoretical 99% VaR is 3.088. Then i ran some monte carlo simulations in excel( $\epsilon$ as a standard normal and $\nu$ as a bernoulli and so on and used the quantile function). Now i went up to 20000 simulations in excel, but the VaR estimate was very sensible to different simulations , varying from 2-8, but i already saw that most of the estimates were close to the theoretical one.&#xA;I coded the same monte carlo simulation in MATLAB and had to increase the simulation amount to 500000 in order to get a very stable and precise estimate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now i am interested in the reason, 500000 seems very high to me, i have never experienced a situation were it was necessary to run more than 10000 simlations.&#xA;Is it because X is a mixture of a continous and discrete Random Variable?&#xA;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="26565" LastActivityDate="2017-04-05T15:48:43.973" Title="VaR estimate with Monte Carlo simlation" Tags="&lt;monte-carlo&gt;&lt;var&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33507" PostTypeId="1" CreationDate="2017-04-05T02:05:09.050" Score="0" ViewCount="226" Body="&lt;p&gt;$$\tau=T-t$$&#xA;$$u=Ce^{r\tau}$$&#xA;$$x=\ln(\frac{S}{K})+(r-\frac{1}{\sigma^2})\tau$$&#xA;The first transform is reverse in time. The second is reversely discounted call price. But I find it hard to see the intuition behind the third transformation. And I am also wondering why this is not a one-to-one transform of time, call price, and price of the underlying. Why is 'multiplying by a Jacobian' doesn't work in this case?&lt;/p&gt;&#xA;" OwnerUserId="25868" LastEditorUserId="25868" LastEditDate="2017-04-05T04:45:17.667" LastActivityDate="2017-04-05T04:45:17.667" Title="Intuition behind the change of variable of BS into Heat Equation" Tags="&lt;black-scholes&gt;&lt;stochastic-processes&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33509" PostTypeId="2" ParentId="9960" CreationDate="2017-04-05T03:03:36.203" Score="2" Body="&lt;p&gt;The Sharpe ratio is just a transformation of Student's t-test and it is a special case of the t-test so that all requirements to use a t-test apply to any use of the Sharpe ratio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A statistic is &lt;em&gt;any&lt;/em&gt; function that uses data from a sample.  The Sharpe ratio is a statistic.  Although it does not assume normality explicitly, it does assume the existence of a second moment and it is a poor statistic in small samples if the data generating function has a second moment but is not near to the normal distribution and the sample size is small.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It has been argued since Mandelbrot in 1963 that the distribution of returns lacks a mean and hence a variance, or standard deviation.  I have written a proof that no standard deviation exists for stocks that I am about to submit for publication.  Not all statistical distributions have a standard deviation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The gist of my argument is that returns are a future value divided by a present value minus one.  Under the Markowitz assumptions, of many buyers and sellers and markets in equilibrium the logical market behavior is for actors to bid their expectations.  By the central limit theorem, as the number of buyers and sellers become large, the distribution of a set of expectations must converge to normality.  This implies that the distribution is the ratio of two normal distributions, which would be $$\frac{1}{\pi}\frac{\gamma}{\gamma^2+(r-\mu)^2}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you take expectations over the distribution you will find that neither a mean nor a variance exists.  This distribution is the Cauchy distribution. It doesn't really explain returns because of the limitation of liability, liquidity constraints, bankruptcy and mergers however it explains the overwhelming amount of the uncertainty.  You have to move away from the Markowitz assumptions to get realistic distributions.  NIST describes the Cauchy distribution thusly.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The Cauchy distribution is important as an example of a pathological case. Cauchy distributions look similar to a normal distribution. However, they have much heavier tails. When studying hypothesis tests that assume normality, seeing how the tests perform on data from a Cauchy distribution is a good indicator of how sensitive the tests are to heavy-tail departures from normality. Likewise, it is a good check for robust techniques that are designed to work well under a wide variety of distributional assumptions.&#xA;  The mean and standard deviation of the Cauchy distribution are undefined. The practical meaning of this is that collecting 1,000 data points gives no more accurate an estimate of the mean and standard deviation than does a single point.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;One practical issue though is that the Sharpe ratio cannot exist.  It is not difficult to show that a t-test would be &lt;em&gt;perfectly&lt;/em&gt; inefficient as the sample size went to infinity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So to answer your question exactly, a standard deviation does not exist for all distributions, and while there isn't a strict assumption of normality it will only be efficient for small samples if normality holds.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2017-04-05T03:03:36.203" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="33510" PostTypeId="2" ParentId="33507" CreationDate="2017-04-05T03:31:16.820" Score="2" Body="&lt;p&gt;the third one is really two transformations:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;y = \log (S/K)&#xA;$$&#xA;$$&#xA;x= y + (r-0.5\sigma^2)\tau&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Move to log coordinates -- the stock followed geometric Brownian motion so it's log follows Brownian motion. So the equation should be simpler in log coordinates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second one is remove the drift. The log has drift $r-0.5\sigma^2$ so removing that changes to coords in which the log stock is driftless. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(there are actually two ways to do the reduction to the heat equation, see Concepts and Practice etc by me)&lt;/p&gt;&#xA;" OwnerUserId="1809" LastEditorUserId="1809" LastEditDate="2017-04-05T04:29:22.937" LastActivityDate="2017-04-05T04:29:22.937" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33511" PostTypeId="1" AcceptedAnswerId="33516" CreationDate="2017-04-05T07:01:23.660" Score="2" ViewCount="243" Body="&lt;p&gt;How to price the &lt;code&gt;American style Asian option with recent N day average&lt;/code&gt;, for example, we exercise at &lt;code&gt;t&lt;/code&gt; day, then the payment is&#xA;$$\Psi(t) = \dfrac{1}{N}\sum\limits^t_{i=t - N+1}S_i$$&#xA;Since the &lt;code&gt;early exercise&lt;/code&gt; and &lt;code&gt;path dependence&lt;/code&gt;, we can not use the &lt;code&gt;Monte Carlo simulation&lt;/code&gt; and &lt;code&gt;tree method&lt;/code&gt;. And since the average is not from the begin day to today, we are not allowed to use the addition variable:&#xA;$$I_j = \sum\limits^j_{i=j - N+1}S_i$$&#xA;namely, we can't use the &lt;code&gt;PDE&lt;/code&gt; method. This is because, we don't know $I_{j+1}$ just from $I_j$ and $S_{j+1}.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I only know above three methods to price the option. Is there any reference or advanced method to price such option?&lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-04-05T13:49:48.987" Title="How to price the American style Asian option with recent N day average" Tags="&lt;monte-carlo&gt;&lt;simulations&gt;&lt;binomial-tree&gt;&lt;exotics&gt;&lt;differential-equations&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33512" PostTypeId="2" ParentId="33506" CreationDate="2017-04-05T08:04:24.437" Score="-1" Body="&lt;p&gt;It is not about a mixture of a continuous and discrete Random Variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is about simulations are not actually random, even using 50,000 trials.&#xA;That's why you get varying results. (It exhibits high discrepancy)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simulating random variable from pseudo-random function generator, very large simulations is needed to ensure convergence.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try using quasi-Monte Carlo Method. It uses quasi-random sequences.&#xA;Plus, it is readily available in MATLAB.&#xA;&lt;a href=&quot;https://www.mathworks.com/help/stats/generating-quasi-random-numbers.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;look here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually, with QMC, you may only need a few thousands simulations.&lt;/p&gt;&#xA;" OwnerUserId="13991" LastActivityDate="2017-04-05T08:04:24.437" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33513" PostTypeId="1" AcceptedAnswerId="33606" CreationDate="2017-04-05T10:48:38.557" Score="2" ViewCount="847" Body="&lt;p&gt;Usually we randomly shuffle train and test datasets for machine learning problem. However, some sources say that for financial problems we should split data into train and test in chronological order without any random shuffling.&lt;/p&gt;&#xA;" OwnerUserId="24771" LastActivityDate="2017-04-10T18:29:39.140" Title="Should I randomly shuffle train and test datasets?" Tags="&lt;data&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33515" PostTypeId="2" ParentId="33506" CreationDate="2017-04-05T13:30:51.720" Score="1" Body="&lt;p&gt;The reason you need to run so many simulations is because you are trying to estimate a tail property which has a very small chance of happening.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's do a quick back of the envelope calculation: The 99% VaR will occur 1% of the time. With the way your binomial variable is set up let's assume only $\nu=-10$ contributes to the VaR. This happens with probability 0.009. If you run 1% * 0.009 = 11,111 simulations, you will only expect to get 1 tail event. With 500,000 simulations, you get 45 tail events, which is pretty much exactly what I would expect to get convergence.&lt;/p&gt;&#xA;" OwnerUserId="5617" LastActivityDate="2017-04-05T13:30:51.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33516" PostTypeId="2" ParentId="33511" CreationDate="2017-04-05T13:49:48.987" Score="2" Body="&lt;p&gt;In convertible bond pricing there is something similar called a &quot;soft call&quot; with similar properties so you might want to search for literature on them.  The main difference is that soft calls are an exercise condition rather than an exercise price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One key point is that, if expiration $t$ is distant, very little error is introduced by ignoring the softness.  This is because there is so much variance remaining that paths exceeding the exercise price tend to do so by a lot, and for a long while.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Otherwise we are in the realm of &quot;tricks&quot;, among which I count Longstaff Schwartz (LS).  In practice LS is not used much because it is so slow and tricky to metaparameterize.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One good trick is to pretend N is a much smaller number (say 2 or 3) at greater intervals (like 10 day periods).  Then you &lt;em&gt;can&lt;/em&gt; add a couple dimensions $I^n_j$ to your PDE solver (often on a reasonably small grid).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another trick used by practitioners is to associate any given level of $S$ with a &lt;em&gt;probability&lt;/em&gt; of exercise based on the brownian bridge.  This is easy to accommodate in a PDE scheme.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2017-04-05T13:49:48.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33517" PostTypeId="2" ParentId="33498" CreationDate="2017-04-05T14:01:37.673" Score="3" Body="&lt;p&gt;What they are referring to is a very simplified version of the Ho-Lee model, i.e. on that assumes $$r(t)=r(0)+{\sigma}W(t)$$ where ${\sigma}$ is a constant (annualized StDev).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the sake of simplicity, imagine we are in discrete time and want to fit the model to observed (market) prices of bonds. We assume that $p=0.50$, i.e. the probability of interest rate going up/down is constant and the interest rate is modelled as &#xA;$$r_{i+1,j}=r_{i,j}+{\sigma}\times\sqrt{\Delta}$$ (the rate going up) and $$r_{i+1,j}=r_{i,j}-{\sigma}\times\sqrt{\Delta}$$ (the rate going down).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is clear that we are in binomial lattice model and that the ${\Delta}$ is the time step. Again, for the sake of simplicity assume ${\Delta}=1.0$ (years).&#xA;(BTW - these equations are consistent with Veronesi's explanations in his book on Fixed Income)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's assume that ${\sigma}=0.02$ and let's have a ZCB with 1y maturity with market price of 97.5310 and 2y ZCB with price of 94.12.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence $r(0)=0.025$ (that is $97.5310{\times}e^{0.0250}=100$) and you now can build the entire lattice, i.e. in the next period the up rate is $0.045$ and the down rate is $0.005$. If you price the 2y ZCB (assuming face of $100$) you get $e^{-0.0250}{\times}0.50{\times}(e^{-0.045}*100+e^{-0.005}*100)=95.142$ which does not correspond to the market price of 94.12.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By introducing another term into the equation, i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_{i+1,j}=r_{i,j}+ {\color{red}{\theta_i}} + {\sigma}\times\sqrt{\Delta}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you use the observed price of the 2y bond to exactly fit the lattice, i.e. the market prices will match the model prices. The ${\theta_{i}}$s are called &lt;em&gt;free parameters&lt;/em&gt; and you really choose them to exactly fix the given ZCB prices (why: you want your model to be good enough to match market prices).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of model calibration, you can use numerical solver and iteratively solve for ${\theta}_1$, ${\theta_2}$ etc. You can get an exact (analytical) expression for each if needed (unlike in BDT model), but the numerical solvers are fast, easy and have good enough accuracy.&lt;/p&gt;&#xA;" OwnerUserId="18030" LastActivityDate="2017-04-05T14:01:37.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33518" PostTypeId="1" CreationDate="2017-04-05T14:48:41.920" Score="-1" ViewCount="481" Body="&lt;p&gt;Looking e.g. at Natural gas futures options, I see for June contracts (expiration 25th May) the follwing data:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Call 4.3 (26.8% difference to Underlying) 36.2% IV and a delta of 0.04&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put 2.5 (26.3% difference to Underlying) 40.7% IV and a delta of -0.02&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would have expected that the absolute value of the delta of the Put would be higher than that of the call due to the fact the difference to the underlying of the put is smaller (only even slightly) and the IV of the Put is higher. But it is the opposite.&#xA;What is the reason, please?&#xA;Thank you&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I got a couple of downvotes and I am not sure why. It is similar to the second question of this post (&lt;a href=&quot;https://quant.stackexchange.com/questions/7880/call-vs-put-option&quot;&gt;Call vs. Put Option&lt;/a&gt;) and judging by the answers, there was some discussion about it.&#xA;On a sidenote, I think it is a questionable attitude to downvote questions (until now I was not even aware that that is possible. On the tour of quant exchange there is no word about it), especially if the guys who are doing it, feel even above to explain why they did.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you think a quesion is too basic (or too stupid) why not just ignoring it. This downvoting has a rude and arrogant character, in my opinon. &lt;/p&gt;&#xA;" OwnerUserId="24201" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.000" LastActivityDate="2017-04-06T10:20:59.127" Title="Option delta difference between OTM call and OTM put" Tags="&lt;options&gt;&lt;delta&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33519" PostTypeId="2" ParentId="33506" CreationDate="2017-04-05T15:48:43.973" Score="4" Body="&lt;p&gt;To answer you question &lt;em&gt;&quot;is it because X is a mixture of a continous and discrete Random Variable&quot;&lt;/em&gt;: the answer is no. The mean reasons are (1) the sample size (which is limited / countable) (2) the fact that you're trying to get the tail value and (3) the shape of the KDE (distribution).The theoretical value of 3.088 will be emprirically calculated if and only if you have sufficiently large sample size.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(@Jack JackGuRae says &lt;em&gt;It is about simulations are not actually random&lt;/em&gt; which isn't exactly true, as the pseudo-random number generators use algorithms that do ensure that big enough samples are properly distributed, i.e. simulating 1000 dice rolls will give you p=1/6 for each side to let's say 3 d.p.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(@msitt is spot on with the tail remark)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you've mentioned before, it is true that for some of the simulations, you needed considerably &lt;em&gt;smaller&lt;/em&gt; sample size, but in this case you are trying to sample from a &lt;strong&gt;highly&lt;/strong&gt; left-skewed distribution. Consider following code to plot the KDE:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sims   &amp;lt;- 10e6&#xA;errors &amp;lt;- rnorm(sims)&#xA;v      &amp;lt;- ifelse(runif(sims) &amp;lt;= 0.009, -10.0, 0.00)&#xA;x      &amp;lt;- v + errors&#xA;plot(density(x), col = 2, lwd = 2)&#xA;abline(v=unname(quantile(x,probs=c(0.01))))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/zP38z.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/zP38z.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the vertical line is the 1% quantile. Chances of having a small sample with this particular value for 1% quantile are very small indeed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Further example where we parametrize the quantile calculation based on the number if simulations and the Bernoulli mode and plot the quantiles based on the number of sims:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;set.seed (3134)&#xA;&#xA;quant &amp;lt;- function(sims, tailmode)&#xA;{&#xA;  errors &amp;lt;- rnorm(sims)&#xA;  v      &amp;lt;- ifelse(runif(sims) &amp;lt;= 0.009, tailmode, 0.00)&#xA;  x      &amp;lt;- v + errors&#xA;  return(unname(quantile(x,probs=c(0.01))))&#xA;}&#xA;&#xA;sims &amp;lt;- seq(100, 20000, len=20)&#xA;&#xA;par(mfrow=c(2,2))&#xA;plot(sims, Vectorize(quant, c(&quot;sims&quot;,&quot;tailmode&quot;))(sims,-10), col = 2, pch=16, ylim = c(-9, -1), ylab = &quot;&quot;, xlab=&quot;&quot;, main=&quot;-10&quot;)&#xA;plot(sims, Vectorize(quant, c(&quot;sims&quot;,&quot;tailmode&quot;))(sims,-5 ), col = 2, pch=16, ylim = c(-9, -1), ylab = &quot;&quot;, xlab=&quot;&quot;, main=&quot;-5&quot;)&#xA;plot(sims, Vectorize(quant, c(&quot;sims&quot;,&quot;tailmode&quot;))(sims,-1 ), col = 2, pch=16, ylim = c(-9, -1), ylab = &quot;&quot;, xlab=&quot;&quot;, main=&quot;-1&quot;)&#xA;plot(sims, Vectorize(quant, c(&quot;sims&quot;,&quot;tailmode&quot;))(sims, 0 ), col = 2, pch=16, ylim = c(-9, -1), ylab = &quot;&quot;, xlab=&quot;&quot;, main=&quot;0&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;gives&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/BvezY.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/BvezY.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which clearly shows that the less skewed your distribution is (i.e. the Bernoulli mode increasing), the faster the calculated 1% quantile converges to its model value.&lt;/p&gt;&#xA;" OwnerUserId="18030" LastActivityDate="2017-04-05T15:48:43.973" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33520" PostTypeId="1" CreationDate="2017-04-05T19:15:55.010" Score="2" ViewCount="255" Body="&lt;h1&gt;Question&lt;/h1&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;With 60 data observations, how do I construct a time series analysis properly?&lt;/li&gt;&#xA;&lt;li&gt;How to do Certain Calculations such as covariances on data with Gaps and Inconsistencies?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h1&gt;Background of Question&lt;/h1&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I'm currently setting out on doing an assignment for a portfolio theory class&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h1&gt;Dataset Characteristics&lt;/h1&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;15 stocks with their price-adjusted monthly returns from  1986-2016 (roughly 400 monthly observations) listed on the ISEQ (Irish Stock Exchange) &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h1&gt;What I think are Data Issues&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Allocated stocks do not have like-for-like observations&#xA;   -  stocks listed at different times have different numbers of observations for each stock. ( Non-uniform time series)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Only have 60 observations where all stocks have data from the same time period/across the panel.(&lt;strong&gt;Do you mean columns? do you mean same dates?&lt;/strong&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;( Insert screenshot of data points)&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;One stock in particular only has 60 observations and is extremely 'blocky' in its returns characteristics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;( ( Insert screenshot of data point)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h1&gt;Data may cause me problems when I:&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Calculate covariances&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;should I use the full array (~400 of observations) of my oldest stock (for variance calculations) against the 60 observations of this problematic stock when calculating the variance co-variance matrix?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Compare like with like and cut my observations across my portfolio to 60 observations&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Am I sacrificing descriptive power in my outputs if I do this?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;My humblest thanks and best wishes,&#xA;CM.&lt;/p&gt;&#xA;" OwnerUserId="27350" LastEditorUserId="7954" LastEditDate="2017-05-06T18:39:42.457" LastActivityDate="2017-05-07T11:50:10.213" Title="Data Issue: Observations in Portfolio Construction" Tags="&lt;time-series&gt;" AnswerCount="4" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="33521" PostTypeId="2" ParentId="30398" CreationDate="2017-04-05T19:59:52.350" Score="6" Body="&lt;p&gt;Both 'credit risk' and 'counterparty credit risk' refer to the same type of risk, i.e. the risk that the opposite side of a contract will not honor its obligations to repay.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But 'credit risk' will be typically used in the context of traditional loans business, i.e. for practitioners 'credit risk' will be associated with lending a money to someone - here your total risk is known at the onset of a transaction, i.e. if you lend 1M USD to a company, then you cannot basically lose more than 1MM USD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whereas 'counterparty credit risk' will be used especially in OTC derivatives business where a contract value might be an asset or a liability over the lifetime of a contract and at the expiry, i.e. we do not know how much we could potentially lose over the life of a contract. To measure 'counterparty credit risk' boils down to finding an estimate on how much you could potentially lose assuming the counterparty does not pay at a given moment of contract life - this estimation is more challenging than in case of typical loans/guarantees.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;References could be found in books of Brigo and Gregory.&lt;/p&gt;&#xA;" OwnerUserId="27334" LastActivityDate="2017-04-05T19:59:52.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33526" PostTypeId="2" ParentId="33443" CreationDate="2017-04-06T01:27:05.560" Score="1" Body="&lt;p&gt;The DPO() function shifts the series into the future, thus creating the look-ahead bias that causes the outlandish results. Setting &lt;code&gt;shift&lt;/code&gt; to zero takes care of this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the &lt;code&gt;?DPO&lt;/code&gt; documentation:&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Description&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The Detrended Price Oscillator (DPO) removes the trend in prices - or other series - by subtracting a moving average of the price from the price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;DPO(x, n = 10, maType, shift = n/2 + 1, percent = FALSE, ...)&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Arguments:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;shift: The number of periods to shift the moving average.&lt;/p&gt;&#xA;" OwnerUserId="17328" LastActivityDate="2017-04-06T01:27:05.560" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33528" PostTypeId="2" ParentId="33520" CreationDate="2017-04-06T06:31:27.710" Score="-1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;It is unclear what the 'portfolio assignment' is and what kind of results you are expected to deliver. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;60 points of data points (monthly) when it comes to stock returns is more than enough; whereas conclusions based 20 years of data do not seem reliable as a company in its first 5 years of existence will be completely different than the same company 15 years later - given the company still exists.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="27334" LastActivityDate="2017-04-06T06:31:27.710" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33529" PostTypeId="2" ParentId="33113" CreationDate="2017-04-06T06:58:58.820" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Pre-Settlement (potential future exposure PFE) calculation at 20 payment dates:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;assume a model for the floating interest rate: might be a constant across all maturities for simplicity (flat yield curve)&lt;/li&gt;&#xA;&lt;li&gt;shift the yield curve to 95th percentile in your favor&lt;/li&gt;&#xA;&lt;li&gt;calculate the price of the swap at each time point (remember that tenor of the swap shorten as you move forward) using the shifted yield curve&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Alternatively: you can simulate interest-rate (yield curve) shifts for example 1k times using an interest-rate model and then take out 95th percentile of swap prices in your favor at each time point - this will be your PFE&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;the shape of the credit risk profile for a generic swap is increasing to a maximum point ( this will be around duration/3 time point) and then decreasing to 0 but details depends on the yield curve shape: for a upward sloping yield curve you can expect to have negative cash-outflows in the second half of the contract tenor as your floating rate should be higher than fixed rate&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The process for pre-settlement risk calculation can be found in the literature.&lt;/p&gt;&#xA;" OwnerUserId="27334" LastActivityDate="2017-04-06T06:58:58.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33530" PostTypeId="1" AcceptedAnswerId="36310" CreationDate="2017-04-06T10:15:37.500" Score="7" ViewCount="198" Body="&lt;p&gt;I'm a bit stuck with the pricing of an option where the underlying stock is correlated to an additional process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Setting&lt;/em&gt;: Assume that we have a probability space where under $Q$ the dynamics of the stock and an additional process are given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;dS(t) &amp;amp;= S(t)(rdt+\sigma dW_1 (t))&#xA;\\[6pt]&#xA;d\lambda(t) &amp;amp;= c\lambda(t)dt+\xi dW_2 (t)&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where:&#xA;$$ W_2 (t)=\rho W_1 (t)+ \sqrt{1-\rho^2}Z(t) $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$W_1 (t)$ and $Z(t)$ are independent Brownian motions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is now how to determine the following conditional risk-neutral valuation: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ E^Q [e^{-\int_0^T\lambda(v)dv} \max(S(T),K) \ | \ e^{-\int_0^T\lambda(v)dv} =x] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The last expression can be rewritten as: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ x E^Q [\max(S(T),K) \ | \ e^{-\int_0^T\lambda(v)dv} =x] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but then I'm stuck how we can deal with the dependence between $S$ and $\lambda$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot in advance for your help!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;N.B: $\lambda$ is not the interest rate but just a stochastic discount factor. &lt;/p&gt;&#xA;" OwnerUserId="27358" LastEditorUserId="20454" LastEditDate="2017-10-05T10:44:48.490" LastActivityDate="2018-03-14T17:01:09.453" Title="Option pricing with dependent risk factors" Tags="&lt;option-pricing&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33531" PostTypeId="2" ParentId="33518" CreationDate="2017-04-06T10:20:59.127" Score="2" Body="&lt;p&gt;The reason for different absolute deltas (and prices) for OTM-call- and -put-options with exactly the same characteristics (same absolute distance from strike to underlying price, same IV, etc.) is twofold:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The effect of interest rates. Ceteris paribus higher interest rates lead to higher call prices and lower put prices due to opportunity costs&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The skewness of the log-normal price return distribution assumption of the Black-Scholes pricing model. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="24201" LastActivityDate="2017-04-06T10:20:59.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33532" PostTypeId="1" CreationDate="2017-04-06T13:51:50.520" Score="0" ViewCount="211" Body="&lt;p&gt;I am trying to create a smile in Heston model, however, as of yet, I have only been able to get smirks (i.e., big negative slope ITM that flattens out ATM, and then a very small positive slope OTM). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What parameters ($\kappa, \xi, \rho$ etc) should one use in Heston in order for the prices to actually show a proper smile? --&gt; \_/&lt;/p&gt;&#xA;" OwnerUserId="27361" LastActivityDate="2017-06-06T08:57:50.447" Title="What parameters give a smile (not smirk) in Heston?" Tags="&lt;heston&gt;&lt;volatility-smile&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33533" PostTypeId="1" CreationDate="2017-04-06T14:25:13.267" Score="1" ViewCount="72" Body="&lt;p&gt;This is a well know conclusion of the &lt;code&gt;boundary condition&lt;/code&gt; of &lt;code&gt;lookback option&lt;/code&gt;. Here&#xA;$$\dfrac{d S_t}{S_t} = (\mu - D)dt + \sigma dW_t$$&#xA;is &lt;code&gt;underlying asset&lt;/code&gt;.&#xA;$$M_t^{(n)} =\left[\int^t_0S^n_u d u\right]^{\dfrac{1}{n}}$$&#xA;$$M_t = \max\limits_{t_0\leq u \leq t}S_u$$&#xA;is &lt;code&gt;maximal process&lt;/code&gt; of $S_t,$ and we have the conclusion:&#xA;$$\lim\limits_{n\rightarrow\infty}M_t^{(n)} = M_t$$&#xA;$V(S_t,t,M_t)$ is the price of &lt;code&gt;lookback option&lt;/code&gt; at time $t.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the &lt;code&gt;boundary condition&lt;/code&gt; of &lt;code&gt;PDE&lt;/code&gt; for $V$ is&#xA;$$\dfrac{\partial V}{\partial M_t}\big|_{S_t = M_t} = 0$$&#xA;this is to make the $d M_t$ term zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, some books explain this condition as following way, do you think it is reasonable?&#xA;&lt;a href=&quot;https://i.stack.imgur.com/aCd56.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/aCd56.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-04-06T14:25:13.267" Title="Boundary condition of lookback option" Tags="&lt;derivatives&gt;&lt;exotics&gt;&lt;differential-equations&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33534" PostTypeId="1" AcceptedAnswerId="33545" CreationDate="2017-04-06T14:40:04.967" Score="0" ViewCount="154" Body="&lt;p&gt;Very mundane question.  My team is setting up a security master db that includes listed option contracts.  I'd like to store the &quot;put or call&quot; attribute in a well-named field, one that won't be confused with other concepts.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;OptionType seems too vague.  It could refer to the contract size or the type of underlying security (stock, bond, index).&lt;/li&gt;&#xA;&lt;li&gt;OptionSide seems ambiguous with the concept of a long or short position.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Any other suggestions?&lt;/p&gt;&#xA;" OwnerUserId="27362" LastActivityDate="2017-04-19T00:48:13.013" Title="What's the most acceptable name for the &quot;put or call&quot; attribute of an option contract?" Tags="&lt;options&gt;&lt;database&gt;" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="33535" PostTypeId="2" ParentId="7216" CreationDate="2017-04-06T15:54:58.267" Score="-1" Body="&lt;p&gt;yahoo only gives the corp actions but no price backwards adjustments for dividends and split adjustments was done wrong&lt;/p&gt;&#xA;" OwnerUserId="27363" LastActivityDate="2017-04-06T15:54:58.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33536" PostTypeId="2" ParentId="33532" CreationDate="2017-04-06T16:07:20.687" Score="2" Body="&lt;p&gt;The impact of all the 5 parameters to be calibrated are the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;$\rho$ impacts the skewness: try $\rho = 0$ to get a symmetric smile&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$\sigma$ impacts the smile effect: you may want to move this parameter in your case. Increasing it (try 0.5 or more for instance) will amplify the smile effect you want.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$v_0$ and $\theta$: the initial volatility and its long term level. This will only impact the level of your smile&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$\kappa$: as for $\sigma$, this will also modify the smile effect. Increasing $\kappa$ will decrease the smile effect, so you may want to decrease it (to 1 for instance).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="26595" LastEditorUserId="26595" LastEditDate="2017-06-06T08:57:50.447" LastActivityDate="2017-06-06T08:57:50.447" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33537" PostTypeId="1" AcceptedAnswerId="33539" CreationDate="2017-04-06T16:42:55.400" Score="1" ViewCount="202" Body="&lt;p&gt;The title is my question.  I think the answer is yes, but I am unsure about it.&lt;/p&gt;&#xA;" OwnerUserId="3011" LastActivityDate="2017-04-06T18:56:46.243" Title="Does the YTM for a zero coupon treasury equal the treasury yield curve value for it's maturity?" Tags="&lt;yield-curve&gt;&lt;yield&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33538" PostTypeId="1" AcceptedAnswerId="33554" CreationDate="2017-04-06T16:44:50.927" Score="0" ViewCount="149" Body="&lt;p&gt;I use a trend-following approach where I look for trends in various currency pairs such as GBP/USD or EUR/USD and then take a position in the Spot currency. I measure the performance of my strategy by looking at the ratio between the % returns of my trades and the standard deviation of the returns of those same trades. A positive ratio above 0.2 actually leads to excellent returns over a long period of time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Someone suggested to me that rather than following one pair, I should take one base currency such as GBP or EUR and generate some kind of composite average (like the US Dollar Basket) and search for trends in that. Once I have signal, I should then take positions in the Spot with the USD and other crosses eg. for GBP it would be 50% GBP/USD + 25% GBP/EUR + 25% GBP/JPY. It was suggested that this would improve my returns/volatility metric (ignoring the fact that non-USD crosses generally have slightly higher spreads and transactions costs than major FX).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is this? I understand diversification but I thought that the idea was that you combined positively expectant strategies which were poorly correlated with each other to diversify. Here, you are just combining random currency pairs where you have no particular evidence whether its going to move favourably for you or not. eg. your research signal indicates GBP will move up, but doesn't say EUR/JPY/USD will move up. So essentially you are just dampening down your returns - but if I wanted to do that, could I not just take a smaller position size? &lt;/p&gt;&#xA;" OwnerUserId="27279" LastActivityDate="2017-04-07T12:33:27.163" Title="Is it better to express a currency position through multiple pairs?" Tags="&lt;fx&gt;&lt;modern-portfolio-theory&gt;&lt;diversification&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33539" PostTypeId="2" ParentId="33537" CreationDate="2017-04-06T16:54:48.057" Score="1" Body="&lt;p&gt;No, generally this will not be the case. The yields of the on-the-run treasuries for specific tenors are collected and a cubic spline is fit to these points. Thus, the yields will only match for the on-the-run 1m, 3m, 6m, 12m, 2y, 3y, 5y, 7y, 10y, and 30y treasuries.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For details please see the page on &lt;a href=&quot;https://www.treasury.gov/resource-center/data-chart-center/interest-rates/Pages/yieldmethod.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;Treasury Yield Curve Methodology&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The Treasury's yield curve is derived using a quasi-cubic hermite&#xA;  spline function. Our inputs are the Close of Business (COB) bid yields&#xA;  for the on-the-run securities. Because the on-the-run securities&#xA;  typically trade close to par, those securities are designated as the&#xA;  knot points in the quasi-cubic hermite spline algorithm and the&#xA;  resulting yield curve is considered a par curve.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;...&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;More specifically, the current inputs are the most recently auctioned&#xA;  4-, 13-, 26-, and 52-week bills, plus the most recently auctioned 2-,&#xA;  3-, 5-, 7-, and 10-year notes and the most recently auctioned 30-year&#xA;  bond, plus the composite rate in the 20-year maturity range. The&#xA;  quotes for these securities are obtained at or near the 3:30 PM close&#xA;  each trading day. The inputs for the four bills are their bond&#xA;  equivalent yields.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="5617" LastEditorUserId="5617" LastEditDate="2017-04-06T18:56:46.243" LastActivityDate="2017-04-06T18:56:46.243" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33540" PostTypeId="2" ParentId="4079" CreationDate="2017-04-06T18:27:31.177" Score="0" Body="&lt;p&gt;Historical outstanding shares can be obtained for free from Quandl:&#xA;Following is the R code for outsatnding shares for IBM from 2012-12-30 onwards.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Quandl.datatable(&quot;ZACKS/FC&quot;, ticker=c(&quot;IBM&quot;), per_end_date.gt=&quot;2012-12-30&quot;,qopts.columns=c(&quot;comm_shares_out&quot;,&quot;wavg_shares_out_diluted&quot;,&quot;wavg_shares_out&quot;, &quot;per_end_date&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also account can be created for free on Quandl and you can get your API key to access the database, it has limited usage though (50 calls per day)&lt;/p&gt;&#xA;" OwnerUserId="27365" LastEditorUserId="27365" LastEditDate="2019-12-30T16:03:23.023" LastActivityDate="2019-12-30T16:03:23.023" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="33541" PostTypeId="2" ParentId="33463" CreationDate="2017-04-06T18:35:13.140" Score="5" Body="&lt;p&gt;So you can get depo and swap rates from markit daily, at links like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;http://www.markit.com/news/InterestRates_&amp;lt;cncy&amp;gt;_&amp;lt;yyyymmdd&amp;gt;.zip&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.markit.com/news/InterestRates_USD_20170105.zip&quot; rel=&quot;noreferrer&quot;&gt;http://www.markit.com/news/InterestRates_USD_20170105.zip&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and there's a spec for it &lt;a href=&quot;http://www.cdsmodel.com/cdsmodel/assets/cds-model/docs/Interest%20Rate%20XML%20v1.3.pdf&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt; - though that's from 2009 so may be out of date, maybe you can find a more up to date one someone on their site, but i've noot been able to inside of a few minutes of googling.&lt;/p&gt;&#xA;" OwnerUserId="19663" LastActivityDate="2017-04-06T18:35:13.140" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33542" PostTypeId="2" ParentId="33261" CreationDate="2017-04-06T19:15:07.317" Score="0" Body="&lt;p&gt;As described for example &lt;a href=&quot;https://en.wikipedia.org/wiki/Realized_variance&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;, realized variance is the sum of squared returns - $\sum_{i=0}^{N-1} R_i^2$ in your notation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus it is wrong to assume that the formula consists of: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&quot;normalizing factor&quot; - $252$ &lt;/li&gt;&#xA;&lt;li&gt;&quot;variance of the logarithmic returns&quot; in statistical terms - $\frac{1}{N}\sum_{i=0}^{N-1} R_i^2$. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Instead the two pieces of the formula are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;realized variance - $\sum_{i=0}^{N-1} R_i^2$&lt;/li&gt;&#xA;&lt;li&gt;reciprocal of duration of time period - $\frac{252}{N}$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And since we are not talking about variance (in statistical sense) of the logarithmic returns, it does not make sense to ask whether and why logarithmic returns are supposed to have zero-expectation!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The realized variance is useful because it provides a relatively accurate measure of volatility of the underlying - $\sigma$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The actual derivation of the formula is illustraded below. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\alpha$ and $\sigma$ be constants, and define the geometric Brownian motion $$ S(t) = S(0) e^{\sigma W(t)+(\alpha-\frac{1}{2}\sigma^2)t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $0 \leq T_1 &amp;lt; T_2$ be given and suppose we observe $S(t)$ for $T_1 \leq t \leq T_2$. Choose some partition of this interval $T_1 = t_0 &amp;lt; t_1 &amp;lt; \cdots &amp;lt; t_m = T_2$ and observe log returns $\log\frac{S_{t_{j+1}}}{S_{t_{j}}}$ over each of subintervals $[t_j, t_{j+1}]$:&#xA;$$\log\frac{S_{t_{j+1}}}{S_{t_{j}}} = \sigma (W(t_{j+1}) - W(t_j)) + (\alpha - \frac{1}{2}\sigma^2)(t_{j+1}-t_j)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;em&gt;realized volatility&lt;/em&gt; $\sum_{j=0}^m\Big(\log\frac{S_{t_{j+1}}}{S_{t_{j}}}\Big)^2$ is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sum_{j=0}^m\Big(\log\frac{S_{t_{j+1}}}{S_{t_{j}}}\Big)^2 = \sigma^2 \sum_{j=0}^m \big(W(t_{j+1})-W(t_j)\big)^2 + \big(\alpha - \frac{1}{2}\sigma^2\big)^2 \sum_{j=0}^m (t_{j+1}-t_j)^2 + \\2\sigma(\alpha - \frac{1}{2}\sigma^2)\sum_{j=0}^m (W(t_{j+1})-W(t_j))(t_{j+1}-t_j)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\|\Pi\| = \max_{j=0,1,\cdots m-1}(t_{j+1}-t_j)$. Then:&#xA;$$ \lim_{\|\Pi\|\to 0} \sum_{j=0}^m (t_{j+1}-t_j)^2 = 0 \\&#xA;\lim_{\|\Pi\|\to 0} \sum_{j=0}^m (W(t_{j+1})-W(t_j))(t_{j+1}-t_j) = 0 \\&#xA;\lim_{\|\Pi\|\to 0} \sum_{j=0}^m \big(W(t_{j+1})-W(t_j)\big)^2 = T_2-T_1$$&#xA;Thus:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma^2 \approx \frac{1}{T_2-T_1}\sum_{j=0}^m\Big(\log\frac{S_{t_{j+1}}}{S_{t_{j}}}\Big)^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now you can see that $\frac{252}{N} = \frac{1}{T_2-T_1} $ and we don't need the assumption that logarithmic returns have zero-expectation. Instead it is  assumed that $S(t)$ follows geometric Browninan motion with constant volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above derivation has been shamelessly stolen from &lt;a href=&quot;http://www.springer.com/gp/book/9780387401010&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; (3.4.3 Volatility of Geometric Brownian Motion) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also have a look at &lt;a href=&quot;http://eu.wiley.com/WileyCDA/WileyTitle/productCd-1118959167.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;The Volatility Smile&quot;&lt;/a&gt; by E. Derman. Chapter 4 &quot;Variance Swaps&quot; discusses how variance swaps can be replicated&lt;/p&gt;&#xA;" OwnerUserId="15154" LastEditorUserId="15154" LastEditDate="2017-04-07T14:48:33.260" LastActivityDate="2017-04-07T14:48:33.260" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="33543" PostTypeId="2" ParentId="33534" CreationDate="2017-04-06T20:18:45.220" Score="0" Body="&lt;p&gt;&lt;strong&gt;CallPutIndicator&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As others have mentioned &quot;Type&quot; and &quot;Class&quot; are too generic to be used here.&lt;/p&gt;&#xA;" OwnerUserId="27366" LastEditorUserId="27366" LastEditDate="2017-04-19T00:48:13.013" LastActivityDate="2017-04-19T00:48:13.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33544" PostTypeId="1" CreationDate="2017-04-06T20:43:54.557" Score="1" ViewCount="78" Body="&lt;p&gt;For example, &quot;Trump tax cut&quot; is a big theme after Trump got elected. How can I extract such themes programmatically, and how can I link the theme to a portfolio that trades on this theme? (long exporters, short importers)&lt;/p&gt;&#xA;" OwnerUserId="5667" LastActivityDate="2017-04-06T20:43:54.557" Title="How can I extract market themes using an algorithm?" Tags="&lt;algorithmic-trading&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33545" PostTypeId="2" ParentId="33534" CreationDate="2017-04-06T20:44:22.573" Score="1" Body="&lt;p&gt;Hull (Options, Futures, and Other Derivatives) calls that the &quot;type&quot; of the option (emphasis added):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;there are two &lt;strong&gt;types&lt;/strong&gt; of options. A &lt;strong&gt;&lt;em&gt;call&lt;/em&gt;&lt;/strong&gt; option... A &lt;strong&gt;&lt;em&gt;put&lt;/em&gt;&lt;/strong&gt; option...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So does &lt;a href=&quot;http://www.nasdaq.com/investing/options-guide/option-types-puts-calls.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;NASDAQ&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Option Types: Calls &amp;amp; Puts&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I have seen &lt;code&gt;optionType&lt;/code&gt; used in many places to identify if the option is a call or put.  I certainly wouldn't complain about &lt;code&gt;PutCall&lt;/code&gt; or some other more specific name, but &lt;code&gt;Type&lt;/code&gt; should not conflict with other attributes.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;OptionType seems too vague. It could refer to the contract size or the type of underlying security (stock, bond, index).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I can't see how the contract size could be considered a &quot;type&quot;.  I would consider stock, bonds, index, etc. the type of the &lt;em&gt;underlying&lt;/em&gt;, which &lt;em&gt;could&lt;/em&gt; be an attribute on the option, but would be more appropriate in a separate entity that represents the underlying instrument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;*To be fair, there are also sites that call American and European the &quot;type&quot; of the option, but I have always seen that called the &lt;code&gt;exerciseType&lt;/code&gt; to disambiguate that from put/call.&lt;/p&gt;&#xA;" OwnerUserId="20213" LastActivityDate="2017-04-06T20:44:22.573" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33546" PostTypeId="1" CreationDate="2017-04-07T00:45:47.020" Score="5" ViewCount="1562" Body="&lt;p&gt;I am trying to wrap my head around how exactly Dupire's formula is implemented in practice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We need $\sigma(S,T)$ for every possible $S$ and $T$. If we had that, then we can just run a monte carlo scheme.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, do we run monte carlo, and then during the simulation, whenever we need $\sigma(S_i, T_i)$, we run Dupire's formula? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or, do we use Dupire's formula to first construct a discrete LV surface, and then we run our monte carlo, and then during the simulation, whenever we need $\sigma(S_i, T_i)$, we interpolate from our discrete LV surface?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or do we do something else? What's best? What's fastest? What's easily implemented?&lt;/p&gt;&#xA;" OwnerUserId="27369" LastEditorUserId="16160" LastEditDate="2017-04-07T02:03:51.780" LastActivityDate="2017-04-07T06:55:40.213" Title="Methods to compute Local Volatility surface and price" Tags="&lt;local-volatility&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33547" PostTypeId="1" CreationDate="2017-04-07T02:34:07.747" Score="2" ViewCount="904" Body="&lt;p&gt;I am interested in implementing a simple pairs trading strategy using two correlated futures contracts. I am unsure what the best way to normalize the prices of the two instruments is. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially right now I am iterating concurrently through the prices of two instruments however the prices are on very different scales and the two contracts have different minimum tick price increments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the best way to normalize the prices so that I can compute the difference in between prices in order to determine if there is a significant spread present?   &lt;/p&gt;&#xA;" OwnerUserId="20245" LastActivityDate="2018-02-14T12:16:36.180" Title="pairs trading, normalization" Tags="&lt;quant-trading-strategies&gt;&lt;futures&gt;&lt;trading&gt;&lt;algorithmic-trading&gt;&lt;normalization&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33548" PostTypeId="1" AcceptedAnswerId="33635" CreationDate="2017-04-07T03:21:42.130" Score="6" ViewCount="1818" Body="&lt;p&gt;I want to calculate the exponential moving average for many stocks in a large investable universe. To do this, I've seen the following formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/myQbd.png&quot; alt=&quot;exponential moving average recursive formula&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because it references the previous day's exponential moving average, it seems to me like I would need to calculate the exponential moving average for every day going back to the security's inception in order to get an accurate ema for today. This seems like it would require too many computations to be used effectively. Is there a way to calculate an accurate ema that is less computationally heavy?&lt;/p&gt;&#xA;" OwnerUserId="27370" LastEditorUserId="16595" LastEditDate="2018-12-31T19:05:45.050" LastActivityDate="2019-01-01T19:16:53.523" Title="Is there a non-recursive way of calculating the exponential moving average?" Tags="&lt;quant-trading-strategies&gt;&lt;python&gt;&lt;moving-average&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="7" ContentLicense="CC BY-SA 4.0" />
  <row Id="33549" PostTypeId="2" ParentId="33548" CreationDate="2017-04-07T03:51:39.297" Score="6" Body="&lt;p&gt;The point of the recursive formula is that you can easily calculate the current EWMA if you have last period's EWMA.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equivalently, you can calculate all the weights directly and sum them that way.&#xA;$$&#xA;\text{EWMA}_t = S_t(1-\lambda) + S_{t-1}(1-\lambda)\lambda + S_{t-2}(1-\lambda)\lambda^2 + \dots&#xA;$$&#xA;where $\lambda$ is your smoothing parameter between $0$ and $1$. Higher values indicate a smoother average while lower values put more weight on the recent observations. In relation to your post,&#xA;$$&#xA;1-\lambda=\frac{2}{T+1}.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You probably notice both of these formulations require you to go back infinitely far to get the current EWMA. Of course we can't do that, so the question now becomes where can you cut it off?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The advantage of the 2nd formulation is that you can derive the half life $\tau$ as&#xA;$$&#xA;\lambda^\tau=\frac{1}{2}&#xA;$$&#xA;or&#xA;$$&#xA;\tau = \log_\lambda(1/2)=\frac{\ln(1/2)}{\ln(\lambda)}&#xA;$$&#xA;This gives you some practical guidance on how many steps you really need to go back to get a good estimate.&lt;/p&gt;&#xA;" OwnerUserId="5617" LastEditorUserId="5617" LastEditDate="2017-04-07T04:10:52.773" LastActivityDate="2017-04-07T04:10:52.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33550" PostTypeId="2" ParentId="33546" CreationDate="2017-04-07T06:55:40.213" Score="4" Body="&lt;p&gt;The problem with Dupire's formula is that it requires the derivatives of the option prices, where you do not have a continuum of prices. The reason this is a problem is that you now have to come up with some interpolation scheme for your prices (and even if that involves fitting some term vol surface, it's still an interpolation scheme, it's just more complicated).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason Dupire's formula + interpolation is a problem, is that interpolation is done (overwhelmingly often) with constaints on the derivatives - these then filter through into the local vol surface you create from your options at discrete tenors and strikes. You end up with some particular behaviour for derivatives where you're interpolating, and then another - different - behaviour where you straddle an actual data point (especially if your interpolation scheme does not have continuous second derivatives in strike).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best method i've used is to have some parameterization of the local vol surface, and the ability to price all the options you have based on that parameterization using the forward kolmogorov equations (because you can price them all at once, making it more efficient). This is then calibrated to the option prices that are your input. Peter Jaeckel has a presentation on this approach for SLV &lt;a href=&quot;http://jaeckel.16mb.com/DHIPresentation.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This gives a parametric form for the local vol surface to use inside the MC.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The downside to this approach is that the fwd kolmogorov pde approach is far from simple to implement (to get working robustly). The upside is that i get very well behaved local vol surfaces in parametric form. The parameterization we use is flexible enough to fit ~5 tenors perefectly (i.e. all option prices inside bid/offer) with 12 parameters - if you want more and you're not able to fit them all perfectly, then you can just join 2 surfaces together in the local vol space and swap over parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of speed, it's pretty good. Calibration takes about a second, worst case. Often it's about ~0.1s.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of &quot;what's best&quot;, this approach blows the &quot;finite difference on interpolated option prices for Dupire&quot; out of the water.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In terms of ease of implementation, i wouldn't put this at the top of the list...&lt;/p&gt;&#xA;" OwnerUserId="19663" LastActivityDate="2017-04-07T06:55:40.213" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="33551" PostTypeId="2" ParentId="32951" CreationDate="2017-04-07T07:15:54.387" Score="2" Body="&lt;p&gt;As shown in Demeterfi et al. &quot;A Guide to Volatility and Variance Swaps&quot; &lt;a href=&quot;http://www.iijournals.com/doi/abs/10.3905/jod.1999.319129?journalCode=jod&quot; rel=&quot;nofollow noreferrer&quot;&gt;article&lt;/a&gt; the fair value of future variance $\mathbf{K}_{var}$ is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbf{K}_{var} =  \frac{2}{T}\Bigg(rT-\Big(\frac{S_0}{S_T}e^{rT}-1\Big)-\log{\frac{S_*}{S_0}}+e^{rT}\int_{0}^{S_*}\frac{1}{K^2}P(K)dK + e^{rT}\int_{S_*}^{\infty}\frac{1}{K^2}C(K)dK \Bigg) \tag{29} \label{formula}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $S*$ is some fixed reference price that you can think of as the approximate at-the-money forward stock level that marks the boundary&#xA;between liquid puts and liquid calls, $S_0$ is underlying current spot price, $P(K)$ and $C(K)$ are current prices of put and call both with the strike $K$ respectively, $r$ is risk-free rate and $T$ is time to expiration.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Equation (29) makes precise the intuitive notion that implied volatilities can be regarded as the market’s expectation of future realized volatilities. It&#xA;  provides a direct connection between the market cost of options and the strategy for capturing future realized volatility, &lt;em&gt;even when there is an implied volatility skew&lt;/em&gt;, and the simple Black-Scholes formula is invalid.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="15154" LastActivityDate="2017-04-07T07:15:54.387" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33552" PostTypeId="1" CreationDate="2017-04-07T09:41:39.343" Score="2" ViewCount="420" Body="&lt;p&gt;I'm provided the forward curve and time 0 prices of ATM Caps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Volatility is 1-factor Gaussian HJM model with specification:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\sigma(t, T) = \nu \exp \{ \beta (T − t) \}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I need to calibrate the volatility parameters $\beta$ and $\nu$ to the cap prices weighted by corresponding Black vegas (weighted least squares). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But the problem is I do not know the cap rate (strike rate) and since Black vegas are a function of cap rate (strike rate), I'm lost on how to proceed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Will be very thankful if someone can point me in the correct direction. The formula for Caplets is:&lt;a href=&quot;https://i.stack.imgur.com/YRgLC.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/YRgLC.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="27372" LastEditorUserId="16160" LastEditDate="2017-04-08T15:41:54.263" LastActivityDate="2017-04-17T14:39:47.337" Title="ATM i.r. Caps - Black vol calibration" Tags="&lt;interest-rates&gt;&lt;calibration&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33553" PostTypeId="1" AcceptedAnswerId="33563" CreationDate="2017-04-07T11:28:13.510" Score="6" ViewCount="1428" Body="&lt;p&gt;This is a commonly asked question and I have not been able to find a satisfactory answer to it. Let me first phrase it here. Suppose that interest rates are $0$ and consider an at the money put and an at the money call (both European) on the same stock (self-financing, hence no dividends) with the same expiry. The payoff of the put is bounded by the strike whereas the payoff of the call is unbounded. But the put-call parity dictates that they have the same price. How do you explain this &quot;contradiction&quot;? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The explanations I have found are all about how stock prices are lognormally distributed etc. This explanation cannot possibly be true since the put-call parity is model-independent. To make it a bit formal I consider the first theorem of asset pricing. Then for the put and the call we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C = E^Q[\max(S_T - S_0,0)]$$&#xA;$$P = E^Q[\max(S_0 - S_T,0)]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here $Q$ is the risk-neutral measure (or the $T$-terminal measure). Subtracting $P$ from $C$ we get&#xA;$$C - P = E^Q[\max(S_T - S_0,0)] - E^Q[\max(S_0-S_T,0)]$$&#xA;Since expectation is linear and $S_T - S_ 0 = \max(S_T - S_0,0) - \max(S_0-S_T,0)$ we have&#xA;$$C - P = E^Q[S_T - S_0] = E^Q[S_T] - S_0$$&#xA;According to the first theorem of asset pricing absence of arbitrage implies that discounted asset prices are martingales. The discount rate is $0$ in this example. Hence, $E^Q[S_T] = S_0$. Finally,&#xA;$$C = P$$&#xA;So I arrived at this conclusion based on two things: there is no arbitrage and interest rates are $0$. Nowhere I directly or indirectly imposed an assumption on the distribution of $S_T$ under $Q$. So what is the explanation of this phenomenon? The only explanation I can think of is that it is not necessarily an arbitrage opportunity if two contracts, one with bounded payoff and the other unbounded payoff, have the same price. Another example is a bond and a stock that coincidentally have the same price. Bond has a bounded (fixed) payoff whereas the stock has unbounded payoff. Nothing weird about that. Likewise, nothing fishy about the put and the call in the example. Is there more to this?&lt;/p&gt;&#xA;" OwnerUserId="11597" LastEditorUserId="11597" LastEditDate="2017-04-07T11:52:21.450" LastActivityDate="2017-04-09T15:26:45.130" Title="At the money put and call having the same price" Tags="&lt;asset-pricing&gt;&lt;put-call-parity&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33554" PostTypeId="2" ParentId="33538" CreationDate="2017-04-07T12:23:53.993" Score="2" Body="&lt;p&gt;My 10 cents is to think about how, if the market is buying GBP, for example, then it will buy GBP against any or all other currencies. It's not a matter of buying GBP only against USD or EUR although those are, say, the major terms currencies. Alternatively, if the market is selling GBP then they will sell against all other currencies. Thus if you use a currency basket for some base currency then that is a better reflection of a &quot;trend&quot; relative to that base currency alone, to reduce a bias in general trends going on with different terms currencies. So if there's really a trend in a base currency then it makes sense that trend is better reflected using a basket of terms currencies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is also the way traders will cover positions. You run a book in a base currency against all other currencies, and if you decide you need to reduce risk in GBP positions, for example, then you will sell GBP against any other currency in your book. It just so happens you probably have bigger positions in the majors, so, GBPUSD. For example, any different GBPXXX deals (say GBPAUD or GBPJPY) are probably &quot;decrossed&quot; into GBPUSD and USDXXX where possible so your trader has fewer positions to have to manage. Thus a major pair like GBPUSD has many more position changes than GBP against other currencies as trades that were originally done in GBP against another currency are decrossed out into GBPUSD and that other currency against USD, or EUR, for risk management of all currencies in their most basic pairs.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastEditorUserId="7369" LastEditDate="2017-04-07T12:33:27.163" LastActivityDate="2017-04-07T12:33:27.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33556" PostTypeId="2" ParentId="33553" CreationDate="2017-04-07T14:19:17.430" Score="0" Body="&lt;p&gt;Put Call Parity is purely based on &lt;strong&gt;no arbitrage opportunity strategy&lt;/strong&gt;, independent of the distribution of stock price. One can always construct a put from a call, a risk free bond and a stock on the &lt;strong&gt;underlying asset.&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long put = Short Stock + Long Call + Long Bond &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, the reason why an bounded option like put is priced same as the unbounded call is fundamentally because the relation also includes an unbounded stock and a bounded bond. &#xA;Edit as suggested by Fab in comments: The probability distribution of the future stock price is not irrelevant for put and call prices, but it is constrained (by the current stock price)&lt;/p&gt;&#xA;" OwnerUserId="27273" LastEditorUserId="27273" LastEditDate="2017-04-09T13:36:43.233" LastActivityDate="2017-04-09T13:36:43.233" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33557" PostTypeId="2" ParentId="33547" CreationDate="2017-04-07T14:38:17.733" Score="1" Body="&lt;p&gt;Normalize by assuming both prices at t(1) = 1, and then multiply every t by (1 + price change in %) to get normalized price at t+1. Difference in tick size does not matter it will just make the spread volatility larger. However you will have to account for that tick size when you back test.&lt;/p&gt;&#xA;" OwnerUserId="17921" LastActivityDate="2017-04-07T14:38:17.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33558" PostTypeId="2" ParentId="33553" CreationDate="2017-04-07T16:16:53.810" Score="1" Body="&lt;p&gt;Let me rewrite what you have a little bit.  First, put-call parity does indeed demand that for forward value $F = E^Q[S_T]$, and for&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\{\hat{C}, \hat{P} \}= \{C, P\} \cdot \int_0^T r(s) ds&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;F  = K + \hat{C} - \hat{P}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is true for &lt;em&gt;any&lt;/em&gt; strike $K$.   Now, when carry costs $c(t)$ and short rate $r(t)$ are identically zero, then by arbitrage arguments $F=S_0$ and we also get that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;F = S_0 = K + \hat{C} - \hat{P}= K + {C} - {P}.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we choose $K=S_0$ with zero $r$ and $c$ we necessarily obtain $C-P=0$ or&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;C=P&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;regardless of the underlying model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, yes, there is nothing fishy going on.   Just from boundary conditions, any continuous model would have clearly have &lt;em&gt;some&lt;/em&gt; strike $\tilde{K}$ at which $C_{\tilde{K}}=P_{\tilde{K}}$.  Our arbitrage arguments just put us into the risk-neutral measure where it necessarily emerges that $\tilde{K}=S_0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we were in real-world probability space $\Theta$ with zero rates, we would find that (generically) for $K_0 := S_0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;E^\Theta\left[ (S_T-K_0)^+  \right] \neq E^\Theta\left[ (K_0-S_T)^+  \right]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;even if we were using geometric brownian motion.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2017-04-09T15:26:45.130" LastActivityDate="2017-04-09T15:26:45.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33559" PostTypeId="1" AcceptedAnswerId="33583" CreationDate="2017-04-07T16:29:03.253" Score="0" ViewCount="60" Body="&lt;p&gt;Thank you all for answering my question.&#xA;I wanted to know what influence has the exponential-Lévy model on a call price (how the curve changes).&lt;/p&gt;&#xA;&lt;p&gt;If we add Merton jumps, we get an EDPID like this one: &lt;a href=&quot;https://i.stack.imgur.com/UlkGZ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/UlkGZ.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;with:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/meq6q.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/meq6q.png&quot; alt=&quot;enter image description here&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;What is your financial interpretation of the curve transformation ?&lt;/p&gt;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;&lt;p&gt;Guillaume&lt;/p&gt;&#xA;" OwnerUserId="25844" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2017-04-09T22:42:50.117" Title="influence of exponential-Lévy on a call price" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;jump-diffusion&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33560" PostTypeId="1" AcceptedAnswerId="33565" CreationDate="2017-04-07T17:48:50.443" Score="3" ViewCount="775" Body="&lt;p&gt;What is the formula for a call price in Merton's jump diffusion model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am asking because I was taught: $$BS \left[ S = S_0e^{ n(m + \frac{v}{2}) - C \cdot T} , vol = \sqrt{\sigma^2 + nv/T} \ \right]$$&#xA;i.e., we use the BS formula where spot and volatility are given as above. Here, $$  C = \lambda (e^{ (m + v/2) } -1 ).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And yet, the prices I get from this do not align with some that I found online.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the formula right? What formula do people usually use?&lt;/p&gt;&#xA;" OwnerUserId="26835" LastActivityDate="2017-04-08T00:03:16.170" Title="Formula for Merton jump diffusion call price" Tags="&lt;merton-model&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33561" PostTypeId="1" CreationDate="2017-04-07T18:23:57.323" Score="1" ViewCount="210" Body="&lt;p&gt;There are two form of LIBOR Market Model that has a drift introduced. I would like to know in plain english explanation why do practitioners use these changes of measure. Are there any significance to the pricing of interest rate derivatives like Caps? I know that caplet is priced in the zero coupon bond associated with the measure that makes the LIBOR Model in the form of zero-drift. But why do we have the model with drifts? &lt;/p&gt;&#xA;" OwnerUserId="27375" LastActivityDate="2017-04-09T23:54:26.517" Title="Why change numeraire for the LIBOR Market Model" Tags="&lt;models&gt;&lt;market&gt;&lt;libor&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33563" PostTypeId="2" ParentId="33553" CreationDate="2017-04-07T19:38:58.903" Score="2" Body="&lt;p&gt;One thing to notice is that indeed $E^Q[S_T]=S_0$, by construction, even though the stock price can only drop down to 0, but it can go up to $2\,S_0, 3\,S_0, 100\,S_0$, ... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, implicitly, there are constraints on the distribution of the stock price at time T (otherwise $S_0$ would change): &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;it could be that the actual distribution is symmetric around $S_0$ (in particular, $S_T$ could then at most go up to $2\,S_0$) - that would immediately make plausible that calls and puts are priced the same&lt;/li&gt;&#xA;&lt;li&gt;it could be that price could, say, drop to 10% or rise to 1000% of $S_0$ - but then, to bring the expectation of $S_T$ back to $S_0$, we'd need a very high probability of dropping, and a very low probability of rising ($P_{down} \cdot 0.1 + P_{up} \cdot 10 = 1$). &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So, I think the crucial insight here is that the payoff of the call is unbounded, yes, but so is the stock price at $S_T$ - yet the stock price now is only $S_0$, which imposes constraints that imply $C=P$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Related puzzle, by the way: Suppose you have an upper digital (paying off if $S_T$ &gt; $S_0$). What's the value as vol goes to infinity?&lt;/p&gt;&#xA;" OwnerUserId="7715" LastActivityDate="2017-04-07T19:38:58.903" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33565" PostTypeId="2" ParentId="33560" CreationDate="2017-04-07T23:46:24.080" Score="3" Body="&lt;p&gt;The solution that you provided in your question is conditional on the number of jumps being equal to some fixed $n$. To get the option price, you need to take the probability weighted sum over all values of $n \in \mathbb{N}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Starting from the standard risk-neutral pricing formula, you use the tower law to condition on the total number of jumps until maturity $N_T$, i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;V_0 &amp;amp; = &amp;amp; e^{-r T} \mathbb{E}_{\mathbb{Q}} \left[ \left( S_T - K \right)^+ \right]\\&#xA;&amp;amp; = &amp;amp; e^{-r T} \mathbb{E}_{\mathbb{Q}} \left[ \mathbb{E}_{\mathbb{Q}} \left[ \left. \left( S_T - K \right)^+ \right| N_T = n \right] \right]\\&#xA;&amp;amp; = &amp;amp; \sum_{n = 0}^\infty e^{-r T} \mathbb{E}_{\mathbb{Q}} \left[ \left. \left( S_T - K \right)^+ \right| N_T = n \right] \mathbb{Q} \left\{ N_T = n \right\}.&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let the jump size in the logarithmic asset price be normal with mean $\mu$ and variane $\nu^2$. Conditional on $N_T = n$, the logarithmic terminal asset price $\ln \left( S_T \right)$ is normally distributed with&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathcal{N} \left( \ln \left( S_0 \right) + \left( r - \frac{1}{2} \sigma^2 - \lambda \left( \exp \left\{ \mu + \frac{1}{2} \nu^2 \right\} - 1 \right) \right) T + n \mu, \sigma^2 T + n \nu^2 \right).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now imagine a Black-Scholes model with an initial spot of $\hat{S}_0(n)$ and a volatility of $\xi(n) = \sqrt{\sigma^2 + n \nu^2 / T}$. The logarithmic terminal asset price $\ln \left( \hat{S}_T(n) \right)$ in this model would be normally distributed with&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathcal{N} \left( \ln \left( \hat{S}_0(n) \right) + \left( r - \frac{1}{2} \xi^2(n) \right) T, \xi^2(n) T \right).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While the variances of the two distributions match by construction, we can solve for $\hat{S}_0(n)$ such that their means do as well. We get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\ln \left( \hat{S}_0(n) \right) = \ln \left( S_0 \right) - \lambda \left( \exp \left\{ \mu + \frac{1}{2} \nu^2 \right\} - 1 \right) T + n \left( \mu + \frac{1}{2} \nu^2 \right).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e. denoting by $V_{\text{BS}} \left( S_0, \sigma \right)$ the Black-Scholes solution for the same plain vanilla call with initial spot $S_0$ and volatility $\sigma$, we get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\ldots = \sum_{n = 0}^\infty e^{-\lambda T} \frac{(\lambda T)^n}{n!} V_{\text{BS}} \left( \hat{S}_0(n), \xi(n) \right).&#xA;\end{equation}&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-04-08T00:03:16.170" LastActivityDate="2017-04-08T00:03:16.170" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33566" PostTypeId="2" ParentId="33493" CreationDate="2017-04-08T00:24:44.527" Score="2" Body="&lt;p&gt;Say we are living in a world where the risk free rate is zero, and we have a stock that pays no dividends. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's worth 100 today. It's expected value in 1 year is also 100.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now lets introduce some risk. Let's say this stock has a 50% chance of defaulting. If it defaults, you'll get some of your money back, but not all of it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given this new information, would you happily agree to buy the stock a year from now for £100?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or would you rather pay 50% * 100 + 50% * (however much you believe you can recover)? &lt;/p&gt;&#xA;" OwnerUserId="19663" LastActivityDate="2017-04-08T00:24:44.527" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="33568" PostTypeId="2" ParentId="33561" CreationDate="2017-04-08T11:34:45.843" Score="3" Body="&lt;p&gt;the point of the LMM is to evolve several different rates simultaneously. If you have rates $f_i$ from $t_i$ to $t_{i+1}$ and take a bond expiring at $t_j$ as numeraire then only the rate $f_{j-1}$ is driftless. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typically $P_{t_0}$ is  used as numeraire which makes all the rates have drift. It generally gives lower variance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(see my book More mathematical finance for extensive discussion of drifts.)&lt;/p&gt;&#xA;" OwnerUserId="1809" LastEditorUserId="1809" LastEditDate="2017-04-09T23:54:26.517" LastActivityDate="2017-04-09T23:54:26.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33570" PostTypeId="1" CreationDate="2017-04-08T16:10:03.327" Score="-2" ViewCount="116" Body="&lt;p&gt;In Hull's Options, Futures, and Other Derivatives 9/e, p39, he states&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A &lt;em&gt;stop order&lt;/em&gt; or &lt;em&gt;stop-loss order&lt;/em&gt; also specifies a particular price.  The order is executed at the best available price once a bid or offer is made at that particular price or a less favorable price.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Let's say someone buys one share on the spot market for \$100 with a stop order to sell at \$90.  So, if a bid comes into the order book at \$90 or less, the stop order is triggered and the investor's position is automatically closed at best bid, say, $98.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this correct?  If so, it seems that any market participant could trigger virtually all stop orders just by submitting a ridiculously low bid, which would cause a cascade of market sell orders.&lt;/p&gt;&#xA;" OwnerUserId="6866" LastActivityDate="2017-04-20T22:48:15.830" Title="Stop Orders - Force a Sale?" Tags="&lt;limit-order-book&gt;" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33571" PostTypeId="2" ParentId="33570" CreationDate="2017-04-08T16:47:53.693" Score="0" Body="&lt;p&gt;Indeed, this works the way you described: a stop-order or stop-loss order has a price specified and it is ALWAYS executed whenever your stop-price has been traded.&#xA;Brokers are obligated to execute at the best possible price so that in your example: if you bought @100 and put a stop at @90, then if 90 gets touched, then your stop gets executed and you sell @90 OR (!) at the next best bid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please note that the stop guarantees you an execution at best possible bid, but no one can guarantee to you that there will be enough stocks to hit @90 to let you get out of your whole position at that price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Order books for some products are full of fake liquidity so that one big transaction can simply just cause bid and ask limit orders to shift a couple of price levels without a single trade executed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To sum up: stop-orders work really badly in low liquidity and full of gaps order books.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Advanced trades use more complex order types to avoid the drawbacks of simple stop-loss orders. &lt;/p&gt;&#xA;" OwnerUserId="27334" LastActivityDate="2017-04-08T16:47:53.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33572" PostTypeId="2" ParentId="33570" CreationDate="2017-04-08T16:52:02.490" Score="2" Body="&lt;p&gt;The statement is not accurate (surprising because Hull is usually very reliable). A trade actually has to &lt;em&gt;go&lt;/em&gt; &lt;em&gt;through&lt;/em&gt; (not just a bid to be made) at that price or less favorable price for the order to be triggered.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Illegal manipulation of stop loss orders is possible, but entering a low bid is not sufficient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say the last price is 100 and you have a stop loss to sell 1 lot at 90. There is a bid for 1 lot at 99 and another bid for 1 lot at 98.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the wrongdoer enters a bid for 2 lots at 90, nothing much happens and the bid is queued behind the 99 and 98 bids. Now, however, the wrongdoer enters a market sell order for 3 lots. This triggers the 99 bid, the 98 bid and the 90 bid. Since the 90 price has been traded, the stop order is &quot;eligible&quot; and it trades against the remainder of the wrongdoers 90 bid. Once new bids come in the market is restored to 99/101 and the wrongdoer can unload your shares which he bought at 90 at the equilibrium price of 99. (He may make money even though he has to buy back at 101 the ones he sold at 99 and 98).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I repeat that this is illegal, so don't try it yourself. But do avoid having stop loss orders in a thin market.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2017-04-08T17:28:13.093" LastActivityDate="2017-04-08T17:28:13.093" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33573" PostTypeId="1" CreationDate="2017-04-08T17:00:43.913" Score="1" ViewCount="1061" Body="&lt;p&gt;What is the best way to compile and link QuantLib 1.9 on Mac OS X?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have Xcode installed and understand an #include may work, if create a new QuantLib main(), but never used this IDE before.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can i compile and link on the command line? I have latest OS X 10.12 so should i use stdlib=libc++ or =libstdc++? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get error that --with-boost are unrecognised options. Boost is installed in opt/local/lib  and opt/local/install (i think - the files exist but any way to check this? How do i test and configure PATHS)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Overall error is C compiler cannot create executables...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;./configure --with-boost-include=/opt/local/include/ \&#xA;            --with-boost-lib=/opt/local/lib/ --prefix=/opt/local/ \&#xA;            CXXFLAGS='-O2 -stdlib=libc++ -mmacosx-version-min=10.6' \&#xA;            LDFLAGS='-stdlib=libc++ -mmacosx-version-min=10.6'&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="21023" LastActivityDate="2018-08-14T21:54:36.233" Title="Install QuantLib on Mac OS X" Tags="&lt;quantlib&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="33574" PostTypeId="2" ParentId="33573" CreationDate="2017-04-08T17:12:16.747" Score="6" Body="&lt;p&gt;I use Xcode for QuantLib. It works great. To compile the project, just put all the source files into the Xcode project like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/nl6V7.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/nl6V7.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's the C++ compiler I use:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/PVHqo.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/PVHqo.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's how I configure my header files. You will only need &lt;code&gt;boost&lt;/code&gt; in my screenshot. You will also need to tell Xcode where to find the QuantLib header files. The other paths are for my own code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/o4oIp.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/o4oIp.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then created a new source file with the &lt;code&gt;main&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;int main(int argc, char ** argv)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Remember add &lt;code&gt;#include &amp;lt;ql/quantlib.hpp&amp;gt;&lt;/code&gt; in your main file.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2017-04-08T17:12:16.747" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33575" PostTypeId="2" ParentId="33570" CreationDate="2017-04-08T17:56:12.323" Score="0" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;market participant could trigger virtually all stop orders just by&#xA;  submitting a ridiculously low bid&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yeah, you are absolutely right about this. But as someone already have been noticed in US market investors are protected by NBBO and best execution/transparency in execution policies. Also there are various amount of mechanisms which protects free-market-system like: &quot;Block trades&quot;, RFQ, min/max possible price (price couldn't be something like +/- XX% from last_traded_price in min_possible amount of time) as an effective mechanism which protect market from such events like &quot;Knightmare&quot;, &quot;Flash Crash&quot; and &quot;Fat Finger Error&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;So theory is right, but the execution isn't possible anymore&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for some third-world countries (hello, moex!) with developing markets (especially @derivatives) it's a different story and you could do (almost) whatever you want. For example you could sell (minimum amount)x(equities) (shares/derivatives/currency) a bit below market price via limit order and your &quot;last traded price&quot; will trigger all the stops.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, scallywag years ago, some firm (let's call it db) use this strategy (called something like &quot;splash-orders&quot;) for execution their own orders when they have been required maximum liquidity in one moment of time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Truth be told it's all about exchanges policies and trading orders. There is a big difference between stop-order and stop-limit order.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;In first case you'll receive best matching price &lt;/li&gt;&#xA;&lt;li&gt;And in the second case your sell order will be triggered @your_price&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And of course, price isn't always calculated and orders (which depending on price) don't match from &quot;last_trading_price&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for now, almost all of these &quot;thicks&quot; that you're talking about were fixed at the dawn of electronic trading.&lt;/p&gt;&#xA;" OwnerUserId="26284" LastEditorUserId="26284" LastEditDate="2017-04-08T18:29:32.007" LastActivityDate="2017-04-08T18:29:32.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33576" PostTypeId="2" ParentId="30073" CreationDate="2017-04-08T19:16:08.147" Score="1" Body="&lt;p&gt;I'm sure &lt;a href=&quot;https://www.google.ru/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=2&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0ahUKEwjl5u-zxpXTAhXjYZoKHU0yDf0QFggpMAE&amp;amp;url=https%3A%2F%2Fwww.markit.com%2FNewsInformation%2FNewsAnnouncementsFile%3FCMSID%3Df54b077c3a044773819dc8ccaf1afc6e&amp;amp;usg=AFQjCNEgmdk0rbdwA7K7_Igqo8w1L2H8QQ&quot; rel=&quot;nofollow noreferrer&quot;&gt;this pdf&lt;/a&gt; will help you to understand what's lying beyond CDX.NA.IG and HY&lt;/p&gt;&#xA;&lt;p&gt;As for the more info (from the link: @Alexander) iTraxx is product made by Deutsche Bank&lt;/p&gt;&#xA;" OwnerUserId="26284" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2017-04-08T19:16:08.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33577" PostTypeId="1" CreationDate="2017-04-08T21:34:51.800" Score="3" ViewCount="1374" Body="&lt;p&gt;I would like to get your opinion on the following topic:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am comparing the behaviour of Gaussian and Student-t Copulas. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I employ the follwing procedure:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Simulate N=100,000 samples from a Student Copula with 3 DoF, Student Copula with 100 DoF and a Gaussian Copula.The dimension of the copulas is 3.&lt;/li&gt;&#xA;&lt;li&gt;I then transform these samples via a Student-t Distribution with 3 DoF. &lt;/li&gt;&#xA;&lt;li&gt;Finally I compute the &lt;strong&gt;empirical quantile function of the sum of the marginals&lt;/strong&gt;  and look at the tail of the distribution between 99% and 99.9%. For people familiar with the domain of finance, this is very close to be computing the VaR.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The following graphs are obtained with a Correlation of 0.1. &#xA;&lt;a href=&quot;https://i.stack.imgur.com/7KPO9.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/7KPO9.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following graphs are obtained with a Correlation of 0.9.&#xA;&lt;a href=&quot;https://i.stack.imgur.com/x4dMB.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/x4dMB.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the above graph I conclude that the higher the correlation the lesser the impact of the copulas. How can this be explained mathematically? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below the code I used (Copula package)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;seed1 &amp;lt;- runif(1,0,100000)&#xA;&#xA;n&amp;lt;- 100000&#xA;cor &amp;lt;- c(0.9, 0.9,0.9)&#xA;t.cop &amp;lt;- tCopula(cor, dim = 3, dispstr = &quot;un&quot;,df = 3)&#xA;t.cop100 &amp;lt;- tCopula(cor, dim = 3, dispstr = &quot;un&quot;,df = 100)&#xA;n.cop &amp;lt;- normalCopula(cor, dim = 3, dispstr = &quot;un&quot;)&#xA;set.seed(seed1)&#xA;tCop &amp;lt;- rCopula(n, t.cop)&#xA;set.seed(seed1)&#xA;tCop100 &amp;lt;- rCopula(n, t.cop100)&#xA;set.seed(seed1)&#xA;nCop &amp;lt;- rCopula(n, n.cop)&#xA;&#xA;StudentN &amp;lt;- qt(nCop,3)&#xA;StudentT &amp;lt;- qt(tCop,3)&#xA;StudentT100 &amp;lt;- qt(tCop100,3)&#xA;&#xA;# StudentN &amp;lt;- qnorm(nCop)&#xA;# StudentT &amp;lt;- qnorm(tCop)&#xA;# StudentT100 &amp;lt;- qnorm(tCop100)&#xA;&#xA;Seq_L &amp;lt;- seq(0.99,0.999,0.00001)&#xA;plot(Seq_L,quantile(rowSums(StudentT),Seq_L), type=&quot;l&quot;, col=&quot;red&quot;)&#xA;lines(Seq_L,quantile(rowSums(StudentN),Seq_L), type=&quot;l&quot;, col=&quot;blue&quot;)&#xA;lines(Seq_L,quantile(rowSums(StudentT100),Seq_L), type=&quot;l&quot;, col=&quot;green&quot;)&#xA;&#xA;nam &amp;lt;- c(&quot;Student Copula with 3 DoF&quot;, &quot;Gaussian Copula&quot;, &quot;Studentr Copula with 100 DoF&quot;)&#xA;legend('topleft',  nam, &#xA;       lty=1, col=c('red', 'blue', 'green'), bty='n', cex=.75)&#xA;title(&quot;Comparison of 3 Copulas with correlation: 0.9&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="15834" LastActivityDate="2017-05-11T08:40:13.810" Title="Gaussian vs Student Copula applied to finance" Tags="&lt;correlation&gt;&lt;value-at-risk&gt;&lt;copula&gt;&lt;normal-distribution&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33578" PostTypeId="1" AcceptedAnswerId="33580" CreationDate="2017-04-09T10:53:43.787" Score="0" ViewCount="93" Body="&lt;p&gt;Let's have two exchanges A and B. Exchange A has maker-taker fee structure, while exchange B has taker-maker fee structure. What happens when a broker routes market order to an exchange B at the time when NBBO is at the exchange A? Will the order be automatically routed (when the order type allows routing) to the exchange A and therefore the broker will have to pay the routing fee from exchange B and taker fee from exchange A?&lt;/p&gt;&#xA;" OwnerUserId="27163" LastActivityDate="2017-04-09T13:40:59.283" Title="Fees from market order routing in different fee-strucuted exchanges" Tags="&lt;market-microstructure&gt;&lt;market-making&gt;&lt;fees&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33579" PostTypeId="1" AcceptedAnswerId="33616" CreationDate="2017-04-09T12:54:48.500" Score="1" ViewCount="288" Body="&lt;p&gt;In insurance mathematics, one often models the underlying of an insurance policy with a Black Scholes model on a filtered probability space $(\Omega,\mathbb{Q},\mathcal{F},\mathbb{F}=(\mathcal{F}_{t}))$ with $\mathbb{Q}$ being the risk-neutral measure. For example, one now would like to value a pure endowment product, i.e. at a fixed time $T$ the prelevant stock price $S(T)$ is paid out if the policyholder is alive at time $T$ else there is no payout. Additionally, such products often contain some further financial guarantee, i.e. minimal payout. But this is not essential for my questions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, one also has to model mortality. &#xA;For this, one often considers $T_{x}$ the future lifespan of a $x$-year old  and sets $\mathcal{G}_{t}:=\sigma(\mathbb{1}_{\{T_{x}\leq s  \}}\vert s\leq t)$, which defines the &quot;insurance filtration&quot; $\mathbb{G}=(\mathcal{G}_{t})$. Then the one considers the enlarged filtration $\mathbb{H}=\mathbb{F}\vee\mathbb{G}$ and works on the filtered space $(\Omega,\mathbb{Q},\mathcal{F},\mathbb{H})$. The survival probability is then defined as $p_{x+t}(t,T):=\mathbb{Q}(T_{x}&amp;gt;T\vert \mathcal{H}_{t})$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, I never found a general good and formal account of this. Many things seem implicitly assumed. My questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Are there any good references for this general modeling approach?&lt;/li&gt;&#xA;&lt;li&gt;Why can the risk-neutral measure even be extended to the enlarged space and in particular be used to measure mortality?&lt;/li&gt;&#xA;&lt;li&gt;Or, are they any special conditions needed?&lt;/li&gt;&#xA;&lt;li&gt;If we assume that mortality is independent from financial markets, do we need any of this anyways?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thanks alot for the help.&lt;/p&gt;&#xA;" OwnerUserId="27389" LastActivityDate="2017-04-11T09:29:38.827" Title="Extending risk neutral measure to insurance/mortality filtration" Tags="&lt;modeling&gt;&lt;risk-neutral-measure&gt;&lt;finance-mathematics&gt;&lt;insurance&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33580" PostTypeId="2" ParentId="33578" CreationDate="2017-04-09T13:40:59.283" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;What happens when a broker routes market order to an exchange B at the&#xA;  time when NBBO is at the exchange A?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Assuming the order was a Buy order, your market order just became the best bid and it is on exchange B.  If the best offer was on B, order filled, if not it will route to A (assuming routing allowed).&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;the broker will have to pay the routing fee from exchange B and taker&#xA;  fee from exchange A?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The fees paid will land in the client account.  The broker doesn't pay anything.  If you have some sort of flat fee the you pay per trade then the broker absorbs (not pays) the trade fees against the flat (exorbitant) fee you paid the broker.  Either way you want to look at it, the client account pays.&lt;/p&gt;&#xA;" OwnerUserId="26556" LastActivityDate="2017-04-09T13:40:59.283" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33581" PostTypeId="1" CreationDate="2017-04-09T17:07:59.060" Score="0" ViewCount="372" Body="&lt;p&gt;I am developing a vertical spread trading model. Looking for a way to calculate the stop loss price on the underlying asset for a given vertical spread at an arbitrary time t.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using Black Scholes, I can find the predicted option price given the stock price and other inputs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But finding the stock price for a given credit spread and on two options is different because:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Need to find stock price from options.&lt;/li&gt;&#xA;&lt;li&gt;There are infinite number combinations of options prices for any given credit.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Open a credit spread 940/950 on AMZN trading at 894.88 with volatility 25.415% and 40 days remaining. The credit is $260.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/IpBLQ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/IpBLQ.png&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to this &lt;a href=&quot;http://opcalc.com/9Jf1&quot; rel=&quot;nofollow noreferrer&quot;&gt;calculator&lt;/a&gt;, if the price rises to 920 on the first day, the loss is $106.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I calculate this quickly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I am calculating the loss at each price until I find the given loss, but this is very inefficient. It takes about 100 ms per credit spread for all days. I would like to filter 250 option chains, with each having perhaps 20 spreads. So about 5,000 credit spreads.&lt;/p&gt;&#xA;" OwnerUserId="1384" LastActivityDate="2017-04-09T17:45:22.083" Title="How to calculate vertical spread loss using Black Scholes?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33582" PostTypeId="2" ParentId="33581" CreationDate="2017-04-09T17:45:22.083" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;How can I calculate this quickly?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;A quick way would be to look at 10 point spread prices with different strikes and different expirations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, what is the price of the 920/930 spread for next week?  This would be equivalent to AMZN moving up 20 points in 7 days.  Assuming Vol does not change significantly it should give you a ballpark figure and all you have to do is pull quotes and calibrate it to your positions strike and expiry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, there are other ways but this quick due the fact that there are no calculations to make.  &lt;/p&gt;&#xA;" OwnerUserId="26556" LastActivityDate="2017-04-09T17:45:22.083" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33583" PostTypeId="2" ParentId="33559" CreationDate="2017-04-09T22:31:46.877" Score="1" Body="&lt;p&gt;While you are asking about the call price curve, the effect of adding compound Poisson jumps to a diffusion is more clearly observable when looking at either the implied probability density or the implied volatility smile. We can also prove that the excess kurtosis of the logarithmic returns is always non-negative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Excess Kurtosis is Non-Negative&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, we can show that any jump-diffusion model generates a non-negative excess kurtosis. Let $X_t = \ln \left( S_t / S_0 \right)$ be the logarithmic asset price following&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;X_t = \gamma t + \sigma W_t + \sum_{i = 1}^{N_t} Y_i.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here,&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$\gamma \in \mathbb{R}$ is the drift such that the discounted asset price is a martingale under the risk-neutral probability measure $\mathbb{P}^*$,&lt;/li&gt;&#xA;&lt;li&gt;$W$ is a standard Brownian motion,&lt;/li&gt;&#xA;&lt;li&gt;$N$ is a compound Poisson process with intensity $\lambda \in \mathbb{R}_+$ and&lt;/li&gt;&#xA;&lt;li&gt;$\left( Y_i \right)_{i = 1}^\infty$ is a sequence of i.i.d. normal random variables with characteristic function $\phi_Y(\omega)$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The cumulant generating function of $X_t$ is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\psi_{X_t}(\omega) &amp;amp; = &amp;amp; \ln \left( \mathbb{E}_{\mathbb{P}^*} \left[ e^{\mathrm{i} \omega X_t} \right] \right)\\&#xA;&amp;amp; = &amp;amp; \left( \mathrm{i} \omega \gamma - \frac{1}{2} \omega^2 \sigma^2 + \lambda \left( \phi_Y(\omega) - 1 \right) \right) t.&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a standard result, see e.g. Proposition 3.4 in Cont and Tankov (2004). The $n$-th cumulant is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;c_n \left( X_t \right) &amp;amp; = &amp;amp; \frac{1}{\mathrm{i}^n} \frac{\partial^n \psi_{X_t}}{\partial \omega^n}(0)\\&#xA;&amp;amp; = &amp;amp; \left( \gamma \mathrm{1} \{ n = 1 \} + \sigma^2 \mathrm{1} \{ n = 2 \} + \lambda \frac{1}{\mathrm{i}^n} \frac{\partial^n \phi_Y}{\partial \omega^n}(0) \right) t&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We recognize that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\frac{1}{\mathrm{i}^n} \frac{\partial^n \phi_Y}{\partial \omega^n}(0) = \mathbb{E} \left[ Y^n \right],&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;given that derivative at zero/expectation exists. The normalized fourth cumulant is equal to the excess kurtosis&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathcal{K} \left( X_t \right) = \frac{c_4 \left( X_t \right)}{c_2 \left( X_t \right)^2},&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;see e.g. Section 2.4 in Lukacs (1970). From the above we can conclude that $\mathcal{K} \left( X_t \right) \geq 0$ for jump-diffusion models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Implied Probability Density and Volatility Smile&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the positive excess kurtosis, the implied probability density becomes more fat-tailed. The below plot is for a Merton jump-diffusion model with $Y \sim \mathcal{N} \left( \alpha, \beta^2 \right)$. I used $T = 1$ month, $r = 0\%$, $\sigma = 20\%$, $\lambda = 25$, $\alpha = 0$ and the lines correspond to $\beta = 0\%$ (blue) $\beta = 1\%$ (green) and $\beta = 2\%$ (red).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/mczoq.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/mczoq.png&quot; alt=&quot;Merton Implied Densities&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The corresponding implied volatility smiles become more convex ($S_0 = 100$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/8Us4J.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/8Us4J.png&quot; alt=&quot;Merton Implied Volatility Smiles&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, here are two plots for the skewness as a function of $\alpha$ when $\beta = 2\%$ and for the excess kurtosis as a function of $\beta$ when $\alpha = 0\%$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/BUceH.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/BUceH.png&quot; alt=&quot;Skewness vs. Jump Mean&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/Ak74d.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Ak74d.png&quot; alt=&quot;Excess Kurtosis vs. Jump Volatility&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I put the Jupyter notebook used to generate these plots on &lt;a href=&quot;https://github.com/MatthiasThul/MertonJumpDiffusionAnalytics&quot; rel=&quot;nofollow noreferrer&quot;&gt;GitHub&lt;/a&gt; so you can play around with it yourself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cont, Rama and Peter Tankov (2004) &lt;em&gt;Financial Modelling With Jump Processes&lt;/em&gt;: Chapman &amp;amp; Hall&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lukacs, Eugene (1970) &lt;em&gt;Characteristic Functions&lt;/em&gt;: Griffin London, 2nd Edition&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-04-09T22:42:50.117" LastActivityDate="2017-04-09T22:42:50.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33584" PostTypeId="1" AcceptedAnswerId="33622" CreationDate="2017-04-10T00:15:59.743" Score="4" ViewCount="619" Body="&lt;p&gt;Let's write $S(T) = S_T$ and $S(0) = S_0$. We want to compute $\frac{d}{dS_0}\mathbb{E}[f(S_T)]$. From a previous discussion this is equal to $$\mathbb{E}_{S_0}\left[f(S_T)\frac{g'_{S_0}(S_T)}{g_{S_0}(S_T)}\right]$$&#xA;where $f(S_T) = e^{-rT}(S_T - K)^{+}$. We need to find $g_{S_0}(S_T)$, the density of $S_T$ which is given by $$g(x) = \frac{1}{x\sigma\sqrt(T)}\phi\left(\frac{ln(x/S_0) - (r - \sigma^2/2)T}{\sigma\sqrt{T}}\right)$$ where $\phi$ is the standard normal density.&#xA;In my notes it states that through algebra and calculus gives $$\frac{g'_{S_0}(x)}{g_{S_0}(x)} = \frac{ln(x/S_0) - (r - \sigma^2/2)T}{S_0 \sigma^2 T}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am a bit confused but the mix of notation of $g(x)$ and $g_{S_0}(x)$, I want to show the detail of this to convince myself that this is true through &quot;algebra and calculus&quot;. This is not an exercise for homework, I just do not understand the notation which is not allowing me to proceed. Any suggestions or comments are appreciated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Attempted Derivation:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Through some algebra I was able to do expand $g(x)$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;g(x) &amp;amp;= \frac{1}{x\sigma\sqrt(T)}\phi\left(\frac{ln(x/S_0) - (r - \sigma^2/2)T}{\sigma\sqrt{T}}\right)\\&#xA;&amp;amp;= \frac{1}{x\sigma\sqrt{T}}\cdot \frac{1}{\sqrt{2\pi}}\exp\left(-\left(\frac{ln(x/S_0) - (r-\sigma^2/2)T}{\sigma\sqrt{T}}\right)^2/2\right)\\&#xA;&amp;amp;= \frac{1}{x\sigma\sqrt{T}}\cdot \frac{1}{\sqrt{2\pi}}\exp\left(-\frac{r}{2\sigma^2} + \frac{ln(x/S_0)}{2\sigma^2 T} + \frac{1}{4}\right)&#xA;\end{align*}&#xA;Thus, $$g'(x) = \frac{ \exp\left(-\frac{r}{2\sigma^2} + \frac{ln(x/S_0)}{2\sigma^2 T} + \frac{1}{4}\right)}{2\sqrt{2\pi}\sigma^3 T^{3/2}x^2} - \frac{ \exp\left(-\frac{r}{2\sigma^2} + \frac{ln(x/S_0)}{2\sigma^2 T} + \frac{1}{4}\right)}{\sqrt{2\pi}\sigma\sqrt{T}x^2 } $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see this seems to be turning into an algebra nightmare. Unless I did something wrong I do not see how we will get $$\frac{g'_{S_0}(x)}{g_{S_0}(x)} = \frac{ln(x/S_0) - (r - \sigma^2/2)T}{S_0 \sigma^2 T}$$&lt;/p&gt;&#xA;" OwnerDisplayName="user26372" LastEditorDisplayName="user26372" LastEditDate="2017-04-10T01:08:45.220" LastActivityDate="2017-04-11T14:42:24.463" Title="European call delta derivation" Tags="&lt;options&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;&lt;delta&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="33588" PostTypeId="1" CreationDate="2017-04-10T08:26:25.513" Score="1" ViewCount="83" Body="&lt;p&gt;Maybe this is a weird question, but suppose that, for some reason, one would like to write an (implicit) option whose payoff is indexed on the writer's CDS spread.&#xA;I would like to know what would be a &quot;fair&quot; premium to charge for this option, knowing that there's no concrete hedging strategy available to the writer (which would require selling protection against its own default) ?&#xA;Of course the term &quot;fair&quot; is quite vague and is actually part of my question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="27394" LastEditorUserId="20454" LastEditDate="2017-06-29T14:25:42.967" LastActivityDate="2017-06-29T14:25:42.967" Title="Writing option on one's own default" Tags="&lt;option-pricing&gt;&lt;cds&gt;&lt;replication&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33589" PostTypeId="1" AcceptedAnswerId="33634" CreationDate="2017-04-10T09:02:08.610" Score="3" ViewCount="270" Body="&lt;p&gt;I have only one return for calculating sharp ratio. As you know, we should calculate standard deviation of returns and standard deviation of one item is 0. Suppose that the single return is 0.1 and the risk less return is 0.2. How can I calculate sharp ratio for these two inputs?&lt;/p&gt;&#xA;" OwnerUserId="8234" LastActivityDate="2017-04-21T06:03:08.513" Title="Calculate Sharpe ratio for only one return" Tags="&lt;sharpe-ratio&gt;&lt;performance-evaluation&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="2" ClosedDate="2017-04-16T18:55:09.413" ContentLicense="CC BY-SA 3.0" />
  <row Id="33590" PostTypeId="1" CreationDate="2017-04-10T09:13:21.107" Score="0" ViewCount="3537" Body="&lt;p&gt;If I have volatility smile quoted with respect to the delta of an option on the forward, how can I convert this delta into the moneyness or strike of the option?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any bult-in function of Matlab financial toolbox?&lt;/p&gt;&#xA;" OwnerUserId="26657" LastEditorUserId="26657" LastEditDate="2017-04-10T10:25:14.930" LastActivityDate="2017-04-10T10:25:14.930" Title="From Delta to moneyness or strike" Tags="&lt;greeks&gt;&lt;volatility-smile&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33591" PostTypeId="2" ParentId="33590" CreationDate="2017-04-10T09:55:15.987" Score="1" Body="&lt;p&gt;The call delta in a Black framework is:&#xA;$$\Delta = N(d_1)$$&#xA;with $d_1=\frac{\ln(F_t(T)/K)+(T-t)\frac{\sigma^2}{2}}{\sigma\sqrt{T-t}}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the strike of the option is:&#xA;$$K=F_t(T) e^{-(N^{-1}(\Delta)+1/2) \sigma \sqrt{T-t}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same thing is done if the option is a put and we obtain:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$K=F_t(T) e^{-(N^{-1}(\Delta+1)+1/2) \sigma \sqrt{T-t}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In matlab it can be solved by doing:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;fzero(@(Strike) blsdelta(Price,Strike,Rate,Time,Volatility,Yield)-Delta, K0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where the initial guess can be &lt;code&gt;K0 = Price&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="26657" LastActivityDate="2017-04-10T09:55:15.987" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="33593" PostTypeId="1" CreationDate="2017-04-10T11:14:43.247" Score="0" ViewCount="850" Body="&lt;p&gt;I'm currently reading the article written by David X.Li &quot;On Default Correlation: A copula Function Approach&quot;. I'm deepening my interest in subprime mortgage crisis.&#xA;In the introduction of the paper the author talks about survival probability and hazard rate function. They are linked by the following formula:&#xA;$$S(t)=e^{-\int_0^th(s)ds},$$&#xA;where $S$ denotes the survival probability and $h$ the hazard rate function.&#xA;The author also defines the following quantity:&#xA;$$p_{t,x}=\mathbb P\left\{T&amp;gt;t+x|T&amp;gt;x\right\},$$&#xA;where &quot;T&quot; is a random variable denoting the default event.&#xA;Then, he states that:&#xA;$$p_{t,x}=e^{-\int_0^th(x+s)ds}.$$&#xA;According to my calculations:&#xA;\begin{align}&#xA;e^{-\int_0^th(s)ds}&amp;amp;=S(t+x)\\&#xA;&amp;amp;=\mathbb P\left\{T&amp;gt;t+x\right\}\\&#xA;&amp;amp;=\mathbb P\left\{T-x&amp;gt;t\right\},&#xA;\end{align}&#xA;whereas&#xA;\begin{align}&#xA;p_{t,x}&amp;amp;=\mathbb P\left\{T&amp;gt;x+t|T&amp;gt;x\right\}\\&#xA;&amp;amp;=\frac{\mathbb P\left\{T&amp;gt;x+t,T&amp;gt;x\right\}}{\mathbb P\left\{T&amp;gt;x\right\}}\\&#xA;&amp;amp;=\frac{\mathbb P\left\{T&amp;gt;x+t\right\}}{\mathbb P\left\{T&amp;gt;x\right\}}\\&#xA;&amp;amp;=\frac{\mathbb P\left\{T-x&amp;gt;t\right\}}{\mathbb P\left\{T&amp;gt;x\right\}}.&#xA;\end{align}&#xA;So in the first part of my calculations, I'm missing the denominator since the two expressions must match. Can I kindly ask you where I am wrong?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="22470" LastEditorUserId="24222" LastEditDate="2017-04-10T12:01:09.627" LastActivityDate="2017-04-10T12:01:09.627" Title="Survival Probability and Hazard Rate Function" Tags="&lt;default-probability&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33594" PostTypeId="1" CreationDate="2017-04-10T11:49:29.270" Score="0" ViewCount="306" Body="&lt;p&gt;I'm calculating 1-day parametric VaR estimates for a stock index under the simple assumption that the returns are normally distributed. My question is, what is your opinion of using a volatility index such as the VIX as an input for the expected volatility of the underlying stock index?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The (annualized) volatility index level would be re-scaled at the daily level (e.g. ${\sqrt{1/360}}\,VIX$). I recognize that VIX is an expectation over one month which is longer than the one-day VaR risk horizon. Are there some other fundamental problems?&lt;/p&gt;&#xA;" OwnerUserId="27398" LastEditorUserId="19887" LastEditDate="2017-04-10T15:35:48.007" LastActivityDate="2017-04-10T16:24:49.900" Title="Implied volatility in parametric VaR" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;var&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33597" PostTypeId="2" ParentId="33220" CreationDate="2017-04-10T14:04:44.847" Score="1" Body="&lt;p&gt;All of the DMS returns are adjusting for dividends. Hence dividends are accounted in the sample. Moreover, DMS have also accounted for inflation. Hence, the real total net equity index return, now and hereafter, $e_{t}$, may be mathematically defined as &#xA;  \begin{equation*}&#xA;      e_{t}=\frac{1+\frac{P_{t}+D_{t}}{P_{t-1}}}{1+\pi_{t}}-1&#xA;  \end{equation*}&#xA;  where $P_{t}$, and $D_{t}$ refers to the price of the index and dividend. $\pi_{t}$ refers to the inflation between periods $t-1$ and $t$ &lt;code&gt;\cite[see,][]{dimson2000risk}&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;@article{dimson2000risk,&#xA;  title={Risk and Return in the 20th and 21st Centuries},&#xA;  author={Dimson, Elroy and Marsh, Paul and Staunton, Mike},&#xA;  journal={Business Strategy Review},&#xA;  volume={11},&#xA;  number={2},&#xA;  pages={1--18},&#xA;  year={2000},&#xA;  publisher={Wiley Online Library}&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="12027" LastActivityDate="2017-04-10T14:04:44.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33600" PostTypeId="1" CreationDate="2017-04-10T14:50:43.763" Score="3" ViewCount="599" Body="&lt;p&gt;I have heard many times that such languages as Python, C++, R and Matlab are popular in finance industry. As for the first three it is a clear choice since they are open source and non-proprietary, but using Matlab requires purchasing of license, so my question is can quant (or anyone else doing quantitative tasks) use another proprietary CAS or programming language like Mathematica for example? If not, why just Matlab?&lt;/p&gt;&#xA;" OwnerUserId="27119" LastActivityDate="2017-04-10T14:50:43.763" Title="Is Wolfram Mathematica a suitable tool for quant?" Tags="&lt;programming&gt;" AnswerCount="0" CommentCount="3" ClosedDate="2017-04-10T15:44:10.333" ContentLicense="CC BY-SA 3.0" />
  <row Id="33602" PostTypeId="2" ParentId="33594" CreationDate="2017-04-10T16:24:49.900" Score="-1" Body="&lt;p&gt;The idea of the parametric VaR is to fit a parametric distribution to historical data. In your case, the historical data is your daily returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Starting from this, you have to make an assumption on this historical returns distribution. The most obvious choice is to assume a normal distribution, which is entirely determined by the mean (average of your historical returns distribution) and the variance (standard deviation of your daily historical returns distribution). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you have fully parameterized your distribution, there exists a closed-form solution for the VaR at any quantile $\alpha$. Here is a post mentioning this formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/16098/parametric-analytical-var?rq=1&quot;&gt;Parametric/Analytical VaR&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps &lt;/p&gt;&#xA;" OwnerUserId="26595" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:23.037" LastActivityDate="2017-04-10T16:24:49.900" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33603" PostTypeId="1" AcceptedAnswerId="33633" CreationDate="2017-04-10T17:15:01.853" Score="0" ViewCount="545" Body="&lt;p&gt;If I have &lt;code&gt;adj.close&lt;/code&gt; and &lt;code&gt;close&lt;/code&gt; values of a stock, and I want to calculate &lt;code&gt;adj.open&lt;/code&gt; from &lt;code&gt;open&lt;/code&gt;, should I just multiply the &lt;code&gt;open&lt;/code&gt; prices with the percentage change  (adj.close/close) or should I add the difference (close - adj.close) to each open price?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you. &lt;/p&gt;&#xA;" OwnerUserId="25040" LastActivityDate="2017-04-21T07:31:19.320" Title="If I have adj.close and close, how to convert open to adj.open?" Tags="&lt;equities&gt;" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="33604" PostTypeId="1" AcceptedAnswerId="33613" CreationDate="2017-04-10T18:15:09.133" Score="10" ViewCount="8157" Body="&lt;p&gt;To understand how Bloomberg prices foreign exchange vanilla options , I extract the following screenshot from its OVML function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/KCZsC.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/KCZsC.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Black-Scholes formua for vanilla options are&#xA;\begin{split}&#xA;&amp;amp; P=\phi\big(Se^{-R_fT}N(\phi d_1)-Xe^{-R_dT}N(\phi d_2)\big) \\&#xA;&amp;amp; d_1 = \frac{\ln(\frac{S}{X})+(R_d-R_f)T+0.5\sigma^2T}{\sigma\sqrt{T}} \\&#xA;&amp;amp; d_2 = d_1-\sigma\sqrt{T}&#xA;\end{split}&#xA;where &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\phi$: 1 for call; -1 for put&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S$: Spot rate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X$: Strike rate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$R_d$: Domestic interest rate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$R_f$: Foreign interest rate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma$: Volatility&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$T$: Time horizon&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the screenshot, I get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{split}&#xA;&amp;amp; S = 1.3347 \\&#xA;&amp;amp; X = 1.3338 \\&#xA;&amp;amp; T = \frac{22}{252} = 0.08730 \text{ yrs} \\&#xA;&amp;amp; \sigma = 0.0655&#xA;\end{split}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also look up that the $R_{USD} = 0.75$ and $R_{CAD}=0.50$. Plugging these numbers in, I get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d_1 = \frac{\ln(\frac{1.3347}{1.3338})+(0.75-0.50)\times 0.08730+0.5\times 0.0655^2 \times 0.08730}{0.0655 \sqrt{0.08730}} = 1.5580$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d_2=1.5580 - 0.0655*\sqrt{0.0873} = 1.5386$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and $P = 1.3347 \times e^{0.50\times 0.0873}\times N(1.5580) - 1.3338\times e^{-0.75\times 0.0873}\times N(1.5386) = 0.03864$, which is nowhere close to Bloomberg's result of 0.07452. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also tried multiplying volatility by $\sqrt{12}$, assuming that the volaility they gave is monthly not annualized. The resulting price is 0.05624, which doesn't match either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also tried changing 0.75 and 0.5 into 0.0075 and 0.005, assuming that the interest rates are in percentages. The resulting price is 0.01688, which also doesn't match.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="27404" LastActivityDate="2021-05-16T21:06:03.060" Title="Pricing of a Foreign Exchange Vanilla Option" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;fx&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="33606" PostTypeId="2" ParentId="33513" CreationDate="2017-04-10T18:29:39.140" Score="3" Body="&lt;p&gt;Here's the kind of problem you can run into with financial data if you select the in-sample/out-of-sample split randomly, instead of chronologically: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose you're building a model to predict stock returns, and you have data on the daily returns for every S&amp;amp;P500 stock over several years.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose stock returns are reasonably modelled by a one-factor model (so a stock's return is pretty close its beta times the S&amp;amp;P500 return).  This is a simplification, but it's accurate enough for this example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now split the data randomly, and train your favorite model to predict next-day returns as a function of beta, plus whatever else you think is relevant.  If the S&amp;amp;P500 index has gone up over your sample period, then the model will favor the highest beta stocks.  If the S&amp;amp;P500 went down, then your model will favor the lowest beta stocks.  This will look great &quot;out-of-sample&quot;, but only because you've implicitly told your model how the S&amp;amp;P500 performed over the entire sample period, so it already knows the right answer for your out-of-sample data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem goes away if you split chronologically.&lt;/p&gt;&#xA;" OwnerUserId="2027" LastActivityDate="2017-04-10T18:29:39.140" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33607" PostTypeId="1" CreationDate="2017-04-10T19:20:43.787" Score="1" ViewCount="124" Body="&lt;p&gt;If we take the heston model but change it slightly by introducing a new parameter $\alpha$ such that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/9YW01.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/9YW01.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is there a way to price the call option within this model as, maybe, a function of the call price within the original model? Or a function of $S_T$ as simulated from the original model?&lt;/p&gt;&#xA;" OwnerUserId="26148" LastActivityDate="2017-04-10T21:55:51.260" Title="Shifted heston call price" Tags="&lt;heston&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33609" PostTypeId="2" ParentId="7272" CreationDate="2017-04-10T19:43:16.030" Score="5" Body="&lt;p&gt;There is now a package for that: The MSGARCH package, you can find it on &lt;a href=&quot;https://CRAN.R-project.org/package=MSGARCH&quot; rel=&quot;noreferrer&quot;&gt;CRAN&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find an exhaustive vignette here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2845809&quot; rel=&quot;noreferrer&quot;&gt;David Ardia, Keven Bluteau, Kris Boudt, Denis-Alexandre Trottier: Markov-Switching GARCH Models in R: The MSGARCH Package (2016)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Abstract&lt;/strong&gt;&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Markov-switching GARCH models have become popular to model the&#xA;  structural break in the conditional variance dynamics of financial&#xA;  time series. In this paper, we describe the R package MSGARCH which&#xA;  implements Markov-switching GARCH-type models very effficiently by&#xA;  using C object-oriented programming techniques. It allows the user to&#xA;  perform simulations as well as Maximum Likelihood and Bayesian&#xA;  estimation of a very large class of Markov-switching GARCH-type&#xA;  models. Risk management tools such as Value-at-Risk and&#xA;  Expected-Shortfall calculations are available. An empirical&#xA;  illustration of the usefulness of the R package MSGARCH is presented.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For modelling EGARCH you set &lt;code&gt;model = &quot;eGARCH&quot;&lt;/code&gt; in the &lt;code&gt;create.spec&lt;/code&gt; function (see p. 2 in the abovementioned vignette).&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2017-04-10T19:43:16.030" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33610" PostTypeId="2" ParentId="303" CreationDate="2017-04-10T19:55:21.730" Score="0" Body="&lt;p&gt;Credit Suisse use it a lot in quants, BarCap use it to some extent. Buy side, BlueMountain Capital are very F# heavy in analytics and contribute to open source a lot (Deedle is amazeballs!). Its also used sporadically in other funds. &lt;/p&gt;&#xA;" OwnerUserId="25164" LastEditorUserId="25164" LastEditDate="2018-01-31T20:44:17.987" LastActivityDate="2018-01-31T20:44:17.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33611" PostTypeId="2" ParentId="33607" CreationDate="2017-04-10T20:43:57.977" Score="2" Body="&lt;p&gt;Let  $X_t = a S_t+(1-a)S_0$. Then&#xA;\begin{align*}&#xA;dX_t &amp;amp;= adS_t=a\lambda X_t \sqrt{v_t} dW^S_t,\\&#xA;X_0 &amp;amp;= S_0.&#xA;\end{align*}&#xA;Moreover,&#xA;\begin{align*}&#xA;\max(S_T-K, 0) &amp;amp;= \max\left(\frac{1}{a}X_T - \frac{1-a}{a}S_0 -K, \, 0 \right)\\&#xA;&amp;amp;= \frac{1}{a}\max\Big(X_T-\big(aK-aS_0+S_0\big), \, 0 \Big).&#xA;\end{align*}&#xA;You can now value the option using the previous formula or Monte Carlo approach, assuming that the underlying asset process is represented by $\{X_t, \, t \ge 0\}$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2017-04-10T20:43:57.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33612" PostTypeId="2" ParentId="33607" CreationDate="2017-04-10T21:55:51.260" Score="2" Body="&lt;p&gt;if we change coordinates slightly, we can regard the process as&#xA;$$&#xA;d (S+\alpha) = (S+\alpha) r dt + \lambda(S+\alpha)\sqrt{V} dW_t,&#xA;$$&#xA;so it's an option on $S+\alpha$ with $S+\alpha$ following the Heston process.&#xA;So just take the old formula and add $\alpha$ to spot and strike.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2017-04-10T21:55:51.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33613" PostTypeId="2" ParentId="33604" CreationDate="2017-04-10T23:19:02.497" Score="8" Body="&lt;p&gt;&lt;strong&gt;Be careful of your rate conventions!&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The issue here is that all your rates are expected to be in units of domestic vs 1 unit of foreign. So for example USDCAD is 1.3347, you really need to be using 1/1.3347 = 0.749 USD per 1 CAD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, your inputs need to be&#xA;$$&#xA;\begin{align}&#xA;S &amp;amp;= 1 / 1.3347 \\&#xA;X &amp;amp;= 1 / 1.3338 \\&#xA;R_d &amp;amp;= 0.75\% \\&#xA;R_f &amp;amp;= 0.50\% \\&#xA;\sigma &amp;amp;= 6.55\% \\&#xA;T &amp;amp;= 22/252&#xA;\end{align}&#xA;$$&#xA;If you do this calculation you will get&#xA;$$&#xA;P = 0.005614&#xA;$$&#xA;Now, the output of this is also in units of domestic per 1 unit of foreign notional (as pointed out by &lt;a href=&quot;https://quant.stackexchange.com/users/16148/&quot;&gt;noob2&lt;/a&gt;). e.g. 0.005614 USD per 1 CAD notional. To get from CAD notional to USD notional, divide by $X$.&#xA;$$&#xA;P_d = P / X = 0.7488\%&#xA;$$&#xA;You can compare this to the $0.7452\%$ from your Bloomberg screenshot.&lt;/p&gt;&#xA;" OwnerUserId="5617" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2017-04-10T23:38:25.367" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="33615" PostTypeId="2" ParentId="33577" CreationDate="2017-04-11T08:14:02.220" Score="2" Body="&lt;p&gt;The first graph with $\rho=0.1$ is straightforward. The t-copula presents more tail dependence than the gaussian copula. Hence, when you look at the tail, there is more probability mass in the case of a student copula. When the degree of freedom increases, you converge to the gaussian copula which explains why the 100df is close to the gaussian. In case $\rho=0.9$, the difference is very small because all these copulas converge to the comonotonic copula obtained when $\rho=1$. &lt;/p&gt;&#xA;" OwnerUserId="27358" LastActivityDate="2017-04-11T08:14:02.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33616" PostTypeId="2" ParentId="33579" CreationDate="2017-04-11T09:29:38.827" Score="1" Body="&lt;p&gt;I'm Phd student in insurance mathematics so I think I have a good position to answer your question. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you said, many insurance products have a financial component and an actuarial component, i.e. some financial guarantees upon the survival or death of the insured.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most insurance papers price this type of payoff via risk-neutral valuation. If you assume that the equity and mortality risks are independent under Q, you can decompose the payoff into a product of risk-neutral expectations. Hence, you decompose the problem into a pure financial payoff and a pure actuarial payoff. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the insurance payoff, most papers assume via diverse arguments that the dynamics under P and Q are the same and hence, you can use your historical data for the actuarial part. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the financial part, if you assume that the financial market is complete (like B-S economy), you have a unique Q and pricing is straightforward. Otherwise, you can &quot;pick&quot; one decent Q via a popular criterion (like the Esscher risk-neutral measure or the minimal risk-neutral measure)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice that all these things work well because you assume that financial and actuarial risks are independent under Q. However, independence under P DOES NOT imply independence under Q. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are interested in this type of research, I recommend you to read papers from my supervisor on his website: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://jandhaene.org/papers/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://jandhaene.org/papers/&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Especially, the paper: On the (in-)dependence between financial and actuarial risks. (2013)&lt;/p&gt;&#xA;" OwnerUserId="27358" LastActivityDate="2017-04-11T09:29:38.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33618" PostTypeId="5" CreationDate="2017-04-11T12:49:24.773" Score="0" Body="&lt;p&gt;Bootstrapping is primarily a method for constructing a (zero-coupon) fixed-income yield curve from the prices of a set of coupon-bearing products, e.g.  deposits, forwards/futures, bonds, swaps etc. The term convers also any recursive procedure of the same kind, for instance default probability curve bootstrapping, caplet volatility bootstrapping.&lt;/p&gt;&#xA;" OwnerUserId="13470" LastEditorUserId="13470" LastEditDate="2017-04-12T07:50:14.383" LastActivityDate="2017-04-12T07:50:14.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33619" PostTypeId="4" CreationDate="2017-04-11T12:49:24.773" Score="0" Body="Bootstrapping is primarily a method for constructing a (zero-coupon) fixed-income yield curve from the prices of a set of coupon-bearing products, e.g.  deposits, forwards/futures, bonds, swaps etc. The term convers also any recursive procedure of the same kind, for instance default probability curve bootstrapping, caplet volatility bootstrapping." OwnerUserId="13470" LastEditorUserId="13470" LastEditDate="2017-04-12T07:49:59.103" LastActivityDate="2017-04-12T07:49:59.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33620" PostTypeId="2" ParentId="16300" CreationDate="2017-04-11T13:07:16.647" Score="3" Body="&lt;p&gt;Interesting idea.  I'm guessing this isn't used for two reasons:  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, the only &lt;a href=&quot;http://www-stat.wharton.upenn.edu/~steele/Papers/PDF/Aacflm.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;algorithm I could find&lt;/a&gt; is $O(n^3)$, which is horrible if you're using a moderately-sized high-frequency dataset.  Least squares is $O(nk^2)$ (n is the number of rows, and k is the number of predictors; typically $k&amp;lt;&amp;lt;n$).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;More relevantly, L1 regression is almost as outlier-insensitive as LMS, and that can be solved easily and quickly with any LP-solver.  For the kinds of outliers we see in finance, I doubt there would be a material difference in the L1 and LMS solutions.&lt;/p&gt;&#xA;" OwnerUserId="2027" LastActivityDate="2017-04-11T13:07:16.647" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33621" PostTypeId="1" AcceptedAnswerId="33669" CreationDate="2017-04-11T13:33:23.837" Score="0" ViewCount="855" Body="&lt;p&gt;I'm doing an assignment where I have liabilities including market and book values of long-term debt. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also have capital including common stock, paid in capital, and accumulated earnings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been able to calculate the structural weights using the debt or equity over the enterprise value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm stuck on calculating the cost of financing, or levered equity beta, in this case however.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to calculate equity beta with the information I've been given that I'm missing?&lt;/p&gt;&#xA;" OwnerUserId="27412" LastActivityDate="2017-05-04T03:53:40.943" Title="How do I calculate levered equity beta without unlevered equity beta?" Tags="&lt;equities&gt;&lt;finance&gt;&lt;beta&gt;" AnswerCount="1" CommentCount="11" ClosedDate="2017-04-14T13:07:45.483" ContentLicense="CC BY-SA 3.0" />
  <row Id="33622" PostTypeId="2" ParentId="33584" CreationDate="2017-04-11T14:22:36.183" Score="3" Body="&lt;p&gt;Two issues can be observed in your derivation. First, we note that&#xA;\begin{align*}&#xA;\exp\left(-\left(\frac{\ln(x/S_0) - (r-\sigma^2/2)T}{\sigma\sqrt{T}}\right)^2/2\right)\color{red}{\ne} \exp\left(-\frac{r}{2\sigma^2} + \frac{\ln(x/S_0)}{2\sigma^2 T} + \frac{1}{4}\right).&#xA;\end{align*}&#xA;Secondly, the derivative (i.e., the delta) is with respect to $S_0$ instead of $x$. In fact, for&#xA;\begin{align*}&#xA;g(S_0, x) &amp;amp;= \frac{1}{x\sigma\sqrt{T}}\phi\left(\frac{\ln(x/S_0) - (r - \sigma^2/2)T}{\sigma\sqrt{T}}\right)\\&#xA;&amp;amp;=\frac{1}{x\sigma\sqrt{T}}\cdot \frac{1}{\sqrt{2\pi}}\exp\left(-\left(\frac{\ln(x/S_0) - (r-\sigma^2/2)T}{\sigma\sqrt{T}}\right)^2/2\right),&#xA;\end{align*}&#xA;it can be easily verified that&#xA;\begin{align*}&#xA;\frac{\partial g(S_0, x)}{\partial S_0} &amp;amp;= g(S_0,x)\, \frac{\ln(x/S_0) - (r-\sigma^2/2)T}{S_0\sigma^2T}.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-04-11T14:42:24.463" LastActivityDate="2017-04-11T14:42:24.463" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33623" PostTypeId="1" CreationDate="2017-04-11T15:29:50.650" Score="2" ViewCount="181" Body="&lt;p&gt;I am a mathematician. What's the go-to reference for a proper math-based introduction to martingale theory and arbitrage pricing? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The books I am being referred to deal mostly either with the discrete case, or, if its continuous, then it does not contain all the proofs and there's a lot of hand-waving (for example, Bjork's Arbitrage theory in Continuous time, which does not even contain proper proofs of, say, the fundamental theorem of finance or the all-important Ito formula). &lt;/p&gt;&#xA;" OwnerUserId="27415" LastActivityDate="2017-04-13T17:55:48.927" Title="Reference request for arbitrage pricing with martingale theory" Tags="&lt;reference-request&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33624" PostTypeId="1" CreationDate="2017-04-11T16:09:30.470" Score="3" ViewCount="612" Body="&lt;p&gt;I am reading the following two Markit documents concerning the bootstrapping of respectively &lt;a href=&quot;http://www.cdsmodel.com/cdsmodel/assets/cds-model/docs/Interest%20Rate%20XML%20v1.3.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;the USD rates curve&lt;/a&gt; and &lt;a href=&quot;http://www.cdsmodel.com/cdsmodel/assets/cds-model/docs/Interest%20Rate%20Curve%20Specification%20-%20All%20Currencies%20(Updated%20November%208%202014)%20Final.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;the EUR, GBP, JPY, CHF, CAD, HKD, SGD, AUD and NZD rates curves&lt;/a&gt;. (Both versions are the last versions.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These curves are not curves to be used ase discount curves in a &quot;real&quot; pricing process, they have to be seen as &quot;convention&quot; curves used in the ISDA model for quotation purposes. (All currencies except JPY the only holidays are week-ends (JPY has the TYP holidays calendar.))&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;1) First question.&lt;/strong&gt; In &lt;a href=&quot;http://www.cdsmodel.com/cdsmodel/assets/cds-model/docs/Interest%20Rate%20Curve%20Specification%20-%20All%20Currencies%20(Updated%20November%208%202014)%20Final.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;the second document&lt;/a&gt; page 7 one sees the following table :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/sfazT.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/sfazT.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I perfectly get what &quot;&lt;em&gt;Trade Date + 2 business days (ignoring holidays)&lt;/em&gt;&quot; (spotdate row for CHF) means : it means that the spot date is equal to the date resulting of the shif of the trade date by to business days forward, the &quot;ignoring holidays&quot; being here surely to recall that there are no holidays except week-ends for EUR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get as well what &quot;&lt;em&gt;Trade Date (even if Trade Date is a holiday)&lt;/em&gt;&quot; (spotdate row for CAD for instance) means (obvious).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But &lt;strong&gt;what does &quot;&lt;em&gt;Trade Date + 2 weekdays (ignoring holidays)&lt;/em&gt;&quot; (spotdate row for EUR for instance) exactly mean ?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Does it mean that one shifts the trade date forward by two days, not adjusting the resulting day even if it falls in a week-end ?&lt;/li&gt;&#xA;&lt;li&gt;Or does it means that one shifts the trade date forward by two business days, the &lt;em&gt;ignoring holidays&lt;/em&gt; being there as a reminder of the fact that there are no holidays for EUR except week-ends ?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2) Second question.&lt;/strong&gt; There's something I don't understand in the bootstrapping process. Quote from &lt;a href=&quot;http://www.cdsmodel.com/cdsmodel/assets/cds-model/docs/Interest%20Rate%20Curve%20Specification%20-%20All%20Currencies%20(Updated%20November%208%202014)%20Final.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;the second document&lt;/a&gt; end of page 8 and top of page 9 :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;&lt;em&gt;As part of this process, intermediate discount factors are needed to discount coupons that do not fall on swap or deposit maturity dates - for example the 2Y calculation requires that the coupon at 18 months be discounted. The intermediate discount factor, in this case for 18 months, is interpolated between the 1Y and 2Y discount factors on the basis of a constant forward rate over the period from 1Y to 2Y i.e. the discount factor is log-linearly interpolated. The correct value for the forward rate is determined by an iterative search using Brent’s method.&lt;/em&gt;&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure to perfectly understand. Assuming we're in the EUR case and noting $t_0$ the trade date and $t_s$ the spot date (and assuming as in the paper that the zero-coupon $P_{t_0,t_s}$ is equal to $1$ we do this : we get (through the 1M, 2M, 3M, 6M, 9M and 1Y LIBOR's values provided by Markit) the values of $P_{t_s,t_s+1M}$, $P_{t_s,t_s+2M}$, $P_{t_s,t_s+3M}$, $P_{t_s,t_s+6M}$, $P_{t_s,t_s+9M}$ and $P_{t_s,t_s+1Y}$, and now we want to infer $P_{t_s,t_s+2Y}$ from the 2Y swap rate $s_{2Y}$ Markit furnishes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Writing the definition of $s_{2Y}$ (the fixed rate making the value of the swap equal to $0$ at inception (that is, at $T_s$)) and sparing the details, one finally arrives at an equation of the form :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\varphi\left(P_{t_s,t_s+6M}, P_{t_s,t_s+1Y}, P_{t_s,t_s+18M}, P_{t_s,t_s+2Y}\right) = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\varphi$ is an affine function and where $P_{t_s,t_s+6M}$ and $P_{t_s,t_s+1Y}$ were previously extracted for LIBOR's quotes. We want to find $P_{t_s,t_s+2Y}$, but we need $P_{t_s,t_s+18M}$ that we don't know. Should I understand that we simply interpolate $P_{t_s,t_s+18M}$ by $P_{t_s,t_s+1Y}^{\frac{(t_s +2Y)-(t_s +18M)}{(t_s +2Y)-(t_s +1Y)}} P_{t_s,t_s+2Y}^{\frac{(t_s +18M)-(t_s +1Y)}{(t_s +2Y)-(t_s +1Y)}}$ and that we then solve&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\varphi\left(P_{t_s,t_s+6M}, P_{t_s,t_s+1Y}, P_{t_s,t_s+1Y}^{\frac{(t_s +2Y)-(t_s +18M)}{(t_s +2Y)-(t_s +1Y)}} P_{t_s,t_s+2Y}^{\frac{(t_s +18M)-(t_s +1Y)}{(t_s +2Y)-(t_s +1Y)}}, P_{t_s,t_s+2Y}\right) = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in $P_{t_s,t_s+2Y}$ using Brent's algorithm ?&lt;/p&gt;&#xA;" OwnerUserId="13470" LastEditorUserId="13470" LastEditDate="2017-04-12T07:12:38.560" LastActivityDate="2017-04-12T07:12:38.560" Title="Questions about Markit rates curve bootstrapping" Tags="&lt;interest-rates&gt;&lt;swaps&gt;&lt;cds&gt;&lt;libor&gt;&lt;bootstrapping&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33625" PostTypeId="2" ParentId="33624" CreationDate="2017-04-11T17:02:28.307" Score="-3" Body="&lt;p&gt;For each payment in the swap you want this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ P(t) = e^{-\int_0^t r(\tau) \mathrm{d}\tau} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $r(\tau)$ is the instantaneous rate. They're saying that $r(\tau)$ is constant between nodes, so for your interpolation for the 18m point you would do this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ P(18\mathrm{m}) = P(1\mathrm{y})  e^{-\int_{1\mathrm{y}}^{18\mathrm{m}} r(\tau) \mathrm{d}\tau}  = P(1\mathrm{y})  e^{- r(1\mathrm{y}) \cdot 6\mathrm{m} } $$&lt;/p&gt;&#xA;" OwnerUserId="19663" LastActivityDate="2017-04-11T17:02:28.307" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33626" PostTypeId="1" AcceptedAnswerId="33641" CreationDate="2017-04-11T19:12:17.513" Score="2" ViewCount="1002" Body="&lt;p&gt;How would one calculate the expected cash flows of a floating rate note?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given a yield curve corresponding to the underlying of  a floating rate note, would it be sufficient to compute the forward rates and use them to calculate the future value of the coupon payments? This would be in line with the classical (textbook) single yield curve valuation of the FRN, but I wonder what the industry approach would be. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would one still do it in this way or would one take an interest rate model (which?), simulate many scenarios and take the averages like Monte Carlo? Are there other ways? Let's assume defaults are not of interest.&lt;/p&gt;&#xA;" OwnerUserId="17138" LastActivityDate="2017-04-12T10:02:32.750" Title="Expected Cash flows of a Floating Rate Note" Tags="&lt;floating-rate&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33628" PostTypeId="1" CreationDate="2017-04-11T11:33:55.750" Score="2" ViewCount="142" Body="&lt;p&gt;I am working through a course on PCA and Factor analysis, where the example is to perform regression on stock prices, with an objective to predict the stock prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The author claims, that we need to predict '&lt;strong&gt;Returns&lt;/strong&gt;' instead of '&lt;strong&gt;Prices&lt;/strong&gt;', as Prices are &lt;strong&gt;Stationary&lt;/strong&gt;, and Regression always needs to be performed on &lt;strong&gt;NonStationary&lt;/strong&gt; or &lt;strong&gt;Trending&lt;/strong&gt; Data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The explanation of above is out of the scope of the course.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone please share an intuition why does the said argument hold true?&lt;/p&gt;&#xA;" OwnerUserId="27423" OwnerDisplayName="Ronak Agrawal" LastActivityDate="2017-04-11T20:15:16.243" Title="Why Regression should only be done on Non-Stationary data points?" Tags="&lt;regression&gt;&lt;pca&gt;" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="33629" PostTypeId="2" ParentId="17246" CreationDate="2017-04-11T21:19:10.143" Score="1" Body="&lt;p&gt;This formula is a direct result of the Modigliani-Miller theorem. After some searching I found a fairly simple proof of this here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quantcoyote.com/2017/04/09/modigliani-miller-unlevered-betas/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://quantcoyote.com/2017/04/09/modigliani-miller-unlevered-betas/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="27421" LastActivityDate="2017-04-11T21:19:10.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33630" PostTypeId="1" CreationDate="2017-04-11T21:59:41.617" Score="2" ViewCount="907" Body="&lt;p&gt;I am trying to figure out the theta for a down-and-out barrier put option. After some research of my own, I found out that a down-and-out put can be expressed as&#xA;$$&#xA;P_V(S_0, S_0)-P_V(S_0, H)-(S_0 - H)P_D(S_0, H) - \frac{H}{S_0}(P_V(\frac{H^2}{S_0}, S_0) - P_V(\frac{H^2}{S_0}, H) + (S_0 - H)P_D(\frac{H^2}{S_0}, H))&#xA;$$&#xA;where&#xA;$P_V$ is a vanilla put and $P_D$ is a digital put and $H$ is the barrier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using this formulation, I used the usual greek formluas for the vanilla and digital options. However, I am not getting the result that I am supposed to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This made me suspicious about my approach, and I wanted to check whether my approach was correct. If it is incorrect, I would very much appreciate if someone could tell me how to find the greeks (theta) of a barrier options, down-and-out put in particular.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance.&lt;/p&gt;&#xA;" OwnerUserId="27302" LastEditorUserId="27302" LastEditDate="2017-04-11T22:09:10.143" LastActivityDate="2017-04-11T22:09:10.143" Title="Greeks(theta) of a Down-and-Out barrier option" Tags="&lt;black-scholes&gt;&lt;binary-options&gt;&lt;barrier&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="33632" PostTypeId="1" CreationDate="2017-04-12T01:25:05.520" Score="1" ViewCount="327" Body="&lt;p&gt;Studying the expected utility maximization problem in Merton's model, I'm having some difficulties.&lt;br&gt;&#xA;Let $t$ be a starting time, $T$ the final finite Time.&lt;br&gt;&#xA;We define,&#xA;\begin{equation}&#xA;V(t,x)=\underset{\pi \in A}{\sup}\{\mathbb{E}\left[U(X_T(\pi))\right] |X_t=x\}&#xA;\end{equation}&#xA;Where $A$ is the set of admissible trading strategies.&#xA;We can prove that $V$ satisfies (&lt;a href=&quot;https://quant.stackexchange.com/questions/32185/hamilton-jacobi-bellman-equation-in-merton-model&quot;&gt;Hamilton-Jacobi-Bellman equation in Merton Model&lt;/a&gt;)&#xA;\begin{equation}&#xA;\frac{dV(t,x)}{dt} + \sup_{\pi_t} \left( \frac{dV(t,x)}{dx} x (r+ \pi_t(\mu-r)) + \frac{1}{2} \frac{d^2V(t,x)}{dx^2} x^2 \pi_t^2 \sigma^2 \right) = 0&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the literature (check below for the reference), it's said that $\textit{&quot;a candidate for the optimal control is obtained from the first-order condition}$ $\textit{for the maximum in the HJB equation is :&quot;}$&#xA;\begin{equation}&#xA;\hat{\pi}(t,x)=-\frac{\mu-r}{\sigma^2}\frac{\frac{dV}{dx}}{x\frac{d^2V}{dx^2}}(t,x)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;At this point, I have two questions :&lt;br&gt;&#xA;1/ How can we actually obtain / prove this result ?&lt;br&gt;&#xA;2/ I don't understand why $V$ is actually present in $\hat{\pi}$ 's expression : By definition, isn't V a sup on all possible $\pi$ ? Shouldn't $\hat{\pi}$ depend on everything apart from $V$ ?&lt;br&gt;&#xA;Thanks guys ! &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Huyen Pham. Optimization methods in portfolio management and option&#xA;  hedging&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="26218" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.953" LastActivityDate="2017-04-12T18:20:21.900" Title="How do we solve bellman's equation in Merton's model" Tags="&lt;black-scholes&gt;&lt;merton-model&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33633" PostTypeId="2" ParentId="33603" CreationDate="2017-04-12T03:04:07.223" Score="2" Body="&lt;p&gt;Your first answer will get close enough for most practical applications; multiplicative factors are generally how adj. closes are calculated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have dividend and split data, you can actually get a more granular answers as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P_{adj,\,t-1} = P_{adj, \,t} (1 + (\frac{P_{t-1}}{S} - P_t -D)\frac{1}{P_t}) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &#xA;$P$ is the actual price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P_{adj}$ is the adjusted price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S$ is the split ratio when $t$ is a split ex-date. Otherwise it is $1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and, $D$ is dividends per share if $t$ is a dividend ex-date. $D = 0$ when $t$ is not a dividend ex-date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this helps. I tested the formula and it appears to work. It may get more complicated if there are other kinds of corporate actions which affect share price. But then again, these corporate actions will be reflected in the adjusted close prices as published within most data sources which leads us back to the start: multiplication.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastActivityDate="2017-04-12T03:04:07.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33634" PostTypeId="2" ParentId="33589" CreationDate="2017-04-12T03:31:48.077" Score="3" Body="&lt;p&gt;For a single period return, the squared value of that return approximates variance (i.e., the absolute value approximates the standard deviation). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Standard deviation is defined thus:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma_X = \sqrt\frac{\Sigma_1^N\mathbb{E}[X-\mu_x]^2}{N}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a non-drifting process, $\mu_x = 0$. Also, in our scenario, $X = (r_a - r_m)$ and $N = 1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, an approximation of the Sharpe ratio should be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$S = \frac{r_a-r_b}{\sqrt{\mathbb{E}[r_a-r_m]^2}} \approx \frac{r_a-r_m}{\mid r_a-r_b\mid} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using $r_a = .1$ and $r_b = .2$, $S$ should equal $-1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you need annualize the returns or standard deviation, just remember that logarithmic returns scale with $T$ and logarithmic standard deviation &lt;em&gt;should&lt;/em&gt; scale with $\sqrt{T}$. If operating under the assumption that returns are percentages, one must convert these into logarithmic returns first and/or use geometric compounding rules.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a related thread see: &lt;a href=&quot;https://quant.stackexchange.com/questions/33372/why-is-ds-s-an-estimate-of-realized-volatility#comment46604_33372&quot;&gt;Why is $dS/S$ an estimate of realized volatility?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Addendum: A perhaps pertinent point that I missed in my original pass through is that the &lt;a href=&quot;https://en.wikipedia.org/wiki/Average_absolute_deviation&quot; rel=&quot;nofollow noreferrer&quot;&gt;mean absolute error is related to the expected standard error&lt;/a&gt; by a factor of ${\sqrt {2/\pi }}=0.79788456\ldots$, i.e.,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;For the normal distribution, the ratio of mean absolute deviation to&#xA;  expected standard error is:&#xA;  $w=\frac{ E|X| }{ \sqrt{E(X^2)} } = \sqrt{\frac{2}{\pi}}$. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Furthermore, the &lt;a href=&quot;https://en.wikipedia.org/wiki/Median_absolute_deviation#Relation_to_standard_deviation&quot; rel=&quot;nofollow noreferrer&quot;&gt;median absolute error is connected with standard error&lt;/a&gt; by the following:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;${\displaystyle {\hat {\sigma }}=k\cdot \operatorname {MAD} ,\,}$&#xA;  where k is a constant scale factor, which depends on the&#xA;  distribution.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;For normally distributed data k is taken to be:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;${\displaystyle k=1/\left(\Phi ^{-1}(3/4)\right)\approx 1.4826}$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Therefore, one could improve the estimate of the single-sample Sharpe ratio by multiplying it by $\approx [.67,\, .8]$. Both answers seem like the right one, unless of course, one argues that sample moments are undefined for a single sample space.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2017-04-21T06:03:08.513" LastActivityDate="2017-04-21T06:03:08.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33635" PostTypeId="2" ParentId="33548" CreationDate="2017-04-12T04:18:16.190" Score="5" Body="&lt;p&gt;I've been waiting for someone to ask this question since every published method with which I am familiar propose weights which converge to &lt;span class=&quot;math-container&quot;&gt;$1$&lt;/span&gt; only when the numbers of terms goes to infininity. This is quite annoying as it either requires we use a biased estimate which underestimates the true exponentially weighted mean or use back-dated information to &lt;em&gt;parameter-ize&lt;/em&gt; the initial value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose you have weighting factors in which lagged weights are a factor of &lt;span class=&quot;math-container&quot;&gt;$\beta$&lt;/span&gt;, where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\beta= e^{\frac{-\Delta t}{\tau}}$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(note: &lt;span class=&quot;math-container&quot;&gt;$\beta[t]$&lt;/span&gt; is the canonical weighting vector of an exponential moving average)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To come up weights, we want to find a series such that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$${\Sigma}_{t=0}^{T=N}( \frac{\beta^{T-t}}{\Sigma\beta^{\Delta t}}) = 1$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The sum of the raw exponential weights can be found through a series expansion:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\Sigma_{t=0}^{T=N} \beta^{\Delta t} = \frac{1-\beta^T}{1-\beta}$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, periodic weights, &lt;span class=&quot;math-container&quot;&gt;$\omega_i$&lt;/span&gt; can found as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\omega_i = {\Sigma}_{t=0}^{T=N}\frac{\beta^{T-t}(1-\beta)}{1-\beta^T}$$&lt;/span&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we have a vector of values:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$X_i = [X_1,\, X_2, \, ...X_N]$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and a vector of weights:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\omega_i = [\omega_1,\, \omega_2, \, ...\omega_N]$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the dot-product of the two vectors will provide an unbiased estimate of the exponentially weighted average where the sum of weights always equal &lt;span class=&quot;math-container&quot;&gt;$1$&lt;/span&gt; and where no out-of-sample terms are required to parameterize the initial value. The recursion is limited only to a finite series the same size as the data to be weighted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\text{EWMA} = f(\omega_i \cdot X_i)= \Sigma (\omega_i * X_i)$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please let me if/how this works for you.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2019-01-01T19:16:53.523" LastActivityDate="2019-01-01T19:16:53.523" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="33636" PostTypeId="1" CreationDate="2017-04-12T04:42:01.240" Score="3" ViewCount="780" Body="&lt;p&gt;I have come across two ways of measuring VaR for Fixed Income instruments thus far:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Express the volatility in of basis points and the position in terms of sensitivity to a 1 basis point movement in yields and then multiply it by the desired largest possible movement (95% or 99%); This method is described on page 17 of &lt;a href=&quot;https://ocw.mit.edu/courses/mathematics/18-s096-topics-in-mathematics-with-applications-in-finance-fall-2013/lecture-notes/MIT18_S096F13_lecnote7.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; document.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Map the cash flows of an instrument (a coupon bond) into buckets, get the zero rates (interpolate if needed), find PV01, volatility of these zero rates, get the correlation matrix for the zero rates, find the total variance and calculate the VaR.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The first one seems relatively simple. However, what happens if there are many bonds in the portfolio? Is it OK to find individual VaRs for each bond and then simply sum them up?&lt;/p&gt;&#xA;&lt;p&gt;On the other hand, the second approach does deal with covariance of rates in different time horizons. But there might be a small error due to bucket specification. Theoretically, we could get an infinite number of buckets. But this is obviously very complicated.&lt;/p&gt;&#xA;&lt;p&gt;Any thoughts?&lt;/p&gt;&#xA;" OwnerUserId="19096" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2019-08-08T13:02:50.370" Title="Fixed Income VaR: Yield Vol vs Cash Flow Mapping" Tags="&lt;fixed-income&gt;&lt;var&gt;" AnswerCount="2" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="33637" PostTypeId="1" CreationDate="2017-04-12T06:50:13.870" Score="0" ViewCount="776" Body="&lt;p&gt;I am trying to estimate the weights of an equal risk portfolio using the PortfolioAnalytics package in r. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To start with, I have tried to redo the example provided in the portfolio vignette. The code is given below, &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[![library(PortfolioAnalytics)&#xA;library(DEoptim)&#xA;library(ROI)&#xA;require(ROI.plugin.glpk)&#xA;require(ROI.plugin.quadprog)&#xA;data(edhec)&#xA;R &amp;lt;- edhec\[, 1:6\]&#xA;colnames(R) &amp;lt;- c(&quot;CA&quot;, &quot;CTAG&quot;, &quot;DS&quot;, &quot;EM&quot;, &quot;EQMN&quot;, &quot;ED&quot;)&#xA;funds &amp;lt;- colnames(R)&#xA; # Create an initial portfolio object with leverage and box constraints&#xA;init &amp;lt;- portfolio.spec(assets=funds)&#xA;init &amp;lt;- add.constraint(portfolio=init, type=&quot;leverage&quot;,&#xA;                  min_sum=0.99, max_sum=1.01)&#xA;init &amp;lt;- add.constraint(portfolio=init, type=&quot;box&quot;, min=0.05, max=0.65)&#xA;init$constraints\[\[2\]\]$min &amp;lt;- rep(0, 6)&#xA;init$constraints\[\[2\]\]$max &amp;lt;- rep(1, 6)&#xA;eq_meanETL &amp;lt;- add.objective(portfolio=init, type=&quot;return&quot;, name=&quot;mean&quot;)&#xA;eq_meanETL &amp;lt;- add.objective(portfolio=eq_meanETL, type=&quot;risk&quot;, name=&quot;ETL&quot;,&#xA;                               arguments=list(p=0.95))&#xA;eq_meanETL &amp;lt;- add.objective(portfolio=eq_meanETL, type=&quot;risk_budget&quot;,&#xA;                               name=&quot;ETL&quot;, min_concentration=TRUE,&#xA;                               arguments=list(p=0.95))&#xA;opt_eq_meanETL &amp;lt;- optimize.portfolio(R=R, portfolio=eq_meanETL,&#xA;                                      optimize_method=&quot;DEoptim&quot;,&#xA;                                      search_size=2000,&#xA;                                      trace=TRUE, traceDE=5)][1]][1]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The risk contribution is given in the image. &#xA;&lt;a href=&quot;https://i.stack.imgur.com/uoIyD.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/uoIyD.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is why is there a difference in the % risk contribution for all the portfolios. isn't the ERC portfolio produces the same contribution for each of the assets in the portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="19037" LastEditorUserId="19037" LastEditDate="2017-04-12T06:55:47.367" LastActivityDate="2017-04-12T06:55:47.367" Title="Equal Risk Contribution in Portfolio Analytics r pkg" Tags="&lt;programming&gt;&lt;portfolio&gt;&lt;portfolio-optimization&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33638" PostTypeId="1" CreationDate="2017-04-12T07:45:20.937" Score="4" ViewCount="170" Body="&lt;p&gt;In the Carr and Madan (1999) methodology exploiting the fast Fourier transform, the quasi-analytical price of a call is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C(t,T,K)=e^{-r(T-t)}\frac{e^{-\alpha \log (K)}}{\pi}Re\left[\int_0^\infty e^{-iu \log(K)} \frac{\psi_t(u-i(1+\alpha))}{\alpha^2+\alpha-u^2+i(1+2\alpha)u}du\right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\psi_t(u)$ is the characteristic function of the log-price and $\alpha$ a control parameter for the integral.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It appears to me that pricing deeply ITM and OTM options is quite unstable using the numerical integral and I obtain often prices that are not possible. For example with a strike of approximately 0 I obtain call prices higher than the stock prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it a known problem? How can I avoid these numerical issues and get the right price? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is actually done in practice?&lt;/p&gt;&#xA;" OwnerUserId="26657" LastEditorUserId="26657" LastEditDate="2017-04-13T07:51:48.483" LastActivityDate="2017-04-13T07:51:48.483" Title="Heston ITM and OTM options pricing" Tags="&lt;option-pricing&gt;&lt;heston&gt;&lt;fourier-transform&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33639" PostTypeId="2" ParentId="33632" CreationDate="2017-04-12T08:05:29.130" Score="3" Body="&lt;p&gt;I'm definitely not an expert on this topic, but it seems to me that:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;$\hat{\pi}_t$ is here defined as &#xA;\begin{align} &#xA;\hat{\pi}_t &amp;amp;= \underset{\pi_t \in \Bbb{R}}{\text{argsup}} \left( \frac{dV(t,x)}{dx} x (r+ \pi_t(\mu-r)) + \frac{1}{2} \frac{d^2V(t,x)}{dx^2} x^2 \pi_t^2 \sigma^2\right) \\&#xA;&amp;amp;= \underset{\pi_t \in \Bbb{R}}{\text{argsup}}\, I(\pi_t) &#xA;\end{align}&#xA;and is hence obtained by applying the first-order optimality condition:&#xA;$$ \frac{d I }{d\pi_t}(\hat{\pi_t}) = 0 $$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The $\pi$ which appears in the definition of the optimal value function:&#xA;$$ V(t,x)=\underset{\pi \in A}{\sup}\{\mathbb{E}\left[U(X_T(\pi))\right] |X_t=x\} $$&#xA;is a full-blown stochastic process $(\pi_t)_{t \in [0,T]}$. On the other hand, $\pi_t$ which appears in the HJB equation is merely a scalar: it represents the value of the optimal control that applied over the infinitesimal interval $[t,t+dt)$ (hence, &quot;locally&quot;, $V(t,x)$ does not depend on it). This is better understood by adopting a dynamic programming view of the problem as mentioned in @Alex C's comment. The idea is then to postulate a candidate optimal control process $\hat{\pi}_t(x)$ by extending the result which has been obtained locally (cf. Bellman's principle of optimality).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2017-04-12T18:20:21.900" LastActivityDate="2017-04-12T18:20:21.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33640" PostTypeId="1" AcceptedAnswerId="33650" CreationDate="2017-04-12T10:02:09.653" Score="1" ViewCount="903" Body="&lt;p&gt;when comparing the Sharpe Ratio (SR) of two different funds, does it make a difference, whether I use  excess returs (returns - risk free rate) or returns (without dedcuting the risk free rate, assuming the risk free rate is always 0%) in the numerator? Since I am subtracting the same risk free rate from the returns of the two funds, the result (eg. Fund A has a higher SR than Fund B) should be the same, irrespective of calculating with excess returns or returns?!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;many thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="27429" LastActivityDate="2017-04-14T05:00:48.827" Title="Sharpe Ratio, risk free rate" Tags="&lt;sharpe-ratio&gt;&lt;performance-evaluation&gt;&lt;risk-free&gt;" AnswerCount="2" CommentCount="0" ClosedDate="2017-04-14T13:09:45.263" ContentLicense="CC BY-SA 3.0" />
  <row Id="33641" PostTypeId="2" ParentId="33626" CreationDate="2017-04-12T10:02:32.750" Score="3" Body="&lt;p&gt;If you are trying to value the FRN, plugging in the forward rates and then discounting is a method that works.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are trying (as you specifically say) to calculate the expected cash flows, then you have to specify which probability measure you are in.  In the forward measure for each cash flow, the forward rate is the expected value.  However in the money market measure, the expected floating cash flow for each date is slightly higher than the forward rate due to the convexity effect alluded to by @will &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-04-12T10:02:32.750" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="33642" PostTypeId="1" CreationDate="2017-04-12T10:07:25.100" Score="2" ViewCount="4183" Body="&lt;p&gt;I used the R-package PortfolioAnalytics for portfolio optimization. In the portfolio optimization part. I used the function optimize.portfolio to set up my optimization. However, here was the error just showed that &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Error in optimize.portfolio(R = initial_weights, portfolio = p, optimize_method = &quot;random&quot;,  : &#xA;    unused arguments (R = initial_weights, portfolio = p, optimize_method = &quot;random&quot;, rp = rp, trace = TRUE)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I checked my code and I made sure everything was fine beside this step.  So I am wondering this function is not working? Anybody knows how to fix this situation or recommend other package to use?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you so much.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Here is my code:&#xA;&#xA;    library(PortfolioAnalytics)&#xA;    library(quantmod)&#xA;    library(PerformanceAnalytics)&#xA;    library(zoo)&#xA;    library(plotly) &#xA;&#xA;    # Get data of the stock&#xA;&#xA;    getSymbols(c(&quot;SWX&quot;,&quot;SPY&quot;,&quot;ICUI&quot;,&quot;MSFT&quot;), src = 'yahoo', from = '2016-01-01')&#xA;&#xA;&#xA;    Adjusted_price &amp;lt;- merge.zoo(SWX[,6], SPY[,6], ICUI[,6], MSFT[,6])&#xA;&#xA;    #Get Returns of portfolio&#xA;    returns.portfolio &amp;lt;- CalculateReturns(Adjusted_price)&#xA;    returns.portfolio &amp;lt;- na.omit(returns.portfolio)&#xA;&#xA;    #Set names of each stocks&#xA;    colnames(returns.portfolio) &amp;lt;- c(&quot;Southwest Gas Holdings&quot;,&quot;S&amp;amp;P 500&quot;,&quot;ICU Medical&quot;,&quot;Microsoft&quot;)&#xA;&#xA;    # Meanreturns&#xA;&#xA;    meanReturns &amp;lt;- colMeans(returns.portfolio)&#xA;    covMat &amp;lt;- cov(returns.portfolio)&#xA;&#xA;    #Initial weights&#xA;    portfolio.spec(assets = c(&quot;SWX&quot;,&quot;SPY&quot;,&quot;ICUI&quot;,&quot;MSFT&quot;) )&#xA;    initial_weights &amp;lt;- c(&quot;SWX&quot; = 0.25,&quot;SPX&quot; = 0.25,&quot;ICUI&quot;=0.25,&quot;MSFT&quot;=0.25)&#xA;    port &amp;lt;- intial_weights&#xA;    portfolio.spec(assets = initial_weights)&#xA;&#xA;    #Initialize Portfolio specification&#xA;    p &amp;lt;- portfolio.spec(assets = initial_weights)&#xA;&#xA;    #Add constraint&#xA;    p &amp;lt;- add.constraint(portfolio = p, type = &quot;weight_sum&quot;, min_sum = 1, max_sum = 1)&#xA;&#xA;    #Add objective&#xA;    p &amp;lt;- add.objective(portfolio = p, type = &quot;risk&quot;, name = &quot;StdDev&quot;)&#xA;    p &amp;lt;- add.objective(portfolio = p, type = &quot;return&quot;, name = &quot;mean&quot;)&#xA;&#xA;    #optimization&#xA;    opt_single &amp;lt;- optimize.portfolio(R = initial_weights, portfolio = p, optimize_method = &quot;random&quot;, rp = rp, trace = TRUE)&#xA;&#xA;Error in optimize.portfolio(R = initial_weights, portfolio = p, optimize_method = &quot;random&quot;,  : &#xA;  unused arguments (R = initial_weights, portfolio = p, optimize_method = &quot;random&quot;, rp = rp, trace = TRUE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="27428" LastActivityDate="2017-04-26T01:43:10.743" Title="Why optimize.portfolio in R package PortfolioAnalytics is not working?" Tags="&lt;programming&gt;&lt;portfolio-optimization&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33643" PostTypeId="1" CreationDate="2017-04-12T10:08:05.983" Score="-2" ViewCount="2516" Body="&lt;p&gt;I am trying to construct a method in python that evaluates the value of an Arithmetic Asian Option using standard Monte Carlo simulation (without control variates). However, I am not getting the correct option values. &#xA;The code is adapted from MATLAB source provided here:&#xA;&lt;a href=&quot;http://personal.strath.ac.uk/d.j.higham/ch22.m&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://personal.strath.ac.uk/d.j.higham/ch22.m&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my implementation: (Key =&gt; S0 = stock value, K = strike price, v = volatility, r = risk-free interest rate, T = time to maturity, N = # of observations, M = # of paths in MonteCarlo simulation)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def arithmeticAsianCallValue (S0, K, v, r, T, N, M):&#xA;&#xA;    dt = T*1.0/N&#xA;    drift = exp((r-0.5*v*v)*dt)&#xA;&#xA;    Spath = numpy.empty(M, dtype=float)&#xA;    arithPayOff = numpy.empty(M, dtype=float)&#xA;&#xA;    scipy.random.seed([100])&#xA;&#xA;    for i in range(0,M,1):&#xA;        growthFactor = drift * exp(v*sqrt(dt)*scipy.random.randn(1))&#xA;        Spath[i] = S0 * growthFactor&#xA;        for j in range(i+1,N,1):&#xA;            growthFactor = drift * exp(v*sqrt(dt)*scipy.random.randn(1))&#xA;            Spath[j] = Spath[j-1] * growthFactor&#xA;&#xA;        arithMean = numpy.mean(Spath)&#xA;        arithPayOff[i] = exp(-r*T)* math.max(arithMean-K, 0)&#xA;&#xA;    # Standard Monte Carlo&#xA;    Pmean = numpy.mean(arithPayOff)&#xA;    Pstd = numpy.std(arithPayOff)&#xA;&#xA;    confmc = [Pmean-1.96*Pstd/sqrt(M), Pmean+1.96*Pstd/sqrt(M)]&#xA;&#xA;    return confmc&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="19401" LastEditorUserId="19401" LastEditDate="2017-04-12T11:09:39.773" LastActivityDate="2017-04-12T11:33:27.627" Title="Monte carlo simulation for arithmetic average price asian option" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;asian-option&gt;" AnswerCount="1" CommentCount="3" ClosedDate="2017-04-13T16:19:38.387" ContentLicense="CC BY-SA 3.0" />
  <row Id="33644" PostTypeId="1" CreationDate="2017-04-12T10:18:38.843" Score="3" ViewCount="531" Body="&lt;p&gt;For tenors &gt; 100 years (i.e. 150 years), my Black-Scholes model is telling me the price of a call option will be equal to its current stock price. Can anyone intuitively explain this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="13434" LastActivityDate="2017-04-12T10:54:51.870" Title="ultra-long tenor European call option valued using Black-Scholes" Tags="&lt;black-scholes&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33645" PostTypeId="2" ParentId="33643" CreationDate="2017-04-12T10:33:54.080" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;code&gt;numpy.max&lt;/code&gt; wouldn't work in this case. Try &lt;code&gt;Math.max&lt;/code&gt;. If you don't believe me, try this:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;print(numpy.max(-100, 0))&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;gives&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;-100&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;You're supposed to draw from random Gaussian, not uniform.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.rand.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://docs.scipy.org/doc/numpy/reference/generated/numpy.random.rand.html&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Create an array of the given shape and populate it with random samples from a &lt;strong&gt;uniform distribution&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Adivice for programming: you're not using the vectorized implementation offered by numpy. If you aren't, forget about it. Mixing looping code with numpy like in this case would just introduce unnecessary bugs.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;EDITED&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;Spath&lt;/code&gt; is a single dimensional numpy array for a single path. You should have initialized it with &lt;code&gt;N&lt;/code&gt; not &lt;code&gt;M&lt;/code&gt;. Making it &lt;code&gt;M&lt;/code&gt; means you'd average the uninitialised elements (0 by default in Python), and thus very low option value.&lt;/p&gt;&#xA;&lt;p&gt;@Bob_Jansen and other mods: I'm tempted to close the question off-topic. This is is clearly homework. The finance concepts is fine, it's the actual implementation (e.g. python loops) that's creating incorrect outputs. When I wrote my response, I thought the error was just like misunderstanding in Gaussian. We're here to answer about finance, not python looping.&lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2017-04-12T11:33:27.627" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="33646" PostTypeId="2" ParentId="33644" CreationDate="2017-04-12T10:47:15.467" Score="1" Body="&lt;p&gt;A European call price respectively admits $\max(0, P(0,T)(F(0,T)-K))$ and $P(0,T) F(0,T)$ for lower and upper bounds, where $P(0,T) = e^{-rT}$ is the price of the zero coupon bond expiring at $T$ and $F(0,T)$ the equity forward price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Only if $\lim_{T \to \infty} F(0,T) \gg K$ will you have the result you mention since in that case both bounds coincide to $P(0,T) F(0,T)$. If the stock does not pay dividends $P(0,T)F(0,T) = S_0$. &lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2017-04-12T10:47:15.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33647" PostTypeId="2" ParentId="33644" CreationDate="2017-04-12T10:54:51.870" Score="4" Body="&lt;p&gt;You can think in terms of the Black-Scholes stock price dynamics:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming a positive drift such as the conditions mentionned by LocalVolatility in its comment are satisfied, you can see that the underlying spot price will tend to infinity in an infinite amount of time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, the spot price will be sufficiently large ($S&amp;gt;&amp;gt;K$) to assume that your payoff $(S-K)^+$ is roughly equal to the underlying spot.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You then see that the only way to replicate this call is to buy the underlying, which has the same payoff as your call when the time to maturity goes to infinity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By no arbitrage, they must therefore have the same price: hence your call worthing the spot price $S$.   &lt;/p&gt;&#xA;" OwnerUserId="26595" LastActivityDate="2017-04-12T10:54:51.870" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33648" PostTypeId="2" ParentId="33638" CreationDate="2017-04-12T11:16:04.023" Score="4" Body="&lt;p&gt;There are a number of tricks. My favourite is to use the Black--Scholes price as a control. The integrals become much better behaved. You compute the difference of the Heston price from the BS price which is the same for calls and puts so there are no ITM vs OTM issues. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my paper with Chao Yang, we investigate the problem of what implied vol to use in the control. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Joshi, Mark S. and Yang, Chao, Fourier Transforms, Option Pricing and Controls (October 9, 2011). Available at SSRN: &lt;a href=&quot;https://ssrn.com/abstract=1941464&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://ssrn.com/abstract=1941464&lt;/a&gt; or &lt;a href=&quot;http://dx.doi.org/10.2139/ssrn.1941464&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://dx.doi.org/10.2139/ssrn.1941464&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also have extensive discussion in my book More Mathematical Finance.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2017-04-12T11:16:04.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33649" PostTypeId="2" ParentId="33623" CreationDate="2017-04-12T13:28:14.587" Score="3" Body="&lt;p&gt;As a mathematician I have preferred Karatzas and Shreve, &quot;Brownian Motion and Stochastic Calculus&quot; (ISBN 978-0387976556).   It has all the theorems and proofs, and is well-written.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Shreve noted the popularity of his book and later wrote the 2-volume set &quot;Stochastic Calculus for Finance&quot;.  The second volume may also be satisfactory to you, but I have not read it.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2017-04-12T13:28:14.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33650" PostTypeId="2" ParentId="33640" CreationDate="2017-04-12T13:53:23.307" Score="4" Body="&lt;p&gt;No, this is not the same. For example, consider the scenario&#xA;$$&#xA;\begin{align*}&#xA;r_A &amp;amp;= 10\% \quad\quad \sigma_A = 10\% \\&#xA;r_B &amp;amp;= 1.5\% \quad\quad \sigma_B = 1\% \\&#xA;\end{align*}&#xA;$$&#xA;If $r_f=1\%$,&#xA;$$&#xA;\text{SR}_A=0.90 \quad\quad \text{SR}_B=0.50&#xA;$$&#xA;then $A$ has the higher sharpe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if $r_f=0\%$,&#xA;$$&#xA;\text{SR}_A=1.00 \quad\quad \text{SR}_B=1.50&#xA;$$&#xA;then $B$ has the higher Sharpe.&lt;/p&gt;&#xA;" OwnerUserId="5617" LastActivityDate="2017-04-12T13:53:23.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33652" PostTypeId="1" AcceptedAnswerId="33654" CreationDate="2017-04-12T14:12:01.393" Score="2" ViewCount="555" Body="&lt;p&gt;Dear Stack Exchange community, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using Performance Analytics package, chart.Drawdown, I would like to plot several drawdowns curves on the same plot to be able to visually compare them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know how to plot one drawdown curve using:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;chart.Drawdown(R, geometric = TRUE, legend.loc = NULL, colorset = (1:12))&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Is it possible to plot several curves? Can someone help me on that? Best. Joe.&lt;/p&gt;&#xA;" OwnerUserId="27438" LastActivityDate="2017-04-12T16:02:25.897" Title="In R, Performance Analytics package, chart.Drawdown, plot several drawdowns curves on the same plot" Tags="&lt;performanceanalytics&gt;&lt;charts&gt;&lt;drawdown&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33653" PostTypeId="2" ParentId="32988" CreationDate="2017-04-12T14:34:06.497" Score="2" Body="&lt;p&gt;&lt;a href=&quot;https://www.fields.utoronto.ca/programs/scientific/09-10/finance/courses/hurdnotes2.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Merton model&lt;/a&gt; will be a bit more quantitiative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Z-Score is an option, as is &lt;a href=&quot;http://econwpa.repec.org/eps/fin/papers/0508/0508002.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Ohlson&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the end you are going to want some non-defaulted-&gt;defaulted transition mapping based on factors you identify as meaningful.&lt;/p&gt;&#xA;" OwnerUserId="5262" LastActivityDate="2017-04-12T14:34:06.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33654" PostTypeId="2" ParentId="33652" CreationDate="2017-04-12T15:44:04.927" Score="3" Body="&lt;p&gt;No problem, just have a look at the following example from the &lt;a href=&quot;https://cran.r-project.org/web/packages/PerformanceAnalytics/PerformanceAnalytics.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;documentation&lt;/a&gt; (p. 49):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;data(edhec)&#xA;chart.Drawdown(edhec[ , c(1, 2)], &#xA;     main = &quot;Drawdown from Peak Equity Attained&quot;, &#xA;     legend.loc = &quot;bottomleft&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.imgur.com/ZaCyHtw.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2017-04-12T16:02:25.897" LastActivityDate="2017-04-12T16:02:25.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33655" PostTypeId="2" ParentId="33623" CreationDate="2017-04-12T16:01:12.053" Score="2" Body="&lt;p&gt;I don't think there many books that proof the fundamental theorem of asset pricing as is quite technical and not very interesting for the usual audience studying quantitative finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, Ito formula is stochastic calculus subject, is a requisite for many mathematical finance books.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, I like these books for a more formal approach:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.springer.com/gp/book/9783540209669&quot; rel=&quot;nofollow noreferrer&quot;&gt;Musiela, Rutkoswki&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.springer.com/gp/book/9780387401003&quot; rel=&quot;nofollow noreferrer&quot;&gt;S.E. Shreve I&lt;/a&gt; for the binomial model&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.springer.com/gp/book/9780387401010&quot; rel=&quot;nofollow noreferrer&quot;&gt;S.E. Shreve II&lt;/a&gt; for continuous time pricing.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For a proof of the fundamental theorems of asset pricing see:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ac.els-cdn.com/0304414981900260/1-s2.0-0304414981900260-main.pdf?_tid=6b8f742e-1f96-11e7-8c4d-00000aab0f27&amp;amp;acdnat=1492011836_05a22d085b9fcd98b2ac56260ba6432e&quot; rel=&quot;nofollow noreferrer&quot;&gt;Harrison, Pliska 1980&lt;/a&gt; (Risk neutral probability measure implies no arbitrage)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://ac.els-cdn.com/0304414983900388/1-s2.0-0304414983900388-main.pdf?_tid=ab1f636a-1f96-11e7-8134-00000aab0f01&amp;amp;acdnat=1492011943_dfd12ef112ccbffa99d60208d858c964&quot; rel=&quot;nofollow noreferrer&quot;&gt;Harrison, Pliska 1981&lt;/a&gt; (Unique risk neutral measure if and only if market is complete).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1704" LastActivityDate="2017-04-12T16:01:12.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33656" PostTypeId="1" AcceptedAnswerId="33657" CreationDate="2017-04-12T19:44:15.860" Score="9" ViewCount="3300" Body="&lt;p&gt;Suppose I have portfolio with 10 assets, each one of them with a weight of 10% from the total portfolio (equally weighted).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's &lt;a href=&quot;https://www.youtube.com/watch?v=uQqUrPjwE-E&quot; rel=&quot;noreferrer&quot;&gt;well known&lt;/a&gt; how to measure from historical prices-&gt;returns a variance-co-variance matrix. And from here to have portfolio's Variance and STD (and later on this is useful for VaR calculation etc.) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However it's also useful to know the regular correlation (Pearson correlation coefficient) between each pair of assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The question is:&lt;/strong&gt; What is the correct measure to some kind of &quot;Total&quot; or &quot;Average&quot; correlation between &lt;strong&gt;all&lt;/strong&gt; the assets in a portfolio?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Naively because it's equally weighted portfolio I just took simple arithmetic average of all pairwise correlation coefficients...&lt;/p&gt;&#xA;" OwnerUserId="18094" LastActivityDate="2017-04-12T22:01:29.303" Title="What is the total correlation between assets in a portfolio?" Tags="&lt;portfolio-management&gt;&lt;statistics&gt;&lt;correlation&gt;&lt;statistical-finance&gt;&lt;covariance-matrix&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="33657" PostTypeId="2" ParentId="33656" CreationDate="2017-04-12T20:09:31.613" Score="11" Body="&lt;p&gt;This is indeed an interesting question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to &lt;a href=&quot;http://www.nematrian.com/MeasuringAverageStockCorrelation&quot; rel=&quot;noreferrer&quot;&gt;this website&lt;/a&gt;, a paper by Goldman Sachs [Tierens and Anadu (2004)] proposes three alternative methods for estimating average stock correlations:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Calculate a full correlation matrix, weighting its elements in line&#xA;with the weight of the corresponding stocks in the portfolio/index,&#xA;and excluding correlations between the stock and itself (i.e. the&#xA;diagonal elements of the correlation matrix)&lt;/li&gt;&#xA;&lt;li&gt;Proxy average&#xA;correlation using only individual stock volatilities and that of the&#xA;portfolio/index as a whole &lt;/li&gt;&#xA;&lt;li&gt;Refine 2. by reference to the ratio of index to average stock volatility&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You can find more details on the abovementioned website. Unfortunately I haven't found the original paper, but if somebody provides a link in the comments I will update the post.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So to answer your question about a &quot;correct&quot; method: As always there is no &quot;god-given&quot; way how to model statistical phenomena, there are always tradeoffs with certain characteristics which are helpful in some situations but less so in others. Some important characteristics and tradeoffs for the different methods can be found in section 3 (Comments) of the abovementioned website.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2017-04-12T20:15:20.070" LastActivityDate="2017-04-12T20:15:20.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33658" PostTypeId="1" AcceptedAnswerId="33662" CreationDate="2017-04-12T20:42:26.770" Score="3" ViewCount="657" Body="&lt;p&gt;In R, with Performance analytics package, I am trying to chart multiple cumulative asset returns from an XTS object. The thing is that I miss some data from some asset returns so that the graph given from:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;chart.CumReturns(XTS_DR_ALL[, c(1,2,5)], wealth.index = TRUE,&#xA;                   main = &quot;Monthly performance, re-based to 100, since inception&quot;, &#xA;                   legend.loc=&quot;topleft&quot;, )&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;...plots non-continuous curves, which are not easy to visualize... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/dZo7D.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/dZo7D.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I do something to plot continuous lines for the asset returns of which I miss data?&#xA;Best, Joe.&lt;/p&gt;&#xA;" OwnerUserId="27438" LastEditorUserId="12" LastEditDate="2017-04-13T08:45:46.227" LastActivityDate="2017-04-13T08:45:46.227" Title="R, Performance Analytics, How to chart continuous line with non continuous data?" Tags="&lt;performanceanalytics&gt;&lt;charts&gt;&lt;missing-values&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33659" PostTypeId="2" ParentId="33493" CreationDate="2017-04-12T21:16:17.913" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Can this be explained by an extraordinary demand for hedging spot&#xA;  positions via shorting futures?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The answer to your question is: kind of but there is more to it.  Out of curiosity I looked into this a bit after you added the company name.  The answer is similar to @will answer above but it was too much to add as an edit, hence, the separate answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This stock has went from PLN500/shr down to single digits.  Currently trading PLN~8.60.  Those numbers are adjusted for a 1:50 split in 2015.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When comparing the current price of a stock to it's future price, you need to adjust spot for dividends and cost of owning the stock (search for Fair Value if an explanation is needed).  Owners of this stock have not received a dividend since 2012 and are currently receiving a rebate (not being charged interest) for owning shares--i.e. Short sellers are so sure this stock is going to zero that they are willing to pay an astronomical amount for someone else to buy, hold and loan them shares.  That premium for the owner (cost for the short seller) is the difference between spot and future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is an instance where market participants are literally saying &quot;I wouldn't buy that stock if you paid me to!&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Though the curve has shifted a bit since your original post, the backwardation is existing because no one has any faith in this company remaining a going concern (at the moment).  Oftentimes a backwardated curve can lead to an arbitrage opportunity, however, not in this case.  The arb is executed by shorting spot and buying future.  For an arb to exist, the current price minus the borrowing cost for a short seller must be greater than the future price--it is not.  There is no arb--just a poorly managed company that no one has any faith in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyone interested in the -ve rate being paid to share holders can use this formula (assume the future price = fair value price) and solve for r.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cmegroup.com/trading/equity-index/fairvalue.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.cmegroup.com/trading/equity-index/fairvalue.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26556" LastEditorUserId="26556" LastEditDate="2017-04-12T21:36:47.640" LastActivityDate="2017-04-12T21:36:47.640" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33660" PostTypeId="2" ParentId="33656" CreationDate="2017-04-12T22:01:29.303" Score="8" Body="&lt;p&gt;I just want to add to vonjd's &lt;a href=&quot;https://quant.stackexchange.com/a/33657/5617&quot;&gt;answer&lt;/a&gt; some info on the comparison of the 3 methods. This is too big for a comment so I'm posting as a separate answer but please upvote his answer, not mine.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h1&gt;Do the differences in methodologies matter in practice?&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;To gauge the practical importance of the biases in methods 2 and 3, we calculate the weighted stock correlation for the stocks in the S&amp;amp;P 500 index during the period January 2002 through March 2004.  For each month in our sample, we use the daily total returns of each of the S&amp;amp;P 500 constituents to calculate the pair-wise correlations needed in method 1, and the single stock volatilities needed in methods 2 and 3.  In addition, we calculate the volatility of the S&amp;amp;P 500 index based on its daily total returns during the month, and we use the start-of-month index weights to obtain the weighted average stock correlation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/a2ruG.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/a2ruG.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Exhibit 2A shows the resulting weighted average cross-stock correlations for each of the 27 months in the sample based on each of the three calculation methods. &lt;strong&gt;The choice of method has a modest impact on the average correlation number for a well-diversified portfolio or index such as the S&amp;amp;P 500.&lt;/strong&gt; Exhibit 2B makes this point even clearer by plotting the differences between the correlations numbers obtained from each of the methods. The absolute difference in correlation fell below 0.05 during the past 2+ years.  Exhibit 2B also visualizes the &lt;strong&gt;consistent upward bias in method 3&lt;/strong&gt; as compared to method 2, but the overestimation is less than 0.01 in absolute value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/dzqXa.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/dzqXa.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Exhibits 3A and 3B analyze the difference between methods 1 and 2 further, by looking at some crude measures associated with the volatility bias in method 2 identified above. They suggest that &lt;strong&gt;larger differences tend to happen more often in periods when average stock volatility is higher or when stock volatility has changed by a larger amount.&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="5617" LastEditorUserId="-1" LastEditDate="2017-04-13T12:46:22.823" LastActivityDate="2017-04-12T22:01:29.303" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="33661" PostTypeId="1" AcceptedAnswerId="33667" CreationDate="2017-04-12T23:05:41.187" Score="2" ViewCount="207" Body="&lt;p&gt;I'm computing downside market capture ratio in R.  The &lt;em&gt;PerformanceAnalytics&lt;/em&gt; R package has a built-in &lt;em&gt;UpDownRatios&lt;/em&gt; function which does this, but it computes the ratio using &lt;strong&gt;sums of returns, not products&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the ratio is the &quot;compound return when the benchmark&#xA;was down divided by the benchmark's compound return when the benchmark was down&quot;, shouldn't that be product?&lt;/p&gt;&#xA;" OwnerUserId="27210" LastActivityDate="2017-04-14T13:43:44.763" Title="Downside Market Capture Ratio: compute with sum or product?" Tags="&lt;performanceanalytics&gt;&lt;ratio&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33662" PostTypeId="2" ParentId="33658" CreationDate="2017-04-13T08:13:22.237" Score="3" Body="&lt;p&gt;I think your question draws on a larger issue: How to compare the performance of financial time series with missing data? The situation is indeed quite common that you have missing values for certain products (for a number of reasons) so you need a general strategy for that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A few observations:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The chart is as it is for a reason: There are missing returns in the series and just pretending as if there weren't any isn't going to help. So the chart is correct and it is also best practice not to provide some argument like &lt;code&gt;impute = TRUE&lt;/code&gt; to make up some interpolated returns. If you wanted to do that you should do it in the underlying data, not the charting function.&lt;/li&gt;&#xA;&lt;li&gt;If your goal is to compare the performance of two products one way to go is omitting the missing values... but be careful: Don't omit the returns, omit the prices! Why? Because if you lose some prices the returns in between will still be correct, not so for losing returns!&lt;/li&gt;&#xA;&lt;li&gt;So what you want to do is first merge the two price series to get the dates where you have complete data (in database lingo a &quot;full outer join&quot;) and after that convert them into returns.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In R you can e.g. do the following:&lt;br&gt;&#xA;&lt;code&gt;ROC(merge(Prices_1, Prices_2, all = FALSE))&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to use more sophisticated methods (with all the caveats) there is an R package especially for imputation of missing values in times series data (but I haven't tried it yet):&lt;br&gt;&#xA;&lt;a href=&quot;https://CRAN.R-project.org/package=imputeTS&quot; rel=&quot;nofollow noreferrer&quot;&gt;imputeTS: Time Series Missing Value Imputation&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find an introductory vignette here:&lt;br&gt;&#xA;&lt;a href=&quot;https://cran.r-project.org/web/packages/imputeTS/vignettes/Introduction.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;imputeTS: Time Series Missing Value Imputation in R&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2017-04-13T08:41:15.837" LastActivityDate="2017-04-13T08:41:15.837" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="33663" PostTypeId="2" ParentId="33623" CreationDate="2017-04-13T08:50:19.210" Score="2" Body="&lt;p&gt;Regarding the proof of the Fundamental Theorems of Asset Pricing (FTAP), as explained by @FKaria not many books present exhaustively and rigorously the proof as it is quite long and technical while not that useful in practice. However, you might want to look at the paper that shows the result is the most general framework: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;a href=&quot;https://www.researchgate.net/profile/Walter_Schachermayer/publication/225903732_A_General_Version_of_the_Fundamental_Theorem_of_Asset_Pricing_1994/links/09e4150d1e7e94fc2f000000/A-General-Version-of-the-Fundamental-Theorem-of-Asset-Pricing-1994.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Delbaen, Freddy; Schachermayer, Walter (1994). &quot;A General Version of the Fundamental Theorem of Asset Pricing&quot;. &lt;em&gt;Mathematische Annalen&lt;/em&gt;. 300 (1): 463–520.&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-04-13T17:55:48.927" LastActivityDate="2017-04-13T17:55:48.927" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33664" PostTypeId="2" ParentId="33642" CreationDate="2017-04-13T16:14:44.237" Score="3" Body="&lt;p&gt;There are some issues with your code - you are using wrong variables as inputs/ in case you are not sure what the function arguments mean, search online for a documentation of the PortfolioPerformance functionality!&#xA;Let me try to make some things clear on how to solve your optimization issue: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your data input is fine! &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(PortfolioAnalytics)&#xA;library(quantmod)&#xA;library(PerformanceAnalytics)&#xA;library(zoo)&#xA;&#xA;# Get data of the stock&#xA;&#xA;getSymbols(c(&quot;SWX&quot;,&quot;SPY&quot;,&quot;ICUI&quot;,&quot;MSFT&quot;), src = 'yahoo', from = '2016-01-01')&#xA;Adjusted_price &amp;lt;- merge.zoo(SWX[,6], SPY[,6], ICUI[,6], MSFT[,6])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You don't need to set any initial weights, at least not for your purpose of a static optimization without reflecting any transaction costs! The optimal portfolio in your setting is independent of the initial weights. Your initial portfolio specifications are also redundant in the code. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;p &amp;lt;- portfolio.spec(assets = colnames(returns.portfolio))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, whenever you refer to the variable &lt;code&gt;p&lt;/code&gt; you can change your portfolio specifications. You have correctly specified your objective function, however, I made the experience that referring to standard deviation sometimes leads to to trouble. In case you are into Markowitz Optimization you care for the Variance of the portfolio weights anyway, so I have changed this: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;p &amp;lt;- add.objective(portfolio = p, type = &quot;risk&quot;, name = &quot;var&quot;)&#xA;p &amp;lt;- add.constraint(portfolio = p, type = &quot;full_investment&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;full_investment&lt;/code&gt; part is equivalent to setting a constraint on the sum of the portfolio weights such that they always sum-up to 1. &#xA;In your setup the investor currently only cares about the risk of the portfolio. Your optimization therefore returns the portfolio weights which attain the lowest possible portfolio variance. This is the global minimum variance portfolio. If you would like to get the efficient portfolio then you need to add an additional constraint, namely the minimal expected return. Just in case you need this, add the following line &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;p &amp;lt;- add.constraint(portfolio=p, type = &quot;return&quot;,     return_target=0.1/250)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;return_target=0.1/250&lt;/code&gt; can be replaced with any number, I have chosen it to reflect that you have daily data and in this case you would like to have a portfolio which makes 10 per cent per year in expectation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Last but not least, the optimization part: Here you mixed up the inputs. The input &lt;code&gt;R&lt;/code&gt; should be the time-series of returns you have. I also recommend to specify the way, R is optimizing the function. Your specification &lt;code&gt;rp=rp&lt;/code&gt; does not make sense as R does not know what you mean with &lt;code&gt;rp&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#Optimize&#xA;optimize.portfolio(R=returns.portfolio, portfolio = p, &#xA;          optimize_method = &quot;ROI&quot;, trace = TRUE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It may be the case that you have to install the package &lt;code&gt;ROI&lt;/code&gt; in order to run this code. What I get as output is the following: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;***********************************&#xA;PortfolioAnalytics Optimization&#xA;***********************************&#xA;&#xA;Call:&#xA;optimize.portfolio(R = returns.portfolio, portfolio = portf1, &#xA;optimize_method = &quot;ROI&quot;, trace = TRUE)&#xA;&#xA;Optimal Weights:&#xA; SWX.Adjusted  SPY.Adjusted ICUI.Adjusted MSFT.Adjusted &#xA;      -0.1077        1.3764       -0.0635       -0.2052 &#xA;&#xA;Objective Measure:&#xA;  StdDev &#xA;0.008082 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="16249" LastActivityDate="2017-04-13T16:14:44.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33667" PostTypeId="2" ParentId="33661" CreationDate="2017-04-14T03:33:21.150" Score="2" Body="&lt;p&gt;I am not familiar with that R package, but I've written a few performance tracking libraries in my past life, so I might be able to add some insight.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While it is indeed true that logarithmic returns may be added and subtracted, all non-quant investors and hedge funds present their performances in percent returns. The reason one can't simply add and subtract percent returns is because the denominators changes instantaneously.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a Numeraire, $\mathbb{N}_t$ representing one's bank account, the wealth process may evolves as such:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{\mathbb{N}_{t}}{\mathbb{N}_{t-1}} = (1 + m_{t-1}) =e^{ \mu_{t-1}} \approx e^{m_{t-1} - \frac{\sigma^2}{2}} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where: $m_t$ is the geometric rate of return; $\mu$ is logarithmic rate of return; and, $\sigma^2$ is the variance of $\mathbb{E}[\mu]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're programming is taking the sum of percent returns, then clearly it will result in the following inequality:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$(\sum_{t}^{T} m_t) +1 \ne \frac{\mathbb{N}_{T}}{\mathbb{N}_{t}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are correct, however, about the following equality:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\prod_{t}^{T}( 1 + m_t)  = \frac{\mathbb{N}_{T}}{\mathbb{N}_{t}} = e^{\Sigma_t^T \mu_t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If changing something about the source code is too onerous, there are two options which will get you the same result:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Option A: convert the percent return to natural logs through the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mu_t = ln(1+m_t) \, , \forall t \in T $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And then convert them back to percents in the final step:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$m_t = e^{\mu_t} -1 \, , \forall t \in T $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Option B: take the ratios of the compounded periodic returns as such&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{\prod_{t}^{T}( 1 + m_t)}{\prod_{0}^{t-1}( 1 + m_t)}$&lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2017-04-14T05:33:28.737" LastActivityDate="2017-04-14T05:33:28.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33668" PostTypeId="2" ParentId="33640" CreationDate="2017-04-14T04:54:31.220" Score="0" Body="&lt;p&gt;A motivating idea for the Sharpe Ratio is that the measure is invariant to leverage. Let's say we lever up $\alpha$ on the excess return $r^A - r^f$ to have the excess return $r^x = \alpha \left(r^A - r^f \right) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Trivially, the Sharpe Ratio is unchanged:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;\mathit{SR} &amp;amp;= \frac{\operatorname{E}[\alpha \left( r^A - r^f \right) ]}{\operatorname{Stdev}\left( \alpha \left( r^A - r^f \right) \right) } = \frac{\operatorname{E}[ r^A - r^f  ]}{\operatorname{Stdev}\left( r^A - r^f \right)  }&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand if you you have returns rather than excess returns, this doesn't work. Let return $r = (1 + \alpha) r^A - \alpha r^f$. Observe the measure would not be invariant to leverage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ ?? = \frac{\operatorname{E}[ (1 + \alpha) r^A - \alpha r^f]}{\operatorname{Stdev}\left( (1 + \alpha) r^A - \alpha r^f]\right)} \neq \frac{\operatorname{E}[ r^A ]}{\operatorname{Stdev}\left( r^A \right)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An excess return (or zero cost portfolio return) is the return on a portfolio that is equally long and short. The difference between two returns is an excess return.&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-04-14T05:00:48.827" LastActivityDate="2017-04-14T05:00:48.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33669" PostTypeId="2" ParentId="33621" CreationDate="2017-04-14T05:24:39.550" Score="0" Body="&lt;p&gt;I'm going to have a try at this one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The levered weighted average cost of capital, $\mathbb{r}_c$, is defined:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb{r}_c = \frac{D+R+I(1-r_T)}{E+B} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where financing costs are equal to dividends $D$, retained earnings $R$, and interest $I$; and:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C$ is capital equal to equity, $E$, plus debt, $B$;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E$ = 'common stock' + 'paid in capital' + 'accumulated earnings'; and,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_T$ is the tax shield.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In typical implementations of WACC, we rearrange as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_c(E+B) = \frac{E}{E+B}(D+R) + \frac{B}{E+B}(I(1-r_T))  $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equating: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{D+R}{E} := r_e$; and,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{I(1-r_T)}{B} := r_b$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;allows us to solve by combination of terms for the cost of equity in familiar form: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_e \approx \frac{E+B}{E}(r_c - r_b ) + r_b$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which therefore implies that a CAPM-free equity beta can be set to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\beta_e = \frac{E+B}{E}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the risk-free rate, it is common to use a short-term treasury note. If the cost of capital is undefined, we can make it whatever we want it to be. If you believe the long-run return of the market is 7%, then that it was it is. Believe it or, no discount rate which approximates opportunity cost is the wrong one.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2017-05-04T03:53:40.943" LastActivityDate="2017-05-04T03:53:40.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33671" PostTypeId="2" ParentId="10669" CreationDate="2017-04-14T07:56:37.343" Score="2" Body="&lt;p&gt;I would like to bring this topic back to life as I believe it calls for some further explanation and disambiguation of definitions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;VaR - Value at Risk&lt;/strong&gt; - is a statistical technique which, given some parameters (horizon, confidence interval, look-back period) and estimation methodology, attempts to forecast the worst possible loss of my portfolio (with a given confidence) at any given horizon. So, for example having a portfolio on which I calculate a 99% 1-day VaR and found it to be 100k, the results could be interpreted as following, &lt;em&gt;at any given one day, with 99% certainty, my portfolio is not expected to loose more than 100k.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typically, how this is done is, by decomposing all assets of the portfolio into relevant risk factors (factors relevant for its valuation) and simulating their behavior, re-value the entire portfolio. Such factors can be swap curves, FX rates, credit spreads, equity prices, equity indices, implied volatily etc. This approach as it is evident, concerns market risk factors and how they on a day-to-day affect the performance of the portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Credit VaR&lt;/strong&gt; - this statistical technique (various implementations and methodologies) provides a measure of the portfolio's risk given changes in the value of debt caused by counterparty default or deterioration of that counterparty's credit worthiness. Furthermore, intra-portfolio asset correlation is an important aspect here (a lot of discussion can be made around this topic and various methodologies have been developed). As it is evident, this type of technique most closely concerns &lt;em&gt;debt portfolio&lt;/em&gt; with &lt;em&gt;longer horizons&lt;/em&gt;.&lt;/p&gt;&#xA;" OwnerUserId="13462" LastActivityDate="2017-04-14T07:56:37.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33674" PostTypeId="1" CreationDate="2017-04-14T11:04:54.010" Score="2" ViewCount="1303" Body="&lt;p&gt;How to normalise daily trading volume and trading value as features for RNN model of stock time series? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The immediate answer could be: taking the global min/max, mean/std for each stock across the whole time series window, normalise the daily volume/value of the corresponding stock, stock by stock. However, during each stock cycle, the trading volume/value range in the particular cycle could vary drastically compared to other cycles, in all these “local” window of a given stock, does it make sense to find dynamic local min/max, mean/std for local normalisation? Or, does it make sense to calculate derivatives of volume/value, 1st and 2nd orders to capture and velocity and acceleration of the market capital flow?&lt;/p&gt;&#xA;" OwnerUserId="27466" LastActivityDate="2017-05-14T12:35:54.497" Title="Normalise daily trading volume/value" Tags="&lt;algorithmic-trading&gt;&lt;volume&gt;&lt;normalization&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33675" PostTypeId="1" AcceptedAnswerId="33703" CreationDate="2017-04-14T11:12:58.680" Score="2" ViewCount="1160" Body="&lt;p&gt;A model for FX, presented in &lt;em&gt;Interest Rate Models&lt;/em&gt;, Brigo and Mercurio (2006), has the following dynamics:&#xA;\begin{align}&#xA;dr_t^d&amp;amp;= \lambda_d(\theta_d(t)-r_t^d)dt+\eta_d dW_t^d\\&#xA;dr_t^f&amp;amp;= [\lambda_d(\theta_d(t)-r_t^d)-\eta_f\rho_{S,f}\sigma]dt+\eta_f dW_t^f\\&#xA;\frac{dS_t}{S_t}&amp;amp; =(r_t^d-r_t^f)dt +\sigma dW_t^S&#xA;\end{align}&#xA;where $S_t$ is the spot exchange rate, the brownian motions are defined under the domestic measure and $\rho_{S,f}$ is the instantaneous correlation of $W_t^S$ and $W_t^f$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The covered interest parity is given by the no arbitrage argument, hence the forward exchange rate is $F_t(T)=S_t\frac{P_t^f(t,T)}{P_t^d(t,T)}$ with  $P_t(t,T)$ the prices of the ZCBs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the uncovered interest parity also respected by the model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E_t[S_T]=?F_t(T)$$&lt;/p&gt;&#xA;" OwnerUserId="26657" LastEditorUserId="26657" LastEditDate="2017-04-18T08:03:49.430" LastActivityDate="2019-08-04T16:54:14.757" Title="FX Hull-White model" Tags="&lt;fx&gt;&lt;hullwhite&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33676" PostTypeId="2" ParentId="33674" CreationDate="2017-04-14T12:08:33.660" Score="3" Body="&lt;p&gt;You must not use &quot;tomorrow&quot;'s data to normalize &quot;today&quot;'s one. So it is not a good idea to use global min/max, mean/std ... across the whole time series window.  The same true is for &quot;cycles&quot; - you can't use data from the end of the cycle to normalize data in the beginning of the cycle. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, at every time point of your time series you may do any kind of normalization if you are using data which were &lt;strong&gt;known before that point&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It does make sense to use derivatives. The operations is usually called &lt;em&gt;differencing&lt;/em&gt; in time series literature and is used to transform non-stationary series into a stationary one, for example. See, for example &lt;a href=&quot;http://eu.wiley.com/WileyCDA/WileyTitle/productCd-EHEP002380.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; p.76 &quot;Differencing&quot;   &lt;/p&gt;&#xA;" OwnerUserId="15154" LastActivityDate="2017-04-14T12:08:33.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33677" PostTypeId="1" CreationDate="2017-04-14T12:19:07.590" Score="1" ViewCount="282" Body="&lt;p&gt;I am doing a master thesis on Variance Swap and my dear friend told me I could find some valuable help on the &quot;Quantitative Finance Stack Exchange&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to apologise beforehand, if my questions is out of order with the chart of this &quot;forum&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At first, I wanted to implement a dispersion trading strategy using Variance Swap.The problem is I can't have access to options data. Therefore, I was thinking of plotting an E-GARCH Model and buy or not  a variance swap depending on my forecast.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I heard that Variance Swap rates are available for major equity index on Bloomberg. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you think this is pertinent ? Or is there strategies with variance swap that are easier to implement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for your time,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Audrey&lt;/p&gt;&#xA;" OwnerUserId="27467" LastActivityDate="2017-04-14T12:19:07.590" Title="Quantitative Strategy on Variance Swap (master thesis)" Tags="&lt;quant-trading-strategies&gt;&lt;swaps&gt;&lt;variance&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33679" PostTypeId="2" ParentId="33661" CreationDate="2017-04-14T13:22:12.203" Score="2" Body="&lt;p&gt;David Addison's discussion of log versus simple(arithmetic) returns in his answer is correct, but this particular calculation has nothing to do with arithmetic versus log returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Up Capture is defined by Bacon(2004), p. 47 as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Up Capture = \frac{\bar{r+}}{\bar{b+}} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(mean of the asset returns over mean of the benchmark return)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So simple versus log returns makes no difference in this calculation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code is implemented using &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{sum(UpRa)}{sum(UpRb)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is what is causing the confusion.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The ratio of sums and the ratio of means is the same.  So the calculation in the code is correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sum is a more efficient vectorized calculation than mean. mean involves an additional division by the total number of observations.  This is why the calculation is implemented the way it is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way to think about why the calculations are equivalent is that both means would have the same denominator.  So you could consider the ratio of sums as having factored out the common denominators (the number of observations).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ref: Bacon, Carl. &lt;em&gt;Practical Portfolio Performance Measurement and&#xA;     Attribution, Second Edition&lt;/em&gt;. Wiley. 2004. p. 47&lt;/p&gt;&#xA;" OwnerUserId="454" LastEditorUserId="454" LastEditDate="2017-04-14T13:43:44.763" LastActivityDate="2017-04-14T13:43:44.763" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="33680" PostTypeId="2" ParentId="33028" CreationDate="2017-04-14T14:33:24.860" Score="4" Body="&lt;p&gt;It's simpler to just think of the yield to maturity as the internal rate of return of the bond given the current price. It's like the discount rate you would apply to the final payout and coupons, such that the result is the market price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A short paper by &lt;a href=&quot;http://www.economics-finance.org/jefe/econ/ForbesHatemPaulpaper.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Forbes, Hatem, and Paul&lt;/a&gt; explains that yield to maturity ignores reinvestment. Strictly speaking, yield to maturity is an internal rate of return, not the return you would get at the horizon. The return you get at the horizon depends on the reinvestment policy. The return at the horizon only matches the yield to maturity if the coupons are invested at the same yield as the yield to maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, assume a \$1000 bond with \$50 annual payments and 2 years until maturity and a 10% yield to maturity. The current price is \$913.22. The sum of the return and the coupons is \$1100. Ignoring reinvestment, the return at the end of two years is 20% cumulatively (1100 / 913.22 - 1) or 9.75% annualized. However, if the \$50 from year 1 is re-invested at a 10% rate, then the investor would now have $1105, generating a 21% return cumulatively (1105 / 913.22 - 1) or 10% annualized.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long story short, the yield to maturity is a bond's internal rate of return given its current price. It is only the return you would earn if you held the bond to maturity if you reinvest at that same rate. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastEditorUserId="2379" LastEditDate="2017-04-14T22:08:49.347" LastActivityDate="2017-04-14T22:08:49.347" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33681" PostTypeId="1" CreationDate="2017-04-14T15:45:22.187" Score="2" ViewCount="2868" Body="&lt;p&gt;Consider the stochastic vol:&#xA;$$dS = \mu Sdt + \sigma SdW_1$$&#xA;$$d\sigma = p(\sigma,S,t)dt + q(\sigma,S,t)dW_2$$&#xA;$$dW_1dW_2 = \rho dt$$&#xA;We want to obtain the price of option $V(\sigma,S,t),$ we use the underlying asset $S$ and another option $V_1(\sigma,S,t)$ to build the &lt;code&gt;hedging portfolio&lt;/code&gt;:&#xA;$$\Pi = V -\Delta S - \Delta_1 V_1$$&#xA;then make&#xA;$$d \Pi = r\Pi dt$$&#xA;eliminate the &lt;code&gt;risk terms&lt;/code&gt; we have&#xA;$$\dfrac{\partial V}{\partial t} + \dfrac{1}{2}\sigma^2S^2\dfrac{\partial^2 V}{\partial S^2} + \rho\sigma Sq\dfrac{\partial^2 V}{\partial S\partial \sigma} + \dfrac{1}{2}\sigma^2q^2\dfrac{\partial^2 V}{\partial \sigma^2} + rS\dfrac{\partial V}{\partial S} -rV = -(p-\lambda q)\dfrac{\partial V}{\partial \sigma}.$$&#xA;Here $\lambda$ is called &lt;code&gt;market price of risk&lt;/code&gt;, since we can understand $\lambda$ as&#xA;$$d V -rV dt = q\dfrac{\partial V}{\partial S}(\lambda d t + d W_2) = q\Delta(\lambda d t + d W_2)$$&#xA;this is the &lt;code&gt;unit of extra return&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And we have another way to price $V,$ the &lt;code&gt;discounted value&lt;/code&gt; of $V$ is &lt;code&gt;martingale&lt;/code&gt;, namely $dt$ term of $d(e^{-rt} V)$ is zero, then we find that, the PDE of $V$ is exactly&#xA;$$\lambda = 0$$&#xA;in above PDE. So does that mean, the discounted value of $V$ is martingale is equivalent to the market price of risk is zero?&lt;/p&gt;&#xA;" OwnerUserId="26165" LastEditorUserId="26165" LastEditDate="2017-04-20T01:13:49.473" LastActivityDate="2017-04-20T01:13:49.473" Title="How to understand the market price of risk" Tags="&lt;derivatives&gt;&lt;stochastic-volatility&gt;&lt;differential-equations&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33683" PostTypeId="1" CreationDate="2017-04-14T17:54:33.943" Score="2" ViewCount="437" Body="&lt;p&gt;I'm currently looking into calculating the &quot;option to switch use&quot; to determine the benefit of the ability to switch between two technologies at any point in time (american option). This is also called an &quot;exchange option&quot; for financial options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Trigeorgis calculates the value of flexibility in his book (p173) as:&#xA;$F(A \rightarrow B) = S_0(A \rightarrow B) + S_1(A \rightarrow B) + S_2(A \rightarrow B)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $S_t$ is the value of the option at each point in time when switching from technology A to technology B.&#xA;The value of the option is therefore calculated as the sum(!) of the options values from each point in time backwards to $t=0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately there is no explanation there why this is treated different than any other calculation of a binomial lattice I found. In any other case I found there is just one backwards pass calculated to find the value at the root node. This final value is then treated as the value of the option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Question: Why is Trigeorgis calculating the option value differently than everyone else?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any insights would be greatly appreciated!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;regards,&#xA;Bernhard&lt;/p&gt;&#xA;" OwnerUserId="27472" LastEditorUserId="27472" LastEditDate="2017-04-14T18:40:54.593" LastActivityDate="2017-10-12T04:00:27.823" Title="Real Options: Calculating the &quot;option to switch use&quot; using binomial lattices" Tags="&lt;options&gt;&lt;american-options&gt;&lt;binomial-tree&gt;&lt;binomial&gt;&lt;real-options&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33684" PostTypeId="2" ParentId="33422" CreationDate="2017-04-14T21:06:35.377" Score="1" Body="&lt;p&gt;You may contact the people at lobsterdata.com. They reconstruct the limit order books from NASDAQ ITCH-Totalview data, which includes all Level III messages passing through NASDAQ electronic trading platform (in general, from 2:00 am -- 8:00 pm). Good luck!   &lt;/p&gt;&#xA;" OwnerUserId="27478" LastActivityDate="2017-04-14T21:06:35.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33685" PostTypeId="2" ParentId="16489" CreationDate="2017-04-14T21:44:53.347" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;It happens at the same exchange and you are using the exchange time stamps, so it is unlikely due to the time jitter problem. &lt;/li&gt;&#xA;&lt;li&gt;According to my knowledge, if your data is from US or EMEA developed equity markets, by-passing the best price in the limit order book is not allowed. &lt;/li&gt;&#xA;&lt;li&gt;Anti-internalization is in general for internal-crossing or dark pool in the sell side. I haven't seen it in the external exchange level. So that is not likely to be the reason either.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;My suggestions: &#xA; 1. review your data carefully, see if some messages are missing.&#xA; 2. review your codes carefully, because the Level III data is irregular and typically in binary format. It's very easy to miss (or miss-translate) some messages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a short reference on how to construct order books from NASDAQ ITCH-Totalview Level III data, &lt;a href=&quot;https://lobsterdata.com/info/HowDoesItWork.php&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://lobsterdata.com/info/HowDoesItWork.php&lt;/a&gt;, and the corresponding working paper at &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1977207&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1977207&lt;/a&gt;.    &lt;/p&gt;&#xA;" OwnerUserId="27478" LastActivityDate="2017-04-14T21:44:53.347" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33686" PostTypeId="1" CreationDate="2017-04-14T21:59:30.973" Score="1" ViewCount="59" Body="&lt;p&gt;I am new to stochastic control and I need your help! Suppose that we are a trader and we are trading based two sources of signal. One comes from the stock's flow of dividends as well as another trader's demand. Assume that the dividend flow moves as $$ dD_t = \mu_D dt + \sigma_D dZ^1_t $$ where $Z^i_t$ denotes a standard Wiener process. Also suppose that the other trader trades randomly and demands on the interval $[t,t+dt)$ the amount $dY_t$. Indeed $Y_t$ denotes the cumulative purchased shares the other trader holds. Also assume that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dY_t = \mu_Z dt + \sigma_Z dZ^2_t $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For me it is both intuitive and technically robust to assume that we can trade as a function of the other trader's demand. I mean if we trade like $dX_t = -dY_t$ then we are spanning the filtration made by the other trader's movements. That is to say, my demand has an increment with $dZ^2_t$ in it. Am I able to do a trade based on the &quot;flow&quot; variable $D_t$ as well? What is the intuition? What technical assumption makes it possible? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example if I trade just the opposite direction of the other trader and just the magnitude of dividends paid then my trade at $[t,t+dt)$ will be $$D_t dt-dY_t$$. But can I reach a trading policy which has the form $$KdZ_t^1$$?&lt;/p&gt;&#xA;" OwnerUserId="27067" LastActivityDate="2017-04-14T21:59:30.973" Title="Flow Variable and Stock Variable" Tags="&lt;stochastic-calculus&gt;&lt;quant-trading-strategies&gt;&lt;stochastic-control&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33687" PostTypeId="2" ParentId="26100" CreationDate="2017-04-15T01:02:36.130" Score="1" Body="&lt;p&gt;in my book Introduction to Mathematical Portfolio Theory, we give two different derivations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most books give at least one, eg Luenberger, Pennacchi&lt;/p&gt;&#xA;" OwnerUserId="1809" LastEditorUserId="16160" LastEditDate="2017-04-15T02:17:52.553" LastActivityDate="2017-04-15T02:17:52.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33688" PostTypeId="2" ParentId="33683" CreationDate="2017-04-15T01:10:43.653" Score="1" Body="&lt;p&gt;hmm, Trigeorgis seems to be saying that the value of being able to switch at one of the times 1,2 and 3 is the same as the sum of being able to switch at each of the times.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems wrong to me since if you switch at time 1, the value of the ability to switch at time 2 becomes worthless. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Valuing an exchange option on a binomial tree is pretty easy -- all you do is a build up a tree of underlying values and discount back one step at a time, and the value at each node is the maximum of the discounted continuation value and the exercise value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the process for the ratio is nice, it is generally much easier to work with that than the two individual ones.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2017-04-15T01:10:43.653" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33689" PostTypeId="1" CreationDate="2017-04-15T03:43:39.027" Score="1" ViewCount="112" Body="&lt;p&gt;I'm trying to backtest some strategies which include 3-5 years single name EM corporate bonds. Some of them don't even have a meaningful historical data. Some others are pretty illiquid. Other than these, my portfolio contains ETFs, equities, FX, and Commodities - pretty much multi asset class portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For risk management purposes I separated these bonds and looking at them from a different angle. But leaving them out in portfolio optimization will be a bad idea as these bonds account for 20-30% of the overall portfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess my question is is it possible to somehow model EM single name corporate bonds? Has anybody come across a similar problem/project? Any resources that you can recommend?&lt;/p&gt;&#xA;" OwnerUserId="19096" LastEditorUserId="19096" LastEditDate="2017-04-19T23:39:32.023" LastActivityDate="2017-04-19T23:39:32.023" Title="Portfolio optimization: how to take care of single name corporate bonds?" Tags="&lt;portfolio-optimization&gt;&lt;bond-portfolio&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33690" PostTypeId="2" ParentId="33028" CreationDate="2017-04-15T05:57:05.183" Score="-1" Body="&lt;p&gt;I think for not too large yield movements , you would earn the ytm by holding for bond duration (rather than till maturity) and reinvesting coupons in bond&lt;/p&gt;&#xA;" OwnerUserId="17348" LastActivityDate="2017-04-15T05:57:05.183" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33692" PostTypeId="2" ParentId="33028" CreationDate="2017-04-15T14:50:02.063" Score="0" Body="&lt;p&gt;Just to add two things:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;in fixed income world bonds are typically quoted by YTM instead of prices but if we go back to prices, then an analogous question would be: what conditions need to hold so that an investor who bought a bond at price X will realize the rate of return (YTM) of Y%?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I see YTM only in terms of a measure that allows me to compare similar bonds - the realized rate of return is a different thing&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;also: YTM assumes a flat yield curve so this is quite far from reality&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="27334" LastActivityDate="2017-04-15T14:50:02.063" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33693" PostTypeId="2" ParentId="32968" CreationDate="2017-04-15T15:45:23.773" Score="2" Body="&lt;p&gt;At a general level it is helpful to delineate market (price) risk and counterparty credit risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And in terms of market risk, the FX forward protects you against unfavourable currency rate move at the delivery date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Counteparty credit risk exists over the life of the contract whenever forward value is positive to your side. And, yes, the higher the currency rate volatilty, the higher the counteparty credit risk should be. If you proceeded to calculate credit risk profile you, then volatility would enter into a simulation model of the currency rate and higher parameter values would result in wider forward value distribution.&#xA;Intuitively, probability that the contract will be extremely positive to your side is higher when the volatility is higher. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In reality things are more complicated when there is collaterisation scheme (as mentioned already), but you asked about a general relationship without further assumptions.&lt;/p&gt;&#xA;" OwnerUserId="27334" LastActivityDate="2017-04-15T15:45:23.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33694" PostTypeId="1" CreationDate="2017-04-15T17:04:52.593" Score="1" ViewCount="1343" Body="&lt;p&gt;I am trying to use Monte Carlo simulation to price arithmetic basket option consisting of two stocks. There seems to be something wrong in my implementation. According to the inputs &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;S1=100, S2=100, K=100, v1=30%, v2=30%, r=5%, T=3, M=100000, type=call&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the value should be &lt;code&gt;24.345&lt;/code&gt;. But for me it's coming out to be &lt;code&gt;21.913&lt;/code&gt;. Here is my implementation:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dt = T&#xA;drift1 = exp((r-0.5*v1*v1)*dt)&#xA;drift2 = exp((r-0.5*v2*v2)*dt)&#xA;&#xA;S1next = 0.0&#xA;S2next = 0.0&#xA;arithPayOff = numpy.empty(M, dtype=float)&#xA;&#xA;scipy.random.seed([100])&#xA;&#xA;for i in range(0,M,1):&#xA;    growthFactor1 = drift1 * exp(v1*sqrt(dt)*scipy.random.randn(1))&#xA;    S1next = S1 * growthFactor1&#xA;    growthFactor2 = drift2 * exp(v2*sqrt(dt)*scipy.random.randn(1))&#xA;    S2next = S2 * growthFactor2&#xA;&#xA;    # Arithmetic mean&#xA;    arithMean = 0.5 * (S1next+S2next)&#xA;    arithPayOff[i] = exp(-r*T) * max(callOrPut*(arithMean-K), 0)&#xA;&#xA;# Standard monte carlo&#xA;Pmean = numpy.mean(arithPayOff)&#xA;Pstd = numpy.std(arithPayOff)&#xA;&#xA;confmc = [Pmean - 1.96*Pstd/sqrt(M), Pmean + 1.96*Pstd/sqrt(M)]&#xA;return numpy.mean(confmc)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="19401" LastActivityDate="2017-04-17T19:49:43.490" Title="Basket Option pricing of two stocks" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;basket&gt;" AnswerCount="1" CommentCount="9" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33695" PostTypeId="1" AcceptedAnswerId="33699" CreationDate="2017-04-15T17:21:12.650" Score="0" ViewCount="1043" Body="&lt;p&gt;I am trying to estimate delta using the pathwise derivative method (Broadie and Glasserman (1996)) and I stuck on this part:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/8veXG.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/8veXG.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the other notation defined:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/zGpu1.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/zGpu1.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is my C++ code I have written so far:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;void Pathwise_Derivative(double S0, double K, double r, double sigma, double T, int M, int N){&#xA;    double dt = T/N;&#xA;    double S[N+1];&#xA;    for(int i = 0; i &amp;lt; M; i++){&#xA;        S[0] = S0;&#xA;        for(int j = 0; j &amp;lt; N; j++){&#xA;            double Z = gaussian_box_muller();&#xA;            S[j+1] = S[j]*exp( (r - (sigma*sigma)/(2))*dt + sigma*sqrt(dt)*Z);&#xA;        }&#xA;    }&#xA;&#xA;    // Estimating Delta&#xA;    int I[N+1];&#xA;    I[0] = 0;&#xA;    for(int i = 1; i &amp;lt;= N; i++){&#xA;        if(S[i] &amp;gt; K){&#xA;            I[i] = 1;&#xA;        }else{&#xA;            I[i] = 0;&#xA;        }&#xA;    }&#xA;    double delta = 0.0;&#xA;    for(int i = 1; i &amp;lt;= N; i++){&#xA;        delta += exp(-r*T)*(S[i]/S0)*I[i];&#xA;    }&#xA;&#xA;&#xA;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I just do not understand the formula for estimating delta and translating it into C++ code, any suggestions are greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="16160" LastEditDate="2017-04-15T20:25:52.820" LastActivityDate="2017-04-16T02:22:35.663" Title="Pathwise Derivative To Estimate Delta" Tags="&lt;options&gt;&lt;programming&gt;&lt;monte-carlo&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33696" PostTypeId="1" CreationDate="2017-04-15T17:58:15.390" Score="2" ViewCount="333" Body="&lt;p&gt;Which of the following options is the most valuable?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;American vanilla call&lt;/li&gt;&#xA;&lt;li&gt;European vanilla call&lt;/li&gt;&#xA;&lt;li&gt;Bermudan call&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;No further assumptions given - that was an interview question and I ordered them followingly: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;European call &amp;lt; American call &amp;lt; Bermudan call &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;as the last one has the most optionalities embedded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Was this the correct answer/reasoning? What do you think?&lt;/p&gt;&#xA;" OwnerUserId="27334" LastActivityDate="2018-03-29T11:53:33.640" Title="Which of the three options is the most valuable?" Tags="&lt;options&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33697" PostTypeId="2" ParentId="33696" CreationDate="2017-04-15T18:11:21.587" Score="13" Body="&lt;p&gt;The greater the optionality, the greater the price. Hence, in your case:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;a European call &quot;gives&quot; you optionality on a single day;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;a Bermudan call &quot;gives&quot; you optionality on a series of days between the beginning of the contract and its maturity;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;an American call &quot;gives&quot; you optionality on all days between the beginning of the contract and its maturity.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Hence your answer is &lt;strong&gt;not&lt;/strong&gt; correct $-$ thank you @Olaf:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \textrm{American} \geq \textrm{Bermudan} \geq \textrm{European}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;PS&lt;/strong&gt;: Why do you think a Bermudean option has more optionality than an American one?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;PS2&lt;/strong&gt;: as precised by @LocalVolatility, the additional optionality might be worthless, hence the inequalities are not strict.&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="24222" LastEditDate="2018-03-29T11:53:33.640" LastActivityDate="2018-03-29T11:53:33.640" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="33698" PostTypeId="2" ParentId="18549" CreationDate="2017-04-15T21:13:11.217" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;The yield of the bond depends on the discount to par at which it was issued, its maturity date, coupon rate, payment frequency, and daycount conventions. Yield computations do not require you to know the risk-free rate.&lt;/li&gt;&#xA;&lt;li&gt;You can compute yield using the YIELD function in excel with the correct inputs.&lt;/li&gt;&#xA;&lt;li&gt;What kind of spread are you referring to, ZSpread? This would require you to shock the risk-free spot curve until you price the bond to its current market price.&lt;/li&gt;&#xA;&lt;li&gt;High coupons are justified by high credit risk of the issuer. A high coupon/yield generally means that the issuer has a high risk of default. Investors must be compensated for this risk with a higher return on their investment.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You can find more details on yield interpretation and computation and this pretty good guide:&#xA;&lt;a href=&quot;https://quantcoyote.com/2017/03/14/bond-yield-explained/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://quantcoyote.com/2017/03/14/bond-yield-explained/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="27486" LastActivityDate="2017-04-15T21:13:11.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33699" PostTypeId="2" ParentId="33695" CreationDate="2017-04-16T02:22:35.663" Score="1" Body="&lt;p&gt;Caution: this code has not been tested.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;totDelta = 0.0&#xA;for(int i = 0; i &amp;lt; M; i++){&#xA;        double Z = gaussian_box_muller();&#xA;        ST = S0*exp( (r - (sigma*sigma)/(2.0))*T + sigma*sqrt(T)*Z);&#xA;        if(ST &amp;gt; K){&#xA;            I = 1;&#xA;        }else{&#xA;            I = 0;&#xA;        }&#xA;    Delta = exp(-r*T)*(ST/S0)*I;&#xA;    totDelta += Delta       &#xA;    }&#xA;&#xA;    return(totDelta/M); /* Average Delta over M MonteCarlo trials */&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-04-16T02:22:35.663" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="33702" PostTypeId="1" AcceptedAnswerId="33709" CreationDate="2017-04-16T12:14:06.090" Score="0" ViewCount="91" Body="&lt;p&gt;Background: I am trying to replicate some results from the Betting Against Beta paper by Frazzini &amp;amp; Pedersen (FP). (&lt;a href=&quot;http://www.econ.yale.edu/~af227/pdf/Betting%20Against%20Beta%20-%20Frazzini%20and%20Pedersen.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.econ.yale.edu/~af227/pdf/Betting%20Against%20Beta%20-%20Frazzini%20and%20Pedersen.pdf&lt;/a&gt;) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, I am trying to recreate the results for the Danish equity market, which has the local currency DKK.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In section 3 of the paper, FP state: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;All returns are in US dollars, and excess returns are above the US&#xA;  Treasury bill rate.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This follows a paragraph about the international equities analysis, so I assume it specifically applies to international equities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Betas are calculated against the MSCI Denmark index, which, like the stocks I am analysing, is listed in DKK.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is two-fold:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Does the statement from the paper imply that I need to convert all daily returns for every stock and the index to USD?&lt;/li&gt;&#xA;&lt;li&gt;If so, do I then need to get the USD/DKK exchange rate for every day (data point) I have stock/index returns for, multiply this by the individual daily stock prices, and then calculate returns anew?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Cheers!&lt;/p&gt;&#xA;" OwnerUserId="27493" LastEditorUserId="16160" LastEditDate="2017-04-16T17:25:36.683" LastActivityDate="2017-04-16T22:16:55.457" Title="Converting international equity returns to USD" Tags="&lt;equities&gt;&lt;returns&gt;&lt;beta&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33703" PostTypeId="2" ParentId="33675" CreationDate="2017-04-16T13:33:43.143" Score="3" Body="&lt;p&gt;Let $K$ be the forward exchange rate determined at time $t$ for maturity $T$. Then the payoff at time $T$ is given by $S_T-K$, which has zero value at time $t$. Let $Q$ and $Q^f$ be the respective domestic and foreign risk-neutral measures, and $E^Q$ and $E^{Q^f}$ be the corresponding expectation operators. Moreover, let $B^d_T = e^{\int_0^t r^d_sds}$ and $B^f_T = e^{\int_0^t r^f_sds}$ be the respective  domestic and foreign money market account values at time $t$. Then, &#xA;\begin{align*}&#xA;B^d_tE^Q\left(\frac{S_T-K}{B^d_T} \mid \mathcal{F}_t\right) = 0.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;K = \frac{B^d_tE^Q\left(\frac{S_T}{B^d_T} \mid \mathcal{F}_t\right)}{E^Q\left(\frac{B^d_t}{B^d_T} \mid \mathcal{F}_t\right)}= \frac{B^d_tE^Q\left(\frac{S_T}{B^d_T} \mid \mathcal{F}_t\right)}{P^d(t, T)}. \tag{1}&#xA;\end{align*}&#xA;Let $Q^T$ be the domestic $T$-forward measure and $E^{Q^T}$ be the corresponding expectation operator. Then&#xA;\begin{align*}&#xA;\frac{dQ}{dQ^T}\big|_{[t, T]} = \frac{B^d_T}{B^d_tP^d(t, T)}.&#xA;\end{align*}&#xA;From $(1)$,&#xA;\begin{align*}&#xA;K &amp;amp;= \frac{B^d_t E^Q\left(\frac{S_T}{B^d_T} \mid \mathcal{F}_t\right)}{P^d(t, T)}\\&#xA;&amp;amp;=E^{Q^T}(S_T \mid \mathcal{F}_t).&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;E^{Q^T}(S_T \mid \mathcal{F}_t) = F_t(T).&#xA;\end{align*}&#xA;On the other hand, we note that&#xA;\begin{align*}&#xA;\frac{dQ}{dQ^f}\big|_{[t, T]} = \frac{B^d_TB^f_t S_t}{B^f_T B^d_tS_T}.&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;E^Q\left(\frac{S_T}{B^d_T} \mid \mathcal{F}_t\right) &amp;amp;= E^{Q^f}\left(\frac{B^d_TB^f_t S_t}{B^f_T B^d_tS_T}\frac{S_T}{B^d_T} \mid \mathcal{F}_t\right)\\&#xA;&amp;amp;=\frac{S_t}{B^d_t}E^{Q^f}\left(\frac{B^f_t}{B^f_T} \mid \mathcal{F}_t\right)\\&#xA;&amp;amp;=\frac{S_t}{B^d_t}P^f(t, T).&#xA;\end{align*}&#xA;Moreover, from $(1)$,&#xA;\begin{align*}&#xA;K &amp;amp;= \frac{B^d_t E^Q\left(\frac{S_T}{B^d_T} \mid \mathcal{F}_t\right)}{P^d(t, T)}\\&#xA;&amp;amp;=S_t \frac{P^f(t, T)}{P^d(t, T)}.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;E^{Q^T}(S_T \mid \mathcal{F}_t) = F_t(T) = S_t \frac{P^f(t, T)}{P^d(t, T)}.\tag{2}&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, we note that, with stochastic interest rates, generally,&#xA;\begin{align*}&#xA;E^{Q}(S_T \mid \mathcal{F}_t) \ne F_t(T).&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$$$&#xA;As OP has already pointed out, Fromula $(2)$ can also be shown by no arbitrage argument. Specifically, at time $t$, while entering a forward contract with forward exchange rate $F_t(T)$, we borrow one unit domestic currency (which can be used to buy $\frac{1}{P^d(t, T)}$ units domestic zero-coupon bond with maturity $T$), convert into $\frac{1}{S_t}$ units foreign currency, and buy $\frac{1}{S_t P^f(t, T)}$ units foreign zero-coupon bond with maturity $T$. The net value of this trading strategy is zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At maturity $T$, in domestic currency, the above trading strategy has value $$F_t(T)\frac{1}{S_tP^f(t, T)}-\frac{1}{P^d(t, T)},$$ which should also have zero value. That is,&#xA;\begin{align*}&#xA;F_t(T) &amp;amp;=S_t \frac{P^f(t, T)}{P^d(t, T)}.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-04-17T01:52:58.460" LastActivityDate="2017-04-17T01:52:58.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33705" PostTypeId="1" CreationDate="2017-04-16T15:09:06.153" Score="-2" ViewCount="61" Body="&lt;p&gt;Reading Bjork's Arbitrage Theory in Continuous Time, he keeps using the word &quot;hedging&quot; and &quot;hedging portfolio&quot; when he's talking about replicating a derivative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why? Is this other definition of the word &quot;hedging&quot; commonly used?&lt;/p&gt;&#xA;" OwnerUserId="27496" LastEditorUserId="20454" LastEditDate="2017-04-16T17:44:08.600" LastActivityDate="2017-04-16T17:44:08.600" Title="Why does Bjork use the term &quot;hedging&quot; to denote a replicating portfolio?" Tags="&lt;terminology&gt;" AnswerCount="1" CommentCount="2" ClosedDate="2017-04-21T09:46:05.047" ContentLicense="CC BY-SA 3.0" />
  <row Id="33706" PostTypeId="2" ParentId="33705" CreationDate="2017-04-16T15:56:48.180" Score="3" Body="&lt;p&gt;Generally, &quot;hedging&quot; is the term most commonly used in practice $-$ &lt;em&gt;i.e.&lt;/em&gt; at trading desks, etc. $-$ for &quot;replication&quot; (of a derivative), while &quot;replication&quot; is more commonly used in academic papers. A third term, used less often than the previous two, is &quot;synthesizing&quot; (my impression is that &quot;synthesizing&quot; is normally used when a &lt;em&gt;traded&lt;/em&gt;, &lt;em&gt;simple&lt;/em&gt; derivative is replicated with other products, e.g. througth put-call parity you can synthesize a vanilla European call with a European put, a share and a zero-coupon bond).&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-04-16T16:01:49.133" LastActivityDate="2017-04-16T16:01:49.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33707" PostTypeId="1" CreationDate="2017-04-16T16:14:25.050" Score="1" ViewCount="61" Body="&lt;p&gt;Quick question on cross currency swaps. On expiry, principal payments are exchanged again. What happens when on expiry, the exchange rate is not the same as when the swap was first entered into?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The principal amount exchanged at the end is still the same as the initial principal amount exchanged? or must I recalculate the amount based on the updated exchange rate?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sorry for this basic question!&lt;/p&gt;&#xA;" OwnerUserId="27497" LastActivityDate="2017-04-16T16:14:25.050" Title="cross currency swap expiry principal amount" Tags="&lt;swaps&gt;&lt;currency&gt;&lt;exchange&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="33709" PostTypeId="2" ParentId="33702" CreationDate="2017-04-16T22:16:55.457" Score="2" Body="&lt;p&gt;If your purpose is to reproduce the result in the paper, then yes, all returns should be converted into USD terms, using the proper exchange rate. To simplify things, you could build your indices in local currency terms, and only convert the final index into USD terms. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I believe AQR publishes these datasets already, which can be downloaded &lt;a href=&quot;https://www.aqr.com/library/data-sets&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;. Note that AQR's excess returns are already in USD terms and over US T-bills (exactly what you need).&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2017-04-16T22:16:55.457" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33711" PostTypeId="1" AcceptedAnswerId="33730" CreationDate="2017-04-17T09:35:52.180" Score="3" ViewCount="177" Body="&lt;p&gt;I am trying to find out the Pricing Equation for certain type of Options under Risk-Neutral pricing. This is the equation I am getting, but I am not sure if this can be solved or not. Any help is appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V = E[I\{S(T_0) \geq B\}N(d_2)]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$t_0 &amp;lt; T_0 &amp;lt; T_1$     This is a time line&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$I\{S(T_0) \geq B\} =&#xA;\begin{cases}&#xA;1, &amp;amp; \text{if } S(T_0) \geq B \\&#xA;0, &amp;amp; \text{otherwise}&#xA;\end{cases}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $S(t_0), S(T_0)$ is the stock price at different times.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$N(d_2)$ is the Black Scholes $N(d_2)$ but Stock Price used in $N(d_2)$ is $S(T_0)$, and time period is $T_1-T_0$. So $N(d_2)$ in itself is a Random Variable in this case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to find the Expectation at &lt;strong&gt;time $= t_0$&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ d_2 = [ln(S(T_0)/K)+(r-0.5vol^2)(T_1-T_0)] / (vol* sqrt (T_1-T_0)) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ S(T_0) = S(t_0) exp((r-0.5vol^2)(T_0-t_0) + vol * sqrt(T_0-t_0)Z)    $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Z~N(0,1)&lt;/p&gt;&#xA;" OwnerUserId="26457" LastEditorUserId="26457" LastEditDate="2017-04-17T12:04:10.950" LastActivityDate="2017-04-18T15:41:26.420" Title="Expectation of N(d2)?" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;probability&gt;" AnswerCount="1" CommentCount="15" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33714" PostTypeId="1" CreationDate="2017-04-17T14:30:46.943" Score="0" ViewCount="194" Body="&lt;p&gt;Where I can find 1 minute historical market data for Japan, Australia and India stocks markets?&lt;/p&gt;&#xA;" OwnerUserId="27509" LastEditorUserId="16148" LastEditDate="2017-04-17T14:40:07.697" LastActivityDate="2021-01-31T16:07:35.770" Title="1 minute data: Japan, Australia and India stocks" Tags="&lt;market-data&gt;&lt;historical-data&gt;&lt;quote&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33715" PostTypeId="2" ParentId="33552" CreationDate="2017-04-17T14:39:47.337" Score="3" Body="&lt;p&gt;Because these are ATM Swaps, strike rates should be equal to the Swap rates which can be computed off the forward curves&lt;/p&gt;&#xA;" OwnerUserId="27510" LastActivityDate="2017-04-17T14:39:47.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33716" PostTypeId="1" CreationDate="2017-04-17T15:52:55.523" Score="1" ViewCount="129" Body="&lt;p&gt;I'm working on volatility forecasting models for equities and currencies. I am using daily data and am interested in producing forecasts for the next &lt;code&gt;n&lt;/code&gt; days. To evaluate model error I am looking at two metrics, &lt;code&gt;mean absolute percentage error&lt;/code&gt; and &lt;code&gt;directional accuracy&lt;/code&gt;. What are the state of the art benchmarks for these two metrics?&lt;/p&gt;&#xA;" OwnerUserId="17004" LastActivityDate="2017-04-17T15:52:55.523" Title="What are the current gold standards for volatility prediction error?" Tags="&lt;volatility&gt;&lt;garch&gt;&lt;forecasting&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33717" PostTypeId="2" ParentId="33694" CreationDate="2017-04-17T18:48:59.410" Score="3" Body="&lt;p&gt;The problem in your code is that the correlation is completely ignored. I would replace the loop by the following piece of code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for i in range(0,M,1):&#xA;    Rand1 = scipy.random.randn(1)&#xA;    Rand2 = scipy.random.randn(1)&#xA;    growthFactor1 = drift1 * exp(v1 * sqrt(dt) * Rand1)&#xA;    S1next = S1 * growthFactor1&#xA;    growthFactor2 = drift2 * exp(v2 * sqrt(dt) * (0.5 * Rand1 + sqrt(0.75) * Rand2))&#xA;    S2next = S2 * growthFactor2&#xA;&#xA;    # Arithmetic mean&#xA;    arithMean = 0.5 * (S1next+S2next)&#xA;    arithPayOff[i] = exp(-r * T) * max(callOrPut * (arithMean - K), 0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Basically, two correlated standard normal random variables $X_1$ and $X_2$ with correlation $\rho$ can be expressed as&#xA;\begin{align*}&#xA;X_1 &amp;amp;= \xi,\\&#xA;X_2 &amp;amp;= \rho\, \xi + \sqrt{1-\rho^2}\, \eta,&#xA;\end{align*}&#xA;where $\xi$ and $\eta$ are two independent standard normal random variables.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-04-17T19:49:43.490" LastActivityDate="2017-04-17T19:49:43.490" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="33718" PostTypeId="1" AcceptedAnswerId="33723" CreationDate="2017-04-17T20:07:07.273" Score="1" ViewCount="1218" Body="&lt;p&gt;For a research project, I need to find or calculate dividend yield for all the index of major countries in the world (e.g: s&amp;amp;p500,DAX,CAC40 and so on), and I am struggling a bit with it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I cannot find the raw data anywhere (apart for s&amp;amp;p500), so I was thinking to try to calculate it as a difference between absolute return and total return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do anyone has a suggestion or documentation on how to do it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="24422" LastActivityDate="2020-04-06T06:30:45.593" Title="Calculation of dividend yield from index returns" Tags="&lt;time-series&gt;&lt;market-data&gt;&lt;returns&gt;&lt;dividends&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33721" PostTypeId="1" CreationDate="2017-04-17T22:37:00.730" Score="1" ViewCount="210" Body="&lt;p&gt;I fitted a CRRA utility function to daily S&amp;amp;P 500 returns in R. (As for instance in &lt;a href=&quot;http://www.efmaefm.org/0EFMAMEETINGS/EFMA%20ANNUAL%20MEETINGS/2011-Braga/papers/0344.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Optimal Option Portfolio Strategies&lt;/a&gt;, page 10)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;expostutility = function(x,y) { mean( (1/(1-y)) * ((1+x)^(1-y)) ) }&#xA;test = na.omit(diff(log(getSymbols('SPY', from='2010-01-01', auto.assign = F)[,4])))&#xA;expostutility(test, 5); expostutility(test, 20)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For 5: -0.249841 For 20: -0.05321077&#xA;Why is the stock market utility higher for higher risk aversion? (Using (correctly) simple returns instead of log does not change the fact.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;test1=rnorm(1000, mean=0.01, sd=0.01)&#xA;test2=rnorm(1000, mean=0.01, sd=0.05)&#xA;expostutility(test1, 2)&#xA;expostutility(test2, 2)&#xA;expostutility(test1, 10)&#xA;expostutility(test2, 10)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here the second series has less utility than the first; the ordering is always correct. But there is much higher overall utility with &lt;em&gt;higher&lt;/em&gt; gamma (i.e., risk aversion). (?) Maybe EU can not be interpreted as such as has to be converted to certainty equivalents?&lt;/p&gt;&#xA;" OwnerUserId="26438" LastEditorUserId="26438" LastEditDate="2017-04-19T10:55:17.997" LastActivityDate="2017-04-19T10:55:17.997" Title="CRRA utility application" Tags="&lt;programming&gt;&lt;risk&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="33722" PostTypeId="2" ParentId="21382" CreationDate="2017-04-18T01:17:27.917" Score="1" Body="&lt;p&gt;This is actually a deceptively good question because, as we all know, estimates of variance are extremely sensitive to sampling frequency, sampling intervals, and lags. This is because not all stock prices perfectly adhere to Brownian Motion (i.e., the variance doesn't adhere strongly to the root time rule). It is also not entirely clear from the paper how exactly intraday volatilty is being measured. Therefore, real-world interpretations and implementations could vary significantly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking your excerpt and comparing to the following expert, from page 12, suggests that Almgren intends intraday volatilty to mean one which is sampled from intraday data across 15-minute intervals: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Ten-day average intraday volume profile (upper) and volatilty profile&#xA;  (lower), on 15-minute intervals.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I infer this to mean that &quot;intraday volatility&quot; for the puprose of this paper means something which resembles the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;${P_t} = $ average logarithmic price sampled over each $t$ minute interval&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mu_{(P,t)} = $ average logarithmic price of each $t$ minute interval sampled from $t$ to $T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}[\sigma^2_{intraday}] \approx \frac{ \sum_{t=0}^{15*24*60} \big( ({P_{15t}}-{P_{15t-15}}) -({\mu_{P,15t }-\mu_{P,15t -15}}) \big)^2}{T}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This verbose implementation is supported by Almgren's footnotes on high frequency volatility estimation: &lt;a href=&quot;http://cims.nyu.edu/~almgren/timeseries/notes7.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://cims.nyu.edu/~almgren/timeseries/notes7.pdf&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Almgren also references simplified implementations using the Garman-Klass (GK) and Yhang-Zhang (YZ) estimators.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, I implement the Almgren impact model using the YZ OHLC estimator. For one, it has been shown to be more efficient than GK. In addition, it's a great example of the Pareto 80/20 rule: YZ gets about 80% of the benefit of intraday data but it requires roughly 20% of the effort (i.e., 5x less work) to implement -- plus OHLC data is low-low-cost.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A precis on the YZ estimator is found here: &lt;a href=&quot;https://quant.stackexchange.com/questions/27741/understanding-yang-zhang-volatility-estimator&quot;&gt;Understanding Yang-Zhang Volatility Estimator&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2017-04-18T01:29:59.993" LastActivityDate="2017-04-18T01:29:59.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33723" PostTypeId="2" ParentId="33718" CreationDate="2017-04-18T07:40:10.683" Score="2" Body="&lt;p&gt;S&amp;amp;P indices usually use an adjusted float weighted methodology, in which a change in the index level is defined -- in the base case -- by a &lt;em&gt;Laspeyres&lt;/em&gt; index:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{I + \Delta I}{I} = \frac{\sum_i P_{i,1}*Q_{i,0}}{\sum P_{i,0}*Q_{i,0}} \,; \forall i \in I$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where: $I$ is the index level;&#xA;$P_i$ is the price of asset $i$; and,&#xA;$Q_i$ is the float adjusted share count of asset $i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please reference this following S&amp;amp;P document for a more robust definition: &lt;a href=&quot;http://us.spindices.com/documents/methodologies/methodology-index-math.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://us.spindices.com/documents/methodologies/methodology-index-math.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Total Returns Indices are further defined as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{I_{TR,t}}{I_{TR,t-1}} = \frac{I_{t-1} + \Delta I_t + \sum_{i,t} (D_{i,t}*Q_{i,t})}{I_{TR,t-1}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where: $I_{TR} $ is the total return index level; and, $D_{i,t}$ is the dividend for asset $i$ on dividend ex-date $t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$I_{TR,t}- I_t = \sum_0^t \sum_i (D_{i,t}*Q_{i,t}) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And your intuition about taking the difference between the price and total return versions of the index should be absolutely right on. To calculate the &lt;em&gt;annual&lt;/em&gt; yield then should be simple:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$yield = \frac{(I_{TR,t} - I_{TR,t-365})-(I_{t} - I_{t-365})}{I_{TR,t}} \approx \frac{I_{TR,t}}{I_{TR,t-365}} - \frac{I_{t}}{I_{t-365}} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where now $t$ represents calendar days.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While I realize that indexing methodologies can be very complicated and can vary, I suspect that the above formula for yield will &lt;em&gt;yield&lt;/em&gt; a result which is both accurate and robust. &lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2017-04-18T17:34:28.460" LastActivityDate="2017-04-18T17:34:28.460" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33725" PostTypeId="2" ParentId="22877" CreationDate="2017-04-18T13:05:12.170" Score="0" Body="&lt;p&gt;Let $[X,Y]_t$ be the quadratic covariation of two processes $X$ and $Y$ at time $t$. The actual precise meaning of $dXdY$ is $$dXdY= d[X,Y]_t$$ For example, the quadratic covariation of a Brownian motion $B_t$ with itself is $t$, so $$dB_t dB_t = d[B_t,B_t]_t=dt$$.&lt;/p&gt;&#xA;" OwnerUserId="22377" LastActivityDate="2017-04-18T13:05:12.170" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33726" PostTypeId="1" CreationDate="2017-04-18T13:48:53.790" Score="1" ViewCount="292" Body="&lt;p&gt;I was reading &quot;Paul Wilmott introduces quantitative finance&quot;. In chapter 10 page 227 he states that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you buy an at-the-money straddle close to expiry the profit you expect to make from this strategy is approx. &#xA;$$\sqrt{2(T-t)/\pi}(\sigma - \sigma_{\text{implied}})S$$&#xA;and its standard deviation of the profit (the risk) is approx. &#xA;$$\sqrt{1-(2/\pi)}\sigma S\sqrt{T-t},$$&#xA;where $\sigma$ is the actual volatility, $\sigma_{\text{implied}}$ is the BSM implied volatility, $t$ is current time and $T$ is the maturity time.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can't figure out how to derive these results. Any help would be greatly appreciated. &lt;/p&gt;&#xA;" OwnerUserId="27525" LastActivityDate="2017-04-18T13:48:53.790" Title="Expected profit from straddle and its standard deviation" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;implied-volatility&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33728" PostTypeId="1" CreationDate="2017-04-18T14:18:06.190" Score="3" ViewCount="101" Body="&lt;p&gt;I'm working on a model of electricity prices. I have empirical data $X(t)$ and managed to find a reasonable fit given by a Levy process $\hat{X}(t)$. I understand in theory what a risk-neutral probability $\mathbb{Q}$ is, but I struggle to implement it in practice.&lt;br&gt;&#xA;For example, one of the requirements for my model is to that the process is a Levy process with mean zero under the real-world probability measure $\mathbb{P}$. Does it mean that $\mathbb{E}_{\mathbb{P}}[X]=0$ and $\mathbb{E}_{\mathbb{Q}}[X]=c$, where $c$ is a constant?&#xA;I'd be grateful for hints how to work with different measures in practice.&lt;/p&gt;&#xA;" OwnerUserId="25659" LastEditorUserId="16148" LastEditDate="2017-04-18T17:47:17.047" LastActivityDate="2017-04-18T17:47:17.047" Title="Electricity Prices: Change of measure in practice" Tags="&lt;market-data&gt;&lt;risk-neutral-measure&gt;&lt;simulations&gt;&lt;models&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33730" PostTypeId="2" ParentId="33711" CreationDate="2017-04-18T15:41:26.420" Score="2" Body="&lt;p&gt;You are essentially interested in pricing a second order bond-binary option. In its most general form, this contract has a time $T_2$ payoff of&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathcal{B}_{\xi_1, \xi_2}^{s_1, s_2} \left( S_{T_1}, S_{T_2}, T_2 \right)  = \mathrm{1} \left\{ s_1 S_{T_1} &amp;gt; s_1 \xi_1 \right\} \mathrm{1} \left\{ s_2 S_{T_2} &amp;gt; s_2 \xi_2 \right\}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, we have $\xi_1 = B$, $s_1 = +1$, $\xi_2 = K$ and $s_2 = +1$. The time $T_1$ value of this option is equal to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathcal{B}_{\xi_1, \xi_2}^{s_1, s_2} \left( S_{T_1}, T_1 \right)  = \mathrm{1} \left\{ s_1 S_{T_1} &amp;gt; s_1 \xi_1 \right\} e^{-r \left( T_2 - T_1 \right)} \mathbb{E} \left[ \left. \mathrm{1} \left\{ s_2 S_{T_2} &amp;gt; s_2 \xi_2 \right\} \right| S_{T_1} \right].&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apart from the additional discounting, this is the same expression as in your question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This contract is a special case of the generalize multi-period and multi-asset $\mathbb{M}$-binary options analyzed by Skipper and Buchen (2003). Its time $0 \leq t &amp;lt; T_1$ value is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathcal{B}_{\xi_1, \xi_2}^{s_1, s_2} \left( S_t, t \right) = e^{-r \tau_2} \mathcal{N}_2 \left( \alpha_{0, 1}, \alpha_{0, 2}; \rho \right),&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\tau_i = T_i - t$, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\alpha_{0, i} = \frac{s_i}{\sigma \sqrt{\tau_i}} \left( \ln \left( \frac{S}{\xi_i} \right) + \left( r - \frac{1}{2} \sigma^2 \right) \tau_i \right)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\rho = s_1 s_2 \sqrt{\frac{\tau_1}{\tau_2}}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, $\mathcal{N}_2$ is the bivariate standard normal distribution function with the given correlation. See the original paper for a derivation of this result. You find a similar result in Chapter 2 of the Ph.D. thesis Veiga (2010). See also &lt;a href=&quot;https://quant.stackexchange.com/questions/31199&quot;&gt;this&lt;/a&gt; related question and the corresponding answers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Skipper, Max and Peter W. Buchen (2003) &quot;The Quintessiential Option Pricing Formula&quot;, Working Paper, School of Mathematics and Statistics, University of Sydney, &lt;a href=&quot;http://www.maths.usyd.edu.au/u/pubs/publist/preprints/2003/skipper-22.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;available online&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Veiga, Carlos Manuel &quot;Closed Formulas and Rating Schemes for Derivatives&quot;, Ph.D. Thesis, Frankfurt School of Finance &amp;amp; Management, &lt;a href=&quot;http://d-nb.info/1011760029/34&quot; rel=&quot;nofollow noreferrer&quot;&gt;available online&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2017-04-18T15:41:26.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33731" PostTypeId="1" AcceptedAnswerId="33755" CreationDate="2017-04-18T16:44:03.590" Score="0" ViewCount="249" Body="&lt;p&gt;I am about to apply traditional univariate GARCH tools to analyze the volatility of the Bitcoin - US Dollar exchange rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The index that I would like to investigate is the Bitcoin Market Price (BMP) that is reported by the Blockchain.info information provider at this link: &lt;a href=&quot;https://blockchain.info/en/charts/market-price&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://blockchain.info/en/charts/market-price&lt;/a&gt;. The data can be freely downloaded into a CSV file by clicking at the button that appears at the bottom of the page.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above page's headline states that the BMP is an &quot;average USD market price across major bitcoin exchanges&quot; which, &lt;em&gt;I guess&lt;/em&gt;, are those tracked at this link &lt;a href=&quot;https://blockchain.info/markets&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://blockchain.info/markets&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any available detailed information on how the BMP is calculated?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be of particular interest to me to know the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) Is the BMP calculated with the exchange rates that are tracked at the second link above?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) Is the BMP weighed by the four exchanges' respective transaction volumes?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;c) Are Bitcoin trades other than those with US Dollar included in the BMP?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;d) If so, which (official/unofficial) fiat exchange rates are used to state the BMP in US Dollar terms?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;e) How often is the BMP updated during any calendar day?&lt;/p&gt;&#xA;" OwnerUserId="25318" LastEditorUserId="25318" LastEditDate="2017-04-18T17:06:09.343" LastActivityDate="2017-04-19T16:35:58.037" Title="How is the Blockchain.info Bitcoin Market Price Calculated?" Tags="&lt;fx&gt;&lt;exchange&gt;&lt;bitcoin&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33733" PostTypeId="2" ParentId="30635" CreationDate="2017-04-18T18:57:58.513" Score="1" Body="&lt;p&gt;This extends to not just FI but multi asset class (MAC) as well. You can use a linear MAC factor model to compute specific\unsystematic risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's are several examples of such a model:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.msci.com/documents/1296102/5025433/PRESENTATION_FixedIncomeRoadshow.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.msci.com/documents/1296102/5025433/PRESENTATION_FixedIncomeRoadshow.pdf&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.jpmorgan.com/jpmpdf/1158651692009.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.jpmorgan.com/jpmpdf/1158651692009.pdf&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You would compute specific risk the same way you normally would: &lt;a href=&quot;https://quant.stackexchange.com/questions/2205/how-to-calculate-unsystematic-risk&quot;&gt;How to calculate unsystematic risk?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="1764" LastEditDate="2017-04-19T21:20:11.480" LastActivityDate="2017-04-19T21:20:11.480" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33735" PostTypeId="1" CreationDate="2017-04-18T21:06:26.913" Score="0" ViewCount="3998" Body="&lt;p&gt;I already have a method of calculating Size:  the natural logarithm of the market value of equity at the end of the fiscal year. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But how to account for the Market Risk Premium, RMW, CMA and MOM factor for each particular stock?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the methodology I want to replicate, the following variable is stated in the Factor-model regression:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/SKMBy.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://i.stack.imgur.com/SKMBy.png&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="27532" LastActivityDate="2017-05-18T21:42:58.047" Title="How can I calculate Fama-French Beta, RMW and CMA factor for a particular stock?" Tags="&lt;factor-models&gt;&lt;beta&gt;&lt;factor-loading&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33736" PostTypeId="2" ParentId="33735" CreationDate="2017-04-18T21:25:47.090" Score="2" Body="&lt;p&gt;Use monthly returns and follow Ken French's &lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/Data_Library/f-f_5_factors_2x3.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;website&lt;/a&gt;. RMW, CMA, and MOM are all calculated in depth on a near daily basis. From his Dartmouth data library. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;MRP&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Rm-Rf, the excess return on the market, value-weight return of all CRSP firms incorporated in the US and listed on the NYSE, AMEX, or NASDAQ that have a CRSP share code of 10 or 11 at the beginning of month t, good shares and price data at the beginning of t, and good return data for t minus the one-month Treasury bill rate (from Ibbotson Associates).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;RMW&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;RMW (Robust Minus Weak) is the average return on the two robust operating profitability portfolios minus the average return on the two weak operating profitability portfolios,&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    RMW =&#xA;&#xA;1/2 (Small Robust + Big Robust)&#xA;  - 1/2 (Small Weak + Big Weak).&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;CMA&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;CMA (Conservative Minus Aggressive) is the average return on the two conservative investment portfolios minus the average return on the two aggressive investment portfolios,&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    CMA =&#xA;&#xA;1/2 (Small Conservative + Big Conservative)&#xA;  - 1/2 (Small Aggressive + Big Aggressive).&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Portfolio construction is done based on broadly 70/30 percentile for each of these factors. If you are looking at US returns this has all been calculated, if you are looking at international returns (for some obscure country where they haven't done this), you will define your own portfolio mixes. &lt;/p&gt;&#xA;" OwnerUserId="17175" LastActivityDate="2017-04-18T21:25:47.090" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33737" PostTypeId="2" ParentId="33689" CreationDate="2017-04-19T03:17:31.780" Score="1" Body="&lt;p&gt;One way might be to calculate a proxy yield based on peer group metrics such as credit rating and currency.  This won't however make any allowance for the liquidity premium, but nonetheless, it might still be a useful  approximation.  If the credit rating history is not available, then you might have to use something like the KMV model (part of Moody's Analytics) which can be used to estimate a yield based on balance sheet structure.   &lt;/p&gt;&#xA;" OwnerUserId="3297" LastActivityDate="2017-04-19T03:17:31.780" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="33738" PostTypeId="1" CreationDate="2017-04-19T05:25:08.723" Score="0" ViewCount="395" Body="&lt;p&gt;I want to get the &lt;strong&gt;daily returns&lt;/strong&gt; in USD given returns in local currency (say Japanese Yen).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say for example, on February 3rd according to Factset, the returns of &lt;a href=&quot;http://www.inpex.co.jp/english/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Inpex Corp&lt;/a&gt; (Japan) are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;In USD&lt;/em&gt;: 0.1740694 (&lt;strong&gt;R_Desired&lt;/strong&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;In JPY&lt;/em&gt;: 0.13843775 (&lt;strong&gt;R_Local&lt;/strong&gt;)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The approach I used was this:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;JPY-USD&lt;/em&gt; on Feb-02 is: 113.311 (&lt;strong&gt;FX(0)&lt;/strong&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;JPY-USD&lt;/em&gt; on Feb-03 is: 112.789 (&lt;strong&gt;FX(-1)&lt;/strong&gt;)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;R_USD = (R_Local+1)x(FX_rate+1)-1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FX_rate = (FX(-1)/FX(0))-1= 0.004628111 (It's FX(0)/FX(-1) if you have the exchange rate in the desired currency).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;R_USD = 0.143709068 (different to what we are supposed to get in R_Desired).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I need to consider something else? What do I need to get that return to be as the one Factset gave back.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your time!&lt;/p&gt;&#xA;" OwnerUserId="24695" LastEditorUserId="24695" LastEditDate="2017-04-19T05:33:57.707" LastActivityDate="2017-05-19T07:51:31.297" Title="Getting Returns from Local Currency to USD" Tags="&lt;fx&gt;&lt;returns&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33739" PostTypeId="2" ParentId="33738" CreationDate="2017-04-19T07:39:39.217" Score="1" Body="&lt;p&gt;It is rather easy:&#xA;The local return is the rate of change of the price in local currency:&#xA;$$&#xA;r_{loc}=  P_t/P_{t-1} - 1&#xA;$$&#xA;where $P_t$ is the local price (in JPY). If you are a USD ivnestor, then you calculate the price in USD:&#xA;$$&#xA;r_{USD}=  \left(P_t * (1 \text{ JPY in USD  on day } t) \right)/\left(P_{t-1} * (1 \text{ JPY in USD on day } t-1) \right) - 1.&#xA;$$&#xA;and for a return &#xA;$$&#xA;r = X_t/X_{t-1}-1&#xA;$$&#xA;it is equivalent to write&#xA;$$&#xA;1+r =  X_t/X_{t-1}.&#xA;$$&#xA;Thus above you can write:&#xA;$$&#xA;r_{USD}=(1+r_{local})*(1+r_{FX})-1.&#xA;$$&#xA;Thus your formula is correct. Just consider that the above calculation depends on the fixing of the FX-rate. As FX is traded around the clock it very much depends on this.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2017-04-19T07:39:39.217" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33740" PostTypeId="1" CreationDate="2017-04-19T08:26:25.170" Score="2" ViewCount="134" Body="&lt;p&gt;I have a time series extracted from a financial time series (so my series of prices is described by an arithmetic model $X(t)+Y(t)+Z(t)$, my series is $Z(t)$). I'm trying to model $Z(t)$ by a Levy process. However, it might be the case that $Z(t)=\int_0^t \omega_{s-} dV_s$, where $\omega_{t}$ is a stochastic volatility and $V(t)$ - a Levy subordinator.&lt;br&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/e73n5.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/e73n5.png&quot; alt=&quot;Q-Q plot of increments of $Z(t)$ vs the fitted model&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/jTHPm.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/jTHPm.png&quot; alt=&quot;ACF of increments of $Z(t)$&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/flGLZ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/flGLZ.png&quot; alt=&quot;ACF of squared increments of $Z(t)$&quot;&gt;&lt;/a&gt;&#xA;We can see that:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;My fit seems to be reasonable, $Z(t)$ has slightly fatter tails than the model.&lt;/li&gt;&#xA;&lt;li&gt;Increments of $Z(t)$ are uncorrelated.&lt;/li&gt;&#xA;&lt;li&gt;Squared increments of $Z(t)$ are slightly correlated.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question:&lt;/strong&gt; How can I &quot;detect&quot; stochastic volatility? I tried to look at ACF functions of the increments of $Z(t)$ (and squared increments), but I'm not sure what it would tell me. I'm looking for easy tests that could give me some intuition, not a definite answer.&lt;/p&gt;&#xA;" OwnerUserId="25659" LastEditorUserId="25659" LastEditDate="2017-04-19T11:31:14.037" LastActivityDate="2017-04-19T11:31:14.037" Title="Detecting stochastic volatility" Tags="&lt;volatility&gt;&lt;time-series&gt;&lt;stochastic-volatility&gt;&lt;auto-correlation&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33742" PostTypeId="2" ParentId="33740" CreationDate="2017-04-19T10:29:16.110" Score="3" Body="&lt;p&gt;I'm not a time series expert but one idea occurs to me:  look at the distribution of the increments if Z(t).  If the w are stochastic , that distribution should have fat tails relative to the distribution that is generating the Levy process.   &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-04-19T10:29:16.110" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33743" PostTypeId="1" CreationDate="2017-04-19T12:06:56.747" Score="3" ViewCount="548" Body="&lt;p&gt;I recently read an article and they provide a formula for the first-passage probability as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Z = {1 \over \sigma }\left[ {\log S/{S_t} + (r - {1 \over 2}{\sigma ^2})t} \right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;${{S_t}}$ value of the stock at time t , $r$ ror on the stock, $\sigma $ standard deviation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The authors ref. Feller (1971) &quot;An Introduction to Probability Theory and Its Applications, Vol 2. &quot; But i have been unable to find the formula , does anyone know where this comes from and any literature where this formula is presented?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: Is it derived from this ? $$Z(t) = \exp \left\{ {\sigma X(t) - (\sigma \mu  + {1 \over 2}{\sigma ^2})t} \right\}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $$X(t) = \log S/Sc$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;update: is there a typo in their formula? after reading some literature should it not be the case that the first passage probability should be &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Z = {1 \over \sigma \sqrt{t} }\left[ {\log S/{S_t} + (r - {1 \over 2}{\sigma ^2})t} \right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Link : &lt;a href=&quot;http://ruangbacafmipa.staff.ub.ac.id/files/2012/02/An-Introduction-to-probability-Theory-by-William-Feller.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Feller pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Link Article : &lt;a href=&quot;https://forum.wilmott.com/download/file.php?id=7750&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://forum.wilmott.com/download/file.php?id=7750&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="26262" LastEditorUserId="24222" LastEditDate="2017-04-23T19:01:09.140" LastActivityDate="2017-04-24T10:10:33.960" Title="First passage probability formula" Tags="&lt;black-scholes&gt;&lt;probability&gt;&lt;barrier&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33744" PostTypeId="1" CreationDate="2017-04-19T12:48:09.740" Score="9" ViewCount="358" Body="&lt;p&gt;&quot;Model Calibration&quot; article in &lt;a href=&quot;http://eu.wiley.com/WileyCDA/Section/id-400799.html&quot; rel=&quot;noreferrer&quot;&gt;Encyclopedia of Quantitative Finance&lt;/a&gt;  states that &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;.  .  .  a common approach for selecting a pricing measure $\mathbb{Q}$ is to choose, given a set of liquidly traded derivatives with (discounted) terminal payoffs $(H^i)_{i \in I}$ and market prices $(C_i)_{i \in I}$, a pricing measure $\mathbb{Q}$ compatible with the observed market prices&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;where $\mathbb{Q}$ denotes&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;a probability measure on the set $\Omega$ of possible trajectories $(S_t)_{ t \in [0,T ]}$ of the underlying asset such that the asset price $\frac{S_t}{N_t}$ discounted by the numeraire $N_t$ is a martingale.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But we know that market prices $(C_i)_{i \in I}$ are generated by fallible human beings!  Each of them has rather limited knowledge about &quot;possible trajectories $(S_t)_{ t \in [0,T ]}$ of the underlying asset&quot;. Otherwise they wouldn't need the model we are trying to calibrate, would they?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So &lt;strong&gt;The Calibration Process&lt;/strong&gt; receives some prices $(C_i)_{i \in I}$, some  arbitrarily choosen mathematical model (i.e. &lt;a href=&quot;https://en.wikipedia.org/wiki/Heston_model&quot; rel=&quot;noreferrer&quot;&gt;Heston&lt;/a&gt;) and produces as an output the calibrated model which supposedly able to give us predictions about the future $(S_t)_{ t \in [0,T ]}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why do we believe that &lt;strong&gt;The Calibration Process&lt;/strong&gt; is different from &lt;a href=&quot;https://en.wikipedia.org/wiki/Garbage_in,_garbage_out&quot; rel=&quot;noreferrer&quot;&gt;&lt;strong&gt;GIGO&lt;/strong&gt;&lt;/a&gt; process? &lt;/p&gt;&#xA;" OwnerUserId="15154" LastActivityDate="2017-04-26T15:27:19.337" Title="Is a common approach to calibration reasonable?" Tags="&lt;calibration&gt;" AnswerCount="1" CommentCount="11" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="33746" PostTypeId="2" ParentId="33681" CreationDate="2017-04-19T13:41:59.330" Score="3" Body="&lt;p&gt;I think you misunderstood the underlying idea of the risk-neutrality and the market price of risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The basic idea is to price the option with a portfolio consisting of the underlying asset $S$ and another option. In order to make this portfolio risk-free and because of no-arbitrage arguments, the change in the portfolio should correspond to the change of the risk-free portfolio, i.e. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d\Pi= r\Pi dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This delivers (I didn't check calculations in details) the partial differential equation with $V$ you obtained.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your mistake is then coming when you write: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d\Pi- r\Pi dt\ $=$\ q \Delta( \lambda dt+d W_2) $.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, this is impossible because, given the risk-free portfolio, the left hand side is zero but the right hand side is always different from zero whatever the value of $\lambda$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Probably that this formula is for the option to price: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dV- rV dt\ $=$\ q \Delta( \lambda dt+d W_2) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which expresses the idea of risk compensation by $\lambda$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The right hand side contains a deterministic term in $dt$ and a stochastic term in $dW_2$. The term in $dW_2$ shows that the portfolio is a risky portfolio and $\lambda$ can then be interpreted as the excess return (on top of the risk-free return $r$) for accepting a certain level of risk. On the one hand, you have a risk but on the other hand, you have excess return via $\lambda$ (which explains the name &quot;market price of risk&quot;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the Feynman–Kac formula, we can also express this PDE as a conditional expectation, which justifies the martingale approach. But nowhere, in the reasoning, we need to assume that $\lambda=0$. Otherwise, it would mean that the risk-neutral measure and the real-world measure coincide, which does not really make sense. &lt;/p&gt;&#xA;" OwnerUserId="27358" LastActivityDate="2017-04-19T13:41:59.330" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33748" PostTypeId="1" CreationDate="2017-04-19T14:13:35.700" Score="1" ViewCount="4342" Body="&lt;p&gt;I am actually trying to strip Markit IR curves, following their specs here : &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cdsmodel.com/cdsmodel/assets/cds-model/docs/Interest%20Rate%20Curve%20Specification%20-%20All%20Currencies%20(Updated%20November%208%202014)%20Final.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.cdsmodel.com/cdsmodel/assets/cds-model/docs/Interest%20Rate%20Curve%20Specification%20-%20All%20Currencies%20(Updated%20November%208%202014)%20Final.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have questions about swaps, more specifically about the fixed/floating payment schedule generation, in this Markit/ISDA context (specialist are welcome !) :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;just to be sure : adding/substracting for instance $3$M to a date $dd/mm/yyyy$ means adding/substracting $3$ to $mm$ (and taking the remainder modulo $12$) and adjusting if needed, right ?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;is the generation done forward (for instance for a $3$M floating leg frequency, one adds $3$M to the settlement date to have the first floating payment date and iterate until the tenor maturity of the swap) or backward (one adds let's say $10$Y to the settlement the have the maturity and last floating payment date, and then from this date one moves backward substracting $3$M's from it) ? I guess the generation is done forward, and backward we would have broken periods issues that they don't discuss in the paper. Am I right ?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;whether it is backward or forward, do we generate dates by substracting or adding (let's say) $3$M's and then adjusting the whole series of obtained dates, or do we add/substract $3$M, then adjust (according to a given convention) then add/substract $3$M again and adjust again etc etc ?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="13470" LastEditorUserId="13470" LastEditDate="2017-04-19T22:18:10.833" LastActivityDate="2018-10-31T01:29:05.300" Title="A question about dates generation" Tags="&lt;swaps&gt;&lt;date&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33749" PostTypeId="1" CreationDate="2017-04-19T14:28:00.100" Score="1" ViewCount="860" Body="&lt;p&gt;I  am searching for exact accounting example of Stock right position in Portfolio when someone is short sell. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Searched a lot over Google, contacted local Brokers as well..Didn't get any response.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please help to understand the secanrio with examples.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks &lt;/p&gt;&#xA;" OwnerUserId="20303" LastActivityDate="2017-04-19T15:19:21.773" Title="if you short sell? And Right issue has taken place, so Does Right issue has negative positions in Portfolio or not?" Tags="&lt;equities&gt;&lt;portfolio-management&gt;&lt;finance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33750" PostTypeId="2" ParentId="33748" CreationDate="2017-04-19T14:34:20.737" Score="1" Body="&lt;p&gt;Swap dates are usually generated using some periodicity to maturity. All of these dates are generated first, then they are individually adjusted for holidays using a business day convention (e.g. modified following).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With this method there is no distinction between &quot;backwards&quot; or &quot;forwards&quot; because both ways produce the same dates.&lt;/p&gt;&#xA;" OwnerUserId="5617" LastActivityDate="2017-04-19T14:34:20.737" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33751" PostTypeId="2" ParentId="31743" CreationDate="2017-04-19T14:57:13.910" Score="2" Body="&lt;p&gt;Both approach gives same results for stocks weights but different results for lamda values&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Correct approach is multiplying the covariance matrix by 2 but you only need stocks weights so its the same&lt;/p&gt;&#xA;" OwnerUserId="27548" LastActivityDate="2017-04-19T14:57:13.910" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33752" PostTypeId="2" ParentId="33748" CreationDate="2017-04-19T15:10:48.683" Score="3" Body="&lt;p&gt;The forwards/backwards will matter if there is a stub period.  Typically it is done backwards though with the end-of-month convention.  Also, the way to do it is to calculate all the accrual start/end dates as if there are no holidays and then do the adjustments.  This way, all the payment dates will roughly be on the same day of the month except for non-business days and different months having different numbers of days etc.  If you add the period then adjust and then add a period to this adjusted date, we can easily drift away from the intended accrual end dates - and by the end of a 30 year swap, you could find that there are only 70 days left in a 3M accrual period!&lt;/p&gt;&#xA;" OwnerUserId="26977" LastActivityDate="2017-04-19T15:10:48.683" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="33753" PostTypeId="2" ParentId="33749" CreationDate="2017-04-19T15:19:21.773" Score="1" Body="&lt;p&gt;If you shortsell a stock, then you are short all the rights (no pun intended) that a stockholder has including dividends, spinoff shares, rights, warrants, whatever.  You will owe the rights as well.  &lt;/p&gt;&#xA;" OwnerUserId="26977" LastActivityDate="2017-04-19T15:19:21.773" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="33754" PostTypeId="1" CreationDate="2017-04-19T15:42:59.943" Score="4" ViewCount="223" Body="&lt;p&gt;In Bjork's arbitrage theory in continuous time, he writes &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/6fpws.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/6fpws.png&quot; alt=&quot;![enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;S, essentially we define $Q$ using $h_t$, and then pick $h_t$ so $Q$ is a martingale measure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, $Q$ needs to be an &lt;strong&gt;equivalent&lt;/strong&gt; measure. We know from Radon-Nikodym that when we define $Q$ using this method, $Q$ WILL be absolutely continuous with respect to $P$. That is, $Q &amp;lt;&amp;lt; P$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But that doesn't mean $P \sim Q.$ We also need $P &amp;lt;&amp;lt;Q$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So why is the $Q$ as defined using $L_t$ and $h_t$ equivalent? The Radon-Nikodym theorem only gives tells us that it is absolutely continuous wrt $P$?&lt;/p&gt;&#xA;" OwnerUserId="27549" LastActivityDate="2017-04-19T17:38:42.213" Title="Understanding Girsanov's theorem in Bjork's book" Tags="&lt;girsanov&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33755" PostTypeId="2" ParentId="33731" CreationDate="2017-04-19T16:35:58.037" Score="0" Body="&lt;p&gt;I am pretty sure this information is not public. I would suggest looking at other bitcoin sources that have some information on how they formulate price:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Tradeblock's XBX (&lt;a href=&quot;https://tradeblock.com/markets/index&quot; rel=&quot;nofollow noreferrer&quot;&gt;more information&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;li&gt;bitcoin average (&lt;a href=&quot;https://bitcoinaverage.com/en/methodology&quot; rel=&quot;nofollow noreferrer&quot;&gt;calculation information&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For every price source I doubt that you will find the exact details of how it is calculated.&lt;/p&gt;&#xA;" OwnerUserId="27551" LastActivityDate="2017-04-19T16:35:58.037" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33756" PostTypeId="1" AcceptedAnswerId="33802" CreationDate="2017-04-19T17:09:58.580" Score="0" ViewCount="142" Body="&lt;p&gt;I've been algo trading a small portfolio within NYSE for about a year now. And while do end up running positive P/L results are far from spectacular. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ran a test using my strategy in OMX Stockholm with much better results even with higher commissions/slippage. Beeing from Finland indices traded there are much more familiar for me as well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am really keen on starting proper backtests &amp;amp; paper trading with a real-time data feed, but I would like to understand what I need to take into account trading in a much smaller less liquid environment?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My list of worries:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Slippage&lt;/li&gt;&#xA;&lt;li&gt;Risk hedging challenges due to low derivate/options trading volume&lt;/li&gt;&#xA;&lt;li&gt;Market manipulation. Few market makers are responsible for more than 50% of the volume in quiet trading days.&lt;/li&gt;&#xA;&lt;li&gt;Complex forex management, Nordic OMX has listings in 4 currencies.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Is there something else I need to take into account compared to trading in larger more liquid exchange?&lt;/p&gt;&#xA;" OwnerUserId="26443" LastActivityDate="2017-04-21T02:24:23.613" Title="Understanding the downsides in of trading in smaller exchange" Tags="&lt;market-microstructure&gt;&lt;market&gt;&lt;exchange&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33757" PostTypeId="2" ParentId="33754" CreationDate="2017-04-19T17:31:48.250" Score="2" Body="&lt;p&gt;The process $L$ is strictly positive.  This implies that $Q$ is equivalent to $P$ and not merely absolutely continuous.&lt;/p&gt;&#xA;" OwnerUserId="3415" LastEditorUserId="3415" LastEditDate="2017-04-19T17:38:42.213" LastActivityDate="2017-04-19T17:38:42.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33760" PostTypeId="1" AcceptedAnswerId="33761" CreationDate="2017-04-19T20:55:19.443" Score="0" ViewCount="1112" Body="&lt;p&gt;I'm reading this paper &lt;a href=&quot;http://www.ssoar.info/ssoar/bitstream/handle/document/22137/ssoar-2009-04-fengler-arbitrage-free_smoothing_of_the_implied.pdf?sequence=1&quot; rel=&quot;nofollow noreferrer&quot;&gt;link&lt;/a&gt; and have came across the below statement. Can someone shed some light on it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;The approach we propose here builds on smoothing rather than interpolation. Therefore, the input data do not need to be arbitrage-free.&quot; Thanks you.&lt;/p&gt;&#xA;" OwnerUserId="24395" LastEditorUserId="16148" LastEditDate="2017-04-19T21:03:57.127" LastActivityDate="2017-04-19T21:06:37.507" Title="Arbitrage free smoothing of implied volatility surface, by Fengler" Tags="&lt;implied-volatility&gt;&lt;arbitrage&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33761" PostTypeId="2" ParentId="33760" CreationDate="2017-04-19T21:06:37.507" Score="3" Body="&lt;p&gt;I think they mean that by interpolation, the smile goes exactly through the implied vols of the raw market data.  By smoothing, it means they are attempting a best fit subject to arbitrage constraints and the fit may not actually go exactly through the raw vol data points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Disclaimer - I only skimmed that section of the paper rather than reading thoroughly.&lt;/p&gt;&#xA;" OwnerUserId="26977" LastActivityDate="2017-04-19T21:06:37.507" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="33762" PostTypeId="1" AcceptedAnswerId="33764" CreationDate="2017-04-19T21:48:58.193" Score="0" ViewCount="300" Body="&lt;p&gt;&lt;strong&gt;Background&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was quickly investigating Boeing's (BA) Debt-to-Equity ratio and received a very high number. I looked around online and have confirmed that BA has recently taken on a lot of debt, but am not reaching the same calculations as Morningstar or YCharts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;INPUTS&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2016 Annual Debt:  &lt;a href=&quot;http://financials.morningstar.com/balance-sheet/bs.html?t=BA&amp;amp;region=usa&amp;amp;culture=en-US&quot; rel=&quot;nofollow noreferrer&quot;&gt;89120.0&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2016 Annual Shareholder Equity: &lt;a href=&quot;http://financials.morningstar.com/balance-sheet/bs.html?t=BA&amp;amp;region=usa&amp;amp;culture=en-US&quot; rel=&quot;nofollow noreferrer&quot;&gt;877.0&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Calculation&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Debt-to-Equity = 89120 / 877 = 101.6&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Ycharts shows a Debt-to-Equity ratio of [12.01]. This should be a simple calculation so how am I getting different numbers?&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="17082" LastActivityDate="2017-04-19T22:35:13.860" Title="Boeing's Debt-to-Equity Ratio" Tags="&lt;indicator&gt;&lt;debt&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33764" PostTypeId="2" ParentId="33762" CreationDate="2017-04-19T22:35:13.860" Score="0" Body="&lt;p&gt;The ratio is calculated using&#xA;$$&#xA;\dfrac{\text{Short and Long Term Debt}}{\text{Shareholders' Equity}} = \dfrac{327 + 9487}{817} = 12.01&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the value matches your other source.&lt;/p&gt;&#xA;" OwnerUserId="5617" LastActivityDate="2017-04-19T22:35:13.860" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33768" PostTypeId="1" CreationDate="2017-04-20T00:45:07.593" Score="1" ViewCount="1461" Body="&lt;p&gt;I understand that it is the partial derivative of option price with respect to strike. What is it used for though? What does your dual delta signify? &lt;/p&gt;&#xA;" OwnerUserId="26736" LastActivityDate="2021-05-21T22:10:11.763" Title="What is Dual Delta?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33769" PostTypeId="2" ParentId="33748" CreationDate="2017-04-20T01:25:04.210" Score="4" Body="&lt;p&gt;This is really just to elaborate on other contributor's answers:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generating the cash flow schedule is surprisingly complicated. As a general rule of thumb, the following dates are involved for a swap (though not all of them need to be specified):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The trade date: This is the date on which the swap is traded, usually &quot;today.&quot;&lt;/li&gt;&#xA;&lt;li&gt;The effective date: This is when the contract actually settles. For USD swaps, it is 2 business days after the trade date.&lt;/li&gt;&#xA;&lt;li&gt;The first interest payment date: This is the date when the first interest payment occurs. For the floating leg of a USD swap, this is usually 3 months after the effective date, though it could be longer than 3 months (long stub) or shorter than 3 months (short stub).&lt;/li&gt;&#xA;&lt;li&gt;The penultimate interest payment date: This is the last interest payment &lt;em&gt;before&lt;/em&gt; the maturity date. The period between this date and the maturity date can also be longer or shorter than other periods.&lt;/li&gt;&#xA;&lt;li&gt;The maturity date: The day on which the final interest rate payment is made and the swap matures.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For most standard swaps, all you need is the trade date and the tenor/term. Using USD standard swap as an example, the cash flows can be generated as follows:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Given the trade date, the effective date is trade day + 2 business day.&lt;/li&gt;&#xA;&lt;li&gt;With the effective date, the maturity date is the effective date + tenor of the swap. To do this date calculation, you also need to understand the &quot;roll day.&quot; In this case, the roll day should be determined from the effective date:&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If &quot;end-of-month roll&quot; is off:&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If the effective date is MM-28-YYYY, then the roll day is 28, and the maturity date should also fall on the 28th. &lt;/li&gt;&#xA;&lt;li&gt;If the effective date is MM-31-YYYY, then the roll day is 31, and the maturity date should also fall on the 31st (if that's not possible, move it BACK to the end of the month).&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;If &quot;end-of-month roll&quot; is on (default for US Treasuries):&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If effective date is month end, all dates in the schedule should also fall on month end.&lt;/li&gt;&#xA;&lt;li&gt;Otherwise, use the same rules above.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;The dates between effective date and maturity can be calculated relatively easily, by incrementally adding the payment period to the previous date, using the same roll day determined in the previous step. For floating leg of a USD swap, for example, start from effective date and incrementally add 3 months.&lt;/li&gt;&#xA;&lt;li&gt;Finally, go through all the dates again and adjust them for holidays and weekends as needed. USD swaps follow the &quot;Modified Following&quot; convention – if a date is a bad day (i.e., holiday/weekends), you move it to the next good day; unless the next good day is in the next month, in which case you move it backward to the previous good day.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In practice, you need to carefully read both the proper local market convention AND the actual agreement to determine the cash flow schedule.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2017-04-20T01:30:51.753" LastActivityDate="2017-04-20T01:30:51.753" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33770" PostTypeId="1" CreationDate="2017-04-20T02:49:04.630" Score="1" ViewCount="217" Body="&lt;p&gt;I am PhD in computer science, and I am pretty much clueless where can I look for good journals or conferences for Forex that talked about its inefficiency.&#xA;Is there any good journals, conferences that has research papers covering this in a practical way? Or any particular research papers you would recommend?&lt;/p&gt;&#xA;" OwnerUserId="26480" LastEditorUserId="15154" LastEditDate="2017-04-20T07:15:39.877" LastActivityDate="2017-04-22T14:14:11.340" Title="Is there any good academic references for Forex inefficiency?" Tags="&lt;fx&gt;&lt;research&gt;&lt;market-efficiency&gt;" AnswerCount="2" CommentCount="0" ClosedDate="2017-04-26T18:23:40.747" ContentLicense="CC BY-SA 3.0" />
  <row Id="33771" PostTypeId="1" AcceptedAnswerId="33774" CreationDate="2017-04-20T04:13:34.780" Score="8" ViewCount="517" Body="&lt;p&gt;I've taken it as gospel that the following equality is true:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}[\mu_x] = m_x - \frac{1}{2}\sigma_x^2 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb{E}[\mu_x]$ is the expected value of the logarithmic mean of some arbitrary Numeraire process: $\mathbb{E}[\frac{dX_T}{X}dt] \to \ln (\frac{{X}_T}{{X}_{T- \Delta t}})$;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$m_x$ is the arithmetic expectation; and,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma^2_x$ is its logarithmic variance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know it's true because the equality can be shown to converge for random processes as sample size becomes large, but this doesn't tell me why it's true.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know of a mathematical proof for why this is true? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, why in common derivations of expected value is $m$ used as starting point instead of $\mu$? Is it because commonly cited short rates are just given that way?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This might be elementary, and I apologize if it is, but I haven't been able to find a purely symbolic proof.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2017-04-20T07:17:56.790" LastActivityDate="2018-03-21T21:45:11.970" Title="Why is logarithmic mean equal to the arithmetic expectation less one-half its variance?" Tags="&lt;risk-neutral-measure&gt;&lt;short-rate&gt;&lt;expected-value&gt;" AnswerCount="2" CommentCount="9" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="33773" PostTypeId="2" ParentId="33744" CreationDate="2017-04-20T06:56:35.397" Score="4" Body="&lt;p&gt;I am intrigued by this question because it gets at the heart of so many grey areas of the financial system in which it becomes almost impossible to know how many assets derive their values from some unseen or ill-prescribed, but presumed extant, underlying process. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Calibration can be interpreted as means of deriving an expectation which is the probabilistic point estimate, subject to certain parameters, $p_1,\,p_2,\,...p_n$, i.e.,:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb{E}[X_T] = f(X_t,\,p_1,\,p_2,\,...p_n)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is, in essence, &lt;strong&gt;&lt;em&gt;The Strong Law&lt;/em&gt;&lt;/strong&gt; of asset pricing. However, the law of arbitrage supersedes the strong law when it is possible to show that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$f(\mathbb{E}[(H_T^i)_{i \in I}]) \ne (C_{i,T})_{i \in I}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;only if/when it is possible to partake in both $H^i$ and $C_i$, such as in the assumption regarding complete markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, in the absence of a complete market, or when faced with complicated pay-off scenarios, any expectation of a $\mathbb{Q}$ martingale may indeed be parametric at best (i.e., the expectation must taken through calibration). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My skepticism is perhaps best demonstrated by the following passage out of Baxter's and Rennie's &lt;em&gt;Financial Calculus&lt;/em&gt; (kudos to @DaneelOlivaw for making me aware of this):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Almost everything appeared safe to price via expectation and the&#xA;  strong law, and only forwards and close relations seemed to have an&#xA;  arbitrage price. Since 1973, however, and the infamous Black-Scholes&#xA;  paper, just how wrong this is has slowly come out. Nowhere in this&#xA;  book will we use the strong law again. […] All derivatives can be&#xA;  built from the underlying −− arbitrage lurks everywhere.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Perhaps... but my personal, &lt;em&gt;fallible&lt;/em&gt; experience tells me otherwise. While the no-arbitrage range of possible values for an equity option may be known presuming that the price of the equity is known, what is the fair value of an equity? I.e., how can we construct a replicating payoff for this equity in a way that is not a &lt;em&gt;tautology&lt;/em&gt; (i.e., a thing which defines itself but nothing more)? To my knowledge, there exist no market for accounting values of assets and liabilities. More explicitly, how can we show the value of a thing, $C_t$, as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C_{i,t} = \int_t^T f(\mathbb{E}[H_{i,t}]P_t) \, dt$; $P_t := e^{-rt}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;when $C_{i,t}$ is a function of human perception regarding the unknown future values of $T$ and $H_{i,t}$, even if we take the risk-neutral expectation and short-rate as gospel?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given that no perfect model for human behavior exists (otherwise that model would equal reality and its creator, a god), an imperfect (practical) answer to mitigating &lt;strong&gt;&lt;em&gt;GIGO&lt;/em&gt;&lt;/strong&gt; is to derive an expectation which make use of the fewest possible parameters. Fewer parameters means less calibration, which means decreased odds of over-fitting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A thing which is descriptive of the past, present, and/or future, and which is also not highly calibrated has a better likelihood of being prescriptive than a thing which is more highly descriptive but also more highly calibrated. &lt;strong&gt;Is there a model for that?&lt;/strong&gt; And don't say &lt;em&gt;degrees of freedom&lt;/em&gt;...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this imply that highly-specified models (e.g., Heston) which calibrate expectations to observations are less robust? Not necessarily if the fit is not &lt;em&gt;garbage&lt;/em&gt; (i.e., not spurious; i.e., it states something which is true regarding the nature of uncertainty), but in aggregate, I believe so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I take the broad corpus of economic literature's failure to predict anything but the past as evidence. &lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2017-04-20T22:39:41.843" LastActivityDate="2017-04-20T22:39:41.843" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33774" PostTypeId="2" ParentId="33771" CreationDate="2017-04-20T07:06:08.400" Score="3" Body="&lt;p&gt;So i'm kinda guessing what you really mean by the logarithmic mean - i'm guessing you mean the logarithmic average of returns - where you mean geometric average.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\left( \prod_{i=0}^n a_i \right)^{\frac{1}{n}}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $a_i$ are our returns. We have to make an assumption here - that your underlying is described by $\mathrm{d}S = \mu S \mathrm{d}t + \sigma S \mathrm{d}W$ such that our processes evolves as $S_{t+\mathrm{d}t} = S_t e^{(\mu - \frac{1}{2} \sigma^2)\mathrm{d}t + \sigma \mathrm{d}W_t}$. i.e. our return is $e^{(\mu - \frac{1}{2} \sigma^2)\mathrm{d}t + \sigma \mathrm{d}W_t}$ - that is what we want to compare the arithmetic and eometric averages of.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, the arithmetic average, below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Arithmetic Average&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ultimately i think you'll just need to go through the algebra of the logarithmic mean, and then the stuff below will give you the rest of what you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unless that is, you don't actually the logarithm mean as described &lt;a href=&quot;https://en.wikipedia.org/wiki/Logarithmic_mean&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First take the following, which i presume you know&#xA;$$&#xA;\begin{align}&#xA;e^x &amp;amp;= 1 + x + \frac{1}{2!}x^2 + \frac{1}{3!}x^3 + \ldots\\&#xA;e^x &amp;amp;= \sum\limits_{k=0}^{\infty} \frac{1}{k!}x^k \\&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if $X$ is a normally distributed random variable, $X \sim \mathcal{N}(\mu,\sigma)$, then we can first split out the mean, such that we have $X = \mu + Y$ where $Y\sim \mathcal{N}(0,\sigma)$, and we have $Z = e^X = e^{\mu + Y} = e^\mu e^Y$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align}&#xA;\mathbb{E}[Z] = \mathbb{E}[e^\mu e^Y] &amp;amp;= e^\mu \mathbb{E}[\sum\limits_{k=0}^{\infty} \frac{1}{k!}Y^k]\\&#xA; &amp;amp;= e^\mu\sum\limits_{k=0}^{\infty} \frac{1}{k!}\mathbb{E}[Y^k]\\&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where each of the $\mathbb{E}[Y^k]$ are the $k^\mathrm{th}$ moments of $Y$, and since $\mu_Y=0$, they are equal to the central moments, which are given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbb{E}[Y^k] = &#xA;\begin{cases}&#xA;0 &amp;amp; \mathrm{if\ }k \mathrm{\ is\  odd}\\&#xA;\sigma^k (k-1)!! &amp;amp; \mathrm{if\ }k \mathrm{\ is\ even}\\&#xA;\end{cases}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So now we just have some algebra to do:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align}&#xA;\mathbb{E}[Z] &amp;amp;= e^\mu\sum\limits_{k=0}^{\infty} \frac{1}{k!}\mathbb{E}[Y^k]\\&#xA;&amp;amp;= e^\mu\sum\limits_{k=0, \mathrm{even}}^{\infty} \frac{1}{k!}\sigma^k (k-1)!!\\&#xA;&amp;amp;= e^\mu\sum\limits_{k=0, \mathrm{even}}^{\infty} \frac{1}{k!!}\sigma^k\\&#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For that last term, let's expand it out and see if we can see anything:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align}&#xA;\sum\limits_{k=0, \mathrm{even}}^{\infty} \frac{1}{k!!}\sigma^k &amp;amp;= 1 + \frac{1}{2}\sigma^2 + \frac{1}{8}\sigma^4 + \frac{1}{48}\sigma^6 + \ldots\\&#xA;&amp;amp;= \frac{1}{0!}\left(\frac{\sigma^2}{2}\right)^0&#xA;+ \frac{1}{1!}\left(\frac{\sigma^2}{2}\right)^1&#xA;+ \frac{1}{2!}\left(\frac{\sigma^2}{2}\right)^2&#xA;+ \frac{1}{3!}\left(\frac{\sigma^2}{2}\right)^3&#xA;+ \ldots \\&#xA;&amp;amp;= e^{\frac{\sigma^2}{2}}&#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So we get back&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align}&#xA;\mathbb{E}[Z] &amp;amp;= e^\mu\sum\limits_{k=0}^{\infty} \frac{1}{k!}\mathbb{E}[Y^k]\\&#xA; &amp;amp;= e^\mu e^{\frac{\sigma^2}{2}}\\&#xA; &amp;amp;= e^{\mu +\frac{\sigma^2}{2}}\\&#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Geometric Average&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the below, the sum is product/sums are over the whole time period, which then cancels out with the reciprocal power.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align}&#xA;\mathbb{E} \left[ \left( \prod_{i=0}^n a_i \right)^{\frac{1}{n}} \right] =&amp;amp; \mathbb{E} \left[ \left( \prod_{i=0}^n e^{(\mu -\frac{1}{2}\sigma^2)\mathrm{d}t + \sigma \mathrm{d}W} \right)^{\frac{1}{n}} \right] \\&#xA;=&amp;amp; \mathbb{E} \left[ \left( e^{\sum_{i=0}^n (\mu -\frac{1}{2}\sigma^2)\mathrm{d}t + \sigma \mathrm{d}W } \right)^{\frac{1}{n}} \right]\\&#xA;=&amp;amp; e^{-\frac{1}{2}\sigma^2} \mathbb{E} \left[ \left( e^{ \mu + \sigma \tilde{X}} \right) \right]\\&#xA;\end{align}&#xA;$$&#xA;Which is essentialyl just the above, but with the extra negative of half the variance - i.e the difference you're looking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It happens because the mean you're looking at is the geometric mean of the expected returns, which are essentially the arithmetic means of the stochastic process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is that what you were after? Or you want it more fleshed out?&lt;/p&gt;&#xA;" OwnerUserId="19663" LastEditorUserId="19663" LastEditDate="2017-05-01T21:19:37.660" LastActivityDate="2017-05-01T21:19:37.660" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33775" PostTypeId="2" ParentId="33770" CreationDate="2017-04-20T08:10:35.590" Score="1" Body="&lt;p&gt;You could try &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.431.295&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Market-maker, inventory control and&#xA;foreign exchange dynamics&lt;/a&gt; by Westerhoff and follow the references...&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2017-04-20T08:10:35.590" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33776" PostTypeId="1" AcceptedAnswerId="33778" CreationDate="2017-04-20T09:41:54.937" Score="4" ViewCount="757" Body="&lt;p&gt;I am reading through documentation related to Funding Valuation Adjustments (FVA) which discuss risk free rate and funding matters and the following question came to my mind: in risk neutral valuation theory, why do we require the risk free rate to be risk free? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed, let's assume a Black-Scholes framework but with a stochastic risk free interest rate, whose dynamics are specified by the Hull-White model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;&amp;amp; dS_t = \mu S_tdt + \sigma_S S_tdW_t^{(S)}&#xA;\\[6pt]&#xA;&amp;amp; dr_t = (\theta_t-\alpha r_t) dt + \sigma_rdW_t^{(r)}&#xA;\\[6pt]&#xA;&amp;amp;dW_t^{(S)}\cdot dW_t^{(r)}=\rho_{S,r}dt&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way I see it is that the risk free rate is supposed to be free of &lt;em&gt;credit risk&lt;/em&gt; $-$ indeed, in a stochastic rate framework, this rate has nonetheless market risk. However, &lt;em&gt;nowhere in the specifications of the above model does credit risk appear&lt;/em&gt;: it seems to me that $(r_t)_{t \geq 0}$ could represent &lt;strong&gt;&lt;em&gt;any&lt;/em&gt;&lt;/strong&gt; rate process. I see 2 situations where it could really make sense to speak about a risk free rate:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;In the original Black-Scholes world, the risk free rate is indeed free of risk because it is the unique process which &lt;em&gt;does not have a random component&lt;/em&gt; $-$ it is constant, hence additionally it is also free from &lt;em&gt;market&lt;/em&gt; risk.&lt;/li&gt;&#xA;&lt;li&gt;If we were modelling asset prices $(S_t)_{t \geq 0}$ with some jump component $-$ to represent default $-$ and the risk free rate was the &lt;em&gt;unique&lt;/em&gt; price process free from this credit risk, then it seems it would also make sense to speak about a risk free rate.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Generally speaking, it seems to me that we can speak of risk free rate when the process $(r_t)_{t \geq 0}$ &lt;em&gt;lacks a type of risk that all other assets have&lt;/em&gt; $-$ market risk, credit risk. However, I have the impression that in practice the 2 modelling choices above are not common: jump processes are not widely used for pricing, and complex, hybrid and long-dated derivatives tend to be priced with stochastic rates if I am not mistaken.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence it seems like $(r_t)_{t \geq 0}$ could very well be anything, for example and importantly the option hedger's cost of funding. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only characteristic I can think of the risk free rate that might justify its importance is the assumption that any market participant can lend and borrow (without limit) at that rate $-$ hence it represents some sort of &quot;average&quot; or &quot;market&quot; funding rate, like Libor for example. But this does not mean it should be risk free; it does not justify the name of the rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Why then stress so much the &lt;em&gt;risk free&lt;/em&gt; part, why does the rate need to be free from risk? Couldn't the process $(r_t)_{t \geq 0}$ simply represent the option writer's cost of funding? What am I missing?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;P.S.&lt;/strong&gt;: note that I am not asking why there should be a risk free rate; rather, I am asking why, within the framework of option risk neutral valuation, we have required the &quot;reference&quot; rate under which we discount cash flows in the valuation measure $\mathbb{Q}$ to be free from risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit 1&lt;/strong&gt;: my question is a theoretical one mostly. From a practical point of view, my thinking is that the choice of rate used for discounting under $\mathbb{Q}$ $-$ hence to price derivatives $-$ is mostly driven by &lt;em&gt;funding considerations&lt;/em&gt;; happily, in a collateralised environment, these funding rates (OIS, Fed Funds) happen to be good proxies for a risk free rate and so there is a matching between theory and practice $-$ maybe my thinking/belief here is wrong.&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-04-20T11:18:17.287" LastActivityDate="2017-04-20T11:18:17.287" Title="Why must the risk free rate be free from risk in risk neutral valuation?" Tags="&lt;black-scholes&gt;&lt;risk-free&gt;&lt;risk-neutral&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33778" PostTypeId="2" ParentId="33776" CreationDate="2017-04-20T10:59:52.280" Score="3" Body="&lt;p&gt;A non academic answer:  In the real world, when dealers or professional counterparties trade options with each other, the option premium is not funded by the dealer's unsecured borrowing.  Rather, options and other derivatives are usually subject to Collateral Agreements whereby 'safe' collateral is posted to cover exposure between counterparties.  If cash collateral is posted, there needs to be an interest rate specified on the collateral balance.  In the US this is usually Fed Funds (an almost risk-free rate).  If Treasuries are posted, the implicit rate is the Treasury repo rate (also an almost risk free rate).   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, the actual interest rates associated with borrowing and lending against derivatives , stocks and bonds are in fact mostly secured rates that resemble risk-free rates.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-04-20T10:59:52.280" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33779" PostTypeId="1" CreationDate="2017-04-20T11:00:05.387" Score="4" ViewCount="290" Body="&lt;p&gt;If the pricing function $F$ satisfies the black scholes PDE, then I can obtain risk-neutral evaluation formula from Feynman-Kac.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I already have the risk-neutral evaluation formula, can I still use Feynman Kac to obtain the Black Scholes PDE? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I..e, is there a converse to Feynman-Kac?&lt;/p&gt;&#xA;" OwnerUserId="27560" LastEditorUserId="19887" LastEditDate="2017-04-20T12:01:20.940" LastActivityDate="2017-04-20T16:00:07.373" Title="Feynman-Kac converse" Tags="&lt;stochastic-calculus&gt;&lt;risk-neutral-measure&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33780" PostTypeId="2" ParentId="33779" CreationDate="2017-04-20T12:23:55.273" Score="3" Body="&lt;p&gt;If you assume that &#xA;$$ V_t = V(t,S_t;\theta) = \Bbb{E}^\Bbb{Q} \left[ e^{-\int_t^T r(s) ds} V_T \mid \mathcal{F}_t \right] $$&#xA;with $V_T = h(S_T;\theta), \Bbb{Q}-\text{a.s.}$ along with&#xA;$$ dS_t/S_t = r(t) dt + \sigma W_t^\Bbb{Q} $$&#xA;then this equivalently means that&#xA;$$ \frac{V_t}{B_t} = \Bbb{E}^\Bbb{Q} \left[ \frac{V_T}{B_T} \mid \mathcal{F}_t \right] \tag{1} $$&#xA;where we have defined $B_t = e^{\int_0^t r(s) ds}$ (let's assume $r(t)$ is deterministic in what follows without loss of generality), which is the mathematical representation of the fact that $V_t/B_t$ is a $\Bbb{Q}$-martingale. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence by the martingale &lt;em&gt;representation theorem&lt;/em&gt; we should have that (pure diffusion assumed)&#xA;\begin{align}&#xA;d\left(\frac{V_t}{B_t}\right) = f(.) dW_t^\Bbb{Q}&#xA;\end{align}&#xA;for some well-behaved function $f$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Computing the differential on the LHS using the information at hand and Itô calculus leads to ($B_t$ has finite variation) &#xA;\begin{align}&#xA;d\left(\frac{V_t}{B_t}\right) &amp;amp;= \frac{dV_t}{B_t} - \frac{V_t}{B_t^2}dB_t + 0 \,d\langle V \rangle_t + 2 \frac{V_t}{B_t^3} \underbrace{d\langle B \rangle_t}_{0} - \frac{1}{B_t^2} \underbrace{d\langle V, B \rangle_t}_{0} \\&#xA;&amp;amp;= \frac{1}{B_t} \left( dV_t - V_t r(t) dt \right) \\&#xA;&amp;amp;= \frac{1}{B_t} \left( \frac{\partial V}{\partial t} dt + \frac{\partial V}{\partial S} dS_t + \frac{1}{2} \frac{\partial^2 V}{\partial S^2} d\langle S \rangle_t - V r(t) dt \right) \\&#xA;&amp;amp;= \frac{1}{B_t} \left( \frac{\partial V}{\partial t} + \frac{\partial V}{\partial S} r(t) S + \frac{1}{2} \frac{\partial^2 V}{\partial S^2} \sigma^2 S^2 - r(t) V \right) dt + \frac{1}{B_t} \frac{\partial V}{\partial S} \sigma S dW_t^\Bbb{Q}&#xA;\end{align}&#xA;hence requiring&#xA;$$ \frac{\partial V}{\partial t}(t,S) + \frac{\partial V}{\partial S}(t,S) r(t) S + \frac{1}{2} \frac{\partial^2 V}{\partial S^2}(t,S) \sigma^2 S^2 - r(t) V = 0 $$&#xA;with $V(T,S_T) = h(S_T;\theta)$, which is precisely the pricing PDE.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="24222" LastEditDate="2017-04-20T16:00:07.373" LastActivityDate="2017-04-20T16:00:07.373" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33781" PostTypeId="5" CreationDate="2017-04-20T12:39:01.137" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2017-04-20T12:39:01.137" LastActivityDate="2017-04-20T12:39:01.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33782" PostTypeId="4" CreationDate="2017-04-20T12:39:01.137" Score="0" Body="SWAPs are a common name for exchange operations between two (or more) counter-parties with various financial instruments like cashflows (IRS), currency (XCCY), credit risk (CDS), et cetera" OwnerUserId="26284" LastEditorUserId="26284" LastEditDate="2017-04-20T19:42:29.867" LastActivityDate="2017-04-20T19:42:29.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33785" PostTypeId="1" AcceptedAnswerId="33994" CreationDate="2017-04-20T14:01:20.837" Score="3" ViewCount="202" Body="&lt;p&gt;Suppose the stochastic equation：&#xA;\begin{equation*}&#xA;d X(u)=\beta(u,X(u))d u+\gamma(u,X(u))d W(u).&#xA;\end{equation*}&#xA;Suppose $X(T)$ is the solution of above stochastic differential equation with initial condition $X(t)=x$ and $h(x)$ is a Borel-measurable function. Denote by&#xA;$$g(t,x)=E^{t,x}h(X(T))$$&#xA;We assume $E^{t,x}|h(X(T))|&amp;lt;\infty$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $X(u)$ is the solution of above  stochastic differential equation with initial condition given at time $0.$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use the &lt;code&gt;markov property&lt;/code&gt; of $X(t),$ we have existing $g(t,x)$ s.t&#xA;$$E[h(X(T))|\mathcal{F}(t)]=g(t,X(t))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is are those two $g(t,x)$ same? Since we want to use &lt;code&gt;Feynman-Kac equation&lt;/code&gt;, but I am not sure whether it is true for first&#xA;$$g(t,x)=E^{t,x}h(X(T)).$$&#xA;since the proof of &lt;code&gt;Feynman-Kac equation&lt;/code&gt; needs the martingale of $g(t,X(t)),$ but I don't think here $g(t,X(t))$ is martingale?&lt;/p&gt;&#xA;" OwnerUserId="26165" LastEditorUserId="26165" LastEditDate="2017-04-20T14:13:54.130" LastActivityDate="2017-05-01T20:15:45.530" Title="markov property for stochastic differential equation" Tags="&lt;stochastic-calculus&gt;&lt;markov&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33786" PostTypeId="2" ParentId="30218" CreationDate="2017-04-20T14:33:22.760" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Why can I price any option (even American) in a risk neutral world under the risk neutral measure? &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Imagine calculating a price from the point of view of people who are 1) risk averse or 2) risk seeking? You would come up with 2 valuations, one slightly lower than the other respectively. The risk neutral approach, takes subjective feelings about risk out of the equation&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Why can I assume that I can model the underlying stock price with the risk free rate? &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If the market mostly takes a risk neutral view of pricing and there is not much opportunity for arbitrage, then we would expect most assets to have the same payoff (i.e. stocks and t-bills)&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;And why can I only do this when pricing option? &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Options are seen as illiquid - i.e. their market prices are sticky. Much of finance is about breaking down illiquid assets into more liquid ones in order to find more accurate prices. In order to do this, we need no arbitrage, and in order to have no arbitrage we need to have precise non-subjective prices (i.e. risk neutral ones)&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;What about stock pricing in the risk neutral world?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You can do the same with stocks and bonds. Stocks can be seen as long call options on the underlying value of the company, and bonds as short put options on the underlying value of the company!&lt;/p&gt;&#xA;" OwnerUserId="7682" LastActivityDate="2017-04-20T14:33:22.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33794" PostTypeId="2" ParentId="33756" CreationDate="2017-04-20T22:24:37.563" Score="1" Body="&lt;p&gt;Keep in mind the selection is much smaller. US exchanges have thousands of relatively liquid listings, OMX Helsinki has less than 50. If you factor in correlation then on any given week you might only have a few good opportunities (vs. hundreds in a large, liquid exchange).&#xA;Currency conversion isn't an issue with a broker like IB as it's done on-the-fly. Some brokers might require you to only trade in your base currency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The positive side is that exchanges which don't get as much attention might have better opportunities as there's fewer players and you might be trading against big, slow pension funds.&#xA;The more liquid the market, the bigger the fish you're competing with.&lt;/p&gt;&#xA;" OwnerUserId="25419" LastActivityDate="2017-04-20T22:24:37.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33795" PostTypeId="2" ParentId="33603" CreationDate="2017-04-20T22:40:48.823" Score="2" Body="&lt;pre&gt;&lt;code&gt;Factor = 1 + ( Close - Adjusted Close ) / Adjusted Close;&#xA;Adjusted Open = Open / Factor&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It's important to remember that precision is lost since dividends are often given with 4 decimals and over multiple adjustments, the effect is significant. Many providers only give 2 decimals for prices which is the wrong approach when splits are taken into consideration.&lt;/p&gt;&#xA;" OwnerUserId="25419" LastEditorUserId="26547" LastEditDate="2017-04-21T07:31:19.320" LastActivityDate="2017-04-21T07:31:19.320" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33796" PostTypeId="2" ParentId="33570" CreationDate="2017-04-20T22:48:15.830" Score="0" Body="&lt;p&gt;There are many ways a stop order can trigger. Whether on last trade, double last, 2 bids/asks below stop level etc.&#xA;Hulls explanation should include that it's only triggered when the bid/ask at NBBO is below/above the specified stop price, orders that are away from the market price are irrelevant here.&lt;/p&gt;&#xA;" OwnerUserId="25419" LastActivityDate="2017-04-20T22:48:15.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33797" PostTypeId="1" AcceptedAnswerId="33800" CreationDate="2017-04-20T22:59:27.550" Score="2" ViewCount="354" Body="&lt;p&gt;I am an engineer with a good math and statistics background. I am looking for a few advanced good books on option pricing, but without the usual math jargon of sigma algebra etc. In other words, a option pricing book for engineers, heavy on math, but not with the math nuisance of pure math. Thank you.&lt;/p&gt;&#xA;" OwnerUserId="27567" LastActivityDate="2017-04-21T00:08:28.077" Title="Option pricing books for engineers" Tags="&lt;options&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33798" PostTypeId="2" ParentId="32797" CreationDate="2017-04-20T22:59:28.440" Score="2" Body="&lt;p&gt;&lt;a href=&quot;http://tsp.finra.org/finra_org/ticksizepilot/TSPilotSecurities.txt&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://tsp.finra.org/finra_org/ticksizepilot/TSPilotSecurities.txt&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The relevant field being &quot;Tick_Size_Pilot_Program_Group&quot;, Gx or C categorization. There is no formula to determine this as this rule is new, on a trial basis and the participating listings aren't chosen completely objectively. It's designed to help market making firms at the expense of retail traders.&lt;/p&gt;&#xA;" OwnerUserId="25419" LastActivityDate="2017-04-20T22:59:28.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33799" PostTypeId="2" ParentId="33797" CreationDate="2017-04-20T23:35:20.787" Score="4" Body="&lt;p&gt;well, my book Concepts and Practice of Mathematical Finance tries to take a more engineering perspective. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2017-04-20T23:35:20.787" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33800" PostTypeId="2" ParentId="33797" CreationDate="2017-04-21T00:02:27.697" Score="1" Body="&lt;p&gt;I'm an engineer myself, so maybe I'll share my experience?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're serious about financial mathematics, you should read Shreve's book. You can probably just ignore sigma fields, Borel sets etc. Most importantly you should study about the risk neutral measure. It's not an advanced book.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;@Mark's book is simple to read but the mathematics is not &quot;heavy&quot;. It's a good reference book if you don't have time to go through the details. It's not an advanced book either (written for university level).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Paul Wilmott's book is even easier to read. Very simple formulas and explanation.&lt;/p&gt;&#xA;" OwnerUserId="601" LastEditorUserId="601" LastEditDate="2017-04-21T00:08:28.077" LastActivityDate="2017-04-21T00:08:28.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33802" PostTypeId="2" ParentId="33756" CreationDate="2017-04-21T02:17:57.587" Score="2" Body="&lt;p&gt;I think you've nailed down the main points. I will only add two thoughts based on my experience with OTC trading:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Volatility&lt;/li&gt;&#xA;&lt;li&gt;The flip side of inefficiency&lt;/li&gt;&#xA;&lt;li&gt;Slippage versus impact&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The volatility on smaller, lesser known exchanges could be more intense due to greater inefficiencies. By volatility, I don't mean just day-to-day noise, but long-term dislocations and extreme swings in both price and fundamental drivers of price. Anyway, I presume inefficiencies are what you're after in the first place.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;...which leads to bullet two: &quot;markets can remain irrational for longer than you can remain solvent&quot;. Presuming you're entering an inefficient market because the long term expectancy from identifying inefficiencies is greater, there is also a darker side of inefficiency which may be hidden from plain view. The flip-side of inefficiency implies that price and expected value of price can diverge for quite some time resulting in large losses even if you are &quot;right&quot;. But then again again, the market is always right.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because implementing said strategy in an illiquid market &lt;strong&gt;&lt;em&gt;could&lt;/em&gt;&lt;/strong&gt; fundamentally change the expectation, I believe that is is important to think about the difference between slippage and impact. First, &lt;strong&gt;slippage does not equal impact&lt;/strong&gt;. I define slippage as the realized transaction price in relation to the published transaction price. For example, if my market on close order was filled at \$100.1, when the the published closing price was \$100, my order experiences slippage of 10 bps (.1%). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, market impact is an estimate for how an order changes both the short and long-term equilibrium price. As a result, impact cannot be directly observed. For example, if I had not submitted my market on close order, how would that have affected the market price? In all likelihood, the published closing price would have been less than \$100. But we cannot directly observe this, so we must infer it based on the observed instantaneous and residual relative (i.e., excess) drift in prices after such an order is placed and filled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The net result of slippage and impact are the same: an implicit cost not included in direct transaction costs. But I think that untangling this conflation is important when dealing with smaller exchanges where smaller orders can drive a huge wedge between your expectancy in some backtest versus reality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practical-speak, I would think it extremely wise to implement said strategy with close regard to impact. In reality, we cannot change the fact that impact happens, but we can improve our price realizations by never attempting to remove liquidity from an already illiquid market.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2017-04-21T02:24:23.613" LastActivityDate="2017-04-21T02:24:23.613" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33803" PostTypeId="1" AcceptedAnswerId="33805" CreationDate="2017-04-21T06:57:53.140" Score="3" ViewCount="3143" Body="&lt;p&gt;I'm reading this paper by &lt;a href=&quot;https://www.econbiz.de/archiv1/2008/58072_arbitrage-free_smoothing.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Fengler (2005)&lt;/a&gt; and have came across the below snippet. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/kJ8oj.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/kJ8oj.png&quot; alt=&quot;snippet from the paper&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;context: Implied volatiltiy surface plot has 3 dimensions IV, Strike, Time to Maturity. Author replaced Strike with Moneyness metric. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;why replace strike price with forward moneyness&lt;/li&gt;&#xA;&lt;li&gt;what is log forward moneyness or some metric of moneyness?&lt;/li&gt;&#xA;&lt;li&gt;For two calls with different maturities, what does &quot;both calls have same forward-moneyness&quot; means. Please refer page 11, proposition 2.1 for this question. I couldn't post the snippet, since i am new to this forum and have less reputations. Apologies. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance.  Loving this community. :)&lt;/p&gt;&#xA;" OwnerUserId="24395" LastEditorUserId="24222" LastEditDate="2017-04-21T07:41:38.133" LastActivityDate="2017-04-21T08:18:13.037" Title="Implied Volatility Surface - log forward moneyness" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;american-options&gt;&lt;volatility-surface&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="33804" PostTypeId="2" ParentId="4079" CreationDate="2017-04-21T07:40:18.360" Score="2" Body="&lt;p&gt;One more source now&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.katelynnsreport.com/main/query&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.katelynnsreport.com/main/query&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find the history of shares outstanding, PE, price to book value, ... every popular financial metrics, as well as history of ranking comparing to industry, sector peers.&lt;/p&gt;&#xA;" OwnerUserId="27570" LastActivityDate="2017-04-21T07:40:18.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33805" PostTypeId="2" ParentId="33803" CreationDate="2017-04-21T08:11:51.960" Score="7" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The reason is that, as shown in Proposition 2.1 of that paper, in order to exclude static calendar arbitrage, the total variance has to be strictly increasing in forward moneyness. See also the below to links for details on this result.&lt;/p&gt;&#xA;&lt;p&gt;The intuition is that for European options, only the distribution of the terminal spot price is relevant. Furthermore, &lt;span class=&quot;math-container&quot;&gt;$F_t^T = \mathbb{E}_{\mathbb{Q}} \left[ \left. S_T \right| \mathfrak{F}_t \right]$&lt;/span&gt; (under the assumptions in the paper). So two options with the same forward moneyness &lt;span class=&quot;math-container&quot;&gt;$\kappa = K_1 / F_t^T$&lt;/span&gt; are the same relative distance away from their respective forward.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I don't understand what your question is here. A metric of moneyness is a measure for how far a given strike is away from some reference level - e.g. the spot or forward.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;It means that for both of them the ratio &lt;span class=&quot;math-container&quot;&gt;$K_i / F_t^{T_i}$&lt;/span&gt; is the same. I.e. consider &lt;span class=&quot;math-container&quot;&gt;$K_1 = 110$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$F_t^{T_1} = 100$&lt;/span&gt;, and &lt;span class=&quot;math-container&quot;&gt;$F_t^{T_2} = 90$&lt;/span&gt; (e.g. because there is a dividend between &lt;span class=&quot;math-container&quot;&gt;$T_1$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$T_2$&lt;/span&gt;). Then &lt;span class=&quot;math-container&quot;&gt;$\kappa = K_1 / F_t^{T_1} = 1.1$&lt;/span&gt;. Now you solve &lt;span class=&quot;math-container&quot;&gt;$\kappa = K_2 / F_t^{T_2}$&lt;/span&gt; for &lt;span class=&quot;math-container&quot;&gt;$K_2$&lt;/span&gt; to get &lt;span class=&quot;math-container&quot;&gt;$K_2 = 99$&lt;/span&gt;. Both options are 10% out-of-the money relative to their respective forward.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;See also the following related questions and answers:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/15215&quot;&gt;How to exploit calendar arbitrage?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/24753&quot;&gt;Calendar Arbitrage in a Vol Surface&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2017-04-21T08:18:13.037" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33807" PostTypeId="1" CreationDate="2017-04-21T10:57:19.997" Score="0" ViewCount="1436" Body="&lt;p&gt;I'm looking for a formal proof that a receiver swaption is equivalent to a callable bond. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have only found some CFA Internet pages so far where this statement is considered as proven, tough I haven't seen any papers or books which proof that explicetly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions?&lt;/p&gt;&#xA;" OwnerUserId="24804" LastActivityDate="2017-09-20T20:00:22.283" Title="Receiver Swaption and Callable Bond - Literature Proof?" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;swaption&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33809" PostTypeId="1" AcceptedAnswerId="33813" CreationDate="2017-04-21T13:11:11.530" Score="1" ViewCount="188" Body="&lt;p&gt;For a portfolio of fixed income, is there a framework or model for providing a VaR-type estimate that takes into account not only market risk factors, but also the loss associated with the probability of an issue defaulting or having its rating downgraded? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;While I've seen some applications (eg CreditMetrics) that are successful in capturing default/issuer risk, these models tend to isolate the credit loss and do not capture market risk factors. If I wanted to have a single VaR estimate to capture the potential loss threshold from both credit and market risk factors for a very large fixed income portfolio, what papers or model would be a good starting point to look at?&lt;/p&gt;&#xA;" OwnerUserId="17712" LastActivityDate="2017-04-21T17:40:33.540" Title="Integrating Credit and Market VaR" Tags="&lt;credit-risk&gt;&lt;value-at-risk&gt;&lt;market-risk&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33810" PostTypeId="2" ParentId="29507" CreationDate="2017-04-21T13:29:45.727" Score="6" Body="&lt;p&gt;This is a little more complicated than the answer provided above since this is FX and the convention for determining the strike matters.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.researchgate.net/publication/275905055_A_Guide_to_FX_Options_Quoting_Conventions&quot; rel=&quot;noreferrer&quot;&gt;https://www.researchgate.net/publication/275905055_A_Guide_to_FX_Options_Quoting_Conventions&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most pairs take premium in the foreign (i.e. left hand side) currency.  This means that you are paying for an option in the underlying - like paying for an IBM call option with IBM shares - and those shares can be viewed as part of the delta - as a result most pairs use the &quot;include premium&quot; convention.  The details are in Wystup's paper and you should read it.  The math is easy and it is nice to see everytrhing spelled out for you.  The only pairs that &quot;Exclude Premium&quot; are EURUSD, GBPUSD, AUDUSD, NZDUSD - so these calculate delta in the usual way.  Also in FX for BBG, the convention is to typically use spot delta for expiries less than a year and forward delta for expiries &gt;= 1 year.  Otherwise onlyvix's answer above is fine if you assume that the foreign risk free rate is 0.0%.  The actual delta is $e^{-r_ft}N(d1)$ in the exclude premium case.&lt;/p&gt;&#xA;" OwnerUserId="26977" LastActivityDate="2017-04-21T13:29:45.727" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="33811" PostTypeId="2" ParentId="11580" CreationDate="2017-04-21T13:43:58.833" Score="3" Body="&lt;p&gt;I like parameterizations for many reasons.  Let's say you have an SPX smile with 125 strikes that can reasonably be traded.  Many parameterizations reduce these 125 strikes down to 5 parameters.  Also, the parameterizations can smooth out what can often be very noisy data on the wings.  In addition, some of these parameterizations can have parameters that can quickly give a trader an immediate intuition as to what the smile looks like.  Now imagine having a time series of volatility surfaces - these parameterizations do a nice job of condensing a massive amount data to a merely large amount of data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I tend to use the SVI parameterization (although I have found that it is very tough to fit inside of the very tight bid ask for a lot of the short dated expiries in the last couple years for SPX).  The usual parameters for SVI are not intuitive, but I can easily translate those 5 parameters into intuitive parameters such as ATM, Skew (first derivative of the smile ATM), Kurtosis (second derivative of the smile ATM), and the left hand/right hand side asymptotic slopes (SVI is linearly asymptotic in implied variance).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another cool feature of the SVI using these intuitive parameters is that I can almost surely (in the probabilistic sense) uniquely invert them back to the raw parameters used to calculate vols.  I like this because I can shock the intuitive parameters - most likely shock ATM or skew and then invert back to new raw parameters.  Shocking the vol surface helps me to understand stress risks.  The only downside with this technique is that after too big a shock, we might not be able to invert - in other words the mapping from raw svi parameters to the intuitive parameters is not surjective - a square root of a negative number will alert you to this!&lt;/p&gt;&#xA;" OwnerUserId="26977" LastEditorUserId="26977" LastEditDate="2017-04-21T13:51:25.620" LastActivityDate="2017-04-21T13:51:25.620" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="33812" PostTypeId="1" CreationDate="2017-04-21T14:19:06.847" Score="0" ViewCount="57" Body="&lt;p&gt;I read online somewhere, and I can't find it now, that to find the probability of a stock hitting a certain price within a certain time frame, we can use Implied Volatility:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;X = StockPrice * IV * SQRT(DaysTillExpire / 365)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;X&lt;/code&gt; would then be 1 standard deviation (or a +/- 34% probability)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So first, is this accurate and second, how does this work?&lt;/p&gt;&#xA;" OwnerUserId="2928" LastActivityDate="2017-04-21T14:19:06.847" Title="Is this the right formula to use implied volatility to gauge probability of a stock being within a certain range?" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;implied-volatility&gt;&lt;probability&gt;" AnswerCount="0" CommentCount="3" ClosedDate="2017-04-25T21:23:25.650" ContentLicense="CC BY-SA 3.0" />
  <row Id="33813" PostTypeId="2" ParentId="33809" CreationDate="2017-04-21T17:40:33.540" Score="1" Body="&lt;p&gt;There are many ways to do this.  Some are more computationally intense than others.  Some are more realistic than others. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to stay in CreditMetrics universe I would jointly simulate systemic variables impacting credit AND interest rate variables.  This can be done in a Gaussian setting quite easily (eg Hull White for interest rate and drift+diffusion in log systemic variables).  This method would allow correlations between interest rates and variables impacting default.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The algorithm would be roughly: simulate n systemic variables and 1 Hull White interest rate variable.  Conditional on these variables, find the total number of defaults in your time horizon of interest.  Of the remaining, recompute their market value given the realization of the interest rate variable.  Add up the final values.  This will be single realization of potential future states.  Repeat M times, take the 99 (or 99.9, or 99.97) percentile and thats the combined VaR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, this is very computationally expensive.&lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2017-04-21T17:40:33.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33814" PostTypeId="1" CreationDate="2017-04-21T17:49:13.127" Score="2" ViewCount="427" Body="&lt;p&gt;Following is from page 10 of &lt;a href=&quot;https://www.econbiz.de/archiv1/2008/58072_arbitrage-free_smoothing.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Fengler (2005)&lt;/a&gt;,  &quot;The prices of American calls for the same strikes must be nondecreasing, Merton (1973), and in the absence of dividends, this property translates to European calls as well.&quot;&lt;br&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/3XpCP.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/3XpCP.png&quot; alt=&quot;snippet from Fengler (2005)&quot;&gt;&lt;/a&gt;&#xA;I have read in this document &lt;a href=&quot;https://books.google.com/books?id=PAAAhBkeFcQC&amp;amp;pg=PA123&amp;amp;lpg=PA123&amp;amp;dq=The%20prices%20of%20American%20calls%20for%20the%20same%20strikes%20must%20be%20nondecreasing&amp;amp;source=bl&amp;amp;ots=S4Psmv_M4l&amp;amp;sig=M3xrnQcrqbCHlQSQpKZflvK_DK4&amp;amp;hl=en&amp;amp;sa=X&amp;amp;ved=0ahUKEwjtmdXyirbTAhWf8oMKHfUzALIQ6AEIIzAA#v=onepage&amp;amp;q=The%20prices%20of%20American%20calls%20for%20the%20same%20strikes%20must%20be%20nondecreasing&amp;amp;f=false&quot; rel=&quot;nofollow noreferrer&quot;&gt;Handbook of Comp Fin&lt;/a&gt; that this doesn't translate to european options since there theta can change sign, so how does no dividends affect this nature of european options.&#xA;&lt;a href=&quot;https://i.stack.imgur.com/Rk4Bi.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Rk4Bi.png&quot; alt=&quot;snippet from book&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="24395" LastActivityDate="2017-04-21T17:49:13.127" Title="American Vs European Options behavior with fixed strikes and varying expiration" Tags="&lt;implied-volatility&gt;&lt;american-options&gt;&lt;european-options&gt;" AnswerCount="0" CommentCount="9" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33817" PostTypeId="5" CreationDate="2017-04-21T19:34:58.633" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2017-04-21T19:34:58.633" LastActivityDate="2017-04-21T19:34:58.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33818" PostTypeId="4" CreationDate="2017-04-21T19:34:58.633" Score="0" Body="Credit Default Swap or CDS - a type of swap which purpose is transferring the credit exposure of fixed income products between parties. It works like an insurance policy, where protection buyer  who makes fixed periodic payments, and a protection seller, who collects the premium in exchange  for making the protection buyer whole in case of default. Most of CDSs are traded via OTC as single derivatives or index derivatives like iTraxx / Markit CDX&#xD;&#xA;" OwnerUserId="26284" LastEditorUserId="26284" LastEditDate="2017-04-21T23:25:42.817" LastActivityDate="2017-04-21T23:25:42.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33819" PostTypeId="2" ParentId="25937" CreationDate="2017-04-21T20:30:21.793" Score="0" Body="&lt;p&gt;My first thought is that it depends a lot on what resources are available. Without knowing more, it's impossible to provide any specific advice regarding model selection... unless, of course, you're willing to go &lt;strong&gt;&lt;em&gt;model-less&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I were given this problem, my first impulse would be to do a peer comparison of annual growth. Since a peer group should respond to similar macro-economic inputs in similar ways, the relative normalized difference should be indicative of whether any out-performance is due to firm-specific factors (e.g., good management; good strategy; good sales people; a superior product; etc..).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I presume isolating firm specific factors is indeed your goal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so, and if I had access to a relevant peer group's revenue data, I could simply difference the annualized logarithmic growth rates over some number of years to arrive at an excess growth rate. Logs are generally appropriate for non-negative top-line numbers. I.e.,:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb{E}[\Delta g] = \sum_n^N (\ln(S_{a,n}) - \ln (S_{a,n-1})) - (\ln(S_{M,n}) - \ln (S_{M,n-1}))  \frac{1}{N}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Delta g$ is the excess logarthmic growth rate of company $a$'s revenues versus a peer group aggregate's ,$M$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The peer group's revenues, $S_M$, are simply an aggregation of its constituents.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The resultant metric, $\Delta g$, could then be standardized in any numerous ways. For example, a vector of annual excess growth rates could be fitted to a line from whence r-squared might come into play. Also, the metric over its standardized error, $\frac{\mathbb{E}[\Delta g]}{\sqrt{\mathbb{E}[\Delta g]^2}}$, would provide a standardized score. Presuming normality, this score could be fed into a cumulative density function to give a p-value for how likely your firm's out-performance is due chance versus its peer group. The assumption here being that statistically significant out-performance is more likely to persist going forward, vis-a-vis, a &quot;forecast&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I personally favor this sort of &lt;strong&gt;&lt;em&gt;weak model&lt;/em&gt;&lt;/strong&gt; approach over standard econometric approaches because the amount calibration and &lt;em&gt;parameterization&lt;/em&gt; required is effectively zero. To paraphrase a common axiom, &lt;strong&gt;&lt;em&gt;&quot;it's better to have a weak model which is approximately right than a strong one which is exactly wrong&quot;&lt;/em&gt;&lt;/strong&gt;. &lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2017-04-21T22:06:00.690" LastActivityDate="2017-04-21T22:06:00.690" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33820" PostTypeId="1" CreationDate="2017-04-21T20:45:35.300" Score="-2" ViewCount="68" Body="&lt;p&gt;I want to understand the logic for why this is: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;We have our model for the stock price behaviour:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d{S_t} = \mu {S_t}dt + \sigma {S_t}d{\tilde W_t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;It describes the development of a stock price over time using the risk-adjusted expected return $\mu$ and the real uncertainty in the stochastic term.&lt;/em&gt;&#xA;&lt;em&gt;We want to change the probability measure in such a way that the stochastic process remains a Brownian motion but with a drift of &lt;strong&gt;r&lt;/strong&gt; instead of $\mu$. .... To repeat the manner of speaking, we want the process to change gear from an instantaneous increase of $\mu$ to &lt;strong&gt;r&lt;/strong&gt; and leave the rest as before&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d{S_t} = r{S_t}dt + \sigma {S_t}d{\tilde W_t}$$&lt;/p&gt;&#xA;" OwnerUserId="27241" LastActivityDate="2017-04-21T20:53:03.313" Title="Why changing measure is necessary?" Tags="&lt;brownian-motion&gt;&lt;risk-neutral-measure&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2017-04-25T21:22:53.643" ContentLicense="CC BY-SA 3.0" />
  <row Id="33821" PostTypeId="2" ParentId="33820" CreationDate="2017-04-21T20:53:03.313" Score="1" Body="&lt;p&gt;they change the measure to get the arbitrage free price.&#xA;Check the link below, or have a look at Hull for an easy introduction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Risk-neutral_measure&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Risk-neutral_measure&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2017-04-21T20:53:03.313" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="33823" PostTypeId="1" AcceptedAnswerId="33824" CreationDate="2017-04-21T21:27:38.837" Score="2" ViewCount="60" Body="&lt;p&gt;If I ask a sell-side desk &quot;A&quot; for a &quot;valuation&quot; of a relatively simple OTC product (equity derivative, or 1st generation equity exotic), what are the reasons/main reason why a different sell-side desk &quot;B&quot; (at some other bank) would arrive at a different valuation for exactly the same product?&lt;/p&gt;&#xA;" OwnerUserId="26367" LastActivityDate="2017-04-22T11:45:15.267" Title="Factors that make sell-side valuations of equity derivatives differ" Tags="&lt;derivatives&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33824" PostTypeId="2" ParentId="33823" CreationDate="2017-04-21T21:33:38.027" Score="3" Body="&lt;p&gt;Pricing these products is subject to different models.  One bank might calibrate their vol surfaces slightly differently and have different skews on their respective smiles.  Also, one bank might assume a slightly different stochastic process in their model for the pricing - or use the same model, but calibrated with different parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly, If I already am very very long a lot of SPX gamma, I probably don't want to buy a short dated digital near the money from you - I would probably prefer to sell it to you to unload some gamma - and I will show you prices according to my preference - of course if you buy from me immediately, no questions asked, I may suspect that I was a bit low and move the price up a bit afterwards.&lt;/p&gt;&#xA;" OwnerUserId="26977" LastActivityDate="2017-04-21T21:33:38.027" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33825" PostTypeId="1" AcceptedAnswerId="33828" CreationDate="2017-04-21T22:03:26.667" Score="0" ViewCount="708" Body="&lt;p&gt;I have a complicated product with knock-out barriers combined with other exotic options. I am curious if there is a fast and loose way to figure out the delta, gamma, rho, theta and possibly vega, with the historical prices of the product.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I mean, I would calculate the greeks by hand since it isnt impossible to write them out in a formula, but it would be a hideous expression, and my basic calculus skills are rusty. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, is there a relatively simple way to get the sensitivities from historical prices? Can I just simply do&#xA;$$&#xA;\frac{\Delta P}{\Delta S}&#xA;$$&#xA;with the historical underlying and historical option price for the delta, for instance? Would this be similar to what I would get by differentiating the price formula?&lt;/p&gt;&#xA;" OwnerUserId="27302" LastActivityDate="2017-04-21T23:42:34.927" Title="Finding the delta and gamma with historical data" Tags="&lt;historical-data&gt;&lt;greeks&gt;&lt;exotics&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33826" PostTypeId="1" AcceptedAnswerId="33829" CreationDate="2017-04-21T22:18:15.777" Score="-1" ViewCount="183" Body="&lt;p&gt;Underlying = 100&#xA;K = 90&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 year Put at K is trading 5. What's the approximate delta of the put?&lt;/p&gt;&#xA;" OwnerUserId="747" LastActivityDate="2017-04-21T23:44:33.363" Title="Estimate Options Delta By Hand" Tags="&lt;options&gt;&lt;volatility&gt;&lt;greeks&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2017-04-22T15:36:11.653" ContentLicense="CC BY-SA 3.0" />
  <row Id="33827" PostTypeId="1" CreationDate="2017-04-21T23:00:52.120" Score="8" ViewCount="5585" Body="&lt;p&gt;I have a EUR-GBP cross currency swap, collateralised in GBP, each leg is paying 3m EURIBOR/LIBOR respectively. I know GBP leg can be modelled with 3m LIBOR forward curve and GBP OIS discount curve. How about the EUR leg?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I heard there are two approaches:&#xA;1. 3m EURIBOR as forward curve, and the discount curve should be EUR IOS adjusted with EUR vs GBP spread.&#xA;2. 3m EURIBOR adjusted with EUR vs GBP spread as the forward curve, and the discount curve should be GBP OIS&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure if both above are accurately described, as I am not familiar with such trades. Can anyone share some insights and explain if any/both of them are correct? Many thanks.&lt;/p&gt;&#xA;" OwnerUserId="27579" LastActivityDate="2018-05-20T22:02:04.207" Title="Forward and discount curves for cross currency swaps" Tags="&lt;swaps&gt;&lt;valuation&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="33828" PostTypeId="2" ParentId="33825" CreationDate="2017-04-21T23:42:34.927" Score="1" Body="&lt;p&gt;The observed time series of the historical option price would give you a time series of $\Delta P$, however these changes in price is not purely driven by change in spot. You also have the impact of change of vol and theta:&#xA;$\Delta P \approx \Delta *\Delta S + 0.5 * \Gamma * \Delta S^2 + vega*\Delta \sigma + \theta$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming that you would know the change of spot, rate and vol. You still have only 1 equation with many unknown greeks (so no unique solution).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, you have the problem that the answer to your problem depends on the moneyness of your option, distance to the barriers, time to expiry etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would it maybe be a solution for you to approximate your very exotic product by a combination of simpler products? You do an overhedge/underhedge etc.&lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2017-04-21T23:42:34.927" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33829" PostTypeId="2" ParentId="33826" CreationDate="2017-04-21T23:44:33.363" Score="2" Body="&lt;p&gt;assuming you don't have a black scholes pricer, or don't want to rely on a pricer... the following book contains many of the &quot;rule of thumbs&quot;  that you are seeking:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.amazon.de/Calculate-Options-Prices-Their-Greeks-ebook/dp/B00WBJN75I/ref=sr_1_2?ie=UTF8&amp;amp;qid=1492818200&amp;amp;sr=8-2&amp;amp;keywords=ursone&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.amazon.de/Calculate-Options-Prices-Their-Greeks-ebook/dp/B00WBJN75I/ref=sr_1_2?ie=UTF8&amp;amp;qid=1492818200&amp;amp;sr=8-2&amp;amp;keywords=ursone&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17316" LastActivityDate="2017-04-21T23:44:33.363" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33830" PostTypeId="1" AcceptedAnswerId="33844" CreationDate="2017-04-22T02:32:15.927" Score="0" ViewCount="112" Body="&lt;p&gt;Let's say I have two time-series S1 and S2 where S1 looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Epoch timestamp |value&#xA;1492827582,      100&#xA;1492827782,      127&#xA;1492827982,      135&#xA;1492828082,      200&#xA;...              ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and S2 looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Epoch timestamp |value&#xA;1492827133,      50&#xA;1492827333,      155&#xA;1492827533,      156&#xA;1492827933,      300&#xA;...              ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What is the most straightforward method to produce some kind of similarity value? I am mainly interested in seeing how the growth is. Don't really care about the absolute values -- just want to have a sense of how similar the curve shapes are. Please note that the timestamps are slightly offset with a slightly different stepping but generally very close. I have heard about cross-correlation approaches but they seem like an overkill. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much  for reading this!&lt;/p&gt;&#xA;" OwnerUserId="27581" LastActivityDate="2017-04-23T13:07:17.217" Title="Two time series similarity with slightly offset timestamps" Tags="&lt;time-series&gt;&lt;correlation&gt;" AnswerCount="1" CommentCount="2" ClosedDate="2017-04-24T17:15:11.177" ContentLicense="CC BY-SA 3.0" />
  <row Id="33831" PostTypeId="1" CreationDate="2017-04-22T04:38:30.960" Score="4" ViewCount="733" Body="&lt;p&gt;Any explanation I've found explaining why future and spot prices converge over time seem to only focus the explanation on why the spot and future price must be equal at maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that if the prices aren't the same at maturity, then an arbitrage opportunity will exist. But what's the explanation for the trend of convergence prior to maturity? I originally thought that this might be because the cost of carry decreases as time to maturity decreases, but doesn't this price behaviour hold true for non-commodity futures as well?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="27556" LastEditorUserId="27497" LastEditDate="2017-04-22T10:02:09.173" LastActivityDate="2017-04-22T12:04:50.433" Title="Convergence of Spot and Futures prices" Tags="&lt;finance&gt;&lt;futures&gt;&lt;financial-markets&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33832" PostTypeId="2" ParentId="33831" CreationDate="2017-04-22T08:56:52.017" Score="5" Body="&lt;p&gt;The trend of convergence is also due to arbitrageurs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Prior to maturity, when the spot is higher than futures, arbitrageurs would short the underlying asset and long futures contracts. This in effect reduces the spot price due to increase in supply while raising the futures price due to increase in demand.&lt;/p&gt;&#xA;" OwnerUserId="27497" LastActivityDate="2017-04-22T08:56:52.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33834" PostTypeId="2" ParentId="33831" CreationDate="2017-04-22T12:04:50.433" Score="4" Body="&lt;p&gt;Let’s start with a &lt;strong&gt;forward&lt;/strong&gt; contract on some asset $S_t$ with no carry. There, it is obvious that at any point in time $F_t = \mathbb{E}^{Q_t}[S_T] = S_t e^{r(T-t)}$. You can see that  $F_t/S_t = e^{r(T-t)} \to 1$ as $t \to T$. If you have a &lt;strong&gt;future&lt;/strong&gt; contract, then you have to start thinking about margin requirements and the possibility that the daily risk-free rate can be different from the rate at which you entered in the trade. Nonetheless this should be relevant only for futures on Fixed Income and FX.&lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2017-04-22T12:04:50.433" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33836" PostTypeId="2" ParentId="33770" CreationDate="2017-04-22T14:09:05.103" Score="1" Body="&lt;p&gt;Arguably the top 3 anomalies for FX (at low frequencies, i.e not HFT) are Carry, Momentum and Value, which are found in some markets other than FX as well. There is a &lt;em&gt;vast&lt;/em&gt; literature on these.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Carry I recommend a survey by Swinkels &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2060207&quot; rel=&quot;nofollow noreferrer&quot;&gt;Empirical Evidence on the Currency Carry Trade, 1900-2012&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Momentum in FX this link is good &lt;a href=&quot;http://quantpedia.com/Screener/Details/8&quot; rel=&quot;nofollow noreferrer&quot;&gt;Quantpedia: FX Momentum&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Value&quot; in FX is generally equivalent with Relative Purchasing Power Parity, again Quantpedia has an overview &lt;a href=&quot;http://quantpedia.com/Screener/Details/9&quot; rel=&quot;nofollow noreferrer&quot;&gt;Quantpedia: FX Value - PPP&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is a huge area you ask about, too big to address really without knowing what you are trying to do. If you want a single overview of FX strategies a source also referenced in several of the above links is &lt;a href=&quot;http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2571391&quot; rel=&quot;nofollow noreferrer&quot;&gt;Levich: A New Look at Currency Investing&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One final warning: it is a lot more difficult to put into practice these ideas, and a lot more controversial how well they work, than these references make it seem.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2017-04-22T14:14:11.340" LastActivityDate="2017-04-22T14:14:11.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33837" PostTypeId="1" CreationDate="2017-04-22T19:43:24.403" Score="1" ViewCount="150" Body="&lt;p&gt;Say we have the following two SDEs driven &lt;em&gt;by the same single Brownian&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dx_t = -0.5\sigma^2g(\psi)^2dt + \sigma g(\psi)dW_t    \quad\quad  d\psi_t = -(H\psi_t+0.5\sigma^2)dt + \sigma dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $x_t$ is the asset log-price process with variable volatility and $\psi_t$ is an OU process connected to that same driving noise.  $H&amp;gt;0$ is the mean-reversion speed of $\psi$, $\sigma&amp;gt;0$ is a constant and &#xA;$$ g(\psi) = 1_{\psi \in (a,b)}\quad\quad a&amp;lt;0&amp;lt;b$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to calculate the univariate &lt;em&gt;affine&lt;/em&gt; characteristic function of $x_t$ i.e. $$\phi(u,\tau) = \mathbb{E}(e^{iux_T}|x_t,\psi_t) = e^{iux_t+\beta(u,\tau)\psi_t+\gamma(\tau)} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think I have multiple issues:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$g(\psi)$ needs to be continuous - but we can use a continuous approximation such as $$g_n(\psi) = \frac{1}{1+(2\frac{\psi-a}{b-a}-1)^{2n}}$$&lt;/li&gt;&#xA;&lt;li&gt;If $g$ is anything but a linear function of $\psi$ (and therefore unable to exhibit the properties that I am looking for), I cannot get the system in affine form &#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I end up with the characteristic function looking like $\phi(u,\tau) =  e^{iux_t+\beta(u,\tau,\psi)} $ which is leaving me with a system of ODEs that don't suggest a closed-form solution&lt;/li&gt;&#xA;&lt;li&gt;I have tried &lt;em&gt;ansatz&lt;/em&gt; approaches such as $\beta(u,\tau,\psi) = \alpha(u,\tau)\phi(u,\psi)$ but to no avail&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Bottom line I am now getting stuck - I can use PDE methods on the above system to price options on $x_t$ but it requires three spatial dimensions and requires excessive calculation time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have any ideas on how to deal with coupled systems with non-constant coefficients such as this?&lt;/p&gt;&#xA;" OwnerUserId="27516" LastEditorUserId="24222" LastEditDate="2017-04-22T20:23:04.420" LastActivityDate="2017-04-22T20:23:04.420" Title="Characteristic function of SDE with coefficients depending upon second coupled SDE" Tags="&lt;option-pricing&gt;&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;sde&gt;&lt;characteristic-function&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33838" PostTypeId="2" ParentId="33807" CreationDate="2017-04-22T19:56:08.677" Score="2" Body="&lt;p&gt;A receiver option is definitely not the same thing as a callable bond.  The latter is a security, with an issuer which may default, for one thing.  However, there is a connection, as follows:  a 10yr bond with a coupon of K and a single call option after one year is economically similar to a 10 year non callable bond with a coupon of K minus a 1yr into 9yr receiver swaption struck at K.  Thus, the issuer's option to call the bond is economically similar to a receiver swaption.  This is only an approximation - the issuer's &quot;credit spread&quot; is a factor in valuing callable bonds but it does not affect the value of the receiver swaption.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-04-22T19:56:08.677" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33839" PostTypeId="1" CreationDate="2017-04-23T00:04:18.707" Score="1" ViewCount="1480" Body="&lt;p&gt;I would like to conduct a study where I build a factor model based on the characteristics/variables I have collected about firms, using a couple of countries.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have acquired two Excel data files from CompuStat :&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Monthly index prices (MSCI WORLD INDEX) (1950-2017)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Monthly financial statement data (like P / E ratio, B / P ratio) of different firms over the period 1950-2017. The companies all have a company key (GVKEY) as a filter option in Excel.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So I think I first need to merge the data based on the GVKEY and date. That would not be any problem, but the main problems are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Some companies do not have values ​​for one or more variables at certain time points and not all firms have the time period 1950-2017, some start at 1993 for example.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Does anyone have any suggestions of how to deal with the problem and merging the data and how I can conduct my study? Does someone have a step-by-step plan or something for me? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could this task be as simple as regressing average returns for a stock with its different factors? I heard that I need to do something with creating risk factors through regressions, making portfolio's and sorting on characteristics and using something like a fama-macbeth regression. The problem is that I do not know the hard-programming to figure out how to construct portfolio's etc..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd be grateful for any help, I want to use STATA!&lt;/p&gt;&#xA;" OwnerUserId="27532" LastActivityDate="2018-06-19T12:52:32.220" Title="How to build Factor model like Fama &amp; French (2014)?" Tags="&lt;finance&gt;&lt;statistics&gt;&lt;factor-models&gt;&lt;capm&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33840" PostTypeId="1" AcceptedAnswerId="33845" CreationDate="2017-04-23T01:56:34.897" Score="1" ViewCount="5137" Body="&lt;blockquote&gt;&#xA;&lt;p&gt;Corporation &lt;span class=&quot;math-container&quot;&gt;$A$&lt;/span&gt; has an excellent credit rating and can borrow at a fixed rate of &lt;span class=&quot;math-container&quot;&gt;$5\%$&lt;/span&gt; or a floating rate of LIBOR + &lt;span class=&quot;math-container&quot;&gt;$1\%$&lt;/span&gt;. Corporation &lt;span class=&quot;math-container&quot;&gt;$B$&lt;/span&gt; has a somewhat less excellent credit rating and can borrow at a fixed rate of &lt;span class=&quot;math-container&quot;&gt;$7\%$&lt;/span&gt; or a floating rate of LIBOR + &lt;span class=&quot;math-container&quot;&gt;$2.5\%$&lt;/span&gt;. Both firms wish to borrow &lt;span class=&quot;math-container&quot;&gt;$10,000,000$&lt;/span&gt; for &lt;span class=&quot;math-container&quot;&gt;$3$&lt;/span&gt; years and &lt;span class=&quot;math-container&quot;&gt;$A$&lt;/span&gt; would rather borrow at a floating rate and &lt;span class=&quot;math-container&quot;&gt;$B$&lt;/span&gt; would prefer to borrow at a fixed rate.&lt;/p&gt;&#xA;&lt;p&gt;What are the comparative-advantages and total gains that &lt;span class=&quot;math-container&quot;&gt;$A$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$B$&lt;/span&gt; could attain if they engaged in a swap contract&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;The solution to this from what I have been provided is &lt;span class=&quot;math-container&quot;&gt;$$\Delta \ \text{fixed}(B-A) - \Delta \ \text{float} (B-A) = (7-5) - ((L+2.5) - (L+1)) = .5$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;I do not understand this at all, if anyone could give me some insight and provide a detailed solution I would greatly appreciate it.&lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2017-04-23T14:14:03.990" Title="Swap contract comparative advantage" Tags="&lt;swaps&gt;&lt;mathematics&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33841" PostTypeId="2" ParentId="18215" CreationDate="2017-04-23T09:00:34.473" Score="2" Body="&lt;p&gt;You can try here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.backtestmarket.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.backtestmarket.com&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;it is a good provider for historical data both for Futures and Forex. Prices are really affordable and it is possible to get free data samples to check whether they are good or not for you &lt;/p&gt;&#xA;" OwnerUserId="27600" LastActivityDate="2017-04-23T09:00:34.473" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33842" PostTypeId="1" AcceptedAnswerId="33868" CreationDate="2017-04-23T11:06:56.067" Score="1" ViewCount="142" Body="&lt;p&gt;I've just started studying derivatives from the &quot;Options, futures, and other derivatives - J.C. Hull&quot; and I'd like to see how to do hedging and trading transactions through a simulation platform or a demo account. What do you recommend me?&lt;/p&gt;&#xA;" OwnerUserId="27078" LastEditorUserId="185" LastEditDate="2017-04-23T13:04:02.437" LastActivityDate="2017-04-24T20:09:15.020" Title="What is the best trading simulation platform for futures, swaps, options, etc.?" Tags="&lt;finance&gt;&lt;trading&gt;&lt;derivatives&gt;&lt;hedging&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33844" PostTypeId="2" ParentId="33830" CreationDate="2017-04-23T13:07:17.217" Score="1" Body="&lt;p&gt;It looks like a good case to use &lt;a href=&quot;https://en.wikipedia.org/wiki/Dynamic_time_warping&quot; rel=&quot;nofollow noreferrer&quot;&gt;Dynamic Time Warping&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2017-04-23T13:07:17.217" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33845" PostTypeId="2" ParentId="33840" CreationDate="2017-04-23T14:14:03.990" Score="5" Body="&lt;p&gt;It is actually rather simple.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets start with the fixed rate market. A can borrow at 5% while B can borrow at 7%. Simply said, A has a comparative advantage of 2% in the fixed rate market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the floating rate market, A borrows at LIBOR + 1% while B borrows at LIBOR + 2.5%. From here, I'm guessing you already know that A has the comparative advantage as well of 1.5%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now by this 2 factors, we can automatically assume that A will borrow in the Fixed rate market due to higher comparative advantage while B will borrow from the floating rate market to not lose out so much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question you are asked is simply asking what is the total gains both A and B would get if they were to be engaged in a swap. The answer is simply the difference in the credit spread between the two markets, 2% - 1.5% = 0.5%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that 0.5% is the TOTAL gains from the swap. If they were to spread the gains equally, it would mean A would enjoy 0.25% cost savings in the floating rate market while B would also enjoy 0.25% cost savings in the fixed rate market using the swap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The swap can easily be conducted using the following steps:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) A borrows 10,000,000 from fixed market at 5%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) B will pay A monthly fixed interest payments of 6.75%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the net effect here is that B essentially pays fixed payment of 0.25% less than he would have without the swap. A gains a total of 1.75% from this cash flow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) B borrows 10,000,000 from the floating market at LIBOR + 2.5%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) A pays B monthly floating interest payments of LIBOR + 2.5%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From this cash flow, B has a net effect of 0 in the floating rate payments. A will then use the 1.75% gains in the previous cash flow to offset the cash flow here, enabling A to pay only LIBOR + 0.75% monthly. A essentially pays 0.25% less than he would have without the swap as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The swap thus allows both parties to gain from the credit spread of 0.5% equally.&lt;/p&gt;&#xA;" OwnerUserId="27497" LastActivityDate="2017-04-23T14:14:03.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33847" PostTypeId="1" CreationDate="2017-04-23T15:02:41.923" Score="-1" ViewCount="192" Body="&lt;p&gt;I am working on a project and I am trying to evaluate an FX option with EUR/GBP underlying. As the EURIBOR is negative, how can I do the pricing? I know I have to transform the interest rate, to switch to a continous interest rate (so I should apply log). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please help me on this. Also, if you have codes for Black-Scholes, Vanna-Volga, Heston, I would really appreciate if you could share them with me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="27607" LastActivityDate="2017-04-24T14:31:15.273" Title="Modeling FX option in a negative interest rate environment" Tags="&lt;options&gt;&lt;fx&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33848" PostTypeId="2" ParentId="33502" CreationDate="2017-04-23T15:09:07.597" Score="2" Body="&lt;p&gt;You have Daily returns $x_{i}$ with $i = 1 \ldots N$ and lets call the corresponding yearly returns $a_{i} = \sum_{j=i}^{i+250}{x_{j}}$ with $i = 1 \ldots N-250$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The $x_{i}$ are i.i.d. with standard derivation $\sigma_{x}$ and expected value $m_{x}$. For the $a_{i}$ we get than a standard derivation of $\sigma_{a} = \sqrt{250} * \sigma_{x}$ and a expected value of $m_{a} = 250 \cdot m_{x}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I understand you correctly you are comparing the following two approaches to estimate the 1 year standard derivation $s_{a}$:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;$s_{a} = \sqrt{\frac{250}{N-1} \cdot \sum_{i=1}^{N}{(x_{i}-\bar{x})^{2}}} = \sqrt{250} \cdot s_{x}$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$s_{a} = \sqrt{\frac{1}{N-250-1} \cdot \sum_{i=1}^{N-250}{(a_{i}-\bar{a})^{2}}}$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Approach 1 is correct if the $x_{i}$ are truly independent. In the real world that is often only approximatly true. Nevertheless it is a very popular approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you suspected, approach 2 is seriously flawed. The problem is, that the $a_{i}$ are not independent by design, which means the standard formula for estimating the standard deviation does not apply. $a_{i}$ and $a_{i+1}$ overlap in 249 $x_{i}$ and are therefore heavily dependent. The autocorrelation function $\rho_{k}$ which is the correlation between any $a_{i}$ and $a_{i+k}$ is for $k &amp;lt; 250$ given by&#xA;$$\rho_{k} = corr(a_{i}, a_{i+k}) = (1- \frac{k}{250}) \cdot $$&#xA;For $k \geq 250$ it's $\rho_{k} = 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see in &lt;a href=&quot;https://en.wikipedia.org/wiki/Unbiased_estimation_of_standard_deviation&quot; rel=&quot;nofollow noreferrer&quot;&gt;wikipedia&lt;/a&gt; in the presence of autocorrelation in the sample your result will be distorted like&#xA;$$E(s^{2}) = s_{a} \cdot \left[ 1 - \frac{2}{N-250-1} \cdot \sum_{k=1}^{N-250}(1-\frac{k}{N-250}) \cdot \rho_{k}  \right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which becomes in the case of the above auto correlation function:&#xA;$$E(s^{2}) = s_{a} \cdot \left[ 1 - \frac{2}{N-250-1} \cdot \sum_{k=1}^{250}(1-\frac{k}{N-250}) \cdot (1-\frac{k}{250})  \right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you can see is that using approach 2 the estimate of the standard derivation will always be lower than the true value. The error will be smaller though the bigger your sample is compared to your aggregation interval. So if you have data from e.g. 50 years, the error of approach 2 might disappear.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another approach might be to use only $a_{i}$ that don't overlap, i.e. use every 250 value. But than you loose a lot of information. In your example with a sample size of 500 you end up with just two values to estimate the standard deviation from.&lt;/p&gt;&#xA;" OwnerUserId="22686" LastActivityDate="2017-04-23T15:09:07.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33849" PostTypeId="2" ParentId="33847" CreationDate="2017-04-23T15:42:33.897" Score="3" Body="&lt;p&gt;It shouldn't be a problem.  You are taking log(1+rate) not log of rate itself. &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-04-23T15:42:33.897" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33850" PostTypeId="1" CreationDate="2017-04-23T17:07:05.163" Score="0" ViewCount="167" Body="&lt;p&gt;Given a set of correlated securities and their corresponding closing prices, I am looking for a way to construct an index of these securities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When applying PCA to obtain the principal components, how can I use or understand the output to construct an index?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance in matlab:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[coeff,score,latent,tsquared,explained,mu] = pca(prices)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13334" LastActivityDate="2017-04-23T17:07:05.163" Title="PCA and constructing an index" Tags="&lt;programming&gt;&lt;index&gt;&lt;pca&gt;&lt;principal-components&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33852" PostTypeId="2" ParentId="33743" CreationDate="2017-04-23T18:52:05.063" Score="3" Body="&lt;p&gt;Their formula looks correct. As is usually the case, there are multi ways to derive this result. I will outline two of them here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Reflection Principle &amp;amp; Measure Change&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The solution to the risk-neutral dynamics of $S$ is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;S_t = S_0 \exp \left\{ \left( r - \frac{1}{2} \sigma^2 \right) t + \sigma W_t^* \right\},&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W^*$ is a $\mathbb{P}^*$-Brownian motion. We have $S_t = B$ when&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;W_t^* + \frac{1}{\sigma} \left( r - \frac{1}{2} \sigma^2 \right) t = \frac{1}{\sigma} \ln \left( \frac{B}{S_0} \right).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\lambda = \frac{1}{\sigma} \left( r - \frac{1}{2} \sigma^2 \right), \qquad \alpha = \frac{1}{\sigma} \ln \left( \frac{B}{S_0} \right)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and define a new probability measure $\hat{\mathbb{P}}$ equivalent to $\mathbb{P}^*$ through the Radon-Nikodym derivative process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\xi_t \left( \mathbb{P}^*, \hat{\mathbb{P}} \right) = \left. \frac{\mathrm{d} \hat{\mathbb{P}}}{\mathrm{d} \mathbb{P}^*} \right| \mathfrak{F}_t = \mathcal{E}_t \left( - \int_0^\cdot \lambda \mathrm{d}W_u^* \right) \qquad \mathbb{P}^*\text{-a.s.},&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\mathcal{E}$ is the Doleans-Dade exponential martingale. It follows by Girsanov's theorem that the process $\hat{W}$ defined by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\hat{W}_t = W_t^* + \lambda t&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is a standard Brownian motion under $\hat{\mathbb{P}}$. Next, by the reflection principle for Brownian motion, PDF of the first passage time $\nu$ of $\hat{W}$ to a level $\alpha$ is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\hat{\mathbb{P}} \left\{ \nu \in \mathrm{d}t \right\} = \frac{\vert \alpha \vert}{t \sqrt{2 \pi t}} \exp \left\{ -\frac{\alpha^2}{2 t} \right\} \mathrm{d}t;&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;see for example Equation (II.6.3) in Karatzas and Shreve (1991), p. 80 or Theorem 3.7.1. in Shreve (2004), p. 113. I take this result as given and you can find details on its derivation in the references. Using the abstract Bayes rule; see for example Lemma A.1.4 in Musiela and Rutkowski (2005), p. 615, we get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\mathbb{P}^* \left\{ \nu \in \mathrm{d}t \right\} &amp;amp; = &amp;amp; \mathbb{E}_{\mathbb{P}^*} \left[ \mathrm{1} \{ \nu \in \mathrm{d}t \} \right]\\&#xA;&amp;amp; = &amp;amp; \mathbb{E}_{\hat{\mathbb{P}}} \left[ \xi_t^{-1} \left( \mathbb{P}^*, \hat{\mathbb{P}} \right) \mathrm{1} \{ \nu \in \mathrm{d}t \} \right]\\&#xA;&amp;amp; = &amp;amp; \mathbb{E}_{\hat{\mathbb{P}}} \left[ \exp \left\{ \lambda \hat{W}_t - \frac{1}{2} \lambda^2 t \right\} \mathrm{1} \{ \nu \in \mathrm{d}t \} \right].&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, when $\nu = t$ then $\hat{W}_t = \alpha$ and thus&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\mathbb{P}^* \{ \nu \in \mathrm{d}t \} &amp;amp; = &amp;amp; \exp \left\{ \lambda \alpha - \frac{1}{2} \lambda^2 t \right\} \hat{\mathbb{P}} \{ \nu \in \mathrm{d}t \}\\&#xA;&amp;amp; = &amp;amp; \frac{\vert \alpha \vert}{t \sqrt{2 \pi t}} \exp \left\{ -\frac{(\alpha - \lambda t)^2}{2 t} \right\} \mathrm{d}t.&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the $\alpha - \lambda t$ term is equal to $Z$ in your reference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Differentiating the Barrier Option Price&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\psi = -1$ ($\psi = +1$) indicate an upper (lower) barrier. Consider a contract with the terminal payoff $V_T = \mathrm{1} \{ \nu &amp;gt; T \}$. Using the method of images, it can be shown that its valuation function in terms of the time-to-maturity $\tau = T - t$ is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\tilde{V}(S, \tau) = \mathcal{B}_B^\psi(S, \tau) - \mathcal{I} \left\{ \mathcal{B}_B^\psi(S, \tau) \right\},&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\mathcal{B}_B^\psi &amp;amp; = &amp;amp; e^{-r \tau} \mathcal{N} \left( \psi d_-(S, B) \right),\\&#xA;d_-(S, B) &amp;amp; = &amp;amp; \frac{1}{\sigma \sqrt{\tau}} \left( \ln \left( \frac{S}{B} \right) + \left( r - \frac{1}{2} \sigma^2 \right) \tau \right),\\&#xA;\mathcal{I} \left\{ \tilde{V}(S, \tau) \right\} &amp;amp; = &amp;amp; \left( \frac{S}{B} \right)^{2 \alpha} \tilde{V} \left( \frac{B^2}{S}, \tau \right)\\&#xA;\alpha &amp;amp; = &amp;amp; \frac{1}{2} - \frac{r}{\sigma^2};\\&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;see e.g. Buchen (2001) or Wilmott et al. (1995). Note that the option price is linked to the first passage time CDF through&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\mathbb{P}^* \{ \nu &amp;gt; \tau \} &amp;amp; = &amp;amp; e^{r \tau} \tilde{V}(S, \tau)\\&#xA;&amp;amp; = &amp;amp; \int_\tau^\infty \mathbb{P}^* \{ \nu \in \mathrm{d}\tau \}&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and thus&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\frac{1}{\mathrm{d} \tau} \mathbb{P}^* \{ \nu \in \mathrm{d}\tau \} = -\frac{\partial}{\partial \tau} \left\{ e^{r \tau} \tilde{V}(S, \tau) \right\}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Carefully differentiating the two terms in $\tilde{V}(S, \tau)$ yields&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\frac{\partial}{\partial \tau} e^{r \tau} \mathcal{B}_B^\psi(S, \tau) &amp;amp; = &amp;amp; -\psi \mathcal{N}' \left( \psi d_-(S, B) \right) \frac{1}{2 \sigma \tau \sqrt{\tau}} \left( \ln \left( \frac{S}{B} \right) - \left( r - \frac{1}{2} \sigma^2 \right) \tau \right)&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\frac{\partial}{\partial \tau} e^{r \tau} \mathcal{I} \left\{ \mathcal{B}_B^\psi(S, \tau) \right\} &amp;amp; = &amp;amp; -\psi \left( \frac{S}{B} \right)^{2 \alpha} \mathcal{N}' \left( \psi d_-(B, S) \right) \frac{1}{2 \sigma \tau \sqrt{\tau}} \left( \ln \left( \frac{B}{S} \right) - \left( r - \frac{1}{2} \sigma^2 \right) \tau \right).&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Through some tedious algebra, we can show that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\left( \frac{S}{B} \right)^{2 \alpha} \mathcal{N}' \left( \psi d_-(B, S) \right) &amp;amp; = &amp;amp; \mathcal{N}' \left( \psi d_-(S, B) \right)\\&#xA;&amp;amp; = &amp;amp; \mathcal{N}' \left( d_-(S, B) \right).&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consequently,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\frac{1}{\mathrm{d} \tau} \mathbb{P}^* \{ \nu \in \mathrm{d}\tau \} &amp;amp; = &amp;amp; \frac{-\psi \ln (B / S)}{\sigma \tau \sqrt{\tau}} \mathcal{N}' \left( d_-(S, B) \right).&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is easy to check that this is the same expression that we obtained before.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Buchen, Peter W. (2001) &quot;Image Options and the Road to Barriers,&quot; &lt;em&gt;Risk Magazine&lt;/em&gt;, Vol. 14, No. 9, pp. 127-130&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Karatzas, Ioannis and Steven E. Shreve (1991) &lt;em&gt;Brownian Motion and Stochastic Calculus&lt;/em&gt;: Springer, 2nd edition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Musiela, Marek and Marek Rutkowski (2005): &lt;em&gt;Martingale Methods in Financial Modelling&lt;/em&gt;: Springer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Shreve, Steven E. (2004) &lt;em&gt;Stochastic Calculus for Finance II - Continuous Time Models&lt;/em&gt;: Springer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wilmott, Paul, Sam Howison and Jeff Dewynne (1995) &lt;em&gt;The Mathematics of Financial Derivatives&lt;/em&gt;: Cambridge University Press&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-04-24T10:10:33.960" LastActivityDate="2017-04-24T10:10:33.960" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33853" PostTypeId="1" AcceptedAnswerId="33856" CreationDate="2017-04-23T21:45:10.243" Score="8" ViewCount="4390" Body="&lt;p&gt;Given $N$ assets, the Markowitz mean-variance model requires expected returns, expected variances and a $N \times N$ covariance matrix. The joint distribution is fully defined by these measures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However I often read that assets are required to be normally distributed for consideration in the mean-variance model. While I understand that a normal joint distribution is fully defined by the statistics described above, I can't really see why normality is required. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can't we simply assume that the distribution is fully described by $\mu$, $\sigma^2$ and $\Sigma$, and not necessarily imply normality? That is, an obvious drawback is not considering higher moments which influence assets, such as skewness and kurtosis, but why is normality an assumption?&lt;/p&gt;&#xA;" OwnerUserId="15487" LastEditorUserId="15487" LastEditDate="2017-08-17T17:24:13.987" LastActivityDate="2018-04-09T21:17:15.757" Title="Why does the Markowitz mean-variance model require the assumption of normality?" Tags="&lt;mean-variance&gt;&lt;normal-distribution&gt;&lt;markowitz&gt;&lt;covariance-matrix&gt;" AnswerCount="2" CommentCount="7" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33854" PostTypeId="1" CreationDate="2017-04-23T21:51:54.000" Score="0" ViewCount="85" Body="&lt;p&gt;How are interest rate and dividend functions integrated over time in practice?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, what does it mean in practice to discount a current price by $e^{\int_{t_m}^{T}r_s ds }$ where $r_s$ is the interest rate function or $e^{\int_{t_m}^{T}\delta_s ds }$ where $\delta_s$ is the dividend fuction.&lt;/p&gt;&#xA;" OwnerUserId="20194" LastActivityDate="2017-04-26T17:26:41.960" Title="Integrating Interest and Dividend Functions" Tags="&lt;futures&gt;&lt;forward&gt;&lt;forward-rate&gt;&lt;discounting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33856" PostTypeId="2" ParentId="33853" CreationDate="2017-04-24T01:24:02.730" Score="15" Body="&lt;p&gt;it doesn't require normality. What it requires is that the investor's decisions are determined by  mean and variance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A normal distribution is determined by mean and variance, so if you assume joint normality then there is no point in the investor being interested in anything else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(we try to discuss assumptions thoroughly in our book, Introduction to Mathematical Portfolio Theory.)&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2017-04-24T01:24:02.730" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33858" PostTypeId="2" ParentId="8274" CreationDate="2017-04-24T05:42:49.780" Score="3" Body="&lt;p&gt;Two remarkably simple solutions have been missed.  Let us go a completely different route.  Let's assume that the standard models don't work sufficiently well, for whatever reason, and that we need a solution that is both &lt;em&gt;model independent&lt;/em&gt; and either reveals long run frequencies or the probabilities given the data.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One method is &lt;em&gt;fancy&lt;/em&gt; and so would look good on paper.  The other is primitive and sounds boring, but satisfies the coherence principle.  The first one is kernel density estimation, the second is an extension of a Bayesian multinomial estimation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The advantage of the first is that it can provide a smooth curve as long as the bins are wide enough.  The advantage of the second is that because it satisfies the coherence principle then gambles can be made from the estimates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is pretty easy to find decent work on estimating long-run frequencies using kernel density estimates.  Between software, online books, paper books and journal articles there are a plethora of options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are likely less familiar with using Bayesian multinomial estimates to construct a density estimate.  It is really just very fancy binning with the added property that you can use it to gamble.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, I would transform my raw data to possible values of a $S_{t+1}$, the possible stock prices, and $K$, the strike price, so that I was reframing the problem as a return-style problem as $$\frac{S_{t+1}}{K}.$$  As you can always multiply by $K$ as it is a constant, there is no information loss.  Conversely, unless you believe the distribution's form is a function of $K$ itself, the conversion would allow direct comparison of five dollar strike prices and fifty dollar strike prices. &#xA; My first bin would be from zero to the first partition value and my last partition would be from $K$ to $\infty$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using this tool has two giant advantages.  If the heavy-tailed distribution has no mean then the put will still have an expected return because only the distribution from zero to $K$ matters in terms of creating a division, while $K$ to $\infty$ only matters to complete the set, but not to set the price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each partition would have a parameter $\theta_i$ that is the estimator for the probability that a return will fall inside that partition.  Unlike the maximum likelihood estimate or the minimum variance unbiased estimator, the Bayesian method produces a distribution of possible values for $\theta_i$ for each partition instead of a point estimator.  Furthermore, $\theta_i$ could depend on data from adjacent partitions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A prior distribution would need to be determined and a Dirichlet prior density function set based on what you believed to be the likely values in the bins.  The likelihood function would just be the multinomial likelihood and the posterior would just be the multivariate Polya distribution.  This will allow you to form the Bayesian posterior predictive density estimate.  This density estimate can have fair gambles placed on it as it is both admissible and coherent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This second method provides valid probabilities.  It also allows you to consider the impact of mergers and bankruptcies in a single distribution or as the weighted average of the distributions.  Its value is that it does not at all depend upon theory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have written a paper on how to do this and an empirical test, but rather than cite it, the subsection on the handling of the distribution is reproduced here in a more general form.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to your specifics on calibration, expected values and no-arbitrage rules I felt I should comment.  As to calibration, it is intrinsically calibrated because Bayesian methods estimate the probability a model is valid given the data rather than the probability of seeing the data given a model is true.  Frequentist models need to be calibrated.  Bayesian models do not assume a model is the true model and do not have this headache.  This particular tool, less so, because there are no distributional assumptions present.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Expected values only exist in mesokurtic and platykurtic models, generally, and only sometimes in leptokurtic models.  You can construct expected losses, given a loss happens, times the probability of loss.  That is not an expected value, but it always exists.  I built an option pricing model around it.  It works.  You do not even need expectations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to the absence of arbitrage opportunities, de Finetti's coherence principle is a weaker assumption than an absence of arbitrage opportunities.  It merely assumes the market maker cannot be gamed in all states of nature, that is the market maker cannot be tricked into taking a sure loss, regardless of the outcomes.  In essence, it says that if an arbitrage opportunity does form, then the market maker will take it.  It does not require that no opportunities ever exist, only that it cannot be used against the market maker to produce income.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used this method as a back-up because I separately wrote a paper deriving the distribution of returns under a very wide set of possible assumptions.  It didn't just cover stocks, but things like antiques at Sotheby's, accounting ratios and single period discount bonds.  Most of the distributions lack a first moment and so you cannot use standard option theory, or lack an analytic solution and so you cannot use a parametric solution.  As most actual distributions are mixture distributions, at least in the paper, this method is a reasonable shortcut.  This method also doesn't require anyone answering the question to be right as to the solution to option pricing, as it only requires the data to be true data.  We could all be wrong, but the solution would be one that a valid gamble can be placed on.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastEditorUserId="25459" LastEditDate="2017-04-24T05:48:30.527" LastActivityDate="2017-04-24T05:48:30.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33868" PostTypeId="2" ParentId="33842" CreationDate="2017-04-24T20:09:15.020" Score="1" Body="&lt;p&gt;I don't know about the &quot;best&quot; but from personal experience:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interactive Brokers: If you have a live account with IBr, they will give you a demo/paper trading account along side of it that you can use for testing purposes.  I used it a long time ago.  I don't remember if the simulated order fills were accurate but other than that it had the full functionality that a regular account would have including API access.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lots of other brokers have demo/paper trading capabilities.  I wouldn't recommend using them for much other than testing very basic things like API functionality, order entry/cancellation, system messaging, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.  It's not exactly on topic for this SE but I remember 25 years ago when I was looking for similar information as this and I am sympathetic.  Good luck.&lt;/p&gt;&#xA;" OwnerUserId="26556" LastActivityDate="2017-04-24T20:09:15.020" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33870" PostTypeId="2" ParentId="19466" CreationDate="2017-04-25T02:38:56.610" Score="1" Body="&lt;p&gt;Just wanted to provide a little color to @assylias' answer, which is a correct one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The S&amp;amp;P 500 index is constructed according to an adjusted float weighted methodology, in which a change in the index level is defined by a &lt;em&gt;Laspeyres&lt;/em&gt; index:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{I + \Delta I}{I} = \frac{\sum_i P_{i,t+1}*Q_{i,t}}{\sum P_{i,t}*Q_{i,t}} \,; \forall i \in I$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where: $I$ is the index level;&#xA;$P_i$ is the price of asset $i$; and,&#xA;$Q_i$ is the float adjusted share count of asset $i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please reference this following S&amp;amp;P document for a more robust definition: &lt;a href=&quot;http://us.spindices.com/documents/methodologies/methodology-index-math.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://us.spindices.com/documents/methodologies/methodology-index-math.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, the S&amp;amp;P earnings yield can be restated as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{E}{I}= \frac{\sum_i e_{i,t}*Q_{i,t}}{\sum P_{i,t}*Q_{i,t}} \,; \forall i \in I$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where now, $e_{i,t}$ is the earnings per share of constituent, $i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, the simple aggregation of Earnings over Market Cap will provide the yield of a cap-weighted index... it serves as a very good approximation of the modified float-weighted Laspeyres index. The sum-product of corporate earnings by the ratio of float to market cap (i.e., index weightings) would be an equivalent workthrough:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E = \sum_i ( E_{i,t}*\frac{Q_{i,t} P_{i,t}}{I}) \,; \forall i \in I$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I cannot speak exactly to Multpl's approach, but my estimates using the aforementioned methodology converge with Multpl's using S&amp;amp;P Capital IQ data. As an aside, I've never been able to perfectly replicate the S&amp;amp;P 500 total return index over time, but my average absolute daily tracking error using the above methodology is less $1 *10^{-6}\%$. I presume there are some adjustments missing or lags in my dataset. It stands to reason that results will very somewhat depending on selection of which float and which earnings to use. For example, expect different results if using GAAP earnings (i.e., net income) versus net income before non-controlling interests and extra-ordinary items. Furthermore, the calculation of float can be very nuanced.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2017-04-25T07:13:32.593" LastActivityDate="2017-04-25T07:13:32.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33871" PostTypeId="2" ParentId="33839" CreationDate="2017-04-25T04:54:46.193" Score="1" Body="&lt;p&gt;Replicating Fama &amp;amp; French 2014 model will require some programming language knowledge, to save time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Major steps includes:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Data cleaning &amp;amp; handling missing data&lt;/li&gt;&#xA;&lt;li&gt;Creating portfolio compositions (SMB, HML, RMW, CMA) for each period&lt;/li&gt;&#xA;&lt;li&gt;Computing portfolio returns for each period &lt;/li&gt;&#xA;&lt;li&gt;Compute stock exposures (betas) to each factor (the regression of stock's excess returns against portfolio excess returns)&lt;/li&gt;&#xA;&lt;li&gt;Interpret results&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You will also need to have stock returns datasets, the risk-free rate and local equity market index for the target market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fundamental data will be used to create the portfolios. Missing data will always exists as companies enters and leaves the market all the time, but it may happens also due to delays in financial statement releases and other issues. if data is not available for a good reason, just let the stock out of the spread portfolio for that period.&lt;/p&gt;&#xA;" OwnerUserId="27629" LastActivityDate="2017-04-25T04:54:46.193" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33872" PostTypeId="2" ParentId="33355" CreationDate="2017-04-25T05:03:36.890" Score="1" Body="&lt;p&gt;There are several ways, but to keep things simple: use a factor model like single index model and you will reduce a lot this problem. If you have no data (very iliquid stock), consider using a proxy from average beta and residual risk for stocks in similar industry.&lt;/p&gt;&#xA;" OwnerUserId="27629" LastActivityDate="2017-04-25T05:03:36.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33873" PostTypeId="2" ParentId="33437" CreationDate="2017-04-25T05:16:49.620" Score="0" Body="&lt;p&gt;Use monthly returns or, if you want only to scale, use daily data and multiply standard deviation by sqr root of 22 (or working days in the target market)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice that if you use a model based on monthly returns, you don't need to scale, but will have a model that takes more time to react to new information. This may be good if you are not a short term investor.&lt;/p&gt;&#xA;" OwnerUserId="27629" LastActivityDate="2017-04-25T05:16:49.620" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33874" PostTypeId="2" ParentId="33520" CreationDate="2017-04-25T05:45:27.010" Score="1" Body="&lt;p&gt;For your assignment, use only the returns that you have available, even if they are not complete for entire period. You will be able to run all your analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice that This is not a good solution in real world cases, if you want to use your covariance/correlation matrix for optimization or monte carlo simulation as using pairwise correlations may lead to non positive semi-defined matrices. &lt;/p&gt;&#xA;" OwnerUserId="27629" LastActivityDate="2017-04-25T05:45:27.010" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33875" PostTypeId="1" CreationDate="2017-04-25T06:39:09.627" Score="2" ViewCount="1397" Body="&lt;p&gt;I am looking for a simple example which explains why variance as a risk measure can be problematic (with a long-only portfolio with no options).&lt;/p&gt;&#xA;" OwnerUserId="27634" LastEditorUserId="467" LastEditDate="2017-04-26T01:24:57.937" LastActivityDate="2017-04-26T11:19:50.903" Title="Why is variance problematic as a risk measure?" Tags="&lt;equities&gt;&lt;risk&gt;&lt;variance&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33876" PostTypeId="2" ParentId="33875" CreationDate="2017-04-25T07:40:53.597" Score="3" Body="&lt;p&gt;Although this sounds like a simple question it might not be that clear. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You say a long-only portfolio with no-options. I assume you mean a stock portfolio. &#xA;As you say &quot;no options&quot; there should not be too much skewness. Additionally we assume that your portfolio is well diversified (no dominating weights in single stocks, countries or industry sectors).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The next question is what the aim of your risk measures is. If it is ranking portfolios in the sense portfolio A is riskier than portfolio B or my portfolio is riskier or less risky if I add/remove a tiny position in stock S then I would say:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Variance is (of course) as fine as standard deviation (volatility);&lt;/li&gt;&#xA;&lt;li&gt;a Gaussian Value-at-Risk (VaR) or Expected Shortfall will not tell you more about your portfolio(s) as it is proportional to volatility;&lt;/li&gt;&#xA;&lt;li&gt;a t-distributed VaR will not tell you more as it depends on the degree of freedom and the volatility. Your degrees of freedom could be similar for portfolio A or B - thus your choice could depend on volatility again.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;We can look at other alternatives to variance but with the above stated aims and the above mentioned nature of your portfolio I would say that variance is just fine.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="26595" LastEditDate="2017-04-25T12:01:48.013" LastActivityDate="2017-04-25T12:01:48.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33877" PostTypeId="2" ParentId="33875" CreationDate="2017-04-25T10:13:21.790" Score="1" Body="&lt;p&gt;Here's a simple hypothetical example:  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Portfolio A = a single stock priced at 100 which can either go to 99 or 101 each with probability 0.5 in one year.  The annual standard deviation is 1.  The variance is 1 .  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Portfolio B = a single stock prices at 100 which can go to 90 or 110 each with probability 0.005 or stay at 100 with probability 0.99.   The annual standard deviation is 1 and the variance is 1 squared as before.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The difference between these two portfolios is not evident from the use of variance as a single risk measure.  Of course this is a highly theoretical example. &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-04-25T10:13:21.790" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33879" PostTypeId="1" AcceptedAnswerId="33890" CreationDate="2017-04-25T12:32:43.647" Score="2" ViewCount="1579" Body="&lt;p&gt;Is there a reliable machine readable source of stock market holiday calendars?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found this source: &lt;a href=&quot;https://eresearch.fidelity.com/eresearch/markets_sectors/global/holidayCalendar.jhtml&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://eresearch.fidelity.com/eresearch/markets_sectors/global/holidayCalendar.jhtml&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I could scrape it, but honestly, I have my doubts about it staying well formatted and conforming over time, or even exist at all over time. Also it doesn't seem to have historic data, including abnormal close times like 9/11. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A good thing about it is that it includes special close times. Some markets close early on some days, notably Stockholm has a bunch of them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2020-06-08 Edit&lt;/strong&gt;: My worries turned out to be warranted. The source now just reads:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;International Holiday Calendar permanently unavailable.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2792" LastEditorUserId="2792" LastEditDate="2020-06-05T20:24:29.807" LastActivityDate="2020-06-05T20:24:29.807" Title="Reliable stockmarket holiday, open and close time dataset/api?" Tags="&lt;equities&gt;&lt;data&gt;&lt;market-data&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="33880" PostTypeId="1" AcceptedAnswerId="33892" CreationDate="2017-04-25T13:18:53.817" Score="-1" ViewCount="930" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;By &quot;Hull, Options, Futures, and Other Derivatives&quot;:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/phdC5.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/phdC5.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt; &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Suppose that, in figure,the stock price is \$100 and the option price&#xA;  is \$10. Imagine an investor who has sold 20 call option&#xA;  contracts—that is, options on 2,000 shares. The investor’s position&#xA;  could be hedged by buying $0.6 \times  2,000 =1,200 $ shares.  The&#xA;  gain (loss) on the stock position would then tend to offset the loss&#xA;  (gain) on the option position.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;For example, if the stock price goes up by \$1 (producing a gain of&#xA;  \$1,200 on the shares purchased), the option price will tend to go up&#xA;  by $0.6 \times  \$1 = \$0.60$ (producing a loss of \$1,200 on the&#xA;  options written);&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Why the option price that will tend to go up by \$ 0.60, produce a loss of \$1,200?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If strike price $K= \$ 50$, we have that investor loss:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$(\$ 100 - \$ 50 ) \times 2,000 = \$ 100.000$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the stock price goes up by $1, the investor loss:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$(\$ 101 - \$ 50 ) \times 2,000 = \$ 102.000$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so, if the stock price goes up by \$1, the option contract produce a loss of \$ 2.000&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why?&lt;/p&gt;&#xA;" OwnerUserId="27078" LastEditorUserId="27078" LastEditDate="2017-04-25T20:03:19.303" LastActivityDate="2017-04-25T20:42:38.653" Title="Delta Hedging: Clarification example of the book &quot;Hull, Options, Futures, and Other Derivatives&quot;" Tags="&lt;options&gt;&lt;finance&gt;&lt;derivatives&gt;&lt;delta-hedging&gt;" AnswerCount="1" CommentCount="5" ClosedDate="2017-05-03T11:54:52.393" ContentLicense="CC BY-SA 3.0" />
  <row Id="33881" PostTypeId="2" ParentId="33827" CreationDate="2017-04-25T14:38:46.610" Score="2" Body="&lt;p&gt;The EUR leg should be valued in EUR but in a manner consistent with GBP collateral: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a 3m EURIBOR forward curve consistent with GBP collateral  &lt;/li&gt;&#xA;&lt;li&gt;a EUR discount curve consistent with GBP collateral  &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In theory both curves should be jointly bootstrapped to fixed vs EURIBOR swaps collateralized in GBP and EURGBP FX swaps and cross currency swaps collateralized in GBP. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice if market data for fixed vs EURIBOR swaps collateralized in GBP is unavailable, you should use fixed vs EURIBOR swaps collateralized in EUR. The theoretical difference between the 3m EURIBOR forward curve under GBP collateral and the 3m EURIBOR forward curve under EUR collateral is a covariance term between EURIBOR and the EUR/GBP basis spread, so assuming that the two curves are the same is equivalent to neglecting the EURIBOR, EUR/GBP basis correlation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the EUR discount curve it should be the EUR OIS adjusted with EUR/GBP OIS basis spread. Beware that the OIS basis spread needs to be bootstrapped: the spread in a zero PV cross currency swap cannot be used directly as it is (roughly) equal to the EUR/GBP OIS basis spread plus the difference between the OIS-Libor spreads in both currencies. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an alternative if you already have the forward EURGBP FX curve available, you can obtain the adjusted EUR OIS curve as GBP OIS discount x spot EURGBP / forward EURGBP.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps. &lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2017-04-25T14:38:46.610" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33883" PostTypeId="2" ParentId="3312" CreationDate="2017-04-25T15:15:30.780" Score="1" Body="&lt;p&gt;Check out this XBRL-Crawler:&#xA;&lt;a href=&quot;https://github.com/eliangcs/pystock-crawler&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/eliangcs/pystock-crawler&lt;/a&gt;&#xA;It runs on Python but might be outdated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You also can download the Text-Files using this Crawler: &lt;a href=&quot;https://pypi.python.org/pypi/SECEdgar&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://pypi.python.org/pypi/SECEdgar&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will test the first one, but the second one works fine.&lt;/p&gt;&#xA;" OwnerUserId="27637" LastActivityDate="2017-04-25T15:15:30.780" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33884" PostTypeId="1" CreationDate="2017-04-25T15:21:19.043" Score="1" ViewCount="84" Body="&lt;p&gt;Assume we look at all passive fills going through a security. How do we benchmark how good each passive fill is (relative to each other)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We expect the edge to be (assuming midprice is our theoretical value) to be the spread between midprice and our fill, and our expected profit would take into account adverse selection &amp;amp; market impact as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That being said, given the last 100 fills (all executed with the same 'edge'), what is a good metric to rank those fills?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also -- how can we quantify adverse selection?&lt;/p&gt;&#xA;" OwnerUserId="27627" LastEditorUserId="27627" LastEditDate="2017-04-25T15:42:07.877" LastActivityDate="2017-04-25T15:42:07.877" Title="Evaluating passive fills" Tags="&lt;equities&gt;&lt;high-frequency&gt;&lt;market-making&gt;" AnswerCount="0" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33885" PostTypeId="2" ParentId="33879" CreationDate="2017-04-25T15:24:55.903" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://github.com/rsheftel/pandas_market_calendars&quot; rel=&quot;nofollow noreferrer&quot;&gt;pandas_market_calendars&lt;/a&gt; should do the job. I think there aren't any market calendars that feature 9/11 or the 2012 storm days as holidays.&lt;/p&gt;&#xA;" OwnerUserId="25419" LastActivityDate="2017-04-25T15:24:55.903" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="33886" PostTypeId="1" AcceptedAnswerId="33961" CreationDate="2017-04-25T15:45:41.980" Score="0" ViewCount="802" Body="&lt;p&gt;I analyzed an MA(1)-GARCH(1,1) model in R, and now I want to test the conditional mean and volatility spillover effect between the two time series (exchange rates) (based on Hamao et al., 1990). Therefore I have to include the exogenous variable from the other stock market. Here is the model: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;img src=&quot;https://i.stack.imgur.com/O2ReP.png&quot; alt=&quot;&quot;&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$R_{j,t-1}$ is the previous currency exchange rates and $\sigma^2_{j,t-1}$ is the squared residual derived from the MA(1)-GARCH(1,1) model applied to $R_{j,t-1}$. I understand the model, but I don’t know how to run this in R. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the R commands for that? &lt;/p&gt;&#xA;" OwnerUserId="27639" LastEditorUserId="19645" LastEditDate="2017-05-05T17:31:28.060" LastActivityDate="2017-05-05T17:31:28.060" Title="GARCH mean and volatility spillover R commands needed" Tags="&lt;volatility&gt;&lt;programming&gt;&lt;garch&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="33887" PostTypeId="1" CreationDate="2017-04-25T17:08:04.850" Score="1" ViewCount="41" Body="&lt;p&gt;I just found a stochastic model for target zone exchange rates &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$x_{t+1}=x_t+k+r(x_t-y)+ \tilde{\epsilon}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where k is a drift term so equal $r-r_f$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;r is lean againt the wind coefficient that characterise the central bank intervention&lt;/p&gt;&#xA;&#xA;&lt;p&gt;y is the reference exchange rate or the desired exchange rate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\tilde{\epsilon}$ is a whitenoise term&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but this process is subject to some conditions &lt;/p&gt;&#xA;&#xA;&lt;p&gt;-if $x_{t+1} &amp;gt; U$ then the value of the exchange rate would be $2 x_{t+1}-U$ (where U is the upper band)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-if $x_{t+1} &amp;lt; L$ then the value of the exchange rate would be $2 x_{t+1}-L$ (where L = lowerband)   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem is that i want to use this process for the Moroccan case to generate a 1 year path of daily exchange rate that could be the probable path&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should i use the monte carlo simulation ? and how could i use it &lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="26814" LastEditorUserId="16148" LastEditDate="2017-04-25T17:46:59.110" LastActivityDate="2017-04-25T17:46:59.110" Title="Model for target zone exchange rates" Tags="&lt;stochastic-processes&gt;&lt;monte-carlo&gt;&lt;exchange&gt;&lt;floating-rate&gt;&lt;rates&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33888" PostTypeId="2" ParentId="18215" CreationDate="2017-04-25T17:51:14.783" Score="1" Body="&lt;p&gt;&lt;a href=&quot;http://pitrading.com/historical-data.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://pitrading.com/historical-data.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can backfill 15 to 30 years of M1 price history depending on the symbol and package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you need the index/etf or futures/forex, try the &lt;a href=&quot;http://pitrading.com/historical-market-data.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;market&lt;/a&gt; package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you need the actual stock components, then the &lt;a href=&quot;http://pitrading.com/historical-stock-data.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;stock&lt;/a&gt; package.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The files are standard ascii text/csv, so compatiblity shouldn't be an issue. But check out the samples to be sure. We mainly feed the historical files into &lt;a href=&quot;http://ninjatrader.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;NinjaTrader&lt;/a&gt; and &lt;a href=&quot;http://www.adaptrade.com/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Adaptrade&lt;/a&gt; for back tests and cross with &lt;a href=&quot;http://kinetick.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Kinetick&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="25326" LastActivityDate="2017-04-25T17:51:14.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33889" PostTypeId="1" AcceptedAnswerId="33903" CreationDate="2017-04-25T18:05:29.387" Score="5" ViewCount="658" Body="&lt;p&gt;If we have a swap with a bank and Special Purpose Vehicle (SPV), and the swap is un-collateralized , how do we estimate Credit Value Adjustment on the swap?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will be able to get the Expected Positive Exposure (EPE) profile but I need to know the Loss Given Default (LGD) and probability of default (essentially a credit curve).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore my question is, what are some real world ways to estimate a credible credit curve for an SPV ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am only looking at it from a practitioners perspective.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This SPV borrows EUR from a bank , does cross currency swap with swap counter party and lends USD to a corporate client. The banks and swap counterparty is A rate and corporate client is BBB+ rate. &lt;/p&gt;&#xA;" OwnerUserId="1386" LastEditorUserId="1386" LastEditDate="2017-04-26T11:19:11.753" LastActivityDate="2017-04-26T11:49:13.093" Title="How to compute the CVA on a swap with SPV?" Tags="&lt;credit-risk&gt;&lt;cva&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33890" PostTypeId="2" ParentId="33879" CreationDate="2017-04-25T19:34:35.473" Score="1" Body="&lt;p&gt;The best most comprehensive (and therefore not free) calendar service I know of is at Swaps Monitor - sounds very fixed income-y, but they also have stock market calendar data. If you are doing something in a production environment, this is the sort of thing you want.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.financialcalendar.com/Data/Holidays/Overview&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.financialcalendar.com/Data/Holidays/Overview&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26977" LastEditorUserId="26977" LastEditDate="2017-04-25T20:40:32.217" LastActivityDate="2017-04-25T20:40:32.217" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33891" PostTypeId="1" CreationDate="2017-04-25T20:42:01.827" Score="2" ViewCount="803" Body="&lt;p&gt;To calculate Key rate duration/Key rate DV01 for bonds, do we move the zero/spot curve or we move the par curve? Or either one is OK? Just want to know the industry standard.&lt;/p&gt;&#xA;" OwnerUserId="27641" LastEditorUserId="467" LastEditDate="2017-04-26T01:14:40.427" LastActivityDate="2017-04-26T01:14:40.427" Title="To compute key rate duration, shall I use par curve or zero curve?" Tags="&lt;bond&gt;&lt;duration&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33892" PostTypeId="2" ParentId="33880" CreationDate="2017-04-25T20:42:38.653" Score="4" Body="&lt;p&gt;We denote by $C(S_0, K)$ the price for a call option with payoff $(S_T-K)^+$ at the option maturity $T.$ Here $S_0=100$ is the spot stock price. &#xA;Generally, &#xA;\begin{align*}&#xA;C(S_0, K) \ne (S_0-K)^+.&#xA;\end{align*} &#xA;Moreover,&#xA;\begin{align*}&#xA;C(S_0+\Delta, K)-C(S_0, K) \approx \frac{\partial C}{\partial S_0} \Delta,&#xA;\end{align*}&#xA;where $\frac{\partial C}{\partial S_0}=0.6$ is the delta hedge ratio. If the stock price go up by $\Delta = \$1$, the shorted option position will loss&#xA;\begin{align*}&#xA;\frac{\partial C}{\partial S_0} \Delta = 0.6 \times \$1 = \$0.60.&#xA;\end{align*}&#xA;Then the whole option position loss is $2,000 \times \$0.60 = \$1,200$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2017-04-25T20:42:38.653" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="33893" PostTypeId="2" ParentId="33891" CreationDate="2017-04-25T21:44:46.467" Score="3" Body="&lt;p&gt;You can do either. It depends on what you're trying to do and how you build your curve. If you're trying to match bond index duration, then shocking par curve is the way to go, because index providers, such as Barclays (now Bloomberg Barclays), Citi, and BofAML, all shock the par yield curve when reporting their option-adjusted duration statistics. However, a lot of &quot;weird things&quot; can happen when you do that (see &quot;Duration Anomaly&quot; and &quot;Effective Duration versus Nominal Duration&quot; by Bob Kopprasch); shocking zero curve tends to produce more intuitive results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For hedging purposes, it may also be advisable to shock the forward curve, or individual input instruments you use to build the curve. &lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2017-04-25T23:04:17.297" LastActivityDate="2017-04-25T23:04:17.297" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33894" PostTypeId="2" ParentId="33437" CreationDate="2017-04-25T22:12:07.030" Score="1" Body="&lt;p&gt;Most implementations of VaR are inherently parametric. If the data is indeed approximately normally distributed, more frequent (daily) sampling will result in greater sample size over shorter time intervals -- this affords greater statistical significance over shorter time periods. Greater significance is highly desirable whether your model employs &lt;strong&gt;&lt;em&gt;frequentist&lt;/em&gt;&lt;/strong&gt; and/or &lt;strong&gt;&lt;em&gt;Bayesian&lt;/em&gt;&lt;/strong&gt; calibration (i.e., &quot;moment estimation&quot;) methods. If variance does indeed grow approximately linearly with respect to time, then basing VaR's parameters on daily returns is preferable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That increasing sample size increases the statistical power of sampling moments from a parametric distribution is classically demonstrated through the Lindeberg–Lévy Central limit theorem (CLT) -- assuming returns are i.i.d. random variables from a stationary process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sqrt{N}((\frac{1}{N}\sum_{n}^NX_n)-\mu)\to_{distribution} \varPhi(0,\sigma^2)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$N$ is sample size;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_i = \{X_1,X_2,...X_N\}$ is a sequence of i.i.d. variables with with an expected value equal to $\mu$ and expected variance equal $\sigma^2$; and,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\varPhi(0,\sigma^2)$ is the cumulative distribution function of the standard,  normal (i.e., &lt;em&gt;Gaussian&lt;/em&gt;) distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to test for the validity of implementing VaR on daily returns, I recommend a simple &quot;unit-root&quot; test on the variances at different sampling frequencies. The following might serve as the basis for a linearity test such that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sum_{i\times n}^N[(X_{n}-\mathbb{E}[X])^2] \propto  i^a; \, a \approx 1 \ldots \forall i\in N$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If returns exhibit varying amount of skewness and ex-kurtosis, or clustered variance, then observed variance will grow linearly with respect to time -- i.e., volatility sampled at varying frequencies and/or intervals will not behave according to the &quot;square root of time&quot; rule.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If, upon discovering this misbehavior, you remain committed to normative assumptions, the &quot;correct&quot; frequency really depends on investors' preferences to trade off between accuracy and significance. For example, sampling too frequently will imply unrealistic expectations. On the other, sampling too infrequently will surely result in spurious and insignificant estimates. Monthly frequency seems reasonable to me... it just depends...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If, however, you are willing to make increasingly specified parametric assumptions, one option is to incorporate higher level moments and/or a non-standard distributions. If you have reason to believe that the posterior distribution will be of a specific shape and/or will possess moments different from those implied by historical data, then more highly-specified parametric methods are more powerful than other approaches. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my opinion, employing higher level moments to more precisely capture the posterior distribution without the expectation that these moments capture something fundamental is very unwise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An alternative to parametric methods is employing non-parametric methods. If you are agnostic regarding the posterior distribution, non-parametric VaR estimators are more robust but may require greater sample sizes. Assuming statistically significant sample size, you can estimate the empirical x% return/loss interval in the absence of assumptions regarding the shape of the underlying distribution. Another class of (mildly) non-parametric estimators, based on kernel density estimation, can be robust at even smaller sample sizes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The paper, &quot;&lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.41.36&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Estimating Value-at-Risk with a Precision Measure by Combining Kernel Estimation with Historical Simulation&lt;/a&gt;&quot; appears to be on point with regard to non-parametric estimators.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2017-05-09T01:10:48.610" LastActivityDate="2017-05-09T01:10:48.610" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33896" PostTypeId="2" ParentId="33875" CreationDate="2017-04-26T04:40:47.800" Score="0" Body="&lt;p&gt;I would like to echo @Richard's and @dm63's answers. I would also like to propose one scenario, in which variance is assumed to be stochastic, which demonstrates how observed variance can be problematic as a risk measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we presume that returns are a random walk in the form of a normally-distributed process, then it follows that variance is a complete measure of &lt;strong&gt;&lt;em&gt;risk&lt;/em&gt;&lt;/strong&gt; -- where we define risk as a probabilistic distribution of random outcomes. For returns which are normally distributed, an arbitrary Numeraire process, $\mathbb{P}$, may evolve according to a Wiener process:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb{E}[\frac{d\mathbb{P}}{\mathbb{P}}] \to_{\text{discretization}} \ln(\frac{\mathbb{P}_t}{\mathbb{P}_{t-\Delta t}}) = \mu \Delta t + \sigma \sqrt{\Delta t}*dZ$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $dZ$ is a Wiener process (e.g., GBM). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If, however, we subscribe to the notion that variance is stochastic (e.g., a non-stationary, mean-reverting process), then the expectation can be re-written as such:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb{E}[\frac{d\mathbb{P}}{\mathbb{P}}] = \mu \Delta t + \sigma_t \sqrt{\Delta t}*dZ_1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d \sigma^2_t \propto \eta \,\sigma \sqrt{\Delta t}*dZ_2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\langle dZ_1 \, dZ_2 \rangle = \rho \, dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where: $\eta$ is the volatility of volatility; and, $\rho$ is the correlation between returns and changes in $\sigma^2_t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This setup is commonly used to calibrate GARCH volatility models, as is detailed in Jim Gatheral's lecture on &quot;&lt;a href=&quot;http://www.math.ku.dk/~rolf/teaching/ctff03/Gatheral.1.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Stochastic Volatility and Local Volatility&lt;/a&gt;&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The expectation of stochastic variance is not far-fetched when considering observed fat-tails in security returns due to &quot;volatility clustering&quot; (i.e., large moves tend to be preceded and proceeded by large moves). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If one believes that variance (and/or expected returns) are stochastic, then one should also believe that observed variation will tend to provide an incomplete measure of long-term (posterior) variation. This belief also implies that balancing the &lt;strong&gt;&lt;em&gt;frequentist&lt;/em&gt;&lt;/strong&gt; view with &lt;strong&gt;&lt;em&gt;Bayseian&lt;/em&gt;&lt;/strong&gt; inference will provide a more accurate picture of posterior realized variation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although this answer may not be the simple one which you requested, I believe that the ramifications of assuming non-stationarity are rather straightforward. Moreover, the implications are relevant even for a long-only portfolio without exposure to leverage or options. &lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2017-04-26T05:15:46.677" LastActivityDate="2017-04-26T05:15:46.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33898" PostTypeId="1" CreationDate="2017-04-26T08:27:29.677" Score="2" ViewCount="221" Body="&lt;p&gt;I understand the economic logic behind it, that the active portfolio with the highest information ratio will also have the highest Sharpe ratio, but I can't see how &#xA;$SR_B^2 = SR_P^2 - IR^2 $&lt;/p&gt;&#xA;" OwnerUserId="5005" LastActivityDate="2017-04-26T08:27:29.677" Title="Proof that Sharpe ratio of the benchmark is related to the maximal information ratio and Sharpe ratio" Tags="&lt;sharpe-ratio&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33899" PostTypeId="1" AcceptedAnswerId="33920" CreationDate="2017-04-26T09:21:25.417" Score="7" ViewCount="2325" Body="&lt;p&gt;In Pfaff's &lt;a href=&quot;http://eu.wiley.com/WileyCDA/WileyTitle/productCd-1119119669.html&quot; rel=&quot;noreferrer&quot;&gt;&quot;Financial Risk Modelling and Portfolio Optimization with R&quot;&lt;/a&gt; the following stylized facts are stated (among the others, p.26):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;The volatility of return processes is not constant with respect to time.&lt;/li&gt;&#xA;  &lt;li&gt;The absolute or squared returns are highly autocorrelated.&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The following R code in the book is used to illustrate the latter of the above two claims:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(fBasics)&#xA;library(evir)&#xA;data(siemens)&#xA;SieDates &amp;lt;- as.character(format(as.POSIXct(attr(siemens, &quot;times&quot;)),&quot;%Y-%m-   %d&quot;))&#xA;SieRet &amp;lt;- timeSeries(siemens*100, charvec = SieDates)&#xA;colnames(SieRet) &amp;lt;- &quot;SieRet&quot;&#xA;SieRetAbs &amp;lt;- abs(SieRet)&#xA;acf(SieRetAbs, main = &quot;ACF of Absolute Returns&quot;, lag.max = 20,&#xA;ylab = &quot; &quot;, xlab = &quot; &quot;, col = &quot;blue&quot;, ci.col = &quot;red&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It generates the picture below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/QlZWO.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/QlZWO.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But a similar result can be achieved through introduction of single burst of volatility into the sequence of returns distributed normally with constant volatility as code below demonstrates:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Random &amp;lt;- do.call(c, lapply(c(0.8, 1.5, 0.8), function(x) rnorm(2000, sd=x) ) )&#xA;RandomAbs &amp;lt;- abs((Random))&#xA;acf(RandomAbs, main = &quot;ACF of RANDOM Returns&quot;, lag.max = 20, ylab = &quot; &quot;, xlab = &quot; &quot;, col = &quot;blue&quot;, ci.col = &quot;red&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It generates the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/rBVwU.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/rBVwU.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Random&quot; itself is shown below:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/URxsz.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/URxsz.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can it be proven mathematically that such change in volatility will produce ACF of abs returns similar to the above?  Is the opposite true?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the Cont's article &lt;a href=&quot;https://link.springer.com/chapter/10.1007/978-3-540-34625-8_10&quot; rel=&quot;noreferrer&quot;&gt;&quot;Volatility Clustering in Financial Markets: Empirical Facts and Agent–Based Models&quot;&lt;/a&gt; kindly shared with me by @JejeBelfort you may read:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A quantitative manifestation of this fact [volatility clustering] is that, while returns themselves are uncorrelated, absolute returns $|r_t|$ or their squares display a positive, significant and slowly decaying autocorrelation function: $corr(|r_t |, |r_{t+\tau} |) &amp;gt; 0$ for $\tau$ ranging from a few minutes to a several weeks.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But again why &lt;a href=&quot;https://en.wikipedia.org/wiki/Volatility_clustering&quot; rel=&quot;noreferrer&quot;&gt;&quot;Volatility clustering&quot;&lt;/a&gt; implies positive autocorrelation of abs returns? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And &lt;a href=&quot;https://link.springer.com/chapter/10.1007/978-1-4757-2763-0_14&quot; rel=&quot;noreferrer&quot;&gt;will&lt;/a&gt; the returns where &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;large changes tend to be followed by large changes, of either sign, and small changes tend to be followed by small changes.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;always produce ACF of abs returns similar to the above? &lt;/p&gt;&#xA;" OwnerUserId="15154" LastEditorUserId="15154" LastEditDate="2017-04-26T13:32:32.883" LastActivityDate="2017-05-01T06:10:21.540" Title="Is an autocorrelation of the abs returns just a consequence of the volatility burst?" Tags="&lt;volatility&gt;&lt;auto-correlation&gt;&lt;stylized-facts&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33902" PostTypeId="2" ParentId="33875" CreationDate="2017-04-26T11:19:50.903" Score="-4" Body="&lt;p&gt;The key in our proposed methodology is a risk measure called shortfall, which we argue has conceptual, computational and practical advantages over other commonly used risk measures. It is a variation of the mean excess function and TailVaR mentioned earlier&lt;/p&gt;&#xA;" OwnerUserId="27655" LastActivityDate="2017-04-26T11:19:50.903" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33903" PostTypeId="2" ParentId="33889" CreationDate="2017-04-26T11:49:13.093" Score="3" Body="&lt;p&gt;The assets of the SPV constitute a single corporate loan.  Therefore the probability of default and LGD of the bond can be estimated from the CDS market for that corporate.   Now the SPV defaults if and only if the bond defaults, so you have the probability of the SPV defaulting.  Next you need to compute your exposure in a default situation.  What matters is whether you are senior to, pari passu, or junior to the EUR loan taken by the SPV.  If you are senior , you would only lose money if bond value&amp;lt; swap exposure, which is a very low probability since most recovery assumptions are in the 40pct area and you are ok unless the currency has moved by 40pct.   If you are junior, you can assume zero recovery on the swap.  The pari passu case is in between. Hope that helps. &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-04-26T11:49:13.093" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33904" PostTypeId="2" ParentId="33899" CreationDate="2017-04-26T12:17:17.540" Score="2" Body="&lt;p&gt;Such volatility pattern is a well-known stylized fact of financial time series (see Cont, Rama. &lt;em&gt;Empirical properties of asset returns: stylized facts and statistical issues.&lt;/em&gt; (2001): 223-236 for more details) which is called &lt;strong&gt;volatility clustering&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Qualitatively, it means that high returns are likely to be followed by high returns, the same applying for low returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quantitatively, it means that the series of absolute returns will exhibit a significant and slowly decaying pattern as in the plot you showed above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a nutshell, what you are looking for is actually the definition of volatility clustering, i.e. if you have such pattern, it means that there is volatility clustering.&lt;/p&gt;&#xA;" OwnerUserId="26595" LastActivityDate="2017-04-26T12:17:17.540" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="33905" PostTypeId="2" ParentId="20625" CreationDate="2017-04-26T13:12:05.287" Score="1" Body="&lt;p&gt;** disclosure: I work for quasardb **&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hi - you may want to run the community edition of quasardb. If your dataset if small enough (32 GB storage) - this may very well work !&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://download.quasardb.net/quasardb/nightly/server/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://download.quasardb.net/quasardb/nightly/server/&lt;/a&gt; (get 2.1.0 that comes with native timeseries support)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is coming with a Python/EXCEL API .. R to follow. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The community edition is 100% features complete. Just the back end storage capacity that is limited.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers&#xA;Gilles&lt;/p&gt;&#xA;" OwnerUserId="27658" LastActivityDate="2017-04-26T13:12:05.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33907" PostTypeId="5" CreationDate="2017-04-26T13:56:03.487" Score="0" Body="&lt;p&gt;Financial time series may be characterized by the following stylized facts: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The autocorrelation of returns is largely insignificant. &lt;/li&gt;&#xA;&lt;li&gt;The distribution of returns is non-stationary (clustered volatility) and approximately symmetric with increasingly positive kurtosis as the time interval decreases and has a power law or Pareto-like tail. &lt;/li&gt;&#xA;&lt;li&gt;There are non-linearities in the mean and (especially) the variance of returns. &lt;/li&gt;&#xA;&lt;li&gt;Markets exhibit non-trivial scaling properties&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The above definition and description are taken from the excellent research note &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.378.6859&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;Characterization of Financial Time Series&quot;&lt;/a&gt; by Martin Sewell&lt;/p&gt;&#xA;" OwnerUserId="15154" LastEditorUserId="15154" LastEditDate="2017-04-26T18:57:40.537" LastActivityDate="2017-04-26T18:57:40.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33908" PostTypeId="4" CreationDate="2017-04-26T13:56:03.487" Score="0" Body="A stylized fact is a term used in economics to refer to empirical findings that are so consistent (for example, across a wide range of instruments, markets and time periods) that they are accepted as truth. Due to their generality, they are often qualitative. " OwnerUserId="15154" LastEditorUserId="15154" LastEditDate="2017-04-26T18:57:49.093" LastActivityDate="2017-04-26T18:57:49.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33912" PostTypeId="2" ParentId="33854" CreationDate="2017-04-26T17:26:41.960" Score="1" Body="&lt;p&gt;For a fixed interest rate or dividend payment/yield, integrating the function becomes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\large{P_T = } \Large{e^{\int_t^T r_s ds} = \Large{e^{r_s (T - t)}}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P_T$ is usually understood to be the future value of a zero-coupon bond with a face value of \$1. The present value, $P_t$, is simply then: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\large{P_t = } \Large{e^{\int_t^T -r_s ds} = \Large{e^{r_s (t - T)}}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $r_s$ is a function, then that must be accounted for in the integration. For complex functions, it is common to estimate the quantity through discretization techniques. When discounting a discrete function, a product function may be used:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\large{P_T=\prod_{t}^T(r_s + 1)}$; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;for fixed $\large{r_s}$, $\large{P_T \to  (r + 1)^{(T - t) + 1}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $r_s$ is not a deterministic function (i.e., it is stochastic), we must now take the expectation under some risk-neutral measure, $\mathbb{Q}$, where the price of a zero-coupon bond at time, $T$, equals:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\large{ \mathbb{E}[ P_T] = \mathbb{E^Q} [e^{\int _{t}^{T}r_{s}\,ds}|{\mathcal{F}}_{t}]}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\mathcal{F_t}$ is a natural filtration process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There exist many methods and models by which to express the expectation of a stochastic interest rate. E.g.: Cox-Ingersol-Ross; Ho-Lee; Hull-White; Merton; etc... The &quot;best&quot; model just depends on what you're trying to do. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When dividends are also present, it is common and mathematically convenient to assume they are a fixed proportion of $P_t$. The effect of proportional dividend is often thought of a exerting a &quot;decay&quot; on future value; it is thus common for pricing models to take the expectation of a &quot;forward&quot; value, $F_t$.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastActivityDate="2017-04-26T17:26:41.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33913" PostTypeId="1" CreationDate="2017-04-26T18:19:09.537" Score="4" ViewCount="234" Body="&lt;p&gt;My question comes in the same vein as the market estimates (roughly) how many hikes are priced in the US through looking at Fed Funds futures contracts. Is there a way to come up with a similar estimate in Europe, and if so, which contracts would one refer to?&lt;/p&gt;&#xA;" OwnerUserId="20531" LastActivityDate="2017-04-27T16:33:56.237" Title="How to quantify how many ECB hikes are priced in?" Tags="&lt;interest-rates&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33914" PostTypeId="2" ParentId="33913" CreationDate="2017-04-26T20:04:42.283" Score="2" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/8uoDN.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/8uoDN.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are some BBG quotes for EUR OIS meeting contracts.  AUD, CAD, EUR, GBP, NZD have reasonably liquid OIS meeting contracts.  A meeting contract represents a forward OIS contract starting on one central bank meeting date and terminating at the next central bank meeting date (actually effective dates of the meet dates I should say - usually the next day except for EUR where the effective date tends to be the Wednesday of the following week which is usually 6 days later than the meet date).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can probably think of the daily fixing for the appropriate OIS index (e.g. EONIA for EUR and SONIA for GBP) of each currency as being roughly constant over the life of the contract except for some end-of-month funding oddities that cause spikes in the respective indices sometimes.  Then consider the fixed rate of the meeting contract relative to what the current policy rate is to get the expected number of hikes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another technicality is that there is often some spread to where the fixing are currently happening relative to where the policy rate is targeting.  As an example, for GBP, SONIA is fixing around 21.2 bps for the most part even though the policy rate is 25 bps.  Right now the first GBP OIS meeting contract (GPSF1A Curncy  in BBG) is trading around 21.1 bps - this implies pretty much a 0% chance of a rate change - and not a (25-21.1)/25 chance of a 25 bps cut because the fixings are already around 21.2 bps as it is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To value the swap properly, you need to use the correct conventions for each currency and bear in mind that the floating leg is compounding daily (weighted by the number of days between fixes).  The compounding is probably just a rounding error, but getting the ACT/36X convention right is important.&lt;/p&gt;&#xA;" OwnerUserId="26977" LastEditorUserId="2379" LastEditDate="2017-04-27T16:33:56.237" LastActivityDate="2017-04-27T16:33:56.237" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33916" PostTypeId="1" CreationDate="2017-04-27T00:19:06.047" Score="1" ViewCount="1725" Body="&lt;p&gt;Would be very grateful for some help in comparing the single index model with other multi-index models in computing the variance-covariance matrix.&lt;/p&gt;&#xA;" OwnerUserId="27350" LastEditorUserId="467" LastEditDate="2017-05-24T06:27:06.017" LastActivityDate="2017-05-24T06:27:06.017" Title="What is the difference between the Single Index Model and Multi-Index Models in computing the variance-covariance matrix of stock returns?" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;covariance-matrix&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33917" PostTypeId="1" AcceptedAnswerId="33933" CreationDate="2017-04-27T00:46:59.247" Score="2" ViewCount="660" Body="&lt;p&gt;I am comparing two methods: Least squares by Longstaff and Schwartz and A Forward Monte Carlo method. I am not sure what price I should consider as the &quot;true value&quot; to compare these two approaches. Any suggestions are greatly appreciated. The option is an American call. &lt;/p&gt;&#xA;" OwnerUserId="19002" LastEditorUserId="467" LastEditDate="2017-04-27T01:19:48.010" LastActivityDate="2017-04-27T21:57:37.723" Title="Shall I use the Longstaff and Schwartz method or the forward Monte Carlo method to price an American call?" Tags="&lt;option-pricing&gt;&lt;programming&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="10" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33918" PostTypeId="2" ParentId="33916" CreationDate="2017-04-27T01:20:46.600" Score="1" Body="&lt;p&gt;In a single factor model the covariance matrix of the returns is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Omega=\sigma_M^2\beta\beta^T+D$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\sigma_M^2$is the market variance, $\beta$ is an N vector containing the Betas of the N securities, and $D$ is a diagonal matrix containing the residual variances of the N securities. This kind of matrix is fairly simple and far from general.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a multiple factor model with K factors this generalizes to &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Omega= B\Omega_f B^T+D$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;now $B$ is an $K \times N$ matrix of factor loadings and $\Omega_f$ is the $K \times K$ covariance of the factors. Again $D$ is a diagonal matrix of idiosyncratic variances for the N securities. This kind of model can produce matrices more complex (of higher rank) than the prior method. However, it still cannot match any arbitrary covariance matrix unless $K=N$. With $K \lt N$ it involves some approximation or simplification compared to an arbitrary covariance matrix.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-04-27T01:20:46.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33920" PostTypeId="2" ParentId="33899" CreationDate="2017-04-27T04:03:15.150" Score="4" Body="&lt;p&gt;I think @zer0hedge has constructed a clever example by which to demonstrate what is implied by the stylized &lt;em&gt;fact&lt;/em&gt; by which volatility begets volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is correct to conclude volatility bursts are a type of absolute autocorrelation. All volatility bursts display characteristics of autocorrelation of absolute returns, but will all types of autocorrelation of absolute returns display characteristics of volatility clustering? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I say no because this explanation leaves out other ways in which absolute returns can show signs of autocorrelation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to demonstrate the stylized fact by which volatility is assumed to be stochastic (e.g., a non-stationary, mean-reverting process), we can rewrite a modified GBM as such (Heston-like model):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\dfrac{dS_t}{S_t} = \mu \Delta t + \sigma_t \sqrt{\Delta t}*dZ_1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d \sigma^2_t \propto \eta \,\sigma \sqrt{\Delta t}*dZ_2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\langle dZ_1 \, dZ_2 \rangle = \rho \, dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where: $dZ_1$ and $dZ_1$ are Wiener processes; $\eta$ is the volatility of volatility; and, $\rho$ is the correlation between returns and changes in $\sigma^2_t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we take the expectation with $\rho =0$, then a corresponding time-series will not be expected to produce autocorrelation of absolute returns because:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma _{Z_1+Z_2}={\sqrt {\sigma _{Z_1}^{2}+\sigma _{Z_2}^{2}+2\rho \, \sigma _{Z_1}\sigma _{Z_2}}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or, the net effect of zero correlation is that expected value of two super-imposed random variables will be indistinguishable from simply raising the expectation for deterministic volatility because &lt;a href=&quot;https://en.wikipedia.org/wiki/Sum_of_normally_distributed_random_variables&quot; rel=&quot;nofollow noreferrer&quot;&gt;the sum of two normally distributed random variables is normally-distributed&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if the we assume that returns are trending (i.e., price momentum is accelerating/decelerating; i.e., $\mu_t$ is autocorrelated) then we should also expect to observe autocorrelation of absolute returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, say $\mu_t$ is a function of $t$, e.g.:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d\mu_t \propto \mu_{t-\Delta t}\alpha\sqrt{t} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where: $\alpha$ is the co-efficient of auto-correlation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the rate of change in returns are correlated to prior returns, then it would follow that the values of absolute returns are also correlated even in the absence of stochastic volatility and/or volatility clustering/bursts. Or, quite simply: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mid \frac{dS_t}{S_t} - \mathbb{E}[\frac{dS}{S}]\mid \approx \sqrt{(\frac{dS_t}{S_t}-\mathbb{E}[\frac{dS}{S}])^2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With so many plausible schemas that fit observations, how are any of them significantly different than astrology?&lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2017-05-01T06:10:21.540" LastActivityDate="2017-05-01T06:10:21.540" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33923" PostTypeId="1" AcceptedAnswerId="33927" CreationDate="2017-04-27T13:04:58.373" Score="4" ViewCount="450" Body="&lt;p&gt;Using finite difference method for the Black-Scholes-Partial Differential Equation one need to impose some boundary conditions on the edge of the grid, i.e for a Grid on $D=[a,b]\times R^+$ one need to impose the boundary condition on $V(a,t)$ and $V(b,t)$, where $V(x,t)$ is described by Black-Scholes-Partial Differential Equation with $x$ and $t$ representing respectively the underlying price and the time-to-maturity of the derivative $V$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question: By imposing those boundary condition, does it has impact on the well-posedness of the problem? From non-stochastic partial differential equation we know that adding boundary condition could make the initial value problem ill-posed. Is there any &quot;rule&quot; of choosing boundary conditions ensuring the problem to be well posed?&lt;/p&gt;&#xA;" OwnerUserId="25867" LastEditorUserId="26595" LastEditDate="2017-04-27T15:29:22.943" LastActivityDate="2017-04-27T15:29:22.943" Title="Finite Difference Method for Black-Scholes-Formula" Tags="&lt;black-scholes-pde&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33924" PostTypeId="1" CreationDate="2017-04-27T14:00:04.350" Score="1" ViewCount="43" Body="&lt;p&gt;Assume a BS model. For a European call option with strike $K$ and expiry $T$, its intrinsical value at time $t$ is defined to be $(S_t-K)_+$ i.e. the payoff we could get if we immediately exercised the option. It can be shown that it is less than its real BS value $c_t$. So we denote its &lt;em&gt;time value&lt;/em&gt; $W_t$ as the difference between the two:&#xA;$$W_t = c_t - (S_t-K)_+&amp;gt;0.$$&#xA;Now we further decompose $W_t$ into two parts $W_t^{de}$ and $W_t^{dc}$, with $W_t^{de}$ meaning &quot;the value of being able to defer exercise&quot; and $W_t^{dc}$ &quot;the value of being able to defer cash flows arising from sale or purchase of asset&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Definitions given in finance class:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Deferral-of-exercise value (insurance value)&lt;/strong&gt; is always positive. It is most valuable for at-the-money options, not worth much if option is deep in or out of the money since the decision is already fairly clear then.&lt;br&gt;&lt;br&gt;&#xA;  &lt;strong&gt;Deferral-of-cash-flows value (cost of carry)&lt;/strong&gt; is more complicated and differs between calls and puts. &lt;br&gt;&#xA;  - A call holder may in principle pay over $K$ and receive asset. The deferral value is in not choosing to pay over $K$ and meanwhile receive interest on it. The value of this strategy is positive.&lt;br&gt;&#xA;  - But for a put deferring receipt of the strike price $K$ means loss of its interest, so it is negative.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But I am never quite clear on the following questions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1). is such a decomposition conventional?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2). if so, how to define $W_t^{de}$ and $W_t^{dc}$ mathematically (at least in the BS model)? I really have some trouble understanding the vague definitions given in my class.&lt;/p&gt;&#xA;" OwnerUserId="19004" LastEditorUserId="19004" LastEditDate="2017-04-27T14:09:30.927" LastActivityDate="2017-04-27T14:09:30.927" Title="Rigorous definition of the two values of a European call" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;valuation&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33925" PostTypeId="2" ParentId="29622" CreationDate="2017-04-27T14:03:40.947" Score="1" Body="&lt;p&gt;To learn more about these type of volatility models, I suggest you to have a look on this research paper &lt;a href=&quot;http://math.cims.nyu.edu/faculty/avellane/UVMfirst.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://math.cims.nyu.edu/faculty/avellane/UVMfirst.pdf&lt;/a&gt;.&#xA;They provide robust heding of volatility derivatives &lt;/p&gt;&#xA;" OwnerUserId="27672" LastActivityDate="2017-04-27T14:03:40.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33926" PostTypeId="2" ParentId="30288" CreationDate="2017-04-27T14:11:21.113" Score="2" Body="&lt;p&gt;Rt in your notation is &quot;filtered&quot; variance R(t|t). The prediction of variance R(t+1|t) adds another term which is not guaranteed to be decreasing overtime.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think another critical assumption is Ve in your equation. How do you define Ve?  For price series Ve as a proxy for volatility makes sense to be time-varying, and probably exhibit some auto-correlation.  &lt;/p&gt;&#xA;" OwnerUserId="5861" LastActivityDate="2017-04-27T14:11:21.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33927" PostTypeId="2" ParentId="33923" CreationDate="2017-04-27T15:05:56.250" Score="3" Body="&lt;p&gt;It depends on the type of payoff you want to price. If it is a call option, you know that $V(0,t) = 0$ and $V(x,t) \approx x$ when $x \rightarrow +\infty$ so you can use a dirichlet condition $V(a,t) = 0$ and $V(b,t) = b$. Alternatively you can use a linear condition $\frac{\partial^2V}{\partial x^2} = 0$ which in practice works fine for a variety of payoffs.  The only case where you have to be carefull is when you price barrier options, for instance an up and out option, in which case $b$ will be set to the barrier and you have to use the dirichlet condition $V(b,t) = $ payoff on barrier. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that to improve numerical convergence of the scheme it is better to have constant coefficients if front of the $\frac{\partial^2V}{\partial x^2}$ term in the PDE when you use a uniform grid, so in the case of the Black &amp;amp; Scholes PDE you should work in $y = \log(x)$ space. &lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2017-04-27T15:05:56.250" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="33928" PostTypeId="2" ParentId="30288" CreationDate="2017-04-27T15:06:44.890" Score="3" Body="&lt;p&gt;I would suggest check out the &lt;a href=&quot;https://en.wikipedia.org/wiki/Kalman_filter&quot; rel=&quot;nofollow noreferrer&quot;&gt;Wikipedia&lt;/a&gt; page first and use more stylized notations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your update equation &lt;code&gt;mean(t) =  mean(t-1) + K(t) * ( price(t) - mean(t-1) )&lt;/code&gt; you are basically saying that your state process is &lt;code&gt;mean(t)&lt;/code&gt; and &lt;code&gt;price(t)&lt;/code&gt; is a measurement of &lt;code&gt;mean(t)&lt;/code&gt;. This doesn't sound legit&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, you could have a mean reverting process $$\text{price}(t) = \text{price}(t-1) + \alpha (\text{mean}(t-1) - \text{price}(t-1))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Although it looks similar, it's fundamentally different from the update equation in Kalman filter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the state vector for this process could be $X_t = \begin{bmatrix}\text{price}(t) \\ \text{mean}(t) \end{bmatrix}$ and state transition equation could be $$\begin{bmatrix}\text{price}(t) \\ \text{mean}(t) \end{bmatrix} = \begin{bmatrix} 1-\alpha &amp;amp; \alpha \\ 0 &amp;amp; 1 \end{bmatrix}&#xA;\begin{bmatrix}\text{price}(t) \\ \text{mean}(t) \end{bmatrix} + \begin{bmatrix}\epsilon_1(t) \\ \epsilon_2(t) \end{bmatrix}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Denote $F_t =  \begin{bmatrix} 1-\alpha &amp;amp; \alpha \\ 0 &amp;amp; 1 \end{bmatrix}$ then the above equation is simply $$X_t = F_tX_t + \epsilon_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The measurement equation could be &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Z_t = H_tX_t + \nu_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Z_t$ is the acutal price series and $H_t = \begin{bmatrix} 1 &amp;amp; 0 \end{bmatrix}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The you can use the Kalman filter two-step recursion to estimate the &lt;code&gt;mean(t)&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="17835" LastActivityDate="2017-04-27T15:06:44.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33929" PostTypeId="1" AcceptedAnswerId="33935" CreationDate="2017-04-27T16:26:08.097" Score="0" ViewCount="700" Body="&lt;p&gt;FX forward rate should reflect the difference in the interate in the two currencies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the moment GBP USD is trading near 1.29. The 5 year yield for US treasuries is about 1.87% and the UK 5 year gilt is currently yielding about 0.5%. This we would expect this is reflected in the GBP USD forward rate. We should expect the 5 year GBP USD rate to be lower than the current rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the current GBPUSD forward quotes I am seeing is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Period  GBPUSD&lt;/p&gt;&#xA;&#xA;&lt;p&gt;SPOT    1.2848&lt;/p&gt;&#xA;&#xA;&lt;p&gt;M12 1.299483&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Y2  1.3175&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Y3  1.336775&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Y4  1.356516&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Y5  1.3755&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Y6  1.3933&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is there a discrepancy? Why is there no arbitrage? Is my reference rate wrong?&lt;/p&gt;&#xA;" OwnerUserId="3334" LastActivityDate="2017-04-28T05:42:24.033" Title="FX forward rates" Tags="&lt;fx&gt;&lt;arbitrage&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33930" PostTypeId="2" ParentId="29622" CreationDate="2017-04-27T17:55:12.377" Score="2" Body="&lt;p&gt;It is definitely used in practice:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It affords a tractable way of pricing in a skew that is easier understood&lt;/li&gt;&#xA;&lt;li&gt;Avellaneda proves that a derivative priced under any stochastic volatility process that is bounded by (sigma_min, sigma_max) will produce a cheaper price than under UVM&lt;/li&gt;&#xA;&lt;li&gt;It is easily implemented into any PDE pricer at no calc time cost&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Edit: just to challenge myself on third bullet point. Given how UVM has two vols, if you are using Euler (i.e. conditionally stable, first-order accuracy) you need to use the larger of the vols for the spatial step size to remain stable. This is not ideal for reasons of accuracy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rather than move to ADI (unconditionally stable, second-order) which is not simple to implement, i am a strong pusher of ADE (alternate direction explicit) which achieves the same stability and accuracy ADI but with the code- and computation-complexity of two passes of an Euler discretisation. Look up ADE by Daniel Duffy if of interest. &lt;/p&gt;&#xA;" OwnerUserId="27516" LastEditorUserId="27516" LastEditDate="2017-04-28T04:53:16.703" LastActivityDate="2017-04-28T04:53:16.703" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33933" PostTypeId="2" ParentId="33917" CreationDate="2017-04-27T21:57:37.723" Score="1" Body="&lt;p&gt;Given the optimal exercise boundary is only an estimate, both the methods underestimate the &quot;true value&quot; of the option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A simple comparison would be whichever method produced higher price for the option is better.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For this comparison to make sense, you could&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;re-use underlying stock simulation across both the methods.&lt;/li&gt;&#xA;&lt;li&gt;make sure variance of price produced is reasonably low for both.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The &quot;better&quot; value of the two is still a lower bound and doesn't really throw information on how big the error is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could implement dual method to produce upper bound and thus a range for the true option price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Again, this range is meaningful only if the underlying stock simulation ( vol model ) is meaningful. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remember 'garbage in garbage out'&lt;/p&gt;&#xA;" OwnerUserId="3101" LastActivityDate="2017-04-27T21:57:37.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33934" PostTypeId="1" AcceptedAnswerId="33944" CreationDate="2017-04-28T05:41:11.413" Score="1" ViewCount="250" Body="&lt;p&gt;Excerpted from Marek Musiela and Marek Rutkowski's &lt;em&gt;Martingale Methods in Financial Modelling&lt;/em&gt;, Second Edition.&lt;a href=&quot;https://i.stack.imgur.com/HEHJo.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/HEHJo.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think I understand formula 3.71: paying cash dividend $\kappa_j$ at time $T_j$ will cause the stock price to drop by the same amount immediately, as is reflected in the subtraction from the firm capital value $G_t$ by $D_t$ in the stock price. (I understand the capital value as the stock price that would have been if no past cash dividends had been issued.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what does the second formula (3.72) mean? To me, $\tilde D_t$ means the present value (at $t$) of all future dividends to be paid after $t$. But what does the sum $S_t=G_t+\tilde D_t$ mean? How can the stock price exceed the capital value of the firm? Also, as opposed to $G_0=S_0$ implied by the first formula, the second formula implies that $G_T=S_T$, how is it reasonable? It looks as if by the expiry, the dividends paid will have had no impact on the stock price at all.&lt;/p&gt;&#xA;" OwnerUserId="19004" LastEditorUserId="19004" LastEditDate="2017-04-28T05:53:39.293" LastActivityDate="2017-04-28T14:12:05.057" Title="What is the other type of impact of dividends on the stock price in this formula?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;equities&gt;&lt;black-scholes&gt;&lt;dividends&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33935" PostTypeId="2" ParentId="33929" CreationDate="2017-04-28T05:42:24.033" Score="3" Body="&lt;p&gt;I am assuming you are confused because you expect the USD to be stronger with the higher interest rates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I had the exact same issue as you just a few months ago. The simplest way to clarify this is that the forward market is created on a NO arbitrage basis. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By logic, we assume that the country with the higher interest rates attracts more foreign investments and thereby appreciating that country's currency. The forward market is there to prevent arbitrage opportunities like this where you can invest in the higher interest rate country and simultaneously hedge your exchange exposure by going into a forward contract that allows you to exchange back into your own currency for higher interest profits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By arbitrageurs who look to do this, the forward market should have high demand for GBP/USD (they are trying to lock in rates) and therefore GBP/USD increases instead of lowers. The calculation of forward prices takes this into account and that is why you have forward rates that do not align with your expectations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note also that forward rates are by no means an indication of future prices. They are simply there mostly as a hedging tool. The currency with the higher interest rates can most definitely end up appreciating against against the lower interest rate currency even though the forward markets says otherwise. For more information on this you can do a google search on Japaneses Yen against USD which is an interesting read.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The issue you question here can be found here -&lt;a href=&quot;http://www.investopedia.com/terms/u/uncoveredinterestrateparity.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.investopedia.com/terms/u/uncoveredinterestrateparity.asp&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I suggest you read through BOTH covered and uncovered interest rate parities to fully understand.&lt;/p&gt;&#xA;" OwnerUserId="27497" LastActivityDate="2017-04-28T05:42:24.033" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33936" PostTypeId="1" AcceptedAnswerId="33943" CreationDate="2017-04-28T07:24:29.240" Score="1" ViewCount="324" Body="&lt;p&gt;From &lt;strong&gt;The Book&lt;/strong&gt; by Hull:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/GLOAX.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/GLOAX.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And Hull's comment:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ol start=&quot;2&quot;&gt;&#xA;  &lt;li&gt;This rule is analogous to the one developed in Section 14.12 for valuing a European option on a stock&#xA;  paying known cash dividends. (In that case we concluded that it is correct to reduce the stock price by the&#xA;  present value of the dividends; in this case we discount the stock price at the dividend yield rate.)&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What 14.12 says is if there is a known future cash dividend $(D,\tau)$ then the European call price at the beginning is the value obtained by replacing $S_0$ with $S_0-D_0$ in the BS formula where $D_0=De^{-r\tau}$ represents the present value of the cash dividend at time $0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I'm quite confused how Hull has developed this analogue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My attempt to analogise his argument for continuous dividend yield: in the case of a known cash dividend $(D,\tau)$ suppose our stock grows from $S_0$ at time $0$ to $S_T$ at time $T$; then in the absence of this dividend I think the stock would grow to $S_T + De^{r(T-\tau)}$ (a bit dubious); the ratio of growth is thus $(S_T + De^{r(T-\tau)})/S_0$. Now, without any dividend, what initial stock price would grow to $S_T$ following this ratio? It must be $S_T/((S_T + De^{r(T-\tau)})/S_0)$. So it means that replacing $S_0$ with this amount in the BS formula gives the price in case of a known cash dividend, which is completely ridiculous, as the correct formula Hull gives replaces $S_0$ with $S_0-De^{-r\tau}$ instead.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what is wrong with my reasoning and what should be the correct way to prove this analogue?&lt;/p&gt;&#xA;" OwnerUserId="19004" LastActivityDate="2017-04-28T13:18:57.177" Title="What is the analogue used by Hull to price European calls with known cash dividends?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;dividends&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33938" PostTypeId="1" AcceptedAnswerId="33939" CreationDate="2017-04-28T09:04:30.367" Score="0" ViewCount="1380" Body="&lt;p&gt;Suppose we have $n$ assets, each of which has weight $w_i$ in the portfolio. The log return of asset $i$ is denoted by $r_i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the intuition why this holds approximately:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;ln \left( \sum_i w_i e^{r_{i,t}}\right) \approx \sum_i w_i r_{i,t}&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="13383" LastActivityDate="2017-04-28T09:20:33.873" Title="Intuition behind log return of portfolio = weighted sum of log returns" Tags="&lt;mathematics&gt;&lt;log-returns&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33939" PostTypeId="2" ParentId="33938" CreationDate="2017-04-28T09:20:33.873" Score="4" Body="&lt;p&gt;The above relation really only approximately. If you consider arithmetic retunrs then it is exact.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the approximation you just need to look at the Taylor series of the exponential:&#xA;$$&#xA;e^x = 1 + x + \text{ terms of higher order}.&#xA;$$&#xA;These terms of higher order ($x^2$ and $x^3$) become small if $x$ is much smaller than one - which holds true for returns.&#xA;Thus&#xA;$$&#xA;\sum_i w_i e^{r_i} \approx \sum_i w_i ( 1+ r_i) = 1 + \sum_i w_i r_i,&#xA;$$&#xA;if $\sum_i w_i = 1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then conside that  $\ln(1+x) \approx x$ (you can check &lt;a href=&quot;https://www.wolframalpha.com/input/?i=ln%281%2Bx%29&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;) and you are done:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\ln \left(1 + \sum_i w_i r_i \right) \approx \sum_i w_i r_i.&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2017-04-28T09:20:33.873" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33941" PostTypeId="1" AcceptedAnswerId="33953" CreationDate="2017-04-28T11:10:44.087" Score="6" ViewCount="382" Body="&lt;p&gt;I am trying to replicate some results from the Betting Against Beta paper by Frazzini &amp;amp; Pedersen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In section 3.1, &lt;em&gt;Estimating Ex Ante Betas&lt;/em&gt;, they illustrate their approach to correlations:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;[we use] overlapping three-day log returns, $r_{i,t}^{3d}=\sum_{k=0}^2ln(1+r_{t+k}^i)$, for correlation to control for nonsynchronous trading (which affects only correlations).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So basically they just make the return of period i equal the average of the returns of period i and the next two periods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Do I use overlapping three day log returns for both stock and market returns, or just for the stock returns?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried both. Just using overlapping stock returns give me very low correlations, none above 0.55 (for stock that should be highly correlated with the market proxy, as they are part of it's constituents)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using overlapping returns on both stock and market returns gives me a maximum correlation of 0.95, and higher correlations in general, which I find more plausible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bonus question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you refer me to a journal article or textbook that explains the reasoning of this correction and potential pitfalls (if any)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Background info: I'm replicating the results for the Danish equity market. MSCI Denmark is used as a market proxy (author's choice)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers!&#xA;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="27493" LastActivityDate="2017-04-29T21:00:33.013" Title="Control for non-synchronous trading in correlations" Tags="&lt;equities&gt;&lt;returns&gt;&lt;correlation&gt;&lt;market&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33942" PostTypeId="1" CreationDate="2017-04-28T12:42:09.540" Score="4" ViewCount="249" Body="&lt;p&gt;Are there data sources from which we could get news articles from the last 2 years? I tried reuters but they had data spanning back to just 3 months.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestion/pointers are appreciated&lt;/p&gt;&#xA;" OwnerUserId="27685" LastActivityDate="2019-03-22T09:43:39.633" Title="Data sources to get past news articles" Tags="&lt;programming&gt;&lt;data-source&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33943" PostTypeId="2" ParentId="33936" CreationDate="2017-04-28T13:18:57.177" Score="2" Body="&lt;p&gt;Remember that Black-Scholes formula applies to &lt;em&gt;lognormally distributed&lt;/em&gt; (under $\Bbb{Q}$) terminal asset prices $S_T$. It is convenient to write this assumption &#xA;$$ S_T \underset{\Bbb{Q}}{\sim} \ln \mathcal{N}\left( \ln(F(0,T))-\frac{1}{2}\sigma^2 T, \sigma^2 T \right) \tag{A} $$&#xA;since it shows that the forward price is the risk-neutral expectation of the future asset price&#xA;$$\Bbb{E}_0^\Bbb{Q} [ S_T ] = F(0,T)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When $(A)$ holds, the price of a European call of strike $K$ and maturity $T$ reads (Black-Scholes formula)&#xA;$$ C(K,T) = DF(0,T) \left( F(0,T) N(d_+) - K N(d_-) \right) $$&#xA;$$ d_{\pm} = \frac{\ln\left( \frac{F(0,T)}{K}\right) \pm \frac{1}{2}\sigma^2 T}{\sigma \sqrt{T}} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now think of how dividends, impact the forward price in &lt;strong&gt;[MODEL 1]&lt;/strong&gt; (dividend yield model) and &lt;strong&gt;[MODEL 2]&lt;/strong&gt; (escrowed model).&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;[MODEL 1]&lt;/strong&gt;: Solving the corresponding SDE $$ dS_t/S_t = (r-q)dt + \sigma dW_t^\Bbb{Q},\,\,\, S(0)=S_0 $$&#xA;yields $S_T = S_0 e^{(r-q)T} \mathcal{E}\left[\sigma W_T^\Bbb{Q}\right]$ (lognormal), hence a forward price&#xA;$$ F(0,T) =  S_0 e^{(r-q)T} = \underbrace{S_0 e^{-qT}}_{S_0^*} e^{rT} \tag{B} $$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;[MODEL 2]&lt;/strong&gt;: Solving the corresponding SDE $$ dS_t/S_t = r dt + \sigma dW_t^\Bbb{Q},\,\, S(0)=S_0-De^{-r\tau} $$&#xA;yields $S_T = S(0)e^{(r)T} \mathcal{E}\left[\sigma W_T^\Bbb{Q}\right]$ (lognormal), hence a forward price&#xA;$$ F(0,T) =  \underbrace{\left( S_0 -De^{-r\tau} \right)}_{S_0^*} e^{rT}  \tag{C} $$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This shows that, under both of these models, one can use BS formula $(A)$ by provided one replaces the forward price by what it is under each respective modelling assumption, which is mathematically equivalent (looking at the BS formula only) to using the spot value $S_0^*$ (see $(B)$ and $(C)$) instead of $S_0$.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2017-04-28T13:18:57.177" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33944" PostTypeId="2" ParentId="33934" CreationDate="2017-04-28T13:43:57.460" Score="1" Body="&lt;p&gt;Let $G_t$ represents the price of the stock as if it paid no dividends.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The models you discuss above correspond to two different ways of viewing the price of a dividend-paying stock&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Case 1&lt;/strong&gt;: $G_t$ minus the (capitalised) value of all &lt;em&gt;past&lt;/em&gt; cash distributions that you were entitled to by holding to the stock.&#xA;$$ S_t = G_t - D_t $$&#xA;in that case you start from $S_0 = G_0$ and finish at $S_T = G_T - D_T$. The advantage with that model is that it still allows the BS formula to be used, provided one modifies (shifts) the strike price.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Case 2&lt;/strong&gt;: $G_T$ plus the (discounted) value of all &lt;em&gt;future&lt;/em&gt; cash distributions that you are entitled to by holding the stock.&#xA;$$ S_t = G_t + \tilde{D}_t $$&#xA;in that case you start from $S_0 = G_0 - \tilde{D}_0$ and finish at $S_T = G_T$. This is known as the escrowed model. The advantage with that model is that it still allows the BS formula to be used, provided one modifies the spot price, see &lt;a href=&quot;https://quant.stackexchange.com/questions/33936/what-is-the-analogue-used-by-hull-to-price-european-calls-with-known-cash-divide/33943#33943&quot;&gt;this&lt;/a&gt; related question.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2017-04-28T14:12:05.057" LastActivityDate="2017-04-28T14:12:05.057" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33945" PostTypeId="1" CreationDate="2017-04-28T15:11:30.877" Score="-1" ViewCount="258" Body="&lt;p&gt;I'm trying to build a multi year time series for a 3 month futures contract. How do I handle rolls? On the day of roll, volatility is high and I want to roll over to next contract series in a way that gives roll adjusted prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What sort of interpolation I can use or proxy using spreads? ANy suggestions welcome&lt;/p&gt;&#xA;" OwnerUserId="2198" LastActivityDate="2017-04-29T02:48:39.933" Title="time series for futures roll" Tags="&lt;time-series&gt;&lt;futures&gt;&lt;roll-adjustment&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33946" PostTypeId="1" CreationDate="2017-04-28T19:01:29.270" Score="1" ViewCount="91" Body="&lt;p&gt;I am writing a simulation of how traders will behave in an emergent market. The idea is to see how traders can use information from other traders to make a decisions as to whether they will buy, sell, or stay out of a market. Here is my code so far:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;f1 &amp;lt;- function(n,m,priceinitial,delta,mean, sd, ninterval){&#xA;traders &amp;lt;- vector(mode=&quot;character&quot;, length=n)&#xA;traderscurrent &amp;lt;- vector(mode=&quot;character&quot;, length=n)&#xA;price &amp;lt;- vector(mode=&quot;numeric&quot;)&#xA;pricecurrent &amp;lt;- vector(mode=&quot;numeric&quot;)&#xA;for(nint in 1:ninterval)&#xA;{&#xA;  L = floor(rnorm(1,mean,sd))&#xA;  print(L)&#xA;  x3 &amp;lt;- runif(2,0,1)&#xA;  v &amp;lt;- c(0, min(x3), max(x3))&#xA;  for(i in 1:n)&#xA;  {&#xA;    traders[i] &amp;lt;- runif(1,0,1)&#xA;    if(findInterval(traders[i],v) == sample(c(1,3),1))&#xA;       {&#xA;         traders[i] &amp;lt;- &quot;B&quot;&#xA;       }&#xA;       else if(findInterval(traders[i],v) == 2)&#xA;               {&#xA;         traders[i] &amp;lt;- &quot;N&quot;&#xA;       }&#xA;    else {&#xA;         traders[i] &amp;lt;- &quot;S&quot;&#xA;    }&#xA;  }&#xA;  print(table(traders))&#xA;  for(step in 1:L)&#xA;  {&#xA;&#xA;    for(i in 1:n)&#xA;    {&#xA;      b &amp;lt;- sample(traders[-i], m)&#xA;      #print(b)&#xA;      #table(b)&#xA;      traderscurrent[i] &amp;lt;- sample(b,1)&#xA;&#xA;    }&#xA;    print(table(traderscurrent))&#xA;    pricecurrent[step] = priceinitial+length(which(traderscurrent == &quot;B&quot;))*delta-length(which(traderscurrent == &quot;S&quot;))*delta&#xA;    priceinitial = pricecurrent[step]&#xA;    traders &amp;lt;- traderscurrent&#xA;    #print(nint)&#xA;    #print(step)&#xA;  }&#xA;    price &amp;lt;- c(price,pricecurrent)&#xA;    #price &amp;lt;- price[-step]&#xA;    plot(price)&#xA;}&#xA;print(price)&#xA;#plot(price)&#xA;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Basically we start off with $n$ traders who can look at $m &amp;lt; n$ others traders to make their decision. The &lt;code&gt; priceinitial &lt;/code&gt; is updated by &lt;code&gt; delta &lt;/code&gt; depending on the actions of the traders. Does anyone have any suggestions on how to improve this code/simulation? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: This simulation is written in R.&lt;/p&gt;&#xA;" OwnerUserId="27690" LastEditorUserId="27689" LastEditDate="2017-04-30T15:06:35.213" LastActivityDate="2017-04-30T15:06:35.213" Title="Simulation of Traders" Tags="&lt;simulations&gt;&lt;price&gt;" AnswerCount="0" CommentCount="8" ClosedDate="2017-05-14T11:21:51.543" ContentLicense="CC BY-SA 3.0" />
  <row Id="33947" PostTypeId="1" CreationDate="2017-04-28T19:43:35.603" Score="2" ViewCount="2211" Body="&lt;p&gt;What is the difference between &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) computing the 'forward price' of a bond at a future time T. ( spot price - carry, involving repo rates) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) computing the price of a bond (discounting all cash flows) with a settlement date on T.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And if I were to compute the DV01 of a Treasury future, are both of these acceptable:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) Compute the change in forward price as defined in 1) when tweaking par yields and repo rates, with the forward date being hte delivery date of the future contract.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) Compute the change in price of a bond as defined 2), with the settlement being the delivery date of the contract, a conversion factor applied to the result.&lt;/p&gt;&#xA;" OwnerUserId="27691" LastActivityDate="2019-01-07T09:14:41.740" Title="&quot;Forward price of bond&quot; VS &quot;Price of a bond with a future settlement date&quot;" Tags="&lt;bond&gt;&lt;forward&gt;&lt;bond-futures&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33948" PostTypeId="1" CreationDate="2017-04-28T22:15:09.817" Score="11" ViewCount="4684" Body="&lt;p&gt;I'm working on a model to determine trends (direction detection or turning point detection). Suppose that we have a stock trend which is illustrated below. Blue line is real trend of stock close prices and red line is imaginary approximation of the trend line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ASPUD.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ASPUD.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I implemented different models such as &lt;code&gt;Piecewise Linear Representation (PLR)&lt;/code&gt; or &lt;code&gt;Wavelet&lt;/code&gt; to find the red line but I haven't got precise results so far. What is your recommendation for this problem?&lt;/p&gt;&#xA;" OwnerUserId="8234" LastActivityDate="2017-07-28T18:34:15.690" Title="Determine trends of data (direction detection or turning point detection)" Tags="&lt;equities&gt;&lt;machine-learning&gt;&lt;prediction&gt;&lt;data-mining&gt;&lt;trends&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="33949" PostTypeId="2" ParentId="33948" CreationDate="2017-04-28T23:20:28.120" Score="1" Body="&lt;p&gt;Your question is very general and I am sure it can be approached from different angles. Segmenting a time series as per the diferent components may help you to forecast each individua part also segmenting it in time spads as per volatility as well, comparing these also. In this regard consider, (I did some minor thinking on this a while ago). I am sure other people may have better ideas or it can be approached from a technical analysis point of view which where there are a number of toos you can use from).  This is what I though a while ago.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Making the series stationary by taking diferences &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Detrending the series. (Long term trends). Once this is done. which you &#xA;can use this to forecast it).  &lt;/li&gt;&#xA;&lt;li&gt;Applying a loess regression to extract cycles to detrended series (smaller &#xA;trends) - careful consideration to variance and degree of the polynomial &#xA;to apply. I do not remember well but time spand I think should be optized &#xA;as per variance. (you can also use this as to forecast the cycle) &lt;/li&gt;&#xA;&lt;li&gt;if you want you can segment the obtained series as per regime change &#xA;methods (usually mean and variance should be used). &lt;/li&gt;&#xA;&lt;li&gt;Applying wavelets to the segments maybe usefull if there is a significant &#xA;signal somewhere, however in general signal on stock indexes is minor &#xA;(probably larger on individual stocks but I do not know how significant). &#xA;You can apply wavelets (however they have boundary issues and levels which &#xA;forbit forecasting) you can then use very short length filters and extract &#xA;the higher frequency ones ( where most of the signal and noise resides ). &#xA;In order to obtain a signal from noise you have to model the types of &#xA;noises that you know or think you know exist in the signal and extracted &#xA;from the signal (this is the trickiest part).  &lt;/li&gt;&#xA;&lt;li&gt;Apply some robust regresion models to forecast the signal and use &#xA;volatility models to apply to noise (if mostly white noise just use vol &#xA;models). (however regression is tricky - read some econometrics papers and talk to some persons in the field to get a sense of numbers and how to use it properly in regression). Some times I have been told using properly a regression may be much better than using a bunch of processes as explained).  &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="7616" LastEditorUserId="-1" LastEditDate="2017-05-29T12:22:50.580" LastActivityDate="2017-05-29T12:22:50.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33950" PostTypeId="2" ParentId="33947" CreationDate="2017-04-28T23:42:54.330" Score="1" Body="&lt;p&gt;With regard to your first question: theoretically, these two methods should produce the same forward price. In practice, they might not. This is because a lot of (most?) institutions build the front end of the bond curve using short-term Treasuries. The forward price calculated using such a curve (as discounted present value) effectively assumes the forward position is financed at short-term Treasury rates. By contrast, your &quot;spot - carry&quot; calculation mostly likely uses repo financing. Since repo trades at a spread to Treasury rates, the two answers will differ slightly. If your yield curve is built with repo rates at the front end, you'd have no problems. (There's another reason why the two answers might differ, which boils down to what market convention you use to calculate your carry, see &lt;a href=&quot;https://quant.stackexchange.com/questions/30065/formula-for-forward-price-of-bond/30067#30067&quot;&gt;formula for forward price of bond&lt;/a&gt; for details.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to bond futures DV01, it is most often calculated by shifting the yields of the entire delivery basket by $x$ basis points, &lt;em&gt;holding repo rates constant&lt;/em&gt;, and then apply a bond futures model to see how much price changes by (a model is needed to account for changes in delivery option value). You have the options of shifting either the spot yield or the forward yield; you should discuss with your traders to see whether they have any preferences.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also hold bond yields constant and shift the repo curve, which produces the &quot;rho&quot; (sensitivity to financing rate).&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2017-04-28T23:42:54.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33951" PostTypeId="1" CreationDate="2017-04-29T00:00:56.877" Score="3" ViewCount="385" Body="&lt;p&gt;I am working with the &lt;code&gt;rmgarch&lt;/code&gt; package in R and I estimated a VAR-aDCC model. Is there any way to extract the extended version of estimates (allowing for volatility spillovers)? More specific, I want the full ARCH and GARCH parameter matrices from the &lt;code&gt;dccfit&lt;/code&gt; function of the &lt;code&gt;garch&lt;/code&gt; package. I saw that in the &lt;code&gt;ccgarch&lt;/code&gt; package there is this option, but the &lt;code&gt;dcc&lt;/code&gt; package does not support the aDCC model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this option available in the &lt;code&gt;rmgarch&lt;/code&gt; package?&lt;/p&gt;&#xA;" OwnerUserId="27692" LastEditorUserId="19645" LastEditDate="2017-04-29T20:59:31.713" LastActivityDate="2021-04-09T10:04:40.393" Title="VAR-aDCC full ARCH and GARCH parameter matrices in R" Tags="&lt;programming&gt;&lt;garch&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33952" PostTypeId="2" ParentId="33945" CreationDate="2017-04-29T02:48:39.933" Score="1" Body="&lt;p&gt;The Var depends only on the daily changes in futures price.  So you create a series of daily changes and you simply omit the day when the roll occurs.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-04-29T02:48:39.933" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33953" PostTypeId="2" ParentId="33941" CreationDate="2017-04-29T12:10:37.597" Score="4" Body="&lt;p&gt;I contacted one the authors of the original paper. He confirmed that the overlapping three day log returns are to be used on both stock and market returns.&lt;/p&gt;&#xA;" OwnerUserId="27493" LastActivityDate="2017-04-29T12:10:37.597" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33955" PostTypeId="1" CreationDate="2017-04-29T14:49:15.793" Score="-3" ViewCount="273" Body="&lt;p&gt;I want to calculate the Simple Moving Average (SMA) for Stock Prices with for period 'N'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Normal Formula for 4 Period Moving Average is &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;MA = (a + b + c + d) / 4&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;for new entry e we do as following:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;MA(new) = (b + c + d + e) / 4&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Problem here is that I need to store for the N period's prices. I have tried for multiple things like&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;New Average = {(Old_Average x N) + (New_Data_Point - Old_Average)}/N&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;but I am loosing on precision.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The sole aim is to reduce the dependency on previous period array values. Can anyone please help.&#xA;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="26185" LastActivityDate="2017-04-30T17:02:49.030" Title="What is an Efficient way to calculate Simple moving average without saving previous N period values?" Tags="&lt;programming&gt;&lt;moving-average&gt;&lt;technical-analysis&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33958" PostTypeId="2" ParentId="33951" CreationDate="2017-04-29T18:09:54.337" Score="0" Body="&lt;p&gt;I do not think you can model spillovers with the DCC model. Unlike BEKK, in DCC the conditional variance of each asset depends only on its own past, not on the past of other assets' conditional variances. Thus no spillovers.&lt;/p&gt;&#xA;" OwnerUserId="19645" LastActivityDate="2017-04-29T18:09:54.337" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="33959" PostTypeId="2" ParentId="33955" CreationDate="2017-04-29T18:39:15.247" Score="2" Body="&lt;p&gt;This is impossible. You need to remember the tail.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd suggest using exponential smoothing in this case. Otherwise, for a simple moving average you'd have to apply some kind of an approximation. There's no point in doing so in my opinion.&lt;/p&gt;&#xA;" OwnerUserId="7365" LastEditorUserId="7365" LastEditDate="2017-04-30T17:02:49.030" LastActivityDate="2017-04-30T17:02:49.030" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33961" PostTypeId="2" ParentId="33886" CreationDate="2017-04-29T19:10:06.793" Score="1" Body="&lt;p&gt;If you were interested in including exogenous&lt;sup&gt;1&lt;/sup&gt; or predetermined regressors in the conditional mean and variance specifications of a univariate time series, you could do that using the package &quot;rugarch&quot; in R. There you can specify your model with the function &lt;code&gt;ugarchspec&lt;/code&gt; and estimate it with &lt;code&gt;ugarchfit&lt;/code&gt;. The specification will use &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;external.regressors=cbind(x.mean)&lt;/code&gt; inside &lt;code&gt;mean.model&lt;/code&gt; where &lt;code&gt;x.mean&lt;/code&gt; is the vector corresponding to $R_{j,t−1}$ (for conditional mean spillover);&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;external.regressors=cbind(x.variance)&lt;/code&gt; inside &lt;code&gt;variance.model&lt;/code&gt; where &lt;code&gt;x.variance&lt;/code&gt; is the vector corresponding to $\varepsilon^2_{j,t−1}$ (for conditional variance spillover). &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Now in your case the extra regressors both in the conditional mean and the conditional variance equation are endogenous (tricky!). To estimate the model consistently and efficiently, you would need to use a (restricted) VARMA-MGARCH model where the MGARCH part is a restricted BEKK-GARCH model, for example. However, the implementation can be quite problematic in practice as there are few software packages that accommodate this model (I think it is available in RATS, but not sure if anywhere else). I do not see an easy way around the problem unless you are willing to simplify the model (e.g. remove the MA components from the condiitonal mean model). For example, using two-stage modelling (first conditional mean, then conditional variance) is not really an option as that could affect consistency (let alone efficiency) of the estimators.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt; exogenous = determined outside the system being modelled&lt;/p&gt;&#xA;" OwnerUserId="19645" LastEditorUserId="19645" LastEditDate="2017-05-05T16:40:17.533" LastActivityDate="2017-05-05T16:40:17.533" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="33964" PostTypeId="1" CreationDate="2017-04-29T22:12:07.807" Score="3" ViewCount="267" Body="&lt;p&gt;I'm trying to evaluate option pricing mainly american, asian and european options in order to get a plot to measure option valuation in time.&#xA;Is there any useful references to do that using R ?&lt;/p&gt;&#xA;" OwnerUserId="27705" LastActivityDate="2017-05-02T22:27:25.977" Title="Is there any useful links for option pricing (american + asian + european) using R" Tags="&lt;option-pricing&gt;&lt;programming&gt;&lt;american-options&gt;&lt;european-options&gt;&lt;asian-option&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33966" PostTypeId="2" ParentId="33955" CreationDate="2017-04-30T05:24:28.350" Score="0" Body="&lt;p&gt;Have you tried a moving average utilising exponential-decays? It is calculated via an updating rule as you desire, I guess the downside is that it isn't of finite 'memory' like the moving averages that you mention. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would be defined as x(t) = x(t-1)*L + (1-L)*y(t) where x(t) is the value of the moving average, y(t) is the new value of the series you are calculating the moving average of and 0 &amp;lt; L &amp;lt; 1 is a fixed parameter that control the 'length' of the moving average window (as L moves down from 1 to 0, the window reduces in length)&lt;/p&gt;&#xA;" OwnerUserId="27516" LastActivityDate="2017-04-30T05:24:28.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33967" PostTypeId="1" AcceptedAnswerId="36258" CreationDate="2017-04-30T05:40:02.557" Score="3" ViewCount="254" Body="&lt;p&gt;&lt;strong&gt;Can it be shown that the Fundamental Theorem on Asset Pricing (FTAP) applies to underlying assets -- namely bonds, equities, and commodities?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FTAP says that assets have no-arbitrage prices equal to their risk-neutral expectations. A no-arbitrage price is the price which is implied by the efficient market hypothesis. However, for assets which have vague underlying/causal relationships, the belief that &quot;the current price represents the expectation&quot; appears to inevitably result in a tautology. Since an arbitrage-free price other than the market price for such assets can be neither be proven nor disproven, the FTAP appears to dissipate into a belief system rather quickly. &lt;strong&gt;Or maybe I've missed something and there is indeed a generic approach which is not also tautological?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is not problematic for derivatives of an underlying asset to have an arbitrage-free price (and/or range of prices) when the market for the underlying is assumed to be sufficiently complete and the terminal payoff conditions based on that underlying are known. Whether or not the underlying itself is efficiently priced may not even be relevant for quantifying an efficient price of its derivative. The following passage from Chapter 1 of Baxter's and Rennie's Financial Calculus summarizes this attitude:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;With markets where the stock can be bought and sold freely and&#xA;  arbitrarily positive and negative amounts of stock can be maintained&#xA;  without cost, trying to trade forward using the strong law would lead&#xA;  to disaster […].&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;[…]&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;But the existence of an arbitrage price, however surprising, overrides&#xA;  the strong law. To put it simply, if there is an arbitrage price, any&#xA;  other price is too dangerous to quote.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;[…]&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Thus maybe a strong-law price would be appropriate for a call option,&#xA;  and until 1973, many people would have agreed. Almost everything&#xA;  appeared safe to price via expectation and the strong law, and only&#xA;  forwards and close relations seemed to have an arbitrage price. Since&#xA;  1973, however, and the infamous Black-Scholes paper, just how wrong&#xA;  this is has slowly come out. Nowhere in this book will we use the&#xA;  strong law again. […] All derivatives can be built from the underlying&#xA;  −− arbitrage lurks everywhere.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If arbitrage lurks everywhere, I interpret this to mean it is possible to take the FTAP view on the underlying assets themselves. It seems both fair and intuitive to think about equity and debt as being derivatives on underlying assets, and those asset in turn as being derivatives themselves. Yet, most of the field appears to be stuck on weak expectation-based models of the flavors provided by the Capital Asset Pricing Model (CAPM) and Fama-French.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Does there exist a stronger pricing model for underlying assets for which arbitrage relationships are vague or -- at very best -- probabilistic? What about things that do not neatly fit into the arbitrage framework, perhaps such as commodities?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Or, is applying FTAP in these situations ill-prescribed -- a misapplication of recent economic thinking which reduces human decision-making behaviors to mathematically convenient utility seeking functions?&lt;/strong&gt; I can see merit in both the behavioral and no-arbitrage economic approaches to asset pricing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any general or specific insights on practical applications of the no-arbitrage principle on  underlying assets are welcome.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2017-05-01T17:49:39.783" LastActivityDate="2017-09-30T19:43:56.997" Title="Do underlying assets have a no-arbitrage price?" Tags="&lt;equities&gt;&lt;valuation&gt;&lt;no-arbitrage-theory&gt;&lt;commodities&gt;&lt;market-efficiency&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33968" PostTypeId="1" CreationDate="2017-04-30T05:56:05.580" Score="0" ViewCount="237" Body="&lt;p&gt;I came across black variance surface in quantlib code. For options, usually volatility surface is used for pricing. When you will use variance surface for pricing or any advantages over volatility surface?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Appreciate any pointers in understanding similarities and differences&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="7422" LastActivityDate="2017-04-30T05:56:05.580" Title="Black Variance Surface" Tags="&lt;volatility&gt;&lt;variance&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33969" PostTypeId="2" ParentId="33955" CreationDate="2017-04-30T06:08:09.523" Score="0" Body="&lt;p&gt;You need the tail for precision, but you can estimate as follows: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The mean, $\mu$, as set of integers $[X_i, X_{i+1},\ldots, X_N ]$ is defined thus:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Large{\mu_{X} = \frac{\sum_n^N X_i}{N}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To estimate the mean at $n$, you could simply do the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Large{\mu_{X,n} \approx \frac{1}{N}X_n + \frac{N-1}{N}\mu_{X,n-1} }$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See the following thread for a related question on using exponential weighting: &lt;a href=&quot;https://quant.stackexchange.com/questions/33548/is-there-a-non-recursive-way-of-calculating-the-exponential-moving-average/33635#33635&quot;&gt;Is there a non-recursive way of calculating the exponential moving average?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26547" LastActivityDate="2017-04-30T06:08:09.523" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33970" PostTypeId="2" ParentId="33964" CreationDate="2017-04-30T07:38:51.757" Score="4" Body="&lt;p&gt;Below is an example of how you could plot a &quot;call&quot; option value with &lt;a href=&quot;https://cran.r-project.org/web/packages/RQuantLib/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;RQuantLib&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(RQuantLib)&#xA;library(ggplot2)&#xA;call_price &amp;lt;- sapply(seq(365,0,-1), function(x) AmericanOption(&quot;call&quot;, 100, 100, 0.2, 0.03, x/365, 0.4)$value)&#xA;qplot(day, call_price, data=data.frame(day=0:365, call_price=call_price), geom=&quot;line&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The code output:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/TIlr2.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/TIlr2.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another useful package is &lt;a href=&quot;https://cran.r-project.org/web/packages/fOptions/&quot; rel=&quot;nofollow noreferrer&quot;&gt;fOptions&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is also a book &lt;a href=&quot;http://eu.wiley.com/WileyCDA/WileyTitle/productCd-0470745843,subjectCd-BA04.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;Option Pricing and Estimation of Financial Models with R&quot;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15154" LastEditorUserId="848" LastEditDate="2017-04-30T07:54:02.440" LastActivityDate="2017-04-30T07:54:02.440" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33972" PostTypeId="1" CreationDate="2017-04-30T10:37:30.617" Score="1" ViewCount="267" Body="&lt;p&gt;I have a data set which looks something like this, referring to American-style put and call options:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; xyz&#xA;          date   undly    EXPR_DT STRK_PRC PC     delta shares_outstanding option_price stock_price &#xA;&#xA; 1: 2005-05-02   xyz   2005-05-21     22.5  C  0.236023             491164        0.250       20.97&#xA; 2: 2005-05-02   xyz   2005-05-21     25.0  C  0.033663             491164        0.025       20.97&#xA; 3: 2005-05-02   xyz   2005-11-19     20.0  C  0.650630             491164        2.850       20.97&#xA; 4: 2005-05-02   xyz   2005-11-19     22.5  C  0.464808             491164        1.575       20.97&#xA; 5: 2005-05-02   xyz   2005-05-21     17.5  P -0.096380             491164        0.150       20.97&#xA; 6: 2005-05-02   xyz   2005-05-21     20.0  P -0.315730             491164        0.525       20.97&#xA; 7: 2005-05-02   xyz   2005-05-21     22.5  P -0.780360             491164        1.725       20.97&#xA; 8: 2005-05-02   xyz   2005-05-21     25.0  P        NA             491164        4.000       20.97&#xA; 9: 2005-05-02   xyz   2005-06-18     20.0  P -0.333370             491164        0.700       20.97&#xA;10: 2005-05-02   xyz   2005-08-20     20.0  P -0.350630             491164        1.050       20.97&#xA;11: 2005-05-02   xyz   2005-11-19     17.5  P -0.199830             491164        0.750       20.97&#xA;12: 2005-05-02   xyz   2005-11-19     20.0  P -0.357960             491164        1.550       20.97&#xA;13: 2005-05-02   xyz   2005-11-19     22.5  P -0.551720             491164        2.750       20.97&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, some deltas are missing, but I need them for my calculations. Is there a convenient and reliable way to estimate the missing deltas, or at least upper/lower bounds, having all the other deltas?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've stumbled over this book by Pierino Ursone, but it only provides methods for European-style options.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.amazon.de/Calculate-Options-Prices-Their-Greeks/dp/1119011620?SubscriptionId=0H7E2ABGRZR51KQBN202&amp;amp;tag=universitat09-21&amp;amp;linkCode=xm2&amp;amp;camp=2025&amp;amp;creative=165953&amp;amp;creativeASIN=1119011620&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.amazon.de/Calculate-Options-Prices-Their-Greeks/dp/1119011620?SubscriptionId=0H7E2ABGRZR51KQBN202&amp;amp;tag=universitat09-21&amp;amp;linkCode=xm2&amp;amp;camp=2025&amp;amp;creative=165953&amp;amp;creativeASIN=1119011620&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="27713" LastActivityDate="2017-06-30T15:02:53.330" Title="Estimate American-style option delta from similar options" Tags="&lt;options&gt;&lt;american-options&gt;&lt;estimation&gt;&lt;delta&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="33973" PostTypeId="2" ParentId="33372" CreationDate="2017-04-30T13:56:34.223" Score="1" Body="&lt;p&gt;The reason is that the drift component is very small compared to volatility on daily returns. Here's the details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, the obvious part. If you assume that the stock prices are lognormal process, then you have:&#xA;$$r_t=\Delta S/S_t=\mu \Delta t+\sigma_{\Delta t}\xi_t$$ where $\xi_t\sim\mathcal{N}(0,1)$ - the standard normal random variable, and $r_t$ - periodic return. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The equation for the variance is:&#xA;$$Var[r_t]=Var[\mu\Delta t]+\sigma_{\Delta t}^2Var[\xi_t]=\sigma_{\Delta t}^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We got this far to see that the variance of the returns is what we're looking for. Now, we need an estimator. Let's look at the well known equation for the variance:&#xA;$$Var[x]=E[x^2]-E[x]^2$$&#xA;If we have only one observation then the estimator for first term looks like this when we start with a definition:&#xA;$$\bar E[r_t^2]=\frac{1}{1}\sum_{t=1}^1r_t^2=r_1^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the second term happens to be very small on daily returns and is often ignored $E[r_1]=E[\mu\Delta t]+E[\sigma_{\Delta t}\xi_t]=\mu\Delta t$, so we're going to drop it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, the simple estimator of the volatility $$\hat\sigma_{\Delta t}=\sqrt{r_1^2}=r_1=\frac{\Delta S_1}{S_1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This only works because the daily volatility is much bigger than the daily drift, e.g. for SPX your daily vol is on the order of $\sigma_{daily}\approx 0.2/\sqrt{250}\approx 0.01&amp;gt;&amp;gt;\mu_{daily}\approx 0.12/250\approx 0.0005$. That's why this estimator is quite good despite certainly being biased. If you use longer periods then this estimator will not work as well. For instance for annual SPX return you get $\sigma\approx 0.2\sim\mu\approx 0.12$, i.e. quite similar magnitudes, so the second term in the variance equation $E[r]^2$ can't simply be dropped.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, I'm assuming you have no problems with time scaling $\sqrt{\Delta t}$ and only are interested in why we can use just one return observation as the estimator of its volatility.&lt;/p&gt;&#xA;" OwnerUserId="7365" LastEditorUserId="7365" LastEditDate="2017-04-30T14:08:42.970" LastActivityDate="2017-04-30T14:08:42.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33974" PostTypeId="2" ParentId="33372" CreationDate="2017-04-30T14:33:50.393" Score="0" Body="&lt;p&gt;Contextually related info, from &lt;a href=&quot;https://www.amazon.co.uk/Computational-Financial-Mathematics-using-MATHEMATICA%C2%AE/dp/0817641971/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Computational Financial Mathematics using Mathematica&lt;/a&gt;, page 54.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;mean value = p e^(a t)&lt;/code&gt; depends on &lt;code&gt;σ^2 = dS^2/S^2 dt&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/b0K79.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/b0K79.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7178" LastActivityDate="2017-04-30T14:33:50.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33975" PostTypeId="2" ParentId="33899" CreationDate="2017-04-30T16:52:22.363" Score="2" Body="&lt;p&gt;Your code basically implements the assumption that you cited:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The volatility of return processes is not constant with respect to&#xA;  time.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Whether it's a single burst or some kind of a fancy function $\sigma_t$ is not important here. The fact is that your volatility is time varying. You may call it piece-wise constant, but it still is characterized as time varying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first plot demonstrates the same thing on the empirical returns, that could be sometimes modeled with stochastic volatility, which will also cause clustering and autocorrelation of squares, abs or other nonlinear function of returns.&lt;/p&gt;&#xA;" OwnerUserId="7365" LastActivityDate="2017-04-30T16:52:22.363" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33976" PostTypeId="2" ParentId="33771" CreationDate="2017-04-30T21:22:53.703" Score="0" Body="&lt;p&gt;@Chris-Degnen made me aware of the following work through which uses Itô's lemma from page 54 of &lt;a href=&quot;https://rads.stackoverflow.com/amzn/click/0817641971&quot; rel=&quot;nofollow noreferrer&quot;&gt;Computational Financial Mathematics using Mathematica&lt;/a&gt;. I adopt it to answer the question as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume stock prices evolve according to following SDE derived from a standard Wiener Process:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS_t = a S_t \,dt + \sigma S_t dB_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where: $B_t$ is a Wiener process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since movements of  $S_t$ should be proportional to the current price, we investigate the proporties of the natural logarithm of price. Let:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_0 = p$; and,&#xA;$z = \ln(S)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Noticing that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(dS)^2 =\sigma^2 S^2\,dt$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;we use Itô's lemma to derive:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dz = d \ln(S) = \frac{1}{S}\,dS+ \frac{1}{2} \frac{-1}{S^2}(dS^2)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$= a\, dt + \sigma \, dB - \frac{-1}{2S^2}\sigma^2S^2\,dt = (a-\frac{1}{2}\sigma^2)dt +\sigma \,dB$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $\sigma$ is constant, the above SDE for $z$ can be solved explicitly by applying stochastic integration, yielding:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$z_t = t (a - \frac{\sigma^2}{2})+ \sigma (B_t-B_0)+z_0 = t (a -\frac{\sigma^2}{2}) +\sigma B_t + \ln(p)$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This in turn gives the solution of the original stock price SDE. By taking its exponent, we now have: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Large{S_t = e^{z_t} = e^{(a-\frac{\sigma^2}{2})t + \sigma B_t + \ln(p) } = S_0 e^{(a-\frac{\sigma^2}{2})t + \sigma B_t }}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since &quot;the population geometric mean is the population median for the lognormal distribution&quot;, and the geometric mean is interchangeable with the logarithmic expectation (through simple transformation), the logarithmic expectation is satisfied by the expected value of the median curve for $S_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The derivation using Itô's lemma is essentially a stochastic chain rule for expressing Jensen's inequality which states that the median and the mean differ from a convex function. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The median for $\frac{dS_t}{S_t}$ is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb{E}[\ln(\frac{S_t}{S_0})] =  (a-\frac{\sigma^2}{2})t$, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(or: $\mathbb{E}[\frac{dS_t}{S_t}] = (a-\frac{\sigma^2}{2})\,dt$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;while the mean value is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\ln(\frac{S_t}{S_0})  ={a\,t }$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(or: $ \frac{S_t+dS\,dt}{S_t} ={a }$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, the expectation is equal to the mean value less one-half its variance.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2018-03-21T21:45:11.970" LastActivityDate="2018-03-21T21:45:11.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33977" PostTypeId="1" AcceptedAnswerId="34031" CreationDate="2017-04-30T22:28:16.077" Score="0" ViewCount="319" Body="&lt;p&gt;I've been working through this &lt;a href=&quot;https://systematicinvestor.wordpress.com/2012/01/29/multiple-factor-model-fundamental-data/&quot; rel=&quot;nofollow noreferrer&quot;&gt;blog on multi-factor models&lt;/a&gt; and I noticed that, when translating factors into Z scores, the author uses cap-weighted means instead of regular means.  Why would he do that?  Are there certain markets where this practice is unacceptable?&lt;/p&gt;&#xA;" OwnerUserId="27210" LastActivityDate="2017-05-03T13:14:51.050" Title="When translating factors into normalized Z scores, why use cap-weighted means?" Tags="&lt;factor-models&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33978" PostTypeId="1" CreationDate="2017-04-30T23:19:48.180" Score="2" ViewCount="356" Body="&lt;p&gt;I was checking Glasserman(2004) - Monte Carlo for Financial Engineering and got to the likelihood ratio method. I am also looking in my textbook (M. Cerrato: The Mathematics of derivatives securities with applications in Matlab). By checking both sources I see some differences and I do not know which one is correct. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Glasserman says that to estimate the BlackScholes delta one has to think of $S(0)$ as a parameter of $S(T)$. We have the density function of a log normally distributed var. $$g(x)=\frac{1}{x\sigma \sqrt{T}}\phi(d(x))$$ where $$d(x)=\frac{ln(x/S(0)-(r-1/2\sigma^2)T}{\sigma \sqrt{T}}$$ so here comes my first question. What is $$\frac{\frac{\partial g(x)}{\partial S(0)}}{g(x)} $$ equal to? I tried it on my own (my mathemtics is not particularly strong so if you are kind to put your calculation step by step I would really appreciate it) and I got $$\frac{\partial\phi(d(x))}{\phi(d(x))}\frac{\partial d(x)}{\partial S(0)}$$ which is quite different from both my lecturer and Glasserman. $$Glasserman=-d(x)\frac{\partial d(x)}{\partial S(0)} $$ $$My\ lecturer=\frac{\partial ln(g(S(T)))}{\partial S(0)} $$ Which of the two is correct (I don't expect mine to be :)) )? and how does the derivation works?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance! &lt;/p&gt;&#xA;" OwnerUserId="27347" LastEditorUserId="16160" LastEditDate="2017-04-30T23:51:31.077" LastActivityDate="2017-05-01T12:08:02.907" Title="Likelihood Ratio Method - Delta" Tags="&lt;mathematics&gt;&lt;finance-mathematics&gt;&lt;statistical-finance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33979" PostTypeId="2" ParentId="33978" CreationDate="2017-05-01T01:32:38.813" Score="1" Body="&lt;p&gt;The second form is the same as the first where $x=S(T)$.&#xA;$$&#xA;\frac{\partial ln(g(x))}{\partial S(0)} = \frac{\partial ln(g(x))}{\partial g(x)}\frac{\partial g(x)}{\partial S(0)} = \frac{1}{g(x)}\frac{\partial g(x)}{\partial S(0)}&#xA;$$&#xA;As for the derivation, apply the chain rule.&#xA;$$&#xA;\begin{align}&#xA;\frac{1}{g(x)}\frac{\partial g(x)}{\partial S(0)} &amp;amp;= \frac{1}{g(x)}\frac{\partial}{\partial S(0)}\left[\frac{1}{x\sigma\sqrt{T}}\phi(d(x))\right] \\&#xA;&amp;amp;= \frac{1}{g(x)}\frac{1}{x\sigma\sqrt{T}}\phi'(d(x))\frac{\partial d(x)}{\partial S(0)}&#xA;\end{align}&#xA;$$&#xA;To continue, note that $\phi'(x) = -x\phi(x)$. I give this without proof and leave it as an exercise for you to verify this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we can finish.&#xA;$$&#xA;\begin{align}&#xA;\frac{1}{g(x)}\frac{\partial g(x)}{\partial S(0)} &amp;amp;= \frac{1}{g(x)}\frac{1}{x\sigma\sqrt{T}}(-d(x))\phi(d(x))\frac{\partial d(x)}{\partial S(0)} \\&#xA;&amp;amp;= -d(x)\frac{\partial d(x)}{\partial S(0)}&#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="5617" LastActivityDate="2017-05-01T01:32:38.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33981" PostTypeId="1" CreationDate="2017-04-29T13:45:10.460" Score="4" ViewCount="185" Body="&lt;p&gt;Suppose that I am interested in a market on a betting exchange for the outright winner of some event, with three competitors, $A, B$ and $C$ with corresponding probabilities of winning $a, b$ and $c$. We expect that the sum $a + b + c = 1$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now suppose that the probability of $A$ winning changes to some $a'$ (as defined by that bet's current price). We expect $b$ and $c$ to change to $b'$ and $c'$ such that $a' + b' + c' = 1$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By what mechanism do $b$ and $c$ change? I see two options:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;They move by market forces, since if at any instant $a + b + c &amp;lt; 1$ people will take this arbitrage opportunity which will push $b$ and $c$ up.&lt;/li&gt;&#xA;&lt;li&gt;The probabilities sum to one rule is enforced 'externally' by the exchange through some mechanism. I am interested in how such a mechanism could work.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'm aware that there are probably different ways of doing this, but I'm interested in any ideas people can come up with!&lt;/p&gt;&#xA;" OwnerDisplayName="Alex Seaton" LastEditorUserId="20795" LastEditDate="2019-09-22T16:57:30.657" LastActivityDate="2019-09-22T16:57:30.657" Title="How is the &quot;probabilities sum to $1$&quot; rule enforced in betting exchanges?" Tags="&lt;probability&gt;&lt;exchange&gt;&lt;betting&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33982" PostTypeId="1" CreationDate="2017-05-01T08:03:28.107" Score="7" ViewCount="1246" Body="&lt;p&gt;I´m currently writing a project on volatility trading and dynamics. &#xA;The literature often states higher demand for OTM (out-of-the-money) and ITM (in-the-money) compared to ATM (at-the-money) options as an explanation for the volatility smile.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand why this can explain the volatility smile. The problem is, that I can't see why the demand should be higher for OTM or ITM options than ATM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help to elaborate on this would be greatly appreciated. &lt;/p&gt;&#xA;" OwnerUserId="27525" LastEditorUserId="467" LastEditDate="2017-05-02T01:24:23.113" LastActivityDate="2018-06-09T13:36:25.180" Title="Why is there greater demand for OTM and ITM options than for ATM options?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;implied-volatility&gt;&lt;volatility-smile&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33987" PostTypeId="1" CreationDate="2017-05-01T09:52:02.187" Score="0" ViewCount="126" Body="&lt;p&gt;I was wondering if we could do a forecast on volatility using monte carlo on an underlying asset. For example EUR/USD :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simulating a lot of possible paths on 1 year &#xA;then calculate the volatilty for each path &#xA;and doing the mean of these volatilities&lt;/p&gt;&#xA;&#xA;&lt;p&gt;thanks guys&lt;/p&gt;&#xA;" OwnerUserId="26814" LastActivityDate="2017-05-01T09:52:02.187" Title="Monte Carlo volatily" Tags="&lt;volatility&gt;&lt;fx&gt;&lt;monte-carlo&gt;&lt;forecasting&gt;&lt;estimation&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33989" PostTypeId="1" CreationDate="2017-05-01T04:28:31.273" Score="1" ViewCount="65" Body="&lt;p&gt;I am studying stock prices. Let P&lt;sub&gt;t&lt;/sub&gt; be price of stock at time t.&#xA;While P&lt;sub&gt;t&lt;/sub&gt; is non stationary, the return, r&lt;sub&gt;t&lt;/sub&gt;=log(P&lt;sub&gt;t&lt;/sub&gt;/P&lt;sub&gt;t-1&lt;/sub&gt;) is stationary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I study on r&lt;sub&gt;t&lt;/sub&gt;, I decide on an ARMA(0,1) without intercept process rather than ARMA(0,0).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am confused with this result. I was expecting r&lt;sub&gt;t&lt;/sub&gt; to be an ARMA(0,0) process which supports P&lt;sub&gt;t&lt;/sub&gt; to be a white noise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I obtained ARMA(0,1). Does not this result contadict with effciciency market hypothesis? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use BIC criterion to select the model. The BIC criterions are as below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;MODEL       BIC-model contains intercept    BIC-model does not contain intercept&#xA;ARMA(0,0)   -11,936.6                       -11,941.2   &#xA;ARMA(1,0)   -11,936.9                       -11,941.9   &#xA;ARMA(0,1)   -11,937.1                       -11,942.0   &#xA;ARMA(1,1)   -11,929.3                       -11,934.2   &#xA;ARMA(2,0)   -11,929.5                       -11,934.4   &#xA;ARMA(0,2)   -11,929.3                       -11,934.2   &#xA;ARMA(2,1)   -11,921.9                       -11,926.5   &#xA;ARMA(1,2)   -11,921.5                       -11,926.4   &#xA;ARMA(2,2)   -11,922.7                       -11,927.5   &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;According to BIC, I decide MA(1) process. The statistics of MA(1) process are as below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Coefficient     0.058409111&#xA;Standard Error  0.019695617&#xA;P-value         0.003021036&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I can't explain the obtained result. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am also confused with the constant term. Even though BIC does not select a model with constant, I suspect the model include a constant term since in long term the price will go up becouse of the inflation rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I haven't studied in finance so much. I will be very glad for an explanation. Thanks a lot.&lt;/p&gt;&#xA;" OwnerUserId="47262" OwnerDisplayName="oercim" LastActivityDate="2017-05-01T12:12:47.457" Title="Are some stock prices not ARIMA(0,1,0) processes?" Tags="&lt;arima&gt;&lt;finance&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33990" PostTypeId="2" ParentId="33989" CreationDate="2017-05-01T06:59:23.227" Score="1" Body="&lt;p&gt;It is clear that in reality stock prices are a quite complex process that cannot be completely described by anything as simple as an ARMA(0, 0) or ARMA(0, 1) process. So, whatever model fitting algorithm you used had to decide between two (very) imperfect data generating models for the data and did so according to its criteria. E.g., if you used maximum likelihood, then the you may simply get ARMA(0, 1) rather than ARMA(0, 0) according to e.g. a likelihood ratio test or AIC or BIC (or whatever criteria you used), simply because it is the more complex model and presumably could approximate your data substantially better. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whether one almost certainly wrong model fits the data substantially better than another almost certainly wrong model, does not necessarily tell you too much about the true underlying data generating model (e.g. whether the efficient market hypothesis is true or not and all information was &quot;priced in&quot;), because the extra moving average component may simply provide a better approximation that compensates for other failures of the model (e.g. error term distribution etc.). And let's be honest the efficient market hypothesis is almost certainly not exactly true and at best it might be a good approximation.&lt;/p&gt;&#xA;" OwnerDisplayName="Björn" LastActivityDate="2017-05-01T06:59:23.227" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33991" PostTypeId="2" ParentId="33972" CreationDate="2017-05-01T13:56:13.543" Score="2" Body="&lt;p&gt;I'll summarize my comments into an answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you do with missing deltas depends on the purpose of the analysis. If the purpose is to study the market then I'm afraid the best is to drop these observations. In my experience the most likely reason for some deltas (greeks) to be missing in the market data feed is the stale price data that occurs with far OTM options which are thinly traded. In this case, the data providers may provide you with the price that no longer is relevant to the current underlying price. The underlying may move enough to make the quoted price impossible, i.e. you can't calculate the implied volatility, there's no solution for IV. Hence, you can't calculate the greeks either. This can be detected by pulling the trade date/time that corresponds to the price quote, and see if the last trade was done long ago and look at what was the underlying price at that date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the purpose of your analysis is something else, maybe re-pricing the option price under different scenarios, e.g. for risk management, then something can or should be done with deltas. For instance, you could build the IV surface from the existing data, then extrapolate the IV to the options with missing greeks, and re-price them using the current underlying price, and subsequently calculate the greeks.&lt;/p&gt;&#xA;" OwnerUserId="7365" LastActivityDate="2017-05-01T13:56:13.543" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="33992" PostTypeId="2" ParentId="32783" CreationDate="2017-05-01T14:41:38.887" Score="2" Body="&lt;p&gt;May be I have overlooked something, but I believe that&#xA;\begin{align*}&#xA;Q(t, S) = \mathbb{P}\left(\tau_{B} \le T \mid \mathcal{F}_t\right).&#xA;\end{align*}&#xA;Then $\{Q(t, S), \, 0&amp;lt;t &amp;lt; T\}$ is a martingale, and the PDE follows immediately, by noting that&#xA;\begin{align*}&#xA;dQ &amp;amp;= Q_t dt + Q_S dS + \frac{1}{2}Q_{SS} d\langle S, S\rangle_t\\&#xA;&amp;amp;=\Big(\underbrace{Q_t + \mu S Q_S + \frac{1}{2}\sigma^2Q_{SS} S^2}_{=0}\Big)dt + \sigma S Q_S dW_t.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="16148" LastEditDate="2017-05-01T19:40:49.410" LastActivityDate="2017-05-01T19:40:49.410" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="33993" PostTypeId="1" CreationDate="2017-05-01T14:57:49.283" Score="2" ViewCount="965" Body="&lt;p&gt;Issue short:&#xA;I have values for Asian Options which I'm trying to replicate using a self-build vba calculator. The values I have to hit is from FinCAD and I'm using a discrete arithmetic average rate option based on Haug, Haug and Margrabe and also trying the Curran version (implemented in VBA). All code below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More information:&#xA;I'm sure we calculate using the informations differently since my value is quite different from he's. Underneath is the exact input used:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Asian Call Option (average price not strike)&lt;/li&gt;&#xA;&lt;li&gt;Valuation date: 06-04-2017&lt;/li&gt;&#xA;&lt;li&gt;Averaging period: 01-05-2017 until 31-05-2017 (May)&lt;/li&gt;&#xA;&lt;li&gt;Underlying price (per 05-04-2017): 515.25&lt;/li&gt;&#xA;&lt;li&gt;Strike: 515&lt;/li&gt;&#xA;&lt;li&gt;Volatility: 20,669%&lt;/li&gt;&#xA;&lt;li&gt;Risk free rate: 0,980%&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I use working days (in my country) so:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Time to next average point (t1): 15 days (from 06-04-2017 to 01-05-2017)&lt;/li&gt;&#xA;&lt;li&gt;Time to maturity (T): 35 days (from 06-04-2017 to 31-05-2017)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;My values (after using 252):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Asian Value (Haug, Haug and Margrabe): 12.7763&lt;/li&gt;&#xA;&lt;li&gt;Asian Value (Curran): 12.7753&lt;/li&gt;&#xA;&lt;li&gt;BS european value: 16.2952&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;He's value:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;18.64&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I simply can't understand the difference. It's not just about the days used. Maybe it's the volatility. Also because my BS European value is lower than he's value and that should not be the case. &#xA;I have also validated my values according to free available calculators on www. &#xA;I just got the info that FinCAD is using their function, aaGeo_Asian, so I tried a geometric version but still don't get they numbers. I do not have information on the specifics in their function. However it could look like they also use projected future values and not &quot;just&quot; the current price of the underlying.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Public Function DiscreteAsianHHM(runFlag As String, CallPutFlag As String, &#xA;TimeFlag As String, ContinuousFlag As String, S As Double, SA As Double, X &#xA;As Double, _&#xA;          input_t1 As Double, input_t As Double, n As Double, m As Double, &#xA;input_r As Double, input_b As Double, v As Double) As Double&#xA;&#xA;&#xA;Dim d1 As Double, d2 As Double, h As Double, EA As Double, EA2 As Double&#xA;Dim vA As Double, OptionValue As Double&#xA;Dim t1 As Double, T As Double&#xA;Dim r As Double, b As Double&#xA;&#xA;'Making sure of the chosen input time (years/days)&#xA;t1 = TimeConvert(TimeFlag, input_t1)&#xA;T = TimeConvert(TimeFlag, input_t)&#xA;&#xA;'Converting to continious compounding rate&#xA;r = CCRConvert(ContinuousFlag, input_r)&#xA;b = CCRConvert(ContinuousFlag, input_b)&#xA;&#xA;&#xA;' Calculate either Asian (A) or plain European (E) by BS formula&#xA;If runFlag = &quot;A&quot; Then&#xA;&#xA;    h = (T - t1) / (n - 1)&#xA;&#xA;&#xA;    If b = 0 Then&#xA;        EA = S&#xA;    Else&#xA;        EA = S / n * Exp(b * t1) * (1 - Exp(b * h * n)) / (1 - Exp(b * h))&#xA;    End If&#xA;&#xA;   'If we are in the averaging period and way ITM&#xA;    If m &amp;gt; 0 Then&#xA;        If SA &amp;gt; n / m * X Then   ' Exercise is certain for call, put must be &#xA;    out-of-the-money&#xA;&#xA;            If CallPutFlag = &quot;Put&quot; Then&#xA;                DiscreteAsianHHM = 0&#xA;            ElseIf CallPutFlag = &quot;Call&quot; Then&#xA;                SA = SA * m / n + EA * (n - m) / n&#xA;                DiscreteAsianHHM = (SA - X) * Exp(-r * T)&#xA;            End If&#xA;            Exit Function&#xA;&#xA;       End If&#xA;    End If&#xA;&#xA;    If m = n - 1 Then ' Only one fix left use Black-Scholes weighted with &#xA;    time&#xA;&#xA;         X = n * X - (n - 1) * SA&#xA;         DiscreteAsianHHM = GBlackScholes(CallPutFlag, S, X, T, r, b, v) * 1 &#xA;         / n&#xA;         Exit Function&#xA;    End If&#xA;&#xA;    If b = 0 Then&#xA;         EA2 = S * S * Exp(v * v * t1) / (n * n) _&#xA;            * ((1 - Exp(v * v * h * n)) / (1 - Exp(v * v * h)) _&#xA;           + 2 / (1 - Exp(v * v * h)) * (n - (1 - Exp(v * v * h * n)) / (1 - &#xA;    Exp(v * v * h))))&#xA;    Else&#xA;&#xA;         EA2 = S * S * Exp((2 * b + v * v) * t1) / (n * n) _&#xA;            * ((1 - Exp((2 * b + v * v) * h * n)) / (1 - Exp((2 * b + v * v) &#xA;         * h)) _&#xA;            + 2 / (1 - Exp((b + v * v) * h)) * ((1 - Exp(b * h * n)) / (1 - &#xA;          Exp(b * h)) _&#xA;            - (1 - Exp((2 * b + v * v) * h * n)) / _&#xA;            (1 - Exp((2 * b + v * v) * h))))&#xA;    End If&#xA;&#xA;    vA = Sqr((Log(EA2) - 2 * Log(EA)) / T)&#xA;&#xA;    OptionValue = 0&#xA;&#xA;    'If we are in the averaging period we need to adjust the strike price&#xA;    If m &amp;gt; 0 Then&#xA;        X = n / (n - m) * X - m / (n - m) * SA&#xA;    End If&#xA;&#xA;    d1 = (Log(EA / X) + vA ^ 2 / 2 * T) / (vA * Sqr(T))&#xA;    d2 = d1 - vA * Sqr(T)&#xA;&#xA;    If CallPutFlag = &quot;Call&quot; Then&#xA;        OptionValue = Exp(-r * T) * (EA * CND(d1) - X * CND(d2))&#xA;    ElseIf (CallPutFlag = &quot;Put&quot;) Then&#xA;        OptionValue = Exp(-r * T) * (X * CND(-d2) - EA * CND(-d1))&#xA;    End If&#xA;&#xA;    DiscreteAsianHHM = OptionValue * (n - m) / n&#xA;    ElseIf runFlag = &quot;E&quot; Then&#xA;    'Generalized BS model&#xA;    DiscreteAsianHHM = GBlackScholes(CallPutFlag, S, X, T, r, b, v)&#xA;    End If&#xA;&#xA;    End Function&#xA;&#xA;&#xA;Public Function TimeConvert(TimeFlag As String, input_t As Double) As Double&#xA;&#xA;If TimeFlag = &quot;Days&quot; Then&#xA;    TimeConvert = input_t / 252&#xA;Else&#xA;    TimeConvert = input_t&#xA;End If&#xA;&#xA;End Function&#xA;&#xA;&#xA;'The generalized Black and Scholes formula&#xA; Public Function GBlackScholes(CallPutFlag As String, S As Double, X _&#xA;            As Double, T As Double, r As Double, b As Double, v As Double) &#xA; As Double&#xA;&#xA;Dim d1 As Double, d2 As Double&#xA;'I thought this was a mistake but note that q=r-b. r is risk free rate, b is &#xA; cost of carry and q is dividend&#xA;d1 = (Log(S / X) + (b + v ^ 2 / 2) * T) / (v * Sqr(T))&#xA;d2 = d1 - v * Sqr(T)&#xA;&#xA;If CallPutFlag = &quot;Call&quot; Then&#xA;    GBlackScholes = S * Exp((b - r) * T) * CND(d1) - X * Exp(-r * T) * CND(d2)&#xA;ElseIf CallPutFlag = &quot;Put&quot; Then&#xA;    GBlackScholes = X * Exp(-r * T) * CND(-d2) - S * Exp((b - r) * T) * CND(-d1)&#xA;End If&#xA;&#xA;End Function&#xA;&#xA;Public Function CCRConvert(ContinuousFlag As String, rate As Double) As &#xA;Double&#xA;&#xA;If ContinuousFlag = &quot;Continuous&quot; Then&#xA;    CCRConvert = rate&#xA;ElseIf ContinuousFlag = &quot;Annual&quot; Then&#xA;    CCRConvert = Log(1 + rate)&#xA;ElseIf ContinuousFlag = &quot;Semi-annual&quot; Then&#xA;    CCRConvert = 2 * Log(1 + rate / 2)&#xA;ElseIf ContinuousFlag = &quot;Quarterly&quot; Then&#xA;    CCRConvert = 4 * Log(1 + rate / 4)&#xA;ElseIf ContinuousFlag = &quot;Monthly&quot; Then&#xA;    CCRConvert = 12 * Log(1 + rate / 12)&#xA;ElseIf ContinuousFlag = &quot;Daily&quot; Then&#xA;    CCRConvert = 252 * Log(1 + rate / 252)&#xA;End If&#xA;&#xA;End Function&#xA;&#xA;&#xA;'Using the build in cummulative normal distribution&#xA; Function CND(X As Double) As Double&#xA; CND = WorksheetFunction.Norm_Dist(X, 0, 1, True)&#xA; End Function&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="27729" LastEditorUserId="27729" LastEditDate="2017-05-02T12:13:52.873" LastActivityDate="2017-12-30T07:37:36.967" Title="Wrong pricing of Asian Option" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;volatility&gt;&lt;valuation&gt;&lt;asian-option&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33994" PostTypeId="2" ParentId="33785" CreationDate="2017-05-01T15:16:29.550" Score="5" Body="&lt;p&gt;Here, we assume that&#xA;\begin{align*}&#xA;g(t, x) = \mathbb{E}\left(h(X_T) \mid X_t = x \right).&#xA;\end{align*}&#xA;Note that, by &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0387945490&quot; rel=&quot;nofollow noreferrer&quot;&gt;Shiryaev&lt;/a&gt;, $g(t, x)$&#xA;is a Borel measurable function such that, for any Borel measurable set $A$,&#xA;\begin{align*}&#xA;\int_{\{X_t \in A\}} h(X_T) d\mathbb{P} &amp;amp;= \int_A g(t, x) \mathbb{P}_{X_t}(dx),&#xA;\end{align*}&#xA;where $\mathbb{P}_{X_t}(dx)$ is the Lebesgue-Stieltjes measure generated by the distribution function of $X_t$, that is, for any Borel measurable set $B$,&#xA;\begin{align*}&#xA;\mathbb{P}_{X_t}(B) = \mathbb{P}(X_t \in B).&#xA;\end{align*}&#xA;It can also be shown that (see Page 196 of &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0387945490&quot; rel=&quot;nofollow noreferrer&quot;&gt;Shiryaev&lt;/a&gt;, starting with indicator and simple functions, then, by monotone convergence theorem, to all positive functions, and, by decomposition, to all integrable measurable functions),&#xA;\begin{align*}&#xA;\int_A g(t, x) \mathbb{P}_{X_t}(dx) = \int_{\{X_t \in A\}} g(t, X_t) d\mathbb{P}.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;\int_{\{X_t \in A\}} h(X_T) d\mathbb{P} = \int_{\{X_t \in A\}} g(t, X_t) d\mathbb{P}.&#xA;\end{align*}&#xA;In other words,&#xA;\begin{align*}&#xA;g(t, X_t) = \mathbb{E}(h(X_T) \mid X_t) = \mathbb{E}(h(X_T) \mid \mathcal{F}_t),&#xA;\end{align*}&#xA;by the Markov property. Moreover, $\{g(t, X_t), \, 0\le t \le T \}$ is obviously a martingale. &lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-05-01T20:15:45.530" LastActivityDate="2017-05-01T20:15:45.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33995" PostTypeId="2" ParentId="33981" CreationDate="2017-05-01T15:21:31.417" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;By what mechanism do b and c change? I see two options:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;They move by market forces, since if at any instant a+b+c&amp;lt;1&#xA;  people will take this arbitrage opportunity which will push b and c&#xA;  up.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The probabilities sum to one rule is enforced 'externally' by the exchange &gt;through some mechanism. I am interested in how such a mechanism could work.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If participants A, B and C are all competitors in the same contest and there can only by 1 winner then the sum of all 3 contracts should = 1 at any point in time.  When the contest ends, the winning contract is equal to 1, the others zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While betting is open, if the odds of one competitor is increasing, then the odds of the other competitors must be decreasing because the sum of all three binary events must equal 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the sum is greater or less than 1, an arbitrage exists.  If it is less than 1, you could buy all 3 contracts knowing that the winning contract will be equal to 1 when the contest is over.  The opposite would be true if the sum is greater than 1--you could sell all three knowing that you will only owe 1 when the contest closes.  Either way, you win.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Exchanges don't need to enforce this with a set of rules.  Market participants watch for arbitrages continuously and if/when one does exist, orders are entered as quickly and with as much size as possible until the arbitrage no longer exists.  For this reason, they rarely exist.&lt;/p&gt;&#xA;" OwnerUserId="26556" LastActivityDate="2017-05-01T15:21:31.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33996" PostTypeId="2" ParentId="33398" CreationDate="2017-05-01T17:25:40.077" Score="0" Body="&lt;p&gt;Here is the answer given by Wikipedia: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The time constant of an exponential moving average is the amount of&#xA;  time for the smoothed response of a unit set function to reach&#xA;  ${\displaystyle 1-1/e\approx 63.2\,\%}$ of the&#xA;  original signal. The relationship between this time constant,&#xA;  ${\displaystyle \tau } $ , and the smoothing factor, ${\displaystyle&#xA;&amp;gt; \alpha }$, is given by the formula: &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;${\displaystyle \alpha =1-e^{-\Delta T \over \tau }}$ &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Where ${\displaystyle \Delta T}$ is the sampling time interval&#xA;  of the discrete time implementation. If the sampling time is fast&#xA;  compared to the time constant then ${\displaystyle \alpha \ \approx {\frac{\Delta T}{\tau} }}$.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This canonical approach is fine, but I find it fairly inefficient because:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;taking the double and triple EMAs is redundant; it is essentially equal to using a lower alpha value;&lt;/li&gt;&#xA;&lt;li&gt;The weights of terms only converge to one; i.e., $\sum w \ne 1$; and&lt;/li&gt;&#xA;&lt;li&gt;Estimating initial parameters requires significant amount of recursion.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I therefore propose the following method: &lt;a href=&quot;https://quant.stackexchange.com/questions/33548/is-there-a-non-recursive-way-of-calculating-the-exponential-moving-average/33635#33635&quot;&gt;Is there a non-recursive way of calculating the exponential moving average?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26547" LastActivityDate="2017-05-01T17:25:40.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="33997" PostTypeId="2" ParentId="33967" CreationDate="2017-05-01T18:19:42.823" Score="1" Body="&lt;p&gt;To take a somewhat trivial example of an underlying asset subject to arbitrage pricing, we can think of options on futures.  But I think you have deeper examples in mind.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Structural models, such as Merton's famous 1974 model, treat equities themselves as derivatives.  In Merton's case the underlying was the economic value $A$ of the firm's assets $A$ and the strike price was the debt $D$.  Here, though, it is reasonably obvious that $A$ is not generally tradeable, so the argument for using arbitrage pricing theory and the associated risk-neutral processes is abstract, and only &quot;rigorous&quot; in a large $N$ portfolio argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea is basically that no single one of these untradeable securities can be arbed precisely, but that a large portfolio of them in a stable economy will take on a value expressed in effect by the market &quot;collectively arbing&quot; them, so that their derivatives can be treated using risk-neutral prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's a little thin, and makes one wonder just how large $N$ is supposed to be.  But it's probably the best analog to what you are looking for.  Namely, a kind of, as you say, &quot;vague arbitrage&quot; can be collectively made risk neutral at some sufficiently large $N$.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2017-05-01T21:13:52.013" LastActivityDate="2017-05-01T21:13:52.013" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="33998" PostTypeId="1" CreationDate="2017-05-01T18:23:07.130" Score="1" ViewCount="147" Body="&lt;p&gt;I urgently need to know how to apply the 'à trous' time-based decomposition in R [also known as &lt;a href=&quot;https://en.wikipedia.org/wiki/Stationary_wavelet_transform&quot; rel=&quot;nofollow noreferrer&quot;&gt;Stationary Wavelet Transform&lt;/a&gt;]&#xA;on a time series as a preprocessing, to use the result in forecasting and not suffering from boundary problem. &lt;/p&gt;&#xA;" OwnerUserId="27555" LastEditorUserId="16148" LastEditDate="2017-05-01T18:59:56.630" LastActivityDate="2017-05-01T18:59:56.630" Title="Wavelet transform (the à trous time-based decomposition) in R" Tags="&lt;time-series&gt;&lt;forecasting&gt;&lt;financial&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="34000" PostTypeId="1" CreationDate="2017-05-01T19:42:49.197" Score="4" ViewCount="6289" Body="&lt;p&gt;I tried to google it but I only get results for ISDA intruducing a new rolling convention. &lt;/p&gt;&#xA;" OwnerUserId="17775" LastActivityDate="2017-05-02T03:48:47.717" Title="What does &quot;rolling&quot; for a CDS contract mean?" Tags="&lt;cds&gt;&lt;credit-derivatives&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2017-05-11T03:43:03.047" ContentLicense="CC BY-SA 3.0" />
  <row Id="34003" PostTypeId="2" ParentId="33982" CreationDate="2017-05-01T21:37:35.530" Score="8" Body="&lt;p&gt;Either you or some reference you are following is in error here.  At-the-money (or at least near-the-money) options are the most liquidly traded.  And trading is much more heavy in out-of-the-money than in-the-money options.  &lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2017-05-01T21:37:35.530" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34005" PostTypeId="2" ParentId="34000" CreationDate="2017-05-02T03:31:15.930" Score="5" Body="&lt;p&gt;For CDS indices, a new series is created every 6 months (3/20 and 9/20). With each new series, the basket of reference entities will generally change, with some names replaced by others. Rolling is the act of closing the old contract and opening the new contract. The maturity of the CDS is typically much longer, with 5Y being the most commonly traded tenor. You can still own the old series past the roll date, but it will be off-the-run and less liquid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Single name CDS used to roll on the quarterly IMM dates (3/20, 6/20, 9/20, 12/20) but the convention now is to also roll these semiannually.&lt;/p&gt;&#xA;" OwnerUserId="5617" LastEditorUserId="5617" LastEditDate="2017-05-02T03:48:47.717" LastActivityDate="2017-05-02T03:48:47.717" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34008" PostTypeId="1" CreationDate="2017-05-02T11:00:54.417" Score="1" ViewCount="300" Body="&lt;p&gt;If you generate random stock price paths according to a GBM with daily increments, what will be the distribution of the realized volatility?  Assume that the realized volatility is measured over daily increments for the whole year.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume that the realized volatility is an unbiased estimator of the parameter sigma in the GBM, but I've never seen it proved.  As for the higher moments, what can be said ?  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastEditorUserId="19645" LastEditDate="2017-05-02T19:07:22.383" LastActivityDate="2017-05-02T19:07:22.383" Title="Distribution of realized volatility for stock prices from a GBM" Tags="&lt;volatility&gt;&lt;black-scholes&gt;&lt;distribution&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34009" PostTypeId="1" AcceptedAnswerId="34051" CreationDate="2017-05-02T11:57:11.007" Score="2" ViewCount="297" Body="&lt;p&gt;I'm reading the paper by &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S0377221706006278&quot; rel=&quot;nofollow noreferrer&quot;&gt;Zhao et al (2008)&lt;/a&gt; and have a problem with used definitions in the text on the page 1535.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;First, we generate a sample, $R$, of a given size from the distribution (21). Let $\hat{\mu}$ and $\hat{\sigma}^2$ be the sample mean vector and the sample variance covariance matrix. Then, we modify the generated sample&#xA;  to $$\hat{R}=\mu + (R-\hat{\mu})\hat{\sigma}^{-1}\sigma.$$&#xA;  Then, the modified sample $\hat{R}$ has the same first and second moments as the original distribution.&#xA;  To further test, whether the modified sample is arbitrage free, we use&#xA;  the Matlab backslash function to examine whether the solution to &#xA;  $(1 + R)^{\top} \backslash 1$ is componentwise positive.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question.&lt;/strong&gt; What means $1$ in the last line? Is it an identity matrix or a column vector of ones? And what is dimensions of this $1$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried to examine the solution from Table 1.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(pracma)&#xA;&#xA;n &amp;lt;- 5&#xA;&#xA;R&amp;lt;-matrix(&#xA;c(&#xA;0.0025, 0.0377, 0.0110, 0.0769, 0.0047,&#xA;0.0025, 0.0431, 0.0001, 0.0045, 0.0562,&#xA;0.0025, 0.0469, 0.0643, 0.0400, 0.0370,&#xA;0.0025, 0.0504, 0.0422, 0.0169, 0.0333,&#xA;0.0025, 0.0596, 0.0038, 0.1896, 0.0663), ncol=n)&#xA;&#xA;#I&amp;lt;-ones(n)&#xA;I &amp;lt;-diag(n)&#xA;&#xA;mldivide(t(I+R),I)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Add after JejeBelfort's comment.&lt;/strong&gt; If the $1$ is a column vector of ones then what is $+$? Union operation or Kronecker product operator?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;I &amp;lt;- rep(1, n)&#xA;cbind(I, R)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Reference.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yonggan Zhao, William T. Ziemba (2008) Calculating risk neutral probabilities and optimal portfolio policies in a dynamic investment model&#xA;with downside risk control. European Journal of Operational Research 185 (2008) 1525–1540.&lt;/p&gt;&#xA;" OwnerUserId="20913" LastEditorUserId="20913" LastEditDate="2017-05-02T23:58:43.663" LastActivityDate="2017-08-03T15:01:41.453" Title="What is a notation '1' in risk neutral probabilities paper?" Tags="&lt;portfolio-management&gt;&lt;risk-management&gt;&lt;self-study&gt;&lt;notation&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34010" PostTypeId="1" CreationDate="2017-05-02T12:59:23.440" Score="0" ViewCount="1304" Body="&lt;p&gt;I want to calculate the beta of a computer vendor using return data from 31st Jan 2008 to 31 Jan 2013 (period of five years) against the return of S&amp;amp;P500.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will be regressing the excess return of company against excess return of S&amp;amp;P500 (where the company is the dependent variable, and S&amp;amp;P is the independent variable).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the &lt;a href=&quot;https://www.treasury.gov/resource-center/data-chart-center/interest-rates/Pages/TextView.aspx?data=yield&quot; rel=&quot;nofollow noreferrer&quot;&gt;daily treasury yield curve rates&lt;/a&gt; as the source of my risk free rates. I am a bit dumbfounded as to exactly which rates to use. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First I have determined that I will use the five maturity constant maturity treasury rates, which is because the duration of the five year maturity treasury rates is similar to the length of the project.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but now, I don't know which date I should choose my rate from.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should I choose the 5 year maturity on 31st Jan 2008, which is 2.82% (and divide it by 360 to get the daily rate) and use this rate for the next five years. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or should I get the average of 5 year maturity yield from 31st Jan 2008 to 31st Jan 2013 (which is 1.8053% using excel) and use it as my risk free rate?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or is there a better method for the estimation of the risk-free rate. &lt;/p&gt;&#xA;" OwnerUserId="27746" LastActivityDate="2017-06-01T20:34:04.517" Title="How to determine the risk free rate for the calculation of Beta" Tags="&lt;interest-rates&gt;&lt;risk-free&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34011" PostTypeId="2" ParentId="34010" CreationDate="2017-05-02T13:46:58.093" Score="0" Body="&lt;p&gt;IMO, investor wants to invest in a company based on the expectations that this stock provids returns above long-term interest rate offered by debt investments. So &lt;em&gt;beta&lt;/em&gt; shall be calculated using long-term interest rates (may be 10/20 years)..and also I would suggest to chose average of long-term interest rates from the 31st Jan 2008 to 31st Jan 2013 to use it as risk free rate.&lt;/p&gt;&#xA;" OwnerUserId="22507" LastActivityDate="2017-05-02T13:46:58.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34012" PostTypeId="1" CreationDate="2017-05-02T14:37:36.957" Score="2" ViewCount="87" Body="&lt;p&gt;I have read that the utility function is usually concave. I assume this requirement arises in order to meet the diversification effect:$$f(\lambda_1c_1+\lambda_2c_2)\ge \lambda_2 f(c_1)+\lambda_2f(c_2)$$&#xA;for some $\lambda_1,\lambda_2\leq1$ and $c_1,c_2$ two assets with some payoff. An investor is happier to hold $c_1,c_2$ in a portfolio than separately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&#xA;Why do we restrict $\lambda_1$,$\lambda_2$ to be less than 1? Is it not useful to require $-f$ to be sub linear so I can consider any arbitrary composition of $c_1$ and $c_2$, i.e. $\lambda_1, \lambda_2 \in \Bbb R^+$&lt;/p&gt;&#xA;" OwnerUserId="25867" LastActivityDate="2017-05-02T14:37:36.957" Title="Why is utility concave?" Tags="&lt;econometrics&gt;&lt;utility-theory&gt;" AnswerCount="0" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="34013" PostTypeId="1" CreationDate="2017-05-02T16:11:49.897" Score="0" ViewCount="93" Body="&lt;p&gt;Imagine I price a Variance Swap for an investor and the observation date starts tomorrow and ends in 30 days. If I use dynamic replication with options to price my variance swap do I use options with a maturity of 1 month? &lt;/p&gt;&#xA;" OwnerUserId="27208" LastActivityDate="2017-05-02T17:36:31.633" Title="Question regarding the purchase of a Variance Swap" Tags="&lt;variance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34015" PostTypeId="1" CreationDate="2017-05-02T17:01:30.157" Score="-1" ViewCount="301" Body="&lt;p&gt;I have a question concerning the super-replication of a call in a trinomial tree which has the following characteristics:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose we have one risky asset $S_t=2+\sum_{k=1}^tZ_i$, where $P(Z_i=0)=P(Z_i=-1)=P(Z_i=1)=\frac{1}{3}$, where $P$ denotes the objective (or real-world) probability measure and one bond $B_t=1$ for t=1,2 (so the risk-free rate is assumed to be 0 over time). The call that is supposed to be super replicated is denoted by $C_2=(S_2-1)^+$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One can show that there exists an equivalent martingale measure in this market and therefore is is arbitrage-free but obviously not complete. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $\Delta_t$ denotes the amount of shares and $\beta_t$ denoted the units of bonds we need to hold at time $t$ for our hedging strategy, I calculated the following for the superhedge portfolio $(\beta_t,\Delta_t)$: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On $\{Z_1=1 \}$&#xA;$$&#xA;4\Delta_2 + \beta_2 \geq 3\\&#xA;3\Delta_2 + \beta_2 \geq 2\\&#xA;2\Delta_2 + \beta_2 \geq 1\\&#xA;$$&#xA; which holds for $\Delta_2=1$ and $\beta_2=-1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On $\{Z_1=0 \}$&#xA;$$&#xA;3\Delta_2 + \beta_2 \geq 2\\&#xA;2\Delta_2 + \beta_2 \geq 1\\&#xA;1\Delta_2 + \beta_2 \geq 0\\&#xA;$$&#xA; which holds for $\Delta_2=1$ and $\beta_2=-1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On $\{Z_1= -1 \}$&#xA;$$&#xA;2\Delta_2 + \beta_2 \geq 1\\&#xA;1\Delta_2 + \beta_2 \geq 0\\&#xA;0\Delta_2 + \beta_2 \geq 0\\&#xA;$$&#xA;and here the last inequality implies the middle one, hence for $\Delta_2=\frac{1}{2}$ and $\beta_2=0$ this holds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far these are the values for the super-replicating portfolio at $t=2$. In order to calculate the amounts that need to be held at $t=1$ we need to keep in mind that a superhedge needs to be self-financing, i.e. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;3\Delta_1 +\beta_1 = 3\Delta_2 + \beta_2 = 3*1-1 = 2 \text{  on $\{Z_1=1 \}$ }\\&#xA;2\Delta_1 +\beta_1 = 2\Delta_2 + \beta_2 = 2*1-1=1 \text{  on $\{Z_1=0 \}$ }\\&#xA;1\Delta_1 +\beta_1 = \frac{1}{2}\Delta_2 + \beta_2 = \frac{1}{2}*1-0=\frac{1}{2}\text{  on $\{Z_1=-1 \}$ }\\&#xA;$$&#xA;which has no solution, since $\Delta_1$ and $\beta_1$ need to be constant. So I can't find a self-financing portfolio that is superhedging the call $C$. I am really confused as I don't see where the flaw in my logic is. I have been trying to find a solution to this since a couple of days so I would really appreciate any help. &#xA;Cheers.&lt;/p&gt;&#xA;" OwnerUserId="27749" LastActivityDate="2017-05-05T01:25:02.017" Title="Super Hedging in incomplete Trinomial Tree" Tags="&lt;hedging&gt;&lt;replication&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34016" PostTypeId="2" ParentId="34013" CreationDate="2017-05-02T17:05:08.250" Score="4" Body="&lt;p&gt;The options will form a static replication - and yes - they should expire on the same day as the variance swap.  You should be sure to do all of your analytics in business time.  Also, typically a year is considered 252 business days by default - even in FX where there are no holidays (though there are no WMR fixings on New Years, Christmas, Good Friday).  You will still need to trade the underlying futures  for the expiration date dynamically (or alternatively flip puts to calls or &lt;em&gt;vice&lt;/em&gt; &lt;em&gt;versa&lt;/em&gt; in your option strip as the forward moves to keep all options out of the money - a put call parity argument will explain that).  The details are in Derman's famous paper about variance swaps.  Skimmed wikipedia and this is probably ok too (though I didn't look carefully):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.emanuelderman.com/writing/entry/more-than-you-ever-wanted-to-know-about-volatility-swaps-the-journal-of-der&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.emanuelderman.com/writing/entry/more-than-you-ever-wanted-to-know-about-volatility-swaps-the-journal-of-der&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Variance_swap&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Variance_swap&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The wikipedia link has some good references at the bottom also.&lt;/p&gt;&#xA;" OwnerUserId="26977" LastEditorUserId="26977" LastEditDate="2017-05-02T17:36:31.633" LastActivityDate="2017-05-02T17:36:31.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34017" PostTypeId="2" ParentId="34008" CreationDate="2017-05-02T18:47:16.357" Score="-1" Body="&lt;p&gt;I assume the OP means what is the variance, across N paths of M steps each, of the realised volatility of the GBM. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You would imagine that it is related to the dt-step size implied by M. i.e. for lower M, the variance of the pathwise-estimated volatility increases. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Feels like is related to strike adjustments for variance swaps with discrete observations, not sure if there is literature out for that but worth googling&lt;/p&gt;&#xA;" OwnerUserId="27516" LastActivityDate="2017-05-02T18:47:16.357" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34020" PostTypeId="1" CreationDate="2017-05-02T20:56:15.187" Score="-1" ViewCount="118" Body="&lt;p&gt;When I review my course on swaps, I read the following sentence:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;the value of the swap rate is independent of the valuation date(even though the PV's of the individual legs of the swap are clearly not)&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I don't quite get this. We know &#xA;$$&#xA;P_0^{fix}(t) = \sum \alpha_j C P_0(t, T_j^c)&#xA;$$&#xA;where $\alpha_j$ are the day count fractions on the fixed leg and $T_j^c$ is the coupon date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;P_0^{float}(t) = \sum \delta_j L_j P_0(t,T_j^f)&#xA;$$ &#xA;where $L_j$ is the LIBOR forward rate, $\delta_j$ is the day count fraction applying to the floating leg.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know that valuation date t belongs to $[0,T_0]$ where $T_0$ is spot date. So swap rate can be obtained as the following formula:&#xA;$$&#xA;C^* = \frac{P_0^{float}(t)}{A_0(t)} = \frac{\sum \delta_j L_j P_0(t,T_j^f)}{\sum \alpha_j P_0(t, T_j^c)}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems there is no way to get $\frac{P_0(t,T_j^f)}{P_0(t, T_j^c)}$ to get rid of $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how come the value of swap rate is not dependent on t??&lt;/p&gt;&#xA;" OwnerUserId="27754" LastEditorUserId="27754" LastEditDate="2017-05-02T21:04:26.050" LastActivityDate="2017-05-12T00:13:39.240" Title="why swap rate not dependent on valuation date?" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;finance&gt;&lt;swaps&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34026" PostTypeId="2" ParentId="33977" CreationDate="2017-05-03T02:26:17.847" Score="1" Body="&lt;p&gt;The choice affects how you construct beta among other things, and in the traditional CAPM sense beta is market cap weighted. There's also market cap squared or cubed weighting schemes. This allows the factor model to more accurately track institutional benchmarks or style of investing for risk purposes. There are also fundamental or free float weighting schemes.&lt;/p&gt;&#xA;" OwnerUserId="1764" LastActivityDate="2017-05-03T02:26:17.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34027" PostTypeId="1" AcceptedAnswerId="34059" CreationDate="2017-05-03T04:07:55.860" Score="3" ViewCount="624" Body="&lt;p&gt;I've always been confused with Delta hedging. It is well-known that for a (smooth enough) function of $(S,t)$ we have, due to Ito's lemma, that:&#xA;\begin{eqnarray*}&#xA;dC = \left(\frac{\partial C}{\partial t} (S,t) + \mu S \frac{\partial C}{\partial S} (S,t) + \frac{1}{2} \sigma^2 S^2 \frac{\partial^2 C}{\partial S^2}(S,t)\right)dt + \sigma S \frac{\partial C}{\partial S} (S,t) dX&#xA;\end{eqnarray*}&#xA;(source &lt;a href=&quot;https://www.quantstart.com/articles/Deriving-the-Black-Scholes-Equation&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;, where $X$ is the standard Brownian motion). The author then proceeds to show that if we choose $\Delta = -\frac{\partial C}{\partial S} (S,t)$, then we will have&#xA;\begin{align*}&#xA;d(C+\Delta S) &amp;amp;= \left(\frac{\partial C}{\partial t} (S,t) + \mu S \frac{\partial C}{\partial S} (S,t) + \frac{1}{2} \sigma^2 S^2 \frac{\partial^2 C}{\partial S^2}(S,t) + \Delta \mu S\right) dt\\&#xA; &amp;amp;+ \sigma S \left(\frac{\partial C}{\partial S}+\Delta\right) dX\\&#xA;&amp;amp;=\left(\frac{\partial C}{\partial t}(S,t) + \frac{1}{2} \sigma^2 S^2 \frac{\partial^2 C}{\partial S^2}(S,t)\right)dt&#xA;\end{align*}&#xA;(I've corrected the author's typo and replaced the term $ \Delta S (\frac{\partial C}{\partial S}+\Delta) dX$ in the formula above with the correct one $\sigma S (\frac{\partial C}{\partial S}+\Delta) dX$ )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand the usual procedure of $\Delta$, but I never understand how $\Delta$ can be defined as $-\frac{\partial C}{\partial S} (S,t)$. By definition a hedging strategy must be a predictable process, is there any justification that $\Delta$ given as above is predictable, not merely adapted, to the filtration generated by the stock process?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even if we accept the definition of $\Delta$, the author also doesn't explain how to compute $d(C+\Delta S)$. But, as far as I know, if $\Delta$ is really the symbol for $-\frac{\partial C}{\partial S} (S,t)$, then we will have&#xA;$$d(\Delta S)=Sd(\Delta)+\Delta dS+(dS)\cdot(d\Delta).$$&#xA;And as for $d\Delta$, I think it's just replacing $C$ by $\Delta$ in the expression of $dC$, and the resulting $d(\Delta S)$ will be super-complicated with $\partial^3 C/\partial S^3$ present. What I obtained in the end was a horribe mess, the risky term $dX$ wasn't eliminated and the non-random term $dt$ doesn't match that in the BS PDE. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wherein lies the problem?&lt;/p&gt;&#xA;" OwnerUserId="19004" LastEditorUserId="15154" LastEditDate="2017-05-03T11:08:25.290" LastActivityDate="2017-05-05T12:47:33.810" Title="Derivation of BS PDE problem using Delta hedging" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;greeks&gt;&lt;delta-hedging&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34028" PostTypeId="2" ParentId="34027" CreationDate="2017-05-03T04:43:41.560" Score="3" Body="&lt;p&gt;this is the d on the delta problem. (In my book concepts I discuss this. Sections 5.6 and 5.7 )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially we hold delta constant across time steps and so ignore the d on the delta because there is an implicit bond holding into which we are putting any residual cash so the value of our hedging portfolio only changes due to changes in the financial instruments rather that from changes in how we hold the money.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Changing Stocks into Bonds or Bonds into stocks will not make or lose money in a no-transaction cost world. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding predictability, if everything is continuous which they are here, adapted and predictable are the same. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastEditorUserId="1809" LastEditDate="2017-05-04T04:41:46.327" LastActivityDate="2017-05-04T04:41:46.327" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="34029" PostTypeId="2" ParentId="34015" CreationDate="2017-05-03T05:44:18.837" Score="0" Body="&lt;p&gt;I don't quite follow what you are doing. However, the easy way to do it is to plot the three points. Draw straight lines through all subsets of size two. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each of these lines will either be above or below or equal to the third point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Above means super-replication. Below means sub-replication. Equal means replication,.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially do the three cases and see what that gives you for the third branch.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastEditorUserId="1809" LastEditDate="2017-05-05T01:25:02.017" LastActivityDate="2017-05-05T01:25:02.017" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34031" PostTypeId="2" ParentId="33977" CreationDate="2017-05-03T13:14:51.050" Score="2" Body="&lt;p&gt;The distribution of equity market capitalizations is such that there are few large outliers (the Apples of the world), but then a lot more smaller companies. The consequence of this is that if you do a regression, such as a cross-sectional regression of the returns in period 1 against the book to price in period 0, then the coefficients will be dominated by the large number of small stocks. In other words, you would estimate a value factor return from period 0 to period 1 that's largely driven by the smaller-cap stocks. By contrast, a weighted least squares approach could be employed to put a greater emphasis on the larger market capitalization stocks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To the extent that Z-scores in a factor model are approximating this approach, the analysis holds. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are many other situations where models attempt to account for this. For instance, the Fama-French factors are constructed by splitting the universe into high and low market capitalization stocks. On a cross-sectional basis, one could use dummy variables to account for the different performance between the small and large stocks. More generally, a hierarchical model could be used.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2017-05-03T13:14:51.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34032" PostTypeId="2" ParentId="235" CreationDate="2017-05-03T13:48:57.013" Score="-1" Body="&lt;p&gt;I understand that a useful approximation for prob of touch is 2 * delta, though I don't recall which authority that is from.&lt;/p&gt;&#xA;" OwnerUserId="27760" LastActivityDate="2017-05-03T13:48:57.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34033" PostTypeId="1" AcceptedAnswerId="34055" CreationDate="2017-05-03T15:01:59.027" Score="-1" ViewCount="1207" Body="&lt;p&gt;I understand the Wikipedia article for put-call parity on a theoretical level: if you magically had portfolios consisting of 1) long a call, short a put, and 2) long the stock, short a discounted strike price's worth of zero coupon bonds, these portfolios must have the same value at expiration and so they should have the same value now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Put%E2%80%93call_parity#Derivation&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Put%E2%80%93call_parity#Derivation&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I'm a bit confused about how you could practically replicate put-call-parity.  Say you had $0, but a bank that loaned and borrowed money at a deterministic and constant interest rate.   So you want to buy the call and you sell the put to construct the first put-call parity portfolio.  Don't you need to borrow money to finance this transaction? Or sell a bond? Where does this borrowing cost - the cost required to create this portfolio - appear in the equation for put-call parity?&lt;/p&gt;&#xA;" OwnerUserId="25333" LastActivityDate="2017-05-04T15:09:56.817" Title="Put call parity in practice" Tags="&lt;options&gt;&lt;call&gt;&lt;put&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34035" PostTypeId="1" CreationDate="2017-05-03T15:24:44.983" Score="0" ViewCount="161" Body="&lt;p&gt;I am using the backward finite difference Method to simulate the price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The algorithm is the follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose we know $V_T(S_T)=payoff$, we can use a backward recurrence:$$V_{T-\delta t}=V_T-\frac{\partial V}{\partial t}\cdot \delta t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This follows just from the Talyor approximation around time $T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{\partial V}{\partial t}$ can be obtained from Black-Scholes-Partial differential equation, i.e.$$\frac{\partial V}{\partial t}=rV-rS\frac{\partial V}{\partial S}-\frac{1}{2}\sigma^2S^2\frac{\partial^2 V}{\partial S^2}$$, where the partial differential can be approximated by central difference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; (1) At time $T$ my $V_T$ is equal to the payoff of the option, this is not really differentiable, how can I assume that the partial differential $\frac{\partial^2 V}{\partial S^2}$ and $\frac{\partial V}{\partial S}$ exists? If these doesn't exist, I am not really able to define the recurrence in the first formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) By the Taylor approximation around time $T$ in the first formula, $V_T$ depends also on $S_T$ which is again time dependend, why I can neglect the time dependence in the $S_T$ term and only approximate around $t=T$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="25867" LastEditorUserId="11834" LastEditDate="2017-05-03T20:59:20.320" LastActivityDate="2017-05-03T20:59:20.320" Title="Finite Difference Method for Black-Scholes differential equation" Tags="&lt;finite-difference-method&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34036" PostTypeId="1" CreationDate="2017-05-03T15:44:46.957" Score="4" ViewCount="940" Body="&lt;p&gt;I'm looking for proof of the following statement:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;The existence of an arbitrage-free implied volatility surface is&#xA;  equivalent to the existence of a well-defined local volatility&#xA;  surface.&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="1764" LastActivityDate="2017-10-07T01:06:09.257" Title="Proof of arbitrage-free implied volatility surface in relation to local volatility surfaces" Tags="&lt;implied-volatility&gt;&lt;local-volatility&gt;&lt;proof&gt;&lt;volatility-surface&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34037" PostTypeId="2" ParentId="2828" CreationDate="2017-05-03T15:48:40.520" Score="2" Body="&lt;p&gt;Actually it is quite simple to demonstrate Ito's correction term in a binomial tree.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Details can be found in my new paper (p. 8-10):&lt;br&gt;&#xA;&lt;a href=&quot;https://ssrn.com/abstract=2956257&quot; rel=&quot;nofollow noreferrer&quot;&gt;von Jouanne-Diedrich, Holger: Ito, Stratonovich and Friends (April 21, 2017)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Abstract&lt;/strong&gt;&lt;br&gt; This exposition should provide you with the bigger&#xA;  picture of stochastic calculus, especially stochastic integrals. It&#xA;  heuristically and pedagogically develops key concepts and intuitions&#xA;  of one of the most important fields of applied mathematics today,&#xA;  namely quantitative finance. It demystifies ideas that a normally&#xA;  either too starkly dumbed down or hidden under highly technical&#xA;  details, so this text tries to fill a missing link in the literature&#xA;  where there seems to be no middle ground as of today. Additionally,&#xA;  the paper gives two results which cannot (to the best of my knowledge)&#xA;  readily be found in the classical literature: an illustration of the&#xA;  Ito correction term within binomial trees and a Taylor expansion for&#xA;  the Stratonovich integral.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Here I only give a summary of the general idea:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We start with a simple binomial tree with $n$ steps and $p=\frac{1}{2}$. Then we transform this tree with a convex function, e.g. with the quadratic function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After that we compare the expected value of this transformed tree with the square of the expected value of the original tree - the difference is Ito's correction term.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All of this leads to a &lt;a href=&quot;https://en.wikipedia.org/wiki/Variance#Definition&quot; rel=&quot;nofollow noreferrer&quot;&gt;well known identity&lt;/a&gt;:&#xA;$$\mathbb{E}[X^2]=\mathbb{E}[X]^2+Var[X]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in this case the variance can be interpreted as Ito's correction term - a nice correspondence to the well known $\frac{1}{2}\sigma^2$-term in the mean of the &lt;a href=&quot;https://en.wikipedia.org/wiki/Log-normal_distribution&quot; rel=&quot;nofollow noreferrer&quot;&gt;log-normal distribution&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2017-05-03T15:54:54.073" LastActivityDate="2017-05-03T15:54:54.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34038" PostTypeId="1" CreationDate="2017-05-03T16:16:08.403" Score="2" ViewCount="815" Body="&lt;p&gt;Im trying to calculate Alpha using CAPM &amp;amp; I have data on everything necessary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R_t-R_f={\alpha}+{\beta}\times(R_m-R_f)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$${\alpha}=R_t-R_t-{\beta}\times(R_m-R_f)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In more detail, I have monthly data on returns, market returns and the risk free rate. Now lets say I'm interested in how a fund has performed in 12 months, which one of the following two methods is correct?  &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ol&gt;&#xA;  &lt;li&gt;Alpha = monthly returns - monthly risk free rate - beta(monthly market returns - monthly risk free rate)&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This will yield a monthly Alpha and then calculating the yearly Alpha per fund by the formula $(a+{\alpha}_1)(a+{\alpha}_2)...-1$ and beta here is calculated by Covariance(Monthly fund return, Monthly market return)/Variance(Monthly Market return)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or do I &lt;em&gt;first&lt;/em&gt; convert the returns to yearly and &lt;em&gt;then&lt;/em&gt; calculate Alpha?&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ol start=&quot;2&quot;&gt;&#xA;  &lt;li&gt;Alpha  = Yearly returns - Yearly risk free - beta ( yearly market return - yearly risk free rate) &lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and beta here is calculated by Covariance(Yearly fund return, Yearly market return)/Variance(Yearly market return)&lt;/p&gt;&#xA;" OwnerUserId="27750" LastEditorUserId="18030" LastEditDate="2017-05-03T16:27:59.677" LastActivityDate="2018-08-15T16:48:03.567" Title="CAPM Calculations" Tags="&lt;finance&gt;&lt;regression&gt;&lt;finance-mathematics&gt;&lt;capm&gt;&lt;statistical-finance&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34040" PostTypeId="2" ParentId="25219" CreationDate="2017-05-03T19:55:23.470" Score="0" Body="&lt;p&gt;Make sure you do the RETURN correlation, not the price correlation.&#xA;Also, if number is not converging, increase the amount of steps so that it is sufficient enough for the law of large numbers kick in.&lt;/p&gt;&#xA;" OwnerUserId="27764" LastActivityDate="2017-05-03T19:55:23.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34042" PostTypeId="2" ParentId="25219" CreationDate="2017-05-03T21:02:01.530" Score="1" Body="&lt;p&gt;You can use a multivariate standard normal distribution to achieve the desired results.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;require(mvtnorm)&#xA;require(matrix)&#xA;&#xA;Covariance.matrix &amp;lt;- # your covariance matrix here&#xA;Drift &amp;lt;- # your drift terms here&#xA;Vol &amp;lt;- # your vol terms here&#xA;n &amp;lt;- # desired number of samples&#xA;z &amp;lt;- rmvnorm(n, simga=nearPD(Covariance.matrix), method=&quot;chol&quot;)&#xA;GBM &amp;lt;- Drift + z * Vol&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If you don't want to assume normality, you can use Cornish-Fisher or something similar to adjust for skew and kurtosis for each individual currency.&lt;/p&gt;&#xA;" OwnerUserId="19473" LastActivityDate="2017-05-03T21:02:01.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34044" PostTypeId="1" CreationDate="2017-05-04T00:31:28.173" Score="0" ViewCount="226" Body="&lt;p&gt;I'm currently using Pandas, Numpy, Scikit-learn, Matplolib but I feel those are just general data analytics related modules. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was taking a Couresa course that used QSTK for specific quant related tasks, but the last update seems to be 2013 or so. I'm looking for tools that create portfolios, different ways to allocate my money (by sectors, by individual stocks), market simulator,  aware of Earnings events etc.   Any tools that will make any of these easier? &lt;/p&gt;&#xA;" OwnerUserId="25040" LastActivityDate="2017-05-04T14:05:09.630" Title="Finance specific modules for Python in 2017?" Tags="&lt;portfolio-optimization&gt;&lt;python&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34045" PostTypeId="2" ParentId="33993" CreationDate="2017-05-04T04:26:37.977" Score="1" Body="&lt;p&gt;Not possible for us to debug your code to find out the cause. Possible reasons:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You have a bug&lt;/li&gt;&#xA;&lt;li&gt;You don't have a bug but your understanding of the model is incorrect&lt;/li&gt;&#xA;&lt;li&gt;Both your code and FinCAD are correct, the difference is due to assumptions&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I don't think FinCAD would make a mistake in such simple model, they have a team of PhD quants for model validation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I should share with you what I'd do if I were you:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You mentioned you failed to replicate for geometric Asian option. Are you talking about Haug, Haug and Margrable? It's just an analytical formula, so there shouldn't be an issue. Check QuantLib's implementation at: &lt;a href=&quot;https://github.com/lballabio/QuantLib/blob/9618244fde50546b3ee813dfed76937b01058586/ql/pricingengines/asian/analytic_discr_geom_av_price.cpp&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/lballabio/QuantLib/blob/9618244fde50546b3ee813dfed76937b01058586/ql/pricingengines/asian/analytic_discr_geom_av_price.cpp&lt;/a&gt;. Can you use the code replicate your results and FinCAD? &lt;/li&gt;&#xA;&lt;li&gt;Check your analytical geometric Asian with &quot;Complete Guide To Option Pricing&quot;. I post a screenshot of the book for you. The book has a pseudocode for you to compare your results. You should not expect to replicate FinCAD if you can't replicate the book. Similarly, the book has a section for Curran's Approximation.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/4e11c.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/4e11c.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/wG9Gq.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/wG9Gq.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;When you test a model, try off with boundary conditions. Don't use normal values until your code works with boundary conditions. Possible ideas: deep out-of-the call, shorten your average period to very small upon maturity (European option), zero volatility, zero risk-free rate etc. Make sure your option value is zero if there's no hope of exercising. Make sure your option behaves like a spot if there's absolutely chance of exercising.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Once you can fix your code for discrete geometric, you can then move on to more complicated arithmetic.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="601" LastEditorUserId="601" LastEditDate="2017-05-04T04:31:45.220" LastActivityDate="2017-05-04T04:31:45.220" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34046" PostTypeId="1" CreationDate="2017-05-04T06:21:08.083" Score="-6" ViewCount="61" Body="&lt;p&gt;Regarding &lt;a href=&quot;https://www.quandl.com/data/SF1-Core-US-Fundamentals-Data/documentation/indicators&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.quandl.com/data/SF1-Core-US-Fundamentals-Data/documentation/indicators&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to get the &lt;strong&gt;&lt;em&gt;sales&lt;/em&gt;&lt;/strong&gt; of a company retrieved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can this be determined?&lt;/p&gt;&#xA;" OwnerUserId="27773" LastActivityDate="2017-05-04T22:20:10.490" Title="How to Calculate Sales From Other Key Figures?" Tags="&lt;fundamentals&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34048" PostTypeId="2" ParentId="390" CreationDate="2017-05-04T10:50:51.180" Score="0" Body="&lt;p&gt;All answers here are quite relevant. To add, in a world of large datasets there is a simple proof why binning might be better than continuous variable - those are models based on trees (specifically random forests and trees boosting). On a quite large dataset they almost always perform better than any smart splines or other non-linear transformations to the linear model. One might say that this is due to model averaging - but why then boosting and bagging of linear regressions almost never win boosting and bagging of trees? That's because if you have sufficient data, smart techniques of latest binning algos inside decision trees simply performs better on highly non-linear datasets without much time to tune those models &lt;/p&gt;&#xA;" OwnerUserId="27775" LastActivityDate="2017-05-04T10:50:51.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34049" PostTypeId="1" AcceptedAnswerId="34050" CreationDate="2017-05-04T11:32:23.210" Score="1" ViewCount="425" Body="&lt;p&gt;I am simulating asset prices for n days using GMB with Euler scheme, calculate returns and then perform Kolmogorov-Smirnov test on simulated returns. Code for simulating GBM :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def simulate_GBM(mu, sig, asset_price, number_of_days):&#xA;&#xA;        delta = 1 / 252&#xA;        t = np.arange(0, number_of_days / 252, delta)&#xA;&#xA;        path = np.zeros(len(t))&#xA;&#xA;        path[0] = asset_price&#xA;&#xA;        for i in range(0, len(t) - 1):&#xA;            path[i + 1] = path[i] + path[i] * mu * delta + \&#xA;                          sig * path[i] * sqrt(delta) * np.random.randn()&#xA;            if path[i + 1] &amp;lt; 0:&#xA;                print(&quot;Zero assset values!&quot;)&#xA;                path[i + 1] = 1&#xA;        return path&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Code for Monte-Carlo GBM&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def perform_GBM_Monte_Carlo(mu, sig, asset_price, num_sim, number_of_days):&#xA;&#xA;        simulations = np.zeros(num_sim)&#xA;        stop_date = number_of_days&#xA;&#xA;        for i in range(0, self.num_sim - 1):&#xA;            simulations[i] = (simulate_GBM(mu, sig, asset_price, num_sim, number_of_days)[stop_date - 1])&#xA;&#xA;        return simulations&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then I calculate returns and perform test&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;data = perform_GBM_Monte_Carlo(0.05, 0.3, 100, 100000, 252)&#xA;returns = np.zeros(len(data))&#xA;for i in range(0, len(data) - 1):&#xA;    returns[i] = data[i]/100 - 1 # initial asset price is 100&#xA;&#xA;lognorm_params = stats.maxwell.fit(returns)&#xA;t_stat, p = stats.kstest(returns, 'lognorm', lognorm_params)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Theory says that returns must be lognormally distributed, but I have very p_value. Is the problem with GBM simulation or the way I perform K-S test?&lt;/p&gt;&#xA;" OwnerUserId="24771" LastActivityDate="2017-05-04T11:41:12.390" Title="Perform scipy Kolmogorov-Smirnov Test for lognormal distribution in GBM" Tags="&lt;black-scholes&gt;&lt;brownian-motion&gt;&lt;lognormal&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34050" PostTypeId="2" ParentId="34049" CreationDate="2017-05-04T11:41:12.390" Score="1" Body="&lt;p&gt;I haven't checked your code, but ... even if your code is all correct (you have calculated the lognormal returns), your test won't work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have 100000 samples, this is a large number. With this large sample size (and huge statistical power), the KS-test will reject anything. If you don't believe me, try to draw 100000 &#xA;lognormal distribution directly from Python, your KS-test will still reject you for very low p-value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Statistical test is meaningless for a large sample size, unless you want very low level of significance.&lt;/p&gt;&#xA;" OwnerUserId="601" LastActivityDate="2017-05-04T11:41:12.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34051" PostTypeId="2" ParentId="34009" CreationDate="2017-05-04T13:12:12.030" Score="3" Body="&lt;h2&gt;The 1 you are referring to is a vector of ones&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The expression  $(1 + R)^T \backslash 1$ appears to be shorthand for a MATLAB equation such as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;s = (ones(n,k) + R)' \ ones(n, 1)&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;R&lt;/code&gt; is an &lt;code&gt;n&lt;/code&gt; by &lt;code&gt;k&lt;/code&gt; matrix (i.e. specifying returns for $n$ periods of $k$ assets).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;1 + R&lt;/code&gt; adds 1 to each element of the matrix R (eg. makes it a return like 1.02 instead of .02). The MATLAB command &lt;code&gt;\&lt;/code&gt; would solve the below system for $\mathbf{s}$ in the least squares sense:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ ( 1 + R)^T \mathbf{s} = \begin{bmatrix} 1 \\ 1 \\ \ldots \\ 1 \end{bmatrix} $$&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;A non-negative solution $\mathbf{s}$ guarantees the absence of arbitrage&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Any solution $\mathbf{s}$ to this linear system will be a vector of state prices for the $n$ states that satisfies the Law of One Price (LOOP). For any asset $i$, the inner product of the return series and the state price vector gives the value 1 which is the price of a return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ (1 + \mathbf{r}_i)^T \mathbf{s} = 1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $\mathbf{s}$ correctly prices each asset, the Law of One Price is satisfied. No arbitrage is a somewhat different condition though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The existence of a non-negative state price vector $\mathbf{s}$ implies the absence of arbitrage. A positive payoff with a strictly negative cost is called an &lt;em&gt;arbitrage&lt;/em&gt;. If the state price density (stochastic discount factor) is positive, then one cannot construct an arbitrage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Note: I'm using bold letters for vectors.)&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Farkas's Lemma and No Arbitrage&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;By &lt;a href=&quot;https://en.wikipedia.org/wiki/Farkas%27_lemma&quot; rel=&quot;nofollow noreferrer&quot;&gt;Farkas's Lemma&lt;/a&gt;, exactly one of the following conditions holds:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;There exists a state price vector $\mathbf{s} \in \mathbb{R}^n$ such that $(1+R)^T \mathbf{s} = \mathbf{1}$ and $\mathbf{s} \geq 0$&lt;/li&gt;&#xA;&lt;li&gt;There exists a $\mathbf{w} \in \mathbb{R}^k$ (giving investments in the $k$ assets) such that $(1+R)\mathbf{w} \geq 0$ and $\mathbf{1}^T \mathbf{w} &amp;lt; 0$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Condition (1) is the existence of a non-negative state price vector $\mathbf{s}$.Condition (2) implies it's possible to construct an arbitrage:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Investing $w_i$ in asset $i$ gives the non-negative payoff $(1 + R) \mathbf{w} \geq 0$&lt;/li&gt;&#xA;&lt;li&gt;The portfolio has a negative cost since $ \mathbf{w}^T \mathbf{1} &amp;lt; 0$. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-08-03T15:01:41.453" LastActivityDate="2017-08-03T15:01:41.453" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34053" PostTypeId="2" ParentId="34027" CreationDate="2017-05-04T13:48:29.343" Score="2" Body="&lt;p&gt;Let $S(t)$ be a Geometrical Brownian Motion as &lt;a href=&quot;https://www.quantstart.com/articles/Deriving-the-Black-Scholes-Equation&quot; rel=&quot;nofollow noreferrer&quot;&gt;there&lt;/a&gt; and let $M(t) = e^{rt}$ be the price of a share of the money market account with the continuously compounding risk-free interest rate $r$ at time $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A &lt;strong&gt;trading strategy&lt;/strong&gt; is specified by an initial capital $X_0$ and a pair of adapted processes:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$\Delta(S(t),t)$, which denotes the number of shares of &lt;em&gt;stock&lt;/em&gt; held at time $t$ &lt;/li&gt;&#xA;&lt;li&gt;$\Gamma(S(t),t)$, which denotes the number of shares of &lt;em&gt;the money market account&lt;/em&gt; held at time $t$ &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The portfolio value at time $t$ is then: $$X(S(t), t) = \Delta(S(t), t) S(t) + \Gamma(S(t),t)M(t)\tag{0} \label{portfolio_value}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As defined &lt;a href=&quot;http://eu.wiley.com/WileyCDA/Section/id-400799.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;, the trading strategy is &lt;strong&gt;self-financing&lt;/strong&gt; if:&#xA;$$ X(S(T), T) - X_0 = \int_0^T \Delta(S(u),u) dS(u) + \int_0^T\Gamma(S(u),u) dM(u) \tag{1} \label{self_financing}$$&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;implying that the change in value over any interval in portfolio value is entirely due to gains from trade &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;in differential notation $\eqref{self_financing}$ can be re-written as: &#xA;$$ dX(S(t),t) = \Delta(S(t),t) dS(t) + \Gamma(S(t),t)dM(t) \tag{2}\label{self_fin_dif}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if we apply Ito product rule to the right hand side of $\eqref{portfolio_value}$ and compare the result with $\eqref{self_fin_dif}$, we will immediately get what is called &lt;em&gt;continuous-time self-financing condition&lt;/em&gt; &lt;a href=&quot;http://www.springer.com/gp/book/9780387401010&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;: &#xA;$$ S d\Delta + dS d\Delta +Md\Gamma + dM d\Gamma = 0 \tag{3} \label{ctsfc}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Corollary&lt;/strong&gt; If $X$ is a given adapted process, then $X_0 = X(0)$, $\Delta$, $\Gamma = \frac{X - \Delta S}{M}$ where $\Delta$ is the solution of $\eqref{self_fin_dif}$ is a self-financing trading strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let $c(x, t)$ be the price of a call at some time $t$ if the stock price at that time is $S(t) = x$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Form a trading strategy $X_0^* = c(S(0),0)$, $\Delta^*$, $\Gamma^* = \frac{c - \Delta^* S}{M}$ whose portfolio value satisfies $$X^*(S(t),t) = c(S(t),t) \tag{4}\label{port_opt}$$ By corollary it will be a self-financing trading strategy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Substitution of $\eqref{port_opt}$ into $\eqref{self_fin_dif}$ gives us:&#xA;$$ dc = \Delta^* dS + \Gamma^*dM = \Delta^* dS + \frac{(c-\Delta^* S)}{M}dM \tag{5} \label{delta}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Applying Ito-Doeblin formula on the left hand side of $\eqref{delta}$ and using the fact that $dM = rMdt$, we will get:&#xA;$$ c_t dt +c_x dS + \frac{1}{2}c_{xx} \sigma^2 S^2 dt = \Delta^* dS + r(c-\Delta^* S)dt \label{bs} \tag{6} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From $\eqref{bs}$ it follows that $\Delta^*(S(t),t) = c_x \equiv \frac{\partial{c}}{\partial{S}}(S(t),t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And the last point. In my opinion, the calculation of $d(C+\Delta S)$ by &lt;a href=&quot;https://www.quantstart.com/articles/Deriving-the-Black-Scholes-Equation&quot; rel=&quot;nofollow noreferrer&quot;&gt;author here&lt;/a&gt; is wrong and you did it correctly in your question. &lt;/p&gt;&#xA;" OwnerUserId="15154" LastEditorUserId="15154" LastEditDate="2017-05-04T15:44:04.683" LastActivityDate="2017-05-04T15:44:04.683" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34054" PostTypeId="2" ParentId="34044" CreationDate="2017-05-04T14:05:09.630" Score="2" Body="&lt;p&gt;You could have a look at this: &lt;a href=&quot;https://github.com/wilsonfreitas/awesome-quant&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/wilsonfreitas/awesome-quant&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1128" LastActivityDate="2017-05-04T14:05:09.630" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34055" PostTypeId="2" ParentId="34033" CreationDate="2017-05-04T15:09:56.817" Score="1" Body="&lt;p&gt;While this question is basic, I am answering because putting models and/or formulae into practice is a part of quant finance that is not covered extensively on this (or any other) SE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(The below will be from the perspective of a listed equity)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, when/if you find options that are not trading in parity with their underlying the first thing you should do is check for corporate actions.  99.9% percent of the time, that is the root of the &quot;mispricing&quot; -- which is not actually a mispricing at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you get past that, then it would be time to execute the trade and get that arbitrage into you or your firm's account before it disappears.  To do this you could execute a conversion, a reversal or a box spread to lock in the profit.  There are a few other ways but I am keeping this simple.  Any of those three methods executes both sides of the equation in one transaction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Presumably, you already have an account with capital in it so you don't need to worry about selling a bond for financing purposes because your margin agreement with your broker already allows you to borrow capital at will.  You do, however, need to know what you will be paying for the trade.  By that, I mean how much of your accounts capital will be held in margin and therefore cannot be used for other opportunities (opportunity cost) and also what rate you will be paying for the funds you have borrowed (usually LIBOR + [some amount of basis points]).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;SPY at $238.75&#xA;SPY 170505C238 @ $1.00&#xA;SPY 170505P238 @ $0.25&#xA;Margin cost for 1 day = $-0.01&#xA;238.75 - 1.00 + 0.25 + 0.01 = 238.01&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The above example uses a conversion (long stock - short call + long put) to execute both sides at once.  The conversion price higher than the strike by 0.01.  In the real world, this is parity.  At first glance, you may think that you can reverse the trade and capture the 0.01 using a reversal but you can't.  I'll let you figure that out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most times you will find that adding the cost of capital into your equation makes the arbitrage disappear.  These types of trades were much easier to find and execute 15 years ago.  Nowadays, if they exist for more than 1 second that is a long time.&lt;/p&gt;&#xA;" OwnerUserId="26556" LastActivityDate="2017-05-04T15:09:56.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34056" PostTypeId="1" AcceptedAnswerId="34057" CreationDate="2017-05-04T15:22:23.727" Score="0" ViewCount="939" Body="&lt;p&gt;Maybe I should have read the CBOE whitepaper but I never did... Now I cannot find it. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was looking at SPY/SPX just a moment ago and noticed that spot VIX doesn't match with SPY or SPX IV. Why not? I always thought that is what VIX was.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can see current spot VIX at 10.71 at the moment while SPY/SPX IV is at 8.4% &lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT!! this is just further info based on accepted answer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;SPY option chains look like someone thinking the world is gonna end.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/0Pnv4.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/0Pnv4.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26443" LastEditorUserId="26443" LastEditDate="2017-05-04T16:00:36.613" LastActivityDate="2017-05-04T16:00:36.613" Title="How is VIX different from SPY/SPX IV?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;vix&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34057" PostTypeId="2" ParentId="34056" CreationDate="2017-05-04T15:36:10.147" Score="2" Body="&lt;p&gt;What is your definition of SPX IV?  ATM?  ATM vol will be less than VIX.  VIX is calculated by pricing a variance swap on SPX.  A variance swap is priced theoretically using all strikes from 0 to infinity appropriately weighted - the final formula is an integral across all of the strikes.  The VIX calculation uses the discrete strikes that are available in the market with weights that you would get from doing a numerical integration based on the strikes in the market.  I believe the cutoff strikes for the calculation occur on both the put and call side at the strike  where two consecutive strikes have no bid.  Look up variance swaps on wikipedia - at the bottom there is a link to an Emannuel Derman paper that goes over the theory of variance swaps.  Variance swaps levels are nice because it is not strike dependent for the options and gives extra weight to downside moves which is sensible given the terminal distribution of equities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The CBOE paper:&#xA;&lt;a href=&quot;https://www.cboe.com/micro/vix/vixwhite.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.cboe.com/micro/vix/vixwhite.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wikipedia variance swaps:&#xA;&lt;a href=&quot;https://en.wikipedia.org/wiki/Variance_swap&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Variance_swap&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Derman's paper:&#xA;&lt;a href=&quot;http://www.emanuelderman.com/writing/entry/more-than-you-ever-wanted-to-know-about-volatility-swaps-the-journal-of-der&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.emanuelderman.com/writing/entry/more-than-you-ever-wanted-to-know-about-volatility-swaps-the-journal-of-der&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26977" LastEditorUserId="26977" LastEditDate="2017-05-04T15:42:11.573" LastActivityDate="2017-05-04T15:42:11.573" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="34058" PostTypeId="2" ParentId="34038" CreationDate="2017-05-04T15:45:50.373" Score="4" Body="&lt;p&gt;The question above looks somewhat confused. Where's the error term?&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;A recipe for a standard calculation&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;It's customary to work with monthly returns. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;For each portfolio $i$, calculate monthly excess returns $R^x_{i,t} = R_{i,t} - R^f_t$ where $R^f_t$ denotes the 1-month risk free rate.&lt;/li&gt;&#xA;&lt;li&gt;Calculate or download the monthly excess return of the market $R^m_t - R^f_t$&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Eg. go to the &lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;data library section of Ken French's website&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Regress excess returns of portfolio $i$ on excess returns of the market:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;$$ R^x_{i,t} = \alpha_i + \beta_i \left( R^m_t - R^f_t \right) + \epsilon_{i,t} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This regression estimates what Eugene Fama calls the &lt;em&gt;market model&lt;/em&gt;. It is a statistical model. The CAPM in turn is an economics based, asset pricing theory that says the $\alpha_i$ in the market model regression should be zero if you're using excess returns (like I did in this example).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For small values, you can annualize $\alpha_i$ by multiplying by twelve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For calculation of t-stats, make sure to use &lt;a href=&quot;https://en.wikipedia.org/wiki/Heteroscedasticity-consistent_standard_errors&quot; rel=&quot;nofollow noreferrer&quot;&gt;heteroscedasticity robust standard errors&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Some related results&lt;/h3&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The CAPM does not work! It would be a mistake to use the CAPM to forecast expected returns.&lt;/li&gt;&#xA;&lt;li&gt;More sensible asset pricing models might be the Fama-French 3 Factor Model, the Carhart 4 Factor Model, or the Fama-French 5 Factor Model. Basically, you add right hand side variables to the regression that actually do explain cross-sectional variation in average returns.&lt;/li&gt;&#xA;&lt;li&gt;12 months is way too short a period to obtain sensible estimates of alpha. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2018-08-15T16:48:03.567" LastActivityDate="2018-08-15T16:48:03.567" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="34059" PostTypeId="2" ParentId="34027" CreationDate="2017-05-04T15:50:39.143" Score="5" Body="&lt;p&gt;This question has been asked many times and some clarifications appear needed.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;As pointed out in an answer to &lt;a href=&quot;https://quant.stackexchange.com/questions/32171/black-scholes-differential/32187#32187&quot;&gt;this question&lt;/a&gt;, the portfolio &#xA;\begin{align*}&#xA;\Delta_t^1 S_t + \Delta^2_t C,&#xA;\end{align*}&#xA;where $\Delta_t^1 = -\frac{\partial C}{\partial S}$ and $\Delta_t^2 =1$, is, generally, neither self-financing nor locally risk-free.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;To derive the Black-Scholes' PDE, we seek a portfolio $\Delta_t^1 S_t + \Delta^2_t C$ such that it is self-financing &lt;strong&gt;and&lt;/strong&gt; locally risk-free. As is shown in answer to &lt;a href=&quot;https://quant.stackexchange.com/questions/32171/black-scholes-differential/32187#32187&quot;&gt;the above question&lt;/a&gt;, we derived the PDE&#xA;\begin{align*}&#xA;\frac{\partial C}{\partial t} + r S_t \frac{\partial C}{\partial S} + \frac{1}{2}\frac{\partial^2 C}{\partial S^2} \sigma^2S_t^2 -rC = 0. \tag{1}&#xA;\end{align*}&#xA;and the portfolio weights&#xA;\begin{align*}&#xA;\Delta_t^1 = -\frac{\frac{\partial C}{\partial S} B_t}{C_t - \frac{\partial C}&#xA;{\partial S}S}, \quad&#xA;\Delta_t^2 =\frac{B_t}{C_t - \frac{\partial C}{\partial S}S}, \tag{2}&#xA;\end{align*}&#xA;where $B_t=e^{rt}$ is the money-market account value. Note that&#xA;\begin{align*}&#xA;\Delta_t^1 S_t + \Delta^2_t C = B_t. &#xA;\end{align*}&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Based on PDE $(1)$ &lt;strong&gt;and&lt;/strong&gt; the portfolio weights give by $(2)$, it is easy to verify that &#xA;\begin{align*}&#xA;\Delta_t^1 dS_t + \Delta^2_t dC = dB_t.&#xA;\end{align*}&#xA;That is, the portfolio is indeed self-financing and locally risk-free.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Though messy, based on PDE $(1)$ and the portfolio weights give by $(2)$, it is possible to show directly that&#xA;\begin{align*}&#xA;d\left(\Delta_t^1 S_t + \Delta^2_t C \right) = \Delta_t^1 dS_t + \Delta^2_t dC&#xA;\end{align*}&#xA;using Ito's lemma. Here, we assume that the respective partial derivatives, such as $\frac{\partial^2 C}{\partial t\partial S}$ and $\frac{\partial^3 C}{\partial S^3}$, exist.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$$ $$&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Below, we show the self-financing property using Ito's lemma, that is,&#xA;  \begin{align*}&#xA;Sd\Delta_t^1  + C d\Delta_t^2 + d\langle \Delta_t^1,\, S \rangle_t +d\langle \Delta_t^2,\, C \rangle_t  =0.&#xA;\end{align*} &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For weight $\Delta_t^1$, &#xA;\begin{align*}&#xA;\frac{\partial \Delta_t^1}{\partial t} &amp;amp;= -\frac{\left(\frac{\partial^2 C}{\partial t \partial S} B_t + r\frac{\partial C}{\partial S}B_t\right) \left(C_t - \frac{\partial C}{\partial S}S \right) - \left(\frac{\partial C}{\partial t} - \frac{\partial^2 C}{\partial t \partial S}S \right)\frac{\partial C}{\partial S} B_t }{\left(C_t - \frac{\partial C}{\partial S}S\right)^2}\\&#xA;&amp;amp;=-\frac{\frac{\partial^2 C}{\partial t \partial S} B_t C_t + r\frac{\partial C}{\partial S}B_t C_t - r \left(\frac{\partial C}{\partial S} \right)^2B_t S_t - \frac{\partial C}{\partial t}\frac{\partial C}{\partial S} B_t }{\left(C_t - \frac{\partial C}{\partial S}S\right)^2}\\&#xA;&amp;amp;=-\frac{\frac{\partial^2 C}{\partial t \partial S} B_t C_t + \frac{1}{2}\frac{\partial^2 C}{\partial S^2} \frac{\partial C}{\partial S}\sigma^2S_t^2 B_t }{\left(C_t - \frac{\partial C}{\partial S}S\right)^2} \qquad\qquad\qquad\qquad\qquad\qquad \mbox{(From Eqn $(1)$)}\\&#xA;&amp;amp;=-\frac{\frac{\partial^2 C}{\partial t \partial S} B_t C_t^2 + \frac{1}{2}\frac{\partial^2 C}{\partial S^2} \frac{\partial C}{\partial S}\sigma^2S_t^2 B_tC_t - \frac{\partial^2 C}{\partial t \partial S}\frac{\partial C}{\partial S} B_t C_t S - \frac{1}{2}\frac{\partial^2 C}{\partial S^2} \left(\frac{\partial C}{\partial S}\right)^2\sigma^2S_t^3 B_t}{\left(C_t - \frac{\partial C}{\partial S}S\right)^3},\\&#xA;\frac{\partial \Delta_t^1}{\partial S} &amp;amp;=-\frac{\frac{\partial^2 C}{\partial S^2} B_t \left(C_t - \frac{\partial C}{\partial S}S \right) - \left(\frac{\partial C}{\partial S} - \frac{\partial^2 C}{\partial S^2}S  - \frac{\partial C}{\partial S}\right)\frac{\partial C}{\partial S} B_t }{\left(C_t - \frac{\partial C}{\partial S}S\right)^2}\\&#xA;&amp;amp;=-\frac{\frac{\partial^2 C}{\partial S^2} B_t C_t }{\left(C_t - \frac{\partial C}{\partial S}S\right)^2},\\&#xA;\frac{\partial^2 \Delta_t^1}{\partial S^2} &amp;amp;=-\frac{\left(\frac{\partial^3 C}{\partial S^3} B_tC_t + \frac{\partial^2 C}{\partial S^2}\frac{\partial C}{\partial S} B_t \right) \left(C_t - \frac{\partial C}{\partial S}S \right)^2 +2\left(C_t - \frac{\partial C}{\partial S}S\right)  \left(\frac{\partial^2 C}{\partial S^2}\right)^2S B_t C_t }{\left(C_t - \frac{\partial C}{\partial S}S\right)^4}\\&#xA;&amp;amp;=-\frac{\frac{\partial^3 C}{\partial S^3} B_tC_t^2 - \frac{\partial^3 C}{\partial S^3}\frac{\partial C}{\partial S} B_tC_t S + \frac{\partial^2 C}{\partial S^2}\frac{\partial C}{\partial S} B_t C_t - \frac{\partial^2 C}{\partial S^2}\left(\frac{\partial C}{\partial S}\right)^2 B_t S + 2\left(\frac{\partial^2 C}{\partial S^2}\right)^2S B_t C_t }{\left(C_t - \frac{\partial C}{\partial S}S\right)^3}&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For weight $\Delta_t^2$,&#xA;\begin{align*}&#xA;\frac{\partial \Delta_t^2}{\partial t} &amp;amp;= \frac{rB_t \left(C_t - \frac{\partial C}{\partial S}S \right) - \left(\frac{\partial C}{\partial t} - \frac{\partial^2 C}{\partial t \partial S}S \right) B_t }{\left(C_t - \frac{\partial C}{\partial S}S\right)^2}\\&#xA;&amp;amp;=\frac{ rB_t C_t - r\frac{\partial C}{\partial S} B_t S - B_t \frac{\partial C}{\partial t} +\frac{\partial^2 C}{\partial t \partial S}S B_t }{\left(C_t - \frac{\partial C}{\partial S}S\right)^2}\\&#xA;&amp;amp;=\frac{\frac{1}{2}\frac{\partial^2 C}{\partial S^2} \sigma^2S_t^2 B_t +\frac{\partial^2 C}{\partial t \partial S}S B_t }{\left(C_t - \frac{\partial C}{\partial S}S\right)^2}  \qquad\qquad\qquad\qquad\qquad\qquad \mbox{(From Eqn $(1)$)}\\&#xA;&amp;amp;=\frac{\frac{1}{2}\frac{\partial^2 C}{\partial S^2} \sigma^2S_t^2 B_tC_t +\frac{\partial^2 C}{\partial t \partial S}S B_tC_t - \frac{1}{2}\frac{\partial^2 C}{\partial S^2}\frac{\partial C}{\partial S} \sigma^2S_t^3 B_t -\frac{\partial^2 C}{\partial t \partial S}\frac{\partial C}{\partial S}S^2 B_t }{\left(C_t - \frac{\partial C}{\partial S}S\right)^2},\\&#xA;\frac{\partial \Delta_t^2}{\partial S} &amp;amp;=\frac{ - \left(\frac{\partial C}{\partial S} - \frac{\partial^2 C}{\partial S^2}S  - \frac{\partial C}{\partial S}\right) B_t }{\left(C_t - \frac{\partial C}{\partial S}S\right)^2}\\&#xA;&amp;amp;=\frac{\frac{\partial^2 C}{\partial S^2} B_t S }{\left(C_t - \frac{\partial C}{\partial S}S\right)^2},\\&#xA;\frac{\partial^2 \Delta_t^2}{\partial S^2} &amp;amp;=\frac{\left(\frac{\partial^3 C}{\partial S^3} B_t S + \frac{\partial^2 C}{\partial S^2} B_t \right) \left(C_t - \frac{\partial C}{\partial S}S \right)^2 +2\left(C_t - \frac{\partial C}{\partial S}S\right)  \left(\frac{\partial^2 C}{\partial S^2}\right)^2S^2 B_t }{\left(C_t - \frac{\partial C}{\partial S}S\right)^4}\\&#xA;&amp;amp;=\frac{\frac{\partial^3 C}{\partial S^3} B_tC_t S - \frac{\partial^3 C}{\partial S^3}\frac{\partial C}{\partial S} B_t S^2 + \frac{\partial^2 C}{\partial S^2} B_t C_t - \frac{\partial^2 C}{\partial S^2}\frac{\partial C}{\partial S} B_t S + 2\left(\frac{\partial^2 C}{\partial S^2}\right)^2S^2 B_t }{\left(C_t - \frac{\partial C}{\partial S}S\right)^3}.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then&#xA;\begin{align*}&#xA;&amp;amp;\ d\langle \Delta_t^1,\, S \rangle_t +d\langle \Delta_t^2,\, C \rangle_t  \\&#xA;=&amp;amp; \left(-\frac{\frac{\partial^2 C}{\partial S^2} B_t C_t \sigma^2 S^2}{\left(C_t - \frac{\partial C}{\partial S}S\right)^2}  +\frac{\frac{\partial^2 C}{\partial S^2}\frac{\partial C}{\partial S}\sigma^2 B_t S^3 }{\left(C_t - \frac{\partial C}{\partial S}S\right)^2}\right)dt\\&#xA;=&amp;amp; \left(\frac{-\frac{\partial^2 C}{\partial S^2} B_t C_t^2 \sigma^2 S^2 + \frac{\partial^2 C}{\partial S^2}\frac{\partial C}{\partial S} B_t C_t \sigma^2 S^3 + \frac{\partial^2 C}{\partial S^2}\frac{\partial C}{\partial S}\sigma^2 B_t S^3 C_t - \frac{\partial^2 C}{\partial S^2}\left(\frac{\partial C}{\partial S}\right)^2\sigma^2 B_t S^4}{\left(C_t - \frac{\partial C}{\partial S}S\right)^3} \right)dt.&#xA;\end{align*}&#xA;Moreover,&#xA;\begin{align*}&#xA;Sd\Delta_t^1  + C d\Delta_t^2 &amp;amp;= S\left(\frac{\partial \Delta_t^1}{\partial t}dt + \frac{1}{2}\frac{\partial^2 \Delta_t^1}{\partial S^2}\sigma^2 S^2 dt + \frac{\partial \Delta_t^1}{\partial S}dS \right) \\&#xA;&amp;amp;\qquad + C\left(\frac{\partial \Delta_t^2}{\partial t}dt + \frac{1}{2}\frac{\partial^2 \Delta_t^2}{\partial S^2}\sigma^2 S^2 dt + \frac{\partial \Delta_t^2}{\partial S}dS \right)\\&#xA;&amp;amp;=S\left(\frac{\partial \Delta_t^1}{\partial t} + \frac{1}{2}\frac{\partial^2 \Delta_t^1}{\partial S^2}\sigma^2 S^2\right)dt + C\left(\frac{\partial \Delta_t^2}{\partial t} + \frac{1}{2}\frac{\partial^2 \Delta_t^2}{\partial S^2}\sigma^2 S^2 \right)dt.&#xA;\end{align*}&#xA;By combining all terms together, we can show that&#xA;\begin{align*}&#xA;Sd\Delta_t^1  + C d\Delta_t^2 + d\langle \Delta_t^1,\, S \rangle_t +d\langle \Delta_t^2,\, C \rangle_t  =0.&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;d\left(\Delta_t^1 S_t + \Delta_t^2 C_t \right) = \Delta_t^1 dS_t + \Delta_t^2 dC_t,&#xA;\end{align*}&#xA;that is, $\left(\Delta_t^1, \, \Delta_t^2\right)$ constitutes a self-financing strategy.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-05-05T12:47:33.810" LastActivityDate="2017-05-05T12:47:33.810" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34061" PostTypeId="1" CreationDate="2017-05-04T17:45:03.523" Score="1" ViewCount="343" Body="&lt;p&gt;I want to understand the connection between the trinomial tree and the finite difference methods. As far as I understood so far is, if we transform the Black-Scholes-PDE to heat equation, the explicit finite difference methods can be written as $$V_{i-1,j}=\lambda V_{i,j+1}+(1+2\lambda) V_{i,j}+\lambda V_{i,j-1}$$&#xA;, where $i$ represent the time mesh and j the spatial mesh.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is nothing else than a trinomial tree with probability factor $\lambda$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; In finite difference method, I am using a $N\times M$ grid, with $N$ number of time mesh and $M$ number of spatial mesh. However, if I am consider only a trinomial mode, the underlying grid would be a triangle, which is not persist with the grid from finite difference method. What is the connection?&lt;/p&gt;&#xA;" OwnerUserId="25867" LastActivityDate="2017-05-04T17:45:03.523" Title="Trinomial Tree and finite difference methods" Tags="&lt;finite-difference-method&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34062" PostTypeId="2" ParentId="25959" CreationDate="2017-05-04T20:26:48.550" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;What really means broker neutral trading system?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It means that you can have one piece of trading software that executes your trades and routes them to one or more brokers (with whom you have accounts, of course) for settlement.  You don't have to trade through your broker's high or low touch trading desks to execute and settle your trades with them.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Can I use leverage if using broker neutral EMS?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes. When you use a broker neutral front end your orders will still run through the electronic order desk at your prime broker and will still be subject to the margin agreement and trading constraints that you have agreed to with them.  During the setup of your accounts with the software vendor and your prime broker(s), they will handle the back-end connections and configurations so that you don't have to do anything.&lt;/p&gt;&#xA;" OwnerUserId="26556" LastActivityDate="2017-05-04T20:26:48.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34063" PostTypeId="1" AcceptedAnswerId="34066" CreationDate="2017-05-04T20:39:14.953" Score="8" ViewCount="956" Body="&lt;p&gt;This might be a dumb question, but on a purely understanding level it is hard for me to wrap my head around the basic interpretation of some factor models. With the CAPM the interpretation of the $\beta$ coefficient is that this is nondiversifiable risk. Since we cannot diversify this risk away due to covariance with the market, we are getting a reward in terms of return for more risk being taken on. This is my understanding of CAPM and it seems natural(if this interpretation is wrong please feel free to say).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, even though I understand the mathematics(factor models involving state variables other than just market return) line by line and the regressions, I am having trouble understanding the $\beta$ coefficient interpretation on different factors than just market return. Let's say we have a size factor, so $smb$ in the Fama French 3 factor model. How should I interpret the beta coefficient on that? If I extrapolate from the interpretation above I would say that $\beta_{smb}$ is a measure of non-diversifiable risk related to the size of companies in the sample, but this string of words together in a sentence in that order just seems silly to me. I think there must be something I am not understanding about the basic interpretation of factor models.&lt;/p&gt;&#xA;" OwnerUserId="27783" LastActivityDate="2019-10-06T01:39:40.070" Title="Philosophical Question about Factor Models" Tags="&lt;capm&gt;&lt;fama-french&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="34064" PostTypeId="1" CreationDate="2017-05-04T21:53:38.603" Score="2" ViewCount="333" Body="&lt;p&gt;There are a lot of ways one could look at this question.  I usually define skew to mean the slope of the vol smile  in log moneyness space - ie the skew at strike $k_0=log(K_0/F)$ is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{d\sigma}{dk}|_{k=k_0}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However this slope may not be sufficient information on a standalone basis since that slope will be much less impressive if $\sigma(k_0)=50\%$ versus $\sigma(k_0)=10\%$.  Therefore some people might normalize that slope by putting $\sigma(k_0)$ as a denominator to the slope in order to normalize the skew.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other ideas might look at prices of put spreads or call spreads.  For example, we could consider the 25 delta put strike and solve for the strike that make a costless 1xN put spread and consider how far the second leg is from the 25 delta put leg.  Similar things can be done with a risk reversal.  Take one strike and solve for the other leg that makes a costless structure in a risk reversal and compare how far each leg is from the forward - and similarly do that for 1XN costless risk reversal structures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another idea which is similar to the put/call spread approach is to compare the price of a digital option that uses the skew at $k_0$ to the Black-Scholes prices which does not use the skew. So for example if the Black-Scholes price of a digital put is 0.30, but the price with skew is 0.21, then the reason for that -0.09 difference is due to the skew correction factor which account for skew (as defined by the slope of the smile) times the vega.  I actually like this measurement of skew - particularly if we compare the magnitude of the skew correction factor to the price of the Black-Scholes Digital price because it much more directly shows the effect of skew on prices which ultimately are what matter most!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my untested proposal for when skew is large (on the put side) is to use Skew*Vega/N(-d2) as a metric - or in other words (where $C$ is a vanilla call - for vega the same as for a put):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\frac{d\sigma}{dK}\frac{\partial C}{\partial \sigma}}{N(-d2)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The trouble with this methodology is that the vol smile that one fits can have numerical artifacts that can make the slope very different at the same strike given two different fitting algorithms that both fit the data more or less equally well - particularly near where the second derivative of the slope is highest.  So perhaps some weighted average across different strikes with this kind of quantity is the right approach (i.e. some integral of this kind of quantity across all strikes).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I imagine the right answer is the one that can backtest the best for a skew strategy by comparing the historical values of these kinds of skew metrics - I built an engine that can backtest these kinds of ideas if I do a days worth of coding - was curious what others have found about what defines skew to be &quot;high&quot; or &quot;low&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apologies if this kind of question is a little too open ended for this forum.  I am not sure there is truly a &quot;right&quot; answer here, but a discussion on skew is useful in my opinion!&lt;/p&gt;&#xA;" OwnerUserId="26977" LastEditorUserId="19645" LastEditDate="2021-05-05T08:44:17.143" LastActivityDate="2021-05-05T08:44:17.143" Title="When is vol smile skew considered high?" Tags="&lt;volatility-smile&gt;&lt;skew&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34065" PostTypeId="2" ParentId="34046" CreationDate="2017-05-04T22:20:10.490" Score="-2" Body="&lt;p&gt;It is calculated as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sales = &#xA;      REVENUEUSD        (Revenues (USD))&#xA;   minus&#xA;      ROIC              (Retun on Invested Capital)&#xA;   minus&#xA;      ROA               (Return on Average Assets)&#xA;   minus&#xA;      ROE               (Return on Average Equity)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="27784" LastActivityDate="2017-05-04T22:20:10.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34066" PostTypeId="2" ParentId="34063" CreationDate="2017-05-05T04:07:35.647" Score="12" Body="&lt;p&gt;This is actually a rather involved question, and different interpretations exist.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;A narrow, linear algebra based interpretation is that the stochastic discount factor lies in the &lt;a href=&quot;https://en.wikipedia.org/wiki/Linear_span&quot; rel=&quot;nofollow noreferrer&quot;&gt;linear span&lt;/a&gt; of the factors. (Recall that a linear asset pricing function implies the existence of a stochastic discount factor.)&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You can take an expansive, economics based interpretation of the &lt;a href=&quot;https://en.wikipedia.org/wiki/Stochastic_discount_factor&quot; rel=&quot;nofollow noreferrer&quot;&gt;stochastic discount factor&lt;/a&gt; as reflecting the marginal rate of substitution between various states of the world. Hence, in the words of Eugene Fama, factors are &quot;variables of special hedging concern to investors.&quot; This is the macroeconomic risk based interpretation of asset pricing.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Another interpretation is that the expected returns to various factors reflect irrational investors, various psychological anomalies, overreaction or underreaction to information. In theory, variation in expected returns due to macroeconomic risk could be distinguished from variation in expected returns due to investor psychology based upon whether expected returns are determined by &lt;em&gt;when&lt;/em&gt; cash flows occur (i.e. in high or low marginal utility states of the world) or by firm &lt;em&gt;characteristics&lt;/em&gt; (e.g. is it a glamour stock). This theoretical distinction is hard to measure and quite controversial in practice, partially because firms with similar characteristics tend to have returns that covary with each other.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Perhaps it makes sense to quickly review the basics of academic asset pricing theory.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;A linear pricing function implies the existence of a stochastic discount factor&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Let &lt;span class=&quot;math-container&quot;&gt;$X$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$Y$&lt;/span&gt; random variables denoting payoffs in the future.&lt;/li&gt;&#xA;&lt;li&gt;Let &lt;span class=&quot;math-container&quot;&gt;$p(x)$&lt;/span&gt; be a function returning the current price of a future payoff.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;A reasonable assumption is that the pricing function &lt;span class=&quot;math-container&quot;&gt;$p(x)$&lt;/span&gt; is a linear functional:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ p(\alpha X + \beta Y) = \alpha p(X) + \beta p(y)$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Note that with various psychology, behavioral effects, the pricing function need not be linear.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the &lt;a href=&quot;https://en.wikipedia.org/wiki/Riesz_representation_theorem&quot; rel=&quot;nofollow noreferrer&quot;&gt;Riesz Representation Theorem&lt;/a&gt; you get that &lt;span class=&quot;math-container&quot;&gt;$p(X)$&lt;/span&gt; can be written as the inner product with some stochastic discount factor &lt;span class=&quot;math-container&quot;&gt;$S$&lt;/span&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ p(X) = \operatorname{E}[SX]$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;The SDF equation can be written as a 1 factor model&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;A return is a payoff with the price of 1. If there is a risk free rate &lt;span class=&quot;math-container&quot;&gt;$R^f$&lt;/span&gt; then &lt;span class=&quot;math-container&quot;&gt;$1 = \operatorname{E}[S R^f] = \operatorname{E}[S] R^f$&lt;/span&gt; since the payoff of the risk free rate is known before hand. So for an arbitrary return:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ 1 = \operatorname{E}[S R]$$&lt;/span&gt;&#xA;Rewrite as a covariance:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ 1 = \operatorname{Cov}(S, R) + \operatorname{E}[S]\operatorname{E}[R]$$&lt;/span&gt;&#xA;Divide by &lt;span class=&quot;math-container&quot;&gt;$\operatorname{E}[S]$&lt;/span&gt;, apply &lt;span class=&quot;math-container&quot;&gt;$\operatorname{E}[S] = 1/R^f$&lt;/span&gt;, and after some more algebra:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \operatorname{E}[R] - R^f = -\frac{\operatorname{Cov}(S, R)}{\operatorname{Var}(S)} \frac{\operatorname{Var}(S)}{\operatorname{E}[S]}$$&lt;/span&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ \operatorname{E}[R] - R^f = \beta_{R, S} \lambda_S$$&lt;/span&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;span class=&quot;math-container&quot;&gt;$\beta_{R,S}$&lt;/span&gt; is a regression beta of the returns on the discount factor and &lt;span class=&quot;math-container&quot;&gt;$\lambda_S$&lt;/span&gt; is the factor premium.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can further show that for a multi-factor model to work, the stochastic discount factor &lt;span class=&quot;math-container&quot;&gt;$S$&lt;/span&gt; must be a linear function of the factors. (There is a close relation here too to more classic notions in finance of the mean-variance frontier.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The whole game of academic asset pricing is to figure out what the stochastic discount factor &lt;span class=&quot;math-container&quot;&gt;$S$&lt;/span&gt; is! It's debatable how much progress has been made. (Or if behavioral effects dominate, whether it will ever be successful.) It's trivial to construct an &lt;span class=&quot;math-container&quot;&gt;$S$&lt;/span&gt; that overfits the data and perfectly predicts the past. The challenge is explaining variation in returns going forward.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Economics and SDF theory&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;In some sense, this is where the bold statements start getting made.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a simple economic model with additive separable utility, you get that the stochastic discount factor reflects the ratio of marginal utilities between the various (possible) states of the world.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, this is getting too long...&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Concluding Thoughts&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;A perhaps obvious point is that none of these factor models work perfectly. It's not hard to find test assets / portfolios that lead to overwhelmingly statistical rejection of most any asset pricing model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To the extent factor models do work, you can interpret the factors in a way that leans more or less on economics. In pure linear algebra terms, the SDF may lie in the linear span of the factors. There's a growing, recent literature around identifying factors by using &lt;a href=&quot;https://en.wikipedia.org/wiki/Principal_component_analysis&quot; rel=&quot;nofollow noreferrer&quot;&gt;principal components analysis&lt;/a&gt;, the underlying idea being that the &lt;a href=&quot;https://en.wikipedia.org/wiki/Basis_(linear_algebra)&quot; rel=&quot;nofollow noreferrer&quot;&gt;basis&lt;/a&gt; that explains the most variance in returns may be a basis that explains cross-sectional variation in expected returns (this is not obvious / automatically true).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Applying more economics and taking the risk based interpretation, the factors may proxy for variables of hedging concern for investors. (Another name for the stochastic discount factor is a marginal rate of substitution process.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Fama-French factors (and several others) are based upon long-short portfolios formed on firm characteristics. An interpretation that flows from the factors' method of construction is that firms sorted by certain characteristics (eg. high book to market ratio) tend to do well or poorly at the same time. Thus, you can even take a behavioral finance view/twist that characteristics matter rather than risk, but that risk based model still does ok because firms with similar characteristics move together.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cochrane, John, &lt;em&gt;Asset Pricing: Revised Edition&lt;/em&gt;, 2005, Princeton University Press&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Duffie, Darrel, &lt;em&gt;Dynamic Asset Pricing Theory&lt;/em&gt;, 1992, Princeton University Press&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2019-10-06T01:39:40.070" LastActivityDate="2019-10-06T01:39:40.070" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="34069" PostTypeId="1" AcceptedAnswerId="34070" CreationDate="2017-05-05T12:58:24.993" Score="1" ViewCount="494" Body="&lt;p&gt;I've heard that quanto options are not sensitive to the FX...but when i draw the graph of the FX delta of the put  i find a positive  value for all K. For very deep ITM quanto put the FX delta is about 14.&#xA;My 2 cents about this comes from the quanto adjustment. If X increases then S decreases (my correl is neg). Thus my quanto put is more valuable. So the delta FX is pos. &#xA;So are quanto puts really sensitive to FX ?&#xA;Tx&lt;/p&gt;&#xA;" OwnerUserId="15738" LastActivityDate="2017-05-05T13:07:58.943" Title="Delta FX of a quanto put" Tags="&lt;trading&gt;&lt;delta&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34070" PostTypeId="2" ParentId="34069" CreationDate="2017-05-05T13:07:58.943" Score="3" Body="&lt;p&gt;For a quanto option, there is a quanto adjustment which involves the volatility functions of the option underlying asset and the FX rate. Since the volatility functions may depend on the spot levels, in particular, for local volatility functions, then, the quanto option value depends on the spot levels of both the underlying and the FX rate. &lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2017-05-05T13:07:58.943" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34071" PostTypeId="1" CreationDate="2017-05-05T14:31:04.553" Score="4" ViewCount="488" Body="&lt;p&gt;What I would like to discuss is the following. I don't think that this is a pure duplicate, so I would be happy about comments:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On one hand it is reasonable to model log-returns as Gaussian:&#xA;$$&#xA;\log(S_{t+\Delta}/{S_t}) = \sigma B_{\Delta t}    \tag{1}&#xA;$$&#xA;with a Gaussian random variable $B_{\Delta t} \sim N(0,\Delta t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand as e.g. in the calculations of the equivalent Gaussian volatility &lt;a href=&quot;https://quant.stackexchange.com/questions/26125/how-is-the-formula-for-the-vev-var-equivalent-volatility-in-the-priip-document&quot;&gt;for PRIIPS&lt;/a&gt; we model&#xA;$$&#xA;S_{t+\Delta} = S_t \exp \left( - \sigma^2/2 \Delta + \sigma \left( B_{t+ \Delta t} - B_{t } \right) \right),&#xA;$$&#xA;and thus&#xA;$$&#xA;\log(S_{t+\Delta}/{S_t}) =  - \sigma^2/2 \Delta + \sigma \left( B_{t+ \Delta t} - B_{t } \right), \tag{2}&#xA;$$&#xA;which leads to a non-centered Gaussian.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that $(2)$ is the natural model if we want to use the SDE&#xA;$$&#xA;dS_t = \sigma S_t dB_t,&#xA;$$&#xA;whose discretized version is&#xA;$$&#xA;S_{t+ \Delta t} - S_{t } \approx \sigma S_t \left( B_{t+ \Delta t} - B_{t } \right),&#xA;$$&#xA;which can be reformulated as &#xA;$$&#xA;\frac{S_{t+ \Delta t} - S_{t }}{S_t} \approx \sigma \left( B_{t+ \Delta t} - B_{t } \right).&#xA;$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how does all this fit together? In risk management we often assume that log-returns are Gaussian $(1)$ and the regulator of PRIIPS assumes that arithmetic returns are approximately Gaussian? How can we interpret the correction term intuitively in $(2)$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: Hopefully doing the right maths:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In setting (A) which gives us equation (1) we have the following stochastic model:&#xA;$$&#xA;S_{t + \Delta t} = S_t \exp \left( \sigma (B_{t + \Delta t} - B_t)  \right)&#xA;$$&#xA;then for the log return $R_t$ we have&#xA;$$&#xA;R_t = \log\left(S_{t + \Delta t}/S_t \right) = \sigma (B_{t + \Delta t} - B_t).&#xA;$$&#xA;Then $R_t$ has a Gaussian distribution with expectation $0$ and variance $\sigma^2 \Delta t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Setting (B):&#xA;$$&#xA;S_{t + \Delta} = S_t \exp \left( -\frac{\sigma^2}{2} \Delta t + \sigma (B_{t + \Delta t} - B_t)  \right)&#xA;$$&#xA;and get for&#xA;$\log(S_{t + \Delta}/S_t)$ again something Gaussian with expectation $-\frac{\sigma^2}{2} \Delta t$ and variance $\sigma^2 \Delta t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For $\Delta t$ small (one or just a couple of days) the difference is negligible but for longer terms (e.g. recommended holding periods) we have to model many $\Delta t$ steps leading to a larger term there. So there is a difference on the long run.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2017-05-11T11:33:41.780" LastActivityDate="2017-05-11T11:33:41.780" Title="Modelling returns in the real world measure with or without drift" Tags="&lt;brownian-motion&gt;&lt;log-returns&gt;&lt;regulatory-formula&gt;" AnswerCount="1" CommentCount="13" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34072" PostTypeId="2" ParentId="34063" CreationDate="2017-05-05T14:40:44.347" Score="2" Body="&lt;p&gt;For a mathematical interpretation see my answer here: &lt;a href=&quot;https://quant.stackexchange.com/a/31456/12&quot;&gt;https://quant.stackexchange.com/a/31456/12&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The classic &quot;philosophical&quot; interpretation is that they are additional risk factors (like $\beta$) for which the investor will be compensated, e.g. small companies are riskier than large companies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another interpretation is that they represent anomalies which can be used by savvy investors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For some more details on both interpretations see my answer here: &lt;a href=&quot;https://quant.stackexchange.com/a/15959/12&quot;&gt;https://quant.stackexchange.com/a/15959/12&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You decide which interpretation suits you best.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2017-11-04T19:36:07.757" LastActivityDate="2017-11-04T19:36:07.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34075" PostTypeId="1" CreationDate="2017-05-05T17:36:50.583" Score="2" ViewCount="350" Body="&lt;p&gt;When looking at the discounted pay-off formulas of a vanilla caplet and a vanilla floorlet&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{\Delta\tau}{1+r_k\Delta\tau}\max(r_k-r_{cap},0)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{\Delta\tau}{1+r_k\Delta\tau}\max(r_{floor}-r_k,0)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_{cap/floor} = $ cap/floor rate between $t_k$ and $t_{k+1}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_{k} = $ realised interest rate between $t_k$ and $t_{k+1}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\tau = $ reset period&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then my intuition tells me that $N(d_2)$ could possibly be the Black risk-neutral exercise probability of the caplet.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Is this assumption correct?&lt;/li&gt;&#xA;&lt;li&gt;If it is, what would be the correct risk-neutral probability of the floorlet? My guess is that it wouldn't be $N(-d_2)$, but I'm not sure.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="27797" LastEditorUserId="26284" LastEditDate="2020-04-20T19:39:47.487" LastActivityDate="2021-05-15T23:02:10.483" Title="Exercise Probabilities Vanilla Cap/Floor" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;derivatives&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="34076" PostTypeId="2" ParentId="34075" CreationDate="2017-05-05T18:23:31.917" Score="0" Body="&lt;p&gt;Seems like you are asking for the risk neutral probability that a digital option on the respective rates will be ITM at expiration.  Also, since you say you are assuming Black's model, you are implicitly assuming that rates can never go below zero - which we know to be wrong of course.  As such, your intuition that the probability of the caplet exercising is indeed $N(d_2)$.  Also, the probability of the floorlet exercising is $N(-d_2)$ just like any other digital put.  Unless I am missing something?&lt;/p&gt;&#xA;" OwnerUserId="26977" LastEditorUserId="26977" LastEditDate="2017-05-05T18:31:25.917" LastActivityDate="2017-05-05T18:31:25.917" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="34079" PostTypeId="1" AcceptedAnswerId="34081" CreationDate="2017-05-05T19:08:36.473" Score="4" ViewCount="1114" Body="&lt;p&gt;While pulling some reports from Bloomberg today I came across the volatility surface for NYSE: ONDK, set for an earnings call next Monday. From what I've seen before (not much, 1 month on the job and counting) volatility should trend upwards with longer terms, and present in the form of a &quot;smile&quot; when you plot volatility against moneyness. The surface for ONDK had volatility dropping down with term, and presented more of a volatility frown than smile. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What exactly does it mean when volatility's highest at close-to-the-money options? And what could drive decreasing volatility with term?&lt;/p&gt;&#xA;" OwnerUserId="27801" LastActivityDate="2017-05-05T19:33:02.867" Title="What interpretation can I derive from an inverted volatility surface?" Tags="&lt;volatility-smile&gt;&lt;volatility-surface&gt;" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="34081" PostTypeId="2" ParentId="34079" CreationDate="2017-05-05T19:26:44.030" Score="2" Body="&lt;p&gt;I just checked this one.  I saw the picture you are referring to and I think the frown is not real.  Much of it looks like noise created by wide bid ask spreads and extremely high implied vols.  The data here is very poor and the options are spread very far apart.  The underlying is $4.60 and the options are struck a dollar apart.  That would be like SPX having strikes every 500 points more or less.  So the smiles only have 0-2 useful data points in the front months and then BBG's algorithms created a smile off of those points.  I know very few people that are detail oriented enough to make good smiles with such sparse data.  I am probably the only person I ever met anal enough to try to do this right though I am sure there are others I have not met.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I like to fit the various smiles in a very specific order.  I assign a metric to each expiration that measures how much &quot;information&quot; there is in the smile.  For that metric, I consider the range of useful strikes in delta space, the number of strikes available to me in that range, and how tight the bid ask spreads are roughly on average.  Then I first fit the smile that has the most &quot;information&quot; according to my metric.  Then given the last smile that I fit in the surface, I inductively fit the next smile while trying to maintain forward volatilities between this smile and already fit smiles that are sensible and without arbitrage.  By enforcing no arbitrage, we actually get smoother term structures cross sections as we vary the strike by moneyness - that to me is very valuable even though I don't price too many exotics.  The smoothness of these term structure cross sections makes the term structure of my parameters fitting each smile much smoother.  Smoothness of parameters make the parameters meaningful and useful for other things.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My point - doing this kind of detailed work would give you the smiles you are more familiar with.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another potential issue - and this is a big one - I see the short interest in BBG says that 12.52% of the float is currently short.  This means that the cost of borrow is likely to be high and BBG is probably calculating vols under the assumption that borrow cost is not unusual.  A very expensive borrow cost will change the forwards - think of the borrow cost as a continuous dividend yield.  This can distort vols a lot, but I cannot confirm how expensive this borrow is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as term structure vols go, usually term structures of vols are increasing as you say, but when there is event risk (like earnings) the shorter dated vols might be higher than the longer dated vols.  Also, during periods of extreme stress, the vol term structures tend to be decreasing due to the mean reverting nature of vol.  In other words, usually the period of stress is short lived so the short dated vol should be very high - and the longer dated vol starting a few months down the road should revert to more normal level - i.e. the forward vols starting a few months out are much lower.&lt;/p&gt;&#xA;" OwnerUserId="26977" LastEditorUserId="26977" LastEditDate="2017-05-05T19:33:02.867" LastActivityDate="2017-05-05T19:33:02.867" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34088" PostTypeId="1" CreationDate="2017-05-06T14:02:01.360" Score="0" ViewCount="43" Body="&lt;p&gt;For a longevity Bond, how is the cash flow and how can I replicate it? I am confused with the cash flow. An Investor pays a principal and receive coupon payment depends on the longevity of certain selected population? So if the selected population lives longer, one would expect a higher coupon payment? How about the principal? Is it similar to CAT bond that the principal is then forgiven?&lt;/p&gt;&#xA;" OwnerUserId="25867" LastActivityDate="2017-05-06T14:02:01.360" Title="Cash flow of longevity Bonds" Tags="&lt;bond&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34089" PostTypeId="1" AcceptedAnswerId="34103" CreationDate="2017-05-06T16:00:14.220" Score="7" ViewCount="1149" Body="&lt;p&gt;For underlying asset&#xA;$$d S = r S dt + \sigma S d W + (J-1)Sd N$$&#xA;here $W$ is a Brownian motion, $N(t)$ is Poisson process with intensity $\lambda.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose $J$ is log-normal with standard deviation $\sigma_J,$ denote&#xA;$$k = E[J-1]$$&#xA;then the value of vanilla call is&#xA;$$\sum\limits_{n=0}^{\infty}\dfrac{(\lambda'\tau)^n}{n!}e^{-\lambda'\tau}V_{BS}(S,t;\sigma_n,r_n)$$&#xA;Here&#xA;$$\lambda' = \lambda(1+k),\ \tau =T - t$$&#xA;$$\sigma^2_n = \sigma^2 + \dfrac{n\sigma_J^2}{\tau},\ &#xA; r_n=r-\lambda k+\dfrac{n\log(1+k)}{\tau}$$&#xA;and $V_{BS}$ is Black-Scholes value of a call without jumps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The result seems to be the weighted mean of vanilla calls, but how to deduce this conclusion? Or is there any reference?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose $\log J \sim N(\mu,\sigma^2_J)$ and $Z$ is standard normal, then we have&#xA;\begin{eqnarray*}&#xA;\log S_T &amp;amp;=&amp;amp; \log S_0 + (r - \dfrac{1}{2}\sigma^2)T + \sigma\sqrt{T} Z + N(T)\log(J)\\&#xA;&amp;amp;\sim&amp;amp; \log S_0 + \dfrac{1}{2}N(T)\sigma_J^2  +N(T)\mu + (r - \dfrac{1}{2}\hat{\sigma}^2)T + \hat{\sigma}\sqrt{T}Z\\&#xA;&amp;amp;=&amp;amp; \log \hat{S}_0 + (r - \dfrac{1}{2}\hat{\sigma}^2)T + \hat{\sigma}\sqrt{T} Z &#xA;\end{eqnarray*}&#xA;we omit the representations of $\hat{S}_0,\ \hat{\sigma}.$ So I think the price at $0$ should be&#xA;$$\sum\limits_{n=0}^{\infty}\dfrac{(\lambda T)^n}{n!}e^{-\lambda T}V_{BS}(\hat{S}_0,0;\hat{\sigma}_n,r)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why the author change the risk free rate  $r_n$ and intensity $\lambda',$ does he change the measure for both Brownian motion and Poisson process?&lt;/p&gt;&#xA;" OwnerUserId="26165" LastEditorUserId="26165" LastEditDate="2017-05-07T14:29:28.630" LastActivityDate="2017-05-07T18:14:11.683" Title="Black-Scholes formula for Poisson jumps" Tags="&lt;black-scholes&gt;&lt;derivatives&gt;&lt;poisson&gt;&lt;jump-diffusion&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="34090" PostTypeId="2" ParentId="33520" CreationDate="2017-05-06T16:30:21.380" Score="2" Body="&lt;p&gt;Your question shows that you are beginner in time series analysis. Welcome!&lt;/p&gt;&#xA;&lt;h1&gt;Long Answer to your question&lt;/h1&gt;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Unevenly_spaced_time_series&quot; rel=&quot;nofollow noreferrer&quot;&gt;A common approach to analyzing unevenly spaced time series is to transform the data into equally spaced observations using some form of interpolation - most often linear - and then to apply existing methods for equally spaced data. However, transforming data in such a way can introduce a number of significant and hard to quantify biases especially if the spacing of observations is &lt;strong&gt;highly irregular&lt;/strong&gt;.&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h1&gt;Short Answer&lt;/h1&gt;&#xA;&lt;p&gt;It depends&lt;/p&gt;&#xA;&lt;h1&gt;Where you will find your answers to all of your questions&lt;/h1&gt;&#xA;&lt;p&gt;First start here:&lt;/p&gt;&#xA;&lt;p&gt;&lt;a href=&quot;http://rafalab.github.io/pages/754/section-10.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Chapter 10 Introduction to Time Series Analysis&lt;/a&gt;&#xA;&lt;a href=&quot;http://www.stat.berkeley.edu/%7Ebartlett/courses/153-fall2010/lectures/1.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Introduction to Time Series Analysis. Lecture 1&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Then read these papers as well as what others have shared&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www-bcf.usc.edu/%7Eliu32/paper/sdm2012_irr.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Granger Causality Analysis in Irregular Time Series&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://eckner.com/papers/unevenly_spaced_time_series_analysis.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;A Framework for the Analysis of Unevenly Spaced Time Series Data&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h1&gt;Please make sure you understand what you are asking otherwise others will not be so nice.&lt;/h1&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;This means googleing and putting in some effort.Effort is not easy, but part of struggle is important and called 'learning.'&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;We are here to help you when you show us your struggles, so that we can  help you with little to no effort =)&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;&lt;strong&gt;Do not be discouraged, ask questions, but make sure you &lt;em&gt;google&lt;/em&gt; first.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Welcome to QuantFinance Stack Exchange!&lt;/p&gt;&#xA;" OwnerUserId="7954" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2017-05-07T11:50:10.213" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34091" PostTypeId="1" AcceptedAnswerId="34092" CreationDate="2017-05-06T18:24:38.017" Score="5" ViewCount="4343" Body="&lt;p&gt;According to wikipedia, CAPM model is described by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E(R_{i})=R_{f}+\beta _{{i}}(E(R_{m})-R_{f})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And according to website such as &lt;a href=&quot;http://investexcel.net/jensens-alpha-excel/&quot; rel=&quot;noreferrer&quot;&gt;http://investexcel.net/jensens-alpha-excel/&lt;/a&gt;, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\alpha = E(R_{i}) - R_{f}-\beta _{{i}}(E(R_{m})-R_{f}),\,\,\,\, \beta = \frac{Cov(R_i,R_m)}{R_m}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E(R_i)$ and $E(R_m)$ are just averages of the times series of $R_i$ and $R_m$. Then alpha can be calculated by direct plug-in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And my question is as follow: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since we could also write the CAPM as $R_i-R_f = \alpha_i  + \beta_i(R_m-R_f)+ \epsilon$, could we just run the OLS regression and get the alpha as part of the coefficients that way? If the answer is yes, is there a relationship between the two methods of calculating alpha and do we prefer one to another? And theoretically, how can one make money based on the alpha? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am sorry if the questions sound silly. Thank you for advance. &lt;/p&gt;&#xA;" OwnerUserId="27823" LastActivityDate="2020-04-30T01:42:43.960" Title="Calculating alpha and its meaning" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;regression&gt;&lt;capm&gt;&lt;asset-allocation&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="34092" PostTypeId="2" ParentId="34091" CreationDate="2017-05-06T19:19:10.683" Score="11" Body="&lt;p&gt;Alphas from a time-series regression are error terms in the cross-sectional, linear relationship between expected returns and factor betas. If a factor model were correct those error terms (the alphas) would be zero.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Discussion&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;A carefully written version of a standard time-series regression of returns in excess of the risk free rate on market excess returns would be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R_{i,t}-R^f_t = \alpha_i  + \beta_i(R^m_t-R^f_t)+ \epsilon_{i,t}$$&#xA;This equation is &lt;strong&gt;NOT&lt;/strong&gt; the CAPM. The CAPM is an economic theory that implies that the $\alpha_i$ for any security/portfolio $i$ in the above regression would be zero. Why is this the case?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The CAPM says that expected excess returns $\operatorname{E}[R_i - R^f]$ increase linearly in the regression beta $\beta_i$ of excess returns on market excess returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is a graph of what Prof. John Cochrane likes to call the cross-sectional implications of the time series regression. The intercepts $\alpha_i$ in time-series regressions are residuals in the cross-sectional regression.&#xA;&lt;a href=&quot;https://i.stack.imgur.com/2o9RZ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/2o9RZ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each blue circle represents a different security/portfolio. For each return series $i$, the estimated $\alpha_i$ from a time series regression is the vertical distance to the black line. If the CAPM were true, all those $\alpha_i$ would be zero and every security would be on that line.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;What actually happens? Why does the CAPM not work?&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The test assets in the figure below are the &lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;25 Fama-French book to market and size portfolios&lt;/a&gt;. If the CAPM were true, each blue circle should lie on the black line, but that's not what happens!&#xA;&lt;a href=&quot;https://i.stack.imgur.com/JJJqi.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/JJJqi.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The red line shows the estimated cross-sectional relationship between expected returns and market beta. If anything, the relationship goes in completely the wrong direction. (The last figure is an old one I made for a prior class.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The intercept term $\alpha$ in a regression of excess returns on other excess returns (interpreted as risk factors) gives you an estimate of average returns that cannot be explained by those factors. Graphically, it's the vertical distance from the black line in the above graphs.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;And a review of &lt;a href=&quot;https://en.wikipedia.org/wiki/Simple_linear_regression&quot; rel=&quot;nofollow noreferrer&quot;&gt;linear regression with 1 right hand side variable&lt;/a&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Let's say you run the following regression:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ y_i = a + b x_i + \epsilon_i$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your estimate of $b$ will be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \hat{b} = \frac{\hat{\operatorname{Cov}}(y,x)}{\hat{\operatorname{Var}}(x)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $\hat{\operatorname{Cov}}(y,x)$ is the sample covariance between $y$ and $x$ and $\hat{\operatorname{Var}}(x)$ is the sample variance of $x$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So basically, your &quot;two methods&quot; of calculation are exactly the same thing.&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2018-08-22T15:29:30.327" LastActivityDate="2018-08-22T15:29:30.327" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="34093" PostTypeId="1" CreationDate="2017-05-06T19:35:19.973" Score="0" ViewCount="50" Body="&lt;p&gt;I read Flash Boys when it first came out. If memory serves correctly it said US exchanges are required to forward received orders to another exchange if it has better prices, to achieve the best national bid/offer (due to RegNMS).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This process (apparently) allowed HFTs to &quot;front&quot; the orders and get to the second exchange before the order.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a few questions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-How would the HFT firm even see the order, if the first exchange didn't execute it locally and simply forwarded it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-If exchanges forward orders to other exchanges with a better price, isn't this removing some of the need for smart order routing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-What are the best resources for understanding US equity exchange architecture, across the various exchanges?&lt;/p&gt;&#xA;" OwnerUserId="5168" LastActivityDate="2017-05-06T19:35:19.973" Title="RegNMS, National best bid/offer and Smart Order Routing" Tags="&lt;equities&gt;&lt;high-frequency&gt;&lt;algorithmic-trading&gt;&lt;electronic-trading&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34094" PostTypeId="2" ParentId="33520" CreationDate="2017-05-06T21:24:28.233" Score="0" Body="&lt;p&gt;Something fairly standard to do is to work with the returns of portfolios constructed on individual firm characteristics rather than the firms themselves. Some basic problems working directly with firms:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;As you discussed, firms come and go from the sample.&lt;/li&gt;&#xA;&lt;li&gt;As several have mentioned in the comments, firms can significantly change. Apple in 2005 was a computer hardware company. In 2015, Apple was a mobile phone company, its revenues dominated by iPhone. Shouldn't we expect the covariance properties to be &lt;em&gt;significantly&lt;/em&gt; different!?&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;If you only use firms where you have data for all years, you are conditioning inclusion in your sample on not delisting, and you may render your estimate of expected returns upwards biased and inconsistent!&lt;/strong&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If someone wrote, &quot;My sample is constructed of all firms which did not go bankrupt or get acquired&quot; or &quot;My sample is constructed of all firms which eventually made it into the S&amp;amp;P500,&quot; do you think those firms had above average returns? Of course they did!&lt;/li&gt;&#xA;&lt;li&gt;In general in finance, you can make &lt;strong&gt;huge&lt;/strong&gt; mistakes by using $t+1$ information at time $t$.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If we're willing to do simple, 1980s style finance, a sensible method is to construct yearly rebalanced portfolios based upon firm characteristics known at the time (or several months previously to be safe). The idea is that the &lt;em&gt;portfolio returns&lt;/em&gt; will be more stable over time in terms of their statistical properties than individual companies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As @Alex27629 mentions, you probably can do most of your analysis using only data you have for each company. I'd expect you get defensible results for the purposes of your project.&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-05-06T21:33:33.457" LastActivityDate="2017-05-06T21:33:33.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34095" PostTypeId="1" AcceptedAnswerId="34096" CreationDate="2017-05-07T00:03:06.400" Score="0" ViewCount="599" Body="&lt;p&gt;For the valuation of a bond, is the bid ask spread somehow reflected in the yield curve? Considering zero coupon bond, one would expect to have an bid price and ask price and therefore if I am calculating the zero rate, I will have two value and this results in two different zero curves. How is it about yield curve? How would the liquidity affect the yield curve?&lt;/p&gt;&#xA;" OwnerUserId="25867" LastActivityDate="2017-05-07T00:41:25.990" Title="Yield curve and bid ask spread" Tags="&lt;yield-curve&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34096" PostTypeId="2" ParentId="34095" CreationDate="2017-05-07T00:41:25.990" Score="1" Body="&lt;p&gt;For a bond, or any security for that matter, the price you pay (or receive)is the price you get(or receive).  The spread is only good for knowing where you can buy (or sell) at any given moment in time.  Your &quot;price&quot; is where you execute your order.  There is (almost) never a singular price that you can consider to be &quot;the&quot; price.  It depends if you are buying or selling.  I'm sure this sounds confusing...welcome to reality&lt;/p&gt;&#xA;" OwnerUserId="26556" LastActivityDate="2017-05-07T00:41:25.990" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34097" PostTypeId="1" AcceptedAnswerId="34098" CreationDate="2017-05-07T01:57:03.773" Score="3" ViewCount="167" Body="&lt;p&gt;Assuming the market is perfect liquid, the bond price can be replicated and is related as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sum_{t=0}^{N}c_ne^{-Y(t_n-t)}=\sum_{t=0}^{N}c_nP_{t_n}=\sum_{t=0}^{N}c_ne^{-Y_{t,t_n}(t_n-t)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The $P_{t_n}$ denotes the ask price of a zero coupon bond at maturity $t_n$ and $c_n$ corresponding payment of the bond at time $t_n$. $Y$ is the yield to maturity and $Y_{t,t_n}$ the yield curve. The idea is just to replicate the payment of bond by zero coupon bond at different maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; Why does this equation holds only under assumption of perfect liquid market? What would change if we are in a illiquid market?&lt;/p&gt;&#xA;" OwnerUserId="25867" LastEditorUserId="21023" LastEditDate="2018-05-27T05:43:34.687" LastActivityDate="2018-05-27T05:43:34.687" Title="Bond Valuation and liquidity" Tags="&lt;fixed-income&gt;&lt;liquidity&gt;&lt;value-investing&gt;&lt;relative-value&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34098" PostTypeId="2" ParentId="34097" CreationDate="2017-05-07T02:20:12.350" Score="4" Body="&lt;p&gt;In practice, this equation won't even hold for the vast majority of bonds in the US Treasury market, which is the most liquid government bond market. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The chart below shows the spreads of US Treasuries relative to a fitted curve (more specifically, a model price is calculated for each bond by discounting its cash flows using a theoretical zero coupon curve. The difference between the model yield and the market quoted yield is shown in the chart):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/9XIDl.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/9XIDl.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see, nearly all Treasuries trade at a small spread to the theoretical yield curve. These spreads change over time, providing a lot of relative value trading opportunities. Relevant to your question, these spreads don't always exist because of liquidity reasons. For example, some bonds might trade rich relative to their theoretical values, because they're trading special in the repo market (&quot;financing advantage&quot;). In fact, a bond might be expensive relative to the theoretical curve precisely because it's too liquid and everyone's buying it (&quot;liquidity advantage&quot;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;During times of stress, these spreads can become much larger. A similar chart for December 15, 2008 is shown below. Note the range on the y-axis:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/nxvva.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/nxvva.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some bonds, such as 10-year on-the-runs and the 15-year sector, traded very rich (at extremely negative spread), because of high demand from investors looking for safe and liquid instruments. By contrast, old 30-year that have rolled into the &amp;lt;10-year sector traded at very cheap levels (very positive spread), because people were dumping these papers and moving into more liquid instruments or cash.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2017-05-07T02:32:29.853" LastActivityDate="2017-05-07T02:32:29.853" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="34101" PostTypeId="1" AcceptedAnswerId="34105" CreationDate="2017-05-07T15:54:18.023" Score="15" ViewCount="56768" Body="&lt;p&gt;Seem to be confused over the difference between PV01 of a bond and DV01 of the bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PV01, also known as the basis point value (BPV), specifies how much&#xA;the price of an  instrument changes if the interest rate changes by 1&#xA;basis point (0.01%).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;DV01 is the dollar value of one basis point change in the instrument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is my explanation correct?&lt;/p&gt;&#xA;" OwnerUserId="5839" LastActivityDate="2020-11-17T09:57:10.013" Title="What's the difference between PV01 and DV01 of a bond?" Tags="&lt;interest-rates&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="34102" PostTypeId="1" CreationDate="2017-05-07T16:35:18.427" Score="2" ViewCount="79" Body="&lt;p&gt;I recently read &lt;a href=&quot;https://arxiv.org/abs/1212.2129&quot; rel=&quot;nofollow noreferrer&quot;&gt;Online Portfolio Selection: A Survey&lt;/a&gt; by Li &amp;amp; Hoi. I rarely hear OPS talked about in the quantitative finance community, aside from different types of mean-variance optimization. So I have two questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Why is Online Portfolio Selection / Capital Growth Theory rarely discussed in quant finance? Is there some fundamental drawback or flaw in the theory?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;What is the state of the art in OPS/CGT? What are the seminal papers?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5251" LastActivityDate="2017-05-07T16:35:18.427" Title="What is the state of the art in Capital Growth Theory?" Tags="&lt;portfolio-management&gt;&lt;portfolio-optimization&gt;&lt;portfolio-selection&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34103" PostTypeId="2" ParentId="34089" CreationDate="2017-05-07T16:52:33.670" Score="7" Body="&lt;p&gt;We assume that the process $\{J_t, \, t\ge 0\}$ is defined at the jump times of the Poisson process $\{N_t, \, t \ge 0\}$, and all the jump sizes are independent and identically distributed. That is,&#xA;\begin{align*}&#xA;Q_t \equiv \int_0^t (J_t-1) dN_t = \sum_{n=1}^{N_t} (J_i-1),&#xA;\end{align*}&#xA;where $J_i$, for $i=1, \ldots, \infty$, are independent and $\xi_i = \ln J_i \sim N\left(u, \sigma_J^2\right)$.&#xA;Note that, the process&#xA;\begin{align*}&#xA;Q_t -\lambda k\, t&#xA;\end{align*}&#xA;is a martingale.&#xA;Moreover, as the discount stock price process $\{e^{-rt}S_t, \ t\ge 0\}$ is a martingale,  under the risk-neutral measure, we assume that the stock price process $\{S_t, \, t \ge 0\}$ satisfies an SDE of the form&#xA;\begin{align*}&#xA;dS_t = S_t \Big[(r-\lambda k)dt + \sigma dW_t + dQ_t\Big].&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;S_T &amp;amp;= e^{\left(r-\lambda k-\frac{1}{2}\sigma^2\right)T + \sigma W_T} \prod_{i=1}^{N_T} J_i = e^{\left(r-\lambda k-\frac{1}{2}\sigma^2\right)T + \sigma W_T + \sum_{i=1}^{N_T} \xi_i}.&#xA;\end{align*}&#xA;Consequently, $n\ge 0$,&#xA;\begin{align*}&#xA;S_T\, \mathbb{I}_{N_T=n} &amp;amp;=e^{\left(r-\lambda k + \frac{n u}{T}-\frac{1}{2}\sigma^2\right)T + \sigma W_T + \sum_{i=1}^n (\xi_i-u)}\\&#xA;&amp;amp;=e^{\left(r-\lambda k + \frac{n u}{T}-\frac{1}{2}\sigma^2\right)T + \sqrt{\sigma^2 + \frac{n \sigma_J^2}{T}}\sqrt{T} Z}\\&#xA;&amp;amp;=e^{\left(r_n -\frac{1}{2}\sigma_n^2\right)T + \sigma_n \sqrt{T} Z},&#xA;\end{align*}&#xA;where $Z$ is a standard normal random variable, $\sigma_n= \sqrt{\sigma^2 + \frac{n \sigma_J^2}{T}}$, and&#xA;\begin{align*}&#xA;r_n &amp;amp;= r-\lambda k + \frac{n u}{T}-\frac{1}{2}\sigma^2 +\frac{1}{2}\sigma_n^2\\&#xA;&amp;amp;= r-\lambda k + \frac{n\ln(1+k)}{T}.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore,&#xA;\begin{align*}&#xA;e^{-rT}E\left((S_T-K)^+ \right) &amp;amp;=\sum_{n=0}^{\infty}e^{-rT}E\left((S_T-K)^+ \mathbb{I}_{N_T=n}\right)P(N_T=n)\\&#xA;&amp;amp;=\sum_{n=0}^{\infty}e^{(-r+r_n)T}e^{-r_nT}E\left((S_T-K)^+ \mathbb{I}_{N_T=n}\right)P(N_T=n)\\&#xA;&amp;amp;=\sum_{n=0}^{\infty}\frac{(\lambda T)^n}{n!}e^{-\lambda T}e^{(-r+r_n)T}C(S_0, K, r_n, \sigma_n, T)\\&#xA;&amp;amp;=\sum_{n=0}^{\infty}\frac{(\lambda T)^n}{n!}e^{-\lambda T}e^{\left(-\lambda k + \frac{n\ln(1+k)}{T}\right)T}C(S_0, K, r_n, \sigma_n, T)\\&#xA;&amp;amp;=\sum_{n=0}^{\infty}\frac{(\lambda T)^n}{n!}e^{-\lambda(1+k) T}e^{\left(-\lambda k + \frac{n\ln(1+k)}{T}\right)T}C(S_0, K, r_n, \sigma_n, T)\\&#xA;&amp;amp;=\sum_{n=0}^{\infty}\frac{(\lambda' T)^n}{n!}e^{-\lambda' T}C(S_0, K, r_n, \sigma_n, T),&#xA;\end{align*}&#xA;where $\lambda'=(1+k)\lambda$ and $C(S_0, K, r_n, \sigma_n, T)$ is the Black-Scholes option price.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-05-07T18:14:11.683" LastActivityDate="2017-05-07T18:14:11.683" CommentCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="34104" PostTypeId="1" CreationDate="2017-05-07T16:58:32.000" Score="2" ViewCount="169" Body="&lt;p&gt;In setting up a curve using deposit rates and futures in python, is there a trigger which allows one to set when the futures start?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking for something similar to &lt;code&gt;DepoFuturesPriority&lt;/code&gt; in the QuantLibXL version - which allows for &lt;code&gt;AllDepos&lt;/code&gt;, &lt;code&gt;DeposBeforeFuturesStartDate&lt;/code&gt;, &lt;code&gt;DeposBeforeFuturesStartDatePlusOne&lt;/code&gt;, &lt;code&gt;DeposBeforeFuturesExpiryDate&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now I am using &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;rate_helpers = depo_helpers[:4] + futures_helpers + swap_helpers&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which basically uses the first 4 depos but until the expiry of the last depo not until the start of the first future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help or suggestions appreciated&lt;/p&gt;&#xA;" OwnerUserId="27835" LastEditorUserId="24222" LastEditDate="2017-05-07T22:42:27.097" LastActivityDate="2017-05-07T22:42:27.097" Title="python and quantlib - setting futures priority" Tags="&lt;python&gt;&lt;quantlib&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34105" PostTypeId="2" ParentId="34101" CreationDate="2017-05-07T16:59:57.637" Score="24" Body="&lt;p&gt;They are both price changes in response to a 1 bp change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;DV01 is valid for a single bond. It is the price change in response to a 1 bp change in yield of this instrument. It arises from the mathematical relationship between yield and price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PV01 is a more general concept for all fixed income securities , not just bonds but swaps, futures and options, MBS, and portfolios thereof. It is the price change in response to a 1 bp change in yields all along the yield curve (parallel shift in the yield curve). It presupposes an estimate of the yield curve and a mathematical relationship between the price of an instrument and this yield curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a single simple bond they are the same.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-05-07T16:59:57.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34106" PostTypeId="1" CreationDate="2017-05-07T17:12:43.447" Score="0" ViewCount="1156" Body="&lt;p&gt;I would like to know if it is possible to break down the VaR risk (using historical and Monte Carlo methodology) among the portfolio assets just like the Component VaR concept in the parametric methodology.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example lets say we have a parametric VaR of 1000 dollars with 95% confidence interval. From those 1000, 250 correspond to asset A, 500 to asset B and 250 to asset C.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I am looking forward to know is whether this same breakdown into Component VaRs can be obtain through non-parametric methodologies such as historical VaR or Monte Carlo VaR.&lt;/p&gt;&#xA;" OwnerUserId="27836" LastEditorUserId="16148" LastEditDate="2017-05-08T21:52:24.080" LastActivityDate="2017-07-04T11:42:22.933" Title="It is possible to carry out the Component VaR decomposition through non parametric methodologies?" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;var&gt;&lt;risk-models&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34108" PostTypeId="1" CreationDate="2017-05-08T01:24:04.580" Score="3" ViewCount="109" Body="&lt;p&gt;I'm trying to answer a simply posed question using a GARCH model: can we expect larger price shocks in a commodity when it's price is higher? (i.e., may we expect larger price shocks at \$100 per barrel oil versus \$20 per barrel?) My initial exploration of this question have involved using a multivariate GARCH model relating the return series and the price series, but the more I dive into the GARCH modeling method, the less I think it is appropriate. I'm essentially trying to see if the series variance is dependent on the series mean. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I already have a way of tackling this question via price regimes and change point analysis, ideally I would figure out a way to use GARCH volatility models as well. Many thanks!&lt;/p&gt;&#xA;" OwnerUserId="27841" LastActivityDate="2017-05-08T19:24:42.813" Title="Investigating a question: &quot;Does commodity price volatility scale with price level?&quot;" Tags="&lt;time-series&gt;&lt;garch&gt;&lt;commodities&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34111" PostTypeId="1" AcceptedAnswerId="34116" CreationDate="2017-05-08T14:40:00.990" Score="21" ViewCount="1698" Body="&lt;p&gt;Factor investing in equity markets is one of the hot topics of these days. Many manufacturers of investment products offer exposure to small cap, momentum, minvol, value and other pure factors or factor blends. Many of them beating the cap-weighted index at relatively low cost.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think of various reasons but I woud like to discuss:&#xA;What are the reasons not everybody just invests in factor portfolios?&#xA;What could be limitations, regulations, fears or other reasons not to invest in factor portfolios?&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2017-05-09T05:56:36.410" LastActivityDate="2017-05-09T16:17:27.690" Title="What are reasons not to do factor investing in equity markets?" Tags="&lt;equities&gt;&lt;portfolio-management&gt;&lt;factor-investing&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="34112" PostTypeId="2" ParentId="25359" CreationDate="2017-05-08T15:04:47.567" Score="0" Body="&lt;p&gt;For the S&amp;amp;P indices (and probably all other indices, but not 100% sure), the changes are made at the close.  There are trading strategies people implement around this.  My experience with this is some years back, so things may have changed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Imagine your are the Vanguard S&amp;amp;P500 index tracker fund on the week that FB is getting added to the S&amp;amp;P 500.  I don't recall the dollar value of the free floating stock for FB on the day of the add (December 20, 2013), but let's say that it was \$100B.  Weights in the index are based on free floating shares - so Zuck's shares don't count. Given \$100B of free floating stock - the index tracking funds like Vanguard have about 12% of the SPX.  This means that these funds need to hold 12% of the free floating shares of FB on the close on Dec 20, 2013.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In reality, they start buying some shares a few days in advance.  In fact they are strongly motivated - especially on the last day - to buy shares in the open market so that they have about 50-60% of their required position before the close.  Then - on the close they jam the order book with a huge market on close order which can sometimes cause the closing print to be 1-3% (I have even seen 10%) higher than the last print before the close.  This is a big win for Vanguard because they are only required to replicate the closing prices - so they have, in fact, most likely gotten an average fill below the closing print with their buying and subsequent jamming on the close.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what matters most here is the \$ amount that the indexers need to buy because their motivation for this strategy is based on the \$ amount they can make!  A second order concern is what is the expected difference in average daily trading volume - this matters too, but not to the same extent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, buy siders sometimes (at least some years back) used to like to piggy back on these trades that the indexers were doing.  Typically, such a trade would be hedged with SPX and/or the comparable stock of another company in the same industry so that macro risk is mitigated.  When we were doing it, this was an amazing strategy - I couldn't understand why it just kept working, but it did.  I have to imagine market efficiency has caught up by now - or rules may have changed to make it harder.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other things to note - getting added to the S&amp;amp;P500 is much less interesting if the add was an upgrade from the midcap S&amp;amp;P 400 - in that case midcap indexers need to sell their shares - I think they used to hold 7% of the shares, so the net amount to buy was only 5% instead of 12%.  This could sometimes set up good shorting opportunities if the stock moved up too much on the announcement of the add.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The key to this strategy was execution and hedging it right.&lt;/p&gt;&#xA;" OwnerUserId="26977" LastEditorUserId="26977" LastEditDate="2017-05-08T15:30:30.383" LastActivityDate="2017-05-08T15:30:30.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34113" PostTypeId="1" CreationDate="2017-05-08T15:08:01.407" Score="3" ViewCount="1473" Body="&lt;p&gt;When talking about Options on Bond Future on CME (American options), we have 2 definitions of Delta and Gamma. One is 'Price Delta/Gamma' and one is 'Interest Rate Delta/Gamma'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My understanding is that Price Delta/Gamma is the classic definition of Option delta/gamma (sensitivity and its sensitivity  of option's price to changes in &#xA;underlying's price).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At face value, 'Interest Rate Delta/Gamma' implies sensitivity and its sensitivity of option's price to changes to interest rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is that the right understanding? If so, isn't &quot;Interest Rate Delta&quot; same as Rho?&lt;/p&gt;&#xA;" OwnerUserId="27850" LastActivityDate="2017-09-12T13:45:28.673" Title="Delta on Bond Future Options" Tags="&lt;options&gt;&lt;greeks&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34116" PostTypeId="2" ParentId="34111" CreationDate="2017-05-08T16:28:49.393" Score="26" Body="&lt;p&gt;This question goes to whether the historical returns to factors represent:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Spurious results, overfitting, data mining...&lt;/li&gt;&#xA;&lt;li&gt;Mispricing&lt;/li&gt;&#xA;&lt;li&gt;Unexploitable effects&lt;/li&gt;&#xA;&lt;li&gt;Compensation for risk&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h3&gt;Case 1: Spurious results etc...&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;If someone constructs a &quot;stock tickers that begin with AAP or GOO&quot; factor, the highly above average returns would almost certainly reflect a fishing expedition (or conditioning on future information) and would not be reproducible going forward.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under a null of no above average returns, you're going to get portfolios that have above average historical returns with t-stats over 2. Beware.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For something like the Fama-French factor $\mathit{HML}$, this seems far less likely since it has continued to hold decades and decades after it was initially discovered. And if a factor works in other markets and asset classes, it may also increase confidence that the effect is really there. For example, Asness et. al. (2013) find value and momentum effects across a broad variety of asset classes.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Case 2: Mispricing&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;If a factor reflects mispricing by investors, some kind of psychological bias or error, there's the possibility that investors wisen up and the higher returns vanish!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, are we likely to see more egregious violations of the law of one price such as in the tech stock carveouts of Lamont and Thaler (2003)? Perhaps, but if investors get smarter, these types of anomalies should go away.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Case 3: Unexploitable effects&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;A related idea is that various anomalies can exist if they are unexploitable. There's a large literature on mispricing and short sale constraints.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A common question for higher turnover strategies (eg. momentum) is to what extent trading costs eat into estimated returns. For example, Novy-Marx and Velikov (2016) examine transaction costs and anomalies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another issue is what's the price you can actually &lt;em&gt;trade&lt;/em&gt; at? In this blog post, &lt;a href=&quot;https://blog.quantopian.com/beware-of-low-frequency-data-by-ernie-chan-ph-d/&quot; rel=&quot;noreferrer&quot;&gt;Ernie Chan goes through some examples where a strategy appears to generate positive returns but actually doesn't!&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Case 4: Compensation for risk&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;If the factors represent compensation for risk, a risk that investors don't wish to hold, then there's a rational reason for the effect to continue. It doesn't violate economic laws of rationality for there to be positive insurance premiums  and for the holders of unpleasant, aggregate risk to earn premiums for bearing that risk. The efficient market hypothesis of Eugene Fama &lt;strong&gt;does not&lt;/strong&gt; imply that expected returns are constant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This brings up a question of whether clients are capable of bearing a risk? When will they want cash? For example, a number of university endowments tried to follow the &lt;a href=&quot;https://en.wikipedia.org/wiki/David_F._Swensen#The_Yale_Model&quot; rel=&quot;noreferrer&quot;&gt;David Swensen, Yale Model&lt;/a&gt; and try to earn premiums for holding highly illiquid investments. When the 2008 financial crisis hit, all types of these illiquid investments in private equity, venture capital etc... became even more illiquid and ceased to pay dividends. Some major university endowments ended up issuing large bonds to raise cash...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If a university's plan in a financial crisis is to avoid cuts in programs by tapping an endowment, then investing a large portion of the endowment in illiquid securities may be problematic. If you go down to the level of tiny non-profits, their revenues (from contributions) can be highly correlated to the business cycle. Putting their cash in investments correlated with their revenue could put them at risk of disintegration in a crisis.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Declining above average returns...&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Mclean and Pontiff (2016) find that many asset pricing anomalies in the literature decline in estimated magnitude post discovery and post publication. Do their results reflect investors learning (and reduced mispricing)? That some prior asset pricing anomalies were spurious or overstated? That compensation for risk has gone down? Some combination of the three?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A decline in the estimated magnitude of an effect in studies trying to replicate the results is a pervasive issue in science.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Asness, Clifford S., Tobias J. Moskowitz, and Lasse Heje Pedersen, 2013, &quot;Value and Momentum Everywhere,&quot; &lt;em&gt;Journal of Finance&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lamont, Owen A., and Richard H. Thaler, 2003, &quot;Can the Market Add and Subtract? Mispricing in Tech Stock Carve‐outs,&quot; &lt;em&gt;Journal of Political Economy&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mclean, David R. and Jeffrey Pontiff, 2016, &quot;Does Academic Research Destroy Stock Return Predictability?&quot; &lt;em&gt;Journal of Finance&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Novy-Marx, Robert, and Mihail Velikov, 2016, &quot;A taxonomy of anomalies and their trading costs,&quot; &lt;em&gt;Review of Financial Studies&lt;/em&gt;`&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-05-09T16:17:27.690" LastActivityDate="2017-05-09T16:17:27.690" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34117" PostTypeId="2" ParentId="34111" CreationDate="2017-05-08T19:03:53.370" Score="6" Body="&lt;p&gt;To add another perspective see this current and very relevant article with many unique and original insights (Kritzman is one of my favorite authors anyway):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cocoma, Paula and Czasonis, Megan and Kritzman, Mark and Turkington, David, Facts About Factors (April 6, 2015). MIT Sloan Research Paper No. 5128-15. Available at SSRN: &lt;a href=&quot;https://ssrn.com/abstract=2594485&quot; rel=&quot;noreferrer&quot;&gt;https://ssrn.com/abstract=2594485&lt;/a&gt; or &lt;a href=&quot;http://dx.doi.org/10.2139/ssrn.2594485&quot; rel=&quot;noreferrer&quot;&gt;http://dx.doi.org/10.2139/ssrn.2594485&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Abstract&lt;/strong&gt;&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;It has become fashionable to allocate portfolios to factors rather&#xA;  than to assets. The often stated motivation for this approach is that&#xA;  factors are less correlated with each other than assets; therefore,&#xA;  factors afford greater opportunity for diversification. This argument&#xA;  is specious, of course, because ultimately the portfolio must be&#xA;  invested in assets. It is, therefore, impossible to produce a better&#xA;  in-sample portfolio by describing the portfolio as a set of factors&#xA;  than assets. There are several potentially legitimate arguments,&#xA;  though, for favoring factor stratification over asset stratification.&#xA;  It could be that factors are easier to forecast than assets, because&#xA;  investors are better able to relate current information to future&#xA;  factor behavior than to future asset behavior. Unfortunately, we have&#xA;  no way of testing this conjecture generically. But there are several&#xA;  testable conjectures. Perhaps risk estimated from high-frequency&#xA;  returns predicts risk over longer horizons more reliably for factors&#xA;  than for assets. Or the statistical properties of large samples may&#xA;  predict the statistical properties of small samples more reliably for&#xA;  factors than for assets. Or, for the same sample size, the statistical&#xA;  properties of factors may be more stationary from one sample to the&#xA;  next than they are for assets. Finally, it may be that reducing the&#xA;  dimensionality of a large set of assets to a smaller set of factors&#xA;  reduces noise more effectively than reducing dimensionality to a&#xA;  smaller set of assets. We offer empirical evidence of the validity, or&#xA;  lack thereof, of these testable conjectures.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="12" LastActivityDate="2017-05-08T19:03:53.370" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34118" PostTypeId="2" ParentId="34108" CreationDate="2017-05-08T19:24:42.813" Score="1" Body="&lt;p&gt;Besides the useful commnent by @will on how to do this without a GARCH model, you could proceed as follows: include the price level (or some transformation of it, e.g. power or log) in the conditional variance equation. Something like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{aligned}&#xA;r_t &amp;amp;= \mu_t+u_t, \\&#xA;u_t &amp;amp;= \sigma_t\varepsilon_t, \\&#xA;\sigma_t^2 &amp;amp;= \omega + \alpha_1 u_{t-1}^2 + \beta_1 \sigma_{t-1}^2 + \gamma_1 g(P_{t-1},P_{t-2},\dots), \\&#xA;\varepsilon_t &amp;amp;\sim i.i.d.(0,1), \\&#xA;\end{aligned}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $g(P_{t-1},P_{t-2},\dots) = P_{t-1}$ or $g(P_{t-1},P_{t-2},\dots) = \sqrt{P_{t-1}}$, or $g(P_{t-1},P_{t-2},\dots) = 0.6 P_{t-1} + 0.4 P_{t-2}$, or something similar. The only difference from the vanilla GARCH model would be the $g(P_{t-1},P_{t-2},\dots)$ term.&lt;/p&gt;&#xA;" OwnerUserId="19645" LastActivityDate="2017-05-08T19:24:42.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34119" PostTypeId="1" CreationDate="2017-05-09T03:49:55.720" Score="0" ViewCount="153" Body="&lt;p&gt;Is there publically available option pricing model or theory that considers open interest/volume % change?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe that laws of supply and demand effect options like any tradable good. However, I have a hard time finding mathematical model showing the relationship between classic Greeks and open interest and options volume % change. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ultimately if someone sells/buys option far in the money or out of money it will affect IV which then moves the option price, IV isn't the mesuring size of the commitment am I correct? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to predict changes in asset prices based on changes in traders commitment (similar to futures COT). Let's say we have huge surge open interest in out of the money puts or calls we can draw a concussion that market thinks asset price going to make a large move. Based wherein the option chain volume changes we should be able to predict the direction as well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there an existing theory around this?&lt;/p&gt;&#xA;" OwnerUserId="26443" LastActivityDate="2017-05-09T03:49:55.720" Title="How to consider open interest &amp; volume change in option pricing?" Tags="&lt;options&gt;&lt;finance-mathematics&gt;&lt;greeks&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34121" PostTypeId="1" AcceptedAnswerId="34124" CreationDate="2017-05-09T05:19:35.690" Score="4" ViewCount="6061" Body="&lt;p&gt;I have been reading up on VaR and get very confused by the subadditivity concept.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On wikipedia, it says &lt;em&gt;&quot;VaR is not subadditive: VaR of a combined portfolio can be larger than the sum of the VaRs of its components.&quot;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, as I am reading through John Hull's &lt;em&gt;Options, Futures and other Derivatives&lt;/em&gt;, it has the following example talking about the benefit of diversification with VaR:  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The 10-day 99% VaR for the portfolio of Microsoft shares is $1,473,621.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The 10-day 99% VaR for the portfolio of AT&amp;amp;T shares is $368,405.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The 10-day 99% VaR for the portfolio of both Microsoft and AT&amp;amp;T shares is $1,622,657.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The amount (1,473,621+368,405) - 1,622,657 = $219,369&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my confusion is that, in this case, isn't the portfolio VaR less than the sum of individual VaR? It looks like it is subadditive here. So where does the conflict come from? Thanks in advance. &lt;/p&gt;&#xA;" OwnerUserId="27823" LastActivityDate="2017-05-09T16:05:46.097" Title="non-subadditivity of VaR" Tags="&lt;portfolio-management&gt;&lt;risk&gt;&lt;risk-management&gt;&lt;var&gt;&lt;value-at-risk&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34122" PostTypeId="2" ParentId="675" CreationDate="2017-05-09T06:09:07.970" Score="0" Body="&lt;p&gt;If  anybody's still looking i think that you may find &lt;a href=&quot;https://github.com/czielinski/portfolioopt&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/czielinski/portfolioopt&lt;/a&gt; interesting .&lt;/p&gt;&#xA;" OwnerUserId="27856" LastActivityDate="2017-05-09T06:09:07.970" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34123" PostTypeId="1" AcceptedAnswerId="34167" CreationDate="2017-05-09T12:48:37.727" Score="6" ViewCount="401" Body="&lt;p&gt;Using mean-variance, I need to estimate a co-variance matrix $\Sigma$ to obtain the best weights in my portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, there are other ways to compute the volatility $\sigma$ than historical standard deviation, for instance using Yang and Zhang estimator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't understand however the link between the vol. estimation and the co-variance matrix. I know that on the diagonals you'll find the volatility, but how do you re-calculate the co-variance matrix after you have obtained more efficient volatility estimates? &lt;/p&gt;&#xA;" OwnerUserId="13334" LastActivityDate="2017-05-14T07:10:40.783" Title="How can I use a more efficient volatility estimator to improve the co-variance matrix?" Tags="&lt;volatility&gt;&lt;portfolio-management&gt;&lt;portfolio-optimization&gt;&lt;covariance&gt;&lt;covariance-matrix&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="34124" PostTypeId="2" ParentId="34121" CreationDate="2017-05-09T13:36:16.007" Score="5" Body="&lt;p&gt;VaR is not sub-additive &lt;em&gt;in general&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Relying on Mark Joshi comment, there are particular cases where it can be. Such cases occur for portfolios containing elliptically distributed risk factors. Of course the normal distribution is among the elliptical distributions family.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The latter can be helpful for analytical VaR modelling as an elliptical model is usually a reasonable approximation for instruments such as equity or FX returns. Then the sub-additive property can be applied.&lt;/p&gt;&#xA;" OwnerUserId="26595" LastActivityDate="2017-05-09T13:36:16.007" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34127" PostTypeId="2" ParentId="34121" CreationDate="2017-05-09T15:30:49.800" Score="6" Body="&lt;h3&gt;Simple example where sub-additivity fails&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Let there be four possible outcomes $i=1,2,3,4$ that occur with equal probability $\frac{1}{4}$. Payoffs for $X$, $Y$, and $X + Y$ are given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ X = \begin{bmatrix}-1\\0\\1\\2 \end{bmatrix} \quad  Y = \begin{bmatrix}0\\-1\\1\\2 \end{bmatrix} \quad X + Y = \begin{bmatrix}-1\\-1\\2\\4 \end{bmatrix}$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the 75% &lt;a href=&quot;https://en.wikipedia.org/wiki/Value_at_risk#Mathematical_definition&quot; rel=&quot;noreferrer&quot;&gt;value at risk (VAR)&lt;/a&gt; for each?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$\operatorname{VAR}(X, .75) = 0$ &lt;/li&gt;&#xA;&lt;li&gt;$\operatorname{VAR}(Y, .75) = 0$ &lt;/li&gt;&#xA;&lt;li&gt;$\operatorname{VAR}(X+Y, .75) = 1$ &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;Making it explicit:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Value at risk (VAR) can be &lt;a href=&quot;https://en.wikipedia.org/wiki/Value_at_risk#Mathematical_definition&quot; rel=&quot;noreferrer&quot;&gt;mathematically defined as&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\operatorname{VAR}\left(X, \alpha \right)  = -\sup_x \left\{ x \in \mathbb{R} : P(X &amp;lt; x ) \leq 1 -\alpha \right\}$$&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The set of $x \in \mathbb{R}$ where $P(X&amp;lt;x) \leq .25$ is the open set $(-\infty, 0)$.&lt;/li&gt;&#xA;&lt;li&gt;The least upper bound of this set is 0, hence the supremum is 0, and the 75% VAR of $X$ is 0.&lt;/li&gt;&#xA;&lt;li&gt;The set of $x \in \mathbb{R}$ where $P(X + Y &amp;lt; x) \leq .25$ is the open set $(-\infty, -1)$.&lt;/li&gt;&#xA;&lt;li&gt;The least upper bound of this set is -1, hence the supremum is -1, and the 75% VAR of $X+Y$ is 1.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-05-09T16:05:46.097" LastActivityDate="2017-05-09T16:05:46.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34129" PostTypeId="2" ParentId="33147" CreationDate="2017-05-09T21:23:43.907" Score="1" Body="&lt;p&gt;Having small capital could have advantages, you can move to shallow assets, small caps equities for example, which have high return rate and here using some algorithmic methods could bring an edge, sometimes even tick data based indicators will improve entry points of your system&lt;/p&gt;&#xA;" OwnerUserId="2044" LastEditorUserId="467" LastEditDate="2017-05-11T22:23:38.297" LastActivityDate="2017-05-11T22:23:38.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34130" PostTypeId="1" CreationDate="2017-05-10T05:14:16.877" Score="1" ViewCount="154" Body="&lt;p&gt;I am looking for a data source / database that holds historical (10 years, better 20 years) dates of US and European stocks:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need the &lt;strong&gt;historical date&lt;/strong&gt; when the quarterly (or annual) fundamental data of that company was published in the past. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in short terms: I need the historical &lt;strong&gt;&lt;em&gt;Earning Event&lt;/em&gt;&lt;/strong&gt; dates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solutions like Reuters or Bloomberg would possibly be too expensive... :-(&lt;/p&gt;&#xA;" OwnerUserId="27875" LastEditorUserId="27875" LastEditDate="2017-05-18T06:29:03.983" LastActivityDate="2017-10-20T06:46:41.473" Title="Where to Find Historical Earning Event (Quarterly Figures Dissemination) Dates?" Tags="&lt;equities&gt;&lt;historical-data&gt;&lt;fundamentals&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="34131" PostTypeId="1" AcceptedAnswerId="34141" CreationDate="2017-05-10T08:21:58.200" Score="4" ViewCount="121" Body="&lt;p&gt;Let's say there are about 100 illiquid EM bonds. I would like to construct a Price Index of these bonds to see the overall performance of these instruments. I have their issue volume &lt;code&gt;(number of bonds x face value)&lt;/code&gt; that will be used to find each bond's weight. However, after some time some of the bonds will mature or will be excluded if their rating falls. Also, there will be some new issues which will qualify for inclusion to the Index. Can anybody tell how can I effectively account for such events?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As per my findings there are two basic types of Price Index construction approaches - &lt;strong&gt;Paasche&lt;/strong&gt; and &lt;strong&gt;Laspeyres&lt;/strong&gt;. But thus far I have not encountered them in some of the bond index construction methodologies.&lt;/p&gt;&#xA;" OwnerUserId="19096" LastActivityDate="2017-05-10T22:49:08.630" Title="Custom Bond Index Construction" Tags="&lt;bond&gt;&lt;index&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34132" PostTypeId="2" ParentId="34071" CreationDate="2017-05-10T08:54:39.370" Score="2" Body="&lt;p&gt;After editing my queston several times I decided to write an answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In setting (B) we have the Ito correction term. As Gordon mentions this makes the expected value vanish.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In setting (A) we introduce a positive drift of the size $\sigma^2 \Delta t/2$ even if we stay in discrete time. It is there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following code illustrates this in R. The setting &lt;code&gt;mu=0&lt;/code&gt; corresponds to (A) and &lt;code&gt;mu = -sigma^2/2&lt;/code&gt;to (B).&#xA;In A after 10 years and using 1000 paths we have an average of 12% gain which is what we can expect if we have the drift of $0.15^2/2$ ($15\%$ vol in the example below) for 10 years  which equals $11.25 \%$ (!)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/mqcsR.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/mqcsR.png&quot; alt=&quot;sample paths drift not corrected&quot;&gt;&lt;/a&gt;&#xA;In B we have -3% which I think is just a sampling error and it should be zero. In a second run I got the 0 expected growth.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/L2Hgp.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/L2Hgp.png&quot; alt=&quot;sample paths drift corrected&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both processes reach similar maxima and do not explode.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bottom line: on the long run not accounting for the drift correction will lead to overestimates of your performance ... which is a basic point in stochastic analysis.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;S_0 = 100&#xA;nr_paths = 1000&#xA;delta_t = 1/250 # nr steps per year&#xA;nr_years = 10&#xA;sigma = 0.15&#xA;&#xA;mu = 0 &#xA;#mu = -sigma^2/2&#xA;&#xA;paths = matrix(S_0, nrow = nr_paths, ncol = nr_years/delta_t)&#xA;dBt = matrix(rnorm(nr_paths*(nr_years/delta_t-1), mean = 0, sd = 1), nrow = nr_paths, ncol = nr_years/delta_t-1)&#xA;&#xA;for (i in 2: (nr_years/delta_t)) {&#xA;  paths[,i] = paths[,i-1]*exp(mu*delta_t + sigma*sqrt(delta_t)*dBt[,i-1]) &#xA;}&#xA;plot( paths[1,], type=&quot;n&quot;, ylim = range(paths), main = paste(&quot;Drift =&quot;, toString(mu))) &#xA;&#xA;for(i in 1:nr_paths) {&#xA;  lines( paths[i,], col = rgb(0,0,1,0.05) )&#xA;}&#xA;&#xA;lines( apply(paths, 2, mean), col =&quot;red&quot;)&#xA;tail(apply(paths, 2, mean))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;EDIT: one more additional thougt:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Setting (A) (no drift correction) leads to&#xA;$$&#xA;E[\log(S_t/S_u)|\mathcal{F_u}] = 0&#xA;$$ &#xA;thus the expectation of the (conditional) logreturn is 0, while&#xA;Setting (B) drift correction as in PRIIPS leads to&#xA;$$&#xA;E[\frac{S_t-S_u}{S_u}|\mathcal{F_u}] = 0&#xA;$$ &#xA;thus the expectation of the (conditional) arithmetic return is zero. In this setting the price $S_t$ is a martingale.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2017-05-11T11:33:16.943" LastActivityDate="2017-05-11T11:33:16.943" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34141" PostTypeId="2" ParentId="34131" CreationDate="2017-05-10T22:49:08.630" Score="6" Body="&lt;p&gt;As @noob2 pointed out, a Laspeyeres type index is the way to go, so I'll focus on other parts of your question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nearly all bond indices are rule-based and rebalanced monthly. At the end of each month, based on a pre-determined set of rules (countries, credit rating range, maturity range, minimum par amount, etc.), you select a basket of bonds. This basket is known as the &quot;returns universe&quot; and is used to compute the daily returns for the next month.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As the month progresses, some of the bonds may be disqualified (perhaps due to a credit event or maturity being too short) and other bonds may qualify. These subtractions and additions result in a forward-looking &quot;statistical universe,&quot; but have no impact on the current &quot;returns universe.&quot; In other words, these events do not change the bonds you use to calculate returns for the current month.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the end of the month, the statistical universe replaces the old returns universe as the new returns universe, and the cycle starts again.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2017-05-10T22:49:08.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34142" PostTypeId="1" CreationDate="2017-05-10T23:28:10.467" Score="-1" ViewCount="44" Body="&lt;p&gt;The convention says that when computing with rates, $1$ year has $360$ days. Does this mean that, when computing with rates, $1$ year has $360$ normal days or 1 day is $\frac{365 \times 24}{360} = 24.33$ hours long?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope it is clear, tell me if my question is confusing.&lt;/p&gt;&#xA;" OwnerUserId="26389" LastEditorUserId="26389" LastEditDate="2017-05-10T23:44:19.037" LastActivityDate="2017-05-10T23:44:19.037" Title="When computing with rates, how long is a year? how long is a day?" Tags="&lt;rates&gt;&lt;daycounting&gt;&lt;convention&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34143" PostTypeId="2" ParentId="34142" CreationDate="2017-05-10T23:34:46.850" Score="1" Body="&lt;p&gt;When the convention is ACT/360, it means that 365 calendar days of interest is calculated as 365/360 years.  I knows it seems stupid, but before industrial use of computers, it was convenient for a year to be a nice round number like 360.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I forget how the 30/360 convention is handled - I once coded up all the conventions, but they have worked really well for me and I don't remember what they all mean!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try this reference:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://developers.opengamma.com/quantitative-research/Interest-Rate-Instruments-and-Market-Conventions.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://developers.opengamma.com/quantitative-research/Interest-Rate-Instruments-and-Market-Conventions.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26977" LastActivityDate="2017-05-10T23:34:46.850" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34144" PostTypeId="2" ParentId="32305" CreationDate="2017-05-11T00:52:40.753" Score="4" Body="&lt;p&gt;The CAPM is an economic theory that expected returns in excess of the risk free rate should be linear in the regression beta on the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \operatorname{E}[R_i - R^f] = \beta_i \operatorname{E}[R^m - R^f]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Graphically, it would look like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/hadXf.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/hadXf.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As market beta increases, expected returns increase.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Testing the CAPM with a cross-sectional regression&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Conceptually, what Fama and Macbeth wanted to do was:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;For each portfolio $i=1, \ldots, n$, run a time series regression to get market beta $\beta_i$.&lt;/li&gt;&#xA;&lt;li&gt;Test the CAPM with a cross-sectional regression of $\operatorname{E}[R_i - R^f]$ on $\beta_i$ using the $n$ securities. That is, run the regression:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;$$ \bar{R_i} - R^f = \gamma_0 + \gamma_1 \beta_i + \epsilon_i$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're statistician/econometrician, you'll realize that naively running that regression will have a &lt;em&gt;HUGE&lt;/em&gt; problem with inconsistent standard errors because returns are cross-sectionally correlated!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A modern approach to consistently estimate standard errors might be to run the following panel regression and cluster by time $t$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ R_{it} - R^f_t = \gamma_0 + \gamma_1 \beta_i + \epsilon_{it}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What Fama and Macbeth did back in the 1970s was develop an intuitive procedure to estimate consistent standard errors in the presence of cross-sectional correlation. For each time period $t$, they ran the cross-sectional regression:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ R_{it} - R^f_t = \gamma_{0,t} + \gamma_{1,t} \beta_i + \epsilon_{it}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They then assumed each time period was independent (broadly reasonable) hence $\gamma_{1,t}$ and $\gamma_{0,t}$ are an IID time series, hence you can take time-series averages and calculate standard errors in the usual Statistics 1 way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\hat{\gamma}_1 = \frac{1}{T} \sum_t \hat{\gamma}_{1,t} \quad \quad \hat{\operatorname{Var}}(\gamma_1) = \frac{1}{T-1} \sum_t (\gamma_{1,t} - \hat{\gamma_1})^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;etc...&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Assumptions of the first stage?&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;If by &quot;first stage&quot; you are referring to the time-series regression:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ R_{it} - R^f_t = \alpha_i + \beta_i \left( R^m_t - R^f_t \right) + \epsilon_{it} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The classic assumptions employed by Fama were that each time period is independent and that the joint distribution of returns is multivariate normal, thereby making any regression of returns on returns a well specified regression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can relax these assumptions if you rely on asymptotic assumptions. Let $\mathbf{x}_t = \begin{bmatrix}1 \\ R^m_t - R^f_t \end{bmatrix}$ and $y_t = R_t - R^f_t$. Following Hayashi's &lt;em&gt;Econometrics&lt;/em&gt; (p. 133), the assumptions would be: (2.1.) linearity: $y_t = \mathbf{x}_t \cdot \boldsymbol{\beta} + \epsilon_t$, (2.2) ergodic stationarity of $(y_t, \mathbf{x}_t)$ (2.3) predetermined regressors (i.e. regressors orthogonal to contemporaneous error term), (2.4) $\operatorname{E}[\mathbf{x} \mathbf{x}']$ is full rank, and (2.5) $\mathbf{x}_t \epsilon_t$ is a martingale difference sequence.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;References&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Hayashi, Fumio, &lt;em&gt;Econometrics&lt;/em&gt;, 2000, Princeton University Press&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2018-08-22T15:18:14.717" LastActivityDate="2018-08-22T15:18:14.717" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="34145" PostTypeId="1" CreationDate="2017-05-11T04:44:08.450" Score="1" ViewCount="390" Body="&lt;p&gt;A recent research paper from Wolfe Research suggests an alternative to the traditional &quot;long top quintile, short bottom quintile &quot; approach to backtesting a factor.  It says to &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;construct a factor tilting portfolio, where a long-only portfolio with exposures to a given factor can be built with a target tracking error.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How would this even work?  Tracking error to what?  I know the paper isn't referring to &quot;factor mimicking portfolios&quot; because that's presented as a different alternative to long-short backtesting.&lt;/p&gt;&#xA;" OwnerUserId="27210" LastActivityDate="2017-05-11T04:44:08.450" Title="How to backtest a factor by building a factor-tilting portfolio" Tags="&lt;backtesting&gt;&lt;factor-models&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34147" PostTypeId="1" CreationDate="2017-05-11T07:04:09.750" Score="1" ViewCount="432" Body="&lt;p&gt;I have obtained the daily returns of my portfolio $R^{port}_t$ using a certain strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I want to estimate the realized volatility $\sigma^{port}_t$ using the past 60 days. An obvious way to do this is by taking the standard deviation on the daily returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I want to use an alternative estimator (&lt;a href=&quot;https://quant.stackexchange.com/questions/27741/understanding-yang-zhang-volatility-estimator&quot;&gt;see Yang Zhang&lt;/a&gt;) which requires as input the Open High and Low prices. How can this estimator be applied to estimate the volatiliy of my portfolio?&lt;/p&gt;&#xA;" OwnerUserId="13334" LastActivityDate="2017-05-12T23:07:58.103" Title="How do I estimate the volatiliy of my portfolio with an estimator that requires High, Low, Open, etc" Tags="&lt;volatility&gt;&lt;returns&gt;&lt;portfolio&gt;&lt;estimation&gt;" AnswerCount="2" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="34149" PostTypeId="1" CreationDate="2017-05-11T08:23:48.510" Score="1" ViewCount="836" Body="&lt;p&gt;As from title, can a VaR equivalent Volatility (VEV) as defined by KID/PRIIPS law be negative?&lt;/p&gt;&#xA;" OwnerUserId="27194" LastActivityDate="2017-10-12T12:59:56.247" Title="Can a VaR equivalent Volatility (VEV) be negative?" Tags="&lt;volatility&gt;&lt;var&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34150" PostTypeId="2" ParentId="34149" CreationDate="2017-05-11T09:12:52.377" Score="2" Body="&lt;p&gt;The formula for VaR equivalent volatility (from &lt;a href=&quot;https://www.esma.europa.eu/sites/default/files/library/jc_2016_21_final_draft_rts_priips_kid_report.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;) is :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\sqrt{3.842 - 2 \ln{\mathrm{VaR}}} - 1.96}{\sqrt{T}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which looks like this (for T=1):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/QW24k.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/QW24k.png&quot; alt=&quot;VaR equivalent vol.&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the x axis is VaR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since VaR is bounded between 0 and 1, &lt;em&gt;no you cannot have a negative VaR equivalent volatility&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed, from the paper I have stated above, it is written on page 29:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&quot;The VaR is the percentage of the amount paid that is returned&#xA;to the retail investor&quot;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, you can say something like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align}&#xA;\frac{\sqrt{3.842 - 2 \ln{\mathrm{VaR}}} - 1.96}{\sqrt{T}} &amp;amp;\geqslant 0 \\&#xA;3.842 - 2 \ln{\mathrm{VaR}} &amp;amp;\geqslant 1.96^2 \\&#xA;- 2 \ln{\mathrm{VaR}} &amp;amp;\geqslant 1.96^2 - 3.842\\&#xA;- 2 \ln{\mathrm{VaR}} &amp;amp;\geqslant -0.0004\\&#xA;\ln{\mathrm{VaR}} &amp;amp;\leqslant 0.0002\\&#xA;\mathrm{VaR} &amp;amp;\leqslant e^{0.0002}\\&#xA;\mathrm{VaR} &amp;amp;\leqslant 1.00040008001\\&#xA;\end{align}$$&#xA;Implying that while $\mathrm{VaR} \leqslant 1.00040008001$, the VaR implied vol. is positive.&lt;/p&gt;&#xA;" OwnerUserId="19663" LastEditorUserId="26595" LastEditDate="2017-05-11T11:57:17.443" LastActivityDate="2017-05-11T11:57:17.443" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="34152" PostTypeId="1" CreationDate="2017-05-11T10:02:50.497" Score="3" ViewCount="482" Body="&lt;p&gt;The existence of basis spreads leads to that e.g. a 6M forward rate has a different price than two after each other following 3M forward rates. This due to that the 6M forward rate has a higher credit and liquidity premium.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone explain why? As I see it, the money is locked in 6 months in both contracts and therefore should have equal credit and liquidity risk. Is this because the demand and supply of 3M contracts is higher than the 6M?&lt;/p&gt;&#xA;" OwnerUserId="7651" LastActivityDate="2017-12-07T17:16:55.680" Title="Basis swap pricing dynamics" Tags="&lt;pricing&gt;&lt;liquidity&gt;&lt;risk-premium&gt;&lt;basis&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34153" PostTypeId="2" ParentId="4886" CreationDate="2017-05-11T11:38:12.960" Score="1" Body="&lt;p&gt;Here is an O(n) version in Java (easily adaptable to another language) - the idea is to keep track of the highest price seen so far. Since you need to visit all the prices to calculate the result, I don't think you can find an algorithm that's more efficient.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;public static double maxDrawdown(double[] prices) {&#xA;  if (prices.length &amp;lt;= 1) return 0;&#xA;&#xA;  double maxPrice = prices[0];&#xA;  double maxDd = 0;&#xA;&#xA;  for (int i = 1; i &amp;lt; prices.length; i++) {&#xA;    if (prices[i] &amp;gt; maxPrice) maxPrice = prices[i];&#xA;    else if (prices[i] &amp;lt; maxPrice) maxDd = Math.min(maxDd, prices[i] / maxPrice - 1);&#xA;  }&#xA;&#xA;  return maxDd;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Inspired by &lt;a href=&quot;https://stackoverflow.com/a/32161433/829571&quot;&gt;this post&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2393" LastEditorUserId="-1" LastEditDate="2017-05-23T12:41:23.377" LastActivityDate="2017-05-11T11:38:12.960" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34154" PostTypeId="1" CreationDate="2017-05-11T11:51:37.387" Score="2" ViewCount="332" Body="&lt;p&gt;It is clear that when pricing derivatives we do this in the risk-neutral measure for known reasons.&#xA;In the calculation of the VaR equivalent Volatility (VEV) in the KID-SRRI calculation (see page 9 &lt;a href=&quot;https://www.esma.europa.eu/sites/default/files/library/2015/11/09_1026_final_kid_srri_methodology_for_publication.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;) as well as int the coming regulation of PRIIPs (see &lt;a href=&quot;https://quant.stackexchange.com/questions/34149/can-a-var-equivalent-volatility-vev-be-negative&quot;&gt;this question&lt;/a&gt; or &lt;a href=&quot;http://ec.europa.eu/finance/docs/level-2-measures/priips-delegated-regulation-2017-1473-annex_en.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;this document page 7&lt;/a&gt;) the model for the price of the product looks like this&#xA;$$&#xA;S_t = S_0 \exp \left ( (r-\sigma^2/2)t + \sigma B_t \right),&#xA;$$&#xA;where r is the risk-free rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am aware that choosing any drift would be difficult but what could be reasons that the regulator chose a risk-neutral setting? Certainly we would need some kind of reward to earn at least the costs of such products.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2017-05-11T14:46:38.217" Title="Why do regulators assume a risk-neutral world?" Tags="&lt;volatility&gt;&lt;risk-neutral-measure&gt;&lt;value-at-risk&gt;&lt;regulatory-formula&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34156" PostTypeId="2" ParentId="34149" CreationDate="2017-05-11T12:12:46.790" Score="1" Body="&lt;p&gt;VeV under PRIIPS will be negative if the &quot;loss&quot; at the 2.5% cutoff is actually a gain&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Imagine a product where you receive a small positive coupon C with probability 0.99, full capital loss with probability 0.01&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This product will have a negative VeV and thus score MRM1&lt;/p&gt;&#xA;" OwnerUserId="27516" LastActivityDate="2017-05-11T12:12:46.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34160" PostTypeId="2" ParentId="34152" CreationDate="2017-05-11T14:35:25.797" Score="1" Body="&lt;p&gt;You are confusing the underlying index 3M Libor and a 6M loan that pays a compounded 3M interest. A 3M Libor is by definition the (average) rate on an interbank 3M loan. A 6M loan, regardless of its reference interest rate, is subject to counterparty risk up to 6M. &lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2017-05-11T14:35:25.797" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="34161" PostTypeId="2" ParentId="34154" CreationDate="2017-05-11T14:46:38.217" Score="1" Body="&lt;p&gt;If I am not mistaken, I might have found something related to this in Box 8 of p11 of the first quoted document.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially, you need to compute a Monte Carlo VaR for your structured funds portfolio. Therefore, they advise you to retrieve the drift (ie: risk free rate) &lt;em&gt;from the interest swap curve&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rationale behind the use of this risk-free rate is the essence of risk-neutral pricing: instruments prices should be the same irrespectively from the risk-aversion of each of the market participants. The latter do not need to estimate the expected drift of each asset by imposing their view. The risk-neutral pricing does it for them!&lt;/p&gt;&#xA;" OwnerUserId="26595" LastActivityDate="2017-05-11T14:46:38.217" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34163" PostTypeId="1" AcceptedAnswerId="34185" CreationDate="2017-05-11T16:09:52.570" Score="2" ViewCount="2643" Body="&lt;p&gt;I am trying to optimize a simple portfolio using several random weights and choosing the best. When the number of assets is large I get a covariance matrix with 'nan' values because some asset pairs do not have trading days in common.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How should I treat the 'nan' values?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="27904" LastEditorUserId="27904" LastEditDate="2017-05-12T13:40:57.543" LastActivityDate="2017-05-12T20:59:28.250" Title="Variance Matrix with 'nan' values" Tags="&lt;optimization&gt;&lt;portfolio&gt;&lt;covariance-matrix&gt;" AnswerCount="2" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="34164" PostTypeId="2" ParentId="33147" CreationDate="2017-05-11T16:22:44.117" Score="0" Body="&lt;p&gt;Higher liquidity instruments typically do have more competition. Low volume equities tend to perform differently intraday due to fewer number of players &quot;controlling&quot; the price. The downside of that is that these few players can also trade against you very effectively.&lt;/p&gt;&#xA;" OwnerUserId="25419" LastActivityDate="2017-05-11T16:22:44.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34167" PostTypeId="2" ParentId="34123" CreationDate="2017-05-11T19:27:01.680" Score="6" Body="&lt;p&gt;Let $s$ be a $N\times1$ vector of standard deviations and $C$ be an $N\times N$ correlation matrix. The covariance matrix is equal to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Sigma=\text{diag}(s) \ C \ \text{diag}(s)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\text{diag}(x)$ is a function that takes an $N\times1$ vector and puts it on the diagonal of a $N\times N$ matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you get some better standard deviation estimates, you can update the covariance matrix with the above formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is also possible to normalize the data using your new volatility estimates in the denominator. For instance, if you decide to use a rolling N-day standard deviation estimate, then adjust each period's return by first subtracting the long-run mean and then divide by the standard deviation estimate appropriate for that day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use this normalized series to estimate the correlation matrix.&lt;/p&gt;&#xA;" OwnerUserId="2379" LastEditorUserId="19645" LastEditDate="2017-05-14T07:10:40.783" LastActivityDate="2017-05-14T07:10:40.783" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="34168" PostTypeId="1" CreationDate="2017-05-11T19:37:16.143" Score="8" ViewCount="5698" Body="&lt;p&gt;OIS is the 1-day non-collateralized interbank interest rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Such a rate is not risk-free. The market trades a very useful curve that is much closer to &quot;risk-free&quot;: the government bond curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the question is, why has the industry preferred to use OIS?  For many currencies OIS is a very small market too!&lt;/p&gt;&#xA;" OwnerUserId="17348" LastEditorUserId="26595" LastEditDate="2017-10-19T14:49:03.720" LastActivityDate="2019-03-19T15:14:21.767" Title="Why do we discount in ois and not treasuries" Tags="&lt;interest-rates&gt;&lt;discounting&gt;&lt;risk-free&gt;&lt;ois-discounting&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34169" PostTypeId="1" CreationDate="2017-05-11T19:57:39.777" Score="1" ViewCount="1212" Body="&lt;p&gt;I am trying to understand the methodology that researchers used to compute ATM-implied volatility with real data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is giving the discrete sets strike prices of one particular option with one maturity traded on one day, it is quite obvious that we will not have options that are at-the-money (Strike Price = Underlying price). From the set of strike prices and observed option prices (normally the midpoint between best bid/ask price), we can numerically estimate a set of implied volatilities with corresponding strike prices. Then, how could we measure the ATM-implied volatility that usually reported in the academic papers for each maturity on each trading day since we do not have one in the dataset? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for your time :) &lt;/p&gt;&#xA;" OwnerUserId="27910" LastEditorUserId="2183" LastEditDate="2017-06-26T09:36:01.923" LastActivityDate="2017-06-26T09:36:01.923" Title="ATM-implied volatility" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;implied&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34170" PostTypeId="2" ParentId="33147" CreationDate="2017-05-11T22:33:47.840" Score="0" Body="&lt;p&gt;I would say that a hobbyist systematic trader is very unlikely to perform long-term real returns. There are several reasons for this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Transaction costs were already mentioned. They decrease with size; if you don't have millions of dollars to play with, you are likely to suffer from them, even more so if you have a high turnover.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By definition, when a strategy works, you exploit it until the price has adjusted. So would other market participants. If you can find something nobody thought about so far, and never disclose it, then you might get some profits... until someone else finds it. It is highly unlikely that you'll on your spare time find something so smart that nobody else can think about it. When they do, profit will shrink or disappear. If you find a strategy in a book, it is publicly available and hence there should not be much profit left for this, even more so with firms who spend their days testing everything around.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Again, I'm not saying it is impossible to make money for a while, but to make it a long-time stream of income is very unlikely. I'm not talking about months here, I'm talking years and decades.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2017-05-11T22:33:47.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34171" PostTypeId="2" ParentId="34168" CreationDate="2017-05-11T23:28:02.570" Score="-1" Body="&lt;p&gt;That seemed strange to me as well.   A loan of Fed Funds should be as risky as any other inter-bank loan.  There might a settlement difference in terms of SWIFT messages, but it shouldn't be significant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll check with our settlements team at work tomorrow and post an update if there's anything to add.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I was told years ago is that the difference is that you are guaranteed to get your Fed funds loan back in case of a default.  That never made sense to me - essentially that would allow you to jump the queue of creditors.   But I have heard this answer many times nonetheless.&lt;/p&gt;&#xA;" OwnerUserId="20092" LastActivityDate="2017-05-11T23:28:02.570" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34172" PostTypeId="2" ParentId="34020" CreationDate="2017-05-12T00:13:39.240" Score="1" Body="&lt;p&gt;Hi guys I have one answer now which is quite simple. You just need multiply $P_0(0,t)$ to get rid of $t$, meaning that it has nothing to do with valuation date.&lt;/p&gt;&#xA;" OwnerUserId="27754" LastActivityDate="2017-05-12T00:13:39.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34173" PostTypeId="2" ParentId="34168" CreationDate="2017-05-12T02:32:21.937" Score="2" Body="&lt;p&gt;OIS is based on overnight Fed Funds, which as you say is an unsecured overnight rate between banks in the Federal funds market.  This is not technically risk-free, although pretty close (what are the chances of Citibank defaulting by tomorrow?).  The OIS swap market thus provides an almost-risk-free rate for any desired term.  For example, the 5yr OIS swap rate on 5/11/17 is 1.75%.   By comparison, the 5yr Treasury yield, an undoubtedly risk-free rate, is 1.90% (15bp higher).  Perhaps this is surprising, but the truth is that Treasuries are subject to supply and demand issues.  Since the crisis, the Government has been issuing large amounts of Treasuries which has caused their yields to rise versus Fed Funds.  Sometimes the opposite can happen - in the 1990s Treasury issuance was limited and yields decreased versus Fed Funds.  This supply and demand effect is one reason why Fed Funds has been a popular near-risk-free rate.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-05-12T02:32:21.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34174" PostTypeId="2" ParentId="34168" CreationDate="2017-05-12T02:58:13.213" Score="11" Body="&lt;p&gt;There are two parts to this question: 1) Is OIS a good risk-free proxy? and 2) Why is OIS used to discount cash flows of derivatives.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, overnight indexed swaps, in the US, are indexed to the Fed funds effective rate, which in turn tracks the Fed funds target rate. The Fed Fund &lt;em&gt;target&lt;/em&gt; rate is directly set by the Federal Reserve, while the Fed Funds &lt;em&gt;effective&lt;/em&gt; rate is determined by supply/demand in the Fed funds market. The dynamics of the Fed funds market are completely different from private sector interest rate markets, because the Fed directly influences/manages the supply/demand in this market. In fact, it is the NY Fed's job to ensure that Fed funds effective rate more or less tracks the target rate through open market operations; otherwise, it would be very difficult for the Fed to conduct its monetary policies. Consider what happens when the economy is in distress. The private interbank market may demand increasingly higher credit risk premium and banks may face substantial funding pressures, but the Fed in such a scenario will almost certainly lower the Fed funds target rate. The NY Fed will &lt;a href=&quot;https://www.newyorkfed.org/markets/openmarket.html&quot; rel=&quot;noreferrer&quot;&gt;do its job&lt;/a&gt; and make sure Fed funds effective rate go down accordingly. All of these statements are meant to paint this picture – you might as well forget about the individual participants; just think of Fed Funds effective rate as a rate controlled by the Fed. (This is a strong statement today, given the evolution of the Funds market after the financial crisis, but this nuance is better suited for a separate discussion.) As a result, OIS, whose payoffs are determined by Fed funds, does not price in credit risks AT ALL, but simply reflects market's expectation for future Fed funds rate (i.e., Fed's future monetary policy stance) and some term premium for longer tenors. If you go back and look at what happened after the Lehman bankcrupty, the Fed funds market was well functioned and reserve &lt;a href=&quot;https://fred.stlouisfed.org/series/WRESBAL&quot; rel=&quot;noreferrer&quot;&gt;expanded&lt;/a&gt;. This is why FRA/OIS spread went to extreme levels at the time – FRA moved a lot because of stress in the private interbank mkt, OIS didn't skyrocket because the Fed was busy cutting rates to 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The next topic is OIS for discounting cash flows of derivatives. This is only true for collateralized derivatives where the collaterals earn Fed funds effective rate. If you enter into a swap where the collateral earns a different rate, you shouldn't use OIS discounting! The problem during the financial crisis was that derivative PVs were calculated using LIBOR, which was higher than the returns earned on collaterals (typically Fed funds effective rate). As a result, the PVs used to determine how much collateral was required ended up being too low (because of the higher discount rates). When counterparties began failing, people woke up to realize that there wasn't enough collaterals to cover the losses. OIS discounting closes the gap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an additional &lt;a href=&quot;https://quant.stackexchange.com/questions/18277/why-using-the-swap-curve-as-riskfree-rate-and-no-longer-gov-bonds/18278#18278&quot;&gt;comment&lt;/a&gt; (and as @dm63 has articulated above), Treasuries are heavily influenced by supply/demand factors, while swaps have unlimited supplies. Because of balance sheet pressures after the financial crisis, longer dated Treasuries have routined traded cheap relative to swaps. As a result, OIS actually provides a clearer measure of future interest rate expectations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another advantage of using the OIS is that people from different banks more or less agree on how to build it, while different banks build wildly different Treasury curves.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2017-05-12T04:17:07.353" LastActivityDate="2017-05-12T04:17:07.353" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="34177" PostTypeId="1" CreationDate="2017-05-12T09:04:40.093" Score="3" ViewCount="369" Body="&lt;p&gt;I am analysing some portfolio returns from the perspective of a Danish investor, i.e. in the local currency, DKK. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to regress portfolio returns in DKK on the returns of a 3 factor Fama &amp;amp; French model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only factor returns I can find on Ken French's website are all denominated in USD, even the European factors he has at:&#xA;&lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html#Developed&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html#Developed&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What is the right approach to see if portfolio returns in other currencies than USD are explained by FF factors?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Some ideas and the result of attempting them:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Regress portfolio returns in DKK on the European 3 factor returns (which is denominated in USD). Result: Positive alpha with p=0.057 (so significant on a 10% level), but also significantly exposed to SMB and HML&lt;/li&gt;&#xA;&lt;li&gt;Convert daily portfolio prices to USD (using the fx rate of a given day) and recalculate returns. Then regress these returns (now on a USD base) with European 3 factor returns (still denominated in USD). Result: No alpha (p=0.82)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Please help me understand if either of these are the correct approach, or if there is another, better way. Also, do I make any assumptions unknowingly when calculating to USD?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers&lt;/p&gt;&#xA;" OwnerUserId="27493" LastEditorUserId="27493" LastEditDate="2017-05-17T08:23:25.180" LastActivityDate="2017-05-17T08:24:01.577" Title="Regressing non-USD returns on FF 3-factor returns" Tags="&lt;returns&gt;&lt;regression&gt;&lt;factor-models&gt;&lt;currency&gt;&lt;fama-french&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34179" PostTypeId="1" CreationDate="2017-05-12T11:08:32.063" Score="3" ViewCount="576" Body="&lt;p&gt;I have created a platform that computes implied volatility, option theo prices and greeks using Black 1976 model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use this platform to calculate above mentioned numbers for a variety of options traded across many different exchanges in real time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to come up with a way to automatically test the sanity of the numbers I compute on historical data (I have close prices, tick by tick data for all products).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some thoughts I have gathered to achieve this:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Come up with a list of sanity checks such as delta of an even put-call portfolio should be close to zero. Payoff should be ~ (spot price - strike price) Can someone suggest me a list of similar checks I could evaluate my data on?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Compare my numbers with a third party source. Does there exist one? I understand that these numbers depend on the model used,I only want my numbers to be in the ballpark. Some amount of error is permissible.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I am open to any other ideas that can help me test sanity automatically / semi-automatically (e.g. plotting graphs and analyzing them).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please advise.&lt;/p&gt;&#xA;" OwnerUserId="27919" LastActivityDate="2017-06-11T16:13:10.577" Title="How to validate option greeks/implied volatility data calculated in-house using Black model on a mass scale in an automated fashion?" Tags="&lt;option-pricing&gt;&lt;greeks&gt;&lt;automated-trading&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34182" PostTypeId="2" ParentId="34179" CreationDate="2017-05-12T14:17:25.483" Score="1" Body="&lt;p&gt;Another application of vol surfaces right here.  A poor fit indicdates strongly the likelihood of bad data - particularly when the number of strikes is high as is the case for SPX.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you do not need a brilliant vol surface for pricing exotics, you needn't worry about smoothness at all points or arbitrage free considerations.  A quick thing is to fit your vols to a piecewise continuous parabolic functional form. Something like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma(k)=\sigma_\mathrm{atm}+\beta k+\alpha k^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $k=\mathrm{log}(K/F)$.  I would fit the ATM by doing a similar parabolic fit on the strikes near the money and your ATM vol will be the intercept.  Then you can fit the left side of the vol smile with the parabolic form above constrained so that the intercept is $\sigma_\mathrm{atm}$.  In other words, fit&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma(k)-\sigma_\mathrm{atm}=\beta_L k+\alpha_L k^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then do the same thing on the right hand side:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma(k)-\sigma_\mathrm{atm}=\beta_R k+\alpha_R k^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This gives you 5 parameters for fitting a vol smile while only doing 3 regressions - very quick operations.  The five parameters are $\sigma_\mathrm{atm}, \alpha_L,\beta_L,\alpha_R,\beta_R$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These 5 parameters can actually fit the data impressively well when the data is good and bid ask is not ridiculously wide (outside of the W shaped vol &quot;smiles&quot; user @LocalVolatility schooled me on).  Although this is not a linear regression, I still like to use the $R^2$ formula to compare my fitted vols to the input vols.  For a ticker like SPX, you will typically see an $R^2$ of 99.8 - the fit is extremely good.  I also like to look at what I call the $L^1$, $L^2$, and $L^\infty$ errors for my fits.  $L^1$ error is the sum of the absolute errors in vol space.  $L^2$ error is the square root of the sum square errprs in the fit and $L^\infty$ error is the maximum error in the fit.  On top of that, counting the number of times missing bid ask, the vega weighted number of times missing bid ask where vega is based on the vol from the fitted smile and the $L^1$ distance from the bid ask spread - i.e. the sum absolute difference between the fitted vols and the bid ask spread - if inside of the bid ask spread the distance is zero.  I use a combination of all of these measures to assess my data quality along with some other tricks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You also have the advantage of looking at tick data - so you can see a time series of these error metrics.  A sudden drastic change could be an alert requiring intervention - but at this point handling the details are up to you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some additional work may be required for American options since put/call vols are not required to be the same....and if using single stocks, borrow costs can be annoying...but I don't have time to discuss those detail right now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS - be sure to discard strikes that are less than 1 or 2 delta from such a fit - maybe even less than 5 delta - depending on what you need.  For SPX going all the way to 1 delta options is fine - but going past that, you see a lot of noise on the wings.  I do a lot of work cleaning up the wings that I have not discussed here - I generally try to tighten up the bid ask when I get to the wings so that the put/call prices are monotonic - it is a pain in the butt, but keeps things much cleaner in the long run.&lt;/p&gt;&#xA;" OwnerUserId="26977" LastEditorUserId="26977" LastEditDate="2017-05-12T16:03:48.667" LastActivityDate="2017-05-12T16:03:48.667" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34183" PostTypeId="1" CreationDate="2017-05-12T17:48:08.727" Score="3" ViewCount="109" Body="&lt;p&gt;Does anyone know any kind of method that produces reasonably well results for American Options under Heston Model setting that could be used as benchmark value? Since right now my goal is to investigate the biasedness of the Least-Square Monte Carlo(LSM) &lt;a href=&quot;https://people.math.ethz.ch/~hjfurrer/teaching/LongstaffSchwartzAmericanOptionsLeastSquareMonteCarlo.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;More details on LSM&lt;/a&gt;under different conditions, I want some methods known to produce better results than LSM. I presume the binomial model under stochastic volatility might be a good choice but maybe a bit hard to implement and time-consuming. So just wondering if anyone knows something better than sv binomial model that could serve as a benchmark? Thanks!&lt;/p&gt;&#xA;" OwnerUserId="27929" LastActivityDate="2017-11-29T18:33:00.863" Title="Benchmark value for American Options under stochastic volatility" Tags="&lt;option-pricing&gt;&lt;stochastic-volatility&gt;&lt;american-options&gt;&lt;benchmark&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34184" PostTypeId="2" ParentId="34163" CreationDate="2017-05-12T18:35:33.367" Score="4" Body="&lt;p&gt;This is a common problem in covariance matrix estimation, with several possible solutions. One of the simplest involves two steps:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) You compute each element of the covariance matrix on a 'best efforts' basis, meaning you take the covariance of the two time series involved after REMOVING any data pairs having a N/A value. (Note that this means each element of the matrix will be based on a different number of observations, which means the resulting matrix is not a standard covariance matrix, it may not be positive definite for example). I assume that for any two time series there are at least a few common observations, otherwise it is an ill-posed problem as Matthew Gunn pointed out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) You &quot;massage&quot; the resulting matrix to make it positive definite (and thus acceptable for use as a covariance matrix) using the routine nearPD which is available in R &lt;a href=&quot;https://stat.ethz.ch/R-manual/R-devel/library/Matrix/html/nearPD.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;link&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;[Even after all this work, a large covariance matrix will be very 'noisy' and of poor quality. You should consider further steps such as 'shrinkage' &lt;a href=&quot;https://cran.r-project.org/web/packages/tawny/tawny.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;link&lt;/a&gt; before you use the results to find an optimum portfolio].&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-05-12T18:52:30.893" LastActivityDate="2017-05-12T18:52:30.893" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="34185" PostTypeId="2" ParentId="34163" CreationDate="2017-05-12T18:48:38.687" Score="1" Body="&lt;ul&gt;&#xA;&lt;li&gt;Your estimated covariance matrix includes &lt;code&gt;nan&lt;/code&gt; entries.&lt;/li&gt;&#xA;&lt;li&gt;The current &lt;a href=&quot;http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.cov.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Pandas.cov function&lt;/a&gt; &lt;strong&gt;already&lt;/strong&gt; makes a best effort to estimate covariance based upon available data by ignoring nan/null values.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This implies that to obtain a &lt;code&gt;nan&lt;/code&gt; in the estimate of covariance, &lt;strong&gt;you must have at least two return series that have ZERO time periods in common!&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Your question is ill posed&lt;/h2&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;What's the correlation between returns of the Dutch East India Company (1602-1799) and Google (2004 - now)? It's an unanswerable and non-sensical question.&lt;/li&gt;&#xA;&lt;li&gt;And if your portfolio optimizer says to put $\frac{1}{2}$ your portfolio in Dutch East India Company and $\frac{1}{2}$ in Google, how are you going to do that?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;A direction to move in&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;If you're going to work with securities that enter and leave your sample, you need to do something more sophisticated than estimate some unconditional covariance matrix with &lt;code&gt;sigma = mydata.cov()&lt;/code&gt; and using that to choose portfolio weights.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If the point is come up with portfolio weights for time $t$, it doesn't make sense to include securities which one cannot invest in at time $t$!&lt;/li&gt;&#xA;&lt;li&gt;You need some notion of $\Sigma_t$, an estimate that's designed for time $t$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And replacing &lt;code&gt;nan&lt;/code&gt; with 0 is not a sensible thing to do! The average covariance term is not zero. Systematic aggregate risk exists and this manifests itself in greater than zero covariance terms.&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-05-12T20:59:28.250" LastActivityDate="2017-05-12T20:59:28.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34186" PostTypeId="2" ParentId="34147" CreationDate="2017-05-12T19:14:01.290" Score="1" Body="&lt;p&gt;There are a few different ways to approach this problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One possibility is to transform your daily price/return data into weekly open, high, low, close data. You may then calculate the Yhang-Zhang or other suitable OHLC variance estimator (e.g., Garman-Klass, etc) as per the canonical approaches.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This approach is enumerated in this the &lt;a href=&quot;http://the-world-is.com/blog/wp-content/uploads/2017/05/YZ-Volatility-Daily-Close-Transformed-into-Weekly-OHLC.xlsx&quot; rel=&quot;nofollow noreferrer&quot;&gt;attached spreadsheet&lt;/a&gt;. In the spreadsheet, given only daily close data and dates, a weekly OHLC series was constructed. The YZ estimator was then taken over the entire data range.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another possibility is to perform a moving time-series analysis, which may be more appropriate if one believes that the variance is non-stationary. I've had success incorporating YZ into autoregressive moving average (ARMA) models, such as generalized auto-regressive conditional heteroskedasticity (GARCH) models. In order to do so, one starts by calculating the YZ error over each interval.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: The weekly YZ estimator is not likely to result in a more efficient estimate than the daily close-to-close estimator. It will, however, provide an alternate measure of dispersion.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2017-05-12T23:07:58.103" LastActivityDate="2017-05-12T23:07:58.103" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34187" PostTypeId="2" ParentId="34147" CreationDate="2017-05-12T19:51:37.313" Score="1" Body="&lt;ul&gt;&#xA;&lt;li&gt;You lack the intraday data to calculate an intraday high or low of your portfolio.&lt;/li&gt;&#xA;&lt;li&gt;The Yang-Zhang volatility estimator requires the intraday high and low.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The logical conclusion would be that you cannot use the Yang-Zhang estimator to estimate your portfolio's volatility.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Discussion&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The idea behind Yang-Zhang and other advanced volatility estimators is that intraday movements provide additional information. By utilizing this information, they generate more precise volatility estimates from the same number of days of data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in your situation, you essentially have no information on the intraday movements of your portfolio, and so there's no intraday information to add.&lt;/p&gt;&#xA;" OwnerUserId="20582" LastActivityDate="2017-05-12T19:51:37.313" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34189" PostTypeId="1" CreationDate="2017-05-12T20:46:17.510" Score="2" ViewCount="229" Body="&lt;p&gt;The original FLAM predicts the information ratio by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ &#xA;IR = IC \times \sqrt{N}&#xA;$$ &#xA;where $IR$ is the Information Ratio, $IC$ is the information Coefficient and $N$ is &lt;strong&gt;the number of independent forecasts&lt;/strong&gt;. Later this law is improved several times, but the term $ IC \times \sqrt{N}$ is always present. I don't seem to understand (and find a good practical example) of what is exactly $N$ and how to calculate it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would be grateful if someone explains the exact definition of $N$. What is an independent forecast? It may seem a stupid question to some, but for me it is fundamental. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Zhou and Jain, Active Equity Management, it is written:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$N$ is the number of independent bets in a year, it has two aspects: the number of cross-sectional bets on different assets at any point in time and the number of independent bets on the same asset across time.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In this context what exactly is &lt;strong&gt;cross-sectional bet&lt;/strong&gt; and &lt;strong&gt;independent bet on the same asset&lt;/strong&gt;? It would be best if someone gives a small portfolio example.&lt;/p&gt;&#xA;" OwnerUserId="27329" LastActivityDate="2020-01-15T07:32:35.480" Title="About the number of independent forecasts in the Fundamental Law of Active Management" Tags="&lt;portfolio-management&gt;&lt;ratio&gt;&lt;information&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34191" PostTypeId="2" ParentId="34106" CreationDate="2017-05-12T22:37:49.877" Score="1" Body="&lt;p&gt;For historical simulation you need a vector of losses $L_{i,t}$ for each asset $i$ in the portfolio and each day $t$ in the look back period.&#xA;The portfolio loss is the sum of the asset losses:&#xA;$$L_{t} = \sum_{i} L_{i,t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to calculate the $VaR$ we determine the date $t^{\star}$ with the n'th highest portfolio loss, where n is determined by your number of days and your significance level (e.g. 95%)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$VaR = L_{t^{\star}} = \sum_{i}{L_{i,t^{\star}}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From here it seems natural to define the $component$ $VaR$ of asset $i$  as the contribution of that asset to the above sum:&#xA;$$VaR_{i}^{comp}=L_{i,t^{\star}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Be aware, that $L_{i,t^{\star}}$ is not the standalone $VaR_{i}$ for asset $i$, since the $t^{\star}$ has been chosen considering the whole portfolio. Also to derive the exact relationship between stand alone $VaR_{i}$ and $VaR^{comp}_{i}$ you need to assume something about the involved distributions.&lt;/p&gt;&#xA;" OwnerUserId="22686" LastActivityDate="2017-05-12T22:37:49.877" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34192" PostTypeId="2" ParentId="3848" CreationDate="2017-05-12T23:00:55.393" Score="1" Body="&lt;p&gt;It's been a few years since the OP, and GPU usage is much more common. While still experimental, most institutions we talk to are running GPUs in the data center in some capacity. GPUs are good at large aggregations and chewing through large and streaming datasets which translates to things like: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;x-Valuation Adjustments (xVA) in relation to derivative instruments... counterparty credit risk, FVA, KVA, etc.&lt;/li&gt;&#xA;&lt;li&gt;Value at Risk (VaR) calculations&lt;/li&gt;&#xA;&lt;li&gt;Order management, keeping track of positions&lt;/li&gt;&#xA;&lt;li&gt;Fraud Detection&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;One of the challenges of GPU compute has traditionally been the moving of data and niche programming languages required. GPU-accelerated databases such as Kinetica are now mature enough to allow things like custom risk analysis (Monte Carlo, etc) to operate in-database. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recently wrote a blog post about it here:&lt;br&gt;&#xA;&lt;a href=&quot;https://www.kinetica.com/blog/machine-learning-finance-observations/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.kinetica.com/blog/machine-learning-finance-observations/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="27643" LastActivityDate="2017-05-12T23:00:55.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34193" PostTypeId="2" ParentId="3848" CreationDate="2017-05-13T00:18:16.897" Score="0" Body="&lt;p&gt;they aren't really surveys but I have a couple of papers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2388415&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2388415&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which discusses Monte Carlo pricing with an emphasis on Bermudan options using the kooderive open source project.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1473563&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1473563&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which discusses asian option pricing.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2017-05-13T00:18:16.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34194" PostTypeId="1" AcceptedAnswerId="34201" CreationDate="2017-05-13T06:16:03.940" Score="0" ViewCount="527" Body="&lt;p&gt;Suppose I can sell a European put in two ways: 1) in a mark to market collateralized market with collateral rate equal to the riskless rate $r$; 2) in a noncollaterized market where I get the payment for the put up front $0$ and invest in either a risky market account or a risky (defaultable) bond at rate $r+\lambda$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) I think the European put price is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P_1(t) = \mathbf E\big[e^{-\int_t^T r\,ds}\big(K-S(T)\big)_+\big|\mathcal F_t\big].$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) I am of two minds. On the one hand, a riskless instantaneous portfolio could be formed by the put with price $P_2(t)$ and the stock with price $S(t)$, with the portfolio price being $P_2(t)-\frac{\partial P_2(t)}{\partial S}S(t)$, as in the usual Black-Scholes argument. Then the growth rate of this riskless portfolio should be just the riskless rate $r$ and we should just have the same price as in 1). On the other hand, the default probability of the risky bond/money market should impose the credit spread $\lambda$ on the interest rate, so the put price should be&#xA;$$P_2(t) = \mathbf E\big[e^{-\int_t^T (r+\lambda)\,ds}\big(K-S(T)\big)_+\big|\mathcal F_t\big]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which is the correct discount factor? If neither is true, what is the correct answer?&lt;/p&gt;&#xA;" OwnerUserId="6686" LastEditorUserId="20454" LastEditDate="2017-10-09T15:51:05.087" LastActivityDate="2017-10-09T15:51:05.087" Title="What Is the correct discounting, risky or riskless?" Tags="&lt;option-pricing&gt;&lt;credit-risk&gt;&lt;discounting&gt;&lt;collateral&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34196" PostTypeId="1" CreationDate="2017-05-13T10:34:04.723" Score="4" ViewCount="622" Body="&lt;p&gt;Suppose that i have data that for each day i have more than one option, either put or call. I.E. I have more than 20 put options and 20 call options for each specific day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the way to estimate the option implied skewness and kurtosis for that specific dataset? Is there a package in R, or some code to help me understand how to do it? For each option i have information like the &lt;code&gt;delta&lt;/code&gt;, &lt;code&gt;strike price&lt;/code&gt;, &lt;code&gt;volume&lt;/code&gt;, &lt;code&gt;spot price&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT.1&lt;/strong&gt;: I am not sure in terms of data; typically more than 1 option is present on a certain date. I.e. on the &lt;code&gt;03-02-2010&lt;/code&gt; we can have 30 options on expiration date &lt;code&gt;A&lt;/code&gt;, 50 on expiration date &lt;code&gt;B&lt;/code&gt; and so forth, which each having their respective values introduced prior. When finding the kurtosis/skewness the procedure includes at the same time all options; taking into account the different expiration dates (seems more logical), or not? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT.2&lt;/strong&gt;: One good way to measure those metrics, is through the Corrado and Su (1996) model, or, even better, with the corrected Brown and Robinson (2002) equations of the Corrado and Su model. Link is in the comment below.&lt;/p&gt;&#xA;" OwnerUserId="27901" LastEditorUserId="27901" LastEditDate="2017-05-15T11:11:57.943" LastActivityDate="2017-05-15T11:11:57.943" Title="How to estimate option implied skewness and kurtosis in R" Tags="&lt;options&gt;&lt;programming&gt;&lt;skewness&gt;&lt;kurtosis&gt;" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="34199" PostTypeId="1" AcceptedAnswerId="34322" CreationDate="2017-05-04T15:29:45.080" Score="5" ViewCount="720" Body="&lt;p&gt;Perhaps I am approaching this from the wrong direction but I was just thinking about the relationship between &lt;a href=&quot;http://en.wikipedia.org/wiki/Ito_calculus&quot; rel=&quot;nofollow noreferrer&quot;&gt;Ito&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/Stratonovich_integral&quot; rel=&quot;nofollow noreferrer&quot;&gt;Stratonovich&lt;/a&gt; integrals:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is a &lt;a href=&quot;https://en.wikipedia.org/wiki/Stratonovich_integral#Comparison_with_the_It.C3.B4_integral&quot; rel=&quot;nofollow noreferrer&quot;&gt;well known result that to convert one into the other&lt;/a&gt; you need an extra Ito-correction term which basically is a convexity correction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question&lt;/strong&gt;&lt;br&gt;&#xA;I understand that you need this extra term in the Ito case. My problem is that I don't have a good intuition why you lose this extra term exactly at the midpoint when you construct the Stratonovich integral. Why not more to the right or more to the left? Or put another way: Why is the situation always that symmetric and thus independent of the integrated function?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&lt;br&gt;&#xA;One hunch I have is that it has to do with &lt;em&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Quadratic_variation&quot; rel=&quot;nofollow noreferrer&quot;&gt;bounded quadratic variation&lt;/a&gt;&lt;/em&gt;: Because the quadratic function is symmetric the midpoint automatically balances the left and the right hand side's &quot;distortions&quot;. Is this idea correct and if yes, how can you show this behaviour in the definition of the Stratonovich (and the Ito) integral?&lt;/p&gt;&#xA;" OwnerUserId="12" OwnerDisplayName="vonjd" LastEditorUserId="12" LastEditDate="2017-05-15T15:55:31.110" LastActivityDate="2017-05-21T08:30:24.613" Title="Ito vs. Stratonovich: Why is it the exact midpoint that renders Ito-correction zero?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;intuition&gt;" AnswerCount="2" CommentCount="8" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34201" PostTypeId="2" ParentId="34194" CreationDate="2017-05-13T22:45:08.173" Score="1" Body="&lt;p&gt;The discount rate for 2) should be a risky rate $r + \lambda$, although we must talk about how to determine $\lambda$.  If you have sold an uncollateralized put option, the put option is an unsecured obligation of yours.  Hence it should carry a similar discount rate to other unsecured obligations that you have issued.  Thus, $\lambda$ is your credit spread.  There is one exception to this:  if the buyer of this put option currently owes you money, the premium paid could be considered a reduction of the amount owed, in which case $\lambda$ is HIS credit spread.  In no case does $\lambda$ depend on the riskiness of some investment you plan to make with the premium paid.  If you are wondering why the Black-Scholes argument breaks down in this case, I believe that it is because the hedged portfolio is risk-free with regard to the stock, but not risk-free with regard to the possibility of default by the issuer of the put option.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-05-13T22:45:08.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34206" PostTypeId="2" ParentId="29999" CreationDate="2017-05-14T12:09:16.967" Score="0" Body="&lt;p&gt;Your question can be read several ways:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;what about introducing terms in the model to obtain skewness and kurtosis of returns?&lt;/li&gt;&#xA;&lt;li&gt;how to have a feedback loop on pas skewness and kurtosis in returns dynamics?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The easiest answer is on the first way to understand your question: how to introduce skew and kurtosis in a model? In math finance, it is usually done thanks to two effects:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;introducing a dynamics on the volatility&lt;/li&gt;&#xA;&lt;li&gt;adding jumps to the dynamics&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Typically, the model would be&#xA;$$\left\{\begin{array}{lcl}%&#xA;dS_t &amp;amp;=&amp;amp; \mu S_t \, dt + \sigma_t S_t \, dW^S_t + dJ_t\\%&#xA;dV_t &amp;amp;=&amp;amp; \kappa\cdot(\theta - V_t)\,dt + \xi \sqrt{V_t}\,dW^{V}_t%&#xA;\end{array}\right.$$&#xA;Modelling volatility dynamics allows to change the moments of the returns; its usual name is the &lt;a href=&quot;https://en.wikipedia.org/wiki/Stochastic_volatility&quot; rel=&quot;nofollow noreferrer&quot;&gt;Heston model&lt;/a&gt;.&#xA;The jump added as a third term to the dynamics can be arbitrary as soon as it is &quot;&lt;em&gt;properly defined&lt;/em&gt;&quot; (i.e. a consistent mathematical way). It is related to &lt;a href=&quot;https://en.wikipedia.org/wiki/L%C3%A9vy_process&quot; rel=&quot;nofollow noreferrer&quot;&gt;Lévy models&lt;/a&gt; (as suggested by @Kiwiakos ), the related mathematics needed in math finance can be found in the Shyriaev-Jacod book &lt;a href=&quot;http://www.springer.com/la/book/9783540439325&quot; rel=&quot;nofollow noreferrer&quot;&gt;Limit Theorems for Stochastic Processes&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2017-05-14T12:09:16.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34207" PostTypeId="2" ParentId="29716" CreationDate="2017-05-14T12:33:38.707" Score="2" Body="&lt;p&gt;&quot;&lt;a href=&quot;http://edge-fund.com/Lo02.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Statistics of Sharpe Ratios&lt;/a&gt;&quot; by Andy Lo is the standard reference for the widely used test for performances: the &lt;em&gt;Sharpe ratio&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This ratio is close to the standard t-test: does the mean of my i.i.d. random variable of performances $R$ is significantly not zero (or better than the risk-free rate $r_f$)?&#xA;$$\mbox{Sharpe Ratio}=\frac{\mbox{mean}(R) - r_f}{\mbox{std}(R)}.$$&#xA;To be compared to (where $N$ is the number of points used to compute the mean and the std)&#xA;$$t\mbox{-test}=\sqrt{N}\cdot \frac{\mbox{mean}(R) - r_f}{\mbox{std}(R)}=\sqrt{N}\cdot\mbox{Sharpe Ratio}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course this relies on the i.i.d. of the performance. It is not the case if you obtain different statistics on daily, weekly and monthly resampled timeseries of your dataset. These points are discussed in Andy Lo's paper.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to go further on the nonparametric aspects of testing the Sharpe ratio, you can follow this link on the &lt;a href=&quot;https://stats.stackexchange.com/questions/155223/testing-sharpe-ratio-significance&quot;&gt;Cross-Validated stackexchange&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2017-05-14T12:33:38.707" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34209" PostTypeId="2" ParentId="7402" CreationDate="2017-05-14T17:10:36.983" Score="1" Body="&lt;p&gt;Swap rates can be used to calibrate a discount curve as follows, the full algebra follows this webpage: &lt;a href=&quot;http://www.quantopia.net/bootstrapping-the-discount-curve-from-swap-rates/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bootstrapping the Discount Curve from Swap Rates&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fair value for the swap rate is related to the zero rate as follows&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X = {Z_{0y} - Z_{Ny} \over \sum_{n=0}^{N-1} \tau \cdot Z_{ny}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if we have yearly swap rates $X_{1y}, X_{2y}$... visible on the market (so $\tau = 1$) then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X_{1y} = {1 - Z_{1y} \over Z_{1y}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and so&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Z_{1y} = {1 \over 1 + X_{1y}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the first point on the calibrated curve. We can continue this process for the next year's swap rate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X_{2y} = {1 - Z_{2y} \over \Bigl( Z_{1y} + Z_{2y} \Bigr)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and substituting the value for $Z_{1y}$ above,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Z_{2y} = {1 - Z_{1y}\cdot X_{1y} \over 1 + X_{2y}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and so on, we can bootstrap a full discount curve from visible swap rates. A more general expression is given in the page I linked above.&lt;/p&gt;&#xA;" OwnerUserId="27947" LastActivityDate="2017-05-14T17:10:36.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34210" PostTypeId="1" CreationDate="2017-05-14T18:14:00.597" Score="2" ViewCount="392" Body="&lt;p&gt;While searching around for some market making-related stuff I bumped into this paper &lt;a href=&quot;https://arxiv.org/abs/1105.3115&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://arxiv.org/abs/1105.3115&lt;/a&gt; and thought that I'll start digging through it and its References, out of lack of better ideas. I doubt that's a particularly effective way of approaching this, so could someone give me a better list of papers to get started with? I'm particularly interested in the theory of market making strategies for stocks, but will happily read any &quot;classical&quot; works in the general &quot;quant finance&quot; area.&lt;/p&gt;&#xA;" OwnerUserId="27948" LastActivityDate="2017-05-31T22:52:49.290" Title="What are some classical papers to read for a mathematician looking to get into quant finance?" Tags="&lt;reference-request&gt;&lt;research&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34211" PostTypeId="1" CreationDate="2017-05-14T19:20:37.040" Score="3" ViewCount="531" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;In academic literature, &quot;statistical arbitrage&quot; is opposed to (deterministic) arbitrage.[1] In deterministic arbitrage, a sure profit can be obtained from being long some securities and short others. In statistical arbitrage, there is a statistical mispricing of one or more assets based on the expected value of these assets. In other words, statistical arbitrage conjectures statistical mispricings of price relationships that are true in expectation, in the long run when repeating a trading strategy.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Global macro is an investment strategy based on the interpretation and prediction of large-scale events related to national economies, history, and international relations. The strategy typically employs forecasts and analysis of interest rate trends, international trade and payments, political changes, government policies, inter-government relations, and other broad systemic factors.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is from wikipedia. From my personal (although I am likely incorrect) experience, stat-arb involves development of regression models using various factors to value an asset and determine relationships in asset prices and macro/fundamental data. If the  difference is significant enough that the expected return on a trade &quot;betting&quot; on a reversion to the models estimate, a profit can be incurred. Thus the trader allocates their portfolio according to expected risk adjusted returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In quantitative macro trading, economic trends are forecasted and positions made accordingly. By this approach, it seems a model is still necessary to translate economic expectations into asset price trends. Thus it seems all quant macro traders are stat-arb traders. They are just using expected data for model inputs rather than current data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is my assumption incorrect?&lt;/p&gt;&#xA;" OwnerUserId="18578" LastActivityDate="2017-05-14T19:20:37.040" Title="Can a stat arb alpha be a global macro alpha?" Tags="&lt;quant-trading-strategies&gt;&lt;econometrics&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34213" PostTypeId="1" AcceptedAnswerId="34302" CreationDate="2017-05-15T05:51:30.093" Score="0" ViewCount="1292" Body="&lt;p&gt;I have been looking at ways to construct a custom Total Return Bond Index given only the Clean and Dirty Prices. First I constructed the following, thinking that Price Index formula would capture coupon payments if I use Dirty Prices:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Ey4zb.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Ey4zb.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Price Index formula is: $$ PI_t = PI_{t-1} \times \frac{{\sum} {P_{i, t} \times N_{i, t-1}}}{{\sum} {P_{i, t-1} \times N_{i, t-1}}} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no big difference between Price Index and Total Return Index. I expected that Total Return Index should be higher than Price Index as it collects the coupons of the bonds in the index. Then I figured that post coupon payment Dirty Prices go down significantly and thus the accrued interest is being swept away.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to examine the following case:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;1) A 6% fixed rate coupon bond with semi-annual payments; &lt;/li&gt;&#xA;&lt;li&gt;2) Face Value is 1000; &lt;/li&gt;&#xA;&lt;li&gt;3) Both Clean and Dirty prices are observable;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/sLxjs.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/sLxjs.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some details:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The bond starts to trade at 1000;&lt;/li&gt;&#xA;&lt;li&gt;Post coupon payment &lt;code&gt;dirty price(t-1) = clean price(t)&lt;/code&gt;; &lt;code&gt;dirty price(t) = clean price(t) + AI(t)&lt;/code&gt;;&lt;/li&gt;&#xA;&lt;li&gt;Total Return: $$ \mathrm{Total\ Return} = \frac{P_t + AI_t + C_t}{P_{t-1} +&#xA;   AI_{t-1}} - 1 $$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So, there is a difference between the Total Return and Clean Price Return and I am assuming that I should include this while building my Total Return Index. I cannot think of a approach how to properly do this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have also looked at the difference between the Dirty Price and Clean Price and I can extract the accrued interest from there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas how to solve this? I cannot use coupon payment dates as I have no info about them.&lt;/p&gt;&#xA;" OwnerUserId="19096" LastEditorUserId="19663" LastEditDate="2017-05-19T11:14:38.903" LastActivityDate="2017-05-19T11:16:08.307" Title="Total Return Bond Index calculation using only Clean and Dirty prices" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;index&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34214" PostTypeId="2" ParentId="34210" CreationDate="2017-05-15T06:58:43.793" Score="3" Body="&lt;p&gt;I would consider &lt;a href=&quot;http://www.springer.com/cn/book/9783540752585&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;Aspect of Mathematical Finance&quot;&lt;/a&gt; as a starting point for a &quot;general quant finance area&quot;. It is &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A collection of essays written by leading experts in the field of finance mathematics&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For &quot;market making-related stuff&quot; I would try &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/9814566160&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;Market Microstructure in Practice&quot;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15154" LastActivityDate="2017-05-15T06:58:43.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34215" PostTypeId="2" ParentId="31971" CreationDate="2017-05-15T09:06:49.920" Score="1" Body="&lt;p&gt;Actually, it is not very clear the legislation. However, from some slides that EIOPA used in a conference I tried to build back their computation and what I found is that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) you simulate 10k with lenght T, so you have a matrix 10k x T&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) you sum over the Ts so you get a vector 10k x 1 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) you have to go in the risk neutral world so from every element from 1 to 10k you remove the historical mean, add the risk free and remove FX risk/variance&lt;/p&gt;&#xA;" OwnerUserId="27194" LastActivityDate="2017-05-15T09:06:49.920" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34216" PostTypeId="1" CreationDate="2017-05-15T12:55:07.087" Score="0" ViewCount="275" Body="&lt;p&gt;Currently I am designing a little market making bot for forex trading, that puts offers around the mid price. In the market I am trading it happens the order book becomes so thin that the mid price jumps up or down by quite a bit (say 30%) when one big order hits the order book.&#xA;&lt;a href=&quot;https://charts.ripple.com/#/markets/XRP/USD:rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B?interval=15m&amp;amp;range=custom&amp;amp;type=candlestick&amp;amp;start=2016-12-24&amp;amp;end=2016-12-26&quot; rel=&quot;nofollow noreferrer&quot;&gt;Just have a look at this chart around Dec 25th&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These events always last just for around 30-60 seconds until the order books recover and the mid price becomes stable again. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My market making bot updates its offers in 12-15 second intervals. Now my question is how to deal effectively with these &quot;outliers&quot;? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first idea was to measure the volatility before the bot updates its offers. And when the volatility is to high the bot just deletes the offers and waits until the volatility falls below a certain threshold again. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My second approach is to sample the price in say 10 second intervals and put these prices in a EWMA model. Then before updating the  price I check the relative distance of the current price from the moving average. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What would be the most sensible approach to stop the bot from suffering from these outliers of the mid price. &lt;/p&gt;&#xA;" OwnerUserId="22207" LastActivityDate="2017-05-15T12:55:07.087" Title="Volatility vs. Moving Average Distance" Tags="&lt;volatility&gt;&lt;moving-average&gt;&lt;outliers&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="34217" PostTypeId="1" CreationDate="2017-05-15T14:03:10.837" Score="3" ViewCount="103" Body="&lt;p&gt;When researchers examine lead-lag relationships between credit default swaps and (as an example) stock markets, many use Vector Autoregressive Models (VAR). They want to find out what market &quot;is leading&quot; the other.&#xA;But when looking at financial returns, one would not expect to find autocorrelation.&#xA;My question: Am I missing something here? I have read tons of papers using this approach and I do not get why it seems to work quite well. I have seen it so often now that there must be something specifically useful about VARs or something wrong with the conclusion I draw (or both). Why is this approach still being used? Does the assumption that markets are not fully efficient enables people to use it?&lt;/p&gt;&#xA;" OwnerUserId="27779" LastActivityDate="2017-05-15T14:03:10.837" Title="VAR models when examining relationships between financial markets" Tags="&lt;time-series&gt;&lt;models&gt;&lt;cds&gt;&lt;lags&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34221" PostTypeId="1" AcceptedAnswerId="34231" CreationDate="2017-05-15T16:29:27.127" Score="1" ViewCount="279" Body="&lt;p&gt;How can you compare stressed VaR estimates?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are statistical tests for assessing the quality of stressed VaR estimates?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think the VaR Coverage test for example by Christoffersen (1988) would still be aplicable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will build different models for calculating stressed VaR for a portfolio long in the MSCI. I am unsure how I can compare the estimates from different models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Additional Question&lt;/strong&gt;&#xA;Say, I am comparing two sVar estimates X,Y. Both yield less than by VaR expected exceedences. X is more conservative than Y. They both perform equally well on test such as Unconditional Coverage and Independence. Which is better?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I thought about backtesting it on a historical stressfull period such as the financial crisis and than look for a model which predicted exceedences are as close as possible to real exceedences. Does this make sense?&lt;/p&gt;&#xA;" OwnerUserId="22744" LastEditorUserId="22744" LastEditDate="2017-05-16T09:29:23.787" LastActivityDate="2017-05-16T09:29:23.787" Title="testing stressed VaR" Tags="&lt;value-at-risk&gt;&lt;stress-testing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34223" PostTypeId="1" AcceptedAnswerId="34229" CreationDate="2017-05-15T19:36:18.953" Score="-3" ViewCount="1986" Body="&lt;p&gt;I am having problems understanding what day is the settlement date for a libor rate, and how to find it for a given rate, e.g., Overnight, 1-Week, etc?&lt;/p&gt;&#xA;" OwnerUserId="15060" LastActivityDate="2017-05-16T14:55:04.290" Title="Define the settlement date of Libor. Where to get them" Tags="&lt;libor&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34224" PostTypeId="1" CreationDate="2017-05-15T19:51:00.777" Score="4" ViewCount="361" Body="&lt;p&gt;It is quite a well-know phenomenon that trading volume has an impact on a stock price: the more you buy the higher is a price because of demand increment. I'm wondering about models that can describe it formally. So I have two questions.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What are the best models that fit it? For example, I know about Kyle's model (&lt;a href=&quot;https://faculty.fuqua.duke.edu/~qc2/BA532/1985%20EMA%20Kyle.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;link&lt;/a&gt;) that says that $p_T = p_0 + \sum\limits_{n=0}^{N-1}\Delta p_n = p_0 + \lambda\sum\limits_{n=0}^{N-1}\varepsilon_n v_n$, where $p_T$ and $p_0$ are prices at $t=T$ and $t=0$ correspondingly, $\varepsilon_n=1$ if the volume of buys $v_b$ is larger than the volume of sells $v_s$ in the time interval $\Delta t$, $\varepsilon_n=-1$ in the opposite case and $v=\vert v_b - v_s\vert$. Is it suitable for real markets or does there exist something better?&lt;/li&gt;&#xA;&lt;li&gt;What statistical methods are usually used when you want to create some model from data or test some model for fitting the data? I think if we are seeking for linear dependence (as Kyle model told) between price and volume then least squares method will be fine for plotting a line between discrete data points.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Any thoughts and suggestions will be very appreciative.&lt;/p&gt;&#xA;" OwnerUserId="27119" LastEditorUserId="16148" LastEditDate="2017-05-15T20:06:28.570" LastActivityDate="2017-05-17T21:14:03.680" Title="Relation between price changes and trading volume (market impact)" Tags="&lt;data&gt;&lt;models&gt;&lt;price&gt;&lt;volume&gt;&lt;market-impact&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34225" PostTypeId="2" ParentId="11556" CreationDate="2017-05-15T22:19:55.520" Score="2" Body="&lt;p&gt;The fact VIX has a very large contango (right now a % carry of 10%/month) has to do with rational risk premium. The net supply of stocks is 1, so on net investors are long the stock market. They want to hedge this risk by going short, so they buy VIX futures (which are correlated -0.7 with the stock market). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, VIX futures are in zero net supply (every long has a short), so the fact that everyone wants to go long volatility means that those who short volatility get to harvest a very large risk premium, which precisely leads to the market clearing in equilibrium. Even more, VIX doesn't really exist as a physical product, so you can't execute a &quot;carry&quot; trade like people do with wheat, corn, oil or even stocks, which means that the only thing that governs the VIX curvature has to do with people's perception of the vol risk premium.&lt;/p&gt;&#xA;" OwnerUserId="27965" LastActivityDate="2017-05-15T22:19:55.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34226" PostTypeId="1" CreationDate="2017-05-16T01:03:39.853" Score="1" ViewCount="326" Body="&lt;p&gt;For deriving, say European, option prices, is there a difference between the replication approach and the hedging approach? More specifically, is there a situation where the hedging approach will not give the pricing while the replicating approach will? Perhaps caused by some restriction on funding methods?&lt;/p&gt;&#xA;" OwnerUserId="6686" LastActivityDate="2017-05-16T01:03:39.853" Title="The difference between hedging and replicationg methods of deriving option prices" Tags="&lt;option-pricing&gt;&lt;hedging&gt;&lt;replication&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34229" PostTypeId="2" ParentId="34223" CreationDate="2017-05-16T06:35:32.320" Score="2" Body="&lt;p&gt;A libor that fixes on $t_f$ starts on $t_s$ and end on $t_e$, with typically &#xA;$t_s$ = $t_f + \text{lag}$ with following adjustment, and $t_e = t_s + \text{tenor}$ with following or modified following adjustment depending on daily, weekly or monthly tenor. Also the EOM rule usually applies. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lag and adjustments will depend on the currency and may be based on several calendars. &#xA;For instance in the case of Euribor &#xA;$t_s$ = $t_f + 2$ target days, $t_e = t_s + \text{tenor}$ adjusted following or modified following target &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or in the case of Libor USD $t_s$ = $t_f + 2$ London days adjusted following London+New York, $t_e = t_s + \text{tenor}$ adjusted following or modified following London+New York. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will find most Libor conventions here: &#xA;&lt;a href=&quot;https://developers.opengamma.com/quantitative-research/Interest-Rate-Instruments-and-Market-Conventions.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://developers.opengamma.com/quantitative-research/Interest-Rate-Instruments-and-Market-Conventions.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17606" LastEditorUserId="5617" LastEditDate="2017-05-16T14:55:04.290" LastActivityDate="2017-05-16T14:55:04.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34230" PostTypeId="1" CreationDate="2017-05-16T06:57:25.267" Score="2" ViewCount="206" Body="&lt;p&gt;&lt;a href=&quot;http://quantpedia.com/Screener/Details/33&quot; rel=&quot;nofollow noreferrer&quot;&gt;Post-earnings announcement drift&lt;/a&gt; is a well documented anomaly in financial research. In 2017 May NBER paper, &lt;em&gt;&lt;a href=&quot;http://www.nber.org/papers/w23394&quot; rel=&quot;nofollow noreferrer&quot;&gt;Replicating Anomalies&lt;/a&gt;&lt;/em&gt;, the authors found that anomalies related to standardized unexpected earnings to be among the most robust quantitative factors. However, I am somewhat unsatisfied with canonical approaches to model calibration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Canonically, post-earnings announcement drift is usually measured as a standardized score, akin to a Z-score, as such:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{SUE} = \frac{(E_{act,t}-E_{exp,t})-\mathbb{E}^T_t[E_{act}-E_{exp}]}{\sqrt{\mathbb{E}^T_t[(E_{act}-E_{exp})^2]}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where:&#xA;$\mathbb{SUE}$ is standardized unexpected earnings; and $E$ is earnings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet, I believe that an astute observer should also take into account the post-earnings drift. But do so, I would think we need to know price elasticity (i.e., &quot;sensitivity&quot;) of an expected change in price (i.e, &quot;drift&quot;) to an expected change in earnings, such that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbb{E}[\mu] = \frac{E_{act}-E_{exp}}{P} *\frac{dP}{dE} - \frac{dP}{P} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb{E}[\mu]$ is the &lt;em&gt;expected&lt;/em&gt; residual logarithmic drift in an asset price following the announcement actual EPS ($E_{act}$) in light of previous analyst expectations ($E_{exp}$);&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{dP}{dE}$ is the constant of price elasticity (i.e., price &quot;Beta&quot;) to a change in earnings; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{dP}{P}$ is the post-earnings logarithmic price drift following an announcement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus the question: what are some practical ways to estimate the constant of price elasticity, $\frac{dP}{dE}$ (i.e., the expected change in price for a change in earnings)? An expected price-to-earnings ratio might be a decent first approximation, but there are problems with this assumption (e.g., it is a very indirect measure; meaningless in cases of negative earnings and asymptotically low/high PEs; etc).&lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2017-05-16T15:40:54.393" LastActivityDate="2017-05-24T07:59:12.770" Title="Practical way to estimate price sensitivity to unexpected earnings (i.e., post-earnings drift)?" Tags="&lt;factor-models&gt;&lt;calibration&gt;&lt;parameter-estimation&gt;&lt;earnings&gt;&lt;anomalies&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34231" PostTypeId="2" ParentId="34221" CreationDate="2017-05-16T08:27:21.853" Score="0" Body="&lt;p&gt;Stress VaR is a particular case of the VaR as being computed on stressed returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, any suitable statistical test (including Christoffersen test) applicable to VaR would fit for purpose for stress VaR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, you should expect this measure to be more conservative than normal VaR, by finding a better coverage (less VaR violations).&lt;/p&gt;&#xA;" OwnerUserId="26595" LastActivityDate="2017-05-16T08:27:21.853" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34232" PostTypeId="1" AcceptedAnswerId="34233" CreationDate="2017-05-16T08:52:07.443" Score="-2" ViewCount="7981" Body="&lt;p&gt;I have N assets with their individual volatilities $\sigma_{i,t}$. I construct a portfolio using the weights $w_{i,t}$ that I obtained in a matter that is irrelevant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I want to determine the portfolio volatility $\sigma_{port, t}$ by combining the individual volatilities, using the weights and correlations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that for two assets you can do:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma^2_{port} = w^{2}_1 \sigma^{2}_1 + w^{2}_2 \sigma^{2}_2 + w_1 w_1 \text{Cov}_{1,2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what do you do when you have N assets?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt;: I know that you can calculate the portfolio volatility using the portfolio returns and then simply taking the historical standard deviation. This is not what I am after since the individual volatilites are estimated using their individual model.&lt;/p&gt;&#xA;" OwnerUserId="13334" LastEditorUserId="19645" LastEditDate="2017-05-16T16:24:53.543" LastActivityDate="2017-05-16T19:38:18.313" Title="Volatility of a multiple-asset portfolio" Tags="&lt;volatility&gt;&lt;portfolio&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ClosedDate="2017-05-20T04:35:31.963" ContentLicense="CC BY-SA 3.0" />
  <row Id="34233" PostTypeId="2" ParentId="34232" CreationDate="2017-05-16T08:57:38.103" Score="6" Body="&lt;p&gt;You can generalize the formula from a portfolio composed of 2 assets to a portfolio composed of $N$ assets as follows :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\sigma^2_{port} = \sum_{i=1}^N \sum_{j=1}^N \omega_i \text{cov} (i,j)\omega_j = \sum_{i=1}^N \sum_{j=1}^N \omega_i \sigma_{i,j}\omega_j &#xA;$$&#xA;where $\sigma_{port}$ represents the standard deviation of your portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking $N = 2$ yields to the formula you wrote above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Besides, denoting by $\mu_i$ the return of asset $i$, the return of your portfolio can be written as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\mu^{port} = \sum_{i=1}^N \omega_i \mu_i&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="26595" LastEditorUserId="26595" LastEditDate="2017-05-16T16:08:12.583" LastActivityDate="2017-05-16T16:08:12.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34234" PostTypeId="2" ParentId="34232" CreationDate="2017-05-16T09:05:05.863" Score="1" Body="&lt;p&gt;You can continue with the same formula as mentioned above in your question for N assets also. To elaborate the above given answer it should be (taking sample as 5 asset portfolio):-&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$(w_1^2)(s_1^2) + (w_2^2)(s_2^2) + (w_3^2)(s_3^2) + (w_4^2)(s_4^2) + (w_5^2)(s_5^2) +  2(w_1)(w_2)Cov_{1,2} + 2(w_1)(w_3)Cov_{1,3} + 2(w_1)(w_4)Cov_{1,4} + 2(w_1)(w_5)Cov_{1,5} + 2(w_2)(w_3)Cov_{2,3} + 2(w_2)(w_4)Cov_{2,4} + 2(w_2)(w_5)Cov{2,5} + 2(w_3)(w_4)Cov_{3,4} + 2(w_3)(w_5)Cov_{3,5} + 2(w_4)(w_5)Cov_{4,5}$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where W stands for Weight of the asset and S stands for volatility. &lt;/p&gt;&#xA;" OwnerUserId="18663" LastEditorUserId="16148" LastEditDate="2017-05-16T11:59:15.840" LastActivityDate="2017-05-16T11:59:15.840" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34235" PostTypeId="2" ParentId="8424" CreationDate="2017-05-16T09:41:16.987" Score="2" Body="&lt;p&gt;One of the easiest ways is described in &lt;a href=&quot;https://www.ime.usp.br/~rvicente/risco/duffie.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Duffie, Pan (1997)&lt;/a&gt; &quot;Bootstrapped Simulation from Historical Data&quot; p.55.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$R$ is the set of all risk factors (a time series)&#xA;$C_{norm}$ is the Covariance Matrix during normal times.&#xA;$C_{stressed}$ is the Covariance Matrix from a period of stress.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can update $R$ in the following way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$R_{i,stressed}=C_{stressed}^{1/2}* C_{norm}^{-1/2}*R_{i,norm}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be implemented in R in the following way:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Rstressed = Rnorm %*% solve(chol(cov(Rnorm))) %*% chol(cov(Rstressperiod))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Checking&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cov(Rstressed)&#xA;cov(Rstressperiod)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will yield identical results.&lt;/p&gt;&#xA;" OwnerUserId="22744" LastEditorUserId="22744" LastEditDate="2017-05-19T14:36:20.627" LastActivityDate="2017-05-19T14:36:20.627" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34237" PostTypeId="1" CreationDate="2017-05-16T12:20:16.427" Score="0" ViewCount="405" Body="&lt;p&gt;Here is an unpublished excerpt from Professor X:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Since Sharpe ratio uses standard deviation as a measure of risk, it assumes normal distribution of the underlying returns and it would therefore not be appropriate to use as a performance measure for hedge funds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Information ratio avoids some, but not all, of the issues with skewness, as it uses mean return. Even if the skewness problem is avoided, choosing the appropriate benchmark for a hedge fund to be able to apply the information ratio calculation is not easy. There is very few of hedge fund style-specific benchmarks available, although some general hedge fund indices do&#xA;exist.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I fail to see how this point adds up given that the two measures look identical apart from using the Risk free rate instead of Benchmark return in the former&lt;/p&gt;&#xA;" OwnerUserId="27960" LastActivityDate="2019-08-20T00:02:45.363" Title="Difference between Sharpe Ratio and Information Ratio when measuring Hedge Fund performance?" Tags="&lt;performance&gt;&lt;hedge-fund&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34238" PostTypeId="1" AcceptedAnswerId="34239" CreationDate="2017-05-16T12:43:43.450" Score="-1" ViewCount="404" Body="&lt;p&gt;I'm trying to price a CMS indexed range accrual using Monte Carlo simulations. Let's say i have n trajectories of ZC rates using G2++ model under risk neutral measure. My question is how do i take into account the convexity adjustment and compute it using monte carlo simulation? What i'm trying to compute is the expectation of the indicator function of my 10 Y swap rate at time $T_i$ being between $K1$ and $K2$ under the forward measure $T_p$ (the payment measure) at time t:&#xA;$$ \mathbb{E_t}^{Q^{Tp}}(\mathbb{1}_{K_{min} &amp;lt;S^{i,i+10Y}(T_i)&amp;lt;K_{max}})$$ &#xA;however my Monte carlo trajectories are under the risk neutral measure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance &lt;/p&gt;&#xA;" OwnerUserId="27971" LastEditorUserId="27971" LastEditDate="2017-05-16T13:38:30.063" LastActivityDate="2017-06-08T15:07:26.380" Title="CMS convexity adjustment in a range accrual Monte Carlo" Tags="&lt;monte-carlo&gt;&lt;convexity&gt;&lt;cms&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34239" PostTypeId="2" ParentId="34238" CreationDate="2017-05-16T13:00:40.030" Score="2" Body="&lt;p&gt;If you have done your simulation under the payment date forward measure then you only need to take the expectation of the indicator of the swap rate being between $K_1$ and $K_2$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have done your simulation under the risk neutral measure (which is associated with the savings account as numeraire) then you take the expectation of the indicator of the swap rate being between $K_1$ and $K_2$ divided by the savings account value on the payment date (your numeraire) to obtain the PV of the payoff. Should you want the expectation of the indicator under the payment date forward measure, you only have to divide the PV with the initial discount to payment date. &lt;/p&gt;&#xA;" OwnerUserId="17606" LastEditorUserId="17606" LastEditDate="2017-05-16T14:58:01.437" LastActivityDate="2017-05-16T14:58:01.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34246" PostTypeId="2" ParentId="34224" CreationDate="2017-05-16T18:47:17.317" Score="1" Body="&lt;p&gt;See &lt;a href=&quot;https://www.jstor.org/stable/2138584&quot; rel=&quot;nofollow noreferrer&quot;&gt;Kandel and Pearson (1995)&lt;/a&gt; and Kim and Verrecchia (&lt;a href=&quot;http://www.jstor.org/stable/2491051&quot; rel=&quot;nofollow noreferrer&quot;&gt;1991&lt;/a&gt;, &lt;a href=&quot;https://doi.org/10.1016/0165-4101(94)90004-3&quot; rel=&quot;nofollow noreferrer&quot;&gt;1994&lt;/a&gt;, &lt;a href=&quot;https://doi.org/10.1016/S0165-4101(98)00013-5&quot; rel=&quot;nofollow noreferrer&quot;&gt;1997&lt;/a&gt;). &lt;/p&gt;&#xA;" OwnerUserId="1052" LastEditorUserId="1052" LastEditDate="2017-05-17T21:14:03.680" LastActivityDate="2017-05-17T21:14:03.680" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34248" PostTypeId="2" ParentId="34237" CreationDate="2017-05-16T19:14:31.990" Score="1" Body="&lt;p&gt;Sharpe is (Portfolio Return - RFR) / Standard Deviation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Information Ratio is (Portfolio Return - Benchmark Return) / Tracking Error,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where tracking error is the standard deviation of the active return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't understand Professor X's comment either. &lt;/p&gt;&#xA;" OwnerUserId="19501" LastActivityDate="2017-05-16T19:14:31.990" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34249" PostTypeId="1" AcceptedAnswerId="34260" CreationDate="2017-05-16T19:28:08.923" Score="3" ViewCount="5970" Body="&lt;p&gt;I use Python 3.6 to develop quantitative FOREX trading strategies. I used to use Yahoo or Google in conjunction with &lt;code&gt;pandas.datareader&lt;/code&gt; in order to collect forex data for day to day strategy development. However, lately, these the &lt;code&gt;pandas&lt;/code&gt; API hasn't been working at all. I'm not sure if they changed the way FOREX data is accessed... Using something like &lt;code&gt;EURUSD=X' or&lt;/code&gt;EUR=X`usually works as an argument for the 'name' of the security. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've also tried using &lt;code&gt;ffn&lt;/code&gt; for python. It is a package that makes downloading data/backtesting very simple. However, I've found that even this has stopped functioning. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Did yahoo and google change their data policies surrounding FOREX data? Or am I doing something completely wrong?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The datareader and ffn are both trying to access this URL to no avail:&#xA;Yahoo: &lt;a href=&quot;http://ichart.finance.yahoo.com/table.csv&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://ichart.finance.yahoo.com/table.csv&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="22393" LastActivityDate="2017-11-06T19:48:00.480" Title="Does Yahoo/Google no longer support web-scraping of FOREX data?" Tags="&lt;programming&gt;&lt;data&gt;&lt;fx&gt;&lt;python&gt;&lt;yahoofinance&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34250" PostTypeId="2" ParentId="21890" CreationDate="2017-05-16T19:36:07.570" Score="1" Body="&lt;p&gt;The benefit to using a resampled efficient frontier is a matter of practicality. Suggested allocations are more stable over time compared to the outputs of a traditional MVO and as a result can require less frequent rebalancing and transaction costs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If rebalancing frequency and transaction costs are an issue for a strategy then it might be worthwhile to consider the resampling method. If the cost savings from less frequent rebalancing are greater than any negative expected impact from a differential between the output from a resampled optimization versus a traditional optimization then use of the resampling method would be justifiable.&lt;/p&gt;&#xA;" OwnerUserId="19501" LastActivityDate="2017-05-16T19:36:07.570" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34253" PostTypeId="2" ParentId="34249" CreationDate="2017-05-16T21:17:59.323" Score="2" Body="&lt;p&gt;They are trying to make this more difficult. In matlab, you can bypass it by pretending to be a chrome user using weboptions, and pretending to access from Chrome:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.mathworks.com/help/matlab/ref/weboptions.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.mathworks.com/help/matlab/ref/weboptions.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;options.UserAgent = 'Chrome';&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Maybe something similar is possible in python?&lt;/p&gt;&#xA;" OwnerUserId="7769" LastActivityDate="2017-05-16T21:17:59.323" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34254" PostTypeId="1" CreationDate="2017-05-16T21:29:32.817" Score="8" ViewCount="291" Body="&lt;p&gt;The interview &lt;a href=&quot;https://youtu.be/URE5qHuvbeA?t=2m23s&quot; rel=&quot;noreferrer&quot;&gt;Warren Buffett Sells 30% Stake In IBM | Squawk Box | CNBC&lt;/a&gt; on May 5, 2017 mentioned that there exist &quot;stock watch firms&quot; that spotted Warren Buffett sold 30% of his stake in IBM before it was announced publicly. How do such firms glean such information (i.e., who is buying and selling stocks before it is announced publicly)?&lt;/p&gt;&#xA;" OwnerUserId="2183" LastActivityDate="2017-05-18T20:20:56.200" Title="How do stock watch firms know who is buying and selling stocks before it is announced publicly?" Tags="&lt;equities&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34255" PostTypeId="2" ParentId="4528" CreationDate="2017-05-16T21:31:44.350" Score="2" Body="&lt;p&gt;On Bloomberg you can go to CRVF &gt;&gt; Credit &gt;&gt; From the rating section select A and in the curves search section search by 'A-'. The curves are broken down by industries, so would be best if you have a specific industry in mind. &#xA;You can also build your own curve. &lt;/p&gt;&#xA;" OwnerUserId="27969" LastActivityDate="2017-05-16T21:31:44.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34259" PostTypeId="1" CreationDate="2017-05-17T09:42:20.777" Score="3" ViewCount="648" Body="&lt;p&gt;I am trying to calibrate my forecast and discount curves using the multi-curve approach with OIS discounting. To do so, I have a implemented multivariate Newton-Raphson root finder. I am finding a bit troublesome writing down the necessary equations in order to have a number of unknowns equal to the number of functions to solve, so I must be missing something.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, when calibrating my Libor and OIS curves together at the same time, my first equation for a 1Y swap instrument that receives fix annually - pays float semi-annually would be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;DF(1Y)\,\tau_1\,FixedRate(1Y) - DF(6M)\, \delta_1 \,Fwd^{6M}_{0.5Y} - DF(1Y)\, \delta_2 \,Fwd^{6M}_{1Y} = 0&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, $\tau$ and $\delta$ are the corresponding time fractions and $DF$ refers to ois discount factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Only with this first equation, I already have three unknowns: $DF(6M), DF(1Y)$ and $Fwd^{6M}_{1Y}$. Adding equations for swaps of higher maturities only adds new unknowns, and this is even without adding other equations I need such as those of 3M-6M tenor swaps, Libor-OIS basis swaps, etc etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is it that I am missing here?&lt;/p&gt;&#xA;" OwnerUserId="13458" LastActivityDate="2017-05-17T09:42:20.777" Title="Equations for multicurve calibration with OIS discounting" Tags="&lt;yield-curve&gt;&lt;calibration&gt;&lt;ois-discounting&gt;&lt;discount-factor-curve&gt;&lt;multicurve&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34260" PostTypeId="2" ParentId="34249" CreationDate="2017-05-17T13:18:36.003" Score="6" Body="&lt;p&gt;Yahoo has changed their site structure. The new download URLs look like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://query1.finance.yahoo.com/v7/finance/download/MSFT?period1=1463461200&amp;amp;period2=1494910800&amp;amp;interval=1d&amp;amp;events=history&amp;amp;crumb=lHxk.yfuuzZ&quot; rel=&quot;noreferrer&quot;&gt;https://query1.finance.yahoo.com/v7/finance/download/MSFT?period1=1463461200&amp;amp;period2=1494910800&amp;amp;interval=1d&amp;amp;events=history&amp;amp;crumb=lHxk.yfuuzZ&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These links originate from pages like this: &lt;a href=&quot;https://finance.yahoo.com/quote/MSFT/history?period1=1463461200&amp;amp;period2=1494910800&amp;amp;interval=1d&amp;amp;filter=history&amp;amp;frequency=1d&quot; rel=&quot;noreferrer&quot;&gt;https://finance.yahoo.com/quote/MSFT/history?period1=1463461200&amp;amp;period2=1494910800&amp;amp;interval=1d&amp;amp;filter=history&amp;amp;frequency=1d&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They've switched to Unix timestamps for the date format, and the download URL now validates a cookie (the &lt;code&gt;crumb&lt;/code&gt; param in the query string), which means that anyone who wants to scrape the data will need to deal with cookies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's a fuller discussion at Elite Trader: &lt;a href=&quot;https://www.elitetrader.com/et/threads/yahoo-historical-data-did-they-change-the-url-recently.309554/&quot; rel=&quot;noreferrer&quot;&gt;https://www.elitetrader.com/et/threads/yahoo-historical-data-did-they-change-the-url-recently.309554/&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="27966" LastActivityDate="2017-05-17T13:18:36.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34264" PostTypeId="1" CreationDate="2017-05-17T15:05:31.887" Score="3" ViewCount="525" Body="&lt;p&gt;Quantopian has this package alphalens to do series of analysis on factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I decided to dig in the code and make sense of the analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question I have is: There are a lot of demean in the factors and factors returns, the argument is when you demean, the analysis is for long short portfolio and when you do not demean, you have a long only portfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone explain why demean of the return gives analysis on long short portfolio?&lt;/p&gt;&#xA;" OwnerUserId="19188" LastActivityDate="2017-05-18T15:20:21.523" Title="question about Quantopian alphalens" Tags="&lt;portfolio-management&gt;&lt;factor-models&gt;&lt;asset-pricing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34265" PostTypeId="1" CreationDate="2017-05-17T15:05:36.670" Score="0" ViewCount="2334" Body="&lt;p&gt;A Target Redemption Forward (TARF) allows you to buy or sell foreign currency at an agreed “Enhanced Rate” for a number of expiry dates. But why can't a Target Redemption Forward (TARF) be used as a hedging instrument?&lt;/p&gt;&#xA;" OwnerUserId="5839" LastActivityDate="2019-09-12T15:06:24.077" Title="Why a Target Redemption Forward cannot be used as hedging instrument?" Tags="&lt;options&gt;&lt;forward&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34268" PostTypeId="1" CreationDate="2017-05-17T15:41:22.703" Score="3" ViewCount="188" Body="&lt;p&gt;I have been tasked with writing a backtesting tool from scratch. I understand a lot of trading operations, but I am primarily a researcher. I need to support futures and equities trading. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need to make sure that the backtest reflects reality relatively accurately. For example trading stocks on margin, I need to know the conventions and regulatory rules that apply, and calculate buying power, pnl, margin, etc, depending on the asset class. E.g. futures margin and pnl works differently than equities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone recommend a resource or resources that can help me fill in the gaps in my knowledge? Like a handbook of trading calculations or suchlike?&lt;/p&gt;&#xA;" OwnerUserId="27992" LastActivityDate="2018-06-12T00:06:31.100" Title="reference for portfolio / margin calculations in backtesting tool" Tags="&lt;backtesting&gt;&lt;finance-mathematics&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34270" PostTypeId="1" AcceptedAnswerId="34272" CreationDate="2017-05-17T16:22:54.873" Score="1" ViewCount="270" Body="&lt;p&gt;I need to calculate the value of an European option on a listed share. The payout is a cash payout of the 5 day volume weighted average price (VWAP) above the strike price at expiry date. The 5 day vwap is calculated by taking the total value divided by the total volume for the 5 days before expiry (including the expiry date)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to calculate the value using the Black Scholes formula. I have the risk free rate and dividend yield. I'm unsure what to use for the spot price and the volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the spot price, I believe I should use the current 5 day VWAP since that is what will be used to calculate the payout (as opposed to using the closing share price on the valuation date)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no actively traded options for this listed entity, so I'll be using historical prices to calculate the historical volatility. Here I'll use daily closing share prices to calculate volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this approach make sense?&lt;/p&gt;&#xA;" OwnerUserId="18065" LastActivityDate="2017-05-17T17:41:46.087" Title="Option value based on a vwap" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34272" PostTypeId="2" ParentId="34270" CreationDate="2017-05-17T17:41:46.087" Score="3" Body="&lt;p&gt;For the spot price you should use the share price on the valuation date, not the 5 day VWAP. Once you've estimated the volatility (historical or by comparison to similar stock's implied volatilities if available) you may use Black &amp;amp; Scholes if the expiry is far enough. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're close to the expiry you may want to refine Black &amp;amp; Scholes by&#xA;replacing $\sigma \sqrt{T}$ with $\sigma \sqrt{T_1 + (T-T_1)/3}$ where $T$ is the expiry date and $T_1 = T - 5 \text{ days}$. This will give you a good enough approximation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rationale for using the share price on the valuation date is that even though the payoff is on the final 5 days VWAP, you would still delta-hedge the option with the share, hence the spot price is your underlying. As for the $\sqrt{T_1 + (T-T_1)/3}$ term it comes from the fact that conditional on the spot price on $T_1$ the VWAP computed on period $T_1$ to $T$ is approximately log normal with log standard deviation  $\sigma \sqrt{(T-T_1)/3}$.&lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2017-05-17T17:41:46.087" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="34274" PostTypeId="2" ParentId="34199" CreationDate="2017-05-17T18:09:11.303" Score="1" Body="&lt;p&gt;There is a good discussion in Chapter 5 of the book &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/3540003134&quot; rel=&quot;nofollow noreferrer&quot;&gt;Stochastic Integration and Differential Equations&lt;/a&gt; by Protter. Note that, generally, the Stratonovich integral is defined by &#xA;\begin{align*}&#xA;\int_0^t Y_{s-} \circ dX_s = \lim_{\pi \rightarrow 0}\sum_{i=1}^n\frac{1}{2}(Y_{t_i}+Y_{t_{i-1}})(X_{t_i}-X_{t_{i-1}}).&#xA;\end{align*}&#xA;Here, $\pi$ is the module of the (can be random) partition $0=t_0 &amp;lt;t_1 &amp;lt; \cdots &amp;lt; t_n=t$. However, for a standard Brownian motion $B=\{B_t, t \ge0\}$,&#xA;we can define&#xA;\begin{align*}&#xA;\int_0^t f(B_s) \circ dB_s = \lim_{\pi \rightarrow 0}\sum_{i=1}^n f\Big(B_{\frac{t_i+t_{i-1}}{2}}\Big)(B_{t_i}-B_{t_{i-1}}).&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From Theorem 30 in Chapter 5 of the above book,&#xA;\begin{align*}&#xA;\lim_{\pi \rightarrow 0}\sum_{i=1}^n B_{\lambda t_{i-1}+(1-\lambda)t_i}(B_{t_i}-B_{t_{i-1}}) &amp;amp;= \int_0^1 B_s dB_s + 1-\lambda\\&#xA;&amp;amp;=\frac{1}{2}B_1^2 + \frac{1}{2}-\lambda,\tag{1}&#xA;\end{align*}&#xA;for any $0&amp;lt;\lambda &amp;lt;1$. That is, only taking values at the interval mid-points, or $\lambda=\frac{1}{2}$, the correction term can disappear.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Theorem 30:  Let X be a semimartingale and Y be a continuous semimartingale. Let $\mu$ be a probability measure on [0,1] and let $\alpha = \int_0^1 k \mu(dk)$.  Further suppose that $[X, Y]_t$ is absolutely continuous.  Then&#xA;  \begin{align*}&#xA;&amp;amp;\ \lim_{\pi \rightarrow 0}\sum_{i=1}^n \int_0^1 f(Y_{t_{i-1}+k (t_i-t_{i-1})})\mu(dk)(X_{t_i}-X_{t_{i-1}})\\&#xA;=&amp;amp;\ \int_0^1 f(Y_s)dX_s + \alpha \int_0^1f'(Y_s)d[Y, X]_s.&#xA;\end{align*}&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now, for $0&amp;lt;\lambda &amp;lt;1$, taking $\mu =\delta_{1-\lambda}(dk)$, that is, the &#xA;point mass at $1-\lambda$,  we obtain $(1)$ above.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-05-17T22:11:54.543" LastActivityDate="2017-05-17T22:11:54.543" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="34275" PostTypeId="1" AcceptedAnswerId="34278" CreationDate="2017-05-17T18:17:43.373" Score="8" ViewCount="1744" Body="&lt;p&gt;I've been working on making an asset allocation model that requires I price a lot of financial instruments (i.e. bonds, options) and optimize based on a certain constraint. I was originally doing this in Matlab, but am now looking to switch it to Python. Is there a package that would be equivalent to the Matlab Financial Toolbox in Python? I've read about many of them (i.e. vollib, QuantLib/PyQL), but I'm not sure which one is the most trusted / popular / commonly used.&lt;/p&gt;&#xA;" OwnerUserId="27995" LastEditorUserId="27995" LastEditDate="2017-05-17T18:23:57.103" LastActivityDate="2017-05-18T03:37:12.940" Title="Equivalent to Matlab's financial toolbox in python?" Tags="&lt;black-scholes&gt;&lt;programming&gt;&lt;python&gt;&lt;asset-allocation&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="34276" PostTypeId="2" ParentId="34275" CreationDate="2017-05-17T18:44:44.580" Score="-1" Body="&lt;p&gt;To get started, check out &lt;a href=&quot;https://docs.continuum.io/anaconda/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Anaconda&lt;/a&gt; from Continuum Analytics. They package all the various scientific and statistical Python libraries under one convenient installer. Some of these packages can be challenging to install if you try to install them piecemeal. If you've got Anaconda you've more or less got the full financial toolbox for Python and then you can start exploring the individual packages. Anaconda provides a list of installed packages with links to the documentation for each package: &lt;a href=&quot;https://docs.continuum.io/anaconda/pkg-docs.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://docs.continuum.io/anaconda/pkg-docs.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to start with a specific library provided by Anaconda, I would suggest &lt;a href=&quot;http://pandas.pydata.org/pandas-docs/stable/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;pandas&lt;/a&gt;. It farms out to many other libraries under the hood for calculations, but it's a pretty ubiquitous top-level library (i.e. library the user interacts with) when it comes to quantitative finance in Python. &lt;/p&gt;&#xA;" OwnerUserId="27966" LastEditorUserId="27966" LastEditDate="2017-05-18T00:25:07.317" LastActivityDate="2017-05-18T00:25:07.317" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="34277" PostTypeId="1" AcceptedAnswerId="34281" CreationDate="2017-05-17T21:01:48.073" Score="0" ViewCount="977" Body="&lt;p&gt;Is there any literature on the maths behind the computation of the price of an accreting swaption in the LMM model (no monte carlo, closed formula or close enough...)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!!&lt;/p&gt;&#xA;" OwnerUserId="27971" LastActivityDate="2017-08-18T19:13:39.370" Title="Accreting swaption" Tags="&lt;swaption&gt;&lt;lmm&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34278" PostTypeId="2" ParentId="34275" CreationDate="2017-05-18T02:13:39.217" Score="14" Body="&lt;p&gt;I took a quick look at Matlab's Financial Toolbox and attempted to map the features to corresponding Python packages –&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For asset allocation, portfolio optimization, and risk analytics:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Standard packages such as &lt;code&gt;scipy&lt;/code&gt; provide a large number of &lt;a href=&quot;https://docs.scipy.org/doc/scipy/reference/optimize.html&quot; rel=&quot;noreferrer&quot;&gt;optimizers&lt;/a&gt; that should suit your needs. There are also pre-canned packages that do portfolio optimizations more directly, but I don't have much experience with them.&lt;/li&gt;&#xA;&lt;li&gt;Specialized packages such as &lt;code&gt;pyfolio&lt;/code&gt; and &lt;code&gt;alphalens&lt;/code&gt; provide a ton of functions that make performance and risk analytics super easy.&lt;/li&gt;&#xA;&lt;li&gt;For some risk applications, you may also find &lt;code&gt;Copulalib&lt;/code&gt; useful.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For pricing instruments -&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;As you've already mentioned, &lt;code&gt;Quantlib&lt;/code&gt; is almost certainly the best open-source solution out there and there are a few ways to make Quantlib accessible from Python (e.g., &lt;a href=&quot;https://pypi.python.org/pypi/QuantLib-Python&quot; rel=&quot;noreferrer&quot;&gt;QuantLib-Python&lt;/a&gt;).&lt;/li&gt;&#xA;&lt;li&gt;If you have other C++ code that you already use for pricing, take a look at &lt;a href=&quot;http://www.boost.org/doc/libs/1_64_0/libs/python/doc/html/index.html&quot; rel=&quot;noreferrer&quot;&gt;Boost Python&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For time series analysis:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;A combination of &lt;code&gt;pandas&lt;/code&gt; and &lt;code&gt;statsmodels&lt;/code&gt; is the gold standard and should be more than sufficient for most purposes. The former provides a large collection of utilities for working with time series (&lt;code&gt;DataFrame&lt;/code&gt;, &lt;code&gt;Series&lt;/code&gt;, &lt;code&gt;Panel&lt;/code&gt;, etc.), while the latter provides a comprehensive library for running anything for linear regressions to sophisticated Dynamic Factor Models.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;pandas-datareader&lt;/code&gt; has many pre-built functions for retrieving financial and economic data from public sources.&lt;/li&gt;&#xA;&lt;li&gt;I've also found &lt;code&gt;arch&lt;/code&gt; quite nifty for running GARCH-type models. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For Technical Analysis:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;ta-lib&lt;/code&gt; has an easy-to-use Python wrapper.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For Financial Charts:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;matplotlib&lt;/code&gt; is the core library. &lt;code&gt;pandas&lt;/code&gt; has built-in plotting functions that use matplotlib to make many chart types very easy to work with.&lt;/li&gt;&#xA;&lt;li&gt;For prettier charts, also check out &lt;code&gt;seaborn&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For SDEs:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I have yet to run into problems can't solved by &lt;code&gt;scipy&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;And for general numeric computing, you need:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;numpy&lt;/code&gt; for numerical computing;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;scikit-learn&lt;/code&gt; for machine learning.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;sympy&lt;/code&gt; for symbolic mathematics.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2017-05-18T03:37:12.940" LastActivityDate="2017-05-18T03:37:12.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34279" PostTypeId="1" CreationDate="2017-05-18T04:54:12.267" Score="-1" ViewCount="56" Body="&lt;p&gt;I trade a lot of treasury curves, so say I have a portfolio of treasury cash and futures products (longs and shorts). How do I find the portfolio DV01 risk and curve risk? I couldn't find anything that could help me get started online. If anyone has any resources please help.&lt;/p&gt;&#xA;" OwnerUserId="13375" LastActivityDate="2017-05-23T03:05:28.200" Title="Where to find risk report/models for treasury spreads trading?" Tags="&lt;interest-rates&gt;&lt;risk-management&gt;&lt;treasuries&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34280" PostTypeId="2" ParentId="34265" CreationDate="2017-05-18T06:24:32.670" Score="1" Body="&lt;p&gt;Since it provides exposure to the FX a TARF can perfectly be used as a hedging instrument. However a TARF contains an optional component (cap on the total payoff) that makes it non linear in the FX and thus makes it depend on the FX volatility as well. &lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2017-05-18T06:24:32.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34281" PostTypeId="2" ParentId="34277" CreationDate="2017-05-18T07:58:14.353" Score="0" Body="&lt;p&gt;As long as the accretion of nominal is the same on the fixed and on the floating leg the Rebonato approximation for the equivalent Black volatility still works but the weights have to be multiplied (numerator and denominator) by the time dependent nominals. This is because the forward swap rate is still a weighted sum of forward Libors, albeit with the weights multiplied by the nominal. &lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2017-05-18T07:58:14.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34283" PostTypeId="1" AcceptedAnswerId="34286" CreationDate="2017-05-18T10:13:07.167" Score="1" ViewCount="863" Body="&lt;p&gt;If there are no taxes and no volatility, I would expect the the move in a stock on the Ex-dividend date to be equal to the gross value of the dividend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if I am taxed, I find the problem gets somewhat complicated, because I need to consider that&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I may be less inclined to hold a dividend-paying stock, but&lt;/li&gt;&#xA;&lt;li&gt;I could just sell out and buy back across the Ex-dividend date, and&lt;/li&gt;&#xA;&lt;li&gt;ultimately, a company that just paid out \$1 in dividends should be worth \$1 less, regardless of who ended up with the cash.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Based on the first 2 considerations I'd say that the drop on the ex-dividend date gradually reduces as taxes increase, but this is complicated by the 3rd point, which suggests to me that the stock should still drop by the value of the dividend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mixing these together suggests that increasing taxes should lower the price of stocks, but I can't put my finger on &lt;em&gt;how&lt;/em&gt; &lt;em&gt;much&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my simple scenario, what would the price drop across the ex dividend date be assuming rational market participants?&lt;/p&gt;&#xA;" OwnerUserId="6570" LastEditorUserId="6570" LastEditDate="2017-05-18T11:32:50.040" LastActivityDate="2017-05-18T11:47:45.107" Title="How does income tax affect the Ex-dividend behavior of a stock?" Tags="&lt;dividends&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34284" PostTypeId="2" ParentId="30830" CreationDate="2017-05-18T10:19:09.897" Score="1" Body="&lt;p&gt;The document refers to an increase in the top tax rate in the UK. And I think the comment below Table 5.1 answers your question:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;As shown, there was a significant increase in dividend income in&#xA;  2009-10 followed by a corresponding fall in 2010-11. This is thought&#xA;  to be the main source of the forestalling behaviour as it is the main&#xA;  source of income for owner-directors of companies who have much more&#xA;  flexibility than others in terms of the timing of their remuneration.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Basically it means that company directors saw this coming, and chose to increase dividends artificially in the short term to get ahead of the increase in taxes that would soon be imposed on them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dividends are a form of income, so company directors (who are also often shareholders) are in the unusual position of being able to decide their own income. They simply did the rational thing in this instance and chose to increase their pay in the short term in order to avoid some of the new taxes.&lt;/p&gt;&#xA;" OwnerUserId="6570" LastActivityDate="2017-05-18T10:19:09.897" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34285" PostTypeId="2" ParentId="34283" CreationDate="2017-05-18T11:16:38.100" Score="3" Body="&lt;p&gt;I would have put this in a comment, but it was too long. I wouldn't really classify it as an answer though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are correct that the company paying out \$1 in dividends drops the value of the company by \$1. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are also correct that it is more complicated than this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are some things to consider:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The dividend yields of stocks also drive demand for them, which changes the price.&lt;/li&gt;&#xA;&lt;li&gt;Capital gains tax. If you can sell before the dividend and buyback after, yielding a profit of the dividend amount, then you'll have to pay capital gains tax on that. &lt;/li&gt;&#xA;&lt;li&gt;There are different tax rates in different countries - so why not lend your shares to someone who pays no dividend tax (for a fee), and then get them back after the dividend? Guess what, this happens already (&lt;a href=&quot;https://www.google.co.uk/search?q=dividend+tax+arbitrage&amp;amp;oq=dividend+tax+ar&amp;amp;aqs=chrome.1.69i57j0l5.3380j0j7&amp;amp;sourceid=chrome&amp;amp;ie=UTF-8&quot; rel=&quot;nofollow noreferrer&quot;&gt;dividend tax arbitrage&lt;/a&gt;). And guess what rate people will charge you for this - that's right, it's a bit less than your dividend tax rate.&lt;/li&gt;&#xA;&lt;li&gt;There is actually another even more amazing/ridiculous. Sometimes you have strange local (i.e. per country) laws that influence dividend values even more. &lt;a href=&quot;https://academic.oup.com/rfs/article-abstract/14/3/617/1576827/Cross-Border-Investing-with-Tax-Arbitrage-The-Case?redirectedFrom=fulltext&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;'s a paper about a 42.86% tax credit on German dividends for German shareholders. So guess what, you lend your German shares to a German bank, they collect a larger dividend than you, and share some of the profits with you.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="19663" LastEditorUserId="19663" LastEditDate="2017-05-18T11:47:45.107" LastActivityDate="2017-05-18T11:47:45.107" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34286" PostTypeId="2" ParentId="34283" CreationDate="2017-05-18T11:18:57.467" Score="4" Body="&lt;p&gt;If you assume the same tax rate $\alpha$ for all shareholders, then out of a dividend $D$ the amount $\alpha D$ goes to the government and the amount $(1-\alpha) D$ goes to the shareholders. In a theoretical pure no arbitrage environment, and assuming no interest rate discounting for the sake of simplicity, this would imply that the stock price would go down by $\alpha D$ on the day the dividend is voted by the board, and $(1-\alpha) D$ on the ex-dividend date.&lt;/p&gt;&#xA;" OwnerUserId="17606" LastEditorUserId="17606" LastEditDate="2017-05-18T11:26:48.913" LastActivityDate="2017-05-18T11:26:48.913" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="34287" PostTypeId="2" ParentId="34277" CreationDate="2017-05-18T11:31:47.187" Score="2" Body="&lt;p&gt;From a practitioner standpoint, we know the prices of non accreting swaptions.  The price of the accreting swaption in any model calibrated to these non accreting swaptions, is heavily dependent on the intra curve correlation assumptions in the model.  We check that these correlations are consistent with other correlation dependent markets such as curve options.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-05-18T11:31:47.187" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34290" PostTypeId="2" ParentId="34264" CreationDate="2017-05-18T15:20:21.523" Score="4" Body="&lt;p&gt;With the factor values in Alphalens, what is specifically done is demeaning followed by division by the sum of the absolute values of all the demeaned factors. With some offhand notation, this is more like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \bar{F}_i =\frac{F_i - E[F]}{\sum_{n=1}^N |F_n|} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $F_i$ is the original factor value, $F$ is the set of all original factor values, and $\bar{F}_i$ is our new demeaned and compressed factor value. This new set of $\{\bar{F}_i\}_{i=1}^N$ is then used to construct a factor-weighted portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Our new factor values will now all be centered around the mean, split with about half of them positive and half of them negative. By using the new factor values to determine the weights of their corresponding securities in our portfolios, we create a de facto long-short portfolio. New factor values that are positive will correspond to positive weights (and hence are longed) and new factor values that are negative will correspond to negative weights (and hence are shorted). If you want to read a little more about how the specific function that carries out this &quot;standardization&quot; is defined, check out the docs &lt;a href=&quot;https://github.com/quantopian/alphalens/blob/9d198cf490082cfad3dbbfe65a41c43c8c1a0afc/alphalens/performance.py#L125&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This demeaning and factor-weighting is primarily what makes it long-short.&lt;/p&gt;&#xA;" OwnerUserId="28005" LastActivityDate="2017-05-18T15:20:21.523" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34292" PostTypeId="5" CreationDate="2017-05-18T16:17:37.270" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2017-05-18T16:17:37.270" LastActivityDate="2017-05-18T16:17:37.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34293" PostTypeId="4" CreationDate="2017-05-18T16:17:37.270" Score="0" Body="Greeks are named quantities representing sensitivity of option price to change in underlying parameters. Use of [greeks] tag should relate to one more named quantities, such as delta or gamma. " OwnerUserId="15247" LastEditorUserId="15247" LastEditDate="2017-05-18T17:16:47.363" LastActivityDate="2017-05-18T17:16:47.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34294" PostTypeId="2" ParentId="30271" CreationDate="2017-05-18T19:05:07.940" Score="0" Body="&lt;p&gt;You want to price the HY options given spread vols and other inputs. First of all, you need to understand HY indices are quoted in prices rather than spreads. With spread vols, you essentially assumed the spread dynamics, but your pay off is related to the price (or upfront payment). So you need to first derive the price dynamics from the spread dynamics using Ito's lemma. Then you should be able to calculate expected payoff under the right measure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe Bloomberg and some other firms are currently using this approach. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if you are able to get price vols, things become easier, because you  have price dynamics automatically and can simply plug in to the Blacks Formula. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a couple of other complications you need to consider in credit index option pricing. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;front end protection; &lt;/li&gt;&#xA;&lt;li&gt;possible zero numeraire. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;A more interesting problem is to price IG options. IG indices are quoted in spreads. And you don't have an easy way to price them since you need to run a spread to upfront conversion on the exercise date to make the exercise decision. Please check out this paper on SSRN, &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2616370&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2616370&lt;/a&gt; &#xA;which provides an alternative approach to solve the problem.&lt;/p&gt;&#xA;" OwnerUserId="28007" LastActivityDate="2017-05-18T19:05:07.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34295" PostTypeId="2" ParentId="34254" CreationDate="2017-05-18T20:20:56.200" Score="4" Body="&lt;p&gt;This may seem obvious but, this is how:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Party A (People with well-established relationships with prime brokerage (&quot;PB&quot;) directors within PB's) gather information from Party B (PB directors or higher up).  PB directors have the info.  What they receive for disseminating it varies by the nature of the relationship they have/had with Party A.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Party B has the info because when you operate as an investment management vehicle, you need to disclose certain things about yourself before the PB even accepts you as a client--you can't just open up an account at any PB with $10,000 because you feel like it; this isn't Scottrade we are talking about.  What gets disclosed by the investment manager's is often far more than should be disclosed--such as who their investor bases/capital sources are.  For example, if someone says that they have a rich, old, white man from Nebraska who owns a large insurance/holding company as an investor and proceeds to buy millions of shares of a company such as IBM it doesn't take a genius to understand what is going on.  This happens pretty much as plainly as I am hypothetically suggesting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After that, Party B is supposed to keep what they know confidential.  This does not always happen, naturally.  If you are Party A and are well connected to many Party B's you can parse all relevant info together and know what &quot;Blue Horseshoe&quot; is doing with relative ease.  I say many Party B's because even though the most sophisticated investors operate under different entities within many PB's, wall street is not as big a place as many people think and when multiple people are hunting the same animal for the same reason, that animal gets caught.  People talk, especially when PB directors know which accounts to keep on their screen and are being compensated (in one way or another) to do so.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Stock watch firms&quot; are apparitions.  They don't exist for anyone to know about publicly or for any sort of small fee.  They are the old boys club reincarnated.  The ones that do &quot;exist&quot; are not well connected and are frauds.  By that I mean they are fraudulently impersonating people who are engaging in illegal acts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wouldn't have answered this save for the fact that there seems to be a decent amount of interest in this question.  Call this whatever you wish but like it or not, it is a reality.&lt;/p&gt;&#xA;" OwnerUserId="26556" LastActivityDate="2017-05-18T20:20:56.200" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34298" PostTypeId="1" CreationDate="2017-05-18T21:15:48.037" Score="4" ViewCount="8957" Body="&lt;p&gt;Since Yahoo has decided to yank their API for the foreseeable future, I'm attempting to switch to Google finance.  I'm having trouble downloading a .csv file for GSPC (S&amp;amp;P 500), despite there clearly being a website and table set up for it.  The website is here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.google.com/finance/historical?q=INDEXSP:.INX&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.google.com/finance/historical?q=INDEXSP:.INX&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Theoretically, I should be able to add &quot;&amp;amp;output=csv&quot; to it, and it should download it as a .csv:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.google.com/finance/historical?q=INDEXSP:.INX&amp;amp;output=csv&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.google.com/finance/historical?q=INDEXSP:.INX&amp;amp;output=csv&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No dice.  Does anyone know what is going on here?  Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="19504" LastActivityDate="2017-09-14T02:11:33.003" Title="Downloading S&amp;P historical data from Google" Tags="&lt;programming&gt;&lt;google&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34299" PostTypeId="1" CreationDate="2017-05-18T21:22:56.787" Score="1" ViewCount="217" Body="&lt;p&gt;I have tried to implement an AAD routine to price call options using the Black-Scholes formula, but my greeks are not quite agreeing with the expected ones, so I have decided to start with something a bit simpler.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming that I know all the discount factors and forward points (so that that I do not need to use any interpolation routine), what would be the best way to implement an &lt;strong&gt;IRSwap pricer&lt;/strong&gt; using AAD? Any particular points I should bear in mind? &lt;/p&gt;&#xA;" OwnerUserId="15099" LastActivityDate="2017-05-18T21:22:56.787" Title="Adjoint Algorithmic Differentiation: swap pricing" Tags="&lt;greeks&gt;&lt;interest-rate-swap&gt;&lt;numerical-methods&gt;&lt;algorithm&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34300" PostTypeId="1" CreationDate="2017-05-18T13:28:10.473" Score="3" ViewCount="133" Body="&lt;p&gt;In a 4 period binomial model, I have a lookback put option that pays $\left [M_{4}-4  \right ]^{+}$, where $M_{4}$ is the maximum price reached during the sequence of 4 trials.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets say the starting price = 4, the number of trials = 4. The up-factor is 2 and down factor 1/2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My idea to find the expected value of the option was to first find the number of paths that only reached (and did not exceed) each level, so:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Level 1 or a price of $M_{4}=8$, I would have $ n \cdot \left [ 8-4 \right ]$ payoffs for this level.&lt;/li&gt;&#xA;&lt;li&gt;Level 2 or a price of $M_{4}=16$, I would have $ o \cdot \left [ 16-4 \right ]$ payoffs for this level.&lt;/li&gt;&#xA;&lt;li&gt;Level 3 or a price of $M_{4}=32$, I would have $ p \cdot \left [ 32-4 \right ]$ payoffs for this level.&lt;/li&gt;&#xA;&lt;li&gt;Level 4 or a price of $M_{4}=64$, I would have $ 1 \cdot \left [ 64-4 \right ]$ payoffs for this level.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Here's the problem&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take for example Level 1:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;P(equaling level 1 at T=4) = 0, there are no paths that end at 1 after 4 trials.&lt;/li&gt;&#xA;&lt;li&gt;P(reaching level 1, but ending at or below level 1) = $\frac{4!}{(4-3)!3!} + \frac{4!}{(4-4)!4!}=5$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;However one of those 5 paths exceeds level 1, even though the path ends at level 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hopefully the graph below illustrates the problem. Both paths end at level 0 (or 4), but the pink path breached level 1 and its payoff would be (16-4) instead of (8-4) for the green path.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/YLhiC.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/YLhiC.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Naturally if the number of periods grow, there could be many more than 1 path that does this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Said another way, how do I calculate the number of red paths in an N period model?&lt;/p&gt;&#xA;" OwnerUserId="20875" OwnerDisplayName="Tejay Lovelock" LastActivityDate="2017-06-29T00:59:55.913" Title="Looback Put Option - finding the number of paths that reach each level" Tags="&lt;binomial&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34301" PostTypeId="2" ParentId="23230" CreationDate="2017-05-19T05:04:18.920" Score="0" Body="&lt;p&gt;To construct a zero rate curve the first step needed is to build a IR curve using Cash,FRAs/Future,Swap rates. Second step is to form a Discount  factor curve from these rates which is continuous(as the IR curve built is non continuous due to Future). Third step is to compute Zero curve from this discount curve which will be continuous in nature and ca be used for generating cash flows.&lt;/p&gt;&#xA;" OwnerUserId="28014" LastActivityDate="2017-05-19T05:04:18.920" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34302" PostTypeId="2" ParentId="34213" CreationDate="2017-05-19T05:50:04.057" Score="0" Body="&lt;p&gt;I think I finally got it. First I simply subtracted Clean Prices from Dirty Prices to get Accrued Interest. Then for each date where $ \mathrm{AccruedInterest}_{t} &amp;lt; \mathrm{AccruedInterest}_{t-1} $ I did $ \mathrm{DirtyPrice}_{t-1} = \mathrm{CleanPrice}_{t} $. The result is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/3UGp7.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/3UGp7.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bear in mind that I am looking at &quot;BB-&quot; rated countries' bonds here. I am still open if there are any comments/suggestions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the weekly average Yield of these bonds:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/tisgg.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/tisgg.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19096" LastEditorUserId="19663" LastEditDate="2017-05-19T11:16:08.307" LastActivityDate="2017-05-19T11:16:08.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34303" PostTypeId="1" CreationDate="2017-05-19T06:42:49.287" Score="1" ViewCount="740" Body="&lt;p&gt;a YOY inflation swaplet payoff is S2/S1 - 1 , where Si is the CPI at time i&#xA;and a TRS (total return swaplet) asset leg payoff is also the same except the underlying is an asset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it seems to me that the modelling for both should be identical, assuming you use the same model for each.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but i understand that typically , in TRS modelling S is GBM , with drift and vol dependent on t so E(S2/S1) = E(S2)/E(S1)=F2/F1 (ie no convexity adj)&#xA;whereas in inflation , there is or is NOT a convexity adjustment , dependent on the model used!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i do not understand this for inflation - surely it cannot be that there can be 2 answers!  &lt;/p&gt;&#xA;" OwnerUserId="17348" LastEditorUserId="17348" LastEditDate="2017-05-22T13:54:43.077" LastActivityDate="2017-05-22T13:54:43.077" Title="convexity adjustment in YOY inflation swap , compared with TRS, and considering autocorrelation" Tags="&lt;inflation&gt;&lt;convexity&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34304" PostTypeId="2" ParentId="34303" CreationDate="2017-05-19T08:03:33.793" Score="2" Body="&lt;p&gt;You get a convexity adjustment from forward correlations only if you model separately the forwards and they are not perfectly correlated on the time interval $[0, T_1]$, as is the case in inflation market models where each forward CPI index is modelled separately from the others, with a global instantaneous correlation structure, &lt;strong&gt;not&lt;/strong&gt; set to identity, similar to the correlation structure in the Libor Market Model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason for using a market model approach for inflation is that the CPI itself is not a tradable asset anyway so we do not need a model that would start from the CPI as a state variable, and the market model provides a better fit to quoted derivatives. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of a TRS swaplet where $S_1$ and $S_2$ represent the prices of the &lt;strong&gt;same&lt;/strong&gt; asset on times $T_1$ and $T_2$, and assuming deterministic rates and dividends and a diffusion process for the asset price $S_t$, the forwards are perfectly correlated on the time interval $[0, T_1]$ so there is no convexity adjustment that would come from decorrelation.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is of course another convexity adjustment that arises when rates are stochastic because the expectation is computed under the $T_2$ terminal measure and the first forward is a martingale only under the $T_1$ measure. &lt;/p&gt;&#xA;" OwnerUserId="17606" LastEditorUserId="17606" LastEditDate="2017-05-22T13:52:57.770" LastActivityDate="2017-05-22T13:52:57.770" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34305" PostTypeId="1" AcceptedAnswerId="34326" CreationDate="2017-05-19T11:13:08.347" Score="0" ViewCount="627" Body="&lt;p&gt;Let say that I have access to continuous daily time series for 20+ years of data for E-mini S&amp;amp;P 500 Index Futures. I have a long/short strategy to backtest that places orders either on open or close. The management of the margin has an impact over the performance of the backtest and I am unsure about how to model the margin.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;How to model margin calls? E.g. is it best practice to use the whole capital to buy as many contract as possible, or buy contracts using half capital and to invest the remaining half in treasury bonds to be used as collateral in case of margin calls?&lt;/li&gt;&#xA;&lt;li&gt;How to model interest rate on margin? E.g. is it best practice to assume no interest rate on margin or to use the 3 month t-bill rate?&lt;/li&gt;&#xA;&lt;li&gt;How to model margin withdrawals? E.g. is it best practice to assume to reinvest the excess on margin in new contracts whenever possible?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;A potential solution for points 1 and 3 could be to assume to restore the margin to the initial margin at the end of day and to reinvest the excess liquidity in new contracts or to sell contracts when liquidity is needed to restore the margin.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answer should target the best practices while not being too much error prone to be implemented in python and fairly representative of the historical performance.&lt;/p&gt;&#xA;" OwnerUserId="28016" LastActivityDate="2017-05-21T14:22:40.490" Title="Margin modelling to backtest futures investment strategy" Tags="&lt;futures&gt;&lt;backtesting&gt;&lt;modelling&gt;&lt;cme&gt;&lt;margin&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34306" PostTypeId="2" ParentId="34298" CreationDate="2017-05-19T12:58:30.027" Score="1" Body="&lt;p&gt;You can't download the S&amp;amp;P data from Google finance like you can with stock or ETF data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you navigate to &lt;a href=&quot;https://www.google.com/finance/historical?q=NYSEARCA%3ASPY&amp;amp;ei=L-keWcHYIdGSmgHtu5rYDw&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.google.com/finance/historical?q=NYSEARCA%3ASPY&amp;amp;ei=L-keWcHYIdGSmgHtu5rYDw&lt;/a&gt; you will notice the link to download to a .csv on the right.  If you add &amp;amp;output=csv to the above URL it will download the SPY data to a .csv&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Compare this to&#xA;&lt;a href=&quot;https://www.google.com/finance/historical?q=INDEXSP%3A.INX&amp;amp;ei=D-keWcn2JIeEmAGJ14qwCA&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.google.com/finance/historical?q=INDEXSP%3A.INX&amp;amp;ei=D-keWcn2JIeEmAGJ14qwCA&lt;/a&gt; This link for S&amp;amp;P 500 Index data does not have the link on the right to download to .csv.  You would have to scrape it out which is never ideal.&lt;/p&gt;&#xA;" OwnerUserId="26556" LastEditorUserId="16148" LastEditDate="2017-05-19T13:33:08.073" LastActivityDate="2017-05-19T13:33:08.073" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34310" PostTypeId="1" AcceptedAnswerId="34311" CreationDate="2017-05-20T10:29:25.740" Score="1" ViewCount="159" Body="&lt;p&gt;Good morning. I would like to ask you some clarifications about the &quot;quotations&quot; of Treasury Bills and Treasury Bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quoting &quot;J.C. Hull&quot;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In general, the relationship between the cash price and quoted price&#xA;  of a Treasury bill in the United States is&#xA;  $$P=\frac{360}{n}(100-Y)$$&#xA;  where P is the quoted price, Y is the cash price, and n is the&#xA;  remaining life of the Treasury bill measured in calendar days.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;So the quotation in this case is equivalent to the yield?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The quoted price of Treasury bond, which traders refer to as the clean&#xA;  price, is not the same as the cash price paid by the purchaser of the&#xA;  bond, which is referred to by traders as the dirty price. In general:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Cash price = Quoted price + Accrued interest since last coupon date&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;But, in this case, how is the &quot;Quoted price&quot; determined?  Is it equivalent to bond yield, applying the same formula?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="27078" LastActivityDate="2017-05-20T12:48:37.083" Title="Clarifications about the &quot;quotations&quot; of Treasury Bills and Treasury Bonds" Tags="&lt;interest-rates&gt;&lt;bond&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34311" PostTypeId="2" ParentId="34310" CreationDate="2017-05-20T12:48:37.083" Score="1" Body="&lt;p&gt;Treasury Bills:&#xA;$P$ is not the yield because it's calculated with a nominal of 100. $100 \cdot P/Y$ is something like the simple yield of the bill.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Treasury Bond:&#xA;You calculate the quoted price from the cash price not the other way around:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quoted price = Cash price - Accrued&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The quoted price for bonds has nothing to do with the yield as you can easily see if you look at some clean prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In both cases is the relevant price the cash price. That is the amount of money that will actually change hands. But because traders like it opaque they do not quote the cash price but instead some 'quoted price' that is calculated from the cash price. But one can be converted into the other.&lt;/p&gt;&#xA;" OwnerUserId="22686" LastActivityDate="2017-05-20T12:48:37.083" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="34313" PostTypeId="1" AcceptedAnswerId="34318" CreationDate="2017-05-20T16:50:34.163" Score="-1" ViewCount="664" Body="&lt;p&gt;In a momentum strategy, every month you form a portfolio of winners. Each of these portfolio you hold for K months. So after K months you sell the 1st portfolio, after K+1 months you sell the next and so on.&#xA;This results in a K-monthly return, every month. How do you cumulate these returns over time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Imagine you keep every portfolio 12 months.&#xA;After 1 year you start selling these portfolios every month, resulting in returns (1+r) of for example 1.07 , 1.065 , 1.067, ...&#xA;What is the cumulative return? 1.07 x 1.065 x 1.067 x ... ? Or something else?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance!&lt;/p&gt;&#xA;" OwnerUserId="28034" LastActivityDate="2017-05-20T23:59:48.130" Title="Momentum strategy cumulation of K-monthly returns over multiple months" Tags="&lt;returns&gt;&lt;momentum&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2017-05-21T06:57:44.097" ContentLicense="CC BY-SA 3.0" />
  <row Id="34314" PostTypeId="2" ParentId="29626" CreationDate="2017-05-20T17:23:49.840" Score="1" Body="&lt;p&gt;I think the proof has already been provided at the end of the proof in Shreve's Theorem 4.4.5. Specifically, note that, since &#xA;\begin{align*}&#xA;\frac{1}{(1+r)^{n \wedge \tau^*}}V_{n \wedge \tau^*}.&#xA;\end{align*}&#xA;is a martingale, &#xA;\begin{align*}&#xA;\tilde{\mathbb{E}}\left(\frac{1}{(1+r)^{N \wedge \tau^*}}V_{N \wedge \tau^*}\right) &amp;amp;= V_0 = \max_{\tau \in S_0} \tilde{\mathbb{E}}\left(\mathbb{I}_{\{\tau \leq N\}}\frac{1}{(1+r)^{\tau}}G_{\tau}\right).\tag{1}&#xA;\end{align*}&#xA;On the other hand,&#xA;\begin{align*}&#xA;&amp;amp;\ \tilde{\mathbb{E}}\left(\frac{1}{(1+r)^{N \wedge \tau^*}}V_{N \wedge \tau^*}\right) \\&#xA;=&amp;amp;\ \tilde{\mathbb{E}}\left(\mathbb{I}_{\{\tau^* \leq N\}} \frac{1}{(1+r)^{\tau^*}}V_{\tau^*}\right) + \tilde{\mathbb{E}}\left(\mathbb{I}_{\{\tau^* =\infty\}} \frac{1}{(1+r)^N}V_N\right)\\&#xA;=&amp;amp;\ \tilde{\mathbb{E}}\left(\mathbb{I}_{\{\tau^* \leq N\}} \frac{1}{(1+r)^{\tau^*}}V_{\tau^*}\right),\tag{2}&#xA;\end{align*}&#xA;as, on $(\tau^* =\infty)$, $V_N=0$. Combining $(1)$ and $(2)$, we conclude that&#xA;\begin{align*}&#xA;\tilde{\mathbb{E}}\left(\mathbb{I}_{\{\tau^* \leq N\}} \frac{1}{(1+r)^{\tau^*}}V_{\tau^*}\right) = \max_{\tau \in S_0} \tilde{\mathbb{E}}\left(\mathbb{I}_{\{\tau \leq N\}}\frac{1}{(1+r)^{\tau}}G_{\tau}\right),&#xA;\end{align*}&#xA;that is, the maximum is achieved at $\tau^*$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2017-05-20T17:23:49.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34315" PostTypeId="1" CreationDate="2017-05-20T23:22:24.647" Score="0" ViewCount="125" Body="&lt;p&gt;The description of an argument of Quantopian's fetch_csv() function is the following:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A well-formed http or https url pointing to a CSV file that has a header, a date column, and &lt;strong&gt;a symbol column&lt;/strong&gt; (symbol column required to match data to securities).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How can my CSV possibly have BOTH a date column and a symbol column?  In my CSV, (created using pandas.DataFrame's to_csv() function), the dates occupy a column, but the symbols constitute a &lt;em&gt;row&lt;/em&gt;, and it is blatantly obvious that if the dates are in a column, the symbols cannot also be.  Can anyone explain this to me?  Thank you.&lt;/p&gt;&#xA;" OwnerUserId="28039" LastEditorUserId="28040" LastEditDate="2017-05-21T05:44:35.257" LastActivityDate="2017-05-21T09:40:40.923" Title="Quantopian's fetch_csv()" Tags="&lt;csv&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34316" PostTypeId="1" CreationDate="2017-05-20T23:23:21.383" Score="3" ViewCount="220" Body="&lt;p&gt;I would like to be sure of my correct understanding of some basic principles.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have following example, data from Euronext:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 Month maturity, future and options are same day expiry. Strike 5400.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Future price: 5407.&#xA;Put: 28.8&#xA;Call: 20.1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We construct following portfolio: Long Call, Short Put, Short Future. This yields zero underlying exposure, and $+28.8-20.1=+8.7$ index points in cash equivalent.&#xA;Now whatever the final spot is at maturity date, I am  effectively gathering 15.2 index points:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Final spot 5400:+7 on Futures + 8.7 in cash&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Final spot at 5447. Call +47, +8.7 in cash,  -40 on Futures.&#xA;etc...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I missing something? In school was told this shouldn't happen in real life&lt;/p&gt;&#xA;" OwnerUserId="28038" LastActivityDate="2017-05-24T06:30:26.923" Title="Arbitrage free option prices: real life example" Tags="&lt;arbitrage&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34317" PostTypeId="1" CreationDate="2017-05-20T23:39:53.677" Score="2" ViewCount="68" Body="&lt;p&gt;I am interested in reduced rank / matrix factorisation techniques and their uses across finance and portfolio optimisation. For example, PCA might be used to reduce the number of components you are dealing with or to suggestion correlation between by doing clustering, what might e.g. LU decomposition be useful for, how about non-negative matrix decomposition, ICA and other decompositions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for any ideas or suggestions. &#xA;Some suggestions: &lt;a href=&quot;https://en.wikipedia.org/wiki/Low-rank_approximation&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Low-rank_approximation&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26223" LastEditorUserId="26223" LastEditDate="2017-05-21T00:26:07.037" LastActivityDate="2017-05-21T00:26:07.037" Title="Reduced rank / matrix factorisation techniques and their uses in portfolio optimisation?" Tags="&lt;quant-trading-strategies&gt;&lt;statistics&gt;&lt;pca&gt;&lt;covariance-matrix&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34318" PostTypeId="2" ParentId="34313" CreationDate="2017-05-20T23:59:48.130" Score="0" Body="&lt;p&gt;There are various ways to do this calculation.  The &quot;K equal sub-portfolios, buy and hold&quot; method was used by Jegadeesh and Titman in their 1993 paper (they also mentioned another method, the &quot;monthly rebalancing&quot; method but did not show results from that method in the paper).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The method is relatively simple, but only an approximation of real investing. At the end of each month you form a sub-portfolio and hold it for K months. This generates K numbers, which are the buy and hold portfolio returns for each of the next K months.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now consider how to determine the returns for the strategy for a specific calendar month, such as May 2017. During this month you hold K sub-portfolios: The newest is the sub-portfolio that was formed at the end of April 2017, then there is one a little older that was formed in March 2017, and so on, until you get to a sub-portfolio formed K months ago, which is about to be liquidated at the end of this month. Jegadeesh and Titman &lt;em&gt;assume&lt;/em&gt; that you hold these sub-portfolios with equal weights, so they find they the return for the strategy for May 2017 by simply averaging the May 2017 returns for these K sub-portfolios.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-05-20T23:59:48.130" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34319" PostTypeId="1" AcceptedAnswerId="34332" CreationDate="2017-05-21T04:05:30.893" Score="2" ViewCount="850" Body="&lt;p&gt;Calculating the normalized (e.g., percent or logarithmic) return on investment on a long (equity, call option, etc...) position is fairly simple. The percent return on investment for any position which costs $\mathbb{P_t}$ is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_{long} = \frac{\mathbb{P}_T-\mathbb{P}_t}{\mathbb{P}_t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where, $\mathbb{P}$ is the Numeraire property of a position (and thereby discounts interest payments and/or dividends).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This property is &quot;calcuable&quot; simply because the upfront cost of the position is finite. However, the position cost of a short seems to be undefined. Rather, one who shorts an instrument, including options, receives $\mathbb{P_t}$, so the percent PnL seems to be undefined:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_{short} = \frac{\mathbb{P}_t-\mathbb{P}_T}{0} = \text{undef.}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This intuition is backed by the possibility of infinite loss on a short. The PnL of a short put, on the other hand, is slightly better defined because the maximum risk is equivalent to long equity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are some ways to calculate a normalized and/or risk-adjusted PnL on a short position? Is there any way to calculate initial investment as capital at risk.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastActivityDate="2017-05-22T02:48:12.090" Title="What is an accepted method to calculate percent PnL from a short position?" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;performance-evaluation&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34320" PostTypeId="2" ParentId="34315" CreationDate="2017-05-21T06:00:29.563" Score="2" Body="&lt;p&gt;It might be allowing you to upload, via CSV, values for multiple dates and multiple securities, all in one go. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Think about how you would format the columns if you had 4 dates of values for stockA and 10 dates of values for stockB&lt;/p&gt;&#xA;" OwnerUserId="27516" LastActivityDate="2017-05-21T06:00:29.563" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34322" PostTypeId="2" ParentId="34199" CreationDate="2017-05-21T08:30:24.613" Score="2" Body="&lt;p&gt;Adding to @Gordon's mathematical explanation I want to give some intuition:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason that the mid-point renders the correction term $0$ is that when you take the &lt;em&gt;right-hand&lt;/em&gt; point you get a result like the Ito integral but with a &lt;em&gt;negative&lt;/em&gt; correction term (because now you kind of look “from the future into the past” where you have the same effect from convexity – but “in the other direction”!). The Stratonovich integral is just the arithmetic mean of the two and therefore loses the correction term!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I updated the following paper accordingly, the details can be found on page 14:&lt;br&gt;&#xA;von Jouanne-Diedrich, Holger, Ito, Stratonovich and Friends (May 18, 2017). Available at SSRN: &lt;a href=&quot;https://ssrn.com/abstract=2956257&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://ssrn.com/abstract=2956257&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2017-05-21T08:30:24.613" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34323" PostTypeId="2" ParentId="34315" CreationDate="2017-05-21T09:40:40.923" Score="2" Body="&lt;p&gt;for example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;your file:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#N/A,     SX5E&#xA;20170519, 3590&#xA;20170518, 3585&#xA;20170517, 3586&#xA;20170516, 3583&#xA;20170515, 3582&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now say we have SX5E and also N225 - they have different holidays, so you might (in your format) have something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#N/A,     SX5E, N225&#xA;20170519, 3590, 19600&#xA;20170518, 3585, 19590&#xA;20170517, 3586, #N/A&#xA;20170516, 3583, 19596&#xA;20170515, 3582, 19589&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the format they're asking for sounds more like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Date, Ticker, Value&#xA;20170519, SX5E, 3590&#xA;20170518, SX5E, 3585&#xA;20170517, SX5E, 3586&#xA;20170516, SX5E, 3583&#xA;20170515, SX5E, 3582&#xA;20170519, N225, 19600&#xA;20170518, N225, 19590&#xA;20170516, N225, 19596&#xA;20170515, N225, 19589&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="19663" LastActivityDate="2017-05-21T09:40:40.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34325" PostTypeId="1" CreationDate="2017-05-21T11:22:36.793" Score="-1" ViewCount="420" Body="&lt;p&gt;I used the ugarchroll in rugarch packages and got a strange error:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;code&gt;Error in ans$res: $ operator is invalid for atomic vectors&lt;/code&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But I don't have &lt;code&gt;$&lt;/code&gt; in my code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(rugarch)&#xA;spec = ugarchspec(variance.model = list(model = &quot;sGARCH&quot;, garchOrder = c(1,1),&#xA;       submodel = NULL , external.regressors = NULL, variance.targeting = FALSE),&#xA;      mean.model = list(armaOrder = c(2,0), include.mean = F, archm = F,&#xA;      archpow = 1,arfima = F, external.regressors = NULL, archex = FALSE),start.pars = list(), fixed.pars&#xA;      = list(),distribution.model = &quot;norm&quot;)&#xA;&#xA;rollgarch_n=ugarchroll(spec,data1return, n.ahead = 1, forecast.length = 500,&#xA;   refit.every = 21,refit.window = &quot;moving&quot;, solver = &quot;hybrid&quot;, solver.control = &#xA;     list(trace = TRUE),calculate.VaR = TRUE, VaR.alpha = 0.01, &#xA;   keep.coef = TRUE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="28044" LastEditorUserId="848" LastEditDate="2017-05-21T14:24:35.100" LastActivityDate="2017-05-22T10:27:39.967" Title="Got &quot;Error in ans\$res: \$ operator is invalid for atomic vectors&quot; when rolling forecast using rugarch" Tags="&lt;forecast&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34326" PostTypeId="2" ParentId="34305" CreationDate="2017-05-21T13:19:34.130" Score="0" Body="&lt;p&gt;The amount of margin required by the exchange per futures contract is not a good guide to position sizing. It is designed to protect &lt;em&gt;the&lt;/em&gt; &lt;em&gt;exchange&lt;/em&gt; from your failure during a particularly bad day. Using this much leverage is too dangerous especially if your trades last many days; you will usually want to trade less than the maximum allowed number of contracts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The trade sizing problem in futures trading is: if you have $E$ dollars in your futures trading account at time t, how many contracts should you buy/sell on your next trade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are broadly speaking two approaches (with many variants and intermediate cases possible):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Fixed Fraction position sizing method due to Ralph Vince (1990), is based on risk management considerations only. You must take a position small enough that you could survive N consecutive losses without depleting your account. Vince said you estimate the worst loss per contract $L$ using historical data and then the number of contracts to trade is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\textbf{contracts} = \frac{1}{N}\frac{E}{|L|}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Vince recommended that the fraction $f=\frac{1}{N}$ should be set to 0.05 (i.e. $\frac{1}{20}$). Some people recommend 0.10 if you are willing to take a high level of risk. It seems reasonable to estimate $L$ using 95% ValueAtRisk over the relevant trade horizon rather than the biggest loss in your backtest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A more advanced method of position sizing is based on the Kelly Criterion and its variants. This involves optimizing the long term rate of growth, and requires knowing the distribution of gains and losses (instead of just the biggest loss). It has the desirable property that bigger bets are taken for a trading system that is particularly profitable (and no bets at all for one that just breaks even). See &lt;a href=&quot;https://en.wikipedia.org/wiki/Kelly_criterion&quot; rel=&quot;nofollow noreferrer&quot;&gt;Kelly Criterion&lt;/a&gt;. A drawback is that it is difficult to estimate the parameters accurately; in my experience the profitability of a system tends to be overestimated when it is first developed, due to a variety of psychological and statistical biases. For this reason I recommend the risk based methods, at least to start with.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2017-05-21T14:22:40.490" LastActivityDate="2017-05-21T14:22:40.490" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34329" PostTypeId="1" CreationDate="2017-05-21T16:00:58.443" Score="3" ViewCount="4809" Body="&lt;p&gt;I am checking a few bonds on the YAS page on Bloomberg and I can see that G is higher than Z spread (this applies to bonds with optionality and bullet, too). As Z is stripped from reinvestment risk, shouldnt G be higher provided that equals credit risk + reinvestment risk? Thank you, much appreciated if anyone can clarify this for me. &lt;/p&gt;&#xA;" OwnerUserId="27969" LastActivityDate="2019-03-17T23:45:46.533" Title="Why is G spread bigger than Z spread theoretically?" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;spread&gt;&lt;bond-yields&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34332" PostTypeId="2" ParentId="34319" CreationDate="2017-05-22T02:48:12.090" Score="4" Body="&lt;p&gt;A short position is a liability on your books, as the borrowed asset has to be returned to the owner. The return is then the percentage return of that liability.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume that the shorted asset at initial time $t_0$ has price $p(t_0)$. The initial liability is then $p(t_0)$. At a future time $t$ the liability is $p(t)$. The return at time $t$ is hence&#xA;$$&#xA;r(t,t_0) = \frac{p(t_0)-p(t)}{p(t_0)}&#xA;$$&#xA;So if the asset decline in price the return is positive, and if the asset goes up in price the return is negative. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition to this would be any return you might generate on the capital received through the short sale. Without leverage, this capital is held as collateral against the liability.&lt;/p&gt;&#xA;" OwnerUserId="5107" LastActivityDate="2017-05-22T02:48:12.090" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34333" PostTypeId="1" CreationDate="2017-05-22T04:11:04.543" Score="1" ViewCount="183" Body="&lt;p&gt;I'm trying to understand what makes a realized volatility estimate tradeable. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quoting from an abstract &lt;code&gt;&quot;I define an estimate as &quot;tradable&quot; if it is attainable from a static position in options a dynamic trading of the underlying.&quot;&lt;/code&gt; An example of a tradeable estimate is giving by this presentation here &lt;a href=&quot;http://www.cboe.com/rmc/2015/CBOE-Bruno-2015.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.cboe.com/rmc/2015/CBOE-Bruno-2015.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not understand what makes this tradable.&lt;/p&gt;&#xA;" OwnerUserId="1764" LastActivityDate="2017-05-22T08:32:27.013" Title="What makes a realized vol estimate &quot;tradeable&quot;?" Tags="&lt;volatility&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34335" PostTypeId="2" ParentId="34333" CreationDate="2017-05-22T08:32:27.013" Score="1" Body="&lt;p&gt;The full abstract is &lt;a href=&quot;http://engineering.columbia.edu/financial-engineering-practitioners-seminar-bruno-dupire-79515&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Title: Tradable Estimates of Historical VolatilityAbstract: There are&#xA;  many estimates of historical volatility, based on time samples, price&#xA;  level samples, on high and low. I define an estimate as &quot;tradable&quot; if&#xA;  it is attainable from a static position in options a dynamic trading&#xA;  of the underlying. I characterize the unbiased tradable estimates,&#xA;  show that the difference of two of them is a costless dynamic strategy&#xA;  and show how the daily/weekly trade performs on various time&#xA;  periods.The usual estimates based on high and low are not tradable.&#xA;  Surprisingly, it is not because high and low are not stopping times&#xA;  but because they do not depend quadratically on the final value. I&#xA;  introduce a new high and low based estimate that is tradable and&#xA;  unbiased.I conclude by using the newly developed Functional Ito&#xA;  Calculus to characterize the contingent claims that can be replicated&#xA;  by a model free strategy of dynamically trading the stock.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;They are just arbitrarily defining &lt;em&gt;tradable&lt;/em&gt; to be a specific subset of tradable. This is just a practicality thing - one could happily set up some OTC contract on whatever they want, the same way you can walk into a bookie and set up a &lt;em&gt;trade&lt;/em&gt; on a completely arbitrary event with them. Technically this means that anything is tradable if you can find someone to take the other side; that does &lt;em&gt;not&lt;/em&gt; make it practical.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's also a data thing. By stipulating that it is a static position of options and dynamic holding of the underlying, the estimator becomes something that is actually useful to people with the required data to use it - I could create the perfect model of the financial markets if i were omniscient, but it would be of no use to you (assuming you're not also omniscient).&lt;/p&gt;&#xA;" OwnerUserId="19663" LastActivityDate="2017-05-22T08:32:27.013" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34336" PostTypeId="2" ParentId="34325" CreationDate="2017-05-22T10:27:39.967" Score="1" Body="&lt;p&gt;I was running into the same error until I realized I had some NAs in the series of returns I was trying to model/forecast. After removing NAs the code worked perfectly. I hope this will solve your problem&lt;/p&gt;&#xA;" OwnerUserId="28061" LastActivityDate="2017-05-22T10:27:39.967" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34337" PostTypeId="1" AcceptedAnswerId="34402" CreationDate="2017-05-22T11:01:47.410" Score="0" ViewCount="108" Body="&lt;p&gt;As it is often presented, Extreme Value Theory (EVT) is applied to financial losses (and gains as well, but always focusing in the tails). By EVT, I especially refer to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Mean excess plot to find an appropriate threshold&#xA;2) Generalized Pareto Distribution (GPD) to fit to the data in the tail, beyond the estimated threshold in 1).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: does it make sense to apply steps 1) and 2) to daily (arithmetic) returns, and not to PnL?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have also seen some cases where steps 1) and 2) are applied to the residuals of a fitted model, e.g. ARMA or GARCH.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which approach is the best?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="26595" LastEditorUserId="26595" LastEditDate="2017-05-25T11:52:48.697" LastActivityDate="2017-05-26T05:27:50.940" Title="Extreme Value Theory: GPD application to returns, not losses (PnL)?" Tags="&lt;pareto-distribution&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34338" PostTypeId="2" ParentId="17864" CreationDate="2017-05-22T15:06:13.087" Score="-2" Body="&lt;p&gt;My understanding is it can be a negative for European options  (US can ONLY be positive)  From what I found a negative can happen when price insurance can be purchased against the underlying commodity, for example&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OIL Jan 19 2018 4 Call  242 Days to Expiration&lt;br&gt;&#xA;Bid 1.50    Ask 1.70    Bid/Ask Size 2054 X 1108    Open Interest 3,085 &#xA;Implied volatility 29.59    Time value -0.09&lt;/p&gt;&#xA;" OwnerUserId="28065" LastEditorUserId="28065" LastEditDate="2017-05-23T16:26:20.380" LastActivityDate="2017-05-23T16:26:20.380" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34339" PostTypeId="2" ParentId="29626" CreationDate="2017-05-22T18:44:46.070" Score="0" Body="&lt;p&gt;A year ago, I was not able to understand the following.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First Shreve defines $V_n$ as follows:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Definition 4.4.1.&lt;/strong&gt; For each $n, n = 0,1,\cdots, N$, let $G_n$ be a random variable depending on the first $n$ coin tosses. An American derivative security with intrinsic value process $G_n$ is a contract that can be exercised at any time prior to and including time $N$ and, if exercised at time $n$, pays off $G_n$. We define the price process $V_n$ for this contract by the American risk-neutral pricing formula   $$V_n= \max_{\tau \in \mathcal{S}_n} \widetilde{\mathbb{E}}_n\Big[\mathbb{I}_{\{\tau \leq N\}}\frac{G_\tau}{(1+r)^{\tau-n}} \Big], \: n = 0, 1, \cdots, N$$ &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Then important properties of $V_n$ (as defined above!) are proved in &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Theorem 4.4.2.&lt;/strong&gt; The American derivative security price process given by Definition 4.4.1 has the following properties:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(i) $V_n \geq \max\{G_n, 0\}$ for all $n$&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(ii) The discounted process $\frac{V_n}{(1+r)^n}$ is a supermartingale&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;(iii) if $Y_n$ is another process satisfying $Y_n \geq \max\{G_n, 0\}$ for all $n$ and for which $\frac{Y_n}{(1+r)^n}$ is a supermartingale then $Y_n \geq V_n$ for all $n$&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;We summarize property (iii) by saying that $V_n$ is the smallest process satisfying (i) and (ii)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Then, in the theorem 4.4.3 Shereve &lt;strong&gt;redefines&lt;/strong&gt; $V_n$ as a &lt;a href=&quot;https://en.wikipedia.org/wiki/Snell_envelope&quot; rel=&quot;nofollow noreferrer&quot;&gt;Snell envelope process&lt;/a&gt; (though Shreve does not use this term):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Theorem 4.4.3.&lt;/strong&gt; We have the following pricing alogrithm for the path-dependent derivative security price process given by Definition 4.4.1: &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$V_N(\omega_1 \cdots \omega_N) = \max{\{G_N, 0\}} $&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$V_n(\omega_1 \cdots \omega_n) = \max\{ G_n(\omega_1 \cdots \omega_n),  \frac{1}{1+r}[\tilde{p}V_{n+1}(\omega_1 \cdots \omega_nH) + \tilde{q}V_{n+1}(\omega_1 \cdots \omega_nT)]$ &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Shreve proves theorem showing that &lt;strong&gt;the redefined&lt;/strong&gt; $V_n$ satisfies conditions of Theorem 4.4.2. and concludes that $$V_n = \max\{ G_n, \frac{1}{1+r}[\tilde{p}V_{n+1} + \tilde{q}V_{n+1}]\} = \max_{\tau \in \mathcal{S}_n} \widetilde{\mathbb{E}}_n\Big[\mathbb{I}_{\{\tau \leq N\}}\frac{G_\tau}{(1+r)^{\tau-n}} \Big] \tag{A}\label{A}$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From now on Shreve uses the &lt;strong&gt;redefined&lt;/strong&gt; $V_n$. The optimal exercise time is defined in&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Theorem 4.4.5.&lt;/strong&gt; The stopping time $$\tau^* = \min\{n; G_n = V_n\}$$ maximizes the righ-hand side of (4.4.1) when $n=0$; i.e. $$ V_0 = \widetilde{\mathbb{E}}\Big[\mathbb{I}_{\{\tau^* \leq N\}}\frac{G_{\tau^*}}{(1+r)^{\tau^*}} \Big]$$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;He proves that the stopped &lt;strong&gt;redefined&lt;/strong&gt; $V_n$ is a martingale: $$ V_{n\wedge \tau^*} = \mathbb{E}_n\frac{V_{n+1\wedge \tau^*}}{1+r} \tag{B}\label{B}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From $\eqref{A}$ we conclude: $$ V_0 = \max_{\tau \in \mathcal{S}_0} \widetilde{\mathbb{E}}\Big[\mathbb{I}_{\{\tau \leq N\}}\frac{G_{\tau}}{(1+r)^{\tau-n}} \Big] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From $\eqref{B}$ we conclude: $$ V_0 = V_{0 \wedge \tau^*} = \mathbb{E}\frac{V_{N\wedge \tau^*}}{{1+r}^{N\wedge\tau^*}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so the reminder of the Shreve's proof should be clear now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For another proof of the optimal exercise theorem and in general better explanation of the topic I highly recommend &lt;a href=&quot;http://www.springer.com/gp/book/9783540209669&quot; rel=&quot;nofollow noreferrer&quot;&gt;Musiela &amp;amp; Rutkowski's &quot;Martingale Methods in Financial Modelling&quot;&lt;/a&gt; referenced by @Gordon on many occasions. &lt;/p&gt;&#xA;" OwnerUserId="15154" LastActivityDate="2017-05-22T18:44:46.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34340" PostTypeId="1" CreationDate="2017-05-22T18:52:38.867" Score="1" ViewCount="444" Body="&lt;p&gt;&lt;strong&gt;My question is:&lt;/strong&gt; Is it possible to imply either the upside or downside (one sided) probability from looking at implied volatilities of stock options?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Let's take an example:&lt;/strong&gt; say you had Stock A at $50, with a 3M ATM Option with an Imp. Vol of 20%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way, using perhaps non-ATM options, or some combination of options perhaps(?), to calculate the implied probability of Stock A being &gt;10% by expiry (let's say 3m)?&lt;/p&gt;&#xA;" OwnerUserId="20531" LastActivityDate="2020-05-10T02:05:10.530" Title="Is it possible to calculate implied probability of &gt;=X% return based on implied volatilities from options" Tags="&lt;equities&gt;&lt;implied-volatility&gt;&lt;probability&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34341" PostTypeId="2" ParentId="998" CreationDate="2017-05-22T19:16:16.920" Score="9" Body="&lt;p&gt;There is an extensive discussion of what is publicly known in Paul Wilmott's new book (which is a very enlightening and enjoyable read, btw):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://books.google.de/books?id=4BdCDgAAQBAJ&amp;amp;lpg=PP1&amp;amp;pg=PP1#v=onepage&amp;amp;q&amp;amp;f=false&quot; rel=&quot;nofollow noreferrer&quot;&gt;Wilmott, P., Orrell, D.: The Money Formula: Dodgy Finance, Pseudo Science, and How Mathematicians Took Over the Markets, Wiley, 2017&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On pages 125 - 131 (chapter 6: What Quants do) they describe Simons' way from academia to the NSA and back and after that founding RenTech.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then several approaches which were/are being used are described, like &lt;a href=&quot;https://en.wikipedia.org/wiki/Hidden_Markov_model&quot; rel=&quot;nofollow noreferrer&quot;&gt;hidden Markov models&lt;/a&gt; (e.g. I didn't know that one of the earliest hires was &lt;a href=&quot;https://en.wikipedia.org/wiki/Leonard_E._Baum&quot; rel=&quot;nofollow noreferrer&quot;&gt;Leonard Baum&lt;/a&gt;, the inventor of the &lt;a href=&quot;https://en.wikipedia.org/wiki/Baum%E2%80%93Welch_algorithm&quot; rel=&quot;nofollow noreferrer&quot;&gt;Baum-Welch algorithm&lt;/a&gt;!), speech recognition, high frequency trading and more agnostic machine learning techniques for finding short-lived patterns in financial time series.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On top of that RenTech uses efficient tax-saving vehicles like basket options, in which all the heavy trading is done, while the investors only buy these instruments once as &quot;long-term&quot; investors. More technical details can be found in a report from the US senate: &lt;a href=&quot;http://www.hsgac.senate.gov/download/report-abuse-of-structured-financial-products-misusing-basket-options-to-avoid-taxes-and-leverage-limits&quot; rel=&quot;nofollow noreferrer&quot;&gt;Misusing Basket Options to Avoid Taxes and Leverage Limits (2014)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&lt;br&gt;&#xA;There are now more resources available:&lt;br&gt;&#xA;- Video: &lt;a href=&quot;https://youtu.be/QNznD9hMEh0&quot; rel=&quot;nofollow noreferrer&quot;&gt;James Simons (full length interview) - Numberphile (&gt; 1 hour)&lt;/a&gt;&lt;br&gt;&#xA;- Book: &lt;a href=&quot;https://books.google.de/books?id=U2yHDwAAQBAJ&amp;amp;lpg=PP1&amp;amp;pg=PP1#v=onepage&amp;amp;q&amp;amp;f=false&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Man Who Solved the Market: How Jim Simons Launched the Quant Revolution (2019)&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2019-11-14T19:29:08.073" LastActivityDate="2019-11-14T19:29:08.073" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="34342" PostTypeId="1" AcceptedAnswerId="34356" CreationDate="2017-05-22T19:37:54.297" Score="2" ViewCount="6605" Body="&lt;p&gt;I am trying to find out how to go from delta to strike. If we look at the Bloomberg I am looking at &lt;strong&gt;1M ATM&lt;/strong&gt; volatility. I have included the Bloomberg data as a picture where we have following information:&#xA;&lt;span class=&quot;math-container&quot;&gt;$f=0.9475$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$r=0.00274-0.02924$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$\sigma =13.32/100$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$T=1/12$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$t=0$&lt;/span&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The strike for &lt;span class=&quot;math-container&quot;&gt;$delta=0.4988$&lt;/span&gt; appears at the picture as well, and I try to recreate it. I use definition for the Black Sholes delta and I have this problem now:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$d(k)=\frac{1}{\sigma \sqrt{T-0}}*\text{Log}\left[\frac{f}{k}\right]*\left(r+\frac{\sigma ^2}{2}\right)*(T-t)$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$r_f=0.00274$&lt;/span&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$ SOLVE[e^{r_f*(T-t)}*N\left(d_1(k)\right)=0.4988]$&lt;/span&gt;&#xA;, &lt;span class=&quot;math-container&quot;&gt;$ k = 0.950417$&lt;/span&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to bloomberg this correct answer is &lt;span class=&quot;math-container&quot;&gt;$k=0.9483$&lt;/span&gt;. &lt;strong&gt;What went wrong?&lt;/strong&gt; Personally I believe it's dates and time parameters that's not correct. According to &lt;em&gt;Bjork: Arbitrage Theory in Continuous Time&lt;/em&gt; the time parameters need to measured in years. And in general. Is my approach correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have found out about this method by looking at topics that are discussed here:&#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/29507/calculate-strike-from-black-scholes-delta/33810#33810&quot;&gt;Calculate strike from Black Scholes delta&lt;/a&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/17171/black-model-delta-strike-relationship-regardless-of-expiry&quot;&gt;Black model: Delta - strike relationship regardless of expiry?&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/wAQYQ.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/wAQYQ.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user25295" LastEditorUserId="17101" LastEditorDisplayName="user25295" LastEditDate="2020-03-05T08:58:46.640" LastActivityDate="2020-04-07T17:15:37.003" Title="Strike / delta relationship for FX options" Tags="&lt;options&gt;&lt;fx&gt;&lt;stochastic-volatility&gt;&lt;delta&gt;&lt;homework&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="34343" PostTypeId="1" CreationDate="2017-05-22T21:16:13.323" Score="0" ViewCount="328" Body="&lt;p&gt;&lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1435199&quot; rel=&quot;nofollow noreferrer&quot;&gt;This paper&lt;/a&gt; gives on equation 22 an estimator for the mean reversion level of the variance process under the real world measure. The context is the Heston model, where the variance is stochastic and the paper is trying to give a proxy for the determination of the Heston model parameters under the &lt;strong&gt;real word measure&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;My question is: I perfectly understand equation 22, but it is not really clear to me if I should use the &lt;strong&gt;historical&lt;/strong&gt; log-returns to do the computation.&#xA;Could you please confirm that all I need to compute the estimator in equation 22 are the historical log-returns?&lt;/p&gt;&#xA;&lt;p&gt;The equation 22, wich I refer to, is the following:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\hat{\bar{\nu}}^{*} := \frac{1}{T}\sum_{k=1}^{K}\left[\ln\left( \frac{S(t_k)}{S(t_{k-1})}\right)\right]^2$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="25437" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2017-05-24T01:27:01.423" Title="Estimate the mean reversion level of the variance process under the real world measure" Tags="&lt;stochastic-processes&gt;&lt;stochastic-volatility&gt;&lt;heston&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34344" PostTypeId="2" ParentId="34279" CreationDate="2017-05-23T02:05:28.720" Score="0" Body="&lt;p&gt;CME has DV01s on their website, I think only for futures.  Beyond that you'll need a data provider such as bloomberg, reuters, or subscribe to barclays live.&lt;/p&gt;&#xA;" OwnerUserId="28069" LastActivityDate="2017-05-23T02:05:28.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34345" PostTypeId="2" ParentId="34279" CreationDate="2017-05-23T03:05:28.200" Score="0" Body="&lt;p&gt;To calculate DV01 and curve risk you should be able to calculate price from yield first. You could probably take a look at QuantLib - it should able to price a bond from yield. Once you can do that, you can do whatever risk calculations you want. For example, to calculate DV01 you would change yield by 1 basis point and then reprice it.&lt;/p&gt;&#xA;" OwnerUserId="15454" LastActivityDate="2017-05-23T03:05:28.200" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34346" PostTypeId="1" AcceptedAnswerId="34352" CreationDate="2017-05-23T05:35:53.717" Score="0" ViewCount="1239" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/H2zlY.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/H2zlY.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The $R_{TP}$  is the tangent portfolio return, but I don't understand the step regarding $\frac{dV(R)}{dw_n}$, you apply this, and how come it get rids of the summation? &lt;/p&gt;&#xA;" OwnerUserId="28020" LastEditorUserId="16148" LastEditDate="2017-05-23T14:23:11.363" LastActivityDate="2017-05-23T14:23:11.363" Title="MPT Tangent Portfolio: Buck for the Bang Ratio" Tags="&lt;modern-portfolio-theory&gt;&lt;portfolio-optimization&gt;&lt;sharpe-ratio&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34347" PostTypeId="1" CreationDate="2017-05-23T05:55:15.910" Score="0" ViewCount="78" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/HleT4.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/HleT4.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to explain to me why the formula is $r_A-hr_B$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My interpretation is that, you short stock B (by selling it), and then you use the money to buy stock A. Thus we have a $r_A$ term there. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, we have to buy back stock B. so $r_A-hr_B$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this interpretation correct?&lt;/p&gt;&#xA;" OwnerUserId="28019" LastActivityDate="2017-05-23T08:23:44.623" Title="Hedge by shorting stock" Tags="&lt;hedging&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34350" PostTypeId="2" ParentId="34342" CreationDate="2017-05-23T07:46:16.813" Score="3" Body="&lt;p&gt;There are specific quotation conventions for specifying ATM and deltas for FX options quotes (unadjusted deltas, premium adjusted deltas, etc.) and converting deltas to strikes. These conventions vary across currency pairs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;See this paper &lt;a href=&quot;https://ideas.repec.org/p/zbw/cpqfwp/20.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://ideas.repec.org/p/zbw/cpqfwp/20.html&lt;/a&gt; for details. &lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2017-05-23T07:46:16.813" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34351" PostTypeId="2" ParentId="34347" CreationDate="2017-05-23T08:23:44.623" Score="1" Body="&lt;p&gt;This is entirely correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, the initial portfolio you hold is one unit of stock A that you want to hedge.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The hedge portfolio is therefore this unit of stock A that you bought, minus $h$ units of stock B that you have short for the hedge. Of course, shorting stock B means that you will have to buy it back at some point, hence the &quot;-&quot; sign.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, the return of your hedging portfolio is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_{port} = r_A - h r_B$$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the following, you want to minimize the risk of this hedging portfolio. In this framework, risk is determined by the variance of your portfolio, and the goal is to find the optimal number of shares $h$ of stock B you should own to reach this minimum variance (or optimal) portfolio.&lt;/p&gt;&#xA;" OwnerUserId="26595" LastActivityDate="2017-05-23T08:23:44.623" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34352" PostTypeId="2" ParentId="34346" CreationDate="2017-05-23T08:44:12.467" Score="2" Body="&lt;p&gt;You get rid of the sum because you are computing the derivative of the variance with respect to one weight only (i.e. $\omega_n$)!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This implied that you take the derivative relatively to one single term of the sum, not all. You can basically compute $$\dfrac{dV(R)}{d\omega_n}$$ for all $n = [1, \cdots, N]$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the calculation, and starting from the 3rd row of the derivation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$2 \omega_n Cov(R_n,R_n) + 2 Cov (R_n, \sum_{m \neq n} \omega_m R_m)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ = 2 Cov(R_n,\omega_n R_n) + 2 Cov (R_n, \sum_{m \neq n} \omega_m R_m)$$&#xA;(bilinearity of the covariance)&#xA;$$ = 2 Cov (R_n, \sum_{m} \omega_m R_m)$$&#xA;$$ = 2 Cov (R_n, \sum_{m} \omega_m R_m - (1 - \sum_{m} \omega_m) R_f)$$&#xA;(as the variance of a constant is zero. The constant I am referring to is $- (1 - \sum_{m} \omega_m) R_f$ since $R_f$ is deterministic. I have just added it in the covariance)&#xA;$$ = 2 Cov (R_n, R_{TP})$$&lt;/p&gt;&#xA;" OwnerUserId="26595" LastEditorUserId="26595" LastEditDate="2017-05-23T09:44:23.570" LastActivityDate="2017-05-23T09:44:23.570" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34353" PostTypeId="1" CreationDate="2017-05-23T10:17:47.530" Score="5" ViewCount="565" Body="&lt;p&gt;I have this equation (Eq. (2.4) &quot;The Volatility Surface - A Practitioner's Guide&quot; by Jim Gatheral (Ed. 2006)):&#xA;$$-\frac{\partial C(v, x, \tau)}{\partial \tau}+\frac{1}{2}v \frac{\partial^2 C(v,x,\tau)}{\partial x^2}-\frac{1}{2}v\frac{\partial C(v,x,\tau)}{\partial x}+\frac{1}{2}v\eta^2\frac{\partial^2 C(v,x,\tau)}{\partial v^2}+\rho\eta v\frac{\partial^2 C(v,x,\tau)}{\partial v \partial x}-\lambda(v-\bar{v})\frac{\partial C(v,x,\tau)}{\partial v}=0$$&#xA;Where $x:=ln{\frac{F_{t,T}}{k}}$ ($F_{t,T}$ is the forward price) and $\tau=T-t$.&#xA;Assuming that:$$C(x,v,\tau)=K\{e^xP_1(x,v,\tau)-P_0(x,v,\tau)\}$$&#xA;Where the above equation correspont to Eq 2.5 of &quot;The Volatility Surface - A Practitioner's Guide&quot; by Jim Gatheral (Ed. 2006). By substituing the last equation in the previous one, J. Gatheral obtains:&#xA;$$-\frac{\partial P_j(v, x, \tau)}{\partial \tau}+\frac{1}{2}v \frac{\partial^2 P_j(v,x,\tau)}{\partial x^2}-(\frac{1}{2}-j)v\frac{\partial P_j(v,x,\tau)}{\partial x}+\frac{1}{2}v\eta^2\frac{\partial^2 P_j(v,x,\tau)}{\partial v^2}+\rho\eta v\frac{\partial^2 P_j(v,x,\tau)}{\partial v \partial x}+(a-b_jv)\frac{\partial P_j(v,x,\tau)}{\partial v}=0$$&#xA;For $j=0,1$, where $a=\lambda \bar{v}, b_j= \lambda - j\rho \eta$. This is Eq 2.6 of the referred book. Now, my problem is the following. When I substitute 2.5 in 2.4, I obtain the following:&#xA;$$k\{-\frac{ \partial P_0(v,x,\tau)}{\partial \tau}+\frac{1}{2}v\frac{\partial ^2 P_0(v,x,\tau)}{\partial x^2}-\frac{1}{2}v\frac{\partial P_0(v,x,\tau)}{\partial x}+\frac{1}{2}v\eta^2\frac{\partial^2 P_0(v,x,\tau)}{\partial v^2}+\rho\eta v\frac{\partial^2 P_0(v,x,\tau)}{\partial v \partial x}-\lambda(v-\bar{v})\frac{\partial P_0(v,x,\tau)}{\partial v}= ke^x \{ -\frac{\partial P_1(x,v,\tau)}{\partial \tau}-\frac{\partial x}{\partial \tau}P_1(x,v,\tau)+\frac{1}{2}v\frac{P_1(v,x,\tau)}{\partial x^2}+\frac{1}{2}v\frac{\partial P_1(v,x,\tau)}{\partial x}+\frac{1}{2}v\eta^2\frac{\partial^2 P_1(v,x,\tau)}{\partial v^2}+\rho\eta v\frac{\partial^2 P_1(v,x,\tau)}{\partial v \partial x}+(a-b_jv)\frac{\partial P_1(v,x,\tau)}{\partial v}\}$$.&#xA;First question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As one can see I have obtained an equation in $P_0({x,v,\tau})$ and $P_1(x,v, \tau)$. J. Gatheral obtains two equations. In order to obtain the same result as him, I have set $k=1$ and $F_{t,T}=0$ to obtain a PDE in $P_0(x,v,\tau)$ and then I have set  $k=0$ and $F_{t,T}=1$ to obtain a PDE in $P_1(x,v,\tau)$. Is it correct? Am I allowed to do that? If yes, why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I take the derivative of the undiscounted call price with respect to $\tau$ from equation 2.5, I obtain the following: $$\frac{\partial C(x,v,\tau )}{\partial \tau}&#xA;   = K\{e^x\frac{\partial P_1(x,v,\tau )}{\partial \tau} + e^x\frac{\partial x}{\partial \tau} P_1 (x,v,\tau)-\frac{\partial P_0(x,v,\tau )}{\partial \tau}\}=K\{e^x\frac{\partial P_1(x,v,\tau )}{\partial \tau} + e^xr P_1 (x,v,\tau)-\frac{\partial P_0(x,v,\tau )}{\partial \tau}\}$$&#xA;Which in my opinion is correct, given that $x$ depend on $\tau$ thanks to $F_{t,T}$. However, I am not able to obtain equation 2.6 because the term $e^xr P_1 (x,v,\tau)$ is not there (I don't see another term which allows me to make a simplification). What am I missing here?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks guys!!&lt;/p&gt;&#xA;" OwnerUserId="28073" LastEditorUserId="28073" LastEditDate="2017-05-24T11:16:50.917" LastActivityDate="2017-11-21T00:11:45.400" Title="The Heston Solution For European Option - Jim Gatheral" Tags="&lt;volatility&gt;&lt;mathematics&gt;&lt;stochastic-volatility&gt;&lt;heston&gt;&lt;quantitative&gt;" AnswerCount="1" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34354" PostTypeId="1" CreationDate="2017-05-23T11:04:01.527" Score="3" ViewCount="650" Body="&lt;p&gt;My goal is to identify a systematic way to position sizing in the futures market. Let assume that I'm an investor with log utility. In addition, let assume that I'm reluctant in estimating the expected return of a strategy. In &lt;a href=&quot;https://www.scribd.com/document/127919736/Optimal-f-and-the-Kelly-Criterion&quot; rel=&quot;nofollow noreferrer&quot;&gt;Optimal f and the Kelly Criterion&lt;/a&gt; Vince states: &quot;It is specifically because the optimal f calculation incorporates worst-case outcomes that it is bounded between zero and one inclusively&quot;. This is scary to me since in real life the next loss can be grater than the largest historical loss. So I've tested what would happen in this worst case scenario.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, I've reproduced in Python the example in page 123 of Vince (1990) in order to make sure that the code works. In this example, the sequence of PnL is [9, 18, 7, 1, 10, -5, -3, -17, -7] and the largest Loss is -17. The resulting optimal f is 0.24. In real trading, we cannot observe the largest loss that we will face in future, so in practice it could make sense to use a look-back period to estimate the largest loss.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the optimal f associated with the look-back period [9, 18, 7, 1, 10, -5, -3] where the largest loss is 5, we get f=0.64. The resulting capital to be invested in the next bet would be largest_loss / optimal_f = 5 / 0.64 = 7.81. However, the outcome of the next bet is -17, so we go broke. Note that even if we used the fractional optimal f, say half f, we would still go broke. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Questions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;How to obtain the optimal f without introducing look-ahead bias and f bounded in [0, 1] while preserving the maximum long term geometric growth of capital?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is there any approach or extension that provide an optimal position sizing strategy without estimating the expected return of the strategy (i.e. position sizing taking into account for the risk only)?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="28016" LastEditorUserId="28016" LastEditDate="2017-05-24T16:14:19.503" LastActivityDate="2017-05-24T16:14:19.503" Title="Optimal f (position sizing) without look ahead bias" Tags="&lt;futures&gt;&lt;leverage&gt;&lt;kelly-criterion&gt;&lt;margin&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34356" PostTypeId="2" ParentId="34342" CreationDate="2017-05-23T13:52:58.950" Score="6" Body="&lt;p&gt;In FX world, the ATM strike is the delta-neutral strike, that is, the absolute delta values of a call and the corresponding put are the same. Moreover, the delta can be premium adjusted or not depending on the particular currency pair. See the linked paper as mentioned by @AntoineConze.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For AUD/USD, the delta is not premium adjusted, and then the delta-neutral ATM strike is determined by the equation&#xA;\begin{align*}&#xA;\Phi(d_1) = \Phi(-d_1),&#xA;\end{align*}&#xA;that is,&#xA;\begin{align*}&#xA;K = Fe^{\frac{1}{2}\sigma_{ATM}^2 T},&#xA;\end{align*}&#xA;where $F$ is the forward, $\sigma_{ATM}$ is the ATM volatility, and $T$ is the maturity. Based on the information you provided,&#xA;\begin{align*}&#xA;T&amp;amp;=\frac{\mbox{10-Jul-13} - \mbox{7-Jun-13}}{365} =0.090411,\\&#xA;K &amp;amp;= 0.9475\times e^{0.5 \times 0.1332^2 \times 0.090411} = 0.94826.&#xA;\end{align*}&#xA;See also Page 51 of the book &lt;a href=&quot;https://www.amazon.ca/Foreign-Exchange-Option-Pricing-Practitioners/dp/0470683686/ref=sr_1_1?ie=UTF8&amp;amp;qid=1495548862&amp;amp;sr=8-1&amp;amp;keywords=Foreign+Exchange+Option+Pricing.&quot; rel=&quot;noreferrer&quot;&gt;Foreign Exchange Option Pricing&lt;/a&gt; by Iain J. Clark.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-05-23T14:42:16.290" LastActivityDate="2017-05-23T14:42:16.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34357" PostTypeId="1" CreationDate="2017-05-23T14:26:02.710" Score="0" ViewCount="65" Body="&lt;p&gt;Suppose $V^+(S,t;K)$ is the value of a American option with strike $K$ before the exercise, and $V^-(S,t;K)$ is the value after exercise. Then how to understand the inequality&#xA;$$V^+(S,t;K)\geq V^-(S,t;K) + (S - K)^+$$ &lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-05-23T14:49:56.227" Title="Value of American option after exercise" Tags="&lt;derivatives&gt;&lt;american-options&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="34358" PostTypeId="2" ParentId="34357" CreationDate="2017-05-23T14:49:56.227" Score="1" Body="&lt;p&gt;After exercise, the option ceases to exist.  It has no value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V^−(S,t;K)=0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V^+(S,t;K)=(S−K)^+$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If an option was exercised and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V^+(S,t;K)&amp;gt;(S−K)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then there was still time value in the option and it should not have been exercised.&lt;/p&gt;&#xA;" OwnerUserId="26556" LastActivityDate="2017-05-23T14:49:56.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34359" PostTypeId="1" AcceptedAnswerId="34360" CreationDate="2017-05-23T15:31:11.770" Score="0" ViewCount="2519" Body="&lt;p&gt;I'm trying to understand how the published prices for futures relate to how much is actually spent when you execute. For example: looking at GEH8 on 4/19/2017.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The quotes look like 98.50, 98.515, but I believe that there is a display factor of .0001.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: if you execute 250 contracts at \$91.51, and it closes at \$91.505, what is the unrealized PnL?&lt;/p&gt;&#xA;" OwnerUserId="28074" LastEditorUserId="5617" LastEditDate="2017-05-23T16:12:50.677" LastActivityDate="2018-12-04T15:11:37.270" Title="Calculating PnL on Eurodollar futures trading" Tags="&lt;futures&gt;&lt;pnl&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34360" PostTypeId="2" ParentId="34359" CreationDate="2017-05-23T15:49:01.167" Score="2" Body="&lt;p&gt;First, I would say that it is realized PnL because with futures, you always have to settle up at the end of the day in the margin accounts.  If you bought the futures at 98.51, then you only post margin since the futures contract has zero value.  If the contract settled at 98.505, then you lost 0.005 on the contract.  Each Eurodollar contract is on 1MM notional, but over the 3M period, it is like a 250K notional.  The payoff is 2,500 per point per contract, so you have a final payoff of 250 * 2,500 * (-0.005) = -250 * 12.50 = -3,125. The 250 factor is the number of contract you referenced in your question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is worthwhile to think of a futures contract as a series of one day forward contracts that get settled up each day in your margin account and you have the option of exiting at anytime.  This way of thinking can help to understand an important feature of the Eurodollar contracts - i.e. the convexity correction that helps to convert futures prices to forward prices and vice versa. This is a feature of any futures contract, but is most pronounced and studied for Eurodollar contracts since they have expiries out to 10 years and the convexity correction is bigger for longer dated contracts.&lt;/p&gt;&#xA;" OwnerUserId="26977" LastEditorUserId="26977" LastEditDate="2017-05-23T17:23:02.807" LastActivityDate="2017-05-23T17:23:02.807" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34361" PostTypeId="2" ParentId="34359" CreationDate="2017-05-23T15:53:18.133" Score="3" Body="&lt;p&gt;This document may be helpful &lt;a href=&quot;https://www.cmegroup.com/trading/interest-rates/files/understanding-eurodollar-futures.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Understanding Eurodollar futures&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value of a 1 point price change (for example from 98 to 99) is equal to 2500 USD per contract (this is $1000000\frac{90}{360}1\%$ since the nominal amount for the loan is one million and interest is paid every 3 month on 30/360 convention). Equivalently the value of a 1 bp change (from 98 to 98.01) is 25 USD. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general for any futures contract once you know the &quot;value of 1 point&quot; on one contract you can calculate the P&amp;amp;L as Value_of_1_point*Price_Change_in_points*Contracts .&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-05-23T16:03:51.087" LastActivityDate="2017-05-23T16:03:51.087" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34362" PostTypeId="2" ParentId="34329" CreationDate="2017-05-23T18:06:26.680" Score="5" Body="&lt;p&gt;Tough to answer specifically because I don't know what bonds you're looking at, but my guess is it has less to do with the spread-building blocks and more to do with the base curve. G spread is based off the interpolated government bond curve, and Z spread is off the Swap curve, if you mouse over on YAS it will show you the base curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since right now the swap curve is higher than the Treasury curve out to about 5/6 years, I imagine you're looking at bond inside of 5 years to maturity. That's going to drive the Z spread lower than the G.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're looking out past 5/6 years the relationship should flip back to what you describe with a G below the Z spread. Look at something like a Verizon 30 year and you'll see that play out. &lt;/p&gt;&#xA;" OwnerUserId="26101" LastActivityDate="2017-05-23T18:06:26.680" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34363" PostTypeId="2" ParentId="34316" CreationDate="2017-05-23T18:56:58.793" Score="-2" Body="&lt;p&gt;Impied future = strike + call - put&lt;/p&gt;&#xA;" OwnerUserId="28079" LastActivityDate="2017-05-23T18:56:58.793" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34364" PostTypeId="1" CreationDate="2017-05-23T18:58:44.457" Score="-1" ViewCount="85" Body="&lt;p&gt;I'm trying to build a consolidated LOB from several direct feeds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, there are many instances in which for a given stock, the bid price in one venue equals or crosses the ask price in a different venue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is that a valid state or do I have an issue with out-of-order event processing across the different feeds? In such case, what's the best way to &quot;fix&quot; the LOB back to a valid state (e.g. ignore the locking/crossing event, remove the locked/crossed prices)?&lt;/p&gt;&#xA;" OwnerUserId="28080" LastActivityDate="2017-07-23T02:36:41.163" Title="Locked/crossed prices in US equities" Tags="&lt;equities&gt;&lt;market-data&gt;&lt;limit-order-book&gt;&lt;orderbook&gt;&lt;feed&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34365" PostTypeId="2" ParentId="34364" CreationDate="2017-05-23T19:13:41.437" Score="0" Body="&lt;p&gt;It is possible to observe it due to the latency between different exchange locations. You may try to fall back on SIP if it persists for more than a few seconds, though probably that part should be outside of your LOB construction.&lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2017-05-23T19:13:41.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34366" PostTypeId="1" CreationDate="2017-05-23T20:56:37.683" Score="3" ViewCount="116" Body="&lt;p&gt;The market for trading options on fixed income ETFs like HYG has become increasingly prominent in the past couple years, but I've been unable to find any discussion related to the pricing methodology of these securities. I suspect the pricing method is quite different from that used for options on equity ETFs like SPY, given that the underlying assets for fixed income ETFs are bonds with interest-rate sensitivities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If anyone has insight into pricing methods or can direct me towards resources that might help, that'd be greatly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="28081" LastActivityDate="2017-05-23T20:56:37.683" Title="Pricing Options on Fixed Income ETFs" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;fixed-income&gt;&lt;etf&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34367" PostTypeId="1" AcceptedAnswerId="34430" CreationDate="2017-05-23T21:12:11.823" Score="1" ViewCount="981" Body="&lt;p&gt;I'm still confused on how to provide liquidity on the forex market using passive or resting orders and get the spread from that (selling at ask and buying from bid) &#xA;And what's the dynamics on the LOB using them.?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anything that could lead me to this will be appreciated. &#xA;Thanks &lt;/p&gt;&#xA;" OwnerUserId="13990" LastActivityDate="2017-06-22T20:35:10.257" Title="Market making with resting orders?" Tags="&lt;fx&gt;&lt;high-frequency&gt;&lt;market-microstructure&gt;&lt;market-making&gt;&lt;market-model&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34368" PostTypeId="2" ParentId="4924" CreationDate="2017-05-23T21:27:58.203" Score="1" Body="&lt;p&gt;For an American call option with strike price $K$ and the time to maturity be $T$ on underlying stock does not pay any dividend, it &lt;strong&gt;IS ALSO&lt;/strong&gt; possible for an early call to be the optimal strategy, &lt;em&gt;if interest rates are negative&lt;/em&gt; (I assume Merton didn't think of this, but we're all Japanese now!).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the theta of a BS call option - the rate of change of option price with time:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\theta = - {\partial V \over \partial t}$$&#xA;$$\theta =ZCB(t,T)\cdot\Big\{-{\sigma F(t,T) \phi(d_1)\over 2\sqrt{\tau}} \mp rK\Phi(\pm d_2) \Big\}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the $\mp$ is $-$ for a call and $+$ for a put. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The usual situation is for this to be negative - the time value of the option decays towards the intrinsic value as time passes. However, it is possible for large positive $r$ in the case of a put, or large negative $r$ in the case of a call, for $\theta$ to be positive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, the value of the option is &lt;em&gt;increasing&lt;/em&gt; towards its intrinsic value, and is currently below it - so the optimal strategy for an American option in this case is to exercise. &lt;a href=&quot;http://www.quantopia.net/european-vs-american-options/&quot; rel=&quot;nofollow noreferrer&quot;&gt;This article gives a longer description&lt;/a&gt; and shows graphs of the effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way of thinking about this is that the negative rate on a call acts like a dividend rate because the money is paid immediately on exercise and the negative rate yields a positive return to expiry on this negative quantity of cash.&lt;/p&gt;&#xA;" OwnerUserId="27947" LastEditorUserId="27947" LastEditDate="2017-05-25T19:56:07.427" LastActivityDate="2017-05-25T19:56:07.427" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34370" PostTypeId="1" CreationDate="2017-05-23T23:45:05.687" Score="0" ViewCount="63" Body="&lt;p&gt;I found &lt;a href=&quot;http://www.marketindex.com.au/asx200&quot; rel=&quot;nofollow noreferrer&quot;&gt;marketindex.com&lt;/a&gt; real time data for the Austrial market index AXJO.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a similar website for the Nikkei Index N225? On all websites it is always 20 minutes delayed, such as yahoo finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ALso, does Interactive brokers have this data in real time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Real time as of delay of max. 1 second or less.&lt;/p&gt;&#xA;" OwnerUserId="16858" LastActivityDate="2017-05-23T23:45:05.687" Title="where to find real time data non-delayed of N225 and AXJO" Tags="&lt;market-data&gt;&lt;indexes&gt;" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="34372" PostTypeId="2" ParentId="34364" CreationDate="2017-05-24T00:58:15.617" Score="-1" Body="&lt;p&gt;Generally you want to rebuild the book venue by venue. NBBO is a different story.&lt;/p&gt;&#xA;" OwnerUserId="11817" LastActivityDate="2017-05-24T00:58:15.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34373" PostTypeId="2" ParentId="34343" CreationDate="2017-05-24T01:27:01.423" Score="1" Body="&lt;p&gt;Answering my own question: Yes, on page 27 of the article the author says that equation 22 should indeed be computed from historical data.&lt;/p&gt;&#xA;" OwnerUserId="25437" LastActivityDate="2017-05-24T01:27:01.423" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34376" PostTypeId="2" ParentId="34316" CreationDate="2017-05-24T06:30:26.923" Score="1" Body="&lt;p&gt;There are usually a couple of problems with reconciling futures / options data from sources like Euronext&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Real time / Delayed Data is not always asynchronous .... &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;EOD Options Data ... Options usually stop trading before Futures ... therefore not comparing apples with apples&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;... assuming no Cost of Carry .... then the implied Forward for any expiry can be estimated by Strike + Call Premium - Put Premium ... better to use ATM strike&lt;/p&gt;&#xA;" OwnerUserId="28087" LastActivityDate="2017-05-24T06:30:26.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34377" PostTypeId="2" ParentId="34230" CreationDate="2017-05-24T07:59:12.770" Score="1" Body="&lt;p&gt;As pure speculative commentary and a non-quantitative answer, you may want to look at the short-term options volatility as a factor for possibly fine tuning your model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your goal seems to be to find the elasticity or 'beta' factor of the price movement. The price drift you are looking at implies some form of information dissemination or perception change in the market. I would expect that a large part of calculating your beta factor would be determining how much the market's opinions changed. Was this surprise far outside of expectations or was it within an expected range.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The options implied volatility on the short term expirations that expire immediately after the release would give you a measurement of the market's perception of risk before the announcement. If you use this to determine the shock factor of the earnings data it could be related to the elasticity of the movement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In simple terms, the IV of the short-term options represents the market pricing of the predicted risks associated with the earnings announcement. Think of it as a measurement of Fear, Uncertainty, and Doubt. If IV is extremely high, the market is pricing in a broad range of possible earnings results. Even a large surprise may not be a significant market mover in this case because the risks are priced in and there was little shock from the event.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, if the options showed an abnormally low IV prior to the announcement you could imply a high level of confidence in the expected earnings results. The market is pricing in a smaller range of possibilities, and a significant deviation could be interpreted as a large information &quot;Shock&quot; to the market. Theoretically, this would be realized as a greater beta to your expected price movement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please understand that this is all speculative and I have no study to back this idea up. On the other hand, it shouldn't be that tough to at least do a sniff test on the concept.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A simple approach would be to take some historical data and run a test. Get a handful of companies' historical earnings data and associated options implied volatilities from just prior to the announcement. Segment your data into two sets. I would normally go with 2/3rd in sample data and 1/3rd out of sample. In this case you may want to just do 50/50.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Run your current model on the out of sample data and figure out the MSE of that test run. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then use the in sample data to calibrate a simple kernel regression using your model's output as one input and the IV factor as the other. Aim for the smallest predictive MSE you can get during your calibration. Then run the new combined model on the out of sample data you used before. Calculate the new MSE and compare it to the origional test of your raw model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This isn't the most analytically pure approach, but it should give you a bit of insight. If your error significantly drops in the combined model then there might be some level of information content in the IV that may be useful in a model. It could be worth analyzing further.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the difference in error rates between the tests isn't significant then there are two possibilities. The first is that the relationship between IV and your beta factor exists, but it is too complex to suss out with a simple kernel regression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second and far more likely answer is that no information exists in the relationship and the idea is a dead end. At least it is an easy test, a fast failure is always good.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have any interest in the concept send me a comment. I have a pretty good set of historical options data I can contribute to a test. I do a lot of work with volatility trades around earnings, and the results would be interesting to me.&lt;/p&gt;&#xA;" OwnerUserId="19959" LastActivityDate="2017-05-24T07:59:12.770" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34379" PostTypeId="1" CreationDate="2017-05-24T10:56:26.607" Score="1" ViewCount="824" Body="&lt;p&gt;I've sort of get the arbitrage logic of it, i.e if the futures price is more expensive than spot price, then investors would short the contract and buy the asset for delivery.&#xA;Correct me if i'm wrong. &#xA;The investor enters into a short position on the contract and buys the asset for delivery. &#xA;So does this mean it works only in the case of physical delivery of asset and not cash settlements?   &lt;/p&gt;&#xA;" OwnerUserId="28090" LastActivityDate="2017-05-24T19:41:38.453" Title="Why does a futures price converge to a spot price?" Tags="&lt;futures&gt;&lt;derivatives&gt;&lt;commodities&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34380" PostTypeId="1" AcceptedAnswerId="34396" CreationDate="2017-05-24T11:00:41.950" Score="0" ViewCount="5038" Body="&lt;p&gt;does anyone know about the EUR Forward Implied 3 Month Rate published by Bloomberg on the Bloomberg Page EURI3M ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First question: this is the rate from a forward curved, forward curve being calculated (implied) from some risk-free zero interest curve. Correct?&#xA;Second question: assuming that first question is correct, what risk-free instruments Bloomberg uses to build the zero interest curve from which forward curve is implied? Possible answers would be LIBORs, Interest Rate Swaps...&lt;/p&gt;&#xA;" OwnerUserId="24076" LastActivityDate="2017-07-24T14:42:43.263" Title="EUR Implied Forward Rate from Bloomberg" Tags="&lt;bloomberg&gt;&lt;forward-rate&gt;&lt;implied&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34383" PostTypeId="2" ParentId="34379" CreationDate="2017-05-24T13:09:40.713" Score="1" Body="&lt;p&gt;on edit: oops - didn't read this question carefully!  Futures price can be above or below spot price.  In equities, for example, if dividends are more than the risk free rate, then the futures will be below the spot if the risk free rate is greater than the dividends, then the futures will be above the spot.  Assuming continuous rates and div yields, $F=Se^{(r-q)T}$ where we can assume that $q$ can absorb all funding costs and borrow costs for the stock for borrowing/lending the stock for short selling. If the equation above is an inequality, buy the cheaper one and sell the more expensive one to capture the convergence.  Follow the usual replication argument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;end of edit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It works for cash deliveries too.  For SPX futures, you have to buy the basket of stocks and sell the futures or vice versa.  Cash delivery happens in the end, but that cash - assuming no transaction costs - can be retrieved by selling the basket.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The cases where the arbitrage fails is when you can't actually buy the spot item today and deliver it at expiration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Probably the most liquid version of this is VIX - you cannot buy VIX spot and hold it to delivery for a VIX futures contract.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Agricultural commodities sometimes have a convergence problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://farmdocdaily.illinois.edu/2013/08/solving-markets-non-convergence-puzzle.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://farmdocdaily.illinois.edu/2013/08/solving-markets-non-convergence-puzzle.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there were 6M futures on fresh eggs, you couldn't buy physical eggs today for delivery in 6M and call them fresh!&lt;/p&gt;&#xA;" OwnerUserId="26977" LastEditorUserId="26977" LastEditDate="2017-05-24T19:41:38.453" LastActivityDate="2017-05-24T19:41:38.453" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34384" PostTypeId="2" ParentId="34380" CreationDate="2017-05-24T13:15:14.547" Score="1" Body="&lt;p&gt;They use interest rate parity under the assumption that they are backing out the implied rate versus either USD or EUR.  For the USD and EUR, they are using the OIS swaps.  So for the US, the ticker for the 3M OIS swap is USSOC curncy and for EUR, the 3M OIS swap ticker is EUSWEC curncy.  There are many other OIS swap tenors on BBG.  I believe BBG will report back the implied rate based on the convention for the currency being requested.&lt;/p&gt;&#xA;" OwnerUserId="26977" LastActivityDate="2017-05-24T13:15:14.547" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34385" PostTypeId="1" AcceptedAnswerId="34390" CreationDate="2017-05-24T17:10:49.350" Score="2" ViewCount="273" Body="&lt;p&gt;I looked into the unconditional and the conditional distribution of a return series, where the unconditional distribution is simply the marginal distribution of the returns, and the conditional distribution is the distribution of the residuals of a GARCH model (i.e., the return series adjusted for GARCH effects).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuitively, I would think that a good part of the deviations from Gaussianity (e.g., a high Jarque-Bera or Kolmogorov-Smirnov statistic) are due to the GARCH effects, so I would expect the conditional distribution to be closer to a Gaussian (i.e., lower JB or KS statistics).&#xA;For a reference, see &lt;a href=&quot;https://www.google.de/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0ahUKEwis0peKgonUAhVED5oKHYc2B-UQFggnMAA&amp;amp;url=http%3A%2F%2Fwww.proba.jussieu.fr%2Fpageperso%2Framacont%2Fpapers%2Fempirical.pdf&amp;amp;usg=AFQjCNFkBMyuCBo3Rmz3NO-u5YsKPF_hvw&amp;amp;sig2=WZZw0TkmvnfWPSghDXgDkQ&amp;amp;cad=rja&quot; rel=&quot;nofollow noreferrer&quot;&gt;Cont (2000)&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, how it is possible that the conditional distribution (e.g., the distribution of GARCH residuals) is &lt;strong&gt;further&lt;/strong&gt; from a Gaussian than the unconditional distribution? How can the GARCH model aggravate the deviations from normality? What does this say about the appropriateness of the GARCH model and how can I diagnose this? What are the underlying assumptions that could be violated here?&lt;/p&gt;&#xA;" OwnerUserId="13665" LastEditorUserId="13665" LastEditDate="2017-05-25T10:32:32.537" LastActivityDate="2017-05-25T10:32:32.537" Title="Under which circumstances can conditional distribution of asset returns be less Gaussian than the unconditional distribution?" Tags="&lt;garch&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34387" PostTypeId="1" AcceptedAnswerId="34389" CreationDate="2017-05-24T17:55:02.800" Score="-3" ViewCount="322" Body="&lt;p&gt;Good evening. I know there are several posts on the subject but unfortunately I can not fully understand this concept and I hope you can help me. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To price the option the fundamental assumption needed is that arbitrage opportunities do not exist.&#xA;The absence of arbitrage implies that the option price is equal in the risk-neutral world and in the real world. &lt;strong&gt;Why?&lt;/strong&gt;&#xA;For example if we consider the simple binomial model:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/5ro5b.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/5ro5b.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;In this case we can build a risk-free portfolio to use as a discount rate the risk-free rate. But I do not understand why the value I get is the same in the real world?&#xA;In this case we get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f=\frac{f_u(1-de^{-rT})+f_d(ue^{-rT}-1)}{u-d}$$&#xA;That we can rewrite in a risk-neutral world:&#xA; $$f=e^{-rT}[pf_u+(1-p)f_d] \qquad p=\frac{e^{rT}-d}{u-d}$$&#xA;In the real world, instead, we would have a different yield rate $\mu$&#xA; $$f^*=e^{-\mu T}[p^*f_u+(1-p^*)f_d] \qquad p^*=\frac{e^{\mu T}-d}{u-d}$$&#xA;In a risk-neutral world the expected value of the action is:&#xA;$$E(S_T)=p S_0 u+(1-p)S_0 d$$&#xA;In the real world the expected value of the action is:&#xA;$$E^*(S_T)=p^* S_0 u+(1-p^*)S_0 d$$&#xA;These two values are different!&lt;/p&gt;&#xA;" OwnerUserId="27078" LastEditorUserId="27078" LastEditDate="2017-05-24T21:35:20.833" LastActivityDate="2017-05-24T21:35:20.833" Title="Option price in a neutral risk world is the same as in the real world. I can not understand!" Tags="&lt;hedging&gt;&lt;risk-neutral-measure&gt;&lt;american-options&gt;&lt;binomial-tree&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2017-05-25T09:00:59.553" ContentLicense="CC BY-SA 3.0" />
  <row Id="34388" PostTypeId="2" ParentId="34353" CreationDate="2017-05-24T18:26:17.550" Score="2" Body="&lt;p&gt;I do not think that Equation $(2.5)$ can be directly substituted into $(2.4)$ to obtain equations of the form given by $(2.6)$ for both $P_0$ and $P_1$. In fact, since Equation $(2.4)$ is satisfied for any European option price, two different option prices are substituted into Equation $(2.4)$ to obtain the respective equations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, note that &#xA;\begin{align*}&#xA;P_0 = \mathbb{E}(1_{\{S_T &amp;gt;K\}}\mid \mathcal{F}_t),&#xA;\end{align*}&#xA;and &#xA;\begin{align*}&#xA;P_1 = \mathbb{E}^S(1_{\{S_T &amp;gt;K\}}\mid \mathcal{F}_t),&#xA;\end{align*}&#xA;where $\mathbb{E}$ is the expectation operator under the risk-neutral probability measure, while $\mathbb{E}^S$ is the expectation operator under the probability measure with the stock price process $S$ as the numeraire.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As $P_0$ is the undiscounted price of a digital option, under a deterministic interest rate setting, we can substitute $P_0$ into $(2.4)$, to obtain the equation for $P_0$. As for $P_1$, we consider the option with Payoff, at maturity $T$, of the form&#xA;\begin{align*}&#xA;S_T 1_{\{S_T &amp;gt;K\}}.&#xA;\end{align*}&#xA;The undiscounted value is given by&#xA;\begin{align*}&#xA;\frac{B_t}{P(t, T)}\mathbb{E}\left(\frac{S_T 1_{\{S_T &amp;gt;K\}}}{B_T}\mid \mathcal{F}_t\right) &amp;amp;= \frac{S_t}{P(t, T)}\mathbb{E}^S(1_{\{S_T &amp;gt;K\}}\mid \mathcal{F}_t)\\&#xA;&amp;amp;=F_{t, T}\mathbb{E}^S(1_{\{S_T &amp;gt;K\}}\mid \mathcal{F}_t)\\&#xA;&amp;amp;=Ke^xP_1,\tag{1}&#xA;\end{align*}&#xA;where $B_t=e^{\int_0^t r_s ds}$ is the money-market account value at time $t$, $P(t, T)$ is the price of a zero-coupon bond with maturity $T$ and unit face value, and $F_{t, T}=\frac{S_t}{P(t, T)}$ is the forward price.&#xA;Now, we substitute $(1)$ into Equation $(2.4)$ to obtain the equation for $P_1$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-05-24T20:42:17.623" LastActivityDate="2017-05-24T20:42:17.623" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="34389" PostTypeId="2" ParentId="34387" CreationDate="2017-05-24T18:50:30.073" Score="2" Body="&lt;p&gt;Of course $E_t[S_T]\neq E^*_t[S_T]$, but you forgot that you have to discount at different rates. In particular you can verify that $S_t =e^{-r(T-t)}E^*_t[S_T]=e^{-\mu(T-t)}E_t[S_T]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: just to give you a little bit of intuition. When you move from physical to risk neutral probability you are simply saying that you can always rewrite the ratio $\frac{P(\omega)}{R(\omega)}$ in terms of risk neutral probabilities $\frac{Q(\omega)}{R_f}$ if $Q(\omega)\equiv\frac{P(\omega)R_f}{R(\omega)}$&lt;/p&gt;&#xA;" OwnerUserId="8028" LastEditorUserId="8028" LastEditDate="2017-05-24T19:31:05.670" LastActivityDate="2017-05-24T19:31:05.670" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34390" PostTypeId="2" ParentId="34385" CreationDate="2017-05-25T00:00:02.960" Score="2" Body="&lt;p&gt;It cannot be the case if the Gaussian model is the true model.  If you see that then your observations are consistent with Mandelbrot's observations in 1963.  See in particular:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mandelbrot B (1963) The variation of certain speculative prices. The Journal of Business 36(4):394–419&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am going to get downvoted for this, but the reason it is not Gaussian is that it is already proven that it can only be Gaussian under one circumstance which is when you believe you will take a loss in every period ignoring the impact of chance effects.  It is possible to get some positive returns if the mean is a small persisting loss and a high enough relative standard deviation.  You can find the literature for this under:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mann H,  Wald A (1943) On the statistical treatment of linear stochastic difference equations. Econometrica 11:173–200&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;White JS (1958) The limiting distribution of the serial correlation coefficient in the explosive case. The Annals of Mathematical Statistics 29(4):1188–1197&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This last article was extended by Rao to all finite order AR cases, but I cannot remember where the citation is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These are both for the Fisher's likelihoodist perspective on probability.  For Pearson and Neyman's interpretation of probability, the CAPM and related models cannot exist.  The discussion is way too long for here.  The short version would be this, however.  The White article shows that &lt;em&gt;no estimator&lt;/em&gt; exists for mean-variance finance in Fisher's understanding of probability for models like the CAPM or Black-Scholes.  This isn't directly obvious, unfortunately.  Pearson and Neyman's method would allow something like Theil's regression as a valid tool, but as it is a median and interquartile range based tool, you won't have mean-variance finance you will have median-interquartile range finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wrote an article on the Bayesian case because Bayesian statistics are always admissible statistics and non-Bayesian statistics are admissible only if they match the Bayesian at ever sample or at the limit.  The original Wald article on this,* An Essentially Complete Class of Decision Functions* is less readable than, say &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Parmigiani G, Inoue L (2009) Decision Theory: Principles and Approaches. Wiley Series in Probability and Statistics, Wiley, Chichester, West Sussex&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For my article, you can read Harris, David E., The Distribution of Returns (August 24, 2016). Available at SSRN: &lt;a href=&quot;https://ssrn.com/abstract=2828744&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://ssrn.com/abstract=2828744&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would point out that the original GARCH article was tested on stocks and they discovered that stocks strongly violated the underlying assumptions of the tool.  The irony is that no one seems to read that part and GARCH has been around ever since.  I am about to revise the above article for final submission for publication.  My article arrives at the Bayesian solution and the solution for regression models, including non-Bayesian cases.  I would reproduce it here with citations, but it took three page, and I don't care to retype and recite three pages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did a &lt;em&gt;population&lt;/em&gt; test on the major portion of the paper for all end of day trades in the CRSP universe from 1925-2013 minus some things like shell companies and so forth.  As all model selection processes are either Bayesian processes or limiting forms of Bayesian processes, I granted only one chance in one million that the above article was correct.  The assumption of Gaussianity was granted 999999/100000 prior probability of truth.  The Gaussian model was rejected overwhelmingly despite the prior bias for it.  People can argue theory all they want, but it's crazy to argue with the population of the data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Go back to the very first GARCH paper, I have it in a file somewhere, but I don't have the citation on me because I cannot find it in them.  It warns that stocks don't have the properties necessary for GARCH to work.  You are getting the response because you are using algorithms whose distance from nature is so great that the Kullback–Leibler divergence between what you are estimating and how you are estimating is very large.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recommend all of the above papers and you can quit using GARCH now.  Also, note this is not a self-promotion posting, but there are few peer-reviewed arguments since the '60s on this, and they don't provide a first principles reason for the distributions that are observed.  While there are articles on various stable distributions, they are basically articles on fitting parameters rather than why the parameters exist in the first place.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I were you I would start with the Parmigiani book as it is not about finance at all and instead about background mathematical principles.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2017-05-25T00:00:02.960" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34392" PostTypeId="1" CreationDate="2017-05-25T07:13:28.970" Score="9" ViewCount="2915" Body="&lt;p&gt;I am primarily looking for price and market cap histories for cryptocurrencies like Bitcoin, Ethereum, zcash, ... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are some good data sources and APIs where I can download history as well as get updates of current prices?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A nice to have would be Level 1 and Level 2 data of the order books of different exchanges but that's secondary.&lt;/p&gt;&#xA;" OwnerUserId="142" LastActivityDate="2019-08-01T08:20:54.530" Title="Which data sources are available for cryptocurrencies?" Tags="&lt;data&gt;&lt;market-data&gt;&lt;fx&gt;&lt;historical-data&gt;&lt;bitcoin&gt;" AnswerCount="6" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="34394" PostTypeId="1" CreationDate="2017-05-25T09:52:12.057" Score="2" ViewCount="157" Body="&lt;p&gt;I have got a question regarding the Vasicek Model and the corresponding Bond Pricing Equation (BPE).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Starting with a short-rate process (under measure $P$ or real world drift $u(r,t)$) of the form:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dr = u(r,t)dt + w(r,t)dX$ with $dX$ being a GBM&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Applying the steps to derive the BPE for the Bond Price $V(r,t)$:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Set up hedged portfolio: $\Pi$ $= V_1 - \Delta$$V_2$&lt;/li&gt;&#xA;&lt;li&gt;Apply no arbitrage condition: $d\Pi$ $= dV_1 - \Delta$$dV_2 = r\Pi$$dt$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Using Ito and removing the risk by defining $\Delta =$ $\frac{\frac{V_1}{\delta r}}{\frac{V_2}{\delta r}}$ we end up having to define the universal contsant $a(r,t)$ which allows us to drop the subscripts $_1$ and $_2$ making the Bond price independent of its maturity $T_1$ and $T_2$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$a(r,t) = \lambda (r,t) w(r,t) - u(r,t)$ with $\lambda (r,t)$ being the Market price of risk.&#xA;Applying all these steps and definitions we end with the parabolic partial differential heat equation for the Bond price:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \frac{\delta V}{\delta t}+\frac{1}{2}w^2\frac{\delta ^2V}{\delta r^2}+(u-\lambda w)\frac{\delta V}{\delta r} - rV = 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which displays a risk-neutral form since $\lambda $ can be seen as a Sharpe ratio defining the excess return for each unit of taken risk $w$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ok, this was kind of a long way to finally derive at my question :-). When using the Vasicek Model for the short-rate process defined as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dr = (\eta - \gamma r)dt + \beta ^\frac{1}{2}dX$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the BPE in all textbooks I have seen is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \frac{\delta V}{\delta t}+\frac{1}{2}\beta \frac{\delta ^2V}{\delta r^2}+(\eta - \gamma r)\frac{\delta V}{\delta r} - rV = 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence we define $a = \gamma r - \eta = \lambda w - u = \lambda \beta ^\frac{1}{2} - (\eta - \gamma r)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I struggle to understand this. Do we assume that in the Vasicek model the market price of risk $\lambda = 0$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much in advance for any helpful comments!&lt;/p&gt;&#xA;" OwnerUserId="28096" LastActivityDate="2017-05-25T09:52:12.057" Title="Basic Interest Rate Modelling Ques" Tags="&lt;interest-rates&gt;&lt;short-rate&gt;&lt;vasicek&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34395" PostTypeId="1" CreationDate="2017-05-25T13:16:14.797" Score="0" ViewCount="1331" Body="&lt;p&gt;I am using the &lt;code&gt;fGarch&lt;/code&gt; package in R to analyze stock volatility. To do this I am using the &lt;code&gt;garchFit&lt;/code&gt; formula on my time series. The general form of &lt;code&gt;garchFit&lt;/code&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;garchFit(formula = ~ garch(1, 1), data = dem2gbp,&#xA;init.rec = c(&quot;mci&quot;, &quot;uev&quot;),&#xA;delta = 2, skew = 1, shape = 4,&#xA;cond.dist = c(&quot;norm&quot;, &quot;snorm&quot;, &quot;ged&quot;, &quot;sged&quot;, &quot;std&quot;, &quot;sstd&quot;,&#xA;&quot;snig&quot;, &quot;QMLE&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I was wondering if there is a way to adapt the formula so that I can fit an &lt;code&gt;EGARCH(1, 1)&lt;/code&gt;. Currently I am only able to change the lag lengths &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt;. &lt;/p&gt;&#xA;" OwnerUserId="28111" LastEditorUserId="848" LastEditDate="2017-05-25T17:38:01.750" LastActivityDate="2018-05-21T00:02:08.277" Title="EGARCH fitting in R" Tags="&lt;programming&gt;&lt;garch&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34396" PostTypeId="2" ParentId="34380" CreationDate="2017-05-25T13:44:25.517" Score="1" Body="&lt;p&gt;The quote is based on the FX quote to achieve FX parity for your given rates. To understand how it works you can go to {FXFA} which uses the same principle. If you go to help on FXFA you can check the model together with all the calculations. &lt;/p&gt;&#xA;" OwnerUserId="27969" LastActivityDate="2017-05-25T13:44:25.517" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34399" PostTypeId="2" ParentId="34395" CreationDate="2017-05-25T17:21:43.007" Score="1" Body="&lt;p&gt;As far as I'm aware this is not possible with just &lt;code&gt;fGarch&lt;/code&gt; but is with the &lt;a href=&quot;https://cran.r-project.org/web/packages/rugarch/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;code&gt;ruGarch&lt;/code&gt;&lt;/a&gt; package. See this &lt;a href=&quot;https://stackoverflow.com/q/41723575/862288&quot;&gt;question on StackOverflow&lt;/a&gt; for a discussion and more information. &lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2017-05-25T17:21:43.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34402" PostTypeId="2" ParentId="34337" CreationDate="2017-05-26T05:27:50.940" Score="1" Body="&lt;p&gt;I don't see a reason why it should not be possible to apply peak-over-threshold to the returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also see page 15 of&#xA;&lt;a href=&quot;https://www.soa.org/library/newsletters/risk-management-newsletter/2009/september/jrm-2009-iss17-levine.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.soa.org/library/newsletters/risk-management-newsletter/2009/september/jrm-2009-iss17-levine.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They use EVT on returns.&lt;/p&gt;&#xA;" OwnerUserId="22686" LastActivityDate="2017-05-26T05:27:50.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34403" PostTypeId="1" CreationDate="2017-05-26T06:18:23.850" Score="0" ViewCount="499" Body="&lt;p&gt;From risk management point of view using cleaned data (excluding or modifying extreme/outlier observations) would give less conservative measure as compared to real-world raw data. So they are more reluctant to base their conclusions on facts that are really observed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, portfolio managers would want to use cleaned data in order to get a more &lt;code&gt;robust and stable estimation of the distribution generating the large majority of the return data&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a result when they optimize their portfolio using some sort of risk measure (st.dev, CVaR, etc.) these two parties will get totally different picture.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should having two different approaches be allowed in the first place? If yes, then how conflict situations (e.g. exceeding risk budgets) can be solved? In what cases do you think data cleaning is permissible? Sort of philosophical questions, but would love to know your thoughts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you all for the answers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;@will, if data is error-free but has some outliers/extreme values, as per the below it seems to be fine to somehow reduce their impact in portfolio optimization:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.ine.pt/revstat/pdf/rs070106.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Application of robust statistics to asset allocation models&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Many strategies for asset allocation involve the computation of the&#xA;  expected value and the covariance matrix of the returns of financial&#xA;  instruments. How much of each instrument to own is determined by an&#xA;  attempt to minimize risk — the variance of linear combinations of&#xA;  investments in these financial assets — subject to various constraints&#xA;  such as a given level of return, concentration limits, etc. The&#xA;  covariance matrix contains many parameters to estimate and two main&#xA;  problems arise. &lt;strong&gt;First, the data will very likely have outliers that&#xA;  will seriously affect the covariance matrix.&lt;/strong&gt; Second, with so many&#xA;  parameters to estimate, a large number of return observations are&#xA;  required and the nature of markets may change substantially over such&#xA;  a long period. In this paper we discuss using &lt;strong&gt;robust covariance&#xA;  procedures, FAST-MCD, Iterated Bivariate Winsorization and Fast 2-D&#xA;  Winsorization, to address the first problem&lt;/strong&gt; and penalization methods&#xA;  for the second. When back-tested on market data, these methods are&#xA;  shown to be effective in improving portfolio performance. &lt;strong&gt;Robust asset&#xA;  allocation methods have great potential to improve risk-adjusted&#xA;  portfolio returns and therefore deserve further exploration in&#xA;  investment management research&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://link.springer.com/chapter/10.1007%2F978-0-387-77439-8_11&quot; rel=&quot;nofollow noreferrer&quot;&gt;Robust Portfolio Construction&lt;/a&gt; (can't find the full version)&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Outliers in asset returns factors are a frequently occurring&#xA;  phenomenon across all asset classes and can have an adverse influence&#xA;  on the performance of mean–variance optimized (MVO) portfolios. This&#xA;  occurs by virtue of the unbounded influence that outliers can have on&#xA;  the mean returns and covariance matrix estimates (alternatively,&#xA;  correlations and variances estimates) that are inputs are optimizer&#xA;  inputs. &lt;strong&gt;A possible solution to the problem of such outlier sensitivity&#xA;  of MVO is to use robust estimates of mean returns and covariance&#xA;  matrices in place of the classical estimates of these quantities&#xA;  thereby providing robust MVO portfolios. We show that the differences&#xA;  occurring between classical and robust estimates for these portfolios&#xA;  are such as to be of considerable concern to a portfolio manager. It&#xA;  turns out that robust distances based on a robust covariance matrix&#xA;  can provide reliable identification of multidimensional outliers in&#xA;  both portfolio returns and the exposures matrix of a fundamental&#xA;  factor model, something that is not possible with one-dimensional&#xA;  Winsorization.&lt;/strong&gt; Multidimensional visualization combined with clustering&#xA;  methods is also useful for returns outlier identification. The&#xA;  question of using robust and classical MVO vs. optimization-based&#xA;  fat-tailed skewed distribution fits and downside risk measure is&#xA;  briefly discussed. Some other applications of robust methods in&#xA;  portfolio management are described, and we point out some future&#xA;  research that is needed on the topic.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.master272.com/finance/AQPM/2004_Charles.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Outliers and Portfolio Optimization&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In this paper we study the impact of outliers on global minimum&#xA;  variance portfolios. From the method developed by Gomez and Maravall&#xA;  (1997, 2000), we detect and correct outliers in Cac40 French index and&#xA;  in three French stocks included in it. It appears that all financial&#xA;  data present outliers, some of them may be explained by economic and&#xA;  financial events. We calculate the conditional volatility forecast for&#xA;  60, 120 and 180 business days, using GARCH (1,1) model with 440&#xA;  observations. As suggested by Franses and Ghijsels (1999), we show&#xA;  that outliers disturb the volatility estimates. Indeed, it seems&#xA;  better to correct outliers before forecasting volatility than used&#xA;  unadjusted series. To evaluate the forecast error, we compute the MSPE&#xA;  and the MAPE. &lt;strong&gt;Finally, we examine the impact of outliers on the&#xA;  global variance minimum portfolio structure. The weights of each&#xA;  stocks are significantly different if the series are beforehand&#xA;  ajusted or not. Moreover, portfolio evaluation is better for adjusted&#xA;  data rather than for unadjusted data. Consequently, it seems important&#xA;  to take into account outliers in portfolio optimisation because they&#xA;  affect portfolio variance, weights of portfolio and portfolio&#xA;  evaluation.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;There are some other resources, but I do not have full access. Also, I clearly recall where practitioners mentioned taking care of outliers in portfolio construction. Obviously, they were clear and open about their &quot;manipulations&quot; (e.g. threw away 2-3 observations from 2007-08 period). That is why I was wondering if this approach has some merits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;@noob2 - I was looking at &lt;code&gt;clean.boudt&lt;/code&gt; as a potential solution for outlier detection and data cleaning.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any further thoughts on this?&lt;/p&gt;&#xA;" OwnerUserId="19096" LastEditorUserId="19096" LastEditDate="2018-03-03T06:24:30.700" LastActivityDate="2018-03-03T06:24:30.700" Title="Data: to clean or not to clean" Tags="&lt;data&gt;&lt;portfolio-management&gt;&lt;risk-management&gt;" AnswerCount="1" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="34406" PostTypeId="1" CreationDate="2017-05-26T13:37:50.713" Score="3" ViewCount="34" Body="&lt;p&gt;I'm currently working on predicting bear and bull phases with a dynamic probit model in the form of $y_t=\beta_1X_t+\gamma_1y_{t-1}+\epsilon_t$. So far I've written all my code in matlab and it works as expected when I set the event bear phase as 0 and the event bull phase as 1. Out of curiosity, I've now set the bull phase to 0 and the bear phase to 1, since I figured that, in a binary setting, $P_0$ should be $(1-P_1)$ and that it shouldn't matter which outcome is 1 and which is 0. However, Matlab delivered completly different and somewhat disappointing results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now ,my question is: Am I overlooking a theoretical concept that prohibits the use of 1 and 0 and the results are to be expected or is my code just plain wrong?   &lt;/p&gt;&#xA;" OwnerUserId="20694" LastActivityDate="2017-05-26T13:37:50.713" Title="Binary probit model: relevant which outcome is 1?" Tags="&lt;time-series&gt;&lt;probability&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34409" PostTypeId="2" ParentId="23211" CreationDate="2017-05-26T18:47:23.443" Score="2" Body="&lt;p&gt;As @piRSquared has pointed out, smart beta can be an ambiguous term which is&#xA;fairly loosely defined. Cliff Asness wrote a &lt;a href=&quot;https://www.aqr.com/cliffs-perspective/smart-beta-not-new-not-beta-still-awesome&quot; rel=&quot;nofollow noreferrer&quot;&gt;paper&lt;/a&gt; defining smart beta as&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;To be considered Smart Beta, we believe that&#xA;  these factors must also be simple and transparent.&#xA;  However, they don’t have to be the&#xA;  same for all managers or products. One can,&#xA;  and many do, argue that their particular version&#xA;  of simple value, low risk or any other&#xA;  tilt is better&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;He also has a more in depth discussion on the blurred line between alternative&#xA;beta and alpha &lt;a href=&quot;https://www.aqr.com/cliffs-perspective/how-can-a-strategy-still-work-if-everyone-knows-about-it&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tend to think about smart beta (which I use&#xA;synonomously with alternative risk premia) as an investment which offers&#xA;positive expected returns above cash and which requires little to no &quot;timing&quot;,&#xA;a term I will make clear below. This definition would include things like equity&#xA;beta, global duration, and currency carry.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use timing in this context to mean the sensitivity of the investment&#xA;strategy's performance with respect to being executed on a specific schedule. While there are many ways to quantify this,&#xA;one method is to look at the correlation of the strategy&#xA;returns with lagged implementations of the same strategy. i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;Corr(X(0), X(L))&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $X(L)$ is a time series of the strategy's returns with the value at time $t$ is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;X(L)_t = \sum_{i=1}^N r^{i}_{t}h^{i}_{t-L}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $N$ is the number of assets, $r^{i}_{t}$ is the return of the $i^{th}$&#xA;asset at time $t$ and $h^{i}_{t}$ is the holdings of the $i^{th}$&#xA;asset at time $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The most extreme example of this would be a constant allocation to stock beta.&#xA;In this case delaying rebalancing would have no effect on the strategy, since we&#xA;are always long a constant amount.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/pYSGP.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/pYSGP.png&quot; alt=&quot;Constant beta&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the other extreme, if you create a strategy that has a 1 day look ahead bias&#xA;which goes long 1 unit when prices go up and short 1 unit when prices go down&#xA;then you have no correlation at different lags, confirming the idea that this is a pure alpha strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/3q0Yq.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/3q0Yq.png&quot; alt=&quot;Timing beta&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Somewhere in between you would have something like currency carry, which I would&#xA;consider a risk premia style strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/hGTmE.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/hGTmE.png&quot; alt=&quot;Carry&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5420" LastActivityDate="2017-05-26T18:47:23.443" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34411" PostTypeId="1" CreationDate="2017-05-27T03:23:26.080" Score="2" ViewCount="57" Body="&lt;p&gt;I am looking for Matlab or R codes for goodness of fit test of time varying copulas. I am able to calculate AIC for them using the Patton copula toolbox, but i want to do goodness of fit test using the known tests such as Cramer-von Mises , Anderson-Darling and etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;any help would be appreciated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards &#xA;Esmaeel&lt;/p&gt;&#xA;" OwnerUserId="28128" LastActivityDate="2017-05-27T03:23:26.080" Title="Goodness of fit test for time varying copulas" Tags="&lt;programming&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34412" PostTypeId="1" CreationDate="2017-05-27T10:40:44.383" Score="5" ViewCount="690" Body="&lt;p&gt;I'm currently writing a master thesis where I look at the predictive power of Google search volume in predicting the movement of the Norwegian Stock Market (Oslo Børs). I'm using Google search volume index (SVI) as a predictor (with other control variables) regressed against three measures: the stock return, the trading volume and the volatility. My sample consist 28 companies from the OBX index. The regression will be based on both cross-sectional and time-series data, thus it is necessary to arrange the data as panel data in order to analyse both types of data simultaneously. Panel data analysis is normally conducted with either fixed effect or random effect. And we run the Hausman test to see which of the two should be applied. So to my question, regardless what the Hausmen test tells, in my case which of those two effects should be applied? Or which one would make more sense to be applied? &lt;/p&gt;&#xA;" OwnerUserId="26935" LastActivityDate="2019-12-29T22:01:45.220" Title="Panel data - Use fixed effect or random effect in predicting stock returns" Tags="&lt;econometrics&gt;&lt;paneldata&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34414" PostTypeId="1" AcceptedAnswerId="34416" CreationDate="2017-05-27T11:00:18.207" Score="8" ViewCount="363" Body="&lt;p&gt;Assume there are two stocks $S_1$ with price $p_1(t)$ and $S_2$ with price $p_2(t)$ where $t$ indicates time. Assume, there is a hypothetical derivative $D$, which is such that, price of $D$ at a time $t$ is given by $p_1(t)/p_2(t)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to find a dynamic hedging strategy using stocks and bonds to construct this derivative?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If yes, then how?&lt;/p&gt;&#xA;" OwnerUserId="28131" LastEditorUserId="28131" LastEditDate="2017-05-27T14:47:42.747" LastActivityDate="2017-07-13T12:27:19.110" Title="Replicating a portfolio with a certain payoff function" Tags="&lt;equities&gt;&lt;derivatives&gt;&lt;hedging&gt;&lt;finance-mathematics&gt;&lt;replication&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34416" PostTypeId="2" ParentId="34414" CreationDate="2017-05-27T14:25:34.250" Score="6" Body="&lt;h2&gt;A general hedging strategy&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Let assume that $S_1(t)$ and $S_2(t)$ are the price processes of your 2 stocks and that they follow a Geometric Brownian Motion (GBM):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\forall \, i \in \{1,2\}, dS_i(t) =\mu_iS_i(t)dt + \sigma_iS_i(t)dW_i(t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We assume both stocks have an instant correlation of $\rho$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dW_1(t)dW_2(t)=\rho dt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let also $V(t)$ be the value or (fair) price of a derivative that depends on prices $S_1(t)$ and $S_2(t)$ at time $t$. We construct a self-financing portfolio made up of $w_0(t)$ derivative contracts, $w_1(t)$ shares of stock $1$ and $w_2(t)$ shares of stock $2$. Its value at $t$, $\Pi(t)$, is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Pi(t) = w_0(t)V(t)+w_1(t)S_1(t)+w_2(t)S_2(t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The portfolio value, being self-financing, evolves according to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ d\Pi(t) = w_0(t)dV(t) + w_1(t)dS_1(t) + w_2(t)dS_2(t) $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We then have $-$ dropping time:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dV = \frac{\partial V}{\partial t}dt + \frac{\partial V}{\partial S_1}dS_1 + \frac{\partial V}{\partial S_2}dS_2 + \frac{1}{2}\frac{\partial^2 V}{\partial S_1^2}dS_1^2 + \frac{1}{2}\frac{\partial^2 V}{\partial S_2^2}dS_2^2 + \frac{\partial^2 V}{\partial S_1 \partial S_2}dS_1dS_2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the above differential equation, multiplied back by weight $w_0(t)$, the random element is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{\partial V}{\partial S_1}w_0\sigma_1S_1dW_1 + \frac{\partial V}{\partial S_2}w_0\sigma_2S_2dW_2 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, in $w_1(t)S_1(t)+w_2(t)S_2(t)$, the random element is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ w_1\sigma_1S_1dW_1 + w_2\sigma_2S_2dW_2 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We are hedging the derivative $V(t)$, hence our portfolio must be &lt;em&gt;riskless&lt;/em&gt; and &lt;em&gt;earn the risk-free rate&lt;/em&gt;: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;From the riskless condition, random fluctuations must be cancelled. Using the portfolio value equation, we derive the hedging strategy:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;w_0(t) &amp;amp; = \frac{\Pi(t)}{V(t)-S_1(t)\frac{\partial V}{\partial S_1}-S_2(t)\frac{\partial V}{\partial S_2}}&#xA;\\[12pt]&#xA;w_1(t) &amp;amp;= -w_0(t)\frac{\partial V}{\partial S_1}&#xA;\\[12pt]&#xA;w_2(t) &amp;amp;= -w_0(t)\frac{\partial V}{\partial S_2}&#xA;\end{align} $$ &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;We let $B(t) = e^{rt}$ be a riskless bond earning the risk-free rate $r$. Given the portfolio must earn $r$ and assuming $\Pi(0)$ is normalized so as to be equal to $1$, then $B(t)$ is a solution to the risk-free return constraint :&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$$d\Pi(t) = r\Pi(t) dt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The final expression of the hedging portfolio is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;w_0(t) &amp;amp; = \frac{B(t)}{V(t)-S_1(t)\frac{\partial V}{\partial S_1}-S_2(t)\frac{\partial V}{\partial S_2}}&#xA;\\[12pt]&#xA;w_1(t) &amp;amp;= -w_0(t)\frac{\partial V}{\partial S_1}&#xA;\\[12pt]&#xA;w_2(t) &amp;amp;= -w_0(t)\frac{\partial V}{\partial S_2}&#xA;\end{align} $$ &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Your question&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Now, in the particular case of your derivative and &lt;strong&gt;&lt;em&gt;interpreting strictly&lt;/em&gt;&lt;/strong&gt; your original question:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot; [...] &lt;em&gt;price of&lt;/em&gt; [the derivative] $D$ &lt;em&gt;at a time $t$ is given by&lt;/em&gt; $\frac{S_1(t)}{S_2(t)}$. &quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The price is then given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ V(t) = \frac{S_1(t)}{S_2(t)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have $\partial V/\partial S_1 = 1/S_2 = V/S_1$ and $\partial V/\partial S_2 = -S_1/S_2^2 = -V/S_2$, hence the hedging strategy &lt;em&gt;would&lt;/em&gt; be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;w_0(t) &amp;amp;= \frac{B(t)}{V(t)}&#xA;\\[12pt]&#xA;w_1(t) &amp;amp;= -\frac{B(t)}{V(t)}\frac{\partial V}{\partial S_1} = -w_0(t)\frac{\partial V}{\partial S_1}&#xA;\\[12pt]&#xA;w_2(t) &amp;amp;= -\frac{B(t)}{V(t)}\frac{\partial V}{\partial S_2} = -w_0(t)\frac{\partial V}{\partial S_2}&#xA;\end{align} $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;However, I am not sure that positing the price&lt;/em&gt; $V(t)$ &lt;em&gt;is the correct approach&lt;/em&gt;: the price of the derivative at $t$ should be derived from its payoff function and the PDE resulting from the risk-free return condition. After a few steps, we would get the following PDE $-$ dropping time:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;rV &amp;amp; = \frac{\partial V}{dt} + \frac{\partial V}{\partial S_1}rS_1 + \frac{1}{2}\frac{\partial^2V}{\partial S_1^2}\sigma_1^2S_1^2 + \frac{\partial V}{\partial S_2}rS_2 + \frac{1}{2}\frac{\partial^2V}{\partial S_2^2}\sigma_2^2S_2^2 + \frac{\partial^2V}{\partial S_1 \partial S_2}\sigma_1\sigma_2S_1S_2\rho&#xA;\\[12pt]&#xA;&amp;amp; = \frac{\partial V}{dt} + rw_1S_1 + \frac{1}{2}\frac{\partial^2V}{\partial S_1^2}\sigma_1^2S_1^2 + rw_2S_2 + \frac{1}{2}\frac{\partial^2V}{\partial S_2^2}\sigma_2^2S_2^2 + \frac{\partial^2V}{\partial S_1 \partial S_2}\sigma_1\sigma_2S_1S_2\rho&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solving it would yield the value of $V(t)$. Note that weight $w_0$ does not appear in the PDE above because all three weights $w_0$, $w_1$ and $w_2$ can be written as a function of $w_0$, hence the term $w_0$ ends up being cancelled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this particular case, by replacing the derivatives by their specific expression $-$ which we can derive from the fact that $V(t) = S_1(t)/S_2(t)$ $-$ we obtain:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin {align}&#xA;&amp;amp; \: rV = 0 + rV + 0 - rV + \sigma_2^2V - \sigma_1\sigma_2\rho V&#xA;\\[12pt]&#xA;\Leftrightarrow &amp;amp; \: r = \sigma_2^2 - \sigma_1\sigma_2\rho&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence we would be imposing a constraint on &quot;&lt;em&gt;market&lt;/em&gt;&quot; parameters. The correct way to proceed would be to derive an expression for $V(t)$ given the PDE above.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;A final example: $V(T)=\frac{S_1(T)}{S_2(T)}$&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Let assume that your derivative has the following payoff function:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ V_T=V(T)=\frac{S_1(T)}{S_2(T)} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Switching to martingale pricing tools, we know that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \forall \, t \in [0,T], V_t = \mathbb{E}^{\mathbb{Q}}\left[e^{-r(T-t)}\frac{S_1(T)}{S_2(T)}|\mathcal{F}_t\right] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $\mathbb{Q}$ is the risk-neutral measure. Let now define $X_t = X(t) = S_1(t)/S_2(t)$. Applying Ito's lemma $-$ and dropping time:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;dX_t = \frac{dS_1}{S_2} - \frac{S_1dS_2}{S_2^2} + \frac{S_1dS_2^2}{S_2^3} - \frac{dS_1dS_2}{S_2^2}&#xA;\\[12pt]&#xA;\Leftrightarrow \frac{dX_t}{X_t} = \left(\mu_1-\mu_2-\sigma_1\sigma_2\rho+\sigma_2^2\right)dt +\sigma_1dW_1^{\mathbb{Q}} + \sigma_2dW_2^{\mathbb{Q}}&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under the risk-neutral measure, $\mu_1=\mu_2=r$. Letting $W_i(t) = W_i^{\mathbb{Q}}(t)$, after a few steps we get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;X_T = X_te^{(\sigma_2^2-\sigma_1^2-4\sigma_1\sigma_2\rho)\frac{T-t}{2}+\sigma_1W_1(T-t)+\sigma_2W_2(T-t)}&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Applying Ito's lemma to $W_1(t)W_2(t)$ and using the martingale property of the Ito integral, we get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbb{Cov}[W_1(T-t),W_2(T-t)] = \rho (T-t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, letting:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;&amp;amp; Z(t) = (\sigma_2^2-\sigma_1^2-4\sigma_1\sigma_2\rho)\frac{t}{2}+\sigma_1W_1(t)+\sigma_2W_2(t)&#xA;\\[6pt]&#xA;&amp;amp; \mathbb{E}[Z(t)] = (\sigma_2^2-\sigma_1^2-4\sigma_1\sigma_2\rho)\frac{t}{2}&#xA;\\[6pt]&#xA;&amp;amp; \mathbb{V}[Z(t)] = \sigma_1^2t + \sigma_2^2t+2\sigma_1\sigma_2\rho t&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We obtain:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbb{E}[X_T|\mathcal{F}_t] = X_te^{\sigma_2^2(T-t)-\sigma_1\sigma_2\rho (T-t)} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \forall \, t \in [0,T], V_t = \frac{S_1(t)}{S_2(t)}e^{(\sigma_2^2-\sigma_1\sigma_2\rho-r)(T-t)} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have came back to the constraint on market parameters derived in section &quot;&lt;strong&gt;Your question&lt;/strong&gt;&quot;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ r = \sigma_2^2 - \sigma_1\sigma_2\rho \quad \Rightarrow \quad V_t = \frac{S_1(t)}{S_2(t)}$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The hedging strategy would then be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;&amp;amp; w_0(t) = \frac{S_2(t)}{S_1(t)}e^{(\sigma_1\sigma_2\rho-\sigma_2^2)(T-t)+rT}&#xA;\\[12pt]&#xA;&amp;amp; w_1(t) = -\frac{e^{rt}}{S_1(t)}&#xA;\\[12pt]&#xA;&amp;amp; w_2(t) = \frac{e^{rt}}{S_2(t)}&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can easily check that $w_0(t)V(t)+w_1(t)S_1(t)+w_2(t)S_2(t) = B(t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We finally can check that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;&amp;amp; \frac{\partial V}{dt} = -(\sigma_2^2-\sigma_1\sigma_2\rho-r)V&#xA;\\[12pt]&#xA;&amp;amp; \frac{\partial V}{\partial S_1}rS_1 = rV&#xA;\\[12pt]&#xA;&amp;amp; \frac{1}{2}\frac{\partial^2V}{\partial S_1^2}\sigma_1^2S_1^2 = 0&#xA;\\[12pt]&#xA;&amp;amp; \frac{\partial V}{\partial S_2}rS_2 = -rV&#xA;\\[12pt]&#xA;&amp;amp; \frac{1}{2}\frac{\partial^2V}{\partial S_2^2}\sigma_2^2S_2^2 = \sigma_2^2V&#xA;\\[12pt]&#xA;&amp;amp; \frac{\partial^2V}{\partial S_1 \partial S_2}\sigma_1\sigma_2S_1S_2\rho = -\sigma_1\sigma_2\rho V&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Terms cancel and we are left with the following identity equation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ rV = rV $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence $V(t)$ as derived above is a solution to the pricing PDE.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Further references&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Further relevant references from Wikipedia and user @Gordon on deriving the hedging strategy and the pricing PDE for a derivative $V(t)$: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Black%E2%80%93Scholes_equation&quot; rel=&quot;nofollow noreferrer&quot;&gt;Black-Scholes equation&lt;/a&gt; (Wikipedia)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/32171/black-scholes-differential/32187#32187&quot;&gt;Black Scholes differential&lt;/a&gt; (Stack Exchange Quantitative Finance)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/34027/derivation-of-bs-pde-problem-using-delta-hedging?rq=1&quot;&gt;Derivation of BS PDE problem using Delta hedging&lt;/a&gt; (Stack Exchange Quantitative Finance)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-07-13T12:27:19.110" LastActivityDate="2017-07-13T12:27:19.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34418" PostTypeId="2" ParentId="32117" CreationDate="2017-05-27T16:56:31.523" Score="1" Body="&lt;p&gt;The Black76 formula uses &quot;F&quot; (the forward price) and Garman-Kohlhagen uses &quot;S&quot; (the spot price), but they are the same formula when you make the substitution $F ↔ Se^{(r−q)T}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which formula to use then becomes a matter of convenience. In some cases F is publicly quoted but r and q would have to be estimated, in that case (being lazy) I prefer to use F directly in the relevant formula.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-05-27T16:56:31.523" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34419" PostTypeId="2" ParentId="8099" CreationDate="2017-05-27T17:12:42.160" Score="9" Body="&lt;p&gt;This website has what you're looking for in downloadable csv/Excel format:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://rankandfiled.com/#/data/tickers&quot; rel=&quot;noreferrer&quot;&gt;http://rankandfiled.com/#/data/tickers&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="28135" LastActivityDate="2017-05-27T17:12:42.160" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34420" PostTypeId="1" AcceptedAnswerId="38259" CreationDate="2017-05-27T17:53:20.777" Score="2" ViewCount="544" Body="&lt;p&gt;The well known &lt;a href=&quot;https://en.wikipedia.org/wiki/Advanced_IRB&quot; rel=&quot;nofollow noreferrer&quot;&gt;Basel&lt;/a&gt; IRB formula is as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$${\displaystyle K=LGD*\left[N\left({\sqrt {\frac {1}{1-R}}}*G(PD)+{\sqrt {\frac {R}{1-R}}}*G(0.999)\right)-PD\right]}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the term below is the conditional probability of default:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$PD^c = N\left({\sqrt {\frac {1}{1-R}}}*G(PD)+{\sqrt {\frac {R}{1-R}}}*G(0.999)\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, after going trough the referenced &lt;a href=&quot;https://pdfs.semanticscholar.org/f1f3/08a5c6e95fee1dd9ca3c8c51d19b5128fd59.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Vasicek(2002)&lt;/a&gt; paper there is the following formula for conditional PD on page 3, which has a minus instead of plus between the two terms:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ p(Y) = N\left( \frac{N^{-1}(p) - Y \sqrt{\rho}}{\sqrt{1 - \rho}} \right) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Am I missing something obvious?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: The different notation is the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;probability of default: $PD = p $&lt;/li&gt;&#xA;&lt;li&gt;inverse normal distribution: $G = N^{-1}$ &lt;/li&gt;&#xA;&lt;li&gt;correlation between assets: $R = \rho$&lt;/li&gt;&#xA;&lt;li&gt;$Y$ is a normally distributed random variable&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="28136" LastEditorUserId="28136" LastEditDate="2017-05-27T18:23:28.067" LastActivityDate="2018-02-15T11:36:06.510" Title="Difference between the Basel IRB and the Vasicek formula" Tags="&lt;var&gt;&lt;vasicek&gt;&lt;basel&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34421" PostTypeId="2" ParentId="9179" CreationDate="2017-05-27T18:18:56.737" Score="0" Body="&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Risk_aversion&quot; rel=&quot;nofollow noreferrer&quot;&gt;Risk Aversion&lt;/a&gt; is a General Economics concept which is widely used in Finance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One example is that given a specific uncertain return $X_t$, a risk neutral investor would only care about the expected (average) return and hence would not require risk premia based on the volatility of that return $Var(X_t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A risk averse individual on the other hand would also care about the variation of the return and not only its expected value. As a result, he/she would require a premium that depends on that volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not particularly familiar with the Vasicek paper that you refer to but most likely it has to do with the preferences of the agents when they evaluate their returns and that a risk premia for volatility of those returns is not required.&lt;/p&gt;&#xA;" OwnerUserId="28136" LastActivityDate="2017-05-27T18:18:56.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34423" PostTypeId="1" CreationDate="2017-05-28T09:18:41.587" Score="0" ViewCount="267" Body="&lt;p&gt;Im working through a solution to evaluating pricing for Vasiceks model &lt;a href=&quot;https://i.stack.imgur.com/pAiST.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/pAiST.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However i dont understand the u∧t terms and how that behaves under the integrals...any help??&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers&lt;/p&gt;&#xA;" OwnerUserId="28140" LastActivityDate="2020-07-11T13:51:43.027" Title="Help evaluating covariance integral when deriving vasiceks model" Tags="&lt;vasicek&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34424" PostTypeId="1" AcceptedAnswerId="34425" CreationDate="2017-05-28T09:51:21.813" Score="2" ViewCount="6329" Body="&lt;p&gt;We've been using this formula to price Bonds.&#xA;c/y + (100-(c/y))/(1+y)^m&#xA;where&#xA;c=coupon&#xA;y=yield to maturity&#xA;m=time to maturity &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's take a 10 year U.S treasury for example.&#xA;Price of existing bonds change according to new bonds issued on the market at par. &#xA;So to price an &lt;em&gt;existing&lt;/em&gt; 10-year US Treasury, do we look at the y-t-m of a&lt;br&gt;&#xA;&lt;em&gt;newly issued&lt;/em&gt; 10-year US- treasury, to insert into the formula above? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If that is the case, does that mean that all bonds of the same maturity have the same yield to maturity? &lt;/p&gt;&#xA;" OwnerUserId="28090" LastActivityDate="2017-05-29T12:36:18.297" Title="Do all bonds of the same maturity have the same yield to maturity?" Tags="&lt;bond&gt;&lt;yield&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34425" PostTypeId="2" ParentId="34424" CreationDate="2017-05-28T12:11:46.890" Score="4" Body="&lt;p&gt;In practice, bonds of the same maturity will have yields that vary slightly from each other.  Several possible reasons (a) a bond with a higher coupon is effectively shorter maturity than a bond with lower coupon, because a higher percentage of the cash flows are returned earlier.  So if the yield curve is upward sloping, high coupon bonds will yield a bit less than low coupon bonds.  (B) liquidity.  Usually the most recently issued bond is more heavily traded so commands a higher price/lower yield than its neighbors. (C) financing. If a bond is difficult to borrow in the repo market,  which may happen if that specific bond is scarce for some reason , then it can trade at a lower yield than its neighbors.   Reason (a) above is purely mathematical. Whereas (b) and (c) are more technical in nature.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-05-28T12:11:46.890" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34426" PostTypeId="1" CreationDate="2017-05-28T12:49:00.820" Score="0" ViewCount="62" Body="&lt;p&gt;I am currently taking a course in Financial Mathematics as part of my Maths degree. Many of the covered topics are quite basic, and revolve around potential arbitrage opportunities. For example, consider the following scenario:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/gUfev.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/gUfev.png&quot; alt=&quot;question&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at part c) of this question, we deduce that the investor can make a guaranteed profit of $\$ 71.61$, with no risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In real market situations, do arbitrage opportunities like this exist, or does the No-Arbitrage Principle always hold?&lt;/p&gt;&#xA;" OwnerUserId="7714" LastActivityDate="2017-05-28T12:49:00.820" Title="How realistic are the scenarios outlined in my course?" Tags="&lt;arbitrage&gt;&lt;no-arbitrage-theory&gt;&lt;forward-rate&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34427" PostTypeId="1" CreationDate="2017-05-28T13:04:15.167" Score="1" ViewCount="458" Body="&lt;p&gt;I was reading slide 29 here:&#xA;&lt;a href=&quot;http://people.hss.caltech.edu/~jlr/courses/BEM103/Readings/JWCh11.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://people.hss.caltech.edu/~jlr/courses/BEM103/Readings/JWCh11.pdf&lt;/a&gt; (&lt;a href=&quot;https://web.archive.org/web/20170528143728/http://people.hss.caltech.edu/~jlr/courses/BEM103/Readings/JWCh11.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;mirror&lt;/a&gt;) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sub-heading: &quot;An interpretation of the Black-Scholes formula&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is saying that the below is a replication strategy of a call option.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Long $N(x)$ quantity stocks&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Sell $K R^{-T}N(x-\sigma \sqrt{T})$ quantity one dollar bonds&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;As far as I understand, any replication strategy (portfolio) must be a self financing portfolio $P$. As per definition of a self-financing portfolio : A portfolio $P$ consisting of $n$ instruments, denoted $P_i$ , with quantities $h_i$ respectively, is self financing iff&#xA;$dP=h_1 dP_1+h_2d P_2+...h_ndP_n$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I can very clearly see that the portfolio which the slide claims to be a replicating portfolio is indeed self financing if we differentiate with respect to $S$ but I cannot see how the portfolio is self financing when we consider the effect of $T$ i.e. time remaining until expiry. What I am seeing is that the above portfolio will be able to self finance for infinitesimal changes in the underlying stock price but I'm not able to see how it is able to self-finance the changes when the portfolio is changing due to the effect of $T$. Can someone please tell me if the above replication strategy can also replicate the effect of $T$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Appendix: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How I concluded that the portfolio is self financing for infinitesimal changes in $S$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The replicating portfolio is given by $P = N(x)S-K R^{-T}N(x-\sigma \sqrt{T}) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets try to prove that for infinitesimal changes in $S$, $P$ will be able to self-finance itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To prove self financing property for changes in $S$, we have to prove that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\partial_S P=h_1 \partial_S P_1+h_2 \partial_S P_2+...h_n\partial_S P_n$. [Eqn 1]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here $h_i$ is quantity of individual portfolio elements and $P_i$ is the price of that element.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For our case: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$h_1=N(x)$ = quantity of stock $S$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$h_2=K R^{-T}N(x-\sigma \sqrt{T})$ = quantity of 1 dollar bonds sold&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P_1=S$ [The stock]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P_2=1$ [$1 Bonds]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All other $h_i$ and $P_i$ are zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Begin Proof:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First lets compute LHS of Eqn 1: Its an established result: LHS = $N(x)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now lets compute RHS of Eqn 1: RHS = $N(x)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;LHS=RHS. Hence Eqn 1 Proved. Hence portfolio will self finance for small changes in $S$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I couldn't outline a similar proof for infinitesimal changes in $T$ and hence the question.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuitive explanation of the proof:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let there be an infinitesimal change in $S$ given by $dS$; in this case the replicating portfolio will change by $N(x)dS$. Now if we want to dynamically hedge the portfolio, the additional change in $P$ would be given by the multiplication of the change $dS$ and the result of differentiation of $P$ w.r.t. $S$, which turns out to be $N(x)dS$. We see that the change in the replicating portfolio w.r.t. $S$ is equal to the change in the dynamically hedged portfolio. Hence $P$ is self financing for changes in $S$. Note that I was not able to produce the same results when I considered infinitesimal changes in $T$, hence the question.&lt;/p&gt;&#xA;" OwnerUserId="28131" LastEditorUserId="28131" LastEditDate="2017-05-29T17:03:46.903" LastActivityDate="2017-05-29T17:03:46.903" Title="Is the replication porfolio for a European Call, self financing for changes in time?" Tags="&lt;black-scholes&gt;&lt;greeks&gt;&lt;replication&gt;" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="34428" PostTypeId="1" CreationDate="2017-05-28T13:07:39.523" Score="2" ViewCount="2239" Body="&lt;p&gt;For a cash-settled vanilla interest rate swaption traded with forward premium paid in full at expiry of the option, what should the &quot;mark-to-market&quot; be during the life of the option? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should it be similar to an IR swap (i.e. value of zero at trade inception) rather than including the premium in the present-value, since net money is zero at time of trade (when the premium is paid at expiry)? Or is there a standard convention?&lt;/p&gt;&#xA;" OwnerUserId="26367" LastActivityDate="2017-05-28T13:07:39.523" Title="market value of a forward premium swaption" Tags="&lt;valuation&gt;&lt;swaption&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34429" PostTypeId="1" AcceptedAnswerId="34431" CreationDate="2017-05-28T17:43:04.047" Score="2" ViewCount="194" Body="&lt;p&gt;One way to think of the value of a risky firm is through expected measure theory. On the most basic level, the value of any asset is the convolution of the probability density function of its risky payoffs onto the outcome space of these risky payoffs. In this view, equity is analogous to perpetual long call option on the value of a firm, while debt is seen as a short put option on its value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, practitioners have not broadly adopted the use of options theory in pricing underlying corporate assets and liabilities. Real options analysis has found some acceptance among specialists', but the inputs and theory to these analyses are subjective and applications are not consistent. Why has this original use of the rational pricing of risky cash flows failed to become more broadly adopted? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Samuelson &amp;amp; McKean (1965), McKean derived a closed-form solution for pricing  perpetual options. The use case of such an approach was intended to value warrants, but was also intended for use in pricing more general corporate assets and liabilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Merton (1973), &quot;the possibilities for further extension of the theory [of rational option pricing] to the pricing of corporate liabilities are discussed&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Black-Scholes (1973), the authors devote an entire section of the paper to discussing the applicability of rational pricing to corporate stocks and bonds:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;It is generally not realized that corporate liabilities other than&#xA;  warrants may be viewed as options. Consider, for example, a company&#xA;  that has common stock and bonds outstanding and whose only asset is&#xA;  shares of common stock of a second company...&#xA;  Under the conditions, it is clear that the stockholders have&#xA;  the equivalent of an option on their company's assets. In effect, the&#xA;  bond holders own the company's assets, but they have given options to&#xA;  the stockholders to buy the assets back. The value of the stock at the&#xA;  end of 10 years will be the value of the company's assets minus the&#xA;  face value of the bonds, or zero, whichever is greater.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In Cox-Ross (1976), the authors use discrete models to &quot;find explicit option valuation formulas, and solutions to some previously unsolved problems involving the pricing of securities with payouts and potential bankruptcy.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Geske (1978), the author: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;...presents a theory for pricing options on options, or compound options.&#xA;  The method can be generalized to value many corporate liabilities. The&#xA;  compound call option formula derived herein considers a call option on&#xA;  stock which is itself an option on the assets of the firm. This&#xA;  perspective incorporates leverage effects into option pricing and&#xA;  consequently the variance of the rate of return on the stock is not&#xA;  constant as Black&amp;amp;Sholes assumed, but is instead a function of the&#xA;  level of the stock price. The Black&amp;amp;Sholes formula is shown to be a&#xA;  special case of the compound option formula. This new model for puts&#xA;  and calls corrects some important biases of the Black-Scholes model.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The list of academic support continues almost indefinitely, but I still very rarely see it applied.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With some much theoretical and anecdotal support, I am surprised that this topic hasn't found broader support. I can surmise a few reasons why it is not broadly used. Chief among these, markets for underlying assets are not complete, and arbitrage relationship between risky cash flows and their underlying drivers can be very firm-specific (or even totally ambiguous). There may be other reasons, but I wanted to gather some input from the community on your opinions. Maybe the theory is more broadly used than I realize, in which case, I'd also like to know where and how.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2017-06-04T22:25:44.497" LastActivityDate="2017-06-05T12:32:18.303" Title="Why aren't option pricing models more frequently used to value risky cash flows?" Tags="&lt;option-pricing&gt;&lt;equities&gt;&lt;fixed-income&gt;&lt;asset-pricing&gt;&lt;valuation&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34430" PostTypeId="2" ParentId="34367" CreationDate="2017-05-28T18:28:23.413" Score="3" Body="&lt;p&gt;The only way you can use limit orders to provide liquidity is to post prices that are the same as the prices of the limit orders, and then you will not be earning any spread. In other words, what you are asking is not possible, since to earn spread you would have to quote a bid that is lower than the price of your client's limit buy order, or an offer that is higher than your limit sell order. This of course runs the very real risk that the client will not get filled on their order, when had their non-discounted interest been advertised to the market, they might have been filled.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, doing that (spreading the client's order) would be unethical, since you would not be exposing the client's true interest to the market, but rather a discounted interest (unless there exists an explicit understanding between you and your client that you would be acting in this manner). The client has placed their trust in you to execute the order faithfully, and instead you are using the client's interest to earn risk-free profit in a way that jeopardizes their order's execution.&lt;/p&gt;&#xA;" OwnerUserId="28145" LastActivityDate="2017-05-28T18:28:23.413" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34431" PostTypeId="2" ParentId="34429" CreationDate="2017-05-28T19:52:16.187" Score="3" Body="&lt;p&gt;There are papers out there applying this approach. Try looking up Leland, Leland&amp;amp;Toft (1994 and 1996) for modelling corporate liabilities, resulting in a series of interesting results. Also, it might be worth looking into a structural credit risk modelling approach (in contrast to a reduced form approach (see Lando (2001 or 2004) for more)). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are also papers using this approach to decide firms are over/underlevered. Otherwise there is the KMV model also using this structural approach for determining credit risk (google it, there is a ton of stuff on this). This is a very interesting area.  &lt;/p&gt;&#xA;" OwnerUserId="26454" LastActivityDate="2017-05-28T19:52:16.187" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34432" PostTypeId="1" CreationDate="2017-05-28T21:50:06.820" Score="3" ViewCount="64" Body="&lt;p&gt;&lt;a href=&quot;https://youtu.be/jGlvLXE82ug?t=34m45s&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Best of Value Investing - Part 1&lt;/a&gt; says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Study show [sic] that about two thirds of acquisitions end up destroying shareholder value. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What study has shown that?&lt;/p&gt;&#xA;" OwnerUserId="2183" LastEditorUserId="2183" LastEditDate="2017-05-28T21:56:49.920" LastActivityDate="2017-05-28T21:56:49.920" Title="What study has shown that &quot;about two thirds of acquisitions end up destroying shareholder value&quot;?" Tags="&lt;equities&gt;&lt;research&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34433" PostTypeId="1" AcceptedAnswerId="34434" CreationDate="2017-05-28T23:05:25.973" Score="4" ViewCount="8342" Body="&lt;p&gt;Are any free Forex data APIs available?  There are a ton of historical data repositories that are freely available but what about a live, streaming data API?  1 minute updates or tick data would be great.&lt;/p&gt;&#xA;" OwnerUserId="28146" LastActivityDate="2020-12-30T11:38:14.137" Title="Place to get free live Forex quotes via API?" Tags="&lt;programming&gt;&lt;data&gt;&lt;fx&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34434" PostTypeId="2" ParentId="34433" CreationDate="2017-05-28T23:11:00.020" Score="3" Body="&lt;p&gt;Your options for real-time tick data are limited, but there are some:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Limited pairs, multiple updates per minute (HTML format) &lt;a href=&quot;http://webrates.truefx.com/rates/connect.html?f=html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://webrates.truefx.com/rates/connect.html?f=html&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The only reliable/free JSON API: &lt;a href=&quot;http://1forge.com/forex-data-api&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://1forge.com/forex-data-api&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="28147" LastActivityDate="2017-05-28T23:11:00.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34438" PostTypeId="1" CreationDate="2017-05-29T08:38:55.590" Score="-1" ViewCount="649" Body="&lt;p&gt;I thought my broker (Interactive Brokers) was offering this but looks like what they actually supply is IV / with historical realized volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also checked Quandl but as this is not data for serious work (at least yet) but a research blog post I am not keen to pay Zacks data charges. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any free data source for historical IV on US equities or pre-generated IV percentiles/ranks?&lt;/p&gt;&#xA;" OwnerUserId="26443" LastActivityDate="2017-09-26T20:52:42.973" Title="Where to get historical IV rank &amp; IV percentile data?" Tags="&lt;equities&gt;&lt;data&gt;&lt;implied-volatility&gt;&lt;market-data&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34439" PostTypeId="1" AcceptedAnswerId="34441" CreationDate="2017-05-29T09:34:48.873" Score="0" ViewCount="144" Body="&lt;p&gt;I'd like to compare the swap rates using OIS discounting $S_{a,b}^{OIS, 6M}$ and a swap rate $S_{a,b}$  not using OIS discounting:&#xA;$$S_{a,b}^{OIS, 6M}=\sum_{a+1}^b L_{6M}(0,T_i,T_{i+6M})\times df^{OIS}(O,T_i)/\sum_{a+1}^b df^{OIS}(O,T_i)$$&#xA;and:&#xA;$$S_{a,b}=\sum_{a+1}^b L(0,T_i,T_{i+6M})\times df(O,T_i)/\sum_{a+1}^b df(O,T_i)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's suppose for simplification that the rates are positive. Is there a way to compare both in general? Thanks you in advance.&lt;/p&gt;&#xA;" OwnerUserId="27971" LastActivityDate="2017-05-29T10:35:41.080" Title="Swap rates comparison" Tags="&lt;swaps&gt;&lt;ois-discounting&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34440" PostTypeId="2" ParentId="34439" CreationDate="2017-05-29T10:26:56.153" Score="0" Body="&lt;p&gt;As you can see the swap rate is a weighted average of the forward Libors.  Since Libor&gt;OIS, we typically have df(OIS)&gt;df, so the OIS discounted swap rate is more heavily weighted towards the back end of the swap.  In an upward sloping yield curve which we currently have, this means that the OIS discounted swap rate is slightly higher than the non OIS.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-05-29T10:26:56.153" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="34441" PostTypeId="2" ParentId="34439" CreationDate="2017-05-29T10:35:41.080" Score="0" Body="&lt;p&gt;Please note that there is a slight indexing error in your formulas: for standard upfront swaps the libor rate paid on $T_i$ covers the period $[T_{i-6M}, T_i]$ so the correct formula for the swap rate is &#xA;$$&#xA;S_{a,b}^{OIS,6M} = \sum_{i=a+1}^b L_{6M}(0, T_{i-6M}, T_{i}) \times df^{OIS}(0, T_i)/\sum_{i=a+1}^b df^{OIS}(0, T_i)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As can be seen from this formula, the swap rate is a weighted average of forward libor rates $L_{6M}(0, T_{i-6M}, T_{i})$, the weights being the discount factors divided by the fixed leg PV01: &#xA;$$&#xA;w_i^{OIS} = df^{OIS}(0, T_i)/\sum_{k=a+1}^b df^{OIS}(0, T_k)$$ &#xA;$$&#xA;w_i = df(0, T_i)/\sum_{k=a+1}^b df(0, T_k)&#xA;$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming there is no convexity adjustment between OIS discounting forward libor rates and non OIS discounting forward libor rates, the difference between the OIS discounting swap rate and the non OIS discounting swap rate will result from different relative weights.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance if your non OIS rates are &lt;strong&gt;above&lt;/strong&gt; OIS rates, then libor rates for short maturities will have a smaller weight in the OIS case than in the non OIS case. In a market configuration where the libor curve is &lt;strong&gt;increasing&lt;/strong&gt; with maturity then the OIS discounting swap rate will be &lt;strong&gt;above&lt;/strong&gt; the non OIS discounting swap rate.  &lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2017-05-29T10:35:41.080" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34442" PostTypeId="2" ParentId="34367" CreationDate="2017-05-29T10:50:33.947" Score="2" Body="&lt;p&gt;With a resting order the market maker's client takes (buys) at the offer, or gives (sells) at the bid. The market maker prices the deal that way as with any other order type. A resting order is simply another type of order and the client pays the market maker's spread like with any order type. I am not sure I agree with @CPL593H if you're a market maker and have a client who will trade at your spread (rather than with someone else) then that's the client's choice. In fact resting orders are a service provided by the market maker so the client doesn't have to watch the market for the prices they want. I don't think the market maker has any obligation to disclose client resting orders to anyone else. In fact they are obliged not to by client confidentiality. Then if a resting order is filled the client has a right to an explanation of the price they received. It will be the same as if it was any other order. If there's a &quot;risk free&quot; profit that's like for any other order because the market maker can immediately cover in the interbank market where the minimum deal sizes are $1 million or above and the client may not have that amount to trade or access to those markets. I mean that is how the industry works. The client pays a spread to cover hedging costs, market access costs, regulatory reporting costs, and any other such costs the market maker has to bear (otherwise the client would have to pay for all these)&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2017-05-29T10:50:33.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34443" PostTypeId="2" ParentId="34424" CreationDate="2017-05-29T12:36:18.297" Score="0" Body="&lt;p&gt;Yield to maturity is a very misleading measure of return for bonds with coupons. With a zero coupon bond, there is only one payment from the bond, so the maturity and the yield to maturity are well defined. But with coupon bonds there are multiple payments and then one final payment at maturity. So two 10 year bonds with different coupon sizes have different cash flows over time, they cannot be compared by using Yield to Maturity (even if they have the same maturity).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quant Finance downplays the role of Maturity and Yield to Maturity, replacing them with Duration and Spread over a yield curve as the proper way to compare bonds. (Of course people still speak of maturity and YTM, but they are no longer considered fundamental concepts). &lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-05-29T12:36:18.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34444" PostTypeId="2" ParentId="34438" CreationDate="2017-05-29T15:48:00.023" Score="0" Body="&lt;p&gt;To reply my own question. I could not find any free data source for this, but &lt;a href=&quot;https://quantcha.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://quantcha.com/&lt;/a&gt; seems to provide free sample data. &lt;/p&gt;&#xA;" OwnerUserId="26443" LastActivityDate="2017-05-29T15:48:00.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34445" PostTypeId="1" AcceptedAnswerId="34485" CreationDate="2017-05-29T17:21:15.597" Score="0" ViewCount="919" Body="&lt;p&gt;Is there some API I can use to get a list of all available option contract tickers on some underlying? I'm using thinkorswim for data, but there is no way to get the tickers via the COM object.&lt;/p&gt;&#xA;" OwnerUserId="28156" LastActivityDate="2017-05-31T20:59:37.597" Title="API for option contract tickers" Tags="&lt;options&gt;&lt;programming&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34446" PostTypeId="2" ParentId="19451" CreationDate="2017-05-29T17:24:05.247" Score="1" Body="&lt;p&gt;Your options for real-time tick data are limited, but there are some:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Limited pairs, multiple updates per minute (HTML format) -&#xA;&lt;a href=&quot;http://webrates.truefx.com/rates/connect.html?f=html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://webrates.truefx.com/rates/connect.html?f=html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;The only reliable/free JSON API: &lt;a href=&quot;http://1forge.com/forex-data-api&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://1forge.com/forex-data-api&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="28147" LastActivityDate="2017-05-29T17:24:05.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34447" PostTypeId="1" AcceptedAnswerId="34449" CreationDate="2017-05-29T18:20:12.510" Score="0" ViewCount="78" Body="&lt;p&gt;Suppose I buy certain number of at-the-money call or put options, and if I want to exercise those options before the expiry date, then do I need to have the cash needed to buy the entitled amount of shares of the underlying stock? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;like if I pay a certain amount for a premium on ATM call options entitling me the right to buy Y number of shares of the underlying, then upon exercise, do I need the cash required to buy Y number of the shares? &lt;/p&gt;&#xA;" OwnerUserId="25307" LastActivityDate="2017-05-31T09:59:56.383" Title="Do I need that extra cash to exercise call or put options?" Tags="&lt;options&gt;&lt;leverage&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34449" PostTypeId="2" ParentId="34447" CreationDate="2017-05-29T19:11:30.540" Score="2" Body="&lt;p&gt;This would depend on whether the option you bought is &lt;strong&gt;cash-&lt;/strong&gt; or &lt;strong&gt;physically-settled&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $V_t$ be the intrinsic value of your option at time $t$, $T$ its maturity and $y$ the number of shares it gives right to. For example, for a call option of strike $K$ written on an underlying $S$ which price process is $(S_t)_{t \geq 0}$, the intrinsic value is $-$ independently on whether the call is European or American:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \forall \, t \in [0,T], \: V_t = y\max(S_t-K,0)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Letting $\tau$ be the time of exercise $-$ for a European call $\tau \in \{T,\infty\}$ and for an American one $\tau \in [0,T] \, \cup \, \infty$, $\tau=\infty$ meaning that the option is not exercised $-$ we have:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;For a cash-settled option, you will receive the cash amount $V_{\tau}\$$ at exercise time $\tau$;&lt;/li&gt;&#xA;&lt;li&gt;For a physically-settled option, you will receive $y$ shares of the underlying $S$ in exchange for the cash amount $yK\$$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Hence for a physically-settled option you would need indeed the cash amount $yK\$$ to buy the $y$ shares of $S$. In practice, I believe most exchange-traded vanilla options are cash-settled although I am clearly not sure about this.&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-05-31T09:59:56.383" LastActivityDate="2017-05-31T09:59:56.383" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34450" PostTypeId="1" CreationDate="2017-05-29T20:24:53.313" Score="-1" ViewCount="221" Body="&lt;p&gt;I am trying to replicate Ivolatility.com's option calculator for a client. Here's the example&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/UFkAq.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/UFkAq.png&quot; alt=&quot;Snapshot of Ivolatility Option Calculator&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using standard Black Scholes model, I can replicate the exact calculations if there is no dividend. With dividend, I understand I need to subtract PV of div from current underlying price to get the adjusted underlying price to be used in standard B-S model. My questions are&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) does everything else in calculating d1, greeks and premium remain the same? or do we still need the dividend yield (even after calculating adjusted underlying price) for calculating the above parameters?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) I understand the price of an American option is max of two european options calculated for different maturities, i.e ex dividend date and actual maturity.   Can you please clarify?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, is it possible to know which model Ivolatility is using?&lt;/p&gt;&#xA;" OwnerUserId="28160" LastEditorUserId="848" LastEditDate="2017-09-27T10:41:02.967" LastActivityDate="2017-09-27T10:41:02.967" Title="SPY American option Greeks and Premium" Tags="&lt;black-scholes&gt;&lt;american-options&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34451" PostTypeId="1" CreationDate="2017-05-29T21:08:46.180" Score="0" ViewCount="96" Body="&lt;p&gt;Is there a place I can download historical stock prices for NYSE/NASDAQ tickers at minute or lower resolution for last year or so?&lt;/p&gt;&#xA;" OwnerUserId="5440" LastActivityDate="2017-05-29T21:08:46.180" Title="Download historical prices" Tags="&lt;historical-data&gt;&lt;nasdaq&gt;&lt;nyse&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34452" PostTypeId="2" ParentId="34450" CreationDate="2017-05-30T01:24:31.730" Score="0" Body="&lt;p&gt;From what authority do you understand that the value of an American option is the max of two Europeans?  I believe this is a false assumption (but it might give you a lower bound value).  E.g. a deep-in-the-money American option might be optimally exercisable &lt;em&gt;before&lt;/em&gt; the ex-div date, to capture the time value of money for some interest rates vs. dividends.  American option values are typically solved by numerical techniques (such as the binomial method).  Ditto European options having complex dividend streams.&#xA;--BEZ&lt;/p&gt;&#xA;" OwnerUserId="28165" LastActivityDate="2017-05-30T01:24:31.730" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34453" PostTypeId="1" AcceptedAnswerId="34463" CreationDate="2017-05-30T04:43:24.393" Score="1" ViewCount="65" Body="&lt;p&gt;On page 4 of &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2097921&quot; rel=&quot;nofollow noreferrer&quot;&gt;this paper&lt;/a&gt;, the author states the following:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;Looking at the limit case, when the strike tends towards 0, we should have the&#xA;  price of a forward contract and it should not depend on the equity skew around 0.&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I cannot interpret mathematically what the author stated. Could you please provide a mathematical explanation of what the author said in words? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="25437" LastEditorUserId="26595" LastEditDate="2017-05-30T12:24:45.680" LastActivityDate="2017-05-30T13:04:04.060" Title="Detailing a proposition about option pricing model coherence" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;implied-volatility&gt;&lt;skew&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34454" PostTypeId="1" CreationDate="2017-05-30T06:54:26.240" Score="0" ViewCount="39" Body="&lt;p&gt;I've been looking at US bank loans and would like to convert the spread that has been quoted to another currency.  And I'm not quite sure how this can be done.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say I'm a £ investor and have invested in a 5yr us bank loan paying '3 month $ libor + 100bps'.&#xA;I'd like to convert this to its equivalent in £ terms.  So to get '3 month £ libor + Xbps'&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to figure out what X would be in this case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been told that I would need a cross currency basis swap curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm just not sure - would anyone be able to help please?&lt;/p&gt;&#xA;" OwnerUserId="28168" LastActivityDate="2017-05-30T09:22:09.277" Title="£ converted spread" Tags="&lt;fixed-income&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34455" PostTypeId="2" ParentId="34454" CreationDate="2017-05-30T09:22:09.277" Score="1" Body="&lt;p&gt;You need to compute the GBP leg margin $x$ for a 5Y constant notional cross currency swap that pays GBP Libor + $x$ vs USD Libor + 100 bps. If you have access to Bloomberg you can use the SWPM page to do that. &lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2017-05-30T09:22:09.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34456" PostTypeId="1" CreationDate="2017-05-30T09:45:37.217" Score="1" ViewCount="119" Body="&lt;p&gt;I am looking for a rigorous way to determine a suitable rolling window size for my stock data. Factors that will influence the window size are how fine my data is (minutely, daily, weekly etc.) and how quickly the underlying assets are moving (which can be analysed using the discrete Fourier transform). E.g. FX prices would fluctuate much faster than equity prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone point to papers, suggestions or strategies to deal with this problem?&lt;/p&gt;&#xA;" OwnerUserId="26223" LastEditorUserId="26223" LastEditDate="2017-05-30T14:16:51.277" LastActivityDate="2017-05-30T14:16:51.277" Title="Stock returns: Determining the window size" Tags="&lt;equities&gt;&lt;finance&gt;&lt;statistics&gt;&lt;high-frequency&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34458" PostTypeId="1" CreationDate="2017-05-30T12:00:03.040" Score="0" ViewCount="165" Body="&lt;p&gt;I tried to find a method to recognize a sudden movement, e.g. climb, of a stock price. The method should realize that the price suddenly changes in value very fast, after having a long calm period. What would be a suitable method (indicator) to achieve that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to search online for that, but out of all explanations how different indicators work, I can not determine which one is the most suitable.&lt;/p&gt;&#xA;" OwnerUserId="25552" LastActivityDate="2017-05-31T12:08:35.243" Title="Indicator for sudden movement of price" Tags="&lt;indicator&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34459" PostTypeId="1" AcceptedAnswerId="34462" CreationDate="2017-05-30T12:26:32.410" Score="0" ViewCount="607" Body="&lt;p&gt;On page 4 of &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2097921&quot; rel=&quot;nofollow noreferrer&quot;&gt;this paper&lt;/a&gt;, the auhor provides two good approximations for quanto options pricing: $V^d_{black}$ and $V^d_{blackATM}$. These approximations consist of using the ATM and/or stike volatilities (of the underlying asset and FX rate) for the pricing procedure. Is there a mathematical reason for this? What I got is that when we have no better options, we run toward the ATM volatilities. But mathematically, I see no reason for this (maybe because it is an average volatility...).&#xA;Could you please provide mathematical justification for these approximations?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you. &lt;/p&gt;&#xA;" OwnerUserId="25437" LastActivityDate="2017-05-30T12:52:29.390" Title="Approximations for Quanto Options pricing" Tags="&lt;option-pricing&gt;&lt;volatility&gt;&lt;implied-volatility&gt;&lt;local-volatility&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34460" PostTypeId="1" AcceptedAnswerId="34476" CreationDate="2017-05-30T12:38:14.977" Score="1" ViewCount="433" Body="&lt;p&gt;I would like to take a closer look at stock prices and CDS spreads of different entities. Because both of them are nonstationary in levels, I use log stock returns and the first difference of the CDS.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question: Can I run the Granger causality test on the Vector Autoregressive model (VAR) with the included variables in differences? And do I have to check for cointegration at first (and use a VECM)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Help is very much appreciated.&lt;/p&gt;&#xA;" OwnerUserId="27779" LastActivityDate="2017-05-31T11:02:14.597" Title="Granger causality with stocks and CDS" Tags="&lt;time-series&gt;&lt;returns&gt;&lt;econometrics&gt;&lt;cds&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34462" PostTypeId="2" ParentId="34459" CreationDate="2017-05-30T12:52:29.390" Score="3" Body="&lt;p&gt;If you compute the quanto adjustment $\exp(-\rho \sigma_X \sigma_S)$ from the vol $\sigma_S(K)$ at the option strike $K$ then the quanto forward obtained by call/put parity becomes strike dependent and that does not make sense. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So a kind of averaged volatility is better, and the ATM vol does a good job, although the actual adjustment would differ for various local volatility or stochastic volatility models all calibrated to the same implied vols. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition the quanto adjustment depends on the correlation parameter $\rho$ which is difficult to estimate, and if you imply it from quoted quanto options then you might as well use the ATM vol for $\sigma_S$ since the thing you're really interested in is the term $\rho \sigma_X \sigma_S$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The paper &quot;Jäckel, P. (2009). Quanto Skew&quot; is a good reference. &lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2017-05-30T12:52:29.390" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34463" PostTypeId="2" ParentId="34453" CreationDate="2017-05-30T13:04:04.060" Score="3" Body="&lt;p&gt;The value of a call option at expiry is $V=\mathrm{max}(0, S_t-K)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you set $K=0$, then you have $V=\mathrm{max}(0, S_t)$, and since $S\geqslant0$, $\mathrm{max}(0, S_t) = S_t$ - i.e. ie's equivalent to holding the stock, which at expiry you'll expect to be worth the whatever the forward is.&lt;/p&gt;&#xA;" OwnerUserId="19663" LastActivityDate="2017-05-30T13:04:04.060" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34464" PostTypeId="1" CreationDate="2017-05-30T15:56:14.260" Score="1" ViewCount="880" Body="&lt;p&gt;We denote &lt;code&gt;discount factor&lt;/code&gt; $D(t)$, and &lt;code&gt;zero coupon bond&lt;/code&gt; $B(t,T)$ as:&#xA;$$B(t,T) =\dfrac{1}{D(t)} E_t[D(T)]$$&#xA;here $E_t[X] = E[X|\mathcal{F}(t)].$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And we define &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Zero curve&lt;/code&gt; $Z(t,T)$&#xA;$$B(t, T)\cdot e^{Z(t,T)(T-t)} = 1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Libor&lt;/code&gt; $L(t,T)$&#xA;$$B(t, T)\cdot (1 + (T-t) L(t, T)) = 1.$$&#xA;Denote $E^{T}[\ ]$ the $T$-forward measure i.e use $B(t,T)$ as numeraire.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I remember that Libor and zero curve should be &lt;code&gt;martingale&lt;/code&gt; under the $T$-forward measure. But we see the representations, equivalently $\dfrac{1}{B(t,T)}$ should be martingale under the $T$-forward. This is the $T$-forward price of $1,$ but discounted value of $1$ is not martingale under original measure i.e&#xA;$$E_t[D(T)\cdot 1] \neq D(t)\cdot1.$$&#xA;We can see that forward rate&#xA;$$B(t,T-\delta) = (1 + (T-t)F(t,T-\delta,T))B(t,T)$$&#xA;is really $T$-forward martingale, since $\frac{B(t,T-\delta)}{B(t,T)}$ is $T$-forward martingale, equivalently $D(t)B(t,T-\delta)$ is martingale under the original measure.&#xA;So, I really confuse here. Can anyone tell where is the mistake? &lt;/p&gt;&#xA;" OwnerUserId="26165" LastEditorUserId="26242" LastEditDate="2018-12-15T23:05:44.110" LastActivityDate="2018-12-15T23:05:44.110" Title="Is Libor a martingale under T-forward measure" Tags="&lt;fixed-income&gt;&lt;stochastic-processes&gt;&lt;bond&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="34467" PostTypeId="2" ParentId="34403" CreationDate="2017-05-30T21:54:20.883" Score="1" Body="&lt;p&gt;To expand upon what others have said in the comments especially @will's. Data &quot;cleansing&quot; is not just about finding outliers or extreme values or manipulating data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The examples below are fairly common scenarios from even the largest data vendors that must also be considered for historical or ongoing analysis. All of these issues below can throw an entire model off.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Vendor provides incorrect values on a stock price or volume.&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Ex: The adjusted close not taking into account splits or dividends.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Provides a incorrect contract specifications for a corporate bond or swap.&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;EX: The wrong coupon frequency, currency code, exc..&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Historical intra-day quotes with incorrect time stamps.&lt;/li&gt;&#xA;&lt;li&gt;An exchange stops accepting orders but still sends bid/ask quotes mid market.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="1764" LastActivityDate="2017-05-30T21:54:20.883" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34468" PostTypeId="2" ParentId="66" CreationDate="2017-05-30T23:29:16.827" Score="0" Body="&lt;p&gt;Pairs trading is simple in concept if you look at it like two lovers. Try to split them apart, and they become sad and want to get back together, they'll do anything to get closer, and as they do, their happiness increases.&lt;/p&gt;&#xA;" OwnerUserId="28180" LastActivityDate="2017-05-30T23:29:16.827" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34469" PostTypeId="1" CreationDate="2017-05-31T00:42:30.513" Score="2" ViewCount="227" Body="&lt;p&gt;I am doing some time series analysis on some 5 minute bar stock data. If I want to specifically focus on data during trading hours and ignore any pre and post market activity, how would I effectively conduct time series on a disjoint set of data?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance if I look at trading data for SPY, how do I deal with the overnight gap and jump from 4 pm to 9:30 in the time series data?&lt;/p&gt;&#xA;" OwnerUserId="28182" LastEditorUserId="28182" LastEditDate="2017-05-31T05:49:04.803" LastActivityDate="2017-06-01T20:40:21.533" Title="Time Series analysis --- Overnight gap" Tags="&lt;time-series&gt;" AnswerCount="3" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34470" PostTypeId="2" ParentId="15874" CreationDate="2017-05-31T01:39:42.917" Score="4" Body="&lt;p&gt;You don't have to scrape that data to get it via Python if you work with Intrinio's API. Here is a Python SDKs that will make it easy for you:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Historical financial statements and dividend yield, marketcap, etc:&#xA;&lt;a href=&quot;https://github.com/nhedlund/intrinio&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/nhedlund/intrinio&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, you can make a curl request for historical marketcap like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;curl &quot;https://api.intrinio.com/historical_data?identifier=AAPL&amp;amp;item=marketcap&amp;amp;start_date=2014-01-01&amp;amp;end_date=2015-01-01&quot; -u &quot;USERNAME:PASSWORD&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That would give you the marketcap for Apple over the specified dates. You can just swap out the marketcap tag for dividendyield and get the data you want. Here is a full tutorial:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://intrinio.com/tutorial/web_api&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://intrinio.com/tutorial/web_api&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="27512" LastActivityDate="2017-05-31T01:39:42.917" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34471" PostTypeId="2" ParentId="34469" CreationDate="2017-05-31T06:34:15.050" Score="1" Body="&lt;p&gt;It depends on how you're actually interacting with your data in practice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have no overnight holding positions and forcefully liquidate at the end of bar 10 minutes before the market close, then you truncate the last three returns since you can't actually act on them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have overnight holding positions, and the market has continuous trading in non-US business hours, then this is merely a challenge in data acquisition because those samples actually exist. You may want to address the seasonal regime shift in the data in this case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have overnight holding positions, and the market halts trading for some nontrivial amount of time $\gg$ 5 min between two sessions, but you aren't actually trying to predict the jumps, you can just leave out those data points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have overnight holding positions, and the market halts trading as above, but you are actually trying to predict this gap, it is reasonable to model this separately.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastActivityDate="2017-05-31T06:34:15.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34472" PostTypeId="2" ParentId="34464" CreationDate="2017-05-31T06:42:43.513" Score="2" Body="&lt;p&gt;Your definition of Libor is invalid as you make it cover the period $t, T$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A Libor with tenor $\delta$ that fixes on $T$ (or to be accurate usually 2 days before $T$) covers the period $T, T+\delta$. Thus the forward Libor rate $L(t, T, T+\delta)$ is computed as &#xA;$$&#xA;B(t, T+\delta) (1 + \delta L(t, T, T+\delta)) = B(t, T)&#xA;$$&#xA;hence &#xA;$$&#xA;L(t, T, T+\delta) = \frac{1}{\delta}\left(\frac{B(t, T)&#xA;}{B(t, T+\delta)} -1 \right)&#xA;$$&#xA;is a martingale under the $T+\delta$ forward measure. &lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2017-05-31T06:42:43.513" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="34473" PostTypeId="2" ParentId="34458" CreationDate="2017-05-31T07:19:08.953" Score="1" Body="&lt;p&gt;Sounds like &lt;a href=&quot;http://www.sharechart.com.au/Education/TechnicalIndicators/Volatility%20Bands.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;Volatility Bands&lt;/a&gt; may be what you need. From the link:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Volatility Bands are an indicator that allows users to compare volatility and relative price levels over a period time. The indicator consists of three bands designed to encompass the majority of a security's price action.&lt;/p&gt;&#xA;&lt;p&gt;Volatility bands can help confirm trend, but they do not determine the future direction of a security.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="28183" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2017-05-31T07:19:08.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34474" PostTypeId="1" AcceptedAnswerId="34480" CreationDate="2017-05-31T07:34:58.463" Score="2" ViewCount="238" Body="&lt;p&gt;We denote &lt;code&gt;discount factor&lt;/code&gt; $D(t),$ &lt;code&gt;zero coupon bond&lt;/code&gt; $B(t,T),$ $E_t[X] = E[X|\mathcal{F}(t)]$ and $T$-forward measure $E_t^{T}[\ ].$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, let me fix the &lt;code&gt;Libor&lt;/code&gt; and &lt;code&gt;Forward Libor&lt;/code&gt; to avoid ambiguity&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Libor&lt;/code&gt; $L(t,T):$&#xA;$$B(t, T)\cdot \Big(1 + (T-t) L(t, T)\Big) = 1.$$&#xA;&lt;code&gt;Forward Libor&lt;/code&gt; $F(t,T-\delta,T):$&#xA;$$\Big(1 + (T-t)F(t,T-\delta,T)\Big)B(t,T) = B(t,T-\delta)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we see the &lt;code&gt;cap&lt;/code&gt;&#xA;$$C(t;T,L^*) = \dfrac{1}{D(t)}E_t\left[D(T)\delta\Big(F(t,T-\delta,T) - L^*\Big)^+\right]$$&#xA;We can change into forward measure&#xA;$$C(t;T,L^*) = \delta B(t,T)E^T_t\left[\Big(F(t,T-\delta,T) - L^*\Big)^+\right]$$&#xA;and $F(t,T-\delta,T)$ is $T$-forward martingale, the above formula become the standard &lt;code&gt;Black-Scholes.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if we choose&#xA;$$C(t;T,L^*) = \dfrac{1}{D(t)}E_t\left[D(T)\delta\Big(L(T-\delta,T) - L^*\Big)^+\right]$$&#xA;then we can transform into&#xA;$$C(t;T,L^*) = (1+\delta L^*)\cdot E^{T}_{t}\left[\left(\dfrac{1}{1+\delta L^*} - B(T-\delta,T)\right)^+\right]$$&#xA;it become a bond put option expiring at time $T - \delta$ maturing at time $T.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But $B(t,T)$ is impossible &lt;code&gt;log-normal&lt;/code&gt; under $T$-forward measure, then we can't use &lt;code&gt;Black-Scholes.&lt;/code&gt; So how to deal with for this case?  &lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-05-31T13:52:13.507" Title="Cap option on Libor" Tags="&lt;options&gt;&lt;fixed-income&gt;&lt;bond&gt;&lt;derivatives&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34475" PostTypeId="1" AcceptedAnswerId="34484" CreationDate="2017-05-31T08:01:36.250" Score="8" ViewCount="1061" Body="&lt;p&gt;I'm trying to understand whether there is a good way to compare forecasts for volatility from different sources i.e., implied volatility and GARCH. I'll outline a few statements that I believe and if anyone could verify if they are correct or explain why I'm wrong I would be grateful.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$\textbf{1.}$&lt;/span&gt; The 30 day implied volatility is the average implied vol for an option with an expiry 30 days from now. The value is annualized and so (roughly) represents a measure of the standard deviation of the &lt;span class=&quot;math-container&quot;&gt;$\textit{prices}$&lt;/span&gt; of the stock over the next year. In order to get a daily value for the 30 day implied volatility we use &lt;span class=&quot;math-container&quot;&gt;$$\sigma_{\text{day}}=\frac{\sigma_{\text{annualized}}}{\sqrt{365}}$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$\textbf{2.}$&lt;/span&gt; GARCH models should always be applied to the returns or the log returns rather than the prices, as often we work under assumptions of normality and we believe returns follow a normal distribution a lot more than prices do. The &lt;span class=&quot;math-container&quot;&gt;$\textit{volatility}$&lt;/span&gt; output from GARCH models is the conditional variance, &lt;span class=&quot;math-container&quot;&gt;$\text{Var}[y_t|y_{t-1},...]$&lt;/span&gt; which I believe is the cond. variance of the returns used to model the GARCH? I believe this since modelling the returns and log returns give different variances which would not be consistent if GARCH outputted the cond. variance of the underlying stock price.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Hence my main questions are,&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Given that implied volatility represents a measure of changes in the underlying price of the stock, and GARCH outputs the conditional variance of the returns, how would one go about comparing the two? Is there a way to change the GARCH forecasts so that we talk about the variance of the prices?&lt;/p&gt;&#xA;&lt;p&gt;Given that I have forecasts for the implied volatility, and GARCH forecasts (and can perform some transformation to get them both in terms of prices or returns, see previous question), how can I compare these out of sample forecasts to the subsequent realised volatility? Would this be done by a Mincer-Zarowitz regression, stating a relevant error measure?&lt;/p&gt;&#xA;&lt;p&gt;One last question, if I use a stochastic volatility model to give the conditional variance, such as Taylor's (1986) (implemented in the &lt;span class=&quot;math-container&quot;&gt;$\texttt{stochvol}$&lt;/span&gt; package) can I perform the same sort of transformation used on the GARCH forecasts to get the volatility of prices rather than returns?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;As you can see, I'm relatively confused about the many different ways one can quote/model/forecast volatility. If anyone can answer my questions, please do :) Thanks&lt;/p&gt;&#xA;" OwnerUserId="28184" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2017-05-31T17:28:10.350" Title="How can I compare 30 day implied volatility forecasts with GARCH forecasts?" Tags="&lt;volatility&gt;&lt;time-series&gt;&lt;implied-volatility&gt;&lt;garch&gt;&lt;stochastic-volatility&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34476" PostTypeId="2" ParentId="34460" CreationDate="2017-05-31T11:02:14.597" Score="1" Body="&lt;p&gt;Regarding testing for Granger causality in presence or absence of cointegration, I find the extensive blog post by Dave Giles &lt;a href=&quot;http://davegiles.blogspot.be/2011/04/testing-for-granger-causality.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;Testing for Granger Causality&quot;&lt;/a&gt; very helpful.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;[M]y question is whether it makes sense to model stock prices &amp;lt;...&gt; instead of log stock returns (not diff), when we are interested in returns. I get that when I am interested in X, I should just leave it in levels even if nonstationary. I wanted to ask whether it still makes sense to model it like that when I am interested in the return itself.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Let me contrast the subject-matter problem to the statistical problem. From the statistical perspective, to ensure the validity of your results, you need to follow sound statistical practice (e.g. as described in Dave Giles' blog). How to interpret the results comes in second. Fortunately, if you assume (and preferably validate the assumption by testing) that the logs of stock prices are cointegrated, you can use VECM where the dependent variables will be the log-returns.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Just to be sure about it: Is that more or less correct? &amp;lt;...&gt; &quot;Stock returns Granger cause spread changes&quot;; this is the interpretation I had in mind (well, after checking whether there is Granger causality of course). The data to be used are stock prices and spreads.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I think your interpretation is fine. &lt;/p&gt;&#xA;" OwnerUserId="19645" LastActivityDate="2017-05-31T11:02:14.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34477" PostTypeId="1" CreationDate="2017-05-31T11:15:28.210" Score="-3" ViewCount="145" Body="&lt;p&gt;My question concerns an ambiguity in the &lt;a href=&quot;https://en.wikipedia.org/wiki/Put%E2%80%93call_parity&quot; rel=&quot;nofollow noreferrer&quot;&gt;wikipedia article&lt;/a&gt; about Put Call Parity.&lt;br&gt;&#xA; In the first sentence:&#xA; &quot;In financial mathematics, put–call parity defines a relationship between the price of a European call option and European put option, both with the identical strike price and expiry, namely that a portfolio of a long call option and a short put option is equivalent to (and hence has the same value as) a single forward contract at this strike price and expiry.&quot;&lt;br&gt;&#xA;is about a &quot;short&quot; put option which means that we have the obligation to sell the put but in the derivation a long put is used, i.e. a put with payoff profile $(K - S_T, 0)^+$. But a short put would be actually $K-S_T \in \mathbb{R}$ if the option gets exercised.&lt;br&gt;&#xA;Edit:&#xA;My question concerns the definition of &quot;short put&quot;. In &lt;a href=&quot;http://www.investopedia.com/terms/s/short-put.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.investopedia.com/terms/s/short-put.asp&lt;/a&gt;&#xA;it is definied as the obligation to sell and then its not the payoff: $-(K-S_T)^+$?&lt;/p&gt;&#xA;" OwnerUserId="28185" LastEditorUserId="28187" LastEditDate="2017-06-02T08:02:38.203" LastActivityDate="2017-06-02T08:02:38.203" Title="Put Call Parity confusion" Tags="&lt;finance&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ClosedDate="2017-06-14T18:00:39.340" ContentLicense="CC BY-SA 3.0" />
  <row Id="34478" PostTypeId="2" ParentId="34477" CreationDate="2017-05-31T11:30:06.760" Score="2" Body="&lt;p&gt;Being short a put simply means that you have sold the put, hence its payoff is from your point of view $-(K - S_T)^+$. When your are long a call and short a put your total payoff is $(S_T - K)^+ -(K - S_T)^+ = S_T - K$, hence the call/put parity. &lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2017-05-31T11:30:06.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34479" PostTypeId="2" ParentId="34458" CreationDate="2017-05-31T12:08:35.243" Score="1" Body="&lt;p&gt;Bollinger Bandwidth would do the job. Bollinger Bandwidth is defined as the percentage difference of standard deviation bands of a moving average.&lt;/p&gt;&#xA;" OwnerUserId="25419" LastActivityDate="2017-05-31T12:08:35.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34480" PostTypeId="2" ParentId="34474" CreationDate="2017-05-31T12:51:41.727" Score="3" Body="&lt;p&gt;Note that&#xA;\begin{align*}&#xA;&amp;amp;\ \dfrac{1}{D(t)}E_t\left(D(T)\delta\Big(L(T-\delta,T) - L^*\Big)^+\right)\\&#xA;=&amp;amp;\ \dfrac{1}{D(t)}E\left(D(T-\delta) E\left(\frac{D(T)}{D(T-\delta)}\delta\Big(L(T-\delta,T) - L^*\Big)^+\mid\mathcal{F}_{T-\delta}\right)  \mid \mathcal{F}_t\right)\\&#xA;=&amp;amp;\ \dfrac{1}{D(t)}E\left(D(T-\delta) B(T-\delta, T)\delta\Big(L(T-\delta,T) - L^*\Big)^+\mid\mathcal{F}_t\right)\\&#xA;=&amp;amp;\ (1+\delta L^*)\dfrac{1}{D(t)}E\left(D(T-\delta)\left(\dfrac{1}{1+\delta L^*} - B(T-\delta,T) \right)^+\mid\mathcal{F}_t\right)\tag{1}\\&#xA;=&amp;amp;\ (1+\delta L^*)B(t, T)E^T_t\left(\frac{D(T-\delta)}{D(T)}\left(\dfrac{1}{1+\delta L^*} - B(T-\delta,T) \right)^+\right).&#xA;\end{align*}&#xA;Your transformation from&#xA;$$C(t;T,L^*) = \dfrac{1}{D(t)}E_t\left(D(T)\delta\Big(L(T-\delta,T) - L^*\Big)^+\right)$$&#xA;to&#xA;$$C(t;T,L^*) = (1+\delta L^*)\cdot E^{T}_{t}\left(\left(\dfrac{1}{1+\delta L^*} - B(T-\delta,T)\right)^+\right)$$&#xA;does not appear correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We also note that $(1)$ is indeed the value of a put bond option with maturity $T-\delta$. Based on a certain short rate model such as the Hull-White model, this value can be computed analytically.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-05-31T13:52:13.507" LastActivityDate="2017-05-31T13:52:13.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34482" PostTypeId="2" ParentId="32029" CreationDate="2017-05-31T17:13:35.150" Score="1" Body="&lt;p&gt;I am giving my interpretation and thoughts on Hull's words. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a derivative of maturity $T$ with price process $(V_t)_{t \geq 0}$ written on a &lt;em&gt;tradable&lt;/em&gt; asset with price process $(S_t)_{t \geq 0}$: for example you can take the standard example of a call option written on a stock. Letting AOA be the &lt;em&gt;Absence of Arbitrage Opportunities&lt;/em&gt; (AOA) assumption, $\mathbb{Q}$ the risk-neutral measure and $D(t,T)$ the discount factor from $T$ to $t$, in the standard framework of derivative pricing theory we loosely have the following implication $-$ this is of course not fully rigorous:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \left[(S \text{ is tradable}) + (\text{AOA})\right] \quad \Rightarrow \quad V_t=\mathbb{E}^{\,\mathbb{Q}\,}[D(t,T)V_T|\mathcal{F}_t]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is &lt;em&gt;because&lt;/em&gt; the asset is tradable &lt;em&gt;and&lt;/em&gt; that we assume there are no arbitrage opportunities &lt;em&gt;that&lt;/em&gt; we can price the derivative as the discounted, expected payoff under the risk-neutral measure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if you are considering an underlying process $(X_t)_{t \geq 0}$ which is &lt;em&gt;not&lt;/em&gt; tradable $-$ &lt;em&gt;e.g.&lt;/em&gt; temperature, wind speed, etc. $-$ then the logical implication above breaks down and you should no longer be able to prove that the price of the derivative is its discounted, expected payoff under $\mathbb{Q}$: even if there are arbitrage opportunities, you cannot exploit them because the underlying asset is not tradable. In such a situation, pricing according to historical data is a reasonable choice. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The non-systematic risk part simply means that weather should be totally &lt;em&gt;uncorrelated&lt;/em&gt; to financial markets: they are two different worlds, and the systematic risk that all financial assets (stocks, bonds, etc.) bear is not present in weather. Simply think what would happen is some abnormal, highly mortal, extremely contagious, &quot;catastrophe-film-like&quot; epidemic started affecting humans: financial assets around the world would become highly volatile due to the uncertain future of the human race, but you can be assured that weather wouldn't be affected by this. However, I struggle to see a straightforward connexion between the absence of systemic risk and the appropriateness of pricing under the real-world measure. Indeed, you can have derivatives that &lt;em&gt;clearly&lt;/em&gt; have systemic risk but that you can price under the real-world measure because the underlying risk is not tradable: please refer to my question &quot;&lt;a href=&quot;https://quant.stackexchange.com/questions/33031/change-of-measures-impact-on-parameter-value&quot;&gt;Change of measure&amp;#39;s impact on parameter value&lt;/a&gt;&quot; for an example $-$ specifically the $1^{\text{st}}$ paragraph of section &quot;&lt;strong&gt;Remarks&lt;/strong&gt;&quot; in @Quantuple's answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a last comment, please also consider the &lt;em&gt;historical&lt;/em&gt; dimension of the problem at hand: initially, primitive processes like temperature and wind speed might not be tradable; derivatives written on them might be issued, priced on the real-world measure. &lt;em&gt;However&lt;/em&gt;, my view is that, once this derivatives are out there in the market, arbitrage opportunities might arise if newly issued derivatives are written at prices which are not consistent with the previously issued derivatives. Hence, although a weather derivatives market might start by pricing under the real-world measure, I think that the development of the market should end up enforcing participants to price under the risk-neutral measure to avoid arbitrage: after all, pricing models are a form of &lt;em&gt;language&lt;/em&gt; between market participants, and you better speak the same language as others to be understood (and avoid being cheated!).&lt;/p&gt;&#xA;" OwnerUserId="20454" LastActivityDate="2017-05-31T17:13:35.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34483" PostTypeId="2" ParentId="34469" CreationDate="2017-05-31T17:23:40.777" Score="0" Body="&lt;p&gt;It is best to think of your data as two dimensional: the rows can be labeled with successive dates (20170102, 20170103, ...), and the columns are labeled 930,935,940,..., 1600. This structure lets you analyze the data any way you want. &lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2017-05-31T17:23:40.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34484" PostTypeId="2" ParentId="34475" CreationDate="2017-05-31T17:28:10.350" Score="4" Body="&lt;p&gt;This is a partial answer to your 2. statement. The &lt;strong&gt;main points&lt;/strong&gt; are, &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the conditional (on information up to time $t-1$) variance of the price $P_t$ is the same as the conditional variance of the &quot;return&quot; $P_{t}-P_{t-1}$;&lt;/li&gt;&#xA;&lt;li&gt;the conditional variance of $\log P_t$ is the same as the conditional variance of $\log P_t - \log P_{t-1}$;&lt;/li&gt;&#xA;&lt;li&gt;the conditional variance of $P_t$ is not the same as the conditional variance of $\log P_t$ (and similarly for $P_{t}-P_{t-1}$ vs $\log P_{t} - \log P_{t-1}$). &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The following is therefore incorrect: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;GARCH models should always be applied to the returns or the log returns rather than the prices&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Suppose $P_t$ is the sum of two components:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a deterministic $\mu_t=g(I_{t-1})$, where $g(\cdot)$ is some function and $I_{t-1}$ is information up to time $t-1$, and&lt;/li&gt;&#xA;&lt;li&gt;a stochastic $\varepsilon_t$.  &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The only component unknown as of time $t-1$ is $\varepsilon_t$, the conditional variance of which is the conditional variance of $P_t$ (conditional on $I_{t-1}$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Meanwhile, the &quot;return&quot; $P_{t}-P_{t-1}=g(I_{t-1})+\varepsilon_t-g(I_{t-2})-\varepsilon_{t-1}$. Here once again the only component that is unknown at time $t-1$ is $\varepsilon_t$, so the conditional variance of $P_{t}-P_{t-1}$ is the conditional variance of $\varepsilon_t$ -- the same as for $P_t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;All the same logic would also hold of you decomposed the price multiplicatively rather than additively.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;However,&lt;/strong&gt; things change if you consider logarithms instead of levels. If you assume $\log P_t=g(I_{t-1})+\varepsilon_t$, you will get a different conditional variance than if you had assumed $P_t=g(I_{t-1})+\varepsilon_t$. This can be proven by a counterexample (any would do).&lt;/p&gt;&#xA;" OwnerUserId="19645" LastActivityDate="2017-05-31T17:28:10.350" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34485" PostTypeId="2" ParentId="34445" CreationDate="2017-05-31T20:40:09.173" Score="1" Body="&lt;p&gt;Interactive Brokers API allows to pull option chain: &lt;a href=&quot;https://interactivebrokers.github.io/tws-api/options.html#option_chains&amp;amp;gsc.tab=0&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://interactivebrokers.github.io/tws-api/options.html#option_chains&amp;amp;gsc.tab=0&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15454" LastActivityDate="2017-05-31T20:40:09.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34486" PostTypeId="2" ParentId="34445" CreationDate="2017-05-31T20:59:37.597" Score="1" Body="&lt;p&gt;Bloomberg also let you get the option chain via their API (not free). field is called &lt;code&gt;OPT_CHAIN&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="27849" LastActivityDate="2017-05-31T20:59:37.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34487" PostTypeId="2" ParentId="34210" CreationDate="2017-05-31T22:52:49.290" Score="5" Body="&lt;p&gt;The field is in flux right now.  Since you are at the master's level I think you should focus on more general works in mathematics.  If you were my student and we were ignoring specific things such as securities analysis and accounting and focusing on the mathematics, I would recommend you begin with measure theory, real analysis, combinatorics, Bayesian analysis and decision theory (both Bayesian and Frequentist).  It's important to understand that a lot of stuff used in quantitative finance lacks empirical support.  Think of other categories of problems such as the difference between two means.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Depending on your precise assumptions there are only a few possible tools and only two or three should be operative at a time, one Bayesian, one Frequentist and one Likelihoodist if it differs from the Frequentist.  Once you have selected your interpretation of probability, there should only be one choice open to you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In quantitative finance, there are tons of tools and each one is being proposed because it is not clear what to use.  Tools range from OLS to GARCH, to fractal based analysis, neural networks to data envelope analysis to random forests and you can get a long list in the literature.  In just one category I did a review on I found 26 techniques.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You want to stay out of the weeds AND stay out of most of the foundational documents.  To understand why you need to stay out of the weeds consider that GARCH is big right now, but in the very first GARCH article they ran a test on stocks and found that stocks strongly violated the assumptions necessary for GARCH to work.  Even though it is not supportable, neither are most things, so why not use it?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Go to one of your advisors or to a librarian in your academic library and start with a book on measure theory.  I am not going to recommend one, but instead, suggest you talk to people about it where you are at.  There is an advantage to face-to-face conversation.  Then pick up real analysis.  You can flip the order.  As you start getting into this you will find that many of these problems are really combinatoric problems.  Lots of the solutions really attempt to go around the combinatoric issues.  Then I would pick up an introductory book on Bayesian methods and an introductory book on decision theory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you get into the field you will find someone needs you to evaluate a neural network or an ARMA model.  I recommend the physicians' command &quot;first do no harm.&quot;  You are an expert in the math and not in finance or economics.  Listen to them, dig deep into what they are really needing from you and what their goals are.  Be as good as you can at the base math, then build into finance later.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS It wouldn't hurt you to pick up an accounting textbook either.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2017-05-31T22:52:49.290" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34488" PostTypeId="1" CreationDate="2017-05-31T23:17:39.750" Score="1" ViewCount="835" Body="&lt;p&gt;In &lt;a href=&quot;https://quant.stackexchange.com/questions/34459/approximations-for-quanto-options-pricing&quot;&gt;this question&lt;/a&gt; I asked about the mathematical rationale of using the ATM vol to price quanto options. One of the reasons pointed (as an answer) was, as expected, that the ATM volatility is kind of an average volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is missing is to prove this mathematically or at least give some intutiton of why this is true through mathematical equations.&#xA;Could you please provide the mathematical reasoning for the conclusion that the ATM vol is kind of an average volatility?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="25437" LastActivityDate="2017-07-01T10:14:16.263" Title="Why is the ATM vol kind of an average volatility" Tags="&lt;option-pricing&gt;&lt;volatility&gt;&lt;stochastic-processes&gt;&lt;implied-volatility&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34489" PostTypeId="1" CreationDate="2017-06-01T00:46:17.177" Score="1" ViewCount="50" Body="&lt;p&gt;I want to write trading strategies for crypto-assets. I am looking to find data sources I can play with to backtest. Has anyone found easy to use data or do I have to index / crawl data sources?&lt;/p&gt;&#xA;" OwnerUserId="28192" LastActivityDate="2017-06-01T00:46:17.177" Title="Has anyone found good data sources to model / backtest crypto-currency trading strategies?" Tags="&lt;data&gt;&lt;bitcoin&gt;" AnswerCount="0" CommentCount="3" ClosedDate="2017-06-01T04:26:52.567" ContentLicense="CC BY-SA 3.0" />
  <row Id="34490" PostTypeId="1" AcceptedAnswerId="34499" CreationDate="2017-06-01T01:36:28.057" Score="0" ViewCount="453" Body="&lt;p&gt;Does the correlation between stocks in a sector or between sectors in the S&amp;amp;P 500 have an impact, all else equal, on the S&amp;amp;P's implied volatility / the VIX?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My guess is that the correlation between stocks does not have a direct impact on the implied volatility. See e.g. &lt;a href=&quot;https://quant.stackexchange.com/a/7763/28193&quot;&gt;this answer&lt;/a&gt; on how to approximate the implied volatility in a Black-Scholes framework; it does not seem to me that a higher or lower degree of correlation between the stocks would directly affect this approximation. (Of course I understand that a high correlation between stocks might be the result of complacency, which would also lead to a low implied volatility. However, that's not a direct link between the two variables.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On a higher level, where I am coming from is that I am curious if indiscriminate buying by index funds, which should lower the correlation between the stocks in the S&amp;amp;P 500 or at least between the stocks in a sector, could lead to a VIX of x  today not being comparable to a VIX of x 10 years ago.&lt;/p&gt;&#xA;" OwnerUserId="28193" LastActivityDate="2017-06-01T16:05:32.490" Title="Does the correlation between stocks in an index affect the implied volatility of the index?" Tags="&lt;black-scholes&gt;&lt;implied-volatility&gt;&lt;index&gt;&lt;vix&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ClosedDate="2017-06-02T10:50:46.113" ContentLicense="CC BY-SA 3.0" />
  <row Id="34491" PostTypeId="2" ParentId="8896" CreationDate="2017-06-01T07:09:58.493" Score="4" Body="&lt;p&gt;Interactive Brokers hosted a webinar on Nov. 10 2016 about Implement Algo Trading coded in Python using Interactive Brokers API. The presenter gave a good explanation on the applicability of IBridgePy, which is a Python package used to connect to Interactive Brokers C++ API for execution of python codes in live markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The webinar was recorded so that you can listen to it anytime you want. The link of the webinar is here: &lt;a href=&quot;https://www.interactivebrokers.com/en/index.php?f=2227&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.interactivebrokers.com/en/index.php?f=2227&lt;/a&gt; In the page, IB categorizes their webinars in several topics: TWS, Trading, API, etc. After you click the tab of &quot;API&quot;, you will see all of the webinars about API. IBridgePy works like a standalone quantopian and it is much easier than IBpy. IBridgePy can be found here www.IBridgePy.com&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the greatest things about IBridgePy is that IBridgePy can run Quantopian's codes without any changes! &lt;a href=&quot;http://www.ibridgepy.com/tutorials/#Migrating_from_Quantopian_to_IBridgePy&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.ibridgepy.com/tutorials/#Migrating_from_Quantopian_to_IBridgePy&lt;/a&gt;&#xA;Disclosure: I am the author of IBridgePy.&lt;/p&gt;&#xA;" OwnerUserId="28198" LastEditorUserId="28198" LastEditDate="2017-10-18T06:50:23.207" LastActivityDate="2017-10-18T06:50:23.207" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34492" PostTypeId="2" ParentId="16827" CreationDate="2017-06-01T07:12:23.233" Score="0" Body="&lt;p&gt;I've been struggling to quantify and explain diversity for a while and I think I've found something which captures the essence of a portfolio manager's ability to diversify away risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say you have a portfolio where each stock has volatility $\sigma_i$, weight $w_i$, and pairwise correlation $\rho_{ij}$.  Then the portfolio's volatility $\sigma$ can be computed as: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma^2 = \underbrace{\sum_i w_i^2 \sigma_i^2}_A + \underbrace{\sum_i\sum_{j \neq i}w_i w_j \sigma_i \sigma_j \rho_{ij}}_{B}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Part $A$ of the equation is a pure volatility part, and part $B$ is correlation-dependent part which portfolio managers are forever trying to minimise my choosing stocks which are not too correlated to each other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Surprisingly, the $A$ part is usually much smaller than the $B$ part.  For example, when I calculate the MSCI AC World's volatility in this way (using a five years of monthly returns of stocks currently in the index), I find $A = 0.01\%$ and $B = 1.04\%$.  When I split my fund's portfolio risks in this manner, I always find $B$ to be much bigger than $A$ (four to ten times bigger).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the goal is to minimize $B$, I propose $\sigma^2/A$, or&#xA;$$\frac{\sigma^2}{\sum w_i^2 \sigma_i^2}$$&#xA;as a ratio for measuring diversity:  the lower the better.  It's similar to &lt;a href=&quot;ftp://economia.unica.it/mattana/Modelli_Mercati_Finanziari/Slides/Lecture_2/CRAA.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Goetzmann &amp;amp; Kumar's Normalized portfolio variance&lt;/a&gt; which @jaamor mentioned in his answer, but makes the denominator more relevant to the portfolio you're trying to measure (a lot of information is lost in a straight average $\bar{\sigma}$ of the $\sigma_i$'s).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;  I think it makes even more sense to scale the denominator somehow, so portfolios with low numbers of stocks don't get a misleadingly bad score (or high numbers of stocks good scores).  Maybe divide by $\sum w_i^2$ or multiply by the number of stocks.&lt;/p&gt;&#xA;" OwnerUserId="27210" LastEditorUserId="27210" LastEditDate="2017-06-05T02:59:48.450" LastActivityDate="2017-06-05T02:59:48.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34493" PostTypeId="2" ParentId="34488" CreationDate="2017-06-01T09:48:49.283" Score="1" Body="&lt;p&gt;See Jim Gatheral's Book &quot;The Volatility Surface&quot; (extract here &lt;a href=&quot;http://janroman.dhis.org/finance/Volatility%20Models/lecture2%20Fitting%20vola%20skew.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://janroman.dhis.org/finance/Volatility%20Models/lecture2%20Fitting%20vola%20skew.pdf&lt;/a&gt;)&#xA;where he obtains the squared implied volatility for strike $K$ as a time average of weighted expectation of square local volatility, then argues that the weight density is concentrated around a curve that connects the initial underlying price to the strike $K$, and finally approximates the density as if it was entirely concentrated on this curve, which he calls the most likely path approximation method. Also remember that the squared local volatility is the expectation of the squared instantaneous (stochastic) volatility conditional on the underlying price and you can view the squared implied vol as approximately the time average of squared instantaneous volatility along that most likely path.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if you use as your underlying the forward price and look at ATM implied vol, the most likely path can also be approximated with the  constant path set to the forward price and the squared implied ATM vol becomes the time average of squared instantaneous vol along that constant path. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might argue that the variance swap would give a true integrated expected square instantaneous volatility and thus be a better approximation in the context of computing the quanto adjustment for quanto options, but as I said in my answer to your original question &lt;a href=&quot;https://quant.stackexchange.com/questions/34459/approximations-for-quanto-options-pricing&quot;&gt;Approximations for Quanto Options pricing&lt;/a&gt; there is so much uncertainty in estimating the FX / option underlying correlation that it does not really matter, the one thing you really want to make sure of is that your quanto adjustment is not strike dependent so that the quanto forward obtained by call/put parity is the same at all strikes. &lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2017-06-01T09:48:49.283" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34494" PostTypeId="2" ParentId="8896" CreationDate="2017-06-01T10:18:55.377" Score="0" Body="&lt;p&gt;While still in alpha, I like qstrader: &lt;a href=&quot;https://github.com/mhallsmoore/qstrader&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/mhallsmoore/qstrader&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1128" LastActivityDate="2017-06-01T10:18:55.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34495" PostTypeId="1" AcceptedAnswerId="34496" CreationDate="2017-06-01T10:22:06.077" Score="0" ViewCount="504" Body="&lt;p&gt;According to &lt;a href=&quot;http://ec.europa.eu/finance/docs/level-2-measures/priips-delegated-regulation-2017-1473-annex_en.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;KID/PRIIPS regulation&lt;/a&gt; in your opinion&lt;/p&gt;&#xA;&#xA;&lt;p&gt;in which case should PCA (as from article 23) be used?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just for structured products and bond-related products or also in other cases? &#xA;Do you have practical examples where you would use it?&lt;/p&gt;&#xA;" OwnerUserId="27194" LastActivityDate="2017-06-01T10:33:38.270" Title="KID PRIIPS regulation: PCA" Tags="&lt;pca&gt;&lt;regulatory-formula&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34496" PostTypeId="2" ParentId="34495" CreationDate="2017-06-01T10:33:38.270" Score="1" Body="&lt;p&gt;Typical uses of PCA in the industry are for modelling:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Forward curves&lt;/li&gt;&#xA;&lt;li&gt;Yield curves&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For the above cases, the first three Principal Components &lt;em&gt;typically&lt;/em&gt; captures more than 95% of the curves moves, which makes it a powerful tool when it comes to curve modelling.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As Structured Products are a combination of an option component and a bond component, PCA would be used for the modelling of the bond component and more generally for bond-related products and, as I mentioned above, forward products.&lt;/p&gt;&#xA;" OwnerUserId="26595" LastActivityDate="2017-06-01T10:33:38.270" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34498" PostTypeId="1" AcceptedAnswerId="40464" CreationDate="2017-06-01T11:01:17.320" Score="4" ViewCount="200" Body="&lt;p&gt;Say I have time series data for $N$ assets, where for the longest existing asset I have data from $t_0=0$ to $T$, but for several other assets I only have data from say $t_0+k$ to $t_0+l$ for some $0&amp;lt;k&amp;lt;l&amp;lt;T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if I want to do portfolio optimization with rolling estimation of the covariance matrix using a window of size $m$, what are some good ways to deal with the assets for which I'm missing data points inside the window?&lt;/p&gt;&#xA;" OwnerUserId="1128" LastActivityDate="2018-08-24T01:00:09.733" Title="Portfolio optimization with changing portfolio constituents" Tags="&lt;data&gt;&lt;portfolio-management&gt;&lt;market-data&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34499" PostTypeId="2" ParentId="34490" CreationDate="2017-06-01T12:45:42.160" Score="2" Body="&lt;p&gt;Concerning your specific question:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;Does the correlation between stocks in a sector or between sectors in the S&amp;amp;P 500 have an impact, all else equal, on the S&amp;amp;P's implied volatility / the VIX?&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;As of Chicago Board Options Exchange's (CBOE) &lt;a href=&quot;https://www.cboe.com/micro/vix/vixwhite.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;documentation&lt;/a&gt;, page 4, the VIX index is calculated as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;&amp;amp; \text{VIX} = 100 \times \sigma_{I}&#xA;\\[12pt]&#xA;&amp;amp; \sigma_{I} = \frac{2}{T}\sum_ie^{rT}\frac{\Delta K_i}{K_i}Q(K_i)-\frac{1}{T}\left(\frac{F}{K_0}-1\right)^2&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer the question at hand, we only need to look at the variable $Q(K_i)$ which is &quot;&lt;em&gt;the midpoint of the bid-ask spread for each option with strike&lt;/em&gt; $K_i$&quot;. So, simplifying, it is the price of an option written on the S&amp;amp;P Index. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The correlation between stocks $-$ and hence between sectors $-$ will without doubt have an effect on this option price: consider a toy example with a simple index $I$ made up of 2 stocks $S_1$ and $S_2$ such that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ I(t) = S_1(t) + S_2(t) $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume that both stocks have the same variance $\sigma_S$. Now let us take 2 extreme cases:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If the correlation is $-1$, the index will not move, so any OTM option $-$ &lt;em&gt;note that the VIX value is calculated with OTM options&lt;/em&gt; $-$ will have $0$ value: &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbb{Var}[I(t)] = \sigma_S^2 + \sigma_S^2 - 2\sigma_S\sigma_S = 0 $$ &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If the correlation is $1$, $S_1$ and $S_2$ will move in unison as any price change in any of the 2 stocks will be &quot;compounded&quot; by an equally intense price change from the other stock. In this case, the index price $I(t)$ might end up below OTM strikes &lt;em&gt;hence&lt;/em&gt; OTM options cannot be worthless $-$ as it would constitute an arbitrage opportunity:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbb{Var}[I(t)] = \sigma_S^2 + \sigma_S^2 + 2\sigma_S\sigma_S = 4\sigma_S^2 $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given pairwise stock correlations have an impact on one of the elements of the VIX formula, they must have an effect on the VIX value.&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-06-01T14:26:48.977" LastActivityDate="2017-06-01T14:26:48.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34500" PostTypeId="2" ParentId="34490" CreationDate="2017-06-01T15:58:13.470" Score="2" Body="&lt;p&gt;As Quantuple said, the variance of an index is related to the pairwise correlations $\rho_{ij}$ between stocks in the index&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma^2_p = \sum_i^N\sigma_i^2w_i^2+2\sum_{i=1}^{N}\sum_{j&amp;gt;i}^N w_i\rho_{ij}&#xA;\sigma_i \sigma_j$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we assume that all rho's are close to a &quot;typical&quot; or &quot;average&quot; value $\bar{\rho}$ then this expression simplifies considerably. Tierens and Anadu (2004) showed that (as you can easily check) we can then derive the following equation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\bar{\rho} = \frac{\sigma_p^2-\sum_{i=1}^N w_i^2\sigma_i^2}{2\sum_{i=1}^{N}\sum_{j&amp;gt;i}^N w_i \sigma_i \sigma_j}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know the weights $w_i$ of the S&amp;amp;P index, and we can observe in the option market the implied volatilties $\sigma_p,\sigma_i$ of the index and the constituent stocks. Therefore we can compute $\bar{\rho}$, sometimes called the market implied correlation among the stocks. &lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-06-01T16:05:32.490" LastActivityDate="2017-06-01T16:05:32.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34501" PostTypeId="1" AcceptedAnswerId="34566" CreationDate="2017-06-01T16:17:27.820" Score="3" ViewCount="192" Body="&lt;p&gt;Let's say I am running a fund and I want to place some bets on the market (i.e. speculate) or hedge my current positions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Starting from this, what would be my incentives to go for exchange-traded products instead of OTC products, and vice-versa?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course exchange-traded products would not be ideal if I am into exotic derivatives. But assuming that I just want to buy/sell a given vanilla options, which is available on both types of market, does it make more sense to go OTC or exchange-traded?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My intuition is that if I go exchange-traded, I have less chances to get ripped-off as the price is &quot;fairly&quot; determined by the supply and demand law than if I go OTC. But in this case, why would vanilla options be traded OTC as well? Are they cheaper when being traded OTC (or different fees as well)?&lt;/p&gt;&#xA;" OwnerUserId="26595" LastEditorUserId="26595" LastEditDate="2017-06-01T16:29:13.310" LastActivityDate="2017-06-06T16:13:22.150" Title="Rationale behind trading exchange-traded vs OTC products?" Tags="&lt;trading&gt;&lt;market-making&gt;&lt;exchange&gt;" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="34503" PostTypeId="2" ParentId="34010" CreationDate="2017-06-01T20:34:04.517" Score="1" Body="&lt;p&gt;Use the risk-free rate contemporaneous to the purchase date, so it would keep moving.  Just a reminder, the &quot;risk-free&quot; rate is an asset that pays out the same amount of money in all states of nature.  If the Earth is struck by a meteor and the recipient is the sole survivor, a computer will still be functioning to print the check.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is an argument that the five-year rate is not free of risk because there could be a sudden shock to inflation that could not be compensated for and therefore consumption would not be held constant.  In that case, the 90-day bill is appropriate.  An alternative would be the overnight LIBOR, but that number is monkeyed with and so a good number for it may not exist.  Nonetheless, except in hyperinflation, the LIBOR bears almost no risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a footnote, I advise everyone to ignore the CAPM.  The short-form preaching of it is that it is not supported empirically.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2017-06-01T20:34:04.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34504" PostTypeId="1" AcceptedAnswerId="34510" CreationDate="2017-06-01T20:37:04.457" Score="1" ViewCount="543" Body="&lt;p&gt;I have searched on the Internet and in several books (including John C. Hull and Jon Gregory) for concrete examples of Potential Future Exposure (PFE), but haven't had any success so far. I would greatly appreciate it if someone can point me to a specific example of PFE calculation from scratch. I am curious to see its input data/parameters and algorithm and how these pieces fit in with each other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="27404" LastActivityDate="2017-06-02T03:37:05.677" Title="Potential Future Exposure (PFE): Is there any Rigorous Walk Through with Data?" Tags="&lt;risk&gt;&lt;simulations&gt;&lt;counterparty-risk&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34505" PostTypeId="2" ParentId="34469" CreationDate="2017-06-01T20:40:21.533" Score="0" Body="&lt;p&gt;A Bayesian method would allow you to partition the data so that trade time could be permitted to impact the likelihood function.  If you held $\beta$ constant, but for the time elapsed, you could use $\beta^{\Delta{t}/5}$ in the likelihood function.  Alternatively, you could treat the final trades as unique due to the change in liquidity and partition the Bayesian likelihood function into two mutually exclusive sets.  You should probably do both and create two parameters, one for model one and one for model two.  Then solve $\Pr(\text{Model one}|\text{data})$ versus $\Pr(\text{Model two}|\text{data})$.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2017-06-01T20:40:21.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34506" PostTypeId="1" CreationDate="2017-06-01T22:06:08.493" Score="0" ViewCount="106" Body="&lt;p&gt;FCFF = net income + non-cash charges + interest x (1 - tax rate) - long-term investments - investments in working capital&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My intuition is: if the company is receiving interests payments, then the term &quot;interest&quot; is positive. If the company is paying out interests, the the term should be negative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you please clarify this for me? &lt;/p&gt;&#xA;" OwnerUserId="28201" LastActivityDate="2017-06-02T18:24:25.817" Title="Is &quot;interest&quot; positive or negative in the &quot;free cash flow to firm&quot; model?" Tags="&lt;equities&gt;&lt;modeling&gt;&lt;pricing-formulae&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34507" PostTypeId="2" ParentId="34506" CreationDate="2017-06-01T22:27:54.203" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;I would use EBIT*(1-T) instead of [Net Income + Int*(1-T)] (easier to remember), though they are =.&lt;/li&gt;&#xA;&lt;li&gt;The sign is in fact positive since it provides a tax shield.&lt;/li&gt;&#xA;&lt;li&gt;Also, the sign is positive b/c investors are only worried about a companies FCF, irrespective of financing decisions.  One company might pay all cash, where as another might use 90% Debt.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="27561" LastActivityDate="2017-06-01T22:27:54.203" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34509" PostTypeId="1" AcceptedAnswerId="39259" CreationDate="2017-06-02T01:07:24.150" Score="2" ViewCount="3509" Body="&lt;p&gt;Alphabet's market capitalization is generally listed as the market cap of GOOG, such as in this Wikipedia &lt;a href=&quot;https://en.wikipedia.org/wiki/List_of_public_corporations_by_market_capitalization&quot; rel=&quot;nofollow noreferrer&quot;&gt;top companies list&lt;/a&gt;. But GOOGL has about the same market cap. Why are they not combined for Alphabet the company? Are they linked in some way behind the scenes that makes summing redundant? And does the same hold for the other stocks with two ticker symbols (four more in S&amp;amp;P 500)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I know there is a similar sounding question, &lt;a href=&quot;https://quant.stackexchange.com/questions/23085/correct-alphabet-google-market-cap-calculation&quot;&gt;Correct Alphabet market cap calculation&lt;/a&gt;, but I think that one's more about discrepancies in the numbers rather than the summing.)&lt;/p&gt;&#xA;" OwnerUserId="28212" LastActivityDate="2018-04-13T16:06:21.057" Title="Why does Alphabet market cap not include both GOOG and GOOGL?" Tags="&lt;market-capitalization&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="34510" PostTypeId="2" ParentId="34504" CreationDate="2017-06-02T03:37:05.677" Score="2" Body="&lt;p&gt;I think PFE is covered well in Jon Gregory's book. Have a look at his &lt;a href=&quot;https://cvacentral.com/books/credit-value-adjustment/spreadsheets/&quot; rel=&quot;nofollow noreferrer&quot;&gt;website&lt;/a&gt;, he has spreadsheets on how PFE can be calculated. In 2nd Edition its in Chapter 8. If you happen to have the 3rd Edition its in Chapter 7.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, what you need to calculate PFE is almost the same as VaR - expected value ($ \mu $), volatility ($ \sigma $), and confidence level ($ \alpha $).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Implementation &lt;a href=&quot;https://ipythonquant.wordpress.com/2015/04/08/expected-exposure-and-pfe-simulation-with-quantlib-and-python/&quot; rel=&quot;nofollow noreferrer&quot;&gt;example&lt;/a&gt; in python.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Informative &lt;a href=&quot;https://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=3&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0ahUKEwjUgZWwmJ7UAhXDfiwKHeqyBMUQFgg4MAI&amp;amp;url=http%3A%2F%2Fwww.prmia.org%2Fsites%2Fdefault%2Ffiles%2Flegacy%2FChapter_Pages%2FCalgary%2FPFE%2520Simulation%2520Methodology.ppt&amp;amp;usg=AFQjCNExsseqR3ttM2tBiUe2nQQdSkPQNQ&quot; rel=&quot;nofollow noreferrer&quot;&gt;presentation&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="19096" LastActivityDate="2017-06-02T03:37:05.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34515" PostTypeId="1" AcceptedAnswerId="34516" CreationDate="2017-06-02T09:14:40.470" Score="0" ViewCount="40" Body="&lt;p&gt;I am retrieving data from yahoo using the getSymbols to get then monthly returns. But I want to subset the data, I want to have monthly returns from January 2016 until May 2017.&#xA;I am running this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quantmod)&#xA;list &amp;lt;- c(&quot;AAL&quot;,&quot;AAPL&quot;,&quot;ADBE&quot;,&quot;AMZN&quot;, &quot;FB&quot;, &quot;GOOGL&quot;, &quot;MSFT&quot;, &quot;NFLX&quot;, &quot;TSLA&quot;, &quot;VOD&quot;)&#xA;&#xA;df &amp;lt;- data.frame()&#xA;&#xA;##get monthly returns from january 2016 until today&#xA;&#xA;for (stock in list){&#xA;&#xA; data &amp;lt;- monthlyReturn(to.monthly(getSymbols(stock, auto.assign = FALSE)),from='2016-01-01', to='2017-05-31' )&#xA;&#xA;      colnames(data)[1] &amp;lt;- paste('r_', stock, sep = &quot;&quot;)&#xA;&#xA;      df &amp;lt;- cbind(df, data)&#xA;&#xA;}&#xA;&#xA;df &amp;lt;- as.data.frame(df)&#xA;attach(df)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And it is not working as I get values from the entire dataset. Instead if I use this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for (stock in list){&#xA;&#xA; data &amp;lt;- monthlyReturn(to.monthly(getSymbols(stock, auto.assign = FALSE)),subset = &quot;2016::&quot;)&#xA;&#xA; colnames(data)[1] &amp;lt;- paste('r_', stock, sep = &quot;&quot;)&#xA;&#xA;  df &amp;lt;- cbind(df, data)&#xA;&#xA;}&#xA;&#xA;df &amp;lt;- as.data.frame(df)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get monthly data from January 2016 until today, but that's not what I want as I want to fix the close date too. Any ideas on how to solve that?&lt;/p&gt;&#xA;" OwnerUserId="28216" LastActivityDate="2017-06-02T09:41:03.153" Title="How can I fix both the open and close data using quantmod's periodReturns?" Tags="&lt;programming&gt;&lt;quantmod&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34516" PostTypeId="2" ParentId="34515" CreationDate="2017-06-02T09:32:56.587" Score="0" Body="&lt;p&gt;Is this what you would like to get:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;lst &amp;lt;- c(&quot;AAL&quot;,&quot;AAPL&quot;,&quot;ADBE&quot;,&quot;AMZN&quot;, &quot;FB&quot;, &quot;GOOGL&quot;, &quot;MSFT&quot;, &quot;NFLX&quot;, &quot;TSLA&quot;, &quot;VOD&quot;)&#xA;&#xA;getSymbols(lst, from = &quot;2016-01-01&quot;, to = &quot;2017-05-31&quot;)&#xA;P &amp;lt;- NULL&#xA;seltickers &amp;lt;- NULL&#xA;&#xA;for(stock in lst) {     &#xA;  tmp = monthlyReturn(Cl(to.monthly(eval(parse(text = stock))))) ## Ad from quantmod&#xA;  if(is.null(P)){ timeP = time(tmp) }&#xA;  if(any(time(tmp)!=timeP)) next&#xA;  else P = cbind(P, as.numeric(tmp))&#xA;  seltickers = c(seltickers, stock)&#xA;  P = xts(P, order.by = timeP)&#xA;  colnames(P) = seltickers&#xA;}&#xA;&#xA;head(P)&#xA;&#xA;                   AAL         AAPL        ADBE         AMZN          FB&#xA;Jan 2016  0.0000000000  0.000000000  0.00000000  0.000000000  0.00000000&#xA;Feb 2016  0.0515516260 -0.006677563 -0.04465382 -0.058739319 -0.04714376&#xA;Mar 2016  0.0002438537  0.127210629  0.10158545  0.074422634  0.06715301&#xA;Apr 2016 -0.1541087371 -0.139921096  0.00447759  0.111094283  0.03049960&#xA;May 2016 -0.0801383419  0.065286997  0.05572065  0.095817020  0.01046093&#xA;Jun 2016 -0.1128173300 -0.042659753 -0.03699608 -0.009919871 -0.03812810&#xA;               GOOGL        MSFT        NFLX         TSLA           AAL&#xA;Jan 2016  0.00000000  0.00000000  0.00000000  0.000000000  0.0000000000&#xA;Feb 2016 -0.05796284 -0.07642038  0.01709504  0.003817971  0.0515516260&#xA;Mar 2016  0.06369044  0.08549526  0.09442242  0.197155277  0.0002438537&#xA;Apr 2016 -0.07211957 -0.09704872 -0.11933878  0.047830399 -0.1541087371&#xA;May 2016  0.05787700  0.06276321  0.13928692 -0.072811096 -0.0801383419&#xA;Jun 2016 -0.06051939 -0.03452834 -0.10812125 -0.049052534 -0.1128173300&#xA;                 AAPL        ADBE         AMZN          FB       GOOGL&#xA;Jan 2016  0.000000000  0.00000000  0.000000000  0.00000000  0.00000000&#xA;Feb 2016 -0.006677563 -0.04465382 -0.058739319 -0.04714376 -0.05796284&#xA;Mar 2016  0.127210629  0.10158545  0.074422634  0.06715301  0.06369044&#xA;Apr 2016 -0.139921096  0.00447759  0.111094283  0.03049960 -0.07211957&#xA;May 2016  0.065286997  0.05572065  0.095817020  0.01046093  0.05787700&#xA;Jun 2016 -0.042659753 -0.03699608 -0.009919871 -0.03812810 -0.06051939&#xA;                MSFT        NFLX         TSLA           AAL         AAPL&#xA;Jan 2016  0.00000000  0.00000000  0.000000000  0.0000000000  0.000000000&#xA;Feb 2016 -0.07642038  0.01709504  0.003817971  0.0515516260 -0.006677563&#xA;Mar 2016  0.08549526  0.09442242  0.197155277  0.0002438537  0.127210629&#xA;Apr 2016 -0.09704872 -0.11933878  0.047830399 -0.1541087371 -0.139921096&#xA;May 2016  0.06276321  0.13928692 -0.072811096 -0.0801383419  0.065286997&#xA;Jun 2016 -0.03452834 -0.10812125 -0.049052534 -0.1128173300 -0.042659753&#xA;                ADBE         AMZN          FB       GOOGL        MSFT&#xA;Jan 2016  0.00000000  0.000000000  0.00000000  0.00000000  0.00000000&#xA;Feb 2016 -0.04465382 -0.058739319 -0.04714376 -0.05796284 -0.07642038&#xA;Mar 2016  0.10158545  0.074422634  0.06715301  0.06369044  0.08549526&#xA;Apr 2016  0.00447759  0.111094283  0.03049960 -0.07211957 -0.09704872&#xA;May 2016  0.05572065  0.095817020  0.01046093  0.05787700  0.06276321&#xA;Jun 2016 -0.03699608 -0.009919871 -0.03812810 -0.06051939 -0.03452834&#xA;                NFLX         TSLA&#xA;Jan 2016  0.00000000  0.000000000&#xA;Feb 2016  0.01709504  0.003817971&#xA;Mar 2016  0.09442242  0.197155277&#xA;Apr 2016 -0.11933878  0.047830399&#xA;May 2016  0.13928692 -0.072811096&#xA;Jun 2016 -0.10812125 -0.049052534&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;These are monthly returns on &lt;code&gt;Close&lt;/code&gt; price. I am not sure if you want returns on &lt;code&gt;Open&lt;/code&gt; price as well.&lt;/p&gt;&#xA;" OwnerUserId="19096" LastEditorUserId="19096" LastEditDate="2017-06-02T09:41:03.153" LastActivityDate="2017-06-02T09:41:03.153" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34517" PostTypeId="1" AcceptedAnswerId="34519" CreationDate="2017-06-02T10:18:08.830" Score="1" ViewCount="56" Body="&lt;p&gt;for my thesis I am trying to fit the correlated factor arbitrage free dynamic Nelson Siegel model to yield data. I use the Kalman filter to model this but since the model is in continuous time, I need to discretize the conditional mean and conditional variance. The conditional mean was not difficult but I can't succeed in discretizing the variance. The expression for the conditional variance is:&#xA;$$&#xA;V[X_t|Y_{t}] = \int_0^{\Delta t} \exp(-K^P  s)\Sigma \Sigma' \exp(-[K^P]'s) ds&#xA;$$&#xA;where $\Delta t = 1 / 252$ and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;K^P = \begin{bmatrix} &#xA;k_{11} &amp;amp; k_{12} &amp;amp; k_{13} \\&#xA;k_{21} &amp;amp; k_{22} &amp;amp; k_{23} \\&#xA;k_{31} &amp;amp; k_{32} &amp;amp; k_{33} &#xA;\end{bmatrix}&#xA;$$&#xA;and&#xA;$$&#xA;\Sigma = \begin{bmatrix} &#xA;\sigma_{11} &amp;amp; 0 &amp;amp; 0 \\&#xA;\sigma_{21} &amp;amp; \sigma_{22} &amp;amp; 0 \\&#xA;\sigma_{31} &amp;amp; \sigma_{32} &amp;amp; \sigma_{33} &#xA;\end{bmatrix}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this is the place to ask this question and that you guys can help me, thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="28217" LastEditorUserId="26595" LastEditDate="2017-06-02T12:19:12.970" LastActivityDate="2017-06-02T12:19:12.970" Title="Discretizing the conditional variance in the Arbitrage Free Dynamic Nelson Siegel model" Tags="&lt;stochastic-calculus&gt;&lt;yield-curve&gt;&lt;yield&gt;&lt;term-structure&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34518" PostTypeId="1" CreationDate="2017-06-02T11:30:10.473" Score="-2" ViewCount="1328" Body="&lt;p&gt;I am trying to predict the return of BN4.SI ( a singapore stock ) and part of Strait Times 30 component index using principal component Analysis. I have written my code in python. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My Question is i have got factors loading how can i predict the next day return of BN4.SI based on this PCA Factors. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please help me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The steps i have taken are &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Get the matrix of standardised returns of all stocks. Standardised log returns are  [(x - mean)/std  for x in array]&lt;/li&gt;&#xA;&lt;li&gt;Generate covariance matrix of the return matrix and that should give me a square matrix ( m X m)&lt;/li&gt;&#xA;&lt;li&gt;I am using numpy linear algebra eig function to calculate eigen values and eigen vectors. Since my returns are standardised then sum of eigen values should be equalled to number of components.&lt;/li&gt;&#xA;&lt;li&gt;Then sort the eigen values in decending order to get first 3 eigen values which explains almost 80% of the variance. This is shown in scree plot in the picture added below.&lt;/li&gt;&#xA;&lt;li&gt;Next step is to get top 3 PCA vector which is acheived by getting the dot product of eigen vector and the original return matrix data. &#xA;pca1 = ti.np.dot(newDF,eVector1.reshape(-1,1)).reshape(1,-1)&#xA;pca2 = ti.np.dot(newDF,eVector2.reshape(-1,1)).reshape(1,-1)&#xA;pca3 = ti.np.dot(newDF,eVector3.reshape(-1,1)).reshape(1,-1)&lt;/li&gt;&#xA;&lt;li&gt;To perform linear regression with BN4.SI standarised return data. I need to get the matrix of the transpose of PCA vectors.&#xA;np.column_stack([pca1.T,pca2.T,pca3.T])&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I am using sklearn to do linear regression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;from sklearn import linear_model&#xA;model = linear_model.LinearRegression()&#xA;model.fit(ti.np.column_stack([pca1.T,pca2.T,pca3.T]),newDF[&quot;BN4.SI&quot;])&#xA;model.score(ti.np.column_stack([pca1.T,pca2.T,pca3.T]),newDF[&quot;BN4.SI&quot;])&#xA;print(model.coef_)&#xA;print(model.intercept_)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[ 0.2802088   0.37944899  0.13462393]&#xA;-1.15582251414e-18&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="26881" LastEditorUserId="26881" LastEditDate="2017-06-12T13:18:39.043" LastActivityDate="2017-06-12T14:56:31.500" Title="Forecasting next day return of a stock using PCA of index constituents" Tags="&lt;equities&gt;&lt;pca&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34519" PostTypeId="2" ParentId="34517" CreationDate="2017-06-02T11:48:46.900" Score="0" Body="&lt;p&gt;Regarding the comment we had, and since $\Delta t$ is rather small, numerical integration could be suited for purpose.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to &lt;a href=&quot;https://en.wikipedia.org/wiki/Numerical_integration&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; Wikipedia article, three options are available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Denoting by $f(s)$ the integrand, that is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f(s) = \exp \left( -K^P s\right) \Sigma \Sigma' \exp \left( - [K^P]' s\right),$$ the quantity $V \left[ X_t | Y_t \right]$ can be approximated by the following rules (ranked in ascending order in terms of complexity and accuracy):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Rectangle rule&lt;/strong&gt;:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$$\int_0^{\Delta t} f(s)ds \approx \Delta t f\left( \frac{\Delta t}{2}\right)$$&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Trapezoidal rule&lt;/strong&gt;:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$$\int_0^{\Delta t} f(s)ds \approx \Delta t \left( \frac{f(0) + f(\Delta t)}{2}\right)$$&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Decomposition rule&lt;/strong&gt; for $n &amp;gt; 1$:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$$\int_0^{\Delta t} f(s)ds \approx \frac{\Delta t}{n} \left( \frac{f(0)}{2} + \sum_{k=1}^n  f\left(k \frac{\Delta t}{n}\right) + \frac{f(\Delta t)}{2}\right)$$&lt;/p&gt;&#xA;" OwnerUserId="26595" LastActivityDate="2017-06-02T11:48:46.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34520" PostTypeId="1" CreationDate="2017-06-02T13:03:46.327" Score="1" ViewCount="53" Body="&lt;p&gt;Let's say I have a corporate bond, for which I know current yield, modified duration, coupon and maturity. I want to estimate how it would have performed under certain market conditions by looking at how a related bond index (holding bonds of similar rating and length) performed (i.e. looking at how its yields changed over that time). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What would be the best way of estimating price returns of my bonds in this way? How do I map the modified duration of my bond to a modified duration I can use to calculate price returns of the index from the change in its yield?&lt;/p&gt;&#xA;" OwnerUserId="28066" LastActivityDate="2017-06-02T13:03:46.327" Title="How to estimate bond price returns via an index?" Tags="&lt;fixed-income&gt;&lt;estimation&gt;&lt;duration&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34522" PostTypeId="1" AcceptedAnswerId="34555" CreationDate="2017-06-02T13:13:27.540" Score="5" ViewCount="240" Body="&lt;p&gt;My question refers to the fact that, for most part, binary options are basically gambling, but not to the full extent. Due to the advanced models, capital anomalies like Momentum and possibly technial analysis, it is theoretically possible to make, at least, an educated guess about the direction of the stock price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are quite a lot of websites out there that offer the possibility of trading binary options even if you are not an investment professional. However, assuming one website is flooded with professionals who really know what they are doing, then there is the, at least, theoretical possibility that most of them are right. How do you, as a broker, insure against that possibility?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that it is a little far fetched, but the question was bugging me since I've encountered binary options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="20694" LastActivityDate="2017-06-05T07:37:54.907" Title="How do binary options broker hedge themselves against losses?" Tags="&lt;risk&gt;&lt;binary-options&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="34523" PostTypeId="1" CreationDate="2017-06-02T14:56:55.020" Score="1" ViewCount="167" Body="&lt;p&gt;Helllo&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Althoug not technically a QF question, I was wondering whether someone can help my anyways. The Lee Carter model is a stochastic mortality model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually, one models the &lt;strong&gt;central death rates&lt;/strong&gt; as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\log(m(x,t)) = a(x) + b(x)\kappa(t) +\varepsilon(x,t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the past, I have also seen that instead of $m(x,t)$ the formula is applied to the probability of dying within one year denoted by $q$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\log(q(x,t)) = a(x) + b(x)\kappa(t) +\varepsilon(x,t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually, one uses/assumes one of the following relationships:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$q(x,t)=\frac{m(x,t)}{(1+\frac{1}{2}m(x,t))}$ or&#xA;$q(x,t)=1-\exp(-m(x,t))$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am wondering which model approach is more appropriate? That is, to model $m(x,t)$ or $q(x,t)$ with the above approach? And why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot,&lt;/p&gt;&#xA;" OwnerUserId="27389" LastEditorUserId="26595" LastEditDate="2017-06-04T16:40:28.923" LastActivityDate="2017-06-04T16:40:28.923" Title="Lee Carter Model - Mortality" Tags="&lt;stochastic-processes&gt;&lt;insurance&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34524" PostTypeId="2" ParentId="34523" CreationDate="2017-06-02T15:19:22.157" Score="2" Body="&lt;p&gt;Depending on what the death rate is applied to (e.g. humans or butterflies or whatever...), the assumption that $m(x,t)$ is rather small compared to 1 is more or less valid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming that this assumption holds, then both of your expressions for $q(x,t)$ would yield to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;$q(x,t) = \frac{m(x,t)}{1 + 0.5 m(x,t)} \approx m(x,t)$,&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$q(x,t) = 1 - e^{- m(x,t)} \approx m(x,t)$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Have a look &lt;a href=&quot;https://www.wolframalpha.com/input/?i=Plot%5B%7Bm%2F(1-0.5m),1-e%5E(-m),m%7D,%7Bm,0,0.1%7D%5D&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/el3AS.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/el3AS.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, if the assumption holds, both approaches are the same.&lt;/p&gt;&#xA;" OwnerUserId="26595" LastEditorUserId="19663" LastEditDate="2017-06-02T17:16:01.717" LastActivityDate="2017-06-02T17:16:01.717" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34525" PostTypeId="2" ParentId="17315" CreationDate="2017-06-02T16:16:58.587" Score="3" Body="&lt;p&gt;You can get that data from &lt;a href=&quot;http://intrinio.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;Intrinio&lt;/a&gt; in an API call that outputs a &lt;a href=&quot;https://intrinio.com/tutorial/file_download&quot; rel=&quot;nofollow noreferrer&quot;&gt;CSV download&lt;/a&gt; or you can use the &lt;a href=&quot;https://intrinio.com/tutorial/excel&quot; rel=&quot;nofollow noreferrer&quot;&gt;Excel add-in&lt;/a&gt; to build EXACTLY what you are looking for and save it to CSV- it will update with the latest data each time you open the work book:&lt;a href=&quot;https://i.stack.imgur.com/TZVIf.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/TZVIf.png&quot; alt=&quot;Excel add-in example of what you are looking for&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see from that picture that an Excel add-in is designed to let you put a list of tickers in column A, a list of &quot;tags&quot; across the top row, and then to drag formulas down with relative references to pull in the data. You can add more tickers or tags to get any fundamentals you want (revenue, EPS, debt, etc).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The CSV download looks like this- you just paste it into your browser and you will download the information:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;http://api.intrinio.com/prices.csv?ticker=AAPL&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;That syntax will download Apple's price history, or you can download Apple's total revenue to CSV:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;https://api.intrinio.com/historical_data?identifier=AAPL&amp;amp;item=totalrevenue&amp;amp;start_date=2014-01-01&amp;amp;end_date=2015-01-01&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem with a CSV download for what you are looking for is that you are putting 3 dimensional data (ticker, tag, date) into a 2 dimensional format (rows, columns). It's better to put group different time periods in different spreadsheets or tabs in a single spreadsheet if you want to work in a 2D medium like Excel. For example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/flLEm.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/flLEm.png&quot; alt=&quot;Pulling historical marketcap for multiple companies in 2D&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see in this example, I can use the add-in to adjust the time period- in this case I'm pulling daily marketcap, but I could also get yearly, quarterly, ttm, etc. Getting this in 3D, so I'm pulling marketcap AND other metrics for multiple tickers and multiple time periods is not a thing with CSV downloads. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use this Excel add-in for free depending on how much data you need in a day and you can use the CSV download functionality to get the data you want, just not in a single CSV. Let me know if I missed any of your requirements- you can definitely get unique identifiers for the stocks as well if you don't want to use the ticker symbols.&lt;/p&gt;&#xA;" OwnerUserId="27512" LastActivityDate="2017-06-02T16:16:58.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34526" PostTypeId="2" ParentId="567" CreationDate="2017-06-02T16:25:02.093" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://intrinio.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;Intrinio&lt;/a&gt; provides that data in JSON and CSV. Its free, up to 500 daily API calls:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://intrinio.com/data/company-financials&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://intrinio.com/data/company-financials&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if you want to pull YUMs income_statement from Q2 2015:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;https://api.intrinio.com/financials/standardized?identifier=YUM&amp;amp;statement=income_statement&amp;amp;fiscal_period=Q2&amp;amp;fiscal_year=2015&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/sfVIL.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/sfVIL.png&quot; alt=&quot;JSON output for company financials&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously you can get any statement (income, balance, cashflows), for any public US company, going back about 10 years this way. You just need to adjust the parameters.&lt;/p&gt;&#xA;" OwnerUserId="27512" LastActivityDate="2017-06-02T16:25:02.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34527" PostTypeId="2" ParentId="18730" CreationDate="2017-06-02T16:36:18.397" Score="0" Body="&lt;p&gt;&lt;a href=&quot;http://intrinio.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;Intrinio&lt;/a&gt; provides that data historically. You can get it in a dynamic Excel spreadsheet if you install the &lt;a href=&quot;https://intrinio.com/tutorial/excel&quot; rel=&quot;nofollow noreferrer&quot;&gt;Excel add-in&lt;/a&gt; or &lt;a href=&quot;https://intrinio.com/tutorial/web_api&quot; rel=&quot;nofollow noreferrer&quot;&gt;via API&lt;/a&gt; if you are a developer. Here is what it looks like in Excel:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=kCdSQQsGiHE&amp;amp;t=13s&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.youtube.com/watch?v=kCdSQQsGiHE&amp;amp;t=13s&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Excel, you can use pre-defined templates just by entering a ticker:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/JzMiW.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/JzMiW.png&quot; alt=&quot;Enter a ticker in Excel&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/VMAKm.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/VMAKm.png&quot; alt=&quot;That gives you the entire statement history&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This gives you a lot of flexibility to modify the cells and everything is basically done for you. If you are a developer, you can just use the API directly, the Excel add-in is a wrapper of the API.&lt;/p&gt;&#xA;" OwnerUserId="27512" LastActivityDate="2017-06-02T16:36:18.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34528" PostTypeId="2" ParentId="15923" CreationDate="2017-06-02T16:52:50.693" Score="0" Body="&lt;p&gt;You can get that data from &lt;a href=&quot;http://intrinio.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;Intrinio&lt;/a&gt; in R as well. There is documentation, including how to actually make the API calls in R with examples, &lt;a href=&quot;http://blog.intrinio.com/intrinio-financial-data-in-r-and-rstudio/&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;. Here is an example of pulling Apple's income statement for Q1 2017- you just need to &lt;a href=&quot;http://intrinio.com/login&quot; rel=&quot;nofollow noreferrer&quot;&gt;get your own API keys&lt;/a&gt; and add them to the code (it's free):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#Cleaning up the environment&#xA;&#xA;rm(list=ls())&#xA;&#xA;#Skip this installation if you already have httr installed. This package makes using APIs in R easier&#xA;install.packages(&quot;httr&quot;)&#xA;#Require the package so you can use it&#xA;require(&quot;httr&quot;)&#xA;&#xA;#Skip this installation if you already have jsonlite installed. This package makes parsing JSON easy&#xA;install.packages(&quot;jsonlite&quot;)&#xA;&#xA;#Require the package so you can use it&#xA;require(&quot;jsonlite&quot;)&#xA;&#xA;#Create variables for your usename and password, get those at intrinio.com/login. &#xA;#Replace them here or the code won't run! They need to be in &quot;&quot;&#xA;&#xA;username &amp;lt;- &quot;Your_API_Username_Here&quot;&#xA;password &amp;lt;- &quot;Your_API_Password_Here&quot;&#xA;&#xA;#These variables will be pasted together to make our API call. You can replace the &quot;stock&quot; variable with any US ticker symbol&#xA;&#xA;base &amp;lt;- &quot;https://api.intrinio.com/&quot;&#xA;endpoint &amp;lt;- &quot;financials/standardized&quot;&#xA;stock &amp;lt;- &quot;identifier=AAPL&quot;&#xA;statement &amp;lt;- &quot;statement=income_statement&quot;&#xA;fiscal_period &amp;lt;- &quot;fiscal_period=Q1&quot;&#xA;fiscal_year &amp;lt;- &quot;fiscal_year=2017&quot;&#xA;&#xA;#Pasting them together to make the API call. &#xA;call1 &amp;lt;- paste(base,endpoint,&quot;?&quot;,stock,&quot;&amp;amp;&quot;, statement, &quot;&amp;amp;&quot;, fiscal_period, &quot;&amp;amp;&quot;, fiscal_year, sep=&quot;&quot;)&#xA;&#xA;#This line of code uses the httr package's GET function to query Intrinio's API, passing your username and password as variables&#xA;get_prices &amp;lt;- GET(call1, authenticate(username,password, type = &quot;basic&quot;))&#xA;&#xA;#The content function parses the API response to text. You can parse to other formats, but this format is the easiest to work with. Text is equivalent to JSON&#xA;get_prices_text &amp;lt;- content(get_prices, &quot;text&quot;)&#xA;&#xA;#This line of code uses the JSONlite function fromJSON to parse the JSON into a flat form. Flat means rows and coloumns instead of nested JSON&#xA;get_prices_json &amp;lt;- fromJSON(get_prices_text, flatten = TRUE)&#xA;&#xA;#Converting the data to a dataframe&#xA;get_prices_df &amp;lt;- as.data.frame(get_prices_json)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The result is a dataframe that looks like this:&lt;a href=&quot;https://i.stack.imgur.com/a92sn.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/a92sn.png&quot; alt=&quot;Apple&amp;#39;s financial statement&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now that you can get the statements via API (for free), you can go to town analyzing them.&lt;/p&gt;&#xA;" OwnerUserId="27512" LastActivityDate="2017-06-02T16:52:50.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34529" PostTypeId="2" ParentId="34506" CreationDate="2017-06-02T18:24:25.817" Score="0" Body="&lt;p&gt;In the calculation of Net Income by the accountants, the interest payments made by the firm have already been subtracted. Now, in this formula, we calculate FCFF by ADDING BACK to net income a portion of the interest, namely, the Tax Shield. You can think of &quot;interest x (1-Tax Rate)&quot; as the subsidy that the company received from the federal government because the tax code favors debt financing over other kinds of financing.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2017-06-02T18:24:25.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34531" PostTypeId="1" CreationDate="2017-06-02T23:51:25.637" Score="0" ViewCount="181" Body="&lt;p&gt;Please correct my conceptual understanding if needed, but I'm trying to calculate the mod duration of treasury curve pieces when the curves are DV01 hedged. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;DV01 of 10 Year Note is 896.1705 and DV01 of ZB futures is 209.0188. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I +3 10 Year Note and -13 ZB futures, I am very close to being DV01 hedged. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I'm sure the mod duration of this position is not close to 0, as I am taking on curve risk. In what way can I calculate mod duration for the example above?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess I'm not expressing myself clearly... I've also changed the title to reflect this. say that I have 2 curve pieces:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First curve: +1 5 Year Note -6 ZN futures&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second curve: +1 10 Year Note -4 ZB futures&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ASSUME that they are perfectly DV01 hedged. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I find how many of the first curve to hedge the second curve? Obviously 10 Year ZB curve have greater ranges, so what's a fundamentally sound way to hedge this using 5 Year ZN curve?&lt;/p&gt;&#xA;" OwnerUserId="13375" LastEditorUserId="13375" LastEditDate="2017-06-03T00:48:09.367" LastActivityDate="2017-06-03T00:48:09.367" Title="Curve to curve hedging for treasury" Tags="&lt;duration&gt;&lt;yield&gt;&lt;treasuries&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34532" PostTypeId="2" ParentId="34531" CreationDate="2017-06-03T00:07:48.207" Score="1" Body="&lt;p&gt;You can use DV01 or mod duration – they yield identical results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your objective is to ensure that the two legs of your trade cancel each other out (in $ terms) when the yield curve shifts by a small amount:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{dP_1}{dy_1}\times \text{Notional/Par Amount}_1 = \frac{dP_2}{dy_2}\times \text{Notional/Part Amount}_2. $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, $dP/dy$ is just DV01, so if you have determined the notional amount on one leg, it's simple algebra to compute the notional requirement on the other leg.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you can use mod duration:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{1}{P_1}\frac{dP_1}{dy_1}\times \text{Notional/Par Amount}_1 \times P_1 = \frac{1}{P_2}\frac{dP_2}{dy_2}\times \text{Notional/Part Amount}_2 \times P_2. $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, $\frac{1}{P}\frac{dP}{dy}$ is the mod duration. Notice that instead of multiplying by notional, it's now notional times $P$ (i.e., market value) on both sides. But again, if you hold notional amount on one leg the same, you can calculate notional on the other leg – just need to take price into account.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2017-06-03T00:07:48.207" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="34535" PostTypeId="1" AcceptedAnswerId="34546" CreationDate="2017-06-03T14:40:53.270" Score="0" ViewCount="1400" Body="&lt;p&gt;Let's assume the usual Black Scholes assumptions hold. My question is related to an answer on &lt;a href=&quot;https://quant.stackexchange.com/questions/32171/black-scholes-differential/32187#32187&quot;&gt;this question&lt;/a&gt;. There, the weights ($\Delta_t^1$,$\Delta_t^2$) are derived which form a locally risk free portfolio $$X_t =\Delta_t^1 S_t + \Delta_t^2C_t$$ with $$\Delta_t^1 = -\frac{\frac{\partial C}{\partial S} B_t}{C_t - \frac{\partial C}&#xA;{\partial S}S},\quad&#xA;\Delta_t^2 =\frac{B_t}{C_t - \frac{\partial C}{\partial S}S}$$ It is emphasized that the strategy $(−∂C∂S, 1)$ is not self financing. I have no doubt about the derivation. Rather, I'm interested to know, in the context of dynamic delta hedging, is it actually valid to set $\Delta_t$ (the amount of the underlying to buy or sell) to $∂C∂S$ instead of $\Delta_t^1$ as shown above? For example, &lt;a href=&quot;http://janroman.dhis.org/finance/Hedgeing/Dynamic%20Hedgeing.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;in this paper on page 4&lt;/a&gt; the authors investigate delta hedging strategies by setting $\Delta_t^1$ to $-∂C∂S$ (e.g. $N(d_1)$ for a European call option) and explicitly claim the self financing property. So how would one actutally compute the correct $\Delta_t$ for a delta hedging strategy in a BS world?&lt;/p&gt;&#xA;" OwnerUserId="20736" LastActivityDate="2017-06-07T17:53:22.443" Title="Dynamic Delta Hedging And a Self Financing Portfolio" Tags="&lt;black-scholes&gt;&lt;delta-hedging&gt;" AnswerCount="2" CommentCount="7" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34536" PostTypeId="2" ParentId="26260" CreationDate="2017-06-03T15:50:59.140" Score="1" Body="&lt;p&gt;I have used an approach to the second method to examine (or to orthonalize) a factor's &quot;independence&quot; vis-a-vis other factors. In addition to looking at R^2, also examining each factor's sensitivity and its t-stats.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the intercept of the regression is statistically different from zero then it would indicate the &quot;dependent&quot; factor contributes more than the explanatory factors. If it is statistically zero (abs(t-stat) &amp;lt;= 2) then the dependent factor is subsumed by the explanatory factors.   &lt;/p&gt;&#xA;" OwnerUserId="28229" LastEditorUserId="28229" LastEditDate="2017-06-03T16:22:34.917" LastActivityDate="2017-06-03T16:22:34.917" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34537" PostTypeId="1" CreationDate="2017-06-03T18:27:07.277" Score="2" ViewCount="167" Body="&lt;p&gt;Some studies try to estimate the percentage of trades that are  performed using algorithmic trading, &lt;a href=&quot;https://youtu.be/V43a-KxLFcg?t=1m57s&quot; rel=&quot;nofollow noreferrer&quot;&gt;e.g.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/njm78.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/njm78.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can one estimate the percentage of trades that are  performed using algorithmic trading?&lt;/p&gt;&#xA;" OwnerUserId="2183" LastActivityDate="2017-06-03T18:27:07.277" Title="How can one estimate the percentage of trades that are performed using algorithmic trading?" Tags="&lt;algorithmic-trading&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34538" PostTypeId="1" CreationDate="2017-06-03T19:26:37.720" Score="3" ViewCount="576" Body="&lt;p&gt;Suppose I have three bonds:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/AI6Df.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/AI6Df.png&quot; alt=&quot;Bond table&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Coupon bonds are paid semi-annually. Rates are continuous compounding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to bootstrap the zero rates for 0.5 years maturity using the 1 year zero coupon bond and the 1 year fixed rate coupon bond, but my eventual 0.5 year zero rate is higher than my 1 year zero rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My calculations are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;1-year zero rate:&#xA;$$95 = 100 \times e^{-r}$$&#xA;$$r_{1y} = -  \ln (0.95) = 5.129\%$$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;6M zero rate:&#xA;$$2.5 \times e^{-0.5 r_{6m}} + 102.5 \times e^{-r_{1y}} = 99.8$$&#xA;$$r_{6m} = - 2 \ln \left( \frac{99.8-102.5 e^{-r_{1y}} }{2.5} \right) = 6.118\%$$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I'm not sure if I'm doing it right, don't think a 0.5 year zero rate is supposed to be higher than a 1 year zero rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Help please!&lt;/p&gt;&#xA;" OwnerUserId="28233" LastEditorUserId="26595" LastEditDate="2017-06-05T13:30:01.120" LastActivityDate="2019-04-28T17:00:25.873" Title="Basic boostrapping question" Tags="&lt;interest-rates&gt;&lt;zero-coupon&gt;&lt;bootstrapping&gt;&lt;bootstrap&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34540" PostTypeId="2" ParentId="34535" CreationDate="2017-06-04T03:28:31.103" Score="2" Body="&lt;p&gt;for a self financing portfolio, you have a holding in stocks and one in bonds. &#xA;If we want to do a hedging simulation, at the start of each step, work out the total value of the hedger's holding (excluding the thing being hedged). Treat this as a cash sum. Buy $N(d_1)$ units of the stock. Use the rest of the money (which may be negative) to buy riskless bonds. Hold this across the step. Repeat. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is trivially self-financing and you will find that the variance of the net position goes to zero as the step size goes to zero. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2017-06-04T03:28:31.103" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34541" PostTypeId="1" CreationDate="2017-06-04T04:12:32.653" Score="8" ViewCount="719" Body="&lt;p&gt;I saw this &lt;a href=&quot;https://youtu.be/V43a-KxLFcg?t=1m57s&quot; rel=&quot;noreferrer&quot;&gt;study&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/njm78.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/njm78.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why does algorithmic trading account for a significantly higher percentage of trades in the USA than in Europe or Asia?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is that because US-based exchanges offer more edge to high-frequency trading such as co-location? Is that because financial firms are more technologically advanced in the US than in Europe or Asia? Or some other reasons?&lt;/p&gt;&#xA;" OwnerUserId="2183" LastEditorUserId="2183" LastEditDate="2017-06-04T04:18:34.367" LastActivityDate="2017-06-07T00:26:02.937" Title="Why does algorithmic trading account for a significantly higher percentage of trades in the USA than in Europe or Asia?" Tags="&lt;algorithmic-trading&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="34543" PostTypeId="2" ParentId="34541" CreationDate="2017-06-04T06:20:27.100" Score="9" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Why does algorithmic trading account for a significantly higher percentage of trades in the USA than in Europe or Asia?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;One of the major reasons for this is the significant fragmentation in the U.S. markets, and in particular the U.S equity markets where I believe Aite Group's data (in your picture) comes from. This doesn't necessarily provide an edge to algorithmic trading firms, but the more products are fungible and trade on an arbitrage basis, the more opportunities exist for naive algorithmic trading. You'll see the same behavior even in non-fragmented markets when you compare, say, more fungible products such as equity indices, to agricultural products.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another major reason is that &quot;algorithmic trading&quot; is loosely defined because it is often difficult to identify volume coming from a black box vs discretionary flow via a smart order router or algorithmic execution desk. Since U.S. markets dominate investor interest and volume across the globe, you'll commonly see that broker-dealers and vendors offer many more services and products for electronic access in the U.S. than in non-U.S. markets. This effect is clear even in the well-known bulge bracket banks. As a result, this difference can also be explained by the availability of such services.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your questions implicitly suggest that a higher % of algorithmic trading activity is related in some way to the amount of opportunity. I'd be careful of that type of reasoning. The markets are very efficient, even when it comes to business decisions. If it comes down to an advantage so obvious as cheaper colocation services in the U.S., the exchanges and data centers in Europe or Asia could easily court the same business by lowering their prices.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Is that because financial firms are more technologically advanced in the US than in Europe or Asia?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;No. The largest participants in the U.S. markets are generally the same as the ones in European markets. This is a highly globalized industry and it's easy for a U.S.-based firm to trade outside of the U.S.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="4660" LastEditDate="2017-06-06T14:03:07.017" LastActivityDate="2017-06-06T14:03:07.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34544" PostTypeId="1" CreationDate="2017-06-04T07:52:21.007" Score="1" ViewCount="4441" Body="&lt;p&gt;I am a beginner in financial risk management and recently I have been studying the plain vanilla interest rate swap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I came across several articles talking about DV01 of interest rate swap as follow.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;DV01(t) = \frac{\partial V_{swap}(t)}{\partial R_{fix}} = \sum_{j=1}^N \alpha_j Z_t(t_j)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is:&#xA;In the equation, $R_{fix}$ should be in decimals. Then for a 1 basis point (i.e. $1/10000$)  change in $R_{fix}$, shouldn't it lead to a $(1/10000) \sum_{j=1}^N \alpha_j Z_t(t_j)$ change in the price of the interest rate swap?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="26415" LastActivityDate="2017-09-03T15:43:12.767" Title="DV01 of Interest rate swap" Tags="&lt;interest-rate-swap&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34545" PostTypeId="1" AcceptedAnswerId="34548" CreationDate="2017-06-04T12:53:15.107" Score="1" ViewCount="483" Body="&lt;p&gt;We consider &lt;code&gt;up/down-out-call&lt;/code&gt; whose payment&#xA;$$V(T,S_T) = \Psi(S_T)\mathbb{II}(S_T),\ V(t,B) = 0.$$&#xA;Here the range constraint function is &lt;code&gt;indictor function&lt;/code&gt; such that&#xA;$\mathbb{II}(S_T)$ = \begin{cases}&#xA;\mathbb{II}_{\{S_T &amp;lt; B\}} &amp;amp; \textrm{up-out-call}\\&#xA;\mathbb{II}_{\{S_T &amp;gt; B\}} &amp;amp; \textrm{down-out-call}\\&#xA;\end{cases}&#xA;We see that the only difference between the &lt;code&gt;barrier option&lt;/code&gt; and &lt;code&gt;vanilla option&lt;/code&gt; is the barrier condition: $V(t,B) = 0,$ so we can suppose&#xA;$$V(t,S) = \widehat V(t,S) - \widetilde V(t,S)$$&#xA;s.t&#xA;$$\widehat V(T,S) = \Psi(S_T),\quad \widetilde V(T,S) = 0$$&#xA;$$\widehat V(t,B) = \widetilde V(t,B)$$&#xA;And use the &lt;code&gt;reflection principle&lt;/code&gt;&#xA;$$\widetilde V(t,S) = \left(\dfrac{S}{B}\right)^{2\alpha}\widehat V(t,\dfrac{B^2}{S})$$&#xA;Since if $\mathbb{II}(S)$ is not zero, $\mathbb{II}(\dfrac{B^2}{S})$ must be zero, then $\widetilde V(T,S) = 0.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But how to use this method to deal with the &lt;code&gt;double barrier-out-call&lt;/code&gt; i.e&#xA;$$V(t,B_1) = V(t,B_2) = 0,\quad B_1 &amp;lt; B_2$$&#xA;or is it possible to use &lt;code&gt;down-out-call&lt;/code&gt; with barrier $B_1$ and &lt;code&gt;up-out-call&lt;/code&gt; with barrier $B_2$ to construct double barrier?&lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-06-04T17:15:59.190" Title="How to use reflection principle to solve the analytic solution of double barrier-out-call" Tags="&lt;stochastic-processes&gt;&lt;derivatives&gt;&lt;barrier&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34546" PostTypeId="2" ParentId="34535" CreationDate="2017-06-04T14:10:47.803" Score="3" Body="&lt;h2&gt;Main references&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;As explained in my comments, the correct approach to derive the hedging portfolio would be the one described in Gordon's answers to the following questions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/34027/derivation-of-bs-pde-problem-using-delta-hedging?noredirect=1&amp;amp;lq=1&quot;&gt;Derivation of BS PDE problem using Delta hedging&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/32171/black-scholes-differential?noredirect=1&amp;amp;lq=1&quot;&gt;Black Scholes differential&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h2&gt;The hedging portfolio $C_t-(\partial C/\partial S)S_t$ is not self-financing&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;We can check that the hedging portfolio $(w_C,w_S)=(1,-\partial C/\partial S)$ is not self-financing. Letting $X_t$ be the portfolio value, we have $-$ dropping time subscripts:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;dX &amp;amp; = dC+d(w_SS)&#xA;\\[6pt]&#xA;&amp;amp; =dC+\left(Sdw_S+w_SdS+dw_SdS\right)&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The differential of the option is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dC = \frac{\partial C}{\partial t}dt+\frac{\partial C}{\partial S}\mu S dt + \frac{\partial C}{\partial S}\sigma SdW+\frac{1}{2}\frac{\partial^2C}{\partial S^2}\sigma^2S^2dt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We differentiate the weight $w_S$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;dw_S &amp;amp; =\frac{\partial w_S}{\partial t}dt+\frac{\partial w_S}{\partial S}dS+\frac{1}{2}\frac{\partial^2 w_S}{\partial S^2}dS^2&#xA;\\[6pt]&#xA;&amp;amp; = \frac{\partial w_S}{\partial t}dt + \frac{\partial w_S}{\partial S}\mu Sdt+\frac{\partial w_S}{\partial S}\sigma SdW+\frac{1}{2}\frac{\partial^2 w_S}{\partial S^2}\sigma^2S^2dt&#xA;\\[6pt]&#xA;&amp;amp; = -\left(\frac{\partial^2C}{\partial S\partial t}dt + \frac{\partial^2C}{\partial S^2}\mu Sdt+\frac{\partial^2C}{\partial S^2}\sigma SdW+\frac{1}{2}\frac{\partial^3C}{\partial S^3}\sigma^2S^2dt\right)&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;&amp;amp; Sdw_S = -\left(\frac{\partial^2C}{\partial S\partial t}Sdt + \frac{\partial^2C}{\partial S^2}\mu S^2dt+\frac{\partial^2C}{\partial S^2}\sigma S^2dW+\frac{1}{2}\frac{\partial^3C}{\partial S^3}\sigma^2S^3dt\right)&#xA;\\[6pt]&#xA;&amp;amp; w_SdS = -\left(\frac{\partial C}{\partial S}\mu Sdt+\frac{\partial C}{\partial S}\sigma SdW\right)&#xA;\\[6pt]&#xA;&amp;amp; dw_SdS = -\frac{\partial^2C}{\partial S^2}\sigma^2S^2dt&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Terms cancel and we obtain:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;dX = \frac{\partial C}{\partial t}dt &amp;amp; - \frac{\partial^2C}{\partial S\partial t}Sdt - \frac{\partial^2C}{\partial S^2}\mu S^2dt &#xA;\\[6pt]&#xA;&amp;amp; - \frac{\partial^2C}{\partial S^2}\sigma S^2dW - \frac{1}{2}\frac{\partial^3C}{\partial S^3}\sigma^2S^3dt -&#xA; \frac{1}{2}\frac{\partial^2C}{\partial S^2}\sigma^2S^2dt&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence we conclude that the self-financing condition $dX = dC+w_SdS$ is not verified: indeed the term in $\partial^2C/\partial S \partial t$ would not appear if it was self-financing, in which case it would read:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;dX &amp;amp; = \left(\frac{\partial C}{\partial t}dt+\frac{\partial C}{\partial S}\mu S dt + \frac{\partial C}{\partial S}\sigma SdW+\frac{1}{2}\frac{\partial^2C}{\partial S^2}\sigma^2S^2dt\right)-\frac{\partial C}{\partial S}\left(\mu Sdt + \sigma SdW \right)&#xA;\\[6pt]&#xA;&amp;amp; = \frac{\partial C}{\partial t}dt + \frac{1}{2}\frac{\partial^2C}{\partial S^2}\sigma^2S^2dt&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Independence of the pricing PDE and the option weight $w_C$&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Note that the confusion around the hedging portfolio is in part due to the fact that the pricing PDE &lt;strong&gt;does not&lt;/strong&gt; depend on the weight of the option $w_C$. As stated in your question, the correct stock weight $w_S$ is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$w_S = -w_C\frac{\partial C}{\partial S}$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recall that after having cancelled the random terms in $dX_t$ through the choice of $(w_C, w_S)$, we get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dX_t = w_C \left(\frac{\partial C}{\partial t} + \frac{1}{2}\sigma^2S^2 \frac{\partial^2 C}{\partial S^2}\right)dt$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the risk-free return constraint, we then obtain $-$ dropping time subscripts:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;&amp;amp; dX = rXdt&#xA;\\[6pt]&#xA;\Leftrightarrow \quad &amp;amp; w_C \left(\frac{\partial C}{\partial t} + \frac{1}{2}\sigma^2S^2\frac{\partial^2C}{\partial S^2}\right)dt = r\left(w_SS+w_CC \right)dt&#xA;\\[6pt]&#xA;\Leftrightarrow \quad &amp;amp; w_C \left(\frac{\partial C}{\partial t} + \frac{1}{2}\sigma^2S^2\frac{\partial^2C}{\partial S^2}\right) = rw_C \left(-\frac{\partial C}{\partial S}S + C\right)&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence the derivative weight $w_C$ can be cancelled.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;A note on hedging portfolios&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Note the difference between our approach and the one described in your paper:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Here, we hold a portfolio of options and stocks and we require this portfolio to return the risk-free rate;&lt;/li&gt;&#xA;&lt;li&gt;In your paper, we hold a portfolio made up on an option combined with stocks and riskless bonds and we require its value to be $0$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$$\underbrace{w_C(t)C_t + w_S(t)S_t = B(t)}_{(1) \, \text{Our hedging portfolio}} \quad \Longleftrightarrow \quad \underbrace{C_t + w_S(t)S_t + w_B(t)B(t) = 0}_{(2) \, \text{Your paper's hedging portfolio}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The self-financing condition is different in both cases:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;&amp;amp; (1) \; : \; C_tdw_C(t) + dw_C(t)dC_t + S_tdw_S(t) + dw_S(t)dS_t = 0&#xA;\\[12pt]&#xA;&amp;amp; (2) \; : \;  S_tdw_S(t) + dw_S(t)dS_t + B_tdw_B(t) + dw_B(t)dB_t = 0&#xA;\end{align} $$&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-06-07T17:53:22.443" LastActivityDate="2017-06-07T17:53:22.443" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34547" PostTypeId="1" AcceptedAnswerId="34551" CreationDate="2017-06-04T16:10:48.607" Score="1" ViewCount="1550" Body="&lt;p&gt;I am curious and want to do some personal research into alpha signals, but I couldn't find much relevant information. What I think will be the way to is to start with a return series, build a long- short portfolio (e.g. top/bottom decile or some more refined ML techniques), take those returns calculate z-scores and do s.th like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;z-score * IC * volatility &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to get a real alpha signal that I can use in a portfolio optimisation context. Would be great to get more insight. &lt;/p&gt;&#xA;" OwnerUserId="5366" LastActivityDate="2017-06-04T22:23:18.183" Title="How does one create an alpha signal" Tags="&lt;returns&gt;&lt;factor-models&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34548" PostTypeId="2" ParentId="34545" CreationDate="2017-06-04T17:08:05.150" Score="3" Body="&lt;p&gt;No, the pricing of a double barrier knock-out option cannot be decomposed into single barrier options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are a few references that apply the method of images to the valuation of double barrier options:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;A very clear and easy to follow exposition can be found in Chapter 3.5 of the Ph.D. thesis by Konstandatos (2003).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you don't have access to that, then I believe it is also reproduced in the author's book Konstandatos (2008).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Another reference is the paper Buchen and Konstandatos (2008). Here, they consider exponential barriers. You seem to be interested in the special case when the exponential &quot;bending&quot; is zero.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Buchen, Peter W. and Otto Konstandatos (2009) &quot;A New Approach to Pricing Double-Barrier Options with Arbitrary Payoffs and Exponential Boundaries,&quot; &lt;em&gt;Applied Mathematical Finance&lt;/em&gt;, Vol. 16, No. 6, pp. 245-259&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Konstandatos, Otto (2003) &quot;A New Framework for Pricing Barrier and Lookback Options,&quot; Ph.D. Thesis, University of Sydney&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Konstandatos, Otto (2008) &lt;em&gt;Pricing Path Dependent Exotic Options&lt;/em&gt;: VDM Verlag Dr. Müller&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-06-04T17:15:59.190" LastActivityDate="2017-06-04T17:15:59.190" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34549" PostTypeId="1" CreationDate="2017-06-04T19:22:41.200" Score="0" ViewCount="155" Body="&lt;p&gt;An option can be exercised hourly but depends on two prices - one is available daily and hourly, the other one only daily. How can I write an option model that uses a quadrinomial lattice with both these prices and can be exercised hourly?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please take the following as given, as I already have a model that serves very well its purpose for daily granularity: I assumed that log-prices (after removing seasonalities) are mean reverting (&lt;a href=&quot;http://en.wikipedia.org/wiki/Ornstein%E2%80%93Uhlenbeck_process&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://en.wikipedia.org/wiki/Ornstein%E2%80%93Uhlenbeck_process&lt;/a&gt;) and I estimated 2 correlated Ornstein-Uhlenbeck processes from historic spot prices - electricity and gas. Then I wrote an option model that calculates the value of the spread between the two (i.e. a gas power plant) with the possibility to exercise daily (binomial method is convenient, as there are many physical restrictions of the power plant). I want to do the same for HOURLY exercise, but for gas there are only DAILY liquid spot prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way that I can for example infer a hypothetical hourly drift, mean-reversion speed, volatility and correlation with electricity price for gas price from the daily parameters?&lt;/p&gt;&#xA;" OwnerUserId="20224" LastEditorUserId="20224" LastEditDate="2017-06-06T09:20:10.277" LastActivityDate="2017-06-06T17:25:08.983" Title="How to use daily and hourly prices in same option model?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;european-options&gt;" AnswerCount="1" CommentCount="9" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34550" PostTypeId="1" AcceptedAnswerId="34572" CreationDate="2017-06-04T19:56:58.580" Score="0" ViewCount="522" Body="&lt;p&gt;When using Markowitz Portfolio Theory, e.g. for finding an optimal portfolio composition, one needs to have estimates of the returns, but most importantly of the covariance matrix. If our universe of assets/securities was, say, larger than 10,000 names (or just a very large number), how would one effectively come up with a useable estimate for the covariance matrix?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly, we can use historically-observed covariance/correlations but given that we have such a large number of names, how accurate would these estimates be? Is it possible to reduce dimensionality by using some sort of PCA approach?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not interested in a perfect solution, but rather in ideas and potential techniques that I could read up on w.r.t. portfolio optimisation and parameter estimation on a large scale.&lt;/p&gt;&#xA;" OwnerUserId="6621" LastActivityDate="2017-06-07T03:06:38.483" Title="Portfolio Optimisation/Covariance Estimation on a large scale" Tags="&lt;portfolio-optimization&gt;&lt;pca&gt;&lt;covariance-matrix&gt;&lt;markowitz&gt;&lt;covariance-estimation&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34551" PostTypeId="2" ParentId="34547" CreationDate="2017-06-04T22:23:18.183" Score="3" Body="&lt;p&gt;I used to combine factors into an expected return per signal. I then used historical return variances to create a Sharpe-optimized weighted portfolio. In hindsight, I wish I had not used the Sharpe ratio to create the final alpha signal. I believe that more recent work in &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S1570865908000033&quot; rel=&quot;nofollow noreferrer&quot;&gt;Stochastic Portfolio Theory&lt;/a&gt; and the &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/9814383139&quot; rel=&quot;nofollow noreferrer&quot;&gt;Continuous Kelly Capital Growth Criterion&lt;/a&gt; provides better avenues for maximizing the long-run rate of return for a given amount of risk. I also regret using historical return variances since I think our data contained information that would have been useful in constructing forward-looking covariance matrices.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastActivityDate="2017-06-04T22:23:18.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34552" PostTypeId="2" ParentId="34429" CreationDate="2017-06-05T00:03:30.720" Score="1" Body="&lt;p&gt;The models do not work empirically.  You don't apply things that don't work.  Find just ONE supporting validation study for Black-Scholes.  I cannot find the citation, but there was a clever one about twenty years ago that tested the S&amp;amp;P 500 and determined that the Black-Scholes formula for it was uncorrelated with reality.  I have run similar tests on disaggregated returns for the CRSP universe and had the same finding.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2017-06-05T00:03:30.720" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34553" PostTypeId="1" AcceptedAnswerId="34554" CreationDate="2017-06-05T00:30:22.730" Score="2" ViewCount="2410" Body="&lt;p&gt;If I know TYU7 contract's CTD is T 2.500 05/15/2024 with modified duration of 6.37. I know futures DV01 is calculated by taking the CTD's DV01 divided by conversion factor as shown &lt;a href=&quot;https://www.cmegroup.com/trading/interest-rates/files/Calculating_the_Dollar_Value_of_a_Basis_Point_Final_Dec_4.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;. What is the modified duration of TYU7? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried backing out the Mod Dur based on the formula for calculating Mod Dur using DV01 for cash instruments, which is $$Mod Dur = \frac{DV01}{0.01*0.01*Price}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the future's DV01 and its price, this gave me a Mod Dur for futures which is the same as Mod Dur for cash CTD. Kinda weird, isn't it?&lt;/p&gt;&#xA;" OwnerUserId="13375" LastEditorUserId="13375" LastEditDate="2017-06-05T00:40:10.940" LastActivityDate="2017-06-05T02:36:46.343" Title="Modified duration of treasury futures tracking CTD?" Tags="&lt;bond-futures&gt;&lt;treasuries&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34554" PostTypeId="2" ParentId="34553" CreationDate="2017-06-05T02:36:46.343" Score="8" Body="&lt;p&gt;Let's make a simplifying assumption that futures perfectly track their CTDs, then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ D_\text{mod, fut} = \frac{1}{f}\frac{df}{dy} = \frac{1}{F_\text{CTD} / \lambda_\text{CTD}} \cdot \frac{dF_\text{CTD} / dy}{\lambda_\text{CTD}} = \frac{1}{F_\text{CTD}}\frac{dF_\text{CTD}}{dy}, $$&#xA;where $f$ is the futures price, $F_\text{CTD}$ is the CTD's forward price, and $\lambda_\text{CTD}$ is the CTD's conversion factor. So you're right; under the assumption that futures track its current CTD, then its modified duration is identical to the CTD's (forward) modified duration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I cannot emphasize how dangerous the assumption can be. In the current environment where CTDs have 100% delivery probability into the futures, you're fine. But in other environments, multiple underlyings can be contenders for CTD status. In these cases, futures duration can be very different from the current CTD. The proper thing to do is to build a futures model that account for delivery options and calculate risk metrics such as option-adjusted DV01/duration.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2017-06-05T02:36:46.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34555" PostTypeId="2" ParentId="34522" CreationDate="2017-06-05T07:37:54.907" Score="3" Body="&lt;p&gt;If we are talking about brokers who making markets for &lt;a href=&quot;https://en.wikipedia.org/wiki/Binary_option&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Binary_option&lt;/a&gt; than I would guess that they aren't hedging at all. It's very common that maturities are in a timeframe of seconds or minutes. In my opinion returns are completely random in those timeframes.&lt;/p&gt;&#xA;" OwnerUserId="26899" LastActivityDate="2017-06-05T07:37:54.907" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34556" PostTypeId="2" ParentId="34429" CreationDate="2017-06-05T12:32:18.303" Score="1" Body="&lt;p&gt;Black-Sholes-Merton formula (and the other models) are valid under some assumptions. These assumptions are broken to some degree in financial markets and even more so for &quot;risky cash flows&quot; in general. You probably will not use model which assumes &quot;A is true&quot; when it is obvious that &quot;A is false&quot;.  Furthermore, as the title of Haug&amp;amp;Taleb &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S0167268110001927&quot; rel=&quot;nofollow noreferrer&quot;&gt;article&lt;/a&gt; claims, even &quot;option traders use (very) sophisticated heuristics, never the Black–Scholes–Merton formula&quot;. &lt;/p&gt;&#xA;" OwnerUserId="15154" LastActivityDate="2017-06-05T12:32:18.303" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34557" PostTypeId="2" ParentId="34538" CreationDate="2017-06-05T12:38:44.293" Score="-1" Body="&lt;p&gt;I think your calculation is just wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Starting from the edit, we have for the 6m zero rate:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;6M zero rate:&#xA;$$2.5 \times e^{-0.5 r_{6m}} + 102.5 \times e^{-r_{1y}} = 99.8$$&#xA;$$r_{6m} = - 2 \ln \left( \frac{99.8-102.5 e^{-r_{1y}} }{2.5} \right) = \textbf{2.6571%}$$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="26595" LastActivityDate="2017-06-05T12:38:44.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34558" PostTypeId="1" CreationDate="2017-06-05T17:21:24.257" Score="5" ViewCount="673" Body="&lt;p&gt;Let's assume we have ATM European call on a basket of two stocks and  price it with:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Multivariate Local Vol with constant correlation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Gaussian copula&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming we use the same correlation coefficient, will we always get the same (or almost the same) result? How we can quantify the difference between both approaches?&lt;/p&gt;&#xA;" OwnerUserId="28250" LastEditorUserId="28250" LastEditDate="2017-06-05T19:20:32.440" LastActivityDate="2017-11-13T21:21:31.467" Title="Difference between Local Vol and Copula" Tags="&lt;options&gt;&lt;correlation&gt;&lt;copula&gt;&lt;local-volatility&gt;&lt;basket&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34564" PostTypeId="2" ParentId="21163" CreationDate="2017-06-06T14:27:43.517" Score="2" Body="&lt;p&gt;There are two test methods described in Aronson's book; White's Reality Check and a Permutation test. At the heart of both is the idea of a &quot;position vector,&quot; e.g. a numerical vector of a series of 1, -1 or 0, which correspond to long, short or neutral positions. For example, a vector of &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[ 1 1 1 1 1 0 0 0 -1 -1 -1 -1 ]  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;would represent being long for 5 days, out of the market for 3 and finally short for 4 days. This can be directly applied to a pairs trade such as long stock A, short stock B for 5 days, no position for 3 days and finally short A and long B for 3 days. The Monte Carlo aspect of the tests in question is essentially an &lt;em&gt;n&lt;/em&gt; number of random permutations of this position vector. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The difference between the two tests is how the &lt;em&gt;null hypothesis sampling distribution&lt;/em&gt; is defined and created. For the simpler of the two, the permutation test, the null is that the &quot;rule&quot; has no predictive power and so the randomized position vector is multiplied with the &quot;returns&quot; to give a distribution of &quot;no predictive power returns.&quot; In the book log returns are used, but any return can be used; e.g. dollars made per day on a minimum sized pairs position, the tick value of the spread curve etc. This will simply be the test statistic used for comparative purposes, and the test will be comparing apples to apples. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For White's Reality Check, the null is that the &quot;rule's return&quot; is zero, and so the return vector must be detrended such that a continuous long or short position would give a zero return over the test period. The book subtracts the average daily log return from each daily log return to acheive this because log return is the chosen test statistic. However, if another test statistic is chosen, it too must be detrended in an appropriate way, e.g. subtract the average dollars made per day on a minimum sized pairs position from each individual daily dollar return on the same sized position. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would, therefore, seem to be quite straightforward to apply the standard tests from the book: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;i)   create your position vector&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ii)  create your chosen test statistic return vector (detrended if necessary)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;iii) apply the test&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, having written all this, I think the more pertinent problem for pairs trading is data mining bias, wherein the search process for stock A and stock B should be subject to testing, rather than testing A with B in the above framework after A and B have been selected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may find it interesting to browse my &lt;a href=&quot;https://github.com/Dekalog/Data-Snooping-Tests&quot; rel=&quot;nofollow noreferrer&quot;&gt;data snooping Github&lt;/a&gt;, which has code and various downloaded papers related to this general area.   &lt;/p&gt;&#xA;" OwnerUserId="252" LastActivityDate="2017-06-06T14:27:43.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34565" PostTypeId="1" CreationDate="2017-06-06T15:36:53.733" Score="2" ViewCount="391" Body="&lt;p&gt;I am trying to set up a time varying factor model for the purpose of return decomposition via kalman filter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following this &lt;a href=&quot;http://lalas.github.io/quantitativeThoughts/r/2014/09/01/dlmTutorial.html#topic4.1&quot; rel=&quot;nofollow noreferrer&quot;&gt;example&lt;/a&gt; and slightly modifying it so as to accommodate for more than one input parameters (i.e S&amp;amp;P 500, Equity L/S index etc) I am getting the betas for the two benchmarks but, as expected, they don't necessarily sum up to 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way to add a constraint during the MLE that the output parameters have to sum up to one?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;...adding the code below, it's basically the same code as in the &lt;a href=&quot;http://lalas.github.io/quantitativeThoughts/r/2014/09/01/dlmTutorial.html#topic4.1&quot; rel=&quot;nofollow noreferrer&quot;&gt;example&lt;/a&gt; with just adding another index and removing the intercept(alpha)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(PerformanceAnalytics, quietly = TRUE,  warn.conflicts = FALSE)&#xA;&#xA;data(managers)&#xA;# extract HAM1 and SP500 excess returns&#xA;HAM1 = 100*(managers[,&quot;HAM1&quot;, drop=FALSE] - managers[,&quot;US 3m TR&quot;, drop=FALSE])&#xA;factor_indices = cbind(100*(managers[,&quot;SP500 TR&quot;, drop=FALSE] - managers[,&quot;US 3m TR&quot;, drop=FALSE]),100*(managers[,&quot;EDHEC LS EQ&quot;, drop=FALSE]))&#xA;factor_indices= factor_indices['1997-01-31/']&#xA;HAM1 = HAM1['1997-01-31/']&#xA;colnames(factor_indices) = c(&quot;SP500&quot;,&quot;EQLS&quot;)&#xA;&#xA;# Specifying a set model parameters&#xA;s2_v = 1      # Variance of observations&#xA;s2_sp = 0.01 &#xA;s2_eqls = 0.01  &#xA;# Construct a regression model&#xA;tvp.dlm = dlmModReg(X=factor_indices, addInt=FALSE, dV=s2_v, dW=c(s2_sp, s2_eqls))&#xA;&#xA;# looking at the various component&#xA;tvp.dlm[c(&quot;FF&quot;,&quot;V&quot;,&quot;GG&quot;,&quot;W&quot;,&quot;m0&quot;,&quot;C0&quot;)]&#xA;tvp.dlm[c(&quot;JFF&quot;,&quot;JV&quot;,&quot;JGG&quot;,&quot;JW&quot;)]&#xA;&#xA;ols.fit = lm(HAM1 ~ factor_indices)&#xA;summary(ols.fit)&#xA;&#xA;start.vals = c(1,0.01,0.01)&#xA;&#xA;names(start.vals) = c(&quot;lns2_v&quot;, &quot;lns2_sp&quot;, &quot;lns2_eqls&quot;)&#xA;&#xA;# function to build Time Varying Parameter state space model&#xA;buildTVP &amp;lt;- function(parm, x.mat){&#xA;  parm &amp;lt;- exp(parm)&#xA;  return( dlmModReg(X=x.mat, dV=parm[1],addInt=FALSE, dW=c(parm[2], parm[3])) )&#xA;}&#xA;&#xA;# Estimate the model&#xA;TVP.mle = dlmMLE(y=HAM1, parm=start.vals, x.mat=factor_indices, build=buildTVP, hessian=T)&#xA;&#xA;# get sd estimates&#xA;#se2 &amp;lt;- sqrt(exp(TVP.mle$par))&#xA;#names(se2) = c(&quot;s_obs&quot;, &quot;s_alpha&quot;, &quot;s_beta&quot;)&#xA;#sqrt(se2)&#xA;&#xA;TVP.dlm &amp;lt;- buildTVP(TVP.mle$par, factor_indices)&#xA;TVP.f &amp;lt;- dlmFilter(y = HAM1, mod = TVP.dlm)&#xA;# Optimal estimates of θ_t given information available at time T.&#xA;TVP.s &amp;lt;- dlmSmooth(TVP.f)&#xA;&#xA;# extract smoothed states &#xA;sp.s = xts(TVP.s$s[-1,1,drop=FALSE], as.Date(rownames(TVP.s$s[-1,])))&#xA;eqls.s  = xts(TVP.s$s[-1,2,drop=FALSE], as.Date(rownames(TVP.s$s[-1,])))&#xA;colnames(sp.s) = &quot;sp&quot;&#xA;colnames(eqls.s)  = &quot;eqls&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="22383" LastEditorUserId="22383" LastEditDate="2017-06-09T08:00:06.923" LastActivityDate="2017-06-09T08:00:06.923" Title="kalman filter for a multifactor model in R" Tags="&lt;returns&gt;&lt;factor-models&gt;&lt;performance-evaluation&gt;&lt;kalman&gt;&lt;factor-loading&gt;" AnswerCount="0" CommentCount="14" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34566" PostTypeId="2" ParentId="34501" CreationDate="2017-06-06T16:13:22.150" Score="2" Body="&lt;p&gt;Here's some criteria: For example deal size, an exchange will trade a range of sizes from x to y and outside that you need OTC. Then there's value dates, an exchange will trade a range of standard value dates and outside that range you need OTC. Then there's the fact of one off or repeat business. If you've got a lot of repeat business you may prefer the OTC 1-to-1 relationship and advisory services compared with more anonymous trading on an exchange. I mean if your OTC counterparty continually rips you off on repeat business you're going to end the relationship, right? So the long term relationship is an incentive for you both to go OTC. There's nothing to stop lower fees for vanilla options (via a better spread band) if your counterparty knows you're going to be trading a lot. On that subject your credit arrangements, collateral agreements and margin costs may also be a criteria between the 2 choices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I guess if you have standard products to trade and see no benefit from a long term relationship with any 1 counterparty, go exchange, otherwise investigate your OTC options.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2017-06-06T16:13:22.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34567" PostTypeId="1" CreationDate="2017-06-06T17:11:45.787" Score="1" ViewCount="715" Body="&lt;p&gt;I would like to do a qualitative question about the Expected shortfall in the Basel 3 document. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;First of all let me introduce few definitions.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose to have a portfolio $P$ depending on a family of risk factors.&#xA;Let $T$ be a time horizon (for the Basel document $T = 10 $ days).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I introduce a family of &lt;strong&gt;liquidity horizons&lt;/strong&gt; usefull to classificate the risk factors:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{matrix}&#xA;j &amp;amp;  &amp;amp; LH_j \\ &#xA;\hline &amp;amp; &amp;amp; \\&#xA;1 &amp;amp; &amp;amp; 10 \ days \\&#xA;2 &amp;amp; &amp;amp; 20 \ days \\&#xA;3 &amp;amp; &amp;amp; 40 \ days\\&#xA;4 &amp;amp; &amp;amp; 60 \ days\\&#xA;5 &amp;amp; &amp;amp; 120 \ days&#xA;\end{matrix}&#xA;$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks to this definition we can introduce the families $Q(P,j)$ of the risk factors whose liquidity horizons are at least as long as $LH_j$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally we define the following terms:&#xA;\begin{align}&#xA;ES_T(P)  = &amp;amp; \mbox{ES for the horizon T wrt all the risk factors} \\&#xA;ES_T(P,j)  = &amp;amp; \mbox{ES for the horizon T where all the risk factors NOT belonging}  \\ &#xA;&amp;amp; \mbox{to Q(P,j) are freezed}&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now that we have done with definitions I can make my question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The Basel document gives this definition of Expected shortfall that I can not understand from an economical point of view:&lt;/strong&gt;&#xA;$$&#xA;ES = \sqrt{\left(ES_T(P)\right)^2 + \sum_{j\geqslant 2} \left( ES_T(P,j) \sqrt{\frac{LH_j - LH_{j-1}}{T}}  \right)^2}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first term is just the right term...but it seems a good idea to introduce other terms in order to take in account of ES wrt a subset of risk factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now: I really do not understand the presence of the terms $\frac{LH_j - LH_{j-1}}{T}$, in particular it seems like they have to do the job of a weighted terms but in general they are equal to the following values $(1, 2, 2, 6)$ so that I can' t understand what is the meaning or the purpose of such terms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advice for your help.&#xA;Ciao!&lt;/p&gt;&#xA;" OwnerUserId="26793" LastEditorUserId="16148" LastEditDate="2017-06-07T12:27:18.430" LastActivityDate="2021-04-14T06:32:43.370" Title="Expected Shortfall Basel III style: what is the idea?" Tags="&lt;var&gt;&lt;basel&gt;&lt;market-risk&gt;&lt;expected&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34568" PostTypeId="2" ParentId="34549" CreationDate="2017-06-06T17:25:08.983" Score="1" Body="&lt;p&gt;From the sounds of things, you have two processes, for electricity and gas prices, and have decided they are Ornstein-Uhlenbeck processes. Let's call then $E$ and $G$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{eqnarray}&#xA;\mathrm{d}E_t &amp;amp;= \theta_{{}_E} (\mu_{{}_E} -E_t)\mathrm{d}t + \sigma_{{}_E} \mathrm{d}W_t^{{}_E} \\&#xA;\mathrm{d}G_t &amp;amp;= \theta_{{}_G} (\mu_{{}_G} -G_t)\mathrm{d}t + \sigma_{{}_G} \mathrm{d}W_t^{{}_G} \\&#xA;\end{eqnarray}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and also we have $\langle\mathrm{d}W_t^{{}_E}\mathrm{d}W_t^{{}_G}\rangle = \rho\sqrt{\mathrm{d}t}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where you've found all these parameters through some sort of optimization/regression (presumably).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the above, $\mu_{{}_X}$ is the anualized drift for process $X$, and $\sigma_{{}_X}$ its anualized vol - you do not have term structures for them, so you don't need to worry about treating them differently when you change $\mathrm{d}t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, i don't know exactly how you're using these - you say you want a &lt;em&gt;quadrinomial lattice&lt;/em&gt; in the question, and then mention that the binomial model is convenient due to physical restrictions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to fiddle with the numbers in excel or something, just use the Euler discretization:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{eqnarray}&#xA;S_{t+\mathrm{d}t} &amp;amp;=&amp;amp; S_t + \int_t^{t+\mathrm{d}t} \theta (\mu - S_t) \mathrm{d}t + \int_t^{t+\mathrm{d}t} \sigma\mathrm{d}W_t \\&#xA;&amp;amp;=&amp;amp; S_t + \theta (\mu - S_t) \mathrm{d}t + \sigma \sqrt{\mathrm{d}t}\tilde{X}&#xA;\end{eqnarray}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should notice that you don't need to change the params to account for a different time discretization.&lt;/p&gt;&#xA;" OwnerUserId="19663" LastActivityDate="2017-06-06T17:25:08.983" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="34569" PostTypeId="2" ParentId="461" CreationDate="2017-06-06T21:31:12.473" Score="0" Body="&lt;p&gt;I keep seeing that IB does not offer true tick data and I don't know if this is because these comments are old and they &lt;strong&gt;DID NOT&lt;/strong&gt; offer true tick data at the time, but from my research they DO OFFER TRUE TICK DATA. (I called them and asked, because I saw in a few places where people said they do not offer it. You have to sign up for market data to get the true tick data, though.) Just wanted to put this out here for other people that come across it.&lt;/p&gt;&#xA;" OwnerUserId="28265" LastActivityDate="2017-06-06T21:31:12.473" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34570" PostTypeId="1" CreationDate="2017-06-06T22:38:55.517" Score="0" ViewCount="126" Body="&lt;p&gt;What is no par call curve in terms of muni securities ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone explain how does it affect spread and duration and why is it used while evaluating securities  ? &lt;/p&gt;&#xA;" OwnerUserId="2750" LastActivityDate="2017-06-08T01:53:23.853" Title="what is non par call curve ?" Tags="&lt;bond&gt;&lt;bond-yields&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34571" PostTypeId="2" ParentId="34541" CreationDate="2017-06-07T00:26:02.937" Score="-3" Body="&lt;p&gt;Euro equities are much more fragmented than the US&lt;/p&gt;&#xA;" OwnerUserId="28266" LastActivityDate="2017-06-07T00:26:02.937" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34572" PostTypeId="2" ParentId="34550" CreationDate="2017-06-07T02:51:38.937" Score="3" Body="&lt;p&gt;Broadly speaking, as you probably already know, there are 2 approaches to estimating large covariance matrices:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Shrinkage Methods like &lt;a href=&quot;http://ledoit.net/ole2_abstract.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;Ledoit-Wolf&lt;/a&gt; that try to reduce the noise in a large matrix (N by N) that has been estimated using the conventional method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Factor Models of Covariance as described in for example &lt;a href=&quot;http://efalken.com/pdfs/ConnorKor07.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Connor Korajczik 2007&lt;/a&gt; that assume that only a small number of factors matter. This is pretty much what you have in mind when you mention &quot;some sort of a PCA approach&quot;. A decent paper on estimating such models is  &lt;a href=&quot;http://www-bcf.usc.edu/~christoj/pdf/jones_2001_jfe.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Extracting factors from heteroskedastic asset returns, by Christopher S. Jones&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the practical side there is a big project at Blackrock directed by Andrew Ang that is developing and updating a huge factor-based risk model for a large number of markets that is the biggest covariance estimation that I know of. Bloomberg is also developing a large risk model of this kind. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a lot of practical issues that you have to deal with if you do the estimation yourself. One is that not all assets have been in existence for the same length of time (Stambaugh wrote about this in 'Analyzing Investments Whose Histories Differ in Length' in 1997). Another is that daily correlations between stocks trading on different exchanges are tricky because, for example the trading hours for New York and Tokyo are quite different. Also, because of these and other problems the covariance matrix you estimate often turns out to be non-positive definite, which causes problems when you run an optimizer. You have to check the matrix before you use it and fix it to be positive definite if necessary.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2017-06-07T03:06:38.483" LastActivityDate="2017-06-07T03:06:38.483" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34573" PostTypeId="2" ParentId="34567" CreationDate="2017-06-07T03:32:56.487" Score="3" Body="&lt;p&gt;I believe the document that @clarkmaio referred to is &lt;a href=&quot;http://www.bis.org/bcbs/publ/d352.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Minimum capital requirements for market risk&lt;/a&gt; and the issue described can be found on page 52.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As explained &lt;a href=&quot;https://www.clarusft.com/fundamental-review-of-the-trading-book-what-you-need-to-know/&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The revised FRTB rules require ES to be calculated using a base liquidity horizon of 10-days and this ES to be scaled by mapping each risk factor to one of the risk categories below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/k536t.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/k536t.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Meaning that a portfolio of:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Minor currencies will have an ES of sqrt(20/10) or 1.41 times higher;&lt;/li&gt;&#xA;&lt;li&gt;Credit spread corporates (IG) will have an ES of sqrt(40/10) or 2&#xA;times higher;&lt;/li&gt;&#xA;&lt;li&gt;Interest rate options will have an ES of 2.45 times higher;&lt;/li&gt;&#xA;&lt;li&gt;Credit Spread volatility products will have an ES of 3.46 times&#xA;higher;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;These reflect the increased time to liquidate such positions in a time of market stress, resulting in a higher potential market loss.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;FX: volatility&lt;/li&gt;&#xA;&lt;li&gt;n = 40&lt;/li&gt;&#xA;&lt;li&gt;j = 3&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;ES = \sqrt{\left(ES_T(P)\right)^2 + \left( ES_T(P,2) \sqrt{\frac{LH_2 - LH_1}{T}}  \right)^2 + \left( ES_T(P,3) \sqrt{\frac{LH_3 - LH_2}{T}}  \right)^2} = \sqrt{\left(ES_T(P)\right)^2 + \left( ES_T(P,2) \sqrt{\frac{20 - 10}{10}}  \right)^2 + \left( ES_T(P,3) \sqrt{\frac{40 - 20}{10}}  \right)^2} = \sqrt{\left(ES_T(P)\right)^2 + \left( ES_T(P,2) \right)^2 + 2 \times \left( ES_T(P,3) \right)^2} = \sqrt{4 \times \left(ES_T(P)\right)^2} = 2 \times ES_T(P)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Credit spread: volatility&lt;/li&gt;&#xA;&lt;li&gt;n = 120&lt;/li&gt;&#xA;&lt;li&gt;j = 5&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;ES = \sqrt{\left(ES_T(P)\right)^2 + \left( ES_T(P,2) \sqrt{\frac{LH_2 - LH_1}{T}}  \right)^2 + \left( ES_T(P,3) \sqrt{\frac{LH_3 - LH_2}{T}}  \right)^2 + \left( ES_T(P,4) \sqrt{\frac{LH_4 - LH_3}{T}}  \right)^2 + \left( ES_T(P,5) \sqrt{\frac{LH_5 - LH_4}{T}} \right)^2} = \sqrt{\left(ES_T(P)\right)^2 + \left( ES_T(P,2) \right)^2 + 2 \times \left( ES_T(P,3) \right)^2 + 2 \times \left( ES_T(P,4) \right)^2 + 6 \times \left( ES_T(P,5) \right)^2} = \sqrt{12} \times ES_T(P) = 3.46 \times ES_T(P)&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="19096" LastEditorUserId="19096" LastEditDate="2017-06-07T10:03:47.307" LastActivityDate="2017-06-07T10:03:47.307" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="34574" PostTypeId="1" AcceptedAnswerId="34582" CreationDate="2017-06-07T04:04:59.773" Score="2" ViewCount="209" Body="&lt;p&gt;For option $V(S,t)$ with underlying asset $S$, we have a hedge portfolio&#xA;$$\Pi = V(S,t) - \Delta(S,t)S$$&#xA;I always confuse here, when we take the differential of $\Pi$&#xA;$$d\Pi = dV -\Delta dS$$&#xA;why needn't we take the differential for $\Delta(S,t),$&#xA;I think it should be&#xA;$$d\Pi = dV -d(\Delta S).$$&#xA;We call the delta-hedge &lt;code&gt;self-financing,&lt;/code&gt; can any one show me a clearly reason?&lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-06-07T13:45:52.230" Title="Why don't we take the differential to the Delta in the Delta hedge-portfolio" Tags="&lt;derivatives&gt;&lt;delta-hedging&gt;" AnswerCount="3" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="34575" PostTypeId="2" ParentId="34574" CreationDate="2017-06-07T05:16:03.480" Score="2" Body="&lt;p&gt;Delta is intended to be a locally-constant holding to the stock (to create an instantaneously riskless portfolio) and determined by the current state of the system, hence passes through the derivative operator. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I visualise it similar to a tangent to a curve - it's different as you move along the curve (i.e. as the state of the system changes) but it's locally-constant and every time we pass through a given point, I recover the same tangent. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Same as under Black-Scholes, my option delta is uniquely determined by the state of my option economy (stock price, moneyness, time to expiry, etc) &lt;/p&gt;&#xA;" OwnerUserId="27516" LastActivityDate="2017-06-07T05:16:03.480" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34576" PostTypeId="1" CreationDate="2017-06-07T05:59:40.780" Score="-3" ViewCount="87" Body="&lt;p&gt;In stock analysis the baseline for alpha is 0, however for beta it's 1. Why is that so, if they are both comparisons to the market at a large?&lt;/p&gt;&#xA;" OwnerUserId="28271" LastActivityDate="2017-06-07T07:12:51.677" Title="Alpha &amp; beta in investing" Tags="&lt;equities&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2017-06-07T07:17:48.787" ContentLicense="CC BY-SA 3.0" />
  <row Id="34577" PostTypeId="1" CreationDate="2017-06-07T06:19:53.923" Score="4" ViewCount="853" Body="&lt;p&gt;Certain trading firms (i.e. Susquehanna International Group) believe playing poker can help a trader better perform in the market.  What is the rationale behind this?  How exactly does playing a card game improve equity and options trading performance?&lt;/p&gt;&#xA;" OwnerUserId="28272" LastActivityDate="2017-06-09T18:44:12.717" Title="Poker and Options Trading" Tags="&lt;options&gt;&lt;equities&gt;&lt;programming&gt;" AnswerCount="2" CommentCount="10" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34578" PostTypeId="2" ParentId="34576" CreationDate="2017-06-07T07:12:51.677" Score="3" Body="&lt;p&gt;I believe that you are working with the CAPM there. Alpha is a measure of how much excess return e.g. a stock generates, while Beta is a measure of how volatile its price is relative to the market. So the &quot;baseline&quot; or market does obviously have a beta of one with an Alpha of zero (no excess return since you are looking at the market/&quot;baseline&quot; as you called it), according to the CAPM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this answers your question.&lt;/p&gt;&#xA;" OwnerUserId="27779" LastActivityDate="2017-06-07T07:12:51.677" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34580" PostTypeId="1" CreationDate="2017-06-07T09:28:05.357" Score="3" ViewCount="182" Body="&lt;p&gt;I want to measure the positioning of an active bond mutual fund vs. its benchmark via rolling linear regression of returns vs several factors. The intuition of using linear regression is that the returns of the index or of the fund ($r$) should be a linear function of the returns of several sub indices (i.e. rates $r_{\text{10yr}}$, credit spreads $r_{\text{cred spreads}}$, etc..).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The regression takes the form:&#xA;$$r = \beta_1 \times r_{\text{10yr}} + \beta_2 \times r_{\text{cred spreads}} + \cdots$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The R-squared of the regression of the index vs. the sub-indices is ~95%.  Likewise the R-squared of the regression of the mutual fund vs. the sub indices is ~85%.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to know whether it is better to measure relative positioning using the difference in the Betas to each factor from the regressions, i.e $\beta_{\text{fund}}$ - $\beta_{\text{index}}$ or if it is better to run a single regression of excess returns of the fund over the benchmark vs. the same set of factors:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$(r_{\text{fund}}-r_{\text{index}}) = \beta_1 \times r_{\text{10yr}} + \beta_2 \times r_{\text{cred spreads}} + \cdots $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe running separate regressions allows for the error terms to be estimated with different variances but what other factors should I think about?  A third possibility is to run a panel regression were sensitivities are estimated simultaneously but the marginal effect is captured through an interaction term for each variable/fund combo.&lt;/p&gt;&#xA;" OwnerUserId="28274" LastEditorUserId="28274" LastEditDate="2017-06-07T14:02:15.093" LastActivityDate="2017-06-09T08:56:19.707" Title="Modelling fund positioning using fund returns and linear regression" Tags="&lt;regression&gt;&lt;asset-returns&gt;&lt;mutual-fund&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34581" PostTypeId="2" ParentId="34574" CreationDate="2017-06-07T09:36:07.450" Score="1" Body="&lt;p&gt;I guess a discrete time approximation would be helpful here. You can follow these steps:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;At time t choose $\alpha_t$ and $\Delta_t$ to set up your portfolio:&#xA;$$\Pi_t=\alpha_t B_t +\Delta_tS_t$$&lt;/li&gt;&#xA;&lt;li&gt;At time $t+dt$ the value of your portfolio is (pay attention to $\alpha_t$ and $\Delta_t$)&#xA;$$\Pi_{t+dt}=\alpha_t B_{t+dt} +\Delta_t S_{t+dt}$$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;It seems clear that for a small change in time, the change in the value of the portfolio is:&#xA;$$d\Pi_t = \Pi_{t+dt}-\Pi_t=\alpha_t(B_{t+dt}-B_t)+\Delta_t(S_{t+dt}-S_t)=\alpha_t dB_t+\Delta_t dS_t$$&#xA;And this is all you need to compute the delta of the portfolio, given that it has been fixed at time t. The next step is to rebalance the portfolio (here is where the selfinancing part kicks in):&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;At time $t+dt$ modify your asset holdings mainting the value of your portfolio (pay attention to $\alpha_{t+dt}$ and $\Delta_{t+dt}$):&#xA;$$\Pi_{t+dt}=\alpha_t B_{t+dt} +\Delta_t S_{t+dt}=\alpha_{t+dt} B_{t+dt} +\Delta_{t+dt} S_{t+dt}$$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;As you can see, this third step is not needed to describe the sensitivity of your portfolio with respect to $S_t$. Only the first two steps suffice, meaning that you do not have to worry about $d(\Delta S)$ exactly because of the second equality in the last equation.&lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2017-06-07T09:36:07.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34582" PostTypeId="2" ParentId="34574" CreationDate="2017-06-07T11:12:39.370" Score="2" Body="&lt;p&gt;&lt;em&gt;&lt;strong&gt;Note&lt;/strong&gt;: I have edited the answer so as to give a clearer interpretation of the self-financing condition.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us specify the notation: $C_t$ is the derivative price; $S_t$ the stock's; $B_t$ the bond's; $w_C(t)$, $w_S(t)$ and $w_B(t)$ the option's, stock's and bond's holdings respectively; $C_T=h(S_T)$ the option's payoff, which we assume is European, hence $T$ is the derivative's maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, the equation you wrote is not exactly correct, because as it has been explained a few times in this site you cannot get a self-financing portfolio by holding an option and simply adjusting the stock's holding: indeed, you cannot dynamically hedge &lt;strong&gt;one&lt;/strong&gt; option only with $w_S(t)$ stock shares, because when time passes and $w_S(t)$ changes, the only way you can change your allocation $-$ your holding $w_S(t)$ $-$ is to inject or withdraw cash from your portfolio, hence you need more degrees of freedom $-$ more weights $-$ in your equation to avoid cash injections/withdrawals. Now, there are a few ways to view the situation:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You can form a self-financing portfolio made up of options and stocks, where the weights are selected so as to cancel all random terms. Because the portfolio is self-financing and also riskless, it must earn the risk-free rate, hence:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$$ B_t = w_C(t)C_t+w_S(t)S_t $$&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You can form a portfolio with a holding of stocks and bonds which replicate the option. Hence your portfolio value must be equal to the option value at any time:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$$ C_t = w_S(t)S_t+w_B(t)B_t $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us consider the second perspective, namely let us form a portfolio consisting of stocks and bonds that replicate the option:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ C_t = w_S(t)S_t+w_B(t)B_t $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, &lt;em&gt;why must the portfolio be self-financing&lt;/em&gt;? Think of yourself as the option writer $-$ &lt;em&gt;i.e.&lt;/em&gt; seller $-$ and assume the option is sold at $t=0$ and that you are charging its fair value: your client is then paying you the option's premium $\pi$ today in exchange for which he is expecting you to settle the liability $h(S_T)$ at maturity $T$. Because you are charging the fair value of the option $-$ you can rationalize this assumption by considering that, in a liquid, competitive market environment, market participants will force option premiums to converge to their fair value, &lt;em&gt;i.e.&lt;/em&gt; no arbitrage $-$ it implies that somehow you should be able to meet your financial obligation at $T$ by appropriately allocating the cash $\pi$ &lt;em&gt;and only that sum&lt;/em&gt;: you shouldn't add or retrieve any cash throughout the life of the contract. In other words, the premium $\pi$ should be the required quantity to &lt;em&gt;finance&lt;/em&gt; your liability $h(S_T)$ at $T$, hence it must be the case that this sum can be allocated dynamically to stocks and bonds throughout the period $[0,T]$ so as to have the value $C_T=h(S_T)$ at $T$ at your disposal to pay your client. Consider the alternatives to this situation:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You need to add cash to your position at some time $t \in [0,T]$: this would be a loss to you, something you want to avoid so you wouldn't do it. You will set $\pi$ so as to avoid this;&lt;/li&gt;&#xA;&lt;li&gt;You can retrieve cash from your position at some time $t \in [0,T]$: you would be extracting value from your client. Because we have assumed we are in a competitive market environment, other option writers will charge lower prices and hence you will lose your client. You will be forced to set $\pi$ so as to avoid this $-$ if you don't want to lose your clients.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;We have established that there shouldn't be neither injections nor retrievals of cash throughout the life of the trade. Therefore, this implies that &lt;strong&gt;&lt;em&gt;the net impact of rebalancing the portfolio on the portfolio value must be null&lt;/em&gt;&lt;/strong&gt;. Applying Ito's Lemma on $dC_t$, this is equivalent to verifying the following self-financing condition: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ S_tdw_S(t) + dw_S(t)dS_t + B_tdw_B(t) + dw_B(t)dB_t = 0 \qquad (1) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(1)$ implies that the replicating portfolio evolves according to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dC_t = w_S(t)dS_t+w_B(t)dB(t) \qquad (2) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Namely, &lt;em&gt;the portfolio value should only change due to fluctuations in the option's, stocks' and bonds' prices&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, this does not mean that $w_S$ and $w_B$ cannot change throughout the life of the trade: these are functions that tell us how many stocks and bonds we must hold at $t$ to be able to pay for $h(S_T)$ at $T$, and because $S_t$ and $B_t$ evolve through time so must their holdings. Therefore we should be continuously rebalancing our holding of stocks and bonds &lt;em&gt;but the purchase of additional stocks (bonds) must always be financed by the sale of bonds (stocks), without any injection or subtraction of cash&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, please note that equation $(2)$ &lt;strong&gt;&lt;em&gt;defines a replicating, self-financing portfolio&lt;/em&gt;&lt;/strong&gt;, but we always need to &lt;strong&gt;&lt;em&gt;ensure condition $(1)$ is fulfilled&lt;/em&gt;&lt;/strong&gt;: in other words, not only should we posit equation $(2)$, but we also have to make sure that $w_S(t)$ and $w_B(t)$ are chosen in such a way that $(1)$ is verified. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recommend taking a look at exercise 4.10, &quot;&lt;strong&gt;Self-financing trading&lt;/strong&gt;&quot;, in Shreve's &lt;em&gt;Stochastic Calculus for Finance II&lt;/em&gt;, where discrete time and continuous time cases are discussed and connected.&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-06-07T13:45:52.230" LastActivityDate="2017-06-07T13:45:52.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34583" PostTypeId="2" ParentId="34577" CreationDate="2017-06-07T15:16:39.817" Score="8" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ubdtK.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ubdtK.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This pic and many more interesting insights about the connection can be found here: &lt;br&gt; &lt;a href=&quot;https://www.quora.com/Why-do-trading-firms-recruit-poker-players&quot; rel=&quot;noreferrer&quot;&gt;https://www.quora.com/Why-do-trading-firms-recruit-poker-players&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2017-06-07T15:16:39.817" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34584" PostTypeId="1" CreationDate="2017-06-07T17:30:40.280" Score="0" ViewCount="497" Body="&lt;p&gt;Google Finance API seems to be down forever. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there instructions or manuals for downloading intraday stock data into CSV files from Interactive Broker OR Yahoo Finance? &lt;/p&gt;&#xA;" OwnerUserId="25307" LastActivityDate="2019-03-06T21:01:15.267" Title="How can I export intraday stock data into CSV from Interactive Broker or Yahoo Finance?" Tags="&lt;programming&gt;&lt;historical-data&gt;&lt;interactive-brokers&gt;&lt;intraday&gt;&lt;yahoofinance&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34585" PostTypeId="1" AcceptedAnswerId="34587" CreationDate="2017-06-07T20:24:09.963" Score="4" ViewCount="158" Body="&lt;p&gt;In Rockafellar and Uryasev's Paper about &lt;a href=&quot;http://www.ise.ufl.edu/uryasev/files/2011/11/CVaR1_JOR.pdf&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;CVaR Optimisation&quot;&gt;CVaR Optimisation&lt;/a&gt; they showed in Equation (17) that using Monte-Carlo-Simulation one can use $$\tilde F_{\beta}(x,\alpha)=\alpha+\frac{1}{q(1-\beta)}\sum_{k=1}^qmax(-x^Ty_k-\alpha,0)$$ to approximate the CVaR approximation, where $\alpha$ denotes the percentile of $\beta-$CVaR, $x\in\Bbb R^n$ the portfolio and $y_k$ the return in k-th scenario. In the following paragraph he introduced some auxiliary real variable $u_k$ for $k=1,...,r$ and claim it is equivalent to minimising the linear expression $$\alpha+\frac{1}{q(1-\beta)}\sum_{k=1}^qu_k$$ subject to $u_k\geq0$ and $x^Ty_k+\alpha+u_k\geq0$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Why is the indices of $u_k$ running from 1 to r and not to q?&lt;/li&gt;&#xA;&lt;li&gt;Why are the both problem equivalent? I can rewrite the last condition in the  second problem as $u_k\geq-x^Ty_k-\alpha$ and together with $u_k\geq0$&#xA;I am allowing $-x^Ty_k-\alpha\leq0$ in the sum, which has value 0 in the first problem with $max(-x^Ty_k-\alpha,0)$ in the summand.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="25867" LastActivityDate="2017-06-07T21:15:20.363" Title="Question on Rockafellar's Paper for optimisation of CVaR" Tags="&lt;risk-management&gt;&lt;optimization&gt;&lt;cvar&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34587" PostTypeId="2" ParentId="34585" CreationDate="2017-06-07T21:15:20.363" Score="5" Body="&lt;p&gt;On 1, I suspect that is a typo and that the second formula should sum to r. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On 2, that is applying well-known techniques in how to handle piece-wise linear functions in an optimizer. For instance, see page 4 of these &lt;a href=&quot;http://www.seas.ucla.edu/~vandenbe/ee236a/lectures/pwl.pdf&quot; rel=&quot;noreferrer&quot; title=&quot;lecture notes&quot;&gt;lecture notes&lt;/a&gt;. It's basically doing the same thing with a few additional complications. In CVaR optimization, there are more things to sum and also $\alpha$ is also part of the optimization (following the optimization, $\alpha$ should equal the Value-at-Risk).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, there's an issue with your math: $-x^Ty_k-\alpha\leq0$ only follows if $u_k$ is always $0$. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2017-06-07T21:15:20.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34590" PostTypeId="2" ParentId="34570" CreationDate="2017-06-08T01:53:23.853" Score="1" Body="&lt;p&gt;A callable bond can be called at specified dates; if the company decides to call it they will pay you a specified Call Price. The call prices are not necessarily equal to par (100) they may be 100+X and if so we refer to it as &quot;non-par&quot; call. The bond contract contains a schedule of these Call Dates and Call prices. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously the possibility of a call has a major impact on the evaluation of a security. The best way to analyze this is to consider that the ability to call is an Option which the company has bought and which the investor has sold. The value of the bond is lower than the value of a non-callable bond (and the yield is higher) because of this. Given a mathematical model of interest rates the exact value of this option can be calculated and the OAS or Option Adjusted Spread can be found that takes the value of this option into account.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A simpler method is to compare the yield of this bond to the yield of other similar bonds. I am not a Muni expert but I believe the most common call arrangement for Munis is &quot;callable after 10 years at Par&quot;. Most of the bonds included in the MMD index are presumably of this type. If you had an index of non-par callable bonds, it would be preferable since it would consist of bonds that are more comparable to the bond you are analyzing.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-06-08T01:53:23.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34593" PostTypeId="1" AcceptedAnswerId="34595" CreationDate="2017-06-08T09:15:35.443" Score="2" ViewCount="94" Body="&lt;p&gt;Suppose the evolution of the stock price is given by Geometric Brownian Motion. Futher I assume that the risk free rate process is given by CIR model. In both models there is a time increment &lt;em&gt;dt&lt;/em&gt;. To my understanding &lt;em&gt;dt&lt;/em&gt; is dependent on day count convention. There are 252 bussiness days in one year. For rates one should take into account their day count conventions e.g. Act/Act, Actual/360 and so on. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do people deal with this issues in real world applications?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="26188" LastActivityDate="2017-06-08T09:33:27.560" Title="Day counts and time increment in Monte Carlo" Tags="&lt;monte-carlo&gt;&lt;daycounting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34595" PostTypeId="2" ParentId="34593" CreationDate="2017-06-08T09:33:27.560" Score="3" Body="&lt;p&gt;Day count conventions such as Act/Act or Act/360 are used for bond math, e.g. interest accrual calculation. The $dt$ in your Monte Carlo simulation is just model time increment and is unrelated to day count conventions. If $T$ is your time horizon for the simulation and you want a uniformly spaced time line $\{t_k\}$ with $N$ time points simply set $dt = T/N$. If you need to add specific dates (e.g. option exercice dates) to your time line just do so and make sure you use the correct time increment $t_{k+1}-t_k$ when simulating from time $t_k$ to $t_{k+1}$. &lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2017-06-08T09:33:27.560" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34596" PostTypeId="2" ParentId="2260" CreationDate="2017-06-08T10:07:54.537" Score="0" Body="&lt;p&gt;If you assume that your capital $C$ can be described as a Geometric Brownian Motion (GBM) with annualized drift $\mu$ and annualized standard deviation $\sigma$, then a correct way to calculate Sharpe Ratio ($\frac{\mu}{\sigma}$, disregarding risk free rate) would be as follows:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Calculate daily log returns: &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;$$\log(C_{t+1}) - \log(C_{t})$$&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;&lt;p&gt;Find mean ($\bar{\mu}$) and standard deviation ($\bar{\sigma}$) of the daily log returns&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Calculate Sharpe: &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\mu}{\sigma} = \left(\frac{\bar{\mu}}{\bar{\sigma}} + 0.5 \bar{\sigma}\right) \times \sqrt{DaysPerYear}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason to add $0.5 \bar{\sigma}$ to the log return-based ratio can be explained via Ito's lemma: logarithm of a GBM has annualized expectation of $\mu - 0.5\sigma^2$.&lt;/p&gt;&#xA;" OwnerUserId="28287" LastEditorUserId="26595" LastEditDate="2017-06-08T10:33:23.277" LastActivityDate="2017-06-08T10:33:23.277" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34597" PostTypeId="1" CreationDate="2017-06-08T10:48:58.177" Score="13" ViewCount="505" Body="&lt;p&gt;In 2001 R.Cont stated in &lt;a href=&quot;http://www.tandfonline.com/doi/abs/10.1080/713665670&quot; rel=&quot;noreferrer&quot;&gt;&quot;Empirical properties of asset returns: stylized facts&#xA;and statistical issues&quot;&lt;/a&gt; article a set of stylized statistical facts which are common to a wide set of financial assets. The set was later reproduced  with minor changes in &lt;a href=&quot;http://onlinelibrary.wiley.com/book/10.1002/9780470061602&quot; rel=&quot;noreferrer&quot;&gt;&quot;Encyclopedia of Quantitative Finance&quot;&lt;/a&gt; in 2010.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the set:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Absence of autocorrelations&lt;/li&gt;&#xA;&lt;li&gt;Heavy tails&lt;/li&gt;&#xA;&lt;li&gt;Gain/Loss assymetry&lt;/li&gt;&#xA;&lt;li&gt;Aggregational Gaussianity (later renamed to &quot;Aggregational normality&quot;)&lt;/li&gt;&#xA;&lt;li&gt;Intermittency (later excluded from the set)&lt;/li&gt;&#xA;&lt;li&gt;Volatility clustering &lt;/li&gt;&#xA;&lt;li&gt;Conditional heavy tails &lt;/li&gt;&#xA;&lt;li&gt;Slow decay of autocorrelation in absolute returns&lt;/li&gt;&#xA;&lt;li&gt;Leverage effect&lt;/li&gt;&#xA;&lt;li&gt;Volume/volatility correlation&lt;/li&gt;&#xA;&lt;li&gt;Assymetry in time scales&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Have any new candidates into the stylized facts set been discovered since then? &lt;/p&gt;&#xA;" OwnerUserId="15154" LastActivityDate="2019-07-15T10:44:44.193" Title="Have any new stylized facts of asset returns been discovered since 2001?" Tags="&lt;stylized-facts&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="34598" PostTypeId="1" CreationDate="2017-06-08T10:56:43.433" Score="1" ViewCount="158" Body="&lt;p&gt;I have a GARCH model fitted on stock returns as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;spec=ugarchspec(variance.model=list(model=&quot;eGARCH&quot;, garchOrder=c(1,1)),&#xA;                mean.model=list(armaOrder=c(2,4), include.mean=TRUE), distribution.model=&quot;sstd&quot;,&#xA;                fixed.pars=list(mu=-0.0005079, ar1= -0.8562921,ar2=-0.9857075, ma1=0.8959524,ma2=0.9844128,ma3=0.0007078,&#xA;                                ma4=-0.0387716,omega=-0.0520487, alpha1=-0.0070554, beta1=0.9928413,gamma1=0.1154331,&#xA;                                shape=8.2996960,skew=2))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I have also filled a copula on two stocks (residuals from the GARCH) from which I simulate innovations with the copula dependence structure. I now want to use the innovations to feed in the GARCH model. Rugarch docs shows that I can do it with the &lt;code&gt;ugarchspec&lt;/code&gt; method using the &lt;code&gt;custom.dist&lt;/code&gt; option as shown&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;path1 &amp;lt;- ugarchpath(spec, n.sim=2800, n.start=1, m.sim=1, custom.dist = list(name=sim_4))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am inputting &lt;code&gt;sim_4&lt;/code&gt; as a vector of innovations and getting the error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;path1 &amp;lt;- ugarchpath(spec, n.sim=2800, n.start=1, m.sim=1, custom.dist = list(name=sim_4))&#xA;Error in if (is.na(custom.dist$name) | is.na(custom.dist$distfit)[1]) { : &#xA;  missing value where TRUE/FALSE needed&#xA;In addition: Warning messages:&#xA;1: In is.na(custom.dist$distfit) :&#xA;  is.na() applied to non-(list or vector) of type 'NULL'&#xA;2: In if (is.na(custom.dist$name) | is.na(custom.dist$distfit)[1]) { :&#xA;  the condition has length &amp;gt; 1 and only the first element will be used&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I am using the &lt;code&gt;rugarch&lt;/code&gt; library... anyone can help?&lt;/p&gt;&#xA;" OwnerUserId="28289" LastEditorUserId="26595" LastEditDate="2017-06-08T14:01:48.720" LastActivityDate="2017-06-08T14:01:48.720" Title="simulating from GARCH model with copula innovations" Tags="&lt;garch&gt;&lt;copula&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34599" PostTypeId="1" CreationDate="2017-06-08T11:01:21.267" Score="2" ViewCount="210" Body="&lt;p&gt;I want to optimise a static portfolio with a holding period of 90 days given 10 tradable assets. The assets are quoted in bid and ask prices. I want to minimise the risk measured by standard deviation given a certain level of expected return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My Idea:&lt;/strong&gt; I treat the bid-ask- prices as two separate assets. Therefore I will have 20 assets and using $$&#xA;        \begin{pmatrix}&#xA;        x_1^+\\&#xA;        x_1^-\\&#xA;        x_2^+ \\&#xA;        x_2^- \\&#xA;        .\\&#xA;        .\\&#xA;        \end{pmatrix}=\begin{pmatrix}&#xA;        x^+\\&#xA;        x^-\\&#xA;        \end{pmatrix}&#xA;$$ I can denote the portfolio with $x^+$ for long position and $x^-$ for short with the constraint $x^+\geq0$  and $x^-\geq0$. The total position is thus equivalent to $x^+-x^-$. Based on the 10 assets, treating short and long separately, I can calculate the mean and the covariance of the return in 90 days based on the data. This will gives me a 20x1 mean vector $\mu=\begin{pmatrix}&#xA;        \mu^+\\&#xA;        \mu^-\\&#xA;        \end{pmatrix}$&#xA;and a 20x20 covariance matrix $\Sigma$. Then the optimisation problem can be written as:&#xA;$$\text{minimalise} \begin{pmatrix}&#xA;        x^+\\&#xA;        x^-\\&#xA;        \end{pmatrix}^T\Sigma \begin{pmatrix}&#xA;        x^+\\&#xA;        x^-\\&#xA;        \end{pmatrix} \\\text{subject to: } x^+S_0^+-x^-S_0^-\leq w\\\begin{pmatrix}&#xA;        x^+\\&#xA;        x^-\\&#xA;        \end{pmatrix}^T\ \begin{pmatrix}&#xA;        \mu^+\\&#xA;        \mu^-\\&#xA;        \end{pmatrix}=r\\x^+\geq0\\x^-\geq0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, $w$ is the initial budget for constructing a portfolio and $S_0^+$ bid price and $S_0^-$ the ask price of the asset at the beginning of the holding period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Questions:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Does this model make sense? I have tried to fix the nonlinearity of transaction cost by restricting $x^+\geq0$ $x^-\geq0$ and treat them separately. Is the reformulated problem indeed a linear convex problem?&lt;/li&gt;&#xA;&lt;li&gt;In the covariance matrix, I am also considering the covariance of the return in long position of an asset with itself's short position. Could this be a problem?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="25867" LastEditorUserId="24222" LastEditDate="2017-06-08T12:07:06.987" LastActivityDate="2017-06-08T12:07:06.987" Title="Optimisation problem with bid-ask spread" Tags="&lt;optimization&gt;&lt;portfolio-optimization&gt;&lt;markowitz&gt;" AnswerCount="0" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="34600" PostTypeId="1" CreationDate="2017-06-08T14:07:32.460" Score="2" ViewCount="856" Body="&lt;p&gt;I am using the &lt;code&gt;fGARCh&lt;/code&gt; package in R to analyze volatility of stock returns. More precisely I am using a &lt;code&gt;garch(1, 1)&lt;/code&gt; fit. The code looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GARCH11&amp;lt;-garchFit(formula = ~garch(1, 1), data = Returns.zoo, trace = FALSE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Returns.zoo&lt;/code&gt; is my time series. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I know the interpretation of GARCH@h.t and GARCH@sigma.t.&#xA;But what does GARCH@fitted tell me in relation to the time series and why is the value equal at all times?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would be very relieved if someone could enlighten me. Thanks very much!&lt;/p&gt;&#xA;" OwnerUserId="28294" LastEditorUserId="26595" LastEditDate="2017-06-08T14:42:20.200" LastActivityDate="2017-06-08T20:14:22.017" Title="R fGARCH fitted Values" Tags="&lt;programming&gt;&lt;garch&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34602" PostTypeId="1" AcceptedAnswerId="34621" CreationDate="2017-06-08T15:12:51.447" Score="2" ViewCount="1653" Body="&lt;p&gt;I am very new to the world of finance (a statistician) and I would like to run time series regressions for 3 and 5-factor Fama-French model in R but before I do that, I am very puzzled about obtaining the actual data:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;If I use quantmod, from my understanding I get the following variables on let's say some top performers in NDXT, let's say GOOG, CSCO, KLAC, ADSK, AKAM: so for each day, I'd get: High ,Low, Close, Volume, Adjusted (and I'm still having a hard time grasping what those concepts mean in terms of a bigger picture of finance)&lt;/li&gt;&#xA;&lt;li&gt;From these variables, or whatever variables I can possibly get through quantmod (given they only provide the publicly available data from Google Finance, Yahoo, Fred, and Oanda), how do I calculate SMB and HML for NDXT? From Fama and French website, &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;SMB = 1/3 (Small Value + Small Neutral + Small Growth)&#xA; - 1/3 (Big Value + Big Neutral + Big Growth).   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and:&lt;br&gt;&#xA;    HML = 1/2 (Small Value + Big Value)&#xA; - 1/2 (Small Growth + Big Growth).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, using the data I can obtain via quantmod, how do I calculate:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Small Value, Small Neutral, Small Growth&lt;/li&gt;&#xA;&lt;li&gt;Big Value, Big Neutral, Big Growth    &lt;/li&gt;&#xA;&lt;li&gt;the average return on the two growth portfolios&lt;/li&gt;&#xA;&lt;li&gt;the average return on the two growth portfolios&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;and to begin with, how do I find the two growth portfolios?&#xA;Or it is already calculated somewhere on Fama and French website for NDXT and I'm just not looking at the right data files?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think my confusion got even further after I read this response &lt;a href=&quot;https://quant.stackexchange.com/questions/15441/how-to-get-real-time-data-for-fama-french-model&quot;&gt;How to get real-time data for Fama-French model?&lt;/a&gt; on Stack Exchange:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Basically, what they do is divide the world up a grid of 5x5 portfolios: size on one axis, value on the other. If you have access to market cap and B/E you could follow their procedure that they outline. Hence, these factors are themselves average returns, so their calculation is dependent on the stocks you choose to input. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="28252" LastActivityDate="2017-06-09T07:58:48.260" Title="Obtaining the Data and Calculating the actual Fama-French Factors for top NDXT companies" Tags="&lt;factor-models&gt;&lt;fama-french&gt;&lt;nasdaq&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34604" PostTypeId="2" ParentId="32907" CreationDate="2017-06-08T17:01:22.297" Score="2" Body="&lt;p&gt;You are correct in that the series is not stationary.  The ADF test isn't designed to test for stationarity outside the center of location.  You are not going to be able to use the square root rule to extrapolate because you have significant autocorrelation of the variances.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do have a suggestion on your problem by noting that returns are not data.  Prices are data, but returns are transformations of data.  The log return is an even greater transformation of the raw data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's start with a simple AR(1) process of prices $p_{t+1}=Rp_t+\epsilon_{t+1}$, where R is implicitly a return and, for simplicity, $\epsilon_{t+1}\sim\mathcal{N}(0,\sigma_{t+1})$ and $\epsilon_{t}\perp\epsilon_{t+\Delta{t}}$.  From Mann and Wald, we know that the OLS estimator is the MLE estimator of $R$ for any distribution of the error term.  From White, we know that the &lt;em&gt;sampling distribution&lt;/em&gt; of the OLS estimator for $R$ is the Cauchy distribution.  Since the Cauchy distribution has no mean, this is the same thing as saying no non-Bayesian solution exists that is also consistent with the thinking behind mean-variance finance.  If, on the other hand, returns are defined as $r_t=\frac{p_{t+1}}{p_t}$ and both $p_t$ and $p_{t+1}$ are independent normal random variables then $r_t$ would have a Cauchy distribution.  The log version of this would be the hyperbolic secant distribution which does have a mean and a variance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's further assume that prices are locally a function of liquidity and globally a function of discounted cash flows.  This makes liquidity a fast function and cash flow a slow function.  Although this implies that returns should be a function of liquidity through prices, liquidity itself has two components, the global interest rate and the local adjustment for market-maker specific liquidity needs.  The discounting of cash flows shares the global rate.  In a separate paper, I argue that the distribution of liquidity is normal or log-normal depending on the model you are using.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The short-run effect is that returns should be centered on the discounted cash flows from dividends, but that the variance of log-returns should be focused on the short-run liquidity.  Although liquidity should have a slight effect on the center of location, that should appear in the regression constant because of the form you are using.  The variability of prices, which is what the bid-ask spread is, is a short-run process.  As liquidity is not idiosyncratic within institutions, but rather a systematic issue, you have to expect serial correlation among the terms.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The number of lags should reflect how long it takes firms to change their overall liquidity levels.  This depends on both internal factors, such as margin credit and so forth, and the short-run external popularity of a particular issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In looking at the serial correlation of returns you are implying momentum in prices.  This implies that prices do not adjust instantaneously, otherwise, there would be no information in historical returns. You should look at both the bid-ask spread and interest rates.  I would argue that you have a misspecified model and that there is no fix except to match it to time series of short-term interest rates and the bid-ask spread.  You may want to look as Abbott's model of marketability and liquidity in &lt;em&gt;The Valuation Handbook&lt;/em&gt;.  You should also grab an article on the summation of variables drawn from the hyperbolic secant distribution as that is essentially what the right-hand side of the regression formula is.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2017-06-08T17:01:22.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34605" PostTypeId="1" CreationDate="2017-06-08T18:36:01.867" Score="0" ViewCount="2135" Body="&lt;p&gt;I'm trying to build a database of historical stock EOD price data with no survivorship bias, primarily from the S&amp;amp;P 500.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have looked through numerous data sources from this website to create a database &lt;a href=&quot;https://quantpedia.com/Links/HistoricalData&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://quantpedia.com/Links/HistoricalData&lt;/a&gt; including&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;quandl&lt;/li&gt;&#xA;&lt;li&gt;CRSP&lt;/li&gt;&#xA;&lt;li&gt;Wharton&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The issue is all of these services are premium, meaning you have to pay for them. I would have used yahoo finance's API but they recently discontinued it. Does someone know of a free alternative where I can get individual stock EOD historical price data to build my database?&lt;/p&gt;&#xA;" OwnerUserId="28297" LastEditorUserId="24222" LastEditDate="2017-06-08T19:45:57.700" LastActivityDate="2019-03-11T12:09:49.520" Title="Looking for free historical EOD prices of stocks from S&amp;P 500" Tags="&lt;data&gt;&lt;quant-trading-strategies&gt;&lt;historical-data&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34608" PostTypeId="2" ParentId="34577" CreationDate="2017-06-08T19:01:17.970" Score="3" Body="&lt;p&gt;To answer this question Aaron Brown wrote a book. With a foreword by Nassim Taleb. In Taleb's words:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The revelation was that poker differs greatly from the random walk-hence, one could learn from it; furthermore, it may be the sole venue for us to learn about randomness. How? Simply, it has other hidden higher layers of uncertainty-many of them. It has suckers, people who invite you to take advantage of them. It also has people for whom you are the sucker (of course, without your being aware of it). You are not flipping a coin and moving left or right. You are not betting against a large machine like a roulette wheel. You are not engaging in a blind draw. You are playing against other humans. You cannot easily control their maximum bet. Your betting policy matters far more than the probability of getting a given card. You can bluff your way, confuse other players, win in spite of a bad hand, or lose in spite of an unlikely good one. Not least, bets can escalate.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The above could be said about trading ...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/cJvbz.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/cJvbz.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the &lt;a href=&quot;http://eu.wiley.com/WileyCDA/WileyTitle/productCd-0470127317.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;link&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Aaron Brown used to be an executive director at Morgan Stanley and a serious lifelong poker player who has played with Wall Street tycoons and world champion poker pros. &lt;/p&gt;&#xA;" OwnerUserId="15154" LastEditorUserId="15154" LastEditDate="2017-06-09T18:44:12.717" LastActivityDate="2017-06-09T18:44:12.717" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34610" PostTypeId="2" ParentId="34605" CreationDate="2017-06-08T19:46:57.870" Score="0" Body="&lt;p&gt;The Yahoo API still works, they just slightly altered it. I'd suggest you try the &lt;code&gt;quantmod&lt;/code&gt; package (if you're using &lt;code&gt;R&lt;/code&gt;) - the authors already adjusted it to the changes in the API.&lt;br&gt;&#xA;Here's a small example for the &quot;Danone&quot; stock from 2010 to 2017.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# install.packages(&quot;quantmod&quot;)&#xA;library(quantmod)&#xA;getSymbols(&quot;BN.PA&quot;,auto.assign=F,from=&quot;2010-01-01&quot;,to=&quot;2017-01-01&quot;)&#xA;# An ‘xts’ object on 2010-01-04/2016-12-30 containing:&#xA;#   Data: num [1:1790, 1:6] 42.7 43.1 42.8 42.7 42.9 ...&#xA;# - attr(*, &quot;dimnames&quot;)=List of 2&#xA;# ..$ : NULL&#xA;# ..$ : chr [1:6] &quot;BN.PA.Open&quot; &quot;BN.PA.High&quot; &quot;BN.PA.Low&quot; &quot;BN.PA.Close&quot; ...&#xA;# Indexed by objects of class: [Date] TZ: UTC&#xA;# xts Attributes:  &#xA;#   List of 2&#xA;# $ src    : chr &quot;yahoo&quot;&#xA;# $ updated: POSIXct[1:1], format: &quot;2017-06-08 21:45:57&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="26503" LastActivityDate="2017-06-08T19:46:57.870" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34612" PostTypeId="2" ParentId="34600" CreationDate="2017-06-08T20:14:22.017" Score="3" Body="&lt;p&gt;When fitting a volatility model, you have two series - one describing the actual data and one the data's volatility.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your code, the volatility part is modelled by a GARCH(1,1) model, while the data is simply modelled with a constant term, which is included by default. Hence, your &quot;fitted&quot; model is just a constant term and &lt;code&gt;GARCH1@fitted&lt;/code&gt; provides a constant value, which is equal to the mean coefficient &lt;code&gt;mu&lt;/code&gt;.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you additionally want to model the data series, you can add an ARMA model to your specification:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GARCH11&amp;lt;-garchFit(formula = ~arma(1,1)+garch(1, 1), data = Returns.zoo, trace = FALSE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then, the &lt;code&gt;@fitted&lt;/code&gt; output will be time-varying, following an ARMA(1,1) process. As you said that you model stock returns, using an ARMA model probably isn't necessary, though.&lt;/p&gt;&#xA;" OwnerUserId="26503" LastActivityDate="2017-06-08T20:14:22.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34613" PostTypeId="1" CreationDate="2017-06-08T20:43:02.583" Score="1" ViewCount="61" Body="&lt;p&gt;I have a pay-off function for a derivative which is defined by the Heaviside difference between $G$ and $B$ shifted by $-F$. To find the value of $V_{t=0}$, I need to find $\tau$ when $\frac{dV}{dt} = 0$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I start by setting up as a classic diffusion argument for the expected value of $\frac{dV}{dt}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb{E}\left[\frac{dV}{dt}\right] = \max{(-F,\, G_t -B_t-F)} \approx \mathbb{H}\left(G_t - B_t\right) - F = \mathbb{E}\left[G_t\right]^+ - \mathbb{E}\left[B_t\right]^- -F$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\mathbb{H}$ is the Heaviside step function: $f(\frac{dV}{dt}, \,\tau) =0 \quad \forall \; G_t &amp;lt; B_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume $G_t$ and $B_t$ are both drifting proccess with drift $= -d$; $G_t$ is a $\mathbb{P}$ Brownian Motion (i.e, Wiener process) with variance $= \sigma^2$. Therefore, we can set up set up the diffusion process as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb{E}\left[\frac{dV}{dt}\right] =\varPhi\left(\frac{\log{\left(\frac{G}{B}\right)}+\frac{\sigma ^2 \tau }{2}}{\sigma  \sqrt{\tau}}\right)G e^{-d \tau } - \varPhi\left(\frac{\log{\left(\frac{G}{B}\right)}-\frac{\sigma ^2 \tau }{2}}{\sigma  \sqrt{\tau}}\right)B e^{-d \tau } - F $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb{E}\left[\frac{dV}{dt}\right] = 0 \to \frac{e^{-d \tau}}{\sqrt{2 \pi}} \left[G\left(\int_{-\infty }^{\frac{\log&#xA;   \left(\frac{G}{B}\right)+\frac{\sigma ^2 \tau }{2}}{\sigma  \sqrt{\tau }}} e^{-\frac{Z^2}{2}} \,&#xA;   dZ\right)-{B \left(\int_{-\infty }^{\frac{\log&#xA;   \left(\frac{G}{B}\right)-\frac{\sigma ^2 \tau }{2}}{\sigma  \sqrt{\tau }}} e^{-\frac{Z^2}{2}} \,&#xA;   dZ\right)}\right]  = F$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\varPhi(X)$ is the CDF of the standard normal (Gaussian) distribution for i.i.d. $X_i$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can solve for the roots of  $\frac{dV}{dt}$ graphically and/or recursively, but I require an analytical and/or closed-form approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I find $\tau$ when $\frac{dV}{dt} = 0$?&lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2017-06-09T00:56:44.770" LastActivityDate="2017-06-09T00:56:44.770" Title="Solving for roots of a stochastic pay-off function" Tags="&lt;stochastic-processes&gt;&lt;brownian-motion&gt;&lt;derivatives&gt;&lt;probability&gt;&lt;wienerprocess&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34614" PostTypeId="1" CreationDate="2017-06-08T21:43:15.993" Score="1" ViewCount="197" Body="&lt;p&gt;What determines trading volumes of the same stock at different trading venues (exchanges/ECNs/dark pools)? It seems that they vary significantly.&lt;/p&gt;&#xA;" OwnerUserId="28054" LastEditorUserId="2299" LastEditDate="2017-06-10T15:20:08.810" LastActivityDate="2017-06-10T15:20:08.810" Title="What determines trading volumes of the same stock at different trading platforms?" Tags="&lt;equities&gt;&lt;trading&gt;&lt;automated-trading&gt;&lt;market-microstructure&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34615" PostTypeId="1" CreationDate="2017-06-08T22:03:23.723" Score="4" ViewCount="1970" Body="&lt;p&gt;I'm wondering if i should use a floating IV or a fixed IV to delta hedge my options every day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've read this post but would like different information :&#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/21419/delta-hedging-with-fixed-implied-volatility-or-floating-implied-volatility&quot;&gt;Delta Hedging with fixed Implied Volatility or floating Implied Volatility?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a view on future realized volatility for an option $\sigma_{e}$ (e for expected).&lt;br&gt;&#xA;When i look at an option, if its implied volatility $\sigma_{i0}$ is lower than $\sigma_{e}$ then i want to buy the option and delta hedge at a certain frequency (daily for example).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've always delta hedged using a floating IV which is changing daily but i realized this may not best thing to do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we decompose the variation of a PNL between 2 hedging periods we have :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;dPNL = \vartheta * d\sigma + \theta*dt + 0.5 * dS^2*\Gamma &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've considered as well known that the daily PNL of a delta hedged between option is given by :&lt;br&gt;&#xA;$$&#xA;dPNL = 0.5 *(\sigma_{i}^2-RV^2)\Gamma * S * dt&#xA;$$&#xA;with $RV$ = realized volatility = $ ds/S $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My concern with this is that i have the feeling that we are only looking at $\Gamma$ and $\theta$ influences in the case we are delta hedging using floating IV every day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at this formula, PNL at maturity should not be IV path dependant, however running simulations i get to very different PNL at maturity using a floating IV. So is this formula only true when using a fixed IV to hedge daily ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My intuition is the following :&lt;br&gt;&#xA;&lt;em&gt;If we want to get rid of the vega effect then we need to replicate the same option with a constant IV so that the vega does not have any effect on PNL.&lt;/em&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;But does this mean that we can use any IV to hedge the option ?&lt;br&gt;&#xA;This makes no sense to me  ?&lt;br&gt;&#xA;I would like to have a mathematical proof of this coming from the Greek PNL decomposition above if possible ?&lt;br&gt;&#xA;What IV should i use in my situation ?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="28302" LastEditorUserId="24222" LastEditDate="2017-06-08T22:30:26.147" LastActivityDate="2017-06-09T12:04:23.077" Title="Delta Hedging with fixed Implied Volatility to get rid of vega?" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;derivatives&gt;&lt;greeks&gt;&lt;delta-hedging&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="34617" PostTypeId="1" AcceptedAnswerId="34623" CreationDate="2017-06-08T23:39:37.217" Score="3" ViewCount="230" Body="&lt;p&gt;I have the following settings:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The allowed traded assets consists of 1 bank account, 1 non dividend paying stock and 19 call options whose maturity is in 30 days. I want to find an optimal static portfolio with holding period of 30 days. The current stock price is 150 USD and the 19 call options has strike price from 115 USD in 5 USD steps (i.e. 115, 120, 125 ....)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The minimization problem is thus:$$\text{minimize: }x^T\Sigma x\\\text{subject to: }\mu^T x=r\\x^TS\le w$$, where the second is the budget constraint and the first is the expected return being equal to $r$. $S$ is the price vector consists of prices of the 21 available assets at the beginning of holding period (1 bank account, 1 stock, 19 calls). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have determined the covariance matrix $\Sigma$ and $\mu$ using Monte Carlo method. To be more specific, I assume that the stock price follows a geometric Brownian motion and generated a great deal of sample paths. Using those paths, I was also able to simulate the payoffs of the option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; Normally I would solve this problem using the &lt;code&gt;quadprog&lt;/code&gt; in MATLAB, which uses interior points method. However the covariance matrix $\Sigma$ is in this case ill-conditioned since the call options and the stock are driven by the same Brownian motion. (I have a correlation matrix with nearly all entries are in the range of 0.8 to 1 and the conditional number of the covariance matrix is in the order of $10^6$.) Can I still trust the result from MATLAB? How can I handle the ill-conditionedness? Will rescaling or preconditioning help?&lt;/p&gt;&#xA;" OwnerUserId="25867" LastEditorUserId="24222" LastEditDate="2017-06-09T12:01:01.963" LastActivityDate="2017-06-14T08:36:12.993" Title="Optimisation with strong correlated Assets" Tags="&lt;modern-portfolio-theory&gt;&lt;optimization&gt;&lt;portfolio-optimization&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34618" PostTypeId="2" ParentId="34614" CreationDate="2017-06-08T23:42:17.433" Score="-2" Body="&lt;p&gt;Here are a few of factors:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The listing exchange for the stock usually receives a large market share, e.g. tech stocks on Nasdaq, etfs on Arca.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Amount of liquidity available, which itself is correlated with the rebate size.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Various IEX-style gimmicks like &quot;we are the investors exchange&quot;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2017-06-08T23:42:17.433" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="34619" PostTypeId="2" ParentId="34615" CreationDate="2017-06-09T03:41:29.347" Score="1" Body="&lt;p&gt;My intuition is that your expected p/l from delta hedging is the same, regardless of what vol you use at each step (since this just changes your series of spot transactions, each of which has zero expected value).  However if you hedge at a vol much lower than the IV, or a vol which is much higher than the IV, your eventual p/l will be more risky than just using the IV at each step.  Meaning, it will have a wider distribution. For example, using a zero vol to hedge would result in no delta hedging p/l on any day except the days you cross the strike, which is highly path dependent.  I'm not sure how to prove that explicitly.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-06-09T03:41:29.347" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34620" PostTypeId="2" ParentId="34615" CreationDate="2017-06-09T06:22:32.233" Score="5" Body="&lt;p&gt;You should have a look at the following paper:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ahmad, Riaz and Paul Wilmott (2005) &quot;Which free lunch would you like today, Sir? Delta hedging, volatility arbitrage and optimal portfolios,&quot; &lt;em&gt;Wilmott Magazine&lt;/em&gt;, Nov. 2005, pp. 64—79&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which tackles this exact issue.&lt;/p&gt;&#xA;" OwnerUserId="28309" LastEditorUserId="24222" LastEditDate="2017-06-09T12:04:23.077" LastActivityDate="2017-06-09T12:04:23.077" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34621" PostTypeId="2" ParentId="34602" CreationDate="2017-06-09T07:58:48.260" Score="1" Body="&lt;p&gt;I can see that you are mentioning quantmod so you are probably using R, but in python it's quite straightforward to download the FF values through pandas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please see &lt;a href=&quot;https://gist.github.com/schalekamp/1439b03c1a4957aee557#file-factor_analysis-py&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; for a sample implementation and you can find further info about the data downloaded &lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/Data_Library/f-f_factors.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope that helps.&lt;/p&gt;&#xA;" OwnerUserId="22383" LastActivityDate="2017-06-09T07:58:48.260" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34622" PostTypeId="2" ParentId="34580" CreationDate="2017-06-09T08:56:19.707" Score="2" Body="&lt;p&gt;That's a quite interesting problem, a few thoughts on how to attack it:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Calculate the correlation and beta between the benchmark and the fund.&lt;/li&gt;&#xA;&lt;li&gt;If the above imply a link between these two then proceed with the betas' comparison.&lt;/li&gt;&#xA;&lt;li&gt;Regarding the three approaches you mention, the one which subtracts the betas sounds mathematically-speaking wrong since beta is a volatility-based measure.&lt;/li&gt;&#xA;&lt;li&gt;So I would go either for the panel regression or the one where you apply the regression on (rfund−rindex) - probably for the panel regression.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Hope that helps.&lt;/p&gt;&#xA;" OwnerUserId="22383" LastActivityDate="2017-06-09T08:56:19.707" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34623" PostTypeId="2" ParentId="34617" CreationDate="2017-06-09T09:02:58.513" Score="5" Body="&lt;p&gt;This answer will try and outline all the different possibilities I came across over the last couple of years, including drawbacks. But first, let me outline the problem a little.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To appreciate the problem, a first simplistic starting point is &lt;a href=&quot;https://ssrn.com/abstract=2658657&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&#xA;What the authors observe is similar to what you observed. &quot;Optimization is Error-Maximization&quot; is an often cited quote.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Why is that?&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To build some intuition, look at the unconstrained solution of the MV problem. It is proportional to the inverse of the variance Covariance matrix $\Sigma^{-1}$. You see that by setting the first derivative to zero and solving for the weights.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The role of the spectrum of $\Sigma$&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you look at the Eigenvalues of $\Sigma$, the problem occurs when they are close to $0$. That is, because the inverse $\Sigma^{-1}$ has the inverse eigenvalues, which in turn means that upon solving the problems, certain directions are being extremely magnified. Also, these directions are very unstable, meaning that upon updating $\Sigma$ at a later point in time, directions and thus your solution are likely to show big changes over time and the solution is unstable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;==REMEDIES==&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Be aware that all of the following methods will cause a loss of information of some kind. Also, I do not prefer one method over the other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;1. Messing around with the spectrum&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of the more straightforward things: If an Eigenvalue is, say $&amp;lt;10^{-6}$, set it to $10^{-6}$ and recalculate the variance covariance matrix.&#xA;(If $\Sigma = E^{T} \Lambda E$ with Eigenbasis $E$ and spectrum $\Lambda$, you can define $\hat{\lambda}_i = \text{max}(10^{-6},\lambda_i)$ and then calculate $\hat{\Sigma} = E^{T} \hat{\Lambda} E$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Hint: you can force total variance to be the same by rescaling but the difference shouldnt be big). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bear in mind that there are numerous ways you could do this but this is the most straightforward one I think. &#xA;More difficult is the question how small do you accept your eigenvalues to be...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;2. Factor Models&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we can express $N$ asset classes in terms of $F$ factors, this is effectively a dimension reduction. If you drop the idiosyncratic parts and the variance covariance matrix of the factors is stable (usually, the idea of factors is that their correlation is not too high). You would need to reformulate your problem &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;3. Shrinkage Estimation&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In numerics, there is the common trick to &quot;add a diagonal&quot;($\hat{\Sigma} = \Sigma + \lambda \mathbb{1})$ to get the spectrum away from $0$. Now, if we come from statistics the total error of an estimator can be decomposed in a bias plus a variance component. The idea is to reduce the estimation error further by taking a bias (you can actually use an ansatz like metioned above and calculate the $\lambda$ if I remember correctly). Look at &lt;a href=&quot;https://en.wikipedia.org/wiki/Estimation_of_covariance_matrices#Shrinkage_estimation&quot; rel=&quot;nofollow noreferrer&quot;&gt;Shrinkage Estimation&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;4. Expected Return estimation - Black Litterman method&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One finding from employing the &lt;a href=&quot;http://www.blacklitterman.org&quot; rel=&quot;nofollow noreferrer&quot;&gt;BL-method&lt;/a&gt; is that the results are more stable. This is because the expected (prior) returns are calculated via the market weights $w_M$ and the variance-covariance matrix: $\mu \approx \Sigma w_M$. Also, you can see that via the very heuristic argument that if your solution $w \approx \Sigma^{-1} \mu$ and $\mu \approx \Sigma w_m$ then this will be stable, as the idea is that both in a way &quot;cancel out&quot;. I know this is by no means mathematically correct but just to give you a feeling.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am sure the list is by no means complete. Take also a look at &lt;em&gt;robust optimization&lt;/em&gt;. I didnt cover this here.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastEditorUserId="2727" LastEditDate="2017-06-14T08:36:12.993" LastActivityDate="2017-06-14T08:36:12.993" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="34624" PostTypeId="1" CreationDate="2017-06-09T10:18:33.140" Score="2" ViewCount="798" Body="&lt;p&gt;I am using a python script to replicate the monthly UMD factor, disregarding  small caps (ie, focusing only on the &quot;BIG HiPRIOR&quot; and &quot;BIG LoPRIOR&quot; sub-portfolios in prof. French's website).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For that purpose, I am mapping the universe of stocks to the Russell 1000, which has a good fit in terms of market cap cut-off, and downloading data from Bloomberg for the relevant constituents over the 1997-2015 period. I then follow the methodology described in prof. French's website (sort 12-2 returns, take upper and bottom 30%, etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem is as follows: I manage to get a very close replication of the BIG HiPRIOR returns over the whole period. However, using exactly the same methodology and data, I fail to replicate the BIG LoPRIOR one:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/51LrA.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/51LrA.jpg&quot; alt=&quot;model output&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After several days of unsuccessfully trying multiple avenues to explain the discrepancy, it occurred to me that the difference in performance looked like some sort of compounding over time. So I decided to download the risk free rate from prof. French's website to see if it explained the difference. Shockingly, it did almost perfectly - if I add the risk free rate to prof. Frech's LoPrior returns only, then the match becomes just as good as for the HiPrior portfolio:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/sTUMb.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/sTUMb.jpg&quot; alt=&quot;model output vs F-F with risk-free added to loPrior&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the issue: the risk free rate was never part of the original dataset I downloaded from Bloomberg (all I downloaded was individual stock returns for the index constituents over the relevant period). Therefore it is not possible that an error in my code would have introduced that consistent bias over time on one portfolio but not the other. The risk free data simply didn't exist as far as my model is concerned. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So at this point I am completely at a loss to explain this issue. On the one hand, I find it impossible to believe that there'd be an issue with prof. French's rigorous calculations; on the other hand I can't explain how such a precise bias (monthly risk free rate at each point in time over a period of 18 years, affecting only the LoPrior portfolio) could have crept into my model if that data simply did not exist when I ran the model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could I ask, to put me out of my misery, if anyone has gone through a similar exercise and successfully replicated each of the sub-portfolios used in the construction of the UMD factor?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks in advance for any help/clarity anyone could shed on this topic! &lt;/p&gt;&#xA;" OwnerUserId="28312" LastEditorUserId="28312" LastEditDate="2017-06-09T22:20:13.443" LastActivityDate="2017-10-18T17:04:20.897" Title="Fama/French momentum replication: risk-free rate missing on one of the legs?" Tags="&lt;factor-models&gt;&lt;fama-french&gt;" AnswerCount="1" CommentCount="11" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34625" PostTypeId="1" AcceptedAnswerId="34639" CreationDate="2017-06-09T13:24:46.813" Score="6" ViewCount="3432" Body="&lt;p&gt;Is there a consensus on a formula for measuring the market depth of a book at a given point in time? Or a possible proxy for this measurement?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I see so many articles / people discussing market depth but no description on how they calculate it or measure it.&lt;/p&gt;&#xA;" OwnerUserId="27368" LastActivityDate="2017-06-11T08:13:34.837" Title="How to measure market depth?" Tags="&lt;market-microstructure&gt;&lt;market-impact&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34626" PostTypeId="1" AcceptedAnswerId="34628" CreationDate="2017-06-09T14:51:52.083" Score="-1" ViewCount="616" Body="&lt;p&gt;I have three assets and a covariance matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I calculate the correlation of asset X with a portfolio that includes assets Y and Z?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, assume I want to calculate the correlation of high yield bonds to a portfolio that includes 60% equities and 40% U.S. Treasuries.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="28314" LastActivityDate="2017-06-09T18:46:42.513" Title="Correlation of asset X with a portfolio of asset Y and Z" Tags="&lt;correlation&gt;&lt;covariance&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2017-06-12T15:29:56.510" ContentLicense="CC BY-SA 3.0" />
  <row Id="34628" PostTypeId="2" ParentId="34626" CreationDate="2017-06-09T15:28:52.433" Score="2" Body="&lt;p&gt;This is fairly basic but anyway... &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us define:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$X$, $Y$ and $Z$ your assets $-$ without any loss of generality, assume $X$ designates high yield bonds, $Y$ equities and $Z$ US Treasuries $-$ and $P$ your portfolio;&lt;/li&gt;&#xA;&lt;li&gt;$\sigma_X$, $\sigma_Y$ and $\sigma_Z$ their respective standard deviation, and $\sigma_P$ the standard deviation of the portfolio;&lt;/li&gt;&#xA;&lt;li&gt;$\sigma_{X,Y}$, $\sigma_{X,Z}$ and $\sigma_{Y,Z}$ their pairwise covariances;&lt;/li&gt;&#xA;&lt;li&gt;$w$ the proportion of equities in your portfolio $-$ so $60\%$ in your example.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Your portfolio $P$ can be written as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ P = wY+(1-w)Z $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are interested in computing the correlation $\mathbb{Corr}(X,P)$ between your portfolio and high yield bonds. By the properties of &lt;a href=&quot;https://en.wikipedia.org/wiki/Variance&quot; rel=&quot;nofollow noreferrer&quot;&gt;variance&lt;/a&gt; and &lt;a href=&quot;https://en.wikipedia.org/wiki/Covariance&quot; rel=&quot;nofollow noreferrer&quot;&gt;covariance&lt;/a&gt;, we obtain:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;\mathbb{Corr}(X,P) &amp;amp; = \frac{\mathbb{Cov}(X,wY+(1-w)Z)}{\sigma_X\sigma_P}&#xA;\\[9pt]&#xA;&amp;amp; = \frac{w\,\sigma_{X,Y}+(1-w)\sigma_{X,Z}}{\sigma_X\sqrt{(w^2\sigma_Y^2+(1-w)^2\sigma_Z^2+2w(1-w)\sigma_{Y,Z})}}&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your are left with $\sigma_X$, $\sigma_Y$, $\sigma_Z$, $\sigma_{X,Y}$, $\sigma_{X,Z}$ and $\sigma_{Y,Z}$, which are the elements of your variance-covariance matrix, and $w$ which you set yourself.&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-06-09T18:46:42.513" LastActivityDate="2017-06-09T18:46:42.513" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34629" PostTypeId="1" CreationDate="2017-06-09T19:12:10.510" Score="0" ViewCount="62" Body="&lt;p&gt;Simple question, what universally accepted financial ratios involve kurtosis? I'm not looking for a made up one. I want something that academics may have discussed.&lt;/p&gt;&#xA;" OwnerUserId="18578" LastActivityDate="2017-06-10T23:40:38.487" Title="What CAPM/Financial ratios involve kurtosis?" Tags="&lt;statistics&gt;&lt;modern-portfolio-theory&gt;&lt;capm&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34630" PostTypeId="2" ParentId="34624" CreationDate="2017-06-10T00:36:50.693" Score="4" Body="&lt;p&gt;Out of curiosity, I took a quick stab at replicating the Fama-French portfolios using &lt;a href=&quot;http://crsp.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;CRSP data&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;I seem to be getting numbers reasonably close to Fama-French, so I think the issue is on your end.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;It's also possible&lt;/strong&gt; though the difference is due to using the Russell 1000 rather than the full CRSP universe. That doesn't strike me as crazy.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I'm for sure not matching Fama-French methodology exactly. Don't take my numbers etc... as gospel. I did this quickly.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here's my preliminary replication of the equal weight, big size, low prior return portfolio (and comparison to Fama French).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/fM9Ia.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/fM9Ia.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Some ideas:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I'd check your 30th percentile breakpoint vs. Ken French's computed breakpoint. (Note: I used 11 months of prior returns; I think French's computed breakpoints elsewhere on the website use 12 months?) &lt;/li&gt;&#xA;&lt;li&gt;There might be an issue that you don't have companies with horrible, prior returns in the Russel 1000 because if they had horrible prior returns they would leave the index! &#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Corollary: you could be doing everything right, but you'll need the full universe to replicate Fama-French.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;Some excerpts from my stuff:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;These are the breakpoints for the 30th prior return percentile and the 70th prior return percentile for the 11 months of prior returns (i.e. t-12 through t-2... do they use 12?).&#xA;&lt;a href=&quot;http://www.mattgunn.com/share/quantse1/PRELIMINARY_prior_ret_breakpoints.csv&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.mattgunn.com/share/quantse1/PRELIMINARY_prior_ret_breakpoints.csv&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These are the returns I get for the portfolio in question:&#xA;&lt;a href=&quot;http://www.mattgunn.com/share/quantse1/PRELIMINARY_big_lowpriorret.csv&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.mattgunn.com/share/quantse1/PRELIMINARY_big_lowpriorret.csv&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use French's size breakpoints available here:&#xA;&lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html#Breakpoints&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html#Breakpoints&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm using my own computed breakpoints for prior returns (in the link above), but if you're trying to match Fama-French, I'd just use their breakpoints which appear to be available at the above link.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another obvious point that I thought I'd mention is that to compute value weight returns, you want to use the 1 month lagged market cap (eg. February return gets the weight of the end of January market cap). &lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-06-10T02:30:09.390" LastActivityDate="2017-06-10T02:30:09.390" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34634" PostTypeId="2" ParentId="34614" CreationDate="2017-06-10T08:12:20.957" Score="1" Body="&lt;p&gt;First of all a stock will have more volume traded on &lt;strong&gt;the exchange it is primarily listed on&lt;/strong&gt;. This means when you are a company and you want to raise capital using equity, you go to an exchange (Nyse, Nasdaq, Bats in the US; Euronext, LSE, Deutsche Boerse in Europe for instance) and you pay annual fees to it to be open to trading there. You will be regulated by the national authority of this exchange. It is a choice. Usually you try to choose an exchange capable to make some advertising around your business. For instance Nasdaq is said to be good for tech companies (like Euronext in Europe).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They &lt;strong&gt;depending on local rules on competition&lt;/strong&gt; (Reg NMS in the US, MiFID in Europe), other exchanges and trading facilities can offer your shares to trading too. Here you can think about all other places, including dark pools. It is the local regulation that will allow someone to buy one share on the listed exchange or on another without any difference (in Europe we talk about a &quot;passport&quot; for shares, and by the way Brexit will probably prevent UK based trading platforms to keep this passport). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Traders are now into this game: where do they choose to buy or sell shares when their bank, insurance company, asset manager ask them to do so? Simply &lt;strong&gt;where it is the cheapest for them&lt;/strong&gt;. They look at fees, and at the bid and ask prices, plus the post trading costs (clearing, give up, etc). Some of these sources of gain/cost can vary:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;trading facilities change their &lt;strong&gt;fees&lt;/strong&gt; to compete, and to attract &quot;big fishes&quot; (&lt;em&gt;tiering the fee schedules&lt;/em&gt;)&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;market makers&lt;/strong&gt; (banks or high frequency firms) are competing at the first limits (bid and ask) of the books (may be because they have agreement with one trading platforms, may be because they have adequate trading rules on another, etc)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;All this mixes to give the &lt;em&gt;market share&lt;/em&gt; of each venue (ie the fraction of value traded on each platform). Usually there is a monopoly on the opening and fixing auctions, guaranteeing up to 12% of market share to one venue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a rule of thumb I would say: between 30 to 70% to the listing venue, then 2 to 3 venues share all the remaining except 3 to 8% that are highly fragmented across very small venues (like dark pools or broker crossing networks). If you want examples have a look at the fragulator: here for &lt;a href=&quot;http://fragmentation.fidessa.com/fragulator/?fim=MSFT.US&quot; rel=&quot;nofollow noreferrer&quot;&gt;Microsoft&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2017-06-10T08:12:20.957" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34635" PostTypeId="1" AcceptedAnswerId="34649" CreationDate="2017-06-10T10:45:27.360" Score="0" ViewCount="1675" Body="&lt;p&gt;I have a certain problem with backtesting calculated earlier Value at Risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've got calculated daily VaR with historical simulation method for stocks. I've used two values of alpha 0.05 and 0.1. Now, I want to backtest this values with Kupiec test. What alpha should I use for Kupiec test? When I'm using 0.05 alpha for VaR calculated with 0.1, I have to reject null hypothesis for all stocks. Is it normal? Or I should use 0.1 alpha for Kupiec test in this case for comparison between these two models.&lt;/p&gt;&#xA;" OwnerUserId="28325" LastEditorUserId="28325" LastEditDate="2017-06-11T17:04:25.647" LastActivityDate="2017-06-11T17:04:25.647" Title="Backtesting Value at Risk. With kupiec test" Tags="&lt;backtesting&gt;&lt;var&gt;&lt;value-at-risk&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34636" PostTypeId="1" AcceptedAnswerId="34648" CreationDate="2017-06-10T13:12:10.330" Score="1" ViewCount="56" Body="&lt;p&gt;I have smile data which looks like this,&#xA;&lt;a href=&quot;https://i.stack.imgur.com/8MhHn.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/8MhHn.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but after converting the vol points to prices using black's model, i got something like this, &#xA;&lt;a href=&quot;https://i.stack.imgur.com/2vuO7.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/2vuO7.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is this expected?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was expecting the shape of the smile to be retained. What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="15771" LastActivityDate="2017-06-11T09:09:24.083" Title="Shape of smile after converting to prices" Tags="&lt;volatility-smile&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="34637" PostTypeId="2" ParentId="22412" CreationDate="2017-06-10T15:30:07.350" Score="8" Body="&lt;p&gt;The &lt;a href=&quot;https://arxiv.org/abs/1312.0563&quot; rel=&quot;noreferrer&quot;&gt;Queue Reactive Model&lt;/a&gt; (by Huang, L and Rosenbaum) is an improvement of what Cont and de Larrard (CL) did.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This model is capturing&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the inflows and outflows in each queue given the current state of the orderbook (it is one of your remark)&lt;/li&gt;&#xA;&lt;li&gt;but more importantly, once one queue depletes, the discovered quantity is not taken at random (like in the CL model)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I guess it is what you want. The only point is that to implement the full queue reactive you need more than level I. But you can yourself adjust the model to level one. Or you can have a look at the model of this paper:&#xA;&lt;a href=&quot;https://arxiv.org/abs/1610.00261&quot; rel=&quot;noreferrer&quot;&gt;Limit Order Strategic Placement with Adverse Selection Risk and the Role of Latency&lt;/a&gt; it is very close to a level I version of the queue reactive.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="27368" LastEditDate="2017-07-11T12:59:33.827" LastActivityDate="2017-07-11T12:59:33.827" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34638" PostTypeId="2" ParentId="32268" CreationDate="2017-06-10T15:49:54.243" Score="2" Body="&lt;p&gt;I agree with the implicit idea behind your question that &quot;&lt;em&gt;on the paper, high frequency fluctuations of prices should not affect long term moves&lt;/em&gt;&quot;.&#xA;One point is for sure: the volatility we have in mind when we talk about &lt;strong&gt;Value At Risk&lt;/strong&gt; and similar systemic measure has nothing to do with the potential increases of volatility due to high frequency activity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nevertheless:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the &lt;strong&gt;cost of trading&lt;/strong&gt; affects all investors, hence the value of a position in a portfolio. And trading practices affect this cost, via the bid-ask spread, fees (that can be designed for HFT only), post trading costs and market impact (i.e. liquidity resilence)&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;market impact affects correlations&lt;/strong&gt; and as you underline it should matter to portfolio managers. But where is the causality? Asset managers changing the correlations via their correlated trading flows or the reverse?&lt;/li&gt;&#xA;&lt;li&gt;I have heard that: &quot;&lt;em&gt;big problems like the flash crash affect the confident people in general have in the price formation process. It is not good and it can lead to less people investing, hence less liquidity&lt;/em&gt;&quot;. I am not fully convinced because I dream people are more rational than this...&lt;/li&gt;&#xA;&lt;li&gt;Last but not least, you can imagine a very bad configuration for the &lt;a href=&quot;https://en.wikipedia.org/wiki/2010_Flash_Crash&quot; rel=&quot;nofollow noreferrer&quot;&gt;2010 flash crash&lt;/a&gt;. Remember it was between 2pm and 4pm NY time. Hence no other markets (Europe nor Asia) were open. Imagine that the worst point (30min after the start) would have happened a Friday, just at the close of European markets... Add than via correlations, European markets would have closed at -10% because of this... Most probably all positions in banks' books would have had to be marked to market prices on Friday night, and hence it could have been the start of a series of fire sales to cover VaR... Remember it was the start of rumours about the status of Greece debt...&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This last sequence is a very rare event, but it can happen, and we should try to prevent all these bad points. What are the solutions? some ideas:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;reduce operational risk&lt;/strong&gt; we need clear procedures to put in production trading systems (from exchanges' matching engine to HFT systems and brokers trading algorithms). With need &lt;strong&gt;norms and certifications&lt;/strong&gt;. &lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;improve circuit breakers&lt;/strong&gt; to stop trading when needed, and connect (to some extend) circuit breakers of different venues.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;put all possible liquidity on connected platforms&lt;/strong&gt; to have as much liquidity as needed.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;(by the way I like &lt;a href=&quot;http://www.worldscientific.com/worldscibooks/10.1142/8967&quot; rel=&quot;nofollow noreferrer&quot;&gt;the book&lt;/a&gt; too...)&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2017-06-10T15:49:54.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34639" PostTypeId="2" ParentId="34625" CreationDate="2017-06-10T16:52:39.403" Score="3" Body="&lt;p&gt;There is no official definition of market depth (this is only a qualitative concept), only the &lt;strong&gt;cost of a roundtrip for a given number of shares of contracts&lt;/strong&gt;. Take $V$ shares, on average, knowing the shape of the book at time $t$, what is the cost of buying and selling them immediately? You obtain a cost $C(V,t)$. Then you need to average or to choose an adequate $V$ or an adequate $t$.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;for $t$ there is no reason to choose a specific time, but you can either average on seconds ${\cal T}=(t_1, \ldots, t_K)$ or according to the intraday volume seasonality ${\cal B}=(\tau_1, \ldots,\tau_N)$ (more volume the morning and at the end of the day)&lt;/li&gt;&#xA;&lt;li&gt;for $V$ you can take only a typical volume of interest for you (if you know you will always split your metaorder in chunks of a given size $V^*$)&lt;/li&gt;&#xA;&lt;li&gt;otherwise you can use the average trade size of a day $\bar V$,&lt;/li&gt;&#xA;&lt;li&gt;or you can reuse a typical distribution of trade volumes of the day ${\cal V}=(v_1,\ldots,v_L)$. Be careful when I speak about trades, I have in mind &lt;em&gt;market orders&lt;/em&gt; you need to aggregate several trades.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You end up with different measures of market depth, like&#xA;$$\mathbb{E}(C(V,t)|V\in {\cal V}, t\in {\cal T}),$$&#xA;or&#xA;$$\mathbb{E}(C(V^*,t)|t\in {\cal B}).$$&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2017-06-11T08:13:34.837" LastActivityDate="2017-06-11T08:13:34.837" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="34641" PostTypeId="1" AcceptedAnswerId="34651" CreationDate="2017-06-10T18:39:22.720" Score="1" ViewCount="162" Body="&lt;p&gt;I have to solve the following exercise: compute and plot the value $V = V(S, t),\ t&amp;lt;T$, ($T=$ maturity) of an European CALL option (with arbitrary $t$, $T$, $K$ (strike price), $r$ (risk-free interest rate), $S&amp;gt;0$, i.e. the asset price at $t&amp;gt;0$), no dividends, but with an (arbitrary) time-varying volatility $\sigma=\sigma(t)$ (I choose it linear, $\sigma(t)=1+t$), by using the implicit finite difference method (implemented in MATLAB). Moreover the exercise says: $&quot;$an approximation $\tilde V=\tilde V(S, t)$ of the value $V$ of this type of option is given by the closed form solution of the B&amp;amp;S equation with constant parameter where the constant volatility $\tilde\sigma$ is approximated by&#xA;$$&#xA;\tilde\sigma = \sqrt{\frac{1}{T-t}\int_t^T\sigma^2(t)dt}.&quot;&#xA;$$&#xA;So, my question is: in order to implement the implicit finite difference method, do I have to compute the approximated value $\tilde\sigma$ (with $\sigma(t)=1+t$, choosed by me) and develop the algorithm with this value, or shall I proceed in an other way? Because in the way I think, the exercise seems very simple..&lt;/p&gt;&#xA;" OwnerUserId="28330" LastActivityDate="2017-06-11T14:09:30.367" Title="MATLAB exercise on an European call option with time-varying volatility" Tags="&lt;volatility&gt;&lt;programming&gt;&lt;finance-mathematics&gt;&lt;numerical-methods&gt;&lt;finite-difference-method&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34642" PostTypeId="2" ParentId="34629" CreationDate="2017-06-10T23:40:38.487" Score="1" Body="&lt;p&gt;Accounting ratios inherently lack a first moment and are skewed though of course that cannot be measured as a moment.  There may be some price ratios that are not skewed, but there shouldn't be any accounting ratios that are not skewed because of the inherent correlation among accounting data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Go to section six of the paper at &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2828744&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2828744&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It discusses the distribution of accounting ratios.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2017-06-10T23:40:38.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34643" PostTypeId="1" CreationDate="2017-06-11T01:19:40.063" Score="-1" ViewCount="87" Body="&lt;p&gt;We consider 2 European call options with the same underlying asset, the same maturity date $T$ and with 2 different strikes $K_1$ and $K_2$ such that $K_1\leq K_2$. We denote $C^1_{0}$ and $C^{2}_{0}$ their respective prices. &#xA;Show that under no arbitrage assumption:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ C^1_{0} - C^{2}_{0}\leq e^{-rT}(K_2-K_1) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $r$ is the risk-free rate.&lt;/p&gt;&#xA;" OwnerUserId="28332" LastEditorUserId="20454" LastEditDate="2017-06-11T14:44:31.510" LastActivityDate="2017-06-11T14:44:31.510" Title="European call options and strikes" Tags="&lt;call&gt;" AnswerCount="2" CommentCount="0" ClosedDate="2017-06-12T05:55:10.057" ContentLicense="CC BY-SA 3.0" />
  <row Id="34644" PostTypeId="2" ParentId="34643" CreationDate="2017-06-11T01:47:06.867" Score="1" Body="&lt;p&gt;Write your equation as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ C_0^1 +e^{-rT}K_1 \leq C_0^2 +e^{-rT}K_2 \quad (1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both sides consist on the price at $0$ of a portfolio $i$, $i \in \{1,2\}$, containing one option of strike $K_i$ and one risk-free zero-coupon bond of maturity $T$ and principal $K_i$. The payoff $P_i$ at $T$ of each portfolio is $\max(S_T,K_i)$ where $S_T$ is the price of the underlying stock. It comes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;P_2 - P_1 &amp;amp; = \max(S_T,K_2) - \max(S_T,K_1) &#xA;\\[12pt]&#xA;&amp;amp; = (K_2-S_T)1_{\{K_2 &amp;gt; S_T &amp;gt; K_1\}} + (K_2-K_1)1_{\{K_1 \geq S_T \}} &#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under all scenarios payoff $P_2$ is greater than payoff $P_1$, hence by no arbitrage portfolio $2$ must have a greater price than portfolio $1$ at any time $0 \leq t \leq T$.  The price of each portfolio is equal to the sum of the option price and the zero-coupon bond thus $(1)$ must be enforced, which proves your original inequality.&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-06-11T11:32:45.953" LastActivityDate="2017-06-11T11:32:45.953" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34647" PostTypeId="2" ParentId="10194" CreationDate="2017-06-11T07:46:30.830" Score="1" Body="&lt;p&gt;Coming across the post somewhat late: I attempted the same, and had Bloomberg caplet data for calibration (6mth EURIBOR) at hand. I calibrate directly via MC simulation (Euler, as suggested by crunch): Starting off with current 6mth EURIBOR, choosing $\theta(t)$ to match curve implied forward 6mth EURIBOR, forward-stepping until the first caplet expiry and computing payoffs. I then vary sigma for this interval to match the caplet premium accurately. To match the next caplet premium, I start off the MC with the realizations of 6mth EURIBOR at the first caplet expiry. Again, varying sigma for the second interval until the second caplet premium is matched etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps not overly elegant (investing a bit of time, one may find an analytic way to work out the piecewise-constant $\sigma$ from Ornstein-Uhlenbeck formulae), but it is stable and matches caplet prices very well. For calibrating a ten-year cap on my laptop, and running the MC in Matlab, about 10s computation time will do.&lt;/p&gt;&#xA;" OwnerUserId="28328" LastEditorUserId="28328" LastEditDate="2017-06-11T09:34:31.963" LastActivityDate="2017-06-11T09:34:31.963" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34648" PostTypeId="2" ParentId="34636" CreationDate="2017-06-11T09:09:24.083" Score="2" Body="&lt;p&gt;if you use put-call parity to make them all calls, they should be monotone decreasing, and convex. I wouldn't expect them to look like a market smile.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2017-06-11T09:09:24.083" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34649" PostTypeId="2" ParentId="34635" CreationDate="2017-06-11T13:47:16.950" Score="1" Body="&lt;p&gt;When backtesting VaR results using Kupiec test you should choose the respective significance levels as your VaRs. Thus, using 0.05 alpha for VaR with 99% confidence level is not correct. From &lt;a href=&quot;https://books.google.com/books?id=4GhKQT3gjbIC&amp;amp;pg=PA143&amp;amp;lpg=PA143&amp;amp;dq=kupiec%20test%20significance&amp;amp;source=bl&amp;amp;ots=ETp4f76mgv&amp;amp;sig=YVsKekXrJUIDXe3XGfAtL5hbYcE&amp;amp;hl=en&amp;amp;sa=X&amp;amp;ved=0ahUKEwiD3fKqprXUAhWqIJoKHSowC-0Q6AEIazAH#v=onepage&amp;amp;q=kupiec%20test%20significance&amp;amp;f=false&quot; rel=&quot;nofollow noreferrer&quot;&gt;Dowd&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;To implement the Kupiec test, we require data on &lt;em&gt;n&lt;/em&gt;, &lt;em&gt;p&lt;/em&gt; and &lt;em&gt;x&lt;/em&gt;. The&#xA;  first are easily found from the sample size and VaR confidence level,&#xA;  and we can derive &lt;em&gt;x&lt;/em&gt; from a set of paired observations of P/L and VaR&#xA;  each period.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="19096" LastActivityDate="2017-06-11T13:47:16.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34650" PostTypeId="2" ParentId="34643" CreationDate="2017-06-11T13:57:40.343" Score="4" Body="&lt;p&gt;The stated equation claims that:  Value of call spread &amp;lt;= present value of its maximum payoff.  This is almost self evident.  For a formal proof, suppose untrue.   Then sell the call spread, invest proceeds at r, giving a certain profit at T.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-06-11T13:57:40.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34651" PostTypeId="2" ParentId="34641" CreationDate="2017-06-11T14:09:30.367" Score="1" Body="&lt;p&gt;Ok, problem solved. The Implicit finite difference method must be implemented with $\sigma(t)=1+t$, not with his approximated value. &lt;/p&gt;&#xA;" OwnerUserId="28330" LastActivityDate="2017-06-11T14:09:30.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34652" PostTypeId="1" AcceptedAnswerId="34659" CreationDate="2017-06-11T14:22:30.757" Score="4" ViewCount="446" Body="&lt;p&gt;Suppose underlying asset $S$&#xA;$$dS = \mu Sdt + \sigma Sd W$$&#xA;our portfolio $\pi$ consist with $q(t)$ &lt;code&gt;stock&lt;/code&gt; $S$ and &lt;code&gt;cash&lt;/code&gt; $\pi - qS$ at time $t,$ so we have&#xA;$$d\pi = r(\pi− qS) dt + q dS.$$&#xA;with $|q|\leq 1.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And assume the final payment of our &lt;code&gt;passport option&lt;/code&gt; is&#xA;$$V(\pi,s, T) = \max\{\pi,0\}.$$&#xA;Use the &lt;code&gt;hedge portfolio&lt;/code&gt;, we can obtain the &lt;code&gt;PDE&lt;/code&gt;&#xA;$$V_t + \dfrac{1}{2}\sigma^2s^2 V_{ss} + q\sigma^2s^2V_{s\pi} + \dfrac{1}{2}q^2\sigma^2s^2V_{\pi\pi} + rsV_s + r\pi V_{\pi} -rV = 0.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We want to choose $q(t)$ to &lt;code&gt;maximize&lt;/code&gt; $V.$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One thing I confuse here, why does author only easily maximize the terms containing $q$ in the PDE? i.e&#xA;$$\max\limits_{|q|\leq 1}\ \left(q\sigma^2s^2V_{s\pi} + \dfrac{1}{2}q^2\sigma^2s^2V_{\pi\pi}\right) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is the book &lt;code&gt;Paul Wilmott on Quantitative Finance&lt;/code&gt; page 455&#xA;&lt;a href=&quot;https://i.stack.imgur.com/QaXu3.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/QaXu3.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/bIYVt.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/bIYVt.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Ra3YU.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Ra3YU.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26165" LastEditorUserId="26165" LastEditDate="2017-06-12T00:53:12.143" LastActivityDate="2017-06-12T08:25:20.800" Title="Pricing the Passport option" Tags="&lt;options&gt;&lt;stochastic-calculus&gt;&lt;derivatives&gt;&lt;differential-equations&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34656" PostTypeId="2" ParentId="26078" CreationDate="2017-06-11T20:10:21.257" Score="2" Body="&lt;p&gt;Symbol for DJIA is &quot;.DJI&quot; (without the quotes but with the leading period)&#xA;&lt;a href=&quot;https://www.google.com/finance/historical?q=.DJI&amp;amp;startdate=Jun+01%2C+2017&amp;amp;output=txt&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.google.com/finance/historical?q=.DJI&amp;amp;startdate=Jun+01%2C+2017&amp;amp;output=txt&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Symbol for NASDAQ is &quot;.IXIC&quot; (without the quotes but with the leading period)&#xA;&lt;a href=&quot;https://www.google.com/finance/historical?q=.IXIC&amp;amp;startdate=Jun+01%2C+2017&amp;amp;output=txt&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.google.com/finance/historical?q=.IXIC&amp;amp;startdate=Jun+01%2C+2017&amp;amp;output=txt&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Symbol for S&amp;amp;P500 is &quot;.INX&quot; (without the quotes but with the leading period)&#xA;&lt;a href=&quot;https://www.google.com/finance/historical?q=.INX&amp;amp;startdate=Jun+01%2C+2017&amp;amp;output=txt&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.google.com/finance/historical?q=.INX&amp;amp;startdate=Jun+01%2C+2017&amp;amp;output=txt&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="28337" LastEditorDisplayName="user13444" LastEditDate="2017-06-12T05:53:29.277" LastActivityDate="2017-06-12T05:53:29.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34657" PostTypeId="1" CreationDate="2017-06-11T20:55:36.153" Score="1" ViewCount="450" Body="&lt;p&gt;I've implemented a simple trading system that gets orders with FIX, manage them in limit order books, calculate relative prices and, execute order book, runs multiple sessions (auctions and normal) by variety of order types.&#xA;now I want to test it with an accountable data&lt;/p&gt;&#xA;&#xA;&lt;p&gt;my need is to have a time series of order &amp;amp; their last status or execution reports.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;any one can help?&#xA;Thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="28338" LastEditorUserId="2299" LastEditDate="2018-06-24T12:15:16.160" LastActivityDate="2021-04-11T04:02:25.360" Title="historical data on orders and executions" Tags="&lt;market-data&gt;&lt;historical-data&gt;&lt;market-microstructure&gt;&lt;trading-systems&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34659" PostTypeId="2" ParentId="34652" CreationDate="2017-06-12T08:25:20.800" Score="4" Body="&lt;p&gt;You maximize the terms in $q$ in the PDE because this is a consequence of the Bellman principle of optimality in dynamic programming. The intuition is that the global optimal strategy $\{q_t\}_{0 \leq t \leq T}$ is locally optimal such that (under the risk neutral measure  because the option is dynamically hedged)&#xA;$$V_t = \max_{|q_t|\leq 1}e^{-r dt}E_t\left[V_{t+dt} \right]$$ &#xA;that is &#xA;$$&#xA;V(\pi, S, t) = \max_{|q|\leq 1}e^{-r dt} E_t\left[V(\pi+ d\pi, S+dS, t+dt) \right]&#xA;$$&#xA;along with the stochastic dynamics (under the risk neutral measure)&#xA;$$&#xA;dS = rS dt + \sigma S dW&#xA;$$&#xA;$$&#xA;d\pi=r(\pi - qS) dt + qdS&#xA;$$&#xA;and the terminal condition $V(\pi, S, T) =\max(\pi, 0)$. In words, you start from the end and go back in time, finding the optimal strategy at each time step conditional on the state you're in. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You then apply Ito's lemma to $V(\pi+ d\pi, S+dS, t+dt)$ to obtain the author's result. &lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2017-06-12T08:25:20.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34660" PostTypeId="1" CreationDate="2017-06-12T09:08:33.547" Score="0" ViewCount="409" Body="&lt;p&gt;I am trying to repeat calculations from Hull(options futures and other derivatives) chapter &quot;Using Equity Prices to Estimate Default Probabilities&quot;. I want to solve system of 2 equations:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{cases} &#xA; E_0 = V_0 N(d_1) - L e^{-rt}N(d_2) \\ &#xA; \sigma_E E_0 = N(d_1) \sigma_V V_0&#xA;\end{cases}&#xA;to find $V_0, \sigma_V$, where you recognise Merton model. We assume that other variables are given, hence should be easy to solve numerically system of 2 equations with 2 unknowns. Using matlab &lt;strong&gt;&lt;em&gt;fsolve&lt;/em&gt;&lt;/strong&gt; function, even with feeding analytical Jacobian for different data inputs sometimes returns me:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;No solutions found.&lt;/strong&gt;&#xA;or&#xA;&lt;strong&gt;Equation solved, fsolve stalled.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is even worse if I use Black Cox model, as the 1st equation(barrier option) and 2nd equation(because of $\frac{\partial E }{\partial V}$ term) is getting huge. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could somebody give some hint how to solve this system? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could somebody give tips or ideas how to choose good initial conditions for &lt;strong&gt;&lt;em&gt;fsolve&lt;/em&gt;&lt;/strong&gt;? &#xA;( Finally, I eager to be able to solve Black Cox model)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; I have been thinking to search for reference how to work with ill-posed problems, or trying to identify if condition number is good, but I can not do the last as the system is non linear( I can not represent it as a matrix).&lt;/p&gt;&#xA;" OwnerUserId="22733" LastEditorUserId="22733" LastEditDate="2017-06-13T08:02:09.413" LastActivityDate="2018-05-29T13:42:21.357" Title="Default Probability calculation. How to solve system of 2 non linear equations?" Tags="&lt;merton-model&gt;&lt;nonlinear&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34661" PostTypeId="1" CreationDate="2017-06-12T10:08:10.333" Score="3" ViewCount="102" Body="&lt;p&gt;How close is yield to maturity usually to current interest yield? Can I use yield to maturity to approximate current interest yield of a bond index? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to calculate bond index price returns and I only have yield to maturity and average coupon yield. Can I just divide average coupon yield by yield to maturity to get a &quot;reasonable&quot; approximation of bond index price, to get price returns with ~10% error?&lt;/p&gt;&#xA;" OwnerUserId="28066" LastActivityDate="2017-06-12T10:18:34.480" Title="Bond yield to maturity vs current interest yield" Tags="&lt;bond&gt;&lt;estimation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34662" PostTypeId="1" AcceptedAnswerId="34666" CreationDate="2017-06-12T10:16:17.943" Score="14" ViewCount="2235" Body="&lt;p&gt;The original paper by Markowitz from the '60s has ~20,000 citations (definitely popular). However several papers I came across show that a &lt;span class=&quot;math-container&quot;&gt;$\frac{1}{n}$&lt;/span&gt; asset allocation gives higher Sharpe ratios (not sure about drawdowns) than mean-variance portfolio optimisation (or any subsequent derivative methods). What is the deal with all the attention portfolio optimisation (a more complex method) is getting if its utility seems low in practice?&lt;/p&gt;&#xA;" OwnerUserId="11655" LastEditorUserId="11655" LastEditDate="2019-07-04T08:28:31.730" LastActivityDate="2019-07-04T08:28:31.730" Title="Why is Markowitz portfolio optimisation so popular considering it is worse than an equal weighted portfolio?" Tags="&lt;optimization&gt;&lt;portfolio-optimization&gt;&lt;asset-allocation&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="15" ContentLicense="CC BY-SA 4.0" />
  <row Id="34663" PostTypeId="2" ParentId="34661" CreationDate="2017-06-12T10:18:34.480" Score="4" Body="&lt;p&gt;Not really.  For infinite maturity bonds we have $Price = coupon/yield$ so your approximation is actually correct.  However for short dated bonds it is not a good approximation.  For example , a 1 year annual pay bond gives $Price=(1+coupon)/(1+yield)$ which is very poorly approximated by $coupon/yield$.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-06-12T10:18:34.480" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34664" PostTypeId="1" CreationDate="2017-06-12T13:15:03.423" Score="1" ViewCount="104" Body="&lt;p&gt;In Thorpe's &lt;a href=&quot;http://www.edwardothorp.com/wp-content/uploads/2016/11/TheKellyCriterionAndTheStockMarket.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;paper&lt;/a&gt;, Thorpe derives the Kelly criterion &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f^* = p - q$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and plugs this into the equation &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$G(f^*) = p \times \log(1+f^*) + q \times \log(1-f^*)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;to get the following expression&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$G(f^*) = p \times \log (p) + q \times \log (q) + \log(2).$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am struggling to derive this result. I am left with&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$p \times \log(p) + q \times \log(q) + p \times \log\left(1 + (1-q)/p\right) + q \times \log \left(1 + (1-p)/q\right).$$&#xA;I expect the last two terms somehow equal $\log(2)$ but I have been scratching my head for hours trying to get there. Can anyone show me how please?&lt;/p&gt;&#xA;" OwnerUserId="28349" LastEditorUserId="26595" LastEditDate="2017-06-12T15:12:09.737" LastActivityDate="2017-06-12T15:12:09.737" Title="Kelly's maximum for G(f)" Tags="&lt;finance-mathematics&gt;&lt;statistical-finance&gt;&lt;kelly-criterion&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34665" PostTypeId="2" ParentId="34518" CreationDate="2017-06-12T14:56:31.500" Score="0" Body="&lt;p&gt;I decided to write an answer in order not to write too many comments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What do we get by PCA? Let us assume we have $n$ random variables.&#xA;We get a representation of the data of the form&#xA;$$&#xA;X_i = e_{1,i} P_1 + \cdots + e_{n,i} P_n&#xA;$$&#xA;where the PCAs $P_1,\ldots,P_n$ are uncorrelated (not necessarily independent) and ordered (descending) by variance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above relation is estimated from past data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the world of interest rates $X_i$ could be the change (rather not the level) of vertex $i$ and it turns out that the change of the i-th rate can be decomposed into a parallel shift ($P_1$) and a steppening ($P_2$) and so on.&#xA;This conditional on the future realization of $P_1$ we can estimate the change of vertex $i$ as it is estimated to be proportional by a factor $e_{1,i}$ to the parallel shift.&#xA;The relation above does not tell us whether $P_{1,t+1}$ the future pf $P_1$ will be positive or negative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of stocks we usually take $X_i$ to be the return of asset $i$. And the principle components are a market factor and several long/short portfolios.&#xA;If we can predict the market then we can plug this into the above equation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that as far as I remember $e_{1,i}$ is not the beta of the stock in the stock setting. Thus we would get a forecast cheaper by looking a betas and forecasting the broad market.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2017-06-12T14:56:31.500" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="34666" PostTypeId="2" ParentId="34662" CreationDate="2017-06-12T16:07:15.650" Score="20" Body="&lt;p&gt;Markowitz's concepts attracted a great deal of interest from theorists (and still do), but never had much application in practice. The results from practical application were always disappointing (starting in the 1970's, well before  DeMiguel, Garlappi, and Uppal (2007) study of $\frac{1}{N}$ portfolios), mainly because it is so difficult to provide accurate estimates of all the parameters involved (especially the expected returns, which in truth no one knows). Nevertheless it was revolutionary because gave rise to other theories,  such as CAPM, multi-factor models, Black-Litterman, etc. which eventually we hope will prove useful. Compare investment textbooks before and after Markowitz and you will see that everything changed at that time. Everyone working in (the asset management side of) QuantFinance today is an intellectual descendant of Markowitz, even though they don't use his method in their everyday work.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-06-12T16:16:26.890" LastActivityDate="2017-06-12T16:16:26.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34668" PostTypeId="2" ParentId="34662" CreationDate="2017-06-12T17:40:30.277" Score="9" Body="&lt;p&gt;There has been a split in the community ever since Mandelbrot published his paper &quot;On the Variation of Certain Speculative Prices.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Mandelbrot, B. (1963). The variation of certain speculative prices.&#xA;  The Journal of Business, 36(4):394–419.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;To understand why this is so important, you must first realize what economists are trying to do.  When you see someone buy an orange, that is the solution to a problem.  Economists can only see the solutions to the problems, but the actual problem is what they are trying to study.  The goal of economists is to solve &quot;inverse problems.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It appeared that Markowitz in his paper &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Markowitz, H. (1952). Portfolio selection. The Journal of Finance, 7(1):77–91.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;had come close to a solution.  It isn't the CAPM yet, but it seemed as if it were done.  What has been missing is that there is a math mistake in Markowitz's paper, but it is very subtle.  Indeed, it wasn't until 1958 that mathematicians had actually solved how to do what Markowitz was trying to do and the answer doesn't match.  There was a warning by John von Neumann that what appear to be proofs in economics may not be proofs as that branch of mathematics had not been solved yet in 1953.  Both of these events were missed in the economic community primarily because the disciplines are a bit stove piped.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the Fisherian likelihoodist discussion see:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;White, J. S. (1958). The limiting distribution of the serial correlation coefficient in the explosive case. The Annals of Mathematical Statistics, 29(4):1188–1197&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;By the 1970's empirical falsifications of the CAPM were beginning to roll out and in the 21st century, they were cataloged.  For the CAPM you can find them at:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Fama, E. F. and French, K. R. (2008). Dissecting anomalies. The Journal of&#xA;  Finance, LXIII(4):1653–1678.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and for the Black-Scholes model, you can find it at:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Yilmaz, B. Z. (2010). Completion, pricing, and calibration in a levy market model.  Master’s thesis. The Institute of Applied Mathematics of Middle East Technical University.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Because the math mistake in Markowitz and subsequent papers was missed &lt;em&gt;and&lt;/em&gt; because economists have to solve the inverse problem, which is not something finance professionals must do, a tremendous emphasis has been placed on the CAPM and its children like the consumption CAPM or its grandchildren such as the Fama-French model.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be very fair to Dr. Markowitz, he tested his own theories empirically at:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Markowitz, H. and Usmen, N. (1996a). The likelihood of various stock market&#xA;  return distributions, part 1: principles of inference. Journal of Risk and&#xA;  Uncertainty, 13:207–219.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Markowitz, H. and Usmen, N. (1996b). The likelihood of various stock market&#xA;  return distributions, part 2: empirical results. Journal of Risk and Uncertainty,&#xA;  13:221–247.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In communication with him, he has been a bit more skeptical of his own work than those that followed him.  The continuous time content seemed even more worrisome to him.  He performed tests in the 90's and were quite rigorous in their methodology.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Markowitz and Usman almost solve the issue in their paper, but they make a mental slip that catches them up.  They took the log approximation of returns and not returns themselves.  This is a very big deal because this is a transformation that has very different properties from those of the raw data.  It changes the statistical distribution.  I believe they would have caught what was really happening had they not taken the approximation.  They came very close.  There wasn't a mental recognition that they had triggered a math alteration in doing that and so they interpret the data as implying that stocks follow Student's t-distribution with 2-3 degrees of freedom.  This isn't quite correct, but it is close.  In log space, it follows a hyperbolic secant distribution.  See, for example,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Harris, D.E.(2017) The Distribution of Returns. Journal of Mathematical Finance, 7, 769-804.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;None of the CAPM models can be valid because, as mentioned above, there is a math mistake in them.  In fact, the Sharpe ratio is mathematically invalid as well except when solved with logs, although it isn't clear what it means in log space.  It is intimately related to Student's t-test, but there is an argument at &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Harris, David E., Why Practitioners Should Use Bayesian Statistics (January 25, 2016). Available at SSRN: &lt;a href=&quot;https://ssrn.com/abstract=2656681&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://ssrn.com/abstract=2656681&lt;/a&gt; or &lt;a href=&quot;http://dx.doi.org/10.2139/ssrn.2656681&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://dx.doi.org/10.2139/ssrn.2656681&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;that for the general case, there does not exist an admissible non-Bayesian estimator for equity securities.  Before using it, one should carefully walk through the implications of the math.  I have not done that for the Sharpe ratio.  It may nor may not be an admissible statistic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The CAPM still receives a lot of research because the fact there is an error in it is not well known.  It is also because the error can be expressed in a number of different ways depending upon the axiom system you are using.  For example, if you are using the Fisherian system of thinking called Likelihoodism then rather than there being a math error in the equations, you can show that the theory could never be tested.  That is to say, no test statistic could ever be created to determine if it is true or false.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question then becomes is something valid science if no method of falsification can exist.  On the other hand, in the Bayesian framework, you can easily show a mathematical contradiction is created by the model assumptions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The short answer is that people use the CAPM because they still need to solve the inverse problem.  A partial solution can be found for option pricing at:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Harris, David E., Pricing European Style Equity Options (August 30,&#xA;  2015). Available at SSRN: &lt;a href=&quot;https://ssrn.com/abstract=2653255&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://ssrn.com/abstract=2653255&lt;/a&gt; or&#xA;  &lt;a href=&quot;http://dx.doi.org/10.2139/ssrn.2653255&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://dx.doi.org/10.2139/ssrn.2653255&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The CAPM is an attempt to invert the problem.  As there is so much groundwork left to do, it isn't clear what people should be using yet.  My suggestion is to begin at:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Parmigiani, G. and Inoue, L. (2009). &lt;em&gt;Decision Theory: Principles and Approaches.&lt;/em&gt; Wiley Series in Probability and Statistics. Wiley, Chichester,&#xA;  West Sussex.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&#xA;Per a request, I have edited the response.  Because there are multiple Bayesian and non-Bayesian axiom systems involved there are multiple possible ways to answer this question.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remembering that the residuals and raw data are leptokurtic and that the math is mesokurtic, the question is why would this be the case.  In particular, it should not matter that the data is leptokurtic because the sample is so large that the residuals should long since have become mesokurtic.  This follows from the central limit theorem.  While it is true that millions of data points are far from infinitely many data points, the results are surprising unless there is no variance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To explore this question it is important to go earlier into optimization theory than most people would do and to discuss some ideas that are usually ignorable.  First, we need to discuss the Bayesian likelihood function and the non-Bayesian density function.  If $$\frac{1}{\pi}\frac{1}{1+(x-\mu)^2},\forall{x}\in\chi$$ is your density function, where each draw is i.i.d. then your Bayesian likelihood function is $$\frac{1}{\pi}\frac{1}{1+(x-\mu)^2},\forall{\mu}\in\Theta,$$ where $\chi$ is the sample space and $\Theta$ is the parameter space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a variety of reasons, this will become important.  The next question is how to estimate $\mu$.  For the Bayesian this question is simple, you use Bayes theorem over the entire parameter space.  For the Frequentist or Likelihoodist the question is far less simple.  The general algorithm for either, though, is to generate a sample statistic that estimates the population parameter and then to develop a test that can allow the performance of inference.  Although the rule generation process and the interpretation of the two primary non-Bayesian methods are different, they roughly share the same ideas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The definition of a statistic is any function of the data.  While the mean, median and mode of a sample is a statistic, so is the sum of the cosines of the data.  There has to be a method to determine which one to use.  At the beginning of the field of statistics, Abraham Wald created a set of decision rules that would determine which estimators are admissible and which are inadmissible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For data drawn from a Gaussian distribution, the sample mean is admissible, but the sample median and mode are not.  Neither is the sum of the cosines of the data points.  There is more though here.  Wald, a Frequentist and using Frequentist axioms, determined that all Bayesian estimators are admissible.  Further, non-Bayesian estimators are admissible under only two circumstances, when they map at every sample to a Bayesian estimator or they converge to the same value at the limit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I point this out because it will save us time to note that the Bayesian rules will always be optimal in the sense that you can never stochastically dominate them, and the Frequentist and Likelihoodist only inherit optimality when that optimization maps to the Bayesian.  This means I can solve this just one time and not sin too badly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let us go back to the very beginning of mean-variance finance to the intertemporal budget constraint $$\tilde{w}=R\bar{w}+\epsilon.$$  Since this is investing, you want to make a profit, so $R\ge{1}$ and generally you can say $R&amp;gt;1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mann and Wald in 1943 were able to show that the maximum likelihood estimator for $R$ is always the least squares estimator for any distribution of $\epsilon$ that was centered on zero and had a finite variance that is greater than zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Frequentist theory $R$ is known as it is the null hypothesis and $\epsilon$ is not known.  In Bayesian theory, $R$ is unknown, but $\bar{w}$ is fixed and was not drawn from a random sample.  It is important to realize that data are no longer random.  All kinds of problems that happen in the sample space are gone now because the only segment of the sample space you care about is the sample that was actually observed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This leaves three estimation cases, $w_{t+1}=Rw_t+\epsilon_{t+1}$, $R_t=\frac{w_{t+1}}{w_t}$ and $r_t=\log(w_{t+1})-\log(w_t)$.  For our purposes, we are going to stick with the first case, though the second and third cases are far more general and would take way too long to solve here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From White's paper above you can derive both the estimator and the test statistic for R for &lt;em&gt;any&lt;/em&gt; distribution for epsilon including jump diffusion models and so forth.  The test statistic is always the Cauchy distribution and the maximum likelihood estimator is the least squares estimator, which is a form of sample mean.  The Cauchy distribution is $$\Pr(x|\mu;\sigma)=\frac{1}{\pi}\frac{\sigma}{\sigma^2+(x-\mu)^2}.$$  The expectation of the Cauchy distribution does not exist and so the estimator cannot be tested.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now there is a very interesting relationship between the sample mean and the data from a Cauchy distribution.  If $$\Pr(x|\mu;\sigma)=\frac{1}{\pi}\frac{\sigma}{\sigma^2+(x-\mu)^2},$$ describes your data, then $$\Pr(\bar{x}|\mu;\sigma)=\frac{1}{\pi}\frac{\sigma}{\sigma^2+(\bar{x}-\mu)^2}.$$  It follows that the distribution of $R$ is the Cauchy distribution.  Since it has no expectation, then E(R) does not exist.  Hence the Markowitz optimization is defeated in a Bayesian environment.  No one can ever form an expectation about a return.  Since the Bayesian estimator is defeated, all non-Bayesian estimators are defeated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is important to note that the estimator only converges to the Cauchy distribution in the form of the intertemporal budget constraint.  It becomes an ugly mixture distribution in the other cases.  It's also important to note in the log case, that the hyperbolic secant distribution has no concept of covariance.  Two assets cannot covary, they can comove, but they cannot covary.  Indeed, it is also impossible for them to be independent of each other because $$f(x_1)*f(x_2)\ne{f(x_1,x_2)}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The contradiction is that you want to make a profit AND you are asserting the existence of an expectation and a variance-covariance relationship.  These are mutually exclusive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Hopefully final edit&lt;/strong&gt;&#xA;The original question was split into two parts.  The first is why is a non-optimal portfolio outperforming an optimal portfolio and secondarily, if this is the case why spend so time on Markowitz style models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The former is simple.  Except for very narrow cases involving bond-only portfolios, the assumption of a profitability goal excludes the existence of a mean and therefore a variance.  Performing any optimization assuming a mean and a covariance structure is impossible, though as there are large articles as to why, only a summary is provided above.  Markowitz style models are unavailable.  So when people look at non-optimal portfolios they find they do better than the theoretically optimal portfolios.  This is unsurprising because without a population parameter to converge to a statistic is just a random number.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to why spend so much time, the answer is that everyone knows it and because it appeared to solve the goal of economics, which is to solve the inverse problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Everyone just assumed that if you assumed a normal random shock you would get normal returns, but White (see above) shows that you get Cauchy returns with no mean or variance.  The problem is that this eliminates all non-Bayesian solutions for general cases because while the Bayesian likelihood function is a minimally sufficient statistic, no sufficient statistic can exist for non-Bayesian methods due to the Pitman-Koopman-Darmois theorem which says none exists for the purposes of creating a projection.  A jointly minimally sufficient exists by conditioning on the ancilliary for inference purposes, but not for projective purposes.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Koopman, B (1936). &quot;On distribution admitting a sufficient statistic&quot;. Transactions of the American Mathematical Society. Transactions of the American Mathematical Society, Vol. 39, No. 3. 39 (3): 399–409&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Indeed, nobody would be discussing tail risk if this process were mesokurtic.  I would grab the above bibliography and work forward in time.  There are a few things that are missing such as Wald's Complete Class Theorem, but that will get picked up in cited works.  You will also want to grab the bibliographies of the works for a more complete discussion.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastEditorUserId="25459" LastEditDate="2017-11-13T23:58:02.200" LastActivityDate="2017-11-13T23:58:02.200" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="34670" PostTypeId="2" ParentId="34662" CreationDate="2017-06-12T19:40:02.990" Score="8" Body="&lt;p&gt;It is more complicated than that: It is not the optimization per se that leads to inferior results but the data you use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kritzman et al. makes a strong case in defense of optimization vs. 1/N in this popular paper:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cfapubs.org/doi/pdf/10.2469/faj.v66.n2.6&quot; rel=&quot;nofollow noreferrer&quot;&gt;In Defense of Optimization: The Fallacy of 1/N, Financial Analysts Journal, Vol. 66, No. 2, 2010 by Mark Kritzman, Sebastien Page and David Turkington&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Abstract&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Previous research has shown that equally weighted portfolios&#xA;  outperform optimized portfolios, which suggests that optimization adds&#xA;  no value in the absence of informed inputs. This article argues the&#xA;  opposite. With naive inputs, optimized portfolios usually outperform&#xA;  equally weighted portfolios. The ostensible superiority of the 1/N&#xA;  approach arises not from limitations in optimization but, rather, from&#xA;  reliance on rolling short-term samples for estimating expected&#xA;  returns. This approach often yields implausible expectations. By&#xA;  relying on longer-term samples for estimating expected returns or even&#xA;  naively contrived yet plausible assumptions, optimized portfolios&#xA;  outperform equally weighted portfolios out of sample.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Another effect is that as soon as you diverge from cap weighted portfolios you automatically add other factors to the mix. In the case of equal weight you especially add &lt;a href=&quot;https://en.wikipedia.org/wiki/Fama%E2%80%93French_three-factor_model&quot; rel=&quot;nofollow noreferrer&quot;&gt;size and value factor loadings&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More on this can be found in the following fascinating paper:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.iijournals.com/doi/abs/10.3905/jpm.2013.39.4.091?journalCode=jpm&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Surprising Alpha From Malkiel’s Monkey and Upside-Down Strategies, The Journal of Portfolio Management, Summer 2013, Vol. 39, No. 4: pp. 91-105 &#xA;DOI: 10.3905/jpm.2013.39.4.091 by Robert D. Arnott, Jason Hsu, Vitali Kalesnik, and Phil Tindall&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&lt;br&gt;&#xA;In reality the picture also seems to be different than what is written in academic papers: CXO Advisory Group compared several equal weight ETFs with their capital weighted benchmarks and comes to the conclusion that they underperform their benchmarks on a net basis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source: &lt;a href=&quot;https://www.cxoadvisory.com/31683/size-effect/do-equal-weight-etfs-beat-cap-weight-counterparts/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.cxoadvisory.com/31683/size-effect/do-equal-weight-etfs-beat-cap-weight-counterparts/&lt;/a&gt; (behind a paywall).&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2018-10-21T17:18:29.987" LastActivityDate="2018-10-21T17:18:29.987" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="34671" PostTypeId="1" CreationDate="2017-06-12T23:57:11.037" Score="1" ViewCount="140" Body="&lt;p&gt;I am calculating oasd using implied vol of 15%. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is relation between OASD vs Implied volatility  in theory for various maturities. I am running using MMD curve. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If anyone recommend any good article on this; it would be helpful. &lt;/p&gt;&#xA;" OwnerUserId="2750" LastActivityDate="2017-06-12T23:57:11.037" Title="What is relation between option adjusted duration and volatility" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;duration&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34672" PostTypeId="1" CreationDate="2017-06-13T03:21:42.060" Score="2" ViewCount="235" Body="&lt;p&gt;what optimizer I can use in R to solve the following portfolio optimization problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$min(f^Tx)$&lt;br&gt;&#xA;   st:&lt;br&gt;&#xA;1. $ -a \le \sum_{i=1} ^{n} x(i) \le b$&lt;br&gt;&#xA;2. $ -c \le x(i) \le d$&lt;br&gt;&#xA;3. $  e \le \sum _{i=1} ^n |x(i)| \le f$&lt;br&gt;&#xA;4. $\sqrt{x^t\Sigma x} \le g$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a,b,c,d,e,f,g - positive. f is a vector. x - weights. $\Sigma$ var-covar matrix estimated from historical data. The problem without constrain 4 can be solved with linear solver ( with some tricks for condition 3). Condition 4 makes constrain non-linear, but quadratic. Any suggestion would be helpful. Thanks. &lt;/p&gt;&#xA;" OwnerUserId="28354" LastEditorUserId="28354" LastEditDate="2017-06-13T03:33:11.090" LastActivityDate="2017-11-10T23:19:06.513" Title="Portfolio optimization in R with factor tilting while constraining volatility" Tags="&lt;optimization&gt;&lt;portfolio-optimization&gt;&lt;portfolio&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34675" PostTypeId="1" CreationDate="2017-06-13T13:38:23.610" Score="3" ViewCount="4597" Body="&lt;p&gt;I understand that periodically participants exchange the difference in the fixed rate and the daily compounded overnight floating rates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is how should one compute the fixed rate?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What should be used as discount factors for arriving at the fixed rates?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example if the fixed rates on at-market interest rate swaps is: 2% for 6 months. How this rate is derived? &lt;/p&gt;&#xA;" OwnerUserId="28091" LastEditorUserId="467" LastEditDate="2017-07-23T04:28:07.707" LastActivityDate="2020-05-13T21:32:12.253" Title="How to compute Overnight Index Swap (OIS) fixed rate?" Tags="&lt;swaps&gt;&lt;ois-discounting&gt;&lt;ois&gt;" AnswerCount="4" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34676" PostTypeId="2" ParentId="34675" CreationDate="2017-06-13T14:20:37.110" Score="0" Body="&lt;p&gt;Your understanding may be incorrect. As a general rule the participants exchange payments only at maturity (not periodically).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure what you mean by &quot;calculate&quot;. The fixed rate has been agreed to by the participants at the inception of the OIS swap. It is written down in the swap agreement. One party agreed to pay say 2% fixed and the other to pay the geometric average overnight rate. The calculation of the geometric average will occur at the end of the contract.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is an exception for long term OIS swaps: Periodically (once each year) the participants get together and they exchange &quot;what each owes so far&quot; based on the overnight floating rates that have been seen so far and the agreed fixed rate; this is to avoid the credit risk from owing a large amount that builds up over a long time. In this case instead of waiting until the end they settle yearly. The swap terms remain the same, they are not adjusted or recalculated in any way.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-07-13T18:52:55.773" LastActivityDate="2017-07-13T18:52:55.773" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34677" PostTypeId="1" CreationDate="2017-06-13T14:39:26.683" Score="1" ViewCount="129" Body="&lt;p&gt;&quot;Carry is a function of the shape of the interest rate curve. When the curve is upwardly sloping (ie, longer&#xA;dated rates are higher than shorter rates, as they are currently), then the market is implying that&#xA;interest rates are expected to rise in the future. If interest rates follow projected forward rates (and&#xA;these expected rises materialise), then carry will be zero.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm struggling to understand why this would be the case? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Source:&lt;/strong&gt; redington.co.uk/base/redington/publications/download/id/12 [Note: It auto downloads the PDF]&lt;/p&gt;&#xA;" OwnerUserId="20531" LastActivityDate="2017-06-14T07:04:35.413" Title="Why is there no carry if interest rates follow projected forward rates?" Tags="&lt;interest-rate-swap&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34679" PostTypeId="1" CreationDate="2017-06-13T15:19:51.243" Score="0" ViewCount="76" Body="&lt;p&gt;I am working on a research project that requires me to run a CAPM regression on all intra-day stock quotes in NSDAQ, NYSE and all other U.S. exchanges since 1993. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The precision of the quote data is at second-level. We calculated the second by second stock returns, market returns, risk free rate, and ran a CAPM regression on the data. We used SPY return as the market benchmark.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, an interesting problem that occurred was - there are some stocks with really small beta (very close to 0). That is, the stock barely moves with the market. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;While pondering about the reasons behind this, we think it might be caused by different minimum stock movements. Some stocks might be trading at \$1, but a market movement of, say, \$10, will overshoot the price movement of such stocks. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, we are still not exactly sure about the reasons and how to adjust the data properly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The follow screenshot is an example of how small the beta can be (estimate is the beta value). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have an idea on this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/y4ai6.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/y4ai6.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="28116" LastEditorUserId="28116" LastEditDate="2017-06-13T15:40:41.740" LastActivityDate="2017-06-13T15:40:41.740" Title="CAPM Beta zero-correlation performance issue" Tags="&lt;statistics&gt;&lt;finance-mathematics&gt;&lt;capm&gt;&lt;quantitative&gt;&lt;statistical-finance&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34680" PostTypeId="1" CreationDate="2017-06-13T16:28:44.203" Score="1" ViewCount="138" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/y0rhc.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/y0rhc.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;People suppose that we have a two asset type portfolio optimization (as Intrument Type 1 and 2).&#xA;In the each portfolio refered by the instrument type there are 2 asset so we have four asset in total.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to express the objective function optimization in case of several asset classes with an appropriate weight? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I suppose that each instrument in each portfolio have the same weight and that the two asset type or portfolio have the same weight I have expressed several objective functions using the relative form&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[&lt;a href=&quot;https://i.stack.imgur.com/y0rhc.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;1&lt;/a&gt;] $X = \sqrt{sum_{i=0}^n ( InstrType1_{i}^M - InstrType1_{i}^N)^2} +       \sqrt{sum_{j=0}^n ( InstrType2_{j}^M - InstrType2_{j}^N)^2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[2] $X = \sqrt{sum_{i=0}^n ( InstrType1_{i}^M - InstrType1_{i}^N)^2*wi} +       \sqrt{sum_{j=0}^n ( InstrType2_{j}^M - InstrType2_{j}^N)^2*wj}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[3] $X = p*\sqrt{sum_{i=0}^n ( InstrType1_{i}^M - InstrType1_{i}^N)^2*wi} +       (1-p)*\sqrt{sum_{j=0}^n ( InstrType2_{j}^M - InstrType2_{j}^N)^2*wj}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One can see that the weighted forms are exponentially lower than the non weighted optimization, the solver do not efficiently handle the objective due to that rescalled problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anybody already deal with multiple objectives?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using matlab least square &lt;a href=&quot;https://fr.mathworks.com/help/optim/ug/lsqnonlin.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://fr.mathworks.com/help/optim/ug/lsqnonlin.html&lt;/a&gt; how to express p in the [3] objective form as its seems to be a weighted least square optimization? as example in [2] one can weight the objective directly within the function while for the [3] its seems to be outside?&lt;/p&gt;&#xA;" OwnerUserId="24915" LastEditorUserId="24915" LastEditDate="2017-06-16T08:48:22.593" LastActivityDate="2017-06-16T08:48:22.593" Title="Multi objective optimization Swaption/Caplets joint Calibration" Tags="&lt;implied-volatility&gt;&lt;backtesting&gt;&lt;swaps&gt;&lt;calibration&gt;&lt;stress-testing&gt;" AnswerCount="0" CommentCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="34681" PostTypeId="1" AcceptedAnswerId="34682" CreationDate="2017-06-13T17:22:55.360" Score="2" ViewCount="261" Body="&lt;p&gt;I'm stuck trying to analytically prove that a partial derivative of a specific, lower defined function $C$ is negative. The context of this problem is actually a Black-Scholes market situation, where a price of a call option decreases as its strike increases. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For given positive constants $S, K, r, \sigma$ and $T$, we have:&#xA;$$C(S,K,r, \sigma,T)=S \Phi(d_1)-Ke^{-rT}\Phi(d_2),$$&#xA;where &#xA;$$d_1=\frac{\ln \frac{S}{K}+(r+\frac{1}{2}\sigma^2)T}{\sigma \sqrt{T}},$$&#xA;$$d_2=d_1-\sigma \sqrt{T}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have to prove that the function $C$ is decreasing if $K$ is increasing. First, I calculate the partial derivation:&#xA;\begin{align}&#xA;\frac{\partial C}{\partial K}&amp;amp;=S\frac{d \Phi(d_1)}{d (d_1)} \frac{\partial d_1}{\partial K}-e^{-rT}\Phi(d_2)-Ke^{-rT}\frac{d \Phi(d_2)}{d (d_2)}\frac{\partial d_2}{\partial K}\\&#xA;&amp;amp; = S \varphi(d_1)\frac{K}{\sigma \sqrt{T}}-e^{-rT}\Phi(d_2)-Ke^{-rT}\varphi(d_2)\frac{K}{\sigma \sqrt{T}}\\&#xA;&amp;amp; = K^2 \left(  -e^{-rT} \frac{\varphi(d_2)}{\sigma \sqrt{T}} \right) + K \left( &#xA; S \frac{\varphi(d_1)}{\sigma \sqrt{T}}\right) -e^{-rT}\Phi(d_2).&#xA;\end{align}&#xA;where $\Phi(x)$ is the standard normal cumulative, and $\varphi(x)$ standard normal density function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is more or less what I've got. I understand that I should somehow prove that the last expression is always non-negative, so I've tried calculating the determinant of the quadratic function of $K$, and I got&#xA;$$D= \frac{S^2 (\varphi(d_1)^2)}{\sigma^2 T}-4 \frac{e^{-2rT }\varphi(d_2)\Phi(d_2)}{\sigma \sqrt{T}}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And now I should prove that it is positive. No idea how? There is also a chance I misunderstood something and am leaving out some necessary conditions, I'm not sure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for an insights on this, I really appreciate it. &lt;/p&gt;&#xA;" OwnerUserId="23864" LastActivityDate="2017-06-13T18:41:08.000" Title="Attempt of an analytical proof that a call price decreases as its strike increases" Tags="&lt;black-scholes&gt;&lt;greeks&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34682" PostTypeId="2" ParentId="34681" CreationDate="2017-06-13T18:32:34.813" Score="5" Body="&lt;p&gt;Something went wrong in the third equality of the equation where you compute $\partial C_0 / \partial K$. Starting from the second equality, you can use that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;S_0 \mathcal{N}' \left( d_1 \right) = K e^{-r T} \mathcal{N}' \left( d_2 \right),&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;see e.g. Equation (1.29) in Wystup (2006). Alternatively, you could use the homogeneity result&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;C_0 = S_0 \frac{\partial C_0}{\partial S_0} + K \frac{\partial C_0}{\partial K}&#xA;\end{equation}.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;see Equation (1.36) in Wystup (2006). This immediately yields the result as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\frac{\partial C_0}{\partial K} = \frac{C_0 - S_0 \partial C_0 / \partial S_0}{K} = -e^{-r T} \mathcal{N} \left( d_2 \right).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The homogeneity result actually holds for all models with constant returns to scale, not just geometric Brownian motion, see Theorem 9 in Merton (1973).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet another approach to show that $\partial C_0 / \partial K &amp;lt; 0$ in a model-free setting is to note that the portfolio which is long a call with strike $K + \Delta$ and short a call with strike $K$ has a payoff equal to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;C_T = \begin{cases} -\Delta &amp;lt; 0 &amp;amp; \text{if } S_T &amp;gt; K + \Delta\\ K - S_T &amp;lt; 0 &amp;amp; \text{if } K + \Delta \geq S_T &amp;gt; K\\ 0 &amp;amp; \text{otherwise} \end{cases}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the portfolio payoff is non-positive everywhere but strictly negative for some $S_T$, its initial value $C_0$ must be strictly negative if $\mathbb{P} \left\{ S_T &amp;gt; K \right\} &amp;gt; 0$. Now divide by $\Delta$, take the limit as $\Delta \downarrow 0$ and you have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\frac{\partial C_0}{\partial K} = \lim_{\Delta \downarrow 0} \frac{C_0(K + \Delta) - C_0(K)}{\Delta} &amp;lt; 0.&#xA;\end{equation} &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Merton, Robert C. (1973) &quot;Theory of Rational Option Pricing,&quot; &lt;em&gt;Bell Journal of Economics and Management Science&lt;/em&gt;, Vol. 4, No. 1, pp. 141-183&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wystup, Uwe (2006) &lt;em&gt;FX Options and Structured Products&lt;/em&gt;, Wiley Finance&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-06-13T18:40:04.917" LastActivityDate="2017-06-13T18:40:04.917" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34683" PostTypeId="2" ParentId="34681" CreationDate="2017-06-13T18:41:08.000" Score="-1" Body="&lt;p&gt;Ok, I think I've figured it out. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;\frac{\partial C}{\partial K}&amp;amp; = S \varphi(d_1)\frac{K}{\sigma \sqrt{T}}-e^{-rT}\Phi(d_2)-Ke^{-rT}\varphi(d_2)\frac{K}{\sigma \sqrt{T}}\\&#xA;&amp;amp; = -e^{-rT}\Phi(d_2)+\frac{K}{\sigma \sqrt{T}} \left[  S \varphi(d_1)-K e^{-rT} \varphi(d_2) \right] \\&#xA;&amp;amp; = -e^{-rT}\Phi(d_2)+\frac{K}{\sigma \sqrt{T}} \left[  e^{\ln S} \frac{1}{\sqrt{2 \pi}}e^{-\frac{d_1^2}{2}}-e^{\ln K} e^{-rT}  \frac{1}{\sqrt{2 \pi}}e^{-\frac{d_2^2}{2}}\right] \\&#xA;&amp;amp; = -e^{-rT}\Phi(d_2)+\frac{K}{\sigma \sqrt{2\pi T}} \left[   e^{\ln S-\frac{d_1^2}{2}}- e^{\ln K-rT-\frac{d_2^2}{2}}\right] .&#xA;\end{align}&#xA;Now, we can try proving that&#xA;\begin{align}&#xA;\ln S-\frac{d_1^2}{2} &amp;amp; \stackrel{?}{=} \ln K-rT-\frac{d_2^2}{2} \\&#xA;\ln S-\frac{d_1^2}{2} &amp;amp; \stackrel{?}{=} \ln K-rT-\frac{(d_1-\sigma \sqrt{T})^2}{2} \\&#xA;\ln S-\frac{d_1^2}{2} &amp;amp; \stackrel{?}{=} \ln K-rT-\frac{(d_1^2-2d_1\sigma \sqrt{T}+\sigma^2 T)}{2} \\&#xA;\ln \frac{S}{K} &amp;amp; \stackrel{?}{=} -rT + d_1 \sigma \sqrt{T}-\frac{\sigma^2 T}{2} \\&#xA;\ln \frac{S}{K} +(r+\frac{\sigma^2 }{2})T &amp;amp; \stackrel{?}{=}  d_1 \sigma \sqrt{T} \\&#xA;d_1 &amp;amp; = \frac{\ln \frac{S}{K} +(r+\frac{\sigma^2 }{2})T}{\sigma \sqrt{T}}.&#xA;\end{align}&#xA;Thus we are left with&#xA;$$ \frac{\partial C}{\partial K} = -e^{-rT}\Phi(d_2), $$&#xA;implying that the partial derivative is always negative.&lt;/p&gt;&#xA;" OwnerUserId="23864" LastActivityDate="2017-06-13T18:41:08.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34684" PostTypeId="1" AcceptedAnswerId="34698" CreationDate="2017-06-13T19:08:27.000" Score="0" ViewCount="98" Body="&lt;p&gt;I am working through &lt;a href=&quot;http://www.eecs.harvard.edu/cs286r/courses/fall12/papers/Thorpe_KellyCriterion2007.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Thorpe's Ch 9&lt;/a&gt; on the Kelly criterion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On page 9 Thorpe states: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Var(ln(1+Y_if)] = p[ln(1+f)]^2 + q[ln(1-f)]^2 - m^2$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $var(X) = E[X^2] - m^2$, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$p[ln(1+f)]^2 + q[ln(1-f)]^2 = E[X^2]$$  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would it be correct to assume that  $E[(ln\sum x_i))^k] = \sum p_i(ln(x_i))^k$ for rvs which can only take on two values? I am assuming this is the case but I am on a steep probability learning curve, so verification from someone with more experience would still be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="28349" LastEditorUserId="26595" LastEditDate="2017-06-14T10:34:53.963" LastActivityDate="2017-06-14T13:30:38.027" Title="Kelly Variance - variance of the sum of logs" Tags="&lt;finance-mathematics&gt;&lt;statistical-finance&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34685" PostTypeId="1" AcceptedAnswerId="34693" CreationDate="2017-06-13T19:10:02.800" Score="3" ViewCount="413" Body="&lt;p&gt;I am a bit confused about the practical use of vol surfaces used for derivative pricing. We know that the two main products that best represent market volatility are caps and swaptions, from which volatility surfaces are generated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I always thought that surfaces implied by the products above described could be used for pricing all products, e.g. barrier options, asian options, CMS and CMS spread options. However, volatility is model dependant, so we could have normal volatility or lognormal volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, is it the case that we always have to convert a normal/lognormal vol from the corresponding surface to a different volatility, so that it fits the volatility term in our pricing model? For example, what vol do we use if we are using a CIR, HJM or BGM models to price one of the derivatives above described?&lt;/p&gt;&#xA;" OwnerUserId="13457" LastEditorUserId="19645" LastEditDate="2021-05-05T08:44:05.127" LastActivityDate="2021-05-05T08:44:05.127" Title="Volatility considerations with interest rate derivatives" Tags="&lt;volatility&gt;&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;volatility-smile&gt;&lt;short-rate&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34686" PostTypeId="2" ParentId="34672" CreationDate="2017-06-13T21:00:49.890" Score="1" Body="&lt;p&gt;You can try the &lt;code&gt;solnp()&lt;/code&gt; function from the package &lt;code&gt;Rsolnp&lt;/code&gt;, which is a solver for nonlinear optimization. First, you define your function that is to be minimized:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;fun1 &amp;lt;- function(x) ( return(as.numeric(fvec %*% x)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;fvec&lt;/code&gt; is your fixed vector $f$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you define the inequality function for the inequalities 1,3 and 4 - inequality 2 is covered by the parameter boundaries in the solver.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ineqfun1 &amp;lt;- function(x){&#xA;  ineq1 &amp;lt;- sum(x);&#xA;  ineq2 &amp;lt;- sum(abs(x));&#xA;  ineq3 &amp;lt;- sqrt(x %*% vcovmat %*% x);&#xA;  return(c(ineq1,ineq2,ineq3))&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;vcovmat&lt;/code&gt; is your var-cov matrix $\Sigma$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;After additionally defining the boundaries &lt;code&gt;a&lt;/code&gt; to &lt;code&gt;g&lt;/code&gt; and a starting estimate for x, which we call &lt;code&gt;xstart&lt;/code&gt;, you can do the optimization:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sol &amp;lt;- solnp(pars=xstart, fun=fun1, ineqfun=ineqfun1,&#xA;             ineqLB=c(-a,e,-Inf),ineqUB=c(b,f,g),&#xA;             LB=-c, UB=d)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If the solver converges, you can get the resulting weight estimates with &lt;code&gt;sol$pars&lt;/code&gt;.&lt;br&gt;&#xA;I have no data to try it, but the code should work. You will have to choose a sensible starting value and appropriate boundaries a-g, though.&lt;/p&gt;&#xA;" OwnerUserId="26503" LastActivityDate="2017-06-13T21:00:49.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34687" PostTypeId="2" ParentId="22315" CreationDate="2017-06-13T21:16:48.310" Score="3" Body="&lt;p&gt;This is a corollary of Feynman-Kac theorem. For self-containedness,&#xA;I re-produce the proof as follows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume that there exists a $C^{1,2}$-function $F=F(t,x)$ defined&#xA;on $[0,T]\times\mathbb{R}$ that satisfies the PDE on the&#xA;interior&#xA;$$&#xA;F_{t}+\beta F_{x}+\frac{1}{2}\sigma^{2}F_{xx}=0,&#xA;$$&#xA;and the boundary condition: $F(T,x)=g(x)$. Consider the process $\left(F(t,X_{t})\right)_{t}$.&#xA;By Ito's lemma, &#xA;\begin{eqnarray*}&#xA; &amp;amp;  &amp;amp; dF(t,X_{t})\\&#xA; &amp;amp; = &amp;amp; F_{t}dt+F_{x}dX_{t}+\frac{1}{2}F_{xx}dX_{t}dX_{t}\\&#xA; &amp;amp; = &amp;amp; \left\{ F_{t}+\beta F_{x}+\frac{1}{2}\sigma^{2}F_{xx}\right\} dt+\sigma F_{x}dW_{t}\\&#xA; &amp;amp; = &amp;amp; \sigma F_{x}dW_{t}.&#xA;\end{eqnarray*}&#xA;(In the above, $\beta$, $\sigma$, and all partial derivatives of $F$&#xA;are evaluated at $(t,X_{t})$ (i.e., $\beta$ denotes $\beta(t,X_{t})$, &#xA;etc...)) By assuming enough boundedness about the process $\left(\sigma(t,X_{t})F_{x}(t,X_{t})\right)_{t}$,&#xA;$\left(F(t,X_{t})\right)_t$ is a martingale (rather than just a local martingale).&#xA;Therefore, &#xA;\begin{eqnarray*}&#xA;F(t,X_{t}) &amp;amp; = &amp;amp; E\left[F(T,X_{T})\mid\mathcal{F}_{t}\right]\\&#xA; &amp;amp; = &amp;amp; E\left[g(X_{T})\mid\mathcal{F}_{t}\right]\mbox{ a.s.}&#xA;\end{eqnarray*}&#xA;Observe that the left hand side is $\sigma(X_{t})$-measurable, so&#xA;does the right hand side, the result follows. For clarity, I work out the details as follows:  Clearly $\sigma(X_{t})\subseteq\mathcal{F}_{t}$.&#xA;Therefore, by tower property of conditional expectation, we have &#xA;\begin{eqnarray*}&#xA; &amp;amp;  &amp;amp; E\left[g(X_{T})\mid X_{t}\right]\\&#xA; &amp;amp; = &amp;amp; E\left[E\left[g(X_{T})\mid\mathcal{F}_{t}\right]\mid X_{t}\right]\\&#xA; &amp;amp; = &amp;amp; E\left[F(t,X_{t})\mid X_{t}\right]\\&#xA; &amp;amp; = &amp;amp; F(t,X_{t})\\&#xA; &amp;amp; = &amp;amp; E\left[g(X_{T})\mid\mathcal{F}_{t}\right].&#xA;\end{eqnarray*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remarks: I do not have enough knowledge about PDE, so I am not sure that the&#xA;function $F$ defined in above really exists.&lt;/p&gt;&#xA;" OwnerUserId="28364" LastActivityDate="2017-06-13T21:16:48.310" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34689" PostTypeId="2" ParentId="34194" CreationDate="2017-06-13T23:21:11.637" Score="0" Body="&lt;p&gt;In risk-neutral pricing environment both cases would be discounted by the risk-free rate; the riskless portoflio in BSM formula earns the risk-free rate because the portfolio return is unaffected by changes of the price of the underlying, i.e. it is immune to market risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, point 2) introduces credit risk which typically would be incorporated by adding/subtracting some amount on the top of the risk-free price of the option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But for the option writer who already received the premium upfront the credit risk remains zero.&lt;/p&gt;&#xA;" OwnerUserId="27334" LastActivityDate="2017-06-13T23:21:11.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34690" PostTypeId="1" CreationDate="2017-06-14T02:42:36.807" Score="0" ViewCount="59" Body="&lt;p&gt;This is a practical problem of calculating the PB of a stock. Here is a example of &lt;code&gt;Jenapharm&lt;/code&gt;, but I am not sure which terms following can be found in Bloomberg.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Jenapharm was the most respected pharmaceutical manufacturer in&#xA;East Germany.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Jenapharm, which was expected to have revenues of 230 million DM&#xA;and &lt;code&gt;earnings&lt;/code&gt; before interest and taxes of &lt;code&gt;30&lt;/code&gt; million DM in 1991.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The firm had a book value of assets of 110 million DM, and a &lt;code&gt;book value of equity&lt;/code&gt; of &lt;code&gt;58&lt;/code&gt; million DM. The &lt;code&gt;interest expenses&lt;/code&gt; in 1991 is&#xA;expected to be &lt;code&gt;15&lt;/code&gt; million DM. The &lt;code&gt;corporate tax rate&lt;/code&gt; is &lt;code&gt;40%&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The firm was expected to maintain sales in its niche product, a&#xA;contraceptive pill, and &lt;code&gt;grow&lt;/code&gt; at &lt;code&gt;5%&lt;/code&gt; a year in the long term, primarily by&#xA;expanding into the generic drug market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;average beta&lt;/code&gt; of pharmaceutical firms traded on the Frankfurt&#xA;Stock exchange was &lt;code&gt;1.05&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;ten-year bond rate&lt;/code&gt; in Germany at the time of this valuation was&#xA;&lt;code&gt;7%&lt;/code&gt;; the &lt;code&gt;risk premium for stocks over bonds&lt;/code&gt; is assumed to be &lt;code&gt;5.5%&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Calculate the PB:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\textrm{Expected Net Income} = (\textrm{EBIT} - \textrm{Interest Expense})*(1-t) $$&#xA;$$= (30 - 15) *(1-0.4) = 9$$&#xA;$$\textrm{Return on Equity} = \textrm{Expected Net Income / Book Value of Equity}$$&#xA;$$ = 9 /58 = 15.52\%$$&#xA;$$\textrm{Cost on Equity} = 7\% + 1.05 (5.5\%) = 12.775\%$$&#xA;$$\textrm{Price/Book Value Ratio} = (\textrm{ROE} - g) / (r - g) $$&#xA;$$= (.1552 - .05) / (.12775 -.05) = 1.35$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To find the data in &lt;code&gt;Bloomberg&lt;/code&gt;, I have following questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Which risk free interest rate will we use? 10 year bond of respective currency?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;For Risk premium for stocks over bonds and Expected Net Income, can we directly found those two terms in Company's information?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-06-14T02:42:36.807" Title="Calculating the PB of a stock in practice" Tags="&lt;equities&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34691" PostTypeId="2" ParentId="34662" CreationDate="2017-06-14T06:21:29.760" Score="3" Body="&lt;p&gt;Markowitz' method for mean-variance optimization was originally intended to demonstrate the &quot;free lunch&quot; of diversification. In that regard, it was and is still very successful. The method gained wider notoriety due its articulation within the &lt;strong&gt;Capital Asset Pricing Model&lt;/strong&gt; (CAPM) (a-la the Sharpe-Black-Lintner Model). The CAPM was really the first application of the a&lt;strong&gt;rbitrage pricing theory&lt;/strong&gt; (APT) which could reproduce an assets price given a beta coefficient based on prior mean and variance. It was largely seen as an elegant solution to the &lt;strong&gt;efficient market hypothesis&lt;/strong&gt; (EMH) in which the current market prices represented optimal weights within a market portfolio. The assumption that investors react based on a-priori (or a-posteriori) mean and variance provided the theoretical &quot;glue&quot; for CAPM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet, most tests involving the portfolio optimization fail to outperform many other simpler weighting schemes because they utilize the prior distributions of securities' mean and variance to come up with optimal weights in order to naively maximize the posterior distribution's return per unit of variance (i.e., located an &lt;strong&gt;efficient frontier&lt;/strong&gt; of security weights). If we knew the posterior distribution's mean and variance, we could use Markowitz' method to optimize return in relation to risk. However, it is now an accepted stylized fact that security return distributions are not fixed (i.e. mean and variance are stochastic and are not complete measures of the distribution). Moreover, we now know that the market portfolio's weights cannot be efficient within a mean-variance framework since it has been shown again and again that there other risk factors that influence the posterior distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fama and French's (FF) entire existence may be predicated as an invective against the CAPM's simple intuition that mean and variance determine the optimal market portfolio. To FF, an efficient market would simply disallow such a simple solution as a single factor linear regression. The key distinction between Sharpe and FF is the view on an efficient market as something which can be priced rationally versus a thing which is too complex for any normative model of investor behavior. Their use of sorts based on size, value, and other factors are proxies for other factors which demonstrate how decisions based on the prior distribution's mean and variance are sub-optimal. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed, FF (1993) found that when portfolios are ranked by size, market beta’s explanatory value falls to zero (and that its utility is not likely salvageable through the remediation of analytical errors).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my opinion, Markowitz' portfolio optimization techniques have practical value if one can non-naively estimate posterior returns and variances. However, if one continues to use prior returns, one should continue to expect sub-optimal results -- at most, a minimization of excess portfolio variance which is simply a naive side-effect of diversification.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastActivityDate="2017-06-14T06:21:29.760" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34692" PostTypeId="2" ParentId="34677" CreationDate="2017-06-14T07:04:35.413" Score="1" Body="&lt;p&gt;Carry tends to have different meanings in the derivatives world and in the asset management world. The paper you are referring to comes from the asset management world. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the derivatives world people tend to think that if the random part is zero the variables &quot;age&quot; according to their forward value: tomorrow's interest rates will be today's 1 day forward interest rates, tomorrow's implied vol will be today's 1 day forward implied vol, etc.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the asset management world people tend to think that if the random part is zero the variables remain the same: tomorrow's interest rates are the same as today's. So they have introduced a concept of carry that can be thought of as the impact of the difference between rates not changing and rates changing according to their forwards. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In essence it's the same difference than between theta and modified theta in the option world: theta is just the derivative to time, but modified theta includes the various funding effects, volatility aging, etc.&lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2017-06-14T07:04:35.413" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34693" PostTypeId="2" ParentId="34685" CreationDate="2017-06-14T09:50:44.593" Score="1" Body="&lt;p&gt;Implied vol surfaces are just a convenient way to represent vanilla options (caps, European swaptions) prices in the context of simple models such as normal, log normal or shifted log normal.  When using a more advanced model (BGM, etc.) with the goal of pricing non vanilla options the first step is to calibrate the advanced model vol parameters to vanilla options prices, keeping in mind that non vanilla options may also depend on parameters that can not be captured trough vanilla options (e.g. correlations, or implied vol outside the quoted strikes range, etc.)&lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2017-06-14T09:50:44.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34695" PostTypeId="1" CreationDate="2017-06-14T12:25:25.537" Score="7" ViewCount="926" Body="&lt;p&gt;The PRIIP (packaged products) regulation prescribes Monte Carlo bootstrapping simulation for calculation of VaR for products of category III (non-linearly leveraged products). The idea is based on Geometric Brownian Motion. The bank shall for each product realize Monte Carlo simulation of future returns and disclose the total-life 97.5% VaR. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is one example published (&lt;a href=&quot;https://ec.europa.eu/info/system/files/risk-section-kid-11072016_en.pdf&quot; rel=&quot;noreferrer&quot;&gt;https://ec.europa.eu/info/system/files/risk-section-kid-11072016_en.pdf&lt;/a&gt;). This example follows this logic:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) History of 9 daily log-returns is available, with the sample mean of $\mu$=-0,00227252 and standard deviation $\sigma$=0,011551773.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Bootstrapping of the returns is performed via random sampling out of these 9 historical log-returns. N=10 000 paths, each T=10 days long are boostrapped. Total return for each path is calculated as sum of sampled log-returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) The path responding to 97.5% quantile is selected, with total log-return of $r_{bootstrapped}^{97,5\%}$=0,029342.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) The risk-risk free rate of $r_{free}$=1.2% per annum is assumed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the intermediary result is clear, the VaR log-return $r_{bootstrapped}^{97,5\%}$=0,029342 is however not risk-neutral. The regulation prescribes to derive a risk neutral return, based on the risk-free rate $r_{free}$ and historical mean $\mu$ and sample deviation $\sigma$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How could the risk-neutral return be calculated ?&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The example states deemed result of $r_{neutral}^{97,5\%}$=0,055447241. I am however not able to derive to this results. The regulation states formula &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Return = E[Return_{risk-neutral}] - E[Return_{measured}] - 0.5\sigma^2T$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is very unclear.&#xA;The calculation I have tried (assuming 261 business days, which is however information not given directly in the example) is based on the logic, that we have to replace the historical mean with risk-free rate. I tried to do it in following way, not sure if correct (?):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_{neutral}^{97,5\%}=r_{bootstrapped}^{97,5\%}+(r_{free}*T/261-0,5*\sigma^2*T-\mu*T)=0,029342+(0,012*10/261-0,5*0,011551773^2*10-(-0,00227252*10))&#xA;)= 0,05185976$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this approach correct or &lt;strong&gt;how should one derive risk-neutral return from the bootstrapping Monte Carlo simulation ?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="16818" LastEditorUserId="16818" LastEditDate="2017-06-21T10:10:51.740" LastActivityDate="2019-12-08T18:01:30.250" Title="Risk neutrality correction for Monte Carlo Bootstrapping according to PRIIP regulation for products of category III" Tags="&lt;brownian-motion&gt;&lt;risk-neutral-measure&gt;&lt;var&gt;&lt;bootstrapping&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34696" PostTypeId="1" CreationDate="2017-06-14T12:35:34.917" Score="0" ViewCount="674" Body="&lt;p&gt;I'm building a Geometric Brownian Motion model which incorporates future dividends which vary over time. Since these should reduce stock price when paid, I can incorporate that into the model, however, I just realized that when I estimated drift from historical data, that data already incorporates dividends. Should I adjust the historical to remove the impact of the dividends? &lt;/p&gt;&#xA;" OwnerUserId="28375" LastActivityDate="2017-07-14T14:48:32.033" Title="Should I adjust historical data for dividends when estimating drift?" Tags="&lt;monte-carlo&gt;&lt;brownian-motion&gt;&lt;random-walk&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34697" PostTypeId="2" ParentId="34696" CreationDate="2017-06-14T13:21:29.907" Score="1" Body="&lt;p&gt;In a Black-Scholes framework, the Geometric Brownian Motion specifying the dynamics of a stock continuously paying dividends is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dS_t = (\mu_{\text{Total}}-q)S_tdt+\sigma S_tdW_t $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under the model above, the stock price $S_t$ is continuously paying a dividend equal to $qS_tdt$, and as a consequence the stock price depreciates continuously at the same rate $-$ the same way in stock markets, stock prices plunge immediately after a dividend payment by an amount equal to the dividend paid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us define $\mu_{\text{Price}} = \mu_{\text{Total}}-q$. Now, depending on what you mean by:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;[...] &lt;em&gt;data already incorporates dividends.&lt;/em&gt;&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;We have:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If your stock data is &lt;em&gt;not&lt;/em&gt; adjusted for dividends $-$ &quot;not adjusted&quot; meaning that stock prices do not incorporate paid dividends $-$ then if you estimate the drift on that data series you will be estimating $\mu_{\text{Price}}$ &lt;em&gt;i.e.&lt;/em&gt; the price return drift which only captures returns from variations in the stock price independent of dividend payments.&lt;/li&gt;&#xA;&lt;li&gt;If your stock data is adjusted for dividends $-$ &quot;adjusted&quot; meaning that stock prices are corrected by adding back paid dividends $-$ then if you estimate the drift on that data series you will be estimating $\mu_{\text{Total}}$, &lt;em&gt;i.e.&lt;/em&gt; the total return drift which incorporates dividend return.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You can manually adjust your data series to &quot;&lt;em&gt;remove the impact of the dividends&lt;/em&gt;&quot; $-$ I am unsure whether you mean subtracting paid dividends from the stock price, or adding them back $-$ and you will be able to estimate both drifts $\mu_{\text{Total}}$ and $\mu_{\text{Price}}$ from each data series, adjusted and unadjusted. From there you can also estimate the continuous dividend yield $q$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For discrete dividend modelling, things get messier. You can take a look at Wikipedia's article on the Black-Scholes model, where they consider &lt;a href=&quot;https://en.wikipedia.org/wiki/Black%E2%80%93Scholes_model#Extensions_of_the_model&quot; rel=&quot;nofollow noreferrer&quot;&gt;extensions with dividend-paying stocks&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="20454" LastActivityDate="2017-06-14T13:21:29.907" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34698" PostTypeId="2" ParentId="34684" CreationDate="2017-06-14T13:30:38.027" Score="0" Body="&lt;p&gt;$$ E[X^2] = p[ln(1+f)]^2 + q[ln(1-f)]^2 $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the standard way to compute the expectation of $X^2$, since in this case $X =\ln(1+Y_i f)$ has only two possible values: $\ln(1+f)$ with probability $p$ and $\ln(1-f)$ with probability q.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it is quite a straightforward calculation. &lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2017-06-14T13:30:38.027" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34700" PostTypeId="1" CreationDate="2017-06-14T16:16:50.350" Score="10" ViewCount="5068" Body="&lt;p&gt;Usually after showing that discounted stock price process is martingale under the risk-neutral measure, most authors say that this implies that the discounted derivative price process is a martingale as well. But I have difficulties to see how the former implies the latter. Generally a function of a martingale is not a martingale. Could anyone put some more light on this?&lt;/p&gt;&#xA;" OwnerUserId="28379" LastActivityDate="2019-03-31T13:39:42.737" Title="Why discounted derivative price is a martingale?" Tags="&lt;derivatives&gt;&lt;risk-neutral-measure&gt;&lt;martingale&gt;" AnswerCount="3" CommentCount="4" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="34703" PostTypeId="1" CreationDate="2017-06-14T17:01:44.260" Score="0" ViewCount="167" Body="&lt;p&gt;Let's say we have an option whose payoff is path dependent (let's say it's asian option with observations every month). Then why these are usually priced with local vol instead of sampling from implied distributions corresponding to consecutive expiries spaced out monthly?&lt;/p&gt;&#xA;" OwnerUserId="28381" LastEditorUserId="19887" LastEditDate="2017-06-15T08:35:32.297" LastActivityDate="2017-06-15T08:48:59.993" Title="Why/When local volatility is preferred over implied distribution sampling?" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;risk-neutral-measure&gt;&lt;distribution&gt;&lt;local-volatility&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34704" PostTypeId="1" CreationDate="2017-06-14T17:32:17.230" Score="1" ViewCount="55" Body="&lt;p&gt;I have been working through Thorp's &lt;a href=&quot;http://www.eecs.harvard.edu/cs286r/courses/fall12/papers/Thorpe_KellyCriterion2007.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;paper&lt;/a&gt;, and with some guidance have got as far as page 20, but I am now stuck with Thorp's result in Ex 6.2 (on that page) where I cannot get the result for $Cor(X_1, X_2)$, so if anyone is able to show the derivation of this it would be much appreciated. Thanks&lt;/p&gt;&#xA;" OwnerUserId="28349" LastEditorUserId="28349" LastEditDate="2017-06-14T19:18:35.760" LastActivityDate="2017-06-15T12:33:37.267" Title="Thorp's var caclulation" Tags="&lt;finance-mathematics&gt;&lt;statistical-finance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34705" PostTypeId="2" ParentId="34700" CreationDate="2017-06-14T18:25:38.007" Score="7" Body="&lt;p&gt;Under a Black-Scholes framework, the dynamics of the stock price under the risk-neutral measure $\mathbb{Q}$ are given by ...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ S_t = r S_tdt +\sigma S_tdW^{\mathbb{Q}}_t $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;... and those of the risk-free bond by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;dB_t = rB_tdt&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us define the derivative value as $V(t,S_t)$, which only depends on the time $t$ and the stock price $S_t$. For notational clarity we will also write $V_t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because the value of the derivative only depends on time and stock price, we can form a portfolio made up of $w_S(t)$ shares of stocks and $w_B(t)$ bonds which &lt;em&gt;replicates&lt;/em&gt; the derivative's payoff. Because the portfolio replicates the payoff, by no arbitrage both the derivative and the portfolio must have the same value for all $t$ between $0$ and the derivative's maturity $T$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ V_t = w_S(t)S_t+w_B(t)B_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This portfolio needs to be &lt;em&gt;self-financing&lt;/em&gt;, meaning that the net impact of changes in the allocation $w(t)=(w_S(t),w_B(t))$ must be equal to $0$ $-$ &lt;em&gt;i.e.&lt;/em&gt; no cash injections into or withdrawals from the portfolio:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dV_t = w_S(t)dS_t+w_B(t)dB_t \quad (1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To ensure property $(1)$ is verified, a trivial strategy is to choose:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ w_B(t) = \frac{V_t - w_S(t)S_t}{B_t} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed, at each time step you rebalance your portfolio by buying (selling) $w_S(t+dt)-w_S(t)$ shares of stock and selling (buying) bonds in a such a quantity that makes the derivative value and the portfolio value match.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We end up for the following dynamics for the derivative's value:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dV_t = w_S(t)dS_t + r(V_t-w_S(t)S_t)dt \quad (2)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, consider the dynamics of the discounted stock price. By Ito's lemma:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;d\left(e^{-rt}S_t\right) &amp;amp; = -re^{-rt}S_tdt + e^{-rt}dS_t &#xA;\\[9pt]&#xA;&amp;amp; = e^{-rt}\sigma S_tdW_t^{\mathbb{Q}}&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, as stated in your question, the discounted stock price is a martingale$^1$ under $\mathbb{Q}$. Let us now derive the dynamics of the &lt;em&gt;discounted derivative value process&lt;/em&gt; with Ito's lemma again:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;d\left(e^{-rt}V_t\right) = -re^{-rt}V_tdt + e^{-rt}dV_t \quad (3)&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, combining $(2)$ and $(3)$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;d\left(e^{-rt}V_t\right) &amp;amp; = -re^{-rt}V_tdt + w_S(t)e^{-rt}dS_t + r(V_t-w_S(t)S_t)e^{-rt}dt&#xA;\\[9pt]&#xA;&amp;amp; = w_S(t)e^{-rt}dS_t - w_S(t)e^{-rt}rS_tdt&#xA;\\[9pt]&#xA;&amp;amp; = w_S(t)e^{-rt}rS_tdt + w_S(t)e^{-rt}\sigma S_tdW_t^{\mathbb{Q}} - w_S(t)e^{-rt}rS_tdt&#xA;\\[9pt]&#xA;&amp;amp; = w_S(t)e^{-rt}\sigma S_tdW_t^{\mathbb{Q}}&#xA;\\[9pt]&#xA;&amp;amp; = w_S(t) \, d\left(e^{-rt}S_t\right)\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The dynamics of the discounted derivative value are drift-less $-$ &lt;em&gt;i.e.&lt;/em&gt; we only have a term in $dW_t^{\mathbb{Q}}$ left $-$ hence the discounted derivative price is a martingale under the risk-neutral measure$^1$.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&lt;strong&gt;Technical point&lt;/strong&gt; $1$: an Ito process $X_t$ with $0$ drift is strictly speaking a&lt;/em&gt; local &lt;em&gt;martingale. A further technical condition is required to ensure that the process is also a martingale: one such possible condition is that the expected quadratic variation of the process must be finite. In general, the local martingales we work with in financial engineering verify this type of condition so we do not bother proving that the local martingale is also a martingale.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Here, in the case of the discounted stock price:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbb{E}\left[[S,S]_t\right] = \mathbb{E}\left[\int_0^t\sigma^2e^{-2ru}S_u^2du\right] &amp;lt; \infty$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;We have:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;\mathbb{E}\left[\int_0^t\sigma^2e^{-2ru}S_u^2du\right] &amp;amp; = \sigma^2S_0^2 \mathbb{E}\left[\int_0^te^{-2ru}e^{2\left((r-\frac{\sigma^2}{2})u + \sigma W_u\right)}du\right] &#xA;\\[12pt]&#xA;&amp;amp; = \sigma^2S_0^2 \int_0^te^{-\sigma^2u} \mathbb{E}\left[e^{2\sigma W_u}\right]du&#xA;\\[12pt]&#xA;&amp;amp; = \sigma^2S_0^2 \int_0^te^{-\sigma^2u} e^{2\sigma^2 u}du&#xA;\\[12pt]&#xA;&amp;amp; = \sigma^2S_0^2 \int_0^te^{\sigma^2u}du&#xA;\\[12pt]&#xA;&amp;amp; = S_0^2 \left(e^{\sigma^2t}-1 \right)&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Which is finite for all $t$. For the derivative:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbb{E}\left[\int_0^t\left(w_S(u)\sigma e^{-ru}S_u\right)^2du\right] &amp;lt; \infty$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Conditions over $w_S(t)$ are needed to ensure the expectation is finite. In the case of a European call option, we would have:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;&amp;amp; w_S(t) = -\frac{\partial V}{\partial S}(t,S_t) = -\mathcal{N}(d_1) &amp;lt; 1&#xA;\\[6pt]&#xA;&amp;amp; \Rightarrow 0&amp;lt; w_S(t)^2 &amp;lt; 1&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Thus the European call price is also a martingale:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbb{E}\left[\int_0^t\left(w_S(u)\sigma e^{-ru}S_u\right)^2du\right] &amp;lt; \mathbb{E}\left[\int_0^t\left(\sigma e^{-ru}S_u\right)^2du\right] &amp;lt; \infty$$&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-06-18T23:34:35.567" LastActivityDate="2017-06-18T23:34:35.567" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34706" PostTypeId="2" ParentId="34704" CreationDate="2017-06-14T19:34:59.207" Score="1" Body="&lt;p&gt;I have found the answer. And it is a very dull one:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a typo in the paper, the first $Cor(X_1, X_2)$ is actually meant to be $Cov(X_1, X_2)$. There is a lesson here, and that is to read ahead before trying to replicate the results in a paper.&lt;/p&gt;&#xA;" OwnerUserId="28349" LastEditorUserId="26595" LastEditDate="2017-06-15T12:33:37.267" LastActivityDate="2017-06-15T12:33:37.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34707" PostTypeId="2" ParentId="34700" CreationDate="2017-06-15T00:25:34.963" Score="5" Body="&lt;p&gt;We decree that $D_t$ has a certain process which makes it a martingale. In particular, &#xA;we let&#xA;$$&#xA;D_t = \mathbb{E} ( D_T \, | \, \mathcal{F}_t)&#xA;$$&#xA;This is trivially a martingale by the tower law. &#xA;Since the discounted stock price and discounted bond price are martingales, we have made everything a martingale and that ensures that there is no arbitrage in the martingale measure. However, the real world measure is equivalent to it so there are none there either.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastEditorUserId="1809" LastEditDate="2017-06-17T00:37:13.790" LastActivityDate="2017-06-17T00:37:13.790" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="34708" PostTypeId="1" AcceptedAnswerId="34745" CreationDate="2017-06-15T08:36:30.893" Score="0" ViewCount="61" Body="&lt;p&gt;I'm just curious if it's possible to use forward dynamics and work out the pricing formulas. Does anyone know if there's a reference (paper/url) I can look at?&lt;/p&gt;&#xA;" OwnerUserId="15771" LastActivityDate="2017-06-17T15:12:07.883" Title="Heston with Forward Dynamics" Tags="&lt;option-pricing&gt;&lt;heston&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34709" PostTypeId="2" ParentId="34703" CreationDate="2017-06-15T08:48:59.993" Score="1" Body="&lt;p&gt;Consider an Asian option on a traded asset $S$ with payout $$ (A - K)^+ = \left( \frac{1}{N} \sum_{i=1}^N S(t_i) - K \right)^+ $$&#xA;To sample the arithmetic mean $A$ you need to sample from the joint distribution of $S(t_1),\dots,S(t_N)$. Thing is, individually sampling from the corresponding marginals will not the same as sampling from the joint because&#xA;$$ p(s_1, \dots, s_N) \ne p(s_1) \dots p(s_N) $$&#xA;since&#xA;$$ p(s_1, \dots, s_N) = p(s_1) p(s_2 \vert s_1) \dots p(s_N \vert s_1, \dots, s_{N-1} ) $$&#xA;a conditional behaviour (path-dependence) which you implicitly construct when running a Monte Carlo simulation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same goes for pricing a European basket option of expiry $T$ with payout&#xA;$$  (B - K)^+ = \left( \sum_{i=1}^N w_i S_i(T) - K \right)^+  $$&#xA;in the sense that in order to sample the terminal basket value $B$ you need to sample from the joint distribution of the terminal individual asset prices $S_1(T),\dots,S_N(T)$. Sampling from the individual marginals is not enough, but you could come up with a copula to construct the joint distribution from the marginals (the copula function reflecting the choice of dependence structure you would like to impose between the individual terminal asset prices).&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2017-06-15T08:48:59.993" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="34711" PostTypeId="1" AcceptedAnswerId="34721" CreationDate="2017-06-15T10:46:31.230" Score="0" ViewCount="273" Body="&lt;p&gt;I have been looking at &lt;code&gt;CVaR&lt;/code&gt; function in the &lt;code&gt;PerformanceAnalytics&lt;/code&gt; package as an option to use in portfolio optimization. However, I cannot figure out the reason behind discrepancy that the function is giving for my test portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a reproducable example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(PerformanceAnalytics)&#xA;&#xA;set.seed(1234)&#xA;a = rnorm(n = 10, mean = 0, sd = 0.02)&#xA;b = rnorm(n = 10, mean = 0, sd = 0.03)&#xA;&#xA;wght = c(0.4, 0.6)  ## assign weights&#xA;&#xA;dt = cbind(a, b)&#xA;&#xA;startDate = as.Date(&quot;2016-01-01&quot;) &#xA;h = seq(1:10)&#xA;myDates = startDate + h&#xA;&#xA;dt = as.data.frame(dt)  ## dataframe of single assets&#xA;rownames(dt) = myDates&#xA;&#xA;tmp = sweep(dt, 2, wght, `*`)&#xA;&#xA;P = as.data.frame(rowSums(tmp))  ## resultant portfolio&#xA;colnames(P) = &quot;Portfolio&quot;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My issue arises here:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;MES1 = ES(dt, p = 0.95, method = &quot;modified&quot;, portfolio_method = &quot;component&quot;,&#xA;       weights = wght)&#xA;MES1$MES[1]&#xA;MES2 = ES(P, p = 0.95, method = &quot;modified&quot;, portfolio_method = &quot;component&quot;,&#xA;      weights = 1)&#xA;MES2$MES[1]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get the same results of &lt;code&gt;CVaR&lt;/code&gt; for the portfolio in both cases. However, when I do not mention &lt;code&gt;portfolio_method = &quot;component&quot;&lt;/code&gt; and &lt;code&gt;weights = 1&lt;/code&gt; should I not get the same result?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ES(P, p = 0.95, method = &quot;modified&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here the function returns completely different result. I am currently inspecting the code on the authors' &lt;a href=&quot;https://github.com/cran/PerformanceAnalytics/blob/4c10886157a80dff2a25b28bb2ee83c1ab857639/R/ES.R&quot; rel=&quot;nofollow noreferrer&quot;&gt;page&lt;/a&gt;, but would also like to know the views of those who went through this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some background information regarding the methodology and implementation can be found &lt;a href=&quot;https://lirias.kuleuven.be/bitstream/123456789/387170/1/jor_boudt_journalofrisk.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;https://quantstrattrader.wordpress.com/2016/07/12/an-introoduction-to-portfolio-component-value-at-risk/&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="19096" LastActivityDate="2017-06-15T23:28:07.260" Title="Portfolio risk budgeting using CVaR function from PerformanceAnalytics in R" Tags="&lt;programming&gt;&lt;portfolio-management&gt;&lt;risk-management&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34713" PostTypeId="1" CreationDate="2017-06-15T13:04:27.720" Score="2" ViewCount="60" Body="&lt;p&gt;I have a sample covariance matrix that is non positive-semi definite (due to missing data points). I am looking at a number of techniques to 'fix' my covariance matrix and make it positive semi-definite so that I can use PCA, Markowitz portfolio optimisation, etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering, is there a way to check the quality of my correction to the covariance matrix? You'd want to keep as much of the original covariance as possible, but at the same time ensure it was positive-semi definite. Is there some potential metric based on that?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas are well appreciated.&lt;/p&gt;&#xA;" OwnerUserId="26223" LastActivityDate="2017-06-15T13:04:27.720" Title="Covariance Matrix: Calculating Error" Tags="&lt;modern-portfolio-theory&gt;&lt;pca&gt;&lt;covariance-matrix&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="0" ClosedDate="2017-06-16T13:21:42.287" ContentLicense="CC BY-SA 3.0" />
  <row Id="34715" PostTypeId="1" CreationDate="2017-06-15T13:57:04.690" Score="6" ViewCount="2250" Body="&lt;p&gt;I am currently writing my thesis about the lack of volatility / changing market structure we see nowadays on the financial market.  I believe an important factor in this development is the delta-hedging of the market makers. I saw numerous articles about so-called gamma imbalance from Mr. Kolanovic on ZeroHedge. &#xA;For example: see &lt;a href=&quot;http://www.zerohedge.com/news/2017-03-21/kolanovic-today-gamma-imbalance-shifted-toward-puts-first-time-5-months&quot; rel=&quot;noreferrer&quot;&gt;http://www.zerohedge.com/news/2017-03-21/kolanovic-today-gamma-imbalance-shifted-toward-puts-first-time-5-months&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to reconstruct this graph for the Eurostoxx50 in order to backtest it and get supportive data for my thesis. I was hoping you could give me some feedback about the methodology. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Methodology (using Bloomberg):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I get the option series for the next upcoming expiration for SX5E options with a moneyness between 0.75 and 1.25. &lt;/li&gt;&#xA;&lt;li&gt;Next I get the gamma's of each individual expiration &lt;/li&gt;&#xA;&lt;li&gt;I calculate the dollar gamma of each option serie with the following formula: &lt;/li&gt;&#xA;&lt;li&gt;Open interest * 100 * gamma * underlying spot (SX5E) ^ 2 / 100.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Next I calculate the gamma imbalance as the difference of each option series between put dollar gamma and call dollar gamma. I do this because the graph in the first link displays &quot;SPX P-C imbalance ($Bn). So I subtract the call dollar gamma from the put gamma dollar. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next I do this for all months expiring after the upcoming expiration month. Gamma decreases as time to expiration increases, so the two different gamma imbalances fit in the same chart.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you give me maybe feedback about this methodology? Is this correct or do you see something incorrect?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More importantly, how can I translate this dollar gamma imbalance to the number of shares that need to be bought / sold as a result of the market-makers option exposure? Is this simply the dollar gamma divided by the price of the underlying? The website (&lt;a href=&quot;https://squeezemetrics.com/monitor/docs#gex&quot; rel=&quot;noreferrer&quot;&gt;https://squeezemetrics.com/monitor/docs#gex&lt;/a&gt;) gives some information about the procedure, but no formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next, I would like to know if my understanding of this whole gamma imbalance is correct&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;Following Friday's option expiry, the gamma imbalance shifted towards puts for the first time in about 5 months and the market was 'free' to move again,&quot; said Kolanovic. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, in my understanding Mr. Kolanovic assumes that market makers are long delta and short gamma in this case right? If index goes down, puts become more in-the-money and get a higher delta. Long put option buy insurance and they have little incentive to cover when the market drops. However, short put holders (the market makers) are forced to sell shares to become delta neutral again. So this would increase the magnitude of the initial downwards move. If the gamma imbalance shifts towards call, then dips will be bought and volatility will be reduced as market makers delta-hedge their position by buying low and selling high. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How viable is the assumption that markets-makers are always short gamma? Or how is this actually measurable?&lt;/p&gt;&#xA;" OwnerUserId="28390" LastEditorUserId="24222" LastEditDate="2017-06-15T16:33:40.737" LastActivityDate="2017-11-01T17:35:34.097" Title="Gamma Imbalance / Exposure" Tags="&lt;market-microstructure&gt;&lt;delta-hedging&gt;&lt;gamma&gt;&lt;delta-neutral&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34718" PostTypeId="2" ParentId="30602" CreationDate="2017-06-15T20:02:37.400" Score="3" Body="&lt;p&gt;It's fine to put any excess return on the left hand side of the regression.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Definition of excess return&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The difference between two returns is called an &lt;em&gt;excess return&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An excess return is the result of going long one portfolio return and short another (such as risk risk free rate). An excess return is a payoff that can be achieved at zero cost (in some idealized, somewhat unrealistic world). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $R^f$ be the 1 month risk free rate, let $R^A$ be the return of Apple, and let $R^G$ be the return of Google. Examples of excess returns:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$R^A_t - R^f_t$ is an excess return&lt;/li&gt;&#xA;&lt;li&gt;$R^A_t - R^G_t$ is an excess return&lt;/li&gt;&#xA;&lt;li&gt;$2 \left( R^A_t - R^G_t \right)$ is an excess return&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(For the mathematically inclined, the space of excess returns is a &lt;a href=&quot;https://en.wikipedia.org/wiki/Vector_space&quot; rel=&quot;nofollow noreferrer&quot;&gt;vector space&lt;/a&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Any excess return can go on the left hand side of a regression in factor models&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;In the Fama-French five factor model and other factor models, what you place on the left hand side of the regression is an &lt;em&gt;excess return&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ R^x_t = \alpha + \beta_1 \mathit{RMRF}_{t} + \beta_2 \mathit{SMB}_{t} + \beta_3 \mathit{HML}_{t}  + \beta_4 \mathit{RMW}_{t} + \beta_5 \mathit{CMA}_{t}  + \epsilon_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's fine to put any excess return on the left hand side. You could put the return of Apple minus the 1 month risk free rate on the left hand side, but you could also put the return of Apple minus the return of the Dominos pizza.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;A simple argument to justify this&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;If model A (below) is well specified:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ R^A_t - R^f_t = \alpha_A + \beta_{A,1} \mathit{RMRF}_{t} + \beta_{A,2} \mathit{SMB}_{t} + \beta_{A,3} \mathit{HML}_{t}  + \epsilon_{A,t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And model B is well specified:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ R^B_t - R^f_t = \alpha_B + \beta_{B,1} \mathit{RMRF}_{t} + \beta_{B,2} \mathit{SMB}_{t} + \beta_{B,3} \mathit{HML}_{t}  + \epsilon_{B,t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you can take the difference of the two equations and you get the a well specified regression model:&#xA;$$ R^B_t - R^A_t = \alpha + \beta_{1} \mathit{RMRF}_{t} + \beta_{2} \mathit{SMB}_{t} + \beta_{3} \mathit{HML}_{t}  + \epsilon_{t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $\alpha = \alpha_A - \alpha_B$, $\beta_1 = \beta_{A,1} - \beta_{B,1}$ etc...&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-06-15T20:23:12.137" LastActivityDate="2017-06-15T20:23:12.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34719" PostTypeId="1" CreationDate="2017-06-15T20:10:18.860" Score="1" ViewCount="139" Body="&lt;p&gt;I'm working on a project which is requiring me to test Binomial option pricing on real data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far I have just been working with test data and my option pricing method works fine.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The issue I'm faced with now, is how to test my method on real data. The problem I have is that I have looked at historical prices for the assets that I'm trying to price the option of, to determine the volatility. I've then used Monte Carlo to price the option. Imagine that we find the volatility to be &quot;X&quot; and that corresponds to u = 1.1 and d = (1/u). Our optimal replication method will tell us how to delta hedge this option, &lt;strong&gt;but what if going into the future the actual underlying does not take on one of the values as predicted by the binomial model&lt;/strong&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the following example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;     $110&#xA;   /&#xA;  /&#xA;$100&#xA; \&#xA;  \&#xA;   \&#xA;     $90.90&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;What if the value at t=1 is actually \$120? Or if it remains at \$100? Should we just choose the one that is closest to the value? And if so, what do we do when the value remains the same? I could implement the trinomial case?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="28396" LastActivityDate="2017-06-15T20:10:18.860" Title="Binomial Option Pricing - Hedging" Tags="&lt;option-pricing&gt;&lt;binomial-tree&gt;&lt;european-options&gt;&lt;real-options&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34720" PostTypeId="2" ParentId="31740" CreationDate="2017-06-15T21:09:40.520" Score="2" Body="&lt;p&gt;Just to provide some background on why mean-variance is so sensitive to estimation error, consider an unconstrained mean-variance optimization. The optimal weights are given by $$w=\frac{1}{\lambda}\Sigma^{-1}\mu&#xA; $$&#xA;where $\lambda$ is a risk aversion coefficient, $\Sigma$ is the covariance matrix, and $\mu$ is a vector of returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can examine the sensitivity of the weights with respect to the parameters, by calculating the partial derivatives. The most relevant is&#xA;$$\frac{\partial w}{\partial\mu}=\frac{1}{\lambda}\Sigma^{-1}&#xA; $$&#xA;The practical nature of the covariance matrix is that it will typically have very high values when inverted. As a result, this means that a small change in $\mu_{i}$ will have a large impact on all $w$. One can do the same analysis with variances and covariances, but it is less of an issue. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem of estimation error is that classical mean-variance optimization is very sensitive to return forecasts. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question then is why focus so much on estimation error when the problem is the return models. In some sense, shrinkage models and random matrix theory are actually an attempt to create better models. They are creating models in recognition that classical mean-variance is susceptible to estimation error. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question suggests non-normal models. While there is value in non-normal models, they are not a solution for estimation error. If the techniques that reduce the impact of estimation error rely too heavily on normal distributions, then tweak the assumptions and see if you can make them work with non-normal distributions.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most importantly: if you have a hammer, try not to hammer your finger. &lt;/p&gt;&#xA;" OwnerUserId="2379" LastActivityDate="2017-06-15T21:09:40.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34721" PostTypeId="2" ParentId="34711" CreationDate="2017-06-15T23:28:07.260" Score="1" Body="&lt;p&gt;It looks like there's a bit of a problem with the code when the option &lt;code&gt;portfolio_method&lt;/code&gt; = &quot;single&quot; is used.   In the code below, your three calculations with &lt;code&gt;ES&lt;/code&gt; are repeated using &lt;code&gt;method&lt;/code&gt;=&quot;gaussian&quot; and then compared with expected shortfall calcuated directly from the expression using mu and sigma.  I've done the direct calculation with &lt;code&gt;dt&lt;/code&gt; using the &lt;code&gt;cov()&lt;/code&gt; function and with &lt;code&gt;P&lt;/code&gt; using the &lt;code&gt;sd()&lt;/code&gt; function.    The resuls of all calcuations should be identical.  Similar to your case, all agree except the &lt;code&gt;ES(P, portfolio_method = &quot;single&quot;)&lt;/code&gt; calculation.   &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking into the &lt;code&gt;ES&lt;/code&gt; code, the different portfolio_method options use different code to calculate sigma and higher moments.  In particular, for gaussian calculations, &lt;code&gt;ES&lt;/code&gt; calculates sigma using &lt;code&gt;cov()&lt;/code&gt; for &lt;code&gt;portfolio_method = &quot;component&quot;&lt;/code&gt; and a general higher moment calculation function &lt;code&gt;centeredmoment()&lt;/code&gt; for &lt;code&gt;portfolio_method = &quot;single&quot;.&lt;/code&gt;  The problem is that for &lt;code&gt;n&lt;/code&gt; = number of rows in the return vector, &lt;code&gt;cov()&lt;/code&gt; and &lt;code&gt;sd()&lt;/code&gt; normalize the moment calculations using &lt;code&gt;1/(n-1)&lt;/code&gt; while the calculations using &lt;code&gt;centeredmoment()&lt;/code&gt; use &lt;code&gt;1/n&lt;/code&gt;.    I've demonstrated this in the code below where the calculation for &lt;code&gt;ES_P_modied_sigma&lt;/code&gt; rescales sigma to use the &lt;code&gt;1/n&lt;/code&gt; normalization and gets the same result as &lt;code&gt;ES(P, portfolio_method =&quot;single&quot;)&lt;/code&gt; for the Gausian distributions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The discrepancy is more apparent in your test calculation since you're using a small number of rows.    As the number of rows increases, the descrepancy becomes much smaller.  Nevertheless, it's something that should be corrected.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#&#xA;#  repeat ES calculations using Gaussian distributions&#xA;#  &#xA;  MES1g = ES(dt, p = 0.95, method = &quot;gaussian&quot;, portfolio_method = &quot;component&quot;,&#xA;            weights = wght)&#xA;  MES2g = ES(P, p = 0.95, method = &quot;gaussian&quot;, portfolio_method = &quot;component&quot;,&#xA;            weights = 1)&#xA;  MES3g &amp;lt;- ES(P, p = 0.95, method = &quot;gaussian&quot;)&#xA;#&#xA;#  calculate Gaussian shortfalls directly using dt and wght and then P &#xA;#&#xA;  prob &amp;lt;- .05&#xA;  mean_dt &amp;lt;-  apply(dt,2,mean)%*%wght&#xA;  sigma_dt &amp;lt;-  sqrt(t(wght)%*%cov(dt)%*%wght)&#xA;  ES_dt &amp;lt;- -mean_dt + dnorm(qnorm(prob))*sigma_dt/prob&#xA;&#xA;  mean_P &amp;lt;- mean(P[,1])&#xA;  sigma_P &amp;lt;- sd(P[,1])&#xA;  ES_P &amp;lt;- -mean_P + dnorm(qnorm(prob))*sigma_P/prob &#xA;#&#xA;# redo calculation with P using sigma scaled by sqrt((nrow(P) - 1)/nrow(P))&#xA;#&#xA;  ES_P_modied_sigma &amp;lt;- -mean_P + dnorm(qnorm(prob))*sigma_P/prob*(sqrt((nrow(P)-1)/nrow(P))) &#xA;#&#xA;# compare all results&#xA;# note that result ES_P_modified_sigma reproduces MES3g showing problem with normalization for sigma&#xA;# &#xA;  c(MES1g$ES, MES2g$ES, MES3g)&#xA;  c(ES_dt, ES_P, ES_P_modied_sigma)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="11889" LastActivityDate="2017-06-15T23:28:07.260" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34722" PostTypeId="1" AcceptedAnswerId="34723" CreationDate="2017-06-16T01:15:17.787" Score="3" ViewCount="387" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Assume $S_0(t)=\exp(\int_0^t r(s) ds)$. Then $\mathbb{Q}\sim \mathbb&#xA; P$ is a martingale measure $\iff$ every asset price process $S_i$ has&#xA;  price dynamics under $\mathbb Q$ of the form &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$dS_i(t)=r(t)S_i(t)dt+dM_i(t)$,&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;where $M_i$ is a $\mathbb Q$ - martingale.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I read the following proof for this theorem:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Let $\tilde{S}_i(t)=\dfrac{S_i(t)}{S_0(t)}$.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$\dfrac{1}{S_0(t)}=\exp(-\int_0^t r(s) ds)$&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Hence&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$d\left(\dfrac{1}{S_0(t)}\right)=-r(t)\dfrac{1}{S_0(t)}dt.$ &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;By Itó's product rule&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$d\left(\dfrac{S_i(t)}{S_0(t)}\right)=-r(t)S_i(t)\dfrac{1}{S_0(t)}dt+\dfrac{1}{S_0(t)}dS_i(t)+d\langle&#xA; S_i,\dfrac{1}{S_0}\rangle_t=&#xA; -r(t)\tilde{S}_i(t)dt+\dfrac{1}{S_0(t)}dS_i(t).$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I understand every mathematical step of the proof but why does this proof the theorem? Can anyone explain?&lt;/p&gt;&#xA;" OwnerUserId="28398" LastActivityDate="2017-06-16T13:36:52.300" Title="Equivalent martingale measure price dynamics" Tags="&lt;black-scholes&gt;&lt;arbitrage&gt;&lt;risk-neutral-measure&gt;&lt;finance-mathematics&gt;&lt;martingale&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34723" PostTypeId="2" ParentId="34722" CreationDate="2017-06-16T08:40:11.957" Score="2" Body="&lt;p&gt;As it stands, the assertion &quot;$\Bbb{Q} \sim \Bbb{P}$ is a martingale measure&quot; is not complete. It omits to tell you what process(es) should emerge as martingale(s) under $\Bbb{Q}$. These processes are $\tilde{S}_i(t) = S_i(t)/S_0(t)$ for any traded asset $S_i$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That being said, starting from the last equation:&#xA;$$d\left(\dfrac{S_i(t)}{S_0(t)}\right)=&#xA; -r(t)\tilde{S}_i(t)dt+\dfrac{1}{S_0(t)}dS_i(t).$$&#xA;For $\tilde{S}_i(t)=S_i(t)/S_0(t)$ to emerge as a $\Bbb{Q}$ martingale, you should have,&#xA;$$ d\tilde{S}_i(t) = -r(t)\tilde{S}_i(t)dt+\dfrac{1}{S_0(t)}dS_i(t) = d M_i(t) $$&#xA;with $M_i(t)$ a $\Bbb{Q}$-martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Isolating $dS_i(t)$ in the second equality gives&#xA;\begin{align}&#xA; dS_i(t) &amp;amp;= r(t) \tilde{S}_i (t) S_0(t) dt + S_0(t) d M_i(t) \\&#xA;         &amp;amp;= r(t) S_i(t) dt + d M^*_i(t) \\&#xA;\end{align}&#xA;assuming usual integrability conditions hold such that&#xA;$$ M^*_i(t) = \int_0^t S_0(u) dM_i(u) $$&#xA;is a well-defined Itô-integral and hence also a martingale (see hints &lt;a href=&quot;https://quant.stackexchange.com/questions/15795/why-is-this-stochastic-integral-a-martingale&quot;&gt;here&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2017-06-16T13:36:52.300" LastActivityDate="2017-06-16T13:36:52.300" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34724" PostTypeId="2" ParentId="34722" CreationDate="2017-06-16T08:48:32.987" Score="1" Body="&lt;p&gt;What is the definition of Equivalent Martingale Measure? It is a measure $\mathbb{Q} \sim \mathbb{P}$ s.t. $\frac{S_i}{S_0}$ is martingale under $\mathbb{Q}$. In the last step of your prove assume $S_i$ has some drift $a$ and volatility $b$, i.e. $dS_i=adt+bdZ^\mathbb{Q}$ and substitute to obtain:&#xA;$$d\left(\frac{S_i}{S_0}\right)=-r\left(\frac{S_i}{S_0}\right)dt +\left(\frac{1}{S_0}\right)dS_i=-r\left(\frac{S_i}{S_0}\right)dt +\left(\frac{1}{S_0}\right)(adt+bdZ^\mathbb{Q})$$ To guarante that the process is indeed a martingale notice that:&#xA;$$d\left(\frac{S_i}{S_0}\right)=\left(-r\frac{S_i}{S_0}+\frac{a}{S_0}\right)dt+ \text{martingale part} $$ Therefore set the drift equal to zero and obtain $a=rS_i$ as requested.&lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2017-06-16T08:48:32.987" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="34727" PostTypeId="1" AcceptedAnswerId="42951" CreationDate="2017-06-16T10:23:37.437" Score="4" ViewCount="176" Body="&lt;p&gt;I'm quoting from Peter Jäckel's book &quot;Monte Carlo Methods in Finance&quot;, page 96:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;...For low-discrepancy numbers, the situation is different. Sobol numbers and other number generators based on integer arithmetic module two, by construction provide additional equidistribution properties whenever the number of iteration is $N=2^n-1$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What's the mathematical incentive behind this choice of iterations?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does the same apply to Halton sequences?&lt;/p&gt;&#xA;" OwnerUserId="6499" LastEditorUserId="24222" LastEditDate="2017-06-16T12:06:58.827" LastActivityDate="2018-12-07T14:15:21.730" Title="Optimal number of iterations for quasi-Monte Carlo" Tags="&lt;monte-carlo&gt;&lt;random-variables&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34728" PostTypeId="1" AcceptedAnswerId="34729" CreationDate="2017-06-16T11:00:12.623" Score="0" ViewCount="247" Body="&lt;p&gt;Two of the conditions for an asset price to have a lognormal distribution are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The volatility of the asset is constant.&lt;/li&gt;&#xA;&lt;li&gt;The price of the asset changes smoothly with no jumps.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In practice, neither of these conditions is satisfied for an exchange rate, but I don't understand why these reason determine the form of a &quot;smile&quot; for implied volatility?&lt;/p&gt;&#xA;" OwnerUserId="27078" LastEditorUserId="19645" LastEditDate="2021-05-05T08:43:54.000" LastActivityDate="2021-05-05T08:43:54.000" Title="Why implicit volatility has the shape of a &quot;smile&quot;?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;volatility-smile&gt;&lt;lognormal&gt;" AnswerCount="2" CommentCount="5" ClosedDate="2017-06-16T13:21:24.510" ContentLicense="CC BY-SA 3.0" />
  <row Id="34729" PostTypeId="2" ParentId="34728" CreationDate="2017-06-16T12:33:44.107" Score="1" Body="&lt;p&gt;There are plenty of theories but no one is 100% certain. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Theory 1:&lt;/strong&gt;&#xA;Options which have strike prices increasingly far away from the spot price are including extreme movements in the market such as black swan events into the price. When an event like this happens there is a sharp change in price of the option and extreme change in volatility. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Theory 2:&lt;/strong&gt;&#xA;Investors may have the same demand in terms of expiration date but not strike price. Investors tend to prefer in-the-money and out-of-the-money options over ATM. Since demand pushes up the prices of options, implied volatility also becomes higher.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Theory 3:&lt;/strong&gt;&#xA;Similar to 1, implied volatility can include jump predictions, but this theory includes all types of jumps, small and medium ones as well as large ones. These jumps are accompanied by large kurtosis as stated in the link @LocalVolatility commented. &lt;/p&gt;&#xA;" OwnerUserId="20926" LastActivityDate="2017-06-16T12:33:44.107" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34730" PostTypeId="2" ParentId="34728" CreationDate="2017-06-16T13:15:48.047" Score="4" Body="&lt;p&gt;The smile is there exactly because the model is wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason it's used though (despite being wrong) is that it provides a convenient space to look at the underlying - the vol*&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The (undiscounted) value of an option is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \int_0^\infty \mathrm{PDF}(s) (s-K)^+ \mathrm{d}s $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\mathrm{PDF}(x)$ is the real probability distribution of the underlying. This is model independent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under BS, the value is the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \int_0^\infty \mathrm{PDF_{LN}}(F,\sigma)(s) (s-K)^+ \mathrm{d}s $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\mathrm{PDF_{LN}}(F,\sigma)$ is the pdf of a lognormal variable with an expected value of $F$ and vol of $\sigma$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So now, we just need to make them match - and we have one parameter to solve for - $\sigma$. This gives us the BS vol. If the distribution truly were lognormal, you'd obtain the same vol everywhere. Since it's not, you get a changing vol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;*BS vol.&lt;/p&gt;&#xA;" OwnerUserId="19663" LastActivityDate="2017-06-16T13:15:48.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34735" PostTypeId="1" AcceptedAnswerId="34791" CreationDate="2017-06-16T18:36:28.580" Score="4" ViewCount="175" Body="&lt;p&gt;What methodologies are there for determining how much money tracks an index such as the FTSE100? Are there public estimates? &lt;/p&gt;&#xA;" OwnerUserId="6661" LastActivityDate="2017-06-20T22:54:49.590" Title="How much money tracks the FTSE?" Tags="&lt;equities&gt;&lt;index&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34737" PostTypeId="1" CreationDate="2017-06-16T20:11:53.517" Score="0" ViewCount="231" Body="&lt;p&gt;In the text book on Risk Management by John Hull, The cost of liquidation is defined as one half of spread between bid price and ask price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.investopedia.com/articles/trading/11/understanding-liquidity-risk.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;Investopedia&lt;/a&gt; justifies the one half factor by saying that we are concerned with only the sell part of the trade. This is not convincing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I personally feel that The cost of liquidation should be plainly bid-ask spread without any factor. Can anyone please clarify. &lt;/p&gt;&#xA;" OwnerUserId="27273" LastEditorUserId="2299" LastEditDate="2017-06-17T17:23:02.263" LastActivityDate="2017-07-17T18:20:56.470" Title="Cost of liquidation" Tags="&lt;market-microstructure&gt;&lt;liquidity&gt;&lt;liquidity-risk&gt;" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="34741" PostTypeId="1" CreationDate="2017-06-17T04:56:22.960" Score="2" ViewCount="169" Body="&lt;p&gt;There are a number of challenges. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;It is usually unclear what the managers' benchmark index is. &lt;/li&gt;&#xA;&lt;li&gt;The index may have 500 - 3000 stocks, but the manager can only hold 20-50, so that will naturally create many &quot;active bets&quot;, but those may not really be &quot;bets&quot;, only oweing to the fact that he cannot hold every stock. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="5667" LastActivityDate="2018-03-18T18:28:48.123" Title="What is a good way to detect fund manager's active stock picks from his portfolio holdings?" Tags="&lt;hedge-fund&gt;&lt;mutual-fund&gt;&lt;funds&gt;&lt;quant-funds&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34742" PostTypeId="1" AcceptedAnswerId="34744" CreationDate="2017-06-17T10:59:04.490" Score="1" ViewCount="170" Body="&lt;p&gt;This is taken from Gatheral's book &quot;The Volatility Surface&quot;, where he tries to go from equation 2.3 to equation 2.4.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have the following PDE, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{\partial V}{\partial t}+\frac{1}{2}vS^2\frac{\partial ^2 V}{\partial S^2} + \rho\eta vS\frac{\partial ^2 V}{\partial S\partial v}+\frac{1}{2}\eta^2v\frac{\partial ^2 V}{\partial v^2} + rS\frac{\partial V}{\partial S}-rV-\lambda(v-\bar{v})\frac{\partial V}{\partial v} = 0&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By using a change of variables, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;x=\ln{\frac{Se^{r\tau}}{K}}, \tau = T-t&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;show that it reduces to &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;-\frac{\partial C}{\partial \tau}+\frac{1}{2}v\frac{\partial ^2 C}{\partial x^2} -\frac{1}{2}v\frac{\partial C}{\partial x} +\frac{1}{2}\eta^2v\frac{\partial ^2 C}{\partial v^2} + \rho\eta v\frac{\partial ^2 C}{\partial x\partial v} - \lambda(v-\bar{v})\frac{\partial V}{\partial v} = 0&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My working are as follows...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have $C(x,v,\tau)=V(Ke^{x-r\tau}, v, T-\tau)$. The partial derivatives are,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{aligned}&#xA;\frac{\partial V}{\partial t} &amp;amp;= \frac{\partial V}{\partial S}\frac{\partial S}{\partial t} + \frac{\partial V}{\partial t}\\&#xA;&amp;amp;=\frac{\partial V}{\partial x}\frac{\partial x}{\partial S}\frac{\partial S}{\partial \tau}\frac{\partial \tau}{\partial t}+\frac{\partial V}{\partial \tau}\frac{\partial \tau}{\partial t}\\&#xA;&amp;amp;=\frac{\partial V}{\partial x}\frac{1}{S}(-rS)(-1)-\frac{\partial V}{\partial \tau}\\&#xA;&amp;amp;= r\frac{\partial V}{\partial x}-\frac{\partial V}{\partial \tau}\\&#xA;\frac{\partial V}{\partial S} &amp;amp;= \frac{\partial V}{\partial x}\frac{\partial x}{\partial S}=\frac{1}{S}\frac{\partial V}{\partial x} \\&#xA;\frac{\partial^2 V}{\partial S^2}&amp;amp;= \frac{1}{S}\frac{\partial }{\partial x}\frac{\partial x}{\partial S}\frac{\partial V}{\partial x}-\frac{1}{S^2}\frac{\partial V}{\partial x}     \\&#xA;&amp;amp;=\frac{1}{S^2}\left(\frac{\partial^2 V}{\partial x^2}-\frac{\partial V}{\partial x}  \right)\\&#xA;\frac{\partial V}{\partial S\partial v} &amp;amp;= \frac{\partial }{\partial S}\frac{\partial V}{\partial v}=\frac{\partial }{\partial x}\frac{\partial x}{\partial S}\frac{\partial V}{\partial v} = \frac{1}{S}\frac{\partial V}{\partial x\partial v}&#xA;\end{aligned}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Substituting into the original PDE, I unfortunately get, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;r\frac{\partial C}{\partial x}-\frac{\partial C}{\partial \tau}+\frac{1}{2}v\frac{\partial ^2 C}{\partial x^2} -\frac{1}{2}v\frac{\partial C}{\partial x} +\frac{1}{2}\eta^2v\frac{\partial ^2 C}{\partial v^2} + \rho\eta v\frac{\partial ^2 C}{\partial x\partial v} +r\frac{\partial C}{\partial x}-rC- \lambda(v-\bar{v})\frac{\partial V}{\partial v} = 0&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure how to get rid of the $r\frac{\partial C}{\partial x}$ and $rC$ terms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think perhaps I left of crucial steps involving his remark that &quot;Further, suppose that we consider only the future value to expiration C of the European option price rather than its value today and define $\tau = T − t$.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone help? Thanks!&lt;/p&gt;&#xA;" OwnerUserId="15771" LastEditorUserId="15771" LastEditDate="2017-06-17T13:58:20.320" LastActivityDate="2017-06-17T13:58:20.320" Title="Gatheral's change of variables for stochastic volatility PDE" Tags="&lt;stochastic-volatility&gt;&lt;heston&gt;&lt;parabolic-pde&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34743" PostTypeId="1" AcceptedAnswerId="34750" CreationDate="2017-06-17T13:11:13.737" Score="5" ViewCount="453" Body="&lt;p&gt;I am trying to predict the future probability of stock returns based on the return distribution. Therefore I calculate the returns as $\frac{P(t)}{P(t-1)}$ for the whole daily data and fit a probability density function $f(x)$ to the data.&#xA;Now the probability that the future return lies in the interval $[a,b]$ should be given as $\int_a^b f(x) dx$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/LhsD3.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/LhsD3.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1.) What are some caveats about this approach?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am particular concerned about how changing volatility could bias my results. As far as I understand it, my fitted pdf will take an average volatility value and yield the return probabilities based on that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2.) How could I account for changing volatility? Pre selecting data on the most recent data?(but: fit will not be well with less data) Maybe usage of of volatility models?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3.)Are there different approaches to calculate the probability of future returns?&lt;/p&gt;&#xA;" OwnerUserId="28417" LastEditorUserId="28417" LastEditDate="2017-06-17T14:38:49.003" LastActivityDate="2017-06-18T07:02:45.643" Title="Predict probability of returns: How does changing volatility affect the return pdf?" Tags="&lt;volatility&gt;&lt;returns&gt;&lt;prediction&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34744" PostTypeId="2" ParentId="34742" CreationDate="2017-06-17T13:39:02.950" Score="3" Body="&lt;p&gt;First note that you have a typo in the definition of the moneyness. It should be&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;x = \ln \left( F_{t, T} / K \right) = \ln \left( S e^{r \tau} / K \right).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following the remark that you cited, we then define&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;e^{-r \tau} C(x, \nu, \tau) = V(S, \nu, t).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that $C$ is a function of $\tau$ and not $t$ - this seems strange in your notation. The corresponding partial derivatives are given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\frac{\partial V}{\partial t} &amp;amp; = &amp;amp; e^{-r \tau} \left( r C - r \frac{\partial C}{\partial x} - \frac{\partial C}{\partial \tau} \right), \\&#xA;\frac{\partial V}{\partial S} &amp;amp; = &amp;amp; e^{-r \tau} \frac{1}{S} \frac{\partial C}{\partial x}, \\&#xA;\frac{\partial^2 V}{\partial S^2} &amp;amp; = &amp;amp; e^{-r \tau} \frac{1}{S^2} \left( \frac{\partial^2 C}{\partial x^2} - \frac{\partial C}{\partial x} \right).&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Substituting back yields Equation (2.4) in Gatheral's book. I would also recommend you clearly distinguish between $C$ and $V$ and don't have $V$ on both sides of your partial derivatives.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2017-06-17T13:39:02.950" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34745" PostTypeId="2" ParentId="34708" CreationDate="2017-06-17T14:54:57.747" Score="1" Body="&lt;p&gt;We define a process $X$ to start at $X_0 = 0$ have the Heston-like $\mathbb{Q}$-dynamics&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\mathrm{d}X_t &amp;amp; = &amp;amp; -\frac{1}{2} V_t \mathrm{d}t + \sqrt{V_t} \mathrm{d}W_t^{(1)},\\&#xA;\mathrm{d}V_t &amp;amp; = &amp;amp; \kappa \left( \theta - V_t \right) \mathrm{d}t + \xi \sqrt{V_t} \mathrm{d}W_t^{(2)}.&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $\mathrm{d} \langle W^{(1)}, W^{(2)} \rangle_t = \rho \mathrm{d}t$ and such that $e^{X_t}$ is a $\mathbb{Q}$-martingale. The characteristic function of $X_t$ under $\mathbb{Q}$ is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\phi_{X_t}(\omega) = \exp \left\{ C(\omega, t) + D(\omega, t) V_0 \right\},&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;C(\omega, t) &amp;amp; = &amp;amp; \frac{\kappa \theta}{\xi^2} \left[ \left( \kappa - \rho \xi \mathrm{i} \omega - d(\omega) \right) t - 2 \ln \left( \frac{1 - c(\omega) e^{-d(\omega) t}}{1 - c(\omega)} \right) \right],\\&#xA;D(\omega, t) &amp;amp; = &amp;amp; \frac{\kappa - \rho \xi \mathrm{i} \omega - d(\omega)}{\xi^2} \left( \frac{1 - e^{-d(\omega) t}}{1 - c(\omega) e^{-d(\omega) t}} \right),\\&#xA;c(\omega) &amp;amp; = &amp;amp; \frac{\kappa - \rho \xi \mathrm{i} \omega - d(\omega)}{\kappa - \rho \xi \mathrm{i} \omega + d(\omega)},\\&#xA;d(\omega) &amp;amp; = &amp;amp; \sqrt{(\rho\xi \mathrm{i} \omega - \kappa)^2 + \xi^2 \left( \mathrm{i} \omega + \omega^2 \right)}.&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This representation of the characteristic function is based on the numerically stable version provided in Albrecher et al. (2007).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using $X$ you can now construct the underlying assets of interest and immediately obtain the relevant characteristic function. In case of a stock with dividend yield $q$, you set&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;S_t = S_0 e^{X_t + (r - q) t} \qquad \Rightarrow \qquad \phi_{\ln \left( S_t \right)}(\omega) = \phi_{X_t}(\omega) e^{\mathrm{i} \omega \left( \ln \left( S_0 \right) + (r - q) t \right)}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a forward, you get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;F_t = F_0 e^{X_t} \qquad \Rightarrow \qquad \phi_{\ln \left( F_t \right)}(\omega) = \phi_{X_t}(\omega) e^{\mathrm{i} \omega \ln \left( F_0 \right)}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then directly employ your favourite characteristic function-based European vanilla option pricer - e.g. Fang and Oosterlee (2008).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Albrecher, Hansjoerg, Philipp Mayer, Wim Shoutens and Jurgen Tistaert (2007) &quot;The Little Heston Trap,&quot; &lt;em&gt;Wilmott Magazine&lt;/em&gt;, Mar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fang, Fang and Cornelis W. Oosterlee (2008) &quot;A Novel Pricing Method for European Options Based on Fourier-Cosine Series Expansions,&quot; &lt;em&gt;Siam Journal of Scientific Computing&lt;/em&gt;, Vol. 31, No. 2, pp. 826-848&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-06-17T15:12:07.883" LastActivityDate="2017-06-17T15:12:07.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34746" PostTypeId="1" CreationDate="2017-06-17T15:17:17.317" Score="-1" ViewCount="131" Body="&lt;p&gt;I'm calculating 1-day parametric VaR estimates under the assumption that the returns are distributed as a generalized error distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the historical observations of the returns, obtained as log-difference prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I estimate in R the shape parameter of the GED to use to find the quantile? &lt;/p&gt;&#xA;" OwnerUserId="28419" LastEditorUserId="467" LastEditDate="2017-06-19T02:27:46.193" LastActivityDate="2017-07-19T10:41:59.207" Title="How to forecast Value-at-Risk in R with different assumptions?" Tags="&lt;var&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34748" PostTypeId="2" ParentId="34737" CreationDate="2017-06-17T17:22:47.390" Score="1" Body="&lt;p&gt;Cost of liquidation should include &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the &lt;strong&gt;explicit costs&lt;/strong&gt;: fees (brokers, exchanges, give-up, post trading, etc)&lt;/li&gt;&#xA;&lt;li&gt;the &lt;strong&gt;implicit costs&lt;/strong&gt; that you cannot know for sure a priori. They are themselves made of&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;slippage: linear costs mostly, a function of the bid ask spread. If you use a dumb trading algo, you will pay a full bid-ask spread, you are right. But if you use an algo that is a little smarter (for instance succeeding in being liquidity provider --ie in the book-- part of the time) you will pay less&lt;/li&gt;&#xA;&lt;li&gt;and the market impact&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Formulas are explained in &lt;a href=&quot;http://www.worldscientific.com/worldscibooks/10.1142/8967&quot; rel=&quot;nofollow noreferrer&quot;&gt;Market microstructure in practice&lt;/a&gt;, but in short you need a market impact of the shape&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\eta(q) = a \,\psi + \kappa\,\sigma\sqrt{\frac{q}{\bar V}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $q$ is your traded quantity, $\psi$ the bid-ask spread, $\sigma$ the volatility, $\bar V$ the average daily volume, and $a$ and $\kappa$ are parameters you need to fit on your data. It is important to use your own data because it will capture your trading habits (types of algo you use --see Chap 3 of the book-- for instance).&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2017-06-17T17:22:47.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34750" PostTypeId="2" ParentId="34743" CreationDate="2017-06-18T06:51:34.360" Score="5" Body="&lt;p&gt;I have written an entire paper on this approach at &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2828744&quot; rel=&quot;noreferrer&quot;&gt;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2828744&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to your specifics&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) &quot;Volatility&quot; as defined by variance does not exist, which is why it is changing.  The first moment is undefined so the second cannot exist.  See the paper as to why.  Your fitted pdf will treat the outcomes as having a single, joint scale parameter.  You won't want to do fitting like this, though, because you won't be able to use a sufficient statistic to create it and so must lose information as to the true location.  A Bayesian method will correct for this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) You do not need to, it is supposed to change.  You will have to use a Bayesian method because there does not exist an admissible non-Bayesian method.  The Bayesian likelihood function always is minimally sufficient and a statistic created using Bayesian methods is always admissible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Yes, it is called the Bayesian Predictive distribution.  It is defined as $$\Pr(\tilde{x}|\mathbf{x})=\int_{\theta\in\Theta}\Pr(\tilde{x}|\theta)\Pr(\theta|\mathbf{x})\mathrm{d}\theta,\forall\theta\in\Theta,$$ where $\Theta$ is the parameter space.  What is important to note is that the prediction, $\tilde{x}$, only depends upon $\mathbf{x}$, the data.  The integration process marginalizes the parameters, removing their effect.  Your prediction does not depend upon a parameter estimate so $\hat{\theta}$ isn't used.  This differs from Frequentist methods which depend upon a parameter estimate.  The question you asked is &quot;can I produce a distribution?&quot;  You did not ask &quot;what are the parameter estimates?&quot;  Those are two different questions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do note that Bayesian methods are neither biased nor unbiased.  They do not care about bias, it's not important in Bayesian methods.  You should treat them as more accurate, but biased as both statements are generally true.  This is because of the fact that you cannot stochastically dominate a Bayesian estimator.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastEditorUserId="25459" LastEditDate="2017-06-18T07:02:45.643" LastActivityDate="2017-06-18T07:02:45.643" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34751" PostTypeId="2" ParentId="34249" CreationDate="2017-06-18T10:50:38.057" Score="0" Body="&lt;p&gt;It seems that after several changes Yahoo Finance closed their API forever. The API was closed on May 15, one month ago already.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tested several alternatives and found that &lt;a href=&quot;https://eodhistoricaldata.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://eodhistoricaldata.com&lt;/a&gt; the best one for those who used Yahoo Finance. They provide raw data, adjusted closes and splits/dividends.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They also have CSV output, with very similar format for Yahoo Finance users.&#xA;Also there is a &lt;a href=&quot;https://intrinio.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://intrinio.com/&lt;/a&gt; data provider, looks good, but they much more expensive, have no data for Mutual Funds and API is very different in compare to Yahoo Finance. Then you need to significantly change your code.&lt;/p&gt;&#xA;" OwnerUserId="19681" LastActivityDate="2017-06-18T10:50:38.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34755" PostTypeId="1" CreationDate="2017-06-18T17:10:33.760" Score="-1" ViewCount="172" Body="&lt;p&gt;I am parsing an ITCH feed (Nasdaq) and I received an Add message (A) for 100@105.2 on the Ask.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Later I receive an Order Executed message (E), indicating 5 lots of the above order had been filled. No problem&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then receive an Order Executed at Price message (C), indicating the remaining 95 lots had been filled, but at price 105.3 (hence the purpose of this message is to convey fills which occurred at different prices to the order's original price).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can an order be filled at a price different to which it was inserted? There are no modify messages for that order between the fills.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is causing me a problem because i'm removing the quantity from my orderbook, but I have no orders at price 105.3, only 105.2. I don't understand why they weren't executed at 105.2? Is this some Nasdaq order type which will follow the market?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what the spec says for that message:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/d76UR.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/d76UR.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5168" LastEditorUserId="2299" LastEditDate="2017-06-18T21:41:15.333" LastActivityDate="2017-07-18T22:26:50.007" Title="ITCH feed, price executed at different to original order?" Tags="&lt;equities&gt;&lt;market-data&gt;&lt;market-microstructure&gt;&lt;nasdaq&gt;&lt;feed&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="34756" PostTypeId="2" ParentId="34755" CreationDate="2017-06-18T19:11:29.043" Score="0" Body="&lt;p&gt;It can happen because of regnms rules. See, for example price-to-comply (case 3) in &lt;a href=&quot;https://www.nasdaqtrader.com/content/ProductsServices/Trading/OrderTypesG.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.nasdaqtrader.com/content/ProductsServices/Trading/OrderTypesG.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2017-06-18T19:11:29.043" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34757" PostTypeId="1" AcceptedAnswerId="34758" CreationDate="2017-06-18T19:40:43.027" Score="2" ViewCount="376" Body="&lt;p&gt;Given that $dr=(\eta-\gamma r)dt+\sqrt{\alpha r+\beta}dW$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $Z(r,t)=e^{A(t;T)-rB(t;T)}$, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{matrix}&#xA;   \frac{dA}{dt}=\eta B-\frac{1}{2}\beta {{B}^{2}}  \\&#xA;   \frac{dB}{dt}=\frac{1}{2}\alpha {{B}^{2}}+\gamma B-1  \\&#xA;\end{matrix}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can we solve for $B$ in this case? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$B$ is a Riccati Equation.&#xA;The answer for B is given below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$B(t;T)=\frac{2(e^{\Psi_1(T-t)}-1)}{(\gamma+\Psi_1)(e^{\Psi_1(T-t)}-1)+2\Psi_1}$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\Psi_1=\sqrt{\gamma^2+2\alpha}$&lt;/p&gt;&#xA;" OwnerUserId="28421" LastActivityDate="2017-06-19T00:06:11.000" Title="Riccati Equation in spot rate model" Tags="&lt;interest-rates&gt;&lt;differential-equations&gt;&lt;spot-rate&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34758" PostTypeId="2" ParentId="34757" CreationDate="2017-06-18T21:26:19.923" Score="5" Body="&lt;p&gt;As you noted, this is a Riccati type ODE and it can thus be simplified using the standard transformations for this class - see e.g. &lt;a href=&quot;https://en.wikipedia.org/wiki/Riccati_equation#Reduction_to_a_second_order_linear_equation&quot; rel=&quot;noreferrer&quot;&gt;Wikipedia&lt;/a&gt;. We start by defining&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;C(t, T) = \frac{1}{2} \alpha B(t, T) \qquad \Rightarrow \qquad C_t(t, T) = \frac{1}{2} \alpha B_t(t, t)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;C_t(t, T) &amp;amp; = &amp;amp; C^2(t, T) + \gamma C(t, T) - \frac{1}{2} \alpha.&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We now set&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;C(t, T) = -\frac{D_t(t, T)}{D(t, T)} \qquad \Rightarrow \qquad C_t(t, T) &amp;amp; = &amp;amp; -\frac{D_{tt}(t, T)}{D(t, T)} + \frac{D_t^2(t, T)}{D^2(t, T)}\\&#xA;&amp;amp; = &amp;amp; \frac{-D_{tt}(t, T)}{D(t, T)} + C^2(t, T)&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\frac{D_{tt}(t, T)}{D(t, T)} &amp;amp; = &amp;amp; C^2(t, T) - C_t(t, T)\\&#xA;&amp;amp; = &amp;amp; -\gamma C(t, T) + \frac{1}{2} \alpha\\&#xA;&amp;amp; = &amp;amp; \gamma \frac{D_t(t, T)}{D(t, T)} + \frac{1}{2} \alpha&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;D_{tt}(t, T) = \gamma D_t(t, T) + \frac{1}{2} \alpha D(t, T).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a homogeneous second order linear ODE with constant coefficients and can be solved using standard methods. We note that $T$ has been fixed and make another substitution by defining $\tau = T - t$ such that $E(\tau) = D(t, T)$. We get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;E_{\tau \tau}(\tau) + \gamma E_\tau(\tau) - \frac{1}{2} \alpha E(\tau) = 0.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The characteristic equation is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;r^2 + \gamma r - \frac{1}{2} \alpha = 0&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with solutions&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;r_{1, 2} = -\frac{1}{2} \gamma \pm\frac{1}{2} \sqrt{\gamma^2 + 2 \alpha} := \beta \pm \lambda.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that $\lambda = \frac{1}{2} \psi_1$ in your notation. We thus have the general solution&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;E(\tau) = c_1 e^{(\beta + \lambda) \tau} + c_2 e^{(\beta - \lambda) \tau}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;E_\tau(\tau) = (\beta + \lambda) e^{(\beta + \lambda) \tau} + (\beta - \lambda) c_2 e^{(\beta - \lambda) \tau}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and for some constants $c_1$ and $c_2$ that have to be determined. We obtain the solution to the Riccati ODE by substituting back&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;B(t, T) = \frac{2 C(t, T)}{\alpha} = -\frac{2 D_t(t, T)}{\alpha D(t, T)} = \frac{2 E_\tau(\tau)}{\alpha E(\tau)}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Applying the terminal condition yields&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;B(T, T) = 0 \qquad &amp;amp; \Leftrightarrow &amp;amp; \qquad E_\tau(0) = 0\\&#xA;&amp;amp; \Leftrightarrow &amp;amp; \qquad c_1 = -c_2 \frac{\beta - \lambda}{\beta + \lambda}.&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;E(\tau) = \frac{c_2}{\beta + \lambda} e^{\beta \tau} \left( (\beta + \lambda) e^{-\lambda \tau} - (\beta - \lambda) e^{\lambda \tau} \right)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;E_\tau(\tau) = (\beta - \lambda) c_2 e^{\beta \tau} \left( e^{-\lambda \tau} - e^{\lambda \tau} \right).&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We finally get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;B(t, T) &amp;amp; = &amp;amp; \frac{2 (\beta^2 - \lambda^2) \left( e^{-\lambda \tau} - e^{\lambda \tau} \right)}{\alpha \left( (\beta + \lambda) e^{-\lambda \tau} - (\beta - \lambda) e^{\lambda \tau} \right)}\\&#xA;&amp;amp; = &amp;amp; \frac{\left( e^{2 \lambda \tau} - 1 \right)}{(\beta + \lambda) - (\beta - \lambda) e^{2 \lambda \tau}}\\&#xA;&amp;amp; = &amp;amp; \frac{2 \left( e^{\psi_1 (T - t)} - 1 \right)}{\left( \gamma + \psi_1 \right) \left( e^{\psi_1 (T - t)} - 1 \right) + 2 \psi_1}.&#xA;\end{eqnarray}&lt;/p&gt;&#xA;" OwnerUserId="24222" LastEditorUserId="24222" LastEditDate="2017-06-19T00:06:11.000" LastActivityDate="2017-06-19T00:06:11.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34759" PostTypeId="1" CreationDate="2017-06-18T21:43:29.717" Score="6" ViewCount="202" Body="&lt;p&gt;I would like to calculate the probability of ruin (or, default), i.e. &#xA;$$\text{Pr}(\tau&amp;lt;T),$$&#xA;where $\tau$ is the default time and $X_t$ follows the Geometric Ornstein-Uhlenbeck (O-U) process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dX_t=\kappa (\theta - X_t) dt + \sigma X_t^{\delta}dW_t,$$&#xA;with $\delta=1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can find closed-form solutions for the cases $\delta=0$ and $\delta=1/2$, which correspond to the standard O-U and CIR processes, for example &lt;a href=&quot;http://neumann.hec.ca/pages/michel.denault/JFM%202009.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;. Does a similar solution exist for the $\delta=1$ case?&lt;/p&gt;&#xA;" OwnerUserId="28437" LastEditorUserId="467" LastEditDate="2017-06-19T02:30:46.477" LastActivityDate="2017-06-19T02:30:46.477" Title="What is the probability of ruin of a Geometric Ornstein-Uhlenbeck process?" Tags="&lt;mean-reversion&gt;&lt;default-probability&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34760" PostTypeId="2" ParentId="11194" CreationDate="2017-06-19T00:36:55.987" Score="1" Body="&lt;p&gt;I know this post is quite old, but someone else just might face a question like this one. I got the, I think, correct answer as follows in R:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;VaR &amp;lt;- (0.001711227-(qt(p = 0.99, df = 5.483)/sqrt(5.483/3.483))*0.02180995)*1000000&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see 0.001711227 is the forecasted mean, 0.02180995 the forecasted sd and 5.483 your fitted shape parameter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;About the method, that's pretty much how it appears in a lecture file I found &lt;a href=&quot;http://faculty.chicagobooth.edu/ruey.tsay/teaching/bs41202/sp2013/lec9-13.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;. You have to standardize your t-student quantile before, and use &lt;code&gt;sqrt(shape/(shape-2))&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="28438" LastActivityDate="2017-06-19T00:36:55.987" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34761" PostTypeId="1" AcceptedAnswerId="34777" CreationDate="2017-06-19T09:18:30.733" Score="0" ViewCount="88" Body="&lt;p&gt;I am trying to implement the (average) total correlation of assets, which is discussed &lt;a href=&quot;https://quant.stackexchange.com/questions/8689/average-correlation-of-index-portfolio&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;https://quant.stackexchange.com/questions/33656/what-is-the-total-correlation-between-assets-in-a-portfolio&quot;&gt;here&lt;/a&gt; in R. Specifically, I am looking at $\rho_{av(1)}$ and  $\rho_{av(2)}$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\rho_{av(1)} = \frac{2 \sum_{i=1}^N \sum_{j&amp;gt;i}^N w_i w_j \rho_{i, j}}{1 -  \sum_{i=1}^N w_i^2}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\rho_{av(2)} = \frac{\sigma^2 - \sum_{i=1}^N w_i^2\sigma_i^2}{2 \sum_{i=1}^N \sum_{j&amp;gt;i}^N w_i w_j \sigma_i \sigma_j}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far, I have the following code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;set.seed(123)&#xA;a = rnorm(100, 0, 0.02)&#xA;b = rnorm(100, 0, 0.03)&#xA;c = rnorm(100, 0, 0.04)&#xA;dt = cbind(a, b, c)&#xA;wg = runif(ncol(dt))&#xA;wg = wg/sum(wg)&#xA;wg = round(wg, digits = 3)&#xA;&#xA;options(scipen = 999)&#xA;cv = cov(dt)&#xA;VARs = diag(cv)&#xA;cr = cor(dt)&#xA;length(wg)&#xA;&#xA;sum_1 = 0&#xA;for (i in 1 : length(wg) ) {&#xA;  for (j in 2 : length(wg) ) {&#xA;    sum_1 = sum_1 + 2 * wg[i] * wg[j] * cr[i, j]&#xA;  }}&#xA;rho_1 = sum_1/(1 - sum(wg^2))&#xA;&#xA;sum_2 = 0&#xA;for (i in 1 : length(wg) ) {&#xA;  for (j in 2 : length(wg) ) {&#xA;    sum_2 = sum_2 + 2 * wg[i] * wg[j] * sqrt(VARs[i]) * sqrt(VARs[j])&#xA;  }}&#xA;&#xA;PV = t(wg) %*% cv %*% wg&#xA;ss = sum(wg^2 * VARs)&#xA;rho_2 = (PV - ss)/sum_2&#xA;&#xA;rhos = c(rho_1, rho_2)&#xA;rhos&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And the results are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;[1]  1.388473356 -0.004104948&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I expected these two to be close to each other. I think there might be an error in my code. I would appreciate if somebody could verify the code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="19096" LastEditorUserId="19096" LastEditDate="2017-06-19T11:59:45.177" LastActivityDate="2017-06-20T04:09:33.663" Title="Implementation of total correlation of assets in R" Tags="&lt;portfolio-management&gt;&lt;correlation&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34762" PostTypeId="2" ParentId="34746" CreationDate="2017-06-19T09:41:02.017" Score="0" Body="&lt;p&gt;Try the following (from &lt;a href=&quot;https://www.rmetrics.org/sites/default/files/ebooks-basicr-ged.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; source):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;dged &amp;lt;- function(x, mean = 0, sd = 1, nu = 2) {&#xA;  z = (x - mean)/sd&#xA;  lambda = sqrt(2^(-2/nu) * gamma(1/nu)/gamma(3/nu))&#xA;  g = nu/(lambda * (2^(1 + 1/nu)) * gamma(1/nu))&#xA;  density = g * exp(-0.5 * (abs(z/lambda))^nu)/sd&#xA;  density&#xA;}&#xA;&#xA;&#xA;gedFit &amp;lt;- function(x, ...) {&#xA;  start = c(mean = mean(x), sd = sqrt(var(x)), nu = 2)&#xA;  loglik = function(x, y = x) {&#xA;    f = -sum(log(dged(y, x[1], x[2], x[3])))&#xA;    f&#xA;  }&#xA;  fit = nlminb(start = start, objective = loglik, lower = c(-Inf,&#xA;                                                            0, 0), upper = c(Inf, Inf, Inf), y = x, ...)&#xA;  names(fit$par) = c(&quot;mean&quot;, &quot;sd&quot;, &quot;nu&quot;)&#xA;  fit&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here you can change &lt;code&gt;data&lt;/code&gt; to your calculated observations:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;set.seed(2356)&#xA;data = rnorm(1000, 0, 0.09)&#xA;fitted = gedFit(data)&#xA;parameters = fitted$par&#xA;parameters&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Your parameters, including &lt;code&gt;nu&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;       mean          sd          nu &#xA;0.003114645 0.088738398 2.409166210 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="19096" LastActivityDate="2017-06-19T09:41:02.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34763" PostTypeId="1" CreationDate="2017-06-19T14:29:04.713" Score="2" ViewCount="988" Body="&lt;p&gt;According to John Hull's book, equity futures delta does not equal to one. For commodities futures, since there is no centralized exchange for physical commodities, do commodities futures' delta equal to one?&lt;/p&gt;&#xA;" OwnerUserId="28446" LastActivityDate="2017-06-19T18:05:41.350" Title="Is commodity futures's delta equal to 1?" Tags="&lt;delta&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34764" PostTypeId="2" ParentId="34763" CreationDate="2017-06-19T15:15:57.093" Score="0" Body="&lt;p&gt;Speaking in qualitative terms:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would treat a commodity futures as delta one w.r.t spot if the maturity is not too long. &#xA;In the case of rather short futures this can be seen as basis risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For longer terms you have term structure risk too, which I would not model/see as linear w.r.t. the spot market.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2017-06-19T15:15:57.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34766" PostTypeId="1" CreationDate="2017-06-19T16:48:43.563" Score="1" ViewCount="117" Body="&lt;p&gt;The opening call auction crossing order book is partially sealed, i.e. only the specialist can see quotes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a stock exchange where this data is available later to simulate the matching algorithm and the open? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any provider selling order flow covering the open auction too (covering at least part of the whole market)?&lt;/p&gt;&#xA;" OwnerUserId="16956" LastActivityDate="2017-06-19T16:48:43.563" Title="How do I estimate opening call auction order book for equities?" Tags="&lt;automated-trading&gt;&lt;market-microstructure&gt;&lt;algorithmic-trading&gt;&lt;exchange&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34767" PostTypeId="2" ParentId="34763" CreationDate="2017-06-19T17:27:33.203" Score="3" Body="&lt;p&gt;In a risk-neutral framework, the price at $t$, $\text{Fut}(t,T,X)$, of a future of maturity $T$ written on a asset $X$ whose price process is $(X_t)_{t \geq 0}$ is given by its conditional risk-neutral expectation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \text{Fut}(t,T,X) = \mathbb{E}^{\, \mathbb{Q}\, }[X_T|\mathcal{F}_t] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For further details on this result, you can consult &lt;em&gt;Stochastic Calculus for Finance II: Continuous-Time Models&lt;/em&gt; by Shreve. The delta $\Delta_{\text{Fut}}$  of the future is then defined to be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \Delta_{\text{Fut}} = \frac{\partial \, \text{Fut}}{\partial X_t} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, to obtain a specific expression for the delta, it is normally necessary to have a model for the evolution of the price $X_t$. Given that you are interested in a commodity, a plausible model for the price process $(X_t)_{t \geq 0}$ is a &lt;a href=&quot;https://en.wikipedia.org/wiki/Geometric_Brownian_motion&quot; rel=&quot;nofollow noreferrer&quot;&gt;Geometric Brownian Motion (GBM)&lt;/a&gt;, so that under $\mathbb{Q}$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;dX_t= rX_tdt+\sigma X_tdW_t&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The price $X_T$ at $T$ can be explicitly written as :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ X_T = X_te^{\left(r-\frac{\sigma^2}{2}\right)(T-t)+\sigma W_{T-t}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $W_{T-t}\sim\mathcal{N}(0,T-t)$ is a Gaussian variable. $X_T$ is lognormal, its expectation under $\mathbb{Q}$ is given by $X_te^{r(T-t)}$ thus:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \Delta_{\text{Fut}} = \frac{\partial \, \text{Fut}}{\partial X_t} = \frac{\partial}{\partial X_t}\mathbb{E}^{\, \mathbb{Q}\, }[X_T|\mathcal{F}_t] = e^{r(T-t)}  $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For short maturities and/or low interest rate $r$, we have $e^{r(T-t)} \approx 1$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On a more qualitative note, as it has been said in the commentaries the delta is not strictly one, it is slightly lower or higher depending on &lt;em&gt;costs&lt;/em&gt; and &lt;em&gt;benefits&lt;/em&gt; generated by the underlying asset: indeed, a future or forward contract involves the future delivery of an underlying asset $X$ at a price agreed in advance, the future price $\text{Fut}(t,T,X)$ or the forward price. Basically, to hedge this position you simply need to buy the asset today and hold it until maturity, when you will deliver it to your client. Holding this position has:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Costs&lt;/strong&gt;: you might have to borrow money at a rate $r$ to buy the asset; for a commodity, you might have storage costs to pay for until the maturity; etc.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Benefits&lt;/strong&gt;: the underlying might generate cash-flows that accrue to you, for example dividends for a stock.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So actually, &lt;em&gt;the delta of a future is conceptually equal to $1$, adjusted for the costs and benefits of hedging the position&lt;/em&gt;: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \Delta_{\text{Fut}} \approx 1+\text{Costs from holding the underlying}-\text{Benefits from holding the underlying}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I know, whether the contract is a future or a forward $-$ &lt;em&gt;i.e.&lt;/em&gt; traded through a centralized exchange or bilaterally $-$ does not fundamentally change this $-$ although it can change the details, &lt;em&gt;i.e.&lt;/em&gt; the exact costs and benefits.&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-06-19T18:05:41.350" LastActivityDate="2017-06-19T18:05:41.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34768" PostTypeId="1" CreationDate="2017-06-19T19:32:50.290" Score="1" ViewCount="95" Body="&lt;p&gt;I have found a result that I find truly puzzling. Here is an extract from a GARCH-Analysis I have performed:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Test______________Statistic_______p-Value&lt;/p&gt;&#xA;&lt;p&gt;Ljung-Box Test_____R    Q(10)_____0.4047773&lt;br /&gt;&#xA;Ljung-Box Test_____R    Q(15)_____0.3371581&lt;br /&gt;&#xA;Ljung-Box Test_____R    Q(20)_____0.4098038&lt;br /&gt;&#xA;Ljung-Box Test_____R^2  Q(10)___0.9935475&lt;br /&gt;&#xA;Ljung-Box Test_____R^2  Q(15)___0.9978561&lt;br /&gt;&#xA;Ljung-Box Test_____R^2  Q(20)___0.9984385&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Pardon the formatting by the way. R stands for the Returns and R^2 for the squared returns. In the ACF Plots I have seen, that there is significant autocorrelation for the R^2 values. Nevertheless, this dependence would show in a significantly low p-Value (for example one below 0.05). Nonetheless I here see the exact opposite. All R^2 Values show an extremely high p-Value. How can this be? Shouldn't this mean that the Values are very independent of one another?&lt;/p&gt;&#xA;" OwnerUserId="28336" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2017-06-19T20:20:06.290" Title="Ljung_Box Statistic of R and R^2 values in Return analysis" Tags="&lt;returns&gt;&lt;garch&gt;&lt;stochastic-volatility&gt;&lt;statistical-finance&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34769" PostTypeId="2" ParentId="34768" CreationDate="2017-06-19T20:20:06.290" Score="1" Body="&lt;p&gt;Two things to consider. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Once a model has been fit to the data, the Ljung-Box test statistic follows a different null distribution than that applicable to raw data. This also holds for other diagnostic tests and the confidence bounds on ACF and PACF. This is because model residuals are in some way restricted. E.g. residuals from a linear regression always sum to one, so each data point does not carry as much information as raw data: you can reconstruct the i-th residual as zero minus the sum of all other residuals, while you cannot reconstruct raw data that way.&lt;/li&gt;&#xA;&lt;li&gt;The Ljung-Box test has really nonstandard null distribution when applied on standardized residuals from a GARCH model, and the $p$-values you have there are most likely wrong, because they are most likely computed from some standard distribution. (Yes, popular software packages continue making this mistake despite notifications from users.) There have been some discussions on that on Cross Validated (search &quot;Ljung-Box&quot; and &quot;GARCH&quot;; e.g. &lt;a href=&quot;https://stats.stackexchange.com/questions/200958/simultaneous-estimation-of-arma-and-garch-components/267654#267654&quot;&gt;this&lt;/a&gt;).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="19645" LastActivityDate="2017-06-19T20:20:06.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34770" PostTypeId="1" CreationDate="2017-06-19T20:32:02.877" Score="-1" ViewCount="473" Body="&lt;p&gt;I am new into learning option pricing and read that option pricing using binomial valuation does not depend on probabilities (real or risk neutral).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A 1 period binomial tree with $u = 1/d = 1.07$ and $S_0$ = $100.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the up-move probability $u$ is 0.99 or 0.01, I read that the call option prices is the same and is equal to $4.8. They assumed European style options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone please help and guide me? Maybe dinner tutorial that explains this? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="28452" LastEditorUserId="26595" LastEditDate="2017-06-20T10:58:03.087" LastActivityDate="2017-07-20T11:44:37.420" Title="Why does option pricing not depend on probabilities in a binomial tree style valuation" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;binomial-tree&gt;&lt;european-options&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34771" PostTypeId="2" ParentId="34770" CreationDate="2017-06-19T21:31:20.740" Score="0" Body="&lt;p&gt;What you say is false. In general, the price of an option does not depend on physical probabilities but does depend on risk neutral probabilities. In your case, in a one-period binomial tree model, the probability of going up is $q=\frac{(1+r)-d}{u-d}$ therefore the price of the option paying $C_u$ and $C_d$ is $$C=\frac{1}{1+r}\left(qC_u+(1-q)C_d\right)=\frac{1}{1+r}\left(\frac{(1+r)-d}{u-d}C_u+\frac{u-(1+r)}{u-d}C_d\right)$$ If you focus on the second part of the equation it looks like the price does not depend on probability, but as the first part shows it does indeed depend on risk-neutral probabilities!&lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2017-06-19T21:31:20.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34772" PostTypeId="1" CreationDate="2017-06-19T22:07:19.700" Score="1" ViewCount="78" Body="&lt;p&gt;I recently met an options trader that said to me that the &lt;strong&gt;&lt;em&gt;price of an option is the expected present value of the payoffs of an option&lt;/em&gt;&lt;/strong&gt; (present value as in discount by the risk free rate and expected value as in real world not risk neutral probabilities).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway I tried to demonstrate to him why this approach is flawed. So typically most books eg &lt;strong&gt;&lt;em&gt;Mark Joshi's Concepts and Practice of Mathematical Finance&lt;/em&gt;&lt;/strong&gt; (which is a fantastic book in my opinion) demonstrate why this is wrong by constructing an arbitrage opportunity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately the options trader just dismissed it and started telling me about what Black, Scholes and Merton did...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question is there a reference where Black, Scholes or Merton actually say that this is not true in their original framework?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&#xA;A more recent survey paper written by them or something along those lines would also be extremely helpful. &lt;/p&gt;&#xA;" OwnerUserId="28454" LastEditorUserId="467" LastEditDate="2017-06-20T02:45:39.490" LastActivityDate="2017-06-20T02:45:39.490" Title="Reference that states that the price of an option is not the expected present value of the payoffs under Black and Scholes?" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;arbitrage&gt;&lt;risk-neutral-measure&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34773" PostTypeId="1" AcceptedAnswerId="34774" CreationDate="2017-06-19T22:39:06.457" Score="0" ViewCount="187" Body="&lt;p&gt;I recently spoke to an options trader that tried to demonstrate option pricing by considering a random walk of balls dropping down a lattice so the underlying stochastic process is a simple random walk of say 100 steps. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The contract considered is $(U_{100}-K)^{+}$ where $U_{100}$ is the number of times the ball goes &quot;up&quot;. He states that this is an option. I think he doesn't understand what an option is because there is no underlying market in this case (ie you can't exactly trade the balls to hedge your position and there is no underlying that moves based on what the ball does except for the contract itself). I would say that this is a bet or a game that you would pay for at a casino.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question is:&#xA;&lt;strong&gt;&lt;em&gt;Is there a resource that actively explains or demonstrates why a derivative is called a derivative? As in why insurance and bets are fundamentally different from derivatives?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="28454" LastEditorUserId="28454" LastEditDate="2017-07-02T23:26:14.203" LastActivityDate="2017-07-02T23:26:14.203" Title="Reference for why a derivative is a derivative and not say an insurance contract" Tags="&lt;derivatives&gt;&lt;hedging&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34774" PostTypeId="2" ParentId="34773" CreationDate="2017-06-19T22:49:38.667" Score="0" Body="&lt;p&gt;From the introduction (Chapter 1) of Baxter's and Rennie's excellent book &lt;em&gt;Financial Calculus&lt;/em&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;With markets where the stock can be bought and sold freely and arbitrarily positive and negative amounts of stock can be maintained without cost, trying to trade forward using the strong law would lead to disaster […].&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;[…]&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;But the existence of an arbitrage price, however surprising, overrides the strong law. To put it simply, if there is an arbitrage price, any other price is too dangerous to quote.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;[…]&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;The strong law and expectation give the wrong price for forwards. But in a certain sense, the forward is a special case. The construction strategy $-$ buying the stock and holding it $-$ certainly wouldn’t work for more complex claims. The standard call option which offers the buyer the right but not the obligation to receive the stock for some strike price agreed in advance certainly couldn’t be constructed this way. If the stock price ends up above the strike, then the buyer would exercise the option and ask to receive the stock – having it salted away in a drawer would then be useful to the seller. But if the stock price ends up below the strike, the buyer will abandon the option and any stock owned by the seller would have incurred a pointless loss.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Thus maybe a strong-law price would be appropriate for a call option, and until 1973, many people would have agreed. Almost everything appeared safe to price via expectation and the strong law, and only forwards and close relations seemed to have an arbitrage price. Since 1973, however, and the infamous Black-Scholes paper, just how wrong this is has slowly come out. Nowhere in this book will we use the strong law again. […] All derivatives can be built from the underlying $-$ arbitrage lurks everywhere.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="20454" LastActivityDate="2017-06-19T22:49:38.667" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34776" PostTypeId="2" ParentId="34772" CreationDate="2017-06-20T02:44:29.113" Score="1" Body="&lt;p&gt;Paul Wilmott's book &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470058269&quot; rel=&quot;nofollow noreferrer&quot;&gt;Frequently Asked Questions in Quantitative Finance&lt;/a&gt; shows 10 different ways of proving the Black-Scholes equation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One of them is certainly using the risk-neutral pricing approach, so just showing that this approach is equivalent to the B-S result should be sufficient to prove it is sound.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the trader said that B-S used discounted expected payoff to yield their formula, he understood strictly nothing to what they did.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, remember that their approach is based on strong assumptions, one of which being the GBM dynamics and the other being that you can trade the underlyings (to dynamically hedge). &lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2017-06-20T02:44:29.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34777" PostTypeId="2" ParentId="34761" CreationDate="2017-06-20T04:09:33.663" Score="0" Body="&lt;p&gt;Here is the corrected original code (thanks @will):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; sum_1 = 0&#xA;  for (i in 1 : (length(wg) - 1) ) {&#xA;    for (j in  min(i+1, length(wg)) : length(wg) ) {&#xA;      sum_1 = sum_1 + 2 * wg[i] * wg[j] * cr[i, j]&#xA;    }}&#xA;  rho_11 = sum_1/(1 - sum(wg^2))&#xA;&#xA;  sum_2 = 0&#xA;  for (i in 1 : (length(wg) - 1) ) {&#xA;    for (j in  min(i+1, length(wg)) : length(wg) ) {&#xA;      sum_2 = sum_2 + 2 * wg[i] * wg[j] * sqrt(VARs[i]) * sqrt(VARs[j])&#xA;    }}&#xA;&#xA;  PV = t(wg) %*% cv %*% wg&#xA;  ss = sum(wg^2 * VARs)&#xA;  rho_22 = (PV - ss)/sum_2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;A vectorized version:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  # double summation in numerator (including multiplier 2)&#xA;  diag(cr) &amp;lt;- 0&#xA;  double_sum.1 &amp;lt;- c(crossprod(wg, cr %*% wg))&#xA;&#xA;  # single summation in denominator&#xA;  single_sum.1 &amp;lt;- c(crossprod(wg))&#xA;  rho_1 = double_sum.1/(1 - single_sum.1)&#xA;&#xA;&#xA;  # single summation in numerator&#xA;  single_sum.2 &amp;lt;- c(crossprod(wg * sqrt(diag(cv))))&#xA;  # double summation in denominator&#xA;  double_sum.2 &amp;lt;- sum(tcrossprod(wg * sqrt(diag(cv)))[upper.tri(diag(length(wg)))])&#xA;  PV = t(wg) %*% cv %*% wg&#xA;  rho_2 = (PV - single_sum.2)/ (2 * double_sum.2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And the comparison of the two methods (initially they were way off):&#xA;&lt;a href=&quot;https://i.stack.imgur.com/FIAfx.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/FIAfx.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19096" LastActivityDate="2017-06-20T04:09:33.663" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34778" PostTypeId="1" CreationDate="2017-06-20T08:26:15.043" Score="0" ViewCount="314" Body="&lt;p&gt;I would like to investigate some data on individual board members in a systematic way. I have a Bloomberg Terminal at my disposal, which I would like to use for this. In a first step, I need to retrieve a list of all board members for a given company ticker. In a second step, I would then want to retrieve personal-level data for each individual.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some pointers regarding both steps would be much appreciated. This seems to be a rather specific use case, so I haven't been able to find anything on this online.&lt;/p&gt;&#xA;" OwnerUserId="13665" LastActivityDate="2020-04-29T08:00:30.073" Title="How to retrieve list of names of board members for a given ticker from Bloomberg Professional" Tags="&lt;bloomberg&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34779" PostTypeId="1" CreationDate="2017-06-20T10:05:39.810" Score="1" ViewCount="66" Body="&lt;p&gt;Given a portfolio of shares $I = \sum{w_iS_i}$ for some fixed weights $w_i$ where each stok $S_i$ has a log-normal distribution, what is the process / distribution followed by the portfolio? That is, what is the distribution of the process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$${dI} = \sum{w_idS_i}  = \sum{w_i(\mu_iS_idt+\sigma_iS_idW_i)} ?$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given that the log-normal distribution is not closed under the summation, it would imply that the process followed by the portfolio is NOT log-normal. However, it seems that it is, nevertheless, still modeled as log-normal in applications. Why is this so? And how bad/good this approximation is to the &quot;true&quot; process given above?&lt;/p&gt;&#xA;" OwnerUserId="25538" LastActivityDate="2017-06-20T10:05:39.810" Title="Process for a portfolio of stocks where each share follows a log-normal process" Tags="&lt;stochastic-processes&gt;&lt;modern-portfolio-theory&gt;&lt;lognormal&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34782" PostTypeId="1" CreationDate="2017-06-20T13:40:53.633" Score="1" ViewCount="945" Body="&lt;p&gt;World,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When pricing a CMS Spread Option the market practice consider the strike as relative to ATM or Absolute?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I relate to the following paper page 70 the author refers to absolute strike &lt;/p&gt;&#xA;&#xA;&lt;p&gt;[&lt;a href=&quot;http://www1.maths.ox.ac.uk/system/files/legacy/12804/Dhamo_diss_sub_30.9.11_11.49_AMENDED_VERSION_FOR_PUBLISHING_add_note_to_that_effect.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;1&lt;/a&gt;] Dhamo,E., On the Calibration of the&#xA;SABR–Libor Market Model Correlations, University of Oxford, 2011  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www1.maths.ox.ac.uk/system/files/legacy/12804/Dhamo_diss_sub_30.9.11_11.49_AMENDED_VERSION_FOR_PUBLISHING_add_note_to_that_effect.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www1.maths.ox.ac.uk/system/files/legacy/12804/Dhamo_diss_sub_30.9.11_11.49_AMENDED_VERSION_FOR_PUBLISHING_add_note_to_that_effect.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively the following author refers to them as relative page 20 &lt;a href=&quot;http://eprints.maths.ox.ac.uk/1384/1/Man_Kuan_Wong_dissertation.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;2&lt;/a&gt; Wong,M-K., A Correlation-sensitive Calibration of a Stochastic Volatility LIBOR Market Model, University of Oxford&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://eprints.maths.ox.ac.uk/1384/1/Man_Kuan_Wong_dissertation.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://eprints.maths.ox.ac.uk/1384/1/Man_Kuan_Wong_dissertation.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This topic has necessarily an impact on the static replication of cms rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any relevant idea?&lt;/p&gt;&#xA;" OwnerUserId="24915" LastEditorUserId="24915" LastEditDate="2017-06-20T14:25:48.530" LastActivityDate="2017-06-20T14:25:48.530" Title="Absolute or relative strikes?" Tags="&lt;interest-rates&gt;&lt;implied-volatility&gt;&lt;correlation&gt;&lt;risk-neutral-measure&gt;" AnswerCount="0" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="34783" PostTypeId="1" CreationDate="2017-06-20T14:26:24.930" Score="6" ViewCount="979" Body="&lt;p&gt;In a ARCH(m) model we have&#xA;$$&#xA;\sigma_n^2=\sum_{i=1}^{m} \alpha_i u_{n-i}^2&#xA;$$&#xA;where $u_i$ is defined as the continuously compounded return during day $i$ (between the end of day $i-1$ and the end of day $i$), $\sigma_n^2$ is the variance rate and $\alpha_i$ is the amount of weight given to the observation $i$ days ago.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An extension is to assume that there is a long-run average variance rate $V_L$ and that this should be given some weight $\gamma$. This leads to the model that&#xA;takes the form&#xA;$$&#xA;\sigma_n^2=\gamma V_L+\sum_{i=1}^{m} \alpha_i u_{n-i}^2.&#xA;$$&#xA;What are the significant implications of this extension?&lt;br&gt;&#xA;Why has Engle won the Nobel Prize for the development of this &quot;simple&quot; model?&lt;/p&gt;&#xA;" OwnerUserId="28468" LastEditorUserId="19645" LastEditDate="2017-06-20T18:36:33.713" LastActivityDate="2017-06-21T06:30:39.810" Title="What are the significant implications of the long-run average variance rate and why Engle won the Nobel Prize for ARCH model development?" Tags="&lt;volatility&gt;&lt;garch&gt;&lt;variance&gt;&lt;models&gt;&lt;arch&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34784" PostTypeId="1" CreationDate="2017-06-20T15:07:19.997" Score="14" ViewCount="9066" Body="&lt;p&gt;I've read through most of the intro resources on Quantopian, but I was wondering if anyone here has recommendations for online courses that focus on Quant Trading? I found one class called &lt;a href=&quot;https://www.experfy.com/training/courses/algorithmic-trading-strategies&quot; rel=&quot;noreferrer&quot;&gt;Algorithmic Trading Strategies&lt;/a&gt; on Experfy that seems like the best option right now. Has anyone taken this class before?&lt;/p&gt;&#xA;" OwnerUserId="28470" LastActivityDate="2019-02-13T13:12:47.050" Title="Best Online Course for Learning Quant Trading?" Tags="&lt;learning&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="34785" PostTypeId="2" ParentId="34784" CreationDate="2017-06-20T15:59:32.730" Score="9" Body="&lt;p&gt;Although not free, &lt;a href=&quot;https://www.datacamp.com/home&quot; rel=&quot;noreferrer&quot;&gt;DataCamp&lt;/a&gt; has a very good reputation: they have a whole career track &quot;Quantitative Analyst&quot; with 12 courses altogether:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;a href=&quot;https://www.datacamp.com/tracks/quantitative-analyst-with-r&quot; rel=&quot;noreferrer&quot;&gt;Quantitative Analyst with R&lt;/a&gt;&lt;br&gt; In finance, quantitative analysts&#xA;  ensure portfolios are risk balanced, help find new trading&#xA;  opportunities, and evaluate asset prices using mathematical models.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;One of the courses is called &quot;&lt;a href=&quot;https://www.datacamp.com/courses/financial-trading-in-r&quot; rel=&quot;noreferrer&quot;&gt;Financial Trading in R&lt;/a&gt;&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have taken some of DataCamp's courses myself (e.g. machine learning for R and Python) and would in general recommend it. I also use it as part of my teaching R in my data sciences classes at my university.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2017-06-20T15:59:32.730" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34786" PostTypeId="2" ParentId="34783" CreationDate="2017-06-20T18:16:11.790" Score="4" Body="&lt;p&gt;$V_L$ is the long-run variance (or the unconditional variance) if and only if $\gamma=1-\sum_{i=1}^n \alpha_i$, because the long-run variance compatible with the model&#xA;$$&#xA;\sigma_n^2 = \gamma V_L + \sum_{i=1}^n \alpha_i u_{n-i}^2&#xA;$$&#xA;is &#xA;$$&#xA;\sigma^2=\frac{\gamma V_L}{1-\sum_{i=1}^n \alpha_i}.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The presence of the intercept $\gamma V_L$ restricts $\sigma_n^2$ to never drop below $\gamma V_L$ (if $\alpha_i&amp;gt;0, \forall i$). You can say this is a fundamental (in the statistical, not the subject-matter sense) level of variance. I am not aware of any special role this term would play in financial theory, but then again I am not very well versed in financial theory either. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The ARCH model and its extensions have proven to be quite useful tools for modelling macroeconomic and financial data. The idea of modelling the conditional variance in this simple way now seems trivial, but someone had to propose it first. Interestingly, the simple model often yields a pretty good fit for the empirical data. The original paper by Engle has also been a starting point for many extensions and refinements of the model -- a sign there was something valuable about the original idea. Tens of thousands of citations (for ARCH and GARCH, and their extensions) later we see that the model has been widely accepted in the financial community, which is a very important measure when it comes to Nobel prizes. You cannot rule out something that has become a standard and a benchhmark in a sufficiently large field from the Nobel prize considerations, can you?&lt;/p&gt;&#xA;" OwnerUserId="19645" LastActivityDate="2017-06-20T18:16:11.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34787" PostTypeId="2" ParentId="34783" CreationDate="2017-06-20T18:21:56.297" Score="9" Body="&lt;p&gt;The best answer to your question is probably given by the Nobel prize committee itself in &lt;a href=&quot;http://www.nobelprize.org/nobel_prizes/economic-sciences/laureates/2003/advanced.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;The Prize in Economic Sciences 2003 - Advanced Information&quot;&lt;/a&gt; document. You should read it in full. Below is an excerpt. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to the committee:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Financial economists have long since known that volatility in returns tends to&#xA;  cluster and that the marginal distributions of many asset returns are leptokurtic, which means that they have thicker tails than the density of the normal distribution with the same mean and variance. Even though the time clustering of returns was known to many researchers, returns were still modeled as independent and identically distributed over time. Examples include Mandelbrot (1963) and Mandelbrot and Taylor (1967) who used so-called stable Paretian distributions to characterize the distribution of returns. &lt;strong&gt;Robert Engle’s modelling of time-varying volatility by way of autoregressive conditional heteroskedasticity (ARCH) thus signiﬁed a genuine breakthrough.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Suppose at time $t$ we observe the stochastic vector $(u_t, \mathbb{x}_t^{'})$ where $u_t$ is a scalar and $\mathbb{x}_t$ may contain some lags of $u_t$. The predictive model for the variable $u_t$ is $$ u_t = \mathbb{E}(u_t | \mathbb{x}_t) + \epsilon_t \tag{3.1} \label{one}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is typically assumed that $\mathbb{E}(u_t | \mathbb{x}_t)$ has a parametric form and $\mathbb{E}\epsilon_t = 0$, $\mathbb{E}\epsilon_t \epsilon_s = 0, \forall t \not = s$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When estimating the parameters in $\mathbb{E}(u_t | \mathbb{x}_t)$, it was typically assumed that the unconditional variance of the error term $\epsilon_t$ is constant or time-varying in an unknown fashion. Engle considered the alternative assumption that, while the unconditional error variance − if it exists − is constant, the &lt;em&gt;conditional&lt;/em&gt; error variance is time-varying.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This revolutionary notion made it possible to explain systematic features in the movements of variance over time and, a fortiori, to estimate the parameters of conditional variance jointly with the parameters of the conditional mean. &lt;strong&gt;The literature is wholly devoid of earlier work with a similar idea.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Engle parameterized the conditional variance of $\epsilon_t$ in the model $\eqref{one}$ such that large positive or negative errors $\epsilon_t$ were likely to be followed by another large error of either sign and small errors by a small error of either sign. Nowdays this is usually refered to as &lt;em&gt;volatility clustering&lt;/em&gt;. He assumed that $\epsilon_t$ can be decomposed as $\epsilon_t = z_t \sigma_t^{\frac{1}{2}}$ where ${z_t}$ is a sequence of iid random variables with zero mean and unit variance and where $$ \sigma_t = \operatorname{Var}(\epsilon_t | \mathcal{F}_t) = \alpha_0 + \sum_{j=1}^m \alpha_j \epsilon_{t-j}^{2} \tag{3.2}\label{two}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In $\eqref{two}$ $\epsilon_t = u_t - \mathbb{E}(u_t | \mathbb{x}_t)$, $\alpha_0 &amp;gt; 0$ and $\alpha_j \geq 0, j = 1, \cdots m$,  the information set $\mathcal{F}_t = \sigma(\{\epsilon_{t - j}, j \geq 1\})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equation $\eqref{two}$ deﬁnes the ARCH model introduced in &lt;a href=&quot;http://www.jstor.org/stable/1912773?seq=1#page_scan_tab_contents&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;Autoregressive conditional heteroscedasticity with estimates of the variance of United Kingdom inﬂation&quot;&lt;/a&gt;, where the conditional variance is a function of past values of squared errors.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In this classic paper, Engle developed the estimation theory for the ARCH model, gave conditions for the maximum likelihood estimators to be consistent and asymptotically normal, and presented a Lagrange multiplier test for the hypothesis of no ARCH (equal conditional and unconditional variance) in the errors $\epsilon_t$.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="15154" LastEditorUserId="15154" LastEditDate="2017-06-21T06:30:39.810" LastActivityDate="2017-06-21T06:30:39.810" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34788" PostTypeId="2" ParentId="34735" CreationDate="2017-06-20T19:21:31.207" Score="3" Body="&lt;p&gt;Every mutual fund/ETF is expected to pay a licensing fee to the index provider for the benchmark it tracks. I don't know whether index providers make that data available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, you could screen mutual funds/ETFs by benchmark and aggregate the market capitalization of the results.&lt;/p&gt;&#xA;" OwnerUserId="28473" LastActivityDate="2017-06-20T19:21:31.207" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34790" PostTypeId="1" CreationDate="2017-06-20T20:29:56.780" Score="-1" ViewCount="237" Body="&lt;p&gt;I'm working on a project to extract the reporting data of federal financial institutions from the FFIEC site (using Python programming). The data is coming from the Uniform Bank Performance Report (UBPR) which is in XBRL format -- a standard for business reporting in XML files.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a quick look at the data I have retrieved:&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;  &amp;lt;context id=&quot;CI_XYZ_2017-03-31&quot;&amp;gt;&#xA;    &amp;lt;entity&amp;gt;&#xA;      &amp;lt;identifier scheme=&quot;http://www.ffiec.gov/cdr&quot;&amp;gt;XYZ&amp;lt;/identifier&amp;gt;&#xA;    &amp;lt;/entity&amp;gt;&#xA;    &amp;lt;period&amp;gt;&#xA;      &amp;lt;instant&amp;gt;2017-03-31&amp;lt;/instant&amp;gt;&#xA;    &amp;lt;/period&amp;gt;&#xA;  &amp;lt;/context&amp;gt;&#xA;  ...&#xA;  &amp;lt;unit id=&quot;USD&quot;&amp;gt;&#xA;    &amp;lt;measure&amp;gt;iso4217:USD&amp;lt;/measure&amp;gt;&#xA;  &amp;lt;/unit&amp;gt;&#xA;  ...&#xA;  &amp;lt;uc:UBPR4635 contextRef=&quot;CI_XYZ_2017-03-31&quot; unitRef=&quot;USD&quot; decimals=&quot;0&quot;&amp;gt;6000&amp;lt;/uc:UBPR4635&amp;gt;&#xA;  &amp;lt;uc:UBPR4107 contextRef=&quot;CI_XYZ_2017-03-31&quot; unitRef=&quot;USD&quot; decimals=&quot;0&quot;&amp;gt;3471000&amp;lt;/uc:UBPR4107&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Everything in the snippet above except for the last two lines seems to contain metadata on the bank and the reporting period. According to &lt;a href=&quot;https://cdr.ffiec.gov/CDR/public/download/UserGuide/v77/FFIEC%20UBPR%20User%20Guide%20Summary%20Ratios--Page%201_2017-06-05.PDF&quot; rel=&quot;nofollow noreferrer&quot;&gt;this PDF&lt;/a&gt; published by the FFIEC, the codes UBPR4635 and UBPR4107 represent &quot;Gross Credit Losses&quot; and &quot;Total Interest Income&quot;, respectively. So the last two lines say that Bank XYZ reported \$6000 in gross credit losses and \$3,471,000 in total interest income for the reporting period ending 3/31/2017.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a few questions to help me better understand and parse this content:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;How are these files read in practice? Is there software available for working specifically with the UBPRs (in XBRL) from the FFIEC?&lt;/li&gt;&#xA;&lt;li&gt;Other than the PDFs provided &lt;a href=&quot;https://cdr.ffiec.gov/Public/DownloadUBPRUserGuide.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;, is there a set of definitions for the UBPR codes (e.g., UBPR4635 and UBPR4107)? Ideally, I would like the information that is in these PDFs, but in a format that is easier for a computer program to parse, such as CSV or XML. &lt;/li&gt;&#xA;&lt;li&gt;The PDFs containing the definitions for the UBPR codes were recently updated on 6/5/17. Do the definitions change or are there rules against that? For example, UBPR4635 means &quot;Gross Credit Losses&quot; today, but could it mean something different in the next update?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I appreciate any help you can provide to answer these questions.&lt;/p&gt;&#xA;" OwnerUserId="28472" LastEditorUserId="28472" LastEditDate="2017-06-22T16:58:06.180" LastActivityDate="2017-07-27T16:13:58.450" Title="Help to understand the XRBL format used in Uniform Bank Performance Reports (UBPR) from the FFIEC" Tags="&lt;python&gt;&lt;banks&gt;&lt;financial&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34791" PostTypeId="2" ParentId="34735" CreationDate="2017-06-20T21:49:19.590" Score="3" Body="&lt;p&gt;Some additional thoughts (that may be more work than you want to do):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Regress fund returns on FTSE 100 index returns and look for $R^2$ above some cutoff.&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Same thing but take a Bayesian approach, assign probabilities of indexing.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Download all prospectus and do textual analysis for phrases that indicate following the FTSE 100 index. &lt;/li&gt;&#xA;&lt;li&gt;You might be able to get a reasonable lower bound by manually checking assets under management (AUM) for some of the biggest passive fund companies: eg. Blackrock, Vanguard, etc... (I don't know what the big UK specific index players may be. HSBC?)&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Searching FTSE 100 on &lt;a href=&quot;http://www.morningstar.co.uk/uk/funds/SecuritySearchResults.aspx?search=FTSE%20100&amp;amp;type=&quot; rel=&quot;nofollow noreferrer&quot;&gt;Morningstar&lt;/a&gt; may be a reasonable source of data?&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-06-20T22:54:49.590" LastActivityDate="2017-06-20T22:54:49.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34794" PostTypeId="2" ParentId="32342" CreationDate="2017-06-21T05:50:54.553" Score="2" Body="&lt;p&gt;You are right in your skepticism when you say: &quot;Aren't these 3 days to fix the settlement just some form of administration which are not relevant for the trader anymore?&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Liquidity is the ease with which an asset can be converted into cash and vice versa without affecting its price too much. Post-trading settlement process's speed may hence not be a consideration for the relative liquidity of an asset. Take for example stocks of Apple are extremely liquid (it's important to remember that &quot;liquidity&quot; of an asset is an abstract notion and is usually understood in comparison to that of another asset). Now, how long the settlement process takes is a different issue. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is actually quite surprising that the paper you quoted misses/confuses the above point. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Liquidity on the blockchain pertains to whether or not there would be enough buyers and sellers in the market such that the market can discover the 'true' price of the asset. Remember that most of the trading in the current markets is done on information asymmetries (read: Stiglitz paradox) so if - in theory - perfect information prevails in a system with a public blockchain as the technological backend, what incentive is there to trade (apart from of course, demands for liquidity for reasons like death, disease, etc)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While, in theory, freeing up these funds sooner than later is a valid argument for increasing liquidity, I think it fades away in comparison to the volume of trading that goes on in public markets. Can a blockchain-based trading platform match that? Should it?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think it's an open question. &lt;/p&gt;&#xA;" OwnerUserId="28480" LastActivityDate="2017-06-21T05:50:54.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34796" PostTypeId="1" CreationDate="2017-06-21T09:49:32.617" Score="0" ViewCount="528" Body="&lt;p&gt;in a paper of Brennon&amp;amp;Schwartz (1977), they model embedded bond options by using an stochastic interest rate model which follows a geometric Brownian Motion.&#xA;Now they claim that this assumption does hold when we assume that the Pure Expectation Hypothesis holds? I do not get the link to that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Further, what are Pros &amp;amp; Cos of using a Geometric Browninan Motion as an Interest Rate process, in general?&#xA;What are state-of-the art models which are applied nowadays?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Greetings,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;KS&lt;/p&gt;&#xA;" OwnerUserId="24804" LastActivityDate="2017-06-22T06:54:47.367" Title="Short-Interest Rates Models - Geometric Brownian Motion?" Tags="&lt;models&gt;&lt;interest&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34797" PostTypeId="2" ParentId="18822" CreationDate="2017-06-21T13:45:56.600" Score="3" Body="&lt;p&gt;In some of their documents, QuantQuote say that they adjust the prices for dividends to provide price continuity. However, the formula they use is wrong. They use&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{price - dividend}{price}$$&#xA;as a factor to adjust prices backward when it should be &#xA;$$\frac{price}{price + dividend}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Over time this adds to a meaningful difference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also would like to add that from my interactions with them they are unprofessional at best and scammers at worst. I purchased data that I received in the wrong time resolution and they have never answered any of my calls or email to get the data I purchased. I would stay away from them and find a better source.&lt;/p&gt;&#xA;" OwnerUserId="28486" LastEditorUserId="26595" LastEditDate="2017-06-21T20:02:48.647" LastActivityDate="2017-06-21T20:02:48.647" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34798" PostTypeId="1" CreationDate="2017-06-21T14:58:58.163" Score="1" ViewCount="1191" Body="&lt;p&gt;I extract continuous prices for a set of futures contracts using Bloomberg. I select the Ratio as adjustment with the Bloomberg default settings. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;For instance, to extract the first/forward generic contract with the Ratio as adjustment you add B:00_0_R to the BB Ticker. So for CO1 Comdty you use CO1 B:00_0_R Comdty.&lt;/em&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The problem&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you extract the historical values up to today, then the adjusted price of  CO1 Comdty on 01/01/1990 is 8.92 (dataset A). However, if you extract only up to 28/04/2017 then the price is 8.79 (dataset B). This difference might not seem a lot, it has however significant implications on the performance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, when I backtest my model (lets assume a simple long-only), I obtain a Sharpe of 1.46 with dataset A. However, with the more recent dataset B, I obtain a Sharpe of 1.20. In addition, some years turn negative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering whether this is indeed a known issue with futures, and if so how deal with the problem?&lt;/p&gt;&#xA;" OwnerUserId="13334" LastActivityDate="2019-11-07T17:08:33.103" Title="Extracting continuous futures prices on different dates with the ratio adjustment" Tags="&lt;futures&gt;&lt;backtesting&gt;&lt;bloomberg&gt;&lt;roll-adjustment&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34799" PostTypeId="1" AcceptedAnswerId="34803" CreationDate="2017-06-21T15:53:25.057" Score="4" ViewCount="245" Body="&lt;p&gt;While I understand DB pension plans tend to use an ALM and surplus management framework to determine their asset allocation and risk/return objectives, I am wondering how in practice they determine the maximum amount of risk they are willing to take on. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I imagine it would be an extremely difficult quantitative problem given that there are many interrelated and difficult to predict variables: the nature of the liabilities, the probability and path dependency of a funding shortfall or benefit cuts, the confidence level of achieving a certain return etc. In practice, what approaches to risk tolerance are used in practice to model these variables, and what has been successful? &lt;/p&gt;&#xA;" OwnerUserId="17712" LastActivityDate="2017-06-22T04:45:33.353" Title="In practice, how do pension plans determine their risk appetite?" Tags="&lt;risk-management&gt;&lt;asset-allocation&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34801" PostTypeId="1" CreationDate="2017-06-22T02:23:36.933" Score="3" ViewCount="157" Body="&lt;p&gt;I am doing an assignment which requires me to review changes in market microstructure across countries over the pass 20 years. SO I would like to get a timeline/implementation dates of market structure developments (fragmentation, autoquote, HFT etc). For example, Reg NMS and miFID were implemented in Oct 2007 and Nov 2007, respectively. How about other developments such as an implementation of autoquote, decimilisation etc.&#xA;Is there a good report/ papers that provide such review?&lt;/p&gt;&#xA;" OwnerUserId="28494" LastActivityDate="2017-07-13T16:40:08.597" Title="history of market microstructure" Tags="&lt;high-frequency&gt;&lt;market-microstructure&gt;&lt;market-design&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34803" PostTypeId="2" ParentId="34799" CreationDate="2017-06-22T04:45:33.353" Score="3" Body="&lt;p&gt;I think there are many approaches to setting risk tolerance/appetite limits. Here are some examples that you may find interesting (from the most clearest):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.nzsuperfund.co.nz/sites/default/files/documents-sys/Risk%20Management%20Policy.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Risk Management Policy of NZ Superannuation (or universal retirement income)&lt;/a&gt;:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The Investment Risk Appetite of the Fund is: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ol&gt;&#xA;  &lt;li&gt;Relative (1 year) - Fund return 3 standard deviations from Reference&#xA;  Portfolio (&gt; -6.5% or &gt; 8.5%); &lt;/li&gt;&#xA;  &lt;li&gt;Absolute (1 year) - Loss greater than&#xA;  25% of Fund value; &lt;/li&gt;&#xA;  &lt;li&gt;Absolute (since inception) - Return &gt;3% below&#xA;  risk free rate;&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Also read their &lt;a href=&quot;https://www.nzsuperfund.co.nz/sites/default/files/documents-sys/Investment%20Beliefs.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Investment Beliefs&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.investpsp.com/pdf/risk-appetite-overview.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;PSP Investments&lt;/a&gt;:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This assumption of the Government’s risk appetite, referred to as the&#xA;  “Risk Appetite Assumption”, is determined by reviewing, through&#xA;  assetliability studies, the pension funding risk resulting from simply&#xA;  investing in a passive portfolio (aka Policy Portfolio) that would&#xA;  replicate market indices of public debt and equity markets. This&#xA;  passive portfolio is designed with the lowest possible investment risk&#xA;  consistent with the Return Objective.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And going through their &lt;a href=&quot;http://www.investpsp.com/pdf/PSP-AR-2015-complete.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;2015 Annual Report&lt;/a&gt; I found this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/779HP.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/779HP.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Active management activities form the second pillar of&#xA;  PSP Investments’ approach. These activities are implemented within&#xA;  an active risk limit and the risk appetite to generate additional&#xA;  returns over the Policy Portfolio.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So my guess here is that they are creating their in-house index of Policy Portfolio and setting tracking error limits for their active funds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may be able to find some other approaches, but many pension funds seem to be less clear about their methodology. For example, see &lt;a href=&quot;https://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=4&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0ahUKEwirrIqOytDUAhXPLFAKHc8RBQwQFgg_MAM&amp;amp;url=https%3A%2F%2Fwww.actuaries.org.uk%2Fdocuments%2Fkeynote-address-rationale-strategic-asset-allocation-norwegian-government-petroleum-fund&amp;amp;usg=AFQjCNG3ssJmxtWBQ7GsdeBHhIQXriCd8g&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; presentation to get some idea about NBIM's approach. They also use Benchmark Portfolio and I think have tracking error limits along with other metrics.&lt;/p&gt;&#xA;" OwnerUserId="19096" LastActivityDate="2017-06-22T04:45:33.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34805" PostTypeId="2" ParentId="34796" CreationDate="2017-06-22T06:54:47.367" Score="1" Body="&lt;p&gt;By &quot;Pure Expectation Hypothesis&quot; they mean that they are specifying the stochastic dynamics for the instantaneous interest rate directly under the risk neutral measure so that &quot;the expected instantaneous rate of return on any default free security is the instantaneous interest rate&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However their model does not match the initial curve so that in fact contradicts this &quot;pure expectation hypothesis&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order for a short rate model to match the initial discount curve you generally need to have a time dependent term in the drift which is calibrated to the initial curve, if possible in closed form. Also you generally want short rate models to have a mean reversion feature so that you do not get very large rates over long time horizons. The Hull &amp;amp; White model is the simplest model that combines these features. &lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2017-06-22T06:54:47.367" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34806" PostTypeId="1" CreationDate="2017-06-22T07:36:33.050" Score="2" ViewCount="732" Body="&lt;p&gt;Suppose an asset follows the SDE&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ d S_{t}^{1} = \mu S_{t}^{1} dt + \sigma_{t} S_{t}^{1} d W_{t} $$&#xA;Furthermore assume that $r = 0$ and a trader who uses Black-Scholes for pricing and hedging with volatility $\sigma^*$ for a terminal value claim with payoff $h(S_T)$. Then the price of the claim under BS is given as the solution of the PDE&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ h_t^BS(t,S) + \frac{1}{2} (\sigma^*)^2 S^2 h_{SS}^{BS}(t,S_t^1) = 0  $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $h_t^BS(t,S) = h(S)$.&lt;br&gt;&#xA;The tracking error of his hedge is then given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$e_T = h(S_t) - V_T $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can be shown that in this case it is equal to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ e_T = \frac{1}{2} \int_0^T ( S_{t}^{1})^2 (\sigma_t^2 - \sigma^*) h_{SS}^{BS}(t,S_t^1) dt $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now suppose that the trader sells a plain vanilla call option and replicates this option with a stock postion equal to the delta of the call. &#xA;Hence, at this time point $t$ he is delta neutral. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now suppose the true volatility $\sigma_t^2$ is bigger than the volatility $\sigma^*$ he used for replication. According to the formula $(\sigma_t^2 - \sigma^*) &amp;gt; 0 $ and the gamma of the position is $$h_{SS}^{BS}(t,S_t^1) &amp;gt; 0 $$&#xA; Hence, $$e_T &amp;gt; 0$$ and the trader makes a loss.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From an intuitive stand point this is clear for me - the trader is short a call option which has a convex payoff - for a large move of $S_t$ the option will gain more value than this hedging portfolio and since he is short the option he will have a loss. However, it is not clear for me why $$h_{SS}^{BS}(t,S_t^1) &amp;gt; 0 $$ - the call option has a positive gamma since again it has a convex payoff but he is $\textbf{short}$ the option hence the gamma would be negative as far as I see.&lt;/p&gt;&#xA;" OwnerUserId="25997" LastActivityDate="2018-12-14T01:58:22.300" Title="Tracking error Black Scholes" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;hedging&gt;&lt;option-strategies&gt;&lt;delta-hedging&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34807" PostTypeId="2" ParentId="34784" CreationDate="2017-06-22T07:42:10.890" Score="2" Body="&lt;p&gt;It depends what you want to do with your knowledge after completing a course and your background. Do you want to end up with a degree and hence improve your future career opportunities (get a job in a hedge fund) or do you want to jump start and trade on your own? For the latter I would suggest The Python Quants: &lt;a href=&quot;http://training.tpq.io/algo_brochure.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://training.tpq.io/algo_brochure.pdf&lt;/a&gt; If you want to take it all the way, then consider taking a masters degree over two years at WorldQuant University: &lt;a href=&quot;https://wqu.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://wqu.org/&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="16937" LastActivityDate="2017-06-22T07:42:10.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34808" PostTypeId="2" ParentId="34806" CreationDate="2017-06-22T08:10:31.353" Score="2" Body="&lt;p&gt;Ok after going trough it again $h_{SS}^{BS}(t,S_{t}^{1})$ represents here the Gamma of the option independent of the position the trader took in it. Since the payoff is convex gamma is positiv.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quick example to cross check it: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuitive approach:When a trader buys a call and hedges it he would profit from a higher volatility then he used for pricing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Approach with the formula: Would he have bought one call and replicated it then he would have a profit if  $e_T &amp;gt; 0 $ since it would imply $h(S_T) &amp;gt; V(T)$. This mean for $\sigma_t^2 &amp;gt; \sigma^*$ the formula of the tracking error again yields a positive outcome since also $h_{SS}^{BS}(t,S_{t}^{1})  &amp;gt; 0 $.&lt;/p&gt;&#xA;" OwnerUserId="25997" LastActivityDate="2017-06-22T08:10:31.353" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34809" PostTypeId="1" CreationDate="2017-06-22T08:51:18.450" Score="4" ViewCount="2279" Body="&lt;p&gt;I have been trying to understand the H&amp;amp;W model expression for zero coupon bond price volatilities:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\nu_B(t_0,t_M)=-\frac{\nu_r}{m}(1-e^{-m\tau_{0,M}})$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\nu_B(t_0,t_M)$ is zero coupon bond price volatility, $\nu_r$ is the short rate volatility, $m$ is the mean-reversion level (or speed?) and $\tau_{0,M}$ is the time to maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have looked in all the associated papers but found no exact match for this expression. What is the intuition and how exactly do you get this expression?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: made notation clearer&lt;/p&gt;&#xA;" OwnerUserId="28388" LastEditorUserId="11678" LastEditDate="2017-06-22T22:16:21.733" LastActivityDate="2021-02-02T18:15:36.887" Title="Zero-coupon bond price volatility with one factor Hull White interest rate model" Tags="&lt;bond&gt;&lt;hullwhite&gt;&lt;heath-jarrow-morton&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34811" PostTypeId="1" CreationDate="2017-06-22T14:56:47.930" Score="1" ViewCount="58" Body="&lt;p&gt;Suppose $S_t^1$ and $S_t^2$ are two stocks following GBMs and have current value $s_1$ and $s_2$ respectively.  How can I explicitly compute the payoff&#xA;$$&#xA;V(t,s_1,s_2)\triangleq \mathbb{E}\left[&#xA;1_{\{S_T^1&amp;gt;S_t^2\}}&#xA;\mid S_t^1=s_1,\, S_t^2=s_2&#xA;\right],&#xA;$$&#xA;where $T\geq t$ and $1$ is the indicator function of the event that $S_T^1$ will exeed the value of $S_T^2$ at time $T$.  &lt;/p&gt;&#xA;" OwnerUserId="11582" LastActivityDate="2017-06-23T00:27:46.643" Title="Payoff of an odd indicator of one stock being greater than another" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;stochastic-calculus&gt;&lt;futures&gt;&lt;binary-options&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34812" PostTypeId="1" CreationDate="2017-06-22T15:03:51.847" Score="1" ViewCount="937" Body="&lt;p&gt;Can we use USD LIBOR as spot rates for discounting?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we have overnight LIBOR and say 1 month LIBOR how to compute 16 day LIBOR? Can we do interpolation?&lt;/p&gt;&#xA;" OwnerUserId="28091" LastActivityDate="2017-06-22T23:25:30.383" Title="Is LIBOR a spot rate?" Tags="&lt;libor&gt;&lt;spot-rate&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34813" PostTypeId="2" ParentId="34367" CreationDate="2017-06-22T15:12:09.763" Score="1" Body="&lt;p&gt;The first response is wrong, you can do this providing the venue is operating a central limit order book and you can match with their client flow. There are several venues or liquidity pools that allow this. If your limit order is at the top of book and someone wants to trade at that price then you will be filled at your price. Making money purely from the spread in FX isn't easy as it is a highly fragmented market and you are relying on the ability to exit your position before the market moves against you. Most market making strategies are using some sort of short term price prediction unless you can get access to really soft flow. Plenty of people are doing what you describe and making nice money, not millions but a good income. If you want to go beyond that you really need some alpha strategies built in.&lt;/p&gt;&#xA;" OwnerUserId="28499" LastActivityDate="2017-06-22T15:12:09.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34816" PostTypeId="1" AcceptedAnswerId="34864" CreationDate="2017-06-22T18:20:53.887" Score="0" ViewCount="103" Body="&lt;p&gt;If I manage a Real Estate portfolio with approximately 400 million in debt, which is roughly 50% Loan-to-Value (the properties are worth about 800 million).    Is it possible to synthesize a bond position to effectively pay down the debt?  Due to prepayment penalties, actually paying down the debt is not an option.  If I recall correctly from my &quot;finance I learned but never applied in the real world&quot;, my position as a borrower can be described as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;-X = -S - P + C (as a borrower we are paying interest, so I would have to be short the bond position.  This can be synthesized by shorting stock, writing a European Put Option maturing when the loan matures, and purchasing a European Call Option maturing when the loan matures).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To offset these, we would effectively have to become a lender/receive interest, which would re-arrange to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;X = S + P - C (long stock position, going long a European Put Option maturing  when the loan matures, and writing a European Call Option maturing when the loan matures).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the real world, I've only ever entered into contracts for interest rate swaps, so what I'm wondering is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Is this actually achievable/how it works?  How would you go about actually executing the transaction?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) If 1 is true, is this efficient?  Is there a better way to go about this?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) What would the &quot;Stock&quot; be in this scenario?  If the loan is fixed with a spread over the UST (for example 130bps over a 5-yr UST that is 200bps for a rate of 3.30%), would the &quot;stock&quot; be the 5-yr UST?&lt;/p&gt;&#xA;" OwnerUserId="2732" LastEditorUserId="2345" LastEditDate="2017-06-26T09:36:18.333" LastActivityDate="2017-06-26T09:36:18.333" Title="Is there a way of synthetically deleveraging a Real Estate portfolio?" Tags="&lt;options&gt;&lt;derivatives&gt;&lt;real-estate&gt;&lt;synthetic&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34818" PostTypeId="1" AcceptedAnswerId="34820" CreationDate="2017-06-22T18:57:46.180" Score="2" ViewCount="60" Body="&lt;p&gt;I have Bloomberg Data &lt;code&gt;PX_LAST&lt;/code&gt; for the MSCI world (MXWO Index). I also have Bloomberg Data &lt;code&gt;PX_LAST&lt;/code&gt; for all subindices for the MSCI world. My goal is to compute from the subindices the return of the index. I tried log and percentage returns and aggregating based on these formulas. I weighted them like that,&#xA;$$\textrm{weight Subindex}_i=\frac{\textrm{PX_LAST}_i}{\sum\textrm{PX_LAST}_j}&#xA;$$&#xA;&lt;a href=&quot;https://i.stack.imgur.com/SaDMh.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/SaDMh.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, the results do not match the returns of the index itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Where can I find information on how the MSCI world index is aggregated from its subindices?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Does anybody know how they are aggregated?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found this link &lt;a href=&quot;https://www.msci.com/index-methodology&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.msci.com/index-methodology&lt;/a&gt; but wasn't lucky finding any info there either.&lt;/p&gt;&#xA;" OwnerUserId="22744" LastActivityDate="2017-06-22T19:32:15.097" Title="Aggregation to MSCI world return from subindicies" Tags="&lt;returns&gt;&lt;log-returns&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34819" PostTypeId="2" ParentId="34809" CreationDate="2017-06-22T19:01:35.467" Score="5" Body="&lt;p&gt;Based on &lt;a href=&quot;https://quant.stackexchange.com/questions/21513/extended-hull-white-interest-rate-model-for-zero-coupon-bond/21516#21516.&quot;&gt;this question&lt;/a&gt;, for the Hull-White model of the form&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}&#xA;dr_t = (\theta(t)-a r_t) dt + \sigma dW_t,&#xA;\end{align*}&lt;/span&gt;&#xA;where &lt;span class=&quot;math-container&quot;&gt;$a$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$\sigma$&lt;/span&gt; are constants, &lt;span class=&quot;math-container&quot;&gt;$a(t)$&lt;/span&gt; is a deterministic function, and &lt;span class=&quot;math-container&quot;&gt;$W_t$&lt;/span&gt; is a standard Brownian motion, the price at time &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt; of a zero-coupon bond with maturity &lt;span class=&quot;math-container&quot;&gt;$T$&lt;/span&gt; and unit face value is given by&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}&#xA;P(t, T) &amp;amp;= A(t, T) e^{-B(t, T) r_t},&#xA;\end{align*}&lt;/span&gt;&#xA;where&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}&#xA;B(t, T) = \frac{1}{a}\Big(1-e^{-a(T-t)} \Big),&#xA;\end{align*}&lt;/span&gt;&#xA;and&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}&#xA;A(t, T) &amp;amp;= \exp\left(- \int_t^T  \theta(u) B(u, T) du -\frac{\sigma^2}{2a^2}\big(B(t, T) -T+t\big)-\frac{\sigma^2}{4a}B(t, T)^2\right).&#xA;\end{align*}&lt;/span&gt;&#xA;Note that&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}&#xA;\ln P(t, T) = \ln A(t, T) -B(t, T) r_t.&#xA;\end{align*}&lt;/span&gt;&#xA;Therefore,&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}&#xA;d\ln P(t, T) &amp;amp;=\frac{\partial \ln A(t, T)}{\partial t}dt - r_t \frac{\partial B(t, T)}{\partial t} dt- B(t, T) dr_t\\&#xA;&amp;amp;=\frac{\partial \ln A(t, T)}{\partial t}dt - r_t \frac{\partial B(t, T)}{\partial t} dt- B(t, T) (\theta(t)-a r_t) dt - \sigma B(t, T) dW_t.&#xA;\end{align*}&lt;/span&gt;&#xA;That is, the zero-coupon bond price volatility is of the form&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{align*}&#xA;\sigma B(t, T) = \frac{\sigma}{a}\Big(1-e^{-a(T-t)} \Big).&#xA;\end{align*}&lt;/span&gt;&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2021-02-02T18:15:36.887" LastActivityDate="2021-02-02T18:15:36.887" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="34820" PostTypeId="2" ParentId="34818" CreationDate="2017-06-22T19:32:15.097" Score="2" Body="&lt;p&gt;The document you're looking for is &lt;a href=&quot;https://www.msci.com/eqb/methodology/meth_docs/MSCI_June2017_IndexCalcMethodology.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;MSCI Index Calculation Methodology&lt;/a&gt;. At a very high level, MSCI indices are market-cap weighted. A crude aggregation would require that you weight the component returns by their market cap as a percentage of total market cap. For example, US currently has a 59% weighting in the index (where 59% = US market cap / world market cap). Doing this should get you close, but if you need exact values, you need to follow the formulas in the document precisely.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2017-06-22T19:32:15.097" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34821" PostTypeId="2" ParentId="34367" CreationDate="2017-06-22T20:28:10.383" Score="3" Body="&lt;p&gt;This paper &lt;a href=&quot;https://arxiv.org/abs/1610.00261&quot; rel=&quot;nofollow noreferrer&quot;&gt;Limit Order Strategic Placement with Adverse Selection Risk and the Role of Latency&lt;/a&gt; (by L and Mounjid) is probably exactly what you expect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is explained how (given a model of orderbook dynamics close to the &lt;a href=&quot;https://arxiv.org/abs/1312.0563&quot; rel=&quot;nofollow noreferrer&quot;&gt;Queue reactive model&lt;/a&gt;) to decide to cancel or not a limit order with respect of the state of the bid and ask queue sizes and your position in the queue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;if you are on the weak side of the book, you should rather cancel (to fear adverse selection)&lt;/li&gt;&#xA;&lt;li&gt;and you are on the strong side, you should stay (and possibly have a good rank in the queue).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Statistics are provided using real data from nasdaq-omx (nordic European equity markets), on which you have the name of the owners of executed orders, hence real data give clues on the different behaviour between HFT, banks and brokers.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2017-06-22T20:35:10.257" LastActivityDate="2017-06-22T20:35:10.257" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34823" PostTypeId="2" ParentId="34812" CreationDate="2017-06-22T23:25:30.383" Score="3" Body="&lt;p&gt;First question can't be answered without knowing what you are discounting.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second question you are asking whether the rate of a 16 day interbank loan can be obtained from interpolating an overnight rate and a 1 month bank loan.  I would say it is a reasonable guess.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-06-22T23:25:30.383" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34824" PostTypeId="2" ParentId="34811" CreationDate="2017-06-23T00:27:46.643" Score="2" Body="&lt;p&gt;The price is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$e^{-r(T-t)} \mathbb{P}(S_{T}^{1} &amp;gt; S_{T}^2) =e^{-r(T-t)} \mathbb{P}(S_{T}^{1} / S_{T}^2 &amp;gt;1) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The crucial point is that the ratio of two log-normals is log-normal even when they are not perfectly correlated so it just comes down to a cumulative normal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We assume vols are $\sigma_1$ and $\sigma_2$. Correlation between driving BMs is $\rho.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $C_{11} = \sigma_{1}^{2}(T-t),C_{22} = \sigma_{2}^{2}(T-t), C_{12} = \rho \sigma_1 \sigma_2(T-t).$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can write&#xA;$$&#xA;S_{T}^{1}= S_{t}^{1} e^{-0.5 C_{11} + \sqrt{C_{11}} Z},$$&#xA;$$&#xA;S_{T}^{2}= S_{t}^{2} e^{-0.5 C_{22} + \sqrt{C_{22}} (\rho Z + \sqrt{1-\rho^2}W)},$$&#xA;with $W$ and $Z$ independent standard normals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So&#xA;$$&#xA;S_{T}^{1} / S_{T}^2 = \frac{S_{t}^{1}}{S_{T}^{2}} e^{-0.5 C_{11} +0.5 C_{22} + \sqrt{C_{11}} Z- \sqrt{C_{22}} (\rho Z + \sqrt{1-\rho^2}W)}.&#xA;$$&#xA;The rest is straightforward.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2017-06-23T00:27:46.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34826" PostTypeId="1" AcceptedAnswerId="34828" CreationDate="2017-06-23T02:58:17.497" Score="-1" ViewCount="49" Body="&lt;p&gt;I have the following issue:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need to calculate the daily income of a financial application over a period based on a percentage of a daily financial index. The problem is that for each day, this index has a different value. For example:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Date     value&#xA;Apr-1    0,048089%&#xA;Apr-2    0,045442%&#xA;Apr-3    0,041886%&#xA;and so on...&#xA;Apr-31   0,035450%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;On April 1, the initial value of the investment was $ 1,000. How much will the total be on April 31st?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to get the final value using a single formula?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way I do today, I need to calculate the day-to-day balance.&lt;/p&gt;&#xA;" OwnerUserId="28000" LastActivityDate="2017-06-23T09:29:58.573" Title="How to calculate daily interest at different rates each day?" Tags="&lt;interest-rates&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2017-06-23T19:02:01.060" ContentLicense="CC BY-SA 3.0" />
  <row Id="34828" PostTypeId="2" ParentId="34826" CreationDate="2017-06-23T09:29:58.573" Score="0" Body="&lt;p&gt;if the values are calculated using discrete compounding, you could do the following.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Formula in Excel:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;=PROD(1+A1:A31)*1000&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;one line in R&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;prod(1+df$value)*1000&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;A word of warning: if you are using this to compound interest rates other than overnight rates, you are on the wrong track.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, I will vote to close the question since its too basic.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2017-06-23T09:29:58.573" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34829" PostTypeId="1" AcceptedAnswerId="34830" CreationDate="2017-06-23T10:41:49.707" Score="0" ViewCount="1445" Body="&lt;p&gt;Let $P_{t}(\pi)$ be the price at time t of a zero coupon bond with time to maturity $\pi$. Furthermore, let $f_{t}(\pi_1, \pi_2)$ be the forward rate that is earned over the time period $[\pi_1, \pi_2]$. Suppose that we are now at time $t=0$ and want to value an interest rate swap over 5 periods with notional amount 1.  We should value both the fixed leg and the floating leg.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly, for the fixed leg with swap rate 1% we have $$PV_{fixed}=0.01\sum_{\pi=1}P_{0}(\pi)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I dont understand why we also have $$PV_{floating}=\sum_{\pi=1}^{5}f_0(\pi-1,\pi)P_{0}(\pi)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What do the forward rates have to do with the floating rates?&lt;/p&gt;&#xA;" OwnerUserId="26106" LastActivityDate="2017-06-23T15:12:26.097" Title="Valuing the floating leg of a swap" Tags="&lt;fixed-income&gt;&lt;swaps&gt;&lt;interest-rate-swap&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34830" PostTypeId="2" ParentId="34829" CreationDate="2017-06-23T11:49:40.587" Score="1" Body="&lt;p&gt;Forward rates are the implied, no-arbitrage floating rate in the 'future'.  I use this term loosely here because nobody really pretends that these rates are actually realized in the future, but, mathematically, forward rates are implied fundamentally as:&#xA;The rate that would make you indifferent between locking in an interest rate from t0 to t1 and then rolling into another (pre-decided rate) between t1 and t2, or just one, &quot;spot&quot; rate from t0 to t2 outright.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mathematically:&#xA;\begin{equation}&#xA;(1+f_{0,1})*(1+f_{1,2}) = (1+r_{0,2})&#xA;\end{equation}&#xA;(note that i ignored compounding and conventions to show the simple case, so this assumes each forward is only compounded for the single period and day-counts perfectly match)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where technically&#xA;\begin{equation}&#xA;f_{0,1}=FloatingRate_{0}&#xA;\end{equation}that is, the first forward rate is the first/current known floating rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The implied forwards of the current floating rate are used for pricing the legs of the swap to get 0 NPV (assuming vanilla swap). If you have a full forwards curve, or a full zero curve, then you can simply solve for the other (assuming the times align, if not you have to use what is called 'stub rates', but won't get into that).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When it comes to swap value, qualitatively the link between floating and forward rates are simply: if the floating rate does not follow the path of the initial implied forwards (at entry of the swap contract), then the value of the swap will change. At first this statement may seem strange, because often swaps are viewed as a bet on the fixed rate leg and that rate moving up and down. But think about how the swap is valued. In theoretical pricing we solve for the fixed leg (in practice you may find yourself solving for a spread to the float leg, but won't get into that here). So what actually causes the fixed leg to change? Well, if the zero curve moves (or par curve on which zero rates are implied) then now your implied forwards have changed! Obviously now your swap has changed in value from the 0NPV entry point (ok... it's possible things shift in ways that it stays near 0... but you get the point). So in reality it makes more sense to think about a swap as a bet on implied forward rates, but nobody really does because it is easier to measure in dollar value of basis point terms on the fixed leg.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I understood your question this should help establish the relationship between floating and forward rates. I would point out that when I say &quot;0NPV&quot; it is not because the PV of each legs is zero, but rather the difference between the two is zero, so that in aggregate the two legs cancel out in PV upon entry.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Forwards and how they relate to discount factors (which are present values of zero coupon bonds. I admit some of your subscripts confuse me a bit just because I'm not used to seeing it that way, but it looks correct to me so hopefully you can relate the following back to your notation):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;(1+f_{0,1})(1+f_{1,2})=(1+r_{0,2})&#xA;\end{equation}&#xA;\begin{equation}&#xA;1/(1+f_{0,1})*1/(1+f_{1,2})=1/(1+r_{0,2})&#xA;\end{equation}&#xA;\begin{equation}&#xA;where: 1/(1+r)=DF&#xA;\end{equation}&#xA;\begin{equation}&#xA;DF_{0,1}*1/(1+f_{1,2})=DF_{0,2}&#xA;\end{equation}&#xA;\begin{equation}&#xA;DF_{0,1}/DF_{0,2}=(1+f_{1,2})&#xA;\end{equation}&#xA;I purposely left the forward rate because this is often how I've seen the relationship stated, however if we take 1/ both sides, it is equivalent to:&#xA;\begin{equation}&#xA;DF_{0,2}/DF_{0,1}=DF_{1,2}&#xA;\end{equation}&#xA;but \begin{equation} DF_{1,2}\end{equation} doesnt really have much economic intuition (it's a 'future present value' so to speak) in practice, so it is avoided, but we can still reconcile to your formula in the comments:&#xA;Firstly, lets get this out of the way:&#xA;\begin{equation}&#xA;DF_{0,t}=P_0(t)=1/(1+r_t)&#xA;\end{equation}&#xA;In the general case where we allow for different time periods we then have:&#xA;\begin{equation}&#xA;P_0(t)/P_0(t-1)=P_{t-1}(t)&#xA;\end{equation}&#xA;simple rearrange:&#xA;\begin{equation}&#xA;P_0(t)/P_{t-1}(t)=P_0(t-1)&#xA;\end{equation}&#xA;where i've used t instead of pi, which IMO is less confusing, and I think the formula you have in the comments erroneously uses both.&lt;/p&gt;&#xA;" OwnerUserId="28514" LastEditorUserId="28514" LastEditDate="2017-06-23T15:12:26.097" LastActivityDate="2017-06-23T15:12:26.097" CommentCount="15" ContentLicense="CC BY-SA 3.0" />
  <row Id="34834" PostTypeId="1" CreationDate="2017-06-23T16:05:08.443" Score="8" ViewCount="940" Body="&lt;p&gt;I've already seen &lt;a href=&quot;https://quant.stackexchange.com/questions/489/correlation-between-prices-or-returns&quot;&gt;this&lt;/a&gt; question and read through all the answers, but I'm still confused about why you shouldn't use price correlation in a pairs trade strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, if I'm looking at the price ratio between two stocks, and I find the current price ratio deviates from the norm, doesn't a high price correlation tell me that the two prices are bound to converge to the same movements and so I have an opportunity to sell high and buy low? &lt;/p&gt;&#xA;" OwnerUserId="28520" LastActivityDate="2019-09-06T15:47:57.257" Title="Why isn't it appropriate to use correlation between prices in a pairs trade strategy?" Tags="&lt;correlation&gt;&lt;pairs-trading&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34836" PostTypeId="2" ParentId="34834" CreationDate="2017-06-23T18:51:05.400" Score="5" Body="&lt;p&gt;You could, and it doesn't hurt for you to test this yourself. Some of my best work has come from drawing the opposite conclusion to conventional wisdom or stylized &quot;facts&quot; in publications.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, it's trivial to construct an example where you won't be able to spread a correlated pair. Suppose the underlying data generation process is &lt;span class=&quot;math-container&quot;&gt;$y_t = x_t^2$&lt;/span&gt;, you will find very high correlation between the two but obviously &lt;span class=&quot;math-container&quot;&gt;$x_t \in \mathbb{o}\left(y_t\right)$&lt;/span&gt; and the two will diverge.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="4660" LastEditDate="2019-09-06T15:47:57.257" LastActivityDate="2019-09-06T15:47:57.257" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="34837" PostTypeId="2" ParentId="34834" CreationDate="2017-06-23T18:56:49.040" Score="4" Body="&lt;p&gt;If you are correlating prices that would imply that you are sizing positions based on the number of shares in each position.  This can result in a book that is very biased in terms of dollars invested.  This is not conventional and actually, makes little sense--most of the time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most pair trading strategies weight positions by dollar value which is why normally, percentage changes would be used to correlate.&lt;/p&gt;&#xA;" OwnerUserId="26556" LastActivityDate="2017-06-23T18:56:49.040" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34838" PostTypeId="1" CreationDate="2017-06-23T22:05:25.967" Score="1" ViewCount="179" Body="&lt;p&gt;How do exchanges decide the tick sizes? I wonder which factors are taken into account to make the decision.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that from time to time tick sizes are changed, e.g. &lt;a href=&quot;https://web.archive.org/web/20170623220320/http://www.cmegroup.com/tools-information/lookups/advisories/ser/files/SER-7425.pdf?mkt_tok=3RkMMJWW&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://web.archive.org/web/20170623220320/http://www.cmegroup.com/tools-information/lookups/advisories/ser/files/SER-7425.pdf?mkt_tok=3RkMMJWW&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Gg23S.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Gg23S.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2183" LastActivityDate="2017-06-24T01:47:28.537" Title="How do exchanges decide the tick sizes?" Tags="&lt;exchange&gt;&lt;tick&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34840" PostTypeId="2" ParentId="34838" CreationDate="2017-06-24T01:47:28.537" Score="1" Body="&lt;p&gt;(1) The tick size puts a lower bound on the bid-ask spread (and often is equal to the bid-ask spread)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tick size too big: the bid-ask spread (which the market maker earns but the customers pay) is too big. Favors the market-makers at the expense of the customers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tick size too small: vice versa.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore the tick size influences the transaction cost.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) The tick size is inversely proportional to the number of levels where limit orders can accumulate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tick size to small: many price levels to choose from, relatively few limit orders at each price level (short queues). Relatively little depth at each level and therefore frequent small changes in price (microvolatility).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tick size too large: few price levels, each with many limit orders queued. Prices stay constant for a long time without changing, but limt orders take a long time to move to the front of the queue and get executed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Influences the &quot;cost of immediacy&quot; i.e. whether limit orders or maket orders are favored.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-06-24T01:47:28.537" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34842" PostTypeId="2" ParentId="21429" CreationDate="2017-06-24T12:12:03.447" Score="0" Body="&lt;p&gt;If I got your question correct, i guess this is what you are referring to - &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Value of the floating leg = (K + 1)/(1+r) where k = interest payment based on the LIBOR during the previous reset point, r = spot rate until the next reset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question is why we are considering the immediately next coupon payment date for valuation of floating rate..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Answer - the coupon rate on the floating rate is reset on every reset date so as to make the value of floating leg = 1 or par on that date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the amount =1 in the above equation represents the PV of all the future cashflows as on the next reset date. Add to that the coupon payment on the next payment date essentially gives you the value of the floating leg as on the next reset date. Discount it today's date to give the value of the floating leg as of today.&lt;/p&gt;&#xA;" OwnerUserId="28526" LastActivityDate="2017-06-24T12:12:03.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34847" PostTypeId="1" AcceptedAnswerId="34908" CreationDate="2017-06-25T04:46:10.723" Score="0" ViewCount="90" Body="&lt;p&gt;I was wondering if anyone is familiar with how credit default swaps can be used for corp funding and financing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I came across an old case where a bank created a funding structure for a client (asset manager).  However, I'm not familiar with how this takes place.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any insight on the above would be greatly appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you,&#xA;Faisal&lt;/p&gt;&#xA;" OwnerUserId="28536" LastActivityDate="2017-06-28T18:07:50.257" Title="CDS for Funding" Tags="&lt;derivatives&gt;&lt;cds&gt;&lt;credit-derivatives&gt;&lt;sovereign-cds&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34852" PostTypeId="1" CreationDate="2017-06-25T15:50:24.107" Score="0" ViewCount="879" Body="&lt;p&gt;In Section 7.5 of Hull 9/e, he states,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Note that 5-year swap rates are less than 5-year AA [LIBOR] borrowing rates&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and gives a creditworthiness argument as to why this is so.  However, on the next page, he works out the following example in which the swap rate is above the corresponding LIBOR rate:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Suppose that the 6-month, 12-month, and 18-month LIBOR/swap zero rates have been determined as 4%, 4.5%, and 4.8% with continuous compounding and that the 2-year swap rate (for a swap where payments are made semiannually) is 5%.  This 5% swap rate means that a bond with a principal of \$100 and a semiannnual coupon of 5% per annum sells for par.  It follows that, if $R$ is the 2-year zero rate, then&#xA;  $$&#xA;2.5e^{-0.04\times 0.5} + 2.5e^{-0.045\times 1.0} + &#xA;2.5e^{-0.048\times 1.5} + 102.5e^{-R\times 2.0} = 100&#xA;$$&#xA;  Solving this, we obtain $R = 4.953$%.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Note the 2-year borrowing rate is less than the 2-year swap rate: $4.953\% &amp;lt; 5\%$.  In other words, there does not seem to be a mathematical reason as to why the $n$-year swap rate should be less than the $n$-year LIBOR rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could someone explain this apparent contradiction? &lt;/p&gt;&#xA;" OwnerUserId="6866" LastEditorUserId="17606" LastEditDate="2017-06-26T09:37:01.190" LastActivityDate="2017-09-19T06:51:06.240" Title="Swap Rates Below LIBOR?" Tags="&lt;interest-rates&gt;&lt;interest-rate-swap&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34854" PostTypeId="1" CreationDate="2017-06-25T16:54:46.233" Score="2" ViewCount="72" Body="&lt;p&gt;I'm currently reading a paper (&lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2543702&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2543702&lt;/a&gt;) which uses the following process to describe the dynamics of a firm's asset value:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;V_t = V_0e^{X_t},\quad\text{where } X_t = \bigg(r - \delta -  \frac{\sigma^2}{2} - \lambda \xi \Bigg)t + \sigma W_t + \sum_{k=1}^{N_t}Y_k.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The parameters $r$, $\delta$, $\sigma$, $\lambda$ and $\xi$ are constants. $W$ is standard Brownian motion, $N$ is a Poisson process with constant intensity $\lambda&amp;gt;0$ and $Y$ is a sequence of i.i.d. random variables. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The author then goes on to derive the Laplace exponent of the process, which is the function $G(\cdot)$ defined by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\mathbb{E}\big[\text{exp}(\beta X_t)\big] = \text{exp}\big[G(\beta)t\big],\quad\beta \in \mathbb{R}.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am able to derive the value of $G(\cdot)$. However, in the literature I have read, I have seen the Laplace exponent being used only when $X$ is a spectrally negative Levy process or a X is a subordinator. What guarantees the existence of the Laplace exponent for the process described above?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks&lt;/p&gt;&#xA;" OwnerUserId="28543" LastActivityDate="2017-06-25T16:54:46.233" Title="Laplace Exponent of a Jump-Diffusion Process" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;probability&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34855" PostTypeId="1" CreationDate="2017-06-25T19:18:10.843" Score="-1" ViewCount="217" Body="&lt;p&gt;For example, if I wanted to compare a list of equities inside of a very small segment of the global economy (say, the members of the Emerging AgroSphere ETF) I'd want to know their full names, their country of origin/headquarters, market capitalization, TTM current net income, TTM revenue, TTM FCF, Long Term Debt, Cash &amp;amp; Cash Equivalents, etc. Its nice to get all that information on one page for side by side comparisons of large lists of companies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Several times in the past year, I've done this type of spreadsheet population by hand. Its been interesting as I always end up picking up more relevant information in my research, but I need a more efficient solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Updates:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Yahoo Finance can do this with its Portflio feature, but I'm not able to add stocks to its lists (website hangs indefinitely and/or is unresponsive after trying to add), so this is not a viable solution currently.&lt;/li&gt;&#xA;&lt;li&gt;FinViz seems like another possible solution, but it isn't able to pull data on smaller cap stocks, like the first one on the list, Aphria ($APHQF). It also doesn't allow bulk entry of stock symbols, and furthermore asks (and requires in order to submit form) for a date, price and number of shares that I &quot;bought&quot; for each. So even if it could pull all the data I need, I'd have to spoof holding information. So this one is not the right tool for the job for several reasons.&lt;/li&gt;&#xA;&lt;li&gt;Just found out Gurufocus.com allows you to select &quot;Compare&quot; rather than &quot;Search&quot; from the dropdown in its Search bar in the top left corner of the page. The website is slow, but the feature is available in free and (of course) premium versions. This seems like a google way to go for now. I'd delete this question if gurufocus.com wasn't so slow.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="3051" LastEditorUserId="3051" LastEditDate="2017-06-25T20:13:30.470" LastActivityDate="2018-08-20T10:01:02.043" Title="What are some simple, free/affordable methods to obtain a spreadsheet of selected columns for a comma separated list of publicly traded stocks?" Tags="&lt;data&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34856" PostTypeId="1" CreationDate="2017-06-25T19:34:36.080" Score="4" ViewCount="2236" Body="&lt;p&gt;I read on &lt;a href=&quot;http://www.thetradenews.com/Technology/HFT--Not-so-flashy-anymore/?p=2&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.thetradenews.com/Technology/HFT--Not-so-flashy-anymore/?p=2&lt;/a&gt; (&lt;a href=&quot;https://web.archive.org/web/20170625192647/http://www.thetradenews.com/Technology/HFT--Not-so-flashy-anymore/?p=2&quot; rel=&quot;nofollow noreferrer&quot;&gt;mirror&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Profits from HFT are estimated to have peaked for the industry at close to $5 billion in 2009. It is thought that now [2017] it is probably less than a billion dollars, spread over many more players,” he says.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I wonder whether this estimation is a consensus amongst industry experts, and if not what other serious estimations are.&lt;/p&gt;&#xA;" OwnerUserId="2183" LastActivityDate="2017-11-08T03:15:13.297" Title="How much profit do HFT firms generate?" Tags="&lt;high-frequency&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34857" PostTypeId="2" ParentId="34855" CreationDate="2017-06-25T20:26:17.333" Score="-2" Body="&lt;p&gt;GuruFocus.com's &quot;Compare&quot; tool is exactly what I was looking for. It is available (probably in some limited form) to free as well as premium users.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To access it, click on the dropdown in the top left search bar and select &quot;Compare&quot;.&#xA;&lt;a href=&quot;https://i.stack.imgur.com/z04zA.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/z04zA.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: GuruFocus.com appears to be suffering from a growth in popularity that is outpacing its ability to serve data to users expediently, so (currently) the website is often very slow, even for premium users.&lt;/p&gt;&#xA;" OwnerUserId="3051" LastActivityDate="2017-06-25T20:26:17.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34858" PostTypeId="1" CreationDate="2017-06-25T20:32:43.763" Score="7" ViewCount="10536" Body="&lt;p&gt;Quoting Hull's book: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;When gamma is positive, theta tends to be negative. The portfolio&#xA;  declines in value if there is no change in S, but increases in value&#xA;  if there is a large positive or negative change in S. When gamma is&#xA;  negative, theta tends to be positive and the reverse is true: the&#xA;  portfolio increases in value if there is no change in S but decreases&#xA;  in value if there is a large positive or negative change in S. As the&#xA;  absolute value of gamma increases, the sensitivity of the value of the&#xA;  portfolio to S increases.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So there is a clear opposite sign correlation but I don't understand why if gamma is negative then theta tends to be positive and the portfolio increases in value if there is no change in S?&lt;/p&gt;&#xA;" OwnerUserId="28469" LastEditorUserId="28469" LastEditDate="2017-07-05T10:08:04.080" LastActivityDate="2017-07-05T10:13:27.973" Title="What is the intuitive reason why the Gamma and the Theta tend to have the opposite sign?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;portfolio-management&gt;&lt;greeks&gt;&lt;gamma&gt;" AnswerCount="4" CommentCount="5" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="34859" PostTypeId="1" CreationDate="2017-06-25T20:44:41.400" Score="1" ViewCount="86" Body="&lt;p&gt;I have generated a random series of returns drawn from a normal distribution and generated a random price series by compounding these returns (X) so $P_i = P_1(1+X)^i$. I want to show the analytic comparison between the variance of this price series to the variance of a k-period moving average of the price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I am finding is that the variance of the price series (not price returns) converges to the variance of k period average price for $all$ values of k (so the variance of moving average price = price variance regardless of the averaging period) for large data sets. This surprised me as I would have expected the variance of the moving average to be scaled down by k regardless of the period. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried to derive this result mathematically but without success. Here is the starting point of my calculation:&#xA;$$MA_k = 1/k . {\sum^k_{i=1}P_i} = $$ &#xA;$$=1/k . (P_1 + P_1(1+x) + ... + P_1(1+x)^{k-1})$$&#xA;$$P_1/k.{\sum^{k-1}_{i=0}}(1+x)^i$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From here I use a power series expansion, ignore higher order terms, and take the variance of the expression. I think I should find this expression &#xA;$var(MA_k) = P_1^2.var(x)$ but that's a guess. I can see I am not incorporating the dependency on the size of the data because there appears to convergence in variances between the rolling average of the price and the price, but I am not sure how to do that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any assistance in filling in the missing steps would be very welcome here.&lt;/p&gt;&#xA;" OwnerUserId="28349" LastEditorUserId="28349" LastEditDate="2017-06-26T09:18:44.320" LastActivityDate="2017-06-26T09:18:44.320" Title="Moving average variance" Tags="&lt;finance-mathematics&gt;&lt;statistical-finance&gt;&lt;math&gt;" AnswerCount="0" CommentCount="5" ClosedDate="2017-06-29T20:24:09.163" ContentLicense="CC BY-SA 3.0" />
  <row Id="34860" PostTypeId="1" CreationDate="2017-06-25T21:10:00.780" Score="2" ViewCount="214" Body="&lt;p&gt;For S&amp;amp;P, or any time series for that matter. When doing analysis on the distribution of the &lt;em&gt;yearly&lt;/em&gt; returns, should I be looking at 1) the daily year over year values, 2) pick some starting point like December 31st of year YYYY and then look at YoY, or 3) something else.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My intuition is that for 1) you are artificially creating many &quot;YoY&quot; values that look the same because the previous days YoY will not change much given a one day move, but at the same time 2) seems a little arbitrary because youre just selecting a single point as a reference point (you could have chosen first of year or middle of year) and in fact 1) contains 2)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Doing both for S&amp;amp;P returns from Yahoo from 1950s doesnt seem like it shows a big difference in terms of mean or vol parameters (the daily YoY has wider min/max as you would expect):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; smry&#xA;          dailyYoY     yearly&#xA;Min.    -0.6699000 -0.4499000&#xA;1st Qu. -0.0120600 -0.0061320&#xA;Median   0.0937500  0.0834800&#xA;Mean     0.0724200  0.0736000&#xA;3rd Qu.  0.1783000  0.1681000&#xA;Max.     0.5222000  0.3274000&#xA;Std Dev  0.1555526  0.1487778&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It seems like one could argue that the yearly is just a sampled version of the dailyYoY, but which should I be using? I'm leaning more towards dailyYoY, because the other method ignores information I already know&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/vspzf.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/vspzf.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17136" LastEditorUserId="17136" LastEditDate="2017-06-30T20:28:29.613" LastActivityDate="2017-07-01T07:57:24.010" Title="Looking at distribution of yearly returns of time series" Tags="&lt;equities&gt;&lt;time-series&gt;&lt;returns&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34862" PostTypeId="2" ParentId="34858" CreationDate="2017-06-26T00:34:15.920" Score="1" Body="&lt;p&gt;Theta is a &lt;a href=&quot;https://en.wikipedia.org/wiki/Greeks_(finance)&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;greek&quot;&lt;/a&gt;that represents time decay. All other things equal, the longer the time elapsed before the maturity date, the less the value of the option. That is, theta is negative over time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gamma refers to the &quot;second derivative&quot; of the price of the underlying security. (The option captures the &quot;delta,&quot; or the first derivative). Because it is a second derivative, gamma is positive when the price of the underlying security moves towards the strike price of the option, and negative when it moves away. So depending on the price movements, gamma could be either positive or negative, while theta is negative, and the two could thus be positively or negatively correlated.&lt;/p&gt;&#xA;" OwnerUserId="2345" LastActivityDate="2017-06-26T00:34:15.920" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34863" PostTypeId="1" AcceptedAnswerId="34866" CreationDate="2017-06-26T00:39:20.863" Score="0" ViewCount="72" Body="&lt;p&gt;I am trying to wrap my head around the binomial model. In particular, how would the calculation go for deriving the price of a call option for one of the stocks expiring at time 2? You can pick any K.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/fF97H.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/fF97H.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am usually used to just one stock, so this has me a bit confused.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Each cell is a price, the arrows indicate change of time into new states, and the upper cell contains prices of stock 1, and lower cell prices of stock 2. No risk-free asset, no dividends).&lt;/p&gt;&#xA;" OwnerUserId="26835" LastActivityDate="2017-06-26T07:32:00.747" Title="What is the call price in a two-stock two-period model (binomial)?" Tags="&lt;option-pricing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34864" PostTypeId="2" ParentId="34816" CreationDate="2017-06-26T00:41:35.420" Score="3" Body="&lt;p&gt;The process of setting aside an amount to pay off debt (without actually paying down debt) is known as &lt;a href=&quot;http://www.investopedia.com/terms/d/defeasance.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;defeasance.&quot;&lt;/a&gt; This can be achieved by setting up an escrow account or other bank account, where &quot;dedicated&quot; funds are deposited so that the total amount (counting &quot;locked in&quot; interest), will be enough to pay off or &quot;defease&quot; the debt. The payments can be made all at once or over time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Technically, you are not &quot;prepaying&quot; the debt until the actual maturity date, but you are &quot;matching&quot; the cash flow needed to pay off the debt. That is a &quot;synthetic&quot; process.&lt;/p&gt;&#xA;" OwnerUserId="2345" LastActivityDate="2017-06-26T00:41:35.420" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34866" PostTypeId="2" ParentId="34863" CreationDate="2017-06-26T07:23:17.360" Score="2" Body="&lt;p&gt;You have to calculate the Risk-Neutral probability of the upmoves and downmoves. The key point to bear in mind is that every stock (and risk-free bond) have the same expected value at each time step.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore calling $q_{01}$ the probability of an upmove from time 0 to 1, you would have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$120q_{01}+90(1-q_{01})=X $$&#xA;$$130q_{01}+80(1-q_{01})=X $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now solve for $q_{01}$ and $X$, which gives you:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$q_{01}=0.5$$&#xA;$$X=105$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do the same at each node and you should find the probabilities. Finally to find the value of a call option just multiply the $q$s for the payoff at the in-the-money nodes (where the stock price is higher than $K$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This payoff has to be discounted using the risk-free rate which you can easily find from the calculations above. For example at the first node:&#xA;$$1+r_{01}=\frac{X}{100} \quad \Rightarrow \quad r_{01}=0.05$$&#xA;assuming a time step of one year and discrete compounding.&lt;/p&gt;&#xA;" OwnerUserId="26657" LastEditorUserId="26657" LastEditDate="2017-06-26T07:32:00.747" LastActivityDate="2017-06-26T07:32:00.747" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34867" PostTypeId="1" CreationDate="2017-06-26T07:41:11.410" Score="1" ViewCount="1096" Body="&lt;p&gt;What is the risk of investing in FX Targeted Accrual Redemption Note (FX-TARN) ? &lt;/p&gt;&#xA;" OwnerUserId="28553" LastEditorUserId="16148" LastEditDate="2017-06-26T18:14:51.623" LastActivityDate="2018-06-17T05:09:05.027" Title="Risk of FX Targeted Accrual Redemption Note" Tags="&lt;risk&gt;&lt;fx&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34868" PostTypeId="2" ParentId="34858" CreationDate="2017-06-26T08:01:06.493" Score="3" Body="&lt;p&gt;I think this is very well explained (with almost no maths) in the first chapter of Lorenzo Bergomi's book &quot;Stochastic Volatility Modeling&quot; (sample available &lt;a href=&quot;http://docs.wixstatic.com/ugd/c4ff5c_ba17141422d44ba99daf19ee2b931544.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; for download). Note that he explains it for a delta-hedged portfolio, which is not exactly your question but I think it can help anyways (and too long so that I can post it as a comment).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/0XO8S.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/0XO8S.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/EkJaL.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/EkJaL.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2017-06-26T08:01:06.493" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34869" PostTypeId="2" ParentId="34657" CreationDate="2017-06-26T09:35:05.637" Score="0" Body="&lt;p&gt;I am also looking for the same kind of information in order to evaluate mechanisms for &lt;a href=&quot;https://en.wikipedia.org/wiki/Double_auction&quot; rel=&quot;nofollow noreferrer&quot;&gt;double auction&lt;/a&gt;. So far, I found the following two sources:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;The &lt;a href=&quot;https://en.wikipedia.org/wiki/Double_auction&quot; rel=&quot;nofollow noreferrer&quot;&gt;TORQ database&lt;/a&gt; - a database of all data related to a random sample of 144 companies from NYSE, for the dates 1990-11-01 to 1991-01-31. In contrast to other databases, it includes not only prices but also buy and sell orders. Unfortunately it is in old DOS format, so you'll need a tool such as DosBox to handle it.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;a href=&quot;https://www.sirca.org.au/products&quot; rel=&quot;nofollow noreferrer&quot;&gt;SIRCA&lt;/a&gt; has a database of Australian Equities Tick History since 1991. It contains &quot;Every bid and ask order, every trade, including the volume of each order and executed trade...&quot;. Unfortunately, it is open only to members (I am not sure how you can become a member).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="28557" LastActivityDate="2017-06-26T09:35:05.637" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34870" PostTypeId="1" AcceptedAnswerId="34872" CreationDate="2017-06-26T10:46:59.427" Score="4" ViewCount="214" Body="&lt;p&gt;How can we define a factor premium? In the book &lt;a href=&quot;https://books.google.at/books/about/Your_Complete_Guide_to_Factor_Based_Inve.html?id=iSNBvgAACAAJ&amp;amp;redir_esc=y&quot; rel=&quot;nofollow noreferrer&quot;&gt;Berkin &amp;amp; Swedroe: Your Complete Guide to Factor-Based Investing&lt;/a&gt; &#xA;the authors start introducing the market bet premium and define it as the average return of the total US stock market minus the average return of Us treasury bills overa certain period. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For other factors (size, value, momentum) if I read it correctly they use the same definition: average factor return minus  average return of US treasury bills.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of the market the definition makes sense: how much do I earn if I invest in stocks instead of the risk less asset (edit thanks to Chris Taylor).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Factors in their setting are defined in the long/short version (e.g. small minus big firms for size and winners minus losers for momentum).&#xA;Then again the comparison of these long/short portfolios against a riskless investment (bills) makes sense. But it would be interesting to see outperformance against the broad market too. Especially the tables of outperformance which they have in their book would make morse sense to me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The authors of the book seems to define the premium in any case as outerperformance over risk-less: but can I compare the outperformance of the broad market (beta one) to the outperformance of winners-loser (beta zero)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do we define the factor premium? How do they define the premium?&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="16148" LastEditDate="2017-06-26T14:18:51.477" LastActivityDate="2017-06-27T08:15:05.217" Title="Definition of factor premium: against cap weighted index or against treasury bills?" Tags="&lt;risk-premium&gt;&lt;factor-investing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34871" PostTypeId="1" CreationDate="2017-06-26T11:39:27.150" Score="2" ViewCount="69" Body="&lt;p&gt;For some empirical research, I need to retrieve data relating to the board members of companies corresponding to all securities in a major index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The data points I am looking for include gender, tenure, age, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am now wondering which financial database service is most suited to this kind of research. I have experimented with Bloomberg, but while the &quot;COMPANY_BOARD_MEMBERS&quot; field returns some such data items, there is no way to access the unique person identifier used by Bloomberg internally to retrieve other data points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, the public documentations of Bloomberg, Datastream, Reuters Eikon and the like are not helpful at all with regard to this question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While I am aware that the data I am looking for are not themselves financial data, I nonetheless post this question here because (1) the data are needed for empirical work in finance, and (2) the databases are financial databases, familiarity with which is most reasonable to assume on Quant SE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any experiences you might have with retrieving this sort of data would be much appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please note that this question is not opinion based, for example, Bloomberg is objectively bad at retrieving person-level data because no accessible personal identifier exists. A database where this is the case would be much more suitable. Also, the number of biographical data points available is not a matter of opinion.&lt;/p&gt;&#xA;" OwnerUserId="13665" LastActivityDate="2017-06-26T11:39:27.150" Title="Which financial database has the most extensive coverage of person-level data and uses person-level identifiers" Tags="&lt;bloomberg&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34872" PostTypeId="2" ParentId="34870" CreationDate="2017-06-26T12:49:22.463" Score="4" Body="&lt;p&gt;All factor returns (including &quot;passive&quot; factors like equity premium, credit premium etc) should be assessed using the fairest possible basis for comparison - &lt;strong&gt;self-financing portfolios&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a passive long-only investment, that is equivalent to the total return on the asset class minus the risk-free rate. For a tradable factor premium, that means constructing long-short portfolios to isolate the factor (e.g. buy cheap stocks, sell expensive stocks with the same dollar value).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The assumption is that you can borrow or invest cash at the risk-free rate, and that any self-financing portfolio can be leveraged as much as necessary by borrowing. I'd add a few comments to this -&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;If you are assuming that you can borrow or lend at the risk-free rate, you are free to compare strategies using risk-adjusted returns (e.g. using the Sharpe ratio) because low volatility strategies (e.g. bonds) can be leveraged to the same volatility as high volatility strategies (e.g. equities)&lt;/li&gt;&#xA;&lt;li&gt;In reality you can't borrow or lend at the risk free rate. The spread between what you can borrow at or what you can invest at is the &lt;strong&gt;cost of leverage&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;li&gt;For some factors, particularly low-volatility, low-beta or defensive factors, it is difficult to construct a self-financing portfolio by being long/short stocks with the same dollar value. This is because you are also trying to construct a zero beta portfolio (to avoid loading on the equity risk premium) which means that you want your long portfolio (low beta stocks) to have a larger dollar value than your short portfolio (high beta stocks).&lt;/li&gt;&#xA;&lt;li&gt;Related to  point 2. - the existence of a cost of leverage (either purely financial, or regulatory/risk-aversion) is often cited as the reason for the existence of the low-beta premium in the first place. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;It doesn't make much sense to compare a zero beta factor portfolio to the performance of a beta one equity investment, because the strategies are &lt;em&gt;uncorrelated by design&lt;/em&gt;. Of course, you &lt;em&gt;can&lt;/em&gt; compare them, as you can compare any two things (even &lt;a href=&quot;http://www.bmj.com/content/321/7276/1569&quot; rel=&quot;nofollow noreferrer&quot;&gt;apples and oranges&lt;/a&gt;) but you don't learn much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Who cares if a zero beta value strategy is outperformed by a long-only equity investment? These are different strategies, capturing different risk premiums. In different time periods, one or the other will outperform. A beta zero strategy is not designed to provide &quot;equity exposure plus alpha&quot;. It is best thought of as an entirely separate return stream, which it is possible to isolate and make an entirely separate allocation to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;--&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the definition of the equity risk premium -&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R_{\rm ERP} = R_{\rm Stocks} - R_{\textrm{Treasury Bills}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is not &quot;how much do I earn if I invest in stocks instead of bonds&quot;. Rather, it is &lt;em&gt;how much do I earn if I invest in stocks instead of risk-free instruments&lt;/em&gt;, where &quot;risk-free instruments&quot; are proxied by Treasury bills.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is an entirely separate &lt;em&gt;bond risk premium&lt;/em&gt; representing the compensation for bearing interest rate risk (and possibly sovereign default risk) which might be written&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R_{\rm BRP} = R_{\textrm{Treasury Bonds}} - R_{\textrm{Treasury Bills}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where we could use, for example, the return on a constant duration portfolio of 10Y bonds to proxy for the &quot;Treasury Bond&quot; return. You may also here this referred to as the &lt;em&gt;duration risk premium&lt;/em&gt;, or the reward for duration extension.&lt;/p&gt;&#xA;" OwnerUserId="924" LastEditorUserId="924" LastEditDate="2017-06-27T08:15:05.217" LastActivityDate="2017-06-27T08:15:05.217" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34874" PostTypeId="1" AcceptedAnswerId="36394" CreationDate="2017-06-26T15:47:21.317" Score="4" ViewCount="464" Body="&lt;p&gt;This questions is regarding the behaviour of banks and other financial institutions who deal with FX products and use SABR model volatilities to price options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How often do they change/tune parameters $\alpha$, $\beta$, $\nu$ and $\rho$?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If a hedge fund is for instance buying USDEUR options and calibrate the model after observing today's market quotes. Will they recalibrate the model tomorrow or use the same parameters?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And finally, &lt;strong&gt;some literature suggests that when dealing with FX it is commom to use $\beta = 1$. Why is that?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerDisplayName="user25295" LastActivityDate="2018-01-09T22:50:10.027" Title="SABR: how often is tuning parameters needed?" Tags="&lt;options&gt;&lt;stochastic-volatility&gt;&lt;sabr&gt;&lt;application&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34875" PostTypeId="1" CreationDate="2017-06-26T19:51:18.383" Score="0" ViewCount="89" Body="&lt;p&gt;For CME's futures options, do most participants use a 365 day convention or a 252 day convention?  I realize that it is our choice, but I'm interested in hearing from practitioners about what is common.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then within each day, is it usual to only take out time during the active trading hours (say 5:00-14:30 ET for crude oil) or do you take out time according to the wall time passing?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; a related question (with some informative answers) is  &lt;a href=&quot;https://quant.stackexchange.com/questions/3205/ways-of-treating-time-in-the-bs-formula&quot;&gt;Ways of treating time in the BS formula&lt;/a&gt;.  But I'm still interested in answers related to CME.&lt;/p&gt;&#xA;" OwnerUserId="77" LastEditorUserId="77" LastEditDate="2017-06-26T20:20:02.150" LastActivityDate="2017-06-27T14:44:18.373" Title="Commodity options time to expiry conventions?" Tags="&lt;options&gt;&lt;implied-volatility&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34876" PostTypeId="2" ParentId="18546" CreationDate="2017-06-26T23:28:33.950" Score="1" Body="&lt;p&gt;A good place to find a list of categories would be Morningstar.com, as they were early creators and promoters of assigning securities to the asset class categories most quoted today. Even signing up for the free access option should give one the ability to group funds by asset class categories and then rank them by some some metric. Here is a link to a page displaying their broad mutual fund categories:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://news.morningstar.com/fund-category-returns/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://news.morningstar.com/fund-category-returns/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If a fund contains equities with high valuations which are among the top 70% of the capitalization of the U.S. equity market, and if regressing this fund against a benchmark (say the Russell 1000 index) produces an &lt;code&gt;R^2&lt;/code&gt; above some threshold, the fund may be categorized as Large Cap Growth. If one looks around the Morningstar site, they should find &quot;some&quot; documentation of their methodology.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While I think this answers your question and then some, most commercial sites will probably help one better understanding how quantitative finance strategies are packaged and consumed, rather than containing pointers on getting started in actually doing the work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good luck hope that helps,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Justin&lt;/p&gt;&#xA;" OwnerUserId="28531" LastEditorUserId="28531" LastEditDate="2017-06-26T23:35:13.047" LastActivityDate="2017-06-26T23:35:13.047" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34879" PostTypeId="1" AcceptedAnswerId="34895" CreationDate="2017-06-27T11:22:55.547" Score="1" ViewCount="88" Body="&lt;p&gt;Pimco's new CIO Dan Ivascyn believes that the inverted yield curve has become less effective as a signal of impending recession. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.bloomberg.com/news/articles/2017-06-22/pimco-s-ivascyn-says-next-inverted-yield-curve-may-be-different&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.bloomberg.com/news/articles/2017-06-22/pimco-s-ivascyn-says-next-inverted-yield-curve-may-be-different&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Some see it as an almost surefire economic law: an inverted yield&#xA;  curve, when long-term bonds yield less than short-term debt, signals a&#xA;  coming recession.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;That may not hold true in today’s world of unprecedented central-bank&#xA;  economic intervention, according to Dan Ivascyn, Pacific Investment&#xA;  Management Co.’s group chief investment officer.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Mr Ivascyn, being CIO of the world's largest bond fund manager, should know his stuff. However, I don't understand why. In fact, I thought the opposite should be true. &lt;strong&gt;The inverted yield curve should be more, not less, effective as a recession indicator thanks to central bank intervention&lt;/strong&gt;. Here is my reasoning. Short-term interest is artificially low today thanks to central bank intervention. Therefore, it is harder for long-term interest rates to go lower than short-term interest rates because short-term rates are already artificially low. So, if an inverted yield curve still happens despite artificially low short-term rates, wouldn't it be a stronger signal of recession? What did I miss out? Please correct me. &lt;/p&gt;&#xA;" OwnerUserId="6190" LastActivityDate="2017-06-27T23:30:01.627" Title="Why should central bank intervention cause inverted yield curve to be less effective as a recession signal?" Tags="&lt;interest-rates&gt;&lt;yield-curve&gt;&lt;yield&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34880" PostTypeId="1" CreationDate="2017-06-27T12:37:49.033" Score="0" ViewCount="106" Body="&lt;p&gt;I know I can get stock prices from Yahoo Finance or Quandl, but does anyone know where to get stock information? i.e., industry, country, sedol, primary exchange&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers,&#xA;Steve&lt;/p&gt;&#xA;" OwnerUserId="28571" LastActivityDate="2017-08-25T11:23:07.513" Title="Open stock information database?" Tags="&lt;equities&gt;&lt;market-data&gt;&lt;historical-data&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34881" PostTypeId="1" AcceptedAnswerId="34882" CreationDate="2017-06-27T13:29:25.850" Score="0" ViewCount="35" Body="&lt;p&gt;Hey so I'm looking to use Japanese bond rates for the 3-month, 5-year, and 10 year government bonds going back 20 years or so.  Unfortunately I'm presenting this in a context where I have to use free (mostly government) data sources, so Bloomberg or CapIQ are out.  I've found stuff for the 10 year rate but I'm totally stuck on the 5 year and 3-month rate going further back than a few months any suggestions?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="28562" LastActivityDate="2017-06-27T13:56:44.210" Title="Help finding free Japanese Government bond data" Tags="&lt;market-data&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34882" PostTypeId="2" ParentId="34881" CreationDate="2017-06-27T13:56:44.210" Score="0" Body="&lt;p&gt;MOF provides daily fitted JGB rates since 1974: &lt;a href=&quot;http://www.mof.go.jp/english/jgbs/reference/interest_rate/index.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;Historical Data (1974~)&lt;/a&gt;, but the shortest tenor is 1-year.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2017-06-27T13:56:44.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34883" PostTypeId="2" ParentId="34875" CreationDate="2017-06-27T14:39:46.727" Score="2" Body="&lt;p&gt;As you mention, it's your own choice; I see the crux of this matter in two points: the first is how you accumulate your theta and the second is how good your volatilities on Friday look versus on Monday.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd personally be inclined to use calendar days for something like oil (I would expect that the chance of a geopolitical event such as a war starting over the weekend is at least 2/7th), while for something like cotton I'd be more inclined to use business days.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;During the day: I have never bothered with this, but I guess if you're looking to be a market maker you should. The thing here is that not all hours are equal. If you look at intraday measures of realized volatility, you'll see that around the pit opening and around settle are typically more volatile than other hours in between. So ideally you would account for that. Additionally, on days on which numbers are published, you would also expect some potential additional volatility around them for which you could adjust. So I wouldn't use either or what you are suggesting if you want to be really precise about this.&lt;/p&gt;&#xA;" OwnerUserId="11851" LastEditorUserId="16148" LastEditDate="2017-06-27T14:44:18.373" LastActivityDate="2017-06-27T14:44:18.373" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34884" PostTypeId="1" CreationDate="2017-06-27T14:59:57.633" Score="1" ViewCount="134" Body="&lt;p&gt;I'm trying to replicate the Fama-French Global 3 Factor portfolios, but don't know how they define their universe. There are some details on his website, but they only cover ranking methodology and the countries they look at. &lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/Data_Library/f-f_3developed.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/Data_Library/f-f_3developed.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know which specific exchanges they use (for example in the US it's just NYSE and NASDAQ), and do they apply any other exclusionary criteria like minimum ADV, no REITs, etc? &lt;/p&gt;&#xA;" OwnerUserId="28573" LastActivityDate="2017-06-27T14:59:57.633" Title="Fama-French Global Factor Universe" Tags="&lt;equities&gt;&lt;factor-models&gt;&lt;fama-french&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34886" PostTypeId="2" ParentId="34790" CreationDate="2017-06-27T15:50:12.363" Score="0" Body="&lt;p&gt;I wrote a script to parse the PDFs &lt;a href=&quot;https://cdr.ffiec.gov/Public/DownloadUBPRUserGuide.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;published by the FFIEC&lt;/a&gt; and put the information in a CSV format. &lt;a href=&quot;https://github.com/rarredon/UBPR-Codes&quot; rel=&quot;nofollow noreferrer&quot;&gt;Here&lt;/a&gt; is a repository for the script with the resulting output in CSV format.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first and third questions remain unanswered.&lt;/p&gt;&#xA;" OwnerUserId="28472" LastActivityDate="2017-06-27T15:50:12.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34887" PostTypeId="1" AcceptedAnswerId="34888" CreationDate="2017-06-27T16:39:54.947" Score="4" ViewCount="833" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/8FEJ0.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/8FEJ0.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Find an arbitrage opportunity in this market. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone explain how to mathematically solve this exercise with for example solving a system of linear equations? &lt;/p&gt;&#xA;" OwnerUserId="28398" LastActivityDate="2017-10-31T16:10:26.837" Title="Finding arbitrage opportunity" Tags="&lt;options&gt;&lt;portfolio-management&gt;&lt;finance&gt;&lt;arbitrage&gt;&lt;finance-mathematics&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34888" PostTypeId="2" ParentId="34887" CreationDate="2017-06-27T17:28:06.777" Score="8" Body="&lt;p&gt;Generally speaking, let us consider a problem where you have a series of simple payoffs $f_{K_i}(S_T)$ of strike $K_i$, $i \in I$, that depend on the value of $S_T$ at time $T$, as well as a more complex, laddered payoff $P_L(T)$ which pays a quantity $g_i(S_T)$ on regions of the form $\{K_i \leq S_T &amp;lt; K_{i+1}\}$ $-$ regions are delimited by the strikes of the simpler payoffs. Then the payoff of the ladder product can normally be written:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ P_L(T) = \sum_{i\in I} g_i(S_T)1_{\{K_i \leq S_T &amp;lt; K_{i+1}\}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the above representation, it is normally possible to rewrite the payoff with indicator functions that depend &lt;strong&gt;only&lt;/strong&gt; on one strike:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ P_L(T) = \sum_{i\in I} h_i(S_T)1_{\{K_i \leq S_T\}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Letting $a_i \in \mathbb{R}$ for all $i$, you will then normally observe that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ h_i(S_T)1_{\{K_i \leq S_T\}} = a_if_{K_i}(S_T) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;i.e.&lt;/em&gt; the payoff of the ladder product can be written as a linear combination of the simple payoffs.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In this case, note that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;X_4(T) &amp;amp; =(S_T-60)\times1_{\{60 \leq S_T &amp;lt;80\}}+20\times 1_{\{80 \leq S_T &amp;lt;100\}}+(120-S_T)\times1_{\{100 \leq S_T\}}&#xA;\\[6pt]&#xA;&amp;amp;=(S_T-60)\times1_{\{60 \leq S_T\}}-(S_T-80)\times 1_{\{80 \leq S_T\}}-(S_T-100)\times1_{\{100 \leq S_T\}} \quad (1)&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;S_T \leq 0 \quad &amp;amp; \Rightarrow \quad X_4(T) = 0 &#xA;\\[6pt]&#xA;60 \leq S_T &amp;lt; 80 \quad &amp;amp; \Rightarrow \quad X_4(T) = S_T-60 &#xA;\\[6pt]&#xA;80 \leq S_T &amp;lt; 100 \quad &amp;amp; \Rightarrow \quad X_4(T) = 20 = (S_T-60)-(S_T-80) &#xA;\\[6pt]&#xA;100 \leq S_T \quad &amp;amp; \Rightarrow \quad X_4(T) = 120-S_T = (S_T-60)-(S_T-80)-(S_T-100)&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(1)$ can be rewritten as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;(1) &amp;amp; = \max(S_T-60,0)-\max(S_T-80,0)-\max(S_T-100,0) &#xA;\\[6pt]&#xA;&amp;amp; = X_1(T) - X_2(T) - X_3(T)&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ X_4(T) = X_1(T) - X_2(T) - X_3(T) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By no-arbitrage assumption, given the long call ladder payoff can be replicated with a portfolio constructed by buying a call $1$ and selling a call $2$ and a call $3$, both the long call ladder and the replicating portfolio should have the same price at time $t$. However this is not the case here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ C_1(t)-C_2(t)-C_3(t) = 40-21.5-8.4 = 10.1 &amp;lt; 11 = C_4(t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The arbitrage strategy consists on selling the call ladder for $11\$$ and buying the replicating portfolio for $10.1\$$, making a riskless profit of $0.9\$$ per contract.&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-10-31T16:10:26.837" LastActivityDate="2017-10-31T16:10:26.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34893" PostTypeId="1" CreationDate="2017-06-27T18:24:24.360" Score="0" ViewCount="105" Body="&lt;p&gt;Suppose you are trading two mean-reverting assets, A and B, and that $Covar(A, B) &amp;gt; 0$. You are currently long one unit of A, and are considering buying one unit of B. Compared to the situation where you have no position, should you be...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(A) More eager to buy B, because it adds some diversification.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is: $\sigma_{A+B} - \sigma_B &amp;lt; \sigma_A$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(B) Less eager to buy B, because you already have correlated exposure to A.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is: $ \sigma_{A+B}^2 - \sigma_B^2 &amp;gt; \sigma_A^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(C) Something else?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If (B), then why do people use $2\sigma$ as a rule of thumb for entering a spread rather than $X \sigma^2$ ?&lt;/p&gt;&#xA;" OwnerUserId="5251" LastEditorUserId="5251" LastEditDate="2017-06-27T18:33:07.367" LastActivityDate="2017-06-27T18:33:07.367" Title="Units of Risk: Variance vs Standard Deviation" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;variance&gt;&lt;mean-variance&gt;&lt;standard-deviation&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34894" PostTypeId="1" AcceptedAnswerId="34900" CreationDate="2017-06-27T21:18:21.550" Score="1" ViewCount="184" Body="&lt;p&gt;I have a question about comparison of different GARCH models via information criteria.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use rugarch package. So, let's have 3 model types: &quot;sGARCH&quot;, &quot;eGARCH&quot;, &quot;gjrGARCH&quot;. I fit all 3 type models for same time series, for example, for p=q=1. Could I use IC (&lt;a href=&quot;https://en.wikipedia.org/wiki/Bayesian_information_criterion&quot; rel=&quot;nofollow noreferrer&quot;&gt;BIC&lt;/a&gt;, for example) for best model selection among these 3 types? If not, what's the best method for this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="19992" LastEditorUserId="16148" LastEditDate="2017-06-27T23:23:21.083" LastActivityDate="2017-06-28T09:39:40.073" Title="Information criteria via different GARCH models" Tags="&lt;time-series&gt;&lt;garch&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34895" PostTypeId="2" ParentId="34879" CreationDate="2017-06-27T23:30:01.627" Score="3" Body="&lt;p&gt;He's talking about central bank intervention in the longer maturities, not the short end.  The Fed bought a lot of long dated Treasuries, which helped flatten the curve.  Hence an inverted curve may reflect all the securities bought by the Fed.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-06-27T23:30:01.627" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34897" PostTypeId="1" AcceptedAnswerId="34901" CreationDate="2017-06-28T06:16:51.423" Score="10" ViewCount="3089" Body="&lt;p&gt;I'm teaching an applied math class this summer and I want to take a short detour into finance (not my specialty at all); specifically the Black-Scholes model of stock movements.  I want my students to be able to simulate stock movements and create some fun graphs.  But I still have a couple basic questions about it myself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I have this right, the change $\Delta S$ in a stock price over a small time interval $\Delta t$ is posited to behave as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Delta S = \mu S \Delta t + \sigma \sqrt{\Delta t} \varepsilon S$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\mu = \text{drift rate}$, $\sigma = \text{volatility}$ (constant), and $\varepsilon$ is a fair coin flip resulting in $1$ and $-1$ (I prefer this incremental equation to a stochastic one, I'm not up on Ito's lemma and all that).  $S_T$, the stock price at time $T$, is then (for fixed $\Delta t$) the random variable&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_T = S_0 \left(1+\mu \Delta t + \sigma \sqrt{\Delta t} \right)^X \left(1+\mu \Delta t - \sigma \sqrt{\Delta t}\right)^{N-X}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $X$ is a binomial R.V. counting the number of $1$'s from the coin flips and $N = T/\Delta t$.  Using the normal approximation for $X$ and letting $\Delta t \rightarrow 0$ gets us&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_T = S_0 e^{(\mu-\sigma^2/2)T}e^{\sigma \sqrt{T} Z}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Z$ is standard normal (or we could replace $\sqrt{T} Z$ with brownian motion $W$ for a dynamic model).  From this we can compute the following expected values:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\ln(E[S_T]) = \ln(S_0) + \mu T$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E[\ln(S_T)] = \ln(S_0) + (\mu - \sigma^2/2) T$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, a dumb question: if volatility isn't a concern, it's the second of these quantities that an investor is concerned with when deciding to purchase a stock, yes?  i.e., the expected value of logarithmic returns is the correct measure of the performance of a stock, not log of the expected value?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My second question maybe isn't as dumb.  Assuming what I just said is correct, does this imply that, in a world where this model held perfectly and that $\mu$ and $\sigma$ were known for all stocks and to all investors, that $\mu - \sigma^2/2 = r$, the risk-free rate?  It would seem to, since a riskless bond with $\mu = r$ and $\sigma = 0$ is always available to investors.  I'm asking because I'm curious and I'd like to say something intelligent to my students about the relationship between $\mu$ and $\sigma$ in this model, e.g higher $\sigma$ means higher $\mu$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another question.  I'm told there's a magic wand called risk-neutral valuation which allows me instead to write&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Delta S = r S \Delta t + \sigma \sqrt{\Delta t} \varepsilon^\star S$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where we've replaced $\mu$ with the risk-free rate and $\varepsilon^\star$ is a different random variable derived from the risk-neutral probability measure.  I'll buy that for the moment.  What confuses me is how, when deriving the Black-Scholes formula for European options, one arrives at the correct formula, even though we've replaced $\mu$ with $r$ but &lt;em&gt;not&lt;/em&gt; replaced $\varepsilon$ with $\varepsilon^\star$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I mean is, suppose you write&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_T = S_0 e^{(r-\sigma^2/2)T}e^{\sigma \sqrt{T} Z}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, replacing $\mu$ with $r$ but &lt;em&gt;not&lt;/em&gt; changing $\sigma$ to $0$ or changing anything in the second exponential (i.e. changing it to a different version of browning motion)  If you use this expression to compute the discounted expected value of the payout of a European call option at strike price $K$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$e^{-rT}E[\text{max}(S_T - K,0)]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;one arrives at the correct formula for $C$, the Black-Scholes price of a European call option.  But why should this be?  Why should the fair value of such an option be arrived at by assuming $\mu = r$, but &lt;em&gt;still&lt;/em&gt; assuming $\sigma \neq 0$?  I realize that letting $\sigma = 0$ makes an option pointless to begin with, but I really don't get why we are justified in letting $\mu = r$, instead of what $\mu$ actually is (whatever it may be).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, anything intelligent you can tell me about how actual investors react to (their estimation of) $\mu$ and $\sigma$, within the context of this model, would be helpful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sorry for my naivety, the closest I've been to a stock market is flipping past CNBC on my couch.  Thanks for any help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you've both said makes good sense to me.  A quick aside: is the Riesz Representation theorem the essential ingredient one uses to prove the existence of risk-neutral measure?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm still fuzzy on one thing though.  I've not been through the Black-Scholes PDE/dynamic hedging argument in detail but I get the gist; setting up a self-financing risk-less portfolio by trading back and forth the derivative and the stock.  And I'm sure that's the most conceptually sound and insightful way to derive the Black-Scholes formula for European options.  But I'm not going to have time to go into this in class,  so let's suppose instead we didn't know any of this Black-Scholes PDE stuff, nor the Feynman-Kac formula.  Again assuming the model&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_T = S_0 e^{(\mu - \sigma^2/2)T} e^{\sigma \sqrt{T} Z}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is there a way to argue from simpler principles that the computation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$e^{-rt} E[\text{max}(S_T-K,0)]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is a valid pricing for a European option, after replacing $\mu$ with $r$?  Because honestly, if I'm actually out there selling these options and need to price them, and I have no education about any of this other than this model, and I know I can sell enough of them for the law of averages to win out, I'm doing this exact computation but leaving $\mu$ right where it is (this was my original guess as to how to price an option by the way, before learning the actual formula or the hedging argument).  In fact, it seems to me that, whatever probabilistic model $S_T$ you believe in for a particular stock, this computation should lead you to your best guess as to the value of the option, &lt;em&gt;without&lt;/em&gt; any alterations such as letting $\mu = r$.  Where am I going wrong here?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, could you recommend some realistic values of $\mu$ and $\sigma$ for me to play around with my students?  Do practical traders actually bother trying to estimate $\mu$ and $\sigma$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for both of your help.&lt;/p&gt;&#xA;" OwnerUserId="28581" LastEditorUserId="28581" LastEditDate="2017-06-29T09:31:11.193" LastActivityDate="2017-06-29T09:31:11.193" Title="Drift rate vs. Riskless rate in the Black-Scholes model" Tags="&lt;black-scholes&gt;&lt;risk-neutral-measure&gt;&lt;risk-free&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="34898" PostTypeId="2" ParentId="34300" CreationDate="2017-06-28T06:38:20.370" Score="1" Body="&lt;p&gt;The general formula to answer this question can be found on page 105-106 of Introduction to Mathematical Finance by Pliska.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general:&#xA;$\bar{\mathbb{P}}\left ( M_{4} \geq 4\left ( 2^{i} \right ) \right )$ (or the probability the maximum to date price was 4, 8, 16 etc) is equal to:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the probability of the stock price finishing at $M_{4}$; plus&lt;/li&gt;&#xA;&lt;li&gt;the probability the stock price exceeding $M_{4}$; plus&lt;/li&gt;&#xA;&lt;li&gt;the probability the stock price reached $M_{4}$ at some point but finished below $M_{4}$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The formula to evaluate this can be found on the pages of Pliska's book mentioned above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However to answer this question, what needs to be calculated is $\bar{\mathbb{P}}\left ( M_{4} = 4\left ( 2^{i} \right ) \right )$ for each level $i$. The only levels of $i$ that contribute value to the option are for $1 \leq i \leq 4$. The probability of the maximum being exactly $i$ can be calculated via:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$\bar{\mathbb{P}}\left ( M_{4} \geq 4\left ( 2^{i} \right ) \right ) - \bar{\mathbb{P}}\left ( M_{4} \geq 4\left ( 2^{i+1} \right ) \right )$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Once again, using the formulas in Pliska's book,  $\bar{\mathbb{P}}\left ( M_{4} = 8\right )$ is given by:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$\bar{\mathbb{P}}\left ( M_{4} \geq 8\right ) - \bar{\mathbb{P}}\left&#xA;   ( M_{4} \geq 16 ) \right )$ = 25.92%&lt;/li&gt;&#xA;&lt;li&gt;$\bar{\mathbb{P}}\left ( M_{4} \geq 8\right )$ = 49.6%&lt;/li&gt;&#xA;&lt;li&gt;$\bar{\mathbb{P}}\left ( M_{4} \geq 16\right )$ = 23.68%&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In this example I have assumed r =10% so the risk neutral probability of an up move is 40%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore there is a 25.92% chance of receving $(8-4)=4$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same calculations need to be done for $M_{4} = 16,32$ and $64$ to determine the price of the option.&lt;/p&gt;&#xA;" OwnerUserId="20875" LastEditorUserId="20875" LastEditDate="2017-06-29T00:59:55.913" LastActivityDate="2017-06-29T00:59:55.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34900" PostTypeId="2" ParentId="34894" CreationDate="2017-06-28T09:39:40.073" Score="2" Body="&lt;p&gt;In short: &lt;strong&gt;Yes&lt;/strong&gt;, you can use the $BIC$ (and $AIC$) information criteria, assuming the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;All models are applied on &lt;em&gt;exactly&lt;/em&gt; the same data set.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;All model parameters are estimated via maximum likelihood estimation.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Your sample size is much bigger, than the amount of parameters in the models (as GARCH models don't have many parameters, this will probably be no issue)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Even though it is often claimed, the compared models don't need to be nested for the $AIC$ and $BIC$ to be valid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly, note that there is no &quot;best&quot; way in model selection. It all depends on the purpose of the model that you are looking for - usually, in a real life setting, the true model isn't even one of the candidates. However, $AIC$ and $BIC$ can usually give you a good idea, which of the models is preferable.&lt;/p&gt;&#xA;" OwnerUserId="26503" LastActivityDate="2017-06-28T09:39:40.073" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="34901" PostTypeId="2" ParentId="34897" CreationDate="2017-06-28T10:52:34.753" Score="7" Body="&lt;p&gt;Let's take your questions in turn -&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If volatility isn't a concern, an investor is concerned with&#xA;  $$&#xA;E[\log S_T] = \log S_0 + (\mu - \tfrac{1}{2}\sigma^2)T&#xA;$$&#xA;  when deciding to purchase a stock, yes? i.e. the expected value of logarithmic returns is the correct measure of the performance of a stock, not log of the expected value?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Yes, for long-term performance you should focus on the log-returns, as these incorporate the volatility drag that penalizes very volatile stocks.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Assuming what I just said is correct, does this imply that, in a world where this model held perfectly and that $\mu$ and $\sigma$ were known for all stocks and to all investors, that $\mu-\tfrac{1}{2}\sigma^2=r$, the risk-free rate?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In a world where the model held perfectly, and $\mu$ and $\sigma$ were known to all investors, &lt;em&gt;and investors are risk-neutral&lt;/em&gt;, then this equation would hold. More generally you could have&#xA;$$&#xA;\mu = r + \tfrac{1}{2}\lambda \sigma^2&#xA;$$&#xA;where $\lambda$ is the market price of risk. If $\lambda&amp;gt;1$ then investors are risk-averse i.e. they demand to be compensated with additional return for bearing risk. If $\lambda&amp;lt;1$ then investors are risk-seeking. A more sophisticated model is the &lt;a href=&quot;https://en.wikipedia.org/wiki/capital_asset_pricing_model&quot; rel=&quot;noreferrer&quot;&gt;capital asset pricing model&lt;/a&gt; (CAPM) which incorporates covariance with the market as an additional source of risk. Note that the CAPM is itself seen as a very simplistic and naive model of asset returns.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Why should the fair value of an option be arrived at by assuming $\mu=r$ but still assuming $\sigma\neq 0$?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The argument that leads to the Black-Scholes option pricing formula is a &lt;em&gt;dynamic hedging&lt;/em&gt; argument. By following a particular trading strategy (i.e. buying and selling the stock in specified amounts) the investor can replicate the payout of a call or put option. Therefore, the price of the option must be equal to the cost of implementing this trading strategy (following the &lt;a href=&quot;https://en.wikipedia.org/wiki/Law_of_one_price&quot; rel=&quot;noreferrer&quot;&gt;law of one price&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To determine the cost of implementing the trading strategy (in the limit of continuous pricing) you set up a PDE, the Black-Scholes equation,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;V_t + rSV_S + \tfrac{1}{2}\sigma^2S^2V_{SS} = rV&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;whose solution gives the price of the option. Note that $\mu$ does not appear in this equation (it drops out due to dynamic hedging) so the price of the option cannot depend on $\mu$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, the link to expectations (and the reason you can solve for the price of the option using Monte Carlo) is provided by the &lt;a href=&quot;https://en.wikipedia.org/wiki/Feynman%E2%80%93Kac_formula&quot; rel=&quot;noreferrer&quot;&gt;Feynman-Kac formula&lt;/a&gt; which translates the solutions of a certain class of parabolic PDEs (of which the Black-Scholes equation is one) to expectations of a particular stochastic process. Since the Black-Scholes equation does not depend on $\mu$, we know that the stochastic process cannot depend on $\mu$ either, and in fact the stochastic process turns out to be&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{dS_t}{S_t} = r dt + \sigma dZ_t&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with a terminal condition specified by the payout of the option (we use a terminal condition rather than an initial condition because the Black-Scholes equation has time reversed compared to a traditional, heat-like parabolic PDE).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's the mathematical answer. The intuitive answer is &quot;we can hedge out all of the price movements related to the drift of the stock, therefore the price of the option can't depend on the drift&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, even if you had two perfectly correlated stocks with a different drift term, and you bought a call option on each of them, the options would have a different terminal value (the one with higher drift would be worth more) but the costs of dynamically hedging the stock movements for the stock with greater drift would also be higher, by an amount which exactly offsets the difference in option terminal values, so the options have the same value now.&lt;/p&gt;&#xA;" OwnerUserId="924" LastEditorUserId="924" LastEditDate="2017-06-28T16:37:23.337" LastActivityDate="2017-06-28T16:37:23.337" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34902" PostTypeId="1" CreationDate="2017-06-28T14:26:02.313" Score="2" ViewCount="531" Body="&lt;p&gt;And yet another question to discuss the assumptions in PRIIPs.&#xA;It is remarkable that in these legal documents a Cornish-Fisher expansion including skewness and kurtosis is used.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at the very recent version of &lt;a href=&quot;http://eur-lex.europa.eu/legal-content/EN/TXT/PDF/?uri=OJ:L:2017:100:FULL&amp;amp;from=DE&quot; rel=&quot;nofollow noreferrer&quot;&gt;the document&lt;/a&gt; we find on page 27 the following formula for the moderate scenario (Which is, if I read it correctly, supposed to be the 50% quantile):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\exp(M_1 \cdot N - \sigma \mu_1/6 - 0.5 \sigma^2 N ),&#xA;$$&#xA;where $N$ is the number of days (more details are not necessary here), $M_1$ is the first moment of the log returns observed, $\sigma$ is the standard deviation and $\mu_1$ is the skewness measured.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have one question:&#xA;I see that  $- \sigma \mu_1/6$ enters if we put in $0$ for the &quot;z-value&quot;. Thus there is something that remains from skewness.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But is it ok to have the average return $M_1$ if we model in a risk-neutral world?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $M_1$ is the average of log-returns then we have&#xA;$M_1 = \tilde{\mu} + \sigma^2/2$ where $\tilde{\mu}$ is the &quot;true&quot; mean and $\sigma^2/2$ is the convexity that we have in the log-normal case. This is corrected in the last part of the formula by the term $- 0.5 \sigma^2 N$.&#xA;This formula is different from the others where there is usually just an expected return of $-\sigma^2/2 N$ which makes the expected growth zero (see e.g. page 28 point 11).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short: is it really consistent to have the $M_1$ term above? Any comments are really appreciated!&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2017-06-29T06:46:43.070" LastActivityDate="2017-09-13T13:01:46.943" Title="Distributional assumptions in PRIIPs" Tags="&lt;log-returns&gt;&lt;regulation&gt;&lt;priips&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34903" PostTypeId="2" ParentId="34834" CreationDate="2017-06-28T15:14:39.060" Score="2" Body="&lt;p&gt;Whatever correlations appear during a bull direction market (the slow upward grind with rare down days and pallid implied relativity), these correlations undergo deposition to near zero when the market does correct. Their is your price extreme indicator, but often the cost to carry associated with the prolonged time it takes for market correction is too much to bear for most people. It is much like going long volatility in those market conditions (Valid concept, difficult and expensive in reality).&lt;/p&gt;&#xA;" OwnerUserId="28591" LastActivityDate="2017-06-28T15:14:39.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34906" PostTypeId="2" ParentId="34897" CreationDate="2017-06-28T15:42:46.103" Score="4" Body="&lt;p&gt;Perhaps some big picture background is useful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Black-Scholes formula was originally developed through a dynamic hedging argument, that by trading a stock and a riskless bond in continuous time, one can perfectly replicate the payoff of an option. If one believes that two equivalent payoffs should have the same price (i.e. the Law of One Price), then the price of the option should be the same as price of the amount of stock and risk free bond needed to start the replicating strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Subsequent develops in asset pricing theory showed that law of one price (i.e. linear pricing) implies the existence of a stochastic discount factor which implies that asset prices are simply expected payoffs divided by the risk free rate under an alternative probability measure.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;A quick tour through asset pricing theory...&lt;/h1&gt;&#xA;&#xA;&lt;h3&gt;Some motivation:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Let's imagine we $a$ apples and $b$ bananas. We can represent a basket of goods as a vector.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ X = \begin{bmatrix} a \\ b \end{bmatrix} $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's natural to assume that the pricing function for this basket of goods is a linear functional.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If a basket $Y$ had twice as many apples and oranges as basket $X$, the price of $Y$ should be twice as high as the price of $X$&lt;/li&gt;&#xA;&lt;li&gt;The price of $Z = X + Y$ should be the price of $X$ plus the price of $Y$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Indeed, if the pricing function weren't a linear functional, you could profit by trading. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Eg. if apples cost \$1 and oranges cost \$2 but a basket of one apple and one orange cost \$2.50, you could buy the basket for \$2.50 and sell the contents for \$3.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;How does this relate to asset pricing theory?&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Instead of $X$ being a vector that represents the number of apples and oranges, let $X$ be a random variable denoting a future payoff. $X$ is a vector that represents payoffs different states of the world.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If investors were &quot;risk neutral,&quot; every state of the world $\omega \in \Omega$ would have a state price proportional to the probability of that state occurring. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But that need not be the case.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Equivalent formulations:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Let $X$ be a random variable denoting a future payoff and let $f(X)$ be a pricing function which gives today's price for payoff $X$. Hand waving away some technical conditions, the following statements are equivalent:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The Law of One Price holds, that is, the pricing function $f$ is a linear functional.&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$f(\alpha X + \beta Y) = \alpha f(X) + \beta f(Y)$ where $Y$ is another payoff. and $\alpha$ and $\beta$ are scalars.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Pricing function $f(X)$ can be written as the inner product of $X$ with some stochastic discount factor $S$.&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$f(X) = \operatorname{E}[XS]$. This follows from the &lt;a href=&quot;https://en.wikipedia.org/wiki/Riesz_representation_theorem&quot; rel=&quot;nofollow noreferrer&quot;&gt;Riesz representation theorem&lt;/a&gt;. &lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;There exists a modified probability measure Q such that pricing function $f$ can be written as $f(X) = \frac{1}{r^f} \operatorname{E}^Q[X]$&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The logic here is remarkably simple. If $f(X) = \operatorname{E}^P[SX] = \sum_i p_i s_i x_i$ then let $q_i = \frac{p_i s_i}{ \sum_j p_j s_j}$ and risk free rate $r^f = \frac{1}{\sum_j p_j s_j}$ and then $f(x) = \frac{1}{r^f} \sum_i q_i x_i  = \frac{1}{r^f} \operatorname{E}^Q[X]$.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Beta models: (Drifting further from your precise question...) Expected returns $\operatorname{E}[r]$ for a security are an affine function of a regression beta on the stochastic discount factor. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h3&gt;Connection to macroeconomics...&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;So far we haven't assumed much beyond the law of one price. And it turns out, the above framework is fantastically flexible, it isn't very constraining. We haven't discussed &lt;em&gt;WHY&lt;/em&gt; different states of the world may have different prices. And we haven't said &lt;em&gt;ANYTHING&lt;/em&gt; on what stochastic discount factor $S$ is!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Macrofinance has tried to pin down $S$ (with limited success imho). Macroeconomics would say differences in the state price density are due to differences in the marginal utility of consumption. The idea is that bread is more valuable to me in times of famine than in times of abundance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remember what risk is in the macrofinance interpretation of asset pricing. Risk is not volatility. Risk is covariance with the stochastic discount factor. Risky stocks will have higher expected returns (in your model, higher $\mu$) to compensate for that risk.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;References&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Cochrane, John, &lt;em&gt;Asset Pricing&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Duffie, Darrell, &lt;em&gt;Dynamic Asset Pricing Theory&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-06-28T16:04:59.850" LastActivityDate="2017-06-28T16:04:59.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34907" PostTypeId="2" ParentId="34858" CreationDate="2017-06-28T16:01:36.360" Score="1" Body="&lt;p&gt;Gamma is the second derivative of price (the first is delta, there are third and fourth and on-up derivatives that are largely not useful. I refer to these as color and temperature). Since your portfolio delta measures your directional assumption, the gamma measures the propensity to a price movement Practically this is only useful when looking at near expiration term, at the money options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Theta will be positive if you sell options (theta decay - you sell high and buy back low). Buying options (do not do this unless you have to) gives negative theta.&lt;/p&gt;&#xA;" OwnerUserId="28591" LastActivityDate="2017-06-28T16:01:36.360" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34908" PostTypeId="2" ParentId="34847" CreationDate="2017-06-28T18:07:50.257" Score="1" Body="&lt;p&gt;I'm not sure if I understood your question right.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What is a CDS?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&quot;agreement that the seller of the CDS will compensate the buyer [...] in the event of a loan default [...]. &#xA;The buyer of the CDS makes a series of payments (the CDS &quot;fee&quot; or &quot;spread&quot;) to the seller [...]&quot;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Credit_default_swap&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Credit_default_swap&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How this could be used?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Investmentbank could have helped the Asset Manager to sell the protection against the default of a bond or a basket of bonds, as an income generating strategy.&lt;/p&gt;&#xA;" OwnerUserId="26899" LastActivityDate="2017-06-28T18:07:50.257" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34909" PostTypeId="1" CreationDate="2017-06-28T19:14:11.903" Score="1" ViewCount="115" Body="&lt;p&gt;This must be very basic, but I don't seem to be able to express the variance of returns on a portfolio in terms of variances-covariance sum of returns of its constituents, which seems to be what is used everywhere. Say $Y(t)=\sum{n_i X_i(t)}$ where $n_i$ is the number of shares of stock $i$ with price $X_i$. Define a relative return on $i$-th constituent over a period $T$ as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_i(t,t+T) = \frac{X_i(t+T)-X_i(t)}{X_i(t)}$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the relative return on the portfolio is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R_T = R(t,t+T) = \frac{Y(t+T)-Y(t)}{Y(t)} = \frac{1}{Y(t)}\sum{n_i X_i(t) r_i(t,t+T)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$Var(R_T) = Var \left( \frac{1}{Y(t)}\sum{n_i X_i(t) r_i(t,t+T)} \right) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is often expressed as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \sum w_iw_jCov(r_i,r_j)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but since both $X(t)$ and $Y(t)$ also vary with time I don't see how this is done.&lt;/p&gt;&#xA;" OwnerUserId="25538" LastActivityDate="2017-06-28T22:28:07.330" Title="Variance of returns on a portfolio" Tags="&lt;modern-portfolio-theory&gt;&lt;portfolio&gt;&lt;variance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34911" PostTypeId="2" ParentId="34909" CreationDate="2017-06-28T20:32:51.740" Score="2" Body="&lt;h1&gt;To estimate covariance between returns of security $i$ and $j$ using a sample from time $t=1$ to $T$:&lt;/h1&gt;&#xA;&#xA;&lt;h3&gt;Step 1: Compute returns for every security $i$ and every period $t$&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The return from time $t$ to $t+1$ for security $i$ is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ R_{i,t+1} = \frac{P_{t+1} + D_{t+1}}{P_t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $P_t$ denotes the price at time $t$ and $D_t$ is the time $t$ value of any distributions (eg. dividends, stock distributions, etc...).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typically data providers will do this for you. Getting everything perfectly correct (eg. delisting returns, distributions etc...) is hugely important.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Step 2: Compute sample mean of returns&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;For security $i$, the sample mean is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\bar{r}_i = \frac{1}{T} \sum_t r_{i,t}$$&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Step 3: Compute sample covariance of returns:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;For security $i$ and $j$, the sample covariance is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \hat{Cov}(r_i, r_j) = \frac{1}{T-1} \sum_t \left(r_{i,t} - \bar{r}_i \right) \left( r_{j,t} - \bar{r}_j \right)$$&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;A note on share counts and weights:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Holding a constant number of shares implies portfolio weights almost certainly vary period to period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $P_{i,t}$ be the price of security $i$ and $n_i$ be the number of shares of security $i$. The portfolio weight on security $i$ at time $t$ is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ w_{i,t} = \frac{n_i P_{i,t}}{\sum_j n_j P_{j,t}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the prices almost certainly change, the portfolio weights almost certainly change. (An exception is if the portfolio is value weighted, in which case the weights will basically remain the same.)&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-06-28T22:28:07.330" LastActivityDate="2017-06-28T22:28:07.330" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34914" PostTypeId="1" AcceptedAnswerId="34921" CreationDate="2017-06-29T13:54:48.643" Score="1" ViewCount="203" Body="&lt;p&gt;I'm currently trying to price a cap on a Libor 3M (US) collateralized in EUR. I understand that my discount curve should be the CSA and the price of a caplet should be using a Black-scholes price:&#xA;$$Cplt(t,K,T_{k-1},T_{k})=\tau_k \times DF(t,T_{k}) \times Black(K, L_{k}(t),\sigma_{k})$$&#xA;where $L_{k}(t)=\mathbb E^{CSA}_t(F_k(T_{k-1}))$ is the expected value of the forward implied from the CSA 3M Libor (US) curve and $DF$ is the discount curve implied from the CSA curve. My question is what is the olatility to use since the bloomberg volatilities are just US collaterlized Cap (discounted with OIS). Can i use the same volatility as the ones in Bloomberg? but in that case, i think i forget the covariance between US Libor 3M and the spread US/EUR.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance.&lt;/p&gt;&#xA;" OwnerUserId="27971" LastEditorUserId="20454" LastEditDate="2017-10-09T15:59:38.103" LastActivityDate="2017-10-09T15:59:38.103" Title="Which volatility to use in cap pricing with CSA discounting?" Tags="&lt;black-scholes&gt;&lt;ois-discounting&gt;&lt;collateral&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34915" PostTypeId="1" AcceptedAnswerId="34980" CreationDate="2017-06-29T14:01:56.650" Score="4" ViewCount="260" Body="&lt;p&gt;I was reading a paper from Cremers and Petajisto, called &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;How Active is Your Fund Manager? A New Measure That Predicts Performance&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In the original paper from 2009 they have the following measure for active share&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1-sum(min(w_pfo, w_bench))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which they later revised to&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sum(abs(w_pfo-w_bench))*0.5&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where in my understanding, the only difference is basically how you treat underweighting the benchmark, i.e. negative cancels out positive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So now to my problem, I want to implement this in my portfolio optimisation code and I am struggling how to formulate the constraint in a DCP conform way. How can I get a convex formulation with a lower limit threshold. I basically want to ensure that my portfolio has a minimum % of active positions outside the benchmark. In CVXPY I am trying s.th. like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sum_entries(abs(w_pfo - w_bench))*0.5 &amp;gt;= 0.8  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1-sum_entries(min_elemwise(w_pfo,w_bench)) &amp;gt;= 0.8  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where w_pfo is my solver variable, I know that it will be a convex problem when I flip the inequality to &amp;lt;= 0.8.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any inputs how to implement this would be great.&lt;/p&gt;&#xA;" OwnerUserId="5366" LastActivityDate="2017-07-04T15:06:44.250" Title="Active share portfolio constraint" Tags="&lt;portfolio-optimization&gt;&lt;convexity&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34917" PostTypeId="2" ParentId="22596" CreationDate="2017-06-29T17:33:56.087" Score="8" Body="&lt;p&gt;Check out my ccxt library on GitHub: &lt;a href=&quot;https://github.com/ccxt/ccxt&quot; rel=&quot;noreferrer&quot;&gt;https://github.com/ccxt/ccxt&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With it you can access market data and trade bitcoin and altcoins with many cryptocurrency exchanges. The library is in Python 2 &amp;amp; 3 (JavaScript and PHP versions are also available as well). You can deploy it from PyPI, with npm or by cloning from GitHub repository.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The ccxt library is under heavy development right now, but already offers a quick-start for trading and technical analysis with many crypto exchange markets out of the box.&lt;/p&gt;&#xA;" OwnerUserId="28604" LastEditorUserId="28604" LastEditDate="2017-12-06T03:28:52.760" LastActivityDate="2017-12-06T03:28:52.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34918" PostTypeId="2" ParentId="32831" CreationDate="2017-06-29T17:51:48.203" Score="4" Body="&lt;p&gt;As specified I will assume your option is perpetual; I will also assume that it is written on an asset whose price $(S_t)_{t \geq 0}$ follows a Geometric Brownian Motion (GBM) with drift coefficient $rS_t$ and diffusion coefficient $\sigma S_t$ under the risk-neutral measure $\mathbb{Q}$ $-$ we assume a constant risk-free rate:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dS_t = rS_tdt + \sigma S_t dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W_t = W_t^{\mathbb{Q}}$. Let us now define the two hitting times of interest here $-$ where time $0$ is today:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The time at which the stock price breaches the barrier $H$: $\tau_H=\min\{t \geq 0:S_t=H\}$;&lt;/li&gt;&#xA;&lt;li&gt;The time at which the stock price reaches $0$: $\tau_0=\min\{t \geq 0:S_t=0\}$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The 2$^{\text{nd}}$ is irrelevant: the probability of $S_t$ hitting $0$ is $0$. Thus we are left with a payoff of $1$ whenever the price reaches the barrier $H$, after which the trade expires. Letting then:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \tau = \tau_H$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By risk-neutral valuation theory the price today $C_0$ of this claim is given by its discounted payoff under the risk-neutral measure$^{(1)}$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ C_0 = \mathbb{E}^{\mathbb{Q}}[e^{-r\tau}|\mathcal{F}_0] = \mathbb{E}^{\mathbb{Q}}[e^{-r\tau}]  $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If the interest rate is $0$, the problem is trivial and the claim's price is $1$, as explained by @dm63 in his comment. &lt;/li&gt;&#xA;&lt;li&gt;On the other hand, if $r &amp;gt;0$ then we have to compute the Laplace transform of the hitting time of a GBM, which is equivalent to computing the Laplace transform of an arithmetic Brownian motion.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Let:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \tau = \min\{t \geq 0 : W_t+\theta t = x\} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;be the hitting time of the arithmetic Brownian motion (ABM) with volatility $1$ and $0&amp;lt;\alpha&amp;lt;1$. The solution, which I prove in the appendix below, is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbb{E}^{\mathbb{Q}}\left[e^{-\alpha\tau}\right] = e^{(\theta-\sqrt{\theta^2+2\alpha})x}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But to be applied to our problem, it requires the following strong assumption$^{(1)}$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{2r-\sigma^2}{2\sigma} \geq 0 \quad \Leftrightarrow \quad r \geq \frac{\sigma^2}{2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, observe that by letting $S_0$ be the current stock price, we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ S_t = S_0e^{(r-\frac{\sigma^2}{2})t+\sigma W_t} = H \quad \Leftrightarrow \quad W_t + \frac{2r-\sigma^2}{2\sigma}t = \frac{1}{\sigma}\log \frac{H}{S_0}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Letting:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;&amp;amp; \alpha := r&#xA;\\[6pt]&#xA;&amp;amp; \theta := \frac{2r-\sigma^2}{2\sigma}&#xA;\\[6pt]&#xA;&amp;amp; x := \frac{1}{\sigma}\log \frac{H}{S_0}&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;\left(\theta - \sqrt{\theta^2+2\alpha}\right)x &amp;amp; = \left(\frac{2r-\sigma^2}{2\sigma}-\sqrt{\frac{(2r-\sigma^2)^2}{4\sigma^2}+2r}\right)\frac{1}{\sigma}\log \frac{H}{S_0}&#xA;\\[6pt]&#xA;&amp;amp; = \left(\frac{2r-\sigma^2}{2\sigma}-\sqrt{\frac{4r^2-4r\sigma^2+\sigma^4+8r\sigma^2}{4\sigma^2}}\right)\frac{1}{\sigma}\log \frac{H}{S_0}&#xA;\\[6pt]&#xA;&amp;amp; = \left(\frac{2r-\sigma^2}{2\sigma}-\sqrt{\frac{(2r+\sigma^2)^2}{4\sigma^2}}\right)\frac{1}{\sigma}\log \frac{H}{S_0}&#xA;\\[6pt]&#xA;&amp;amp; = \log \frac{S_0}{H}&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \boxed{C_0 = \mathbb{E}^{\mathbb{Q}}\left[e^{-r\tau}\right] = \frac{S_0}{H}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that for the claim to make sense, we need $H &amp;gt; S_0$, so we have $0 \leq C_0 &amp;lt; 1$. The price has a striking feature: it does not depend on the volatility of the stock price. This can be explained by the fact that, on a perpetual time scale and given that we are almost sure the stock price will hit the barrier (see appendix), the volatility becomes irrelevant $-$ although one might think that a higher volatility should increase the price of this claim. &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Appendix: Laplace transform of the hitting time of an ABM&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;We are looking for a closed-form formula for:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathcal{L_{\alpha}}(\tau) = \mathbb{E}^{\mathbb{Q}}\left[e^{-\alpha\tau}\right] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \tau = \min\{t \geq 0 : W_t+\theta t = x\} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We will assume that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;x &amp;gt; 0 &amp;amp; \quad (\text{A})&#xA;\\[6pt]&#xA;1 &amp;gt; \lambda &amp;gt; 0 &amp;amp; \quad (\text{B}) &#xA;\\[6pt]&#xA;\theta \geq 0 &amp;amp; \quad (\text{C})&#xA;\end{align} $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Letting:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \hat{W}_t = W_t+\theta t $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We first define the auxiliary process:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ X_t = e^{\lambda \hat{W}_t - \lambda\theta t - \frac{\lambda^2}{2}t} = e^{\lambda W_t - \frac{\lambda^2}{2}t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can be easily shown that $X_t$ is a martingale$^{(2)}$. Therefore the stopped process $X_{\min(t,\tau)}$ is also a martingale. By the martingale property and given $W_0=0$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbb{E}^{\mathbb{Q}}[X_{\min(t,\tau)}] = \mathbb{E}^{\mathbb{Q}}[X_{\min(0,\tau)}] = \mathbb{E}^{\mathbb{Q}}[X_0] = 1 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us now assess the behaviour of the stopped process as $t \rightarrow \infty$ depending on whether $\tau$ is finite or not:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If the hitting time is finite, then it comes:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$$ \lim_{t \, \rightarrow \, \infty} X_{\min(t,\tau)} = e^{\lambda \hat{W}_{\tau} - \lambda\theta\tau - \frac{\lambda^2}{2}\tau} $$&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If the hitting time is infinite, &lt;em&gt;i.e.&lt;/em&gt; the arithmetic Brownian motion never hits $x$, then we know that the exponential of $\lambda \hat{W}_t$ remains bounded between $0$ and $e^{\lambda x}$. Under assumptions $(\text{B})$ and $(\text{C})$ the rest of the exponential converges to $0$ as $t \rightarrow \infty$, thus:&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$$ \lim_{t \, \rightarrow \, \infty} X_{\min(t,\tau)} = 0 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Combining these two results, we get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \lim_{t \, \rightarrow \, \infty} X_{\min(t,\tau)} = X_{\infty} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ X_{\infty} = \mathbf{1}_{\{\tau \, &amp;lt; \, \infty\}}\left(e^{\lambda \hat{W}_{\tau} - \lambda\theta\tau - \frac{\lambda^2}{2}\tau}\right) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, under assumptions $(\text{A})$ and $(\text{B})$, we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ 0 \leq X_{\min(t,\tau)} \leq e^{\lambda \hat{W}_{\min(t,\tau)}} \leq e^{\lambda \hat{W}_{\tau}} \leq e^{\hat{W}_{\tau}} = e^{x} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore by the &lt;a href=&quot;https://en.wikipedia.org/wiki/Dominated_convergence_theorem&quot; rel=&quot;nofollow noreferrer&quot;&gt;dominated convergence theorem&lt;/a&gt; we can state that: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \lim_{t \rightarrow \infty} \mathbb{E}^{\mathbb{Q}}[X_{\min(t,\tau)}] =  \mathbb{E}^{\mathbb{Q}}\left[\lim_{t \rightarrow \infty}X_{\min(t,\tau)}\right] = \mathbb{E}^{\mathbb{Q}}[X_{\infty}]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbb{E}^{\mathbb{Q}}\left[\mathbf{1}_{\{\tau \, &amp;lt; \, \infty\}}\left(e^{\lambda \hat{W}_{\tau} - \lambda\theta\tau - \frac{\lambda^2}{2}\tau}\right)\right] = 1 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now making $X_{\infty}$ dependent on $\lambda$, we see it is bounded from above by $e^{x}&amp;gt;1$ and it converges $\text{a.s.}$ to $\mathbf{1}_{\{\tau \, &amp;lt; \, \infty\}}$ when $\lambda \rightarrow 0$. Applying again the dominated convergence theorem, we get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \lim_{\lambda \rightarrow 0}\mathbb{E}^{\mathbb{Q}}[X_{\infty}(\lambda)] = \mathbb{E}^{\mathbb{Q}}\left[\lim_{\lambda \rightarrow 0}X_{\infty}(\lambda)\right] = \mathbb{E}^{\mathbb{Q}}\left[\mathbf{1}_{\{\tau \, &amp;lt; \, \infty\}}\right] = \mathbb{Q}\left(\tau \, &amp;lt; \, \infty\right)=1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The hitting time is $\text{a.s}$ finite, hence we can get rid of the indicator function and write:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbb{E}^{\mathbb{Q}}\left[e^{\lambda \hat{W}_{\tau} - \lambda\theta\tau - \frac{\lambda^2}{2}\tau}\right] = 1 \quad \Leftrightarrow \quad \mathbb{E}^{\mathbb{Q}}\left[e^{- (\lambda\theta + \frac{\lambda^2}{2})\tau}\right] = e^{-\lambda x} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us define:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \alpha = \lambda\left(\theta+\frac{\lambda}{2}\right) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This identity defines a quadratic equation in $\lambda$ with solutions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;\lambda_1 = -\theta + \sqrt{\theta^2+2\alpha}&#xA;\\[6pt]&#xA;\lambda_2 = -\theta - \sqrt{\theta^2+2\alpha}&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given we have assumed $\lambda&amp;gt;0$ and $(\text{C})$, the solution must be $\lambda_1$, thus:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbb{E}^{\mathbb{Q}}\left[e^{- \alpha\tau}\right] = e^{(\theta - \sqrt{\theta^2+2\alpha}) x} $$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note $(1)$&lt;/strong&gt;: alternatively you could also interpret the payoff such that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ C_0 = \mathbb{E}^{\mathbb{Q}}[\mathbf{1}_{\{\tau \, &amp;lt; \, \infty\}}e^{-r\tau}]  $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case you are explicitly requiring the hitting time to be finite. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is one strong advantage from this representation, as we do not require any longer the strong assumption we made at the beginning, which purpose is to allow us to get rid of the indicator function in $X_{\infty}$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ r \geq \frac{\sigma^2}{2} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note $(2)$&lt;/strong&gt;: let us pick two times $s&amp;lt;t$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;\mathbb{E}^{\mathbb{Q}}[X_t|\mathcal{F}_s] &amp;amp; = \mathbb{E}^{\mathbb{Q}}[e^{\lambda W_t-\frac{\lambda^2}{2}t}|\mathcal{F}_s]&#xA;\\[3pt]&#xA;&amp;amp; = \mathbb{E}^{\mathbb{Q}}[e^{\lambda W_t-\frac{\lambda^2}{2}t+\lambda(W_s-W_s)}|\mathcal{F}_s]&#xA;\\[3pt]&#xA;&amp;amp; = e^{\lambda W_s-\frac{\lambda^2}{2}t}\mathbb{E}^{\mathbb{Q}}[e^{\lambda(W_t-W_s)}|\mathcal{F}_s]&#xA;\\[3pt]&#xA;&amp;amp; = e^{\lambda W_s-\frac{\lambda^2}{2}t}\mathbb{E}^{\mathbb{Q}}[e^{\lambda(W_t-W_s)}]&#xA;\\[3pt]&#xA;&amp;amp; = e^{\lambda W_s-\frac{\lambda^2}{2}t}e^{\frac{\lambda^2}{2}(t-s)}&#xA;\\[3pt]&#xA;&amp;amp;=X_s&#xA;\end{align} $$&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-07-09T19:17:57.770" LastActivityDate="2017-07-09T19:17:57.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34919" PostTypeId="1" AcceptedAnswerId="34961" CreationDate="2017-06-29T19:34:00.673" Score="9" ViewCount="10298" Body="&lt;p&gt;I am currently working on a large data set (approx 80 million data points over 10 years). I would like another set of data that has one currency in common. Eg, I have EUR/USD and would like USD/CNY or EUR/AUD etc. Doesn't need to be over the full 10 years, 1 year would be more than sufficient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found a few places online that sell this data, but the cheapest I could find was approx 60 Euros which is a lot for a student.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there anywhere someone can get data like this cheaper?&lt;/p&gt;&#xA;" OwnerUserId="28606" LastActivityDate="2020-07-04T01:24:52.427" Title="Where can someone get free (or very cheap) high frequency tick forex data?" Tags="&lt;data&gt;&lt;market-data&gt;&lt;fx&gt;&lt;historical-data&gt;&lt;tick-data&gt;" AnswerCount="4" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34920" PostTypeId="1" AcceptedAnswerId="34922" CreationDate="2017-06-29T20:14:48.503" Score="7" ViewCount="710" Body="&lt;p&gt;Being a lover of Sir Arthur Conan Doyle's work, I picked up a copy of Cochrane’s 2008 paper, &lt;em&gt;The Dog That Did Not Bark: A Defense of Return Predictability&lt;/em&gt; and read:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If returns are not predictable, dividend growth must be predictable,&#xA;  to generate the observed variation in divided yields. I find that the&#xA;  absence of dividend growth predictability gives stronger evidence than&#xA;  does the presence of return predictability&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Given &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\frac{DIV_1}{P_0} = r – g,$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with expected dividend &lt;span class=&quot;math-container&quot;&gt;$DIV_1$&lt;/span&gt;, current share price &lt;span class=&quot;math-container&quot;&gt;$P_0$&lt;/span&gt;, return &lt;span class=&quot;math-container&quot;&gt;$r$&lt;/span&gt; and dividend growth rate &lt;span class=&quot;math-container&quot;&gt;$g$&lt;/span&gt;, is Cochrane saying that since there is no statistical evidence that dividend yield &lt;span class=&quot;math-container&quot;&gt;$DIV_1/P_0$&lt;/span&gt; is correlated with dividend growth rate &lt;span class=&quot;math-container&quot;&gt;$g$&lt;/span&gt; when there should be, that there is a link (predictability) between dividend yield and returns?&lt;/p&gt;&#xA;" OwnerUserId="28559" LastEditorUserId="26595" LastEditDate="2019-04-16T14:50:37.680" LastActivityDate="2019-04-16T14:50:37.680" Title="Cochrane on Return Predictability" Tags="&lt;equities&gt;&lt;dividends&gt;&lt;yield&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="7" ContentLicense="CC BY-SA 4.0" />
  <row Id="34921" PostTypeId="2" ParentId="34914" CreationDate="2017-06-29T20:22:26.383" Score="0" Body="&lt;p&gt;It works like a quanto option: you know the forward Libor dynamics under $P^{USD}$ but you want to price under $P^{CSA}$. If you assume a Black &amp;amp; Scholes geometric brownian motion dynamics under $P^{USD}$, then under $P^{CSA}$ the drift is adjusted with the covariance between the forward libor and the change of measure $dP^{CSA} / dP^{USD}$, but the volatility does not change.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course pricing with the Black formula is not equivalent to saying that the underlying follows a geometric brownian motion, especially in the presence of a smile, but again the practice for quanto options is to use the adjusted quanto forward and the non quanto volatility at strike $K$, so I would say that pricing with USD collateralized volatility is fine.   &lt;/p&gt;&#xA;" OwnerUserId="17606" LastEditorUserId="17606" LastEditDate="2017-06-29T20:42:52.390" LastActivityDate="2017-06-29T20:42:52.390" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34922" PostTypeId="2" ParentId="34920" CreationDate="2017-06-30T02:58:12.227" Score="13" Body="&lt;ul&gt;&#xA;&lt;li&gt;Let $P_t$ be the price of the overall market index at the end of quarter $t$&lt;/li&gt;&#xA;&lt;li&gt;Let $D_t$ be the dividend for the overall market in quarter $t$&lt;/li&gt;&#xA;&lt;li&gt;Let $X_t = \frac{D_t}{P_t}$ be the dividend to price ratio.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Two key concepts in time-series statistics are &lt;a href=&quot;https://en.wikipedia.org/wiki/Stationary_process&quot; rel=&quot;noreferrer&quot;&gt;stationarity&lt;/a&gt; and &lt;a href=&quot;https://en.wikipedia.org/wiki/Ergodic_process&quot; rel=&quot;noreferrer&quot;&gt;ergodicity&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the dividends to price ratio is a stationary, ergodic process, then dividend to price ratio can't wander off arbitrarily far in some direction and stay there forever. Speaking informally, stationarity and ergodicity imply that if $X_t$ gets extremely low or extremely high, it'll tend to come back to normal (eventually).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cochrane is an excellent writer, and you may be better off reading his explanations, but I'll take a shot at an abbreviated version for basic intuition.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;If $\frac{D_t}{P_t}$ is unusually high at time $t$, how does it return to normal?&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;If $\frac{D_t}{P_t}$ is a stationary ergodic process, then if $\frac{D_t}{P_t}$ is high, you can forecast that it will probably decline.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;For $\frac{D_t}{P_t}$ to come down, either $D_t$ has to decrease or $P_t$ has to increase. A high $\frac{D_t}{P_t}$ therefore implies either:&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Dividends $D_t$ decrease in the future or&lt;/li&gt;&#xA;&lt;li&gt;Prices $P_t$ increase in the future (i.e. there are high returns).&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Cochrane gives evidence that high dividends to price ratios don't forecast changes in dividends, rather, they forecast higher returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cochrane's &quot;The Dog that Did Not Bark&quot; argument is that since high $\frac{D_t}{P_t}$ has to forecast dividends or returns, $\frac{D_t}{P_t}$ not forecasting dividends is evidence that $\frac{D_t}{P_t}$ does forecast returns.&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2018-06-17T21:46:02.253" LastActivityDate="2018-06-17T21:46:02.253" CommentCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="34925" PostTypeId="2" ParentId="26143" CreationDate="2017-06-30T06:00:43.423" Score="4" Body="&lt;p&gt;If you are interested in checking performance of a trading strategy using machine learning techniques I recommend using Quantopian for back-testing a Random Forest Classifier against SPY benchmark:&#xA;&lt;a href=&quot;https://www.quantopian.com/posts/simple-machine-learning-example-mk-ii&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.quantopian.com/posts/simple-machine-learning-example-mk-ii&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Machine learning can be useful in selecting alpha factors predictive of return as described in the following Quantopian notebook:&#xA;&lt;a href=&quot;https://www.quantopian.com/posts/machine-learning-on-quantopian&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.quantopian.com/posts/machine-learning-on-quantopian&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Machine learning can also be used to find clusters of stocks (K-means, GMM) for pair trading strategies, discover principal components (PCA) for mean reversion strategies, and predict latent market states (HMM, Kalman Filter).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recommend Kevin Murphy's &quot;Machine Learning: A probabilistic perspective&quot; as an excellent resource for studying machine learning.&lt;/p&gt;&#xA;" OwnerUserId="28610" LastActivityDate="2017-06-30T06:00:43.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34926" PostTypeId="2" ParentId="18660" CreationDate="2017-06-30T06:10:58.950" Score="4" Body="&lt;p&gt;Python. &lt;a href=&quot;http://scikit-learn.org/stable/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Scikit-learn&lt;/a&gt; is a powerful machine learning library written in Python. In addition to libraries such as &lt;a href=&quot;http://www.statsmodels.org/stable/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;stats models&lt;/a&gt; and tensor-flow.  Python is a stable production-level language (also used by Quantopian).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For unsupervised learning, you may want to look into affinity propagation, DBSCAN or Dirichlet-Process K-Means algorithms that do not require the knowledge of clusters ahead of time. For text data, LDA and on-line HDP are useful in learning the topics.&lt;/p&gt;&#xA;" OwnerUserId="28610" LastActivityDate="2017-06-30T06:10:58.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34928" PostTypeId="1" CreationDate="2017-06-30T11:26:31.907" Score="1" ViewCount="131" Body="&lt;p&gt;Let $X=(X_t,t\in\mathbb{N})$ be a pure jump Lévy process (i.e $X_t$ does not have a diffusion component). Let further $Y=(Y_t,t\in\mathbb{N})$ be a process that is used to time-change the process $X$ (there are several examples in Schoutens (2003) of these type of processes, such as the integrated CIR model). E.g, the time-changed Lévy process is given by $X_Y=(X_{Y_t},t\in \mathbb{N})$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Schoutens (2003), it is argued that for a price process $S=(S_t,t\in\mathbb{N})$ given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_t=S_0 \frac{\exp((r-q)t)}{\mathbb{E}(\exp{X_{Y_t}}\vert y_0)}\exp{X_{Y_t}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $q$ is the dividend yield, $r$ the interest rate, and $y_0$ the initial value of the underlying process for which $Y$ is based on, puts us into the risk-neutral world by mean-correcting arguments (because of the factor $\frac{\exp({r-q}t)}{\mathbb{E}(\exp{X_{Y_t}}\vert y_0)}$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Later on Schouten suggests to use the process $S$ to price options directly in the risk neutral world. It seems that this is all based on arbitrage-free principles.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So now to my question: In what way does the mean correcting argument in this case yield an Equivalent Martingale measure? They don't even define the Physical measure? Even though the discounted price process is a martingale(?) how can it be sure that it is also equivalent to some physical measure?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Schoutens (2003) Lévy processes in finance, Wiley.&lt;/p&gt;&#xA;" OwnerUserId="28616" LastActivityDate="2017-06-30T11:26:31.907" Title="Mean correcting martingale argument" Tags="&lt;options&gt;&lt;option-pricing&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34929" PostTypeId="1" AcceptedAnswerId="34931" CreationDate="2017-06-30T12:13:10.697" Score="0" ViewCount="569" Body="&lt;p&gt;I am trying to work with Kou's double exponential Jump-diffusion model and simulate a price path in a programming language. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the dynamics of the asset price in Kou's model follow:&#xA;\begin{equation}&#xA;‎\frac{dS(t)}{S(t-)}=\mu‎‏ ‎dt+\sigma ‎dW(‎t)+d(\sum_{i=1}^{N(t)}(V_i-1))‎&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where W(t) is a standard Brownian motion, N(t) is a Poisson process with rate ‎‎λ , and {Vi} is a sequence of independent identically distributed (i.i.d.) non negative random variables such that Y=log(V) has an asymmetric double exponential distribution with the density:&#xA;\begin{equation}&#xA;f_Y(y)=p.‎\eta_1 e^{-‎\eta_{1}y‎‎}‎\upharpoonleft_{y‎\geq 0‎}+q.‎\eta_2 e^{‎\eta_2 y‎} \upharpoonleft_{y&amp;lt;0},\eta_{1}&amp;gt;1,\eta_{2}&amp;gt;0 ‎‎‎&#xA;‎\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solving this SDE gives:&#xA;\begin{equation}&#xA; S(t)=S(0)\exp\{(\mu- \frac{1}{2}\sigma^2)t+\sigma W(t)\} \prod_{i=1}^{N(t)}V_i&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I generate the Yi-s in a simulation program via the asymmetric double exponential distribution. So let's say I have generated the following four jumps:&#xA;\begin{equation}&#xA;\{12.8277,-14.4736,7.287,-10.1267\}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; I simulate these values with the following Matlab code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;y=binornd(1,p,N,1); %1 = upwards jump, 0  = downwards jump&#xA;Y=y.*exprnd(e1,N,1)-(1-y).*exprnd(e2,N,1);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now the part which I do not get is the following. Because Y = log(V), the Vi-s in the price equation are:&#xA;\begin{equation}&#xA;V_i = e^{Y_i}&#xA;\end{equation}&#xA;right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So when the first jump occurs at time t1, I am adding the jump part in the price equation (the multiplication with Vi). To do so, I take the exponential of 12.8277, but then the stock price explodes (because exp(12.8277)&gt;372).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think I am mixing things up with the exponential in the equation, because multiplying with the exponential of the generated Yi-s leads to incorrect stock prices. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could someone explain to me the part which I am interpreting wrong?&lt;/p&gt;&#xA;" OwnerUserId="28615" LastEditorUserId="28615" LastEditDate="2017-06-30T13:03:43.503" LastActivityDate="2017-06-30T13:09:00.583" Title="Trouble understanding jump part in Kou double exponential jump diffusion model" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;stochastic-calculus&gt;&lt;jump&gt;&lt;jump-diffusion&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="34931" PostTypeId="2" ParentId="34929" CreationDate="2017-06-30T13:09:00.583" Score="0" Body="&lt;p&gt;Your problem is that $\eta$ in your density for $Y$ is the rate parameter of the exponential distribution such that its mean is $1 / \eta$. MATLAB however requires you to provide the mean as &lt;code&gt;mu&lt;/code&gt; in the &lt;code&gt;exprnd&lt;/code&gt; function. I.e. instead of passing &lt;code&gt;e1&lt;/code&gt; and &lt;code&gt;e2&lt;/code&gt; you should pass their inverses.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2017-06-30T13:09:00.583" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34932" PostTypeId="1" CreationDate="2017-06-30T14:15:18.883" Score="0" ViewCount="88" Body="&lt;p&gt;If I want to test the sensitivity of a diversified, multi-asset class portfolio to say a 100 bps shock upwards in the S&amp;amp;P 500, the simplest solution would be to run an OLS defined as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\hat{Y}_{portfolio} = \alpha +\hat{\beta_x}x_{sp500} + \epsilon$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;then define the portfolio sensitivity as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \Delta P = (\Delta X_{sp500})(\hat{\beta_x})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The obvious flaw with this method is that your fitted model would most likely have a very high variation and low $R^2$. Is there a standard method for using a dummy variable or some other technique to minimize $\hat{\beta}$ if the error term has high variation? &lt;/p&gt;&#xA;" OwnerUserId="19473" LastActivityDate="2017-06-30T14:15:18.883" Title="Sensitivity analysis" Tags="&lt;regression&gt;&lt;sensitivities&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34934" PostTypeId="1" CreationDate="2017-06-30T20:55:45.780" Score="4" ViewCount="427" Body="&lt;p&gt;This question is not very technical.&#xA;I have a file with holdings (both for the fund and the benchmark) of a number of securities and need to do a style allocation analysis.&#xA;For these securities, I have different 'factors' such as dividend yield, market cap, P/E, P/B etc and I have the weights in the fund and in the benchmark.&#xA;The analysis should be done in excel, but I'm not sure how to do it.&#xA;I could do a 'weighted average' of each factor and then compare the outcome of portfolio to the outcome of the benchmark. But that seems too straight forward. Do you have any suggestions on how to do such style allocation analysis? Thanks&lt;/p&gt;&#xA;" OwnerUserId="28625" LastActivityDate="2017-11-21T05:13:53.820" Title="Holdings based style analysis" Tags="&lt;risk&gt;&lt;factor-models&gt;&lt;excel&gt;&lt;factor-investing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34936" PostTypeId="1" AcceptedAnswerId="34937" CreationDate="2017-06-30T21:47:49.983" Score="0" ViewCount="46" Body="&lt;p&gt;Would anyone recommend any Index or data that I can avail to understand the trend in buying/selling of US treasuries by China? I have access to Reuters feed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&#xA;Sumit&lt;/p&gt;&#xA;" OwnerUserId="24131" LastEditorUserId="16148" LastEditDate="2017-06-30T22:15:00.217" LastActivityDate="2017-07-01T00:14:22.557" Title="US Treasury foreign buying/selling data" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;treasuries&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34937" PostTypeId="2" ParentId="34936" CreationDate="2017-07-01T00:14:22.557" Score="3" Body="&lt;p&gt;The following link from Treasury gives you the data you need &#xA;&lt;a href=&quot;https://www.treasury.gov/resource-center/data-chart-center/tic/Pages/index.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.treasury.gov/resource-center/data-chart-center/tic/Pages/index.aspx&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-07-01T00:14:22.557" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34938" PostTypeId="2" ParentId="34915" CreationDate="2017-07-01T04:32:29.667" Score="0" Body="&lt;p&gt;I initially thought that this could be done in R using &lt;code&gt;fPortfolio&lt;/code&gt; package, but couldn't figure it out. Then &lt;a href=&quot;https://stackoverflow.com/questions/44842929/minimize-portfolio-variance-constrained-to-be-sufficiently-similar-to-a-benchma&quot;&gt;@josliber from SO&lt;/a&gt; suggested the following with &lt;code&gt;quadprog&lt;/code&gt; package:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quadprog)&#xA;set.seed(1111)&#xA;df = matrix(rnorm(3*100), 100)&#xA;&#xA;cov.mat = cov(df)&#xA;wbench &amp;lt;- c(0.4, 0.5, 0.1)&#xA;n &amp;lt;- length(wbench)&#xA;&#xA;cov.mat.exp &amp;lt;- cbind(rbind(cov.mat, matrix(0, n, n)), matrix(0, 2*n, n))&#xA;cov.mat.exp &amp;lt;- cov.mat.exp + 1e-8*diag(2*n)  ## make it positive definite&#xA;&#xA;consts &amp;lt;- rbind(rep(c(1, 0), c(n, n)),&#xA;                 rep(c(0, 1), c(n, n)),&#xA;                 cbind(matrix(0, n, n), -diag(n)),&#xA;                 cbind(diag(n), -diag(n)))&#xA;&#xA;rhs &amp;lt;- c(1, 0.7, -w.bench, rep(0, n))&#xA;&#xA;mod &amp;lt;- solve.QP(Dmat = cov.mat.exp,&#xA;                dvec = rep(0, 2*n),&#xA;                Amat = t(consts),&#xA;                bvec = rhs,&#xA;                meq = 1)&#xA;wpf &amp;lt;- head(mod$solution, n)&#xA;y &amp;lt;- tail(mod$solution, n)&#xA;wpf&#xA;y&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="19096" LastActivityDate="2017-07-01T04:32:29.667" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34939" PostTypeId="2" ParentId="34860" CreationDate="2017-07-01T06:57:26.033" Score="1" Body="&lt;p&gt;In my view there isn't a good answer to this question; the daily method introduces autocorrelation between your returns and the yoy samples leave you with little data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would let whatever you choose (and I'll mention some of the other things that you could think about below) mainly be guided by what you are trying to achieve with you analysis, e.g. do you care about the mean, standard deviation, worst loss, or still something else? Do you believe that recent returns are more relevant than those from 50 years ago?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So some ideas for what you could do beyond what you mentioned (and depending on your goals these could be reasonable or highly inappropriate):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As hinted at in the comments on the question, for the daily points there are some methods available to adjust e.g. the estimator for the standard deviation of yearly returns to correct for the autocorrelation. So that's one way to go. If there isn't an analytical correction, you could come up with one based on simulation from what you consider to be an appropriate idealized distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another way to go could be bootstrapping. If daily bootstrapping isnt useful for your application, a good trade-off might be to divide your data in weekly or monthly blocks and just sample 52 cq 12 of those.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you're really interested in the tails, you could also look at something like extreme value theory for estimating returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet another way to go, if you're interested in crises (as people looking at very long time series often are) could be to model the data as bring emitted from a hidden Markov model where markets can be in a few states (e.g. {normal, crisis, recovery}) and estimate return distributions and transition probabilities from them and then sample from you this model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet another alternative could be looking at what distribution fits your daily data well and simulate how that aggregates from daily to yearly for certain percentiles of the distribution.&lt;/p&gt;&#xA;" OwnerUserId="11851" LastEditorUserId="16160" LastEditDate="2017-07-01T07:57:24.010" LastActivityDate="2017-07-01T07:57:24.010" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34949" PostTypeId="1" CreationDate="2017-07-02T15:36:32.877" Score="1" ViewCount="179" Body="&lt;p&gt;Ideally I would like links to code implementations (eg. Matlab ) or book/paper references, but I would appreciate suggestions on various methods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Update: I was hoping to attract people who test the validity of their models (eg. that indeed a stock price follows a BS or OU model). I am more interested in the code implementation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We start with sampled process $X_{t}$.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;A straightforward way is through repeated normality tests: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;a. Test for normality of $X_{t}$ using KS test&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b. Independence of increments: we test whether the product $X_{T/2}(X_{T}-X_{T/2})/\sigma^{2}$ is close to a standard normal, where $\sigma^{2}=(T/2)^{2}$ . &lt;/p&gt;&#xA;&#xA;&lt;p&gt;c. Joint normal for increments $Y_{n}=(X_{t_2}-X_{t_1},...,X_{t_n}-X_{t_n-1})$: we divide the possible values of $Y_{n}$ into $m$ cells and denote $O_{j}:=$# samples that fall into cell $j$. Then the statistic $\sum \frac{(O_{j}-E[O_{j}])^{2}}{E[O_{j}]}$ should be approximately a $\chi^{2}-$distribution. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Maybe testing for quadratic variation=$t$ and martingale property (Levy characterization)?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Some spectral characterization for WP? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The other &lt;a href=&quot;https://stats.stackexchange.com/questions/215837/test-for-fractional-brownian-motion-in-matlab&quot;&gt;link&lt;/a&gt; is testing for fractional WP, which is more involved.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Turning it into a test for White noise since it is the &quot;derivative&quot; of WP. So maybe taking finite difference for WP and doing white noises tests for it:&#xA;$$(X_{t+\Delta t}-X_{t})/\Delta t.$$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="28642" LastEditorUserId="28642" LastEditDate="2017-07-02T23:37:59.860" LastActivityDate="2017-07-02T23:37:59.860" Title="Testing whether a process is a Wiener process" Tags="&lt;time-series&gt;&lt;programming&gt;&lt;brownian-motion&gt;&lt;regression&gt;&lt;validation&gt;" AnswerCount="0" CommentCount="5" ClosedDate="2017-07-02T17:29:55.227" ContentLicense="CC BY-SA 3.0" />
  <row Id="34950" PostTypeId="1" CreationDate="2017-07-02T15:52:50.607" Score="1" ViewCount="85" Body="&lt;p&gt;Why is small number of defaults is a problem in case of PD estimation? What are the consequences? Can you recommend notes, books, etc about the topic? &lt;/p&gt;&#xA;" OwnerUserId="27474" LastActivityDate="2017-07-03T00:04:55.877" Title="Problem of PD estimation" Tags="&lt;credit-risk&gt;&lt;default-probability&gt;" AnswerCount="2" CommentCount="1" ClosedDate="2017-07-03T17:21:06.683" ContentLicense="CC BY-SA 3.0" />
  <row Id="34951" PostTypeId="2" ParentId="34950" CreationDate="2017-07-02T18:08:06.767" Score="1" Body="&lt;p&gt;A low default portfolio (LDP) problem is encountered more often in case of wholesale lending portfolios where the number of borrowers is much less compared to retail lending portfolios where the number of borrowers run into tens of thousands and consequently low default portfolios are often the exception. A useful presentation on negotiating low default portfolios can be found &lt;a href=&quot;https://www.business-school.ed.ac.uk/waf/crc_archive/2013/23.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&#xA;This presentation has references to other important work done on working with LDPs.&lt;/p&gt;&#xA;" OwnerUserId="28645" LastActivityDate="2017-07-02T18:08:06.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34952" PostTypeId="2" ParentId="34920" CreationDate="2017-07-02T21:02:29.900" Score="10" Body="&lt;p&gt;Maybe I am a little bit late to the party, but I want to give a shot. As in &lt;a href=&quot;https://scholar.harvard.edu/files/campbell/files/campbellshiller_jf1988.pdf&quot; rel=&quot;noreferrer&quot;&gt;Campbell and Shiller&lt;/a&gt;, start from the identity $R_{t+1}\equiv\frac{P_{t+1}+D_{t+1}}{P_t}$ where $R_{t+1}$ is the gross return between time $t$ and $t+1$, and $P_t$ is the price at time $t$. Rearrange the relationship as $R_{t+1} =\frac{D_{t+1}}{D_t}\frac{\left(1+\frac{P_{t+1}}{D_{t+1}}\right)}{\frac{P_t}{D_t}}$. Take logs of both sides and obtain:&#xA;$$r_{t+1}=\Delta d_{t+1}-pd_t+log\left(1+e^{pd_{t+1}}\right)\approx k+\Delta d_{t+1}-pd_t+\rho pd_{t+1}$$ where $r_{t+1}=logR_{t+1}$, $\Delta d_{t+1}=log \left(\frac{D_{t+1}}{D_t}\right)$, $pd_t=log\left(\frac{P_t}{D_t}\right)$ and $k$ and $\rho$ are constants coming from the Taylor expansion of $log\left(1+e^x\right)\approx k+\rho x$.For more details check &lt;a href=&quot;http://people.bu.edu/sgilchri/teaching/EC%20745%20Fall%202013/Lecture%20Slides/lecture4_campbell_shiller_decomp.pdf&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can rearrange and iterate forward to obtain:&#xA;\begin{equation}&#xA;pd_t = k + \sum_{j=0}^\infty\rho^j\Delta d_{t+1+j} - \sum_{j=0}^\infty\rho^j r_{t+1+j}&#xA;\end{equation}&#xA;From here you can compute &#xA;$$var\left(pd_t\right)=Cov\left(pd_t,\sum_{j=0}^\infty\rho^j\Delta d_{t+1+j}\right)-Cov\left(pd_t,\sum_{j=0}^\infty\rho^j r_{t+1+j}\right)$$ and therefore the key relationship $$1=\frac{Cov\left(pd_t,\sum_{j=0}^\infty\rho^j\Delta d_{t+1+j}\right)}{var\left(pd_t\right)}-\frac{Cov\left(pd_t,\sum_{j=0}^\infty\rho^j r_{t+1+j}\right)}{var\left(pd_t\right)}=\beta_{d}-\beta_r$$ where $\beta_d$ is the OLS estimate of a regression of al future dividend growths on $pd_t$ and $\beta_r$ of all log-returns on $pd_t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cochrane's starting point is exactly &lt;strong&gt;$1=\beta_d-\beta_r$&lt;/strong&gt;. Any hypothesis regarding $\beta_r$, i.e. whether returns are predictable using the price-dividend ratio, &lt;strong&gt;generates a &quot;twin&quot; hypothesis&lt;/strong&gt; regarding $\beta_d$, i.e. whether dividend growth can be predicted using the price-dividend ratio! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So for instance, let's assume that returns are indeed NOT predictable, i.e. $\beta_r=0$, then we whould expect $\beta_d=1+\beta_r=1$. A test of no return predictability implies a joint test of $\beta_r=0$ AND $\beta_d=1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://faculty.chicagobooth.edu/john.cochrane/research/papers/cochrane%20dog%20that%20did%20not%20bark.pdf&quot; rel=&quot;noreferrer&quot;&gt;Cochrane &lt;/a&gt;does exactly this. He simulates jointly $\beta_r$ and $\beta_d$ and shows that under the null of $\beta_r=0$ the coefficient of $\beta_d$ is much more extreme than what we observe in the data. Quoting the paper:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In sum, the &lt;em&gt;lack&lt;/em&gt; of dividend forecastability in the data gives far stronger&#xA;  statistical evidence against the null than does the &lt;em&gt;presence&lt;/em&gt; of return forecastability.[...]Under the&#xA;  unforecastable-return null, we see return forecast coefficients as large or&#xA;  larger than those in the data about 20% of the time and a t-statistic as large&#xA;  as that seen in the data about 10% of the time. However, I find that the&#xA;  absence of dividend–growth forecastability offers much more significant&#xA;  evidence against the null. The best overall number is a 1–2% probability&#xA;  value (last row of Table 5)—dividend growth fails to be forecastable in only&#xA;  1–2% of the samples generated under the null. The important evidence, as&#xA;  in Sherlock Holmes’s famous case, is the dog that does not bark.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2017-07-02T21:02:29.900" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34953" PostTypeId="1" CreationDate="2017-07-02T21:53:27.910" Score="0" ViewCount="5937" Body="&lt;p&gt;I know this is a rookie question, but I have seen some comments about using GARCH to forecast stock returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it something people do? Wasn't GARCH just for volatility?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, can you suggest any (simple) papers that could help me better understand this technique and how to apply it in Eviews or R?&lt;/p&gt;&#xA;" OwnerUserId="27347" LastEditorUserId="467" LastEditDate="2017-07-03T04:38:50.717" LastActivityDate="2017-07-05T19:43:31.497" Title="Can I forecast stock returns using GARCH?" Tags="&lt;garch&gt;&lt;forecasting&gt;&lt;eviews&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34954" PostTypeId="2" ParentId="34950" CreationDate="2017-07-03T00:04:55.877" Score="0" Body="&lt;p&gt;So there are two issues present in estimating the probability of default, the scarcity of observed defaults and the form of the model.  For simplicity, we will restrict ourselves to Pearson-Neyman decision theory and Bayesian decision theory.  Presumably, if you are calculating a default rate or a probability of default, you are going to do something with this information.  If that is not the case, as may be true in academic research, then you should note that the likelihood-based solution will be similar to the Frequentist solution anyway.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;@AlexC points out the obvious extreme case, that the number of observed defaults is zero.  If you used a simple counting mechanism such as defaults/total observations then in a Frequentist methodology, the projected probability of default is zero.  It won't happen.  Don't worry about it.  Of course, this is naive, as is also pointed out by @AlexC.  The Bayesian alternative is problematic in that a solution is not unique.  The solution will depend entirely upon the prior alone.  Although the data will influence the final solution, the posterior estimate will be heavily determined by the estimate prior to collecting any data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To put this in a real-world context, consider a firm that had 1,000 credit transactions with customers and no defaults.  For simplicity, assume that if there is a default then there is no possibility of partial recovery.  That simplicity has to go away, but let's keep this simple.  The firm is seeking a bank loan to expand and the bank will do so but rejects their accounting department's &quot;allowance for doubtful debt.&quot;  They want compensating balances to cover the allowance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem of using a Bayesian method is that you have to state your beliefs about the default rate, prior to collecting data.  Of course, this could be retrospective and one could say &quot;last year I believed the default rate would be $\mu\pm\sigma$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is what density function to use.  Someone could use the uniform distribution as the prior distribution, which is the same thing as saying all possible default rates are equally possible.  The difficulty with this solution is that it probably is not credible.  If something is a rare event, then probably everyone knows it is a rare event.  In fact, if you believed that there was an equal chance of 999 defaults and 1 default, then your pricing would probably drive all customers out of the credit market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So let's consider a simpler prior density, where any default rate $\theta$ is more probable to the left and less probable to the right.  The easiest version of this is the triangle distribution.  It's density is $2(1-\theta).$  This is tempting because all it says is small values are more probable than large values.  The challenge is that the prior expected rate of default is 33%, which is not a rare event.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, one could ask the managers what they expected.  Let's assume the manager said that from prior experience they expected a one percent, plus or minus one percent rate of default.  Using the beta distribution as a model, that is approximately a beta distribution of one default per ninety-seven successes.  The prior density is $97(1-\theta)^{96}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have not noticed, we haven't even begun to discuss things like logistic regression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So now let's consider our four possible default rate calculations, the Frequentist, the uniform distribution, the triangular distribution and the density from an expert.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under the Frequentist solution, the probability of default is zero and the confidence interval is zero in width so it is [0,0].&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Bayesian estimate using the uniform is one default per 1002 transactions.  The Bayesian 95% highest density credible interval is (0.00253%,.368%).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Bayesian estimate using the triangular distribution is one default per one thousand and three observations.  The Bayesian 95% highest density credible interval is (0.00253%,.367%)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Bayesian estimate using the expert managerial opinion is one per one thousand and ninety-eight observations.  The Bayesian 95% highest density credible interval is (0.00231%, .336%).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, the deeper issue is that we have estimated a parameter on an event we have never even seen once.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's assume they got the bank loan, and there were 2,000 total observations the next year and nine were defaults.  Strangely, the results must depart because the Frequentist solution is to treat this as a new sample.  While you could combine them in a meta-analysis, or if you were doing an analysis of the entire set, the default is to separate them as separate samples.  Repetition is important in Frequentist theory.  We will solve it both ways, however, since someone approaching the problem for the first time at the end of the second year wouldn't see the first year as a different sample.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second year estimate would be .45% with a confidence interval of (.430%,.470%).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The joint year estimate would be .3% with a confidence interval of (.289%,.311%).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To simplify, only the &quot;expert&quot; decision will be tested.  The mean parameter estimate is .323%.  The 95% highest density credible interval is (.155%,.551%).  The last Bayesian posterior would become the prior for the new estimate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might ask yourself, &quot;why is the Bayesian estimate so wide compared to the Frequentist?&quot;  The Bayesian method basically takes the uncertainty around rare events as more substantial than Frequentist methods would imply.  While the Frequentist joint estimate is quite tight with a width of .022%, the Bayesian is quite wide with a width of .396%.  That is 18 times wider than the Frequentist method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The difference is created by how the two methods interpret uncertainty.  The Frequentist assumes the true model is known and since it is known only chance remains.  The Bayesian method does not assume the true model is known and the infinite set of possible true models is assigned a probability distribution that it is the true model.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically, a Frequentist prediction is a prediction built on an expectation, while the Bayesian method provides an expectation of a prediction.  P(E(X)) versus E(P(X)).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the probability had been nearer to 50% then the Bayesian interval would tend to be inside the Frequentist interval because you have seen so many examples of both cases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which of the two should you consider using?  If your question is of a true or false nature, such as $H_0:.1\le\theta$, then you should use the Frequentist solution.  On the other hand, if the true value of $\theta$ matters, particularly if you are gambling on the result as you would as the management creating a policy for recievables, then you should use the Bayesian method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason is again based on how they handle uncertainty.  The Frequentist estimator is a form of an expectation.  As such it has nice properties when thinking in terms of truth or falsehood or more properly rejection of a null.  On the other hand, the Bayesian solution actually creates an entire statistical distribution of possible answers.  When you estimate the number of future events that could happen, a density function provides more information to the predictive estimate than a single point will, no matter how well chosen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What has not been discussed are things such as logit, probit or related methods.  The biggest issue there is that your number of factors have to be small relative to your observed defaults.  Logit is the easier to discuss because it is directly related to the methods used above, except that the problem is converted into one of odds, to be more precise, log odds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All the limitations seen above are present in logistic regression except that you are trying to condition the prediction on factors.  The difficulty here is that you have few examples of an event and so while factors may be very good at explaining variation among the observed non-defaults, they may not be good at predicting the difference between defaults and non-defaults. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The form is restricted by the size of defaults and non-defaults.  Imagine you were sure eight factors were involved in separating defaults from non-defaults, but you only saw nine examples of defaults.  Further, you think one factor is actually quadratic.  You will have an overfitting problem.  The very thing you need, which is a highly predictive model for these rare events, is the very thing you cannot have.  Fortunately, Bayesian model selection processes will provide a disciplined mechanism for you to make estimates with, but it would be very surprising to find the successful model had 8 factors with the above data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On top of this, most defaults are not &quot;all-or-nothing,&quot; and on top of this, you will need to model the actual amount at risk and not just the rate.  This will reduce your independent variables down quite a bit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your useage is academic or existential, then use the Frequentist method.  If this is being used for a business then the Bayesian method should be used.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2017-07-03T00:04:55.877" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34955" PostTypeId="2" ParentId="30812" CreationDate="2017-07-03T00:58:31.807" Score="4" Body="&lt;p&gt;I have been searching for the same information as I noticed some of my students did use CSI market.  What bothered me is that there are no dates attached to the numbers.  The only number is the copyright year in small letters at the bottom.&lt;/p&gt;&#xA;" OwnerUserId="28647" LastActivityDate="2017-07-03T00:58:31.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34957" PostTypeId="2" ParentId="18546" CreationDate="2017-07-03T02:54:03.587" Score="1" Body="&lt;p&gt;This question is very broad and subjective. There are many ways to look at ETFs (for short term trading, for long term holding, ...). What is useful to one person is ridiculous to another. Many people who work with ETF's keep (and update) their own list of ETFs that are relevant to them. You may want to do the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is one person's list, emphasizing broad coverage of major asset classes. It excludes 2x and 3x funds, individual country funds (of which there are dozens) and smart beta funds. Apologies for any mistakes or omissions.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ETFs for Major Asset Classes&#xA;&#xA;Broad categories of world stocks&#xA;&#xA;VTI   ITOT        US Stocks (US Tot Stk Mkt Index)&#xA;VEA               Developed non-US mkts (FTSE dev ex-northAm)&#xA;VWO   SCHE  EEM   Emerging Mkt Stocks&#xA;FM    FRN         Frontier Mkts&#xA;&#xA;Stock styles within US&#xA;&#xA;RSP               Guggenheim S&amp;amp;P 500 EW&#xA;RPV               Guggenheim  S&amp;amp;P500 Pure Value&#xA;IWB   VONE        iShares Russell 1000&#xA;IWF               iShares Russell 1000 Growth&#xA;IWD               iShares Russell 1000 Value&#xA;SCHV              Schwab Large Cap Value&#xA;IUSV              iShares Core S&amp;amp;P Value&#xA;VTV               V CRSP Large Cap Value&#xA;EQAL              Russell 1000 EW&#xA;IWM   VTWO        iShares Russell 2000&#xA;IWO               iShares Russell 2000 Growth&#xA;IWN               iShares Russell 2000 Value&#xA;SPLV              Sp500 Low Volatility&#xA;USMV              iShares MSCI USA Minimum Volatility&#xA;LGLV              Russell 1000 Low Volatility&#xA;USLB              Russell 1000 Low Beta EW&#xA;VBR               Small Cap Value (CRSP US sm cap val)&#xA;VBK               Small Cap Growth (CRSP US sm cap gr)&#xA;VB                Small Cap (CRSP US sm cap)&#xA;MDY               S&amp;amp;P Midcap 400&#xA;VOE               CRSP Mid Cap Value&#xA;IJR               S&amp;amp;P Smallcap 600&#xA;EWSC              S&amp;amp;P Smallcap 600 EW&#xA;SLYV              S&amp;amp;P Smallcap 600 value&#xA;SLYG              S&amp;amp;P Smallcap 600 growth&#xA;EES               Wisdomtree Small Cap Earn&#xA;VYM               High Dividend Yield&#xA;&#xA;Industry sectors within US&#xA;&#xA;XLF   VFH         Financial Sector&#xA;XLK   VGT         Technology Sector&#xA;XLV   VHT         Health Care Sector&#xA;XLP   VDC         Consumer Staples Sector&#xA;XLY   VCR         Consumer Discretionary Sector&#xA;XLE   VDE         Energy Sector&#xA;XLB   VAW         Materials Sector&#xA;XLI   VIS         Industrial Sector&#xA;XLU   VPU         Utiltites Sector&#xA;RWR   VNQ         REITs&#xA;&#xA;Specific industries within US&#xA;&#xA;XME               Metals and Mining&#xA;XBI               Biotech&#xA;XPH               Pharmaceutical&#xA;XAR               Aerospace and defense&#xA;XTL               Telecom&#xA;XHB               Homebuiders&#xA;XRT               Retail&#xA;KIE               Insurance&#xA;&#xA;&#xA;Stock styles international (outside US)&#xA;&#xA;EFA               iShares MSCI EAFE&#xA;EFG               iShares MSCI EAFE Growth&#xA;EFV               iShares MSCI EAFE Value&#xA;SCHF              Schwab FTSE dev ex US&#xA;VSS               V FTSE AW ex US Small Cap&#xA;SCZ               iShares MSCI EAFE Small Cap&#xA;GWX               SPDR International Small Cap&#xA;&#xA;&#xA;Bonds&#xA;&#xA;(1) US Treasuries by Maturity&#xA;BIL               SPDR Bbg Barclays 1-3 Month T-Bill&#xA;SHY   VGSH        USTR Sh Term bd (1-3 years)&#xA;IEI   VGIT        US 3-7 year treasury&#xA;IEF               US 7-10 year treasury&#xA;TLH               US 10-20 year treasury&#xA;TLT               US 20+ year treasury&#xA;EDV               US Extended Duration (24 yr)&#xA;VTIP  SCHP  TIP   Treas Inflation Prot Securities&#xA;&#xA;(2) Bond portfolios including some non-USTR bonds&#xA;BND   AGG   SCHZ  Total Bond Mkt (Aggr bnd index, us inv grade)&#xA;BLV               Lg Term bond (global)&#xA;BSV               Sh Term bond (global)&#xA;BNDX  IAGG        V International Bond (Aggr exUS, hedged)&#xA;CSJ   VCSH        1-3 year credit (us inv grade)&#xA;LQD   VCIT        US inv grade corp&#xA;CLY   VCLT        10+ yr credit (us inv grade)&#xA;JNK   HYG         High yield bond&#xA;BWX               Intl treas ex US&#xA;HYXU              Dev Mkts ex US high yield&#xA;PCY               Em Mkts Sovereign USD Debt&#xA;VWOB  EMB         Em Mkts Govt Bond&#xA;CEMB              Em Mkts Corp Bond&#xA;EMLB              Em Mkts lcl currency Bond&#xA;EMLC              Em Mkts lcl currency Bond&#xA;VTEB              US Municipal Bond&#xA;BKLN              Senior Loan (lev loan)&#xA;&#xA;Real Estate Investment Trusts&#xA;&#xA;VNQ   SCHH        US REITs&#xA;VNQI              REITs ex US&#xA;REM               Mortgage REITs&#xA;&#xA;Global Infrastructure&#xA;&#xA;IGF               iShares Global Infrastructure&#xA;&#xA;Preferred Stock/Convertibles&#xA;&#xA;PFF   PSK         Preferred Stock&#xA;CWB               SPDR Bbg Convertible&#xA;ICVT              iShares Conv Bond&#xA;&#xA;Commodities &amp;amp; Resources&#xA;&#xA;GLD               Gold&#xA;RING              Gold Mining Stocks&#xA;USO               Crude Oil&#xA;COMB  BCI         BBG Commod index&#xA;BCD               BBG Commod index 4-6 mo.&#xA;COMG              GSCI Commod Index&#xA;SLV               Silver&#xA;PPLT              Platinum&#xA;PALL              Palladium&#xA;CPER              Copper&#xA;WOOD              Ishares Global Timber &amp;amp; Forest&#xA;FIW               First Trust Water&#xA;&#xA;Master Limited Partnerships&#xA;&#xA;AMLP  AMJ         Alerian MLP index&#xA;TPYP              Tortoise NA Pipeline MLP&#xA;&#xA;Foreign Exchange&#xA;&#xA;UUP               US dollar (bullish Usd vs 6 major currencies)&#xA;UDN               US dollar (bearish Usd vs 6 major crrencies)&#xA;FXE               Long the Euro&#xA;FXY               Japanese Yen&#xA;CYB               Chinese Yuan&#xA;DBV               DB G10 Carry Trade&#xA;&#xA;Option Based, Volatility Based&#xA;&#xA;PUTW              Wisdomtree CBOE S&amp;amp;P 500 PutWrite (PUT)&#xA;PBP               PowerShares S&amp;amp;P 500 BuyWriteCall (BXM)&#xA;VXX               Volatility&#xA;XIV               Volatility Inverse&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-07-03T02:54:03.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34958" PostTypeId="2" ParentId="27510" CreationDate="2017-07-03T04:49:23.317" Score="0" Body="&lt;p&gt;I face the same problem. I was trying to simulate (not calibrate the model) using the basic simulation scheme that you outlined (the log Euler scheme). I used a flat forward libor rate of 3.5% and a flat vol (time homogenous) 30%. When I simulate out to 15+ years, I start getting rates like you witnessed for some paths. Did you get any clarity on this issue. Do people not use this discretization scheme (I saw some articles talking about simulating deflated bond prices, as they are a martingale under this measure and then backing out Libors from those simulated bond prices). That doesn't answer this explosion issue. I guess the corresponding numeraires will be very small canceling out the effect (when people value assets through pathwise discounting). Is that the reason why we don't see anyone commenting on this issue?&lt;/p&gt;&#xA;" OwnerUserId="28650" LastActivityDate="2017-07-03T04:49:23.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34959" PostTypeId="2" ParentId="34953" CreationDate="2017-07-03T08:23:08.333" Score="2" Body="&lt;p&gt;The GARCH(p, q) model (where p is the order of the GARCH terms ${\sigma^2}$ and q is the order of the ARCH terms ${\epsilon^2}$ ), following the notation of original paper is given by:&#xA;$$&#xA;{\sigma_t^2}={\omega}+{\sum_{i=1}^q}{\alpha_i}{\epsilon_{t-i}^2}+{\sum_{i=1}^p}{\beta_i}{\sigma_{t-i}^2}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously, the GARCH model is about volatility and variance of returns. It can only forecast volatility, but not returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually, It is much more difficult to forecast returns than to forecast volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could take this book to understand GARCH and apply it with R: &#xA;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0470890819&quot; rel=&quot;nofollow noreferrer&quot;&gt;An Introduction to Analysis of Financial Data with R.&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="22348" LastActivityDate="2017-07-03T08:23:08.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34961" PostTypeId="2" ParentId="34919" CreationDate="2017-07-03T09:45:43.457" Score="2" Body="&lt;p&gt;You might get something from &lt;a href=&quot;http://www.truefx.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Integral's True FX&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2017-07-03T09:45:43.457" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34963" PostTypeId="2" ParentId="27510" CreationDate="2017-07-03T12:57:28.943" Score="1" Body="&lt;p&gt;The rates will explode in the current low rates environment my friend where empirically they are at a too low level to use a log-normal model if you want to preserve your log-normality please use a shifted log normal distribution instead to a convenient rate cut off of around 2%. This happens mainly on EUR market.&#xA;Hope this help&lt;/p&gt;&#xA;" OwnerUserId="24915" LastEditorUserId="24915" LastEditDate="2017-09-04T07:48:58.533" LastActivityDate="2017-09-04T07:48:58.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34965" PostTypeId="2" ParentId="27510" CreationDate="2017-07-03T14:35:05.863" Score="5" Body="&lt;p&gt;this is a well-known problem. One solution is to make volatility zero when rates exceed a certain high level. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's less problematic than it looks because any cash-flows generated will be divided by a rolling money market account which has huge value and so the deflated cash-flows are very small.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2017-07-03T14:35:05.863" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34966" PostTypeId="1" AcceptedAnswerId="34970" CreationDate="2017-07-03T15:50:38.980" Score="4" ViewCount="528" Body="&lt;p&gt;I use the Monte-Carlo Simulation for the computation of VaR and CVaR and wish to compute the 95% Confidence Interval of my result(not the confidence level of VaR). In the case of VaR this is simple the confidence interval on a quantile given by the formula $$\frac{r}{100}=\alpha+\sqrt\frac{\alpha(1-\alpha)}{m} N^{-1}(\frac{1-\beta}{2})$$ where $\alpha$ denotes the confidence level of VaR(the quantile) and $\beta$ the desired confidence Interval in percentage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;  How can I calculate the confidence Interval for CVaR? As the CVaR is a conditional expectation, I have two statistical errors, one on the quantile and one on the computation of expectation using Monte-Carlo. How can I find a formula for this.&lt;/p&gt;&#xA;" OwnerUserId="25867" LastEditorUserId="25867" LastEditDate="2017-07-03T17:28:28.030" LastActivityDate="2017-07-04T06:41:12.380" Title="Confidence Interval on Monte-Carlo-CVaR" Tags="&lt;risk-management&gt;&lt;var&gt;&lt;value-at-risk&gt;&lt;cvar&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34968" PostTypeId="2" ParentId="34953" CreationDate="2017-07-03T16:54:25.090" Score="0" Body="&lt;p&gt;It depends on your beliefs about the nature of stock returns. Whether or not those beliefs reflect reality is a different matter. I think it's helpful to consider what is being modeled in GARCH by breaking down the term:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;G&lt;/strong&gt;eneralized - i.e., can take a number of parameters in order to fit generic data types.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;A&lt;/strong&gt;utoregressive - i.e., terms tend to revert to their means, a-la a Ornstein-Uhlenbeck process (also, Brownian Motion under friction).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;C&lt;/strong&gt;onditional - i.e., future terms are dependent on past terms and/or best estimates of future terms are based on Bayesian inference; reflects stylized beliefs on absolute return/variance clustering. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;H&lt;/strong&gt;eteroskedasticity - i.e., literally, &quot;differing variance&quot;; parameters change over time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While it is technically possible to use GARCH to model the conditional expectations of stock returns, GARCH models were not intended to model returns.&#xA;Implicit in the name is its intent as skedasticity (i.e., volatility) metric in which terms are squared residuals of periodic returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Relaxing the squared error condition, however, results in a particular form of &lt;a href=&quot;https://en.wikipedia.org/wiki/Autoregressive%E2%80%93moving-average_model&quot; rel=&quot;nofollow noreferrer&quot;&gt;Autoregressive Moving Averages&lt;/a&gt; (ARMA). ARMAs are a more generic class of econometric model which allow for negative terms and which can conform to many &lt;a href=&quot;https://quant.stackexchange.com/questions/34597/have-any-new-stylized-facts-of-asset-returns-been-discovered-since-2001&quot;&gt;stylized facts&lt;/a&gt; of security returns. &lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2017-07-05T19:43:31.497" LastActivityDate="2017-07-05T19:43:31.497" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34969" PostTypeId="1" AcceptedAnswerId="35238" CreationDate="2017-07-03T17:04:49.417" Score="0" ViewCount="271" Body="&lt;p&gt;I have been using the Carr-Madan method to price caplets using the FFT. I have followed every step closely and (i believe) successfully. I understand the procedure theoretically but I cannot interpret the complex nature of my results. Is the modulus my answer? Or is it the real part? Am I doing something wrong to have a complex number as my result?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://wwwf.imperial.ac.uk/~ajacquie/IC_Num_Methods/IC_Num_Methods_Docs/Literature/CarrMadan.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://wwwf.imperial.ac.uk/~ajacquie/IC_Num_Methods/IC_Num_Methods_Docs/Literature/CarrMadan.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="28658" LastEditorUserId="28658" LastEditDate="2017-07-23T15:14:05.697" LastActivityDate="2017-07-23T15:16:53.950" Title="Understanding FFT's complex number result on option pricing" Tags="&lt;options&gt;&lt;characteristic-function&gt;&lt;fourier-transform&gt;" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="34970" PostTypeId="2" ParentId="34966" CreationDate="2017-07-03T17:21:32.897" Score="3" Body="&lt;p&gt;One: Your VaR CI relies on normal approximation and might be (very) bad depending on the number of samples and the target function (P&amp;amp;L). Often it is better to use the exact approach based on the empirical distribution (see here: &lt;a href=&quot;https://stats.stackexchange.com/a/284970/8298&quot;&gt;https://stats.stackexchange.com/a/284970/8298&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Two: To estimate CVaR confidence intervals you may use bootstrap confidence intervals (see &lt;a href=&quot;https://en.wikipedia.org/wiki/Bootstrapping_(statistics)#Deriving_confidence_intervals_from_the_bootstrap_distribution&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;). The advantage of bootstrap is that it is simple to understand and implement and works for all kinds of cash-flows. This comes with a single disadvantage, it is computationally intensive.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In essence you calculate repeated independent estimates of your CVaR. This produces an empirical distribution of estimates, from which you can calculate standard deviation, confidence intervals and all kinds of statistics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Be aware the &quot;standard&quot; CVaR estimator (average of everything beyond the quantile) is biased. I found the bias small/irrelevant in practice but then again that might depend. You can correct this bias with bootstrap as well (nicely explained &lt;a href=&quot;https://www.semanticscholar.org/paper/Quantifying-and-correcting-the-bias-in-estimated-r-Kim-Hardy/33c8eded5cc15fc7e3abebefc7f4e0fd1f9bf02e&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="482" LastEditorUserId="482" LastEditDate="2017-07-04T06:41:12.380" LastActivityDate="2017-07-04T06:41:12.380" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34971" PostTypeId="1" CreationDate="2017-07-03T18:31:39.923" Score="1" ViewCount="2014" Body="&lt;p&gt;Let’s say a trader sells a Short Call with strike 100 (for making profit with the premium) at-the-money (for highest extrinsic value there). For hedging until expiration, he buys the underlying share at price 100. If the price goes up, ideally and theoretically, the profit from the share is equal to the loss from the Short Call.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;He adjusts his position of the share according to Delta. So in the first place, he buys a position of 0.5 at 100. This means, practically, that immediately above the strike, his shares make less profit than they should for hedging the full options position. However they will compensate by making already some profit below the strike.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yet this will be true only, if the price starts collecting the profit right from Delta=0 up to Delta=1. If he buys position 0.5 at the strike, and then the price only wanders around above the strike price, even though he is going to increase his position to Delta 1 eventually, the share will never earn the full profit it needs to fully compensate the short call loss (losses from the many small ups and downs not even considered yet).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would others see it the same way? And what to conclude from that?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;He could ignore Delta and always hedge with full&#xA;position size (he is small enough and the market big enough for&#xA;that). But if the price moves around the strike for long, and he has&#xA;to fully go long above and fully flat below, his earned premium will&#xA;be gone soon. &lt;/li&gt;&#xA;&lt;li&gt;Or he just has to bear this cost; it’s covered by the premium&#xA;anyway. And most likely the price will go a bit underneath the strike&#xA;anyway, and collect at least a bit of profit there. &lt;/li&gt;&#xA;&lt;li&gt;Or he would need to sell a Call not ATM but OTM, so he can start&#xA;his hedge from where Delta is near 0. But doesn’t sound good&#xA;either, as lower extrinsic value there.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/9OCgH.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/9OCgH.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="24559" LastActivityDate="2017-07-03T18:31:39.923" Title="Short Call Hedge. Options and gamma trading" Tags="&lt;options&gt;&lt;delta-hedging&gt;&lt;gamma&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34976" PostTypeId="2" ParentId="34106" CreationDate="2017-07-04T07:22:48.590" Score="2" Body="&lt;p&gt;Yes, it is possible in general to allocate portfolio VaR to single positions in a portfolio. This is based on a general result on homogeneous risk measures called the Euler allocation. This allocation provides the marginal change in your risk measure when the size of one position changes (for an infinitesimally) small amount. For VaR this gradient can be expressed as follows: Let $L=\sum L_i$ denote your portfolio's P&amp;amp;L then the marginal increase of VaR in direction $L_i$ will be &#xA;$$ \frac{d \text{VaR}(L + h L_i)}{dh} = E[L_i | L=VaR].$$ This equality is non-trivial for more details see the papers by Tasche, start &lt;a href=&quot;https://arxiv.org/abs/0708.2542&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;No assumptions (except mild technical ones) on the distribution of $L$ or the $L_i$ are necessary to derive this result. But if you make normal (&quot;parametric&quot;) assumptions for your P&amp;amp;L the conditional expectation on the RHS can be readily calculated and leads to the well known formulas for parametric Component VaR. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case of historical or Monte Carlo estimates, i.e. estimates based on samples, the conditional expectation poses a challenge since $L=VaR$ will generally be a set of measure zero. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the Monte Carlo case this can be solved by broadening the condition or interpolation (i.e. you condition on $VaR-\epsilon&amp;lt;L&amp;lt;VaR + \epsilon$ and interpolate between quantiles). Another possibility is to use kernel estimates to estimate the conditional probability. Again the paper cited above provides more details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Theoretically the same applies for historical observations, but of course the data/sample situation is even worse. Unless you have plenty of observations at the relevant quantiles this is probably fruitless.&lt;/p&gt;&#xA;" OwnerUserId="482" LastEditorUserId="482" LastEditDate="2017-07-04T11:42:22.933" LastActivityDate="2017-07-04T11:42:22.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34978" PostTypeId="1" CreationDate="2017-07-04T14:26:03.203" Score="1" ViewCount="705" Body="&lt;p&gt;I am calibrating the Hull-White model which involves finding the level of mean-reversion from the market instantaneous forward rate? Is the market instantaneous forward rate directly available from Bloomberg? Thank you.&lt;/p&gt;&#xA;" OwnerUserId="28670" LastActivityDate="2017-07-04T17:38:18.407" Title="Instantaneous Forward Rate from Bloomberg" Tags="&lt;bloomberg&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34980" PostTypeId="2" ParentId="34915" CreationDate="2017-07-04T15:06:44.250" Score="2" Body="&lt;p&gt;The problem you are proposing has a non-convex feasible set, so you can't formulate it in a DCP-conforming way. To see this, consider a 2-element benchmark portfolio [1, 1]. You are optimizing over portfolios [x, y] such that |x-1| + |y-1| &gt;= 1.6. Note that [2, 0] and [0, 2] are both feasible portfolios, but the convex combination 0.5[2, 0] + 0.5[0, 2] = [1, 1] is not feasible. Thus, your feasible set is non-convex.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you note, if you instead constrained portfolios to be sufficiently similar to the benchmark portfolio instead of sufficiently dissimilar, then the problem is convex and it is easy to formulate this in a DCP-conforming way using the exact constraints you listed in your question.&lt;/p&gt;&#xA;" OwnerUserId="28672" LastActivityDate="2017-07-04T15:06:44.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34982" PostTypeId="2" ParentId="34978" CreationDate="2017-07-04T17:38:18.407" Score="2" Body="&lt;p&gt;&quot;Instantaneous forward rate&quot; is a theoretical construct. Two different models produce vastly different forwards; in fact, two different researchers using the same model may produce different forwards. So short answer is no, this is not available from Bloomberg.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming you're trying to get mean-reversion params for the physical measure, you can just use a short-term interest rate (e.g., short-term bill rates) as a proxy. Assuming you're calibrating in the risk neutral measure, then use quoted instruments (bonds or swaps, depending on what curve you're fitting).&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2017-07-04T17:38:18.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34983" PostTypeId="2" ParentId="2512" CreationDate="2017-07-04T18:44:14.537" Score="0" Body="&lt;p&gt;I saw this the other day In Glassermans: Monte Carlo methods in Financial Engineering. Lets say you already discretized your process and you want to simulate random steps. The method he is proposing is simulating 2 variables: a normal one lets call it Z and a central $\chi^2$ one with one less degree of freedom than your original variable (which is a non central $\chi^2$). He later claims that if $\lambda$ is the mean of the non central variable then:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\chi^{2'}_n(\lambda)=(Z+\sqrt{\lambda})^2+\chi^2_{n-1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where the accented one is the non central with n degrees etc. He argues this is a efficient method however he proposes others as well. I suppose if he has it there it must be an efficient and low variance method. Hope it helps&lt;/p&gt;&#xA;" OwnerUserId="28658" LastActivityDate="2017-07-04T18:44:14.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34984" PostTypeId="1" CreationDate="2017-07-04T21:11:14.013" Score="1" ViewCount="223" Body="&lt;p&gt;I have reading a paper from Oliver Grandville on long term expected return. I am trying to reconcile what I am reading in that paper vs what I see under &quot;Application to Stock Market&quot; in Kelly criterion page on Wikipedia. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cfapubs.org/doi/abs/10.2469/faj.v54.n6.2227&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.cfapubs.org/doi/abs/10.2469/faj.v54.n6.2227&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Kelly_criterion&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Kelly_criterion&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In his paper, he define the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$R_{t-1,t} = \frac{S_t-S_{t-1}}{S_{t-1}}$ as the yearly rate of return compounded once per year&lt;/li&gt;&#xA;&lt;li&gt;$X_{t-1,t} = 1 + R_{t-1,t} = \frac{S_t}{S_{t-1}}$ as the yearly dollar return&lt;/li&gt;&#xA;&lt;li&gt;$log \left( X_{t-1,t} \right) = log \left(\frac{S_t}{S_{t-1}}\right)$ as the yearly continuously compounded rate of return&lt;/li&gt;&#xA;&lt;li&gt;$E(X_{t-1,t}) = E(1+R_{t-1,t})$ as the expected value of the yearly dollar return and $V(X_{t-1,t})$ as its variance&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;He derives that given $log \left( X_{t-1,t} \right) = log \left(\frac{S_t}{S_{t-1}}\right) = \mu + \sigma N(0,1)$ (ie log returns follow normal distribution of mean $\mu$ and variance $\sigma^2)$, we must have that $E(X_{t-1,t}) = exp \left( \mu + \frac{\sigma^2}{2}\right) $. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;For the wiki article vs this article, the wiki one says expected log return is $R_s = \left( \mu - \frac{\sigma^2}{2}\right)t$. This seems similar to the Grandville article in that if you take $log(E(X_{t-1,t})) = \mu + \frac{\sigma^2}{2}$, but its not exactly the same. Is the because the assumption the wiki article makes is different (ie the stock price moves like Brownian motion?)&lt;/li&gt;&#xA;&lt;li&gt;In the derivation of the max of the expected value in wiki page. Shouldnt it be $G(f) = fE(stock) + (1-f)E(bond)=f*(\mu - \frac{\sigma^2}{2}) + (1-f)*r$, but the vol term is different ($f^2$ vs $f$). Why is that?&lt;/li&gt;&#xA;&lt;li&gt;Finally, the last line of the wiki article mentions that &quot;Remember that $ \mu $ is different from the asset log return $R_s$. Confusing this is a common mistake made by websites and articles talking about the Kelly Criterion.&quot; My understanding is that $\mu$ is the expected of the log returns $E(log(X_{t-1,t}))$ whereas $R_s$ is the log of the expected returns $log(E(X_{t-1,t}))$ and that this distinction is important because $E(log(X))$ and $log(E(X))$ are not always equal. Is this understanding correct?  &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="17136" LastEditorUserId="17136" LastEditDate="2017-07-06T00:17:04.777" LastActivityDate="2017-07-09T22:54:16.687" Title="Questions on continuously compounded return vs long term expected return" Tags="&lt;quant-trading-strategies&gt;&lt;returns&gt;&lt;brownian-motion&gt;&lt;expected-return&gt;&lt;kelly-criterion&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34985" PostTypeId="2" ParentId="34919" CreationDate="2017-07-04T21:35:13.063" Score="2" Body="&lt;p&gt;Take a look as well at &lt;a href=&quot;https://tickstory.com/product/tickstory-lite/&quot; rel=&quot;nofollow noreferrer&quot;&gt;TickStory Lite&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;IIRC, you should be able to pull tick level FX transactions back to 2003 for free. I used this several months ago, so not sure if anything has changed.&lt;/p&gt;&#xA;" OwnerUserId="28675" LastActivityDate="2017-07-04T21:35:13.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34986" PostTypeId="1" AcceptedAnswerId="34996" CreationDate="2017-07-05T06:17:21.097" Score="2" ViewCount="981" Body="&lt;p&gt;I am thinking of building some custom stock screening tool.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For this I need fundamental data (parts of balance sheet, earnings statements, cash flow statement if available, probably some minimal stock market quotes, ...) for lots of companies in several countries, not just the US. Real-time data is not needed, it can be significantly delayed if that makes it easier or cheaper.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are my options for this?&#xA;Where can I find this data?&#xA;Would it be more efficient to collect this data from various websites and starting to build a database using someone from upwork, or to buy this data service somewhere at a reasonable price?&lt;/p&gt;&#xA;" OwnerUserId="2394" LastActivityDate="2017-08-04T14:34:31.683" Title="Getting international fundamental stock market data" Tags="&lt;market-data&gt;&lt;historical-data&gt;&lt;fundamentals&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34987" PostTypeId="1" AcceptedAnswerId="35001" CreationDate="2017-07-05T08:25:39.200" Score="0" ViewCount="224" Body="&lt;p&gt;I'm preparing for thesis defense and I've got simple question connected with Value at Risk backtesting. Portfolio VaR was calculated using historical simulation approach (250 days and 500days) and backtested with Kupiec test. In those portfolios where VaR was not properly estimated, there was always high frequency of exceedances so the Value at Risk was underestimated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why there was so many exceedances? The statistical important information was included in tails of distribution, because of lack of these tails the VaR was not properly estimated?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What should be done to improve the precision of estimation?&lt;/p&gt;&#xA;" OwnerUserId="28325" LastActivityDate="2017-07-05T22:13:46.893" Title="VaR Backtesting. High frequency of exceedances" Tags="&lt;backtesting&gt;&lt;portfolio&gt;&lt;var&gt;&lt;value-at-risk&gt;" AnswerCount="1" CommentCount="25" ContentLicense="CC BY-SA 3.0" />
  <row Id="34988" PostTypeId="2" ParentId="22125" CreationDate="2017-07-05T08:29:06.040" Score="0" Body="&lt;p&gt;Here are a few things you can do:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;There are software vendors where quite a few hedge funds submit their positions on a monthly basis so you can run daily risk assessments assuming that the portfolio stays the same (might be a wrong assumption though pending on the turnover of the underlying HF)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Regarding the return-based analysis, I have been recently having a look at the kalman filter instead of the regression. There is also the dynamic style analysis based on FLS.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Try to find statistical relationships between the returns and measure the 'true exposure' of your portfolio.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="22383" LastActivityDate="2017-07-05T08:29:06.040" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34990" PostTypeId="1" CreationDate="2017-07-05T09:44:14.470" Score="1" ViewCount="68" Body="&lt;p&gt;My question concerns a topic in quantitative finance that I feel is often brushed under the table: is a given strategy self-financing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have two assets, one risky and one riskless, defined by the following SDEs:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;dS(t)&amp;amp;=\mu S(t)dt + \sigma S(t)dW(t)\\&#xA;S(0)&amp;amp;=S_0\\&#xA;dB(t)&amp;amp;=rB(t)dt\\&#xA;B(0)&amp;amp;=B_0&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $\mu, \sigma, S_0, B_0&amp;gt;0$ constants, and $W(t)$ a Wiener-process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's assume we have $V_0&amp;gt;0$ wealth we wish to invest in a portfolio of these assets. Our strategy is a special strategy: we wish to hold the ratio of the risky and the riskless asset constant at all times. Our strategy $\{\Delta(t), \beta(t)\}$ is thus defined as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;V(t)&amp;amp;=\Delta(t)S(t)+\beta(t)B(t)\\&#xA;V(0)&amp;amp;=V_0\\&#xA;\frac{\Delta(t)S(t)}{V(t)}=x,&amp;amp;\quad\quad\frac{\beta(t)B(t)}{V(t)}=1-x&#xA;\end{align*}&#xA;with $x\in\mathbb{R}$ fixed. I know the self-financing condition is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dV(t)=\Delta(t)dS(t)+\beta(t)dB(t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;During my studies I have checked the self-financing condition for the Black-Scholes-Merton formula for example, which did take a lot of calculations. What I feel the difference here might be is that in the BSM-formula the portfolio weights are given explicitly, whereas here they are given implicitly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I check for the validity (self-financing) of this strategy? Intuitively I of course understand that I should be able to rebalance my portfolio in a way that the weights of the assets are constant, but I want to be able to show this in a rigorous way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The closest I have come to an answer to this question is in P. Wilmott's &lt;em&gt;Quantitative Finance&lt;/em&gt; (2nd Edition), Chapter 66: asset allocation in continuous time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the book Wilmott shows that the value process of such a portfolio is going to become:&#xA;$$&#xA;dV(t) = \left(x(\mu-r)+r\right)V(t)dt+x\sigma V(t)dW(t)&#xA;$$&#xA;which I of course understand intuitively, but he hasn't convinced me that this strategy is valid in the sense that it's self-financing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did apply Ito's lemma to the portfolio, and I arrived at:&#xA;$$&#xA;dV(t)=\Delta(t)dS(t)+\beta(t)dB(t)+S(t)d\Delta(t)+B(t)d\beta(t)+d\langle\Delta,S\rangle(t)+d\langle\beta,B\rangle(t)&#xA;$$&#xA;for which the sum of the last four terms should equal zero. I know that the last term $d\langle\beta,B\rangle(t)$ does equal zero because $B(t)$ is of bounded variation. But I'm having difficulty moving forward, since the strategy itself is defined implicitly, so I feel like I'm moving in circles.&lt;/p&gt;&#xA;" OwnerUserId="28681" LastEditorUserId="16160" LastEditDate="2017-07-05T11:32:27.547" LastActivityDate="2017-07-05T11:32:27.547" Title="Is the 'constant weight in the risky asset' portfolio-strategy self-financing?" Tags="&lt;stochastic-calculus&gt;&lt;asset-allocation&gt;&lt;continuous-time&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="34991" PostTypeId="2" ParentId="34858" CreationDate="2017-07-05T10:13:27.973" Score="4" Body="&lt;p&gt;I think I've found the answer to my question (I'm waiting for confirmation from you in the comments)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The intuitive difference in this negative sign correlation depends on the position taken on options in the portfolio:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Gamma is always positive when you buy an option (Theta acts negatively when buying options);&lt;/li&gt;&#xA;&lt;li&gt;Gamma is always negative when selling an option (Theta acts positively in case of sale).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="28469" LastActivityDate="2017-07-05T10:13:27.973" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="34994" PostTypeId="1" CreationDate="2017-07-05T12:04:53.497" Score="2" ViewCount="1033" Body="&lt;p&gt;Long volatility delta hedging and strangle are common long volatility strategies. We can make strangle delta neutral(in $) by buying more puts than calls(if an absolute value of put delta is less than call) and vice versa. Delta hedging is rather complicated and implies dynamic rehedging. So why delta hedging is so popular in volatility trading if we can simply use strangle?&lt;/p&gt;&#xA;" OwnerUserId="24771" LastActivityDate="2017-07-05T12:04:53.497" Title="Delta hedging vs Strangle" Tags="&lt;options&gt;&lt;option-strategies&gt;&lt;delta-hedging&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="34995" PostTypeId="1" CreationDate="2017-07-05T12:37:49.940" Score="-2" ViewCount="678" Body="&lt;p&gt;I am trying to evaluate an interest rate swap starting before the valuation date with an amortizing schedule(in Python).&#xA;I am using your (i.e. Quantilb) codes but i can't figure out how to solve my problem.&#xA;I am following this example &lt;a href=&quot;http://gouthamanbalaraman.com/blog/interest-rate-swap-quantlib-python.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://gouthamanbalaraman.com/blog/interest-rate-swap-quantlib-python.html&lt;/a&gt;.&#xA;The first problem is that i have nominal amount decreasing with ammortization schedule.&#xA;The second,&#xA;I have an evaluation date following the first reference date. So I have the first coupon of the floating rate leg already defined and I need to discount its crashflow in the swap&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;from QuantLib import *&#xA;&#xA;import matplotlib.pyplot as plt&#xA;import numpy &#xA;from cookielib import MONTHS&#xA;&#xA;today = Date(1,1,2017)&#xA;Settings.instance().evaluationDate = today&#xA;&#xA;from matplotlib.ticker import FuncFormatter&#xA;from utils import *&#xA;&#xA;def format_rate(r):&#xA;    return '{0:.4f}'.format(r.rate()*100.00)&#xA;&#xA;&#xA;def plot_curves(*curves):&#xA;    fig, ax = plt.subplots()&#xA;    ax.set_xticks([0,5,10,15,20,25,30,35,40,45,50,55,60,65,100])&#xA;&#xA;    times = numpy.linspace(0, 61, 4000)&#xA;    for curve, style in curves:&#xA;        rates = [ curve.zeroRate(t, Continuous).rate() for t in times ]&#xA;        plt.plot(times, rates, style)&#xA;        #print zip(times, rates)&#xA;&#xA;    #print curve.zeroRate(1, Continuous).rate()    &#xA;    plt.show()&#xA;&#xA;def plot_curve(curve):&#xA;    plot_curves((curve,'-'))&#xA;&#xA;&#xA;&#xA;&#xA;quotes = [SimpleQuote(-0.00373), SimpleQuote(-0.00329), SimpleQuote(-0.00271)]&#xA;helpers = [SwapRateHelper(QuoteHandle(quotes[0]),Period(1, Months), TARGET(),Months, Preceding,  Actual360(),Euribor1M())]&#xA;helpers.append(SwapRateHelper(QuoteHandle(quotes[1]),Period(3, Months), TARGET(),Months, Preceding,  Actual360(),Euribor3M()))&#xA;helpers.append(SwapRateHelper(QuoteHandle(quotes[2]),Period(6, Months), TARGET(),Months, Preceding,  Actual360(),Euribor6M()))&#xA;&#xA;&#xA;for rate, tenor in [(-0.00252, 1), (-0.00187, 2), (-0.00096, 3), (0.0001, 4), (0.00127, 5), (0.00247, 6), (0.00369, 7), (0.00505, 8), (0.00623, 9), (0.00732, 10), (0.00917, 12), (0.01116, 15), (0.01286, 20), (0.01349, 25), (0.01373, 30), (0.01378, 40), (0.01331, 50), (0.013, 61)]:&#xA;    quotes.append(SimpleQuote(rate))&#xA;    helpers.append(SwapRateHelper(QuoteHandle(quotes[-1]),Period(tenor, Years), TARGET(),Annual, Preceding,  Actual360(),Euribor1Y()))&#xA;&#xA;&#xA;rate_curve = PiecewiseLinearZero(0, TARGET(), helpers, Actual360())&#xA;print 'reference'&#xA;print rate_curve.referenceDate()&#xA;&#xA;print '-------rate_curve.dates---------------'&#xA;&#xA;for i, d in enumerate(rate_curve.dates()):&#xA;    print i+1, d, d.weekday()&#xA;&#xA;&#xA;curve_handle = RelinkableYieldTermStructureHandle(rate_curve)&#xA;&#xA;fixed_schedule = Schedule(Date(22, 6, 2017), Date(22, 6, 2020),Period(6, Months), TARGET(), Preceding, Preceding, DateGeneration.Forward, False)&#xA;floating_schedule = Schedule(Date(22, 6, 2017), Date(22, 6, 2020),Period(6, Months), TARGET(), Preceding, Preceding, DateGeneration.Forward, False)&#xA;&#xA;&#xA;print '----------fixed_schedule----------------'&#xA;&#xA;for i, d in enumerate(fixed_schedule):&#xA;    print i+1, d&#xA;&#xA;print '----------floating_schedule-------------' &#xA;&#xA;for i, d in enumerate(floating_schedule):&#xA;    print i+1, d&#xA;&#xA;index = Euribor1Y(curve_handle)&#xA;&#xA;discountTermStructure = RelinkableYieldTermStructureHandle()&#xA;&#xA;&#xA;swap = VanillaSwap(VanillaSwap.Receiver,1000000, fixed_schedule, 0.2, Actual360(), floating_schedule, index, 0.185, Actual360())&#xA;&#xA;swap_engine = DiscountingSwapEngine(curve_handle)&#xA;swap.setPricingEngine(swap_engine)&#xA;&#xA;print '-----leg 0 ----------------------'&#xA;&#xA;&#xA;for i, cf in enumerate(swap.leg(0)):&#xA;    print &quot;%2d    %-18s  %10.4f&quot;%(i+1, cf.date(), cf.amount())&#xA;&#xA;print '-----leg 1 ----------------------'&#xA;&#xA;for i, cf in enumerate(swap.leg(1)):&#xA;    print &quot;%2d    %-18s  %10.4f&quot;%(i+1, cf.date(), cf.amount())&#xA;&#xA;swap.setPricingEngine(DiscountingSwapEngine(curve_handle))&#xA;P0 = swap.NPV()&#xA;&#xA;print '----floatingLegNPV-----'&#xA;print swap.floatingLegNPV()&#xA;print '----fixedLegNPV-----'&#xA;print swap.fixedLegNPV()&#xA;print '----NPV-----'&#xA;print P0&#xA;&#xA;plot_curve(rate_curve)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Best regards&#xA;Matteo&lt;/p&gt;&#xA;" OwnerUserId="28686" LastEditorUserId="28686" LastEditDate="2017-07-05T13:46:38.323" LastActivityDate="2017-07-28T14:59:51.133" Title="Quantlib: Interest rate swap starting before valuation date" Tags="&lt;interest-rate-swap&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34996" PostTypeId="2" ParentId="34986" CreationDate="2017-07-05T13:40:06.407" Score="4" Body="&lt;p&gt;Quandl has two premium fundamental datasets that may be of interest to you, &lt;a href=&quot;https://www.quandl.com/data/RB1-Robur-Global-Select-Stock-Fundamentals/documentation/introduction&quot; rel=&quot;nofollow noreferrer&quot;&gt;Robur Global Select Stock Fundamentals&lt;/a&gt; and &lt;a href=&quot;https://www.quandl.com/databases/MF1/documentation/introduction&quot; rel=&quot;nofollow noreferrer&quot;&gt;Mergent Global Fundamentals Data&lt;/a&gt;. Quandl also has &lt;a href=&quot;https://www.quandl.com/search?query=fundamental&quot; rel=&quot;nofollow noreferrer&quot;&gt;fundamental datasets&lt;/a&gt; for specific countries including the US, China, and India.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have an Interactive Brokers account and can program against their API, you can sign up for &lt;a href=&quot;https://interactivebrokers.github.io/tws-api/reuters_fundamentals.html#report_type&amp;amp;gsc.tab=0&quot; rel=&quot;nofollow noreferrer&quot;&gt;Reuters Worldwide Fundamentals&lt;/a&gt; and build your own database. This dataset has good global coverage and is very cheap (only a few dollars per month for non-professionals), but it will be significantly more development work to build your own database using IB's API, as opposed to purchasing a ready-made database from Quandl.&lt;/p&gt;&#xA;" OwnerUserId="27966" LastActivityDate="2017-07-05T13:40:06.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="34997" PostTypeId="1" CreationDate="2017-07-05T13:57:04.123" Score="1" ViewCount="1883" Body="&lt;p&gt;Is NZD/USD the only currency pair with a different value date &lt;strong&gt;roll-over time&lt;/strong&gt;? Where do you see this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only information I found so far is from&#xA;&lt;a href=&quot;http://www.londonfx.co.uk/valdates.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.londonfx.co.uk/valdates.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="28688" LastActivityDate="2018-10-12T15:00:40.997" Title="Fx Currency Pairs Roll over dates" Tags="&lt;fx&gt;&lt;date&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35001" PostTypeId="2" ParentId="34987" CreationDate="2017-07-05T21:56:13.700" Score="0" Body="&lt;p&gt;I assume that the problem can be boiled down into: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;blockquote&gt;&#xA;    &lt;blockquote&gt;&#xA;      &lt;p&gt;SAMPLE SIZE &lt;/p&gt;&#xA;    &lt;/blockquote&gt;&#xA;  &lt;/blockquote&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If I am right, this problem should be less where you are using 500 daily returns in you VaR calculation instead of 250. Then the reason is that the statistical parameters become fuzzier and fuzzier with fewer samples. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A simple way to make it better is to make it grow i.e. make it remember. Allow it to grow never to shrink, then it remembers volatile times.&lt;/p&gt;&#xA;" OwnerUserId="7584" LastEditorUserId="7584" LastEditDate="2017-07-05T22:13:46.893" LastActivityDate="2017-07-05T22:13:46.893" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="35002" PostTypeId="2" ParentId="34997" CreationDate="2017-07-05T22:03:59.220" Score="0" Body="&lt;p&gt;I think that article you listed is fairly old.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The standard practice is to calculate the &lt;code&gt;value date roll-over&lt;/code&gt; at 5:00pm NY time even for NZD/USD or other non G10 pairs. I can't find a source for holidays, however I think that is exchange/ECN/IB/liquidity provider dependent with most trading 24/5 regardless of holidays.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&#xA;If the settlement currency is not USD, it may be different. AUD based accounts would have a 3:00pm Sydney time value date. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.citibank.com.au/Global_docs/pdf/MCG15054-MCA-and-FX-PDS.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.citibank.com.au/Global_docs/pdf/MCG15054-MCA-and-FX-PDS.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;See:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cmegroup.com/trading/fx/g10/new-zealand-dollar_contract_specifications.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.cmegroup.com/trading/fx/g10/new-zealand-dollar_contract_specifications.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="1764" LastEditDate="2017-07-05T22:19:16.270" LastActivityDate="2017-07-05T22:19:16.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35004" PostTypeId="1" AcceptedAnswerId="35009" CreationDate="2017-07-06T01:15:01.223" Score="-4" ViewCount="338" Body="&lt;p&gt;I want to use American stock index, such as S&amp;amp;P 500 index(open, close...) to predict japan stock daily close price or other with machine learning. I found that there is timezone between japan and New York timezone, there are about 13 hours difference, I mean Wednesday, 5 July 2017, 19:12:00 in Tokyo time, the New York time is: Wednesday, 5 July 2017, 06:12:00. I mean if I want to use the S&amp;amp;P 500 index which is American index to predict japan stock daily close price, I think I can't use the same day(date) data of s&amp;amp;p 500 and japan stock data to predict the next day close price since there are time difference between Japan and USA. For example, if want to predict 7/6 Japan stock close price, I can use the 7/5 japan stock price data for features, and I can't use the 7/5 S&amp;amp;P 500 index data for features, I should use the 7/4 S&amp;amp;P 500 index data for predicting 7/6 stock price. I want to ask:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1). Should I use the yesterday or today data of S&amp;amp;P 500 data to predict tomorrow japan stock price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2). How to processing the missing value of S&amp;amp;P 500 data which some date(I mean the same date of japan stock price) is missed. How about Friday S&amp;amp;P 500 index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="28083" LastActivityDate="2017-07-06T09:09:51.190" Title="python: How use the S&amp;P 500 index to predict japan stock,namely timezone issue" Tags="&lt;equities&gt;&lt;machine-learning&gt;&lt;financial-engineering&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35005" PostTypeId="2" ParentId="34919" CreationDate="2017-07-06T04:10:18.043" Score="7" Body="&lt;p&gt;Dukascopy offers historical tick data.  Through their &lt;a href=&quot;https://www.dukascopy.com/swiss/english/marketwatch/historical/&quot; rel=&quot;noreferrer&quot; title=&quot;website&quot;&gt;historical data website&lt;/a&gt; you can download what you want, but registration is required, and lots of manual clicking.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However if you are comfortable with scripting, you can directly download the tick data yourself.  The URL pattern is &lt;code&gt;http://www.dukascopy.com/datafeed/{currency}/{year}/{month}/{day}/{hour}h_ticks.bi5&lt;/code&gt;, so for example &lt;code&gt;http://www.dukascopy.com/datafeed/AUDCAD/2017/00/01/23h_ticks.bi5&lt;/code&gt; gets you ticks for AUDCAD from 1 January 2017, 23:00-23:59:59.999 UTC.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the months are zero-based (I don't know why), so Jan-Dec is 00-11 (two digits).  Every hour is present as a file, even if the market is closed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The file format is an LZMA-compressed binary packed file, so you will need to decompress it to CSV or other format according to your need.  Each tick is 20 bytes, five four-byte fields:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;(long) the relative time from the hour, in milliseconds&lt;/li&gt;&#xA;&lt;li&gt;(long) the ask price, in points&lt;/li&gt;&#xA;&lt;li&gt;(long) the bid price, in points&lt;/li&gt;&#xA;&lt;li&gt;(float) the ask volume&lt;/li&gt;&#xA;&lt;li&gt;(float) the bid volume&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In python, I use a &lt;code&gt;struct.unpack('&amp;gt;LLLff', bytes)&lt;/code&gt; to extract the fields.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The data format is very space efficient for transfer and storage, but not efficient for processing, so I convert it to a time series for my storage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I based my code on &lt;a href=&quot;https://eareview.net/tick-data/dukascopy-php-scripts&quot; rel=&quot;noreferrer&quot;&gt;this guide&lt;/a&gt;, and there's plenty of GitHub repositories to help.&lt;/p&gt;&#xA;" OwnerUserId="13482" LastActivityDate="2017-07-06T04:10:18.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35006" PostTypeId="1" CreationDate="2017-07-06T04:48:45.493" Score="6" ViewCount="324" Body="&lt;p&gt;I think the question has already been asked about &lt;em&gt;stylized facts&lt;/em&gt; of &lt;a href=&quot;https://quant.stackexchange.com/questions/34597/have-any-new-stylized-facts-of-asset-returns-been-discovered-since-2001&quot;&gt;asset &lt;strong&gt;&lt;em&gt;returns&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;; this question regards the essential characteristics and normative assumptions used to evaluate asset &lt;strong&gt;&lt;em&gt;prices&lt;/em&gt;&lt;/strong&gt;. I.e., given that the economic value of a generic asset is its discounted expected utility, what are some assumptions by which an economic stakeholder may assess a claim's worth?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To start, here are a few:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Price is an expressed belief of value. &lt;/li&gt;&#xA;&lt;li&gt;The efficient market hypothesis (EMH): the market acts as a price discovery mechanism in which market prices reflect participants' capital-weighted expectation. It should be difficult to prove that the market price is not &quot;correct&quot;. &quot;Price is what you pay -- value is what you get&quot; applies only in cases where the market is not efficient.&lt;/li&gt;&#xA;&lt;li&gt;The fundamental theorem of asset pricing (FTAP) which posits (i) a risk-neutral measure equal to a probabilistic measure which can only be rigorously demonstrated given (ii) complete markets.&lt;/li&gt;&#xA;&lt;li&gt;FTAP's correlary to EMH: in an efficient market place, any price which reflects a $\mathbb P$ (i.e., &quot;acturial&quot; and/or &quot;real-world&quot;) expectation that does not have a different $\mathbb Q$ (&quot;risk-neutral&quot;) measure can be considered an efficient price. I.e., any &quot;no-arbitrage&quot; price is permitted under EMH.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;em&gt;Asset prices cannot be negative (or can they???).&lt;/em&gt;&lt;/strong&gt; Since maximum loss is (typically) constrained to principal invested, asset prices cannot theoretically be negative -- but, in practice, investors may assign them negative values (vis-a-vis, the &quot;drag&quot; on value whereby the inclusion of an asset causes a portfolio to be valued less than it if were dis-included).&lt;/li&gt;&#xA;&lt;li&gt;Corollary of requirement that prices be supported over the domain $\left[0, \infty \right]$: price paid determines both expected return as well as maximum loss (à la Seth Klarman's synthesis regarding Warren Buffet-esque &quot;Margin of Safety&quot;).&lt;/li&gt;&#xA;&lt;li&gt;The fair price of any generic asset is equal to the &lt;strong&gt;&lt;em&gt;expected&lt;/em&gt;&lt;/strong&gt; net present value of the discounted cash flows that it is &lt;strong&gt;&lt;em&gt;expected&lt;/em&gt;&lt;/strong&gt; to generate.&lt;/li&gt;&#xA;&lt;li&gt;Time value of money (TVM): &lt;strong&gt;Time is money&lt;/strong&gt;. Time has monetary value which can be expressed as a utility function. Utility is usually interchangeably expressed as a discount factor or an interest rate which represents an expected and/or required rate of return based on an investor's intertemporal preferences regarding consumption and risk. Rational utility should always be a monotonically decreasing utility function with respect to time -- i.e.,&quot;a dollar today is always worth more than a dollar at any time in the future&quot;. Therefore, discount rates cannot be negative (or can they???). Also, a discounting function need not be an exponential/geometric (i.e., normative) function, continuous, symmetrical, or time-invariant.&lt;/li&gt;&#xA;&lt;li&gt;Modigliani-Miller's postulates on (i) the value of a firm and (ii) the irrelevance of capital structure inform the intuition that -- under a broad range of regulatory frameworks -- capital structuring decisions are not a major factor in determining an asset's enterprise value. &lt;/li&gt;&#xA;&lt;li&gt;Corollary to MM II: it is simpler to price the firm's underlying assets in totality (and then allocate value to claims in order of seniority) vice value each class of claim individually, vis-a-vis &quot;in order to value a company's stock, one must first value the company itself&quot; (&lt;strong&gt;&lt;em&gt;attribution needed&lt;/em&gt;&lt;/strong&gt;).&lt;/li&gt;&#xA;&lt;li&gt;Arbitrage Theory of Pricing's (APT) statement that asset prices are reflexively a transformed function of returns.&lt;/li&gt;&#xA;&lt;li&gt;The Capital Asset Pricing Model's (CAPM) application of APT which states that asset prices are a function of diversifiable and non-systemic risk under a mean-variance framework.&lt;/li&gt;&#xA;&lt;li&gt;Equity is analogous to a long call option on a firm's value; debt is analogous to short put option on a firm's value. A position which is long equity and long debt is a synthetic long position on the firm's underlying assets.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Good responses should add depth to and/or expand upon those characteristics already identified. I also would appreciate any relevant references including compendia and/or primers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I appreciate your thoughts and references.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2017-08-11T21:04:23.390" LastActivityDate="2017-08-11T21:04:23.390" Title="What are the essential characteristics of asset prices?" Tags="&lt;returns&gt;&lt;arbitrage&gt;&lt;asset-pricing&gt;&lt;actuarial-science&gt;" AnswerCount="0" CommentCount="6" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35008" PostTypeId="1" AcceptedAnswerId="35020" CreationDate="2017-07-06T09:07:59.327" Score="5" ViewCount="1130" Body="&lt;p&gt;Is the existence of anomalies to the EMH sufficient to disprove the EMH, or do we need a persistent anomaly which the financial markets cannot correct to disprove the EMH?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This question is for the weak, semi-strong, and strong versions of EMH.&lt;/p&gt;&#xA;" OwnerUserId="9499" LastActivityDate="2017-07-08T23:15:33.097" Title="Does the existence of anomalies disprove the efficient markets hypotheses?" Tags="&lt;emh&gt;&lt;market-efficiency&gt;" AnswerCount="4" CommentCount="4" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="35009" PostTypeId="2" ParentId="35004" CreationDate="2017-07-06T09:09:51.190" Score="1" Body="&lt;p&gt;To forecast something you can use any variable that is known before the result you are trying to forecast.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example the Wednesday close of S&amp;amp;P and the Wednesday close of Nikkei can be used to predict the Thursday Open and/or Thursday Close of Nikkei. When S&amp;amp;P closes on Wednesday it is about 5 am Thursday in Japan so the Thursday business activity in Japan has not begun (or finished) yet. So a prediction would be meaningful, it would be looking forward in time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general you can use today closing index value of S&amp;amp;P 500 to predict tomorrow Japan stock price. &lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-07-06T09:09:51.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35010" PostTypeId="1" CreationDate="2017-07-06T10:09:58.593" Score="2" ViewCount="155" Body="&lt;p&gt;For my finance textbook, I would like to recommend data sources that students can afford.  Obviously, Compustat is not affordable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any low-cost or free data bases that offer basic historical financial statements on US (and maybe non-US) companies in panel format?  I am thinking of just about 10-20 key items for at least 20 years for all US corps: Assets, Current Assets, Liabilities, Current Liabilities, Long-Term Debt, Working Capital, Revenues, Gross Profit, Operating Income, Interest Expense, Income Tax Expense, Net Income, CF Operations, CF Investing, and CF Financing.  Plus a ticker, a period date, and a release date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Presumably, this could even be scraped from Edgar, but I would rather not have to do this myself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pointers appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;/iaw&lt;/p&gt;&#xA;" OwnerUserId="28699" LastActivityDate="2018-12-29T00:02:51.937" Title="Low-Cost Historical Corporate Financials Data?" Tags="&lt;finance&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35011" PostTypeId="1" AcceptedAnswerId="35209" CreationDate="2017-07-06T10:35:31.497" Score="16" ViewCount="596" Body="&lt;p&gt;The general idea of efficiency in financial markets is that information is being processed almost instantaneously because active investors arbitrage away any arising price discrepancies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, more and more money is being allocated to passive investment vehicles (mainly ETFs) because of the empirical fact that active managers are not worth their fees and/or you cannot discern upfront those who will be worth their fees.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This obviously constitutes a paradox because if fewer and fewer active investors arbitrage away price discrepancies the case for passive investing begins to crumble...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did a little googling and found lots of &quot;opinions&quot; on this, so the idea of this paradox as such is not new. What I did &lt;em&gt;not&lt;/em&gt; find are any serious academic papers on the issue or some kind of consensus.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question&lt;/strong&gt;&lt;br&gt;&#xA;To the best of your knowledge, is there some consensus on this matter and/or could you point me to good academic papers which thoroughly investigate this paradox (theoretically, by simulation or empirically)?&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="28193" LastEditDate="2017-07-21T18:46:26.963" LastActivityDate="2017-07-21T18:46:56.127" Title="Does the rise in passive investing make the markets less efficient?" Tags="&lt;reference-request&gt;&lt;etf&gt;&lt;market-efficiency&gt;&lt;active-investing&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="35012" PostTypeId="2" ParentId="34997" CreationDate="2017-07-06T12:05:55.993" Score="0" Body="&lt;p&gt;For a price quotation you can make any value date you like. What I mean by that is if the market's open and there's someone there to make a price then that's when the value date rolls. For example, at 7am Wellington time when the NZD market opens that's when the first prices for the new day's value date will be made and thus the NZD value date rolls from then on. I guess the same thing happens for all local markets and sovereign currencies.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastEditorUserId="16148" LastEditDate="2017-07-06T13:38:57.687" LastActivityDate="2017-07-06T13:38:57.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35013" PostTypeId="1" CreationDate="2017-07-06T13:16:23.203" Score="0" ViewCount="526" Body="&lt;p&gt;In the classic Vasicek model, the market's short rate process $(r_t)_{t \geq 0 }$ is given through the SDEs:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dr_t=\alpha \left( \bar{\mu} - r_t\right) dt+\sigma d W^{\mathbb{P}}(t), $$&#xA;$$ dr_t=\alpha \left( \mu - r_t\right) dt+\sigma d W^{\mathbb{Q}}(t), $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W^{\mathbb{P}}$ is a Wiener process under the objective, real-world probability measure $\mathbb{P}$, and $W^{\mathbb{Q}}$ is a Wiener process under the risk-neutral measure $\mathbb{Q}$ (measure equivalent to $\mathbb{P}$). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A standard result of this set-up is that the time $t$ price of a T-maturity zero-coupon bond is equal to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P(t,T)=A(t,T)e^{-r(t)B(t,T)},$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $A(t,T)$ and $B(t,T)$ are deterministic functions of the risk-neutral parameters $\alpha, \mu$ and $\sigma$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say that the current time is $t=0$ and we want to plot one trajectory of $P(t,T)$, i.e. $t \mapsto P(t,T)$ for $t \in \left[0,T\right]$. Thus, we want to calculate $P(\Delta_k , T)$, where $\Delta_k  =k \times T/n$, and $k=0, 1, \dots, n$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have that&#xA;$$ P( \Delta_k , T)= A(\Delta_k ,T)e^{-r( \Delta_k )B(\Delta_k ,T)}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: Should we simulate $r(\Delta_k )$ under the risk-neutral or under the real-world measure. That is, should we simulate it as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r( \Delta_k ) \sim r(\Delta_{k-1} )+\alpha (\bar{\mu}-r(\Delta_{k-1} ))\Delta_1  + \sigma \Delta_1 \mathcal{N}(0,1), $$&#xA;or as&#xA;$$r( \Delta_k ) \sim r(\Delta_{k-1} )+\alpha (\mu-r(\Delta_{k-1} ))\Delta_1  + \sigma \Delta_1 \mathcal{N}(0,1). $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From my understanding, we should do it under the real-world measure, but I have some resources that go on talking about the trajectory of $P(t,T)$ without even touching the real-world dynamics of the short-rate, so I don't quite understand if I am right, what are they even getting when they only use the risk-neutral measure to simulate the short-rate.&lt;/p&gt;&#xA;" OwnerUserId="23864" LastEditorUserId="23864" LastEditDate="2017-07-06T15:02:07.857" LastActivityDate="2017-07-06T15:02:07.857" Title="Vasicek Model - Should I simulate short-rate under the real-world or risk-neutral measure if I am interested in simulating future bond prices" Tags="&lt;short-rate&gt;&lt;vasicek&gt;" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="35014" PostTypeId="1" CreationDate="2017-07-06T13:40:37.183" Score="2" ViewCount="649" Body="&lt;p&gt;I am a novice when it comes to algorithmic trading with strong interest in the subject matter. As I am looking around for online courses, I can only find one course called &lt;a href=&quot;https://www.experfy.com/training/courses/algorithmic-trading-strategies&quot; rel=&quot;nofollow noreferrer&quot;&gt;Algorithmic Trading Strategies&lt;/a&gt;. The reviews look decent but it is hard to say if the course is for beginners like me or for someone who is more advanced. Any recommendations on how to get started?&lt;/p&gt;&#xA;" OwnerUserId="28696" LastActivityDate="2017-07-06T19:16:50.890" Title="Algorithmic Trading" Tags="&lt;quant-trading-strategies&gt;&lt;algorithmic-trading&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ClosedDate="2017-07-07T08:05:08.913" ContentLicense="CC BY-SA 3.0" />
  <row Id="35015" PostTypeId="1" AcceptedAnswerId="35038" CreationDate="2017-07-06T14:22:16.713" Score="0" ViewCount="132" Body="&lt;p&gt;So what I am trying to do is to model the volatility for different currencies by fitting a GARCH(p, q) model. I am selecting the values of (p, q) by iteratively going through p &amp;amp; q such that max(p, q) = 5. After going through the 24 different combinations of p &amp;amp; q (excluding where p = q = 0), I select the model which has the lowest Akaike Information Criterion. I am doing all this in R using the rugarch package. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the &quot;best&quot; model selected for some currencies, I observed that the t-value is extremely low. I have observed t-value of omega in a GARCH(1, 1) model as low as 0.09. My question is that can I still use the model if the GARCH parameters are statistically insignificant? Or am I mistaken and the usual &quot;statistical significance of model parameters&quot; which I learned for linear regression doesn't apply for GARCH type models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am a newbie to this field but I do not mind trying to learn from the start so any pointers would be greatly appreciated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance. &lt;/p&gt;&#xA;" OwnerUserId="28700" LastActivityDate="2017-08-06T09:43:47.540" Title="I am trying to fit an GARCH(p,q) model to FX volatility. Should I be interested in the t-value of GARCH parameters?" Tags="&lt;volatility&gt;&lt;garch&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35016" PostTypeId="1" CreationDate="2017-07-06T14:35:36.443" Score="0" ViewCount="1366" Body="&lt;p&gt;I asked this question before, but in the wrong community (sorry):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to explain stock returns in a regression model. Besides regressing against my main explanatory variables, I want to control for at least the most common risk factors. In a paper (reference below), the authors state that they &quot;[...] control for the firm’s factor loadings based on the Fama-French three-factor model [...]&quot; (p. 13).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This sounds as if they include the factor loadings as explanatory variables in their regression. To me, this does not make sense and I guess, I interprete this wrong. I would be very thankful, if somebody could help me to clarify this. How exactly do they control for the firm's factor loadings? Do they include the factor returns, rather than the factor loadings, as explanatory variables?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much in advance!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: This is the paper I am talking about:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lins, Karl V., Henri Servaes, and Ane Tamayo. &quot;Social capital, trust, and firm performance: The value of corporate social responsibility during the financial crisis.&quot; The Journal of Finance (2017).&lt;/p&gt;&#xA;" OwnerUserId="28706" LastActivityDate="2020-04-24T13:17:33.020" Title="How do I control for a firm's “factor loadings” based on the Fama French model in a regression model?" Tags="&lt;regression&gt;&lt;factor-models&gt;&lt;fama-french&gt;&lt;factor-loading&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35018" PostTypeId="2" ParentId="35008" CreationDate="2017-07-06T16:49:43.983" Score="2" Body="&lt;p&gt;I have a paper that argues that the distribution of returns cannot have a mean.  I argue that prices are data and that returns are not data.  Rather, returns are transformations of data.  Therefore, it is the statistical distribution of prices that must determine the distribution of returns.  Since returns are $$\frac{p_{t+1}}{p_t}-1,$$ it follows that returns are a ratio distribution.  In the simplest case, the Markowitz case, with many buyers and sellers and infinite liquidity, it can be shown through the central limit theorem that prices would be normally distributed.  Depending slightly on how you construct the process, this implies that the distribution will have no mean or variance.  Because negative prices don't exist, the distribution of returns for going concerns must be:  $$\left[\frac{\pi}{2}+\tan^{-1}\left(\frac{\mu}{\gamma}\right)\right]^{-1}\frac{\gamma}{\gamma^2+(r-\mu)^2},$$ if you accept the Markowitzian assumption.  This also assumes the distribution is conditioned on the equilibrium prices so that: $$\mu=\frac{p^*_{t+1}}{p_t^*}.$$  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you do not exist in a Markowitzian world, then the distribution will vary, but it will have the Cauchy distribution buried in it.  You can see this by transforming the process into polar coordinates.  In doing so, you will find that the limits of integration of the angles that the cumulative density of the Cauchy distribution must be present, regardless of any assumptions you may otherwise make.  You will end up with some type of integral similar to: $$\int_{-\frac{\pi}{2}}^{\tan^{-1}(r)}.$$  It will depend a little bit on how you orient your problem.  Nonetheless, the arctangent will be present because the arctangent is opposite over adjacent and if the current price is the length of the adjacent and the future price is the length of the opposite side, then you can see the linkage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have also replaced the rules of mathematics in other papers to accommodate this.  The efficient market hypothesis is invalid because it depends upon a mathematics that cannot be correct.  This does not mean that markets are inefficient, though, it just means we have been discussing what efficiency means the wrong way.  Having looked at the data in quite some depth, I would argue that prices, conditioned upon dividends, are quite efficient, but in a sense much weaker than any version of the efficient market hypothesis.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This weakening comes from the nature of the allowable cost functions and the rules of regression.  The implied cost function for the distribution to find $\mu$ is the &quot;all-or-nothing&quot; cost function.  It is $$C(\hat{\mu},\mu)=\begin{matrix}c_1&amp;amp;\hat{\mu}&amp;lt;\mu\\0&amp;amp;\hat{\mu}=\mu\\ c_2&amp;amp;\hat{\mu}&amp;gt;\mu\end{matrix},c_1,c_2&amp;gt;0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A gamble in this form means that any mistake is a bad mistake, though it may be the case that a mistake to the left is a different cost than a mistake to the right.  Overvaluing $\mu$ causes you to buy too much at too high a price while undervaluing $\mu$ causes you to buy too little and you suffer an opportunity loss of profits.  A stronger gamble can be placed by regressing price over dividends.  That leads to the absolute linear loss function, still weaker than an expectation, but about fifty percent of the time you should make too much money and about fifty percent of the time you should make too little.  Since it is linear, the median loss should be zero, though the mean loss could be any value in the real number line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The anomalies are being created by the difference in the math.  People are measuring behavior under an assumption of some form of normality or lognormality and seeing behavior under distributions without a mean, variance or covariance.  There are tons of persisting anomalies.  Until people quit using the tools of mean-variance finance, the ideas behind the EMH will persist.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;People are receiving compensation based upon the EMH.  For example, the Uniform Prudent Investor Act presumes the validity of the EMH and declares alternative behavior imprudent and hence tortious unless you can document why you behaved in a manner different from how the hypothesis would recommend.  Everyone knows it is not empirically supported.  Indeed, it has been a bonanza under &quot;publish or perish,&quot; because you don't have to discover anything to discover something because you can always find a new way to finagle a prediction into an anomaly.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So many careers implicitly depend upon the EMH that while paying lip service to it being empirically incorrect, people are not stupid.  They don't want lawsuits.  I found 3800 articles on just one anomaly in an EconLit search.  Empirical disproof has existed since 1963 with Mandelbrot's article &quot;On the Variation of Certain Speculative Prices.&quot;  Four hundred and eighty-two trillion dollars in options are priced on the EMH or a variant according to the Bank of International Settlements.  That is a lot of money to say &quot;oops&quot; on.  The EMH will persist until something forces a sea change.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are interested in math that will work.  Buy a copy of Parmigiani's book called &quot;Decision Theory.&quot;  Its ISBN-10: 047149657X is a way to search for it.  If you have no background at all in Bayesian methods, you should first pick up &quot;Introduction to Bayesian Statistics,&quot; by William Bolstad.  It is ISBN-10: 1118091566.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&#xA;Just a note, this probably should have been asked and answered under the Economics forum instead and should probably be migrated to there.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastEditorUserId="25459" LastEditDate="2017-07-06T17:00:18.540" LastActivityDate="2017-07-06T17:00:18.540" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="35019" PostTypeId="1" AcceptedAnswerId="35021" CreationDate="2017-07-06T18:06:52.497" Score="12" ViewCount="5769" Body="&lt;p&gt;I have read various blog posts and reddit threads and so on talking about the recent changes to the Yahoo! Finance API and it leaves me very confused. I'm confused about what has changed. Supposedly all prices are adjusted data for both dividends and splits, but the &quot;AdjClose&quot; column &lt;em&gt;isn't&lt;/em&gt;? Or no data is adjusted for dividends (just splits)? Or too much data is mysteriously missing? Or that only the location of the API has changed (breaking links) but the data is the same?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone explain:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;What has changed&lt;/li&gt;&#xA;&lt;li&gt;What exactly about the quality of the data has changed (or that changes appear sporadically without explanation, which would be bad)&lt;/li&gt;&#xA;&lt;li&gt;What about the data described has changed (is it adjusted as it was before, or are dividends no longer adjusted for, putting Yahoo! Finance on part with Google Finance)&lt;/li&gt;&#xA;&lt;li&gt;Whether Yahoo! Finance should be the go-to source for free equities data now, or whether Google Finance/Quandl are now superior&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="28712" LastActivityDate="2019-04-29T21:39:03.040" Title="Is Yahoo! Finance data good or bad now?" Tags="&lt;data&gt;&lt;historical-data&gt;&lt;yahoofinance&gt;&lt;google&gt;&lt;adjusted&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="35020" PostTypeId="2" ParentId="35008" CreationDate="2017-07-06T18:35:27.087" Score="9" Body="&lt;p&gt;If one finds an anomaly relative to some asset pricing model, there are three possibilities:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The anomaly you &quot;found&quot; actually isn't there: you're overfitting the data, found a spurious result.&lt;/li&gt;&#xA;&lt;li&gt;The efficient market hypothesis is wrong.&lt;/li&gt;&#xA;&lt;li&gt;The asset pricing model you're using is wrong.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Any test of market efficiency is a joint test of market efficiency and an asset pricing model. The efficient market hypothesis on its own doesn't generate testable predictions.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Some definitions:&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;The efficient market hypothesis (EMH) of Prof. Eugene Fama is that market prices reflect all available information.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Strong form: prices reflect literally &lt;em&gt;all&lt;/em&gt; information, public or private.&lt;/li&gt;&#xA;&lt;li&gt;Semi-strong form: prices reflect all publicly available information.&lt;/li&gt;&#xA;&lt;li&gt;Weak form: prices reflect all past price movements.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Let's also review some things the EMH on its own does &lt;em&gt;NOT&lt;/em&gt; say:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The EMH does &lt;em&gt;NOT&lt;/em&gt; say that expected returns are constant.&lt;/li&gt;&#xA;&lt;li&gt;The EMH does &lt;em&gt;NOT&lt;/em&gt; say that expected returns are the same for all securities.&lt;/li&gt;&#xA;&lt;li&gt;The EMH does &lt;em&gt;NOT&lt;/em&gt; say that returns are entirely unforecastable.&lt;/li&gt;&#xA;&lt;li&gt;The EMH does &lt;em&gt;NOT&lt;/em&gt; say that stock prices follow geometric Brownian motion etc...&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The efficient market hypothesis, on its own, says &lt;em&gt;FAR&lt;/em&gt; less than a lot of people think.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Testing market efficiency and the joint-hypothesis problem&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Early in the history of academic finance, Fama pointed out that any test of market efficiency is a &lt;em&gt;joint&lt;/em&gt; test of market efficiency and an asset pricing model. To say prices are wrong, you need to say &lt;em&gt;something&lt;/em&gt; about what they should be!&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Example: Joint test of efficient markets and the capital asset pricing model (CAPM)&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;For example, the CAPM asset pricing model is that expected returns are linear in market betas:&#xA;$$ \operatorname{E}[R_{it} - R^f_{t}] = \beta_i \operatorname{E}[R^m_t - R^f_t]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using various proxies for the market portfolio, joint tests of this model and market efficiency are strongly rejected: since the 1980s, average returns actually decline in market beta rather than increase.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You also had the anomalies of size and value. Does the existence of these anomalies relative to the CAPM imply the efficient market hypothesis is violated? No. The CAPM could simply be the wrong asset pricing model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That begs the question, what's an allowable asset pricing model? Could one test market efficiency more directly by making fewer assumptions on the asset pricing model?&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Toward cleaner tests of market efficiency&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;A basic commonality of any risk based asset pricing model is the law of one price: a linear pricing function. If you can show two securities have the same payoffs and trade at different prices, that's hard to reconcile with market efficiency and &lt;em&gt;any&lt;/em&gt; risk based asset pricing model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Along that line, you have Richard Thaler's paper &quot;Can the market add and subtract?&quot; on tech stock carveouts. Thaler argues that in the case of Palm and 3-Com, linearity of the pricing function was violated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More broadly, one can argue against market efficiency and risk based asset pricing models by showing:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Some strategy earns significant expected returns&lt;/li&gt;&#xA;&lt;li&gt;A risk based story doesn't make sense, and that it's far more plausible that positive returns reflect the market not incorporating information.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For example, the abnormal return to earnings surprises is fairly compelling evidence evidence against the strong form efficient market hypothesis. It suggests that the market was not already aware of the earnings info until it was announced.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fama and French have been unwilling to add a momentum factor to their asset pricing models. They're not willing to call it a risk factor. Is momentum an anomaly that falsifies the joint hypothesis of efficient markets and risk based asset pricing models? Perhaps?&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Unexploitable anomalies?&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;A line of research in the broader market efficiency literature is that you can have unexploitable anomalies due to transactions costs and various other frictions. Due to short sale constraints, transaction costs, stale prices, etc... a strategy may not actually earn the returns that a naive backtest says it would have. &lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-07-08T23:15:33.097" LastActivityDate="2017-07-08T23:15:33.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35021" PostTypeId="2" ParentId="35019" CreationDate="2017-07-06T18:53:01.000" Score="12" Body="&lt;blockquote&gt;&#xA;  &lt;ol&gt;&#xA;  &lt;li&gt;What has changed&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The API is gone. The new downloads need 1st to parse the Yahoo Finance page to find a hidden &lt;em&gt;crumb&lt;/em&gt; and use it as the key for data retrieval over a 2nd URL.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The adjusted close is sometimes the adjusted, sometimes is the non-adjusted and sometimes is a different value&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lines with literally &lt;em&gt;&quot;null&quot;&lt;/em&gt; as the value for the prices have been inserted. Apparently this sometimes only affects the &lt;em&gt;volume&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes changes will appear across a single download of data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Splits and dividends are for example apparently no longer applied to some of the values&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ol start=&quot;2&quot;&gt;&#xA;  &lt;li&gt;What exactly about the quality of the data has changed (or that changes appear sporadically without explanation, which would be bad)&#xA;  What about the data described has changed (is it adjusted as it was before, or are dividends no longer adjusted for, putting Yahoo! Finance on part with Google Finance)&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Having a lot of &lt;em&gt;&quot;sometimes&quot;&lt;/em&gt; as seen above is for sure no synonym of quality&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ol start=&quot;3&quot;&gt;&#xA;  &lt;li&gt;What about the data described has changed (is it adjusted as it was before, or are dividends no longer adjusted for, putting Yahoo! Finance on part with Google Finance)&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;See above again&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ol start=&quot;4&quot;&gt;&#xA;  &lt;li&gt;Whether Yahoo! Finance should be the go-to source for free equities data now, or whether Google Finance/Quandl are now superior&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It is obviously no longer usable without a prior analysis from your side. Anything else seems to be a better choice now.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For reference see for example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://community.backtrader.com/topic/432/yahoofinance-data-feeds/&quot; rel=&quot;noreferrer&quot;&gt;https://community.backtrader.com/topic/432/yahoofinance-data-feeds/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://community.backtrader.com/topic/516/yahoofinancedata-gets-displayed-invalid-due-to-changed-adjusted-close/&quot; rel=&quot;noreferrer&quot;&gt;https://community.backtrader.com/topic/516/yahoofinancedata-gets-displayed-invalid-due-to-changed-adjusted-close/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://community.backtrader.com/topic/411/attributeerror-nonetype-object-has-no-attribute-close/&quot; rel=&quot;noreferrer&quot;&gt;https://community.backtrader.com/topic/411/attributeerror-nonetype-object-has-no-attribute-close/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Understanding that Yahoo may have not been happy about people downloading (and possibly redistributing) data for (a) f(r)ee, how Yahoo did it shows what Yahoo is up for: a web page that said that engineers were working on the problem. There was obviously no problem and a page indicating that the service was no longer available would have been the right way to go.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: And some tickers like &lt;code&gt;YHOO&lt;/code&gt; (surprise, surprise) seem to no longer be available (try for example &lt;code&gt;YHOO.MX&lt;/code&gt; for something that works)&lt;/p&gt;&#xA;" OwnerUserId="17554" LastEditorUserId="17554" LastEditDate="2017-07-07T07:15:24.270" LastActivityDate="2017-07-07T07:15:24.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35022" PostTypeId="2" ParentId="35008" CreationDate="2017-07-06T19:02:02.683" Score="0" Body="&lt;p&gt;I agree with most answers posted. But the research on this subject has been highly contradictory, and the answer to your question is highly dependant on the hypothesis you are trying to test. If your hypothesis is looking for 6-sigma events within an &quot;efficient&quot; market, then anomalies are what you need to come by, and will disprove your hypothesis if not found.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, if you are trying to test for arbitrage opportunities on the basis that markets are not as frictionless as they have been theorized to be, then anomalies aren't that normal and should not be that evident in your findings, unless the stock/company/government has underwent a surprising event which has led to that anomaly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you follow the Martingale logic for equity prices, then the price of a stock should be the sum of all past events and should reflect such &quot;known&quot; events. On the flip side, if you are a random walk advocate, you can fairly certainly assume that prices move randomly while following a log normal distribution, which in turn forces your returns to have a normal distribution. Stock predictability in that sense has been very insignificant, but you can run millions of Monte Carlo or Geometric Brownian motions and claim that you have predicted a future price, when in fact that would just be an assumption dependant on the set of inputs you have specified. In that sense, if you believe the prices to be following a random walk, then the price change itself follows a random walk and not prices themselves. This leads to the assumption that in this case, markets are of the weak form in which prices reflect all past information, but this also leads to the fact that todays price is a martingale of all previously known event data points of that asset. Then again, you should also test for autocorrelation within your variables because that may as well be the reason why anomalies are evident. This definitely doesn't work for assets with high storage costs such as commodities, or illiquid asset classes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long story short, your interpretation should be highly dependent on what assumptions you are inputting to begin with. As you fiddle around with your inputs, your outputs might vary highly, so knowing the dataset you are working with would provide you with better insights as to whether the anomalies are true anomalies, or just a result of auto-correlation or multi-collinearity between the variables you are trying to test. &lt;/p&gt;&#xA;" OwnerUserId="28711" LastActivityDate="2017-07-06T19:02:02.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35024" PostTypeId="2" ParentId="35014" CreationDate="2017-07-06T19:16:50.890" Score="1" Body="&lt;p&gt;Look up any book from Ernest Chan. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;such as this one: &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/B00CY5HC0U&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.amazon.com/Algorithmic-Trading-Winning-Strategies-Rationale-ebook/dp/B00CY5HC0U/ref=as_sl_pc_qf_sp_asin_til?tag=quantitativet-20&amp;amp;linkCode=w00&amp;amp;linkId=OKVO7DYTPENVN5Y7&amp;amp;creativeASIN=B00CY5HC0U&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This might not necessarily teach you how to code an algorithm from 0 to 1, but will give you the basic foundation in order to understand how an algorithm is stacked, how its built, what trading signals you are trying to generate and how to actually back-test and interpret the data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also check his blog epchan.blogspot.com. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a wealth of communities as well such as quantopian.com that allow you to fiddle around with existing algorithms, and use their api to backtest and modify. It would be a good starting point, if you just want to go straight into the coding aspect. Some of the posted algorithms come with very detailed comments that can help&lt;/p&gt;&#xA;" OwnerUserId="28711" LastActivityDate="2017-07-06T19:16:50.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35025" PostTypeId="1" CreationDate="2017-07-06T20:16:03.067" Score="4" ViewCount="2235" Body="&lt;p&gt;I'm struggling a little with the interpretation of option adjusted spread on mortgage backed securities.  I can see how, for a corporate bond &lt;em&gt;without&lt;/em&gt; optionality, the z-spread is sort of like a constant hazard rate of default.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is it right to think of OAS as the constant hazard rate of default on a corporate bond &lt;em&gt;with&lt;/em&gt; optionality?&lt;/li&gt;&#xA;&lt;li&gt;Can I think of the z-spread on a corporate bond with optionality as a constant hazard of non-payment due to &lt;em&gt;either default or option exercise&lt;/em&gt;?  (I think this isn't quite right because in event of option exercise the principal is paid).&lt;/li&gt;&#xA;&lt;li&gt;Can I think of (z-spread - OAS) as a constant hazard rate of option exercise?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Underlying these questions is my confusion about what is being accomplished by including OAS in the different interest rate scenarios when modelling the option.  In which states of the world is the option expected to be exercised?  Is it those states when it is optimal to do so according to the scenario's zero-coupon rate?&#xA;  Or is it those states when it is optimal given zero-coupon rate plus OAS?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My next confusion is how OAS deals with the fact that the option isn't exercised exactly when it is optimal.  For corporate bonds there is the issuer's cost of refinancing to consider.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;4&quot;&gt;&#xA;&lt;li&gt;Is this, in fact, exactly why OAS is included in the scenarios for modelling the option -- it is reflecting the refinancing cost that prevents the issuer from refinancing?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;On the other hand for RMBS there are numerous causes of prepayment including time-varying macro factors and behavioral factors.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;5&quot;&gt;&#xA;&lt;li&gt;If the answer to #1 above is affirmative, then (a) does that interpretation also hold for agency RMBS which are guaranteed?  and (b) if so, why isn't OAS just the same as the spread on an agency bond?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If the answer to #4 is affirmative, then by analogy it would seem for agency RMBS the OAS should capture all deviation of realistic mortgage prepayment (due to all causes) from purely optimal refinancing (ignoring house sales etc.)  If that's right then the answer to 5(a) is &quot;no&quot;.  Maybe for a callable corporate bond the OAS represents the credit spread reflected in the price after adjusting for the value of the call option -- the spread the bond would have with the option stripped out.  But for agency RMBS it's clearly not the spread on a hypothetical MBS where prepayment is stripped out because OAS would seem to go up when home owners are for some reason less likely to prepay and go down when for some reason home owners are more likely to prepay.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;6&quot;&gt;&#xA;&lt;li&gt;Is there any intuitive interpretation of OAS on agency RMBS e.g. in terms of hazard rates, or as the spread on some hypothetical instrument?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="28691" LastActivityDate="2018-08-25T03:00:25.207" Title="Interpretation of OAS on MBS" Tags="&lt;option-pricing&gt;&lt;fixed-income&gt;&lt;spread&gt;&lt;mbs&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="35026" PostTypeId="2" ParentId="35016" CreationDate="2017-07-06T20:20:39.597" Score="2" Body="&lt;p&gt;It sounds like something reasonable/standard to do would be.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Sort your companies into five portfolios based upon quintiles of social responsibility.&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Also make a long-short portfolio of the top quintile portfolio minus the bottom quintile portfolio. (This long-short return will be an &lt;a href=&quot;https://quant.stackexchange.com/questions/30602/fama-french-solving-for-alpha/34718#34718&quot;&gt;excess return&lt;/a&gt; so when you run the below regression, you would not subtract the risk free rate.)&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Regress returns on Fama-French factors (and possibly momentum) to control for those risk factors.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For example, to compute Jensen's alpha relative to the Fama-French three factor model you would run the following regression for portfolio $i$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ R_{it} - R^f_t = \alpha_i + \beta_{i,1} \mathit{RMRF}_t + \beta_{i,2} \mathit{SMB}_t + \beta_{i,3} \mathit{HML}_t + \epsilon_{it}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or for five factor model:&#xA;$$ R_{it} - R^f_t = \alpha_i + \beta_{i,1} \mathit{RMRF}_t + \beta_{i,2} \mathit{SMB}_t + \beta_{i,3} \mathit{HML}_t + \beta_{i,4}\mathit{CMA}_t + \beta_{i,5} \mathit{RMW}_t + \epsilon_{it}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The $\alpha_i$, &lt;a href=&quot;https://en.wikipedia.org/wiki/Jensen%27s_alpha&quot; rel=&quot;nofollow noreferrer&quot;&gt;Jensen's alpha&lt;/a&gt;, is the average return above and beyond what would be expected based upon covariance with the various risk factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Factor returns etc... are on &lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Ken French's website&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You're forming portfolios based upon some signal and checking against some asset pricing model by estimating Jensen's alpha. Some call this forming calendar time portfolio sand it naturally corrects standard-errors for cross-sectional correlation in returns. Calculate &lt;a href=&quot;https://en.wikipedia.org/wiki/Heteroscedasticity-consistent_standard_errors&quot; rel=&quot;nofollow noreferrer&quot;&gt;heteroscedasticity consistent&lt;/a&gt; standard errors.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Computing abnormal returns&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The basic idea of abnormal returns is that they are returns minus some expectation of what returns should be given an asset pricing model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathit{AR}_{it} = R_{it} - \operatorname{E}[R_{it} \mid \mathcal{F}]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, under the Fama-French three factor model, the abnormal return would be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathit{AR}_{it} = R_{it} - R^f_t - \left( \beta_1 \mathit{RMRF}_t + \beta_2 \mathit{SMB}_t + \beta_3 \mathit{HML}_t \right) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the betas are computed using a time-series regression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you regress abnormal returns on stuff, you should cluster standard errors by time because of cross-sectional correlation.&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-07-06T20:37:21.533" LastActivityDate="2017-07-06T20:37:21.533" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35027" PostTypeId="1" CreationDate="2017-07-06T21:25:39.800" Score="1" ViewCount="217" Body="&lt;p&gt;When I try to find, for example 3 months T-bill rate, how that rate is calculated?&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;getSymbols(Symbols = &quot;DGS3MO&quot;, src = &quot;FRED&quot;, auto.assign = FALSE) -&gt; t3&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;tail(t3)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;      DGS3MO&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;  &#xA;  &lt;p&gt;2017-06-28   1.02&#xA;  2017-06-29   1.04&#xA;  2017-06-30   1.03&#xA;  2017-07-03   1.06&#xA;  2017-07-04     NA&#xA;  2017-07-05   1.05&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;How these yields are calculated? Is it bank discount yield, because that's how yield of T-bills is calculated by convention If I'm not wrong, or is it recalculated bond equivalent yield?&lt;/p&gt;&#xA;" OwnerUserId="28713" LastActivityDate="2018-02-02T09:43:07.220" Title="What yield on T-bills is presented in obtained data from quantmod?" Tags="&lt;bond&gt;&lt;yield&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35029" PostTypeId="2" ParentId="35027" CreationDate="2017-07-06T21:42:41.317" Score="1" Body="&lt;p&gt;The answer is buried in your question. If you look at the underlying data from &lt;a href=&quot;https://fred.stlouisfed.org/series/DGS3MO?cid=47&quot; rel=&quot;nofollow noreferrer&quot;&gt;FRED&lt;/a&gt; you'll see their method. &lt;/p&gt;&#xA;" OwnerUserId="28675" LastEditorUserId="924" LastEditDate="2017-07-07T07:23:15.657" LastActivityDate="2017-07-07T07:23:15.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35030" PostTypeId="2" ParentId="35027" CreationDate="2017-07-06T21:55:18.843" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;Annualized using a 360-day year or bank interest.&lt;/li&gt;&#xA;&lt;li&gt;On a discount basis&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So it's on the bank discount yield. I have a problem understanding why the yield is changing daily? My answer is: since it is trading constantly on the secondary market, supply and demand determines price of the bill every day, so applying bank discount yield on that new prices we get new yields every day? &lt;/p&gt;&#xA;" OwnerUserId="28714" LastActivityDate="2017-07-06T21:55:18.843" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35031" PostTypeId="2" ParentId="34538" CreationDate="2017-07-06T22:12:07.893" Score="1" Body="&lt;p&gt;You think you make a mistake where you actually don´t make one.&#xA;The exercise is just like it is. Resulting in  $$r_{6m}&amp;gt;r_{12m}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The difference in your both answers, based on the same rounding, lays in the different basis for the logarithm.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_{6m} = - 2 \log_e \left( \frac{99.8-102.5 e^{-r_{1y}} }{2.5} \right) = \textbf{6.118%}$$&#xA;$$r_{6m} = - 2 \log_{10} \left( \frac{99.8-102.5 e^{-r_{1y}} }{2.5} \right) = \textbf{2.6571%}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Calculation for the last interest rate base on $r_{6m}=0.06118%$ and $r_{12m}=0.05129%$ yields:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_{18m}=-\frac{log_e\left(\frac{102.7-4\times(e^{0.5\times(-0.06118)}+e^{-0.05129})}{104}\right)}{1.5}=0.06019886318=\textbf{6.0199%}$$&lt;/p&gt;&#xA;" OwnerUserId="20676" LastActivityDate="2017-07-06T22:12:07.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35032" PostTypeId="1" AcceptedAnswerId="35037" CreationDate="2017-07-06T23:58:13.040" Score="3" ViewCount="399" Body="&lt;p&gt;&lt;strong&gt;Background:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am preparing for interviews and I was told to try and answer as many problems in the Mark Joshi book as possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Suppose an asset takes values from a discrete set $v_j$ and the probabilities of $v_j$ is $p_j$.&#xA;  Write an algorithm that produces the random variable for this asset from a uniformly distributed random variable&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I am not sure if I understand the question posed here. Any suggestions or clarification is greatly appreciated. &lt;/p&gt;&#xA;" OwnerUserId="19002" LastActivityDate="2017-08-25T13:07:54.710" Title="Mark Joshi Quantitative finance numerical techiniques, writting an algorithm that produces a random variable" Tags="&lt;programming&gt;&lt;finance-mathematics&gt;&lt;quantitative&gt;" AnswerCount="4" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35034" PostTypeId="2" ParentId="35032" CreationDate="2017-07-07T04:59:22.753" Score="3" Body="&lt;p&gt;I am sure you have seen the $n=2$ case: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Write a program that returns &quot;Yes&quot; with probability p and &quot;No&quot; otherwise. You are given a function runif(), which returns a random number between 0 and 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;r = runif(); if $r&amp;lt;p$ then return &quot;YES&quot;; else return &quot;NO&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;From this well known example you have to generalize to more than 2 possible outcomes. Imagine that you have to simulate a lottery spinning wheel with unequal sectors. of width $p_1,p_2,\cdots$ with $r$ representing the distance (fraction of a circle) by which the wheel turned.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After you draw a uniform random number r=runif(), you check its value. If $r&amp;lt;p_1$ you return $v_1$, else if $r&amp;lt;p1+p2$ you return $v_2$ else if $r&amp;lt;p_1+p_2+p_3$ you return $v_3$,... The general case, for arbitrary $n$, is just a simple loop testing if $r$ is in the right range and returning the corresponding value for that sector. (Do you think you can write the code?).&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-07-07T09:22:19.300" LastActivityDate="2017-07-07T09:22:19.300" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35036" PostTypeId="2" ParentId="35032" CreationDate="2017-07-07T08:55:33.077" Score="1" Body="&lt;p&gt;The question is asking you to produce an algorithm to generate random numbers with a given probability distribution, having been provided with uniformly distributed random numbers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;essentially, you need to provide some function, $f(\phi(\ldots)): \tilde{X}\sim U(0,1) \to \tilde{Y} \sim \phi(\ldots)$ . That is, a function of a pdf, that will convert uniformly distributed random numbers to random numbers distributed according to the pdf provided.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several ways to do it described on &lt;a href=&quot;https://en.wikipedia.org/wiki/Pseudo-random_number_sampling#Continuous_distributions&quot; rel=&quot;nofollow noreferrer&quot;&gt;wikipedia&lt;/a&gt;, in the case of this specific question, the one you want is &lt;a href=&quot;https://en.wikipedia.org/wiki/Inverse_transform_sampling&quot; rel=&quot;nofollow noreferrer&quot;&gt;inverse transform sampling&lt;/a&gt;. You just need to integrate the pdf to get a cdf to use. You can then create an interpolating spline for it, on some grid, and then swap x and y to invert it.&lt;/p&gt;&#xA;" OwnerUserId="19663" LastActivityDate="2017-07-07T08:55:33.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35037" PostTypeId="2" ParentId="35032" CreationDate="2017-07-07T09:13:32.307" Score="5" Body="&lt;p&gt;Yes. Mark Joshi's book is a good preparation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For this question you are given some function &lt;em&gt;random()&lt;/em&gt; yielding a uniform random number and what we want is a function &lt;em&gt;next()&lt;/em&gt; which yields realizations of a random $X$ variable with values $v_j$ such that $P(X=v_j)=p_j$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From standard textbooks we know the following transformation: If $u_i$ are uniform random numbers and $g$ the inverse of a cumulative distribution function $F$ then $g(u_i)$ are realizations of a random variable with c.d.f $F$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In our case the best way is to store the values in a vector $v[]$ so we have just to handle the random index $Y$ with $P(Y=j)=p_j$. The c.d.f is given by&#xA;$$&#xA;  F[k] = P(Y\le k) = \sum_{j \le k} p_j&#xA;$$&#xA;and can be stored in another array, Now the inverse is easy to implement:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;int g(double x)&#xA;{&#xA;    for (int k = 0; k &amp;lt; F.Length; k++)&#xA;    {&#xA;        if (x &amp;lt;= F[k])&#xA;        return k;&#xA;    }&#xA;    return F.Length - 1; // you're not getting here&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;double next()&#xA;{&#xA;    return v[g[random()]];&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Done. The transform can as well be used to generate normal, exponential... random numbers.&lt;/p&gt;&#xA;" OwnerUserId="28719" LastEditorUserId="11645" LastEditDate="2017-07-07T09:31:06.013" LastActivityDate="2017-07-07T09:31:06.013" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35038" PostTypeId="2" ParentId="35015" CreationDate="2017-07-07T09:20:05.620" Score="1" Body="&lt;p&gt;The post became kind of lengthy, so if you're only interested in what you should do, just skip to the summary in the end. However, I think most of the confusion about these tests in general stems from a lack of knowledge about what one is actually doing, when applying the test.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, let's take a look at &lt;em&gt;what&lt;/em&gt; we are testing. As you said, you want to see, whether the GARCH parameters are &quot;significant&quot;, according to the test, in order to choose a lag order.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Generally&lt;/strong&gt;, for a parameter estimate $\hat\beta$, we want to test the null hypothesis $\mathcal{H}_0:\hat\beta=\beta_0$ against the alternative $\hat\beta\ne\beta_0$. As we want to see, whether our parameters are &quot;significantly different from zero&quot;, we apply the test with $\beta_0=0$. Then, the &lt;strong&gt;t-statistic&lt;/strong&gt; is given by&#xA;    \begin{align}\label{52}&#xA;	t_{\hat\beta}=\frac{\hat\beta-\beta_0}{\sigma_{\hat\beta}}=\frac{\hat\beta}{\sigma_{\hat\beta}},&#xA;	\end{align}&#xA;    where $\sigma_{\hat\beta}$ denotes the standard error of our estimate $\hat\beta$, i.e. the standard deviation of its sampling distribution.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, one of the main assumptions of the test comes into play, namely that the estimator is normally distributed. As you use the &lt;code&gt;rugarch&lt;/code&gt; package, estimation is done by MLE. Thus, one can note that the asymptotic distribution of $\hat\beta$ is $\mathcal{N}(0,\sigma_{\hat\beta}^2)$ under the null hypothesis and some regularity conditions. &#xA;Hence, in this case the t-statistic is asymptotically standard normally distributed. Considering that the standard normal distribution is symmetric, we can approximate the p-value by&#xA;      \begin{align}\label{53}&#xA;	  p=2\cdot(1-\Phi(|t_{\hat\beta}|)),&#xA;	  \end{align}&#xA;    with $\Phi(\cdot)$ denoting the standard normal cumulative distribution function.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Numerically&lt;/strong&gt;, to use this test, we firstly have to compute the standard error $\sigma_{\hat\beta}$. This can be (and usually is) done for every estimated parameter at once, by approximating the covariance matrix $\Sigma$ with the inverse observed information matrix ${\mathcal I}^{-1}$. The latter is given by the negative hessian of the likelihood $-\hat{\mathbf{H}}$, or the hessian of the negative likelihood, evaluated at the maximum likelihood estimate. Altogether, this means&#xA;    \begin{align}\label{54}&#xA;	\Sigma\approx\mathcal{I}^{-1}=(-\hat{\mathbf{H}})^{-1},&#xA;	\end{align}&#xA;    which yields the standard errors for every parameter estimate, by calculating &#xA;    \begin{align}\label{55}&#xA;	\sqrt{\text{diag}\left((-\hat{\mathbf{H}})^{-1}\right)}.&#xA;	\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, let's look into some of the possible issues one might encounter:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The estimator could be non-normally distributed. In your case, as you're using MLE, the asymptotic gaussian distribution could be inaccurate for small sample sizes.&lt;/li&gt;&#xA;&lt;li&gt;The inversion of the hessian may prove to be difficult and require high numerical precision, specifically for highly (in)significant parameters.&lt;/li&gt;&#xA;&lt;li&gt;It should be kept in mind that, inherently, statistical tests don't give you the probability that the null hypothesis is true, but the probability of observing the data, &lt;em&gt;given that the null hypothesis is true&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;In summary&lt;/strong&gt;, what I wanted to say is: The test certainly has its issues and shouldn't be used as the only deciding factor. However, it can provide some insight into the impact that a parameter has on a model's estimates.&lt;br&gt;&#xA;Thus, when deciding the lag order of models, one should always additionally consult other model selection measures, like e.g. information criteria (AIC/BIC). The t-values can be used as pointers, which parameters could be omitted for a potentially better fit.&lt;/p&gt;&#xA;" OwnerUserId="26503" LastEditorUserId="26503" LastEditDate="2017-07-07T09:42:39.033" LastActivityDate="2017-07-07T09:42:39.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35039" PostTypeId="2" ParentId="14708" CreationDate="2017-07-07T09:44:10.120" Score="3" Body="&lt;p&gt;The choice of a model depends on what inputs you have, the complexity allowed (e.g. calculation time restrictions) and what you want to infer from it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The development of the LMM adressed the mathematical difficulty of finding a joint model for all Libor forwards and was a great achievement in the late 90'. But at that time the distribution of the Libors was no longer assumed to be log-normal (the so-called skew and smile appeared).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since then various extensions were discussed: stoch-vol (SABR, Heston,...), jumps, local-vol,...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Swaption traders use SABR a lot but $F_i$ is the swap rate of the specific option (no &lt;em&gt;joint&lt;/em&gt; model is used).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;LMM models were used for the ultra-complex products (path-dependent &lt;em&gt;and&lt;/em&gt; callable) which are not so important any more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, the advantage of the SABR-LMM over the standard LMM is its capability to produce a smile, but things get terribly complicated in terms of calibration and dynamics (forward smile).&lt;/p&gt;&#xA;" OwnerUserId="28719" LastActivityDate="2017-07-07T09:44:10.120" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35040" PostTypeId="2" ParentId="35032" CreationDate="2017-07-07T09:52:06.807" Score="2" Body="&lt;p&gt;The answers above which suggest simulating uniform $U\sim(0,1)$ and returning $J$ such that $\sum_{i=1}^{J-1} p_i \le U &amp;lt; \sum_{i=1}^{J} p_i$ will be fine for the interview.  However, since this isn't just a job interview Q&amp;amp;A site, I'd like to remark that for large sample spaces, or if you make a lot of samples from even a modestly sized sample spaces, this is extremely inefficient. I'd be aghast to see this being used in production code in the 21st century for these cases- &lt;a href=&quot;https://en.wikipedia.org/wiki/Alias_method&quot; rel=&quot;nofollow noreferrer&quot;&gt;Walker alias sampling&lt;/a&gt;, for example, is a much better alternative.&lt;/p&gt;&#xA;" OwnerUserId="19547" LastEditorUserId="16148" LastEditDate="2017-07-07T13:26:44.493" LastActivityDate="2017-07-07T13:26:44.493" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="35041" PostTypeId="2" ParentId="1621" CreationDate="2017-07-07T10:01:21.713" Score="1" Body="&lt;p&gt;Conceptually you are trying to infer information about regions where you don't have data, a classical extrapolation problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For that with different assumptions you will get different answers. E.g. for rates all standard models assign positive probability to every high level but considering the laws on usury you might doubt that rates can grow without bounds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Besides the problem that you just have 5 points of data, the non-parametric approaches (Dupire, Derman-Kani) often lack some basic properties (positive probabilities which sum up to one...), so best practice is to choose a model you trust for further inference and fit it to the given vols.&lt;/p&gt;&#xA;" OwnerUserId="28719" LastActivityDate="2017-07-07T10:01:21.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35042" PostTypeId="1" AcceptedAnswerId="35046" CreationDate="2017-07-07T11:54:06.173" Score="0" ViewCount="128" Body="&lt;p&gt;I am trying to collect data I could use for calibration of a short-rate modeling process, so I need data which represents the historical short-rates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the Bank of England webpage I came across the &lt;a href=&quot;http://www.bankofengland.co.uk/statistics/Pages/yieldcurve/archive.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;historical Government liability curve data&lt;/a&gt;, and also the &lt;a href=&quot;http://www.bankofengland.co.uk/boeapps/iadb/index.asp?Travel=NIxIRx&amp;amp;levels=1&amp;amp;XNotes=Y&amp;amp;A3765XBMX3687X3764.x=7&amp;amp;A3765XBMX3687X3764.y=5&amp;amp;XNotes2=Y&amp;amp;Nodes=X4051X4052X4053X4066X4067X3687X3764&amp;amp;SectionRequired=I&amp;amp;HideNums=-1&amp;amp;ExtraInfo=true#BM&quot; rel=&quot;nofollow noreferrer&quot;&gt;3-months UK treasury bills discount rates&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It turns out they are not the same. For example, on the 31 May 2017 the UK nominal 3-month spot rate was 0.04, and the 3-months UK treasury bill discount rate was 0.0575. Also, in the 3-months UK nominal spot rate table, values of 3-months spots are actually mostly not given.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't understand what is the difference between these two values, and which ones should I use for my historical data?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks for any insights on this.&lt;/p&gt;&#xA;" OwnerUserId="23864" LastEditorUserId="23864" LastEditDate="2017-07-07T22:33:38.400" LastActivityDate="2017-07-07T22:33:38.400" Title="Difference between a 3-months UK nominal spot rate and a 3-months UK treasury bill discount rate?" Tags="&lt;interest-rates&gt;&lt;yield-curve&gt;&lt;bond-yields&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35043" PostTypeId="1" CreationDate="2017-07-07T14:49:49.523" Score="2" ViewCount="2049" Body="&lt;p&gt;Currently I'm working on my Master Thesis in Quant Finance in cooperation with a company. I would like to thank you very much for your time and help in advance!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my thesis I want to price Mark-to-Market &lt;strong&gt;(MtM)&lt;/strong&gt; Basis Cross Currency Swaps &lt;strong&gt;(CCS)&lt;/strong&gt; and subsequently the Constant Notional &lt;strong&gt;(CN)&lt;/strong&gt; version. So far, I'm following the multi curve framework described here&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Fujii, Masaaki; Shimada, Yasufumi; Takahashi, Akihiko (2010): A Note on Construction of Multiple Swap Curves with and without Collateral. In FSA Research Review 6, pp. 139–157.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first question is, whether this is in &lt;strong&gt;general a good approach, i.e. applied by the majority of practitioners?&lt;/strong&gt; Or is there something else out there you have heard about? The goal is to price these products precisely and to follow market practice.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The rest is addressed to people who know the multi curve approach very well, because it is a very detailed question. However, if you would like to know more about this approach don't hesitate to ask me :). So far, I followed this approach and the last ingredient missing is the convexity adjustment mentioned p.14-16. The JPY discounting curve USD collateralized need to be derived via MtM CCS because the CN data is not available (I'm applying this on EURUSD and not JPYUSD). For that purpose I found a paper, which specifies the convexity adjustment analytical, i.e. did the whole derivation for me on p. 29/30 :D&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Moreni, Nicola; Pallavicini, Andrea (2015): FX Modelling in Collateralized Markets: foreign measures, basis curves, and pricing formulae. In SSRN Journal.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To specify the volatility of the diffusion terms, I would like to use market data of FX Options EURUSD and Options on 3M USD Libor. The correlation term I will determine via historical data. &lt;strong&gt;Is that data available?&lt;/strong&gt; I checked Bloomberg and Reuters, and it seems that Options on 3M USD Libor are not available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another goal of the thesis is, to check how much influence the convexity adjustment has and whether it can be neglected. I thought that neglecting the convexity adjustment is actually not a problem, because the derived discounting curve (in my case: EUR discounting collateralized with USD) might be slightly wrong, because it neglects the adjustment. But when pricing other MtM swaps I will ignore again the convexity adjustment, which kind of equalizes the first error. In other words, I calibrate my curve on market data, which I hit in the end; therefore, I will price MtM swaps correctly even though I ignore the convexity adjustment. If this is correct, the only reason for a convexity adjustment is to price CN swaps in the end, because they don't contain such an adjustment and I would use a curve discounting curve containing a bias because of an ignored adjustment. My third question is how banks deal with this problem? &lt;strong&gt;Do they go for a convexity adjustment for pricing subsequently CN CCS?&lt;/strong&gt; Are there other easier ways for estimating it? Or is it possible that they say, ok there is an adjustment, but the influence is so small, that we can hide this adjustment in wider spreads?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Again, thank you very much for your time!&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kind regards,&#xA;Pablo &lt;/p&gt;&#xA;" OwnerUserId="28726" LastActivityDate="2017-10-10T11:50:51.703" Title="Pricing Mark-to-Market Basis Cross Currency Swaps and Subsequently Constant Notional" Tags="&lt;fx&gt;&lt;swaps&gt;&lt;pricing&gt;&lt;quantitative&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35045" PostTypeId="1" CreationDate="2017-07-07T18:44:00.737" Score="1" ViewCount="253" Body="&lt;p&gt;In &lt;a href=&quot;https://quant.stackexchange.com/questions/34488/why-is-the-atm-vol-kind-of-an-average-volatility&quot;&gt;this question&lt;/a&gt;, I got an answer that is much explaining in words what could be explained mathematically. The user who answered referenced the book &quot;The Volatility Surface, by Jim Gatheral's&quot;. &#xA;But this book is too summarized. Could you please indicate another more detailed reference to help me understand the argument given in the answer of &lt;a href=&quot;https://quant.stackexchange.com/questions/34488/why-is-the-atm-vol-kind-of-an-average-volatility&quot;&gt;this question&lt;/a&gt;?&lt;/p&gt;&#xA;" OwnerUserId="25437" LastEditorUserId="25437" LastEditDate="2017-07-07T21:44:48.160" LastActivityDate="2017-07-10T08:29:31.867" Title="Explaining mathematically why to use the ATM vol" Tags="&lt;option-pricing&gt;&lt;volatility&gt;&lt;reference-request&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2017-07-11T18:32:31.097" ContentLicense="CC BY-SA 3.0" />
  <row Id="35046" PostTypeId="2" ParentId="35042" CreationDate="2017-07-07T21:56:38.660" Score="2" Body="&lt;p&gt;The Treasury bill rates are actual yields of short-term Treasury bills. More precisely, these are &quot;average rates of discount at the weekly tender for 91 day bills.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By contrast, the spot rates are calculated from &lt;a href=&quot;http://www.bankofengland.co.uk/statistics/Documents/yieldcurve/yields_background_note.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;theoretical fitted curves&lt;/a&gt;. Notable, the government curves use repo rates at the short end, not bill rates. Additionally, these are continuously compounded rates, not discount yields.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is unlikely that you'll get very different results using either rates. I would opt for repo rates, primarily because the bill mkt in the UK is not particularly liquid.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2017-07-07T22:29:31.597" LastActivityDate="2017-07-07T22:29:31.597" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="35048" PostTypeId="2" ParentId="35008" CreationDate="2017-07-08T00:52:19.827" Score="0" Body="&lt;p&gt;I find the argument binary. As long as there is self interest in human behavior, EMH is a fairy tail. &lt;/p&gt;&#xA;" OwnerUserId="28736" LastActivityDate="2017-07-08T00:52:19.827" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35052" PostTypeId="1" AcceptedAnswerId="35275" CreationDate="2017-07-08T17:44:59.903" Score="2" ViewCount="1988" Body="&lt;p&gt;I have two timestamps, e.g.  2017-04-11 and 2017-07-08, or 2017-04-11 21:00:57 and 2017-07-08 12:41:54 and I am looking for a Python package/function that returns the total &lt;strong&gt;trading&lt;/strong&gt; time between these two timestamps (i.e. excluding the time during which market was closed).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The higher the precision of the timestamps, the better. I am aware that the trading time depends on the financial instrument.&lt;/p&gt;&#xA;" OwnerUserId="2183" LastEditorUserId="467" LastEditDate="2017-07-20T03:43:31.580" LastActivityDate="2017-07-25T09:20:35.850" Title="Is there a python package/function that returns the trading time between two timestamps?" Tags="&lt;python&gt;" AnswerCount="2" CommentCount="9" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35053" PostTypeId="1" CreationDate="2017-07-08T19:20:56.130" Score="9" ViewCount="3775" Body="&lt;p&gt;I am trying to calibrate Vasicek model, i.e. to determine the parameters $\kappa, \mu, \bar{\mu}$ and $\sigma$ where the process dynamics are given through&#xA;$$  dr_t=\kappa\left( \mu - r_t\right) dt+\sigma d W^{\mathbb{P}}(t), $$&#xA;$$ dr_t=\kappa\left( \bar{\mu}- r_t\right) dt+\sigma d W^{\mathbb{Q}}(t), $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W^{\mathbb{P}}$ is a Wiener process under the objective, real-world probability measure $\mathbb{P}$, and $W^{\mathbb{Q}}$ is a Wiener process under the risk-neutral measure $\mathbb{Q}$ (measure equivalent to $\mathbb{P}$).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using historic proxies for short rates (daily rates starting from 01/01/2012), I first tried to work out the real-world calibration, i.e. to determine parameters $\kappa, \mu$ and $\sigma$, for which I used a pretty straight forward ordinary simple regression approach and I ended up with the following values:&#xA;$$ \kappa = 3.1527, \\&#xA;\mu= 0.003, \\&#xA;\sigma= 0.0034.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The image shows actual historic data vs. two simulations of my calibrated Vasicek model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/IH69z.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/IH69z.jpg&quot; alt=&quot;Some simulations vs. actual data&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: do these parameters seem reasonable? I'm mostly concerned with how large $\kappa$ is relative to other parameters. Intuitively, it makes me think that it makes my short rate process more volatile and not in a stochastic way, but the deterministic drift is so large compared to the process mean, that it makes it jump a lot (sorry for my obviously very noob language here). And then, looking at it analytically - volatility of a Vasicek process is known and it is equal to $\text{Std}\left( r_t \right)=\sqrt{\frac{\sigma^2}{2 \kappa} \left[1-e^{-2 \kappa t} \right]}$, and so since my $\kappa$ is so large, my (stochastic) volatility is not that big so it is the huge deterministic drift that's making my process so crazy (or am I completely missing the point here?). Also, if what I am saying is right - how come that then our two simulations in many cases display the situation when $r(t)$ is for example larger than $\mu$ but in the next step it is not pushed down towards $\mu$ with 'big' deterministic drift?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;All in all, I would really appreciate any insights on this - are these parameters just too crazy and should be discarded. If yes - which other calibration method would you suggest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, once I get pass the real-world calibration - what approaches to the risk-neutral one would you suggest as well. I was thinking to simply find $\bar{\mu}$ as&#xA;$$ \text{argmin}\sum_{T \in \{3,5,7,10,15\}} \left| P(T)-\bar{P}(T) \right|^2,$$&#xA;where $P(T)$ is today's observed market price of a $T$-maturity zero coupon bond, and $\bar{P}(T)$ is the model's implied today's price of a $T$-maturity zero (function of $\bar{\mu}$) coupon bond. Do you maybe think I should include more dates and not just today?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyways, apologies for my all over the place question. I am just puzzled with so many question about this thing, and will really appreciate any help, insight, point of view, suggestions on this. Thanks in advance. &lt;/p&gt;&#xA;" OwnerUserId="23864" LastEditorUserId="24222" LastEditDate="2017-07-08T21:04:09.617" LastActivityDate="2020-11-24T06:49:09.393" Title="Vasicek model calibration" Tags="&lt;interest-rates&gt;&lt;calibration&gt;&lt;short-rate&gt;&lt;vasicek&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35054" PostTypeId="1" AcceptedAnswerId="35057" CreationDate="2017-07-08T21:57:43.100" Score="3" ViewCount="284" Body="&lt;p&gt;In &lt;a href=&quot;http://www.emanuelderman.com/writing/entry/more-than-you-ever-wanted-to-know-about-volatility-swaps-the-journal-of-der&quot; rel=&quot;nofollow noreferrer&quot;&gt;More Than You Ever Wanted to Know About Volatility Swaps&lt;/a&gt; the fair value of a future variance swap can be replicated from market prices for calls and puts. The fair put and call strike is shown to be&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$K_{var} = \frac{2}{T}\left( rT - \left(\frac{S_0}{S_*}e^{rT} - 1 \right) - \log \frac{S_*}{S_0} + e^{rT}\int_0^{S_*} \frac{1}{K^2} P(K)dK  + e^{rT}\int^\infty_{S_*} \frac{1}{K^2} C(K)dK \right)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $P(K)$ is current market put prices and $C(K)$ is market call prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there an intuition to the scaling factor&lt;/strong&gt; $\frac{1}{T\cdot K^2}$? It also shows up in the discretized version of variance estimates, or the &lt;a href=&quot;https://www.cboe.com/micro/vix/vixwhite.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;VIX calculation&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Derman, &lt;em&gt;et al&lt;/em&gt;. also states it provides a &quot;direct connection between the market cost of options and the strategy for capturing future realized volatility, even there is an implied volatility skew and the simple Black-Scholes formula is invalid&quot;. So I think there is a risk-neutral takeaway that doesn't regard the model.&lt;/p&gt;&#xA;" OwnerUserId="20194" LastEditorUserId="20194" LastEditDate="2017-07-09T06:52:53.627" LastActivityDate="2017-07-09T09:22:56.690" Title="Intuition Behind Scaling Factor in Variance Swaps" Tags="&lt;volatility&gt;&lt;variance&gt;&lt;vix&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35057" PostTypeId="2" ParentId="35054" CreationDate="2017-07-09T09:22:56.690" Score="4" Body="&lt;p&gt;I believe you want to know why the VIX is a weighted portfolio of calls and puts with weights proportional to $\frac{1}{K^2}$ (NB: obviously the T is there to adjust for time to maturity, hence is not very enlightening).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's start with the basics. As shown by &lt;a href=&quot;http://faculty.baruch.cuny.edu/lwu/890/BreedenLitzenberger78.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Breeden and Litzenberger (1978)&lt;/a&gt; the second derivative of an option price with respect to the strike is proportional to the risk-neutral probability, i.e. $\frac{\partial^2C}{\partial K^2}=\frac{\partial^2P}{\partial K^2} \propto q(K)$ where $q(K)$ is the risk-neutral pdf at $K$. The intuition is that an infinitely tight butterfly spread around $K$ gives us the risk-neutral likelihood of $K$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now that we have $q(K)$ we can construct in principle any desired payoff $f(S_T)$, given that $$price(f(S_T))=e^{-rT}E^Q[f(S_T)]=e^{-rT}\int_0^\infty f(K)q(K)dK=\int_0^\infty f(K) \frac{\partial^2C}{\partial K^2}dK$$ If you integrate by parts the previous integral and assume that the function is well behaved at the boundaries as shown &lt;a href=&quot;http://www.frouah.com/finance%20notes/Payoff%20function%20decomposition.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; you obtain that:&#xA;$$price(f(S_T))=e^{-rT}f(F)+\int_0^F\frac{\partial^2 f}{\partial K^2}\left(K\right)P(K)dK+\int_F^\infty\frac{\partial^2 f}{\partial K^2}\left(K\right)C(K)dK$$ where $F$ is the current Forward price, $C$ and $P$ are call and put prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As shown by &lt;a href=&quot;http://quantlabs.net/academy/download/free_quant_instituitional_books_/[Journal%20of%20Portfolio%20Management,%20Neuberger]%20The%20Log%20Contract%20-%20A%20New%20Instrument%20to%20Hedge%20Volatility.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Neuberger&lt;/a&gt;, if prices follow a geometric Brownian motion, i.e. $dS=S\mu dt+S\sigma dW$, then $$log E^Q[S_T]-E^Q[log S_T]\propto\sigma^2$$ (NB: just write down the cumulant-generating function of a Normal distribution). This shows that under lognormal stock prices if we set $f(S_T)$ we can recover the implied volatility (NB: the implied &lt;strong&gt;risk-neutral&lt;/strong&gt; variance, but the physical and risk-neutral variances are equal because of Girsanov's theorem in a continuous time diffusion.) Hence, you see immediately that to recover the price of the log contract you have to compute $\frac{\partial^2}{\partial K^2}log(K)=-\frac{1}{K^2}$. This is the reason why in the VIX$^2$ computation the weights are inversely proportional to $K^2$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the way, as a side note, if you are interested in risk-neutral variances outside of the log-normal paradigm it is enough to notice that $Var^Q(S_T)=E^Q[S_T^2]-E^Q[S_T]^2$, hence if you set $f(S_T)=S_T^2$ then you will notice that $\frac{\partial^2}{\partial K^2}K^2=1$ and therefore:&#xA;$$Var^Q(S_T)=...\int_0^F P(K)dK+\int_F^\infty C(K)dK$$&lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2017-07-09T09:22:56.690" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35060" PostTypeId="1" AcceptedAnswerId="35063" CreationDate="2017-07-09T16:11:49.173" Score="5" ViewCount="3926" Body="&lt;p&gt;My question concerns the Black-Scholes formula for the value of a European option, namely&lt;/p&gt;&#xA;&#xA;\begin{align}&#xA;  C(S_t, t) &amp;amp;= N(d_1)S_t - N(d_2) Ke^{-r(T - t)} \\&#xA;     d_1 &amp;amp;= \frac{1}{\sigma\sqrt{T - t}}\left[\ln\left(\frac{S_t}{K}\right) + \left(r + \frac{\sigma^2}{2}\right)(T - t)\right] \\&#xA;     d_2 &amp;amp;= d_1 - \sigma\sqrt{T - t} \\&#xA;\end{align}&#xA;&#xA;&lt;p&gt;First, I want to ignore for purposes of this question the derivation of this formula using the Black-Scholes PDE dynamic hedging argument, which I haven't been through in detail, but I understand in principal.  Rather, I'd like someone to explain to me why the following argument, which leads me to a (slightly) different answer than the one above, is wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Black-Scholes model of stock movements posits that the change $\Delta S$ in a stock price over a small time interval $\Delta t$ behaves as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Delta S = \mu S \Delta t + \sigma \sqrt{\Delta t} \varepsilon S$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\mu = \text{drift rate}$, $\sigma = \text{volatility}$ (constant), and $\varepsilon$ is a fair coin flip resulting in $1$ and $-1$ (I prefer this incremental equation to a stochastic one, I'm not up on Ito's lemma and all that).  $S_T$, the stock price at time $T$, is then (for fixed $\Delta t$) the random variable&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_T = S_0 \left(1+\mu \Delta t + \sigma \sqrt{\Delta t} \right)^X \left(1+\mu \Delta t - \sigma \sqrt{\Delta t}\right)^{N-X}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $X$ is a binomial R.V. counting the number of $1$'s from the coin flips and $N = T/\Delta t$.  Using the normal approximation for $X$ and letting $\Delta t \rightarrow 0$ gets us&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_T = S_0 e^{(\mu-\sigma^2/2)T}e^{\sigma \sqrt{T} Z}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Z$ is standard normal (or we could replace $\sqrt{T} Z$ with brownian motion $W$ for a dynamic model).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, what is the fair value of a European option on this stock at strike price $K$ and time to expiry $T$?  Well, the seller of such an option would expect to have to pay at expiry, on average&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E[\text{max}(S_T - K,0)]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, the expected value of the payout of the option.  And so to price it today, one would discount this expected payout by the risk-free rate:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$e^{-rT}E[\text{max}(S_T - K,0)]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, this is wrong, according to the Black-Scholes formula given a the beginning.  I'll spare you the computations, but in fact, this computation returns the correct Black-Scholes formula only if we change our model $S_T$ to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_T = S_0 e^{(r-\sigma^2/2)T}e^{\sigma \sqrt{T} Z}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, by replacing $\mu$, the drift rate of the stock, to $r$, the risk-free rate.  And so my question is, why are we justified in doing this?  Why is it okay, for purposes of this computation, to &quot;pretend&quot; that the drift rate of the stock is $r$, when it very well may not be in real life?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Two objections come to my mind regarding my computation.  First, it assumes that the person valuing the option only cares about its expected payout, and not the volatility of the payout, due to the volatility of the stock itself (i.e. it assumes risk-neutrality, which may not be the case).  Still, if someone were to sell enough of these options (on identical but independent stocks) for the law of averages to win out, then this would be a correct valuation.  And secondly, this doesn't seem to be actually computing the market value of the option, but only the expected cost to the seller.  That is, expected cost to the seller might not be exactly the same thing as value to the buyer.  But still, if someone were to offer options at a price other than this one, obvious (statistical) arbitrage opportunities would exist (for a market participant with enough reserves to weather the volatility in the payouts).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm interested in your thoughts on these objections.  But my big question is still: why does replacing $\mu$ with $r$ lead us to the correct formula, when $\mu$ and $r$ are almost never equal?  Thanks you for any help.&lt;/p&gt;&#xA;" OwnerUserId="28581" LastActivityDate="2017-07-14T03:31:32.240" Title="Deriving the Black-Scholes formula as the expected value on the payout of an option" Tags="&lt;black-scholes&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35062" PostTypeId="2" ParentId="35060" CreationDate="2017-07-09T17:45:34.593" Score="5" Body="&lt;p&gt;You make a crucial mistake when you assume that the price of the option is &#xA;$$C=e^{-rT}E^{\mathbb{P}}[(S_T-K)^+]$$ that is, it is not true that the price of an asset is the discounted (using the risk-free rate) payoff under the physical measure $\mathbb{P}$. The following two statements, on the other hand, are true:&#xA;$$C=E^{\mathbb{P}}\left[\frac{\xi_T}{\xi_0}(S_T-K)^+\right]$$&#xA;$$C=e^{-rT}E^{\mathbb{Q}}[(S_T-K)^+]$$&#xA;where $\xi_t$ is the state price density, i.e. the stochastic process $\xi_t$ under which the product with any asset $\xi_t S_{it}$ is a $\mathbb{P}$-martingale, or $\mathbb{Q}$ is the risk-neutral measure under which any asset has drift $r$, i.e. the any asset follows the following SDE $$\frac{dS_{it}}{S_{it}}=rdt+\sigma dZ^\mathbb{Q}$$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my opinion, the easiest way to show that Black-Scholes follows, is to solve the same integral noticing that under $\mathbb{Q}$ the stock price is $S_T=S_0 e^{(r-\frac{1}{2}\sigma^2)T+\sigma \sqrt{T}Z}$. Alternatively, you can show that the SPD follows $\frac{d\xi}{\xi}=-rdt-\frac{\mu-r}{\sigma}dZ^{\mathbb{P}}$, use Ito's lemma on $f(t,S,\xi)=S\xi$ and obtain the same result again.&lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2017-07-09T17:45:34.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35063" PostTypeId="2" ParentId="35060" CreationDate="2017-07-09T17:59:48.637" Score="5" Body="&lt;p&gt;There are a lot of different questions to address in your post.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I'd like someone to explain to me why the following argument, which leads me to a (slightly) different answer than the one above, is wrong.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Letting $\mathbb{P}$ designate real-world probabilities, the reason your reasoning is not correct is because you posit that:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;the seller of such an option would expect to have to pay at expiry, on average&#xA;  $$ \mathbb{E}^{\mathbb{P}}[\max(S_T−K,0)] $$&#xA;  That is the expected value of the payout of the option. And so to price it today, one would discount this expected payout by the risk-free rate.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Your reasoning would be right if the call option and the underlying asset on which it is written $-$ and which we use to hedge our exposure $-$ were &lt;em&gt;not traded&lt;/em&gt;. To understand this, consider a way simpler product: a forward contract written on the stock, in which you promise to buy or sell one share of stock at maturity $T$ at a price $K$. The expected value of $S_T$ under your model is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbb{E}^{\mathbb{P}}[S_T]=S_0e^{\mu T}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this a fair price for the forward contract:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ K = S_0e^{\mu T} \text{ ?}$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well, no: assume you can enter this contract with a client that, like yourself and other participants in the market, can borrow at a rate $r&amp;lt;\mu$. The client can enter into a forward &lt;em&gt;sell&lt;/em&gt; agreement with you, so that you promise to &lt;em&gt;buy&lt;/em&gt; the stock share at price $K$ above at time $T$. The client can then borrow at rate $r$ an amount $S_0$ $-$ &lt;em&gt;i.e.&lt;/em&gt; equal to the stock's current price $-$ with maturity $T$ and buy the stock now. At $T$, your client will:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;use the stock he purchased at $t=0$ to deliver the stock to you;&lt;/li&gt;&#xA;&lt;li&gt;own an amount $S_0e^{rT}$ to his lender;&lt;/li&gt;&#xA;&lt;li&gt;receive an amount $S_0e^{\mu T}$ from selling the stock to you.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So his final payoff will be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ S_0(e^{\mu T}-e^{rT}) &amp;gt; 0 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which constitutes an &lt;em&gt;arbitrage opportunity&lt;/em&gt;. The market will make those disappear because they constitute &quot;free money&quot;. What is then the right price to charge for the forward contract? Well, the client has always the choice to borrow $S_0$ at rate $r$ and deliver you the share at maturity, hence the only logical price to avoid arbitrage strategies is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ K_{\text{For}} = S_0e^{rT} $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You see a few things here:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Like with the more complicated example of a call option, pricing a forward contract is equivalent to requiring the stock price to have a return rate of $r$ under some probability measure: it does not matter that the stock's true average return is $\mu$, the fact that you can hedge your exposure by borrowing at a rate $r$ overrides this property. &lt;/li&gt;&#xA;&lt;li&gt;When the derivative $-$ call option, forward contract $-$ or its underlying can be traded and hence the risk can be hedged, then the law of large numbers that you call in is overridden by the requirement that there must not be arbitrage opportunities (in real life, these fade away very quickly). For more details on this, you can check my answer to question &quot;&lt;a href=&quot;https://quant.stackexchange.com/questions/34773/reference-for-why-a-derivative-is-a-derivative-and-not-say-an-insurance-contract/34774#34774&quot;&gt;Reference for why a derivative is a derivative and not say an insurance contract&lt;/a&gt;&quot;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Still, if someone were to sell enough of these options (on identical but independent stocks) for the law of averages to win out, then this would be a correct valuation.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The fact is that, by valuing the derivative that way, he will be bleeding money away by leaving market participants arbitrage him at each contract.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;But my big question is still: why does replacing $\mu$ with $r$ lead us to the correct formula, when $\mu$ and $r$ are almost never equal?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Intuitively, you can think of it this way: &lt;em&gt;it is not the rate of return of the underlying asset that matters, but rather the rate at which you can borrow the underlying asset to hedge yourself&lt;/em&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mathematically, the shortest way to understand this is through a PDE approach. You might know that through dynamic hedging arguments, you can derive a PDE that determines the option's value; letting $C_t$ be the price of the call option and $\Phi(S_T)=\max(S_T-K,0)$ its payoff, this PDE is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{\partial C_t}{\partial t} + \frac{\partial C_t}{\partial S_t}rS_t +\frac{1}{2}\frac{\partial^2C_t}{\partial S_t^2}\sigma^2S_t^2-rC_t = 0 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, the main point here is that we can apply to that PDE equation the &lt;a href=&quot;https://en.wikipedia.org/wiki/Feynman%E2%80%93Kac_formula&quot; rel=&quot;noreferrer&quot;&gt;Feynman-Kac Theorem&lt;/a&gt; which states its solution, &lt;em&gt;i.e.&lt;/em&gt; the function $C_t$ that follows those dynamics with terminal condition $C_T=\Phi(S_T)$, can be computed as the following expectation $-$ under a probability measure $\mathbb{Q}$ where the drift of the stock price is $r$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ C_0 = \mathbb{E}^{\mathbb{Q}}\left[e^{-\int_0^Trdt}\Phi(S_T)|S_0\right] = e^{-rT}\mathbb{E}^{\mathbb{Q}}\left[\max(S_T-K,0)|S_0\right] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fact that pricing a derivative contract is equivalent to computing the expectation of its payoff under a probability measure $\mathbb{Q}$ where the stock's price drift is $r$ instead of $\mu$ is little more than a mathematical trick resulting from the Feynman-Kac Theorem.&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-07-09T23:10:16.960" LastActivityDate="2017-07-09T23:10:16.960" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35064" PostTypeId="2" ParentId="34984" CreationDate="2017-07-09T19:19:47.403" Score="2" Body="&lt;p&gt;There are two communities that parametrize the random variables of the returns and levels differently. And unfortunately, they both use the same notation. One community uses $\mu$ to denote the mean of the logarithm of the level. The other uses $\tilde{\mu}$ to denote the logarithm of the mean of the level. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yes, the order in which you apply transformations to random variables and take their expectation is very important. Only in the case of affine/linear transformations does the order not matter. In your case, the logarithm is a nonlinear function, and so interchanging the order matters very much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the statistics community, where it is more common to deal with single random variables and not continuous time stochastic processes, we would probably say $X$ follows a Lognormal distribution with parameters $\mu$ and $\sigma^2$. This is written $X \sim \text{Lognormal}(\mu, \sigma^2)$. However, these parameters do not denote the mean and variance of the random variable $X$. Instead, the denote the mean and variance of $R = \log X$, which is a Normally distributed single period return. For us the expected level is $E[X] = \exp[ \mu + \sigma^2/2].$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When people talk about SDEs, which I'm less familiar with, they mention that the expected level after one period is $e^{\tilde{\mu}}$. Here they are using the parameter to denote the logarithm of the mean of the level. The relationship between the two parametrizations is as follows:&#xA;$$&#xA;\left[ \begin{array}{c}&#xA;\tilde{\mu} \\&#xA;\tilde{\sigma}^2&#xA;\end{array}\right]&#xA;=&#xA;\left[ \begin{array}{c}&#xA;\mu + \frac{\sigma^2}{2} \\&#xA;\sigma^2&#xA;\end{array}\right],&#xA;$$&#xA;where the left hand side is the set of parameters used by the SDE community.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Make the substitutions and you can see that both communities are saying the same thing about returns:&#xA;$$&#xA;E[R] = E[\log X] = \mu = \tilde{\mu} - \frac{\tilde{\sigma}^2}{2}.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you make the substitutions again, you can see they are also saying the same thing about the levels:&#xA;$$&#xA;E[X] = \exp(\mu + \sigma^2/2) = \exp(\tilde{\mu}).&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="1870" LastEditorUserId="1870" LastEditDate="2017-07-09T19:30:46.097" LastActivityDate="2017-07-09T19:30:46.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35065" PostTypeId="2" ParentId="34984" CreationDate="2017-07-09T22:34:20.477" Score="0" Body="&lt;p&gt;This is about the second question only.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the theory of SDEs the parameter $\tilde{\mu}$ is sometimes called the instantaneous rate of return, that is the rate of return over an interval of time so small that the randomness can be neglected (i.e. in the limit $\Delta t\to 0$)&#xA;.&#xA;However, over a finite interval of time this rate of return does not apply, the randomness in the process causes the expected rate to be less than this, and over one time unit (taken to be a year for illustration) the rate of return is $\tilde{\mu}- \frac{1}{2}\sigma^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now turning to the Wikipedia article. What is the yearly expected return for an investment that combines Stock in the proportion $f$ and Tbills in the proportion $(1-f)$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Stock has instantaneous rate of return $\tilde{\mu}$ and variance $\sigma^2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Tbill has rate of return $r$ and variance 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The combination of the two has instantaneous rate of return $f \tilde{\mu} + (1-f) r$ and has variance $f^2 \sigma^2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Applying the formula above we find that the yearly (or one time unit) rate of return for the blended investment is $f\tilde{\mu} + (1-f) r-\frac{1}{2}f^2 \sigma^2$. Which is the expression given in the Wikipedia article. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The mysterious &quot;minus half the variance&quot; correction term that makes its appearance is called the &quot;Ito correction&quot; and really requires a knowledge of stochastic calculus to explain.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2017-07-09T22:54:16.687" LastActivityDate="2017-07-09T22:54:16.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35067" PostTypeId="1" AcceptedAnswerId="35113" CreationDate="2017-07-10T06:56:31.257" Score="3" ViewCount="212" Body="&lt;p&gt;I was reading this seminal &lt;a href=&quot;https://pdfs.semanticscholar.org/1519/ee324c31edfb02e6ec0d12662b42e1b5cd1a.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;paper&lt;/a&gt; by Infanger. On page 40, Figure 11. was quite interesting. In particular I was interested in the top one, 19 Years and I wanted to reproduce this plot. To give some background: It's about utility maximization which should be solved by DP approach, i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \max_{x_t,0\le t\le T} E[u(W_T)]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $u$ is a utility function and $W_T$ is the wealth at time $T$. We want therefore to maximize terminal wealth. For the picture he uses the following &quot;quadratic downside risk&quot; function&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ u(W) = W - \frac{\lambda}{2}\max{(0,W_d-W)^2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W_d$ is a target amound and $\lambda$ a scaling parameter. As wealth evolves via $W_{t+1} = W_t \cdot\langle x_t, R\rangle$ where $x_t$ are the allocation and $R$ the return, he writes down the Bellman equation of this problem:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V_{t}(W_t) = \max_{x_t}E[V_{t+1}(W_t\cdot \langle x_t, R\rangle)|W_t]$$&#xA;since I'm just interested in the final step, we have $V_T = u$ and the maximization problem I want to solve is&#xA;$$V(W) = \max_{x}E[u(W\cdot \langle x, R\rangle)|W] $$&#xA;dropping the time $t$ index. I assumed (as Infanger did if I get him right), that $R$ are normally distributed. I use then Gauss-Hermite quadrature to approximate the expectation (see page 71 in this &lt;a href=&quot;https://www.google.ch/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=2&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0ahUKEwiP9bThjPzUAhUsBcAKHWRmAs4QFgg7MAE&amp;amp;url=http%3A%2F%2Fwww.zccfe.uzh.ch%2Fstatic%2Ffiles%2FCai_Judd_Dynamic_Programming.pdf&amp;amp;usg=AFQjCNE_N5vIj9Mu8o3mvknL8V892YNoQA&quot; rel=&quot;nofollow noreferrer&quot;&gt;paper&lt;/a&gt;).&#xA;$$V(W) = \frac{1}{\sqrt{\pi}}\max_{x}\sum_{i=1}^m w_i u(W(1+\hat{\mu}(x)+\sqrt{2}\hat{\sigma}(x)\cdot q_i)) $$&#xA;where $\hat{\mu} = \langle \mu, x\rangle$ and $\hat{\sigma} = \sqrt{\langle x, \Sigma x\rangle}$ and $w_i$ are the Gauss-Hermite weights and $q_i$ the corresponding nodes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've coded a very simple and not optimized version to see if I get the desired picture. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;first a picture of the utility function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;utility &amp;lt;- function(w){&#xA;  K &amp;lt;- 100000&#xA;  temp &amp;lt;- K-w&#xA;  temp[temp&amp;lt;=0] &amp;lt;- 0&#xA;  return(w - 1000*temp^2)&#xA;}&#xA;&#xA;x &amp;lt;- seq(90000,120000,1000)&#xA;y &amp;lt;- utility(x)&#xA;plot(x,y,type=&quot;l&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/vKuuW.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/vKuuW.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I just generated a sequences of $W$ and solved the above problem. The following code junk defines the covariance and expected return vector. The data is from the Infanger paper above.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;wealth &amp;lt;- seq(50000,150000,5000)&#xA;mu &amp;lt;- c(0.108, 0.1037, 0.0949, 0.079, 0.0561)&#xA;cor &amp;lt;- matrix(c(1, 0.601, 0.247, 0.062, 0.094,&#xA;                0.601, 1.0, 0.125, 0.027, 0.006,&#xA;                0.247, 0.125, 1.0, 0.883, 0.194,&#xA;                0.062, 0.027, 0.883, 1.0, 0.27,&#xA;                0.094, 0.006, 0.194, 0.27, 1.0),&#xA;              ncol=5, nrow=5,byrow=T)&#xA;std &amp;lt;- c(0.1572, 0.1675, 0.0657, 0.0489, 0.007)&#xA;temp &amp;lt;- std%*%t(std)&#xA;cov &amp;lt;- temp*cor&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With this data at hand and a sequence of wealth (see above) I just run an optimization for each given wealth and store the solution (assuming no short selling). To solve the problem I used the &lt;code&gt;Rsolnp&lt;/code&gt; package in R. It solves a minimization problem that's why I'm returning a $-1$ in the objective function below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(Rsolnp)&#xA;library(statmod)&#xA;obj &amp;lt;- function(x, currentWealth, mu, cov, r=0, nodes, weights){&#xA;  drift &amp;lt;- sum((mu-r)*x)+r&#xA;  cor &amp;lt;- sqrt(sum(x*(cov%*%x)))&#xA;  term1 &amp;lt;- currentWealth*(1+drift)&#xA;  term2 &amp;lt;- currentWealth*sqrt(2)*cor*nodes&#xA;  return(-1/sqrt(pi)*sum(weights*utility(term1+term2)))&#xA;}&#xA;&#xA;g_constraints &amp;lt;- function(x,currentWealth, mu, cov, r=0, nodes, weights){&#xA;  return(sum(x))&#xA;}&#xA;&#xA;x0 &amp;lt;- rep(0.25,length(mu))&#xA;weights &amp;lt;- gauss.quad(10,&quot;hermite&quot;)$weights&#xA;nodes &amp;lt;- gauss.quad(10,&quot;hermite&quot;)$nodes&#xA;solmat &amp;lt;- matrix(NA, ncol=length(mu),nrow=length(wealth))&#xA;for(i in 1:length(wealth)){&#xA;  sol &amp;lt;- solnp(pars=x0, fun = obj,&#xA;               eqfun = g_constraints,&#xA;               eqB = 1,&#xA;               LB = rep(0, length(mu)),&#xA;               UB = rep(1, length(mu)),&#xA;               currentWealth = wealth[i], mu = mu, cov = cov,&#xA;               r = 0, nodes = nodes, weights = weights)&#xA;  solmat[i,] &amp;lt;- sol$pars&#xA;  x0 &amp;lt;- sol$pars&#xA;}&#xA;colnames(solmat) &amp;lt;- c(&quot;US Stock&quot;, &quot;Int Stocks&quot;, &quot;Corp Bonds&quot;, &quot;Gvnt Bond&quot;, &quot;Cash&quot;)&#xA;rownames(solmat) &amp;lt;- as.character(wealth)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, I get a constant allocation where all money is invested in US Stocks. What's wrong with this and how do I get this chart from Infanger?&lt;/p&gt;&#xA;" OwnerUserId="17133" LastEditorUserId="-1" LastEditDate="2017-07-14T20:44:38.870" LastActivityDate="2017-07-14T20:44:38.870" Title="Why is this utility function not picking up its penalty?" Tags="&lt;programming&gt;&lt;portfolio-optimization&gt;&lt;asset-allocation&gt;&lt;utility-theory&gt;&lt;dynamic&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35068" PostTypeId="2" ParentId="35045" CreationDate="2017-07-10T08:29:31.867" Score="1" Body="&lt;p&gt;This is detailed in the chapter 2 of Lorenzo Bergomi's book &quot;Stochastic volatility modeling&quot;, section &lt;strong&gt;2.4.1 - Implied volatilities as weighted averages of instantaneous volatilities&lt;/strong&gt;. Samples of the book, notably chapter 2, are available for download &lt;a href=&quot;http://www.lorenzobergomi.com/contents-sample-chapters&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The author shows that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \sigma_{KT}^2 = \frac{\Bbb{E}^\Bbb{Q} \left[ \int_0^T e^{-rt} S_t^2 \frac{dP_{\sigma_{KT}}}{dS^2} \sigma_{t}^2 dt \right]}{\Bbb{E}^\Bbb{Q} \left[ \int_0^T e^{-rt} S_t^2 \frac{dP_{\sigma_{KT}}}{dS^2} dt \right]} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\sigma_{KT}$ is the implied volatility of a European call option of strike $K$ and maturity $T$ of $P_{\sigma_{KT}}$ priced under the stochastic volatility model&#xA;$$ dS_t = (r-q) S_t dt + \sigma_t S_t dW_t^\Bbb{Q} \tag{1}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma_{KT}^2$ is thus the average value of $\sigma^2_t$, weighted by the dollar gamma computed with the constant volatility $\sigma_{KT}$ itself, over paths generated by the stochastic volatility model $(1)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bergomi then discusses further approximations.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2017-07-10T08:29:31.867" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="35069" PostTypeId="1" CreationDate="2017-07-10T08:38:18.593" Score="1" ViewCount="64" Body="&lt;p&gt;I understand that Delta measures the rate of change of the theoretical option value with respect to the change of the underlying asset price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This also represents the number of shares a call option writer is required to have in his portfolio in order to mitigate the relative risks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my software, this sensitivity is often reported discounted to the present time from option's expiration date. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you please explain why?&lt;/p&gt;&#xA;" OwnerUserId="6499" LastActivityDate="2017-07-10T08:38:18.593" Title="The interpretation of discounted Greeks" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;derivatives&gt;&lt;greeks&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="35070" PostTypeId="2" ParentId="35043" CreationDate="2017-07-10T09:04:32.983" Score="0" Body="&lt;p&gt;As to &quot;precise pricing&quot; &lt;a href=&quot;https://wiki.treasurers.org/wiki/Foreign_exchange_swap#Pricing&quot; rel=&quot;nofollow noreferrer&quot;&gt;ACT Treasurer's Wiki&lt;/a&gt; shows that in practise the reason a swap is cheaper than 2 outrights is the hedging cost - with a swap the market maker need not hedge in the FX market at all. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to which interest rate curve you choose, in my view that's all about the hedging cost in the money markets, and as to why there's a convexity it's all about predicting cash flow payments for the hedge. You've got &lt;a href=&quot;https://quant.stackexchange.com/questions/2982/cross-currency-swap-pricing-in-nowadays-environment?rq=1&quot;&gt;this&lt;/a&gt; quant finance answer, and &lt;a href=&quot;https://quant.stackexchange.com/questions/2228/what-is-the-reason-for-the-convexity-adjustment-when-pricing-a-constant-maturity?rq=1&quot;&gt;this one&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How much influence does a convexity adjustment have? How does the bank deal with the problem of convexity? I guess that if the bank loses money on hedging these deals then they either get out of the swap pricing business or replace the traders.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastEditorUserId="7369" LastEditDate="2017-07-10T09:12:09.857" LastActivityDate="2017-07-10T09:12:09.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35071" PostTypeId="1" AcceptedAnswerId="35072" CreationDate="2017-07-10T09:31:31.330" Score="2" ViewCount="208" Body="&lt;p&gt;Acerbi has several backtests for expected shortfall. The second backtest is based on this equality &lt;a href=&quot;https://i.stack.imgur.com/RXV5t.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/RXV5t.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;a href=&quot;https://i.stack.imgur.com/YUSBp.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/YUSBp.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Does anybody know how to derive this equality? Can anybody explain, why it makes sense, especially dividing by $\alpha$?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Background:&#xA;I took the equality from this presentation &lt;a href=&quot;https://www.cass.city.ac.uk/faculty-and-research/faculties/finance/seminars-and-workshops/financial-engineering-workshops/ACERBI-Carlo-10.03.2015.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.cass.city.ac.uk/faculty-and-research/faculties/finance/seminars-and-workshops/financial-engineering-workshops/ACERBI-Carlo-10.03.2015.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is how I know expected shortfall&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/jAwdL.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/jAwdL.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="22744" LastActivityDate="2017-07-10T10:00:18.113" Title="expected shortfall as unconditional expectation" Tags="&lt;backtesting&gt;&lt;var&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35072" PostTypeId="2" ParentId="35071" CreationDate="2017-07-10T10:00:18.113" Score="3" Body="&lt;p&gt;Letting $X_t$ be a random variable, its &lt;a href=&quot;https://en.wikipedia.org/wiki/Conditional_expectation#Conditional_expectation_with_respect_to_an_event&quot; rel=&quot;nofollow noreferrer&quot;&gt;conditional expectation with respect to some event&lt;/a&gt; $E$ is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbb{E}^{\mathbb{P}}[X_t|E]=\frac{\mathbb{E}^{\mathbb{P}}[\mathbf{1}_EX_t]}{\mathbb{P}(E)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In our case, Expected Shortfall is defined as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \text{ES}_{\alpha,t} = -\mathbb{E}^{\mathbb{P}}[X_t|X_t + \text{VaR}_{\alpha} &amp;lt; 0]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;\text{ES}_{\alpha,t} &amp;amp; = -\frac{\mathbb{E}^{\mathbb{P}}[\mathbf{1}_{\{X_t + \text{VaR}_{\alpha} &amp;lt; 0\}}X_t]}{\mathbb{P}(X_t + \text{VaR}_{\alpha} &amp;lt; 0)} &#xA;\\[9pt]&#xA;&amp;amp; = -\frac{\mathbb{E}^{\mathbb{P}}[\mathbf{1}_{\{X_t + \text{VaR}_{\alpha} &amp;lt; 0\}}X_t]}{\alpha} &#xA;\\[11pt]&#xA;&amp;amp; = -\mathbb{E}^{\mathbb{P}}\left[\frac{\mathbf{1}_{\{X_t + \text{VaR}_{\alpha} &amp;lt; 0\}}X_t}{\alpha}\right] &#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where the second step is a consequence of the definition of $\text{VaR}_{\alpha}.$&lt;/p&gt;&#xA;" OwnerUserId="20454" LastActivityDate="2017-07-10T10:00:18.113" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35073" PostTypeId="1" CreationDate="2017-07-10T12:40:30.880" Score="4" ViewCount="132" Body="&lt;p&gt;Does anyone know where I can find this paper ?  A Simple New Formula for Options With Stochastic Volatility - (Heston,1997)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="28756" LastActivityDate="2017-07-10T12:40:30.880" Title="Heston (1997) paper" Tags="&lt;heston&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35074" PostTypeId="1" CreationDate="2017-07-10T15:15:56.577" Score="8" ViewCount="354" Body="&lt;p&gt;A highly cited article &lt;a href=&quot;http://www.tandfonline.com/doi/abs/10.1080/713665670&quot; rel=&quot;noreferrer&quot;&gt;&quot;Empirical properties of asset returns: stylized facts and statistical issues&quot;&lt;/a&gt; by R. Cont use the &lt;strong&gt;Figure 8.&lt;/strong&gt; below to illustrate &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;the well-known phenomenon of volatility clustering: large price variations are more likely to be followed by large price variations. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/0RQXe.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/0RQXe.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note the burst of autocorrelation of $x^2$ (red dotted line) at lag $\approx 85$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Later on the author publishes even higher cited book &lt;a href=&quot;https://www.crcpress.com/Financial-Modelling-with-Jump-Processes/Tankov-Cont/p/book/9781584884132&quot; rel=&quot;noreferrer&quot;&gt;&quot;Financial Modelling with Jump Processes&quot;&lt;/a&gt; (together with P. Tankov). On the &lt;strong&gt;FIGURE 7.3&lt;/strong&gt; in the book (shown below) the same autocorrelation of $x^2$ as above is shown. But this time  &lt;em&gt;without&lt;/em&gt; the burst! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/flEDK.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/flEDK.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also I have to admit that I couldn't understand x axis legend for both pictures above. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So it would be great if someone who has access to S&amp;amp;P 500 Index futures intraday 1-minute data for 1991-1995 could calculate autocorrelation function of squared price increments and publish it here!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt;&#xA;I've quickly prepared a similar graph using data for 1998-2012 kindly provided by @David Addison. In appears that &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;autocorellations are two times higher than in the article and in the book&lt;/li&gt;&#xA;&lt;li&gt;power law (blue line) does not seem to be a very good fit&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/FRQFq.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/FRQFq.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. I do not claim that above I and David has provided a reliable evidence of anything. Rather it should be considered as an additional justification for the question and request. Let's reproduce the results of &lt;a href=&quot;https://www.imperial.ac.uk/people/r.cont&quot; rel=&quot;noreferrer&quot;&gt;Professor Rama Cont&lt;/a&gt; !&lt;/p&gt;&#xA;" OwnerUserId="15154" LastEditorUserId="16148" LastEditDate="2021-02-02T13:43:08.217" LastActivityDate="2021-03-04T14:03:35.377" Title="Are Cont's &quot;stylized facts&quot; based on reliable evidence?" Tags="&lt;volatility&gt;&lt;stylized-facts&gt;" AnswerCount="1" CommentCount="12" FavoriteCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="35075" PostTypeId="1" CreationDate="2017-07-10T16:50:00.037" Score="2" ViewCount="413" Body="&lt;p&gt;I'm working through Baxter and Rennie's &quot;Financial Calculus: An Introduction to Derivative Pricing&quot;. It was going very well and I've actually found it an easy read up until the point where they introduce the Binomial Representation Theorem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here they ask us to consider the branching from tick i-1 to tick i i.e. $\Delta S_i = S_i - S_{i-1}$ and $\Delta N_i = N_i - N_{i-1}$ where S and N are our two martingales.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q1: At this point they comment that the variability of these increments depends on the branch structure. Are they referring to the probabilities associated to each branch or to the value of the random variables at time i?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moving on, they say that since there are only two places to go, any random variable dependent on the branch is fully determined by its width size and a constant offset dependent on the filtration $F_{i-1}$. So if we want to construct one random process out of another it will in general be a construction based on a scaling (to match the widths) and a shift (to match the offsets).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q2: Am I correctly interpreting this when I rearrange the above eqns to give $S_i = \Delta S_i + S_{i-1}$ and $N_i = \Delta N_i + N_{i-1}$, and then view the widths as being the $\Delta S_i, \Delta N_i$ parts and the offsets as being the $S_{i-1}, N_{i-1}$ parts?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q3: So he's basically saying that to transform one martingale into another we need to multiply it and then shift it? Is there some more intuitive way to see why this should be the case?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now to the more confusing stuff....he next says that we'll consider the scaling first. The size of the difference between and up and down jump is $\delta s_i = s_u - s_d$ for S and $\delta n_i = n_u - n_d$ for N, and that both of these are dependent only on the filtration $F_{i-1}$. So we can define the ratio of these branch widths as $\phi_i = \frac{\delta n_i}{\delta s_i}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q4: I cannot wrap my head around why $\delta s_i, \delta n_i$ are previsible - they clearly depend on future values of the random variable, namely $s_u,s_d,n_u,n_d$. This is glossed over in all the notes I've found which is a bit irritating. It seems important as only once we can confirm that this is true can we conclude that $\phi_i$ is indeed previsible as the Theorem states. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Q5: He is now referring to $\delta s_i$ as a branch width, whereas he was calling $\Delta S_i$ a width a few lines earlier (hence my second question above). In any case, $\phi_i$ is constructed as a ratio such that when it multiplies the $\Delta S_i$ increment it will bring it to the correct scale for $\Delta N_i$. Is this correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="19439" LastActivityDate="2018-01-13T05:08:13.453" Title="Previsibility in Binomial Representation Theorem" Tags="&lt;stochastic-processes&gt;&lt;binomial-tree&gt;&lt;random-walk&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35076" PostTypeId="1" AcceptedAnswerId="35080" CreationDate="2017-07-10T20:10:12.327" Score="3" ViewCount="1241" Body="&lt;p&gt;In &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1119057868&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;em&gt;Finding Alphas&lt;/em&gt;&lt;/a&gt;, Chapter 1, Introduction to Alpha Design, the authors state: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;An alpha can be represented as a matrix of securities and positions&#xA;  indexed by time. The value of the matrix corresponds to positions in&#xA;  that particular stock on that particular day. Positions in stock&#xA;  change daily; the daily changes are traded in the securities market.&#xA;  The alpha produces returns, and returns have variability. The ratio of&#xA;  return to standard deviation (variability) of the returns is the&#xA;  information ratio of the alpha. &lt;strong&gt;It so happens that the information&#xA;  ratio of the alpha is maximized when alpha stock positions are&#xA;  proportional to the forecasted return of that stock.&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;My emphasis added. This statement is provided without proof. I feel like there is a Grinold-Kahn style proof of this, but I am unable to find it. How does one prove this claim?&lt;/p&gt;&#xA;" OwnerUserId="28761" LastActivityDate="2017-07-11T14:04:09.170" Title="Portfolio Weights to Maximize Information Ratio (Finding Alphas)" Tags="&lt;portfolio-management&gt;&lt;portfolio-optimization&gt;&lt;factor-models&gt;&lt;portfolio-selection&gt;&lt;factor-loading&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35077" PostTypeId="1" CreationDate="2017-07-11T00:48:46.360" Score="-3" ViewCount="397" Body="&lt;p&gt;Below is the stochastic differential equation of the Geometric Brownian Motion:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dS_t = S_t \mu dt + S_t\sigma dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My understanding of the Wiener process is that the volatility component of an asset price is already captured there. Why is $\sigma$ being multiplied with the Wiener process?&lt;/p&gt;&#xA;" OwnerUserId="20191" LastEditorUserId="26595" LastEditDate="2017-07-11T14:31:23.853" LastActivityDate="2017-07-12T05:24:22.403" Title="Geometric Brownian Motion: Why is the Wiener process multiplied by volatility?" Tags="&lt;brownian-motion&gt;&lt;wienerprocess&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35078" PostTypeId="2" ParentId="35077" CreationDate="2017-07-11T01:49:37.713" Score="4" Body="&lt;p&gt;If you examine a &lt;a href=&quot;http://mathworld.wolfram.com/WienerProcess.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;standard definition of a Wiener process&lt;/a&gt;, $W_t - W_0$ follows the normal distribution with mean zero and variance $t$. If you want the variance to be something else, you have to scale it.&lt;/p&gt;&#xA;" OwnerUserId="20582" LastActivityDate="2017-07-11T01:49:37.713" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35079" PostTypeId="1" CreationDate="2017-07-11T03:29:12.857" Score="1" ViewCount="83" Body="&lt;p&gt;I found that the historical data of forward exchange rate is really hard to find, I'm looking for historical data of JPY/USD forward exchange rate, does anyone have experience in this?&lt;/p&gt;&#xA;" OwnerUserId="28766" LastEditorUserId="16148" LastEditDate="2017-07-11T15:50:54.810" LastActivityDate="2017-07-11T15:50:54.810" Title="Forward exchange rate historical data?" Tags="&lt;finance&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35080" PostTypeId="2" ParentId="35076" CreationDate="2017-07-11T03:41:23.990" Score="0" Body="&lt;p&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt; I don't have any of these books, and I don't know for sure what the author is trying to say.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It sounds vaguely like Markowitz portfolio theory applied to returns relative to some benchmark instead of relative to the risk free rate?&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Refresher on classic Markowitz portfolio theory.&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;I will use bold letters to denote vectors. $\boldsymbol{R}$ is a random vector denoting returns of risky assets and $r_f$ is the risk free rate.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Define $\boldsymbol{\mu}_f = \operatorname{E}[\boldsymbol{R} - r_f]$&lt;/li&gt;&#xA;&lt;li&gt;Define covariance matrix $\boldsymbol{\Sigma}_f = \operatorname{Var}(\boldsymbol{R} - r_f)$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Portfolio weights for the &lt;a href=&quot;https://en.wikipedia.org/wiki/Modern_portfolio_theory&quot; rel=&quot;nofollow noreferrer&quot;&gt;tangency portfolio&lt;/a&gt;, the portfolio with the highest &lt;a href=&quot;https://en.wikipedia.org/wiki/Sharpe_ratio&quot; rel=&quot;nofollow noreferrer&quot;&gt;Sharpe ratio&lt;/a&gt;, are given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathbf{w} = \left( \frac{1}{\boldsymbol{1}' \boldsymbol{\Sigma}_f^{-1} \boldsymbol{\mu}_f}\right)\boldsymbol{\Sigma}_f^{-1} \boldsymbol{\mu}_f$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, see &lt;a href=&quot;https://quant.stackexchange.com/questions/8594/derivation-of-the-tangency-maximum-sharpe-ratio-portfolio-in-markowitz-portfol&quot;&gt;derivation here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;A guess of what that the book is trying to talk about?&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;I don't have the book, and this is heavily extrapolation based upon that short passage.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Let $R_b$ be a random variable denoting the return of some benchmark $b$.&lt;/li&gt;&#xA;&lt;li&gt;The author may be using alpha not in the &lt;a href=&quot;https://en.wikipedia.org/wiki/Jensen%27s_alpha&quot; rel=&quot;nofollow noreferrer&quot;&gt;Jensen's alpha&lt;/a&gt; sense (or &lt;a href=&quot;http://www-bcf.usc.edu/~ferson/papers/SDF.PDF&quot; rel=&quot;nofollow noreferrer&quot;&gt;stochastic discount factor alpha&lt;/a&gt; sense) but is calling returns above some benchmark $\boldsymbol{R} - R_b$ alpha?&lt;/li&gt;&#xA;&lt;li&gt;An &lt;a href=&quot;https://en.wikipedia.org/wiki/Information_ratio&quot; rel=&quot;nofollow noreferrer&quot;&gt;information ratio&lt;/a&gt;&#xA;$\frac{\operatorname{E}[R_a - R_b]}{\operatorname{Var}(R_a - R_b)}$&#xA;is just a Sharpe ratio relative to some benchmark $R_b$ instead of&#xA;the risk free rate $r_f$.&lt;/li&gt;&#xA;&lt;li&gt;Define $\boldsymbol{\mu}_b = \operatorname{E}[\boldsymbol{R} - R_b]$ and $\boldsymbol{\Sigma}_b = \operatorname{Var}(\boldsymbol{R} - R_b)$. Then portfolio weights for the maximum information ratio portfolio would be the same $\mathbf{w} = \left( \frac{1}{\boldsymbol{1}' \boldsymbol{\Sigma}_b^{-1} \boldsymbol{\mu}_b}\right)\boldsymbol{\Sigma}_b^{-1} \boldsymbol{\mu}_b$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Portfolio weights aren't proportional to $\boldsymbol{\mu}_b$ though. They aren't a scalar $\lambda$ times $\boldsymbol{\mu}_b$. You apply the linear transformation $\left( \frac{1}{\boldsymbol{1}' \boldsymbol{\Sigma}_b^{-1} \boldsymbol{\mu}_b}\right)\boldsymbol{\Sigma}_b^{-1}$ to $\boldsymbol{\mu}_b$ .&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20454" LastEditDate="2017-07-11T13:03:42.053" LastActivityDate="2017-07-11T13:03:42.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35081" PostTypeId="1" CreationDate="2017-07-11T07:20:57.263" Score="2" ViewCount="187" Body="&lt;p&gt;Suppose I invest in an EUR denominated fund. This fund invests fully in USD stocks and doesn't hedge it's FX exposure (i.e. the EUR value of this fund is just equal to the USD value of the holdings converted to EUR based on the daily rate).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On one hand, I would like to think that since I've invested a EUR amount, my risk-neutral drift should be equal to the EUR risk-free rate. On the other hand, if I look through the fund at the underying assets, then they have a risk neutral drift equal to the USD risk-free rate corrected by the FX forward. Without a xccy basis, that drift would correct the risk neutral drift back to the EUR drift (based on interest rate parity), but in the presence of a xccy basis, that relation breaks down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So which one is correct?&lt;/p&gt;&#xA;" OwnerUserId="11851" LastEditorUserId="11851" LastEditDate="2017-07-11T09:06:42.630" LastActivityDate="2017-07-12T18:28:38.437" Title="Risk neutral drift in presence of xccy basis" Tags="&lt;risk-neutral&gt;&lt;cross-currency-basis&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35083" PostTypeId="2" ParentId="3156" CreationDate="2017-07-11T13:21:07.937" Score="3" Body="&lt;p&gt;Recent benchmarks of KDB+ vs. other big data technologies, Kdb still comes out on top 5, especially considering hardware costs for this particular data set. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;[1.1 Billion Taxi Rides on kdb+/q &amp;amp; 4 Xeon Phi CPUs] &lt;a href=&quot;http://tech.marksblogg.com/billion-nyc-taxi-kdb.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://tech.marksblogg.com/billion-nyc-taxi-kdb.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="842" LastActivityDate="2017-07-11T13:21:07.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35085" PostTypeId="2" ParentId="35076" CreationDate="2017-07-11T14:04:09.170" Score="0" Body="&lt;p&gt;In the &lt;a href=&quot;https://en.wikipedia.org/wiki/Treynor%E2%80%93Black_model&quot; rel=&quot;nofollow noreferrer&quot;&gt;Treynor Black Model&lt;/a&gt; the weights $w_i$ are proportional to the Alpha (the above market expected performance) divided by the idiosyncratic (or residual) variance of the stock: $w_i=\frac{\alpha_i}{\sigma_i^2}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the claimed result is not true unless: the $\sigma_i^2$ are all the same and the holding time is so short that the &quot;forecasted return&quot; is the same as the alpha (e.g. for 1 day the &quot;expected return on the market&quot; is so small that $\alpha_i=R_i-R_{CAPM}$ may be very close to $R_i$, the expected return on the particular stock i from our model). (Or perhaps by &quot;forecasted return&quot; they meant above normal forecasted return).&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2017-07-11T14:04:09.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35086" PostTypeId="1" CreationDate="2017-07-11T14:27:16.787" Score="5" ViewCount="587" Body="&lt;p&gt;In the GS Research Note about &lt;a href=&quot;http://www.emanuelderman.com/writing/entry/more-than-you-ever-wanted-to-know-about-volatility-swaps-the-journal-of-der&quot; rel=&quot;noreferrer&quot;&gt;Volatility Swaps&lt;/a&gt;, it is shown that you can replicate a pure variance exposure (hedge) with only vanilla calls and puts, primarily thanks to the Carr-Madan formula of payoff reconstruction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Derman et al. mention how using the log contract replication is a higher order term replication, so there are times where first and second order terms dominate (and vice versa). This is where the error comes into play.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the same formula used to calculate the VIX index - just in discrete form instead of continuous. &lt;strong&gt;What are the necessary implications of the discrete VIX calculation and this error term, and is there any method that is robust to jumps?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On page 30 of the report, it is mentioned that if the jump is &quot;small enough&quot; it can be considered part of the diffusion and has no impact on the variance. Can &quot;small enough&quot; be quantified a little further?&lt;/p&gt;&#xA;" OwnerUserId="20194" LastActivityDate="2017-07-12T17:49:09.830" Title="Replicating Log Contract - Errors Introduced by Jumps" Tags="&lt;volatility&gt;&lt;swaps&gt;&lt;variance&gt;&lt;vix&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35090" PostTypeId="1" CreationDate="2017-07-12T02:10:53.380" Score="3" ViewCount="406" Body="&lt;p&gt;I am trying to wrap my head around how ETFs that track futures work (whether its USO tracking WTI futures or VXX tracking VIX futures).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have read online about how for normal contango environments, ETFs tracking those futures will lose value over time because of the roll yield (when the nearby futures expires, the fund needs to buy the next month future in order to maintain same exposure, but for normal contango environments, it means that price is generally higher). &lt;a href=&quot;https://quant.stackexchange.com/questions/8853/etf-negative-roll-yield&quot;&gt;ETF Negative Roll Yield&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the article below seems to demonstrate that for the VIX at least, that is not the case. &lt;a href=&quot;https://sixfigureinvesting.com/2016/09/the-cost-of-contango-its-not-the-daily-roll/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://sixfigureinvesting.com/2016/09/the-cost-of-contango-its-not-the-daily-roll/&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In his post, he attributes the loss of the VXX ETF over time not to the actual rolling of the index, but due to the fact that as time goes closer to maturity, the contract will slide down that contago curve, and that movement is the thing that drives price declines. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;In his toy example, if he keeps the term structure the same from day to day, the roll cost doesnt factor into the overall value of his Nov/Dec aggregate because the &lt;em&gt;number&lt;/em&gt; of contract changes but the &lt;em&gt;value&lt;/em&gt; does not. This seems not right? If the ETF is targeting some constant time to maturity exposure, because the overall value split by month is now 84%/16% vs 88%/12%, the &lt;em&gt;value&lt;/em&gt; weighted time to maturity will have changed from day to day. In my mind, dont most funds target this constant maturity? Like if I want constant 30 day exposure. Starting from day 0, I buy nearby expiring 30 days from today. Day 1, I now need to shift 1/30 in value from the nearby contract to the 2nd nearby (which say is now 59 days to expiry), so that my value weighted time to maturity remains at 30 days?&lt;/li&gt;&#xA;&lt;li&gt;If say I were to be long SPY futures, if I simply wanted to roll my exposure from one contract to the next as they expired, my wanting to buy 1 contract each time seems like it will incur a roll cost because I want a constant 1 contract exposure&lt;/li&gt;&#xA;&lt;li&gt;If my understanding of ETFs targeting specific constant maturity is correct, how and when do these ETFs decide to roll their exposures? Ie do they do it at end of day? Also I would imagine, it may be difficult to maintain exact constant maturity because you cant have fractional future contracts, so what error tolerance do they allow?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="17136" LastActivityDate="2017-07-12T02:10:53.380" Title="Is there really a negative roll yield for futures in contango?" Tags="&lt;futures&gt;&lt;yield-curve&gt;&lt;vix&gt;&lt;etf&gt;&lt;roll-adjustment&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="35091" PostTypeId="2" ParentId="35010" CreationDate="2017-07-12T03:15:58.780" Score="1" Body="&lt;p&gt;I have compiled a pretty exhaustive list on my website: &lt;a href=&quot;http://the-world-is.com/blog/resources/general-investor-resources/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://the-world-is.com/blog/resources/general-investor-resources/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Particularly, look under the following headings:&#xA;&quot;Tools&quot; &gt;&gt; &quot;Research Platforms&quot;&#xA;and,&#xA;&quot;Data&quot; &gt;&gt; &quot;Fundamental Financial Data&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a lot resources there to get you started. Personally, I use &lt;a href=&quot;https://www.portfolio123.com/mvnforum/pubprofile?member=primus&amp;amp;sref=18416/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Portfolio123&lt;/a&gt; which might also be appropriate for your purposes. It has several panel-based displays of financial data, some of which are customizable. Moreover, its core data holdings are actually derived from Compustat yet it is much more affordable than purchasing a license to Capital IQ.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this business, you often get what you pay for. I believe that paying a little coin for premium data is well worth the cost, especially since the costs have come down significantly for retail investors.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastActivityDate="2017-07-12T03:15:58.780" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35092" PostTypeId="2" ParentId="35077" CreationDate="2017-07-12T05:24:22.403" Score="0" Body="&lt;p&gt;To understand why $W_t$ is scaled by standard deviation, I think it helps to reference the central limit theorem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assumes $x_1,...,x_n$ are i.i.d. variables with mean, $\mu$, and variance, $\sigma^2$. Then a random sampling $\forall \, x_n \in X$ will converge to the distribution as $n \to \infty$ . In this case, $W_t$ simply represents the process which encompasses all $x$ in a standardized distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \mu dt + \sigma dW_t \sim \ {\mathcal {N}}\left[\mu\,\Delta t,\sigma \sqrt{\Delta t} \right] $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\mathcal {N}$ is cumulative density function.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastActivityDate="2017-07-12T05:24:22.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35094" PostTypeId="2" ParentId="35086" CreationDate="2017-07-12T09:01:35.363" Score="3" Body="&lt;p&gt;The &lt;strong&gt;static replication&lt;/strong&gt; result, i.e. a continuous strip of adequately weighted OTM vanillas can be used to replicate a variance swap, only holds: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;under a &lt;strong&gt;pure diffusion&lt;/strong&gt; assumption&lt;/li&gt;&#xA;&lt;li&gt;if one considers &lt;strong&gt;continously sampled&lt;/strong&gt; realised variance which is the same as the annualised quadratic variation of the logarithm of the price process.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In practice these assumptions are not met due to&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;presence of &lt;strong&gt;jumps&lt;/strong&gt; in the underlying price process (error 1)&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;discretely sampled&lt;/strong&gt; realised variance in the specification of variance swap contracts (error 2)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Anyway, because a continuous strip of options is not practical from a pure trading perspective, it is replaced that by a &lt;strong&gt;finite sum&lt;/strong&gt; (error 3). This is exactly what the VIX formula does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems from your question like you are interested in both errors 1 and 3. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The paper &quot;&lt;em&gt;The Effect of Jumps and Discrete Sampling on Volatility and Variance Swaps&lt;/em&gt;&quot; by Broadie and Jain discuss these, along with error 2, in the context of some particular stochastic volatility with jump model, see section &lt;em&gt;6.1 Effect of jumps on fair variance strikes&lt;/em&gt;. The references cited may also be useful. An electronic copy is available &lt;a href=&quot;http://www.columbia.edu/~mnb2/broadie/Assets/variance_swaps_jumps_200903.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt; for download.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2017-07-12T17:49:09.830" LastActivityDate="2017-07-12T17:49:09.830" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35095" PostTypeId="1" CreationDate="2017-07-12T09:32:32.997" Score="0" ViewCount="227" Body="&lt;p&gt;I've modeled a basic black scholes model in Excel and I have been using it to price European options for backtesting purposes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This has been working fantastically and I would like to adjust this to include an American options pricing function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this possible to modify my Excel? Or is the math too complex for simple Excel formulas to handle?&lt;/p&gt;&#xA;" OwnerUserId="28664" LastEditorUserId="26595" LastEditDate="2017-07-12T15:57:30.847" LastActivityDate="2017-07-12T22:31:49.153" Title="How do I modify my basic black scholes model in Excel to price american options?" Tags="&lt;options&gt;&lt;equities&gt;&lt;black-scholes&gt;&lt;derivatives&gt;&lt;excel&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35097" PostTypeId="2" ParentId="35043" CreationDate="2017-07-12T10:23:15.067" Score="1" Body="&lt;p&gt;Most banks consider this convexity too small to worry about.  A typical approach is to model a mtm basis swap using notionals that correspond to the fx forward rates for each period.  Every day these notionals are adjusted for moves in fx.  If there were significant convexity effects, those adjustments would cause a material pnl, but I haven't seen that in practice.   &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-07-12T10:23:15.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35100" PostTypeId="1" CreationDate="2017-07-12T13:42:12.657" Score="1" ViewCount="983" Body="&lt;p&gt;I am looking at AAPL TAQ high-frequency trade data from NYSE and I have noticed that at several places the trade price (defined in Daily TAQ Client Specification as: &quot;The Trade Price is the monetary value of an individual share of security at the time of the trade.&quot;) is quoted with three decimal digits. However, the TAQ quote data file does not contain quotes with three decimal digits, only two are present (as the minimal tick value for AAPL is 0.01$). Therefore, I am perplexed how to interpret the trades represented by three decimal digits, as there are no corresponding quotes at those prices. My question is, what is the reason behing this discrepancy?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: The sample trades can look like this: [time in nanoseconds, exchange, stock, ..., trade size, trade price, ...]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;113750721732148 Y MSFT ... 100 60.55 ...&lt;br&gt;&#xA;113750722078102 V MSFT ... 19 60.545 ...&lt;br&gt;&#xA;113750746289535 K MSFT ... 100 60.55 ...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And for example, at 113748385546534 there was a trade with trade price 60.54. So trades fluctuate between the best bid and best ask prices, but there is this trade that is within the spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source: NYSE TAQ trade sample data available here &lt;a href=&quot;ftp://ftp.nyxdata.com/Historical%20Data%20Samples/Daily%20TAQ%20Sample/&quot; rel=&quot;nofollow noreferrer&quot;&gt;ftp://ftp.nyxdata.com/Historical%20Data%20Samples/Daily%20TAQ%20Sample/&lt;/a&gt;.&#xA;I am talking about AAPL trades in a file EQY_US_ALL_TRADE_20161024 and AAPL quotes in a file SPLITS_US_ALL_BBO_A_20161024.&lt;/p&gt;&#xA;" OwnerUserId="27163" LastEditorUserId="27163" LastEditDate="2017-07-14T12:08:43.567" LastActivityDate="2018-07-04T01:55:59.617" Title="Trade price in high-frequency TAQ data" Tags="&lt;high-frequency&gt;&lt;market-microstructure&gt;&lt;tick-data&gt;&lt;nyse&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="35103" PostTypeId="2" ParentId="25905" CreationDate="2017-07-12T18:06:26.060" Score="0" Body="&lt;p&gt;There is a theoretical answer to your question.  Actually, there are two of them.  The first is that if there is a grounded, theoretical reason for one to be superior to the other, then that is the answer.  Of course, if there were, this post wouldn't be sought.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you have multiple models, the only solution lies in Bayesian statistics.  The standard implementation for either of these in most financial literature is through the AIC or the BIC, which is closer to a summary statistic that a complete answer.  It is uncommon in finance to search for the full-blown Bayesian solution as it will tend to match the AIC or BIC.  The AIC and BIC could be thought of as stylized Bayesian solutions with restrictive assumptions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am going to extend the discussion because a good grounding in Bayesian methods is a fundamental skill for those who use statistical methods and this tends to be lacking in finance and economics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, it is important to understand that Pearson and Neyman's Frequentist school of thought is grounded in a different set of axioms than Bayesian methods.  They tend to be constructed inside &quot;measure theory.&quot;  Measure theory is the mathematical study of measurement where you allow infinitesimals in your math.  If you do not, then you cannot use the real numbers.  You are seeking several things in the Frequentist school.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, you are seeking a parameter estimation algorithm that has good qualities such as consistency and unbiasedness.  You are also trying to minimize the variance in the estimate among the set of all possible estimators that meet your other property requirements.  This statistic, or set of statistics as in the case of multiple regression, is paired with a hypothesis, the null hypothesis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The null hypothesis is used to generate the sample space.  This is the set of all possible samples that could happen, given the null is true.  Then, at least conceptually, the set of all possible sample statistics is created from the set of samples.  This is the sampling distribution of the statistic and is the statistical test you use.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This contrasts with Bayesian methods.  Bayesian methods can be constructed from a variety of axiom systems.  The three biggest are de Finetti's, Savage's and Cox's.  Each is important to finance in their own right.  The method of de Finetti could be described as the defining axioms of the entire field of finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;He begins with a bookie, an event, and a gamble.  He defines a coherent statistic as a statistic such that the bookie cannot be forced to take a sure loss in all states of the world.  This is a weaker constraint than the no arbitrage constraint.  It simply says the market maker cannot be gamed, but it does not say a market maker or financial institution cannot game a naive investor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Probability and utility do not exist in his thinking.  Only a bookie, an event, and a gamble exist.  Probability and utility are derived from this.  His argument is that probability is a mental calculation that we do to makes sense of reality, but which is not part of reality itself.  The same is true for utility.  It may reflect internal brain processes that we then define as preferences, but the argument is that the brain processes are real, but utility is not.  Utility is us trying to make sense of the world.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because of these axioms, anyone using them can be sure that their stated probabilities can be gambled on.  This is never true of a Frequentist gamble.  Frequentist statistics can never be gambled on because you can always game a Frequentist bookie.  Hence, any Frequentist mean-variance finance model is always stochastically dominated by Bayesian decision theory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If mean-variance finance were valid, and I have argued in papers that it cannot be, then it would only be valid for scientific purposes. You could never bet money on the results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Savage does not take the tack of de Finetti.  Instead, he derives utility and probability from cognitive preferences alone.  This creates a purely personalistic set of statistics.  You have yours.  I have mine.  They are incredibly powerful.  They force you to acknowledge in a disciplined manner that we have different knowledge, data, experiences, and preferences and put them into the open so we can explore the scientific space.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cox's axioms are derived from set theory and Venn diagrams with function theory. His method is built around beliefs about logical statements.  This is powerful.  Do you believe the CAPM is better than the Fama-French model?  How much?  You assert logical claims, and they are tested with data.  A probability is a statement of how much belief you should have in an idea.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this seems long and convoluted for an answer, then you understand why people say &quot;I'll just use the AIC.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I bring the axioms up because they will ground you for what you want to do, at least at a deeper level.  The statement, &quot;the CAPM is better than the Four Factor Model,&quot; is a logical assertion that can be tested.  Further, as the method would be identical to de Finetti's, you can also gamble money on the outcome.  It is more than just saying &quot;the AIC is better for the CAPM.&quot;  It is a tested logical assertion that a gamble can be placed on.  However, as per Savage, you have to state your beliefs in an open and public forum about how you are constructing your problem so that it can be torn apart by all who disagree with you and in the best of cases, described in a way your opponents could test their own beliefs using your data.  This can be operationalized through Bayes factors as a table.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now as to the operational aspects.  In Bayesian methods data are not random.  It cannot be random.  You saw it.  It is a fact.  A fact cannot be random.  An observation is a fixed thing.  The explanation of the fact is what you are uncertain about.  Randomness is not chance in Bayesian understanding; it is uncertainty.  In Bayesian thinking, parameters are random variables meaning there is uncertainty as to their true value.  Since there is uncertainty regarding the explanation of the facts, the explanation is random.  Let that sink it a second.  It goes against your training.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Indeed, there was a debate in Bayesian statistics about taking random samples, as is required in Frequentist thought because it imposes a mathematical function on nature that is not found in the data generating function itself.  It was later proved this was a harmless imposition on the data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you need to do is construct a probability statement regarding each model.  That is to say, you need to solve $$\Pr(model=CAPM|data)$$ versus $$\Pr(model=Fama-French|data.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is done through Bayes theorem.  You would begin by assigning prior probabilities over each parameter and model.  To do this, you would research prior articles in other countries on likely values and create a statistical distribution of these observed parameters.  It won't be exact, of course, but neither are sampling statistics.  You would create some functional form for each parameter and model.  Models are treated as parameters here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you would assign a likelihood function to the data generation process.  The likelihood looks like a density function, but it isn't the same.  For i.i.d. variables, if $$\frac{1}{\pi}\frac{1}{1+(x-\mu)^2},\forall{x}\in\chi$$ is your density function, then $$\frac{1}{\pi}\frac{1}{1+(x-\mu)^2},\forall{\mu}\in\Theta$$ is your likelihood function, where $\chi$ is your sample space and $\Theta$ is your parameter space.  In a likelihood function, $x$ is not random, $\mu$ is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then over the entire model space and parameter space, you would multiply the prior by the likelihood.  This would give you the numerator of Bayes theorem.  Summing over the models and integrating over the parameters would give you the denominator.  This gives you the posterior density function.  For the CAPM it would be: $$\Pr(model=CAPM;\beta;\alpha;\sigma|data),$$ where $\sigma$ is the uncertainty of the model over the data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, this is not what you asked for. You want to know $$\Pr(model=CAPM|data).$$  $\beta,\alpha$ and $\sigma$ are called &quot;nuisance parameters.&quot;  A nuisance parameter is any parameter that you do not care about, but which you have to calculate to solve your problem.  They are removed through a process called marginalization.  The $$\Pr(model=CAPM|data)=\int\int\int\Pr(model=CAPM;\beta;\alpha;\sigma|data)\mathrm{d}\beta\mathrm{d}\alpha\mathrm{d}\sigma.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While this long process may not seem worth it, Bayesian methods do something that Frequentist methods cannot do, they can make predictions about future events.  Once the events have happened, you can the &quot;score&quot; the predictions based on the future data.  So, even if you find that the CAPM was the best model, it may score terribly.  It may be the best of the three models over the data set, but it may be useless out of sample implying there is another model that you have not considered.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generically, where $x$ is data and $\tilde{x}$ is future data, the Bayesian predictive distribution is $$\Pr(\tilde{x}|x)=\int_\theta\Pr(\tilde{x}|\theta)\Pr(\theta|x)\mathrm{d}\theta.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if you noticed I didn't tell you how to calculate this, it is because that takes you over to the world of textbooks.  I strongly recommend William Bolstad's Introduction to Bayesian Statistics.  Its ISBN is 1118091566.  He also has a book on computational methods that is a graduate text that follows on this text which is mostly restricted to problems with analytic solutions.  You should also get a copy of Parmigiani's Decision Theory: Principles and Practices.  Its ISBN is 047149657X.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Frequentist methods cannot solve this because the null hypothesis is that your model is the true model.  You cannot test among possible true models, because for the null to work, you have to start with it.  The Bayesian method tests how likely a model is near the model in nature.  It does not make the rather arrogant assertion, &quot;I know the true model.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The hidden advantage of using a Bayesian method is exactly when your model is wrong.  Imagine you had a model where people were hypothesized to behave in a certain way.  What you do not know is that they behave one way when it rains and another when it is sunny.  The Bayesian posterior probability when have two modes because it would pick up the lurking variable.  You would end up with, in practice, two covariance matrices and two sets of parameters.  The Frequentist would average them out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now it can be the case that a multimodal parameter is due to a statistical run and you cannot test the difference between these two possibilities, but it gives you a warning to investigate.  The posterior density warns you when things are wrong with your model because it will look wrong.  Of course it takes skill and practice to know what it &quot;should&quot; look like.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The AIC and the BIC say &quot;choose this model.&quot;  Bayesian scoring says &quot;wow, that was the best model, but boy is it bad.&quot;&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2017-07-12T18:06:26.060" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35104" PostTypeId="2" ParentId="22830" CreationDate="2017-07-12T20:53:02.653" Score="1" Body="&lt;p&gt;The expected value approach through integration essentially restates the expectation using the heat diffusion equation (i.e., with boundary condition $0$). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The true insight of B-S was not that the fair value of an option is the expected value of the posterior distribution, but rather that the &quot;correct&quot; distribution is the &quot;risk-neutral&quot; one. B-S's dynamic hedging argument eliminated the drift(s) -- thus the &quot;risk-neutral&quot; distribution. Having established the B-S PDE, B-S solve the equation by the standard convolution method for a diffusion equation. This is essentially what you have done above, without deriving a PDE. In fact, the rules of stochastic integration (Ito's Lemma, Kolmorgov, Giransov, etc...) are merely simplified restatements which were derived from measure theory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This approach reminds me of an interesting post which restates the expected value approach graphically, and extends options analysis to product development and R&amp;amp;D. Read it here: &lt;a href=&quot;http://blackswanfarming.com/product-development-payoff-asymmetry/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://blackswanfarming.com/product-development-payoff-asymmetry/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26547" LastActivityDate="2017-07-12T20:53:02.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35105" PostTypeId="2" ParentId="35095" CreationDate="2017-07-12T22:31:49.153" Score="1" Body="&lt;p&gt;If you don't need particularly good accuracy you might try the Whaley approximation.  Here's the &lt;a href=&quot;http://www.javaquant.net/papers/Barone-Adesi-Whaley.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;original paper&lt;/a&gt; and an   &lt;a href=&quot;https://software.intel.com/en-us/articles/recipe-pricing-options-using-barone-adesi-whaley-approximation&quot; rel=&quot;nofollow noreferrer&quot;&gt;implementation in code&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The approximation requires you to run a few numerical iterations to solve a transcendental equation.  In practice 10 is always enough so you can just create 10 cells side by side with successive iterations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I strongly recommend against using the results for any kind of trading.  The approximation will not be good enough no matter how many iterations you run.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2017-07-12T22:31:49.153" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35106" PostTypeId="1" AcceptedAnswerId="35108" CreationDate="2017-07-12T23:14:59.523" Score="0" ViewCount="1119" Body="&lt;p&gt;For an event study, can anyone explain me the &lt;strong&gt;daily value weighted return&lt;/strong&gt; for a benchmark and the &lt;strong&gt;equally weighted return size adjusted&lt;/strong&gt; for measuring the EARs and how to calculate both weights?&#xA;Regards,&lt;/p&gt;&#xA;" OwnerUserId="26672" LastEditorUserId="16160" LastEditDate="2017-07-12T23:29:22.813" LastActivityDate="2017-07-13T02:30:03.347" Title="Daily value weighted return and equally weighted size adjusted" Tags="&lt;portfolio-management&gt;&lt;market-data&gt;&lt;anomalies&gt;&lt;event-study&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35107" PostTypeId="1" AcceptedAnswerId="35112" CreationDate="2017-07-12T23:27:56.713" Score="2" ViewCount="4273" Body="&lt;p&gt;In &lt;a href=&quot;http://jaeckel.16mb.com/QuantoSkew.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;this paper (Quanto Skew, by Jackel)&lt;/a&gt;, on second page, the author states:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;a) Determine an effective volatility coeffcient $\hat \sigma$ exactly&#xA;  as in (2) using the forward as if the option&#xA;  was entirely domestic. Subsequently, price the&#xA;  quanto option with Black's formula replacing the&#xA;  forward $F$ by $F^{'}$ as given in (1). &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What does the author mean with &quot;using the forward as if the option&#xA;was entirely domestic&quot;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that the idea is to calibrate a model (let's use the Heston model for example, as I know it) against market data in order to get an &quot;effective volatility&quot; and then apply standard Black-Scholes equation using the modified Forward and this &quot;effective volatility&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But which market data do I use? The underlying asset is quoted in FOR currency. Do I get all the foreign vanilla options on this asset to calibrate the model? And then how do I derive the &quot;effective volatility&quot; from the calibrated model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT - Question 2&lt;/strong&gt;&#xA;On page 4 the author says that the DFAQ case is the applciation of equation 6. But on page 2 he had said that it is the application o Black's formula, using the effective volatility and the forward $F^{'}$. Even more confusing is that also on page 4 he says that for the DFAQ case one should take $F=S_0$ and not $F=F^{'}$ as expected. Could you please clarify what the author is stating?&lt;/p&gt;&#xA;" OwnerUserId="25437" LastEditorUserId="25437" LastEditDate="2017-07-13T22:01:18.297" LastActivityDate="2017-07-13T22:01:18.297" Title="Common Quanto adjustment" Tags="&lt;option-pricing&gt;&lt;volatility&gt;&lt;skew&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35108" PostTypeId="2" ParentId="35106" CreationDate="2017-07-13T00:58:55.967" Score="1" Body="&lt;p&gt;&quot;Size adjusted return for company X&quot; on day t is defined as the return of company X on day t minus the equal weighted return of all stocks in the same size decile as company X. So for example if company X is in the third NYSE size decile, you average together the returns of all third size decile companies (whether NYSE or not) on day t and you subtract this from the return of company X.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have several companies X, Y, Z, etc. then the &quot;equal weighted size adjusted return&quot; means you average together the size adjusted returns (computed as described above) for the companies X, Y, Z, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &quot;value weighted return&quot; for companies X, Y, Z, etc. is a weighted average of the returns of these companies, where the weights are the market capitalizations (price times shares outstanding) of these companies and the denominator is the total market capitalization of all included companies.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2017-07-13T02:30:03.347" LastActivityDate="2017-07-13T02:30:03.347" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35109" PostTypeId="1" AcceptedAnswerId="35110" CreationDate="2017-07-13T01:52:26.617" Score="1" ViewCount="113" Body="&lt;p&gt;I am working with the AUD/USD forex pair for my master's thesis (not in finance, hence I'm asking such a simple question). I am wondering if it's proper usage of the word 'financial asset' to refer to the AUD/USD forex pair.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The financial asset used in this thesis is the AUD/USD foreign exchange price, between the years of 1990 and 2000.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Wikipedia's 'financial asset' page lists currency as one of the things it can mean, however I'm unsure if that applies to forex prices like in this context. &lt;/p&gt;&#xA;" OwnerUserId="28606" LastActivityDate="2018-01-07T23:24:01.870" Title="Does it make sense to refer to a forex pair as a 'financial asset'" Tags="&lt;terminology&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35110" PostTypeId="2" ParentId="35109" CreationDate="2017-07-13T02:13:37.127" Score="4" Body="&lt;p&gt;You have 2 contracts AUD/USD and USD/AUD, one is to buy AUD with USD, the other is buying USD with AUD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The currency itself is an asset, however the use of the word &lt;em&gt;pair&lt;/em&gt; could be misleading since you do not buy the pair. So, the word financial asset could be used in reference to buying AUD with USD in the same way as buying APPL with USD. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe this sounds better...&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The financial asset used in this thesis is the AUD/USD foreign exchange &lt;strong&gt;contract&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="26256" LastEditorUserId="26595" LastEditDate="2017-07-13T10:04:33.307" LastActivityDate="2017-07-13T10:04:33.307" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35111" PostTypeId="2" ParentId="35109" CreationDate="2017-07-13T10:45:16.883" Score="1" Body="&lt;p&gt;Financial asset is the Aussie dollar bill or coin. If your numeraire happens to be the US dollar, then the FX rate is the market value of the financial asset denominated in units of the numeraire. &lt;/p&gt;&#xA;" OwnerUserId="11610" LastActivityDate="2017-07-13T10:45:16.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35112" PostTypeId="2" ParentId="35107" CreationDate="2017-07-13T11:13:18.923" Score="3" Body="&lt;p&gt;First of all, quanto options (options denominated in FOR currency but whose value we wish to determine is in DOM currency) are mainly traded over-the-counter, hence their prices are not likely available, as opposed to non-quanto options (options denominated in DOM currency with payoff also in DOM currency) for wich we have some quotes. The idea of the methodology presented by Jackel is to use the later to determine the price of the former.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding your questions:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;What does the author mean with &quot;using the forward as if the option was&#xA;  entirely domestic&quot;?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The author means to derive/calibrate an implied volatility while forgetting about the quanto feature (i.e. you only focus on the skew of the domestic currency, DOM, and not of the skew of the FX rate DOM/FOR). &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;But which market data do I use? The underlying asset is quoted in FOR&#xA;  currency. Do I get all the foreign vanilla options on this asset to&#xA;  calibrate the model? And then how do I derive the &quot;efficient&#xA;  volatility&quot; from the calibrated model?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For the implied volatility calibration, just use options data on options written in DOM currency (European or American options without quanto feature, e.g. call &amp;amp; put options written on the S&amp;amp;P 500 (in USD) with a payoff in USD and quoted in USD) as they will give you the skew you are interested in (i.e. DOM currency). Using such data, derive your &quot;efficient volatility&quot; using usual models (Heston, CEV, ...).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you have your &quot;efficient volatility&quot; $\hat{ \sigma}_{DOM}$ smile, you can extract the at-the-money volatility (or more generally, the volatility corresponding to the moneyness of the option you want to price) and your quanto option price will be computed as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ C_{quanto}(F',K,\hat{ \sigma}_{DOM},r,T)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $ C_{quanto}$ is the Black 76' formula for pricing an option with strike $K$, interest rate $r$ and time-to-maturity $T$. $F'$ is the so-called effective forward capturing the quanto feature derived from equation (1):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$F' = F \exp (\hat{c}) = F \exp \left(\hat{ \sigma}_{DOM} \cdot \rho \cdot \hat{\sigma}_{FOR} \cdot T\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The FX volatility $\hat{ \sigma}_{FOR}$ is determined similarly to $\hat{ \sigma}_{DOM}$ using available options from the market written on the DOM/FOR FX rate. Again, the author suggests to extract the at-the-money volatility. Of course, it is not likely that you find an &quot;exact&quot; at-the-money&quot; option in the market as the underlying price moves constantly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; In my answer, I suggested that you calibrate a smile before extracting the ATM volatility. Of course it is your choice to assume which volatility model to use: you can assume a flat volatility taken from the available option which is the closest to the ATM region. I suggested a calibration to generalize the methodology to non-ATM options by building a smile and then extract the volatility at the desired moneyness level.&lt;/p&gt;&#xA;" OwnerUserId="26595" LastEditorUserId="26595" LastEditDate="2017-07-13T13:44:49.027" LastActivityDate="2017-07-13T13:44:49.027" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="35113" PostTypeId="2" ParentId="35067" CreationDate="2017-07-13T13:06:42.057" Score="1" Body="&lt;p&gt;The problem was a missing $W_t$ in the equation for correlation. I've updated the above code and did a rerun. We have now the following allocation which is much closer to the Infanger paper.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; solmat&#xA;           US Stock  Int Stocks Corp Bonds    Gvnt Bond         Cash&#xA;50000  5.043872e-01 0.089871441 0.40574133 2.745030e-08 1.788550e-09&#xA;55000  4.050341e-01 0.090625580 0.50434024 2.744996e-08 1.788417e-09&#xA;60000  3.222272e-01 0.091347143 0.58642565 2.744972e-08 1.788325e-09&#xA;65000  2.521815e-01 0.091750138 0.65606829 2.744945e-08 1.788218e-09&#xA;70000  1.920722e-01 0.092167629 0.71576010 2.744928e-08 1.788152e-09&#xA;75000  1.401952e-01 0.092551771 0.76725296 2.744917e-08 1.788109e-09&#xA;80000  9.542976e-02 0.092965569 0.81160464 2.744770e-08 1.787578e-09&#xA;85000  5.926248e-02 0.085949047 0.77256462 2.548693e-10 8.222386e-02&#xA;90000  2.556086e-02 0.042435548 0.35690767 2.546768e-10 5.750959e-01&#xA;95000  5.666367e-07 0.007460414 0.02786258 1.724982e-12 9.646764e-01&#xA;1e+05  4.086260e-03 0.018524853 0.14238886 1.318764e-04 8.348682e-01&#xA;105000 4.229705e-03 0.021298108 0.33601246 1.319004e-04 6.383278e-01&#xA;110000 4.261748e-03 0.022020057 0.49978208 1.319047e-04 4.738042e-01&#xA;115000 1.014474e-02 0.042426599 0.62859439 3.219158e-03 3.156151e-01&#xA;120000 1.040348e-02 0.046451692 0.76095787 3.218435e-03 1.789685e-01&#xA;125000 1.308464e-02 0.132081249 0.79793418 3.218537e-03 5.368139e-02&#xA;130000 1.429210e-02 0.239570571 0.72417454 3.105067e-03 1.885772e-02&#xA;135000 1.471366e-02 0.313967841 0.65235180 3.064252e-03 1.590244e-02&#xA;140000 1.492658e-02 0.369961444 0.59727148 3.044485e-03 1.479601e-02&#xA;145000 1.506062e-02 0.416426483 0.55128612 3.032353e-03 1.419442e-02&#xA;150000 1.515564e-02 0.456708072 0.51130955 3.023891e-03 1.380285e-02&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="17133" LastActivityDate="2017-07-13T13:06:42.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35116" PostTypeId="2" ParentId="34801" CreationDate="2017-07-13T16:40:08.597" Score="1" Body="&lt;p&gt;Have a look in the introduction of the book of @lehalle and Laruelle: Market Microstructure in Practice, there is an excellent overview in tabular form. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Lehalle, Charles-Albert, and Sophie Laruelle, eds. Market microstructure in practice. World Scientific, 2013.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="16249" LastActivityDate="2017-07-13T16:40:08.597" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35118" PostTypeId="2" ParentId="34675" CreationDate="2017-07-13T19:49:36.193" Score="-2" Body="&lt;p&gt;The &lt;a href=&quot;https://www.erisfutures.com/traderscorner&quot; rel=&quot;nofollow noreferrer&quot;&gt;Traders Corner at the Eris Exchange&lt;/a&gt; is a good source of information.  Also, Eris makes a lot of OIS data available on their FTP site. This doesn't answer your question directly, but the Traders Corner seems to have more stuff every time I look at it, and Eris itself is a great resource.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to the Eris website, they receive their OIS curves from CME Clearing, i.e. these are the rates that the clearing house uses to value the instruments in members' portfolios.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the fixed rates, you could probably infer these from the settlement prices for swap futures.  The majority of swaps are now cleared, and the settlement teams at major exchanges (like CME, for example) can draw on market data from beyond their own exchanges, especially on thinly traded products.  The settlement price methodology is typically published in the exchange rulebook (or at least somewhere on their website).  &lt;/p&gt;&#xA;" OwnerUserId="28802" LastEditorUserId="28802" LastEditDate="2017-07-13T19:57:49.430" LastActivityDate="2017-07-13T19:57:49.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35119" PostTypeId="2" ParentId="35060" CreationDate="2017-07-14T03:31:32.240" Score="1" Body="&lt;p&gt;The answers above address the issue of which probability measure should be used when calculating the expected value of a call option under Black-Scholes assumptions. For perspective, you should also review a text like Musiela and Rutkowski.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you would like to see the detailed calculation, I have worked through it using Mathematica. See &lt;em&gt;ntgladd.com&lt;/em&gt;,  tab = &lt;em&gt;Finance&lt;/em&gt;, section = &lt;em&gt;Black-Scholes Formalism&lt;/em&gt; notebook = &lt;em&gt;17-9 Derivation of Black-Scholes formula by calculating an expectation&lt;/em&gt;. The same formula is derived from the Black-Scholes PDE in &lt;em&gt;17-10 Solving BS PDE for call option&lt;/em&gt;. &lt;/p&gt;&#xA;" OwnerUserId="28807" LastActivityDate="2017-07-14T03:31:32.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35123" PostTypeId="1" CreationDate="2017-07-14T10:33:04.917" Score="3" ViewCount="694" Body="&lt;p&gt;There is this &lt;a href=&quot;https://en.wikipedia.org/wiki/Stock_market_cycles&quot; rel=&quot;nofollow noreferrer&quot;&gt;Wikipedia article&lt;/a&gt; on cycles in stock market data, which describes a 5-step process of finding dominant cycles in price data where step 2 reads:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Step 2: Subsequently, a cycles engine performs a spectral analysis&#xA;  based on an optimized Discrete Fourier Transform (DFT) and then isolates&#xA;  those cycles that are repetitive and have the largest amplitudes.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now here is the issue: when looking at the amplitude spectrum of DFT of a time series it may make sense, but then what about the phase of the corresponding components? Let me illustrate my issue with the example. Let's say I calculate DFT of the signal from around 4k samples, so there is a very fine resolution of the high frequency/low period components. In the amplitude spectrum using numerical or visual methods I find a local maximum at 1.04 (row #349, column 'amp'):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;                               coeff      freq         w       amp        ph    c     period&#xA;347  (-341.737858288+1419.41730018j)  0.079899  0.502018  0.672335  1.807059  0.0  12.515850&#xA;348    (385.34656135-2047.44320284j)  0.080129  0.503465  0.959425 -1.384764  0.0  12.479885&#xA;349  (-1137.33333723+1957.67508513j)  0.080359  0.504912  1.042630  2.097099  0.0  12.444126&#xA;350   (969.672144511-1569.38982154j)  0.080589  0.506358  0.849546 -1.017344  0.0  12.408571&#xA;351  (-914.401398452+857.116113024j)  0.080820  0.507805  0.577162  2.388520  0.0  12.373219&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Fmswy.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Fmswy.png&quot; alt=&quot;A slice of the amplitude spectrum&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So there is a peak with the top at 1.04 corresponding to the cycle with the period of 12.44 samples (in this very case 1 sample = 1 day) and if I follow the guidelines from the article [&lt;a href=&quot;https://en.wikipedia.org/wiki/Stock_market_cycles&quot; rel=&quot;nofollow noreferrer&quot;&gt;1&lt;/a&gt;] I should select this cycle as (one of) the dominant in the price data. But what about its nearest neighbors in the amplitude spectrum? One can see that the 5 consecutive cycles with the top one in the middle that have significant amplitudes, but much different phases (the 'ph' column in the table above, values are in radians). If I select and plot the top one only I will get a simple sine wave, but if I add 2 or 4 neighbors the plot will be more complicated with amplitude reaching way above 1.04 up to the sum of all composite amplitudes when the cycle tops come in sync as pictured in the figure below where the top subplot is showing the top cycle, the middle one the sum of the top cycle and 2 nearest neighbors, and the bottom one the the sum of the top cycle and 4 nearest neighbors:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/xBY9p.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/xBY9p.png&quot; alt=&quot;1, 3 and 5 cycles&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apparently the middle and bottom plots are very different from the top one, so I'm wondering how such issue should be dealt with? Perhaps the envelope could be used as the dominant cycle instead? If the phase angles were not so spread out, maybe a cycle of an average phase could be fitted in, but what can be done about the cycles that have similar amplitudes and frequencies, but much different phases?&lt;/p&gt;&#xA;" OwnerUserId="28654" LastActivityDate="2017-07-14T10:33:04.917" Title="Stock market cycles with Fourier Transform - amplitude vs. phase" Tags="&lt;digital-signal-processing&gt;&lt;wavelet&gt;&lt;fourier-transform&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35125" PostTypeId="2" ParentId="33948" CreationDate="2017-07-14T13:57:01.687" Score="5" Body="&lt;p&gt;The graph you attached suggests that you were trying to find swings between major highs and lows. This can be done by simply finding local extrema in the price series. The concept is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;find local extrema: minima in Low prices, maxima in High prices;&lt;/li&gt;&#xA;&lt;li&gt;find local extrema in the results, if swings are too short;&lt;/li&gt;&#xA;&lt;li&gt;repeat #2 until satisfied with the results.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This is the Python code to do that using Pandas data frame and Numpy's argrel* functions to locate relative extrema in series:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import pandas as pd&#xA;import numpy as np&#xA;from scipy.signal import argrelmin, argrelmax&#xA;&#xA;N = 3 # number of iterations&#xA;df = pd.read_csv('prices.csv') # load your stock prices in OHLC format&#xA;h = df['High'].dropna().copy() # make a series of Highs&#xA;l = df['Low'].dropna().copy()  # make a series of Lows&#xA;for i in range(N):&#xA;        h = h.iloc[argrelmax(h.values)[0]] # locate maxima in Highs&#xA;        l = l.iloc[argrelmin(l.values)[0]] # locate minima in Lows&#xA;        h = h[~h.index.isin(l.index)] # drop index that appear in both&#xA;        l = l[~l.index.isin(h.index)] # drop index that appear in both&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then it's up to you what to do the resulting series, ie. you can use the indexes to slice your price data into swing segments or make a new series from h and l values and interpolate in between if you need just numbers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's the example how this code worked on the price date of some undisclosed stock. The OHLC candlesticks were plotted in blue and the swing series in green. The swing series on the top subplot resulted after 1 iteration and the one on the bottom subplot resulted after 5 iterations:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/sKh5q.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/sKh5q.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first iteration results stick very closely to the candlesticks, but the fifth iteration seem to capture the bigger swings. The accuracy is of course debatable, but in my opinion this method can be a good starting point for trend analysis. There is plenty of ways to improve it, ie.: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;add smoothing to the input High/Low price series;&lt;/li&gt;&#xA;&lt;li&gt;make sure that the results alternate from min to max to min, so there are no clusters of minima or maxima in the series like it occurred twice in the bottom chart of the example above;&lt;/li&gt;&#xA;&lt;li&gt;find ways to automatically adapt the number of iterations to achieve the needed results, etc...&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="28654" LastEditorUserId="28654" LastEditDate="2017-07-28T18:34:15.690" LastActivityDate="2017-07-28T18:34:15.690" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35126" PostTypeId="1" CreationDate="2017-07-14T15:00:55.950" Score="1" ViewCount="21338" Body="&lt;p&gt;I have a file where I easily export real-time prices to excel using the Bloomberg Add-In, using the formula BDP. Is there a way to get these prices of a specific time? &#xA;For example, =BDP(&quot;EURGBP Curncy&quot;, &quot;Bid&quot;) gives the real-time Bid price. How can I change it to give the Bid price of today 3pm specifically?&lt;/p&gt;&#xA;" OwnerUserId="28818" LastActivityDate="2021-04-25T10:25:51.800" Title="Price at Specific Time from Bloomberg" Tags="&lt;data&gt;&lt;bloomberg&gt;&lt;excel&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35129" PostTypeId="2" ParentId="35126" CreationDate="2017-07-14T16:07:57.907" Score="2" Body="&lt;p&gt;BDP() is for current data, to get past data at a specific time or range of times you use BDH() (where H refers to Historical Data) &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Try for example &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;=BDH(&quot;EURGBP Curncy&quot;,&quot;Last Price&quot;,&quot;7/13/2017 3:00:00 PM&quot;,&quot;7/13/2017 3:00:01 PM&quot;,&quot;BarTp=T,BarSz=1,Fill=P&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This will search the time interval from 3:00:00 and 3:00:01 and give you the price of the last trade in that interval, in other words the most recent price as 3:00:01. (It will be blank if there are no trades at all in that interval (unlikely), which you would need handle with IF statements etc.).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With BarTp=b or BarTp=a you can get the bid or ask instead of the last trade.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-07-14T18:38:39.737" LastActivityDate="2017-07-14T18:38:39.737" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35132" PostTypeId="1" CreationDate="2017-07-14T19:09:08.047" Score="0" ViewCount="161" Body="&lt;p&gt;Suppose in computing weight of evidence based on &lt;a href=&quot;https://quant.stackexchange.com/questions/15985/credit-rating-or-probability-of-default-from-financial-ratios&quot;&gt;financial ratios&lt;/a&gt; of some bank, one finds that their debt ratio and equity ratio have largely (you pick how large I guess) differing weights of evidence. This does not violate the modigliani miller theorem because of its highly unrealistic assumptions, but how might MMT be relevant? Or is it completely irrelevant?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Oh and the point of computing weight of evidence is for building a logistic regression model to &lt;a href=&quot;https://en.wikipedia.org/wiki/Credit_scorecards&quot; rel=&quot;nofollow noreferrer&quot;&gt;estimate probability of default&lt;/a&gt; for the banks' clients.&lt;/p&gt;&#xA;" OwnerUserId="7788" LastActivityDate="2017-07-15T23:40:59.693" Title="What relevance might the Modigliani-Miller theorem have for weight of evidence?" Tags="&lt;regression&gt;&lt;finance-mathematics&gt;&lt;modeling&gt;&lt;economics&gt;&lt;default-probability&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35135" PostTypeId="1" CreationDate="2017-07-15T00:25:48.297" Score="2" ViewCount="513" Body="&lt;p&gt;I'm attempting to optimize a reinforcement learning system to maximize risk adjusted returns. I have currently defined the reward as the differential Sharpe ratio at each step: the influence of the return at time t on the cumulative Sharpe ratio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This was defined in &lt;a href=&quot;https://pdfs.semanticscholar.org/93b8/17deef9dd5afc66ccf43174a07ddaa49854f.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; paper [Reinforcement Learning for Trading, by John &#xA;Moody and Matthew Saffell, NIPS, 1999], however I am interested in maximizing Sortino ratio instead. The assets I am trading are highly volatile but also heavily skewed towards positive returns; the Sharpe ratio of the strategy is only 2.5 but the Sortino is ~11. So, maximizing for Sharpe here doesn't make much sense. The derivation of this differential Sharpe ratio is:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/mId6p.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/mId6p.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to adapt this only take into account the variance of my downside risk. Any help or further reading would be great.&lt;/p&gt;&#xA;" OwnerUserId="25930" LastEditorUserId="16160" LastEditDate="2017-07-15T01:39:50.487" LastActivityDate="2018-03-05T23:17:30.430" Title="Differential Sortino Ratio" Tags="&lt;sharpe-ratio&gt;&lt;machine-learning&gt;&lt;differential-equations&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35136" PostTypeId="1" CreationDate="2017-07-15T04:06:09.353" Score="1" ViewCount="122" Body="&lt;p&gt;I came across a term 'gamma-weighted SOIR' several times recently. it seem like an old term on gamma imbalance. could someone care to explain what this is and the rationale behind it?&lt;/p&gt;&#xA;" OwnerUserId="25885" LastActivityDate="2017-07-15T04:06:09.353" Title="gamma-weighted SOIR" Tags="&lt;options&gt;&lt;gamma&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35138" PostTypeId="1" CreationDate="2017-07-15T15:51:28.433" Score="2" ViewCount="2001" Body="&lt;p&gt;I want to price a European Power Call option (without dividend yield) with payoff $\max\{S_T^2-X, 0\}$, where $T$ is the maturity and $X$ the strike.&#xA;Let $(S_t)_{t\ge 0}$ be the price process of an underlying with dynamics&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$dS_t=S_t(r dt + \sigma dW_t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So first I observed that&#xA;$dS_t^2=2S_tdS_t+d\langle S\rangle_t=S_t^2\left((2r+\sigma^2)dt+2\sigma dW_t\right)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So $\tilde{S}_t$ is a BS-stock with volatility $\tilde{\sigma}=2\sigma$ and interest rate $\tilde{r}=2r+\sigma^2$.&#xA;Then I applied the BS-formula for option pricing which gives a call price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But this leads to the wrong result. As i looked it up the right way is to choose $\tilde{\sigma}=2\sigma$, $\tilde r = r$ and a dividend $q=-(\sigma^2+r)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now my question is: &#xA;What is the reasoning behind this choice? Why is the price of a European Power Call option &lt;strong&gt;without&lt;/strong&gt; dividend yield derived by using Black-Scholes formula &lt;strong&gt;with&lt;/strong&gt; dividends? That doesn't make sense to me. And why did my straightforward approach lead to a wrong result? &lt;/p&gt;&#xA;" OwnerUserId="28398" LastEditorUserId="24222" LastEditDate="2017-07-16T16:27:54.823" LastActivityDate="2017-07-16T16:27:54.823" Title="Pricing of European Power Call Option via Black-Scholes formula: reasoning?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;pricing&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35139" PostTypeId="2" ParentId="25012" CreationDate="2017-07-15T20:36:22.620" Score="4" Body="&lt;h3&gt;Does variable $x$ forecast returns?&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Let's say you have some variable $x$ that you think forecasts returns, and you want to conduct statistical tests of a null hypothesis that $x$ has nothing to do with expected returns. &lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Why a long-short portfolio? (quick answer)&lt;/h1&gt;&#xA;&#xA;&lt;h3&gt;1. It gives you a reasonable shot at detecting an effect.&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Imagine you have a stereo system and you want to see if dial $x$ does anything. You could turn the dial all the way to the right and compare sound with the dial turned all the way to the left.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, comparing returns of a portfolio of firms with high $x$ with returns of a portfolio of firms with low $x$ gives you a reasonable shot at detecting whether $x$ matters.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;2. It's simple and intuitive.&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Sorting into portfolios on some signal is classic, low-brow statistics, 1980s style finance.I'm not saying this to be derogatory. There's much to be said for simple, robust techniques done well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With classic techniques, many quantitative finance types can instantly recognize and understand the broad outlines of what you're doing.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;3. Forming portfolios naturally corrects test-statistics for cross-sectional correlation.&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;If you worked at the level of individual companies, your statistical tests need to be robust to the immense cross-sectional correlation in returns. Firms in the same industry will go up and down together. Firms with similar accounting characteristics go up and down together.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While a reasonably skilled statistician can handle this properly by clustering standard errors by time, a long-short portfolio is much easier to explain to those less skilled in statistics.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Recipe overview&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;A standard thing to do since at least the 1980s is to form portfolios on signal $x_t$ and test if portfolios with high $x$ have statistically different returns than portfolios with low $x$.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Sort firms $i=1, \ldots, n$ into $k$ portfolios at time $t$ based upon which &lt;a href=&quot;https://en.wikipedia.org/wiki/Quantile&quot; rel=&quot;nofollow noreferrer&quot;&gt;quantile&lt;/a&gt; $x_{it}$ falls into at time $t$.&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Eg. if $k=5$, companies in the bottom quintile of $x$  (i.e. lowest 20% of firms) would go portfolio 1 and companies in the top quintile (i.e. highest 20%) would go in portfolio 5.&lt;/li&gt;&#xA;&lt;li&gt;You may want to exclude micro-cap firms, etc...&lt;/li&gt;&#xA;&lt;li&gt;No cheating! Be &lt;strong&gt;extremely&lt;/strong&gt; careful to not form portfolios based upon information unavailable at time $t$. &lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Compute monthly returns for your portfolios. &#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The more frequently you rebalance, the more issues there are with trading costs, bid-ask bounce etc... and whether these portfolio returns are achievable in practice.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;Compute average returns, risk adjusted returns (i.e. Jensen's alpha), or characteristic adjusted returns (i.e. excess returns over some benchmark portfolio return).&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Eg. For each portfolio $1, \ldots, k$, regress returns against the factors of the Fama-French five factor model and compute the alpha, t-stat for the alpha etc... (Note: the spread portfolio return is already an &lt;a href=&quot;https://quant.stackexchange.com/questions/30602/fama-french-solving-for-alpha/34718#34718&quot;&gt;excess return&lt;/a&gt; and so you don't subtract the risk free rate from that portfolio return when estimating alpha).&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If $x$ really delivers a signal, you'd want to see alpha increasing in $x$ across the portfolios and an economically and statistically significant number for the alpha of the long-short, spread portfolio. You'd ideally like to see portfolio 5 has higher returns than portfolio 4 has higher returns than portfolio 3, etc.... &lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2018-08-20T13:59:48.067" LastActivityDate="2018-08-20T13:59:48.067" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="35140" PostTypeId="2" ParentId="35132" CreationDate="2017-07-15T21:36:22.910" Score="1" Body="&lt;p&gt;I understand your question to be, &quot;Does the Modigliani-Miller theorem have any relevance for forecasting the probability of default based upon debt to equity ratios?&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Not really.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Modigliani-Miller thoerem is about the total value of the firm, not probability of default. As @n00b2 said in the comments, &quot;Nobody, and certainly not M&amp;amp;M, ever said that the probability of bankruptcy has nothing to do with $\frac{D}{E}$.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The M&amp;amp;M theorem &lt;em&gt;doesn't&lt;/em&gt; say that $\frac{D}{E}$ doesn't affect the probability of default. Rather, the M&amp;amp;M assumptions imply that bankruptcy doesn't matter in the sense that it wouldn't affect total enterprise value.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Quick review of Modigliani-Miller (M&amp;amp;M) theorem&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;The M&amp;amp;M theorem says that under the M&amp;amp;M assumptions, &lt;em&gt;firm value&lt;/em&gt; is invariant to capital structure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The basic idea is that if firm cashflows are taken as given and capital markets are rational, then the total value of a firm doesn't change based upon how those cash flows are split up between debt and equity (or in fact any type of security).&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Under M&amp;amp;M assumptions, bankruptcy doesn't matter!&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;In an M&amp;amp;M world, there is no cost of bankruptcy, there are no lawyer fees, there's no loss of consumer confidence in the firm, etc....&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In an M&amp;amp;M world, bankruptcy doesn't mean &lt;em&gt;anything&lt;/em&gt; besides that cash flows are going to creditors instead of equity holders.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Example:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Let $D_f$ be the market value of the debt of Tesla if the debt has a face value of $f$. Let $E_f$ be the market value of the equity of Tesla if the debt has a face value of $f$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under the M&amp;amp;M assumptions $D_{\text{100 dollars}} + E_{\text{100 dollars}} = D_{\text{100 billion dollars}} + E_{\text{100 billion dollars}}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of 100 of outstanding debt, virtually all the firm value of Tesla would be in the equity. In the case of 100 billion of outstanding debt, virtually all the firm value would be in the value of debt (and bankruptcy would be assured with probability near 100%).&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-07-15T23:40:59.693" LastActivityDate="2017-07-15T23:40:59.693" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35141" PostTypeId="1" CreationDate="2017-07-16T03:30:38.987" Score="-1" ViewCount="361" Body="&lt;p&gt;How do I show the following:&#xA;Suppose $\lambda=-\frac{S'(x)}{S(x)}$, where $S(x)=1-F(x)$ is survival probability.&#xA;Show that $\lambda$ is the intensity of the exponential distribution with cdf $F(x)=1-e^{-\lambda x}$.&lt;/p&gt;&#xA;" OwnerUserId="28421" LastActivityDate="2017-09-14T05:10:38.690" Title="Intensity of Exponential Distribution" Tags="&lt;distribution&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35142" PostTypeId="2" ParentId="35141" CreationDate="2017-07-16T03:39:08.720" Score="0" Body="&lt;p&gt;You didn't define an intensity function, and you might be assuming what's to be shown. Does this help?&#xA;\begin{align*}&#xA;-\frac{S'(x)}{S(x)} &amp;amp;= \lambda\frac{e^{-\lambda x}}{e^{-\lambda x} } \tag{defn of survival function} \\&#xA;&amp;amp;= 1.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="1870" LastEditorUserId="1870" LastEditDate="2017-07-16T03:44:49.550" LastActivityDate="2017-07-16T03:44:49.550" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35143" PostTypeId="1" AcceptedAnswerId="35153" CreationDate="2017-07-16T11:29:15.113" Score="2" ViewCount="112" Body="&lt;p&gt;I have 3 time series X1, X2, X3. &#xA;I want to find the coefficient (c1, c2) that will minimize the distance between them as follow:&#xA;$$MIN\sum\sqrt{(X1-(c1*X2+c2*X3))^2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The constrains are:&#xA;$$-1&amp;lt; c1,c2 &amp;lt; 1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can I do it in R? &lt;/p&gt;&#xA;" OwnerUserId="1463" LastEditorUserId="16160" LastEditDate="2017-07-16T14:09:22.410" LastActivityDate="2017-07-17T16:12:51.080" Title="How to find coefficient that will minimize the distance between few times series" Tags="&lt;time-series&gt;&lt;programming&gt;&lt;optimization&gt;&lt;tracking-error&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35144" PostTypeId="1" AcceptedAnswerId="35148" CreationDate="2017-07-16T17:42:16.620" Score="3" ViewCount="190" Body="&lt;p&gt;Let's say you are running an arbitrage strategy in the Forex market. You see an opportunity to buy USD/JPY at 100 on exchange A, and sell USD/JPY at 105 on exchange B. You submit the buy and sell order simultaneously as limit orders to these two exchanges. Due to unforeseen circumstances, your buy order fills but the sell order does not. I can think of a few techniques to do, which one is recommended?&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Fill the sell order at the current market price, taking a potential loss. &lt;/li&gt;&#xA;&lt;li&gt;Wait x some time for the sell order to fill, and then cancel.&lt;/li&gt;&#xA;&lt;li&gt;Revert the buy order by placing a new sell order that cancels out the buy order.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="17004" LastEditorUserId="467" LastEditDate="2017-07-20T03:39:20.253" LastActivityDate="2017-07-20T03:39:20.253" Title="What are recommended recovery techniques in arbitrage when one order doesn't fill?" Tags="&lt;fx&gt;&lt;arbitrage&gt;&lt;high-frequency&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35146" PostTypeId="1" AcceptedAnswerId="35469" CreationDate="2017-07-16T23:29:51.410" Score="-1" ViewCount="176" Body="&lt;p&gt;I have a time series (vector) representing the evolution of a stock price over time. I am looking for a program/library that can generate a matrix containing as many technical indicators as possible. Which publicly available program/library can do that?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I have crossposted the question at:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://qr.ae/TbcrXL&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://qr.ae/TbcrXL&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2183" LastEditorUserId="2183" LastEditDate="2017-07-29T15:56:12.927" LastActivityDate="2017-08-07T09:54:09.477" Title="Program/library to generate many technical indicators given a series of stock prices" Tags="&lt;software&gt;&lt;technicals&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35147" PostTypeId="1" CreationDate="2017-07-17T03:44:00.490" Score="5" ViewCount="283" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Let $\left(S_t^{(1)}\right)_{t\ge0}$ and&#xA;  $\left(S_t^{(2)}\right)_{t\ge0}$ be the price processes of two stocks&#xA;  with dynamics&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$$ \begin{align} &#xA;&amp;amp; dS_t^{(1)}=\sigma_{11}S_t^{(1)}dW_t^{(1)}&#xA;\\[6pt]&#xA;&amp;amp; dS_t^{(2)}=\sigma_{21}S_t^{(2)}dW_t^{(1)}+\sigma_{22}S_t^{(2)}dW_t^{(2)}&#xA;\end{align} $$&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;where $W_t^{(1)}$ and $W_t^{(2)}$ are independent Brownian motions.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Further let the riskfree interest rate $r=0$.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;I want to price a option with a payoff $X(T)=&#xA; S_T^{(2)}1_{\{S_T^{(1)}&amp;gt;K\}}$ at maturity T.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;First we observe:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;&amp;amp; S_t^{(1)}=S_0^{(1)}\exp(-\dfrac{\sigma_{11}^2}{2}t+\sigma_{11}W_t^{(1)})&#xA;\\[6pt]&#xA;&amp;amp; S_t^{(2)}=S_0^{(2)}\exp(-\dfrac{1}{2}(\sigma_{21}^2+\sigma_{22}^2)t+\sigma_{21}W_t^{(1)}+\sigma_{22}W_t^{(2)}).&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So using the risk-neutral valuation formula the price of this option at time $0$ is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ V_0=e^{-rT}\mathbb E_{\mathbb Q}[X(T)]=\mathbb E_{\mathbb Q}[S_T^{(2)}1_{\{S_T^{(1)}&amp;gt;K\}}].$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now using $S_t^{(2)}$ as numéraire gives the new measure:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \dfrac{d\mathbb{Q^N}}{d\mathbb Q}=\dfrac{S_T^{(2)}}{S_0^{(2)}}=\exp\left(-\pmatrix{-\sigma_{21} &amp;amp; -\sigma_{22}}\pmatrix{W_T^{(1)} \\W_T^{(2)}}-\dfrac{1}{2}(\sigma_{21}^2+\sigma_{22}^2)T\right) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now by Girsanov's theorem $\hat W_t^{(1)}:=W_t^{(1)}-t\sigma_{21}$ is a $\mathbb Q^N$- Brownian motion. So we get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align} &#xA;V_0 = e^{-rT}\mathbb E_{\mathbb Q}[X(T)] &amp;amp; = \mathbb E_{\mathbb Q}[S_T^{(2)}1_{\{S_T^{(1)}&amp;gt;K\}}]&#xA;\\[6pt]&#xA;&amp;amp; = \mathbb E_{\mathbb Q^N}\left[S_T^{(2)}1_{\{S_T^{(1)}&amp;gt;K\}}\left(\dfrac{d\mathbb{Q^N}}{d\mathbb Q}\right)^{-1}\right]&#xA;\\[6pt]&#xA;&amp;amp; = S_0^{(2)}\mathbb Q^N\left(S_T^{(1)}&amp;gt;K\right)&#xA;\\[6pt]&#xA;&amp;amp; = S_0^{(2)}\mathbb Q^N\left(S_0^{(1)}\exp(-\dfrac{\sigma_{11}^2}{2}T+\sigma_{11}W_T^{(1)})&amp;gt;K\right)&#xA;\\[6pt]&#xA;&amp;amp; = S_0^{(2)}\mathbb Q^N\left(S_0^{(1)}\exp\left(-\dfrac{\sigma_{11}^2}{2}T+\sigma_{11}(\hat W_T^{(1)}+\sigma_{21}T)\right)&amp;gt;K\right)&#xA;\\[6pt]&#xA;&amp;amp; = S_0^{(2)}\Phi\left(\dfrac{\log(S_0^{(1)}/K)-\left(\dfrac{\sigma_{11}^2}{2}-\sigma_{11}\sigma_{21}\right)T}{\sigma_{11}\sqrt T}\right).&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I right? Is there another, maybe simpler way to do it?&lt;/p&gt;&#xA;" OwnerUserId="28398" LastEditorUserId="20454" LastEditDate="2017-07-18T08:32:58.213" LastActivityDate="2017-07-18T08:32:58.213" Title="pricing option with two stocks" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;risk-neutral-measure&gt;&lt;pricing&gt;" AnswerCount="0" CommentCount="9" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35148" PostTypeId="2" ParentId="35144" CreationDate="2017-07-17T12:34:23.387" Score="3" Body="&lt;p&gt;If you don't fill an order that you intended to fill then you usually try again. After all, that's your strategy. Then the professional response is to open a ticket with IT on why the order wasn't filled, and find out exactly what the problem was, and why, and take IT actions so it can't happen again. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a way, you're asking about a form of &quot;slippage&quot;.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2017-07-17T12:34:23.387" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35149" PostTypeId="1" CreationDate="2017-07-17T12:43:39.120" Score="1" ViewCount="54" Body="&lt;p&gt;I want to price American Option by applying an existing boundary to a set of randomly generated paths. The boundary can be obtained from a binomial method. &#xA;For example, a call option with one year maturity can be exercised at the end of each four month (3 exercise points), the spot and strike price is both at $100 dollar, with continuous dividend at 10%, risk free rate at 5% and volatility at 20%. &#xA;The following bound can be obtained from the binomial method:&#xA;For the first exercise point, the option should be exercised if the stock price is greater than 113.9557.The second is 110.2940 and the last is 100.0000. The option value obtained from the binomial method is 5.73. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I apply this bound to 10000 random generated path, I get a value around 9.5. I don't know what can cause this highly biased value?&#xA;Thanks in advance for any suggestions and solutions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The code for generating the path is:&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;b=10000;&#xA;payoff=Stockpath=matrix(S0[q], nrow=b, ncol=t+1);&#xA;optionvalue=matrix(0,nrow=b,ncol=1);&#xA;prev.theta=theta.maxexp=matrix(300, nrow=1, ncol=t+1);&#xA;theta.maxexp[4]=K; #initiate the bound&#xA;exercise=matrix(0,nrow=b,ncol=t+1);&#xA;exerciseindex=matrix(4,nrow=b,ncol=1);&#xA;&#xA;for (p in 2:ncol(Stockpath)){&#xA;    steptemp=tstep*(p-1);&#xA;    for (i in 1:b/2){&#xA;      x=rnorm(1, mean=0, sd=1);&#xA;      Stockpath[i,p]=S0[q]*exp((r-delta-sigma^2/2)*steptemp+sigma*sqrt(steptemp)*x);&#xA;      Stockpath[i+b/2,p]=S0[q]*exp((r-delta-sigma^2/2)*steptemp+sigma*sqrt(steptemp)*(-x));&#xA;      payoff[i,p]=max(Stockpath[i,p]-K,0);&#xA;      payoff[i+b/2,p]=max(Stockpath[i+b/2,p]-K,0);&#xA;    }&#xA;  }&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The code for applying the bound is:&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for (step in t:2){&#xA;        exercise[,step]=ifelse(Stockpath[,step]&amp;gt;temp.theta[step],1,0)&#xA;      }&#xA;      exercise[which(apply(exercise,1,sum)==0),t+1]=1;&#xA;      index=which(apply(exercise,1,sum)&amp;gt;1);&#xA;      colindex=apply(exercise,1,function(x) min(which(x==1)));&#xA;      exercise=matrix(0,nrow=b,ncol=t+1);&#xA;      for (i in 1:b)  exercise[i,colindex[i]]=1;&#xA;&#xA;&#xA;      optionvalue=exercise*payoff;&#xA;      exerciseindex=exercise*matrix(c(0:t+1),ncol=4,nrow=b,byrow=TRUE);&#xA;      dicountfactor=exercise*exp(-r*(exerciseindex-1)/t);&#xA;      dicountfactor[which(dicountfactor[,1]&amp;gt;0),1]=1;&#xA;      optionvalue=optionvalue*dicountfactor;&#xA;      mean(apply(optionvalue,1,sum));#The option value&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="28840" LastActivityDate="2017-07-17T12:43:39.120" Title="Pricing American Option Using an Exisiting Boundary" Tags="&lt;option-pricing&gt;&lt;american-options&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35151" PostTypeId="2" ParentId="33942" CreationDate="2017-07-17T15:19:19.660" Score="2" Body="&lt;p&gt;At &lt;a href=&quot;http://info.cloudquant.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;CloudQuant&lt;/a&gt; we have been using historical sentiment data and news data from bloomberg. This news includes the news title text. I believe that the full text is also available but we aren't using it. We allow our clients in the CloudQuant Elite product to be able to access the news sentiment in our historical backtesting. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bloomberg's &quot;EVENT-DRIVEN TRADING TEXTUAL NEWS&quot; and real time data can be found at: &lt;a href=&quot;https://www.bloomberg.com/professional/product/event-driven-feeds/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.bloomberg.com/professional/product/event-driven-feeds/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="28844" LastActivityDate="2017-07-17T15:19:19.660" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35152" PostTypeId="1" CreationDate="2017-07-17T16:06:42.003" Score="1" ViewCount="192" Body="&lt;p&gt;Backtesting technical indicators (that determine market psychology) - how well would they have done? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example RSI was published in 1978. Before its creation - did it performed better or worse?&lt;/p&gt;&#xA;" OwnerUserId="28845" LastActivityDate="2017-07-18T09:35:57.307" Title="How well would Technical Indicators have done before creation?" Tags="&lt;quant-trading-strategies&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35153" PostTypeId="2" ParentId="35143" CreationDate="2017-07-17T16:12:51.080" Score="3" Body="&lt;p&gt;Define $\|.\|_1$ as the &lt;a href=&quot;https://en.wikipedia.org/wiki/Lp_space#The_p-norm_in_finite_dimensions&quot; rel=&quot;nofollow noreferrer&quot;&gt;$L_1$ norm&lt;/a&gt;. I'll use bold letters to denote vectors and I'm using $\mathbf{y} = \mathbf{x}_1$. Your problem is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;	\begin{array}{*2{&amp;gt;{\displaystyle}r}}&#xA;	\mbox{minimize (over $c_1, c_2$)} &amp;amp; \| \mathbf{y} - c_1 \mathbf{x}_2 - c_2 \mathbf{x}_3 \|_1 \\&#xA;	\mbox{subject to} &amp;amp; -1 \leq c_1 \leq 1\\&#xA;&amp;amp; -1 \leq c_2 \leq 1&#xA;	\end{array}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or let matrix $X = \begin{bmatrix} \mathbf{x}_2 &amp;amp; \mathbf{x}_3 \end{bmatrix}$ . The problem can be written more succinctly as:&#xA;\begin{equation}&#xA;	\begin{array}{*2{&amp;gt;{\displaystyle}r}}&#xA;	\mbox{minimize (over $\mathbf{c}$)} &amp;amp; \| X \mathbf{c} - \mathbf{y} \|_1 \\&#xA;	\mbox{subject to} &amp;amp; \mathbf{c} \preceq \mathbf{1} \\&#xA;                      &amp;amp; -\mathbf{c} \preceq \mathbf{1}&#xA;	\end{array}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Minimizing the $L_1$ norm subject to affine constraints is a &lt;a href=&quot;https://en.wikipedia.org/wiki/Convex_optimization&quot; rel=&quot;nofollow noreferrer&quot;&gt;convex optimization&lt;/a&gt; problem. There are a multitude of approaches to solve this problem, and since it's only in two variables, it's quite trivial to solve. Any general purpose optimization library can probably solve this without issues.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below is a short list of things you can do. It is not an exhaustive list.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Option 1: Use &lt;a href=&quot;http://cvxr.com/cvx/&quot; rel=&quot;nofollow noreferrer&quot;&gt;CVX&lt;/a&gt; to solve this problem:&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I'm just mentioning this because I know it well. There are ways to call CVX from R but it might be inconvenient. If you were in MATLAB or Python you could do something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;%% initialize code (currently matlab code)&#xA;n = 200;&#xA;y = randn(n, 1);  &#xA;X = randn(n, 2);&#xA;&#xA;%% CVX CODE&#xA;cvx_begin&#xA;variables c(2);&#xA;minimize(norm(y - X * c, 1))&#xA;subject to:&#xA;-1 &amp;lt;= c&#xA;c &amp;lt;= 1&#xA;cvx_end&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h2&gt;Option 2: Rewrite the problem as a linear program.&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;By introducing a vector $\mathbf{s} \in \mathbb{R}^n$, the &lt;a href=&quot;http://cvxopt.org/examples/mlbook/l1.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;$L_1$ norm minimization problem can be written as a linear program&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;	\begin{array}{*2{&amp;gt;{\displaystyle}r}}&#xA;	\mbox{minimize (over $\mathbf{c}, \mathbf{s}$)} &amp;amp; \mathbf{1}'\mathbf{s} \\&#xA;	\mbox{subject to} &amp;amp; \mathbf{c} \preceq \mathbf{1} \\&#xA;                  &amp;amp; -\mathbf{c} \preceq \mathbf{1} \\&#xA;&amp;amp; X\mathbf{c} - \mathbf{y} \preceq \mathbf{s} \\&#xA;&amp;amp; -X\mathbf{c} + \mathbf{y} \preceq \mathbf{s}&#xA;	\end{array}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are &lt;a href=&quot;https://cran.r-project.org/web/views/Optimization.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;numerous solvers in R for linear programs&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="20582" LastActivityDate="2017-07-17T16:12:51.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35158" PostTypeId="1" AcceptedAnswerId="35162" CreationDate="2017-07-18T09:17:40.300" Score="0" ViewCount="335" Body="&lt;p&gt;Recently I wrote a program in Python which extracts stock data for a designated period and frequency of the predetermined stocks and then optimises the portfolio using the Sharpe ratio. In order to generate the different kinds of weights, I wrote a generator that gives me all the possible weights (all weights are non-negative and have to sum to 100).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the problem with this is that while I can still confidently simulate a 5 stock portfolio (which takes about 5 minutes), simulating a 6 stock portfolio would take up to 10 hours on my machine, given all the possible distributions of weights (if I recall correctly it should be around 96 millions). I would want to push this as far as possible, optimally to a point where the gains from un-systematic risk reduction are minimal as a consequence of adding additional stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now my question is what are the &quot;smart ways&quot; to do this (obviously the way I am using is neat since you get all the possible outcomes, but cant be considered seriously given the resource and time intensity)? What kind of optimisation techniques would one use in order to make this process faster?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not searching for any single solution, but rather for an elaboration as to what optimization techniques exist out there, that could be used in order to approach this problem and what are their advantages or/and disadvantages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for any suggestions!   &lt;/p&gt;&#xA;" OwnerUserId="17688" LastEditorUserId="26595" LastEditDate="2017-07-18T09:29:50.697" LastActivityDate="2017-07-18T11:57:54.727" Title="Portfolio optimisation - Non brute force solutions to optimisation problems" Tags="&lt;equities&gt;&lt;programming&gt;&lt;optimization&gt;&lt;portfolio-optimization&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35159" PostTypeId="2" ParentId="35152" CreationDate="2017-07-18T09:27:26.747" Score="4" Body="&lt;p&gt;A simple model for any trading strategy that is fitted using historical data is that the in-sample performance is some combination of&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Genuine alpha&lt;/li&gt;&#xA;&lt;li&gt;Overfitting &quot;alpha&quot;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;and that out of sample, you just get the genuine alpha. Additionally, alpha may decay over time, but it is unlikely to improve. In the absence of other effects, you would therefore expect any trading strategy to have much better performance before it was published and became widely known.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To test this with RSI, I used a data set of 32 commodity futures from 1960 to 2016, and created a simple trend-following strategy that uses the RSI indicator with a 21-day lookback period. Trades on day &lt;em&gt;t&lt;/em&gt; are formed using information up to and including the close of day &lt;em&gt;t-1&lt;/em&gt;, and are assumed to be executed at the closing price on day &lt;em&gt;t&lt;/em&gt;. Positions are sized to give roughly equal risk in each contract over the entire sample. All results are gross of transaction costs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The results pre- and post-publication are&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;                        1960-1978    1979-2016&#xA;Annualised Return           8.79%        3.54%&#xA;Annualised Volatility       5.97%        5.49%&#xA;Sharpe Ratio                1.47         0.64&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It is clear that the strategy has not performed as well since it was published, and in fact it has been completely flat since 2009 - indicating a possible post-publication effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, other explanations should be explored (e.g. running a systematic strategy with daily rebalance may not have been feasible before the widespread availability of personal computers, or transaction costs may have been prohibitively high in the past).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One final note - I have used the RSI as a &lt;em&gt;momentum&lt;/em&gt; indicator here. The original article, published in &lt;em&gt;Commodities&lt;/em&gt; magazine by J. Welles Wilder in July 1978, envisioned the RSI being used as a &lt;em&gt;reversal&lt;/em&gt; indicator, i.e. you would sell when the RSI was high and buy when it was low. Given the strong results from using it as a momentum indicator prior to publication, I am at a loss to explain this!&lt;/p&gt;&#xA;" OwnerUserId="924" LastEditorUserId="924" LastEditDate="2017-07-18T09:35:57.307" LastActivityDate="2017-07-18T09:35:57.307" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="35160" PostTypeId="2" ParentId="35158" CreationDate="2017-07-18T10:27:53.553" Score="2" Body="&lt;p&gt;The maximum Sharpe portfolio has a closed form solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $w_i$ be the weight of asset $i$ so that $\sum_i w_i = 1$. The weights for the maximum Sharpe portfolio is then&#xA;$$&#xA;\bf{w} = \frac{\bf{\Sigma}^{-1}\bf{\mu}}{\bf{1}^T\bf{\Sigma}^{-1}\bf{\mu}},&#xA;$$&#xA;where $\bf{\Sigma}$ is the return covariance matrix, $\mu$ is the excess return expectations, and $\bf{1}$ is a vector of ones.&lt;/p&gt;&#xA;" OwnerUserId="5107" LastActivityDate="2017-07-18T10:27:53.553" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35161" PostTypeId="1" AcceptedAnswerId="35171" CreationDate="2017-07-18T10:41:05.407" Score="1" ViewCount="263" Body="&lt;p&gt;I would ask a sort of &quot;philosophical&quot; question. Is there any author who gave a scientific definition of this subject? Is it considered a branch of mathematics or does it primarily concern economics? Thank you in advance.&lt;/p&gt;&#xA;" OwnerUserId="22470" LastActivityDate="2017-07-18T19:17:00.273" Title="A definition of quantitative finance" Tags="&lt;finance&gt;&lt;quantitative&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ClosedDate="2017-07-23T04:23:21.677" ContentLicense="CC BY-SA 3.0" />
  <row Id="35162" PostTypeId="2" ParentId="35158" CreationDate="2017-07-18T10:55:48.980" Score="3" Body="&lt;p&gt;There are a few commonly used solutions&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Analytic solutions. These can be particularly effective when the objective function is linear/quadratic, and the constraints are all linear equality constraints (e.g. self-financing, zero beta, sector neutrality etc)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Quadratic optimization. This works well with linear/quadratic objective function, and linear equality or inequality constraints (all the above, plus turnover constraints, position limits, sector exposure limits etc)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Conic optimization. This extends the applicability of the above solutions to objective functions that can be non-linear/quadratic and constraints that can be non-linear, as long as the objective function and constraints can be transformed to either linear/quadratic or conic.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Non-linear optimization. Generic non-linear optimizers (e.g. interior point methods or Nelder-Mead) can sometimes give satisfactory solutions on a wide range of objective functions and constraints -- the only requirements generally being that the objective function/constraints are sufficiently smooth (no discontinuities). It helps if you can calculate an analytic gradient.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;To optimize for the Sharpe ratio in cases  1 and 2, you generally have to consider a family of solutions $w_\lambda$ that maximise&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\alpha^T w_\lambda - \lambda w_\lambda^T\Sigma w_\lambda$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and chose the value of $\lambda$ that gives the highest Sharpe Ratio. In cases 3 and 4 you can optimize for the Sharpe ratio directly.&lt;/p&gt;&#xA;" OwnerUserId="924" LastEditorUserId="924" LastEditDate="2017-07-18T11:57:54.727" LastActivityDate="2017-07-18T11:57:54.727" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="35163" PostTypeId="1" AcceptedAnswerId="35166" CreationDate="2017-07-18T11:37:50.413" Score="6" ViewCount="4791" Body="&lt;p&gt;Considering an American option in a Black-Scholes model, is there a relation between Vega and Gamma as it holds in the European case?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am aware an exact relation would be difficult to find. But in practice is there a kind of approximate relation between these two quantities?&lt;/p&gt;&#xA;" OwnerUserId="28850" LastEditorUserId="924" LastEditDate="2017-07-18T14:23:15.750" LastActivityDate="2017-07-19T15:45:12.630" Title="American Options relation between greeks" Tags="&lt;greeks&gt;&lt;american-options&gt;&lt;gamma&gt;&lt;vega&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="35165" PostTypeId="2" ParentId="35163" CreationDate="2017-07-18T14:01:24.127" Score="2" Body="&lt;p&gt;One way to think of American-exercise options is to break their value $V_A$ down into a value due to the european exercise, $V_E$, and a &quot;premium&quot; due to the possibility of early exercise, $V_P$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;V_A = V_E + V_P&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the differentiation operator is linear, we then have similar terms for gamma and vega&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\Gamma_A = \Gamma_E + \Gamma_P&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\aleph_A = \aleph_E + \aleph_P&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the &quot;european component&quot; the standard relation holds&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA; \aleph_E = S^2 \sigma \tau \Gamma_E&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To the extent that the exercise premium $V_P$ and its derivatives are small compared to $V_E$ and its derivatives, the standard european option relationship holds in approximation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{aligned}&#xA;\aleph_A    &amp;amp;=  S^2 \sigma \tau \Gamma_E + \aleph_P \\&#xA;             &amp;amp;=  S^2 \sigma \tau (\Gamma_A-\Gamma_P) + \aleph_P \\&#xA;             &amp;amp;=  S^2 \sigma \tau \Gamma_A + \underbrace{(\aleph_P -S^2 \sigma \tau\Gamma_P)}_{\text{Small terms}}&#xA;\end{aligned}&#xA;$$&#xA; and similarly&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\Gamma_A = \frac{\aleph_A}{S^2 \sigma \tau} + \underbrace{\Gamma_P - \frac{\aleph_P}{S^2 \sigma \tau}}_{\text{Small terms}}&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2017-07-19T15:45:12.630" LastActivityDate="2017-07-19T15:45:12.630" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="35166" PostTypeId="2" ParentId="35163" CreationDate="2017-07-18T14:18:27.050" Score="14" Body="&lt;p&gt;No, you should not expect such a relationship to hold in general. The reason is that American options have an &quot;exercise barrier&quot; which European options don't, and this results in different prices and greeks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of put options (with interest rate $r&amp;gt;0$) as the spot price falls, at some point it becomes optimal to exercise early and take the cash. Beyond this point, the option behaves like a short position in the stock, so its delta is exactly -1 and its gamma is zero. As the spot crosses through this barrier, the gamma jumps.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Vega, on the other hand, does not have such a discontinuity. The chart below shows the price of a European and American put with strike 100, three months to maturity, risk-free rate 15% and volatility 20%. The European prices and greeks are from the Black-Scholes model, and the American prices and greeks are from a binomial tree.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/0QZhL.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/0QZhL.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that when the spot price is sufficiently far from the early exercise barrier, it is unlikely to cross it, and the option behaves like a European. In this case you expect the standard relationship between gamma and vega,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\nu = \sigma\tau S^2 \Gamma$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;will approximately hold. The plot below shows how this relationship holds when the spot price is sufficiently far above the strike, but breaks down when it approaches the early exercise barrier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ZugPL.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZugPL.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="924" LastEditorUserId="924" LastEditDate="2017-07-19T08:21:09.767" LastActivityDate="2017-07-19T08:21:09.767" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35168" PostTypeId="1" CreationDate="2017-07-18T15:32:03.457" Score="5" ViewCount="396" Body="&lt;p&gt;Stock returns correlation matrices are notoriously hard to estimate, especially when the number of assets $N$ is large with respect to the size of the readily available historical returns $T$. Many methods exist to ease the estimation (and work-around the problem's ill-posedness).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wondered if anyone tried to implement the unbiased version of the Rotational Invariant correlation matrix Estimator (RIE) described in &lt;a href=&quot;https://www.cfm.fr/assets/ResearchPapers/Cleaning-Correlation-Matrices.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; paper.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've written some python code to test it and it does not seem to offer a significant advantage over the standard sample estimator of the correlation matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've already checked my code several time so I'd be interested to know if someone managed to implement it adequately (I don't need the code, just to know whether there is a typo in the paper for instance).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot already.&lt;/p&gt;&#xA;" OwnerUserId="28853" LastEditorUserId="16148" LastEditDate="2017-07-18T15:43:15.883" LastActivityDate="2018-01-16T08:55:32.573" Title="Cleaning correlation matrix, Bun Bouchaud Potters (2016) method" Tags="&lt;correlation-matrix&gt;&lt;random-matrix-theory&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35169" PostTypeId="2" ParentId="7181" CreationDate="2017-07-18T15:36:46.103" Score="0" Body="&lt;p&gt;check out this paper: &quot;Predicting the direction of stock market prices&#xA;using random forest&quot; Luckyson Khaidem Snehanshu Saha Sudeepa Roy Dey, Applied Mathematical Finance&lt;/p&gt;&#xA;" OwnerUserId="28854" LastActivityDate="2017-07-18T15:36:46.103" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35170" PostTypeId="2" ParentId="35161" CreationDate="2017-07-18T16:17:05.863" Score="1" Body="&lt;p&gt;There are recurring questions as to what kind of academic discipline finance is. Is it applied math? A subfield of economics? Both? Neither? You'll find a multitude of opinions over time.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Early questions&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Milton_Friedman&quot; rel=&quot;nofollow noreferrer&quot;&gt;Milton Friedman&lt;/a&gt; famously questioned whether &lt;a href=&quot;https://en.wikipedia.org/wiki/Harry_Markowitz&quot; rel=&quot;nofollow noreferrer&quot;&gt;Harry Markowitz&lt;/a&gt; could be awarded a PhD in economics for his dissertation on portfolio theory because Friedman didn't think portfolio theory was economics. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Was it? Perhaps the most famous definition of economics comes from &lt;a href=&quot;https://en.wikipedia.org/wiki/Lionel_Robbins&quot; rel=&quot;nofollow noreferrer&quot;&gt;Lionel Robbins&lt;/a&gt;, &quot;Economics is the science which studies human behaviour as a relationship between ends and scarce means which have alternative uses.&quot; Friedman agreed with Robbins, writing in &lt;a href=&quot;https://books.google.com/books/about/Price_Theory.html?id=E7fAbXvo-ScC&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;em&gt;Price Theory&lt;/em&gt;&lt;/a&gt;, &quot;an economic problem exists whenever scarce means are used to satisfy alternative ends.&quot; The phrase, &quot;alternative ends&quot; captures some notion that preferences over multiple outcome variables are at the heart of economics and distinguishes an economic problem from an engineering problem. Building the fastest car from limited resources is an engineering problem. Building the best car would be an economic problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is portfolio optimization an engineering problem? Or an economic problem that involves preferences? The subsequent decades have put portfolio choice squarely within the realm of economic problems.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;No arbitrage pricing, Black Scholes, and interest rate models&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The 1970s, 1980s brought substantial developments in finance theory that arguably fall outside the traditional boundaries of economics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fischer Black and Myron Scholes found that continuous trading of a stock and a risk free bond could replicate the payoff of an option on that stock. Under the assumptions of Black-Scholes, a stock option from a mathematical standpoint is a redundant security. The late 1970s and subsequent decades also saw the development of term structure models, (eg. &lt;a href=&quot;https://en.wikipedia.org/wiki/Vasicek_model&quot; rel=&quot;nofollow noreferrer&quot;&gt;Vasicek model&lt;/a&gt;, &lt;a href=&quot;https://en.wikipedia.org/wiki/Heath%E2%80%93Jarrow%E2%80%93Morton_framework&quot; rel=&quot;nofollow noreferrer&quot;&gt;Heath-Jarrow-Morton framework&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Much of the work here has been picked up by mathematics and financial math departments. And I've heard Myron Scholes express his opinion that finance isn't just a subfield of economics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is quantitative finance just applied math? That's a problematic position as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Economics has also been broadening the boundaries of what's considered economics in other areas. For example, &lt;a href=&quot;https://en.wikipedia.org/wiki/Alvin_E._Roth&quot; rel=&quot;nofollow noreferrer&quot;&gt;Alvin Roth&lt;/a&gt; originally worked in &lt;a href=&quot;https://en.wikipedia.org/wiki/Operations_research&quot; rel=&quot;nofollow noreferrer&quot;&gt;operations research&lt;/a&gt;, but his matching theory has been been brought under the banner of economics.&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-07-18T16:26:14.760" LastActivityDate="2017-07-18T16:26:14.760" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35171" PostTypeId="2" ParentId="35161" CreationDate="2017-07-18T18:32:31.437" Score="2" Body="&lt;p&gt;Excellent information from Matthew Gun. I am just going to throw out what I think could be a reasonable definition of Quantitative Finance;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Quantitative Finance&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;A field of applied mathematics that uses concepts from statistics, economics, econometrics, game theory,  time series analysis, AI theory and other areas to provide a better understanding and competitive advantage within financial markets.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure if that is quite what you are looking for, but it should be a decent start.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am happy to update this if people have some suggestions that would help.&lt;/p&gt;&#xA;" OwnerUserId="19959" LastEditorUserId="19959" LastEditDate="2017-07-18T19:17:00.273" LastActivityDate="2017-07-18T19:17:00.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35175" PostTypeId="2" ParentId="9697" CreationDate="2017-07-19T03:12:34.413" Score="2" Body="&lt;p&gt;A few points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, In a typical factor model, the idiosyncratic piece (what you call $Var[\epsilon_k]$) is non-negligible, which results in a $\hat\Sigma$ that is going to be well-conditioned.  From a numerical point of view, this is very convenient.  The more well-conditioned a covariance matrix, the less susceptible the optimization routine is to round-off errors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, one can introduce variables $l_1, ..., l_K$ with constraints that $\sum_{i=1}^N e_{i,j} w_i = l_j$ and then work with $\Sigma_F$ directly in the formulation of an optimization and not use a full $N\times N$ covariance matrix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Third, from a portfolio optimization standpoint we don't care if the factors are orthogonal or not. We can rotate them to be orthogonal.  As long as $\Sigma_F$ is positive definite, we can use the Cholesky decomposition to write it as $LL^T = \Sigma_F$ and then replace the loadings matrix $e$ with a rotated one $\tilde e &#xA; =eL$ so that now the factors are orthogonal.  That is&#xA;$$e\Sigma_Fe^T = eLL^Te^T = \tilde e \tilde e^T.$$&lt;/p&gt;&#xA;" OwnerUserId="15965" LastActivityDate="2017-07-19T03:12:34.413" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35177" PostTypeId="1" CreationDate="2017-07-19T13:14:07.323" Score="1" ViewCount="122" Body="&lt;p&gt;I am looking for a comprehensive ressource describing known strategies of credit risk premia. Is there such kind of articles/books/websites?&lt;/p&gt;&#xA;" OwnerUserId="16457" LastActivityDate="2017-07-20T03:14:58.130" Title="Literature on credit risk premia" Tags="&lt;fixed-income&gt;&lt;quant-trading-strategies&gt;&lt;credit&gt;&lt;algorithm&gt;&lt;strategy&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35182" PostTypeId="2" ParentId="9054" CreationDate="2017-07-20T00:47:11.593" Score="0" Body="&lt;p&gt;An older paper from 1998, but possibly still relevant, is &lt;a href=&quot;http://www.financerisks.com/filedati/WP/ALGO_PAPER/arq-beyondvar.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Beyond VaR: From Measuring Risk to Managing Risk&lt;/a&gt;, by Helmut Mausser and Dan Rosen.  They present both a parametric and a non-parametric approach for a portfolio containing two underlying stocks with multiple puts and calls at various strikes and expiries &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The paper is widely cited, so you may be able to find something more recent, e.g. using IEEE XPLORE (where I also saw it referenced).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if this picture speaks to you, their 1998 paper might not be a bad starting point. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/eMdiR.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/eMdiR.png&quot; alt=&quot;Loss Distributions from Mausser and Rosen&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="28802" LastActivityDate="2017-07-20T00:47:11.593" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35183" PostTypeId="2" ParentId="25827" CreationDate="2017-07-20T00:58:14.503" Score="5" Body="&lt;p&gt;Try &lt;strong&gt;&lt;a href=&quot;http://www.quantumforquants.org/&quot; rel=&quot;noreferrer&quot;&gt;Quantum for Quants&lt;/a&gt;&lt;/strong&gt;, which has contributions from people working actively in quantum computing, and some small scale examples solved on the &lt;a href=&quot;https://www.dwavesys.com/&quot; rel=&quot;noreferrer&quot;&gt;D-Wave Systems&lt;/a&gt; Quantum Annealer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The picture below is from an article on Finding Arbitrage Opportunities using a Quantum Annealer (the link is on the Q4Q main page).  The annealer can solve &lt;em&gt;certain&lt;/em&gt; graph theory problems very quickly, including those with multiple constraints on traversing the edges, so that calculations with multi-legged instruments are easier to manage.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/8VTJV.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/8VTJV.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="28802" LastEditorUserId="28802" LastEditDate="2017-07-20T01:06:09.007" LastActivityDate="2017-07-20T01:06:09.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35184" PostTypeId="2" ParentId="35177" CreationDate="2017-07-20T03:14:58.130" Score="3" Body="&lt;p&gt;Two papers by AQR might be of use:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2563482&quot; rel=&quot;nofollow noreferrer&quot;&gt;Asvanunt, A. and S. Richardson (2016), “The Credit Risk Premium”&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Despite theoretical and intuitive reasons for a credit risk premium,&#xA;  past research has found little supporting empirical evidence. This is&#xA;  primarily due to biases in computing credit excess returns which&#xA;  improperly account for term risk. Using data spanning 80 years in the&#xA;  U.S., and nearly 20 years in Europe, we find strong evidence of credit&#xA;  risk premium after correctly adjusting for term risk. The credit risk&#xA;  premium is not spanned by other known risk premia and exhibits time&#xA;  variation related to economic growth and aggregate default rates.&#xA;  These results have important implications for asset pricing and&#xA;  investment decisions.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.aqrcapital.com/-/media/files/perspectives/systematic-credit-investing.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Asvanunt, A., Frieda, A., and S. Richardson, “Systematic Credit Investing”&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This paper aims to increase familiarity of the credit asset class and&#xA;  provide an overview of our approach to systematic credit investing. We&#xA;  introduce credit instruments and outline a simple framework for&#xA;  understanding sources of credit excess returns. We summarize two&#xA;  avenues for approaching systematic credit investing (and provide many&#xA;  references for readers interested in greater depth): (i) strategic and&#xA;  tactical exposure to the overall credit risk premium and (ii) relative&#xA;  value opportunities across credit instruments. We find that both kinds&#xA;  of systematic credit exposure have the potential to provide meaningful&#xA;  performance and diversification benefits to traditional and&#xA;  alternative portfolios.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Also take a look at &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2138885&quot; rel=&quot;nofollow noreferrer&quot;&gt;Van Luu, B. and P. Yu (2011). The credit risk premium: should investors overweight credit, when, and by how much?&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The authors revisit the case for maintaining a strategic overweight to&#xA;  corporate bonds in fixed income portfolios based on the notion of the&#xA;  credit risk premium. Using a series of excess returns to&#xA;  investment-grade corporate bonds going back to 1926, the authors find&#xA;  evidence of a positive risk premium of corporate bonds over&#xA;  Treasuries. However, investors who rely on a passive structural&#xA;  overweight should be aware of the substantial additional tracking&#xA;  error and the long payoff periods required. Second, they examine the&#xA;  behavior of credit excess returns through many cycles, using the OECD&#xA;  Composite Leading Index to divide economic activity into four&#xA;  re-occurring phases. At the margin, the results are useful in guiding&#xA;  portfolio managers and asset owners in their tactical decisions with&#xA;  regard to the magnitude of the credit tilt.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="19096" LastActivityDate="2017-07-20T03:14:58.130" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35185" PostTypeId="2" ParentId="35052" CreationDate="2017-07-20T03:49:35.163" Score="1" Body="&lt;p&gt;I am not aware of such package to exist, and I would be surprised if it does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason behind this is because the amount of &quot;meta&quot; data (exchange closing times per product etc...) is quite substantial and usually not readily available in API. Not that you would also probably have to have a time series of closing times, as some might evolve through time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a chance that some major banks or hedge funds keep track of such datasets, but they probably spent a good amount of resource on building it and won't be willing to give it away for free.&lt;/p&gt;&#xA;" OwnerUserId="467" LastActivityDate="2017-07-20T03:49:35.163" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35186" PostTypeId="1" CreationDate="2017-07-20T07:56:24.753" Score="2" ViewCount="11571" Body="&lt;p&gt;I would like to adress a question I have in mind and I didn't found a clear answer online.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When we deal with Barrier or Digital Options we have a discontinuty in the payoff, so that the derivatives (the Greeks) are very spiky and take large values around the barrier/strike. As a consequence, it would be a very complicated task to hedge this type of options because the trader would have to buy or sell huge amounts of the underlying, risking to have problems with liquidity and suffer some losses.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice I know that we have to apply a &lt;strong&gt;barrier shift&lt;/strong&gt;  to sligthly change the payoff structure and have more manageable deltas around the barrier/strike.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does it work? How can we choose this shift? Wouldn't be pricing a different option (with a different price) wrong? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most importantly, what if the underlying price goes around the shifted barrier? Here, we would have to buy/sell large amounts in order to delta hedge anyways.&lt;/p&gt;&#xA;" OwnerUserId="26657" LastActivityDate="2017-07-21T12:18:02.790" Title="Delta hedging on Barrier/Digital Options" Tags="&lt;options&gt;&lt;hedging&gt;&lt;barrier&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35187" PostTypeId="1" CreationDate="2017-07-20T08:36:07.780" Score="0" ViewCount="52" Body="&lt;p&gt;I'm quite confused regarding the computation of a YTM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I got a Portfolio of Single Loans 30Y(like a MBS) which are not traded and hence do not have a market price. &#xA;Now I want to compute the YTM in the usual manner but as far as I know in order to do so I need a (market) price, which does not exist in my case.&#xA;The only price I could get is the Present Value of the Mortgage?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;KS&lt;/p&gt;&#xA;" OwnerUserId="24804" LastActivityDate="2017-08-19T11:03:15.803" Title="YTM of a Fixed-Income Loan?" Tags="&lt;credit&gt;&lt;yield&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35188" PostTypeId="1" CreationDate="2017-07-20T08:48:48.423" Score="-1" ViewCount="556" Body="&lt;p&gt;I see several methods to modify the monte carlo model to price american option payoffs. However, the math looks a little too complex to model into excel - i am looking at the least square methods by longstaff and schwartz 2003.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;how can this be coded into vba?&lt;/p&gt;&#xA;" OwnerUserId="28664" LastActivityDate="2017-08-27T20:52:17.613" Title="I built a monte carlo simulation option pricer in excel. How do i modify it to price american options?" Tags="&lt;options&gt;&lt;vba&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35191" PostTypeId="2" ParentId="35188" CreationDate="2017-07-20T10:39:14.297" Score="1" Body="&lt;p&gt;How about trying a simple rule for early exercise.  For example , exercise if stock &gt; X, where C could be a constant or a vector.  Chose X to maximize the option value.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-07-20T10:39:14.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35192" PostTypeId="2" ParentId="35187" CreationDate="2017-07-20T11:00:28.433" Score="1" Body="&lt;p&gt;Yes, you need a market price to compute the yield to maturity. The YTM is just another way of expressing price that puts different bonds (e.g. with different maturities or coupon rates) onto something approaching the same footing. Since it is a transformation of price, you can't calculate it without knowing the price.&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2017-07-20T11:00:28.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35194" PostTypeId="1" AcceptedAnswerId="35196" CreationDate="2017-07-20T14:04:45.387" Score="6" ViewCount="6005" Body="&lt;p&gt;I want to forecast prices $S(t)$ of some asset based on historical daily values. I want to use the geometric Brownian motion given by an SDE:&#xA;$$dS=\mu S t + \sigma S dB,$$&#xA;where $B$ is a Brownian motion, for modeling. The historical prices are&#xA;$$\{S_i\}_{i=1}^N,$$&#xA;from which I calculate the log-returns ($N-1$ in total)&#xA;$$Z_i=\ln\frac{S_i}{S_{i-1}},$$&#xA;and the 1-day historical volatility as the standard deviation of the returns:&#xA;$$\hat{\sigma} = \sqrt{Var\{Z_i\}}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q1:&lt;/strong&gt; Let's say I want to forecast the prices $S(t)$ for 180 days. Should I take $\sigma$ in the SDE as the 1-day volatility $\hat{\sigma}$ or as $\sqrt{180}\hat{\sigma}$? I'd say that $\sigma=\hat{\sigma}$ as I'm modeling day by day, but is it correct?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Q2:&lt;/strong&gt; How do I compute the drift $\hat{\mu}$ from the historical prices?  Is it simply&#xA;$$\hat{\mu}=\frac{1}{N-1}\sum\limits_{i=1}^{N-1}Z_i,$$&#xA;and is it (the above formula) a &lt;em&gt;1-day drift&lt;/em&gt;?&lt;/p&gt;&#xA;" OwnerUserId="28878" LastActivityDate="2018-10-10T03:34:23.513" Title="Estimating the historical drift and volatility" Tags="&lt;volatility&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="35195" PostTypeId="1" AcceptedAnswerId="35198" CreationDate="2017-07-20T14:11:21.193" Score="3" ViewCount="2762" Body="&lt;p&gt;I have been working with Deposit Futures and the Brazilian One-Day Interbank Deposit Future but I can't get my head around them. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What exactly is delivered and when? What is the contract a right to?&lt;/p&gt;&#xA;" OwnerUserId="28388" LastActivityDate="2017-07-20T15:40:02.107" Title="What exactly is a deposit futures contract?" Tags="&lt;fixed-income&gt;&lt;futures&gt;&lt;derivatives&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35196" PostTypeId="2" ParentId="35194" CreationDate="2017-07-20T14:13:26.173" Score="5" Body="&lt;p&gt;By looking at log returns, you are examing the stochastic process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;Q_t = \log S_t&#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;\begin{align}&#xA;dQ_t &amp;amp; = \left( \mu - \tfrac{1}{2}\sigma^2\right) dt + \sigma\, dB_t \\&#xA;&amp;amp; \equiv \alpha \,dt + \sigma\, dB_t&#xA;\end{align}&#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;span class=&quot;math-container&quot;&gt;$\alpha=\mu-\tfrac{1}{2}\sigma^2$&lt;/span&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far, everything is in continuous time. To interpret the SDE, you need to know how much time passes when &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt; increases by one unit. If the distance between &lt;span class=&quot;math-container&quot;&gt;$t=0$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$t=1$&lt;/span&gt; is one day, then &lt;span class=&quot;math-container&quot;&gt;$Q_{t+1}-Q_t$&lt;/span&gt; is the daily log return, and &lt;span class=&quot;math-container&quot;&gt;$\mu$&lt;/span&gt; is the daily drift. However, if the distance between &lt;span class=&quot;math-container&quot;&gt;$t=0$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$t=1$&lt;/span&gt; is one year, then &lt;span class=&quot;math-container&quot;&gt;$\mu$&lt;/span&gt; is the annual drift.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's assume that one unit of &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt; is one day. Then defining &lt;span class=&quot;math-container&quot;&gt;$Z_i = Q_{i+1} - Q_i$&lt;/span&gt; (which is equivalent to your definition of log returns) the formula&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;\hat{\alpha} = \frac{1}{N-1} \sum_{i=1}^{N-1} Z_i&#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;gives the one-day drift for this process, and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;\hat{\sigma}^2 = \frac{1}{N-2} \sum_{i=1}^{N-1} (Z_i - \hat{\alpha})^2&#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;gives the one-day variance (hence &lt;span class=&quot;math-container&quot;&gt;$\hat{\sigma}$&lt;/span&gt; is the one-day standard deviation). To recover the estimator for the drift term &lt;span class=&quot;math-container&quot;&gt;$\mu$&lt;/span&gt; you define&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;\hat{\mu} = \hat{\alpha} + \tfrac{1}{2}\hat{\sigma}^2&#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want the 180-day drift and standard deviation, you need&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;\begin{align}&#xA;\hat{\mu}_{180} &amp;amp; = 180\hat{\mu} \\&#xA;\hat{\sigma}_{180} &amp;amp; = \sqrt{180}\,\hat{\sigma}&#xA;\end{align}&#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Purely as a point of notation, I would take your price observations to be &lt;span class=&quot;math-container&quot;&gt;$\{S_i\}_{i=0}^N$&lt;/span&gt; so that you have &lt;span class=&quot;math-container&quot;&gt;$N+1$&lt;/span&gt; price observations, and &lt;span class=&quot;math-container&quot;&gt;$N$&lt;/span&gt; daily returns. It will simplify your formulas later.&lt;/p&gt;&#xA;" OwnerUserId="924" LastEditorUserId="-1" LastEditDate="2018-10-10T03:34:23.513" LastActivityDate="2018-10-10T03:34:23.513" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="35198" PostTypeId="2" ParentId="35195" CreationDate="2017-07-20T14:45:13.023" Score="3" Body="&lt;p&gt;The One-Day Interbank Deposit Futures Contract (aka the DI contract) is a contract on the Brazilian one-day interbank rate. This is the rate at which large banks in Brazil lend and borrow from each other. The contract provides a way to hedge or speculate in short-term Brazilian interest rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This contract is financially, rather than physically, settled. That means that nothing is actually delivered. Rather, at the end of each day the holders of the contract have their account at the exchange credited or debited by an amount which reflects the one-day change in the deposit rate. The amount of debit or credit $X_t$ is given by the formula&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;X_t = N\times M\times \left( P_t - P_{t-1}F_t\right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $N$ is the number of contracts held, $M$ is the point value of the contract (i.e. number of Brazilian Real per contract point), $P_t$ is the price of the contract and $F_t$ is the correction factor, which is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;F_t = \prod_{j=1}^n \left( 1 + \frac{DI_{t-j}}{100}\right)^{1/252}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $DI_t$ is the interbank deposit rate for day $t$, and $n$ is the number of reserve days (aka business days) between the day that the debit/credit is being calculated for, and the last trading day. Typically $n=1$ unless there have been some holidays between today and the previous trading day. Note that weekends do not count as holidays, so $n=1$ between the close on Friday and the close on the following Monday.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the quantities $P_t$ is known as the &lt;em&gt;unit price&lt;/em&gt;. This is not actually what is quoted in the market - instead the interest rate $DI_t$ is quoted. The relationship between them is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;P_t = \frac{100,000}{\left(1 + \frac{DI_t}{100} \right)^{ \frac{N_t}{252} } }&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $N_t$ is the number of reserve days to maturity on day $t$ (i.e. it decreases by 1 for each business day that passes). In particular, on the final trading day you have $N_t=0$ and $P_t=100,000$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for what the contract is a right to - holding the contract merely gives you the right (or obligation) to the associated cashflows each day. Nothing is transferred between holders of this contract except for cash.&lt;/p&gt;&#xA;" OwnerUserId="924" LastEditorUserId="924" LastEditDate="2017-07-20T15:40:02.107" LastActivityDate="2017-07-20T15:40:02.107" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="35199" PostTypeId="1" AcceptedAnswerId="35200" CreationDate="2017-07-20T16:04:00.317" Score="2" ViewCount="360" Body="&lt;p&gt;At the moment I'm working with a banking system that calculates the discounted cash flows of a bond product in the following manner: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It uses the 'regular', exponential way of calculating discounted cash flows which can be translated into this equation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{1}{(1 + \text{yield})^t} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$t = \frac{\text{number of days between the valuation date and the maturity date}}{\text{number of days in a year}} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, for the last year before the maturity, when $t \leq 1$, it uses the simplified method instead:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{1}{ 1 + \text{yield} \times t} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't really know why this change in calculations happens, instead of just using the exponential method for all the flows. It is even stranger that it takes the last year and not the last coupon into account. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know what financial/business/mathematical reasons could be behind such a behaviour? &lt;/p&gt;&#xA;" OwnerUserId="28879" LastEditorUserId="20454" LastEditDate="2017-07-20T16:49:17.407" LastActivityDate="2017-07-20T16:55:57.163" Title="Discounted cash flows for bond valuation: exponential and simplified" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;valuation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35200" PostTypeId="2" ParentId="35199" CreationDate="2017-07-20T16:55:57.163" Score="2" Body="&lt;p&gt;This is simply a market convention. In most bond markets, compounded interest is used when discounting cash flows, EXCEPT when the bond is trading in its final coupon period, at which point simple interest is usually used. This is done to make the yield more comparable to other money market instruments, which are almost always quoted with simple interest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. I didn't understand the &quot;it takes the last year and not the last coupon into account&quot; part.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2017-07-20T16:55:57.163" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="35202" PostTypeId="1" CreationDate="2017-07-20T20:29:13.413" Score="1" ViewCount="453" Body="&lt;p&gt;I work at the trading desk P&amp;amp;L department at a large bank.&#xA;The trading desk has positions in almost all sorts of derivatives (options, futures) over a long list of stocks, currencies, commodities...&#xA;My boss asked me to do the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Show that it is not possible to predict next years P&amp;amp;L &lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Build a working econometric model to predict next year's P&amp;amp;L&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The daily P&amp;amp;L time series is really not stationary.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I tell my boss that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Non-stationarity $\Rightarrow $Cannot be predicted based exclusively on the time series. Is it true? &#xA;At least to start and show him that the time series is not enough to make predictions and that we will need, at least, a complex machine learning model to do so.&lt;/p&gt;&#xA;" OwnerUserId="25437" LastEditorUserId="25437" LastEditDate="2017-07-20T21:30:38.980" LastActivityDate="2017-07-20T22:00:25.910" Title="Predict the behavior of a time series (P&amp;L trading desk)" Tags="&lt;statistics&gt;&lt;econometrics&gt;&lt;prediction&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35203" PostTypeId="2" ParentId="35202" CreationDate="2017-07-20T22:00:25.910" Score="7" Body="&lt;p&gt;Without seeing your trading desk's P&amp;amp;L it's impossible to say whether it is predictable or not. But here are a few thoughts -&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;There's no reason to think that it isn't predictable. In general, financial time series are hardest to predict when the represent the return stream of an investible asset. A trading desk's P&amp;amp;L isn't really investible, so there is no reason to think that it will be unpredictable.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You certainly won't be able to predict the P&amp;amp;L with a large amount of certainty, but you may be able to make ballpark estimates.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Have you graphed the P&amp;amp;L to check if there is an obvious trend? For example, if markets are getting more efficient, you would expect P&amp;amp;L to be decreasing over time.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Is P&amp;amp;L correlated with other variables that you may be able to predict? For example, if the desk is engaged in market making, it will probably make more money when volatility is high and liquidity is low (as the desk is selling liquidity, and the price of liquidity is high when markets are more volatile). &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If the desk is trading illiquid instruments (e.g. exotic derivatives) the P&amp;amp;L series may be autocorrelated. This is especially true if P&amp;amp;L is correlated with volatility or liquidity, since vol and liquidity measures are autocorrelated.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Are the markets the desk is engaged in becoming more heavily traded, or less? P&amp;amp;L from market making is correlated with volume, and you may be able to make a reasonable guess about whether volume will be higher or lower next year.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;What you certainly &lt;em&gt;do not&lt;/em&gt; need is a complex machine learning model. As Lisa Ann said in a comment, you will do much better with visualisations, simple linear models, and a healthy dose of insight.&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2017-07-20T22:00:25.910" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="35204" PostTypeId="1" AcceptedAnswerId="43620" CreationDate="2017-07-21T00:45:47.527" Score="2" ViewCount="1686" Body="&lt;p&gt;I'm a noob trying to calculate IntraDay and Overnight Volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For &lt;strong&gt;Intraday volatility&lt;/strong&gt; we can get the annualization factor with the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Length (hours, Open to Close): 6.5&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Time frames per day: 24 / 6.5 = 3.6923&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Time frames per year: 252 * 3.6923 = 930.4596&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Annualization factor: SQRT(930.4596) = &lt;strong&gt;30.5034&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For &lt;strong&gt;Overnight&lt;/strong&gt; volatility, the annualization factor is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Length (hours, Close to Open): 17.5&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Time frames per day: 24 / 17.5 = 1.3714&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Time frames per year: 252 * 1.3714 = 345.5928&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Annualization factor: SQRT(345.5928) = &lt;strong&gt;18.5901&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With these parameters, I can calculate &lt;strong&gt;intraday volatility&lt;/strong&gt; as the standard deviation of the 20 most recent &lt;strong&gt;open-to-close&lt;/strong&gt; price changes, multiplied by the annualization factor, &lt;strong&gt;30.5034&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And overnight volatility can be calculated by the standard deviation of the 20 most recent &lt;strong&gt;close-to-open&lt;/strong&gt; price changes, multiplied by the annualization factor, &lt;strong&gt;18.5901&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems like this should be pretty straightforward since I have all the inputs but I'm not sure if I'm doing it right, especially in thinkorswim.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, I tried editing ThinkorSwim's default historical volatility study to the following (I only changed the the last two lines from the bottom):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#&#xA;# TD Ameritrade IP Company, Inc. (c) 2007-2017&#xA;#&#xA;&#xA;declare lower;&#xA;&#xA;input length = 20;&#xA;input basis = {default Annual, Monthly, Weekly, Daily};&#xA;&#xA;def ap = getAggregationPeriod();&#xA;&#xA;assert(ap &amp;gt;= AggregationPeriod.MIN, &quot;Study can only be calculated for time-aggregated charts: &quot; + ap);&#xA;&#xA;def barsPerDay = (regularTradingEnd(getYyyyMmDd()) - regularTradingStart(getYyyyMmDd())) / ap;&#xA;def barsPerYear =&#xA;    if ap &amp;gt; AggregationPeriod.WEEK then 12&#xA;    else if ap == AggregationPeriod.WEEK then 52&#xA;    else if ap &amp;gt;= AggregationPeriod.DAY then 252 * AggregationPeriod.DAY / ap&#xA;    else 252 * barsPerDay;&#xA;&#xA;def basisCoeff;&#xA;switch (basis) {&#xA;case Annual:&#xA;    basisCoeff = 1;&#xA;case Monthly:&#xA;    basisCoeff = 12;&#xA;case Weekly:&#xA;    basisCoeff = 52;&#xA;case Daily:&#xA;    basisCoeff = 252;&#xA;}&#xA;&#xA;def clLog = log(open / close[1]);&#xA;plot HV = stdev(clLog, length) * 30.5;&#xA;HV.SetDefaultColor(GetColor(0));&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this correct? Is there a simpler thinkscript/formula? Thanks very much. I appreciate it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;** Here's the graph its spitting out:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/awIBM.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/awIBM.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="28885" LastEditorUserId="28885" LastEditDate="2017-07-21T00:59:13.773" LastActivityDate="2019-01-26T19:37:46.307" Title="What is the formula for Intraday and overnight volatility?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;implied-volatility&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35206" PostTypeId="1" AcceptedAnswerId="35235" CreationDate="2017-07-21T01:22:02.193" Score="0" ViewCount="482" Body="&lt;p&gt;Suppose I look at a 36 month loan for \$10,000 at 20%. Thus my payment per month is \$166.67. Thus my IRR should be 20% (on an annualized basis).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let's suppose I prepay my loan early at the end of 24 months. Doing the calculation, I still get the same IRR of 20%. Can someone confirm that this is in fact the case?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&#xA;Greg&lt;/p&gt;&#xA;" OwnerUserId="13419" LastEditorUserId="20582" LastEditDate="2017-07-21T01:46:01.703" LastActivityDate="2017-07-23T08:38:12.617" Title="Question about IRR and early prepayment" Tags="&lt;present-value&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35208" PostTypeId="1" CreationDate="2017-07-21T05:47:09.037" Score="2" ViewCount="245" Body="&lt;p&gt;This question is motivated by my experience of meeting some markets professionals who claimed certain things about Black Scholes and option pricing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;So I am wondering what are some of the common misconceptions within Quantitative Finance that people have encountered?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="28454" LastEditorUserId="28454" LastEditDate="2017-07-21T05:52:57.147" LastActivityDate="2017-07-25T00:25:37.197" Title="Common misconceptions in Quantitative Finance?" Tags="&lt;finance&gt;&lt;quantitative&gt;" AnswerCount="2" CommentCount="0" ClosedDate="2017-07-23T04:29:38.177" ContentLicense="CC BY-SA 3.0" />
  <row Id="35209" PostTypeId="2" ParentId="35011" CreationDate="2017-07-21T07:16:05.320" Score="5" Body="&lt;p&gt;On more than a few occasions, I have attempted to extrapolate the current trend towards passive allocation to its logical conclusion: more passive allocation means more inefficiency. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not aware of any research which directly measures the correlation between market efficiency and active versus passive allocation. In general, the level of market efficiency &lt;strong&gt;should&lt;/strong&gt; be hard to measure (see related topic: &lt;a href=&quot;https://quant.stackexchange.com/questions/15896/what-are-the-empirical-limitations-to-testing-market-efficiency&quot;&gt;What are the empirical limitations to testing market efficiency?&lt;/a&gt;). However, I believe that the converse is indirectly measurable: pricing &quot;anomalies&quot; and/or risk-premia tend to dissipate following their discovery and/or the publication of a more efficient (i.e, &quot;better&quot;) model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If one concludes that the dispersion of knowledge regarding pricing inefficiencies has lead the market to become more efficient as market participants act on this knowledge, then one may tentatively accept the converse: the flight of capital away from active management may lead to greater inefficiency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Examples of &quot;alpha&quot; diffusion and then decay abound. Notably:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Fama-French factors have decreased in efficacy over time. In the 2004 paper, &quot;&lt;a href=&quot;https://nccur.lib.nccu.edu.tw/bitstream/140.119/72703/1/1822.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;On the Cross-Section of Expected Stock Returns: Fama-French Ten Years Later&lt;/a&gt;&quot;, the authors found that &quot;using the Fama-Mac Beth two-pass regression, that the size effect becomes insignificant during the post-1981 period, and the Book/Market effect becomes insignificant during the post-1990 period.&quot;&lt;/li&gt;&#xA;&lt;li&gt;Following several papers on the momentum anomaly, notably with Carhart's 1994 paper, momentum's ability to predict future returns has notably diminished.&lt;/li&gt;&#xA;&lt;li&gt;On a recent &lt;a href=&quot;http://ritholtz.com/2017/07/mib-ed-thorp-beat-vegas-wallst/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Master's in Business podcast&lt;/a&gt; with Barry Ritholz, guest Ed Thorp discusses the efficacy of the Black-Scholes model following &lt;a href=&quot;https://www.cs.princeton.edu/courses/archive/fall09/cos323/papers/black_scholes73.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;its publication in 1973&lt;/a&gt;. Thorp had been using equations similar to the Black-Scholes for approximately five years before the paper was published. He noted in the interview that traders were slow to latch on to more rigorous pricing mechanisms, but eventually did so. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This concept of active versus management and inefficiency might be exemplified through a thought experiment in which all market participants woke up tomorrow fully believing in the absolute truth of EMH. These converts would then be motivated by the belief that active management is futile; allocation decisions would be purely driven by the mechanistics of MPT and mean-variance optimization. Throw out risk-premia, fundamental analysis, technical analysis, everything -- the market prices already reflect all expectations of future risk and reward. Given that it is impossible for the average money manager who charges fees to out-perform the &quot;average&quot;, the shift towards passive management is justifiable. Yet, some price discovery through active allocation is necessary for the EMH to work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problems of herd behavior in the context of MPT are more eloquently outlined in the 2014 paper, &quot;&lt;a href=&quot;http://www.tandfonline.com/doi/abs/10.1080/20430795.2012.738600&quot; rel=&quot;nofollow noreferrer&quot;&gt;Modern portfolio theory and risk management: assumptions and unintended consequences&lt;/a&gt;&quot;, in which the authors define some problems underlying the assumption of MPT, namely: &quot;information asymmetry and bounded rationality; the joint hypothesis problem and random walk hypotheses.&quot; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question then may become, &quot;how much active capital is required to provide an efficient price discovery mechanism?&quot;. To my knowledge, this remains an open question but I believe that the threshold whereby flight from active management leads to inefficiency may still be a ways off. Currently, I believe about half of the equity money managers are active versus passive. However, much of the assets under active management are actually passively managed (vis-a-vis, &quot;closet indexing&quot;) as measured by a fund's &quot;&lt;a href=&quot;http://ActiveShare.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;active share&lt;/a&gt;&quot;. While this seems like a lot of passive money, the dismal performance of hedge funds over the past decade is evidence that active management is still saturated. Moreover, the rise of algorithmic finance through vast computational power, data analytics, and instantaneous communication has probably left less room for active management to exploit anomalies and inefficiencies.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="28193" LastEditDate="2017-07-21T18:46:56.127" LastActivityDate="2017-07-21T18:46:56.127" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35210" PostTypeId="2" ParentId="35186" CreationDate="2017-07-21T08:02:16.967" Score="7" Body="&lt;p&gt;You're right that the &quot;real&quot; greeks of a digital option are unwieldy, e.g. delta is zero everywhere except at the barrier where it is an impulse. So sell-side trading desks model/price digital options as tightly struck call/put spreads that will sit and play nicely with the rest of the book. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a simple example: let's say a bank sells a digital call on AAPL that pays \$1000 if the stock is over \$150 at expiry. This could be modeled as being short 100 \$140/\$150 call spreads. So if the stock ends up at \$155, the trader would have hedged against a payout that matches the digital (\$1000 = 100 call spreads * \$10 strike difference). In this case, there is no gap/fixing risk upon expiry. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, what's the problem with this? In short, the price the trader quotes for the digital is going to be very noncompetitive, as the person asking for the digi could go and just purchase call spreads themselves (though this is not possible for all underlyings), and so the trader will soon be out of a job.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can he/she show a better price? Basically in one of two ways:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Using more &lt;strong&gt;leverage&lt;/strong&gt;, meaning that they would model the digi call as a tighter call spread. The tighter the strikes used to model, the more call spreads it would require, and the larger/more discontinuous the greeks would be in the book. E.g. if modeled as 145/150, it would require 200 spreads, 1000 spreads for 149/150 and so on. Still no gap risk.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Using what you call a &lt;strong&gt;barrier shift&lt;/strong&gt;. Here's where things can get spicy. In short, this is changing where the call spread used to model the digi is centered. Let's say the trader models the \$150 digi call as 500 \$149/\$151 call spreads (so one on either side of the digi strike rather than both at/below in our first example). Then his/her price on the digi is going to certainly be a bit better for the client. But what happens if the stock is at \$150.50 upon the digi expiry? Then the trader would effectively be due to pay out the \$1000 but only have \$750 from their hedges (since they hedged against the call spreads, paying 500 * (150.50-149) = 750), and so would realise a fixing loss upon expiry of \$250.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The trader must assess how much &lt;strong&gt;leverage&lt;/strong&gt; is realistic or practical (a) in the context of the rest of their trading book and greek management and (b) to your point, given the &lt;strong&gt;liquidity&lt;/strong&gt; in the underlying market for delta/vega hedging. At this point, they're likely to still be uncompetitive without taking &lt;strong&gt;some&lt;/strong&gt; (unhedgeable) gap risk via a barrier shift, but they would seek to keep their total digital exposure to a modest amount at any given time.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2017-07-21T08:02:16.967" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35211" PostTypeId="2" ParentId="35186" CreationDate="2017-07-21T09:24:16.763" Score="5" Body="&lt;p&gt;I nearly agree with @phlsmk's answer, but with some small differences.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First off, the delta of a digital is &lt;em&gt;not&lt;/em&gt; &quot;zero everywhere except at the barrier where it is an impulse&quot;. This is what it is at $t=T$. before this, it is smoothed out, exactly like a regular option is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is on what the delta may become. This is not the only place where it happens.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's look at an example, just a vanilla call. K=100, r=q=0 (i.e. no drift, fwd is whatever the spot is), $\sigma$=20% (changing the vol. in all these examples will just be like changing the time, so it doesn't really make a difference to the answer). Below, &lt;code&gt;adu&lt;/code&gt; is absolute delta/unit, and &lt;code&gt;aguu&lt;/code&gt; is absolute gamma/unit/unit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/lSjiW.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/lSjiW.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;note how as the time goes to zero, the payoff approaches a cusp. Here are the delta and gamma:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/LT4gC.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/LT4gC.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/oL0FR.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/oL0FR.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, i think it's fairly easy to see that as $t \to T$ this becomes unmanageable to hedge.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One method to deal with this is to break up the option into several, with different strikes spread around the original one. Here's what that looks like (with the $t=1.0$ pv overlayed in orange for comparison):&#xA;&lt;a href=&quot;https://i.stack.imgur.com/9jksT.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/9jksT.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and here's the difference in price as time goes on:&lt;a href=&quot;https://i.stack.imgur.com/KaRB7.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/KaRB7.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Okay, so delta and gamma?&#xA;&lt;a href=&quot;https://i.stack.imgur.com/uB6Jx.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/uB6Jx.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/a2DTU.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/a2DTU.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the delta has an extra step in the middle, and the gamma is still spikey, but now each spike is half the size of before. Obviously we can do better still.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's do a strip of options spread from 90 to 110.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's our new payoff, and the comparison to the original:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/H6pMf.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/H6pMf.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/su0BX.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/su0BX.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And again, delta and gamma:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/4ARx6.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/4ARx6.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/8Wzlb.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/8Wzlb.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, you can see that by spreading out our payoff, we can reduce the &lt;em&gt;potential&lt;/em&gt; risk we may face in the future, with only a minimal increase in cost.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is just for a vanilla option - but a digital is essentially the first derivative of a call wrt. strike, so just swap gamma for delta in the examples above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously the more you smear out the barriers, the higher the cost will be. This is where risk limits come in. If you want to do one of these trades in small size, there is no need for this, since the maximum risk will be small. If you come to me and ask to do a 100mm digital though, then i could potentially have a very large hedge on my hands, so i will smooth the payout to reduce that risk - this is just another cost of doing a large trade. If you can find someone else who is happier to accept enormous risk, then perhaps they will offer you a lower price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I disagree that doing this will make your prices non competitive, as it is an extremely standard thing to do -&gt; everyone does it. How much may differ, but as i mentioned already, this is also dependent on size. And as you move to larger size, the market is going to shrink anyway, so you're going to expect costs to increase.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And for the barrier shift - why would the bank ever do this in any direction other than against the client? When done like this, the PnL at expiry is always $\geqslant0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;eidt:&#xA;so, i spent a little longer toying around with my spreadsheet for this - you can do even better. Why weight the notionals of the options evenly? If we weight them according to a normal, we can get nicely behaved greeks all the time, even at $t=T$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/CAbcf.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/CAbcf.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/8ZvaU.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/8ZvaU.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/QqVNO.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/QqVNO.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/4MWC7.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/4MWC7.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where that last one is the delta of your digital. Notice that the two methods are different - the first has a lower level for the whole region, but it appears abruptly. the second has a larger maximum but approaches slowly. Which you decide to go with will depend on how you want to manage things.&lt;/p&gt;&#xA;" OwnerUserId="19663" LastEditorUserId="19663" LastEditDate="2017-07-21T12:18:02.790" LastActivityDate="2017-07-21T12:18:02.790" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35212" PostTypeId="2" ParentId="35208" CreationDate="2017-07-21T11:26:51.893" Score="0" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Black-Scholes: One of the biggest misconceptions is that the general&#xA;BSM-Formula is a &quot;law of nature&quot;. People sometimes forget the word &quot;model&quot;.   That's why in the field of finance there is an enormous amount of other models, which try to make option-pricing as realistic as possible (stochastic volatility, jump-processes&#xA;etc.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Continuous time: How do u define &quot;continuous time&quot;? This is a highly&#xA;    theoretical construct. So can the markets be described as&#xA;    &quot;continuous&quot;? Indeed they are actually discrete. This misconception&#xA;    is also related to the first Topic.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Probability theory: Some scientists argue that our probability theory is still just a theory and not a natural law. Indeed, there are a few more other probability theories which we forgot. For more details I can recommend the book &quot;The Black Swan&quot; from Taleb.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="24804" LastEditorUserId="185" LastEditDate="2017-07-25T00:25:37.197" LastActivityDate="2017-07-25T00:25:37.197" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35213" PostTypeId="2" ParentId="35208" CreationDate="2017-07-21T14:09:12.840" Score="2" Body="&lt;p&gt;Paul Wilmott wrote a book that addresses the subject pretty well. A solid read. &#xA;&lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/1119358612&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Money Formula&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12142" LastActivityDate="2017-07-21T14:09:12.840" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35214" PostTypeId="1" AcceptedAnswerId="35223" CreationDate="2017-07-21T14:35:22.813" Score="1" ViewCount="130" Body="&lt;p&gt;An interesting problems I have been dealing with as a relatively new quant to the Electricity markets is the difficulty of back testing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The issues I have been having with backtesting are that the framework needs to be able to work over two series, a purchase in the day ahead market and a sale in the real time market 24hr after. some of the backtesting frameworks like &lt;a href=&quot;http://pmorissette.github.io/bt/index.html#features&quot; rel=&quot;nofollow noreferrer&quot;&gt;bt&lt;/a&gt; and &lt;a href=&quot;https://www.backtrader.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;backtrader&lt;/a&gt; work great for normal single series models but don't hold up for a double series market, atleast with out significant customization which may be the fastest route.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wondering if anyone has encountered a similar problem? &lt;/p&gt;&#xA;" OwnerUserId="17012" LastEditorUserId="17012" LastEditDate="2017-07-24T12:38:26.313" LastActivityDate="2017-07-24T12:38:26.313" Title="Dual Settlement Market Backtesting and Analysis" Tags="&lt;backtesting&gt;&lt;python&gt;&lt;commodities&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35215" PostTypeId="2" ParentId="35011" CreationDate="2017-07-21T15:48:00.423" Score="4" Body="&lt;p&gt;First, you might find &lt;a href=&quot;https://papers.ssrn.com/sol3/Papers.cfm?abstract_id=2625975&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; recent paper by Israeli, Lee and Sridharan (Review of Accounting Studies, forthcoming) interesting. This is the abstract:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;We examine whether an increase in ETF ownership is accompanied by a decline in pricing efficiency for the underlying component securities. Our tests show an increase in ETF ownership is associated with: (1) higher trading costs (bid-ask spreads and market liquidity); (2) an increase in “stock return synchronicity”; (3) a decline in “future earnings response coefficients”; and (4) a decline in the number of analysts covering the firm. Collectively, our findings support the view that increased ETF ownership can lead to higher trading costs and lower benefits from information acquisition. This combination results in less informative security prices for the underlying firms.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Second, Seth Klarman from Baupost published some interesting thoughts on this matter in his 2016 letter to investors (not public, but copies surface here and there):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;One of the perverse effects of increased indexing and ETF activity is that it will tend to ‘lock in’ today's relative valuations between securities. When money flows into an index fund or index-related ETF, the manager generally buys into the securities in an index in proportion to their current market capitalization (often to the capitalization of only their public float, which interestingly adds a layer of distortion, disfavoring companies with large insider, strategic, or state ownership). Thus today's high-multiple companies are likely to also be tomorrow's, regardless of merit, with less capital in the hands of active managers to potentially correct any mispricings. Conversely with money pouring into market indices, stocks outside the indices may be cast adrift, no longer attached to the valuation grid but increasingly off of it. This should give long-term value investors a distinct advantage. The inherent irony of the efficient market theory is that the more people believe in it and correspondingly shun active management, the more inefficient the market is likely to become.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Third, I agree that there seems to be a contradiction: The &lt;a href=&quot;https://www.economist.com/news/finance-and-economics/21723845-sheer-luck-good-past-returns-predicting-future-performance-fund&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;iron law of costs&quot; (no correlation between gross fund performance and fees, hence a negative correlation between net fund performance and fees)&lt;/a&gt; means that investors will be worse off if they try to beat the market. Nevertheless, investors trying to beat the market actually contribute to valuable public goods, such as scrutiny of listed companies and the efficiency of capital allocation in the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would argue that &lt;strong&gt;passive investing&lt;/strong&gt; and &lt;strong&gt;index investing&lt;/strong&gt; are not exactly the same thing and that this difference is crucial to understand this contradiction. In order to save costs, investors should abstain from trying to beat the market; the advantage of &lt;strong&gt;passive investing&lt;/strong&gt; is that costs are lower. However, can the cost-saving goal of &lt;strong&gt;passive investing&lt;/strong&gt; only be achieved by EXACTLY replicating an index (i.e., &lt;strong&gt;index investing&lt;/strong&gt;) or could investors just as well simply build their own low-maintenance portfolio of 50-100 big companies? My point is thus that the goals of &lt;strong&gt;passive investing&lt;/strong&gt; could largely be achieved without giving way to the disadvantages of &lt;strong&gt;index investing&lt;/strong&gt; (in short, less efficient capital markets). In this spirit, the third resource that you might find interesting is &lt;a href=&quot;https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/253454/bis-12-917-kay-review-of-equity-markets-final-report.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Kay Review of UK Equity Markets and Long-Term Decision Making&lt;/a&gt;, a report published in 2012 on behalf of the UK government. On this specific topic, Kay writes:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The objectives of ‘passive investment’ strategies may not be best achieved (other than tautologically) by replicating a benchmark index based on all stocks in a particular category, if that category is not defined by any criteria of relevance to the underlying beneficiaries. An indexed portfolio holds a wide range of stocks – the widest possible in any asset class – but holding a wide range of stocks is not the same as holding a diversified portfolio. An index fund is concentrated in a few sectors – in the UK index financials were once heavily represented, now oil and mining are [remember, this was written in 2012]. Telecommunications and pharmaceuticals are over-represented relative to their contribution to economic activity, because these activities are mostly&#xA;  conducted by large companies. House-building is mostly conducted by small businesses; automobile construction is not included in the UK index because it is mostly conducted by foreign companies. ‘Fundamental indices’ whose weights are related to the economic significance of companies or markets rather than based on market capitalisation are an attempt to devise passive strategies which avoid these defects, and also to escape the losses from long-run mean reversion which arise from the adoption of market weightings in index funds or benchmarks. Index funds are necessarily overweight in overpriced sectors and underweight in underpriced sectors and this is true even if one has no knowledge of which&#xA;  sectors are over or underpriced.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Should passive strategies be based on indices at all? Interest in passive strategies developed in the 1970s as a result of scepticism about the ability of asset managers to pick stocks successfully and concern about the level of fees and costs of turnover associated with many active management strategies. One large endowment described to us the development of a portfolio of large, global&#xA;  companies with the intention of building stakes in these companies and holding them indefinitely. Such a strategy may have lower trading costs than even a conventionally passively managed fund. We note that several asset managers are now developing similar investment strategies.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;(Of course, one of the reasons why &lt;strong&gt;passive investing&lt;/strong&gt; is often conflated with &lt;strong&gt;index investing&lt;/strong&gt; is that investors are increasingly unwilling to tolerate even short bouts of underperformance versus the index. See p. 40-42 of the Kay Review for more details on these cultural / psychological / institutional mechanisms.)&lt;/p&gt;&#xA;" OwnerUserId="28193" LastActivityDate="2017-07-21T15:48:00.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35216" PostTypeId="1" AcceptedAnswerId="35218" CreationDate="2017-07-21T16:30:27.570" Score="3" ViewCount="2004" Body="&lt;p&gt;The &quot;Shiller P/E regression&quot; refers to the regression of real stock market returns over the next 20 years on the Shiller P/E. When I did this OLS regression myself (based on the data from Prof. Shiller), I got an R-squared of c. 67% and a p value for the regression of essentially zero (corresponding F stat of over 1600).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, are the aforementioned OLS stats (R-squared, p value) the right ones to think about the goodness of fit and the significance of the regression? I am worried about the issue of overlapping time periods in the sample; i.e. the first item in the sample contains annualized real returns from Jan 1928 to Jan 1948, then the second item contains annualized real returns from Feb 1928 to Feb 1948 - thus the two items in the sample overlap for a whole 19 years and 11 months. Doesn't this somehow lower the &quot;information content&quot; in my sample compared to a sample that were to only contain non-overlapping time periods?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this is an issue mentioned by Prof. Shiller himself in his book Irrational Exuberance (I have the 2nd edition from 2005 in front of me, p. 187):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The relation between price-earnings ratios and subsequent returns appears to be moderately strong, though there are questions about its statistical significance, since there are fewer than twelve nonoverlapping ten-year intervals in the 155 years' worth of data.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In the corresponding footnote, he further writes (p. 261 in my book):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;However, the actual academic literature has still not resolved the question of statistical significance. There are unresolved statistical complexities, notably those due to the problem of (near) unit roots in the ratios and the dependency of both independent and dependent variables on price. There are other statistical issues too: a tendency toward rare big outlier observations, issues of the relevance of asymptotic distribution theory in small samples, questions about regime change, and measurement issues for the underlying data, as well as difficulty interpreting complex statistical evidence that has been selectively presented by a researcher who may have a preconceived bias.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;He then presents a series of academic papers that address some of these issues and that arrive at differing conclusions. However, most of the papers cited in my edition (2005) are by now a bit dated and hence I am wondering whether a consensus has by now evolved in the academic literature.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;(I am aware of &lt;a href=&quot;https://quant.stackexchange.com/questions/740/time-series-regression-with-overlapping-data&quot;&gt;this question&lt;/a&gt; that deals with overlapping time periods but I was wondering whether any progress has been made specifically on the topic of the &quot;Shiller P/E regression&quot;.)&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="28193" LastActivityDate="2018-09-11T18:23:35.090" Title="How can you determine the correct significance of the Shiller P/E regression?" Tags="&lt;equities&gt;&lt;regression&gt;&lt;valuation&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35217" PostTypeId="1" CreationDate="2017-07-21T17:46:54.103" Score="-1" ViewCount="912" Body="&lt;p&gt;Does anyone here has a code for &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2225753&quot; rel=&quot;nofollow noreferrer&quot;&gt;HY estimator&lt;/a&gt;, preferably in python?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have written a very basic code in python but my results are weird. When I run it for two liquid assets traded on two different exchanges simultaneously, I get a correlation of only 0.8% and a lead/analysis shows a kink at 1-sec. It is the same asset trading in two places so the correlation has to be fairly significant and 1-sec of lead/lag is very very unlikely. I was wondering if someone can help or share a few pointers?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know of the yuima library in R which implements this, but my knowledge of R minimal and hence looking for some help.&lt;/p&gt;&#xA;" OwnerUserId="15428" LastEditorUserId="15428" LastEditDate="2017-07-27T08:27:33.767" LastActivityDate="2017-07-28T11:37:05.503" Title="Code for HY Estimator" Tags="&lt;high-frequency&gt;&lt;high-frequency-estimators&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35218" PostTypeId="2" ParentId="35216" CreationDate="2017-07-21T18:28:09.993" Score="2" Body="&lt;h1&gt;Overlapping observations leads to correlation of error terms&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Let $r_{t \rightarrow t+k}$ be the log return from time $t$ to $t+k$. Imagine you're running a regression forecasting $k$ year returns using yearly data:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ r_{t \rightarrow t + k} = a + b x_t + \epsilon_{t+k}$$&#xA;    Your intuition is correct that there's a problem with conventional standard errors.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;For reference, non-overlapping returns $r_{t \rightarrow t+1}$ generally can be assumed to have zero autocorrelation and there's no issue.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;But with overlapping $k$ period returns, the error terms $\epsilon_{t}, \ldots, \epsilon_{t+k-1}$ will be autocorrelated. (Two adjacent $k$ period returns will have $k-1$ overlapping periods.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;Hansen Hodrick (1980) standard errors&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;A sensible starting point is to compute Hansen Hodrick (1980) standard errors with $k-1$ overlapping periods. Some MATLAB code below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;b  = X \ y;           %solve b = (x'x)^-1 (x' y)&#xA;resid = y - X * b;    &#xA;Sxx = (X'*X/n);    &#xA;residrep = resid * ones(1,cols2);&#xA;V = (X .* residrep)' * (X .* residrep) / n;    &#xA;for i=1:k-1,&#xA;    V_lag = (X(1:end-i,:) .* residrep(1:end-i,:))' * (X(i+1:end,:) .* residrep(i+1:end,:)) / n;&#xA;    V = V + V_lag + V_lag';&#xA;end;    &#xA;Sxx_inv = inv(Sxx);&#xA;bcov = Sxx_inv * V * Sxx_inv / n;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;John Cochrane's book &lt;em&gt;Asset Pricing&lt;/em&gt; also discusses how to do this on p. 209.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Other approaches?&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Glancing through the literature, there's some debate as to the small sample properties of the Hansen Hodrick (1980) correction and several others have been proposed. The answer you linked to on Cross-Validated provides some references on the subject. &lt;/p&gt;&#xA;&#xA;&lt;h3&gt;References&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Ang, Andrew and Geert Bekaert, 2007, &quot;&lt;a href=&quot;http://www.jstor.org/stable/4494784&quot; rel=&quot;nofollow noreferrer&quot;&gt;Stock Return Predictability: Is It There?&lt;/a&gt;&quot; &lt;em&gt;Review of Financial Studies&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cochrane, John, 2005, &lt;em&gt;Asset Pricing (revised)&lt;/em&gt; p. 209 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cochrane, John, 2011, &quot;&lt;a href=&quot;https://faculty.chicagobooth.edu/john.cochrane/research/papers/discount_rates_jf.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Discount Rates&lt;/a&gt;,&quot; &lt;em&gt;Journal of Finance&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hansen, Lars P. and Robert J. Hodrick, 1980, &quot;Forward Exchange Rates as Optimal Predictors of Future Spot Rates: An Econometric Analysis,&quot; &lt;em&gt;Journal of Political Economy&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2018-09-11T18:23:35.090" LastActivityDate="2018-09-11T18:23:35.090" CommentCount="5" ContentLicense="CC BY-SA 4.0" />
  <row Id="35223" PostTypeId="2" ParentId="35214" CreationDate="2017-07-22T06:15:29.050" Score="1" Body="&lt;p&gt;&lt;code&gt;backtrader&lt;/code&gt; supports the spot/day-ahead pattern, which was developed explicity for energy markets. See&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.backtrader.com/blog/posts/2017-03-15-future-vs-spot/future-vs-spot.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.backtrader.com/blog/posts/2017-03-15-future-vs-spot/future-vs-spot.html&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://community.backtrader.com/topic/221/power-futures-settlement&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://community.backtrader.com/topic/221/power-futures-settlement&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="17554" LastActivityDate="2017-07-22T06:15:29.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35224" PostTypeId="1" AcceptedAnswerId="35225" CreationDate="2017-07-22T07:04:53.417" Score="2" ViewCount="170" Body="&lt;p&gt;Let $S\left(t\right)$ be a tradable financial security that doesn't generate cash flow (eg no dividend). $S\left(t\right)$ follows an unknown stochastic process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We now have a financial derivative that pays $\frac{S\left(T_2\right)} {S\left(T_1\right)}$ at $t=T_2$, where $0&amp;lt;T_1&amp;lt;T_2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume interest rate $r_t$ is not constant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What's the present value of this financial derivative at $t=0$ ?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;My attempt so far:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V\left(0\right)=E^{\mathbb{Q}}\left[e^{-\int_{0}^{T_2}r_t\,dt} \frac{S\left(T_2\right)}{S\left(T_1\right)}\right]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe my next step should be to get rid of the discount factor term. Any idea how can I do that?&lt;/p&gt;&#xA;" OwnerUserId="6428" LastActivityDate="2018-01-03T23:05:06.313" Title="Calculate $E^{\mathbb{Q}}\left[e^{-\int_{0}^{T_2}r_t\,dt} \frac{S\left(T_2\right)}{S\left(T_1\right)}\right]$" Tags="&lt;option-pricing&gt;&lt;risk-neutral-measure&gt;&lt;martingale&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35225" PostTypeId="2" ParentId="35224" CreationDate="2017-07-22T10:37:53.167" Score="4" Body="&lt;p&gt;We assume &lt;a href=&quot;https://en.wikipedia.org/wiki/Black%E2%80%93Scholes_model&quot; rel=&quot;nofollow noreferrer&quot;&gt;a Black-Scholes world&lt;/a&gt; &lt;em&gt;except&lt;/em&gt; the dynamics of the stock price, namely:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;No arbitrage opportunities.&lt;/li&gt;&#xA;&lt;li&gt;No dividend payments from the stock.&lt;/li&gt;&#xA;&lt;li&gt;Existence of a riskless asset yielding the risk free rate $-$ which here we assume non-constant, $(r_t)_{t \geq 0}$.&lt;/li&gt;&#xA;&lt;li&gt;Possibility to borrow and lend infinitely at the risk-free rate.&lt;/li&gt;&#xA;&lt;li&gt;Possibility to buy and sell infinitely the stock $-$ &lt;em&gt;even fractional amounts&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li&gt;No transaction costs.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;We also assume that the stock is tradable and that the derivative is attainable $-$ we basically assume we are in the standard pricing setting except for the stock price dynamics. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the price at time $t=0$, $V(0)$, of the derivative is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ V(0) = P(0,T_1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $P(0,T_1)$ is the price of a riskless zero-coupon contracted at time $t=0$ and maturing at time $t=T_1$ $-$ which is effectively a function of the rate $r_t$ and is independent of $S(t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Financial proof&lt;/strong&gt;: the financial derivative you describe delivers a quantity $w$ of the stock at time $T_2$, where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ w = \frac{1}{S(T_1)}$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus $w$ will only be known at time $T_1$, when you will buy $w$ shares of the stock. But at that time, the value of such a position is trivially equal to $\$1$. Thus you only need to have $\$1$ at time $T_1$ to settle the trade at maturity $T_2$; no further transactions are needed. The value today of $\$1$ at $T_1$ is simply equal to the value of a zero-coupon bond contracted at $t=0$ and maturing at $T_1$. Hence:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ V(0) = P(0,T_1)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Mathematical proof&lt;/strong&gt;: under the assumptions listed at the beginning, by the law of iterated expectations, adaptedness of the stock price with respect to a suitable filtration $(\mathcal{F})_{t \geq 0}$ and the martingality property of discounted stock prices under the risk-neutral measure $\mathbb{Q}$, we obtain:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;V(0) &amp;amp; = E^{\mathbb{Q}}\left[e^{-\int_0^{T_2}r_t\,dt} \frac{S(T_2)}{S(T_1)}\right] &#xA;\\[6pt]&#xA;&amp;amp; = E^{\mathbb{Q}}\left[E^{\mathbb{Q}}\left[e^{-\int_0^{T_2}r_t\,dt} \frac{S(T_2)}{S(T_1)}|\mathcal{F}_{T_1}\right]\right]&#xA;\\[6pt]&#xA;&amp;amp; = E^{\mathbb{Q}}\left[e^{-\int_0^{T_1}r_t\,dt}\frac{1}{S(T_1)}E^{\mathbb{Q}}\left[e^{-\int_{T_1}^{T_2}r_t\,dt} S(T_2)|\mathcal{F}_{T_1}\right]\right]&#xA;\\[6pt]&#xA;&amp;amp; = E^{\mathbb{Q}}\left[e^{-\int_0^{T_1}r_t\,dt}\frac{1}{S(T_1)}S(T_1)\right]&#xA;\\[9pt]&#xA;&amp;amp; = P(0,T_1)&#xA;\end{align} $$&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-07-22T14:27:27.867" LastActivityDate="2017-07-22T14:27:27.867" CommentCount="13" ContentLicense="CC BY-SA 3.0" />
  <row Id="35226" PostTypeId="1" AcceptedAnswerId="35270" CreationDate="2017-07-22T13:00:01.817" Score="1" ViewCount="323" Body="&lt;p&gt;In the book McMillian on Options the author states that in some cases an option market maker hedges himself by purchasing longer dated options. Unfortunately, the author does not go into detail why the market maker does that. I was unable to find on the internet literature that this is actually true. I was wondering if someone could confirm this and explain why this is the case?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Rephrased the question.&lt;/p&gt;&#xA;" OwnerUserId="23856" LastEditorUserId="23856" LastEditDate="2017-07-24T17:47:31.370" LastActivityDate="2017-07-25T00:20:05.630" Title="Option Market Making: Hedging large volumes" Tags="&lt;options&gt;&lt;market-making&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35227" PostTypeId="1" CreationDate="2017-07-22T13:09:57.657" Score="-1" ViewCount="659" Body="&lt;p&gt;How to derive Generalised Black equation for Option on Future using generalised Black Scholes Equation &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$F=exp(r(T−t))S$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\partial V}{\partial t} + \frac{1}{2}\sigma^2F^2\frac{\partial^2 V}{\partial F^2}  -rV = 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From&#xA;$$\frac{\partial V}{\partial t} + \frac{1}{2}\sigma^2S^2\frac{\partial^2 V}{\partial S^2} + rS\frac{\partial V}{\partial S} -rV = 0$$&lt;/p&gt;&#xA;" OwnerUserId="28901" LastEditorUserId="28901" LastEditDate="2017-07-23T12:23:36.167" LastActivityDate="2017-07-23T12:23:56.763" Title="Option on Futures - Black Equation Derivation" Tags="&lt;black-scholes&gt;" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="35228" PostTypeId="1" CreationDate="2017-07-22T14:21:44.853" Score="0" ViewCount="358" Body="&lt;p&gt;I built a trading model to predict the FTSE index. However, apparently one cannot trade the FTSE directly, but only different underlying products.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My model trains on the FTSE index, however tradeable FTSE futures are 20% different in daily direction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any ways to trade the FTSE index directly and not some derivative product that has different daily price movements?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I saw that apparently there are &lt;a href=&quot;https://www.xm.com/equity-indices/ftse100?gclid=Cj0KCQjw78vLBRCZARIsACr4cxwuo0D_VJ1YOA-ILdZLa5r1MDUCH0D8jluD490Ii-ASR5bN9MCWCxQaApc8EALw_wcB&quot; rel=&quot;nofollow noreferrer&quot;&gt;different FTSEs&lt;/a&gt; to choose from&#xA;Also, interactive brokers shows a &lt;a href=&quot;https://www.interactivebrokers.co.uk/en/index.php?f=2222&amp;amp;exch=iceeu&amp;amp;showcategories=IND&quot; rel=&quot;nofollow noreferrer&quot;&gt;list of several FTSE indices&lt;/a&gt; to trade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;FTSE 100 Index Z&lt;/li&gt;&#xA;&lt;li&gt;FTSE Eurotop 100 Index Q&lt;/li&gt;&#xA;&lt;li&gt;FTSE 100 TR Index GBP TUKXG&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I don't understand what it means and which one represents the real FTSE 100 index to train my model on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Short explanation would be helpful&lt;/p&gt;&#xA;" OwnerUserId="16858" LastEditorUserId="24222" LastEditDate="2017-07-24T10:19:14.373" LastActivityDate="2017-08-23T10:28:03.763" Title="How to trade the FTSE index long and short" Tags="&lt;longshort&gt;&lt;indexes&gt;&lt;cfd&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35229" PostTypeId="1" CreationDate="2017-07-22T16:13:23.223" Score="1" ViewCount="344" Body="&lt;p&gt;I want to download historical data using &lt;code&gt;pandas_datareader&lt;/code&gt; for OMX30, however I cant find any symbol which can be found using pandas_datareader.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;STO:XACT-BULL&lt;/li&gt;&#xA;&lt;li&gt;INDEXNASDAQ:OMXS30&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Can only be found on &lt;a href=&quot;https://www.google.com/finance?cid=4420283&quot; rel=&quot;nofollow noreferrer&quot;&gt;google finance site&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question is what symbol can I download that represents OMX30?&lt;/p&gt;&#xA;" OwnerUserId="28787" LastActivityDate="2017-07-22T16:13:23.223" Title="What symbols to use on Google Finance and Yahoo finance OMX30" Tags="&lt;data&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35233" PostTypeId="1" AcceptedAnswerId="35234" CreationDate="2017-07-22T21:12:39.110" Score="0" ViewCount="920" Body="&lt;p&gt;I have a decent knowledge of econometrics, but would like to have some help with the procedure of FF regression.Suppose I would like to know if a stock, say AAPL, has outperformed the Fama French 3 factor model.So,I download data from Kenneth French website and run the regression with (AAPL minus risk free rate) as dependant variable and SMB,HML and RMRF as indpt variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) The alpha or intercept value is a &quot;single value&quot; or a number and not a time series.But,I want to know how each day the AAPL stock has outperformed the fame french model.So, if I take the residuals(which will be a time series data) from the above regression,is it the excess returns over FF model? Is the procedure right or wrong?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Or should I multiply the betas from the regression with SMB,HML,RMRFcoloumns , then AAPL-(bta1*SMB + beta2*HML + beta3*RMRF).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="28906" LastActivityDate="2017-07-23T02:18:57.167" Title="Fama french model: Daily excess return calculation" Tags="&lt;factor-models&gt;&lt;fama-french&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35234" PostTypeId="2" ParentId="35233" CreationDate="2017-07-23T02:18:57.167" Score="1" Body="&lt;p&gt;By doing (2) you are technically calculating the residuals which you are proposing in (1). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Be aware of &lt;a href=&quot;http://www.investopedia.com/terms/l/lookaheadbias.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;look-ahead bias&lt;/a&gt; though, you could mitigate such bias by, say, estimating beta 1,2, and 3 according to time series regression from 2005 to 2010. Then use estimated coefficients to calculate the residuals over the years 2010 to 2015 similar to the methodology of event studies.&lt;/p&gt;&#xA;" OwnerUserId="28909" LastActivityDate="2017-07-23T02:18:57.167" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35235" PostTypeId="2" ParentId="35206" CreationDate="2017-07-23T08:38:12.617" Score="1" Body="&lt;p&gt;Yes, the IRR is the same regardless of the prepayment date.  The only thing that varies is the life of the loan.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-07-23T08:38:12.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35236" PostTypeId="2" ParentId="35227" CreationDate="2017-07-23T12:23:56.763" Score="1" Body="&lt;p&gt;Update:Will's link helped &lt;a href=&quot;https://quant.stackexchange.com/questions/35227/option-on-futures-black-equation-derivation&quot; title=&quot;Derivation&quot;&gt;Derivation&lt;/a&gt;: I applied following Chain rule&#xA;V=(&lt;strong&gt;F&lt;/strong&gt;,t) and F = (&lt;strong&gt;S&lt;/strong&gt;, t) (F = &lt;strong&gt;Forward Price&lt;/strong&gt;, S = &lt;strong&gt;Underlying Price&lt;/strong&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\frac{\partial V}{\partial t} = \frac{\partial V}{\partial F}\frac{\partial F}{\partial t}  + \frac{\partial V}{\partial t}\frac{\partial t}{\partial t} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;=  $$\frac{\partial V}{\partial t} = \frac{\partial V}{\partial F}\frac{\partial F}{\partial t}  + \frac{\partial V}{\partial t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;gets me&#xA;$$\frac{\partial V}{\partial t} = \frac{\partial V}{\partial t} - rF\frac{\partial V}{\partial t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Substituting in Black Scholes equation, RS term gets cancelled out w.r.t F.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Future price has No value at the time of Purchase!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot!&lt;/p&gt;&#xA;" OwnerUserId="28901" LastActivityDate="2017-07-23T12:23:56.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35237" PostTypeId="2" ParentId="20814" CreationDate="2017-07-23T14:32:17.470" Score="0" Body="&lt;p&gt;If the Fama-French model were the correct asset pricing model, it could be applied to any return, whether it is the return of a portfolio or the return of an individual stock.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That said, there are some issues if you want to apply factor models at the firm level.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;A big problem: imprecise measurement&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The problem is that betas of individual stocks as estimated from a standard time-series regression tend to be measured extremely poorly.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;There's so much volatility and noise at the individual company level, your standard errors are going to be quite large.&lt;/li&gt;&#xA;&lt;li&gt;Betas almost certainly change over time. Apple in the mid 1990s is a different company than Apple today. Using a longer time series to estimate betas at the company level is problematic too.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;A motivation for forming portfolios on characteristics and estimating the betas of the portfolios is that hopefully the portfolios have more stable factor loadings over time and that much of the noise is diversified away. With highly diversified portfolios, the FF3, FF5, etc... factor model regressions actually can give a quite high $R^2$.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Some ideas of what to do?&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;It really depends on how you're using the betas, what your question is. If you're interested in ONE particular company, the brutal truth may be that using a market beta of 1 may be about as predictive going forward as any market beta you estimate. (Mechanically, the value weight average market beta must equal 1.)&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Go Bayesian: put a prior on your beta estimates and do a Bayesian linear regression.&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Extreme prior: ignore time series regression and use market beta of 1.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;I've seen corporate finance &lt;a href=&quot;http://people.stern.nyu.edu/adamodar/New_Home_Page/TenQs/TenQsBottomupBetas.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;Prof. Aswath Adamodar&lt;/a&gt; at NYU advocate using betas estimated from firms in the same industry?&lt;/li&gt;&#xA;&lt;li&gt;There are numerous papers that show firm characteristics are highly related to factor loadings.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;On the other hand, using betas estimated from time series regressions on individual companies could be good enough. It really depends on what you're doing.&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-07-23T14:58:47.700" LastActivityDate="2017-07-23T14:58:47.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35238" PostTypeId="2" ParentId="34969" CreationDate="2017-07-23T15:16:53.950" Score="0" Body="&lt;p&gt;As I figured after reading Stephane Crepey's Financial Modelling book the result is meant to be complex, we should only include the real part as the answer something not 100% clear (at least to me) from Carr-Madan's paper.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also found a useful outline of the algorithm for a naive version of FFT at F.Rouah's book on the Heston Model.&lt;/p&gt;&#xA;" OwnerUserId="28658" LastActivityDate="2017-07-23T15:16:53.950" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35239" PostTypeId="1" CreationDate="2017-07-23T19:22:39.683" Score="0" ViewCount="405" Body="&lt;p&gt;In many reputed sites such as, &lt;a href=&quot;http://www.investopedia.com/university/advancedbond/advancedbond5.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;Investopedia&lt;/a&gt;, bond duration is explained as &lt;strong&gt;a measurement of how long, in years, it takes for the price of a bond to be repaid by its internal cash flows.&lt;/strong&gt;&#xA;My understanding was duration is just the time weighted average of present value of future cash flows. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am unable to see how duration explains when the bond is repaid. Please explain &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: Even reputed authors like &lt;a href=&quot;https://books.google.co.in/books?id=06ouqLABGyoC&amp;amp;lpg=PP1&amp;amp;dq=john%20hull%20risk%20management%20and%20financial%20institutions%20pdf&amp;amp;pg=PA165#v=onepage&amp;amp;q&amp;amp;f=false&quot; rel=&quot;nofollow noreferrer&quot;&gt;John Hull&lt;/a&gt; mention this understanding &lt;/p&gt;&#xA;" OwnerUserId="27273" LastEditorUserId="27273" LastEditDate="2017-07-24T11:58:01.610" LastActivityDate="2017-07-30T01:38:31.487" Title="Alternate explanation of Duration" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;duration&gt;&lt;bond-yields&gt;" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35241" PostTypeId="1" CreationDate="2017-07-23T20:13:43.310" Score="2" ViewCount="108" Body="&lt;p&gt;Thank you for the knowledge shared on this site&lt;/p&gt;&#xA;&#xA;&lt;p&gt;wanted to ask this question below, in case someone kindly knows the answer &lt;/p&gt;&#xA;&#xA;&lt;p&gt;AAPL is listed on NASDAQ, but it is also traded on other exchanges like BATS. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do you find around how much volume of AAPL typically trades on NASDAQ vs other exchanges?&lt;/p&gt;&#xA;" OwnerUserId="28917" LastActivityDate="2017-07-27T04:39:56.573" Title="For AAPL, How do You find how much volume typically trades on NASDAQ vs other exchanges?" Tags="&lt;nasdaq&gt;&lt;nyse&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35242" PostTypeId="2" ParentId="35239" CreationDate="2017-07-23T21:47:33.007" Score="2" Body="&lt;h3&gt;It's a bad definition&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The definition you quoted, &quot;[duration is] a measurement of how long, in years, it takes for the price of a bond to be repaid by its internal cash flows&quot; is &lt;em&gt;not&lt;/em&gt; a sensible definition of Macaulay duration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only place I could find an explanation behind that language &lt;a href=&quot;https://en.wikipedia.org/w/index.php?title=Bond_duration&amp;amp;oldid=392901603#Confused_notions&quot; rel=&quot;nofollow noreferrer&quot;&gt;is this previous version of the bond duration Wikipedia article&lt;/a&gt; that called that definition an inaccurate and confused notion.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Duration is sometimes explained inaccurately as being a measurement of&#xA;  how long, in years, it takes for the price of a bond to be repaid by&#xA;  its internal cash flows. This quantity is the duration of a&#xA;  perpetual bond (assuming a flat yield curve at the coupon), and is&#xA;  simply $\frac {1}{r}$. For instance, if&#xA;  a bond pays 5% per annum and was issued at par, it will take 20 years&#xA;  of these payments to repay its price. Note the absurdity of&#xA;  interpreting duration this way: given a bond paying 5% per annum with&#xA;  a term of 5 years, the duration is approximately 4.37, whereas the&#xA;  price of the bond will not be repaid in full until maturity (at 5&#xA;  years).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;h3&gt;Recreating the math on this?&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Let's say you have a &lt;a href=&quot;https://en.wikipedia.org/wiki/Consol_(bond)&quot; rel=&quot;nofollow noreferrer&quot;&gt;consol&lt;/a&gt; with a perpetual coupon $C$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If interest rates are a constant $r &amp;gt; 0$ then the present value is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;V &amp;amp;= \lim_{T \rightarrow \infty} \sum_{t=1}^T \frac{C}{(1 + r)^t} \\&#xA;&amp;amp;=  \frac{C\left(\frac{1}{1+r} \right)}{1 - \frac{1}{1 + r}}\\&#xA;&amp;amp;= \frac{C}{r}&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Macaulay duration is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*} D_M &amp;amp;= \lim_{T \rightarrow \infty} \frac{1}{C/r} \sum_{t=1}^T t \frac{C}{(1+r)^t} \\&#xA;&amp;amp;= r \lim_{T \rightarrow \infty} \sum_{t=1}^T t \left( \frac{1}{1+r}\right)^t &#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The interior part is an &lt;a href=&quot;https://en.wikipedia.org/wiki/Arithmetico%E2%80%93geometric_sequence&quot; rel=&quot;nofollow noreferrer&quot;&gt;arithmetico-geometric series&lt;/a&gt;. The infinite sum can be written as $\frac{ \left( \frac{1}{1+r} \right)}{\left(1 - \frac{1}{1+r}\right)^2}$ which simplifies to $\frac{r+1}{r^2}$ hence:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$D_m = 1 + \frac{1}{r}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll get $\frac{1}{r}$ as the Macaulay duration and $\frac{C}{r} + C$ as the price if you included the undiscounted cashflow $C$ instead of starting with $\frac{C}{1+r}$.&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-07-24T02:32:35.767" LastActivityDate="2017-07-24T02:32:35.767" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="35243" PostTypeId="2" ParentId="35239" CreationDate="2017-07-24T00:32:57.667" Score="1" Body="&lt;p&gt;Let's consider the simple case of a $T$-year zero coupon bond, whose continuously compounded yield is $y_t$. Then its price and yield are related by&#xA;$$ P = e^{-y_T \cdot T} .$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By definition, the modified duration is&#xA;$$ -\frac{1}{P}\frac{dP}{dy} =\frac{e^{-y_T\cdot T} \cdot (-T)}{e^{-y_T\cdot T}} = T. $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This demonstrates that for a zero coupon bond, assuming its yield to maturity is continuously compounded, then its modified duration and time to maturity are identical. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if a bond is not a zero coupon bond and the compounding convention is not continuous, then this intuitive result no longer holds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With some relative simple math, we can show that the Macauley duration of a bond that pays semi-annual coupon and maturing in $T$ years is&#xA;$$ D_\text{mac} = \frac{1}{P}\left[ \sum_{t=1}^{2T} \frac{t}{2}\frac{c/2}{(1+y/2)^t} + T \frac{100}{(1 + y/2)^{2T}}\right] . $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This shows that Macauley duration is the time-weighted present value of cash flows divided by price, or (roughly) the present-value-of-cashflow weighted time to maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How useful is Macauley duration in real life? Frankly speaking, not very... From an analytical perspective, the only concepts that are used would be modified duration or effective duration. Unfortunately neither of them has a very nice interpretation (except in the simplest case shown above).&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2017-07-24T00:32:57.667" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35244" PostTypeId="1" CreationDate="2017-07-24T01:04:25.320" Score="0" ViewCount="63" Body="&lt;p&gt;I'm looking for a best possible data source for BSE India realtime L2 data (at least 5 levels of book) equities only (F&amp;amp;O welcome, but not needed).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have an access to bloomberg terminal, have you any experience with its data quality? (Max 1 second delay, 200ms ideal)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I have discovered India is quite restrictive in terms of data availability for foreigners.&lt;/p&gt;&#xA;" OwnerUserId="28920" LastActivityDate="2017-07-24T01:04:25.320" Title="BSE India best data source for foreigners (Bloomberg terminal?)" Tags="&lt;market-data&gt;&lt;bloomberg&gt;&lt;tick-data&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35245" PostTypeId="2" ParentId="33948" CreationDate="2017-07-24T01:35:06.123" Score="2" Body="&lt;p&gt;You didn't say what you were going to do with the result and so there are two answers.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, if you do not care about the future and the only concern is to precisely match the data that happened, then you can always fit any curve by constructing a polynomial whose degree is equal to the number of data points.  It will fit perfectly.  It will be useless as anything other than a descriptor of prior points, but it will look just right.  It will be a case of overfitting.  There is a nice example of overfitting the presidential elections at &lt;a href=&quot;https://stats.stackexchange.com/questions/128616/whats-a-real-world-example-of-overfitting&quot;&gt;https://stats.stackexchange.com/questions/128616/whats-a-real-world-example-of-overfitting&lt;/a&gt; .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your model is clearly overfitting the data for any predictive purpose, but very close to the exact solution if you are looking historically.  The reason you can tell it is overfitting is that it is that it is catching the wavelets.  The wavelets are known to be purely random and without signal.  The original article on this can be found at:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Slutzky, Eugen.  The Summation of Random Causes as the Source of Cyclic Processes. Econometrica. 5(2). Apr. 1937. pp.105-146&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If you are trying to predict an outcome and intend to use it, then you need to adopt Bruno de Finetti's &lt;em&gt;Coherence Principle&lt;/em&gt; to get there in your underlying mathematics.  This will restrict you to &lt;em&gt;Bayesian Statistics&lt;/em&gt;.  Non-Bayesian methods are never coherent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To understand why there is a simple 250-year-old example from the Reverand Thomas Bayes himself.  In this example, the Reverend Bayes imagines a billiards table where a ball is bounced around to arrive at a random point.  The ball splits the table into region A and region B randomly.  The probability that a ball will roll into an area is equal to the proportion of area that region has divided by the total area.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The ball is removed after its location is recorded.  Then two billiards players shoot balls.  If the ball lands in their region they win and if not they lose.  The problem is nobody told them where their region is or if they got a point or not until after it is over.  They don't know where to shoot.  The first to six points wins.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question that needs to be solved is the odds that player B will win, given that eight shots have been made and the score is 5-3 in favor of A.  A needs one point to win and B needs three.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Frequentist answer is $(3/8)^3.$  This corresponds to gambling odds of about 18:1.  So if you were to use a Frequentist method, then if you were a bookie you should offer 18:1 odds that B will win.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Bayesian answer is very different.  The Bayesian solution asks two different questions.  The first question is what do we know about the odds of winning before we saw the balls shot.  Second, what is the set of probabilities that &lt;em&gt;could have&lt;/em&gt; triggered the exact results that were seen and what are the odds that each of these probabilities is the one true probability?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, the user of a Bayesian method would create a parameter $\theta$ and assign the probability $\theta=k,\forall{k}\in[0,1]$.  Since all possible values are equally probable, the prior distribution of beliefs about $\theta$ should be that $\Pr(\theta=k)\propto{1},\forall\theta\in{[0,1]}$.  There is a binomial likelihood, so its probability is $\theta^3(1-\theta)^5$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The posterior density function is $504\theta^3(1-\theta)^5$.  This is the summary of all possible parameters that could trigger a 5-3 position and the probability that this is the true parameter.  We need a prediction, however.  To do this we make a prediction over the entire density, which is to predict the probability of winning three out of three.  The solution to this is to solve $$504\int_0^1\theta^3\theta^3(1-\theta)^5\mathrm{d}\theta.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The answer to this is $\frac{1}{11}$.  The Bayesian solution would create 10:1 odds.  The Bayesian would be correct and always would create the correct solution.  The Bayesian solution is $E(p^3)$, while the Frequentist is $[E(p)]^3$.  This is true for any Bayesian versus Frequentist process including regression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You would use Bayesian model selection.  You would create a model that said there were only one set of parameters such as $$\frac{x_{t+1}-\beta{x_t}-\alpha-\varepsilon_{t+1}}{\sigma}.$$  Then you would assume there was a break and you would model two series jointly, one right after the other.  You would do this again for three, four and five and so on until you felt you didn't want to continue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you increase the number of possible breaks, Bayes theorem will begin penalizing you for the added structure.  At the same time, since it fits better, Bayes theorem will reward you for the improved goodness of fit.  The model where the penalties are small and the rewards are high will end up with being the best fit model.  If you want to do a prediction, then you will use the Bayesian posterior predictive distribution as we did to calculate the odds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because there is no prebuilt tool for this, you will have to build your own.  If you have not used a Bayesian method, begin with William Bolstad's &lt;em&gt;Introduction to Bayesian Statistics, 3rd edition&lt;/em&gt;.  Definitely get the third edition as it is a huge improvement.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2017-07-24T01:35:06.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35246" PostTypeId="2" ParentId="35224" CreationDate="2017-07-24T02:16:35.547" Score="1" Body="&lt;p&gt;An alternative proof:   The contract may be replicated by waiting until $T_1$ and then investing  one dollar in the stock.  Hence its value must be the same as a zero coupon bond priced at t maturing at $T_1$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above holds for any stock dynamics and rate dynamics.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastEditorUserId="20454" LastEditDate="2018-01-03T23:05:06.313" LastActivityDate="2018-01-03T23:05:06.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35247" PostTypeId="2" ParentId="25641" CreationDate="2017-07-24T05:46:42.800" Score="1" Body="&lt;p&gt;You don't provide enough information. Yet, if you provide a little more information it might be possible. In theory -- one may recreate a statement for the source and use of funds (i.e., delta balance sheet) from an income statement and cash flow statement. The following adjustments provides a simplified example of the &lt;a href=&quot;https://www.wallstreetoasis.com/finance-dictionary/what-is-a-balance-sheet-BS&quot; rel=&quot;nofollow noreferrer&quot;&gt;IFRS balance sheet taxonomy&lt;/a&gt;, and it is not significantly different for US GAAP:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;-(Impairments + Net_Disposals) = NetPPE_New - AdditionsToPPE + DepAmort - NetPPE_Old&#xA;&#xA;AdditionsToPPE - Gross_Disposals = GrossPPE_New - GrossPPE_Old&#xA;&#xA;Accum_Disposals - Impairments = AccumDDA_Old - AccumDDA_New + DepAmort&#xA;&#xA;(AdditionsToPPE - Gross_Disposals) + (Accum_Disposals - Impairments) = (GrossPPE_New - GrossPPE_Old) + (AccumDDA_Old - AccumDDA_New + DepAmort)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Note, AdditionsToPPE (above) is roughly analogous to CapEx.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recreating a delta balance sheet becomes a lot more complicated when you enter the real world. The real world is fraught with nuanced accounting adjustments. One must account also for asset disposals, impairments, write-offs, and M&amp;amp;A activity.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastActivityDate="2017-07-24T05:46:42.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35248" PostTypeId="2" ParentId="26087" CreationDate="2017-07-24T08:06:26.890" Score="3" Body="&lt;p&gt;Tidyquant also has a nice function tq_get() for getting all sorts of equity data from freely available sources including financial statements.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.business-science.io/code-tools/2017/01/01/tidyquant-introduction.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.business-science.io/code-tools/2017/01/01/tidyquant-introduction.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2017-07-24T08:06:26.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35250" PostTypeId="2" ParentId="35228" CreationDate="2017-07-24T09:40:18.200" Score="1" Body="&lt;p&gt;I would have a look at ETFs tracking the FTSE 100. There will still be a small tracking error due the the way ETFs work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At a starting point have a look at this list: &lt;a href=&quot;http://etfdb.com/index/ftse-100-index/&quot; rel=&quot;nofollow noreferrer&quot;&gt;FTSE 100 Index ETFs - ETFdb.com&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="4769" LastActivityDate="2017-07-24T09:40:18.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35251" PostTypeId="2" ParentId="35228" CreationDate="2017-07-24T10:19:21.813" Score="0" Body="&lt;p&gt;I agreed with chjortlund. Tracking ETFs are probably your best bet with a marginal tracking error depending on rebalancing etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the question is why would you have a strategy on something that is not directly tradable? i.e. strategy that works on the VIX but not its futures would be pointless.&lt;/p&gt;&#xA;" OwnerUserId="28664" LastActivityDate="2017-07-24T10:19:21.813" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35252" PostTypeId="1" AcceptedAnswerId="35282" CreationDate="2017-07-24T11:20:54.387" Score="4" ViewCount="3217" Body="&lt;p&gt;I understand that a general swap has 4 curves attached to it: the flat forecast curve associated with the fixed leg, the forecast curve associated with the floating leg, the fixed leg discount curve and the floating leg discount curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I also understand that $DV01 = \dfrac{\partial V_{swap}}{\partial y}$, where $y$ is the yield. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I don't understand is which curve(s) is the $y$? Which curve are we shifting by $1bp$ to calculate the $DV01$?&lt;/p&gt;&#xA;" OwnerUserId="28388" LastActivityDate="2020-04-08T15:43:57.170" Title="What curve are you shifting when you calculate DV01 for a swap?" Tags="&lt;fixed-income&gt;&lt;swaps&gt;&lt;yield-curve&gt;&lt;duration&gt;&lt;discount-factor-curve&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35254" PostTypeId="1" CreationDate="2017-07-24T12:06:45.920" Score="-1" ViewCount="124" Body="&lt;p&gt;I have developed an algorithm / model that predicts the next day direction of CBOT wheat futures. It performs sufficiently well in backtesting that I'm interested to see how it would perform with real money behind it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I'm on a pretty tight budget.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the most cost efficient options for front testing a strategy on a low budget? I've looked into ETF's, but often the fees involved, if reasonable for larger investments, completely obliterate any performance achieved by my model.&lt;/p&gt;&#xA;" OwnerUserId="19116" LastEditorUserId="467" LastEditDate="2017-07-24T14:53:26.420" LastActivityDate="2017-07-29T12:15:48.530" Title="How to test a strategy with a small capital?" Tags="&lt;quant-trading-strategies&gt;&lt;investing&gt;" AnswerCount="2" CommentCount="1" ClosedDate="2017-08-07T15:00:23.597" ContentLicense="CC BY-SA 3.0" />
  <row Id="35256" PostTypeId="1" CreationDate="2017-07-24T13:06:53.423" Score="-1" ViewCount="122" Body="&lt;p&gt;I was wondering if banks have a certain target value when it comes to their balance sheet. I'm not speaking about the target leverage ratio or something like that. It's more like: &quot;In the following year we (the bank) want to increase our balance sheet from 60 billion to 70 billion.&quot;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My main idea behind the question is that based on the target value for the balance sheet a bank wants to increase its market share or strengthen his position in the market. &lt;/p&gt;&#xA;" OwnerUserId="28219" LastActivityDate="2017-07-31T05:29:28.770" Title="Do banks have a target balance sheet?" Tags="&lt;banks&gt;&lt;banking-regulations&gt;" AnswerCount="4" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35257" PostTypeId="2" ParentId="35256" CreationDate="2017-07-24T14:32:07.313" Score="1" Body="&lt;p&gt;Yes, they definitely do. Most public companies - and that includes most banks - will have quarterly goals for revenue, profits, dividends, retained earnings and so on. So, while they usually won't set a specific target for assets (I'm guessing that's what you mean by balance sheet), you can sure find this target balance sheet by doing the math with the other stated targets. &lt;/p&gt;&#xA;" OwnerUserId="28855" LastActivityDate="2017-07-24T14:32:07.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35261" PostTypeId="1" CreationDate="2017-07-24T16:46:29.333" Score="-2" ViewCount="146" Body="&lt;p&gt;I have the following options data. This is just a snippet but this data is available every day  Period 30 to 720 and Out of the Money : 0 to 60 in increments of 5&#xA;I would like to compute short straddle return for each day. Its been a while since I used options and was wondering if someone could guide me &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    ID  Symbol  TradeDate Period Strike_Price     Call_Put  Out_of_the_Money    IV  Delta&#xA;    2631442 A   17-Jul-17   30  12591.56            P        0             0.10793-0.49383&#xA;    2631443 A   17-Jul-17   30  12591.56            C        0             0.10738 0.50614&#xA;    2629567 A   14-Jul-17   30  12616.31            P        0             0.10864-0.49379&#xA;    2629568 A   14-Jul-17   30  12616.31            C        0             0.1074  0.50614&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="13527" LastActivityDate="2017-07-25T00:32:28.483" Title="straddle return" Tags="&lt;options&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2017-07-26T18:13:12.303" ContentLicense="CC BY-SA 3.0" />
  <row Id="35262" PostTypeId="2" ParentId="35254" CreationDate="2017-07-24T16:51:38.917" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;try a demo account of fair broker (Interactive Brokers  if you are able to base account there) and you will see if it really works (1 month min)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;if it works good, find an investor (managed account is a good scheme). If you are not able to make anyone believe you, borrow money to fund your own account. Avoid friends and family - nothing is worse than going bad with business and friends in one time.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Plenty of small hedge funds will be interested if its good.&lt;/p&gt;&#xA;" OwnerUserId="28920" LastActivityDate="2017-07-24T16:51:38.917" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35263" PostTypeId="2" ParentId="35241" CreationDate="2017-07-24T17:01:04.933" Score="0" Body="&lt;p&gt;Most exchanges are disclosing security-wise traded volume on daily basis. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;NASDAQ &lt;a href=&quot;http://www.nasdaq.com/symbol/aapl/historical&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.nasdaq.com/symbol/aapl/historical&lt;/a&gt;&#xA;NYSE &lt;a href=&quot;https://www.nyse.com/quote/XNGS:AAPL&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.nyse.com/quote/XNGS:AAPL&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also checkout &lt;a href=&quot;https://www.bats.com/us/equities/market_statistics/execution_quality/symbol/?symbol=AAPL&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.bats.com/us/equities/market_statistics/execution_quality/symbol/?symbol=AAPL&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="28920" LastActivityDate="2017-07-24T17:01:04.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35264" PostTypeId="1" CreationDate="2017-07-24T18:07:37.313" Score="1" ViewCount="1590" Body="&lt;p&gt;I'm trying to figure out how to perform CAPM, the fama french 3 Factors and 5 Factors and the Carhart 4 factors regressions in Eviews.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I downloaded all the data from French's website. The 3 Factors data, 5 factors data and the monthly return on 25 portfolios sorted on size and Book-to-Market-Value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question 1:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Picture below is a screenshot of the monthly returns for the 25 portfolios sorted on size and Book-to-market value obtained from French's website.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What value should I use for the monthly returns of let's say year 1926?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/hkuus.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/hkuus.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question 2:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the Regression in Eviews, should I input the Fama French 3 Factors ($SMB$, $HML$, $R_{m}$) together with returns in question 1 in &#xA;this equation: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R_{i,t} - R_{f} = \alpha_i + \beta_i (R_{m} - Rf) + \gamma_i  SMB + \delta_i HML + \varepsilon_{i,t}$$&lt;/p&gt;&#xA;" OwnerUserId="28923" LastEditorUserId="26595" LastEditDate="2017-07-25T10:46:19.530" LastActivityDate="2018-05-21T16:03:08.397" Title="fama French regression in Eviews" Tags="&lt;fama-french&gt;&lt;eviews&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35265" PostTypeId="2" ParentId="35226" CreationDate="2017-07-24T18:15:44.847" Score="0" Body="&lt;p&gt;Toughest challenge you face as a market maker is &lt;strong&gt;inventory risk&lt;/strong&gt;. To sell something, you should own it. Time between buy and sell is never zero and you have same exposure against market as any other participant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking advantage of calendar spread makes you &lt;strong&gt;market neutral&lt;/strong&gt;, but you still have place for profit.&lt;/p&gt;&#xA;" OwnerUserId="28920" LastActivityDate="2017-07-24T18:15:44.847" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35266" PostTypeId="2" ParentId="35252" CreationDate="2017-07-24T18:35:26.797" Score="2" Body="&lt;p&gt;The short answer is that there's no consensus. A popular method is to shock each input instrument by 1 bp (i.e., change the futures rate by 1bp, the swap rates by 1bp, OIS rates by 1bp, etc.), rebuild the curve, and then reprice the instrument of interest to obtain its curve sensitivity. This of course is not quite a &quot;parallel&quot; shift of any curve (e.g., a 1bp change in futures rate won't correspond to a 1bp change in either the zero curve or the par curve), but it's close enough and it does make hedging easier (after all, you're shocking tradable instruments).&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2017-07-24T18:35:26.797" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35267" PostTypeId="1" CreationDate="2017-07-24T21:24:46.380" Score="1" ViewCount="690" Body="&lt;p&gt;I came across Michael Halls-Moore &lt;a href=&quot;https://www.quantstart.com/articles/Basics-of-Statistical-Mean-Reversion-Testing&quot; rel=&quot;nofollow noreferrer&quot;&gt;article on using the Hurst exponent test&lt;/a&gt; to determine if a price time-series is mean-reverting, trend-following or closer to a random walk, but doesn't this disregard the fact that financial instruments often exhibit a &quot;bid-ask bounce affect&quot; ? In which case, is his approach of using the Hurst exponent a bit too naive to use in practice?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there other ways to determine if a price time-series is mean-reverting or trend following specifically for financial instruments that more applicable in real-world settings?&lt;/p&gt;&#xA;" OwnerUserId="27368" LastActivityDate="2017-07-25T00:10:05.577" Title="How to know if a time series is trending or mean reverting?" Tags="&lt;time-series&gt;&lt;forecasting&gt;&lt;trends&gt;&lt;hurst-exponent&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35268" PostTypeId="2" ParentId="35264" CreationDate="2017-07-24T21:58:03.197" Score="1" Body="&lt;p&gt;For each return series $i$ you want to form an excess return over the risk free rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ R^x_{it} = R_{it} - R^f_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then for each return series, run the regression:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ R^x_{it} = \alpha_i + \beta_{i1} \mathit{RMRF}_t + \beta_{i2} \mathit{SMB}_t + \beta_{i3} \mathit{HML}_t + \epsilon_{it}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the factor model is correct, the estimated alphas probably will be statistically indistinguishable from zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/34091/calculating-alpha-and-its-meaning/34092#34092&quot;&gt;This answer&lt;/a&gt; the interpretation of alpha. The intercept alpha from a time-series regression is an error term in the cross-sectional linear relationship between portfolio betas average returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If confused, I'd recommend material by Eugene Fama and/or John Cochrane as they are clear and careful writers.&lt;/p&gt;&#xA;" OwnerUserId="20582" LastActivityDate="2017-07-24T21:58:03.197" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35269" PostTypeId="2" ParentId="35267" CreationDate="2017-07-25T00:10:05.577" Score="3" Body="&lt;p&gt;The article that you linked mentioned several statistical tests, that approach the question from different angles. However, you should know that bid-ask bounce is not significant if you're looking at daily data on liquid (heavily traded) financial instruments. &lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2017-07-25T00:10:05.577" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35270" PostTypeId="2" ParentId="35226" CreationDate="2017-07-25T00:20:05.630" Score="1" Body="&lt;p&gt;McMillian's example does not make sense to me. Typically short-dated contracts are liquid and longer expirations are less so, and it would make sense to hedge long-expirations contracts with more liquid (also typically tighter, and more leveraged) short-term ones, but not the other way around.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only explanation for this, is maybe by &quot;hedging&quot; he meant just laying off gamma/vega risks against flow, and not (what I would call) actively hedging by crossing the spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Source: I'm a former OMM. Don't know any literature that describes things like that.&lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2017-07-25T00:20:05.630" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="35272" PostTypeId="2" ParentId="26087" CreationDate="2017-07-25T00:30:16.360" Score="2" Body="&lt;h3&gt;1. Another data provider: Compustat&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The canonical source in academic research for the accounting data disclosed in 10-K filings is the &lt;a href=&quot;https://en.wikipedia.org/wiki/Compustat&quot; rel=&quot;nofollow noreferrer&quot;&gt;Compustat&lt;/a&gt; annual database. The Compustat quarterly database contains information listed in 10-Qs and 10-Ks (and can be a bit trickier to work with).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have no idea on the cost of those products.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;2. Downloading 10-Ks and extracting data yourself...&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;I would NOT recommend this. It's a &lt;em&gt;huge&lt;/em&gt; programming project. (I did it myself once to extract share repurchase data from the HTML of 10-Q, 10-K filings and it took months and months of testing.)&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-07-25T00:46:04.437" LastActivityDate="2017-07-25T00:46:04.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35273" PostTypeId="2" ParentId="35261" CreationDate="2017-07-25T00:32:28.483" Score="1" Body="&lt;p&gt;For starters, to calculate returns you need prices, which I don't see in your data. Second, while long options positions are trivial to calculate, short positions and spreads require margin deposit that depends on the product you trade, and your broker's risk policy. &lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2017-07-25T00:32:28.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35274" PostTypeId="2" ParentId="35252" CreationDate="2017-07-25T06:52:53.627" Score="1" Body="&lt;p&gt;Agree with Helin. For short term risk management a trader would be usually looking at delta to the forecast curve (i.e. swaps curve and government curve for a swaps/options trader), although he/she would also have delta risk to the OIS curve and also to curves of other currencies now that multi-currency collateralisation is quite common. Those other deltas tend to build up more slowly and over time (and therefore account for a smaller % of daily PnL), and so are managed/hedged on a slightly longer time scale.&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2017-07-25T06:52:53.627" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35275" PostTypeId="2" ParentId="35052" CreationDate="2017-07-25T09:20:35.850" Score="3" Body="&lt;p&gt;Yes you can! With &lt;code&gt;pandas_market_calendars&lt;/code&gt;. See: &lt;a href=&quot;https://github.com/rsheftel/pandas_market_calendars&quot; rel=&quot;nofollow noreferrer&quot;&gt;GitHub - Repo&lt;/a&gt;. From the docs&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import pandas_market_calendars as mcal&#xA;nyse = mcal.get_calendar('NYSE')&#xA;&#xA;schedule = nyse.schedule(start_date='2016-12-30', end_date='2017-01-10')&#xA;&#xA;market_open market_close&#xA;2016-12-30  2016-12-30 14:30:00+00:00   2016-12-30 21:00:00+00:00&#xA;2017-01-03  2017-01-03 14:30:00+00:00   2017-01-03 21:00:00+00:00&#xA;2017-01-04  2017-01-04 14:30:00+00:00   2017-01-04 21:00:00+00:00&#xA;2017-01-05  2017-01-05 14:30:00+00:00   2017-01-05 21:00:00+00:00&#xA;2017-01-06  2017-01-06 14:30:00+00:00   2017-01-06 21:00:00+00:00&#xA;2017-01-09  2017-01-09 14:30:00+00:00   2017-01-09 21:00:00+00:00&#xA;2017-01-10  2017-01-10 14:30:00+00:00   2017-01-10 21:00:00+00:00&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For your starting timestamp, you can calculate the difference until the end of the 1st trading day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your ending timestamp, you can calculate the difference from the start of the last trading day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the rest of the days, the time to accumulate is obviously the ending time minus the starting time. Even if the output above has the same starting/ending times, it will not always be the case as in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;early = nyse.schedule(start_date='2012-07-01', end_date='2012-07-10')&#xA;&#xA;market_open market_close&#xA;2012-07-02  2012-07-02 13:30:00+00:00   2012-07-02 20:00:00+00:00&#xA;2012-07-03  2012-07-03 13:30:00+00:00   2012-07-03 17:00:00+00:00&#xA;2012-07-05  2012-07-05 13:30:00+00:00   2012-07-05 20:00:00+00:00&#xA;2012-07-06  2012-07-06 13:30:00+00:00   2012-07-06 20:00:00+00:00&#xA;2012-07-09  2012-07-09 13:30:00+00:00   2012-07-09 20:00:00+00:00&#xA;2012-07-10  2012-07-10 13:30:00+00:00   2012-07-10 20:00:00+00:00&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So you actually need to iterate over the results and calculate the accumulated time for each trading day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course: your instrument has to be in one of the supported calendars (or else you can create your own)&lt;/p&gt;&#xA;" OwnerUserId="17554" LastActivityDate="2017-07-25T09:20:35.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35276" PostTypeId="1" CreationDate="2017-07-25T13:08:24.967" Score="3" ViewCount="693" Body="&lt;p&gt;When looking at the explanation of CBOE S&amp;amp;P 500 Implied Correlation Indices &lt;a href=&quot;http://www.cboe.com/products/vix-index-volatility/volatility-indicators/correlation-indicators&quot; rel=&quot;nofollow noreferrer&quot;&gt;available here&lt;/a&gt;, it is written that such indices:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;[...] &quot;may be used to provide trading signals for a strategy known as volatility dispersion (or correlation) trading. For example, a long volatility dispersion trade is characterized by selling at-the-money index option straddles and purchasing at-the-money straddles in options on index components.&quot;&lt;/em&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, it is not obvious to see the behavior of this strategy (i.e. short ATM Index straddles - long ATM Index components straddles) with reference to correlation. First, I guess we are talking about the correlation between the S&amp;amp;P 500 and its individual constituents, am I right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then comes my question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could someone provide me with a mathematical derivation of the payoff of this strategy exhibiting the aforementioned (implied) correlation?&lt;/p&gt;&#xA;" OwnerUserId="26595" LastActivityDate="2017-07-25T13:08:24.967" Title="Rationale behind volatility dispersion (or correlation) trading" Tags="&lt;options&gt;&lt;quant-trading-strategies&gt;&lt;option-strategies&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35277" PostTypeId="2" ParentId="34392" CreationDate="2017-07-25T14:32:13.173" Score="4" Body="&lt;p&gt;You could web scrape historical snapshots from Coinmarketcap (&lt;a href=&quot;https://coinmarketcap.com/historical/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://coinmarketcap.com/historical/&lt;/a&gt;) that have market cap, price and outstanding supply going back to 2013. They also have an API (&lt;a href=&quot;https://coinmarketcap.com/api/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://coinmarketcap.com/api/&lt;/a&gt;) but at first glance it appears to only be for real time data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cryptowatch (acquired by Kraken) is generally sexy (&lt;a href=&quot;https://cryptowat.ch/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://cryptowat.ch/&lt;/a&gt;) and are working on a streaming API (&lt;a href=&quot;https://cryptowat.ch/docs/api&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://cryptowat.ch/docs/api&lt;/a&gt;)&lt;/p&gt;&#xA;" OwnerUserId="253" LastActivityDate="2017-07-25T14:32:13.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35281" PostTypeId="2" ParentId="34392" CreationDate="2017-07-25T20:45:08.810" Score="5" Body="&lt;p&gt;I have found that &lt;a href=&quot;https://bitcoincharts.com/&quot; rel=&quot;noreferrer&quot;&gt;Bitcoincharts&lt;/a&gt; has trade level data from a number of exchanges going back quite far.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can be downloaded at:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://api.bitcoincharts.com/v1/csv/&quot; rel=&quot;noreferrer&quot;&gt;https://api.bitcoincharts.com/v1/csv/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="142" LastActivityDate="2017-07-25T20:45:08.810" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35282" PostTypeId="2" ParentId="35252" CreationDate="2017-07-25T21:38:25.693" Score="5" Body="&lt;p&gt;Let's step back and look at the reason for making a DV01 calculation first before answering the question; &#xA;The reason for making a DV01 calculation is to quantify what market movements has impact on the valuation of the trade. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since the 'flat' forecast curve won't be affected by market movements the answer is (using pre-2008 methodology): The floating forecast curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After 2008 the discount curves became more important regarding the valuation as the previous standard to discount on the floating forecast curve (aka. IBOR-curve) was replaced by discounting on OIS (Overnight Index Swap)-curves or discount curves based on the collateral posted by the trade counter party. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In such a case DV01 would be calculated for the forecast curve, and for the discounting curve (which should be the same for both legs of the swap as long as both legs are in the same currency), resulting in two DV01 measurements.&lt;/p&gt;&#xA;" OwnerUserId="28934" LastActivityDate="2017-07-25T21:38:25.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35283" PostTypeId="2" ParentId="8956" CreationDate="2017-07-25T22:05:21.287" Score="2" Body="&lt;p&gt;1.Yes, for some bonds where you have enough issues to build a curve you are able to value them using the curve instead of just relying on the price per issue.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2.It's not a forecast of the future of the yield curve shape, it's a snapshot of the current markets view of the future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3.No, see answer for Q1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4.Yes, to be able to value contracts on a curve instead of just on price (so you could see where a contract 'should' be)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5.I think the following post will point you in the right direction &#xA;( &lt;a href=&quot;https://quant.stackexchange.com/questions/15986/how-to-compute-the-implied-probability-of-default-from-a-cds-spread&quot;&gt;How to compute the implied probability of default from a CDS spread?&lt;/a&gt; ).&lt;/p&gt;&#xA;" OwnerUserId="28934" LastActivityDate="2017-07-25T22:05:21.287" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35285" PostTypeId="1" CreationDate="2017-07-26T06:25:05.863" Score="1" ViewCount="971" Body="&lt;p&gt;Hi Quantitative Finance,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that there are a wealth of pairs trading models out there. Recently, it got me thinking as to why we go through the trouble to find cointegrated pairs while we can simply combine their returns to achieve stationarity. Consider case 1 and 2:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Case 1, cointegration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume $Y_t$ and $X_t$ are $I(1)$ and find $\beta$ such that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;Y_t +\beta X_t&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is $I(0)$. Then you can predict $Y_t +\beta X_t$ using AR. Assume series is OU and derive $\beta$ as the value that gives the highest log-likelihood.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Case 2, combination of returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume $Y_t$ and $X_t$ are $I(1)$ and consider &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;Y'_t +\beta X'_t&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Y'_t$ and $X'_t$ are the returns. The key is, what is $\beta$ which could depend on the correlation between both variables or on risk management, how much $X_t$ hedges out a particular risk factor of $Y_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Based on my experience, I find that for case 1, it's harder to find cointegrated pairs and a particular $\beta$ will only gives stationarity for at most one month, thus requiring the $\beta$ to be estimated again. For case 2, it's difficult to get the length of the returns; too short (1h) and you're ignoring prior history (2 days) which could constitute the mean reverting relationship.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is case 1 superior to case 2? Can it be shown that case 2 doesn't have the constant spread property that case 1 is suppose to have?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers,&#xA;Donny&lt;/p&gt;&#xA;" OwnerUserId="5634" LastActivityDate="2017-10-16T00:28:10.777" Title="Cointegration vs combination of returns" Tags="&lt;cointegration&gt;&lt;pairs-trading&gt;&lt;mean-reversion&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35286" PostTypeId="1" AcceptedAnswerId="35288" CreationDate="2017-07-26T06:52:53.830" Score="1" ViewCount="98" Body="&lt;p&gt;I recently found out about the multitude of day count conventions in Finance (e.g.&lt;a href=&quot;https://en.wikipedia.org/wiki/Day_count_convention&quot; rel=&quot;nofollow noreferrer&quot;&gt;wikipedia&lt;/a&gt; and &lt;a href=&quot;https://quant.stackexchange.com/questions/10077/which-day-count-conventions-are-there-and-where-do-they-apply&quot;&gt;stackexchange&lt;/a&gt;). As far as I understand the reason for this variety is a long history of diverse usage. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would I be correct to expect that in the (perhaps near) future a global standard will emerge? If so is there any of the current conventions a good candidate for a global standard?&lt;/p&gt;&#xA;" OwnerUserId="28017" LastActivityDate="2017-08-01T07:04:22.430" Title="Towards a standard day count convention in Finance, what the standard should be?" Tags="&lt;finance&gt;&lt;daycounting&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35288" PostTypeId="2" ParentId="35286" CreationDate="2017-07-26T09:03:09.657" Score="4" Body="&lt;p&gt;No.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is a detail that is important to get right, but otherwise uninteresting. There is no point in changing a convention once you've set one. There are some more common ones associated with the biggest markets, like Act/360, but that's all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Day count conventions are well documented. There is a degree of consolidation via ISDA standard contracts in the IRS market, but it is limited.&lt;/p&gt;&#xA;" OwnerUserId="1314" LastEditorUserId="1314" LastEditDate="2017-08-01T07:04:22.430" LastActivityDate="2017-08-01T07:04:22.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35289" PostTypeId="2" ParentId="35285" CreationDate="2017-07-26T12:28:29.470" Score="0" Body="&lt;p&gt;In practice, of course, you use the model that will perform better for your purpose. Formally, cointegration is first and absolutely a long run relationship, and more data must give you a better estimate of \beta. If it does not, then case 1 should in principle be rejected. If case 1 is appropriate , it is very powerful in the long run. Working with case 2 may offer more from a RM standpoint, as the consequences of working with case 1 when it is wrong seem pretty dire. This is great &quot;model risk&quot; compounding your more easily quantified &quot;market risk&quot;. &lt;/p&gt;&#xA;" OwnerUserId="11767" LastActivityDate="2017-07-26T12:28:29.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35291" PostTypeId="1" CreationDate="2017-07-26T13:55:01.617" Score="2" ViewCount="5539" Body="&lt;p&gt;I'm comparing two types of discounting: Z-Spread and Discount Margin.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reading the article by O'Kane &lt;a href=&quot;http://quantlabs.net/academy/download/free_quant_instituitional_books_/[Lehman%20Brothers,%20O%27Kane]%20Credit%20Spreads%20Explained.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Credit Spread Explained&lt;/a&gt; I found Z-Spread is used for fixed rate notes meanwhile Discount Margin, and Z-DM, are used for floating rate notes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I got the two definitions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Z-Spread&lt;/strong&gt;: vertical parallel shift over the current &lt;em&gt;zero rate curves&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Discount Margin&lt;/strong&gt;: vertical shift over the &lt;em&gt;current XIBOR&lt;/em&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;My question is: why theoretically speaking is more correct to use Discount Margin for floating rate notes meanwhile I should use Z-Spread for fixed rate ones?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For floating rate notes, is it also correct to use the &lt;em&gt;current zero rate curve&lt;/em&gt; for discounting and the &lt;em&gt;forward curve&lt;/em&gt; for generating future cashflows?&lt;/p&gt;&#xA;" OwnerUserId="16014" LastActivityDate="2019-03-14T19:07:20.983" Title="Z-Spread vs Discount Margin" Tags="&lt;fixed-income&gt;&lt;pricing&gt;&lt;self-study&gt;&lt;discounting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35292" PostTypeId="1" AcceptedAnswerId="35294" CreationDate="2017-07-26T14:07:17.770" Score="0" ViewCount="1281" Body="&lt;p&gt;In an attempt to construct the efficient frontier curve for a portfolio made up of all the stocks in the s&amp;amp;p index, I have run into some strange error for the calculations of the volatility of this portfolio. Here's the piece of the python code with the error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;tickers = ['A'..........# all the tickers of the s&amp;amp;p listed companies]&#xA;&#xA;adj_close = pd.DataFrame()  # an empty variable that will house&#xA;&#xA;adj_close = web.get_data_yahoo(tickers, start='2017-5-25', end='2017-6-25')['Adj Close']&#xA;&#xA;returns = (adj_close / adj_close.shift(1)) - 1&#xA;&#xA;pf_returns = []&#xA;pf_volatility = []&#xA;&#xA;num_assets = len(tickers)&#xA;&#xA;cov_matrix = returns.cov() * 20&#xA;&#xA;for x in range(100):&#xA;    weights = np.random.random(num_assets) #random set of floats that matches the number of assets&#xA;    weights /= np.sum(weights)             #sum of weights = 1&#xA;    pf_returns.append(np.sum(weights * returns.mean() * 20))&#xA;    pf_volatility.append(np.dot(weights.T, np.dot(cov_matrix, weights)) * 0.5)&#xA;&#xA;pf_returns = np.array(pf_returns)&#xA;pf_volatility = np.array(pf_volatility)&#xA;&#xA;port = pd.DataFrame({'Returns': pf_returns, 'Volatility': pf_volatility})&#xA;print(port)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Here's the output:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   Returns  Volatility&#xA;0   0.014793         NaN&#xA;1   0.013081         NaN&#xA;2   0.013250         NaN&#xA;3   0.010461         NaN&#xA;4   0.010808         NaN&#xA;5   0.011683         NaN&#xA;6   0.011159         NaN&#xA;7   0.012093         NaN&#xA;8   0.010168         NaN&#xA;9   0.013329         NaN&#xA;10  0.012290         NaN&#xA;11  0.011616         NaN&#xA;12  0.011767         NaN&#xA;13  0.011151         NaN&#xA;14  0.011238         NaN&#xA;15  0.010688         NaN&#xA;16  0.011548         NaN&#xA;17  0.010132         NaN&#xA;18  0.010191         NaN&#xA;19  0.012638         NaN&#xA;20  0.010190         NaN&#xA;21  0.013640         NaN&#xA;22  0.014704         NaN&#xA;23  0.012479         NaN&#xA;24  0.011054         NaN&#xA;25  0.011495         NaN&#xA;26  0.012228         NaN&#xA;27  0.008502         NaN&#xA;28  0.012055         NaN&#xA;29  0.013000         NaN&#xA;..       ...         ...&#xA;70  0.010414         NaN&#xA;71  0.012023         NaN&#xA;72  0.011955         NaN&#xA;73  0.012560         NaN&#xA;74  0.014966         NaN&#xA;75  0.011383         NaN&#xA;76  0.012452         NaN&#xA;77  0.010191         NaN&#xA;78  0.011512         NaN&#xA;79  0.014761         NaN&#xA;80  0.011228         NaN&#xA;81  0.013632         NaN&#xA;82  0.011403         NaN&#xA;83  0.011184         NaN&#xA;84  0.013233         NaN&#xA;85  0.015004         NaN&#xA;86  0.012597         NaN&#xA;87  0.012751         NaN&#xA;88  0.012068         NaN&#xA;89  0.009325         NaN&#xA;90  0.012346         NaN&#xA;91  0.010205         NaN&#xA;92  0.010199         NaN&#xA;93  0.014781         NaN&#xA;94  0.011009         NaN&#xA;95  0.011710         NaN&#xA;96  0.010670         NaN&#xA;97  0.013398         NaN&#xA;98  0.012641         NaN&#xA;99  0.011366         NaN&#xA;&#xA;[100 rows x 2 columns]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can correct my volatility code?. Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="28659" LastEditorUserId="28659" LastEditDate="2017-07-26T14:19:44.050" LastActivityDate="2017-07-26T15:22:57.057" Title="Why am I getting 'NaN' for as the output for a porfolio of 505 assets?" Tags="&lt;portfolio-optimization&gt;&lt;python&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35294" PostTypeId="2" ParentId="35292" CreationDate="2017-07-26T14:28:02.217" Score="1" Body="&lt;p&gt;You probably have NaN values in your covariance matrix. NaN is a &lt;a href=&quot;https://en.wikipedia.org/wiki/NaN#Floating_point&quot; rel=&quot;nofollow noreferrer&quot;&gt;special floating point value&lt;/a&gt; that's often used to denote missing observations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example: &#xA;If you have a dataframe $y$ with two series that don't overlap in time more than 1 period, the covariance between the two series is going to be undefined (which the cov function returns as NaN).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;x = pd.DataFrame([[1, np.NaN],[2,3],[np.NaN,4]])&#xA;x.cov()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Dataframe x is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;     0    1&#xA;0  1.0  NaN&#xA;1  2.0  3.0&#xA;2  NaN  4.0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and x.cov() is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;     0    1&#xA;0  0.5  NaN&#xA;1  NaN  0.5&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Notice the NaN value in the covariance matrix. Note that NaN times a number returns NaN and NaN plus a number returns NaN.&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-07-26T15:22:57.057" LastActivityDate="2017-07-26T15:22:57.057" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="35295" PostTypeId="1" AcceptedAnswerId="35303" CreationDate="2017-07-26T15:02:20.483" Score="1" ViewCount="2803" Body="&lt;p&gt;My code actually works just fine. What I don't understand is, if I put p=0.995 instead of 0.95, the console gives me numeric(0). What can cause this error? However, when I use &quot;gaussian&quot; method, it works just fine. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function tries to calculate the Value at Risk at the probability level of 99.5%. At 95% the function works as it should. You can reconstruct using the following code. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;VaR(bonds.returns,p=0.995, weights= weights,portfolio_method = &quot;component&quot;, method=&quot;historical&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;bonds.returns&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;   structure(c(0.0075452479085516, -0.000430602750240983, -0.000618087487474384, &#xA;0.00222086866888427, 0.0106496372204352, 0.00136921667853951, &#xA;0.00423968343697001, 0.0024904263575809, -0.000195676402276579, &#xA;0.000280808046426939, 0.00478090360779571, 0.0034797185745854, &#xA;0.00730203951222119, -0.000343622174203362, -0.00819027347184287, &#xA;-0.00430557592076686, 0.0121157759451644, 0.00511236623854172, &#xA;0.00632861635220117, 0.00281239014100998, -0.000272659992988644, &#xA;0.00102275383776207, 0.00580914478101358, 0.00408258034556819, &#xA;0.00683299709040042, 0.00444050627813075, 0.00112276199450645, &#xA;-0.00105140888790989, 0.00547308066278407, 0.00292103243043851, &#xA;0.000354539209820759, 0.000498394063572771, 0.000774893452150316, &#xA;0.00578507825894592, 0.00786336442020064, 0.00264068177602228, &#xA;0.0044426685809873, 0.00123386036476414, 0.000437716332879923, &#xA;0.00273957849531858, 0.00459152849567035, 0.00344127119889892, &#xA;0.00372234677044103, 0.00235998145728855, -0.000988017658188123, &#xA;0.000196396130996312, 0.00448116019271083, 0.00288335334692413, &#xA;0.00421227034351057, 0.00228605784355529, -0.00052312928966014, &#xA;0.00158416670737593, 0.00452201783723516, 0.0028924387350957, &#xA;0.00519960504742145, 0.00304595059792567, 0.00181483311621222, &#xA;0.00192813007255133, 0.00722328637152936, 0.00474544339681326, &#xA;0.00443227606157648, 0.00133718717534648, -5.13615959075731e-05, &#xA;-0.00041091387245229, 0.00307284387075546, 0.00220280114340743, &#xA;0.00575621301775153, 0.00313461918612856, -0.000187677120282226, &#xA;0.000272182906913443, 0.00450387051372281, 0.00321330157395727, &#xA;0.0056956454201833, 0.00323328013180268, 0.000923749602274482, &#xA;0.00117925737548585, 0.00519286314193823, 0.00386179068890669, &#xA;0.00449726636750203, 0.00136557388242409, 6.81855816717647e-05, &#xA;-9.74013324506195e-06, 0.00322401550644313, 0.00166993533855031, &#xA;0.00521548174581388, 0.0035394698147293, -0.000146521679975864, &#xA;0.000879258910347014, 0.00566832951610041, 0.00377491914601547, &#xA;0.00289058379650298, -0.00118324046075591, 8.10011745171479e-05, &#xA;-0.000577086623739564, 0.0027756673251278, 0.00217195850043939, &#xA;0.00844551759115331, 0.00488711529000163, 0.000326399164418012, &#xA;0.0021100258858846, 0.00678345055135887, 0.00597233751253223, &#xA;0, -0.00294687131050764, -0.0124380701571574, -0.00119904076738608, &#xA;0.00780792316926782, -0.00107682631649164, 0.00416801143436785, &#xA;0.00224983241044274, -5.49742537244713e-05, 0.000394003811757804, &#xA;0.00469870579507048, 0.00247967034970653, 0.00207520724910104, &#xA;0.00483573674509374, 0.000787690448444067, 0.00624265490733067, &#xA;0.00121078347334125, -0.00618572147130281, 0.00466954738246472, &#xA;0.00228923662382208, -0.00131503490280616, -0.000811840997970381, &#xA;0.00319055121231049, 0.00204454540964982, 0.000172922203210746, &#xA;0.0043951044178534, 0.00170323796408711, -0.000533617929562413, &#xA;0.000841575646791437, 0.0009493670886076, 0.00477505036185932, &#xA;0.00240800263076935, 0.00104766339315954, 0.000909138960833111, &#xA;0.00509077850888784, 0.00328909345018547, 0.00160412259506937, &#xA;0.00107103890774041, 0.00254974502549743, 0.000578467062284815, &#xA;0.00337908555366173, -0.00140072718602857, 0.00422467406148375, &#xA;0.00172189447526239, -0.000234400179706773, -0.000341913740047883, &#xA;0.00276556239616932, 0.00202703361172563), .indexCLASS = &quot;Date&quot;, tclass = &quot;Date&quot;, .indexTZ = &quot;UTC&quot;, tzone = &quot;UTC&quot;, class = c(&quot;xts&quot;, &#xA;&quot;zoo&quot;), index = structure(c(1491177600, 1491264000, 1491350400, &#xA;1491436800, 1491523200, 1491782400), tzone = &quot;UTC&quot;, tclass = &quot;Date&quot;), .Dim = c(6L, 25L), .Dimnames = list(NULL, c(&quot;BE0000343526&quot;, &quot;BE6248644013&quot;, &#xA;&quot;FR0010171975&quot;, &quot;FR0013152907&quot;, &quot;IE00BV8C9186&quot;, &quot;SI0002103677&quot;, &#xA;&quot;XS0162513211&quot;, &quot;XS0162869076&quot;, &quot;XS0162990229&quot;, &quot;XS0908570459&quot;, &#xA;&quot;XS1117298247&quot;, &quot;XS1146286205&quot;, &quot;XS1196380031&quot;, &quot;XS1196817586&quot;, &#xA;&quot;XS1200679667&quot;, &quot;XS1202849086&quot;, &quot;XS1203860934&quot;, &quot;XS1313004928&quot;, &#xA;&quot;XS1362373224&quot;, &quot;XS1388864503&quot;, &quot;XS1405784015&quot;, &quot;XS1418788599&quot;, &#xA;&quot;XS1463101680&quot;, &quot;XS1538284230&quot;, &quot;XS1570260460&quot;)))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;weights&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;c(0.039728041, 0.040869022, 0.042067239, 0.039212564, 0.039765805, &#xA;0.040603312, 0.041035065, 0.04158508, 0.039500351, 0.042032909, &#xA;0.040638835, 0.040266658, 0.040995045, 0.04002851, 0.040191534, &#xA;0.039809092, 0.039765018, 0.041233473, 0.04085667, 0.027147317, &#xA;0.041430642, 0.040688867, 0.040016652, 0.040498212, 0.040034086&#xA;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7456" LastActivityDate="2017-07-27T09:11:51.310" Title="R returns numeric(0) when putting p=0.995 for calculating VaR" Tags="&lt;performanceanalytics&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35296" PostTypeId="1" AcceptedAnswerId="35300" CreationDate="2017-07-26T15:20:06.157" Score="0" ViewCount="266" Body="&lt;p&gt;One has entered a forward contract to purchase oil at $F_{t,T} = S_{t}e^{(r_f + s - c)(T-t)}$. The contract is entered at time $t$ and executed at time $T$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where:&lt;br&gt;&#xA;$S_{t}$ is the spot price at time $t$&lt;br&gt;&#xA;$r_{f}$ is the risk free rate&lt;br&gt;&#xA;$s$ are the storage costs&lt;br&gt;&#xA;$c$ is the convenience yield&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would one calculate the price at which one would settle the forward upfront (at time $t$)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;The question&lt;/strong&gt;: at what rate would you discount the forward price to determine the &quot;upfront settlement price&quot; i.e. the price settled today to take future delivery of the oil.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I initially thought of using a CAPM model to determine the risk of the underlying. However in both the classic forward and the &quot;upfront settled&quot; forward one is exposed to changes in the oil price, so this wouldn't make sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I then thought you could discount at the forward rate, but then one would settle at spot at time $t$ and I suppose one would rather then just buy the underlying?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas on the best approach would be much appreciated!&lt;/p&gt;&#xA;" OwnerUserId="28873" LastActivityDate="2017-07-26T18:43:41.407" Title="Up-front settlement of forward contract" Tags="&lt;forward&gt;&lt;forward-rate&gt;&lt;discounting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35297" PostTypeId="1" CreationDate="2017-07-26T16:47:58.413" Score="2" ViewCount="945" Body="&lt;p&gt;Suppose a Stock follows an Itô process with instantaneous volatility $\sigma(S(t),t)$. Precisely&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dS(t)=\mu S(t)dt+\sigma(S(t),t)S(t)dW(t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a historical data for the values of $S(t)$.How can I estimate the instantaneous volatilities $\sigma(S(t),t)$ that took place on each day in this historical &lt;strong&gt;daily&lt;/strong&gt; data series? &lt;/p&gt;&#xA;" OwnerUserId="25437" LastEditorUserId="25437" LastEditDate="2017-07-26T23:30:05.357" LastActivityDate="2018-01-25T09:44:00.173" Title="Instantaneous Volatility Estimator" Tags="&lt;volatility&gt;&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35298" PostTypeId="2" ParentId="14586" CreationDate="2017-07-26T16:48:42.093" Score="0" Body="&lt;p&gt;Apparently Interactive Brokers (IB) now supports a native Python API. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Previously, I recall there at least two 3rd party APIs to IB:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;IbPy (&lt;a href=&quot;https://github.com/blampe/IbPy&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/blampe/IbPy&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;li&gt;iBridgePy (&lt;a href=&quot;http://www.ibridgepy.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.ibridgepy.com/&lt;/a&gt;)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="22178" LastActivityDate="2017-07-26T16:48:42.093" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35300" PostTypeId="2" ParentId="35296" CreationDate="2017-07-26T18:43:41.407" Score="0" Body="&lt;p&gt;Normally you enter a forward with strike equal to the current forward price, there is no upfront settlement. If the contract does have an initial value (e.g. because the strike is zero) you do settle upfront, you discount the future cash flow to today. The discounting rate depends on your cost of funding and the price of credit risk.&lt;/p&gt;&#xA;" OwnerUserId="11851" LastActivityDate="2017-07-26T18:43:41.407" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35303" PostTypeId="2" ParentId="35295" CreationDate="2017-07-27T03:56:28.427" Score="1" Body="&lt;p&gt;The problem arises due to your data. Some of your columns do not have a negative value in that percentile (check for example &lt;code&gt;XS1463101680&lt;/code&gt; and &lt;code&gt;XS1203860934&lt;/code&gt; -- all positives), thus historical VaR is meaningless (your losses cannot be a positive value, loss is always negative). Therefore, you will get an error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, your code for &lt;code&gt;p = 0.95&lt;/code&gt; returns the same error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, this particular function will not work if you have less than &lt;strong&gt;200&lt;/strong&gt; data observations (returns). Why? Well, having investigated the code, I found the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the bottom of &lt;a href=&quot;https://github.com/cran/PerformanceAnalytics/blob/4c10886157a80dff2a25b28bb2ee83c1ab857639/R/VaR.R&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; page you can see the formula that is used to compute historical component VaR:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;component = {&#xA;        # @todo need to add another loop here for subsetting, I think, when weights is a timeseries&#xA;        #if (mu=NULL or sigma=NULL) {&#xA;        #     pfolioret = Return.portfolio(R, weights, wealth.index = FALSE, contribution=FALSE, method = c(&quot;simple&quot;))&#xA;        #}&#xA;        # for now, use as.vector&#xA;        weights=as.vector(weights)&#xA;        names(weights)&amp;lt;-colnames(R)&#xA;&#xA;    switch(method,&#xA;        modified = { return(VaR.CornishFisher.portfolio(p,weights,mu,sigma,m3,m4))},&#xA;        gaussian = { return(VaR.Gaussian.portfolio(p,weights,mu,sigma)) },&#xA;        historical = { return(VaR.historical.portfolio(R, p,weights)) },&#xA;        kernel = { return(VaR.kernel.portfolio(R, p,weights)) }&#xA;    )&#xA;&#xA;}, # end component portfolio switch&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Tracing back the function &lt;code&gt;VaR.historical.portfolio&lt;/code&gt;, on the bottom of &lt;a href=&quot;https://github.com/cran/PerformanceAnalytics/blob/4c10886157a80dff2a25b28bb2ee83c1ab857639/R/PortfolioRisk.R&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; page we observe:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;VaR.historical.portfolio = function(R,p,w)&#xA;{&#xA;    alpha = .setalphaprob(p)&#xA;    portret = c();&#xA;    T = dim(R)[1]&#xA;    N = dim(R)[2]&#xA;    for( t in c(1:T) ){&#xA;       portret = c(portret,sum(w*as.numeric(R[t,])))&#xA;    }&#xA;    hVaR = -1* sort(portret)[floor(alpha*T)]&#xA;    return(hVaR)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;T = dim(R)[1]&lt;/code&gt; piece gives you the number of rows of your data. Your alpha is &lt;code&gt;1 - 0.995&lt;/code&gt; or &lt;code&gt;0.005&lt;/code&gt;. Then you have this code &lt;code&gt;floor(alpha*T)&lt;/code&gt; which is basically destroying everything as &lt;code&gt;alpha*T&lt;/code&gt; is &lt;code&gt;0.76&lt;/code&gt; and &lt;code&gt;floor(0.76)&lt;/code&gt; is 0. And &lt;code&gt;sort(portret)[0]&lt;/code&gt; returns &lt;code&gt;numeric(0)&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function works for &lt;code&gt;p = 0.95&lt;/code&gt; because your alpha is &lt;code&gt;0.05&lt;/code&gt; and &lt;code&gt;102 * 0.05 = 5.1&lt;/code&gt; and &lt;code&gt;floor(5.1) = 5&lt;/code&gt; so you're getting the fifth element as your historical component VaR.&lt;/p&gt;&#xA;" OwnerUserId="19096" LastEditorUserId="19096" LastEditDate="2017-07-27T09:11:51.310" LastActivityDate="2017-07-27T09:11:51.310" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="35304" PostTypeId="2" ParentId="35241" CreationDate="2017-07-27T04:39:56.573" Score="1" Body="&lt;p&gt;Usually you can extract information/data like this from financial data vendors (Bloomberg, Reuters, etc.). I am going to explain how you can get volumes of a stock traded on different exchanges using Bloomberg:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Type in the search box AAPL &lt;/li&gt;&#xA;&lt;li&gt;Hit  &lt;/li&gt;&#xA;&lt;li&gt;Type in VWAP&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/hm5TD.gif&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/hm5TD.gif&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you can play around with different parameters like &lt;code&gt;period&lt;/code&gt;, &lt;code&gt;price&lt;/code&gt;, &lt;code&gt;volume&lt;/code&gt;, etc. Under the column &lt;code&gt;Breakdown&lt;/code&gt; you have the names of the exchanges where the security is traded and respective volume under the column &lt;code&gt;Volume&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also check the exchanges on &lt;a href=&quot;https://www.openfigi.com/search#!?pageSize=50&amp;amp;page=1&amp;amp;sort=EXCH_CODE&amp;amp;simpleSearchString=aapl&amp;amp;marketSector=Equity&quot; rel=&quot;nofollow noreferrer&quot;&gt;OpenFIGI&lt;/a&gt;. Just refine the filter by selecting &lt;code&gt;Common Stock&lt;/code&gt; in &lt;code&gt;Security Type&lt;/code&gt;. Unfortunately, this page only gives the Exchange codes. Here is a &lt;a href=&quot;https://www.google.kz/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=3&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0ahUKEwjyvJKMzajVAhVDDJoKHQn_AhcQFgg2MAI&amp;amp;url=http%3A%2F%2Fwww.ultumus.com%2Fwp-content%2Fuploads%2F2017%2F01%2FBloomberg-Exchange-Code-to-MIC-Mapping.xlsx&amp;amp;usg=AFQjCNEG4qDqfUkUC0_iHTV_Mlv1SqJzvQ&quot; rel=&quot;nofollow noreferrer&quot;&gt;link&lt;/a&gt; to an excel file where you can find the full details of Exchanges by their code.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me know if you have any further questions.&lt;/p&gt;&#xA;" OwnerUserId="19096" LastActivityDate="2017-07-27T04:39:56.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35305" PostTypeId="1" AcceptedAnswerId="35309" CreationDate="2017-07-27T05:26:35.940" Score="2" ViewCount="775" Body="&lt;p&gt;I am trying to derive a martingale pricing equation (closed form solution) for a best-of option. But I am getting stuck at a point.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are 2 stocks $U(t)$ and $V(t)$ they both follow GBM with a correlation of $\rho$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to price an European option whose final payoff is $\max \left\{ U(t), V(t) \right\}$. For simplicity I am assuming that interest rates are 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;V(0) = \mathbb{E} \left[ \max \left\{ U(t), V(t) \right\} \right]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By theory of total expectation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;V(0) = \mathbb{E} \left[ U(t) \right] \mathbb{P} \left\{ U(t) &amp;gt; V(t) \right\} + \mathbb{E} \left[ V(t) \right] \left( 1 - \mathbb{P} \left\{ U(t) &amp;gt; V(t) \right\} \right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I guess this is not the correct approach.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help is highly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="26457" LastEditorUserId="24222" LastEditDate="2017-07-27T06:41:30.487" LastActivityDate="2017-07-28T03:56:38.267" Title="Pricing Equation for Best of Options" Tags="&lt;option-pricing&gt;&lt;martingale&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35306" PostTypeId="1" AcceptedAnswerId="35310" CreationDate="2017-07-27T07:01:36.427" Score="4" ViewCount="336" Body="&lt;p&gt;Please help me figure out what is the mathematical relationship between $\frac{dV}{dS}$ (Delta) and $\frac{dV}{dK}$ ($K$=strike), taking into account vol skew.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ask this because I want to figure out the value of a digital at a certain strike, given that I know the vanilla option delta there, and also I have the volatility smile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that there is the equation:&#xA;$$ \frac{d V}{d S} = \frac{\partial V}{\partial S} + \frac{\partial V}{\partial \sigma} \frac{\partial \sigma}{\partial S} , $$ so I suppose there is something similar for what I need.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I recall , $dV/dK = N(d2)$ and $dV/dS = N(d1)$ (ignoring dividends and risk-free rates), so I just need some simple approximation linking $\frac{dV}{dS}$ and $\frac{dV}{dK}$ (approximation if an exact relationship is too complicated).&lt;/p&gt;&#xA;" OwnerUserId="17348" LastEditorUserId="26595" LastEditDate="2017-07-27T08:26:52.743" LastActivityDate="2018-07-27T17:21:39.420" Title="Mathematical equation relating $\frac{dV}{dS}$ to $\frac{dV}{dK}$" Tags="&lt;finance-mathematics&gt;&lt;delta&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35307" PostTypeId="1" AcceptedAnswerId="35314" CreationDate="2017-07-27T08:09:16.147" Score="0" ViewCount="121" Body="&lt;p&gt;I was reading &lt;a href=&quot;https://www.wsj.com/articles/real-yields-pull-back-as-investors-rethink-growth-prospects-1500814801?mod=e2fb&quot; rel=&quot;nofollow noreferrer&quot;&gt;this article&lt;/a&gt; which has this paragraph:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;One concern for investors is that a rise in real yields would raise borrowing costs, increasing the debt burden of consumers and businesses. That could further crimp the prospects for economic growth, which could make major central banks cautious in shifting toward reduced monetary stimulus.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I understand, yields(including real yields) are defined as $\frac{bond\ coupon}{bond\ value}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, if real yields are increasing, then it means bond values are decreasing, so a company issuing a bond would get less money.&#xA;But that doesn't stop the company from issuing more bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, why would borrowing costs rise?&lt;/p&gt;&#xA;" OwnerUserId="28949" LastActivityDate="2017-07-30T01:23:47.100" Title="How can a rise in real yields raise borrowing costs" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;bond-yields&gt;" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35309" PostTypeId="2" ParentId="35305" CreationDate="2017-07-27T08:55:50.367" Score="2" Body="&lt;p&gt;For best-of options, the usual approach is to use &lt;a href=&quot;https://quant.stackexchange.com/questions/21212/derivation-of-magrabe-formula&quot;&gt;Magrabe's formula&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Starting from the following relationship:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\max\{U(t),V(t)\} = U(t) + \max\{V(t) - U(t), 0\} ,$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you end up with the sum of one of the underlying asset, $U(t)$, and an exchange option paying $\max\{V(t) - U(t), 0\}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While the present value of the first term is easy to find, the second requires Magrabe's results stating that the price of the exchange option is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V(t) N(d_U) e^{-q_V \tau} - U(t) N(d_V) e^{-q_U \tau}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d_V = \frac{\ln\left(V(t) / U(t)\right) + \left( q_U - q_V -  \sigma^2 / 2\right)\tau}{\sigma \sqrt{\tau}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d_U = d_V + \sigma \sqrt{\tau}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma^2 = \sigma^2_U + \sigma^2_V - 2 \rho \sigma_U \sigma_V$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $\tau$ being the time-to-expiration, $q_x$ and $\sigma_x$ being respectively the dividend yield and the volatility of asset $x$, $x \in \{U,V \}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, the price of your best-of option becomes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$U(t) e^{-q_U \tau} + V(t) N(d_U) e^{-q_V \tau} - U(t) N(d_V) e^{-q_U \tau}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which simplifies to &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V(t) N(d_U) e^{-q_V \tau} + U(t) N(-d_V) e^{-q_U \tau}$$&lt;/p&gt;&#xA;" OwnerUserId="26595" LastActivityDate="2017-07-27T08:55:50.367" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="35310" PostTypeId="2" ParentId="35306" CreationDate="2017-07-27T09:05:55.897" Score="11" Body="&lt;p&gt;If your working modelling assumptions are such that the dynamics of the log price process $\ln(S_t)$ is &lt;em&gt;space homogeneous&lt;/em&gt;, you have that the price of a European vanilla option is itself a space-homogeneous function of degree one. You can then appeal to Euler theorem to get the relationship you need.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More specifically, define the price at time $t$ of the option expiring at $T$ and struck at $K$ as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ V = DF(t,T)\, \Bbb{E}_t^\Bbb{Q} \left[ (w(S_T - K))^+ \right] := V(S_t, K, T-t, \theta) $$&#xA;where $\theta$ figures the relevant model parameters and $w=\pm1$ the call/put factor. Now under the space homogeneity assumption we've just mentioned, you can write that&#xA;$$ V(xS_t,xK,T-t,\theta) = x V(S_t,K,T-t,\theta), \forall x \geq 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Taking the derivative with respect to $x$ on both sides and then setting $x=1$ gives:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{\partial V}{\partial S} S + \frac{\partial V}{\partial K} K = V $$&#xA;hence&#xA;$$ \frac{\partial V}{\partial K} = \frac{1}{K} \left( V - \frac{\partial V}{\partial S} S \right) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is what you are looking for.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;And indeed if you are pricing a digital call ($D$ below) for instance, using the notation $C$ to denote the European call price&#xA;\begin{align}&#xA;D &amp;amp;= -\frac{dC}{dK} \\&#xA;    &amp;amp;= -\left[ \frac{\partial C}{\partial K} + \frac{\partial C}{\partial \Sigma} \frac{\partial \Sigma}{\partial K} \right] \\&#xA;   &amp;amp;= -\left[ \frac{1}{K}\left( C - \Delta S\right) + \nu \frac{\partial \Sigma}{\partial K}  \right]&#xA;\end{align}&#xA;where for a maturity $T$ and strike level $K$, $C$ is the corresponding European call price, $\Delta$ its BS Delta, $\nu$ its BS Vega and $\partial \Sigma/\partial K$ the IV skew. We have moved from the second line to the third using the result which we just derived.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2018-07-27T17:21:39.420" LastActivityDate="2018-07-27T17:21:39.420" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="35311" PostTypeId="2" ParentId="35307" CreationDate="2017-07-27T09:41:52.063" Score="3" Body="&lt;p&gt;Let's consider raising money (issuing 1 year zero coupon bond) under the following 2 scenarios (ceteris paribus):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;High yields (20%) -- you raise 80 USD and promise to return 100 USD at the end of the year. Your cost is 20 USD;&lt;/li&gt;&#xA;&lt;li&gt;Low yields (5%) -- you raise 95 USD and promise to return 100 USD at the end of the year. Your cost is 5 USD;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="19096" LastActivityDate="2017-07-27T09:41:52.063" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35314" PostTypeId="2" ParentId="35307" CreationDate="2017-07-27T11:55:44.400" Score="5" Body="&lt;p&gt;Your formula is the definition of the running yield, which is a crude approximation.&#xA;Let $P$ be the price of a zero-coupon bond paying 100 at maturity and $y$ its yield. Then it holds that&#xA;$$&#xA;P = 100 \times \exp(- y T),&#xA;$$&#xA;where $T$ is the maturity. If we set $y = i+r$, where $i$ is the inflation and $r$  is the real interest rate (similar to the &lt;a href=&quot;https://en.wikipedia.org/wiki/Fisher_equation&quot; rel=&quot;nofollow noreferrer&quot;&gt;Fisher equation&lt;/a&gt;) then this becomes:&#xA;$$&#xA;P = 100 \times \exp(- (i + r) T),&#xA;$$&#xA;thus the higher $r$ the less you get now and still have to pay 100 after $T$. This is how real rates make borrowing more expensive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same is true for coupon-bearing bonds.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="26595" LastEditDate="2017-07-27T16:05:23.020" LastActivityDate="2017-07-27T16:05:23.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35315" PostTypeId="1" AcceptedAnswerId="35347" CreationDate="2017-07-27T13:25:18.470" Score="1" ViewCount="197" Body="&lt;p&gt;Does anyone know a good online trading platform for simulation (no to make real money, but just to simulate a P&amp;amp;L) ?&#xA;I would like to test myself  as a bank trader (so sell side and not buy side) just to see if I could  be good at it...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to trade vanillas but also exotic with the possibility to have the associated greeks to hedge them with real-time market data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does such a platform for simulation (I insist) exist ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Tx&lt;/p&gt;&#xA;" OwnerUserId="15738" LastEditorUserId="15738" LastEditDate="2017-07-27T13:31:36.363" LastActivityDate="2020-09-23T16:21:09.907" Title="Online trading platform" Tags="&lt;finance&gt;&lt;trading&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35316" PostTypeId="1" AcceptedAnswerId="35319" CreationDate="2017-07-27T13:51:41.463" Score="2" ViewCount="336" Body="&lt;p&gt;Let's assume we have a normal distribution $X\sim \mathcal{N}(\mu,\sigma^2)$. In a normal distribution the quantile can be calculated as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\Phi_X ^{-1}(p)=\mu +\sigma {\sqrt {2}}\operatorname {erf} ^{-1}(2p-1)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we want to calculate the value in the future of a stock we map it as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;Y=\exp(X)&#xA;\end{equation}&#xA;Which means:&#xA;\begin{equation}&#xA;\log(Y)\sim \mathcal{N}(\mu,\sigma^2)&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to know that if the function of the quantile can be calculated based directly on:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\Phi_Y ^{-1}(p)=\exp(\mu -\sigma/2+\sigma {\sqrt {2}}\operatorname {erf} ^{-1}(2p-1))&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The part of the equation $-\sigma/2$ is extracted from îto calculus, however, I cannot find anywhere the correctness of this equation (I deduced it). I think the function $exp$ is monotonic, so, it should preserve the value for the quantiles, but I'm not certain. One of my certainties is that $\mu$ changed to $\mu-\sigma/2$, I have no idea if that modifies in some way the calculation of $\Phi_Y ^{-1}(p)$, or if $\sigma$ also changed.&lt;/p&gt;&#xA;" OwnerUserId="24610" LastEditorUserId="24610" LastEditDate="2017-07-28T08:24:19.650" LastActivityDate="2017-07-28T08:24:19.650" Title="Quantile normal and lognormal" Tags="&lt;probability&gt;&lt;distribution&gt;&lt;itos-lemma&gt;&lt;normal-distribution&gt;&lt;lognormal&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35318" PostTypeId="2" ParentId="35307" CreationDate="2017-07-27T14:29:12.867" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;a company issuing a bond would get less money. But that doesn't stop the company from issuing more bonds.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;No, but it increases the &lt;em&gt;cost&lt;/em&gt; of borrowing.  Suppose a company wants to sell bonds to raise \$1,000. If the amount a company can get for a new \$1,000 bond issue lowers from \$950 to \$900, then it has to either &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;issue more bonds in order to receive the same amount, &lt;/li&gt;&#xA;&lt;li&gt;settle for less money received, or &lt;/li&gt;&#xA;&lt;li&gt;raise the coupon rate of the bond issues. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;All of those either directly increase costs (more interest paid) or reduce the benefit to the company, indirectly increasing costs.&lt;/p&gt;&#xA;" OwnerUserId="20213" LastActivityDate="2017-07-27T14:29:12.867" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35319" PostTypeId="2" ParentId="35316" CreationDate="2017-07-27T14:42:15.250" Score="6" Body="&lt;p&gt;Quantiles are preserved under monotonic transformations, hence the quantile for $Y$ is simply the exponential of the quantile of $X$, no need for corrections whatsoever (see &lt;a href=&quot;https://stats.stackexchange.com/questions/159460/can-quantiles-be-calculated-for-lognormal-distributions&quot;&gt;here&lt;/a&gt; for instance). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put otherwise, let $q$ denote the quantile $\alpha$ of $X$ i.e.&#xA;$$\Bbb{P}(X \leq q) = \alpha$$ &#xA;then&#xA;\begin{align}&#xA;\Bbb{P}( X \leq q ) &amp;amp;= \Bbb{P}( \underbrace{\exp(X)}_{Y} \leq \underbrace{\exp(q)}_{Q} ) = \alpha &#xA;\end{align}&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2017-07-27T14:42:15.250" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35321" PostTypeId="1" CreationDate="2017-07-27T21:51:53.727" Score="2" ViewCount="868" Body="&lt;p&gt;I understand that there exist a cross Currency Basis between euro and dollar of about 35 bps, which in my understanding can be arbitraged out by following principle of interest rate parity. However, it still exists and has increased dramatically after change in NAV regulations for money market MFs in the US. Could somebody pls explain why Cross Currency Basis should exist in the world of complete capital mobility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="28231" LastActivityDate="2017-07-28T06:21:35.660" Title="Cross Currency Basis Swap" Tags="&lt;interest-rate-swap&gt;&lt;financial-markets&gt;&lt;cross-currency-basis&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35322" PostTypeId="2" ParentId="35321" CreationDate="2017-07-28T00:01:57.917" Score="2" Body="&lt;p&gt;To give a short answer , it is very simple.  Market participants cannot actually borrow and lend freely at USD Libor or Euribor.  Hence the basis swap cannot easily be arbitraged away.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-07-28T00:01:57.917" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35324" PostTypeId="2" ParentId="35305" CreationDate="2017-07-28T03:56:38.267" Score="-1" Body="&lt;p&gt;Assuming GBM dynamics, I work through the (tedious) details of a worst-of call option in the more general case of a nonzero strike. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;ntgladd.com &lt;/p&gt;&#xA;&#xA;&lt;p&gt;tab = &lt;em&gt;Finance&lt;/em&gt;, subsection = &lt;em&gt;Option models&lt;/em&gt;, &#xA;file = &lt;em&gt;Worst Of Call Option - Three Ways&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a real world application, you would use Monte Carlo with some sort of market calibrated local vol or stochastic vol model. &lt;/p&gt;&#xA;" OwnerUserId="28807" LastActivityDate="2017-07-28T03:56:38.267" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35325" PostTypeId="1" AcceptedAnswerId="35326" CreationDate="2017-07-28T05:21:57.590" Score="1" ViewCount="370" Body="&lt;p&gt;Typically, we value 1 dollar at time $T$ at $e^{-Tr}$, where $r$ is the risk-free rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why wouldn't we do this for future cash flows in expected earnings for a corporation? Why do we discount at WACC instead to provide a valuation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that one should try to &quot;beat&quot; the WACC rate to be profitable, but I don't see why this should affect valuation.&lt;/p&gt;&#xA;" OwnerUserId="28961" LastActivityDate="2017-07-28T06:12:32.767" Title="Why does DCF discount at WACC and not risk-free rate?" Tags="&lt;risk-neutral-measure&gt;&lt;valuation&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35326" PostTypeId="2" ParentId="35325" CreationDate="2017-07-28T06:12:32.767" Score="3" Body="&lt;p&gt;A dollar to be received with certainty (for example, you have purchased a bill from the US government) at time $t$ will be valued at $e^{-rt}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are uncertain about whether you will receive the dollar or not, you should take this into account. A simple model is that the institution who is supposed to pay you will default with probability $p$, in which case the value of the dollar is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;V = p \times 0 + (1 - p) \times e^{-rt} = (1-p)e^{-rt}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For convenience, we often write this as the discounted value of a dollar with a risky discount rate $\lambda$, that is,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;e^{-\lambda t} = (1-p)e^{-rt}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which rearranges to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\lambda  = r + \frac{1}{t}\log\left( \frac{1}{1-p} \right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;when $p$ is small, this is approximately $\lambda \approx r + p/t$. The following two situations are equivalent -&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Discounting an uncertain payment with a risk-free discount rate&lt;/li&gt;&#xA;&lt;li&gt;Discounting an assumed certain payment with a risky discount rate&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="924" LastActivityDate="2017-07-28T06:12:32.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35327" PostTypeId="2" ParentId="35321" CreationDate="2017-07-28T06:21:35.660" Score="3" Body="&lt;p&gt;To add to dm63's answer, I think there are a few reasons -&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;It's worth asking about why a cross-currency basis spread exists in the first place. The standard explanation is demand from (for example) Japanese corporates to issue fixed-rate debt in the US, where rates are generally higher, and swap the payments back into JPY with a cross-currency basis swap. This demand only goes one way, so it puts pressure on which pushes the basis away from zero.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Global investment banks, who are the market participants able to borrow and lend at closest to USD LIBOR or EURIBOR, would in the past absorb this flow, and arbitrage away any differences. But they are constrained by balance sheet considerations - arbitraging away a five year EUR/USD cross-currency basis swap spread requires deploying balance sheet for up to five years, for a return of only 35 basis points. Many banks don't think it is worth it.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Other market participants, e.g. hedge funds, can't generally borrow/lend at LIBOR or EURIBOR themselves, so the option may not be open to them. Even if it was, they generally don't have enough cash on hand to make it economically viable, so they would need to borrow from banks, who would need to deploy balance sheet to support the borrowing, and we have just seen that banks don't like to deploy balance sheet right now.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="924" LastActivityDate="2017-07-28T06:21:35.660" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35329" PostTypeId="1" CreationDate="2017-07-28T09:51:05.763" Score="3" ViewCount="454" Body="&lt;p&gt;I was reading a WSJ article about the European Central Bank shadow rate, which is -5.1% at the moment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The article says about  the shadow rate that &quot;Calculated with the rates on longer-dated credit instruments, this gauges where the ECB's benchmark rate might be if it could be set meaningfully below 0&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what is this shadow rate and how is it connected to the interest rate?&lt;/p&gt;&#xA;" OwnerUserId="28949" LastEditorUserId="16160" LastEditDate="2019-01-26T19:27:09.533" LastActivityDate="2021-03-17T04:52:47.363" Title="What is a central bank's shadow rate" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;bond-yields&gt;&lt;central-banking&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="35330" PostTypeId="2" ParentId="35217" CreationDate="2017-07-28T11:37:05.503" Score="2" Body="&lt;p&gt;Unfortunately for you (but maybe helpful to others) I can only refer to R packages.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The R package high-frequency (&lt;a href=&quot;https://cran.r-project.org/package=highfrequency&quot; rel=&quot;nofollow noreferrer&quot;&gt;link&lt;/a&gt;) provides &lt;code&gt;rHYCov&lt;/code&gt;.  The synchrony package (&lt;a href=&quot;https://cran.r-project.org/package=synchrony&quot; rel=&quot;nofollow noreferrer&quot;&gt;link&lt;/a&gt;) provides a whole plethora of methods for temporal, spatial and spatio-temporal statistics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, I would personally advise against HY for its boundary artefacts and instead use something more robust like cross-correlation with the Bjornstad-Falck kernel.&lt;/p&gt;&#xA;" OwnerUserId="1040" LastActivityDate="2017-07-28T11:37:05.503" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35333" PostTypeId="1" AcceptedAnswerId="35344" CreationDate="2017-07-28T14:34:31.610" Score="0" ViewCount="43" Body="&lt;p&gt;I was reading &lt;a href=&quot;https://www.wsj.com/articles/airbus-earnings-hit-by-lower-aircraft-deliveries-1501138056?mod=e2fb&quot; rel=&quot;nofollow noreferrer&quot;&gt;this article&lt;/a&gt;, and I am puzzled by this paragraph:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Airbus reported a 34% fall in net income to €895 million ($1.1 billion). The company also suffered about €2 billion in cash outflow in the first six months of 2017.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how can can the company have an income of &lt;code&gt;€895&lt;/code&gt; if it has lost &lt;code&gt;€2 billion&lt;/code&gt; in cash outflows?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If it has a &lt;code&gt;€2 billion&lt;/code&gt; cash outflow, doesn't that mean that it's net income is a loss of &lt;code&gt;€2 billion&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="28949" LastActivityDate="2017-07-28T19:35:18.833" Title="How can a company have positive net income if it has a negative cash outflow" Tags="&lt;income&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2017-07-29T12:12:53.017" ContentLicense="CC BY-SA 3.0" />
  <row Id="35334" PostTypeId="2" ParentId="34995" CreationDate="2017-07-28T14:59:51.133" Score="0" Body="&lt;p&gt;For the first problem: &lt;code&gt;VanillaSwap&lt;/code&gt; doesn't allow amortization.  You'll have to create the fixed and floating legs with &lt;code&gt;FixedRateLeg&lt;/code&gt; and &lt;code&gt;IborLeg&lt;/code&gt; (which take a list of notionals) and use them to build an instance of the &lt;code&gt;Swap&lt;/code&gt; class.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the second, if the rate of the floating cashflow has been fixed on date &lt;code&gt;d&lt;/code&gt; to a rate &lt;code&gt;r&lt;/code&gt;, you can run&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;index.addFixing(d, r);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;to store the information and make it available for calculation.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2017-07-28T14:59:51.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35335" PostTypeId="1" CreationDate="2017-07-28T15:30:14.603" Score="10" ViewCount="2028" Body="&lt;p&gt;I'd like this question to definitively guide a practitioner to using both $\mathbb{P}$ vs $\mathbb{Q}$ probabilities in trading and research.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's take only one fact as given: if I have a risk-neutral probability distribution I can price and hedge any option.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is the distinction more philosophical or practical? Does it have real impact on&#xA;trading desks P/L? For example, is it a construct to remind us we're not in the &quot;real world&quot; when modeling?&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/8274/how-to-estimate-real-world-probabilities?noredirect=1&amp;amp;lq=1&quot;&gt;This question&lt;/a&gt; says it is the difference in using $\mu$ vs $r$ when solving the S.D.E... which seems to say if I definitively knew $\mu$ and $r$ I would be able to transition with absolutely no loss of information. What edge would this provide me in the market?&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1717163&quot; rel=&quot;noreferrer&quot;&gt;This good paper&lt;/a&gt; and &lt;a href=&quot;https://quant.stackexchange.com/a/25945/20194&quot;&gt;this good answer&lt;/a&gt; seems to divide them on the &lt;em&gt;approach&lt;/em&gt; of their research. $\mathbb{P}$-quants vs $\mathbb{Q}$-quants... in this sense it seems to be that $\mathbb{P}$-Quants are concerned with modeling the future using historical data sets. Projection. $\mathbb{Q}$-quants are concered with &lt;em&gt;relative valuation&lt;/em&gt; and making sure that their pricing shemes are consistent with exchange traded products that are observed in the market. Extrapolation. I see that these job functions are different, but I do not see why one &lt;em&gt;could&lt;/em&gt; not apply $\mathbb{P}$ methods to the $\mathbb{Q}$ world (their effectiveness seems less important to me - it doesn't seem like a scientific violation). &lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Girsanov_theorem&quot; rel=&quot;noreferrer&quot;&gt;Girsanov's Theorem&lt;/a&gt; shows its possible to switch between the two. Now I know I CAN draw conclusions from each other, but the method is not clear.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is there a way on paper to move from&lt;/strong&gt;&#xA; $\mathbb{P}$ &lt;strong&gt;to&lt;/strong&gt; $\mathbb{Q}$ &lt;strong&gt;and vice-versa if I have a closed form-solution or a parameterized model of either&lt;/strong&gt; $\mathbb{P}$ &lt;strong&gt;or&lt;/strong&gt; $\mathbb{Q}$? If my returns under $\mathbb{Q}$ is $X \sim \mathcal{N}(r,\,\sigma^{2})\,$. From here, how can I get to $\mathbb{P}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd prefer to stay out of a model-framework completely and let all results be in general. From what I've found I believe the connection is in putting a price on the market risk premium, but I have not found empirical estimations of this or attempts to use its estimation for moving between $\mathbb{P}$ and $\mathbb{Q}$. Any papers on $\lambda$ estimation or extraction would be appreciated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wanted to add this quote from Gary Hatfield:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Recall that the whole point of risk neutral pricing is to recover the price of traded options in a way that avoids arbitrage. As such, the probabilities of various paths are implied from the prices of various traded securities whose payoffs depend on those paths. Since investors are in aggregate risk averse, these prices imply higher probabilities to bad scenarios than they do to good scenarios. Hence, while everyone (almost!) agrees that stocks have a higher expected return than risk free bonds, the prices of stock and stock options imply the only difference between stocks and risk free bonds is that stocks are more volatile. Put another way, a risk neutral scenario set has many more really bad scenarios than a real world scenario set precisely because investors fear these scenarios. They therefore overweigh their probability when deciding how much a security is worth.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This provides intuitive context to the difference, but makes it seem&#xA;impossible to every replicate the $\mathbb{P}$ world.&lt;/p&gt;&#xA;" OwnerUserId="20194" LastEditorUserId="20454" LastEditDate="2017-07-28T16:29:14.987" LastActivityDate="2018-09-26T15:26:37.030" Title="$\mathbb{P}$ vs $\mathbb{Q}$ Probabilities - Transitioning Between Measures" Tags="&lt;probability&gt;&lt;risk-neutral-measure&gt;&lt;discounting&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="35336" PostTypeId="1" CreationDate="2017-07-28T15:32:42.827" Score="2" ViewCount="501" Body="&lt;p&gt;Credit default swap is the premium you pay to protect against a credit default from your borrower. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would it be equal to the credit premium over risk free i.e. bond yield - risk free of comparable maturity Treasury security (adjusted for tenor, liquidity etc)?&lt;/p&gt;&#xA;" OwnerUserId="28231" LastActivityDate="2017-10-26T19:32:24.503" Title="CDS Vs Credit Risk premium over risk free" Tags="&lt;credit-risk&gt;&lt;cds&gt;&lt;credit-derivatives&gt;&lt;default-risk&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35337" PostTypeId="2" ParentId="35329" CreationDate="2017-07-28T16:00:18.967" Score="8" Body="&lt;p&gt;It looks like it's referring to &lt;a href=&quot;https://sites.google.com/site/jingcynthiawu/home/wu-xia-shadow-rates&quot; rel=&quot;noreferrer&quot;&gt;Wu and Xia (2016) shadow rates&lt;/a&gt;. Some more media coverage is &lt;a href=&quot;http://review.chicagobooth.edu/magazine/summer-2014/is-fed-intervention-effective-ask-the-shadow-rate&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;. The core idea of a shadow rate goes back at least to &lt;a href=&quot;http://www.jstor.org/stable/2329320?seq=1#page_scan_tab_contents&quot; rel=&quot;noreferrer&quot;&gt;Fischer Black&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Black (1995)&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Fischer Black's idea was that the nominal short rate &lt;span class=&quot;math-container&quot;&gt;$r_t$&lt;/span&gt; is an option. One can either:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Invest and earn the real shadow rate &lt;span class=&quot;math-container&quot;&gt;$s_t$&lt;/span&gt;, which is based on the investment opportunity set, plus expected inflation.&lt;/li&gt;&#xA;&lt;li&gt;Hold currency and earn 0.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Thus the shadow rate &lt;span class=&quot;math-container&quot;&gt;$s_t$&lt;/span&gt; can go negative while the short rate &lt;span class=&quot;math-container&quot;&gt;$r_t$&lt;/span&gt; observed in markets is always non-negative.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Wu and Xia (2016)&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Wu and Xia (2016) take that idea and estimate a shadow federal funds rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The short rate is maximum of a lower bound &lt;span class=&quot;math-container&quot;&gt;$\underline{r}$&lt;/span&gt; and the shadow rate &lt;span class=&quot;math-container&quot;&gt;$s_t$&lt;/span&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ r_t = \max(\underline{r}, s_t) $$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a Gaussian affine term structure model (GATSM), the forward rates are affine in state variables &lt;span class=&quot;math-container&quot;&gt;$X_t$&lt;/span&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ f^{GATSM}_{n, n+1, t} = a_n + b_n'X_t $$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Wu and Xia (2016), their non-linear model implies the forward rate can be approximated by: &#xA;&lt;span class=&quot;math-container&quot;&gt;$$ f^{SRSTM}_{n, n+1, t} = \underline{r} +  \sigma^\mathbb{Q}_n g\left(\frac{a_n + {b_n^\mathbb{Q}}'X_t - \underline{r}}{\sigma^\mathbb{Q}_n}\right)  $$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They linearize &lt;span class=&quot;math-container&quot;&gt;$g$&lt;/span&gt; around the current estimate and apply a Kalman filter to estimate. You'll want to read their paper to see precisely what they do and it's possible I'm butchering something (this isn't my area).&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;References:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Black, Fischer, &quot;Interest Rates as Options,&quot; &lt;em&gt;Journal of Finance&lt;/em&gt;, 1995&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wu, Cynthia Jing and Fan Dora Xia, &quot;Measuring the Macroeconomic Impact of Monetary Policy at the Zero Lower Bound,&quot; &lt;em&gt;Journal of Money, Credit, and Banking&lt;/em&gt;, 2016&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2019-01-26T17:43:00.850" LastActivityDate="2019-01-26T17:43:00.850" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="35338" PostTypeId="2" ParentId="35336" CreationDate="2017-07-28T16:57:34.313" Score="2" Body="&lt;p&gt;In theory, it should indeed be equal as holding a bond $B_t$ from some company $X$ as well as paying on a CDS written on the bond should earn you the risk-free rate, given the CDS hedges the default risk of your bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, there is a CDS-bond basis, which is equal to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \text{Basis}_{\text{ CDS-Bond}} = \text{Premium}_{\text{ CDS}} - \text{Spread}_{\text{ Bond}} $$  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $\text{Premium}_{\text{ CDS}}$ is the CDS annual premium and $\text{Spread}_{\text{ Bond}}$ the difference between the bond yield and the risk-free rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;AFAIK historically these basis have been positive: indeed, in a CDS your credit exposure is higher than with a bond because you are not only exposed to the credit risk of $X$ but also to the credit risk of the counterparty with whom you have entered the CDS trade. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, again AFAIK, I think since the crisis they have turned negative quite often. This is often due to changes in demand and supply dynamics, normally due to regulation or practical trading issues. For example, under Basel II rules CDS were capital-relief instruments because they allowed banks to compress regulatory capital for credit risk, but since then Basel rules have changed (Basel III now) and the favorable treatment of CDS has been restrained, driving down CDS trading significantly $-$ before the crisis, I believe I read somewhere between 50% to 80% of CDS trading was driven by capital-relief trades by banks; unfortunately I am unable to find the source. &lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-07-28T17:13:19.557" LastActivityDate="2017-07-28T17:13:19.557" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35340" PostTypeId="2" ParentId="30398" CreationDate="2017-07-28T17:26:54.607" Score="3" Body="&lt;p&gt;I think the accepted answer gives the right insight, but I would like to add a further consideration: the difference between credit and counterparty risk is related to the &lt;em&gt;main risk you are seeking compensation for when entering a trade&lt;/em&gt;. Indeed:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;We might speak of &lt;strong&gt;credit risk&lt;/strong&gt; when you enter a trade for which &lt;em&gt;you are seeking compensation primarily for the risk that your counterparty might not pay you back&lt;/em&gt;: this is the case of a corporate bond for example, in which case you are first and foremost taking a view on the credit quality of the issuer.&lt;/li&gt;&#xA;&lt;li&gt;We might speak of &lt;strong&gt;counterparty risk&lt;/strong&gt; when you enter a trade for which &lt;em&gt;you are seeking compensation primarily for some risk other than credit (equity risk, rate risk, etc.) but for which you are nonetheless exposed to the credit quality of a counterparty&lt;/em&gt;: this would be the case of any derivative transaction for example, in which you might be taking rate risk (e.g. interest rate swap) or equity risk (e.g. stock option) but which remains nonetheless a contract with a party which has to pay you at maturity $-$ hence subject to the risk the counterparty might default and not pay what they own you.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="20454" LastActivityDate="2017-07-28T17:26:54.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35341" PostTypeId="1" CreationDate="2017-07-28T17:28:45.520" Score="1" ViewCount="390" Body="&lt;p&gt;I have got two rather short questions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Statement:&lt;/strong&gt;&#xA;Theoretically, a firm's equity prices and credit spreads should be negatively correlated. This correlation tends to be stronger for riskier companies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My questions:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is this statement correct?&lt;/li&gt;&#xA;&lt;li&gt;Does this statement tell anything about the stock &lt;em&gt;returns&lt;/em&gt; and the credit spread &lt;em&gt;changes&lt;/em&gt;? In other words: Can I conclude that the correlation mentioned above also holds for stock returns (%) and spread changes (%)?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="27779" LastActivityDate="2017-11-28T21:18:32.833" Title="Correlation between equity returns and debt spread changes" Tags="&lt;equities&gt;&lt;bond&gt;&lt;correlation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35342" PostTypeId="2" ParentId="35335" CreationDate="2017-07-28T18:53:37.247" Score="11" Body="&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$\mathbb{P}$&lt;/span&gt; is the true probability measure. Measure &lt;span class=&quot;math-container&quot;&gt;$\mathbb{Q}$&lt;/span&gt; is a measure of convenience that allows risk neutral pricing. &lt;a href=&quot;https://quant.stackexchange.com/questions/38477/what-is-the-difference-between-risk-neutral-probabilities-and-stochastic-discoun/38489#38489&quot;&gt;Stochastic discount factor &lt;span class=&quot;math-container&quot;&gt;$M$&lt;/span&gt; takes you between the two.&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;If you care about prices you can either: (1) work under &lt;span class=&quot;math-container&quot;&gt;$\mathbb{Q}$&lt;/span&gt; or (2) work under &lt;span class=&quot;math-container&quot;&gt;$\mathbb{P}$&lt;/span&gt; &lt;em&gt;with&lt;/em&gt; a stochastic discount factor &lt;span class=&quot;math-container&quot;&gt;$M$&lt;/span&gt;. There's an isomorphic relationship between settings (1) and (2).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If you care about the real world probabilities of various outcomes, you need to use &lt;span class=&quot;math-container&quot;&gt;$\mathbb{P}$&lt;/span&gt;. If you want real world, expected returns you want &lt;span class=&quot;math-container&quot;&gt;$\mathbb{P}$&lt;/span&gt;. (In efficient markets, the expected return under &lt;span class=&quot;math-container&quot;&gt;$\mathbb{Q}$&lt;/span&gt; of every security is the risk free rate.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;Theoretical justification behind the existence of a measure &lt;span class=&quot;math-container&quot;&gt;$\mathbb{Q}$&lt;/span&gt;&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Perhaps it's useful to backup a moment and revisit basic foundations of asset pricing theory.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Let &lt;span class=&quot;math-container&quot;&gt;$X$&lt;/span&gt; be a random variable denoting a risky cash flow next period.&lt;/li&gt;&#xA;&lt;li&gt;Let &lt;span class=&quot;math-container&quot;&gt;$f(X)$&lt;/span&gt; be a pricing function which gives today's price for a risky cash flow.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;An obviously desirable feature of &lt;span class=&quot;math-container&quot;&gt;$f$&lt;/span&gt; is that it should be linear: &lt;span class=&quot;math-container&quot;&gt;$f(aX + bY) = af(X) + bf(Y)$&lt;/span&gt; (where &lt;span class=&quot;math-container&quot;&gt;$a$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$b$&lt;/span&gt; are scalars and &lt;span class=&quot;math-container&quot;&gt;$Y$&lt;/span&gt; is another risky cash flow). If &lt;span class=&quot;math-container&quot;&gt;$f$&lt;/span&gt; is a &lt;a href=&quot;https://en.wikipedia.org/wiki/Functional_(mathematics)&quot; rel=&quot;noreferrer&quot;&gt;linear functional&lt;/a&gt; then there exists a &lt;a href=&quot;https://en.wikipedia.org/wiki/Stochastic_discount_factor&quot; rel=&quot;noreferrer&quot;&gt;stochastic discount factor&lt;/a&gt; &lt;span class=&quot;math-container&quot;&gt;$M$&lt;/span&gt; such that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ f(X) = \operatorname{E}^\mathbb{P}[MX]$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we're in a discrete probability space with &lt;span class=&quot;math-container&quot;&gt;$n$&lt;/span&gt; possible outcomes (for simplicity), then for any linear functional &lt;span class=&quot;math-container&quot;&gt;$f$&lt;/span&gt;, there exists an &lt;span class=&quot;math-container&quot;&gt;$M$&lt;/span&gt; such that &lt;span class=&quot;math-container&quot;&gt;$f$&lt;/span&gt; can be written as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ f(X) = \sum_i p_i m_i x_i $$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That whole &lt;span class=&quot;math-container&quot;&gt;$M$&lt;/span&gt; business may be rather inconvenient. Is there something we could do? Let &lt;span class=&quot;math-container&quot;&gt;$q_i = \frac{p_i m_i}{\sum_j p_j m_j}$&lt;/span&gt;. Observe that &lt;span class=&quot;math-container&quot;&gt;$\sum_i q_i = 1$&lt;/span&gt; so that &lt;span class=&quot;math-container&quot;&gt;$Q$&lt;/span&gt; is a probability measure. Also observe that the risk free rate satisfies &lt;span class=&quot;math-container&quot;&gt;$1 = \sum_i p_i m_i (1 + r_f)$&lt;/span&gt; hence &lt;span class=&quot;math-container&quot;&gt;$ \sum_i p_i m_i = \frac{1}{1 + r_f}$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \operatorname{E}^\mathbb{P}[MX] = \sum_i p_i m_i x_i = \frac{1}{1+r_f} \sum_i q_i x_i = \frac{1}{1+r_f} \operatorname{E}^\mathbb{Q}[X]$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For pricing, you can either use:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;probability measure &lt;span class=&quot;math-container&quot;&gt;$\mathbb{P}$&lt;/span&gt; along with the stochastic discount factor &lt;span class=&quot;math-container&quot;&gt;$M$&lt;/span&gt;&lt;/li&gt;&#xA;&lt;li&gt;a tilted probability measure &lt;span class=&quot;math-container&quot;&gt;$\mathbb{Q}$&lt;/span&gt; and risk neutral pricing.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;They're the same thing.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Discussion&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;A fundamental idea of asset pricing theory is that each state of the world &lt;span class=&quot;math-container&quot;&gt;$i$&lt;/span&gt; may have a different state price given by &lt;span class=&quot;math-container&quot;&gt;$p_i m_i$&lt;/span&gt;. The idea of risk neutral pricing is that for convenience, you can pack this into a tilted probability measure Q where &lt;span class=&quot;math-container&quot;&gt;$q_i$&lt;/span&gt; is proportional to &lt;span class=&quot;math-container&quot;&gt;$p_i m_i$&lt;/span&gt;. What takes you back and forth between &lt;span class=&quot;math-container&quot;&gt;$P$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$Q$&lt;/span&gt; is the &lt;em&gt;stochastic discount factor&lt;/em&gt; &lt;span class=&quot;math-container&quot;&gt;$M$&lt;/span&gt; aka &lt;em&gt;state price deflator&lt;/em&gt; aka &lt;em&gt;state price density&lt;/em&gt; aka &lt;em&gt;pricing kernel&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;So what might &lt;span class=&quot;math-container&quot;&gt;$M$&lt;/span&gt; be? (economics interpretation)&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Describing &lt;span class=&quot;math-container&quot;&gt;$M$&lt;/span&gt; is the great goal of academic asset pricing. Success has been at best mixed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Economics often calls &lt;span class=&quot;math-container&quot;&gt;$M$&lt;/span&gt; a marginal rate of substitution process because in economic theory, if agents have additively separable utility over a consumption stream given by &lt;span class=&quot;math-container&quot;&gt;$U(C) = \sum_{t=0} \beta^t u(c_t)$&lt;/span&gt; then the SDF is a ratio of marginal utilities:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ m_{t+1} = \beta \frac{u'(c_{t+1})}{u'(c_t)}$$&lt;/span&gt;&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2018-09-26T15:26:37.030" LastActivityDate="2018-09-26T15:26:37.030" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="35344" PostTypeId="2" ParentId="35333" CreationDate="2017-07-28T19:35:18.833" Score="1" Body="&lt;p&gt;Without looking at the Airbus article, cash flow and income do not have to move together.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume AirBus is a very simple company, all they did was sell one plane which cost them 100 million to build and they sold it for 120 million.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With no other transactions, AirBus would have a Net Income of 20 million but its cash flow can be negative 100 because it has paid the full cost of the parts and labor but has yet to collect from the buyer. Additionally it could have just invested 100 million in a plant and none of that is expensed yet (rather capitalized on the balance sheet) so there would be another 100 million cash outflow for a negative total cash outflow of 200 million despite being profitable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PM if you need help, I do this for a living.&lt;/p&gt;&#xA;" OwnerUserId="28969" LastActivityDate="2017-07-28T19:35:18.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35345" PostTypeId="1" CreationDate="2017-07-28T19:42:29.420" Score="-2" ViewCount="386" Body="&lt;p&gt;I am trying to model the ending value of a stock after a certain number of years, I need it for a bigger project but I made this sample sheet to get help.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This sheet is assuming that annual returns are normally distributed and I am generating a return for each year from a normal distribution. However I feel this is somewhat flawed as even if we assume daily returns are normally distributed, annual returns will not be due to the effect of compounding. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How about I do exponential(normally generated annual return)? Help please!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://1drv.ms/x/s!AgTfphgT-fk83AdP5jq0AA5d97j6&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://1drv.ms/x/s!AgTfphgT-fk83AdP5jq0AA5d97j6&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="28969" LastActivityDate="2017-08-01T18:43:45.903" Title="Modeling stock performance in excel" Tags="&lt;monte-carlo&gt;&lt;normal-distribution&gt;&lt;excel&gt;&lt;vba&gt;" AnswerCount="2" CommentCount="12" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35347" PostTypeId="2" ParentId="35315" CreationDate="2017-07-28T19:48:06.250" Score="1" Body="&lt;p&gt;Most brokers have a paper account, try interactive brokers. I am not a bank trader, but I would imagine having the ability to sell options is all you need to play around for a bit? Unless I am missing something. &lt;/p&gt;&#xA;" OwnerUserId="28969" LastActivityDate="2017-07-28T19:48:06.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35348" PostTypeId="2" ParentId="35256" CreationDate="2017-07-28T19:53:07.693" Score="1" Body="&lt;p&gt;Having worked in a bank and often closely to senior managers, I have never heard anyone talking about a balance sheet target. Every dept has its revenue and cost targets....&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would be interesting to see what others have to say. &lt;/p&gt;&#xA;" OwnerUserId="28969" LastActivityDate="2017-07-28T19:53:07.693" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35350" PostTypeId="2" ParentId="35254" CreationDate="2017-07-28T20:47:32.410" Score="0" Body="&lt;p&gt;Try modifying it into a spread trade. (ie Long the nearby month, short a far month).  The margins are much smaller.  A W k8 vs W N8 spread has \$167 margin/ spread.  Outright wheat can be \$1000 /contract. &lt;/p&gt;&#xA;" OwnerUserId="28971" LastEditorUserId="848" LastEditDate="2017-07-29T12:15:48.530" LastActivityDate="2017-07-29T12:15:48.530" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35352" PostTypeId="1" AcceptedAnswerId="35392" CreationDate="2017-07-28T21:48:30.040" Score="2" ViewCount="221" Body="&lt;p&gt;I recently visited the trading floor of CBOE where especially the pits of SPX and VIX are relatively crowded and open outcry is still performed. I was surprised to hear that the traded volume is non negligible compared to the electronic trading which takes place in parallel. Apparently some customers still prefer to communicate their orders using trading pitches - often heard and read reasons are the ability to get better prices (especially for big orders) and the ability to split trades among many traders &lt;a href=&quot;http://www.chicagobusiness.com/article/20160804/NEWS01/160809925/cboe-is-converting-trading-floors-into-tech-workspaces&quot; rel=&quot;nofollow noreferrer&quot;&gt;see here, for instance&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I am wondering about three things:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Where does the ability to get better prices come from? If it is about established relationships or professional environment I do not see why appropriate trading platforms would provide equivalent means to replace open-outcry.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;How fast is the information gathered at the trading pitch communicated to electronic traders? Given, a broker signalizes her aim to sell/buy a large quantity of a certain option and her orders gets filled, how many seconds does it take until the information is processed? In a world where time-stamps of trading data are sometimes in measures of nano/micro seconds, I suppose that manually recording the trades takes an awful long period of time.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Especially with respect to question 2: i am wondering about the reliability of high-frequency data for academic (but also industrial) purposes if a substantial amount of trading (CBOE representative claimed that roughly 30 % of daily VIX and SPX volume is settled in the trading pitches) is not performed in an electronic fashion but instead rather anonymous if we consider the substantial lags. And may this even be the real reason why some customers still prefer to send employees to the trading pitches?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="16249" LastActivityDate="2017-07-31T15:38:15.010" Title="What makes open-outcry preferable to electronic trading and what are its consequences?" Tags="&lt;high-frequency&gt;&lt;market-microstructure&gt;&lt;exchange&gt;&lt;liquidity&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35353" PostTypeId="2" ParentId="35297" CreationDate="2017-07-29T06:03:43.157" Score="-1" Body="&lt;p&gt;This is upto you how you defined $\sigma(S(t), t)$. As @james42 has pointed out, if volatility is constant, ie $\sigma(S(t), t) = \sigma $, then you can compute $\sigma$ by taking standard deviation of daily log return $r_t$ defined  $r_t = ln(S_t / S_{t-1})$, where $ln$ is natural logarithm. If there are empirical evidences to suggest that volatility is not constant then you can use plethora of GARCH family models available in the literature. &lt;/p&gt;&#xA;" OwnerUserId="16991" LastActivityDate="2017-07-29T06:03:43.157" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35354" PostTypeId="1" AcceptedAnswerId="35357" CreationDate="2017-07-29T06:59:49.720" Score="0" ViewCount="528" Body="&lt;p&gt;I was reading about quantitative easing &lt;a href=&quot;http://www.investopedia.com/terms/q/quantitative-easing.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;, where the definition goes like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Quantitative easing is an unconventional monetary policy in which a central bank purchases government securities or other securities from the market in order to lower interest rates and increase the money supply.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can QE lower interest rates?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The central bank decides the interest rates for government bonds, right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So why would it need QE to lower interest rates? Can it not just cut them?&lt;/p&gt;&#xA;" OwnerUserId="28949" LastActivityDate="2017-07-30T23:59:18.333" Title="How can quantitative easing lower interest rates" Tags="&lt;interest-rates&gt;&lt;bond&gt;&lt;central-banking&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35356" PostTypeId="1" AcceptedAnswerId="35373" CreationDate="2017-07-29T08:05:59.790" Score="0" ViewCount="145" Body="&lt;p&gt;I was reading &lt;a href=&quot;http://www.investopedia.com/terms/q/quantitative-easing.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;this article&lt;/a&gt; on quantitative easing. At some point, this is mentioned, referring to QE:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;This strategy loses effectiveness when interest rates approach zero, at which point banks have to implement other strategies to kick start the economy.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why would QE lose effectiveness when interest rates approach 0?&lt;/p&gt;&#xA;" OwnerUserId="28949" LastActivityDate="2017-07-31T00:19:16.363" Title="Why wouldn't quantitative easing work if interest rates approach 0" Tags="&lt;interest-rates&gt;&lt;quantitative&gt;&lt;central-banking&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35357" PostTypeId="2" ParentId="35354" CreationDate="2017-07-29T08:09:35.240" Score="3" Body="&lt;p&gt;The central bank does not decide the rates for government bond, it can only influence the rates. The market decides the rates (unless the treasury wants to issue at a huge discount or premium) it needs to comply with the markets expected rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As CB buys government bonds, the number of freely floating bonds is reduced and due to the law of supply and demand their price will go up. When the price of a bond goes up its interest rate goes down (as you are earning a lower rate when you buy it since it has fixed cashflows).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even the fed funds rate is not a rate set by the fed, the fed only sets the target fed funds rate and it takes action to make it likely that banks will lend each other within this range. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;*I suggest you read up on the duties of the fed vs treasury, these duties vary from country to country. For example in my home country the central bank issues bonds. However that is not the case in the US, the treasury issues the bonds and they are assets on the balance sheet of the fed. The bonds are liabilities on the treasury balance sheet. You can also read about the fed wants to downsize its balance sheet now.&lt;/p&gt;&#xA;" OwnerUserId="28969" LastActivityDate="2017-07-29T08:09:35.240" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35358" PostTypeId="2" ParentId="35354" CreationDate="2017-07-29T08:13:32.647" Score="1" Body="&lt;p&gt;Using the US as an example, the Fed closely controls the Federal funds rate, which is an overnight rate (not the yield on Government bonds).   Usually therefore, the yield on government bonds is determined by supply and demand in the marketplace.  However when QE is occurring, the Fed becomes a source of demand for these bonds and hence influences their yield in a downward direction.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-07-29T08:13:32.647" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35359" PostTypeId="2" ParentId="35356" CreationDate="2017-07-29T08:14:30.850" Score="0" Body="&lt;p&gt;As rates approach zero then next thing is for rates to go negative which comes with its own shortfalls. For example central banks that are in the negative territory need to get out of that so that when the next crisis hits they have some playing room. There could be something I am missing let us wait and see. &lt;/p&gt;&#xA;" OwnerUserId="28969" LastActivityDate="2017-07-29T08:14:30.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35361" PostTypeId="2" ParentId="35356" CreationDate="2017-07-29T12:01:48.783" Score="2" Body="&lt;p&gt;I don't agree with the statement. It's precisely after short term interest rates approach zero that central banks turn to QE as an additional technique to boost the economy.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-07-29T12:01:48.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35363" PostTypeId="1" AcceptedAnswerId="35430" CreationDate="2017-07-29T13:09:15.040" Score="0" ViewCount="66" Body="&lt;p&gt;I has looking at &lt;a href=&quot;https://www.youtube.com/watch?v=Oz5hNemSdWc&quot; rel=&quot;nofollow noreferrer&quot;&gt;this video&lt;/a&gt; on how interest rates are set. When the process of borrowing from the FED to commercial banks is explained, another entity is described(around 00:40).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So when the FED lends to commercial&amp;amp;investment banks, is there some other player involved in the transactions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is this other player necessary?&lt;/p&gt;&#xA;" OwnerUserId="28949" LastActivityDate="2017-08-02T13:02:12.023" Title="Does the FED lend directly to commercial&amp;investment banks or is there an intermediary" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;central-banking&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35365" PostTypeId="1" AcceptedAnswerId="35366" CreationDate="2017-07-29T17:41:05.023" Score="0" ViewCount="74" Body="&lt;p&gt;In the US, the Fed determines the federal funds rate, which is used by banks to lend money to each other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the UK, I am assuming the Central Bank has the same role.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So why then is there a need for Libor?&#xA;Libor is aimed at asking the banks how much it would cost them to borrow from other banks. Why ask them, when these costs are already settled by the Central Bank?&lt;/p&gt;&#xA;" OwnerUserId="28949" LastActivityDate="2017-07-29T19:15:43.990" Title="Why is there a need for Libor in the UK" Tags="&lt;interest-rates&gt;&lt;debt&gt;&lt;central-banking&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35366" PostTypeId="2" ParentId="35365" CreationDate="2017-07-29T18:28:44.313" Score="2" Body="&lt;p&gt;Libor is a term rate (eg 3 month libor is the rate at which banks would lend to each other for 3 months). Fed funds (or Sonia in the UK) is an overnight rate.   That's the difference.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-07-29T18:28:44.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35367" PostTypeId="2" ParentId="35365" CreationDate="2017-07-29T19:15:43.990" Score="1" Body="&lt;p&gt;The reason banks are asked rather than the rate being observed is that transactions do not take place for all of those maturities, at least not with enough banks to make it accurate at any given time. So the best that can be done is ask them at what cost they can borrow and surely each has a bias to either overstate or understate depending on their market positions. Although in general you would not want to tell the market you think you can borrow at a high rate as that will cause the market to expect a higher rate from you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Libor is the underlying for trillions of derivatives contract and serves a very important function. Like a lot of things in finance such as MTP, we can criticize it a lot but it may be the best we have at the moment...&lt;/p&gt;&#xA;" OwnerUserId="28969" LastActivityDate="2017-07-29T19:15:43.990" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35369" PostTypeId="2" ParentId="35307" CreationDate="2017-07-30T01:23:47.100" Score="1" Body="&lt;p&gt;One thing to keep in mind is that the majority of bonds are issued close to par. In a rising yield environment, for a coupon-paying bond to be priced at par yet to offer a higher yield, the coupon has to be higher. Effectively, your borrowing cost is higher.&lt;/p&gt;&#xA;" OwnerUserId="28983" LastActivityDate="2017-07-30T01:23:47.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35370" PostTypeId="2" ParentId="35239" CreationDate="2017-07-30T01:38:31.487" Score="0" Body="&lt;p&gt;It is true that the unit of Macaulay Duration and Modified Duration is in years, if you look at the mathematical formula for them. However, it is a bad idea to interpret duration in general as a measurement for time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The best interpretation for duration is that it is actually a measure of a bond's sensitivity to yield changes. For example, the effective duration of an Interest-Only (IO) MBS Strip is negative. In fact, when interest rate rises, mortgage prepayment is slower and investors will receive more interest payment, so the price of an IO Strip will go up. In the case, it makes zero sense to interpret a negative number as a measurement for time.&lt;/p&gt;&#xA;" OwnerUserId="28983" LastActivityDate="2017-07-30T01:38:31.487" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35371" PostTypeId="2" ParentId="35291" CreationDate="2017-07-30T01:59:47.860" Score="1" Body="&lt;p&gt;For floating-rate bonds, it is difficult to compute z-spread if you don't know their cash flows. As a result, you would use discount margin where you have an assumption for the future cash flows of the floater.&lt;/p&gt;&#xA;" OwnerUserId="28983" LastEditorUserId="28983" LastEditDate="2019-03-14T19:07:20.983" LastActivityDate="2019-03-14T19:07:20.983" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="35372" PostTypeId="2" ParentId="35025" CreationDate="2017-07-30T02:34:04.797" Score="1" Body="&lt;p&gt;In fact, OAS reflects none of the factors mentioned in the question. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To begin with, the technical interpretation of OAS is that is it is the &lt;strong&gt;free money&lt;/strong&gt; you earn for holding an MBS, for the following reasons:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1). OAS has nothing to do with &lt;strong&gt;default&lt;/strong&gt;, as your cash flows are already default-adjusted by your credit model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2). Similarly, OAS has nothing to do with &lt;strong&gt;prepayment&lt;/strong&gt;, as your cash flows are already prepayment-adjusted by your prepayment model. (That's why OAS is called an option-adjusted-spread, because the spread does't contain any option cost in it.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see, OAS is adjusted for credit and prepayment. For an (non-agency) MBS, it is subject only to default risk and prepayment risk on top of a treasury, which means, OAS is a measure of the &lt;strong&gt;risk-free spread&lt;/strong&gt; for holding an MBS!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, you may ask, &lt;strong&gt;if OAS is risk-free spread, how come OAS is not 0 if the market is efficient&lt;/strong&gt;? There are a few reasons.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1). There is a &lt;strong&gt;liquidity&lt;/strong&gt; consideration for most mortgage bonds. So OAS is above zero to compensate for illiquidity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2). OAS is very &lt;strong&gt;model-dependent&lt;/strong&gt;. As you can see, the calculation for OAS depends on your credit model, prepayment model, and OAS model (which means interest model as well as home price model). For instance, if your credit model under-predicts losses, then your OAS may be way above 0. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;3). There is &lt;strong&gt;model risk&lt;/strong&gt;. An assumption in OAS model is that your cash flow projections are correct. However, as we have discussed, these projections are model dependent and no models are completely correct! Mortgage traders are aware of this risk of the models being wrong, so part of the positive OAS can be attributed to the reward for taking this model risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact, few practitioners interpret OAS as free money. Rather, they use it as a &lt;strong&gt;relative value&lt;/strong&gt; measure to compare mortgage bonds.&lt;/p&gt;&#xA;" OwnerUserId="28983" LastActivityDate="2017-07-30T02:34:04.797" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35373" PostTypeId="2" ParentId="35356" CreationDate="2017-07-30T06:42:00.493" Score="2" Body="&lt;p&gt;There are different schools of thoughts on this topic, but as @dm63 pointed out, interest rate approaching zero is not a reason for QE to lose effectiveness; it is in fact a reason for conducting QE in the first place.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My preferred narrative goes roughly as follows: In a depressionary environment, investors sell assets and move money into cash. This cuts off capital flows into risky assets and the capital market stops functioning normally. To reverse this vicious cycle, the first step is to lower short-term cash rates to make funding super cheap for those that need it and to make cash unattractive to investors holding cash. After cash return has reached zero, the next step is to conduct QE, starting with bond purchases. This lowers long-term interest rate, incentivizing investors to move money away from cash and back into risky assets (stocks, high yield, etc.). As money flows back into assets, the prices of these assets increase. Not only does this create a positive wealth effect and a virtuous cycle of risk taking, it also lowers funding costs for borrowers/issuers, allowing deleveraging to happen. But as the prices of bonds/stocks/etc. increase, their future expected returns decline. This is actually when QE loses effectiveness – when the expected returns of risky assets are very low relative to cash. When this happens, additional QE won't create as much wealth effect and can't induce investors to move into risky assets any more (if cash and stocks have the same expected return, you'd just hold cash).&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2017-07-30T06:49:10.397" LastActivityDate="2017-07-30T06:49:10.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35374" PostTypeId="2" ParentId="18730" CreationDate="2017-07-30T09:30:09.670" Score="0" Body="&lt;p&gt;All of the data is easily available from &lt;a href=&quot;https://simfin.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://simfin.com/&lt;/a&gt;. The site has now been updated and now standardized company statements for over 2000 US equities and financial ratios are available (as well as their historical development).&lt;/p&gt;&#xA;" OwnerUserId="22841" LastActivityDate="2017-07-30T09:30:09.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35376" PostTypeId="1" AcceptedAnswerId="35380" CreationDate="2017-07-30T11:22:47.503" Score="0" ViewCount="55" Body="&lt;p&gt;I was reading a few days ago that Deutsche Bank was planning to issue preferred stock in order to gather cash.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The company is struggling and because it has many illiquid assets some fear bankruptcy. So if holders of preferred stock get their money back before holders of common stock, wouldn't the share price of common stock reach rock bottom? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe the same thing happened with the New York Times a few years back, when they needed cash and so they issued preferred stock. Their share price didn't change much if memory serves.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Who would invest in a company knowing that it is close to bankruptcy and that they will get the money last?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How come when a company issues preferred stock when struggling, its share price doesn't approach 0?&lt;/p&gt;&#xA;" OwnerUserId="28949" LastActivityDate="2017-07-30T20:14:36.037" Title="If a struggling company issues preferred stock, won't its share price hit rock bottom" Tags="&lt;equities&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35377" PostTypeId="1" AcceptedAnswerId="35381" CreationDate="2017-07-30T16:23:33.793" Score="-1" ViewCount="237" Body="&lt;p&gt;I was reading &lt;a href=&quot;https://www.wsj.com/articles/as-washington-stalls-company-profits-keep-trucking-1501423201?mod=e2fb&quot; rel=&quot;nofollow noreferrer&quot;&gt;this article&lt;/a&gt; and I am puzzled by this phrase:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;A weaker dollar has made it easier to sell U.S.-made goods overseas and kept borrowing costs low.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can a weaker dollar keep borrowing costs low?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When US companies borrow cash, they usually borrow dollars, right? So what impact can the dollar have if it's high or low?&lt;/p&gt;&#xA;" OwnerUserId="28949" LastActivityDate="2017-07-30T23:34:47.850" Title="Why would a weaker dollar keep borrowing costs low" Tags="&lt;currency&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35379" PostTypeId="2" ParentId="35376" CreationDate="2017-07-30T19:03:18.363" Score="1" Body="&lt;p&gt;It's true that common shareholders will be subordinated to the new preferred shares, but if a company is close to defaulting on its debt, the infusion of cash from a preferred issue may be better for the common shareholders than going through a bankruptcy.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-07-30T19:03:18.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35380" PostTypeId="2" ParentId="35376" CreationDate="2017-07-30T20:08:08.557" Score="2" Body="&lt;p&gt;Prior planning for issuance of Preferred stock, something happens in every organization. &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Plan to restructure organization.&lt;/li&gt;&#xA;&lt;li&gt;List of assets, which could be sold off and what could be held. &lt;/li&gt;&#xA;&lt;li&gt;Employee restructuring. often happens :) &lt;/li&gt;&#xA;&lt;li&gt;Operations restructuring, if required. &lt;/li&gt;&#xA;&lt;li&gt;identification of additional investment needed areas, which could bring the needed revenue to organization like R&amp;amp;D or services or&#xA;advertising or new plants or new machinery.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The above listed activities give a rough picture on how much new money is needed, depending on that, The company goes for issuance of preferred stock. This new plan needs approval from analysts (depends on stock market).  The new plan along with the audited reports, is submitted to SEC for approval, so they could go for issuance of preferred stock.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;People/Organizations who buy these preferred stock would check the above list and invest ONLY if they believe its feasible. This info is also made available to the general share holders too. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Some of the above points might not be applicable in some markets, but generally, this is how it is done.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Issuance of preferred stock generally means, the board / CEO has done the required homework and identified areas which need changes. Now, they would be using new cash to implement these changes, which should add value to the retail investor too, so the price should go up. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have seen some companies default and go for restructuring intentionally, cuz their organizations are heavily troubled by Unions, which wont let them make significant changes when the company had cash in hand. So they let the company fail and then do a restructuring. Few Italian companies have done it i guess.  &lt;/p&gt;&#xA;" OwnerUserId="6799" LastEditorUserId="6799" LastEditDate="2017-07-30T20:14:36.037" LastActivityDate="2017-07-30T20:14:36.037" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35381" PostTypeId="2" ParentId="35377" CreationDate="2017-07-30T21:12:48.923" Score="1" Body="&lt;p&gt;Say, &#xA;Case 1: Strong dollar. 1 USD = 1 EURO&#xA;Case 2: Weakened dollar. 1.5 Dollar = 1 EURO&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If Microsoft sells licence for windows in Eu for say 10 Euros. In case 1, with strong dollar, Microsoft will earn 10 USD. In case 2, with weak dollar, Microsoft will make 15 USD. So profit for the company increases by depreciating the currency, but it has some adverse effects too. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If some company wants to lend, it has to lend more money, because dollar is weak now. so, banks will make interest on more money. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently the interest rates in US are around 1%. So, by weakening dollar, companies have to borrow more money and could earn more dollars in return (profits). Borrowing cheap and making more money/profits. Because dollar is weak. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If dollar is strong, they need to borrow less and make less profits. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is, there will be more outflow from banks which are currently sitting on huge pile of cash. As companies are lending more and taking risk, in case of defaults, guess what happens. If everything goes fine, money circulation improves, and this improves GDP too. So, more tax income to Government. &#xA;As more cash is circulating in markets, there will be more inflation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As currency weakens, people income wouldn't increase immediately. Most of retail employees are on minimum wages. guess what happens to them, who currently aren't able to make ends meet. with inflation and minimal or no wage increases. scary. &lt;/p&gt;&#xA;" OwnerUserId="6799" LastEditorUserId="6799" LastEditDate="2017-07-30T23:34:47.850" LastActivityDate="2017-07-30T23:34:47.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35382" PostTypeId="2" ParentId="35363" CreationDate="2017-07-30T23:48:52.453" Score="0" Body="&lt;p&gt;I don't think, fed lends money to anyone. Government issues bonds and Fed buys these bonds. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As fed buys paper bonds from government, fed pays them in freshly printed dollars. Now government has the required number of dollars and goes on spending spree. when the government needs more cash, they issue more bonds, which are bought by Fed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The case of bail outs are different. These are considered exception and under special privileges (If the failed company can bring down nations GDP by ~2% or more or if unemployment increases by 100K), then they bail out such huge corporations, which otherwise would cease to exist and impact the whole nation.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The numbers are for reference only. not sure of their internal considerations. &lt;/p&gt;&#xA;" OwnerUserId="6799" LastActivityDate="2017-07-30T23:48:52.453" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="35384" PostTypeId="2" ParentId="35354" CreationDate="2017-07-30T23:59:18.333" Score="1" Body="&lt;p&gt;&lt;em&gt;How can QE lower interest rates?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say, if a market has 1000 USD with only 10 citizens in it. Say, everyone is making 100 USD and spending the same. The bank will have 1000 USD as everyone pays using bank. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With QE, Fed will plug in say 200 more USD into this market. Now the total cash in market is 1200 USD with 10 players. Now, everyone can make slightly more than 100 USD. They can spend more too. The cash at bank is now 1200. So banks have more cash now, which could be lent at a lower rate. So interest rates go down. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is just an example. there are many other considerations too. QE causes deflation. in such a case, interest rates could fall further. If economy stays healthy, it increases inflation in long run, which has more adverse effects, because, this inflation isn't natural. its artificially created by Fed.  &lt;/p&gt;&#xA;" OwnerUserId="6799" LastActivityDate="2017-07-30T23:59:18.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35385" PostTypeId="2" ParentId="35256" CreationDate="2017-07-31T00:09:09.700" Score="0" Body="&lt;p&gt;Banks can lend money from other banks at FED rates or around. So, technically A bank can lend money from other bank and increase its Auto loans portfolio or mortgages portfolio. This technically increases banks balance sheet. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A risk averse bank can reduce exposure to say, Auto loans and could lend the same amount to other banks and make Fed interest rates on this lending. As this bank being not profit hungry, it just wants to protect its cash. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some banks want to lend more from other banks and increase their exposure to sub prime auto loans for more profits, where as few banks doesn't want to increase their risk. These risk averse banks lend to other banks and make minimal interest on their cash. &lt;/p&gt;&#xA;" OwnerUserId="6799" LastActivityDate="2017-07-31T00:09:09.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35386" PostTypeId="2" ParentId="35356" CreationDate="2017-07-31T00:19:16.363" Score="1" Body="&lt;p&gt;If i have a long term goal of say 10 mil and i contribute 10K everymonth. say, i need to contribute for 40 years, which would be 4.8 Mil My contribution + (Compounded) interest is 5.2 Mil. I reach my target and i am a happy man. (Some random interest rate :) )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With Zero interest rates, I need to contribute all 10 Mil from my pocket. i am not making any money on my money, so i better save more. &#xA;This is the perception of people, who have long term aspirations/plans/goals. When interest rates reach zero, they panic and they stop spending and start saving more. This reduces GDP, causes deflation and further worsens the situation leading to negative interest rates. &lt;/p&gt;&#xA;" OwnerUserId="6799" LastActivityDate="2017-07-31T00:19:16.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35389" PostTypeId="1" CreationDate="2017-07-31T03:14:54.243" Score="2" ViewCount="333" Body="&lt;p&gt;I'm trying to follow the replication argument in the first page of the following paper&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.math.columbia.edu/~fts/Collateralized%20trade%20pricing%20made%20simple%20v1a.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.math.columbia.edu/~fts/Collateralized%20trade%20pricing%20made%20simple%20v1a.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;One can however instead replicate directly with the holder of the zero&#xA;  coupon bond: Consider the collateralized zero coupon bond is valued as&#xA;  $V(t)$. As holder of the bond requires $V(t)$ as cash collateral, the issuer&#xA;  receives nothing net. Note the collateral grows at the rate of $c(t)$.&#xA;  Therefore, putting $e^{-c(T)}$ as collateral, one sees that at time&#xA;  $T$, holder of the bond will find the collateral account containing&#xA;  exist one unit of currency $i$ which is exactly the payoff of the&#xA;  bond.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I'm afraid I don't understand many things. The purchaser gives $V(t)$ to the issuer, and the issuer gives $V(t)$ to the purchaser as collateral. So neither the issuer nor purchaser receives anything net at the start of the contract. Finally, the collateral is paid from the holder of the bond from the issuer, so I don't see how the holder would stand to gain from the collateral rates - shouldn't it be the issuer instead?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Overall, if the risk-free rate was not the collateral interest rate, how could we create arbitrage? Could someone explain in more detail what is going on? &lt;/p&gt;&#xA;" OwnerUserId="28961" LastEditorUserId="20454" LastEditDate="2017-10-09T15:34:39.217" LastActivityDate="2017-10-09T15:34:39.217" Title="Collateral replication argument" Tags="&lt;replication&gt;&lt;theory&gt;&lt;collateral&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35390" PostTypeId="2" ParentId="35256" CreationDate="2017-07-31T05:29:28.770" Score="0" Body="&lt;p&gt;Although i've never worked in a bank, i think it is more likely for a bank to have a target structure of its balance sheet than a target balance sheet. what i mean is that banks would structure its balance sheet for NPA, risk assets according to Basel Norms and other regulatory details. some of this might also stem from what the banks promised share holders and other stake holders including the central bank.&lt;/p&gt;&#xA;" OwnerUserId="15428" LastActivityDate="2017-07-31T05:29:28.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35391" PostTypeId="2" ParentId="35389" CreationDate="2017-07-31T12:12:57.093" Score="3" Body="&lt;p&gt;Let me know whether this helps, but the author mentions a paper from Fujii and Takahashi; I have been looking for it on the internet and I have found what seems to be a version of it: &lt;a href=&quot;http://www.cirje.e.u-tokyo.ac.jp/research/dp/2010/2010cf743.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Collateral Posting and Choice of Collateral Currency&lt;/a&gt;. I think they give a relatively transparent explanation $-$ in terms of &lt;em&gt;funding costs&lt;/em&gt;  $-$ of why the discount rate for collateralized trades must be the collateral rate. I reproduce some excerpts here $-$ the author is referring to some derivative contract between two parties, A and B $-$ my emphasis:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;[Uncollateralized trade]&lt;/strong&gt;: &quot;&lt;em&gt;Let us consider the situation where the firm A has a positive present value (PV) in the contract with the firm B with high credit quality. From the view point of the firm A, it is equivalent to providing a loan to the counterparty B with the principal equal to its PV. &lt;strong&gt;Since the firm A has to wait for the payment from the firm B until the maturity of the contract, it is clear that A has to finance its loan and hence the funding cost should be reflected in the pricing of the contract. If the firm A has (and continues to be) Libor credit&#xA;  quality, the funding cost is given by the Libor of its funding currency&lt;/strong&gt; since it makes the present value of ”funding” zero. This is the main reason why Libor (London inter-bank offered rate) has been widely used as a proxy of the discounting rate in the derivative pricing.&lt;/em&gt;&quot;&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;[...]&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;&lt;strong&gt;[Collateralized trade]&lt;/strong&gt;: &quot;&lt;em&gt;The above situation drastically changes when the trade is collateralized&lt;/em&gt; [...]. &lt;em&gt;Let us assume that the trade has been made with a CSA (credit support annex, a legal document regulating credit support for derivative transactions), requiring cash collateral with zero minimum transfer amount as well as threshold. &lt;strong&gt;In this case, there is no external funding need for the firm A, since the cash amount equal to the PV is posted from the firm B. Now, the firm A has to pay the counterparty B the margin whose interest rate is called ”collateral rate” applied to the posted collateral amount.&lt;/strong&gt; This effectively makes the funding cost of the contract equal to the collateral rate.&lt;/em&gt;&quot; &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Note that it is the party &lt;em&gt;receiving&lt;/em&gt; the collateral that pays the collateral rate to the party &lt;em&gt;posting&lt;/em&gt; the collateral.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Edit 15/09/17]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am expanding on my previous answer, trying to address your questions.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;[...] &lt;em&gt;the collateral is paid from the holder of the bond&lt;/em&gt; [did you meant &lt;em&gt;to&lt;/em&gt; instead of &lt;em&gt;from&lt;/em&gt;?] &lt;em&gt;the issuer, so I don't see how the holder would stand to gain from the collateral rates - shouldn't it be the issuer instead?&lt;/em&gt;&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Note that $V(t) &amp;gt; 0$, hence it will always be the bond seller who will post collateral to the buyer $-$ as the bond has always positive value to the buyer. Hence the buyer holds at any time $t$ in $[0,T]$ a collateral amount equal to $V(t)$, for which he has to pay the (deterministic) collateral rate $c(t)$ to the seller. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The seller knows he has to deliver $1\$$ at time $T$ to the buyer, but he has to continuously post a collateral equal to the bond's value to the buyer, who will remunerate him continuously at rate $c(t)$. Hence if he values the zero-coupon bond at $0$ as $-$ we keep the author's assumption of deterministic rates:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ V(0) = e^{-\int_0^Tc(t)dt}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;He knows he will &quot;hold&quot; $1\$$ of collateral in the buyer's collateral account at $T$, because the latter is paying $c(t)$ for the collateral.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;&lt;em&gt;Overall, if the risk-free rate was not the collateral interest rate, how could we create arbitrage? Could someone explain in more detail what is going on?&lt;/em&gt;&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For simplicity we assume rates are constant, &lt;em&gt;i.e.&lt;/em&gt; $r$ and $c$ are the &quot;risk-free&quot; and collateral rates for borrowing/lending over period $[0,T]$. Now let us consider two cases:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;$r&amp;lt;c$&lt;/strong&gt;: if the seller prices the zero-coupon bond as&#xA;$$ V(0) = e^{-rT} $$&#xA;By the same replication argument as before, the seller needs to post $V(0)$ as collateral; the collateral will grow at rate $c$ hence at maturity the collateral account $C(T)$ will have the value:&#xA;$$ C(T) =e^{(c-r)T} &amp;gt; 1 $$&#xA;The seller can then recover $e^{(c-r)T}-1$ from the collateral account as riskless profit.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;$r&amp;gt;c$&lt;/strong&gt;: the previous strategy would yield a loss this time. In this case there isn't a clear strategy that would yield the seller a riskless profit without making the buyer pay a price $V(0)$ higher than the $1\$$ he is going to receive at $T$. He could always price:&#xA;$$ V(0) = e^{(r-c)T} $$&#xA;So that the collateral account will contain $e^{rT}&amp;gt;1$ at $T$, but the buyer is unlikely to enter that deal $-$ except in the case of negative rates maybe. The problem is that at $t=0$ the price $V(0)$ is immediately pledged as the collateral amount $C(0)$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Edit 2 15/09/17, modified on 09/10/17]$^{\text{ [1]}}$&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To show more formally that the collateral rate is the correct rate, let us consider a tradable asset $X(t)$ which follows a generic Ito process and does not pay any cash-flow (dividends, coupons, etc.):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dX(t) = \mu_X(t,X(t))dt+\sigma_X(t,X(t))dW(t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We also assume that the collateral rate $r_C(t)$ is stochastic. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can interpret the zero-coupon bond as a derivative written on the asset $X(t)$ with payoff function $h(T,X(T))=1\$$ at maturity $T$ (note there is no uncertainty as to what the final payoff will be). We will note its value at time $t$ as $V(t) = V(t,X(t))$. The asset $X(t)$ is merely instrumental and allows us to apply the &lt;a href=&quot;https://en.wikipedia.org/wiki/Feynman%E2%80%93Kac_formula&quot; rel=&quot;nofollow noreferrer&quot;&gt;Feynman-Kac Theorem&lt;/a&gt; in order to derive the correct discount rate $-$ see footnote $\text{[1]}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume a cash collateral amount $C(t)$ needs to be posted continuously to the bond holder such that $C(t)=V(t)$ (perfect collateralization) and that this amount is remunerated at the collateral rate. To replicate the bond, the seller forms a portfolio $\Pi(t)$ made up of the asset and the cash account $\beta(t)$: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ V(t) = \Pi(t) = \Delta_X(t)X(t)+\beta(t) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To be self-financing, the cash account needs to be made up of 1) the funding for the asset purchase $-$ opposite position to the asset's holding $-$ which we assume is done at a rate $r_X(t)$, and 2) the collateral amount which is equal to the derivative's value:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \beta(t) = C(t)-\Delta_X(t)X(t) = V(t)-\Delta_X(t)X(t)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because the portfolio is self-financing, we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dV(t) = d\Pi(t) = \Delta_X(t)dX(t)+d\beta(t) \tag{1} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the collateral is remunerated at rate $r_C(t)$ and the financing of the asset purchase is done at rate $r_X(t)$, the cash account growths according to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ d\beta(t) = r_C(t)V(t)dt - r_X(t)\Delta_X(t)X(t)dt $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, by Ito's lemma:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dV(t) = \frac{\partial V}{\partial t}dt + \frac{\partial V}{\partial X}dX(t)+\frac{1}{2}\frac{\partial^2 V}{\partial X^2}dX(t)^2 \tag{2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By the standard hedging arguments used in the Black-Scholes framework, we choose $\Delta_X(t)$ so as to eliminate risk $-$ &lt;em&gt;i.e.&lt;/em&gt; cancel random terms in $dX(t)$ $-$ in $\text{(1)}$ and $\text{(2)}$, and equating both:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{\partial V}{\partial t}dt + \frac{1}{2}\frac{\partial^2 V}{\partial X^2}dX(t)^2 = r_C(t)V(t)dt - r_X(t)\Delta_X(t)X(t)dt  $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the Black-Scholes equation with different collateral and asset financing rates and no &quot;risk-free&quot; rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the terminal condition of the bond $-$ $V(T)=h(T,X(T))=1$ $-$ we can apply the Feynman-Kac theorem and obtain:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ V(t) = E^Q\left[e^{-\int_t^Tr_C(u)du}|\mathcal{F}_t\right] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Q$ is a risk-neutral measure under which $X(t)$ growths at rate $r_X(t)$. You see that the collateral rate is the correct discount rate in this case: the bond buyer funds the position through the collateral rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\text{[1] }$&lt;em&gt;This proof has been modified from an earlier version in order to rigorously apply the Feynman-Kac theorem. In the opinion of the writer, if we do not define an auxiliary &lt;strong&gt;tradable&lt;/strong&gt; asset $X(t)$ and instead we make the bond price dependent on the collateral rate, then without (strongly) assuming either that 1) the rate $r_C(t)$ is traded in itself or 2) the 1st and 2nd derivatives of the bond price with respect to the collateral rate are null, it is not possible to derive a pricing PDE to which we can apply Feynman-Kac to find the price of the zero-coupon bond.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Edit 08/10/17]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;&lt;em&gt;Overall, if the risk-free rate was not the collateral interest rate, how could we create arbitrage? Could someone explain in more detail what is going on?&lt;/em&gt;&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For more information on arbitrage from different discount rates and collateral agreements, you can read &lt;em&gt;Risk&lt;/em&gt; magazine's article &lt;a href=&quot;https://www.google.co.uk/amp/docplayer.net/amp/15278401-Goldman-and-the-ois-gold-rush.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;Goldman and the OIS Gold Rush&quot;&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-10-09T14:37:03.847" LastActivityDate="2017-10-09T14:37:03.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35392" PostTypeId="2" ParentId="35352" CreationDate="2017-07-31T15:38:15.010" Score="5" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;The better price will come from two live traders (one on each side of the trade) willing to take a smaller percentage commission for a large block trade.  For example, if a trader's average commission per day is USD 2,000 and someone sends them a 100M block trade, they aren't going to insist on their standard commission rate.  Let's say they usually get a .5% commission (this is an absurdly large commission that I am just using for the sake of the example).  They aren't going to turn away a trade of that size if they don't receive their full 500,000 commission.  They will gladly take 50-100k and be very happy.  Reducing their commission, generally, involves taking a smaller spread on the execution which translates into a better price for the client.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Usually, the traders are in constant contact with people from their firm who are off the floor.  Either by phone or by hand signals.  While it may take a minute for the large order to hit the tape, the electronic market already 'knows' about it due to the communication between the floor trader and the 'upstairs' trading desk.  They are working together to fill their customer order and to manage the firm's exposure.  Exposure management will be handled electronically with e-mini contracts or SPY, so the large floor trade is already being felt in electronic marketplaces.  **These large trades don't always need hedging help from a firm's delta-one desk, so the last sentence will not apply to every trade.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Aside from anonymity, you don't have to worry as much about getting front run by a high-frequency firm because the two live traders are handling it personally and it is in their best interest to not divulge too much information because their commission and relationship with the large order customer is also on the line.  This is why you may see large block prints on the tape that appear to come out of nowhere but don't seem to have a large impact on anything.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The main consequence is that a live trader requires a much higher commission to execute then executing electronically.  For this reason, they are mostly just executing large orders or for people who value anonymity enough to pay the higher execution price (though they aren't truly anonymous).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even when the trading floor ceases to exist these type of 'high-touch' executions will still be around; they just won't be two trader's in a pit communicating with each other.  Instead, the trader receiving the order will email or call several of their trader friends and see if they can find a middle ground and get the order executed.&lt;/p&gt;&#xA;" OwnerUserId="26556" LastActivityDate="2017-07-31T15:38:15.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35393" PostTypeId="1" CreationDate="2017-07-31T15:45:06.050" Score="0" ViewCount="62" Body="&lt;h1&gt;Short Version&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Can I get a quantile of such an expression?&#xA;\begin{equation}&#xA;\sum_{k=1}^{n} A_k\exp(\mathcal{N}(t_k\mu-\sigma\sqrt{t_k}/2,\sigma)))&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know I can do it for one part of the summation as stated &lt;a href=&quot;https://quant.stackexchange.com/questions/35316/quantile-normal-and-lognormal&quot;&gt;here&lt;/a&gt;, however I would like to know if that can be also the case for the summation.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Long Version&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Let's say I have a periodic investment, in a really simplified case, we have the user deposits $A_1$, $A_2$ and $A_3$ as in the following image.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/zgaWr.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/zgaWr.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The deposits $A_1$, $A_2$ and $A_3$ happen at $t_1$, $t_2$ and $t_3$ respectively, being the period of time between each transaction $t$. The return of the period of time $t$ is $\mu$ and the volatility is $\sigma$.I want to know how much I have at time $t_3$ with a probability of $90\%$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My variables are normally random distributed. This means that for example in order to project $A_1$ to the times $t_1$, $t_2$ and $t_3$ we will have the following equations:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;X_{A_1,t_1}\sim A_1\exp(\mathcal{N}(0t\mu-\sigma\sqrt{0t}/2,0\sigma))=A_1\\&#xA;X_{A_1,t_2}\sim A_1\exp(\mathcal{N}(t\mu-\sigma\sqrt{1t}/2,\sigma\sqrt{t}))\\&#xA;X_{A_1,t_3}\sim A_1\exp(\mathcal{N}(2t\mu-\sigma\sqrt{2t}/2,\sigma\sqrt{2t}))&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the first equation you have exactly the same money because your deposit was it $t_1$, the same time that we analyze. Now, we know that we can calculate a quantile for a normal distribution is $\Phi^{-1}_P=\mu+\sqrt{2}\sigma \operatorname {erf} ^{-1}(2P-1)$ where $P \in [0,1]$, in our case $.9$ because we want to verify $90\%$ and $\operatorname {erf}$ is the &lt;a href=&quot;https://en.wikipedia.org/wiki/Error_function&quot; rel=&quot;nofollow noreferrer&quot;&gt;error function&lt;/a&gt;. Thus, we can calculate the quantile of $A_1$ in $t_3$ as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\Phi^{-1}_{A_1,t_3|P}= A_1\exp(2t\mu-\sigma\sqrt{2t}/2+\sqrt{2}\sigma\sqrt{2t} \operatorname {erf} ^{-1}(2P-1))&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some reference to this equation &lt;a href=&quot;https://quant.stackexchange.com/questions/35316/quantile-normal-and-lognormal&quot;&gt;here&lt;/a&gt;. My question is, can I sum all the values of the quantiles to $t_3$? or, how can I obtain the values of the quantiles at $t_3$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried the following equation: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\Phi^{-1}_{t_3|P}=\Phi^{-1}_{A_1,t_3|P}+\Phi^{-1}_{A_2,t_3|P}+\Phi^{-1}_{A_3,t_3|P}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As shown before, the last term of the quation is just $A_3$ but the others depend on the time and the quantile. This equation is not right, I have some dissimilarities with a montecarlo simulation I did to verify the results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm almost certain I must not sum quantiles the way I did, but I cannot find the proper resource to verify the equations.&lt;/p&gt;&#xA;" OwnerUserId="24610" LastEditorUserId="24610" LastEditDate="2017-08-01T07:58:13.600" LastActivityDate="2017-08-02T14:50:43.427" Title="Quantile with periodic investing" Tags="&lt;monte-carlo&gt;&lt;probability&gt;&lt;distribution&gt;&lt;normal-distribution&gt;&lt;lognormal&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35394" PostTypeId="2" ParentId="35345" CreationDate="2017-07-31T16:08:27.093" Score="2" Body="&lt;p&gt;The problem is you are trying to model it with a normal distribution.  Prices are data.  Returns are not data.  Returns are mathematical transformations of raw data.  It is mathematically impossible for returns to be normally distributed unless losses are anticipated in every period.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Returns can be constructed in four ways.  You can either use: $$\frac{p_{t+1}}{p_t}-1,$$ $$\log(p_{t+1})-\log(p_t),$$ $$p_{t+1}=Rp_t+\varepsilon_{t+1},$$ or $$p_{t+1}=p_t\exp{(r\Delta{t}+\epsilon_{t+1})}.$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Each possible choice has a different statistical distribution, however, it was proven by Mann and Wald in 1943 that R is normal in the third equation if $|R|&amp;lt;1$.  White in 1958 proved it was a Cauchy distribution if it is greater than one.  Of course, since people want to make a profit, it must be greater than one.  This also means that there is no non-Bayesian solution possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The actual argument is very long and detailed, but the short-form argument would be that no sufficient statistic exists for any of the four equations.  Because of this, no projective method will be admissible unless it is a Bayesian method because it will lose information from the data.  That isn't quite rigorous, but the answer works out that way for all four cases in the end.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $p_t$ can be viewed as $p_t^*+\varepsilon_t,\forall{t}$, then a ratio of prices is the ratio of two random variates.  Under Markowitz's assumptions, this should be a Cauchy distribution.  That isn't quite realistic, but if you remove firms going into bankruptcy or merger, it will be close if you truncate it to prohibit returns less than 100%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It will be insanely challenging to do this via Excel.  What you will need to do is a Markov Chain Monte Carlo algorithm to perform the calculations.  There is a proof that no analytic solution can exist.  You cannot create &quot;point estimators&quot; that will be useable to solve your problem.  Proof of this is by Koopman in 1936.  It would form the basis of the Pitman-Koopman-Darmois theorem.  If it is possible to do in Excel, then you will need to use Visual Basic. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would recommend Python or C.  There are issues in computational algebra that I am not sure Excel could do.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you remove mergers and bankruptcies, then your Bayesian likelihood function is close to $$\left[\frac{\pi}{2}+\tan^{-1}\left(\frac{R}{\Gamma}\right)\right]^{-1}\frac{\Gamma}{\Gamma^2+(r_t-R)^2}.$$  This likelihood does not account for the intertemporal budget constraint, but is close enough for most purposes.  To adjust for the intertemporal budget constraint you will likely need to use survival functions, either the logistic curve or the arctangent will work, though each have a different interpretation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will need to construct the Bayesian posterior predictive distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For an extended discussion on this you can read my papers on the topic at &lt;a href=&quot;https://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=1541471&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://papers.ssrn.com/sol3/cf_dev/AbsByAuth.cfm?per_id=1541471&lt;/a&gt;.  Some of the papers have been submitted for publication.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bibliography:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;B. O. Koopman, On distributions admitting a sufficient statistic,&quot; vol. 39, pp. 399-409, May 1936.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;J. H. Curtiss, On the distribution of the quotient of two chance variables,&quot; Annals of Mathematical Statistics, vol. 12, p. 409, 1941.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;H. Mann and A. Wald, On the statistical treatment of linear stochastic difference equations,&quot; Econometrica, vol. 11, pp. 173-200, 1943.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;J. S. White, The limiting distribution of the serial correlation coefficient in the explosive case,&quot; The Annals of Mathematical Statistics, vol. 29, pp. 1188-1197, Dec 1958.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would also recommend reading &lt;/p&gt;&#xA;&#xA;&lt;p&gt;E. T. Jaynes, Probability Theory: The Language of Science. Cambridge: Cambridge University Press, 2003.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason I said that it would be very challenging to do in Excel has to do with limitations of the product.  While Excel is wonderful for what it was designed to do, it has design limitations that should impact its use here.  There is a field called &quot;compuational algebra.&quot;  All computational software has built in limits.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Excel's will likely be binding.  Computational algebra answers questions such as how to solve $1/3\times{3}$.  In computational terms this is not equivalent to $3\times{1}/3$.  $1/3$ is .3 repeating.  Times 3 it is .9 repeating.  $3\times{1}$ is 3, divided by 3 is 1 and not .9 repeating.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Visual Basic in Excel isn't designed for this.  It is probable that using Visual Basic would cause the programmer to spend a lot of time firefighting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&#xA;The only necessary mathematical assumptions to arrive at the likelihood is that there are many potential buyers and many potential sellers and that stocks are sold in a double auction.  There is an additional constraint imposed for the limitation of liability.  Nothing in that is controversial.  The solution meets de Finetti's requirement of exchangeability.  As a result, path dependence or path independence is an irrelevant question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&#xA;For the log-log model, you cannot assume normality because it is not the correct likelihood function.  It is what is done, but it is also not correct.  Again, read above papers.  If you have removed mergers and bankruptcies, then the likelihood function is $$\frac{1}{2\gamma}\text{sech}\left[\frac{\pi}{2}\left(\frac{\log(p_{t+1})-\log(p_t)-R}{\gamma}\right)\right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You do not want to multilply the variance by 250 and take the square root.  It is not clear in this likelihood function that there is sufficient independence for that to be valid.  Instead, make $p_{t+1}$ one year, or two years or whatever into the future.  If there is no trade on the exact date, such as would be the case if it ended on a weeekend or holiday, adjust the return for the slight difference in dates.  For example, if it were 363 days later, then in logs multiply it by 365 and divide by 363.  That would be close.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use a Frequentist method with logs, then you will overestimate annual returns by two percent and underestimate the standard deviation by four percent.  There is a theoretical flaw in using the standard Frequentist solution.  I know this because I compared these for all end of day trades from 1925-2013 in the CRSP universe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have no experience with Bayesian methods, then you should read William Bolstad's book &quot;Introduction to Bayesian Statistics, 3rd Edition.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am sorry that you are being caught up in the transition from a math that was problematic to the correct math, but that is what is about to happen to lots of people.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastEditorUserId="25459" LastEditDate="2017-08-01T01:39:36.617" LastActivityDate="2017-08-01T01:39:36.617" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="35395" PostTypeId="1" CreationDate="2017-07-31T19:42:58.410" Score="8" ViewCount="538" Body="&lt;p&gt;The CME-traded Eurodollar futures option is an American option. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the industry standard pricing model for this product? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does the industry practice to treat CME-traded Eurodollar futures option as European and use Black-Scholes model to price it (due to daily margin)?&lt;/p&gt;&#xA;" OwnerUserId="29005" LastEditorUserId="20795" LastEditDate="2019-09-08T11:15:02.443" LastActivityDate="2020-07-20T01:13:37.973" Title="What is the industry standard pricing model for CME-traded Eurodollar future (American) options?" Tags="&lt;options&gt;&lt;pricing&gt;&lt;american-options&gt;&lt;eurodollars&gt;&lt;cme&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="35396" PostTypeId="2" ParentId="35341" CreationDate="2017-07-31T19:44:42.870" Score="1" Body="&lt;p&gt;Answer to question 2:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the famous Merton's theorem. It says that returns from the stock mimics the fundamentals of the company, in other words, the credit risk of the company. We use it for modelling the market risk of a stock. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. The translation Matrixx provides the probability of a company's debt to more from  one state to other, say Aaa to B is 5%. Now, the theorem assumes that this probability of downgradation of debt also reflects in the returns of the stock. If one assumes that the returns are normally distributed, then the returns have to fall by (mean -1.645 *std dev) for the debt rating to move to B.&lt;/p&gt;&#xA;" OwnerUserId="27273" LastActivityDate="2017-07-31T19:44:42.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35398" PostTypeId="2" ParentId="1209" CreationDate="2017-08-01T00:05:37.633" Score="0" Body="&lt;p&gt;I went through the exercise of acquiring constituent data for indices as well as exchange constituents recently. After discussing the issue with both S&amp;amp;P Global and the FTSE Russel team the reply of both providers was that this data is not distributed in a free format (we were discussing this to include data on www.simfin.com). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I don't currently have access to Bloomberg or Factset, I can not help you with professional tools, but I have made a list of sources for constituent data (freely available however not all up-to-date).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here the list of free sources that I found:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dow 30 - &lt;a href=&quot;https://primeaim.wordpress.com/2014/09/24/central-index-keys-cik-for-dow-30-and-sp-500/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://primeaim.wordpress.com/2014/09/24/central-index-keys-cik-for-dow-30-and-sp-500/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;S&amp;amp;P 500 - &lt;a href=&quot;https://primeaim.wordpress.com/2014/09/24/central-index-keys-cik-for-dow-30-and-sp-500/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://primeaim.wordpress.com/2014/09/24/central-index-keys-cik-for-dow-30-and-sp-500/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Russell 2000 (scroll down to download CSV with constituents) - &lt;a href=&quot;https://www.ishares.com/us/products/239710/ishares-russell-2000-etf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.ishares.com/us/products/239710/ishares-russell-2000-etf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NASDAQ - &lt;a href=&quot;http://rankandfiled.com/#/data/tickers&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://rankandfiled.com/#/data/tickers&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NYSE - &lt;a href=&quot;https://dan.vonkohorn.com/blog/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://dan.vonkohorn.com/blog/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wilshire 5000 - &lt;a href=&quot;http://financemainpage.com/Listing_of_All_Wilshire_5000_Stocks.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://financemainpage.com/Listing_of_All_Wilshire_5000_Stocks.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="22841" LastActivityDate="2017-08-01T00:05:37.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35399" PostTypeId="1" CreationDate="2017-08-01T06:19:35.577" Score="1" ViewCount="70" Body="&lt;p&gt;From a quantitative point of view which information is significant, what can be ignored?&lt;/p&gt;&#xA;" OwnerUserId="15046" LastEditorUserId="15046" LastEditDate="2017-08-01T06:24:49.690" LastActivityDate="2017-09-20T05:50:31.680" Title="What information is significant in a company's 10Q?" Tags="&lt;equities&gt;&lt;data&gt;&lt;fundamentals&gt;&lt;sec&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35402" PostTypeId="1" CreationDate="2017-08-01T08:11:59.707" Score="2" ViewCount="217" Body="&lt;p&gt;I've finished a university course in statistical machine learning that covered topics such as regression, classification, neural networks, SVM, PCA etc.  The class was quite tough and rigorous (we had Bishop as a textbook) and we implemented the algorithms, but I'd like to solidify my knowledge by actually going out and applying the techniques to more real world material, preferably in Python.  The goal of this is to have something to show employers aside from just a class.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have no illusions of spending a month working and being able to beat currency markets or whatever, but while I'm doing this, I'd like to test it on markets that aren't flooded with professionals and see what happens.  I'm looking for resources/guides to get started - I'm not sure if I need data scrapers, need to set up a database etc.  Basically just good resources to applying the stats I've learnt and possibly a primer on the finance I need to know.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Totally open to different directions I should go in.  Apologies if this is a duplicate, I did try searching but mostly saw people hoping for a 'magic bullet' to crush markets.  I'd be super happy with (optimistic I know) setting up some sort of auto trader for crypto markets even if it lost a bit, just for the experience.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit: I should also add that I've done 5 computer science classes so am comfortable with programming in general, and have done a bit of stochastics through our stats department&lt;/p&gt;&#xA;" OwnerUserId="29010" LastEditorUserId="29010" LastEditDate="2017-08-01T10:45:24.360" LastActivityDate="2017-08-02T07:53:05.880" Title="Applying my Machine Learning class (possibly to small markets)" Tags="&lt;quant-trading-strategies&gt;&lt;statistical-finance&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ClosedDate="2017-08-02T07:18:23.360" ContentLicense="CC BY-SA 3.0" />
  <row Id="35403" PostTypeId="1" AcceptedAnswerId="35453" CreationDate="2017-08-01T08:24:55.577" Score="1" ViewCount="2078" Body="&lt;p&gt;I am having problems retrieving 14 days historical data from IB. &#xA;I recently made the switch from MATLAB to Python so I have a lot of catching up to do.&#xA;Where do I go wrong? All help is appreciated. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import sys&#xA;&#xA;import pandas as pd&#xA;&#xA;from time import sleep, strftime&#xA;&#xA;from ib.ext.Contract import Contract&#xA;&#xA;&#xA;&#xA;#Make connection&#xA;conn = Connection.create(port=7496, clientId=999)&#xA;conn.connect()&#xA;&#xA;def var2(msg):&#xA;    print(msg)&#xA;&#xA;conn.register(var2, message.historicalData)&#xA;def var3(msg):&#xA;    print(msg)&#xA;&#xA;&#xA;if __name__ == '__main__':&#xA;    #conn = ibConnection()&#xA;    conn.register(var2, 'UpdateAccountValue')&#xA;    conn.register(var3, message.tickSize, message.tickPrice)&#xA;    conn.connect()&#xA;&#xA;    def inner():&#xA;&#xA;        qqqq = Contract()&#xA;        qqqq.m_secType = &quot;STK&quot; &#xA;        qqqq.m_symbol = &quot;ABN&quot;&#xA;        qqqq.m_currency = &quot;EUR&quot;&#xA;        qqqq.m_exchange = &quot;AEB&quot;&#xA;        endtime = strftime('%Y%m%d %H:%M:%S')&#xA;        conn.reqHistoricalData(1,qqqq,endtime,&quot;14 D&quot;,&quot;1 min&quot;,&quot;BID&quot;,1,1)&#xA;        data = reqHistoricalData&#xA;&#xA;&#xA;conn.disconnect()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="28975" LastActivityDate="2017-08-04T02:35:37.953" Title="Problems retrieving historical data through IbPy" Tags="&lt;data&gt;&lt;python&gt;&lt;interactive-brokers&gt;&lt;historical&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="35404" PostTypeId="1" CreationDate="2017-08-01T09:27:20.220" Score="1" ViewCount="2588" Body="&lt;p&gt;I am trying to calculate the Mark-to-Market of a CDS, and I want to know if what I did is correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let a CDS of maturity $T$, we suppose that the recovery $RR$, the discount rate $r$, and the hazard rate $\lambda &amp;gt; 0$ are constant. The default time $\tau$ is defined such that $\mathbb{P}(\tau &amp;gt; t)$ $=$ $e^{-\lambda t}$. Let $0 = T_0 &amp;lt; ... &amp;lt; T_N = T$ the contractual payment dates. We ignore the payment accrued.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm going to calculate the fair spread $s$*, this is the spread such that $PVPremiumLeg = PVProtectionLeg$.&#xA;We can write the present value of the premium leg of an existing CDS contract as :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$PVPremiumLeg = s\sum_{i=0}^{N-1} (T_{i+1} - T_i) \mathbb{E}[e^{-rT_i}1_{\tau &amp;gt; T_{i+1}}] =  s\sum_{i=0}^{N-1} (T_{i+1} - T_i)e^{-(r+\lambda)T_{i+1}}$. We also suppose that the premium payments are continuous. So : &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$PVPremiumLeg \simeq s\int_{0}^{T} e^{-(r+\lambda)u} du = s \frac{1-e^{-(r+\lambda)T}}{r+\lambda}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we suppose that the protection leg is payed at the defaut time $\tau$, we have, $PVProtectionLeg = (1-RR)\mathbb{E}[e^{-r\tau}1_{\tau \le T}] = (1-RR)\int_{0}^{T} \lambda e^{-(r+\lambda)u} du = (1-RR) \frac{\lambda}{\lambda +r}(1-e^{-(\lambda + r)T})$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We deduce that the fair spread $s$* is $s$* $= (1-RR)\lambda$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we want to compute the Mark-to-Market (protection buyer point of view) of this CDS, at a time $0 &amp;lt; t \le T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have $MtM(t) = PVProtection(t) - PVPremiumLeg(t)$. But at this time $t$, we know that the market spread (the spread quoted in the market) $s_t$ is the spread which makes the Mark-to-Market of a new CDS (of maturity $T$) starting at time $t$ equal to $0$, i.e $PVProtectionLeg(t) - s_t\frac{1-e^{-(r+\lambda)T}}{r+\lambda} = 0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So $PVProtectionLeg(t) = s_t\frac{1-e^{-(r+\lambda)T}}{r+\lambda}$. And then we conclude that :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$MtM(t) = (s_t - s_0)\frac{1-e^{-(r+\lambda)T}}{r+\lambda}$ with $s_0$ the contractual spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to implement this MtM function in $R$.&#xA;My question is how do you calibrate the $\lambda$ ? Do we still have $\lambda = \frac{s_0}{1-RR}$, or do we calibrate it at each time $t$, i.e $\lambda_t = \frac{s_t}{1-RR}$ ? Thank your for you answer and sorry for my poor english.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Adam.&lt;/p&gt;&#xA;" OwnerUserId="29014" LastActivityDate="2017-08-02T22:04:11.707" Title="CDS Mark-to-Market" Tags="&lt;cds&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35406" PostTypeId="1" CreationDate="2017-08-01T12:00:05.663" Score="1" ViewCount="59" Body="&lt;p&gt;So I've been using ensemble methods to model stock price movement, using intraday per-minute data in the OHLCV format, with the prediction being a 1 if the future close goes up, and 0 if it goes down. There are rows within the data that have the same closing price, and due to my somewhat limited understanding of how to interpret intraday data, I do not know if this is a normal occurrence.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I factor in that the stock price may not move at all, then this becomes a multiclass classification problem, as I then have 3 outcomes to consider. This obviously entails a more involved process in producing error metrics, so I wanted to know if I am mistaken in thinking this is a multiclass problem. Thanks&lt;/p&gt;&#xA;" OwnerUserId="28367" LastActivityDate="2017-08-01T12:00:05.663" Title="Binary or Multiclass Classification?" Tags="&lt;modeling&gt;&lt;python&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35407" PostTypeId="1" CreationDate="2017-08-01T12:41:30.940" Score="0" ViewCount="13851" Body="&lt;p&gt;Can somebody explain what is difference between 144A bond offering vs Regulation S offering vs Registered Bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also can 144A bond offering be done by US issuer ?&lt;/p&gt;&#xA;" OwnerUserId="28697" LastActivityDate="2017-08-07T14:39:04.703" Title="144A vs Regulation S vs Registered bonds" Tags="&lt;bond&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35408" PostTypeId="2" ParentId="1209" CreationDate="2017-08-01T13:37:14.520" Score="0" Body="&lt;p&gt;Using the terminal alone:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;lt;INDEX&amp;gt; Index MEMB &amp;lt;GO&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;e.g.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;CAC Index MEMB &amp;lt;GO&amp;gt;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;All constituents will show up with their weight and the last price.  You can then use &lt;code&gt;Output -&amp;gt; Excel&lt;/code&gt; to export them.  Also you could add custom fields in case, for instance, you want yesterday's closing price (&lt;code&gt;PX_YEST_CLOSE&lt;/code&gt;) instead of &lt;code&gt;LAST_PX&lt;/code&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1040" LastActivityDate="2017-08-01T13:37:14.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35409" PostTypeId="2" ParentId="35407" CreationDate="2017-08-01T13:58:19.143" Score="2" Body="&lt;p&gt;144A vs Reg S&lt;a href=&quot;https://www.ppm.net/common-question-rule-144a-vs-reg-s/&quot; rel=&quot;nofollow noreferrer&quot;&gt;1&lt;/a&gt;&#xA;Registered bonds - well, registered with the SEC.  144A and Reg S are exemptions from registration.  Read the link for a decent discussion of 144A vs Reg S. In essence though, 144A permits issuers to sell unregistered bonds IN THE US to &quot;qualified institutional buyers&quot; aka &quot;QIBs&quot; (entities that have a high net worth and can demonstrate that they are or should be viewed as knowledgeable enough to protect themselves and don't need the &quot;protection&quot; of SEC registration to assess the securities. Reg S is a mechanism for a US issuers to issue securities outside of the US and thus also not register the securities with the SEC. As they are not being sold to US entities SEC protection is viewed as not being necessary. &lt;/p&gt;&#xA;" OwnerUserId="12142" LastActivityDate="2017-08-01T13:58:19.143" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35410" PostTypeId="2" ParentId="3778" CreationDate="2017-08-01T14:00:50.120" Score="0" Body="&lt;p&gt;For US equities and futures check out Lime Brokerage (disclosure - I used to work there).  Bloomberg and similar systems ARE NOT realistic solutions for an automated trader that care at all about latency.  &lt;/p&gt;&#xA;" OwnerUserId="12142" LastActivityDate="2017-08-01T14:00:50.120" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35411" PostTypeId="2" ParentId="35402" CreationDate="2017-08-01T15:04:45.813" Score="2" Body="&lt;p&gt;Try to find online forecasting challenges on sites like kaggle.com They would often provide you with the data, so you don't need to worry about it. Here's a good example (finished): &lt;a href=&quot;https://www.kaggle.com/c/two-sigma-financial-modeling#description&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.kaggle.com/c/two-sigma-financial-modeling#description&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2017-08-01T15:04:45.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35412" PostTypeId="1" AcceptedAnswerId="35413" CreationDate="2017-08-01T15:15:27.817" Score="6" ViewCount="417" Body="&lt;p&gt;In financial markets, anomalies refer to situations when a security or group of securities performs contrary to the notion of efficient markets, where security prices are said to reflect all available information at any point in time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is some evidence however that specific anomalies may decay in repeated&#xA;experimental markets. Two studies showing this result include: Shogren et al (2001) who report erosion of the gap between willingness to pay (WTP) and willingness to accept (WTA) when values of goods are elicited in repeated auctions; and Cox and Grether (1996) who report decay of preference reversal when lottery values are elicited in repeated auctions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are other explanations of why an anomaly would disappear? How would this technically work?&lt;/p&gt;&#xA;" OwnerUserId="13334" LastActivityDate="2017-08-08T03:09:53.070" Title="Why do anomalies disappear after they get detected?" Tags="&lt;quant-trading-strategies&gt;&lt;modern-portfolio-theory&gt;&lt;anomalies&gt;&lt;market-efficiency&gt;" AnswerCount="4" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35413" PostTypeId="2" ParentId="35412" CreationDate="2017-08-01T15:25:54.010" Score="8" Body="&lt;p&gt;The best explanation I have seen so far is the so-called &lt;a href=&quot;https://en.wikipedia.org/wiki/Adaptive_market_hypothesis&quot; rel=&quot;noreferrer&quot;&gt;Adaptive Market Hypothesis&lt;/a&gt; by Andrew Lo: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The adaptive market hypothesis, as proposed by Andrew Lo, is an&#xA;  attempt to reconcile economic theories based on the efficient market&#xA;  hypothesis (which implies that markets are efficient) with behavioral&#xA;  economics, by applying the principles of evolution to financial&#xA;  interactions: competition, adaptation and natural selection.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It has several implications, esp. 2. and 5. answer your question:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ol&gt;&#xA;  &lt;li&gt;To the extent that a relation between risk and reward exists, it is unlikely to be stable over time. &lt;/li&gt;&#xA;  &lt;li&gt;There are opportunities for arbitrage. &lt;/li&gt;&#xA;  &lt;li&gt;Investment strategies—including quantitatively, fundamentally and technically based methods—will perform well in certain environments&#xA;  and poorly in others.&lt;/li&gt;&#xA;  &lt;li&gt;The primary objective is survival; profit and utility maximization are secondary.&lt;/li&gt;&#xA;  &lt;li&gt;The key to survival is innovation: as the risk/reward relation varies, the better way of achieving a consistent level of expected&#xA;  returns is to adapt to changing market conditions.&lt;/li&gt;&#xA;  &lt;/ol&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="12" LastActivityDate="2017-08-01T15:25:54.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35414" PostTypeId="2" ParentId="35402" CreationDate="2017-08-01T15:58:00.530" Score="1" Body="&lt;p&gt;I would do the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Use a free autotrading platform (Interactive Brokers API, metatrader etc)&lt;/li&gt;&#xA;&lt;li&gt;Get data from Quandl&lt;/li&gt;&#xA;&lt;li&gt;Upload any trading algorithm to github.&lt;/li&gt;&#xA;&lt;li&gt;Create a blog and write about the algorithm you have come up with.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;These will give you something to show to potential employers.&lt;/p&gt;&#xA;" OwnerUserId="22383" LastEditorUserId="22383" LastEditDate="2017-08-02T07:53:05.880" LastActivityDate="2017-08-02T07:53:05.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35415" PostTypeId="2" ParentId="35345" CreationDate="2017-08-01T17:58:17.120" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Hi All, I have been reading for days trying to get to the bottom of this question, however I don’t have a solid enough math background to reach the answer. I want to simulate the performance of an asset and I am assuming it is normally distributed and it will behave in a similar manner in the future. 1-) Take the daily changes in an assets price 2-) Apply natural log on those price (LN) 3-) Calculate the Average and Sd of (2) 4) Multiple the average by 250 to arrive at the annual expected return and Sd by Sqrt(250) to arrive at annual volatility If I am running a simulation with annual periods, how do I correctly use the data from step 4. If I draw value from a distribution with the return and volatility from step 4. Should I apply exponential to that randomly generated before using it in the simulation? Thanks!&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;As you have done already in step 4, that's the annualized volatility and return. You are assuming ln(s1/s0) ~ N(mu, sigma), so s1 = s0*exp(N(mu, sigma)). exp() ensures s1 will never be less than $0.  &lt;/p&gt;&#xA;" OwnerUserId="29022" LastEditorUserId="29022" LastEditDate="2017-08-01T18:43:45.903" LastActivityDate="2017-08-01T18:43:45.903" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35417" PostTypeId="1" AcceptedAnswerId="35423" CreationDate="2017-08-01T19:40:01.587" Score="0" ViewCount="652" Body="&lt;p&gt;The CIR model for spot rate $r_t$ is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dr_t=(\eta-\gamma r_t)dt+\sqrt{\alpha r_t} dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\eta, \gamma, \alpha$ are constants.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to express this SDE in discrete form using Milstein scheme?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The one I derived is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_{t+1}=r_t+(\eta-\gamma r_t)\delta t+\sqrt{\alpha r_t}\cdot\sqrt{\delta t}\phi +\frac{1}{2}\sqrt{\alpha r_t}\cdot\left(\frac{1}{2}\frac{\alpha}{\alpha r_t}\right)[\delta t(\phi^2-1)]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\phi$ is normal RV.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone help me to identify my error? Or is it correct?&lt;/p&gt;&#xA;" OwnerUserId="28421" LastEditorUserId="26595" LastEditDate="2017-08-02T08:25:35.380" LastActivityDate="2017-08-02T14:13:48.143" Title="CIR discretization Milstein scheme" Tags="&lt;monte-carlo&gt;&lt;sde&gt;&lt;spot-rate&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35418" PostTypeId="2" ParentId="35417" CreationDate="2017-08-02T03:33:36.417" Score="0" Body="&lt;p&gt;${{r}_{t+\Delta t}}={{r}_{t}}+(\eta-\gamma r_t)\delta t+\sigma \sqrt{{{r}_{t}}}\sqrt{\delta t}\,{{Z}}+\frac{1}{4}{{\sigma }^{2}}\delta t({{Z}}^{2}-1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Euler is just bad. Milstein in my experience is not much better. A better scheme in general is Predictor Corrector.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another approach (in Glasserman) is to simulate the SDE using the non-central Chi^2 distribution which resolves Euler problem.&lt;/p&gt;&#xA;" OwnerUserId="25655" LastEditorUserId="25655" LastEditDate="2017-08-02T14:13:48.143" LastActivityDate="2017-08-02T14:13:48.143" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35419" PostTypeId="1" AcceptedAnswerId="35424" CreationDate="2017-08-02T07:57:42.267" Score="2" ViewCount="391" Body="&lt;p&gt;Let's say you have two trading strategies and all you're given is information about their average daily P&amp;amp;L and the Sharpe ratio of each strategy. Trading strategy A's daily average P&amp;amp;L is 10,000 USD and the Sharpe ratio is 5. Trading strategy B's daily average P&amp;amp;L is 5,000 USD and the Sharpe ratio is 10. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given only this information (and nothing on correlation), how would you optimally allocate capital between the two trading strategies? &lt;/p&gt;&#xA;" OwnerUserId="29031" LastActivityDate="2017-08-02T14:43:02.050" Title="How much capital to allocate between two trading strategies given average daily P&amp;L and their Sharpe Ratios?" Tags="&lt;capm&gt;&lt;sharpe-ratio&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35421" PostTypeId="1" AcceptedAnswerId="35425" CreationDate="2017-08-02T08:39:22.780" Score="0" ViewCount="514" Body="&lt;p&gt;Given that the Black-Scholes formula for a European Call is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C(S,t)=Se^{-D(T-t)}N(d_1)-Ke^{-r(T-t)}N(d_2)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S$ is stock price, $K$ is strike price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I take limit as $t\rightarrow T^-$, where $\sigma&amp;gt;0$, what are the cases that I have to take into considerations?&lt;/p&gt;&#xA;" OwnerUserId="28421" LastActivityDate="2017-08-02T16:28:24.220" Title="Black-Scholes European call price taking limits" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;call&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35422" PostTypeId="2" ParentId="35419" CreationDate="2017-08-02T08:41:34.547" Score="0" Body="&lt;p&gt;If you only have that type of information, then simply use:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;w1 = 10000/(10000+5000)&#xA;w2 = 5000/(10000+5000)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or replace the PNL by the Sharpe Ratio.&lt;/p&gt;&#xA;" OwnerUserId="13334" LastActivityDate="2017-08-02T08:41:34.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35423" PostTypeId="2" ParentId="35417" CreationDate="2017-08-02T09:08:25.707" Score="1" Body="&lt;p&gt;The Milstein scheme for the following CIR model&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dr_t=(\eta-\gamma r_t)dt+\sqrt{\alpha r_t} dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;should be &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_{t+1}=r_t+(\eta-\gamma r_t)\delta t+\sqrt{\alpha r_t}\cdot\sqrt{\delta t}\phi +\frac{1}{2}\sqrt{\alpha r_t}\cdot\left(\frac{1}{2}\sqrt{\frac{\alpha}{r_t}}\right)[\delta t(\phi^2-1)]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_{t+1}=r_t+(\eta-\gamma r_t)\delta t+\sqrt{\alpha r_t}\cdot\sqrt{\delta t}\phi +\frac{1}{4}\alpha(\phi^2-1)\delta t$$&#xA;where $\phi$ is normal RV.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think that you wrongly derived $\frac{\partial\left(\sqrt{\alpha r_t}\right)}{\partial r_t}$ in the last term.&lt;/p&gt;&#xA;" OwnerUserId="26595" LastActivityDate="2017-08-02T09:08:25.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35424" PostTypeId="2" ParentId="35419" CreationDate="2017-08-02T09:14:57.567" Score="8" Body="&lt;p&gt;To be consistent with the average daily returns that you specified, your first strategy would need to have a daily standard deviation of 31,749 USD and the second a standard deviation of 7,937 USD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How much weight you should assign to each strategy depends on your goal. You might want to maximize the daily profit, minimize the volatility, or maximize the information ratio. Each of these demands different allocations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To maximize the daily profit, put all of your weight in the strategy with the highest expected return (strategy 1).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To minimize the volatility, you should weight each strategy according to the variance of the &lt;em&gt;other&lt;/em&gt; strategy. This leads to putting 94.1% of the weight in the second strategy, and 5.9% in the first strategy. The exact ratio of the weights is 16:1, since the first strategy has 4x the volatility of the first (and hence 16x the variance).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To maximise the information ratio (equivalently the Sharpe ratio, assuming that the returns you mentioned are excess returns), the &lt;a href=&quot;https://en.wikipedia.org/wiki/Kelly_criterion#Application_to_the_stock_market&quot; rel=&quot;noreferrer&quot;&gt;Kelly criterion&lt;/a&gt; then suggests that the allocation to each strategy should be proportional to the average return over the variance. Since the second strategy has half the expected return, and one-quarter the standard deviation, it should therefore receive 8x the capital allocation that the first strategy receives, since&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{\frac{1}{2}}{\frac{1}{4}\times \frac{1}{4}} = 8&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the strategies are somewhat positively correlated, you should allocated more to the second strategy (since it has higher Sharpe).&lt;/p&gt;&#xA;" OwnerUserId="924" LastEditorUserId="924" LastEditDate="2017-08-02T14:43:02.050" LastActivityDate="2017-08-02T14:43:02.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35425" PostTypeId="2" ParentId="35421" CreationDate="2017-08-02T09:31:30.020" Score="3" Body="&lt;p&gt;Look at the values of $d_1$ and $d_2$ when $t \rightarrow T$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d_1 = \frac{\ln(S/K) + \left(r - D + \dfrac{1}{2}\sigma^2\right)\tau}{\sigma \sqrt{\tau}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d_2 = d_1 - \sigma \sqrt{\tau}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $\tau = T -t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, $t \rightarrow T$ is equivalent to $\tau \rightarrow 0$&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Case 1: $S &amp;gt; K$&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$d_1 \sim \frac{\ln(S/K) }{\sigma \sqrt{\tau}} \rightarrow + \infty$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d_2 \sim d_1\rightarrow + \infty$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C(S,\tau) = S e^{- D \tau} N (d_1) - K e^{- r \tau} N (d_2) \rightarrow (S-K)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;as $N(d_i) \rightarrow 1$ for $i \in \{ 1,2\}$.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Case 2: $S &amp;lt; K$&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$d_1 \sim \frac{\ln(S/K) }{\sigma \sqrt{\tau}} \rightarrow - \infty$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d_2 \sim d_1\rightarrow - \infty$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C(S,\tau) = S e^{- D \tau} N (d_1) - K e^{- r \tau} N (d_2) \rightarrow 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;as $N(d_i) \rightarrow 0$ for $i \in \{ 1,2\}$.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Case 3: $S = K$&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$d_1 = \frac{\left(r - D + \dfrac{1}{2}\sigma^2\right)\sqrt{\tau}}{\sigma} \rightarrow 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d_2 \rightarrow 0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C(S,\tau) = S e^{- D \tau} N (d_1) - K e^{- r \tau} N (d_2)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C(S,\tau) = \left( S - K \right) \dfrac{1}{2} \rightarrow 0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;as $N(d_i) \rightarrow \dfrac{1}{2}$ for $i \in \{ 1,2\}$ and $S = K$ by assumption.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Putting everything together, you see that the price of the call tends to its payoff&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$(S-K)^+$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;when the time $t$ is &quot;infinitely&quot; close to the maturity of the call $T$.&lt;/p&gt;&#xA;" OwnerUserId="26595" LastEditorUserId="26595" LastEditDate="2017-08-02T16:28:24.220" LastActivityDate="2017-08-02T16:28:24.220" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="35426" PostTypeId="1" AcceptedAnswerId="35432" CreationDate="2017-08-02T10:32:39.070" Score="2" ViewCount="76" Body="&lt;p&gt;I need to calculate the fair value of an option, with the underlying being the earnings of a listed company.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe the best way to achieve this is to simulate the earnings of the company and I want to do it as follows:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Simulate the share price using standard GBM.&lt;/li&gt;&#xA;&lt;li&gt;Simulate the PE ratio using a mean reverting AR process&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;From these two simulated values, I can calculate the earnings and from there the payoff using a Monte Carlo simulation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think this a a good approach, but if there are better methods, please let me know.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question relates to the correlation between the share price and the PE ratio. Is it fair to assume that they are not correlated, since PE can be seen as the market's rating of the company?&lt;/p&gt;&#xA;" OwnerUserId="18065" LastEditorUserId="18065" LastEditDate="2017-08-02T10:53:44.283" LastActivityDate="2017-08-02T15:26:30.653" Title="Option with company earnings as underlying" Tags="&lt;options&gt;&lt;equities&gt;&lt;earnings&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35428" PostTypeId="2" ParentId="35426" CreationDate="2017-08-02T12:42:02.193" Score="0" Body="&lt;p&gt;PE is literally price / earnings. You certainly must assume that price and PE are correlated. &lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2017-08-02T12:42:02.193" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35429" PostTypeId="2" ParentId="27780" CreationDate="2017-08-02T12:58:13.110" Score="1" Body="&lt;p&gt;RiskyScientist answers make sense, but I want to provide a counter-example and an alternative, more systematic answer. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you look at ATM weeklys on SPY/SPX you will also see volatility rises into expiration as well. This behavior cannot be explained by sector-related, or any idiosyncratic reason. Also ATMs are highly liquid, and are prices far above 0.01, so RiskyScientists second reason would also not apply here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason why there's an IV premium for short-term options is because they are cheap in $ - so you can get a lot of gamma for little money, either for speculation or to hedge something longer-term flow for cheap. &lt;/p&gt;&#xA;" OwnerUserId="185" LastActivityDate="2017-08-02T12:58:13.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35430" PostTypeId="2" ParentId="35363" CreationDate="2017-08-02T13:02:12.023" Score="2" Body="&lt;p&gt;This video is not explaining how banks borrow from the Fed.  It is explaining the role of banks as an intermediary between the Fed and the Home Loan Banks.  Thus, the Home Loan Banks have cash and would like to deposit it at the Fed, but they can't because they are not eligible for the Fed deposit facility.  So they deposit it with a bank, which turns around and deposits it in the Fed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;FYI Banks don't generally take out unsecured loans from the Fed, unless they are in crisis mode.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-08-02T13:02:12.023" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35431" PostTypeId="2" ParentId="35393" CreationDate="2017-08-02T13:49:27.580" Score="2" Body="&lt;p&gt;The random variable&#xA;$$X = \sum_{k=1}^{n} A_k\exp(\mathcal{N}(t_k\mu-\sigma\sqrt{t_k}/2,\sigma)))$$ emerges as a weighted sum of individual random variables that are log-normally distributed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately, even if we assume that the individual r.v. involved in the sum are independent, a sum of log-normals (here $X$) possesses no analytically tractable probability density function. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will therefore not be able to find a closed-form expression for the quantiles of $X$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A practical solution however could be to use a &quot;Monte Carlo&quot; simulation in the loose sense: draw a (sufficient) number $M$ of random samples from $X$, $(x_i)_{i=1,...,M}$; sort them in ascending order and infer the desired quantile&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These related questions (&lt;a href=&quot;https://stats.stackexchange.com/questions/134976/compute-quantile-of-sum-of-distributions-from-particular-quantiles&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;https://stats.stackexchange.com/questions/281129/finding-the-distribution-of-sum-of-lognormal-random-variables&quot;&gt;there&lt;/a&gt;) may also help I guess.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2017-08-02T14:50:43.427" LastActivityDate="2017-08-02T14:50:43.427" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35432" PostTypeId="2" ParentId="35426" CreationDate="2017-08-02T14:41:53.797" Score="2" Body="&lt;p&gt;I think it is reasonable to assume the two are uncorrelated, since P/E ratios $R$ do not vary a lot and tend to have more to do with the fundamentals of a given industry than the earnings levels of particular companies in them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming the two are uncorrelated lets you do your pricing using trapezoid-rule quadrature of the Black-Scholes formula.  (You weren't going to use Monte Carlo, I hope.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;V = \int_R BS(P/R, \sigma_P) p(R) dR&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that if $p(R)$ is gaussian (as in the terminal distribution of a typical AR or OU process) you'll have to cut off the bounds of integration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Personally I would not bother assuming anything other than a constant P/E ratio $R$.  I would just goose the equity volatility $\sigma_P$, which after all is just a guess at future volatility, and call the job done.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2017-08-02T14:41:53.797" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="35433" PostTypeId="1" CreationDate="2017-08-02T15:09:27.853" Score="2" ViewCount="2716" Body="&lt;p&gt;Given that the Black-Scholes formula for a European Call is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C(S,t)=Se^{-D(T-t)}N(d_1)-Ke^{-r(T-t)}N(d_2)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S$ is stock price, $K$ is strike price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An At-The-Money-Forward option is struck when $K=Se^{(r-D)(T-t)}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;When $t\rightarrow T$, show that the approximation can be obtained to give&#xA;$$C(S,t)\approx 0.4 Se^{-D(T-t)}\sigma\sqrt{T-t}$$&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I noticed from this post &lt;a href=&quot;https://quant.stackexchange.com/questions/1150/what-are-some-useful-approximations-to-the-black-scholes-formula&quot;&gt;HERE&lt;/a&gt;, I understood everything except the last step:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have found that:&#xA;$$C(S,t)\approx S(0.4\sigma\sqrt{T-t})$$ by using the Taylor's Series expansion of $N(x)$ around $0$, but do not know how can we use the following replacement?&#xA;$$S=Se^{-D(T-t)}$$&lt;/p&gt;&#xA;" OwnerUserId="28421" LastActivityDate="2017-08-02T17:15:09.227" Title="At-The-Money-Forward option approximation" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35434" PostTypeId="2" ParentId="35426" CreationDate="2017-08-02T15:14:19.160" Score="1" Body="&lt;p&gt;I assume that you are talking about the &lt;em&gt;changes&lt;/em&gt; in P, and P/E being uncorrelated, rather than the values themselves, since you are going to be simulating the increments in your GBM or AR process.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems reasonable to assume that increments in price and earnings are correlated (i.e. if earnings increase, the price will probably go up). And since P/E is a simple function of P and E, its relationship with P will be determined by the relationship between P and E.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The increments of P/E are given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\Delta (PE) = \frac{P}{E}\left( \frac{\Delta P}{P} - \frac{\Delta E}{E}\right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and so (abusing notation a bit) the covariance between P and P/E is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align}&#xA;\mathrm{Cov}(\Delta P, \Delta PE)&#xA;&amp;amp; = \mathrm{Cov}(\Delta P, \Delta P) - \mathrm{Cov}(\Delta P, \Delta E) \\&#xA;&amp;amp; = \sigma_P^2 - \rho \sigma_P \sigma_E \\&#xA;&amp;amp; = \sigma_P \left( \sigma_P - \rho \sigma_E \right)&#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;therefore the increments in P will be uncorrelated with the increments in P/E if you have $\sigma_P = \rho \sigma_E$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since price volatility is generally higher than earnings volatility ($\sigma_P &amp;gt; \sigma_E$) and correlation is obviously less than one, this relationship will not hold in general, and you should expect the increments of P/E to be positively correlated with the increments of P.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; I confirmed this with data, using quarterly price and earnings data for the S&amp;amp;P 500 from 1970 to present, and observed around an 80% correlation between log changes in price, and log changes in price-to-earnings.&lt;/p&gt;&#xA;" OwnerUserId="924" LastEditorUserId="924" LastEditDate="2017-08-02T15:26:30.653" LastActivityDate="2017-08-02T15:26:30.653" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35435" PostTypeId="2" ParentId="35433" CreationDate="2017-08-02T15:18:02.327" Score="2" Body="&lt;p&gt;Rewrite the call price as &#xA;$$ C(S,t) = e^{-r(T-t)} \left( F N(d_1) - K N(d_2) \right) $$&#xA;where $F = Se^{(r-D)(T-t)}$ (forward price). Using $F$ you can also write that &#xA;$$d_{1,2} = \frac{ \ln(F/K)\pm\frac{1}{2} \sigma^2(T-t) }{\sigma\sqrt{T-t}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, by definition when the option is struct AMTF, $K=F$ and you have that&#xA;$$ C(S,t) = e^{-r(T-t)} F \left[ N\left(\frac{1}{2}\sigma\sqrt{T-t}\right) - N\left(-\frac{1}{2}\sigma\sqrt{T-t}\right) \right] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are then exactly in the same situation as in &lt;a href=&quot;https://quant.stackexchange.com/questions/1150/what-are-some-useful-approximations-to-the-black-scholes-formula&quot;&gt;this&lt;/a&gt; question (see equation (1)), but with $Fe^{-r(T-t)}=Se^{-D(T-t)}$ instead of $S$. The rest of the development stays the same.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2017-08-02T17:15:09.227" LastActivityDate="2017-08-02T17:15:09.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35439" PostTypeId="1" CreationDate="2017-08-02T21:58:32.483" Score="-1" ViewCount="616" Body="&lt;p&gt;I have invested a few years in learning R and have developed a number of Monte Carlo backtesting scripts. My question is this: In general, for a person with some experience writing R code who is interested in Monte Carlo backtesting of various strategies, is it worth the time to go through quantstrat's steep learning curve, or would one be better off putting that time into continuing to develop and modify one's own backtesting scripts?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this question is off topic, I apologize. I can't seem to find another place to ask it.&lt;/p&gt;&#xA;" OwnerUserId="29042" LastActivityDate="2017-10-04T21:58:58.447" Title="quantstrat for backtesting vs. writing one's own code in R" Tags="&lt;programming&gt;&lt;monte-carlo&gt;&lt;backtesting&gt;&lt;quants&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="35442" PostTypeId="1" AcceptedAnswerId="35443" CreationDate="2017-08-03T01:35:53.013" Score="2" ViewCount="161" Body="&lt;p&gt;When we want to close out the position of futures prior to the delivery period, you will &lt;code&gt;entering into the opposite trade to the original one.&lt;/code&gt; Equivalently, except for the P&amp;amp;L at the closing time, you have nothing related to this contract again. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in the real trading, you still have two contracts and should make the delivery both of them at the maturity, and we never consider the commission, default from one of your counterparty etc. So can anyone tell me the  mechanics of the closing out for a future contract in the real trading?&lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-08-03T05:28:12.663" Title="How to understand closing position of futures" Tags="&lt;futures&gt;&lt;derivatives&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35443" PostTypeId="2" ParentId="35442" CreationDate="2017-08-03T05:28:12.663" Score="4" Body="&lt;p&gt;When you close out a position in a stock, you don't have two stock positions, one long and one short. You just have zero position. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same is true of futures. Your counterparty for both trades is the exchange, so when you do a round trip in a futures contract, you really do end up with no position at the end. &lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2017-08-03T05:28:12.663" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35444" PostTypeId="2" ParentId="35412" CreationDate="2017-08-03T06:06:13.853" Score="4" Body="&lt;p&gt;Adding to the excellent answer of vonjd:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;another, more cynical interpretation is that some of these &quot;anomalies&quot; never would have existed ex-post and that their discovery is the inevitable result of thousands of researchers looking for patterns in the same data set. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Look at &quot;. . . and the Cross-Section of Expected Returns&quot; by Harvey et. al. for an elaboration on this idea and &quot;The Probability of Backtest Overfitting&quot; by Bailey et al. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reading both will give you some healthy skepticism regarding anomalies. &lt;/p&gt;&#xA;" OwnerUserId="26256" LastActivityDate="2017-08-03T06:06:13.853" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35446" PostTypeId="2" ParentId="35412" CreationDate="2017-08-03T08:18:39.107" Score="5" Body="&lt;p&gt;Any anomaly that can be phrased as a &quot;mispricing&quot; or &quot;relative value&quot; opportunity can be expected to disappear as more people discover it and trade on it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, say that stock movements over the last 15 minutes of the day are found to be strongly mean-reverting. That is, stocks which decline over the last 15 minutes of the day tend to be undervalued, and stocks which advance over the last 15 minutes tend to be overvalued.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A trader who wants to take advantage of this needs to buy stocks that have declined, and sell stocks that have advanced. That buying and selling activity pushes up the price of the stocks that declined (making them less undervalued) and pushes down the price of stocks that advanced (making them less overvalued) and thereby reducing the size of the opportunity for other traders.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In some cases, you may not have an &quot;anomaly&quot; but instead a &quot;risk premium&quot;. The difference is that an anomaly has positive expected return because other market participants have not yet caught on to it, whereas a risk premium has a positive expected return because it is the reward demanded by the market for bearing a risk. For example, the &quot;value risk premium&quot; is generally assumed to be a compensation for risk, since value stocks often look riskier (high leverage, high earnings volatility, may be distressed).&lt;/p&gt;&#xA;" OwnerUserId="924" LastEditorUserId="924" LastEditDate="2017-08-03T08:24:30.383" LastActivityDate="2017-08-03T08:24:30.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35447" PostTypeId="1" AcceptedAnswerId="35449" CreationDate="2017-08-03T11:26:07.883" Score="0" ViewCount="61" Body="&lt;p&gt;I am looking for a formula that lets me keep the ratio between two assets in my portfolio constant when one of the assets is appreciating continually in comparison to the other asset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Imagine a portfolio consisting of USD and say Amazon stock in the year 1998. Over the next few years the stock will double in terms of USD again and again. I discovered that if the owner would sell ~28.5714 % of the stock per doubling the composition of the portfolio would approach 50% USD and 50% AMZN over time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How can this number (28.5714 %) be mathematically derived? Is there a formula that lets me compute the portion that would have to be sold per doubling in order to arrive at a different portfolio composition? Say I would like to be only 10% exposed to AMZN.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wrote and used this tool: &lt;a href=&quot;https://davalb.github.io/continuous-divestment/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://davalb.github.io/continuous-divestment/&lt;/a&gt; to experimentally arrive at the 28.5714 figure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I am not entirely sure if this is the right community to ask this question. If not I apologize. Any hints where I could get an answer to this question are very welcome!)&lt;/p&gt;&#xA;" OwnerUserId="29052" LastActivityDate="2017-08-03T15:36:53.700" Title="How to keep the ratio of two assets constant when one asset is appreciating towards the other" Tags="&lt;portfolio-management&gt;&lt;portfolio&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35448" PostTypeId="1" AcceptedAnswerId="35450" CreationDate="2017-08-03T12:45:17.837" Score="-1" ViewCount="134" Body="&lt;p&gt;If the Federal Funds Rate changes, does that affect bond prices? How?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, is there any connection between the Federal Funds Rate and the coupon payment on US bonds?(for those that have a coupon payment) When the Federal Funds Rate is changed, is there also a chance in the coupon paid by bonds issued after that?&lt;/p&gt;&#xA;" OwnerUserId="28949" LastActivityDate="2017-08-03T14:17:53.947" Title="What is the connection between the federal funds rate and US government bonds" Tags="&lt;interest-rates&gt;&lt;bond&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35449" PostTypeId="2" ParentId="35447" CreationDate="2017-08-03T13:20:23.343" Score="2" Body="&lt;p&gt;So, if I understood the question correctly&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In $t=1$ you have $n_1$ amazon shares that are sold for $p_1$ each. You also have $C_1$ in cash, for a total portfolio value of&#xA;$$W_1 = n_1 p_1 + C_1 $$&#xA;In $t=2$ the price of the amazon shares rose to $p_2$. Now your portfolio value is&#xA;$$W_2 = n_1 p_2 + C_1 $$&#xA;You want a new situation&#xA;$$W_2^{'} = n_2 p_2 + C_2 $$&#xA;In which you have sold $n_1 - n_2$ Amazon shares, and put the proceedings of the selling in cash. You want to impose that the value of the Amazon shares over the total value of the portfolio is the same in $W_2^{'}$ and $W_1$&#xA;So you have 2 conditions:&#xA;(1) $$\dfrac{n_2 \cdot p_2}{W_2^{'}} = \dfrac{n_1 \cdot p_1}{W_1}$$ &#xA;and (2)&#xA;$$C_2 = C_1 + p_2 (n_1 - n_2)$$&#xA;The second condition arises from the fact that the cash in $t=2$ is equal to the cash in $t=1$ plus the proceedings of the shares you sold. You do not add additional cash from your pockets.&#xA;Putting (2) in (1) and solving for $n_2$ yields to:&#xA;$$n_2 = n_1 \cdot \dfrac{p_1}{p_2} \cdot \dfrac{C_1 + n_1 p_2}{C_1 + n_1 p_1}$$&#xA;Suppose $p_1 = 1\$$,$p_2 = 2\$$,$n_1 = 1 \,\text{share}$, $C_1 = 1\$$, the formula yields $ n_2 = 0.75 \,\text{shares}$. &#xA;In fact, both the initial weight of the Amazon share is 50%. &#xA;Also the final weight of the Amazon shares, after the price doubled and you sold 0.25 shares, is 50%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The amount of shares you have to sell is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ n_1 - n_2 = \Delta n = n_1 \left[ \dfrac{C_1 (p_2 - p_1)}{p_2(C_1 +n_1 p_1)} \right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hypothesizing that the price double ($p_2 = 2 p_1$) and the initial cash weight for 50% ($C_1 = n_1 p_1$), we obtain&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \dfrac{\Delta n}{n_1} = \dfrac{1}{4} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, you have to sell 25% of your Amazon shares.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT2:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is the implicit assumption that you are able to sell all your $\Delta n$ shares for the same price of $p_2$. This may not be true, especially if you have to sell a large amount of shares. &#xA;You may not be able to find people willing to buy later shares at $p_2$, because they entered a buy order for a lower price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, if the price falls ($p_2 &amp;lt; p_1$), you need to buy shares. In this case, if you don't want to borrow money, you have to impose the restriction $C_2 \ge 0$, which leads to a minimum $p_2$ value. If the price falls below this value, you have lost all your cash and you are not able to buy further shares. &lt;/p&gt;&#xA;" OwnerUserId="25351" LastEditorUserId="25351" LastEditDate="2017-08-03T15:36:53.700" LastActivityDate="2017-08-03T15:36:53.700" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35450" PostTypeId="2" ParentId="35448" CreationDate="2017-08-03T14:17:53.947" Score="2" Body="&lt;p&gt;The fed funds rate is the rate setting mechanism that affects all rates along the curve, however it mainly influences short term rates. If overnight borrowing costs are going up, then its going to cost more to borrow for 1m, 3m, 6m, 1yr, 2yr. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The short end of the curve isn't affected by long term growth and inflation assumptions as much as the long end of the curve, its mainly driven by monetary policy (the fed funds rate). ie, 2% annual inflation isn't going to eat away as much at a 2yr coupon bond as it would with a 30yr bond. Long term rates also have a term premium, which is compensation for the uncertainty in future inflation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a chart (as of yesterday 8/2/2017) that shows how the yield curve has changed over the last 2yrs in response to monetary policy and long term growth/inflation assumptions. Visualizations usually help me so hopefully this will allow you to understand. &#xA;&lt;a href=&quot;https://i.stack.imgur.com/drImp.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/drImp.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see, short term rates have gone up considerably since August 2015. However as you go further out on the curve, the rate differential starts to decrease, which implies (IMO) that long term growth and inflation expectations are roughly the same as what they were 2yrs ago. If you follow the markets, think back to the summer of 2016 when rates were extremely low, with negative yields in the trillions of dollars. There was an interest rate increase in Dec 2015, so the short end of the curve is shifted up, but the long end got hammered, meaning the growth and inflation expectations at that time were abysmal (Roughly a month after Brexit, US election coming up, QE by central banks etc etc). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at the six month curve, The &quot;Trump Bump&quot; was still in affect, with the global inflation outlook on the rise. As that has clearly died down, its left us with where we are today. Another rate increase, but much future expectations, causing the steepness of the curve to flatten. &lt;/p&gt;&#xA;" OwnerUserId="28730" LastActivityDate="2017-08-03T14:17:53.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35451" PostTypeId="1" CreationDate="2017-08-03T16:23:21.200" Score="4" ViewCount="1619" Body="&lt;p&gt;Suppose I am short of cash and want a loan for some mundane objective like travelling or buying a car. The interest rate for personal loan with my bank is too high.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any way in finance that an average guy like me can do a synthetic loan (without being a corporate investor or rich) in case I find out that the implicit market free rate from this operation is lower than with my bank?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At first I considered Put Call parity. I could go short on stock St, long/short on call /put and arrange things to pay the strike K in the future for sure. If I calculate that after fees, liquidity issues and other costs the implicit risk free rate of this transaction is lower than the interest rate of a loan, it would make sense. The killer detail is margin, in most countries you need at least the value of what you are shorting, in this case St, untouched in your account. If I already have St free in my bank account I wouldn't need a loan anyway and all becomes meaningless.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any class of assets that would allow someone to practically build a synthetic loan for personal reasons or margin requirement would kill everything in the end.&lt;/p&gt;&#xA;" OwnerUserId="20616" LastActivityDate="2019-08-06T15:19:04.887" Title="Build a Synthetic Loan for Personal Finance" Tags="&lt;option-pricing&gt;&lt;derivatives&gt;&lt;option-strategies&gt;&lt;no-arbitrage-theory&gt;&lt;put-call-parity&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35452" PostTypeId="1" CreationDate="2017-08-03T21:32:16.833" Score="2" ViewCount="810" Body="&lt;p&gt;I am trying to replicate Duan's results from his 1995 Paper, &quot;The GARCH Option Pricing Model&quot;. I have written this code in Python myself, and using his parameters I consistently seem to obtain results significantly below his results. As an example, if I run the code with 30 days as Time to Maturity of the Option and number of simulations being 50,000, I obtain a result of 260.162, whereas Duan reports results of 266.75. I was wondering if anybody who was familiar with GARCH Option Pricing could assist me in my troubles. Thankyou in advance. (Note that results are reported as 10,000 times, if anyone was wondering how a call option with initial stock price of 1, strike price of 1, t = 30 days and r = 0 could be price as 266.75).&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import numpy as np&#xA;&#xA;beta0 = 0.00001524 #GARCH Parameter Omega&#xA;beta1 = 0.7162 #GARCH Parameter associated with lagged variance term&#xA;beta2 = 0.1883 #GARCH Parameter associated with lagged innovation&#xA;lamba = 0.007452 #RiskNeutral Parameter&#xA;H0 = beta0/(1-(1+lamba)*beta2-beta1) #initial variance&#xA;#H0 = (0.8)**2*(omega/(1-(1+lamba)*alpha-beta)) #initial conditional variance&#xA;#H0 = (1.2)**2*(omega/(1-(1+lamba)*alpha-beta)) #initial conditional variance&#xA;S0 = 1 #initial stock price&#xA;K = 1 #strike price&#xA;r = 0 #risk-free interest rate&#xA;t = 0 #start time&#xA;Td = 30 #time in days&#xA;i = 50000 #number of simulations&#xA;discount_factor = np.exp(-r*(Td/365)) #discount factor&#xA;dt = np.dtype(np.float16)&#xA;&#xA;h = np.zeros([i,Td], dtype = dt)&#xA;e = np.zeros([i,Td], dtype = dt)&#xA;t = range(0,Td,1)&#xA;S = S0*np.ones([i], dtype = dt)&#xA;DH = np.ones([i], dtype = dt)&#xA;z = np.random.standard_normal([i,Td])&#xA;&#xA;for x in range(0,i-1):&#xA;h[x,0] = H0&#xA;e[x,0] = H0*np.random.normal(0,1,)&#xA;for y in range(0,Td-1):&#xA;    h[x,y+1] = beta0 + h[x,y]*(beta1 + beta2*(z[x,y] - lamba)**2)&#xA;    e[x,y+1] = np.sqrt(h[x,y+1])*z[x,y+1]&#xA;&#xA;sumh = h.sum(axis=1)&#xA;sume = e.sum(axis=1)&#xA;&#xA;&#xA;for x in range(0,i):&#xA;S[x] = S[x]*np.exp((Td)*(r/365) - 0.5*sumh[x] + sume[x])&#xA;DH[x] = np.exp(-0.5*sumh[x] + sume[x])&#xA;&#xA;&#xA;for x in range(0,i):&#xA;if S[x]&amp;gt;=K:&#xA;    DH[x] = DH[x]&#xA;else:&#xA;    DH[x] = 0&#xA;&#xA;&#xA;for x in range(0,i):&#xA;S[x] = np.maximum(S[x] - K, 0)&#xA;S[x] = discount_factor*S[x]&#xA;&#xA;CallPrice = np.average(S)&#xA;StdDev = np.std(S)&#xA;UpperLimit = CallPrice + 1.96*StdDev/i&#xA;LowerLimit = CallPrice - 1.96*StdDev/i&#xA;DeltaHedge = np.average(DH)&#xA;#print(&quot;The Call Price is:&quot;, CallPrice*10000)&#xA;print(&quot;The Call Price is:&quot;, CallPrice*10000)&#xA;print(&quot;The lower bound of the 95% confidence interval is:&quot;,  LowerLimit)&#xA;print(&quot;The upper bound of the 95% confidence interval is:&quot;, UpperLimit)&#xA;print(&quot;The corresponding Option Delta is:&quot;, DeltaHedge)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="29061" LastActivityDate="2017-08-03T21:32:16.833" Title="GARCH Option Pricing Model (Duan 1995)" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;volatility&gt;&lt;garch&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35453" PostTypeId="2" ParentId="35403" CreationDate="2017-08-04T02:35:37.953" Score="0" Body="&lt;p&gt;You have several mistakes in your code, one obvious is having an &lt;code&gt;inner()&lt;/code&gt; function without calling it. Here is an example that I clean up based on your code. I added a few comments in my code the explain what's going on. Also see my comments on your original post.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;from time import sleep, strftime&#xA;from ib.ext.Contract import Contract&#xA;&#xA;&#xA;def historical_data_handler(msg):&#xA;    # The response data callback function&#xA;    # print (msg.reqId, msg.date, msg.open, msg.close, msg.high, msg.low)&#xA;    print(msg)&#xA;&#xA;&#xA;if __name__ == '__main__':&#xA;    # Establish IB connection, make sure you have the correct port, clientId&#xA;    conn = ibConnection(host='127.0.0.1', port=7496, clientId=999)&#xA;&#xA;    # Register the response callback function and type of data to be returned&#xA;    conn.register(historical_data_handler, message.historicalData)&#xA;    conn.connect()&#xA;&#xA;    # Establish a Contract object and the params for the request&#xA;    req = Contract()&#xA;    req.m_secType = &quot;STK&quot; &#xA;    req.m_symbol = &quot;ABN&quot;&#xA;    req.m_currency = &quot;EUR&quot;&#xA;    req.m_exchange = &quot;AEB&quot;&#xA;    endtime = strftime('%Y%m%d %H:%M:%S')&#xA;    conn.reqHistoricalData(1,req,endtime,&quot;14 D&quot;,&quot;1 min&quot;,&quot;BID&quot;,1,1)&#xA;&#xA;    # Make sure the connection don't get disconnected prior the response data return&#xA;    sleep(5)&#xA;    conn.disconnect()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="29028" LastActivityDate="2017-08-04T02:35:37.953" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35457" PostTypeId="2" ParentId="11458" CreationDate="2017-08-04T09:09:30.670" Score="-1" Body="&lt;p&gt;All you wrote are valid to the point where no real money of your own involved. Writing an academic paper is as easy as having a cup of tea. The real test of a model is actually making real bets, i.e. buying and selling options, if you make money, then the model can be said a good one!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As simple as that! Why do you have to sort to EMH or the like? Why people prefer a fantasy (EMH or risk-neutral) to a real thing, because in a fantasy everything is possible!&lt;/p&gt;&#xA;" OwnerUserId="29068" LastActivityDate="2017-08-04T09:09:30.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35458" PostTypeId="1" CreationDate="2017-08-04T09:45:25.337" Score="-1" ViewCount="84" Body="&lt;p&gt;Time series of returns, $r_t$, in finance are often modeled with some type of conditional heteroskedasticity model, e.g. ARCH(1):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_t = \sigma_t z_t$$&#xA;$$\sigma_t^2 = a_0 +a_1 r_{t-1}^2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where, say, $z_t \tilde{} N(0,1)$, which implies that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_t = z_t \sqrt{a_0 +a_1 r_{t-1}^2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and hence the returns are not independent. However, Value-at-risk (VaR) seems to be estimated by constructing a single empirical distribution of the observed returns and taking some quantile. But since the returns are not independent, they cannot be represented by one univariate distribution, so why this procedure to calculate VaR is considered valid? It seems to me that, at the very least, VaR estimated in this way would be biased, but I am not sure I have seen corrections being applied / discussed for this.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Add 1&lt;/strong&gt; It seems to me that given a time series with a persistent volatility (e.g. one with a high order of the ARCH term above, say 100), any finite period of observations, say 250, is likely to have explored a smaller part of the total space compared to IID returns, so I would have thought that one has to correct somehow for this when estimating VaR from historical observations in this case.&lt;/p&gt;&#xA;" OwnerUserId="25538" LastEditorUserId="25538" LastEditDate="2017-08-04T12:58:46.040" LastActivityDate="2017-08-04T12:58:46.040" Title="VaR estimation when returns are not independent, e.g. ARCH" Tags="&lt;time-series&gt;&lt;risk&gt;&lt;garch&gt;&lt;var&gt;&lt;arch&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35459" PostTypeId="1" AcceptedAnswerId="35487" CreationDate="2017-08-04T10:32:28.507" Score="0" ViewCount="188" Body="&lt;p&gt;Here is the statements of &lt;code&gt;future price&lt;/code&gt; in Shreve's book &lt;code&gt;Stochastic Calculus for Finance II&lt;/code&gt; page 244 to proof the &lt;code&gt;value of cash flow is zero.&lt;/code&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/biPNv.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/biPNv.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&#xA;But I have problem that here we use the fact $D(t_{k+1})$ is $\mathcal{F}(t_k)$-measurable, since the definition of $D(t_{k+1})$ in the discrete interest rate case as following:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/Xim2g.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Xim2g.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but, in the continuous interest rate case, we can never guarantee $D(t_2)$ is $\mathcal{F}(t_1)$-measurable when $t_2&amp;gt;t_1.$ Does the statement still hold?&lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-08-07T07:30:54.343" Title="Zero value of cash flow for future in Shreve's book" Tags="&lt;stochastic-calculus&gt;&lt;futures&gt;&lt;derivatives&gt;" AnswerCount="1" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="35460" PostTypeId="2" ParentId="35458" CreationDate="2017-08-04T10:55:50.297" Score="0" Body="&lt;p&gt;The fact that you have a univariate distribution does not imply that the returns are independent. If fact it is plenty of univariate models that take into account the dependence of the time series. In volatility models the innovations (${{Z}_{t}}$ in your question) are independent, not the returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The procedure to caluclate VaR with volatiltiy models is consistent. When you compute quantiles, you may think that the time dependence is broken apart by ordering the returns, but this is not the case, because the returns are modeled using time dependence variance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I try to explain with an example. There are closed formulas to complute VaR using simple volatility models. Most of the time, for advanced models you have to use simulation. For example you estimate a GARCH model with your data. Then you simulate N (N&gt;1000) paths from this model and for each path you compute VaR. Finally you can compute the mean of tha VaRs or better you compute a confidence interval.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In multivariate models the procedure is the same. You have just more parameters to model the time-varying correlation between assets (see GARCH-DCC model)&lt;/p&gt;&#xA;" OwnerUserId="22108" LastEditorUserId="22108" LastEditDate="2017-08-04T11:01:50.937" LastActivityDate="2017-08-04T11:01:50.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35461" PostTypeId="1" CreationDate="2017-08-04T15:52:56.153" Score="3" ViewCount="257" Body="&lt;p&gt;Have I understood it correctly if the standard way to calculate implied correlation is the Gaussian Copula model where we:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Calibrate the underlying portfolio to get a homogenous default probability for all assets.&lt;/li&gt;&#xA;&lt;li&gt;Calibrate the correlation parameter alpha to each tranche in the CDO.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I am a bit confused since the most articles i've read do not comment on the default probability, but only the correlation parameter and it seems counterintuitive to ignore one parameter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;p.s. it seems that the idea of implied correlation has been abandoned after the crash in 2008, what is a viable alternative?&lt;/p&gt;&#xA;" OwnerUserId="29071" LastEditorUserId="29071" LastEditDate="2017-09-18T16:08:19.517" LastActivityDate="2017-09-18T16:08:19.517" Title="Implied correlation" Tags="&lt;correlation&gt;&lt;implied&gt;&lt;cdo&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35462" PostTypeId="1" CreationDate="2017-08-04T16:33:31.293" Score="3" ViewCount="556" Body="&lt;p&gt;&quot;An Improved Estimator For Black-Scholes-Merton Implied Volatility&quot; by Hallerbach (2004) (&lt;a href=&quot;https://ssrn.com/abstract=567721&quot; rel=&quot;nofollow noreferrer&quot;&gt;link to article&lt;/a&gt;) provides an equation (Eq. 24, Page 13, and below)&#xA;for the implied volatility of a &lt;em&gt;call&lt;/em&gt; option. What would be the equation for a &lt;em&gt;put&lt;/em&gt; option? Thank you!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma\sqrt{T} = \frac{\sqrt{2\pi}}{2(S+X)}\Biggl[2C+X-S+\sqrt{(2C+X-S)^2-1.85\frac{(S+X)(X-S)^2}{\pi\sqrt{XS}}}\Biggl]$$&lt;/p&gt;&#xA;" OwnerUserId="29074" LastEditorUserId="29074" LastEditDate="2017-08-08T17:19:00.563" LastActivityDate="2017-08-08T19:53:31.343" Title="What is The Closed-Form Implied Volatility Estimator (As Defined by Hallerbach 2004) for A Put Option?" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;put&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35463" PostTypeId="1" AcceptedAnswerId="35464" CreationDate="2017-08-04T18:43:47.220" Score="0" ViewCount="109" Body="&lt;p&gt;I am currently researching if some fund characteristics such as (fund size, fund family size, capital flows, and fund age) explains fund performance measured (monthly alpha). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, I am using a fixed effect panel regression where the dependant variable is monthly fund performance; the independent variables are lagged monthly fund characteristic. I perform a fixed effect regression and cluster by (ID) to adjust standard errors for cross-sectional dependence and heteroscedastic residuals.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My sample size is 350 funds with 120 observation for each fund (10 years). In total, I have around 42,000 observations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any disadvantages and/or benefits for using a large panel dataset? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You're help is appreciated. &lt;/p&gt;&#xA;" OwnerUserId="28909" LastActivityDate="2017-08-05T04:18:39.127" Title="Disadvantages of large panel" Tags="&lt;regression&gt;&lt;econometrics&gt;&lt;quantitative&gt;&lt;hedge-fund&gt;&lt;mutual-fund&gt;" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="35464" PostTypeId="2" ParentId="35463" CreationDate="2017-08-04T22:54:28.480" Score="2" Body="&lt;p&gt;In general, more data is better than less data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the topic of your specific scenario, you want to cluster by date or use some other procedure to produce consistent standard errors in the presence of cross-sectional correlation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Monthly returns are basically uncorrelated over time but exhibit significant cross-sectional correlation.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;With large quantities of data, treating correlated error terms as uncorrelated can massively understate standard errors!&lt;/h1&gt;&#xA;&#xA;&lt;h3&gt;Example:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Let's say I have $i=1,\ldots,50$ people recording the results of me flipping a coin 20 times ($t=1,\ldots,20$). Let $y_{it}$ be person $i$'s recorded result of flip $t$. I have $20 \cdot 50 = 1000$ observations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My model is:&#xA;$$ y_{it} = \mu + \epsilon_{it}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I treat each $\epsilon_{it}$ as uncorrelated, I'm going to massively understate my standard errors. In reality, I have basically 20 independent observations, not 1,000. For each time $t$, the $\epsilon_{it}$ will be significantly correlated.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Basically the same thing happens with returns&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;For any time period $t$, returns ${R}_{it}$ are correlated. There's huge cross-sectional correlation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, you'd want to &lt;em&gt;cluster&lt;/em&gt; by &lt;em&gt;date&lt;/em&gt;. There are other methods of course to deal with cross-sectional correlation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same logic is behind:&#xA; - forming portfolios and using time-series variation in portfolio returns&#xA; - the Fama-Macbeth procedure of running $T$ cross-sectional correlations and taking the time-series average and standard deviation to compute estimates and standard errors.&lt;/p&gt;&#xA;" OwnerUserId="20582" LastActivityDate="2017-08-04T22:54:28.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35465" PostTypeId="1" CreationDate="2017-08-04T23:25:35.663" Score="9" ViewCount="1120" Body="&lt;p&gt;Fortunately, for obvious reasons, few applications require simulating asset returns over horizons in excess of 30 years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nevertheless, simulations over long horizons are sometimes conducted as part of the ALM process at defined-benefit pension funds. The purpose is to understand portfolio risk and compare alternatives by making an assessment of the probability of attaining a severely under-funded status.  The simulation of liabilities is based on actuarial models which carry a relatively high degree of confidence for long horizons. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The asset side is problematic.  For the sake of argument, assume that  investment is in the S&amp;amp;P 500 index and cash. Simple models like geometric Brownian motion result in excessively high dispersion of long-term returns and many &lt;strong&gt;&lt;em&gt;absurd&lt;/em&gt;&lt;/strong&gt; scenarios. This is at odds with historical evidence and what we believe is the likely volatility of future economic growth. Such simplistic models also ignore the propensity for central bank intervention through monetary policy which can induce faster drawdown recovery and (possibly) limit the formation of asset bubbles.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the S&amp;amp;P 500 index over the period 1927 - 2017, a reasonable estimate of the standard deviation of annualized returns is 19% over a 1-year horizon and 2%   over a 30-year horizon. Assuming independence of returns over non-overlapping periods as with a GBM model, the standard deviation for the 30-year period would be considerably higher at $19\% \, / \, \sqrt{30} \approx 4\%.$ This variance reduction is commonly cited in economic research papers that argue for long-term mean reversion of equity index returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We could try to fix this, for example, by imposing mean reversion in returns through AR- or ARMA-type models. Unfortunately, the desired variance reduction can only be achieved by choosing parameters that result in unrealistic and empirically unjustifiable levels of return autocorrelation -- for example, -0.5 autocorrelation of returns over non-overlapping annual periods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The better approach, I believe, is a regime-switching model where mean reversion is triggered in bubbles and crashes.  The question is what metric would be appropriate to define the regimes and what would be a reasonable model to incorporate the conditional mean reversion?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suggestions appreciated.   &lt;/p&gt;&#xA;" OwnerUserId="8153" LastEditorUserId="8153" LastEditDate="2017-08-05T00:00:28.150" LastActivityDate="2018-02-15T06:03:26.767" Title="Modeling Long-Term Mean Reversion in Asset Returns" Tags="&lt;equities&gt;&lt;stochastic-processes&gt;&lt;portfolio-management&gt;&lt;mean-reversion&gt;&lt;asset-returns&gt;" AnswerCount="5" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35466" PostTypeId="2" ParentId="35463" CreationDate="2017-08-05T04:18:39.127" Score="1" Body="&lt;p&gt;See this comment from the &lt;a href=&quot;https://en.wikipedia.org/wiki/Fixed_effects_model&quot; rel=&quot;nofollow noreferrer&quot;&gt;wiki&lt;/a&gt; page on fixed effects models:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In statistics, a fixed effects model is a statistical model in which the model parameters are fixed ... Such models assist in controlling for unobserved heterogeneity when this heterogeneity is &lt;strong&gt;constant over time&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Emphasis on the time constancy of unobserved heterogeneity is my own. Do you believe that the unobserved heterogeneity in mutual fund characteristics is constant over time? This could be a reasonable dimension on which less is more.&lt;/p&gt;&#xA;" OwnerUserId="26256" LastActivityDate="2017-08-05T04:18:39.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35467" PostTypeId="1" CreationDate="2017-08-05T07:19:23.243" Score="3" ViewCount="1210" Body="&lt;p&gt;I am trying to replicate the results in Consistent Pricing of FX Options, A. Castagna and F. Mercurio. However, when I calculate the strike prices for 25-delta put and call and ATM I cannot get the same result as in the article.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The parameters given in the article (p.5):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;T      = 94/365&lt;/li&gt;&#xA;&lt;li&gt;S      = 1.205&lt;/li&gt;&#xA;&lt;li&gt;s(ATM) = 0.0905&lt;/li&gt;&#xA;&lt;li&gt;s(RR)  = -0.0050&lt;/li&gt;&#xA;&lt;li&gt;s(BF)  = 0.0013&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;These result in s(25dPut) = 0.0943 and s(25dCall) = 0.0893 (equations 4 and 5 on pages 2 and 3).&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;K(25dPut)  = 1.1733&lt;/li&gt;&#xA;&lt;li&gt;K(25dCall) = 1.2487&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The values I get (equations 6 and 7 on p. 3) are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;K(25dPut)  = 1.16688287...&lt;/li&gt;&#xA;&lt;li&gt;K(25dCall) = 1.2421907...&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here is my Python code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;S       = 1.205&#xA;tau     = 94.0 / 365.0&#xA;iv_v    = 0.0905&#xA;rr_v    = -0.005&#xA;bf_v    = 0.0013&#xA;for_df  = 0.9902752&#xA;dom_df  = 0.9945049&#xA;&#xA;vol_call = iv_v + bf_v + 0.5 * rr_v&#xA;vol_put = iv_v + bf_v - 0.5 * rr_v&#xA;&#xA;alpha = - scipy.stats.norm.ppf( 0.25 * np.exp( (for_df**(-1) - 1) * tau) )&#xA;k1 = S * np.exp( - alpha * vol_put * np.sqrt(tau) + ((dom_df**(-1) - 1) - (for_df**(-1) - 1) + 0.5 * vol_put**(2) ) * tau )&#xA;k2 = S * np.exp( alpha * vol_call * np.sqrt(tau) + ((dom_df**(-1) - 1) - (for_df**(-1) - 1) + 0.5 * vol_call**(2) ) * tau )&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This code gives wrong results, but I cannot figure out where the error is.&lt;/p&gt;&#xA;" OwnerUserId="29077" LastEditorUserId="924" LastEditDate="2017-09-06T20:16:46.410" LastActivityDate="2019-04-30T03:03:45.707" Title="FX Option strikes from ATM, RR, BF quotes" Tags="&lt;options&gt;&lt;implied-volatility&gt;&lt;fx&gt;&lt;python&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35469" PostTypeId="2" ParentId="35146" CreationDate="2017-08-05T16:18:06.993" Score="2" Body="&lt;p&gt;From &lt;a href=&quot;http://qr.ae/TbcrXL&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://qr.ae/TbcrXL&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Phil Newton's answer:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Most modern charting packages can do this.&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;Meta trader.&lt;/li&gt;&#xA;  &lt;li&gt;Ninja trader.&lt;/li&gt;&#xA;  &lt;li&gt;Multi Charts.&lt;/li&gt;&#xA;  &lt;li&gt;Tradestation.&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Naoya Yamaguchi's answer:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;And Ninja trader is free. You can also program more indicators into it, using C#. This means a great collection of .NET assemblies, including Deep Learning assemblies like Accord, are available to you, too!&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2183" LastActivityDate="2017-08-05T16:18:06.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35471" PostTypeId="1" AcceptedAnswerId="35472" CreationDate="2017-08-05T17:52:48.537" Score="1" ViewCount="2415" Body="&lt;p&gt;According to Wikipedia, CVA is defined as  the difference between the risk-free portfolio value and the true portfolio value that takes into account the possibility of a counterparty’s default.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What does the 'risk-free portfolio value' mean? I guess it's similar to the risk premium (risky asset return - riskfree asset return), but can anyone provide an example of the risk-free portfolio value in the context of CVA?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="19237" LastEditorUserId="1809" LastEditDate="2017-08-06T03:42:37.640" LastActivityDate="2017-08-06T03:42:37.640" Title="What is CVA (credit valuation adjustment)?" Tags="&lt;risk&gt;&lt;risk-management&gt;&lt;derivatives&gt;&lt;cva&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35472" PostTypeId="2" ParentId="35471" CreationDate="2017-08-05T18:34:35.587" Score="2" Body="&lt;p&gt;If you have a portfolio of derivatives with a counterparty and this counterparty defaults before the trades mature, the net mark to market value of the portfolio will be calculated according to the master agreement and a close-out amount will be supposed to be paid by one party to the other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this portfolio has a positive mark to market value (from your point of view), you won't be able to recover the full amount in the insolvency proceedings, but rather only a part of it (determined by the recovery rate).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This means there's a probability that you incur a loss, due to counterparty credit risk. CVA is basically the (risk-neutral) expected value of this loss, or equivalently the price of hedging this risk in the market.&lt;/p&gt;&#xA;" OwnerUserId="29079" LastActivityDate="2017-08-05T18:34:35.587" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35473" PostTypeId="2" ParentId="35439" CreationDate="2017-08-05T20:28:46.873" Score="0" Body="&lt;p&gt;It never hurts to have additional tools at your disposal and I would therefore suggest learning quantstrat. Before you start hitting the books ask yourself: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Are you trying to enhance back testing by mitigating overfitting risk? &lt;/li&gt;&#xA;&lt;li&gt;Are you trying to build more complexity into the strategy itself by layering more signals? &lt;/li&gt;&#xA;&lt;li&gt;Do you want to generate extreme time series data replicating economic collapse and how your strategy would behave under those circumstances? &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The question you're asking is ambiguous in that regard. Depending on what you are trying to do, your approach would vary (i.e. to use quantstrat or not).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What aspect of your backtests are your trying to improve?&lt;/p&gt;&#xA;" OwnerUserId="28675" LastActivityDate="2017-08-05T20:28:46.873" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35474" PostTypeId="1" AcceptedAnswerId="35476" CreationDate="2017-08-05T20:49:42.223" Score="0" ViewCount="124" Body="&lt;p&gt;Currently running a fixed effect panel using STATA. First, I declare data set as panel:&#xA;Code: xtset id obs &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where id = 350 firms and obs = 125&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then I run a fixed effect regression:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Code: xtreg y x, fe &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The within r-squared of the fixed effect regression is 0.001&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, since I want to control for cross sectional dependence. I run the same regression but with time dummy:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;xtreg y x i.obs, fe&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The within r-squared increases dramatically to 0.25&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is why there is a significant increase in r-squared? Is the increase due to higher explanatory power after correcting for cross sectional dependence?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="28909" LastActivityDate="2017-08-06T20:46:10.767" Title="R-squared increase dramatically when including &quot;time dummy&quot; (STATA)" Tags="&lt;finance&gt;&lt;regression&gt;&lt;econometrics&gt;&lt;paneldata&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35475" PostTypeId="2" ParentId="22692" CreationDate="2017-08-05T23:57:13.217" Score="0" Body="&lt;p&gt;Here's one solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For this example I will use the &lt;a href=&quot;https://stat.ethz.ch/R-manual/R-devel/library/datasets/html/austres.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;ausres data set&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;df &amp;lt;- data.frame(time=time(austres), Value = as.matrix(austres))&#xA;df$Quarter &amp;lt;- ifelse(df$time - floor(df$time) == 0, 'Q1',&#xA;          ifelse(df$time - floor(df$time) == 0.25, 'Q2',&#xA;          ifelse(df$time - floor(df$time) == 0.5, 'Q3',&#xA;          ifelse(df$time - floor(df$time) == 0.75, 'Q4',''))))&#xA;&#xA;df$NewData &amp;lt;- ifelse(df$Quarter == 'Q4', df$Value*1.15, df$Value)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;First line, convert your time series to a data frame. Then associate each ts to corresponding quarter. Last line you'll want to transform Q4 based on whatever you want to do. In this case I am increasing Q4 by 15%. If you need to transform the data frame back to a time series you can always do that since the first column is preserved.&lt;/p&gt;&#xA;" OwnerUserId="28675" LastActivityDate="2017-08-05T23:57:13.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35476" PostTypeId="2" ParentId="35474" CreationDate="2017-08-06T00:25:21.847" Score="2" Body="&lt;p&gt;It means that about 25 percent of your within firm variation (i.e. the variation of a firm over time) is explained by your time-series dummies &lt;code&gt;i.obs&lt;/code&gt; which pickup the period by period cross-sectional mean.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To phrase it another way, about 25 percent of a firm's variation in $y_{it}$ over time is explained by variation in the aggregate $\bar{y}_t$.&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-08-06T20:46:10.767" LastActivityDate="2017-08-06T20:46:10.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35477" PostTypeId="1" CreationDate="2017-08-06T00:32:34.597" Score="2" ViewCount="967" Body="&lt;p&gt;I want to generate a table of ETFs listed in the US and declared benchmarks. The idea is that I want to have the possibility to use the benchmark as a proxy of the ETF to run longer backtests when appropriate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Among cheap data vendors, there is a nice table provided by ETF Global on &lt;a href=&quot;https://www.quandl.com/databases/ETFI?filterSelection=all&amp;amp;keyword=&quot; rel=&quot;nofollow noreferrer&quot;&gt;Quandl&lt;/a&gt; that does the job. However, there is no ISIN or SEDOL for the ETFs and no identifiers for the benchmark, making not possible to automatically download the corresponding total return time series from Thomson Reuters or Bloomberg afterwards.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've spent hours with Eikon, Datastream and chatting with the support to create this table using Thomson Reuters data, but many benchmarks are wrong or missing. I do not have access to Bloomberg.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Question: is it possible to retrieve such table from Bloomberg or Thomson Reuters?&lt;/p&gt;&#xA;" OwnerUserId="22202" LastEditorUserId="22202" LastEditDate="2017-08-06T10:43:16.703" LastActivityDate="2017-08-10T09:20:23.800" Title="Database of ETF and underlying index from Thomson Reuters or Bloomberg" Tags="&lt;data&gt;&lt;bloomberg&gt;&lt;etf&gt;&lt;reuters&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35478" PostTypeId="1" AcceptedAnswerId="35479" CreationDate="2017-08-06T02:06:12.030" Score="1" ViewCount="1180" Body="&lt;p&gt;I read that since stock prices are non-stationary it does not make sense to take their covariance. So I took the log returns of stocks, computed covariance matrix, took the top few eigen vectors that explain maximum variance and instead of projecting the returns I projected the log prices on these vectors. Is there anything wrong with this approach? python code below:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;logprices = numpy.log(prices)&lt;/p&gt;&#xA;&lt;p&gt;logreturns = numpy.diff(logprices, axis=0)&lt;/p&gt;&#xA;&lt;p&gt;cov = EmpiricalCovariance().fit(logreturns).covariance_&lt;/p&gt;&#xA;&lt;p&gt;eigenvalues, eigenvectors = numpy.linalg.eigh(cov)&lt;/p&gt;&#xA;&lt;p&gt;components = eigenvectors[:, :5] # top 5 eigen vectors&lt;/p&gt;&#xA;&lt;p&gt;sources = numpy.dot(logprices, components)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="12202" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2017-08-06T08:16:38.367" Title="principal component analysis on non stationary data" Tags="&lt;time-series&gt;&lt;pca&gt;&lt;covariance-matrix&gt;&lt;stationarity&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35479" PostTypeId="2" ParentId="35478" CreationDate="2017-08-06T08:16:38.367" Score="1" Body="&lt;p&gt;You may know that they are two definitions of &lt;strong&gt;stationary&lt;/strong&gt; (see for instance &lt;a href=&quot;http://rads.stackoverflow.com/amzn/click/0387962638&quot; rel=&quot;nofollow noreferrer&quot;&gt;Series of Irregular Observations: Forecasting and Model Building&lt;/a&gt;; this book probably contains all you need to model timeseries, and it is now new):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;strongly stationary&lt;/strong&gt; means each time you have an observation (for you an &lt;em&gt;observation&lt;/em&gt; is a vector of returns of dimension you number of stocks) it is drawn from the &lt;strong&gt;same distribution&lt;/strong&gt;;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;weakly stationary&lt;/strong&gt; means each time how have an observation, it is drawn from a distribution that has the same expectation (i.e. mean) and variance (i.e. here covariance matrix).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you believe mixing your observation to obtain a covariance matrix and make his PCA, what would you need ?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a first answer is you need your observations to be &lt;em&gt;weakly stationary&lt;/em&gt; to be able to even speak about their covariance matrix, no?&lt;/li&gt;&#xA;&lt;li&gt;but you can &lt;em&gt;relax&lt;/em&gt; it and say you only need the eigenvectors and eigenvalues you will keep to be strongly stationary. You will need the &lt;em&gt;beta&lt;/em&gt;s of the stocks with respects to these components to be &quot;&lt;em&gt;stable&lt;/em&gt;&quot;, say constant.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The second option is another model, it is in fact a factor model. It states the returns $R_k$ of the $k$th stock is equal to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R_k = \beta_k F_k + \epsilon_k,$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\epsilon_k$ is no more stationary... You will for sure need its variance to be far lower than the one of $\beta_k F_k$ to be able to identify the &lt;em&gt;factors&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As usual in statistics, all is matter of &lt;strong&gt;model choice&lt;/strong&gt;. You need to be aware of your choices, use estimators that are compatible with them (imagine for instance your random vector of $\epsilon_k$ is somehow &quot;synchronized&quot; to drive $R_k$ towards highly negative values during months, and then switches them to positive values... you will need an ad hoc estimator). And at the end of the process, you will need to check all the parameters you obtain are compatible with your initial hypothesis.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2017-08-06T08:16:38.367" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35484" PostTypeId="2" ParentId="35465" CreationDate="2017-08-07T02:29:15.307" Score="4" Body="&lt;p&gt;One &lt;strong&gt;&lt;em&gt;economic&lt;/em&gt;&lt;/strong&gt; model you could look at is the Habit model of Campbell and Cochrane (1999). The basic idea is that as the consumption of the representative investor approaches the (appropriately defined) habit level of consumption the representative investors risk aversion spikes: this means discount rates increase dramatically and we see a big drop in stock prices. Discount rates recover after this shock and so do the stock prices. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want a purely statistical model you can see how Lu Zhang (2005,JF) writes down a statistical process for the stochastic discount factor that gives us this kind of a stock return process. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;x_{t+1} = \bar{x}\left(1-\rho_x\right) + \rho_x x_t + \sigma_x\varepsilon_{t+1}^x&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;M_{t+1} = \beta^{\left(\gamma_0 + \gamma_1\left(x_t-\bar{x}\right)\right)\left(x_t-x_{t+1}\right)}&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here $\gamma_0&amp;gt;0$, and $\gamma_1&amp;lt;0$, (usually 50,-1000). Think of x like consumption, M is the discount factor process (i.e. how much do we discount future cash flows on equity), and notice the asymmetric response of risk aversion to changes in consumption above and below the mean. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is not tested but might help you get an idea. &lt;/p&gt;&#xA;" OwnerUserId="26256" LastActivityDate="2017-08-07T02:29:15.307" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35487" PostTypeId="2" ParentId="35459" CreationDate="2017-08-07T07:30:54.343" Score="1" Body="&lt;p&gt;In practice, a futures contract can be seen as a &lt;em&gt;margined&lt;/em&gt; forward contract. More specifically, futures are marked to the market at the end of each business day by accounting for the change in value of an associated &lt;em&gt;futures price&lt;/em&gt; process $(\mathcal{F}(t,T))_{t \in [0,T]}$ verifying $\mathcal{F}(T,T)=S_T$. This MtM variation is &lt;em&gt;settled&lt;/em&gt; each day by the exchange by crediting/debiting the holder's margin account. This daily margining means that the value of the futures contract is effectively reset to zero each day.\&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we were to model this in continuous time, we should therefore &lt;em&gt;interpret&lt;/em&gt; a futures contract as a financial instrument &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;which can be entered (or unwinded) at zero cost at any time such that its $t$-value $V_t \equiv 0, \forall t$ &lt;/li&gt;&#xA;&lt;li&gt;paying a cash dividend $dD_t = \mathcal{F}(t+dt,T)-\mathcal{F}(t,T)$ over each infinitesimal period $[t,t+dt[$ where $\mathcal{F}(t,T)$ figures the &lt;em&gt;future price process&lt;/em&gt; of maturity $T$ and $D_t$ the cumulated dividend process.&lt;/li&gt;&#xA;&lt;li&gt;such that the future price process should verify $\mathcal{F}(T,T) = S_T$ almost surely.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;REM: In these definitions, it is crucial not to confuse the &lt;em&gt;value&lt;/em&gt; of a futures contract, which is zero by definition, with the futures &lt;em&gt;price&lt;/em&gt; which is not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For any dividend-paying asset $V_t$, it is well-known that the self financing strategy consists in fully reinvesting all contributions of its dividend process $D_t$, so that overall there are no exogenous cash withdrawal or infusion as time passes. This leads to the following &lt;em&gt;self-financing portfolio wealth evolution&lt;/em&gt; starting from $X_0=0$&#xA;    \begin{align*}&#xA;	dX_t &amp;amp;= dV_t + (X_t - V_t) r dt + dD_t &#xA;	\end{align*} &#xA;and arbitrage free pricing theory tells us that any self-financing strategy, here $X_t$, should be a martingale under the risk-neutral measure $\Bbb{Q}$ associated to the money market account $B_t$ numéraire. Here, this suggests that $B_t^{-1}X_t$ should be a $\Bbb{Q}$-martingale. Now, &#xA;    \begin{align}&#xA;	d(B_t^{-1} X_t) &amp;amp;= B_t^{-1} \left( dX_t + X_t r dt \right) \\&#xA;	&amp;amp;= B_t^{-1} \left( dV_t + dD_t - rV_t dt \right) \\&#xA;	&amp;amp;= B_t^{-1} \left( B_t(d(B_t^{-1}V_t)) + dD_t \right) \\&#xA;	&amp;amp;= d(B_t^{-1}V_t) + B_t^{-1} dD_t&#xA;	\end{align}&#xA;    such that &#xA;    \begin{equation}&#xA;	B_t^{-1} X_t = B_t^{-1} V_t + \int_0^t B_s^{-1} dD_s &#xA;	\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For futures, $V_t \equiv 0$ and the $\Bbb{Q}$-martingale property can further be written as&#xA;$$ \Bbb{E}^\Bbb{Q}_0 \left[ B_t^{-1} X_t \right] = B_0^{-1} X_0 = 0 $$&#xA;hence&#xA;    $$ \Bbb{E}^\Bbb{Q}_0 \left[ \int_0^t B_s^{-1} dD_s \right] =  \Bbb{E}^\Bbb{Q}_0 \left[ \int_0^t B_s^{-1} d\mathcal{F}(s,T) \right] = 0 $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which, assuming some light conditions on the adaptability and regularity of $(B_s)_{t \geq 0}$, is verified if the &lt;em&gt;future price&lt;/em&gt; process $\mathcal{F}(t,T)$ itself emerges as a $\Bbb{Q}$-martingale (Itô integral), which along with the terminal condition mentioned earlier gives us&#xA;    $$ \mathcal{F}(t,T) = \Bbb{E}^\Bbb{Q}_t \left[ F(T,T) \right] = \Bbb{E}^\Bbb{Q}_t \left[ S_T \right] $$&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2017-08-07T07:30:54.343" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="35488" PostTypeId="1" CreationDate="2017-08-07T08:50:24.837" Score="0" ViewCount="135" Body="&lt;p&gt;Suppose someone is doing some daily trading and tells you their annualised sharpe ratios for the following years:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;2004: 0.7&#xA;2005: 1.2&#xA;2006: 1.1&#xA;2007: -0.2&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is it possible to get the annualised Sharpe ratio for the period 2004-2007? And if so, how? &lt;/p&gt;&#xA;" OwnerUserId="29090" LastActivityDate="2017-08-08T07:25:41.990" Title="If you have the (annualised) Sharpe ratios for some individual years, can you get the overall Sharpe ratio?" Tags="&lt;sharpe-ratio&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35489" PostTypeId="2" ParentId="35488" CreationDate="2017-08-07T09:36:09.650" Score="2" Body="&lt;p&gt;No, in general you can't combine Sharpe ratios in this way.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the special case that the volatility is the same in each year, and the returns aren't too pathological, then the aggregate Sharpe ratio will be close to the average of the Sharpe ratios for each year, i.e. in your case it would be (0.7 + 1.2 + 1.1 - 0.2) / 4 = 0.7.&lt;/p&gt;&#xA;" OwnerUserId="924" LastEditorUserId="924" LastEditDate="2017-08-07T09:42:13.733" LastActivityDate="2017-08-07T09:42:13.733" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35490" PostTypeId="2" ParentId="35146" CreationDate="2017-08-07T09:54:09.477" Score="1" Body="&lt;p&gt;I did the search by myself some time ago and couldn't find much that is readily available (in the sense that you can directly use it in a Python program, say). The closest I found find is the following library:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.ta-lib.org/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;TA-Lib : Technical Analysis Library&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's a bit dated, however, with the latest release being published in 2007.&lt;/p&gt;&#xA;" OwnerUserId="20336" LastActivityDate="2017-08-07T09:54:09.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35494" PostTypeId="1" CreationDate="2017-08-07T14:05:15.283" Score="-1" ViewCount="275" Body="&lt;p&gt;A one year bond of principle 100, coupon 6% with half year paying  and yield 11%. Suppose the beginning day of bond is 1.1 and today is 3.1, then I want to ask that, the price&#xA;$$c = \dfrac{3}{e^{0.11 * 0.25}} + \dfrac{103}{e^{0.11 * 0.75}}$$&#xA;is the dirty price or clean price?&lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-08-07T16:39:49.750" Title="This is the dirty price or clean price" Tags="&lt;bond&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35495" PostTypeId="2" ParentId="35407" CreationDate="2017-08-07T14:39:04.703" Score="0" Body="&lt;p&gt;&lt;a href=&quot;https://www.law.columbia.edu/sites/default/files/document-library/clsbsbdl_document/files/regulation_s_selling_and_transfer_restrictions.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Regulation S Selling and Transfer Restrictions:&#xA;A Basic User’s Guide&lt;/a&gt;&#xA;Pretty good discussion.  &lt;/p&gt;&#xA;" OwnerUserId="12142" LastActivityDate="2017-08-07T14:39:04.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35497" PostTypeId="1" AcceptedAnswerId="35501" CreationDate="2017-08-07T16:36:23.280" Score="1" ViewCount="967" Body="&lt;p&gt;I am looking for the interpretation which distinguishes between average return and cumulative return.&lt;br&gt;&#xA;I have two portfolios : the average return of portfolio 2 = 3 10E-4 per day while the average return of portfolio 4 = 4.21 10E-4 .. portfolio 4 outperforms portfolio 2.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I graph the cumulative returns of the two portfolios, it's clear that portfolio 2 exceeds portfolio 4.&lt;br&gt;&#xA;  I would be grateful if you could help me to understand and interpret the following graphic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/BZTuV.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/BZTuV.png&quot; alt=&quot;Cumulative returns&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="17810" LastEditorUserId="16148" LastEditDate="2017-08-07T17:15:11.760" LastActivityDate="2017-08-07T20:48:38.970" Title="average return Vs cumulative return interpretation" Tags="&lt;returns&gt;&lt;performance-evaluation&gt;&lt;portfolio-selection&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35498" PostTypeId="1" CreationDate="2017-08-07T16:38:19.427" Score="1" ViewCount="4342" Body="&lt;p&gt;I'm trying to optimize a portfolio using cvxpy. My original construction is the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;w = Variable(n)&#xA;ret = mu.T * w&#xA;risk = quad_form(w, Sigma)&#xA;prob = Problem(Maximize(ret), [risk &amp;lt;= .01])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which is just maximize return under some risk constraint. However, I would like to also have a weights/leverage constraint, like the following:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;prob = Problem(Maximize(ret), [risk &amp;lt;= .01, sum(abs(w)) &amp;lt;= 1.0])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I add this constraint in many of my weights go to zero and the optimal portfolio is just concentrated in 2-3 assets. This is different from the case without this constraint which results in a much more diversified portfolio. I'm a little confused as to why the weights constraint causes this. Does anyone have any insight?&lt;/p&gt;&#xA;" OwnerUserId="16680" LastActivityDate="2020-06-26T01:01:53.497" Title="portfolio optimization with weights constraint in python" Tags="&lt;optimization&gt;&lt;portfolio-optimization&gt;&lt;python&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35499" PostTypeId="2" ParentId="35494" CreationDate="2017-08-07T16:39:49.750" Score="0" Body="&lt;p&gt;It is the dirty price, since it includes accrued interest, as represented by the first part of the equation.&lt;/p&gt;&#xA;" OwnerUserId="28989" LastActivityDate="2017-08-07T16:39:49.750" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35500" PostTypeId="2" ParentId="35467" CreationDate="2017-08-07T20:00:04.847" Score="1" Body="&lt;p&gt;The interest rates (calculated from discount factors) you are using are wrong. Correct formulas:&#xA;$r_{dom}$ = $-\frac{log(dom_{df})}{T}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r_{for}$ = $-\frac{log(for_{df})}{T}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;alpha = - scipy.stats.norm.ppf( 0.25 * np.exp( for_df**(-1) )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;k1 = S * np.exp( - alpha * vol_put * np.sqrt(tau) + ($r_{dom}$ - $r_{for}$ + 0.5 * vol_put**(2) ) * tau )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;k2 = S * np.exp( alpha * vol_call * np.sqrt(tau) + ($r_{dom}$ - $r_{for}$ + 0.5 * vol_call**(2) ) * tau )&lt;/p&gt;&#xA;" OwnerUserId="29097" LastActivityDate="2017-08-07T20:00:04.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35501" PostTypeId="2" ParentId="35497" CreationDate="2017-08-07T20:48:38.970" Score="5" Body="&lt;p&gt;Consider these two simple portfolios:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Portfolio 1 returns -10% in month 1 and 10% in month 2. Average arithmetic return is zero, and cumulative return is $(1-10\%)(1+10\%)=0.99$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Portfolio 2 returns -50% in month 2 and 50% in month 2. Average arithmetic return is still zero, but cumulative return is $(1-50\%)(1+50\%)=0.75$, a much lower terminal value!&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In general, arithmetic return and geometrically compounded return are linked as follows:&#xA;$$ \text{annualized geometric return} \approx \text{annualized arithmetic return} - \frac{\sigma^2}{2}, $$&#xA;where $\sigma$ is volatility. The more volatile a return stream is, the less cumulative compounding effect you get (all else equal).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, one return stream has higher average arithmetic return than the other, but it likely is more volatile, resulting in less cumulative compounding over time.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2017-08-07T20:48:38.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35502" PostTypeId="1" AcceptedAnswerId="35503" CreationDate="2017-08-07T23:22:35.840" Score="-1" ViewCount="509" Body="&lt;p&gt;I am evaluating the performance of a sample of 1000 mutual funds over the period 2000 to 2017 using Carhart (1997) four factor model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a way to test for robustness, I use two benchmarks. The CRSP total market index (from Dr Kenneth French website) and Wilshire 5000. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I ran individual time series regressions for all 1000 funds. Then I cross-sectionally average the coefficients to get a sense of how my sample performs on aggregate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I use CRSP market index as a benchmark, I get a momentum coefficient of -0.06. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when I use Wilshire 5000 as a benchmark, I get a momentum coefficient of -0.01. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both coefficients are statistically different from 0. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, what could be a reason why momentum differs significantly when I change the benchmark?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you. &lt;/p&gt;&#xA;" OwnerUserId="28909" LastActivityDate="2017-10-07T02:14:40.990" Title="Carhart (1997) momentum factor loading" Tags="&lt;finance&gt;&lt;regression&gt;&lt;asset-pricing&gt;&lt;econometrics&gt;&lt;fama-french&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="35503" PostTypeId="2" ParentId="35502" CreationDate="2017-08-08T01:34:51.540" Score="0" Body="&lt;p&gt;See this wiki &lt;a href=&quot;https://en.wikipedia.org/wiki/Frisch%E2%80%93Waugh%E2%80%93Lovell_theorem&quot; rel=&quot;nofollow noreferrer&quot;&gt;Frisch-Waugh-Lovell Theorem&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and it will explain how to interpret multiple regression coefficients from a regression of the form&#xA;\begin{equation}&#xA;Y = X_1 \beta_1 + X_2 \beta_2 + u&#xA;\end{equation} as capturing the relationship between some variable $X_2$ and $Y$ after the relationship between $X_2$ and $X_1$  and the relationship between $Y$ and $X_1$ has been removed (we only consider residual correlation after controlling for other variables).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Imagine now that you have a regression where you change $X_1$ from your CRSP index to the Wilshire 5000 as you keep $X_2$ as your momentum index - the change must come from co-variation of these indices with returns or momentum. &lt;/p&gt;&#xA;" OwnerUserId="26256" LastActivityDate="2017-08-08T01:34:51.540" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35504" PostTypeId="2" ParentId="35412" CreationDate="2017-08-08T03:09:53.070" Score="2" Body="&lt;p&gt;In high-frequency energy trading, it's possible for a trader to have hundreds of orders in the book, possibly on more than one exchange, e.g. ICE and NYMEX. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A trader may be running dozens of algorithms simultaneously. Each of these may respond independently to the changes it detects in the market data, as well as to the timing and fill data from its own execution reports. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In some situations, a sudden price change in an influential futures market may require the modification of order prices on both sides of the market over dozens of delivery periods. And then of course there are spreads, butterflies and other futures strategies that link the prices of their legs. Orders in these instruments may also have to be adjusted. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's important to realize that even within an exchange, instruments related in the economic sense are not necessarily traded on the same match engine, and that execution reports (to individual traders) travel along different paths than market data (published generically to all subscribers). A multi-product strategy must take this into account. NYMEX and ICE also trade financially-settled equivalents to each other's physically settled contracts, and these take time to change as well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Algorithms vary in terms of how much data they require in order to detect and act on a price change. The algorithm operators can also run them differently on days when the market is expected to be volatile, e.g. with thresholds that reduce the risk of a misplaced execution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Even a trader with black boxes co-located at the exchanges still needs time to transmit the necessary cancel/replace messages, especially since other traders will be attempting to do the same thing. A mispricing in a set of linked markets can therefore exist for several milliseconds, and in some cases as much as &lt;strong&gt;several hundred milliseconds,&lt;/strong&gt;  i.e. the time needed for the majority of algorithmic participants to update their local book states and begin waiting for the next triggering event. &lt;/p&gt;&#xA;" OwnerUserId="28802" LastActivityDate="2017-08-08T03:09:53.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35506" PostTypeId="2" ParentId="4599" CreationDate="2017-08-08T04:22:29.580" Score="0" Body="&lt;p&gt;The risk of losing the premium and on the short position is a possible scenario. &#xA;Suppose you didn't short the underlying then you have a different worst case scenario. Shorting the underlying only changed these scenarios and the probability of these scenarios happening. There is always some risk associated with every portfolio and as a trader you can choose which scenario or which exposures you are willing to take.&lt;/p&gt;&#xA;" OwnerUserId="29101" LastActivityDate="2017-08-08T04:22:29.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35507" PostTypeId="1" CreationDate="2017-08-08T05:37:48.267" Score="0" ViewCount="51" Body="&lt;p&gt;I am new to this forum and hope for some help. I have a dataset of returns. I cannot tell where these come from, but let's assume they come from a trading algorithm of stock prices. The returns are measured weekly and represent a portfolio of different stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Changing some parameters (when to buy and when to sell) in the algorithm will &quot;randomly&quot; change the returns. I would call this random because I change the parameters until the overall return at the end of the year becomes maximum. But when positive and negative weekly returns are generated will be completely random to the parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, after having found the optimum, I test the weekly returns for significance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I have some questions to this procedure:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) The most important questions is: Is it ok to fit the parameters until I find [both,] the highest yearly return [that result from statistical significant weekly returns]? Is the procedure of finding a significant weekly return ok? If not, what else could I do?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) What is the typical method of testing (weekly) returns? My guess was regressing the weekly return against its constant and testing for significance. Another idea is that I would create a bankroll and a time variable. So I can test if the growth of the bankroll is significantly increasing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would be glad if you could help me and link some journal articles that explain the field of returns more in detail. Thank you very much!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;UPDATE, in order to clarify my problem a little more:&#xA;The procedure is that I first vary some parameters. This will lead to different yearly returns. My variable of interest ist the weekly return. This will also vary with a change in the parameters. Then I change my parameters such that the yearly return becomes maximum. Then I run a regression on the weekly returns against their constants. The problem here is that the weekly returns from one stock are r=random[-1,x], where x &gt; 0. So they are either -1 or x. &#xA;Next I combine either the weekly returns of two different stocks into a portfolio or I combine two consecutive weeks. Value of -1 are now only the exceptions. The new portfolio will return weekly a value of p=random[y] where y can be any rational number. &#xA;After this, I run tests on this weekly portfolio return. Note that I do only try to optimize the yearly return. And I stabilize variance of the weekly return by putting them into &quot;pseudo&quot; random portfolio. Note that the weekly returns can be interpreted as time series, but they are not really finacial time series. This is because the return don't come from stocks. I just assumed this to illustrate the case. So problems with time varying variance should not occur. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS: I already asked this question in statsexchange but did not receive an answer.&lt;/p&gt;&#xA;" OwnerUserId="29104" LastEditorUserId="29104" LastEditDate="2017-08-08T06:46:51.267" LastActivityDate="2017-08-08T06:46:51.267" Title="Is my data fittet to be significant?" Tags="&lt;time-series&gt;&lt;regression&gt;&lt;return&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35508" PostTypeId="2" ParentId="35507" CreationDate="2017-08-08T06:00:36.437" Score="4" Body="&lt;p&gt;The question you ask is in fact about what people in machine learning call &lt;strong&gt;&lt;a href=&quot;https://en.m.wikipedia.org/wiki/Overfitting&quot; rel=&quot;nofollow noreferrer&quot;&gt;overfitting&lt;/a&gt;&lt;/strong&gt;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the more you choose your &quot;&lt;em&gt;metaparameters&lt;/em&gt;&quot; to provide high returns on your sample of days&lt;/li&gt;&#xA;&lt;li&gt;the less you can trust them to reproduce out of this sample.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;There is not a lot you can do to prevent this except read a lot to understand overfitting and be very careful. Two main directions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;for data scientists: read &lt;a href=&quot;http://eu.wiley.com/WileyCDA/WileyTitle/productCd-0471030031.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Vapnik's book&lt;/a&gt;: you will learn here the effect of nonlinearity on overfitting.&lt;/li&gt;&#xA;&lt;li&gt;for an exconometric approach, read &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2249314&quot; rel=&quot;nofollow noreferrer&quot;&gt;Harvey's paper&lt;/a&gt;: you will learn how test a lot of simple models can be enough to overfit your data.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2017-08-08T06:00:36.437" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35509" PostTypeId="1" CreationDate="2017-08-08T07:18:22.533" Score="1" ViewCount="249" Body="&lt;p&gt;The CIR model states $dr=\kappa(\theta-r)dt+\sigma dW$ and the corresponding bond pricing equation can be derived from the general equilibrium approach. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The equation is: $\frac{1}{2}\sigma^2rP_{rr}+[\kappa(\theta-r)-\lambda r]P_r-rP=P_{\tau} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\lambda$ is the factor of risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the derivation of the corresponding stochastic discount factor and pricing kernel of CIR model?&lt;/p&gt;&#xA;" OwnerUserId="26649" LastActivityDate="2017-10-08T01:22:16.603" Title="Stochastic Discount Factor of CIR bond pricing model" Tags="&lt;bond&gt;&lt;stochastic-discount&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35510" PostTypeId="2" ParentId="35488" CreationDate="2017-08-08T07:25:41.990" Score="2" Body="&lt;p&gt;Consider the simplest case possible: 2 periods with independent log-returns and zero risk-free rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then write that the log-return over the full period $x$ is the sum of the individual log-returns over each sub-period: $x = x_1+x_2$. Also, the overall sharpe ratio is by definition&#xA;$$ s = \frac{\Bbb{E}[x]}{\sqrt{\text{Var}[x]}} $$&#xA;Under our assumptions it can further be expressed as&#xA;$$s = \frac{\mu_1+\mu_2}{\sqrt{\sigma_1^2+\sigma_2^2}} =  \frac{\mu_1+\mu_2}{\sqrt{s_1^2 \mu_1^2 + s_2^2\mu_2^2}}$$&#xA;showing that, even in the simplest case possible, you cannot compute $s$ from the sole knowledge of the individual Sharpe ratios $s_1$ and $s_2$.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2017-08-08T07:25:41.990" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35513" PostTypeId="1" AcceptedAnswerId="35516" CreationDate="2017-08-08T09:53:42.920" Score="9" ViewCount="1926" Body="&lt;p&gt;Apologies if this question is vague, I've gone over how to word it several times in my head, and I'm not sure it gets clearer each time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've been looking at this website article &lt;a href=&quot;https://www.quantstart.com/articles/Basics-of-Statistical-Mean-Reversion-Testing&quot; rel=&quot;noreferrer&quot;&gt;https://www.quantstart.com/articles/Basics-of-Statistical-Mean-Reversion-Testing&lt;/a&gt; and have been investigating the code for the Hurst exponent in Python. The article gives a code snippet of Python as follows (to calculate Hurst):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def hurst(ts):&#xA;    &quot;&quot;&quot;Returns the Hurst Exponent of the time series vector ts&quot;&quot;&quot;&#xA;    # Create the range of lag values&#xA;    lags = range(2, 100)&#xA;&#xA;    # Calculate the array of the variances of the lagged differences&#xA;    tau = [sqrt(std(subtract(ts[lag:], ts[:-lag]))) for lag in lags]&#xA;&#xA;    # Use a linear fit to estimate the Hurst Exponent&#xA;    poly = polyfit(log(lags), log(tau), 1)&#xA;&#xA;    # Return the Hurst exponent from the polyfit output&#xA;    return poly[0]*2.0&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Which works great, but because of my annoying personality where I need to understand something before I use it, I've been driving myself nuts for a day and a half trying to understand how this code has been developed/derived (especially the sqrt(std) part). The article itself does have some brief steps, but I'm not able to follow them. It may be that I don't quite understand the &amp;lt;| ..... |&gt; notation means and how it can relate to standard deviation. Attached here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/aDisI.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/aDisI.png&quot; alt=&quot;Hurst equations&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone provide a link to an article, website or paper that shows from what principles this calculation could have been derived? From Racine's paper I'm aware that Hurst's original method was the RS method, but I believe the method used in the code is from the generalized Hurst exponent or Standard method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My mathematics isn't at pHd level, but I do have an Engineering degree, so it's not totally useless either. What I am having a huge problem understanding is why the code uses the square root of standard deviation, so if anyone could shed some light on that, it would be greatly appreciated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your time, apologies again if this isn't totally clear.&lt;/p&gt;&#xA;" OwnerUserId="29107" LastEditorUserId="743" LastEditDate="2018-02-25T22:16:20.210" LastActivityDate="2019-07-16T09:16:41.487" Title="Explanation of Standard Method Generalized Hurst Exponent" Tags="&lt;quant-trading-strategies&gt;&lt;python&gt;&lt;hurst-exponent&gt;" AnswerCount="4" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="35514" PostTypeId="1" AcceptedAnswerId="35519" CreationDate="2017-08-08T11:17:54.330" Score="1" ViewCount="816" Body="&lt;p&gt;What's the intuition behind the fact that the limit of $\mathcal{N}(d_2)$, i.e. the (risk-neutral) probability of exercise, in the Black-Scholes Model tends to $0$ when the volatility tends to infinity?&lt;/p&gt;&#xA;" OwnerUserId="29110" LastEditorUserId="20454" LastEditDate="2017-08-08T11:29:40.880" LastActivityDate="2020-08-19T12:11:19.637" Title="Probability of exercise in the Black-Scholes Model" Tags="&lt;option-pricing&gt;&lt;volatility&gt;&lt;black-scholes&gt;&lt;probability&gt;&lt;risk-neutral-measure&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35515" PostTypeId="2" ParentId="35513" CreationDate="2017-08-08T11:38:09.947" Score="1" Body="&lt;p&gt;I fail to understand how this code works too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the past, I have used this &lt;a href=&quot;https://www.mathworks.com/matlabcentral/fileexchange/30076-generalized-hurst-exponent&quot; rel=&quot;nofollow noreferrer&quot;&gt;matlab implementation&lt;/a&gt; for the generalized hurst exponent calculation and it was quite reliable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recently someone has translated this into &lt;a href=&quot;https://github.com/PTRRupprecht/GenHurst/blob/master/genhurst.py&quot; rel=&quot;nofollow noreferrer&quot;&gt;python&lt;/a&gt;, but I haven't tested this yet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope that helps.&lt;/p&gt;&#xA;" OwnerUserId="22383" LastActivityDate="2017-08-08T11:38:09.947" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35516" PostTypeId="2" ParentId="35513" CreationDate="2017-08-08T11:41:56.360" Score="2" Body="&lt;p&gt;I am unaware of the notation in this case but I am still trying to make sense of it. (maybe someone can jump in with an edit?) Here's what I have got:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is the notion of quadratic variation out there that could apply here. You can also think about it as a scalar product (which is the same). &#xA;You can see that the notation here is rather sloppy, because $\text{log}(t)$ denotes the log price process at time $t$.&#xA;For discrete points in time, you can interpret it as the vector of log prices at the times $t_i$ and treat the bracket as a scalar product (now denoting $\log(t+\tau)$ and $\log(t)$ as a vector):&#xA;$$&#xA;\langle (\text{log}(t+\tau)-\text{log}(t))^2\rangle \approx \langle \text{log}(t+\tau)-\text{log}(t),\text{log}(t+\tau)-\text{log}(t)\rangle&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I try to switch to a more precise notation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $t_i, i = 1,\ldots,T$ be the discrete timestamps and $P_i$ the price at $t_i$. Then the term above means the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \left(\sum_{i=1}^{T-\tau} (\log(P_{i+\tau})-\log(P_i))^2\right)^{1/2}. $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now to determine the hurst exponent $H$, we say that this is approximately $\tau^{2H}$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \left(\sum_{i=1}^{T-\tau} (\log(P_{i+\tau})-\log(P_i))^2\right)^{1/2} \approx \tau^{2H}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;taking the logarithm on &lt;em&gt;both sides&lt;/em&gt; gives:&#xA;$$&#xA;\log(\ldots) \approx 2H \log(\tau)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what the algorithmdoes is, take 99 values for $\tau$ and calculate the quadratic variation of the lagged differences. Then regress those onto $\tau$ to get an approximation for $2H$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if we come back to the code: I dont know what the polyfit function does but I assume it performs a polynomial regression with the degree as a parameter. What I dont get is the last line where the result is multiplied by two but you should be able to verify this if you clarify the function output (what is regressed on what, what coefficients are saved where).&lt;/p&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2017-08-08T11:41:56.360" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="35517" PostTypeId="1" CreationDate="2017-08-08T12:16:28.620" Score="1" ViewCount="136" Body="&lt;p&gt;The market consist of one single stock and call options with different strike price based on the given stock.Suppose the market believes the stock follows the following GBM:$$dS_t=\mu S_tdt+\sigma S_tdW_t$$ and a trader believe that the actual volatility should be $\sigma' $. Suppose all price is given according to the black-scholes-framework. I wish to find an optimal strategy by maximizing the exponential utility:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My approach:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the return of the stock and call option can be computed by using $\sigma $ for the current price and payoff by using the $\sigma '$ and then substract the payoff from the current price. Then insert in the expected utility:$$E[U(w^TX)]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where U is the exponential utility and X is the return. w denots our portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is, is the payoff of the portfolio still gaussian? As I am including call-options. Because if it is gaussian, I can explicit write down the expectation in dependence of the mean and variance. Then the optimization problem is quite easy. If is not, what would be the best way to do it.&lt;/p&gt;&#xA;" OwnerUserId="25867" LastEditorUserId="25867" LastEditDate="2017-08-08T15:42:52.990" LastActivityDate="2017-08-08T15:42:52.990" Title="optimizing the expected utility" Tags="&lt;black-scholes&gt;&lt;risk&gt;&lt;portfolio-optimization&gt;&lt;utility-theory&gt;" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="35518" PostTypeId="1" CreationDate="2017-08-08T13:01:22.153" Score="2" ViewCount="295" Body="&lt;p&gt;I would like to get a trades view on hedging a FX Forward with a FX Future by just moving the (1) FX_Spot rate and ignore the other risk factors (2) ccy1 DV01 risk, (3) ccy2 DV01 risk, (4) basis swap risk between ccy1 and ccy2. What would the best way performing that? Does someone has an example how to perform it? Thanks. &lt;/p&gt;&#xA;" OwnerUserId="29106" LastActivityDate="2017-08-13T14:34:25.573" Title="Traders view on hedging of FX Futures with FX Forward" Tags="&lt;fx&gt;&lt;futures&gt;&lt;hedging&gt;&lt;forward&gt;&lt;delta-hedging&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35519" PostTypeId="2" ParentId="35514" CreationDate="2017-08-08T13:55:51.523" Score="3" Body="&lt;p&gt;As a random variable, the terminal asset price has a semi-infinite support, bounded at zero. Intuitively, this means that when increasing volatility while keeping all other parameters unchanged (same mean, here reflected by the forward price which is vol independent), the distribution tries to extend itself on both side of the definition domain but hits a boundary at zero, where probability accumulates (probability mass).&lt;/p&gt;&#xA;&lt;p&gt;This is not very rigorous but I hope you get the idea, you could try plotting the lognormal pdf as &lt;span class=&quot;math-container&quot;&gt;$\sigma \to \infty$&lt;/span&gt; for visual inspection.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2020-08-19T12:11:19.637" LastActivityDate="2020-08-19T12:11:19.637" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="35520" PostTypeId="1" CreationDate="2017-08-08T15:16:10.820" Score="1" ViewCount="46" Body="&lt;p&gt;I have been thinking about this for a while... I can't make my head around it because of the gap that there's still on between financial economics and quantitative finance. Usually, when a student is introduced to the CAPM in undergrad for didactical purposes, she's told that the $\beta$ in the regression represents the sensitivity of an investment to an ideal &quot;market portfolio&quot;. But assuming that the market portfolio is a weighted linear combination of all existing &lt;em&gt;securities&lt;/em&gt;, it still does incorporate volatility clustering phenomena. This may lead to a guess that &lt;em&gt;is not&lt;/em&gt; possible to eliminate volatility, and by this I mean even volatility clustering - i.e. persistent autocorrelation of the absolute/squared returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the anecdotical evidence from friends of mine working in hedge funds, is that it is actually possible to eliminate the volatility clustering phenomena with proprietary trading strategies. So my question is: if we consider the tail dependency in financial markets, we observe that in turbulent market times even uncorrelated assets start moving together, as noted by Bouchaud; this observation may lead to think that volatility is &lt;em&gt;not a specific risk&lt;/em&gt; that can be eliminated through diversification. On the other hand, proprietary trading desks can set up properly their strategies so to avoid dependence on the second moment of their returns, and offer their investors more attractive returns. But where volatility stands in this framework? If it is possible to build a portfolio with no autocorrelation on the squared returns, I think that there's a good chance of dealing with alpha in its purest form, not some kind of &quot;smart beta&quot; professed in business school. This would lead me to think that volatility is a systemic risk for the ones that are not able to handle it, and something that can be eliminated for those who know what they're doing. Unfortunately, I haven't found any paper on the argument, but feel free to express your point of view, and even share papers on the subject, discussing a little bit what's in them.&lt;/p&gt;&#xA;" OwnerUserId="16045" LastActivityDate="2017-08-08T15:16:10.820" Title="Volatility taxonomy" Tags="&lt;volatility&gt;&lt;soft-question&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35522" PostTypeId="2" ParentId="35462" CreationDate="2017-08-08T19:42:11.323" Score="2" Body="&lt;p&gt;I would look to these papers below by Dan Stefanica et al. Very easy to code and yields better results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2908494&quot; rel=&quot;nofollow noreferrer&quot;&gt;An Explicit Implied Volatility Formula&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2922742&quot; rel=&quot;nofollow noreferrer&quot;&gt;Tighter Bounds for Implied Volatility&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="13398" LastEditorUserId="16148" LastEditDate="2017-08-08T19:53:31.343" LastActivityDate="2017-08-08T19:53:31.343" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35523" PostTypeId="1" CreationDate="2017-08-08T20:20:50.753" Score="2" ViewCount="356" Body="&lt;p&gt;I am attempting to calculate the unconditional variance of an E-GARCH model:&#xA;$$\log(h_{t+1}) = \beta_{0} + \beta_{1}\log(h_{t}) + \beta_{2}\left[|\varepsilon_{t} - \lambda| + \gamma(\varepsilon_{t} - \lambda) \right]$$&#xA;where $\varepsilon_{t} \sim \mathcal{N}(0,1)$ under the LRNVR measure, $\mathcal{Q}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can calculate the unconditional variance of the GARCH and the GJR-GARCH models quite easily though I am completely stumped on this one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I manipulated it down to:&#xA;$$h_{t+1} = h_{t}^{\beta_{1}}\beta_{1}e^{\beta_{0} - \gamma\beta_{2}\lambda}e^{\beta_{2}(|\varepsilon - \lambda| + \gamma\varepsilon)}$$ though I may be wrong in this manipulation (Thankyou for pointing out my error Quantuple). If I am correct, I do not know how to continue from here. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I eventually want to use this results for option pricing under an E-GARCH model, hence the need to calculate this parameter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: After reading Daniel Nelson's paper, and Option Pricing Using GARCH Models: An Empirical Examination by Caroline Sasseville, I have an expression for $\mathbb{E}[h_{t}]$. It is quite large and it has to be estimated, but the start of it is as follows:&#xA;$$\mathbb{E}[h_{t}] = (h_{1})^{\beta_{1}^{i-1}}\left(e^{\beta_{0}\frac{\beta_{1}^{i-1}-1}{\beta_{1}-1}}\right)2^{1-i}\prod_{k=1}^{i-1} f(\lambda, \gamma, k)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand how to compute this but I am perplexed as to what $h_{1}$ is. I interpret $h_{1}$ as the initial conditional variance which is usually set to the unconditional variance. However, my thoughts are that as k tends towards infinity, $(h_{1})^{\beta_{1}^{i-1}}$ would tend towards one, as based off Sasseville's paper, $\beta_{1}$ is less than one and hence $\beta_{1}^{i-1}$ would tend towards zero. This is not a rigorous answer, just intuitive thinking but would love if someone had some clarification on this. Possibly I am missing something incredibly simple as to what $h_{1}$ is :).&lt;/p&gt;&#xA;" OwnerUserId="29114" LastEditorUserId="29114" LastEditDate="2017-08-14T20:50:56.723" LastActivityDate="2017-08-14T20:50:56.723" Title="Unconditional variance of an E-GARCH model" Tags="&lt;option-pricing&gt;&lt;volatility&gt;&lt;garch&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35525" PostTypeId="2" ParentId="35509" CreationDate="2017-08-09T01:12:18.303" Score="1" Body="&lt;p&gt;If you refer me to the exact text you are using I will be more specific - since your notation is not like their 1995 paper.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In any case, the derivation of the stochastic discount factor (also called the pricing kernel) in a general equilibrium model must come from the first order conditions of an investors portfolio choice. The investor will have a utility function over something he cares about (wealth, consumption, leisure, etc) and asset risk will be a function of the co-variance between the return on the asset and some function of the investors utility over something he cares about. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the standard framework where an investor makes a consumption investment decision in a two period framework. Given some endowment today $e_0$ consumption is what is left after saving $c_1=e_1-s$, tomorrow you consume the uncertain return on investment $s\tilde{R}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;\underset{s}{max}\quad u(e_1-s) + \beta\mathbb{E}[u(s\tilde{R})]&#xA;\end{equation}&#xA;The first order conditions of portfolio choice can be written as &#xA;\begin{align*}&#xA;u'(c_1) =&amp;amp; \mathbb{E}[u'(c_2)\tilde{R}]\\&#xA;1  =&amp;amp; \mathbb{E}[\beta\frac{u'(c_2)}{u'(c_1)}\tilde{R}]\\&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anything else you see will be a variation on the same concept.  &lt;/p&gt;&#xA;" OwnerUserId="26256" LastActivityDate="2017-08-09T01:12:18.303" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35527" PostTypeId="2" ParentId="34605" CreationDate="2017-08-09T08:29:44.070" Score="3" Body="&lt;p&gt;In our startup SimFin, we are working on exactly such a solution, which is offered for free, since we couldn't afford the pricey premium solutions neither back when we were students. &#xA;To this date, we have financial ratios, Financial statements (directly sourced from the SEC's XBRL data and up to 10y back) and stock prices for over 1000+ US companies, including the entire S&amp;amp;P 500.&#xA;The fundamental financial data is freely available and you can instantly download it via excel.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Feel free to check it out under &lt;em&gt;www.simfin.com&lt;/em&gt; and hopefully find what you are looking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you need any specific data set, just write us there and we can compile it for you in exchange for some valuable feedback.&lt;/p&gt;&#xA;" OwnerUserId="28993" LastEditorUserId="28993" LastEditDate="2017-08-10T09:22:39.233" LastActivityDate="2017-08-10T09:22:39.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35528" PostTypeId="2" ParentId="35477" CreationDate="2017-08-09T08:51:41.203" Score="3" Body="&lt;p&gt;You can find the underlying data for the big indices, such as S&amp;amp;P 500, on our website www.simfin.com, freely available and instantly downloadable as excel.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To this date, we have financial ratios, Financial statements (directly sourced from the SEC's XBRL data and up to 10y back) and stock prices for over 1000+ US companies, which hopefully might provide you some valuable info on generating your table. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your case, it will be advisable to filter the data regarding the index membership.&lt;/p&gt;&#xA;" OwnerUserId="28993" LastEditorUserId="28993" LastEditDate="2017-08-10T09:20:23.800" LastActivityDate="2017-08-10T09:20:23.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35530" PostTypeId="2" ParentId="35465" CreationDate="2017-08-09T09:25:07.077" Score="6" Body="&lt;p&gt;You could use the two factor model of Schwartz-Smith. It's a very standard model in commodities, where you observe this kind of long term mean reversion (where &quot;long-term&quot; is here around a year).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's a mean reversion model where the long-term mean reversion is itself a brownian proccess. This way you can have the desided stochasticity in the short term, but a long term mean reversion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the original paper:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.anderson.ucla.edu/faculty/eduardo.schwartz/articles/72.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;E.S. Schwartz &amp;amp; J.E. Smith (2000), &quot;Short-term variations and long-term dynamics in&#xA;commodity prices&quot;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6356" LastEditorUserId="6356" LastEditDate="2018-02-14T11:52:27.377" LastActivityDate="2018-02-14T11:52:27.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35531" PostTypeId="1" AcceptedAnswerId="35594" CreationDate="2017-08-09T09:30:56.703" Score="0" ViewCount="618" Body="&lt;p&gt;I am wondering, how do you price a open-ended repo (when a maturity date is not set)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have done some research and have found no formula's or even an explanation of how to value such a repo. In fact, I have not found a pricing model for a term repo either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am considering the security as the object being lent or borrowed and the loan amount (money) as the collateral. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By an open repo, I meant the one described by wikipedia: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Open has no end date which has been fixed at conclusion. Depending on the contract, the maturity is either set until the next business day and the repo matures unless one party renews it for a variable number of business days. Alternatively it has no maturity date - but one or both parties have the option to terminate the transaction within a pre-agreed time frame.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="28388" LastEditorUserId="28388" LastEditDate="2017-08-11T09:13:21.167" LastActivityDate="2017-08-14T02:48:44.440" Title="Pricing an open repurchase agreement" Tags="&lt;pricing&gt;&lt;pricing-formulae&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35532" PostTypeId="2" ParentId="35531" CreationDate="2017-08-09T10:16:54.177" Score="2" Body="&lt;p&gt;There's no such thing as an undated repo.  For example , what would happen if the underlying security matures? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Term repos of Treasuries of one week to one year are reasonably common.  The pricing models incorporate some generic factors such as the shape of the Fed Funds curve, plus some security specific factors such as the likelihood of the underlying security going &quot;special&quot; during the repo (if a security becomes hard to borrow for some reason, the repo rate goes down).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To respond to your edit :   If a repo is cancellable by either party on a given date, then it will theoretically terminate on that date (it must be advantageous for a party to do that , unless it is worth exactly zero).  In this case the pricing is the same as a repo ending on that date.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If a repo is extendible or cancellable by one party only , we have a more complex situation.  If the repo is a fixed rate repo, the party with the cancellation right owns an interest rate option so those types of models must be employed.  If the repo is a floating rate repo, it depends how the floating rate is determined.  Generally the option value will be less in this case.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastEditorUserId="18388" LastEditDate="2017-08-11T20:42:12.573" LastActivityDate="2017-08-11T20:42:12.573" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35533" PostTypeId="1" AcceptedAnswerId="35555" CreationDate="2017-08-09T12:42:25.417" Score="2" ViewCount="556" Body="&lt;p&gt;I am trying to perform the numerical integration in the Heston using Gaussian quadrature but I obtain an error of  4e-3 while some of the deep out-of-the-money near expiry Call prices are smaller than 1e-5. Is there any way I can improve the accuracy without being extremely slow or should I exclude those prices from my calibration ?&lt;/p&gt;&#xA;" OwnerUserId="28757" LastActivityDate="2019-03-21T12:19:36.333" Title="How can I improve the numerical integration accuracy in Heston model?" Tags="&lt;heston&gt;" AnswerCount="2" CommentCount="19" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35535" PostTypeId="2" ParentId="35477" CreationDate="2017-08-09T14:24:28.180" Score="1" Body="&lt;p&gt;So here's the answer for Bloomberg I suppose plus some extra advice when looking at the data you get from there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is the function ETF that lets you screen for ETFs. &#xA;Unfortunately, I have not found a possibility to screen by benchmark.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take AGG US Equity as an example. There is the field &quot;FUND_BENCHMARK_PRIM&quot; which points to the BM ticker. (This is what you see when you use the COMP function). With the help of this ticker, you can easily download the bm timeseries.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what you could try: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Export the filter results from the ETF function into excel&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Download the BM ticker via the Excel BB API&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;A couple of warnings:&#xA;If you compare the BM returns to the one of the ETF on Bloomberg via ticker, be aware that the Exchange code DOES matter. On some of them, the ETF is scarcely traded and as a result there are lots of stale prices in Bloomberg. Of course, you could still sell this on the secondary market. Just choose a different exchange with more liquid prices to compare. Or you could look at the NAV instead (also, if you NAV trade the ETFs of course).&#xA;If you look at Asian or EM ETFs, there is the currency conversion that gives you lots of TE so its better to look twice before jumping to conclusions. &lt;/p&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2017-08-09T14:24:28.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35536" PostTypeId="2" ParentId="35513" CreationDate="2017-08-09T14:38:51.833" Score="3" Body="&lt;p&gt;@vanguard2k I haven't exactly been able to satisfy myself with the derivation of the original code, but I have been able to do the next best thing. I've looked at the source of the code, which is QuantStart which credits Dr Tom Starke, which uses a slightly different code and also credits Dr Ernie Chan. I've then gone to Dr Chan's blog and used his principles to come up with my own code. It uses variance instead of std, gets rid of the sqrt, and uses a 2.0 divisor instead of a 2.0 multiplier (which is the 1/4 that you mention). And the results it gives are the same as the original code. The difference is I understand (I think) the principles that are behind the code below and the final answer is the same. Thanks alot for all your help troubleshooting with me, in the end you were pretty much right, all the elements that didn't seem to make sense cancelled each other out in the end (I guess).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://epchan.blogspot.fr/2016/04/mean-reversion-momentum-and-volatility.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://epchan.blogspot.fr/2016/04/mean-reversion-momentum-and-volatility.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Dr Chan states that if z is the log price, then volatility, sampled at intervals of τ, is volatility(τ)=√(Var(z(t)-z(t-τ))). To me another way of describing volatility is standard deviation, so std(τ)=√(Var(z(t)-z(t-τ)))&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;std is just the root of variance so var(τ)=(Var(z(t)-z(t-τ)))&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Dr Chan then states:  In general, we can write Var(τ)  ∝ τ^(2H) where H is the Hurst exponent&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Hence (Var(z(t)-z(t-τ)))  ∝ τ^(2H)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Taking the log of each side we get log (Var(z(t)-z(t-τ)))  ∝  2H log τ&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;[ log (Var(z(t)-z(t-τ))) / log τ ] / 2 ∝  H (gives the Hurst exponent) where we know the term in square brackets on far left is the slope of a log-log plot of tau and a corresponding set of variances.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;lags = range(2,100)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def hurst_ernie_chan(p):&#xA;&#xA;variancetau = []; tau = []&#xA;&#xA;for lag in lags: &#xA;&#xA;    #  Write the different lags into a vector to compute a set of tau or lags&#xA;    tau.append(lag)&#xA;&#xA;    # Compute the log returns on all days, then compute the variance on the difference in log returns&#xA;    # call this pp or the price difference&#xA;    pp = subtract(p[lag:], p[:-lag])&#xA;    variancetau.append(var(pp))&#xA;&#xA;# we now have a set of tau or lags and a corresponding set of variances.&#xA;#print tau&#xA;#print variancetau&#xA;&#xA;# plot the log of those variance against the log of tau and get the slope&#xA;m = polyfit(log10(tau),log10(variancetau),1)&#xA;&#xA;hurst = m[0] / 2&#xA;&#xA;return hurst&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="29107" LastActivityDate="2017-08-09T14:38:51.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35537" PostTypeId="2" ParentId="35465" CreationDate="2017-08-09T15:23:56.210" Score="2" Body="&lt;p&gt;Although I agree with jd8 answer, practical implementation issues may arise. Here I suggest a parsimonious engineering solution relying on economic intuition of Habit model of Campbell and Cochrane (1999).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 – Assume time varying mean and standard deviation in standard GBM dynamics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2 – Use “drawdown” as an observable variable for measuring risk aversion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3 – Create a methodology for mapping drawdown to mean and standard deviation. &#xA;For the simulation shown below I have used a rule based technique calibrated based on historical market behavior. Simply speaking, mean and standard deviation are proportionate to drawdown. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;4 – Simulate GBM with time varying mean and standard deviation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/wQ2JD.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/wQ2JD.png&quot; alt=&quot;Single path simulation&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26407" LastActivityDate="2017-08-09T15:23:56.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35538" PostTypeId="1" AcceptedAnswerId="42644" CreationDate="2017-08-09T15:52:56.777" Score="0" ViewCount="678" Body="&lt;p&gt;I'm trying to compute the price of a CDO at any time, using the &lt;em&gt;one factor gaussian copula&lt;/em&gt; and &lt;em&gt;the Large Homogenous Portfolio Approximation&lt;/em&gt;. You can find the CDO pricing formula in M. Neugebauer (2007): A comprehensive Analysis of Advanced Pricing Models for Collateralised Debt Obligations&#xA; &lt;a href=&quot;https://www.maths.ox.ac.uk/system/files/legacy/12804/A%20comprehensive%20analysis%20of%20advanced%20pricing%20models%20for%20collateralised%20debt%20obligations.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see in the formula $(2.13)$ page 9, the only difficulty is the computation of the expected tranche loss $ELT(t)$, but you can find a closed form (thanks to the one factor gaussian copula model and the large homogenous approximation), it is written in page 16 (equation $(2.37)$). We can see that $ELT(t)$ depends on the default probability of the reference name $P(\tau \le t)$, with $\tau$ being the default time of the reference name. If we assume that $\tau$ has an exponential distribution with hazard rate function $\lambda(t)$, then $P(\tau \le t) = 1 - e^{-\lambda (t)*t}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is : how do you calibrate $\lambda (t)$ ? I know that for CDSs, we have that $\lambda  \simeq \frac{s_0}{1-RR}$ with $s_0$ the &lt;em&gt;contractual spread&lt;/em&gt;, and $RR$ the &lt;em&gt;recovery rate&lt;/em&gt; (and at time $t$, you have $\lambda_t = s_t / 1-RR$ with $s_t$ the &lt;em&gt;market spread&lt;/em&gt; at time $t$). How does it work in our case? Thank you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Adam.&lt;/p&gt;&#xA;" OwnerUserId="29125" LastEditorUserId="16148" LastEditDate="2017-08-09T19:27:30.747" LastActivityDate="2018-11-15T10:07:51.993" Title="CDO tranche Pricing : Default probability" Tags="&lt;cdo&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35539" PostTypeId="1" CreationDate="2017-08-09T17:01:46.973" Score="0" ViewCount="320" Body="&lt;p&gt;What is the right way to express the change in interest rate time series, if this time series contains both positive and negative rates? &lt;/p&gt;&#xA;" OwnerUserId="29040" LastActivityDate="2017-08-10T05:20:21.547" Title="Modeling Interest Rate Time Series" Tags="&lt;interest-rates&gt;" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="35540" PostTypeId="1" CreationDate="2017-08-09T18:14:38.187" Score="0" ViewCount="50" Body="&lt;p&gt;I have a hand full of daily economic data. I am currently using a brute force approach. Genetic optimization is only used when k is very large. This method is beautiful to me, but isn't valuable compared to OLS models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I have found a set of slides from a .edu source on bi-variate x parameters for estimating y for linear modeling. This is very nice and all but I have far more than two economic indicators in mind. The paper mention linear algebra as being a pre-requisite to much higher k values for &quot;hyperplane&quot; models.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anyone provide insight on how this could be done? I am thinking perhaps 10 or 15 x values and a single y value. It would be nice if there where a stupid simple explanation and a highly technical one. Despite a 120-130 IQ in mathematics, I suffer severe ADHD+ASD so learning is hard. :(&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Re-stating the Question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to perform multi-variate linear regression for k explanatory variables. Where k is an integer element of [1,infinity)&lt;/p&gt;&#xA;" OwnerUserId="18578" LastActivityDate="2017-08-09T18:14:38.187" Title="Multi-Variate linear modeling: how to calculate mathematically vs brute force genetic optimization" Tags="&lt;modeling&gt;&lt;econometrics&gt;&lt;statistical-finance&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="35541" PostTypeId="2" ParentId="35539" CreationDate="2017-08-09T19:28:33.580" Score="1" Body="&lt;p&gt;The usual approaches used to deal with negative interest rates are:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) the normal (Bachelier) model or Brownian motion, where $dr_t = \sigma dW_t$; this makes changes independent from the level of the interest rate,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) shifted lognormal (displaced diffusion) model, where, instead of the ordinary Geometric Brownian Motion $dr_t = r_t \sigma dW_t$, we have $dr_t = (r_t + h) \sigma dW_t$ with for example $h=2\%$ or any similar value accepted by convention or made to fit the data; this keeps changes somewhat proportional to the rate level, while allowing negative values up to $-h$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also look at &lt;a href=&quot;https://quant.stackexchange.com/questions/4019/modelling-with-negative-interest-rates&quot;&gt;this&lt;/a&gt; question, which has useful references.&lt;/p&gt;&#xA;" OwnerUserId="29128" LastEditorUserId="-1" LastEditDate="2017-08-10T05:20:21.547" LastActivityDate="2017-08-10T05:20:21.547" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35542" PostTypeId="1" CreationDate="2017-08-10T01:30:56.917" Score="2" ViewCount="95" Body="&lt;p&gt;I there a source or way from which I can find out the minimum tick size for US securities at any point in time from 1970 until today?&#xA;I know that securities above \$1 have \$0.01 tick while those below \$1 have \$0.0001 tick since Jan 29, 2001 but how about before this time?&lt;/p&gt;&#xA;" OwnerUserId="28494" LastEditorUserId="743" LastEditDate="2017-08-10T18:43:25.157" LastActivityDate="2017-10-09T19:45:03.023" Title="tick size for US securities" Tags="&lt;market-microstructure&gt;&lt;tick-data&gt;&lt;tick&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35543" PostTypeId="1" CreationDate="2017-08-10T07:42:19.073" Score="1" ViewCount="119" Body="&lt;p&gt;When pricing a spread option with two different prices, one can use Kirk's approximation combined with Margrabe's formula (&lt;a href=&quot;https://en.wikipedia.org/wiki/Margrabe%27s_formula&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Margrabe%27s_formula&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But what if I am pricing an option that involves 3 or 4 different prices ? Is there a closed form formula ? Else how can I price it ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The payoff of my strategy looks like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\mathop{\mathbb{E}} \left[\left(\alpha K+\beta F_1(t_1) +\gamma F_1(t_2)+\zeta F_2(t_1) +\lambda F_2(t_2)\right)^+\right]$$&#xA;Where $K$ is the strike, $F_1$ and $F_2$ the price of two different assets.&lt;/p&gt;&#xA;" OwnerUserId="29134" LastActivityDate="2017-10-10T13:50:51.913" Title="How to price a strategy involving more than 2 different prices?" Tags="&lt;pricing&gt;&lt;spread-options&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35544" PostTypeId="1" CreationDate="2017-08-10T13:00:37.850" Score="1" ViewCount="123" Body="&lt;p&gt;A few questions and my answers, to be sure I understand everything&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question 1&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose A and B agree on a forward contract:&#xA;maturity&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$T = 1Y$ &lt;/li&gt;&#xA;&lt;li&gt;spot at $t=0$: $S_0=100$&lt;/li&gt;&#xA;&lt;li&gt;forward price $K = 120$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Suppose B wants to sell this contract to C at $t = 6M$ (so that the contract will be between A and C). Suppose that $S_{6M}=135$, then C will buy the contract at 135-120=15 ?(so C buys the mark-to-market forward price)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question 2&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value of a forward contract at $t$ = 0 equals&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V_{0}=S_{0}-Kexp(-rT)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $K=S_{0}exp(rT)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;At $t = 6M$, the value is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$V_t=S_t-Kexp(-r(T-t))=S_t-S_{0}exp(rT)exp(-r(T-t))=S_t-S_0exp(rt).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So again C will buy the contract at this price (?)&lt;/p&gt;&#xA;" OwnerUserId="15738" LastEditorUserId="16148" LastEditDate="2017-08-11T13:43:10.313" LastActivityDate="2017-08-11T13:43:10.313" Title="Some questions on (re-)pricing a forward" Tags="&lt;options&gt;&lt;forward&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35549" PostTypeId="1" CreationDate="2017-08-10T15:18:33.510" Score="1" ViewCount="37" Body="&lt;p&gt;I'm trying to work out a method for finding the initial capital value that allows someone to run out of money at the exact time they reach mortality. Currently, I'm graphing the annual total capital values through an iterative method. I have a pre-calculated list of the annual expenses (discrete values unique to each year), and I know the growth.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The iterative method I use when I know the initial capital value is simple, and works as follows&lt;br&gt;&#xA;Given an initial value $x_0$ , the next year's total capital value is the growth of the previous year's value $x_0(1 + growth)$ minus the expenses for that year. This value, $x_1$ , is then used to determine the next year's total $x_1(1+growth) - expenses$, and so on until we reach the mortality date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I now need to find the initial value $x_0$ given that the final value must be 0. I've tried implementing a type of binary-search simulation where I try find the starting value that gives the end value closest to 0, but that is both fairly computationally expensive for a live graphing application as well as quite an ugly solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a better method for solving this problem? Or is this simply a boundary condition that cannot be inferred from the end result?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance for your help&lt;/p&gt;&#xA;" OwnerUserId="29135" LastActivityDate="2017-08-10T16:39:18.763" Title="Calculating the ideal initial capital value to optimize a growth model" Tags="&lt;programming&gt;&lt;finance-mathematics&gt;&lt;mathematics&gt;&lt;calculation&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="35550" PostTypeId="2" ParentId="35549" CreationDate="2017-08-10T16:39:18.763" Score="1" Body="&lt;p&gt;At the end of each year you have wealth $X_t$ in an investment account which grows at the rate $r$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the beginning of each year you withdraw the amount $W$ and keep it in cash to pay for your expenses through the coming year.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your investment to last $n$ years you need to start with $X=W+W\frac{1}{1+r}+\cdots+W\frac{1}{(1+r)^n}$. In this way you will be able to live for $n+1$ years&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using geomteric series summation formula this can be rewritten in closed form as $X=\frac{W}{r}[1+r-\frac{1}{(1+r)^n}]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example to live for 1 year ($n=0$) you need to start with $W$ (which you will immediately withdraw for spending)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To live for 2 years ($n=1$) you need $W\frac{2+r}{1+r}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And so on.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2017-08-10T16:39:18.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35551" PostTypeId="2" ParentId="35544" CreationDate="2017-08-10T17:01:58.697" Score="4" Body="&lt;p&gt;Assuming zero dividend and a constant interest rate $r$, the 1y forward price is then &#xA;\begin{align*}&#xA;120 = K = S_0 e^r = 100\, e^r.&#xA;\end{align*}&#xA;Consequently, $e^r = 1.2$. The fair value of the forward contract, at 6M, is given by&#xA;\begin{align*}&#xA;e^{0.5 r} E\left(\frac{S_{1Y}-120}{e^{r}} \mid \mathcal{F}_{6M} \right) &amp;amp;= e^{0.5 r}\left(\frac{S_{6M}}{e^{0.5 r}} -\frac{120}{e^r}\right)\\&#xA;&amp;amp;= S_{6M} - 120 e^{-0.5 r}.\tag{1}&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, for your Question 1, C is willing to buy the forward contract with the price 135-120 = 15, given that the value in $(1)$ is greater than 15.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your second question, since &#xA;\begin{align*}&#xA;S_t - S_0 e^{rt} &amp;amp;= S_{6M} - S_0 e^{0.5r}\\&#xA; &amp;amp;= S_{6M} - S_0 e^r e^{-0.5r}\\&#xA;&amp;amp;=S_{6M}- 120 e^{-0.5 r},&#xA;\end{align*}&#xA;C is indifferent for buying the forward contract with this price.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-08-11T13:11:11.497" LastActivityDate="2017-08-11T13:11:11.497" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35552" PostTypeId="2" ParentId="35542" CreationDate="2017-08-10T18:45:31.600" Score="1" Body="&lt;p&gt;You probably can't find a definitive resource.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can however past this together using sources on line.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.finra.org/industry/tick-size-pilot-program&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.finra.org/industry/tick-size-pilot-program&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.sec.gov/oiea/investor-alerts-bulletins/ia_ticksize.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.sec.gov/oiea/investor-alerts-bulletins/ia_ticksize.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I know that securities above \$1 have \$0.01 tick while those below \$1 have \$0.0001 tick since Jan 29, 2001 but how about before this time?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is not really correct anymore due to the penny pilot tick rule put in place a few years ago on select symbols &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The good news is that this doesn't change too often, if you search for penny pilot tick rule you'll find the majority of the symbols that traded at odd increments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And warehousing has made this a bit muddier as sub penny price improvement can mean tickers that normally trade in penny increments actually get filled at non penny increments.&lt;/p&gt;&#xA;" OwnerUserId="743" LastEditorUserId="16148" LastEditDate="2017-08-10T18:48:23.697" LastActivityDate="2017-08-10T18:48:23.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35554" PostTypeId="2" ParentId="35465" CreationDate="2017-08-10T19:59:30.637" Score="1" Body="&lt;p&gt;Modeling Volatility and Valuing Derivatives Under Anchoring&#xA;Paul Wilmott, Alan L. Lewis, Daniel J. Duffy&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1002/wilm.10366/pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://onlinelibrary.wiley.com/doi/10.1002/wilm.10366/pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd use volatility anchoring to produce persistent local smiles and sensible, easily calibrated dynamics&lt;/p&gt;&#xA;" OwnerUserId="27516" LastEditorUserId="16148" LastEditDate="2017-08-10T20:14:03.723" LastActivityDate="2017-08-10T20:14:03.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35555" PostTypeId="2" ParentId="35533" CreationDate="2017-08-10T20:03:43.050" Score="2" Body="&lt;p&gt;Use fourier-cosine expansions, first paper by Fang-Oosterlee in 2008. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Very simple to code and exponential convergence affords working accuracy within sub-seconds vs order of magnitude slower under Carr-Madan. For reference precision you can add another order of magnitude. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My VBA implementation is faster and more stable than Carr-Madan in C++ for OTM options&lt;/p&gt;&#xA;" OwnerUserId="27516" LastActivityDate="2017-08-10T20:03:43.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35557" PostTypeId="1" AcceptedAnswerId="35558" CreationDate="2017-08-11T03:16:40.643" Score="0" ViewCount="158" Body="&lt;p&gt;Assume we are given $N$ samples, let's say small timeseries of 1 hour resolution daily exchange rates - for the sake of argument. Each sample is a $24$ element vector $x$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then we proceed to do clustering using our favourite unsupervised learning algorithm, say K-means. Assume we use $k$ classes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Afterwards, we observe the mean return values of the following days &lt;em&gt;conditioned&lt;/em&gt; on the class. Meaning, for the days in class $k=1$ we have on average returns $\mu_1$ on the following day.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The statement then is the following, if a day looks like class $c$ then tommorrow you can expect returns $\mu_c$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Here is my question:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have we broken any rule in this process? Should we have stored some of the $N$ days for out of sample performance? It seems to me that even talking about out of sample and in sample is meaningless, since the algorithm only uses the vectors $x$ and is absolutely agnostic about the returns on the following day. &lt;/p&gt;&#xA;" OwnerUserId="21007" LastActivityDate="2017-08-11T04:16:38.577" Title="Unsupervised learning and in out of sample" Tags="&lt;backtesting&gt;&lt;algorithmic-trading&gt;&lt;machine-learning&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35558" PostTypeId="2" ParentId="35557" CreationDate="2017-08-11T04:16:38.577" Score="1" Body="&lt;p&gt;You form your clusters on in-sample data. How well new data conforms to these clusters going forward can only be determined from out-of-sample data. So you are estimating the generalisation of your clusters. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you don't separate the data then you might find clusters which only appeared in the future, and any associated forward returns would have been linked to those clusters.&lt;/p&gt;&#xA;" OwnerUserId="5107" LastActivityDate="2017-08-11T04:16:38.577" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35560" PostTypeId="1" AcceptedAnswerId="35567" CreationDate="2017-08-11T11:04:38.050" Score="3" ViewCount="327" Body="&lt;p&gt;Currently I am using the Fama and French 3 factor model to explain the performance of mutual funds using monthly returns from 2000 to 2017. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use two market proxies:&#xA;(1) RM-RF, obtained directly from Kenneth French website. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) Wilshire 5000-RF, obtained from Bloomberg Terminal. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;RF is the 1 month U.S. t-bill. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For some reason when I run my regressions, the R-squared using (2) Wilshire 5000 as a market proxy is higher than when (1) RM was used as a market proxy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The correlation coefficient between the two proxies is 0.93, which suggest that there differences (probably in the composition of the Fama and French market proxy). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was just wondering if there are any technical differences between the two market proxies? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If RM is a value weighted of all investable equities in the U.S., the correlation coefficient should be much higher than .93 relative to Wilshire 5000. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks. &lt;/p&gt;&#xA;" OwnerUserId="28909" LastEditorUserId="28909" LastEditDate="2017-08-11T11:29:04.573" LastActivityDate="2017-08-12T15:45:25.180" Title="Fama and French (market premium) factor" Tags="&lt;finance&gt;&lt;regression&gt;&lt;econometrics&gt;&lt;quantitative&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35564" PostTypeId="2" ParentId="35543" CreationDate="2017-08-11T12:44:56.003" Score="1" Body="&lt;p&gt;For such problems, you may consider the moment matching approach. &#xA;For example, you can approximate the combination of terms where the coefficients have the same sign by a log-normal random variable, and then use the approach you mentioned. If all coefficients have the same sign, &#xA;you can approximate the whole combination by a shifted log-normal random variable. That is, &#xA;\begin{align*}&#xA;\beta F_1(t_1) +\gamma F_1(t_2)+\zeta F_2(t_1) +\lambda F_2(t_2) \approx A + B e^{C\xi},&#xA;\end{align*}&#xA;where $A$, $B$ and $C$ are constants, and $\xi$ is a standard normal random variable. Here, the parameters $A$, $B$ and $C$ can be calibrated by matching the moments up to the third order. However, you need to solve a cubic equation. For simplicity, you can assume that $A=0$ to have a second order moment matching.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-08-11T12:56:13.607" LastActivityDate="2017-08-11T12:56:13.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35565" PostTypeId="2" ParentId="35560" CreationDate="2017-08-11T15:43:27.917" Score="2" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;If you look closely to &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/j.1540-6261.1992.tb04398.x/epdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Frama French 1992&lt;/a&gt; you will see that Fama-French exclude financials from their sample. They do not specify whether these are excluded from the market factor or not. That might be one of the differences from the Wilshire 5000 to the Fama-French market sample.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Another difference is that they only include stocks that have a&#xA;stock returns on 24 of the preceeding 60 months. That should be&#xA;another difference.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;They only include firms with positive equity book values&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If you read their data section closely I am sure you will find several other things that could make results different.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastEditorUserId="16472" LastEditDate="2017-08-11T18:40:34.460" LastActivityDate="2017-08-11T18:40:34.460" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35567" PostTypeId="2" ParentId="35560" CreationDate="2017-08-11T17:55:44.707" Score="3" Body="&lt;h2&gt;Update&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I downloaded the return series for WFIVX (a Wilshire 5000 index fund) and I calculate a correlation coefficient of .9991 with the Fama-French market return series from Ken French's website (for 2000 to 2017)! So I think something is wrong with your .93 calculation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are your monthly returns over the same period (i.e. end of month $t-1$ to end of month $t$)). Do they include all distributions etc...?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;How Fama and French calculate the market return (RM)&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;From &lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/Data_Library/f-f_5_factors_2x3.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Ken French's webpage&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Rm-Rf, the excess return on the market, value-weight return of all&#xA;  CRSP firms incorporated in the US and listed on the NYSE, AMEX, or&#xA;  NASDAQ that have a CRSP share code of 10 or 11 at the beginning of&#xA;  month t, good shares and price data at the beginning of t, and good&#xA;  return data for t minus the one-month Treasury bill rate (from&#xA;  Ibbotson Associates).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That the first digit of the &lt;a href=&quot;http://www.crsp.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;CRSP&lt;/a&gt; share code is 1 means that the shares are ordinary common shares (and not certificates or ADRs etc...)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The CRSP coding for the 2nd digit are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Code    Definition&#xA;0   Securities which have not been further defined.&#xA;1   Securities which need not be further defined.&#xA;2   Companies incorporated outside the US&#xA;3   Americus Trust Components (Primes and Scores).&#xA;4   Closed-end funds.&#xA;5   Closed-end fund companies incorporated outside the US&#xA;8   REIT's (Real Estate Investment Trusts).&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h3&gt;Does this match Fama-French market return?&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Basically yes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The below SQL code achieves a mean 0.4 basis point absolute different with the Fama-French &lt;code&gt;rm&lt;/code&gt; factor (from their website) since 2000. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/DVu3w.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/DVu3w.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It gets a bit more dodgy in the early 1980s and I'd have to check all the details a bit better, but the big point is that you can about all the way there by:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Only use NYSE, AMEX, and NASDAQ stocks.&lt;/li&gt;&#xA;&lt;li&gt;Only use regular, common shares (and no REITs)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I've included some SQL code below. (It runs on my idiosyncratic setup, and I'm including just for illustrative purposes... you won't be able to run this.):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;SELECT t1.date, SUM(t1.ret * t2.prc * t2.shrout) / SUM(t2.prc * t2.shrout) as vw_ret&#xA;FROM (&#xA;    SELECT t1.permno, t1.date, t1.ret&#xA;    FROM q_stock.msf t1&#xA;    JOIN q_stock.mse e on t1.permno = e.permno and e.event = 'NAMES' and e.date &amp;lt;= t1.date and t1.date &amp;lt;= e.nameendt -- join with events file to get share code&#xA;    WHERE (exchcd = 1 or exchcd = 2 or exchcd = 3) and t1.date &amp;gt; 20000000 and t1.ret is not null and (shrcd = 10 or shrcd = 11)) t1&#xA;&#xA;JOIN mycrsp.yyyymm_date_link l ON t1.date = l.date&#xA;JOIN q_stock.msf t2 ON t1.permno = t2.permno and l.prev_date = t2.date -- lagged by 1 month to get market cap weights&#xA;WHERE t2.prc &amp;gt; 0 -- good prior month price data (FF may do more than this)&#xA;&#xA;GROUP BY t1.date&#xA;ORDER BY t1.date&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Note that Fama French factors have RMRF and RF so to get RM you do RM = RMRF + RF.)&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-08-12T15:45:25.180" LastActivityDate="2017-08-12T15:45:25.180" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="35570" PostTypeId="1" AcceptedAnswerId="35590" CreationDate="2017-08-12T01:11:20.517" Score="0" ViewCount="622" Body="&lt;p&gt;So I am attempting to calculate the Parabolic SAR over FX market data. I understand that the SAR equation is:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;SARt = SARt-1 + * [EPt-1 - SARt-1]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with EPt-1 changing depending on if it is a rising or falling SAR but my question is how is the initial/prior SAR (SARt-1) calculated at first with new data or at a transition point (changing from a rising to failing SAR).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any advice or books with the full mathematical definition would be much appreciated. Many thanks.&lt;/p&gt;&#xA;" OwnerUserId="29157" LastActivityDate="2017-08-13T23:19:13.070" Title="How do you calculate the initial prior SAR value in a Parabolic SAR over FX market data" Tags="&lt;fx&gt;&lt;indicator&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35571" PostTypeId="1" CreationDate="2017-08-12T01:33:20.510" Score="1" ViewCount="127" Body="&lt;p&gt;Suppose I'm running automated classic price arbitrage on 3 currencies (let's ignore the unfeasibility of this in our day and age). We have currency pairs Gold/Silver, Silver/Bronze, and Gold/Bronze.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have two questions:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) In general, is it better (in terms of being able to successfully execute a complete set of arbitrage trades over some period of time) for these pairs to demonstrate high or low volatility within that period of time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) Assume that Gold/Silver demonstrates &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(a) low volatility&#xA;(b) high volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In each of these cases, is which is better (in terms of being able to successfully execute a complete set of arbitrage trades over some period of time): having the other pairs demonstrate high volatility or low volatility within that period of time? Why?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Forgive me if this is an exceedingly elementary question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Follow up question: considering that it's best to execute a set of arb trades as soon as possible (lest someone else do it before you and move the prices against you), you'd probably want to measure volatility over second-long periods. Would volatility calculations over such [small] timeframes lose their significance?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; This link, &lt;a href=&quot;https://25iq.com/2014/07/09/a-dozen-things-ive-learned-from-jim-simons/&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;A Dozen Things I’ve Learned from Jim Simons&quot;&gt;&quot;A Dozen Things I’ve Learned from Jim Simons&quot;&lt;/a&gt; quotes Simons as saying:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Once in a while the phenomena we exploit are particularly present. We like a reasonable amount of volatility. In our business we want some action [...] Tumult is usually good for us.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This makes me think that higher volatility is better for arbitrage, but why? Also, this tumult may be amenable to several of Renaissance's strategies, but we don't know that arbitrage is one of said strategies, so I can't really draw any conclusions.&lt;/p&gt;&#xA;" OwnerUserId="29158" LastEditorUserId="29158" LastEditDate="2017-08-18T18:20:17.753" LastActivityDate="2017-08-18T19:57:15.343" Title="How does volatility affect price arbitrage?" Tags="&lt;volatility&gt;&lt;arbitrage&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35572" PostTypeId="1" CreationDate="2017-08-12T05:58:29.920" Score="1" ViewCount="1037" Body="&lt;p&gt;Proposition 2.10 of Tomas Bjork's &quot;Arbitrage Theory in Continuous Time&quot; states that if the general binomial model is free of arbitrage then it is also complete i.e. every contingent claim has a replicating portfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is the proof in question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/EMpmH.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/EMpmH.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this exact question has already been asked and answered &lt;a href=&quot;https://quant.stackexchange.com/questions/14065/arbitrage-free-implies-complete-market&quot;&gt;here&lt;/a&gt;, but I don't think that the answers are satisfactory because in the chosen answer he says that the system of linear equations only has a proof if $d &amp;lt; u$, but this is not true because it has a solution in the case that $d &amp;gt; u$ by symmetry and in the case of $d = u$ because then the two linear equations are the same. Also, the answer claims that by Proposition 2.3 $d &amp;lt; 1 + R &amp;lt; u$, but in the actual proposition these inequalities aren't strict!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure I really understand the top voted answer, but I get the feeling it is also not relevant because earlier in the chapter it says that we assume there is no bid-ask spread. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the last answer I feel like it might be an actual answer to the question, but I don't see why a unique risk neutral measure implies completeness. The book's definition for completeness is that you can price a claim, and I don't see how this definition relates to the definition about the uniqueness of risk neutral measures? &lt;/p&gt;&#xA;" OwnerUserId="29127" LastActivityDate="2017-08-12T08:33:15.477" Title="Why does arbitrage free imply complete market?" Tags="&lt;arbitrage&gt;&lt;no-arbitrage-theory&gt;&lt;binomial&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35573" PostTypeId="2" ParentId="35572" CreationDate="2017-08-12T08:33:15.477" Score="2" Body="&lt;p&gt;You agree that the proposition is proven if the equations have a unique solution.  You agree that there is a unique solution if u&gt;d.   Then we just have to show that u&gt;d.  But the definition of u and d is that we have a binomial model where there are two possible outcomes for the stock, a higher outcome su and a lower outcome sd.   Hence u&gt;=d by assumption , and in fact u&gt;d because if u=d we do not have a binomial model.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-08-12T08:33:15.477" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="35575" PostTypeId="1" CreationDate="2017-08-12T15:39:00.893" Score="0" ViewCount="245" Body="&lt;p&gt;By discount curve $D(t)$ I mean the discount rate applied to a cash payment or receipt at time $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is the correct terminology to use? I have seen the term &quot;yield curve&quot; thrown around, but I'm not exactly sure what it typically means, given that there are different compounding conventions, definitions of yield, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the same discount curve used for everything? In other words, are cash flows from government bonds, corporate bonds, swaps, etc. all discounted using the same discount curve? How is this discount curve typically constructed and where does OIS come into the picture?&lt;/p&gt;&#xA;" OwnerUserId="29161" LastEditorUserId="29161" LastEditDate="2017-08-12T15:59:13.913" LastActivityDate="2017-08-15T19:45:34.233" Title="When to use what discount rate?" Tags="&lt;discounting&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35576" PostTypeId="1" AcceptedAnswerId="35608" CreationDate="2017-08-12T19:27:00.510" Score="0" ViewCount="888" Body="&lt;p&gt;I'm trying to use the Black &amp;amp; Scholes to calculate the price for some options on the CBOE, but I'm having a hard time matching what I calculate with what i see on the market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example I took the following screenshot (from &lt;a href=&quot;https://www.cboe.com/delayedquote/quote-table?ticker=SPX&quot; rel=&quot;nofollow noreferrer&quot;&gt;this page&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Fd5oN.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Fd5oN.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the time of writing, the numbers are as follows:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;S&amp;amp;P500: 2441.32&lt;/li&gt;&#xA;&lt;li&gt;VIX (from &lt;a href=&quot;https://nl.investing.com/indices/volatility-s-p-500&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;): 15.51&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Together with a risk free interest rate of &lt;code&gt;5%&lt;/code&gt; I calculated the price for the option with the strike price of &lt;code&gt;$2450&lt;/code&gt; using &lt;a href=&quot;http://www.soarcorp.com/black_scholes_calculator.jsp&quot; rel=&quot;nofollow noreferrer&quot;&gt;an online Black&amp;amp;Scholes calculator&lt;/a&gt;. The price I got for the call option is &lt;code&gt;$2429.325&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/JKjeH.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/JKjeH.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;$2429.325&lt;/code&gt; is nowhere near the going rate of about &lt;code&gt;$36&lt;/code&gt; listed on the first screenshot above. Even if I multiply the rate of &lt;code&gt;$36&lt;/code&gt; with the usual multiplier of 100 I get &lt;code&gt;$3600&lt;/code&gt;, which is also nowhere near the &lt;code&gt;$2429.325&lt;/code&gt; I got from the Black&amp;amp;Scholes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anybody know what I'm doing wrong here? All tips are welcome!&lt;/p&gt;&#xA;" OwnerUserId="29160" LastEditorUserId="16160" LastEditDate="2017-08-13T12:05:32.540" LastActivityDate="2017-08-14T20:24:36.343" Title="Black &amp; Scholes doesn't give current option market price" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;pricing&gt;&lt;exchange&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35580" PostTypeId="2" ParentId="35576" CreationDate="2017-08-13T12:02:19.837" Score="2" Body="&lt;p&gt;The Black &amp;amp; Scholes model is exactly that: a model. And it is wrong. Stock price returns are not lognormal distributed with a constant vol. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your function is CallPrice(spot, strike, time, r, q, vol) and you give me all of the arguments, I can give you the price &lt;em&gt;according to the black Scholes model&lt;/em&gt;. If you give me the price, and all the inputs except one, then I can work out (essentially by trial and error) the possible values of the missing parameter that give the same price. If we do this for the volatility, given option to prices, we can work out the &lt;em&gt;Black &amp;amp; Scholes implied volatility&lt;/em&gt; for each option. And you'll get a different vol for each option (ie clearing the BS model is inconsistent). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So then you have the question why use this model and work out the implied volatility? It is simply a mapping from option price to something else, you could just as easily decide you want to look at your option prices as their value above intrinsic (ie time value). Is makes it easier to compare a stock to itself in the past. To see where options are overpriced vs historical levels, etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is problem 1. Problem two is that you're using vix. Vix is the &quot;30 day option implied varswap par rate&quot;, it is calculated using g the varswap static replication portfolio, which is essentially a weighted sum over otm options. It's okay as an approximation, but it will be higher than the atm vol (which is approx. what you need). &lt;/p&gt;&#xA;" OwnerUserId="19663" LastActivityDate="2017-08-13T12:02:19.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35581" PostTypeId="1" CreationDate="2017-08-13T12:06:56.307" Score="2" ViewCount="2128" Body="&lt;p&gt;We know that a stock has discrete dividend payings $D_i$ at $t_i$, in the pricing of a forward, we will calculate the discount cash flows&#xA;$$\sum e^{-rt_i}D_i$$&#xA;then minus the sum of discount cash flows from spot time $S_0.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And if stock has a continuous dividend paying rate $D,$ we have the forward price&#xA;$$e^{-DT}S_0 - e^{-rT}K.$$&#xA;So how to understand $e^{-DT}S_0$ is same as $S_0 - \sum e^{-rt_i}D_i$ i.e the spot price minus the discounted cash flows of dividend. Or when $\Delta t = t_{i+1} - t_i\rightarrow 0，$ how to obtain the  compatible result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose, we pay dividend rate $\alpha_i$(include multiplying time $\Delta t$) at time $t_i$ with $i =1,2,3$ and $S_{t_i-}$ means the price before dividend paying, we have&#xA;$$S_{t_i} = (1 - \alpha_i)S_{t_i-}.$$&#xA;And we use the factor that the discounted stock price before dividend paying should be martingale. So we receive dividend $\alpha_3 S_{t_3-}$ at time $t_3,$ the expected value at time $t_2$ under risk neutral measure should be&#xA;$$E[e^{-r(t_3-t_2)}\alpha_3 S_{t_3-}] = \alpha_3 S_{t_2}$$&#xA;$$= \alpha_3(1 - \alpha_2)S_{t_2-}.$$&#xA;Again to discounted to time $t_1,$ we have&#xA;$$\alpha_3(1 - \alpha_2)(1 - \alpha_1)S_{t_1-}.$$&#xA;Finally, we have discounted value at time $0$ of dividend $t_3$&#xA;$$\alpha_3(1 - \alpha_2)(1 - \alpha_1)S_0$$&#xA;then dividend $t_2$ is &#xA;$$\alpha_2(1 - \alpha_1)S_0,$$&#xA;then dividend $t_1$ is &#xA;$$\alpha_1S_0.$$&#xA;Then the initial value minus the discounted dividend should be&#xA;$$S_0 - \alpha_3(1 - \alpha_2)(1 - \alpha_1)S_0 - \alpha_2(1 - \alpha_1)S_0 - \alpha_1S_0$$&#xA;$$=(1-\alpha_3)(1 - \alpha_2)(1 - \alpha_1)S_0.$$&lt;/p&gt;&#xA;" OwnerUserId="26165" LastEditorUserId="16148" LastEditDate="2017-10-13T17:38:45.057" LastActivityDate="2017-11-12T18:28:26.643" Title="How to understand the compatibility between the discrete and continuous dividend payments" Tags="&lt;options&gt;&lt;discrete-dividends&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35582" PostTypeId="1" CreationDate="2017-08-13T13:53:03.070" Score="-1" ViewCount="114" Body="&lt;p&gt;Apologies in advance if this question has been asked already. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am estimating basis risk for different term points in the curve. Imagine i have three time series (1-month, 3-month, 1-year). I believe they are NOT independent of each other.  I have estimated the absolute daily change for each one of them (% change didn't work as some time series switch from negative to positive, or the other way around). I could generate a variance/covariance matrix of the absolute daily change in these three time series, and calculate some sort of a 'portfolio' standard deviation (assuming equal weights). This standard deviation would be in basis points, as mentioned above. For instance, 2 bps. I could also generate some sort of an expected value (average) for this portfolio, for instance 10 bps. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question that I have is: how do I interpret the standard deviation in the context of each separate time series? If i want to estimate tail risk for this portfolio, is it accurate to (assuming normal distribution), to just estimate 2 standard deviations from the mean and analyze the tail risk from that data point? What would 4 basis points mean for each time series, i.e., how do I transform this portfolio tail risk to each time series, given that it is not proportional (%) change, but rather absolute change?&lt;/p&gt;&#xA;" OwnerUserId="29040" LastActivityDate="2017-10-13T18:09:14.533" Title="Covariance Interest Rate Risk Time Series" Tags="&lt;interest-rates&gt;&lt;var&gt;&lt;covariance-matrix&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35583" PostTypeId="2" ParentId="35518" CreationDate="2017-08-13T14:34:25.573" Score="1" Body="&lt;p&gt;Fx futures and fx forwards with the same expiration are an excellent hedge for each other.  They basically trade on top of each other.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-08-13T14:34:25.573" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35585" PostTypeId="1" AcceptedAnswerId="35586" CreationDate="2017-08-13T18:14:56.163" Score="0" ViewCount="252" Body="&lt;p&gt;Suppose gold futures are selling at 360 in February, and 370 in April. Interest is 9% annually. Note that 360*(1+0.09*2/12)=365.4, so the April futures is overpriced. Then we can sell April and buy February. We borrow 360 in February, hold the gold until April, and pay off the loan and deliver gold in April to get $4.6 in April for sure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure what the analogous trade is if the April futures is underpriced - say April is 364. Then we should buy April and sell February. But we don't have gold to deliver in February.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help completing this last trade is greatly appreciated. Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="29172" LastActivityDate="2017-08-13T18:55:48.520" Title="Taking advantage of mispricing in forwards" Tags="&lt;options&gt;&lt;futures&gt;&lt;arbitrage&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2017-08-14T09:13:14.583" ContentLicense="CC BY-SA 3.0" />
  <row Id="35586" PostTypeId="2" ParentId="35585" CreationDate="2017-08-13T18:41:30.753" Score="2" Body="&lt;p&gt;You are right. There is a basic asymmetry there. Because of storage there is an upper limit to $F_{apr}-F_{feb}$ but no such upper limit to $F_{feb}-F_{apr}$. You can still express your opinion by buying april futures and selling feb, but it is not an arbitrage (you'll make money if you are right and lose if you are wrong).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or as traders sometimes put it &quot;for a storable commodity there is a limit to contango but not to backwardation&quot;. &lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2017-08-13T18:55:48.520" LastActivityDate="2017-08-13T18:55:48.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35588" PostTypeId="1" AcceptedAnswerId="35589" CreationDate="2017-08-13T22:33:57.023" Score="6" ViewCount="459" Body="&lt;p&gt;On the website &lt;a href=&quot;https://25iq.com/2014/07/09/a-dozen-things-ive-learned-from-jim-simons/&quot; rel=&quot;noreferrer&quot;&gt;https://25iq.com/2014/07/09/a-dozen-things-ive-learned-from-jim-simons/&lt;/a&gt;  (&lt;a href=&quot;https://web.archive.org/web/20170813231131/https://25iq.com/2014/07/09/a-dozen-things-ive-learned-from-jim-simons/&quot; rel=&quot;noreferrer&quot;&gt;mirror&lt;/a&gt;), James Simons cited “We have three criteria. If it’s publicly traded, liquid and amenable to modeling, we trade it.” Why liquid?&lt;/p&gt;&#xA;" OwnerUserId="29154" LastEditorUserId="2183" LastEditDate="2017-08-13T23:12:53.073" LastActivityDate="2017-08-17T18:40:24.317" Title="Why James Simons trades it only if it is liquid?" Tags="&lt;finance&gt;" AnswerCount="4" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35589" PostTypeId="2" ParentId="35588" CreationDate="2017-08-13T23:03:29.863" Score="6" Body="&lt;p&gt;Liquid =&gt; low transactions costs. When you are trying to take advantage of small anomalies you need transaction costs to be low.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[Added 2017-08-13]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Simons does not believe there are big price inefficiencies; he does not think you can buy for 10 something that is worth 20 tomorrow. He thinks there are many small anomalies where a security is mispriced by a fraction of a percent. To profit from this you need: to combine many securities (so the randomness washes out) and to concentrate on securities with low transaction costs (if an illiquid security is &quot;10 bid 11 ask&quot; that is a 10% round trip transaction cost, no way you can overcome that with a fraction of a percent per month price appreciation).&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2017-08-14T00:19:54.687" LastActivityDate="2017-08-14T00:19:54.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35590" PostTypeId="2" ParentId="35570" CreationDate="2017-08-13T23:19:13.070" Score="1" Body="&lt;p&gt;So after looking through and doing some reverse engineering of some implementations I think I have found the answer.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;public static ParabolicSAR GenerateFirstSAR (ParabolicSAR sar,double[] high, double[] low) {&#xA;    if (high[0] &amp;lt; high[1]) {&#xA;        ...&#xA;        sar.sars.add(Math.min(low[0], low[1]));&#xA;        ...&#xA;    } else {&#xA;        ...&#xA;        sar.sars.add(Math.max(high[0], high[1]));&#xA;        ...&#xA;    }&#xA;    return sar;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In this high is an array of all the high points but you really only need 2 and then low is the low points. Same rule applies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this broken down means that for a rising condition the primary SAR is the minium value from the first 2 low points.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Math.min(low[0], low[1])&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;And visa versa for a failing condition.&lt;/p&gt;&#xA;" OwnerUserId="29157" LastActivityDate="2017-08-13T23:19:13.070" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35591" PostTypeId="1" CreationDate="2017-08-13T23:50:29.917" Score="1" ViewCount="56" Body="&lt;p&gt;Under risk-neutral measure, all assets have expected return at risk-free rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This includes stock, or equity prices. But what of the fact that equities typically have higher returns than the risk-free rate (the equity risk premium)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am guessing that I am confusing risk-neutral measure with the real-world measure. But then what good is the risk-neutral measure if the expected returns is not what one actually observes in the real-world market?&lt;/p&gt;&#xA;" OwnerUserId="29161" LastActivityDate="2017-08-13T23:50:29.917" Title="Why is expected equity returns the risk-free rate under risk-neutral measure?" Tags="&lt;equities&gt;" AnswerCount="0" CommentCount="2" ClosedDate="2017-08-14T09:11:29.467" ContentLicense="CC BY-SA 3.0" />
  <row Id="35592" PostTypeId="1" CreationDate="2017-08-14T01:54:16.813" Score="0" ViewCount="223" Body="&lt;p&gt;Here is the example of future option in John Holl's book &lt;code&gt;Options, Futures and Other Derivatives  9th&lt;/code&gt; page 384.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't understand that when you exercise the future call option, you enter a long position of a future, then what's the price of your future? Actually, I don't much understand the &lt;code&gt;P&amp;amp;L on future&lt;/code&gt; when you close out the future after exercise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For my understand, you hold a long position of future with price $331,$ when you exercise, the price become $330,$ then you should &lt;code&gt;lose the money&lt;/code&gt;&#xA;$$25000\times(331-330)$$&#xA;but not &lt;code&gt;earn the money&lt;/code&gt; in the book, so where is my misunderstand?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/QHXAG.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/QHXAG.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26165" LastEditorUserId="26165" LastEditDate="2017-08-14T02:01:43.190" LastActivityDate="2017-08-14T02:32:01.033" Title="What's the future price when you exercise the future option" Tags="&lt;options&gt;&lt;futures&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35593" PostTypeId="2" ParentId="35592" CreationDate="2017-08-14T02:32:01.033" Score="1" Body="&lt;p&gt;This goes down to a specificity of options on futures. A future is not a stock, you need to know the entry price to compute the mark-to-market. You can't deliver a future/forward without specifying at which price it was entered. Futures are settled everyday so you will use the last settlement price as the entry price of the delivered future contracts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Close of August 14th : 330 cents (settlement price of the future, SP)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Spot price on August 15th : 331 cents (spot price of the future, F)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you exercice a call option on a future contract you receive the future contract + the (positive) difference between strike price and settlement price (10 cents). When you sell the future contract you receive the difference between the settlement price and the spot price (1 cent).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cash received = (SP - K) + (F - SP) = F - K&lt;/p&gt;&#xA;" OwnerUserId="1181" LastActivityDate="2017-08-14T02:32:01.033" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35594" PostTypeId="2" ParentId="35531" CreationDate="2017-08-14T02:48:44.440" Score="1" Body="&lt;p&gt;This is a bit too general, it really depends of the optionality of the contract : who can break the contract and when ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The repo for a given maturity is just a market parameter, like spot, or interest rate, you don't price spot or interest rate, you take it for granted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, if the repo is open in the sense of one day tacit reconduction there is not much to price, it's just the 1-day repo rate. If it changes then you re-rate your repo and that's all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more complex structures such as evergreen (unilateral break with a notice period), pricing should be used in theory (using implied vol of the repo) but actually I have never seen these structures priced in a quantitative way. In the bulge bracket bank I used to work, this parameter didn't even exist (repo vol). Without sounding demeaning this area of finance is more about relationships, legal considerations and regulatory optimization than accurate pricing of repo volatility and structures to the third digit.&lt;/p&gt;&#xA;" OwnerUserId="1181" LastActivityDate="2017-08-14T02:48:44.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35595" PostTypeId="1" CreationDate="2017-08-14T08:09:55.007" Score="-1" ViewCount="624" Body="&lt;p&gt;We want to use the &lt;code&gt;Duration&lt;/code&gt; to convert &lt;code&gt;forward price volatility&lt;/code&gt; to &lt;code&gt;yield volatility&lt;/code&gt; with following relation&#xA;$$\dfrac{\Delta F_B}{F_B} = -D \Delta y_F.$$&#xA;But how to calculate the the &lt;code&gt;yield of forward bond price?&lt;/code&gt; if we know the zero curve $Z(t^*,T).$ In the example it seems directly use the rate of zero curve. I only know the how to calculate the yield of a bond with following relation:&#xA;$$\dfrac{\Delta B}{B} = -D \Delta y$$&#xA;here $B$ is the bond price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example:&#xA;Consider a &lt;code&gt;European put option&lt;/code&gt; on a 10-year bond with a principal of 100.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The coupon is 8% per year payable semiannually.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The life of the option is 2.25 years&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The strike price of the option is 115.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The forward yield volatility is 20%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The zero curve is flat at 5% with continuous compounding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is some computation. What I don't understand is the &lt;code&gt;yield with semiannual compounding&lt;/code&gt; $5.0630\%.$ I know how to calculate the yield of a coupon bond, but here how to obtain the yield of a  forward  $5.0630\%?$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/akxK1.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/akxK1.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26165" LastEditorUserId="26165" LastEditDate="2017-08-15T01:26:43.823" LastActivityDate="2017-10-14T02:14:11.503" Title="How to calculate the yield of a forward bond price from the zero curve" Tags="&lt;forward&gt;&lt;yield&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35596" PostTypeId="2" ParentId="35581" CreationDate="2017-08-14T11:31:45.050" Score="5" Body="&lt;p&gt;This equivalence can only be written for discrete &lt;em&gt;proportional dividends&lt;/em&gt;. For discrete &lt;em&gt;cash&lt;/em&gt; dividends the two spot diffusion models are too different for that relationship to be written in general form (since the div yield model guarantees strictly positive future equity prices, while using discrete cash dividends does not). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;More specifically, if you have $N$ evenly spaced discrete proportional dividend payments over $[0,T[$ the div over the first period makes you move from $S_0$ to $S_0(1-q\Delta t)$ with $\Delta t=T/N$. Denote the resulting spot value by $S_{\Delta t}$. The next makes you move from $S_{\Delta t}$ to $S_{\Delta t}(1-q\Delta t)$ etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the end of the day you get: $$S_{T=N\Delta t} = S_0(1-q\Delta t)^N = S_0(1-q\Delta t)^{T/\Delta t}$$ Now taking the limit as $\Delta t \to 0$, knowing that $\lim_{x \to 0} \exp(-x) = 1-x$ you heuristically get: $$\lim_{\Delta t \to 0} S_T = S_0 \exp(-q \Delta t)^{T/\Delta t} = S_0 \exp(-qT)$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For discrete proportional dividends (payment date = ex-date), under $\Bbb{Q}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dS_t = r S_t dt + \sigma S_t dW_t^\Bbb{Q} - \sum_i D(S_{t_i^-}) \delta(t-t_i) dt $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ D(S_{t_i^-})=\alpha_i S_{t_i^-}, \alpha_i \in [0,1[ $$&#xA;Applying Itô's lemma for semi-martingales with jumps and integrating from $t=0$ to $t=T$ yields&#xA;\begin{align*}&#xA;\ln S_T - \ln S_0 &amp;amp;= \left(r - \frac{\sigma^2}{2} \right) T + \sigma W_T^{\Bbb{Q}} + \sum_{i : 0 &amp;lt; t_i \le T} \left[ \ln(S_{t_i}) - \ln(S_{t_i^-}) \right]\\&#xA;				  &amp;amp;= \left(r - \frac{\sigma^2}{2} \right) T + \sigma W_T^{\Bbb{Q}} + \sum_{i : 0 &amp;lt; t_i \le T} \left[ \ln \left( \frac{S_{t_i^-}-D(S_{t_i^-})}{S_{t_i^-}} \right) \right]\\&#xA;				  &amp;amp;= \left( r - \frac{\sigma^2}{2} \right) T + \sigma W_T^{\Bbb{Q}} + \sum_{i : 0 &amp;lt; t_i \le T} \ln(1-\alpha_i)	  &#xA;\end{align*}&#xA;hence&#xA;\begin{align}&#xA;S_T = S_0 \prod_{i : 0 &amp;lt; t_i \le T} (1-\alpha_i) \exp \left( r T\right) \mathcal{E}[\sigma W_T^{\Bbb{Q}}] &#xA;\end{align}&#xA;where $\mathcal{E}[X_t]$ figures the stochastic exponential of the process $X_t$, i.e. $\mathcal{E}[X_t] = \exp(X_t - 1/2[X,X]_t)$, hence&#xA;$$ F(0,T) = S_0 \prod_{i : 0 &amp;lt; t_i \le T} (1-\alpha_i) e^{r T} \tag{A} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly if you assume a continuous dividend yield:&#xA;$$ dS_t = (r - q) S_t dt + \sigma S_t dW_t^\Bbb{Q} $$&#xA;you would have obtained the well-known result&#xA;$$ S_T = S_0 e^{(r-q)T} \mathcal{E}\left[ \sigma W_T^\Bbb{Q} \right]$$&#xA;hence&#xA;$$ F(0,T) = S_0 e^{(r-q)T} \tag{B} $$&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2017-08-14T14:08:34.373" LastActivityDate="2017-08-14T14:08:34.373" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="35598" PostTypeId="2" ParentId="34902" CreationDate="2017-08-14T12:55:33.247" Score="1" Body="&lt;p&gt;I think the reason is that the performance scenarios should not be based on the risk-neutral world. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can clearly see that for Category 3, where in Annex IV, p. 12a the regulation requires that &lt;em&gt;&quot;the expected return for each asset or assets shall be the return observed over&quot;&lt;/em&gt; the underlying history, hence one does not correct for impact of the mean as required for the MRM. Similarly, the Category 2 formulas, also include the mean for the regular performance scenarios. &lt;/p&gt;&#xA;" OwnerUserId="26173" LastActivityDate="2017-08-14T12:55:33.247" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35600" PostTypeId="2" ParentId="21043" CreationDate="2017-08-14T15:07:57.517" Score="0" Body="&lt;p&gt;Look at the contract specification pages, e.g.  &lt;a href=&quot;http://www.cmegroup.com/trading/equity-index/us-index/e-mini-sandp500_contractSpecs_options.html?140=&quot; rel=&quot;nofollow noreferrer&quot;&gt;E-mini S&amp;amp;P 500 Options Contract Specs&lt;/a&gt;  (&lt;a href=&quot;https://web.archive.org/web/20170814150642/http://www.cmegroup.com/trading/equity-index/us-index/e-mini-sandp500_contractSpecs_options.html?140=&quot; rel=&quot;nofollow noreferrer&quot;&gt;mirror&lt;/a&gt;):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Listed Contracts: Four months in the March Quarterly Cycle (Mar, Jun, Sep, Dec)&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Strike Price Listing Procedures:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;At all multiples of 25 index points within ±50% of Exercise Price Reference, centered on previous day’s settlement price of the underlying futures&lt;/li&gt;&#xA;&lt;li&gt;At all multiples of 10 index points within ±20% of Exercise Price Reference, centered on previous day’s settlement price of the underlying futures&lt;/li&gt;&#xA;&lt;li&gt;Once the option’s underlying futures contract becomes second nearest to delivery, at all multiples of 5 index points within ±10% of Exercise Price Reference, centered on previous day’s settlement price of the underlying futures&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/X1iXT.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/X1iXT.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2183" LastActivityDate="2017-08-14T15:07:57.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35603" PostTypeId="2" ParentId="35582" CreationDate="2017-08-14T17:45:03.963" Score="1" Body="&lt;p&gt;If $v$ is a vector of DV01 ezposures versus your various risk factors/buckets and $\Sigma$ is your covariance matrix tegen portfolio (delta-normal) Var is given by $$\alpha \sqrt{v^T \Sigma v }$$ where $\alpha$ is some point from the inverse cumulative normal.this gives you risk in cash (money) terms rather than % losses.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are other ways to measure tail risks of course, both in metrics and methodology, but this looks like what you're after&lt;/p&gt;&#xA;" OwnerUserId="11851" LastActivityDate="2017-08-14T17:45:03.963" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35604" PostTypeId="2" ParentId="35595" CreationDate="2017-08-14T17:52:54.417" Score="0" Body="&lt;p&gt;You need to convert from continuous compounding to simple compounding. With a continuous rate $r_c$, \$1 grows in one year to $exp(r_c)$. With semi-annual compounding at an annualized rate $r_s$ it grows to $(1+r_s/2)^2$. Equating the two you can convert one into an equivalent yield on the other.&lt;/p&gt;&#xA;" OwnerUserId="11851" LastActivityDate="2017-08-14T17:52:54.417" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="35605" PostTypeId="1" AcceptedAnswerId="35609" CreationDate="2017-08-14T18:18:47.583" Score="2" ViewCount="1432" Body="&lt;p&gt;I am able to see why Expected Shortfall will be subadditive for normal distribution or a uniform distribution. I am trying to prove the result for any generic distribution. I came across many proofs available on the internet, but the math involved is too complex in all of them. Is there any simple explanation why ES is subadditive for any generic distributions?&lt;/p&gt;&#xA;" OwnerUserId="27273" LastActivityDate="2017-08-14T20:39:21.653" Title="Subadditivity of Expected Shortfall" Tags="&lt;probability&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35607" PostTypeId="2" ParentId="35576" CreationDate="2017-08-14T20:11:51.697" Score="1" Body="&lt;p&gt;Option prices are not determined by a model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Option prices are determined by an exchange matching two traders' bid and ask. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The model is simply an attempt to explain why that specific bid and ask was reached. The real answer is &quot;because both sides of the trade thought it was acceptable.&quot;&lt;/p&gt;&#xA;" OwnerUserId="19473" LastActivityDate="2017-08-14T20:11:51.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35608" PostTypeId="2" ParentId="35576" CreationDate="2017-08-14T20:24:36.343" Score="3" Body="&lt;p&gt;Also, your input for volatility into the BS Calculator is 1551%. I am assuming you want to input the volatility as 15.51%, which would be 0.1551.&lt;/p&gt;&#xA;" OwnerUserId="29114" LastActivityDate="2017-08-14T20:24:36.343" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35609" PostTypeId="2" ParentId="35605" CreationDate="2017-08-14T20:39:21.653" Score="3" Body="&lt;p&gt;The expected shortfall is defined by&#xA;\begin{align*}&#xA;ES_{\alpha} = \frac{1}{1-\alpha}\int_{\alpha}^1 VaR_{p}(L) dp,&#xA;\end{align*}&#xA;where $L$ is the loss function. For the case with 500 scenarios, the $\alpha=99\,\%$ percentile VaR is approximately the $5^{\rm th}$ worst loss scenario. The expected shortfall can then be approximated by the average of the 5 worst losses, times $-1$ (we take $ES_{\alpha}$ to be positive). That is,&#xA;\begin{align*}&#xA;ES_{\alpha}(L) = -\frac{1}{5}\sum_{i=1}^5 L(i),&#xA;\end{align*}&#xA;where $L(i)$ is the $i^{\rm th}$ worst loss scenario. Assuming that the loss $L$ can be decomposed into the losses $L_1$ and $L_2$ from two sub-portfolios. That is $$L=L_1+L_2.$$ Then&#xA;$$L(i) = L_1(i)+L_2(i).$$ However, it is easy to see that, though $L(1), \ldots, L(5)$ are the 5 worst loss scenarios of $L$, $L_j(1), \ldots, L_j(5)$, for $j=1, 2$, are not necessarily the 5 worst loss scenarios for $L_j$. In other words, for $j=1, 2$,&#xA;\begin{align*}&#xA;ES_{\alpha}(L_j) \ge -\frac{1}{5}\sum_{i=1}^5 L_j(i).&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;ES_{\alpha}(L) &amp;amp;= -\frac{1}{5}\sum_{i=1}^5 L(i)\\&#xA;&amp;amp;=-\frac{1}{5}\sum_{i=1}^5 L_1(i)-\frac{1}{5}\sum_{i=1}^5 L_2(i)\\&#xA;&amp;amp;\le ES_{\alpha}(L_1) + ES_{\alpha}(L_2).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2017-08-14T20:39:21.653" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35611" PostTypeId="2" ParentId="35588" CreationDate="2017-08-14T21:46:46.007" Score="5" Body="&lt;p&gt;A market being liquid also means that the books are deeper. This implies that you can trade larger volumes without moving the market prices as much. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A liquid market also allows you to reverse your position quickly and avoid being stuck with unwanted assets. &lt;/p&gt;&#xA;" OwnerUserId="29189" LastActivityDate="2017-08-14T21:46:46.007" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35613" PostTypeId="1" AcceptedAnswerId="35615" CreationDate="2017-08-15T01:46:39.227" Score="0" ViewCount="48" Body="&lt;p&gt;Here is a example of &lt;code&gt;Cap option&lt;/code&gt; in John Holl's book &lt;code&gt;Options, Futures and Other Derivatives  9th&lt;/code&gt; &lt;code&gt;page 681.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One thing I am confused that there are two discounted rate, one is &lt;code&gt;LIBOR/swap zero curve is flat at 7%&lt;/code&gt; and the other is &lt;code&gt;The continuously compounded zero rate for all maturities is 6.9395%.&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here we use forward price $F_k,$ it seems we should use the &lt;code&gt;LIBOR&lt;/code&gt; as the a discounted rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/65gg4.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/65gg4.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26165" LastEditorUserId="26165" LastEditDate="2017-08-15T01:51:40.870" LastActivityDate="2017-08-15T06:51:01.073" Title="What's discounted rate used in the cap option" Tags="&lt;options&gt;&lt;bond&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35615" PostTypeId="2" ParentId="35613" CreationDate="2017-08-15T06:51:01.073" Score="1" Body="&lt;p&gt;7% annual LIBOR with quarterly payment = 4 * 1.75% coupons&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1.0175 ^ 4 = 1.071859&lt;/p&gt;&#xA;&#xA;&lt;p&gt;ln(1.071859) = 6.9395%, the continuously compounded rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the second question you ask about converting yields with different quoting conventions, I suggest you read some literature about this before attempting more complex equations. By the way it's John Hull, John Holl is writing beer guides.&lt;/p&gt;&#xA;" OwnerUserId="1181" LastActivityDate="2017-08-15T06:51:01.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35616" PostTypeId="1" AcceptedAnswerId="35622" CreationDate="2017-08-15T10:48:35.273" Score="2" ViewCount="742" Body="&lt;p&gt;Here is &lt;code&gt;quanto adjustments&lt;/code&gt; in John Hull's book &lt;code&gt;Options, Futures and Other Derivatives  9th&lt;/code&gt; &lt;code&gt;page 699.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/TDmZW.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/TDmZW.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that we have&#xA;$$E_X[V] = E_Y[VW].$$&#xA;And, $V$ and $W$ should be both martingale under $Y$-measure, so we simply write&#xA;$$\dfrac{dV}{V} = \sigma_V d W_V$$&#xA;$$\dfrac{dW}{W} = \sigma_W  d W_W$$&#xA;$$d W_Vd W_W = \rho d t$$&#xA;But how can we obtain the final result in the book&#xA;$$E_X[V] = E_Y[V]e^{\rho \sigma_V\sigma_W T}.$$&#xA;It seems not the same result as two log-normal?&lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-08-15T17:25:58.040" Title="quanto adjustments" Tags="&lt;derivatives&gt;&lt;numerairechange&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35618" PostTypeId="2" ParentId="21043" CreationDate="2017-08-15T12:33:08.457" Score="0" Body="&lt;p&gt;It does not really matter when an option was issued. All that matters is the time remaining until expiration.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose there are two exchanges, one issues the options 12 months before expiration, the other 6 months before expiration. Then for the last 6 months, two options with identical strike trade at the same price, by arbitrage. It does not matter that one is &quot;older&quot; (has been trading for longer) than the other one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The idea that &quot;options lose 2/3 of their time value in the second half of their lifespan&quot; is because $\sqrt{\frac{1}2{}}= 0.7 $ but does not imply it is &quot;good&quot; to own options that have been recently issued.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-08-15T12:46:29.840" LastActivityDate="2017-08-15T12:46:29.840" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35620" PostTypeId="1" AcceptedAnswerId="35623" CreationDate="2017-08-15T12:57:15.333" Score="0" ViewCount="393" Body="&lt;p&gt;I was always under the impression that, ceteris paribus, higher the coupon rate, higher the convexity of the bond. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/AKE5K.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/AKE5K.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But &lt;a href=&quot;http://www.investopedia.com/terms/c/convexity.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;Investopedia&lt;/a&gt; says the following: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&quot;zero-coupon bonds have the highest degree of convexity&quot;&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Isn't that wrong? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please correct me if I am missing something here. &lt;/p&gt;&#xA;" OwnerUserId="27273" LastEditorUserId="26595" LastEditDate="2017-08-15T13:28:53.203" LastActivityDate="2017-08-15T16:19:09.757" Title="A very simple question about convexity of a bond" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;bond-yields&gt;&lt;convexity&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35621" PostTypeId="1" CreationDate="2017-08-15T13:28:46.287" Score="1" ViewCount="78" Body="&lt;p&gt;I know there exist lots of method to estimate the Hurst parameter, such as R/S, V/S, GHE, DFA, DMA, Wavelet Spectral Density, Whittle  and so on. &#xA;Can you tell me which one is the best one. Is anyone compare these method?&lt;/p&gt;&#xA;" OwnerUserId="26890" LastActivityDate="2017-08-22T11:51:46.687" Title="which method is the roubust method to estimate the Hurst parameter?" Tags="&lt;time-series&gt;&lt;statistics&gt;&lt;statistical-finance&gt;&lt;continuous-time&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35622" PostTypeId="2" ParentId="35616" CreationDate="2017-08-15T13:51:59.557" Score="3" Body="&lt;p&gt;I believe that the dynamics for $V$, under $Y$, is not the form you provided. In particular, a measure change will change the drift of $V$. &#xA;Specifically, the dynamics of $V$ is typically of the form &#xA;\begin{align*}&#xA;\frac{dV}{V} = -\sigma_V\sigma_W \rho dt + \sigma_V d W_V.&#xA;\end{align*}&#xA;You can now check that the final result holds.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Addendum&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;We assume that, under $X$, $V$ satisfies an SDE of the form&#xA;\begin{align*}&#xA;\frac{dV}{V} = \sigma_V d \widetilde{W}_V.&#xA;\end{align*}&#xA;Moreover, the Radon-Nikodym derivative $\eta = \frac{dY}{dX}$ satisfies&#xA;\begin{align*}&#xA;\frac{d\eta}{\eta} = \sigma_W d \widetilde{W}_W,&#xA;\end{align*}&#xA;where $d\langle \widetilde{W}_V, \widetilde{W}_W\rangle = \tilde{\rho} dt$. Then, by Cholesky decomposition,&#xA;\begin{align*}&#xA;\frac{d\eta}{\eta} = \sigma_W d \left(\tilde{\rho}\widetilde{W}_V+ \sqrt{1-\tilde{\rho}^2} \widetilde{B}_W\right).&#xA;\end{align*}&#xA;where $\widetilde{W}_V$ and $\widetilde{B}_W$ are two independent standard Brownian motions.&#xA;Moreover, by Girsanov transformation,&#xA;\begin{align*}&#xA;W_V &amp;amp;= \widetilde{W}_V - \sigma_W \tilde{\rho} t\, \mbox{ and}\\&#xA;B_W &amp;amp;= \widetilde{B}_W - \sigma_W \sqrt{1-\tilde{\rho}^2} t&#xA;\end{align*} &#xA;are two standard Brownian motions under $Y$. Let $W= \eta^{-1} = \left(\frac{dY}{dX}\right)^{-1}$. Then, under $Y$,&#xA;\begin{align*}&#xA;\frac{dV}{V} &amp;amp;= \sigma_V\sigma_W\tilde{\rho} dt +\sigma_V d W_V,\\&#xA;\frac{dW}{W} &amp;amp;=\eta d\left(\frac{1}{\eta}\right)\\&#xA;&amp;amp;= -\frac{d\eta}{\eta}+\frac{1}{\eta^2} d\langle \eta,\eta\rangle\\&#xA;&amp;amp;=\sigma_W^2 dt -\sigma_W d \left(\tilde{\rho}\widetilde{W}_V+ \sqrt{1-\tilde{\rho}^2} \widetilde{B}_W\right)\\&#xA;&amp;amp;=-\sigma_W d \left(\tilde{\rho}W_V+ \sqrt{1-\tilde{\rho}^2} B_W\right).&#xA;\end{align*}&#xA;Let $\rho=-\tilde{\rho}$ and $W_W=\tilde{\rho}W_V+ \sqrt{1-\tilde{\rho}^2} B_W$. Then, under $Y$,&#xA;\begin{align*}&#xA;\frac{dV}{V} &amp;amp;= -\sigma_V\sigma_W\rho dt +\sigma_V d W_V,\\&#xA;\frac{dW}{W} &amp;amp;=\sigma_W d W_W,&#xA;\end{align*} &#xA;where $d\langle W_V, W_W\rangle_t = \rho dt.$ Moreover, &#xA;\begin{align*}&#xA;E_X(V) &amp;amp;= E_Y\left(\frac{dX}{dY} V \right)\\&#xA;&amp;amp;=E_Y\left(\left(\frac{dY}{dX}\right)^{-1} V \right)\\&#xA;&amp;amp;=E_Y(VW).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-08-15T17:25:58.040" LastActivityDate="2017-08-15T17:25:58.040" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="35623" PostTypeId="2" ParentId="35620" CreationDate="2017-08-15T14:56:46.590" Score="6" Body="&lt;p&gt;The chart you posted does not give a correct visual representaion of convexity . Convexity is not $\frac{\partial^2 P}{\partial y^2}$ but $\frac{1}{P}\frac{\partial^2 P}{\partial y^2}$. So you have to normalize for P. The 4 curves you plot have very different P.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When the curves are redrawn normalized so they go through the same point $(y_0,P_0)$ you will see that smaller coupons have bigger convexity. And zero coupons the biggest of all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put differently: convexity is measured &quot;per dollar invested&quot; not &quot;per bond&quot;.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-08-15T16:19:09.757" LastActivityDate="2017-08-15T16:19:09.757" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35624" PostTypeId="2" ParentId="9968" CreationDate="2017-08-15T15:03:20.630" Score="1" Body="&lt;p&gt;I can't post comments yet, so I will put it here. The second link to the answer above does not work. Can anyone provide the reference to the iceberg chasing paper by Almgren?&lt;/p&gt;&#xA;" OwnerUserId="29189" LastActivityDate="2017-08-15T15:03:20.630" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35625" PostTypeId="1" CreationDate="2017-08-15T15:07:58.480" Score="11" ViewCount="1141" Body="&lt;p&gt;What would be the best algorithm to identify Iceberg Orders? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have found one in the paper &quot;The Impact of Hidden Liquidity in Limit Order Books&quot; by Stefan Frey and Patrik Sandas, but I was wondering if anyone here would have inputs on the subject. &lt;/p&gt;&#xA;" OwnerUserId="29189" LastEditorUserId="31393" LastEditDate="2021-04-18T23:44:31.500" LastActivityDate="2021-04-18T23:44:31.500" Title="Identify Iceberg Orders" Tags="&lt;programming&gt;&lt;market-microstructure&gt;&lt;limit-order-book&gt;&lt;depth-of-market&gt;" AnswerCount="3" CommentCount="6" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="35626" PostTypeId="1" AcceptedAnswerId="35792" CreationDate="2017-08-15T16:07:19.120" Score="0" ViewCount="1609" Body="&lt;p&gt;I'm trying to get the values for the turn of year jumps that can be found at section 4.8 of &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2219548&quot; rel=&quot;nofollow noreferrer&quot;&gt;Everything You Always Wanted to Know About Multiple Interest Rate Curve Bootstrapping But Were Afraid To Ask&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and I don't see how the 8.5 bps for the eonia at 2014 are calculated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this section it says:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;...we are allowed to estimate the coefficient using instruments with a given underlying rate tenor (e.g. those on Euribor3M used for C3M ), and to apply it to any other curve Cx taking into account the proper weights...&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this mean is it taking the value from another tenor rates? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this section also says:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;The Con yield curve displays both the 2013 (10.2 bps) ON&#xA;and the 2014 (8.5 bps) turn of year jumps. The C1m yield curve displays the 2014 turn 1M&#xA;of year jump between 1st Dec. 2013 (+1.8 bps) and 2nd Jan. 2014 (−1.6 bps) with size roughly equal to 1/20 of the ON jumps&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This makes me more confused as it talks about &lt;em&gt;a size for 1M jump of roughly 1/20 of ON jump&lt;/em&gt; and:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I don't see where the 1/20 applies (it later talks about jump for 3M is 1/3 of 1M jump which is 0.6bps and 0.5bps and makes sense to me)&lt;/li&gt;&#xA;&lt;li&gt;As it says is &lt;em&gt;roughly equal&lt;/em&gt; makes me think this value has been calculated in a different way and then compared to what should be&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="8174" LastEditorUserId="16148" LastEditDate="2017-08-15T16:13:25.903" LastActivityDate="2017-08-26T14:12:30.023" Title="Yield curve: Turn of year effect jump calculation" Tags="&lt;yield-curve&gt;&lt;yield&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35627" PostTypeId="1" CreationDate="2017-08-15T17:54:06.253" Score="1" ViewCount="355" Body="&lt;p&gt;As part of a time series analysis, I'm writing a MATLAB program to create a Hull White tree, for the purpose of pricing a coupon-bearing bond. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;While using the function &lt;strong&gt;hwvolspec&lt;/strong&gt; (volatility specifications), there are six input arguments, two of which are &lt;strong&gt;Alphacurve&lt;/strong&gt;, which is the vector of mean reversion values, and &lt;strong&gt;AlphaDates&lt;/strong&gt;, which is the vector of mean reversion end dates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the only time series data that I have are the volatility term structures, the zero curves, the market prices of the bond in question, and I also have all the associated dates. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My main question is, how do I figure out the mean reversion values and dates from the data that I have? From where do I get the value of &lt;strong&gt;Alphacurve&lt;/strong&gt; and &lt;strong&gt;AlphaDates&lt;/strong&gt;? Do I need any additional data?&lt;/p&gt;&#xA;" OwnerUserId="29203" LastEditorUserId="848" LastEditDate="2017-08-15T18:08:33.023" LastActivityDate="2017-08-15T18:08:33.023" Title="How to calculate mean reversion values for Hull White tree calibration on MATLAB?" Tags="&lt;programming&gt;&lt;mean-reversion&gt;&lt;hullwhite&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35628" PostTypeId="2" ParentId="35588" CreationDate="2017-08-15T18:49:57.913" Score="2" Body="&lt;p&gt;When the market for a security is highly liquid, a large, sophisticated investor can assume that his presence in the market for the security does not affect liquidity. When the market for a security is illiquid, a large, sophisticated investor must consider how his presence in the market for the security affects liquidity. To understand this intuition, start with a standard Kyle (1985) model, and suppose that an additional informed investor is deciding whether to trade the risky asset given an exogenous internal cost of capital.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;RenTech is large and sophisticated, and likely has a short-term investment horizon and a high IRR. If its presence in the market for the security affects liquidity, it might not be able to exit positions easily, and the returns process is likely to be less &quot;amenable to modeling.&quot;&lt;/p&gt;&#xA;" OwnerUserId="1052" LastActivityDate="2017-08-15T18:49:57.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35629" PostTypeId="2" ParentId="34695" CreationDate="2017-08-15T19:06:10.690" Score="1" Body="&lt;p&gt;Isnt't the simulated return of 1,057013249 just a typo? Next to it on the presentation you can spot no. &quot;3&quot; - I suppose it is a return ID which should further correspond to what is shown 2 slides forward. However, the return presented there under ID 3 is 1,053225 (ln(1,053225)=0,05185689 which is very close to the number you stated, maybe it's a matter of rounding). Does it make sense?&lt;/p&gt;&#xA;" OwnerUserId="29205" LastActivityDate="2017-08-15T19:06:10.690" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35631" PostTypeId="1" AcceptedAnswerId="35633" CreationDate="2017-08-15T19:36:44.720" Score="3" ViewCount="427" Body="&lt;p&gt;I have a derivative that pays off $S_T^2$ at time $T &amp;gt; 0$ with $S_T$ denoting the price of a non dividend-paying stock at $T$. I came across a question about how one can statically replicate this derivative with vanilla calls and puts. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My guess is that it is impossible to do that on the entire support of $S_T$. Since the square function dominates a linear function eventually and the call option is linear in $S_T$ for $S_T$ large enough, there cannot be a sequence of linear combinations of calls and puts that converges to the payoff of this derivative pointwise. I was also given a hint that I should consider integration. I am aware that $S_T^2$ can be written as $S_T^2 = 2\int_0^{S_T}x\,dx$ but I am not sure if that is what the hint hints at. Any tips/solutions appreciated.&lt;/p&gt;&#xA;" OwnerUserId="11597" LastActivityDate="2017-08-15T20:21:57.093" Title="Replicating a square derivative with calls and puts" Tags="&lt;derivatives&gt;&lt;replication&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35632" PostTypeId="2" ParentId="35575" CreationDate="2017-08-15T19:45:34.233" Score="3" Body="&lt;p&gt;Ideally, you would discount a certain cash flow by its appropriate curve. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) you would discount the cash flow of your fixed income investments by the yield curve of the Treasury market;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) you would discount the cash flow of an oil company by the interest curve that the it encounters when financing its ventures. If such a ('ideal') curve is not available, you might use the equivalent one from the oil sector, etc.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The yield curves are typically constructed using bootstrap:&#xA;&lt;a href=&quot;https://en.wikipedia.org/wiki/Bootstrapping_(finance)&quot; rel=&quot;nofollow noreferrer&quot;&gt;Wikipedia link to Bootstrapping&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;OIS means Overnight Index Swap. As a swap, the two parties involved agree to exchange cash flows (notional amount): one is the interest accrued by using a floating rate and the other using a fixed rate. As it is overnight,  rate swap whose floating leg is tied to an overnight rate, compounded over a specified term.&lt;/p&gt;&#xA;" OwnerUserId="29189" LastActivityDate="2017-08-15T19:45:34.233" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35633" PostTypeId="2" ParentId="35631" CreationDate="2017-08-15T20:10:49.557" Score="4" Body="&lt;p&gt;Note that&#xA;\begin{align*}&#xA;S_T^2 = 2\int_0^{S_T} k dk.&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;S_T^2 &amp;amp;= 2S_T^2-2\int_0^{S_T} k dk\\&#xA;&amp;amp;=2S_T\int_0^{S_T}dk-2\int_0^{S_T} k dk\\&#xA;&amp;amp;=2\int_0^{S_T} (S_T-k)dk\\&#xA;&amp;amp;=2\int_0^{\infty} (S_T-k)^+dk.&#xA;\end{align*}&#xA;For the partition $0=k_0 &amp;lt; k_1 &amp;lt; \cdots &amp;lt; k_n &amp;lt; \infty$,&#xA;\begin{align*}&#xA;S_T^2 &amp;amp;=2\int_0^{\infty} (S_T-k)^+dk\\&#xA;&amp;amp;\approx 2\sum_{i=1}^n (k_i-k_{i-1})(S_T-k_i)^+.&#xA;\end{align*}&#xA;That is, it can be replicated by a portfolio of call options. The replication by put options is similar.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-08-15T20:21:57.093" LastActivityDate="2017-08-15T20:21:57.093" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35635" PostTypeId="1" CreationDate="2017-08-15T23:15:22.613" Score="2" ViewCount="926" Body="&lt;p&gt;Is there a way to stay with the short rate model (like HW2F or G2++) but extend it to capture vol term structure (vol smile or skew). What happens if I calibrate HW2F to OTM swaptions? (I don't want to use calibration to caps as they almost always ignore correlation). Thanks!&lt;/p&gt;&#xA;" OwnerUserId="29210" LastActivityDate="2019-01-08T11:48:48.160" Title="Why Hull White 2 Factor model can't capture vol skew?" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;calibration&gt;&lt;hullwhite&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35636" PostTypeId="1" CreationDate="2017-08-15T23:45:01.130" Score="2" ViewCount="38" Body="&lt;p&gt;I encountered a paper by &lt;a href=&quot;https://pdfs.semanticscholar.org/615c/1dc1a041b826054294ed19cfe1584cb0e192.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Vuolteenaho (2002)&lt;/a&gt; in which he uses pooled VAR model. I have some troubles understanding the idea. He uses firm level variables (log returns, ROE, etc.) and ultimately he obtains a single coefficient (table II on page 241) for a variable. I understand how a regular VAR works, but how is this one estimated (I assume that by using pooled OLS/WLS, as mentioned in the paper), but how can I write out this pooled VAR in equations (for example for two firms)?&lt;/p&gt;&#xA;" OwnerUserId="24370" LastActivityDate="2017-08-15T23:45:01.130" Title="Understanding pooled VAR model" Tags="&lt;returns&gt;&lt;estimation&gt;&lt;paneldata&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35637" PostTypeId="1" AcceptedAnswerId="35638" CreationDate="2017-08-16T00:07:24.850" Score="0" ViewCount="156" Body="&lt;p&gt;I see these terms being used on the floor, but don't really understand precisely what is being referred to. One colleague asserted that an 'off term' volatility is for an option whose delivery date doesn't match the expiry date, but this doesn't make sense given that the delivery date is irrelevant for volatility - but rather the expiry date determines volatility.&lt;/p&gt;&#xA;" OwnerUserId="29211" LastActivityDate="2017-08-16T01:49:53.323" Title="What is 'off term' volatility and 'term' volatility?" Tags="&lt;volatility&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35638" PostTypeId="2" ParentId="35637" CreationDate="2017-08-16T01:49:53.323" Score="1" Body="&lt;p&gt;I think what your colleague meant is that the expiry date of the product doesn't match THE expiry date of the market. For instance a volatility product that would expire at 10:42 am on a random day would be off term. One that expires at the same time than a major listed contract would be term vol.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your desk will quote off term products with a higher margin/spread because they are harder to hedge.&lt;/p&gt;&#xA;" OwnerUserId="1181" LastActivityDate="2017-08-16T01:49:53.323" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35639" PostTypeId="1" AcceptedAnswerId="35645" CreationDate="2017-08-16T02:24:40.383" Score="1" ViewCount="1159" Body="&lt;p&gt;As volatility goes to infinity, the delta of a call option goes to 1. The delta approximates the probability that the option expires in the money. So it seems that the probability of expiring in the money is very close to 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, the price of the put option approaches the constant function at the strike price. This is what one would see if the probability of the call expiring out of the money is close to 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This seems to suggest that the probability that the call option expires in the money and out of the money is both close to 1. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Put another way, as the volatility increases, the probability of a call expiring in the money increases as well. But so does the price of a put option. So it would seem that the price of a put increases, even though the probability of the put expiring in the money decreases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to make sense of this?&lt;/p&gt;&#xA;" OwnerUserId="29161" LastEditorUserId="29161" LastEditDate="2017-08-16T02:59:52.610" LastActivityDate="2017-08-16T08:08:10.190" Title="Paradox in option expiry as volatility goes to infinity" Tags="&lt;options&gt;&lt;volatility&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35640" PostTypeId="2" ParentId="35075" CreationDate="2017-08-16T02:35:56.880" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Are they referring to the probabilities associated to each branch or to the value of the random variables at time $i$?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;They're referring to the variability in the values of the random processes.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Am I correctly interpreting this when I rearrange the above eqns to give $S_i = \Delta S_i + S_{i-1}$ and $N_i = \Delta N_i + N_{i-1}$, and then view the widths as being the $\Delta S_i, \Delta N_i$ parts and the offsets as being the $S_{i-1}, N_{i-1}$ parts?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The authors probably don't mean that. Later on they express $\Delta N_i = \phi_i \Delta S_i + k$, where $k$ is the offset and $\phi_i$ the scaling factor (I found the terminology used in the proof very tedious myself).&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;So he's basically saying that to transform one martingale into another we need to multiply it and then shift it? Is there some more intuitive way to see why this should be the case?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The intuitive analog that comes to my mind is that of a coordinate transformation. Suppose we have a 2-D Cartesian coordinate system and the coordinates of a point in it. If you change to a different coordinate system in the same plane, then the coordinates of that point will be scaled (depending on the scale of the new axes relative to old axes) and shifted (depending on location of new origin relative to old).&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I cannot wrap my head around why $\delta s_i, \delta n_i$ are previsible - they clearly depend on future values of the random variable, namely $s_u,s_d,n_u,n_d$. This is glossed over in all the notes I've found which is a bit irritating. It seems important as only once we can confirm that this is true can we conclude that $\phi_i$ is indeed previsible as the Theorem states.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The key is that both $S$ and $N$ are $\mathbb{Q}-$martingales. Assuming that $S_{i+1}$ can either be $s_u$ or $s_d$ (similarly for $N_{i+1}$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_i = qs_u + (1-q)s_d \implies (q-1)(s_d-S_i) = q(s_u-S_i)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$N_i = qn_u + (1-q)n_d \implies (q-1)(n_d-N_i) = q(n_u-N_i)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Dividing the first equation by the second, we get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{s_d-S_i}{n_d-N_i} = \frac{s_u-S_i}{n_u-N_i}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Again, tinkering with the original 2 equations:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_i = qs_u + (1-q)s_d \implies S_i-s_d = q(s_u-s_d)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$N_i = qn_u + (1-q)n_d \implies N_i-n_d = q(n_u-n_d)$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which gives us &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{s_d-S_i}{n_d-N_i} = \frac{s_u-s_d}{n_u-n_d} = \frac{s_u-S_i}{n_u-N_i}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So irrespective of whether the next move is up or down, the ratio $\frac{S_{i+1}-S_i}{N_{i+1}-N_i} = \frac{s_u-s_d}{n_u-n_d}$ will remain the same and is therefore known with the information available till the current step $i$.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$\phi_i$ is constructed as a ratio such that when it multiplies the $\Delta S_i$ increment it will bring it to the correct scale for $\Delta N_i$. Is this correct?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;That is correct.&lt;/p&gt;&#xA;" OwnerDisplayName="user28682" LastActivityDate="2017-08-16T02:35:56.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35641" PostTypeId="1" AcceptedAnswerId="35647" CreationDate="2017-08-16T02:53:52.890" Score="2" ViewCount="2417" Body="&lt;p&gt;I'm a programmer and recent trading enthusiast. To learn more about options I'm building a market maker trading bot. So far it gets market prices and volatility and calculates the Black&amp;amp;Scholes. I figured that if my calculated B&amp;amp;S lies between the current market bid and ask, the bot should be able to find an acceptable price to post to the market. From this point on the bot could simply post a bid slightly higher than the current market bid, and an ask slightly lower than the current market ask. When the other market makers then see that their prices are beaten by a newcomer (me), I would assume them to rally against me for both the bid and the ask, resulting in a decreasing spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I'm now at a point where I would need to program a rule so that my bot can decide when to stop rallying with the other bots. In other words; my bot should be able to decide what spread around the calculated B&amp;amp;S value it would still find acceptable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I can see in the market, spreads as a percentage of the option value are lower for options that are deep in the money, get larger at the money, and are largest out of the money:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/Oqixc.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Oqixc.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This gives me the idea that there should be some kind of theoretical model, or at least a rule of thumb, to decide on the acceptable spread for the options that my bot is making the market for. I of course understand that it depends on your risk appetite, but I guess it also depends on the transaction costs, hedging possibilities, volatility and market liquidity. So I hope there is some model or guiding principle to tell me what is acceptable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anybody know any theoretical model or rule of thumb to calculate acceptable spreads for options? All tips are welcome!&lt;/p&gt;&#xA;" OwnerUserId="29160" LastEditorUserId="16148" LastEditDate="2017-08-16T16:18:17.810" LastActivityDate="2017-08-17T02:38:09.430" Title="Theoretical models for options bid-ask spread?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;market-making&gt;&lt;spread&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35642" PostTypeId="1" AcceptedAnswerId="35661" CreationDate="2017-08-16T04:18:03.127" Score="2" ViewCount="541" Body="&lt;p&gt;Suppose we are holding a replicating portfolio $\Pi_t$ of long an option $f(S,t)$ and short some stock, so $$\Pi_t=f(S_t,t)-\Delta_t S_t$$  Suppose the stock follows geometric Brownian motion and pays continuous dividends at rate $q$, so $$d S_t = S_t((\mu-q)dt + \sigma dW_t$$  Naively, $$d\Pi_t = d f(S_t,t)-\Delta_t dS_t$$  However, because the stock pays a dividend, common sense and the literature tell us that $$d\Pi_t=df(S_t,t)-\Delta_t dS_t-\Delta_t S_t dt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; How do we rigorously arrive at the total derivative for $d\Pi_t$ which includes extra term $-\Delta_t S_t dt$, given that we know $\Pi_t=f(S_t,t)-\Delta_t S_t$, without appeal to common sense i.e., from the equations, without recalling the mechanics of how the stock works?  Because, naively, I would not include the extra term, if I just knew the equation defining $\Pi_t$ and nothing about the mechanics of the stock.&lt;/p&gt;&#xA;" OwnerUserId="29212" LastActivityDate="2020-09-24T00:31:17.883" Title="Rigorous derivation of $d\Pi$ for stock with continuous dividend" Tags="&lt;black-scholes&gt;&lt;black-scholes-pde&gt;" AnswerCount="1" CommentCount="11" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35643" PostTypeId="1" CreationDate="2017-08-16T05:25:41.303" Score="1" ViewCount="136" Body="&lt;p&gt;In order to simulate an interest rate yield curve, can I just estimate a covariance matrix of historical key rate data, simulate with a normal copula, spline my simulated key rates, then price my assets as a function of the simulated yield curves?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, could I just spline historical key rate values and estimate risk as a function of those values?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is this insufficient? / Where does the need for stochastic models arise?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="29208" LastEditorUserId="29208" LastEditDate="2017-08-17T21:05:37.760" LastActivityDate="2017-09-16T21:31:33.130" Title="Interest rate risk using copulas" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;risk&gt;&lt;yield-curve&gt;&lt;covariance&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35644" PostTypeId="2" ParentId="35625" CreationDate="2017-08-16T05:49:56.283" Score="1" Body="&lt;p&gt;the best example will be bid * ask which one of the sides is being hit again and again and yet the amount of the bid/ask size is being refreshed. so best bid is 99 and it's size is 1000 shares or 1 share etc. and ask price is 100 and all trades are done on the bid side and the amount traded on the bid is higher than the bid size. this is the simple case. the more complicated is what if the bid price moves by 1 tick etc.&lt;/p&gt;&#xA;" OwnerUserId="28856" LastActivityDate="2017-08-16T05:49:56.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35645" PostTypeId="2" ParentId="35639" CreationDate="2017-08-16T08:08:10.190" Score="6" Body="&lt;p&gt;Where you are right, because of call-put parity &#xA;$$C-P=DF(F-K)$$&#xA;with $F$ representing the forward price, the difference between the European call and a European put price is independent of the volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This suggests that when $C$ increases due to increasing volatility, $P$ should therefore increase by the same amount all other things equal. And indeed the maximum put price is $DF\times K$ at which point the call is worth $DF\times F$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where you are wrong is that, under the risk-neutral measure: $\Delta$ (or rather $N(d_1)$ in the BS equation) is not the probability of expiring in the money for a call, $N(d_2)$ is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See also these questions: &lt;a href=&quot;https://quant.stackexchange.com/questions/35514&quot;&gt;Probability of exercise in the Black-Scholes Model&lt;/a&gt; and &lt;a href=&quot;https://quant.stackexchange.com/questions/35368&quot;&gt;Yet another question about the risk-neutral measure. Why is the risk-neutral probability of an infinitely volatile GBM 0?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2017-08-16T08:08:10.190" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35647" PostTypeId="2" ParentId="35641" CreationDate="2017-08-16T09:57:55.083" Score="5" Body="&lt;p&gt;When trading options it is most useful to think in terms of implied volatilities, rather than option prices. For vanilla options, there is a one-to-one relationship between implied volatility and price, and the Black-Scholes formula gives the conversion between the two.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since price and implied volatility are interchangeable, you can convert both the bid and ask for an option to implied volatility, to get the volatility bid and ask. The bid-ask spreads in volatility are often much more intuitive than the bid-offer spreads in price. This makes sense from an option trader's point of view - once you have delta-hedged your option, your main risks are from vega and gamma, which represent the riskiness of moves in implied and realized volatility. For a market maker, the bid-ask spread is designed to cover against the possibility of volatility moving against them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a concrete example, consider three month options on an underlier where the spot is 100, interest rates and dividends are zero, and the implied volatility is 19.9% bid and 20.1% offered for every strike, i.e. the volatility bid-ask spread is a fixed 0.2%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The prices for strikes ranging from 80 (out of the money) to 120 (in the money), with bids rounded down to the nearest $0.05 and offers rounded up, are&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Strike |   Bid  |   Ask  | Percent&#xA;-------+--------+--------+--------&#xA;    80 | 20.00  | 20.05  |   0.25%&#xA;    85 | 15.15  | 15.25  |   0.66%&#xA;    90 | 10.65  | 10.80  |   1.40%&#xA;    95 |  6.80  |  7.00  |   2.90%&#xA;   100 |  3.90  |  4.10  |   5.00%&#xA;   105 |  1.95  |  2.15  |   9.76%&#xA;   110 |  0.90  |  1.05  |  15.38%&#xA;   115 |  0.35  |  0.45  |  25.00%&#xA;   120 |  0.10  |  0.20  |  66.67%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Notice that the percentage spread, $(p_{\rm ask} - p_{\rm bid}) / p_{\rm mid}$, increases as the options get further out of the money, even though the bid-offer spread in volatility space is constant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A partial answer to your question &quot;How can that help me determine an appropriate spread in USD?&quot; is to do all of your modelling of spreads in volatility space, and only convert back to USD when you need to actually submit a quote. Of course, having a constant bid-offer spread in volatility space is unrealistic as well (in general, you will want larger bid-offer spreads on options with more vega and gamma) but it is a much better starting point than working in price space.&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2017-08-16T09:57:55.083" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35648" PostTypeId="1" CreationDate="2017-08-16T10:12:10.983" Score="1" ViewCount="709" Body="&lt;p&gt;Is there a way to crudely estimate term premia in long term bonds? I understand there is a well developed and widely available model from the NY Fed (&lt;a href=&quot;https://www.newyorkfed.org/research/data_indicators/term_premia.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;ACM Model&lt;/a&gt;) but I'm wondering if there is a 'quick and dirty' method which can be applied to any curve, as I am trying to estimate the term premium in the long end of the Brazilian curve (e.g. 10y - 3m rates?)&lt;/p&gt;&#xA;" OwnerUserId="29217" LastActivityDate="2017-08-16T14:53:07.590" Title="How to roughly estimate long term term premia?" Tags="&lt;fixed-income&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35649" PostTypeId="1" AcceptedAnswerId="35650" CreationDate="2017-08-16T10:58:42.473" Score="0" ViewCount="179" Body="&lt;p&gt;&lt;a href=&quot;https://quant.opengamma.io/Pricing-and-Risk-Management-of-Credit-Default-Swaps-OpenGamma.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Pricing and Risk Management of Credit Default Swaps, with a Focus on the ISDA Model&lt;/a&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/c5oHV.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;Screenshot: Pricing protection leg of a CDS, by OpenGamma&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the screenshot above, I am having trouble understanding the maths between equation 13 and equation 14. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notation:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$N$&lt;/span&gt; = notational payment, e.g., £100&lt;/li&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$RR$&lt;/span&gt; = recovery rate, the percentage of the &lt;span class=&quot;math-container&quot;&gt;$N$&lt;/span&gt; recovered upon default, e.g., you get back 40%&lt;/li&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$\tau$&lt;/span&gt; = time of default&lt;/li&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$t_v$&lt;/span&gt; = valuation date&lt;/li&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$T$&lt;/span&gt; = maturity date&lt;/li&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$\mathbb{I}_A$&lt;/span&gt; = indicator function for event &lt;span class=&quot;math-container&quot;&gt;$A$&lt;/span&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$r(s)$&lt;/span&gt; = instantaneous short rate at time &lt;span class=&quot;math-container&quot;&gt;$s$&lt;/span&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$P(t)$&lt;/span&gt; = discount factor from time &lt;span class=&quot;math-container&quot;&gt;$t &amp;gt; 0 = $&lt;/span&gt;start date&lt;/li&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$Q(t)$&lt;/span&gt; = survival probability at time &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;What I have tried:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$\mathbb{E}\left[e^{-\int_{t_v}^{T}r(s)ds}\mathbb{I}_{\tau&amp;lt;T}\right] = \int_{-\infty}^{\infty} \tau e^{-\int_{t_v}^{T}r(s)ds}\mathbb{I}_{\tau&amp;lt;T} d\tau = \int_{0}^{T} \tau \frac{P(\tau)}{P(t_v)}d\tau$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From here, I cannot see how equation 14 is derived.&lt;/p&gt;&#xA;" OwnerUserId="28388" LastEditorUserId="18748" LastEditDate="2020-05-19T10:02:34.147" LastActivityDate="2020-05-19T10:02:34.147" Title="CDS protection/contingent leg pricing, taking expectation of interest and hazard rates" Tags="&lt;finance-mathematics&gt;&lt;pricing&gt;&lt;mathematics&gt;&lt;cds&gt;&lt;pricing-formulae&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="35650" PostTypeId="2" ParentId="35649" CreationDate="2017-08-16T12:01:12.877" Score="0" Body="&lt;p&gt;After some more trying, I think I have it. &#xA;\begin{equation} \label{eq1}&#xA;\begin{split}&#xA;N(1-RR)\ \mathbb{E}\left[ e^{-\int_{t_v}^{\tau}r(s)ds} \mathbb{I}_{\tau&amp;lt;T} \right] &amp;amp; = N(1-RR)\ \mathbb{E}\left[ \frac{P(\tau)}{P(t_v)} \mathbb{I}_{\tau&amp;lt;T} \right] \\&#xA; &amp;amp; = \frac{N(1-RR)}{P(t_v)}\ \mathbb{E}\left[ P(\tau) \mathbb{I}_{\tau&amp;lt;T} \right] \\&#xA;&amp;amp; = \frac{N(1-RR)}{P(t_v)}\ \int_{-\infty}^{\infty} -\frac{dQ(s)}{ds}P(s) \mathbb{I}_{s&amp;lt;T} ds \\&#xA;&amp;amp; = -\frac{N(1-RR)}{P(t_v)}\ \int_{0}^{T} P(s) \frac{dQ(s)}{ds} ds \\&#xA;&amp;amp; = -\frac{N(1-RR)}{P(t_v)}\ \int_{0}^{T} P(s)\ dQ(s)&#xA;\end{split}&#xA;\end{equation}&lt;/p&gt;&#xA;" OwnerUserId="28388" LastEditorUserId="28388" LastEditDate="2018-01-04T12:56:18.130" LastActivityDate="2018-01-04T12:56:18.130" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35652" PostTypeId="1" CreationDate="2017-08-16T13:18:23.487" Score="0" ViewCount="430" Body="&lt;p&gt;I'm trying to understand the advantages and disadvantages of using &lt;a href=&quot;https://en.wikipedia.org/wiki/Public_Market_Equivalent#Direct_Alpha&quot; rel=&quot;nofollow noreferrer&quot;&gt;Direct Alpha&lt;/a&gt; versus &lt;a href=&quot;https://en.wikipedia.org/wiki/Public_Market_Equivalent#Excess_IRR&quot; rel=&quot;nofollow noreferrer&quot;&gt;Excess IRR&lt;/a&gt; for computing excess returns over a market index for private assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Wikipedia references a highly informative &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2403521&quot; rel=&quot;nofollow noreferrer&quot;&gt;paper&lt;/a&gt; that compares the Direct Alpha against PME, PME+, mPME, and KS-PME and discusses the limitations of these as well as analyzes the correlations between them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for a similar resource to that compares the two in my title.&lt;/p&gt;&#xA;" OwnerUserId="24137" LastEditorUserId="16148" LastEditDate="2017-08-16T14:38:55.093" LastActivityDate="2017-08-16T14:57:58.793" Title="Private Equity: Direct Alpha vs Excess IRR" Tags="&lt;modern-portfolio-theory&gt;&lt;reference-request&gt;&lt;capm&gt;&lt;asset-returns&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35654" PostTypeId="2" ParentId="35652" CreationDate="2017-08-16T14:39:10.680" Score="2" Body="&lt;p&gt;They are &quot;essentially&quot; the same thing. IPP (or excess IRR) is the excess return over the annualized benchmark such that the adjusted PME is 1:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{PME} = 1 = \frac{\sum_{i=1}^n d_i &#xA;    \left(1 + \dfrac{b_{T_i, T_N}}{q} + \dfrac{r}{q}\right)^{q(T_N-T_i)} }{\sum_{j=1}^m c_i &#xA;    \left(1 + \dfrac{b_{T_j, T_N}}{q} + \dfrac{r}{q}\right)^{q(T_N-T_j)}}, $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $c_i$ and $d_i$ are the contribution and distribution at time $t_i$, respectively, $b$ is the annualized public market benchmark return over the relevant periods,  $r$ is the annualized excess IRR/IPP, and $q$ is the compounding frequency (typically $q=1$ in the IPP setting).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you let $q\to\infty$ (i.e., continuous compounding) and with some redefinition (e.g., $e^\alpha = 1+a$), it is easy to show that excess IRR/IPP converges to direct alpha.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So simply put, direct alpha is just the limiting case of excess IRR/IPP, but they're conceptually the same thing. As such, they have the same advantages and disadvantages. IMO, the derivation of IPP/excess IRR is  more direct (resembling the way OAS is defined in the fixed income market) and the use of discrete compounding makes the output more comparable to other reported returns.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2017-08-16T14:57:58.793" LastActivityDate="2017-08-16T14:57:58.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35655" PostTypeId="2" ParentId="35648" CreationDate="2017-08-16T14:53:07.590" Score="2" Body="&lt;p&gt;The ACM term premium can be replicated very well with a simple linear regression:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{10-Year ACM TP} = -1.84 - 0.0579\times\text{3M Rate} - 0.6922\times\text{2Y Yield} - 0.4329\times\text{5Y Yield} + 1.6159\times\text{10Y Yield}. $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Adjusted $R^2$ of this regression is 0.96. You can perhaps apply these coefficients to Brazilian rates to get some crude estimate. How well will it work? Probably not very well, unless the Brazilian interest rate dynamics happen to be the same as the US, which seems highly unlikely.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Other easy ways to measure term premium is to look at forwards. For example, the difference between 7y forward 3m rate and 10 year forward 3m rate can be used as a proxy (that far out into the future, people are unlikely to have strong views about rate direction, so the slope of the curve mostly likely can be attributed to term premium, rather than changing rate expectations).&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2017-08-16T14:53:07.590" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35656" PostTypeId="2" ParentId="35641" CreationDate="2017-08-16T15:55:24.347" Score="3" Body="&lt;p&gt;I have upvoted Chris Taylor's answer, which has the best approach, particularly for near-the-money strikes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, for illiquid options and far-out-of-the-money and far-in-the-money strikes, you will often find that bid prices are below &lt;em&gt;intrinsic value&lt;/em&gt;, i.e. smaller than even Black-Scholes gives even with $\sigma=0.0$.  With no volatility here, it is of course not possible to compute the spread in volatility terms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In these cases, you will generally find that offer prices correspond to insanely high volatilities.  There is a minimum tick size to listed options, and even an offer price of a single tick for far-from-the-money options will correspond to $\sigma \gg 200\%$.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus there are cases where the implied volatilities lose their utility, making a price-based scheme more attractive.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you use a price-based scheme, you can&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;subtract present intrinsic value $I$ from option prices, before computing percentage spreads and divide by offer prices; or more reasonably,&lt;/li&gt;&#xA;&lt;li&gt;work with absolute rather than percentage spreads&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In your example above, you have respectively&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;an underlying value $S$ of about 98, so you would compute your percentage spreads as 100% at the top and 66% at the bottom; and&lt;/li&gt;&#xA;&lt;li&gt;absolute spreads ranging from 0.50 at the top to 0.10 at the bottom.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;For american exercise options intrinsic value is simply $(S-K)^+$ while for european exercise it is $e^{-rT}(F-K)^+$. Here $(x)^+$ is defined as $\max(x,0)$ for calls and $\max(-x,0)$ for puts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One final note: for far-in-the-money options you should pay very close attention to funding rate $r$, because that's the most important driver of option value.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2017-08-17T02:38:09.430" LastActivityDate="2017-08-17T02:38:09.430" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35657" PostTypeId="2" ParentId="14569" CreationDate="2017-08-16T16:28:58.683" Score="1" Body="&lt;p&gt;Tablesaw is similar to Python's Pandas: &lt;a href=&quot;https://github.com/jtablesaw/tablesaw&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/jtablesaw/tablesaw&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2117" LastActivityDate="2017-08-16T16:28:58.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35658" PostTypeId="1" CreationDate="2017-08-16T20:14:32.803" Score="1" ViewCount="1152" Body="&lt;p&gt;Why does papers such as Fama and French (2010) and Barras et al. (2010) construct equal weighted portfolio of all funds when they analyse the aggregate performance of mutual funds? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;They both report an R-squared of 0.98 by weighting funds equally. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I do 2000 time series regression for all funds, and calculate the average R-squared obtained from all 2000 regressions, I get an average of 0.81. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But, when I construct an equally weighted portfolio of all 2000 funds (similar to the papers mentioned above), I obtain an R-squared of 0.97.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My main question is why does R-squared increase significantly when I construct an equally weighted portfolio of funds compared to taking the average R-squared of 2000 time series regressions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Appreciate any help you can provide. &lt;/p&gt;&#xA;" OwnerUserId="28909" LastActivityDate="2017-10-15T22:21:39.493" Title="The R-squared of the four factor model." Tags="&lt;finance&gt;&lt;regression&gt;&lt;asset-pricing&gt;&lt;econometrics&gt;&lt;quantitative&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35659" PostTypeId="2" ParentId="35658" CreationDate="2017-08-16T20:44:13.283" Score="1" Body="&lt;p&gt;The reason is noise. There is much more noise in individual stock returns (or for that matter individual fund returns) than for an overall fund portfolio. In fact an overall fund portfolio should be quite close to the market. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Think about it this way (very stylized example):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Imagine the market is the S&amp;amp;P500 and you are running CAPM regressions;&lt;/li&gt;&#xA;&lt;li&gt;Run each of the S&amp;amp;P500 stock returns of the S&amp;amp;P500 on the market and you get what? Probably an $R^2$ around 0.2-0.5 for each stock? Take the average of those and you get a similar figure;&lt;/li&gt;&#xA;&lt;li&gt;Now, value-weight those stocks and run them on the market factor. Which $R^2$ you get? You get 100%.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;It's just about the noise.&lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2017-08-16T20:44:13.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35660" PostTypeId="1" CreationDate="2017-08-16T21:12:12.163" Score="1" ViewCount="3203" Body="&lt;p&gt;I've been trying to calculate the credit spread of a financial institution with a Fitch rate of A.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By using the transition matrix (&lt;a href=&quot;https://www.fitchratings.com/web_content/nrsro/nav/NRSRO_Exhibit-1.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.fitchratings.com/web_content/nrsro/nav/NRSRO_Exhibit-1.pdf&lt;/a&gt; page 4), I obtained a default probability at &lt;code&gt;10 years&lt;/code&gt; of &lt;code&gt;0.7941%&lt;/code&gt; (by multiplying the matrix with itself 10 times).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After that, I tried to obtain the credit spred with a 40% of recovery rate with the following formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ PD = 1 - EXP(\frac{-spread \cdot years}{1-R}) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I obtained a spread of &lt;code&gt;4,783&lt;/code&gt; at 10 years which is very low to &lt;code&gt;100 bps&lt;/code&gt; of credit spread obtained from a JP Morgan CDS. Results make more sense if I don't use the years in the formula, but I think they should be considered.&lt;/p&gt;&#xA;" OwnerUserId="16520" LastEditorUserId="-1" LastEditDate="2017-08-17T19:36:55.250" LastActivityDate="2017-11-16T21:49:57.707" Title="How to calculate credit spread from rating" Tags="&lt;credit-risk&gt;&lt;spread&gt;&lt;credit-ratings&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="35661" PostTypeId="2" ParentId="35642" CreationDate="2017-08-16T21:52:59.510" Score="1" Body="&lt;p&gt;Let &lt;span class=&quot;math-container&quot;&gt;$S^0_t = e^{rt}$&lt;/span&gt; be the money market account.&lt;/p&gt;&#xA;&lt;p&gt;Consider you short a derivative &lt;span class=&quot;math-container&quot;&gt;$P_t$&lt;/span&gt; and hedge it with cash and stock.&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;  \Pi_t =  \Delta^0_t S^0_t + \Delta_t S_t - P_t&#xA;$$&lt;/span&gt;&#xA;At time &lt;span class=&quot;math-container&quot;&gt;$t+dt$&lt;/span&gt;, the portfolio is&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{eqnarray*}&#xA;  \Pi_{t+dt} &amp;amp;=&amp;amp; \Delta^0_t S^0_{t+dt} + \Delta_t S_{t+dt} + \Delta_t q_t S_t dt - P_{t+dt} &#xA;\end{eqnarray*}&lt;/span&gt;&#xA;Where &lt;span class=&quot;math-container&quot;&gt;$\Delta_t q_t S_t dt$&lt;/span&gt; corresponds to the dividend received. Then&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{eqnarray*}&#xA;  \Pi_{t+dt} &#xA;  &amp;amp;=&amp;amp; (1+rdt)\Delta^0_t S^0_{t} + \Delta_t S_{t+dt} - P_{t+dt} \\ &#xA;  &amp;amp;=&amp;amp; (1+rdt)( \Pi_t - \Delta_t S_t + P_t ) + \Delta_t S_{t+dt} + \Delta_t q_t S_t - P_{t+dt} \\ &#xA;  &amp;amp;=&amp;amp; (1+rdt)( \Pi_t - \Delta_t S_t + P_t ) + \Delta_t S_{t+dt} + \Delta_t q_t S_t - P_{t+dt} &#xA;\end{eqnarray*}&lt;/span&gt;&#xA;This can be rewritten&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{eqnarray*}&#xA;  d\Pi_{t}-r\Pi_t &amp;amp;=&amp;amp; \Delta_t (dS_{t} - (r-q)S_tdt) - (dP_{t} - rP_tdt)  &#xA;\end{eqnarray*}&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;Assume the stock price has dynamic&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;  \frac{dS_t}{S_t} = \mu dt + \sigma dW^\mathbb{P}_t&#xA;$$&lt;/span&gt;&#xA;under the real-world measure &lt;span class=&quot;math-container&quot;&gt;$\mathbb{P}$&lt;/span&gt; (the drift could even be stochastic here). We search for the price in the form &lt;span class=&quot;math-container&quot;&gt;$P_t = P(t,S_t)$&lt;/span&gt;. Applying Ito, one finds&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{eqnarray*}&#xA;  dP_{t} &amp;amp;=&amp;amp;  \partial_tPdt + \partial_SP dS_t + \frac{1}{2}\sigma^2 S_t^2\partial^2_SP dt&#xA;\end{eqnarray*}&lt;/span&gt;&#xA;so&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{eqnarray*}&#xA;  d\Pi_{t}-r\Pi_t &amp;amp;=&amp;amp; (\Delta_t - \partial_SP) dS_{t} - \Delta_t S_t (r-q)dt) - \partial_tPdt - \frac{1}{2}\sigma^2 S_t^2\partial^2_SP dt + rP(t,S_t)dt)  &#xA;\end{eqnarray*}&lt;/span&gt;&#xA;In order to kill the stochastic term we should choose &lt;span class=&quot;math-container&quot;&gt;$\Delta_t = \partial_SP$&lt;/span&gt;. We end up with a risk-less portfolio with PnL&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{eqnarray*}&#xA;  d\Pi_{t}-r\Pi_t &amp;amp;=&amp;amp; -\left(\partial_tP + (r-q)S_t \partial_SP + \frac{1}{2}\sigma^2 S_t^2\partial^2_SP - rP \right)dt &#xA;\end{eqnarray*}&lt;/span&gt;&#xA;By absence of arbitrage, this has to be 0 otherwise we could make a guaranteed profit without taking any risk. So the right hand side is the diffusion equation&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{eqnarray*}&#xA;  \partial_tP + (r-q)S_t \partial_SP + \frac{1}{2}\sigma^2 S_t^2\partial^2_SP dt = rP&#xA;\end{eqnarray*}&lt;/span&gt;&#xA;This is a diffusion equation (the Black-Scholes equation). In the case where &lt;span class=&quot;math-container&quot;&gt;$P$&lt;/span&gt; pays a single cashflow &lt;span class=&quot;math-container&quot;&gt;$P(T,S_T)$&lt;/span&gt; at &lt;span class=&quot;math-container&quot;&gt;$T$&lt;/span&gt;, the Feynman-Kac theorem ensures that the solution to this PDE can be written as an expectation&#xA;&lt;span class=&quot;math-container&quot;&gt;\begin{eqnarray*}&#xA;  P(t,S) &amp;amp;=&amp;amp; \mathbb{E}^\mathbb{Q}_t\left[ e^{-\int_t^T r ds} P(T,Y_T) |Y_t = S\right] &#xA;\end{eqnarray*}&lt;/span&gt;&#xA;where &lt;span class=&quot;math-container&quot;&gt;$(X,\mathbb{Q})$&lt;/span&gt; is any probability space, &lt;span class=&quot;math-container&quot;&gt;$W^\mathbb{Q}$&lt;/span&gt; a Brownian motion on it and &lt;span class=&quot;math-container&quot;&gt;$Y$&lt;/span&gt; a process satisfying the SDE&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;  \frac{dY_t}{Y_t} = (r-q) dt + \sigma dW^\mathbb{Q}_t&#xA;$$&lt;/span&gt;&#xA;Such a probability &lt;span class=&quot;math-container&quot;&gt;$\mathbb{Q}$&lt;/span&gt; is usuallly called the risk-neutral measure and the process &lt;span class=&quot;math-container&quot;&gt;$Y$&lt;/span&gt; is usually written &lt;span class=&quot;math-container&quot;&gt;$S$&lt;/span&gt;. But they are only mathematical constructs that can make computation easier because the real-world drift is irrelevant. The core of the argument is accounting for the PnL of our strategy and absence of arbitrage. The fact that the price does not depend on the drift is due to the fact that it cancels out when we hold the underlying as our hedge.&lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2020-09-24T00:31:17.883" LastActivityDate="2020-09-24T00:31:17.883" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="35665" PostTypeId="2" ParentId="35643" CreationDate="2017-08-17T09:59:35.893" Score="2" Body="&lt;p&gt;One reason is that your system needs to correctly price today's yield curve and interest rate options market , otherwise it is not arbitrage free versus existing instruments.   Historical data will not in general achieve that.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-08-17T09:59:35.893" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35666" PostTypeId="2" ParentId="15986" CreationDate="2017-08-17T12:51:59.297" Score="10" Body="&lt;p&gt;I believe the answer can be further improved for all those being directed here by google after 3 years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A common way to model the default probability is by the hazard rate. As @Bob correctly mentions, a traditional requirement is for it to satisfy (see &lt;a href=&quot;https://shamit8.files.wordpress.com/2014/11/options-futures-and-other-derivatives-8th-john.pdf&quot; rel=&quot;noreferrer&quot;&gt;Option Futures and Other Derivatives&lt;/a&gt; section 23.4 in which the author discusses also other more exact approximations):&#xA;$$\lambda(t)=\frac{S(t)}{1-R}.$$&#xA;This is associated with the default probability by (see &lt;a href=&quot;https://en.wikipedia.org/wiki/Poisson_point_process&quot; rel=&quot;noreferrer&quot;&gt;Poisson Process&lt;/a&gt;):&#xA;$$P(t,t+h)=\lambda(t)h+o(h)\,,$$&#xA;with $P(t,t+h)$ the probability of a default occurring between $t$ and $t+h$. Therefore:&#xA;$$P(0,T)=\int_0^T(1-P(0,T))P(t,t+dt)=\int_0^T\lambda(t)(1-P(0,T))dt\,,$$&#xA;where the first term of the integral is &quot;default has not occurred so far&quot; and the second is &quot;default occurs on the next time step&quot;. This means that $P$ satisfies:&#xA;$$\frac{dP(0,t)}{dt}=\lambda(t)(1-P(0,t)).$$&#xA;If the CDS is assumed to be constant then $\lambda$ is constant and a solution would be:&#xA;$$P(0,t)=1-\exp\left(\frac{-St\,\,\,}{1-R}\right).$$&#xA;Equivalently solution for the CDS is:&#xA;$$S=\frac{R-1}{t}\log(1-P(0,t)).$$&lt;/p&gt;&#xA;" OwnerUserId="25455" LastActivityDate="2017-08-17T12:51:59.297" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35667" PostTypeId="1" AcceptedAnswerId="35676" CreationDate="2017-08-17T13:22:25.640" Score="7" ViewCount="895" Body="&lt;p&gt;Looking at a portfolio of bonds, I've come across a large number of callable bonds with relatively long maturities (20 to 30 years) but very short call windows. In other words, the first and only call date (European style) will be e.g. 3 months before maturity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can think of two possible reasons why: either the issuer wants a small bit of flexibility for the redemption date, or there is a regulatory or similar reason. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The yield uplift for investors will be tiny - the possibility of losing 1 or 2 coupons in a 30 year bond - so that wouldn't be a reason. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What am I missing? Why would issuers do this? It's not a one-off either, I can see hundreds!&lt;/p&gt;&#xA;" OwnerUserId="7166" LastEditorUserId="20795" LastEditDate="2019-09-21T14:24:51.413" LastActivityDate="2019-09-21T14:24:51.413" Title="Callable bonds with very short call period. Purpose?" Tags="&lt;bond&gt;&lt;callable-bonds&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35668" PostTypeId="1" CreationDate="2017-08-17T13:22:56.780" Score="3" ViewCount="937" Body="&lt;p&gt;I've calibrated the Heston Model using options data and I was wondering if the parameters I've obtained are stable enough. Also, is Feller condition imposed, when calibrating the Heston Model, in the industry ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers&#xA;&lt;a href=&quot;https://i.stack.imgur.com/QfqQ4.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/QfqQ4.jpg&quot; alt=&quot;Heston parameters&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: The squared returns which is supposed to be an estimator for daily variance has a large peak during around Jan-09. Is it a good explanation for the peak in theta and v0 ?&#xA;&lt;a href=&quot;https://i.stack.imgur.com/YaT6s.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/YaT6s.jpg&quot; alt=&quot;squared returns&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="28757" LastEditorUserId="28757" LastEditDate="2017-08-17T15:47:29.847" LastActivityDate="2017-08-17T15:47:29.847" Title="Heston Model Calibration" Tags="&lt;heston&gt;&lt;calibration&gt;" AnswerCount="0" CommentCount="7" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35669" PostTypeId="1" CreationDate="2017-08-17T03:13:07.063" Score="1" ViewCount="1135" Body="&lt;p&gt;Can you explain what are some similarities and differences between snowball, KIKO (knock in knock out) and TRF (target redemption forward) derivatives?&lt;/p&gt;&#xA;" OwnerDisplayName="Carl Im" LastActivityDate="2019-04-09T23:01:15.203" Title="Differences between Snowball, KIKO and TRF derivatives?" Tags="&lt;equities&gt;&lt;investing&gt;&lt;trading&gt;&lt;options&gt;&lt;derivatives&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35670" PostTypeId="2" ParentId="35669" CreationDate="2017-08-17T04:30:57.877" Score="1" Body="&lt;p&gt;Similarities:&#xA;1. Snowball, kiko, trf all belong to a family of derivative products with limited profitability and unlimited risk.&#xA;2. They all have periodic settlement (monthly USD sale, e.g.)&#xA;3. If you evaluate just the first few payments, NPV is negative, i.e. a loss, for the product provider(i.e. bank).  However, if you evaluate the remaining payments, the NPV is positive.  Their upfront profit is financed by taking risk in the back-end.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Differences:&#xA;The main difference is in Early Termination Provision.&#xA;For TRF, even if the original contract is for 2 years, if the life-to-date fx gain of the TRF is above a certain barrier, the contract terminates and all settlements afterward are automatically cancelled.&#xA;For KIKO, if the exchange rate falls below a preset barrier level at any time during the life of the contract, the current settlement as well as all settlements afterward are automatically cancelled.&#xA;For Snowball, there is no early termination, but, whereas TRF, KIKO both have fixed contract exchange rate, Snowball has a variable contract exchange rate that can reset against client's benefit.  This mechanism generates enough value to give the client upfront benefit.&lt;/p&gt;&#xA;" OwnerDisplayName="Carl Im" LastActivityDate="2017-08-17T04:30:57.877" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35671" PostTypeId="1" AcceptedAnswerId="35684" CreationDate="2017-08-17T16:34:45.860" Score="0" ViewCount="122" Body="&lt;p&gt;Can futures rolling affect curve constructing? Let's say that i'm using future 1 and 2 to construct the short end of my curve. As i understand it, rolling will create volatility (as volumes spike), which can affect the futures prices and thus the rates deduced from those futures. So is there a risk that the part of the curve implied from these futures presents some kind of jumps in this rolling period?&#xA;Thank in advance.&lt;/p&gt;&#xA;" OwnerUserId="27971" LastEditorUserId="16148" LastEditDate="2017-08-17T18:14:50.583" LastActivityDate="2017-08-18T20:39:43.550" Title="Libor futures rolling adjustment &amp; curve building" Tags="&lt;futures&gt;&lt;yield-curve&gt;&lt;roll-adjustment&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35672" PostTypeId="1" CreationDate="2017-08-17T18:13:06.233" Score="1" ViewCount="89" Body="&lt;p&gt;Let H be the Hurst parameter of the Fractional Brownian Motion. Are there any useful areas in mathematical finance where the fractional brownian motion with H&amp;lt;1/2 is used? From all the articles I see they assume that H&gt;1/2. If there are any uses for H&amp;lt;1/2 could you please point me in their direction?&lt;/p&gt;&#xA;" OwnerUserId="11692" LastActivityDate="2017-08-24T06:10:56.190" Title="Use of fBm when $H&lt;1/2$" Tags="&lt;modeling&gt;&lt;models&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35673" PostTypeId="2" ParentId="35588" CreationDate="2017-08-17T18:40:24.317" Score="3" Body="&lt;p&gt;A third interesting reason why the markets should be liquid is volume of data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the models being used demand a lot of data to have a small error (as is the case in Deep Learning models), then liquid markets give you a large enough dataset to train your models. &lt;/p&gt;&#xA;" OwnerUserId="29189" LastActivityDate="2017-08-17T18:40:24.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35676" PostTypeId="2" ParentId="35667" CreationDate="2017-08-18T10:13:27.127" Score="9" Body="&lt;p&gt;It's because of a bank regulation called the Liquidity Coverage Ratio.  This says that if you have liabilities of less than 30 days, you have to hold liquid assets against it.   To avoid that , you can call the bond when it still has 3 months to go.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-08-18T10:13:27.127" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="35678" PostTypeId="1" AcceptedAnswerId="35747" CreationDate="2017-08-18T16:18:37.990" Score="0" ViewCount="61" Body="&lt;p&gt;Doesn't the existence of Market Price of Risk make investment strategies relying on the average outcome of a risky investment attractive as compared to the expected value of it (computed under the risk free measure)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand there is some heterogeneity going on but, wouldn't the demand for such a strategy anyway decrease the MPR until making it zero, so that the average payoff of the security matches the risk-free computed value?&lt;/p&gt;&#xA;" OwnerUserId="25455" LastEditorUserId="16148" LastEditDate="2017-08-18T18:03:42.757" LastActivityDate="2017-08-23T01:34:33.147" Title="Does MPR imply strategies with positive average return?" Tags="&lt;risk-neutral-measure&gt;&lt;strategy&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35680" PostTypeId="2" ParentId="34392" CreationDate="2017-08-18T17:08:33.083" Score="5" Body="&lt;p&gt;As mentioned in other answers, Coinmarketcap and Bitcoincharts are two options. The data they provide is also available from Quandl too.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only issue is, that data has daily frequency and is only the usual OHLC type, at best. If you want tick data you have no other option than to get it from exchanges themselves. There you can also get the orderbook data too. Just use a websocket for getting all the data. Some examples:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bitfinex: &lt;a href=&quot;http://docs.bitfinex.com/&quot; rel=&quot;noreferrer&quot;&gt;http://docs.bitfinex.com/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bitstamp: &lt;a href=&quot;https://www.bitstamp.net/api/&quot; rel=&quot;noreferrer&quot;&gt;https://www.bitstamp.net/api/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;GDAX: &lt;a href=&quot;https://docs.gdax.com/&quot; rel=&quot;noreferrer&quot;&gt;https://docs.gdax.com/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11923" LastActivityDate="2017-08-18T17:08:33.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35684" PostTypeId="2" ParentId="35671" CreationDate="2017-08-18T20:23:21.970" Score="1" Body="&lt;p&gt;Futures roll can potentially create some short-term imbalances that distort market pricing. Whether or not that should be accounted for in curve construction is philosophical. In my mind, there's no reason to – you're building a market-based curve, and you shouldn't override the market. You can, however, build a separate &quot;fair value&quot; curve which incorporates some of your personal views on where things should be trading at. Comparing this fair value curve with the market-based curve is how you discover relative value trading opportunities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, I wouldn't worry about &quot;jumps&quot; in the curve in general. There's no reason why the yield curve has to be perfectly smooth. You may have read about the humps in the T-bill curve around October maturity. The hump simply reflects market concerns about whether or not the debt ceiling will be lifted in time. There are always reasons for why these abnormalities exist; it's best to show them so as to reveal potential trading opportunities, rather than smoothing them out just to make the curve look nicer...&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2017-08-18T20:39:43.550" LastActivityDate="2017-08-18T20:39:43.550" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35685" PostTypeId="2" ParentId="35660" CreationDate="2017-08-18T20:37:17.527" Score="1" Body="&lt;p&gt;Assuming you have a transition Matrix, you can obtain a term structure for each rating (AAA,AA,BB,etc...) by a matrix multiplication, as your transition matrix is a Markov Chain. This term Structure will be a probability of default term structure. Then, applying the approximation for the probability of default you mentioned given it's credit quality as A and assuming you have a Recovery Rate for your case:&#xA;$$PD_{A}^{T}=1-e^{\frac{-spread*years}{1-R}}$$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;from there, you can calculate the spread as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$spread=-\frac{1-R}{years}ln(1-PD_{A}^{T}).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously, the best thing to do is to estimate the spread as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ spread=\frac{CDS_{DefLeg}}{DVO1}$$&lt;/p&gt;&#xA;" OwnerUserId="29200" LastActivityDate="2017-08-18T20:37:17.527" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35686" PostTypeId="1" CreationDate="2017-08-18T20:39:53.653" Score="7" ViewCount="1906" Body="&lt;p&gt;I am trying to calibrate the 1 factor Hull White model to ATM swaptions. The strategy which I use is to minimise the sum of squared difference between model and market prices for the swaptions on the diagonal of the swaption matrix. I am using only swaption maturities till 10 years. So the swaptions which I am using for the calibration are 10x1, 9x2, ..., 1x10. And I am running a DE algorithm for jointly calibrating both the mean reversion parameter and volatility parameter (both assumed constant). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I understand that a lot of practitioners fix the value of the mean reversion parameter and only calibrate for the volatility parameter. However I have not been able to find any references for how a &quot;best value&quot; for the mean reversion parameter is decided. So it would be great if someone could shed some light on what exactly are the steps to decide on a &quot;best value&quot; for the mean reversion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The currency for which I am trying to calibrate is GBP.&lt;/p&gt;&#xA;" OwnerUserId="26314" LastActivityDate="2019-08-29T09:01:55.217" Title="Fixing mean reversion parameter in the 1F HW model" Tags="&lt;interest-rates&gt;&lt;calibration&gt;&lt;hullwhite&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35687" PostTypeId="1" CreationDate="2017-08-18T22:10:16.833" Score="2" ViewCount="287" Body="&lt;p&gt;Every year a place like Goldman Sachs hires dozens of new strategists (quants) and the same can be said about many other firms. Some of those quants become managing directors and are set for life. But what is a typical career trajectory for a quant like? Does it depend on whether a person has a PhD or not? Even as a VP in NYC you do not really become a high net worth individual, even though you can probably afford a decent life there, so I am curious what happens to most of these people that enter the industry but are not quite in the top 1% that earns the big bucks. &lt;/p&gt;&#xA;" OwnerUserId="26887" LastActivityDate="2017-08-19T01:04:57.403" Title="Long term career trajectories of quants" Tags="&lt;quants&gt;&lt;career&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2017-08-19T16:41:07.470" ContentLicense="CC BY-SA 3.0" />
  <row Id="35688" PostTypeId="2" ParentId="35687" CreationDate="2017-08-19T01:04:57.403" Score="2" Body="&lt;p&gt;More a comment than a proper answer, with low rep I can't comment. By the way, I would say that a PhD isn't a requirement in order to do a quant job - look at Citadel, for example: most of their hires don't have a PhD. What they do have, indeed, is the capability to formulate well-posed problems, and to deal even with ill posed ones.&lt;/p&gt;&#xA;" OwnerUserId="29143" LastActivityDate="2017-08-19T01:04:57.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35689" PostTypeId="1" CreationDate="2017-08-19T17:01:59.803" Score="2" ViewCount="50" Body="&lt;p&gt;Given a reference underlying price, reference option price, delta and gamma, if I receive a new underlying/option price what equation should I use to calculate the respective option/underlying price (and new delta gamma?)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(and a minor sub-question, does the Theo feature in this?)&lt;/p&gt;&#xA;" OwnerUserId="5168" LastActivityDate="2017-08-19T17:01:59.803" Title="Calculate latest underlying price (or option), given new option (or underlying) market price?" Tags="&lt;option-pricing&gt;&lt;delta-hedging&gt;&lt;delta&gt;&lt;gamma&gt;&lt;delta-neutral&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35690" PostTypeId="1" CreationDate="2017-08-19T17:03:01.550" Score="3" ViewCount="1992" Body="&lt;h1&gt;How do you suggest I do this?&lt;/h1&gt;&#xA;&lt;p&gt;I would like to perform a statistical test to check if:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;the aggregate alpha of all funds equals 0.&lt;/li&gt;&#xA;&lt;li&gt;the aggregate beta of all funds equals 1.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h1&gt;Data&lt;/h1&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Sample of 1000 mutual funds over the period 1990 to 2017. I regress&#xA;funds monthly excess return over the risk free rate against the&#xA;Carhart (1997) four factor model.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h1&gt;Dilemma&lt;/h1&gt;&#xA;&lt;p&gt;Since I individually regress funds over the risk parameters. Now I have 1000 alpha, 1000 beta,...&lt;/p&gt;&#xA;&lt;h1&gt;Software&lt;/h1&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Stata&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h1&gt;How I plan on doing it&lt;/h1&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I individually regress each funds excess return against the risk factors; and store the regression coefficients (alpha, beta, smb, hml, and mom) and their standard errors to calculate the t-statistic of coefficients.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="28909" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2017-09-03T07:53:13.490" Title="Choosing the right statistical test for Mutual Fund Performance Evaluation" Tags="&lt;time-series&gt;&lt;portfolio-management&gt;&lt;finance&gt;&lt;regression&gt;&lt;econometrics&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="35691" PostTypeId="2" ParentId="8896" CreationDate="2017-08-19T17:14:04.247" Score="0" Body="&lt;p&gt;This one uses machine learning:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/ScottFreeLLC/AlphaPy&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/ScottFreeLLC/AlphaPy&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://alphapy.readthedocs.io/en/latest/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://alphapy.readthedocs.io/en/latest/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="25221" LastActivityDate="2017-08-19T17:14:04.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35692" PostTypeId="2" ParentId="35690" CreationDate="2017-08-19T17:20:02.477" Score="1" Body="&lt;p&gt;Well, one can as well determine what is the distribution of your $\alpha$ and $\beta$ coefficient, and find which funds deliver significant performance with respect to the overall distribution. Without distributional assumptions on the coefficients, you can't test anything.&lt;/p&gt;&#xA;" OwnerUserId="29143" LastActivityDate="2017-08-19T17:20:02.477" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35693" PostTypeId="2" ParentId="35690" CreationDate="2017-08-19T17:55:01.350" Score="11" Body="&lt;p&gt;Define excess return $r^x_{it} = r_{it} - r^f_{t}$ as the return $i$ minus the risk free rate, and $f_{jt}$ similarly denotes the excess return of factor $j$ at time $t$. Let's say we have some factor model of returns where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ r^x_{it} = \alpha_i + \sum_j \beta_{i,j} f_{jt} + \epsilon_{it}$$&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;F-test / GRS Test&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;If we assume the error terms $\epsilon_{it}$ follow the normal distribution, are uncorrelated over time, and are homoskedastic, a standard F-test can be used for the hypothesis that $\alpha_i = 0$ for all $i$. Finance calls this the GRS test for Gibbons, Ross, and Shanken who originally applied it to asset pricing. A statistician may see it as a form of &lt;a href=&quot;https://en.wikipedia.org/wiki/F-test&quot; rel=&quot;noreferrer&quot;&gt;F-test&lt;/a&gt;. Following similar notation as in Cochrane (2005):&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Let $\tau$ be the number of time periods of your data.&lt;/li&gt;&#xA;&lt;li&gt;Let $\Sigma_f$ be a $k \times k$ sample covariance matrix of your factors.&lt;/li&gt;&#xA;&lt;li&gt;Let $\Sigma$ be an $n \times n$ sample covariance matrix of your residuals $\epsilon_{it}$.&lt;/li&gt;&#xA;&lt;li&gt;Let $\boldsymbol{\alpha} = \begin{bmatrix}\alpha_1 \\ \ldots \\ \alpha_n \end{bmatrix}$ be a vector of your alphas.&lt;/li&gt;&#xA;&lt;li&gt;Let $\boldsymbol{\mu_f}$ be a $k \times 1$ vector giving the sample mean returns of the factors.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The GRS test statistic is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ f_{GRS} = \left( \frac{\tau - n - k}{n}\right) \frac{\boldsymbol{\alpha}' \Sigma^{-1} \boldsymbol{\alpha}}{ 1 + \boldsymbol{\mu_f}' \Sigma_f^{-1} \boldsymbol{\mu_f}} $$&#xA;where test statistic $f_{GRS}$ follows the $F$ distribution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ f_{GRS} \sim F\left(n, \tau - n - k \right)$$&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;$\chi^2$ test&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Dropping the assumption of normally distributed error terms, there exists a test-statistic that asymptotically approaches the $\chi^2$ distribution. Let $n$ be the number of test assets, and let $T$ be the number of time periods. Define test statistic $J$ as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ J = T \frac{\boldsymbol{\alpha}' \Sigma^{-1} \boldsymbol{\alpha}}{ 1 + \boldsymbol{\mu_f}' \Sigma_f^{-1} \boldsymbol{\mu_f}} $$&#xA;$J$ follows the $\chi^2$ distribution with $n$ degrees of freedom:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ J \sim \chi^2\left(n \right)$$&#xA;Cochrane (2005) shows how to derivate the test statistic as a special case of the &lt;a href=&quot;https://en.wikipedia.org/wiki/Sargan%E2%80%93Hansen_test&quot; rel=&quot;noreferrer&quot;&gt;Sargan-Hansen J test&lt;/a&gt;. You might also examine Cochrane's notes &lt;a href=&quot;https://faculty.chicagobooth.edu/john.cochrane/teaching/35150_advanced_investments/week_5_notes.pdf&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Collinear residuals&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;If some of your test returns are essentially the same return, then you're going to have a rank deficient $\Sigma$ matrix. Use the &lt;a href=&quot;https://en.wikipedia.org/wiki/Moore%E2%80%93Penrose_pseudoinverse&quot; rel=&quot;noreferrer&quot;&gt;pseudo-inverse&lt;/a&gt; $\Sigma^+$ instead of the inverse $\Sigma^{-1}$ and use $n$ as the number of linearly independent assets. This $n$ can be estimated by conducting a &lt;a href=&quot;https://en.wikipedia.org/wiki/Singular_value_decomposition&quot; rel=&quot;noreferrer&quot;&gt;singular value decomposition&lt;/a&gt; of $\Sigma$ and counting the number of singular values above some threshold. (This is how MATLAB and some other packages estimate matrix &lt;a href=&quot;https://en.wikipedia.org/wiki/Rank_(linear_algebra)&quot; rel=&quot;noreferrer&quot;&gt;rank&lt;/a&gt;.)&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Discussion:&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Generally what you find with any of these F tests or $\mathcal{X}^2$ tests is that the hypothesis that all the alphas are zero is &lt;strong&gt;overwhelmingly&lt;/strong&gt; rejected. What does that mean?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One possibility is that the model of returns is misspecified, that the Carhart four factor model or whatever you're using doesn't perfectly describe the joint distribution of returns. These factor models sort of work (in the sense that they're useful), but they're not that precise either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you find that mutual funds have non-zero alpha relative to this asset pricing model does it mean:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Some mutual funds have positive skill (and/or some have negative&#xA;skill)?&lt;/li&gt;&#xA;&lt;li&gt;That we have the wrong asset pricing model?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The two aren't really distinguishable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There's also a famous saying of &lt;a href=&quot;https://en.wikipedia.org/wiki/George_E._P._Box&quot; rel=&quot;noreferrer&quot;&gt;Box&lt;/a&gt; that all models are wrong but some are useful. Generally speaking, you can statistically reject any asset pricing model with the right test assets. Whether the model is useful is a more nuanced discussion.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Testing for betas?&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;You seem to want to test for a value weight market beta of 1? I don't see how this is at all useful. &lt;em&gt;Mechanically&lt;/em&gt;, the value weight market beta across all securities &lt;em&gt;must&lt;/em&gt; be one! I'm struggling to see how this would be useful?&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Bootstrapping&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Another approach to creating consistent test statistics is &lt;a href=&quot;https://en.wikipedia.org/wiki/Bootstrapping_(statistics)&quot; rel=&quot;noreferrer&quot;&gt;bootstrapping&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, Fama and French (2010) construct bootstrap simulations of what distribution of mutual fund returns would be expected under a hypothesis of zero alphas under the Fama French three factor model.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;References&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Cochrane, John, &lt;em&gt;Asset Pricing&lt;/em&gt;, 2005, p. 230 &lt;a href=&quot;https://faculty.chicagobooth.edu/john.cochrane/teaching/35150_advanced_investments/Cochrane_asset_pricing_CH12_229-250.pdf&quot; rel=&quot;noreferrer&quot;&gt;link&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fama, Eugene and Kenneth French, &quot;Luck versus Skill in the Cross-Section of Mutual Fund Returns&quot;, &lt;em&gt;Journal of Finance&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-09-03T07:53:13.490" LastActivityDate="2017-09-03T07:53:13.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35696" PostTypeId="1" AcceptedAnswerId="35830" CreationDate="2017-08-19T22:09:47.433" Score="1" ViewCount="134" Body="&lt;p&gt;Following &quot;Arbitrage Theory in Continuous Time&quot; by Thomas Bjork, a standard one-factor short-rate model is of the form&#xA;\begin{align*}&#xA;dr_t = \mu(t,r_t)dt + \sigma(t,r_t)dW_t.&#xA;\end{align*}&#xA;The only exogeneously given asset is then the locally risk-free money account with dynamics&#xA;\begin{align*}&#xA;dB_t = r_tB_tdt, \quad\text{ or }\quad  B_t = e^{\int_0^tr_sds},&#xA;\end{align*}&#xA;which can be shown to be equivalent to investing in a self-financing rolling over trading strategy, which at each time $t$ consists entirely of bonds with maturity at $t+dt$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, from the $r_t$ dynamics one can derive the dynamics for the price of a $T$-bond, $p(t,T)$:&#xA;\begin{align*}&#xA;\frac{dp(t,T)}{p(t,T)} = \alpha_T(t)tdt + \sigma_T(t)dW_t,&#xA;\end{align*}&#xA;and the punchline is that for any maturities $S&amp;gt;t$ and $T&amp;gt;t$:&#xA;\begin{align*}&#xA;\frac{\alpha_T(t)-r_t}{\sigma_T(t)}=\frac{\alpha_S(t)-r_t}{\sigma_S(t)},&#xA;\end{align*}&#xA;which means that the local risk-premium for exposing yourself to interest-rate risk is the same whether you invest in a bond with maturity $S$ or maturity $T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand the mathematics, but I am looking for an intuitive answer to the following question: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Why is there a risk-premium for investing in $T$-bonds?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why don't we have $\alpha_T(t)=r_t$? Intuitively I feel like the $T$-bonds are just as locally risk-free as the money account, which, as mentioned above, is just like investing continuously in bonds that are about to mature.&lt;/p&gt;&#xA;" OwnerUserId="26887" LastEditorUserId="26887" LastEditDate="2017-08-28T23:57:38.367" LastActivityDate="2017-08-29T16:08:48.830" Title="Short-rate models: Risk-premium of $T$-bonds" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;bond&gt;&lt;short-rate&gt;&lt;risk-premium&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35697" PostTypeId="1" AcceptedAnswerId="35701" CreationDate="2017-08-19T23:52:09.867" Score="10" ViewCount="6220" Body="&lt;p&gt;Taken from a mid-July Wall Street Journal news story: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Surging optimism in financial markets hasn’t translated into a big pickup in economic growth. Stocks hit records Friday and big U.S. banks reported stronger-than-expected earnings. But new government data showed consumers pulled back spending at mid-year even as markets rallied. Households also grew less optimistic about the future and inflation on consumer purchases softened.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A prominent quant responds:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;In the quant language: the physical measure and the risk neutral measure are different, and assign different probabilities to future events... There is really no logical contradiction between predictions based on history and those based on market sentiment.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone elaborate a bit on what exactly this means, how it should be interpreted, and what it tells us about the future? I am familiar with risk-neutral pricing theory, but thinking about a real-world story like this one makes me quite confused.  &lt;/p&gt;&#xA;" OwnerUserId="26887" LastEditorUserId="26887" LastEditDate="2017-08-21T06:40:18.460" LastActivityDate="2017-11-13T08:13:36.057" Title="Risk-neutral vs. physical measures: Real-world example" Tags="&lt;risk-neutral-measure&gt;" AnswerCount="6" CommentCount="4" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="35698" PostTypeId="2" ParentId="8896" CreationDate="2017-08-20T00:38:03.083" Score="2" Body="&lt;p&gt;There are quite a few Quantopian alternative. The most popular are &lt;a href=&quot;https://www.quantconnect.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;QuantConnect&lt;/a&gt; and &lt;a href=&quot;https://www.quantiacs.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;Quantiacs&lt;/a&gt;. Both QuantConnect and Quantiacs offer a server ran platform to implement your algorithm. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However they both also have their tools on Github. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/QuantConnect&quot; rel=&quot;nofollow noreferrer&quot;&gt;QuantConnect GitHub&lt;/a&gt; is a open-source C#, F# and Python algorithmic trading platform. QuantConnect data source is QuantQuote compared to Quantopian's data source which is Quandl.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/Quantiacs&quot; rel=&quot;nofollow noreferrer&quot;&gt;Quantiacs GitHub&lt;/a&gt; offers their open-source toolkit in Python and Matlab. Quantiacs uses their own data source.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Data is important to backtesting. Hopefully these two will give you some alternative to implementation and data source.&lt;/p&gt;&#xA;" OwnerUserId="29261" LastActivityDate="2017-08-20T00:38:03.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35699" PostTypeId="2" ParentId="35697" CreationDate="2017-08-20T03:23:49.773" Score="3" Body="&lt;p&gt;This was born as a comment, but is too long, so I'll post it as an answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Excuse me, @AlexC, but the guy interviewed is right. Even when pricing options with a trivial binomial tree you notice that the probabilities of the different outcomes are re-weighted when you switch from the physical measure to the risk neutral one. Then, we can reason a little bit: if we consider the stock price as the &lt;em&gt;present value of future cash flows&lt;/em&gt; - definition stolen from a corporate finance textbook, we need it before doing fancy mathematics - it is immediate to get how a stock price already incorporates &lt;em&gt;historic prediction&lt;/em&gt; - i.e. the reaction of the market to particular events - and to even notice that this kind of analysis doesn't differ at all with respect to the predictions based on &lt;em&gt;market sentiment&lt;/em&gt; - that is, the attitude of the market participants. Both are two different ways of doing basically the same thing.&lt;/p&gt;&#xA;" OwnerUserId="16045" LastActivityDate="2017-08-20T03:23:49.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35701" PostTypeId="2" ParentId="35697" CreationDate="2017-08-20T09:32:38.363" Score="14" Body="&lt;p&gt;You can price an asset paying $X_{t+1}$ in two ways:&#xA;$$P_t=\frac{1}{R_f}\sum_{\omega} Q(\omega)X_{t+1}(\omega)$$&#xA;$$P_t=\sum_{\omega} P(\omega)M_{t+1}(\omega)X_{t+1}(\omega)$$&#xA;As you can see, the price is making a joint statement (i.e. you can recover $Q(\omega)$) regarding both the probability of an event $P(\omega)$ and how much people dislike that event, i.e. the discount factor $M_{t+1}(\omega)$. If I ask you to price an umbrella, not only the price reflects the likelihood that tomorrow is going to rain (i.e. $P(rain)$) but how much you dislike being under the rain without an umbrella (i.e., $M_{t+1}(rain)$). Therefore, when you observe the price of umbrellas going up, is it because it is more likely to rain or because people dislike more taking a shower? Unfortunately, so far there is no way to tell!&lt;/p&gt;&#xA;" OwnerUserId="8028" LastActivityDate="2017-08-20T09:32:38.363" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35703" PostTypeId="2" ParentId="35697" CreationDate="2017-08-20T11:35:30.227" Score="8" Body="&lt;p&gt;First of all, you need to understand risk-neutral measures are not meant to make &lt;em&gt;predictions&lt;/em&gt; of future prices, but they are meant to allow &lt;em&gt;hedging&lt;/em&gt; (ie &lt;em&gt;risk replication&lt;/em&gt;). Historical measures on their side, are meant to &lt;em&gt;predict future prices&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I used the plural because &lt;strong&gt;they are many risk-neutral and historical measures&lt;/strong&gt;. In both cases you choose one measure when you choose an &lt;strong&gt;underlying model&lt;/strong&gt;. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Risk neutral measure&lt;/strong&gt; is explaining the &lt;strong&gt;map&lt;/strong&gt; of current market prices: under a specific model (for instance martingale, or semi-martingale) you like all available financial products asking their prices to be consistant with respect to the associated claims.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Historical measure&lt;/strong&gt; uses past prices to estimate future ones. As usual in prediction, it needs to &lt;em&gt;stationarize&lt;/em&gt; the data, and the usual way is to use prices returns. But some methods can get rid of stationarization locally. In any case you will need &lt;em&gt;conditionings&lt;/em&gt; (ie month of the year, news, day of the week, etc). The way to disentangle and recompose basic elements to obtain the prices &lt;em&gt;tomorrow&lt;/em&gt; (or newt week), is &lt;strong&gt;your model&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;That being said, why is it expected to have different pricing for risk-neutral (RN) and historical (HIST) valuation?&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;First of all, from the viewpoint of the the HIST measure, prices today can be &lt;em&gt;cheap&lt;/em&gt; or &lt;em&gt;expensive&lt;/em&gt;, it is &lt;em&gt;not meant to be the case&lt;/em&gt; for the RN measure.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;This shows that HIST can give you arbitrage opportunities for hedge funds: buy now if it is cheap, you will earn money selling your position soon.&lt;/li&gt;&#xA;&lt;li&gt;And RN gives you (rare) arbitrage opportunities for banks: you identify one bank is underpricing a derivative product with respect to all other market prices. Usually this mispricing is small, hence you need the leverage of a bank to earn a decent amount of money. And the gain will be &lt;em&gt;instantaneous&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You now see that you need to be able to &lt;strong&gt;take risk to take profit of HIST arbitrage opportunities&lt;/strong&gt; (because you will have to hold a portfolio waiting for the price to come back) and you &lt;strong&gt;need leverage to take profit of RN opportunities&lt;/strong&gt; but your reward is riskless.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Last but not least, thanks to Bachelier's replication principle (ie Black-Scholes like framework), if you use a versatile enough RN measure and you replicate your risk frequently enough (to not suffer from gamma-driven lost). I.e. you will not loose (too much) money to cancel any risk. Of course you need the market to be complete (ie having enough tradable instruments to span the Euclidian space generated by your risk).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2017-08-20T11:35:30.227" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35704" PostTypeId="2" ParentId="3979" CreationDate="2017-08-20T13:12:17.003" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;I have a cumulative profit/loss time series below for a trading strategy, what is the appropriate way to calculate the returns in percentage for such a series?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Correct me if I am wrong, but it seems to me there is no such thing as return for P&amp;amp;L. Your series contains net income which itself is a return. You could calculate the ralative change for your series, but it has no meaning when you switch from profit to loss and vice versa. &lt;a href=&quot;http://mathforum.org/library/drmath/view/55720.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Here&lt;/a&gt; is the relevant discussion with the link to WSJ not providing percent change for net income in such scenario.&lt;/p&gt;&#xA;" OwnerUserId="18551" LastActivityDate="2017-08-20T13:12:17.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35705" PostTypeId="2" ParentId="26125" CreationDate="2017-08-20T14:39:36.713" Score="3" Body="&lt;p&gt;To answer this question it might make sense to mention the VaR part and VEV part separately.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;VaR example using a parametric approach to VaR: assuming an investment of $V_0 = 10,000 $ into the financial asset and its daily log return following a normal distribution such that $r_t \backsim N(\mu, \sigma^2)$ with mean $\mu=0.02$ and standard deviation $\sigma = 0.7$, compute the VaR of the investment at $p = 2.5\%$ for 1 day. Since the VaR may be defined in several ways, e.g. as value $\bigtriangleup V_1 $ on which the investment can depreciate or as value  $V_1$ ($V_1 &amp;lt; V_0$), which shows the new level of the investment, the later definition is used in the example. &#xA;The solution would be:&lt;br&gt;&#xA;\begin{equation}&#xA;VaR = V_t(exp(\Phi^{-1}(0.025)\sigma + \mu)). &#xA;\end{equation} &#xA;2.5-quantile of standard Normal distribution is $\Phi^{-1}(0.025)$ is -1.96. &#xA;\begin{equation}&#xA;10,000(exp(-1.96 * 0.7 + 0.02)) = 2587.22, &#xA;\end{equation} &#xA;meaning that with probability $2.5\%$ a one-day investment of 10,000 into the asset will be 2587.22 or less.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;As one may guess, given a Normal distributional assumption on daily log-return and already calculated VaR, for example by means of a Monte Carlo simulation, one may infer $\sigma$. It seems that a question being answered by VEV is: &quot;what would be a scale parameter labelled $\sigma$ of a Normally distributed random variable, if one assumes &quot;demeaned&quot; distribution $N(-\dfrac{1}{2} \sigma T,  \sigma^2T)$ and value of 2.5-quantile at the VaR level. $T$ denotes the period in years.&lt;br&gt;&#xA;[ see this link for more info on T and distributional assumption &lt;a href=&quot;https://quant.stackexchange.com/questions/26235/is-this-a-viable-alternative-options-pricing-method/26276#26276&quot;&gt;Is This A Viable Alternative Options Pricing Method?&lt;/a&gt; ]. &#xA;\begin{equation}&#xA;VaR = V_t(exp(\Phi^{-1}(0.025)\sigma \sqrt{T} +(-\dfrac{1}{2} \sigma T) )), &#xA;\end{equation} &#xA;which is rewritten in as a quadratic equation: &#xA;\begin{equation}&#xA;\dfrac{1}{2} T\sigma^2 + 1.96\sqrt{T}\sigma + \ln{\dfrac{VaR_0}{V_0}}=0, &#xA;\end{equation} &#xA;which can be solved for sigma via discriminant as $ax^2 + bx + c = 0$, when $\sigma$ replaces the $x$. Finally, a negative solution being disregarded one gets VEV formula:&#xA;\begin{equation}&#xA;\sigma = \dfrac{\sqrt{3.8416-2\ln{\dfrac{VaR_0}{V_0}}}-1.96}{\sqrt{T}}. &#xA;\end{equation} &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="24076" LastActivityDate="2017-08-20T14:39:36.713" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35706" PostTypeId="1" CreationDate="2017-08-20T16:24:18.693" Score="1" ViewCount="643" Body="&lt;p&gt;I'm trying to build a Excel spreadsheet with QuantLib 1.4 for swap valuation of &quot;live&quot; swaps; IRSs with a start date in the past, and an end date in the future. This is what I've got so far...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/SpreadServe/ssxls/blob/master/IRDValServer.xls&quot; rel=&quot;nofollow noreferrer&quot;&gt;IRDValServer.xls&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically it's a cut down version of the InterestRateDerivatives.xls example sheet, with Cap, Floor, FRA and Swaptions removed. In the DateCalc tab I've added a call to qlScheduleDates in column D so I know which past dates require fixings. However, the dates supplied by qlScheduleDates are not the ones that qlInstrumentNPV needs. ohRangeRetrieveError gives this error message: &quot;qlInstrumentNPV - 2nd leg: Missing Euribor6M Actual/360 fixing for August 10th, 2017&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried launching Excel from inside Visual Studio, so I could breakpoint the code throwing that error. This was the stack trace to the error.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;QuantLibXL-vc90-mt-sgd-1_4_0.xll!QuantLib::Error::Error(const std::basic_string&amp;lt;char,std::char_traits&amp;lt;char&amp;gt;,std::allocator&amp;lt;char&amp;gt; &amp;gt; &amp;amp; file, long line, const std::basic_string&amp;lt;char,std::char_traits&amp;lt;char&amp;gt;,std::allocator&amp;lt;char&amp;gt; &amp;gt; &amp;amp; function, const std::basic_string&amp;lt;char,std::char_traits&amp;lt;char&amp;gt;,std::allocator&amp;lt;char&amp;gt; &amp;gt; &amp;amp; message)  Line 97 C++&#xA;QuantLibXL-vc90-mt-sgd-1_4_0.xll!QuantLib::IborCoupon::indexFixing()  Line 102 + 0x146 bytes    C++&#xA;    // fixingDate_ = 42957 (10 Aug 2017), today = 42962 (15 Aug 2017)&#xA;    // fixingValueDate_ = 42961 (14 Aug 2017)&#xA;    // this is BlackIborCouponPricer::coupon_&#xA;QuantLibXL-vc90-mt-sgd-1_4_0.xll!QuantLib::BlackIborCouponPricer::adjustedFixing(double fixing)  Line 101 + 0x17 bytes  C++&#xA;QuantLibXL-vc90-mt-sgd-1_4_0.xll!QuantLib::BlackIborCouponPricer::swapletPrice()  Line 148 + 0x24 bytes C++&#xA;QuantLibXL-vc90-mt-sgd-1_4_0.xll!QuantLib::BlackIborCouponPricer::swapletRate()  Line 153 + 0xe bytes   C++&#xA;QuantLibXL-vc90-mt-sgd-1_4_0.xll!QuantLib::FloatingRateCoupon::rate()  Line 93 + 0x29 bytes C++&#xA;QuantLibXL-vc90-mt-sgd-1_4_0.xll!QuantLib::FloatingRateCoupon::amount()  Line 62 + 0x2d bytes   C++&#xA;QuantLibXL-vc90-mt-sgd-1_4_0.xll!QuantLib::CashFlows::npvbps(const std::vector&amp;lt;boost::shared_ptr&amp;lt;QuantLib::CashFlow&amp;gt;,std::allocator&amp;lt;boost::shared_ptr&amp;lt;QuantLib::CashFlow&amp;gt; &amp;gt; &amp;gt; &amp;amp; leg, const QuantLib::YieldTermStructure &amp;amp; discountCurve, bool includeSettlementDateFlows, QuantLib::Date settlementDate, QuantLib::Date npvDate, double &amp;amp; npv, double &amp;amp; bps)  Line 515 + 0xf bytes  C++&#xA;QuantLibXL-vc90-mt-sgd-1_4_0.xll!QuantLib::DiscountingSwapEngine::calculate()  Line 86 + 0x88 bytes C++&#xA;QuantLibXL-vc90-mt-sgd-1_4_0.xll!QuantLib::Instrument::performCalculations()  Line 168 + 0x26 bytes C++&#xA;QuantLibXL-vc90-mt-sgd-1_4_0.xll!QuantLib::LazyObject::calculate()  Line 150 + 0xf bytes    C++&#xA;QuantLibXL-vc90-mt-sgd-1_4_0.xll!QuantLib::Instrument::calculate()  Line 155    C++&#xA;QuantLibXL-vc90-mt-sgd-1_4_0.xll!QuantLib::Instrument::NPV()  Line 187 + 0xe bytes  C++&#xA;QuantLibXL-vc90-mt-sgd-1_4_0.xll!qlInstrumentNPV(char * ObjectId, xloper * Trigger)  Line 155 + 0x19 bytes  C++&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;By breakpointing in IborCoupon::indexFixing I found that the fixingValueDate_ in IborCoupon lined up with&#xA;the dates supplied by qlScheduleDates, but the fixingDate_ did not. In the debugger I captured these&#xA;values on different visits into IborCoupon::indexFixing( )&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;fixingDate      2017-08-10  2015-08-12  2016-02-11  2016-08-11  2017-02-10  2017-08-10&#xA;fixingValueDate 2017-08-14  2015-08-14  2016-02-15  2016-08-15  2017-02-14  2017-08-14&#xA;fixingEndDate   2018-02-14  2016-02-15  2016-08-15  2017-02-14  2017-08-14  2018-02-14&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I resolve this date mismatch so I can supply the correct fixings?&#xA;Can I get qlScheduleDates to show me the fixingDate values rather thatn the fixingValueDates? Or can I change the&#xA;floating rate coupon pricing logic to take the dates qlScheduleDates reports?&lt;/p&gt;&#xA;" OwnerUserId="7075" LastActivityDate="2017-09-25T13:44:37.250" Title="QuantLibXL swap valuation fixing dates" Tags="&lt;quantlib&gt;&lt;excel&gt;&lt;irs&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35707" PostTypeId="1" CreationDate="2017-08-20T17:47:53.200" Score="4" ViewCount="3197" Body="&lt;p&gt;Consider a vanilla European call option C, with underlying asset S, strike price K and time to maturity T. Assume that S follows a geometric Brownian motion with mean growth rate of μ and volatility σ. r represents the continuously compounding risk free interest rate. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I sold one call option, and I decided to hedge my risks, using Delta-Neutral strategy. So, I make sure that I always have  $$ S\frac{\partial C}{\partial S}$$ worth of stock with me at any moment. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In John Hull, it is mentioned that the cost of such a strategy is always equal to BSM price, irrespective of the actual path that the stock price follows. I am trying to prove this statement mathematically. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is how I am trying to prove:&#xA;The total cost of delta hedging should be &#xA;$$&#xA;\int_0^T SN(d1)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ as    &#xA;\frac{\partial C}{\partial S} = N(d1)&#xA;$$&#xA;( If possible, we can assume r = 0 for simplicity )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can you please guide me on how to proceed further or any other method&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S. (edit): Intuitively, I know that cost of delta-hedging strategy is always equal to the price of the option. To prove this, let us assume that I sold a call  option. Now, I want to hedge myself against downward movement in stock prices. The strategy I would follow is to maintain Delta * Stocks at every point in time, therefore my payoff at the end of maturity would be zero. Essentially, the cost of such a strategy has to be &lt;em&gt;always equal&lt;/em&gt; to the price of the call option because only then, No-arbitrage holds.&lt;/p&gt;&#xA;" OwnerUserId="27273" LastEditorUserId="27273" LastEditDate="2017-08-21T11:57:50.933" LastActivityDate="2017-11-20T11:08:32.207" Title="A simple question: Cost of delta hedging when a call option is sold" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;european-options&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35708" PostTypeId="1" CreationDate="2017-08-20T20:06:29.673" Score="1" ViewCount="98" Body="&lt;p&gt;Under the usual notations, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In most textbooks on Quantative Finance, for deriving the Black-Scholes solution I find that authors, while setting up the riskless portfolio, assume that,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{d} (\frac{\partial V}{\partial S} S_t) =  \frac{\partial V}{\partial S} \text{d} S_t $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;At least can we prove this post facto, as in, does this equation hold true for famous Black Scholes equation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same issue is also pointed out &lt;a href=&quot;https://quant.stackexchange.com/questions/8560/black-scholes-hedging-argument?rq=1&quot;&gt;here&lt;/a&gt;. &lt;/p&gt;&#xA;" OwnerUserId="27273" LastEditorUserId="27273" LastEditDate="2017-08-20T20:12:23.977" LastActivityDate="2017-08-20T22:24:19.640" Title="Assumption in black scholes solution" Tags="&lt;black-scholes&gt;&lt;black-scholes-pde&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35709" PostTypeId="2" ParentId="22596" CreationDate="2017-08-20T20:30:51.317" Score="2" Body="&lt;p&gt;Just starting to check it out, but &lt;a href=&quot;https://www.enigma.co/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.enigma.co/&lt;/a&gt; seems to have a Crypto framework based on zipline in the making.&lt;/p&gt;&#xA;" OwnerUserId="29270" LastEditorUserId="29270" LastEditDate="2019-01-03T19:09:28.570" LastActivityDate="2019-01-03T19:09:28.570" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="35712" PostTypeId="2" ParentId="35708" CreationDate="2017-08-20T22:24:19.640" Score="2" Body="&lt;p&gt;This is not true. Note that $\frac{\partial C}{\partial S_t} = N(d_1)$. Then&#xA;\begin{align*}&#xA;d\left(\frac{\partial C}{\partial S_t}S_t\right) &amp;amp;= \underbrace{S_t dN(d_1) + d\langle N(d_1), S\rangle_t} + N(d_1) dS_t\\&#xA;&amp;amp;\ne N(d_1) S_t.&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;d\left(\frac{\partial C}{\partial S_t}S_t\right)\ne \frac{\partial C}{\partial S_t}dS_t.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2017-08-20T22:24:19.640" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35714" PostTypeId="1" CreationDate="2017-08-21T07:05:07.603" Score="3" ViewCount="73" Body="&lt;p&gt;I'm a quant working in a mainly fundamental shop.  Analysts are asked to score things like management or industry trends of stocks in their &quot;watchlist&quot;, and I am now trying to weave the results into a factor model.  The model includes other factors such as earnings yield and some financial quality metrics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The scores are simple 1 to 5 scores, where 1 is very good and 5 is very bad.  A lot of thought is put into them, and they derive from team consensus (and hours of arguments).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that they are heavily skewed towards the better end of the spectrum.  Stocks which would score a 5 would be considered so bad we wouldn't bother watching them (and thus are not even in our watchlist).  Stocks which score a 4 are rare:  only a couple of stocks, one of which has had substantial volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Which statistical technique best deals with the skew in score distributions?&lt;/strong&gt;  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I compute factor premiums with OLS, I get a very low R-squared.&lt;/p&gt;&#xA;" OwnerUserId="27210" LastEditorUserId="27210" LastEditDate="2017-08-21T19:46:21.827" LastActivityDate="2017-08-21T19:46:21.827" Title="Factor models based on fundamental surveys: how to deal with the pointy end?" Tags="&lt;factor-models&gt;" AnswerCount="0" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35715" PostTypeId="1" AcceptedAnswerId="35721" CreationDate="2017-08-21T09:53:06.787" Score="3" ViewCount="159" Body="&lt;p&gt;I've recently started studying Cont &amp;amp; Tankov's &quot;financial modelling with jump processes&quot;. I'm curious as to why that this assumption of the cadlag property (also called  RCLL &quot;right continuous with left limits&quot;) for price paths is natural for the financial context? &lt;/p&gt;&#xA;" OwnerUserId="28544" LastEditorUserId="16148" LastEditDate="2017-08-21T14:56:18.380" LastActivityDate="2017-08-21T16:31:47.883" Title="Cadlag Property of Jump Proccesses" Tags="&lt;stochastic-processes&gt;&lt;finance-mathematics&gt;&lt;jump-diffusion&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35717" PostTypeId="1" CreationDate="2017-08-21T13:21:29.547" Score="0" ViewCount="140" Body="&lt;p&gt;I understand LIBOR rates quoted on a daily basis upto 12 M tenors. But how are rates beyond 12M tenor estimated. I got this question from an interviewer.&lt;/p&gt;&#xA;" OwnerUserId="27464" LastActivityDate="2017-08-21T16:29:58.033" Title="How are LIBOR rates beyond 12M arrived at?" Tags="&lt;interest-rates&gt;&lt;yield-curve&gt;&lt;libor&gt;&lt;interest&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2017-08-29T14:48:41.487" ContentLicense="CC BY-SA 3.0" />
  <row Id="35718" PostTypeId="2" ParentId="35697" CreationDate="2017-08-21T14:26:22.200" Score="3" Body="&lt;p&gt;Imagine we're in a classic, linear asset pricing framework. As @fnic explains, information can arrive either about future cash flows &lt;em&gt;or&lt;/em&gt; discount rates. Newspaper articles typically are written as if changes in prices reflect changes in future cash flows, but this need not be the case. The stock market may also go up because the price of risk has declined.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If stock prices change, you don't know whether:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Future cash flows changed&lt;/li&gt;&#xA;&lt;li&gt;Discount rates changed&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Markets can go up while future cash flows remain unchanged if discount rates go down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also be aware that people say all kinds of bizarre, internally inconsistent or nonsensical stuff on CNBC or in newspaper articles. &lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Classic SDF framework&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The current price of a security is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ V_t  = \sum_\omega P(\omega) M_{t+1}(\omega) X_{t+1}(\omega)$$&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Example:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;And let's say the probability measure $P$, stochastic discount factor $M_{t+1}$ and payoff $X_{t+1}$ are defined as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{array}{cccc} \text{State}  &amp;amp; \text{Probability: }P &amp;amp; \text{SDF: }M_{t+1} &amp;amp; \text{Payoff: }X_{t+1}&amp;amp; \\ \omega_1 &amp;amp; \frac{1}{4} &amp;amp; \frac{1}{1.1} &amp;amp; 110 \\ \omega_2 &amp;amp; \frac{1}{4} &amp;amp; \frac{1}{1.1} &amp;amp; 100 \\ \omega_3 &amp;amp; \frac{1}{4} &amp;amp; 1&amp;amp; 110 \\ \omega_4 &amp;amp; \frac{1}{4} &amp;amp; 1&amp;amp; 100\end{array}$$&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If all the states are possible, the current price of the payoff is $V_t \approx 100.23$.&lt;/li&gt;&#xA;&lt;li&gt;If only the states $\{w_3, w_4 \}$ with the high SDF value are possible, the price would be 105.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$$ \operatorname{E}[ M_{t+1} X_{t+1} \mid \omega \in \{\omega_3, \omega_4\}] = .5 \cdot 1 \cdot 110 + .5 \cdot 1 \cdot 100 = 105$$&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If only the states $\{w_1, w_3 \}$ with the high cashflow are possible, the price would be 105.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;$$ \operatorname{E}[ M_{t+1} X_{t+1} \mid \omega \in \{\omega_1, \omega_3\}] = .5 \cdot \frac{1}{1.1} \cdot 110 + .5 \cdot 1 \cdot 110 = 105$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus if we observe that price increases from 100.23 to 105, it could be due to either information about cashflows $X_{t+1}$ or the stochastic discount factor $M_{t+1}$.&lt;/p&gt;&#xA;" OwnerUserId="20582" LastActivityDate="2017-08-21T14:26:22.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35720" PostTypeId="1" AcceptedAnswerId="35726" CreationDate="2017-08-21T15:00:12.100" Score="3" ViewCount="2358" Body="&lt;p&gt;The most common formula for the ex-ante tracking error is $\sqrt{w^{T}Cw}$, where $w$ is a vector of excess weights relative to the benchmark and $C$ a forecast of covariance matrix. The sums of both $w_p$ (the vector of portfolio weights) and $w_b$ (the vector of benchmark weights) are set to 1 and they share as many rows as $C$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the litterature, the size of $C$ seems limited to that of the benchmark.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the implications, in terms of bias of the ex-ante tracking error, for an active investor that buys stocks outside her benchmark? And what are the possible solutions to limit this?&lt;/p&gt;&#xA;" OwnerUserId="5005" LastActivityDate="2018-06-02T12:55:34.770" Title="Ex-Ante Tracking Error : active strategies and the size of the covariance matrix" Tags="&lt;performance&gt;&lt;tracking-error&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35721" PostTypeId="2" ParentId="35715" CreationDate="2017-08-21T16:18:26.543" Score="6" Body="&lt;p&gt;Intuitively, cadlag expresses the fact that we know a jump has occurred after the fact, but we never have advance knowledge that the jump is about to occur (i.e no knowledge of the starting point for the jump or that a jump is &quot;under way&quot;). Each jump is a surprise, after which we believe there will be no jumps at least for a little while.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hear it in the trading room all the time: &quot;WTF! I looked away from the screen for a few secs and the price just jumped up[down]!&quot;. That is exactly what discrete time monitoring of a c.t. cadlag process is like. Even if you &quot;look very frequently&quot; somehow you never really &quot;see&quot; the jump, only the after jump situation.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-08-21T16:31:47.883" LastActivityDate="2017-08-21T16:31:47.883" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35722" PostTypeId="2" ParentId="35717" CreationDate="2017-08-21T16:29:58.033" Score="1" Body="&lt;p&gt;If you want to estimate interbank lending rates beyond 12 months, the best you can do is look at where bonds issued by banks are trading.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes there is loose talk (even by interviewers) that may confuse this with long term swap rates, which are contracts to exchange a fixed rate for 3 or 6 month libor.  However this has nothing to do with bank lending beyond 12 months.    &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-08-21T16:29:58.033" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35723" PostTypeId="2" ParentId="35697" CreationDate="2017-08-21T18:10:44.657" Score="1" Body="&lt;p&gt;In my view, this comment from the newspaper is related to expectations . &#xA;If we consider the risk neutral measures as the financial market expectations we can understand the rally in the financial market (there is an expectation of a better conditions in the near future). This could be different from the historical measure (such as data showing a consumer pull back spending).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I thought risk neutral measures only apply for pricing financial derivatives products...I really doubt that we can extend that concept to the stock market. Can anyone clarify this please?&lt;/p&gt;&#xA;" OwnerUserId="17024" LastActivityDate="2017-08-21T18:10:44.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35725" PostTypeId="2" ParentId="32542" CreationDate="2017-08-21T19:19:18.573" Score="1" Body="&lt;p&gt;For any given process for the short rate $\{r_t,, t &amp;gt;0\}$, the price at time $t$ of a zero-coupon bond with maturity $T$, where $t\le T$, is given by&#xA;\begin{align*}&#xA;P(t, T) = E\left(e^{-\int_t^T r_s ds}\,\big|\, \mathcal{F}_t\right).&#xA;\end{align*}&#xA;Since, for $t\le T$,&#xA;\begin{align*}&#xA;\frac{P(t, T)}{e^{\int_0^tr_s ds}} = E\left(e^{-\int_0^T r_s ds}\,\big|\, \mathcal{F}_t\right)&#xA;\end{align*}&#xA;is a martingale under the risk-neutral measure, we can assume that the dynamics for $r_t$ is already defined in the risk-neutral measure. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the forward rate $f(t, T)$, we note that $r_t = f(t, t)$ and &#xA;\begin{align*}&#xA;P(t, T) = e^{-\int_t^T f(t, u)du}. \tag{1}&#xA;\end{align*}&#xA;We assume that $f(t, T)$ follows, under the risk-neutral measure, the HJM model, that is,&#xA;\begin{align*}&#xA;df(t, T) = \alpha(t, T) dt + \sigma(t, T) dW_t,&#xA;\end{align*}&#xA;where $\{W_t, \, t \ge 0\}$ is a standard Brownian motion. From $(1)$, &#xA;\begin{align*}&#xA;d\ln P(t, T) &amp;amp;= f(t, t) dt -\int_t^T df(t, u) du\\&#xA;&amp;amp;=r_t dt - \left(\int_t^T \alpha(t, u) du\right)dt - \left(\int_t^T \sigma(t, u) du\right)dW_t.&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;\frac{dP(t, T)}{P(t, T)} &amp;amp;= \frac{1}{P(t, T)}d\left(e^{\ln P(t, T)} \right)\\&#xA;&amp;amp;=\frac{1}{P(t, T)}\left(e^{\ln P(t, T)} d\ln P(t, T) + \frac{1}{2}e^{\ln P(t, T)} d\langle \ln P, \ln P\rangle_t\right)\\&#xA;&amp;amp;=\left(r_t - \int_t^T \alpha(t, u) du +\frac{1}{2}\left(\int_t^T \sigma(t, u) du\right)^2 \right)dt - \left(\int_t^T \sigma(t, u) du\right)dW_t.&#xA;\end{align*}&#xA;Note that, under the risk-neutral measure, the drift term of $dP(t, T)$ is $r_t$.  That is,&#xA;\begin{align*}&#xA;\int_t^T \alpha(t, u) du = \frac{1}{2}\left(\int_t^T \sigma(t, u) du\right)^2.&#xA;\end{align*}&#xA;Consequently,&#xA;\begin{align*}&#xA;\alpha(t, T) = \sigma(t, T)\int_t^T \sigma(t, u) du.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2017-08-21T19:19:18.573" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35726" PostTypeId="2" ParentId="35720" CreationDate="2017-08-21T20:26:55.670" Score="2" Body="&lt;p&gt;There's nothing in the math that says a portfolio can only put non-zero weights on securities where the benchmark puts positive weights. So I'm not sure I understand your problem?&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Quick math review&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Let $R$ be a $k \times 1$ random vector denoting next period returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\mathbf{w}_b$ and $\mathbf{w}_b$ be $k \times 1$ vectors denoting weights of the portfolio.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The return of the portfolio and the benchmark are given by given by:&#xA;$$ r_p = R \cdot \mathbf{w}_p \quad \quad  r_b = R \cdot \mathbf{w}_b$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If one defines tracking error as the standard deviation of the difference:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;\sqrt{ \operatorname{Var}\left( r_p - r_b \right) } &amp;amp;= \sqrt{ \operatorname{Var}\left( \left(\mathbf{w}_p - \mathbf{w}_b \right) \cdot R \right) } \\&#xA;&amp;amp;= \sqrt{ \left(\mathbf{w}_p - \mathbf{w}_b \right)' \operatorname{Var}(R) \left(\mathbf{w}_p - \mathbf{w}_b \right) }&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Example:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Let's say $k=2$ and I have two stocks, Apple and Google.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R = \begin{bmatrix} R_{AAPL} \\ R_{GOOG} \end{bmatrix} $$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say my portfolio is 100% Apple and my benchmark is Google. Hence:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbf{w}_p = \begin{bmatrix} 1 \\ 0 \end{bmatrix} \quad \mathbf{w}_b = \begin{bmatrix} 0 \\ 1 \end{bmatrix} \quad \mathbf{w}_p - \mathbf{w}_b = \begin{bmatrix} 1 \\ -1 \end{bmatrix}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And hence tracking error is given by:&#xA;$$ \sqrt{ \operatorname{Var}(R_{AAPL}) - 2 \operatorname{Cov}( R_{AAPL}, R_{GOOG}) + \operatorname{Var}(R_{GOOG})}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How good my estimate of the tracking error is will depend on how good is my estimate of the variance of Apple and Google and how good is my estimate of the covariance between them.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;What can go wrong?&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;A broad category of problems comes from using an estimate $\Sigma$ instead of the true covariance matrix $\operatorname{Var}(R)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another perhaps more subtle source of problems come from generating weights $\mathbf{w}_p$ directly or indirectly based upon estimate $\Sigma$. If you choose weights to minimize tracking error based upon sample covariance matrix $\Sigma$, you're almost certainly going to get a downward biased estimate of your true tracking error. Sample covariance matrix $\Sigma$ may have eigenvalues near zero while the true covariance matrix doesn't (indeed if time number of time periods $T$ used to estimate covariance is less than the number of securities $N$, this mechanically must be true). &lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-08-21T21:19:59.350" LastActivityDate="2017-08-21T21:19:59.350" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35727" PostTypeId="2" ParentId="35707" CreationDate="2017-08-21T23:45:38.463" Score="4" Body="&lt;p&gt;You should go back to the derivation of the Black-Scholes equation (see &lt;a href=&quot;https://quant.stackexchange.com/questions/35642/rigorous-derivation-of-d-pi-for-stock-with-continuous-dividend/35661#35661&quot; title=&quot;Answer&quot;&gt;this answer&lt;/a&gt; for example). The main point is that you can cancel the risk of the derivative over an infinitesimal time period $dt$ by holding a certain amount $\Delta$ of the asset. When applying this hedging strategy, in this continuous limit, the variance of your PnL is zero. So regardless of the actual path followed by the underlying, the cost of the replication strategy is always the same. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now this assumes that the rates are deterministic and moreover volatility is known and constant so the volatility we input to price is always going to be the realised volatility on any path. If the volatility is unknown, you PnL will be: &#xA;$$&#xA;  d\Pi_t - r_t\Pi_t = \frac{1}{2}S^2\partial^2_SP \left( \sigma_R^2 - \sigma_M^2\right) dt&#xA;$$&#xA;the difference between realised variance $\sigma_R^2dt$ and pricing model variance $\sigma_M^2 dt$, weighted by the portfolio's Gamma. &lt;/p&gt;&#xA;" OwnerUserId="6901" LastEditorUserId="6901" LastEditDate="2017-08-21T23:58:39.953" LastActivityDate="2017-08-21T23:58:39.953" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="35728" PostTypeId="1" CreationDate="2017-08-22T03:51:20.183" Score="0" ViewCount="493" Body="&lt;p&gt;A security is currently trading at 100, and with 99% probability it will be at 110 tomorrow, and with 1% probability at 90. What is the value of an ATM call option today expiring tomorrow? Assume nil interest rates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you sell the option at $C$ and immediately hedge with $n$ shares of the underlying, you'll be left with $C - 100n$. Tomorrow your portfolio will be worth $C - 100n + 110n = C + 10n$ with 99% chance and $C - 100n + 90n = C-10n$ with 1% chance. In order for you to not lose or make money on selling the option, in the first case your portfolio must be worth 10, and in the second case 0. In other words, $C$ and $n$ are uniquely determined by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{cases}&#xA;C + 10n = 10 \\&#xA;C - 10n = 0.&#xA;\end{cases}&#xA;Solving yields $C = 5$ and $n = 1/2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, one sees that there is a 99% chance the option has value 10 dollars tomorrow and a 1% chance it has no value, yielding $C = (10)(.99) = 9.90.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which is the correct valuation? Is the stock mispriced if we know there is a 99% chance of an upward movement?&lt;/p&gt;&#xA;" OwnerUserId="29289" LastActivityDate="2017-08-22T09:56:26.503" Title="Basic binomial option pricing example" Tags="&lt;option-pricing&gt;&lt;binomial-tree&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35729" PostTypeId="2" ParentId="35728" CreationDate="2017-08-22T06:36:01.787" Score="1" Body="&lt;p&gt;The correct valuation is C=5, assuming the stock is trading at 100.  Any other option price allows an immediate arbitrage opportunity between the option and the stock.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whether the stock should be trading at 100 is a separate question.  It depends on the risk tolerance of investors, and the correlation of this stock with other investments, for example.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastEditorUserId="18388" LastEditDate="2017-08-22T09:04:09.783" LastActivityDate="2017-08-22T09:04:09.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35730" PostTypeId="1" AcceptedAnswerId="35754" CreationDate="2017-08-22T09:31:52.617" Score="1" ViewCount="102" Body="&lt;p&gt;&lt;strong&gt;I'm trying to calculate 5-day realized volatility (as proxy for integrated volatility) using 5-min frequency data.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm working from the paper&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.jstor.org/stable/3598946&quot; rel=&quot;nofollow noreferrer&quot;&gt;CORRECTING THE ERRORS: VOLATILITY FORECAST EVALUATION USING HIGH-FREQUENCY DATA AND REALIZED VOLATILITIES&lt;br&gt;&#xA;by Andersen et al (2005)&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm able to use&#xA;$$&#xA;RV_t(h) \equiv \sum_{i=1}^{1/h} r^{(h)2}_{t-1+ih}&#xA;$$&#xA;with $t = 1$ day and $h=81$ for 81 5-min samples per day&lt;br&gt;&#xA;to get the daily realized variance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the paper, p.282, footnote 4&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;For notational simplicity, we focus our discussion on one-period return and volatility measures, but the general results and associated measurement error adjustment extend in a straightforward manner to the multiperiod case&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I would be very grateful if someone could point out that straightforward extension to me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;&lt;br&gt;&#xA;I'm going with the simple approach of adding the variances for 5 days, i.e. $h=81 * 5$&lt;br&gt;&#xA;Annualized volatility calculated from this is in the same range as the Yang-Zang &amp;amp; Parkinsons estimators&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any input would still be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="25882" LastEditorUserId="25882" LastEditDate="2017-08-23T09:59:45.780" LastActivityDate="2017-08-23T15:39:46.483" Title="How to extend Realized Volatilty to multiple periods" Tags="&lt;volatility&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35731" PostTypeId="2" ParentId="35728" CreationDate="2017-08-22T09:56:26.503" Score="0" Body="&lt;p&gt;Your example is a bit odd;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;tomorrow, you expect a stock to be worth either $110$, with $99\%$ probability, or $90$ with $1\%$ probability. So your expectation of the value tomorrow is $0.99\cdot110 + 0.01\cdot 90 = 109.8$ - this means that the &lt;em&gt;intrinsic&lt;/em&gt; value of your option is $\max(0, 109.8-100) = 9.8$. If the option is worth less than this, then there is an arbitrage, as it has negative time value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value of the option is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{eqnarray}&#xA;\mathrm{Call} &amp;amp;=&amp;amp; \int_0^\infty \phi(S_T) \cdot \max(S_t-K,0)\ \mathrm{d}S_T\\&#xA;&amp;amp;=&amp;amp;\phi(110) \cdot (110-100)^+ + \phi(90)\cdot(90-100)^+ \\&#xA;&amp;amp;=&amp;amp; \phi(110) \cdot 10 = 99\% \cdot 10\\&#xA;&amp;amp;=&amp;amp; 9.9&#xA;\end{eqnarray}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is an odd / contrived example though, since the spot price is so far from the forward, and we have said there are no dividends and interest rates are zero. So you're only going to be able to explain this with some fairly contrived scenarios (i.e. maybe the company is selling loads of stock to raise money and driving the price down, such that it's not at an equillibrium value, and the market knows this will stop tomorrow? Who knows.)&lt;/p&gt;&#xA;" OwnerUserId="19663" LastActivityDate="2017-08-22T09:56:26.503" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35732" PostTypeId="2" ParentId="21051" CreationDate="2017-08-22T09:58:23.773" Score="0" Body="&lt;p&gt;It is apparently true that one of the majors ways of clearing the presence of serial correlation  in the residuals is to either increase the lag lengths or to run a difference model as well as running a regression model, through the origin (ignoring the intercept terms) or better still run an auto-regressive distributed lag model, but what most scintillating  researchers in economics and other related disciplines fail to understand is that we have different types of econometric techniques and each of them has its own underlying assumptions.&#xA;Succinctly speaking, the condition of no residual serial correlation or no autocorrelation is often one of the underlying assumptions of the method of ORDINARY LEAST SQUARE(OLS) which is an econometric technique for modelling mainly LINEAR MODELS not for Nonlinear regressions.&#xA;     Therefore, discerning from the above, GARCH and other forms of ARCH family models have their own underlying assumptions.In fact, if you are trying to estimate any of the above models and you find absence of heteroscedasticity for instance in your model, you should just start crying immediately because your model is not likely to have ARCH EFFECT and GARCH model wouldn't run in the absence of that because the residuals of the model wil not be conditionally heteroscedastic. In the absence of all these you should just cry and go and change to any other modelling technique but not within the ARCH models.&#xA;So I think that since no autocorrelation is only one of the asumptions of OLS, we should not have to worry much about it whenever we are estimating Nonlinear regression models(CHINONSO'S ARGUMENT 2017)&lt;/p&gt;&#xA;" OwnerUserId="29292" LastActivityDate="2017-08-22T09:58:23.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35733" PostTypeId="2" ParentId="35707" CreationDate="2017-08-22T10:07:36.580" Score="2" Body="&lt;p&gt;Based on the inputs from other users, this is another non-rigorous proof of &lt;strong&gt;&lt;em&gt;why the cost of delta-hedging is equal to the option price.&lt;/em&gt;&lt;/strong&gt; This approach might be useful for students who use John Hull for reference and may not be familiar with self-financing strategy. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Context:&lt;/strong&gt; E.g. 19.2 in Options, Futures and Other Derivatives by Hull.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We sold a plain European option and we want to hedge our position by replicating the option payoff. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \text{Assume that at} \quad t = 0, \quad C_0, \, \Delta_0, \,  \text{are the price &amp;amp; the delta of the option and }  S_0 \text{to be the price of the stock}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know invest a portfolio worth $ C_0 $that consists of $$ (\Delta_0 * S_0) \quad\text{stocks} + \quad (C_0 - \Delta_0 * S_0) \quad \text{money} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, &#xA;$$ \text{At} \quad t = 1, \quad C_1, \, \Delta_1, \,  \text{are the price &amp;amp; the delta of the option and }  S_1 \text{to be the price of the stock}$$&#xA;So, we borrow $$B_1 = (\Delta_1*S_1 - \Delta_0*S_1) \text{worth of money from the money market}\\$$&#xA;After which our portfolio positions are&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$  (\Delta_1 * S_1) \quad\text{stocks} + \quad (C_0 - \Delta_0 * S_0 -(\Delta_1*S_1 - \Delta_0*S_1)) \quad \text{money} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, &#xA;$$ \text{At} \quad t = 2, \quad C_2, \, \Delta_2, \,  \text{are the price &amp;amp; the delta of the option and }  S_2 \text{to be the price of the stock}$$&#xA;So, we borrow $$B_2 = (\Delta_2*S_2 - \Delta_1*S_2) \text{worth of money from the money market}$$&#xA;After which our portfolio positions are&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$  (\Delta_2 * S_2) \quad\text{stocks} + \quad (C_0 - \Delta_0 * S_0 -(\Delta_1*S_1 - \Delta_0*S_1)-(\Delta_2*S_2 - \Delta_1*S_2) ) \quad \text{money} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume that by end of $ t= 2 $, the option reaches its maturity and payoff to us, i.e.  the seller of the option is $ \Delta_2*S_2 - C_2$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;In Hull book, this money market concept is not explained clearly. &lt;strong&gt;&lt;em&gt;The statement that Hull makes is that the cost of setting up the initial portfolio + borrowing + final payoff is equal to the option price: in other words,&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ (\Delta_0 * S_0) \quad (\text{initial cost of the stock}) + \\ (\Delta_1*S_1 - \Delta_0*S_1) + (\Delta_2*S_2 - \Delta_1*S_2) \quad (borrorwings) + \\ (\Delta_2*S_2 - C_2) \quad (final payoff) \\ \text{is equal to } \\ C_0 \text{ -the initial price of the option} $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solving the above equation of Hull, we get, &#xA;$$ \Delta_0*(S_0-S_1) + \Delta_1*(S_1-S_2) = C_0 - C_2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the definition of $\Delta$, this should always hold true for small time intervals. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence, Hull's statement that &lt;em&gt;cost of setting up delta-hedged portfolio is equal to the price of the option&lt;/em&gt; holds true&lt;/p&gt;&#xA;" OwnerUserId="27273" LastActivityDate="2017-08-22T10:07:36.580" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35735" PostTypeId="2" ParentId="35621" CreationDate="2017-08-22T11:51:46.687" Score="1" Body="&lt;p&gt;I would say that - from personal experience, when analyzing the stability of the estimates and their oscillatory behavior - the two most robust techniques are the generalized Hurst exponent, and the Wavelet Spectral Density. However, to my best knowledge there is no research that compares the various methodologies - but a few months ago I found a paper about Hurst exponent and multifractality, it might be an interesting read for you: &lt;a href=&quot;https://arxiv.org/pdf/0711.2892.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Algorithm to estimate the Hurst exponent&#xA;of high-dimensional fractals&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="29143" LastActivityDate="2017-08-22T11:51:46.687" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35737" PostTypeId="1" AcceptedAnswerId="35744" CreationDate="2017-08-22T16:52:41.863" Score="1" ViewCount="235" Body="&lt;p&gt;Do price approximations lead to arbitrage opportunities against a price computed using the exact formula?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, dirty bond price uses a linear approximation to compute the accrual interest:&#xA;$$P_{d}=P_{c}+\alpha t$$&#xA;Whereas the exact formula gives a slightly higher value for $0&amp;lt;t&amp;lt;1$ (with time unit the time between payments), for both continuous or discrete compounding (assuming par):&#xA;$$P(t)=ce^{i(t-1)}+e^{i(t-1)}P(0)$$&#xA;$$P(t)=\frac{c}{(1+i)^{t-1}}+\frac{P(0)}{(1+i)^{t-1}}$$&#xA;Giving the high nominal of some bonds, does the difference is ever high enough to produce arbitrage opportunities?&lt;/p&gt;&#xA;" OwnerUserId="25455" LastActivityDate="2017-09-07T08:40:58.967" Title="Do price approximations lead to arbitrage opportunities?" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;arbitrage&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35738" PostTypeId="1" AcceptedAnswerId="35743" CreationDate="2017-08-22T17:55:55.893" Score="0" ViewCount="2355" Body="&lt;p&gt;How do I calculate the three factors? The first &quot;market&quot; factor seems straightforward. However the SmB and the HmL factors seem to require accounting data. Also, how does one calculate the momentum factor? Can you write down explicit formulas with clearly defined notation, or provide a reference that describes the canonical calculations?&lt;/p&gt;&#xA;" OwnerUserId="1870" LastEditorUserId="1870" LastEditDate="2017-08-22T18:31:09.287" LastActivityDate="2017-08-23T04:43:16.763" Title="How to calculate Fama-French factors?" Tags="&lt;equities&gt;&lt;factor-models&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35740" PostTypeId="1" CreationDate="2017-08-22T18:55:30.670" Score="2" ViewCount="538" Body="&lt;p&gt;I'm working on a project where I need to estimate the parameters of the CIR model. In the particular case, the CIR model is used to model cumulated capital calls for a private equity fund. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The data is quarterly, and runs for only 40 quarters or so, meaning that n is quite small. In this case, the CLS method should be the better choice for estimating the parameters.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The CLS estimators below are mathematically derived in the paper &quot;Estimation in the Cox-Ingersoll-Ross model&quot; by Overbeck and Ryden.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I am not confident on how to actually compute the specific estimates using these estimators and my data. Would you be so kind to help me in the right direction on this ? How would you go about this in R for example?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Best regards&#xA;Kristian&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/lehhu.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/lehhu.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="29297" LastActivityDate="2017-08-22T18:55:30.670" Title="Estimating parameters of the Cox-Ingersoll-Ross model using CLS in R" Tags="&lt;programming&gt;&lt;estimation&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35743" PostTypeId="2" ParentId="35738" CreationDate="2017-08-22T21:35:25.937" Score="4" Body="&lt;p&gt;I don't have time to give you a complete, precise answer, but this may help you get going. I'm pulling stuff from various notes I have in places. It's a bit trickier than someone naively might think.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Ken French's description of their methodology:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/Data_Library/f-f_factors.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;details&lt;/a&gt; section of various points in their data library has a bunch of material.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may also look for papers where Fama and French discuss their three or five factor model. For the three factor model, you might look at &quot;Common Risk Factors in the Returns on Stocks and Bonds,&quot; 1993, &lt;em&gt;Journal of Financial Economic.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Some Compustat calculations to get you going:&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The SQL code I have to calculate book equity from the Compustat annual file is: &lt;code&gt;seq - COALESCE(pstk, 0) + COALESCE(txditc, 0) as be&lt;/code&gt;. (Be aware that the last part, adding back deferred taxes &lt;code&gt;txditc&lt;/code&gt; has a substantial effect.)&lt;/li&gt;&#xA;&lt;li&gt;The SQL code I used to calculate operating profitability is &lt;code&gt;(revt - cogs - COALESCE(tie,0) - COALESCE(xsga,0)) as op_numerator&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Market equity I calculate as &lt;code&gt;csho * prcc_f as me&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;The book to market ratio would then be &lt;code&gt;CASE WHEN (me is NULL) OR (me = 0) THEN NULL ELSE be /me END as beme&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Find some Compustat manual to find what those variables are.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;CRSP calculations and getting the universe right...&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Limit the universe to &lt;a href=&quot;http://www.crsp.com/products/documentation/data-definitions-1&quot; rel=&quot;nofollow noreferrer&quot;&gt;CRSP sharecd&lt;/a&gt; 10 and 11.&lt;/li&gt;&#xA;&lt;li&gt;For breakpoint calculations, limit it to the New York Stock Exchange.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/Data_Library/f-f_factors.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;Rm-Rf includes all NYSE, AMEX, and NASDAQ firms. SMB and HML for July of year t to June of t+1 include all NYSE, AMEX, and NASDAQ stocks for which we have market equity data for December of t-1 and June of t, and (positive) book equity data for t-1.&quot;&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Form portfolios in June based upon accounting data for the prior fiscal year. Thus the accounting data is at least six months old and possibly a year old.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I recall there may be some small, additional checks for good price data.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h3&gt;Sanity checks:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;You can see if you're computing market equity, book equity, etc... and oper ating in the same universe of securities by checking whether you can match the percentile breakpoints they compute:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-08-22T23:22:39.017" LastActivityDate="2017-08-22T23:22:39.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35744" PostTypeId="2" ParentId="35737" CreationDate="2017-08-22T22:09:46.403" Score="8" Body="&lt;p&gt;No. The dirty price is the market's estimate of fair value for the bond. The clean price is just a quoting convention (so that the price doesn't jump when you pass over a coupon date). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The market doesn't try to estimate the clean price and then get the all-in (dirty) price wrong. The market estimates the all-in price, and then applies the accrued interest adjustment when it comes to submitting a quote. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The adjustment is just a convention that everyone agrees on to make the price series nicer. Since the adjustment has no economic impact whatsoever, it doesn't matter what adjustment is used, and you might as well use the simpler, linear adjustment for days accrued, rather than a more complex adjustment that takes compounding into account. &lt;/p&gt;&#xA;" OwnerUserId="924" LastEditorUserId="924" LastEditDate="2017-09-07T08:40:58.967" LastActivityDate="2017-09-07T08:40:58.967" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35745" PostTypeId="2" ParentId="35678" CreationDate="2017-08-23T00:11:13.397" Score="1" Body="&lt;p&gt;Yes, the existence of non-zero market price of risk implies the existence of strategies with a positive expected return. The expected return is the compensation demanded for bearing market risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The demand for positive expected return strategies doesn't decrease the market price of risk to zero (equivalently, it doesn't decrease the expected return of risky strategies to zero). Why would it? Why would you buy stocks if the expected return was the same as holding cash?&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2017-08-23T00:11:13.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35746" PostTypeId="1" AcceptedAnswerId="35750" CreationDate="2017-08-23T00:57:40.383" Score="-6" ViewCount="107" Body="&lt;p&gt;I want to extract data from the wall street. I am a programmer in Django/Python, and I need the best source for price date, fundamental data. I wanted to extract it directly from google finance, but it seems that google finance with shut down in october. There was a plugin with google finance, but because of that reason, I don't want to use it.&lt;/p&gt;&#xA;" OwnerUserId="29304" LastEditorUserId="29304" LastEditDate="2017-08-23T01:08:43.767" LastActivityDate="2017-08-23T04:15:13.177" Title="Extract data from Wall Street - Programming" Tags="&lt;market-data&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2017-08-23T05:37:27.733" ContentLicense="CC BY-SA 3.0" />
  <row Id="35747" PostTypeId="2" ParentId="35678" CreationDate="2017-08-23T01:34:33.147" Score="0" Body="&lt;p&gt;It depends what kind of people inhabit your world (or your model).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If people are risk neutral, then indeed they will look only at expected return. They will rush into stocks and raise their price until the return is equal to the risk free rate. The risk premium on stocks will drop to zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But there is a lot of evidence that this is not how real human beings behave. They really are risk averse and they will not all decide to buy stocks. Historically the risk premium on stocks does not seem to be dropping to zero but remains positive. And in my experience those who are initially enthusiastic about being in stocks moderate their opinion considerably when the first recession hits and they personally experience just how unpleasant it is to lose money. (In fact some give up on stocks altogether).&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-08-23T01:34:33.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35748" PostTypeId="2" ParentId="30812" CreationDate="2017-08-23T02:34:27.197" Score="0" Body="&lt;p&gt;They are a provider for Yahoo Finance of &quot;historical chart data and daily updates&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They are mentioned in the &quot;Exchanges and data providers on Yahoo Finance&quot; &lt;a href=&quot;https://help.yahoo.com/kb/SLN2310.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;page&lt;/a&gt; under the &quot;Data delays and providers&quot; section.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;Fundamental company data provided by Capital IQ. Historical chart data and daily updates provided by Commodity Systems, Inc. (CSI):&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="7089" LastActivityDate="2017-08-23T02:34:27.197" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35749" PostTypeId="2" ParentId="35672" CreationDate="2017-08-23T02:50:09.590" Score="2" Body="&lt;p&gt;Recently, some guys have found the volatility is rough path, with $H\approx0.1$. Please see the important paper &lt;a href=&quot;https://arxiv.org/abs/1410.3394&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;Volatility is rough&quot;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26890" LastEditorUserId="16148" LastEditDate="2017-08-24T06:10:56.190" LastActivityDate="2017-08-24T06:10:56.190" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35750" PostTypeId="2" ParentId="35746" CreationDate="2017-08-23T04:15:13.177" Score="3" Body="&lt;p&gt;I have to say that I don't like the way you have phrased your question - it denotes a lack of any research effort. However, here at QFStackExchange there is this useful answer - &lt;a href=&quot;https://quant.stackexchange.com/questions/141/what-data-sources-are-available-online&quot;&gt;What data sources are available online?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="29143" LastActivityDate="2017-08-23T04:15:13.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35751" PostTypeId="2" ParentId="35738" CreationDate="2017-08-23T04:43:16.763" Score="1" Body="&lt;p&gt;Canonical references are&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Fama-French: &lt;a href=&quot;https://www.jstor.org/stable/2329112&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.jstor.org/stable/2329112&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Carhart: &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/j.1540-6261.1997.tb03808.x/full&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://onlinelibrary.wiley.com/doi/10.1111/j.1540-6261.1997.tb03808.x/full&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="6535" LastActivityDate="2017-08-23T04:43:16.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35752" PostTypeId="1" CreationDate="2017-08-23T13:37:26.000" Score="1" ViewCount="492" Body="&lt;p&gt;I am having trouble understanding the QE scheme of Andersen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://pdfs.semanticscholar.org/5730/bbf4f6437ab1775e222b5fef1ccdac1ddfc0.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Leif Andersen: Efficient Simulation of the Heston Stochastic Volatility Model, 2006&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible for the variance process to become zero? There is a switching rule. If $v=a(b+Z)^2$, then the probability is zero I think. (Only if b=Z since a&gt;0). But for the other process, I don't know what will happen.&lt;/p&gt;&#xA;" OwnerUserId="25170" LastEditorUserId="16148" LastEditDate="2017-08-23T14:48:30.793" LastActivityDate="2017-08-23T14:48:30.793" Title="Heston Model: Quadratic exponential scheme" Tags="&lt;heston&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35754" PostTypeId="2" ParentId="35730" CreationDate="2017-08-23T15:39:46.483" Score="1" Body="&lt;p&gt;I think your approach for adding the Realized Variances is correct. The focus on one period returns is simply because it eases notation. The only thing you would need to change is the units of time you are working with. This is $t=1$ (e.g. week) means five days and under that notation you would just need to change your $h$ to the new appropriate value $h/5$. This is equivalent to just adding the Realized Variances.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I believe the value of the time step $h$ for $5$ minutes is initially (considering 8 hours of trading) would be:&#xA;$$h=\frac{5}{8*60}\approx0.0104$$&#xA;So that as your cited paper says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;[...] $1/h$ is assumed to be an integer [...]&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For the $5$ days case:&#xA;$$h=\frac{1}{8*60}\approx0.0021$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Note that this extension to multiple periods does not take into account jumps that occur between closure and market opening (ignored by simple adding the daily $RV$'s) which have shown different behaviours compared to the jumps during trading hours. For a detail discussion on how to include close-open jumps see for example &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download;jsessionid=798EA29B6216024F5D25D8A46217CFB1?doi=10.1.1.628.4037&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Yang&amp;amp;Zhang&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="25455" LastActivityDate="2017-08-23T15:39:46.483" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35755" PostTypeId="1" CreationDate="2017-08-23T22:47:28.950" Score="6" ViewCount="803" Body="&lt;p&gt;This might seem like a dumb question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When using a volatility model, stochastic for example, we try to calibrate it so that it fits the implied volatility smile given by the market, but why is this volatility smile so important ? What can we do with our calibrated smile afterwards ? I read here and there that we can reprice exotic products afterwards or interpolate to get an implied volatility for a strike that is not listed on the market, but can you give more detail ? If possible using SABR or any other model as an example ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you&lt;/p&gt;&#xA;" OwnerUserId="29312" LastActivityDate="2018-07-17T06:59:23.297" Title="Why is the volatility smile so important" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;volatility-smile&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35756" PostTypeId="1" CreationDate="2017-08-23T23:58:30.157" Score="6" ViewCount="5934" Body="&lt;p&gt;Currently testing if monthly fund characteristics (size, capital flows, age, risk, persistence,...) explain funds abnormal returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My data is set as a panel with 1000 equity mutual funds over the period (2000-2017). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, I run the following regression &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alpha = intercept + B1(fund size) + B2(capital flows) + ... + u &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most past literature such as Chen et al. (2004) and Carhart (1997) use the Fama MacBeth procedure to test such relationship. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However since my dataset suffers from both time series and cross sectional correlation. I am better off (according to Petersen (2009)) by using a fixed effect regression and cluster residuals by fund and time to adjust standard errors. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, I run the regression using both models (fixed effect and Fama MacBeth procedure) and I get slightly different results. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was just wondering what would be better model to tackle such problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;References:&#xA;Chen, J., Hong, H., Huang, M. and Kubik, J.D., 2004. Does fund size erode mutual fund performance? The role of liquidity and organization. The American Economic Review, 94(5), pp.1276-1302.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Petersen, M.A., 2009. Estimating standard errors in finance panel data sets: Comparing approaches. The Review of Financial Studies, 22(1), pp.435-480.&lt;/p&gt;&#xA;" OwnerUserId="28909" LastActivityDate="2018-10-04T13:36:23.060" Title="Fama Mac-Beth (1973) vs Fixed effect" Tags="&lt;finance&gt;&lt;regression&gt;&lt;asset-pricing&gt;&lt;econometrics&gt;&lt;paneldata&gt;" AnswerCount="1" CommentCount="8" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="35757" PostTypeId="1" CreationDate="2017-08-24T08:06:00.007" Score="0" ViewCount="207" Body="&lt;p&gt;In John Hull's book &lt;code&gt;Options, Futures and Other Derivatives  9th&lt;/code&gt; &lt;code&gt;page 507&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We want to calculate the VaR of a &lt;code&gt;forward contract of a foreign currency&lt;/code&gt; and we should spread forward into two bonds. It's said that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;a forward contract to buy a foreign currency. Suppose the contract matures at time T. It can be regarded as the exchange of a foreign zero-coupon bond maturing at time T for a domestic zero-coupon bond maturing at time T.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know that the payment at $T$ is&#xA;$$Q_T - K$$&#xA;it's easy to understand regarding $K$ as a domestic zero-coupon bond maturing at time $T$ with principle $K.$ But how to regard $Q_T$ as the &lt;code&gt;foreign zero-coupon?&lt;/code&gt; &lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-10-27T15:40:10.593" Title="How to regard foreign currency forward as foreign and domestic bonds on VaR" Tags="&lt;fx&gt;&lt;var&gt;&lt;forward&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35758" PostTypeId="1" CreationDate="2017-08-24T08:06:16.843" Score="0" ViewCount="318" Body="&lt;p&gt;I'm trying to figure out a spreadsheet I have which simulates 50000 returns in excel using the following function: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;LOGNORM.INV(RAND(),0,0.35)-1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does adding a minus 1 to the end of this formula convert what is essentially a log normally distributed price to a normally distributed return?&lt;/p&gt;&#xA;" OwnerUserId="20592" LastEditorUserId="26595" LastEditDate="2017-08-24T08:44:11.877" LastActivityDate="2017-08-24T19:08:10.893" Title="Log normal price simulation" Tags="&lt;simulations&gt;&lt;distribution&gt;&lt;normal-distribution&gt;&lt;lognormal&gt;&lt;log-returns&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35759" PostTypeId="1" AcceptedAnswerId="35761" CreationDate="2017-08-24T09:05:15.767" Score="0" ViewCount="513" Body="&lt;p&gt;And if so, can they be used to estimate the future price of bonds?&lt;/p&gt;&#xA;" OwnerUserId="11655" LastActivityDate="2017-08-24T15:53:40.793" Title="Do stochastic interest rate models forecast future interest rate?" Tags="&lt;interest-rates&gt;&lt;stochastic-processes&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35760" PostTypeId="2" ParentId="35758" CreationDate="2017-08-24T09:33:15.927" Score="2" Body="&lt;p&gt;To my knowledge, adding a minus 1 does not transform a log normal variable into an normal distributed variable.&#xA;The only thing that I can think of which make sense is the log normal represents a price ratio $\frac{P_t}{P_0}$ (for instance if the price process is a geometric browninan motion). In this case adding -1 does transform price ratio into arithmetic return $R_t=\frac{P_t - P_0}{P_0} =\frac{P_t}{P_0}-1$. if you make the assumption that $P_0=1$, then indeed $R_t=P_t-1$. But in any case, the return does not follow normal law.&lt;/p&gt;&#xA;" OwnerUserId="17733" LastActivityDate="2017-08-24T09:33:15.927" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35761" PostTypeId="2" ParentId="35759" CreationDate="2017-08-24T09:35:01.760" Score="4" Body="&lt;p&gt;Yes, every stochastic interest rate model makes a forecast for the future interest rate. For example, the random walk model&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;dr_t = \sigma dW_t&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;predicts all future interest rates to be equal to the current rate. The Vasicek model,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;dr_t = a(\bar{r} - r_t)dt + \sigma dW_t&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;predicts that the future interest rate reverts to the long-term rate $\bar{r}$, i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;E(r_t) = \bar{r} + (r_0 - \bar{r})e^{-at}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More complex models might make forecasts for the entire maturity structure of interest rates, rather than just for the short rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Every interest rate forecast can be converted into a forecast for bond prices, since bond prices are (more or less) a function of interest rates. However, you should note that&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;You can't be sure that you have the right interest rate model.&lt;/li&gt;&#xA;&lt;li&gt;Even if you have an accurate model, most interest rate models are risk-neutral, i.e. they don't take the risk premium associated with duration into account. You can't expect them to give accurate forecasts of real-world interest rates.&lt;/li&gt;&#xA;&lt;li&gt;Stochastic models generally don't take external information into account (e.g. government monetary policy, risk sentiment, business cycle, bond market microstructure). They are potentially discarding valuable information.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For these reasons I would be &lt;em&gt;very&lt;/em&gt; careful when using a pure stochastic interest rate model to make forecasts for bond prices.&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2017-08-24T09:35:01.760" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35762" PostTypeId="1" AcceptedAnswerId="35777" CreationDate="2017-08-24T11:37:10.247" Score="2" ViewCount="2283" Body="&lt;p&gt;recently &lt;a href=&quot;https://esas-joint-committee.europa.eu/Publications/Technical%20Standards/JC%202017%2049%20(PRIIPs_flow_diagram_risk_reward).pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;new document&lt;/a&gt; has been provided by EU supervisors regarding the new PRIIPs KID methodology. &lt;em&gt;(PRIIPs KID is 3page document about the fund/product that is being sold to clients. It has to inform about scenarios and risk of the investment)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This new document include examples of calculation and my question is regarding the stress performance scenario for category 2 PRIIPs, which is on page 23 and 24. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I tried to reconstruct this example and was successful with all other scenarios except the stressed. That means that I should have same dataset as they have. However my results for stressed scenario are slightly shifted. Moreover the stressed volatilities (red bold on page 24) are different for 3 and 5 holding period, which does not correspond to the methodology on page 23. The formula for stressed volatility is based on historical data only and should NOT depend on the holding period, aside from 1 year period which is special. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So my question is: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Why are the stressed volatilities for 3 and 5 holding period different? &lt;/li&gt;&#xA;&lt;li&gt;Is anyone able to reconstruct their numbers precisely? &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If code or excel is needed I can share, however I do not know how to share datasets here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Requested info about the dataset.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Source: Bloomberg&lt;/li&gt;&#xA;&lt;li&gt;Start date: 01.05.2012&lt;/li&gt;&#xA;&lt;li&gt;End date: 28.04.2017&lt;/li&gt;&#xA;&lt;li&gt;Remove two NAs&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;After there should be 1280 observed &lt;em&gt;returns&lt;/em&gt; (1281 &lt;em&gt;prices&lt;/em&gt;). For favourable, unfavourable and neutral scenario I get 1e-10 (rounding) error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt; 3Y and 5Y stress volatilities should be equall, as I found out in slide 26 of &lt;a href=&quot;https://www.dropbox.com/s/egfx0ktolojfsek/3.PRIIPs%20Workshop%20-%20Risk%20Reward%20Methodology.pdf?dl=0&quot; rel=&quot;nofollow noreferrer&quot;&gt;presentation&lt;/a&gt; from the latest ESA's workshop 27.11.2017 in frankfurt. Which means full dataset should be used for rolling volatilities.&lt;/p&gt;&#xA;" OwnerUserId="29232" LastEditorUserId="29232" LastEditDate="2017-12-04T08:38:24.020" LastActivityDate="2017-12-04T08:38:24.020" Title="PRIIPs category 2 stress scenario methodology" Tags="&lt;volatility&gt;&lt;regulatory-formula&gt;&lt;priips&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35763" PostTypeId="1" CreationDate="2017-08-24T13:46:05.107" Score="2" ViewCount="71" Body="&lt;p&gt;Here is the proof that the limit of GARCH(1,1)&#xA;$$\sigma_n^2 = \gamma V_L + \alpha u_{n-1}^2 + \beta\sigma_{n-1}^2$$&#xA;is equivalent to stochastic process of variance&#xA;$$d V = \alpha(V_L - V) dt + \xi VdW.$$&#xA;We have already assumed return $u_{n-1}$ is $(0,\sigma_{n-1}^2)$-normal, then $u^2_{n-1}$ can't be normal. But author said that&#xA;$$u^2_{n-1} = \sigma_{n-1}^2 + \sqrt{2}\sigma_{n-1}^2\varepsilon$$&#xA;where $\varepsilon$ is a random sample from a standard normal?&lt;a href=&quot;https://i.stack.imgur.com/FhM46.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/FhM46.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-08-24T13:46:05.107" Title="Deduce GARCH(1,1) to the stochastic variance model" Tags="&lt;garch&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35765" PostTypeId="2" ParentId="35759" CreationDate="2017-08-24T14:51:54.600" Score="2" Body="&lt;p&gt;Yes, they do forecast the interest rate. But that is not really what they are used for. They are used to forecast the variability of interest rates (i.e. various outcomes for interest rates that we could have) and therefore allow the pricing of interest rate &lt;em&gt;derivatives&lt;/em&gt; (not of the bonds themselves). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words these models generate a &lt;em&gt;set&lt;/em&gt; of interest rate paths (thousands of them). The mean (expected) interest rate path from the  model is not particularly interesting or useful for trading bonds. The model is generally calibrated so the mean outcome is derived from the forward structure in the market, or from the forecast of the person running the model. So you &quot;learn nothing new&quot; by averaging the model's predictions, you are just getting back what you put in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So a stochastic interest rate model is a machine for automatically generating plausible i.r. scenarios, not a crystal ball that tells you what interest rates will be. &lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-08-24T15:53:40.793" LastActivityDate="2017-08-24T15:53:40.793" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35766" PostTypeId="1" CreationDate="2017-08-24T14:55:02.677" Score="1" ViewCount="9449" Body="&lt;p&gt;Would just like to check my understanding. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I were to pay USD FRA-OIS, does it mean I'm paying the OIS leg and receiving fixed? And the fixed is because the 3mL is fixed at the start of the period/tenor of the contract? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So this implies that if the LIBOR-OIS spread widens, the trade would be in the money?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="6722" LastEditorUserId="16148" LastEditDate="2017-08-24T16:00:24.220" LastActivityDate="2017-08-25T07:39:36.060" Title="What does it mean to pay USD FRA-OIS?" Tags="&lt;libor&gt;&lt;rates&gt;&lt;ois&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35770" PostTypeId="1" AcceptedAnswerId="35773" CreationDate="2017-08-24T18:01:56.597" Score="2" ViewCount="652" Body="&lt;p&gt;I am able to replicate steps and arrive to the option price using Black Scholes framework. Here however I am more interested to understand, at least intuitively, why the ln transformation of price process is performed (Ito lemma part) in the first place. Price process is already a function of time and Wiener process, so I wonder why do we need to apply another function (ln). I do not think it has to do with log normality of prices or normality of returns. I have seen such a transformation taking place in solution of other problems that were not related to GBM - BS framework. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks,&lt;/p&gt;&#xA;" OwnerUserId="29323" LastEditorUserId="24222" LastEditDate="2017-08-24T18:58:46.423" LastActivityDate="2017-08-24T21:29:00.560" Title="Intuition behind Ln transformation of stock price when applying Ito lemma" Tags="&lt;black-scholes&gt;&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="1" ClosedDate="2017-08-25T07:27:34.957" ContentLicense="CC BY-SA 3.0" />
  <row Id="35771" PostTypeId="2" ParentId="35757" CreationDate="2017-08-24T18:02:47.447" Score="1" Body="&lt;p&gt;Let $X_t$ be the exchange rate from one unit foreign currency to units domestic currency. Moreover, let $K$ be the forward rate set at the contract inception time, which is usually prior to the VaR calculation date $t_0=0$. Then the value at time $t$, where $t_0 \le T \le T$, of the forward contract is given by&#xA;\begin{align*}&#xA;B_t^d\,\mathbb{E}\left(\frac{X_T-K}{B^d_T} \,\big|\, \mathcal{F}_t\right),&#xA;\end{align*}&#xA;where $B_t^d$ is the domestic money-market account value, $P^f(t, T)$ is the value at time $t$ of the foreign zero coupon bond with maturity $T$, and $\mathbb{E}$ is the expectation operator under the domestic risk-neutral measure $\mathbb{Q}^d$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As $P^f(t, T)X_t$ and $P^d(t, T)$ are values at time $t$ of domestic tradable assets. the processes $\left\{\frac{P^f(t, T)X_t}{B_t^d}, \, t_0\le t \le T \right\}$ and $\left\{\frac{P^d(t, T)}{B_t^d}, \, t_0\le t \le T \right\}$ are martingales under the domestic risk-neutral measure. Then, the value at $t$ of the forward contract is given by&#xA;\begin{align*}&#xA;B_t^d\,\mathbb{E}\left(\frac{X_T-K}{B^d_T} \,\big|\, \mathcal{F}_t\right) &amp;amp;=&#xA;B_t^d\,\mathbb{E}\left(\left(\frac{P^f(T, T)X_T}{B^d_T} -K\frac{P^d(T, T)}{B^d_T}\right) \,\big|\, \mathcal{F}_t\right)\\&#xA;&amp;amp;=P^f(t, T)X_t - K P^d(t, T).&#xA;\end{align*}&#xA;That is, the value of the exchange of certain amount of foreign zero-coupon bond with certain amount of domestic zero-coupon bond.  &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Addendum&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Here, we provide a mathematical derivation that the process $\left\{\frac{P^f(t, T)X_t}{B_t^d}, \, 0 \le t \le T \right\}$ is a martingale under the domestic risk-neutral measure $\mathbb{Q}^d$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\mathbb{Q}^f$ be the foreign risk-neutral measure, and $\mathbb{E}^f$ be the corresponding expectation operator. Note that the process $\left\{\frac{P^f(t, T)}{B_t^f}, \, 0 \le t \le T \right\}$ is a martingale under the foreign risk-neutral measure. We denote by $\eta_t$ the Radon–Nikodym derivative &#xA;\begin{align*}&#xA;\frac{d\mathbb{Q}^d}{d\mathbb{Q}^f}\big|_t = \frac{B_t^d X_0}{B_t^f X_t}.&#xA;\end{align*}&#xA;Then, for $0 \le s \le t \le T$,&#xA;\begin{align*}&#xA;\mathbb{E}\left(\frac{P^f(t, T)X_t}{B_t^d}\, \big| \, \mathcal{F}_s\right) &amp;amp;= \mathbb{E}^f\left(\frac{\eta_t}{\eta_s}\frac{P^f(t, T)X_t}{B_t^d}\, \big| \, \mathcal{F}_s\right)\\&#xA;&amp;amp;=\mathbb{E}^f\left(\frac{B_t^d}{B_t^f X_t} \frac{B_s^f X_s}{B_s^d}\frac{P^f(t, T)X_t}{B_t^d}\, \big| \, \mathcal{F}_s\right)\\ &#xA;&amp;amp;=\frac{B_s^f X_s}{B_s^d}\mathbb{E}^f\left(\frac{P^f(t, T)}{B_t^f}\, \big| \, \mathcal{F}_s\right)\\ &#xA;&amp;amp;=\frac{P^f(s, T)X_s}{B_s^d}.&#xA;\end{align*}&#xA;That is,  $\left\{\frac{P^f(t, T)X_t}{B_t^d}, \, 0 \le t \le T \right\}$ is a martingale under the domestic risk-neutral measure.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-08-28T14:10:23.120" LastActivityDate="2017-08-28T14:10:23.120" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="35772" PostTypeId="2" ParentId="35758" CreationDate="2017-08-24T19:08:10.893" Score="1" Body="&lt;p&gt;To be precise, that code generates draws from a &lt;a href=&quot;https://en.wikipedia.org/wiki/Log-normal_distribution&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;em&gt;shifted lognormal distribution&lt;/em&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Define $R_t = \frac{P_t + D_t}{P_{t-1}} - 1$ as the &lt;em&gt;return&lt;/em&gt; from $t-1$ to $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Define $r_t = \log \left( 1 + R_t \right)$ as the &lt;em&gt;log return&lt;/em&gt; from $t-1$ to $t$. (Note if $D_t=0$ then $r_t = \log P_t - \log P_{t-1}$.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your code above generates &lt;em&gt;returns&lt;/em&gt; where the corresponding &lt;em&gt;log return&lt;/em&gt; follows the normal distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a practical matter, the &lt;a href=&quot;https://stats.stackexchange.com/questions/244199/why-is-it-that-natural-log-changes-are-percentage-changes-what-is-about-logs-th/244237#244237&quot;&gt;linear approximation of $f(x) = \log(1+x)$ around $x=0$ is given by $x$,&lt;/a&gt; hence for $r_t$ near zero, we have $r_t \approx R_t$. If a return is .02, the log return is .0198. (Of course, this breaks down the farther one is from zero.)&lt;/p&gt;&#xA;" OwnerUserId="20582" LastActivityDate="2017-08-24T19:08:10.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35773" PostTypeId="2" ParentId="35770" CreationDate="2017-08-24T21:29:00.560" Score="4" Body="&lt;p&gt;This is merely a mathematical trick. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You cannot easily integrate $dS_t = S_t(\mu dt + \sigma dW_t)$ over time because the RHS depends on $S_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using Ito's lemma on the log price gets you: $d\ln(S_t) = \left(\mu-\frac{1}{2}\sigma^2\right) dt + \sigma dW_t$ which is straightforward to integrate.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2017-08-24T21:29:00.560" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35774" PostTypeId="1" CreationDate="2017-08-24T21:44:15.103" Score="2" ViewCount="97" Body="&lt;p&gt;My understanding of Delta is the change in the Option's price relative to the change in the underlying asset's price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of Treasury Future Options (ie those on CME), one intuitive way to do it is to shift interest rate curve (whatever curve the underlying asset depends on) by a certain amount, and then compute the prices of the underlying future contract, as well as the prices of the option itself, and find the ratio of the differences of those 2 types of prices. This will give me the 'Delta' of this option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The trick of course is computing the price of the option in the above. And this is where option price modeling comes in.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But why would there be a 'market price' based delta? Whatever price that we need to find in the above methodology must be computed using a model, no?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would one find a 'market price' based Delta ?&lt;/p&gt;&#xA;" OwnerUserId="29327" LastActivityDate="2017-08-24T21:44:15.103" Title="'Market price' based Delta vs 'Model Price' based Delta for Bond Future Options?" Tags="&lt;options&gt;&lt;delta&gt;&lt;bond-futures&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35775" PostTypeId="2" ParentId="35766" CreationDate="2017-08-25T07:39:36.060" Score="1" Body="&lt;p&gt;I think I've found the answer in another forum (which fits my initial intuition). So just to share:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;FRA-OIS is traded via swap. So if you think the spread would widen you&#xA;  pay on the swap. So you would pay OIS + Spread and receive Libor.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.wallstreetoasis.com/forums/tech-questions-on-eurodollar-and-fed-funds-futures-hedging&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.wallstreetoasis.com/forums/tech-questions-on-eurodollar-and-fed-funds-futures-hedging&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="6722" LastActivityDate="2017-08-25T07:39:36.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35777" PostTypeId="2" ParentId="35762" CreationDate="2017-08-25T08:35:25.430" Score="1" Body="&lt;p&gt;Well probably it is some sort of mistake on EU supervisor side because if you look at stress scenario for Cat 3 in that document you will find that it's just nonsense. For example they are using only 2Y (which is the RHP in their example) of data but they should use full 5Y. Next if you look at the returns (page 31) the first nine returns are corresponding to the dates on the left but the other returns and even rolling vol. are not (the last return is for 28.3.2017 not 27.1.2017 as they are presenting). Furthermore the volatilities they calculated are wrong. The last five volatilities are rolling volatilities for 22.3.2017 to the 28.3.2017 and the rolling window is not 63 (as it should be due to RHP is 2Y) but 21. And the first volatilities well I don't know how they calculate them I have try to reproduce them from data but I was not successful. So that is that, they probably publish corrected document but until then you should rely only on RTS when it comes to the stress scenario.&lt;/p&gt;&#xA;" OwnerUserId="29333" LastActivityDate="2017-08-25T08:35:25.430" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35778" PostTypeId="2" ParentId="34880" CreationDate="2017-08-25T11:23:07.513" Score="1" Body="&lt;p&gt;This kind of data you are looking for is - as far as I know - not available for free. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Stock segmentation&lt;/strong&gt; depends on various aspects and there are professional agencies that do this job. While MSCI, for example, classifies a stock in Sector A, STOXX classifies it into Sector B. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also &lt;strong&gt;primary exchange&lt;/strong&gt; depends on various aspects and Bloomberg and Thomson Reuters use different methods to evaluate the primay exchange. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;SEDOL numbers&lt;/strong&gt;: see here: &lt;a href=&quot;http://www.londonstockexchange.com/products-and-services/reference-data/sedol-master-file/sedol-master-file.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.londonstockexchange.com/products-and-services/reference-data/sedol-master-file/sedol-master-file.htm&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="22515" LastActivityDate="2017-08-25T11:23:07.513" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35781" PostTypeId="1" AcceptedAnswerId="35782" CreationDate="2017-08-25T14:27:36.630" Score="4" ViewCount="12266" Body="&lt;p&gt;I'm comparing the performance of Fama French three factor and Carhart four factor models. For the regression analysis, I have used the 25 Value Weighted portfolios sorted on size and B/M. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Table above are the values obtained for the GRS ([Gibbons, Ross and Shanken][3]) test. I'm not sure about the way to analyse this table. Can anyone help me please?&lt;/p&gt;&#xA;" OwnerUserId="28923" LastEditorUserId="28923" LastEditDate="2017-09-03T16:23:53.487" LastActivityDate="2019-03-21T19:45:02.663" Title="how to interpret the GRS F test values?" Tags="&lt;fama-french&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35782" PostTypeId="2" ParentId="35781" CreationDate="2017-08-25T15:00:29.633" Score="8" Body="&lt;p&gt;You don't have a GRS test there that all the alphas are zero. You have a $\chi^2$ test that all the alphas are zero. (The p-value associated with that test statistic corresponds to a &lt;a href=&quot;https://en.wikipedia.org/wiki/Chi-squared_distribution&quot; rel=&quot;nofollow noreferrer&quot;&gt;chi-squared distribution&lt;/a&gt; with 25 degrees of freedom. &lt;code&gt;1 - chi2cdf(81.338394, 25) = 7.029276349879154e-08&lt;/code&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps examine &lt;a href=&quot;https://quant.stackexchange.com/a/35693/20582&quot;&gt;this answer&lt;/a&gt; here.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Quick review of the F-test (GRS test)&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Under the assumption of normal error terms, that are homoskedastic and uncorrelated over time, one can apply an F-test that all the alphas are zero.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The Gibbons Ross Shanken (GRS) test is what finance calls a statistical F-test for the hypothesis that all the alphas (from a set of time-series regressions) are zero. Each $\alpha_i$ is the intercept term in a time-series regression of excess returns $r_{it} - r^f_t$ on factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps examine &lt;a href=&quot;https://quant.stackexchange.com/questions/34091/calculating-alpha-and-its-meaning/34092#34092&quot;&gt;this answer&lt;/a&gt; on the meaning of alpha and why a test that all alphas are zero constitutes a joint test of market efficiency and an asset pricing model. &lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Quick review of $\chi^2$ test&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Dropping the assumption of normally distributed error terms, there exists a test-statistic that asymptotically approaches the $\chi^2$ distribution. Let $n$ be the number of test assets (in your case 25), and let $T$ be the number of time periods. Define test statistic $J$ as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ J = T \frac{\boldsymbol{\alpha}' \Sigma^{-1} \boldsymbol{\alpha}}{ 1 + \boldsymbol{\mu_f}' \Sigma_f^{-1} \boldsymbol{\mu_f}} $$&#xA;$J$ follows the $\chi^2$ distribution with $n$ degrees of freedom:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ J \sim \chi^2\left(n \right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Definition of variables are given &lt;a href=&quot;https://quant.stackexchange.com/questions/35690/choosing-the-right-statistical-test-for-mutual-fund-performance-evaluation/35693#35693&quot;&gt;here&lt;/a&gt;. Cochrane (2005) shows how to derivate the test statistic as a special case of the &lt;a href=&quot;https://en.wikipedia.org/wiki/Sargan%E2%80%93Hansen_test&quot; rel=&quot;nofollow noreferrer&quot;&gt;Sargan-Hansen J test&lt;/a&gt;. You might examine Cochrane's notes &lt;a href=&quot;https://faculty.chicagobooth.edu/john.cochrane/teaching/35150_advanced_investments/week_5_notes.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;References:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Cochrane, John, &lt;em&gt;Asset Pricing&lt;/em&gt;, 2005, p. 230&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2018-05-28T15:42:37.397" LastActivityDate="2018-05-28T15:42:37.397" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="35784" PostTypeId="1" CreationDate="2017-08-25T20:47:03.460" Score="1" ViewCount="144" Body="&lt;p&gt;I'm currently working on an stochastic optimal control problem applied to a portfolio asset allocation. In principle, the problem is to maximize the return of a fixed income portfolio under certain VaR constraint.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1- How would one go about solving these problems numerically (Monte-Carlo method, etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2- Can some one direct me to a source for an exposition of the material (seeing some code would be awesome!)&lt;/p&gt;&#xA;" OwnerUserId="25293" LastActivityDate="2017-08-25T20:47:03.460" Title="How to Implement an optimal Stochastic Control Optimization?" Tags="&lt;stochastic-processes&gt;&lt;optimization&gt;&lt;stochastic-control&gt;" AnswerCount="0" CommentCount="2" ClosedDate="2017-08-26T10:15:31.170" ContentLicense="CC BY-SA 3.0" />
  <row Id="35785" PostTypeId="2" ParentId="35285" CreationDate="2017-08-25T21:18:21.323" Score="1" Body="&lt;p&gt;The reason we look for cointegration is to find some long-term relationship between &lt;em&gt;levels&lt;/em&gt; of prices. When you use the returns, you are seeking a relationship between first differences, which are usually not integrated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case 1, your model helps to describe what will happen between the two prices. In the cases of oil prices, for instance, Brent and WTI are essentially the same product. If their prices differ too strongly and their cointegrated series is far from the mean, we can expect it to mean-revert at some point in the future, whether that's now or before the end of the world. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case 2, you are looking for a way of modeling an instantaneous change in returns from one asset due to changes in another -- this is by it's nature more short term. As Richard points out in his excellent comment below, this omits a variable and may not be an effective test.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Case 1 is your best option, as it's unlikely that first differences of a financial time series are cointegrated.&lt;/p&gt;&#xA;" OwnerUserId="19823" LastEditorUserId="19823" LastEditDate="2017-10-16T00:28:10.777" LastActivityDate="2017-10-16T00:28:10.777" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35786" PostTypeId="1" AcceptedAnswerId="35788" CreationDate="2017-08-25T22:29:01.467" Score="3" ViewCount="3534" Body="&lt;p&gt;I am still confused regarding the differences between upfront and running.&#xA;If two bonds have a spread of 50bp, does that equate to 50bp in total return over the course of the year or do I have to multiply 50bp by the duration effect. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sometimes I mix up the two and don't know which space I'm in.&lt;/p&gt;&#xA;" OwnerUserId="29342" LastActivityDate="2019-10-25T16:00:28.473" Title="Carry and roll (upfront vs running)" Tags="&lt;fixed-income&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="35788" PostTypeId="2" ParentId="35786" CreationDate="2017-08-26T01:02:21.183" Score="3" Body="&lt;p&gt;Bps running and bps upfront are used so that notional amount doesn't need to be referenced, and &quot;bps upfront&quot; is just &quot;bps running&quot; multiplied by DV01 (&lt;em&gt;not&lt;/em&gt; modified duration).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, a 10-year bond currently has a DV01 of roughly 9. Then &quot;1 bp running&quot; for this bond is equivalent to &quot;9 bp upfront&quot;. If the notional amount is \$100 million, then the total dollar risk is $9 \text{ bps} \times \text{100 million} = \$90,000$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Carry and roll for bonds/swaps are usually quoted in &quot;bps running&quot; terms over a specified horizon. If a bond's RD&amp;amp;C (rolldown + carry) is $x$ bps running over 3 months, it means that your expected P&amp;amp;L from carry and roll will be $x \text{ bp} \times \text{PV01}$ over three months. Continuing with our 10-year bond example, its RD&amp;amp;C is currently about 4.4 bps running, or 39.6 bps upfront, or \$396,000 for 100 million notional. Note that we don't usually annualize carry and roll statistics when we report them, so these are expected P&amp;amp;L over the specified horizon (3 months in this case).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also note that bps running is bond specific, &quot;1 bp running&quot; would equate to &quot;$x$ bp upfront&quot; depending on a bond's risk. So the simple yield spread between two bonds is neither bps running nor bps upfront. Typically we'd calculate the carry/roll for each bond and then take the difference. The result would be considered a &quot;bps running&quot; concept and you'd implement a spread trade in a DV01-neutral way (i.e., you'd scale the notionals on the two bonds so that their DV01s are identical).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's use a real life example: 10-year bond yield closed at 2.17% today while 30-year bond yield closed at 2.75%, a yield spread of 58 bp. If we implement a duration-neutral spread trade (say short 2.27 units of 10-year bond against each unit of 30-year bond), the 3-month carry of the trade would be $1.9-2.7 = -0.8$ bp running and the 3-month rolldown is $0.1 - 1.7 = -1.6$ bp running.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2017-08-26T01:39:35.503" LastActivityDate="2017-08-26T01:39:35.503" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35790" PostTypeId="1" AcceptedAnswerId="35798" CreationDate="2017-08-26T12:00:15.087" Score="2" ViewCount="1297" Body="&lt;p&gt;I'm currently working on roll down calculations for the Treasury curve (3-month roll, 6-month roll, etc..). One of the senior guys (I just started out of college) asked me to adjust for the coupon effects for some of the long dated bonds. I understand that higher coupon bonds have lower yields than other bonds with the same maturity. However, I am not sure the proper way to adjust for the coupon effects.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've read literature where people use asset swap spreads to observe the coupon effects. &lt;/p&gt;&#xA;" OwnerUserId="29342" LastEditorUserId="16160" LastEditDate="2017-08-26T13:00:43.813" LastActivityDate="2017-08-27T06:30:03.783" Title="Roll down Treasury curve (Coupon effects)" Tags="&lt;fixed-income&gt;&lt;treasuries&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35791" PostTypeId="2" ParentId="35706" CreationDate="2017-08-26T13:40:16.493" Score="2" Body="&lt;p&gt;Going backwards 2 days with &lt;code&gt;qlCalendarAdvance(..., &quot;-2D&quot;, ...)&lt;/code&gt; works in this particular case.  To be more robust, and to take into account the number of fixing days and the conventions of the index you're using, you can use the &lt;code&gt;qlInterestRateIndexFixingDate&lt;/code&gt; function. It takes the interest-rate index and a value date (that is, the start of your coupon) and returns the corresponding fixing date.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2017-08-26T13:40:16.493" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35792" PostTypeId="2" ParentId="35626" CreationDate="2017-08-26T14:12:30.023" Score="2" Body="&lt;p&gt;I don't have a full answer to your question, but I re-did some of the calculations in one of the chapters of the &lt;a href=&quot;https://leanpub.com/quantlibpythoncookbook&quot; rel=&quot;nofollow noreferrer&quot;&gt;QuantLib Python Cookbook&lt;/a&gt;.  The part on EONIA bootstrapping is available for free; look around the page for a &quot;Read free sample&quot; button.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short: if you bootstrap an EONIA curve without taking the jump into account, one of your forward levels will be off.  In order to estimate the jump, you can create another curve that replaces that forward level with one which is interpolated between those around it and is thus not affected by the jump.  If you forecast end-of-year rates off the two curves, the difference between the two fixings can be attributed to the jump, which can thus be estimated and then modeled explicitly.  Details are in the chapter I linked.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the other points in the question: the idea is that the jumps for the various tenors are all due to the jump in the overnight rate.  The rates over longer tenors can be seen as an average of the overnight rates (plus a spread, of course).  The 1/20 ratio is due to a month having more or less 20 business days, causing the 1-month rate to be the average of about 20 fixings, only one of them including the jump.  The &quot;roughly equal&quot; might mean that there's noise in the calculation of the average, or (as you say) that the estimate of the jump can be done in a different way, that is, directly on 1-month rates.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2017-08-26T14:12:30.023" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35793" PostTypeId="1" AcceptedAnswerId="35794" CreationDate="2017-08-26T15:29:09.237" Score="1" ViewCount="153" Body="&lt;p&gt;I was wondering, is it possible to calculate a daily VWAP (Volume weighted Average Price) from the close snap shot (close price, high, low open and total volume traded over the day)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so is there a formula?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many thanks&lt;/p&gt;&#xA;" OwnerUserId="29351" LastActivityDate="2017-08-26T17:00:55.137" Title="Calculating a VWAP using close prices snapshot" Tags="&lt;finance-mathematics&gt;&lt;statistical-finance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35794" PostTypeId="2" ParentId="35793" CreationDate="2017-08-26T17:00:55.137" Score="2" Body="&lt;p&gt;No, you need the volume at each traded price level.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2017-08-26T17:00:55.137" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35795" PostTypeId="1" CreationDate="2017-08-26T17:02:10.670" Score="4" ViewCount="14124" Body="&lt;p&gt;I was hoping that I can get help on a simple yet not so straight forward  topic :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at valuing the costs of holding an IRS in the books this would entail marketed-to-market due to price movements in addition to Carry &amp;amp; roll down. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is specific to Carry of an interest rate swap. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;On an IRS there would a fixed leg and a floating leg, assume that we are running a 5 year IRS where we are paying a USD fixed rate quarterly and receiving 3m Libor floating quarterly .Assume 5y  spot rate is 2% &amp;amp; 3m libor is 1.3% &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuitively the 3 month carry would be (spot rate - libor ) , in our case 2%-1.3% quarterly &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is why is it to calculate carry the following is used instead:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Carry = forward rate - spot rate &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In our case (4.75 years IRS starting in 3 months) - ( 5y spot rate )&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;please explain to me like I'm a 6 year old&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any links or txt that you can provide would be appreciated &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kind Regards &lt;/p&gt;&#xA;" OwnerUserId="29352" LastActivityDate="2020-01-05T08:28:37.950" Title="Carry calculation on an interest rate swap" Tags="&lt;fixed-income&gt;&lt;interest-rate-swap&gt;&lt;irs&gt;&lt;theta&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="35796" PostTypeId="2" ParentId="35756" CreationDate="2017-08-26T18:34:48.537" Score="7" Body="&lt;p&gt;A more apples to apples comparison would be between (i) Fama-Macbeth procedure and (2) clustering standard-errors by date. Adding fixed-effects is somewhat different.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Problem: cross-sectional correlation causes naively computed standard errors to be understated&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Let &lt;span class=&quot;math-container&quot;&gt;$r_{it}$&lt;/span&gt; denote the return of firm &lt;span class=&quot;math-container&quot;&gt;$i$&lt;/span&gt; in month &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt;. An important statistical issue is that firm returns are cross-sectionall correlated: &lt;span class=&quot;math-container&quot;&gt;$\operatorname{Cov}(r_{it}, r_{jt})$&lt;/span&gt; is far from zero. This flows through to significant, positive cross-sectional correlation in the error terms for most any regression specification. The end result is that you'll underestimate standard errors (overstate significance) unless you use standard errors that are consistent in the presence of cross-sectional correlation.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;What to do?&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Two possible approaches are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The Fama-Macbeth procedure: run a cross-sectional regression each period and take a time-series average of those estimates.&lt;/li&gt;&#xA;&lt;li&gt;Running a single panel regression and clustering standard-errors by&#xA;date.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Both methods rely on zero correlation between the error terms of non-contemporaneous periods. A difference is weighting. The Fama-Macbeth procedure weights each time period equally. A panel regression will effectively give greater weight to periods with more observations or greater variation in right hand side variables.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your results are basically the same with either method, that's great. If they differ, you need to be careful about what your precise research question is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Somewhat related is an old debate in the event study literature as whether to equally weight events or calendar time periods. For example, initial public offerings (IPOs) tend to group together in time. Weighting each IPO equally or forming portfolios and weighting each month equally are quite different. Eg. Fama (1998) advocates for calendar time portfolios of abnormal returns. Critics (eg. Ritter) say this is inefficient.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Setup&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Imagine you have the panel data model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ y_{it} = \mathbf{x}_{it} \cdot \mathbf{b} + \epsilon_{it}$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's assume:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Error terms are cross-sectionally correlated: &lt;span class=&quot;math-container&quot;&gt;$\operatorname{E}[\epsilon_{it} \epsilon_{jt}] \neq 0$&lt;/span&gt; for &lt;span class=&quot;math-container&quot;&gt;$i \neq j$&lt;/span&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Error terms are uncorrelated over time: &lt;span class=&quot;math-container&quot;&gt;$\operatorname{E}[\epsilon_{it} \epsilon_{j\tau}] = 0$&lt;/span&gt; for any &lt;span class=&quot;math-container&quot;&gt;$i$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$j$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$t \neq \tau$&lt;/span&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h2&gt;Review of Fama-Macbeth procedure&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;For &lt;em&gt;each&lt;/em&gt; time period &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt;, run the a cross-sectional regression:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ y_{it} = \mathbf{x}_{it} \cdot \mathbf{b}_t + \epsilon_{it}$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From this, you obtain a time-series of estimates &lt;span class=&quot;math-container&quot;&gt;$\hat{\mathbf{b}}_t$&lt;/span&gt;. Under the assumption that error terms are uncorrelated over time, we can then compute the overall estimate and standard-errors using the most basic, Stats 1 method. For any component of the vector &lt;span class=&quot;math-container&quot;&gt;$\mathbf{b}$&lt;/span&gt; one would compute the estimate and standard-error as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ \hat{b} = \frac{1}{T} \sum_t b_t \quad \quad \mathit{SE} = \sqrt{\frac{\frac{1}{T} \sum_t \left( b_t - \hat{b} \right)^2 }{T}}$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;OLS regression and then clustering standard-errors by time&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;A more modern approach is to run a standard panel regression and then cluster on the date variable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An advantage of the general panel setting is that it's reasonably straightforward to apply other kinds of corrections to standard errors if you so desired (eg. Hansen-Hodrick, Newey-West, two-way clustering, etc...)&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;An instructive special case&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;If you have a &lt;a href=&quot;https://en.wikipedia.org/wiki/Panel_data&quot; rel=&quot;nofollow noreferrer&quot;&gt;balanced panel&lt;/a&gt; and no-time series variation in your right hand side variables (i.e. &lt;span class=&quot;math-container&quot;&gt;$\mathbf{x}_{it} = \mathbf{x}_i$&lt;/span&gt; for all &lt;span class=&quot;math-container&quot;&gt;$i$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt;), then your estimate of &lt;span class=&quot;math-container&quot;&gt;$\mathbf{b}$&lt;/span&gt; using a single ordinary least squares reression and using the Fama-Macbeth procedure are &lt;em&gt;EXACTLY&lt;/em&gt; the same. The two approaches to estimating standard errors though may be quite different depending on the cross-sectional correlation in the errors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If there is time-series variation in the right hand side variables, the two estimates will differ. What's happening? Fama-Macbeth equally weights each time period while a single OLS regression will effectively give greater weight to periods where &lt;span class=&quot;math-container&quot;&gt;$\mathbf{x}_{it}$&lt;/span&gt; have greater variation.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Simple example showing how Fama-Macbeth procedure differens on weighting:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Imagine we have the data:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ \begin{array}{cccc} y &amp;amp; x &amp;amp; i &amp;amp; t \\ 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 1 \\ 0 &amp;amp; 1 &amp;amp; 2 &amp;amp; 1 \\ 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; 2 \\ 2 &amp;amp; 2 &amp;amp; 2 &amp;amp; 2 \end{array} $$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Running the Fama-Macbeth procedure we get &lt;span class=&quot;math-container&quot;&gt;$b_1 = 0$&lt;/span&gt; for time period 1 and &lt;span class=&quot;math-container&quot;&gt;$b_2 = 1$&lt;/span&gt; hence our estimate of &lt;span class=&quot;math-container&quot;&gt;$b$&lt;/span&gt; is &lt;span class=&quot;math-container&quot;&gt;$\frac{0 + 1}{2} = .5$&lt;/span&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A single panel regression would estimate &lt;span class=&quot;math-container&quot;&gt;$b$&lt;/span&gt; as approximately .9.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;References:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Fama, Eugene F., 1998, &quot;Market Efficiency, Long-Term Returns, and Behavioral Finance&quot;&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2018-10-04T13:36:23.060" LastActivityDate="2018-10-04T13:36:23.060" CommentCount="14" ContentLicense="CC BY-SA 4.0" />
  <row Id="35797" PostTypeId="2" ParentId="35795" CreationDate="2017-08-27T01:08:55.900" Score="7" Body="&lt;p&gt;It turns out that the two things are the same, appropriately scaled.   Proof:  we can construct a 5 year swap using 3 month libor combined with a 3mo-4.75yr forward swap, weighted by the dv01s of each part.  Thus, ignoring discounting, we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5yr swap rate = (0.25*3mo libor + 4.75*forward rate)/5.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This can be rewritten as &lt;/p&gt;&#xA;&#xA;&lt;p&gt;0.25*(5yr swap rate - 3moLibor) = 4.75*(forward rate - 5yr swap rate)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus the two methods are equivalent, when each is multiplied by its relevant weighting.  Note: if you do this with discounting, the 4.75 gets replaced by the dv01 of the forward swap.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-08-27T01:08:55.900" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="35798" PostTypeId="2" ParentId="35790" CreationDate="2017-08-27T06:16:49.940" Score="7" Body="&lt;p&gt;To calculate rolldown that accounts for the coupon effect requires a &lt;a href=&quot;https://quant.stackexchange.com/questions/3302/deriving-spot-rates-from-treasury-yield-curve&quot;&gt;fitted curve&lt;/a&gt;. Assuming such a curve is available, then the following procedure is usually followed:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, calculate the &lt;a href=&quot;https://quant.stackexchange.com/questions/3319/what-is-the-difference-between-option-adjusted-spread-oas-and-z-spread&quot;&gt;z-spread&lt;/a&gt; of the bond in question relative to the fitted curve:&#xA;$$ P = \sum_{i=1}^n c_i \cdot d(t_i) \cdot e^{-s t_i}, $$&#xA;where $P$ is the current quoted dirty price (inclusive of accrued interest), $c_i$ is the $i$th upcoming cash flow, $d(t_i)$ is the discount factor corresponding to the $i$th cash flow (obtained from the fitted curve), and $s$ is the z-spread we are solving for. Conceptually, we are looking for how much of a parallel shift we need to apply to the zero coupon curve, so that the shifted curve reprices the bond to its current market price. (I'm using continuous compounding here, but you can use semi-annual compounding if you want; doesn't really matter.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming that we are calculating 3-month rolldown, we then reprice the bond using discount factors that are three months shorter and using the same z-spread from the previous step:&#xA;$$ P' = \sum_{i=1}^n c_i \cdot d(t_i - 0.25) \cdot e^{-s \cdot (t_i - 0.25)}. $$&#xA;(Note that &quot;0.25&quot; is me being lazy. In practice, you should get the correct day count fraction corresponding to the true &quot;3 months.&quot;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can then calculate a new yield to maturity $y'$ from $P'$ (assuming that maturity has shortened by three months). The difference between the current market yield and $y'$ is rolldown – coupon adjusted.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2017-08-27T06:30:03.783" LastActivityDate="2017-08-27T06:30:03.783" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="35799" PostTypeId="2" ParentId="16031" CreationDate="2017-08-27T06:55:07.297" Score="2" Body="&lt;p&gt;We can use &lt;code&gt;statistical inference&lt;/code&gt; with at least three types of data with applications in &lt;code&gt;financial engineering&lt;/code&gt; (with examples from Bayesian).&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;time series&lt;/code&gt;: trends, seasonality, change points, outliers, etc&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;&quot;A Simple Intro to Bayesian Change Point Analysis&quot;&lt;/em&gt;: &lt;a href=&quot;https://www.r-bloggers.com/a-simple-intro-to-bayesian-change-point-analysis/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.r-bloggers.com/a-simple-intro-to-bayesian-change-point-analysis/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;em&gt;&quot;Sorry ARIMA, but I’m Going Bayesian&quot;&lt;/em&gt;: &lt;a href=&quot;http://multithreaded.stitchfix.com/blog/2016/04/21/forget-arima/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://multithreaded.stitchfix.com/blog/2016/04/21/forget-arima/&lt;/a&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Bayesian structural time series models possess three key features for modeling time series data:&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;Ability to incorporate uncertainty into our forecasts so we quantify future risk&lt;/li&gt;&#xA;  &lt;li&gt;Transparency, so we can truly understand how the model works&lt;/li&gt;&#xA;  &lt;li&gt;Ability to incorporate outside information for known business drivers when we cannot extract the relationships from the data at hand&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;Bayesian networks&lt;/code&gt; (&lt;code&gt;factor graphs&lt;/code&gt;): to model decision variables, both known and latent and estimate risk in complex decision frameworks &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;em&gt;&quot;Market Analysis and Trading Strategies with Bayesian Networks&quot;&lt;/em&gt; : &lt;a href=&quot;http://c4i.gmu.edu/~pcosta/F15/data/fileserver/file/472072/filename/Paper_1570113749.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://c4i.gmu.edu/~pcosta/F15/data/fileserver/file/472072/filename/Paper_1570113749.pdf&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;related post: &lt;a href=&quot;https://stats.stackexchange.com/questions/85453/why-use-factor-graph-for-bayesian-inference&quot;&gt;https://stats.stackexchange.com/questions/85453/why-use-factor-graph-for-bayesian-inference&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;code&gt;text&lt;/code&gt; : for things like &quot;named entity recognition&quot;, &quot;concept extraction&quot; and &quot;sentiment analysis&quot;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;To compare Bayesian vs frequentist inference and learn about MCMC hands on approaches I found these resources and authors to be the best&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;em&gt;&quot;[Jake VanderPlas] Frequentism and Bayesianism: A Python-driven Primer&quot;&lt;/em&gt;: &lt;a href=&quot;https://arxiv.org/pdf/1411.5018.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://arxiv.org/pdf/1411.5018.pdf&lt;/a&gt;. Jake thinks with both hats and this helps connect the two worlds and motivate deeper study&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Discussion - The Bayesian approach gives odds of 10 to 1 against Bob,&#xA;  while the naïve frequentist approach gives odds of 18 to 1 against Bob. So which one is correct?&#xA;  For a simple problem like this, we can answer this question empirically by simulating a large number of games and count the fraction of suitable games which Bob goes on to win. This can be coded in a couple dozen lines of Python (see part II of [VanderPlas2014]). The result of such a simulation confirms the Bayesian result: 10 to 1 against Bob winning.&#xA;  So what is the takeaway: is frequentism wrong? Not necessarily: in this case, the incorrect result is more a matter of the approach being “naïve” than it being “frequentist”.&#xA;  The approach above does not consider how p may vary.&#xA;  There exist frequentist methods that can address this by, e.g. applying a transformation and conditioning of the data to isolate dependence on p, or by performing a Bayesian like integral over the sampling distribution of the frequentist estimator ˆp. Another potential frequentist response is that the question itself is posed in a way that does not lend itself to the classical,&#xA;  frequentist approach ...&lt;/p&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;em&gt;&quot;[Jake Vanderplas] Statistics, Data Mining, and Machine Learning in Astronomy&quot;&lt;/em&gt; : &lt;a href=&quot;https://books.google.ro/books?id=2fM8AQAAQBAJ&amp;amp;pg=PA123&amp;amp;lpg=PA123&amp;amp;dq=%22Classical+or+frequentist+statistics+is+based+on+these+tenets%22&amp;amp;source=bl&amp;amp;ots=_bGr55pHCG&amp;amp;sig=MvEeTaaIBbGLhP0jETP6W5B_-XI&amp;amp;hl=en&amp;amp;sa=X&amp;amp;ved=0ahUKEwiTucTnsPfVAhUhCZoKHZGeCnMQ6AEIJDAA#v=onepage&amp;amp;q=%22Classical%20or%20frequentist%20statistics%20is%20based%20on%20these%20tenets%22&amp;amp;f=false&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://books.google.ro/books?id=2fM8AQAAQBAJ&amp;amp;pg=PA123&amp;amp;lpg=PA123&amp;amp;dq=%22Classical+or+frequentist+statistics+is+based+on+these+tenets%22&amp;amp;source=bl&amp;amp;ots=&lt;em&gt;bGr55pHCG&amp;amp;sig=MvEeTaaIBbGLhP0jETP6W5B&lt;/em&gt;-XI&amp;amp;hl=en&amp;amp;sa=X&amp;amp;ved=0ahUKEwiTucTnsPfVAhUhCZoKHZGeCnMQ6AEIJDAA#v=onepage&amp;amp;q=%22Classical%20or%20frequentist%20statistics%20is%20based%20on%20these%20tenets%22&amp;amp;f=false&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Classical or frequentist statistics is based on these tenets:&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;Probabilities refer to relative frequencies of events.They are objective properties of the real world.&lt;/li&gt;&#xA;  &lt;li&gt;Parameters (such as the fraction of coin flips, for a certain coin, that are heads) are fixed, unknown constants. Because they are not fluctuating, probability statements about parameters are meaningless.&lt;/li&gt;&#xA;  &lt;li&gt;Statistical procedures should have well-defined long-run frequency properties.&#xA;  For example, a 95% confidence interval should bracket the true value of the&#xA;  parameter with a limiting frequency of at least 95%.&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;  &#xA;  &lt;p&gt;In contrast, Bayesian inference takes this stance:&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;Probability describes the degree of subjective belief, not the limiting frequency.&lt;/li&gt;&#xA;  &lt;li&gt;Probability statements can be made about things other than data, including&#xA;  model parameters and models themselves.&lt;/li&gt;&#xA;  &lt;li&gt;Inferences about a parameter are made by producing its probability&#xA;  distribution—this distribution quantifies the uncertainty of our knowledge&#xA;  about that parameter. Various point estimates, such as expectation value, may&#xA;  then be readily extracted from this distribution.&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;em&gt;&quot;[Thomas Wiecki] Bayesian Data Analysis with PyMC3&quot;&lt;/em&gt;: &lt;a href=&quot;https://vimeo.com/79518830&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://vimeo.com/79518830&lt;/a&gt;&#xA;Thomas is a main contributor for &lt;code&gt;PyMC3&lt;/code&gt; which is a very good tool for discover, study and apply &lt;code&gt;Bayesian inference&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;em&gt;&quot;MCMC in Python: random effects logistic regression in PyMC3&quot;&lt;/em&gt; &lt;a href=&quot;https://healthyalgorithms.com/2014/02/17/mcmc-in-python-random-effects-logistic-regression-in-pymc3/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://healthyalgorithms.com/2014/02/17/mcmc-in-python-random-effects-logistic-regression-in-pymc3/&lt;/a&gt;&#xA;&lt;code&gt;MCMC&lt;/code&gt; is indeed fundamental to &lt;code&gt;Bayesian inference&lt;/code&gt; but an algorithm serial in nature =&gt; hard to distribute / scale. For that we have &lt;code&gt;Variational Bayes inference&lt;/code&gt; and &lt;code&gt;Loopy belief propagation&lt;/code&gt;.&#xA;&lt;a href=&quot;https://metacademy.org/roadmaps/rgrosse/bayesian_machine_learning&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://metacademy.org/roadmaps/rgrosse/bayesian_machine_learning&lt;/a&gt; says that &lt;em&gt;&quot;&lt;code&gt;Loopy BP&lt;/code&gt; can be interpreted as a &lt;code&gt;variational inference&lt;/code&gt; algorithm.&quot;&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8247" LastEditorUserId="8247" LastEditDate="2017-09-03T11:18:42.277" LastActivityDate="2017-09-03T11:18:42.277" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35800" PostTypeId="2" ParentId="16031" CreationDate="2017-08-27T09:00:56.020" Score="4" Body="&lt;p&gt;First of all, the area of statistics you need in finance is &lt;strong&gt;&lt;a href=&quot;http://www.springer.com/gb/book/9780387962634&quot; rel=&quot;nofollow noreferrer&quot;&gt;time series analysis&lt;/a&gt;&lt;/strong&gt;. That being say, as usual is statistics: the more data you have, the more sophisticated models you can use. Typically in intraday / high frequency finance, you can afford to use sophisticated methods. See &lt;a href=&quot;http://www.worldscientific.com/worldscibooks/10.1142/8967&quot; rel=&quot;nofollow noreferrer&quot;&gt;MMP&lt;/a&gt; (and especially the appendix) for basics, and &lt;a href=&quot;https://www.crcpress.com/Quantitative-Trading-Algorithms-Analytics-Data-Models-Optimization/Guo-Lai-Shek-Wong/p/book/9781498706483&quot; rel=&quot;nofollow noreferrer&quot;&gt;Quantitative Trading&lt;/a&gt; for more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Again as usual, advantages of Bayesian vs. Least Square methods are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Using &lt;em&gt;prior&lt;/em&gt; to obtain a better accuracy (if your prior is adequate) with the same number of observations (note that nevertheless you have a prior --but very simple:Bayesian-- with Least Squares).&lt;/li&gt;&#xA;&lt;li&gt;The robustness to &lt;em&gt;outliers&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li&gt;The capability to deal with &lt;em&gt;non i.i.d. datasets&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;No preference for Bayesian or LS, but you have to understand how you answer to each of these points when you decide to use a method.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You present &lt;strong&gt;portfolio construction&lt;/strong&gt; as an &lt;em&gt;estimation&lt;/em&gt;. I would not agree: you need estimates to build a portfolio but the portfolio construction is not an estimation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typically BL uses a Bayesian approach to estimate covariance (and potentially expected returns and the risk aversion of market participants) under a general equilibrium consideration. Once it is done they use some of the estimates to build a portfolio using a given framework (can be Bayesian or not).&lt;/p&gt;&#xA;" OwnerUserId="2299" LastEditorUserId="2299" LastEditDate="2017-09-03T14:55:11.260" LastActivityDate="2017-09-03T14:55:11.260" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35802" PostTypeId="1" AcceptedAnswerId="35831" CreationDate="2017-08-27T16:08:13.880" Score="1" ViewCount="1189" Body="&lt;p&gt;I am working through some backtesting ideas and I would love to capture the basic statistics results for comparison, (cumulative returns, annual returns, sharpe, omega etc.) &#xA;Is there a python library that provides the calculation of the stats as callable functions similar to the ta-lib library, &lt;a href=&quot;https://github.com/mrjbq7/ta-lib&quot; rel=&quot;nofollow noreferrer&quot;&gt;Python's TA-Lib port&lt;/a&gt;?&lt;/p&gt;&#xA;" OwnerUserId="9446" LastActivityDate="2017-08-29T04:49:07.107" Title="Python Library To Calculate Porfolio Statistics" Tags="&lt;backtesting&gt;&lt;portfolio&gt;&lt;python&gt;&lt;library&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35804" PostTypeId="1" AcceptedAnswerId="35814" CreationDate="2017-08-27T21:22:01.223" Score="2" ViewCount="1045" Body="&lt;p&gt;Sometimes traders approximate realized volatility to compare it to the annualized implied volatilities in options by multiplying the 1-day daily return (as a substitute for the daily volatility since the average return is assumed to be zero) by 16 since volatility is proportional to the square root of time and if there are 252 trading days in a year:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sqrt{252}*\sigma_{daily}=\sigma_{annualized}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sqrt{252}=15.8745 \approx 16$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so, $16*\sigma_{daily}\approx\sigma_{annualized}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The absolute value of the percent return on a given day is used in place of daily volatility to get a rough approximation of the realized volatility for that day. However, in &quot;Volatility Trading&quot; by Euan Sinclair he claims we should use 20 as the multiplier instead of 16. He writes the difference &quot;is due to confusing the square root of average squared returns with daily returns&quot;. He arrives at this multiplier by the following equations:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E[| R_{t} |]=\sqrt{2/\pi}\sigma$      (&lt;strong&gt;equation 1&lt;/strong&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma=19.896(\frac{1}{N}\sum_{t=1}^{N}| R_t |)$      (&lt;strong&gt;equation 2&lt;/strong&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;so, $average move = 0.04986\sigma S \approx \frac{\sigma S}{20}$  (&lt;strong&gt;equation 3&lt;/strong&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How is he coming to equation 1 and 2? Why isn't the first approach correct? Please explain in more detail.&lt;/p&gt;&#xA;" OwnerUserId="9501" LastActivityDate="2017-09-01T09:33:10.763" Title="Daily Return to Approximate Annualized Realized Volatility 16 or 20?" Tags="&lt;options&gt;&lt;volatility&gt;&lt;implied-volatility&gt;&lt;trading&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35805" PostTypeId="1" CreationDate="2017-08-28T04:44:30.277" Score="-1" ViewCount="444" Body="&lt;p&gt;This is John Hull's book &lt;code&gt;Options, Futures and Other Derivatives  9th&lt;/code&gt; &lt;code&gt;Page 549&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The process of calculating the &lt;code&gt;Asset Swap Spreads.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;$1+V$ the discounted value of floating rate paying of &lt;code&gt;LIBOR+premium&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$B^*$ the discounted value of fixed rate paying&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$B$ is the current value of fixed rate bond&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$1$ is the current value of floating rate bond(value at par)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;As my understanding, floating rate paying will spend $1$ to buy the floating rate bond and receive the money $B^*;$ and fixed rate paying will spend $B$ to buy the fixed rate bond and receive the money $1+V.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the relation should be&#xA;$$-1 + B^* = - B + (1+V),$$&#xA;something reverse from the following result, I must misunderstand somewhere?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ZEoNT.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ZEoNT.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-09-27T10:03:39.240" Title="Asset Swap Spreads" Tags="&lt;credit-risk&gt;&lt;default-risk&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35806" PostTypeId="1" CreationDate="2017-08-28T05:12:05.020" Score="2" ViewCount="383" Body="&lt;p&gt;I have been using this superdiversified 10 ETFs portfolio.&lt;br&gt;&#xA;To lower the risk it's composed from stocks and bonds across the globe and includes some commodities.&lt;br&gt;&#xA;Being in USD currency and the Euro being on the rise I wanted to find equivalents ETFs (tracking the same indexes) in Euros.&lt;br&gt;&#xA;Where could I find the equivalents ETFs I could buy in Europe (ideally from France) ?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+--------+--------------------------------------------------+-------------+&#xA;| ticker | Exchange-traded Fund                             | Percent (%) |&#xA;+--------+--------------------------------------------------+-------------+&#xA;| BWX    | SPDR Bloomberg Barclays Intl Treasury Bond       |  13         |&#xA;| EMLC   | VanEck Vectors JP Morgan Emer Mkts Loc Curr Bond |  10         |&#xA;| BND    | Vanguard Total Bond Market                       |   9         |&#xA;+--------+--------------------------------------------------+-------------+&#xA;| IAU    | iShares Gold Trust                               |  11         |&#xA;| DBC    | PowerShares DB Commodity Tracking                |   5         |&#xA;+--------+--------------------------------------------------+-------------+&#xA;| VEU    | Vanguard FTSE All-World ex-U.S.                  |  17         |&#xA;| VWO    | Vanguard FTSE Emerging Markets Index             |  14         |&#xA;| VNQI   | Vanguard Global ex-U.S. Real Estate              |   4         |&#xA;| VNQ    | Vanguard REIT                                    |   6         |&#xA;| VTI    | Vanguard Total Stock Market                      |  11         |&#xA;+--------+--------------------------------------------------+-------------+&#xA;| Composite Portfolio                                       | 100         |&#xA;+-----------------------------------------------------------+-------------+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="28677" LastEditorUserId="24222" LastEditDate="2017-08-28T08:06:37.293" LastActivityDate="2018-09-23T01:01:05.617" Title="Where can I find the European equivalents ETFs from a USD superdiversified 10 ETFs portfolio" Tags="&lt;portfolio-management&gt;&lt;portfolio-optimization&gt;&lt;portfolio&gt;&lt;etf&gt;&lt;portfolio-selection&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35807" PostTypeId="1" CreationDate="2017-08-28T07:15:17.477" Score="1" ViewCount="307" Body="&lt;p&gt;Does the discount curve used for discounting cash flows have to be a zero coupon, annual compounding, actual by actual day basis curve? In practice, does a curve used for discounting necessarily have certain attributes, if so what are those? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, how can we convert a curve from one compounding and day count to another compounding and day count?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am working on IFRS 13 where I need to compute discounted cash flows to measure fair value of an asset/liability.  I have tried to find answers to these questions but have not found anything conclusive. There is mention on how to convert a discount rate from one day count to another but not a discount curve and also not  while taking into consideration the compounding change as well. &lt;/p&gt;&#xA;" OwnerUserId="29370" LastActivityDate="2017-11-26T10:03:47.983" Title="Characteristics of a Discount Curve" Tags="&lt;discounting&gt;&lt;present-value&gt;&lt;discount-factor-curve&gt;&lt;daycounting&gt;&lt;compounding&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35808" PostTypeId="2" ParentId="35807" CreationDate="2017-08-28T08:06:33.183" Score="2" Body="&lt;p&gt;By no arbitrage, market participants need to agree on the values of the discount factor, even if they are using different conventions (day count, compounding period) to convert the discount factor into a rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, consider two discount factors computed using continuous compounding, where one is computed using the 30/360 day count (year fraction $t_{30/360}$) and the other is using ACT/365 (year fraction $t_{ACT/365}$). Then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;d_{30/360} = e^{-r_{30/360} t_{30/360}} \\&#xA;d_{ACT/365} = e^{-r_{ACT/365} t_{ACT/365}}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and by no arbitrage, you must have $d_{30/360} = d_{ACT/365}$ and hence&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;e^{-r_{30/360} t_{30/360}} = e^{-r_{ACT/365} t_{ACT/365}}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which implies that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;r_{30/360} = \frac{t_{ACT/365}}{t_{30/360}} r_{ACT/365}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, consider a continuous rate $r_c$ and a rate compounded $k$ times per year, $r_k$ where the year fraction is $t$ and the number of periods is $n=kt$.  Then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;d_c = e^{-r_ct}\\&#xA;d_k = \left( 1 + \frac{r_k}{k} \right)^{-kt}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and by no arbitrage, $d_c=d_k$, so&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;e^{-r_ct} = \left( 1 + \frac{r_k}{k} \right)^{-kt}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which implies that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;r_c = k\log\left( 1 + \frac{r_k}{k} \right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;r_k = k \left( e^{r_c/k} - 1 \right)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general, to convert from one rate convention to another, write the expression for the discount factor in terms of the rate in each convention, equate the two expressions, and solve for one rate in terms of the other.&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2017-08-28T08:06:33.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35809" PostTypeId="2" ParentId="35805" CreationDate="2017-08-28T08:18:51.707" Score="0" Body="&lt;p&gt;The asset swap spread is a function of the riskiness of the bond.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;floating rate paying will spend 1 to buy the floating rate bond and receive the money $B^∗$;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;If he is the floating rate payer he is short the floating bond, not long.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the floating rate paying leg he pays $1$ and he receives $1 + V$ (PV of Libor + Spread). The fixed rate receiver (same person) is long the risky fixed rate bond which costs $B$ and its payments (risk free) are worth $B^*$. With this reasoning you can go directly to $V = B^* - B$ by the way (floating rate pay leg present value is $1+V-1 = V$, fixed rate receive leg market present value is $B^* - B$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Pay $1 + B^*$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Receive $1 + V + B$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just reorganize $1 + V = B^* + 1 - B$&lt;/p&gt;&#xA;" OwnerUserId="1181" LastEditorUserId="16148" LastEditDate="2017-09-27T10:03:39.240" LastActivityDate="2017-09-27T10:03:39.240" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35811" PostTypeId="2" ParentId="35806" CreationDate="2017-08-28T12:44:15.060" Score="1" Body="&lt;p&gt;You can find the tracked indices on bloomberg. Just open the corresponding ticker and type comp or get the field FUND_BENCHMARK_PRIM if you dont know it already.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are several pages such as etfdb.com or morningstar for example where you can search ETFs by benchmark. Just pick your benchmark and choose an ETF from the list that is suitable for your needs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will need to make small concessions though I guess. For some of these will not have a widely accepted benchmark and there wont be other suitable products.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The DBC is such a case. Since it &quot;tracks&quot; a proprietary index, there will not be a like for like replacement. (probably you can buy this one in France anyway, but you see my point)&lt;/p&gt;&#xA;" OwnerUserId="2727" LastActivityDate="2017-08-28T12:44:15.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35814" PostTypeId="2" ParentId="35804" CreationDate="2017-08-28T14:52:26.100" Score="3" Body="&lt;p&gt;Let's first discuss how author arrived at equation 1 and 2. It is based on the fact that if &lt;span class=&quot;math-container&quot;&gt;$X \sim N(0, \sigma^2)$&lt;/span&gt;, then &lt;span class=&quot;math-container&quot;&gt;$ Y = |X|$&lt;/span&gt; follows &lt;a href=&quot;https://en.wikipedia.org/wiki/Half-normal_distribution&quot; rel=&quot;nofollow noreferrer&quot;&gt;half-normal distribution&lt;/a&gt;. In your question, &lt;span class=&quot;math-container&quot;&gt;$X$&lt;/span&gt; is daily return (ie &lt;span class=&quot;math-container&quot;&gt;$R_t$&lt;/span&gt;).&#xA;It can be shown that&#xA;&lt;span class=&quot;math-container&quot;&gt;$$E(|X|) = \sqrt{\frac{2}{\pi}} \sigma \tag{equation 1}$$&lt;/span&gt;&#xA;this provides&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\sigma  = E(|X|) \cdot\sqrt{\frac{\pi}{2}}  $$&lt;/span&gt;&#xA;For sample data&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\hat{\sigma} = 1/N\sum_{I =1}^{N} |X_i| \cdot \sqrt{\frac{\pi}{2}}    $$&lt;/span&gt;&#xA;where &lt;span class=&quot;math-container&quot;&gt;$\hat{\sigma}$&lt;/span&gt; is estimator of daily volatility. Assuming 252 days in a year, this provides (assuming &lt;span class=&quot;math-container&quot;&gt;$X_i's$&lt;/span&gt; are i.i.d.)&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\sigma_{annual} = \sqrt{252} \hat{\sigma} = 19.896 \cdot 1/N\sum_{I =1}^{N} |X_i| \tag{equation 2} $$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;p&gt;You also asked, which approach is more correct. For asymptotic large &lt;span class=&quot;math-container&quot;&gt;$N$&lt;/span&gt; both approach are equivalent and will provide same estimator. Under the first approach volatility is defined as average of square root of return, whereas under the second approach volatility is simply average of absolute return. Notice, &lt;span class=&quot;math-container&quot;&gt;$$1/N \sum_{I=1}^{N} |X_i| \leq \sqrt{1/N \sum_{I=1}^{N} X_i^2}$$&lt;/span&gt;&#xA;I think this provide nice relationship between  standard&#xA;deviation and absolute standard deviation.&lt;/p&gt;&#xA;" OwnerUserId="16991" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2017-09-01T09:33:10.763" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35817" PostTypeId="1" AcceptedAnswerId="35818" CreationDate="2017-08-28T17:04:19.167" Score="2" ViewCount="594" Body="&lt;p&gt;I am calibrating a 3-parameter stochastic model to options market data via Monte Carlo simulation. Let the parameter set be denoted by $\bar{\theta}$. (this is not a simple Black-Scholes type model, so MC calibration is the only possible way of calibrating this model)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, my question is whether I should have a fixed seed for my objective function evaluation, with the objective function being the mean squared error between the simulated options value and the market implied options value. Meaning that every time my optimizer makes a call to the objective function with a perturbed parameter set $\theta+\delta$, I am using the same random numbers. Effectively eliminating Monte Carlo noise. But is this 'cheating', if so the use of finite difference gradients for this type of problems are useless (or?)&lt;/p&gt;&#xA;" OwnerUserId="29379" LastActivityDate="2017-08-28T17:40:50.320" Title="Calibration by monte carlo, should I fix my seed?" Tags="&lt;options&gt;&lt;stochastic-processes&gt;&lt;market-data&gt;&lt;monte-carlo&gt;&lt;calibration&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35818" PostTypeId="2" ParentId="35817" CreationDate="2017-08-28T17:40:50.320" Score="6" Body="&lt;p&gt;It is not cheating. It allows you to make your results (e.g. prices, calibrated parameters) 'reproducible' which is good. However, fixing the seed can hide convergence issues. When the variance of your Monte Carlo estimator is large, picking different seeds could yield drastically different results. So be careful. In practice you can obviously solve this by increasing the number of simulations (hence decreasing the estimator's variance).&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2017-08-28T17:40:50.320" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35819" PostTypeId="1" AcceptedAnswerId="35822" CreationDate="2017-08-28T18:26:14.020" Score="2" ViewCount="353" Body="&lt;p&gt;I don't do any financial trading, and this question came up to me as I was browsing through some questions on this SE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A general sentiment I felt after reading though several questions on this SE, is that algorithmic trading strategies generally won't remain as effective as they were during backtesting, or after some time in deployment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On some intuitive level I can understand why that might be the case, it just seems odd. But I was wondering if there is some in-depth reasoning on why this is the case.&lt;/p&gt;&#xA;" OwnerUserId="29301" LastActivityDate="2017-08-29T03:19:19.773" Title="Why do trading strategies lose effectiveness over time?" Tags="&lt;quant-trading-strategies&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35820" PostTypeId="2" ParentId="35806" CreationDate="2017-08-28T18:29:35.227" Score="1" Body="&lt;p&gt;As you said, this portfolio is well diversified across the world, so I would not worry about currency risk unduly. However, if you are not happy with the currency exposure it gives you, you could change it by using a &quot;currency overlay&quot;, that is add currency futures or forwards to bring the exposure to whatever you wish.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2017-08-28T18:29:35.227" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35821" PostTypeId="1" CreationDate="2017-08-28T19:15:14.377" Score="1" ViewCount="172" Body="&lt;p&gt;I am analysing the four commonly used asset pricing models (CAPM, F3F, C4F, F5F) to determine which one is most effective.I have performed time series regressions on the 25 value weighted portfolios sorted on size and book to market equity. the coefficients for the market risk premium, smb and hml,umd,rmw, cma are examined and compared. From the regression results, the carhart four factor model seems to the most efective one (R2, coefficient,  χ2 test are better than the rest of the models). Im not sure if my results is in line with literatures. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any literature with regards to a comparision of the performance of the four asset pricing in US?&lt;/p&gt;&#xA;" OwnerUserId="28923" LastActivityDate="2017-10-27T22:41:28.843" Title="Comparison of the four asset pricing models" Tags="&lt;asset-pricing&gt;&lt;fama-french&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35822" PostTypeId="2" ParentId="35819" CreationDate="2017-08-28T19:16:58.463" Score="15" Body="&lt;p&gt;There are two key concerns (which in practice, may be difficult to distinguish):&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Previous research overestimated an effect.&lt;/li&gt;&#xA;&lt;li&gt;The effect shrinks over time.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h3&gt;1. Problems with reproducibility and replicability&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Previous research may have found an effect, but was the effect &lt;em&gt;really&lt;/em&gt; there? There may be problems with:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Reproducing results using the same data.&lt;/li&gt;&#xA;&lt;li&gt;Replicating a result using new data.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Because of errors or problems in analysis, results may not be reproducible even with the same data. For example, failure to account for cross-sectional correlation in financial return data can easily lead to standard-errors that are off by factor of 10.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because of what Andrew Gelman calls &lt;a href=&quot;http://www.stat.columbia.edu/~gelman/research/unpublished/p_hacking.pdf&quot; rel=&quot;noreferrer&quot;&gt;&lt;em&gt;the garden of forking paths&lt;/em&gt;&lt;/a&gt;, all the choices a researcher must make can lead even a capable, honest researcher to find &quot;statistically significant&quot; results that aren't replicable in new data. In finance, it's not hard to find a trading strategy which through pure luck would have made obscene amounts of money in the past (and there are many people looking)! If I started a VC fund today that will only invest in startups where the co-founders are named Sergei and Larry, you might rightly question how well a back test is estimating expected returns. The numerous degrees of freedom one has when building trading strategies creates what Gelman would call a garden of forking paths.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These are especially &lt;a href=&quot;https://www.nature.com/news/over-half-of-psychology-studies-fail-reproducibility-test-1.18248&quot; rel=&quot;noreferrer&quot;&gt;prominent problems in psychology&lt;/a&gt; but also &lt;a href=&quot;http://www.nature.com/news/1-500-scientists-lift-the-lid-on-reproducibility-1.19970&quot; rel=&quot;noreferrer&quot;&gt;pervasive throughout science&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;h3&gt;2. The effect shrinks over time&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Another issue especially pertinent to trading (and much of social science) is that if an effect is based upon people making errors, there's the potential for people to wisen up once the effect becomes widely enough understood.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If small stocks declined in December and advanced in January due to tax-loss selling and subsequent repurchasing, will those effects persist once more traders and investors are aware?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the finance context, distinguishing between (1) and (2) may be difficult (or practically, may not even matter). To some extent, everyone in macro-finance uses the same dataset: worldwide financial data. To obtain new data, we must all wait for the passage of time.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;References&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Gelman, Andrew and Eric Loken, &lt;a href=&quot;http://www.stat.columbia.edu/~gelman/research/unpublished/p_hacking.pdf&quot; rel=&quot;noreferrer&quot;&gt;&quot;The garden of forking paths&quot;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mclean, David R. and Jeffrey Pontiff, 2016, &quot;Does Academic Research Destroy Stock Return Predictability?&quot; Journal of Finance&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Peng, Roger D., 2009, &quot;Reproducible research and Biostatistics,&quot; &lt;em&gt;Biostatistics&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-08-29T03:19:19.773" LastActivityDate="2017-08-29T03:19:19.773" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35823" PostTypeId="1" CreationDate="2017-08-28T19:36:44.010" Score="2" ViewCount="401" Body="&lt;p&gt;I am trying to find a way to create Real Estate Index using Python 3.6 for my high school project.&#xA;I have a csv file with the following columns:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Date of Sale&lt;/li&gt;&#xA;&lt;li&gt;Amount&lt;/li&gt;&#xA;&lt;li&gt;Type (Commercial/Residential/Industrial)&lt;/li&gt;&#xA;&lt;li&gt;State&lt;/li&gt;&#xA;&lt;li&gt;Number of Investor&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I want to create an index for each of the different types of properties, and then also compare it to the S&amp;amp;P 500, using data since about 2005.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;I have been learning from Python for Finance by Yves Hilpisch, but cannot find mention of creating a custom index.&lt;/li&gt;&#xA;&lt;li&gt;So far, I created a moving average of quarterly transactions, and it does show a very good visual and a near complete slowdown between 2007 to 2010. But is that a real index?&lt;/li&gt;&#xA;&lt;li&gt;My Y-Axis is in the Millions, but I would like it to be a much smaller number like the S&amp;amp;P 500. Can I just divide all cumulative figures by 10^6?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Could someone point me to some good (and free since my allowance is small) resource to learn about this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you so much.&lt;/p&gt;&#xA;" OwnerUserId="29380" LastActivityDate="2017-11-26T22:06:01.010" Title="Real Estate Index in Python" Tags="&lt;python&gt;&lt;index&gt;&lt;indexes&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35825" PostTypeId="2" ParentId="35823" CreationDate="2017-08-28T20:40:39.133" Score="3" Body="&lt;p&gt;I suppose you don't have to constrain yourself to that specific data, so you could refer to the &lt;a href=&quot;https://www.census.gov/topics/housing.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Census Bureau&lt;/a&gt; if you need more data. Moreover, you can search on Google for ''housing index methodology'' if you want references on how to build professional indexes. Personally, I think it would be great practice to replicate an index for your high-school project (remember to state in your work that it is not an original idea and to quote the sources). However, your teacher might think it is better that you come up with something yourself, even if not so elaborate. In that case, I would suggest you think about the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Which variables are useful, and for what they are used. Here are some guidelines:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;date: to see the evolution in time, but also allows you to aggregate by period and see: if you have seasonality, if the annual/quarterly count of transactions has increased or decreased, the time between transactions, etc.&lt;/li&gt;&#xA;&lt;li&gt;amount: by the amount, you can cathegorize within the three categories that you already have and possibly distinguish whether the real estate being bought/sold is cheap or luxury (this is a good indicator of the state of the economy)&lt;/li&gt;&#xA;&lt;li&gt;type: compare with indexes related to each one (confidence indexes, activity indexes, etc)&lt;/li&gt;&#xA;&lt;li&gt;state: some regions are more industrial, while others are more residential. Your index could indicate the market evolution in each state by pointing out the evolution of activity for each of the three categories;&lt;/li&gt;&#xA;&lt;li&gt;number of investor: some investors buy one house to live in and that is it, while others might do this as a business. If a number only appears once in the dataset, you probably have the first case, while if it appears many times you are probably facing an institutional investor.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;2) An index should give you a quick assessment of the market over time. You should be able to compare two moments and tell whether the market is better or worse (should you invest in it or not), but you might also want to build something that gives more details on the market that you are observing.&lt;/p&gt;&#xA;" OwnerUserId="29189" LastActivityDate="2017-08-28T20:40:39.133" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35826" PostTypeId="2" ParentId="35821" CreationDate="2017-08-28T20:45:23.710" Score="2" Body="&lt;p&gt;You can read &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S0927539803000446&quot; rel=&quot;nofollow noreferrer&quot;&gt;Capocci and Hubner (2004)&lt;/a&gt; for a comparison of these models on hedge fund performance.&lt;/p&gt;&#xA;" OwnerUserId="29189" LastActivityDate="2017-08-28T20:45:23.710" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35828" PostTypeId="1" AcceptedAnswerId="35829" CreationDate="2017-08-29T00:25:59.040" Score="1" ViewCount="541" Body="&lt;p&gt;Let $S$ be a GBM with dynamics $dS_t/S_t=rdt+\sigma dW_t$. We want to compute the following expected value:&#xA;\begin{align*}&#xA;\mathbb{E}(S_T\log(S_T)).&#xA;\end{align*}&#xA;Using a change of measure we can write&#xA;\begin{align*}&#xA;\mathbb{E}(S_T\log(S_T)) &#xA;=S_0\mathbb{\widehat E}(\log(S_T)) &#xA;\end{align*}&#xA;where $\mathbb{\widehat P}$ is the measure with $S$ as numeraire. How do we finish this problem? What are the dynamics of $(\log(S_t))_{t\geq 0}$ under $\mathbb{\widehat P}$?&lt;/p&gt;&#xA;" OwnerUserId="26887" LastEditorUserId="1809" LastEditDate="2017-08-29T03:54:44.063" LastActivityDate="2017-08-29T04:24:10.897" Title="Change-of-measure: Dynamics of $\log(S_t)$ with $S_t$ as numeraire" Tags="&lt;stochastic-calculus&gt;&lt;risk-neutral-measure&gt;&lt;sde&gt;&lt;numerairechange&gt;&lt;girsanov&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2017-08-29T17:47:51.820" ContentLicense="CC BY-SA 3.0" />
  <row Id="35829" PostTypeId="2" ParentId="35828" CreationDate="2017-08-29T01:11:15.450" Score="6" Body="&lt;p&gt;Under the stock numeraire measure, $\frac{B_t}{S_t}$ is a Martingale. We can compute $$d\frac{B_t}{S_t}= \frac{1}{S_t}dB_t -\frac{1}{S_t^2}B_tdS_t+\frac{1}{S_t^3}B_t\sigma^2S_t^2dt\\=\frac{B_t}{S_t}\left(rdt -\mu dt -\sigma dW_t +\sigma^2dt\right)$$ so the growth rate $\mu$ that makes this a Martingale is $$ \mu = r+\sigma^2.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the growth rate of the stock under the stock numeraire measure is $r+\sigma^2$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, applying Ito as usual, you can find that $\log(S_t)$ follows Brownian motion with drift $r+\frac{1}{2}\sigma^2.$ (This is in contrast to $r-\frac{1}{2}\sigma^2$ in the usual case with the bond as numeraire.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking back, I see that I missed the fine print that you called the growth rate of the stock $r$. I hope it's clear that I started in the physical measure, called the stock growth rate $\mu$ and used $r$ to refer to the risk free rate.&lt;/p&gt;&#xA;" OwnerUserId="29286" LastEditorUserId="29286" LastEditDate="2017-08-29T04:24:10.897" LastActivityDate="2017-08-29T04:24:10.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35830" PostTypeId="2" ParentId="35696" CreationDate="2017-08-29T01:52:11.523" Score="2" Body="&lt;p&gt;Imagine you hold a zero coupon bond with a certain maturity $T$ and the short rate follows a process like you specified.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might know deterministically what the cash bond pays this period, but you don't know how the interest rate itself is going to change. If the interest rate goes down, then the expectation of future rates goes down and the expected amount of interest you'd receive rolling the cash account to time $T$ goes down, so the term discount factor goes down and the term bond price goes up. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus your bond gains (or loses) value in an unpredictable way this period, depending on what interest rates do. So there is local risk in owning a bond.&lt;/p&gt;&#xA;" OwnerUserId="29286" LastEditorUserId="29286" LastEditDate="2017-08-29T16:08:48.830" LastActivityDate="2017-08-29T16:08:48.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35831" PostTypeId="2" ParentId="35802" CreationDate="2017-08-29T04:49:07.107" Score="3" Body="&lt;p&gt;Turns out Quantopian's empyrical package handles this exact use case &lt;a href=&quot;https://github.com/quantopian/empyrical&quot; rel=&quot;nofollow noreferrer&quot;&gt;Quantopian Empyrical Package&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9446" LastActivityDate="2017-08-29T04:49:07.107" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35832" PostTypeId="1" CreationDate="2017-08-29T09:16:09.453" Score="1" ViewCount="679" Body="&lt;p&gt;I am having troubles with the calculation of the PRIIPs stress performance scenario so I would appreciate any help. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as I understand from the formula, the stress calculation, unlike the calculation of the other scenarios, depends on the length of the recommended holding period (RHP). I deduct that based on paragraph 10.b. of Annex IV of the RTS which states that the historical lognormal returns from t0 to tN have to be identified. Is N to be understood as “number of trading periods in the recommended holding period” (as defined in Annex II, paragraph 12). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. for a RHP of 1 year and assumed 252 trading days, I should identify a total of 253 returns, meaning I should have a history of 254 prices. Does this mean that for a product with a RHP of 10Y I should have 10Y of historical returns/prices? On the other hand, for the calculation of MRM and all other scenarios I can simply rely on the minimum 2Y of historical prices. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks, &#xA;Ryko&lt;/p&gt;&#xA;" OwnerUserId="15542" LastActivityDate="2019-09-01T23:02:20.367" Title="PRIIPs category 2 stress scenario calculation" Tags="&lt;regulatory-formula&gt;&lt;priips&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35834" PostTypeId="1" CreationDate="2017-08-29T13:46:16.237" Score="1" ViewCount="755" Body="&lt;p&gt;Consider the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A bond with a 9% coupon and a price of $98. Let's say the zero swap curve is flat at around 7% (e.g. the zero swap curve is high because we're at the end of a business cycle). Let's say this gives the bond a z-spread of 2%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now say the CDS spread is 7.5%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The CDS-Bond basis using the z-spread is positive (7.5-2 = 5.5%), but if we were to just use the coupon rate of 9% as our reference rate and bought both the bond and the CDS we would have a risk-less trade (ignoring upfront payments, etc.) Pocket 9%, pay out 7.5%. In the case of default, price goes from 98 to 40, but CDS pays you 60 (100-40). So what's the big deal with the z-spread?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why do we use the z-spread and not just the coupon in these scenarios?&lt;/p&gt;&#xA;" OwnerUserId="29386" LastEditorUserId="29386" LastEditDate="2017-08-29T14:31:16.887" LastActivityDate="2019-12-11T13:00:27.613" Title="Importance of z-spread in CDS-Bond Basis trading" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;cds&gt;&lt;credit&gt;&lt;credit-derivatives&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35837" PostTypeId="1" CreationDate="2017-08-29T18:45:38.367" Score="1" ViewCount="1372" Body="&lt;p&gt;What is a fast online algorithm for calculating the EWMA (exponentially weighted moving average) of an input variable observed at irregular intervals?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know the formula for when sampling at regular intervals:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Calculating alpha from halflife:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\alpha = 1 - e^{\frac{\ln{.5}}{H}}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Calculating the EWMA of x:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;E = \alpha\cdot x + (1-\alpha)\cdot E_{-1}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is an algorithm for doing the same where the sampling interval is irregular?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have found an algorithm online, which purports to achieve an irregular EWMA.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;double operator()(double x)&#xA;{&#xA;    if (isnan(prev_ewma_)) // we don't decay the first sample&#xA;    {&#xA;        prev_ewma_ = x;&#xA;        prev_time_ = Time::now();&#xA;        return x;&#xA;    }&#xA;&#xA;    double time_decay = Time::now() - prev_time_;&#xA;&#xA;    double alpha = 1 - std::exp(-time_decay / halflife_);&#xA;    double ewma  = alpha * x + (1 - alpha) * prev_ewma_;&#xA;&#xA;    prev_ewma_ = ewma;&#xA;    prev_time_ = now;&#xA;    return ewma;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Is this algorithm correct?&lt;/p&gt;&#xA;" OwnerUserId="3184" LastEditorUserId="3184" LastEditDate="2017-08-31T18:49:05.073" LastActivityDate="2020-01-14T21:57:14.003" Title="Online algorithm for calculating EWMA at irregular intervals?" Tags="&lt;time-series&gt;&lt;algorithm&gt;" AnswerCount="2" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="35838" PostTypeId="2" ParentId="35837" CreationDate="2017-08-29T19:32:03.593" Score="2" Body="&lt;p&gt;You count the number of 'unit intervals' within that irregular duration between two events and repeat the update function by the count. Amortized time is the average number of unit intervals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practical use cases, the 'unit intervals' are larger (subsampling), so this is done in amortized constant time.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="4660" LastEditDate="2017-08-29T20:57:17.423" LastActivityDate="2017-08-29T20:57:17.423" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="35840" PostTypeId="1" AcceptedAnswerId="35843" CreationDate="2017-08-30T06:43:53.280" Score="0" ViewCount="1902" Body="&lt;p&gt;Here is the &lt;code&gt;fixed coupon for CDS index&lt;/code&gt; in John Hull's book &lt;code&gt;Options, Futures and Other Derivatives  9th&lt;/code&gt; &lt;code&gt;page 580.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually, I don't much understand the goal of this part,  here is some of my understanding, I am not sure whether it is right.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume there is only one company in the index, the buyer of CDS will pay the coupon $c$ to seller every quarter until the default occurs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Seller will pay the the protection $(1-R)B$ when the default occurs. As the definition of &lt;code&gt;spread&lt;/code&gt;, seller equivalently pays the spread $s$ to buyer every quarter until the default occurs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$D$ is the present value of paying $1$ every quarter until the default occurs. So the present value of this contract of notional principle $1$ is&#xA;$$D\times (s-c)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is the amount buyer should pay for the seller at beginning.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are the above statements right? But why do we need the coupon $c?$ We can set $c=0$ to simply the process i.e there is only one cash flow from the seller during the contract.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/i36vA.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/i36vA.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-08-30T09:30:39.097" Title="Fixed coupon for CDS index" Tags="&lt;credit-derivatives&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35841" PostTypeId="1" CreationDate="2017-08-30T07:57:09.630" Score="4" ViewCount="2656" Body="&lt;p&gt;I was wondering, what is the motivation behind the payoff of the cash swaptions being multiplied by the swap annuity? &#xA;$$c(S_{\theta, T})=\sum_{i=\theta+1}^{T}\tau_i\frac{1}{{(1+S_{\theta,T}(\theta))}^{\tau_{\theta,i}}}$$&#xA;Why not using the classic one:&#xA;$$A_{t} = \sum_{i=1}^{T} P_{t,T_i}\tau_i$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance for your answer!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers&lt;/p&gt;&#xA;&#xA;&lt;p&gt;S.&lt;/p&gt;&#xA;" OwnerUserId="29396" LastActivityDate="2018-03-07T12:16:20.017" Title="Cash-settled swaptions" Tags="&lt;fixed-income&gt;&lt;derivatives&gt;&lt;swaption&gt;&lt;annuity&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35843" PostTypeId="2" ParentId="35840" CreationDate="2017-08-30T09:30:39.097" Score="2" Body="&lt;p&gt;Coupons are there to reduce the counterparty risk between the seller and the buyer. If you didn't have that 500 bp coupon on a high yield bond the protection buyer would have to make a big payment upfront then wave it goodbye when the protection seller defaults. It also helps standardizing contracts (same quarterly payments whatever the spread you entered the contract at).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's explained here &lt;a href=&quot;http://economicsofcontempt.blogspot.hk/2009/01/upfront-cds-with-fixed-coupons.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://economicsofcontempt.blogspot.hk/2009/01/upfront-cds-with-fixed-coupons.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1181" LastActivityDate="2017-08-30T09:30:39.097" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="35845" PostTypeId="1" CreationDate="2017-08-30T10:33:54.963" Score="1" ViewCount="1810" Body="&lt;p&gt;Which are the steps to compute the theta greek from the BS solution:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$c(t, x) = xN(d_+(T-t,x)) - K e ^{-r(T-t)}N(d_-(T-t,x))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ d_\pm (T-t, x) = \dfrac{1}{\sigma \sqrt{T-t}} \left[ \ln \left( \dfrac{x}{K} \right) + \left( r \pm \dfrac{\sigma^2}{2} \right) (T-t) \right] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that the answer is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ c_t(t,x) = -rKe^{-r(T-t)}N(d_-(T-t,x)) - \dfrac{\sigma x}{2 \sqrt{T-t}}N'(d_+(T-t,x)) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, form me it is clear how to obtain the first term: $-rKe^{-r(T-t)}N(d_-(T-t,x))$; the problem is how I can derive $d_-(T-t,x)$ in order to obtain:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ - \dfrac{\sigma x}{2 \sqrt{T-t}} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="25754" LastEditorUserId="25754" LastEditDate="2017-08-30T12:44:37.520" LastActivityDate="2018-08-24T20:38:33.773" Title="How to derive the Greek theta from Black-Scholes solution formula?" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;greeks&gt;&lt;self-study&gt;&lt;proof&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35849" PostTypeId="1" CreationDate="2017-08-30T14:22:42.700" Score="2" ViewCount="211" Body="&lt;p&gt;I have an unusual request/question. I was wondering if anyone here could recommend me some books about risk management and equity derivatives.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am about to do an internship as a risk analyst on an Equity derivatives desk and I am looking for any book, resources that could prepare me for the job&lt;/p&gt;&#xA;" OwnerUserId="27208" LastEditorUserId="467" LastEditDate="2017-08-31T01:41:39.163" LastActivityDate="2017-08-31T01:41:39.163" Title="What are good risk management books or docs?" Tags="&lt;risk-management&gt;&lt;derivatives&gt;&lt;reference-request&gt;&lt;books&gt;" AnswerCount="1" CommentCount="5" ClosedDate="2017-08-31T01:44:04.907" ContentLicense="CC BY-SA 3.0" />
  <row Id="35851" PostTypeId="1" CreationDate="2017-08-30T14:53:10.940" Score="2" ViewCount="139" Body="&lt;p&gt;Are there any publicly available data on [aggregate] profits for domestic US banks, especially quarterly data? Most studies that I know use the &quot;Financial Statements of Banks&quot; from the OECD but these are only annual data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apart from [this] the Board of Governors of the FED is releasing the &quot;The Financial Accounts of the United States&quot; (source: &lt;a href=&quot;https://www.federalreserve.gov/releases/Z1/current/default.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.federalreserve.gov/releases/Z1/current/default.htm&lt;/a&gt;). For the data download program see: &lt;a href=&quot;https://www.federalreserve.gov/datadownload/Choose.aspx?rel=Z1&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.federalreserve.gov/datadownload/Choose.aspx?rel=Z1&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately I can't really find any useful data on profits for domestic banks. FRED has only data on Net-interest income or Income for domestic banks but this data are not very helpful &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any suggestions? &lt;/p&gt;&#xA;" OwnerUserId="28219" LastEditorUserId="16148" LastEditDate="2017-08-30T18:31:22.177" LastActivityDate="2018-12-27T20:23:48.773" Title="Profits of US Banks" Tags="&lt;data&gt;&lt;market-data&gt;&lt;banks&gt;" AnswerCount="3" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35855" PostTypeId="2" ParentId="35851" CreationDate="2017-08-30T19:23:32.377" Score="4" Body="&lt;p&gt;You might want to check what &lt;a href=&quot;https://www.fdic.gov/bank/statistical/guide/data.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;FDIC&lt;/a&gt; has. They have a lot of quarterly data for bank balance sheets. Unfortunately, I don't think they have data for all US banks, only the ones they insure. &lt;/p&gt;&#xA;" OwnerUserId="29189" LastActivityDate="2017-08-30T19:23:32.377" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35856" PostTypeId="2" ParentId="35849" CreationDate="2017-08-30T19:29:13.607" Score="2" Body="&lt;p&gt;I believe that 'Derivatives Markets' by McDonald and 'Options Futures and other Derivatives' by Hull are both good books if you want to refresh your memory.&lt;/p&gt;&#xA;" OwnerUserId="29189" LastActivityDate="2017-08-30T19:29:13.607" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35857" PostTypeId="2" ParentId="35841" CreationDate="2017-08-30T20:55:27.317" Score="6" Body="&lt;p&gt;The advantage of cash-settled swaptions is that the payoff only depends on one variable: the corresponding swap rate which is directly observable in the market:&#xA;$$&#xA;   \mathrm{Payoff}(T) = f(S_T) = A^{\mathrm{Cash}}(S_T)\max(S_T - K,0)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The payoff of a physical swaption on the other hand depends on the physical annuity which is not directly observable. You typically have to bootstrap the discount curve to get all the discount factors and sum those to get the value of the annuity. The cash-settled annuity is the approximation corresponding to a flat curve with zero rate $S_T$ (and zero funding basis spread).  &lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2017-08-30T20:55:27.317" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35861" PostTypeId="1" CreationDate="2017-08-31T12:56:00.540" Score="2" ViewCount="593" Body="&lt;p&gt;I am currently to create my own volatility smile for cryptocurrency options. I am basically reading the bids and offers and calculating the implied volatilities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I now want to shape and parametrise my own volatility smile. What is a good way to do it? I tried the Corrado-Su Model, but I was not too happy about the results. Currently I use something simple:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma(X) = \sigma_{ATM} \times (F/X)^{1-\beta}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $X$ = Strike and $F$ = Underlying Price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, having only 1 parameter ($\beta$) to calibrate is a bit small.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any other simple implementations to build a volatility smile?&lt;/p&gt;&#xA;" OwnerUserId="29408" LastEditorUserId="16148" LastEditDate="2017-08-31T16:44:44.203" LastActivityDate="2017-09-01T06:40:53.307" Title="Build Implied Volatility Smile" Tags="&lt;option-pricing&gt;&lt;volatility&gt;&lt;black-scholes&gt;&lt;implied-volatility&gt;&lt;bitcoin&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35862" PostTypeId="1" CreationDate="2017-08-31T14:06:08.180" Score="2" ViewCount="258" Body="&lt;p&gt;It is well-known that for the calculation of potential future exposure (PFE), real-word probability measure should be used to scenario-generation and risk-neutral measure is used for revaluation; see e.g. J.Hull &quot;Financial Risk Management and Financial Institutions&quot;-chapter 7. Now, the point is how we should go about calibrating real-world parameters, e.g. drift. I know that this task is not obvious. Can anyone explain to me the following points:&#xA;a) For which classes of risk factor, it is OK to just calibrate drift to historical data, e.g. using simple average?&#xA;b) For risk factors that are hard to obtain estimates of drift from historical data, what is the best practice to tackle this? Any good reference would be highly appreciated.&lt;/p&gt;&#xA;" OwnerUserId="29310" LastActivityDate="2017-08-31T14:06:08.180" Title="Calibration of real-world drift for PFE" Tags="&lt;calibration&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35863" PostTypeId="1" CreationDate="2017-08-31T14:06:48.883" Score="4" ViewCount="436" Body="&lt;p&gt;I have a given trading strategy T and say 3 assets in my universe. The hold time is one day. The trading strategy can general signals for the 3 assets in any given day (so signal can trigger for any one or all 3). In case the signal is generated for more than one asset, the goal is to find the optimal capital allocation between the two (or three) assets, according to &quot;some&quot; criterion&quot;. One criterion could be minimizing overall return variance where return is the yearly return of the strategy say. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We are given historical OHLC data for the 3 assets. So it is possible to compute daily return series, and the variance/covariance between the returns across the 3 assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In general I want to apply mean variance to the problem but am a bit confused when it comes to treating the dynamic nature of the problem (its not as simple as optimizing a portfolio of assets). The signal generation is conditioned on some events being true so its stochastic. I can set up a backtest and compute the realized returns (keeping weights on the assets unknowns, in days where signals came for two/three assets say). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am curious if someone can help structure the problem or drop some pointers to set it up. Is this in the camp of Stochastic dynamic asset allocation?&lt;/p&gt;&#xA;" OwnerUserId="4843" LastActivityDate="2018-02-07T21:17:43.153" Title="Portfolio diversification and Sharpe ratio" Tags="&lt;optimization&gt;&lt;variance&gt;&lt;mean&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35865" PostTypeId="2" ParentId="21215" CreationDate="2017-08-31T16:39:43.433" Score="6" Body="&lt;p&gt;I know this was asked almost two years ago, but I thought I'd answer the question. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It appears that the H that you want to estimate is identical to the values you received from the Johansen test, with the exception of rows 1:4 and columns 2:4. You only need to set those values to zeroes and ones, which is fairly easy considering that the diagonal is (very nearly) one and the other values are small enough that they can be rounded to where they need to be.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Code for that:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Set H to found cointegrating vectors&#xA;H &amp;lt;- vecm$beta &#xA;&#xA;# Replace needed rows with rounded values&#xA;H[1:4, 2:4] &amp;lt;- round(H[1:4, 2:4])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This has the effect of creating the intended restriction matrix, which looks like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;                  ect1        ect2        ect3      ect4&#xA;y1.l1     1.000000e+00  0.00000000  0.00000000  0.000000&#xA;y2.l1     6.001737e-17  1.00000000  0.00000000  0.000000&#xA;y3.l1    -2.103352e-17  0.00000000  1.00000000  0.000000&#xA;y4.l1     3.744563e-17  0.00000000  0.00000000  1.000000&#xA;y5.l1    -9.857458e-01 -1.00335472 -1.01229025 -1.066448&#xA;constant  5.632217e-02  0.02311308  0.07969588 -0.519249&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, running the &lt;code&gt;blrtest&lt;/code&gt; function:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;blrresult &amp;lt;- blrtest(jcointt, H, 4)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And it's result:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; summary(blrresult)&#xA;&#xA;###################### &#xA;# Johansen-Procedure # &#xA;###################### &#xA;&#xA;Estimation and testing under linear restrictions on beta &#xA;&#xA;The VECM has been estimated subject to: &#xA;beta=H*phi and/or alpha=A*psi&#xA;&#xA;                  ect1        ect2        ect3      ect4&#xA;y1.l1     1.000000e+00  0.00000000  0.00000000  0.000000&#xA;y2.l1     6.001737e-17  1.00000000  0.00000000  0.000000&#xA;y3.l1    -2.103352e-17  0.00000000  1.00000000  0.000000&#xA;y4.l1     3.744563e-17  0.00000000  0.00000000  1.000000&#xA;y5.l1    -9.857458e-01 -1.00335472 -1.01229025 -1.066448&#xA;constant  5.632217e-02  0.02311308  0.07969588 -0.519249&#xA;&#xA;Eigenvalues of restricted VAR (lambda):&#xA;[1] 0.2009 0.1479 0.1410 0.0963&#xA;&#xA;The value of the likelihood ratio test statistic:&#xA;0 distributed as chi square with 8 df.&#xA;The p-value of the test statistic is: 1 &#xA;&#xA;Eigenvectors, normalised to first column&#xA;of the restricted VAR:&#xA;&#xA;            [,1]    [,2]    [,3]    [,4]&#xA;y1.l1     1.0000  1.0000  1.0000  1.0000&#xA;y2.l1    -0.7020  1.1557 -0.2307 -3.3582&#xA;y3.l1     0.5135 -0.3613 -0.2651 -6.0261&#xA;y4.l1    -0.2599  0.1480  2.9151 -1.5204&#xA;y5.l1    -0.5241 -1.9374 -3.5946 10.1052&#xA;constant  0.2160 -0.0226 -1.4838  0.2879&#xA;&#xA;Weights W of the restricted VAR:&#xA;&#xA;        [,1]    [,2]    [,3]   [,4]&#xA;y1.d -0.2594 -0.1574  0.0141 0.0035&#xA;y2.d  0.1290 -0.1118  0.0467 0.0214&#xA;y3.d -0.1813  0.0618  0.0085 0.0302&#xA;y4.d  0.0270  0.0014 -0.0560 0.0097&#xA;y5.d -0.0629 -0.0009  0.0254 0.0065&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Hopefully this helps you or someone else.&lt;/p&gt;&#xA;" OwnerUserId="19823" LastActivityDate="2017-08-31T16:39:43.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35868" PostTypeId="1" CreationDate="2017-08-31T19:09:39.300" Score="1" ViewCount="284" Body="&lt;p&gt;I've seen charts of implied vol (IV) against realized volatility?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What time frames do people generally use to calculate each?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, do people generally use ATM 1 month call options to get IV, then compare it with realized volatility 30 days down the line? I.e. get the two time series for IV and realized vol and shift the former back by 30 data points?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What time frame is generally used to calculate realized volatility? A 30 day window, longer, shorter..?&lt;/p&gt;&#xA;" OwnerUserId="29386" LastActivityDate="2017-08-31T19:09:39.300" Title="Time frame for implied vs realized vol" Tags="&lt;options&gt;&lt;volatility&gt;&lt;implied-volatility&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35870" PostTypeId="2" ParentId="11264" CreationDate="2017-08-31T20:29:31.103" Score="9" Body="&lt;p&gt;I believe that the answers given here are incorrect as they return the sample standard deviation while the the population measure is the correct calculation for Bollinger Bands. The bands usign the sample calc will be too wide. Pandas does not appear to allow a choice between the sample and population calculations for either solution presented here.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sd = pd.stats.moments.rolling_std(price,length)&#xA;rolling_std  = stock_price.rolling(window=window_size).std()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Numpy does allow a choice, so it should be used until a proper pandas solution is presented.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;a = np.array([1,2,3,4,5])&#xA;print np.std(a, ddof=1) # sample&#xA;print np.std(a, ddof=0) # population&#xA;&amp;gt;&amp;gt;&amp;gt; &#xA;1.58113883008&#xA;1.41421356237&#xA;&amp;gt;&amp;gt;&amp;gt; &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://docs.scipy.org/doc/numpy/reference/generated/numpy.std.html&quot; rel=&quot;noreferrer&quot;&gt;https://docs.scipy.org/doc/numpy/reference/generated/numpy.std.html&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;John Bollinger, CFA, CMT&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well, it appears that pandas has caught up with me. This works correctly now.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;b = pd.DataFrame([1,2,3,4,5])&#xA;print b.rolling(window=5).std() # sample&#xA;print b.rolling(window=5).std(ddof=0) # population&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="29413" LastEditorUserId="29413" LastEditDate="2017-08-31T20:47:50.203" LastActivityDate="2017-08-31T20:47:50.203" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35871" PostTypeId="1" AcceptedAnswerId="35874" CreationDate="2017-08-31T20:58:39.503" Score="0" ViewCount="939" Body="&lt;p&gt;I wasn't able to find something that addressed this specifically with the search terms I was using, though I am sure an answer exists here. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;[Please reference the image below]&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Columns B &amp;amp; C are weighted asset returns (i.e. raw asset return * weight). Column D represents a portfolio of the two assets and is the sum of the weighted returns for each period. Cells B3 &amp;amp; C3 are the cumulative returns of the weighted asset returns. Cell D3 is the cumulative return of the portfolio. Cell F3 is the product of the two cumulative asset returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;QUESTION: Why are do the calculations in the yellow cells produce slightly different results?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think this may be an example of where I've forgotten some fairly basic arithmetic concepts, but intuitive explanations would greatly be appreciated. Link to spreadsheet below. Thanks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/WParf.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/WParf.png&quot; alt=&quot;Excel screenshot&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://docs.google.com/spreadsheets/d/1LwAwfg6J0FOD2Vw0URKFc5saivZB84CBU7LjNaGOOig/edit?usp=sharing&quot; rel=&quot;nofollow noreferrer&quot;&gt;Link to spreadsheet&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="25945" LastActivityDate="2017-09-01T11:43:12.480" Title="Cumulative portfolio returns vs. product of cumulative asset returns" Tags="&lt;returns&gt;&lt;portfolio&gt;&lt;asset-returns&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35872" PostTypeId="2" ParentId="35861" CreationDate="2017-09-01T06:40:53.307" Score="3" Body="&lt;p&gt;I recommend you have a look at the SABR model. &lt;a href=&quot;https://en.wikipedia.org/wiki/SABR_volatility_model&quot; rel=&quot;nofollow noreferrer&quot;&gt;Wikipedia&lt;/a&gt; is a great starting point to get the relevant literature.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The main advantage of the SABR model is that analytic approximations exist, which allow for a simple calibration. You just have to optimize the model parameters to fit your observed Call/Put prices or corresponding implied volatilities.&lt;/p&gt;&#xA;" OwnerUserId="29417" LastActivityDate="2017-09-01T06:40:53.307" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35874" PostTypeId="2" ParentId="35871" CreationDate="2017-09-01T11:43:12.480" Score="1" Body="&lt;p&gt;Mathematically you are asking:&#xA;$$\prod_i(1+B_i+C_i) &quot;=&quot; \prod_i(1+B_i)\prod_i(1+C_i)\,,$$&#xA;which usually does not happen as:&#xA;$$(1+B_i)(1+C_i)=1+B_i+C_i+B_iC_i\,,$$&#xA;so there is $B_iC_i$ factor that you are missing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuitively the product of the returns does not correspond to any investment strategy. There is no way to fix the amount of money you invest so that after an investment period you get:&#xA;$$(1+B_i)(1+C_i)\,,$$&#xA;as having the amount $(1+B_i)$ requires you to be at investment period $i+1$ when you cannot obtain a return of $C_i$ but rather $C_{i+1}$ or $B_{i+1}$. Therefore you should not expect it to be equal to the return of investing weighted amounts on your assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please check @AlexC comment, where he gives you an example of why multiplying the individual returns is an incorrect way to compute the return of the composed portfolio.&lt;/p&gt;&#xA;" OwnerUserId="25455" LastActivityDate="2017-09-01T11:43:12.480" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35878" PostTypeId="2" ParentId="35851" CreationDate="2017-09-01T14:19:44.597" Score="1" Body="&lt;p&gt;such data is provided by the SEC through their Edgar search tool, which you can find here: &lt;a href=&quot;https://www.sec.gov/edgar/searchedgar/webusers.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.sec.gov/edgar/searchedgar/webusers.htm&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Though they provide the Information as XBRL data or in form of the regular statements like those you find on the IR pages of the respective companies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Our startup SimFin, provides the kind of data you are searching for and it is for free, since we couldn't afford the pricey premium solutions back when we were students and wanted to overcome the hegemony of the data market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To this date, we have financial ratios, Financial statements (directly sourced from the SEC's XBRL data and up to 10y back) and stock prices for over 1000+ US equities, including big indices like the S&amp;amp;P 500. you can browse and compile all periods (quarterly, half-year or 9M) from fundamental financial data according to your needs and then instantly download it as excel. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, as far as the financial statements go, we display both the original as well as the standardized statements and make it transparent how we transition from one to the other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Feel free to check it out under &lt;a href=&quot;https://simfin.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://simfin.com&lt;/a&gt;&#xA;and hopefully find what you are looking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope i could help!&lt;/p&gt;&#xA;" OwnerUserId="28993" LastActivityDate="2017-09-01T14:19:44.597" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35879" PostTypeId="2" ParentId="141" CreationDate="2017-09-01T14:55:53.947" Score="4" Body="&lt;p&gt;Our startup SimFin, provides both historical and actual data for free, since we couldn't afford the pricey premium solutions back when we were students and wanted to overcome the hegemony of the data market.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To this date, we have 70+ financial ratios, Financial statements (directly sourced from the SEC's XBRL data and up to 10y back; quarterly, H1 and 9M) and stock prices for over 1000+ US equities, including big indices like the S&amp;amp;P 500. All the fundamental financial data is freely available and you can instantly download it as excel.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, as far as the financial statements go, we display both the original as well as the standardized statements and make it transparent how we transition from one to the other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Feel free to check it out under &lt;a href=&quot;http://simfin.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;simfin.com&lt;/a&gt;&#xA;and hopefully find what you are looking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the user experience and the quality of data, you shall assure yourselves of how good you estimate it and gladly provide us with valuable feedback so we can further improve our service with the power of the community.&lt;/p&gt;&#xA;" OwnerUserId="28993" LastActivityDate="2017-09-01T14:55:53.947" CommentCount="1" CommunityOwnedDate="2017-09-01T14:55:53.947" ContentLicense="CC BY-SA 3.0" />
  <row Id="35880" PostTypeId="1" AcceptedAnswerId="35934" CreationDate="2017-09-01T17:46:34.290" Score="5" ViewCount="7809" Body="&lt;p&gt;Do forward prices factor into option prices at all? It seems to me from Black-Scholes that you just need a spot price and interest rate r.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that $F_t = S_0 e^{r t}$, but I don't know if this means that option prices actually rely on traded futures to derive $r$ and then plug it into Black-Scholes or not..?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a good resource to read on the relationship between options and forwards?&lt;/p&gt;&#xA;" OwnerUserId="29386" LastEditorUserId="24222" LastEditDate="2017-09-03T12:11:42.987" LastActivityDate="2017-09-23T04:24:07.830" Title="Relationship between forward and option prices" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;interest-rates&gt;&lt;forward&gt;&lt;put-call-parity&gt;" AnswerCount="3" CommentCount="7" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35882" PostTypeId="1" AcceptedAnswerId="35886" CreationDate="2017-09-01T22:09:53.157" Score="2" ViewCount="247" Body="&lt;p&gt;I would like to know how the fourier transform creates filters to extract the constituent signals? I did learn from a book it extracts the spike information and then analyze and combine those informations?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But i have a doubt like if there are more than two constituent signal which cancel each other then how the spikes be useful? Many thanks, i am just beginning to understand this.&lt;/p&gt;&#xA;" OwnerUserId="28425" LastActivityDate="2017-09-02T16:15:27.157" Title="How Fourier Transform creates the filters?" Tags="&lt;fourier-transform&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35883" PostTypeId="2" ParentId="27510" CreationDate="2017-09-02T00:28:49.283" Score="1" Body="&lt;p&gt;The explosion of the forward rates in the log-normal LMM simulated in the spot measure seems to be related to the explosion of the Eurodollar futures prices in this model which was studied in this paper&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.tandfonline.com/doi/abs/10.1080/1350486X.2017.1297727&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.tandfonline.com/doi/abs/10.1080/1350486X.2017.1297727&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Eurodollar futures prices are given by the expectation of the Libor in the spot measure, so an explosion in the former quantity is a signal that the Libor distribution becomes heavy tailed. Sampling from such a heavy tailed distribution will produce a path with extremely large Libor values. The plot in Figure 4.1 shows a lower bound on the ED futures convexity adjustment, which is seen to explode at a certain volatility. This is an exact analytical bound which does not involve any simulation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A similar explosion of the MC paths happens also in stochastic volatility models such as the log-normal SABR model, simulated by Euler time discretization. The simplest setting where this phenomenon appears is the bank account compounding interest in discrete time, assuming that the interest rate follows a geometric Brownian motion. An introduction to this phenomenon is given in Section 2 of the above paper. &lt;/p&gt;&#xA;" OwnerUserId="16700" LastEditorUserId="16700" LastEditDate="2017-09-02T03:43:34.350" LastActivityDate="2017-09-02T03:43:34.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35885" PostTypeId="1" AcceptedAnswerId="35900" CreationDate="2017-09-02T08:36:11.847" Score="0" ViewCount="199" Body="&lt;p&gt;We need to create an internal Forex API for internal usage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We're interested in the accuracy and real-time availability provided by a Fix connection.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How would we go about getting access to a FIX endpoint without spending thousands of dollars?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to find a broker to give us access to their endpoint?&lt;/p&gt;&#xA;" OwnerUserId="29428" LastActivityDate="2017-09-04T11:06:21.883" Title="How do I get Forex data via FIX" Tags="&lt;fx&gt;&lt;fix&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35886" PostTypeId="2" ParentId="35882" CreationDate="2017-09-02T15:04:03.073" Score="3" Body="&lt;p&gt;A filter is a mathematical operator that serves to convert an original time-series into another time-series or function. The purpose is to remove some particular features (e.g. trends, business cycle, seasonalities and noise) that are associated with specific frequency components.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get the basic idea think of a moving average which is nothing but a filter to remove (supposed) noise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of the fourier transform the time series is transformed from the time domain into the frequency domain.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mathematically the filter is applied in both cases by convolution of the original series with a coefficient vector (basically nothing but the dot product). In case of the moving average the coefficient vector is a rectangular function, in case of the fourier transform you basically use some kind of trigonometric functions (via the complex exponential function) to extract the frequencies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find more here:&lt;br&gt;&lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1289420&quot; rel=&quot;nofollow noreferrer&quot;&gt;Analysis of Financial Time-Series Using Fourier and Wavelet Methods&lt;/a&gt; by Philippe Masset&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To get a general intuition about the fourier transform you can find many excellent answers here:&lt;br&gt;&lt;a href=&quot;https://math.stackexchange.com/questions/1002/fourier-transform-for-dummies&quot;&gt;https://math.stackexchange.com/questions/1002/fourier-transform-for-dummies&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2017-09-02T16:15:27.157" LastActivityDate="2017-09-02T16:15:27.157" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35888" PostTypeId="2" ParentId="16031" CreationDate="2017-09-02T20:58:46.127" Score="3" Body="&lt;p&gt;Although I like the other answers to this question I think, there are some points which may be interesting to note and should get attention as well. Let me address each of your individual questions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;My question is, what are the benefits that both approaches contribute the most in finance?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, I think ,  methodology in finance is not about being Bayesian or Frequentist but about searching for an answer using appropriate tools. As stated by @lehalle, its all about the data, the model and the objects you are after.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Financial datasets are, in general, not very large. You may have firm-month observations of thousands of firms, but as companies are usually not surviving for hundreds of years, time-series are relatively short. This leads to the problem that your parameters are not going to be estimated with large precision.&#xA;How can you handle this estimation uncertainty?&#xA;Well, either you go for frequentist standard errors, which may be unnecessary inflated as they are only driven by the number of observations, or you choose some well-motivated priors in order to include additional information which decreases your parameter uncertainty.&#xA;Trade-off here: You may impose priors which are not accepted by your peers or you may not be able to obtain some meaningful, significant results.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Often, the objects you are interested in are hard to capture by Frequentist methods. Stating empirical evidence without being able to asses the estimation uncertainty is worthless (in most cases). Let me give you one example where Bayesian Methods provide you with ways to computed Credible Regions where  you would probably have a hard time to compute confidence intervals: Risk-management often cares about the Value-at-Risk, some quantile of your predicted distribution of future returns.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;You may estimate the parameters of the return distribution which then yields you an estimated VaR. Can Frequentists tell you something about the uncertainty of this estimation? Well, the distribution of a quantile of return distribution is rather hard to capture. Fascinating world of Monte-Carlo Markov Chain (MCMC) allows you to simulate VaRs by sampling from the posterior distribution of the parameters and getting draws of associated VaRs conditional on the likelihood function. Bayesian Computation is a simulation tool which helps you to analyze otherwise extremely complicated statements. Trade-off here: Numerical approximations are not as handy as analytical close-form solutions, but at least there is some solution...You may also think about time-varying parameter models such as Stochastic Volatility Factor models, GMM and the like perform rather poor in this area.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;It really depends on your aim what fits best. Always keep in mind that results are interpreted differently depending on using Bayesian vs. Frequentist approaches. I personally think, Bayesian thinking is more &lt;em&gt;natural&lt;/em&gt; in the sense that it overlaps with my subjective feeling for probabilities. Keep in mind that sometimes it is quite nice to have statements such as &lt;em&gt;the probability of the CAPM being correct given the data is X percent&lt;/em&gt; (you may have a look in Doron Avramovs &lt;em&gt;An exact Bayes test for asset pricing models&lt;/em&gt;).&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What other areas in finance are Bayesian methods being used as industry standards?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This I don't know but you may find Rachevs book 'Bayesian Methods in Finance' useful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Are there certain areas where one is favored than other? Should someone interested in Finance be gearing towards bayesian or frequentist?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't think anything should be preferred. Open mindedness for every method which helps to understand what is going on is the key. But: it is important to understand that there are differences in methodologies and some useless comments such as&#xA;Frequentist: &quot;Bayesians can generate every result if they just torture the prior long enough&quot;&#xA;Bayesian: &quot;Asymptotic Theory is useless as data is always finite&quot;&lt;/p&gt;&#xA;" OwnerUserId="16249" LastActivityDate="2017-09-02T20:58:46.127" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35889" PostTypeId="1" AcceptedAnswerId="35890" CreationDate="2017-09-02T23:19:39.720" Score="2" ViewCount="146" Body="&lt;p&gt;Problem set up:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;asset S: $$\frac{dS}{S} = \mu dt+\sigma dz$$&#xA;Hedged using a forward contract: $F = F(S,t).$&#xA;Hedge portfolio: $$P = S+nF$$&#xA;I want to find the variance of $dP$, and then minimize that with respect to $n$, to calculate the optimal number of forward contracts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dP = dS + ndF;$$ $dF$ uses Ito's Lemma&#xA;The variance of the change in the portfolio is defined as follows:&#xA;then for $$V(dP) = EdP^2 - (EdP)^2$$&#xA;where V stands for Variance and E stands for Expectation, of the Portfolio P&#xA;My goal is to find the Variance and then minimize it with respect to n.&#xA;Does anyone have experience using the concept of minimum variance hedge ratio in a set up like this? Any guidance would be appreciated.&#xA;Thanks&lt;/p&gt;&#xA;" OwnerUserId="29471" LastEditorUserId="29471" LastEditDate="2017-09-02T23:45:44.197" LastActivityDate="2017-09-03T00:06:59.807" Title="minimum variance hedge with stochastic processes" Tags="&lt;finance&gt;&lt;variance&gt;&lt;quantitative&gt;&lt;hedge&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35890" PostTypeId="2" ParentId="35889" CreationDate="2017-09-03T00:06:59.807" Score="1" Body="&lt;p&gt;Ito's lemma gives $$dF = \left(\frac{\partial F}{\partial t}+\frac{1}{2}\frac{\partial^2F}{\partial S^2}\sigma^2 S^2\right)dt + \frac{\partial F}{\partial S}dS = adt + bdS $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using the usual rules, e.g. $dz^2 = dt$, we get $$ dS^2 = \sigma^2S^2dt,$$ $$dF^2 = b^2dS^2 = b^2\sigma^2S^2dt,$$ and $$dSdF = bdS^2 = b \sigma^2S^2dt,$$ so this gives  $$dP^2  = dS^2 + n^2dF^2 + 2ndFdS = \sigma^2S^2 (1+n^2b^2+2nb)dt = \sigma^2S^2(nb+1)^2dt.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is the same as the expected value $E(dP^2)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then for the other term, you know that $E (dP)$ is going to be of the form $c dt$ so that $(E(dP))^2 = 0.$&lt;/p&gt;&#xA;" OwnerUserId="29286" LastActivityDate="2017-09-03T00:06:59.807" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="35892" PostTypeId="1" AcceptedAnswerId="35893" CreationDate="2017-09-03T09:48:38.247" Score="2" ViewCount="859" Body="&lt;p&gt;I am a beginner in Finance and I get confused by the statement &quot;Black-Scholes model implies flat implied volatility plots&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is one form of this statement: (Dan Stefanica, 150 most frequently asked questions on Quant Interviews, 3.3.12)&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;&quot;On the same asset, prices for options with multiple strikes and maturities are quoted and implied volatilities can be computed for each of these options. If the price of the asset had a lognormal distribution - as assumed in the Black-Scholes model - then the resulting plots of implied volatility vs Strike would be flat&quot; &#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;But surely the volatility is assumed constant in the derivation of BS in the first place? It is an assumption, not a consequence of &quot;the price of the asset having a lognormal distribution&quot; ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is another example of my confusion , this time from this paper &lt;a href=&quot;http://www.columbia.edu%2F~mh2078%2FBlackScholesCtsTime.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.columbia.edu%2F~mh2078%2FBlackScholesCtsTime.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/IEfwn.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/IEfwn.png&quot; alt=&quot;IV&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As i understand it, in the Black-Scholes model, we fix K,T, we assume $\exists \sigma=\sigma(K,T)$ for those K,T and we come up with the BS formula above&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is nothing in the BS derivation that assumes $\exists \sigma, \forall K,T ....$ ?&lt;/p&gt;&#xA;" OwnerUserId="29441" LastActivityDate="2017-09-03T12:02:51.770" Title="&quot;Black-Scholes model implies flat implied volatility plots&quot;?" Tags="&lt;black-scholes&gt;&lt;implied-volatility&gt;&lt;volatility-smile&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35893" PostTypeId="2" ParentId="35892" CreationDate="2017-09-03T12:02:51.770" Score="5" Body="&lt;p&gt;Regarding your second question: Remember that Black/Scholes start by postulating a stochastic model for the dynamics of the underlying asset - a geometric Brownian motion with a constant diffusion coefficient $\sigma$. This asset price process should be the same no matter what option you want to value based on it. Saying that you allow for different values for $\sigma$ for different strikes or maturities essentially means that you use a different model for each vanilla option, which is inconsistent and for sure not what they initially had in mind.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding your first question: The implied volatility $\hat{\sigma}(T, K)$ is the value for the constant diffusion coefficient that results in a Black/Scholes price equal to some observed market price. So obviously, if market prices for all $(T, K)$ were computed using a Black/Scholes model with a common volatility $\sigma^*$, then you would recover this same value as the implied volatility $\hat{\sigma}(T, K) = \sigma^*$ and thus a flat volatility surface. Similarly, this fixed $\sigma^*$ results in log-normally distributed prices. So if implied densities for the terminal spot price of a given maturity were log-normally distributed, then the corresponding implied volatility smile would be flat.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2017-09-03T12:02:51.770" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35894" PostTypeId="2" ParentId="31548" CreationDate="2017-09-03T14:23:55.017" Score="4" Body="&lt;p&gt;There are two items that must be clarified with respect to your question:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Are you assuming an interest rate swap (IRS) at mid-market, i.e. at-the-money (ATM) or an off-market IRS with some unknown net present value (PV)?&lt;/li&gt;&#xA;&lt;li&gt;Are you interested in a risk approximation or a more accurate formula that reflects the truest risk sense of a market curve shifted up or down?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If you are assuming a mid-market IRS and want an approximation then MarinD's answer should suffice. This can also be seen for example by differentiating the fixed leg PV formula with respect to the fixed rate: $$\text{Analytic delta of mid-market IRS} = \frac{\partial P_{\text{fixed}}}{\partial R} = N \sum_{i=1}^{n_1} d_i v_i$$ (using &lt;a href=&quot;https://en.wikipedia.org/wiki/Interest_rate_swap&quot; rel=&quot;nofollow noreferrer&quot;&gt;wikipedia's&lt;/a&gt; IRS formula notation)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have an off-market IRS then you must add in the delta associated with the PV. In my experience a good approximation for a par tenor IRS is to divide the PV by 10,000 (bps) and multiply by the tenor divided by two (which approximates the annuity PV's cashflows being exchanged over the tenor of the swap). E.g. a 10Y IRS with a PV of \$1mm will correspond to \$500 total delta per bp. Since PV has already factored in discount factors when arriving at the PV there is no need to reassert them again.&#xA;$$\text{Analytic delta of off-market IRS} = \frac{\partial P_{\text{fixed}}}{\partial R} + Delta(PV)= N \sum_{i=1}^{n_1} d_i v_i + \frac{PV * tenor}{10,000 * 2}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Neither of these are risks in the true sense of market moves because they both assume the market remains constant whilst the fixed rate on the contract moves. It is possible to derive the formula you seek in analytic terms but is rather complicated. And also to apply. The book &lt;a href=&quot;http://www.tradinginterestrates.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Pricing and Trading Interest Rate Derivatives&lt;/a&gt; covers what you are after in the chapter &quot;analytic cross-gamma&quot; since these derivations are required to calculate the real gamma on IRSs.&lt;/p&gt;&#xA;" OwnerUserId="29443" LastActivityDate="2017-09-03T14:23:55.017" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35895" PostTypeId="2" ParentId="34544" CreationDate="2017-09-03T15:43:12.767" Score="2" Body="&lt;p&gt;Since DV01 and PV01 are short for 'dollar value of a basis point' and 'present value of a basis point' (for currencies not in USD) respectively then you are right that the value should be scaled to give the right value inline with the definition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a commenter highlighted definitions are not necessarily consistent across sources. I have written a number of articles myself and am guilty of this inconsistency, unfortunately. Since it generally obfuscates delta and gamma formulae to have $10^{-4}$ and $10^{-8}$ scalars I tend to leave them out with a footnote. The results and terminology often follow from context.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One other important item you should be aware that is not consistent is direction. Traders of interest rates can reference long/short differently and have plus/minus sign conventions for the risk of the same interest rate move.&lt;/p&gt;&#xA;" OwnerUserId="29443" LastActivityDate="2017-09-03T15:43:12.767" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35896" PostTypeId="2" ParentId="16741" CreationDate="2017-09-03T15:58:41.437" Score="4" Body="&lt;p&gt;An interest rate swap (IRS) can have a vega component if it is not a standard IRS. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are familiar with the convexity adjustment for FRAs (and single period IRSs) compared with their respective short term interest rate (STIR) future, you will be aware that it is the different gamma components of these products that result in profit-and-loss (PnL) over their lifetimes. One of the main over-arching reasons for this is the timing of payments of any PnL cashflows. The effect, and the discrepancy in pricing adjustments, is largest for higher assumed volatility.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For interest rate swaps that customise the payment date, i.e. they bring forward or lag the payment compared with the vanilla product then this introduces the same concern. Investment bank mark-to-market (MTM) valuations of IRSs factor this into their portfolio assessments, although generally this is a small effect - a few hundredths of a basis point depending on the size of payment lag. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/7808/convexity-adjustment-for-a-forward-swap-rate&quot;&gt;This question&lt;/a&gt; expands on futures convexity, and &lt;a href=&quot;http://www.tradinginterestrates.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;this reference&lt;/a&gt; includes an example of precisely the effect I mention in the section on gamma.&lt;/p&gt;&#xA;" OwnerUserId="29443" LastActivityDate="2017-09-03T15:58:41.437" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35897" PostTypeId="2" ParentId="35795" CreationDate="2017-09-03T16:46:42.760" Score="7" Body="&lt;p&gt;I will attempt to summarise the content included in &lt;a href=&quot;http://www.tradinginterestrates.com&quot; rel=&quot;noreferrer&quot;&gt;this book&lt;/a&gt;, which has a specific chapter dealing with carry and roll-down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There, two concepts are made completely separate.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;b&gt;Costs-of-carry&lt;/b&gt; are defined as costs relating to holding a trade that are not directly related to market movements. For example, funding a margin requirement for an IRS facing a clearing house, or funding the regulatory capital charge imposed by regulators for transacting IRSs. These costs are not necessarily consistent from one user to another.&lt;/li&gt;&#xA;&lt;li&gt;&lt;b&gt;Roll-down&lt;/b&gt; is defined as the expected profit-and-loss (PnL) if over a period of time the interest rate swap curve remains the same as its current state (shifted in time) as opposed to evolving to its future predicted values.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Personally I have traded IRSs for over 11 years and have never used carry and roll in the way you describe. Why? A mid-market swap is precisely that; a swap expected to not gain or lose any value given the future forecast evolution of rates. If, over the first 3 months you acquire 0.7% (2%-1.3%) but rates evolve exactly as forecast you are left with cash in your pocket and a swap liability of precisely the opposing amount of cash. If you wanted to exit the swap at that point you would be left with no P nor L, since your cash would have to fund its exit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, if the interest rate curve had moved so that the future curve reflected the starting curve (shifted in time), this would represent a genuine PnL event. This movement is described as 'roll-down'. Since the first fixing is known, the only part of your 5Y swap that can change is the 3-mth fwd 4.75-Yr part. The roll-down is calculated by evaluating the difference in rate between the current 4.75Y swap and the 3M4.75Y swap (delta adjusted for just that portion of the swap).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I recognise this isn't a direct answer to the specific question but I hope it elucidates the concept nonetheless.&lt;/p&gt;&#xA;" OwnerUserId="29443" LastActivityDate="2017-09-03T16:46:42.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35899" PostTypeId="1" CreationDate="2017-09-03T21:13:18.263" Score="1" ViewCount="7289" Body="&lt;p&gt;I am trying to understand the currency basis calculation and whether there is a difference in currency basis when quoted vs. OIS and -IBOR rates.&lt;/p&gt;&#xA;" OwnerUserId="2685" LastEditorUserId="16160" LastEditDate="2017-09-03T22:08:57.980" LastActivityDate="2019-06-24T09:43:18.523" Title="What is the EUR swap curve on Bloomberg? I.e. what is the EUR equivalent of S23 curve on Bloomberg?" Tags="&lt;swaps&gt;&lt;bloomberg&gt;&lt;discounting&gt;&lt;cross-currency-basis&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35900" PostTypeId="2" ParentId="35885" CreationDate="2017-09-04T04:28:41.663" Score="1" Body="&lt;p&gt;Too long for comment:&#xA;It's unclear what your idea of the Forex market is but, generally speaking, FX is an interbank market.  So you connect with the bank(s) of your choice and be done with it.  In my experience not a lot of banks offer FIX trading though, only FIX STP and Drop Copy to your back and middle office.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then again there's ECNs like Fastmatch where banks and ordinary clients can connect and provide or take liquidity.  Most of these ECNs primarily support their own binary format and many of them offer market data and/or trading via FIX as well (Fastmatch, Dukascopy, etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for pricing, in any case it's all bespoke: Banks expect you to trade a certain amount per month but formally don't charge for using FIX (if they support it in the first place), ECNs typically charge you (or pass on) connection fees, there's no formal charge for FIX either.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So in short: If you don't plan on actually trading FX the minimum turnover or market access fees will probably counter your plans.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;I'm not sure I understand your question about accuracy and real-time availability.  Of course it's real-time and of course it's accurate.  Or do you mean if there's some sort of guarantee to trade on the last seen quote, e.g. like a FIX Order 'D' or 'E' (prev quoted, prev indicated)?&lt;/p&gt;&#xA;" OwnerUserId="1040" LastActivityDate="2017-09-04T04:28:41.663" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="35901" PostTypeId="1" CreationDate="2017-09-04T05:16:15.733" Score="2" ViewCount="498" Body="&lt;p&gt;This question is regarding the Ho-Lee model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;dr_t = \theta_tdt + \sigma dW_t&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In discrete time, we can calibrate an interest rate binomial tree by finding $\theta$ in each period to match market price with the model price (expectations under the risk-neutral measure). However, every step I proceed to calibrate the next bond on the tree, the $\theta$ in the same period becomes smaller and smaller, because I'm using the calibrated interest rates for previous periods (not sure, please correct me if I'm wrong!). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: what is the intuition/explanation of the $\theta$? Can we view it as the underlying &quot;trend&quot; of the interest rates since $\theta$ is the drift?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="27839" LastEditorUserId="27839" LastEditDate="2017-09-04T16:52:52.037" LastActivityDate="2017-09-04T16:52:52.037" Title="Ho-Lee Model Calibration: theta becomes smaller" Tags="&lt;interest-rates&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35902" PostTypeId="1" CreationDate="2017-09-04T06:10:59.810" Score="6" ViewCount="440" Body="&lt;p&gt;I've read a number of recent papers on market making. Nearly all of the more recent papers focus on defining the problem in terms of a state and action space, deriving the relevant HJB equations and constraints, and going from there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I realize this could be viewed as a broad question, but I think that it's worthy from the perspective of a programmer. In practice, what are the general methods to attack the problem of solving an optimal policy in real time? I understand the theoretical underpinnings of the DPP, but there are few libraries or frameworks designed to help with this, and those that exist are extremely light on the documentation. I'm confused as to how viable methods like policy and value iteration are when solving online (in terms of computational cost and resulting added latency in the HFT world). Are there any good examples of someone taking a set of HJB equations for optimal market making (inventory management) or execution and going all the way (preferably with code or pseudocode) to a working mvp?&lt;/p&gt;&#xA;" OwnerUserId="25930" LastActivityDate="2018-08-25T02:11:58.067" Title="How do you actually solve a stochastic HJB equation in practice?" Tags="&lt;market-microstructure&gt;&lt;market-making&gt;&lt;stochastic-control&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="35904" PostTypeId="2" ParentId="35885" CreationDate="2017-09-04T11:06:21.883" Score="1" Body="&lt;p&gt;The &lt;a href=&quot;https://www.marketfactory.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;MarketFactory API&lt;/a&gt; looks interesting. Also try Integral's &lt;a href=&quot;https://www.truefx.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;TrueFX&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2017-09-04T11:06:21.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35905" PostTypeId="1" CreationDate="2017-09-04T15:02:23.083" Score="3" ViewCount="335" Body="&lt;p&gt;Is it considered a viable trading strategy to do the opposite of a consistently losing model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That is, whenever the model says short, you go long, and vice versa.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt; I would never do this. I am just interested in the opinion of other members of this community.&lt;/p&gt;&#xA;" OwnerUserId="19676" LastEditorUserId="19676" LastEditDate="2017-09-04T16:01:10.570" LastActivityDate="2019-02-18T13:23:08.770" Title="Doing opposite of what the model says" Tags="&lt;quant-trading-strategies&gt;&lt;backtesting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35906" PostTypeId="2" ParentId="35905" CreationDate="2017-09-04T15:35:13.913" Score="15" Body="&lt;p&gt;If you do this, you would destroy the value of the statistical tests that you performed on the backtest. You had a hypothesis that the strategy would make money, but the hypothesis was rejected. You cannot say &quot;I will accept the hypothesis that the opposite strategy is successful&quot;; no statistician would agree with this conclusion. In that case, you might as well test strategies at random and trade them in whatever direction (&lt;em&gt;direct&lt;/em&gt; or &lt;em&gt;opposite&lt;/em&gt;) they seem to work, but it would be an unsound procedure from a statistical point of view, with low chance of success in out of sample data. Some people do that, but I would not consider it valid statistical trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you could do is formulate a new &lt;em&gt;hypothesis&lt;/em&gt;, but that &lt;em&gt;hypothesis&lt;/em&gt; cannot be accepted yet. It would need to be tested ON NEW DATA, not the data that you used in the backtest. Perhaps, you would monitor the market for a while and see how the opposite strategy does. At some point, you may have enough data to conclude that the opposite strategy works and you can trade it for real.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="38578" LastEditDate="2019-02-18T13:23:08.770" LastActivityDate="2019-02-18T13:23:08.770" CommentCount="4" ContentLicense="CC BY-SA 4.0" />
  <row Id="35907" PostTypeId="2" ParentId="35880" CreationDate="2017-09-04T17:43:55.740" Score="3" Body="&lt;p&gt;In developed equity markets you have at least those three entities: Stocks, futures and options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as my experience goes you indeed often hedge options with futures. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is more interesting is the relationship concerning stocks and futures: In theory stocks are the underlying and futures are the derivatives. In practice it is, interestingly enough, often the other way around: Futures are the more liquid instruments and get traded more often, stocks follow suit due to arbitrage conditions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, all in all the instruments that are often the most important in modern financial markets - for options and stocks - are indeed futures!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NB: There seem to be regional differences, e.g. in Europe single-stock futures play a much bigger role than in the US, e.g. EUREX trades futures on most of the EURO STOXX® 600 Index members. Yet the above is true for index futures in any case.&lt;/p&gt;&#xA;" OwnerUserId="12" LastEditorUserId="12" LastEditDate="2017-09-04T19:54:14.943" LastActivityDate="2017-09-04T19:54:14.943" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35908" PostTypeId="1" AcceptedAnswerId="35909" CreationDate="2017-09-04T18:49:43.977" Score="0" ViewCount="109" Body="&lt;p&gt;I need to model the expected NPV of a mortage loan over his whole life-time. Assume that only the prepayment and default risk matters and that these events can occour at only discrete time-points. I'm not shure whethere to use conditional probabilities - cunditioned on having survived up to the payment date or &quot;unconditional&quot; ones.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Option 1:&lt;/strong&gt;&#xA;$E(NPV)=\sum_t \frac{1}{(1+r)^t} ( P(T=t,prepayment) CF^{pre}+ P(T=t,default) CF^{def}+ P(T=t,regular) CF^{reg})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Option 2:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E(NPV)=\sum_t \frac{1}{(1+r)^t} ( P(T=t,prepayment|T&amp;gt;=t) CF^{pre}+ P(T=t,default|T&amp;gt;=t) CF^{def}+ P(T=t,regular|T&amp;gt;=t) CF^{reg})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where T denotes the stochastic variable, modelling the discrete timepoints at which the payments are expected.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you have a reference/textbook on which option to choose?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or do I even miss an option?&lt;/p&gt;&#xA;" OwnerUserId="29374" LastActivityDate="2017-09-04T19:12:19.607" Title="NPV of a mortage loan" Tags="&lt;mbs&gt;&lt;joint-probability&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35909" PostTypeId="2" ParentId="35908" CreationDate="2017-09-04T19:12:19.607" Score="1" Body="&lt;p&gt;A few initial observations but the quick answer is your Option 2.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) Assuming both prepayment and default can occur only at discrete time-points is not strictly correct since a borrower has the right to payoff the loan in full at any time between payment dates.&#xA;(2) Default is a nebulous concept - are you referring to the act of missing a payment itself, or when the loan is ultimately declared as charged-off with some recovery depending on net proceeds after liquidation costs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Industry practice is to model the conditional probability of a missed payment with recovery proceeds received after a pre-specified liquidation lag. It is also convention to assume that NO cures for missed payments occur. The conditional probability of prepayment is applied to the prior month's balance (after scheduled amortization). Combining these terms with the contractual cash flows (and adjusting the &quot;performing&quot; balance appropriately every period) should allow you to compute actual principal and actual interest which discounted back using the appropriate discount rate should give you the NPV.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Empirically, hazard models estimated on actual data on performance, i.e., panel data sets for each loan where you can estimate multinomial models for a loan being in one of 3 mutually exclusive states (alive = 0, prepaid = 1,&#xA;charged-off = 2) [these can also be estimated using pair-wise binomial logits] are used as inputs into the cash flow formulas laid out earlier.&lt;/p&gt;&#xA;" OwnerUserId="6139" LastActivityDate="2017-09-04T19:12:19.607" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35910" PostTypeId="2" ParentId="32250" CreationDate="2017-09-04T20:22:34.250" Score="0" Body="&lt;p&gt;Cash flows, such as coupon payments. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Change in various curve marks, such as volatility curve if there are derivative products in the portfolio. Not too sure if there is a prepayment curve but if there is, then a change in the prepayment curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Changes in swap spreads.&lt;/p&gt;&#xA;" OwnerUserId="29451" LastActivityDate="2017-09-04T20:22:34.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35912" PostTypeId="2" ParentId="14919" CreationDate="2017-09-05T00:32:15.777" Score="4" Body="&lt;p&gt;Just came across this thread...not sure if you already have your answer, but thought I'd give you a shout.&#xA;In the energy business, we employ a range of models. You'll find the most sophisticated models on the Pricing desks, Risk Management desks and the Options trading desks. A variety of products are traded - futures, forwards and swaps. For options - in power, you'll find fixed strike options for forward months and &quot;cash&quot;/inside the months; the latter are struck daily. In natural gas, usually index options and monthly options trade. Calendar spreads are pretty common in gas. Also, heat rate options are somewhat liquid. On the pricing desk - a number of structures - heat rate call options, electric load serving (has the characteristic of short gamma), nat gas storage, heat rate call options (phys and financial) - all of which require a fair amount of analysis are traded. There's too much to list in one place - but if you google Energy Risk by Edeyland - that will give you a good starting point. Hope this helps.&lt;/p&gt;&#xA;" OwnerUserId="29471" LastActivityDate="2017-09-05T00:32:15.777" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35924" PostTypeId="2" ParentId="11000" CreationDate="2017-09-06T03:38:48.650" Score="3" Body="&lt;p&gt;Why don't you use &lt;code&gt;rugarch&lt;/code&gt; package? You can refer to author's example webpage via &lt;a href=&quot;http://www.unstarched.net/r-examples/rugarch/a-short-introduction-to-the-rugarch-package/&quot; rel=&quot;nofollow noreferrer&quot;&gt;A short introduction to the rugarch package&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;## example&#xA;forc1 = ugarchforecast(fit, n.ahead = 500)&#xA;forc2 = ugarchforecast(spec, n.ahead = 500, data = sp500ret[1:1000, , drop = FALSE])&#xA;forc3 = ugarchforecast(spec, n.ahead = 1, n.roll = 499, data = sp500ret[1:1500, , drop = FALSE], out.sample = 500)&#xA;f1 = as.data.frame(attributes(forc1)[[1]]$seriesFor[1])&#xA;f2 = as.data.frame(attributes(forc2)[[1]]$seriesFor[1])&#xA;f3 = t(as.data.frame(attributes(forc3)[[1]]$seriesFor[1], which = 'sigma', rollframe = 'all', aligned = FALSE))&#xA;U = uncvariance(fit)^0.5&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;n.ahead&lt;/code&gt; is the parameter for forecast how many days in advance. Kindly refer to &lt;a href=&quot;https://quant.stackexchange.com/questions/7932/forecasting-using-rugarch-package&quot;&gt;Forecasting using rugarch package&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="15289" LastEditorUserId="15289" LastEditDate="2017-09-06T04:13:27.470" LastActivityDate="2017-09-06T04:13:27.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35931" PostTypeId="1" CreationDate="2017-09-06T16:07:00.323" Score="0" ViewCount="2960" Body="&lt;p&gt;My understanding is that the Black-Scholes formula can be derived via the Capital Asset Pricing Model, I cannot find anything about this on the net. Could someone demonstrate this (in a hopefully not too technical way)?&lt;/p&gt;&#xA;" OwnerUserId="29226" LastActivityDate="2017-09-06T16:33:26.430" Title="Derivation of the Black-Scholes formula" Tags="&lt;black-scholes&gt;" AnswerCount="1" CommentCount="2" ClosedDate="2018-02-17T19:41:50.703" ContentLicense="CC BY-SA 3.0" />
  <row Id="35932" PostTypeId="2" ParentId="35931" CreationDate="2017-09-06T16:33:26.430" Score="3" Body="&lt;p&gt;Here, in section 8:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;a href=&quot;http://www.frouah.com/finance%20notes/Black%20Scholes%20Formula.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;Four derivations of the Black-Scholes Formula&quot;&lt;/a&gt;, F. D. Rouah (&lt;a href=&quot;http://www.frouah.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.frouah.com/&lt;/a&gt;)&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="20454" LastActivityDate="2017-09-06T16:33:26.430" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35934" PostTypeId="2" ParentId="35880" CreationDate="2017-09-07T10:06:17.690" Score="5" Body="&lt;p&gt;At the heart of the (relative) pricing theory is the concept of no arbitrage and replication. I'll focus on equities here because as stated in the comments it may be more complicated for commodities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Forwards deliver a payout linear in the future value of the underlying asset. Hence they can be replicated statically by a simple cash &amp;amp; carry replication strategy (REM: this is where the argument gets more elaborate for commodities such as electricity or perishables). Using the absence of arbitrage argument yields the famous $$F(0,T)=S_0 e^{f T}$$ where $f$ reflects the cost of &lt;em&gt;funding&lt;/em&gt; the equity purchase and carrying it (borrowing cash + having the equity in your balancesheet, placing the stock in repo + reinvesting the divs to decrease the overall cost).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This term structure of funding cost $f(t)$ (i.e. it is clear that $f$ is not constant in practice), also factors in when pricing non-linear products such as options, since their pricing equations also stem from some replication principle - this time dynamic instead of static -  where one purchases the relevant quantity of stocks to replicate the target instrument's behaviour. If you assume proportional dividends and no jumps, then the risk-neutral dynamics of an asset writes:&#xA;$$ dS_t/S_t = f(t) dt + \sigma(t) dW_t $$&#xA;or equivalently&#xA;$$ dS_t/S_t = \frac{\partial \ln\left(F(0,t)/S_0\right)}{\partial t} dt + \sigma(t) dW_t $$&#xA;So you see that the forward curve indeed intervenes. You could therefore see the market forward prices as a way of extracting the implied funding cost and hence (partly) marking your model to the market. This is independent of the volatility model used $\sigma(t)$ (it could be BS, Heston, Local volatility à la Dupire). Of course if there &lt;em&gt;is&lt;/em&gt; arbitrage opportunities or the above argument fails to apply, everything breaks down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Mathematically, this is also understandable as follows: the forward curve characterises the first moment of $S_t$ under the risk-neutral measure knowing the current information, so obviously it'll intervene somewhere when pricing since it's part of the characterisation of the pdf of $S_t$. If you assume BS, then adding the volatility surface to the forward curve gives you the full representation of the future distributions of $S_t \vert S_0$ under the risk-neutral measure. This is enough for European options but not for some more exotic options (e.g. forward starts) that depend on the conditional densities $S_{t_2} \vert S_{t_1}$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding your question: &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;But do futures prices on the market have any effect on option prices in the model. It seems to me that S=Fe^(r-d)T is just a theoretical equation by no-arbitrage. Do futures actually follow this equation?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You could actually say the same about European options (quoted using the BS model for instance). You should see it the other way around: these are inputs that allow you to calibrate your model so that you could apply relative valuation principles afterwards, that is, some sort of ketchup economics: knowing that basic building blocks are priced at X in the market, I know some combination of these blocks should be worth Y in my model.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2017-09-07T12:25:17.080" LastActivityDate="2017-09-07T12:25:17.080" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35937" PostTypeId="1" CreationDate="2017-09-07T14:33:39.393" Score="7" ViewCount="233" Body="&lt;p&gt;Using the package PerformanceAnalytics in R, I am trying to calculate the return of an equal-weighted portfolio that contains 30 assets. However, these assets do not have the same starting point in time, resulting in missing values for several assets from the beginning of the sample period. By default, PerformanceAnalytics ascribes a value of &quot;0&quot; to missing values, resulting in assets being assigned a positive weight in the portfolio, although these did not have any return data available.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a possibility to have PerformanceAnalytics ignore the missing values and rebalance the portfolio once a new asset becomes available?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In advance, thank you for your helpful comments.&lt;/p&gt;&#xA;" OwnerUserId="29497" LastActivityDate="2018-10-04T14:19:35.673" Title="Portfolio returns with unequal asset return histories" Tags="&lt;returns&gt;&lt;portfolio&gt;&lt;performanceanalytics&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35939" PostTypeId="1" CreationDate="2017-09-07T15:50:58.777" Score="1" ViewCount="303" Body="&lt;p&gt;i've constructed a Forward FX curve using the formula:&#xA;$F= Spot \frac{(1+I_b*n/N)}{(1+I_c*n/N)}$&#xA;when i get these Forward rates for 1 month, 3, 6 till 1 year i got a decreasing forward Fx Curve &#xA;How to explain that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards&lt;/p&gt;&#xA;" OwnerUserId="29499" LastEditorUserId="16148" LastEditDate="2017-09-07T18:42:33.940" LastActivityDate="2017-09-07T18:42:33.940" Title="Decreasing Forward FX rate curve" Tags="&lt;yield-curve&gt;&lt;forward&gt;&lt;currency&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35940" PostTypeId="1" AcceptedAnswerId="35969" CreationDate="2017-09-07T17:06:41.120" Score="0" ViewCount="740" Body="&lt;p&gt;When pricing an equity option we calculate risk-free rate by interpolating one of the curves below for time-to-maturity T. &#xA;What is the difference between the following curves and in what case each is applicable to option pricing?&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;US Swap Curve&lt;/li&gt;&#xA;&lt;li&gt;USD Discount curve &lt;/li&gt;&#xA;&lt;li&gt;USD SWAP OIS Fed Funds rate &lt;/li&gt;&#xA;&lt;li&gt;USD Basis Swap &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="11726" LastEditorUserId="11726" LastEditDate="2017-09-07T18:18:29.263" LastActivityDate="2017-09-10T08:37:16.273" Title="Interest rate curve in option pricing" Tags="&lt;options&gt;&lt;interest-rates&gt;&lt;yield-curve&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35943" PostTypeId="1" CreationDate="2017-09-07T19:35:21.617" Score="1" ViewCount="164" Body="&lt;p&gt;Suppose there are two time series of data, ask price and bid price in options. They are used to calculate bid-ask spread($\frac{P_A-P_B}{P_{Mid}}$). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I attempt to use winsorization and standardization to make the results more stable and reliable, but I'm not sure whether the standardisation should be used first. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I think I should standardise the bid-ask spread and then winsorize the spread. But I should not use them in ask and bid prices. Am I correct? &lt;/p&gt;&#xA;" OwnerUserId="26460" LastEditorUserId="16148" LastEditDate="2017-09-07T19:52:07.590" LastActivityDate="2017-09-07T19:52:07.590" Title="Winsorization and Standardization in data manipulation" Tags="&lt;data&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35944" PostTypeId="2" ParentId="34856" CreationDate="2017-09-07T20:40:38.777" Score="1" Body="&lt;p&gt;Another estimate from &lt;a href=&quot;http://nordic.businessinsider.com/the-fastest-traders-on-wall-street-are-in-trouble-2017-8?r=US&amp;amp;IR=T&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://nordic.businessinsider.com/the-fastest-traders-on-wall-street-are-in-trouble-2017-8?r=US&amp;amp;IR=T&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Total revenues brought in by HFTs from equity trading have dropped over 85% from 7.2 billion USD in 2009 to 1.1 billion USD in 2016, according to data from the TABB Group. The consultancy expects revenues to slide to 900 million USD  this year.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2183" LastActivityDate="2017-09-07T20:40:38.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35947" PostTypeId="1" CreationDate="2017-09-07T23:34:14.437" Score="-1" ViewCount="232" Body="&lt;p&gt;I am trying to build an equal active weight portfolio, while minimizing the total risk. However, my constraint of equal active weight always leads to 0 active weight for everything. I know 0 active weight for everything is not the optimal result, as there's no way my benchmark happens to be the minimal risk portfolio. Does anyone know how to solve this problem?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;fun = lambda x: x.dot(covariance_matrix).dot(x.transpose())&#xA;cons = np.array([])  &#xA;&#xA;for i in range(0,x0.size-1):        &#xA;&#xA;    con = {'type': 'eq', 'fun': lambda x, i=i: (x[i]-bmWeight[i])-(x[i+1]-bmWeight[i+1])}&#xA;    cons = np.append(cons,con)       &#xA;&#xA;sumCon = {'type': 'eq', 'fun': lambda x:  sum(x)-1}       &#xA;cons = np.append(cons, sumCon)&#xA;&#xA;solution = minimize(fun,x0,method='SLSQP',constraints = cons)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="29473" LastActivityDate="2017-09-08T01:40:25.217" Title="How to run optimization to achieve an equal active weight portfolio?" Tags="&lt;portfolio-management&gt;&lt;portfolio-optimization&gt;&lt;finance-mathematics&gt;&lt;python&gt;&lt;mathematics&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35948" PostTypeId="1" AcceptedAnswerId="35960" CreationDate="2017-09-08T00:44:59.560" Score="3" ViewCount="395" Body="&lt;p&gt;I've noticed in my backtests that &quot;shrinking&quot; the expected returns vector towards zero tends to improve the performance. This has led me to investigate shrinkage methods for the forecasts/expected return vector vs the traditional &quot;shrinkage&quot; as applied to the risk/covariance matrix estimation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One structured way to do this is the Bayesian approach - which seems to lead to Black Litterman. There is some advice on shrinking the expected returns vector here &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/44/what-methods-do-you-use-to-improve-expected-return-estimates-when-constructing-a&quot;&gt;What methods do you use to improve expected return estimates when constructing a portfolio in a mean-variance framework?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but I'm wondering if people tend to perform Black Litterman in an online sense as in portfolio rebalancing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. this would mean using your previous weights/portfolio positions as your prior and updating your prior with your new expected return forecasts at the next time step.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this a common approach/use case of Black Litterman?&lt;/p&gt;&#xA;" OwnerUserId="16680" LastActivityDate="2017-09-08T22:57:49.083" Title="black litterman for rebalancing" Tags="&lt;optimization&gt;&lt;portfolio-optimization&gt;&lt;black-litterman&gt;&lt;rebalancing&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35949" PostTypeId="2" ParentId="35947" CreationDate="2017-09-08T01:07:16.233" Score="1" Body="&lt;h3&gt;Your constraints imply all the active weights must be zero!&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;We know that the base weights add to 1, that is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \sum_i b_i = 1$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Define the active weight $a_i$ as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ a_i = x_i - b_i$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence if you have the constraint $\sum_i x_i = 1$, then the sum of the active weights must be zero. Observe that summing both sides:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \underbrace{\sum_i a_i}_{=0} = \underbrace{\sum_i x_i}_{=1} - \underbrace{\sum_i b_i}_{=1}$$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then if you add constraints such that $a_i = a_j$ for any $i$ and $j$ then $a_i = 0 $ for all $i$ (otherwise, they wouldn't sum to zero).&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-09-08T01:40:25.217" LastActivityDate="2017-09-08T01:40:25.217" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35950" PostTypeId="1" CreationDate="2017-09-08T07:45:49.860" Score="6" ViewCount="131" Body="&lt;p&gt;It has been about 13 years since Andrew Lo published &lt;a href=&quot;http://www.iijournals.com/doi/abs/10.3905/jpm.2004.442611%40jpm40.2004.30.issue-5?journalCode=jpm40&quot; rel=&quot;noreferrer&quot;&gt;The Adaptive Markets Hypothesis&lt;/a&gt;. It provides valid criticism to Efficient Markets Hypothesis and brings lots of innovation over it. Unfortunately, it is but a framework of what it would be. What I am asking is; are there any significant models/theorems which employ AMH at its core?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;p.s. I should add that I am working on financial models that might be uneasy with the collosal EMH. Many other studies either try to adhere to or completely ignore it.&lt;/p&gt;&#xA;" OwnerUserId="8147" LastActivityDate="2017-09-08T07:45:49.860" Title="Mathematical Representation of Adaptive Markets Hypothesis" Tags="&lt;market-efficiency&gt;&lt;emh&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35956" PostTypeId="2" ParentId="10800" CreationDate="2017-09-08T16:01:30.527" Score="2" Body="&lt;p&gt;That's an old post by now, but since I somehow came across it here's my take. The reason why Wilmott is correct is because all the hypotheses made in order to formulate the pricing PDE for vanillas (I assume you're comfortable with that), still hold in the case of barrier options. So why is it that you doubt that the same PDE can be used? So yes, it's only the boundary conditions that differ and yes, it is indeed obvious that the PDE is satisfied by barrier options when you use the same BS assumptions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for probilitator's implying that the actual solving of the PDE's is usually left to pure mathematicians, I'm not sure about that! This should be engineers, (or at least applied mathematicians) as they are the ones who like to (and thus specialize) in solving things in practice, pure mathematicians usually prefer to stay in their abstract world:)&lt;/p&gt;&#xA;" OwnerUserId="19373" LastActivityDate="2017-09-08T16:01:30.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35957" PostTypeId="1" CreationDate="2017-09-08T16:19:29.633" Score="0" ViewCount="1404" Body="&lt;p&gt;What is fixed-equivalent yield and how is it derived? Thanks!&lt;/p&gt;&#xA;" OwnerUserId="29470" LastEditorUserId="16148" LastEditDate="2017-09-08T16:54:49.930" LastActivityDate="2017-09-08T22:04:33.720" Title="How is Bloomberg's fixed-equivalent yield on a floater calculated?" Tags="&lt;fixed-income&gt;&lt;bloomberg&gt;&lt;floating-rate&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35959" PostTypeId="2" ParentId="35957" CreationDate="2017-09-08T21:51:24.150" Score="1" Body="&lt;p&gt;Quote [fixed equivalent] yield is determined by assuming the coupon rate on the floater is swapped to a synthetic fixed rate and then solving for the internal rate of return. Endquote &lt;a href=&quot;https://academlib.com/14293/economics/actual_floater&quot; rel=&quot;nofollow noreferrer&quot;&gt;link&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words it is based on seeing what kind of fixed rate you can get in the swap market for the floating rate payments from the bond, then seeing what Yield to Maturity you get on a bond with such (hypothetical) fixed coupons, the other facts about the floating bond (maturity and price) remaining unchanged.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-09-08T22:04:33.720" LastActivityDate="2017-09-08T22:04:33.720" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35960" PostTypeId="2" ParentId="35948" CreationDate="2017-09-08T22:57:49.083" Score="4" Body="&lt;p&gt;There are some technical problems with using your previous weights as priors (that is, they are point measures), but yes, the Black-Litterman framework is suitable for this. You can essentially include any view point you have on the market within the model and let it affect your position size. This also includes views on transaction costs (based on such measures as market impact, average volume, position size etc.). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you work with a simple diagonal model (ignoring covariance), I have found it effective to shrink the weight toward the previous periods value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regarding the point measure issue, it is a reasonable modelling assumption to assume a normal distribution with mean equal your previous weight (or the market capitalized weight) and a sufficiently small variance. This makes the model analytically tractable. &lt;/p&gt;&#xA;" OwnerUserId="13808" LastActivityDate="2017-09-08T22:57:49.083" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35961" PostTypeId="1" AcceptedAnswerId="35983" CreationDate="2017-09-08T23:09:14.350" Score="2" ViewCount="1369" Body="&lt;p&gt;I am following the cookbook example for pricing a Vanilla Swap in QuantLib Python, given &lt;a href=&quot;http://gouthamanbalaraman.com/blog/interest-rate-swap-quantlib-python.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let's assume that a week passed, and we are trying to calculate the mark to market value of the same swap. After a bit of looking around, I have found this &lt;a href=&quot;https://sourceforge.net/p/quantlib/mailman/message/27530541/&quot; rel=&quot;nofollow noreferrer&quot;&gt;thread&lt;/a&gt;, which leads me to believe that in order to re-price a swap at a later date, one needs to change the settlement date to get the updated market value of a swap. This does not seem right, since changing the settlement_date for the swap would result in shifting the cash flow schedules as well. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I am looking for is to keep the swap definition (cash flow dates, maturity etc), load in a new yield curve at a later date, and re-price my swap using the new yield curve. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anybody show me how to do this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks! &lt;/p&gt;&#xA;" OwnerUserId="29518" LastActivityDate="2017-09-11T09:26:26.017" Title="Calculating market value of a vanilla swap at a later date in QuantLib" Tags="&lt;python&gt;&lt;quantlib&gt;&lt;interest-rate-swap&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35962" PostTypeId="1" AcceptedAnswerId="35971" CreationDate="2017-09-09T00:56:04.420" Score="4" ViewCount="4992" Body="&lt;p&gt;I'm still a bit confused on how a funding valuation adjustment is actually computed. So I'm looking for a simple example of a funding valuation adjustment, preferably a binomial or discrete model, with terms clearly defined mathematically whenever possible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone have such an example to illustrate? &lt;/p&gt;&#xA;" OwnerUserId="29161" LastActivityDate="2017-09-13T20:11:05.027" Title="Simple example of a funding valuation adjustment?" Tags="&lt;valuation&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35964" PostTypeId="2" ParentId="4101" CreationDate="2017-09-09T16:26:59.440" Score="1" Body="&lt;p&gt;Actually the classical definition of a tick is the minimum price movement of a future (set by the exchange). This is often misrepresented semantically as most instruments have a genuine tick size of 0.01 (e.g. Bobl, Bund or Short Sterling contracts) but some do not (e.g. Euribor has 0.005 tick, Schatz has 0.005 and Buxl has 0.02). So some finance practitioners say a tick when they actually mean a cent, which is a 0.01 price deviation. Be aware of that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly with respect to your question;&#xA;1) The notional on a Bobl contract specification means that one cent (0.01) is worth 10EUR. If Bobl has a DV01 of 44.8EUR this is a movement of 4.48 cents or 4.48 ticks for each bp.&#xA;2) The notional on a Euriobor contract spec means one cent is worth 25EUR. If one contract has a DV01 of 25EUR this is a movement of 1.0 cents or 2 ticks for each bp.&#xA;To get the hedge ratio of number of contracts divide 100 Bobls of 4480 DV01 by 25 to get 179 Euribor contracts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course you will have a superior hedge if you trade all different contracts (to a total of 179) rather than a single contract (e.g. Sep 18). If you wanted to approximate an asset swap then you would have to trade something slightly different to a linear pro-rata of different contracts, although with current yield levels it will probably be minimally different.&lt;/p&gt;&#xA;" OwnerUserId="29443" LastActivityDate="2017-09-09T16:26:59.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35965" PostTypeId="2" ParentId="35899" CreationDate="2017-09-09T17:28:42.207" Score="2" Body="&lt;p&gt;You can synthesise this with the single currency IBOR-OIS basis swap (SBS) in each currency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example paying the EUR/USD 10Y XCS @ -40bps, represents paying 3M Euribor -40 versus receiving 3M USD Libor flat.&#xA;If you then buy a EUR 10Y OIS/IBOR SBS @ 8bps, this represents receiving 3M Euribor -8bps and paying EONIA flat.&#xA;If you then sell a USD 10Y OIS/IBOR SBS @ 20bps, this represents paying 3M USD Libor - 20bps and receiving FFOIS flat.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Net you have synthesised paying a EUR/USD EONIA/FFOIS XCS @ -52bps (-40 +8 -20).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: due to the credit support annex (CSA) on the EUR SBS being EUR cash collateral through any clearing house this is different to that on the specific XCS instrument which (if it traded) would be USD collateralised on all aspects of the trade, so this will have a minor (probably negligible) impact.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note: you can also use the same technique for other IBOR tenors such as 6M, where the standard XCS is 3M IBOR and there is a 3M/6M SBS market in each currency.&lt;/p&gt;&#xA;" OwnerUserId="29443" LastEditorUserId="29443" LastEditDate="2017-09-09T18:16:09.923" LastActivityDate="2017-09-09T18:16:09.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35966" PostTypeId="1" AcceptedAnswerId="35973" CreationDate="2017-09-09T20:29:43.713" Score="1" ViewCount="490" Body="&lt;p&gt;Given a 2-dimensional Wiener process $(W_{1},W_{2})$ with correlation $\rho$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let \begin{equation*} X(t):= F(t) + \int_{0}^{t} f(s) dW_{1}(s) + \int_{0}^{t} g(s) dW_{2}(s)\end{equation*}&#xA;for some nice enough deterministic functions $F$, $f$ and $g$.&#xA;Let now $0&amp;lt;t_{1}&amp;lt;t_{2}&amp;lt;\ldots &amp;lt; t_{n+1}$ and $k\in\{1,2,\ldots,n+1 \}$. We define $X_{i}:=X(t_{i})$ and&#xA;\begin{equation*} Y_{k}:= (X_{k}-X_{i})_{i\neq k}=(X_{k}-X_{1},\ldots,\widehat{X_{k}-X_{k}},\ldots,X_{k}-X_{n+1})\in\mathbb{R}^{n}.  \end{equation*}&#xA;I know would like to understand the following claim:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Y_{k}$ has a multivariate normal distribution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help or references would be appreciated very much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a follow-up:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I figured that the definition of 2-dimensional Wiener process $(W_{1},W_{2})$ with correlation $\rho$ is not quite clear to me.&#xA;I assume that $W_{1}$ and $W_{2}$ being one-dimensional Wiener processes and $corr(W_{1}(t),W_{2}(t))=\rho$ is not enough, isn't it!?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would assume that we have to assume that $(W_{1}(t),W_{2}(t))$ has a two-dimensional normal distribution with mean 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally, is there a standard definition for a n-dimensional Wiener process with correlation? If so, I would be happy to get some references. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Else, my guess would be that a n-dimensional stochastic process $W=(W_{1},\ldots,W_{n})$ is a n-dimensional process with:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$W(0)=0$ a.s.&lt;/li&gt;&#xA;&lt;li&gt;$W_{t}$ a.s.-continuous&lt;/li&gt;&#xA;&lt;li&gt;increments are independent&lt;/li&gt;&#xA;&lt;li&gt;$W_{t}-W_{s}\sim N(0,\Sigma)$, for $t&amp;gt;s$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Sigma$ is a positive-definite and symmetric matrix with diagonal elements equal to $t-s$&lt;/p&gt;&#xA;" OwnerUserId="27389" LastEditorUserId="27389" LastEditDate="2017-09-15T16:22:48.580" LastActivityDate="2017-09-15T16:22:48.580" Title="Vector of differences of Brownian motion integrals is multivariate normal" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35969" PostTypeId="2" ParentId="35940" CreationDate="2017-09-10T08:37:16.273" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;b&gt;USD Swap Curve&lt;/b&gt;: This is an ambiguous name, it could, in today's multi curve framework, mean multiple things. The most common layman definition of US Swap Curve is to represent the benchmark swap rate for different tenors on an x-y plane. E.g. 1Y: 1%, 2Y: 1.5%, 3Y: 2% etc. The benchmark is usually 6M LIBOR swaps in USD.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;b&gt;USD Discount Curve&lt;/b&gt;. Again, an ambiguous name, but slightly less. A discount curve's use is to provide discount factors for valuing cashflows. Therefore that much is specified. On which measure to discount is a different matter (e.g. 3M LIBOR or 6M Libor or FFOIS or some arbitrary benchmark). The industry interbank standard for discount factors of cleared derivatives is the FFOIS discount curve.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;b&gt;USD Swap OIS Fed Funds rate&lt;/b&gt;. The inclusion of the word swap means I should consistently equate this to 1. but instead of LIBOR swaps it is OIS Swaps whose floating rate benchmark is the daily FFOIS rate.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;b&gt;USD Basis Swap&lt;/b&gt;. Again unclear since there is no context, but this could either represent a single-currency basis swap (SBS) (USD 3M LIBOR versus 6M LIBOR or 3M LIBOR versus FFOIS), or if referenced from a separate currency, e.g. EUR, it might reference the cross-currency basis swap (XBS), e.g. EUR/USD 10Y XCS.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;b&gt;The relation between these curves:&lt;/b&gt;&#xA;For option pricing you are often interested in the forward valuation of cashflows, for which collateralised derivatives will be dependent upon the US FFOIS discount curve, which itself is derived from FFOIS swaps.&#xA;More commonly the FFOIS rates are derived from the more liquid US Swaps and LIBOR/FFOIS Basis swaps which can all be simultaneously solved to produce a multi-curve framework.&lt;/p&gt;&#xA;" OwnerUserId="29443" LastActivityDate="2017-09-10T08:37:16.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35971" PostTypeId="2" ParentId="35962" CreationDate="2017-09-10T12:59:28.557" Score="6" Body="&lt;p&gt;To discuss &lt;em&gt;Funding Valuation Adjustments&lt;/em&gt; (FVA) it is first necessary to describe a situation in which such an adjustment would be needed. In here we will take as an example collateral mismatches, which is a common case. For a conceptual treatment of FVA and collateral mismatches refer to Ruiz (2013).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We borrow the modified Black-Scholes framework of Piterbarg (2010). We assume we have sold a European derivative with maturity $T$ which value is given by $V(t)$ at time $t$ and that the transaction is collateralized, meaning that the counterparty we have traded with has to pledge to us a collateral with value $C(t)$ $-$ importantly, we do not assume here that $V(t)=C(t)$ as this would eliminate the need for an FVA. We make two assumptions on this collateral: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;First, it can be &lt;a href=&quot;https://en.wikipedia.org/wiki/Hypothecation#Rehypothecation&quot; rel=&quot;nofollow noreferrer&quot;&gt;rehypothecated&lt;/a&gt;; &lt;/li&gt;&#xA;&lt;li&gt;Secondly, collateral is remunerated at a rate $r_C(t)$ at time $t$ $-$ the rate can be constant, deterministic or stochastic. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The derivative we have traded is written on an underlying asset which price is given by $S(t)$ at $t$, and this price follows Geometric Brownian Motion (GBM) dynamics. Finally, we assume we can borrow on an unsecured basis $-$ &lt;em&gt;i.e.&lt;/em&gt; without collateral $-$ at a rate $r_F(t)$ such that $r_F(t) \geq r_C(t)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By hedging the derivative by holding appropriate quantities of the underlying asset and cash, Piterbarg shows that its value is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ V(t) = \mathbb{E}_t\left[e^{-\int_t^Tr_C(u)du}V(T)\right]-\mathbb{E}_t\left[\int_t^Te^{-\int_t^ur_C(v)dv}(r_F(u)-r_C(u))(V(u)-C(u))du \right] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\mathbb{E}_t[\cdot]$ denotes the expectation operator conditional on the $\sigma$-algebra $\mathcal{F}_t$ $-$ &lt;em&gt;i.e.&lt;/em&gt; the expectation conditional on market information at $t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, by designating by $V_{\text{CSA}}(t)$ $-$ where CSA stands for &lt;a href=&quot;https://en.wikipedia.org/wiki/Credit_Support_Annex&quot; rel=&quot;nofollow noreferrer&quot;&gt;Credit Support Annex&lt;/a&gt; $-$ the value of the derivative if $C(t)=V(t)$ for all $t$ until maturity, we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align} V(t) &amp;amp; = \underbrace{\mathbb{E}_t\left[e^{-\int_t^Tr_C(u)du}V(T)\right]}_{\text{CSA-value of derivative}}-\underbrace{\mathbb{E}_t\left[\int_t^Te^{-\int_t^ur_C(v)dv}(r_F(u)-r_C(u))(V(u)-C(u))du \right]}_{\text{FVA for collateral mismatch}}&#xA;\\[6pt]&#xA;&amp;amp; = V_{\text{CSA}}(t)-\text{FVA}(t)&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case, due to the mismatch between the derivative's value and the collateral the counterparty has to post at any time, we need (respectively can) to borrow (resp. lend) the difference between $V(t)$ and $C(t)$: this constitutes a funding valuation cost (resp. funding valuation benefit).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, for simplicity we assume the following:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Both the collateral rate $r_C(t)$ and the unsecured funding rate $r_F(t)$ are constant for all $t$;&lt;/li&gt;&#xA;&lt;li&gt;The counterparty has to post a collateral amount equal to a certain portion $p$ of the derivative's value: $C(t) = pV(t)$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The FVA can then be rewritten:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align} &#xA;\text{FVA}(t) &amp;amp; = (1-p)(r_F-r_C)\int_t^T\mathbb{E}_t[e^{-r_Cu}V(u)]du &#xA;\\[6pt]&#xA;&amp;amp; = (1-p)(r_F-r_C)\int_t^TV_{\text{CSA}}(u)du&#xA;\end{align} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To compute the FVA you need the value of the derivative at all time points along its life. You immediately see that computing the funding adjustment $-$ and, in general, any &lt;a href=&quot;https://en.wikipedia.org/wiki/XVA&quot; rel=&quot;nofollow noreferrer&quot;&gt;valuation adjustment&lt;/a&gt; such as CVA or DVA $-$ is computationally a much harder problem than computing the selling price: as a derivative's dealer you only need the price of the derivative at time $0$ when you actually sell it to your counterparty, but for determining the FVA you need the price at a series of future times. That means that common numerical techniques used by banks to price derivatives, such as Monte Carlo methods or finite differences, cannot be applied to the problem of FVA because they are too computationally expensive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice, a common approach is the following. You first need to simulate your underlying risk factors: in our example here, the derivative only depends on the asset $S(t)$ hence you need to simulate $m$ price paths $\omega_1,\cdots,\omega_m$ from $0$ to $T$ at a discrete time grid $0=t_0 &amp;lt; t_1 &amp;lt; \cdots &amp;lt; t_{n-1} &amp;lt; t_n = T$ $-$ if rates are stochastic then you also need to simulate rates. After having a sample of price paths for the underlying, you proceed as follows:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Working backwards, you first record for each price path $\omega_i$, $i \in \{1,\cdots,m\}$, the value of the derivative at maturity $t_n$ $-$ which is trivial since the payoff is known at maturity $-$ which we will designate by $v(\omega_i,t_n)$;&lt;/li&gt;&#xA;&lt;li&gt;You then calculate for each price path the discounted value $v(\omega_i,t_{n-1})$ of the derivative's payoff at the previous grid point, $t_{n-1}$, by simply discounting using rate $r_C$:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;$$ v(\omega_i,t_{n-1}) = e^{-r_C(t_n-t_{n-1})}v(\omega_i,t_n)$$&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;3&quot;&gt;&#xA;&lt;li&gt;You then assume values $v(\omega_i,t_n)$ can be reliably approximated by a &quot;simple&quot; function $f_{n-1,n}(\cdot)$, such as a polynomial, applied to values $v(\omega_i,t_{n-1})$ and estimate that function from the simulated sample $-$ for example by Ordinary Least Squares:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;$$ v(\omega_i,t_n) \approx f_{n-1,n}(v(\omega_i,t_{n-1})) \qquad \text{(1)}$$&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;4&quot;&gt;&#xA;&lt;li&gt;&lt;p&gt;Repeat recursively steps 1 to 3 until you have reached the current time and you have a set of simple pricing functions $f_{0,1},f_{1,2},\cdots,f_{n-1,n}$.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Let us designate by $w_0$ the price path for the derivative's value corresponding to the current market state $-$ &lt;em&gt;i.e.&lt;/em&gt; such that $v(\omega_0,0)=v(S(0),0)=V_{\text{CSA}}(0)$ which can be obtained either by an analytic formula or numerical techniques. We can then recursively calculate the value of the derivative at each time step $t_1,\cdots,t_n$: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$v(\omega_0,t_1)=f_{0,1}(v(\omega_0,0))=f_{0,1}(v(S(0),0))=f_{0,1}(V_{\text{CSA}}(0))$;&lt;/li&gt;&#xA;&lt;li&gt;$v(\omega_0,t_2)=f_{1,2}(v(\omega_0,t_1))=f_{1,2} \circ f_{0,1}(V_{\text{CSA}}(0))$;&lt;/li&gt;&#xA;&lt;li&gt;Etc. &lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Defining $\Delta_{j,j+1}=t_{j+1}-t_j$ for all $j$, you can now calculate FVA with the following formula:&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;\text{FVA}(t) &amp;amp; = (1-p)(r_F-r_C)\int_t^TV_{\text{CSA}}(u)du&#xA;\\[6pt]&#xA;&amp;amp; \approx (1-p)(r_F-r_C)\sum_{j=0}^{n-1}f_{j,j+1}(v(\omega_0,t_j))\Delta_{j,j+1} \qquad \text{(2)}&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;References&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Piterbarg, V. (2010). &quot;Funding beyond discounting: collateral agreements and derivatives pricing&quot;, &lt;em&gt;Risk&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ruiz, I. (2013). &quot;FVA Demystified: CVA, DVA, FVA and their interaction (Part I)&quot;, iRuiz Consulting&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ruiz, I. (2014). &quot;FVA Calculation and Management: CVA, DVA, FVA and their interaction (Part II)&quot;, iRuiz Consulting&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;[Edit 11/09/17]&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the procedure outlined above might be problematic for coarse time grids: for example, if the time step is $1$ year, the derivative's price today might not be a good predictor of the derivative's value in $1$ year time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;An alternative methodology would be as follows: instead of predicting the derivative's price at $t_{j+1}$ from the derivative's price at $t_j$, we could predict the derivative's price at $t_{j+1}$ from the underlying price at $t_{j+1}$. Letting $S(\omega_i,t_j)$ be the asset's simulated price on path $\omega_i$ at time $t_j$, equation $\text{(1)}$ above would be replaced by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ v(\omega_i,t_j) \approx f_j\left(S(\omega_i,t_j)\right) $$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence equation $\text{(2)}$ would become:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;\text{FVA}(t) \approx (1-p)(r_F-r_C)\frac{1}{m'}\sum_{j=0}^n\sum_{i=0}^{m'}f_j(S(\omega_i,t_j))\Delta_{j,j+1}&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $S(\omega_i,t_0)=S(\omega_i,0)=S(0)$ for all $i$ and $(S(\omega_i,t_j)_{0\leq j\leq n})_{0\leq i\leq m'}$ is a new simulated sample of the asset $S(t)$.&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-09-13T20:11:05.027" LastActivityDate="2017-09-13T20:11:05.027" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="35973" PostTypeId="2" ParentId="35966" CreationDate="2017-09-10T18:23:12.537" Score="1" Body="&lt;p&gt;As noted above, the random vector $Y_k$ is multi-normal if for any combinations &#xA;\begin{align*}&#xA;\sum_{i\ne k} a_i (X_k-X_i) \tag{1}&#xA;\end{align*}&#xA;is normal. WLOG, we assume that $1&amp;lt;k&amp;lt;n+1$. Note that&#xA;\begin{align*}&#xA;\sum_{i\ne k} a_i (X_k-X_i) &amp;amp;=-\sum_{i\ne k}a_i X_i +X_k \sum_{i\ne k} a_i\\&#xA;&amp;amp;=-a_{n+1}(X_{n+1}-X_n)\\&#xA;&amp;amp;\quad -(a_{n+1}+a_n)(X_n-X_{n-1})\\&#xA;&amp;amp;\quad - \cdots \\&#xA;&amp;amp;\quad -\sum_{i=k+1}^{n+1} a_i(X_{k+1}-X_k)\\&#xA;&amp;amp;\quad +\sum_{i=1}^{k-1}a_i(K_k-X_{k-1})\\&#xA;&amp;amp;\quad +\cdots\\&#xA;&amp;amp;\quad +a_1(X_2-X_1).&#xA;\end{align*}&#xA;Since $(W_1, W_2)$ is a 2-dimensional Brownian motion, by Cholesky decomposition,&#xA;\begin{align*}&#xA;W_1(t) &amp;amp;= B_1(t),\\&#xA;W_2(t) &amp;amp;= \rho B_1(t) + \sqrt{1-\rho^2}B_2(t),&#xA;\end{align*}&#xA;where $B_1$ and $B_2$ are two independent Brownian motions. Then,&#xA;for $i=2,\ldots, n+1$, &#xA;\begin{align*}&#xA;X_i-X_{i-1} &amp;amp;= F(t_i)-F(t_{i-1}) + \int_{t_{i-1}}^{t_i}f(s)dW_1(s) + \int_{t_{i-1}}^{t_i}g(s)dW_2(s)\\&#xA;&amp;amp;= F(t_i)-F(t_{i-1}) + \int_{t_{i-1}}^{t_i}(f(s)+\rho g(s))dB_1(s) + \int_{t_{i-1}}^{t_i}\sqrt{1-\rho^2}g(s)dB_2(s)&#xA;\end{align*}&#xA;is normal. Moreover, since&#xA;\begin{align*}&#xA;(X_2-X_1),\, \ldots, \, (X_{n+1}-X_n)&#xA;\end{align*}&#xA;are independent, their combinations &#xA;\begin{align*}&#xA;\sum_{i\ne k} a_i (X_k-X_i)&#xA;\end{align*}&#xA;is also normal. That is, $Y_k$ is multi-normal.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-09-11T13:11:15.570" LastActivityDate="2017-09-11T13:11:15.570" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="35975" PostTypeId="1" CreationDate="2017-09-10T19:23:30.880" Score="0" ViewCount="525" Body="&lt;p&gt;We know that the vega of vanilla European call and put option is positive under Black-Scholes framework, where stock price flows a geometric Brownian motion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question I want to ask is that &lt;strong&gt;is vega always positive for vanilla European call/put option, regardless of the process that the underlying stock follows?&lt;/strong&gt; In other words, is the statement that 'vega is always positive for vanilla European call/put option', assumption (about the distribution of the stock process) free?&lt;/p&gt;&#xA;" OwnerUserId="29537" LastActivityDate="2017-09-11T23:50:53.137" Title="Is vega of vanilla European call/put option always positive?" Tags="&lt;option-pricing&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35976" PostTypeId="2" ParentId="35863" CreationDate="2017-09-10T19:52:36.947" Score="1" Body="&lt;p&gt;You should start looking at &lt;a href=&quot;https://en.wikipedia.org/wiki/Merton%27s_portfolio_problem&quot; rel=&quot;nofollow noreferrer&quot;&gt;Merton's Portfolio problem&lt;/a&gt;.&#xA;A lot of papers elaborated on the top of it.&#xA;The principle is &quot;&lt;em&gt;simple&lt;/em&gt;&quot;:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;optimize the allocation between one risky asset (Brownian) and a riskless one;&lt;/li&gt;&#xA;&lt;li&gt;such a way you maintain a portfolio from which you consume money (for instance to pay some expenses).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The main result is the optimal allocation is the same as &lt;a href=&quot;https://en.wikipedia.org/wiki/Modern_portfolio_theory&quot; rel=&quot;nofollow noreferrer&quot;&gt;Markowitz one&lt;/a&gt;.&#xA;It is probably why people did not focus that much on it. &#xA;Nevertheless as soon as you change assumptions, you obtain very interesting results, like for instance in &lt;a href=&quot;http://mathfinance.sns.it/wp-content/uploads/2010/12/Weber_slides.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;On portfolio optimization&#xA;in markets with frictions&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2017-09-10T19:52:36.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35978" PostTypeId="1" AcceptedAnswerId="35993" CreationDate="2017-09-10T20:15:37.820" Score="0" ViewCount="3093" Body="&lt;p&gt;I have historical adjusted closing prices for $k$ stocks over $n$ days. I have a budget of $B$ dollars, and I'd like to choose allocations for each of the stocks, $a_{1:k}$, such that I maximize the Sharpe ratio for this time period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More formally:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;\text{given } &amp;amp; c_{i, j} \text{ for } i=1...n, \; j=1...k  &amp;amp;&amp;amp; \text{adjusted close of stock } j \text{ on day } i \\&#xA;\text{and } &amp;amp; B &amp;amp;&amp;amp; \text{total budget} \\&#xA;\text{find } &amp;amp; a_{1:k} &amp;amp;&amp;amp; \text{allocations for each stock} \\&#xA;\text{that maximize } &amp;amp; s = \frac{\mu}{\sigma} &amp;amp;&amp;amp; \text{Sharpe ratio} \\&#xA;\text{where } &amp;amp; \mu = \frac{1}{n} \sum_{i=1}^n r_i &amp;amp;&amp;amp; \text{sample mean of the daily returns} \\&#xA;&amp;amp; \sigma = \sqrt{\frac{1}{n}\sum_{i=1}^n (r_i - \mu)^2} &amp;amp;&amp;amp; \text{sample standard deviation of the daily returns} \\&#xA;&amp;amp; r_1 = 0 &amp;amp;&amp;amp; \text{return on day one is zero} \\&#xA;&amp;amp; r_i = \frac{p_i}{p_{i-1}} - 1 \;\; \text{for } i=2...n &amp;amp;&amp;amp; \text{percent change in portfolio value on day } i \\&#xA;&amp;amp; p_i = a^{\top} c_i &amp;amp;&amp;amp; \text{portfolio value on day } i \\&#xA;\text{subject to } &amp;amp; a_j \geq 0 \text{ for } j = 1...k &amp;amp;&amp;amp; \text{only non-negative allocations for each stock} \\&#xA;&amp;amp; \sum_{j=1}^k a_j = B &amp;amp;&amp;amp; \text{must use total budget}&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way I tried solving this was simply setting $a_{1:k} = B \times \texttt{softmax}(w_{1:k})$ or $a_{1:k} = B \times \frac{\texttt{relu}(w_{1:k})}{\texttt{sum}(\texttt{relu}(w_{1:k}))}$, for some latent variables $w_{1:k}$, and then running gradient ascent using TensorFlow. This works well in practice, but I'm wondering if there is a better way (i.e., something with guaranteed convergence to the global maximum).&lt;/p&gt;&#xA;" OwnerUserId="24868" LastActivityDate="2017-09-13T15:12:28.143" Title="How to maximize the Sharpe ratio given historical closing prices?" Tags="&lt;optimization&gt;&lt;sharpe-ratio&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35979" PostTypeId="2" ParentId="35975" CreationDate="2017-09-11T01:10:30.770" Score="2" Body="&lt;p&gt;well it's hard to define vega in a process-free manner. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In More Mathematical Finance, I do explore the question, however. My solution is to introduce the concept of increasing uncertainty. Thus model $A$ is more uncertain than $B$ at time $T$ if we can write the rvs for the stock price as&#xA;$$&#xA;B_T = X A_T&#xA;$$&#xA;with $X$ a mean one rv independent of $A_T.$ If the variance of $X$ is positive then the option on $B_T$ is worth more than the one on $A_T.$ This is an application of Jensen's inequality. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the answer to your question in some sense yes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;( see also Merton 1973 )&lt;/p&gt;&#xA;" OwnerUserId="1809" LastEditorUserId="1809" LastEditDate="2017-09-11T23:50:53.137" LastActivityDate="2017-09-11T23:50:53.137" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35983" PostTypeId="2" ParentId="35961" CreationDate="2017-09-11T09:26:26.017" Score="1" Body="&lt;p&gt;You can keep the &lt;code&gt;Swap&lt;/code&gt; instance you created, which contains the swap definition, and change the evaluation date and the curves you're using.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The evaluation date is simple: in Python,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Settings::instance().evaluationDate = new_date&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;will do the trick.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for the curves, you'll have to change the declaration of &lt;code&gt;discount_curve&lt;/code&gt; and &lt;code&gt;libor_curve&lt;/code&gt; so that they use &lt;code&gt;YieldTermStructureRelinkableHandle&lt;/code&gt; instead of &lt;code&gt;YieldTermStructureHandle&lt;/code&gt;.  This will give you the possibility to relink them to a different curve.  Your modified script will be something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# as in the original notebook: create the swap,&#xA;# the curves for pricing on the first evaluation date, etc.&#xA;&#xA;print swap.NPV()   # as of the first evaluation date&#xA;&#xA;Settings::instance().evaluationDate = new_date&#xA;&#xA;libor_curve.linkTo(&#xA;    # the curve for the new evaluation date&#xA;)&#xA;discount_curve.linkTo(&#xA;    # the curve for the new evaluation date&#xA;)&#xA;&#xA;print swap.NPV()  # as of the new date, using the new curves.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In short: keep the swap, change everything else as required.  The swap will recalculate accordingly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One thing you might need to be aware of: if any of the non-expired floating coupon fixed before the evaluation date, you'll have to load the fixing of the underlying index.  The interface to do that is, e.g.,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;libor3M_index.addFixing(date, value)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="308" LastActivityDate="2017-09-11T09:26:26.017" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35985" PostTypeId="1" CreationDate="2017-09-11T12:03:04.160" Score="1" ViewCount="744" Body="&lt;p&gt;Let's say we want to price an option and so need a dividend yield to plug into Black-Scholes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can compute an implied dividend yield for a stock using:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$F=S_0 e^{(r-d)T}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and by isolating for $d$. We can then use this implied dividend in pricing options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But how do we find the implied dividend yield for an index? E.g. what if we want to price an option on an index, and there are no forwards for that index?&lt;/p&gt;&#xA;" OwnerUserId="29386" LastEditorUserId="29386" LastEditDate="2017-09-11T12:28:55.237" LastActivityDate="2017-09-11T12:28:55.237" Title="Dividend yield for an index" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;forward&gt;&lt;index&gt;&lt;dividends&gt;" AnswerCount="0" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="35986" PostTypeId="1" AcceptedAnswerId="35999" CreationDate="2017-09-11T12:10:46.423" Score="1" ViewCount="162" Body="&lt;p&gt;In practice, I have seen articles and financial textbooks on calibration of processes directly under the risk neutral world without showing that the measure is equivalent to a physical measure $P$. They seem to make an assumption that in the physical world, the market is arbitrage free, and that there exists an equivalent measure $P$, whatever the process defined on $Q$ looks like in $P$. Is there a reason for this and why people don't bother with even checking that there exists an equivalent measure $P$?&lt;/p&gt;&#xA;" OwnerUserId="28822" LastActivityDate="2017-09-12T00:03:54.110" Title="Why calibration in $Q$ against option prices without showing that $Q$ is equivalent to $P$?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;risk-neutral-measure&gt;&lt;martingale&gt;" AnswerCount="1" CommentCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="35989" PostTypeId="1" CreationDate="2017-09-11T16:19:57.080" Score="1" ViewCount="548" Body="&lt;p&gt;My question is regarding the PRIIPs regulation, specificaly about category 3 products that depend on yield curves and require PCA. The product in question is index-linked product, which means that the product is linked to a bond (zero or coupon). We know the coupon rate, maturity, nominal value. With these we can simply calculate Present Value of the bond using a discount factor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://ec.europa.eu/finance/docs/level-2-measures/priips-delegated-regulation-2017-1473-annex_en.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;PRIIPs regulation&lt;/a&gt; (beginning on page 8) requires simulating future VaR and future scenarios. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I understand it, for a bond we have to gather historical daily yield curves &lt;strong&gt;log returns&lt;/strong&gt;, perform PCA, disregard all components except 3 most significant, reverse PCA and the result is basically smoothed yield curve returns. Afterwards we bootstrap smoothed yield curve returns for each day until maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What next? The MRM is calculated as VAR at the end of maturity, but at the end of maturity the payoff of any bond is 100% of nominal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also how to continue with simulated return? I calculate Present value with the simulated return. What about the spread then? What curves should I even use in the beginning? The &lt;a href=&quot;https://esas-joint-committee.europa.eu/Publications/Technical%20Standards/JC%202017%2049%20(PRIIPs_flow_diagram_risk_reward).pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;flow diagrams&lt;/a&gt; are not very helpful in this case. They even suggest different approach than what is in the methodology.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Overall this part of methodology is described very poorly (at least for me) and I will appreciate any help, any info, any experience about PRIIPs using yield curves and PCA+bootstrap simulations. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also what does following quote (page10) mean? Recomended holding period should equal maturity.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;em&gt;&quot;adjusted  so  that  the  expected mean  matches  current  expectations for the rate at tenor point T, at the end of the recommended holding period&quot;&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="29232" LastActivityDate="2017-09-11T16:19:57.080" Title="PRIIPs category 3 curve dependent products (PCA)" Tags="&lt;pca&gt;&lt;regulatory-formula&gt;&lt;priips&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="35990" PostTypeId="1" CreationDate="2017-09-11T17:16:18.410" Score="0" ViewCount="128" Body="&lt;p&gt;All the tutorials for making a contract seem to use either Apple or Google as examples:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;goog_contract = create_contract('GOOG', 'STK', 'SMART', 'SMART', 'USD')&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I want to trade CME Feeder Cattle futures - how do I confirm I'm using the correct contract ticker (in IB it's GF), Futures and Exchange designation? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a master list of exchanges and tickers someone can kindly point me to :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cmegroup.com/trading/agricultural/livestock/feeder-cattle.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.cmegroup.com/trading/agricultural/livestock/feeder-cattle.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="29551" LastActivityDate="2017-09-11T17:28:43.263" Title="Making an IB contract: Directory for IBpY exchanges and commodity codes?" Tags="&lt;programming&gt;&lt;futures&gt;&lt;python&gt;&lt;commodities&gt;&lt;interactive-brokers&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35991" PostTypeId="2" ParentId="35990" CreationDate="2017-09-11T17:28:43.263" Score="1" Body="&lt;p&gt;IB has a search portal where you can look up contracts: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://pennies.interactivebrokers.com/cstools/contract_info/v3.9/index.php&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://pennies.interactivebrokers.com/cstools/contract_info/v3.9/index.php&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="27966" LastActivityDate="2017-09-11T17:28:43.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35993" PostTypeId="2" ParentId="35978" CreationDate="2017-09-11T20:19:31.937" Score="2" Body="&lt;h3&gt;Several comments:&lt;/h3&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;What you're looking for in known in finance and portfolio theory as the &lt;a href=&quot;https://en.wikipedia.org/wiki/Modern_portfolio_theory&quot; rel=&quot;nofollow noreferrer&quot;&gt;tangency portfolio&lt;/a&gt;. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Your formulation of the problem is imprecise/problematic.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;It's much cleaner to formulate this problem in terms of portfolio weights, returns, and covariance of returns, rather than with prices.&lt;/li&gt;&#xA;&lt;li&gt;Along those lines, where's the covariance matrix of returns? Portfolio variance with portfolio weights $w_1, \ldots, w_m$ can be written as $\sum_{ij} \operatorname{Cov}(r_i, r_j) w_i w_j$ or with covariance matrix $\Sigma$ and portfolio weight vector $\mathbf{w}$ as $\mathbf{w}' \Sigma \mathbf{w}$.&lt;/li&gt;&#xA;&lt;li&gt;Returns are $\frac{P_t + D_t}{P_{t-1}}$, that is, you must include distributions. (Use a data provider that calculates returns for you.)&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;There are excellent resources across the Internet on the basics of Markowitz portfolio theory.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The &lt;a href=&quot;https://quant.stackexchange.com/questions/8594/derivation-of-the-tangency-maximum-sharpe-ratio-portfolio-in-markowitz-portfol&quot;&gt;solution to this problem in its most basic form&lt;/a&gt; can be trivially found once you solve the linear system $\Sigma \mathbf{x} = \boldsymbol{\mu}$ for $\mathbf{x}$. Using gradient descent to solve this problem strikes me as a big bizarre.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In practice, a big problem is that your estimates of expected returns are garbage and estimates of covariance are poor. Garbage in, garbage out. Possible solutions? Explicit Bayesian methods or regularlization etc.... See Cochrane (2007) and his section on wacky weights.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h3&gt;An intuitive, numerical approach with no short sale constraints&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;These &lt;a href=&quot;https://faculty.washington.edu/ezivot/econ424/portfoliotheorynoshortsalesslides.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;these slides&lt;/a&gt; from Eric Zivot given an overview.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Financial portfolio theory defines &lt;a href=&quot;https://en.wikipedia.org/wiki/Efficient_frontier&quot; rel=&quot;nofollow noreferrer&quot;&gt;the efficient frontier&lt;/a&gt; as the curve showing the lowest standard deviation that can achieve a given expected return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Points along the efficient frontier can be found numerically by solving an optimization problem. To find a non-negative portfolio weight vector $\mathbf{w}\succeq \mathbf{0}$ that achieve expected return $\mu_p$ at minimum variance, solve:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{equation}&#xA;	\begin{array}{*2{&amp;gt;{\displaystyle}r}}&#xA;	\mbox{minimize (over $\mathbf{w}$)} &amp;amp; \mathbf{w}'\Sigma\mathbf{w} \\&#xA;	\mbox{subject to} &amp;amp; \mathbf{w}'\boldsymbol{\mu} = \mu_p \\&#xA;    &amp;amp; \mathbf{w}'\mathbf{1} = 1 \\&#xA;    &amp;amp; \mathbf{w} \succeq \mathbf{0} &#xA;	\end{array}&#xA;\end{equation} $$&#xA;Then portfolio variance is $\sigma^2_p = \mathbf{w}' \Sigma \mathbf{w}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For reasonable number of assets, this &lt;a href=&quot;https://en.wikipedia.org/wiki/Quadratic_programming&quot; rel=&quot;nofollow noreferrer&quot;&gt;quadratic programming&lt;/a&gt; problem can be solved close to instantaneously for a global solution. Starting with the minimum variance portfolio, you can solve then this problem multiple times with different $\mu_p$ values to trace out the efficient frontier, and then you can find the tangency portfolio.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;References:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Cochrane, John, &quot;Portfolio Theory, 2007, &lt;a href=&quot;https://faculty.chicagobooth.edu/john.cochrane/research/papers/portfolio_text.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;Portfolio Theory&quot;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-09-13T15:12:28.143" LastActivityDate="2017-09-13T15:12:28.143" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35994" PostTypeId="1" AcceptedAnswerId="35998" CreationDate="2017-09-11T21:01:35.527" Score="3" ViewCount="2573" Body="&lt;p&gt;I'm not too sure what the answer is to this. You have a call option on a security worth 100 now that will either be worth 110 or 95 dollars at a future date. The strike of this option is 105. What is an estimated value of this call option?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="11917" LastActivityDate="2018-01-06T10:46:17.467" Title="Determining price of Option interview question" Tags="&lt;option-pricing&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="35995" PostTypeId="1" AcceptedAnswerId="36064" CreationDate="2017-09-11T21:50:50.620" Score="1" ViewCount="365" Body="&lt;p&gt;Let's assume I am buying a NZD/USD 1Y forward for $1000000 on the 20/02/2017. The NZD/USD 1Y forward point is currently -270 and spot rate is 0.8325. (Example taken from &lt;a href=&quot;https://www.hedgebookpro.com/blog/calculating-fx-forward-points/&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I want to have a price return for this at asset at 21/02/2017, 22/02/2017 etc. The 1Y FX forward becomes a 1Y - 1 day, 1Y - 2 days FX forward etc. which are not quoted. So they have to be estimated.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do have access to the new 1Y FX forward rate on all of those future dates and I also have access to the 6M FX forward rate, 2-Y FX forward rate etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I create an estimated price series?&lt;/p&gt;&#xA;" OwnerUserId="15763" LastActivityDate="2017-09-18T02:04:04.310" Title="Price series for an FX forward contract" Tags="&lt;fx&gt;&lt;forward&gt;&lt;asset-pricing&gt;&lt;forward-rate&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="35996" PostTypeId="1" AcceptedAnswerId="36151" CreationDate="2017-09-11T21:55:38.143" Score="1" ViewCount="115" Body="&lt;p&gt;I'm researching short selling volume data reports from NYSE, NASDAQ and BATS (Sources: FINRA + BATS website). And my question is: &lt;strong&gt;Why are those numbers so high?&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it really just a speculative short selling or a big piece is made from another transactions - like insider selling due Securities Act of 1933 prohibiting direct selling of securities obtained from issuer (so they are shown like shorts to regulators).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Compared to &lt;strong&gt;short interest&lt;/strong&gt; (published 2 times per month) those numbers are insane.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I attach a chart with &lt;strong&gt;short volume as a percentage of total volume&lt;/strong&gt; reported to FINRA and by BATS (&lt;strong&gt;this volume is significantly lower than total volume published by Bloomberg&lt;/strong&gt; - what might be another reason) But distribution of short selling should be approximately same across trading venues right? (excl. darkpools of course)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/2crDf.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/2crDf.png&quot; alt=&quot;Alcoa short volume&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="28920" LastActivityDate="2017-09-22T23:45:51.120" Title="Short selling volume reports" Tags="&lt;equities&gt;&lt;data&gt;&lt;short-selling&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35997" PostTypeId="1" CreationDate="2017-09-11T23:19:44.060" Score="2" ViewCount="40" Body="&lt;p&gt;I've came across this question which is puzzling me. Imagine that interest rates are zero and that you observe a stock $S_t$ whose value today $S_0$ is equal to 1\$. We consider the derivative that pays 1\$ at the time $\tau$ where the stock crosses a fixed barrier $B &amp;gt; 1\$$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We will suppose that the risk-neutral probability of the event&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathbb{Q} \left(\exists t \geq 0, \quad S_t\geq B\right)=1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us now consider the following pricing approaches :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Martingale Approach :&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Using this approach, we know that the value of the derivative today is the expected (discounted, but rates are 0.0) payoff under the risk-neutral probability. The payoff is exactly equal to the indicator function&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$1_{\exists t \geq 0,S_t\geq B}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the price, is simply the probability of that event which is 1.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Replication Approach&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Imagine that one wants to replicate the option using the underlying, he can buy $1/B$ of the stock today. At the time where the stock value is equal to $B$, the portfolio is worth $1/B * B = 1$ which is the payoff of the option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\implies$ A portfolio of $1/B$ shares today replicates the payoff of the option at each state of the world. By no arbitrage the value of the option should be $1/B$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The two approaches yield different pricing results, yet I cannot find the logical flow behind one method or the other. Can you please help ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="29553" LastActivityDate="2017-09-11T23:19:44.060" Title="Infinite Horizon Barrier Option Paradoxe" Tags="&lt;option-pricing&gt;&lt;martingale&gt;&lt;replication&gt;" AnswerCount="0" CommentCount="0" ClosedDate="2017-09-12T18:13:17.953" ContentLicense="CC BY-SA 3.0" />
  <row Id="35998" PostTypeId="2" ParentId="35994" CreationDate="2017-09-11T23:54:43.330" Score="8" Body="&lt;p&gt;I would think you are supposed to assume that cash is worth 1 at all times. There is miniscule interest across a day in any case. They are testing if you can do a one-step binomial tree. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then either price by replication or risk-neutral valuation. The RN probability of an up-move is $q$ such that&#xA;$$&#xA;10 q -5(1-q) =0.&#xA;$$&#xA;So $q=1/3$ so the price is &#xA;$$&#xA;\frac{1}{3} \times (110-105) + \frac{2}{3} \times 0 = \frac{5}{3}.&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="1809" LastEditorUserId="24222" LastEditDate="2018-01-06T10:46:17.467" LastActivityDate="2018-01-06T10:46:17.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="35999" PostTypeId="2" ParentId="35986" CreationDate="2017-09-12T00:03:54.110" Score="2" Body="&lt;p&gt;Fundamentally, option pricing is an extrapolation exercise. Fitting a q-measure model to the observed option prices gives a way of performing the extrapolation. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If q-measure model gives reasonable dynamics to the option prices observed and the underlying then the process of dynamic hedging with the options will work. If it doesn't, there will be systematic biases and the model will be poor. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Practitioners don't worry about the real-world process because it's unknowable and modelling it better rarely helps with the modelling and hedging.&lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2017-09-12T00:03:54.110" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36000" PostTypeId="1" CreationDate="2017-09-12T09:08:57.853" Score="3" ViewCount="262" Body="&lt;p&gt;I wonder if some one can help me with the solution to this question from Björk's &quot;Arbitrage theory in continuous time&quot;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;At date of maturity $T_2$ the holder of a financial contract will&#xA;  obtain the amount:&#xA;  $$ \frac{1}{T_2 - T_1 } \int_{T_1}^{T_2} S(u) du $$&#xA;  where $T_1$ is some time point before $T_2$. Determine the arbitrage free&#xA;  price of the contract at time $t$. Assume you live in a Black-Scholes world and that $t&amp;lt;T_1$.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Earlier in the book he states this theorem that I think one might use:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The arbitrage free price of a claim $\Phi(S(T))$ is given by:&#xA;  $$ \Pi(t,\Phi)=F(s,t) $$&#xA;  where $F(\cdot,\cdot)$ is given by the formula &#xA;  $$ F(s,t)=e^{-r(T-t)}E_{s,t}^Q [\Phi(S(T))] $$ &#xA;  where the $Q$-dynamics of $S(t)$ are given by &#xA;  $$ dS(t)=rS(t)dt + S(t)\sigma(t,S(t))dW(t) $$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;However I'm not really sure how to apply it in this case. Can anybody help me out here?&lt;/p&gt;&#xA;" OwnerUserId="29562" LastEditorUserId="20454" LastEditDate="2017-09-12T10:05:19.907" LastActivityDate="2017-09-12T10:15:41.900" Title="Determine price of financial contract" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36002" PostTypeId="2" ParentId="36000" CreationDate="2017-09-12T10:03:03.827" Score="5" Body="&lt;p&gt;As stated in the theorem you mention, the price $\pi_t$ at $t$ of a financial contract which pays $\Phi(S_T)$ at maturity $T&amp;gt;t$ $-$ where $\Phi(\cdot)$ is the payoff function and $(S_t)_{t \geq 0}$ is the underlying asset $-$ is given by the conditional risk-neutral expectation of its discounted payoff:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \pi_t = \mathbb{E}^{\mathbb{Q}}\left[e^{-\int_t^Tr_udu}\Phi(S_T)|\mathcal{F}_t\right]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming the risk-free rate $(r_t)_{t \geq 0}$ is constant for all $t$, the price of your financial contract is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \pi_t = \frac{e^{-r(T_2-t)}}{T_2-T_1}\mathbb{E}^{\mathbb{Q}}\left[\int_{T_1}^{T_2}S_udu|\mathcal{F}_t\right] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \Phi(S_{T_2}) = \frac{1}{T_2-T_1}\int_{T_1}^{T_2}S_udu $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By linearity of the risk-neutral expectation operator $\mathbb{E}^{\mathbb{Q}}[\cdot]$ and the risk-free return of the asset $S_t$ under the measure $\mathbb{Q}$, we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;\pi_t &amp;amp; = \frac{e^{-r(T_2-t)}}{T_2-T_1}\int_{T_1}^{T_2}\mathbb{E}^{\mathbb{Q}}\left[S_u|\mathcal{F}_t\right]du &#xA;\\[6pt]&#xA;&amp;amp; = \frac{e^{-r(T_2-t)}}{T_2-T_1}\int_{T_1}^{T_2}S_te^{r(u-t)}du &#xA;\\[6pt]&#xA;&amp;amp; = \frac{e^{-r(T_2-t)}S_t}{T_2-T_1}\int_{T_1}^{T_2}e^{r(u-t)}du &#xA;\\[6pt]&#xA;&amp;amp; = e^{-r(T_2-t)}S_t\frac{e^{r(T_2-t)}-e^{r(T_1-t)}}{r(T_2-T_1)}&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Letting $D(t,T)$ be the discount-factor&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ D(t,T) = e^{-r(T-t)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and $\text{For}_S(t,T)$ the forward price of asset $S_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \text{For}_S(t,T) = e^{r(T-t)}S_t $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a convenient representation of the result is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \pi_t = D(t,T_2)\frac{\text{For}_S(t,T_2)-\text{For}_S(t,T_1)}{r(T_2-T_1)}$$&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-09-12T10:15:41.900" LastActivityDate="2017-09-12T10:15:41.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36003" PostTypeId="1" CreationDate="2017-09-12T13:26:10.573" Score="2" ViewCount="357" Body="&lt;p&gt;I was hoping somebody can assist me with a query. Would it be a valid approach to  revalue a frn with a discount margin from a comparable bond as par minus the difference between the quoted margin and comparable margin multiplied by the notional?  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="29565" LastEditorUserId="29565" LastEditDate="2017-09-13T07:16:29.583" LastActivityDate="2019-09-03T22:00:33.967" Title="Floating rate note value approximation" Tags="&lt;fixed-income&gt;&lt;pricing&gt;&lt;valuation&gt;&lt;yield&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36004" PostTypeId="2" ParentId="34113" CreationDate="2017-09-12T13:45:28.673" Score="1" Body="&lt;p&gt;Interest rate delta depends on how you define it but generally (according to &lt;a href=&quot;http://www.bis.org/bcbs/publ/d352.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;banking regulation anyway&lt;/a&gt;) is not the same as $\rho$&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$\rho$ is related to the risk free rate to do with the theoretical funding of a position assuming no arbitrage.&lt;/li&gt;&#xA;&lt;li&gt;Interest rate delta is related to the sensitivities present in the basket of underlyings w.r.t. different rates curves&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The simplest way to understand this is the treat the PV as a function $f(\mathbf{x})$ of a vector of risk factors (e.g. rates, credit spread etc.), $\mathbf{x}$, that you represent with a Taylor expansion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the $i^{\text{th}}$ sensitivity is a single rate curve there exists a first order term in the expansion&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;f(\mathbf{x}) \propto \frac{\partial f (\mathbf{x})}{\partial x_i}&#xA;$$&#xA;which you could also denote $\Delta_i$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As touched on above, what happens in risk management is that $\mathbf{x}$ is decomposed into subsets that are treated as independent (with associated correlations that can be applied later)&#xA;$$\mathbf{x} = \text{Rates} + \text{Credit} + \dots$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and this can go further in rates as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\text{Rates} = 3m Libor + 6mLibor + 6mEuribor + \dots$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A lot of risk models will currently look at a parallel shifts in the yield curve and then apply some kind of correlation factor at the various stages of decomposition above&lt;/p&gt;&#xA;" OwnerUserId="16087" LastActivityDate="2017-09-12T13:45:28.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36005" PostTypeId="1" CreationDate="2017-09-12T14:14:41.287" Score="3" ViewCount="209" Body="&lt;p&gt;currently I am working through the paper of Tino Kluge &quot;Pricing Swing Options and other Electricity Derivatives&quot; to get a better understanding about the power markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The author establishes methods in order to estimate relevant parameters for a ornstein-uhlenbeck process with jumps in chapter 3.3 by the means of linear regression and maximum likelihood. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I implemented the formulas and results seem sensible, but does anyone of you know more data sources than the small table on page 31 of the paper, where I could get benchmark results for more diverse time periods and markets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="18620" LastActivityDate="2018-11-06T20:00:35.807" Title="Electric power price parameter estimation" Tags="&lt;estimation&gt;&lt;mean-reversion&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36006" PostTypeId="2" ParentId="74" CreationDate="2017-09-12T14:14:53.123" Score="1" Body="&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.zorro-trader.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.zorro-trader.com/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/gbeced/pyalgotrade&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/gbeced/pyalgotrade&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I found a lot of the libraries were quite lousy as for any good strategy the parameters need to be optimised to some degree and thus the portfolio might need to be &quot;backtested&quot; a number of times &lt;em&gt;(really this isn't a backtest but more like &quot;training&quot;)&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This makes a lot of libraries totally useless when they take several hours for fitting parameters to a minute-by-minute algo-strategy.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Speed&lt;/h1&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Zorro trader is a bit awkward as I have a Linux machine and it is a Windows compiled C++ program. However, it is &lt;strong&gt;super quick&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;PyAlgoTrade has a number of tricks to speed up backtests and it can be pretty quick.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;h1&gt;Flexibility&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Both allow the use of arbitrary market input data. This allows you to create random stressed scenarios as well as use your own market data.&lt;/p&gt;&#xA;" OwnerUserId="16087" LastActivityDate="2017-09-12T14:14:53.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36007" PostTypeId="2" ParentId="36005" CreationDate="2017-09-12T14:19:52.810" Score="1" Body="&lt;p&gt;I found New Zealand has some great open source data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The ASX publishes live forwards:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.asx.com.au/asx/markets/futuresPriceList.do?code=ED&amp;amp;type=FUTURE&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.asx.com.au/asx/markets/futuresPriceList.do?code=ED&amp;amp;type=FUTURE&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;You can also get historic data from the following authority:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.emi.ea.govt.nz/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.emi.ea.govt.nz/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you are after high freq data I'm guessing you may struggle&lt;/p&gt;&#xA;" OwnerUserId="16087" LastActivityDate="2017-09-12T14:19:52.810" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36009" PostTypeId="2" ParentId="36003" CreationDate="2017-09-12T16:41:19.807" Score="1" Body="&lt;p&gt;I don't see any issue with it as long as the terms and attributes of the two FRNs are comparable. Were the two FRNs issued on the same date?&lt;/p&gt;&#xA;" OwnerUserId="29470" LastActivityDate="2017-09-12T16:41:19.807" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36010" PostTypeId="1" AcceptedAnswerId="36013" CreationDate="2017-09-12T22:13:52.283" Score="0" ViewCount="90" Body="&lt;p&gt;Bond ETFs usually make monthly dividend payments. The ETF manager receives quarterly or semiannual coupons on the underlying bonds in the ETF. What is the time delay between the coupons received and the monthly dividends?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I.e. Are coupons received in quarter x, and then distributed over 3 months in quarter x + 1 (or for semiannual bonds H1 and then distributed over 6 months in H2)? What about situations where coupons from different bonds are received at various points in the quarter, what happens then...are they paid out in the same month?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would be extra grateful if you could cite the source for your information. Been looking for a resource or PDF that explains this stuff.&lt;/p&gt;&#xA;" OwnerUserId="29386" LastEditorUserId="29386" LastEditDate="2017-09-12T22:21:39.980" LastActivityDate="2017-09-13T04:31:47.183" Title="Bond ETF Dividends" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;etf&gt;&lt;dividends&gt;&lt;yield&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36012" PostTypeId="2" ParentId="35937" CreationDate="2017-09-13T04:02:14.223" Score="1" Body="&lt;p&gt;You've two options:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Just use dates for which data is available for all assets&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Transform the price vectors to xts format&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;test &amp;lt;- xts([returnvector1], order.by=[column with date])&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Merge the individual price vectors to one large return matrix &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;PriceMat &amp;lt;- merge(test1, test2, test3,..., by=[&quot;Date&quot;], all=FALSE)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Transform price matrix to returns matrix&#xA;library(quantmod)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;RetMat &amp;lt;- apply(PriceMat,2,Delt,type=geometric)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;It should work like this. I'm so sorry but I haven't the chance to check the code.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Fill with mean value&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could first transform the price vectors to return vectors, and merge them afterwards  (&lt;code&gt;merge(retvec1, retvec2, all=TRUE)&lt;/code&gt;). The matrix you will get now, will have many NA values. Find those NAs overwrite them with mean-returns for the individual asset&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="26899" LastEditorUserId="29318" LastEditDate="2018-10-04T14:19:35.673" LastActivityDate="2018-10-04T14:19:35.673" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="36013" PostTypeId="2" ParentId="36010" CreationDate="2017-09-13T04:31:47.183" Score="1" Body="&lt;p&gt;From &lt;a href=&quot;https://www.blackrockblog.com/2015/10/02/how-bond-etf-distributions-work/&quot; rel=&quot;nofollow noreferrer&quot;&gt;BlackRock&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;As a ’40 Act fund, a bond ETF is required to distribute all interest&#xA;  and capital gains to investors on at least an annual basis. Most bond&#xA;  ETFs distribute interest on a monthly basis, which can provide a&#xA;  smoother income stream than the semi-annual coupon payments an&#xA;  individual bond typically provides (see hypothetical illustration&#xA;  below).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/gJpaF.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/gJpaF.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19096" LastActivityDate="2017-09-13T04:31:47.183" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36014" PostTypeId="2" ParentId="18158" CreationDate="2017-09-13T04:33:32.900" Score="0" Body="&lt;p&gt;Very interesting question Mr. Sundar. The reason for considering deferred revenue as a non-monetary liability is primarily because this liability is created out of a cash receipt from a customer for a service/product which is not yet delivered. Now since the cash is already received the liability is no more monetary. Hope you got the logic!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers!&#xA;AJ &lt;/p&gt;&#xA;" OwnerUserId="29574" LastActivityDate="2017-09-13T04:33:32.900" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36020" PostTypeId="1" CreationDate="2017-09-13T22:10:50.003" Score="2" ViewCount="157" Body="&lt;p&gt;In &lt;a href=&quot;http://janroman.dhis.org/finance/NumeriX/Numerix_Funding%20beoyned%20Discounting.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Piterbarg (2010)&lt;/a&gt; the author presents a modified Black-Scholes model with an economy with a CSA-collateral (OIS) rate $r_C(t)$, a repo rate $r_R(t)$ and considers a derivative $V(t)$ written on a stock share $S(t)$ and collateralized by $C(t)$. The market has two assets, a zero-coupon bond yielding the OIS rate $P_C(t)$ and the stock, both following under their respective risk-neutral measures a Geometric Brownian Motion with drifts the OIS rate and the repo rate respectively (assuming no dividends) $-$ numbering as in paper:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;dP_C(t)/P_C(t) &amp;amp;= r_C(t)dt + \sigma_C(t)dW_C(t) \qquad \text{(1)}&#xA;\\[6pt]&#xA;dS(t)/S(t) &amp;amp;= r_R(t)dt+\sigma_S(t)dW_S(t)  \qquad \text{(4)}&#xA;\end{align}$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The author defines one risk-neutral measure $P$ from the zero-coupon bond's Brownian Motion $W_C(t)$, however note that Piterbarg's hedging argument shows that the stock price is a martingale under the risk-neutral measure associated to the money market account with rate $r_R(t)$. Then the author states just below equation $\text{(4)}$:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;Note that if our probability space&lt;/em&gt;&lt;/strong&gt; [generated by the stock's Brownian Motion $W_S(t)$] &lt;strong&gt;&lt;em&gt;is rich enough, we can take it to be the same risk-neutral measure $P$ as used in $\text{(1)}$.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What might the author mean by that sentence?&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-10-09T15:36:27.420" LastActivityDate="2017-10-09T15:36:27.420" Title="Risk-neutral measure(s) under collateralization and funding costs" Tags="&lt;option-pricing&gt;&lt;risk-neutral-measure&gt;&lt;collateral&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36021" PostTypeId="1" CreationDate="2017-09-13T22:30:26.840" Score="1" ViewCount="353" Body="&lt;p&gt;I hear this during morning meetings where traders are making references to buying the 5 year and hedging with 2 year and 10 year? Does this mean that the position is neutral to overall movements in interest rates? I still don't get the concept of the hedging.&lt;/p&gt;&#xA;" OwnerUserId="29342" LastActivityDate="2017-09-13T23:23:45.567" Title="What does Buying 5 year and hedging with 2 year and 10 year mean?" Tags="&lt;fixed-income&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36022" PostTypeId="2" ParentId="36021" CreationDate="2017-09-13T23:05:53.110" Score="0" Body="&lt;p&gt;Assume you're paying (the fixed rate) 5y on a swap. If you then hedge yourself by paying on a 2y swap and receiving on a 10y swap, you are netting a positive cash-flow near the 5y swap rate you pay (assuming a monotonically increasing swap curve). The reason that the receiving swap on the long end of the curve (10y) must be further away from the hedged swap (5y) than the paying swap (2y) is normally due to the decreasing nature of the term-structure of convexity $-$ i.e. the swap curve's slope decreases with maturity. &lt;/p&gt;&#xA;" OwnerUserId="20454" LastActivityDate="2017-09-13T23:05:53.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36023" PostTypeId="2" ParentId="36021" CreationDate="2017-09-13T23:23:45.567" Score="2" Body="&lt;p&gt;Yes this means the trader is selling a combination of 2yr and 10yr bonds to offset the interest rate risk of the purchased 5yr bonds. This is best understood in terms of dv01.  For example , you buy 100k dv01 of 5yr notes and sell 50k dv01 each of 2yr and 10yr notes.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-09-13T23:23:45.567" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36025" PostTypeId="2" ParentId="34298" CreationDate="2017-09-14T02:11:33.003" Score="0" Body="&lt;p&gt;Don't bother with Yahoo data - it's skewed.  I used the backdoor approach and am able to download data without a problem.  But quite a few of the data files had inaccurate stock data - it's as though their algorithm to adjust for splits has biasing over time.  Google is 100% accurate but it's limited to 16 years of data - at least the link that I use.&lt;/p&gt;&#xA;" OwnerUserId="29590" LastActivityDate="2017-09-14T02:11:33.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36026" PostTypeId="1" CreationDate="2017-09-14T03:24:06.463" Score="0" ViewCount="112" Body="&lt;p&gt;for an expiring European in-the-money (ITM) call (delta = 0.9), if $T$ increases from 1 to 30, what should delta be now? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say $K = 100$, $S_0 = 105$, $\sigma = 10%$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuitively I think the delta would decrease since now there is more time for the option to move out of money, and we are less certain it would end ITM. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However BS pricing formula's $\mathcal{N} \left( d_1 \right)$ section seem to suggest that increased T would have a positive effect?&lt;/p&gt;&#xA;" OwnerUserId="28902" LastEditorUserId="16148" LastEditDate="2017-09-14T07:39:45.640" LastActivityDate="2017-09-14T14:38:40.573" Title="ITM call delta when T increases" Tags="&lt;black-scholes&gt;&lt;european-options&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36027" PostTypeId="2" ParentId="36026" CreationDate="2017-09-14T04:47:48.393" Score="1" Body="&lt;p&gt;Remember $$ d_1 = \frac{\log(S/K) + \left(r+\frac{1}{2}\sigma^2\right)T}{\sigma\sqrt{T}}$$ so the first term is decreasing in $T.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's take the derivative: $$\frac{\partial \delta}{\partial T} = N'(d_1)\frac{\partial d_1}{\partial T} = \frac{e^{-d_1^2/2}}{\sqrt{2\pi}}\frac{1}{2\sigma\sqrt T}\left(-\frac{1}{T}\log (S/K) + r+\frac{1}{2}\sigma^2\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We see that it's possible for this quantity to be negative and it's less positive / more negative (for everything else fixed) when $S/K$ becomes large.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also observe that for $r=0$ we can rewrite it as: $$ \frac{\partial \delta}{\partial T}=-\frac{e^{-d_1^2/2}}{\sqrt{2\pi}}\frac{1}{2T}d_2.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recall that $N(d_2)$ is the probability of finishing in the money, so we see the derivative is negative whenever there is a more than $50\%$ chance of finishing in the money (when $r$ is non-zero, this is adjusted a bit).&lt;/p&gt;&#xA;" OwnerUserId="29286" LastEditorUserId="29286" LastEditDate="2017-09-14T14:38:40.573" LastActivityDate="2017-09-14T14:38:40.573" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="36028" PostTypeId="1" CreationDate="2017-09-14T13:52:18.630" Score="3" ViewCount="2972" Body="&lt;p&gt;I am struggling to get an equivalent of Excel's YIELD function using Quantlib in python. As you can see from the Excel documentation on YIELD &lt;a href=&quot;https://support.office.com/en-us/article/YIELD-function-f5f5ca43-c4bd-434f-8bd2-ed3c9727a4fe?NS=EXCEL&amp;amp;Version=16&amp;amp;SysLcid=1033&amp;amp;UiLcid=1033&amp;amp;AppVer=ZXL160&amp;amp;HelpId=xlmain11.chm60490&amp;amp;ui=en-US&amp;amp;rs=en-US&amp;amp;ad=US&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;, only a few parameters are needed compared to this example using Quantlib &lt;a href=&quot;http://gouthamanbalaraman.com/blog/quantlib-bond-modeling.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://gouthamanbalaraman.com/blog/quantlib-bond-modeling.html&lt;/a&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, if I use the function bondYield, I can't seem to get the same values as in Excel. Take for example this bond:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/bI3rf.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/bI3rf.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;the YIELD above has the formula &lt;code&gt;=YIELD(B1,B2,B3/100,B4,100,2,1)*100&lt;/code&gt;. The yield is &lt;code&gt;1.379848&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I try to set up similar parameters in Quantlib, as shown below&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# ql.Schedule&#xA;calendar = ql.UnitedStates()&#xA;bussinessConvention = ql.ModifiedFollowing&#xA;dateGeneration = ql.DateGeneration.Backward&#xA;monthEnd = False&#xA;cpn_freq = 2&#xA;issueDate = ql.Date(30, 9, 2014)&#xA;maturityDate = ql.Date(30, 9, 2019)&#xA;tenor = ql.Period(cpn_freq)&#xA;schedule = ql.Schedule(issueDate, maturityDate, tenor, calendar, bussinessConvention,&#xA;                       bussinessConvention, dateGeneration, monthEnd)&#xA;&#xA;# ql.FixedRateBond&#xA;dayCounter = ql.ActualActual() &#xA;settlementDays = 1&#xA;faceValue = 100&#xA;couponRate = 1.75 / 100&#xA;coupons = [couponRate]&#xA;fixedRateBond = ql.FixedRateBond(settlementDays, faceValue, schedule, coupons, dayCounter)&#xA;&#xA;# ql.FixedRateBond.bondYield&#xA;compounding = ql.Compounded&#xA;cleanPrice = 100.7421875&#xA;fixedRateBond.bondYield(cleanPrice, dayCounter, compounding, cpn_freq) * 100&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This gives a yield of &lt;code&gt;1.3784187000852273&lt;/code&gt;, which is close, but not the same as the one given by the excel function.&lt;/p&gt;&#xA;" OwnerUserId="28262" LastEditorUserId="28262" LastEditDate="2017-09-15T09:57:49.303" LastActivityDate="2017-09-15T09:57:49.303" Title="Excel YIELD function equivalent in python Quantlib" Tags="&lt;python&gt;&lt;quantlib&gt;&lt;bond-yields&gt;&lt;excel&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36033" PostTypeId="2" ParentId="36028" CreationDate="2017-09-14T20:10:00.650" Score="2" Body="&lt;p&gt;You're getting downvoted for asking a bad question. I'll explain why the question is bad.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your link to the Excel documentation has the full specification of what YIELD does. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If there is one coupon period or less until redemption, YIELD is&#xA;  calculated as follows:&lt;/p&gt;&#xA;  &#xA;  &lt;blockquote&gt;&#xA;    &lt;p&gt;(image here; look at your link) &#xA;    where:&lt;/p&gt;&#xA;  &lt;/blockquote&gt;&#xA;  &#xA;  &lt;p&gt;A = number of days from the beginning of the coupon period to the&#xA;  settlement date (accrued days).&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;DSR = number of days from the settlement date to the redemption date.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;E = number of days in the coupon period.&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;If there is more than one coupon period until redemption, YIELD is&#xA;  calculated through a hundred iterations. The resolution uses the&#xA;  Newton method, based on the formula used for the function PRICE. The&#xA;  yield is changed until the estimated price given the yield is close to&#xA;  price.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So: if there is one coupon period, you have an explicit formula. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, you have to implement the PRICE equation (&lt;a href=&quot;https://support.office.com/en-US/article/PRICE-function-3EA9DEAC-8DFA-436F-A7C8-17EA02C21B0A&quot; rel=&quot;nofollow noreferrer&quot;&gt;Excel documentation&lt;/a&gt;) and obtain $yield$ such that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$PRICE(yield,\theta) = yield $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\theta$ is a vector with the other parameters. Now, you could do this two ways:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Implement a custom numerical routine. Excel does this with Newton's method, but you could try fixed-point iteration (after doing some math and verifying that PRICE satisfies the conditions of the contraction mapping theorem.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If this sounds hard: use &lt;a href=&quot;https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.root.html#scipy.optimize.root&quot; rel=&quot;nofollow noreferrer&quot;&gt;scipy.optimize.root&lt;/a&gt; (which you could have discovered googling for &quot;python function root&quot;. Note that this function solves the equation $f(x)=0$, so you want to feed it $PRICE(yield,\theta)-yield$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So in summary: all you have to do is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Implement YIELD for one coupon period or less, as detailed in the Excel documentation&#xA;2) Implement PRICE as detailed in the Excel documentation; and&#xA;3) Use Python for root-finding.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This might take you a good half hour of coding, but hey, you're learning.&lt;/p&gt;&#xA;" OwnerUserId="28717" LastActivityDate="2017-09-14T20:10:00.650" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="36035" PostTypeId="1" AcceptedAnswerId="36043" CreationDate="2017-09-15T02:58:53.353" Score="8" ViewCount="506" Body="&lt;p&gt;I recently got an interview question for a junior analyst role asking if risk could be infinite in CAPM, and I wasn't sure how to answer it. I don't see how an asset could be infinitely more volatile than the market. I understand a theoretical 0-beta asset, but not infinity. So how high can beta really be? In what case would it be infinite (if any)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I apologize if this question is very elementary and I'm missing a key point here.&lt;/p&gt;&#xA;" OwnerUserId="19189" LastActivityDate="2017-09-15T16:07:55.293" Title="How high can Beta be in CAPM?" Tags="&lt;capm&gt;&lt;beta&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36038" PostTypeId="1" AcceptedAnswerId="36067" CreationDate="2017-09-15T06:10:26.167" Score="-1" ViewCount="1497" Body="&lt;p&gt;I have confused by three concepts and following is my understanding:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;Quoted Price&lt;/code&gt; and &lt;code&gt;Cash price&lt;/code&gt; are totally different things in the &lt;code&gt;Treasury Bill&lt;/code&gt; and &lt;code&gt;Treasury Bond&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the &lt;code&gt;Treasury Bill,&lt;/code&gt; they are the two alternative ways to state the amount of coupon over face value 100 and we have the relation&#xA;$$\dfrac{n}{360}\times\text{Quoted Price} = 100 - \text{Cash price}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in the &lt;code&gt;Treasury Bond,&lt;/code&gt; they describe the current price of bond with the relation:&#xA;$$\text{Cash price = Quoted price + Accrued interest since last coupon date}.$$&#xA;$$\text{Cash price = Dirty price}$$ &#xA;$$\text{Quoted price = Clean price}$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;code&gt;Value of Bond&lt;/code&gt; is calculated by the zero curve or the yield of the bond, when the coupon structure is known. The &lt;code&gt;Value of Bond&lt;/code&gt; have the relation with &lt;code&gt;Quoted Price&lt;/code&gt; and &lt;code&gt;Cash price&lt;/code&gt; in &lt;code&gt;Treasury Bond&lt;/code&gt;(&gt;,&amp;lt; or =), but has nothing related in &lt;code&gt;Treasury Bill.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not sure whether above understanding is correct.&lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-09-18T12:22:10.997" Title="Treasury Bill and Treasury Bond : Quoted Price VS Cash Price VS Value of Bond" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;bond&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36039" PostTypeId="2" ParentId="36028" CreationDate="2017-09-15T07:37:15.180" Score="5" Body="&lt;p&gt;Your question is more or less answered in &lt;a href=&quot;https://quant.stackexchange.com/questions/25382/how-to-calculate-bond-yield-in-quantlib-python&quot;&gt;How to calculate bond yield in QuantLib - Python&lt;/a&gt;. Once you've built the fixed-rate bond object (as in the post you linked) you can call &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;fixedRateBond.bondYield(targetPrice, day_count, compounding, frequency)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Comparing the above to the Excel interface in your link, &lt;code&gt;targetPrice&lt;/code&gt; is &lt;code&gt;pr&lt;/code&gt;, &lt;code&gt;frequency&lt;/code&gt; is the frequency as in Excel, and &lt;code&gt;day_count&lt;/code&gt; is &lt;code&gt;basis&lt;/code&gt;.&#xA;The other parameters (maturity, settlement etc.) go in the definition of the bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This will let you skip the part in Goutham's post that deals with spot-curve definition and pricing engines. However, you won't have something as simple as Excel's formula.  That's because the definition of the bond has to include quite a few real-life parameters (such as: should we adjust the start and end of coupons to a business day when they fall on a weekend or a holiday? If so, how? What calendar should we use to decide what days are holidays? Do you want the yield to be continuously compounded?)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to avoid this, you can choose defaults that make sense for you and wrap the calculations in a simpler interface that you can call.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2017-09-15T07:37:15.180" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36041" PostTypeId="1" AcceptedAnswerId="36047" CreationDate="2017-09-15T10:28:54.550" Score="0" ViewCount="165" Body="&lt;p&gt;This is John Hull's book &lt;code&gt;Options, Futures and Other Derivatives 9th&lt;/code&gt; &lt;code&gt;Page 142&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose the maturity of a &lt;code&gt;Eurodollar futures&lt;/code&gt; is $T.$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the settlement of futures is $T$ and the payment of deposit for the interest is $T+0.25?$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As this understanding, suppose enter rate of future is $F$ and the real rate of future is $P$ at $T.$ We would assume an interest rate of $F$ for the three-month period at time $T.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then we will receive the cash flow $(F-P)\times 0.25$ from futures settlement at $T$(suppose only pay one time at $T$)  and receive the deposit of interest $P*0.25$ at $T+0.25,$ discounted the deposit into $T$ we have the total cash of $1$ contract&#xA;$$(F-P)*0.25 +\dfrac{P*0.25}{1+F*0.25}.$$&#xA;To keep the the rate is still $F$ at $T,$ we should hold $k$ contract, then we have the equation&#xA;$$\left((F-P)*0.25 +\dfrac{P*0.25}{1+F*0.25}\right)\times k = F.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can not understand the result in the example $1/(1+0.035 * 0:25)= 0.9913$ contracts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/07DFG.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/07DFG.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/cx6l1.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/cx6l1.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26165" LastEditorUserId="26165" LastEditDate="2017-09-15T10:47:19.907" LastActivityDate="2017-09-16T07:07:22.633" Title="The settlement and payment date of Eurodollar" Tags="&lt;futures&gt;&lt;eurodollars&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36042" PostTypeId="2" ParentId="8274" CreationDate="2017-09-15T13:33:45.857" Score="2" Body="&lt;p&gt;You can definitely calculate the real-world probabilities. For instance, just think log-returns are normally distributed, take the mean and standard deviation of the past log-returns and ta-da... You just calculated the real world probabilities of the underlying asset! Of course, your estimate is just as good as your assumptions. &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You just assumed log-returns behaved as Normal Distribution (analogous to Brownian Motion, or very close).&lt;/li&gt;&#xA;&lt;li&gt;You just assumed mean and standard deviation of the asset will not change until expiration.&lt;/li&gt;&#xA;&lt;li&gt;You assumed several other minor things as well.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;If these assumptions hold&lt;/em&gt;, for the time of the contract, you can calculate the real world probability of every price of the asset in the future. Your derivative's price will be equivalent to the contract function. For instance for the European call $max(S_T - K,0)$. You know the parameters and the distribution of $S_T$ and $K$ is fixed. You can then get a fair price for the contract. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What Black-Scholes does is plainly get rid of the risk parameter. Assume the drift $\mu = r - 0.5\sigma^2 + \lambda$. Suppose $\lambda$ is the risk premium/parameter. As understandable, people have various opinions about the behavior of $\lambda$. BS says that if I take a position in the underlying market with a certain size and opposite direction, I can remove $\lambda$ under certain assumptions. This is called delta hedging ($\Delta$). Since it removes all subjective parameters, you can form a replicating portfolio (i.e. it requires no money, brings no money either). If you can show you make money from trades of a replicating portfolio, it is called arbitrage. If you lose money, it is not a replicating portfolio. &lt;strong&gt;You can use risk neutral probabilities in real world as long as you delta hedge if it is a BS world.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem with BS, as with all other models, is the set of assumptions. You can say today, using a low-tails distribution to estimate log-return probabilities is ridiculous. True, it is widely used. But it is mainly for convenience, not for actual pricing (try at your peril).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also remember Black-Scholes model came before all the theory around it. They loved the simplicity and versatility of the model so much that they thought it deserved a theory. You can read the story from &lt;a href=&quot;https://rads.stackoverflow.com/amzn/click/0262633671&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;. Any serious divergence from BS model results in horribly complex and long equations which are quite confusing for the average finance people (a degree further and too complex for most people in the planet). Two years ago at a Q-Finance academic conference I witnessed a professor complimenting the presenter with the words &quot;I did not understand what you are doing but it is beautiful&quot; with amusement. In his defense, he was the head organizer and presenter is a distinguished honorary guest from a very reputable university.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To address your questions directly:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You can use either or both. All that matters is that you can predict the future prices. You should also put a lookback period limit if you use historical prices. In my experience, no calibration holds for long. &lt;/li&gt;&#xA;&lt;li&gt;No arbitrage is perhaps the most empirically solid condition in financial markets. Arbitrage is basically free money. Financial markets are swarming with intelligent people. Any arbitrage opportunity (albeit rare*) will be negated in a short time. &lt;/li&gt;&#xA;&lt;li&gt;I cannot emphasize this enough: &quot;DO NOT USE NORMAL OR ANY LOW-TAILED DISTRIBUTION AS AN ASSUMPTION, UNLESS YOU ARE FROM ACADEMIA WRITING A PAPER&quot;. Many people condemned it. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;*One recent exception I encountered is the Bitcoin. Bitcoin recently announced a &lt;em&gt;fork&lt;/em&gt;, resulting in another currency named Bitcoin Cash. Some exchanges granted it, some exchanges did not. The strategy was simple: long the grantee exchange BTC and short non-grantee. You have a free Bitcoin cash with no risk (unless exchanges differ too much in prices). &lt;/p&gt;&#xA;" OwnerUserId="8147" LastActivityDate="2017-09-15T13:33:45.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36043" PostTypeId="2" ParentId="36035" CreationDate="2017-09-15T15:55:12.460" Score="7" Body="&lt;p&gt;Infinity is rather non-sensical. A better question perhaps is whether you can put some theoretical bounds on an asset's market beta.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;An asset's volatility bounds its market beta&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Let $R_i$ be the return of security $i$ and $R_m$ be the return of the market. Market beta would be given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \beta_i = \frac{\operatorname{Cov}(R_i, R_m)}{\operatorname{Var}(R_m)}$$&#xA;Let $\rho \in [-1, 1]$ be the correlation coefficient, $\sigma_i$ the standard deviation of return $i$, and $\sigma_m$ the standard deviation of the market return. Since $\operatorname{Cov}(R_i, R_m) = \rho_{im} \sigma_i \sigma_m$ we can rewrite the above expression as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \beta_i = \rho_{im} \frac{\sigma_i}{\sigma_m} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\rho_{im} \in [-1, 1]$, hence if we know $\sigma_i$ and $\sigma_m$, we can put an upper bound on the market beta: $\beta_i \in [-\frac{\sigma_i}{\sigma_m}, \frac{\sigma_i}{\sigma_m}]$. To have a high market beta, you need high volatility. This is perhaps rather obvious.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Another constraint: value weighted average beta must be 1&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Let $w_i$ be security $i$'s share of the market portfolio. The market portfolio return is then:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R_m = \sum_i w_i R_i $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take covariance of both sides and divide by variance of the market:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{\operatorname{Cov}(R_m, R_m)}{\operatorname{Var}(R_m)} = \sum_i w_i \frac{\operatorname{Cov}(R_i, R_m)}{\operatorname{Var}(R_m)}$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Observe that the first side is 1 and the second side are market betas:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ 1 = \sum_i w_i \beta_i$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The value weight mean market beta of all securities in the market portfolio must be 1! Speaking loosely, the larger $i$'s weight is in the market portfolio, the more market beta is pulled toward 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, there's no theoretical reason the security must have positive net supply (eg. derivatives don't have positive net supply).&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Last comment&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Whenever people talk about market betas, there's some tendency to say &quot;CAPM.&quot; Resist the urge. You can estimate market betas and run the following regression whether the CAPM is true or not.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$R_t - R^f_t = \alpha + \beta (R^m_t - R^f_t) + \epsilon_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The CAPM is an economic theory that implies that $\alpha_i$ in the above regression is zero. The CAPM, while simple and beautiful, is an empirical failure. It doesn't work. That said, you can still estimate market betas and use them in sensible ways. Just don't use them as a sufficient statistic to forecast returns. &lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-09-15T16:07:55.293" LastActivityDate="2017-09-15T16:07:55.293" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36044" PostTypeId="2" ParentId="22819" CreationDate="2017-09-15T16:24:47.407" Score="2" Body="&lt;p&gt;&lt;strong&gt;AssetMacro.com&lt;/strong&gt; covers credit default swaps historical data for approximately 4000 major companies and countries. Visit AssetMacro &lt;a href=&quot;https://www.assetmacro.com/credit-default-swaps&quot; rel=&quot;nofollow noreferrer&quot;&gt;Credit Default Swaps&lt;/a&gt; to search through the database's contents. I think limited data are freely available.&lt;/p&gt;&#xA;" OwnerUserId="29614" LastEditorUserId="15818" LastEditDate="2017-11-06T15:49:28.940" LastActivityDate="2017-11-06T15:49:28.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36045" PostTypeId="1" CreationDate="2017-09-15T18:31:26.223" Score="4" ViewCount="1599" Body="&lt;p&gt;I was wondering was the standard definition of a multi-dimensional Brownian motion is. For one-dimension, I consider the following the standard definiton.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Brownian motion (or a Wiener process) is a real-valued stochastic process $W_{t}$ satisfying the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$W(0)=0$ a.s.&lt;/li&gt;&#xA;&lt;li&gt;$W_{t}$ a.s.-continuous&lt;/li&gt;&#xA;&lt;li&gt;increments are independent&lt;/li&gt;&#xA;&lt;li&gt;$W_{t}-W_{s}\sim N(0,t-s)$, for $t&amp;gt;s$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I often find 2-dimensional Wiener process $(W_{1},W_{2})$ with correlation $\rho$ mentionned. And it is not quite clear how this is exactly defined.&#xA;I assume that $W_{1}$ and $W_{2}$ being one-dimensional Wiener processes and $corr(W_{1}(t),W_{2}(t))=\rho$ is not enough, isn't it!?&#xA;I would assume that we have to assume that $(W_{1}(t),W_{2}(t))$ has a two-dimensional normal distribution with mean 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Generally, is there a standard definition for a n-dimensional Wiener process with correlation? If so, I would be happy to get some references. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Else, my guess would be, similarly to the 1-dim case, that an n-dimensional Wiener process $W=(W_{1},\ldots,W_{n})$ is a n-dimensional process with:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$W(0)=0$ a.s.&lt;/li&gt;&#xA;&lt;li&gt;$W_{t}$ a.s.-continuous&lt;/li&gt;&#xA;&lt;li&gt;increments are independent&lt;/li&gt;&#xA;&lt;li&gt;$W_{t}-W_{s}\sim N(0,\Sigma)$, for $t&amp;gt;s$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Sigma$ is a positive-definite and symmetric matrix with diagonal elements equal to $t-s$. The case $\Sigma=(t-s)\mathbf{1}$ would be a standard n-dimensional Wiener process, i.e. without any correlations.&lt;/p&gt;&#xA;" OwnerUserId="27389" LastEditorUserId="27389" LastEditDate="2017-09-15T18:36:31.717" LastActivityDate="2017-09-15T18:36:31.717" Title="Standard definition of multidimensional Brownian Motion with correlations" Tags="&lt;stochastic-processes&gt;&lt;brownian-motion&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36047" PostTypeId="2" ParentId="36041" CreationDate="2017-09-16T07:07:22.633" Score="1" Body="&lt;p&gt;The futures contract pays off every day during its life, with the last payment at T.  There are no payments after that.  When Hull is talking about a payment at T+.25 he is referring to the payoff of an investment that is separate from the futures contract.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-09-16T07:07:22.633" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36048" PostTypeId="1" CreationDate="2017-09-16T07:18:42.423" Score="0" ViewCount="77" Body="&lt;p&gt;As S&amp;amp;P500 index is an index based on the market capitalization of 500 biggest companies. What if some of those companies doesn't trade for a particular day. Does the next few companies (based on market capitalization) are taken into consideration for calculation of S&amp;amp;P500 Index.&lt;/p&gt;&#xA;" OwnerUserId="29621" LastActivityDate="2017-09-18T09:36:26.853" Title="How does the S&amp;P500 index is affected when 10-20 S&amp;P500 companies doesn't trade for a particular day?" Tags="&lt;index&gt;&lt;spx&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2017-09-19T17:31:46.370" ContentLicense="CC BY-SA 3.0" />
  <row Id="36049" PostTypeId="2" ParentId="36048" CreationDate="2017-09-16T07:33:01.617" Score="3" Body="&lt;p&gt;A company's market capitalization does not change because it did not trade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Index calculations are based upon the last traded price of each constituent security.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is no difference to the index level in a stock not trading and it remaining flat for the day (i.e. no change in price since the last close price).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some indices have liquidity limits, so if a security is under a long-term halt or suspension, or is simply illiquid and doesn't trade very often, it could be removed from the index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The methodology documents are a good place to start in determining such rules.  For example, this document describes most of the S&amp;amp;P market-cap-based indices:&#xA;&lt;a href=&quot;https://us.spindices.com/documents/methodologies/methodology-sp-us-indices.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://us.spindices.com/documents/methodologies/methodology-sp-us-indices.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A recent related development is that S&amp;amp;P Dow Jones Indices have changed their calculation methodology to use the Consolidated Tape trade prices rather than the use the data from the primary exchange for intraday values.  This change occurred on 5 Dec 2016.  There could be cases where the a stock is only suspended on their primary listing exchange but can still trade elsewhere (on ECNs).  However, closing index prices will only use primary exchange pricing.&lt;/p&gt;&#xA;" OwnerUserId="13859" LastEditorUserId="13859" LastEditDate="2017-09-18T09:36:26.853" LastActivityDate="2017-09-18T09:36:26.853" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36050" PostTypeId="2" ParentId="34852" CreationDate="2017-09-16T10:20:37.490" Score="1" Body="&lt;p&gt;This example you give from Hull is, unfortunately, poorly presented for a number of reasons.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The key point you initially state that Hull is trying to explain is: &lt;b&gt;&quot;5Y swap rates are less than the 5Y LIBOR borrowing rate.&quot;&lt;/b&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are a number of inherent problems with this statement;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;There are lots of different 5Y swap rates, i.e. IRSs whose floating leg is 1M LIBOR, or 3M LIBOR, or 6M LIBOR etc.. All of them have different rates, as do IRSs versus the same LIBOR tenor but with different fixed frequencies such as annual, semi, quarterly etc..&lt;/li&gt;&#xA;&lt;li&gt;It conveys the sense that LIBOR is some rate which permits borrowing money for any term and is an active market. It isn't liquid or active at all. All LIBOR is, is a set of fixed tenors (1M, 2M, 3M, 6M, 9M, 12M) per currency that gives an indication of borrowing rates based on banks' opinions only - no actual trading data. There certainly is no 5Y LIBOR rate.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The specific problem with the example, though, and its probably cause for contradiction is that by using exponentials in the bond calculation it is assuming the quoted tenor LIBOR rates are continually compounded. Continually compounded rates are never used in practice and only, really, in theory for more complicated problems using derivatives to simplify the mathematics. It would be better here to defined the discount factors as: $\frac{1}{1+d_ir_i}$ instead of $e^{-r_id_i}$. That changes your bond coupon calculation and instead of getting 4.953% you would end up with 5.212%. This is more directly comparable with swaps that are certainly not continually compounded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From a more theoretical standpoint if instead of using 5Y, we arbitrarily chose a better example such as 6M we can claim: &lt;b&gt;&quot;The 6M swap rate (versus 3M floating LIBOR) is less than the 6M LIBOR rate&quot;.&lt;/b&gt; The reason this is the case is symmetric from both the point of view of the borrower and of the lender:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;A borrower who seeks to borrow for a tenor of 6M can choose to borrow for the entire tenor of 6M ensuring a fixed funding profile. Or he can first borrow for 3M and then roll the loan into a new 3M loan after the first has expired. If this works he ends up with a lower rate (the 6M swap rate versus 3M LIBOR) but if liquidity disappears then he is faced with a scarcity premium and securing the second loan can be very costly. Northern Rock of UK is an example of a bank that collapsed due to this precise feature.&lt;/li&gt;&#xA;&lt;li&gt;A lender who lends money can lend for a fixed tenor of 6M or for 3M and then choose at the 3M point to re-lend again. The choice to re-lend can be considered an option so if he synthetically sells it by issuing a loan for the full 6M tenor then logically he will charge a higher rate for that than two 3M loans.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;The mathematics and a further description of these effects can be found in the section of term structure of ultra-short dated rates in &lt;a href=&quot;http://www.tradinginterestrates.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;this book&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="29443" LastActivityDate="2017-09-16T10:20:37.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36053" PostTypeId="1" CreationDate="2017-09-16T20:48:20.107" Score="2" ViewCount="121" Body="&lt;p&gt;recently I was trying to analysis the message data from NASDAQ ITCH data, but I find a problem with a type of message called &quot;Executed With Price Message&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, first there is an Add Order Message, place a limit price ask order at price 10 dollar, then there is an Executed With Price Message tell that limit order has been executed at price 9.99 dollar which is 1 cent worse than the limit order. Could someone explain to me why this happens.&lt;/p&gt;&#xA;" OwnerUserId="29628" LastActivityDate="2017-09-16T20:48:20.107" Title="Why is limit price order been executed with a worse price?" Tags="&lt;equities&gt;&lt;market-data&gt;&lt;market-microstructure&gt;&lt;limit-order-book&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36054" PostTypeId="1" CreationDate="2017-09-16T22:11:03.767" Score="-1" ViewCount="52" Body="&lt;p&gt;I would like to calculate asset correlations while excluding movements resulting from the denominating currency (as much as possible). My common sense tells me that any two assets with the same denominator are going to have higher correlation, then the underlying securities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The dollar index, or forex quotes, would only represent foreign exchange&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When &quot;all&quot; assets appreciate in value, this could in my view also simultaneously be a devaluation of the base curreny.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For now i just take a mean of log returns from a diverse set of asset classes, but that is an approximation at best.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What would be a good way to calculate this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="29630" LastActivityDate="2017-09-18T00:47:20.360" Title="Calculate price variance caused by denominating currency" Tags="&lt;correlation&gt;&lt;currency&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="36055" PostTypeId="2" ParentId="25590" CreationDate="2017-09-17T20:10:30.777" Score="1" Body="&lt;p&gt;Linear interpolation of the discount factors is &lt;b&gt;not&lt;/b&gt; a good idea.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A better idea, in the absence of a full analysis, is to &lt;b&gt;linearly interpolate the logarithm of the discount factors&lt;/b&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can use the 6M IBOR rate and other yearly tenor IRSs (versus 6M IBOR) to roughly bootstrap the 6M forecast curve. What linearly interpolating the logarithm of the discount factors does is to generate constant overnight (one-day) rates between your knot points. This results in an approximately linearly interpolated 6M rate between knot points. This is the standard method for most simple curves and even more advanced IRS trading desks utilise this form of interpolation in specific sections of their curve.&lt;/p&gt;&#xA;" OwnerUserId="29443" LastActivityDate="2017-09-17T20:10:30.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36056" PostTypeId="1" CreationDate="2017-09-17T20:21:23.847" Score="0" ViewCount="126" Body="&lt;p&gt;I'm not sure how feasible this is. I'm aware of how to generate correlated random numbers using a cholesky decomposition. However, say I have a fixed data set in increasing order (e.g. Price series: $10, $ 20, $ 30....$50). Now, I want to generated another series - of correlated quantities that follow the same order of increasing prices (so in the extreme case of 100% correl, Quantities have the exact same values - 10, 20, 30...50. But what would this look like if the correl were less than 100%). The idea is to see the impact on Total Revenue (P*Q) curve under different correlation assumptions. Cholesky did not work - as the Q series does not follow a specific order. I also tried using a regression say Q = a + bP; so if I changed b by changing the underlying correl..but that doesn't quite work (b = correl * stdev Q/stdev P; so I'll need to generate a new series that has the specified correl and stdev; it feels circular). In any case - this question itself might be daft...if so, please feel free to throw the eggs. But, if there's something possible - I'd love to know. thanks!&lt;/p&gt;&#xA;" OwnerUserId="29471" LastActivityDate="2017-09-19T08:05:23.800" Title="Ordered correlated random numbers" Tags="&lt;correlation&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36057" PostTypeId="1" CreationDate="2017-09-17T20:52:48.713" Score="0" ViewCount="156" Body="&lt;p&gt;I haven't found the answer for the question above in google. Why can't we just discretize the equation instead of using methods like euler or milstein for the discretization. &lt;/p&gt;&#xA;" OwnerUserId="18443" LastActivityDate="2017-09-17T20:52:48.713" Title="Why do we have to use discretization methods for SDE?" Tags="&lt;finance-mathematics&gt;&lt;mathematics&gt;&lt;sde&gt;&lt;differential-equations&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36058" PostTypeId="2" ParentId="36056" CreationDate="2017-09-17T21:34:44.567" Score="1" Body="&lt;p&gt;Instead of five elements lets reduce to two for simplicity, and call prices, $P$ and quantities, $Q$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suggest $P_1$ and $P_2$ have covariance matrix $\Sigma$. You might say $Q_1 = P_1 + X_1$ and $Q_2 = P_2 + X_2$, where $X_1$ and $X_2$ are your stochastic elements for quantities, and we let them be independent with non-identical variances. (note: if $\mathbf{P}=[10, 20]$ and $\mathbf{X}=[0, 0]$ then you return your simple scenario $\mathbf{Q}=[10, 20]$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we have four random quantities to sample, $P_1, P_2, Q_1, Q_2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Written in matrix vector notation (with $\mathbf{Y,Z}$ added in for shorthand):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$(\mathbf{Y}=)\begin{bmatrix}\mathbf{P} \\ \mathbf{Q}\end{bmatrix} = \begin{bmatrix}1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0 \\ 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 \\ 1 &amp;amp; 0 &amp;amp; 1 &amp;amp; 0 \\ 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 1 \end{bmatrix} \begin{bmatrix}\mathbf{P} \\ \mathbf{X}\end{bmatrix} (=\mathbf{AZ})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then $$Cov(\mathbf{Y,Y}) = \mathbf{A} Cov(\mathbf{Z,Z}) \mathbf{A^T}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where,&#xA;$$Cov(\mathbf{Z,Z})=\begin{bmatrix} \Sigma_{1,1} &amp;amp;\Sigma_{1,2} &amp;amp; 0 &amp;amp; 0 \\ \Sigma_{1,2} &amp;amp; \Sigma_{2,2} &amp;amp; 0 &amp;amp; 0 \\ 0 &amp;amp; 0 &amp;amp; \sigma_{X_1}^2 &amp;amp; 0 \\ 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; \sigma_{X_2}^2 \end{bmatrix}$$&#xA;You can now reduce the covariance of $\mathbf{Y}$ to lower triangular by Cholesky decomposition and sample in the usual way. If you want to define the Q's differently say letting $Q_2=(P_2-P_1)+conts.$ then you just need to rework the equations, similarly if you want the X's to be correlated with each other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This doesn't address the issue of ordering, but one could choose after the process to sort the P's and their corresponding Q's to give an ordered structure. One might also choose to define P as a constant vector plus random disturbance for which the equations could then be slightly re-worked.&lt;/p&gt;&#xA;" OwnerUserId="29443" LastEditorUserId="29443" LastEditDate="2017-09-18T06:31:37.470" LastActivityDate="2017-09-18T06:31:37.470" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="36059" PostTypeId="1" AcceptedAnswerId="36061" CreationDate="2017-09-17T22:25:25.607" Score="1" ViewCount="77" Body="&lt;p&gt;What (if one exists) is the standard way for estimating future dividends on bond etfs?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The major challenge in my mind is that the monthly dividend distributions of a bond etf (like HYG) don't necessarily correspond to the interest income received that month from the underlying bonds of the etf. This is because the ETF manager doesn't immediately turn around and pay out all of the interest income immediately.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the past few months HYG dividends have hovered around the $0.37 mark for every month. In the near-term, you would expect the dividends to continue around there. But what happens 6 months down the line? There's a lot of variation in dividends when you look at historical periods of that length.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, somehow the market comes up with estimates for dividends and you can find them in the implied forwards of options on HYG. What's the standard way to do this?&lt;/p&gt;&#xA;" OwnerUserId="29386" LastActivityDate="2017-09-18T00:42:16.220" Title="Bond ETF Implied Dividends" Tags="&lt;bond&gt;&lt;etf&gt;&lt;dividends&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36060" PostTypeId="1" CreationDate="2017-09-17T23:52:57.373" Score="2" ViewCount="383" Body="&lt;p&gt;I'm trying to work the proof that the normalized gains process, $G^z_t = \frac{S_t}{B_t}+\int^t_0\frac{1}{B_s}dD_s$ is a Q-martingale under Q (the risk-neutral measure). I'll show what I've worked through, but it feels like I'm just invoking circular logic, so I'm not sure if I've followed the right path. Also, I have a question regarding the intuition of the whole thing, and also a practical question related to the Wiener process under Q that I'll place at the end. This will probably be long, so many thanks to anyone who takes the time to lend any insight.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My proof:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, note that $\frac{1}{B_t}$ can be thought of as $e^{-rt}$, if we think of $B_0$ as \$1 in a bank account. Furthermore, we can also think of $dD_t=qS_tdt$, with q the continuously compounded dividend yield. Finally, also let the normalized price process $\frac{S_t}{B_t}=Z_t$. Now, by Ito, $\frac{S_t}{B_t}$, or equivalently $S_te^{-rt}$ differentiates to $-r\frac{S_t}{B_t}dt+\frac{1}{B_t}dS_t$. Assuming a GBM for $dS_t=\alpha S_tdt+\sigma S_tdW_t$, we are led to the following for $Z_t$ and $G^z_t$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dZ_t=Z_t(\alpha-r)dt+Z_t\sigma dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dG^z_t=Z_t(\alpha-r+q)dt+Z_t\sigma dW_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, by Girsanov, let $dQ=LdP$ where $dL_t=L_t\phi dW_t$, we have $dW_t=\phi_tdt+dW^Q_t$. Plugging this into the dynamics of $dS_t$ we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dS_t=S_t(\alpha+\sigma\phi_t)dt+S_t\sigma dW^Q_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Making this the Q-dynamics for the stock price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, plugging this into our result for $G^Z_t$ we are led to&#xA;$$dG^Z_t=Z_t(\alpha-r+q+\sigma\phi_t)dt+Z_t\sigma dW^Q_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, to be a martingale, we need no drift, that is $a-r+q+\sigma\phi_t=0$, or $\alpha+\sigma\phi_t=r-q$. From this we see that we can go back to the Q-dynamics for the stock price and write &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dS_t=S_t(r-q)dt+S_t\sigma dW^Q_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;...and this is where I sort of end. I don't know if I've proved what was meant to be proved or not. I know that I've ended up with the known Q-dynamics result, which is encouraging.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, for a practical question - is there any difference in simulating $W^Q_t$ in practice versus $W_t$? For instance, suppose I decide to price a derivative via Monte Carlo simulation in excel. Would it be the exact same function (i.e. norm.inv(rand(0,1))?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;***Update - ok, I think I took it a step further and have it now. So, now that I basically rigorously derived the Q-dynamics of the stock price price process in the last line, let's go back to the fact that the normalized gains process is $G^z_t = \frac{S_t}{B_t}+\int^t_0\frac{1}{B_s}dD_s$, or equivalently $$G^z_t=e^{-rt}S_t+\int^t_0e^{-rs}S_sqds$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's focus on the undifferentiated part, that is, $e^{-rt}S_t$, call it $\tilde{S}_t$. By Ito, we have &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d\tilde{S}_t=-re^{-rt}S_tdt+e^{-rt}dS_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Plugging in the before derived Q-dynamics for $dS_t$, we have &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d\tilde{S}_t=-r\tilde{S}_tdt+e^{-rt}[(r-q)S_tdt+\sigma S_tdW^Q_t]&amp;lt;=&amp;gt;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d\tilde{S}_t=(r-r-q)\tilde{S}_tdt+\sigma\tilde{S}_tdW^Q_t&amp;lt;=&amp;gt;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d\tilde{S}_t=-q\tilde{S}_t+\sigma\tilde{S}_tdW^Q_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, going back to the full equation for the gains process, we have &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dG^z_t=-q\tilde{S}_tdt+q\tilde{S}_tdt+\sigma\tilde{S}_tdW^Q_t&amp;lt;=&amp;gt;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dG^z_t=\sigma\tilde{S}_tdW^Q_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Proved Q-martingale&lt;/p&gt;&#xA;" OwnerUserId="28223" LastEditorUserId="28223" LastEditDate="2017-09-26T16:58:58.183" LastActivityDate="2017-09-26T16:58:58.183" Title="Normalized Gains Process is a Q-Martingale - Proof and Intuition" Tags="&lt;black-scholes&gt;&lt;stochastic-calculus&gt;&lt;girsanov&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36061" PostTypeId="2" ParentId="36059" CreationDate="2017-09-18T00:42:16.220" Score="0" Body="&lt;p&gt;You just look at the holdings&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This ETF even publishes its list of future expected cash flows...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.ishares.com/us/products/239565/ishares-iboxx-high-yield-corporate-bond-etf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.ishares.com/us/products/239565/ishares-iboxx-high-yield-corporate-bond-etf&lt;/a&gt;&#xA;&lt;a href=&quot;https://www.ishares.com/us/literature/cashflows/ishhyld-etf-cash-flows.csv&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.ishares.com/us/literature/cashflows/ishhyld-etf-cash-flows.csv&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1181" LastActivityDate="2017-09-18T00:42:16.220" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36062" PostTypeId="2" ParentId="36054" CreationDate="2017-09-18T00:47:20.360" Score="0" Body="&lt;p&gt;Here is two ideas that comes to mind:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1.)&#xA; - Take the derivative of CPI as a % with respect to Wage growth as a %&#xA; - Take the derivative of PPI as a % with respect to the derivative ((Composite revenue per share of SP500)/PB ratio)^-1 as a %&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2.)&#xA;Now find the standard deviation and other relevant descriptive statistics of some weighted index of both ratios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3.)&#xA;Benchmark the derivative of asset X as a % with respect to our measurement index. (choose derivative or difference based on what you are analyzing for)&lt;/p&gt;&#xA;" OwnerUserId="18578" LastActivityDate="2017-09-18T00:47:20.360" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36064" PostTypeId="2" ParentId="35995" CreationDate="2017-09-18T02:04:04.310" Score="1" Body="&lt;p&gt;Here is an approximate formula requiring no other inputs. Suppose:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$S_0$ = initial spot rate&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$F = S_0 +  d$ agreed forward exchange rate, where d is the number of forward points&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$T$ maturity date of forward&lt;/p&gt;&#xA;&#xA;&lt;p&gt;you can calculate an approximate mark-to-market price for the forward on date $t$ $ (0\le t \le T)$ as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P_t = S_t - (S_0 +d \frac{t}{T})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P_0 = 0$. At the moment you enter into the forward agreement you could get out of it with no profit or loss (except perhaps a transaction cost)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$P_T = S_T - F$. This is what textbooks say a forward is worth at maturity. You have made money if the spot rate is above the initially contracted forward rate and have lost money in the opposite case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When $0&amp;lt;t&amp;lt;T$ the formula gives a linearly interpolated value. This is where the approximation comes in, it is not strictly true, because of interest compounding and for other reasons, but may be close enough for a forward having a maturity of 1 year or less.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2017-09-18T02:04:04.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36066" PostTypeId="1" AcceptedAnswerId="36202" CreationDate="2017-09-18T11:45:04.193" Score="1" ViewCount="164" Body="&lt;p&gt;&lt;strong&gt;Scenario:&lt;/strong&gt; I am trying to do a variation of the MV optimization for a portfolio. In this instance, I already have a vector of mean returns ($\mu$), a vector of ones, a covariance matrix ($\Sigma$), and $\phi^{-1}$ which is the inverse of the standard normal cumulative distribution function (function of probability alpha).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Problem:&lt;/strong&gt; From the two equations stated below, I am going to input: $\mu$, $\Sigma$, 1 (vector of ones), $H$, and $\alpha$, and try to get a value for $\gamma$ (also, the ' represents the transpose of the vector).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Equations:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$    H = w(\gamma)'\mu + \Phi^{−1}(α)[w(\gamma)' \Sigma w(γ)]^{1/2}$$&#xA;$$    w(\gamma) = \frac{1}{\gamma}\Sigma^{-1}\Big[\mu − \Big(\frac{\mathbf{1}' \Sigma^{-1} \mu-\gamma}{\mathbf{1}' \Sigma^{-1} \mathbf{1}}\Big) \mathbf{1}\Big]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;What I already tried:&lt;/strong&gt; I am trying to solve this system using a python solver. But I am not able to do it since the matrix multiplication apparently becomes non-convex.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; How to solve this problem?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Obs:&lt;/strong&gt; This question comes from the article Portfolio Optimization with mental accounts from Sanjiv Das, Harry Markowitz, Jonathan Scheid, and Meir Statman, Equations (7) and (8). The article is found at: &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.410.8747&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.410.8747&amp;amp;rep=rep1&amp;amp;type=pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="29646" LastEditorUserId="16148" LastEditDate="2017-09-18T20:24:26.360" LastActivityDate="2017-09-27T16:01:48.863" Title="Solving a system of two equations with non-convex matrix multiplication for MV optimization" Tags="&lt;portfolio-optimization&gt;&lt;mean-variance&gt;&lt;covariance-matrix&gt;&lt;markowitz&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36067" PostTypeId="2" ParentId="36038" CreationDate="2017-09-18T12:22:10.997" Score="2" Body="&lt;p&gt;Bills do not have a coupon.  They are sold at a discount to 100, but you get your 100 back at maturity.  The equation should read 'Quoted Yield' not 'Quoted Price'.  Yield is the effective return on your investment.  The lower the cash price, the higher the return. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The equations for bonds are correct.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-09-18T12:22:10.997" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36070" PostTypeId="1" AcceptedAnswerId="36114" CreationDate="2017-09-18T21:05:06.743" Score="0" ViewCount="296" Body="&lt;p&gt;I tried solving the below problem without knowing the shortcut of thinking about this in terms of a put versus a call. I can't seem to arrive at the correct answer using my method and I'm wondering where I'm going wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$u = e^{(0.03 - 0.05)/12 + 0.05\sqrt{1/12}} = 1.012848937$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d = e^{(0.03 - 0.05)/12 - 0.05\sqrt{1/12}} = 0.984028496$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$p^* = \frac{1}{1 + e^{0.05\sqrt{1/12}}} = 0.496391623$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The call pays off at nodes: $u^6, u^5d, u^4d^2, u^3d^3, u^2d^4, u^1d^5$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The desired price is then:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\big[(0.8u^6 - 1.35^{-1}){p^*}^6(1 - p^*)^0 + (0.8u^5d^1 - 1.35^{-1}){p^*}^5(1 - p^*)^1 + (0.8u^4d^2 - 1.35^{-1}){p^*}^4(1 - p^*)^2 + (0.8u^3d^3 - 1.35^{-1}){p^*}^3(1 - p^*)^3 + (0.8u^2d^4 - 1.35^{-1}){p^*}^2(1 - p^*)^4 + (0.8u^1d^5 - 1.35^{-1}){p^*}^1(1 - p^*)^5\big]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$= 0.005760287$, multiplied by the discount factor $e^{-0.03 \cdot 0.5}$ and $\$1,000,000$ to arrive at $5,760.28$ euros.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/0Lbrk.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/0Lbrk.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5641" LastActivityDate="2017-09-21T02:02:05.853" Title="Put-Call Parity on Currency and Binomial Trees" Tags="&lt;binomial-tree&gt;&lt;currency&gt;&lt;put-call-parity&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36073" PostTypeId="1" AcceptedAnswerId="40462" CreationDate="2017-09-19T01:35:13.080" Score="9" ViewCount="1786" Body="&lt;p&gt;In market making models derived originally from &lt;a href=&quot;https://www.math.nyu.edu/faculty/avellane/HighFrequencyTrading.pdf&quot; rel=&quot;noreferrer&quot;&gt;Avellaneda-Stoikov&lt;/a&gt;, there is a function lambda that represents the arrival rate of orders. In its prodigy, there are different representations of lambda, some linear, exponential, etc. But, all of these are functions of the difference between the maker's quote and the reference price. How do you calibrate it on initialization? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, in a &lt;a href=&quot;https://arxiv.org/abs/1105.3115&quot; rel=&quot;noreferrer&quot;&gt;Gueant-Lehalle-Tapia&lt;/a&gt; model, how are A and K practically calibrated?&lt;/p&gt;&#xA;" OwnerUserId="29648" LastEditorUserId="16160" LastEditDate="2017-09-19T01:44:37.527" LastActivityDate="2018-06-24T13:46:13.560" Title="How does one calibrate lambda in a Avellaneda-Stoikov market making problem?" Tags="&lt;finance&gt;&lt;market-microstructure&gt;&lt;limit-order-book&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="36074" PostTypeId="1" AcceptedAnswerId="36086" CreationDate="2017-09-19T01:52:24.243" Score="1" ViewCount="2603" Body="&lt;p&gt;Looking at the swap curve construction here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.bankofcanada.ca/wp-content/uploads/2010/01/wp00-17.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.bankofcanada.ca/wp-content/uploads/2010/01/wp00-17.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;it seems to be constructed in an identical fashion as the yield curve as described here:&#xA;&lt;a href=&quot;https://en.wikipedia.org/wiki/Yield_curve#Construction_of_the_full_yield_curve_from_market_data&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Yield_curve#Construction_of_the_full_yield_curve_from_market_data&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So are the terms &quot;swap curve&quot; and &quot;yield curve&quot; interchangeable?&lt;/p&gt;&#xA;" OwnerUserId="29161" LastActivityDate="2017-09-19T14:45:49.443" Title="Is the &quot;swap curve&quot; synonymous with the &quot;yield curve&quot;?" Tags="&lt;swaps&gt;&lt;yield-curve&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36075" PostTypeId="2" ParentId="9728" CreationDate="2017-09-19T04:47:17.993" Score="3" Body="&lt;p&gt;As for now, below API would give a nice JSON response:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;https://query1.finance.yahoo.com/v7/finance/quote?lang=en-US&amp;amp;region=US&amp;amp;corsDomain=finance.yahoo.com&amp;amp;fields=symbol,longName,shortName,priceHint,regularMarketPrice,regularMarketChange,regularMarketChangePercent,currency,regularMarketTime,regularMarketVolume,quantity,averageDailyVolume3Month,regularMarketDayHigh,regularMarketDayLow,regularMarketPrice,regularMarketOpen,fiftyTwoWeekHigh,fiftyTwoWeekLow,regularMarketPrice,regularMarketOpen,sparkline,marketCap&amp;amp;symbols=000001.SS,600600.SS&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="29650" LastActivityDate="2017-09-19T04:47:17.993" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36076" PostTypeId="2" ParentId="36074" CreationDate="2017-09-19T06:41:15.290" Score="1" Body="&lt;p&gt;Actually No,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Yield curve is simply market consensus interest rates for specific maturities. It can be build using similar government bonds, LIBOR rates, SWAP rates etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So swap curve is one type of yield curves. &lt;/p&gt;&#xA;" OwnerUserId="29651" LastActivityDate="2017-09-19T06:41:15.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36077" PostTypeId="2" ParentId="34852" CreationDate="2017-09-19T06:51:06.240" Score="0" Body="&lt;p&gt;Interestingly there is no such thing as 5 year LIBOR. As you know LIBOR is interbank borrowing rates up to 1 year. I know that  Hull 9/e is very respected and popular book but that statement is simply wrong.&lt;/p&gt;&#xA;" OwnerUserId="29651" LastActivityDate="2017-09-19T06:51:06.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36078" PostTypeId="2" ParentId="36056" CreationDate="2017-09-19T08:00:19.183" Score="2" Body="&lt;p&gt;For a small vector, you could compute all the permutations of the elements&#xA;and calculate their correlation with the original&#xA;vector. You could then pick those permutations that&#xA;lead to correlations within your desired range.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In R, for instance:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(&quot;e1071&quot;)&#xA;P &amp;lt;- seq(10, 50, by = 10)&#xA;perm &amp;lt;- permutations(length(P))&#xA;rho &amp;lt;- apply(perm, 1, function(r) cor(P, P[r], method = &quot;spearman&quot;))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The vector &lt;code&gt;rho&lt;/code&gt; gives the rank correlation for every row in the matrix &lt;code&gt;perm&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;head(data.frame(perm, rho))&#xA;&#xA;##   X1 X2 X3 X4 X5 rho&#xA;## 1  1  2  3  4  5 1.0&#xA;## 2  2  1  3  4  5 0.9&#xA;## 3  2  3  1  4  5 0.7&#xA;## 4  1  3  2  4  5 0.9&#xA;## 5  3  1  2  4  5 0.7&#xA;## 6  3  2  1  4  5 0.6&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;For larger vectors and if sampling with replacement is&#xA;allowed, I would probably go for some variant of the&#xA;inversion method. In R, an implementation is in function &lt;code&gt;resampleC&lt;/code&gt; in the   &lt;a href=&quot;https://CRAN.R-project.org/package=NMOF&quot; rel=&quot;nofollow noreferrer&quot;&gt;NMOF&lt;/a&gt; package.&lt;/p&gt;&#xA;" OwnerUserId="6857" LastEditorUserId="6857" LastEditDate="2017-09-19T08:05:23.800" LastActivityDate="2017-09-19T08:05:23.800" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36080" PostTypeId="1" AcceptedAnswerId="36085" CreationDate="2017-09-19T10:43:40.517" Score="1" ViewCount="560" Body="&lt;p&gt;When we use the binomial tree to price the American put, we should compare the discounted value from last nodes and the intrinsic value at each node. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I confuse that, discounted value from last nodes is the value of European put at this node, and  the value of European put is always greater than its intrinsic value, how does it occur the intrinsic value is greater than discounted value?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the statement &lt;code&gt;the value of European put is always greater than its intrinsic value,&lt;/code&gt; I get from the book &lt;code&gt;Problems and Solutions in Mathematical Finance  Equity Derivatives. Volume 2&lt;/code&gt; &lt;code&gt;page 74&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/iRMp3.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/iRMp3.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26165" LastEditorUserId="26165" LastEditDate="2017-09-19T10:57:51.793" LastActivityDate="2017-09-19T14:02:07.393" Title="Binomial tree prices the American put" Tags="&lt;american-options&gt;" AnswerCount="2" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36081" PostTypeId="2" ParentId="36080" CreationDate="2017-09-19T11:57:25.230" Score="1" Body="&lt;p&gt;the result is simply not true. If it were true American puts would not be early exercised and they would be worth the same as Europeans. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The proof is flawed. The set -up of $\pi_t$ does not make sense. We cannot take&#xA;$$&#xA;\max(S_t-K,0)&#xA;$$&#xA;as part of a self-financing portfolio. We could take bonds worth that but they wouldn't be worth&#xA;$$&#xA;\max(S_T-K,0)&#xA;$$&#xA;at the end. &lt;/p&gt;&#xA;" OwnerUserId="1809" LastActivityDate="2017-09-19T11:57:25.230" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="36083" PostTypeId="1" CreationDate="2017-09-19T13:07:48.767" Score="2" ViewCount="2190" Body="&lt;p&gt;I want to implement a Momentum Strategy, followed by Jegadeesh and Titman (1993) with overlapping Portfolios. I want to duplicate their results. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Quick Link to the paper (Unfortunately the Method is poorly described): &lt;a href=&quot;http://www.business.unr.edu/faculty/liuc/files/BADM742/Jegadeesh_Titman_1993.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.business.unr.edu/faculty/liuc/files/BADM742/Jegadeesh_Titman_1993.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all: I work with discrete monthly Returns. But I don't know which returns I have to calculate to implement my Momentum Strategy properly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's consider Formationperiod J=3 and Holdingperiod K=3&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case I have a composite Portfolio consisting of the Portfolio initiated in JAN (Tranche 1), a Portfolio initiated in FEB (Tranche 2, hold for 2 Periods) and the portfolio initiated in MAR (Tranche 3, hold for 1 Period).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/LXhK1.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/LXhK1.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What Returns do I have to calculate now to duplicate the Method of Jegadeesh and Titman (1993)? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My attempt would be: In March, I calculate the Return of Tranche 1. This Portfolio was acutally held for 3 Months and so we liquidate it and measure it's Return with the Geometric Mean (Because I have discrete Returns). This is the first observation of my Strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I can also calculate the Return of the composite Portfolio (vertical aggregation) for the month March. I calculate the Return of the composite Portfolio (Consisting 3 Sub-Portfolios) in March and divide it by 3 (Arimethic Mean) so that I have the average Returns of all 3 Sub-Portfolios for the Month March in my Composite Portfolio.&#xA;This results in having for March 2 Observations, the Return of my liquidated Sub-Portfolio and the Return of my Composite Portfolio for the Month. In April I have the monthly Return of Tranche 2 and the composite Portfolio (Consisting Tranche2, 3 and the new Tranche 1). For every Month I sum up these two observations and take the Mean. This continues every Month. At the end I sum every Return of each Month up and take the mean of that to have the Monthly Returns of my actual Strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this the proper way to calculate the Returns of a Momentum Strategy? Or do I just calculate composite Portfolio Returns?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would really appreciate your help!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With kind regards!&lt;/p&gt;&#xA;" OwnerUserId="29654" LastActivityDate="2017-10-20T13:47:34.223" Title="Calculate Returns of Momentum Strategy (Overlapping Portfolios - Jegadeesh and Titman 1993)" Tags="&lt;portfolio-selection&gt;&lt;strategy&gt;&lt;momentum&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36085" PostTypeId="2" ParentId="36080" CreationDate="2017-09-19T14:02:07.393" Score="1" Body="&lt;p&gt;Assume deterministic interest rates and no dividends to keep notations uncluttered.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because the discounted value of all self-financing portfolio is a martingale under $\Bbb{Q}$ one can express the European put price as a risk-neutral expectation as follows:&#xA;$$ P(S_0;K,T)=\frac{1}{B_T} \Bbb{E}^\Bbb{Q}_0\left[\text{max}(K−S_T,0)\right] \tag{1}$$&#xA;Since $f : x \to \max(0, x)$ is a convex function, one can apply Jensen's inequality to the RHS of $(1)$. Further using the fact that $S_t/B_t$ is also a $\Bbb{Q}$ martingale under our working assumptions, one gets:&#xA;\begin{align}&#xA;P(S_0;K,T) &amp;amp;\geq \text{max}\left( \Bbb{E}^\Bbb{Q}_0\left[\frac{K}{B_T} −\frac{S_T}{B_T} \right], 0 \right) \\&#xA;&amp;amp;\geq {\color{green}{\max\left( \frac{K}{B_T} - S_0, 0 \right)}}&#xA;\end{align}&#xA;Hence we have an equality relating the put price (in blue below) to the RHS above (in green below), which is not the intrinsic value (in orange below). This is illustrated taking the example given in @Chris Taylor's comment &lt;a href=&quot;https://i.stack.imgur.com/LUtbm.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/LUtbm.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2017-09-19T14:02:07.393" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36086" PostTypeId="2" ParentId="36074" CreationDate="2017-09-19T14:45:49.443" Score="1" Body="&lt;p&gt;The concept is different, but in efficient and liquid markets, they could be the same thing. Essentially, you're asking what the &quot;time value of money&quot; is. There are many different instruments whose value is based off of said value - bonds, interest rate futures, interest rate swaps, etc. Therefore, in theory, if you wanted to build a curve that represents the time value of money over time, you could use the implied rates from all of the different sources to form a single curve. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, as mentioned before by Alex C, there are lots of different curves due to differences in liquidity and some minor market inefficiencies.  &lt;/p&gt;&#xA;" OwnerUserId="29657" LastActivityDate="2017-09-19T14:45:49.443" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36087" PostTypeId="2" ParentId="34741" CreationDate="2017-09-19T14:51:56.010" Score="0" Body="&lt;p&gt;To detect fund manager's active stock picks from his portfolio holdings you need the managers' benchmark index. Check the fund fact sheet for this. Fund Rating Agencies often use a broad well-known index, but that index often does not fit to the origin fund investment approach. An American US Value oriented fund can consequently outperform his own index, but simultaneously underperform the broad main index. Therefore, the best way is to ask the fund company for an &lt;em&gt;attribution analysis&lt;/em&gt;. &#xA;&lt;a href=&quot;https://i.stack.imgur.com/VRVz2.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/VRVz2.png&quot; alt=&quot;The attached example shows the active bets.&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="22515" LastActivityDate="2017-09-19T14:51:56.010" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36088" PostTypeId="1" AcceptedAnswerId="36108" CreationDate="2017-09-19T16:56:34.550" Score="0" ViewCount="2690" Body="&lt;p&gt;I am struggeling with the wording &quot;Collateralized&quot; IRS and try to get an understanding out of it based on an example. Especially what it means that in the multi curve models the expectations are calibrated such that the net present value of a swap equals zero (PV Fixed - PV Floating).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the following IRS:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Notional 1 Mio. Euro&#xA;Fixed Rate Leg = 2%&#xA;Floating Rate Leg (Tenor) = 6M Euribor without spread&#xA;Maturity = 2 years&#xA;Tenor Floating = 6 Month&#xA;Tenor Fixed = 12 Month&#xA;Day Count Conventions Fixed = Actual/360&#xA;Day Count Conventions Floating = Actual/360&#xA;Discount Curve = OIS USD&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How would an example look like (with math and with numerical numbers)? &lt;/p&gt;&#xA;" OwnerUserId="29660" LastEditorUserId="20454" LastEditDate="2017-10-09T15:44:06.250" LastActivityDate="2020-10-15T12:50:17.050" Title="Collateralized Interest Rate Swap" Tags="&lt;pricing&gt;&lt;interest-rate-swap&gt;&lt;libor&gt;&lt;ois-discounting&gt;&lt;collateral&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="36090" PostTypeId="1" CreationDate="2017-09-19T17:31:51.480" Score="2" ViewCount="594" Body="&lt;p&gt;For a little bit of background, I've been studying stochastic calc and a few of it's applications (currently I'm still at the early stages of learning applications) and have been curious as to whether or not trading strategies using stochastic modeling are still relevant in the modern day age (late 2017 as I'm writing). One example might be: seeing as the familiarity with Black-Scholes has grown so much over that past ~30 years, using it as a strategy to find and capitalize off of what a trader might deem a mis-pricing no longer seems do-able (or at best, has become extremely difficult) due to it's popularity (i.e. since everybody has been trained on how to apply it/where to use it, hence it's become less effective at doing what it was able to do in the past).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My main questions are as follows: has the evolution of tools in Machine Learning replaced the role of model building using stochastic equations (can more complex models built from ML perform the same role as stochastic modeling without the uniformity of logic/formulae/precise derivations of models)? What is the main role of present day stochastic modeling in finance? Are there any hybrid stochastic machine learning models/methodologies? What role will stochastic calc/modeling play in finance within the next 10 years or so?&lt;/p&gt;&#xA;" OwnerUserId="29576" LastActivityDate="2017-09-19T17:31:51.480" Title="stochastic modeling and machine learning" Tags="&lt;stochastic-calculus&gt;&lt;quant-trading-strategies&gt;&lt;finance-mathematics&gt;&lt;machine-learning&gt;&lt;financial-engineering&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="0" ClosedDate="2017-09-20T09:31:42.643" ContentLicense="CC BY-SA 3.0" />
  <row Id="36091" PostTypeId="2" ParentId="32546" CreationDate="2017-09-20T05:34:49.170" Score="0" Body="&lt;p&gt;The historical fundamentals can also be found in Thomson Reuters EIKON. In the Menu Bar, click on &quot;Fundamentals&quot;. The Snapshot shows recent values. Try to find the &quot;Standardized Financials&quot;. There is a good overview of all historical annual statements, including the named Ratios like ROA, ROE. If not, there could be a subscription issue. Call TR Customer Service else. &lt;/p&gt;&#xA;" OwnerUserId="22515" LastActivityDate="2017-09-20T05:34:49.170" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36092" PostTypeId="1" AcceptedAnswerId="36095" CreationDate="2017-09-20T05:43:35.660" Score="1" ViewCount="539" Body="&lt;p&gt;Denote American Call/Put $C_{am}/P_{am},$ European Call/Put $C_v/P_v,$ with constant risk-free interest rate $r,$ dividend yield rate $D,$ strike $K,$ maturity $T.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1.We have the well know inequalities:&#xA;$$C_v\leq C_{am} \leq  C_v + S_t(1 - e^{-D(T-t)})$$&#xA;$$P_v\leq P_{am} \leq  P_v + K(1 - e^{-r(T-t)})$$&#xA;Surely, we can build the portfolios to proof the inequalities, but is there any intuitive ways to demonstrate above inequalities? Or when does the &lt;code&gt;=&lt;/code&gt; hold, for none-zero $D$ and $r$ since the proof by portfolio method is not clear to see the conditions of &lt;code&gt;=.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, $S_t(1 - e^{-D(T-t)})$ is actually the sum of discounted dividend, that means &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;American call will never be larger than the European call adding the dividend of its underlying asset.&lt;/code&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And we also have &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;it's always optimal to exercise American call immediately before the ex-dividend&lt;/code&gt; etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maybe the conditions of &lt;code&gt;=&lt;/code&gt; can effectively solve the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2.Moreover, for the low boundary(value of forward) of European call&#xA;$$\max(e^{-D(T- t)}S_t - e^{-r(T- t)}K,0)\leq C_v(t),$$&#xA;some book said it can be regard as the American call, I can not understand this statement?&lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-09-20T07:26:57.103" Title="Intuitively understand boundaries of American Call and Put" Tags="&lt;american-options&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36093" PostTypeId="2" ParentId="35399" CreationDate="2017-09-20T05:50:31.680" Score="1" Body="&lt;p&gt;From the following 10-Q information, the &lt;strong&gt;bold&lt;/strong&gt; highlighted rows are most significant: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Net sales&lt;/strong&gt; &lt;/li&gt;&#xA;&lt;li&gt;Cost of sales&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Gross margin   &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Operating expenses:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Research and development&lt;/li&gt;&#xA;&lt;li&gt;Selling, general and administrative&lt;/li&gt;&#xA;&lt;li&gt;Total operating expenses&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Operating income &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;Other income/(expense), net &lt;/li&gt;&#xA;&lt;li&gt;Income before provision for income taxes &lt;/li&gt;&#xA;&lt;li&gt;Provision for income taxes &lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Net income&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Earnings per Share&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Basic&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Diluted&lt;/strong&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Shares used in computing earnings per share:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Basic&lt;/li&gt;&#xA;&lt;li&gt;Diluted&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cash dividends declared per share&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;But keep in mind: this selection is not frozen in time. Some would argue that Net Income is also necessary. &lt;/p&gt;&#xA;" OwnerUserId="22515" LastActivityDate="2017-09-20T05:50:31.680" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36094" PostTypeId="2" ParentId="34130" CreationDate="2017-09-20T05:59:50.230" Score="-1" Body="&lt;p&gt;The &lt;strong&gt;publication date&lt;/strong&gt; differs from the &lt;strong&gt;statement date&lt;/strong&gt;. If the statement date is '201&lt;strong&gt;6&lt;/strong&gt;-12-31', the publication date could be '201&lt;strong&gt;7&lt;/strong&gt;-02-15'. Sometimes, thera are &lt;em&gt;restatements&lt;/em&gt; (=annual report is republished with corrected new numbers) where publication date is '201&lt;strong&gt;7&lt;/strong&gt;-02-15' for statement date '201&lt;strong&gt;5&lt;/strong&gt;-12-31'. Both dates are published in Reuters databases. If this is too expensive, try to find this on Quandl (I'm not sure if they have both dates). &lt;/p&gt;&#xA;" OwnerUserId="22515" LastActivityDate="2017-09-20T05:59:50.230" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36095" PostTypeId="2" ParentId="36092" CreationDate="2017-09-20T07:26:57.103" Score="4" Body="&lt;p&gt;The lower bounds are obvious since American options can be exercised at any time while European options can only be exercised at maturity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The upper bounds are obtained from the property that an American option value is the Snell envelope of its discounted payoff, so that when the discounted payoff is a submartingale the American option should never be exercised early. &lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2017-09-20T07:26:57.103" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="36096" PostTypeId="2" ParentId="36083" CreationDate="2017-09-20T12:56:02.450" Score="1" Body="&lt;p&gt;In Jegadeesh and Titman, and the papers that follow it, the monthly return to the strategy for the month of March is found by averaging the monthly return for Tranche 1 in March, the avg return for Tranche 2 in March and the monthly return for Tranche 3 in March. As shown in the diagram Tranche 1 consists of those stocks bought at the end of December and held in Jan, Feb, Mar and so on for the other tranches. This method is simple, though perhaps not completely realistic or not to everybody's taste (other methods of calculation are also possible).&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2017-09-20T12:56:02.450" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36097" PostTypeId="1" CreationDate="2017-09-20T13:02:36.453" Score="0" ViewCount="451" Body="&lt;p&gt;This is my personal record trading options (selling spreads) over a certain time period:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Win Rate: 83.94%&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Average Win: $299&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Average Loss: $1,181.40&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The formula for the Kelly Criterion is:&#xA;$$&#xA;f=\frac{p(b+1)-1}{b}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $f$ is a percentage of how much capital to place on a bet, $p$ is the probability of success, and $b$ is the payout odds (eg. 3 dollars for ever 1 dollar bet).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if I put in my numbers:&#xA;$$&#xA;f=\frac{0.8394(\frac{299}{1181.4}+1)-1}{\frac{299}{1181.4}}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which equals &lt;code&gt;20.48%&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That seems really high. Accordingly to this, I should put up 20% of my portfolio per trade. What am I not understanding?&lt;/p&gt;&#xA;" OwnerUserId="2928" LastActivityDate="2017-09-20T18:15:45.950" Title="Can a Kelly Criterion Percent be very high?" Tags="&lt;probability&gt;&lt;kelly-criterion&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36100" PostTypeId="1" AcceptedAnswerId="36217" CreationDate="2017-09-20T14:28:30.817" Score="1" ViewCount="457" Body="&lt;p&gt;I'm working on the following exercise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the standard Black-Scholes model, and n different simple contingent claims with contract functions $\phi_1,\dots, \phi_n$. Let &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;V=\sum_{i=1}^n h_i(t) S_i (t)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;denote the value process of a self-financing, Markovian portfolio. Show that V satisfies the Blach Scholes equation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First since $h_i$ is Markovian, $V$ will be of the form $V(t, S(t))$. The equation is &#xA;$$&#xA;\frac{\partial V}{\partial t} + \frac12 \sigma^2 S^2 \frac{\partial^2 V}{\partial S^2} + rs \frac{\partial V}{\partial S} - rV = 0&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My idea was to calculate all the partial derivatives, and plug them in. I got&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\partial V_t = \sum dS_i (S_i \partial h'_{i,t} + h_i)$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\partial V_s = \sum \partial h_{i,s} S_i + h_i dS_i$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\partial V_{ss} = \sum \partial h_{i,ss} S_i 2h'_s dS_i + h_i d^2S_i$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and from here it feels like I did something wrong.&lt;/p&gt;&#xA;" OwnerUserId="29671" LastActivityDate="2017-09-29T14:26:41.657" Title="Show that $V=\sum_{i=1}^n h_i(t)S_i(t)$ satisfies the Black-Scholes equation" Tags="&lt;black-scholes&gt;" AnswerCount="1" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="36101" PostTypeId="1" CreationDate="2017-09-20T15:04:24.090" Score="2" ViewCount="152" Body="&lt;p&gt;I read a post by M. Avellaneda &lt;a href=&quot;http://math.nyu.edu/faculty/avellane/TradingVolatilityNY2016.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;trading volatility&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At page 59-62 there's &lt;strong&gt;Strategies with VIX futures to hedge short VXX&lt;/strong&gt;&#xA;I'd like to reproduce the result. I am not sure how to do it. Some key points are &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;I guess the strategy short vxx and long front month vx future so it only has exposure to second front month future.&lt;/li&gt;&#xA;&lt;li&gt;maintain a long vx future position(roll monthly)&lt;/li&gt;&#xA;&lt;li&gt;but how many vxx shares to short ?&lt;/li&gt;&#xA;&lt;li&gt;In this scenario how to maintain market neutral? should I keep beta of vxx+ beta of vx futures = 0 ?&lt;/li&gt;&#xA;&lt;li&gt;what does market neutral, positive beta supposed to mean?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Could someone give me some outlines what to do plz ?&lt;/p&gt;&#xA;" OwnerUserId="7602" LastEditorUserId="16148" LastEditDate="2017-09-20T15:12:39.413" LastActivityDate="2017-09-20T15:12:39.413" Title="Need some suggestion about short vxx long vx future strategy" Tags="&lt;quant-trading-strategies&gt;&lt;hedging&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36102" PostTypeId="1" CreationDate="2017-09-20T15:38:27.440" Score="1" ViewCount="132" Body="&lt;p&gt;I was recently in a competition which simulated real time currency trading. Teams were supposed to build bots that could request current prices of currencies, buy, or sell currencies using HTTP request. The objective was at the end of the competition, teams that gained the most profit wins. Each team was given an initial 500 units from each currency (Total of 6). Also, transactions incur no cost. (Basically once the server receives your request to buy/sell, it performs it right away if valid).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Me and my team developed a bot that used triangular Arbitrage. We request the prices, then try all possible three ways, if any is non consistent, we arbitrage it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, me and my team were relatively successful and we ranked fifth (Out of 35 teams). However, I couldn't help but see that the top three teams generated ridiculous profits (15 times of magnitude as us). &lt;strong&gt;So my natural question is, what strategy would've been the best in this sort of scenario?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="29674" LastActivityDate="2017-09-20T15:38:27.440" Title="Best strategy to maximize Profit if no transaction cost?" Tags="&lt;arbitrage&gt;&lt;finance-mathematics&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36103" PostTypeId="2" ParentId="36097" CreationDate="2017-09-20T16:31:03.043" Score="1" Body="&lt;p&gt;I think your calculation is right and the Kelly criterion is very aggressive. Note however that it is meant to apply to the situation where you win exactly your last bet times 299 84% of the time and you lose exactly your bet times 1181.4 the other percentage of the time. This is not the case here so this is at best an estimation and it's somewhat self defeating as a risk management strategy if that 1181 number comes with a lot of tail risk (not to mention that your measured historical edge may not be representative of your true edge for a variety of reasons). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given these caveats, yes, the kelly procedure is to sell enough spreads so that your total amount at risk (1181 times quantity) would be 20 percent of your bankroll.&lt;/p&gt;&#xA;" OwnerUserId="29286" LastEditorUserId="29286" LastEditDate="2017-09-20T18:15:45.950" LastActivityDate="2017-09-20T18:15:45.950" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36106" PostTypeId="2" ParentId="33807" CreationDate="2017-09-20T19:21:42.837" Score="0" Body="&lt;p&gt;I have reconsidered my previous answer and I think it is possible for any Call price. If the call price ist different from 100% say 102% than one could use a Swaption to receive the fixed coupon and pay a calibrated coupon2 to the corresponding forward Bond price 102%. The calibrated coupon2 would need to be updated at every pricing date.&lt;/p&gt;&#xA;" OwnerUserId="29680" LastActivityDate="2017-09-20T19:21:42.837" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="36107" PostTypeId="2" ParentId="33807" CreationDate="2017-09-20T20:00:22.283" Score="0" Body="&lt;p&gt;I have written brief derivation on page 6 of the following document:&#xA;&lt;a href=&quot;https://github.com/phillyfan1138/PaperMarketRisk/blob/master/MarketRiskDocumentation.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/phillyfan1138/PaperMarketRisk/blob/master/MarketRiskDocumentation.pdf&lt;/a&gt;.  I've implemented a pricing model using the fact that they are equivalent (and unit tested that they are equal) in the following repository: &lt;a href=&quot;https://github.com/phillyfan1138/HullWhite&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/phillyfan1138/HullWhite&lt;/a&gt;.  See especially line 392 of HullWhite.h and test &quot;Payer Swaption&quot; in test.cpp.&lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2017-09-20T20:00:22.283" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36108" PostTypeId="2" ParentId="36088" CreationDate="2017-09-20T20:14:15.967" Score="3" Body="&lt;p&gt;Collateralised means that when the IRS is negatively valued (i.e. a liability) for one of the counterparties then they post collateral to the other respective counterparty (i.e. the asset holder) to protect them against default of the liability owner.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Collateral comes in many forms. The 'gold standard' is cash remunerated at the OIS rate, but it could be corporate bonds or equities or some other weaker form of collateral. For standard swaps cash@OIS is the default collateral type specified in the CSA (credit support annex) and this is why the discount factor curve used for standard IRS is the the OIS curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your (annual) fixed leg is 2%. Suppose you received fixed on EUR100mm and the 6M IBOR rate was 1%, this would imply you make a payment of EUR0.5mm in 6M time. At that point the remaining cashflows on your swap mean it is now an asset of EUR0.5mm, so the counterparty will repay the cashflow, that you just paid to them, back to you. But now the money is in the form of collateral and you will pay the counterparty interest at OIS on the EUR0.5mm.&lt;/p&gt;&#xA;" OwnerUserId="29443" LastActivityDate="2017-09-20T20:14:15.967" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="36111" PostTypeId="1" AcceptedAnswerId="36121" CreationDate="2017-09-21T01:17:33.857" Score="4" ViewCount="397" Body="&lt;p&gt;I've been working with this trader and every time he explains something to me, it sound like foreign language. There's so many things going on. I'm a graduate analyst on the bond trading desk and I don't think it's all that complicated. It's just millions of concepts flying around. Anyone have any advice or the best way to learn? I've read Fabozzi but it isn't the same as sitting on the desk.&lt;/p&gt;&#xA;" OwnerUserId="29342" LastActivityDate="2017-09-21T15:41:48.427" Title="How do bond traders get all the different moving parts?" Tags="&lt;fixed-income&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36112" PostTypeId="1" CreationDate="2017-09-21T01:32:49.920" Score="4" ViewCount="1065" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/gYcJC.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/gYcJC.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am reading a paper. The authors use the multivariate regression to calculate the pure factor return $\beta_F$ using the following equation:&#xA;$$Return_{t+1}=\beta_F f_F + \beta_{RF_1} f_{RF_1} +⋯+ \beta_{RF_N} f_{RF_N} +\epsilon$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;$\beta_F$  = pure factor return for the desired return factor, &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$\beta_{RF_i}$  = pure factor return for Risk factor $i$,&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$f_F$ = evaluated factors (ex: Dividend Yield)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$f_{RF_i}$ = risk factor (ex: size)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;After that, they produce a monthly factor return as the graph here.&#xA;I just wonder from the pure factor return for the desired return factor, how they can get the return over months like the graph?&lt;/p&gt;&#xA;" OwnerUserId="29683" LastEditorUserId="27210" LastEditDate="2017-09-21T05:27:03.047" LastActivityDate="2018-11-11T03:33:02.063" Title="pure factor return for factor model" Tags="&lt;factor-models&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36113" PostTypeId="1" AcceptedAnswerId="36116" CreationDate="2017-09-21T01:50:27.040" Score="0" ViewCount="1598" Body="&lt;p&gt;I saw the question&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/34000/what-does-rolling-for-a-cds-contract-mean/34005#34005&quot;&gt;What does &amp;quot;rolling&amp;quot; for a CDS contract mean?&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One answer says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Entering into a new contract when the old one expires.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;and another says:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Rolling is the act of closing the old contract and opening the new contract&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What I am confused on is whether or not the contract actually expires before purchasing the new one. Is the rolled CDS sold or expired?&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Rolling is the act of closing the old contract and opening the new contract. The maturity of the CDS is typically much longer, with 5Y being the most commonly traded tenor.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Longer than what and how so? Does this mean I sell a 5y CDS and buy a 10y?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And then there's also the 4 points made in this article - think this is talking about rolls in general - what other products are rolled?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.clarusft.com/the-imm-roll-for-swaps-what-is-it-and-what-are-the-volumes/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.clarusft.com/the-imm-roll-for-swaps-what-is-it-and-what-are-the-volumes/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could someone explain what they mean in basic terms?&lt;/p&gt;&#xA;" OwnerUserId="29161" LastEditorUserId="29161" LastEditDate="2017-09-21T02:14:21.230" LastActivityDate="2017-09-21T02:34:45.673" Title="What does rolling a CDS entail?" Tags="&lt;options&gt;&lt;cds&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36114" PostTypeId="2" ParentId="36070" CreationDate="2017-09-21T02:02:05.853" Score="4" Body="&lt;p&gt;You have forgotten the combinatorial factors for binomial probabilities on your terms. You need $$ {n\choose k} p^n(1-p)^{n-k},$$ not just $$ p^n(1-p)^{n-k}.$$ The second term should have a factor of $6$ and the third should have a factor of $15,$ etc.&lt;/p&gt;&#xA;" OwnerUserId="29286" LastActivityDate="2017-09-21T02:02:05.853" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36116" PostTypeId="2" ParentId="36113" CreationDate="2017-09-21T02:34:45.673" Score="3" Body="&lt;p&gt;You sell it and buy a new one. It does not expire. This is conceptually no different from rolling futures if you're more familiar there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems you haven't gotten the gist of the other answer so I'll try to phrase it more clearly. (I don't know much about CDS/CDX so I'm taking the other answerer's word on what the market is like as correct.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say you own some single-name CDS. Say contracts for this name are issued semiannually in Mar and Sep and have a maturity of 5 years. The most recently issued contract is called 'on the run' and it is the most actively traded contract. Say we're before the Sep contract is issued and we have a position in the contract issued Mar17 (which expires Mar22). Once the Sep is issued, we're going to roll to the September, which means we sell our Mar22 contracts and buy Sep22. So we sell an off-the-run 4.5y contract and buy the on-the-run 5y contract. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why do we do this rather than holding? Mostly because the on-the-run is more liquid so unless we're positive we want exposure for the length of the contract, it's good to have one that you can trade out of easily. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Eventually, if we wanted to keep our exposure, we would need to buy a new contract when the old one expires. This is sort of a last-minute roll.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a bit different from futures where the active contract typically expires next month and we need to roll to the next next month if we want to keep our position and not take delivery. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We also might have initially hedged some transaction with the active contract for liquidity reasons, but actually we want to ultimately be hedged with longer maturities. Then, we're going to roll our position in the active contract to a longer maturity when we get a good opportunity to, which means we sell our short-dated contracts and buy longer dated ones. &lt;/p&gt;&#xA;" OwnerUserId="29286" LastActivityDate="2017-09-21T02:34:45.673" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36118" PostTypeId="1" AcceptedAnswerId="36120" CreationDate="2017-09-21T03:24:02.260" Score="0" ViewCount="76" Body="&lt;p&gt;If the bond is trading at 5% and it becomes special, how do you quantify the impact this has on the bond? Or am I misunderstanding the concept of specialness?&lt;/p&gt;&#xA;" OwnerUserId="29342" LastActivityDate="2017-09-21T05:59:52.980" Title="How do you quantify the impact on bond if it becomes special?" Tags="&lt;fixed-income&gt;&lt;fixed&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36119" PostTypeId="2" ParentId="36112" CreationDate="2017-09-21T03:31:02.270" Score="4" Body="&lt;p&gt;From that picture you took, it looks like the $\beta_F$ is a time series.  It's computed by doing a cross-sectional regression at each point in time.&lt;/p&gt;&#xA;" OwnerUserId="27210" LastActivityDate="2017-09-21T03:31:02.270" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36120" PostTypeId="2" ParentId="36118" CreationDate="2017-09-21T05:46:23.857" Score="4" Body="&lt;p&gt;I'll use a real life example back from the early 2000s, since the specialness effect was much more pronounced.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Back on Feb 14, 2001, the 10-year on-the-run note (5s of Feb 15, 2011) traded at a yield of 5.121% / price of 99.062. We assume that the bond will lose its specialness in three months, so we reference the 3-month forward market for clues.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On this day, this issue's 3-month repo rate was 3.14%, so the 3-month forward price is simply:&#xA;$$ 99.062 \times \left(1 + 3.14\% \times \frac{89}{360}\right) - 1.230 = 98.602, $$&#xA;where 1.230 was the accrued interest as of the forward settlement date.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The general collateral repo rate on the same day was over 200 bp higher at 5.19%. If the bond weren't trading special and had to be financed at GC, the forward price calculated above would imply a spot price as follows:&#xA;$$ P \times \left(1 + 5.19\% \times \frac{89}{360}\right) - 1.230 = 98.602. $$&#xA;So without repo advantage, the bond's price should be $P = 98.567$, or a yield of 5.18%. This is 6 bp higher than the quoted yield of 5.12%, indicating that specialness richened the bond by 6 bp.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2017-09-21T05:59:52.980" LastActivityDate="2017-09-21T05:59:52.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36121" PostTypeId="2" ParentId="36111" CreationDate="2017-09-21T05:58:57.110" Score="9" Body="&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Don't get discouraged – this is how we all felt when we got started. This is particularly true in fixed income, where a lot of jargons are thrown around.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Ask your colleagues. You can potentially figure everything out by reading books, but it's much better to just consult your colleagues – it's one thing to have an academic understanding of how things work, it's a totally different matter to hear how practitioners interpret and think about different concepts.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I generally find Fabozzi's books to be too academic. Fixed income is all about market conventions and subtleties, which Fabozzi glosses over. There are much better books written by practitioners. Bruce Tuckman's &lt;em&gt;Fixed Income Securities&lt;/em&gt; is my personal favorite (I prefer the 2nd edition to the 3rd). Another great one is Siddhartha Jha's &lt;em&gt;Interest Rate Markets – A Practical Approach to Fixed Income&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Assuming you work for an institution that publishes such things, read the weekly rates strategy reports from at least the past few years.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2017-09-21T06:20:19.767" LastActivityDate="2017-09-21T06:20:19.767" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36124" PostTypeId="1" AcceptedAnswerId="36127" CreationDate="2017-09-21T13:51:02.550" Score="9" ViewCount="2534" Body="&lt;p&gt;You're invited to a one-on-one coin-flip gambling game. Your opponent has 1 million USD on hand (the max you can bet is 1 million USD). The payouts for flipping heads and tails are as follows:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Tails: You win 2x your bet.&lt;/li&gt;&#xA;&lt;li&gt;Heads: You lose your entire bet. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This game is a one-off gamble; no second chances. &lt;strong&gt;How much would you bet?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(This was from a trading interview so it likely involves choosing the right risk-reward profile. Is there a right answer? Or is this a subjective question?)&lt;/p&gt;&#xA;" OwnerUserId="11917" LastEditorUserId="29031" LastEditDate="2019-09-16T15:57:27.817" LastActivityDate="2019-09-16T15:57:27.817" Title="Trading interview gambling question" Tags="&lt;trading&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="36125" PostTypeId="1" CreationDate="2017-09-21T13:53:40.610" Score="1" ViewCount="92" Body="&lt;p&gt;What are the major commercial providers that specialize in modeling the impact of specific global events on asset class performance? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm familiar with &lt;a href=&quot;http://www.oxfordeconomics.com/forecasts-and-models/countries/scenario-analysis-and-modeling/global-scenarios-service/overview&quot; rel=&quot;nofollow noreferrer&quot;&gt;Oxford Economics&lt;/a&gt;' Global Scenario Service, which will map out specific macro scenarios (e.g conflict in North Korea, BREXIT) and forecast the expected impact under the scenario on variables like GDP, equity markets, growth etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm wondering if there are other researchers that provide similar scenario impact analysis but with more of a focus on portfolio management and asset class expectations. What tools are available for this kind of analysis? Besides Oxford, there doesn't seem to be anyone that provides the same kind of in-depth macro scenario modeling. &lt;/p&gt;&#xA;" OwnerUserId="17712" LastActivityDate="2017-09-23T15:13:12.363" Title="Commercial providers of scenario analysis and modeling" Tags="&lt;portfolio-management&gt;&lt;stress-testing&gt;&lt;scenario-analysis&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36126" PostTypeId="1" CreationDate="2017-09-21T13:58:39.573" Score="1" ViewCount="346" Body="&lt;p&gt;I have a portfolio X with weights $w_i$. I am trying to find the contribution $\xi_i$ of asset $i$ to the total correlation $\rho_{XM}$ of the portfolio X  to an index M. I can't find these contributions when I develop the correlation portfolio/index formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously, the sum of all contributions must be equal to 100%, but the sum over all $i$ of the  contributions times the asset/index correlation $\rho_{iM}$ , must be equal to the portfolio/index correlation $\rho_{XM}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any ideas ? &lt;/p&gt;&#xA;" OwnerUserId="29698" LastEditorUserId="16148" LastEditDate="2017-09-21T17:05:21.590" LastActivityDate="2017-09-21T17:05:21.590" Title="How to calculate the contribution (%) of an asset to the global correlation of the portfolio?" Tags="&lt;portfolio-management&gt;&lt;modern-portfolio-theory&gt;&lt;correlation&gt;&lt;index&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36127" PostTypeId="2" ParentId="36124" CreationDate="2017-09-21T14:40:15.043" Score="10" Body="&lt;p&gt;The Kelly criterion gives the fraction, $f$, of the current bankroll to bet in order to maximize the longterm growth. The criterion is given by&#xA;$$&#xA;f = \frac{bp-q}{b},&#xA;$$&#xA;where $b$ is the winnings received on \$1 bet, $p$ is the probability of winning, and $q=1-p$ is the probability of losing the bet of \$1. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case $b=2$, $p=q=0.5$ so the optimal fraction to bet is&#xA;$$&#xA;f = \frac{2\cdot0.5-0.5}{2} = 0.25.&#xA;$$&#xA;That is 25% of your bankroll or \$250k.&lt;/p&gt;&#xA;" OwnerUserId="5107" LastEditorUserId="5107" LastEditDate="2017-09-22T08:02:01.220" LastActivityDate="2017-09-22T08:02:01.220" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36128" PostTypeId="2" ParentId="36126" CreationDate="2017-09-21T14:42:47.543" Score="2" Body="&lt;p&gt;Say the index is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;X = \sum_{i=1}^n w_iX_i&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and the variance is ${\rm Var}(X) = \sigma^2$ then obviously the covariance of the index with itself is $\sigma^2$ so&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;{\rm Cov}\left(\sum_{i=1}^n w_i X_i, X\right) = \sum_{i=1}^n w_i{\rm Cov}(X_i,X) = \sigma^2&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The correlation is the covariance divided by the square root of the produce of the variances, so dividing everything through by $\sigma^2$ you have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\sum_{i=1}^n w_i \frac{{\rm Cov}(X_i,X)}{\sigma^2} = 1&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might choose to consider the components of this sum the &quot;contribution to the correlation&quot; from each member of the index, i.e.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\xi_i = \frac{w_i}{\sigma^2}{\rm Cov}(X_i,X)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Noting that the covariance can be expressed in terms of the correlation, you also have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\xi_i = \frac{w_i\sigma_i}{\sigma} {\rm Corr}(X_i, X)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and finally, you could note that this is $w_i$ times the coefficient of regression of $X_i$ on $X$, commonly known as the beta, so you have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\xi_i = w_i\beta_i&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It then becomes obvious that the $\xi_i$ must sum to one, since the average beta of the constituents to an index must be one.&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2017-09-21T14:42:47.543" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36129" PostTypeId="2" ParentId="36111" CreationDate="2017-09-21T15:41:48.427" Score="4" Body="&lt;p&gt;This is how we've all felt when we started in FI groups. Not much way around it other than just time on the job, but what is really helpful for a lot of people (myself included) is to keep a notebook nearby and just take down every question you have or anything you don't understand. Then, when things slow down from a sprint to a walk (and you're only with other junior analysts/associates) you can ask colleagues what things mean and fill in your notes.&lt;/p&gt;&#xA;" OwnerUserId="29648" LastActivityDate="2017-09-21T15:41:48.427" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36134" PostTypeId="2" ParentId="34934" CreationDate="2017-09-21T22:01:31.593" Score="3" Body="&lt;p&gt;I'm not exactly sure what you're asking, but since you tagged the question as &lt;em&gt;factor-models&lt;/em&gt;, I'll assume you are modeling the next month's returns of stocks as a function of the factors:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$r_i = \alpha_i + \beta_1f_{i1} + \cdots + \beta_Kf_{iK} + \epsilon_i$$&#xA;where&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$r_i$ is the next return of stock $i$&lt;/li&gt;&#xA;&lt;li&gt;$\alpha_i$ is the part of stock $i$'s return unexplained by factors,&lt;/li&gt;&#xA;&lt;li&gt;$f_{i1},..., f_{iK}$ are your current &lt;em&gt;factor exposures&lt;/em&gt; (dividend yields, market caps, P/E, P/B),&lt;/li&gt;&#xA;&lt;li&gt;$\beta_1,..., \beta_k$ are the &lt;em&gt;factor premiums&lt;/em&gt; which we obtain through a multilinear regression analysis, and &lt;/li&gt;&#xA;&lt;li&gt;$\epsilon_i$ is an error term.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;From your question, it seems like you have a single point-in-time snapshot of all stocks in your universe.  Since your question is a couple of months old, I can only assume that you also have the returns $r_i$ from the next month.  You can now do a cross-sectional regression, where you model how much of next month's returns can be attributed to your $f_{i1},..., f_{iK}$ factor exposures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Excel might not be the ideal tool for the job, but it can be done.  This isn't the right forum for how to do such things in Excel, but &lt;a href=&quot;http://smallbusiness.chron.com/run-multivariate-regression-excel-42353.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; and &lt;a href=&quot;http://www.wikihow.com/Run-a-Multiple-Regression-in-Excel&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; are both links to helpful sites on how to activate and use the &lt;em&gt;Analysis ToolPak&lt;/em&gt; add-in for such tasks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you have computed your premiums $\beta_1,..., \beta_k$, you can combine them with the weights of your portfolio.  If $w_i$ are the portfolio weights, then $\sum_i w_i r_i$ is the return of your portfolio at the next month, and each $\sum_i w_i \beta_j f_{ji}$ explains how much of the portfolio's return can be attributed to that particular factor.  Note that you will most likely have a big chunk leftover $\sum_i w_i \alpha_i$ which can't be explained by factors.  Replace the word &quot;portfolio&quot; with &quot;benchmark&quot;, and you can repeat the exercise with the whole benchmark using the same $\beta_1,..., \beta_k$ (because you used the whole universe to compute them).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I hope this helps!&lt;/p&gt;&#xA;" OwnerUserId="27210" LastEditorUserId="27210" LastEditDate="2017-09-22T03:38:42.093" LastActivityDate="2017-09-22T03:38:42.093" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36135" PostTypeId="1" CreationDate="2017-09-21T22:19:07.563" Score="1" ViewCount="721" Body="&lt;p&gt;I was recently told by a colleague that the risk neutral probabilities should ALWAYS be greater than zero to have a no arbitrage condition. Intuitively, we know probabilities cannot be &amp;lt; 0, but how can we prove that we need them to &gt; 0 too?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am assuming if this is correct, it also applies to trinomial and n-nomial trees too. Can someone please clarify?&lt;/p&gt;&#xA;" OwnerUserId="28452" LastActivityDate="2019-09-12T21:12:43.720" Title="Why risk neutral probabilities should be strictly greater than zero for no arbitrage condition?" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;binomial&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36136" PostTypeId="2" ParentId="36135" CreationDate="2017-09-21T22:26:08.057" Score="2" Body="&lt;p&gt;There is one condition under which the risk neutral probability of an event can be zero: if the real world probability is zero. If not then any contract that pays off in that event must go down in price if the contract is modified as to not pay off or pay off less in that event. Otherwise, one can buy one and sell the other... it's arbitrage in the &quot;free lottery ticket&quot; sense that you get a nonzero probability of a payoff for free. This translates to the risk neutral probability of the event being positive.&lt;/p&gt;&#xA;" OwnerUserId="29286" LastEditorUserId="29286" LastEditDate="2017-09-22T03:20:43.870" LastActivityDate="2017-09-22T03:20:43.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36137" PostTypeId="1" CreationDate="2017-09-21T23:53:24.150" Score="0" ViewCount="63" Body="&lt;p&gt;Scenario:&#xA;stock trading at 100 today, 80% chance it will trade at 110 tomorrow, 20% chance it will trade at 90 tomorrow&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A new 100 strike call option on this stock is worth 8 today (assuming no discounting).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assume you buy this call option. Now, you can hedge this option by selling 50 shares today, giving a payoff of -3 tomorrow. This is clearly a poor trade. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Logically, shouldn’t the payoff of the hedged position be zero in this scenario? What am I missing here?&lt;/p&gt;&#xA;" OwnerUserId="29706" LastEditorUserId="29706" LastEditDate="2017-09-22T00:13:44.507" LastActivityDate="2017-09-22T00:39:45.730" Title="Hedging Options" Tags="&lt;options&gt;&lt;hedging&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2017-09-22T10:38:35.350" ContentLicense="CC BY-SA 3.0" />
  <row Id="36138" PostTypeId="2" ParentId="36137" CreationDate="2017-09-22T00:39:45.730" Score="2" Body="&lt;p&gt;You are missing the fact that the option is worth 5 not 8.  You cannot use the 80/20 probabilities to value the option, you have to use the risk/neutral probabilities , which are 50/50.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-09-22T00:39:45.730" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36140" PostTypeId="2" ParentId="36124" CreationDate="2017-09-22T08:46:46.557" Score="16" Body="&lt;p&gt;An alternative approach is to size your bet to maximize your expected utility, which is assumed to be given by a function $u(w)$ of your total wealth $w$. This could be a better approach than using the Kelly criterion, because the Kelly fraction gives the amount to bet if you want to maximize your long-term growth rate, assuming that you will bet a large number of times, but in this case you are told  that you only get one chance to bet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you bet a fraction $x$ of your bankroll, you will have $1+2x$ if you win and $1-x$ if you lose, so your expected utility is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\tfrac{1}{2}u(1 + 2x) + \tfrac{1}{2}u(1 - x)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maximizing this is equivalent to maximizing $u(1+2x) + u(1-x)$. In the special case of log utility $u(w)=\log w$ you require&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{d}{dx} \left( \log(1+2x) + \log(1-x) \right) = \frac{2}{1+2x} - \frac{1}{1-x} = 0&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which you can solve to give $x = 1/4$, the same answer as if you used Kelly betting to maximize your long-term growth. Other utility functions will give different results.&lt;/p&gt;&#xA;" OwnerUserId="924" LastEditorUserId="924" LastEditDate="2017-09-22T15:37:58.520" LastActivityDate="2017-09-22T15:37:58.520" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36141" PostTypeId="1" CreationDate="2017-09-22T08:56:41.040" Score="0" ViewCount="2047" Body="&lt;p&gt;I'm trying to simulate $N$ correlated assets in Excel in order to estimate a basket option price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For 2 assets, I correlated the two random variables $X_1$ and $X_2$ and then simulate the BlackScholes price increments. At the end, the correlation computed with Excel Function for the two stock prices is completely different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So how do you correlate two BlackScholes stock prices with a correlation $\rho$ ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd like to complete this step correctly before extending to $N$ assets with Cholesky decomposition..&lt;/p&gt;&#xA;" OwnerUserId="29708" LastEditorUserId="26595" LastEditDate="2017-09-25T08:48:17.043" LastActivityDate="2017-09-25T08:48:17.043" Title="Correlated assets in Monte Carlo simulation" Tags="&lt;monte-carlo&gt;&lt;correlation&gt;&lt;random-walk&gt;&lt;asset&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36143" PostTypeId="1" CreationDate="2017-09-22T09:28:42.833" Score="1" ViewCount="135" Body="&lt;p&gt;I want to run some simulation studies of (linear) factor models and for that reasons I am wondering about the features such a simulation should contain - every suggestion is welcome, I'll do my best to update my code accordingly to provide some general usable framework at the end of the day. Citations are welcome, too!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is related to &lt;a href=&quot;https://quant.stackexchange.com/questions/1018/simulating-returns&quot;&gt;this question,&lt;/a&gt; however, I think due to the presence of factors and predictors the setup is sufficiently different to ask a separate question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is my approach:&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Underlying assumptions and statistical model for the returns&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I want to work with linear factor models of the form&#xA;\begin{align}E[r_t] =&amp;amp; \beta(z_t) E[f_t] \\ \beta(z_t) =&amp;amp; \beta_0 + \beta_1z_t \end{align}&#xA;which essentially implies a model for the returns which are driven by the factor returns (I'll go for market excess returns, so it is a CAPM model) and the factor-loadings are time-varying, where the dynamics come from some macro-risk variable $z_t$ which may predict business cycles (I'll go for the aggregated dividend yield).&#xA;Substituting yields&#xA;$$E[r_t] = \beta_0 E[f_t] + \beta_1(z_t \times f_t)   $$&#xA;Based on this framework I first estimate appropriate parameters $\beta$ (and prevailing mispricing $\alpha$) using some test asset. In my case I used some B/M and Size portfolio sorts from Kenneth Frenchs Homepage to get estimates (based on simple OLS) &#xA;$\hat{\alpha}$ and $\hat{\beta}$ which I'll assume to be fixed (probably one could base the simulation on sampled values of these parameters as well). One could also adjust for time-series characteristics by estimating $\hat{\alpha}$ and $\hat{\beta}$ based on some sub-samples of the data, employing rolling windows, state-space models, etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following code is running the regressions. I gathered the FF Market Data and Portfolio-Sort returns (from Kenneth Frenchs Homepage), the dividend yield time-series (from Goyal Welchs Homepage) and combined everything in one data.frame available on a gist:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(RCurl)&#xA;library(tidyverse)&#xA;&#xA;# Read-in data (contains asset returns, market (factor) returns ---------&#xA;# and dividend yield (predictive variable)) -----------------------------&#xA;&#xA;x &amp;lt;- getURL(&quot;https://gist.githubusercontent.com/voigtstefan/&#xA;             be71f96eea328dc32786a56409362b40/raw&#xA;             /3b8bd42fdc3d327767941e44de6321a80a76a247/&#xA;             data.csv&quot;)&#xA;data &amp;lt;- read_csv(x)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The linear model is fitted as follows to get estimates of $\hat \alpha$ and $\hat\beta$:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Fit linear model on predictive variables and market factor -------------&#xA;fit &amp;lt;- lm(Returns~dy+Market,data)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Simulate (noisy) factor returns&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;In a next step I simulate factor returns which are distributed similar to the initial market returns. I only matched the first two moment of this distribution, but probably one could either adjust for the presence of fat tails (estimate a student-t), adjust for time-series aspects (estimate time-varying volatilities).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to see how factor models react to the inclusion of &lt;em&gt;new&lt;/em&gt; factors which do not have explanatory power. In other words, I'll feed the model with additional simulated factors but the simulated returns itself are only driven by, say, the market data.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Simulate factors ------------------------------&#xA;seed.init &amp;lt;- 1 # For reproducability&#xA;sim.factor &amp;lt;- matrix(rnorm(nrow(data),&#xA;                           mean(data$Market),&#xA;                           sd(data$Market)),nrow=nrow(data),ncol=1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;h1&gt;Simulate returns&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Now that I have simulated factors, I can simulate returns by employing the statistical model explained above: I use the predictors (which I do not simulate) and the simulated market returns to sample returns from the regression equation. The factor loadings are replaced with the estimated coefficients.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I gathered (factor) market-returns  and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;we simulate return time-series by running a time-series regression of the portfolio sorts based on B/M and Size on two explanatory variables: market returns and the dividend yield as predictive variable. In a second step I use the estimated parameters to simulate time-series of 150 years of monthly data. I compute the HJ-measure based on the usual moment conditions (with and without conditioning information) for models which always include the market factor but in addition by adding randomly generated \textit{factors} which are independent from the returns and the market factor. In addition I compute the corresponding model likelihoods of the unrestricted version of our Bayesian model.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Simulate returns ------------------------------&#xA;sim.returns &amp;lt;- cbind(1,data$dy,sim.factor)%*%coef(fit) + &#xA;rnorm(n=nrow(data),sd=sd(fit$residuals))&#xA;&#xA;sim.data &amp;lt;- data.frame(returns = sim.returns, factor = sim.factor, dy =  &#xA;data$dy)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="16249" LastActivityDate="2017-09-22T09:28:42.833" Title="Simulating asset returns: (Academia) state of the art" Tags="&lt;returns&gt;&lt;simulations&gt;&lt;asset-pricing&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36146" PostTypeId="1" AcceptedAnswerId="36200" CreationDate="2017-09-22T14:37:23.387" Score="0" ViewCount="1479" Body="&lt;p&gt;I wonder if someone can explain how this should be solved:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Compute the arbitrage free price at t=0 of the Geometric basket call&#xA;  option (My remark: the payoff function is $\max\left(\left( \prod_{i=1}^n&#xA; S_i(T) \right)^{1/n} - K , 0)\right)$ , on the stock $S_t$. &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Hint: $\left( \prod_{i=1}^n S_i(T) \right)^{1/n}$ has the same&#xA;  distribution as $e^X$ where $X \sim N(a, b)$. Start by calculating $a$ and $b$. After that, you can find the price in the same fashion as in the derivation of the Black Scholes formula.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I think I'm supposed to use the Feynman-Kac formula for the price process:&#xA;$$ F(t,s)= e^{-r(T-t)}\mathbb{E}[\Phi(S(T)) \ | \ S_t =s]$$&#xA;(or something like this), but I'm confused by the expectation and w.r.t what I'm integrating. I'd be really grateful if someone could help me with this one!&lt;/p&gt;&#xA;" OwnerUserId="29566" LastEditorUserId="29566" LastEditDate="2017-09-24T18:16:07.247" LastActivityDate="2017-09-27T01:47:00.100" Title="Price of Geometric basket call option" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;" AnswerCount="1" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="36147" PostTypeId="1" AcceptedAnswerId="36278" CreationDate="2017-09-22T16:00:03.007" Score="6" ViewCount="613" Body="&lt;p&gt;This question pops up in my head every few weeks and I'm struggling to really understand the concept / theory behind it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We all know there are different kind of measures of dependencies out there. From Pearson's $\rho$ to Kendall's $\tau$ to more sophisticated tail dependency measures from copula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\lim_{q\downarrow0}\frac{C(q,q)}{q}$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $C$ is the copula of two random variables $X, Y$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In portfolio theory we often asses risk with the standard deviation in optimization, i.e. $\sqrt{w\Sigma w}$. The nice thing about pearson correlation is that we know $Var(w^TX)= w\Sigma w$ if $\Sigma$ is the covariance matrix of the random variables $X$. This simple fact allows us to  use the dependency measure (pearson correlation) to define a risk measure which has a simple structure.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we think deeper about it. We have a dependency matrix $\Sigma$ containing pairwise dependency measures. Using $f_\Sigma (w):= w\Sigma w$ maps then these pairwise dependency to a single risk number for the total portfolio. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;First question&lt;/strong&gt; Can we come up with such meaningful $f$ for other pairwise dependency measures as well to obtain an overall single risk number for the portfolio? Meaningful in this context simply means that we really capturing a sort of risk of the overall portfolio.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I often see that the same quadratic $f$ is used but one just replaces the pairwise dependency matrix. For example using Kendall's tau, correlation or tail dependencies as entries in $\Sigma$. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Second question&lt;/strong&gt; Does this replacing even make sense from a mathematical and risk perspective? What are the pitfalls then of just blindly using such a $\Sigma$ with a different dependency measure? For example the package FRAPO calculates a minimal tail dependency portfolio by quoting from this &lt;a href=&quot;https://rdrr.io/rforge/FRAPO/man/PMTD.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;link&lt;/a&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Akin to the optimisation of a global minimum-variance portfolio, the minimum tail dependennt portfolio is determined by replacing the variance-covariance matrix with the matrix of the lower tail dependence coefficients as returned by tdc.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At least to me it's not clear why this should work and represent a number which tells you something about the risk of the portfolio.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Example for answer Wintermute&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm not sure if I understand / agree. I did the following example in R. Suppose we have 4 assets with the following correlation matrix:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; cor &amp;lt;- matrix(c(1, 0.9, -0.95, -0.96, 0.9 , 1, -0.98, -0.92, -0.95, -0.98, 1, 0.97, -0.96, -0.92, 0.97, 1), nrow=4, byrow=T)&#xA;&amp;gt; cor&#xA;      [,1]  [,2]  [,3]  [,4]&#xA;[1,]  1.00  0.90 -0.95 -0.96&#xA;[2,]  0.90  1.00 -0.98 -0.92&#xA;[3,] -0.95 -0.98  1.00  0.97&#xA;[4,] -0.96 -0.92  0.97  1.00&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;i.e. two asset are highly correlated two are highly uncorrelated. Assume we have an equally weighted portfolio and volatilities (standard deviation of the assets are $(0.12,0.08,0.15,0.02)$. Then the covariance matrix is&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; cov &amp;lt;- matrix(c(cor[1,1]*0.12*0.12, cor[1,2]*0.12*0.08, cor[1,3]*0.12*0.15, cor[1,4]*0.12*0.02, cor[2,1]*0.12*0.08, cor[2,2]*0.08*0.08, cor[2,3]*0.08*0.15, cor[2,4]*0.08*0.02, cor[3,1]*0.12*0.15, cor[3,2]*0.15*0.08, cor[3,3]*0.15*0.15, cor[3,4]*0.15*0.02, cor[4,1]*0.12*0.02, cor[4,2]*0.02*0.08, cor[4,3]*0.02*0.15, cor[4,4]*0.02*0.02),nrow=4,byrow=T)&#xA;&amp;gt; cov&#xA;          [,1]      [,2]     [,3]      [,4]&#xA;[1,]  0.014400  0.008640 -0.01710 -0.002304&#xA;[2,]  0.008640  0.006400 -0.01176 -0.001472&#xA;[3,] -0.017100 -0.011760  0.02250  0.002910&#xA;[4,] -0.002304 -0.001472  0.00291  0.000400&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;checking quickly if I didn't mess around and if the matrices are positive semi-definite:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; cov2cor(cov)&#xA;      [,1]  [,2]  [,3]  [,4]&#xA;[1,]  1.00  0.90 -0.95 -0.96&#xA;[2,]  0.90  1.00 -0.98 -0.92&#xA;[3,] -0.95 -0.98  1.00  0.97&#xA;[4,] -0.96 -0.92  0.97  1.00&#xA;&amp;gt; eigen(cov)&#xA;$values&#xA;[1] 4.237828e-02 1.181651e-03 1.278374e-04 1.223631e-05&#xA;&#xA;$vectors&#xA;            [,1]        [,2]       [,3]        [,4]&#xA;[1,] -0.56773237  0.78783396 -0.2372159  0.02694845&#xA;[2,] -0.37734597 -0.49612636 -0.7636994 -0.16802342&#xA;[3,]  0.72548256  0.36316206 -0.5520474 -0.19243722&#xA;[4,]  0.09468381 -0.03591096 -0.2360838  0.96644184&#xA;&#xA;&amp;gt; eigen(cor)&#xA;$values&#xA;[1] 3.840405106 0.115703083 0.038349747 0.005542064&#xA;&#xA;$vectors&#xA;           [,1]       [,2]        [,3]        [,4]&#xA;[1,] -0.4960354  0.5839966 -0.63706112 -0.08396417&#xA;[2,] -0.4947472 -0.7033709 -0.19753124 -0.47061241&#xA;[3,]  0.5078001  0.2206994 -0.08387845 -0.82848975&#xA;[4,]  0.5013114 -0.3398664 -0.74033705  0.29168255&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Looks all about right. Now lets calculate $w^T\Sigma w$ and $w^TCw$. According to you we should see a difference. However, they are pretty inline with each other:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; sum(w*(cov%*%w))&#xA;[1] 9.55e-05&#xA;&amp;gt; sum(w*(cor%*%w))&#xA;[1] 0.0075&#xA;&amp;gt; w&#xA;[1] 0.25 0.25 0.25 0.25&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;the risk (using the covariance matrix) is zero as we would expect.&lt;/p&gt;&#xA;" OwnerUserId="17133" LastEditorUserId="17133" LastEditDate="2017-10-02T16:42:14.717" LastActivityDate="2017-10-03T13:17:53.007" Title="tail dependency for portfolio optimization" Tags="&lt;risk&gt;&lt;portfolio-optimization&gt;&lt;dependence&gt;" AnswerCount="2" CommentCount="10" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="36148" PostTypeId="1" CreationDate="2017-09-22T16:18:18.453" Score="-1" ViewCount="1855" Body="&lt;p&gt;I understand that zero coupon bond changes as interest rates change. But I am unsure of how to get the delta. Say I buy a 5Y zero coupon bond with notional amount 5M USD. How do I calculate the delta? Interest rates are 2.10%.&lt;/p&gt;&#xA;" OwnerUserId="29715" LastActivityDate="2017-09-23T01:39:45.073" Title="What is the delta of a zero coupon bond?" Tags="&lt;delta&gt;&lt;zero-coupon&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2017-09-25T17:46:23.463" ContentLicense="CC BY-SA 3.0" />
  <row Id="36149" PostTypeId="1" AcceptedAnswerId="36152" CreationDate="2017-09-22T19:34:44.790" Score="2" ViewCount="167" Body="&lt;p&gt;In this &lt;a href=&quot;http://www.investopedia.com/ask/answers/04/031904.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;Investopedia article&lt;/a&gt;,&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;For example, when the Federal Reserve increased interest rates in&#xA;March 2017 by a quarter percentage point, the bond market fell. The&#xA;yield on 30-year Treasury bonds dropped to 3.108% from 3.2%, the yield&#xA;on ten-year Treasury notes fell to 2.509% from 2.575%, and the&#xA;two-year notes' yield fell from 1.401% to 1.312%.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I know that interest rate and bond price are negatively correlated: if interest rate goes up, bond prices drops. Also, for a given amount of coupon earned on each period, if the price drops, the yield should increase instead of falling. What is wrong here? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="24330" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2017-09-23T00:40:04.537" Title="Interest rate vs bond yield" Tags="&lt;interest-rates&gt;&lt;bond&gt;&lt;bond-yields&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36150" PostTypeId="2" ParentId="35880" CreationDate="2017-09-22T22:00:25.320" Score="2" Body="&lt;p&gt;There is absolutely an important relationship between forward contracts and options that doesn't rely on BS (or any model). Although noob2 already mentioned put-call parity being written in terms of forward price, I wanted to shed more light on this. The following derivation applies to any asset that doesn't pay dividends, the ability to take long and short positions on forward contracts, and the ability to long and short European puts and calls. I will use the notation $\alpha^+ = max ( 0, \alpha)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose we are at present time $t=0$ and there are European put $P$ and European call $C$ options on an asset $S$ with expirations $T &amp;gt; 0$ and strikes $K &amp;gt; 0$. Also suppose that the asset $S$ has a forward price for delivery at $T$ of $F$.&#xA;Consider the strategy at $t = 0$:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Take the long position on a forward contract on $S$ for delivery at $T$&lt;/li&gt;&#xA;&lt;li&gt;Long one put at price $P_0$&lt;/li&gt;&#xA;&lt;li&gt;Short one call at price $C_0$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;It follows that the terminal capital of this strategy is:&#xA;    $$X_T = P_T - C_T + S_T - F = (K - S_T)^+ - (S_T - K)^+ + S_T - F$$&#xA;Then simplifying the difference in the two option payouts yields:&#xA;    $$X_T = K - F$$&#xA;Investing $d(T)(K - F)$ at $t=0$ would result in the same terminal capital, where $d(T)$ is the discount factor from $T$ to $0$. Assuming no arbitrage, at $t=0$ our two strategies have the same initial capital and it follows that:&#xA;    $$P_0 - C_0 = d(T)(K - F)$$&#xA;    It is important to note that we have made no assumptions about the behavior of the underlying.&lt;/p&gt;&#xA;" OwnerUserId="27883" LastEditorUserId="27883" LastEditDate="2017-09-23T04:24:07.830" LastActivityDate="2017-09-23T04:24:07.830" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36151" PostTypeId="2" ParentId="35996" CreationDate="2017-09-22T23:45:51.120" Score="1" Body="&lt;p&gt;For those who also need an answer as I did. The explanation is here:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://investorshub.advfn.com/boards/read_msg.aspx?message_id=57101068&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://investorshub.advfn.com/boards/read_msg.aspx?message_id=57101068&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;TLDR: Those data are +- worthless because not only actual short sales (speculations) are included.&lt;/p&gt;&#xA;" OwnerUserId="28920" LastActivityDate="2017-09-22T23:45:51.120" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36152" PostTypeId="2" ParentId="36149" CreationDate="2017-09-23T00:40:04.537" Score="4" Body="&lt;p&gt;The Federal Funds rate is an overnight rate.  It may move differently from longer term rates such as the yield on 10yr notes.  Possible reasons why 10yr yields might move down when the Fed raises the Fed funds rate :   (A) the market thinks that the economy will go into recession so the Fed will have to lower rates down the road. (B) the Fed had been expected to raise the Fed funds rate by 50bp but they only raised it by 25bp.   Etc. &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-09-23T00:40:04.537" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36153" PostTypeId="1" CreationDate="2017-09-23T01:03:53.477" Score="7" ViewCount="4526" Body="&lt;p&gt;I'm looking for short interest data (those disclosed on 15 days basis to FINRA) &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;As far as I know FINRA publishes only OTC data (&lt;a href=&quot;http://otce.finra.org/ESI&quot; rel=&quot;noreferrer&quot;&gt;http://otce.finra.org/ESI&lt;/a&gt;).&lt;/li&gt;&#xA;&lt;li&gt;Nasdaq.com contains only nasdaq traded stocks (SI data of them)&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://regsho.finra.org/regsho-Index.html&quot; rel=&quot;noreferrer&quot;&gt;http://regsho.finra.org/regsho-Index.html&lt;/a&gt; is not what I'm looking for (short volume, not an interest)&lt;/li&gt;&#xA;&lt;li&gt;NYSE offers paid service containing it&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Some sites like gurufocus.com (under ownership sections) contain it and I doubt they buy it from NYSE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do you know about feasible way to obtain this data (in CSV and free would be a dream, but I don't expect that), without scraping sites like gurufocus (some more official way like FINRA download page)&lt;/p&gt;&#xA;" OwnerUserId="28920" LastActivityDate="2019-07-05T02:05:53.787" Title="Equity short Interest data source" Tags="&lt;equities&gt;&lt;data&gt;&lt;market-data&gt;&lt;short-selling&gt;" AnswerCount="3" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36154" PostTypeId="2" ParentId="36148" CreationDate="2017-09-23T01:39:45.073" Score="1" Body="&lt;p&gt;The delta is (value of bond) - (value of bond if rates go up 1bp)&#xA;=5mm/(1.0210)^5 - 5mm/(1.0211)^5&#xA;=$2206&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-09-23T01:39:45.073" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36155" PostTypeId="1" AcceptedAnswerId="36169" CreationDate="2017-09-23T05:26:47.370" Score="1" ViewCount="137" Body="&lt;p&gt;Given Bid Ask Hang Seng Index Future Data, how can I determine whether the current index future price has gone up or down relative to the last price?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Bid       Ask&#xA;20,000    20,001&#xA;20,000    20,000&#xA;19,999    20,001&#xA;19,999    20,000&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since the index future is always in integer form, I was thinking of using &quot;Mid Price&quot; , i.e. &lt;code&gt;Bid + trunc((Ask - Bid) / 2)&lt;/code&gt; in &lt;code&gt;R&lt;/code&gt; and then comparing the mid price with its previous mid price in order to determine whether the index future price has gone up or down? Is this right approach ? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would really appreciate any insights into this. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="15278" LastEditorUserId="15278" LastEditDate="2017-09-23T07:10:39.277" LastActivityDate="2017-11-20T16:50:55.863" Title="Given only Bid Ask and quantity Data, how do I determine whether the security price has gone up or down?" Tags="&lt;data&gt;&lt;market-data&gt;&lt;historical-data&gt;&lt;tick-data&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36156" PostTypeId="1" AcceptedAnswerId="36162" CreationDate="2017-09-23T12:17:14.420" Score="5" ViewCount="940" Body="&lt;p&gt;I tried using the brownian bridge approach to determine the probability &#xA; $$P(S_t&amp;lt;\beta,t\in [0,T]|S_0,S_T)$$ where $S_t$ is a GBM in the usual Black Scholes setup. We know that for a BM $W_t$,&#xA; $$P(W_t&amp;lt;\beta,t\in [0,T]|W_T=x)=1-\exp\bigg(-\frac{2}{T}\beta(\beta-x)\bigg)$$&#xA;and I then tried the following: since $$S_t=S_0e^{(\mu-1/2\sigma^2)t-\sigma W_t}$$we have&#xA;$$\begin{aligned}&amp;amp;P(S_t&amp;lt;\beta,t\in [0,T]|S_0,S_T=s)\\&amp;amp;=P\bigg(W_t&amp;lt;\frac{\ln(\beta/S_0)-(\mu-1/2\sigma^2)t}{\sigma}\bigg|S_0,W_T=\frac{\ln(s/S_0)-(\mu-1/2\sigma^2)T}{\sigma}\bigg)\\&amp;amp;=1-\exp\bigg(-\frac{2}{T}\bigg(\frac{\ln(\beta/S_0)-(\mu-1/2\sigma^2)t}{\sigma}\bigg)\bigg(\frac{\ln(\beta/S_0)-\ln(s/S_0)}{\sigma}\bigg)\bigg)\\&amp;amp;=1-\exp\bigg(-\frac{2}{\sigma^2T}\bigg(\ln(\beta/S_0)-(\mu-1/2\sigma^2)t\bigg)\ln(\beta/s)\bigg)\end{aligned}$$&#xA;Evidently, the correct answer is just$$1-\exp\bigg(-\frac{2}{\sigma^2T}\ln(\beta/S_0)\ln(\beta/s)\bigg)$$&#xA;so I believe I'm almost there. What am I missing?&lt;/p&gt;&#xA;" OwnerUserId="26893" LastActivityDate="2019-01-28T19:33:10.583" Title="GBM probability of hitting barrier" Tags="&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36157" PostTypeId="2" ParentId="36155" CreationDate="2017-09-23T12:31:19.947" Score="1" Body="&lt;p&gt;It's not, mid-price can change even if no trades are executed (such as when the liquidity dries up pr market makers change their prices). You can only compare previous trades to find it whether future price has gone up or not.&lt;/p&gt;&#xA;" OwnerUserId="20084" LastActivityDate="2017-09-23T12:31:19.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36158" PostTypeId="1" CreationDate="2017-09-23T12:37:50.213" Score="0" ViewCount="325" Body="&lt;p&gt;Is there any intuition to use 1/P (inverse of the stock price) as a factor of volatility?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$VOLT = \beta_1 * \frac{1}{P} + Res$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;P.S: In a research paper, I found it's related to the market micro-structure, but I don't really know in which way they are related.&lt;/p&gt;&#xA;" OwnerUserId="25163" LastActivityDate="2017-09-25T02:14:29.317" Title="inverse of stock price" Tags="&lt;volatility&gt;&lt;market-microstructure&gt;" AnswerCount="2" CommentCount="1" ClosedDate="2017-09-27T19:17:58.717" ContentLicense="CC BY-SA 3.0" />
  <row Id="36159" PostTypeId="1" AcceptedAnswerId="37038" CreationDate="2017-09-23T14:19:04.340" Score="0" ViewCount="1146" Body="&lt;p&gt;I have heard that FIX is one of the most widely used protocols for communication of securities exchange systems (correct me if its not!!).&#xA;My question is: is there any other well known protocol like FIX for this kind of communications?&lt;/p&gt;&#xA;" OwnerUserId="29725" LastActivityDate="2019-02-21T14:09:24.547" Title="is there any alternative to FIX protocol" Tags="&lt;market&gt;&lt;exchange&gt;&lt;fix&gt;" AnswerCount="4" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36160" PostTypeId="2" ParentId="36158" CreationDate="2017-09-23T14:33:29.890" Score="1" Body="&lt;p&gt;This is a poor estimator of volatility. Prices suffer from lack of stationarity (making different time periods hard to compare), and aren't mean reverting like we mostly believe volatility is. For example, if an asset increases in price by a constant amount each day the volatility will seem to be going up, even though the standard deviation of the returns is 0. &lt;/p&gt;&#xA;" OwnerUserId="13808" LastActivityDate="2017-09-23T14:33:29.890" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36161" PostTypeId="2" ParentId="36125" CreationDate="2017-09-23T15:13:12.363" Score="1" Body="&lt;p&gt;All the big factor risk model providers do macro scenario analysis as part of their suite of products.  From the point of view of portfolio management, these sorts of products are ideal for putting your own portfolios through what-if scenarios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, MSCI Barra does a macroeconomic factor model described &lt;a href=&quot;https://www.msci.com/msci-macroeconomic-risk-model&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.  Part of their sales pitch includes a &quot;risk model and scenario analysis service&quot;.  There's a similar scenario analysis for factor model provider Northfield in a pdf &lt;a href=&quot;http://www.northinfo.com/documents/702.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;, and I'm sure you could find one for other factor model providers like Axioma.&lt;/p&gt;&#xA;" OwnerUserId="27210" LastActivityDate="2017-09-23T15:13:12.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36162" PostTypeId="2" ParentId="36156" CreationDate="2017-09-23T15:39:26.740" Score="6" Body="&lt;p&gt;In Inequality &#xA;\begin{align*}&#xA;W_t&amp;lt;\frac{\ln(\beta/S_0)-(\mu-1/2\sigma^2)t}{\sigma},&#xA;\end{align*}&#xA;the right-hand side depends on $t$, you are not able to use the above result directly. In this case, a Girsanov transformation is usually employed. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $a= \frac{\mu-1/2\sigma^2}{\sigma}$, $b= \frac{\ln(\beta/S_0)}{\sigma}$, and $c= \frac{\ln(s/S_0)}{\sigma}$. We define the probability measure $\tilde{P}$ such that&#xA;\begin{align*}&#xA;\frac{d\tilde{P}}{dP}\big|_t = e^{-\frac{1}{2}a^2 t - aW_t},&#xA;\end{align*}&#xA;where $P$ is the original probability measure.  Then $\tilde{W}_t = W_t + at$ is a standard Brownian motion under $\tilde{P}$. Let $E$ and $\tilde{E}$ be expectations with respect to measures $P$ and $\tilde{P}$. Then, for any Borel set $A$,&#xA;\begin{align*}&#xA;&amp;amp;\ E\left(\pmb{1}_{\{W_t+at &amp;lt; b, t \in [0, T]\}} \pmb{1}_{\{W_T\in A\}} \right)\\ =&amp;amp;\ \tilde{E}\left(\left(\frac{d\tilde{P}}{dP}\big|_T \right)^{-1}\pmb{1}_{\{W_t+at &amp;lt; b, t \in [0, T]\}} \pmb{1}_{\{W_T\in A\}} \right)\\&#xA;=&amp;amp;\ \tilde{E}\left(e^{\frac{1}{2}a^2 T + aW_T}\pmb{1}_{\{W_t+at &amp;lt; b, t \in [0, T]\}} \pmb{1}_{\{W_T\in A\}} \right)\\&#xA;=&amp;amp;\ \tilde{E}\left(e^{-\frac{1}{2}a^2 T + a\tilde{W}_T}\pmb{1}_{\{\tilde{W}_t &amp;lt; b, t \in [0, T]\}} \pmb{1}_{\{\tilde{W}_T-aT\in A\}} \right)\\&#xA;=&amp;amp;\ \tilde{E}\left(e^{-\frac{1}{2}a^2 T + a\tilde{W}_T}\pmb{1}_{\{\tilde{W}_T-aT\in A\}}\tilde{E}\left(\pmb{1}_{\{\tilde{W}_t &amp;lt; b, t \in [0, T]\}} \,|\, \tilde{W}_T \right) \right)\\&#xA;=&amp;amp;\ \tilde{E}\left(e^{-\frac{1}{2}a^2 T + a\tilde{W}_T}\pmb{1}_{\{\tilde{W}_T-aT\in A\}}\left[1-\exp\Big(-\frac{2}{T}b(b-\tilde{W}_T)\Big) \right] \right)\\&#xA;=&amp;amp;\ E\left(\frac{d\tilde{P}}{dP}\big|_Te^{-\frac{1}{2}a^2 T + a\tilde{W}_T}\pmb{1}_{\{\tilde{W}_T-aT\in A\}}\left[1-\exp\Big(-\frac{2}{T}b(b-\tilde{W}_T)\Big) \right] \right)\\&#xA;=&amp;amp;\ E\left(\pmb{1}_{\{W_T\in A\}}\left[1-\exp\Big(-\frac{2}{T}b(b-W_T-aT)\Big) \right] \right).&#xA;\end{align*}&#xA;That is,&#xA;\begin{align*}&#xA;E\left(\pmb{1}_{\{W_t+at &amp;lt; b, t \in [0, T]\}} \,|\, W_T\right)&amp;amp;=1-\exp\Big(-\frac{2}{T}b(b-W_T-aT)\Big),&#xA;\end{align*}&#xA;or, equivalently,&#xA;\begin{align*}&#xA;E\left(\pmb{1}_{\{W_t+at &amp;lt; b, t \in [0, T]\}} \,|\, W_T=x\right)&amp;amp;=1-\exp\Big(-\frac{2}{T}b(b-x-aT)\Big).&#xA;\end{align*}&#xA;Therefore,&#xA;\begin{align*}&#xA;&amp;amp;\ P\bigg(W_t&amp;lt;\frac{\ln(\beta/S_0)-(\mu-1/2\sigma^2)t}{\sigma}, t \in[0, T]\,\Big|\,S_0,W_T=\frac{\ln(s/S_0)-(\mu-1/2\sigma^2)T}{\sigma}\bigg)\\&#xA;=&amp;amp;\ E\left(\pmb{1}_{\{W_t+at &amp;lt; b, t \in [0, T]\}} \,|\, W_T=c-aT\right)\\&#xA;=&amp;amp;\ 1-\exp\Big(-\frac{2}{T}b(b-c)\Big)\\&#xA;=&amp;amp;\ 1-\exp\Big(-\frac{2}{\sigma^2T}\ln(\beta/S_0)\ln(\beta/s)\Big).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-09-23T21:20:48.223" LastActivityDate="2017-09-23T21:20:48.223" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36164" PostTypeId="2" ParentId="36135" CreationDate="2017-09-23T19:05:05.937" Score="0" Body="&lt;p&gt;For the binomial model with up factor &lt;span class=&quot;math-container&quot;&gt;$u$&lt;/span&gt;, down factor &lt;span class=&quot;math-container&quot;&gt;$d$&lt;/span&gt;, and interest rate &lt;span class=&quot;math-container&quot;&gt;$r$&lt;/span&gt; i.e. if a security at time &lt;span class=&quot;math-container&quot;&gt;$t = n$&lt;/span&gt; is worth &lt;span class=&quot;math-container&quot;&gt;$S_n$&lt;/span&gt;, then at time &lt;span class=&quot;math-container&quot;&gt;$t = n + 1$&lt;/span&gt;, &lt;span class=&quot;math-container&quot;&gt;$S_{n+1} = uS_n$&lt;/span&gt; with probability &lt;span class=&quot;math-container&quot;&gt;$p$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$S_{n+1} = dS_n$&lt;/span&gt; with probability &lt;span class=&quot;math-container&quot;&gt;$q$&lt;/span&gt;; similarly, if &lt;span class=&quot;math-container&quot;&gt;$X$&lt;/span&gt; is left in the bank at &lt;span class=&quot;math-container&quot;&gt;$t = n$&lt;/span&gt;, then at &lt;span class=&quot;math-container&quot;&gt;$t = n + 1$&lt;/span&gt; the account will contain &lt;span class=&quot;math-container&quot;&gt;$(1 + r)X$&lt;/span&gt;. Recall the risk neutral probabilities for the binomial model:&#xA;    &lt;span class=&quot;math-container&quot;&gt;$$\tilde{p} = \frac{(1 + r) - d}{u - d}, \ \tilde{q} = \frac{u - (1 + r)}{u - d}$$&lt;/span&gt;&#xA;    Also recall the no arbitrage condition for this model:&#xA;    &lt;span class=&quot;math-container&quot;&gt;$$d &amp;lt; 1 + r &amp;lt; u$$&lt;/span&gt;&#xA;    This condition implies that our risk neutral probabilities &lt;span class=&quot;math-container&quot;&gt;$\tilde{p} &amp;gt; 0$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$\tilde{q} &amp;gt; 0$&lt;/span&gt;. To answer your first question, we prove that the risk neutral probabilities must be &lt;span class=&quot;math-container&quot;&gt;$&amp;gt; 0$&lt;/span&gt; by showing that arbitrage is possible if this is not the case. Suppose that &lt;span class=&quot;math-container&quot;&gt;$1 + r &amp;lt; d &amp;lt; u$&lt;/span&gt; and we are at time &lt;span class=&quot;math-container&quot;&gt;$t = n$&lt;/span&gt;. This implies that &lt;span class=&quot;math-container&quot;&gt;$\tilde{p} &amp;lt; 0$&lt;/span&gt;. Our strategy will be:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Borrow &lt;span class=&quot;math-container&quot;&gt;$S_n$&lt;/span&gt; from the bank&lt;/li&gt;&#xA;&lt;li&gt;Purchase one share of stock&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;At time &lt;span class=&quot;math-container&quot;&gt;$t = n + 1$&lt;/span&gt; we owe &lt;span class=&quot;math-container&quot;&gt;$(1+r)S_n$&lt;/span&gt; to the bank. Our position in stock is worth either &lt;span class=&quot;math-container&quot;&gt;$uS_n &amp;gt; (1 + r)S_n$&lt;/span&gt; or &lt;span class=&quot;math-container&quot;&gt;$dS_n &amp;gt; (1 + r)S_n$&lt;/span&gt;. We then sell the stock and cover what we owe to the bank, leaving us with a nonzero amount of terminal capital when we invested &lt;span class=&quot;math-container&quot;&gt;$0$&lt;/span&gt;. This is an arbitrage strategy. A similar strategy can be used when &lt;span class=&quot;math-container&quot;&gt;$d &amp;lt; u &amp;lt; 1 + r$&lt;/span&gt;, namely short stock and invest in the bank.&lt;/p&gt;&#xA;" OwnerUserId="27883" LastEditorUserId="27883" LastEditDate="2019-09-12T21:12:43.720" LastActivityDate="2019-09-12T21:12:43.720" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="36165" PostTypeId="1" AcceptedAnswerId="36179" CreationDate="2017-09-23T22:10:54.203" Score="0" ViewCount="148" Body="&lt;p&gt;I have a model that predicts the future price of a stock, and would like to incorporate this information to value the option. Lets take an example. AAPL stock is trading at 151.89 US dollars today (Sep 22, 2017). I would like to compute the fair value of the call option with a strike of 149 that expires on Oct 20, 2017. From the market I can get the current mid price of the option and its implied volatility. However, lets say my model predicts that the value of AAPL on Oct 20, 2017 is normally distributed with a mean of 145 dollars and a standard deviation of 1 dollar. How could I use this information to compute the value of the option? For the purposes of this question, we can assume the dividend yield is 0 and we know the risk free rate.  If somebody has a way to do this for a European option instead of an American that would probably be close enough for my purposes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The purpose of computing the value is so I can buy or sell the option where market price is most different from the value computed above thus maximizing risk adjusted return. The assumption, of course is that my model is accurate.&lt;/p&gt;&#xA;" OwnerUserId="29727" LastEditorUserId="29727" LastEditDate="2017-09-25T14:13:45.287" LastActivityDate="2017-09-25T14:20:27.300" Title="Valuing an option when we have a view on future price of underlying" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;american-options&gt;" AnswerCount="1" CommentCount="10" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36166" PostTypeId="2" ParentId="36159" CreationDate="2017-09-23T22:51:12.600" Score="1" Body="&lt;p&gt;Fix is pretty much the standard if you are talking about communicating with exchanges for market data and orders.  However many exchanges such as CFE also implement proprietary protocols which are much faster.   For people who don’t care about microseconds, it’s often easier to use Fix so they don’t have to write and test code separately for each exchange. &lt;/p&gt;&#xA;" OwnerUserId="29727" LastActivityDate="2017-09-23T22:51:12.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36167" PostTypeId="2" ParentId="3284" CreationDate="2017-09-23T23:57:23.407" Score="7" Body="&lt;p&gt;I saw a lot of &quot;DON'T USE THEM&quot; messages so I think the OP might benefit from a little more comprehensive answer that puts things in perspective. Firstly, understand that no data source is perfect. I have worked with reuters, csidata , eoddata, google, yahoo and they will always have some problems. It is understandable to some extent because:&lt;br&gt;&lt;br&gt;&#xA;a) often exchanges themselves do not report correct data or there was an amendment to the cross price, busted trades etc.&lt;br&gt;&#xA;b) splits and dividends create errors (google's data is supposed to be split adjusted, but not for dividend. Yet there are numerous examples where it's not true)&lt;br&gt;&#xA;c) some vendors ignore splits and divs given on non trading days- that creates problems&lt;br&gt;&#xA;d) tickers change or get delisted and then in a few years some other company or class or shares is assigned that ticker. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good news is generally I have noticed different vendors have different problem and by combining two or more data sources you can reduce errors exponentially. But be careful as different vendors use different notations to represent class/preferred shares.&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Reuters is excellent in keeping track of name-changes/delistings. Their price, split/div is also most accurate. If you have money and want the best, go with them. CSI's split/div data is good, but they have atleast 5% error in prices. EODDATA has good op/tp but don't give historical split/divs and have no customer support. In order of quality I would rank the ones I know as:&lt;br&gt;&lt;br&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;REUTERS - expensive - errors less than 0.1%&lt;br&gt;&lt;/li&gt;&#xA;&lt;li&gt;CSIDATA - budget - errors 5% in prices, less than 0.1% in split/divs&lt;br&gt;&lt;/li&gt;&#xA;&lt;li&gt;EODDATA - budget - errors less than 0.1% in prices. no historical split/divs&lt;br&gt;&lt;/li&gt;&#xA;&lt;li&gt;GOOGLE  - free   - errors 2 to 4% &lt;br&gt;&lt;/li&gt;&#xA;&lt;li&gt;YAHOO   - free   - slightly worse than google, but deteriorating fast&lt;br&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="29729" LastActivityDate="2017-09-23T23:57:23.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36169" PostTypeId="2" ParentId="36155" CreationDate="2017-09-24T13:46:22.947" Score="2" Body="&lt;p&gt;&lt;strong&gt;if only bid ask data is given&lt;/strong&gt; as indicated, your using of mid price is best and common option&lt;/p&gt;&#xA;" OwnerUserId="28856" LastActivityDate="2017-09-24T13:46:22.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36170" PostTypeId="2" ParentId="3284" CreationDate="2017-09-24T16:06:41.397" Score="-1" Body="&lt;p&gt;Try alpha vantage. I have been using them and they have a good api and include dividends and stock splits. &lt;/p&gt;&#xA;" OwnerUserId="29727" LastActivityDate="2017-09-24T16:06:41.397" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36174" PostTypeId="2" ParentId="36158" CreationDate="2017-09-25T02:14:29.317" Score="0" Body="&lt;p&gt;Re: high prices $\Rightarrow$ lower volatility&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's pretty common for high volatility to arise when prices are lowering. This is because prices lowering is a movement in the underlying, and thus increases vol. Volatility is generally not related to the actual price of the underlying - you would ideally like to normalize. $\frac{1}{P}$ could potentially be used for normalization.&lt;/p&gt;&#xA;" OwnerUserId="27883" LastActivityDate="2017-09-25T02:14:29.317" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36175" PostTypeId="1" CreationDate="2017-09-25T03:11:28.707" Score="1" ViewCount="681" Body="&lt;p&gt;Can someone explain how/why bond prices have not changed at t=1. I would expect that even though the curve is not changing, the price at t=1 would not be same at it was at t=0? Shouldn’t  new prices at t=1 be calculated by using forward rates, which can be backed out from the spot rates?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.untag-smd.ac.id/files/Perpustakaan_Digital_1/FINANCE%20Fixed-Income%20Securities%200470852771.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.untag-smd.ac.id/files/Perpustakaan_Digital_1/FINANCE%20Fixed-Income%20Securities%200470852771.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The following text is from Page 234 (Fixed-Income Securities: Valuation, Risk Management and Portfolio Strategies):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;8.1.1 Timing Bets on No Change in the Yield Curve or ‘‘Riding the Yield Curve’’&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When an investor invests in a fixed-income security with a maturity different from his desired holding period, he is exposed to either reinvestment risk or capital risk. Consider, for example, a portfolio manager who has a given amount to invest over 9 months. If he buys a 6-month T-bill, he incurs a reinvestment risk because the 3-month rate at which he will invest his funds in 6 months is not known today. And if he buys a 1-year T-bill, he incurs a risk of capital loss because the price at which he can sell it in 9 months is not known today. Riding the yield curve is a technique that fixed-income portfolio managers traditionally use in order to enhance returns. When the yield curve is upward sloping and is supposed to remain unchanged, it enables an investor to earn a higher rate of return by purchasing fixed-income securities with maturities longer than the desired holding period, and selling them to profit from falling bond yields as maturities decrease over time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We consider at time t =  0 the following zero-coupon curve and five bonds with the same $1,000,000 nominal value and a 6% annual coupon rate. The prices of these bonds are given at time t =  0 and 1 year later at time t =  1, assuming that the zero-coupon yield curve has remained stable (see table below).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Maturity (Years)  Zero-coupon rate (%)      Bond price at t =  0      Bond price at t =  1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1                              3.90                                  102.021                       102.021&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2                             4.50                                   102.842                      102.842&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3                            4.90                                    103.098                      103.098&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4                            5.25                                    102.848                      102.848&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5                           5.60                                     102.077                        —&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A portfolio manager who has $1,020,770 cash at disposal for 1 year buys 1 unit of the 5-year bond at a market price of 102.077%, and sells it 1 year later at a price of 102.848%. The total return, denoted by TR , of the buy-and-sell strategy is given by the following formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;TR = (102. 848 +  6) / 102. 077 −  1 =  6. 633%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Over the same period, a 1-year investment would have just returned 3.90%. The portfolio manager has made 2.733% surplus profit out of his ride. Of course, the calculation is based on the assumption that future interest rates are unchanged. If rates had risen, then the investment would have returned less than 6.633% and might even have returned less than the 1-year rate. Reciprocally, the steeper the curve’s slope at the outset, the lower the interest rates when the position is liquidated, and the higher the return on the strategy.&lt;/p&gt;&#xA;" OwnerUserId="29738" LastActivityDate="2017-09-25T03:11:28.707" Title="Riding the Yield Curve" Tags="&lt;fixed-income&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36179" PostTypeId="2" ParentId="36165" CreationDate="2017-09-25T13:09:03.527" Score="0" Body="&lt;p&gt;You cannot incorporate your own prediction into the &quot;fair value&quot; of the option. &quot;Fair value&quot; of the option is the initial amount required to set up the replication hedging portfolio, and is shown to be equal to the discounted expectation of the option payoff under the risk neutral measure, not the subjective measure that comes out of your &quot;personal&quot; model. You can however compute the distribution of return of buying or selling an option under your &quot;personal&quot; model and build your investment strategy accordingly. &lt;/p&gt;&#xA;" OwnerUserId="17606" LastEditorUserId="17606" LastEditDate="2017-09-25T14:20:27.300" LastActivityDate="2017-09-25T14:20:27.300" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36180" PostTypeId="1" CreationDate="2017-09-25T13:11:54.193" Score="1" ViewCount="11885" Body="&lt;p&gt;This could be a trivial question, but would I like to clear the concepts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Our firm started sourcing the Murex Trades which has all the variety of Derivative products. I noticed that the Curve Assignment service has two types being Used:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Discount Curve&lt;/li&gt;&#xA;&lt;li&gt;Forward Curve&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I noticed that both curves are mapped to most of the products. Can you please confirm the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;In general whats the criteria for selection of the type of curve?&lt;/li&gt;&#xA;&lt;li&gt;Does it generally differs for Short Term  maturing Products and Long Term maturing products?&lt;/li&gt;&#xA;&lt;li&gt;Do we need to consider both curves for Credit Risk purpose?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance&lt;/p&gt;&#xA;" OwnerUserId="29743" LastEditorUserId="26595" LastEditDate="2017-09-25T13:59:27.037" LastActivityDate="2017-09-25T21:45:38.790" Title="Discount Curve Vs Forward Curve" Tags="&lt;finance&gt;&lt;yield-curve&gt;&lt;credit-risk&gt;&lt;discounting&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36183" PostTypeId="1" CreationDate="2017-09-25T21:38:01.227" Score="-1" ViewCount="359" Body="&lt;p&gt;Suppose I was interested in longing volatility. Suppose I bought a long straddle today which expires in 3 months. Suppose that volatility was very high in those 3 months, however, the stock expires at the money on expiration day. The straddle expires worthless but my PnL was still positive. How did I make money? &lt;/p&gt;&#xA;" OwnerUserId="20156" LastActivityDate="2017-09-25T23:17:56.593" Title="Positive PnL with long volatility strategy" Tags="&lt;options&gt;&lt;volatility&gt;&lt;quant-trading-strategies&gt;&lt;option-strategies&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36184" PostTypeId="2" ParentId="36180" CreationDate="2017-09-25T21:45:38.790" Score="-2" Body="&lt;p&gt;You should first understand the difference between a forward rate and a zero rate. The zero rates are what you would normally think of: the discount factor to get the value of a cash flow today. The forward curves are implied discount factors calculated using zero rates which give discount factors in the future under no arbitrage assumptions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The computation of forward rates are trivial. Wiki reference is the best if you forget the calculation: &lt;a href=&quot;https://en.wikipedia.org/wiki/Forward_rate&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Forward_rate&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;It's a function of what you want to discount. For example, if you were valuing cash flows in the future, (i.e. interest rate swap), you would use a forward curve. &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Depends on the product&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Depends on the product &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="20156" LastActivityDate="2017-09-25T21:45:38.790" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36186" PostTypeId="2" ParentId="36183" CreationDate="2017-09-25T22:47:37.717" Score="2" Body="&lt;p&gt;I think you would know better than me. But assuming this is some sort of riddle, I would say you made money by dynamically hedging the straddle. When the stock goes into the money your straddle delta goes positive and you sell stock to hedge. When the opposite happens you buy. You are buying low and selling high.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If on the other hand you just sat on the straddle you of course lost money overall (which doesn't necessarily mean it was a bad trade from an expected value perspective.  Still this example shows if you want more volatility = more money guaranteed you need to dynamically hedge.)&lt;/p&gt;&#xA;" OwnerUserId="29286" LastEditorUserId="29286" LastEditDate="2017-09-25T22:52:50.490" LastActivityDate="2017-09-25T22:52:50.490" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36187" PostTypeId="2" ParentId="36183" CreationDate="2017-09-25T23:17:56.593" Score="1" Body="&lt;p&gt;Another way to look at the riddle. You think volatility will be high during the next three months, so you buy a 6 months straddle. Three months from now, having been proven right, you sell your straddle (which has 3 months to go) at a high price, due to the high implied vol.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-09-25T23:17:56.593" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36188" PostTypeId="1" CreationDate="2017-09-26T10:13:55.010" Score="2" ViewCount="184" Body="&lt;p&gt;This might be a very basic question but I didn't find the answer in the materials I saw on Google. What is the interest rate used to compute the discounted cash flows for both the fixed and variable leg for a basic vanilla interest rate swap ? &#xA;Thank you in advance !&lt;/p&gt;&#xA;" OwnerUserId="29708" LastEditorUserId="29708" LastEditDate="2017-09-26T20:35:28.533" LastActivityDate="2017-09-26T20:35:28.533" Title="Discount rate in IRS valuation" Tags="&lt;interest-rates&gt;&lt;swaps&gt;&lt;discounting&gt;&lt;irs&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36190" PostTypeId="1" CreationDate="2017-09-26T11:56:45.997" Score="1" ViewCount="412" Body="&lt;p&gt;The software vendor that I am using for the calculation of the market risk exposure claim that they cannot compute the delta adjusted of the equity variance swap positions since there is no specific underlying.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I guess that there is an underlying (the volatility of the equity index) but, in general, what would you recommend to use as as exposure measure for this kind of product type?&lt;/p&gt;&#xA;" OwnerUserId="22383" LastActivityDate="2017-09-26T11:56:45.997" Title="Does delta adjusted exposure make sense for an equity variance swap?" Tags="&lt;swaps&gt;&lt;variance&gt;&lt;delta&gt;&lt;exposure&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36193" PostTypeId="2" ParentId="19048" CreationDate="2017-09-26T14:43:28.887" Score="2" Body="&lt;p&gt;Your two problems are highly related. See perhaps Boyd and Vandenberghe Chapter 5 on Lagrangian duality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\mathcal{W} = \left\{ \mathbf{w}: \mathbf{w}_l \leq \mathbf{w} \leq \mathbf{w}_u \right\}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Optimization 1:&lt;/strong&gt;&lt;br&gt;&#xA;\begin{equation}&#xA;	\begin{array}{*2{&amp;gt;{\displaystyle}r}}&#xA;	\mbox{minimize (over $\mathbf{w}$)} &amp;amp; \frac{1}{2} \mathbf{w}'\Sigma\mathbf{w} \\&#xA;	\mbox{subject to} &amp;amp; \mathbf{w}'\boldsymbol{\mu} = r \\&#xA;&amp;amp; A \mathbf{w} = \mathbf{0} \\&#xA;&amp;amp; \mathbf{w} \in \mathcal{W}&#xA;	\end{array}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me define an optimization problem 2b (similar to your optimization problem 2) to more closely match Lagrangian duality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Optimization 2b:&lt;/strong&gt;&lt;br&gt;&#xA;\begin{equation}&#xA;	\begin{array}{*2{&amp;gt;{\displaystyle}r}}&#xA;	\mbox{minimize (over $\mathbf{w}$)} &amp;amp; \frac{1}{2} \mathbf{w}'\Sigma\mathbf{w} + \lambda \left( \mathbf{w}'\boldsymbol{\mu} - r \right) + \mathbf{v}' A \mathbf{w}  \\&#xA;	\mbox{subject to} &amp;amp; \mathbf{w} \in \mathcal{W}&#xA;	\end{array}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Lagrangian duality&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Problem 1 and problem 2b are highly related problems. Define the Lagragian function as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathcal{L}\left(\mathbf{w}, \lambda, \mathbf{v} \right) = \frac{1}{2} \mathbf{w}'\Sigma\mathbf{w} + \lambda \left( \mathbf{w}'\boldsymbol{\mu} - r \right) + \mathbf{v}' A \mathbf{w}  $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where scalar $\lambda$ and vector $\mathbf{v}$ are Lagrange multipliers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your optimization problem 1 is: &#xA;$$\min_{\mathbf{w} \in \mathcal{W}} \max_{\lambda, \mathbf{v}} \mathcal{L}(\mathbf{w}, \lambda, \mathbf{v}) $$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Min-max interpretation: First you pick $\mathbf{w}$ (to minimize the objective), and then (after observing your choice) I get to pick penalties $\lambda$ and $\mathbf{v}$ to maximize the objective. If you violate the constraints, I can choose arbitrarily large penalties so the objective is $\infty$!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a convex problem. If furthermore the feasible set has a non-empty relative interior then &lt;a href=&quot;https://en.wikipedia.org/wiki/Slater%27s_condition&quot; rel=&quot;nofollow noreferrer&quot;&gt;Slater's condition&lt;/a&gt; holds and then the duality gap is zero. We then have:&#xA;$$\min_{\mathbf{w} \in \mathcal{W}} \max_{\lambda, \mathbf{v}} \mathcal{L}(\mathbf{w}, \lambda, \mathbf{v}) =  \max_{\lambda, \mathbf{v}}\min_{\mathbf{w} \in \mathcal{W}} \mathcal{L}(\mathbf{w}, \lambda, \mathbf{v}) $$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interpretation: If the &lt;a href=&quot;https://en.wikipedia.org/wiki/Duality_(optimization)&quot; rel=&quot;nofollow noreferrer&quot;&gt;duality gap is zero&lt;/a&gt; (i.e. the saddle point property), then the order doesn't matter! The max of the min is the same as the min of the max. The primal problem (the left hand side) is the same as the dual problem (on the right hand side).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Define the Lagrangian dual function as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ g(\lambda, \mathbf{v}) = \min_{w \in \mathcal{W}} \mathcal{L}(\mathbf{w}, \lambda, \mathbf{v}) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that the dual function is the value obtained from solving optimization problem 2b. The dual problem is known as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \max_{\lambda, \mathbf{v}} g(\lambda, \mathbf{v}) $$&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Summary&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Define the Lagrangian dual function $g(\lambda, \mathbf{v}$) as value obtained from solving optimization problem 2b. If Slater's condition holds, then your optimization problem 1 is equivalent to the dual problem $\max_{\lambda, \mathbf{v}} g( \lambda, \mathbf{v})$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There exists a $\lambda^*$ and a $\mathbf{v}^*$ such that solving problem 2b gives the same answer as problem 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps the real issue (as I go into in the comments) is in carefully defining your problem. If constraints really are hard constraints, then you can't violate them period. End of story. Where you seem to be going though is that perhaps some of these constraints are more goals than requirements. What's the right penalty then for violating these soft constraints? I don't know?&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;References&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Boyd, Stephen and Lieven Vandenberghe, &lt;a href=&quot;https://web.stanford.edu/~boyd/cvxbook/bv_cvxbook.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;em&gt;Convex Optimization&lt;/em&gt;&lt;/a&gt;, 2004&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rockafellar, R. T., &lt;a href=&quot;https://sites.math.washington.edu/~rtr/papers/rtr054-ConjugateDuality.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;em&gt;Conjugate Duality and Optimization&lt;/em&gt;&lt;/a&gt;, 1974&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-09-29T02:45:10.660" LastActivityDate="2017-09-29T02:45:10.660" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="36200" PostTypeId="2" ParentId="36146" CreationDate="2017-09-27T01:07:05.413" Score="2" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;The answer below assumes that the payoff provided by the OP is correct. The question appears simple, but still a lot of subtleties to deal with. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;We assume that, under the risk-neutral probability measure, &#xA;\begin{align*}&#xA;dS_i(t) = S_i(t) \big(r dt + \sigma_i dW_i(t)\big),&#xA;\end{align*}&#xA;for $i=1, \ldots, n$, where $r$ is the interest rate, $\sigma_i$ is the volatility and $\{W_i(t), t\ge 0\}$ is a standard Brownian motion such that $d\langle W_i, W_j\rangle(t) = \rho_{i, j}dt$ for $i\ne j$. Then,&#xA;\begin{align*}&#xA;\Big(\Pi_{i=1}^nS_i(T)\Big)^{\frac{1}{n}} = \Big(\Pi_{i=1}^nS_i(0)\Big)^{\frac{1}{n}}\exp\bigg(\Big(r -\frac{1}{2n}\sum_{i=1}^n\sigma_i^2\Big)T + \frac{1}{n}\sum_{i=1}^n \sigma_iW_i(T)\bigg).&#xA;\end{align*}&#xA;Let&#xA;\begin{align*}&#xA;\sigma = \frac{1}{n}\sqrt{\sum_{i=1}^n \sigma_i^2 + 2\sum_{i\ne j} \rho_{i, j} \sigma_i \sigma_j},&#xA;\end{align*}&#xA;and &#xA;\begin{align*}&#xA;\xi = \frac{\frac{1}{n}\sum_{i=1}^n \sigma_iW_i(T)}{\sigma \sqrt{T}}.&#xA;\end{align*}&#xA;Then, $\xi$ is standard normal, that is, $\xi\sim N(0, 1)$. Let&#xA;\begin{align*}&#xA;F = \Big(\Pi_{i=1}^nS_i(0)\Big)^{\frac{1}{n}}\exp\bigg(\Big(r -\frac{1}{2n}\sum_{i=1}^n\sigma_i^2 + \frac{1}{2}\sigma^2\Big)T\bigg).&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;\Big(\Pi_{i=1}^nS_i(T)\Big)^{\frac{1}{n}} = F e^{-\frac{1}{2}\sigma^2 T + \sigma \sqrt{T} \xi}.&#xA;\end{align*}&#xA;Moreover, as the derivation of the Black-Scholes formula, &#xA;\begin{align*}&#xA;E\left(\max\bigg(\Big(\Pi_{i=1}^nS_i(T)\Big)^{\frac{1}{n}} -K, 0\bigg) \right) &amp;amp;=E\left(\max\bigg(F e^{-\frac{1}{2}\sigma^2 T + \sigma \sqrt{T} \xi} -K, 0\bigg) \right)\\&#xA;&amp;amp;=F\Phi(d_1) - K \Phi(d_2),&#xA;\end{align*}&#xA;where $\Phi$ is the cumulative distribution function of a standard normal random variable, &#xA;\begin{align*}&#xA;d_1 = \frac{\ln \frac{F}{K}+\frac{1}{2}\sigma^2 T}{\sigma \sqrt{T}},&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;d_2 = d_1 - \sigma \sqrt{T}.&#xA;\end{align*}&#xA;The option value is then given by&#xA;\begin{align*}&#xA;e^{-rT} \big[F\Phi(d_1) - K \Phi(d_2) \big].&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-09-27T01:47:00.100" LastActivityDate="2017-09-27T01:47:00.100" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36202" PostTypeId="2" ParentId="36066" CreationDate="2017-09-27T12:39:43.450" Score="2" Body="&lt;p&gt;I will use a case in which I randomly generate both $\Sigma$ and $\mu$ randomly in 4 dimensions&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import numpy as np&#xA;import matplotlib.pyplot as plt&#xA;from scipy.stats import norm&#xA;from scipy.optimize import bisect&#xA;&#xA;n = 4&#xA;np.random.seed(0)&#xA;&#xA;S = np.random.uniform(0, 1, [n, n])&#xA;S = 0.5 * (S + S.transpose())&#xA;mu = np.random.uniform(-1, 1, n)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The trick with the transpose is just there to ensure that &lt;code&gt;S&lt;/code&gt; is symmetric. I will choose $\alpha = 0.90$, and define the function $H$ as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Sinv = np.linalg.inv(S)&#xA;ones = np.ones_like(mu)&#xA;&#xA;def H(gamma):&#xA;&#xA;    # w&#xA;    w = (ones.dot(Sinv).dot(mu) - gamma) / (ones.dot(Sinv).dot(ones))&#xA;    w = Sinv.dot(mu - w) / gamma&#xA;&#xA;    # H&#xA;    H = w.dot(mu) + norm.ppf(alpha) * np.sqrt(w.dot(S).dot(w))&#xA;&#xA;    return H&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is a plot of $H = H(\gamma)$. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; g = np.linspace(4, 50, num = 500)&#xA; h = np.array(map(H, g))&#xA; i = h &amp;gt; 0&#xA; plt.plot(g[i], h[i])&#xA; plt.show()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/GBtup.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/GBtup.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The function is indeed sort of problematic for large values of $\gamma$ in the sense that any optimization algorithm (pretty much all of them) that uses derivatives will fail. But still you can use &lt;a href=&quot;https://en.wikipedia.org/wiki/Bisection_method&quot; rel=&quot;nofollow noreferrer&quot;&gt;bisection&lt;/a&gt; to find the root&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example I will use $H = 1.04$ (up in the flat region)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;f = lambda x: H(np.exp(x)) - 1.04&#xA;r = bisect(f, 1.5, 6, xtol = 1e-12)&#xA;g0 = np.exp(r)&#xA;print g0, H(g0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which generates the output&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;231.206991393 1.04&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So the root is $\gamma = 231.20699$&lt;/p&gt;&#xA;" OwnerUserId="29731" LastEditorUserId="29731" LastEditDate="2017-09-27T16:01:48.863" LastActivityDate="2017-09-27T16:01:48.863" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36207" PostTypeId="1" AcceptedAnswerId="36211" CreationDate="2017-09-27T22:04:21.003" Score="1" ViewCount="466" Body="&lt;p&gt;Trying to derive the pricing function for a derivative on two assets $S^1$ and $S^2$ with the following payoff function:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\Phi(S^1_T,S^2_T)=S_T^1 \, \unicode{x1D7D9}\{S_T^2\le K\}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where I'm simply using $\unicode{x1D7D9}$ as the indicator function. Also, importantly, the two assets are driven by independent Wiener processes. So, effectively, we have a binary put option on $S_T^2$, where the payoff is $S_T^1$. So, I know a few things from the start. If the payoff was some fixed amount $K$, the pricing function would be $Ke^{-rT}N(-d_2)$. On the other hand, if the payoff was the asset $S_T^2$ itself, the pricing function would be $S_0^2N(-d_1)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, given that we have independent Weiner processes, I feel like the pricing should be more similar to a fixed payoff binary. Furthermore, the payoff should be the risk-neutral expectation of the payoff asset. That is,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;&amp;amp;\pi(t)=S_t^1e^{r(T-t)}e^{-r(T-t)}N(-d_2)\\&#xA;\iff&amp;amp; \pi(t)=S_t^1N(-d_2)&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $d_2$ defined as it would be in the standard B-S model. I'm hoping someone could confirm/deny this and perhaps provide a more rigorous derivation. Thanks.&lt;/p&gt;&#xA;" OwnerUserId="28223" LastEditorUserId="19887" LastEditDate="2017-09-28T11:30:25.690" LastActivityDate="2017-09-28T14:55:30.177" Title="Pricing for an Odd Type of Asset or Nothing Option" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;exotics&gt;&lt;binary-options&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36208" PostTypeId="1" AcceptedAnswerId="36257" CreationDate="2017-09-27T23:46:40.163" Score="0" ViewCount="1033" Body="&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Team $A$ and team $B$, in a series of $7$ games, whoever wins $4$ games first wins. You want to bet $100$ that your team wins the series, in which case you receive $200$, or $0$ if they lose. However the broker only allows bets on individual games. You can bet $X$ on any individual game that day before it occurs to receive $2X$ if it wins and $0$ if it loses. How do you achieve the desired pay-out? In particular, what do you bet on the first match?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Thoughts: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My initial thought was breaking this problem up in terms of combinatorics and probability by asking questions like: how many possible combinations are there for one of the two particular teams to win? What is the probability that $A$ wins?, what is the probability $A$ wins given $B$ wins the first game?, etc...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was a bit stumped by this question so turning to the solution the author suggests that well this is just replicating a $4$-step symmetric binomial tree. Continuing on I could not really follow his solution, I was wondering if there were other ways of answering this problem. Any suggestions or guidance are greatly appreciated. &lt;/p&gt;&#xA;" OwnerUserId="19002" LastActivityDate="2017-09-30T19:17:46.243" Title="Mark Joshi, Quant Interview Question problem 2.34; replicating a digital option on a 4-step symmetric binomial tree" Tags="&lt;option-pricing&gt;&lt;finance-mathematics&gt;&lt;mathematics&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36209" PostTypeId="2" ParentId="36208" CreationDate="2017-09-28T02:27:05.890" Score="2" Body="&lt;p&gt;You can solve it with a 7-step binomial tree, maybe there is a shortcut to get to 4 ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Start with the green nodes which is your final gain/loss, the previous gain/loss is just the mean of those two values, the previous bet is simply half the difference between those two child values (I haven't written those).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First bet is a 31.25 bet, then 31.25 again if you lose, 15.625 if you win.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/jsKW6.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/jsKW6.jpg&quot; alt=&quot;a nasty binomial tree&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1181" LastActivityDate="2017-09-28T02:27:05.890" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36210" PostTypeId="1" CreationDate="2017-09-28T03:14:17.030" Score="1" ViewCount="641" Body="&lt;p&gt;As an US investor, if I enter a basis swap in a foreign currency (say Euribor-Eonia basis in EUR), and book my trade using USD. I must have some sort of FX risk, right?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I hedge such risk? I'd imagine my delta to EURUSD is 0 at the time I enter this swap. But as market moves, my P&amp;amp;L either positive or negative. Does that mean I need to dynamically hedge this FX risk?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(please feel free to edit if my question isn't phrased clearly)&lt;/p&gt;&#xA;" OwnerUserId="17835" LastActivityDate="2017-09-29T06:32:50.777" Title="FX risk of basis swap in foreign currencies" Tags="&lt;risk&gt;&lt;fx&gt;&lt;swaps&gt;&lt;interest-rate-swap&gt;&lt;basis&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36211" PostTypeId="2" ParentId="36207" CreationDate="2017-09-28T03:18:58.127" Score="4" Body="&lt;p&gt;The price is, under the risk-neutral measure, $$ P_t = e^{-r(T-t)}\mathbb E[S_T^1 \mathbb 1(S_T^2\le K)\mid \mathcal F_t].$$ Since the risk-neutral asset processes are independent geometric brownian motions, $S_T^1$ and $S_T^2$ are conditionally independent given $\mathcal F_t.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So the conditional expectation factors and you get $$ P_t = e^{-r(T-t)}\mathbb E[S_T^1\mid \mathcal F_t]\mathbb E[\mathbb 1(S_T^2\le K)\mid \mathcal F_t] = S^1_t N(-d_2)$$ (where &quot;$d_2$&quot; is of course relative to the $S^2_t$ process) just like you say.&lt;/p&gt;&#xA;" OwnerUserId="29286" LastEditorUserId="26595" LastEditDate="2017-09-28T14:55:30.177" LastActivityDate="2017-09-28T14:55:30.177" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36212" PostTypeId="2" ParentId="36210" CreationDate="2017-09-28T03:47:20.933" Score="1" Body="&lt;p&gt;Yes, you have a second order FX risk on the mark-to-market of your basis swap. However it is highly unlikely you will need to hedge it frequently.&lt;/p&gt;&#xA;" OwnerUserId="1181" LastActivityDate="2017-09-28T03:47:20.933" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36213" PostTypeId="1" CreationDate="2017-09-28T08:08:14.933" Score="1" ViewCount="204" Body="&lt;p&gt;I read the paper &quot;Momentum has its moments&quot; (Pedro Barroso and Pedro Santa-Clara, 2012 - available free from Nova Business School), though i didn't fully understand something important, when speaking about changing weights on the WML the authors speaks about number that varies from 0.2 to 2, but since WML consist of long and short what these numbers mean for them? in other words, how can i interpret these numbers as a specific weight for the long and short legs? This question is not just for this specific paper.&lt;/p&gt;&#xA;" OwnerUserId="29771" LastEditorUserId="848" LastEditDate="2017-09-28T08:16:14.143" LastActivityDate="2017-09-28T14:29:37.533" Title="implementation of risk managed momentum strategy" Tags="&lt;momentum&gt;&lt;factor-investing&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36214" PostTypeId="1" AcceptedAnswerId="36248" CreationDate="2017-09-28T12:56:31.380" Score="2" ViewCount="232" Body="&lt;p&gt;I have some questions when dealing with Value-at-Risk (VaR) and Conditional Value-at-Risk (CVaR).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any relationship between $VaR_{\alpha}(X)$ and $VaR_{\alpha}(-&#xA;X)$, or $CVaR_{\alpha}(X)$ and $CVaR_{\alpha}(-X)$ ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, $VaR$ and $CVaR$ are defined as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$VaR_{\alpha}(X) := \inf \left\{x\in \mathbb{R}| Pr(X &amp;gt;x)\leq \alpha \right\}, \alpha \in [0, 1]$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$CVaR_{\alpha}(X) := \frac{1}{\alpha}\int_{0}^{\alpha}VaR_{s}(X)ds$$&lt;/p&gt;&#xA;" OwnerUserId="29773" LastEditorUserId="20913" LastEditDate="2019-05-07T15:08:28.757" LastActivityDate="2019-05-07T15:08:28.757" Title="Questions about VaR and CVaR. Is there any relation between $VaR_{\alpha}(X)$ and $VaR_{\alpha}(-X)$, or $CVaR_{\alpha}(X)$ and $CVaR_{\alpha}(-X)$?" Tags="&lt;value-at-risk&gt;&lt;cvar&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="36216" PostTypeId="2" ParentId="36213" CreationDate="2017-09-28T14:20:00.087" Score="1" Body="&lt;p&gt;Barroso and Santa-Clara recommend that for risk management reasons you &quot;scale the leverage&quot; of the WML strategy over time, and they provide a formula for doing so. Let's say you manage 1 million dollars. Sometimes you short 0.2 million of L stocks against long 0.2 million of W stocks, at other times when circumstances are more favorable you short 2 million of L (twice as much as your capital) against 2 million of W long. The leverage is a decision variable that you control (subject to an upper limit by your Prime Broker, of course, but 2 is realistic and even 3 or 4 is doable if you are crazy enough (good luck if things go wrong)).&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-09-28T14:29:37.533" LastActivityDate="2017-09-28T14:29:37.533" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="36217" PostTypeId="2" ParentId="36100" CreationDate="2017-09-28T14:55:31.673" Score="2" Body="&lt;p&gt;This comes from Chapter 8 of Björk's &quot;&lt;em&gt;Arbitrage Theory in Continuous Time&lt;/em&gt;&quot; entitled &quot;&lt;em&gt;Completeness and Hedging&lt;/em&gt;&quot;. The martingale approach and multidimensional models are only introduced in later chapters (resp. 10 and 13). So I'll write up an answer which does not rely on either of these concepts but rather on the notion of &lt;em&gt;dynamic hedging&lt;/em&gt; in &lt;em&gt;complete marks&lt;/em&gt;, as the title of the chapter suggests.&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Complete derivation&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The exercise says we're working in &quot;&lt;em&gt;the standard Black-Scholes&lt;/em&gt;&quot; framework, that is, with a risky-asset whose spot price $S_t$ follows a GBM with volatility $\sigma$ and a risk-free money market account. The value at time $t$ of 1 unit of currency invested in the latter account will be denoted $B_t$ and the risk-free rate $r$. We assume that $S$ pays no dividends so that investing in $S$ is a self-financing strategy.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We let $ (S_i(t))_{i=1}^N$ denote the $t$-values of $N$ claims contingent on asset $S$ and delivering a payout $(\phi_i(.))_{i=1}^N$ at maturity $T$. We then also let&#xA;$$ V_t = \sum_{i=1}^N h_i(t) S_i(t) \tag{0}$$&#xA;denote the $t$-value of a portfolio composed of a weighted sum of the $N$ contingent claims defined earlier.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(V_t)_{t \geq 0}$ is assumed to be a &lt;strong&gt;Markovian&lt;/strong&gt; process so that we can write $V_t = \color{red}{V}(t,S_t)$. It then follows, by Ito's lemma, that:&#xA;$$ dV_t = \frac{\partial \color{red}{V}}{\partial t} + \frac{\partial \color{red}{V}}{\partial S} dS_t + \frac{\partial^2 \color{red}{V}}{\partial S^2} d \langle S \rangle_t \tag{A} $$&#xA;We will not use this assumption for the moment. We just keep it in mind for later.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(V_t)_{t \geq 0}$ is also assumed to represent the value of a &lt;strong&gt;self-financing&lt;/strong&gt; wealth process. By definition of the self-financing property and by applying Itô's lemma on the individual contingent claims' prices, this leaves us with&#xA;\begin{align}&#xA;dV_t &amp;amp;= \sum_{i=1}^N h_i(t) dS_i(t) \\&#xA;     &amp;amp;= \sum_{i=1}^N h_i(t) \left( \frac{\partial S_i}{\partial t} dt + \frac{\partial S_i}{\partial S} dS_t + \frac{1}{2} \frac{\partial^2 S_i}{\partial S} d\langle S \rangle_t \right) \tag{B}&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the self-financing hedging portfolio $\Pi$ with $t$-value&#xA;$$ \Pi_t = V_t - \alpha(t) S_t $$&#xA;Again, by definition of the self-financing property and using previous identities we have&#xA;\begin{align}&#xA;d\Pi_t &amp;amp;= dV_t - \alpha(t) dS_t \tag{1} \\&#xA; &amp;amp;= \sum_{i=1}^N h_i(t) \left( \frac{\partial S_i}{\partial t} dt + \frac{\partial S_i}{\partial S} dS_t + \frac{1}{2} \frac{\partial^2 S_i}{\partial S} d\langle S \rangle_t \right) - \alpha(t) dS_t \tag{2}&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the above we wee that constructing our dynamic hedge by picking &#xA;$$ \alpha^*(t) = \sum_{i=1}^N h_i(t) \frac{\partial S_i}{\partial S} \tag{3}$$&#xA;makes the P&amp;amp;L of the the hedging portfolio deterministic, or delta-neutral, such that in the limit as $dt \to 0$, the P&amp;amp;L is zero almost surely (perfect hedging).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For this particular choice of $\alpha^*(t)$, the hedging portfolio should therefore earn the risk-free rate in the absence of arbitrage opportunities:&#xA;$$ d(\Pi_t(\alpha^*)) = r \Pi_t(\alpha^*) dt $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Building on $(1)$ and $(2)$ and $(3)$ (and our GBM working assumption for $S$ for the quadratic variation term)&#xA;$$ \sum_{i=1}^N h_i(t) \left( \frac{\partial S_i}{\partial t} + \frac{1}{2} \frac{\partial^2 S_i}{\partial S} \sigma^2 S^2 \right) dt = r \left(V_t - \sum_{i=1}^N h_i(t) \frac{\partial{S_i}}{\partial{S}} S_t \right)  dt $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;hence finally we see that the option price $V_t$ should verify the pricing PDE&#xA;$$ \sum_{i=1}^N h_i(t) \left( \frac{\partial S_i}{\partial t} + r S \frac{\partial S_i}{\partial S} + \sigma^2 S^2 \frac{\partial^2 S_i}{\partial S^2}\right) - rV_t = 0 \tag{4} $$&#xA;$$ V_T = \sum_{i=1}^N h_i(T) \phi_i(S) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Remembering that we can write $V_t = \color{red}{V}(t,S)$ from the Markovian property and identifying the coefficients of the 2 Itô differentials $(A)$ and $(B)$, we can rewrite the above PDE as&#xA;$$ \frac{\partial \color{red}{V}}{\partial t}(t,S) + r S \frac{\partial \color{red}{V}}{\partial S}(t,S) + \sigma^2 S^2 \frac{\partial^2 \color{red}{V}}{\partial S^2}(t,S) - r\color{red}{V}(t,S) = 0 \tag{5} $$&#xA;$$ \color{red}{V}(T,S) = \sum_{i=1}^N h_i(T) \phi_i(S) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is indeed Black-Scholes PDE for $\color{red}{V}(t,S)$. &lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;h2&gt;Alternative derivation&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Let's take the problem the other way around as you propose to do in your original post:&#xA;$$ \frac{\partial V}{\partial t}(t,S) + r S \frac{V}{\partial S}(t,S) + \sigma^2 S^2 \frac{\partial^2 V}{\partial S^2}(t,S) - rV(t,S) \stackrel{?}{=} 0 \tag{5} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We know that $(V_t)$ is &lt;strong&gt;Markovian&lt;/strong&gt;, so that we can write $$V_t = V(t,S) = \sum_{i=1}^N h_i(t) S_i(t,S) $$&#xA;where $S_i(t,S)$ are the fair prices of the $N$ contingent claims, i.e. functions verifying the individual Black-Scholes PDE with terminal conditions involving the payout functions $\phi_i(.)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The derivatives then follow from standard calculus:&#xA;$$ \frac{\partial V}{\partial t}(t,S) = \sum_{i=1}^N \frac{\partial h_i}{\partial t}(t) S_i(t,S) + \sum_{i=1}^N  h_i(t) \frac{\partial{S_i}}{\partial t}(t,S) $$&#xA;$$ \frac{\partial V}{\partial S}(t,S) = \sum_{i=1}^N h_i(t) \frac{\partial{S_i}}{\partial S}(t,S) $$&#xA;$$ \frac{\partial^2 V}{\partial S^2}(t,S) = \sum_{i=1}^N h_i(t) \frac{\partial^2{S_i}}{\partial S^2}(t,S) $$&#xA;Now the key here is to note that the time derivative can be simplified. Thanks to the &lt;strong&gt;self-financing property&lt;/strong&gt;, the $h_i'(t)$ term disappears (see the two identities $(A)$ and $(B)$ above, or &lt;a href=&quot;https://quant.stackexchange.com/questions/33116/self-financing-portfolio&quot;&gt;this&lt;/a&gt; question in the general case where $h_i$ also depends on $S$ in addition to $t$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Plugging these derivatives back in the pricing PDE for $V$, along with the definition of $V$ as the sum of $N$ contingent claims we get that indeed&#xA;$$ \sum_{i=1}^N h_i(t) \left( \frac{\partial S_i}{\partial t}(t,S) + r S \frac{S_i}{\partial S}(t,S) + \sigma^2 S^2 \frac{\partial^2 S_i}{\partial S^2}(t,S) - rS_i(t,S) \right) = 0 $$&#xA;since the functions $S_i(t,S)$ verify the $N$ individual Black-Scholes pricing PDEs.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2017-09-29T14:26:41.657" LastActivityDate="2017-09-29T14:26:41.657" CommentCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="36219" PostTypeId="1" CreationDate="2017-09-28T15:29:34.867" Score="2" ViewCount="532" Body="&lt;p&gt;Provide option prices for call options stuck at 110,120,130, and 140 for an asset at 100 so that there is no arbitrage. I was not sure how to construct the market quickly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is an interview question. I understand that we want to prevent the person from buying and selling a call spread and that the prices would be decreasing. But how do I calculate prices numerically for this question?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks &lt;/p&gt;&#xA;" OwnerUserId="11917" LastEditorUserId="16148" LastEditDate="2017-09-28T15:51:31.233" LastActivityDate="2017-09-28T16:59:55.237" Title="Pricing Calls with different Strikes to prevent arbitrage" Tags="&lt;options&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36220" PostTypeId="2" ParentId="36219" CreationDate="2017-09-28T16:07:38.603" Score="4" Body="&lt;p&gt;You basically need to maintain the convexity with respect to the strike. For example, let's assume that the price of the option struck at 110 is 5 and for the option struck at 140 is 1. Then the price $x$ for the option struck at 120 and the price $y$ for the option struck at 130 satisfy the following inequalities&#xA;\begin{align*}&#xA;x &amp;amp;\le \frac{5+y}{2},\\&#xA;y &amp;amp;\le \frac{x+1}{2},\\&#xA;x &amp;amp;\le \frac{2}{3} \times 5 + \frac{1}{3} \times 1 = \frac{11}{3},\\&#xA;y &amp;amp;\le \frac{1}{3} \times 5 + \frac{2}{3} \times 1 = \frac{7}{3}.&#xA;\end{align*}&#xA;We can set $x=\frac{11}{3}$ and $y=\frac{7}{3}$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2017-09-28T16:07:38.603" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36221" PostTypeId="2" ParentId="36219" CreationDate="2017-09-28T16:54:49.940" Score="3" Body="&lt;p&gt;You can (also) solve the problem by the repeated application of two rules:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rule 1. For any two calls (with same maturity) the higher strike call is cheaper than the lower strike call.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rule 2. For three calls, the middle strike one is cheaper than the linear interpolation of the prices of the other two calls &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Of course, it is the same thing as the convexity property, just a different way to remember it).&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-09-28T16:59:55.237" LastActivityDate="2017-09-28T16:59:55.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36223" PostTypeId="1" CreationDate="2017-09-28T19:47:29.760" Score="2" ViewCount="122" Body="&lt;p&gt;I'm trying to create a script to predict major swings in the price of Aluminium.  I am trying to implement a dynamic time warping algorithm for the same.  Was wondering if this really is the best approach, or if there are some key items that I am missing.&lt;/p&gt;&#xA;" OwnerUserId="29782" LastEditorUserId="19645" LastEditDate="2017-09-29T08:15:20.477" LastActivityDate="2017-09-29T08:15:20.477" Title="What is a good algorithm to predict volatility in metals commodity markets?" Tags="&lt;volatility&gt;&lt;time-series&gt;&lt;forecasting&gt;&lt;machine-learning&gt;&lt;commodities&gt;" AnswerCount="0" CommentCount="0" ClosedDate="2017-09-29T08:16:48.787" ContentLicense="CC BY-SA 3.0" />
  <row Id="36224" PostTypeId="2" ParentId="35025" CreationDate="2017-09-28T22:31:55.387" Score="1" Body="&lt;p&gt;OAS is the fudge compensation factor that falls out in modeling MBS when you don't model expected cash flows (prepayment sensitive) in Risk-Neutral space. Your analogy to corporate default hazard should be interpreted in that light.&lt;/p&gt;&#xA;" OwnerUserId="6139" LastActivityDate="2017-09-28T22:31:55.387" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36225" PostTypeId="1" AcceptedAnswerId="36234" CreationDate="2017-09-29T00:01:40.033" Score="0" ViewCount="705" Body="&lt;p&gt;I'm trying to use publicly-available OIS/IRS clearing data from CME (&lt;a href=&quot;ftp://ftp.cmegroup.com/../../irs/&quot; rel=&quot;nofollow noreferrer&quot;&gt;ftp://ftp.cmegroup.com/../../irs/&lt;/a&gt;) and LCH (&lt;a href=&quot;http://www.lch.com/en/asset-classes/otc-interest-rate-derivatives/volumes/settlement-prices-swapclear-global#usd&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.lch.com/en/asset-classes/otc-interest-rate-derivatives/volumes/settlement-prices-swapclear-global#usd&lt;/a&gt;) to bootstrap discount and LIBOR curves. The data between the two (for 9/27/17) only seems to line up for a few of quotes; otherwise CME seems to be way off.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;CURVE_NAME                      TENOR       CME         LCH     &#xA;USD-LIBOR-BBA 1M                2 Years     0.085503    1.62863&#xA;USD-LIBOR-BBA 1M                3 Years     0.087091    1.7314&#xA;USD-LIBOR-BBA 1M                5 Years     0.086834    1.88156&#xA;USD-LIBOR-BBA 1M                10 Years    0.076219    2.16906&#xA;USD-LIBOR-BBA 1M                30 Years    0.083729    2.42323&#xA;*USD-LIBOR-BBA 3M               2 Years     1.735708    1.71488*&#xA;*USD-LIBOR-BBA 3M               3 Years     1.841474    1.8189*&#xA;*USD-LIBOR-BBA 3M               5 Years     2.001625    1.96906*&#xA;*USD-LIBOR-BBA 3M               10 Years    2.292491    2.24531*&#xA;*USD-LIBOR-BBA 3M               30 Years    2.566058    2.50698*&#xA;USD-LIBOR-BBA 6M                2 Years     0.095259    1.81238&#xA;USD-LIBOR-BBA 6M                3 Years     0.105594    1.9214&#xA;USD-LIBOR-BBA 6M                5 Years     0.113404    2.07906&#xA;USD-LIBOR-BBA 6M                10 Years    0.127893    2.37479&#xA;USD-LIBOR-BBA 6M                30 Years    0.136217    2.64458&#xA;*USD LIBOR-OIS DISCOUNT CURVE   2 Years     1.507455    1.50574*&#xA;USD LIBOR-OIS DISCOUNT CURVE    3 Years     0.225845    1.5926&#xA;USD LIBOR-OIS DISCOUNT CURVE    5 Years     0.251034    1.71656&#xA;USD LIBOR-OIS DISCOUNT CURVE    10 Years    0.296045    1.94901&#xA;USD LIBOR-OIS DISCOUNT CURVE    30 Years    0.351283    2.15568&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How should I interpret this disconnect for the purposes of bootstrapping curves?&lt;/p&gt;&#xA;" OwnerUserId="2119" LastActivityDate="2017-09-29T09:55:52.580" Title="How do I interpret LCH/CME OIS/IRS pricing data?" Tags="&lt;bootstrapping&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36226" PostTypeId="1" CreationDate="2017-09-29T00:36:50.503" Score="0" ViewCount="865" Body="&lt;p&gt;I'm trying to build a zero/spot curve and have two pieces of information.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;1yr zero coupon swap = 1%&lt;/li&gt;&#xA;&lt;li&gt;3yr zero coupon swap = 3%&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;My initial guess was to linearly interpolate which produces a linear curve with slope 1. However, this seems very hand wavy (not rigorously justified) and I'm not convinced it is right. Is there a better approach to tackle this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My end goal is to find overnight rates for each day in the 3yr period.&lt;/p&gt;&#xA;" OwnerUserId="29719" LastEditorUserId="16160" LastEditDate="2017-09-29T01:07:56.803" LastActivityDate="2017-10-03T09:52:36.307" Title="Yield curve interpolation" Tags="&lt;yield-curve&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36228" PostTypeId="1" AcceptedAnswerId="36236" CreationDate="2017-09-29T01:48:23.590" Score="1" ViewCount="47" Body="&lt;p&gt;How to effectively verify the accuracy of a model(may be complicate) for exotic option, if there is no enough data of market price? Is there any related reference?&lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-09-29T11:54:25.673" Title="Verify the accuracy of a model for exotic option if there is no enough data of market price every?" Tags="&lt;options&gt;&lt;exotics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36230" PostTypeId="2" ParentId="36210" CreationDate="2017-09-29T06:32:50.777" Score="-1" Body="&lt;p&gt;So near leg has an x EUR cost funded in USD and far leg returns y EUR. If the swap is even couldn't you use an FX forward to fix the price of the EURUSD cashflow at the far leg? Then you know the total cost of the basis swap no matter how the spot FX market moves.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2017-09-29T06:32:50.777" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="36231" PostTypeId="2" ParentId="36226" CreationDate="2017-09-29T08:08:30.777" Score="0" Body="&lt;p&gt;If you do not have other information about the underlying, I am afraid this is pretty much all you can do. However, it is not that bad as you think. To give you an idea below is the &lt;a href=&quot;https://www.treasury.gov/resource-center/data-chart-center/interest-rates/Pages/TextView.aspx?data=yield&quot; rel=&quot;nofollow noreferrer&quot;&gt;treasury yield rates&lt;/a&gt; at three different dates: today (09/28/2017), one year (09/28/2016) and two years (09/28/2016) ago&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/5rUpu.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/5rUpu.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For each curve I fit a model (dashed lines) of the form&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;{\rm yield} = ae^{-bt} + c&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And these are the estimates for 09/28/2017&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{array}{c|rrr}&#xA;t~({\rm yr}) &amp;amp; \text{exp. fit} &amp;amp; \text{interp.} &amp;amp; \text{actual} \\&#xA;\hline&#xA;1.0 &amp;amp; 1.24 &amp;amp; 1.31 &amp;amp; 1.31 \\&#xA;1.5 &amp;amp; 1.34 &amp;amp; 1.38 &amp;amp; - \\&#xA;2.0 &amp;amp; 1.43 &amp;amp; 1.45 &amp;amp; 1.45 \\&#xA;2.5 &amp;amp; 1.52 &amp;amp; 1.52 &amp;amp; - \\&#xA;3.0 &amp;amp; 1.60 &amp;amp; 1.59 &amp;amp; 1.59 \\&#xA;\end{array}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which shows that the linear interpolation is actually really close to the exponential fit. The reason behind this is that the time variation of the yields is smooth enough to be approximated by a low order expansion around a given point in time&lt;/p&gt;&#xA;" OwnerUserId="29731" LastActivityDate="2017-09-29T08:08:30.777" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36234" PostTypeId="2" ParentId="36225" CreationDate="2017-09-29T09:55:52.580" Score="2" Body="&lt;p&gt;The section that refers to USD-LIBOR-BBA 3M looks correct.  This shows that CME IRS are marginally higher than LCH IRS.  This means that when you bootstrap the curve, the corresponding forward rates will be higher also.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The sections USD-LIBOR-BBA 1M and USD-LIBOR-BBA 6M appear to show the level of 3M-1M and 6M-1M basis swaps respectively.   These may help in bootstrapping the forwards for 1M libor and 6M libor.   The section USD-LIBOR-OIS appears to show the fed funds -3M libor basis swap , which you also need when bootstrapping, since the fed funds rates are needed to present value the cash flows.   &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-09-29T09:55:52.580" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36236" PostTypeId="2" ParentId="36228" CreationDate="2017-09-29T10:35:49.727" Score="2" Body="&lt;p&gt;If your exotic contract specification can degenerate into a lighter exotic structure for which you can observe quotes, make sure you match them.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have nothing at all, try to assess how well you would have done, in average, by selling the exotic and hedging it according to your model assumptions for various past realisations of the market (ideally different regimes). If you always lost money in all scenarii, then your model - and the manner in which it captures the true market dynamics - is probably not suited for the sell-side. If you always made money, then your probably charging too high of a price and will not be competitive, hence not suited for the sell-side either. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;As mentioned in the comments below, it may also help you to read the answers given to &lt;a href=&quot;http://quant.stackexchange.com/a/27495/19887&quot;&gt;this&lt;/a&gt; related question.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2017-09-29T11:54:25.673" LastActivityDate="2017-09-29T11:54:25.673" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="36238" PostTypeId="1" CreationDate="2017-09-29T11:41:57.267" Score="5" ViewCount="164" Body="&lt;p&gt;From Jacod and Shiryaev's Limit Theorems for Stochastic Processes, we get the following definitions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Definitions:&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;A process with independent increments (abbreviated PII) $X = (X_t)_{t \geq 0}$ on a stochastic basis $(\Omega, \mathcal{F}, \mathbb{F} = (\mathcal{F}_t)_{t \geq 0}, \mathbb{P})$ is a càdlàg adapted real-valued process with $X_0 = 0$ and for all $0 \leq s \leq t &amp;lt; +\infty$, $X_t - X_s$ is independent of $\mathcal{F}_s$.&lt;/li&gt;&#xA;&lt;li&gt;A Lévy process (also called process with independent and stationary increments) on a stochastic basis $(\Omega, \mathcal{F}, \mathbb{F}, \mathbb{P})$ is a PII $X$ such that the distribution of the increment $X_t - X_s$ depends only on $t-s$, for all $0 \leq s \leq t$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Lévy processes are ubiquitous in mathematical finance. For example, most models for the return of financial assets (Brownian motion, Kou, Merton, CGMY, etc...) are Lévy processes. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would like to know if processes with independent increments which are not Lévy (i.e. not stationary) are used in finance. One possible application could be models with seasonal changes in parameters of the distribution. Thanks a lot !&lt;/p&gt;&#xA;" OwnerUserId="29788" LastActivityDate="2018-02-03T14:47:22.797" Title="Are processes with independent increments (which are not Lévy) used in finance?" Tags="&lt;stochastic-processes&gt;&lt;models&gt;&lt;modelling&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36239" PostTypeId="2" ParentId="34189" CreationDate="2017-09-29T13:30:13.093" Score="0" Body="&lt;p&gt;See the paper by Ding and Martin (2017), &quot;The fundamental law of active management, Redux&quot;, published in the Journal of Empirical Finance.&lt;/p&gt;&#xA;" OwnerUserId="29791" LastActivityDate="2017-09-29T13:30:13.093" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36245" PostTypeId="1" CreationDate="2017-09-29T21:09:56.540" Score="6" ViewCount="2890" Body="&lt;p&gt;What is the difference between financial economics and finance?&lt;/p&gt;&#xA;" OwnerUserId="29795" LastEditorUserId="19645" LastEditDate="2020-12-30T13:46:48.137" LastActivityDate="2020-12-30T13:46:48.137" Title="Financial economics vs finance" Tags="&lt;finance&gt;&lt;economics&gt;" AnswerCount="1" CommentCount="3" ClosedDate="2017-10-02T08:54:27.217" ContentLicense="CC BY-SA 4.0" />
  <row Id="36247" PostTypeId="2" ParentId="36245" CreationDate="2017-09-29T22:36:53.887" Score="8" Body="&lt;p&gt;Financial economics is what economics calls finance. Finance is what finance calls finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Less flippantly though, there's a long debate on whether finance is a subfield of economics, and this debate goes back at least to the PhD thesis of Markowitz. Prof. Milton Friedman famously opposed awarding Markowitz a PhD in economics from the University of Chicago for his portfolio theory because while Markowitz's work was brilliant, Friedman didn't consider it to be economics. I've heard Myron Scholes also express views that finance is to some extent distinct from economics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, you can find a huge range of views on whether finance is an economics subfield. Clearly much of the early work in finance was done by economists, and finance draws heavily from econometrics, time-series econometrics, and macroeconomics. On the other hand, risk-neutral pricing looks less like classic economics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd personally argue there's some degree of economics claiming successful, related fields as its progeny. The mechanism design of Alvin Roth came out of operation research, but it's now been brought into economics.&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-11-21T21:07:09.827" LastActivityDate="2017-11-21T21:07:09.827" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36248" PostTypeId="2" ParentId="36214" CreationDate="2017-09-29T23:54:45.220" Score="2" Body="&lt;p&gt;We consider the case where the distribution function $F$ of $X$ is strictly increasing. Then &#xA;\begin{align*}&#xA;VaR_{\alpha}(X) &amp;amp;= \inf\{x: P(X &amp;gt;x) \le \alpha \}\\&#xA;&amp;amp;=\inf\{x: F(x)\ge 1-\alpha \}\\&#xA;&amp;amp;=F^{-1}(1-\alpha).&#xA;\end{align*}&#xA;Moreover, we note that the distribution function $G$ of $-X$ is defined by&#xA;\begin{align*}&#xA;G(x) &amp;amp;= P(-X \le x) \\&#xA;&amp;amp;=1-F(-x),&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;VaR_{\alpha}(-X) &amp;amp;= G^{-1}(1-\alpha)\\&#xA;&amp;amp;=-F^{-1}(\alpha)\\&#xA;&amp;amp;=-VaR_{1-\alpha}(X).&#xA;\end{align*}&#xA;Furthermore,&#xA;\begin{align*}&#xA;CVaR_{\alpha}(-X) &amp;amp;=\frac{1}{\alpha}\int_0^{\alpha}VaR_s(-X)ds\\&#xA;&amp;amp;=-\frac{1}{\alpha}\int_0^{\alpha}VaR_{1-s}(X)ds\\&#xA;&amp;amp;={\color{red}{-}}\frac{1}{\alpha}\int_{1-\alpha}^1 VaR_s(X)ds\\&#xA;&amp;amp;=-\frac{1}{\alpha}\left(\int_0^1 VaR_s(X)ds - \int_0^{1-\alpha} VaR_s(X)ds\right)\\&#xA;&amp;amp;=-\frac{1}{\alpha}\int_0^1F^{-1}(1-s)ds +\frac{1-\alpha}{\alpha}CVaR_{1-\alpha}(X)\\&#xA;&amp;amp;=-\frac{1}{\alpha}\int_0^1F^{-1}(s)ds +\frac{1-\alpha}{\alpha}CVaR_{1-\alpha}(X)\\&#xA;&amp;amp;=-\frac{1}{\alpha}\int_{-\infty}^{\infty} x\, dF(x) +\frac{1-\alpha}{\alpha}CVaR_{1-\alpha}(X)\\&#xA;&amp;amp;=-\frac{1}{\alpha} E(X) +\frac{1-\alpha}{\alpha}CVaR_{1-\alpha}(X).&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-10-11T12:50:46.177" LastActivityDate="2017-10-11T12:50:46.177" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36249" PostTypeId="2" ParentId="21182" CreationDate="2017-09-30T03:31:41.740" Score="1" Body="&lt;p&gt;The OP states that $W(t)$ and $B(t)$ are two independent Brownian motions, which is slightly different from Standard Brownian Motion/Wiener Process, even if they have little in common (both are Markov and Martingale processes). The Wiener process is the standard Brownian motion while a general Brownian motion is of a form:&#xA;$B(t)=\alpha\,W(t)+\beta$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The definition of the Brownian motion from &lt;a href=&quot;http://www.springer.com/us/book/9780387401010&quot; rel=&quot;nofollow noreferrer&quot;&gt;Stochastic Calculus for Finance II (Shreve, 2004)&lt;/a&gt; is:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Let $(Ω, F, P)$ be a probability space. For each $ω ∈ Ω$, suppose&#xA;  there is a continuous function $W(t)$ of $t ≥ 0$ that satisfies &#xA;  $$W(0) = 0\tag1$$ and that depends on $ω$. Then $W(t)$, $t ≥ 0$, is a&#xA;  Brownian motion if for all $0=t_0 &amp;lt;t_1 &amp;lt;···&amp;lt;t_m$ the increments&#xA;  $W(t_1) = W(t_1)−W(t_0),W(t_2)−W(t_1),...,W(t_m)−W(t_{m−1})$ are&#xA;  independent and each of these increments is normally distributed with&#xA;  $$\mathop{\mathbb{E}}[W(t_{i+1}) − W(t_i)] = 0, \tag2$$&#xA;  $$Var[W(t_{i+1})−W(t_i)]=t_{i+1}−t_i \tag3$$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;So, if $X(t)=\dfrac{W(t)+B(t)}{2}$ is Brownian motion, it must verify the properties $(1)$, $(2)$, and $(3)$.&#xA;Let's see: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Property $(1)$&lt;/strong&gt;&#xA;$$\begin{align}&#xA;X(0)&amp;amp;=\dfrac{W(0)+B(0)}{2}\\&#xA;    &amp;amp;=0&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Property $(2)$&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For $0\leq s\leq t$:&#xA;$$\begin{align}&#xA;\mathop{\mathbb{E}}[X(t)-X(s)]&amp;amp;=\mathop{\mathbb{E}}\left[\dfrac{W(t)+B(t)}{2}-\dfrac{W(s)+B(s)}{2}\right]\\&#xA;    &amp;amp;=\dfrac{\mathop{\mathbb{E}}[W(t)-W(s)]+\mathop{\mathbb{E}}[B(t)-B(s)]}{2}\\&#xA;    &amp;amp;=0&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Property $(3)$&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For $0\leq s\leq t$:&#xA;$$\begin{align}&#xA;Var[X(t)-X(s)]&amp;amp;=\mathop{\mathbb{E}}\left[\dfrac{W(t)+B(t)}{2}-\dfrac{W(s)+B(s)}{2}\right]\\&#xA;    &amp;amp;=Var\left[\dfrac{W(t)-W(s)}{2}\right]+Var\left[\dfrac{B(t)-B(s)}{2}\right]\\&#xA;    &amp;amp;=\dfrac{1}{4}\,Var[W(t)-W(s)]+\dfrac{1}{4}\,Var[B(t)-B(s)]\\&#xA;    &amp;amp;=\dfrac{1}{2}\,(t-s)\\&#xA;    &amp;amp;\neq t-s&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $Var[X(t)-X(s)]\neq t-s$, for $0\leq s \leq t$, we conclude that $X(t)$ is not a Brownian motion for $t\geq 0$.&lt;/p&gt;&#xA;" OwnerUserId="25265" LastActivityDate="2017-09-30T03:31:41.740" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36250" PostTypeId="1" CreationDate="2017-09-30T10:23:22.697" Score="1" ViewCount="99" Body="&lt;p&gt;I'm studying Monte Carlo analysis but I find very counter-intuitive the computation of the minimum sample size in order to reach a certain level of precision. As stated in &lt;code&gt;Montecarlo methods in Financial Engineering&lt;/code&gt;, such sample size comes from the CLT and it can be computed according to&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$n = \frac{z^2_{\delta/2} \sigma^2}{\epsilon^2}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My experiment is the classic bernoulli variable, with $p$ probability of success.&#xA;Suppose my level of precision is $0.01$, then my $z_{0.01/2} = 2.57$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I consider three cases.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$p=0.1\%$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$p=1\%$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$p=10\%$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With $\sigma^2 = p(1-p)$, I get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$n_{10\%} = 2.57^2 \cdot 0.1 \cdot 0.9 / 0.01^2 = 5944$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$n_{1\%} = 2.57^2 \cdot 0.01 \cdot 0.99 / 0.01^2 = 654$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$n_{0.1\%} = 2.57^2 \cdot 0.001 \cdot 0.999 / 0.01^2 =  66$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuitevely I would think the rarer the event, the greater the number of the simulations needed in order to approach the theoretical mean.&#xA;What am I getting wrong?&lt;/p&gt;&#xA;" OwnerUserId="29801" LastEditorUserId="24222" LastEditDate="2017-09-30T14:25:09.633" LastActivityDate="2017-09-30T14:25:09.633" Title="Monte Carlo convergence sample size" Tags="&lt;monte-carlo&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36252" PostTypeId="1" AcceptedAnswerId="36283" CreationDate="2017-09-30T13:18:21.830" Score="1" ViewCount="483" Body="&lt;p&gt;In Proof of Proposition 1.2.20 in the following lectures notes&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://math.uni-heidelberg.de/studinfo/reiss/sode-lecture.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://math.uni-heidelberg.de/studinfo/reiss/sode-lecture.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found following quote&#xA;&quot; stochastic integrals with respect to independent Brownian motions&#xA;are uncorrelated (attention: they may well be dependent!).&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I was wondering now when this can occur.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given two independent Wiener processes $W_{1}$ and $W_{2}$.&#xA;We consider two Ito integrals:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\int_{0}^{t} F(s)\,dW_{1}(s)$ and $\int_{0}^{t} G(s)\, dW_{2}(s)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From general (multi-dimensional) Ito-isometry, the two integrals are uncorrelated. Using approximations of $F$ and $G$ by simple functions, one can show uncorrelation probably pretty straight forward. &#xA;However, I am wondering when the two integrals can become dependent. &#xA;My questions therefore are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Is there an easy example for this?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Assuming that $F$ and $G$ are deterministic, does then follow independence? And if so, how does one show this?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="27389" LastActivityDate="2017-10-03T19:53:23.530" Title="Stochastic integrals wrt to independent Wiener processes are uncorrelated, but potentially dependent?" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36253" PostTypeId="1" AcceptedAnswerId="36261" CreationDate="2017-09-30T15:29:33.743" Score="3" ViewCount="2735" Body="&lt;p&gt;If two bonds have yield of 5% and 2% and assume there's no price change, can we say that the carry is simply 5%-2% = 3% for a year. Does this take into account coupons?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equivalently, let's say the 10s30s curve is 60 basis points. Can you simply take 60 and divide by 20 years to get 3 basis point of carry per year. Does this even make sense?&lt;/p&gt;&#xA;" OwnerUserId="29342" LastActivityDate="2017-10-01T20:40:19.617" Title="Question on pure carry for two bonds" Tags="&lt;fixed-income&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="36254" PostTypeId="2" ParentId="36147" CreationDate="2017-09-30T16:23:45.833" Score="2" Body="&lt;p&gt;Let $X$ be an $n \times 1$ random vector and $w$ a vector of coefficients. Then we know that $$Var(w^TX)=w^T \;Var(X) \;w=w^T\Sigma w$$ where $\Sigma$ is the covariance matrix of $X$. Now suppose that $C$ is the correlation matrix of $X$ and $e$ is the $n \times 1$ vector of all ones. We see that $$w^T C w = w^Te +\sum_{i \neq j}w_iw_jc_{ij}$$ where $c_{ij}$ is the correlation between the $i^{th}$ and $j^{th}$ components of $X$. Now $c_{ij}$ tells you the strength of any possible linear relationship between the $i^{th}$ and $j^{th}$ components of $X$ (1 or -1 means a perfect linear relationship). What does it mean to sum correlations? In the context of multiple regression it can be used to compute $R^2$ to see how much of the variance is described by your model, however in the context of portfolio risk I'm not sure it tells us anything meaningful. For example if half the correlations are 1 and the other half -1 $w^T C w$ would be small and you might think you have low risk. However you should have a strong linear dependance between all of your stocks. I would say the same for Kendall's tau. In general I would say it is dangerous to use any measure which is not first and foremost rational. In addition it is dangerous to use any code which you do not completely understand. It is not even remotely clear to me how the code in the link you provided works so I would stay away. If you want to measure the tail risk of your portfolio I would recommend fitting a power law to your time series of portfolio returns. This will give you a good idea of how kurtotic your portfolio returns are.&lt;/p&gt;&#xA;" OwnerUserId="13698" LastActivityDate="2017-09-30T16:23:45.833" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36255" PostTypeId="1" CreationDate="2017-09-30T16:24:31.700" Score="0" ViewCount="2205" Body="&lt;p&gt;I am struggling to understand bootstrapping the spot curve based on euroswaps. These contracts have a fixed leg paying an annual rate and a variable leg paying either euribor 3m 4 times a year or euribor 6m 2 times a year.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First of all I would like to know which is the swap to be used, fixed vs. 3m or 6m?&#xA;Then to bootstrap the zero curve, I don’t quite follow the bond equivalence. In a swap with the same payment frequency I understand that the fixed leg is equivalent to a bond priced at par paying the rate as coupon. This equivalence does not seem valid to me though when the payment schedule is not the same on both legs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cheers, &lt;/p&gt;&#xA;" OwnerUserId="29803" LastActivityDate="2018-12-21T19:54:54.083" Title="Bootstrapping the spot curve based on swaps" Tags="&lt;interest-rate-swap&gt;&lt;bootstrapping&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36257" PostTypeId="2" ParentId="36208" CreationDate="2017-09-30T19:17:46.243" Score="3" Body="&lt;p&gt;The answer above is only confusing because it is missing the the bet amounts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have a series of events, you are only allowed to bet on single events.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You want to construct something such that the payoff is dependent on the various outcomes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/JqzUW.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/JqzUW.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we need to fill in the blanks - the current winnings, and the bet at each point. for each node $n_{ij}$, the current winnings must be the value at the previous nodes $\pm$ the bet (depending on if it were a win or loss).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first layers are pretty trivial:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if i have X, and betting Y leaves me with 0 if i lose, then X must equal Y. and if winning leaves me with 2Y, then X = half the winnings. So the final node has me with a balance of 100, and betting 100. I do the same for all the nodes where i can infer the same thing:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Nflae.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Nflae.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that you can only fill in nodes where you know both possible outcomes. Fortunately these always exist. Now you fill in the middle node where the score would be 2-2, and then all of those diagonals:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/jVNC8.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/jVNC8.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And you then arrive at the same answer as above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll have a think about it tomorrow on how to do it with just 4 nodes though.&lt;/p&gt;&#xA;" OwnerUserId="19663" LastActivityDate="2017-09-30T19:17:46.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36258" PostTypeId="2" ParentId="33967" CreationDate="2017-09-30T19:43:56.997" Score="2" Body="&lt;p&gt;Please see the papers below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sebastián A. Rey, Non-Arbitrage Valuation of Equities. International Journal of Financial Markets and Derivatives (2015) vol. 4, no 3/4, p. 231-245&#xA;&lt;a href=&quot;http://www.inderscienceonline.com/doi/abs/10.1504/IJFMD.2015.073472?mobileUi=0&amp;amp;&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.inderscienceonline.com/doi/abs/10.1504/IJFMD.2015.073472?mobileUi=0&amp;amp;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sebastián A. Rey, The Valuation of Equities and the GDP Growth Effect: A Global Empirical Study. International Journal of Financial Studies (2016) vol. 4, no 4, 21&#xA;&lt;a href=&quot;http://www.mdpi.com/2227-7072/4/4/21&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.mdpi.com/2227-7072/4/4/21&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="29805" LastActivityDate="2017-09-30T19:43:56.997" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36259" PostTypeId="1" CreationDate="2017-09-30T21:11:51.057" Score="0" ViewCount="294" Body="&lt;p&gt;My example is:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Current price = 20,&lt;/li&gt;&#xA;&lt;li&gt;If it goes up it'll be worth 22, if it goes down it will be worth 18&lt;/li&gt;&#xA;&lt;li&gt;risk free rate: 12%, time = 3 months&lt;/li&gt;&#xA;&lt;li&gt;Strike = 21&lt;/li&gt;&#xA;&lt;li&gt;call option is worth 0.633&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I know that if the call option value is less than 0.633 then there's an opportunity for arbitrage but what about if the option is being sold in the market at 0.7? What strategy is used in this case?&lt;/p&gt;&#xA;" OwnerUserId="29807" LastActivityDate="2021-04-02T18:00:20.057" Title="How to show arbitrage when a European option price is greater than the no-arbitrage price?" Tags="&lt;options&gt;&lt;arbitrage&gt;&lt;no-arbitrage-theory&gt;&lt;european-options&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36261" PostTypeId="2" ParentId="36253" CreationDate="2017-10-01T20:40:19.617" Score="7" Body="&lt;p&gt;The quick answer - &lt;b&gt;No, not really, on any of the points.&lt;/b&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cost-of-carry (and its counterpart, roll-down) are concepts very misunderstood in the fixed income world if you ask me. Most people seem to have their own, ill-defined definitions of what cost-of-carry and roll-down are. Sometimes people interchange or even bastardise these terms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My definition is as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;b&gt;Cost-of-carry&lt;/b&gt;: the physically payable cost for holding a trade for a defined period of time. A bond purchased on repo would incur the cost of financing the purchase, for example. Regulatory capital charges would be another example for a bank.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;b&gt;Roll-down&lt;/b&gt;: the mark-to-market (MTM) gain or loss on a position if the yield curve remains static over a period of time. For example; today 9Y and 10Y yields might be, say, 1.870% and 1.917% and in 1Y time assume they will still be 1.870% and 1.917% (even though today's fwd curve does not price that outcome - it actually prices 1Y9Y at, say, 1.943%)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if you buy a 10Y bond with an annual 3% coupon at a yield of 1.917% for a dirty price of 109.81, financed by a repo rate of say 1.70% what will happen?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your &lt;b&gt;cost-of-carry&lt;/b&gt; is the repo cost minus the coupon = (109.81*1.7%=1.87) - 3 = 1.13 gain.&#xA;Your &lt;b&gt;mark-to-market&lt;/b&gt; is affected by the new yield of 1.943% and price of 108.68, meaning a loss of 1.13.&#xA;So if the yield curve evolves as expected you gain cash and lose on MTM in the same amounts. This is arbitrage free pricing in action. If this didn't happen everyone would purchase bonds financed on repo and hope to accrue gains.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But now lets assume &lt;b&gt;roll-down&lt;/b&gt;: if the yield curve remains the same then the price of the bond is instead 109.10 so you only lose 0.71 on MTM and hence your net gain is 0.42.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These example numbers are all consistent within the context I created in a spreadsheet for a specific term structure, but in the real world different bonds can have different repos, the term structure of the curve will be different, but the principle are the same.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For your two specific bonds at 5% (long) and 2% (short), if they both have the same repo then after a year your cost-of-carry will be +3 whilst your MTM will be -3 under an arbitrage free pricing model. If you assume roll down then this will depend upon the shape of the curve it is entirely possible that depending on which curves you have purchased you will see a negative roll-down.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/25329/question-regarding-carry-roll-of-a-bond&quot;&gt;This other answer&lt;/a&gt; shares the same opinion.&#xA;&lt;a href=&quot;https://quant.stackexchange.com/questions/35795/carry-calculation-on-an-interest-rate-swap/35897#35897&quot;&gt;Another answer&lt;/a&gt; I give to swaps shares the same concept.&lt;/p&gt;&#xA;" OwnerUserId="29443" LastActivityDate="2017-10-01T20:40:19.617" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36264" PostTypeId="1" CreationDate="2017-10-02T03:28:21.910" Score="1" ViewCount="151" Body="&lt;p&gt;I am interested in comparing the value of bank Certificates of Deposit (CDs) with brokered CDs, to determine whether one is undervalued relative to the other. A brokered CD is basically a vanilla bond which can be bought at new issue and traded thereafter on an (albeit illiquid ) secondary market. A bank CD is a term deposit with no secondary market (you are not allowed to sell them to another investor), but the owner has the option to put it back to the issuer at par any time before maturity subject to an Early Withdrawal Penalty (EWP). The EWP is typically some prespecified fraction of the total interest which would have been earned had the CD been held to maturity. So a bank CD is basically a non-tradeable putable bond (American option) where the option premium is paid only if exercised (rather than included in the new issuance price like a conventional putable bond). Since both bank CDs and brokered CDs are FDIC insured, there is no credit risk differentiation between them, regardless of the issuer. I am considering only non-callable CDs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's look at current 2y CDs as an example. The current cheapest 2y new issue brokered CD off &lt;a href=&quot;https://personal.vanguard.com/us/FixedIncomeHome&quot; rel=&quot;nofollow noreferrer&quot;&gt;Vanguard&lt;/a&gt; yields 1.70%. It's a bit harder to compare bank CDs because the EWPs vary, but the current cheapest 2y bank CD off &lt;a href=&quot;https://ratebrain.com/cd-rates&quot; rel=&quot;nofollow noreferrer&quot;&gt;RateBrain&lt;/a&gt; is 1.85% from Popular Direct with a 270 day EWP, which seems about average. So the put option premium is 1.39%, paid only if exercised. I’m not much up on options, but my first thought was that since the put option is initially sold at-the-money, the delta is 50% and if we equate that with the probability of expiring in-the-money then we could say that the present value of the premium payment is 50% * 1.39% = 0.69%. Now the bank CD yields 15bp more than the brokered CD and the duration is 1.95, so the present value of the extra yield is 0.29% which reduces the effective price of the option to 0.40% up-front. I priced on Bloomberg a 2y expiry ATM American put option on the on-the-run 2y maturity treasury bond (yielding 1.50%) and came up with a premium of 0.59%, so on that basis it looks like the bank CD underprices the put option by 0.19% and is the more valuable investment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This surprises me because I assumed that the bank CD would overprice the put option, given that it is sold to investors who mostly have no ability value the option. However I do see three problems with the preceding approach:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) Since the expiry of the put option equals the maturity of the bond, it will always expire at-the-money (ignoring the possibility of default and early redemption at par with FDIC insurance payout). Therefore unlike standard American equity options which I believe are never (except for special circumstances) optimal to exercise before maturity, it seems that this &quot;expiry=maturity&quot; bond put option should always be exercised before maturity because it will always expire worthless, but I have no idea when is the optimal time to exercise. Even so, since rates could go either way is the probability of exercise still 50%?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) The CD put option can’t be sold so it should be worth less than the standard treasury bond put option. Even although the standard treasury bond put should be exercised some time prior to maturity, presumably before that time it is better to sell it rather than exercise it otherwise you lose the remaining time value. The CD put being non-tradeable forces you to sacrifice the time value, although the expected value lost seems to depend on the expected time of exercise which is investor-specific.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Suppose you can correctly value the CD put option and remove it from the equation, you are still left with having to value the non-tradeable vanilla bond component. Theoretically it seems you could “synthetically sell” a non-tradeable treasury-esque bond by selling treasury futures against it, which would lock in the mark-to-market value and ensure that you receive at maturity the price you would have received had you been able to sell it when you wanted. So a non-tradeable bond is like a tradeable bond with the obligation when you sell it to finance the purchaser until maturity at the implied treasury futures funding rate (approximately Libor?). But the price of this obligation seems to depend on a) the investor’s own funding rate; and b) the likelihood of the investor actually incurring the obligation by selling the bond. As to a), I'm not sure how one would go about estimating the funding rate of the average CD investor, or even whether there is such a thing. And b) is again investor-specific.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, can anyone think of an objective way to value a bank CD relative to a brokered CD? Or is the best we can do to turn the problem on its head and assume that they are fairly valued and impute the observed price differential to be the cost of the tradeability option embedded in standard tradeable putable bonds?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only remotely related thing I could find on the internet was &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2420077&quot; rel=&quot;nofollow noreferrer&quot;&gt;this&lt;/a&gt; paper, but I couldn’t easily understand it and see how much bearing it had on the problem in hand.&lt;/p&gt;&#xA;" OwnerUserId="29808" LastActivityDate="2017-10-10T02:26:56.130" Title="How to compare the value of bank Certificates of Deposit (CDs) with brokered CDs?" Tags="&lt;option-pricing&gt;&lt;fixed-income&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36265" PostTypeId="1" AcceptedAnswerId="36269" CreationDate="2017-10-02T04:13:48.137" Score="0" ViewCount="564" Body="&lt;p&gt;You invest $1, 000$ dollars  for $10$ years at a $5$% yearly interest rate. After each year the interest paid is reinvested at the same rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(a) Represent the total amount A after ten years in the form $A = S(1 + x)^n$. What are $S$, $x$, and $n$ here?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ S = 1000, x = .05,  n =10$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(b) Compute A (up to cents) using a calculator.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Plugging in the corresponding numbers &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$A=1628.89$ dollars&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;This is where I begin to struggle with the problem&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(c) If one writes $A$ in the form $A = S(1+x)^n = S\exp(n\log(1+x))$ and uses the approximation $log(1 + x) ≈ x$ for small $x$, then one obtains $A ≈ Se^{nx}$. Which value for A is obtained with this approximation method?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(d) A better approximation is $log(1 + x) ≈ x − 1/2 x^2$. Explain how this is related to finding the taylor approximation for $\log(1+x)$ which is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$log(1+x)=x-x^2/2+x^3/3-x^4/4+x^5/5+...=\sum_{n=1}^\infty (-1)^{n+1}\frac{x^n}{n}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(e) Based on the approximation in (d) develop an approximation formula for A in terms of S, x, and n. Use it to compute A in our specific example.&lt;/p&gt;&#xA;" OwnerUserId="29823" LastEditorUserId="16148" LastEditDate="2017-10-02T18:19:44.253" LastActivityDate="2017-10-02T18:19:44.253" Title="taylor expansion in compounded interest" Tags="&lt;interest&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2017-10-04T16:55:53.433" ContentLicense="CC BY-SA 3.0" />
  <row Id="36269" PostTypeId="2" ParentId="36265" CreationDate="2017-10-02T11:16:14.627" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;(c) If one writes $A$ in the form $A=S(1+x)^n=S e^{n\ln(1+x)}$ and uses the approximation $\ln(1+x)\approx x$ for small $x$, then one obtains $A\approx S e^{nx}$. Which value for $A$ is obtained with this approximation method?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This is is based on the properties&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\ln (a^b) &amp;amp;=&amp;amp; b\ln a \tag{1a}\\&#xA;e^{\ln a} &amp;amp;=&amp;amp;a \tag{1b}&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;A = S(1+x)^n \stackrel{(1b)}{=} Se^{\ln(1 + x)^n} \stackrel{(1a)}{=}  Se^{n\ln(1 + x)} \tag{2}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, you can use the fact &lt;a href=&quot;https://en.wikipedia.org/wiki/Geometric_series#Geometric_power_series&quot; rel=&quot;nofollow noreferrer&quot;&gt;that&lt;/a&gt; when $|x|&amp;lt; 1$ then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{1}{1+x} = 1 - x + x^2 - \cdots = \sum_{k=0}^{+\infty}(-1)^k x^k&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;if you integrate both sides, you get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\ln(1 + x) = x -\frac{x^2}{2} + \frac{x^3}{3}- \cdots = \sum_{k=0}^{\infty}(-1)^k \frac{x^{k+1}}{k+1} \tag{3}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;such that for small $x$ it is enough to take just the first term in this sum &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\ln(1 + x)\approx x \tag{4}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Eqn (2) then becomes&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;A_1\approx Se^{nx} = 1648.72&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will use the subscript $1$ to emphasize we are taking just the first term in the series&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;(d) A better approximation is $\ln(1 + x) \approx x - x^2/2$. Explain how this is related to finding the Taylor approximation of $\ln(1 + x)$ which is&#xA;  $$&#xA;\ln(1 + x) = x -\frac{x^2}{2} + \frac{x^3}{3}- \cdots = \sum_{k=0}^{\infty}(-1)^k \frac{x^{k+1}}{k+1} &#xA;$$&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;You just need to take the first two terms in Eq. (3). Here is the thing, if $x$ is small $x^2/2$ is smaller, and $x^3/3$ is even smaller, and $\dots$ So the more terms you include the better, but the smaller the correction in the overall result. Up to second order&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;A_2\approx Se^{n(x - x^2/2)} = 1628.24&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which looks almost like the exact result you found before. If you're to include up to third order you'd see how it approaches even better the exact solution.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;e) Based on the approximation in (d) develop an approximation formula for $A$ in terms of $S$, $x$, and $n$. Use it to compute $A$ in our specific example.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;In general if you take up to $N$ terms in the sum this is what you get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;A_N \approx Se^{n(x - x^2 - \cdots + (-1)^{N+1}x^{N}/N)}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Below there's some results&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;A_{\rm exact} &amp;amp;=&amp;amp; 1628.89 \\&#xA;A_1 &amp;amp;=&amp;amp; 1648.72 \\&#xA;A_2 &amp;amp;=&amp;amp; 1628.24 \\&#xA;A_3 &amp;amp;=&amp;amp; 1628.92 \\&#xA;A_4 &amp;amp;=&amp;amp; 1628.89&#xA;\end{eqnarray}&lt;/p&gt;&#xA;" OwnerUserId="29731" LastEditorUserId="29731" LastEditDate="2017-10-02T15:17:10.293" LastActivityDate="2017-10-02T15:17:10.293" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36270" PostTypeId="2" ParentId="17441" CreationDate="2017-10-02T17:02:11.833" Score="1" Body="&lt;p&gt;The quantile and variance relationship depends on the data you are analyzing.  Consider first the case where your data is (statistically) nice.  That is, your one-period returns $r_i$ are all Gaussian and i.i.d.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We form sums &#xA;$$&#xA;y_i = \sum_{j=t-(k+1)}^t r_j&#xA;$$&#xA;which are of course themselves gaussian, but as you note are now highly autocorrelated for $k&amp;gt;0$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Following &lt;a href=&quot;http://agecon.okstate.edu/faculty/publications/165.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Harri and Brosen&lt;/a&gt; we see that any OLS fit of $y_i$ will have variance of error terms of $k$ times the variance of an OLS fit to one-period returns.  Since the mean estimator can be viewed as a trivial OLS regression, we have that the mean $\bar{y} = k\bar{r}$ and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\mathrm{Var}\left[y_i-\bar{y}\right] = k \, \mathrm{Var}\left[r_i-\bar{r}\right]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because everything is gaussian, the distribution functions follow entirely.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this were the whole story, we would conclude that there's never any real reason to oversample like this, and leave it at that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Things get more interesting when we assume there is some underlying trend to the $r_i$ or a pattern to measurement errors in $r_j$.  For example, if some flaws in accounting result in quarterly sales to inventory ratios exhibiting seasonal patterns, then those patterns will be &quot;washed out&quot; in the annual sum.  Essentially we will have exploited the error structure to obtain&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\mathrm{Var}\left[y_i-\bar{y}\right] &amp;lt; k \,\mathrm{Var}\left[r_i-\bar{r}\right].&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; You asked about covariance structure of $y$.  For any two observations of $y$ we have (extending Harri and Brorsen)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\mathrm{Cov}(y_\ell, y_j) = \mathrm{Var}(\{r_i\}) \,(\ell-|\ell - j|)^+ &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $(\cdot)^+$ indicates the function that returns $\max(\cdot, 0)$.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="254" LastEditDate="2017-10-06T13:56:06.523" LastActivityDate="2017-10-06T13:56:06.523" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="36271" PostTypeId="1" CreationDate="2017-10-02T22:47:32.357" Score="6" ViewCount="475" Body="&lt;p&gt;I was asked this question in an interview.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;There is an option as follows. It monitors the prices of two stocks A and B, and pays the difference in their prices at time &lt;span class=&quot;math-container&quot;&gt;$T$&lt;/span&gt;, if stock A has been higher than stock B all through till &lt;span class=&quot;math-container&quot;&gt;$T$&lt;/span&gt;. There is nothing paid if stock A has fallen lesser than stock B at any time before &lt;span class=&quot;math-container&quot;&gt;$T$&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;How do we price this option?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;I gave an answer by modeling the difference as a Brownian motion, and computing the probability that the zero-hitting time for the BM to be greater than &lt;span class=&quot;math-container&quot;&gt;$T$&lt;/span&gt;. However the interviewer said there was a simpler method based on option pricing.&lt;/p&gt;&#xA;&lt;p&gt;Can anyone help me?&lt;/p&gt;&#xA;" OwnerUserId="29827" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2017-10-04T00:13:34.037" Title="How to price this option?" Tags="&lt;options&gt;&lt;option-pricing&gt;" AnswerCount="2" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36272" PostTypeId="2" ParentId="36271" CreationDate="2017-10-03T00:08:34.013" Score="7" Body="&lt;p&gt;Well &quot;based on option pricing&quot; is a little vague, but the desired solution is probably to use one of the stocks (say stock $B$) as your numeraire. If you're unfamiliar the intuitive idea is that imagine instead of money, people used stock $B$ as currency / measure of wealth, etc. Then the &quot;value&quot; of stock $A$ (i.e. the number of shares of stock $B$ it is worth) is $S_A/S_B$ and you have a fixed strike / Barrier of $1.$ So you price a barrier option with initial price $S_{A,0}/S_{B,0}$, barrier / strike $1$ and volatility $$ \sqrt{\sigma_A^2 + \sigma_B^2-2\rho\sigma_A\sigma_B}$$ (i.e. the volatility of $S_A/S_B$) and that gives the price of the option in units of $S_B,$ so just multiply by $S_B$ to get the price in dollars.&lt;/p&gt;&#xA;" OwnerUserId="29286" LastActivityDate="2017-10-03T00:08:34.013" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36275" PostTypeId="2" ParentId="36226" CreationDate="2017-10-03T09:52:36.307" Score="2" Body="&lt;p&gt;Consider the possible forward rates in each of the three years.   I.e. In X for 1 year forward rates, where X is 0,1 or 2.    Possible solutions (ignoring compounding for simplicity) include the following :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1,3,5):   Forward rates are a linear function of time.  And &#xA;(1,4,4):   Forward rates shoot up towards 4 and then stay constant. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;These are very different solutions but both are possible.  Each solution can be used to produce overnight rates- for example the overnight forward rate for the first solution is 2x, where X is the forward time.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, an intermediate solution seems more likely.  Forward rates are not usually linear, nor do they reach some asymptote within a year.  You don't have enough information to determine this more accurately.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-10-03T09:52:36.307" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36277" PostTypeId="1" CreationDate="2017-10-03T13:16:59.123" Score="1" ViewCount="151" Body="&lt;p&gt;I have little to no programming background so please bear with me. I work for a firm that executes our FX trades via FX Connect. I would like to program some logic into FX Connect so that trades that meet a certain criteria will  automatically send trades.&lt;/p&gt;&#xA;" OwnerUserId="29836" LastEditorUserId="29839" LastEditDate="2017-11-24T20:07:19.097" LastActivityDate="2017-11-24T20:07:19.097" Title="Interact with FX Connect" Tags="&lt;programming&gt;&lt;fx&gt;&lt;automated-trading&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36278" PostTypeId="2" ParentId="36147" CreationDate="2017-10-03T13:17:53.007" Score="4" Body="&lt;p&gt;Since your standard for meaningful risk measurement is pretty low (&quot;Meaningful in this context simply means that we really capturing a sort of risk of the overall portfolio.&quot;) There are limited cases where such an approach might make sense. From a broader perspective I think it makes very little sense. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If your matrix of pairwise risk numbers is symmetric and positive definite, it defines a metric (actually an inner product) in the vector space of all possible portfolios. With this metric you can do all those things you can do with any metric: Distinguish between large (&quot;risky&quot;) and small (&quot;safe&quot;) portfolios, optimise easily (due to convexity of the distance funtion), perform risk/return optimisation and so on. I think this is exactly the point quintuple has made.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Will this give you the full picture? Without strong additional assumptions on the underlying multivariate distribution of asset returns definitely not. The best example for such an assumption is of course being multivariate normal. Actually the reason why the covariance matrix is so important in this case is &lt;em&gt;not&lt;/em&gt; that it provides a simple way to calculate the variance. It is important since covariance (together with the means) determines the distribution! This means if you know the covariance (and the means) you know everything about the distribution there is to know, including the risk of total portfolio return, for whichever way you may define your risk. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;To drive this point of adequate assumptions down further: Even linear correlations may no longer be &quot;meaningful&quot; if you leave multivariate normality. See this  &lt;a href=&quot;https://people.math.ethz.ch/~embrecht/ftp/copchapter.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;paper on pitfalls of correlation&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore the whole idea of measuring only &lt;em&gt;pairwise&lt;/em&gt; dependence is highly problematic. Pairwise dependence is just one aspect of total dependence (hence of total risk). To see a true shocker have a look at &lt;a href=&quot;http://www.actuaries.ch/de/downloads/aid!b9f3124e-8a75-4721-b157-1fc861a86858/id!37/hummelAFIR_SAV2013_handouts.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;this presentation&lt;/a&gt;. It is in German sadly but on page 9 you find a nice graphic. It is an example of three uniform(0,1) random variables. The left hand scatters show that they are pairwise independent (not just uncorrelated, really independent!) while the righthand side gives you the full picture. In this example the third variable $U_3$ is actually a deterministic function of the two other variables $(U_1,U_2)$, i.e. it has arguably the strongest possible dependence on the other two.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you would like to understand how this guy has constructed the example have a look at his &lt;a href=&quot;https://arxiv.org/abs/0906.4853&quot; rel=&quot;nofollow noreferrer&quot;&gt;paper on shaping tail dependencies&lt;/a&gt;.     &lt;/p&gt;&#xA;" OwnerUserId="482" LastActivityDate="2017-10-03T13:17:53.007" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36280" PostTypeId="1" CreationDate="2017-10-03T14:44:26.867" Score="4" ViewCount="1508" Body="&lt;p&gt;On the &lt;a href=&quot;https://www.investopedia.com/articles/investing/032615/how-etf-arbitrage-works.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;&amp;quot;how ETF arbitrage works&amp;quot; page&lt;/a&gt;, investopedia says&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;The arbitrage opportunity happens when demand for the ETF increases or decreases the market price, or when liquidity concerns cause investors to redeem or demand the creation of additional ETF shares. At these times, price fluctuations between the ETF and its underlying assets cause mispricings. The NAV of the underlying portfolio is updated every 15 seconds during the trading day, so if an ETF is trading at a discount to NAV, a company can purchase shares of the ETF then turn around and sell it at NAV and vice versa if it is trading at a premium.&lt;/p&gt;&#xA;&lt;p&gt;For example, when ETF A is in high demand, its price rises above its NAV. At this point the AP will notice the ETF is overpriced or trading at a premium. It will then sell the ETF shares it received during creation and make a spread between the cost of the assets it bought for the ETF issuer and the selling price from the ETF shares. It may also go into the market and buy the underlying shares that compose the ETF directly at lower prices, sell ETF shares on the open market at the higher price, and capture the spread.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;From what I understood, for the above explanation to be correct, the ETF's (NAV per share) and the price of the ETF share that's traded, are two completely separate entities. The former is determined by the price of the ETF's underlying assets and the latter is defined by the supply and demand of the traded ETF share itself.&lt;/p&gt;&#xA;&lt;p&gt;If I'm correct, then this implies that the ETF share price and the NAV per share are forced to be equal due to arbitrage traders only? I mean, if for example I was an insane/idiot trader, willing to quote a bid price higher than the current ask price and I complete that trade, this would mean that the ETF share price definitely goes higher than the NAV per share value. Now, how does the ETF share price again go back to matching the (NAV per share) value? Is it just that the market 'believes' that the ETF share price is supposed to be equal to its NAV per share, and hence no one would bid for the ETF share at a price higher than (NAV per share)?&lt;/p&gt;&#xA;&lt;p&gt;Also, in this case, how would someone, who doesn't own any of the ETF shares, be able to capitalize on this mispricing? First of all, am I even correct about how the mispricing occurs?&lt;/p&gt;&#xA;" OwnerUserId="29838" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2018-03-08T04:08:02.973" Title="Slight confusion regarding arbitrage opportunities in ETFs as mentioned by investopedia" Tags="&lt;arbitrage&gt;&lt;etf&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36282" PostTypeId="2" ParentId="36271" CreationDate="2017-10-03T16:52:45.870" Score="4" Body="&lt;p&gt;I suspect you could replicate this trade by buying $A$ and selling short $B$ (additionally, when the price of $A$ touches $B$ at any time before $T$, you liquidate the position for $0$ payoff). If so, today's price of this option is just $S_A-S_B$.&lt;/p&gt;&#xA;" OwnerUserId="29842" LastEditorUserId="20454" LastEditDate="2017-10-04T00:13:34.037" LastActivityDate="2017-10-04T00:13:34.037" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="36283" PostTypeId="2" ParentId="36252" CreationDate="2017-10-03T17:51:30.837" Score="0" Body="&lt;p&gt;Note that, by Ito's isometry,&#xA;\begin{align*}&#xA;E\left(\int_{0}^{t} F(s)\,dW_{1}(s)\int_{0}^{t} G(s)\, dW_{2}(s)\right) &amp;amp;= \int_0^t E\big(F(s) G(s) \big) d\langle W_1, W_2\rangle_t =0.&#xA;\end{align*}&#xA;That is, $\int_{0}^{t} F(s)\,dW_{1}(s)$  and $\int_{0}^{t} G(s)\,dW_2(s)$ are uncorrelated. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $F(s)$ and $G(s)$ are deterministic, then, for any constants $a$ and $b$&#xA;\begin{align*}&#xA;a\int_{0}^{t} F(s)\,dW_{1}(s) + b\int_{0}^{t} G(s)\,dW_2(s)&#xA;\end{align*}&#xA;is the limit, in probability, of the sum&#xA;\begin{align*}&#xA;\sum_{i=1}^n \Big(aF(t_{i-1}) \big(W_1(t_i)-W_1(t_{i-1})\big) +bG(t_{i-1}) \big(W_2(t_i)-W_2(t_{i-1})\big)\Big),\tag{1}&#xA;\end{align*}&#xA;where $0=t_0 &amp;lt; t_1 &amp;lt; \cdots &amp;lt; t_n = t$ is a partition of $[0, t]$. Note that all terms in $(1)$ are normal and independent, and then their sum is also normal. Since the limit, in probability, of normal random variables is also normal, \begin{align*}&#xA;a\int_{0}^{t} F(s)\,dW_{1}(s) + b\int_{0}^{t} G(s)\,dW_2(s)&#xA;\end{align*}&#xA;is normal. That is, &#xA;$\int_{0}^{t} F(s)\,dW_{1}(s)$  and $\int_{0}^{t} G(s)\,dW_2(s)$ are jointly normal, and are therefore independent (note that the joint characteristic function is the product of the individual characteristic functions).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if $F(s)$ and $G(s)$ are not deterministic, then $\int_{0}^{t} F(s)\,dW_{1}(s)$  and $\int_{0}^{t} G(s)\,dW_2(s)$ are not necessarily independent. For example, consider $X_t=\int_{0}^{t} W_2(s)\,dW_{1}(s)$  and $Y_t=\int_{0}^{t} W_1(s)\,dW_2(s)$. Then $X_t$ and $Y_t$ is uncorrelated, but are not independent.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;$X_t$ and $Y_t$ are uncorrelated but are not independent.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Note that&#xA;\begin{align*}&#xA;dX_t^2 = 2X_tdX_t + W_2^2(t) dt,&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;dY_t^2 = 2Y_t dY_t + W_1^2(t) dt.&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;X_t^2 Y_t^2 = 2\int_0^t Y_s^2 X_s dX_s+2\int_0^t X_s^2 Y_s dY_s + \int_0^t \left(W_1^2(s)X_s^2 + W_2^2(s) Y_s^2 \right) ds.&#xA;\end{align*}&#xA;By symmetry,&#xA;\begin{align*}&#xA;E\left( X_t^2 Y_t^2\right) = 2\int_0^t E\left(W_1^2(s)X_s^2\right) ds.\tag{2}&#xA;\end{align*}&#xA;Note that &#xA;\begin{align*}&#xA;dW_1^2(t) = 2W_1(t) dW_1(t) + dt.&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;W_1^2(t)X_t^2 &amp;amp;= 2\int_0^t X_s W_1(s)^2 dX_s + 2\int_0^t W_1(s) X_s^2 dW_1(s)\\&#xA;&amp;amp;\qquad +\int_0^t \left(W_1(s)^2 W_2(s)^2 + X_s^2 + 4X_sW_1(s)W_2(s)\right)ds.\tag{3}&#xA;\end{align*}&#xA;Furthermore, note that&#xA;\begin{align*}&#xA;W_1(t)W_2(t) = X_t + Y_t.&#xA;\end{align*}&#xA;Then,&#xA;\begin{align*}&#xA;E\left( X_tW_1(t)W_2(t)\right) &amp;amp;= E\left(X_t^2 + X_t Y_t\right)\\&#xA;&amp;amp;=\int_0^t s ds=\frac{1}{2}t^2.&#xA;\end{align*}&#xA;Therefore, from $(3)$,&#xA;\begin{align*}&#xA;E\left(W_1^2(t)X_t^2\right)  &amp;amp;=\int_0^t \left(s^2 + \frac{1}{2}s^2 + 2s^2 \right)ds = \frac{7}{6}t^3,&#xA;\end{align*}&#xA;and, from $(2)$,&#xA;\begin{align*}&#xA;E\left( X_t^2 Y_t^2\right) &amp;amp;= 2\int_0^t E\left(W_1^2(s)X_s^2\right) ds\\&#xA;&amp;amp;=\frac{7}{3} \int_0^t s^3ds = \frac{7}{12} t^4.&#xA;\end{align*}&#xA;However,&#xA;\begin{align*}&#xA;E\left( X_t^2 \right)E\left(Y_t^2\right) = \frac{1}{4}t^4.&#xA;\end{align*}&#xA;That is, $X_t$ and $Y_t$ are not independent.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-10-03T19:53:23.530" LastActivityDate="2017-10-03T19:53:23.530" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36284" PostTypeId="1" CreationDate="2017-10-03T19:47:00.437" Score="-2" ViewCount="141" Body="&lt;p&gt;i am reading an article regarding convertible bonds and it keeps saying:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;......firms facing investment options that are expected to mature&#xA;shortly after issuance.......&lt;/p&gt;&#xA;&#xA;&lt;p&gt;OR&#xA;.......firms with investment options expected to expire sooner.....&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I just don't get what does it mean that the option will mature or expire soonerIs it like that the investment opportunity wont hold long ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ps The article is :Convertible Bond Design and Capital&#xA;Investment: The Role of Call Provisions&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS2 I know what the &quot;maturity of a bond&quot; is. I am asking about &quot;maturity&quot; as used in the quotation above.&lt;/p&gt;&#xA;" OwnerUserId="29843" LastEditorUserId="16148" LastEditDate="2017-10-05T15:13:54.813" LastActivityDate="2017-10-05T15:13:54.813" Title="What is the &quot;maturity&quot; of an &quot;investment option&quot;?" Tags="&lt;fixed-income&gt;&lt;convertible-bond&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36286" PostTypeId="1" CreationDate="2017-10-03T20:45:44.790" Score="1" ViewCount="211" Body="&lt;p&gt;In the paper &quot;Momentum has its moments&quot; (Pedro Barroso and Pedro Santa-Clara, 2012 - available free from Nova Business School), the authors claim that there is a way to avoid momentum crash (caused by the short leg as the market rebounded&#xA;following large previous declines, in other words the short leg rise with the market and cause great loses). They using the realized variance computed as the sum of the squared returns of the momentum strategy as a predictor. The question is how and why the realized variance can predict the point where the market start to rebound after large declines?&lt;/p&gt;&#xA;" OwnerUserId="29771" LastEditorUserId="16160" LastEditDate="2017-12-03T00:54:20.830" LastActivityDate="2018-02-01T02:35:14.320" Title="Realized variance as predictor that improves momentum strategy" Tags="&lt;momentum&gt;&lt;factor-investing&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36287" PostTypeId="2" ParentId="36286" CreationDate="2017-10-03T21:40:50.227" Score="3" Body="&lt;p&gt;You are right, the authors provide no strong justification for why their method works. They just show that &quot;it would have worked well in the past&quot;. But we should be skeptical how well it will work in the future, especially when you consider what a big improvement this simple change makes in the strategy; it seems a little too good to be true. This is a reasonable criticism of the paper. I suppose we will have to wait until the next big &quot;momentum crash&quot; and see what happens...&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2017-10-03T21:40:50.227" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36288" PostTypeId="2" ParentId="30834" CreationDate="2017-10-03T22:17:51.127" Score="2" Body="&lt;p&gt;I recommend taking a look at cufflinks and py-quantmod:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/santosjorge/cufflinks&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/santosjorge/cufflinks&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://github.com/jackwluo/py-quantmod&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/jackwluo/py-quantmod&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="29846" LastActivityDate="2017-10-03T22:17:51.127" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36289" PostTypeId="2" ParentId="36284" CreationDate="2017-10-04T01:10:04.590" Score="3" Body="&lt;p&gt;The maturity of an investment is the end date of the contract. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, you can buy a bond that pays P*(1+r) one year from now, where P is the price you pay, r is the interest rate, and the day on which it expires (one year from today) is the expiration date. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another example, in the case of options contracts, you buy a contract that gives you the option to buy/sell a security on a given day (let's say a month from now). This day a month from now on which the option expires (and you have to decide whether to buy/sell or not) is called expiration date. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In summary, expiration date or maturity date is the end day of the contract. &#xA;You could think of the concept of &quot;time to maturity&quot; too, which consists on how many days are left until the last day of the contract.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of your paper, it is considering investments whose end dates (expiration dates) are closer to today's date, i.e, their time to maturity is short.&lt;/p&gt;&#xA;" OwnerUserId="29189" LastActivityDate="2017-10-04T01:10:04.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36290" PostTypeId="2" ParentId="30398" CreationDate="2017-10-04T04:26:58.417" Score="2" Body="&lt;p&gt;This is my take on the matter: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;**&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Credit risk&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;** - this can be defined as the risks of default on financial obligations from the extension of credit directly to a counterparty or indirectly through an instrument.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;**&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Counterparty risk&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;** - this can be defined as the risk of default from (i) the extension of credit or (ii) agreed contractual performance, which in most cases will carry financial obligations to the affected party/ies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On this basis, it can be surmised that counterparty risk is a subset of credit risk.&lt;/p&gt;&#xA;" OwnerUserId="29847" LastActivityDate="2017-10-04T04:26:58.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36294" PostTypeId="2" ParentId="36259" CreationDate="2017-10-04T10:24:32.470" Score="0" Body="&lt;p&gt;Hint: Put call parity. We are supposed to have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$C = P+S-D \cdot K$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if instead $C &amp;gt; P+S-D \cdot K$, then the arbitrage profit should be $C - (P+S-D \cdot K)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what do you do with the call option? Long? Short? I guess it's the opposite position of what you used when $C &amp;lt; P+S-D \cdot K$&lt;/p&gt;&#xA;" OwnerUserId="7788" LastActivityDate="2017-10-04T10:24:32.470" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36295" PostTypeId="1" CreationDate="2017-10-04T10:35:27.920" Score="-2" ViewCount="261" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;“A stock is like a living organism. A sparrow, say. And we are able to create an emergent-based abstraction of that sparrow, which closely approximates the sparrow itself, accounting for migration patterns, wind, weather, and other variables. We can create a similar abstraction of a stock combining the information from the specific ETFs, which represent its underlying dependencies. And if we apply this to the stock we can predict its delta, following the path of its extracted self, because nature follows abstraction.”&#xA;        - Taylor, Billions S02E10&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Delta of V is $$\frac{\partial V}{\partial S}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So delta of S (long) or -S (short) is $$\frac{\partial (\pm S)}{\partial S} = \pm 1 \ ?$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If so, does this mean the &lt;a href=&quot;http://abstrusegoose.com/353&quot; rel=&quot;nofollow noreferrer&quot;&gt;hypothesis is unnecessary&lt;/a&gt;?&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;if we apply this to the stock&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;because anyone, for any stock,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;can predict its delta&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;?&lt;/p&gt;&#xA;" OwnerUserId="7788" LastEditorUserId="7788" LastEditDate="2018-03-27T07:14:13.213" LastActivityDate="2018-03-27T07:14:13.213" Title="Can we 'predict' the delta of a stock? The delta of a stock is $\pm 1$ right?" Tags="&lt;equities&gt;&lt;greeks&gt;&lt;delta-hedging&gt;&lt;delta&gt;" AnswerCount="1" CommentCount="3" ClosedDate="2017-10-04T16:54:47.567" ContentLicense="CC BY-SA 3.0" />
  <row Id="36296" PostTypeId="2" ParentId="36295" CreationDate="2017-10-04T10:40:27.763" Score="2" Body="&lt;p&gt;By definition of delta, yes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ f(S)=\pm 1 \times S \quad \Rightarrow \quad \frac{\partial f}{\partial S}(S) = \pm 1$$&lt;/p&gt;&#xA;" OwnerUserId="20454" LastActivityDate="2017-10-04T10:40:27.763" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36299" PostTypeId="1" AcceptedAnswerId="36314" CreationDate="2017-10-04T15:51:18.340" Score="2" ViewCount="230" Body="&lt;p&gt;I am trying to solve the equation &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\frac{d}{dt}V(t)=r(t)V(t)+\pi-\mu(x+t)(b_d-V(t))$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;numerically using the R function 'ode'. This is a Thiele differential equation for a life insurance reserve with premium rate $\pi$, mortality intensity $\mu$ (for an $x+t$ year old), death benefit $b_d$ and interest rate process $r$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to do this in a so called unit-linked setting, where the returns on the policy are generated by investments in stocks, hence I have assumed a Black Scholes model for simplicity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I generate a Geometric Brownian Motion. As seen the time interval is 40 years and the step size of the simulation is $40/100000$. For each simulated point I calculate the returns as&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r[i]=\frac{S[i+1]-S[i]}{S[i]}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Such that I have $100000$ return values. Plotting these two for two very different scenarios yields&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/FdqAO.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/FdqAO.jpg&quot; alt=&quot;Scenario 1&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/HLkNg.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/HLkNg.jpg&quot; alt=&quot;Scenario 2&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My problem is, at I would expect the reserve process to vary a lot more, much like the simulated Geometric Brownian Motion. In essence, it is too smooth, i think. Also if I generate GBM trajectories which end in, say, the value 500 and 10 respectively, the difference in the final value of the reserve varies very little.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does anyone know why this is, am I doing something wrong? The R-code is attached.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;maturity &amp;lt;- 40&#xA;simulation.length &amp;lt;- 100001&#xA;dt &amp;lt;-  maturity/(simulation.length-1)&#xA;&#xA;timeline &amp;lt;- seq(0,maturity, dt)&#xA;&#xA;BM &amp;lt;- GBM &amp;lt;- EV &amp;lt;- rep(0, times=simulation.length)&#xA;EV[1] &amp;lt;- GBM[1] &amp;lt;- S0&#xA;&#xA;for(i in 2:simulation.length){&#xA;  BM[i] &amp;lt;- BM[i-1]+sqrt(dt)*rnorm(1)&#xA;  GBM[i] &amp;lt;- GBM[1]*exp((mu-(sigma^2)/2)*(i-1)*dt+sigma*BM[i])&#xA;  EV[i] &amp;lt;- EV[1]*exp(mu*(i-1)*dt)&#xA;}&#xA;&#xA;return &amp;lt;- rep(0,length(GBM))&#xA;returns[1] &amp;lt;- 0&#xA;for (i in 2:length(GBM)-1)&#xA;{&#xA;  returns[i] &amp;lt;- (GBM[i+1] - GBM[i]) / GBM[i]&#xA;}&#xA;&#xA;dV &amp;lt;- function(t,V, parms)&#xA;{&#xA;  list(returns[t/0.0004+1] * V + premiumRate - mortalityIntensity(t+25) * &#xA;(deathBenefit - V))&#xA;}&#xA;&#xA;out &amp;lt;- ode(y = 0, times = timeline, func = dV, parms = NULL)&#xA;&#xA;interpolatedReserve &amp;lt;- approxfun(times,out[,2], method=&quot;linear&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem is not that the &lt;code&gt;approxfun&lt;/code&gt; function is not good enough, because I used it on the GBM to plot the green trajectory.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I use 60000 as the premium rate (around 1000 dollars per month paid to pension) and a death benefit of 1.000.000 (realistic numbers in Danish Kroner). Is it because the returns $r\cdot V$ are too small to be noticed compared to the yearly premium rate? I would just suspect the reserve plot to follow the movements of the GBM roughly?&lt;/p&gt;&#xA;" OwnerUserId="29858" LastEditorUserId="29858" LastEditDate="2017-10-04T17:00:41.067" LastActivityDate="2017-10-06T01:10:48.273" Title="Projecting a Thiele differential equation with Black Scholes returns" Tags="&lt;black-scholes&gt;&lt;programming&gt;&lt;finance&gt;&lt;simulations&gt;&lt;actuarial-science&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36305" PostTypeId="2" ParentId="36277" CreationDate="2017-10-05T02:20:47.983" Score="1" Body="&lt;p&gt;ForEx Connect C++ API. You can find out more about it &lt;a href=&quot;http://fxcodebase.com/wiki/index.php/Start_Using_ForexConnect_API_(C%2B%2B_Win32/Win64)&quot; rel=&quot;nofollow noreferrer&quot;&gt;here.&lt;/a&gt; That said, you will definitely need some programming in your toolkit in order to achieve what you're setting out to do. Good luck.&lt;/p&gt;&#xA;" OwnerUserId="28675" LastActivityDate="2017-10-05T02:20:47.983" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36306" PostTypeId="2" ParentId="36284" CreationDate="2017-10-05T12:54:35.133" Score="2" Body="&lt;p&gt;The Theory of Corporate Finance is an academic field that tries to explain theoretically why companies issue the kinds of securities they do. The simplest company, a steady state business that earns say X a year growing at y% a year could be financed with equity and (optionally) debt alone. How then do we explain the great variety of instruments that real life companies issue, including warrants, convertible debt (of different kinds) and so on?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;TCF has been able to explain this to some extent by saying that companies are more complicated than described above, for example that they have &quot;growth options&quot; or &quot;investment options&quot; available to them for a limited period of time and that these &quot;options&quot; are not available to every company.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is important to understand that these are not &quot;financial options&quot; like puts and calls traded on the CBOE, but &quot;real options&quot;. In an abstract sense they are somewhat analogous, and will have a &quot;premium&quot; and a &quot;maturity date&quot; and so on. But they fairly abstract entities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example a mining company may have discovered gold on a property. By paying a &quot;premium&quot; of 500,000 to a geologist, they can have a 6 month study done to map the field and determine the feasibility of mining it. On or before the 6 month &quot;maturity&quot; they can decide, if everything looks good, if the price of gold is high etc. to &quot;exercise&quot; the growth option and pay 2,000,000 to build a mine on the site to produce gold.  Another example would be a company that is developing a new product, and if successful, will spend money to build a factory to produce the product. Again we have an &quot;option&quot; that will either expire (the product does not work or is not worth selling) or &quot;be exercised&quot; by spending an &quot;exercise price&quot; to purchase a shiny new factory that will produce the product. These options (or &quot;business opportunities&quot;, to use a simpler language) have a &quot;maturity date&quot; that could be years away in the case of an R&amp;amp;D program that is expected to last that long before failure or success.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What does this have to do with the existence of convertible bonds? The theory (and it is a theory, to be verified or rejected empirically) says that steady state companies do not issue convertibles, they are issued by &quot;growth companies&quot; companies with &quot;growth options&quot; or &quot;investment options&quot; available to them. These companies are not in great financial shape now, but they are able to attract money by offering the following deal: We will issue conv. bonds now, if things go well for us our equity will go up and you will able to convert to equity and make a lot of money. If things don't go well (the option is not exercised, the business opportunity does not pan out) you will still be bond holders and will have some protection in bankruptcy court if our equity is wiped out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The article you mentioned &quot;Convertible Bond Design and Capital Investment: The Role of Call Provisions&quot; is part of this &quot;real options&quot; literature. It tries to prove that kind of &quot;investment options&quot; that a company has determines the kind of cb they issue. Companies that have investment options that &quot;mature&quot; in the distant future (for example a pharma company with a long term R&amp;amp;D program) will issue callable convertible bonds, while the others (for example a mining company with a 6 month deadline for opening/closing a mine) will issue regular (non-callable) convertible bonds). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sorry for a complicated answer to a very simple question. The &quot;maturity&quot; we are concerned with here is the maturity of the &quot;real options&quot; or &quot;business opportunities&quot; available to the company. The time available until a decision is to be made whether to pursue the opportunity (by investing company money) or not.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-10-05T13:09:20.333" LastActivityDate="2017-10-05T13:09:20.333" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36307" PostTypeId="2" ParentId="32909" CreationDate="2017-10-05T15:08:04.083" Score="2" Body="&lt;p&gt;It's confusing because US Treasury securities (USTs) don't actually have to settle $T+1$. Depositories, or non-depositories with an account at a clearing bank, can settle Treasuries on a gross delivery-versus-payment basis over the Fedwire Securities Service in real-time (i.e., $T+0$), which is what is done for same-day start bilateral repos backed by USTs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The $T+1$ settlement convention for USTs comes from the widespread use of the Fixed Income Clearing Corporation Government Securities Division (FICC GSD) for settlement. FICC GSD netting members' transactions each day are netted down prior to determining their delivery obligations. This cycle of daily settlement on a net basis significantly reduces transaction costs, particularly for broker-dealers, whose securities inflows closely match their outflows. However, because it runs on a daily cycle, settlement via this facility has to happen on a T+1 basis.&lt;/p&gt;&#xA;" OwnerUserId="5192" LastActivityDate="2017-10-05T15:08:04.083" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36310" PostTypeId="2" ParentId="33530" CreationDate="2017-10-05T18:25:51.780" Score="5" Body="&lt;p&gt;Note that&#xA;\begin{align*}&#xA;d\left(e^{-ct} \lambda_t \right) &amp;amp;= -ce^{-ct} \lambda_t dt + e^{-ct}d\lambda_t\\&#xA;&amp;amp;=\xi e^{-ct}dW_2(t).&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;\lambda_t = \lambda_0 e^{ct} + \xi\int_0^t e^{-c(u-t)} dW_2(u).&#xA;\end{align*}&#xA;Moreover,&#xA;\begin{align*}&#xA;\int_0^T \lambda_s ds &amp;amp;= \frac{\lambda_0}{c}\left(e^{cT}-1 \right) + \xi\int_0^T \int_0^s e^{-c(u-s)} dW_2(u)ds\\&#xA;&amp;amp;=\frac{\lambda_0}{c}\left(e^{cT}-1 \right) + \xi\int_0^T ds \int_u^T e^{-c(u-s)} ds\, dW_2(u)\\&#xA;&amp;amp;=\frac{\lambda_0}{c}\left(e^{cT}-1 \right) +\frac{\xi}{c}\int_0^T\left(e^{-c(u-T)}-1 \right)dW_2(u)\\&#xA;&amp;amp;\equiv \frac{\lambda_0}{c}\left(e^{cT}-1 \right) + \frac{\xi}{c} X_T,&#xA;\end{align*}&#xA;where&#xA;\begin{align*}&#xA;X_T = \int_0^T\left(e^{-c(u-T)}-1 \right)dW_2(u) \sim N\left(0,\ \frac{1}{2c}e^{2cT}-\frac{2}{c}e^{cT}+T+\frac{3}{2c} \right).&#xA;\end{align*}&#xA;Furthermore, note that&#xA;\begin{align*}&#xA;E\left(W_1(T) X_T \right) &amp;amp;= E\left(\int_0^T dW_1(u) \int_0^T\left(e^{-c(u-T)}-1 \right)dW_2(u) \right)\\&#xA;&amp;amp;=\rho \left(\frac{1}{c}e^{cT}-\frac{1}{c}-T \right).&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;corr(W_1(T), \, X_T) = \frac{\rho \left(\frac{1}{c}e^{cT}-\frac{1}{c}-T \right)}{\sqrt{T \left( \frac{1}{2c}e^{2cT}-\frac{2}{c}e^{cT}+T+\frac{3}{2c}\right)}}\equiv \rho_0.&#xA;\end{align*}&#xA;We can then assume that&#xA;\begin{align*}&#xA;W_1(T) = \frac{\rho_0\sqrt{T}}{\sqrt{\frac{1}{2c}e^{2cT}-\frac{2}{c}e^{cT}+T+\frac{3}{2c}}}X_T + \sqrt{T\left(1-\rho_0^2\right)}Z,&#xA;\end{align*}&#xA;where $Z$ is a standard normal random variable that is independent of $X_T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From&#xA;\begin{align*}&#xA;e^{-\int_0^T \lambda_sds} = x,&#xA;\end{align*}&#xA;we obtain that&#xA;\begin{align*}&#xA;X_T = -\frac{c}{\xi}\ln x - \frac{\lambda_0}{\xi}\left(e^{cT}-1 \right).&#xA;\end{align*}&#xA;Then&#xA;\begin{align*}&#xA;S(T) &amp;amp;= S(0) e^{(r-\frac{1}{2}\sigma^2)T + \sigma W_1(T)}\\&#xA;&amp;amp;=S(0) e^{\frac{-\sigma \rho_0\sqrt{T}}{\sqrt{\frac{1}{2c}e^{2cT}-\frac{2}{c}e^{cT}+T+\frac{3}{2c}}}\left(\frac{c}{\xi}\ln x + \frac{\lambda_0}{\xi}\left(e^{cT}-1 \right) \right)}&#xA;e^{(r-\frac{1}{2}\sigma^2)T + \sigma \sqrt{1-\rho_0^2} \sqrt{T} Z}\\&#xA;&amp;amp;\equiv \tilde{S}(0) e^{-\frac{1}{2}\sigma^2 (1-\rho_0^2)T + \sigma \sqrt{1-\rho_0^2} \sqrt{T} Z},&#xA;\end{align*}&#xA;where&#xA;\begin{align*}&#xA;\tilde{S}(0) = S(0) e^{\frac{-\sigma \rho_0\sqrt{T}}{\sqrt{\frac{1}{2c}e^{2cT}-\frac{2}{c}e^{cT}+T+\frac{3}{2c}}}\left(\frac{c}{\xi}\ln x + \frac{\lambda_0}{\xi}\left(e^{cT}-1 \right) \right)} e^{(r-\frac{1}{2}\sigma^2\rho_0^2)T}.&#xA;\end{align*}&#xA;Therefore,&#xA;\begin{align*}&#xA;&amp;amp;\ E\left(e^{-\int_0^T \lambda_s ds} \max(S(T), K) \,|\, e^{-\int_0^T \lambda_s ds} =x\right) \\&#xA;=&amp;amp;\ xE\left(K+\max(S(T)-K, 0) \,|\, e^{-\int_0^T \lambda_s ds} = x\right)\\&#xA;=&amp;amp;\ x\Big(K + \tilde{S}(0)\Phi(d_1)-K\Phi(d_2) \Big),&#xA;\end{align*}&#xA;where $\Phi$ is the cumulative distribution function of a standard normal random variable, &#xA;\begin{align*}&#xA;d_1 = \frac{\ln \frac{\tilde{S}(0)}{K} + \frac{1}{2}\sigma^2 (1-\rho_0^2)T}{\sigma \sqrt{(1-\rho_0^2)T}},&#xA;\end{align*}&#xA;and&#xA;\begin{align*}&#xA;d_2 = d_1 - \sigma \sqrt{(1-\rho_0^2)T}.&#xA;\end{align*}&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2018-03-14T17:01:09.453" LastActivityDate="2018-03-14T17:01:09.453" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="36311" PostTypeId="1" AcceptedAnswerId="36319" CreationDate="2017-10-05T20:04:31.673" Score="0" ViewCount="1424" Body="&lt;p&gt;I have not been able to get to the results of the stress scenarios. I am using the series suggested between 1.05.2012 and 1.05.2017 where I have 1283 daily values including both dates. My steps in excel are the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Since there are 5 years of daily prices , I calculate, for each possible day, the log normal performance on 63 days. For example in cell C65 =LN(B65/B2), then in C66 =LN(B66/B3), then in C67 =LN(B67/B4), until C1284 =LN(B1284/B1221). This makes 1282 - 63 = 1220 observations of returns. The average return of the observations is +2.26%.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In column D I calculate the difference between the return and the average return, so in D65 = -0.24% - 2.26% = -2.49%, in D66 = +2.16% - 2.26% = -0.1% and so on until in D1284 = 8.71% - 2.26% = 6.45%.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;In column E I raise the results from each cell of column D to square. The column total is 6.01199142.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I divide this by 1220, to obtain 0.004927862.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I get the square root of this to get to the standard deviation and I obtain 0.07019873. This is very different than 0.017152366 indicated on page 24 of the flow diagram document.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;So I am obviously missing something. Can someone please lead me in the right direction ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;" OwnerUserId="29772" LastActivityDate="2017-11-03T15:54:06.617" Title="PRIIPs category 2 stress scenario calculation steps" Tags="&lt;regulatory-formula&gt;&lt;priips&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36314" PostTypeId="2" ParentId="36299" CreationDate="2017-10-05T21:49:38.130" Score="-1" Body="&lt;p&gt;I found a solution, but I am not exactly sure why what I did was wrong. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Never the less, the solution was, using the R package Sim.DiffProc to simulate the Stochastic Diffusion Process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$&#xA;dV(t)=\alpha(t,V(t))dt+\sigma(t,V(t))dW(t)\\=(\alpha V(t)+\pi-\mu(x+t)(b_d-V(t)))dt+\sigma V(t)dW(t)&#xA;$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks to Quantuple for leading me in the right direction.&lt;/p&gt;&#xA;" OwnerUserId="29858" LastEditorUserId="29858" LastEditDate="2017-10-06T01:10:48.273" LastActivityDate="2017-10-06T01:10:48.273" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36315" PostTypeId="1" CreationDate="2017-10-05T22:35:18.730" Score="-3" ViewCount="99" Body="&lt;p&gt;I am very confused on how to derive the attached equation (15). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would someone be kind enough to walk me through the proof?&#xA;&lt;a href=&quot;https://i.stack.imgur.com/CYF6v.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/CYF6v.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="29881" LastEditorUserId="848" LastEditDate="2017-11-01T06:12:59.667" LastActivityDate="2017-11-01T06:12:59.667" Title="Derivation of arithmetic variation of a portfolio over multiple periods" Tags="&lt;modern-portfolio-theory&gt;&lt;variance&gt;&lt;expected-return&gt;&lt;proof&gt;" AnswerCount="1" CommentCount="5" ClosedDate="2017-10-10T17:33:53.183" ContentLicense="CC BY-SA 3.0" />
  <row Id="36318" PostTypeId="2" ParentId="4687" CreationDate="2017-10-06T06:49:23.753" Score="-1" Body="&lt;p&gt;&lt;p&gt;If you are looking for an &lt;a href=&quot;https://www.allfxbrokers.com/brokers/business-model/ecnstp&quot; rel=&quot;nofollow noreferrer&quot;&gt;ecn broker&lt;/a&gt; you can find a relevant list by clicking &lt;a href=&quot;https://www.allfxbrokers.com/brokers/business-model/ecnstp&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="29884" LastActivityDate="2017-10-06T06:49:23.753" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36319" PostTypeId="2" ParentId="36311" CreationDate="2017-10-06T07:25:10.910" Score="1" Body="&lt;p&gt;This is how I understand it. &#xA;You first check the recommended holding Period for your fund. If it is bigger than 1 Year and you have daily prices you will have sub intervals of 63 observations as you say. &#xA;However you compute the returns &lt;strong&gt;daily&lt;/strong&gt; as usual (e.g. Ln(B2/B3)) and you take a rolling window for the standard deviation Estimation of 63 Variables (e.g. St.dev(C2:C64,C3:C65...etc). From this series of Standard deviations you take the different percentiles.&#xA;This approach will lead you to reasonable outputs.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps&lt;/p&gt;&#xA;" OwnerUserId="28303" LastEditorUserId="16148" LastEditDate="2017-10-06T14:13:59.197" LastActivityDate="2017-10-06T14:13:59.197" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36321" PostTypeId="2" ParentId="36315" CreationDate="2017-10-06T09:46:09.403" Score="2" Body="&lt;p&gt;$\newcommand{\E}{\mathbb{E}}$&#xA;$\newcommand{\V}{\mathbb{V}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First note that &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\E[(r_{t + n} + 1)^2] &amp;amp;=&amp;amp; \E[r_{t+n}^2 + 2r_{t + n} + 1] = \E[r_{t + n}^2] + 2\mu + 1  \\&amp;amp;=&amp;amp; (\V[r_{t+n}] + \E^2[r_{t+n}]) + 2 \mu + 1 \\ &amp;amp;=&amp;amp; \sigma^2 + (\mu^2 + 2\mu + 1) = \sigma^2 + (\mu + 1)^2 \tag{1}&#xA;\end{eqnarray}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, since $r_{t+n}$ are &lt;em&gt;independent&lt;/em&gt; random variables we have&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{eqnarray}&#xA;\V[r_{t,t+k}] &amp;amp;=&amp;amp; \V\left[\prod_{n=1}^k (r_{t+n} +1) - 1\right] = \V\left[\prod_{n=1}^k (r_{t+n} +1)\right]\\&#xA;&amp;amp;=&amp;amp; \E\left[\left(\prod_{n=1}^k (r_{t+n} +1)\right)^2\right] - \E^2\left[\prod_{n=1}^k (r_{t+n} +1)\right] \\&#xA;&amp;amp;=&amp;amp; \E\left[\prod_{n=1}^k (r_{t+n} +1)^2\right] - \left(\E\left[\prod_{n=1}^k (r_{t+n} +1)\right]\right)^2 \\&#xA;&amp;amp;=&amp;amp; \prod_{n=1}^k \E[(r_{t+n} +1)^2] - \left(\prod_{n=1}^k \E[r_{t+n} +1]\right)^2 \\&#xA;&amp;amp;\stackrel{(1)}{=}&amp;amp; \prod_{n=1}^k [\sigma^2 + (\mu + 1)^2] - \prod_{n=1}^k(\mu + 1)^2 \\&#xA;&amp;amp;=&amp;amp;[\sigma^2 + (\mu + 1)^2]^k - (\mu + 1)^{2k}&#xA;\end{eqnarray}&lt;/p&gt;&#xA;" OwnerUserId="29731" LastActivityDate="2017-10-06T09:46:09.403" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36322" PostTypeId="2" ParentId="21165" CreationDate="2017-10-06T13:51:13.387" Score="1" Body="&lt;p&gt;To be rigorous, I have modified your original question to define:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ S_{t_i^+}=(1-\alpha)S_{t_i^-}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $t_i$ is a payment date for $B$. At $t_i$, $B$ receives the amount $\alpha S_{t_i^-}$. This way we distinguish $S_{t_i}$, $S_{t_i^+}$ and $S_{t_i^-}$ where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ S_{t_i} = S_0e^{(r-\frac{\sigma^2}{2})t_i+\sigma W_{t_i}} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) To me there is no particular issue. Letting $0&amp;lt;t_0&amp;lt;t$, note that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;S_t&amp;amp;=S_0e^{(r-\frac{\sigma^2}{2})t+\sigma W_t}&#xA;\\[9pt]&#xA;&amp;amp;=\left(S_0e^{(r-\frac{\sigma^2}{2})t_0+\sigma W_{t_0}}\right)e^{(r-\frac{\sigma^2}{2})(t-t_0)+\sigma (W_t-W_{t_0})}&#xA;\\[6pt]&#xA;&amp;amp;=S_{t_0}e^{(r-\frac{\sigma^2}{2})(t-t_0)+\sigma W_{t-t_0}}&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Letting:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;S_{t_0^-} &amp;amp; = S_0e^{(r-\frac{\sigma^2}{2})t_0+\sigma W_{t_0}} \tag{1}&#xA;\\[6pt]&#xA;S_{t_0^+} &amp;amp; = (1-\alpha)S_{t_0^-} \tag{2}&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ S_{t_0^+}e^{(r-\frac{\sigma^2}{2})(t-t_0)+\sigma W_{t-t_0}} = (1-\alpha)S_{t_0^-}e^{(r-\frac{\sigma^2}{2})(t-t_0)+\sigma W_{t-t_0}} = (1-\alpha)S_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we have a 2nd date $t_1&amp;gt;t_0$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;S_{t_1^+}e^{(r-\frac{\sigma^2}{2})(t-t_1)+\sigma W_{t-t_1}} &amp;amp; = (1-\alpha)S_{t_1^-}e^{(r-\frac{\sigma^2}{2})(t-t_1)+\sigma W_{t-t_1}} &#xA;\\[6pt]&#xA;&amp;amp; = (1-\alpha)S_{t_0^+}e^{(r-\frac{\sigma^2}{2})(t_1-t_0)+\sigma W_{t_1-t_0}} e^{(r-\frac{\sigma^2}{2})(t-t_1)+\sigma W_{t-t_1}} &#xA;\\[6pt]&#xA;&amp;amp; = (1-\alpha)S_{t_0^+}e^{(r-\frac{\sigma^2}{2})(t-t_0)+\sigma W_{t-t_0}} \qquad &#xA;\\[6pt]&#xA;&amp;amp; = (1-\alpha)^2S_t&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So you can simulate your asset and then multiply by $(1-\alpha)^N$ posteriorly. From $\text{(1)}$ and $\text{(2)}$ you see that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ S_{t_i^-} = (1-\alpha)^{i-1}S_0e^{(r-\frac{\sigma^2}{2})t_i+\sigma W_{t_i}} = (1-\alpha)^{i-1}S_{t_i}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) The price of a claim is its discounted risk-neutral expectation, hence letting $\pi_B$ be the price of $B\text{'s}$ claim we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;\pi_B&amp;amp;=E^Q\left[\sum_{i=1}^Ne^{-rt_i}\alpha S_{t_i^-}\right]&#xA;\\[6pt]&#xA;&amp;amp; = \sum_{i=1}^N\alpha e^{-rt_i}E^Q\left[S_{t_i^-}\right]&#xA;\\[6pt]&#xA;&amp;amp; = \sum_{i=1}^N\alpha e^{-rt_i}(1-\alpha)^{i-1}E^Q\left[S_{t_i}\right]&#xA;\\[6pt]&#xA;&amp;amp; = \alpha S_0\sum_{i=1}^N e^{-rt_i}(1-\alpha)^{i-1}e^{rt_i}&#xA;\\[6pt]&#xA;&amp;amp; = \alpha S_0\sum_{i=0}^{N-1} (1-\alpha)^{i}&#xA;\\[6pt]&#xA;&amp;amp; = S_0(1-(1-\alpha)^N)\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) First, note that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \min(S_{t_N}-S_0,0)=-\max(S_0-S_{t_N},0) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence party $A$ has sold a put with strike $S_0$ to the fund. Additionally, &lt;em&gt;vis-à-vis&lt;/em&gt; party $C$ the position is equivalent to the fund having sold a call with strike $S_0$. As a result, combining the positions of $A$ and $C$, the fund is short a forward contract on the asset $S_t$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, $B\text{'s}$ payments can be interpreted as dividends: the asset pays a proportional dividend with rate $\alpha$ at times $\{t_i\}_i$. After each payment the asset depreciates by $\alpha S_{t_i^-}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming the asset is effectively dividend-paying, we conclude that to replicate all payments the fund only needs to hold one unit of the asset: it will pay $B$ with dividends received and at maturity $t_N$ it will sell it for a price equal to $S_0$ to either $A$ (if $S_{t_N} \leq S_0$) or $C$ (if $S_{t_N} &amp;gt; S_0$).&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-10-06T17:11:33.753" LastActivityDate="2017-10-06T17:11:33.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36323" PostTypeId="1" CreationDate="2017-10-06T15:05:59.557" Score="-1" ViewCount="142" Body="&lt;p&gt;I collect data every 30 seconds and store it in a DB. Suppose I want to do analysis for 30m,1H,4H and 1 day time frames, what's the best approach to have access to that data for each TF? &lt;/p&gt;&#xA;" OwnerUserId="29889" LastActivityDate="2017-10-06T16:01:36.167" Title="How to store tick data for diffferent time frames?" Tags="&lt;tick-data&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36324" PostTypeId="2" ParentId="36323" CreationDate="2017-10-06T16:01:36.167" Score="2" Body="&lt;p&gt;Create a separate DB for each time horizon you need in your research.&lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2017-10-06T16:01:36.167" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36325" PostTypeId="2" ParentId="21165" CreationDate="2017-10-06T18:54:40.350" Score="1" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;This is an addendum to the answer provided by Daneel Olivaw.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Let's assume that the payment at $t_i$, for $i=1, \ldots, N$, is $\alpha_i S_{t_i}$. We define the step function&#xA;\begin{align*}&#xA;M_t = \sum_{i=1}^N \alpha_i \pmb{1}_{\{t_i \le t\}}.&#xA;\end{align*}&#xA;Moreover, we assume that the fund value process $\{S_t, \, t \ge 0\}$ satisfies an SDE of the form&#xA;\begin{align*}&#xA;dS_t = S_{t-}\big(rdt-dM_t + \sigma dW_t \big).&#xA;\end{align*}&#xA;Then &#xA;\begin{align*}&#xA;S_t = S_0 e^{(r-\frac{1}{2} \sigma^2)t + \sigma W_t}\Pi_{t_i \le t} (1-\alpha_{i}).&#xA;\end{align*}&#xA;The valuation of the respective payoffs can now be followed as the answer of Daneel Olivaw.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastActivityDate="2017-10-06T18:54:40.350" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36327" PostTypeId="1" CreationDate="2017-10-07T00:13:51.483" Score="2" ViewCount="469" Body="&lt;p&gt;I have modelled the time-series of daily log-returns from August 2015 to October 2017 of a minimum-variance portfolio composed of four cryptocurrencies (BTC, ETH, LTC, XMR) by fitting the data to four different distributions: the Cauchy distribution, the Normal distribution, the exponential distribution, and Student's t distribution. I've then subsequently yielded the value-at-risk (VaR) and expected shortfall (ES) for all of the aforementioned distributions except for the Cauchy one, as this one has an undefined mean and variance. However, I've particularly run into a problem when computing the VaR for Student's t distribution. This is because when fitting my data I obtain a degrees of freedom parameter of&#xA;$$&#xA;\nu=1.73&#xA;$$&#xA;and since the VaR formula for Student's t distribution is defined as&#xA;$$&#xA;\sqrt{\frac{\nu-2}{\nu}}t_{\nu}^{-1}(1-\alpha)\sigma-\mu&#xA;$$&#xA;where $t_{\nu}^{-1}(1-\alpha)$ is the quantile function of the Student's t distribution, $\alpha$ is a probability level such that $0&amp;lt;\alpha&amp;lt;1$, $\sigma$ is the standard deviation parameter, and $\mu$ is the mean (or location) parameter, this then obviously implies that&#xA;$$&#xA;\nu-2&amp;lt;0&#xA;$$&#xA;which means that the square root &quot;does not exist&quot; in this context.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Interestingly enough, I can nevertheless yield the expected shortfall for Student's t distribution, since its closed-form expression doesn't involve taking the square root of any number. This is all illustrated in the figures below&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/uPZqQ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/uPZqQ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/LLcWj.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/LLcWj.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore, does anybody have any idea as to why I obtain a degrees of freedom parameter $\nu&amp;lt;2$, and in which specific circumstances this tends to occur? Typically the opposite result should be obtained, and as it can be seen above, the distribution is somewhat heavy-tailed. In the past I have modelled and have performed stress testing (i.e. computing the parametric VaR and ES) on a minimum-variance portfolio of stocks, and I have never encountered this issue of yielding $\nu&amp;lt;2$. Any input would be highly appreciated. Thank you very much in advance.&lt;/p&gt;&#xA;" OwnerUserId="29892" LastEditorUserId="29892" LastEditDate="2017-10-07T01:10:58.867" LastActivityDate="2017-10-07T01:10:58.867" Title="Trouble computing the VaR for Student's t-distribution for a minimum-variance portfolio composed of four cryptocurrencies (BTC, ETH, LTC, and XMR)" Tags="&lt;time-series&gt;&lt;portfolio-management&gt;&lt;portfolio-optimization&gt;&lt;modern-portfolio-theory&gt;&lt;mean-variance&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36328" PostTypeId="2" ParentId="34036" CreationDate="2017-10-07T01:06:09.257" Score="5" Body="&lt;p&gt;This is not quite true, in either direction.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have an arbitrage free implied vol surface, you might not have a well-defined local vol surface.  An example comes from a discrete model.  Consider a spot dynamics where the spot is a martingale that jumps up or down by integer amounts.  The spot distribution is discrete, with zero density in between integer levels.  The Dupire equation will result in division by zero trying to calculate the corresponding local vol.  That is, there is no local vol model that gives exactly the same prices.  Local vol models get arbitrarily close, but the limit diffusion is a &quot;gap diffusion&quot; -- what you get when you let the local vol be infinite.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the other direction, there are local volatility functions which give a strict local martingale spot dynamics.  For example, let the local volatility be $\sigma (S)=S $, so $dS=S^2 dW $. &#xA; According to the usual theories of arbitrage pricing, this model has arbitrage.  For instance there is a delta-hedging strategy to replicate $S $ at time $T $ for less cost than $S (0) $.  Such local vol models are only arbitrage free under a different numeraire.  For example taking a basket of one dollar and one stock as numeraire, the local vol model allows the price of the dollar to become worthless with respect to the basket, but the arbitrage is no longer present.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Unfortunately I don't know of a neat way to fix the statement to nicely clean up the edge cases.  As written it is &quot;mostly true&quot; or &quot;morally true&quot; but not mathematically true.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastActivityDate="2017-10-07T01:06:09.257" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36329" PostTypeId="1" CreationDate="2017-10-07T15:33:28.517" Score="6" ViewCount="352" Body="&lt;p&gt;In case of uncollateralised trades, where we use LIBOR rates for discounting, does the LIBOR tenor have to match with the payment frequency?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, one of the swap leg pays USD floating amount every 3 months, does this suggest that we should use 3M USD Libor for discounting? (and 1M USD LIBOR for monthly payment etc.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this is true, what if the payment frequency is once every 3 years. What would be the best LIBOR tenor to use for discounting?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If not, is there any market convention of choosing the suitable default LIBOR curve for different currencies, irrespective of the payment frequency?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="26834" LastEditorUserId="20454" LastEditDate="2017-10-07T17:20:19.687" LastActivityDate="2017-10-08T21:07:56.780" Title="Discount curve and payment frequency" Tags="&lt;swaps&gt;&lt;libor&gt;&lt;discounting&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36330" PostTypeId="1" AcceptedAnswerId="36344" CreationDate="2017-10-07T16:32:36.787" Score="5" ViewCount="1060" Body="&lt;p&gt;In the simple Merton structural credit risk model, the physical default probability is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;DD_p = \frac{\ln(A / D) + (\mu -0.5\sigma^2)T}{\sigma \sqrt{T}}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;P=N(-DD_p)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming that the physical distance-to-default(DD) and P are already provided, one needs to convert the physical default probability to risk-neutral probability in order to derive a fair value spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &quot;standard&quot; way for this conversion in the literature seems to be the following:&#xA;$$&#xA;Q=N[N^{-1}(P) + \lambda R \sqrt T]&#xA;$$&#xA;where $\lambda$ is the market Sharpe ratio and R is the correlation of market and asset returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially, the physical probability is transformed to a point in the CDF, a risk premium is added, then the sum is transformed back to arrive at the risk-neutral default probability.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is: why can we not simply plug in the risk-free rate(say the Treasury rate) into the distance-to-default formula since all assets have the same drift(r) under the risk-neutral measure?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;DD_q = \frac{\ln(A / D) + (r -0.5\sigma^2)T}{\sigma \sqrt{T}}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;Q=N(-DD_q)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone point out what is wrong with my naive thinking? There must be a good reason why the literature is taking the more circuitous approach above.&lt;/p&gt;&#xA;" OwnerDisplayName="user2163" LastActivityDate="2017-10-25T07:13:40.460" Title="Conversion between physical and risk-neutral default probabilities" Tags="&lt;default-probability&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36332" PostTypeId="2" ParentId="36329" CreationDate="2017-10-07T22:51:35.043" Score="6" Body="&lt;p&gt;Better yet, don't use LIBOR for discounting at all.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since LIBOR involves credit spread over the risk free rate, using LIBOR for discounting would adjust the deal's market value to reflect some amount of credit risk. &lt;a href=&quot;https://www-2.rotman.utoronto.ca/~hull/DownloadablePublications/LIBORvsOIS.pdf&quot; rel=&quot;noreferrer&quot;&gt;Hull and White&lt;/a&gt; argue it's not generally the best idea, since it would mean double-counting, as one also normally computes the CVA to handle this risk. Also, it'd be admissible only if the counterparty's credit risk was comparable to LIBOR panelists, ie. if it was a bank, but having an uncollateralized deal with a bank is unlikely in the current regulatory environment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to value uncollateralized trades, you're better off using OIS as the discount curve, with explicit xVA adjustments.&lt;/p&gt;&#xA;" OwnerUserId="29898" LastActivityDate="2017-10-07T22:51:35.043" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36334" PostTypeId="1" AcceptedAnswerId="39207" CreationDate="2017-10-08T14:00:40.977" Score="2" ViewCount="948" Body="&lt;p&gt;While I completely understand the negative base arbitrage when the base is defined as : $$Base = CDS - ASW$$&#xA;I am stuck on the possible arbitrage when the base is positive.&lt;br /&gt;&#xA;Let's think with an easy example : &lt;br /&gt;&#xA;France Telecom ASW : 100bps&lt;br /&gt;&#xA;CDS France Telecom : 200bps&lt;br /&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I borrow the bond on a reverse Repo at Libor +30bps and sell it, and sell protection with the CDS. Then I receive 200bps from the CDS and pay Libor + 30bps for the repo and then ? I am not able to see the arbitrage ? Could someone provide some explanations ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance ! &lt;/p&gt;&#xA;" OwnerUserId="29708" LastActivityDate="2018-04-10T08:00:53.820" Title="Positive base arbitrage CDS vs Asset Swap" Tags="&lt;bond&gt;&lt;arbitrage&gt;&lt;cds&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36335" PostTypeId="1" CreationDate="2017-10-08T15:09:05.087" Score="0" ViewCount="124" Body="&lt;p&gt;I know if $X \sim N(\mu,\sigma^2)$, then $VaR_{\alpha}(X) =\mu + \sigma\Phi^{-1}(\alpha)$ and $CVaR_{\alpha}(X) = \mu + \sigma \frac{\phi(\Phi^{-1}(\alpha))}{1-\alpha}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But how to evaluate $\lim_{\alpha \to 1}\frac{VaR_{\alpha}(X)}{CVaR_{\alpha}(X)}$?&lt;/p&gt;&#xA;" OwnerDisplayName="user28045" LastActivityDate="2017-10-08T15:09:05.087" Title="How to derive the limit of ratio between VaR and CVaR?" Tags="&lt;var&gt;&lt;cvar&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36337" PostTypeId="1" AcceptedAnswerId="36340" CreationDate="2017-10-08T18:41:55.243" Score="5" ViewCount="758" Body="&lt;p&gt;Can someone help me finding the expected value of the solution to Merton's jump diffusion model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;S_t &amp;amp;= S_0 \exp \left( \left(r -  \frac{\sigma^2}{2} - \lambda k \right) t + \sigma W_t \right)  \prod_{j=1}^{N_t} (1+\epsilon_i)&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W_t$ is a BM and $N_t$ is a Poisson process with intensity $\lambda$ and $k$ is the expectation of $\epsilon_i$. The Brownian Motion and Poisson Process are independent.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;E \left[ \exp \left( \left(r -  \frac{\sigma^2}{2} \right) t + \sigma W_t \right) \right] = \exp(rt)&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but what is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;E \left[ \prod_{j=1}^{N_t} (1+\epsilon_i) \right] = ?&#xA;\end{align}&lt;/p&gt;&#xA;" OwnerUserId="29909" LastActivityDate="2017-10-09T14:32:59.970" Title="Merton's jump diffusion" Tags="&lt;stochastic-calculus&gt;&lt;jump-diffusion&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36338" PostTypeId="2" ParentId="36280" CreationDate="2017-10-08T21:00:07.543" Score="4" Body="&lt;p&gt;Yes. Your understanding is correct. The only thing that keeps the ETF price in line is the aggregate market participants willingness to keep it in line. Under normal circumstances, that willingness is available usually in plenty of volume for most any size of ETF trader.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider there to be a continuum of ability to be able to purchase or sell at NAV. On the one hand is the open-end fund where you transact at the NAV on a guaranteed basis (but you give up intra-day trading ability). At the other end is a closed end fund where you have no ability to guarantee execution at NAV (even though it is likely to be a well known quantity). In between is the ETF. There is no explicit guarantee that you can execute at NAV. Instead a process was created to incentivize explicit or implicit market makers to provide an ability to enter or exit an ETF position. That process allows Authorized Participants to exchange the underlying basket of assets for the ETF and vice versa. Since this is a pretty straightforward (generally) problem to solve, this usually acts as a powerful incentive and the market sees plenty of ability to transact in many ETFs. &#xA;Consider that the NAV is likely calculated based on a mid-market price for all of the basket. While in large, liquid ETFs, eg SPY, there are many non-market making participants looking to trade and there will likely be an ability to participate very very very near to NAV. On the other hand, a market maker will be looking to sell (buy) the ETF at a slightly (deliberately vague) higher (lower) price than where they can obtain the basket.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is generally the case. On the other hand, consider a couple of other cases that might allow supply/demand to drive ETF prices away from NAV. First might be that the NAV calculation is not as accurate as might appear. For instance, high yield bonds where pricing might be subject to wide markets or obtaining liquidity in large size is impossible. Second, consider that APs tend to take what are considered to be low risk trades that require large amounts of leverage to make profitable. That means that they are dependent on their ability to obtain credit from their clearing firms or from banks. Should that credit get tighter, that could either force APs to widen their markets, stop operating, or even liquidate at adverse prices (there may be some sort of an inability to deliver baskets due to some settlement or credit issues). MUB (the muni bond ETF) traded at a discount for an extended period in the past.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In order to take advantage of these opportunities, the most effective way is to become an AP, but that is likely out of reach for most unless you wish to join or become a broker-dealer and do it full time. The second way is to find a correlated asset to trade against. For instance, if one found that HYG was trading rich but JNK was fair, one could do a pair trade. Given normal conditions (HYG not hard to borrow and reasonable costs to trade) that should be within an aggressive retail trader's scope.&lt;/p&gt;&#xA;" OwnerUserId="29910" LastActivityDate="2017-10-08T21:00:07.543" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36340" PostTypeId="2" ParentId="36337" CreationDate="2017-10-08T22:18:47.393" Score="8" Body="&lt;p&gt;Given for all $i$ the mean of $\epsilon_i$ is $k$ and that the $\{\epsilon_i\}_i$ are i.i.d., we have$^{\text{(1)}}$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align}&#xA;E\left[\prod_{i=1}^{N_t}(1+\epsilon_i)\right] &amp;amp;=E\left[E\left[\prod_{i=1}^{N_t}(1+\epsilon_i)|N_t\right]\right]&#xA;\\[6pt]&#xA;&amp;amp;=E\left[\prod_{i=1}^{N_t}E\left[(1+\epsilon_i)|N_t\right]\right]&#xA;\\[6pt]&#xA;&amp;amp;=E\left[\prod_{i=1}^{N_t}(1+k)\right]&#xA;\\[13pt]&#xA;&amp;amp;= E\left[(1+k)^{N_t}\right]&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By definition of the expectation and the distributional properties of $N_t$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align}&#xA;E\left[(1+k)^{N_t}\right]&amp;amp;=\sum_{n=0}^{\infty}(1+k)^{n}\frac{(\lambda t)^n}{n!}e^{-\lambda t}&#xA;\\[6pt]&#xA;&amp;amp;= e^{k\lambda t}&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\text{(1)}$ &lt;em&gt;Note a subtlety here that got me momentarily confused: the product of $n$ i.d.d. random variables $\epsilon_1,\cdots,\epsilon_n$ with same distribution as $\epsilon$ is &lt;strong&gt;not&lt;/strong&gt; the same as the $\text{n}^{\text{th}}$ power of variable $\epsilon$. Hence, you cannot directly collapse the product $\prod_{1\leq i \leq n}(1+\epsilon_i)$ to the power $(1+\epsilon)^n$, you first need to &quot;inject&quot; the expectation into the product.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-10-09T14:32:59.970" LastActivityDate="2017-10-09T14:32:59.970" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36341" PostTypeId="2" ParentId="14726" CreationDate="2017-10-09T02:10:35.413" Score="1" Body="&lt;p&gt;Check out the approach proposed in this paper (specifically Remark 3.2):&#xA;Ledoit, O., &amp;amp; Wolf, M. (2008). Robust performance hypothesis testing with the Sharpe ratio. Journal of Empirical Finance, 15(5), 850-859.&lt;/p&gt;&#xA;" OwnerUserId="29913" LastActivityDate="2017-10-09T02:10:35.413" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36342" PostTypeId="1" AcceptedAnswerId="36346" CreationDate="2017-10-09T04:51:10.543" Score="14" ViewCount="594" Body="&lt;p&gt;You read a lot about cryptocurrencies these days, especially bitcoin.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question: Do you see something fundamentally different about them compared to other asset classes, i.e. other currencies, from a quantitative point of view?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If yes, could you give some good references which discuss those characteristics?&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2021-04-06T20:03:46.690" Title="Something fundamentally different about cryptocurrencies?" Tags="&lt;reference-request&gt;&lt;bitcoin&gt;" AnswerCount="2" CommentCount="9" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="36344" PostTypeId="2" ParentId="36330" CreationDate="2017-10-09T08:48:17.160" Score="3" Body="&lt;p&gt;I'm no expert on this topic but here's my two cents. Hopefully if I'm wrong someone will correct me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the 2 relations you wrote, we see that&#xA;$$ DD_q = -N^{-1}(P) - \lambda R \sqrt{T} $$&#xA;or equivalently&#xA;\begin{align}&#xA;DD_q &amp;amp;= DD_p -  \lambda R \sqrt{T} \\&#xA;&amp;amp;= \frac{\ln(A/D)+((\mu-\lambda \sigma R) - 0.5\sigma^2)T}{\sigma \sqrt{T}}&#xA;\end{align}&#xA;where the equivalent &quot;risk-free&quot; rate $r$ would be, $r := \mu - \lambda \sigma R $. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the asset under scrutiny is tradable, you are right that $r$ should represent the cost of carrying that asset in the absence of arbitrage. However, if there is no way to straightforwardly &quot;trade&quot; it -- which could be the case here since $A$ represents the &lt;em&gt;total assets&lt;/em&gt; of a firm -- assumptions have to be used. The assumptions used here are consistent with the &lt;a href=&quot;https://en.wikipedia.org/wiki/Capital_asset_pricing_model&quot; rel=&quot;nofollow noreferrer&quot;&gt;CAPM&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Denoting asset-specific quantities using the index $a$ and market specific quantities with $m$, CAPM indeed writes&#xA;\begin{align}&#xA;\Bbb{E}[r_a] &amp;amp;= r + \beta_m (\Bbb{E}[r_m] - r) \\&#xA;&amp;amp;= r + \rho_{a,m} \frac{\sigma_a}{\sigma_m} (\Bbb{E}[r_m] - r) \\&#xA;&amp;amp;= r + \rho_{a,m} \sigma_a \lambda_m&#xA;\end{align}&#xA;whence&#xA;$$ r = \Bbb{E}[r_a] - \rho_{a,m} \sigma_a \lambda_m $$&#xA;or using the notations above&#xA;$$ r = \mu - \lambda \sigma R $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consequently, the method you refer to simply consists in specifying a particular form for the &lt;em&gt;market price of risk&lt;/em&gt; by relying on CAPM assumptions. &lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2017-10-25T07:13:40.460" LastActivityDate="2017-10-25T07:13:40.460" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36345" PostTypeId="2" ParentId="25006" CreationDate="2017-10-09T08:56:47.660" Score="1" Body="&lt;p&gt;Sequence Number Reset depends on FIX engine configuration.&#xA;If you have FIX initiator you can set &quot;ResetOnLogon=N&quot;, so that your acceptor will keep track of sequence number.&#xA;In case of sequence number mismatch, both counterparty/FIX engine will replay messages that were lost.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have Acceptor at your end, then you can ask counterparty(initiator) FIX engine to keep &quot;ResetOnLogon=N&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Refer this &lt;a href=&quot;http://www.quickfixengine.org/quickfix/doc/html/configuration.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;link&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="19176" LastActivityDate="2017-10-09T08:56:47.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36346" PostTypeId="2" ParentId="36342" CreationDate="2017-10-09T09:09:27.173" Score="3" Body="&lt;p&gt;There is something very fundamental to Cryptocurrencies, especially the one you want to talk about, i.e. Bitcoin. I suggest you a very good reading, &lt;a href=&quot;https://queue.acm.org/detail.cfm?id=3136559&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;Academic Pedigree of Cryptocurrency.&quot;&lt;/a&gt; There is a method of registering every transaction happening on Bitcoin Peer-to-Peer reviewed distributed network, which is called a &quot;Public Ledger.&quot; Every Miner is basically a ledger, who earns a reward by the distributed network for recording certain number of transactions, collectively known as a 'Block.' This is why miners' startup are usually referred to as &quot;Block Chain.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In our normal currency system, the &quot;Ledger Work&quot; is done through Banks. You might have heard (if I am not Wrong!) that a check is a ledger, but a private ones. This is why Banks work by charging you, because they have to power up the system with your money. In Bitcoin or any other CC network, the work is not only public, but also done without any intermediate structure. So, You can directly send your money (bitcoins,) and not worry about it. It is secure! Than, every transactions is on public ledger, so every user with a unique user key, and pass key can have access to his bitcoins, and privacy of this ownership is entirely dependent on user. You wanna publish you crypto-wealth, well! Go On! But you don't really have to do this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, you will start to connect the dots, and make a whole picture that explains the difference itself. Our everyday Banking Structures are fueled by a whole banking, and financial infrastructure, which is than either controlled or governed by some central department, for which you are charged. Obviously, Money is Fuel for Economy. But as you see, Bitcoin have no central controlling system, even its inventor (named as Satoshi Nakamuto) have no control over it. Now, let's discuss the fluctuating price for such CC, like Bitcoin. Its highly unstable prices attract our attention, when we get to hear that people with thousand of bitcoins are now Millionaires, just because they've mined a lot in past. The truth is, that this currency is still experimental. Its price is totally governed by the exchange rates of markets, and totally determined on the basis of Demand &amp;amp; Supply of Market. One bank added a support for FOREX in Bitcoins, and prices climbed up to USD 5,000. Sudden rush to sell increased the supply in market, and the prices went back to USD 3,000. There will be a time, when its prices will get stable, but for that to happen, we need a lot more people to adopt CryptoCurrency as their common transaction medium.&lt;/p&gt;&#xA;" OwnerUserId="29849" LastActivityDate="2017-10-09T09:09:27.173" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36347" PostTypeId="1" CreationDate="2017-10-09T09:15:36.433" Score="1" ViewCount="784" Body="&lt;p&gt;Would it make sense to use a regression to calculate beta for returns on a foreign exchange currency (regressed on a market average of all currencies)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would the beta make sense? (why/why not)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Should I worry about CAPM assumptions?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for your assistance!&lt;/p&gt;&#xA;" OwnerUserId="29522" LastActivityDate="2017-11-11T22:46:34.657" Title="Beta in foreign exchange market" Tags="&lt;fx&gt;&lt;regression&gt;&lt;capm&gt;&lt;beta&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36350" PostTypeId="5" CreationDate="2017-10-09T16:07:05.677" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2017-10-09T16:07:05.677" LastActivityDate="2017-10-09T16:07:05.677" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36351" PostTypeId="4" CreationDate="2017-10-09T16:07:05.677" Score="0" Body="Questions related to collateral, from impact on theoretical valuations to operational aspects of collateral posting." OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-10-10T14:53:19.697" LastActivityDate="2017-10-10T14:53:19.697" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36352" PostTypeId="1" CreationDate="2017-10-09T17:48:43.960" Score="1" ViewCount="101" Body="&lt;p&gt;I have conducted very much research about leveraged ETFs lately. Most sources specifically say that these instruments are not meant for long-term investments and that they are very risky due to the daily recalibration. However, judging by the price of some leveraged ETFs like the SPXL it does seem like they have the potential to be good investments. Of course instruments of this kind should only be used in bullish phases. Nevertheless shouldn't a combination of ETFs like the SPXL for bull phases and the SPXS for bear phases yield superior returns? I have tried to estimate potential returns based on random variables in R. The code is as follows:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;X = 0&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;ETF = function(L,r_avg,v,t){&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;for (i in 1:t)&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;{&#xA;  if (i == 1) X = 1 * (1+ L*rnorm(1,r_avg,v))&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;else {if (i == t) return(X*(1+L* rnorm(1,r_avg,v)) else X = X* norm(1,r_avg,v)}&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Given a leverage L, an average daily return r_avg, a volatility/variance v and a time period t, the function calculates the return of an investment under these circumstances. Of course the model is extremely basic. It only considers returns that can be modeled using the normal distribution and does not consider that there are extra fees for leveraged ETFs. However, in this model the leveraged investments generally outcompete non-leveraged versions even when the volatility is very high. This seems strange, since the sources that I have reviewed suggest that when volatility is high the leveraged funds will be bad choices due to the volatility drag. If someone could clear things up that would be great! Can leveraged ETFs really be long term investment vehicles? And if not, then what is wrong with my model?&lt;/p&gt;&#xA;" OwnerUserId="28336" LastActivityDate="2017-10-09T17:48:43.960" Title="Long Term investment in leveraged ETFs not necessarily bad?" Tags="&lt;programming&gt;&lt;etf&gt;&lt;leverage&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36356" PostTypeId="1" AcceptedAnswerId="36357" CreationDate="2017-10-09T21:56:42.127" Score="-1" ViewCount="92" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/9v2ae.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/9v2ae.jpg&quot; alt=&quot;Observed prices questions&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could one of you please assist with question 4 shown in the image above?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance!&#xA;JR&lt;/p&gt;&#xA;" OwnerUserId="29925" LastActivityDate="2017-10-09T22:47:23.433" Title="Valuation of Fixed-Income Securities" Tags="&lt;fixed-income&gt;" AnswerCount="2" CommentCount="3" ClosedDate="2017-10-10T05:06:09.957" ContentLicense="CC BY-SA 3.0" />
  <row Id="36357" PostTypeId="2" ParentId="36356" CreationDate="2017-10-09T22:17:15.073" Score="1" Body="&lt;p&gt;Bonds X and Y pay semiannual coupons. Then the cash flow for X is a single payment at the maturity of 3\$ (half of 6\$ since it's semiannual) plus the par value. The discounted cash flow has to equal the price of the bond. &lt;br /&gt;Then you have :$$100,98 = \frac{103}{1+R_{0.5}}$$&#xA;Solving for $R_{0.5}$ gives you 2%&#xA;&lt;br /&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then you can perform the same calculation for Y, knowing that you have a first cash flow of 4\$ (that has to be discounted with $R_{0.5}$) for the first 6-month period and a second for the second period for the coupon and the principal payment (that should be discounted with $R_1$). &lt;br /&gt;&lt;/p&gt;&#xA;" OwnerUserId="29708" LastEditorUserId="29708" LastEditDate="2017-10-09T22:38:30.153" LastActivityDate="2017-10-09T22:38:30.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36359" PostTypeId="2" ParentId="36356" CreationDate="2017-10-09T22:47:23.433" Score="1" Body="&lt;p&gt;I wish I could &quot;add a comment&quot; to your answer but I can't for the moment.&lt;br /&gt;&#xA;Of course, the coupon for Y is 4\$ I corrected my answer. However, you are missing to square the denominator (because you are discounting the cash flow of the second period). You should have : $$103.59 = \frac{4}{1+R_{0.5}} + \frac{104}{(1+R_1)^2}$$&#xA;Since you know $R_{0.5}$ you can solve for $R_{1}$. &lt;br /&gt;Hope this helped!&lt;/p&gt;&#xA;" OwnerUserId="29708" LastActivityDate="2017-10-09T22:47:23.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36360" PostTypeId="2" ParentId="35451" CreationDate="2017-10-10T02:53:47.650" Score="1" Body="&lt;p&gt;Pre-caveat -- I have not done this in a retail account and am unfamiliar with how this would be treated from a margin perspective, though I believe it should receive a &quot;light&quot; treatment as its risk is quite low.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is such a structure. It is called a box. You were very close in the structure that you proposed. You proposed a conversion (or what we would have called a reversal or reverse-conversion) of long call, short put, short stock. Instead, consider two conversions. One is long call, short put, short stock. The other is short call, long put, long stock. Both are in the same expiration but different strikes.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But won't that offset? Yes, the stock (or futures or other underlying) will offset. But, depending on which way that you did it, there will be a net income or outlay of money. To borrow money, one would sell call in the low strike (high call premium to collect with little to pay out for the corresponding put) AND sell put in the high strike (again, high premium but this time in the put and the OTM option will be call). In other words, you would be selling the deep options in two conversions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider AAPL is trading \$100. The 3 month, 50 call is \$55.00 and the put is \$5. Meanwhile the 150 put trades 55 and the 150 call trades \$5. Both have conversions priced at 0. But if you sell call in the 50 conversion, you collect \$55 - \$5 = \$50. Meanwhile, to avoid transacting in stock, you bundle it with the 150 conversion to sell put: \$55 - \$5 and collect another \$50. Voila. Position: -1 50c, +1 50p, +1 150c, -1 150p. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With that said, you have to keep in mind that for the example that I gave, for AAPL options, they are American style options and subject to early exercise. Which means that you will likely lose your fat short option positions. Your choice is then to either transact in European style options (say SPX options, IIRC) or choose strikes in American style options to seek to avoid early exercise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The truth is that for retail accounts, I've never tried this. It is common for institutional clearing accounts to do exactly this to manage cash/equity balances (or even take punts on the path of future rates, etc). So I can't tell you that your broker or firm will provide a credit to your account that actually economically benefits you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On top of that, it is a 4 legged spread for which small amounts can make big differences in the implied interest rates. So while this is out there, and it is documented, I have to warn you that it is more likely than not to be a negative economic experience for you. So do not take this at all as trading or investing advice. If anything, it is merely to alert you to this structure and to perform more research about how your broker handles it, what it may cost, and all of the nuances (of which there are all sorts) for holding this trade.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Follow-on:&#xA;I just realized there would be a legitimate question as to where the magic of this came from in spontaneously generating credit at some anticipated far better rate than would otherwise be available. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This occurs because all transactions are done at the options clearing house, e.g., OCC or CME or wherever (those are US examples). Each clearing member guarantees that the trades will settle and be appropriately handled at expiration (or early exercise). Your broker or clearer will either have a credit line with you that will dictate if you can take any money out. You may not be able to; I don't know. You will likely, however, be able to use those proceeds to unlever currently leveraged transactions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, say that you owned \$500K of stocks using \$400K of funds. $100K of boxes into the account may (I stress may -- I can't speak for your situation) apply so that you don't need to pay the loan rate at your broker/clearer.  Hope that helped.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit/add due to comment:&#xA;The box gets its name from the way that looks like in a &quot;carded-up&quot; position, the way that option market makers look at them.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Call Pos        Strike        Put Pos     &#xA;  0               95             0&#xA; -9              100             9    &#xA;  9              105            -9&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="29910" LastEditorUserId="29910" LastEditDate="2017-12-11T14:22:54.023" LastActivityDate="2017-12-11T14:22:54.023" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36363" PostTypeId="1" CreationDate="2017-10-10T05:40:30.270" Score="1" ViewCount="277" Body="&lt;p&gt;In fixed income markets a stylized fact seems to be that there is a negative correlation between interest rates and credit spreads: Spreads tend to widen as rates fall. Why is that? &lt;/p&gt;&#xA;" OwnerUserId="26887" LastActivityDate="2017-10-10T05:40:30.270" Title="Negative correlation between interest rates and credit spreads - Why?" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;spread&gt;&lt;credit&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36365" PostTypeId="1" AcceptedAnswerId="36366" CreationDate="2017-10-10T07:18:40.500" Score="-1" ViewCount="87" Body="&lt;p&gt;In OTC market Collateral Posting as cash is normal, so when it is said &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Collateral Posted as USD CASH&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does that mean Actual amount of currency is posted electronically (or any security is posted) and does it carry any interest Rate Risk?&lt;/p&gt;&#xA;" OwnerUserId="11661" LastActivityDate="2017-10-10T09:22:11.397" Title="Cash as Collateral in OTC Market" Tags="&lt;derivatives&gt;&lt;collateral&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36366" PostTypeId="2" ParentId="36365" CreationDate="2017-10-10T09:22:11.397" Score="2" Body="&lt;p&gt;It means that cash is posted electronically.  The party receiving the cash must pay interest on it, usually Fed Funds on an overnight basis in the US, specified in the CSA (credit support annex).  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-10-10T09:22:11.397" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36367" PostTypeId="1" CreationDate="2017-10-10T13:27:28.650" Score="12" ViewCount="445" Body="&lt;p&gt;It is well-known that calibrating Heston to the vanilla market is not as easy as it seems: some parameters are &quot;interdependent&quot; and the objective function exhibit plateaus in the parameter space (at least in some dimensions of the parameter space, typically mean-reversion). A good reference on this is this 2017 &lt;a href=&quot;http://www.sciencedirect.com/science/article/pii/S0377221717304460&quot; rel=&quot;noreferrer&quot;&gt;paper&lt;/a&gt; by Cui et Al.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The authors mention&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;There are two possible approaches that one can seek to deal with this: the first is to scale the parameters to a similar order and search on a &lt;strong&gt;better-scaled&lt;/strong&gt; objective function; the second is to decrease the tolerance level for the optimisation process, meaning to approach the very bottom of this objective function&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I am particularly interested in the first approach and was wondering the parameterisations that you experts tend to use for your daily Heston calibrations? Is there a sound way to disentangle $\kappa$ and $\rho$ for instance?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;For instance, the variance process being CIR the asymptotic variance of variance computes as&#xA;$$\lim_{t \to \infty} \text{Var}_0^\Bbb{Q}[v_t] = \theta \frac{\xi^2}{\kappa} $$&#xA;To disentangle the effects of $\kappa$ and $\xi$ on smile convexity, one could therefore reparametrise the Heston variance process as&#xA;$$ dv_t = \kappa (\theta-v_t) dt + \xi^* \sqrt{\kappa} \sqrt{v_t} dW_t $$&#xA;where we have defined a new parameter $\xi^*$ such that $\xi = \xi^* \sqrt{\kappa}$. This parameter looks more natural since it would eventually lead us to: $\lim_{t \to \infty} \text{Var}_0^\Bbb{Q}[v_t] = \theta \xi^*$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Actually, I've found that this parametrisation was already proposed by Hans Buehler (see &lt;a href=&quot;http://www.quantitative-research.de/dl/Encyclopedia-Heston.pdf&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;, section 1.1.1. for a small discussion and equation (2) for the result). In some other presentations he mentions another reparametrisation where vol-of-vol appears in the drift (but the idea is the same IMO). &lt;/p&gt;&#xA;" OwnerUserId="29934" LastActivityDate="2020-06-10T18:06:45.720" Title="Heston model reparametrisation" Tags="&lt;heston&gt;&lt;calibration&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36368" PostTypeId="2" ParentId="7181" CreationDate="2017-10-10T14:42:00.443" Score="-1" Body="&lt;p&gt;You can find an Excel and VBA implementation of Random Forest using the open source ALGLIB Libary &lt;a href=&quot;https://www.academia.edu/attachments/54618055/download_file?st=MTUwNzY0NjEwOCwxOTYuMjMuNTAuNzMsMTIyMTAxMg%3D%3D&amp;amp;s=profile&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2911" LastActivityDate="2017-10-10T14:42:00.443" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36369" PostTypeId="1" CreationDate="2017-10-10T14:59:24.057" Score="2" ViewCount="48" Body="&lt;p&gt;When an exchange works with an electronic order book and a matching engine, it usually tries to match orders in realtime during trading hours. That means when a new order comes in, it tries to match this order to existing ones as soon as possible, usually within microseconds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any exchanges which don't do this in realtime, but instead employ a timed interval, which gives the participants a certain time (e.g. some seconds) to decide about their orders and place them, and then matching all known orders after the interval has ended?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This would eliminate the advantage of hosting trading algorithms nearby to the exchange, thus eliminate the need for co-hosting and the rally to host closest, reducing the trading to what it should actually be, a decision based on publicly available information.&lt;/p&gt;&#xA;" OwnerUserId="29936" LastActivityDate="2017-10-10T14:59:24.057" Title="Are there any exchanges which match orders in timed intervals?" Tags="&lt;exchange&gt;&lt;orderbook&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36370" PostTypeId="1" CreationDate="2017-10-10T15:08:19.893" Score="2" ViewCount="669" Body="&lt;p&gt;Having calculated the 1Y stress scenario at certain dates on the Euro stoxx 50 series, I realise that it jumps during June 2017. As at 31/5/2017 I get 0.347660613, and as at 30/06/2017 I get 0.663384825.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I right in saying that the KID would show at the end of May that there is a stress risk of losing 65.23% over one year, while the KID at the end of June would show a stress risk of losing 33,66% over one year ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Firstly, can someone indicate if my calculation is terribly wrong ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Secondly, would financial advisors, clients, regulators be aware of the limitations of showing these scenario statistics at one single date, and without some interpretation ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regards.&lt;/p&gt;&#xA;" OwnerUserId="29772" LastActivityDate="2018-11-09T20:03:00.563" Title="PRIIPs category 2 stress scenario - general question" Tags="&lt;priips&gt;&lt;regulatory-formula&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="36371" PostTypeId="1" CreationDate="2017-10-10T16:06:24.227" Score="1" ViewCount="59" Body="&lt;p&gt;Is there any literature that discusses adjusting a bond for various PIK (Pay-in-Kind) options? I'm trying to benchmark a loan with a PIK option with non-PIK bonds.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit: The loan has a payment in kind option where the borrower can pay interest in a deferred manner. &lt;/p&gt;&#xA;" OwnerUserId="29470" LastEditorUserId="29470" LastEditDate="2017-10-10T16:35:01.370" LastActivityDate="2017-10-10T16:35:01.370" Title="Adjust a bond for PIK option" Tags="&lt;fixed-income&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36372" PostTypeId="1" CreationDate="2017-10-10T16:27:16.220" Score="0" ViewCount="633" Body="&lt;p&gt;Why is there no drift adjustment when numeraire is changed from bank account (risk neutral measure) to zero coupon bond who matures at time of payoff (fwd risk neutral measure) ?&lt;/p&gt;&#xA;" OwnerUserId="17348" LastActivityDate="2017-10-11T10:06:52.100" Title="Change of numeraire from bank account to Zcb" Tags="&lt;stochastic-calculus&gt;&lt;convexity&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ClosedDate="2017-11-03T20:06:14.730" ContentLicense="CC BY-SA 3.0" />
  <row Id="36374" PostTypeId="1" CreationDate="2017-10-10T18:42:46.570" Score="2" ViewCount="143" Body="&lt;p&gt;I'm interested in modeling the joint likelihood for rating changes and default events across a portfolio of bonds.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To estimate the correlation between these assets, I can use a third-party factor model (BarraOne) to simulate: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;A)&lt;/strong&gt; the returns for each bond's underlying issuer equity &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;B)&lt;/strong&gt; the returns of the bonds themselves&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A default event or ratings downgrade would occur when the simulated P&amp;amp;L in a trial falls below a certain threshold. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The returns for the bonds themselves (option B) are a function of simulated changes in term structure, swap spread and credit spread factors. Equity returns are a factor model incorporating simulated changes in various factors such as value, equity market, size etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I am only interested in the joint likelihood of ratings up/downgrades and default, which option would give me a more accurate proxy for the correlation of credit events?&lt;/p&gt;&#xA;" OwnerUserId="17712" LastActivityDate="2019-09-04T05:01:50.217" Title="Choosing a proxy for asset credit event correlations" Tags="&lt;fixed-income&gt;&lt;simulations&gt;&lt;credit-risk&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36375" PostTypeId="2" ParentId="36372" CreationDate="2017-10-10T18:43:09.013" Score="3" Body="&lt;p&gt;Let $B_t= e^{\int_0^t r_sds}$ be the money-market account value at time $t$, and $P(t, T)$ be the value of the zero-coupon bond with maturity $T$ and unit face amount. Moreover, let $Q$ be the risk-neutral measure and $Q_T$ be the $T$-forward measure. If the interest rate $r_t$ is deterministic, then&#xA;\begin{align*}&#xA;P(t, T) &amp;amp;= E\left(e^{-\int_t^T r_s ds} \,|\, \mathcal{F}_t\right)\\&#xA;&amp;amp;= e^{-\int_t^T r_s ds} = \frac{B_t}{B_T},&#xA;\end{align*}&#xA;where $E$ is the expectation under the risk-neutral measure $Q$. Moreover, &#xA;for $0 \le t \le T$,&#xA;\begin{align*}&#xA;\frac{dQ}{dQ_T}\big|_t &amp;amp;= \frac{B_t P(0, T)}{P(t, T)}\\&#xA;&amp;amp;=\frac{B_t \frac{1}{B_T}}{\frac{B_t}{B_T}}=1.&#xA;\end{align*}&#xA;In particular, for any $A\in \mathcal{F}_T$, &#xA;\begin{align*}&#xA;Q(A) &amp;amp;= \int_{\Omega} \pmb{1}_A dQ \\&#xA;&amp;amp;= \int_{\Omega} \pmb{1}_A \frac{dQ}{dQ_T}\big|_T dQ_T \\&#xA;&amp;amp;= \int_{\Omega} \pmb{1}_A dQ_T \\&#xA;&amp;amp;=Q_T(A).&#xA;\end{align*}&#xA;That is, $Q=Q_T$.&lt;/p&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-10-10T20:01:56.800" LastActivityDate="2017-10-10T20:01:56.800" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="36376" PostTypeId="1" CreationDate="2017-10-10T23:25:57.660" Score="0" ViewCount="244" Body="&lt;p&gt;I have 2 questions which i can't seem to find no matter how I search. so:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) If we have 2 portfolios. One based on risk-return tradeoff (with variables HML, SMB and beta ) (Fama French, 1993) and the other one based on the characteristics approach (Daniel &amp;amp; Titman, 1997) (still with market beta, size and book to market as variables) how to we compare which is better apart from the Sharpe ratio? With the t-stat of their coefficients?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Can someone please explain the difference between the factor and characteristics as variables for the returns of stocks? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;&#xA;&lt;p&gt;PS sorry if i am not clear enough but even I can't grasp exactly the idea&lt;/p&gt;&#xA;" OwnerUserId="29942" LastEditorUserId="29942" LastEditDate="2017-10-10T23:33:48.080" LastActivityDate="2017-12-10T01:31:16.017" Title="How we compare 2 portfolios one with risk the other with characteristics?" Tags="&lt;portfolio&gt;&lt;factor-models&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36377" PostTypeId="2" ParentId="36376" CreationDate="2017-10-10T23:42:01.430" Score="2" Body="&lt;p&gt;To Fama &amp;amp; French a &quot;value stock&quot; is a stock that fluctuates up and down together with a portfolio of (other) stocks that have high book to market. If you think about the 2 stage procedure Fama and French use to first identify the B/M factor and then calculate a stock's exposure to this factor, that is what it amounts to.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To K. Daniel  &amp;amp; Titman a &quot;value stock&quot; is a stock that has high B/M. Period. There is no reference to any time series factor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In principle, but it is very hard to do in practice, if we could identify a group of stocks that have high B/M themselves but do not go up and down with other high B/M stocks, but maybe go up when B/M stocks go down and vice versa, then we would have the solution at hand. We could just ask if these stocks have high returns over the long run (in which case K&amp;amp;D are right), or if they have low returns (then F&amp;amp;F are right).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But as I said, it is difficult to do this, and maybe impossible. (So 20 years later we still don't have an answer to this question).&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2017-10-10T23:54:02.910" LastActivityDate="2017-10-10T23:54:02.910" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36378" PostTypeId="1" AcceptedAnswerId="36380" CreationDate="2017-10-11T03:47:18.283" Score="1" ViewCount="1679" Body="&lt;p&gt;I may asked this question before, but I still don't understand. We know that in a asset swap, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A pays the fixed coupon on the bond&lt;/p&gt;&#xA;&#xA;&lt;p&gt;B pays LIBOR + Spread&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The exchanges take place regardless of whether the bond defaults.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I don't understand why A and B will swap the bond value and the par value at the beginning(especially for par value, it seems very strange)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, Asset swap is totally a different thing from CDS, but what's the relation between asset swap spread and CDS spread?&lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-10-11T07:25:55.253" Title="Why do we swap the bond value and par value at the beginning in the Asset Swap" Tags="&lt;swaps&gt;&lt;credit&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36379" PostTypeId="2" ParentId="36378" CreationDate="2017-10-11T04:25:08.227" Score="2" Body="&lt;p&gt;You don't have to. You can exchange either the par amount, market price (clean or dirty), or any other value, and you can exchange at the beginning of the trade or at maturity. These are all fully negotiable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you swap the par value, the spread applied to LIBOR is called the &quot;par-par asset swap spread.&quot; However, you could also exchange the market price of the bond, in which case you'd apply a different spread to LIBOR and this spread is known as the &quot;proceeds asset swap spread&quot; or &quot;market-value asset swap spread.&quot; As said, you can exchange any value you want – you just need to recalculate the spread accordingly. It's just that par/par or proceeds are the most common ones.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2017-10-11T04:25:08.227" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36380" PostTypeId="2" ParentId="36378" CreationDate="2017-10-11T07:25:55.253" Score="3" Body="&lt;p&gt;Rather than thinking of an asset swap as a traded instrument, it can be useful to think of the asset swap spread as a relative value indicator. The asset swap PV has two parts, the bond part (valued at $100 - P$) and the swap, which pays the bond's coupon on the fixed leg, and ${\rm LIBOR} + s$ on the floating leg.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The spread $s$ accounts for two properties of the bond that make it distinct from a risk-free bond trading at par -&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The bond's coupon may be higher than a risk-free bond (reflecting credit risk when the bond was issued)&lt;/li&gt;&#xA;&lt;li&gt;The bond may not trade at par (reflecting changes in credit risk since the bond was issued)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;These components together reflect the current credit-worthiness of the bond. In order for the asset swap spread to correctly reflect the second component, it is necessary that in the initial exchange of bond for capital, the capital is $100 i.e. the face value of the bond, not its market value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the capital exchanged was the market value of the bond, the asset swap spread would only reflect the coupon of the bond, which isn't a good indicator of its current credit risk, and would render the asset swap spread useless as a tool for comparing relative value of two related bonds.&lt;/p&gt;&#xA;" OwnerUserId="924" LastActivityDate="2017-10-11T07:25:55.253" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36381" PostTypeId="1" AcceptedAnswerId="36409" CreationDate="2017-10-11T08:57:02.873" Score="3" ViewCount="3373" Body="&lt;p&gt;I post this question here as I didn't receive an answer in the Mathematics community.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am trying to understand how replicating portfolios can help us determine fair prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose we have a 3-year forward contract on 30 assets where each asset pays a dividend of \$15 in one year and \$10 in two years. Revenues are invested in zero coupon bonds maturing at $t=3$ years. The spot price now is $S_0=\$1000$ and the interest rate is 3 % compounded continuously.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider a portfolio A with 30 assets. Create a replicating portfolio B using a forward contract on 30 assets with forward price $K$ and bank deposits to determine $K$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I calculate the future value of the original portfolio A of 30 assets to be $$30S_3+30(10 \cdot e^.03+15\cdot e^.06)$$ at $t=3$ years (the payments are invested in a bank). We do not have $K$ in here since we are not in a contract? I want this to equal the value of portfolio B in order to use the law of one price. The value of the forward contract of B is $30S_3-K$ and thus I need bank deposits to the value of $$30 S_3+30(10 \cdot e^.03+15\cdot e^.06)-(30S_3-K)=K+30(10 \cdot e^.03+15\cdot e^.06).$$Therefore I need to deposit $$Ke^{-3\cdot 0.03}+30\cdot(10 \cdot e^.03+15\cdot e^.06)e^{-3\cdot 0.03}$$ at $t=0$ years. By the law of one price, the portfolios are worth the same at $t=0$ so $$30S_0=Ke^{-3\cdot 0.03}+30\cdot(10 \cdot e^.03+15\cdot e^.06)e^{-3\cdot 0.03}$$ and so I get $$K=e^{3\cdot0.03}\cdot30 \cdot 1000-30\cdot(10 \cdot e^.03+15\cdot e^.06)=\$32038.27$$ Does my approach work?&lt;/p&gt;&#xA;" OwnerUserId="29948" LastEditorUserId="29948" LastEditDate="2017-10-12T22:26:59.363" LastActivityDate="2017-10-12T22:26:59.363" Title="How to compute the forward price using a replicating portfolio?" Tags="&lt;portfolio&gt;&lt;forward&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36383" PostTypeId="2" ParentId="35832" CreationDate="2017-10-11T12:55:29.377" Score="1" Body="&lt;p&gt;No, all performance scenarios are N-dependent, where N is number of trading periods in the RHP (recommended holding period). In that sense there is no difference between the optimistic, pesimistic, neutral and stress scenarios.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The N has therefore no relation to how many historical returns are you obliged to gather. It only depends on the length of RHP.&lt;/p&gt;&#xA;" OwnerUserId="16818" LastActivityDate="2017-10-11T12:55:29.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36385" PostTypeId="1" AcceptedAnswerId="36404" CreationDate="2017-10-11T15:46:31.917" Score="2" ViewCount="1257" Body="&lt;p&gt;When I am reading papers (ie &lt;a href=&quot;http://www.math.kth.se/matstat/seminarier/reports/M-exjobb12/120119.pdf&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;kth&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;http://www.xaia.com/uploads/media/Bootstrap_XAIA_02.pdf&quot; rel=&quot;nofollow noreferrer&quot; title=&quot;XAIA&quot;&gt;here&lt;/a&gt;) on bootstrapping discount curves they refer to obtaining discount factors from rates for swaps maturing less than a year with:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$D(t, T_i) = \frac{1}{1+s_i(T_i-t)}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(where $s_i$ is the swap rate, $T_i-t$ is the time to maturity in years and $D$ is the discount factor)  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In short my question is why not this?:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$D(t, T_i) = \frac{1}{(1+s_i)^{(T_i-t)}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is the difference because we are assuming there is no compounding?  Is this a correct assumption?  It's quite a key question because the denominator in the bootstrapping formula for tenors &gt; 1 year (because the ois swaps pay annually) depends on this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ D(0,T_i) = \frac{1-s_i\sum_{j=1}^{i-1}(T_j-T_{j-1})D(0,T_j)}{1+s_i(T_i-T_{i-1})} $$&lt;/p&gt;&#xA;" OwnerUserId="29888" LastActivityDate="2017-10-12T14:48:46.153" Title="OIS Discount Factor Bootstrapping - Do we assume simple interest?" Tags="&lt;bootstrapping&gt;&lt;ois-discounting&gt;&lt;discount-factor-curve&gt;&lt;ois&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36386" PostTypeId="1" AcceptedAnswerId="36389" CreationDate="2017-10-11T16:36:53.460" Score="2" ViewCount="116" Body="&lt;ul&gt;&#xA;&lt;li&gt;Yield graphs seem to be predominant.&lt;/li&gt;&#xA;&lt;li&gt;This is in contrast to price graphs in equity based products.&lt;/li&gt;&#xA;&lt;li&gt;I can work out the price if I know the face value, but still -- would imagine for consistency purposes price would be a frequent value measure for both products.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="11655" LastActivityDate="2018-06-08T11:30:42.440" Title="Why bond (individual or their benchmark index) graphs predominantly display yield rather than price?" Tags="&lt;fixed-income&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36387" PostTypeId="1" CreationDate="2017-10-11T18:15:20.697" Score="1" ViewCount="1780" Body="&lt;p&gt;I have a question on the VaR estimation via the student t GARCH model. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under this framework, the one day ahead VaR estimate is calculated by the following formula: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$VaR_{p}=\mu_{t+1}+\sigma_{t+1}\sqrt{\frac{\nu-2}{\nu}}z_{p}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $z_{p}$ is the unconditional student-t quantile of the estimated innovations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you know, for the  parameters estimation of the Student-t GARCH model the corresponding (Student-t) log likelihood function should be maximised (Maximum Likelihood methodology). When this estimation is conducted the $\nu$ (degrees of freedom) is also estimated since it is one of the parameters of the log likelihood function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is if this is the actual $\nu$ (degrees of freedom) that we need to use in the above formula or I have to re-estimate it by fitting the Student-t pdf to the estimated innovations (residuals)? If this is the case can this fitting (parameters estimation) be done via the &lt;strong&gt;fitdist&lt;/strong&gt; MATLAB function (Student-t is not included in the provided range of distributions)?&lt;/p&gt;&#xA;" OwnerUserId="29947" LastEditorUserId="467" LastEditDate="2017-10-12T03:28:47.193" LastActivityDate="2017-10-12T17:16:57.483" Title="VaR : Student-t GARCH" Tags="&lt;programming&gt;&lt;risk&gt;&lt;risk-management&gt;&lt;garch&gt;&lt;value-at-risk&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36389" PostTypeId="2" ParentId="36386" CreationDate="2017-10-11T18:52:29.280" Score="3" Body="&lt;p&gt;You can't show the term structure easily with prices. Say you have 2 bonds, a 5 year at 2% and a 10 year at 3%. If both have coupons of the same, so no premium or discount, they both will trade at $100. There's then no way to see how interest rates should evolve in that chart. This is why we show spot rates--it helps standardize coupon and face value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also, in fixed income we like to compare fixed income products to non-bond securities. You can't compare a bond to the Fed Funds rate on a price basis, for example.&lt;/p&gt;&#xA;" OwnerUserId="29648" LastActivityDate="2017-10-11T18:52:29.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36391" PostTypeId="2" ParentId="36347" CreationDate="2017-10-11T20:19:14.850" Score="1" Body="&lt;p&gt;beta is a measurement of correlation and risk. Calculating beta with a regression can be a solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Beta = covariance / variance&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since Beta represents strength and level of correlation between two different symbols, it is correct to make a linear regression to calculate it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CAPM is influenced by Beta, since the formula is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;CAPM = Rf + Beta * (Rm - Rf)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but I do not think you will affect negatively your CAPM if you compute Beta with a linear regression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do not see any problem related!&lt;/p&gt;&#xA;" OwnerUserId="29954" LastActivityDate="2017-10-11T20:19:14.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36393" PostTypeId="2" ParentId="32993" CreationDate="2017-10-11T21:09:35.183" Score="7" Body="&lt;p&gt;The SABR process is a strict martingale for all values of beta &amp;lt; 1 (in particular, negative betas are fine). If beta = 1, the process is a strict martingale if and only if rho &amp;lt; 0. Under all other circumstances, i.e. beta &gt; 1, or beta = 1 and rho &gt;= 0, the SABR process is a local martingale but not a martingale (it may explode in finite time).&lt;/p&gt;&#xA;" OwnerUserId="29957" LastActivityDate="2017-10-11T21:09:35.183" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36394" PostTypeId="2" ParentId="34874" CreationDate="2017-10-11T22:05:05.817" Score="1" Body="&lt;p&gt;The SABR parameters are typically calibrated daily. Intraday recalibrations may be required on particularly volatile days.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The choice beta = 1 is a popular choice when SABR is used in FX or equity markets, because of the distribution characteristics of the respective asset returns (matched best by beta = 1). In the rates markets, for which SABR was originally developed, beta depends on the option expiration and the underlying tenor.&lt;/p&gt;&#xA;" OwnerUserId="29957" LastActivityDate="2017-10-11T22:05:05.817" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36395" PostTypeId="1" CreationDate="2017-10-11T22:43:26.953" Score="1" ViewCount="259" Body="&lt;p&gt;Using intraday data, are there certain measures that exist for measuring the &quot;activity&quot; of a particular instrument. By intraday data I mean, all changes to the limit order book (trades, adds, cancels, etc.), tick by tick.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, let's say on any average day, this &quot;measure of activity&quot; for Apple stock would be relatively similar, but on a day where Apple is making an earnings release or some big event, I'd expect there to be more trading activity (maybe more adds/cancels, etc.) . &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any particular measures that can help me determine this?&lt;/p&gt;&#xA;" OwnerUserId="27368" LastActivityDate="2017-10-12T17:33:53.090" Title="Metrics for Measuring Intraday Activity" Tags="&lt;market-microstructure&gt;&lt;limit-order-book&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36396" PostTypeId="1" AcceptedAnswerId="36397" CreationDate="2017-10-11T22:44:20.763" Score="0" ViewCount="56" Body="&lt;p&gt;The official solution to this question is B, but I don't understand that if the recommendation is given by the CAPM model, then the CAPM estimated return should be regarded as &quot;fair&quot; and benchmark for comparison. Then the valuation decision should be &lt;em&gt;undervalued&lt;/em&gt; (and hence the answer should be D). Is the official answer wrong?&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Patricia Franklin makes buy and sell stock recommendations using the&#xA;  capital asset pricing model. Franklin has derived the following&#xA;  information for the broad market and for the stock of the CostSave&#xA;  Company (CS):&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;• Expected market risk premium    8%&lt;br&gt;&#xA;  • Risk-free rate    5%&lt;br&gt;&#xA;  • Historical beta for CostSave    1.50  &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Franklin believes that historical betas do not provide good forecasts&#xA;  of future beta, and therefore uses the following formula to forecast&#xA;  beta:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;forecasted beta = 0.80 + 0.20 x historical beta&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;After conducting a thorough examination of market trends and the CS&#xA;  financial statements, Franklin predicts that the CS return will equal&#xA;  10%. Franklin should derive the following required return for CS along&#xA;  with the following valuation decision (undervalued or overvalued):&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;A.    overvalued     8.3%&lt;br&gt;&#xA;  B.    overvalued     13.8%&lt;br&gt;&#xA;  C.    undervalued    8.3%&lt;br&gt;&#xA;  D.    undervalued    13.8%&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="24524" LastActivityDate="2017-10-11T23:16:23.147" Title="Should the valuation decision of the following question be undervalued or overvalued?" Tags="&lt;risk&gt;&lt;finance&gt;&lt;returns&gt;&lt;pricing&gt;&lt;capm&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36397" PostTypeId="2" ParentId="36396" CreationDate="2017-10-11T23:16:23.147" Score="1" Body="&lt;p&gt;The price and the discount rate are inversely related. So if the stock is going to earn a lower return than CAPM predicts/requires, one way to look at it is that you are buying it at too high a price today; so as a CAPM believer you shouldn't buy it at this price, it gives you too low a return, wait for a lower price. In other words the stock is overvalued.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the return is going to be 10%, then the &quot;terminal price&quot; 1 year from now is going to be $P_T=1.1*P_0$ but according to CAPM the price today has to be $\hat{P_0}=\frac{P_T}{1.138}=\frac{1.1*P_0}{1.138}=0.966*P_0$. The equilibrium (or &quot;fair&quot;) price is &lt;em&gt;below&lt;/em&gt; today's price, it needs to come down by 3.33% to be fair.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-10-11T23:16:23.147" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36398" PostTypeId="1" CreationDate="2017-10-12T00:51:55.553" Score="2" ViewCount="707" Body="&lt;p&gt;I would like to explore some listed options trade ideas on the SPX (and maybe later on its components too), and naturally I would need historical data to backtest those ideas.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In my quest for a provider of historical listed SPX option prices, I found the data shop of the CBOE which appears to sell them. Has anyone tried their data? If yes, how good is the quality? Are there a lot of missing or wrong prices and greeks?&lt;/p&gt;&#xA;" OwnerUserId="19693" LastActivityDate="2018-05-17T13:52:20.333" Title="SPX options data from the CBOE data shop" Tags="&lt;options&gt;&lt;market-data&gt;&lt;historical-data&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36400" PostTypeId="1" AcceptedAnswerId="36401" CreationDate="2017-10-12T07:40:11.287" Score="14" ViewCount="5633" Body="&lt;p&gt;I am reading paper High-frequency trading in a limit order book by Marco Avellaneda and Sasha Stoikov. At the end of the paper they obtain a closed-form solution to the optimal market-maker quotes under diffusion without drift. They found that the optimal behaviour of the market-maker would be to set a bid/ask spread of size:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;spread = \gamma\sigma^2(T-t) + \frac{2}{\gamma}ln(1+\frac{\gamma}{k}),&#xA;$$ &#xA;where $\gamma$ is a discount factor, $\sigma^2$ is the variance of the process, $k$ is the parameter corresponing to the intensity of arrival of market orders, $T$ is terminal time and $t$ is curent time, around a reservation price given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;price = s - q\gamma\sigma^2(T-t), &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $q$ is the state of the inventory and $s$ is the current price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I do not see any specification of bounds for this reservation price and therefore I think there is no guarantee that ask prices computed by the market-maker will be higher or bid prices will be lower than the current price of the process. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How is therefore this necessity of market makers' ask prices being higher and bid prices being lower than the actual price enforced in their model (e.g. in their simulations)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Edit:&#xA;To be more concrete, I just specify, that in my opinion, it needs to hold that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;price + spread/2 - s &amp;gt; 0&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lets denote $price$ by $p_{mm}$ and $spread/2$ by $s_{mm}$. Then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;p_{mm} + s_{mm} - s &amp;gt; 0, \\&#xA;s - q\gamma\sigma^2(T-t) + \frac{\gamma\sigma^2(T-t)}{2} + \frac{1}{\gamma}ln(1+\frac{\gamma}{k}) - s &amp;gt;0 \\&#xA;(...) \\&#xA;\frac{1}{2} + \frac{ln(1+\frac{\gamma}{k})}{\gamma^2\sigma^2(T-t)} &amp;gt; q&#xA;$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, this situation does not need to happen, so there is no guarantee he will set prices compatible with current market prices.&lt;/p&gt;&#xA;" OwnerUserId="27163" LastEditorUserId="27163" LastEditDate="2017-10-12T09:28:21.360" LastActivityDate="2020-05-08T09:30:47.527" Title="Avellaneda -Stoikov market making model" Tags="&lt;high-frequency&gt;&lt;market-making&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="16" ContentLicense="CC BY-SA 3.0" />
  <row Id="36401" PostTypeId="2" ParentId="36400" CreationDate="2017-10-12T08:09:14.897" Score="8" Body="&lt;p&gt;The market-maker makes a bid-ask spread $\delta$ around the reservation price $r$. So at any time, the market-maker quotes the bid price&#xA;$$&#xA;p_b = r - \delta/2,&#xA;$$&#xA;and the ask price&#xA;$$ &#xA;p_a = r + \delta/2.&#xA;$$&#xA;Bid price is hence always below the reservation price and ask price is always above the reservation price.&#xA;The reservation price &#xA;$$&#xA;r = s - q\gamma\sigma^2(T-t)&#xA;$$&#xA;is the market price minus a term that depends on the inventory $q$ that the market-maker is holding. If $q$ is positive the reservation price moves lower (below the market price) and vice-versa for negative $q$, reflecting the risk of inventory. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the inventory grows the reserve price will eventually move to a point where the market-maker quotes starts to attract orders to liquidate inventory, which will again result in a change in the reserve price. Orders arrive with probability &#xA;$$&#xA;\lambda_a(\delta^a)dt = Ae^{-k\delta^a}dt,&#xA;$$&#xA;for the ask price and similarly for the bid price. Here $\delta^a$ is the distance of the ask quote from the market price. So if the bid-price gets high enough it will be executed with probability 1, and equivalently if the ask-price gets low enough. The reserve price will hence settle into a state of equilibrium reflecting the risk of inventory. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that there is no requirement that $p_b&amp;lt;s$, or $p_a&amp;gt;s$. The market-maker can post competitive bid and ask prices that improves on the current market price in order to manage the inventory.&lt;/p&gt;&#xA;" OwnerUserId="5107" LastEditorUserId="5107" LastEditDate="2017-10-12T09:03:11.560" LastActivityDate="2017-10-12T09:03:11.560" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="36402" PostTypeId="2" ParentId="18085" CreationDate="2017-10-12T11:20:10.880" Score="0" Body="&lt;p&gt;In case any years data is missing, it gives error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It can be corrected as below :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;df[&quot;YTD&quot;] = df1_GroupedDat['Adj Close'].transform(lambda x: 0 if x.empty else x/x.iloc[0]-1.0)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="29967" LastEditorUserId="26595" LastEditDate="2017-10-14T13:52:22.600" LastActivityDate="2017-10-14T13:52:22.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36403" PostTypeId="2" ParentId="34149" CreationDate="2017-10-12T12:59:56.247" Score="1" Body="&lt;p&gt;VEV can also be negative in the following case (please correct me if I'm wrong):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;for a category 3 product characterized by an uconditional protection of capital, you have to calc the pV. With negative risk free rates, dfs are &gt;1 and thus VaR as a percentage of the invested amount is &gt;1. i.e:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Amount=  10,000 ,Residual=   145 , Risk free=   -0.295% , PV=    10,011.75 , VaR [Price Space]= 1.001174886, VEV=   -0.079% &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does it look OK to you?&lt;/p&gt;&#xA;" OwnerUserId="15921" LastActivityDate="2017-10-12T12:59:56.247" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36404" PostTypeId="2" ParentId="36385" CreationDate="2017-10-12T14:48:46.153" Score="2" Body="&lt;p&gt;An OIS interest rate swap rate with annual-annual freq is determined under one year by:&#xA;$$1 + d_i s_i = \prod_{j=1}^{n(i)}(1+ d_j r_j) \; , \quad \text{where} \quad d_i = \sum_{j=0}^{n(i)} d_j \;.$$&#xA;Each $r_j$ is a forecast overnight OIS rate which as you can see are compounded in the floating side.&#xA;Therefore a discount factor in the future, for maturity $m_i&amp;lt;1Y$, which would be represented by:&#xA;$$ \text{discount factor at }m_i = \frac{1}{\prod_{j=1}^{n(i)}(1+d_jr_j)}=\frac{1}{1+d_is_i}\;.$$&lt;/p&gt;&#xA;" OwnerUserId="29443" LastActivityDate="2017-10-12T14:48:46.153" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36407" PostTypeId="2" ParentId="21942" CreationDate="2017-10-12T16:54:48.117" Score="0" Body="&lt;p&gt;There is some interesting work that can be done by looking at the predictive value of filings. Fintel is doing some work around this - you can see a sample of Baker Brothers performance &lt;a href=&quot;https://fintel.io/i/baker-bros-advisors-lp&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://fintel.io/i/baker-bros-advisors-lp&lt;/a&gt; - for more information, see also &lt;a href=&quot;https://fintel.io/b/2017-8-24-determining-investor-sentiment-in-industries-by-examining-institutional-funds-flow&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://fintel.io/b/2017-8-24-determining-investor-sentiment-in-industries-by-examining-institutional-funds-flow&lt;/a&gt; &#xA;(I am involved with Fintel)&lt;/p&gt;&#xA;" OwnerUserId="29972" LastEditorUserId="29973" LastEditDate="2017-10-14T13:52:14.403" LastActivityDate="2017-10-14T13:52:14.403" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36408" PostTypeId="2" ParentId="36387" CreationDate="2017-10-12T17:10:15.953" Score="2" Body="&lt;p&gt;I think you are mixing the residuals versus the &lt;strong&gt;standardized&lt;/strong&gt; residuals ( 0 mean and unit variance residuals) and/or the student distribution vs the &lt;strong&gt;standardized&lt;/strong&gt; student distribution.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The degree of freedom you obtain from the MLE estimation is the one&#xA;  you should use in the Var formula.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The &lt;strong&gt;standardized&lt;/strong&gt; student Garch model is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Y_{t} = \mu_{t} + \sigma_{t} z_{t} \qquad z_{t} \sim t(0,1,v)\qquad, v&amp;gt;2$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $z_{t}$ are the &lt;strong&gt;standardized&lt;/strong&gt; student innovations (see Bollerslev original formulation).&#xA;You always need to have standardized innovations since the conditional variance of residuals  $ (\epsilon_{t}= \sigma_{t} z_{t})$ must be  equal to $\sigma_{t}^{2}$ :&#xA;$Var(\epsilon_{t}) = \sigma_{t}^{2}$ only if $Var(z_{t})=1$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you fit your model you obtain the residuals : $ \epsilon_{t}= \sigma_{t} z_{t}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the standardized t-innovations are recovered by :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$z_{t} =   \epsilon_{t} \sigma_{t}^{-1} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;MLE estimate is based on the fact that those innovations are IID. The loglikelihood estimation returns arch+garch parameters and parameters of the distribution of the error term : in this case $v$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally the VaR is given by : &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Var_{t} = \mu_{t} + \sigma_{t} st_{\alpha,v}  $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $st_{\alpha,v} $ being the left quantile at $ \alpha $% for the &lt;strong&gt;standardized&lt;/strong&gt; t-distribution with (estimated) number of degrees of freedom ($v$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However if you use a &lt;strong&gt;non&lt;/strong&gt;-standardized t-distribution to express the VaR , and since you know that the variance of the t-distribution is   :  $ Variance(f_{tdist})=\sigma_{tdist}^{2}= \frac{v}{v-2} $&#xA;you can expressed the VaR  by rescaling the student distribution as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation} &#xA;\begin{split}&#xA;Var_{t} &amp;amp; = \mu_{t} + \sigma_{t} st_{\alpha,v} \\&#xA; &amp;amp; = \mu_{t} + \sigma_{t} \left(     t_{\alpha,v }   \sigma_{tdist}^{-1} \right)\\&#xA; &amp;amp; = \mu_{t} + \sigma_{t} \left(     t_{\alpha,v }   \left[\sqrt\frac{v}{v-2}  \right]^{-1} \right)\\&#xA;&amp;amp; = \mu_{t} + \sigma_{t}      t_{\alpha,v }    \sqrt\frac{v-2}{v}    \\&#xA;\end{split}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that $st_{\alpha,v}$  , the standardized t-distribution is different of $t_{\alpha,v}$  the non-standardized t-distribution&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The MLE estimation is based on $st_{\alpha,v}$  , from the estimation you get $v$ and then the factor $ \sqrt\frac{v-2}{v} $ is just a rescaling operation which does not participate to the MLE estimation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Matlab you can use the &lt;a href=&quot;https://fr.mathworks.com/help/stats/prob.tlocationscaledistribution.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;tLocationScaleDistribution&lt;/a&gt; with $\mu =0$ and $\sigma = 1 $.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2017-10-12T17:16:57.483" LastActivityDate="2017-10-12T17:16:57.483" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36409" PostTypeId="2" ParentId="36381" CreationDate="2017-10-12T17:15:47.813" Score="3" Body="&lt;p&gt;It can perhaps be explained more straightforwardly as follows, in terms of what happens at various times:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) At time 0 I (the arbitrageur) borrow $30\cdot S_0$ from a bank and use it to buy 30 assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) At time 3 I still have the 30 assets, and I owe the bank $30\cdot S_0 \cdot e^{.09}$. I also have the dividends which have been temporarily invested and are now worth $30(10⋅e^{.03}+15⋅e^{.06})$ as you said. This is helpful in (partially) repaying the loan. I still need to come up with $$K =30\cdot S_0 \cdot e^{.09}-30(10⋅e^{.03}+15⋅e^{.06})$$ for loan repayment.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you give this amount $K$ at time 3 and I deliver the 30 assets to you, I will break even. So this is the forward price which I/we should agree to today. Numerically the value I get is $K=32038.626$&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2017-10-12T17:15:47.813" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36410" PostTypeId="2" ParentId="36395" CreationDate="2017-10-12T17:23:50.253" Score="1" Body="&lt;p&gt;There is an interesting literature about volume weighted duration. The idea is to measure the activity of a market by measuring the time necessary to exchange a fix amount of stocks. This can be seen as a measure of intra-day activity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can have a look to these papers : &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Gouriéroux, C., Jasiak, J., &amp;amp; Le Fol, G. (1999). Intra-day market activity. Journal of Financial Markets, 2(3), 193–226. &lt;a href=&quot;http://doi.org/10.1016/S1386-4181(99)00004-X&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://doi.org/10.1016/S1386-4181(99)00004-X&lt;/a&gt; item&lt;/li&gt;&#xA;&lt;li&gt;Hautsch, N. (2001). Modelling Intraday Trading Activity Using Box-Cox ACD Models. working paper. Retrieved from &lt;a href=&quot;http://www.ssrn.com/abstract=289643&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.ssrn.com/abstract=289643&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;These models are generally based on Autoregressive Conditional durations models (ACD), see the following excellent survey to get an overview :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Pacurar, M. (2008). Autoregressive conditional Duration (ACD) models in finance: a survey of the theoretical and empirical literature. Journal of Economic Surveys, 1(February). Retrieved from &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/j.1467-6419.2007.00547.x/full&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://onlinelibrary.wiley.com/doi/10.1111/j.1467-6419.2007.00547.x/full&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7008" LastEditorUserId="7008" LastEditDate="2017-10-12T17:33:53.090" LastActivityDate="2017-10-12T17:33:53.090" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36411" PostTypeId="1" AcceptedAnswerId="36414" CreationDate="2017-10-12T18:04:23.683" Score="4" ViewCount="285" Body="&lt;p&gt;I'm having some troubles understanding a problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem:&#xA;&quot;Show how a measure change can be used to estimate the probability for $Y &amp;gt; 100$ when $Y \sim \mathcal{N}(0, 1)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The book I'm using doesn't go through this part that well, so could anyone explain this example?&lt;/p&gt;&#xA;" OwnerUserId="29974" LastEditorUserId="24222" LastEditDate="2017-10-13T06:48:51.943" LastActivityDate="2017-11-03T10:19:02.577" Title="Probability in different measures" Tags="&lt;probability&gt;&lt;risk-neutral-measure&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="36412" PostTypeId="1" AcceptedAnswerId="36468" CreationDate="2017-10-12T18:26:25.930" Score="17" ViewCount="2526" Body="&lt;p&gt;I've recently read &lt;a href=&quot;https://www.math.nyu.edu/faculty/avellane/AvellanedaLeeStatArb071108.pdf&quot; rel=&quot;noreferrer&quot;&gt;Avellaneda &amp;amp; Lee&lt;/a&gt; which seems to be widely recommended as an introduction to Statistical Arbitrage methods in trading. For those who aren't familiar with the paper, the method in the paper (which I'm assuming is similar to other Statistical Arbitrage strategies) is to use the residuals of some factor model (whether it be by PCA or fundamental factors) as the signals to trade. The paper then fits a mean reverting process to the residuals and uses the estimated halflife to bet on the residuals converging to the mean (when they are overstretched).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is two fold - first, I understand that this only works if your factors (PCA or fundamental) span the cross section of returns of the assets in the model (i.e. explain much of the variance). However, if you already knew factors that spanned the cross section of the returns, why wouldn't you trade the actual factors instead of the residual. In other words, if you have a factor model&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathrm{PredictedRet}_{i+1} = \alpha_i + \sum_{i=1}^{N} \beta_i * F_{i} + \epsilon_i$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is reasonably good at explaining the cross section of returns of some universe of securities, why wouldn't you just use your $\mathrm{PredictedRet}$ as the signal instead of some reversion function of the residuals e.g. $\mathrm{Reversion}(\epsilon_{i...N})$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next question is on the implementation in the Avellaneda paper. They seem to only use the residual of the mean reverting process to determine the signal (see pg 20), where&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mathrm{Signal} = \frac{X_i - \mathrm{mean}_i}{\sigma_i}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is essentially some type of z-score on the residual mean reverting process. Now, as far as I can tell, Avellaneda just goes on to trade these signals, without hedging the factors of the factor model out. So it could be the case where your factor model is predicting a very bullish outcome however the residual z score happens to be slightly positive, resulting in a negative trade signal (vs the very bullish signal from the factor model prediction).  Are you supposed to trade these statistical arbitrage strategies factor neutral (and why isn't that being done in the Avellaneda paper)?&lt;/p&gt;&#xA;" OwnerUserId="16680" LastEditorUserId="19663" LastEditDate="2017-10-14T21:41:19.320" LastActivityDate="2017-10-16T17:27:53.723" Title="statistical arbitrage vs factor trading" Tags="&lt;quant-trading-strategies&gt;&lt;arbitrage&gt;&lt;statistical-finance&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="36414" PostTypeId="2" ParentId="36411" CreationDate="2017-10-12T20:01:56.610" Score="11" Body="&lt;p&gt;In order to estimate a probability of an event with small probability, you might want to try to estimate the probability for a changed random variable that allocates a larger probability mass for the event happening. So, in your case, you might want to change the original $N(0, 1)$ to $N(100, 1)$ because for the second r.v. the probability of it being higher than 100 is $\frac{1}{2}$. So, you are looking for a change of measure in form:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{dQ}{dP} = \frac{dN(0,1)}{dN(100,1)} = exp(-100y+5000),&#xA;$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Q$ is the probability measure associated with $N(0, 1)$ and $P$ is the probability measure associated with $N(100, 1)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;And therefore for an event $A = \{Y &amp;gt; 100\}$ by the Radon-Nikodym theorem we can obtain:&#xA;$$&#xA;Q(A) = E_{P}[exp(-100Y+5000)I(A)] \approx \frac{1}{n} \sum_{i=1}^{n} e^{-100y_i + 5000} I(y_i &amp;gt; 100) \\&#xA;= e^{-5000}  \frac{1}{n} \sum_{i=1}^{n} e^{-100(y_i-100)} I(y_i &amp;gt; 100)&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By running, for example this C++ code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#include &amp;lt;vector&amp;gt;&#xA;#include &amp;lt;random&amp;gt;&#xA;#include &amp;lt;iostream&amp;gt;&#xA;int main()&#xA;{&#xA;    std::vector&amp;lt;long double&amp;gt; estimation;&#xA;    int simulation_length { 1000000 };&#xA;    std::default_random_engine generator;&#xA;    std::normal_distribution&amp;lt;long double&amp;gt; distribution(100.0, 1.0);&#xA;    long double pick;&#xA;    long double estimation_sum { 0.0 };&#xA;&#xA;    for (int i = 0; i != simulation_length; ++i)&#xA;    {&#xA;        pick = distribution(generator);&#xA;        if (pick &amp;gt; 100)&#xA;        {&#xA;            estimation.push_back(exp(-100 * (pick - 100)));&#xA;        }&#xA;    }&#xA;&#xA;    for (double i : estimation)&#xA;    {&#xA;        estimation_sum += i;&#xA;    }&#xA;&#xA;    std::cout &amp;lt;&amp;lt; estimation_sum / simulation_length &amp;lt;&amp;lt; std::endl;&#xA;&#xA;    return 0;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;you get the output 0.00400264. By multiplying it by exp(-5000) you get 1.34876725857872×10^(-2174), which is very close to the true value (i.e. 1.34417907674465×10^(-2174), obtained through Mathematica)&lt;/p&gt;&#xA;" OwnerUserId="27163" LastEditorUserId="27163" LastEditDate="2017-11-03T10:19:02.577" LastActivityDate="2017-11-03T10:19:02.577" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36415" PostTypeId="2" ParentId="36386" CreationDate="2017-10-12T20:13:02.600" Score="2" Body="&lt;p&gt;Investing in equities is different than investing in bonds. With equities, you don't know the outcome. When you invest today and sell in five years, you don't know if the investment will be positive or negative. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Investing in bonds is different, because you know that the outcome is 100 (with the exception that the bond will default). As you know the actual price and the annual yields income in the next years, you are able to calculate the ratio of INPUT / OUTPUT, and hence the yield. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;With equities, you can also calculate your ratio Input / Output, but only &lt;em&gt;after&lt;/em&gt; selling your equities. With bonds, you can calculate it &lt;em&gt;before&lt;/em&gt; investing. &lt;/p&gt;&#xA;" OwnerUserId="22515" LastActivityDate="2017-10-12T20:13:02.600" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36417" PostTypeId="2" ParentId="32842" CreationDate="2017-10-12T20:25:21.013" Score="1" Body="&lt;p&gt;Thomson Reuters has that data for all listed companies worldwide and their reporting currency (but expensive). &lt;/p&gt;&#xA;" OwnerUserId="22515" LastActivityDate="2017-10-12T20:25:21.013" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36418" PostTypeId="2" ParentId="32973" CreationDate="2017-10-12T20:36:02.067" Score="4" Body="&lt;p&gt;For me as a beginner, the best book was &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Technical Analysis of the Financial Markets&lt;/strong&gt;: A Comprehensive Guide to&#xA;  Trading Methods and Applications&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;from &lt;em&gt;John Murphy&lt;/em&gt;. It was published in 1999 (or so), but has still value. The book describes the base concept of trends, the history of beginning, the oszillators and ratios very well. You should read it. I still use it sometimes. &lt;/p&gt;&#xA;" OwnerUserId="22515" LastActivityDate="2017-10-12T20:36:02.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36419" PostTypeId="2" ParentId="25472" CreationDate="2017-10-12T21:07:00.267" Score="1" Body="&lt;p&gt;Some years ago, I've calculated a 29-day SMA backtesting in Excel with consideration that buying and selling is not able at the same close day where the signal is generated. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&lt;strong&gt;Don't forget the transaction costs!&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;When &lt;strong&gt;transaction costs&lt;/strong&gt; would be &lt;strong&gt;0%&lt;/strong&gt; (...or not included) the performance would look like this: &#xA;&lt;a href=&quot;https://i.stack.imgur.com/W9aer.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/W9aer.png&quot; alt=&quot;Performance without transaction costs&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When &lt;strong&gt;transaction costs&lt;/strong&gt; would be &lt;strong&gt;0.45%&lt;/strong&gt; the performance would look like this: &#xA;&lt;a href=&quot;https://i.stack.imgur.com/VQer5.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/VQer5.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When &lt;strong&gt;transaction costs&lt;/strong&gt; would be &lt;strong&gt;1%&lt;/strong&gt;, the strategy would go bankrupt just some years after launching (do you see the blue line at the bottom?): &#xA;&lt;a href=&quot;https://i.stack.imgur.com/YJq5i.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/YJq5i.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="22515" LastActivityDate="2017-10-12T21:07:00.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36420" PostTypeId="1" AcceptedAnswerId="36461" CreationDate="2017-10-12T21:49:29.860" Score="2" ViewCount="1015" Body="&lt;p&gt;In his book, &quot;Why Stock Markets Crash&quot;, Didier Sornette discusses a trading strategy that exploits return correlations.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Consider a return $r$ that occurred at time $t$ and a return $r'$ that&#xA;  occurred at a later time $t'$, where $t$ and $t'$, are multiples of&#xA;  some time unit (say 5 minutes). $r$ and $r'$ can be decomposed into an&#xA;  average contribution and a varying part. We are interested in&#xA;  quantifying the correlation $C(t, t')$ between the uncertain varying&#xA;  part, which is defined as the average of the product of the varying&#xA;  part $r$ and of $r'$ normalized by the variance (volatility) of the&#xA;  returns, so that $C(t, t' = t) = 1$ (perfect correlation between $r$&#xA;  and itself). &lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;A simple mathematical calculation shows that the best linear predictor&#xA;  $m_t$ for the return at time $t$, knowing the past history $r_{t-1},&#xA;\&amp;gt; r_{t-2}, \ldots ,r_i, \ldots,$ is given by&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;$$m_t\equiv\frac{1}{B(t, t)}\sum_{i&amp;lt;t} B(i, t)r_i,$$&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;where each $B(i, t)$ is a factor that can be expressed in terms of the&#xA;  correlation coefficient $C(t', t)$ and is usually called the&#xA;  coefficient $(i, t)$ of the inverse correlation matrix. This formula&#xA;  expresses that each past return $r_i$ impacts on the future return&#xA;  $r_t$ in proportion to its value with a coefficient $B(i, t)/B(t, t)$&#xA;  which is nonzero only if there is nonzero correlation between time $i$&#xA;  and time $t$. With this formula, you have the best linear predictor in&#xA;  the sense that it will minimize the errors in variance. Armed with&#xA;  this prediction, you have a powerful trading strategy: buy if $m_t \&amp;gt;&#xA;&amp;gt; 0$ (expected future price increase) and sell if $m_t &amp;lt; 0$ (expected&#xA;  future price decrease).&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I'm trying to solve for $m_t$ given the following dataset...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;+----------+-----------------+&#xA;| t        | r               |&#xA;+----------+-----------------+&#xA;| 15:50:00 | 0.003705090715  |&#xA;| 15:51:00 | 0.003873999746  |&#xA;| 15:52:00 | 0.002158853672  |&#xA;| 15:53:00 | 0.001246754886  |&#xA;| 15:54:00 | 0.005646756563  |&#xA;| 15:55:00 | -0.001073638262 |&#xA;| 15:56:00 | -0.001804395665 |&#xA;| 15:57:00 | 0.002322446782  |&#xA;| 15:58:00 | 0.001803468933  |&#xA;| 15:59:00 | -0.001686730014 |&#xA;| 16:00:00 | 0.0008781111203 |&#xA;+----------+-----------------+&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;First I create a matrix for time lags $r_{t}, r_{t-1}, r_{t-2}, r_{t-3}, r_{t-4}$, called $\color{blue}{\mathbf M}$...&#xA;$$&#xA; \begin{bmatrix}&#xA; \color{blue}{0.00087811} &amp;amp; \color{blue}{-0.00168673} &amp;amp;  \color{blue}{0.00180347} &amp;amp;  \color{blue}{0.00232245} &amp;amp; -0.0018044  \\&#xA;-0.00168673 &amp;amp;  0.00180347 &amp;amp;  0.00232245 &amp;amp; -0.0018044  &amp;amp; -0.00107364 \\&#xA; 0.00180347 &amp;amp;  0.00232245 &amp;amp; -0.0018044  &amp;amp; -0.00107364 &amp;amp;  0.00564676 \\&#xA; 0.00232245 &amp;amp; -0.0018044  &amp;amp; -0.00107364 &amp;amp;  0.00564676 &amp;amp;  0.00124675 \\&#xA;-0.0018044  &amp;amp; -0.00107364 &amp;amp;  0.00564676 &amp;amp;  0.00124675 &amp;amp;  0.00215885 \\&#xA; \end{bmatrix}&#xA;$$&#xA;With $\color{blue}{\mathbf M}$ I am able to create a correlation matrix, called $\color{green}{\mathbf C}$...&#xA;$$&#xA; \begin{bmatrix}&#xA; 1.         &amp;amp;  \color{green}{-0.15885375} &amp;amp; -0.88120533 &amp;amp;  0.52518141 &amp;amp;  0.32904361 \\&#xA;-0.15885375 &amp;amp;  1.         &amp;amp; \color{green}{-0.27689212} &amp;amp; -0.87324435 &amp;amp;  0.43345156 \\&#xA;-0.88120533 &amp;amp; -0.27689212 &amp;amp;  1.         &amp;amp; \color{green}{-0.16496963} &amp;amp; -0.38678436 \\&#xA; 0.52518141 &amp;amp; -0.87324435 &amp;amp; -0.16496963 &amp;amp;  1.         &amp;amp; \color{green}{-0.18292072} \\&#xA; 0.32904361 &amp;amp;  0.43345156 &amp;amp; -0.38678436 &amp;amp; -0.18292072 &amp;amp;  1.         \\&#xA; \end{bmatrix}&#xA;$$&#xA;and its inverse, called $\color{red}{\mathbf I}$...&#xA;$$&#xA; \begin{bmatrix}&#xA; \color{red}{678.1834365} &amp;amp;  -47.5405215 &amp;amp; 305.9166473 &amp;amp; -205.4095813 &amp;amp; -138.3472675 \\&#xA; -47.5405215 &amp;amp;  557.4221492 &amp;amp;  89.6736779 &amp;amp;  245.3640449 &amp;amp; -138.7710611 \\&#xA; 305.9166473 &amp;amp;   89.6736779 &amp;amp; 111.2290498 &amp;amp;  -89.4926475 &amp;amp;   61.0341470 \\&#xA;-205.4095813 &amp;amp;  245.3640449 &amp;amp; -89.4926475 &amp;amp;  323.4950056 &amp;amp;   -2.4011426 \\&#xA;-138.3472675 &amp;amp; -138.7710611 &amp;amp;  61.0341470 &amp;amp;   -2.4011426 &amp;amp;  120.3071511 \\&#xA; \end{bmatrix}&#xA;$$&#xA;Next I solve for...&#xA;$$&#xA;\sum_{i&amp;lt;t} \color{green}{B(i, t)}\color{blue}{r_i},&#xA;$$&#xA;as follows...&#xA;$$&#xA;\color{green}{\mathbf{C}[0][1]} \left( \color{blue}{\mathbf{M}[0][0]} \right) +&#xA;\color{green}{\mathbf{C}[1][2]} \left( \color{blue}{\mathbf{M}[0][1]} \right) +&#xA;\color{green}{\mathbf{C}[2][3]} \left( \color{blue}{\mathbf{M}[0][2]} \right) +&#xA;\color{green}{\mathbf{C}[3][4]} \left( \color{blue}{\mathbf{M}[0][3]} \right) = -0.000394790246734&#xA;$$&#xA;Finally I multiply by $\frac{1}{B(t,t)}$ which &lt;em&gt;I think&lt;/em&gt; is equal to $\color{red}{\mathbf{I}[0][0]}$...&#xA;$$&#xA;\begin{align}&#xA;m_t &amp;amp; = -0.000394790246734\left( \frac{1}{B(t,t)} \right) \\&#xA;&amp;amp; = -0.000394790246734\left( \color{red}{\mathbf{I}[0][0]} \right) \\&#xA;&amp;amp; = -0.000394790246734\left( 678.1834365 \right) \\ &#xA;&amp;amp; = -0.267740206251 \\&#xA;\end{align}&#xA;$$&#xA;Did I solve for $m_t$ correctly?&lt;/p&gt;&#xA;" OwnerUserId="22700" LastEditorUserId="22700" LastEditDate="2017-10-16T02:32:20.003" LastActivityDate="2020-07-22T02:56:04.090" Title="Didier Sornette's Strategy to Exploit Return Correlations" Tags="&lt;quant-trading-strategies&gt;&lt;correlation-matrix&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="36427" PostTypeId="1" AcceptedAnswerId="36435" CreationDate="2017-10-13T07:00:38.337" Score="0" ViewCount="194" Body="&lt;p&gt;If the probability distribution function $f(x)$ is not symmetric, is there any relationship between $VaR_{\alpha}(X)$ and $VaR_{1-\alpha}(X)$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, $VaR$ is defined as &#xA;$$&#xA;VaR_{\alpha}(X) := \inf\left\{x \in \mathbb{R}| Pr(X&amp;gt;x)\leq \alpha\right\}, \alpha \in [0, 1].&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="29773" LastActivityDate="2017-10-13T12:53:47.820" Title="What's the relationship between $VaR_{\alpha}(X)$ and $VaR_{1-\alpha}(X)$ if the probability distribution function is not symmetric?" Tags="&lt;probability&gt;&lt;value-at-risk&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36429" PostTypeId="2" ParentId="17441" CreationDate="2017-10-13T07:44:00.143" Score="0" Body="&lt;p&gt;Doing some more research I found the very recent publication and would like to share it for interested readers of the question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2968896&quot; rel=&quot;nofollow noreferrer&quot;&gt;Parameter Estimation from Overlapping Observations&lt;/a&gt;. This work is done in the setting of Brownian motion with drift and finds very explicite formulas for the bias (and how to correct it).&#xA;From the abstract:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;This paper examines parameter estimation (mean, volatility and&#xA;  correlation) for correlated Brownian processes that makes use of&#xA;  overlapping return observations. We derive the minimum variance&#xA;  unbiased estimators within the space of linear (for the mean) and&#xA;  quadratic (for the variance and covariance) combinations of the&#xA;  observations.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2017-10-13T07:44:00.143" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36430" PostTypeId="1" CreationDate="2017-10-13T07:50:50.077" Score="1" ViewCount="717" Body="&lt;p&gt;Are there any market practices to extrapolate the volatility smile for equities? I already have an arbitrage free interpolated call prices data and I'm looking for a method to extrapolate beyond the last available data.&#xA;I tried the method described here : S. Benaim, M. Dodgson, and D. Kainth. An arbitrage-free method for smile extrapolation. Technical&#xA;report, Royal Bank of Scotland, 2008. 1, 2, but I  have arbitrageable prices (Plus there is no indication that beyond the vicinity of the last point, we obtain arbitrage free prices.&lt;/p&gt;&#xA;" OwnerUserId="27976" LastActivityDate="2017-10-13T09:36:34.523" Title="Extrapolation of the volatility smile" Tags="&lt;arbitrage&gt;&lt;volatility-smile&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36431" PostTypeId="1" AcceptedAnswerId="36434" CreationDate="2017-10-13T09:02:25.843" Score="-1" ViewCount="777" Body="&lt;p&gt;Let me ask you about the following rationale regarding stress scenario (IV Annex 10 (c)):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot; Identify for each sub interval of length w the historical lognormal returns rt, where t=t0, t1, t2, …, tN. &quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I find myself wondering what the t0,...,tN are: in fact, given that RTS only mentions for historical data of up to 5 years, I interprete the above as saying that t0,...,tN should be the 5 years data used in the rest performance scenarios as well. Otherwise the RTS should be more specific of how and where exactly these &quot;new data&quot; come from.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would you agree to that interpretation or are you of the opinion that for stress purposes one needs to get more historical data?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much in advance for your answer!&lt;/p&gt;&#xA;" OwnerUserId="29984" LastActivityDate="2020-07-14T10:02:33.983" Title="PRIIPs Stress Scenario" Tags="&lt;priips&gt;&lt;regulation&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36432" PostTypeId="2" ParentId="36430" CreationDate="2017-10-13T09:36:34.523" Score="3" Body="&lt;p&gt;I'm a fan of fitting a distribution, and then implying vols from that in the wings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You'll get an arbitrage free surface, that makes sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A very simple example is to use gaussians to build a pdf, and then numerically price the options from it. Here's an example fitting FTSE options using just 2 gaussians to create the implied pdf and resulting smile:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/pB5DE.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/pB5DE.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where the fit to the options is good:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/geBGZ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/geBGZ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You're of course free to use other distributions as your basis functions to create your pdf, as well as mixtures of different functions - what i liike about doing this is that you get a very nice smooth distribution. No spline nodes causing weird behaviour in the derivatives, and it integrates to 1.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You just price the options by numerically integrating your pdf.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I welcome anyone to point me at a particularly nasty smile from the past and i will happily fit it and put the results here.&lt;/p&gt;&#xA;" OwnerUserId="19663" LastActivityDate="2017-10-13T09:36:34.523" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="36434" PostTypeId="2" ParentId="36431" CreationDate="2017-10-13T11:24:55.000" Score="1" Body="&lt;p&gt;I interpreted it as the rolling standard deviation in 21 or 63 day Windows for the whole five years (less 21 or 63 days respectively) depending on whether you are doing one year or longer stress scenarios. I believe some think that the one year stress scenario means you only go back one year with the 21 day rolling window but this would surely be inconsistent with the other scenarios where regardless of the RHP you still use the maximum amount of historic returns.&lt;/p&gt;&#xA;" OwnerUserId="29976" LastActivityDate="2017-10-13T11:24:55.000" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36435" PostTypeId="2" ParentId="36427" CreationDate="2017-10-13T12:53:47.820" Score="1" Body="&lt;p&gt;No, because the VaR is defined as a quantil. For example, you have the loss-vector l=(-1,-2,3,4,5,6,7,8,9,10). The VaR(90%) is 9. And it is also VaR(90%)=9, if you have l=(8,8,8,8,8,8,8,8,9,10). The VaR is independent of the values before and after his value. This is also a disadvantage of the VaR and one reason to take also the expected shortfall (mean of the losses that are bigger than the VaR).&lt;/p&gt;&#xA;" OwnerUserId="29963" LastActivityDate="2017-10-13T12:53:47.820" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="36436" PostTypeId="2" ParentId="36374" CreationDate="2017-10-13T14:13:32.833" Score="1" Body="&lt;p&gt;In portfolio models there are not included the correlation of credit events but the correlation of the returns of each issuer. Is that the same that you are searching for?&#xA;If yes, then you can calculate the the correlation as a parameter of the model and you do not need a proxy. If you have the parameters you can get the whole distribution with a monte carlo simulation. &lt;/p&gt;&#xA;" OwnerUserId="29963" LastActivityDate="2017-10-13T14:13:32.833" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36440" PostTypeId="1" AcceptedAnswerId="36444" CreationDate="2017-10-14T10:41:24.627" Score="-2" ViewCount="453" Body="&lt;p&gt;Straightforward question;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to find dividend yields of the S&amp;amp;P 500 on a daily basis (or at least the dividends of the S&amp;amp;P 500)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have been looking everywhere and can't find anything on daily frequency. I am almost convinced that they do not come in daily data; but one cannot always be so sure.&lt;/p&gt;&#xA;" OwnerUserId="27901" LastEditorUserId="27901" LastEditDate="2017-10-14T10:58:34.857" LastActivityDate="2020-05-02T13:42:31.873" Title="Dividend Yields of the S&amp;P500" Tags="&lt;historical-data&gt;&lt;dividends&gt;&lt;yield&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36441" PostTypeId="1" AcceptedAnswerId="36442" CreationDate="2017-10-14T12:29:22.633" Score="0" ViewCount="3508" Body="&lt;p&gt;I would like to ask about swap zero curve calculation algorithm by Bloomberg terminal. This is a plain vanilla CZK interest rate swap, fixing the Prague IBOR. My task is to calculate zero rates from market rates, however I have only managed to get accurate zero rates from 2 years onwards. I tried to bootstrap spot rates from FRAs (CKFR0F1 is FRA 6x12 and CKFR011 is 12x18) with this formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$(1+r_{0;t_{0}}\frac{t_{0}}{360})*(1+r_{t_{0};t_{0}+t{u}}\frac{t_{u}}{360})= (1+r_{0;t_{0}+t{u}}\frac{t_{u}+t_{0}}{360})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $r_{0;t_{0}}= 0.0056$, $r_{t_{0};t_{0}+t{u}} = 0.0095$, $t_{0}=182$ and $t_{u}=183$. By solving this equation I get $r_{0;t_{0}+t{u}}=r_{0;1}= 0.007568827$, which is off only by a tiny fraction. I guess the mistake will be in day count conventions, however this is the closest I have come to the correct solution. Can someone explain how the calculation should be done? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have also attached screenshots of the swap yield curve and cash-flows.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/eHdDZ.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/eHdDZ.jpg&quot; alt=&quot;Swap cash-flows&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/bRQZL.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/bRQZL.jpg&quot; alt=&quot;Swap zero curve screenshot&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="29999" LastActivityDate="2018-09-28T10:35:11.920" Title="Bloomberg terminal swap zero curve calculation" Tags="&lt;swaps&gt;&lt;discounting&gt;&lt;irs&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36442" PostTypeId="2" ParentId="36441" CreationDate="2017-10-14T16:04:37.750" Score="1" Body="&lt;p&gt;It looks like you should use a different convention for the zero rates. I tried the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\left(1+r_{0;t_{0}}\frac{t_{0}}{360}\right) \times \left(1+r_{t_{0};t_{0}+t{u}}\frac{t_{u}}{360}\right) =  \left(1+r_{0;t_{0}+t{u}}\right)^{\frac{t_{u}+t_{0}}{360}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Solving with the same input gives $r_{t_{0};t_{0}+t{u}}=0.00756843$, in agreement with Bloomberg.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The right hand side convention kicks in because $(t_u+t_0)/360 &amp;gt; 1~year$. It's a convention used for zero rates, and it looks Bloomberg is using it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only source I'm aware of which treats this convention is Brigo and Mercurio:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://books.google.ie/books?id=C31l_fs-mMkC&amp;amp;lpg=PA57&amp;amp;pg=PA9#v=onepage&amp;amp;q&amp;amp;f=false&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://books.google.ie/books?id=C31l_fs-mMkC&amp;amp;lpg=PA57&amp;amp;pg=PA9#v=onepage&amp;amp;q&amp;amp;f=false&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="3371" LastEditorUserId="848" LastEditDate="2017-10-14T16:46:14.837" LastActivityDate="2017-10-14T16:46:14.837" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36444" PostTypeId="2" ParentId="36440" CreationDate="2017-10-14T18:40:17.743" Score="2" Body="&lt;p&gt;I imagine the easiest way to do this is to infer from the price index and the total return index.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Recall that the daily total return is (roughly)&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ TR = \frac{P_{t-1} + d_t}{P_t} - 1, $$&lt;/span&gt;&#xA;while the price index is simply&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ PR = \frac{P_{t-1}}{P_t} - 1,$$&lt;/span&gt;&#xA;where &lt;span class=&quot;math-container&quot;&gt;$P_t$&lt;/span&gt; is the index level at time &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$d_t$&lt;/span&gt; is the dividend (in index points) at time &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As an example, S&amp;amp;P 500 returned -0.168675% on 10/12/2017, while the S&amp;amp;P 500 total return index returned -0.160054%. The difference of 0.008621% reflects the impact of dividends. Given the index level of 2555.23999, this implies a dividend (in points) of 0.02200424 points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To translate this into a dividend yield equivalent, you would need to calculate this daily, take the 1-year moving sum and divide by the index level.&lt;/p&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="26595" LastEditDate="2020-05-02T13:42:31.873" LastActivityDate="2020-05-02T13:42:31.873" CommentCount="2" ContentLicense="CC BY-SA 4.0" />
  <row Id="36445" PostTypeId="1" AcceptedAnswerId="38774" CreationDate="2017-10-14T21:30:31.117" Score="1" ViewCount="584" Body="&lt;p&gt;This question is to do with a paragraph in Hull (Options and other Derivatives)&#xA;He explains that Stock Prices usually follow a Markov Property, where the current price of the stock contains all the information of the past, and that the path taken by the Stock is irrelevant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;He gives an example saying: &quot;All investors watch stock prices closely. Suppose that a pattern is discovered in a Stock Price that always gave a 65% chance of steep price rises. Therefore, Investors would attempt to buy the stock immediately, and the demand for the stock would rise. This would lead to an immediate increase in price and the observed effect would be eliminated, as would any trading opportunities.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't get why the observed effect would be eliminated? Didn't the Stock Price actually rise as was predicted? I.e, if the price was expected to rise in the first place, wouldn't the strategies have worked?  &lt;/p&gt;&#xA;" OwnerUserId="28090" LastActivityDate="2018-03-14T17:19:52.797" Title="Why does the Weak Form of Market Efficiency and Markov Property hold?" Tags="&lt;equities&gt;&lt;time-series&gt;&lt;markov&gt;&lt;market-efficiency&gt;" AnswerCount="2" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36447" PostTypeId="1" CreationDate="2017-10-14T21:58:01.117" Score="4" ViewCount="153" Body="&lt;p&gt;What is the difference between the realized volatility (also called historical volatility) and the fundamental volatility?&lt;/p&gt;&#xA;" OwnerUserId="25265" LastActivityDate="2017-10-14T21:58:01.117" Title="Realized volatility vs Fundamental volatility" Tags="&lt;volatility&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36449" PostTypeId="1" AcceptedAnswerId="36456" CreationDate="2017-10-14T22:50:51.857" Score="4" ViewCount="144" Body="&lt;p&gt;I'm reading both the &lt;a href=&quot;https://en.wikipedia.org/wiki/Covered_bond&quot; rel=&quot;nofollow noreferrer&quot;&gt;wikipedia page&lt;/a&gt; and &lt;a href=&quot;http://www.investopedia.com/terms/c/coveredbond.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;investopedia page&lt;/a&gt; about covered bonds, and I'm not sure I understand its definition.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From what I could tell a covered bond it's a 'lump' of other loans put together, and sold to someone. Let's say financial institution A sells it to investor B. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case of insolvency by A, B has the right to the  scheduled interest payments from the underlying assets of the bonds, as well as the principal at the bond’s maturity, and if it's not enough also to other assets from the issuer of the bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why would the fact of the underlying loans of a covered bond staying on the balance sheet of the financial institution during the 'duration' of the bond provide some sort of protection to investor B? Is it because, in this way, it eliminates possibility of the institution to sell its bad loans to other investors?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any help would be appreciated.&lt;/p&gt;&#xA;" OwnerUserId="9499" LastEditorUserId="9499" LastEditDate="2017-10-15T13:58:51.510" LastActivityDate="2017-10-15T16:18:08.700" Title="What's a covered bond?" Tags="&lt;fixed-income&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36450" PostTypeId="1" CreationDate="2017-10-15T07:36:09.000" Score="2" ViewCount="554" Body="&lt;p&gt;If a time series follows a Brownian motion (BM), is it true that the inverse ts and reverse chronological ts is also a BM?&lt;/p&gt;&#xA;&lt;p&gt;What if the ts exhibits mean reversion tendencies? Would these tendencies become a momentum tendencies?&lt;/p&gt;&#xA;&lt;p&gt;Is this a useful/common field of studies in the quant world?&lt;/p&gt;&#xA;" OwnerUserId="30010" LastEditorUserId="19645" LastEditDate="2021-05-05T08:53:08.943" LastActivityDate="2021-05-05T08:53:08.943" Title="Reverse chronological time series / inverse time series" Tags="&lt;time-series&gt;&lt;brownian-motion&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="36451" PostTypeId="2" ParentId="36445" CreationDate="2017-10-15T08:17:04.150" Score="0" Body="&lt;p&gt;Its best to think of market efficiency from 2 perspectives - the statiscian's and the trader's. The statiscian's market efficiency incorporates a lot of simplyfying assumptions (e.g. frictionless markets), while the trader's denotes the absence of opportunities with a risk/return profile in excess of the market (in practice, this would incorporate all the financial and time costs that drag on performance).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Think of it within the context of a market exchange. The market makers who facilitate trades would want to protect themselves against adverse selection from traders who knew about this &quot;inefficiency&quot;. If there were repeated patterns that caused everyone to buy, market makers would quickly learn to adjust prices in anticipation of the imbalanced trading, which eliminates those opportunities. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The price would rise, but your opportunity as a trader to benefit from this information would be limited.&lt;/p&gt;&#xA;" OwnerUserId="30011" LastActivityDate="2017-10-15T08:17:04.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36452" PostTypeId="1" AcceptedAnswerId="36462" CreationDate="2017-10-15T08:41:54.087" Score="1" ViewCount="279" Body="&lt;p&gt;The Actual/Actual AFB day count convention is explained on Wikipedia &lt;a href=&quot;https://en.wikipedia.org/wiki/Day_count_convention#Actual.2FActual_AFB&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;. I'll condense the rules here the way I understood them.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;Factor = Days(Date1,Date2)/DiY&lt;/li&gt;&#xA;  &lt;li&gt;If 29th february is in date range from Date1 (inclusive) to Date2 (exclusive), DiY=366 else DiY=365&lt;/li&gt;&#xA;  &lt;li&gt;If date range from Date1 to Date2 spans multiple years, calculation is split in two parts:&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;Number of complete years counted back from the last day in the period&lt;/li&gt;&#xA;  &lt;li&gt;The remaining initial stub, calculated using the basic rule&lt;/li&gt;&#xA;  &lt;li&gt;ISDA additional rule: If counting backwards for multiple years, if the last day of the relevant period is 28 February the full year should be counted back to 28 February unless 29 February exists in which case 29 February should be used.&lt;/li&gt;&#xA;  &lt;/ul&gt;&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Now consider the case &lt;code&gt;Date1 = 2004-02-28&lt;/code&gt; and &lt;code&gt;Date2 = 2008-02-28&lt;/code&gt;. Applying the rules gives:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;4 full years&lt;/li&gt;&#xA;&lt;li&gt;Date2' = 2004-02-29 [rebased Date2 by counting back + ISDA additional rule]&lt;/li&gt;&#xA;&lt;li&gt;DiY = 365, because: Date1 = 2004-02-28, Date2' = 2004-02-29; 29 February is not in date range from Date1 (inclusive) and Date2' (exclusive) i.e. the remaining initial stub&lt;/li&gt;&#xA;&lt;li&gt;Factor = 4 + 1/365&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;However, in the example on the Wikipedia page I linked to at the top it shows for those same two dates that &lt;code&gt;Factor = 4 + 1/366&lt;/code&gt;. Which factor is correct? And if the result of the Wikipedia page is correct, where did I go wrong with my reasoning?&lt;/p&gt;&#xA;" OwnerUserId="20033" LastEditorUserId="20033" LastEditDate="2017-10-15T08:49:03.450" LastActivityDate="2017-10-16T05:42:28.277" Title="Day count convention Actual/Actual AFB; Factor for Date1 = 2004-02-28 and Date2 = 2008-02-28" Tags="&lt;finance&gt;&lt;bond&gt;&lt;daycounting&gt;&lt;accrued-interest&gt;" AnswerCount="1" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="36456" PostTypeId="2" ParentId="36449" CreationDate="2017-10-15T12:20:03.520" Score="5" Body="&lt;p&gt;The fact that the underlying loans stay on the issuer balance sheet provides protection to the investor because if any of the loans defaults, the issuer has to replace it by another healthy loan.  That would not be the case in a CLO for example, where the loans have been sold into an issuance vehicle separate from the parent company.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-10-15T12:20:03.520" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36457" PostTypeId="2" ParentId="7181" CreationDate="2017-10-15T14:49:04.187" Score="0" Body="&lt;p&gt;Check this: &lt;a href=&quot;http://allenfrostline.com/2017/03/12/strategy-xgboost-classification-technical-indicators/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://allenfrostline.com/2017/03/12/strategy-xgboost-classification-technical-indicators/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have used RF as well and obtained comparable results:&#xA;&lt;a href=&quot;https://www.researchgate.net/publication/315542322_Exposition_on_Random_Forest_A_stock_example&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.researchgate.net/publication/315542322_Exposition_on_Random_Forest_A_stock_example&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These have been combined into a single paper which also talks about specific stocks from Big pharma companies. Email me if you need that.&lt;/p&gt;&#xA;" OwnerUserId="30013" LastActivityDate="2017-10-15T14:49:04.187" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36458" PostTypeId="2" ParentId="36449" CreationDate="2017-10-15T16:18:08.700" Score="6" Body="&lt;p&gt;Dm63 has already compared a CLO to a CoveredBond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's compare a normal bank bond to a Pfandbrief or Covered Bond. Legal textbooks say that the normal bond is covered by some unidentified portion of the assets (including loans) the Bank has. But this is only a general, abstract statement. The details will be determined later, if the Bank has difficulty paying its creditors. A complicated procedure will be used to determine what the loans are worth (which may or may not involve selling them to a 3d party), how much is owed to different creditors (different classes of bonds for example) and who will receive what portion of what they are owed. There is a scramble to value bank assets and distribute them to creditors based on complicated legal and regulatory considerations at that time (the time of bank resolution).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When a Pfandbrief is issued a decision is made up front that the bonds are backed by a pool of specific, identified loans (and of course these loans cannot be used to back other bonds). Furthermore, if the loan quality deteriorates or the loans are sold, the Bank is required to replace those bonds in the pool with healthy ones. Therefore the covered bond holders know at all times what the ultimate assets backing the bond are.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-10-15T16:18:08.700" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36459" PostTypeId="1" CreationDate="2017-10-15T23:02:25.367" Score="-1" ViewCount="44" Body="&lt;p&gt;How would you formulate this linear program in standard form? (ie objective function and constraints). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;any help would be appreciated. I don't understand how to formulate this without having an equation for each month, but I'm not sure what that would equate to. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://imgur.com/a/VzFWv&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://imgur.com/a/VzFWv&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anyone give me any hints to begin?&lt;/p&gt;&#xA;" OwnerUserId="30021" LastEditorUserId="848" LastEditDate="2018-03-15T05:48:35.077" LastActivityDate="2018-03-15T05:48:35.077" Title="Linear programming cash match portfolio - how to formulate?" Tags="&lt;optimization&gt;&lt;portfolio-optimization&gt;&lt;homework&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36460" PostTypeId="2" ParentId="36459" CreationDate="2017-10-16T00:06:38.217" Score="0" Body="&lt;p&gt;You are asked to find &quot;The least expensive portfolio that meets or exceeds the scheduled tuition payments&quot;. So you have known payments $P_t$ in each future month. You can construct the known &quot;cumulative payment curve&quot; $CP_t=\sum_{i=1}^t P_i$ giving all payments due up to and including month t. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any portfolio will produce cash outflows $O_t$ in each month, with cumulative curve $CO_t=\sum_{i=1}^t O_t$. You must minimize the cost of the portfolio today, suject to the inequalities $CO_t \ge CP_t$ for all t, which basically says that each step along the way the portfolio has generated enough cash for you to have been able to keep up with the required tuition payments so far.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both the &quot;cost of the portfolio today&quot; and the &quot;cumulative outflows&quot; are linear functions of the decision variables, the amounts $w_j$ to be used to purchase the available securities $S_j$ for $j=1,\cdots,N$&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2017-10-16T00:21:37.130" LastActivityDate="2017-10-16T00:21:37.130" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36461" PostTypeId="2" ParentId="36420" CreationDate="2017-10-16T05:32:25.617" Score="3" Body="&lt;p&gt;I do not understand why t is zero in B(t,t) and 1,2,3,4 in B(i,t).  And why did you interprete the value B(i,t) as the inverse of C, but not B(t,t)?&#xA;I think B(i,t) is the first column of I. An inverse is defined by Matrix^-1. But, B(*) is a value. So, you should divide by B(t,t). Here, you multiplicate it.&lt;/p&gt;&#xA;" OwnerUserId="29963" LastActivityDate="2017-10-16T05:32:25.617" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36462" PostTypeId="2" ParentId="36452" CreationDate="2017-10-16T05:42:28.277" Score="1" Body="&lt;p&gt;Looking at the link to &lt;a href=&quot;https://github.com/lballabio/QuantLib/blob/61f836f33984bdde059b1c51c2c5a7e70db63a53/ql/time/daycounters/actualactual.cpp#L171&quot; rel=&quot;nofollow noreferrer&quot;&gt;QuantLib's implementation of Act/Act AFB&lt;/a&gt; posted by Helin Gai &lt;a href=&quot;https://quant.stackexchange.com/questions/36452/day-count-convention-actual-actual-afb-factor-for-date1-2004-02-28-and-date2?noredirect=1#comment52326_36452&quot;&gt;in comments&lt;/a&gt;, this would be the part that the determines DiY (variable &lt;code&gt;den&lt;/code&gt;):&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Real den = 365.0; // the DiY&#xA;&#xA;if (Date::isLeap(newD2.year())) {&#xA;    temp = Date(29, February, newD2.year());&#xA;    if (newD2&amp;gt;temp &amp;amp;&amp;amp; d1&amp;lt;=temp)&#xA;        den += 1.0;&#xA;} else if (Date::isLeap(d1.year())) {&#xA;    temp = Date(29, February, d1.year());&#xA;    if (newD2&amp;gt;temp &amp;amp;&amp;amp; d1&amp;lt;=temp)&#xA;        den += 1.0;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;d1&lt;/code&gt; will be 2004-02-28 and &lt;code&gt;newD2&lt;/code&gt; will be 2004-02-29 after counting back complete years and applying the ISDA additional rule. Applying this bit of code:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;if (Date::isLeap(newD2.year()))&lt;/code&gt; &gt; True&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;temp = Date(29, February, newD2.year());&lt;/code&gt; &gt; temp = '2004-02-29'&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;if (newD2&amp;gt;temp &amp;amp;&amp;amp; d1&amp;lt;=temp)&lt;/code&gt; &gt; False, since &lt;code&gt;newD2&amp;gt;temp&lt;/code&gt; doesn't hold&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;den&lt;/code&gt; is not incremented and remains 365;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So according to QuantLib's implementation, Factor will be 4 + 1/365. It seems my suspicion is true that the &lt;a href=&quot;https://en.wikipedia.org/wiki/Day_count_convention#Actual.2FActual_AFB&quot; rel=&quot;nofollow noreferrer&quot;&gt;example on Wikipedia&lt;/a&gt; is incorrect.&lt;/p&gt;&#xA;" OwnerUserId="20033" LastActivityDate="2017-10-16T05:42:28.277" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36463" PostTypeId="2" ParentId="21509" CreationDate="2017-10-16T05:45:06.243" Score="1" Body="&lt;p&gt;Let's illustrate with a one step tree. Take a call option. Without even making a specific assumption about the payout of the option, except that it will be greater in case of an uptick than a downtick: $f_u&amp;gt;f_d$. The price at time 0 for the option will be $f=(1+r)^{-1}f_u$ by the risk-neutral valuation formula, since you assume $1+r=u$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Sell the option at time 0, receive $(1+r)^{-1}f_u$ and put them on a risk-free bank account. You receive $f_u$ at time $T$. Buy back the option which is now either worth $f_u$ in which case you just have the money necessary, either worth $f_d$ in which case you gain $f_u-f_d$ while your initial investment was zero. An arbitrage opportunity. (You could equally well make the argument using the stock instead of the option, it doesn't require you to use the risk-neutral valuation formula.)&lt;/p&gt;&#xA;" OwnerUserId="156" LastActivityDate="2017-10-16T05:45:06.243" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36464" PostTypeId="1" AcceptedAnswerId="36499" CreationDate="2017-10-16T07:19:54.630" Score="0" ViewCount="785" Body="&lt;p&gt;I have a strategy that buys a set of stocks and holds them for 6 months then rebalances. I would like to apply a rolling window backtest to the following strategy, but am wondering &lt;strong&gt;what is the appropriate way to combine the results from the different starting point&lt;/strong&gt;. For example I would have a backtest that start on month 1 and rebalances every month 7 and 1. Then I will also have a backtest that starts on month 2 and rebalances every month 8 and 2. I would have 6 of these, start on month 1, 2, 3, 4, 5, 6. How should I combine their results?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;E.g. should I calculate the CAGR for each backtest, then get the arithmetic mean?&lt;/p&gt;&#xA;" OwnerUserId="30023" LastEditorUserId="24222" LastEditDate="2017-10-16T07:26:09.280" LastActivityDate="2017-10-18T06:58:11.337" Title="How to combine rolling window backtest result?" Tags="&lt;backtesting&gt;&lt;rebalancing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36467" PostTypeId="1" CreationDate="2017-10-16T15:51:47.673" Score="2" ViewCount="174" Body="&lt;p&gt;Under what scenarios would the Deltas for Options on Bond Futures differ the most between Black vs SABR models ?&lt;/p&gt;&#xA;" OwnerUserId="30027" LastActivityDate="2017-10-16T15:51:47.673" Title="Option delta under Black mode vs SABR" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;delta&gt;&lt;sabr&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36468" PostTypeId="2" ParentId="36412" CreationDate="2017-10-16T16:33:11.157" Score="11" Body="&lt;p&gt;1) Why would you trade the error on the residual instead of creating a long/short factor model and trade expected returns?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would posit that the biggest reason people do this is for orthogonality of return. There are about 2,000 incredibly mature firms trading value, momentum, vol, etc. You would be competing with the likes of AQR, LSV Asset Management, etc. What you are doing when trading the residual of the return is making a bet that the &quot;unexplained&quot; component of the return is mean-reverting without trying to explain the reason for those price movements. Let's unpack this with a thought simulation. On page 39 of Dalio's book, Principles, he states &quot;theoretically...if there was a computer that could hold all of the world's facts and if it was perfectly programmed to mathematically express all of the relationships between all of the world's parts, the future could be perfectly foretold.&quot;* For the sake of argument and simplicity, let's assume that there are 5 factors that perfectly explain equity returns for the entire universe in a linear fashion: market, value, momentum, size, and the amount of people currently playing chess in the world (an example of some factor you likely would never find, but might drive the stock for whatever reason - if I recall correctly, Jim Simons has publicly stated that he regressed weather in Milan to the S&amp;amp;P return). Let's say you have data for the first 4, but not the last. In this case, you run your linear regression and are left with some error term driven by your lack of knowledge / data about the number of people playing chess. By constructing an engine to trade this mean reversion, you are making a bet (without knowing the following specifics) that the number of chess players world-wide is a stationary process around some mean and you want to bet that it will snap back to that mean whenever it gets out of wack.** In the real world, there are many factors that likely nobody has found that drive stock return in a non-linear fashion, and this process would bet on them all together instead of just one. People say all the time &quot;yesterday's alpha is today's beta,&quot; so it's critical to develop new signals that other people haven't found to add value. Absolute Return allocators (i.e. endowments, pensions, etc.) will often run a correlation between a new investment and their current investments to understand how uncorrelated their alphas are.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The other limitation is the type of factor you are using. Take a look at Quantitative Equity Portfolio Management by Chincarini and Kim. You have fundamental factors like div. yield, size, number of holders, and separately, economic factors like market, inflation, interest rates. Fundamental factor values are known at t0 and any historical regression is to find expected return associated with that fundamental factor level. For example, you expect an incremental 0.05% return for every additional mutual fund that holds the stock. At t0, you know there are 100 holders, so you expect 5% return associated with this level. Economic factors like market, or in this case, sector ETFs are only known at t1 (not t0), so you are actually detailing more of a risk model than a prediction model. The paper trades the overstretched nature of the residual at t0 on t1, which makes this okay, but you wouldn't be able to use this is a prediction model unless you had some idea of what tomorrow's IBB return would be in addition to the IBB beta that you have calculated on Dynavax, for example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Are you supposed to trade mean reversion on error terms factor neutral and why isn't this being done in the Avellaneda paper?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only way I know to get pure exposure to the error of the regression is to purchase one unit of the stock and to buy and sell commensurate units of the factors within the regression. In this way, you will be factor neutral because the stock's implicit factor exposure will be offset with purchases and sales of those factors / ETFs. I believe that is what the paper is saying / implementing on page 16:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Entering a trade, e.g. buy to open, means buying one dollar of the corresponding stock and selling βi dollars of its sector ETF or, in the case of using multiple factors, βi1 dollars of ETF #1, βi2 dollars of ETF #2, ..., βim dollars of ETF #m. Similarly, closing a long position means selling stock and buying ETFs&lt;/p&gt;&#xA;&#xA;&lt;p&gt;*I don't necessarily subscribe to this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;**The paper addresses this briefly in the following comment &quot;Another possibility is to consider scenarios in which one of the stocks is expected to out-perform the other over a significant period of time. In this case the co-integration residual should not be stationary. This paper will be principally concerned with mean-reversion, so we don’t consider such scenarios,&quot; but this is a convergence model. In the case where the number of chess players goes parabolic upwards for whatever reason, you lose a lot of money without having a divergence model as well.&lt;/p&gt;&#xA;" OwnerUserId="26157" LastEditorUserId="26157" LastEditDate="2017-10-16T17:27:53.723" LastActivityDate="2017-10-16T17:27:53.723" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36469" PostTypeId="2" ParentId="14708" CreationDate="2017-10-16T16:45:14.533" Score="2" Body="&lt;p&gt;Quick answer: all non-vanilla instruments with a rate component. It is particularly relevant in the context of portfolio risk aggregation (containing multiple instruments with different maturities, strikes, etc). Individual instruments can be often priced using &quot;locally calibrated&quot; models, but their risk metrics may be inconsistent with each other.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are some write ups on modeling term structure of rates focusing on SABR-LMM:&#xA;&lt;a href=&quot;http://lesniewski.us/papers/working/SABRLMM.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://lesniewski.us/papers/working/SABRLMM.pdf&lt;/a&gt;&#xA;&lt;a href=&quot;http://lesniewski.us/papers/lectures/Vol_Workshop_2015/VolWork1.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://lesniewski.us/papers/lectures/Vol_Workshop_2015/VolWork1.pdf&lt;/a&gt;&#xA;&lt;a href=&quot;http://lesniewski.us/papers/lectures/Vol_Workshop_2015/VolWork2.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://lesniewski.us/papers/lectures/Vol_Workshop_2015/VolWork2.pdf&lt;/a&gt;&#xA;&lt;a href=&quot;http://lesniewski.us/papers/lectures/Vol_Workshop_2015/VolWork3.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://lesniewski.us/papers/lectures/Vol_Workshop_2015/VolWork3.pdf&lt;/a&gt;&#xA;&lt;a href=&quot;http://lesniewski.us/papers/lectures/Vol_Workshop_2015/VolWork4.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://lesniewski.us/papers/lectures/Vol_Workshop_2015/VolWork4.pdf&lt;/a&gt;&#xA;&lt;a href=&quot;http://lesniewski.us/papers/lectures/Vol_Workshop_2015/VolWork5.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://lesniewski.us/papers/lectures/Vol_Workshop_2015/VolWork5.pdf&lt;/a&gt;&#xA;&lt;a href=&quot;http://lesniewski.us/papers/lectures/Vol_Workshop_2015/VolWork6.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://lesniewski.us/papers/lectures/Vol_Workshop_2015/VolWork6.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="29957" LastActivityDate="2017-10-16T16:45:14.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36470" PostTypeId="2" ParentId="1807" CreationDate="2017-10-16T17:59:41.167" Score="2" Body="&lt;p&gt;I realize I'm resurrecting an old thread, but I don't think the answers were clear enough. You can get a really good estimate for borrow rate by doing:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Calculate the forward by adding Strike Price + Call Price - Put Price. The forward rate represents Spot - dividends + interest - borrow rate. The forward rate is also (Forward ÷ Spot) - 1. If you can accurately estimate dividends and interest rates, then the remainder would be the cost to borrow implied by the options market.&lt;/p&gt;&#xA;" OwnerUserId="25719" LastActivityDate="2017-10-16T17:59:41.167" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36471" PostTypeId="1" AcceptedAnswerId="36480" CreationDate="2017-10-16T18:16:37.997" Score="2" ViewCount="118" Body="&lt;p&gt;I'm working through the following little exotic exercise and have some questions and curiosity as to whether I'm on the right track&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the claims&#xA;$$Y_t=\frac{1}{S_t}$$&#xA;$$X=\frac{1}{S_T}$$&#xA;a) Can $Y_t$ be the arbitrage-free price of a traded derivative?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Answer?-- So this question is for some reason stumping me. I suppose it means the literal process $Y_t$ (that is, not under a risk-neutral expectation), which seems highly unlikely to be an arb free price process. I just can't seem to put it in any rigorous terms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) Derive an expression for the arbitrage free price process $\pi_t[X]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under risk-neutral valuation, we have&#xA;$$\pi_t[X]=E^Q[\frac{X}{B_T}]=E^Q[\frac{\frac{1}{S_T}}{B_T}]=E^Q[\frac{1}{S_TB_T}]$$&#xA;So, here's where I had the idea to multiply both sides by $S_t$. Now, I've done a lot of problems with change of numeraire, but this really isn't that, so I'm now going to continue under the assumption that we are still under Q:&#xA;$$\pi_t[X]=\frac{1}{S_t}E^Q[\frac{S_t}{S_TB_T}]&amp;lt;=&amp;gt;$$&#xA;$$\pi_t[X]=\frac{1}{S_t}E^Q[e^{-r(T-t)+(\frac{1}{2}\sigma^2-r)(T-t)-\sigma(W_T-W_t)}]&amp;lt;=&amp;gt;$$&#xA;$$\pi_t[X]=\frac{1}{S_t}E^Q[e^{(\frac{1}{2}\sigma^2-2r)(T-t)-\sigma(W_T-W_t)}]$$&#xA;Using the fact that $E[e^{\mu+\sigma Z}]=e^{\mu+\frac{1}{2}\sigma^2}$, we have&#xA;$$\pi_t[X]=\frac{1}{S_t}e^{(\sigma^2-2r)(T-t)}$$&lt;/p&gt;&#xA;" OwnerUserId="28223" LastEditorUserId="28223" LastEditDate="2017-10-17T13:04:12.003" LastActivityDate="2017-10-17T13:04:12.003" Title="Pricing and Arbitrage of Inverse Asset Claim" Tags="&lt;option-pricing&gt;&lt;no-arbitrage-theory&gt;&lt;exotics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36473" PostTypeId="1" AcceptedAnswerId="36478" CreationDate="2017-10-16T18:45:57.607" Score="-2" ViewCount="79" Body="&lt;p&gt;Beth Anderson, FRM, is a portfolio manager for several wealthy clients including Reuben Carlyle. Anderson manages Carlyle's personal portfolio of stock and bond investments. Carlyle recently told Anderson that he is under investigation by the IRS for tax evasion related to his business, Carlyle Concrete (CC). After learning about the investigation, Anderson proceeds to inform a friend at a local investment bank so that they may withdraw their proposal to take CC public. Which of the following is most likely correct? Anderson:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A.  violated the Code by failing to immediately terminate the client relationship with Carlyle.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;B.  violated the Code by failing to maintain the confidentiality of her client's information.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;C.  violated the Code by failing to detect and report the tax evasion to the proper authorities.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;D.  did not violate the Code since the information she conveyed pertained to illegal activities on the part of her client.  &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I wonder why choice A and choice C are not correct.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="24524" LastEditorUserId="16148" LastEditDate="2017-10-16T21:36:35.193" LastActivityDate="2017-10-16T21:41:18.050" Title="Just an FRM ethics question" Tags="&lt;risk&gt;&lt;risk-management&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2017-10-17T07:19:18.483" ContentLicense="CC BY-SA 3.0" />
  <row Id="36476" PostTypeId="1" CreationDate="2017-10-16T19:50:37.410" Score="4" ViewCount="175" Body="&lt;p&gt;Working two exercises relating to $Q^d$ and $Q^f$. I'm comfortable working with transforms and likelihood processes on a risky asset between $Q$ and $Q^s$, and also on an exchange rate $X$ between $Q$ and $Q^d$, but I'm basically employing analogous methodology here on the transform from $Q^d$ to $Q^f$ and I'm not sure if this is correct. Anyways,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consider the a domestic/foreign exchange rate $X$, and the likelihood process&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$L_t=\frac{dQ^f}{dQ^d}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;a) Find the Girsanov transform between $Q^d$ and $Q^f$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I've already worked out the $Q^d$ dynamics of $X$ as&#xA;$$X_t=(r^d-r^f)X_tdt+\sigma_xX_tdW^{Q^d}$$&#xA;Now, consider the process&#xA;$$\frac{B^d_t}{X_t}$$&#xA;We have&#xA;$$d(\frac{B^d_t}{X_t})=\frac{B^d_t}{X_t}(\frac{dB^d_t}{B^d_t}-\frac{dX_t}{X_t}+(\frac{dX_t}{X_t})^2)&amp;lt;=&amp;gt;$$&#xA;$$d(\frac{B^d_t}{X_t})=\frac{B^d_t}{X_t}(r^ddt-(r^d-r^f)dt-\sigma_xdW^{Q^d}+\sigma^2_xdt)&amp;lt;=&amp;gt;$$&#xA;$$d(\frac{B^d_t}{X_t})=\frac{B^d_t}{X_t}((r^f+\sigma^2_x)dt-\sigma_xdW^{Q^d})$$&#xA;Now, by Girsanov, $dW^{Q^d}=\varphi^fdt+dW^{Q^f}$, thus&#xA;$$d(\frac{B^d_t}{X_t})=\frac{B^d_t}{X_t}((r^f+\sigma^2_x-\varphi^f\sigma_x)dt-\sigma_xdW^{Q^f})$$&#xA;For a $Q^f$-MG,&#xA;$$r^f+\sigma^2_x-\varphi^f\sigma_x=0&amp;lt;=&amp;gt;\varphi^f=\frac{\sigma^2_x+r^f}{\sigma_x}$$&#xA;Plugging this back into the $Q^d$-dynamics of $X$ yields&#xA;$$X_t=(r^d-r^f)X_tdt+\sigma_xX_t(\frac{\sigma^2_x+r^f}{\sigma_x}dt+dW^{Q^f})&amp;lt;=&amp;gt;$$&#xA;$$X_t=(r^d+\sigma^2_x)X_tdt+\sigma_xX_tdW^{Q^f}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) Derive an expression for $L_t$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm basically getting nonsense for this, so I won't even waste time writing it out. I end up with $L_t=X_t\cdot \frac{B^f_t}{B^d_t}$&lt;/p&gt;&#xA;" OwnerUserId="28223" LastActivityDate="2017-10-17T11:16:15.847" Title="Girsanov Transform and Likelihood Process Domestic to Foreign" Tags="&lt;option-pricing&gt;&lt;probability&gt;&lt;risk-neutral-measure&gt;&lt;numerairechange&gt;&lt;girsanov&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36478" PostTypeId="2" ParentId="36473" CreationDate="2017-10-16T21:31:58.913" Score="2" Body="&lt;p&gt;Keep in mind that &quot;under investigation&quot; is not the same as &quot;guilty of&quot;. Instead the answer is clearly B, what is she doing giving information to &quot;a friend&quot; at another firm, under what justification?       &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The tax evasion may or may not have taken place. If it took place it took place at Carlyle Concrete, which she has nothing to do with since she just manages his personal investments. It is not her job to detect fraud at the Concrete Company, so she has not failed to do her duty. As far as &quot;reporting information to the authorities&quot; what sense does that make since the information is that &quot;the IRS (i.e. the tax authorities!) have started an investigation&quot;, she could report that to the IRS but they would laugh, they already know that. Instead she provided a &quot;tip&quot; to a friend to help the friend get a promotion at another investment bank!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The general principle: she has a duty to report illegal activity that she knows of (facts or admissions of fact, not allegations, investigations, rumors) to &lt;em&gt;authorities&lt;/em&gt; (not to &quot;friends&quot;), other than that she has to keep her mouth shut about information she has about her client. The duty of confidentiality for an investment advisor is very strong, over-ruled only to report crimes.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-10-16T21:41:18.050" LastActivityDate="2017-10-16T21:41:18.050" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36480" PostTypeId="2" ParentId="36471" CreationDate="2017-10-16T23:04:48.163" Score="2" Body="&lt;p&gt;Concerning question $\text{b}$, your result is correct but you don't need to complicate things by dividing and multiplying by $S_t$: your expectation $E^Q[\cdot] = E^Q[\cdot|\mathcal{F}_t]$ is really conditional on infomation at $t$, hence you can simply take the $1/S_t$ factor from $1/S_T$ outside the conditional expectation without having to multiply and divide by $S_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for question $\text{a}$, once you have answered question $\text{b}$ it should be relatively straigthforward (&lt;strong&gt;hint&lt;/strong&gt;: the answer is not a clear cut &quot;yes&quot; or &quot;no&quot;).&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-10-16T23:11:39.870" LastActivityDate="2017-10-16T23:11:39.870" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36484" PostTypeId="2" ParentId="25200" CreationDate="2017-10-17T07:32:46.440" Score="2" Body="&lt;p&gt;By chance I became aware that this is generally known as &quot;trading the equity curve&quot;. More information can be found at this blog [1] of a former AHL researcher. He is also looking for more information on academic treatises.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[1] &lt;a href=&quot;https://qoppac.blogspot.co.uk/2015/11/random-data-evaluating-trading-equity.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://qoppac.blogspot.co.uk/2015/11/random-data-evaluating-trading-equity.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="5656" LastActivityDate="2017-10-17T07:32:46.440" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36486" PostTypeId="2" ParentId="36476" CreationDate="2017-10-17T08:48:46.277" Score="3" Body="&lt;p&gt;Let $(V_t)_{t \geq 0}$ denote a self-financing wealth process in foreign currency units. In the absence of arbitrage, the former process should emerge as a martingale when expressed in the foreign money market numéraire i.e.&#xA;$$ V_0 = \Bbb{E}^{\Bbb{Q}^f} \left[ \frac{B_0^f}{B_T^f} V_T \right] \tag{1} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still by absence of arbitrage, the value of that same wealth process when converted in domestic currency units using the running FX rate, i.e. $(X_t V_t)_{t \geq 0}$, should emerge as a martingale when expressed in the domestic money market numéraire i.e.&#xA;$$ X_0 V_0 = \Bbb{E}^{\Bbb{Q}^d} \left[ \frac{B_0^d}{B_T^d} X_T V_T \right] \tag{2} $$&#xA;Rearranging $(1)$ and $(2)$ one gets:&#xA;$$ V_0 = \Bbb{E}^{\Bbb{Q}^f} \left[ \frac{B_0^f}{B_T^f} V_T \right] = \Bbb{E}^{\Bbb{Q}^d} \left[ \frac{B_0^d}{B_T^d} \frac{X_T}{X_0} V_T \right]  $$&#xA;from which you can deduce that&#xA;$$ \left. \frac{d\Bbb{Q}^f}{d\Bbb{Q}^d} \right\vert_{\mathcal{F}_T} = \frac{B_0^d X_T B_T^f}{B_T^d X_0 B_0^f} \tag{3} $$&#xA;Now you found that the FOR/DOM exchange rate $(X_t)_{t \geq 0}$ verifies the SDE&#xA;$$ X_t=(r^d-r^f)X_tdt+\sigma_xX_tdW^{Q^d} $$&#xA;from which one can deduce that&#xA;\begin{align}&#xA;X_T &amp;amp;= X_0 \exp\left(\left((r^d-r^f)-\frac{1}{2}\sigma_x^2\right)T + \sigma_x W_T^{\Bbb{Q}^d} \right) \\&#xA;&amp;amp;= X_0 \frac{B_T^d}{B_T^f} \mathcal{E}\left[ \sigma_x W_T^{\Bbb{Q}^d} \right]&#xA;\end{align}&#xA;such that, further noting that by definition $B_0^d = B_0^f = 1$, the Radon-Nikodym derivative (3) can be rewritten as&#xA;$$ \left. \frac{d\Bbb{Q}^f}{d\Bbb{Q}^d} \right\vert_{\mathcal{F}_T} = \mathcal{E}\left[ \sigma_x W_T^{\Bbb{Q}^d} \right] $$&#xA;which is a Doléans-Dade exponential (hence a martingale with unit expectation).&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2017-10-17T11:16:15.847" LastActivityDate="2017-10-17T11:16:15.847" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36487" PostTypeId="1" AcceptedAnswerId="36488" CreationDate="2017-10-17T09:59:29.783" Score="0" ViewCount="189" Body="&lt;p&gt;There is a statement in John Hull's book &lt;code&gt;Options, Futures and Other Derivatives  9th&lt;/code&gt; &lt;code&gt;page 633&lt;/code&gt; for the relation between &lt;code&gt;implied volatility function (IVF)&lt;/code&gt; and &lt;code&gt;implied distribution&lt;/code&gt; of asset in future time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;When it is used in practice the IVF model is recalibrated daily to the prices of plain vanilla options. It is a tool to price exotic options consistently with plain vanilla options. As discussed in Chapter 20 plain vanilla options define the risk-neutral probability distribution of the asset price at all future times. It follows that the IVF model gets the risk-neutral probability distribution of the asset price at all future times correct. This means that options providing payoffs at just one time (e.g., all-or-nothing&#xA;and asset-or-nothing options) are priced correctly by the IVF model. However, the model does not necessarily get the joint distribution of the asset price at two or more times correct. This means that exotic options such as compound options and barrier options may be priced incorrectly.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can not understand that, IVF guarantees the model match the market price of vanilla option for all strike $K$ and all maturity $T.$ And the &lt;code&gt;implied distribution&lt;/code&gt; of asset in future time is totally determined by the market price:&#xA;$$    p(S^*,t^*;K,T) = e^{r(T - t^*)}\dfrac{\partial^2 V}{\partial K^2}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here, market value: $V,$ maturity $T,$ strike $K,$ spot price of asset: $S^*,$ current time: $t^*.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone give me a clear explanation?&lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-10-17T10:15:37.200" Title="IVF and implied distribution of underlying in John Hull's book" Tags="&lt;implied-volatility&gt;&lt;derivatives&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="36488" PostTypeId="2" ParentId="36487" CreationDate="2017-10-17T10:15:37.200" Score="3" Body="&lt;p&gt;One example: even if you know the implied distribution at all future times T, you know nothing about the change in price between two future times T1 and T2.   An exotic depending on the price change from T1 to T2 thus cannot be priced.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-10-17T10:15:37.200" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="36489" PostTypeId="1" AcceptedAnswerId="36490" CreationDate="2017-10-17T10:36:04.433" Score="1" ViewCount="1138" Body="&lt;p&gt;I saw different definitions of these reinsurance treaties. What's the exact definition of an excess of loss reinsurance and stop-loss reinsurance?&#xA;In Chi's paper, see &lt;a href=&quot;https://www.researchgate.net/profile/Yichun_Chi/publication/228231915_Optimal_Reinsurance_under_VaR_and_CVaR_Risk_Measures_A_Simplified_Approach/links/00463527c227800853000000/Optimal-Reinsurance-under-VaR-and-CVaR-Risk-Measures-A-Simplified-Approach.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.researchgate.net/profile/Yichun_Chi/publication/228231915_Optimal_Reinsurance_under_VaR_and_CVaR_Risk_Measures_A_Simplified_Approach/links/00463527c227800853000000/Optimal-Reinsurance-under-VaR-and-CVaR-Risk-Measures-A-Simplified-Approach.pdf&lt;/a&gt;&#xA;the standard stop-loss reinsurance is of the form $f(x) = (x-d)_{+}$, where $d \geq 0$ is the retention level and $(x)_{+} = \max\{x, 0\}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The limited stop-loss treaty is of the form $f(x) = \min\{(x-a)_{+}, b\}$.&#xA;This is equivalent to $f(x) = (x-a)_{+} - (x-a-b)_{+}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The truncated stop-loss is $f(x)=(x-d)_{+}\mathbb{I}(x \leq m)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While in Peter Antal's work, see,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.actuaries.ch/fr/downloads/aid!b4ae4834-66cd-464b-bd27-1497194efc96/id!96/Reinsurance_Script2009_v2.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.actuaries.ch/fr/downloads/aid!b4ae4834-66cd-464b-bd27-1497194efc96/id!96/Reinsurance_Script2009_v2.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Stop-loss reinsurance is an excess of loss on the DI's aggregate annual loss, which is $$&#xA;S_{SL} = (\sum_{i = 1}^{N}X^{i}-D)^{+} - (\sum_{i = 1}^{N}X^{i}-C-D)^{+}$$.&#xA;And the excess of loss is of the form&#xA;$$&#xA;S_{XL} = \sum_{i = 1}^{N}[(X^{i}-D)^{+} - (X^{i}-C-D)^{+}].&#xA;$$&#xA;I am confused. What's the exact definition of stop-loss reinsurance?&lt;/p&gt;&#xA;" OwnerUserId="29773" LastActivityDate="2017-10-17T14:00:36.850" Title="Definitions of excess of loss reinsurance and stop-loss reinsurance" Tags="&lt;insurance&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36490" PostTypeId="2" ParentId="36489" CreationDate="2017-10-17T12:56:14.743" Score="1" Body="&lt;p&gt;A marine syndicate at Lloyds will insure 10 ships for 2018. The loss during 2018 on each ship will be $X_i$ for $i=1,\cdots,10$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The syndicate has limited capital and could be wiped out if the losses are too large. For this reason they may want to take out re-insurance. There are 2 kinds:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) Stop-loss reinsurance puts a limit on the losses for the year, i.e. a limit on $\sum X_i$.  If this exceed $D=100$ million dollars, only 100 million will be paid by the syndicate and the rest will be covered by the reinsurer. The reinsurance then is  $(\sum X_i-D)^+$. If the reinsurer is only willing to provide reinsurance up to an upper limit C, then the other formula you gave applies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) Another solution is to put a limit on the losses on each single ship of say 10 million dollars. This is called Excess of Loss insurance. In this case the formula is $\sum(X_i-D)^+$ with D=10.  Again an upper limit to the reinsurance equal to C can be introduced, slightly modifying the formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In summary these are 2 types of reinsurance and each can have an upper limit $C$ or not. There is no inconsistency. (Also, if instead of $\sum X_i$ we write $x$ then we get different looking but equivalent formulas for stop-loss insurance).&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-10-17T14:00:36.850" LastActivityDate="2017-10-17T14:00:36.850" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36491" PostTypeId="2" ParentId="21217" CreationDate="2017-10-17T18:25:26.117" Score="1" Body="&lt;p&gt;Check out free daily interest rates at &lt;a href=&quot;https://www.theice.com/marketdata/reports/170&quot; rel=&quot;nofollow noreferrer&quot;&gt;ICE Benchmark Administration&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19424" LastActivityDate="2017-10-17T18:25:26.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36492" PostTypeId="1" CreationDate="2017-10-17T18:48:38.383" Score="-1" ViewCount="285" Body="&lt;p&gt;I'm taking a look at my trading history over a particular time period and have 500 trades on with an win rate of 82%. My average win is $W$. My average loss is $L$. So am I correct in assuming the Kelly Criterion is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\frac{0.82 \times (W / L + 1) - 1}{W / L}&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="2928" LastEditorUserId="24222" LastEditDate="2017-10-17T21:16:58.037" LastActivityDate="2017-10-18T10:58:24.447" Title="Am I calculating my Kelly Criterion correctly?" Tags="&lt;portfolio-management&gt;&lt;probability&gt;&lt;kelly-criterion&gt;&lt;money-management&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36493" PostTypeId="2" ParentId="36492" CreationDate="2017-10-17T19:08:35.227" Score="2" Body="&lt;p&gt;According to Skiena (&lt;a href=&quot;https://www3.cs.stonybrook.edu/~skiena/691/2007/lectures/Kelly.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;link&lt;/a&gt; page 21) the Kelly fraction in the case of wins all equal to W and losses all equal to L is: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f=\frac{pW-qL}{WL}=p/L-q/W$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $q=1-p$ and $p$ is the probability of a win.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When the wins and losses are random, with average $W$ and $L$ respectively, I am not sure this formula is completely justified. But it might be a good approximation&lt;/p&gt;&#xA;" OwnerUserId="16148" LastActivityDate="2017-10-17T19:08:35.227" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36494" PostTypeId="1" CreationDate="2017-10-17T22:20:19.487" Score="-2" ViewCount="156" Body="&lt;p&gt;I see a lot of academic papers talking about accuracy in pricing American Options (and finding analytic solutions). Why is there so much interest in this topic? Isn't the option price set by the market? From what I can understand, accuracy in pricing gives accuracy in implied volatility, which gives you a sense of which options are expensive relative to others (eg. A listed puts for the same underlying, same maturity but varying strike may have different volatilities, even though they should be the same). I don't see why as an option trader accuracy is important, since the market already decided the fair price.&lt;/p&gt;&#xA;" OwnerUserId="30048" LastActivityDate="2018-06-16T17:57:02.467" Title="Why is accuracy important in pricing American Options?" Tags="&lt;options&gt;&lt;american-options&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="36495" PostTypeId="2" ParentId="36420" CreationDate="2017-10-17T23:07:19.953" Score="1" Body="&lt;p&gt;Why you don't just do a least square regression ? &#xA;It is likely not stable no ?&lt;/p&gt;&#xA;" OwnerUserId="17394" LastEditorUserId="17394" LastEditDate="2017-10-18T04:31:51.820" LastActivityDate="2017-10-18T04:31:51.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36498" PostTypeId="2" ParentId="27752" CreationDate="2017-10-18T06:39:17.893" Score="1" Body="&lt;p&gt;Interactive Brokers hosted a webinar on Nov. 10 2016 about Implement Algo Trading coded in Python using Interactive Brokers API. The presenter gave a good explanation on live trading using IBridgePy, which is a flexible and easy-to-use Python platform.&#xA;The webinar was published by IB at youtube &lt;a href=&quot;https://www.youtube.com/watch?v=hogXB07OJ_I&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.youtube.com/watch?v=hogXB07OJ_I&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;IBridgePy 's website is www.IBridgePy.com&#xA;One of greatest thing is that IBridgePy can run Quantopian's codes without any changes!&#xA;The tutorial of migrating from Quantopian to IBridgePy is here.&#xA;&lt;a href=&quot;http://www.ibridgepy.com/tutorials/#Migrating_from_Quantopian_to_IBridgePy&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.ibridgepy.com/tutorials/#Migrating_from_Quantopian_to_IBridgePy&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Disclaimer: Posted by IBridgPy&lt;/p&gt;&#xA;" OwnerUserId="28198" LastActivityDate="2017-10-18T06:39:17.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36499" PostTypeId="2" ParentId="36464" CreationDate="2017-10-18T06:58:11.337" Score="0" Body="&lt;p&gt;Let's take the example of your rolling window with a 6 months holding periods and monthly rebalancing. You can apply a similar methodology with different holding periods and rebalancing frequency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can generate the performance of your strategy at each month and annualize it. This is equivalent to running 6 portfolios with the same strategy with each contributing 1/6 to the performance (so there is a strong assumption that they all have equal weight at any given rebalancing periods, which is likely wrong).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can then use each monthly performance and annualize or average them (I would go with annualize) to evaluate your strategy and compare it to other strategies. Wrong because of the assumptions but useful and feasible. Also keep in mind that a backtest has many other assumptions so they are just a tool.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One important point with this approach is that the volatility of that strategy will be vastly underestimated because of the auto-correlation of the returns and if you want to get a more realistic Sharpe ratio you would need to adjust the volatility for the auto-correlation of your monthly returns. Newey-West type of methods, or otherwise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This effect will have the most impact if you start comparing shorter holding periods volatility with the longer ones. Don't get fooled that the longer holding periods have higher Sharpe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Definitely a lot of assumptions but something that can be useful to evaluate a strategy on multiple horizons.&lt;/p&gt;&#xA;" OwnerUserId="19661" LastActivityDate="2017-10-18T06:58:11.337" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36500" PostTypeId="1" AcceptedAnswerId="36509" CreationDate="2017-10-18T08:50:55.160" Score="11" ViewCount="6201" Body="&lt;p&gt;I'm looking for something that might be considered the 'Bible' of fixed income.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ideally it would contain everything from the basics of PV and discounting cash flows all the way up to some of the most complicated instruments, such as cross-currency basis swaps, although I understand that this may have to cover two books, such as 'An Intro to Fixed Income' and 'Further Fixed Income', or 'Advanced Fixed Income'.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="8010" LastActivityDate="2020-10-08T14:16:42.437" Title="What are some of the best textbooks on Fixed Income securities?" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;bond-yields&gt;&lt;bond-futures&gt;" AnswerCount="6" CommentCount="3" FavoriteCount="14" ContentLicense="CC BY-SA 3.0" />
  <row Id="36501" PostTypeId="2" ParentId="36500" CreationDate="2017-10-18T09:38:35.877" Score="4" Body="&lt;p&gt;The Fixed-Income bible is definitely this one:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Damiano Brigo, Fabio Mercurio. &lt;em&gt;Interest Rate Models - Theory and Practice&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It is a 1,007-pager covering a large range of topics including:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Basic definitions and no-arbitrage pricing&lt;/li&gt;&#xA;&lt;li&gt;Short rate models&lt;/li&gt;&#xA;&lt;li&gt;Market models&lt;/li&gt;&#xA;&lt;li&gt;Volatility smile for fixed income instruments&lt;/li&gt;&#xA;&lt;li&gt;Exotic payoffs&lt;/li&gt;&#xA;&lt;li&gt;Inflation and credit-linked instruments&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="26595" LastEditorUserId="26595" LastEditDate="2019-05-27T00:44:59.820" LastActivityDate="2019-05-27T00:44:59.820" CommentCount="3" ContentLicense="CC BY-SA 4.0" />
  <row Id="36502" PostTypeId="2" ParentId="36500" CreationDate="2017-10-18T10:43:21.880" Score="1" Body="&lt;p&gt;@JejeBelfort 's answer suggests a good book if you are interested in the stochastic modelling side of the fixed income world. I also really liked Musiela and Rutowski's &quot;Martingale Methods in Financial Modelling&quot; for this. Though not purely focussed on fixed income it has 5 chapters devoted to the topic. One thing that I liked about it is that it is relatively self-contained and requires only the basics of stochastic analysis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both of these books are relatively technical though and don't cover things like present value and discounted cash-flows, which you are asking for in your question. I would thus suggest you have a look at Sundaresan's &quot;Fixed Income Markets and Their Derivatives&quot;. This book starts from zero and covers a wide range of fixed income products as well as the institutional settings. It is often used as a one-semester textbook for an advanced undergrad course.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2017-10-18T10:43:21.880" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36503" PostTypeId="2" ParentId="36492" CreationDate="2017-10-18T10:58:24.447" Score="2" Body="&lt;p&gt;When it comes to Kelly, I've always liked the explanation at &lt;a href=&quot;http://www.financialwisdomforum.org/gummy-stuff/kelly-ratio.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.financialwisdomforum.org/gummy-stuff/kelly-ratio.htm&lt;/a&gt;. At this link there are three versions of Kelly explained, if you don't mind the &quot;chatty&quot; style. The third version brings in the standard deviation of wins and losses, which I think is very useful.&lt;/p&gt;&#xA;" OwnerUserId="252" LastActivityDate="2017-10-18T10:58:24.447" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36504" PostTypeId="1" CreationDate="2017-10-18T11:17:22.230" Score="1" ViewCount="315" Body="&lt;p&gt;Does a bond paying floating coupon &lt;code&gt;LIBOR&lt;/code&gt;, still has the value at par when we use the &lt;code&gt;OIS&lt;/code&gt; as discount factor?&#xA;It seems only when the Identity:&#xA;$$B(t,T_2)(1+(T_2-T_1)F(t,T_1,T_2))=B(t,T_1)$$&#xA;still holds, the proposition above will be true. Here $B(t,T)$ is the value of zero coupon bond, $F(t,T_1,T_2)$ is the &lt;code&gt;forward LIBOR.&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In John Hull's book &lt;code&gt;Options, Futures and Other Derivatives  9th&lt;/code&gt; &lt;code&gt;page 205&lt;/code&gt;  ,shows the way to calculate the forward LIBOR implied in &lt;code&gt;Swap rate&lt;/code&gt; under &lt;code&gt;OIS discounting.&lt;/code&gt; But it's the case we know $B(t,T_1),$ but don't know $B(t,T_2).$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we know both $B(t,T_1)$ and $B(t,T_2).$ Can we calculate the forward LIBOR still as above identity?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Denote&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$D_{ois}(t):$ the discounted factor of OIS&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$B(t,T):$ Bond price&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$E_t[]:$ Conditional expectation at time $t$ under OIS-risk neutral measure which makes $D_{ois}(t)B(t,T)$ martingale for all $T.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use $N(t) = D_{ois}(t)B(t,T_1)$ as a numeraire to change the measure into OIS $T_1$-forward measure $E^{T_1}_t[]$(simply use expectation represent new measure).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then&#xA;$$ \dfrac{B(t,T)}{B(t,T_1)} = \dfrac{D_{ois}(t)B(t,T)}{D_{ois}(t)B(t,T_1)}$$&#xA;should be martingale under $E^{T_1}_t[].$ Then use the definition of the forward LIBOR $F(t, T, T_{1})$ we can prove that&#xA;$$\dfrac{1}{D_{ois}(T)}E_{T}\left[D_{ois}(T_1)\Big((T_1-T) \cdot F(T, T, T_{1})+1\Big)\right] = 1.$$&lt;/p&gt;&#xA;" OwnerUserId="26165" LastEditorUserId="26165" LastEditDate="2017-10-18T15:41:11.760" LastActivityDate="2018-03-17T18:20:57.717" Title="Floating leg of a standard swap still has a value at par when we use the OIS as discount factor?" Tags="&lt;libor&gt;&lt;fix&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36505" PostTypeId="1" AcceptedAnswerId="36517" CreationDate="2017-10-18T11:33:35.723" Score="1" ViewCount="256" Body="&lt;p&gt;From a list of trades I would like to calculate the change in profit during the time the position is open. Does anyone have a script to do this, either python or R? The profits are based on a contract size of 100 from the index, where slippage is taken into consideration. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Trade list&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Enter           Exit            Profit&#xA;20070829 14:00  20070829 17:24  1,465,00&#xA;20070914 17:24  20070918 14:00  1,588,98&#xA;20070924 14:00  20070924 17:24  796,98&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Index data:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; Date     Time      Open     High     Low     Close  Volume&#xA;  20070829  900     7430.24 7430.24 7358.12 7372.1  1&#xA;  20070829  1000    7378.56 7378.56 7354.41 7372.16 1&#xA;  20070829  1100    7366.6  7433.46 7366.6  7428.72 1&#xA;  20070829  1200    7423.62 7429.08 7408.82 7418.13 1&#xA;  20070829  1300    7417.8  7427.13 7412.43 7422.03 1&#xA;  20070829  1400    7423.91 7434.21 7406.92 7418.04 1&#xA;  20070829  1500    7416.77 7431.55 7413.9  7426.8  1&#xA;  20070829  1600    7428.96 7442.38 7406.2  7414.65 1&#xA;  20070829  1724    7415.36 7433.29 7407.98 7433.29 1&#xA;  20070830  900     7439.18 7484.69 7439.18 7478.72 1&#xA;  20070830  1000    7478.22 7491.75 7462.95 7464.2  1&#xA;  20070830  1100    7463.82 7480.76 7463.82 7475.08 1&#xA;  20070830  1200    7474.77 7474.77 7439.76 7456.95 1&#xA;  20070830  1300    7456.19 7456.19 7423.3  7429.93 1&#xA;  20070830  1400    7430.05 7444.99 7425.68 7444.99 1&#xA;  20070830  1500    7441.21 7454.32 7419.61 7420.8  1&#xA;  20070830  1600    7421.59 7480.41 7418.81 7479.4  1&#xA;  20070830  1724    7479.01 7494.39 7469.71 7487.42 1&#xA;  20070831  900     7519.94 7574.6  7519.94 7554.82 1&#xA;  20070831  1000    7554.85 7564.01 7546.77 7552.3  1&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="26799" LastEditorUserId="16148" LastEditDate="2017-10-18T13:41:48.217" LastActivityDate="2017-12-08T13:26:10.527" Title="Calculate day-to-day change in value of open position" Tags="&lt;programming&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36506" PostTypeId="2" ParentId="36504" CreationDate="2017-10-18T13:17:43.230" Score="1" Body="&lt;p&gt;No, the Libor floater is not worth par when discounting at OIS (unless there is no basis between OIS and Libor). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a dual curve settings discounting is done at $B_{OIS}(t, T)$, whereas the forward libors are computed on the projection curve as $F(t, T_1, T_2) = (B_{libor}(t, T_1)/B_{libor}(t, T_2) - 1)/(T_2 - T_1)$, where $B_{OIS}(t, T)$ is the discount factor on the OIS curve and $B_{libor}(t, T)$ is the discount factor on the libor curve. &lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2017-10-18T13:17:43.230" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="36509" PostTypeId="2" ParentId="36500" CreationDate="2017-10-18T16:47:22.713" Score="17" Body="&lt;p&gt;If I were to recommend one, it would be:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Bruce Tuckman's &lt;em&gt;Fixed Income Securities&lt;/em&gt;. This is by far my absolute favorite. It is extremely well written and discusses complex concepts in very easy-to-understand terms. Tuckman is both an academic and a practitioner (Salmon/Credit Suisse/Lehman/Barclays), so the book takes great care in addressing many real-life considerations of fixed income trading/investing that other books either gloss over or ignore. The book is also filled with excellent trading examples. (I should mention that I prefer the 2nd edition to the 3rd edition, which in my mind has a more logical organization of the material, although you'd miss out on modern topics such as multi-curve construction. I also recommend that you search around for research notes Tuckman wrote at Lehman, which are timeless master pieces for thinking about different concepts/strategies.) (Disclosure: I don't know the guy, but I clearly admire his intellect.)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Tuckman's book is more or less oriented toward undergrads/MBAs/practitioners, so it does not rigorously address topics that require a lot of stochastic calculus. For a more rigorous (and yet not esoteric) treatment, my favorite is &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Pietro Veronesi's &lt;em&gt;Fixed Income Securities: Valuation, Risk, and Management&lt;/em&gt;. This is another masterfully written book that blends theory and practice very well. It covers everything you'd expect, from discounted cash flows to interest rate modeling in continuous time. It is also very practitioner friendly, with step-by-step guides to implementing all the models. This title strikes a perfect balance between mathematical rigor and accessibility, and is used by many MFE programs from what I heard.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Other references:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Siddhartha Jha's &lt;em&gt;Interest Rate Markets: A Practical Approach to Fixed Income&lt;/em&gt; is an excellent reference for fixed income strategy, written by a trader/strategist. It uses very little math, but discusses many real-life trading strategies. You can learn a lot of ideas not usually covered in mainstream textbooks.&lt;/li&gt;&#xA;&lt;li&gt;Damiano Brigo and Fabio Merccurio's &lt;em&gt;Interest Rate Models&lt;/em&gt; is, for a long time, the bible for fixed income &lt;em&gt;quants&lt;/em&gt;. It provides detailed coverage of many interest rate models and their implementations. In my mind, it is almost certainly not a title for beginners, but it's an invaluable reference for those in quantitative roles.&lt;/li&gt;&#xA;&lt;li&gt;Leif B. G. Andersen and Vladimir V. Piterbarg's &lt;em&gt;Interest Rate Modeling&lt;/em&gt;, which comes in three volumes, represents the state of the art and is widely considered the new bible(s). Like Brigo &amp;amp; Merccurio, these are best treated as reference books rather than textbooks.&lt;/li&gt;&#xA;&lt;li&gt;Depending on which track you go down, there are also &quot;bibles&quot; for specific areas of fixed income. For example, &quot;The Treasury Bond Basis&quot; is the bible for bond futures traders; &quot;Salomon Smith Barney Guide to Mortgage-Backed and Asset-Backed Securities&quot; is the definitive guide to the MBS market, etc.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2017-10-18T19:25:21.893" LastActivityDate="2017-10-18T19:25:21.893" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="36514" PostTypeId="1" CreationDate="2017-10-19T02:45:20.183" Score="5" ViewCount="99" Body="&lt;p&gt;Damodaran's paper &quot;&lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2742186&quot; rel=&quot;nofollow noreferrer&quot;&gt;Equity Risk Premiums...&lt;/a&gt;&quot; (2016) discusses the standard of using various measures of sovereign default risk (e.g. Moody's ratings, bond default spreads, CDS spreads) to estimate equity risk premiums for a country.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The implication appears to be that when a country undergoes default or debt restructure, the value of equities will suffer by an equal or greater amount than the holders of sovereign debt (Damodaran uses a &lt;a href=&quot;http://pages.stern.nyu.edu/~adamodar/New_Home_Page/datafile/ctryprem.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;1.23 multiplier for EM&lt;/a&gt;).  What is happening at the firm level that underpins this relationship?&#xA; Sure, businesses which hold the debt will suffer (e.g. banks), but this is not the case for most businesses.  Why can't the default spread for sovereign debt in an EM country be higher than the risk premium for equities in that country?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For instance, Damodaran currently estimates Greek equity risk premium as 19.90% as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Greek_RP = US_equity_risk_premium + 1.23*Greek_bond_default_spread&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Greek_RP = 5.69 + 1.23*11.55&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Greek_RP = 19.90&lt;/p&gt;&#xA;" OwnerUserId="30069" LastEditorUserId="30069" LastEditDate="2017-10-19T06:09:01.880" LastActivityDate="2017-10-19T06:09:01.880" Title="Why use sovereign default risk to determine equity risk premiums?" Tags="&lt;risk-premium&gt;&lt;sovereign-cds&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36515" PostTypeId="1" CreationDate="2017-10-19T03:30:04.243" Score="2" ViewCount="48" Body="&lt;p&gt;I'm hoping someone can direct me towards any books/papers that approach volatility forecasting from the perspective of market specific events (fed meetings, USDA reports, OPEC announcements etc). From my own study it seems that much of the literature is focused on GARCH and similar models, but one of the reasons I think these models tend to do poorly from an options pricing standpoint is because they neglect significant upcoming events. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm aware of implied volatility models with jumps, however I'm more interested in any data driven approaches that may describe a technique for modeling the size of a jump in a given market. &lt;/p&gt;&#xA;" OwnerUserId="30070" LastActivityDate="2017-10-19T03:30:04.243" Title="Looking for material on volatility forecasting with a focus on market/news events" Tags="&lt;options&gt;&lt;volatility&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36517" PostTypeId="2" ParentId="36505" CreationDate="2017-10-19T05:46:42.977" Score="4" Body="&lt;p&gt;Perhaps the PMwR package does some of the things you want. Disclosure: I am the package author. PMwR is not on CRAN (yet),&#xA;but is on GitHub (&lt;a href=&quot;https://github.com/enricoschumann/PMwR&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/enricoschumann/PMwR&lt;/a&gt;) and can also be installed from &lt;a href=&quot;http://enricoschumann.net/R/packages/PMwR/index.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://enricoschumann.net/R/packages/PMwR/index.htm&lt;/a&gt; .&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It allows you to compute the profit/loss for trades, both in total and&#xA;over time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You start by creating a &lt;code&gt;journal&lt;/code&gt;. I take your first trade and use the&#xA;closing prices from the table. If you want to include your slippage, adjust the entry/exit prices.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(&quot;PMwR&quot;)&#xA;j &amp;lt;- journal(amount = c(100, -100),&#xA;             price = c(7418.04, 7433.29),&#xA;             timestamp = as.POSIXct(c(&quot;20070829  1400&quot;,&#xA;                                      &quot;20070829  1724&quot;),&#xA;                                    format = &quot;%Y%m%d  %H%M&quot;))&#xA;&#xA;j&#xA;&#xA;##              timestamp  amount    price&#xA;## 1  2007-08-29 14:00:00     100  7418.04&#xA;## 2  2007-08-29 17:24:00    -100  7433.29&#xA;## &#xA;## 2 transactions  &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;To compute the profit/loss, use the function &lt;code&gt;pl&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pl(j)&#xA;&#xA;## P/L total        1525&#xA;## average buy   7418.04&#xA;## average sell  7433.29&#xA;## cum. volume       200&#xA;## &#xA;## 'P/L total' is in units of instrument;&#xA;## 'volume' is sum of /absolute/ amounts.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You may also evaluate your position over time. As an example, I use the close prices you provided.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;timestamp &amp;lt;- as.POSIXct(&#xA;    c(&quot;20070829  0900&quot;, &quot;20070829  1000&quot;, &quot;20070829  1100&quot;,&#xA;      &quot;20070829  1200&quot;, &quot;20070829  1300&quot;, &quot;20070829  1400&quot;,&#xA;      &quot;20070829  1500&quot;, &quot;20070829  1600&quot;, &quot;20070829  1724&quot;,&#xA;      &quot;20070830  0900&quot;, &quot;20070830  1000&quot;, &quot;20070830  1100&quot;,&#xA;      &quot;20070830  1200&quot;, &quot;20070830  1300&quot;, &quot;20070830  1400&quot;,&#xA;      &quot;20070830  1500&quot;, &quot;20070830  1600&quot;, &quot;20070830  1724&quot;,&#xA;      &quot;20070831  0900&quot;, &quot;20070831  1000&quot;),&#xA;    format = &quot;%Y%m%d  %H%M&quot;)&#xA;&#xA;close &amp;lt;- c(7372.1 , 7372.16, 7428.72, 7418.13, 7422.03,&#xA;           7418.04, 7426.8 , 7414.65, 7433.29, 7478.72,&#xA;           7464.2 , 7475.08, 7456.95, 7429.93, 7444.99,&#xA;           7420.8 , 7479.4 , 7487.42, 7554.82, 7552.3)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, you call &lt;code&gt;pl&lt;/code&gt;with two more arguments: &lt;code&gt;along.timestamp&lt;/code&gt; and &lt;code&gt;vprice&lt;/code&gt;; the latter stands for valuation price. This will give you a time-series of total profit/loss (realised + unrealised) of your trade.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;pl(j, along.timestamp = timestamp, vprice = close)[[1]]$pl&#xA;&#xA;## 2007-08-29 09:00:00 2007-08-29 10:00:00 2007-08-29 11:00:00 &#xA;##                   0                   0                   0 &#xA;## 2007-08-29 12:00:00 2007-08-29 13:00:00 2007-08-29 14:00:00 &#xA;##                   0                   0                   0 &#xA;## 2007-08-29 15:00:00 2007-08-29 16:00:00 2007-08-29 17:24:00 &#xA;##                 876                -339                1525 &#xA;## 2007-08-30 09:00:00 2007-08-30 10:00:00 2007-08-30 11:00:00 &#xA;##                1525                1525                1525 &#xA;## 2007-08-30 12:00:00 2007-08-30 13:00:00 2007-08-30 14:00:00 &#xA;##                1525                1525                1525 &#xA;## 2007-08-30 15:00:00 2007-08-30 16:00:00 2007-08-30 17:24:00 &#xA;##                1525                1525                1525 &#xA;## 2007-08-31 09:00:00 2007-08-31 10:00:00 &#xA;##                1525                1525 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6857" LastActivityDate="2017-10-19T05:46:42.977" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36518" PostTypeId="1" CreationDate="2017-10-19T08:35:42.397" Score="2" ViewCount="214" Body="&lt;p&gt;Say I have a currency pair &lt;code&gt;GBP/USD&lt;/code&gt; at rate &lt;code&gt;1.45&lt;/code&gt;, buying &lt;code&gt;1 GBP&lt;/code&gt; costs &lt;code&gt;1.45 USD&lt;/code&gt; and selling &lt;code&gt;1 GBP&lt;/code&gt; gives me &lt;code&gt;1.45 USD&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I put an order of &lt;code&gt;100,000&lt;/code&gt; on this pair on the buy side. Does this usually mean (if there even is a fixed convention for this) I buy &lt;code&gt;100,000 GBP&lt;/code&gt;, which means it costs me &lt;code&gt;145,000 USD&lt;/code&gt;, or does it mean I pay &lt;code&gt;100,000 USD&lt;/code&gt; and get &lt;code&gt;68,965 GBP&lt;/code&gt;?&lt;/p&gt;&#xA;" OwnerUserId="30054" LastActivityDate="2018-06-26T14:05:11.480" Title="Is order amount related to base or quote in a currency pair?" Tags="&lt;fx&gt;&lt;currency&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36520" PostTypeId="1" AcceptedAnswerId="36530" CreationDate="2017-10-19T12:34:06.123" Score="0" ViewCount="2073" Body="&lt;p&gt;let's assume I have a portfolio of two funds (call them F1 and F2), where, by convention, there is a monthly compounding of the returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On a monthly basis, the contribution of each fund will just be Weight_Fi*Return_Fi.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On an annual basis, though, since the assumption is that there is monthly compounding in the whole portfolio (in the sense that Return_portfolio_year = (1+Return_portfolio_jan)*(1+Return_portfolio_feb)...) I cannot think of any straightforward way to calculate the annual contribution of each fund.&lt;/p&gt;&#xA;" OwnerUserId="22383" LastActivityDate="2017-10-20T05:59:58.667" Title="How to calculate the annual contribution of a fund to a portfolio of funds?" Tags="&lt;portfolio-management&gt;&lt;returns&gt;&lt;portfolio&gt;&lt;funds&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="36522" PostTypeId="1" CreationDate="2017-10-19T14:26:37.623" Score="0" ViewCount="323" Body="&lt;p&gt;I am writing a program to price American put options with binomial pricing model and to compare it with the market price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I used made-up numbers for $\sigma$ and $r$, the price by binomial pricing model is very close to its European counterpart by Black-Scholes equation. (And always a little bit higher which makes sense since American puts should be worth more than European puts). So my code should be correct in this sense.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And my question is what volatility and interest rate I should use?&lt;br&gt;&#xA;&lt;strong&gt;1.&lt;/strong&gt; If the duration of the option is 1 month, should I use $std(log(\frac{S_{i+1}}{S_i}))$ for the past month as the volatility $\sigma$ in the model?&lt;br&gt;&#xA;&lt;strong&gt;2.&lt;/strong&gt; For the interest rate $r$, I found that some people suggest to use the treasury rate for the corresponding duration of the option. However, I found no source saying whether the rates on &lt;a href=&quot;https://www.treasury.gov/resource-center/data-chart-center/interest-rates/Pages/TextView.aspx?data=yield&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.treasury.gov/resource-center/data-chart-center/interest-rates/Pages/TextView.aspx?data=yield&lt;/a&gt; are continuously compounded or annually compounded. I tried using both. But both of the resulted option prices are still way off from the market value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any other related suggestions are more than welcome. If anyone with practical experience can answer these naive questions, I'd really appreciate it. &lt;/p&gt;&#xA;" OwnerUserId="27823" LastEditorUserId="16148" LastEditDate="2017-10-19T14:38:38.313" LastActivityDate="2017-10-19T14:38:38.313" Title="How to estimate $\sigma$ and $r$ in binomial pricing model?" Tags="&lt;option-pricing&gt;&lt;volatility&gt;&lt;interest-rates&gt;&lt;binomial-tree&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="36524" PostTypeId="1" CreationDate="2017-10-19T16:08:21.563" Score="1" ViewCount="1222" Body="&lt;p&gt;I am here for the first time and read quite a few posts before asking this question. In my class, my finance Professor wrote the formula for Tracking Error $TE$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$TE = \sqrt{(1-R^2)} \times \sigma$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\sigma$ stands for the standard deviation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't find this formula in any of the books. Could anyone help me to understand the relationship between $R^2$, $\sigma$ and $TE$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="30084" LastEditorUserId="26595" LastEditDate="2017-10-19T17:45:40.170" LastActivityDate="2017-10-19T17:51:15.807" Title="What is the formulat to compute Tracking Error?" Tags="&lt;standard-deviation&gt;&lt;tracking-error&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36527" PostTypeId="2" ParentId="36524" CreationDate="2017-10-19T17:42:50.893" Score="3" Body="&lt;p&gt;The simplest and most common method for finding the Tracking Error of Fund X versus a Benchmark B is to compute the standard deviation of the differences in monthly returns of the Fund and the Benchmark:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$TE=\text{STDEV}(r_{X,i}-r_{B,i})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A slightly more complicated method involves performing a regression of Fund X returns on the benchmark returns. Then we compute $$TE = \sqrt{(1-R_{XB}^2)} \times \sigma_X$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $R^2_{XB}$ is the R-squared of the regression, i.e. the percentage of the variance of the fund returns that is &quot;explained&quot; by benchmark returns (and so $(1-R^2_{XB})$ is the percentage of variance that IS NOT explained), and $\sigma_X$ is the standard deviation of fund returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These two definitions are not equivalent. In the first definition &quot;perfect tracking&quot; ($TE=0$) means that the fund returns copy the benchmark returns 1 to 1. The second definition the fund may track a version of the benchmark returns levered up or down (to find the degree of leverage implied, check the Beta of the Regression).   &lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-10-19T17:51:15.807" LastActivityDate="2017-10-19T17:51:15.807" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36529" PostTypeId="1" CreationDate="2017-10-20T03:02:03.047" Score="3" ViewCount="846" Body="&lt;p&gt;&lt;code&gt;Hull-White:&lt;/code&gt;&#xA;$$d r = [\theta(t) - ar]d t + \sigma d W_t.$$&#xA;There is a statement in John Hull's book:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The advantage of making $a$ or $\sigma$, or both, functions of time is that the models can be fitted more precisely to the prices of instruments that trade actively in the market.&lt;br&gt;&#xA;The disadvantage is that the volatility structure becomes nonstationary. The volatility term structure given by the model in the future is liable to be quite different from that existing in the market today.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\theta(t)$ can already match the initial curve in the market, what's the meaning of &lt;code&gt;fitted more precisely to the prices?&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\sigma(t)$ can match today's implied vol of all maturities, it should be better than $\sigma.$ How to understand &lt;code&gt;nonstationary?&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2018-08-11T00:03:02.457" Title="Time dependent parameters in Hull-White model" Tags="&lt;interest-rates&gt;&lt;hullwhite&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36530" PostTypeId="2" ParentId="36520" CreationDate="2017-10-20T05:59:58.667" Score="2" Body="&lt;p&gt;These problems arise when you compute arithmetic return contributions: in a given month, you want the sum of the funds' contributions to equal the portfolio return. The sum of these single-month contributions over more than one month will never equal the total portfolio returns over more than one month.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One way to include the compounding effect is to 'pretend' that a segment's return contribution in one period is reinvested in the overall portfolio in succeeding periods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example, with R code. There are just two periods: first F1 makes 10%, then F2 makes 10%. The weights of F1/F2 are kept constant at 50% each.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(&quot;PMwR&quot;)&#xA;weights &amp;lt;- rbind(c( 0.5, 0.5),&#xA;                 c( 0.5, 0.5))&#xA;&#xA;R &amp;lt;- rbind(c( 10,   0),&#xA;           c( 0 , -10))/100&#xA;&#xA;rc(R, weights, segment = c(&quot;F1&quot;, &quot;F2&quot;), timestamp = 1:2)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The output will be&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;$period_contributions&#xA;  timestamp   F1   F2 total&#xA;1         1 0.05 0.00  0.05&#xA;2         2 0.00 0.05  0.05&#xA;&#xA;$total_contributions&#xA;    F1     F2  total &#xA;0.0525 0.0500 0.1025 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;F1 makes a higher overall contribution because its single-period&#xA;contribution occured earlier and hence is compounded by the&#xA;overall portfolio return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(The PMwR package, of which I am the author, is available from GitHub &lt;a href=&quot;https://github.com/enricoschumann/PMwR&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/enricoschumann/PMwR&lt;/a&gt; .)&lt;/p&gt;&#xA;" OwnerUserId="6857" LastActivityDate="2017-10-20T05:59:58.667" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="36532" PostTypeId="1" CreationDate="2017-10-20T07:49:59.373" Score="4" ViewCount="6860" Body="&lt;p&gt;I'm trying to implement a pricing model for fixed rate bonds with the code below.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import QuantLib as ql&#xA;import pandas as pd&#xA;&#xA;todaysDate = ql.Date(31, 8, 2017)&#xA;ql.Settings.instance().evaluationDate = todaysDate&#xA;&#xA;spotDates = [ql.Date(1,9,2017), ql.Date(5,9,2017), ql.Date(7,9,2017), ql.Date(14,9,2017),   ql.Date(21,9,2017), ql.Date(2,10,2017), ql.Date(31,10,2017), ql.Date(30,11,2017), ql.Date(2,1,2018), ql.Date(31,1,2018), ql.Date(28,2,2018), ql.Date(3,4,2018), ql.Date(30,4,2018)]&#xA;spotRates = [0.066682, 0.067199, 0.067502, 0.068526, 0.069462, 0.070742, 0.072984, 0.073566, 0.073174, 0.072844, 0.072610, 0.072467, 0.072366]&#xA;&#xA;dayCount = ql.Actual365Fixed()&#xA;calendar = ql.SouthAfrica()&#xA;interpolation = ql.Linear()&#xA;compounding = ql.Compounded&#xA;compoundingFrequency = ql.Semiannual&#xA;&#xA;spotCurve = ql.ZeroCurve(spotDates, spotRates, dayCount, calendar, &#xA;interpolation, compounding, compoundingFrequency)&#xA;spotCurveHandle = ql.YieldTermStructureHandle(spotCurve)&#xA;&#xA;issueDate = ql.Date(20, 4, 2009)&#xA;maturityDate = ql.Date(20, 4, 2018)&#xA;tenor = ql.Period(ql.Semiannual)&#xA;calendar = ql.SouthAfrica()&#xA;bussinessConvention = ql.Following&#xA;dateGeneration = ql.DateGeneration.Backward&#xA;monthEnd = False&#xA;&#xA;schedule = ql.Schedule (issueDate, maturityDate, tenor, calendar, bussinessConvention, bussinessConvention, dateGeneration, monthEnd)&#xA;&#xA;dayCount = ql.Actual365Fixed()&#xA;couponRate = 0.0925&#xA;coupons = [couponRate]&#xA;&#xA;settlementDays = 3&#xA;faceValue = 100&#xA;fixedRateBond = ql.FixedRateBond(settlementDays, faceValue, schedule, coupons, dayCount)&#xA;&#xA;bondEngine = ql.DiscountingBondEngine(spotCurveHandle)&#xA;fixedRateBond.setPricingEngine(bondEngine)&#xA;&#xA;fixedRateBond.NPV()&#xA;print(fixedRateBond.NPV())&#xA;print(fixedRateBond.dirtyPrice())&#xA;print(fixedRateBond.cleanPrice())&#xA;print(fixedRateBond.accruedAmount())&#xA;print(fixedRateBond.dayCounter())&#xA;print(fixedRateBond.settlementDate())&#xA;&#xA;for c in fixedRateBond.cashflows():&#xA;    print('%20s %12f' % (c.date(), c.amount()))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My cash flow schedule looks a bit strange, I would have expected values of 4.625.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;October 20th, 2009     4.637671&#xA;April 20th, 2010       4.612329&#xA;October 20th, 2010     4.637671&#xA;April 20th, 2011       4.612329&#xA;October 20th, 2011     4.637671&#xA;April 20th, 2012       4.637671&#xA;October 22nd, 2012     4.688356&#xA;April 22nd, 2013       4.612329&#xA;October 21st, 2013     4.612329&#xA;April 22nd, 2014       4.637671&#xA;October 20th, 2014     4.586986&#xA;April 20th, 2015       4.612329&#xA;October 20th, 2015     4.637671&#xA;April 20th, 2016       4.637671&#xA;October 20th, 2016     4.637671&#xA;April 20th, 2017       4.612329&#xA;October 20th, 2017     4.637671&#xA;April 20th, 2018       4.612329&#xA;April 20th, 2018     100.000000&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Model values produced are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;104.60163528858176&#xA;104.6774279539175&#xA;101.18016767994489&#xA;3.497260273972613&#xA;Actual/365 (Fixed) day counter&#xA;September 5th, 2017&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The value I get for accrued interest is spot on with the values provided by our internal system, but the prices are a bit off. &#xA;Clean price expectation is 100.81517 and Dirty price expectation is 104.31243&lt;/p&gt;&#xA;" OwnerUserId="20592" LastActivityDate="2020-05-17T21:58:31.590" Title="Pricing a fixed rate bond in Quantlib Python" Tags="&lt;fixed-income&gt;&lt;python&gt;&lt;quantlib&gt;" AnswerCount="3" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36534" PostTypeId="1" CreationDate="2017-10-20T13:31:34.367" Score="0" ViewCount="119" Body="&lt;p&gt;I've backed out a time series of risk-neutral densities of GBP/USD options using a non-parametric approach in Matlab and would like to assess their forecast ability by applying the unconditional test in section 2.3 (page 11) of Christoffersen and Mazzotta &quot;&lt;a href=&quot;https://www.mcgill.ca/desautels/files/desautels/CM_JFEC_05.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Accuracy of Density Forecasts from Foreign Exchange Options&lt;/a&gt;&quot;, JFinEmetr (2005). However, I am not sure how to go about obtaining a series of probability transforms from truncated RNDs. I am also very new to Matlab so any guidance regarding the implementation of Christoffersen and Mazzotta (2005) would be greatly appreciated. &lt;/p&gt;&#xA;" OwnerUserId="3351" LastEditorUserId="3351" LastEditDate="2017-10-20T22:26:17.287" LastActivityDate="2017-10-20T22:26:17.287" Title="Probability integral transforms of risk-neutral densities" Tags="&lt;programming&gt;&lt;implied-volatility&gt;&lt;risk-neutral-measure&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36536" PostTypeId="2" ParentId="36534" CreationDate="2017-10-20T18:40:18.160" Score="1" Body="&lt;p&gt;Calculate the &lt;em&gt;cumulative&lt;/em&gt; RNDs - these form a bijection from the observed returns through to (0,1). Reverse the map so that a random uniform samples a return from the distribution. Non-parametric sampling that recovers the estimated terminal density goven by vanilla option prices. &lt;/p&gt;&#xA;" OwnerUserId="27516" LastActivityDate="2017-10-20T18:40:18.160" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36541" PostTypeId="2" ParentId="34189" CreationDate="2017-10-20T23:38:12.430" Score="1" Body="&lt;p&gt;There is no such thing as number of independent bets when one is betting on a common random factor as we quants usually do. Grinold &amp;amp; Kahn’s formula is only relevant when the factor payoff is a constant over time. This is not interesting in practice. When the factor payoff is random, then Ding and Martin &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2730434&quot; rel=&quot;nofollow noreferrer&quot;&gt;The Fundamental Law of Active Management: Redux&lt;/a&gt; (2017) showed that the portfolio IR is basically IC divided by IC standard deviations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To put it more bluntly , the G&amp;amp;K formula is useless and misleading. It is a joke that CFAers have to learn this stuff.&lt;/p&gt;&#xA;" OwnerUserId="29791" LastEditorUserId="16160" LastEditDate="2017-10-21T13:42:13.280" LastActivityDate="2017-10-21T13:42:13.280" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36543" PostTypeId="1" CreationDate="2017-10-21T10:08:32.083" Score="2" ViewCount="543" Body="&lt;p&gt;I have a portfolio which is a subset of a benchmark. I want to minimise the tracking error between my portfolio and the benchmark.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Currently I use APT's risk model to do this. I set it to run for 10 iterations. Each iteration reduces the number of trades by approx 10% of the previous iteration and minimises the tracking error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wish to use my own risk model rather than APT for various reasons. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can minimise the tracking error using my own risk model. However I am not sure how to minimise the tracking error and constraining the number of trades like APT does.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One approach which is very crude is to minimise the tracking error and calculate the marginal contribution of each stock to the tracking error and to tell the optimiser that those stocks cannot be traded. What is a better way?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am using matlab and the tomlab optimiser, with the documentation below. So yes the objective function is non linear and we have linear constraints. I have seen that tomlab provides a mixed integer programming function however not sure how to incorporate it into my current problem?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt; % -----------------------------------------------------&#xA; %&#xA; % QP minimization problem:&#xA; %&#xA; %&#xA; %        min   0.5 * x' * F * x + c' * x.  x in R^n&#xA; %         x&#xA; %        s/t   x_L &amp;lt;=   x  &amp;lt;= x_U&#xA; %              b_L &amp;lt;= A x  &amp;lt;= b_U&#xA; %&#xA; % Equality equations: Set b_L==b_U&#xA; % Fixed    variables: Set x_L==x_U&#xA;%&#xA;% -----------------------------------------------------&#xA;%&#xA;% Syntax of qpAssign:&#xA;%&#xA;% function Prob = qpAssign(F, c, A, b_L, b_U, x_L, x_U, x_0, Name,...&#xA;%                 setupFile, nProblem, fLowBnd, x_min, x_max, f_opt, x_opt);&#xA;%&#xA;% INPUT (One parameter F must always be given. Empty gives default)&#xA;%&#xA;% F            The matrix F in 0.5 x' F x in the objective function&#xA;% c            The vector c in c'x in the objective function&#xA;% A            The linear constraint matrix&#xA;% b_L          The lower bounds for the linear constraints&#xA;% b_U          The upper bounds for the linear constraints&#xA;% x_L          Lower bounds on x&#xA;% x_U          Upper bounds on x &#xA;%&#xA;%              b_L, b_U, x_L, x_U must either be empty or of full length&#xA;%&#xA;% x_0          Starting point x (may be empty)&#xA;% Name         The name of the problem (string)&#xA;% setupFile    The (unique) name as a TOMLAB Init File. If nonempty qpAssign&#xA;%              will create a executable m-file with this name and the given&#xA;%              problem defined as the first problem in this file.&#xA;%              See qp_prob.m, the TOMLAB predefined QP Init File.&#xA;%              If empty, no Init File is created. Also see nProblem.&#xA;% nProblem     Number of problems, or problem number, to define in the setupFile&#xA;%              Not used if setupFile is empty.&#xA;%&#xA;%              nProblem = 1 ==&amp;gt; File is created to make it easy to edit new&#xA;%              problems into the file. Text are included on how to add new&#xA;%              problems. The given problem is set as number 1.&#xA;%              If isempty(nProblem) same as nProblem=1.&#xA;%&#xA;%              length(nProblem) &amp;gt; 1 ==&amp;gt; A file suitable for large test sets&#xA;%              are setup, where the problem definition is read from mat-files.&#xA;%              Statements for problems nProblem(1) to nProblem(2) are defined.&#xA;%              The given input is assumed to be nProblem(1), and the&#xA;%              corresponding mat-file is created.&#xA;%&#xA;%              If nProblem &amp;gt; 1. Additional problems are assumed, and the only&#xA;%              thing done is to create a mat-file with the problem.&#xA;%&#xA;%              If isempty(setupFile), nProblem is not used&#xA;%&#xA;% fLowBnd      A lower bound on the function value at optimum. Default -1E300&#xA;%              A good estimate is not critical. Use [] if not known at all.&#xA;%              Only used running some nonlinear TOMLAB solvers with line search&#xA;% x_min        Lower bounds on each x-variable, used for plotting&#xA;% x_max        Upper bounds on each x-variable, used for plotting&#xA;% f_opt        Optimal function value(s), if known (Stationary points)&#xA;% x_opt        The x-values corresponding to the given f_opt, if known.&#xA;%              If only one f_opt, give x_opt as a 1 by n vector&#xA;%              If several f_opt values, give x_opt as a length(f_opt) x n matrix&#xA;%              If adding one extra column n+1 in x_opt,&#xA;%              0 indicates min, 1 saddle, 2 indicates max.&#xA;%              x_opt and f_opt is used in printouts and plots.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="7530" LastEditorUserId="7530" LastEditDate="2017-10-24T15:15:41.873" LastActivityDate="2017-10-24T15:50:17.880" Title="minimise tracking error whilst reducing number of trades required" Tags="&lt;portfolio-management&gt;&lt;risk&gt;&lt;risk-management&gt;&lt;portfolio-optimization&gt;&lt;tracking-error&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36544" PostTypeId="1" CreationDate="2017-10-21T12:55:34.950" Score="3" ViewCount="836" Body="&lt;p&gt;I'm currently reading a book demonstrating how Stochastic Optimal Control can solve common optimization problems encountered within quantitative finance. I haven't covered much continuous mathematics at this level (most of my degree was discrete) I would probably find it easier understanding the practical solution via a code implementation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any online resources solving Stochastic Optimal Control problems via code?&lt;/p&gt;&#xA;" OwnerUserId="5168" LastActivityDate="2018-08-24T03:11:00.320" Title="Code examples of solving Stochastic Optimal Control problems" Tags="&lt;portfolio-management&gt;&lt;stochastic-calculus&gt;&lt;portfolio-optimization&gt;&lt;stochastic-control&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="36546" PostTypeId="1" CreationDate="2017-10-21T18:43:22.257" Score="0" ViewCount="126" Body="&lt;p&gt;In Excel you have the daily prices of all the stocks in the S&amp;amp;P 500 for 3 years; and the index itself.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using all the data how might you determine which stocks had company specific movement during the 3 year period?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The simplest thing I can think of is to regress each stock against the index and then filter down to those with r-squared closest to &lt;code&gt;0&lt;/code&gt;.  Another option is to use the correlation and filtering for those closest to &lt;code&gt;-1&lt;/code&gt;, but negative beta isn't necessarily company specific movement.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to make this first iteration as simple as possible and easily visible using Excel.  Is there a better approach?&lt;/p&gt;&#xA;" OwnerUserId="30107" LastActivityDate="2017-10-22T10:30:27.783" Title="Correlation or r-squared to determine if a stock has specific movement relative to an index?" Tags="&lt;risk-models&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36547" PostTypeId="1" CreationDate="2017-10-21T21:10:35.540" Score="1" ViewCount="496" Body="&lt;p&gt;I have PCA models to capture Risk for Swaps trading &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have a question regarding a multi-leg package which has 4 legs (box spread).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Typically, a box spread is a switch between two Swap Spread, where a Swap Spread is trading the spread between the Swap and the Bond yield. &#xA;   So the 4 leg package has 2 Swaps leg and 2 Bond leg.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, the following structure:-&#xA;Leg 1: Buy the 10Y Swap&#xA;Leg 2: Sell the 10Y Bencmark Bond&#xA;Leg 3: Sell the 30Y Swap&#xA;Leg 4: Buy the 30Y Benchmark Bond&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The trade is done as a relative value trade since the trader thinks the 10Y swap spread is cheaper relative to the 30Y Swap spread.&#xA;What's the best way I can capture the risk of this package, using a PCA model?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="24131" LastActivityDate="2017-10-22T11:03:46.020" Title="Using PCA model to capture Risk on a box trade on Swap spread" Tags="&lt;fixed-income&gt;&lt;risk&gt;&lt;swaps&gt;&lt;interest-rate-swap&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36548" PostTypeId="1" AcceptedAnswerId="47155" CreationDate="2017-10-21T22:53:16.963" Score="2" ViewCount="702" Body="&lt;p&gt;I'm reading &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.62.1248&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Pricing American Options using LU decomposition&lt;/a&gt; by Ikonen and &#xA;Toivanen (IT).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They reference &lt;a href=&quot;http://www.math.ku.dk/~rolf/teaching/thesis/BrSch.AmrPut.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;The valuation of American put options&lt;/a&gt; by Brennan and Schwartz, and cast it as method that uses LU decomposition to solve the linear complementarity problem (LCP) arising in the discretisation of the Black-Scholes &quot;PDI&quot; for American options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On page 9, IT write:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&quot;It is obvious that the use of the max-function in the backward substitution is possible because of the form of the solution of the option pricing problem.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this mean that the Brennan-Schwartz method of modified back substitution exactly the LCP exactly? If so, I don't think this is &lt;em&gt;obvious&lt;/em&gt;. Is there a proof of it anywhere?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And on a related note, if Brennan-Schwartz solves the LCP exactly then why doesn't Wilmott use it in his &quot;The Mathematics of Financial Derivatives&quot;? He uses Projected Successive Over-relaxation (PSOR) exclusively, which is shown by IT to be a lot slower than using LU decomposition.&lt;/p&gt;&#xA;" OwnerUserId="23872" LastActivityDate="2019-08-17T20:48:46.643" Title="Brennan-Schwartz algorithm for pricing American options" Tags="&lt;american-options&gt;&lt;numerical-methods&gt;&lt;black-scholes-pde&gt;&lt;finite-difference-method&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36549" PostTypeId="2" ParentId="36546" CreationDate="2017-10-21T23:27:14.060" Score="1" Body="&lt;p&gt;Company specific movement can be estimated as the standard deviation of monthly residuals. So, regress each firm with the index and estimate the monthly residuals. Calculate the standard deviation of monthly residuals for each firm. Then use residual risk as an estimate of the magnitude of firm specific movement. &lt;/p&gt;&#xA;" OwnerUserId="28909" LastActivityDate="2017-10-21T23:27:14.060" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36550" PostTypeId="1" AcceptedAnswerId="36569" CreationDate="2017-10-22T06:11:27.690" Score="1" ViewCount="92" Body="&lt;p&gt;I am currently analyzing the performance of stocks with high/low corporate social responsibility rating. Some companies went bankrupt during the observation period and I wonder how long I should keep them in my sample. For example, if a company went bankrupt in September 2009, but return data is provided up until 2015, should I keep it in the sample or should I drop it after September 2009? I want to mitigate the survivorship bias, but am afraid that keeping a bankrupt company might distort results. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for your help and have a nice day!&lt;/p&gt;&#xA;" OwnerUserId="28706" LastActivityDate="2017-10-23T20:05:07.903" Title="Analyzing stock performance - keep companies after bankruptcy?" Tags="&lt;equities&gt;&lt;portfolio-management&gt;&lt;portfolio&gt;&lt;portfolio-selection&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36551" PostTypeId="2" ParentId="36546" CreationDate="2017-10-22T10:30:27.783" Score="2" Body="&lt;p&gt;&lt;strong&gt;Short answer&lt;/strong&gt;: to find the companies with the higher specific risk, look for the regressions with higher mean squared residuals.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Long Answer&lt;/strong&gt;: If you are interested in company specific risk, what you are doing is kind of right. The lower the $R^{2}$ is, the higher the ratio of company specific risk to total risk is.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at the $R^{2}$ alone is not sufficient to compare company specific risks between companies, because some of them might have very different levels of total risk. After each regression you should compute the company specific risk (which is just the Mean squared residuals).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The risks are connected by following equation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\sigma^{2}_{total}= \beta^{2} \sigma^{2}_{market}+ \sigma^{2}_{specific} $$&lt;/p&gt;&#xA;" OwnerUserId="29404" LastActivityDate="2017-10-22T10:30:27.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36552" PostTypeId="2" ParentId="36547" CreationDate="2017-10-22T11:03:46.020" Score="3" Body="&lt;p&gt;Since the 10 year and 30 year swap spreads are frequently traded and have time series available, think of this as a 2 variable problem.  You then have a simple &quot;spread of spreads&quot; trade which is easily analysed using PCA type methodology.  You should find a high correlation between these two spreads, so the variability of the spread of spreads is quite low.   &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-10-22T11:03:46.020" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36553" PostTypeId="1" CreationDate="2017-10-22T11:16:51.767" Score="5" ViewCount="198" Body="&lt;p&gt;Given an Ito-process $X(t)$, $t\in[0,T]$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$X(t)=X_{0}+\int_{0}^{t}F(s)ds + \int_{0}^{t}G(s)dW(s)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;with $F\in \mathbb{L}^{1}(0,T)$ and $G\in\mathbb{L}^{2}(0,T)$.&#xA;It is now often claimed that this representation is unique (up to indistinguishability of the processes $F$ and $G$).&#xA;By linearity it is enough to assume the case $X=0$ and to show that $X_{0}=0$, $F=0$ and $G=0$. Taking $t=0$, it follows immediately that $X_{0}=0$. I now thought one could just use simply the fact that  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\int_{0}^{t}G(s)dW(s)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is a martingale as well as to use Ito-isometry to prove this. If we have shown that $F=0$. Then &#xA;$$ 0 = \mathbb{E}\left[\left(\int_{0}^{t}G(s)dW(s) \right)^{2}\right]=\mathbb{E}\left[\int_{0}^{t}G^{2}(s)ds \right]$$ by Ito-isometry. Thus $$\int_{0}^{t}G^{2}(s)ds=0$$ almost surely.&#xA;Can I now already conclude that $G=0$ up to indistinguishability?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, how do I show that $F=0$?&lt;/p&gt;&#xA;" OwnerUserId="27389" LastActivityDate="2018-03-25T12:18:07.340" Title="Ito representation unique up to indistinguishability? Proof?" Tags="&lt;stochastic-calculus&gt;&lt;martingale&gt;&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36557" PostTypeId="1" AcceptedAnswerId="36561" CreationDate="2017-10-22T23:44:47.160" Score="1" ViewCount="207" Body="&lt;p&gt;I'm trying to solve the next exercise:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $g(S_{T})=S_{T}^{n}$ be the pay-off of a power option. Show that it's price is given by $v(t,x)=\phi(t,T)x^{n}.$ &#xA;Find the function $\phi(t,T)$ using risk-neutral value and PDE of Black-Scholes to find $\phi(t,T)$ solving a ODE.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've done both computations but my answers do not match. I'm not sure if I'm understanding right both methods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using first method gives me $e^{(n-1)r(T-t)-\frac{n\sigma^2(T-t)(1-n(T-t))}{n}},$ by the other hand $e^{r(1-n)-\frac{r(1-n)-n(n-1)\sigma^2t}{2}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How am I doing wrong?&lt;/p&gt;&#xA;" OwnerUserId="30119" LastActivityDate="2017-10-23T11:37:52.417" Title="Price of the form $v(t,x)=\phi(t,T)x^n$ for a power option" Tags="&lt;black-scholes&gt;&lt;risk-neutral-measure&gt;&lt;exotics&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36558" PostTypeId="1" CreationDate="2017-10-23T06:42:32.487" Score="1" ViewCount="589" Body="&lt;p&gt;Not &quot;non-monetary event&quot; because that would make too much sense. I've never really seen this kind of a question before, but someone asked me that question because they didn't know what it meant either, it has something to do with stocks after a split as far as I can gather, but no online source seems to use that phrase.&lt;/p&gt;&#xA;" OwnerUserId="30123" LastActivityDate="2019-10-22T05:37:18.093" Title="What is a &quot;monetary non-event&quot; for a corporation?" Tags="&lt;equities&gt;&lt;finance&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36559" PostTypeId="1" CreationDate="2017-10-23T08:06:32.100" Score="0" ViewCount="64" Body="&lt;p&gt;Question: At time=0 company A enters an 3y interest rate swap with a bank, where A recieves floating and pays fixed. After 1y, at t=1, the inflation changes from 1% to 3% does this affect the MV of the swap?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Attempt: Since &lt;code&gt;nominal rate = real rate + inflation&lt;/code&gt; and the nominal is fixed here in this interest rate swap, the real rate A pays will go down hence they are better off. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Attempt 2: If A were to enter an IRS at t=1 they would have to pay a higher fixed rate than they do in the IRS they entered at t=0 so they are better off.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this correct?&lt;/p&gt;&#xA;" OwnerUserId="12002" LastActivityDate="2017-10-23T08:06:32.100" Title="Does MV of IRS depend on inflation?" Tags="&lt;interest-rate-swap&gt;&lt;inflation&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36561" PostTypeId="2" ParentId="36557" CreationDate="2017-10-23T08:40:07.573" Score="2" Body="&lt;p&gt;&lt;strong&gt;From Black-Scholes PDE&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The option price $V(t,S)$ satisfies the Black-Scholes PDE:&#xA;$$ \frac{\partial V}{\partial t} + rS \frac{\partial V}{\partial S} + \frac{1}{2} \sigma^2 S^2 \frac{\partial^2 V}{\partial S^2} - r V = 0 $$&#xA;with boundary condition $V(T,S) = g(S) = S^n $.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Plugging in the fact that $V(t,S) := \phi(t,T) S^n$ yields the following ODE for the function $\phi(t,T)$&#xA;$$ \phi' + \left( r n + \frac{1}{2} \sigma^2 n (n-1) - r \right) \phi = 0 \tag{1} $$&#xA;The solution of writes&#xA;$$ \phi(t,T) = A e^{\mu t} $$ &#xA;for some constant $A \in \Bbb{R}$ yet to be determined and $\mu$ the root of the characteristic polynomial of $(1)$&#xA;$$ \mu = - (n-1) \left( r + \frac{1}{2} \sigma^2 n \right) $$&#xA;Now applying the boundary condition $$V(T,S) = S^n \iff \phi(T,T) = 1$$ allows to determine the constant $A$ and we eventually find&#xA;$$ \phi(t,T) = \exp\left( (n-1) \left( r + \frac{1}{2} \sigma^2 n \right) (T-t) \right) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;From martingale pricing&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a Black-Scholes framework (GBM diffusion setting) and conditionally on the information available at $t$ we have that under the measure associated to the money market account numéraire (risk-neutral measure)&#xA;$$ S_T = S_t \exp\left( \left( r - \frac{1}{2}\sigma^2\right)(T-t) + \sigma\left(W_T-W_t\right) \right) $$&#xA;such that &#xA;$$ g(S_T) = S_T^n = S_t^n \exp\left( n\left( r - \frac{1}{2}\sigma^2\right)(T-t) + n\sigma\left(W_T-W_t\right) \right) $$&#xA;Adding and subtracting half of the quadratic variation of the process $n \sigma (W_T - W_t)$ in the argument of the exponential allows us to rewrite this as &#xA;\begin{align}&#xA;S_T^n &amp;amp;= S_t^n \exp\left( n\left( r - \frac{1}{2}\sigma^2\right)(T-t) + \frac{n^2 \sigma^2}{2}(T-t)- \frac{n^2 \sigma^2}{2}(T-t) + n\sigma\left(W_T-W_t\right) \right) \\&#xA;&amp;amp;= S_t^n \exp\left( \left( nr+ n(n-1)\frac{1}{2}\sigma^2\right) (T-t) \right) \mathcal{E}\left[ n\sigma(W_T-W_t) \right]&#xA;\end{align} &#xA;where $\mathcal{E}[\cdot]$ is a stochastic exponential of unit expectation (Doléans-Dade exponential). Now, since we're working in the measure associated to the money market account numéraire the price of the power option writes:&#xA;\begin{align}&#xA;V_t &amp;amp;= \Bbb{E}_t \left[ \exp(-r(T-t)) g(S_T) \right] \\&#xA;&amp;amp;= \exp(-r(T-t)) \cdot S_t^n \exp\left( \left( nr+ n(n-1)\frac{1}{2}\sigma^2\right) (T-t) \right) \cdot 1 \\&#xA;&amp;amp;= \underbrace{\exp\left( (n-1) \left( r+ n \frac{1}{2}\sigma^2\right) (T-t) \right)}_{:= \phi(t,T)} S_t^n&#xA;\end{align}&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2017-10-23T11:37:52.417" LastActivityDate="2017-10-23T11:37:52.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36562" PostTypeId="1" CreationDate="2017-10-23T12:01:55.133" Score="2" ViewCount="108" Body="&lt;p&gt;When pricing options, especially in the theoretical literature getting high precision, say up to 8 decimal places is always a competitive goal. Though realistically in a practical setting is such precision always needed? If prices are only quoted up to x decimal places (as a side what is the precision most prices are quoted up to, 5 dp?), do we actually only need to worry about precision up to this point, and any thing else is but academic? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="11762" LastActivityDate="2017-10-23T12:01:55.133" Title="Practical precision for Options Pricing" Tags="&lt;options&gt;&lt;trading&gt;&lt;numerical-methods&gt;&lt;best-practices&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36566" PostTypeId="2" ParentId="30483" CreationDate="2017-10-23T16:09:34.000" Score="0" Body="&lt;p&gt;The most important rule of backtesting is to ensure that you do not fall into the 'look-ahead' bias trap. IMHO, while adjusting for splits, bonuses and dividends in regular strategies does not cause look ahead bias, in case of pair trading it &lt;em&gt;does&lt;/em&gt; influence the backtesting results. I realised this when using backtesting results of about 750 pairs to choose the best performing pairs and trade them henceforth. Since the spread in pair trading is derived from prices (or log prices), to backtest on adjusted close prices implies measuring profitability of trades in the past that would have actually not been triggered (or best been triggered at different price points) by the strategy. This is especially troublesome when only one of the instruments in the pair has an adjusted close price different from the real close price; that is only one instrument has undergone a split while the other has not. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;While trading one of the pairs, I realised that profit/loss accrued from the trade as of now (say 23rd Oct 2017) might be very different from the profit/loss generated by the trade as shown in the backtest result carried out on the very same pair using adjusted close prices 2 years from now (assuming one of the stocks undergoes a split before that). In fact I would even go further to say that using the adjusted close prices two years from now in a backtest may not even trigger a signal to enter the trade on 23rd Oct 2017.  Hence it is my belief (a reasonable one I hope) that adjusted close prices introduce look-ahead bias into pair trade backtesting. I haven't come across any academic paper or quant site discussing this issue but have experienced while trading myself. It would be nice if you could share the link of the paper that you ran into.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To avoid this situation as mentioned above, I select only those pairs that have not undergone splits or bonus issue after the starting point of the backtest period. It yields less profitable but more dependable results.&lt;/p&gt;&#xA;" OwnerUserId="28645" LastActivityDate="2017-10-23T16:09:34.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36567" PostTypeId="1" AcceptedAnswerId="36598" CreationDate="2017-10-23T17:52:25.573" Score="1" ViewCount="131" Body="&lt;p&gt;In a Time Series Book by Hashem Pesaran, he mentions that there are a number of issues that need to be addressed in order to choose an adequate model for predicting asset returns. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand the other 4 considerations in the picture but I don't understand what it means for the squares or absolute values of returns to be independently distributed over time? Why is that different from the distribution being constant over time which includes the variance being constant over time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/01KyO.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/01KyO.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="29941" LastEditorUserId="29941" LastEditDate="2017-10-25T21:50:27.147" LastActivityDate="2017-10-25T21:50:27.147" Title="Why should we care if the &quot;squares of returns are independently distributed over time&quot; to choose an adequate model of the distribution of returns?" Tags="&lt;time-series&gt;&lt;returns&gt;&lt;distribution&gt;&lt;expected-return&gt;&lt;asset-returns&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36569" PostTypeId="2" ParentId="36550" CreationDate="2017-10-23T19:25:55.003" Score="3" Body="&lt;p&gt;It could be useful to set ex-ante what is your investable universe. &#xA;It is pretty typical that at any period of time you would track only names wich are part of a Benchmark (SP500, R1000, FTSE, Nikkei 225 etc). Or set your own rule for what would consider an investable company. Usually the main criteria are : Market Cap, Market Cap accessible to global investors and median or average liquidity in the last 6 (or 1,3,12) months.&#xA;As you observed it is critical that you have no survivorship bias. That's why Benchmarks constructed by reputable vendors is usually a safe way to go.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, apply your investment policy/rule to analyze the performance of stocks with high/low corporate social responsibility rating that are in your investable universe. In the forward returns (holding a stock) make sure you take into account any bankruptcy and stocks moving out of your investable universe.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example: You buy company &quot;FOO&quot; at the end of December 2015 and you have a yearly rebalance process. The company might go bankrupt in August 2016. So when you are holding this name for a year you will likly have a -99.99% return for that name when you rebalance at the end of December 2016. At the same time the likely outcome is that that name is not in your investable universe anymore and would not impact again your performance. This is very similar to how most portfolio managers would operate in general.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can adjust this methodology for a different frequency. The essential is to have a sense of what is an investable stock at point t, independently of what will happen in the future (no survivorship bias and no look ahead bias).&lt;/p&gt;&#xA;" OwnerUserId="19661" LastEditorUserId="19661" LastEditDate="2017-10-23T20:05:07.903" LastActivityDate="2017-10-23T20:05:07.903" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36570" PostTypeId="1" CreationDate="2017-10-23T19:26:26.520" Score="0" ViewCount="349" Body="&lt;p&gt;If I have a portfolio of stocks that I invest in and out of at different holding periods and different times of the year. How would one calculate the annualized returns and annualized sharpe ratio of the portfolio? &lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Edit&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;I am trying so far: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Right now my idea was... take the cumulative gross profit of the portfolio, so summing the daily PnL for all stocks say from year 2009 to present day. Then I did the following, I use R - &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Annualized return&#xA; Aret &amp;lt;- (1+total.PnL.sum)^(1/8.51685393258427)-1 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;is this somewhat correct for the annualized return? I am using 8.51 years... as all the stock purchases were over 8.5 years at different times etc.. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or do you assume a 252 number here?&lt;/p&gt;&#xA;" OwnerUserId="25673" LastEditorUserId="25673" LastEditDate="2017-10-24T00:41:07.230" LastActivityDate="2017-10-24T00:41:07.230" Title="Calculate Annualized Return / Annualized Sharpe From Portfolio" Tags="&lt;programming&gt;&lt;sharpe-ratio&gt;&lt;performance-evaluation&gt;&lt;annualized&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36571" PostTypeId="2" ParentId="36570" CreationDate="2017-10-24T00:10:28.680" Score="1" Body="&lt;ol&gt;&#xA;&lt;li&gt;For finding the returns during a calendar year (or other period) there are two methods:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;a) The IRR (internal rate of return) method requires the values of the portfolio at the end of year n-1 and end of year n, and the dates and amounts of any cash additions/withdrawals from the portfolio during the year.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you put these dates and amounts into an Excel sheet, the =XIRR() function can be used to compute the rate of return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is also a simple formula called the Modified Dietz method that can be used to find the approximate rate of return given the same information (the two won't give exactly the same result, however).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;b) A more sophisticated method called the TWR (Time Weighted Return) is used by most mutual funds and institutional investors, but it requires more information. You  need the starting and ending values of the portfolio, the dates and amounts of cash flows, but also the value of the portfolio at the time of these external cash inflows/outflows. This will allow you to compute an exact rate of return between two inflow/outflow events; you then link together the returns during these &quot;closed&quot; periods to find the TWR for the entire year.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One convenient way to handle these calculations is to pretend that your portfolio is actually a mutual fund from which you withdraw or add money. You keep track of the number of Units the MF has issued and the Net Asset Value per unit. When you add/withdraw money the number of units increases/decreases (issuance/redemption process); at the close of that day you also compute the value of the portfolio and divide by number of units to find the NAV per unit. This is sometimes called the BAI method of accounting.&lt;/p&gt;&#xA;&#xA;&lt;ol start=&quot;2&quot;&gt;&#xA;&lt;li&gt;Finally, computing the Sharpe ratio requires the most information of all. For this you need the NAV for every trading day of the year (typically 252 days), or equivalently the daily return for each trading day of the year. Some brokerage firms will let you download the daily values of your portfolio and the daily inflows/outflows, from which you can compute the daily returns.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-10-24T00:10:28.680" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="36572" PostTypeId="1" CreationDate="2017-10-24T02:32:23.383" Score="-2" ViewCount="1119" Body="&lt;p&gt;Define the time-0 log-moneyness of a call on stock $S$ with strike $K$ and expiry $T$ to be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\log(S(0)\exp(rT)/K)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What does it mean for the strikes K to be at-the-log-moneyness?? I guessed this but i don't think it is right:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\log(K) = \log(S(0)\exp(rT)/K)$$&lt;/p&gt;&#xA;" OwnerUserId="30131" LastEditorUserId="26595" LastEditDate="2017-10-24T08:43:00.900" LastActivityDate="2017-10-24T08:43:00.900" Title="Log-moneyness definition" Tags="&lt;options&gt;&lt;monte-carlo&gt;&lt;derivatives&gt;&lt;call&gt;&lt;quants&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2017-11-03T20:05:34.273" ContentLicense="CC BY-SA 3.0" />
  <row Id="36573" PostTypeId="1" CreationDate="2017-10-24T03:04:36.323" Score="2" ViewCount="493" Body="&lt;p&gt;I am trying to understand what was done &lt;a href=&quot;http://www.etf.com/sections/features/23070-finding-smart-beta-in-the-factor-zoo.html?nopaging=1&quot; rel=&quot;nofollow noreferrer&quot;&gt;in this study&lt;/a&gt; by Research Affiliates on the small cap anomaly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking at Table 1, how are the authors actually calculating the p-value?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have read that the p-value can be derived by way of calculating the t-value from the &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Sharpe Ratio * the sqrt(N) with N being the number of observations&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Using R, I have tried to back into the p-value with the below, but have not had much success here. I am assuming that the data is monthly, which is what you will see below, but changing for daily does not change the result significantly.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#US P Value&#xA;# 46 years * 12 months&#xA;#.01 as difference in Small vs. Large cap Sharpe&#xA;46*12&#xA;.01*sqrt(552)&#xA;2*pt(-abs(.01*sqrt(552)),df=552-1)&#xA;&#xA;#US P value - post Banz&#xA;# 31 years * 12 months &#xA;#.06 as difference in Small vs. Large cap Sharpe&#xA;31*12&#xA;.06*sqrt(372)&#xA;2*pt(-abs(.06*sqrt(372)),df=372-1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Results:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; #US P Value&#xA;&amp;gt; # 46 years * 12 months&#xA;&amp;gt; 46*12&#xA;[1] 552&#xA;&amp;gt; .01*sqrt(552)&#xA;[1] 0.2349468&#xA;&amp;gt; 2*pt(-abs(.01*sqrt(552)),df=552-1)&#xA;[1] 0.8143373&#xA;&amp;gt; &#xA;&amp;gt; #US P value - post Banz&#xA;&amp;gt; # 31 years * 12 months &#xA;&amp;gt; 31*12&#xA;[1] 372&#xA;&amp;gt; .06*sqrt(372)&#xA;[1] 1.157238&#xA;&amp;gt; 2*pt(-abs(.06*sqrt(372)),df=372-1)&#xA;[1] 0.2479196&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Please let me know if there is additional information I can provide / any questions.&lt;/p&gt;&#xA;" OwnerUserId="30132" LastActivityDate="2018-01-19T17:40:30.997" Title="p-value of Sharpe Ratio Differences" Tags="&lt;statistics&gt;&lt;sharpe-ratio&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36574" PostTypeId="2" ParentId="36572" CreationDate="2017-10-24T06:18:23.730" Score="2" Body="&lt;p&gt;I would guess it means K=S(0)*exp(rt), so that log moneyness is zero.   &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-10-24T06:18:23.730" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36575" PostTypeId="1" CreationDate="2017-10-24T07:21:36.877" Score="0" ViewCount="45" Body="&lt;p&gt;The price of a non-zero coupon bond (with dicrete discounting) is found using&#xA;$$B = \frac{C}{r}\Bigg(1-\frac{1}{(1+r)^n}\Bigg) + \frac{P}{(1+r)^{n}}$$ or for a continuously dicounted version:&#xA;$$B = C\cdot e^{-r}\Bigg(\frac{1-e^{-r \cdot n}}{1-e^{-r}}\Bigg) + P\cdot e^{-r \cdot n}$$&#xA;where $C$ -- coupon payment, $P$ -- face value, $n$ -- number of compounding periods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now  $r$ depending on the context is called yield to maturity, the return required by investor or base interest rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems that often an implicit suggestion is made that:&#xA;$$return  \; required \; by \; investor \; = base \; interest \; rate$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is as follows: is above equality true or is yield (or return required by investor) more like&#xA;$$r (i, c)$$&#xA;a function of base interest rate $i$ and credit worthiness $c$?&lt;/p&gt;&#xA;" OwnerUserId="11655" LastActivityDate="2017-10-24T08:11:52.487" Title="Is return required by a bond investor a function of base interest rate and credit worthiness of the issuer?" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36576" PostTypeId="2" ParentId="36575" CreationDate="2017-10-24T08:11:52.487" Score="1" Body="&lt;p&gt;Yes, in the US,  the yield on a bond equals the yield on a US Treasury bond with a similar maturity plus a credit spread reflecting the creditworthiness of the issuer.  If the issuer is high quality the spread might be a low number (say 0.50%), and if the issuer is low quality it could be much higher say 2%).  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-10-24T08:11:52.487" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36577" PostTypeId="1" CreationDate="2017-10-24T08:25:05.390" Score="0" ViewCount="57" Body="&lt;p&gt;I am always curious as to how people on wall street forecast every single item on a company's balance out up to 3 years. It seems to me just pure false accuracy in order to come up with a price target.&lt;/p&gt;&#xA;" OwnerUserId="6804" LastActivityDate="2017-10-24T08:25:05.390" Title="How do analyst on Wall Street forecast whole balance sheet" Tags="&lt;equities&gt;&lt;accounting&gt;&lt;dcf&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36579" PostTypeId="2" ParentId="36543" CreationDate="2017-10-24T11:56:02.657" Score="1" Body="&lt;p&gt;First of all we need to make clear the difference between the risk model and the optimizer.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;The Risk Model&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;The risk model is how you evaluate the risk and tracking error of your portfolio. In most risk models this would be implemented by using something of the form&lt;/p&gt;&#xA;&#xA;&lt;p&gt;w'eSe'w + wI&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;w is a [nx1] vector of your stocks weight&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;e is [nxm] matrix representing the risk factor loading of your stocks&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;S is a [mxm] matrix of the covariance of your risk factor&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I is an [nx1] vector of your stocks idiosyncratic volatility (the&#xA;volatility which is not explained by the risk factors)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;This can come from any risk model vendor or you can create your own as you indicate.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;The Optimization&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Now the second problem and where your question is actually difficult to answer is how to optimize. We dont know which software you are currently using or would like to use to solve your optimization problem so I'll try to be quite general.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The optimisation problem you want to solve is to find the set of stock weights such that you minimise &lt;/p&gt;&#xA;&#xA;&lt;p&gt;w'eSe'w + wI&lt;/p&gt;&#xA;&#xA;&lt;p&gt;typically there would be constraints such that Aw=b (linear constraints) and l &amp;lt; w &amp;lt; b (bound constraints) and potentially other linear or quadratic terms in your objective&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since your objective is of quadratic form and your constraints linear most solver would be able to handle that efficiently.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now your question relates to the maximum number of trades to be done. This is typically considered to be a Mixed Integer Programming (MIP) where you have an hidden variable which can be 1 or 0 for each of the trade w-w* to be done or not. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is not a simple task to optimize. What you suggest could actually be used and is a heuristic that can be applied within the general solution : Branch-and-Bound.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Essentially in branch and bound you want to evaluate multiple combinations of that hidden variable to see which one would produce the most optimal solution subject to your constraints and how close it gets to the bound of the relaxed optimal solution. If the dimensionality is particularly high this is not a trivial problem and you would need to define several things such as the actual branching mechanism and the stopping mechanism. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most (but not all) optimizer (commercially available or open-source) will have such functionalities and I would suggest you rely on them to implement those type of strategies. Otherwise you can read more on branch and bound and have your own implementation (although I would say in most cases this is not the recommended approach)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can also try different heuristics like the one that you described and hope that you are not too far from the optimal solution. Reading about branch and bound would help you evaluate this in any case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Without knowing which specific software you are using this is as general advice as I can give.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Good luck !&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;UPDATE&lt;/strong&gt; : Since you added which platform you are using : I would look into MILP/MIQP functionalities of the solver. Tomlab doesnt have out of the box solutions for this type of portfolio constraint so it's worth checking with Tomlab what modules you have paid for and would match MILP/MIQP solving.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One word of notice though : it is not trivial to implement, you would need to experiment and if the size of your universe is large (&gt;1000 names) the optimization can be particularly slow.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If you have time : learn and experiment :) - Expect at least a few weeks (2,4,8...16?) of work to get there even if you know what you are doing&lt;/li&gt;&#xA;&lt;li&gt;If you dont have time and no additional budget : Apply the heuristic&#xA;you described in an iterative way. Or some other reasonable&#xA;heuristics and compare which ones gives you the lowest T.E.&#xA;consistently.&lt;/li&gt;&#xA;&lt;li&gt;If you have some time and lots of budget go for a commercial solver, possibly specialized in portfolio construction problem that has specific BnB strategies for this type of problems.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Also worth adding : You might want to add a penalty for transaction costs in your utility function with a fixed amount per transaction (and potentially a percent per dollar traded and potentially with a market impact model). This might make the optimization a bit more natural and give you insights when you actually NEED to trade more than usual&lt;/p&gt;&#xA;" OwnerUserId="19661" LastEditorUserId="19661" LastEditDate="2017-10-24T15:50:17.880" LastActivityDate="2017-10-24T15:50:17.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36584" PostTypeId="1" CreationDate="2017-10-24T15:19:59.707" Score="0" ViewCount="128" Body="&lt;p&gt;I am trying to compute the RSI using the ticker price.&#xA;I have troubles at the time to implement the RSI when I want to compute it every 1 minute but using windows to compute the OHLC of 10 minutes.&#xA;I don't know how to use the OHCL resampling for example if I want to compute the RSI for a the time 03:55.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say that I use the close value as the input for the RSI. &#xA;Do I have to compute the close every 10 minute back at times 03:55, 03:45, 03:35, 03:25, ...., or I have to compute the OHLC values at times 03:50, 03:40, 03:30, 03:20 and the only &quot;truncated&quot; and incomplete window is the last one?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say the I use the following parameters :&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$\Delta t$: time window to compute the OHCL values&lt;/li&gt;&#xA;&lt;li&gt;$N$: number of windows used to compute the RSU&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;So the question would be, do I have to move jointly the hole big window $W=N \Delta t$ one minute at a time, or the the OHLC values for the previous complete windows remains constant (at times 03:50, 03:40, 03:30 ) and the only that is changing is the last one till it gets filled?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank's! &lt;/p&gt;&#xA;" OwnerUserId="30135" LastActivityDate="2017-10-25T16:02:44.640" Title="Correct way to compute RSI in a moving window" Tags="&lt;numerical-methods&gt;&lt;technical-analysis&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36585" PostTypeId="1" CreationDate="2017-10-24T20:24:50.553" Score="0" ViewCount="766" Body="&lt;p&gt;Let $X_t=\int_0^t W_s ds$ where $W_s$ is Brownian motion, so $E[W_s]=0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then $E[X_t]=\int_0^t E[W_s] ds=\int_0^t 0 ds=0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So $E[X_t|{\cal F}_s]=0\neq X_s$, almost everywhere.  So by previous sentence, $X_t$ is not a martingale.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Question:&lt;/em&gt; Is the above a correctly stated and argued proof that $X_t$ is not a martingale?&lt;/p&gt;&#xA;" OwnerUserId="29212" LastActivityDate="2017-10-24T20:24:50.553" Title="Proof that integral of Brownian motion wrt time is not a martingale" Tags="&lt;brownian-motion&gt;&lt;martingale&gt;" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="36586" PostTypeId="2" ParentId="36584" CreationDate="2017-10-24T20:39:21.037" Score="1" Body="&lt;p&gt;The concept of RSI was developed by Welles Wilder on the basis of close prices. On intraday prices, I would suggest to calculate RSI with all possible prices. Yes, that's a technical problem because of the amount of data! But this problem is the same as our ancestors have 40 years ago when computers were extremely expensive. So when you have a 10 minute conflation, I would compute it at the given times 03:50, 03:40, 03:30, 03:20 and store it in database. So on 04:00, you calculate a new value for 04:00 and take the history values for 3:50, 3:40 from your database. &#xA;&lt;a href=&quot;https://i.stack.imgur.com/SjYlU.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/SjYlU.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="22515" LastEditorUserId="22515" LastEditDate="2017-10-25T16:02:44.640" LastActivityDate="2017-10-25T16:02:44.640" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36587" PostTypeId="1" CreationDate="2017-10-24T21:13:47.560" Score="-2" ViewCount="64" Body="&lt;p&gt;i want to ask about the  variable &quot;market beta&quot; which exist in the Fama and French article &quot;the cross-section of expected returns (1992) . beta it does mean the measure of risk which we know it in the asset pricing model? or it's another thing?  &lt;/p&gt;&#xA;" OwnerUserId="30141" LastActivityDate="2017-10-25T01:35:04.407" Title="market Beta in fama french (1992)" Tags="&lt;finance&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2017-10-27T10:14:11.400" ContentLicense="CC BY-SA 3.0" />
  <row Id="36588" PostTypeId="2" ParentId="36587" CreationDate="2017-10-25T01:35:04.407" Score="1" Body="&lt;p&gt;You can think of FF as a generalization of CAPM. CAPM has Beta, FF has three Betas: $\beta_1,\beta_2,\beta_3$. But $\beta_1$, called the &quot;market  beta&quot; is exactly the same as the Beta in CAPM. &lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-10-25T01:35:04.407" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36591" PostTypeId="1" CreationDate="2017-10-25T03:41:01.963" Score="1" ViewCount="159" Body="&lt;p&gt;I intend to regress the correlation coefficient (rolling window and/or DCC) between NIKKEI 225 adjusted close and 10yr Japanese government bonds on inflation , inflation expectations and other factor which may or may not be important in order to evaluate their relative impact on the correlation coefficient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I can't seem to find a sophisticated enough explanation for the correlation's existence other than the changing dynamics of the demand for these asset classes (viewing them as substitutes).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A discounted dividends model suggest a strictly positive relationship, but the data suggests otherwise. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the fundamental reasons for the correlation between stock returns and government bond yields that would explain the correlation switching signs?&lt;/p&gt;&#xA;" OwnerUserId="30144" LastActivityDate="2017-11-24T08:41:50.447" Title="Correlation between bond yields and stock returns?" Tags="&lt;equities&gt;&lt;correlation&gt;&lt;bond-yields&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36592" PostTypeId="2" ParentId="36518" CreationDate="2017-10-25T04:26:43.423" Score="0" Body="&lt;p&gt;Neither. Your order would be rejected without an &quot;amount currency&quot; to specify the size of the quote (or deal) otherwise the dealer can't properly assign a spread to you. Spreads are decided according to asset / inventory in this case either GBP or USD and the dealer needs to know which one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you're touching on is market convention about which way around dealers like to deal with currency instruments. There's an established order, 1 underlying reason for that is which way round is it easier to do the conversion maths... but again whether you're priced in GBPUSD or USDGBP you need to give your order a size either in USD or GBP.&lt;/p&gt;&#xA;" OwnerUserId="7369" LastActivityDate="2017-10-25T04:26:43.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36595" PostTypeId="2" ParentId="36591" CreationDate="2017-10-25T07:54:41.550" Score="2" Body="&lt;p&gt;Why do you say a DDM suggests a positive relationship between govt bond yield and stock price ? If yield gets higher the present value of future dividends is lower (maintaining risk premium and dividend growth constant).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also the discount rate is bond yield + risk premium and the risk premium is inversely correlated with the govt bond yield so these effects tend to at least cancel out (during an economic crisis govt bond yields go down but risk premium goes up usually more, furthermore dividend and estimated dividend growth are also lower).&lt;/p&gt;&#xA;" OwnerUserId="1181" LastActivityDate="2017-10-25T07:54:41.550" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36598" PostTypeId="2" ParentId="36567" CreationDate="2017-10-25T11:30:47.533" Score="0" Body="&lt;p&gt;First it is not returns but residuals and squared residuals of your model that should be IID.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second, it is required that squared residuals are IID because you are not only interested on your mean forecast &lt;strong&gt;but also about the variance of your forecast.&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Imagine two cases : &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;your forecasted value is 0.5 but its variance is unknown because residuals of your models have time-varying variance. The variance of your forecast may be 0.2 or 0.8, you simply don't know it. (in fact you only know its central tendency)&lt;/li&gt;&#xA;&lt;li&gt;your forecasted value is still 0.5 but you know for sure that it has a certain variance (let's say 0.2) because it is derived of the variance of your squared residuals that is constant.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;In the second case you are able to build a confidence interval about your forecast but not in the first case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To sum up, residuals must be IID to be sure that the mean forecast is correct. Squared residuals must be IID to infer the variance of your forecast and to be able to build multi-step forecast and confidence bands.&lt;/p&gt;&#xA;" OwnerUserId="7008" LastActivityDate="2017-10-25T11:30:47.533" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36599" PostTypeId="2" ParentId="29663" CreationDate="2017-10-25T12:01:28.643" Score="3" Body="&lt;p&gt;Well, you need to know what is the stochashtic model you are using for $y_T$, if you assume it's a geometric brownian motion you have this process :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$y_T = y_0 e^{\sigma W_T - \frac{1}{2} \sigma^2T} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you compute the expectation and variance you get &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \mathbb{E}(y_T) = y_0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Var(y_T) = {y_0}^2( e^{\sigma^2 T }-1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As  $y_0 $ is constant you have $\mathbb{E}((y_T-y_0)^2) = Var(y_T)+(\mathbb{E}(y_T)-y_0)^2$ (using the variance formula)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which gives $\mathbb{E}((y_T-y_0)^2) = y_0^2 (e^{\sigma^2 T}-1)$&#xA;if you have $\sigma^2 T$ small you can perfom a taylor's expansion and you'll have the result shown&lt;/p&gt;&#xA;" OwnerUserId="30150" LastActivityDate="2017-10-25T12:01:28.643" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36601" PostTypeId="1" CreationDate="2017-10-25T15:49:07.407" Score="5" ViewCount="2494" Body="&lt;p&gt;I keep reading/hearing that the results from mean-var optimization is max Sharpe ratio. It seems making sense if you fix either target return or target risk, but in general, it doesn't seems right, for example, $J1$ and $J2$ are target function:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$J1 = \mu\prime w - \lambda w\prime\Sigma w.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$J2 = (\mu\prime w)/\sqrt{w\prime\sigma w}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The optimal solution of $J1$ and $J2$ should be very different, because $J1$ depends on lambda, $J2$ does not, not to mention the derivatives respect to w are very different.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;what am I missing here? &lt;/p&gt;&#xA;" OwnerUserId="30153" LastEditorUserId="30153" LastEditDate="2017-10-25T16:07:55.760" LastActivityDate="2018-11-20T22:48:59.347" Title="mean variance optimization vs max sharpe ratio" Tags="&lt;sharpe-ratio&gt;&lt;mean-variance&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36602" PostTypeId="1" AcceptedAnswerId="36767" CreationDate="2017-10-25T16:39:30.390" Score="4" ViewCount="2204" Body="&lt;p&gt;I've been trying to get the zero rates of the Chilean Swap curve with Quantlib in Python, but I haven't been able to set up the parameters correctly. This is my code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import QuantLib as ql&#xA;import pandas as pd&#xA;&#xA;#Custom Calendar with Chilean Holidays&#xA;def create_calendar_chile(start_year,n_years):&#xA;    Chile = ql.WeekendsOnly()&#xA;    days = [1,14,15,1,21,26,2,16,15,18,19,9,27,1,19,8,17,25,31]&#xA;    months = [1,4,4,5,5,6,8,9,9,10,10,11,12,12,12,12]&#xA;    name = ['Año Nuevo','Viernes Santo','Sabado Santo','Dia del Trabajo','Dia de las Glorias Navales','San Pedro y San Pablo','Elecciones Primarias','Dia de la Virgen del Carmen','Asuncion de la Virgen','Independencia Nacional','Glorias del Ejercito','Encuentro de dos mundos','Día de las Iglesias Evangélicas y Protestantes','Día de todos los Santos','Elecciones Presidenciales y Parlamentarias','Inmaculada Concepción','Segunda vuelta Presidenciales','Navidad','Feriado Bancario']&#xA;    for i in range(n_years+1):&#xA;        for x,y in zip(days,months):&#xA;            date = ql.Date(x,y,start_year+i)&#xA;            Chile.addHoliday(date)&#xA;&#xA;    return Chile&#xA;&#xA;&#xA;&#xA;today = ql.Date(25, 10, 2017)&#xA;ql.Settings.instance().evaluationDate = today&#xA;&#xA;swap_clp = [2.46, 2.40, 2.40, 2.41, 2.54, 2.68, 3.01, 3.3, 3.53, 3.69, 3.87, 4.02, 4.13, 4.23, 4.38, 4.38, 4.56]&#xA;terms = [3,6,9,12,18,2,3,4,5,6,7,8,9,10,12,15,20]&#xA;## SWAP Parameters ##&#xA;calendar = create_calendar_chile(2001,50)&#xA;bussiness_convention = ql.Following&#xA;day_count = ql.Actual360()&#xA;&#xA;#Overnigth Rate&#xA;TPM = 2.5&#xA;depo_helper = [ql.DepositRateHelper(ql.QuoteHandle(ql.SimpleQuote(TPM/100)),ql.Period(1,ql.Days),1,calendar,ql.Unadjusted,False,ql.Actual360())]&#xA;&#xA;#Swap Rates&#xA;swap_helpers = []&#xA;for i in range(len(terms)):&#xA;    if i &amp;lt; 4:&#xA;        coupon_frequency = ql.Once&#xA;        tenor = ql.Period(terms[i],ql.Months)&#xA;        rate = swap_clp[i]&#xA;        swap_helpers.append(ql.SwapRateHelper(ql.QuoteHandle(ql.SimpleQuote(rate/100.0)),tenor, calendar,coupon_frequency, bussiness_convention,day_count,ql.Euribor3M()))&#xA;    else:&#xA;        coupon_frequency = ql.Semiannual&#xA;        tenor = ql.Period(terms[i],ql.Years)&#xA;        rate = swap_clp[i]&#xA;        swap_helpers.append(ql.SwapRateHelper(ql.QuoteHandle(ql.SimpleQuote(rate/100.0)),tenor, calendar,coupon_frequency, bussiness_convention,day_count,ql.Euribor3M()))&#xA;&#xA;#Yield Curve&#xA;rate_helpers = depo_helper + swap_helpers&#xA;yieldcurve = ql.PiecewiseLinearZero(today,rate_helpers,day_count)&#xA;&#xA;spots = []&#xA;tenors = []&#xA;for d in yieldcurve.dates():&#xA;    yrs = day_count.yearFraction(today, d)&#xA;    compounding = ql.Simple&#xA;    freq = ql.Annual&#xA;    zero_rate = yieldcurve.zeroRate(yrs, compounding, freq)&#xA;    tenors.append(yrs)&#xA;    eq_rate = zero_rate.equivalentRate(day_count,compounding,freq,today,d).rate()&#xA;    spots.append(100*eq_rate)&#xA;&#xA;datatable = {'Dates':yieldcurve.dates(),'Tenors':tenors,'spots':spots}&#xA;df = pd.DataFrame.from_dict(datatable)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And I'm getting the following results:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt; df&#xA;                 Dates     Tenors     spots&#xA;0   October 25th, 2017   0.000000  0.000000&#xA;1   October 27th, 2017   0.005556  2.500087&#xA;2   January 29th, 2018   0.266667  2.461170&#xA;3     April 27th, 2018   0.511111  2.401418&#xA;4      July 27th, 2018   0.763889  2.401059&#xA;5   October 29th, 2018   1.025000  2.410821&#xA;6   October 28th, 2019   2.036111  2.739493&#xA;7   October 27th, 2020   3.050000  3.141727&#xA;8   October 27th, 2021   4.063889  3.529495&#xA;9   October 27th, 2022   5.077778  3.875600&#xA;10  October 27th, 2023   6.091667  4.157661&#xA;11  October 28th, 2024   7.111111  4.495323&#xA;12  October 27th, 2025   8.122222  4.817217&#xA;13  October 27th, 2026   9.136111  5.100542&#xA;14  October 27th, 2027  10.150000  5.390948&#xA;15  October 29th, 2029  12.186111  5.945168&#xA;16  October 27th, 2032  15.225000  6.352031&#xA;17  October 29th, 2035  18.272222  2.707640&#xA;18  October 27th, 2037  20.297222  8.655828&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The zero rates are wrong according to Bloomberg boostrap (leaving aside smalls differences in the rates and dates). I'm using the Euribor3M index in the Swap Helpers but I assume thats wrong. How could I set up a custom index in python? Also, the zero levels seem to be kind of high compared to the real zeros:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Bloomberg:&#xA;Date    Days    Term    InstType    Mid Zero&#xA;26-10-2017  1   O/N CASH    2,500   2,500&#xA;30-01-2018  97  3 MO    CASH    2,460   2,460&#xA;30-04-2018  187 6 MO    CASH    2,400   2,400&#xA;30-07-2018  278 9 MO    CASH    2,400   2,400&#xA;30-10-2018  370 1 YR    CASH    2,410   2,410&#xA;30-04-2019  552 18 MO   CASH    2,540   2,540&#xA;30-10-2019  735 2 YR    SWAP    2,680   2,684&#xA;30-10-2020  1101    3 YR    SWAP    3,010   3,024&#xA;29-10-2021  1465    4 YR    SWAP    3,300   3,327&#xA;28-10-2022  1829    5 YR    SWAP    3,540   3,582&#xA;30-10-2023  2196    6 YR    SWAP    3,700   3,752&#xA;30-10-2024  2562    7 YR    SWAP    3,870   3,939&#xA;30-10-2025  2927    8 YR    SWAP    4,030   4,119&#xA;30-10-2026  3292    9 YR    SWAP    4,140   4,243&#xA;29-10-2027  3656    10 YR   SWAP    4,230   4,346&#xA;30-10-2032  5484    15 YR   SWAP    4,380   4,502&#xA;30-10-2037  7310    20 YR   SWAP    4,560   4,742&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="20751" LastEditorUserId="848" LastEditDate="2017-10-28T15:55:14.260" LastActivityDate="2017-11-06T14:02:45.463" Title="Swap Bootstrapping with quantlib" Tags="&lt;python&gt;&lt;quantlib&gt;" AnswerCount="2" CommentCount="5" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36603" PostTypeId="2" ParentId="36601" CreationDate="2017-10-25T17:12:54.393" Score="2" Body="&lt;p&gt;&lt;strong&gt;In theory in the case of a constrained optimisation and in practice they are not.&lt;/strong&gt; &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However...&#xA;A lot of practitioner wants to achieve the best Sharpe Ratio for their portfolio. But as you describe it in J2 the term is not linear nor quadratic and is much harder to optimise especially in the context of the multitude of constraints that would occur in a typical portfolio optimisation framework&lt;/p&gt;&#xA;&#xA;&lt;p&gt;J1 is nicely quadratic so it is a lot easier to optimise. And it has this nice property that you would want to maximise u'w and minimise wSw which aligns in terms of conceptual goals with getting the best possible Sharpe Ratio&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But in reality they are not equivalent and J2 is highly unpractical and rarely used. Also with J2 a passive portfolio with 0 tracking error would be always the best solution in the absence of other constraints... So the vast majority of practitioner would use a variant of J1&lt;/p&gt;&#xA;" OwnerUserId="19661" LastEditorUserId="19661" LastEditDate="2017-10-25T17:56:03.487" LastActivityDate="2017-10-25T17:56:03.487" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36605" PostTypeId="1" AcceptedAnswerId="36613" CreationDate="2017-10-26T04:38:28.363" Score="1" ViewCount="420" Body="&lt;p&gt;In the proof of &lt;code&gt;Dupire equation&lt;/code&gt; we end up with an identity involving the &lt;code&gt;Dirac delta function&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to prove that&#xA;$$\dfrac{E[\sigma_T^2\delta(S_T-K)]}{E[\delta(S_T-K)]}=E[\sigma_T^2|S_T = K].$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\delta(x)$ is the  &lt;code&gt;Dirac delta function.&lt;/code&gt; $S_T$ is a random variable, and $\sigma_T$ also.&lt;/p&gt;&#xA;" OwnerUserId="26165" LastEditorUserId="19887" LastEditDate="2017-10-26T20:01:14.153" LastActivityDate="2017-10-26T20:01:14.153" Title="Conditional expectation and Dirac delta function" Tags="&lt;local-volatility&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36607" PostTypeId="1" AcceptedAnswerId="36754" CreationDate="2017-10-26T05:57:45.737" Score="0" ViewCount="23" Body="&lt;p&gt;I seem to remember someone telling me a while back that a good indicator of future equity performance was how &quot;institutionally under-owned&quot; a given equity is versus its weight in a given broad market index (e.g., Russell 3000).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I cannot seem to remember the terms he used, but I do remember he cited academic research as supporting this premise.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I cannot find very much literature on this topic and/or data to support the claim.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone point me to a paper or resource on this potential market anomaly? &lt;/p&gt;&#xA;" OwnerUserId="26547" LastEditorUserId="26547" LastEditDate="2017-10-26T06:37:55.843" LastActivityDate="2017-11-05T07:19:00.513" Title="Possible correlations to institutional allocations versus market capitalization" Tags="&lt;data&gt;&lt;indicator&gt;&lt;anomalies&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36608" PostTypeId="2" ParentId="33423" CreationDate="2017-10-26T07:15:41.057" Score="2" Body="&lt;p&gt;To correct two points in @AlexC's otherwise great answer:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;The given points are of the form $(t, r(t))$:&#xA;$$\begin{eqnarray*}\left(0,\frac{499}{10^4}\right),&amp;amp;&#xA;\left(\frac14,\frac{533}{10^4}\right),\\&#xA;\left(\frac12, \frac{575}{10^4}\right),&amp;amp;&#xA;\left(\frac34,\frac{653}{10^4}\right).\end{eqnarray*}$$&#xA;The cubic polynomial $r(t)=at^3+bt^2+ct+d$ thus is not all that bad: it has $d=499\cdot 10^{-4}$, and&#xA;$$\begin{eqnarray*}a \cdot 2^{-6}+b\cdot 2^{-4}+c\cdot 2^{-2}+d=533\cdot 10^{-4}\\&#xA;a \cdot 2^{-3}+b\cdot 2^{-2}+c\cdot 2^{-1}+d=575\cdot 10^{-4}\\&#xA;a \cdot 3^32^{-6}+b\cdot 3^22^{-4}+c\cdot 3\cdot2^{-2}+d=653\cdot 10^{-4}\end{eqnarray*}$$&lt;/li&gt;&#xA;&lt;li&gt;The accumulated amount is $A(1)=A(0)\cdot e^{\int_0^1 r(t)\,dt}$ where $A(0)=\$78,000$.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;Here are some details on finding $a$, $b$, and $c$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{eqnarray*}a \cdot 2^{-2}+b+c\cdot 2^{2}+d\cdot 2^4=533\cdot 5^{-4}\\&#xA;a \cdot 2^{1}+b\cdot 2^{2}+c\cdot 2^{3}+d\cdot 2^4=575\cdot 5^{-4}\\&#xA;a \cdot 3^32^{-2}+b\cdot 3^2+c\cdot 3\cdot2^{2}+d\cdot 2^4=653\cdot 5^{-4}\end{eqnarray*}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{eqnarray*}\frac14a+b+4c+16d=533\cdot 5^{-4}\\&#xA;2a+4b+8c+16d=575\cdot 5^{-4}\\&#xA;\frac{27}4a+9b+12c+16d=653\cdot 5^{-4}\end{eqnarray*}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note $16d=499\cdot 5^{-4}$ so this becomes&#xA;$$\begin{eqnarray*}\frac14a+b+4c=34\cdot 5^{-4}\\&#xA;2a+4b+8c=76\cdot 5^{-4}\\&#xA;\frac{27}4a+9b+12c=154\cdot 5^{-4}\end{eqnarray*}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{bmatrix}\frac14&amp;amp;1&amp;amp;4\\&#xA;2&amp;amp;4&amp;amp;8\\&#xA;\frac{27}4&amp;amp;9&amp;amp;12\end{bmatrix}^{-1}=\begin{bmatrix}2&amp;amp;-2&amp;amp;\frac23\\&#xA;-\frac52&amp;amp;2&amp;amp;-\frac12\\&#xA;\frac34&amp;amp;-\frac38&amp;amp;\frac1{12}\end{bmatrix}$$&#xA;so&#xA;$$\begin{bmatrix}a\\ b\\ c\end{bmatrix}=5^{-4}\begin{bmatrix}2&amp;amp;-2&amp;amp;\frac23\\&#xA;-\frac52&amp;amp;2&amp;amp;-\frac12\\&#xA;\frac34&amp;amp;-\frac38&amp;amp;\frac1{12}\end{bmatrix}\begin{bmatrix}34\\ 76\\ 154\end{bmatrix}$$&lt;/p&gt;&#xA;" OwnerUserId="7431" LastActivityDate="2017-10-26T07:15:41.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36609" PostTypeId="2" ParentId="19564" CreationDate="2017-10-26T07:30:33.823" Score="0" Body="&lt;p&gt;From rewriting&#xA;$$A(t)=(1+i)^t = e^{t\ln(1+i)}$$&#xA;we get by the Chain Rule that&#xA;$$\delta_t = \frac{A'(t)}{A(t)}=\frac{\ln(1+i)\cdot e^{t\ln(1+i)}}{A(t)}=\ln(1+i).$$&lt;/p&gt;&#xA;" OwnerUserId="7431" LastActivityDate="2017-10-26T07:30:33.823" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36610" PostTypeId="1" CreationDate="2017-10-26T07:35:53.677" Score="1" ViewCount="31" Body="&lt;p&gt;The following option exercise style is somewhere between American and European:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;There is a fixed &lt;strong&gt;grant date&lt;/strong&gt; $N_1$ at which you determine at which date $N_2&amp;gt;N_1$ the option will be exercised.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So once the grant date $N_1$ arrives, the option becomes European, i.e., you have to commit yourself to when the option will be exercised. But the choice of $N_2$ may depend on the history of stock prices up to time $N_1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps this is Bermudan or Verde. Is there a standard or succinct way to describe it?&lt;/p&gt;&#xA;" OwnerUserId="7431" LastActivityDate="2017-10-26T07:35:53.677" Title="Option style with grant date" Tags="&lt;options&gt;&lt;american-options&gt;&lt;european-options&gt;&lt;bermudan&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36611" PostTypeId="1" AcceptedAnswerId="36614" CreationDate="2017-10-26T07:58:59.367" Score="5" ViewCount="814" Body="&lt;p&gt;I have run across the term &quot;model-free finance&quot; (e.g. there was a &lt;a href=&quot;http://www.thalesians.com/finance/index.php/Events/Seminars&quot; rel=&quot;noreferrer&quot;&gt;Thalesian talk&lt;/a&gt; in London recently), yet haven't found any real definition of it nor anything really substantial.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you point me to resources or material which could provide some ideas what this new approach is all about?&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2017-10-26T08:38:18.863" Title="What is model-free finance?" Tags="&lt;finance&gt;&lt;arbitrage&gt;&lt;reference-request&gt;&lt;models&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36612" PostTypeId="2" ParentId="36611" CreationDate="2017-10-26T08:15:30.077" Score="1" Body="&lt;p&gt;It sounds a bit like the game-theoretic probability (GTP) of Shafer and Vovk. See &#xA;&lt;a href=&quot;http://www.probabilityandfinance.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.probabilityandfinance.com&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you know when pricing a simple binomial option, instead of talking about risk-neutral measure you can argue directly that a certain price is correct (by linearity essentially). In GTP they keep going in that direction and try to eliminate probability measures in favor of game strategies. So if this is right then model-free really means probability-measure-free.&lt;/p&gt;&#xA;" OwnerUserId="7431" LastActivityDate="2017-10-26T08:15:30.077" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36613" PostTypeId="2" ParentId="36605" CreationDate="2017-10-26T08:20:41.363" Score="3" Body="&lt;p&gt;Slightly abusing notations&#xA;\begin{align}&#xA;\Bbb{E}\left[ \sigma^2_T \vert S_T = K \right] &amp;amp;= \int_{0}^{+\infty} \sigma^2_T \, p( \sigma^2_T \vert S_T = K) d\sigma^2_T \\&#xA;&amp;amp;= \int_{0}^{+\infty} \sigma^2_T \frac{p(\sigma^2_T, S_T=K)}{p(S_T=K)} d\sigma^2_T &#xA;\\&#xA;&amp;amp;= \frac{\int_{0}^{+\infty} \sigma^2_T p(\sigma^2_T, S_T=K) d\sigma^2_T }{p(S_T=K)} \\&#xA;&amp;amp;= \frac{\int_{0}^{\infty} \int_{0}^{+\infty} \sigma^2_T \delta(S_T-K) p(\sigma^2_T, S_T) d\sigma^2_T dS_T }{\int_{0}^{+\infty} \delta(S_T-K) p(S_T) dS_T} \\&#xA;&amp;amp;= \frac{\Bbb{E}\left[ \sigma^2 \delta(S_T-K) \right]}{\Bbb{E}\left[ \delta(S_T-K) \right]}&#xA;\end{align}&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2017-10-26T08:20:41.363" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36614" PostTypeId="2" ParentId="36611" CreationDate="2017-10-26T08:38:18.863" Score="3" Body="&lt;p&gt;Carefully searching Mark Davis' webpage I found this article&#xA;&lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2593587&quot; rel=&quot;nofollow noreferrer&quot;&gt;Model-Free Methods in Valuation and Hedging of Derivative Securities&lt;/a&gt; which seems to be a survey on this topic.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I quote from the abstract:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In contrast to conventional model-based derivative pricing, a recent&#xA;  stream of research aims to investigate what prices are consistent with&#xA;  absence of arbitrage, given only the current prices of traded options&#xA;  on the same underlying. This paper gives a succinct survey of work in&#xA;  this area. After summarising results on the Black-Scholes model, the&#xA;  volatility surface and the Breedon-Litzenberger (BL) and Dupire&#xA;  formulas, the two main streams of work are described.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2017-10-26T08:38:18.863" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36615" PostTypeId="1" CreationDate="2017-10-26T15:55:55.263" Score="1" ViewCount="131" Body="&lt;p&gt;Is there a ranking of Investment Banks institutional VWAP execution algorithms anywhere (who beats the benchmark price most consistently and by how much)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="29351" LastActivityDate="2017-10-26T15:55:55.263" Title="Investment Bank VWAP Execution ranking" Tags="&lt;quant-trading-strategies&gt;&lt;quantitative&gt;&lt;order-execution&gt;&lt;vwap&gt;&lt;active-investing&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36617" PostTypeId="2" ParentId="18885" CreationDate="2017-10-26T20:07:25.887" Score="2" Body="&lt;p&gt;There is no mystery here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $X$ is Gaussian, $E[e^X] = e^{E[X]+\frac{1}{2}V[X]}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, $$P_{30} = E[e^{-(40-30)z_{30}}] = e^{-E[(40-30)z_{30}] +\frac{1}{2}V[(40-30)z_{30}]]} &amp;gt; e^{-(40-30)E[z_{30}]} = e^{-(40-30)z_0}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fact that you are simulating a whole path is irrelevant since you could just as well simulate $z_{30}$ exactly with one step. I don't understand your point about the expected Brownian path. &lt;/p&gt;&#xA;" OwnerUserId="6901" LastActivityDate="2017-10-26T20:07:25.887" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36618" PostTypeId="1" AcceptedAnswerId="36622" CreationDate="2017-10-26T21:21:55.060" Score="1" ViewCount="451" Body="&lt;p&gt;Let $W_t$ be a Brownian motion, so $W_t=z_t \sqrt{t}$ where $z_t \in N(0,1)$ and the pdf of $z$ is &#xA;$f(z)=\frac{e^{-\frac{z^2}{2}}}{\sqrt{2\pi}}$.  So&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$E(W_t)=\int_{-\infty}^{\infty} W_t f(z) dz&#xA;=\int_{-\infty}^{\infty} z \sqrt{t} \frac{e^{-\frac{z^2}{2}}}{\sqrt{2\pi}} dz&#xA;=\int_{0}^{\infty} (z+(-z)) \sqrt{t} \frac{e^{-\frac{z^2}{2}}}{\sqrt{2\pi}} dz=0$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now suppose ${\cal F}_t$ is the &lt;a href=&quot;https://en.wikipedia.org/wiki/Natural_filtration&quot; rel=&quot;nofollow noreferrer&quot;&gt;natural filtration&lt;/a&gt; for $W_t$.  By construction of Brownian motion, we are given that $E(W_t|{\cal F}_s)=W_s, 0\leq s\leq t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Question&lt;/em&gt;: How do I write $E(W_t|{\cal F}_s)$ as a Riemann integral expression similar to the Riemann integral expression of $E(W_t)$ given above?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt; I have done extensive Google search on this, without finding any responsive exposition.  If this question is beside the point, please explain why.  If it's on point, please answer with the Riemann integral expression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note&lt;/em&gt;: &lt;a href=&quot;https://math.stackexchange.com/questions/2489707/write-expectation-of-brownian-motion-conditional-on-filtration-as-an-integral&quot;&gt;Cross-posted.&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="29212" LastActivityDate="2017-10-27T08:40:52.467" Title="Write expectation of brownian motion conditional on filtration as an integral?" Tags="&lt;brownian-motion&gt;&lt;martingale&gt;&lt;expected-value&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36619" PostTypeId="2" ParentId="33947" CreationDate="2017-10-26T22:04:03.747" Score="0" Body="&lt;p&gt;Theoretically, both methods should give same result. But practically, term repo market is very illiquid (wide bid-offer that become wider further out you go, though you might find quotes for term repos to bond future delivery dates) plus the discount curve is never fully defined for bond markets, traders use their intuition to build one - unique curve does not exist. These two issues will give differences.&lt;/p&gt;&#xA;" OwnerUserId="7117" LastActivityDate="2017-10-26T22:04:03.747" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36620" PostTypeId="1" CreationDate="2017-10-27T00:53:25.510" Score="1" ViewCount="439" Body="&lt;p&gt;Trying to understand this answer here, but having difficulty. Would appreciate it if someone formally, mathematically wrote down the precise definitions here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/a/25330&quot;&gt;https://quant.stackexchange.com/a/25330&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is a &quot;financed position&quot;?&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;&quot;how much yield can increase before a financed position starts to lose&#xA;  money&quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What does this mean? Yield of what, exactly? What yield is this is? Is this yield-to-maturity, current yield, etc? Can someone write this down mathematically?&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;In dollar terms, carry = (ending accrued interest – starting accrued interest) – (starting price + starting AI) x repo rate x year fraction&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;What is &quot;starting&quot;/&quot;ending&quot; accrued interest, &quot;starting&quot; price (is this the bond's clean price?). &lt;/p&gt;&#xA;" OwnerUserId="30174" LastEditorUserId="30174" LastEditDate="2017-10-28T15:35:41.540" LastActivityDate="2017-10-28T15:35:41.540" Title="Definition of carry" Tags="&lt;fixed-income&gt;" AnswerCount="0" CommentCount="4" ClosedDate="2017-10-31T16:02:45.733" ContentLicense="CC BY-SA 3.0" />
  <row Id="36622" PostTypeId="2" ParentId="36618" CreationDate="2017-10-27T08:19:57.643" Score="1" Body="&lt;p&gt;Let $(W_t)_{t \geq 0}$ denote a standard Brownian motion and $\Bbb{F}=\{\mathcal{F}_t\}_{t \geq 0}$ the natural filtration it generates over some probability space $(\Omega, \Bbb{P})$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By definition, we know that $$\forall 0 &amp;lt; s &amp;lt; t, W_t - W_s \sim \sqrt{t-s}\, N(0, 1)$$ under $\Bbb{P}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Noting that $W_t = (W_t - W_s) + W_s$ and conditioning on the knowledge of $\mathcal{F}_s$ we could further write that&#xA;$$ W_t \vert \mathcal{F}_s \sim N(W_s, t-s)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Such that&#xA;\begin{align}&#xA;\Bbb{E}[W_t \vert \mathcal{F}_s] &amp;amp;= \int_{-\infty}^{+\infty} W_t p(W_t\vert\mathcal{F}_s) dW_t \\&#xA;&amp;amp;= \int_{-\infty}^{+\infty} x \frac{1}{\sqrt{2\pi(t-s)}}\exp\left(-\frac{1}{2}\left(\frac{x - W_s}{\sqrt{t-s}}\right)^2\right) dx \tag{A}\\&#xA;&amp;amp;= \underbrace{\int_{-\infty}^{+\infty} (x - W_s) \frac{1}{\sqrt{2\pi(t-s)}}\exp\left(-\frac{1}{2}\left(\frac{x - W_s}{\sqrt{t-s}}\right)^2\right) dx}_{=0} \dots \\&#xA;&amp;amp; \dots + W_s \int_{-\infty}^{+\infty}\underbrace{\frac{1}{\sqrt{2\pi(t-s)}}\exp\left(-\frac{1}{2}\left(\frac{x - W_s}{\sqrt{t-s}}\right)^2\right) dx}_{=1} \\&#xA;&amp;amp;= W_s&#xA;\end{align}&#xA;where $(A)$ is the result you're looking for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that this is basically the hand-wavy way of writing:&#xA;\begin{align}&#xA;\Bbb{E}[W_t \vert \mathcal{F}_s] &amp;amp;= \Bbb{E}[W_t -W_s + W_s \vert \mathcal{F}_s] \\ &#xA;&amp;amp;=  \Bbb{E}[W_t -W_s \vert \mathcal{F}_s] + \Bbb{E}[ W_s \vert \mathcal{F}_s] \\&#xA;&amp;amp;= 0 + W_s = W_s &#xA;\end{align}&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2017-10-27T08:40:52.467" LastActivityDate="2017-10-27T08:40:52.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36626" PostTypeId="1" CreationDate="2017-10-27T19:09:49.647" Score="7" ViewCount="732" Body="&lt;p&gt;The Black Derman Toy model of interest rates is usually introduced as the model governed by the stochastic differential equation: &#xA;$$d \ln r = \left[\theta(t) + \cfrac{\sigma'(t)}{\sigma(t)}\ln r \right]dt + \sigma(t) dz$$&#xA;However, originally the model was developed using binomial trees. The &lt;a href=&quot;http://marshallinside.usc.edu/dietrich/FAJ-1990-BlackDermanToy-OneFactor.pdf&quot; rel=&quot;noreferrer&quot;&gt;Black-Derman-Toy paper&lt;/a&gt; does not contain any differential equation. How does one show that the model constructed using binomial trees corresponds to the above differential equation in the continuous limit? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In a number of articles, for example the Black-Karasinski paper, the derivation is attributed to Hull and White's 1990 article &quot;Pricing interest-rate derivative securities&quot;, but it does not give the derivation, only states it as a fact. I have looked into other papers of Hull and White available from John Hull's &lt;a href=&quot;http://www-2.rotman.utoronto.ca/~hull/DownloadablePublications/index.html&quot; rel=&quot;noreferrer&quot;&gt;website&lt;/a&gt;, but did not find anything.&lt;/p&gt;&#xA;" OwnerUserId="30014" LastEditorUserId="30014" LastEditDate="2017-10-27T20:11:59.223" LastActivityDate="2017-11-05T00:01:38.903" Title="Black Derman Toy model: from tree to differential equation" Tags="&lt;interest-rates&gt;&lt;binomial-tree&gt;&lt;hullwhite&gt;&lt;black&gt;" AnswerCount="1" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36630" PostTypeId="1" CreationDate="2017-10-28T02:27:51.007" Score="1" ViewCount="40" Body="&lt;p&gt;Per-minute tick data for USDJPY is available &lt;a href=&quot;http://www.forextester.com/data/datasources&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.  Suppose we download this file to usdjpy.txt and then save it into a Numpy array in Python 3 as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import numpy as np&#xA;with open('USDJPY.txt','r') as f: data=f.readlines()&#xA;data=[x.split(',') for x in data][1:]&#xA;jpy=np.array([float(close) for (ticker,yy,time,open,high,low,close,vol) in data])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The per-minute returns in USDJPY, expressed in basis points, will be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;rjpy=10000.0*np.diff(jpy)/jpy[0:-1]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Define a histogram function and empirical PDF function as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def histc(X,bins):&#xA;    map_to_bins = np.digitize(X,bins)&#xA;    r = np.zeros(bins.shape)&#xA;    for i in map_to_bins:&#xA;        r[i-1] += 1&#xA;    return [r,map_to_bins]&#xA;&#xA;def epdf(S,numIntervals=100):&#xA;    minS=np.min(S)&#xA;    maxS=np.max(S)&#xA;    intervalWidth=(maxS-minS)/numIntervals&#xA;    x=np.arange(minS,maxS+intervalWidth/2.,intervalWidth)&#xA;    [ncount,ii]=histc(S,x)&#xA;    if ncount[1]&amp;gt;len(S)/2:&#xA;        medS=np.median(S)&#xA;        minS=0.8*medS&#xA;        maxS=1.2*medS&#xA;        intervalWidth=(maxS-minS)/numIntervals&#xA;        x=np.arange(minS,maxS+intervalWidth/2.,intervalWidth)&#xA;        [ncount,ii]=histc(S,x)&#xA;    relativefreq=ncount/sum(ncount)&#xA;    return (x,relativefreq)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The empirical PDF of USDJPY 1-minute pip returns is then:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(x,rf)=epdf(djpy,numIntervals=1000)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;which if we plot it&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;from bokeh.plotting import figure, show&#xA;from bokeh.io import output_notebook&#xA;output_notebook()&#xA;simple=[(x[i],int(100*rf[i])) for i in range(rf.shape[0]) if int(100*rf[i]) &amp;gt; 0]&#xA;X=np.array([x for x,y in simple])&#xA;Y=np.array([y for x,y in simple])&#xA;p=figure(plot_width=600,plot_height=200,tools=&quot;pan,wheel_zoom,box_zoom,reset,resize&quot;)&#xA;p.line(X,Y)&#xA;show(p)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Looks like this:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/FdPDh.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/FdPDh.png&quot; alt=&quot;PDF of 1 minute move of USDJPY&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now suppose I want to know what could happen in an hour (60 one-minute moves).  Following the answer to &lt;a href=&quot;https://math.stackexchange.com/questions/2492594/what-is-the-pdf-of-the-sum-of-n-drawings-from-a-pdf/2492673#2492673&quot;&gt;this question&lt;/a&gt;, I could convolve the EPDF above 60 times and I should get the right answer.  I think this would look something like this:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def step_pdf(pdf1,pdf2):&#xA;    pdf=np.convolve(pdf1,pdf2)&#xA;    pdf=(pdf[0:-1:2]+pdf[1::2])/2&#xA;    pdf=np.append(np.array([0]),pdf)&#xA;    pdf=pdf/pdf.sum()&#xA;    return pdf&#xA;&#xA;from functools import reduce&#xA;pdf60=reduce(step_pdf,[rf for i in range(60)])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If I then plot the new pdf60 on top of the old pdf&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;p=figure(plot_width=600,plot_height=200,tools=&quot;pan,wheel_zoom,box_zoom,reset,resize&quot;)&#xA;p.line(x,rf,color='red')&#xA;p.line(x,pdf60,color='blue')&#xA;show(p)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I see (call this &quot;Convolution PDF60&quot;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/ckw6m.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/ckw6m.png&quot; alt=&quot;Convolution PDF60&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The blue line is my 60-minute PDF from the above 60-fold convolution.  It is smoother, which I expect, but it is still roughly in the same range as the original 1-minute PDF, which I do not expect.  So now I will try a more constructive way of generating the 60-minute PDF:  I will construct as many 60-minute samples randomly as I have 1-minute samples, by summing randomly selected vectors of size 60 from my original population of 1-minute moves.  Then I will compute the empirical PDF of the result.  I completely trust this construction, so I will use it as a benchmark against my original construction.  So:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;n=djpy.shape[0]&#xA;draws=np.random.randint(0,n,size=(n,60))&#xA;djpy60=np.array([djpy[draws[i]].sum() for i in range(n)])&#xA;(x,pdf60)=epdf(djpy60,numIntervals=1000)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now if I plot pdf60:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;p=figure(plot_width=600,plot_height=200,tools=&quot;pan,wheel_zoom,box_zoom,reset,resize&quot;)&#xA;p.line(x,rf,color='red')&#xA;p.line(x,pdf60,color='blue')&#xA;show(p)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I see a much wider distribution of 60-minute moves, which corresponds much more strongly to my intuition (call this &quot;Monte Carlo PDF60&quot;):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/znrT8.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/znrT8.png&quot; alt=&quot;Monte Carlo PDF60&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt; Why aren't my Convolution PDF60 and my Monte Carlo PDF60 in agreement?&lt;/p&gt;&#xA;" OwnerUserId="29212" LastActivityDate="2017-10-28T02:27:51.007" Title="Computing the PDF of the sum of N moves of an empirical PDF for USDJPY 1-minute moves" Tags="&lt;probability&gt;&lt;density&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36633" PostTypeId="1" CreationDate="2017-10-28T18:44:26.113" Score="1" ViewCount="1284" Body="&lt;p&gt;If $X$ is a random variable with $t$-distribution of parameter $\mathcal{v}$, how can I prove that&#xA;$$&#xA;\lim_{\alpha \to 1^{-}} \frac{\mathrm{ES}_{\alpha}(X)}{\mathrm{VaR}_{\alpha}(X)} = \frac{\mathcal{v}}{\mathcal{v}-1}?&#xA;$$&#xA;In the book &lt;em&gt;Quantitative Risk Management: Concepts, Techniques and Tools&lt;/em&gt; by Alexander J. McNeil  et al., I found the following formulas: &#xA;$$\mathrm{ES}_{\alpha} = \frac {g_v(t_v^{-1}(\alpha))}{1- \alpha} \frac{v+(t_v^{-1}(\alpha))^2}{v-1}&#xA;,\qquad\mathrm{VaR}_{\alpha} = t_v^{-1}(\alpha)$$&#xA;where $t_v$ denotes the distribution function of the standard student and $g_v$ the density function of the same distribution.&#xA;But I'm having dificulties evaluating such limit. Any suggestions?&lt;/p&gt;&#xA;" OwnerDisplayName="user30191" LastEditorUserId="7431" LastEditDate="2017-10-30T10:07:58.603" LastActivityDate="2017-10-30T10:07:58.603" Title="Ratio between Expected Shortfall and Value at Risk for $t$-distribution" Tags="&lt;var&gt;&lt;value-at-risk&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36634" PostTypeId="2" ParentId="17116" CreationDate="2017-10-28T21:52:54.457" Score="1" Body="&lt;p&gt;I am sharing list of update symbols, All are from Yahoo Only. &lt;a href=&quot;https://github.com/stockdatalab/Stock-Exchanges-Ticker-List&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/stockdatalab/Stock-Exchanges-Ticker-List&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We are pushing all in our github account soon you can find them on our website as well. &lt;/p&gt;&#xA;" OwnerUserId="30194" LastActivityDate="2017-10-28T21:52:54.457" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36636" PostTypeId="1" AcceptedAnswerId="37050" CreationDate="2017-10-29T12:58:23.347" Score="10" ViewCount="1386" Body="&lt;p&gt;I recently purchased SPX options data from the CBOE. Normally, if the data is OK and the Put-Call parity holds, one should expect to correctly imply ZC (Zero Coupon bond) prices and forwards by performing a linear regression on all available collar prices (long put and short call of the same strike), given a fixed maturity $T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This works indeed very well, until we come close to maturity. More specifically, the linear regression gives wrong results for collars on their last trading day. For example, if I perform linear regression on all the collars available at date 2005-02-17 (Thursday) which expire on 2005-02-19, I get an annualized risk-free rate of 84.85% (or a ZC being worth ~99.5297%), which is clearly wrong. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I find weird is that this behavior happens only one day before the 3rd friday. Is there something I am missing about how the prices behave when close to expiration ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT :&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm adding here a plot of how of the term structure of the implied risk-free rate (that I have smoothed using a Nelson-Siegel fit but the behavior is present regardless of whether I smooth the curves or not) evolves as we approach the third Thursday 2005-02-17 :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/0JWZm.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/0JWZm.png&quot; alt=&quot;Term structure of the implied risk-free rate when close to expiration&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When we are a little far from that date, we get more coherent term structures :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/K89Xx.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/K89Xx.png&quot; alt=&quot;Term structure of the implied risk-free rate when sufficiently far from expiration&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="19693" LastEditorUserId="19693" LastEditDate="2017-10-29T18:52:07.593" LastActivityDate="2017-11-23T22:33:31.517" Title="Implying risk-free rates using Put/Call parity" Tags="&lt;option-pricing&gt;&lt;interest-rates&gt;&lt;market-data&gt;&lt;put-call-parity&gt;" AnswerCount="2" CommentCount="10" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36637" PostTypeId="1" CreationDate="2017-10-29T13:06:28.030" Score="2" ViewCount="231" Body="&lt;p&gt;I want to use stochastic process to model subscriber's mobile data consumption as time going in a month. So I think about Geometric Brownian Motion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, people's cumulative data consumption will never decrease. Thus, how can I adjust the formulation of Geometric Brownian Motion to make it monotone? Or is there any other stochastic process more suitable?&lt;/p&gt;&#xA;" OwnerUserId="30199" LastActivityDate="2017-12-29T18:52:08.403" Title="How to adjust Geometric Brownian Motion to be monotone?" Tags="&lt;data&gt;&lt;sde&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36640" PostTypeId="1" AcceptedAnswerId="36641" CreationDate="2017-10-29T16:58:39.227" Score="2" ViewCount="70" Body="&lt;p&gt;Quandl has &lt;a href=&quot;https://blog.quandl.com/api-for-housing-data&quot; rel=&quot;nofollow noreferrer&quot;&gt;neighborhood level housing data&lt;/a&gt; and a good API.  Is there a way to use their API to get the same data from 2009?  If not, is there another source for historical neighborhood level housing data.  In particular, average or median price per square foot?&lt;/p&gt;&#xA;" OwnerUserId="5689" LastActivityDate="2017-10-29T17:16:36.087" Title="Historical Neighborhood Level Housing Data Source?" Tags="&lt;historical-data&gt;&lt;real-estate&gt;&lt;opensource&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36641" PostTypeId="2" ParentId="36640" CreationDate="2017-10-29T17:16:36.087" Score="3" Body="&lt;p&gt;Have a look at Zillow's historical data. For example, this &lt;a href=&quot;http://files.zillowstatic.com/research/public/Neighborhood/Neighborhood_MedianValuePerSqft_AllHomes.csv&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://files.zillowstatic.com/research/public/Neighborhood/Neighborhood_MedianValuePerSqft_AllHomes.csv&lt;/a&gt; is a dataset of neighborhood level median $ / sqft. Also, Zillow has a great api that you can use to programmatically pull and process the data. If you are a python user, check out the package PyZillow for more detail.&lt;/p&gt;&#xA;" OwnerUserId="30203" LastActivityDate="2017-10-29T17:16:36.087" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36642" PostTypeId="2" ParentId="36500" CreationDate="2017-10-29T17:22:27.553" Score="1" Body="&lt;p&gt;Prior to starting on a high yield trading desk, I was asked not to show up until I read and internalized &quot;Inside the Yield Book.&quot; I now understand why. It is not prescriptive as most texts on the subject, rather it helps to build intuition from the ground up.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://rads.stackoverflow.com/amzn/click/111839013X&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.amazon.com/Inside-Yield-Book-Classic-Analysis/dp/111839013X&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="30203" LastActivityDate="2017-10-29T17:22:27.553" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36643" PostTypeId="1" CreationDate="2017-10-29T22:43:52.100" Score="8" ViewCount="6129" Body="&lt;p&gt;Apologies if this is a very simple question, but how exactly do firms make money from &quot;flow trading&quot;? Is it simply profiting from &quot;selling&quot; direct market access?&lt;/p&gt;&#xA;" OwnerUserId="5168" LastEditorUserId="11723" LastEditDate="2018-12-21T09:36:44.373" LastActivityDate="2018-12-21T09:36:44.373" Title="How do firms make money from &quot;flow trading&quot;?" Tags="&lt;trading&gt;&lt;market-making&gt;&lt;banks&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="36644" PostTypeId="1" AcceptedAnswerId="36772" CreationDate="2017-10-30T00:31:09.397" Score="6" ViewCount="461" Body="&lt;p&gt;Utility based portfolio optimization deals with the problem of finding the optimal portfolio $x_T$ by maximizing the utility/objective function $O(x_T,x_0)$ where $x_0$ is the current portfolio. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the particular case of mean-variance the objective function is equal to&#xA;$$&#xA;O(x,x_0) = \mathrm{AlphaTerm}(x,x_0) - \lambda\cdot \mathrm{Var}(x) - \kappa\cdot \mathrm{TC}(x,x_0)&#xA;$$&#xA;and we want to find the portfolio $x$ that maximizes this objective subject to a set of constraints such as:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$\mathrm{Risk}(x)\leq MR$&lt;/li&gt;&#xA;&lt;li&gt;$\mathrm{Gross}(x)\leq MG$&lt;/li&gt;&#xA;&lt;li&gt;$-MN\leq \mathrm{Net}(x)\leq MN$&lt;/li&gt;&#xA;&lt;li&gt;$-M\beta\leq \mathrm{Beta}(x)\leq M\beta$&lt;/li&gt;&#xA;&lt;li&gt;$\mathrm{TC}(x,x_0)\leq MTC$&lt;/li&gt;&#xA;&lt;li&gt;Others&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;where $\mathrm{TC}(x,x_0)$ is the total transaction cost (i.e. Fees + Market Impact) of trading from $x_0$ to $x$ and $\mathrm{Var}(x)=\mathrm{Risk}(x)^2$&#xA;is the portfolio variance. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there any study about the advantages/disadvantages of the more general case such as $U_\theta(x,x_0)$ where we are maximizing &#xA;$$&#xA;O_{\theta}(x,x_0) = \mathrm{AlphaTerm}(x,x_0) - \lambda\cdot \mathrm{Risk}(x)^{\theta} - \kappa\cdot\mathrm{TC}(x,x_0)&#xA;$$&#xA;subject to same constraints?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What about the difference between $\theta=2$ vs. $\theta=1$?  &lt;/p&gt;&#xA;" OwnerUserId="6065" LastEditorUserId="6065" LastEditDate="2017-10-31T01:16:53.113" LastActivityDate="2017-11-06T18:14:51.547" Title="Generalized Mean Variance Portfolio" Tags="&lt;portfolio-optimization&gt;&lt;modern-portfolio-theory&gt;&lt;mean-variance&gt;" AnswerCount="3" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36646" PostTypeId="2" ParentId="36643" CreationDate="2017-10-30T03:50:53.817" Score="20" Body="&lt;p&gt;Flow trading is in spirit very similar to market making - such firms make a profit by earning a spread.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are 3 common ways this is done. Suppose a client wants to buy 100k shares of XYZ, which is publicly quoted at 1M@10.01 bid, 1M@10.03 ask. For sake of simplification, assume sub-penny pricing is not accepted in the jurisdiction where XYZ is listed.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Match against inventory: The firm already has a position of 100k shares of XYZ at an average fill price of 10.015. In theory, the firm has an unrealized loss at liquidation price on the public market. Now, the firm can sell all 100k shares to the client at 10.02, which is an improvement over the public best offer of 10.03 for the client, while the firm also collects a spread of 0.005x10^5=$500 - a win-win situation.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Instantaneous: The firm does not have a position in XYZ. Nevertheless, the firm can sell all 100k shares to the client at 10.03 immediately. Since this is the best offer price on the public market, the firm benefits because it has likely skipped the queue at 10.03 to get a fill. Now the firm can work the offsetting order, wait for a client that wants to sell XYZ, hedge its position, or improve the public best bid by posting buy 100k@10.02 where it would earn a spread of 1 cent.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Combination of the above: The firm already has an inventory of 80k shares at an average fill price of 10.01. It can sell 100k to the client at 10.02 and simultaneously buy 20k from the market at 10.03, thus realizing an average entry price of 10.014 and average exit price of 10.02, collecting a spread of 0.006x10^6=$600.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;(1), (2) and (3) suggest that all previous replies to your answer are misinformed, it is entirely possible to do this in a way that neither frontruns the client nor disadvantages the client relative to NBBO. On the contrary, the client may be a noise trader and frontrunning its order may actually work against you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) suggests that the firm needs to already be in the business of holding on to a large portfolio which it wants to be at net zero exposure, this is why many flow trading firms are also large broker-dealers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) suggests that the flow trader collects profits at the expense of the otherwise market makers who were quoting 10.01-10.03 and would've loved to compete for the business of filling those 100k shares. The moral issue arises here as one may argue that the flow trader is collecting its profit at the expense of its client: perhaps a high-frequency market maker on the exchange would've been willing to cross the spread and sell at 10.00 if it saw a 100k@10.00 bid post because the public market maker has prediction alpha. By internalizing the flow, we're removing competitive price discovery from the public market. This lends credence to why most high-frequency trading firms prefer lit and transparent markets, which are more competitive for the utility traders, investors and end users of these markets.&lt;/p&gt;&#xA;" OwnerUserId="4660" LastEditorUserId="24222" LastEditDate="2017-12-29T23:54:16.423" LastActivityDate="2017-12-29T23:54:16.423" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="36648" PostTypeId="2" ParentId="36633" CreationDate="2017-10-30T06:33:43.810" Score="4" Body="&lt;p&gt;Let $u=t^{-1}_v(\alpha)$ and recall that $g_v(u)=c_v(v+u^2)^{-\frac{v+1}2}$ for some constant $c_v$. By the formulas you provided,&#xA;$$\begin{eqnarray*}\lim_{\alpha\to 1^-}\frac{\mathrm{ES}_\alpha(X)}{\mathrm{VaR}_\alpha(X)}&amp;amp;=&amp;amp;\lim_{\alpha\to 1^-} \frac{g_v(t^{-1}_v(\alpha))}{(1-\alpha)(v-1)\left(\frac{t^{-1}(\alpha)}{v+(t^{-1}(\alpha))^2}\right)}\\&#xA;=\lim_{u\to\infty} \frac{g_v(u)}{(1-t_v(u))(v-1)\left(\frac{u}{v+u^2}\right)}&amp;amp;=&amp;amp;\lim_{u\to\infty}\frac{(v+u^2)^{-(v-1)/2}u^{-1}c_v/(v-1)}{(1-t_v(u))}.\end{eqnarray*}$$&#xA;This is of the form $[0/0]$. L'Hopital's rule gives&#xA;$$\frac{\frac{d}{du}\left[(v+u^2)^{-(v-1)/2}u^{-1}c_v/(v-1)\right]}{-g_v(u)}=\frac{c_v}{v-1}\frac{\frac{d}{du}\left[(v+u^2)^{-(v-1)/2}u^{-1}\right]}{-g_v(u)}$$&#xA;$$=\frac{c_v}{v-1}\frac{\left[-\frac{v-1}2(v+u^2)^{-(v+1)/2}2uu^{-1}+(v+u^2)^{-(v-1)/2}(-u^{-2})\right]}{-c_v(v+u^2)^{-(v+1)/2}}$$&#xA;$$=\frac{1}{v-1}\left[\frac{v-1}1+(v+u^2)(u^{-2})\right]=1+\frac{v+u^2}{(v-1)u^2}\to1+0+\frac1{v-1}=\frac{v}{v-1},$$&#xA;as desired.&lt;/p&gt;&#xA;" OwnerUserId="7431" LastEditorUserId="7431" LastEditDate="2017-10-30T07:04:54.533" LastActivityDate="2017-10-30T07:04:54.533" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36651" PostTypeId="2" ParentId="36643" CreationDate="2017-10-30T11:07:31.377" Score="1" Body="&lt;p&gt;As to the value that customer order flow provides, there is specific published research on order flow in the FX markets by Sarno et al. &lt;a href=&quot;http://www3.imperial.ac.uk/fileupload/download/7.dellacorte.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;(Why) Does order flow forecast exchange rates?&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="7369" LastEditorUserId="16160" LastEditDate="2017-10-30T12:44:02.860" LastActivityDate="2017-10-30T12:44:02.860" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36652" PostTypeId="2" ParentId="36637" CreationDate="2017-10-30T11:56:26.547" Score="1" Body="&lt;p&gt;You could model this as a Lévy-process. The class of &lt;a href=&quot;https://en.wikipedia.org/wiki/Subordinator_(mathematics)&quot; rel=&quot;nofollow noreferrer&quot;&gt;subordinators&lt;/a&gt; can be used to model processes that never decrease. If the increments are Gamma-distributed then this is a gamma subordinator. Depending on what you want to do with the model the class of Lévy processes is studied in detail. You can look for more details &lt;a href=&quot;http://galton.uchicago.edu/~lalley/Courses/385/LevyProcesses.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;. Compound Poisson processes fall in this class as well but I think they don't come that natural in your case.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2017-12-29T18:52:08.403" LastActivityDate="2017-12-29T18:52:08.403" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36654" PostTypeId="1" CreationDate="2017-10-30T12:49:55.423" Score="1" ViewCount="189" Body="&lt;p&gt;I want to forecast a differenced time series of an Index using the combined ARMA-GARCH model (because I want to forecast the mean and not the variance). My model is a ARMA(2,2)-GARCH(1,1) model. So the equations for the first forecast are:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Y(t+1)=Y(t)+Alpha(1)*(Y(t)-Y(t-1))+Alpha(2)*(Y(t-1)-Y(t-2)) - Beta(1)*e(t) - Beta(2)*e(t-1) + e(t+1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;with&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;e(t+1) = Sigma(t+1)*Z(t+1)  ,   Z(t+1)=N(0,1) &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Sigma^2 (t+1) = Omega + a(1)*u^2(t) + b(1)*Sigma^2(t) + b(2)*Sigma^2(t-1)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I tried it with the rugarch package and the ugarchforecast method:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;GARCHspec &amp;lt;- ugarchspec( variance.model = list(model = &quot;sGARCH&quot;, garchOrder = c(1, 1)),mean.model = list(armaOrder = c(2, 2), include.mean = TRUE))&#xA;&#xA;GARCHfit &amp;lt;- ugarchfit(GARCHspec, diffclosingkursu)&#xA;&#xA;ugarchforecast(GARCHfit,n.ahead=250)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The forecast seems to be quite strange&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;*------------------------------------*&#xA;*       GARCH Model Forecast         *&#xA;*------------------------------------*&#xA;Model: sGARCH&#xA;Horizon: 30&#xA;Roll Steps: 0&#xA;Out of Sample: 0&#xA;&#xA;0-roll forecast [T0=1976-11-23 01:00:00]:&#xA;     Series  Sigma&#xA;T+1   10.28 0.7802&#xA;T+2   10.30 0.8580&#xA;T+3   10.32 0.9264&#xA;T+4   10.34 0.9876&#xA;T+5   10.36 1.0429&#xA;T+6   10.38 1.0933&#xA;T+7   10.40 1.1395&#xA;T+8   10.43 1.1822&#xA;T+9   10.45 1.2217&#xA;T+10  10.47 1.2585&#xA;T+11  10.49 1.2927&#xA;T+12  10.51 1.3247&#xA;T+13  10.54 1.3547&#xA;T+14  10.56 1.3829&#xA;T+15  10.58 1.4093&#xA;T+16  10.60 1.4343&#xA;T+17  10.63 1.4578&#xA;T+18  10.65 1.4800&#xA;T+19  10.67 1.5010&#xA;T+20  10.69 1.5208&#xA;T+21  10.71 1.5396&#xA;T+22  10.74 1.5574&#xA;T+23  10.76 1.5743&#xA;T+24  10.78 1.5903&#xA;T+25  10.80 1.6056&#xA;T+26  10.82 1.6200&#xA;T+27  10.85 1.6338&#xA;T+28  10.87 1.6469&#xA;T+29  10.89 1.6593&#xA;T+30  10.91 1.6743&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Also, how can it be, that every forecast for the same time series is the same but e(t+1) should be a random variable?&lt;/p&gt;&#xA;" OwnerUserId="29546" LastActivityDate="2017-10-30T12:49:55.423" Title="ARMA-GARCH Forecasting" Tags="&lt;time-series&gt;&lt;programming&gt;&lt;garch&gt;&lt;arma&gt;" AnswerCount="0" CommentCount="3" ClosedDate="2017-11-03T20:06:34.373" ContentLicense="CC BY-SA 3.0" />
  <row Id="36655" PostTypeId="1" AcceptedAnswerId="36657" CreationDate="2017-10-30T13:31:37.370" Score="2" ViewCount="572" Body="&lt;p&gt;Hail to all,&#xA;I am struggling to solve the following SDE for intensity:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$d\lambda_t = \kappa(\rho(t) - \lambda_t)dt + \delta dN_t $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know to expect the solution in the form of &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\lambda_t = c(0)e^{-\kappa t} + \kappa \int_0^{t}e^{-\kappa (t-u)} \rho(u) du + \delta\int_0^{t}e^{-\kappa (t-u)}dN_u$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;from here I am able to verify that this is indeed the solution but I am no able to reach this step rigorously.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="22424" LastEditorUserId="20454" LastEditDate="2017-10-30T17:52:38.320" LastActivityDate="2017-10-30T19:34:35.340" Title="Hawkes process intensity solution" Tags="&lt;stochastic-calculus&gt;&lt;sde&gt;&lt;stochastic&gt;&lt;jump&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36656" PostTypeId="2" ParentId="36655" CreationDate="2017-10-30T13:40:56.613" Score="1" Body="&lt;p&gt;Set $\tilde{\lambda}_t = e^{\kappa t} \lambda_t$ and solve for $\tilde{\lambda}_t$&lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2017-10-30T13:40:56.613" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36657" PostTypeId="2" ParentId="36655" CreationDate="2017-10-30T14:00:12.847" Score="4" Body="&lt;p&gt;Let us define the auxiliary process $\Lambda_t=e^{\kappa t}\lambda_t$. Note that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \Lambda_t = \kappa e^{\kappa t} \int_0^t(\rho_s-\lambda_s)ds+\delta e^{\kappa t}\int_0^tdN_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence after a jump occurs at $t$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \Lambda_t=\Lambda_{t-}+\delta e^{\kappa t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Therefore by Ito's lemma for jump-diffusion processes:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;d\Lambda_t &amp;amp; = \frac{\partial \Lambda_t}{\partial t}dt+\frac{\partial \Lambda_t}{\partial \lambda_t}\kappa(\rho_t-\lambda_t)dt+(\Lambda_t-\Lambda_{t-})dN_t&#xA;\\[9pt]&#xA;&amp;amp; = \kappa e^{\kappa t}\rho_tdt+\delta e^{\kappa t}dN_t&#xA;\end{align}$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Integrating:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \Lambda_t=\Lambda_0+\kappa\int_0^te^{\kappa s}\rho_sds+\delta\int_0^te^{\kappa s}dN_s$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \lambda_t=\lambda_0+\kappa\int_0^te^{\kappa (s-t)}\rho_sds+\delta\int_0^te^{\kappa (s-t)}dN_s$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You notice that in the original SDE the following factor is the &quot;nuisance&quot;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d\lambda_t = \cdots + \left(-\kappa \lambda_t dt\right) + \cdots$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;which corresponds to the differential of an exponential with constant $\kappa$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dx_t = \kappa x_tdt \quad \Leftrightarrow \quad x_t = Ce^{\kappa t}$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hence you need to try to get rid of it by making a $+\kappa \lambda_t dt$ appear somehow, which can be achieved by differentiating an exponential with constant $\kappa$ through Ito's lemma applied to $\Lambda_t$ as defined above.&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-10-30T19:34:35.340" LastActivityDate="2017-10-30T19:34:35.340" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36658" PostTypeId="1" CreationDate="2017-10-30T14:24:47.600" Score="0" ViewCount="447" Body="&lt;p&gt;Suppose $S_t$ is a geometric brownian motion. Then how to understand its time integral, i.e., $Y_t=\int_0^{t}S_udu$? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is $Y_t$ still a stochastic process? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to compute the expectation of $Y_t$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How to compute the expectation of $\left[a-Y_t\right]^+$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here $[x]^+=\max\{x,0\}$.&lt;/p&gt;&#xA;" OwnerUserId="30199" LastEditorUserId="19645" LastEditDate="2021-03-29T12:20:12.187" LastActivityDate="2021-03-29T12:20:12.187" Title="Time integral of geometric brownian motion" Tags="&lt;sde&gt;&lt;asian-option&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36660" PostTypeId="1" CreationDate="2017-10-30T17:10:51.820" Score="0" ViewCount="207" Body="&lt;p&gt;here's the problem.&#xA;Suppose you want to compute the price of a Call option on a Swap contract.&#xA;Let $T$ and $T+S$ the times (in year fraction) where the Swap lives and suppose that the fluxes of the swap are every $6$ months in the times:&#xA;$$&#xA;T=T_0&amp;lt; T_1&amp;lt; \dots &amp;lt; T_N = T+S&#xA;$$&#xA;Let $S_{fwd}$ the swap forward rate:&#xA;$$&#xA;S_{fwd}  = S(t; T, T+S) = \frac{B(t, T) - B(t, T+S)}{\sum_{i=1}^M (T_i - T_{i-1})B(t, T_i)} = 2\frac{B(t, T) - B(t, T+S)}{\sum_{i=1}^M B(t, T_i)}&#xA;$$&#xA;while the spot Swap rate is:&#xA;$$&#xA;S_t(s) = \frac{1-B(t, t+s)}{\sum_{i=1}^M (T_i - T_{i-1})B(t, T_i)}&#xA;$$&#xA;where $B(0, T)$ is the usual risk-free discount. The above formula is just the rate which let the swap be fair. ($S_t(s)$ is just $S_{fwd}$ with $t=T$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Our Call option will use this $S_{fwd}$ as strike and it will exercise $2$ times a year so that the payoff will be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\sum_i^{2M}\mathbb{E}^{T_i} \left[ \frac{1}{2}B(T, T_i)(S_T(s) - S_{fwd})^+  | \mathcal{F}_T\right]   = A(T)(S_T(s) - S{fwd})^+ &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we can compute the expected value. In order to have a simpler term we can (I have to...for the exercise spirit this passage is mandatory) change of measure:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;B(0, T)\mathbb{E}^T \left[ A(T)(S_T(s) - S{fwd})^+ \right] = A(0) \mathbb{E}^A \left[(S_T(s) - S_{fwd} )^+ \right].&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Finally I come to the main question:&lt;/strong&gt; At this point the exercise ask me to do some approximations and to estimate the errors. One of this approximations is to compute the integral in the forward measure $T$ (the measure we are using before the change of measure) even if we've changed of numeraire. It seems like a good idea since all the trajectories are available in that measure and, in this way, no Girsanov or Brownian motion corrections is needed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So that we have the following approximation:&#xA;$$&#xA; A(0) \mathbb{E}^A \left[(S_T(s) - S_{fwd} )^+ \right] =  A(0) \mathbb{E}^T \left[(S_T(s) - S_{fwd} )^+ \right] + \epsilon&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem is that I don't understand how to compute the error $\epsilon$ generated by a change of measure: in fact it is a &quot;theoretical&quot; technique and I cannot see how to &quot;write down&quot; the error (the estimate can be done both in the analytic way and in a numerical way: Montecarlo, finite differences...).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advice. I know it could seem like confusing...and in fact it is form me a little bit.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ciao!&#xA;AM&lt;/p&gt;&#xA;" OwnerUserId="26793" LastEditorUserId="2587" LastEditDate="2017-10-30T18:15:48.253" LastActivityDate="2017-10-30T18:15:48.253" Title="Pricing of Swaption by Proxy and Monte Carlo" Tags="&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;derivatives&gt;&lt;swaps&gt;" AnswerCount="0" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="36661" PostTypeId="1" AcceptedAnswerId="36668" CreationDate="2017-10-30T20:01:23.643" Score="1" ViewCount="103" Body="&lt;p&gt;I'm using the equations given on this &lt;a href=&quot;http://www.investopedia.com/terms/f/forwardprice.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;page&lt;/a&gt; to price forwards on an equity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's a basic equation that discounts dividends.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But my question is: What do we do about dividends that occur after the forward's expiration date?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, consider a stock that pays dividends on the last day of every month in the year. Say I want to price the forward that expires on the 15th of March. According to that webpage, I only need to discount dividends paid on January 1st, February 1st, and March 1st. But what about the dividend that will be paid on April 1st. On March 15th, we would be halfway through the month and the stock will have accrued half of the value of the next dividend. So how should I treat months after the forward? Thanks.&lt;/p&gt;&#xA;" OwnerUserId="29386" LastEditorUserId="29386" LastEditDate="2017-10-30T21:35:05.763" LastActivityDate="2017-10-31T08:16:14.940" Title="Role of next month's dividends in forward pricing" Tags="&lt;options&gt;&lt;equities&gt;&lt;futures&gt;&lt;forward&gt;&lt;dividends&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36662" PostTypeId="1" CreationDate="2017-10-30T22:45:24.837" Score="1" ViewCount="308" Body="&lt;p&gt;I've seen this in the original paper (&lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.628.4037&amp;amp;rep=rep1&amp;amp;type=pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Yang, Zhang: Drift Independent Volatility Estimation ...&lt;/a&gt;) (see Equation 10, Page 483)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$k = \frac{\alpha - 1 }{\alpha + \frac{ n + 1 }{ n - 1 }}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;while there are some implementations with this (in &lt;a href=&quot;https://www.rdocumentation.org/packages/TTR/versions/0.23-2/topics/volatility&quot; rel=&quot;nofollow noreferrer&quot;&gt;R documentation&lt;/a&gt;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$k =\frac{\alpha}{1 + \frac{ n + 1}{n - 1 } }$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why the difference ?&lt;/p&gt;&#xA;" OwnerUserId="30207" LastEditorUserId="16160" LastEditDate="2017-11-04T10:49:13.660" LastActivityDate="2017-11-04T10:49:13.660" Title="Why are some Yang Zhang constant k different from the original paper?" Tags="&lt;volatility&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="36665" PostTypeId="1" CreationDate="2017-10-31T03:16:28.157" Score="4" ViewCount="241" Body="&lt;p&gt;Shall I construct a stochastic process $X(t)$ such that $X(s+t)-X(s)\sim U(-t,t)$ ?&#xA;Or is there already any similar formula?&lt;/p&gt;&#xA;" OwnerUserId="30199" LastEditorUserId="24222" LastEditDate="2017-10-31T09:27:28.087" LastActivityDate="2017-10-31T09:27:28.087" Title="Is there uniform stochastic process?" Tags="&lt;stochastic-processes&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36666" PostTypeId="2" ParentId="36665" CreationDate="2017-10-31T06:19:59.657" Score="3" Body="&lt;p&gt;Let $U$ be uniform in $[-1,1]$ and let $X_t=Ut$, which is uniform in $[-t,t]$.&#xA;Then&#xA;$$X_{t+s}-X_s=U(t+s)-Us=Ut$$&#xA;so this works. So it's not so much a stochastic process as just a random variable giving the slope of a line.&lt;/p&gt;&#xA;" OwnerUserId="7431" LastActivityDate="2017-10-31T06:19:59.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36667" PostTypeId="1" CreationDate="2017-10-31T07:08:47.807" Score="1" ViewCount="119" Body="&lt;p&gt;I read &lt;a href=&quot;https://quant.stackexchange.com/questions/4160/discrete-returns-versus-log-returns-of-assets&quot;&gt;Discrete returns versus log returns of assets&lt;/a&gt; and it is very helpful. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if log-returns are easier for time-aggregation, then why do economists work with discrete returns e.g. in GDP growth?&lt;/p&gt;&#xA;" OwnerUserId="30222" LastEditorUserId="848" LastEditDate="2017-10-31T07:56:24.473" LastActivityDate="2017-10-31T07:56:24.473" Title="Elobaration on: Discrete returns versus log returns of assets" Tags="&lt;economics&gt;&lt;log-returns&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36668" PostTypeId="2" ParentId="36661" CreationDate="2017-10-31T08:16:14.940" Score="3" Body="&lt;p&gt;A long equity forward position initiated at $t=0$ for delivery at $T$ can be replicated by borrowing cash to purchase the stock at $t=0$, carrying that stock up to $T$ and paying the interests on the cash borrowed (cash &amp;amp; carry).&#xA;This shows that the forward price is basically the cost of funding the equity purchase. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now if the stock pays dividends the proceeds can be reinvested, which contributes to decreasing the effective funding cost. Obviously only the dividends falling over the replication period $]0,T]$ can be reinvested and hence matter in pricing the forward $F(0,T)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice there is an additional complication due to the 'ex-dividend' date versus 'payment' date discrepancy but the idea remains the same.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastActivityDate="2017-10-31T08:16:14.940" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36670" PostTypeId="2" ParentId="36644" CreationDate="2017-10-31T13:12:28.697" Score="2" Body="&lt;p&gt;I doubt that there are papers that study exactly the set of constraints that you have listed. But there are papers that look, for instance, into specifications for risk and reward other than variance and mean. For instance, in &lt;a href=&quot;https://ssrn.com/abstract=1365167&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://ssrn.com/abstract=1365167&lt;/a&gt; and &lt;a href=&quot;https://ssrn.com/abstract=2975529&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://ssrn.com/abstract=2975529&lt;/a&gt;  we have looked whether alternative risk functions provide any advantage. In a nutshell, these studies find that emphasising risk works well, and that using risk functions that only look at downside risk/losses work better than&#xA;a symmetric risk function (i.e. variance).&lt;/p&gt;&#xA;" OwnerUserId="6857" LastActivityDate="2017-10-31T13:12:28.697" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36671" PostTypeId="1" CreationDate="2017-10-31T13:42:29.640" Score="-1" ViewCount="509" Body="&lt;p&gt;I'm evaluating the impact of two variables on stock returns. For this I am using a Garch(1,1)-model in RStudio. This is the result I am getting. Why is the garch model not a valid choice? The external regressors are in the variace model, because they are not incorporated in the mean equation. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt; myspec&amp;lt;-ugarchspec(variance.model=list(model=&quot;sGarch&quot;, garchOrder=c(1,1),external.regressors=mydata),&#xA;+                    mean.model=list(armaOrder=c(1,0),include.mean=TRUE))&#xA;Error: &#xA;ugarchspec--&amp;gt;error: the garch model does not appear to be a valid choice.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="30224" LastActivityDate="2017-10-31T15:32:19.857" Title="Garch(1,1) in R" Tags="&lt;garch&gt;" AnswerCount="1" CommentCount="2" ClosedDate="2017-11-02T08:52:00.097" ContentLicense="CC BY-SA 3.0" />
  <row Id="36673" PostTypeId="2" ParentId="36671" CreationDate="2017-10-31T15:32:19.857" Score="1" Body="&lt;p&gt;&lt;a href=&quot;https://www.rdocumentation.org/packages/rugarch/versions/1.3-8/topics/ugarchspec-methods&quot; rel=&quot;nofollow noreferrer&quot;&gt;From the docs&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;List containing the variance model specification: model Valid models (currently implemented) are “sGARCH”, “fGARCH”, “eGARCH”, “gjrGARCH”, “apARCH” and “iGARCH” and “csGARCH”.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Other values than the ones listed are never valid.&lt;/p&gt;&#xA;" OwnerUserId="848" LastActivityDate="2017-10-31T15:32:19.857" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36675" PostTypeId="1" AcceptedAnswerId="36676" CreationDate="2017-10-31T17:07:31.420" Score="3" ViewCount="192" Body="&lt;p&gt;I'm studying the book &quot;The Mathematics of Financial Derivatives - A Student Introduction&quot; and at the start of the second chapter it says that thanks to the effcient market hypothesis (1-the past history is fully reflected in the present price, 2-markets respond immediately to any new information about an asset) the changes in the asset price are a Markov process (full text below). After this, the book introduces the SDE that model the return on the asset: $\frac{dS}{S}=\mu dt + \sigma dW$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A stochastic process is said to be a Markov process if it satisfies the Markov property: the next state of the process depends solely on the present one, not on the sequence of events that preceded it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I'm a bit confused, how can the changes in the price be a Markov process if the present price fully reflects the past history?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or maybe I misinterpreted it, and the Markov property just says that all past information about the stock price process is incorporated in the current price and therefore only the current price is relevant ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/sKOKH.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/sKOKH.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="30227" LastEditorUserId="30227" LastEditDate="2017-10-31T17:41:28.053" LastActivityDate="2017-10-31T17:41:28.053" Title="Are changes in the asset price a Markov process?" Tags="&lt;option-pricing&gt;&lt;stochastic-processes&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36676" PostTypeId="2" ParentId="36675" CreationDate="2017-10-31T17:31:10.767" Score="5" Body="&lt;p&gt;Let us define a stock process $(S_t)_{t \geq 0}$. We assume the value of the process $S_t$ at $t$ captures all past information which might affect the stock price (its &quot;&lt;em&gt;past history&lt;/em&gt;&quot;). Let us consider two times $t_1 &amp;lt; t_2$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we make the (realistic) assumption that information &lt;strong&gt;accumulates&lt;/strong&gt; and &lt;strong&gt;increases&lt;/strong&gt; over time then, given the stock price $S_t$ captures all relevant information up to $t$, the stock price $S_{t_2}$ encapsulates all relevant information up to and including $t_2$. Therefore it contains at least the same amount of relevant information than $S_{t_1}$. As this is true for all $t&amp;lt;t_2$, all information affecting the stock process at $t_2$ is contained in $S_{t_2}$ and the history of the process is irrelevant (because it is &quot;encapsulated&quot; in $S_{t_2}$): the stock process is thus a Markov process.&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-10-31T17:39:35.543" LastActivityDate="2017-10-31T17:39:35.543" CommentCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="36679" PostTypeId="1" AcceptedAnswerId="36683" CreationDate="2017-10-31T20:02:18.553" Score="0" ViewCount="547" Body="&lt;p&gt;I'm trying to write a program to calculate the convexity of a bond. The bigger idea is, that if I have access to the actual price for each point in time, I should be able to calculate various features of the bond given that date. The convexity program is written as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;&quot;&quot; Calculate convexity of a bond &quot;&quot;&quot;&#xA;    def bond_convexity(price, par, T, coup, freq, dy=0.0001):&#xA;        ytm = bond_ytm(price, par, T, coup, freq)&#xA;&#xA;        ytm_minus = ytm - dy&#xA;        price_minus = bond_price(par, T, ytm_minus, coup, freq)&#xA;&#xA;        ytm_plus = ytm + dy&#xA;        price_plus = bond_price(par, T, ytm_plus, coup, freq)&#xA;&#xA;        convexity = (price_minus+price_plus-2*price)/(price*dy**2)&#xA;        return convexity&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Where the yield to maturity and bond price functions are as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&quot;&quot;&quot;Interpolate yield to maturity&quot;&quot;&quot;&#xA;def bond_ytm(price, par, coupdates, coup, freq=2, guess=0.05):&#xA;     freq = float(freq)&#xA;     MAT = coupdates[len(coupdates) - 1] #maturity date&#xA;     timedif = list() #init&#xA;     periods = list() #init&#xA;     for i in range(0,len(coupdates)-1):&#xA;         timedif.append( round((MAT - coupdates[i]).days/365,1) )     #collection of time to maturity - coupon date&#xA;         periods.append(timedif[i]*freq)&#xA;     coupon = coup/100.*par/freq&#xA;     dt = [(x)/freq for x in periods]&#xA;     ytm_func = ytm_func = lambda y : \&#xA;         sum([coupon/(1+y/freq)**(freq*t) for t in dt]) + par/(1+y/freq)**\&#xA;(freq*max(dt)) - price&#xA;&#xA; return optimize.newton(ytm_func, guess)&#xA;&#xA; &quot;&quot;&quot;Price bond&quot;&quot;&quot;&#xA; def bond_price(par, coupdates, ytm, coup, freq=2):&#xA;      freq = float(freq)&#xA;      MAT = coupdates[len(coupdates) - 1] #maturity date&#xA;      timedif = list() #init&#xA;      periods = list() #init&#xA;      for i in range(0,len(coupdates)-1):&#xA;          timedif.append( round((MAT - coupdates[i]).days/365,1) ) #collection of time to maturity - coupon date&#xA;          periods.append(timedif[i]*freq)&#xA;      coupon = coup/100.*par/freq&#xA;      dt = [(x)/freq for x in periods]&#xA;      price = sum([coupon/(1+ytm/freq)**(freq*t) for t in dt]) + par/(1+ytm/freq)**(freq*max(dt))&#xA; return price&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now, the following data shows the upcoming coupon dates for the bond and today's date at the top. I've saved this variable as cdd:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;cdd&#xA;Out[28]: &#xA;[datetime.datetime(2017, 10, 31, 15, 20, 0, 480212),&#xA; datetime.datetime(2018, 2, 1, 0, 0),&#xA; datetime.datetime(2018, 8, 1, 0, 0),&#xA; datetime.datetime(2019, 2, 1, 0, 0),&#xA; datetime.datetime(2019, 8, 1, 0, 0),&#xA; datetime.datetime(2020, 2, 1, 0, 0),&#xA; datetime.datetime(2020, 8, 1, 0, 0),&#xA; datetime.datetime(2021, 2, 1, 0, 0),&#xA; datetime.datetime(2021, 8, 1, 0, 0),&#xA; datetime.datetime(2022, 2, 1, 0, 0),&#xA; datetime.datetime(2022, 8, 1, 0, 0),&#xA; datetime.datetime(2023, 2, 1, 0, 0),&#xA; datetime.datetime(2023, 8, 1, 0, 0),&#xA; datetime.datetime(2024, 2, 1, 0, 0),&#xA; datetime.datetime(2024, 8, 1, 0, 0),&#xA; datetime.datetime(2025, 2, 1, 0, 0),&#xA; datetime.datetime(2025, 8, 1, 0, 0),&#xA; datetime.datetime(2026, 2, 1, 0, 0),&#xA; datetime.datetime(2026, 8, 1, 0, 0),&#xA; datetime.datetime(2027, 2, 1, 0, 0),&#xA; datetime.datetime(2027, 8, 1, 0, 0),&#xA; datetime.datetime(2028, 2, 1, 0, 0),&#xA; datetime.datetime(2028, 8, 1, 0, 0),&#xA; datetime.datetime(2029, 2, 1, 0, 0),&#xA; datetime.datetime(2029, 8, 1, 0, 0),&#xA; datetime.datetime(2030, 2, 1, 0, 0),&#xA; datetime.datetime(2030, 8, 1, 0, 0),&#xA; datetime.datetime(2031, 2, 1, 0, 0),&#xA; datetime.datetime(2031, 8, 1, 0, 0),&#xA; datetime.datetime(2032, 2, 1, 0, 0),&#xA; datetime.datetime(2032, 8, 1, 0, 0),&#xA; datetime.datetime(2033, 2, 1, 0, 0),&#xA; datetime.datetime(2033, 8, 1, 0, 0),&#xA; datetime.datetime(2034, 2, 1, 0, 0),&#xA; datetime.datetime(2034, 8, 1, 0, 0),&#xA; datetime.datetime(2035, 2, 1, 0, 0),&#xA; datetime.datetime(2035, 8, 1, 0, 0),&#xA; datetime.datetime(2036, 2, 1, 0, 0),&#xA; datetime.datetime(2036, 8, 1, 0, 0),&#xA; datetime.datetime(2037, 2, 1, 0, 0),&#xA; datetime.datetime(2037, 8, 1, 0, 0),&#xA; datetime.datetime(2038, 2, 1, 0, 0),&#xA; datetime.datetime(2038, 8, 1, 0, 0),&#xA; datetime.datetime(2039, 2, 1, 0, 0),&#xA; datetime.datetime(2039, 8, 1, 0, 0),&#xA; datetime.datetime(2040, 2, 1, 0, 0),&#xA; datetime.datetime(2040, 8, 1, 0, 0),&#xA; datetime.datetime(2041, 2, 1, 0, 0),&#xA; datetime.datetime(2041, 8, 1, 0, 0),&#xA; datetime.datetime(2042, 2, 1, 0, 0),&#xA; datetime.datetime(2042, 8, 1, 0, 0),&#xA; datetime.datetime(2043, 2, 1, 0, 0),&#xA; datetime.datetime(2043, 8, 1, 0, 0),&#xA; datetime.datetime(2044, 2, 1, 0, 0),&#xA; datetime.datetime(2044, 8, 1, 0, 0),&#xA; datetime.datetime(2045, 2, 1, 0, 0),&#xA; datetime.datetime(2045, 8, 1, 0, 0)]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, if I run the program to calculate convexity for a bond priced at 112.057, par = 100, dates as cdd, coupon of 4.9, and semi annual frequency, I get the following solution:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;bond_convexity(112.057, 100, cdd, 4.9, 2)&#xA;Out[32]: 351.98162487756656&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Bloomberg is showing that the convexity should be approximately 3.467. What could I possibly be doing wrong? Any help is appreciated.&lt;/p&gt;&#xA;" OwnerUserId="29576" LastActivityDate="2017-10-31T22:08:37.683" Title="Convexity for historical bond data" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;python&gt;&lt;bond-yields&gt;&lt;convexity&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36680" PostTypeId="1" CreationDate="2017-10-31T20:32:12.217" Score="2" ViewCount="105" Body="&lt;p&gt;Meucci has a compelling system to merge a prior distribution with subjective views about risk drivers called Entropy Pooling. The original paper is &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1213325&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;. In the non-parametric (scenario-based) approach, we take a $J \times N$ matrix $X$, where $J$ is the number of simulations, and $N$ is the number of assets. Then we associate a $J \times 1$ vector of probabilities $p$ to each simulation outcome. From there we create a $J \times K$ matrix of views $V$, where $J$ again represents the number of scenarios, and $K$ represents a generic function of the market. I can't quite visualize what the $J \times K$ matrix would look like for standard views. Let's say that I have simulated 10 joint scenarios for a two-variable standard normal distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$      \mathbf X=&#xA;        \begin{pmatrix}&#xA;        -.85 &amp;amp; 1.02 \\&#xA;        1.62 &amp;amp; .36 \\&#xA;        .31 &amp;amp; .93 \\&#xA;        -.53 &amp;amp; .36 \\&#xA;        1.1 &amp;amp; -.84 \\&#xA;        -1.49 &amp;amp; .30 \\&#xA;        1.45 &amp;amp; -.31 \\&#xA;        .37 &amp;amp; -.64 \\&#xA;        .96 &amp;amp; -.29 \\&#xA;        1.01 &amp;amp; .97 \\&#xA;        \end{pmatrix}&#xA;        \space&#xA;        \space&#xA;        \mathbf &#xA;        p=&#xA;        \begin{pmatrix}&#xA;        .1 \\&#xA;        .1 \\&#xA;        .1 \\&#xA;        .1 \\&#xA;        .1 \\&#xA;        .1 \\&#xA;        .1 \\&#xA;        .1 \\&#xA;        .1 \\&#xA;        .1 \\&#xA;        \end{pmatrix}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have two views: asset one will have an average of $.5$, and asset one will have a standard deviation of $.1$. How do I transform these standard views into a conformable $J \times K$ matrix?&lt;/p&gt;&#xA;" OwnerUserId="30229" LastActivityDate="2017-10-31T20:32:12.217" Title="Non-Parametric Entropy Pooling View and Constraint Matrix Structure" Tags="&lt;entropy-pooling&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36681" PostTypeId="1" AcceptedAnswerId="36716" CreationDate="2017-10-31T21:36:59.827" Score="1" ViewCount="154" Body="&lt;p&gt;I understand that VIX futures are usually in contango and so a portfolio that holds futures with a weighted average expiration of 30 days will &quot;roll&quot; down to equal the VIX index at maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is usually given as the reason why XIV makes money most of the time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But a portfolio that holds VIX futures with a weighted average expiration of 30 days has to keep adjusting its weightings as time passes, adding more weight to the 2nd future. This means that although the falling value of the front contract reduces this weighted average, the purchase of more 2nd month futures pushes up the weighted average.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So are we saying that the loss from the fall in value in the first contract is greater than the gain in weighted average from moving into higher valued 2nd month options?&lt;/p&gt;&#xA;" OwnerUserId="29386" LastActivityDate="2017-11-02T19:37:31.650" Title="XIV Positive Roll Yield" Tags="&lt;volatility&gt;&lt;implied-volatility&gt;&lt;futures&gt;&lt;vix&gt;&lt;roll-adjustment&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36683" PostTypeId="2" ParentId="36679" CreationDate="2017-10-31T22:08:37.683" Score="1" Body="&lt;p&gt;A couple of thoughts:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;There are different ways to express convexity, depending how you express yields. An example might help: If yields are expressed in percent (e.g., 5 for 5%), then the convexity of a zero coupon bond with a duration of 15 is roughly $15\times15/100 = 2.25$. Alternatively, if you expressed yields in decimals (0.05 for 5%), then the corresponding convexity is expressed as $15\times 15 = 225$. The first approach is more common and is used by BBG. All you have to do is to divide your number by 100 to be consistent.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;You are using an approximation formula for convexity, but yield-based convexity for vanilla bonds has an exact closed-form solution (simply take the second derivative of the price/yield formula relative to yield).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Your implementation does not conform to market conventions (stuff like Actual/Actual day count). There are a lot of subtleties involved in bond pricing and I recommend using a professional implemented solution if precision is important. QuantLib, for example, has a very easy to use Python binding that you can use.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2017-10-31T22:08:37.683" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36685" PostTypeId="1" AcceptedAnswerId="36686" CreationDate="2017-11-01T00:12:59.063" Score="1" ViewCount="3342" Body="&lt;p&gt;What is the general usage of the term &lt;strong&gt;daily log returns&lt;/strong&gt; $Y_t$ of an asset? (1) or (2)?&lt;br&gt;&#xA;$$(1) \text{ } Y_t = log (\frac{p_t}{p_{t-1}})$$ &lt;strong&gt;OR&lt;/strong&gt; &#xA;$$(2) \text{ } Y_t = log (\frac{p_t-p_{t-1}}{p_{t-1}})$$ for $p_t$ being the close price of day $t$.&lt;/p&gt;&#xA;" OwnerDisplayName="user30233" LastActivityDate="2017-11-01T00:19:44.257" Title="Definition of log return of an asset" Tags="&lt;returns&gt;&lt;log-returns&gt;&lt;asset-returns&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2017-11-01T08:19:30.003" ContentLicense="CC BY-SA 3.0" />
  <row Id="36686" PostTypeId="2" ParentId="36685" CreationDate="2017-11-01T00:19:44.257" Score="1" Body="&lt;p&gt;The first one is a correct way. The second one is simply taking log to the relative returns which can be negative and natural log is not defined for negative values... &lt;/p&gt;&#xA;" OwnerUserId="18555" LastActivityDate="2017-11-01T00:19:44.257" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36687" PostTypeId="2" ParentId="14600" CreationDate="2017-11-01T01:20:38.140" Score="2" Body="&lt;p&gt;This is a dynamic programming problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a roll, the expectation will be 3.5.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For two rolls, if your first roll gets 1 or 2 or 3, you will roll it again. In other words, you have 1/2 chance to do the second roll and get the expectation as 3.5. If 4 or 5 or 6, you will stop here since it is good enough above the expectation (3.5). For such outcome as 4 or 5 or 6, your average is 5 with another 1/2 chance. So the total expectation will be 1/2*3.5 + 1/2*5 = 4.25.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For three rolls, you will consider the case differently after the first rolls. If I obtain 5 or 6, I will stop here for just one roll since it achieve above my expectation. Otherwise, I will roll twice and obtain the expectation of two rolls as 4.25. In total, the expectation will be 2/3*4.25 + 1/3*5.5 = 14/3 = 4.67.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose that we have k rolls and obtain the expectation $E$ above 5, we have to change the strategy again after the first roll. You can stop rolling if you get 6, otherwise keep going to obtain $E$ values. The new expectation will be like that:&#xA;$$E_{new} = 1/6*6 + 5/6*E_{old} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For n rolls, write a program in Python as the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;&#xA;def die_fair_value(rolls):&#xA;    cnt=1&#xA;    val=3.5&#xA;    while cnt &amp;lt; rolls:&#xA;        if val &amp;lt; 4:&lt;br&gt;&#xA;            val = 1/2.0*5 + 1/2.0*val&#xA;        elif val&amp;lt;5:&#xA;            val = 1/3.0*5.5 + 2/3.0*val&#xA;        else:&#xA;            val = 1/6.0*6 + 5/6.0*val&#xA;        cnt += 1&#xA;    return val&#xA;&lt;/code&gt;&lt;/p&gt;&#xA;" OwnerUserId="30234" LastEditorUserId="30234" LastEditDate="2017-11-01T14:35:41.980" LastActivityDate="2017-11-01T14:35:41.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36688" PostTypeId="2" ParentId="14600" CreationDate="2017-11-01T02:41:08.803" Score="2" Body="&lt;p&gt;Hang on a second.  The value of the game assuming you have an option to roll a second time is 4.25, as established above.  But the value of the game without the option to roll again is 3.5.  Therefore the value of the option is 0.75.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-11-01T02:41:08.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36690" PostTypeId="1" AcceptedAnswerId="36692" CreationDate="2017-11-01T07:05:08.300" Score="2" ViewCount="98" Body="&lt;p&gt;I've got the following question:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Suppose the price of a stock either rises or falls by the same&#xA;  percentage for each day. Suppose there is no dividend and the interest&#xA;  rate is 0. Should I buy the stock now or sell it? Is there no&#xA;  difference?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I think there were more conditions to this problem but I cannot remember.&#xA;Owning the stock gives some rights of the company, so I think we should also assume that the prospect of the company is neutral as well... I couldn't understand the intention and the answer of the problem. I would really appreciate if someone can explain it.&lt;/p&gt;&#xA;" OwnerUserId="30236" LastActivityDate="2017-11-01T16:14:14.707" Title="The right choice when the price of a stock follows a random walk" Tags="&lt;equities&gt;&lt;random-walk&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="36691" PostTypeId="1" CreationDate="2017-11-01T07:32:08.920" Score="8" ViewCount="470" Body="&lt;p&gt;Could you refer some most recent books of &lt;code&gt;derivatives pricing by C++&lt;/code&gt; including Tree method, Finite difference method, Monte Carlo etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once I read a series of &lt;code&gt;Daniel Duffy&lt;/code&gt;'s books, but most of his books were written more than 15 years. Many syntax are not used in modern C++ code.&lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-11-03T12:16:53.870" Title="Refer some most recent books of derivatives pricing by C++" Tags="&lt;programming&gt;&lt;derivatives&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36692" PostTypeId="2" ParentId="36690" CreationDate="2017-11-01T08:11:17.753" Score="3" Body="&lt;p&gt;It makes no difference. Starting with a capital of 1, let &lt;span class=&quot;math-container&quot;&gt;$X_i$&lt;/span&gt; be the multiplying factor for the &lt;span class=&quot;math-container&quot;&gt;$i$&lt;/span&gt;th day, so &lt;span class=&quot;math-container&quot;&gt;$X_i\in\{1+r,1-r\}$&lt;/span&gt; with each possibility having probability 1/2. The expected capital after one day is&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\mathbb E(X_1)=\frac12((1+r)+(1-r))=1.$$&lt;/span&gt;&#xA;After &lt;span class=&quot;math-container&quot;&gt;$n$&lt;/span&gt; days, your capital is &lt;span class=&quot;math-container&quot;&gt;$X_1X_2\cdots X_n$&lt;/span&gt;, and&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\mathbb E(X_1\cdots X_n)=\mathbb E(X_1)\cdots\mathbb E(X_n)=1$$&lt;/span&gt;&#xA;since the days are independent.&lt;/p&gt;&#xA;&lt;hr /&gt;&#xA;&lt;h3&gt;Clarifying notes&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;You might think,&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&amp;quot;&lt;span class=&quot;math-container&quot;&gt;$(1+r)(1-r)=1-r^2&amp;lt;1$&lt;/span&gt; so as the stock goes up and down, I lose money&amp;quot;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;but note that if the stock goes down, then down again, you have &lt;span class=&quot;math-container&quot;&gt;$$(1-r)^2=1-2r+r^2&amp;gt;1-2r,$$&lt;/span&gt;&#xA;so you get more than what you'd get using a &amp;quot;simple interest&amp;quot; idea, and this together with the up/up case cancels out the loss in the up/down case.&lt;/p&gt;&#xA;&lt;p&gt;Indeed, for &lt;span class=&quot;math-container&quot;&gt;$n=2$&lt;/span&gt; the expected capital is&#xA;&lt;span class=&quot;math-container&quot;&gt;$$\frac14[(1+r)^2+2(1+r)(1-r)+(1-r)^2)]=1.$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;Of course if you like or dislike risk then you may want to buy or not buy, respectively, but the expected capital remains 1.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;On the other hand if the multipliers were not &lt;span class=&quot;math-container&quot;&gt;$\{1+r,1-r\}$&lt;/span&gt; but &lt;span class=&quot;math-container&quot;&gt;$\{1+r, \frac1{1+r}\}$&lt;/span&gt; then it would make sense to buy, as the expectation after one day would be &lt;span class=&quot;math-container&quot;&gt;$$\frac12\left(1+r+\frac1{1+r}\right)=\frac12\frac{(1+r)^2+1}{1+r}=1+\frac{r^2}{2(1+r)}&amp;gt;1.$$&lt;/span&gt;&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="7431" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2017-11-01T16:14:14.707" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36693" PostTypeId="1" CreationDate="2017-11-01T11:29:12.593" Score="1" ViewCount="121" Body="&lt;p&gt;I am trying to calculate the implied option premium $C(K)$ and $\Delta$ using the procedure outlined by Castagna and Mercurio in this paper - &lt;a href=&quot;http://www.fabiomercurio.it/consistentfxsmile.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.fabiomercurio.it/consistentfxsmile.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is if I am given a range of option premiums for different maturities, and a swap curve for domestic and foreign rates, should I build the Vanna Volga option premium smile for a range of maturities $T$s and strikes $K$s and then interpolate to find the Vanna Volga option premium from this smile/surface or is it better to interpolate each item of my inputs to find the inputs at the correct maturity $T$ and then calculate the option premium without building a matric for a range of $T$s and $K$s.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Given&lt;/h2&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;risk-free rates for &lt;strong&gt;specific&lt;/strong&gt; Ts from 0, 1wk, 2wk, ..., 2y etc.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;$\sigma$ for $ \sigma_{\Delta25p} $, $ \sigma_{\Delta25c} $, $ \sigma_{\Delta_{ATM}} $&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;h2&gt;Input&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;$S_0$, $K$, and $T$&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Output&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;$C(K)$ and $\Delta$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, to clarify I want to kow whether I should interpolate to find a specific risk-free rate and $\sigma$ for a specifc $S_0$, $K$, and $T$ first or to interpolate the smile once I have calculated the above for a range of $T$s and $K$s.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="30238" LastActivityDate="2017-11-01T11:29:12.593" Title="Should I interpolate before or after to find option price using Vanna-Volga method?" Tags="&lt;option-pricing&gt;&lt;programming&gt;&lt;implied-volatility&gt;&lt;delta&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36694" PostTypeId="2" ParentId="15099" CreationDate="2017-11-01T11:53:04.230" Score="13" Body="&lt;p&gt;This is a loaded question. Ross' recovery theorem has both flaws and insights. The single answer thus far did a great job of addressing the flaws from an economics perspective. No one questions that the math is wrong: it is correct. Here is a mathematical insight from Ross' work. Abstracting from the finance and economics, the purely probabilistic content of Ross' Recovery theorem is the following. Suppose we are given a positive measure that describes the product of transition frequencies&#xA;of a univariate Markov process and a positive multiplicative functional $m_t = \exp(-\int_0^t g_u du)$, where $g_u$ is some real-valued stochastic process at time $u$.&#xA;The Ross recovery theorem answers two questions posed together: &#xA;Question 1) Under what additional probabilistic structure, can we remove the multiplicative functional and thereby obtain transition frequencies, which need not be the same as the transition frequencies multiplying the functional?&#xA;Question 2) What additional probabilistic structure to Question 1 is needed to uniquely obtain these possibly different transition frequencies?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ross' answer to both questions posed simultaneously is that the sufficient  conditions are that the univariate Markov process is an irreducible&#xA;time-homogeneous finite-state Markov Chain and that the measure change be transition independent. From a purely probabilistic perspective, &lt;a href=&quot;https://www.princeton.edu/~joses/wp/Long_term.pdf&quot; rel=&quot;noreferrer&quot;&gt;Hansen Scheinkman 2009&lt;/a&gt; answer question 1. Not surprisingly, they can do so with weaker sufficient conditions, requiring neither finite states or transition independence. Both papers supply mathematical insights into how to change from a positive measure eg Arrow Debreu security prices to a probability measure eg forward measure or market beliefs or a third probability measure.  From a purely probabilistic standpoint,   Ross incremental contribution is to answer question 2.    To get the stronger conclusion of uniqueness, he makes stronger assumptions. I don't personally consider this a flaw. In fact, identifying the additional structure that leads to the stronger conclusion is usually considered by mathematicians to be a mathematical insight.&#xA;Some economists argue in contrast that this additional structure is a weakness because&#xA;1) it is less general, and rules out some well known successful models, and &#xA;2) the particular application Ross suggested ends up being empirically refuted.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So to summarize, I believe that the two incremental assumptions Ross made in answering Question 2 can simultaneously be interpreted as both a mathematical insight and an economics flaw.&lt;/p&gt;&#xA;" OwnerUserId="30240" LastEditorUserId="16148" LastEditDate="2017-11-01T16:20:41.427" LastActivityDate="2017-11-01T16:20:41.427" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36695" PostTypeId="1" AcceptedAnswerId="36722" CreationDate="2017-11-01T12:10:42.923" Score="1" ViewCount="1142" Body="&lt;p&gt;In my question, as stated in the title, I aim to understand when the strategy of the CBOE Put Protection Index (&lt;a href=&quot;http://www.cboe.com/products/strategy-benchmark-indexes/put-protection-index&quot; rel=&quot;nofollow noreferrer&quot;&gt;PPUT&lt;/a&gt;) makes profit; particularly during which market conditions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given the description of CBOE: that the PPUT index holds a long position indexed to the SP500 and buys a monthly 5% OTM-Put option as hedge, what does that mean in terms of making profit? How does it make the profit?&lt;/p&gt;&#xA;" OwnerUserId="30242" LastEditorUserId="8147" LastEditDate="2017-11-01T13:18:44.530" LastActivityDate="2017-11-03T00:15:24.250" Title="When does the CBOE Put Protection Index (PPUT) make profit?" Tags="&lt;options&gt;&lt;finance&gt;&lt;put&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36696" PostTypeId="1" AcceptedAnswerId="36700" CreationDate="2017-11-01T12:59:57.377" Score="0" ViewCount="204" Body="&lt;p&gt;I am struggling to find any source from where I can get 13-f filings before 2000s. EDGAR is mostly after 1999. Does any one know a good source? Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="30244" LastActivityDate="2017-11-01T19:29:15.200" Title="Is there a way to get historical 13-f filings reports from 1970s-1990s?" Tags="&lt;edgar&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36698" PostTypeId="1" CreationDate="2017-11-01T16:33:09.407" Score="1" ViewCount="49" Body="&lt;p&gt;I would like to know which strategies would perform well if the ECB hikes interest rates?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Alternatively, what is a good strategy to hedge a loan in EUR against interest rate hikes? &lt;/p&gt;&#xA;" OwnerUserId="30246" LastEditorUserId="848" LastEditDate="2017-11-01T17:52:53.743" LastActivityDate="2017-11-01T17:52:53.743" Title="What strategies benefit from EURO (ECB) interest rate hike(s) long term?" Tags="&lt;interest-rates&gt;&lt;hedging&gt;" AnswerCount="0" CommentCount="1" ClosedDate="2017-11-01T21:13:55.943" ContentLicense="CC BY-SA 3.0" />
  <row Id="36700" PostTypeId="2" ParentId="36696" CreationDate="2017-11-01T19:29:15.200" Score="1" Body="&lt;ul&gt;&#xA;&lt;li&gt;Thomson Reuters has 13f filing data. I don't know the best way to get it from them. (If you're an academic, you can use Wharton Research Data Services if your school is a subscriber.)&lt;/li&gt;&#xA;&lt;li&gt;Section 13f &lt;a href=&quot;https://www.sec.gov/divisions/investment/13ffaq.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;didn't exist before 1975&lt;/a&gt;. I'm guessing you'll find that SEC rule 13f-1 which requires the 13f filing wasn't operational until the 1980s. &#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;For example, see &lt;a href=&quot;https://cdn.loc.gov/service/ll/fedreg/fr043/fr043121/fr043121.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;page 26705 of volume 43 of the Federal Register from 1978&lt;/a&gt; which describes rule 13f-1.&lt;/li&gt;&#xA;&lt;/ul&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="20582" LastActivityDate="2017-11-01T19:29:15.200" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36701" PostTypeId="1" CreationDate="2017-11-02T01:16:50.847" Score="2" ViewCount="917" Body="&lt;p&gt;I wonder how the number of shorted shares for a given company is publicly known. For example, &lt;a href=&quot;http://www.wsj.com/mdc/public/page/2_3062-nasdaqshort-highlites.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.wsj.com/mdc/public/page/2_3062-nasdaqshort-highlites.html&lt;/a&gt; (&lt;a href=&quot;https://web.archive.org/web/20171102011837/http://www.wsj.com/mdc/public/page/2_3062-nasdaqshort-highlites.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;mirror&lt;/a&gt;) indicates the percentage of the float that is shorted  :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/vQcUl.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/vQcUl.png&quot; alt=&quot;                             enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="2183" LastActivityDate="2017-11-02T01:16:50.847" Title="How is the number of shorted shares for a given company publicly known?" Tags="&lt;short-selling&gt;" AnswerCount="0" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36703" PostTypeId="1" AcceptedAnswerId="36705" CreationDate="2017-11-02T07:35:48.980" Score="3" ViewCount="979" Body="&lt;p&gt;The book &lt;code&gt;Advanced Equity Derivatives Volatility and Correlation&lt;/code&gt; &lt;code&gt;page 22&lt;/code&gt; said&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To preclude arbitrage we must at least require:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;No call or put spread arbitrage : $\dfrac{\partial c}{\partial K}\leq 0,\ \dfrac{\partial p}{\partial K}\geq 0.$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;No butterfly spread arbitrage : $\dfrac{\partial^2 c}{\partial K^2}\geq 0,\ \dfrac{\partial^2 p}{\partial K^2}\leq 0.$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;No calendar spread arbitrage : $\dfrac{\partial c}{\partial T}\geq 0,\ \dfrac{\partial p}{\partial T}\geq 0.$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;I know $\dfrac{\partial c}{\partial K},\dfrac{\partial^2 c}{\partial K^2},\dfrac{\partial c}{\partial T}$ are the limitation of their corresponding option strategies, but why $\leq 0$ and $\geq 0$ can represent the sufficient conditions of no arbitrage?&lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-11-02T09:13:43.630" Title="How to understand the no call or put spread arbitrage condition" Tags="&lt;option-strategies&gt;&lt;no-arbitrage-theory&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="36704" PostTypeId="2" ParentId="22307" CreationDate="2017-11-02T08:17:28.187" Score="0" Body="&lt;p&gt;This strategy used EMA crossing is a simple testing, It is only used to teach some new player to learn programmatic trading. But some times it also can make money. Although, it`s not a good strategy, because it can loss money too. So, it is just a test strategy to study if you interesting in this. You could watch this URL: &lt;a href=&quot;https://www.botvs.com/strategy/12348&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.botvs.com/strategy/12348&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A strategy only has 30 line code. It is Realizing the EMA, the MA and the AMA crossing. &lt;/p&gt;&#xA;" OwnerUserId="30254" LastEditorUserId="24222" LastEditDate="2017-11-02T08:33:15.813" LastActivityDate="2017-11-02T08:33:15.813" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36705" PostTypeId="2" ParentId="36703" CreationDate="2017-11-02T08:41:30.970" Score="3" Body="&lt;p&gt;Let's focus on a European call option for the sake of the argument. Assume deterministic rates to keep notations uncluttered. Define $\Bbb{Q}$ as the probability measure associated to the money market numéraire $B_t$.&#xA;$$ C(K,T) = \frac{1}{B_T} \Bbb{E}^\Bbb{Q} \left[ (S_T-K)^+ \right] = \frac{1}{B_T} \int_K^\infty (S - K) q(S) dS $$&#xA;Whence (Leibniz rule)&#xA;$$ \frac{\partial C}{\partial K}(K,T) = - \frac{1}{B_T} \int_K^\infty q(S) dS = -\frac{1}{B_T}\Bbb{Q}(S_T \geq K)$$&#xA;since $B_T$ is a numéraire (traded asset with positive value at all times) and since by definition of a probability &#xA;$$\Bbb{Q}(\omega) \geq 0 , \forall \omega \in \Omega$$&#xA; the resulting no static arbitrage condition is indeed $ \frac{\partial C}{\partial K}(K,T) \leq 0 $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly,&#xA;$$ \frac{\partial^2 C}{\partial K^2}(K,T) = \frac{1}{B_T}q(K) $$&#xA;where the same argument applies for the sign of $B_T$ and again by definition of a p.d.f.&#xA;$$ q(\cdot) \geq 0 $$&#xA;so that we we get $ \frac{\partial^2 C}{\partial K^2}(K,T) \geq 0 $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As you can see the weak inequalities directly come from the positivity on the c.d.f. and p.d.f.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As far as calendar arbitrage is concerned, the relation you wrote holds for American options and is a direct consequence of the latter's definition &#xA;$$ C^{AM}(K,T) = \sup_{\tau \in [0,T]} \Bbb{E}^\Bbb{Q} \left[ \frac{1}{B_\tau}(S_{\tau} - K)^+ \right] $$&#xA;where $\tau$ is a stopping time and obviously &#xA;$$ \sup_{\tau \in [0,T_2]} \Bbb{E}^\Bbb{Q} \left[ \frac{1}{B_\tau}(S_{\tau} - K)^+ \right] \geq \sup_{\tau \in [0,T_1]} \Bbb{E}^\Bbb{Q} \left[ \frac{1}{B_\tau}(S_{\tau} - K)^+ \right] $$&#xA;for any $T_2 \geq T_1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You have a similar inequality for the absence of calendar arbitrage for European options though, see &lt;a href=&quot;https://quant.stackexchange.com/questions/24753/calendar-arbitrage-in-a-vol-surface&quot;&gt;this&lt;/a&gt; related question for further info.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2017-11-02T09:13:43.630" LastActivityDate="2017-11-02T09:13:43.630" CommentCount="7" ContentLicense="CC BY-SA 3.0" />
  <row Id="36706" PostTypeId="2" ParentId="22307" CreationDate="2017-11-02T08:56:07.053" Score="1" Body="&lt;p&gt;The issue is that so as to the EMA crossing to work you need a perfect trend.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In case the underlying starts moving in a range you will start having multiple losing trades since the two EMA's will almost overlap...the commissions will kill you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can see this picture for an example&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/0QKwX.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/0QKwX.jpg&quot; alt=&quot;&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="22383" LastActivityDate="2017-11-02T08:56:07.053" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36707" PostTypeId="2" ParentId="36691" CreationDate="2017-11-02T09:08:11.367" Score="4" Body="&lt;p&gt;I'd recommend the 2nd edition of &lt;em&gt;C++ Design Patterns and Derivatives Pricing&lt;/em&gt; (2008) by the regretted Mark Joshi. The table of contents is available &lt;a href=&quot;http://www.markjoshi.com/design/contents.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;. Trees are covered in Chapter 8.&lt;/p&gt;&#xA;" OwnerUserId="19887" LastEditorUserId="19887" LastEditDate="2017-11-02T10:03:14.970" LastActivityDate="2017-11-02T10:03:14.970" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36709" PostTypeId="1" CreationDate="2017-11-02T10:28:19.127" Score="0" ViewCount="68" Body="&lt;p&gt;I'm currently taking a introductory mathematical finance course in university and recently on the news (BBC, etc), it states that the economic markets are shown to be slowing down for the next few years or so. This got me curious - is there a method in mathematics and/or statistics that allows one to show that the market is indeed slowing down in growth? The only areas I could think of currently is forecasting methods. Some insight will be appreciated, especially if some reference books can be suggested. &lt;/p&gt;&#xA;" OwnerUserId="29670" LastActivityDate="2017-11-02T10:28:19.127" Title="Is there a mathematical way of showing the slowing down of economic markets?" Tags="&lt;market-data&gt;&lt;finance-mathematics&gt;&lt;forecasting&gt;&lt;statistical-finance&gt;&lt;financial-engineering&gt;" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="36710" PostTypeId="1" CreationDate="2017-11-02T11:55:12.030" Score="2" ViewCount="258" Body="&lt;p&gt;We're talking about how we price every financial instrument: by discounting the payoff, that is, we take future cash flows and we discount them by a proper rate which takes into account the risk of not receiving those flows. I was thinking about these two points:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;to keep it simple, when we're dealing with unknown future cash flows (e.g. floating rate notes) we use forward prices to be consistent with an arbitrage-free setting;&lt;/li&gt;&#xA;&lt;li&gt;Put-Call parity yields implied dividends paid by the underlying in the future.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Let you have an array of implied dividends coming from Put-Call parity: these are the future cash flows paid by the underlying according to the arbitrage-free rules for which Put-Call parity holds true.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if the present value, $P(0)$, of any security is the discounted sum of its future cash flows on date $t$, $c(t)$, here we could write&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P(0)=\sum_{t=0}^{T}\frac{d(t)}{\left(1+k(t)\right)^{t}}+\frac{d(T)}{k(T)\left(1+k(T)\right)^{T}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Aside from typos, last cash flow is the terminal value and $d(t)$ terms are the implied dividends paid on date $t$. If we knew $k(t)$ term structure, we would know something like a yield term structure for the underlying risk: unfortunately, we don't have that. However, we have $P(0)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;does it make sense to solve for $\bar k$ like we do for vanilla bonds yield to maturity? This method is currently used by practitioners for everything which it shouldn't be used for: variable rate notes, callable bonds and so forth. Then I feel authorized to do it.&lt;/li&gt;&#xA;&lt;li&gt;What would this $\bar k$ represent? I would say it has the same properties of the yield to maturity: it is the return of the security only under very irrealistic assumptions... nonetheless, it's useful for comparisons and rankings purposes.&lt;/li&gt;&#xA;&lt;li&gt;Why isn't this model consistent with arbitrage-free valuation? Today I buy shares at $P(0)$ and I hedge my position by building (short) parity positions: I sell Call options and buy Put options struck at the same price. I get dividends from the underlying shares, same dividends that I &quot;lose&quot; when my short Calls expire and I have to deliver.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Any thoughts about the reason for which I'm wasting my time by building a screener for such &quot;implied dividend yields&quot;?&lt;/p&gt;&#xA;" OwnerUserId="3058" LastActivityDate="2018-10-09T22:05:58.963" Title="Is an options implied dividends DCF model consistent with risk neutral/arbitrage-free valuation?" Tags="&lt;dividends&gt;&lt;discounting&gt;&lt;put-call-parity&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36711" PostTypeId="2" ParentId="36710" CreationDate="2017-11-02T15:34:10.110" Score="0" Body="&lt;p&gt;In regards to 1 &amp;amp; 2, I think k(t) in this case represents more of the spot rate than the YTM. If you are assuming that the term structure is static, then k(t) can be interpolated for n periods of discounting dividends, but this is not realistic. I think this is ultimately why your model is not consistent with arbitrage free valuation. &lt;/p&gt;&#xA;" OwnerUserId="30043" LastActivityDate="2017-11-02T15:34:10.110" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36712" PostTypeId="1" AcceptedAnswerId="36715" CreationDate="2017-11-02T16:17:03.340" Score="2" ViewCount="5184" Body="&lt;p&gt;Suppose we are to plot a yield curve for a list of bonds. Do we use the Nelson-Siegel fitted yield curve since that's with the case for zero coupon bonds? Or do we in fact use bonds with different coupon rates to calculate the yield curve?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am somewhat confused with all the applicable methods and definitions so some clarification will be great, as I'm also still new to this topic on yield curves and term-structures.&lt;/p&gt;&#xA;" OwnerUserId="29670" LastActivityDate="2017-11-02T17:47:54.030" Title="Do we use the Nelson-Siegel model to calculate the yield curve?" Tags="&lt;bond&gt;&lt;yield-curve&gt;&lt;bond-yields&gt;&lt;term-structure&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36713" PostTypeId="2" ParentId="36712" CreationDate="2017-11-02T17:08:39.043" Score="1" Body="&lt;p&gt;Conceptually, the term-structure of interest rates (spot rate curve) is calculated with zero coupon treasuries. Nelson-Siegel will accomplish this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The yield curve is calculated with treasury Bonds, which pay coupons. While this is a good benchmark for examining the current state of interest rates, you will not gain much by comparing corporate bonds to this curve (since the coupons vary). Additionally, there are discrepancies with on the run issues, and how the day count is calculated with respect to corporates.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is for that reason that you want to model the zero coupon term-structure (spot rate curve). This will strip out many of the nuances of treasury bonds and give you a clearer picture on the spread between your corporate bond and zero-coupon treasuries.&lt;/p&gt;&#xA;" OwnerUserId="30043" LastActivityDate="2017-11-02T17:08:39.043" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36715" PostTypeId="2" ParentId="36712" CreationDate="2017-11-02T17:34:55.287" Score="9" Body="&lt;p&gt;In the beginning, we had a plot of yields of individual bonds against time to maturity, the crudest form of &quot;yield curve.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Years later, people began hand-drawing a smoothed line through these yields as closely as possible. Because bonds have different coupon rates, making their yields hard to compare, people tend to draw the curve through bonds trading close to par (100), making these the earliest form of &quot;par yield curves.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/e1Dhd.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/e1Dhd.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Later on, people discovered that they can use much better models to construct these curves more &quot;scientifically&quot; (e.g., in ways that use discounted cash flow principles and account for the differing coupon rates of bonds). Many models are proposed, including the Nelson-Siegel model, cubic splines, exponential splines, etc. These models all attempt to accomplish the same thing – create a curve that best fits the prices or yields of observed bond yields/prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now back to your questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Nelson-Siegel, like any other curve fitting procedures, can be used to produce smoothed yield curves. The outputs from the model can be the zero coupon curve (zero coupon rates against time), par curve (yields and coupon rates of par bonds against time), or forward curve (forward short-term interest rates). These curves are just mathematical transformations of each other. From a single model, you automatically get all of them.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The inputs to these models (NS included) are almost always coupon bonds, not zero coupon bonds (so yes, bonds of different coupon rates are used to calibrate the model). But as said, you get both zero coupon curve and coupon yield curve out of the model.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Quants/researchers like to work with zero coupon rates, because of their mathematical simplicity. But par curves are frequently the preferred presentation format, since they are more directly comparable with observed yields.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="8182" LastEditorUserId="8182" LastEditDate="2017-11-02T17:47:54.030" LastActivityDate="2017-11-02T17:47:54.030" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36716" PostTypeId="2" ParentId="36681" CreationDate="2017-11-02T19:37:31.650" Score="2" Body="&lt;p&gt;I found the answer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The loss in value is due to the fact that the portfolio of 1st and 2nd month futures itself loses value before it is readjusted. So when the readjustment is made (at the end of the day or however frequently it happens) to maintain a 30-day weighted average, a very small (but not insignificant) amount of money is lost.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is not due to the fact that the 2nd month contract is more expensive, but rather due to the fact that both the 1st and 2nd month contracts lose value for the interval they are held for before each rebalancing.&lt;/p&gt;&#xA;" OwnerUserId="29386" LastActivityDate="2017-11-02T19:37:31.650" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36719" PostTypeId="1" CreationDate="2017-11-02T20:34:49.387" Score="1" ViewCount="464" Body="&lt;p&gt;Good evening&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is where I am currently at with regards to calculating the sub interval details.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have split the calculation into 2 steps, firstly I am taking the return for date x minus the average of date x to date y (for the RHP 1 year using 21 days) so for example, if my first return date was 20/09/2016, I would average the returns for 20/09/16-18/10/16 and power the result to 2 (ie (rti-M1)^2).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second aspect is the wtiσs, which I have calculated as the Sum of the above results for 20/09/16-18/10/16 divided by the sub interval of 21 then square rooting that result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally, I take the 99th percentile of the results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, using the ESMA guidelines and recently released flow diagram, I am unable to come up with the same results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There appears to have been some discussion on whether or not you should use the latest years worth of data for the 1 year or if you should be using the full data set.  Personally I believe it should be the full data set otherwise if the latest years data had lower volatility you wouldn't see the full effect of the stress over a bad years data set.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, if this was the case, then why is the 3 and 5 year RHP stressed volatility different when they both use the same sub-interval and in theory the same full data-set.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone help me understand where I am going wrong and/or point me in the right direction please as I have managed to work everything else out and whilst I can get to within 4-5 decimal places of the ESMA results, the next step pushes the final figure for the stress scenario even further out (it works if I manually type in the figures for Wσs√N from ESMA) so I know that the last bit is not incorrect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Apologies for the long question.&lt;/p&gt;&#xA;" OwnerUserId="30231" LastActivityDate="2019-09-04T22:02:45.400" Title="PRIIPS Category 2 Stress Scenario Calc" Tags="&lt;priips&gt;&lt;regulatory-formula&gt;&lt;stress&gt;&lt;regulation&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36720" PostTypeId="2" ParentId="29982" CreationDate="2017-11-02T21:59:02.157" Score="1" Body="&lt;p&gt;Interpreting risk-neutral moments is tricky. Personally, I think the only good way to avoid heuristics and confusion in doing so is to always use the phrase &quot;from the perspective of a risk-neutral agent&quot;. A risk-neutral agent is just a weirdo who thinks that the probability of a hurricane breaking out tomorrow is 10%. You would disagree with him on that, of course, but - interestingly - agree on the price of the hurricane insurance! For this weirdo, the covariance between the underlying of a futures and the discount factor is equal to the forward-futures spread; for you, it is not.&lt;/p&gt;&#xA;" OwnerUserId="25674" LastActivityDate="2017-11-02T21:59:02.157" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36721" PostTypeId="1" CreationDate="2017-11-02T23:54:50.340" Score="1" ViewCount="40" Body="&lt;p&gt;I am trying to implement the spectral analysis on European Put Options. My code is designed to change the number of nodes(basis functions) accordingly, but the boundary condition and thus the range of the plots are dependent on the number of nodes used in the program. I am trying to have the same range and the boundary conditions independent of the N (nodes). Below is a current implementation of my code. Any suggestion on how should I make the boundary conditions independent of the N.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;K=40;     % Strike price&#xA;v=0.02;   % volatility&#xA;r=0.03;   % rate&#xA;T=1;      % time to maturity&#xA;nt=15;   % time intervals&#xA;N=30;     % number of nodes&#xA;M=3;      %  number of derivatives required&#xA;b=1;      % scaling parameter in Laguerre differentiation&#xA;% The function [x, DM] = lagdif(N, M, b) computes the&#xA;%  differentiation matrices D1, D2, ..., DM on Laguerre points.&#xA;%&#xA;[x, DM] = laguerredif(N, M, b); &#xA;D1=DM(:,:,1);  % 1-st derivative matrix&#xA;D2=DM(:,:,2);  % 2-nd derivative matrix&#xA;i=2:N-1; &#xA;I=speye(N);          % unit matrix&#xA;X=spdiags(x,0,N,N);  % matrix with x values&#xA;X2=X.^2;             % x^2 matrix&#xA;H=r*I-r*X*D1-0.5*v*X2*D2; % H operator from Black-Shcholes equation&#xA;A=H(i,i);            &#xA;xi=x(i);             % spot price values&#xA;yi=max(K-xi,0);      %  Put value for European &#xA;h=-T/nt;             % time step&#xA;t=T:h:0;             % backward scheme for time (from T to 0)&#xA;b=H(i,N)*K;          % Boundary condition&#xA;[l,u]=lu(I(i,i)-0.5*h*A); % LU decomposition&#xA;for it=2:length(t) &#xA;    % solving Matrix equation using LU decomposition &#xA;    % on every time step&#xA;b1=H(i,1)*K*exp(-r*(T-t(it)));      &#xA;yi=u\(l\(yi+0.5*h*(A*yi+b+b1)));&#xA;b=b1;&#xA;end&#xA;plot(xi,yi,'-o');    % plot for option values vs spot price&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="27916" LastActivityDate="2017-11-02T23:54:50.340" Title="Spectral Analysis for European Put Options" Tags="&lt;option-pricing&gt;&lt;black-scholes-pde&gt;&lt;european-options&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36722" PostTypeId="2" ParentId="36695" CreationDate="2017-11-02T23:56:04.063" Score="5" Body="&lt;p&gt;The PPUT strategy is an example of a &quot;tail protection strategy&quot;. The objective is to have a return somewhat similar to the return of the S&amp;amp;P 500 but with better performance during &quot;crashes&quot; (sharp down moves in the S&amp;amp;P). The strategy buys puts, which cost money (i.e. detract from returns) but are helpful when the SP drops more than 5% (improving the return in that case, i.e cushioning the fall).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As berkobay said, the strategy makes money as long as the rise in S&amp;amp;P exceeds the cost of the puts. As we will see later the average cost of the puts is about 10 or 20 basis points per month (although it can be much higher at times, such a after a crash), so for example when the S&amp;amp;P is up 3% in a month the PPUT might be up 2.8%, if the S&amp;amp;P is unchanged, the PPUT return might be -0.20% and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's use the &gt; 30 years of data provided by the CBOE, and look at returns during each &quot;option-month&quot;, where an &quot;option-month&quot; goes from the 3d Friday of a calendar month to the 3d Friday of the next month. For example &quot;option-September 2017&quot; goes from 2017/08/18 to 2017/09/15.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here are basic statistics for the monthly returns for the PPUT strategy and for the SPX index (recall that the SPX index does not include dividends):&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;    PPUT                         SPX&#xA;         Monthly Annualized           Monthly Annualized&#xA;N            374   31.17     N            374   31.17&#xA;Avg     0.006327  0.075919   Avg     0.007394  0.088724&#xA;Stdev    0.03595  0.124533   Stdev   0.045541  0.157759&#xA;Frac&amp;gt;=0 0.596257             Frac&amp;gt;=0 0.625668&#xA;Max     0.125122             Max     0.139962&#xA;95%tile 0.065314             95%tile 0.072122&#xA;Min     -0.07937             Min     -0.25061&#xA;5% tile -0.05982             5% tile -0.06378&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;As you can see the PPUT has lower returns per year (7.59% vs 8.87%) but with lower volatility (12.45% per year vs 15.78%). PPUT is less risky, as we can more clearly see by comparing the worst (i.e. tail) outcomes. For example the worst monthly return for SPX during this period was -25% (during the option-month from September 19, 2008 to October 17, 2008), while the worst possible outcome for PPUT was &quot;only&quot; -7.9).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To answer your first question the PPUT makes money a decent percentage of the time (59% of months) but the SPX makes money 62% of he time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Finally a chart of the PPUT and SPX cumulative returns visually confirms these statistics: a better return for the SPX, but a smoother ride for the PPUT.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/VhbmF.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/VhbmF.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Many more statistics could be computed, of course: I leave those up to you.&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2017-11-03T00:15:24.250" LastActivityDate="2017-11-03T00:15:24.250" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36723" PostTypeId="1" CreationDate="2017-11-03T00:31:20.123" Score="2" ViewCount="211" Body="&lt;p&gt;Which are good references to know about different calibration methods for stochastic volatility models such as Heston? I know that there are a lot of way of carrying this task out and I was just wondering if there is something like a survey of some work and project done about.&lt;/p&gt;&#xA;" OwnerUserId="29555" LastActivityDate="2018-03-04T09:06:11.680" Title="Calibration of stochastic volatility models" Tags="&lt;stochastic&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36728" PostTypeId="1" CreationDate="2017-11-03T06:33:53.077" Score="1" ViewCount="393" Body="&lt;p&gt;If, given a return stream of unknown composition, what is the best find a portfolio of assets that replicates that return stream from a universe of assets? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, what is the best optimisation method to use to find the weights to assign a portfolio of assets where the returns from the portfolio has a correlation of 1 to another asset? Preferably something that is easy to replicate in Python.&lt;/p&gt;&#xA;" OwnerUserId="30262" LastActivityDate="2020-06-26T01:18:43.807" Title="Create a hedging portfolio" Tags="&lt;optimization&gt;&lt;portfolio&gt;&lt;index&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36729" PostTypeId="1" AcceptedAnswerId="36759" CreationDate="2017-11-03T09:22:28.473" Score="-1" ViewCount="82" Body="&lt;p&gt;I am currently working on a project at an investment bank regarding new accounting regulations on financial instruments. The task at hand it to understand the connection between a large array of variables. In its simplest form, my question can be presented as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\tilde{X}$ and $\tilde{Y}$ be two random variables with sample means $\hat{\mu_{\tilde{X}}}$, $\hat{\mu_{\tilde{Y}}}$, sample variances $\hat{\sigma_{\tilde{X}}}^2$, $\hat{\sigma_{\tilde{X}}}^2$ and sample covariance $\hat{\sigma_{\tilde{X}\tilde{Y}}}^2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have ran 1000 Monte-Carlo simulations for $\tilde{X}$ under a geometric Brownian motion given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d{\tilde{X_t}}=\hat{\mu_{\tilde{X}}}\tilde{X_t}dt+\tilde{\sigma_{\tilde{X}}}\tilde{X_t}dW_{t},$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $W_{t}$ is the Wiener process; normally distributed - $\mathcal{N}(0,t)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One particular simulation, say $i$ of 1000 is of peculiar interest. I am now interested in the possible values for $\tilde{Y}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have tried to take an econometric approach. That is, run a regression on $\tilde{X}$ with $\tilde{Y}$ and using the regression equation&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\tilde{X_i} = \tilde{\beta_0} + \tilde{\beta_1}{\tilde{Y_{i}}},$$&#xA;$$\implies \tilde{Y_i} = \frac{\tilde{X} - \tilde{\beta_0}}{\tilde{\beta_1}},$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;try and back out the values of $\tilde{Y_i}$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am not quite pleased with the results. I am therefore hoping for an alternative method. I have other things in mind - that is, creating a new distribution for the sample but was hoping to gather the thoughts of the experts on this forum.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advanced to everyone who takes the time to read and/or provide their thoughts on the matter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gus&lt;/p&gt;&#xA;" OwnerUserId="13726" LastActivityDate="2017-11-05T15:36:02.630" Title="Given a particular Monte-Carlo simulation, how will a different correlated value change" Tags="&lt;monte-carlo&gt;&lt;regression&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36730" PostTypeId="1" AcceptedAnswerId="36821" CreationDate="2017-11-03T10:48:30.517" Score="2" ViewCount="793" Body="&lt;p&gt;I'm currently taking graduate finance courses, and wish to pursue a career in finance - in particular $\textbf{optimization in finance}$. To date, I've only been taught the GAMS programming language (some models can be found at: &lt;a href=&quot;https://www.gams.com/latest/finlib_ml/libhtml/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.gams.com/latest/finlib_ml/libhtml/index.html&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've looked up &lt;a href=&quot;https://quant.stackexchange.com/questions/306/what-programming-languages-are-most-commonly-used-in-quantitative-finance&quot;&gt;What programming languages are most commonly used in quantitative finance?&lt;/a&gt; but found no other programming language that solves optimization problems in finance. Are there any other possible programs I can pick up which are still relevant in the industry? &lt;/p&gt;&#xA;" OwnerUserId="29670" LastActivityDate="2017-11-10T03:32:00.470" Title="Types of programming languages used for optimization in finance" Tags="&lt;programming&gt;&lt;finance&gt;&lt;optimization&gt;&lt;finance-mathematics&gt;&lt;career&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36732" PostTypeId="2" ParentId="36691" CreationDate="2017-11-03T12:16:53.870" Score="6" Body="&lt;p&gt;If by &quot;modern C++&quot; you mean C++11 and beyond, I'm afraid you won't find such a book at this time.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are content with idiomatic C++ 03, as in &quot;using the STL and smart pointers instead of managing memory by hand&quot;, I second Quantuple's suggestion of Mark Joshi's book.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With a couple of caveats, I might also add my own &lt;a href=&quot;https://leanpub.com/implementingquantlib&quot; rel=&quot;noreferrer&quot;&gt;&lt;em&gt;Implementing QuantLib&lt;/em&gt;&lt;/a&gt;; the caveats being that (a) I'm tooting my own horn here, so I hope this answer will be useful enough not to be seen as just self-promotion; and (b) it describes the implementation of trees, FD, MC etc. in QuantLib, which is based on the constraints and the design goals we had for the library and might or might not be applicable in your case. I tried to describe those as well, so you can make different choices based on your constraints.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2017-11-03T12:16:53.870" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36736" PostTypeId="1" CreationDate="2017-11-03T17:48:06.307" Score="1" ViewCount="175" Body="&lt;p&gt;two short questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;If I download the five factor data from Kenneth French's website (&lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html&lt;/a&gt;) and for example calculate the average of the SML-portfolio, I get an excess return and not only a return, right?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If I want to prove, that the CAPM is a weak model, I just put the factor portfolios in a figure, where I also put the CAPM-predicted Security Market Line. The Security Market Line goes from the risk free rate on the y-axis through the average market return at beta=1. For the factor portfolios I calculate their CAPM-Betas by doing a regression. But wat is their return? Is their return equal to their excess return oder do I have to add the risk free rate on top of the calculated average excess returns? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="30268" LastActivityDate="2017-12-04T12:03:51.220" Title="Understanding Fama/Frenchs' Five Factors - Returns or Excess Returns?" Tags="&lt;capm&gt;&lt;fama-french&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36738" PostTypeId="1" CreationDate="2017-11-03T19:32:24.350" Score="3" ViewCount="2519" Body="&lt;p&gt;I'm trying to manually calculate the accrued interest of a U.S. Treasury floating rate note (FRN).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe the formula is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(# of days / 360) x 1,000,000 x coupon&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this formula is correct, then in order to back into the value of $199.84 on the following screen print, we would need a rate of 1.19904%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;199.84 = (6/360) x 1,000,000 x 0.0119904&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't see that 1.19904% rate anywhere on the screen print below.  Is there some sort of interpolation taking place?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How is the accrued interest of $199.84 calculated?  Thanks!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/8jfz4.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/8jfz4.jpg&quot; alt=&quot;Bloomberg YAS screen&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="30271" LastEditorUserId="30271" LastEditDate="2017-11-03T19:39:39.170" LastActivityDate="2017-11-03T19:39:39.170" Title="How to Calculate Accrued Interest on a Floating Rate Note" Tags="&lt;floating-rate&gt;&lt;accrued-interest&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36739" PostTypeId="2" ParentId="36602" CreationDate="2017-11-04T02:51:49.753" Score="2" Body="&lt;p&gt;For the 2.707 you get at year 18, there's a bug in your code. The 18 month tenor is loaded as 18 years&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#Swap Rates&#xA;swap_helpers = []&#xA;for i in range(len(terms)):&#xA;    if i &amp;lt; 4:  # should be i &amp;lt; 5!!! &#xA;        ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Don't know the conventions used for the Bloomberg rates to comment on the difference though.&lt;/p&gt;&#xA;" OwnerUserId="30274" LastActivityDate="2017-11-04T02:51:49.753" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36742" PostTypeId="2" ParentId="36723" CreationDate="2017-11-04T07:00:32.760" Score="1" Body="&lt;p&gt;You may have a look at &lt;a href=&quot;https://rads.stackoverflow.com/amzn/click/1482244063&quot; rel=&quot;nofollow noreferrer&quot;&gt;Stochastic Volatility Modeling&lt;/a&gt; by Lorenzo Bergomi.&lt;/p&gt;&#xA;" OwnerUserId="24989" LastActivityDate="2017-11-04T07:00:32.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36743" PostTypeId="2" ParentId="36736" CreationDate="2017-11-04T11:45:03.947" Score="2" Body="&lt;p&gt;For the first question: you get the excess return of small minus large (SML).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the second question: if you want to find the average return, you have to add the risk-free rate to the average excess return. &lt;/p&gt;&#xA;" OwnerUserId="29189" LastActivityDate="2017-11-04T11:45:03.947" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36744" PostTypeId="2" ParentId="21951" CreationDate="2017-11-04T15:17:07.647" Score="2" Body="&lt;p&gt;&lt;strong&gt;For FX feed:&lt;/strong&gt; Oanda's RestV20 API attends your needs pretty well. You can get live tick data for free by opening a practice account (it is pretty simple, doesn't need credit card or ID verification). &lt;a href=&quot;https://www.oanda.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.oanda.com/&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With this practice account API you can stream up to 20 currencies simultaneously.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;They also have descent historic data from 2004 onwards (I haven't looked for historic tick data, for sure they have '1 Minute' and upwards).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As of 4th November 2017 Oanda offer streams for 71 currencies:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;[&quot;AUD_CAD&quot;,&quot;AUD_CHF&quot;,&quot;AUD_HKD&quot;,&quot;AUD_JPY&quot;,&quot;AUD_NZD&quot;,&quot;AUD_SGD&quot;,&quot;AUD_USD&quot;,&quot;CAD_CHF&quot;,&quot;CAD_HKD&quot;,&quot;CAD_JPY&quot;,CAD_SGD&quot;,&quot;CHF_HKD&quot;,&quot;CHF_JPY&quot;,&quot;CHF_ZAR&quot;,&quot;EUR_AUD&quot;,&quot;EUR_CAD&quot;,&quot;EUR_CHF&quot;,&quot;EUR_CZK&quot;,&quot;EUR_DKK&quot;,&quot;EUR_GBP&quot;,&quot;EUR_HKD&quot;,&quot;EUR_HUF&quot;,&quot;EUR_JPY&quot;,&quot;EUR_NOK&quot;,&quot;EUR_NZD&quot;,&quot;EUR_PLN&quot;,&quot;EUR_SEK&quot;,&quot;EUR_SGD&quot;,&quot;EUR_TRY&quot;,&quot;EUR_USD&quot;,&quot;EUR_ZAR&quot;,&quot;GBP_AUD&quot;,&quot;GBP_CAD&quot;,&quot;GBP_CHF&quot;,&quot;GBP_HKD&quot;,&quot;GBP_JPY&quot;,&quot;GBP_NZD&quot;,&quot;GBP_PLN&quot;,&quot;GBP_SGD&quot;,&quot;GBP_USD&quot;,&quot;GBP_ZAR&quot;,&quot;HKD_JPY&quot;,&quot;NZD_CAD&quot;,&quot;NZD_CHF&quot;,&quot;NZD_HKD&quot;,&quot;NZD_JPY&quot;,&quot;NZD_SGD&quot;,&quot;NZD_USD&quot;,&quot;SGD_CHF&quot;,&quot;SGD_HKD&quot;,&quot;SGD_JPY&quot;,&quot;TRY_JPY&quot;,&quot;USD_CAD&quot;,&quot;USD_CHF&quot;,&quot;USD_CNH&quot;,&quot;USD_CZK&quot;,&quot;USD_DKK&quot;,&quot;USD_HKD&quot;,&quot;USD_HUF&quot;,&quot;USD_INR&quot;,&quot;USD_JPY&quot;,&quot;USD_MXN&quot;,&quot;USD_NOK&quot;,&quot;USD_PLN&quot;,&quot;USD_SAR&quot;,&quot;USD_SEK&quot;,&quot;USD_SGD&quot;,&quot;USD_THB&quot;,&quot;USD_TRY&quot;,&quot;USD_ZAR&quot;,&quot;ZAR_JPY&quot;]&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I am not very familiar with FXCM but I saw a free tick feed from them a few days ago (once I find the link I'll post it here).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I did find something about FXCM free historic tick data:&#xA;&lt;a href=&quot;https://www.fxcm.com/uk/trading-services/market-data/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.fxcm.com/uk/trading-services/market-data/&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="30280" LastEditorUserId="30280" LastEditDate="2017-11-04T15:27:32.657" LastActivityDate="2017-11-04T15:27:32.657" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36748" PostTypeId="1" AcceptedAnswerId="36749" CreationDate="2017-11-04T20:01:05.247" Score="2" ViewCount="225" Body="&lt;p&gt;I just found out about eurdollar futures and I am confused.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A eurodollar future contract is defined as a cash settled future based on a Eurodollar Time Deposit having a principal value of USD $1,000,000 with a three-month maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose that a a bank decides to sell 5 eurodollar futures that settle in three months. What exactly does it mean ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is going to happen when the constract expires?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Same question if the bank decides to buy 5 eurodollar contracts.&lt;/p&gt;&#xA;" OwnerUserId="30285" LastActivityDate="2017-11-05T14:46:27.270" Title="eurodollar future" Tags="&lt;futures&gt;&lt;derivatives&gt;&lt;hedging&gt;&lt;financial-engineering&gt;&lt;financial-markets&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36749" PostTypeId="2" ParentId="36748" CreationDate="2017-11-04T20:45:54.007" Score="3" Body="&lt;p&gt;all (STIR) short term interest rate futures are cash settled [see comment, STIR in this context is -IBOR futures which are the most common in the largest markets]&#xA;If a party sells 5 contracts at a price of 98.50, and at settlement the EDSP (exchange delivery settlement price) (which is derived from 3M US LIBOR) is, say, 98.40 then the bank has made a profit of 10 cents or 10 basis points.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The overall profit is 5mm (notional) * 0.0010 (price chg) * 0.25 (quarter of year) = $1,250.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rather obviously, buying is the opposite of selling, and would constitute a loss here.&lt;/p&gt;&#xA;" OwnerUserId="29443" LastEditorUserId="29443" LastEditDate="2017-11-05T14:46:27.270" LastActivityDate="2017-11-05T14:46:27.270" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="36750" PostTypeId="2" ParentId="36626" CreationDate="2017-11-05T00:01:38.903" Score="5" Body="&lt;p&gt;From the gentleman and scholar Emanuel Derman. Emanuel states &quot;the last two pages answer the question asked&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.dropbox.com/s/cg299qsbquuqdru/TwitterNotesOnBDT.2017.pdf?dl=0&amp;amp;m=&quot; rel=&quot;noreferrer&quot;&gt;https://www.dropbox.com/s/cg299qsbquuqdru/TwitterNotesOnBDT.2017.pdf?dl=0&amp;amp;m=&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please thank him directly on Twitter.&lt;/p&gt;&#xA;" OwnerUserId="27083" LastActivityDate="2017-11-05T00:01:38.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36751" PostTypeId="2" ParentId="25976" CreationDate="2017-11-05T02:48:27.510" Score="0" Body="&lt;p&gt;Another take at question 2: the value of the contract to you would be given by $V_0$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align}&#xA;V_0&amp;amp;=\min_{0\leq\tau \leq T}\mathbb{E}^Q\left[e^{-\int_0^{\tau}r(s)ds}(S_\tau-K)\right]&#xA;\\[6pt]&#xA;&amp;amp;=\min_{0\leq\tau \leq T}\left\{e^{-\int_0^{\tau}d(s)ds}S_0-e^{-\int_0^{\tau}r(s)ds}K\right\}&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming a zero dividend yield and a constant risk-free rate:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align}&#xA;V_0&amp;amp;=\min_{0\leq\tau \leq T}\left\{S_0-e^{-r \tau}K\right\}&#xA;\\[6pt]&#xA;&amp;amp;=1_{\{r&amp;gt;0\}}\left(S_0-K\right)+1_{\{r&amp;lt;0\}}\left(S_0-e^{-rT}K\right)&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With stochastic rates $-$ letting $P_{0,t}$ be the price of a zero-coupon bond with maturity $t$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align}&#xA;V_0&amp;amp;=\min_{0\leq\tau \leq T}\left\{S_0-P_{0,\tau}K\right\}&#xA;\\[6pt]&#xA;&amp;amp; \Leftrightarrow \max_{0\leq\tau \leq T} P_{0,\tau}&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Conclusions are the same as @dm63: with positive interest rates you exercise at contract inception $0$ whereas with negative rates you exercise at maturity $T$.&lt;/p&gt;&#xA;" OwnerUserId="20454" LastActivityDate="2017-11-05T02:48:27.510" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36752" PostTypeId="1" CreationDate="2017-11-05T03:59:30.250" Score="3" ViewCount="991" Body="&lt;p&gt;On &lt;a href=&quot;https://interactivebrokers.github.io/tws-api/historical_bars.html#hd_what_to_show&quot; rel=&quot;nofollow noreferrer&quot;&gt;Interactive Broker's TWS API manual&lt;/a&gt;, there are several historical data types to choose from.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Which IB TWS data type's &lt;code&gt;Close&lt;/code&gt; value corresponds to&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Close&lt;/li&gt;&#xA;&lt;li&gt;Adjusted Close&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;in Yahoo Finance?&lt;/p&gt;&#xA;" OwnerUserId="6409" LastActivityDate="2018-01-04T13:23:32.953" Title="Close and Adjusted Close in Interactive Brokers API and Yahoo Finance" Tags="&lt;time-series&gt;&lt;market-data&gt;&lt;interactive-brokers&gt;&lt;yahoofinance&gt;&lt;ohlc&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36753" PostTypeId="1" AcceptedAnswerId="36756" CreationDate="2017-11-05T06:10:13.723" Score="0" ViewCount="604" Body="&lt;p&gt;The last price of Wells Fargo (Ticker: WFC) on Thursday, 10/26/17, was&#xA;$55.62. Options with expiration 11/17/17 had following last prices: Options with expiration 11/17/17 had following last prices:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;call-strike-put &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1.11-55-0.78 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;0.85-55.5-1.04 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;0.63-56-1.33&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The spreads of the options were fairly low in the 0.04–0.06 range. The indicated price for the options is the average of bid and ask, which gives a good approximation for a realistic price. We will neglect interest rates in this problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(a) Compute $S_0+p-K-c$ for each of the three strike prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My answer:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$0.29,0.31,0.32$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(b) The computations in (a) show that the call-put parity seems to be violated.&#xA;Explain the reason for this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My answer: Wells Fargo is an American option. American options allow early exercise, unless, they are held until expiration. As we can see in the problem the expiration of the stock is 10/26 whereas the option expiration is 11/17. Since the expiration dates are not the same, there is opportunity for arbitrage, since the values in (a) are greater than 0, i.e. $S_0+p&amp;gt;K+c$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question: I understand that there is opportunity for arbitrage, but I don't understand how the arbitrage actually occurs. In this case, would a person 1. buy the $S_o+p$ or $K+c$ 2. which dates would they buy it and 3. when would they sell it. Also, what it means for $S_0+p$ to be greater than $K+c$ for the buyer's decision? &lt;/p&gt;&#xA;" OwnerUserId="29823" LastEditorUserId="29823" LastEditDate="2017-11-05T06:38:43.983" LastActivityDate="2017-11-05T10:28:25.493" Title="Violation of the call-put parity" Tags="&lt;arbitrage&gt;&lt;put-call-parity&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36754" PostTypeId="2" ParentId="36607" CreationDate="2017-11-05T07:19:00.513" Score="0" Body="&lt;p&gt;I actually found that what I was looking is referred to as &quot;Active Share&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;According to &lt;a href=&quot;https://activeshare.info&quot; rel=&quot;nofollow noreferrer&quot;&gt;ActiveShare.info&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Active Share is the percentage of fund holdings that is different from&#xA;  the benchmark holdings...&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Active Share is not a measure of skill but rather measures how&#xA;  different the fund's holdings are relative to the holdings of the&#xA;  particular benchmark considered...&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Research has shown that as a group and over fairly long periods of&#xA;  time:&lt;/p&gt;&#xA;  &#xA;  &lt;ul&gt;&#xA;  &lt;li&gt;funds with low Active Shares have tended to underperform their    benchmarks net of costs &lt;/li&gt;&#xA;  &lt;li&gt;funds with high Active Shares have tended to    outperform their benchmarks net of costs, especially among funds that    do not trade&#xA;  frequently, among small cap funds and among funds that do not have&#xA;  very large assets under management (see further the section 'Active&#xA;  Share Research')&lt;/li&gt;&#xA;  &lt;/ul&gt;&#xA;  &#xA;  &lt;p&gt;...The papers below, co-authored by Martijn Cremers,&#xA;  provide further background and explanation. For more information on&#xA;  his academic research on Active Share, see activeshare.nd.edu.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;The website also offers a search tool to determine a given fund's active share versus the S&amp;amp;P 500.&lt;/p&gt;&#xA;" OwnerUserId="26547" LastActivityDate="2017-11-05T07:19:00.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36756" PostTypeId="2" ParentId="36753" CreationDate="2017-11-05T10:28:25.493" Score="6" Body="&lt;p&gt;On 10/24/17, Wells Fargo announced that they would pay a dividend of 0.39 to holders of record on 11/3/17.  Thus, if you buy the stock after this date (through the exercise of the call) you do not get the dividend.  This means that the potential arbitrage, instead of being 0.30, is -0.09.   This is now sufficiently close to zero that there is likely no arbitrage opportunity after paying bid- offer on the put, call and stock.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://m.nasdaq.com/symbol/wfc/dividend-history&quot; rel=&quot;noreferrer&quot;&gt;http://m.nasdaq.com/symbol/wfc/dividend-history&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-11-05T10:28:25.493" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36757" PostTypeId="2" ParentId="36752" CreationDate="2017-11-05T13:00:28.783" Score="2" Body="&lt;p&gt;On the page you link:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;TRADES data is adjusted for splits, but not dividends&lt;/p&gt;&#xA;&lt;p&gt;ADJUSTED_LAST data is adjusted for splits and dividends. Requires TWS 967+.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;So to get adjusted close, request &lt;code&gt;ADJUSTED_LAST&lt;/code&gt; and use the Close field. To get the unadjusted close, request &lt;code&gt;TRADES&lt;/code&gt; and use the Close field.&lt;/p&gt;&#xA;" OwnerUserId="27966" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2017-11-05T13:00:28.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36758" PostTypeId="2" ParentId="36238" CreationDate="2017-11-05T13:38:32.893" Score="1" Body="&lt;p&gt;After some research, I found that PIIs are used in the modelling of Default Risk. See for example : &lt;a href=&quot;http://www.tandfonline.com/doi/abs/10.1080/13504860903357292&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.tandfonline.com/doi/abs/10.1080/13504860903357292&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this paper, the authors also use &quot;Sato processes&quot; which the authors define as a PII with self-similarity. &lt;/p&gt;&#xA;" OwnerUserId="29788" LastActivityDate="2017-11-05T13:38:32.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36759" PostTypeId="2" ParentId="36729" CreationDate="2017-11-05T15:36:02.630" Score="1" Body="&lt;p&gt;Quantuple's comment is completely relevant here. You have defined the relationship between X and Y through the covariance matrix. The traditional way of generating a set of paired variables (or multiple variables) using the monte carlo method is to use Cholesky decompisition on the matrix. You have:&#xA;$$ \Sigma = \begin{bmatrix} \sigma_x \sigma_x &amp;amp; \rho_{xy} \sigma_x \sigma_y \\ \rho_{xy} \sigma_x \sigma_y &amp;amp; \sigma_y \sigma_y \end{bmatrix} $$&#xA;Define the Cholesky decomposition: $\Sigma = \mathbf{LL^T}$ where $\mathbf{L}$ is a lower diagonal matrix. For the 2x2 case we have:&#xA;$$\mathbf{L}= \begin{bmatrix} \sigma_x &amp;amp; 0 \\ \rho_{xy} \sigma_y &amp;amp; \sigma_y\sqrt{(1-\rho_{xy}^2)} \end{bmatrix} $$&#xA;Now if, for each iteration you define $\mathbf{Z}=[Z_1, Z_2]$ two independent standard normal variables, the combination $\mathbf{LZ}+\mu$ will define paired samples whose covariance matrix tends to what you want for large samples.&#xA;I believe (although have not looked for a long time) that the distribution of the covariance matrix for n samples is defined by the Wishart distribution. &#xA;You can also use PCA decomposition for this but is more computationally expensive I believe.&lt;/p&gt;&#xA;" OwnerUserId="29443" LastActivityDate="2017-11-05T15:36:02.630" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36761" PostTypeId="2" ParentId="36644" CreationDate="2017-11-05T20:41:38.260" Score="1" Body="&lt;p&gt;Using $\theta$ variation in place of variance have the following effect:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;if you want to be protected “against” super-diffusivity (ie dynamics which variance / risk grows faster than linearly with time), use a $\theta&amp;gt;1$&lt;/li&gt;&#xA;&lt;li&gt;if you believe dynamics you are working against are sub-diffusive, use $\theta&amp;lt;1$&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The later case can be reallistic for intraday dynamics (negative auto-correlations, or presence of mean-reversion), see for instance &lt;a href=&quot;https://arxiv.org/abs/1205.3482&quot; rel=&quot;nofollow noreferrer&quot;&gt;Optimal starting times, stopping times and risk measures for algorithmic trading&lt;/a&gt; (by Labadie and L), while the former can be good if you fear some “bubbles”.&lt;/p&gt;&#xA;" OwnerUserId="2299" LastActivityDate="2017-11-05T20:41:38.260" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36764" PostTypeId="2" ParentId="36728" CreationDate="2017-11-06T03:15:22.150" Score="1" Body="&lt;p&gt;To answer my own question:&#xA;I've used a fairly simple index-tracking portfolio created from asset correlation, which is basically a quadratic programming optimisation problem, by following the procedure detailed in the paper here:&#xA;&lt;a href=&quot;https://www.nag.co.uk/content/index-tracking-portfolio-optimization-model&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.nag.co.uk/content/index-tracking-portfolio-optimization-model&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since my preferred Python quadratic programming solver (CVXOPT) does not explicitly incorporate lower/upper bound solution for portfolio weights, I've used the following quadprog function taken from &lt;a href=&quot;https://gist.github.com/garydoranjr/1878742&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://gist.github.com/garydoranjr/1878742&lt;/a&gt; to solve for optimal portfolio weights. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Both _x and _y are organised in date-unified Pandas data frames, with DateTime as index. &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;_x = ... # Return stream of potential portfolio of assets&#xA;_y = ... # target/hedge return stream&#xA;&#xA;n = len(_x.columns)&#xA;lb = -1.0&#xA;ub = 1.0&#xA;&#xA;ser, res = quadprog(&#xA;    np.cov(_x.transpose()), &#xA;    [-1.0 * np.cov(_x.loc[:,c].T, _y)[0][1] for c in _x.columns],&#xA;    np.ones(n),&#xA;    1.0,&#xA;    np.vstack([lb for n in range(n)]), &#xA;    np.vstack([ub for n in range(n)])  )&#xA;for s,z in zip(ser, _x.columns):&#xA;    print('{}: {:0.4f}'.format(z, float(s[0])))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="30262" LastActivityDate="2017-11-06T03:15:22.150" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36765" PostTypeId="1" AcceptedAnswerId="36775" CreationDate="2017-11-06T10:31:43.493" Score="2" ViewCount="548" Body="&lt;p&gt;I'm having some trouble pricing a 0% interest rate Floor following Black's formula. The term d1 contains the expresion Ln(Forward/Strike) &#xA;if the strike is exactly 0 this expresion yields an indetermination and therefore we can't compute N(d1) in the pricing formula.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I was wondering how to work around this. A peer suggested to compute the regular formula using a 100% probability, but the results are not really meningful.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Aside from the displaced model is there any other adjustment to the black model to price a 0% interest rate floor?&lt;/p&gt;&#xA;" OwnerUserId="30311" LastActivityDate="2017-12-07T12:25:21.790" Title="Pricing 0% interest rate Floor Black Model" Tags="&lt;black-scholes&gt;&lt;interest-rates&gt;&lt;derivatives&gt;" AnswerCount="2" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="36767" PostTypeId="2" ParentId="36602" CreationDate="2017-11-06T14:02:45.463" Score="3" Body="&lt;p&gt;You probably figured this out already, since you mention in the comments that Bloomberg rates are compounded semiannually.  However, the higher rates have to do with the compounding convention you're choosing. You're asking for rates with simple compounding, and that overrides the annual frequency you're passing and causes the rates to be higher than you expect.  Using &lt;code&gt;Compounded&lt;/code&gt; and &lt;code&gt;Semiannual&lt;/code&gt; returns values much closer to the ones you quoted.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2017-11-06T14:02:45.463" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36768" PostTypeId="1" AcceptedAnswerId="36769" CreationDate="2017-11-06T15:23:30.750" Score="2" ViewCount="852" Body="&lt;p&gt;Here is a passage from &quot;Advanced Equity Derivatives: Volatility and Correlation&quot; by Sebastien Bossu, Wiley (2014).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We see the prox $\beta_0,$ it seems to use the approximation that &lt;code&gt;the at-the-money short term straddle is same as the implied vol?&lt;/code&gt; But I can not obtain this result.&#xA;Here we may use approximate formula of at-money call/put with risk free rate $r=0:$&#xA;$$c= p = 0.4S\sigma\sqrt{T-t}?$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/xdgfe.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/xdgfe.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26165" LastEditorUserId="26165" LastEditDate="2017-11-06T15:50:50.457" LastActivityDate="2017-11-06T19:48:53.893" Title="at-the-money short term straddle and the implied vol" Tags="&lt;derivatives&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36769" PostTypeId="2" ParentId="36768" CreationDate="2017-11-06T16:00:36.987" Score="2" Body="&lt;p&gt;Throughout the answer we assume a Black-Scholes framework, noting $C_{BS}(t,T)$ and $P_{BS}(t,T)$ the prices at $t$ of a call and a put option written on an underlying $X_t$ and with maturity $T$. In general, the subscript $BS$ will designate the Black-Scholes price of a derivative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A straddle of strike $K$ corresponds to a simultaneous long position in a call option and in a put option both with strike $K$. Letting $V(t,T)$ be the value at $t$ of a straddle with maturity $T$, by call-put parity:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ V(t,T) = C(t,T)+P(t,T)=2C(t,T)+e^{-r(T-t)}K-X_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming no revenue (i.e. dividends) or cost yield, if the straddle is at-the-money (ATM) forward:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ V(t,T) = 2C(t,T)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, letting $\sigma_X^{\star}$ be the ATM volatility of underlying $X_t$, &lt;a href=&quot;https://quant.stackexchange.com/questions/1150/what-are-some-useful-approximations-to-the-black-scholes-formula&quot;&gt;a useful approximation of the Black-Scholes formula&lt;/a&gt; for ATM calls is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ C_{BS}(t,T) \approx 0.4X_t\sigma_X^{\star}\sqrt{T-t} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ V_{BS}(t,T) \approx 0.8X_t\sigma_X^{\star}\sqrt{T-t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover, note that your straddle is written on &lt;em&gt;returns&lt;/em&gt; instead of prices/levels, hence when the straddle is ATM the approximation simplifies to:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ V_{BS}(t,T) \approx 0.8\sigma_X^{\star}\sqrt{T-t}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your formula, the scaling factor $0.8$ and the square root will cancel, leaving:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \beta_0 = \frac{V_{BS}(t,T,B_t)}{\sum_{i=0}^n{w_iV_{BS}(t,T,S^{(i)}_t)}} \approx \frac{\sigma_B^{\star}}{\sum_{i=0}^n{w_i\sigma_i^{\star}}} $$&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-11-06T19:48:53.893" LastActivityDate="2017-11-06T19:48:53.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36770" PostTypeId="5" CreationDate="2017-11-06T16:16:38.947" Score="0" Body="" OwnerUserId="-1" LastEditorUserId="-1" LastEditDate="2017-11-06T16:16:38.947" LastActivityDate="2017-11-06T16:16:38.947" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36771" PostTypeId="4" CreationDate="2017-11-06T16:16:38.947" Score="0" Body="This is a special tag that is designed to be used only by the system for questions that have had all of their other tags removed. Do not add this tag to existing questions, it is reserved for use by the system to identify posts with no valid tags." OwnerUserId="16595" LastEditorUserId="16595" LastEditDate="2017-11-06T17:18:27.073" LastActivityDate="2017-11-06T17:18:27.073" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36772" PostTypeId="2" ParentId="36644" CreationDate="2017-11-06T18:09:39.467" Score="4" Body="&lt;p&gt;Something to perhaps realize is that your two problems may not be as different as you think if $\lambda$ is an ad-hoc parameter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For any solution to your 2nd problem (where $\theta &amp;gt; 1$), there exists a $\lambda$ for problem 1 which gives you the same solution as problem 2.&lt;/p&gt;&#xA;&#xA;&lt;h1&gt;Example&lt;/h1&gt;&#xA;&#xA;&lt;p&gt;Let $f$ and $g$ be convex functions and let $\mathbf{x}$ denote a vector. To build some intuition, consider the two problems (stylized versions of your problem 1 and problem 2). &lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Problem A:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;	\begin{array}{*2{&amp;gt;{\displaystyle}r}}&#xA;	\mbox{minimize (over $\mathbf{x}$)} &amp;amp; f(\mathbf{x}) + \lambda_1g(\mathbf{x}) 	\end{array}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Problem B:&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Let $h(x)$ be convex and non-decreasing over the range of $g$, hence composition $h(g(\mathbf{x}))$ is also convex. Consider&#xA;\begin{equation}&#xA;	\begin{array}{*2{&amp;gt;{\displaystyle}r}}&#xA;	\mbox{minimize (over $\mathbf{x}$)} &amp;amp; f(\mathbf{x}) + \lambda_2 h\left(  g(\mathbf{x})  \right) 	\end{array}&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;First order conditions&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Both are convex optimization problems and the first order conditions are necessary and sufficient.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The first order condition for problem A is $\frac{\partial f}{\partial \mathbf{x}} + \lambda_1 \frac{\partial g}{\partial \mathbf{x}} = 0$.&lt;/li&gt;&#xA;&lt;li&gt;The first order condition for problem B is $\frac{\partial f}{\partial \mathbf{x}} + \lambda_2 h'(g(\mathbf{x}))\frac{\partial g}{\partial \mathbf{x}} = 0$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Let $\mathbf{x}^*$ be the solution to either problem A or problem B. If $\lambda_1 = \lambda_2 h'(g(\mathbf{x}^*))$ then problem A and problem B have the same solution. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your penalty is $h(x) = x^\theta$ (which is convex and increasing on the region $x &amp;gt;0$ if $\theta &amp;gt; 1$). Observe $h'(x) = \theta x^{\theta - 1}$. Also observe that to achieve the same solution $\mathbf{x}^*$, you could have $\lambda_1 &amp;gt; \lambda_2$ or $\lambda_1 &amp;lt; \lambda_2$ depending on the specific parameterization. &lt;strong&gt;As you've formulated the problem, increasing $\theta$ doesn't necessarily increase the penalty for larger risk (where risk is defined as the standard deviation of returns)!&lt;/strong&gt; For example, let's say your solution $\mathbf{x}^*$ for $\theta = 1$ gives a standard deviation of returns of .01. Simply raising $\theta$ to $1000$ would increase the convexity of the risk penalty but it would decrease the level of the penalty to numerical irrelevance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your $g(\mathbf{x}) = \sqrt{\mathbf{x}'\Sigma \mathbf{x}}$ where $\Sigma$ is the covariance matrix of returns.&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-11-06T18:14:51.547" LastActivityDate="2017-11-06T18:14:51.547" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36774" PostTypeId="1" CreationDate="2017-11-07T05:48:36.570" Score="1" ViewCount="89" Body="&lt;p&gt;My question concern how to derive the expected utility of a power function in the following model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have two normally distributed risky assets X and Y and a risk-free asset B, for which :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;rA = 0.5y + 0.5x&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the following allocation problem in which I invest W0 = 100 $ between A and B :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;mrA + (100 − m)rB ∼ N&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, for a negative exponential utility I have &lt;/p&gt;&#xA;&#xA;&lt;p&gt;U(w) = -exp(-θW) where W = mrA + (100 − m)rB and θ = A(W)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/X4Dzq.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/X4Dzq.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;By doing the FOC, I can find m* which is the EU Maximizing weight to invest in the risky portfolio A if θ is known.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I want to do the same thing with a power function so I have tried to understand how to derive the exponential function and I have found the proof in the paper of Garlappi and Skoulakis (2008). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The general model to approximate E(U(R)) around the center cp of the Mth order is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/w4rxp.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/w4rxp.png&quot; alt=&quot;General model for Taylor Approximation&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Because we are working with normal distributions, odd moments are null and we are only interest by mean and variance (only the two first).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For exponential we have :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/I1FQl.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/I1FQl.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, I understand that the parameter &lt;a href=&quot;https://i.stack.imgur.com/4jWXA.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/4jWXA.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt; is only the general model for the mth order derivative. On this formula, there are two things that I don't understand quite well:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) When I compute &lt;strong&gt;(1)&lt;/strong&gt; for a 2nd order approximation, I obtain :&#xA;&lt;a href=&quot;https://i.stack.imgur.com/Obwsf.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Obwsf.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt; but I don't see how to continue the proof in order to find the final answer and from where the summation term from k=0 to K comes?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) The term &lt;a href=&quot;https://i.stack.imgur.com/P0700.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/P0700.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt; is developped for even moments (ie: second-order in this case) as :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/IqyDC.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/IqyDC.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i) Here, I cannot figure out what is the meaning of the parameter K and how to derive the proof. Even though I have found on Wikipédia that : (2k-1)!! = [(2k)! / (2k)!!] = [(2k)! / (2^n) * n!] but this is not the same thing because of the numerator that is different...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In brief, I hope that by understanding rigorously the exponential derivation, I will be able to apply as well for the power function in my little ptf problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance for this great help,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Gabriel&lt;/p&gt;&#xA;" OwnerUserId="30273" LastActivityDate="2017-11-07T05:48:36.570" Title="How to derive Expected utility approximation with power function" Tags="&lt;utility-theory&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36775" PostTypeId="2" ParentId="36765" CreationDate="2017-11-07T09:43:46.820" Score="3" Body="&lt;p&gt;If the forward is $&amp;gt; 0$ then under the Black &amp;amp; Scholes model the probability of underlying rate being $\leq 0$ is zero, so that the $0\%$ strike floor is worth zero. If the forward is $\leq 0$ (as has been happening since rates went into the negative territory) then the Black &amp;amp; Scholes model is meaningless since it models the underlying as being log normal. &#xA;This is why practitioners have resorted to the displaced log normal model, where the variable $underlying + displacement$ is assumed to be log normal, with $displacement$ an additional parameter of the model.   &lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2017-11-07T09:43:46.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36776" PostTypeId="1" CreationDate="2017-11-07T11:11:24.713" Score="2" ViewCount="78" Body="&lt;p&gt;The context of this question is Counterparty Credit Risk. In particular, the modelling of collateral for non-cleared OTC derivatives.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Regulators require collateral amounts, such as Variation Margin and Initial Margin, to be exchanged with a counterparty throughout the lifetime of a portfolio of trades.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This collateral should mitigate the risk of a counterparties' default over some horizon, e.g. 10 working days, called the margin period of risk (MPOR).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The settlement period is part of that MPOR, and corresponds to the time during which cash flows are acummulated by either side. This period ends when a default event is recognized, after which the liquidation procedure starts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The question is, do you know of any available work on how to quantitatively determine this settlement period over counterparties?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So far we have approached this using Granger causality test. In short, we check whether the actual available collateral per counterparty is Granger-caused by the theoretical collateral. Then we use the average time-lag over counterparties, resulting from this test, as an estimation of the settlement period.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Kind Regards,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nicolas&lt;/p&gt;&#xA;" OwnerUserId="29479" LastActivityDate="2017-11-07T11:11:24.713" Title="How to estimate quantitatively the settlement period?" Tags="&lt;counterparty-risk&gt;&lt;collateral&gt;&lt;margin&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36780" PostTypeId="2" ParentId="34856" CreationDate="2017-11-07T14:39:02.267" Score="2" Body="&lt;p&gt;The best HFTs don't just &quot;HFT&quot; and concurrently run multiple strategies on the same underlying instruments. Therefore, in general these estimates most likely are lowballing the profitability. As a former COO of an HFT-brokerage-provider, I saw the underlying numbers and labeling what most call &quot;HFT&quot; is erroneous - yeah, they go flat at the end of the day, but many strategies have holding periods in the dozens of seconds to minutes.  Anyone that gives you their estimates if not on the prop side is full of it. Best you  can do - take a look at the public company Virtu, they are a large player. And as a public company you can get &lt;em&gt;some&lt;/em&gt; insights into their profitability, if not their underlying strategies. &lt;/p&gt;&#xA;" OwnerUserId="12142" LastActivityDate="2017-11-07T14:39:02.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36786" PostTypeId="2" ParentId="34856" CreationDate="2017-11-08T03:10:05.860" Score="2" Body="&lt;p&gt;Instead of looking at estimates, you can look at actual data. There's two well known and publicly traded HFT firms Virtu Financial and Flow Traders. Their earnings and financials are public.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.flowtraders.com/investors#no-back&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.flowtraders.com/investors#no-back&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://ir.virtu.com/investor-relations/default.aspx&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://ir.virtu.com/investor-relations/default.aspx&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1764" LastEditorUserId="1764" LastEditDate="2017-11-08T03:15:13.297" LastActivityDate="2017-11-08T03:15:13.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36787" PostTypeId="1" AcceptedAnswerId="36791" CreationDate="2017-11-08T03:16:17.940" Score="3" ViewCount="334" Body="&lt;p&gt;Say I have infinite precision of strikes $K$ (continuous world $dk$) and expirations $T$ (continuous $dT$) all with liquidity (so no practical limitations). What positions in an underlying can't be replicated? I'm under the impression I can replicate any European payoff, so if I had infinite expirations I could replicate really any position.&lt;/p&gt;&#xA;" OwnerUserId="20194" LastEditorUserId="20194" LastEditDate="2017-11-08T22:28:55.700" LastActivityDate="2017-11-08T22:28:55.700" Title="What Positions on an Underlier CANNOT be Hedged with Vanillas?" Tags="&lt;exotics&gt;&lt;replication&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36788" PostTypeId="1" CreationDate="2017-11-08T03:46:15.527" Score="0" ViewCount="805" Body="&lt;p&gt;I'm calculating the historical and forward quarterly WACC for a security. For the historical WACC, should I use the quarter's tax rate (which in some cases is very negative) or a TTM tax rate or something else? The wide quarterly variances throw off the calculation considerably. The purpose of this would be to look for historical trends.&lt;/p&gt;&#xA;" OwnerUserId="30220" LastActivityDate="2018-12-05T09:55:58.320" Title="Choosing WACC Tax Rate" Tags="&lt;wacc&gt;" AnswerCount="2" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36789" PostTypeId="2" ParentId="27496" CreationDate="2017-11-08T04:58:06.870" Score="1" Body="&lt;p&gt;I suppose you could try:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Populating your 'tickers' vector with the symbolnames of all the rest of the stocks in your portfolio that you want to measure all at once.&lt;/li&gt;&#xA;&lt;li&gt;Use SIT::bt.apply.matrix or a similar function whose main argument is the 'prices' variable to get your signals applied to all 'tickers' you declared earlier in beginning.&lt;/li&gt;&#xA;&lt;li&gt;Run and measure.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="26400" LastActivityDate="2017-11-08T04:58:06.870" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36790" PostTypeId="2" ParentId="36787" CreationDate="2017-11-08T05:55:21.590" Score="3" Body="&lt;p&gt;Gap risk contracts.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;These are daily-restriking putspreads that pay &amp;amp; cancel only if the underlying drops more than (say) 20% as measured vs yesterday's closing level. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Contracts can range from as short as 6 months to 10 years.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Cannot replicate that using Europeans. &lt;/p&gt;&#xA;" OwnerUserId="27516" LastActivityDate="2017-11-08T05:55:21.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36791" PostTypeId="2" ParentId="36787" CreationDate="2017-11-08T10:51:05.240" Score="6" Body="&lt;p&gt;Any non path dependent European type payoff $f(S_T)$ can be replicated in a model independent way with vanilla calls and puts provided $f$ is twice differentiable (in the distribution sense). This is a consequence of the Carr-Madan formula. &lt;/p&gt;&#xA;" OwnerUserId="17606" LastEditorUserId="17606" LastEditDate="2017-11-08T15:26:00.533" LastActivityDate="2017-11-08T15:26:00.533" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36792" PostTypeId="1" CreationDate="2017-11-08T12:16:52.203" Score="1" ViewCount="1118" Body="&lt;p&gt;I know this topic has been on the table before, but I haven't seen a clear explanation with an example. I have successfully calculated the previous steps in &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://esas-joint-committee.europa.eu/Publications/Technical%20Standards/JC%202017%2049%20(PRIIPs_flow_diagram_risk_reward).pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://esas-joint-committee.europa.eu/Publications/Technical%20Standards/JC%202017%2049%20(PRIIPs_flow_diagram_risk_reward).pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but I am now struggling with stress scenario calculation in pages 23-24. I have made a quick excel to show the calculation I have done. I don't know where I'm going wrong , but I'm quite close number wise (could be still a mile away from correct). A clear answer with used value dates and ranges would be much appreciated to point out where I'm wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is a link to excel:&#xA;&lt;a href=&quot;https://www.dropbox.com/s/8htamga4mg92pf2/PRIIPS_EuroStoxx50_example.xlsx?dl=0&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.dropbox.com/s/8htamga4mg92pf2/PRIIPS_EuroStoxx50_example.xlsx?dl=0&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;edit: Added more calculations in the excel above&lt;/p&gt;&#xA;" OwnerUserId="30346" LastEditorUserId="30346" LastEditDate="2017-11-08T14:28:49.300" LastActivityDate="2018-10-18T15:44:06.770" Title="PRIIPs Stress Scenario for Category 2" Tags="&lt;calculation&gt;&lt;priips&gt;&lt;stress&gt;" AnswerCount="3" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36795" PostTypeId="2" ParentId="18758" CreationDate="2017-11-08T19:43:29.633" Score="1" Body="&lt;p&gt;You may refer this :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;use the latest package in CRAN &quot;BatchGetSymbols&quot; for downloading OHLC data for multiple tickers in a single data frame.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You may not need to construct the loop for this. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Refer the following link for more information&#xA;&lt;a href=&quot;https://cran.r-project.org/web/packages/BatchGetSymbols/vignettes/BatchGetSymbols-vignette.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://cran.r-project.org/web/packages/BatchGetSymbols/vignettes/BatchGetSymbols-vignette.html&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="30354" LastActivityDate="2017-11-08T19:43:29.633" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36796" PostTypeId="1" CreationDate="2017-11-08T20:19:34.873" Score="3" ViewCount="2183" Body="&lt;p&gt;This is a question on cap volatility market data. The quotes usually include volatilities for different strike (1%, 2%, ... 5%) and maturities (1Y,2Y,...20Y). One volatility for each combination of strike and maturity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I want to price a cap with, let's say, a strike of 2% and maturity in 10 years I would use the corresponding volatility from the market data described above. I think I understand it so far.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But then I also have volatility quotes for the at-the-money (ATM) rate. How do I know what the current at-the-money rate is? Second, in which situation would I use the ATM quotes?&lt;/p&gt;&#xA;" OwnerUserId="30357" LastEditorUserId="30357" LastEditDate="2017-11-08T21:05:42.983" LastActivityDate="2019-01-03T15:01:10.257" Title="Cap/Floor ATM Rate" Tags="&lt;option-pricing&gt;&lt;interest-rates&gt;&lt;market-data&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36797" PostTypeId="2" ParentId="36788" CreationDate="2017-11-08T23:39:46.820" Score="1" Body="&lt;p&gt;If you are trying to determine the quarterly WACC your tax rate needs to be quarterly as well. Personally, I would take a look at the change in income tax expense. You can also try experimenting with change in (income tax expense / ebit) or adding in income tax expense + deferred tax liability. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I would say use the quarterly tax rate even if it is negative. It is negative due to corporate tax subsidies, deferments, low quarterly earnings etc. Point being that these, in so far as they are eventually translated in to capital losses or gains should impact the weighted average cost of capital. Example: One of the ways the government will try and encourage businesses to expand is lowering the tax rate. So that they will get more bang for their buck, so to speak.&lt;/p&gt;&#xA;" OwnerUserId="30359" LastActivityDate="2017-11-08T23:39:46.820" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36799" PostTypeId="2" ParentId="10334" CreationDate="2017-11-09T01:25:24.310" Score="2" Body="&lt;p&gt;CLS, the global payment-versus-payment FX settlement platform provides aggregated data through Quandl. CLS doesn't cover the entire market but settles about half of the global the FX turnover (for its membership across different trading platforms). The order flow data is provided for spot trades only. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope that helps.&#xA;S&lt;/p&gt;&#xA;" OwnerUserId="30363" LastActivityDate="2017-11-09T01:25:24.310" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36800" PostTypeId="1" CreationDate="2017-11-09T02:29:55.923" Score="0" ViewCount="233" Body="&lt;p&gt;I am trying to understand the concept, weighting schemes, real\$ vs fast\$ view, etc... On the desk today, I used some third party tool to run analysis on some trade ideas but I'm blindly running numbers based on different horizon yields. I would like to understand the process more.&lt;/p&gt;&#xA;" OwnerUserId="29342" LastEditorUserId="16160" LastEditDate="2017-11-09T03:03:43.023" LastActivityDate="2017-11-09T04:16:49.923" Title="Anyone have good literature on buying bullet vs barbell returns?" Tags="&lt;fixed-income&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36801" PostTypeId="2" ParentId="36800" CreationDate="2017-11-09T04:16:49.923" Score="3" Body="&lt;p&gt;A very detailed treatment can be found in Antti Ilmanen's &quot;Understanding the Yield Curve: Part 5 - Convexity Bias and the Yield Curve.&quot; This piece of pretty easy to find on the Internet.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Another wonderful report is &quot;Can Convexity Be Exploited&quot; (Lehman Brothers Quantitative Portfolio Strategy 2006).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For regression-based weighting, refer to Bruce Tuckman's &lt;em&gt;Fixed Income Securities&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For PCA-based weighting, refer to &quot;Principles of Principal Components&quot; (Salomon Smith Barney 2000) and &quot;PCA for Interest Rates&quot; (Morgan Stanley 2005).&lt;/p&gt;&#xA;" OwnerUserId="8182" LastActivityDate="2017-11-09T04:16:49.923" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36802" PostTypeId="2" ParentId="36788" CreationDate="2017-11-09T05:48:02.233" Score="2" Body="&lt;p&gt;The various forms of the Capital Asset Pricing Model, as well as Black-Scholes, are built on top of the axioms of Frequentist Decision Theory.  An assumption in the model is that the parameters are known with a probability of one.  Generally speaking, this assumption is harmless.  There are many models where the result with perfect knowledge is also the result without such knowledge.  Unfortunately, finance cannot be such a case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To demonstrate this case, consider the simple one period profit function of $w_{t+1}=Rw_t+\epsilon_{t+1}$.  If $\epsilon$ is drawn from a normal distribution and $R$ is known, then all of the properties of mean-variance finance will hold.  In fact, $w_{t+1}$ will converge to a normal distribution on repeated sampling if you rescale to 1 at every sample.  However, if $R$ is unknown and $R&amp;gt;1$, which it must be in finance, then two papers show that this class of problem has no non-Bayesian solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first paper was by Mann and Wald in 1943 and the second by White in 1958.  Mann and Wald solved that the estimator for the coefficient was the least squares estimator, a form of the sample mean.  White showed that the distribution of $\hat{R}-R$ was the Cauchy distribution.  This is where it gets weird.  The Cauchy distribution lacks a population mean or variance. Hence no useful estimator exists.  Therefore WACC cannot be estimated unless you actually know the means, variances, and covariances of every security with perfect knowledge.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I wrote a paper solving the distribution of returns for all asset and liability classes.  It notes something else that most people have ignored.  The first, above, is that no one actually checked the properties of estimators created by these models.  The second though is interesting as well.  Returns cannot be data, except bank or insurance company guaranteed investments.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Returns are not data as they are not observed.  Prices are observed.  Volumes are observed.  Cash flows are observed.  Returns are calculated from either prices or cash flows.  They are a function of the data.  The definition of a statistic is that it is a function of the data.  Returns are not data.  They are statistics.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As such, they inherit the properties of the underlying data via the mathematical transformation that turns them into returns.  There are four methods that economists convert prices to returns discussed in the article.  A fifth, using the internal rate of return method, was not thought about by me when I wrote the article although it is a form of regression and so should be covered.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the simple case where a return is a future value divided by the present value minus one is the ratio of two random variates.  Under some simple, real-world assumptions, the distribution of returns of going concerns that are traded on an exchange will converge to the truncated Cauchy distribution with a very slight skew due to the intertemporal budget constraint.  For assets sold at other types of auctions, such as Sotheby’s, it will be the ratio of two Gumbel distributions because of the different rules.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The short version of this is that WACC cannot be measured if it exists.  Any attempt at measurement would have zero relative asymptotic efficiency to a median based measurement.  This would violate the theory.  It isn’t median-interquartile range finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason you are getting wide sample variances that do not settle down is that the truncated Cauchy distribution lacks a variance.  It looks like heteroskedasticity, but it isn’t.  The Cauchy distribution is askedastic, and so no measurement of a traditional understanding of volatility exists.  This is not to say it cannot be measured.  The interpretation is very different because there is no such thing as a variance or covariance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Bayesian methods are admissible here, but they don’t work like it is generally taught in finance.  Indeed, since they do not view data as random, but instead view parameters as uncertain the differences can be rather large.  Before going down that path, I recommend picking up an introductory text on Bayesian methods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you look at a mean or variance as a property of a distribution, then you may have an easier time thinking about it.  A nose is a property that vertebrates share.  Trees do not.  If you attempt to measure the number of noses on a tree, you will fail no matter what method you use.  On the other hand, trees do pass gasses with the environment.  They just don’t do it through the structure we call a nose.  All living parts of a tree are engaged in respiration.  If you widen your concept, the lack of a nose is not a problem.  Not having a variance is a similar type of problem.  The idea of volatility works differently quite a bit in the same sense that trees lack noses but respirate through an entirely different model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The correct solution is to look at the marginal cost of capital on a firm by firm basis.  For firms with lines of credit, this is easy.  For firms that would not qualify for commercial loans then you would have to look at the discount on initial public offerings.  I doubt a data source exists to provide you with your requested information.  The existence of mean-variance finance implied that it was not necessary information.  Someone really needs to go back and fill in that gap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For my paper, you can find it at &lt;a href=&quot;http://www.scirp.org/Journal/PaperInformation.aspx?PaperID=78849&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.scirp.org/Journal/PaperInformation.aspx?PaperID=78849&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For White’s paper, you can find it at:&#xA;White, J.S. (1958) The Limiting Distribution of the Serial Correlation Coefficient in the Explosive Case. The Annals of Mathematical Statistics, 29, 1188-1197.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don’t have the Mann and Wald citation where I am at, but I think you can get to it via the White paper in its bibliography.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do apologize, but your problem cannot be solved by anyone.  No such methodology exists within null hypothesis based methods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Just for completeness, it does not matter what tax rate you use as you cannot solve the necessary other components.  IF you used the marginal cost of funds, then you should use the actual quarterly marginal tax rate, even if it is negative to be mathematically consistent with the idea of marginal thinking.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastEditorUserId="25459" LastEditDate="2017-11-09T05:54:29.990" LastActivityDate="2017-11-09T05:54:29.990" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="36804" PostTypeId="1" AcceptedAnswerId="36815" CreationDate="2017-11-09T11:10:06.307" Score="9" ViewCount="1531" Body="&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/F50yn.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/F50yn.jpg&quot; alt=&quot;A Satire of Tulip Mania by Jan Brueghel the Younger (ca. 1640)&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The &lt;a href=&quot;https://en.wikipedia.org/wiki/Tulip_mania&quot; rel=&quot;noreferrer&quot;&gt;Tulip mania&lt;/a&gt; is considered to be one of the first recorded examples of a speculative bubble in modern history. Long story short, the newly introduced tulip plant in the United Provinces, combined with the development of the first modern financial instruments like future contracts and markets to exchange future contracts, lead to a craze that suddenly burst in February 1637.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The wikipedia article has the following to say about the available data:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;The lack of consistently recorded price data from the 1630s makes the&#xA;  extent of the tulip mania difficult to discern. The bulk of available&#xA;  data comes from anti-speculative pamphlets by &quot;Gaergoedt and Warmondt&quot;&#xA;  (GW) written just after the bubble. Economist Peter Garber collected&#xA;  data on the sales of 161 bulbs of 39 varieties between 1633 and 1637,&#xA;  with 53 being recorded by GW. Ninety-eight sales were recorded for the&#xA;  last date of the bubble, 5 February 1637, at wildly varying prices.&#xA;  The sales were made using several market mechanisms: futures trading&#xA;  at the colleges, spot sales by growers, notarized futures sales by&#xA;  growers, and estate sales. &quot;To a great extent, the available price&#xA;  data are a blend of apples and oranges&quot;, according to Garber.[34]&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;It seems that the work of Garber contains the most extensive data collection. I wondered if there is a place on the net where these data are readily available, preferably in a format that is easy to parse for statistical analysis tools like R.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;TL;DR : Can I download the data concerning Tulip mania somewhere?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="156" LastActivityDate="2017-11-13T11:34:50.653" Title="Data for the Tulip mania" Tags="&lt;market-data&gt;&lt;historical-data&gt;&lt;speculation&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="36807" PostTypeId="1" CreationDate="2017-11-09T13:45:50.493" Score="1" ViewCount="286" Body="&lt;p&gt;I'm studying the Merton model for pricing an European call option. The jump-diffusion process is:&#xA;$$X_t=bt+\sigma W_t+\displaystyle\sum_{i=1}^{N_t}Y_i.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$N_t$ is the Poisson process,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$W_t$ is the brownian motion with drift $b=\left(r-\frac{\sigma^2}{2}-\lambda\left(e^{\mu+\delta^2/2}-1\right)\right)$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\mu$ is the mean of jumps,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\delta$ is the standard deviation of jumps,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\Phi_X(u) = exp\left(t\left(ibu-\frac{\sigma^2u^2}{2}+\lambda\left(exp\left(i\mu u-\frac{\delta^2u^2}{2}\right)-1\right)\right)\right)$ is the characteristic function of $X_t$,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$V_0 = \displaystyle\sum_{n=0}^{+\infty}e^{-\lambda T}\frac{(\lambda T)^n}{n!}V_{BS}$ is the Merton series for the option price, where $V_{BS}=blsprice$ is the option price in Black-Scholes. So $V_0$ is the analytical solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I already solved the PIDE, derived from the jump-diffusion model, with an implicit scheme. The numerical solution approximates very well the analytical one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I'm studying the Carr-Madan algorithm on the &lt;a href=&quot;http://www.proba.jussieu.fr/pageperso/tankov/tankov_voltchkova.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;article by Tankov and Voltchkovato&lt;/a&gt; (pages 9 to 11), and I would like to compare its numerical solution with the analytical one of the Merton series. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Carr-Madan is based on the idea of considering the log of the strike, $k=log(K)$, and then compute the Fourier transform of the difference between the price of an European call in the jump-diffusion model (Merton model here)(this price is what we want to achieve) and the price of an European call in the Black-Scholes model. This Fourier transform is given by &#xA;$$\zeta_T(v)=e^{ivrT}\frac{\Phi_X(v-i)-\Phi_{BS}(v-i)}{iv(1+iv)}$$&#xA;where $\Phi_X$ is the one above and $\Phi_{BS}=exp\left(-\frac{\Sigma^2T}{2}\left(v^2+iv\right)\right)$ is the characteristic function of log-stock&#xA;price in the Black-Scholes model (in my code I'm using $\Sigma=\sigma$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The call price in the Merton model can be computed by evaluating numerically the inverse Fourier transform of $\zeta_T$ and then by summing to it the Black-Scholes call price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The inverse Fourier transform of $\zeta_T$ is (truncate and discretize the integral)&#xA;$$\frac{1}{2\pi} \int_{-\infty}^{+\infty} e^{-ikv}\zeta_T(v)dv \approx \frac{L}{2\pi(N-1)} \sum_{m=0}^{N-1} w_m\zeta_T(v_m) e^{-ikv_m}$$&#xA;where $v_m = -L/2+m\Delta,~\Delta = L/(N-1)$ is the discretization step and $w_m$ are weights for a integration rule (I'm using Simpson's rule).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We can identify this sum with the DFT $F_n = \sum_{k=0}^{N-1} f_k e^{-2\pi ink/N}$ by chosing the log strikes $k_n = k_0+2\pi n/(N\Delta),~n=0,...,N-1$:&#xA;$$\frac{L}{2\pi(N-1)} e^{ik_nL/2} \sum_{m=0}^{N-1} \underbrace{w_m\zeta_T(k_m) e^{-ik_0m\Delta}}_\textrm{$f_m$} e^{-2\pi inm/N}.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm studying the particular case with $\mu=0$ and $K=1$, that's why I compare (in the last line of the code) the analyrical solution with the first component of the Carr-Madan solution (first strike for Carr-Madan is $K=e^{k_0}=1$ because $k_0=0$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I'm facing some problems:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) if the initial underlying price $S_0=1$, then Carr-Madan solution is about $8$% bigger than the analytical one;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) if $S_0=1$ AND I remove the risk-free interest $r$ from $b$, then the Carr-Madan solution is equal to the analytical one (first seven digits after the separator are equal);&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(3) if $S_0\neq 1$ the Carr-Madan solution is different from the analytical one (the error is smaller if I eliminate $r$ from $b$).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I really don't understand this behaviour and where I made the mistakes in the code, so I post it here. For the variables I used the names as in Tankov-Voltchkovato article. So this is the matlab code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;clear all&#xA;close all&#xA;format long&#xA;&#xA;%% parameters&#xA;&#xA;t = 0;       % now&#xA;T = 1;       % expiry date&#xA;tau = T - t; % time to expiry&#xA;S_0 = 1;     % initial underlying price&#xA;r = 0.1;     % risk-free rate&#xA;sigma = 0.2; % volatility&#xA;lambda = 1;  % mean no. of jumps per unit time&#xA;mu = 0;      % mean of jumps&#xA;delta = 0.5; % standard deviation of jumps&#xA;&#xA;%% merton series (analytical solution)&#xA;&#xA;K = 1; % strike&#xA;N = 30;&#xA;v = zeros(N+1,1);&#xA;for n = 0:N&#xA;    sigma_n = sqrt(sigma^2+n*delta^2/tau);&#xA;    Sn = S_0*exp(n*mu+n*delta^2/2-lambda*tau*exp(mu+delta^2/2)+lambda*tau);&#xA;    v(n+1) = exp(-lambda*tau)*(lambda*tau)^n/factorial(n)*blsprice(Sn,K,r,tau,sigma_n);&#xA;end&#xA;MertonSeriesValue = sum(v);&#xA;&#xA;%% carr-madan (numerical solution)&#xA;&#xA;L = 2^16; % truncation interval&#xA;N = 2^16; % no. of points&#xA;v_m = linspace(-L/2,L/2,N);&#xA;Delta = L/(N-1); % discretization step&#xA;% corrected Simpson-Cavalieri weight rule&#xA;w = 4*ones(1,N); &#xA;w(1:2:N) = 2;&#xA;w(1) = 1;&#xA;w = w/3;&#xA;% log strikes&#xA;k_0 = 0;&#xA;k_n = k_0+(2*pi*(0:(N-1)))/(Delta*N);&#xA;K_CR = exp(k_n);&#xA;&#xA;zeta_T = fourier(v_m,T,sigma,r,lambda,mu,delta);    % Fourier transform&#xA;dft = fft(w.*zeta_T.*exp(-1i*k_0*Delta*(0:(N-1)))); % FFT computes DFT&#xA;z_T = L/(2*pi*(N-1))*exp(1i*k_n*L/2).*dft;          % aproximate option prices&#xA;C_BS = blsprice(S_0,K_CR,r,T,sigma);                % option value for Black-Scholes&#xA;C = z_T+C_BS;                                       % option value for Merton&#xA;CarrMadanMertonPrice = max(real(C),0);&#xA;&#xA;%% comparison&#xA;&#xA;Merton_CR_KK = [MertonSeriesValue(1); CarrMadanMertonPrice(1); K_CR(1)==K]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;function used at line 46&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function[zeta_T] = fourier(v,T,sigma,r,lambda,mu,delta)&#xA;%&#xA;% Fourier transform in log-strike k of z_T(k)&#xA;%&#xA;u = v-1i;&#xA;b = r-(sigma^2)/2+lambda*(1-exp(mu+(delta^2)/2)); % if I remove r from here the solution will be more precise&#xA;phi_T_sigma = exp(-(sigma^2)*T*(u.^2+1i*u)/2); % characteristic function of log-stock price in the Black-Scholes model&#xA;phi_T = exp(T*(-((sigma*u).^2)/2+1i*b*u+lambda*(exp(-(delta*u).^2/2+1i*mu*u)-1))); % characteristic function of the jump-diffusion process in the merton model&#xA;zeta_T = exp(1i*v*r*T).*(phi_T-phi_T_sigma)./(1i*v.*(1+1i*v)); % Fourier transform&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="30227" LastActivityDate="2017-11-09T13:45:50.493" Title="Option pricing in Merton model, comparison between Merton series and Carr-Madan" Tags="&lt;option-pricing&gt;&lt;black-scholes-merton&gt;" AnswerCount="0" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="36808" PostTypeId="1" AcceptedAnswerId="36809" CreationDate="2017-11-09T14:41:20.480" Score="2" ViewCount="106" Body="&lt;p&gt;I am looking at a portfolio of private assets which is a mix of real estate, infrastructure and private equity. These consist of a handful of direct investments in real assets (not a fund of funds) and so are highly illiquid. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My goal is to get a metric indicating whether the liquidity risk of the private asset portfolio as a whole is deterioriating or improving. What are some  approaches or models that would provide insight into the liquidity risk for private assets? &lt;/p&gt;&#xA;" OwnerUserId="17712" LastEditorUserId="17712" LastEditDate="2017-11-09T15:31:39.237" LastActivityDate="2017-11-09T15:31:39.237" Title="Calculating liquidity risk for private assets?" Tags="&lt;liquidity-risk&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36809" PostTypeId="2" ParentId="36808" CreationDate="2017-11-09T15:06:22.303" Score="1" Body="&lt;p&gt;Excellent work on this has been done by Abbott in the &lt;em&gt;Valuation Handbook&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See:&#xA;Abbott, A. (2009) Valuation Handbook: Measures of Discount for Lack of Marketability and Liquidity. Wiley Finance, Hoboken, 474-507.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2017-11-09T15:06:22.303" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36810" PostTypeId="1" CreationDate="2017-11-09T17:36:36.153" Score="1" ViewCount="160" Body="&lt;p&gt;I'm calculating expected loss on fixed-income using actual default probabilities and risk-free rate as the discount factor. I understand this is not theoretically correct. In absence of risk-neutral probabilities, are there any alternative rates I can use (besides risk-free rate) as the discount factor?  &lt;/p&gt;&#xA;" OwnerUserId="29470" LastActivityDate="2017-12-10T05:31:16.707" Title="Calculating expected loss using actual probabilities" Tags="&lt;fixed-income&gt;&lt;derivatives&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36812" PostTypeId="1" AcceptedAnswerId="36814" CreationDate="2017-11-09T18:33:16.890" Score="2" ViewCount="844" Body="&lt;p&gt;I am writing code to calculate and plot the Exponential Moving Average(&lt;strong&gt;EMA&lt;/strong&gt;) for different chart &lt;strong&gt;timeframes&lt;/strong&gt;(tick/1M/5M/1H etc). I found the formula for calculating EMA:&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;strong&gt;EMA = Price(t) * k + EMA(y) * (1 – k)&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;p&gt;Where,&lt;/p&gt;&#xA;&lt;p&gt;&lt;em&gt;t = today, y = yesterday, N = number of days in EMA, k = 2/(N+1)&lt;/em&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;But I can't figure out how to factor in the timeframe into this formula.&#xA;I know that the EMA plot looks different for different chart timeframes but I am unable to figure out why it is different.&lt;/p&gt;&#xA;&lt;p&gt;To summarize with an example:&lt;/p&gt;&#xA;&lt;p&gt;How would I go about calculating the plot points for the 5-day EMA for a candlestick chart timeframe of 5M, 15M, 1H etc?&lt;/p&gt;&#xA;&lt;p&gt;Thank you in advance.&lt;/p&gt;&#xA;" OwnerUserId="30380" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2017-11-09T20:29:47.620" Title="Calculate Exponential Moving Average for a specific time frame" Tags="&lt;fx&gt;&lt;technical-analysis&gt;&lt;charts&gt;&lt;graphs&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36814" PostTypeId="2" ParentId="36812" CreationDate="2017-11-09T19:55:59.413" Score="2" Body="&lt;p&gt;First, let's assume (hypothetically) you want to compute 5-day EMA from data sampled daily. Then $k_D=2/(N+1)$, here $N=5$, so $k_D=0.333$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now assume you want to use data sampled every 5 minutes. There are 288 5-minutes intervals in a day (I am assuming a market that trades around the clock). There are 288*5 = 1440 intervals in a 5 day period. So $k_{5m} =2/(288*5+1)=0.000693963$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And similarly you can find the appropriate $k$ to use for other sampling intervals. The general formula is $k=\frac{2}{mN+1}$ where m= number of sampling intervals in a day, N= desired decay period for the moving average in days.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-11-09T20:29:47.620" LastActivityDate="2017-11-09T20:29:47.620" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36815" PostTypeId="2" ParentId="36804" CreationDate="2017-11-09T20:55:57.810" Score="8" Body="&lt;p&gt;I don't see anyplace obvious. My quick reading of Garber's original paper is that he greatly drew on work by Ernst Krelage which I've linked below. The Appendix I of Thompson (2007) describes in detail how he constructs his time series. I think you'll have to get your hands dirty, get into the weeds of these papers. This is probably a good thing, as the foundation for quality analysis should be some understanding of where the data comes from and what it is. You could try contacting people that are still alive.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;What do these prices represent?&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Perhaps of interest to this audience is the argument of Earl A. Thompson that the most extravagant prices of the Tulip mania are misinterpreted because they were &lt;em&gt;strike prices&lt;/em&gt; for deeply out of the money call options rather than &lt;em&gt;spot&lt;/em&gt; or &lt;em&gt;futures prices&lt;/em&gt;! Thompson writes, &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;... on February 24, 1637, a large organization of Dutch&#xA;  florists and planters, in a decision that was later ratified by Dutch&#xA;  legislatures and courts, announced that all contracts written after&#xA;  November 30,1636 and before the re-opening of the cash market in the&#xA;  Spring possessed provisions that were not in the original contracts.&#xA;  The new provisions relieved their customers of their original&#xA;  unconditional contractual obligations to buy the future tulips at the&#xA;  specified contract price but demanded that they compensate the&#xA;  planters with a fixed percentage of their contract prices The&#xA;  provisions, in effect, converted the futures prices in the original&#xA;  contracts to exercise prices in options contracts.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Thompson argues that the work of the Dutch legislature essentially turned a futures contract at price $k$ into a call option with a strike price $k$ and payment of $\alpha k$ due by speculators to farmers where $\alpha$ was administratively determined to be a few percent. This predictably sent the market clearing strike price $k$ through the stratosphere.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Economist FreeExchange blog has some coverage of the academic debate &lt;a href=&quot;https://www.economist.com/blogs/freeexchange/2013/10/economic-history&quot; rel=&quot;noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;McClure and Thomas (2017) question Thompson's interpretation of prices as strike prices instead of spot prices. 17th century Dutch history and law are way outside my area, I'm not a tulip expert, and I don't know which of the several sides to take.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;References&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Garber, Peter M., &lt;a href=&quot;http://www.jstor.org/stable/1830454&quot; rel=&quot;noreferrer&quot;&gt;&quot;Tulipmania&quot;&lt;/a&gt;, &lt;em&gt;Journal of Political Economy&lt;/em&gt;, 97(3), 535–557., 1989&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Krelage, Ernst H., &lt;em&gt;&lt;a href=&quot;http://www.dbnl.org/tekst/krel002bloe01_01/krel002bloe01_01.pdf&quot; rel=&quot;noreferrer&quot;&gt;Bloemenspeculatie in Neterland&lt;/a&gt;&lt;/em&gt;. Amterstdam: van Kampen, 1942&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Krelage, Ernst H., &lt;em&gt;Drie eeuwen bloembollenexport&lt;/em&gt;. The Hague: Rijksuitgeverij, 1946&lt;/p&gt;&#xA;&#xA;&lt;p&gt;McClure, JE and DC Thomas, &lt;a href=&quot;https://www.cambridge.org/core/journals/financial-history-review/article/explaining-the-timing-of-tulipmanias-boom-and-bust-historical-context-sequestered-capital-and-market-signals/20BEB345A7BB4BF2E84C07F9077361A1/core-reader&quot; rel=&quot;noreferrer&quot;&gt;&quot;Explaining the timing of tulipmania’s boom and bust: historical context, sequestered capital and market signals,&quot;&lt;/a&gt; &lt;em&gt;Financial History Review&lt;/em&gt;, 2017&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thompson, Earl A., &lt;a href=&quot;http://www.jstor.org/stable/27698044&quot; rel=&quot;noreferrer&quot;&gt;&quot;Tupilmania: Fact or artifact?&quot;&lt;/a&gt; &lt;em&gt;Public Choice&lt;/em&gt;, 2007&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-11-09T21:25:07.120" LastActivityDate="2017-11-09T21:25:07.120" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36816" PostTypeId="1" CreationDate="2017-11-09T21:36:01.323" Score="2" ViewCount="361" Body="&lt;p&gt;I'm trying to price the following floating rate note:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/dUhv7.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/dUhv7.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The price displayed on Bloomberg is 100.103063.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I pass the following to the PRICE() function in Bloomberg, I get 100.1019629.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;=PRICE(Settlement, Maturity, Rate, Yield, Redemption, Frequency, Basis)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Settlement:  11/10/17&#xA;Maturity:  4/30/19&#xA;Rate:  1.258560%&#xA;Yield:  1.188560%&#xA;Redemption:  100&#xA;Frequency:  4&#xA;Basis 2 (Act/360)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to use an Excel function to arrive at that price of 100.103063?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="30271" LastActivityDate="2017-11-09T21:36:01.323" Title="Is it possible to use an Excel function to price a U.S. Treasury Floating Rate Note (FRN)?" Tags="&lt;bond&gt;&lt;floating-rate&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36817" PostTypeId="1" CreationDate="2017-11-09T22:36:15.603" Score="4" ViewCount="375" Body="&lt;p&gt;&lt;strong&gt;Note I have added much more detail to this question&lt;/strong&gt; I have decided to add the detail without altering the original text since a number of those of you offering assistance asked for clarification. Please scroll down to the bolded section below for a more complete problem description.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With relatively few assumptions (stationary excess returns), and arbitrarily  small (but positive) predictive power for an algorithmic trading signal, I can construct a series of strategies with excess returns $S_n$ with arbitrarily large Sharpe Ratio, i.e., &#xA;$$\frac{E[S_n]}{\sigma[S_n]}\rightarrow\infty$$ &#xA;and at the same time,  $Prob\{|S_n|&amp;gt;0\}\rightarrow 0$ (i.e., the probability of trading goes to zero). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This would seem to contradict &lt;strong&gt;Hansen-Jagannathan bounds,&lt;/strong&gt; which show that for all priced assets in the economy with excess returns $R_e$, and pricing kernel $M$, we would necessarily have $$0=E[M R_e]$$ and this gives us the bound:&#xA;$$\frac{|E[R_e]|}{\sigma[R_e]} \le \frac{\sigma[M]}{E[M]}$$&#xA;i.e., the Sharpe ratio of assets in our economy is bounded by the inverse of the Sharpe of the pricing kernel, otherwise known as a &lt;em&gt;good deal bound&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, near arbitrages would exist, although the probability of getting any return at all is negligible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are the consequences of this? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would this then be a &lt;em&gt;pricing anomaly&lt;/em&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;New Material&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Pricing Anomaly for Stationary Returns with non-zero ACF?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We consider a dynamic (e.g., momentum or mean-reversion) strategy on a stationary time-series of excess returns,  $R_t$ which has mean zero and fixed autocorrelation function (ACF) and is driven by Gaussian innovations (i.e., $R_t\sim \mathscr{N}(0,\sigma_R^2)$ and $E[R_tR_s]=C(t-s)$ with $C(k)\ne 0$ for some $k\geq 1$). We have here assumed that &lt;em&gt;at least one&lt;/em&gt; of the elements of the ACF is non-zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have a signal $X_t$ which is unknown but also has no prevision. So for instance at time $t$ we could have it be an exponentially weighted moving average, $X_t=\sum_1^\infty \lambda^k R_{t-k}$ or let it be the forecast from an ARIMA model among other things. Irrespective, the signal $X$ and the returns $R$ are assumed to be jointly normal. (i.e., $X_t\sim \mathscr{N}(0,\sigma_X^2)$ and $E[X_t R_t]=\rho$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;For those who are concerned with notion of prevision: we will assume that at time $t$, $X_t$ is fully known whereas $R_t$ is not seen. Consequently, the moments of the&lt;/em&gt; &lt;strong&gt;conditional&lt;/strong&gt; &lt;em&gt;returns of the strategy&#xA;$E_t[(X_t R_t)^k]=X_t^k E[R_t^k]$ are merely moments of the conditionally normal distribution $R_t$. We are interested in looking at  the&lt;/em&gt; &lt;strong&gt;unconditional&lt;/strong&gt; &lt;em&gt;one-period moments of the  strategy, e.g., $E[(X_t R_t)^k]$ which can be characterised by Isserlis' or Wick's theorem, and have properties like positive skewness and excess kurtosis, as is seen commonly in CTA returns. Moreover the distribution of $X_tR_t$ is fully known.&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I mentioned, we are interested in the unconditional properties of the strategy $X_tR_t$ which are easy to characterise due to the joint normality of $X$ and $R$ in terms of the correlation $\rho$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ SR = \frac{\rho}{\sqrt{\rho^2+1}}$$&#xA;and Skewness is &#xA;$$	\gamma_3=\frac{2\rho(3+\rho^{2})}{(1+\rho^{2})^{\frac{3}{2}}}, $$&#xA;and kurtosis is &#xA;$$	\gamma_4 = \frac{3(3+14\rho^2+3\rho^4)}{(1+\rho^2)^2} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An immediate consequence is that in order to maximize the Sharpe ratio, we should not be concerned with prediction (i.e., minimizing the MSE), but rather should consider maximizing the correlation between our signal and returns. Consequently, OLS is not the optimal framework, (i.e., Yule-Walker equations aren't quite right) and rather  orthogonal  or total least squares (TLS) is more appropriate. TLS is derived from PCA. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moreover it is possible to determine standard errors on Sharpe ratios for dynamic strategies which are a refinement of those of Lo (Lo, Andrew W. &lt;em&gt;The statistics of Sharpe ratios.&lt;/em&gt; Financial analysts journal 58.4 (2002): 36-52), although for all $|\rho|&amp;lt;0.5$ they are reasonably approximated using adjusted stderr calculations of Mertens (E. Mertens, &lt;em&gt;Comments on variance of the IID estimator in Lo,&lt;/em&gt; Research Note, 2002, &lt;a href=&quot;http://www.elmarmertens.com/research/discussion%5C#TOC-Correct-variance-for-estimated-Sharpe-Ratios&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.elmarmertens.com/research/discussion\#TOC-Correct-variance-for-estimated-Sharpe-Ratios&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Nonlinear Transforms&lt;/strong&gt;&#xA;Our study takes us tononlinear transforms of the signal $X$, which means that we will scale each trades by $f(X)$ rather than $X$ itself. In our paper, we consider &lt;em&gt;optimal&lt;/em&gt; transformations (as in those which maximize the Sharpe ratio among all smooth transforms, etc). Among smooth nonlinear transformations $f()$ of our signal $X$, it can be shown that the &lt;em&gt;optimal&lt;/em&gt; (Sharpe ratio maximizing) smooth transformation is given by &#xA;$$f^*(x)= \frac{E[R|X=x]}{E[R^2|X=x]}$$&#xA;and in the case of jointly normal signal and returns, this reduces to&#xA;$$f^*(x)= \frac{\beta X}{\beta^2 X^2 +\sigma^2_{R|X}}$$&#xA;where $R=\beta X+\eta$ with $\eta\sim \mathcal{N}(0,\sigma_{R|X}^2)$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The optimal Sharpe ratio obtained by a smooth transformation can be found as&#xA;$$SR^*=\frac{A}{(1-A)^{1/2}}$$ where&#xA;$$A=E_x\bigl[\frac{E[R|X=x]^2}{E[R^2|X=x]}\bigr].$$&#xA;In the case of jointly Gaussian signal and returns, this can be found in closed form (FWIW).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So much for the background (which is covered in an upcoming paper, Firoozye, N and Koshiyama, A, &lt;em&gt;Optimal Dynamic Strategies on Guassian Returns&lt;/em&gt;, in preparation). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do let me know if you are interested in the paper, since I can post a link here once we've tidied it up a little more.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we  instead restrict our attention to  nonlinear transforms which are simple indicator functions, we let &#xA;$$f_\epsilon(x)=1_{x&amp;gt;\epsilon}-1_{x&amp;lt;-\epsilon}$$ (i.e., we trade based on a threshold and are long or short one unit of the underlying) for $\epsilon&amp;gt;0$ then the Sharpe ratio for strategy $S_\epsilon=f_\epsilon(X)R$ can be calculated as &#xA;$$SR[f(X)R]=\frac{\sqrt{2} \rho M(\lambda)}{\sqrt{1+\rho^2 M(\lambda)(\lambda -2M(\lambda))}}$$&#xA;where $\lambda =\epsilon/\sigma_X$ and $M(\lambda)$ is the &lt;em&gt;inverse Mills ratio&lt;/em&gt; or $$M(\lambda)=\frac{\phi(\lambda)}{1-\Phi(\lambda)}$$&#xA;for $\phi$ and $\Phi$ being the Gaussian PDF and CDF respectively. While not obvious, we can show numerically that this Sharpe ratio becomes unbounded for $\epsilon$ large enough. Note I have not proved that $SR\rightarrow \infty$ but it appears that for $\lambda$ large enough it always becomes unbounded. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Consequently, with relatively few assumptions (stationary excess returns), and arbitrarily  small (but positive) predictive power for an algorithmic trading signal, we can construct a series of strategies with excess returns $S_\epsilon$, with arbitrarily large Sharpe Ratio, i.e., &#xA;$$\frac{E[S_\epsilon]}{\sigma[S_\epsilon]}\rightarrow\infty$$ &#xA;but at the same time, we note that $Prob\{|S_\epsilon|&amp;gt;0\}\rightarrow 0$ (i.e., the probability of trading goes to zero). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This would seem to contradict &lt;strong&gt;Hansen-Jagannathan bounds,&lt;/strong&gt; which show that for all priced assets in the economy with excess returns $R_e$, and pricing kernel $M$, we would necessarily have $$0=E[M R_e]$$ and this gives us the bound via CSB:&#xA;$$\frac{|E[R_e]|}{\sigma[R_e]} \le \frac{\sigma[M]}{E[M]}$$&#xA;i.e., the Sharpe ratio of assets in our economy is bounded by the inverse of the Sharpe of the pricing kernel, otherwise known as a &lt;em&gt;good deal bound&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, in our economy, where excess returns are stationary with a fixed (nonzero) ACF, near arbitrages would exist, although the probability of getting any return at all is negligible.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;What are the consequences of this? &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Would this then be a &lt;em&gt;pricing anomaly&lt;/em&gt;?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="15602" LastEditorUserId="15602" LastEditDate="2017-11-13T20:57:04.177" LastActivityDate="2018-03-13T23:17:03.170" Title="What are the consequences of violating Hansen-Jagannathan bounds?" Tags="&lt;asset-pricing&gt;&lt;algorithmic-trading&gt;" AnswerCount="1" CommentCount="7" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36818" PostTypeId="2" ParentId="30134" CreationDate="2017-11-09T22:56:42.377" Score="1" Body="&lt;p&gt;The TTR RSI code uses EMA by default. Code below:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://github.com/joshuaulrich/TTR/blob/master/R/RSI.R&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/joshuaulrich/TTR/blob/master/R/RSI.R&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Default Welles Wilder EMA&#xA;if(missing(maType)) {&#xA;    maType &amp;lt;- 'EMA'&#xA;    maArgs$wilder &amp;lt;- TRUE&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="30358" LastActivityDate="2017-11-09T22:56:42.377" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36819" PostTypeId="1" CreationDate="2017-11-09T23:35:45.540" Score="3" ViewCount="450" Body="&lt;p&gt;I have asked my question on Mathematics site of Stack Exchange but maybe I will get the answer rather here.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am working on inverse problem - calibration of local volatility (financial application). This inverse problem is ill-posed. The optimization algorithm takes a $ \sigma $ surface as input and solves a PDE to calculate the cost function for each input. After inputs are evolved following genetic algorithm rules.&#xA;There are several authors proposing next approaches to regularize the input surface:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Regularization by means of Tikhonov&lt;/li&gt;&#xA;&lt;li&gt;Smoothing using B-splines&lt;/li&gt;&#xA;&lt;li&gt;Regularization using multiscale approach&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Some authors use on of the first two approaches.&#xA;However, the author of my article uses both of them(&lt;a href=&quot;http://www.proba.jussieu.fr/pageperso/ramacont/papers/evolution.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Main Article&lt;/a&gt;). For example the smoothness norm is introduced as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \|\sigma\|^2 = \sum_{i}^{T} \int_{-A}^{A} dx \int_{0}^{T}|\frac{d\sigma}{dT}|^2 + |\frac{d^2\sigma}{dx^2}|^2 dx$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;or in matrix form:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \|\sigma\|^2 = \theta A \theta^{T} $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \theta $ is a matrix of control points in B-Spline representation and&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \sigma(T_{i},\cdot) = \sum_{m=1}^{M} \theta(i,m)\phi_{m}(\cdot) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ \sigma(t,x) = \frac{T_{i+1}-t}{T_{i+1}-T_{i}}\sigma(T_{i},x)+\frac{t-T_{i}}{T_{i+1}-T_{i}}\sigma(T_{i+1},x) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;are spline and linear interpolations by $x$ and $T$ axis respectively.&#xA;After the authors use Cholesky decomposition to obtain matrix $B$ such that $ A = BB^{T} $. &#xA;Finally they use genetic optimization algorithm to perform random changes of control points: $ \theta_{new} = \theta + B\epsilon_{i} $.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The PDE is solved again with new candidate solutions $ \theta_{new} $ until the stopping criteria is not achieved.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Basically I do not understand the difference between regularization and smoothing.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I do understand:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;B-Splines allow us to obtain a smooth representation of a function of interest&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Regularization is putting some convenient constraint on the function to be optimized (including the constraint of smoothness).&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Isn't it enough to introduce a spline representation of the surface? (won't it be already smooth - as I understand it will). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why do not we apply the random change directly on $ \theta $? kind of $\theta_{new} = \theta+\epsilon_{i}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The role of smoothness norm knowing that B-Spline function is apriori smooth is not clear for me.&#xA;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="30375" LastEditorUserId="20582" LastEditDate="2017-11-10T15:18:49.177" LastActivityDate="2017-11-10T15:18:49.177" Title="Ill-posed problem: Local volatility calibration. Regularization vs Smoothing" Tags="&lt;calibration&gt;&lt;local-volatility&gt;&lt;interpolation&gt;&lt;parabolic-pde&gt;" AnswerCount="0" CommentCount="5" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36820" PostTypeId="2" ParentId="36817" CreationDate="2017-11-10T02:15:29.073" Score="3" Body="&lt;p&gt;The interpretation of the Hansen-Jagannathan bounds is that it's a bound on stochastic discount factors, not a bound on returns. If $\frac{\operatorname{E}[R_e]}{\sigma(R_e)}$ is unbounded above, then so is $\frac{\sigma(M)}{\operatorname{E}[M]}$. &lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Quick derivation of the Hansen Jagannathan bound&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;By the Cauchy-Schwartz inequality:&#xA;$$ |\operatorname{Cov}(R_e, M) | \leq \sigma(R_e) \sigma(M)$$&#xA;If the pricing function for a payoff is linear (i.e. $p(\alpha X + \beta Y) = \alpha p(X) + \beta p(Y)$), then the pricing function can be written as the inner product with a stochastic discount factor $M$. Apply that the inner product of zero cost return $R_e$ with stochastic discount factor $M$ properly gives the price 0  (i.e.  $ \operatorname{E}[R_e M] = 0$)&#xA;$$ |\operatorname{E}[R_e]\operatorname{E}[M] | \leq \sigma(R_e) \sigma(M)$$&#xA;If no arbitrage opportunities exist then $M$ is strictly positive and $\operatorname{E}[M] &amp;gt; 0$. Furthermore if $\sigma(R_e) &amp;gt; 0$ then:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{|\operatorname{E}[R_e] |}{\sigma(R_e)}  \leq \frac{\sigma(M)}{\operatorname{E}[M]}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The assumptions that got here are fairly minimal.&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-11-10T12:55:52.670" LastActivityDate="2017-11-10T12:55:52.670" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36821" PostTypeId="2" ParentId="36730" CreationDate="2017-11-10T03:32:00.470" Score="2" Body="&lt;p&gt;I think it depends on the size of your organization/team, since for smaller organisations you would need to manipulate your variables and input data much more than larger ones, and therefore would need something more nimble like Python. More enterprise level, which generally have predefined data tables and teams/tools, teams would prefer you work with C++ or Java as a programmer, with the rare C#&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I prefer to work Python which, although is definitely not the fastest language, it is the most portable and allows more dynamic manipulation/preprocessing/fetching, and most well-defined mathematical optimisation problems have been implemented with Python APIs. Plus Jupyter Notebooks allows for very visual and iterative coding for analytical work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, you would be hard-pressed to find specific optimisation scenarios and would likely require you to implement that logic. For example, you can execute a number of Mean-Variance optimisations by configuring CVXOPT solvers (&lt;a href=&quot;http://cvxopt.org/userguide/index.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://cvxopt.org/userguide/index.html&lt;/a&gt;) in Python, such as creating a hedged portfolio, but you would not find readily available (and free) 'Selective Hedging' optimisations, pre-implemented outside of GAMS.&lt;/p&gt;&#xA;" OwnerUserId="30262" LastActivityDate="2017-11-10T03:32:00.470" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36822" PostTypeId="2" ParentId="36810" CreationDate="2017-11-10T04:23:53.557" Score="2" Body="&lt;p&gt;Yes, I solve this in a paper I am about to submit.  It is important that you understand what it means to say &quot;actual probabilities.&quot;  Most people use Pearson-Neyman type statistics and they do not and cannot give rise to actual probabilities except in the narrow case of &quot;exact&quot; tests when the null is actually true.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The reason is that Pearson-Neyman methods use minimax distributions.  Minimax distributions are worst-case distributions, but they allow you to guarantee that you will not have false positives more than $\alpha$ percent of the time if your sample size goes to infinity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The result is that any statistics generated are not coherent, with the technical definition of coherence being that a bookie offering to buy risks could not be gamed into taking a sure loss by a crafty actor or set of actors.  In essence, you can gamble on these probabilities and they will be the true probabilities, given the information available.  If you would use Pearson-Neyman probabilities then someone who is crafty would be capable of gaming your solution.  This is very surprising, but also true.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When Pearson and Neyman put together their system of thinking, which rolls into economics, they did not intend it to be used for gambling, but instead to direct behavior.  Should you keep the lot coming off the assembly line or reject the lot based on a sample?  It is a wonderful system when used as intended.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us begin by estimating the default rate and to simplify the argument we will drop things like logistic regression because they nicely add dimensionality, but detract from the simplicity of the explanation.  Note that the only thing that would change in this discussion is the form of the likelihood function and the dimensionality of the prior distribution.  How you would do it would change, but the logic is unchanged.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let us also narrowly define what a default is, acknowledging that a wide definition would merely add dimensionality to the problem.  So, for example, in a real model, you would separately define the probability of a temporary suspension of payments, the probability of a permanent suspension with full recovery of principal, the probability of a permanent suspension with partial recovery and the probability of permanent suspension with no recovery.  For partial recoveries, either of interest or principal, then you also need to model the likely recovery given the type of default happened.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For our narrow discussion, we will pretend we live in an all or nothing world, wherein default results in no form of recovery.  In essence, this is now a Bernoulli trial.  Let us also make this a zero coupon bond so that we do not need to model separate defaults on each coupon.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know I just shrank the problem down tremendously but there is no loss of generality.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You would then use Bayesian decision theory and there is no issue of either risk neutrality, risk aversion, loss aversion or risk loving preferences.  The first issue is to set the prior distribution.  A flat or non-informative prior is not a true credible solution as it would imply that the chance of default for a bond is equally 99% and 0.1%.  This would provide a 50% chance of default as the prior expectation.  That is ridiculous.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two ways to set a prior.  The first would be to observe actual historical rates.  Since we are dropping logistic regression we are assuming true independence of defaults rather than dependence on accounting values or the state of the economy.  In this pretend world we can get away with that.  Let us imagine that you found a large data set of one thousand observations and in that set, there was one default.  That would create a prior probability for $\theta$ where $\theta$ is the probability of default equal to $999(1-\theta)^{998}$ by assuming the prior is a beta distribution.  This may not be true, but for our purposes is very convenient mathematically.  If you have a better way to construct the prior, then don't do this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To understand, this density is not the probability of default, but rather the probability $\theta=k,\forall{k}\in(0,1),$ where $\theta$ is the true chance of default.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A second solution could be to work backward from rates using relationships such as $i=r^*+p_h+p_m+p_d,$ where you would factor out inflation, maturity and the Fisher effect from bond rates.  There are other solutions too.  Let us stick with the simple one above though.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now lets assume you buy a portfolio of 100 bonds and none of them default.  We are also going to assume you are not collecting outside data though the process would be the same as no one cares where the data came from.  Random sampling is not required here.  The binomial density is $(1-\theta)^{100}$.  The beta distribution above and the binomial likelihood would be multiplied together and normalized to a density.  The resulting density of $\Pr(\theta|data)=\frac{1}{1099}(1-\theta)^{1098}$ is the posterior density of $\theta.$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are not interested in the location of the parameter, but rather, the probability there will be zero defaults, one default, two defaults and so forth.  To do this, you would integrate out any unknowns leaving only the knowns, which are the data and the prior knowledge.  This is often expressed as $\Pr(\tilde{x}|X)$, where $X$ is the data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To solve this prediction you integrate out the uncertainty as follows:&#xA;$\Pr(\tilde{x}=k|X)=\int_\theta\Pr(\tilde{x}|\theta)\Pr(\theta|X)\mathrm{d}\theta$.  In this specific case, the solution is analytic and well known.  It is called the beta-binomial distribution.  If $\alpha$ are defaults, in this case, 1, and $\beta$ is surviving bonds, in this case, 1099, and $n$ is the future number of bonds purchased and $k$ is possible default levels, then you can construct a discrete mass function for each level and take the expectation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The analytic solution is $\Pr(default=k|\alpha, \beta) = \frac{\Gamma(n+1)}{\Gamma(k+1)\Gamma(n-k+1)} \frac{\Gamma(k+\alpha)\Gamma(n-k+\beta)}{\Gamma(n+\alpha+\beta)} &#xA;                         \frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)},$ where $\Gamma$ is the gamma function for the mass function and then the expectation would be trivial to take as the chance of two defaults is very small.  You would then discount at the institution's marginal cost of funds, which is the deposit rate in the case of a bank.  There need only be a subjective cost of funds.  You end up with $$\frac{E(k)}{1+i}$$ where $i$ is the marginal cost of funds for the actor.  This is the present value of your expected losses, though not expressed as a rate.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The above outcome has a known solution in the literature.  It is $$\frac{\frac{n\alpha}{\alpha+\beta}}{1+i}=100/1100/(1+i)\approx{.09}/(1+i).$$  So in one hundred future bonds you would expect to lose nine hundreths of one bond.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, if I were doing it, I would ignore everything I just told you as it would make computation very costly unless I wanted to write a do loop and calculate the factorials in logs and invert the process.  For a large enough sample size, the normal approximation would be better to work with in theoretical work.  If I were serious about the computation then I would use Bayesian logistic regression because it does not have the assumption violations so well documented in Nwogugu at:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Nwogugu, Michael; Decision-making, risk and corporate governance: A critique of methodological issues in bankruptcy/recovery prediction models; Applied Mathematics and Computation; 2007;(185); pp. 178-196.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Still, you would take the expectation of the Bayesian predictive distribution divided by the subjective cost of funds.  It would just now be very complex due to the true dimensionality of the problem and you would almost certainly be forced to use a Metropolis-Hastings algorithm to solve the problem.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you are not risk neutral, then you would not use quadratic loss as it assigns equal quadratically growing costs to the risk of mislocating the point estimate of $E(k)$ downward as upward.  If you were loss averse then you would underweight underestimates of $k$ and overweight overestimates of $k$.  This is why I said it may be easier to do with the normal distribution.  It may be easier to solve as a traditional risk aversion problem with something like CARA or CRRA.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is a good book on both Pearson-Neyman and Bayesian decision theory at:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://rads.stackoverflow.com/amzn/click/047149657X&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.amazon.com/Decision-Theory-Principles-Giovanni-Parmigiani/dp/047149657X/ref=sr_1_1?ie=UTF8&amp;amp;qid=1510287077&amp;amp;sr=8-1&amp;amp;keywords=parmigiani+decision+theory&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I do apologize that this is so long, but you would likely ask the question in a different manner if you were accustomed to thinking in terms of decision theory.  Also, you wanted to know about the actual default probabilities and not abstracted ones if the parameters were truly known at a risk-free rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the real world, I used Bayesian methods to test 78 models of bankruptcy and found two that worked, although all are statistically significant.  All significance tells you is that the results are unlikely to be due to chance if the null is true, it does nothing to tell you how useful it is.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastEditorUserId="25459" LastEditDate="2017-11-10T04:48:22.223" LastActivityDate="2017-11-10T04:48:22.223" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36823" PostTypeId="1" CreationDate="2017-11-10T10:35:02.837" Score="1" ViewCount="51" Body="&lt;p&gt;Assume I have a series of future incomes in a single foreign currency.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do I calculate the total VaR for this forex risk using the volatility method?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My first thought was that I could simply add up the VaR for each future income, i.e. for receiving $V_1, V_2, ..., V_n$ at times $T_1, T_2, ..., T_n$ the 95% VaR would be:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\operatorname{VaR}_{0.95} = -1.65\sum_i{\sigma V_i \sqrt{T_i}}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but is this correct?&lt;/p&gt;&#xA;" OwnerUserId="19168" LastActivityDate="2017-11-10T10:35:02.837" Title="VaR of future foreign currency income stream" Tags="&lt;volatility&gt;&lt;fx&gt;&lt;var&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36826" PostTypeId="1" AcceptedAnswerId="36827" CreationDate="2017-11-10T14:51:54.600" Score="2" ViewCount="403" Body="&lt;p&gt;I am looking for the TOIS, TONAR, AONIA in Quantlib for discounting. I only could find the EOINA, FEDFUNDS, SONIA etc.Do I miss something? In case they don't exist how can I use the corresponding rate helpers in quantlib (python).&lt;/p&gt;&#xA;" OwnerUserId="29660" LastActivityDate="2017-11-13T09:07:17.800" Title="TOIS (CHF), TONAR (JPY), AONIA(AUD) in Quantlib" Tags="&lt;python&gt;&lt;quantlib&gt;&lt;ois&gt;&lt;overnight-index&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36827" PostTypeId="2" ParentId="36826" CreationDate="2017-11-10T16:37:52.673" Score="2" Body="&lt;p&gt;Not all overnight indexes were given a specific class.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As a workaround, you can create an instance of the &lt;code&gt;OvernightIndex&lt;/code&gt; class and pass it the relevant parameters (fixing calendar, day counter etc.). E.g., if there wasn't an &lt;code&gt;EONIA&lt;/code&gt; class already, you could build an instance of it as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;index = OvernightIndex(&quot;EONIA&quot;, 0, EURCurrency(),&#xA;                       TARGET(), Actual360(), curve_handle)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where the parameters are a name for the index, the number of settlement days, the currency, the fixing calendar, the day counter, and a handle to the curve used to forecast the fixings.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you find yourself doing this often, and if you can write some C++, you might also consider writing a specific class (like EONIA and the like) and possibly contribute it to QuantLib. You can compare the code above with the contents of &lt;code&gt;ql/indexes/ibor/eonia.hpp&lt;/code&gt; and &lt;code&gt;ql/indexes/ibor/eonia.cpp&lt;/code&gt; to see how that can be done.&lt;/p&gt;&#xA;" OwnerUserId="308" LastEditorUserId="308" LastEditDate="2017-11-13T09:07:17.800" LastActivityDate="2017-11-13T09:07:17.800" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36828" PostTypeId="1" CreationDate="2017-11-10T16:55:04.173" Score="1" ViewCount="194" Body="&lt;ul&gt;&#xA;&lt;li&gt;There are a number of short rate models that give $r(t)$.&lt;/li&gt;&#xA;&lt;li&gt;How can those be used to construct the whole of the yield curve $y(t,T)$ (where $y(t, 0) = r(t)$)?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="11655" LastActivityDate="2017-11-10T16:55:04.173" Title="How are short rate models used to construct the whole of the yield curve?" Tags="&lt;fixed-income&gt;&lt;yield-curve&gt;&lt;short-rate&gt;" AnswerCount="0" CommentCount="2" FavoriteCount="1" ClosedDate="2017-11-17T13:50:22.160" ContentLicense="CC BY-SA 3.0" />
  <row Id="36829" PostTypeId="2" ParentId="34558" CreationDate="2017-11-10T19:18:04.783" Score="0" Body="&lt;p&gt;The answer to your question is in Lorenzo Bergomi's book &quot;Stochastic Volatility Modeling&quot;, section 2.10.&lt;/p&gt;&#xA;" OwnerUserId="30395" LastActivityDate="2017-11-10T19:18:04.783" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36830" PostTypeId="1" AcceptedAnswerId="36873" CreationDate="2017-11-10T19:22:00.320" Score="0" ViewCount="1448" Body="&lt;p&gt;I want to use QuantLib Python to price a swap at 2 different evaluation dates during the life time of the swap. The following is what I've tried so far:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;from QuantLib import *&#xA;&#xA;# global data&#xA;calendar = TARGET()&#xA;todaysDate = Date(6,November,2001);&#xA;Settings.instance().evaluationDate = todaysDate&#xA;settlementDate = Date(8,November,2001);&#xA;&#xA;# market quotes&#xA;deposits = { (1,Weeks): 0.0382,&#xA;             (1,Months): 0.0372,&#xA;             (3,Months): 0.0363,&#xA;             (6,Months): 0.0353,&#xA;             (9,Months): 0.0348,&#xA;             (1,Years): 0.0345 }&#xA;&#xA;swaps = { (2,Years): 0.037125,&#xA;          (3,Years): 0.0398,&#xA;          (5,Years): 0.0443,&#xA;          (10,Years): 0.05165,&#xA;          (15,Years): 0.055175 }&#xA;&#xA;# convert them to Quote objects&#xA;for n,unit in deposits.keys():&#xA;    deposits[(n,unit)] = SimpleQuote(deposits[(n,unit)])&#xA;for n,unit in swaps.keys():&#xA;    swaps[(n,unit)] = SimpleQuote(swaps[(n,unit)])&#xA;&#xA;# build rate helpers&#xA;&#xA;dayCounter = Actual360()&#xA;settlementDays = 2&#xA;depositHelpers = [ DepositRateHelper(QuoteHandle(deposits[(n,unit)]),&#xA;                                     Period(n,unit), settlementDays,&#xA;                                     calendar, ModifiedFollowing,&#xA;                                     False, dayCounter)&#xA;                   for n, unit in [(1,Weeks),(1,Months),(3,Months),&#xA;                                   (6,Months),(9,Months),(1,Years)] ]&#xA;&#xA;settlementDays = 2&#xA;fixedLegFrequency = Annual&#xA;fixedLegTenor = Period(1,Years)&#xA;fixedLegAdjustment = Unadjusted&#xA;fixedLegDayCounter = Thirty360()&#xA;floatingLegFrequency = Semiannual&#xA;floatingLegTenor = Period(6,Months)&#xA;floatingLegAdjustment = ModifiedFollowing&#xA;swapHelpers = [ SwapRateHelper(QuoteHandle(swaps[(n,unit)]),&#xA;                               Period(n,unit), calendar,&#xA;                               fixedLegFrequency, fixedLegAdjustment,&#xA;                               fixedLegDayCounter, Euribor6M())&#xA;                for n, unit in swaps.keys() ]&#xA;&#xA;# term structure handles&#xA;&#xA;discountTermStructure = RelinkableYieldTermStructureHandle()&#xA;forecastTermStructure = RelinkableYieldTermStructureHandle()&#xA;&#xA;# term-structure construction&#xA;&#xA;helpers = depositHelpers + swapHelpers&#xA;depoFraSwapCurve = PiecewiseFlatForward(settlementDate, helpers, Actual360())&#xA;&#xA;# swaps to be priced&#xA;&#xA;swapEngine = DiscountingSwapEngine(discountTermStructure)&#xA;&#xA;nominal = 1000000&#xA;length = 5&#xA;maturity = calendar.advance(settlementDate,length,Years)&#xA;payFixed = True&#xA;&#xA;fixedLegFrequency = Annual&#xA;fixedLegAdjustment = Unadjusted&#xA;fixedLegDayCounter = Thirty360()&#xA;fixedRate = 0.04&#xA;&#xA;floatingLegFrequency = Semiannual&#xA;spread = 0.0&#xA;fixingDays = 2&#xA;index = Euribor6M(forecastTermStructure)&#xA;floatingLegAdjustment = ModifiedFollowing&#xA;floatingLegDayCounter = index.dayCounter()&#xA;&#xA;fixedSchedule = Schedule(settlementDate, maturity,&#xA;                         fixedLegTenor, calendar,&#xA;                         fixedLegAdjustment, fixedLegAdjustment,&#xA;                         DateGeneration.Forward, False)&#xA;floatingSchedule = Schedule(settlementDate, maturity,&#xA;                            floatingLegTenor, calendar,&#xA;                            floatingLegAdjustment, floatingLegAdjustment,&#xA;                            DateGeneration.Forward, False)&#xA;&#xA;spot = VanillaSwap(VanillaSwap.Payer, nominal,&#xA;                   fixedSchedule, fixedRate, fixedLegDayCounter,&#xA;                   floatingSchedule, index, spread,&#xA;                   floatingLegDayCounter)&#xA;spot.setPricingEngine(swapEngine)&#xA;&#xA;# price on two different evaluation dates&#xA;&#xA;discountTermStructure.linkTo(depoFraSwapCurve)&#xA;forecastTermStructure.linkTo(depoFraSwapCurve)&#xA;&#xA;print(Settings.instance().evaluationDate)&#xA;print(spot.NPV())&#xA;print&#xA;&#xA;Settings.instance().evaluationDate = Date(13,November,2001)&#xA;settlementDate = Date(15,November,2001)&#xA;depoFraSwapCurve = PiecewiseFlatForward(settlementDate, helpers, Actual360())&#xA;&#xA;discountTermStructure.linkTo(depoFraSwapCurve)&#xA;forecastTermStructure.linkTo(depoFraSwapCurve)&#xA;&#xA;print(Settings.instance().evaluationDate)&#xA;print(spot.NPV())&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get the following error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;November 6th, 2001&#xA;19065.5382172&#xA;&#xA;November 13th, 2001&#xA;&#xA;---------------------------------------------------------------------------&#xA;RuntimeError                              Traceback (most recent call last)&#xA;&amp;lt;ipython-input-36-789cc81616ab&amp;gt; in &amp;lt;module&amp;gt;()&#xA;    145 forecastTermStructure.linkTo(depoFraSwapCurve)&#xA;    146 &#xA;--&amp;gt; 147 print(spot.NPV())&#xA;    148 &#xA;&#xA;C:\ProgramData\Anaconda2\lib\site-packages\QuantLib\QuantLib.pyc in NPV(self)&#xA;   9157 &#xA;   9158     def NPV(self):&#xA;-&amp;gt; 9159         return _QuantLib.Instrument_NPV(self)&#xA;   9160 &#xA;   9161     def errorEstimate(self):&#xA;&#xA;RuntimeError: 2nd leg: Missing Euribor6M Actual/360 fixing for November 6th, 2001&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any idea what I need to do to resolve this error?&lt;/p&gt;&#xA;" OwnerUserId="30396" LastActivityDate="2017-11-13T12:05:01.003" Title="QuantLib Python price same swap on different evaluation dates" Tags="&lt;python&gt;&lt;quantlib&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="36831" PostTypeId="2" ParentId="115" CreationDate="2017-11-10T21:05:07.220" Score="5" Body="&lt;p&gt;I asked this question 6 years ago, and in the meantime I came across this little volume:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://eu.wiley.com/WileyCDA/WileyTitle/productCd-0470851562.html&quot; rel=&quot;noreferrer&quot;&gt;Lévy Processes in Finance: Pricing Financial Derivatives&lt;/a&gt; by Wim Schoutens (2003).&lt;/p&gt;&#xA;" OwnerUserId="156" LastActivityDate="2017-11-10T21:05:07.220" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36832" PostTypeId="2" ParentId="115" CreationDate="2017-11-10T21:37:10.240" Score="2" Body="&lt;p&gt;Read:  Harris, D.E. (2017) The Distribution of Returns. Journal&#xA;of Mathematical Finance , 7, 769-804.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The paper derives all distributions that should be present.  In practice, these are mixture distributions.  The use of stable distributions came about when it was concluded that it probably was not a Cauchy distribution.  Unfortunately, the methodology used to do the testing was seriously flawed in most cases.   In a separate paper, it has been shown that no admissible non-Bayesian statistic exists that is also computable with regard to the bulk of all finance problems.  There are deep issues in probability theory that makes such questions difficult to solve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The simplified version of the issue goes like this.  The distributions involved have two distinct issues.  The first is that they lack sufficient statistics, except order statistics of course.  As a result, any point statistic must lose information except Bayesian statistics where a cost function has been applied to a predictive distribution.  So if you use any form of Frequentist solution, then you must lose information in order to create the measurement.  This is not a problem for Bayesian methods as they always use all the information that exists in the sample and the Bayesian likelihood is always minimally sufficient.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The second issue has to do with truncation.  For the distributions involved, if there were no truncation, then the median and the mode would be collocated and either could be thought of as the center of location.  There is no mean, of course.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This allows the use of order statistics, it may still be the case they are not admissible for other reasons, but order statistics do not lose information other than the information loss that comes from converting things into ranks in the first place.  The median is the mean rank and so you can discuss minimum variance unbiased estimators with regard to rank statistics even though the underlying data lacks a variance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The difficulty comes from truncation.  The difference between the median and the mode for US stocks from 1925-2016 is two percent per annum and the resulting difference in measurement of risk results in a four percent understatement of actual risk by using a non-Bayesian method.  This can be confirmed by changing the problem from an analytic problem to a geometry problem.  This bias is preserved under the transformation to logs and so log measures overstate return and understate risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The mode remains the center of location, but the median is now shifted as part of the left tail is missing.  This is not problematic for Bayesian methods but catastrophic for Likelihoodist and Frequentist methods.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To heap insult onto injury, distribution tests are subject to the Jeffreys-Lindley paradox.  Distribution tests are sharp null hypotheses.  The CRSP universe has around sixty million end-of-day trades.  The paradox is a theorem that states that all true sharp null hypotheses will be falsified once the sample size is large enough.  Most non-Bayesian distribution tests must falsify true nulls if the sample size is large.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2017-11-10T21:37:10.240" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36834" PostTypeId="1" CreationDate="2017-11-11T00:42:48.117" Score="1" ViewCount="3011" Body="&lt;p&gt;I have weekly series on financial risk index data as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;DATE          NFCIRISK&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1/8/1971      0.58 &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1/15/1971     0.61&lt;/p&gt;&#xA;&#xA;&lt;p&gt;......through&lt;/p&gt;&#xA;&#xA;&lt;p&gt;10/6/2017   -0.88&lt;/p&gt;&#xA;&#xA;&lt;p&gt;10/13/2017  -0.89&lt;/p&gt;&#xA;&#xA;&lt;p&gt;10/20/2017  -0.89&lt;/p&gt;&#xA;&#xA;&lt;p&gt;10/27/2017  -0.89&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I want to convert them into a monthly(average of four weeks) series and I tried to use following in r but didnt work.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;library(xlsx)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;library(xts)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;month.end &amp;lt;- endpoints(MyData, on = &quot;months&quot;)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;monthly &amp;lt;- period.apply(MyData, INDEX = month.end, FUN = mean)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;head(monthly)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could anyone please help me if any other ways I can try either in r or in Julia. Thanks and appreciating your response. &lt;/p&gt;&#xA;" OwnerUserId="30400" LastEditorUserId="30400" LastEditDate="2017-11-11T00:47:52.803" LastActivityDate="2017-11-11T21:42:33.810" Title="How to convert weekly data to monthly in r (or in Julia)" Tags="&lt;time-series&gt;&lt;finance&gt;&lt;statistical-finance&gt;&lt;data-mining&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36835" PostTypeId="2" ParentId="36834" CreationDate="2017-11-11T06:44:58.427" Score="1" Body="&lt;p&gt;You can try following :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Use &quot;Quandl&quot; package in R. Which allows you to download data for Monthly, Quarterly, Weekly, Daily directly using single argument. &#xA;It also provides the Index data. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this will help you!! &lt;/p&gt;&#xA;" OwnerUserId="30354" LastActivityDate="2017-11-11T06:44:58.427" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36836" PostTypeId="2" ParentId="36834" CreationDate="2017-11-11T07:42:24.467" Score="1" Body="&lt;p&gt;See the &lt;a href=&quot;https://www.rdocumentation.org/packages/rts/versions/1.0-38/topics/endpoints&quot; rel=&quot;nofollow noreferrer&quot;&gt;endpoints&lt;/a&gt; function in R.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;It returns a numeric vector corresponding to the last observation in each period specified by on, with a zero added to the beginning of the vector, and the index of the last raster in x at the end.&lt;/p&gt;&#xA;&lt;p&gt;Valid values for the argument on include: “us” (microseconds), “microseconds”, “ms” (milliseconds), “milliseconds”, “secs” (seconds), “seconds”, “mins” (minutes), “minutes”, “hours”, “days”, “weeks”, “months”, “quarters”, and “years”.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="25326" LastEditorUserId="-1" LastEditDate="2020-06-17T08:33:06.707" LastActivityDate="2017-11-11T07:42:24.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36837" PostTypeId="1" CreationDate="2017-11-11T11:05:52.440" Score="1" ViewCount="148" Body="&lt;p&gt;I hope you can help me. I want to use the bid-ask spread of prices for 10yr treasury notes as a proxy for bond market liquidity. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I got monthly aggregated bond price data (for yrs 1999-2013) from CRSP's Treasuries data base. However, when I calculate the bid-ask spread for the individual 10 yr notes, I see bid-ask spreads for many notes over several years almost constant (0,03125) although there are significant changes in both, bid and ask prices. Only toward the end of my time series (2009-2013) I see some variability in bid-ask spreads. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone please explain to me why I observe almost constant bid-ask spreads?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I uploaded the file on google drive, here is the link: &lt;a href=&quot;https://drive.google.com/open?id=19cn4tUr89bToodORRi5NIH7L-mni0TRN&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://drive.google.com/open?id=19cn4tUr89bToodORRi5NIH7L-mni0TRN&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you very much in advance, Nik&lt;/p&gt;&#xA;" OwnerUserId="30405" LastActivityDate="2017-11-11T11:05:52.440" Title="Bond liquidity: why do I observe constant bid-ask spreads?" Tags="&lt;bond&gt;&lt;spread&gt;&lt;liquidity&gt;&lt;bid&gt;&lt;ask&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36838" PostTypeId="2" ParentId="24312" CreationDate="2017-11-11T11:26:53.380" Score="2" Body="&lt;p&gt;When downloading your data set you can also select a variable called share code. All common stocks trade with share code &quot;10&quot; or &quot;11&quot;. After loading the set simply delete all shares with a code other than &quot;10&quot; or &quot;11&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Companies may go bankrupt or get acquired so that is why only 70% trade until the end of the year I guess...&lt;/p&gt;&#xA;" OwnerUserId="30405" LastActivityDate="2017-11-11T11:26:53.380" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36840" PostTypeId="1" CreationDate="2017-11-11T14:39:33.643" Score="3" ViewCount="228" Body="&lt;p&gt;This problem was presented in an interview, and I know I got it roughly correct. But I am still not entirely understanding the early exercise component of it:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Say I am advertising a game where I would flip a coin up to 100 times. The payoff at any time $t$ is $P_t=\frac{\# of heads}{\# of flips}$. If I allow you to walk away with your earnings at any time, how much should I charge for the game?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand logically how without early exercise, the option should be priced as $\frac{1}{2}$, since for any large number of tosses the Payout should be $P_t=\frac{\frac{1}{2}*\infty}{\infty}=\frac{1}{2}$ from the law of large numbers, expected value etc etc. The interviewer then proceeded to show me how a binomial tree could be used to price the option:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/jrQfX.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/jrQfX.png&quot; alt=&quot;Binomial Tree&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The maximum upside for the top half of the tree is 1, with the probability of that occurring at $\frac{1}{2}$ and the maximum upside of the lower half of the tree being in the above tree $\frac{1}{2}$. Extending this out to 100 flips results in payout 1 in the top half again, but the bottom half could potentially result in $\frac{99}{100}$ if you flipped tails first and then flipped heads 100 times. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know there are only one or two steps left to finding the minimum price that me, as the game maker, should charge to play this game. I know it should be higher than $\frac{1}{2}$, because I am giving the early exercise option and this will only give me more downside while giving the user more upside. The minimum cost means I should be pricing it on the potential upsides of the two branches. Can somebody bring this home for me? Would help me understand for the next time a question like this is asked.&lt;/p&gt;&#xA;" OwnerUserId="30406" LastActivityDate="2019-05-03T23:14:16.907" Title="Early Exercise Options and Coin Flipping" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;game&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36841" PostTypeId="1" CreationDate="2017-11-11T16:38:56.317" Score="3" ViewCount="240" Body="&lt;p&gt;I understand how to calculate the parametric VaR of a stock and an option separately. But I don't understand how one can calculate the VaR of a portfolio of a stock and an option on that stock using the parametric method. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Would the method for multiple stocks be correct here? i.e.,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$ VaR(portfolio) = -\sqrt{w^{T}\Sigma w} \times z \times V, $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $w$ = weights, $\Sigma$ = covariance matrix for stock and option, $z$ = $2.327$ for $1\%$ $VaR$ and $V$ = portfolio value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This doesn't seem correct to me as the delta of the option is not involved...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, how do you extend this to have multiple stock-option pairs in the same portfolio?&lt;/p&gt;&#xA;" OwnerUserId="30407" LastActivityDate="2017-11-11T16:38:56.317" Title="Parametric VaR of a portfolio of a stock and an option on that stock" Tags="&lt;options&gt;&lt;risk&gt;&lt;portfolio&gt;&lt;var&gt;&lt;covariance&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36842" PostTypeId="2" ParentId="36347" CreationDate="2017-11-11T17:00:01.933" Score="2" Body="&lt;p&gt;I don't think it is making sense to choose the CAPM approach, since in the FX-Market there is no appreciation and the market average of the returns of every currency should be 0.&lt;/p&gt;&#xA;" OwnerUserId="30321" LastEditorUserId="16160" LastEditDate="2017-11-11T22:46:34.657" LastActivityDate="2017-11-11T22:46:34.657" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36844" PostTypeId="1" CreationDate="2017-11-11T19:22:42.173" Score="6" ViewCount="7344" Body="&lt;p&gt;Following pictures are the &lt;code&gt;Principal Component Analysis&lt;/code&gt; for the yield curve change from&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.coursera.org/learn/interest-rate-models/lecture/ZHMM6/principal-component-analysis&quot; rel=&quot;noreferrer&quot;&gt;https://www.coursera.org/learn/interest-rate-models/lecture/ZHMM6/principal-component-analysis&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why is the first loading(factor) exactly the level; the second loading exactly the slope; etc?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And we can see John Hull's book &lt;code&gt;Options, Futures and Other Derivatives 9th&lt;/code&gt; &lt;code&gt;page 514.&lt;/code&gt; It's totally converse to the above statement. It knows the &lt;code&gt;loading&lt;/code&gt; of each factor and maturity first, then use the variance of &lt;code&gt;factor score&lt;/code&gt; to determine which factor is most important.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In John Hull's version actually I don't know how to directly observe the loading of a factor for a specific  yield, e.g the &lt;code&gt;slope factor of 2-year yield&lt;/code&gt;?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I really confuse here, which one is right in the real practice?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/hN86t.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/hN86t.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/vuAcH.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/vuAcH.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;John Hull's book &lt;code&gt;Options, Futures and Other Derivatives 9th&lt;/code&gt; &lt;code&gt;page 514:&lt;/code&gt;&#xA;&lt;a href=&quot;https://i.stack.imgur.com/MtQCH.png&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/MtQCH.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="26165" LastEditorUserId="26165" LastEditDate="2017-11-13T12:53:03.327" LastActivityDate="2017-11-13T12:53:03.327" Title="Principal Component Analysis of yield curve change" Tags="&lt;statistics&gt;&lt;yield-curve&gt;&lt;principal-components&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="8" ContentLicense="CC BY-SA 3.0" />
  <row Id="36845" PostTypeId="2" ParentId="341" CreationDate="2017-11-11T19:31:07.590" Score="2" Body="&lt;p&gt;There are many good answers already, but I give this one just to provide some additional intuition:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The simplest &lt;strong&gt;random walk&lt;/strong&gt; is tossing a coin several times: heads means one up, tails means one down. Because of the symmetry of this process the sum of those tosses adds up to zero, on average: it is a &lt;strong&gt;martingale&lt;/strong&gt;!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Intuitively a &lt;strong&gt;martingale&lt;/strong&gt; means that, on average, the &lt;strong&gt;expected value&lt;/strong&gt; of your cumulative &lt;strong&gt;stochastic process&lt;/strong&gt; stays the same, no matter how many coin tosses in the future.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you add a &lt;strong&gt;drift&lt;/strong&gt; to your random walk by e.g. saying that the up-move is not one but two it is no longer a martingale because, on average, the expected value will go higher and higher.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the moment I see &lt;strong&gt;no direct connection with the Efficient Market Hypothesis (EMH)&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2017-11-11T19:31:07.590" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36847" PostTypeId="2" ParentId="36834" CreationDate="2017-11-11T21:42:33.810" Score="0" Body="&lt;p&gt;Such computations can be handled by &lt;code&gt;tapply&lt;/code&gt;, which is in R base.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suppose your data is stored in a dataframe &lt;code&gt;MyData&lt;/code&gt;, first column the timestamps, second column the values:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;MyData &amp;lt;- read.table(text=&#xA;&quot;DATE NFCIRISK&#xA;01/8/1971 0.58&#xA;01/15/1971 0.61&#xA;10/6/2017 -0.88&#xA;10/13/2017 -0.89&#xA;10/20/2017 -0.89&#xA;10/27/2017 -0.89&quot;,&#xA;sep = &quot; &quot;, stringsAsFactors = FALSE, header = TRUE)&#xA;&#xA;MyData[[1]] &amp;lt;- as.Date(MyData[[1]], &quot;%m/%d/%Y&quot;)&#xA;MyData&#xA;&#xA;##         DATE NFCIRISK&#xA;## 1 1971-01-08     0.58&#xA;## 2 1971-01-15     0.61&#xA;## 3 2017-10-06    -0.88&#xA;## 4 2017-10-13    -0.89&#xA;## 5 2017-10-20    -0.89&#xA;## 6 2017-10-27    -0.89&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Then you can simply write:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;tapply(MyData[[2]], format(MyData[[1]], &quot;%Y-%m&quot;), mean)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and get&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;1971-01  2017-10 &#xA; 0.5950  -0.8875 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6857" LastActivityDate="2017-11-11T21:42:33.810" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36850" PostTypeId="2" ParentId="8749" CreationDate="2017-11-12T11:34:44.803" Score="2" Body="&lt;p&gt;The derivation of $$ \sigma_E E_0 = N(d_1) \sigma_V V_0 $$ is actually in &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/j.1540-6261.1974.tb03058.x/abstract&quot; rel=&quot;nofollow noreferrer&quot;&gt;Merton (1974)&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/0Iazq.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/0Iazq.png&quot; alt=&quot;Merton (1974)&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/dziGB.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/dziGB.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Equation 3.b is what you are looking for. The only difference is the notation. You can see F as E, and everything else is the same. &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Reference:&lt;/p&gt;&#xA;  &#xA;  &lt;p&gt;Merton, R.C., 1974. On the Pricing of Corporate Debt: The Risk&#xA;  Structure of Interest Rates. The Journal of Finance, 29(2), p.449.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="28116" LastActivityDate="2017-11-12T11:34:44.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36851" PostTypeId="2" ParentId="36844" CreationDate="2017-11-12T13:49:21.827" Score="5" Body="&lt;p&gt;To put things in context, if $\{{\bf X}_i\}_{i=1}^n$ is a set of variables and $\{{\bf Y}_j\}_{j=1}^n$ denote the principal components of ${\bf X}$ then&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;{\bf X}_j = \mu_j + \sum_{k=1}^n{\bf Y}_k A_{jk} \tag{1}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\mu = \mathbb{E}[{\bf X}]$ and $A$ is the diagonal representation of the correlation matrix $\Sigma = \mathbb{C}{\rm ov}[{\bf X}]$. The whole point of PCA analysis is to truncate Eq. (1) to a given number of terms $k_\max \leq n$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;{\bf X}_j \approx \mu_j + \sum_{k=1}^{k_\max}{\bf Y}_k A_{jk} \tag{2}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The smaller values of $k_\max$ contain most of the information required to re-construct the set of observations ${\bf X}$. You can roughly think of this as a Taylor expansion&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;{\bf X}_j \approx \mu_j + {\bf Y}_1 \color{red}{A_{j1}} + {\bf Y}_2 \color{blue}{A_{j2}} + {\bf Y}_3 \color{orange}{A_{j3}} + \cdots \tag{3}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where the coefficients of the expansion are $\color{red}{A_{j1}}$, $\color{blue}{A_{j2}}$, $\color{orange}{A_{j3}}$, $\cdots$. In this picture this coefficients would correspond to $0$-th, $1-$st, $2-$nd, $\cdots$ derivatives, so that you could call them&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;$a_1 = \{\color{red}{A_{j1}}\}_j$ level&lt;/li&gt;&#xA;&lt;li&gt;$a_2 = \{\color{blue}{A_{j2}}\}_j$ slope&lt;/li&gt;&#xA;&lt;li&gt;$a_3 = \{\color{orange}{A_{j3}}\}_j$ curvature&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Here's an example for the Swiss market&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/YwsTd.jpg&quot; rel=&quot;noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/YwsTd.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="29731" LastActivityDate="2017-11-12T13:49:21.827" CommentCount="12" ContentLicense="CC BY-SA 3.0" />
  <row Id="36852" PostTypeId="1" AcceptedAnswerId="36854" CreationDate="2017-11-12T15:35:17.807" Score="0" ViewCount="501" Body="&lt;p&gt;I always thought equity options where quoted with implied volatility, the price being given by the Black-Scholes price of the option with volatility equal to the implied volatlity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But apparently there is another way to quote option : with reference implied vol (or reference price) and delta for an underlying at a price near the spot price. I also heard about &quot;target price&quot; in this context.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I cannot find any reference about this, so more more information or an explanation would be great&lt;/p&gt;&#xA;" OwnerUserId="28718" LastActivityDate="2017-11-12T17:21:33.080" Title="Quoting options with reference price and delta" Tags="&lt;black-scholes&gt;&lt;implied-volatility&gt;&lt;european-options&gt;" AnswerCount="1" CommentCount="10" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36854" PostTypeId="2" ParentId="36852" CreationDate="2017-11-12T17:21:33.080" Score="1" Body="&lt;p&gt;In the equity space and between different institutions, options are usually not quoted in implied volatilities. For this to work, you'd additionally have to also quote at least a risk-free rate, forward and a measure of time-to-expiry (e.g. a day count convention) for European options. For American options, it get's even less feasible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the broker/OTC market, options are usually quoted as a price, spot reference and delta combination. The delta and spot reference determine how the price is adjusted to account for spot moves between quote and trade time to the first order. This is necessary as a trade usually does not happen immediately immediately but only after the broker collected a sufficient number of quotes and the initiating counterpart made a decision. Let $T_\text{quote}$ and $T_\text{trade}$ be the times of the quote and trade, respectively. The traded price is then given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;P \left( T_\text{trade} \right) = P \left( T_\text{quote} \right) + \Delta \left( T_\text{quote} \right) \left[ S \left( T_\text{trade} \right) - S \left( T_\text{quote} \right) \right].&#xA;$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course, you (as the one providing the quote) can always retract it while it hasn't been traded yet. E.g. when the too much time passed, the implied volatility changed or the spot price moved too much for the delta approximation to be valid.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the screen, there is not need for this as you can update your quotes at all times.&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2017-11-12T17:21:33.080" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36855" PostTypeId="1" AcceptedAnswerId="36871" CreationDate="2017-11-12T17:37:15.977" Score="3" ViewCount="340" Body="&lt;p&gt;I'm currently using QuantLib Python. Let's say that I've got a VanillaSwap object:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;import QuantLib as ql&#xA;swap_obj = ql.VanillaSwap(... , iborIndex , ...)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;How can I find out what is the underlying iborIndex of the swap object?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried the following already, but none of the following works:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;swap_obj.index&#xA;swap_obj.iborIndex&#xA;swap_obj.index()&#xA;swap_obj.iborIndex()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6428" LastActivityDate="2017-11-13T11:18:49.000" Title="Given QuantLib Python VanillaSwap object, how to get the iborIndex of the swap object?" Tags="&lt;swaps&gt;&lt;python&gt;&lt;quantlib&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36856" PostTypeId="1" CreationDate="2017-11-12T20:32:19.977" Score="2" ViewCount="168" Body="&lt;p&gt;Are there any papers about cointegration consisting of time series of more than two assets ? I wonder if there could be any trading strategy for three assets case.&lt;/p&gt;&#xA;" OwnerUserId="2044" LastEditorUserId="16160" LastEditDate="2017-11-12T21:18:06.593" LastActivityDate="2017-11-15T06:48:48.077" Title="Are there any papers about cointegration consisting of time series of more than two assets?" Tags="&lt;arbitrage&gt;&lt;cointegration&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36857" PostTypeId="2" ParentId="35937" CreationDate="2017-11-12T23:00:40.483" Score="3" Body="&lt;p&gt;You can use Bayesian methods.  Missing data is not an intrinsic problem for Bayesian methods, however, you do need to understand why the data is missing before you use Bayesian methods.  In your case, it is because the firms did not exist.  That is rather fortunate as this makes your case rather simple.  It is a different problem if, for example, there was some reason data was missing such as you may see in other social science data such as embarrassment.  Then you have a headache.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You need to develop prior distributions for the location of the center of location and for the scale parameter.  Let us imagine that they start sequentially so that $X_1$ is the first series to begin, $X_2$ the second and $X_{30}$ the last.  You would set a prior for the first until you were one observation before observing $X_2$.  You would treat your posterior density from $X_1$ as the prior for $X_2$.  I would weaken the scale parameter to cover the probability that the parameters for $X_2$ are not the same as $X_1$.  Repeat until all series have begun.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For interior missing observations, such as day without a trade, you would estimate the distribution of possible values from prior observations and marginalize it out so that you would not lose information from the missing observations.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The alternative of using the mean value distorts the scale parameter and distorts any inference.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The third alternative, waiting until they all share a time series, wastes information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See: &lt;a href=&quot;http://www.bias-project.org.uk/papers/NonTechnicalMissingTalkSlides.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.bias-project.org.uk/papers/NonTechnicalMissingTalkSlides.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you have never used Bayesian methods, send me a question and I will provide some additional information.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2017-11-12T23:00:40.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36858" PostTypeId="2" ParentId="36856" CreationDate="2017-11-12T23:22:54.083" Score="4" Body="&lt;p&gt;Technically, if you do PCA on the yield curve (&lt;em&gt;live dangerously!&lt;/em&gt;, do it in levels), the first two PCAs are nonstationary. The third is questionable. Note that this is a perfectly valid way of looking for stochastic common trends (see Madalla-Kim, &lt;em&gt;Unit Roots, Cointegration and Structural Change&lt;/em&gt; for refs). The fourth principal component is stationary by most measures.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;FYI, stochastic common trends is the state-space analog of Cointegration. In cointegration, we use Johansen for testing. In Stoch-common trends, one uses Nyberg, which switches H0 and H1, just like for unit root testing one uses ADF, but for mean-reversion testing, one uses KPSS. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fourth principal component requires the use of four assets to replicate it. Since PCs are ordered by their modes (first PC=level=no zeros, second PC=slope=one zero,  third PC=curvature=two zeros,..) the fourth PC=three zeros and best corresponds to the relationship between one slope on another. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A proxy we used to use for this was 2s-30s slope vs 5s-10s slope. These slopes are generally cointegrated although as with most relationships, the beta can shift. We used to call this the &lt;em&gt;condor&lt;/em&gt; back when we covered this trade pre-crisis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It turns out, that finding the cointegrating relationship is not very robust. Doing the regression of say 2s on 5s,10s and 30s in levels is not robust. The stderrs are too high. Regressing 2s30s slopes on 5s10s slope performs much better OOS. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This was traded pre-crisis, but I don't think it's a very viable trade for most given that there are too many transaction costs. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A similar slope vs slope, well-behaved, trade would be close-maturity futures slopes, so EDH8-EDM8 vs ERH8-ERM8).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It is pretty straightforward to come up with multi-asset portfolios in rates which one can make sense of, because each product is only modestly different from other products. In fact, the factor mimicking portfolio for levels or for slope or for curvature are all multi-asset portfolios. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You might be asking about equities,  however, and, unlike rates, I do not personally know whether it makes sense for a triplet of assets to be mean-reverting, since it is a little less intuitive.&lt;/p&gt;&#xA;" OwnerUserId="15602" LastEditorUserId="15602" LastEditDate="2017-11-15T06:48:48.077" LastActivityDate="2017-11-15T06:48:48.077" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36860" PostTypeId="2" ParentId="36856" CreationDate="2017-11-13T01:31:08.477" Score="2" Body="&lt;p&gt;The Johansen test can be used to test for cointegration among $n$ assets.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Johansen_test&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Johansen_test&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The original paper:&#xA; Johansen, Søren (1991). &quot;Estimation and Hypothesis Testing of Cointegration Vectors in Gaussian Vector Autoregressive Models&quot;. Econometrica. 59 (6): 1551–1580&lt;/p&gt;&#xA;" OwnerUserId="5107" LastEditorUserId="5107" LastEditDate="2017-11-13T02:11:53.783" LastActivityDate="2017-11-13T02:11:53.783" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36861" PostTypeId="2" ParentId="36844" CreationDate="2017-11-13T02:40:52.000" Score="3" Body="&lt;p&gt;We can calculate the principal components by finding the eigenvalues and eigenvectors of the covariance matrix. The largest eigenvalue represents the largest variance, second largest eigenvalue the second largest variance etc. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;By plotting the components of the eigenvectors we can identify them with, e.g., shifts, tilts, flexing and so on. For example for a yield curve we usually have that the first eigenvector has all components positive (parallel level shift), the second eigenvector has the first half of the components positive and the second half negative (slope tilt), the third eigenvector has the first third of the components positive, second third negative, and the last third positive (flexing).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It just happens that the largest variance comes from a parallel shift in the curve, the second largest variance comes from a tilt of the curve, and the third largest variance comes from a flexing of the curve. &lt;strong&gt;It is not required to be so&lt;/strong&gt;, it is just the dynamics of the market that can be identified with the principal components.  &lt;/p&gt;&#xA;" OwnerUserId="5107" LastActivityDate="2017-11-13T02:40:52.000" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="36862" PostTypeId="1" AcceptedAnswerId="36865" CreationDate="2017-11-13T03:43:17.017" Score="2" ViewCount="1066" Body="&lt;p&gt;Does anyone know how to adjust &lt;strong&gt;&lt;code&gt;trading volume&lt;/code&gt;&lt;/strong&gt; based on stock splits?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is an example of ANA (9202.T) on 2017-09-27.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A stock split happened with factor 1:10.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;DateTime                Open    High    Low     Close   TradedVolume&#xA;2017-09-26 15:00:00     423.0   423.0   423.0   423.0   3787000&#xA;&#xA;DateTime                Open    High    Low     Close   TradedVolume&#xA;2017-09-27 09:00:00     4206.0  4209.0  4201.0  4208.0  829700 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Do I just need to divide &lt;code&gt;TradedVolume&lt;/code&gt; by a factor of 10 and multiply the prices by 10, before the split?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case I would get the adjusted values to be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;DateTime                Open     High     Low      Close   TradedVolume&#xA;2017-09-26 15:00:00     4230.0   4230.0   4230.0   4230.0  378700&#xA;&#xA;DateTime                Open     High     Low      Close   TradedVolume&#xA;2017-09-27 09:00:00     4206.0   4209.0   4201.0   4208.0  829700 &#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This seems the most natural to me as we keep the total value (price*volume) constant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Looking forward to hearing your thoughts.&lt;/p&gt;&#xA;" OwnerUserId="25601" LastActivityDate="2017-11-13T05:21:23.760" Title="How to adjust trading volume based on stock splits?" Tags="&lt;equities&gt;&lt;volume&gt;&lt;split&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36863" PostTypeId="1" AcceptedAnswerId="36969" CreationDate="2017-11-13T04:49:14.853" Score="1" ViewCount="1005" Body="&lt;p&gt;I am new to package &lt;code&gt;quantmod&lt;/code&gt; and &lt;code&gt;quandl&lt;/code&gt;. I encountered a problem while I was trying to fetch period return data. Below is my source code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;require(TTR)&#xA;require(quantmod)&#xA;SYMs &amp;lt;- TTR::stockSymbols()&#xA;filtered = SYMs[!is.na(SYMs$Sector) &amp;amp; !is.na(SYMs$Industry),]&#xA;selected = filtered[,c(&quot;Symbol&quot;, &quot;Sector&quot;, &quot;Industry&quot;)]&#xA;for(i in 1:nrow(selected)){&#xA;  ticker = selected$Symbol[i]&#xA;  getSymbols(ticker)&#xA;  selected$MonthyReturn &amp;lt;- monthlyReturn(ticker, subset='2017-11-10')&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The problem of this code is that the monthlyReturn will not operate, giving an error of &lt;code&gt;Error in try.xts(x) : Error in UseMethod(&quot;as.xts&quot;) :   no applicable method for 'as.xts' applied to an object of class &quot;character&quot;&lt;/code&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This error does not seem very intuitive to me. I tried an actual ticker and noticed that the monthlyReturn(ticker, subset='2017-11-10') will only work if the ticker is not of type character (e.g. AAPL instead of 'AAPL' will work fine).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can I know what is the reason? &lt;/p&gt;&#xA;" OwnerUserId="30425" LastActivityDate="2017-11-19T21:38:16.433" Title="Getting monthly return using quantmod, if input ticker is a variable" Tags="&lt;programming&gt;&lt;returns&gt;&lt;quantmod&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36865" PostTypeId="2" ParentId="36862" CreationDate="2017-11-13T05:21:23.760" Score="4" Body="&lt;p&gt;Simple:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Divide the share price by the split factor.&lt;/li&gt;&#xA;&lt;li&gt;Multiply the volume by the split factor.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Let's use Apple's 7/1 split from Monday June 9, 2014 as an example.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The split factor was 7/1 or 7.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The closing price on Friday June 6, 2014 was 645.57 and the volume was 12497800.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;After the split, the closing price for Friday June 6, 2014 was adjusted to 92.22 and the volume increases to 87484600.&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;645.57 / ( 7 ) = 92.22&lt;/li&gt;&#xA;&lt;li&gt;12497800 * ( 7 ) = 87484600&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;For a reverse split, the calculation is the same but the share price will increase and the volume will decrease because the split factor is a fraction. In a 1/4 reverse split, the split factor is (1/4) or 0.25.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For further reading:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://help.yahoo.com/kb/adjusted-close-sln28256.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;What is the adjusted close?&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.crsp.com/products/documentation/crsp-calculations&quot; rel=&quot;nofollow noreferrer&quot;&gt;CRSP Calculations&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="30421" LastActivityDate="2017-11-13T05:21:23.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36866" PostTypeId="2" ParentId="35697" CreationDate="2017-11-13T08:13:36.057" Score="0" Body="&lt;p&gt;Perhaps it was just the way it was quoted but I have a serious problem with the statements by a prominent quant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, &lt;em&gt;prediction&lt;/em&gt; via risk-neutral DGP makes no sense at all. Nobody (except those who dogmatically hold to this view in spite of losing money) in their right mind would &lt;em&gt;predict&lt;/em&gt; using the Q-measure. Short rates would zip up to forwards, carry would not exist, options would have no value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;One predicts with P. Historic data gives more insight into evolutions of asset prices than do forward curves. In fact, one does use forwards in best predictions, but not at all in a method that is consistent with Q measure evolutions.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Price and risk-manage with Q measure. Predict with P. Of course, evolve by Q measure to see the discrepancies with P to determine market prices of risk. What is overvalued and what is undervalued. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Meucci has a reasonable tiny writeup on Q vs P measures. Each has its place, but don't start predicting with Q.&#xA;&lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1717163&quot; rel=&quot;nofollow noreferrer&quot;&gt;'P' Versus 'Q': Differences and Commonalities between the Two Areas of Quantitative Finance&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="15602" LastActivityDate="2017-11-13T08:13:36.057" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36868" PostTypeId="1" CreationDate="2017-11-13T10:41:44.490" Score="1" ViewCount="67" Body="&lt;p&gt;I have heard of existing methods of detecting bubbles in the pricing of precious metals like gold and was wondering if, by extension, something similar could be done to examine prices of cryptocurrencies, and particularly Bitcoin.&lt;/p&gt;&#xA;" OwnerUserId="30428" LastActivityDate="2017-11-13T10:41:44.490" Title="Are there ways of detecting a price bubble of an asset with no inherent value such as Bitcoin, purely based on an existing momentum in pricing?" Tags="&lt;price&gt;&lt;bitcoin&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36869" PostTypeId="1" CreationDate="2017-11-13T10:43:18.730" Score="1" ViewCount="201" Body="&lt;p&gt;I'm a software developer currently working for an asset manager in their Risk department.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking at Currency Futures and have a question I was hoping someone could put me right on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If I have a fund whose base currency is GBP and it holds 1 long position in the EUR/USD currency future (say Dec15).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Having a GBP base currency, can I (should I?) represent the fund's exposure as 2 legs: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;a long EUR exposure; and&lt;/li&gt;&#xA;&lt;li&gt;a short USD exposure?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;If so, I'd expect the EUR exposure value to be EUR125,000 but what would the USD exposure value be?  And how do I ensure the net of the two equates to the market  value of the position?&lt;/p&gt;&#xA;" OwnerUserId="6607" LastEditorUserId="6607" LastEditDate="2017-11-13T10:56:33.427" LastActivityDate="2017-11-13T10:56:33.427" Title="Net Exposure of FX Future" Tags="&lt;fx&gt;&lt;futures&gt;&lt;risk-management&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36870" PostTypeId="1" CreationDate="2017-11-13T10:59:41.853" Score="17" ViewCount="1814" Body="&lt;p&gt;In posts regarding the &lt;span class=&quot;math-container&quot;&gt;$\mathbb{P}$&lt;/span&gt; vs &lt;span class=&quot;math-container&quot;&gt;$\mathbb{Q}$&lt;/span&gt; debate (see &lt;a href=&quot;https://quant.stackexchange.com/questions/35697/risk-neutral-vs-physical-measures-real-world-example&quot;&gt;1&lt;/a&gt;, &lt;a href=&quot;https://quant.stackexchange.com/questions/8274/how-to-estimate-real-world-probabilities?noredirect=1&amp;amp;lq=1&quot;&gt;2&lt;/a&gt;, &lt;a href=&quot;https://quant.stackexchange.com/questions/9172/sde-simulation-p-or-q?rq=1&quot;&gt;3&lt;/a&gt; or &lt;a href=&quot;https://quant.stackexchange.com/questions/35335/mathbbp-vs-mathbbq-probabilities-transitioning-between-measures?rq=1&quot;&gt;4&lt;/a&gt;), most answers conclude that historical-based forecast are better suited than risk-neutral models for financial predictions. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, this conclusion seems to be based on sentimental beliefs. In fact, empirical analyses comparing historical and risk-neutral predictions tend to conclude that risk-neutral models perform better than historical models. See, for instance, these recent papers: &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3034270&quot; rel=&quot;nofollow noreferrer&quot;&gt;1&lt;/a&gt;, &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3162037&quot; rel=&quot;nofollow noreferrer&quot;&gt;2&lt;/a&gt; or these comprehensive surveys: &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1969863&quot; rel=&quot;nofollow noreferrer&quot;&gt;1&lt;/a&gt; and &lt;a href=&quot;http://www.jstor.org/stable/pdf/3216966.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;2&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While indeed risk-neutral forecasts have theoretical flaws, a rational assessment would entail: (i) evaluating how these flaws actually impact future predictions and (ii) comparing the flaws observed in risk-neutral predictions with the biases of historical models. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, since most people already seem to have a notably strong view, this pre-conditioning could be relegating what should be, conceptually, the core of the discussion (i.e.: performing empirical analyses and comparing forecast models with an agnostic view)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, why it is that we adopt such pre-conditioned view regarding risk-neutral predictions? &lt;/p&gt;&#xA;" OwnerUserId="5208" LastEditorUserId="5208" LastEditDate="2020-04-16T20:23:53.447" LastActivityDate="2020-04-16T20:23:53.447" Title="Why quants think that the risk-neutral measure should not be used for financial forecasting?" Tags="&lt;time-series&gt;&lt;historical-data&gt;&lt;risk-neutral-measure&gt;&lt;forecasting&gt;&lt;stochastic-discount&gt;" AnswerCount="5" CommentCount="0" FavoriteCount="11" ContentLicense="CC BY-SA 4.0" />
  <row Id="36871" PostTypeId="2" ParentId="36855" CreationDate="2017-11-13T11:18:49.000" Score="4" Body="&lt;p&gt;It's a bit awkward. Cashflows and indexes are stored as pointers to their base class and you can't cast them directly from Python, so the module provides a few helper functions from that.  You can do something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;first_coupon = as_floating_rate_coupon(swap_obj.floatingLeg()[0])&#xA;ibor = as_iborindex(first_coupon.index())&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(Using, e.g., just &lt;code&gt;first_coupon.index()&lt;/code&gt; would give you an instance of &lt;code&gt;FloatingRateIndex&lt;/code&gt;, so it wouldn't have the complete interface of &lt;code&gt;IborIndex&lt;/code&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2017-11-13T11:18:49.000" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36872" PostTypeId="2" ParentId="36804" CreationDate="2017-11-13T11:34:50.653" Score="3" Body="&lt;p&gt;Also, check out this senior thesis on the tulip mania; the author used what sounds like the type of data you are looking for, so I would reach out to him and ask him where he got it: &lt;a href=&quot;http://arno.uvt.nl/show.cgi?fid=129437&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://arno.uvt.nl/show.cgi?fid=129437&lt;/a&gt; &lt;/p&gt;&#xA;" OwnerUserId="30428" LastActivityDate="2017-11-13T11:34:50.653" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36873" PostTypeId="2" ParentId="36830" CreationDate="2017-11-13T12:05:01.003" Score="1" Body="&lt;p&gt;When you set the evaluation date to November 13th, the fixing date of the first Euribor coupon (November 6th) is in the past; therefore, the coupon can't forecast its fixing over the interest-rate curve like it did in the first case (the curve only describes present and future rates, not past ones).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the pricing to work, you'll have to store the value of the past fixing.  You can do it with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;index.addFixing(Date(6,November,2001), rate)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where &lt;code&gt;rate&lt;/code&gt; is the Euribor fixing; if you don't have it, you can probably use as a proxy the 6-months deposit fixing you're using to bootstrap the curve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A couple of notes:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;the way you wrote the code, on November 13th you'll bootstrap the curve using the same rates you used for November 6th.  In real life, they changed.  (That's ok if you're aware of what you're doing; I'm mentioning it just in case and for future readers.)&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;if you want the curve to move with the evaluation date, you don't need to &#xA;recreate it when the date changes.  Instead of passing the reference &#xA;date, as in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;curve = PiecewiseFlatForward(settlementDate, helpers, Actual360())&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;you can tell the curve explicitly that its reference date should be two &#xA;business days after the evaluation date, as in:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;curve = PiecewiseFlatForward(2, TARGET(), helpers, Actual360())&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This way, you can create the curve just once and have it move &#xA;automatically when the evaluation date changes.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="308" LastActivityDate="2017-11-13T12:05:01.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36878" PostTypeId="2" ParentId="34558" CreationDate="2017-11-13T21:21:31.467" Score="1" Body="&lt;p&gt;He says the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's use a multi-asset local volatility model calibrated for each stock on its market smile of maturity $T$ (a one-maturity smile), and with the Brownian motions correlated through a correlation matrix $\rho$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then there exists a local volatility for each asset such that: (1) the smile of maturity $T$ for each asset is recovered, (2) the resulting multi-asset local volatility price is equal to the Gaussian copula price with a correlation martrix equal to $\rho$ and the marginals calibrated on the $T$-maturity smiles. This is true for any European payoff.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given a $T$-maturity smile, there exist many different local volatilities calibrated to this single maturity smile. They generate different smiles for shorter maturities. The local volatility that recovers the copula price is the one generated by a Markov-functional model built on the $T$-maturity smile.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;He explains it better than me in section 2.10 of his book. Chapter 2 of his book is posted for free on his website: &lt;a href=&quot;http://www.lorenzobergomi.com&quot; rel=&quot;nofollow noreferrer&quot;&gt;www.lorenzobergomi.com&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="30435" LastActivityDate="2017-11-13T21:21:31.467" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36879" PostTypeId="2" ParentId="36870" CreationDate="2017-11-14T00:21:05.943" Score="12" Body="&lt;p&gt;There is a deeper issue.  Frequentist distributions are not probability distributions because they are designed to be minimax distributions rather than actual distributions.  This ignores all of the other problems and this also ignores risk-neutral versus any other measure of risk aversion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An even deeper issue is that these models presume that the parameters are known.  If you have a wealth model such as $w_{t+1}=Rw_t+\epsilon_{t+1}$, where $\epsilon_t\sim\mathcal{N}(0,\sigma^2_t)$, then if $R$ and $\sigma^2_t$ are known, then the mean-variance results follow.  However, if the parameters are not known, then they can never be known.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;See:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;White, J. S. (1958). The limiting distribution of the serial correlation coefficient in the explosive case. The Annals of Mathematical Statistics, 29(4):1188–1197&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;This shocking proof, when combined with Mann and Wald's proof&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Mann, H. and Wald, A. (1943). On the statistical treatment of linear stochastic&#xA;  difference equations. Econometrica, 11:173–200.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Imply that if mean-variance models are true, then no solution can be constructed using their axioms.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a solution to the question you are asking, however, see &lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Harris, D.E.(2017) The Distribution of Returns. Journal of Mathematical Finance, 7, 769-804,&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;which derives the distributions of returns.  You can use these as Bayesian likelihood functions and arrive at a coherent predictive distribution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Bayesian predictive distribution is:&#xA;$$\Pr(\tilde{x}=k|\mathbf{X})=\int_{\theta\in\Theta}\Pr(\tilde{x}=k|\theta)\Pr(\theta|\mathbf{X})\mathrm{d}\theta,\forall{k}\in\chi,$$ where $\chi$ is the sample space, $\Theta$ is the parameter space, $\theta$ is a parameter or vector of parameters in $\Theta$, $\mathbf{X}$ is the observed sample and $\tilde{x}$ is some predicted value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Notice that $\Pr(\tilde{x}|\mathbf{X})$ does not depend upon the values for $\theta$ as any uncertainty as to its true value has been marginalized out so that the prediction only depends upon the information that you observed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The predictive distribution of $\tilde{x}$ is coherent so that a bookie, or market-maker, offering prices or odds based on the information in $\mathbf{X}$ cannot be gamed and take a sure loss by a clever actor or set of actors.  That is never true for Frequentist solutions.  You can rig a game based on a Frequentist statistic if you are crafty enough.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Whereas the Frequentist model assumes the parameters are known, the Bayesian model ends with a result that they do not matter for the purposes of making a prediction.  That is a powerful result.  The former is fragile, the latter is robust.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As to why we adopt these strong views, it is because we are people.  Even economists who do not work for the Street have vested interests.  It is challenging to be a scientist when your salary is tied to your outcomes.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2017-11-14T00:21:05.943" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36881" PostTypeId="1" CreationDate="2017-11-14T01:46:48.653" Score="1" ViewCount="287" Body="&lt;p&gt;Is there anyway to construct a return series for an options positions using price data on the underling? I want to introduce options as an asset to the portfolio optimization process. I realize the best way to do this would be with actual historical data, but that's complicated for obvious reasons.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My thinking is it would be easy if you only used delta. You assume a constant delta position, and the option returns just become a fraction of the underlying's returns. But would it be possible to simulate the higher moments?&lt;/p&gt;&#xA;" OwnerUserId="28156" LastActivityDate="2017-11-14T16:43:29.327" Title="Options return series for portfolio optimization" Tags="&lt;options&gt;&lt;portfolio-optimization&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36882" PostTypeId="1" CreationDate="2017-11-14T02:57:17.473" Score="2" ViewCount="323" Body="&lt;p&gt;I have a 1-minutely OHLC dataset indexed by time as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;df_ohlc&#xA;Out[2]: &#xA;                      open  high  low  close  index  week&#xA;Date                                                    &#xA;2011-09-13 09:53:00   5.8   6.0  5.8    6.0      1     1&#xA;2011-09-13 09:54:00   6.0   6.0  6.0    6.0      2     1&#xA;2011-09-13 09:55:00   6.0   6.0  6.0    6.0      3     1&#xA;2011-09-13 09:56:00   6.0   6.0  6.0    6.0      4     1&#xA;2011-09-13 09:57:00   6.0   6.0  6.0    6.0      5     1&#xA;...&#xA;2017-07-17 18:19:00  2176.99  2176.99  2176.50  2176.50  3073467   305&#xA;2017-07-17 18:20:00  2175.00  2177.65  2175.00  2176.99  3073468   305&#xA;2017-07-17 18:21:00  2177.80  2177.84  2173.71  2177.61  3073469   305&#xA;2017-07-17 18:22:00  2177.50  2177.50  2175.04  2175.04  3073470   305&#xA;2017-07-17 18:23:00  2177.30  2177.30  2175.00  2175.00  3073471   305&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In Python,&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for i in range(1,len(df_ohlc)+1):&#xA;  plt.clf()&#xA;  kde_est.iloc[i] = df_ohlc['close'][df_ohlc['week']==i].plot.kde()&#xA;  plt.show()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;generates the Kernel Density Estimate (a smooth histogram essentially) for each week's closing prices of the dataset. In other words, it generates 305 individual KDE plots for this dataset.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;How would I plot all these KDEs over time on one 3-Dimensional surface?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For example, right now each KDE plot is [Close Price] x [Probability Density]. I'd like to introduce a new variable (z = time) so we can see the changes in KDE over time, [Close Price] x [Probability Density] x [Week]&lt;/p&gt;&#xA;" OwnerUserId="26931" LastActivityDate="2020-04-02T21:02:40.417" Title="Generating surface of Kernel Density Estimates over time" Tags="&lt;time-series&gt;&lt;python&gt;&lt;density&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36883" PostTypeId="1" CreationDate="2017-11-14T05:39:03.443" Score="1" ViewCount="803" Body="&lt;p&gt;I guess this is a pretty straight forward and basic question. &#xA;I am using the entire CRSP universe from 1962-2016 and my goal is to replicate a research paper. However, I realized that the average (value weighted) return of my downloaded CRPS data is too high in comparison to e.g. the original paper, or market return data from the Kenneth R. French website. The difference is significant ~ 3% higher, thus I am a bit clueless as to what I did wrong.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What I did:&#xA;I used holding period return data for the entire data base and took the PERMNO to identify single stocks.&#xA;Moreover I only select those issues with a share code of 10 or 11 and I have added the delist return to the appropriate date.&#xA;I never worked with CRSP and I was under the impression that I accounted for everything that should be accounted for.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question therefore is: Is there anything I missed are there any adjustments that should have been done to the data to derive the appropriate results.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am grateful for any advise and if the conclusion is that I must have messed up, well I would be grateful for that inside too.&lt;/p&gt;&#xA;" OwnerUserId="30438" LastActivityDate="2017-11-15T16:16:51.237" Title="What are necessary adjustments to returns in CRSP?" Tags="&lt;equities&gt;&lt;returns&gt;&lt;historical-data&gt;&lt;adjustments&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36884" PostTypeId="1" AcceptedAnswerId="36893" CreationDate="2017-11-14T07:59:16.070" Score="2" ViewCount="342" Body="&lt;p&gt;Consider the bond decribed by the following formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;1000-\text{max}\left[0,1000 \;\text{min}\left(\frac{169}{S_T} -1,1\right)\right]&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $S_T$ is a yen-USD exchange rate at maturity;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if $S_T$ is larger than $169$ yen/per USD the holder receives $1000$ USD while if $S_T&amp;lt;84.5$ then the holder receives nothing. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;(This was ICON (index currency option notes) issued in 1995, according to the book, if anyone is interested).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm asked to show that this is a combination of two options and a bond.&#xA;Now looking at the profit-maturity rate graph it sort of gives me the idea, as there are two &quot;flat&quot; parts of the graph (which probably is a result of combining two options) and the middle part connecting them comes from regular bond yield. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I'm not sure how I would magically cook up the formula (for the derivatives involved. Or is there other way than that?) from just intuition alone. Also, I'm not entirely sure what's meant by &quot;regular bond here&quot;. I'm quite new to all these financial concepts, so it'd be great if someone could give a significant hints towards the solution.&lt;/p&gt;&#xA;" OwnerUserId="30440" LastEditorUserId="30440" LastEditDate="2017-11-14T08:34:03.790" LastActivityDate="2017-11-14T21:14:09.417" Title="Show that a derivative is a combination of two options and a regular bond" Tags="&lt;options&gt;&lt;bond&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36886" PostTypeId="1" AcceptedAnswerId="37210" CreationDate="2017-11-14T09:11:51.650" Score="2" ViewCount="882" Body="&lt;p&gt;I often see two different recovery rates in Markit : real recovery rate and assumed recovery rate. What is the difference between them ?&lt;/p&gt;&#xA;" OwnerUserId="28718" LastEditorUserId="28718" LastEditDate="2017-11-14T11:36:40.500" LastActivityDate="2018-05-09T09:45:13.547" Title="Markit recovery rates : assumed vs real" Tags="&lt;credit&gt;&lt;recovery&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="36887" PostTypeId="1" CreationDate="2017-11-14T10:04:31.497" Score="2" ViewCount="103" Body="&lt;p&gt;The regulator forces banks to assess their (intraday) liquidity risk in normal and stressed conditions &lt;a href=&quot;https://www.bis.org/publ/bcbs144.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;see e.g. BCBS 144 principle 9&lt;/a&gt;.&#xA;To me this sounds pretty much like a possible application of EVT to banking  - not (!) asset - liquidity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I find it hard to find referenes of an application of EVT to the liquidity of banks -especially something up-to-date.&#xA;Can we collect some here?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: I found &lt;a href=&quot;https://repository.tudelft.nl/islandora/object/uuid%3A1c0c4545-bb07-4916-aa37-1d4bea3b7872&quot; rel=&quot;nofollow noreferrer&quot;&gt;this thesis: Intraday liquidity risk estimation&#xA;using transaction data:&#xA;an extreme value theory approach&lt;/a&gt;. If I interpret the conclusions correctly then the result is rather mixed.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="2587" LastEditDate="2017-11-14T16:22:48.507" LastActivityDate="2017-11-14T16:22:48.507" Title="Application of Extreme Value Theory in banking liquidity risk analysis" Tags="&lt;liquidity&gt;&lt;banking-regulations&gt;&lt;evt&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36888" PostTypeId="1" CreationDate="2017-11-14T10:13:27.213" Score="2" ViewCount="722" Body="&lt;p&gt;Can I use the Implied vol surface from the plain vanilla options to price the Knock out Barrier options with Rebate?. In addition, for risk management purpose, can I just imply the volatility from the Barrier option prices like in plain vanilla options (Black and Scholes Framework)&lt;/p&gt;&#xA;" OwnerUserId="30443" LastActivityDate="2017-11-16T09:21:13.150" Title="Barrier option with Rebate" Tags="&lt;option-pricing&gt;&lt;implied-volatility&gt;&lt;exotics&gt;" AnswerCount="1" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="36889" PostTypeId="1" AcceptedAnswerId="36892" CreationDate="2017-11-14T11:38:10.060" Score="1" ViewCount="72" Body="&lt;ul&gt;&#xA;&lt;li&gt;I am used to applying $R^{2}$ (relative explained variance) as a measure for point estimates.&lt;/li&gt;&#xA;&lt;li&gt;I am now confronted with forecasting the whole of the yield curve and would like to see what fraction of variance in the actual market yield curves is explained by the forecast model. I am slightly unsure how to proceed as I am no longer dealing with a single point, but rather the whole curve (or, if discretised, a collection of points). &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="11655" LastActivityDate="2017-11-14T13:56:08.113" Title="$R^{2}$ Measure for Functions (Yield Curves)" Tags="&lt;fixed-income&gt;&lt;forecasting&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36890" PostTypeId="2" ParentId="36882" CreationDate="2017-11-14T12:47:24.527" Score="1" Body="&lt;p&gt;Perhaps the easiest way is &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) To write manually a function, that takes an array(this corresponds to your data during a week), either with hands, using a kernel you want $f(x)=\frac{1}{nh}\sum_{k=1}^n K((x-x_i)/hn)$, or using &lt;strong&gt;scipy.stats.gaussian_kde&lt;/strong&gt;(or more general using &lt;strong&gt;sklearn.neighbors&lt;/strong&gt; &lt;strong&gt;KernelDensity&lt;/strong&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Merge the results of 1) into 1 array, say Prob.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Using the corresponging methods of matplotlib (&lt;strong&gt;plot_surface&lt;/strong&gt;, etc) plot as you said [Price]x[Prob]x[Week]&lt;/p&gt;&#xA;" OwnerUserId="30445" LastActivityDate="2017-11-14T12:47:24.527" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36891" PostTypeId="2" ParentId="36881" CreationDate="2017-11-14T13:49:48.067" Score="1" Body="&lt;p&gt;Because of the asymmetry of option returns (as a function of the underlying) it never works to map options to proportions of the underlying, except in cases where the option position is too small to matter.  You really have to run the options through Black-Scholes-like pricing formulas based on each scenario's underlying prices.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can still do portfolio optimization, even mean-variance portfolio optimization, but you no longer get all that simple linear algebra.  Instead it becomes necessary to run some kind of optimization algorithm over the mean-variance objective.  (Since the dimensions are high, a conjugate gradient scheme can do well)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It usually makes sense to make volatility part of your simulation as well.  I believe the folks at RiskMetrics have published some papers on the whole process.&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2017-11-14T13:49:48.067" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36892" PostTypeId="2" ParentId="36889" CreationDate="2017-11-14T13:56:08.113" Score="3" Body="&lt;p&gt;I'm not sure you are truly asking the right questions about this project, but the concept of mean squared error is easily extended to continuous curves.  Let's say our maximum yield curve tenor is $T$, that we have a prediction $p(t)$ and a true value $y(t)$.  Then we define our mean squared error as the mean &lt;a href=&quot;https://en.wikipedia.org/wiki/L2_distance&quot; rel=&quot;nofollow noreferrer&quot;&gt;$L^2$ distance&lt;/a&gt;, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;MSE = \frac{1}{T}\int_0^T \left|p(t) - y(t)\right|^2 dt&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="254" LastActivityDate="2017-11-14T13:56:08.113" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36893" PostTypeId="2" ParentId="36884" CreationDate="2017-11-14T14:44:50.667" Score="1" Body="&lt;p&gt;Your payoff $\pi_T$ is the following:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ &#xA;\pi_T = \left\{\begin{array} &#xA;\\ 0 &amp;amp; &amp;amp; \text{if  } S_T&amp;lt;84.5&#xA;\\ 2,000 - 169,000/S_T &amp;amp; &amp;amp; \text{if  } 84.5 \leq S_T \leq 169&#xA;\\ 1,000 &amp;amp; &amp;amp; \text{if  } S_T &amp;gt; 169&#xA;\end{array}\right.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Letting $N=1000$, $k_1=84.5$ and $k_2=169$, it can be written:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;\pi_T&amp;amp;=1_{\{k_1 \leq S_T \leq k_2\}}\left(2N-\frac{k_2N}{S_T}\right)+1_{\{k_2&amp;lt;S_T\}}N\\[6pt]&#xA;&amp;amp;=k_2N\left(1_{\{k_1 \leq S_T \}}\left(\frac{1}{k_1}-\frac{1}{S_T}\right)+1_{\{k_2 \leq S_T \}}\left(\frac{1}{S_T}-\frac{1}{k_2}\right)\right)&#xA;\\[6pt]&#xA;&amp;amp;=k_2N\left(1_{\{\frac{1}{k_1} \geq S_T^{-1} \}}\left(\frac{1}{k_1}-S_T^{-1}\right)-1_{\{\frac{1}{k_2} \geq S_T^{-1} \}}\left(\frac{1}{k_2}-S_T^{-1}\right)\right)&#xA;\\[6pt]&#xA;&amp;amp;=k_2N\left(\max\left(0,\frac{1}{k_1}-S_T^{-1}\right)-\max\left(0,\frac{1}{k_2}-S_T^{-1}\right)\right)&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $S_T^{-1}$ is the &lt;em&gt;USDJPY&lt;/em&gt; FX rate. Therefore the payoff can be hedged by selling a put option on the USDJPY rate with strike $1/k_1$ and buying a put option on USDJPY with strike $1/k_2$ in quantities $k_2N$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you use a zero-coupon bond paying $1,000$ at maturity $T$ in your hedging strategy (as your questions specifies) then you still need two options similar to those above. But you do not really need it as there is no capital protection, i.e. under some scenarios $\pi_T=0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a general methodology to address this type of static hedging questions, refer to the beginning of my answer to question &lt;a href=&quot;https://quant.stackexchange.com/questions/34887/finding-arbitrage-opportunity/34888#34888&quot;&gt;&quot;Finding arbitrage opportunity&quot;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Note: an earlier comment I made on a digital call option was wrong.&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-11-14T21:14:09.417" LastActivityDate="2017-11-14T21:14:09.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36894" PostTypeId="1" CreationDate="2017-11-14T15:42:39.743" Score="3" ViewCount="128" Body="&lt;p&gt;I have the following expectation to calculate :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbf{E}\left[ e^{\int_{t_0}^{\tau} r_s ds} \mathbf{1}_{\{\tau &amp;lt; T\}}\right] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More precisely, I want to show that :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \mathbf{E}\left[ e^{\int_{t_0}^{\tau} r_s ds} \mathbf{1}_{\{\tau &amp;lt; T\}}\right] = \int_{t_0}^T P(s) dQ(s)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $P(s) \equiv \mathbf{E}\left[ e^{\int_{t_0}^{s} r_u du} \right]$ and $Q(s) \equiv \mathbf{E}\left[ e^{\int_{t_0}^{s} \lambda_u du} \right]$, $\tau$ is the first jump of a Poisson process with default intensity $(\lambda_t)_t$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only hypothesis I have is that rates and default are independent $-$ rates don't follow a special process.&lt;/p&gt;&#xA;" OwnerUserId="28718" LastEditorUserId="28718" LastEditDate="2017-11-14T16:41:26.533" LastActivityDate="2018-01-14T16:21:28.863" Title="Simplifying an expectation function of default time and rates" Tags="&lt;credit-risk&gt;&lt;credit&gt;&lt;default-probability&gt;&lt;default&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36895" PostTypeId="2" ParentId="36881" CreationDate="2017-11-14T16:43:29.327" Score="1" Body="&lt;p&gt;Yes, however, this requires assumptions and you would introduce a certain degree of error. This is because option prices - as all asset prices - are the result of supply and demand. Without market prices, you are missing an important piece of information, which is captured in the Black Scholes model by volatility (aka implied volatility when inferred from market prices).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In your case, where option prices are not an option ;), you need to find a replacement for implied volatility. You could look into GARCH models to forecast volatility on your underlying price (return) data. Together with the Black Scholes model this could give you an idea on the corresponding option price. Please note, from empirical data we know that this volatility forecast is usually different from the actual implied volatility, hence, you are introducing an error.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Lastly, you have to make some assumptions on your option strategy, e.g. do you roll a protective put every 3 month, etc.?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You could also have a look at option replication strategies, e.g. &quot;delta-replicated put&quot; (see e.g. &lt;a href=&quot;http://www.tandfonline.com/doi/abs/10.1080/14697688.2016.1249512?journalCode=rquf20&quot; rel=&quot;nofollow noreferrer&quot;&gt;this paper&lt;/a&gt;).&lt;/p&gt;&#xA;" OwnerUserId="25579" LastActivityDate="2017-11-14T16:43:29.327" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36896" PostTypeId="2" ParentId="36883" CreationDate="2017-11-14T17:28:46.980" Score="3" Body="&lt;p&gt;I'm going to guess that you might be getting the timing mismatched when computing value weights. (When I was a TA for a first year finance PhD class, I was surprised at how common this error was.)&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Let $s_{it}$ be the share price of firm $i$ at the end of month $t$.&lt;/li&gt;&#xA;&lt;li&gt;Let $n_{it}$ be the number of shares outstanding of firm $i$ at the end of month $t$.&lt;/li&gt;&#xA;&lt;li&gt;Let $r_{it}$ be the return of firm $i$ from the end of month $t-1$ to the end of month $t$.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;If you have portfolio weights $w_{it}$ such that $\sum_i w_{it} = 1$, the portfolio return is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ r^{(p)}_t = \sum_{i} w_{it} r_{it} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you choose weights $w_{it}$ proportional to $s_{it} n_{it}$, you &lt;strong&gt;will be using information from the future to choose portfolio weights&lt;/strong&gt;! This is an epic no no that will lead to unachievable, high returns. For the return from $t-1$ to $t$, you only have access to information available at time $t-1$. The value weight $w_{it}$ for month $t$ should be proportional to the market cap $s_{i, t-1} n_{i, t-1}$. For example, the value weight return for February should use the market caps as of the end of January.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Other possibilities (if you're doing the weights properly)&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Another possibility is that you aren't matching the universe of stocks properly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Make sure you're matching the universe of Fama-French market return, &quot;... all CRSP firms incorporated in the US and listed on the NYSE, AMEX, or NASDAQ that have a CRSP share code of 10 or 11 at the beginning of month t, good shares and price data at the beginning of t, and good return data for t minus the one-month Treasury bill rate (from Ibbotson Associates).&quot; Basically you want to keep only share codes 10 and 11 and then exclude some microcaps (this last part is less quantitatively important in modern data).&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-11-15T16:16:51.237" LastActivityDate="2017-11-15T16:16:51.237" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36899" PostTypeId="1" CreationDate="2017-11-14T19:56:32.317" Score="2" ViewCount="568" Body="&lt;p&gt;In the Fama/French &lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;data library&lt;/a&gt; the monthly research factors for the Fama-French-3-Factor-Model and the Fama-French-5-Factor-Model are presented.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't see how they are calculating the factor returns in the &quot;Last 3 Months&quot; and &quot;Last 12 Months&quot; columns.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Date      Mkt.RF  SMB   HML   RMW   CMA   RF&#xA;Sep 2016   0.25  1.75 -1.49 -1.92 -0.04 0.02&#xA;Oct 2016  -2.02 -3.97  4.16  1.24  0.20 0.02&#xA;Nov 2016   4.86  6.81  8.27 -0.50  3.67 0.01&#xA;Dec 2016   1.82  0.39  3.61  0.98 -0.25 0.03&#xA;Jan 2017   1.94 -1.28 -2.68  0.13 -0.94 0.04&#xA;Feb 2017   3.57 -2.14 -1.79  0.62 -1.74 0.04&#xA;Mar 2017   0.17  0.81 -3.17  0.83 -1.00 0.03&#xA;Apr 2017   1.09  0.51 -1.91  2.13 -1.55 0.05&#xA;May 2017   1.06 -3.07 -3.75  1.32 -1.84 0.06&#xA;Jun 2017   0.78  2.46  1.32 -2.13 -0.06 0.06&#xA;Jul 2017   1.87 -1.59 -0.28 -0.58 -0.14 0.07&#xA;Aug 2017   0.17 -1.87 -2.26  0.44 -2.44 0.07&#xA;Sep 2017   2.51  4.81  3.04 -1.51  1.62 0.09&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The table above shows the most recent data from their website. I tried to calculate the arithmetic mean return over the last 3 months and also the geometric mean return but the numbers don't match up. These are the numbers I fail to come up with:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Fama/French 5 Research Factors (2x3)&#xA;       Sep 2017   Last 3 Months   Last 12 Months&#xA;Rm-Rf     2.51        4.61           19.24&#xA;SMB       4.81        1.20            1.11&#xA;HML       3.04        0.38            4.86&#xA;RMW      -1.51       -1.69            3.59&#xA;CMA       1.62       -1.08           -5.58&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;It is clear that the first column consists of the last row data from the above dataset. But how to calculate the second and third column values?&lt;/p&gt;&#xA;" OwnerUserId="30451" LastEditorUserId="30451" LastEditDate="2017-11-16T11:19:59.253" LastActivityDate="2018-10-04T16:40:34.497" Title="How are Fama French Factor Returns for the last 3 and 12 months calculated?" Tags="&lt;returns&gt;&lt;factor-models&gt;&lt;fama-french&gt;&lt;monthly&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36901" PostTypeId="1" AcceptedAnswerId="36908" CreationDate="2017-11-14T22:04:57.600" Score="3" ViewCount="54" Body="&lt;p&gt;The OCC publishes memos about how corporate actions cause listed options to be adjusted.  Sometimes these memos specify option root symbols like '2DXC' alongside 'DXC' (&lt;a href=&quot;https://www.theocc.com/webapps/infomemos;OCCPROD0PUBSESSION=C91322FF2F741DE864BB03DE74831E04.occ-ppube4l?number=40932&amp;amp;date=201703&amp;amp;lastModifiedDate=03%2F31%2F2017%2016%3A32%3A47&quot; rel=&quot;nofollow noreferrer&quot;&gt;link to an OCC memo dated 3/31/17&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When are symbols like '2DXC' used?  What kind of options are these?&lt;/p&gt;&#xA;" OwnerUserId="27362" LastActivityDate="2017-11-15T06:08:44.703" Title="What kind of options use a root symbol that starts with a digit and ends with a stock ticker?" Tags="&lt;options&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36902" PostTypeId="1" AcceptedAnswerId="36906" CreationDate="2017-11-15T00:54:42.920" Score="0" ViewCount="168" Body="&lt;p&gt;I am new to R and I am trying to plot a histogram from one of the columns in my csv file. The table is already being read perfectly as I can check on R Studios date view. I also can plot histograms of vectors i create using a simples control like: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;X &amp;lt;- 1:100&#xA;hist(x)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, when i try to plot from my table, it says: &#xA;Error in hist(b) : object 'b' not found&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My table as a header, and i can check it using the command:&#xA;names(data)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Why can't i seem to plot the histogram from my read data? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks&lt;/p&gt;&#xA;" OwnerUserId="30369" LastActivityDate="2017-11-15T04:26:50.883" Title="Histogram on R Studio" Tags="&lt;programming&gt;" AnswerCount="1" CommentCount="1" ClosedDate="2017-11-19T05:07:56.460" ContentLicense="CC BY-SA 3.0" />
  <row Id="36906" PostTypeId="2" ParentId="36902" CreationDate="2017-11-15T04:26:50.883" Score="1" Body="&lt;p&gt;Check your global environment if the data is a numeric or integer. You may get an error if it is reading in as a character string, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Also you should be referencing the column name in your code assuming you have multiple columns being pulled in. Like this hist(foo$bar).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Suggest you look at ggplot's histograms &lt;a href=&quot;http://ggplot2.tidyverse.org/reference/geom_histogram.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="28675" LastActivityDate="2017-11-15T04:26:50.883" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36908" PostTypeId="2" ParentId="36901" CreationDate="2017-11-15T06:08:44.703" Score="0" Body="&lt;p&gt;These symbols are used for Flex options series&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can have a description of Flex options in either of the links below&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.cboe.com/products/flex-cflex&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.cboe.com/products/flex-cflex&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://www.investopedia.com/terms/f/flexoption.asp&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.investopedia.com/terms/f/flexoption.asp&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1181" LastActivityDate="2017-11-15T06:08:44.703" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36909" PostTypeId="2" ParentId="985" CreationDate="2017-11-15T06:55:47.937" Score="0" Body="&lt;p&gt;Identical? So $Y_t=X_t$ for all $t$?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then the difference is zero which is more than just a stationary time-series. They are perfectly collinear.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, it depends on the cointegration test you use whether high collinearity will show up as cointegration. If you use Engle-Granger, you do a regression first, which will find $\alpha=0,\beta=1$ and $\epsilon_t=0$. I'm not sure what an ADF test on $0$ will actually do, and this could lead to a numeric instability.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe that a Johansen test will also lead to a numeric instability.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If this is a serious problem for some automated system, then probably the first thing to do is look for collinearity (take the timeseries covariance matrix and look at the condition number). If they are highly collinear or identical, you should catch it before running it through the cointegration engine.&lt;/p&gt;&#xA;" OwnerUserId="15602" LastActivityDate="2017-11-15T06:55:47.937" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36911" PostTypeId="1" CreationDate="2017-11-15T09:57:28.630" Score="0" ViewCount="55" Body="&lt;ul&gt;&#xA;&lt;li&gt;Long term equities outperform bonds (equity premium puzzle).&lt;/li&gt;&#xA;&lt;li&gt;However this kind of misses the nature of returns: in equity it is mostly the &lt;em&gt;total return&lt;/em&gt; from &quot;the principal&quot; (and a little from dividends); in bonds it is principally income from coupons (assuming holding to maturity).&lt;/li&gt;&#xA;&lt;li&gt;What if you trade bonds actively (utilising changes in interest rates, credit worthiness, etc.)? Could you expect ~10 % analogous to what you see in some equity strategies?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="11655" LastActivityDate="2017-11-15T11:11:55.160" Title="Returns on actively trading bonds compared to equity?" Tags="&lt;fixed-income&gt;&lt;expected-return&gt;&lt;active-investing&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36912" PostTypeId="2" ParentId="36911" CreationDate="2017-11-15T11:11:55.160" Score="1" Body="&lt;p&gt;Theoretically, actively trading bonds versus passively holding bonds shouldn't result in extra expected returns, assuming that you are holding on average more or less the same amount of bonds as before.  In other words , the expected returns on timing the marketplace with respect to interest rates and credit spreads are theoretically zero in an efficient market.  Obviously there are a lot of active fund managers around who disagree with that, otherwise they wouldn't be in business.  However there are also a lot of managers in many asset classes who have failed to beat a simple long only strategy in recent years.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-11-15T11:11:55.160" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36913" PostTypeId="1" CreationDate="2017-11-15T11:18:22.490" Score="1" ViewCount="310" Body="&lt;p&gt;I am in the prcess of carrying out intra-and intra sector analysis of US stocks, and am proxing sectors with sector ETFs. I therefore, need to catalog the list of US sector ETFs - but have been unable to source this (so far) online.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a definitive list online, of the set of US exchange listed Industry sector ETFs (ideally, the sectors should map 1-1 to the &lt;a href=&quot;http://www.ftserussell.com/financial-data/industry-classification-benchmark-icb&quot; rel=&quot;nofollow noreferrer&quot;&gt;ICB&lt;/a&gt; classification of industry groups) - i.e. something akin to the &lt;strong&gt;Euro STOXX sector indices&lt;/strong&gt;.&lt;/p&gt;&#xA;" OwnerUserId="1733" LastEditorUserId="1733" LastEditDate="2017-11-15T12:43:34.077" LastActivityDate="2020-02-04T08:37:40.517" Title="List of US Industry sector ETFs that map to ICB classification" Tags="&lt;equities&gt;&lt;data&gt;&lt;market-data&gt;&lt;etf&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="36915" PostTypeId="2" ParentId="36894" CreationDate="2017-11-15T15:05:40.093" Score="1" Body="&lt;p&gt;For an in-homogeneous Poisson process, the intensity process $\lambda_t$ is assumed to be deterministic. More generally, we can define $\tau$ to be the first jump time of a Cox process, or a conditional Poisson process (see Chapter 6 of the book &lt;a href=&quot;https://www.amazon.ca/Credit-Risk-Modeling-Valuation-Hedging/dp/3642087078&quot; rel=&quot;nofollow noreferrer&quot;&gt;Credit Risk&lt;/a&gt;). We assume that $t_0=0$ is the valuation date. Then the intensity process $\lambda_t$ can be stochastic, and &#xA;\begin{align*}&#xA;Q(t) \equiv P(\tau &amp;gt; t) = E\left(e^{-\int_{t_0}^t \lambda_s ds} \right).&#xA;\end{align*}&#xA;Moreover, given the independence assumption,&#xA;\begin{align*}&#xA;E\left(e^{-\int_{t_0}^{\tau} r_u du} \pmb{1}_{t_0&amp;lt;\tau&amp;lt;T} \right) &amp;amp;= E\left(E\left(e^{-\int_{t_0}^{\tau} r_u du} \pmb{1}_{t_0&amp;lt;\tau&amp;lt;T} \,|\, \tau \right)\right)\\&#xA;&amp;amp;=E\left(P(\tau) \pmb{1}_{\tau&amp;lt;T}\right)\\&#xA;&amp;amp;=-\int_{t_0}^TP(s) dQ(s),&#xA;\end{align*}&#xA;where &#xA;\begin{align*}&#xA;P(s) = E\left(e^{-\int_{t_0}^s r_u du}  \right)&#xA;\end{align*}&#xA;is the price of a zero-coupon bond with maturity $s$ and unit face value.&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;Comments: If we assume that $t_0&amp;gt;0$, then the whole question should be changed. For example, we need to define the filtration for the market information and the enlarged filtration generated by the process defining the default time as well as the market information. Moreover, certain &lt;em&gt;martingale invariance property&lt;/em&gt;, or $\mathcal{H}$-Hypothesis, should also be assumed.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="11678" LastEditorUserId="11678" LastEditDate="2017-11-15T15:57:43.397" LastActivityDate="2017-11-15T15:57:43.397" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="36918" PostTypeId="1" CreationDate="2017-11-15T15:34:30.780" Score="1" ViewCount="65" Body="&lt;p&gt;Let's say we have a time series for an illiquid future and we would like to replicate this time series using two time series for liquid futures using daily rebalancing. What would be a good approach to do that? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;My idea was to use linear regression to find the proportions of each liquid future. Then I would maintain these proportions throughout by daily rebalancing one future and then maybe do a weekly rebalancing on the second one. Does this make sense?&lt;/p&gt;&#xA;" OwnerUserId="29909" LastEditorUserId="29909" LastEditDate="2017-11-15T17:16:12.813" LastActivityDate="2017-11-15T17:16:12.813" Title="Creating a synthetic future" Tags="&lt;time-series&gt;&lt;futures&gt;&lt;rebalancing&gt;&lt;synthetic&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36919" PostTypeId="1" CreationDate="2017-11-15T18:14:16.287" Score="2" ViewCount="120" Body="&lt;p&gt;I have a question about this paper &quot;&lt;em&gt;Achieving higher order convergence for the prices of European options in binomial trees&lt;/em&gt;&quot; by Mark Joshi, (Link: &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=976561&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=976561&lt;/a&gt; ). In section 9 he proves that the Leisen-Reimer tree has second order convergence. In the following, an exponential expansion has been used:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$h^{-1}(z) = 0.5 + 0.5 \left[ 1-\exp \left( - \left( \frac{z}{n + \frac{1}{3} + \frac{0.1}{n+1}} \right)^2 \left( n+ \frac{1}{6} \right) \right) \right]^{\frac{1}{2}} \\ = \frac{1}{2} + \frac{1}{2} \frac{z}{\sqrt{n}} - \frac{z}{8n^{3/2}} - \frac{z^3}{8n^{3/2}} + \mathcal{O}(n^{-5/2})$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Furthermore, we have that $n=2k+1$. So we get &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$h^{-1}(z) = \frac{1}{2} + \frac{z}{2\sqrt{2}k^{1/2}} - \left( \frac{3}{16 \sqrt{2}} + \frac{1}{16 \sqrt{2}}z^3 \right) \frac{1}{k^{3/2}} + $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When I use exponential expansion, I am not able to get to the same result. Are there anyone who has an idea?&lt;/p&gt;&#xA;" OwnerUserId="30464" LastActivityDate="2017-11-15T18:14:16.287" Title="Second order convergence for the Leisen-Reimer tree" Tags="&lt;binomial-tree&gt;&lt;european-options&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36920" PostTypeId="1" AcceptedAnswerId="36942" CreationDate="2017-11-15T19:32:50.227" Score="7" ViewCount="2092" Body="&lt;p&gt;I would want to use QuantLib Python to calculate 6-month roll-down of a 5-year swap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I believe that the calculation I need to do is as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$Rolldown=r_{0,5Y}-r_{0,4.5Y}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where $r_{0,5Y}$ is the 5Y spot rate and $r_{0,4.5Y}$ is the 4Y spot rate.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can find the definition of roll-down in the following links:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://e-markets.nordea.com/api/research/attachment/2796&quot; rel=&quot;noreferrer&quot;&gt;https://e-markets.nordea.com/api/research/attachment/2796&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.gioa.us/presentations/2012/4-Rajappa.pdf&quot; rel=&quot;noreferrer&quot;&gt;http://www.gioa.us/presentations/2012/4-Rajappa.pdf&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Please let me know whether I got my equation correct.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming that my equation is correct, the following is how I tried to calculate roll-down of the swap using QuantLib Python:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;from QuantLib import *&#xA;&#xA;# global data&#xA;calendar = TARGET()&#xA;todaysDate = Date(6,November,2001);&#xA;Settings.instance().evaluationDate = todaysDate&#xA;settlementDate = Date(8,November,2001);&#xA;&#xA;# market quotes&#xA;deposits = { (1,Weeks): 0.0382,&#xA;             (1,Months): 0.0372,&#xA;             (3,Months): 0.0363,&#xA;             (6,Months): 0.0353,&#xA;             (9,Months): 0.0348,&#xA;             (1,Years): 0.0345 }&#xA;&#xA;swaps = { (2,Years): 0.037125,&#xA;          (3,Years): 0.0398,&#xA;          (5,Years): 0.0443,&#xA;          (10,Years): 0.05165,&#xA;          (15,Years): 0.055175 }&#xA;&#xA;# convert them to Quote objects&#xA;for n,unit in deposits.keys():&#xA;    deposits[(n,unit)] = SimpleQuote(deposits[(n,unit)])&#xA;for n,unit in swaps.keys():&#xA;    swaps[(n,unit)] = SimpleQuote(swaps[(n,unit)])&#xA;&#xA;# build rate helpers&#xA;&#xA;dayCounter = Actual360()&#xA;settlementDays = 2&#xA;depositHelpers = [ DepositRateHelper(QuoteHandle(deposits[(n,unit)]),&#xA;                                     Period(n,unit), settlementDays,&#xA;                                     calendar, ModifiedFollowing,&#xA;                                     False, dayCounter)&#xA;                   for n, unit in [(1,Weeks),(1,Months),(3,Months),&#xA;                                   (6,Months),(9,Months),(1,Years)] ]&#xA;&#xA;fixedLegFrequency = Annual&#xA;fixedLegTenor = Period(1,Years)&#xA;fixedLegAdjustment = Unadjusted&#xA;fixedLegDayCounter = Thirty360()&#xA;floatingLegFrequency = Semiannual&#xA;floatingLegTenor = Period(6,Months)&#xA;floatingLegAdjustment = ModifiedFollowing&#xA;swapHelpers = [ SwapRateHelper(QuoteHandle(swaps[(n,unit)]),&#xA;                               Period(n,unit), calendar,&#xA;                               fixedLegFrequency, fixedLegAdjustment,&#xA;                               fixedLegDayCounter, Euribor6M())&#xA;                for n, unit in swaps.keys() ]&#xA;&#xA;# term structure handles&#xA;&#xA;discountTermStructure = RelinkableYieldTermStructureHandle()&#xA;forecastTermStructure = RelinkableYieldTermStructureHandle()&#xA;&#xA;# term-structure construction&#xA;&#xA;helpers = depositHelpers + swapHelpers&#xA;depoSwapCurve = PiecewiseFlatForward(settlementDate, helpers, Actual360())&#xA;&#xA;swapEngine = DiscountingSwapEngine(discountTermStructure)&#xA;&#xA;# 5Y Swap &#xA;&#xA;nominal = 1000000&#xA;maturity1 = calendar.advance(settlementDate,5,Years)&#xA;&#xA;fixedLegFrequency = Annual&#xA;fixedLegAdjustment = Unadjusted&#xA;fixedLegDayCounter = Thirty360()&#xA;fixedRate = 0.04&#xA;&#xA;floatingLegFrequency = Semiannual&#xA;spread = 0.0&#xA;fixingDays = 2&#xA;index = Euribor6M(forecastTermStructure)&#xA;floatingLegAdjustment = ModifiedFollowing&#xA;floatingLegDayCounter = index.dayCounter()&#xA;&#xA;fixedSchedule1 = Schedule(settlementDate, maturity1,&#xA;                         fixedLegTenor, calendar,&#xA;                         fixedLegAdjustment, fixedLegAdjustment,&#xA;                         DateGeneration.Forward, False)&#xA;floatingSchedule1 = Schedule(settlementDate, maturity1,&#xA;                            floatingLegTenor, calendar,&#xA;                            floatingLegAdjustment, floatingLegAdjustment,&#xA;                            DateGeneration.Forward, False)&#xA;&#xA;spot1 = VanillaSwap(VanillaSwap.Receiver, nominal,&#xA;                   fixedSchedule1, fixedRate, fixedLegDayCounter,&#xA;                   floatingSchedule1, index, spread,&#xA;                   floatingLegDayCounter)&#xA;spot1.setPricingEngine(swapEngine)&#xA;&#xA;&#xA;# 4.5Y Swap &#xA;&#xA;rolldown_period = Period(6, Months)&#xA;&#xA;maturity2 = calendar.advance(maturity1, -rolldown_period)&#xA;&#xA;fixedSchedule2 = Schedule(settlementDate, maturity2,&#xA;                         fixedLegTenor, calendar,&#xA;                         fixedLegAdjustment, fixedLegAdjustment,&#xA;                         DateGeneration.Forward, False)&#xA;floatingSchedule2 = Schedule(settlementDate, maturity2,&#xA;                            floatingLegTenor, calendar,&#xA;                            floatingLegAdjustment, floatingLegAdjustment,&#xA;                            DateGeneration.Forward, False)&#xA;&#xA;spot2 = VanillaSwap(VanillaSwap.Receiver, nominal,&#xA;                   fixedSchedule2, fixedRate, fixedLegDayCounter,&#xA;                   floatingSchedule2, index, spread,&#xA;                   floatingLegDayCounter)&#xA;spot2.setPricingEngine(swapEngine)&#xA;&#xA;# price on two different evaluation dates&#xA;&#xA;discountTermStructure.linkTo(depoSwapCurve)&#xA;forecastTermStructure.linkTo(depoSwapCurve)&#xA;&#xA;spot5Y = spot1.fairRate()&#xA;spot4Y6M = spot2.fairRate()&#xA;&#xA;print('5Y spot rate')&#xA;print(spot5Y)&#xA;print('4.5Y spot rate')&#xA;print(spot4Y6M)&#xA;print('6 month roll down')&#xA;print(spot5Y - spot4Y6M)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Am I correct in how to use QuantLib Python to calculate 6-month roll-down of a 5-year swap? Is it necessary to create 2 swap objects like what I have done in order to calculate swap roll-down? &lt;/p&gt;&#xA;" OwnerUserId="30396" LastActivityDate="2017-11-17T16:42:38.290" Title="Use QuantLib Python to calculate roll-down of a swap" Tags="&lt;python&gt;&lt;quantlib&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="9" ContentLicense="CC BY-SA 3.0" />
  <row Id="36921" PostTypeId="2" ParentId="36888" CreationDate="2017-11-15T22:42:20.470" Score="1" Body="&lt;p&gt;No.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Implied vol as used in the market is purely a convention to express prices of vanilla options. The definition of implied vol is the number to plug into the Black-Scholes option pricing formula to get the right price for a vanilla option.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The fact that options at different strikes have different implied vols proves that the Black-Scholes dynamics (i.e. the assumption that spot follows a geometric Brownian motion) are incompatible with market pricing. If the Black-Scholes dynamics were correct, then the implied vol smiles would be constant.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Given that Black-Scholes market dynamics are incorrect, there is no reason they should give a correct price for any kind of path dependent option. Indeed market prices for barrier options do not match those that come from the Black-Scholes model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One cannot even define an &quot;implied vol&quot; analogue for barrier options.  This is because, unlike vanilla options, the Black-Scholes price of a barrier option is not necessarily monotonic in volatility. For low levels of volatility, the option price is near intrinsic value, but for high volatility there are counteracting effects of increased final payoff value but also increased probability of a barrier hit. The market price of the option may be higher than the highest possible Black-Scholes price. So there may be zero, one, or two levels of vol to correctly price the option.&lt;/p&gt;&#xA;" OwnerUserId="11936" LastEditorUserId="24222" LastEditDate="2017-11-16T09:21:13.150" LastActivityDate="2017-11-16T09:21:13.150" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36923" PostTypeId="1" CreationDate="2017-11-16T01:08:05.710" Score="3" ViewCount="522" Body="&lt;blockquote&gt;&#xA;  &lt;p&gt;Hello, I'm looking for suggestions and tweaks to my study plan. I'm planning to go down the list, and I hope to finish all of this in 2-3 years. &lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;For Starters &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Some general college level statistics and probability textbook&lt;/li&gt;&#xA;&lt;li&gt;John Hull's Options, Futures, and Other Derivatives.&lt;/li&gt;&#xA;&lt;li&gt;Mark Joshi's The Concepts and Practice of Mathematical Finance&lt;/li&gt;&#xA;&lt;li&gt;Martin Baxter and Andrew Rennie, Financial Calculus: An Introduction to Derivative Pricing&lt;/li&gt;&#xA;&lt;li&gt;Paul Wilmott Introduces Quantitative Finance - Paul Wilmott&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Coding&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.learncpp.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.learncpp.com/&lt;/a&gt; for C++&lt;/li&gt;&#xA;&lt;li&gt;More Effective C++: 35 New Ways to Improve Your Programs and Designs - Scott Meyers&lt;/li&gt;&#xA;&lt;li&gt;Learning Python the Hard Way by Zed Shaw&lt;/li&gt;&#xA;&lt;li&gt;R in a Nutshell by Joseph Adler&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Mathematical Finance&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;More Mathematical Finance by Mark Joshi&lt;/li&gt;&#xA;&lt;li&gt;Brownian Motion and Stochastic Calculus by Karatzas and Shreve&lt;/li&gt;&#xA;&lt;li&gt;Stochastic Differential Equations by Oksendal&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Time Series Analysis&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Time Series Analysis and Its Applications: With R Examples (Springer Texts in Statistics)&lt;/li&gt;&#xA;&lt;li&gt;Time Series: Theory and Methods - Peter Brockwell, Richard Davis&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;General Interview Books:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Heard on The Street: Quantitative Questions from Wall Street Job Interviews - Timothy Crack&lt;/li&gt;&#xA;&lt;li&gt;Frequently Asked Questions in Quantitative Finance - Paul Wilmott&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;I would appreciate hearing all opinions. Did I leave out an industry favorite, or the book that helped you the most? Did I focus too little or too much in a particular topic? Did I leave anything out? Is my timeframe for completing this reasonable? Thank you.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;" OwnerUserId="26721" LastActivityDate="2017-11-16T01:08:05.710" Title="Recommendations on Quant Study Path" Tags="&lt;quants&gt;" AnswerCount="0" CommentCount="3" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36924" PostTypeId="1" CreationDate="2017-11-16T11:10:19.693" Score="0" ViewCount="546" Body="&lt;p&gt;I am studying share price log returns and AR(1) model.&#xA;I downloaded data from $FTSE100$ and I used the Adj.close column to find the Ln returns: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/2LfaF.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/2LfaF.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/3gfR5.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/3gfR5.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now I am trying to understand how can I estimate an AR(1) model using this information.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand the AR(1) model. I did a couple of example in excel, but I do not understand how the ln returns are related to that. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;AR(1) is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X_t=\phi+\alpha*X_{t-1}+\epsilon$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I assume that I need to find values for $\phi$ and $\alpha$ to try to fit the AR(1) model but I am confused.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can anyone help me on this?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="30480" LastActivityDate="2017-11-16T11:18:56.760" Title="Estimate an AR(1) model from returns" Tags="&lt;time-series&gt;&lt;finance&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2017-12-03T11:48:08.080" ContentLicense="CC BY-SA 3.0" />
  <row Id="36925" PostTypeId="2" ParentId="36924" CreationDate="2017-11-16T11:18:56.760" Score="3" Body="&lt;p&gt;You're on the right track. The time series you're trying to fit is the one formed by the returns $X_t = \ln (P_{t}/P_{t-1})$, where $P_t$ the tabulated price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you calculate the returns just use a linear fit to estimate $\alpha$, $\phi$ and you're set. Probably you want to check $|\alpha|$ as well, it tells you something about the stationarity of the series&lt;/p&gt;&#xA;" OwnerUserId="29731" LastActivityDate="2017-11-16T11:18:56.760" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="36926" PostTypeId="1" CreationDate="2017-11-16T12:25:31.683" Score="1" ViewCount="97" Body="&lt;p&gt;I want to build a theoretical Portfolio with markowitz optimization for a course in University. The task is to build a Portfolio with low risk. So i want to do a CPPI strategy. Now the stock part of the Portfolio should contain stocks with small volatility. My thought is, that companies with big revenues (e.g blue chip stocks) are less volatile than stocks from younger and smaller companies. Am I right with my assumption and is there empirical evidence?&lt;/p&gt;&#xA;" OwnerUserId="29546" LastActivityDate="2017-11-16T12:25:31.683" Title="Volatility of stocks" Tags="&lt;equities&gt;&lt;portfolio-management&gt;&lt;portfolio-selection&gt;" AnswerCount="0" CommentCount="11" ContentLicense="CC BY-SA 3.0" />
  <row Id="36927" PostTypeId="1" AcceptedAnswerId="36929" CreationDate="2017-11-16T13:58:24.497" Score="4" ViewCount="752" Body="&lt;p&gt;In the real practice, do we use &lt;code&gt;Monte Carlo&lt;/code&gt; or &lt;code&gt;finite difference method&lt;/code&gt; of PDE to price the &lt;code&gt;Basket option&lt;/code&gt;(say 20 underlyings)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And could you show some reasons in detail. &lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2019-03-20T12:27:09.303" Title="use Monte Carlo or FDM to price Basket option" Tags="&lt;options&gt;&lt;option-pricing&gt;" AnswerCount="3" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36929" PostTypeId="2" ParentId="36927" CreationDate="2017-11-16T14:04:34.863" Score="5" Body="&lt;p&gt;Multidimensional finite differences (such as ADI schemes) are only practical up to 3 dimensions, higher dimension are too demanding in terms of computer memory and computing time. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;For higher order problems Monte Carlo is usually the method of choice. Using low discrepancy quasi random suites (e.g. Sobol) along with the Brownian bridge technique leads to reasonable computing times.  See for instance Jaeckel's book &quot;monte carlo methods in finance&quot;. &lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2017-11-16T14:04:34.863" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="36930" PostTypeId="2" ParentId="36927" CreationDate="2017-11-16T15:56:05.173" Score="1" Body="&lt;p&gt;Quasi Monte Carlo (QMC) as suggested by Antoine's answer will work fine if you're not planning on having a portfolio of these things to deal with.  If you're on the buy side or just playing around, go with QMC.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For more serious applications, the answers to this question: &lt;a href=&quot;https://quant.stackexchange.com/questions/4738/basket-option-pricing-step-by-step-tutorial-for-beginners/4761#4761&quot;&gt;Basket option pricing: step by step tutorial for beginners&lt;/a&gt; include the most common industry practices of&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Moment matching (&lt;a href=&quot;https://www.feweb.vu.nl/en/Images/AmericanBasketOptions_tcm258-194676.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;link to a paper&lt;/a&gt;), and&lt;/li&gt;&#xA;&lt;li&gt;Proxy volatilities&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;along with a suggestion by Choi (2018), which I have not reviewed, that a quadrature schemes works best (according to &lt;a href=&quot;https://doi.org/10.1002/fut.21909&quot; rel=&quot;nofollow noreferrer&quot;&gt;his paper of 2018&lt;/a&gt; [&lt;a href=&quot;http://arxiv.org/abs/1805.03172&quot; rel=&quot;nofollow noreferrer&quot;&gt;Arxiv&lt;/a&gt;]).  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Moment matching and proxies achieve the necessary level of accuracy in a (very) small fraction of the computation time a QMC scheme would require.&lt;/p&gt;&#xA;" OwnerUserId="254" LastEditorUserId="26559" LastEditDate="2018-08-03T13:32:27.023" LastActivityDate="2018-08-03T13:32:27.023" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="36931" PostTypeId="1" CreationDate="2017-11-16T17:03:37.237" Score="2" ViewCount="2596" Body="&lt;p&gt;Given the following stochastic process:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dX = a(X,t)dt + b(X,t)dz $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ dz = A \sqrt{dt}$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;and $A$ is a random variable with mean zero and variance $1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a way to calculate the expected value of $X$ at some time $t$? My suspection is that it is simply the integral of the expected value of $dX$. However, the function impacts its own expected value, so I could also imagine that the answer is very different. Any help here?&#xA;Thanks :)&lt;/p&gt;&#xA;" OwnerUserId="28336" LastEditorUserId="20454" LastEditDate="2017-11-16T18:13:47.457" LastActivityDate="2017-11-18T17:55:38.883" Title="Expected Value of Stochastic Process" Tags="&lt;stochastic-processes&gt;&lt;stochastic&gt;&lt;expected-value&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36933" PostTypeId="1" CreationDate="2017-11-16T19:37:22.180" Score="2" ViewCount="104" Body="&lt;p&gt;Does anyone know where I can find (at least 10 years worth of) end of day historical &lt;code&gt;(op, hi, lo, cl)&lt;/code&gt; data for the FTSE 350 Sector Indices?.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I need the data for private/personal research so I'm looking for either a free, or inexpensive source. &lt;/p&gt;&#xA;" OwnerUserId="1733" LastActivityDate="2017-11-16T19:37:22.180" Title="FTSE 350 sector index historical data" Tags="&lt;equities&gt;&lt;data&gt;&lt;market-data&gt;&lt;historical-data&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36934" PostTypeId="1" AcceptedAnswerId="36995" CreationDate="2017-11-17T00:16:09.123" Score="1" ViewCount="376" Body="&lt;p&gt;Once the yield matrix has been computed, the eigenvectors must be calculated to project the yield matrix on the 3 main dimensions. Tehen is wasted to calculate the yield matrix to be used for the simulation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Until this point is clear, but in the next phase I can not understand how the simulation is performed. Can you know what steps are needed to simulate? I tried searching on the internet but I can not find clear and precise information about it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you for availability&lt;/p&gt;&#xA;" OwnerUserId="30494" LastActivityDate="2017-11-22T16:39:32.423" Title="Simulation curves; PRIIPS category 3" Tags="&lt;yield-curve&gt;&lt;simulations&gt;&lt;priips&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36935" PostTypeId="1" CreationDate="2017-11-17T04:55:08.683" Score="2" ViewCount="357" Body="&lt;p&gt;I am looking for a survey book on general hedge fund strategies, preferably on the quantitaitive side. An ideal book would survey common hedge fund strategies (e.g. fixed income arb, volatility arb) and be somewhat on the technical side.&lt;/p&gt;&#xA;" OwnerUserId="26509" LastActivityDate="2018-03-24T15:42:49.313" Title="Reference request: hedge fund strategies" Tags="&lt;reference-request&gt;&lt;hedge-fund&gt;" AnswerCount="2" CommentCount="4" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36936" PostTypeId="1" CreationDate="2017-11-17T10:58:51.627" Score="3" ViewCount="114" Body="&lt;p&gt;I am a bit fuzzy about difference between compounded poisson process defined as &#xA;$$\sum_{i=1}^{N_t} D_i $$&#xA;where $N_t$ is poisson process and $ D_i $ are iid random variables&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and marked poisson process. Is compounded poisson a version of marked process $ \{(\tau_i, D_i), i \in \mathbb{N} \}$ ?&lt;/p&gt;&#xA;" OwnerUserId="22424" LastActivityDate="2017-11-17T10:58:51.627" Title="Marked poisson process vs compounded" Tags="&lt;jump&gt;&lt;poisson&gt;&lt;poisson-process&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36937" PostTypeId="1" AcceptedAnswerId="37005" CreationDate="2017-11-17T15:07:24.980" Score="0" ViewCount="3110" Body="&lt;p&gt;I am building a curve using par swaps rates. For example, I have the following two semi-annual swaps for input&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;Duration   start          end            rate   &#xA;1year      14-Nov-2011    14-Nov-2012    0.58%&#xA;2year      14-Nov-2011    14-Nov-2013    0.60%&#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;and I want to build a curve for &lt;code&gt;10-Nov-2011&lt;/code&gt;. I don't know how to calculate discount factor for &lt;code&gt;14-Nov-2011&lt;/code&gt;, since I don't know how to choose a rate for period from &lt;code&gt;10-Nov-2011&lt;/code&gt; until &lt;code&gt;14-Nov-2011&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Does anyone know how to find discount factor for &lt;code&gt;14-Nov-2011&lt;/code&gt;?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Additional info:&lt;/strong&gt; For previous input the curve looks like&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&#xA;Date     , Discount factor&#xA;10-Nov-11, 1                  &#xA;14-Nov-11, 0.999935743789455  ???&#xA;14-May-12, 0.997012282219702  &#xA;14-Nov-12, 0.99406543047691   &#xA;15-Nov-12, 0.993981821851122  &#xA;15-May-13, 0.990959091324625  &#xA;15-Nov-13, 0.987828512874748  &#xA;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;generated with parameters: &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Accrual method: &lt;em&gt;Actual/360&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Interpolation to use durring bootstrapping: &lt;em&gt;Linear from spot rates&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Swap bootstrapping method: &lt;em&gt;Linear spot rates&lt;/em&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;In my calculation, if we choose rate &lt;code&gt;0.58%&lt;/code&gt; than the discount factor for &lt;code&gt;14-Nov-11&lt;/code&gt; would be:&#xA;$$\textrm{discount factor} = \frac{1}{1+rate\times accrual} = \frac{1}{1+\frac{0.58}{100} \times \frac{4}{360}} = 0.99993555970837$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is not the correct value. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Additionally, when I try to reproduce the rate which is used to build the curve I already have, I get:&#xA;$$ rate = \frac{1-discount factor}{discount factor \times accrual} = \frac{1-0.999935743789455}{0.999935743789455 \times \frac{4}{360}}= 0.57834\%$$&lt;br&gt;&#xA;but it is unclear to me how can I get this rate from input data.&lt;/p&gt;&#xA;" OwnerUserId="13360" LastActivityDate="2017-11-21T13:18:29.003" Title="In curve building: How to calculate interest rate (discount factor) for period before first known effective date" Tags="&lt;swaps&gt;&lt;interest-rate-swap&gt;&lt;discount-factor-curve&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="36938" PostTypeId="2" ParentId="36937" CreationDate="2017-11-17T15:28:12.157" Score="1" Body="&lt;p&gt;Your valuation date is $t=$ Thu 10-Nov-11. The swaps start on the spot date which is $t + 2$ business days = Mon 14-Nov-11. The usual approach is to extrapolate between $t$ and the first curve pillar, in a manner consistent with the interpolation method that you are using for representing your discount curve. For instance if you use linear interpolation of zero coupon rates then you might want to use linear extrapolation of zero coupon rates. Alternatively some systems use flat extrapolation, it won't make much of a difference for the short end of the curve. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that to get a richer curve you probably want to add short term instruments, such as weekly and monthly maturities swaps for the OIS discount curve, or FRAs or futures for the Libor projection curves. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;A quick note on bootstrapping: when bootstrapping you are making some interpolation assumptions (because you need discount factors for the swaps semi-annual cash flows). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The common approach is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;sort your N instruments by increasing maturity. &lt;/li&gt;&#xA;&lt;li&gt;transform the instruments maturities into N time pillars. &lt;/li&gt;&#xA;&lt;li&gt;choose a curve interpolation/extrapolation method, so that you can view you curve as depending on N parameters (e.g. N zero coupon rates if you choose to interpolate zero coupon rates). &lt;/li&gt;&#xA;&lt;li&gt;View your bootstrapping problem as finding N parameters to match N prices. &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;This looks like an N dimensional problem, but as long as your interpolation is such that the curve up to maturity T does not depend on pillars &gt; T (i.e. linear interpolation which is local is fine, but splines which are global are not fine) then the N dimensional problem reduces to a sequence of N one dimensional problems which are easily solved. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The advantage of this approach is that you can use any mix of instruments into your bootstrapping. &lt;/p&gt;&#xA;" OwnerUserId="17606" LastEditorUserId="17606" LastEditDate="2017-11-17T16:07:28.410" LastActivityDate="2017-11-17T16:07:28.410" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="36939" PostTypeId="1" CreationDate="2017-11-17T15:49:17.003" Score="2" ViewCount="379" Body="&lt;p&gt;Ciao All.&#xA;I'm studying the CIR model and this question came out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Usually the Ornstein-Uhnlenbeck dynamic is used to build the CIR model:&#xA;let&#xA;$$&#xA;dX_t = aX_t + \sigma dW_t&#xA;$$ &#xA;where $a \in \mathbb{R}$ and $\sigma &amp;gt;0$. Then if we call $Y_t = X_t^2$ we get:&#xA;$$&#xA;dY_t = \left(\sigma^2 + 2aY_t \right) dt + 2 \sqrt{Y_t} \sigma dW_t&#xA;$$&#xA;which is a CIR dynamic. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Starting from now we will use the usual notation:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;dY_t = a \left( b-Y_t \right)dt + \sigma \sqrt{Y_t} dW_t.&#xA;\end{equation}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course $Y_t$ is positive a.e. since it's equal to $X_t^2$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is about the condition&#xA;$$&#xA;ab &amp;gt; 2 \sigma^2&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In fact according to many papers this is enough to make $Y_t$ positive.&#xA;Can you give a proof of this fact?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&#xA;Ciao!&lt;/p&gt;&#xA;" OwnerUserId="26793" LastActivityDate="2017-11-17T15:49:17.003" Title="Proof positiveness condition CIR dynamic" Tags="&lt;interest-rates&gt;&lt;stochastic-processes&gt;&lt;models&gt;" AnswerCount="0" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36940" PostTypeId="2" ParentId="36931" CreationDate="2017-11-17T16:01:45.903" Score="2" Body="&lt;p&gt;If you write the SDE in the integral form everything should be straightforward:&#xA;$$&#xA;X_t = X_0 + \int_0^t a(X_s, s) ds + \int_0^t b(X_s, s) dz_s &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you now take the expected value the third term disappear since $A$ has  $0$ mean (and by definition of the integral of stochastic process).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At the end you obtain:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\mathbb{E} \left[ X_t\right] = X_0 + \int_0^t \mathbb{E} \left[ a(X_s, s) \right] ds.&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now the explicit computation depends on the structure of the term  $a$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ciao!&lt;/p&gt;&#xA;" OwnerUserId="26793" LastEditorUserId="26793" LastEditDate="2017-11-18T17:55:38.883" LastActivityDate="2017-11-18T17:55:38.883" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36941" PostTypeId="2" ParentId="36920" CreationDate="2017-11-17T16:37:17.913" Score="3" Body="&lt;p&gt;Don't use the Nordea piece - it's not correct. Let me explain why;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If rolldown is the assumption that the IRS curve remains static through time then for a 5Y IRS you have two components; the first fixing, i.e. 0.5Y part which is known, and the 0.5Y4.5Y fwd IRS, which is floating and yet to fix.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If, through rolldown, you assume that the 0.5Y4.5Y IRS will converge to the current 0Y4.5Y IRS then that is what you should be subtracting in order to obtain the number of basis points that are applicable to the portion of risk that exists for the extent of the 0.5Y4.5Y swap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't know why carry and rolldown are so poorly and universally misunderstood in finance but many research pieces from banks are wrong or, if not wrong, poorly conceived and overly complicated. If you want to read accurate details for IRSs consider &quot;pricing and trading interest rate derivatives: a pratical guide to swaps&quot; by JHM Darbyshire, and also take a look at these other answers...&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/35795/carry-calculation-on-an-interest-rate-swap/35897#35897&quot;&gt;Carry calculation on an interest rate swap&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/36253/question-on-pure-carry-for-two-bonds?noredirect=1&amp;amp;lq=1&quot;&gt;Question on pure carry for two bonds&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://quant.stackexchange.com/questions/25329/question-regarding-carry-roll-of-a-bond?noredirect=1&amp;amp;lq=1&quot;&gt;question regarding carry &amp;amp; roll of a bond&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="29443" LastActivityDate="2017-11-17T16:37:17.913" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36942" PostTypeId="2" ParentId="36920" CreationDate="2017-11-17T16:42:38.290" Score="5" Body="&lt;p&gt;No, I think you're getting a wrong figure.  The general idea might work, but the construction of the second swap must be changed.  (Or you can use just one swap; I'll get to that later.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As I read the documentation you linked, the idea of the second swap would be to model the first swap after 6 months have passed.  However, let's look at the two swaps.  I'll define a helper function to look at their coupons:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;def show_cashflows(leg):&#xA;    for c in leg:&#xA;        print '%20s | %s | %.4f%%' % (c.date(), c.amount(),&#xA;                                      as_coupon(c).rate()*100)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is what the fixed leg of the 5-years swap pays...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;show_cashflows(spot1.fixedLeg())&#xA;&#xA; November 8th, 2002 | 40000.0 | 4.0000%&#xA;November 10th, 2003 | 40000.0 | 4.0000%&#xA; November 8th, 2004 | 40000.0 | 4.0000%&#xA; November 8th, 2005 | 40000.0 | 4.0000%&#xA; November 8th, 2006 | 40000.0 | 4.0000%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...and here is the floating leg:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;show_cashflows(spot1.floatingLeg())&#xA;&#xA;      May 8th, 2002 | 17748.0555555 | 3.5300%&#xA; November 8th, 2002 | 16930.6254304 | 3.3125%&#xA;      May 8th, 2003 | 19219.7194265 | 3.8227%&#xA;November 10th, 2003 | 19755.8616671 | 3.8237%&#xA;     May 10th, 2004 | 22498.6599297 | 4.4503%&#xA; November 8th, 2004 | 22498.6599297 | 4.4503%&#xA;      May 9th, 2005 | 25550.9745581 | 5.0540%&#xA; November 8th, 2005 | 25693.1528497 | 5.0544%&#xA;      May 8th, 2006 | 25408.8159749 | 5.0537%&#xA; November 8th, 2006 | 25835.3508522 | 5.0547%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Your second swap should give you the same coupons, as seen from an evaluation date 6 months later.  The floating leg looks the same, except that one coupon is gone:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;show_cashflows(spot2.floatingLeg())&#xA;&#xA;      May 8th, 2002 | 17748.0555555 | 3.5300%&#xA; November 8th, 2002 | 16930.6254304 | 3.3125%&#xA;      May 8th, 2003 | 19219.7194265 | 3.8227%&#xA;November 10th, 2003 | 19755.8616671 | 3.8237%&#xA;     May 10th, 2004 | 22498.6599297 | 4.4503%&#xA; November 8th, 2004 | 22498.6599297 | 4.4503%&#xA;      May 9th, 2005 | 25550.9745581 | 5.0540%&#xA; November 8th, 2005 | 25693.1528497 | 5.0544%&#xA;      May 8th, 2006 | 25408.8159749 | 5.0537%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(It looks like the last coupon is gone, not the first; but that's because you're assuming that the curve stays the same and shifts in time, and therefore the fixings of the second coupon in six months will equal the fixing of the first coupon now.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, here's what the fixed leg looks like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;show_cashflows(spot2.fixedLeg())&#xA;&#xA; November 8th, 2002 | 40000.0 | 4.0000%&#xA;November 10th, 2003 | 40000.0 | 4.0000%&#xA; November 8th, 2004 | 40000.0 | 4.0000%&#xA; November 8th, 2005 | 40000.0 | 4.0000%&#xA;      May 8th, 2006 | 20000.0 | 4.0000%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since you created a 4.5 years schedule, the last coupon is shorter and is missing half the amount.  This, of course, causes the fair rate to be off.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;print spot2.fairRate()&#xA;&#xA;0.0434536470094&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You have a couple of ways to fix this.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First, instead of creating a 4.5 years swap, you can create a 5-years swap starting 6 months in the past:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;issue2 = calendar.advance(settlementDate, -rolldown_period)&#xA;maturity2 = calendar.advance(issue2, 5, Years)&#xA;&#xA;fixedSchedule2 = Schedule(issue2, maturity2,&#xA;                         fixedLegTenor, calendar,&#xA;                         fixedLegAdjustment, fixedLegAdjustment,&#xA;                         DateGeneration.Forward, False)&#xA;floatingSchedule2 = Schedule(issue2, maturity2,&#xA;                            floatingLegTenor, calendar,&#xA;                            floatingLegAdjustment, floatingLegAdjustment,&#xA;                            DateGeneration.Forward, False)&#xA;&#xA;swap3 = VanillaSwap(VanillaSwap.Receiver, nominal,&#xA;                    fixedSchedule2, fixedRate, fixedLegDayCounter,&#xA;                    floatingSchedule2, index, spread,&#xA;                    floatingLegDayCounter)&#xA;swap3.setPricingEngine(swapEngine)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now the fixed leg pays the correct amounts...&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;show_cashflows(swap3.fixedLeg())&#xA;&#xA;     May 8th, 2002 | 40000.0 | 4.0000%&#xA;     May 8th, 2003 | 40000.0 | 4.0000%&#xA;    May 10th, 2004 | 40000.0 | 4.0000%&#xA;     May 9th, 2005 | 40000.0 | 4.0000%&#xA;     May 8th, 2006 | 40000.0 | 4.0000%&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;...and the fair rate changes accordingly.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;print swap3.fairRate()&#xA;&#xA;0.0387677146311&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The second way to fix it is, as you suggested, to use a single swap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can build the term structure so that it moves with the evaluation date; instead of passing the reference date explicitly, tell the curve that the reference date should be two business days after the evaluation date.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;depoSwapCurve = PiecewiseFlatForward(2, TARGET(), helpers, Actual360())&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The rest of the initialization stays the same.  With this setup, you can simply ask the fair rate of the swap &lt;code&gt;spot1&lt;/code&gt; at two different evaluation dates:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Settings.instance().evaluationDate = todaysDate&#xA;print spot1.fairRate()&#xA;&#xA;0.0443&#xA;&#xA;Settings.instance().evaluationDate = calendar.advance(todaysDate, 6, Months)&#xA;print spot1.fairRate()&#xA;&#xA;0.038847797035&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;(The fair rate after 6 months is similar, but not quite the same as the one calculated in the first way. It's probably due to the curve being a bit different due; the tenors of the deposits used for bootstrapping might equal a different number of days depending on the spot date.)&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2017-11-17T16:42:38.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36943" PostTypeId="1" AcceptedAnswerId="36945" CreationDate="2017-11-17T17:10:38.080" Score="3" ViewCount="1603" Body="&lt;p&gt;A &lt;a href=&quot;https://quant.stackexchange.com/questions/10960/usage-of-brownian-bridge&quot;&gt;similar question&lt;/a&gt; has already been asked in the past, unfortunately the 2nd question of the OP was never really addressed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most references found on internet on Brownian Bridge and Monte-Carlo simulations seem to relate to Quasi-Monte-Carlo methods and look general and academic in nature. However, in the mentioned question it is said that Brownian Bridge &quot;[...] &lt;em&gt;could reduce the computation effort on path-dependent derivatives. For example, during pricing of a barrier option, a path could be simulated with monthly scenarios of the factors; then&lt;/em&gt; [a Brownian Bridge] &lt;em&gt;could be used to estimate the probability of the path 'knock-out' of the barrier.&lt;/em&gt;&quot; This seems to be a &quot;&lt;em&gt;practitioner's trick&lt;/em&gt;&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is anybody familiar with this technique/trick and, if so, could she/he explain it briefly?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Alternatively, does anyone has any reference to this topic, if possible openly available on internet (paper, etc.)?&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have an idea on how the Brownian Bridge could be used to speed-up Monte Carlo pricing for some specific path-dependent payoffs (like barriers) but I was wondering if anybody has more knowledge on this, there does not seem to be references in internet. &lt;/p&gt;&#xA;" OwnerUserId="20454" LastActivityDate="2017-11-17T22:31:07.940" Title="How are Brownian Bridges used in derivatives pricing in practice?" Tags="&lt;option-pricing&gt;&lt;monte-carlo&gt;&lt;brownian-motion&gt;&lt;simulations&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36945" PostTypeId="2" ParentId="36943" CreationDate="2017-11-17T20:10:14.360" Score="8" Body="&lt;p&gt;Yes, the term Brownian Bridge seems to be used loosely. I assume you are talking about continuously monitored barriers by the way, since you mention the probability of the barrier being crossed in between the path time points. If that's the case then &quot;naive&quot; Monte Carlo simulation will have what is called &quot;simulation bias&quot;. That's exactly because the simulated process could hit the barrier in between path time points but the simulation will naturally &quot;miss out&quot; on such events. And somewhat counter-intuitively, this bias can be very large: even if one uses say daily time steps for the simulated paths, this naive MC barrier price can still be 30% or 40% off (!) compared to the true continuous barrier price (see second link below for such examples).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, I'm guessing that when we are talking about BB reducing the computational effort when pricing barrier options, what is meant is that it can do so by enabling a more accurate price for continuous barriers without the need to use a ridiculous amount of time steps/points. Right, now this is called the Brownian bridge technique because it uses the probability of Brownian motion hitting a point conditional on two fixed end points.&#xA;Such probability formulas are only available for Brownian Motion and Geometric Brownian Motion, so this technique can be used for something simple like Black Scholes and actually remove the simulation bias completely. But it can also be used for other processes with good results. Anytime we use the Euler discretization scheme for example, the simulated process becomes locally BM.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I will not expand here further but here's a reference that describes this technique and more (and has the probability formulas)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://hal.univ-grenoble-alpes.fr/hal-00319947/document&quot; rel=&quot;noreferrer&quot;&gt;Advanced Monte Carlo methods for barrier and related exotic options - Emmanuel Gobet&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And in the link below you can see this technique applied to MC pricing of continuously monitored barriers under Black-Scholes (only of academic interest, perfect accuracy) and the Heston model (of more practical interest, technique still seems very effective).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://www.acenumerics.com/miscellaneous/monte-carlo-pricing-of-continuously-monitored-barrier-options-with-heston&quot; rel=&quot;noreferrer&quot;&gt;Monte Carlo pricing of continuous barrier options with Heston&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Of course there may be other ways a BB-related method can help with MC simulation of path-dependent options that I'm not aware of.&lt;/p&gt;&#xA;" OwnerUserId="19373" LastEditorUserId="19373" LastEditDate="2017-11-17T22:31:07.940" LastActivityDate="2017-11-17T22:31:07.940" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36946" PostTypeId="1" CreationDate="2017-11-17T20:24:56.033" Score="2" ViewCount="446" Body="&lt;p&gt;I am new to mean reversion, and I'd like to run an analysis on a fund (ts with monthly returns only) to see if mean reversion applies and if so, when it will happen.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Most of the examples I found focus on cointegrated securities. Ornstein-Uhlenbeck seems to be a popular model for mean reversion estimate. If someone could please provide me an example of applying OU model on a return-only time series or point me to the right direction, I will really appreciate it!&lt;/p&gt;&#xA;" OwnerUserId="26571" LastActivityDate="2017-11-20T00:36:17.847" Title="R Mean Reversion Estimate on Funds" Tags="&lt;time-series&gt;&lt;programming&gt;&lt;mean-reversion&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36947" PostTypeId="2" ParentId="36935" CreationDate="2017-11-17T20:57:56.260" Score="1" Body="&lt;p&gt;&quot;Active Equity Management&quot; gives a decent coverage for US equities.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://rads.stackoverflow.com/amzn/click/0692297774&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.amazon.com/Active-Equity-Management-Xinfeng-Zhou/dp/0692297774/ref=sr_1_fkmr2_1?ie=UTF8&amp;amp;qid=1510952220&amp;amp;sr=8-1-fkmr2&amp;amp;keywords=active+portfolio+management+quantitative+theory+and+applications&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="1552" LastActivityDate="2017-11-17T20:57:56.260" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36949" PostTypeId="1" CreationDate="2017-11-17T22:50:42.197" Score="1" ViewCount="181" Body="&lt;p&gt;I am trying to solve the following problem from a Quant exam (abridged):&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;You have 1000 USD. You can only invest in two (independent) stocks, A and B, with&#xA;  the annualized expected returns and volatilities given. Interest rates&#xA;  are zero. Find the fully invested portfolio that minimizes the&#xA;  portfolio volatility.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Then theres the hint, apparently to make calculations easier: &quot;&lt;strong&gt;Ignore also the differences between normal and log-normal distributions&lt;/strong&gt;.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is about the hint, I am not sure if I interpret it correctly: I would use the fact that for an infinitesimal time step $\mathrm d t$ we have for a stock price $$\frac{\mathrm d S}{S} \sim N(\mu\, \mathrm d t, \sigma^2\,\mathrm d t),$$ which follows from the model of a stock price as a geom. Brownian motion. As a consequence, for a sufficiently small time step $\delta t$ this would imply that &lt;em&gt;approximately&lt;/em&gt; $$S(\delta t) \sim N((1+\mu) S(0)\delta t, \sigma^2S(0)^2\delta t).$$ The way I would interpret the hint is that I should work with this approximation, instead of using that $S(\delta t)$ is actually (but yet almost inperceivably) log-normally distributed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Is my interpretation correct?&lt;/strong&gt; I am interested if I understand the hint correctly from a stochastic point of view.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then, with $\mu_A = 0.1, \mu_B = 0.15, \sigma_A = 0.1$ and $\sigma_B = 0.2$, I would obtain the following: If I invest $\lambda_A$ USD into stock A, and $1000-\lambda_A$ into stock B, then the portfolio value $\Pi$ after $\delta t$ would approximately be distributed as&#xA;$$\Pi(\delta t) \sim N\big([1.1\lambda_A +1.15(1000-\lambda_A)]\delta t, [0.01\lambda_A^2+0.04(1000-\lambda_A)^2]\delta t).$$&#xA;From this, I would directly obtain:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The expected profit of the portfolio is maximized if the portfolio consists entirely of stock B (i.e. $\lambda_A = 0$).&lt;/li&gt;&#xA;&lt;li&gt;The portfolio volatility would be minimized if I invested 800 USD in stock A and 200 USD in stock B (i.e. $\lambda_A = 800$).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I am interested in properly understanding the underlying mathematics, and not so much in applying a formula I don't understand.&lt;/p&gt;&#xA;" OwnerUserId="30502" LastEditorUserId="30502" LastEditDate="2017-12-15T15:25:14.917" LastActivityDate="2017-12-15T15:25:14.917" Title="Ignore the difference between normal and log-normal distributions" Tags="&lt;portfolio-optimization&gt;&lt;brownian-motion&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36953" PostTypeId="1" AcceptedAnswerId="36958" CreationDate="2017-11-18T15:47:45.310" Score="3" ViewCount="429" Body="&lt;p&gt;I'm trying to solve portfolio problem with minimising its Expected shortfall, assuming the returns follow a stable distribution. If I'm able to calculate MLE fit to the series, calculate expected shortfall of that instrument, then how would I optimise the portfolio? I've read for &lt;a href=&quot;http://www.imes.boj.or.jp/english/publication/mes/2002/me20-1-4.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;instance here&lt;/a&gt; it is then linear programming problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried to calculate ES of each of my instrument and then optimize the objective function &lt;code&gt;weights*ES&lt;/code&gt;, but I always get minimum for vector weights 0, which makes sense, that's when its lowest. But that's of course not what I want, what is it that I'm missing? Is it good idea to take code which calculates this for normally distributed returns and just replace the function which calculates the actual ES?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks a lot&lt;/p&gt;&#xA;" OwnerUserId="22237" LastActivityDate="2017-11-19T16:18:34.190" Title="Expected shortfall minimization as portfolio objective" Tags="&lt;portfolio-management&gt;&lt;risk-management&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36954" PostTypeId="1" CreationDate="2017-11-18T15:53:37.307" Score="4" ViewCount="392" Body="&lt;p&gt;I recently stumbled upon a paper titled &quot;Markov Chain Monte Carlo Analysis of Option Pricing Models&quot; thanks to another post on this site (see: &lt;a href=&quot;https://quant.stackexchange.com/questions/2137/reference-on-markov-chain-monte-carlo-method-for-option-pricing/2142#2142&quot;&gt;link&lt;/a&gt;). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have the ultimate goal of implementing a MCMC algorithm for pricing FX options and in the process of doing so would like to write a brief and &quot;simple&quot; paper/set of notes on how to do so (which also covers the preliminary mathematics). The aforementioned paper has been incredibly insightful yet it doesn't cover much on the implementation side of the matter.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I found that this chapter of a book is perfect for all the preliminary mathematics: &lt;a href=&quot;http://www.mcmchandbook.net/HandbookChapter1.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;MCMC Handbook: Chapter 1&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So I have two questions:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Can anyone point me in the direction of relevant literature about&#xA;MCMC in the context of FX options or something a bit more general&#xA;regarding MCMC w.r.t. options? And, &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;If such literature about MCMC for FX options doesn't exist, do you&#xA;think such a paper would be of any value other than that of a&#xA;learning exercise for myself?&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="28544" LastActivityDate="2017-11-20T18:30:29.797" Title="Markov chain Monte Carlo Analysis of FX Options" Tags="&lt;option-pricing&gt;&lt;fx&gt;&lt;monte-carlo&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="36956" PostTypeId="1" CreationDate="2017-11-18T20:33:00.617" Score="4" ViewCount="978" Body="&lt;p&gt;Is there any data out there on the Fama and French (1993) paper? I am not talking about their factor data available on their website, I am interested in reproducing their factor calculations. I am trying to replicate their research, such as the SMB, HML calculations given on their &lt;a href=&quot;http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/Data_Library/f-f_bench_factor.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;website&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have requested access to WRDS which would give me access to the CRSP and Compustat data, then I believe that I should be fine to replicate their research but I was just wondering if the returns data from NYSE, AMEX and NASDAQ from July 1963 - Dec 1991 was available online.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Example of the data:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;        Mkt-RF     SMB     HML      RF&#xA;199007    0.86    0.77   -0.25    0.68&#xA;199008  -10.82   -1.60    0.60    0.66&#xA;199009  -11.97    1.22    0.80    0.60&#xA;199010    9.56   -7.38   -4.24    0.68&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I would like to calculate myself the SMB and HML factors.&lt;/p&gt;&#xA;" OwnerUserId="30516" LastActivityDate="2017-12-01T23:40:39.943" Title="Fama and French data: Replicating research" Tags="&lt;finance&gt;&lt;fama-french&gt;&lt;yahoofinance&gt;&lt;financial-markets&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36957" PostTypeId="2" ParentId="36956" CreationDate="2017-11-18T21:52:32.807" Score="3" Body="&lt;p&gt;Your best shot is really to get WRDS. If you get access you can replicate their research in few minutes (there is SAS code out there). &#xA;It's unlikely that you will be given the data for free. That data is actually expensive. That being said, any university with an econ of finance department has access to that data and gives it to students for free. So if you are enrolled in any sort of higher education program you should manage to get access to it fairly easily. &lt;/p&gt;&#xA;" OwnerUserId="16472" LastActivityDate="2017-11-18T21:52:32.807" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="36958" PostTypeId="2" ParentId="36953" CreationDate="2017-11-19T01:56:27.510" Score="3" Body="&lt;p&gt;The ES of the optimized portfolio is (except in trivial cases) not the same as the weighted sum to the ES of the individual instruments; your objective function should be the expected shortfall of the weighted sum of the losses, not the weighted sum of the expected shortfalls of the individual instruments. (So it is an integral over the weighted sum of instrument losses.) This is equation (20) or (21) in the paper you linked. Minimization is facilitated by breaking this into two pieces (shown as equations (22) and (23)) by introducing the auxiliary variables $z_i$. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;There are two other constraints. One is the constraint on the sum of the weights (mentioned by a Alex C above); this is equation (25). The other is the constraint that the portfolio delivers a desired level of return, equation (24). &#xA;The optimization program you want is analogous to equations (22)-(25) in the doc you linked. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;It's really a pretty amazing thing that minimizing expected shortfall is numerically feasible. That insight is due to Rockafellar and Uryasev (and these papers are mostly available online &lt;a href=&quot;http://www.ise.ufl.edu/uryasev/files/2011/11/CVaR1_JOR.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;link1&lt;/a&gt;); but getting from an intuitive description of the problem to the operational form of the programming problem isn't as pretty as you would like! On operationalization, however, I found these slides by Guy Yollin invaluable:&#xA;&lt;a href=&quot;http://www.r-programming.org/files/RFinance2009.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://www.r-programming.org/files/RFinance2009.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="11767" LastEditorUserId="16160" LastEditDate="2017-11-19T16:18:34.190" LastActivityDate="2017-11-19T16:18:34.190" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="36960" PostTypeId="1" CreationDate="2017-11-19T13:49:25.213" Score="0" ViewCount="924" Body="&lt;p&gt;I am a student, so please don't judge me for stupid questions. I'm writing a code to valuate call option (based on random geometric Brownian motion) using Monte Carlo Simulation and Black Scholes Model, however, I am getting absolutely different results. Here is my code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;T=1;&#xA;n=100;&#xA;d=T/n;&#xA;N=1000;&#xA;S0=100;&#xA;mu=0.2;&#xA;s=0.1;&#xA;r=0.01;&#xA;K=105;&#xA;t=0:d:T;&#xA;W=zeros(N,n+1);&#xA;&#xA;Z= randn(N,n);&#xA;W=cumsum([zeros(N,1) sqrt(d)*Z],2);&#xA;S=S0*exp((mu-0.5*s^2).*t+s*W);&#xA;&#xA;payoffs=max(S(:,n+1)-K,0);&#xA;disc_payoffs=payoffs/exp(r*(T-t(1)));&#xA;MC=mean(disc_payoffs); &#xA;&#xA;d1=(log(S0./K)+(r+0.5.*s^2).*(T-t(1)))/(s.*sqrt(T-t(1)));&#xA;d2=(log(S0./K)+(r-0.5.*s^2).*(T-t(1)))/(s.*sqrt(T-t(1)));&#xA;BS=S0.*normcdf(d1)-K.*exp(-r.*(T-t(1))).*normcdf(d2);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;With MC my answer is around 17, but with BS is always 2 point something. Could you please help me to find the mistake?&lt;/p&gt;&#xA;" OwnerUserId="30521" LastEditorUserId="24222" LastEditDate="2017-11-19T14:13:26.970" LastActivityDate="2017-11-19T14:22:27.817" Title="Monte Carlo simulation and Black Scholes give different results in my code" Tags="&lt;option-pricing&gt;&lt;black-scholes&gt;&lt;monte-carlo&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36961" PostTypeId="2" ParentId="36960" CreationDate="2017-11-19T14:22:27.817" Score="3" Body="&lt;p&gt;It seems that you are using mu in your MC code where you should be using r.  The reason that we use r instead of mu is that we need to perform risk-neutral pricing.  Please read about that in detail if you are not familiar.&lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-11-19T14:22:27.817" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36962" PostTypeId="1" CreationDate="2017-11-19T15:57:38.020" Score="2" ViewCount="81" Body="&lt;p&gt;While on my last day on an internship last summer, I heard on the morning call a UK rates trader say something along the lines of: &quot;Most of the curve is at fair value at the moment, so nothing particularly interesting in the way of trade opportunities&quot;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;How do traders determine that the curve is at fair value? Is there a general approach to doing this? Or do traders develop their own models for determining it? Can traders disagree on whether or not a curve is at fair value?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What are some good places to learn about determining this?&lt;/p&gt;&#xA;" OwnerUserId="8010" LastActivityDate="2017-11-19T15:57:38.020" Title="How do traders determine when points in a yield curve are at 'fair value'?" Tags="&lt;fixed-income&gt;&lt;interest-rates&gt;&lt;yield-curve&gt;&lt;rates&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36965" PostTypeId="2" ParentId="25484" CreationDate="2017-11-19T18:02:02.917" Score="2" Body="&lt;p&gt;You could compare 3 month fx forward points versus realised 3 month fx differentials to see if interest rate differentials are a good predictor. I looked at a 1 year horizon and concluded that you cannot ignore the interest rate differential, but on the other hand the best prediction might lie between zero drift and the fx forward predicted rate. &lt;/p&gt;&#xA;" OwnerUserId="30522" LastActivityDate="2017-11-19T18:02:02.917" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36966" PostTypeId="1" CreationDate="2017-11-19T19:36:12.643" Score="4" ViewCount="1026" Body="&lt;p&gt;I hope this question is on-topic. What is a convenient way to get MSCI index performance data from the web? I would be interested in daily performance data of the factor indices momentum, minvol, small cap and enhanced value.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I know that I can download files from &lt;a href=&quot;https://www.msci.com/end-of-day-data-search&quot; rel=&quot;noreferrer&quot;&gt;MSCI end of day index data search&lt;/a&gt;. It is just not conveniant. If I take longer periods I can only use monthly data. But I would like to have at least weekly, preferable daily data.&#xA;I don't have direct access to Bloomberg at the moment. But can I use the web site of BB to scrape the data? Qandl doesn't offer what I need and I have not seen the data on google finance. Do I have to switch to investable ETFs to get the data? I would like to have the last 10 years.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastEditorUserId="38987" LastEditDate="2020-08-09T01:04:19.457" LastActivityDate="2021-05-06T02:10:53.147" Title="Retrieval of MSCI factor index performance data from the web" Tags="&lt;equities&gt;&lt;data&gt;" AnswerCount="2" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36967" PostTypeId="1" CreationDate="2017-11-19T19:50:38.113" Score="3" ViewCount="2949" Body="&lt;p&gt;I'm reaching out regarding the R-Squared of a Fama-Macbeth regression. This is often reported in econometric results but I have yet to find a good explanation of how it is computed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically, if I consider the second stage of a Fama-Macbeth regression, where we are potentially running hundreds of regressions, how are the R-Squareds of these hundreds of regressions aggregated into a final R-Squared for the entire procedure? I understand that the coefficients are aggregated by a simple averaging, but was unclear about the R-Squareds. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand that there are codes to do this, but am trying to understand what's under the hood.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;From the Fama-Macbeth regression we specify a model where each return &lt;span class=&quot;math-container&quot;&gt;$y_{i,t}$&lt;/span&gt; of portfolio &lt;span class=&quot;math-container&quot;&gt;$i$&lt;/span&gt; in time period &lt;span class=&quot;math-container&quot;&gt;$t$&lt;/span&gt; can be priced by:&#xA;&lt;span class=&quot;math-container&quot;&gt;$$&#xA;y_{i,t}=\gamma_0 + \gamma_1 \beta_{1, i}+ \gamma_2 \beta_{2, i} + \dots + \gamma_j \beta_{N,i}&#xA;$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where &lt;span class=&quot;math-container&quot;&gt;$N$&lt;/span&gt; represents the total number of factors.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When calculating the predicted values to calculate our &lt;span class=&quot;math-container&quot;&gt;$R^2$&lt;/span&gt;, do we take the residuals of each time period or the mean portfolio returns, i.e. are our residuals &lt;span class=&quot;math-container&quot;&gt;$y_{i,t}-\hat{y}_{i,t}$&lt;/span&gt; (&lt;span class=&quot;math-container&quot;&gt;$i \times t$&lt;/span&gt; number of resids) or only &lt;span class=&quot;math-container&quot;&gt;$y_{i}-\hat{y}_{i}$&lt;/span&gt; (i number of resids).&lt;/p&gt;&#xA;" OwnerUserId="30524" LastEditorUserId="17936" LastEditDate="2018-10-27T19:16:45.653" LastActivityDate="2018-10-27T19:16:45.653" Title="How to compute a Fama-Macbeth R-Squared (R2)?" Tags="&lt;regression&gt;&lt;factor-models&gt;&lt;econometrics&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 4.0" />
  <row Id="36969" PostTypeId="2" ParentId="36863" CreationDate="2017-11-19T21:11:37.470" Score="2" Body="&lt;p&gt;When writing &lt;code&gt;getSymbols(ticker)&lt;/code&gt; the function is creating an xts object in the global env named by the ticker. In the first iteration, when i = 1, ticker is  a character, &quot;AAMC&quot;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Next, when you are trying to get the monthly returns for that newly created xts object, &lt;code&gt;monthlyReturn(ticker, subset='2017-11-10')&lt;/code&gt; you are referencing the character, not the newly created xts object, named AAMC as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To fix this, you could &lt;code&gt;xtsTicker &amp;lt;- getSymbols(ticker, auto.assign = FALSE)&lt;/code&gt; then &lt;code&gt;monthlyReturn(xtsTicker, subset='2017-11-10')&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;One thing to note as well, &lt;code&gt;selected$MonthyReturn &amp;lt;-&lt;/code&gt; is referencing all rows within that column. This should be changed to &lt;code&gt;selected$MonthyReturn[i]&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;While this answers your question as why the monthlyReturn() function will not work, this may not make your for loop work. This loop is bound to run into errors, which will break upon. For some tickers, there will not be an monthly returns to give.&#xA;In that case, you could add an if statement to take care of that. One option would be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;for(i in 1:nrow(selected)){&#xA;   ticker = selected$Symbol[i]&#xA;   xtsTicker &amp;lt;- getSymbols(ticker, auto.assign = FALSE)&#xA;    if(nrow(monthlyReturn(xtsTicker, subset='2017-11-17')) == 0){&#xA;    selected$MonthyReturn[i] &amp;lt;- NA&#xA;    }else{&#xA;    selected$MonthyReturn[i] &amp;lt;- monthlyReturn(xtsTicker, subset='2017-11-17')&#xA;   }&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;There will also be times where a ticker is unable to be downloaded, hence another error. &lt;/p&gt;&#xA;" OwnerUserId="30290" LastEditorUserId="30290" LastEditDate="2017-11-19T21:38:16.433" LastActivityDate="2017-11-19T21:38:16.433" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36970" PostTypeId="2" ParentId="36946" CreationDate="2017-11-20T00:36:17.847" Score="1" Body="&lt;p&gt;T, while not necessarily a direct answer to your question, I just wanted to offer a word of caution in applying a mean reversion model to security or fund returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In attempting to fit a mean reversion model to returns, you are implicitly stating that you believe that historical returns are good predictors of future returns. Although I don't know what your dataset is, this is generally &lt;em&gt;not&lt;/em&gt; the case. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;More likely to be mean reverting are the fundamentals &lt;em&gt;underlying&lt;/em&gt; these returns. Using a financial markets example this might be something like multiples (P/E or EV/EBITDA).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But if you still wanted to run such a mean reversion analysis, I would recommend starting with a regression with a format similar to the following: use as your independent (x) variable the returns from period t and as your dependent (y) variable the returns from period t+1. If there is mean reversion you should see a negative resulting coefficient, although you should also check the fit of your result as well -- in keeping with my comments above, I would expect the fit to be poor, even if your coefficient is negative.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Hope this helps!&lt;/p&gt;&#xA;" OwnerUserId="30524" LastActivityDate="2017-11-20T00:36:17.847" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36971" PostTypeId="1" AcceptedAnswerId="36975" CreationDate="2017-11-20T01:04:39.177" Score="1" ViewCount="504" Body="&lt;p&gt;I am trying to price a digital option and the final price under different number of time steps are as follows:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/mmjL8.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/mmjL8.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is it possible to have a graph like this? &lt;/p&gt;&#xA;" OwnerUserId="27587" LastEditorUserId="27587" LastEditDate="2017-11-20T01:27:39.833" LastActivityDate="2017-11-20T10:54:27.893" Title="Number of Time Steps in Binomial Option Pricing - Problem?" Tags="&lt;derivatives&gt;&lt;binomial&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36972" PostTypeId="2" ParentId="30687" CreationDate="2017-11-20T05:29:50.313" Score="0" Body="&lt;p&gt;The log distribution of returns is $$\frac{1}{2\gamma}\text{sech}\left[\frac{\pi}{2}\left(\frac{x-\mu}{\gamma}\right)\right]$$ when bankruptcy, mergers and the budget constraint are ignored.  I think the actual shocks in Sornette are actually liquidity shocks and because the bid-ask spread is ignored in most modelling, it looks like changes of underlying volatility. There is enough empirical data to support the issue that I think a careful study needs done.  Also, modeling things in logs is a bit more difficult than to do so in raw form.  We don't use punch cards anymore.  No one buys log(3 shares) +log($7/share).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should treat them as continuous.  Do note that as you add variables to the distribution above, that you do not add covariates.  The distribution involved lacks anything resembling a covariance matrix.  $\gamma$ just turns into $\gamma'$.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2017-11-20T05:29:50.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36973" PostTypeId="1" CreationDate="2017-11-20T09:06:41.417" Score="2" ViewCount="713" Body="&lt;p&gt;Does anyone know where I can download from historical data for sovereign bond CDS (credit default swaps) rates?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;preferebly free?&lt;/p&gt;&#xA;" OwnerUserId="30285" LastEditorUserId="30285" LastEditDate="2018-03-03T22:07:21.073" LastActivityDate="2019-01-20T18:27:46.640" Title="Sovereign bond CDS data" Tags="&lt;fixed-income&gt;&lt;finance&gt;&lt;bond&gt;&lt;swaps&gt;&lt;bloomberg&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36974" PostTypeId="1" AcceptedAnswerId="37372" CreationDate="2017-11-20T10:21:32.560" Score="1" ViewCount="1571" Body="&lt;p&gt;Let's say that I have a bond that pays coupon on a semi-annual basis. Therefore, the price of this bond can be calculated using the following formula:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ P = \sum_{i=1}^N \frac{CF_i}{(1 + YTM/2)^{2t_i}} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;First derivative of the above is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{\partial P}{\partial YTM} = \frac{1}{(1 + YTM/2)} \sum_{i=1}^N \frac{-2t_iCF_i}{(1 + YTM/2)^{2t_i}} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Second derivative (aka convexity) of the Price function is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{\partial^2 P}{\partial YTM} = \frac{1}{(1 + YTM/2)^2} \sum_{i=1}^N \frac{({4t_i}^2+2t_i)CF_i}{(1 + YTM/2)^{2t_i}} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And the generalized form of the convexity formula for bonds that pay multiple coupons per year is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{\partial^2 P}{\partial YTM} = \frac{1}{(1 + YTM/f)^2} \sum_{i=1}^N \frac{({(ft_i)}^2+ft_i)CF_i/f}{(1 + YTM/f)^{ft_i}} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am getting slightly different results when I compare my results with &lt;a href=&quot;https://www.youtube.com/watch?v=yOwRgWhIn_g&quot; rel=&quot;nofollow noreferrer&quot;&gt;Bionic Turtle&lt;/a&gt;. Is there any mistake in my derivation?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerUserId="19096" LastEditorUserId="19096" LastEditDate="2017-11-21T03:27:45.213" LastActivityDate="2018-02-12T21:43:42.353" Title="Derivation of convexity formula" Tags="&lt;fixed-income&gt;&lt;bond&gt;&lt;convexity&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36975" PostTypeId="2" ParentId="36971" CreationDate="2017-11-20T10:54:27.893" Score="3" Body="&lt;p&gt;It is quite common to see non-smooth convergence in tree models and this is not specific to digital options.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The problem usually that the tree is constructed independent of the contract to be priced. Thus, the location of the strike relative to the two surrounding nodes might vary widely between two successive step sizes. For European plain vanilla options, a common approach is to &quot;tilt&quot; the tree such that one of the terminal nodes coincides with the strike. The same approach can be applied to European digital options as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A good reference is Tian (1999) &quot;A Flexible Binomial Option Pricing Model&quot;, &lt;em&gt;Journal of Futures Markets&lt;/em&gt;, Vol. 19, No. 7, pp. 817-843. The below plot is taken from this paper and compares the convergence of a standard Cox-Ross-Rubinstein tree to the tilted one.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/2IoTY.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/2IoTY.png&quot; alt=&quot;Comparison of binomial tree convergence.&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="24222" LastActivityDate="2017-11-20T10:54:27.893" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36976" PostTypeId="1" CreationDate="2017-11-20T11:01:49.057" Score="0" ViewCount="1285" Body="&lt;p&gt;I need some help, since I can't find any good sources. I need the portfolios for my thesis.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have 20 years of monthly stock returns for ~200 stocks. I want to create each month 5 equally weighted portfolios. The ranking for portfolios should be done based on each stocks past 3 year standard deviation from stock returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In total there would be 204 balancing periods (17 years =20 years - initial estimation period of 3 years).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have some experience from using R and think it could be done there. &#xA;Any suggestions? Thx!&lt;/p&gt;&#xA;" OwnerUserId="30211" LastActivityDate="2017-11-20T17:50:26.097" Title="How to construct stock portfolios in R" Tags="&lt;programming&gt;&lt;portfolio&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36978" PostTypeId="1" CreationDate="2017-11-20T11:24:31.477" Score="3" ViewCount="453" Body="&lt;p&gt;In &lt;code&gt;HJM&lt;/code&gt; model we have &lt;code&gt;instaneous forward rate&lt;/code&gt; $f(t,T):$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d f(t,T) = v(t,T)v_T(t,T)d t - v_T(t,T)d W_t,$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;is &lt;code&gt;Markov&lt;/code&gt;. And the &lt;code&gt;spot rate&lt;/code&gt; $r(t)$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$d r(t) = \left\{f_t(0,t) + \int^t_0 [v(\tau,t)v_{tt}(\tau,t)+v_{t}(\tau,t)^2]d\tau - \int^t_0 v_{tt}(\tau,t)d W_\tau\right\}d t$$&#xA;$$ +  v_{tt}(\tau,t)|_{\tau = t}d W_\tau.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Term&#xA;$$\int^t_0 v_{tt}(\tau,t)d W_\tau$$&#xA;makes $r(t)$ &lt;code&gt;non-Markov&lt;/code&gt;generally(Ho-Lee is not).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But one thing confused me is that, &lt;code&gt;Hull-White&lt;/code&gt; (One-Factor) Model:&#xA;$$d r = [\theta(t) - ar]d t + \sigma d W_t.$$&#xA;is HJM model, and $r$ is obviously Markov. But we have $v(t,T)$ in Hull-White:&#xA;$$v(t,T) = \sigma\dfrac{1 - e^{-a(T-t)}}{a}$$&#xA;should make $r(t)$ non-Markov.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So what's wrong here?&lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-11-20T11:24:31.477" Title="Hull White and HJM model not Markov" Tags="&lt;interest-rates&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36979" PostTypeId="1" CreationDate="2017-11-20T15:57:00.510" Score="1" ViewCount="679" Body="&lt;p&gt;If I am a private equity fund manager (e.g I have a portfolio consisting of direct private equity investments), what does credit risk mean in a practical sense for me? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The usual issuer credit risk metrics for a debt portfolio (such as migration or downgrade risk) don't really apply here since I am borrowing and not lending. If I want to capture whether the credit quality of my private equity fund has improved/deteriorated, what should I be measuring? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I can use models such as Altman's Z-score to see the bankruptcy risk for individual companies, but is it possible to create some kind of aggregate measure to communicate credit risk for the overall PE fund? What kind of approaches exist that have looked at this problem, or how do professional funds usually look at this?&lt;/p&gt;&#xA;" OwnerUserId="17712" LastActivityDate="2017-11-20T15:57:00.510" Title="What is credit risk in a private equity portfolio?" Tags="&lt;credit-risk&gt;&lt;private-equity&gt;" AnswerCount="0" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36980" PostTypeId="1" AcceptedAnswerId="36984" CreationDate="2017-11-20T16:01:31.510" Score="0" ViewCount="248" Body="&lt;p&gt;I have been using Quantlib Addin, now I am looking for the equivalent function for QuantLib in Python:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;=qlYieldTSDiscount(EffectiveDate;DiscountCurve)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Or any workaround? I need to discount my NPV to today. &lt;/p&gt;&#xA;" OwnerUserId="29660" LastEditorUserId="16148" LastEditDate="2017-11-20T17:54:41.653" LastActivityDate="2017-11-20T17:54:41.653" Title="qlYieldTSDiscount in QuantLib Python" Tags="&lt;python&gt;&lt;quantlib&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36981" PostTypeId="2" ParentId="36967" CreationDate="2017-11-20T16:18:56.310" Score="3" Body="&lt;p&gt;There's nothing different here. To compute $R^2$, you need the actual values $y_i$ and the fitted (i.e. model predicted) values $\hat{y}_i$. Think of the Fama-Macbeth procedure as just another way to get fitted values $\hat{y}_i$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once you have your coefficient estimate $\hat{\mathbf{b}}$ from running Fama-Macbeth. Calculate &lt;a href=&quot;https://en.wikipedia.org/wiki/Coefficient_of_determination&quot; rel=&quot;nofollow noreferrer&quot;&gt;$R^2$ the usual way&lt;/a&gt;: calculate the total sum of squares, obtain the fitted values $\hat{y}_i = \mathbf{x}_i \cdot \hat{\mathbf{b}}$, calculate the explained sum of squares, and then compute $R^2$.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Quick econometrics review&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Imagine you have the following panel regression.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ y_{it} = \mathbf{x}_{it} \cdot \mathbf{b} + \epsilon_{it} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now let's imagine that the error terms are cross-sectionally correlated (i.e. $\operatorname{E}[\epsilon_{it}\epsilon_{jt}] \neq 0$) but across time, the error-terms are independent (and we have $\operatorname{E}[\epsilon_{it_1}\epsilon_{j t_2}] = 0$ for $t_1 \neq t_2$). Because of the cross-sectional correlation, the typical OLS standard errors are going to be understated. In typical finance settings, they will be massively understated because cross-sectional correlation is big.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What to do?&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Option 1: Compute clustered standard errors, clustering on the time variable. (This is arguably a more modern approach.)&lt;/li&gt;&#xA;&lt;li&gt;Option 2: Fama-Macbeth procedure&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;(Note: in typical situations, you should obtain similar results but the two approaches involve different weighting.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Back in 1973, cluster robust, Rogers standard errors weren't around yet, and instead Fama and Macbeth developed their immensely intuitive procedure. The basic intuition is that:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;Each time period is independent, so we can use our regular Stats 1 techniques to estimate the mean and t-stat for a stationary time series.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;We can run period by period cross-sectional regressions to obtain a time-series of estimates $\{\hat{\mathbf{b}}_t\}$&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Combine (1) and (2) and you have the Fama-Macbeth procedure.&lt;/p&gt;&#xA;" OwnerUserId="20582" LastActivityDate="2017-11-20T16:18:56.310" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36982" PostTypeId="2" ParentId="36976" CreationDate="2017-11-20T16:35:51.240" Score="1" Body="&lt;p&gt;Here is an example that uses the &lt;code&gt;btest&lt;/code&gt; function, which is&#xA;in the PMwR package. The package is available from&#xA;&lt;a href=&quot;http://enricoschumann.net/R/packages/PMwR/index.htm&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://enricoschumann.net/R/packages/PMwR/index.htm&lt;/a&gt; or&#xA;from&#xA;&lt;a href=&quot;https://github.com/enricoschumann/PMwR&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://github.com/enricoschumann/PMwR&lt;/a&gt;. (Disclosure: I&#xA;am the package author.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the example, I create 240 random monthly prices of 200&#xA;assets. Just plug in your own data instead.&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;na &amp;lt;- 200     ## number of assets&#xA;no &amp;lt;- 20*12   ## number of observations&#xA;&#xA;R &amp;lt;- array(rnorm(na*no, sd = 0.05),  ## returns&#xA;           dim = c(no, na))&#xA;&#xA;P &amp;lt;- apply(rbind(0,R), 2,            ## prices&#xA;           function(x) cumprod(1+x))&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The main input for running &lt;code&gt;btest&lt;/code&gt; is a function that&#xA;is called at any instant of time at which trading may&#xA;take place, and which returns the desired position (or,&#xA;alternatively, the desired weights). In the example, it may look as follows. The function selects the 50 assets with the lowest vol and&#xA;equal-weights them:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;vol_sort &amp;lt;- function() {&#xA;&#xA;    ## number of assets in portfolio&#xA;    k &amp;lt;- 50                        &#xA;&#xA;    ## get prices for the last 36 months and&#xA;    ## compute returns&#xA;    R &amp;lt;- returns(Close(n = 36))    &#xA;&#xA;    ## compute vols and select the k assets with&#xA;    ## the smallest vol&#xA;    vols &amp;lt;- apply(R, 2, sd)        &#xA;    select &amp;lt;- order(vols)[1:k]&#xA;&#xA;    ## compute an equal-weight portfolio of&#xA;    ## these assets&#xA;    w &amp;lt;- numeric(length(vols))     &#xA;    w[select] &amp;lt;- 1/k&#xA;    w&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The backtest can be run then as follows:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(&quot;PMwR&quot;)&#xA;result &amp;lt;- btest(prices = list(P),&#xA;                signal = vol_sort,  &#xA;                b = 36,                 ## burn-in: drop 36 months&#xA;                convert.weights = TRUE, ## since vol_sort returns weights,&#xA;                                        ## convert them into positions&#xA;                initial.cash = 100)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="6857" LastEditorUserId="6857" LastEditDate="2017-11-20T17:50:26.097" LastActivityDate="2017-11-20T17:50:26.097" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36983" PostTypeId="2" ParentId="36155" CreationDate="2017-11-20T16:50:55.863" Score="0" Body="&lt;p&gt;You need to look at it for &lt;strong&gt;exactly what it is&lt;/strong&gt;. The only information that you have is that the ask/bid prices went up/down. From this information you can calculate the mid prices. You do not have a perfect price estimate, and it is important understand this fact and deal with it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Instead of computing only mid prices, I find it useful to compute bid and ask prices as well.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You will have 3 price streams to compute, and you can then evaluate each one of them separately as well as in composition:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Mid  &lt;/li&gt;&#xA;&lt;li&gt;Bid&lt;/li&gt;&#xA;&lt;li&gt;Ask&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;Using some kind of composition enables you to differentiate cases where only bid or ask changed values from cases where both changed values.&lt;/p&gt;&#xA;" OwnerUserId="30280" LastActivityDate="2017-11-20T16:50:55.863" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36984" PostTypeId="2" ParentId="36980" CreationDate="2017-11-20T17:31:34.880" Score="2" Body="&lt;p&gt;That would be&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;discount_curve.discount(effective_date)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;You'll find examples of various tasks in QuantLib-Python on &lt;a href=&quot;http://gouthamanbalaraman.com/blog/quantlib-python-tutorials-with-examples.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Goutham Balaraman's blog&lt;/a&gt; or on the &lt;a href=&quot;https://leanpub.com/quantlibpythoncookbook&quot; rel=&quot;nofollow noreferrer&quot;&gt;QuantLib Python Cookbook&lt;/a&gt;.  Having a look at those might ease your learning curve.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2017-11-20T17:31:34.880" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36985" PostTypeId="2" ParentId="36954" CreationDate="2017-11-20T18:18:03.133" Score="1" Body="&lt;p&gt;This online course might be helpful for implementation and basic theory (although it does not touch FX options):&#xA;&lt;a href=&quot;https://iversity.org/en/courses/monte-carlo-methods-in-finance&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://iversity.org/en/courses/monte-carlo-methods-in-finance&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="20556" LastEditorUserId="20556" LastEditDate="2017-11-20T18:30:29.797" LastActivityDate="2017-11-20T18:30:29.797" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36986" PostTypeId="2" ParentId="36949" CreationDate="2017-11-20T19:52:40.810" Score="1" Body="&lt;h3&gt;Super basic Markowitz min variance problem&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Portfolio return is $r_p = w_a r_a + w_b r_b$ hence portfolio variance (under assumption of independent assets is $w^2_a \sigma^2_b + w^2_b \sigma^2_b$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{equation}&#xA;	\begin{array}{*2{&amp;gt;{\displaystyle}r}}&#xA;	\mbox{minimize (over $w_a, w_b$)} &amp;amp; w^2_a \sigma^2_b + w^2_b \sigma^2_b \\&#xA;	\mbox{subject to} &amp;amp; w_a + w_b = 1&#xA;	\end{array}&#xA;\end{equation}&#xA;This is a convex optimization problem where Slater's condition is satisfied. The first order conditions are necessary and sufficient conditions for an optimum. Do a bit of algebra on the first order conditions and you get:&#xA;$$ w_a  = \frac{\sigma^2_b}{\sigma^2_a + \sigma^2_b} \quad \quad  w_b  = \frac{\sigma^2_a}{\sigma^2_a + \sigma^2_b} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Using your values of $\sigma_a = .1$ and $\sigma_b = .2$, then $w_a = .2$ and $w_b = .8$, as you calculated.&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-11-20T20:08:03.793" LastActivityDate="2017-11-20T20:08:03.793" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="36987" PostTypeId="1" CreationDate="2017-11-20T20:30:11.227" Score="2" ViewCount="100" Body="&lt;p&gt;Can someone provide a typical numerical values of GARCH(1,1) coefficients $(\omega,\alpha,\beta)$ for estimating SPX index variance? I will appreciate it if some references could be provided.&lt;/p&gt;&#xA;" OwnerUserId="6686" LastEditorUserId="6686" LastEditDate="2017-11-22T00:21:40.783" LastActivityDate="2017-11-25T22:41:14.777" Title="Typical SPX variance GARCH(1,1) coefficients" Tags="&lt;garch&gt;&lt;variance&gt;&lt;spx&gt;" AnswerCount="1" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36988" PostTypeId="2" ParentId="23274" CreationDate="2017-11-20T20:53:54.123" Score="2" Body="&lt;p&gt;There is no easy answer to this question. Several providers do provide partial solutions, but nothing that could be considered research-grade like CRSP's mutual fund data. Beyond holdings and flows, there are all sorts of variables one could be interested in when looking at ETFs, e.g. discount to NAV, creation/redemption baskets, etc.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here's a partial list:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://financial.thomsonreuters.com/en/products/data-analytics/financial-research/lipper-fund-research.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;Thomson Reuters' Lipper&lt;/a&gt;, which is now one of the primary sources for CSRP and is more detailed and up to date.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;https://www.factset.com/analytics/etf_analytics&quot; rel=&quot;nofollow noreferrer&quot;&gt;Factset's ETF Analytics&lt;/a&gt; data, which in some cases goes back to 1993.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://corporate.morningstar.com/ca/asp/subject.aspx?page=4&amp;amp;xmlfile=2404.xml&quot; rel=&quot;nofollow noreferrer&quot;&gt;Morningstar's&lt;/a&gt; historical data, which goes back to 2003.&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&quot;http://www.crsp.com/products/documentation/crsp-survivor-bias-free-us-mutual-fund-guide-crspsift&quot; rel=&quot;nofollow noreferrer&quot;&gt;CRSP Survivor-Bias-Free US Mutual Fund data&lt;/a&gt;, which includes US ETF data. There would be no information about ETF redemption baskets, for example.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Most of these options, except CRSP, cost in the hundreds of thousands of dollars a year. Depending on your purpose/affiliation/profile you could also try reaching out to the largest players and ask for historical data, which would not be exhaustive but probably a lot cheaper.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Note that I do not have access to all of this data and that the coverage can vary quite a bit between vendors. You should reach out to them for a sample and access to the data dictionary for their products. Sadly the marketplace for financial data is not very efficient.&lt;/p&gt;&#xA;" OwnerUserId="5120" LastActivityDate="2017-11-20T20:53:54.123" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36989" PostTypeId="2" ParentId="36870" CreationDate="2017-11-20T21:09:12.117" Score="7" Body="&lt;p&gt;In their book &quot;Counterparty Credit Risk, Collateral and Funding&quot; D. Brigo, M. Morini and A. Pallavicini start with a dialogue between a Physics PhD graduate and an experienced practitioner of Quantitative Finance.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The topic of P vs Q is presented in that dialogue in a manner meant to be understandable to a new comer. I would certainly recommend you to have a look!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This dialogue is also available on the &lt;a href=&quot;https://arxiv.org/pdf/1111.1331.pdf&quot; rel=&quot;noreferrer&quot;&gt;arXiv&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am also adding a couple quotes from that dialogue:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;.. &lt;em&gt;&quot;&lt;strong&gt;Q:&lt;/strong&gt; Ok. We simulate under P because we want the risk statistics of the&#xA;portfolio in the real world, under the physical probability measure, and&#xA;not under the so called pricing measure Q&quot; ..&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;.. &lt;em&gt;&quot;&lt;strong&gt;Q:&lt;/strong&gt;  And how is this Q related to P? [still puzzled]&#xA;&lt;strong&gt;A:&lt;/strong&gt;  The two measures are related by a mathematical relationship that de-&#xA;pends on risk aversion, or market price of risk.  In the simplest models&#xA;the real expected rate of return is given by the risk free rate plus the&#xA;market price of risk times the volatility.  Indeed the ”expected” return&#xA;of an asset depends on the probability measure that is used.  For exam-&#xA;ple, under P the average rate of return of an asset is hard to estimate,&#xA;whereas under Q one knows that the rate of return will be the risk free&#xA;rate, since dependence on the real rate of return can be hedged away through replication techniques.  [starts looking tired]&quot;&lt;/em&gt;&lt;/p&gt;&#xA;" OwnerUserId="29479" LastActivityDate="2017-11-20T21:09:12.117" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36990" PostTypeId="2" ParentId="3319" CreationDate="2017-11-20T23:04:34.297" Score="1" Body="&lt;p&gt;eh, just bumped into this. the answer is quite simple - z-spread is based on a curve that is not dynamic. there are different ways to set up your prepayment model, but generally you'd use forward rates. so, for each future period, your prepayment model would use this static curve &amp;amp; a current coupon (index) model to calculate your refinancing incentive and come up with CPR. Once this is done, you have cash flows for each period until your product matures. if a price is already given, what the computer/software will do is calculate the required spread to be added to each point in the static discount spot curve so that the resulting price equals your given price (input). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;OAS is a bit more complicated, but in essence you have many (250, for instance) paths, instead of one. so you have 250-sets of cash flows that need to be discounted. depending on how your term structure model is set up, this might affect your valuation (or risk) dramatically. generally, simulating the curve gives you increased prepayments (there is a long answer for this), which drives your cash flows shorter. now these shorter cash flows need to produce the same price, which is given as an input. how do you do that? the simulation discounts less, i.e., adds smaller spread (OAS vs static) to come up with the same final price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;cheers.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;d.&lt;/p&gt;&#xA;" OwnerUserId="29040" LastActivityDate="2017-11-20T23:04:34.297" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36991" PostTypeId="1" AcceptedAnswerId="37088" CreationDate="2017-11-21T00:13:42.947" Score="2" ViewCount="323" Body="&lt;p&gt;So, I need some help to move forward with this problem. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{cases}&#xA;\frac{\partial F(t,x,y)}{\partial t}+\frac{1}{2}\frac{\partial^2 F(t,x,y)}{\partial x^2}+\frac{9}{2}\frac{\partial^2 F(t,x,y)}{\partial y^2}+\frac{\partial^2 F(t,x,y)}{\partial x \partial y}-F(t,x,y)=0 \ \ \ (t,x) \in[0,T) x R^2\\&#xA;F(T,x,y)=x^2y\\&#xA; \end{cases}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have concluded that the C matrix defined as $\sigma*\sigma^T=\begin{matrix}&#xA;1 &amp;amp; 1\\&#xA;1  &amp;amp;  3&#xA;\end{matrix}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and that $\mu_{1}=\mu_{2}=0$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and that I should solve &#xA;$$F(t,x,y)=E_{t,x,y}[e^{-(T-t)}x^2y]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;but my problem is to figure out how $x$ and $y$ should look like. &#xA;My attempt was &#xA;$$dX(s)=dW_{1}(s)+dW_{2}(s)$$&#xA;$$dY(s)=3dW_{2}(s)+dW_{1}(s)$$&#xA;since they should be correlated given the problem, but I'm unsure if I have understood how to define $dX(s)$ and $dY(s)$ properly. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Well, if i preceed with $dX(s)$ and $dY(s)$ as defined above I get&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$F(t,x,y)=E_{t,x,y}[e^{-(T-t)}x^2y]=\\e^{-(T-t)}E_{t,x,y}\bigg[\bigg(x+\big(W_{1}(T)-W_{1}(t)\big)+\big(W_{2}(T)-W_{2}(t)\big)\bigg)^2\bigg(y+3\big(W_{2}(T)-W_{2}(t)\big)+\big(W_{1}(T)-W_{1}(t)\big)\bigg)\bigg]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which does not lead me to the correct answer. &#xA;Anyone with some guiding for me?&lt;/p&gt;&#xA;" OwnerUserId="30541" LastActivityDate="2017-11-26T07:23:59.680" Title="Feynman Kac Terminal value problem two variables" Tags="&lt;stochastic-calculus&gt;&lt;finance&gt;&lt;differential-equations&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="36992" PostTypeId="2" ParentId="36870" CreationDate="2017-11-21T00:22:23.860" Score="4" Body="&lt;p&gt;The risk neutral density is a mathematical trick to allow pricing of options.  As it has little bearing on reality, it makes little sense to simulate from it for the purposes of forecasting real results.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I would argue that any paper that shows that the risk neutral density forecasts better than the real world is either suffering from a specification or an estimation problem.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Perhaps the best empirical study that I have seen on the topic is the following paper, which examines the real world density, the risk neutral density, and the link between the two for the (very general) CGMY model:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;http://finance.martinsewell.com/stylized-facts/distribution/CarrGemanMadanYor2002.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;http://finance.martinsewell.com/stylized-facts/distribution/CarrGemanMadanYor2002.pdf&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="9403" LastActivityDate="2017-11-21T00:22:23.860" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36993" PostTypeId="2" ParentId="36870" CreationDate="2017-11-21T00:32:39.047" Score="6" Body="&lt;p&gt;Perhaps a case of views based upon theoretical possibilities rather than empirical realities?&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;In theory, &lt;span class=&quot;math-container&quot;&gt;$P$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$Q$&lt;/span&gt; can be &lt;em&gt;extremely&lt;/em&gt; different&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$P$&lt;/span&gt; is the real world, actual probability measure.&lt;/li&gt;&#xA;&lt;li&gt;&lt;span class=&quot;math-container&quot;&gt;$Q$&lt;/span&gt; is an artificial probability measure constructed so that security prices are risk neutral expectations (discounted at risk free rate) under measure &lt;span class=&quot;math-container&quot;&gt;$Q$&lt;/span&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;The connection between the two is through &lt;a href=&quot;https://en.wikipedia.org/wiki/State_prices&quot; rel=&quot;nofollow noreferrer&quot;&gt;state prices&lt;/a&gt;. If state prices are constant, then &lt;span class=&quot;math-container&quot;&gt;$P$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$Q$&lt;/span&gt; are the same. But with arbitrary state prices, &lt;span class=&quot;math-container&quot;&gt;$P$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$Q$&lt;/span&gt; can be made arbitrarily different from each other. The probability of a hurricane under the risk neutral measure can deviate arbitrarily from the probability of a hurricane  under the true probability measure depending on the market price of hurricane risk. If risk prices are extreme enough, a 1% probability event may have 20% probability under the risk neutral measure. (Economic theory may have some objection to this, but the basic math of risk neutral pricing does not.)&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Quick review: the pricing kernel connects &lt;span class=&quot;math-container&quot;&gt;$P$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$Q$&lt;/span&gt;&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Let &lt;span class=&quot;math-container&quot;&gt;$p(X)$&lt;/span&gt; be an asset pricing function that returns the price of payoff &lt;span class=&quot;math-container&quot;&gt;$X$&lt;/span&gt;. If &lt;span class=&quot;math-container&quot;&gt;$p$&lt;/span&gt; is linear, then it can be written as an inner product of the payoff &lt;span class=&quot;math-container&quot;&gt;$X$&lt;/span&gt; with a pricing kernel &lt;span class=&quot;math-container&quot;&gt;$\pi$&lt;/span&gt;.&#xA;&lt;span class=&quot;math-container&quot;&gt;$$p(X) = \mathbb{E}^P\left[ \pi X \right]$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Then define Radon-Nikodym derivative &lt;span class=&quot;math-container&quot;&gt;$\frac{dQ}{dP} = \pi R_f$&lt;/span&gt; and conduct a change of measure.&#xA;&lt;span class=&quot;math-container&quot;&gt;$$ p(X) = &#xA;\frac{1}{R_f}\mathbb{E}^P\left[\frac{dQ}{dP}X \right] =  \frac{1}{R_f} \mathbb{E}^Q[X] $$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So depending what pricing kernel &lt;span class=&quot;math-container&quot;&gt;$\pi$&lt;/span&gt; is, some notion of distance between &lt;span class=&quot;math-container&quot;&gt;$P$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$Q$&lt;/span&gt; could be quite large (since the linear &lt;span class=&quot;math-container&quot;&gt;$p$&lt;/span&gt; assumption on its own doesn't put meaningful constraints on &lt;span class=&quot;math-container&quot;&gt;$\pi$&lt;/span&gt;).&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2019-07-15T13:51:22.500" LastActivityDate="2019-07-15T13:51:22.500" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="36994" PostTypeId="1" CreationDate="2017-11-21T05:19:20.233" Score="6" ViewCount="916" Body="&lt;p&gt;When we use a binomial interest rate tree to value callable bond, we work backward, right? If any computed bond value is larger than the call price, the bond will be called. The call price will replace the computed bond value and we go on to calculate the bond value in previous year. My question is: we cannot call the bond twice. If the bond is call at year 2 on some node, we use the call price to calculate the bond price at year 1 and the results shows that the bond will be called in year 1 too. So confused!&lt;/p&gt;&#xA;" OwnerUserId="30545" LastActivityDate="2019-08-21T17:03:25.423" Title="Question about using binomial interest rate tree to value callable bonds" Tags="&lt;fixed-income&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="36995" PostTypeId="2" ParentId="36934" CreationDate="2017-11-21T08:30:43.340" Score="0" Body="&lt;p&gt;As I understand it, using PCA you just &quot;smoothen&quot; the yield curve returns. Afterwards you bootstrap (pick random day from smoothened returns matrix and take this return at each maturity) every period in the future (if you have daily data = bootstrap return each day until maturity). This way you obtain random curve development until maturity and since the the returns are logarithms, you just take exponential of these simulated returns and multiply by the last observed yield (annex II point 23 b ii). Then you subtract the adjustment regarding nonnegativity that was applied in point 23 a ii. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;However what to do next, I am not sure. In my case, I have zero-bond. I am not sure what data to use, what spread to use when discounting. I was hoping there will be an example calculation done by EIOPA by now.&lt;/p&gt;&#xA;" OwnerUserId="29232" LastActivityDate="2017-11-21T08:30:43.340" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="36996" PostTypeId="2" ParentId="36792" CreationDate="2017-11-21T08:47:49.037" Score="1" Body="&lt;p&gt;I think they messed up with the dataset. The dates are weird and the rolling volatilities do not match. They suddenly take 2 year history instead of 5. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;May I please ask why did you not take full columns for 1Y and 3Y stress volatilities? (the percentile() starts somewhere in middle of the column)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;EDIT: You should use full dataset to calculate rolling volatilities and thus only 1Y and more than 1Y stress volatilities shall differ.(ESA's workshop in Frankfurt 27.11.2017, &lt;a href=&quot;https://www.dropbox.com/s/egfx0ktolojfsek/3.PRIIPs%20Workshop%20-%20Risk%20Reward%20Methodology.pdf?dl=0&quot; rel=&quot;nofollow noreferrer&quot;&gt;ESA's workshop&lt;/a&gt; ).&lt;/p&gt;&#xA;" OwnerUserId="29232" LastEditorUserId="29232" LastEditDate="2017-12-06T13:25:45.707" LastActivityDate="2017-12-06T13:25:45.707" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="36997" PostTypeId="1" CreationDate="2017-11-21T08:59:14.183" Score="2" ViewCount="181" Body="&lt;p&gt;Explain why&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;If spot prices tends to be higher than futures prices, then long hedges are likely to be particularly attractive&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Supposed logic behind this is that if spot prices are likely to be higher than futures prices, then one might lock into futures prices, $F_1$, (at the beginning of hedging) and in this case as spot prices $S_1$ are likely to be higher than futures prices $F_1$ the hedging is attractive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But I have a slight problem with this statement; we know that the basis $b_t=S_t-F_t$ at time $t$ is likely to be positive. If the hedging ends in $t=2$ then the amount paid by (assuming hedging ratio $h=1$) long position is&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;P=F_1+b_2$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;&lt;em&gt;If&lt;/em&gt;&lt;/strong&gt; it is more likely that $P&amp;lt;S_1$, then the statement makes sense. However, by given condition it is also true that we would expect $b_2&amp;gt;0$ more often, and in particular this probably increases risk of $P&amp;gt;S_1$ e.g. if $F_1=S_1$. Of course we cannot ascertain anything in hedging, but I'm slightly bugged at the fact that there is a chance of this turning worse ($P&amp;gt;S_1$), and in fact I do not know if there is any good reason to believe that $\mathbb{P}(P&amp;gt;S_1)\le \mathbb{P}(P&amp;lt;S_1)$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It seems to me that the first paragraph only says that $\mathbb{P}(P&amp;lt;S_1)$ is higher compared to the case in which spot prices are often lower than futures prices&lt;/p&gt;&#xA;" OwnerUserId="30440" LastActivityDate="2017-11-22T14:31:32.290" Title="If spot prices tends to be higher than futures prices, then long hedges are particularly attractive - Why?" Tags="&lt;futures&gt;&lt;hedging&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="37002" PostTypeId="1" AcceptedAnswerId="37010" CreationDate="2017-11-21T11:50:43.267" Score="2" ViewCount="669" Body="&lt;p&gt;I happened to a interview question:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Give a equal dice, you will gain the money which is the number you roll, then how much will you pay for the game.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Naturely, the answer is 3.5. But the interview said, the dice game is not the derivatives, you have nothing to hedge it, then you are a speculator. So the answer is not 3.5.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What did he mean?&lt;/p&gt;&#xA;" OwnerUserId="26165" LastActivityDate="2017-11-22T15:26:47.370" Title="The dice game and derivatives trading" Tags="&lt;derivatives&gt;" AnswerCount="2" CommentCount="6" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="37003" PostTypeId="2" ParentId="37002" CreationDate="2017-11-21T12:00:24.750" Score="2" Body="&lt;p&gt;He meant that you are taking risk, so you might only pay less than 3.5 for it.  For example , supposing your whole net worth is usd 35,000 and the game is played in units of usd 10,000.  Would you pay 35,000 for the game where you could get back only 10,000?  That would crush your total wealth.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-11-21T12:00:24.750" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="37005" PostTypeId="2" ParentId="36937" CreationDate="2017-11-21T13:18:29.003" Score="0" Body="&lt;p&gt;If we want to find the rate before the first known swap (or cash, future,etc) we need to do the following:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Sort inputs by termination dates and choose the rate from the first one. In my case it is &lt;code&gt;0.58%&lt;/code&gt;. So, let us denote $\textrm{firstIntervalRate}=0.58\%$.&lt;/li&gt;&#xA;&lt;li&gt;Rate for the period from the valuation date until the first start (effective) date should be calculated using the following formula&#xA;$$\begin{align} r &amp;amp;= \left ( (1+\textrm{firstIntervalRate})^{accrual}-1\right ) \times \frac{1}{accrual}\\&#xA;&amp;amp;=\left ( \left (1+ \frac{0.58}{100}\right )^{\frac{4}{360}}-1 \right ) \times \frac{360}{4}= 0.57834\%.\end{align} &#xA;$$&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Derivation:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we have $N$ payments with the given annual rate (in my case it is $\textrm{firstIntervalRate}$) than the rate for every period $r_p$ would satisfy&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\textrm{firstIntervalRate} = \prod_{n=1}^{N}(1+r_p)-1= (1+r_p)^N -1, $$&#xA;so the rate for the period of $1/N$ of one year would be &#xA;$$ r_p=(1+\textrm{firstIntervalRate})^{1/N}-1.$$&#xA;If we want a rate for an arbitrary number of days, we need to change $1/N$ in previous formula with the actual $accrual$ factor. Now, we have rate $r_p$ for some number of days (in my case it is 4 days) and next step is to make it annualized by multiplying  with the number of payments per year (or in arbitrary case with the value of $1/accrual$).&lt;/p&gt;&#xA;" OwnerUserId="13360" LastActivityDate="2017-11-21T13:18:29.003" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37007" PostTypeId="1" AcceptedAnswerId="37032" CreationDate="2017-11-21T14:05:49.397" Score="0" ViewCount="72" Body="&lt;p&gt;I have been using Quantlib Addin, now I am looking for the equivalent function for QuantLib in Python:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;=qlRateHelperEarliestDate(RateHelper)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and &lt;/p&gt;&#xA;&#xA;&lt;p&gt;=qlRateHelperLatestDate(RateHelper)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Or any workaround? &lt;/p&gt;&#xA;" OwnerUserId="29660" LastActivityDate="2017-11-22T14:14:45.267" Title="qlRateHelperEarliestDate and qlRateHelperLatestDate in QuantLib Python" Tags="&lt;python&gt;&lt;quantlib&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37008" PostTypeId="1" CreationDate="2017-11-21T14:13:41.697" Score="3" ViewCount="124" Body="&lt;p&gt;Is it possible for a company to sell protection on their own assets or own country bonds by CDS?&#xA;The company can buy protection on those assets, but how about selling?&#xA;I suppose it can not sell. Is there any paper, writing about the subject?&#xA;Thanks.&lt;/p&gt;&#xA;" OwnerUserId="30550" LastActivityDate="2017-11-24T12:06:19.803" Title="Is it possible to sell protection on own asset with CDS?" Tags="&lt;fixed-income&gt;&lt;cds&gt;&lt;default-probability&gt;&lt;default-risk&gt;&lt;sovereign-cds&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="37010" PostTypeId="2" ParentId="37002" CreationDate="2017-11-21T15:53:28.123" Score="7" Body="&lt;p&gt;The interviewer meant that he's smart. &lt;a href=&quot;http://marginalrevolution.com/marginalrevolution/2013/06/google-interview-questions.html?utm_source=feedburner&amp;amp;utm_medium=feed&amp;amp;utm_campaign=Feed%3A%20marginalrevolution%2Ffeed%20%28Marginal%20Revolution%29&amp;amp;utm_content=Google%20Feedfetcher&quot; rel=&quot;nofollow noreferrer&quot;&gt;Quoting Senior VP of People operations at Google&lt;/a&gt;,&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;On the hiring side, we found that brainteasers are a complete waste of&#xA;  time. How many golf balls can you fit into an airplane? How many gas&#xA;  stations in Manhattan? A complete waste of time. They don’t predict&#xA;  anything. They serve primarily to make the interviewer feel smart.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;Putting that aside, one possible approach would be to invoke &lt;a href=&quot;https://en.wikipedia.org/wiki/Von_Neumann%E2%80%93Morgenstern_utility_theorem&quot; rel=&quot;nofollow noreferrer&quot;&gt;Von Neumann-Morgernstern expected utility&lt;/a&gt; to construct a certainty equivalent value for the gamble based upon your level of risk aversion.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Utility functions are used to define a &lt;a href=&quot;https://en.wikipedia.org/wiki/Total_order&quot; rel=&quot;nofollow noreferrer&quot;&gt;total order&lt;/a&gt; over possible outcomes and hence can represent complete, transitive preferences: outcome $X$ is preferred to $Y$ if and only if the utility function assigns $X$ higher utility. Expected utility extends classic utility theory to stochastic outcomes by defining the overall utility $U$ of a stochastic outcome $X$ as the expectation of a bernoulli utility function $u$ whose curvature $-\frac{u''}{u'}$ &lt;a href=&quot;https://en.wikipedia.org/wiki/Risk_aversion#Absolute_risk_aversion&quot; rel=&quot;nofollow noreferrer&quot;&gt;formalizes a notion of risk aversion&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ U(X) = \mathbb{E}[u(X)]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(Small note: the curvature of $u$ here is extremely important, representing risk aversion, while the curvature of $U$ is irrelevant: any monotonic, increasing transformation of an overall utility function $U$ represents the same preferences.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A nice Bernoulli utility function $u$ to use is &lt;a href=&quot;https://en.wikipedia.org/wiki/Isoelastic_utility&quot; rel=&quot;nofollow noreferrer&quot;&gt;power utility&lt;/a&gt;. In a special case this is simply log utility: $u(x) = \log(x)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $w$ be a scalar representing your wealth.  Let $Z$ be payoff from the dice roll (i.e. 1 dollar if dice rolls 1 etc...) Let $c$ be the certainty equivalent of the gamble. The certainty equivalent gives you the same expected utility as your gamble hence $c$ solves the equation:&#xA;$$u(w + c) = \mathrm{E}[ u(w + Z) ] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With log utility:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \log(w + c) = \frac{1}{6}\sum_{i=1}^6 \log(w + i) $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we have log utility and a wealth of one million dollars ($w = 1,000,000$), then I compute the certainty equivalent of the gamble as $c = 3.49999854$. So it's not 3.5 dollars, but really, it's basically the same unless you pump up your risk aversion or scale up the gamble. (And that wealth is probably dramatically too low if you take into account the present value of all future wages.)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This analysis of course doesn't take into account the value of the time wasted talking about this gamble. A few dollar bet is almost certainly too small to be worth meaningful analysis.&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-11-22T15:26:47.370" LastActivityDate="2017-11-22T15:26:47.370" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="37013" PostTypeId="1" CreationDate="2017-11-21T17:05:29.697" Score="-4" ViewCount="2332" Body="&lt;p&gt;I have a simple question on the VaR for a portfolio that consists of a long and short position. Say I have a portfolio consisting of the following positions:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;p&gt;long 1000 shares of stock X &lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;short 1000 shares of stock X&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;Let's assume the daily volatility for Apple stock is 2% and that the stock trades at 2 dollar/share so my investment is 4000 dollar in total. I want to calculate the VaR for each of the positions separately and for the full portfolio, but I am a little bit confused with the signs associated with long and short position. Intuitively, the portfolio should have VaR = 0 as the long and short position in the same stock with equal investment have a neutralizing effect.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(1) VaR for the long position&#xA;VaR = 2%*2000*2.33 = 93.2&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(2) VaR for the short position&#xA;VaR = 2%*abs(-2000)*2.33 = 93.2&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now, for the combined position, my question is which signs to use? Do we say:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;VaR = 2.33*sqrt((40)^2+(-40)^2+2*40*(-40)*corr) = 0 since corr = 1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;VaR = 2.33*sqrt((40)^2+40^2+2*40*40*corr) = 0 since corr = -1&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since you have the same stock X, the correlation is simply equal to 1 or do we say it is equal to -1 because we have a short and long position in it? So generally my question is, do we take the absolut value if the position is short or?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks!&lt;/p&gt;&#xA;" OwnerUserId="20813" LastEditorUserId="16148" LastEditDate="2017-11-21T17:09:06.210" LastActivityDate="2019-08-24T09:14:20.063" Title="Value at Risk - Long/Short position" Tags="&lt;portfolio-management&gt;&lt;var&gt;&lt;variance&gt;" AnswerCount="3" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="37014" PostTypeId="1" CreationDate="2017-11-21T17:44:38.770" Score="3" ViewCount="230" Body="&lt;p&gt;First thing first, CME has a tool to calculate fed rate hike probability &lt;a href=&quot;http://www.cmegroup.com/trading/interest-rates/countdown-to-fomc.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;&lt;em&gt;from here&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As of 11/20/2017, their probability distribution was like this:&#xA;&lt;a href=&quot;https://i.stack.imgur.com/vTYoD.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/vTYoD.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have checked a couple Q&amp;amp;A sections on this site and I think I understand their logic, for example &lt;a href=&quot;https://quant.stackexchange.com/questions/22310/dec-16-fed-rate-hike/22311#22311&quot;&gt;&lt;strong&gt;&lt;em&gt;this one&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;. I also read &lt;a href=&quot;http://www.cmegroup.com/education/fed-funds-futures-probability-tree-calculator.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;strong&gt;&lt;em&gt;CME's documentation&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;. But still i was not able to back out the probability of 91.5% for a December 2017 rate hike using their fed fund future prices. I got a probability of 85.6905%. &#xA;$$r1 = 100 - 98.8432 = 1.1562$$ &#xA;$$r2 = 100-98.7125 = 1.2875$$&#xA;$$1.2875 = (1.1562*12 + r*19)/31$$&#xA;which implies $r = 1.370426$, and: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$P(\text{hike}) = (1.370426 - 1.1562)/0.25=0.856905$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What did I missed?&lt;/p&gt;&#xA;" OwnerUserId="30555" LastEditorUserId="20454" LastEditDate="2017-11-21T20:18:31.367" LastActivityDate="2017-11-21T20:18:31.367" Title="CME Rate Hike Probability Calculation" Tags="&lt;futures&gt;&lt;cme&gt;" AnswerCount="0" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="37015" PostTypeId="1" AcceptedAnswerId="37070" CreationDate="2017-11-21T17:52:20.380" Score="9" ViewCount="3791" Body="&lt;p&gt;I'm trying to do some portfolio construction in cvxpy in Python:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;weight = Variable(n)&#xA;ret = mu.T * weight&#xA;risk = quad_form(weight, Sigma)&#xA;&#xA;prob = Problem(Maximize(ret), [risk &amp;lt;= .01])&#xA;prob.solve()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However I would like to include asset level risk budgeting constraints e.g. no asset can contribute more than 1% risk to the total risk. This constraint would look like (mctr = marginal contribution to total risk, actr = absolute contribution to total risk)&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;mctr = Sigma * weight / 0.1&#xA;actr = mul_elemwise(mctr, weight)&#xA;prob = Problem(Maximize(ret), [risk &amp;lt;= .01, actr &amp;lt;=.01])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;However, when I try to do this cvxpy errors out with &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;&amp;gt;&amp;gt; mul_elemwise(mctr, w)&#xA;*** ValueError: The first argument to mul_elemwise must be constant.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;And then I tried reformulating the constraint as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;actr = diag(mctr, weight.T)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;but still an error:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;(Pdb) prob.solve()&#xA;*** cvxpy.error.DCPError: Problem does not follow DCP rules.&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Now I understand why I'm getting these errors, but I also know that these are fairly common constraints, so I'm wondering how to formulate them into cvxpy so I can solve my optimization. Thanks&lt;/p&gt;&#xA;" OwnerUserId="16680" LastEditorUserId="16680" LastEditDate="2017-11-22T14:19:29.203" LastActivityDate="2020-06-26T01:23:43.463" Title="cvxpy portfolio optimization with risk budgeting" Tags="&lt;portfolio-management&gt;&lt;risk&gt;&lt;optimization&gt;&lt;portfolio-optimization&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="37016" PostTypeId="2" ParentId="2263" CreationDate="2017-11-21T20:18:57.660" Score="0" Body="&lt;p&gt;I was once trying to do something similar. My idea as to find baskets of stocks that behaved similarly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similar stocks, in my understanding, are stocks that vary together in a temporal way, i.e., if they go they same direction by a similar amount in the same days, than they can be considered similar.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What worked for me was this: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;1) I picked one year of data from the stocks of interest.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2) Calculated the correlation between the daily variations only, generating a correlation matrix with a value of 1 all over the main diagonal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;3) Transformed the columns into feature vectors (could've been the lines as well)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;4) Fed those vectors into a simple Kmeans (I used Apache Spark's implementation)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;5) Starting from K = 2, I kept iterating until my within set sum of squared errors found a valley (in my case, they best K was 6).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;6) There the clusters were, interestingly separated by industry, with banks in one cluster, siderurgics in another, etc. Basically, I clustered the stocks that correlate the most with the same set of other stocks.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've only tried it for a set of Brazilian stocks, though.&lt;/p&gt;&#xA;" OwnerUserId="30557" LastActivityDate="2017-11-21T20:18:57.660" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37017" PostTypeId="1" AcceptedAnswerId="37018" CreationDate="2017-11-21T20:29:19.807" Score="2" ViewCount="403" Body="&lt;p&gt;Given $r=0$, $\sigma(K)=\text{const}$ and:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \text{Binary} = \lim_{ε → 0} \frac{(C(K,\sigma (K))-C(K+ε,\sigma(K+ε)))}{ε} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I have to find the analytical expression for the above.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since $σ(K)=\text{const}$, I know that we can write the above as:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \text{Binary} = \lim_{ε → 0}\frac{(C(K)-C(K+ε))}{ε} $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Do I take the derivative next or use the Taylor's theorem?&lt;/p&gt;&#xA;" OwnerUserId="29715" LastEditorUserId="20454" LastEditDate="2017-11-21T21:00:36.567" LastActivityDate="2017-11-21T21:25:54.323" Title="Binary option analytical formula" Tags="&lt;derivatives&gt;&lt;replication&gt;&lt;binary-options&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="37018" PostTypeId="2" ParentId="37017" CreationDate="2017-11-21T20:54:27.073" Score="2" Body="&lt;p&gt;As you say, you simply differentiate with respect to $K$. Assuming your binary's maturity is $T$, note that in a Black-Scholes framework with constant risk-free rate $r$, by the &lt;a href=&quot;https://faculty.baruch.cuny.edu/lwu/890/BreedenLitzenberger78.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Breeden-Litzenberger equations&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \begin{align}&#xA;\text{Binary}&amp;amp;=\lim_{\epsilon \rightarrow 0}\frac{-C(K+\epsilon)+C(K)}{\epsilon}&#xA;\\[6pt]&#xA;&amp;amp;=-\frac{\partial C}{\partial K}(K)&#xA;\\[9pt]&#xA;&amp;amp;=e^{-rT}(1-Q(K))&#xA;\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $Q(\cdot)$ is the cumulative, risk-neutral distribution and $(1-Q(K))$ gives the probability that the underlying asset's price is below $K$ at time $T$, which is consistent with the payoff of a binary option. &lt;/p&gt;&#xA;" OwnerUserId="20454" LastEditorUserId="20454" LastEditDate="2017-11-21T21:25:54.323" LastActivityDate="2017-11-21T21:25:54.323" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="37019" PostTypeId="2" ParentId="36966" CreationDate="2017-11-21T21:16:06.810" Score="0" Body="&lt;p&gt;Index providers typically don't make their data publicly available and you would have to look at the ETFs or mutual funds that track these benchmarks or pay for the index data.&lt;/p&gt;&#xA;" OwnerUserId="1764" LastActivityDate="2017-11-21T21:16:06.810" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="37021" PostTypeId="2" ParentId="37013" CreationDate="2017-11-21T21:49:09.450" Score="0" Body="&lt;p&gt;I think VaR for the short position should be VaR = 2%*(-2000)*2.33 = -93.2&lt;/p&gt;&#xA;" OwnerUserId="30555" LastActivityDate="2017-11-21T21:49:09.450" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37023" PostTypeId="1" CreationDate="2017-11-21T22:32:02.943" Score="1" ViewCount="33" Body="&lt;p&gt;Short version:  Is there a meaningful notion of &quot;average return per period&quot; for an investment whose value falls to zero over time?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Long version:&#xA;Call the gross return on an investment the ratio $\frac{Pt}{Pt-k}$, where $P_t$ is the asset price at time $t$ and $P_{t - k}$ is the asset price $k$ periods before $t$.&#xA;Then &#xA;$$\frac{P_t}{P_{t-k}} = \frac{P_{t-k+1}}{P_{t-k}}...\frac{P_{t-1}}{P_{t-2}}\frac{Pt}{P_{t-k}}$$&#xA;the product of the single-period gross returns from $t-k$ to $t$.&#xA;For nonzero gross returns over $k$ periods, we can compute a meaningful average return via the geometric mean, i.e. the $k^{th}$ root of the $\frac{P_t}{P_{t-k}}$.  Choosing all of the single-period returns to be this value would result in the desired $k$-period return.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the case of a total loss, where the final asset price is zero, the geometric mean would be zero.  This makes sense in that, if all single-period returns were zero, the $k$-period return would also be zero.   But it fails to account for the number of periods it takes for the asset price to fall to zero.  It seems sensible that the gross daily return for an asset whose value falls from \$100 to \$0 in a single day is 0.  But what if the asset price falls to linearly to zero over the course of 100 days?  It seems that the gross daily return should be higher in this example than in the first, since the value of the investment declines less rapidly.  Under the geometric mean approach, though, both of these scenarios result in the same gross daily return: 0.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is there a measure of average return that accounts for the time difference between these two scenarios?&lt;/p&gt;&#xA;" OwnerUserId="30562" LastActivityDate="2017-11-21T22:32:02.943" Title="Average return per period for a total loss" Tags="&lt;returns&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="37025" PostTypeId="2" ParentId="2263" CreationDate="2017-11-22T00:39:36.980" Score="0" Body="&lt;p&gt;You may be interested in a paper by Marcos Lopez de Prado called &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2708678&quot; rel=&quot;nofollow noreferrer&quot;&gt;Building Diversified Portfolios that Outperform Out-of-Sample&lt;/a&gt;, in Journal of Portfolio Management, 2016&lt;/p&gt;&#xA;&#xA;&lt;p&gt;He uses a clustering technique (described in the paper) to group stocks for the purpose of forming a diversified risk parity portfolio&lt;/p&gt;&#xA;" OwnerUserId="16160" LastActivityDate="2017-11-22T00:39:36.980" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37026" PostTypeId="1" CreationDate="2017-11-22T05:11:43.897" Score="0" ViewCount="686" Body="&lt;p&gt;as an exercise, I am trying to simulate the BS model via Monte Carlo Simulation in R to price a normal European-style call option. However, the code will give me results that are way higher than the BS results even in case of 100,000 simulations. Here is my Code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;nSim=1000&#xA;T=5&#xA;N=T*360&#xA;K=7589.42&#xA;r=0.0219&#xA;Y0=7846.33&#xA;dt=T/N&#xA;drift=0.0&#xA;sigma=0.197&#xA;a=1&#xA;b=1&#xA;&#xA;callOptionPrice=simulateCall()&#xA;callOptionPrice&#xA;&#xA;  simulateCall=function(){&#xA;  C&amp;lt;-vector(mode=&quot;double&quot;,nSim)&#xA;for(a in 1:nSim){&#xA; V=newPath()&#xA; C[a]=max(V[N]-K,0)&#xA;  a=a+1    &#xA;  }&#xA;call=1/nSim*sum(C)*exp(-r*T)&#xA;return(call)&#xA;}&#xA;&#xA;newPath=function() {&#xA;  Y&amp;lt;-vector(mode=&quot;double&quot;, length=N)&#xA;  i=0&#xA;  t=1&#xA;  Y[1]=Y0&#xA;  for(i in 0:N){&#xA;    dW=sqrt(dt)*rnorm(1)&#xA;    Y[t+1] = Y[t] + r*Y[t]*dt + sigma*Y[t]*dW&#xA;    t=t+1&#xA;  }&#xA;  return(Y)&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Could anybody help me to find the mistake here? The actual result according to BS should be 1864.1388, however my code always returns numbers &gt;2400.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance!&lt;/p&gt;&#xA;" OwnerUserId="30566" LastActivityDate="2018-03-22T12:39:46.690" Title="Different Results Monte Carlo and Black-Scholes - where is my mistake?" Tags="&lt;black-scholes&gt;&lt;monte-carlo&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="37028" PostTypeId="2" ParentId="37026" CreationDate="2017-11-22T08:50:06.583" Score="1" Body="&lt;p&gt;I've cleaned up your code a bit:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;nSim=1000&#xA;T=5&#xA;N=T*360&#xA;K=7589.42&#xA;r=0.0219&#xA;Y0=7846.33&#xA;dt=T/N&#xA;drift=0.0&#xA;sigma=0.197&#xA;&#xA;  simulateCall=function(){&#xA;  C&amp;lt;-vector(mode=&quot;double&quot;,nSim)&#xA;for(a in 1:nSim){&#xA; V=newPath()&#xA; C[a]=max(V[N]-K,0)    &#xA;  }&#xA;call=1/nSim*sum(C)*exp(-r*T)&#xA;return(call)&#xA;}&#xA;&#xA;newPath=function() {&#xA;  Y&amp;lt;-vector(mode=&quot;double&quot;, length=N)&#xA;  Y[1]=Y0&#xA;  for(i in 1:(N-1)){&#xA;    dW=sqrt(dt)*rnorm(1)&#xA;    Y[i+1] = Y[i] + r*Y[i]*dt + sigma*Y[i]*dW&#xA;  }&#xA;  return(Y)&#xA;}&#xA;&#xA;callOptionPrice=simulateCall()&#xA;callOptionPrice&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Check where I made changes, some stuff you put in there was useless like specifying the variable you loop over and adding code within the loop to increment that variable. Or defining superfluous variables.&lt;/p&gt;&#xA;" OwnerUserId="156" LastEditorUserId="156" LastEditDate="2017-11-22T09:05:53.153" LastActivityDate="2017-11-22T09:05:53.153" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="37029" PostTypeId="1" AcceptedAnswerId="37033" CreationDate="2017-11-22T10:04:57.937" Score="2" ViewCount="446" Body="&lt;p&gt;Suppose I want to calculate the Sharpe ratio given a risk free rate of 0.05 for a portfolio consisting of assets from 500 ETFs. How can I do so in R given the data I've collected thus far in my R code? The following is a part of my code:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;#To extract ETF-prices for each column&#xA;prices &amp;lt;- data.frame(ETF=ETF,row.names = dates) &#xA;head(prices)&#xA;# Function for calculating continous returns &amp;amp; log returns&#xA;returnscalc &amp;lt;- function(x){&#xA;  diff(x)/x[-length(x)]&#xA;}&#xA;returns &amp;lt;- apply(prices, 2, returnscalc)&#xA;head(returns)&#xA;# Function for calculating geometric mean&#xA;geomAveCalc &amp;lt;- function(x){&#xA;  (prod((1+x)))^(1/length(x))-1&#xA;}&#xA;&#xA;weeklymean &amp;lt;- apply(returns, 2, geomAveCalc)&#xA;yearlymean &amp;lt;- matrix((1+weeklymean)^52-1)&#xA;yearlystd &amp;lt;-  sqrt (52 * apply(returns, 2, var))&#xA;yearlycov &amp;lt;- 52 * cov(returns)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;where ETF is the data extracted from the .csv file containing the ETFs data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some help will be deeply appreciated.&lt;/p&gt;&#xA;" OwnerUserId="29670" LastActivityDate="2017-11-22T14:42:05.290" Title="Sharpe Ratio of ETFs in R" Tags="&lt;programming&gt;&lt;sharpe-ratio&gt;&lt;etf&gt;&lt;csv&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="37031" PostTypeId="2" ParentId="36997" CreationDate="2017-11-22T14:05:01.583" Score="1" Body="&lt;p&gt;Suppose the future price of crude (for delivery next month) is always 3 USD less than the spot price. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say the spot price of crude is 50, so end of month future is 47. You go long the future. What happens at future expiration?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Case 1. Bad news from the middle east, the spot price has increased to 60. The future expires at 60. You have made 13 USD per barrel.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Case 2. Bad news from China, the economy is tanking and crude imports are tanking. The world is awash in crude and the spot price goes to 40 /bbl. So does the expiring future. You have lost 7 USD.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If Case 1 and Case 2 are equally likely, i.e. the spot price is a martingale, the long future position has made (13-7)/2 = 3 USD per month on average. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;That's why if spot prices are a martingale, but spot tends to be consistently higher than futures prices, then long hedges are likely to be profitable on average. (Of course this average profitability is masked by large month to month fluctuations, you are fully exposed to spot price changes).&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-11-22T14:31:32.290" LastActivityDate="2017-11-22T14:31:32.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37032" PostTypeId="2" ParentId="37007" CreationDate="2017-11-22T14:14:45.267" Score="0" Body="&lt;p&gt;I'll try to pen a general answer, since asking a question for each function you'll need won't be very time effective.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The convention for QuantLibXL function names is to map the underlying C++ methods as:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;ql{class name}{method name}(object, [parameters])&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;so, for instance, the method &lt;code&gt;yearFraction(Date d1, Date d2)&lt;/code&gt; defined in the class &lt;code&gt;DayCounter&lt;/code&gt;, which in C++ is called as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;t = object.yearFraction(d1,d2);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;in QuantLibXL becomes &lt;code&gt;qlDayCounterYearFraction(object, d1, d2)&lt;/code&gt;.  (Sometimes the class name is shortened; for instance, the method &lt;code&gt;discount&lt;/code&gt; in class &lt;code&gt;YieldTermStructure&lt;/code&gt; is mapped as &lt;code&gt;qlYieldTSDiscount&lt;/code&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You can invert the principle to find the C++ (or Python) method from the QuantLibXL function.  The function &lt;code&gt;qlRateHelperEarliestDate&lt;/code&gt; maps the method &lt;code&gt;earliestDate&lt;/code&gt; of class &lt;code&gt;RateHelper&lt;/code&gt;, so &lt;code&gt;qlRateHelperEarliestDate(rate_helper)&lt;/code&gt; corresponds to &lt;code&gt;rate_helper.earliestDate()&lt;/code&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The same goes for &lt;code&gt;latestDate&lt;/code&gt;, and for most other functions; the first parameter in Excel is the object on which to call the method, and the others are the parameters to pass.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2017-11-22T14:14:45.267" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37033" PostTypeId="2" ParentId="37029" CreationDate="2017-11-22T14:42:05.290" Score="5" Body="&lt;p&gt;try:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(PerformanceAnalytics)&#xA;SharpeRatio.annualized(Returns, Rf = 0.05, scale = 252, geometric = TRUE)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="26899" LastActivityDate="2017-11-22T14:42:05.290" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37034" PostTypeId="2" ParentId="36934" CreationDate="2017-11-22T16:39:32.423" Score="0" Body="&lt;p&gt;My interpretation of what to do next regarding the point :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;&quot;-adjusted so that the expected mean matches current expectations for the rate at tenor point T, at the end of the recommended holding period.&quot;&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;is to subtract the current value of each tenor from each simulated tenor and add back the current expectation of the value of that tenor at the point in time where your simulated data refer. Adjusting each tenor point so that the expected value of the simulated tenor matches the current expectation of that tenor at the end of the RHP would not have any physical meaning to me.&#xA;I am curious about your thoughts...&lt;/p&gt;&#xA;" OwnerUserId="30576" LastActivityDate="2017-11-22T16:39:32.423" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37037" PostTypeId="2" ParentId="34855" CreationDate="2017-11-23T05:39:57.760" Score="0" Body="&lt;p&gt;The Google Finance API for Python will be able to do this, and the process of writing it out to a Spreadsheet will be relatively trivial (e.g. pandas XlsxWriter, or openpyxl if you want to get fancy with formatting). However the quality and coverage varies a bit, and you may find some anomalies and/or missing data. &#xA;&lt;a href=&quot;https://pypi.python.org/pypi/googlefinance.client/1.3.0&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://pypi.python.org/pypi/googlefinance.client/1.3.0&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;An alternative if you want higher quality data is Quandl, which has a very good API and you can buy different data sets depending on what you want. &#xA;&lt;a href=&quot;https://www.quandl.com/tools/python&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.quandl.com/tools/python&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For both, you will need to do a bit of sorting/pivoting to get all the current cross section to line up nicely, but that should do the trick for simple requests. &lt;/p&gt;&#xA;" OwnerUserId="30262" LastActivityDate="2017-11-23T05:39:57.760" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37038" PostTypeId="2" ParentId="36159" CreationDate="2017-11-23T06:52:33.903" Score="1" Body="&lt;p&gt;I've worked in companies providing capital market solutions for companies all over the globe and I can confidently say that FIX is pretty much the industry standard when it comes to Trading. However in other areas like Post Trade and Back office functions, protocols like SWIFT are prominent. &lt;/p&gt;&#xA;" OwnerUserId="30429" LastActivityDate="2017-11-23T06:52:33.903" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37040" PostTypeId="1" AcceptedAnswerId="37067" CreationDate="2017-11-23T08:39:58.903" Score="1" ViewCount="892" Body="&lt;p&gt;How can I estimate a GARCH(1,1) model with control variables like this:&#xA;$$Y_t=a_0+a_1X_t+e_t$$&#xA; where$$ e_t\sim N(0,h_t)$$&#xA;$$h_t=b_0+b_1e_{t-1}^2+b_3h_{t-1}+b_3Z_t$$&#xA;I've checked some packages but can't fix it. Hope you guys can shed some lights!&lt;/p&gt;&#xA;" OwnerUserId="30587" LastEditorUserId="19645" LastEditDate="2017-11-24T20:07:57.130" LastActivityDate="2017-11-24T20:07:57.130" Title="How to add controls (regressors) to GARCH model in R?" Tags="&lt;programming&gt;&lt;garch&gt;" AnswerCount="1" CommentCount="2" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="37041" PostTypeId="1" AcceptedAnswerId="37043" CreationDate="2017-11-23T08:42:31.790" Score="0" ViewCount="1165" Body="&lt;p&gt;I am asked to solve the following homework question:&#xA;Risk free rate: 2%&#xA;Expected excess return on market portfolio: 8%&#xA;Standard deviation of market portfolio: 20%&#xA;The efficient portfolio has the following:&#xA;Expected return: 12%&#xA;Standard deviation: 25%&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am asked the following question: &quot;How can the expected return of the wining portfolio be achieved? Specify the amount invested in each asset/portfolio of assets?&quot; and I've used the following calculation to determine portfolio weight of 1.25:&#xA;0.12=ω0.1+(1-ω)0.02⇒ω=1.25&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And here is where I am a little lost. What does it mean to have the portfolio weight &gt;1 and what does it mean? If it's incorrect, where did I go wrong before? Thanks for any help!&lt;/p&gt;&#xA;" OwnerUserId="30173" LastActivityDate="2017-11-23T10:36:57.207" Title="How do you interpret a positive portfolio weight (when using CAPM and CML to calculate efficient portfolios)" Tags="&lt;portfolio-optimization&gt;&lt;capm&gt;&lt;expected-return&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="37042" PostTypeId="1" CreationDate="2017-11-23T09:43:44.123" Score="1" ViewCount="123" Body="&lt;p&gt;The topic of this question is the validation as prescribed in the Basel N ($N \ge 2$) framework. The task is given the probability of default $p_k$ for $K$ rating classes at time $t$ and the outcome on a credit portfolio at time $t+1$ to judge the quality (discriminatory power, calibration) of the rating model.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In practice there are cirumstances where the task of validation is difficult:&#xA;We can face the situation where we have a low number of creditors (due to a special segment or because the bank just entered the market). Furthermore we can have no defaults at all. This is either by pure chance (for example in a small portfolio) or because the portfolio bears low risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It appears that Dirk Tasche wrote &lt;a href=&quot;https://arxiv.org/find/all/1/all:+AND+Dirk+Tasche/0/1/0/all/0/1&quot; rel=&quot;nofollow noreferrer&quot;&gt;some papers&lt;/a&gt; in this setting and he and his collaborators are most often cited. I somehow can't see the connection to validation. But isn't there more literature?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Some literature deals with calibrating models but what is best practice in validation of no default portfolios? I would be interested in retail and corporate portfolios. I appreciate any remarks. Maybe you can help me find more or apply Tasche's findings to validation.&lt;/p&gt;&#xA;" OwnerUserId="2587" LastActivityDate="2017-11-23T09:43:44.123" Title="PD validation in the low/no default setting" Tags="&lt;default-probability&gt;&lt;credit-ratings&gt;&lt;validation&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="37043" PostTypeId="2" ParentId="37041" CreationDate="2017-11-23T10:36:57.207" Score="0" Body="&lt;p&gt;Just to make this a regular reply:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A negative value for a weight means that you short that asset. Inevitably, it also means that the money you get from shorting gets invested into the other assets. Hence weights larger than 1. In your case, it is the risk-free asset you short, which means you are borrowing money. To be precise you borrow 25% at the risk-free rate and invest 125% into the risky assets.&lt;/p&gt;&#xA;" OwnerUserId="156" LastActivityDate="2017-11-23T10:36:57.207" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37044" PostTypeId="2" ParentId="36636" CreationDate="2017-11-23T13:02:08.513" Score="5" Body="&lt;p&gt;Elaborating on my comment:   consider a 100 point in the money collar, one day before expiration.   You are effectively claiming the price of this is 99.5. But if you call the pit and get a two way price of 99-100 there is nothing to do.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-11-23T13:02:08.513" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37045" PostTypeId="1" CreationDate="2017-11-23T14:22:03.547" Score="0" ViewCount="341" Body="&lt;p&gt;PRIIPs regulation &lt;a href=&quot;http://ec.europa.eu/finance/docs/level-2-measures/priips-delegated-regulation-2017-1473-annex_en.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Annex 2&lt;/a&gt; states in Point 20 that bootstrapping is to be used to infer the expected distribution of prices or price levels for the PRIIP’s underlying contracts from the observed distribution of returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For a product based on a government bond this approach seems to be inefficient/wrong since there is some knowledge about the way the value of the bond will behave in the future. Namely, it should be expected that the bond will drop to its face (nominal) value. However, if I am correct in understanding what bootstrapping based on historical values will do, this will not be accounted for in the bootstrapping approach? &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Especially if the historical data is collected where the value of the bond has been (in average) rising (e.g. mid or early term of a long term bond) or (in average) stable. In this case, bootstrapping will produce an average curve (among others) that is not falling down to the face value. Thus, for government bonds we would see something quite extraordinary at maturity :)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is quite problematic since all of the quantiles will be overestimated leading to an overestimate in VaR!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since there is no mention of &quot;domain knowledge&quot; in PRIIPs (Annexes), how would you approach this problem? If you do not find this to be a problem could you please explain why you think so?&lt;/p&gt;&#xA;" OwnerUserId="30593" LastEditorUserId="30593" LastEditDate="2017-11-23T14:44:37.830" LastActivityDate="2017-11-23T15:51:14.110" Title="PRIIPs bootstrap for Category 3 MRM - bonds - future values to maturity" Tags="&lt;bond&gt;&lt;bootstrapping&gt;&lt;priips&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37046" PostTypeId="2" ParentId="37045" CreationDate="2017-11-23T15:51:14.110" Score="1" Body="&lt;p&gt;In the case of a govt bond, shouldn't the simulation be based on a (govt bond) curve (point 23 in the annex) in which case as time passes in your simulation you will recompute the bond price from shorter and shorter tenor points on the curve, thus ensuring that the bond price converges to its nominal value at maturity ?&lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2017-11-23T15:51:14.110" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="37047" PostTypeId="1" CreationDate="2017-11-23T16:02:06.053" Score="0" ViewCount="430" Body="&lt;p&gt;PRIIPs regulation &lt;a href=&quot;http://ec.europa.eu/finance/docs/level-2-measures/priips-delegated-regulation-2017-1473-annex_en.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;Annex II&lt;/a&gt; (MRM) states in point 16: &quot;The VaR shall be the value of the PRIIP at a confidence level of 97.5% at the end of the recommended holding period &lt;strong&gt;discounted to the present date using the expected risk-free discount factor&lt;/strong&gt; from the present date to the end of the recommended holding period.&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Annex IV point 12.b) (for favourable, moderate and unfavourable scenarios) states: &quot;the expected performance shall be calculated at the end of the recommended holding period, and &lt;strong&gt;without discounting the expected performance using the expected risk-free discount factor.&lt;/strong&gt;&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In Annex IV point 14 the regulations states: &quot;For Category 3 PRIIPs, the stress scenario shall be the value of the PRIIP at the extreme percentile as defined in point 11 of this Annex of the simulated distribution as set out in point 13 of this Annex.&quot;; thus not mentioning point 12 where we are working without discounting.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thus, my questions are:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Why do we specifically discount (risk-free) in MRMs and do not discount for performance scenarios (favourable, moderate and unfavourable)?&lt;/li&gt;&#xA;&lt;li&gt;Why is stress scenario different from avourable, moderate and unfavourable or is this just a mistake and should also not be discounted?&lt;/li&gt;&#xA;&lt;li&gt;Why would we like to have a scenario where we do not have benefits from a risk-free interest?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="30593" LastActivityDate="2017-11-23T17:54:33.417" Title="PRIIPs Category 3 risk-free discount factor - MRM and Performance scenarios" Tags="&lt;risk-management&gt;&lt;priips&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37048" PostTypeId="2" ParentId="37047" CreationDate="2017-11-23T17:54:33.417" Score="1" Body="&lt;p&gt;When computing the MRM VaR you are trying to answer the question &quot;how much of &lt;strong&gt;today's&lt;/strong&gt; investment value may the investor lose ?&quot;. Thus you need to discount the end of holding period VaR back to the beginning of the holding period to express the loss in terms of &lt;strong&gt;today's&lt;/strong&gt; money. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;When computing expected performance (i.e. expected return on the investment) you do not discount as performance is computed as the difference between the end of holding period value and the beginning of the period value. But I think you are right, performance under the stress scenario should also be undiscounted.  &lt;/p&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2017-11-23T17:54:33.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37049" PostTypeId="1" AcceptedAnswerId="37061" CreationDate="2017-11-23T21:41:32.943" Score="4" ViewCount="397" Body="&lt;p&gt;First I want to say that I've read this post (&lt;a href=&quot;https://quant.stackexchange.com/questions/47/how-to-calculate-future-distribution-of-price-using-volatility&quot;&gt;How to calculate future distribution of price using volatility?&lt;/a&gt;) but it doesn't help much.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here is what I'm trying to do (values are not real)&#xA;&lt;a href=&quot;https://i.stack.imgur.com/IB8jA.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/IB8jA.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's pretend that the last price for this security is 20.85 and what I'm trying to do is to determine, based on volatility, the range where the price should be in n days with X % of probability.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On my plot let's pretend that the blue area is a probability of 41.5% and the two pruple dots are on 20 days in the future. I'm looking for a function that would take a daily end of day price time serie, a probability, and a number of day and return a price range. For instance based on my plot:&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;In 10 days the price should be between 19.65 and 20.05 with 93.4%&#xA;chances&lt;/li&gt;&#xA;&lt;li&gt;In 20 days the price should be between 20.20 and 21.50 with 41.5% chances&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&#xA;&lt;p&gt;I would like to be able to do that with a function like this :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;future_price_range(eod_prices_time_serie, nb_of_days, probability)&#xA;&#xA;#with the first exemple it would look like this:&#xA;future_price_range(pcef_eod, 10, 0.934)&#xA;&#xA;# And return&#xA;[1] 19.65 20.05&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Based on the post I'm refering to at the top of this question I already managed to do something but I'm not sure if I'm doing it right:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(quantmod)&#xA;library(PerformanceAnalytics)&#xA;&#xA;# Retrieving daily prices from yahoo finance &#xA;pcef &amp;lt;- getSymbols(&quot;PCEF&quot;)&#xA;&#xA;# Selecting only the column of adjusted prices&#xA;pcef_ad &amp;lt;- Ad(PCEF)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;In the post I've linked at the top of my question it is said :  &quot;The distribution of the log of a stock price in n days is a normal distribution with mean of log(currentprice) ...&quot;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# So i take the last price&#xA;tail(pcef_ad, 1)&#xA;# PCEF.Adjusted&#xA;# 2017-11-22         23.62&#xA;&#xA;# And a convert it to log &#xA;mean_last_price_log &amp;lt;- log(23.62)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&quot; ... and standard deviation of volatility∗(√n/365.2425) if you're using calendar days, and assuming no dividends and 0% risk-free interest rate.&quot;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# I calculate daily returns &#xA;pcef_daily_return &amp;lt;- dailyReturn(pcef_ad)&#xA;&#xA;# To calculate the standard dev of returns&#xA;sd(pcef_daily_return)&#xA;# [,1]&#xA;# 0.005932502&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Since I'm using the volatility of daily returns I guess I should not divide n by 365.2425. Am I right about this ?&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;# Let's say we want the price range in 10 days&#xA;n &amp;lt;- 10&#xA;&#xA;sd_pcef_daily_return &amp;lt;- 0.005932502 * sqrt(n)&#xA;&#xA;lg_dist &amp;lt;- rnorm(n = 10000, mean = mean_last_price_log, sd = sd)&#xA;&#xA;# I convert it back to USD&#xA;us_dist &amp;lt;- exp(log_dist)&#xA;hist(us_dist)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I'm not sure what number should i take for the n parameter in rnorm. I took 10000 because it seems &quot;enough&quot; but what is the rule here ? Here is what i get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/pvmTQ.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/pvmTQ.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;### making a function of this&#xA;&#xA;&#xA;&#xA;future_price_range &amp;lt;- function(eod_prices, days, probability){&#xA;  last_price &amp;lt;- tail(eod_prices,1)&#xA;  mean_log_price &amp;lt;- log(last_price)&#xA;  sd_daily_returns &amp;lt;- sd(dailyReturn(eod_prices)) * sqrt(days)&#xA;  log_dist &amp;lt;- rnorm(n = 10000, mean = mean_log_price, sd = sd_daily_returns)&#xA;  usd_dist &amp;lt;- exp(log_dist)&#xA;  return(hist(usd_dist))&#xA;}&#xA;&#xA;future_price_range(eod_prices = pcef_ad, days = 100)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;So with 100 days the probability of having a higher/lower price increases as expected:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/BY6Lk.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/BY6Lk.png&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But now I'm struggling to implement the &quot;probability&quot; parameter in my function and return a vector of the 2 prices for the range.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Could you confirm that I haven't done any mistake in my code and do you have any clues to help me to finish It.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It would also be great if i could output the same kind of plot I used at the beginning of this post. I guess I need to compute the price range for each days until the target date and use the data to plot it on the graph but I have no idea how to do that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;There is one last thing I'd like to do: I take a end of day daily price time series, i set a number of days and i get a price range for a set of probabilities:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;function(price_data, nb_of_days)&#xA;&#xA;99%    55.12    20.90&#xA;95%    54.34    21.36&#xA;90%    53.26    22.35&#xA;80%    49.78    24.12&#xA;...    ...      ...&#xA;10%    ...      ...&#xA;5%     ...      ...&#xA;1%     ...      ...&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Any help would be much appreciated. Thank you so much in advance.&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;&lt;strong&gt;EDIT : Answer from @vanguard2k (Thank you so much !)&lt;/strong&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I made a few adjustment from @vanguard2k answer to make the code reproductible. For more details, have a look at the post below&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(PerformanceAnalytics)&#xA;library(quantmod)&#xA;library(ggplot2)&#xA;library(lubridate)&#xA;&#xA;# Retrieving price data from yahoo&#xA;pcef &amp;lt;- getSymbols(&quot;PCEF&quot;, auto.assign = FALSE)&#xA;&#xA;# Selecting only adjusted EOD prices&#xA;pcef_ad &amp;lt;- Ad(pcef)&#xA;&#xA;# tail(pcef_ad)&#xA;# PCEF.Adjusted&#xA;# 2017-11-15      23.21980&#xA;# 2017-11-16      23.40866&#xA;# 2017-11-17      23.51800&#xA;# 2017-11-20      23.53000&#xA;# 2017-11-21      23.57000&#xA;# 2017-11-22      23.62000&#xA;&#xA;# Computing daily returns&#xA;pcef_daily_returns &amp;lt;- dailyReturn(pcef_ad)&#xA;&#xA;# tail(pcef_daily_returns)&#xA;# daily.returns&#xA;# 2017-11-15 -0.0004278567&#xA;# 2017-11-16  0.0081334892&#xA;# 2017-11-17  0.0046709639&#xA;# 2017-11-20  0.0005102900&#xA;# 2017-11-21  0.0016999149&#xA;# 2017-11-22  0.0021213831&#xA;&#xA;# Annualized Standard Deviation of daily returns&#xA;sigma &amp;lt;- sd(pcef_daily_returns)*sqrt(365)&#xA;&#xA;# Why do we set a mean of zero ???&#xA;mean &amp;lt;- 0&#xA;probability &amp;lt;- 0.95&#xA;&#xA;# Last observed price as &quot;S&quot;&#xA;S &amp;lt;- coredata(tail(pcef_ad,1))[1,1]&#xA;&#xA;# Number of days to &quot;forecast&quot; as &quot;n&quot;&#xA;n &amp;lt;- 10&#xA;&#xA;upper.bounds &amp;lt;- qnorm(probability,mean=mean*(0:n)/365,sd=sigma*sqrt((0:n)/365))&#xA;# [1] 0.000000000 0.009768138 0.013814233 0.016918911 0.019536276&#xA;# [6] 0.021842220 0.023926954 0.025844064 0.027628466 0.029304414&#xA;# [11] 0.030889564&#xA;&#xA;&#xA;lower.bounds &amp;lt;- qnorm(1-probability,mean=mean*(0:n)/365,sd=sigma*sqrt((0:n)/365))&#xA;# [1]  0.000000000 -0.009768138 -0.013814233 -0.016918911 -0.019536276&#xA;# [6] -0.021842220 -0.023926954 -0.025844064 -0.027628466 -0.029304414&#xA;# [11] -0.030889564&#xA;&#xA;upper.cone &amp;lt;- S*exp(upper.bounds)&#xA;# [1] 23.62000 23.85185 23.94856 24.02303 24.08598 &#xA;# [6] 24.14159 24.19197 24.23839 24.28168 24.32241 &#xA;# [11] 24.36100&#xA;&#xA;lower.cone &amp;lt;- S*exp(lower.bounds)&#xA;# [1] 23.62000 23.39040 23.29595 23.22374 23.16303 &#xA;# [6] 23.10968 23.06155 23.01738 22.97635 22.93787 &#xA;# [11] 22.90154&#xA;&#xA;foo &amp;lt;- ggplot(data=data.frame(date=index(pcef_ad),data=coredata(pcef_ad)),aes(x=index(pcef_ad),y=coredata(pcef_ad))) + &#xA;  geom_line() + &#xA;  geom_polygon(data=data.frame(date=c(today()+0:n,today()+n:0),data=c(lower.cone,rev(upper.cone))),mapping=aes(x=date,y=data),alpha=1, fill = &quot;pink&quot;)&#xA;&#xA;foo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/AB2Ej.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/AB2Ej.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;h2&gt;&lt;strong&gt;EDIT 2&lt;/strong&gt;&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;I tried the code with a &quot;forecast&quot; period of 1000 days, just to see. And there is something in the produced values that I don't understand: Why is the upper range wider than the lower range ? It looks like the prediction takes account of the upside trend but how ? Honestly I expected the range to be symetrical with regard to the last observed price. I expected the blue line and the green line to have the same length, but the green one is bigger ... why ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/CUkez.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/CUkez.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="30596" LastEditorUserId="30596" LastEditDate="2017-11-24T17:21:37.643" LastActivityDate="2017-11-24T17:21:37.643" Title="R Calculate future price range and plot the result" Tags="&lt;time-series&gt;&lt;programming&gt;&lt;statistics&gt;&lt;probability&gt;" AnswerCount="1" CommentCount="4" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="37050" PostTypeId="2" ParentId="36636" CreationDate="2017-11-23T22:33:31.517" Score="5" Body="&lt;p&gt;Once upon a time, all option contracts ceased trading on the third Friday of every month.  There was no after hours trading for the underlying.  When the exchanges closed, everything was done.  This is no longer true.  Contracts do not exclusively cease trading on the third Friday, although some still do.  Likewise, the underlying can continue trading after the options cease trading.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This change creates liquidity mismatches.  In fact, an option can close out of the money at the end of options trading, but land in the money by the end of the aftermarket trading of the underlying.  From what I have inferred from your posts the cost of liquidity is not being modeled separately from the discount factor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In addition, some derivative contracts are used as proxies for other assets.  This also creates liquidity issues.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;You should consider formally modeling liquidity.  Bonds will do similar things as they get close to maturity.  The market maker has to make back their cost of capital regardless of how long until the closing date.  These are not &quot;jumps&quot; so much as a failure to control for the width of the bid-ask spread.  The spread often widens towards maturity to prevent a savvy investor from dumping bad inventory on the market maker at a favorable price.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Look at:&lt;/p&gt;&#xA;&#xA;&lt;blockquote&gt;&#xA;  &lt;p&gt;A. Abbott, Valuation Handbook, ch. Measures of Discount for Lack of Marketability and Liquidity, pp. 474–507. Hoboken, NJ: Wiley Finance, 2009.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&#xA;&lt;p&gt;I have used it to model liquidity.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your model does not consider the costs to the market maker and so is behaving badly on a date that is the common nexus of a variety of contracts.  This isn't a &quot;rigor&quot; issue so much as a misspecification issue.  This isn't the only type of contract that has this behavior.&lt;/p&gt;&#xA;" OwnerUserId="25459" LastActivityDate="2017-11-23T22:33:31.517" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="37051" PostTypeId="1" CreationDate="2017-11-23T22:53:10.870" Score="3" ViewCount="544" Body="&lt;p&gt;A soft question: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are there any existing packages in R that allows one to compute the modified duration and convexity of bonds in R? If there isn't, how can one go about doing so (with formulas) with the appropriate bond data obtained?&lt;/p&gt;&#xA;" OwnerUserId="29670" LastActivityDate="2017-11-23T22:53:10.870" Title="Modified duration and convexity of a bond in R" Tags="&lt;fixed-income&gt;&lt;programming&gt;&lt;bond&gt;&lt;duration&gt;&lt;convexity&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="37053" PostTypeId="1" CreationDate="2017-11-24T05:30:52.900" Score="5" ViewCount="490" Body="&lt;p&gt;It's clear that each aggressive order (or market order or limit crossing BBO) is matched against the same volume of resting limit order(s). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm interested in statistics per different types of traders, large or small. My hypothesis is that large traders such as market makers or execution algos execute more than 50% of their volume as resting orders, probably around 70-80%, but I could not find relevant studies. Will appreciate references to such studies. Alternatively, it can be statistics per account size of traders or anything relevant. I'm most interested in futures markets such as CME and Eurex, US stocks markets, and cryptocurrencies.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My main motivation to to ask this question is to evaluate the 'importance' of market depth (order book) data compared to trades data (or times and sales). It seems that trades data is just 3-10% of all market data updates, but it's not a reliable way to answer my (probably vague) question because resting orders can be cancelled or moved at any time.&lt;/p&gt;&#xA;" OwnerUserId="1515" LastEditorUserId="1515" LastEditDate="2017-11-24T07:16:01.057" LastActivityDate="2017-11-24T07:16:01.057" Title="What is the proportion of aggressive orders vs passive orders executed by different types of traders?" Tags="&lt;market-making&gt;&lt;limit-order-book&gt;&lt;order-execution&gt;&lt;volume&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="37055" PostTypeId="1" AcceptedAnswerId="37096" CreationDate="2017-11-24T09:09:59.220" Score="2" ViewCount="293" Body="&lt;p&gt;I'm creating a log price series in MATLAB. This is fairly easy to do using standard functions. Given a price series &lt;code&gt;prices&lt;/code&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;r = diff(log(prices))&lt;/code&gt; will give you the standard log return series calculated by &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r = \ln(P_t) - \ln(P_{t-1})$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, I'd like to use the &lt;a href=&quot;https://www.mathworks.com/help/finance/tick2ret.html&quot; rel=&quot;nofollow noreferrer&quot;&gt;tick2ret&lt;/a&gt; function in the Financial Toolbox to keep my tooling consistent. Here's where the confusion starts:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've always referred to &lt;code&gt;r&lt;/code&gt; above as the &quot;continually compounded return series&quot;. Perhaps this is incorrect. &lt;code&gt;tick2ret&lt;/code&gt; calculates, by default, the &quot;simple compounding return series&quot;. Curious, I made another return series:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;r2 = tick2ret(prices)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and as it turns out &lt;code&gt;r&lt;/code&gt; and &lt;code&gt;r2&lt;/code&gt; are virtually the same aside from rounding. I expected the &quot;simple compounded returns&quot; to be calculated using&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$r = \frac{P_t - P_{t-1}}{P_{t-1}}$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;However, according to my calculation they are using the log return calculation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Am I misunderstanding simple and compound returns? Can the log return series be calculated using simple compounding? I think I am getting lost in terminology. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you!&lt;/p&gt;&#xA;" OwnerDisplayName="user20664" LastActivityDate="2017-11-27T02:58:00.520" Title="Simple Compounding vs Continuous Compounding in return series" Tags="&lt;programming&gt;&lt;returns&gt;&lt;log-returns&gt;&lt;compounding&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37056" PostTypeId="1" AcceptedAnswerId="37090" CreationDate="2017-11-24T10:52:31.100" Score="3" ViewCount="773" Body="&lt;p&gt;I am trying to backtest a strategy with &lt;a href=&quot;https://www.backtrader.com/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Backtrader&lt;/a&gt; (not the first time) and have a problem while printing date &amp;amp; time for each iteration (time stay on 23:59:59). Here are the first lines of my dataset: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/Ld2QA.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/Ld2QA.png&quot; alt=&quot;Dataset lines&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What is printed on the console :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/KFB3P.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/KFB3P.png&quot; alt=&quot;Console log&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And finally how I load my data :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;data = bt.feeds.GenericCSVData(dataname=&quot;BTCUSD_15MIN.csv&quot;,&#xA;                           datetime=0,&#xA;                           fromdate=datetime.datetime(2015,1,13),&#xA;                           todate=datetime.datetime(2015,1,15),&#xA;                           open=1,&#xA;                           high=2,&#xA;                           low=3,&#xA;                           close=4,&#xA;                           openinterest=-1,&#xA;                           time=-1,&#xA;                           volume=-1,&#xA;                           dtformat=&quot;%Y-%m-%d %H:%M:%S&quot;)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Has someone already got this issue? Thanks a lot!&lt;/p&gt;&#xA;" OwnerUserId="29708" LastEditorUserId="29708" LastEditDate="2017-11-24T21:04:28.690" LastActivityDate="2017-11-26T11:20:49.210" Title="Backtrader doesn't display time when backtesting" Tags="&lt;backtesting&gt;&lt;python&gt;&lt;strategy&gt;" AnswerCount="2" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37057" PostTypeId="2" ParentId="36431" CreationDate="2017-11-24T12:03:52.797" Score="0" Body="&lt;p&gt;The Rick n Backer approach to the rolling window for stress scenario is the only logical and right approach you can choose. These rolling windows should be calculated for all the 5Y(if avaiable) data history. If we would only use data based on RHP we would get in quite big troubles with products with short RHP e.g when the produdct has shorter RHP than 21 days we wouldn't be able to calculate the risk scenario but all the scenarious are required to be shown in KID. Or if RHP would be more than 21 days but still somethig short we could get that stressed volatitily would be lower than the historic volatility which could result in that the stress scenario would be more optimistic than the unfavourable scenario which would be contradicting the idea behind the stress scenario.&lt;/p&gt;&#xA;" OwnerUserId="29333" LastActivityDate="2017-11-24T12:03:52.797" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37058" PostTypeId="2" ParentId="37008" CreationDate="2017-11-24T12:06:19.803" Score="2" Body="&lt;p&gt;First, I would emphasize that default protection is bought and sold on debt securities , not on assets.  To answer your question, you cannot sell protection on your own debt.  You can sell protection on sovereign debt, including the sovereign where your company is based.  However, the buyer of this protection understands that there may be a high correlation between the default of the sovereign and the default of your company (the so called wrong way risk mentioned by @noob2), so the price they pay for this protection may be a discount to the full market price.  &lt;/p&gt;&#xA;" OwnerUserId="18388" LastActivityDate="2017-11-24T12:06:19.803" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37059" PostTypeId="2" ParentId="36792" CreationDate="2017-11-24T12:07:07.180" Score="0" Body="&lt;p&gt;Yes in the dataflows there were some mixup (similar question with the &lt;a href=&quot;https://quant.stackexchange.com/questions/35762/priips-category-2-stress-scenario-methodology/35777#35777&quot;&gt;answer&lt;/a&gt;) with the data for the stress scenarious. But for the other scenarious you should be able to get to the results with no problem. Also I would like to address you to the &lt;a href=&quot;https://quant.stackexchange.com/questions/36431/priips-stress-scenario/37057#37057&quot;&gt;this&lt;/a&gt; question where you can find how you should address the rolling window and how to chose dataset for the stress scenarious.&lt;/p&gt;&#xA;" OwnerUserId="29333" LastActivityDate="2017-11-24T12:07:07.180" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37061" PostTypeId="2" ParentId="37049" CreationDate="2017-11-24T13:48:37.493" Score="3" Body="&lt;p&gt;First, you are right about your issue with $n$ (the nb_of_days). If you calculate the daily volatility of returns, you only need to multiply it by $n^{1/2}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you are trying to get is the volatility cone. Let $S$ be the last stock price, $p$ the probability of the stock price being below and $Q$ the quantile function of the standard normal.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The distribution of the log of returns is given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ log(S_1/S_0) \approx N(\mu_s/365,\sigma_S/(365)^{1/2})$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So, for the whole horizon, the upper border of the cone is given by&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ S_0 \cdot \text{exp}\left(Q(p)\cdot \sigma_S\cdot (n/365)^{1/2} + \mu_s\cdot n /365\right).$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The lower bound is the same term with $1-p$ respectively. For shorter time horizons, we just need to change the value for $n$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;It takes some time to produce a good plot but you could try something like this with the ggplot2 package:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;sigma &amp;lt;- sd(pcef_daily_return)*sqrt(365)&#xA;mean &amp;lt;- 0&#xA;probability &amp;lt;- 0.95&#xA;&#xA;S &amp;lt;- coredata(tail(pcef_ad,1))[1,1]&#xA;&#xA;upper.bounds &amp;lt;- qnorm(probability,mean=mean*(0:n)/365,sd=sigma*sqrt((0:n)/365))&#xA;lower.bounds &amp;lt;- qnorm(1-probability,mean=mean*(0:n)/365,sd=sigma*sqrt((0:n)/365))&#xA;upper.cone &amp;lt;- S*exp(upper.bounds)&#xA;lower.cone &amp;lt;- S*exp(lower.bounds)&#xA;&#xA;&#xA;foo &amp;lt;- ggplot(data=data.frame(date=index(pcef),data=coredata(pcef)),aes(x=index(pcef),y=coredata(pcef))) + &#xA;  geom_line() + &#xA;  geom_polygon(data=data.frame(date=c(today()+0:n,today()+n:0),data=c(lower.cone,rev(upper.cone))),mapping=aes(x=date,y=data),alpha=0.25)&#xA;&#xA;foo&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;" OwnerUserId="2727" LastEditorUserId="2727" LastEditDate="2017-11-24T15:02:43.847" LastActivityDate="2017-11-24T15:02:43.847" CommentCount="10" ContentLicense="CC BY-SA 3.0" />
  <row Id="37062" PostTypeId="1" CreationDate="2017-11-24T14:23:49.440" Score="1" ViewCount="114" Body="&lt;p&gt;I don't understand this passage from Shreve, Stochastic Calculus for Finance II. The points I want to clarify :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1 ) How does the volatility tells us which paths are possible ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;2 ) How does the change of measure from the Real to the Risk Neutral one put more probability on the paths with lower returns ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;this is from page 217 :&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/3vKvh.jpg&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/3vKvh.jpg&quot; alt=&quot;enter image description here&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="30609" LastEditorUserId="30610" LastEditDate="2017-11-24T15:12:11.867" LastActivityDate="2017-11-24T17:05:20.313" Title="Risk Neutral measure, reaffecting probabilities to paths" Tags="&lt;stochastic-processes&gt;&lt;risk-neutral-measure&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="37064" PostTypeId="2" ParentId="37062" CreationDate="2017-11-24T16:48:17.373" Score="2" Body="&lt;p&gt;&quot;How does the change of measure from the Real to the Risk Neutral one put more probability on the paths with lower returns ?&quot;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Are you familiar with how polling firms like Gallup adjust their sample to make them more representative of the general population? If they have interviewed 1000 people and find that they have fewer poor people than in the general population, they will overweight the opinions of the lower income subjects that they do have (i.e. give them a weight higher that $\frac{1}{1000}$). Through this ex-post re-weighting, you can change a sample that you already have to give it the statistical properties you want (in this case to lower the mean income of the sample).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Similarly, if you have a sample of 1,000,000 real price paths (having return $\mu$) generated by Monte Carlo simulation, you can overselect the lower return price paths and underselect the high return ones to bring the average return down to the risk free rate $r_f&amp;lt;\mu$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is what the famous &quot;change of measure&quot; and the Girsanov process does. It &quot;reweights the probabilities&quot; of various paths. See illustration here &lt;a href=&quot;https://en.wikipedia.org/wiki/Girsanov_theorem&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://en.wikipedia.org/wiki/Girsanov_theorem&lt;/a&gt;&lt;/p&gt;&#xA;" OwnerUserId="16160" LastEditorUserId="16160" LastEditDate="2017-11-24T17:05:20.313" LastActivityDate="2017-11-24T17:05:20.313" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37065" PostTypeId="1" CreationDate="2017-11-24T16:49:40.970" Score="10" ViewCount="1585" Body="&lt;p&gt;In the really interesting &lt;a href=&quot;https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2708678&quot; rel=&quot;noreferrer&quot;&gt;paper&lt;/a&gt; by Marcos Lopez de Prado a variation of risk parity is applied whereby the underlying assets of the portfolio are first split in 'correlation clusters' and the allocation percentages are distributed based on that.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;More specifically, the allocation algorithm is initially splitting the assets in two groups and assigning a variance-based allocation in these, while proceeding with a tree-like recursive procedure for the members of the two initial groups. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;This results in the weights being in [0,1], however, as mentioned a couple of times in the paper, this can be easily modified so as to accommodate different constraints. Any idea on how this would be possible? For example, how can I get the weights to be in the range [0.01 0.1]? &lt;/p&gt;&#xA;" OwnerUserId="22383" LastEditorUserId="22383" LastEditDate="2017-11-27T08:41:31.183" LastActivityDate="2017-11-28T17:34:19.517" Title="Hierarchical Risk Parity with allocation constraints?" Tags="&lt;portfolio-management&gt;&lt;risk-management&gt;&lt;portfolio-optimization&gt;&lt;risk-models&gt;&lt;covariance-matrix&gt;" AnswerCount="2" CommentCount="0" FavoriteCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="37066" PostTypeId="1" AcceptedAnswerId="37078" CreationDate="2017-11-24T18:08:08.293" Score="0" ViewCount="285" Body="&lt;p&gt;Good evening,&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've tried searching similar posts, but most are unanswered or in a more advanced step than what I'm trying to achieve.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I've managed to do the boostrap method for spot prices underlyings. I've confirmed the results with the EIOPA slides and it's working as intended.&#xA;What I don't understand however, is what to do when my underlying is a &lt;strong&gt;bond&lt;/strong&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The legislation states that I must do a &lt;strong&gt;PCA&lt;/strong&gt; to my residual maturity matrix. Is this matrix for all my bonds (ex: each column is the maturity of a bond?) or just for one underlying? Why do I need a matrix in this case instead of a vector?&#xA;The rest of the steps seem clear except for what they mean about the return matrix. Again, if I have one underlying that is a bond, is this just a vector of returns (calculated from the market prices of my bond) like I have for spot price underlyings?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In step 23.b) I also have questions:&#xA;It seems I will create a &lt;strong&gt;N&lt;/strong&gt;x&lt;strong&gt;T&lt;/strong&gt; matrix similar to the other bootstrap method, where &lt;strong&gt;N is 10k&lt;/strong&gt; (simulation number) and T is the number of days in the RHP, what I don't understand is what value I'm going to sample to fulfil my matrix. The steps don't seem very clear to me.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And in the end, how shall I join both boostrap methodologies results to value my PRIIP? If I have 1 bond and 1 equity, I'm going to obtain 10k results for each, do I take the 9750th value of both vectors and sum them to obtain my total VaR ?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks for the help, and please ask for more details if I wasn't clear explaining a point. &lt;/p&gt;&#xA;" OwnerUserId="30612" LastActivityDate="2017-11-25T12:32:53.780" Title="PRIIP Category 3 Curves" Tags="&lt;bond&gt;&lt;var&gt;&lt;pca&gt;&lt;priips&gt;&lt;bootstrap&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="37067" PostTypeId="2" ParentId="37040" CreationDate="2017-11-24T19:26:56.263" Score="2" Body="&lt;p&gt;Here is how you do that in R with library &quot;rugarch&quot;:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;library(rugarch)&#xA;#n=1e3; set.seed(1); x=rnorm(n); set.seed(2); y=rnorm(n); set.seed(3); z=rnorm(n)&#xA;spec = ugarchspec(variance.model = list(external.regressors = cbind(z)), mean.model = list(armaOrder = c(0, 0), external.regressors = cbind(x)))&#xA;fit = ugarchfit(spec = spec, data = y)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;The object &lt;code&gt;fit&lt;/code&gt; contains the fitted model. If you uncomment the second line, you can try it out with randomly generated data.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;(I suppose you meant $b_2$ -- not $b_3$ -- before $h_{t-1}$.)&lt;/p&gt;&#xA;" OwnerUserId="19645" LastActivityDate="2017-11-24T19:26:56.263" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37068" PostTypeId="2" ParentId="37056" CreationDate="2017-11-24T21:05:30.897" Score="2" Body="&lt;p&gt;&lt;strong&gt;&lt;em&gt;Answer&lt;/em&gt;&lt;/strong&gt;: This is the line that sorted out my issue :&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;timeframe=bt.TimeFrame.Ticks&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;If interested in the strategy results, it's &lt;a href=&quot;https://myfinancialmarkets.club/2017/11/23/backtest-a-trading-strategy-in-python/&quot; rel=&quot;nofollow noreferrer&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="29708" LastActivityDate="2017-11-24T21:05:30.897" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37070" PostTypeId="2" ParentId="37015" CreationDate="2017-11-24T23:56:18.850" Score="13" Body="&lt;h3&gt;The underlying problem: your ACTR constraints aren't convex&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;The &lt;span class=&quot;math-container&quot;&gt;$i$&lt;/span&gt;th constraint on your risk contribution can be written:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ w_i \sum_j \sigma_{ij} w_j \leq c_i s$$&lt;/span&gt;&#xA;And this isn't a convex constraint because of the &lt;span class=&quot;math-container&quot;&gt;$w_j w_i$&lt;/span&gt; terms (a function &lt;span class=&quot;math-container&quot;&gt;$g(x,y)=xy$&lt;/span&gt; isn't convex in &lt;span class=&quot;math-container&quot;&gt;$x$&lt;/span&gt; and &lt;span class=&quot;math-container&quot;&gt;$y$&lt;/span&gt;). They're not convex constraints, so you won't be able to write them as convex constraints in CVX's ruleset.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;More detail on your optimization problem&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Let &lt;span class=&quot;math-container&quot;&gt;$\mathbf{w}$&lt;/span&gt; denote a vector of portfolio weights, &lt;span class=&quot;math-container&quot;&gt;$\boldsymbol{\mu}$&lt;/span&gt; a vector of expected returns, &lt;span class=&quot;math-container&quot;&gt;$\Sigma$&lt;/span&gt; a covariance matrix, &lt;span class=&quot;math-container&quot;&gt;$s$&lt;/span&gt; the maximum standard deviation, &lt;span class=&quot;math-container&quot;&gt;$\mathbf{m}$&lt;/span&gt; a vector of the maximum marginal contributions to risk, and &lt;span class=&quot;math-container&quot;&gt;$\mathbf{c}$&lt;/span&gt; a vector of the the maximum contributions to risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Directly translating a maximize return subject to constraints on (1) standard deviation of portfolio returns, (2) marginal contribution to risk, and (3) marginal contribution to risk times portfolio weights where &lt;span class=&quot;math-container&quot;&gt;$\circ$&lt;/span&gt; denotes the element wise product (i.e. &lt;a href=&quot;https://en.wikipedia.org/wiki/Hadamard_product_(matrices)&quot; rel=&quot;noreferrer&quot;&gt;hadammard product&lt;/a&gt;).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;\begin{equation}&#xA;	\begin{array}{*2{&amp;gt;{\displaystyle}r}}&#xA;	\mbox{maximize (over $\mathbf{w}$)} &amp;amp; \boldsymbol{\mu}' \mathbf{w} \\&#xA;	\mbox{subject to} &amp;amp; \sqrt{\mathbf{w}' \Sigma \mathbf{w}} \leq s\\ &#xA;    &amp;amp; \frac{1}{\sqrt{ \mathbf{w}' \Sigma \mathbf{w} }}\Sigma \mathbf{w} \leq \mathbf{m} \\&#xA;    &amp;amp; \frac{1}{\sqrt{\mathbf{w}'\Sigma \mathbf{w}}}\left( \Sigma \mathbf{w} \right)  \circ \mathbf{w} \leq \mathbf{c}&#xA;	\end{array}&#xA;\end{equation}&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Assuming the standard deviation constraint binds we have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;\begin{equation}&#xA;	\begin{array}{*2{&amp;gt;{\displaystyle}r}}&#xA;	\mbox{maximize (over $\mathbf{w}$)} &amp;amp; \boldsymbol{\mu}' \mathbf{w} \\&#xA;	\mbox{subject to} &amp;amp; \sqrt{\mathbf{w}' \Sigma \mathbf{w}} \leq s\\ &#xA;    &amp;amp; \Sigma \mathbf{w} \leq s \mathbf{m} \\&#xA;    &amp;amp; \left( \Sigma \mathbf{w} \right)  \circ \mathbf{w} \leq s \mathbf{a} \quad \quad \text{&amp;lt;----- still not convex}&#xA;	\end{array}&#xA;\end{equation}&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We now have a convex optimization problem (i.e. convex objective subject to affine equality constraints and convex inequality constraints) &lt;strong&gt;EXCEPT&lt;/strong&gt; for the last constraint! You won't be able to write the contribution to risk constraint as a convex constraint using CVX's ruleset because it is not convex! &lt;/p&gt;&#xA;&#xA;&lt;p&gt;What to do? One approach is to use a more generalized solver and be aware that you may encounter local maxima since the problem is not convex. You're right that these are common constraints. There are papers out there on this topic, and you could possibly examine some of the algorithms proposed. For example, the paper, &lt;a href=&quot;http://ieeexplore.ieee.org/document/7145485/&quot; rel=&quot;noreferrer&quot;&gt;&quot;SCRIP: Successive Convex Optimization Methods for Risk Parity Portfolio Design&quot;&lt;/a&gt; looks interesting, but I haven't read it closely enough to endorse it. &lt;/p&gt;&#xA;&#xA;&lt;h2&gt;Further background on the problem: why these constraints?&lt;/h2&gt;&#xA;&#xA;&lt;p&gt;Let &lt;span class=&quot;math-container&quot;&gt;$\mathbf{w}$&lt;/span&gt; be a vector representing portfolio weights of &lt;span class=&quot;math-container&quot;&gt;$n$&lt;/span&gt; risky assets (i.e. excluding the risk free rate), and  Let &lt;span class=&quot;math-container&quot;&gt;$\Sigma$&lt;/span&gt; be the covariance matrix of their returns..&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The standard deviation of portfolio returns &lt;span class=&quot;math-container&quot;&gt;$R_p = \mathbf{w}' \mathbf{R} + \left( 1 - \sum_i w_i\right) r_f $&lt;/span&gt; as a function of weights &lt;span class=&quot;math-container&quot;&gt;$\mathbf{w}$&lt;/span&gt; are given by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;\begin{align*} f (\mathbf{w}) &amp;amp;= \operatorname{Std}(R_p) \\ &amp;amp;= \sqrt{\mathbf{w}'\Sigma\mathbf{w} }&#xA;\end{align*}&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Take the partial derivative with respect to portfolio weights and you get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ \frac{\partial f}{\partial \mathbf{w}} = \frac{1}{f (\mathbf{w})}\Sigma \mathbf{w}$$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Observe that the standard deviation of returns &lt;span class=&quot;math-container&quot;&gt;$f(\mathbf{w})$&lt;/span&gt; is homogenous of degree one in weights &lt;span class=&quot;math-container&quot;&gt;$\mathbf{w}$&lt;/span&gt; (i.e. &lt;span class=&quot;math-container&quot;&gt;$f (\lambda \mathbf{w}) = \lambda f(\mathbf{w})$&lt;/span&gt; hence by &lt;a href=&quot;http://mathworld.wolfram.com/EulersHomogeneousFunctionTheorem.html&quot; rel=&quot;noreferrer&quot;&gt;Euler's homogeneous function theorem&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;span class=&quot;math-container&quot;&gt;$$ f(\mathbf{w}) = w_1 \frac{\partial f}{\partial w_1} +w_2 \frac{\partial f}{\partial w_2}+ \ldots + w_n \frac{\partial f}{\partial w_n} $$&lt;/span&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;A lot of people call  &lt;span class=&quot;math-container&quot;&gt;$w_i \frac{\partial f}{\partial w_i}$&lt;/span&gt; asset &lt;span class=&quot;math-container&quot;&gt;$i$&lt;/span&gt;'s contribution to risk since they nicely adds up to the total. But note that &lt;span class=&quot;math-container&quot;&gt;$w_i\frac{\partial f}{\partial w_i}$&lt;/span&gt; does &lt;strong&gt;NOT&lt;/strong&gt; measure what would happen to the standard deviation of portfolio returns if the entire position in asset &lt;span class=&quot;math-container&quot;&gt;$i$&lt;/span&gt; is excluded.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Rather, it's a derivative. Observe &lt;span class=&quot;math-container&quot;&gt;$\frac{\partial f}{\partial \log w_i} = w_i \frac{\partial f}{\partial w_i}$&lt;/span&gt; hence the term relates the change in standard deviation to an infinitesimally small &lt;em&gt;percent&lt;/em&gt; change in position size. (You can show taking &lt;span class=&quot;math-container&quot;&gt;$\frac{d}{\log x}$&lt;/span&gt; gives the derivative with respect to a percent change in &lt;span class=&quot;math-container&quot;&gt;$x$&lt;/span&gt;.)&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2019-05-16T17:16:46.293" LastActivityDate="2019-05-16T17:16:46.293" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="37071" PostTypeId="1" CreationDate="2017-11-25T03:23:57.770" Score="0" ViewCount="642" Body="&lt;p&gt;Researching a return series on some currency pairs I grabbed 2 years worth of daily data and got to work trying to fit an ARIMA/GARCH model to it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Fitting the (log) return series:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;r = tick2ret(midPrice)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;and then calculating the ACF and PACF&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;autocorr(r)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;parcorr(r)&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I get plots that look like:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;a href=&quot;https://i.stack.imgur.com/f1rhK.png&quot; rel=&quot;nofollow noreferrer&quot;&gt;&lt;img src=&quot;https://i.stack.imgur.com/f1rhK.png&quot; alt=&quot;Plots&quot;&gt;&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Clearly the return series is mean reverting with it's mean hovering comfortably around zero.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;About this time I usually say &quot;a ha!&quot; and spot the &lt;code&gt;p&lt;/code&gt; and &lt;code&gt;q&lt;/code&gt; I need to fit an ARIMA model from the ACF and PACF. However, the only lag here that is significant (considering ~5% of the lags touching will be by chance) is lag 0. This occurs on both the ACF and PACF. This means my return series is discrete white noise! That can't be right &lt;em&gt;at all&lt;/em&gt;.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Going further and performing the ljung-box test on the return series:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;code&gt;[h,p] = lbqtest(r,'Lags', 8);&lt;/code&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Shows &lt;code&gt;h = 0&lt;/code&gt; and &lt;code&gt;p = 0.7746&lt;/code&gt; indicating we almost certainly have no autocorrelation up to lag 8.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I feel like something is going wrong here. My intuition would tell me if the return series is mean reverting you would certainly have autocorrelation up to some lag.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What could be going wrong here? I'm still new to MATLAB (coming from R) so it's possible I'm doing something wrong...but I don't think so...&lt;/p&gt;&#xA;" OwnerDisplayName="user20664" LastActivityDate="2017-11-25T03:23:57.770" Title="Interpreting ACF/PACF of return series" Tags="&lt;time-series&gt;&lt;auto-correlation&gt;&lt;arima&gt;&lt;lags&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="37073" PostTypeId="1" CreationDate="2017-11-25T08:55:12.833" Score="0" ViewCount="377" Body="&lt;p&gt;I read that small cap stocks are more volatile than large cap stocks. Now I am looking for sources (e.g research papers or similiar) with empirical evidence for this proposition but I can't find any (maybe I am not searching correctly, but I come from a more mathematical background so bear with me). Can anyone give some papers or some hints what and where to search?&lt;/p&gt;&#xA;" OwnerUserId="29546" LastActivityDate="2018-09-29T17:13:44.957" Title="Volatility of stocks small cap vs large cap" Tags="&lt;volatility&gt;&lt;equities&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="37074" PostTypeId="1" AcceptedAnswerId="37081" CreationDate="2017-11-25T09:01:26.910" Score="1" ViewCount="130" Body="&lt;p&gt;I read the book of Skiadas Asset Pricing Theory 2009. I don't quite understand what does mean pricing cash flow. In the book it's written:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\textbf{Definition 2.9}$  A cash flow $x^*$ is a pricing cash flow if $x^* \in X$ and there exist constants $\rho$ and $q$ such that $q \neq 0$ and:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$x(0) + \rho\mathbb{E}[x(1)] + q\mathbb{Cov}[x^*(1),x(1)] = 0 \qquad \forall x \in X$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$X$ - market of cash flows&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$x(0)$ price of cash flow&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$x(1)$ payoff at different states of nature $K$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm looking for some geometric and/or economic interpretation.&#xA;Thanks in advance!&lt;/p&gt;&#xA;" OwnerUserId="26003" LastActivityDate="2017-11-25T16:48:19.707" Title="Economic intuition behind pricing cash flow" Tags="&lt;asset-pricing&gt;&lt;mean-variance&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="37075" PostTypeId="2" ParentId="37073" CreationDate="2017-11-25T10:05:18.717" Score="5" Body="&lt;p&gt;If you compute the standard deviation of returns (wich is the common measure of volatility) of small-caps stocks vs. large-cap stocks. Small caps stocks usually show a higher volatility of price returns.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you go to morningstar.com, search for SPY (S&amp;amp;P 500, large cap ETF) you'll see an annual standard deviation of around 10%. In comparaison, IWM (Russell 2000, Small Cap ETF) have a standard deviation of around 14%.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You don't need a research paper to prove this.&lt;/p&gt;&#xA;" OwnerUserId="30596" LastEditorUserId="30596" LastEditDate="2018-09-29T17:13:44.957" LastActivityDate="2018-09-29T17:13:44.957" CommentCount="0" ContentLicense="CC BY-SA 4.0" />
  <row Id="37076" PostTypeId="1" AcceptedAnswerId="37077" CreationDate="2017-11-25T10:45:36.747" Score="1" ViewCount="117" Body="&lt;p&gt;How does one hedge against any exchange risk?&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;A Japanese exporter has a €1,000,000 receivable due in one year. Detail a strategy using a money market hdege that will eliminate any exchange rate risk.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;1-year rates of interest:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{array}{r|c|c}&#xA;\text{Currency} &amp;amp; \text{Borrowing} &amp;amp; \text{Lending}\\&#xA;\hline&#xA;Dollar\ (\$) &amp;amp; 4.50\ \% &amp;amp; 4.00\ \%  \\&#xA;Euro\ (€) &amp;amp; 6.00\ \% &amp;amp; 5.35\ \%  \\&#xA;Yen\ (¥) &amp;amp; 1.00\ \% &amp;amp; 0.75\ \%&#xA;\end{array}&#xA;$$&#xA;The spot rates are as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{array}{cc}&#xA;\ Current\ Spot\ Exchange\ Rates &amp;amp; \ &amp;amp; \ One\ Year\ Forward\ Rates\\&#xA;\&#xA;\$ 1.25 = €1.00 &amp;amp; \ &amp;amp; \$ 1.2262 = €1.00  \\&#xA;\$ 1.00 = ¥1.00 &amp;amp; \ &amp;amp; \$ 1.03 = ¥100  \\\end{array}&#xA;$$&lt;/p&gt;&#xA;" OwnerUserId="30520" LastEditorUserId="30520" LastEditDate="2017-11-25T14:31:34.110" LastActivityDate="2017-11-28T12:14:16.880" Title="Hedging against exchange risk" Tags="&lt;hedge&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37077" PostTypeId="2" ParentId="37076" CreationDate="2017-11-25T11:35:36.510" Score="1" Body="&lt;p&gt;So after much calculations, this is the approach:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In 1 year you need €1,000,000, how much do you need currently (&lt;em&gt;$x$&lt;/em&gt;)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If the euro interest rate is at 6%, &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ x\ \times\ (1+6\%) = x(1.06) = €\ 1,000,000$$&#xA;$$ \begin{align}x\ = \frac{€\ 1,000,000}{1.06} &#xA;\newline \therefore\ x\ = €\ 943,396.22\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;With the current spot rate, we can convert € 943,396.22 into dollars by:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$€\ 943,396.22 \times  \frac{$1.25}{€} = $\ 1,179,245.28$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You would convert these dollars to yen:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\$\ 1,179,245.28 \times \frac{¥\ 100}{$} = ¥\ 117,924,528.30$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;The answer is:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You would borrow € 943,396.22 today. Convert the euro to dollars at the spot exchange rate, convert these dollars to yen at the spot rate, and receive ¥117,924,528.30&lt;/p&gt;&#xA;" OwnerUserId="30520" LastEditorUserId="30520" LastEditDate="2017-11-28T12:14:16.880" LastActivityDate="2017-11-28T12:14:16.880" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="37078" PostTypeId="2" ParentId="37066" CreationDate="2017-11-25T12:32:53.780" Score="0" Body="&lt;p&gt;Think of the specific bond you are interested in as being priced off a curve (e.g. a govt bonds par rates curve). The curve is actually represented by a vector of rates $(R_1,...,R_I)$ indexed by tenors $(T_1,...,T_I)$, and when repricing a specific bond you first interpolate its yield in the curve. Now if you want to generate sample random paths for your bond price, you first need to generate sample random paths for your curve $(R_1,...,R_I)$. Now if $I$ is large that would be time consuming, so what the legislator says is &lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;do a PCA on the variance-covariance matrix for the returns of $(R_1,...,R_I)$;&lt;/li&gt;&#xA;&lt;li&gt;select the 3 principal factors $(x_1, x_2, x_3)$ (those that correspond to the 3 largest eigenvalues);&lt;/li&gt;&#xA;&lt;li&gt;generate sample random paths for $(x_1, x_2, x_3)$, then reconstruct the sample paths for the returns of $(R_1,...,R_I)$ from $(x_1, x_2, x_3)$ and the PCA transition matrix. &lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="17606" LastActivityDate="2017-11-25T12:32:53.780" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="37079" PostTypeId="1" CreationDate="2017-11-25T12:54:39.710" Score="3" ViewCount="1922" Body="&lt;p&gt;Here are three statements:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;A lower coupon bond exhibits higher duration.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;The higher the coupon rate, the lower a bond’s convexity. Zero-coupon bonds have the highest convexity.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;Given particular duration, the convexity of a bond portfolio tends to be&#xA;greatest when the portfolio provides payments evenly over a long period of time. It is least when the payments are concentrated around one particular point in time.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;And we have the relation&#xA;$$\dfrac{\Delta B}{B} = -D\Delta y + \dfrac{1}{2}C(\Delta y)^2.$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I understand above three statements as given two coupon paying structures with same maturity and same principle, then at a intersection point $(y_0,B_0),$ we compare their duration, convexity?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And can anyone proof why in formula?&lt;/p&gt;&#xA;" OwnerUserId="26165" LastEditorUserId="26165" LastEditDate="2017-11-27T11:32:08.063" LastActivityDate="2018-05-13T22:37:32.043" Title="The relation between coupon and convexity" Tags="&lt;bond&gt;&lt;duration&gt;&lt;convexity&gt;" AnswerCount="1" CommentCount="5" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="37080" PostTypeId="1" CreationDate="2017-11-25T13:21:37.173" Score="4" ViewCount="100" Body="&lt;p&gt;I'm writing a backtester and using an order-by-order Nasdaq ITCH feed whilst testing it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let's say the bid-ask spread is 100 @ 9-11 @ 100&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My strategy inserts an bid order for 100 @ 10 and this becomes the new best bid. I continue parsing the ITCH feed and I see that the 100 @ 9 has traded. This implies had I really placed a bid for 10, that would have traded now. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;So instead of removing the bid at 9, I remove my own order and notify my strategy that we were just filled. However, in reality the bid at 9 disappeared and therefore ITCH would never send another message (i.e. cancel) for it because as far as they're concerned, it no longer exists. Therefore I am stuck with this order in the book, which actually shouldn't be there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Is this situation unavoidable in a backtesting simulation? Or is there something I can/should do?&lt;/p&gt;&#xA;" OwnerUserId="5168" LastEditorUserId="5168" LastEditDate="2017-11-25T14:31:54.327" LastActivityDate="2017-11-25T14:31:54.327" Title="Backtesting: what happens to real-executed order if mine fills instead?" Tags="&lt;quant-trading-strategies&gt;&lt;backtesting&gt;&lt;strategy&gt;" AnswerCount="0" CommentCount="0" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="37081" PostTypeId="2" ParentId="37074" CreationDate="2017-11-25T16:10:40.740" Score="4" Body="&lt;p&gt;All that's going on here are essentially consequences of a linear pricing function.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;That asset prices should be linear in their payoffs makes intuitive economic sense: the value of a basket of payoffs is the sum of the basket contents. An assumption that the pricing function is linear is sometimes referred to as the law of one price.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Quick review&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;Let $f$ be a pricing function which gives you the current price $X_0$ of a future, stochastic payoff $X_1$. If $f$ is linear, $f(a X_1 + b Y_1) = a f(X_1) + b f(Y_1)$, then $f$ can be written as the inner product with some stochastic discount factor.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ f(X_1) = \mathbb{E}[MX_1]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $X^*$ be the &lt;a href=&quot;https://en.wikipedia.org/wiki/Projection_(linear_algebra)&quot; rel=&quot;nofollow noreferrer&quot;&gt;projection&lt;/a&gt; of $M$ onto the space of payoffs $\underline{X}$. $X^* \in \underline{X}$ will also work as the discount factor for $X_1 \in \underline{X}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ f(X_1) = \mathbb{E}[ X^* X_1] $$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we can just do some algebra:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ X_0 = \mathbb{E}[X^*X_1]$$&#xA;$$ X_0 = \mathbb{Cov}[X^*, X_1] + \mathbb{E}[X^*] \mathbb[X_1]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm following how John Cochrane defines $X^*$ in his book &lt;em&gt;Asset Pricing&lt;/em&gt;. The book here appears to call any scalar multiple of $X^*$ a pricing cash flow?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Anyway, you can manipulate these equations to bring out classic regression beta models and the mean variance frontier.&lt;/p&gt;&#xA;" OwnerUserId="20582" LastEditorUserId="20582" LastEditDate="2017-11-25T16:48:19.707" LastActivityDate="2017-11-25T16:48:19.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37083" PostTypeId="1" CreationDate="2017-11-25T19:52:36.477" Score="1" ViewCount="643" Body="&lt;p&gt;I am looking for a good reference for Monte Carlo simulation applied to derivatives with Python. Most books I found until now deal with C++... I have found &quot;Derivatives Analytics with Python&quot; by Yves Hilpisch, has anyone already read it or has a good reference to suggest?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;br/&gt;Thanks a lot!&lt;/p&gt;&#xA;" OwnerUserId="29708" LastEditorUserId="18555" LastEditDate="2018-01-16T21:05:04.573" LastActivityDate="2018-01-16T21:05:04.573" Title="Books about Monte Carlo Simulation on derivatives with Python" Tags="&lt;monte-carlo&gt;&lt;derivatives&gt;&lt;python&gt;&lt;simulations&gt;&lt;books&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="37084" PostTypeId="2" ParentId="36987" CreationDate="2017-11-25T22:41:14.777" Score="2" Body="&lt;p&gt;Have found that using Alpha =0.06, Beta =0.93, omega =0.01 works fairly well. That is from calibrating to histories over quite long time periods. &lt;/p&gt;&#xA;" OwnerUserId="30522" LastActivityDate="2017-11-25T22:41:14.777" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="37088" PostTypeId="2" ParentId="36991" CreationDate="2017-11-26T07:23:59.680" Score="0" Body="&lt;p&gt;Try with&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align}&#xA;dX(s)&amp;amp;=dW_{1}(s) \\&#xA;dY(s)&amp;amp;=dW_{1}(s)+\sqrt{2}dW_{2}(s)&#xA;\end{align}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The covariance matrix of these differentials is $$\left(\begin{array}{cc} 1 &amp;amp; 1 \\ 1 &amp;amp; 3\end{array}\right) \; .$$&lt;/p&gt;&#xA;" OwnerUserId="156" LastActivityDate="2017-11-26T07:23:59.680" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="37089" PostTypeId="1" CreationDate="2017-11-26T10:43:16.317" Score="3" ViewCount="177" Body="&lt;p&gt;Is using leveraged ETF cheaper than borrowing money and buying regular 1x ETF? Let's assume that we're rebalancing daily and interest rate for borrowing is something like 2.66% (taken from Interactive brokers - benchmark + 1.5%). One such example could be TLT and TMF.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'd say that using leveraged ETF could be cheaper because they can finance it more effectively using financial derivatives, on the other hand expenses are larger as well. But there are other things like tracking error, etc.&lt;/p&gt;&#xA;" OwnerUserId="29299" LastActivityDate="2019-02-25T06:07:03.373" Title="Are leveraged ETFs cheaper than using leverage?" Tags="&lt;etf&gt;&lt;leverage&gt;" AnswerCount="2" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="37090" PostTypeId="2" ParentId="37056" CreationDate="2017-11-26T11:20:49.210" Score="2" Body="&lt;p&gt;That for sure only solved your problem by chance (because what you chose is smaller than the actual reality)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Your data is obviously &lt;code&gt;15-minutes&lt;/code&gt; based. But without specification, you let the default values in place: &lt;code&gt;bt.TimeFrame.Daily&lt;/code&gt;, which gives you the &lt;strong&gt;end of the day&lt;/strong&gt; for each bar. No surprises there.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The right choice would therefore be:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;timeframe=bt.TimeFrame.Minutes,&#xA;compression=15,&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;This is explained in the &lt;em&gt;backtrader&lt;/em&gt; community in several posts and in the FAQ.&lt;/p&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;FAQ: &lt;a href=&quot;https://community.backtrader.com/topic/381/faq&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://community.backtrader.com/topic/381/faq&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;One post with the same content: &lt;a href=&quot;https://community.backtrader.com/topic/244/backtesting-1-minute-data/&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://community.backtrader.com/topic/244/backtesting-1-minute-data/&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="17554" LastActivityDate="2017-11-26T11:20:49.210" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37091" PostTypeId="1" AcceptedAnswerId="37117" CreationDate="2017-11-26T13:29:30.300" Score="6" ViewCount="4063" Body="&lt;p&gt;I would want to use QuantLib Python to calculate DV01 of an interest rate swap.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Initially I was thinking of calculating the fixed leg DV01 and floating leg DV01 separately, then add both legs DV01 together to get the swap DV01. However, I don't know how to calculate the floating leg DV01 using QuantLib Python.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In the end I took a different approach to calculate interest rate swap DV01 using the following code: &lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;from QuantLib import *&#xA;&#xA;# global data&#xA;calendar = TARGET()&#xA;todaysDate = Date(6,November,2001);&#xA;Settings.instance().evaluationDate = todaysDate&#xA;settlementDate = Date(8,November,2001);&#xA;&#xA;# market quotes&#xA;deposits = { (1,Weeks): 0.0382,&#xA;             (1,Months): 0.0372,&#xA;             (3,Months): 0.0363,&#xA;             (6,Months): 0.0353,&#xA;             (9,Months): 0.0348,&#xA;             (1,Years): 0.0345 }&#xA;&#xA;swaps = { (2,Years): 0.037125,&#xA;          (3,Years): 0.0398,&#xA;          (5,Years): 0.0443,&#xA;          (10,Years): 0.05165,&#xA;          (15,Years): 0.055175 }&#xA;&#xA;# convert them to Quote objects&#xA;for n,unit in deposits.keys():&#xA;    deposits[(n,unit)] = SimpleQuote(deposits[(n,unit)])&#xA;for n,unit in swaps.keys():&#xA;    swaps[(n,unit)] = SimpleQuote(swaps[(n,unit)])&#xA;&#xA;# build rate helpers&#xA;&#xA;dayCounter = Actual360()&#xA;settlementDays = 2&#xA;depositHelpers = [ DepositRateHelper(QuoteHandle(deposits[(n,unit)]),&#xA;                                     Period(n,unit), settlementDays,&#xA;                                     calendar, ModifiedFollowing,&#xA;                                     False, dayCounter)&#xA;                   for n, unit in [(1,Weeks),(1,Months),(3,Months),&#xA;                                   (6,Months),(9,Months),(1,Years)] ]&#xA;&#xA;fixedLegFrequency = Annual&#xA;fixedLegTenor = Period(1,Years)&#xA;fixedLegAdjustment = Unadjusted&#xA;fixedLegDayCounter = Thirty360()&#xA;floatingLegFrequency = Semiannual&#xA;floatingLegTenor = Period(6,Months)&#xA;floatingLegAdjustment = ModifiedFollowing&#xA;swapHelpers = [ SwapRateHelper(QuoteHandle(swaps[(n,unit)]),&#xA;                               Period(n,unit), calendar,&#xA;                               fixedLegFrequency, fixedLegAdjustment,&#xA;                               fixedLegDayCounter, Euribor6M())&#xA;                for n, unit in swaps.keys() ]&#xA;&#xA;# term structure handles&#xA;&#xA;discountTermStructure = RelinkableYieldTermStructureHandle()&#xA;forecastTermStructure = RelinkableYieldTermStructureHandle()&#xA;&#xA;# term-structure construction&#xA;&#xA;helpers = depositHelpers + swapHelpers&#xA;depoSwapCurve = PiecewiseFlatForward(settlementDate, helpers, Actual360())&#xA;&#xA;swapEngine = DiscountingSwapEngine(discountTermStructure)&#xA;&#xA;# 5Y Swap &#xA;&#xA;nominal = 1000000&#xA;maturity = calendar.advance(settlementDate,5,Years)&#xA;&#xA;fixedLegFrequency = Annual&#xA;fixedLegAdjustment = Unadjusted&#xA;fixedLegDayCounter = Thirty360()&#xA;fixedRate = 0.04&#xA;&#xA;floatingLegFrequency = Semiannual&#xA;spread = 0.0&#xA;fixingDays = 2&#xA;index = Euribor6M(forecastTermStructure)&#xA;floatingLegAdjustment = ModifiedFollowing&#xA;floatingLegDayCounter = index.dayCounter()&#xA;&#xA;fixedSchedule = Schedule(settlementDate, maturity,&#xA;                         fixedLegTenor, calendar,&#xA;                         fixedLegAdjustment, fixedLegAdjustment,&#xA;                         DateGeneration.Forward, False)&#xA;floatingSchedule = Schedule(settlementDate, maturity,&#xA;                            floatingLegTenor, calendar,&#xA;                            floatingLegAdjustment, floatingLegAdjustment,&#xA;                            DateGeneration.Forward, False)&#xA;&#xA;swap = VanillaSwap(VanillaSwap.Receiver, nominal,&#xA;                   fixedSchedule, fixedRate, fixedLegDayCounter,&#xA;                   floatingSchedule, index, spread,&#xA;                   floatingLegDayCounter)&#xA;swap.setPricingEngine(swapEngine)&#xA;&#xA;&#xA;discountTermStructure.linkTo(depoSwapCurve)&#xA;forecastTermStructure.linkTo(depoSwapCurve)&#xA;print('Fixed Leg DV01')&#xA;print(swap.fixedLegBPS())&#xA;&#xA;shift = 0.0001&#xA;&#xA;temp_fyc_handle = YieldTermStructureHandle(depoSwapCurve)&#xA;temp_dyc_handle = YieldTermStructureHandle(depoSwapCurve)&#xA;shiftedForwardCurve = ZeroSpreadedTermStructure(temp_fyc_handle, QuoteHandle(SimpleQuote(shift)))&#xA;shiftedDiscountCurve = ZeroSpreadedTermStructure(temp_dyc_handle, QuoteHandle(SimpleQuote(shift)))&#xA;discountTermStructure.linkTo(shiftedDiscountCurve)&#xA;forecastTermStructure.linkTo(shiftedForwardCurve)&#xA;P_p = swap.NPV()&#xA;&#xA;temp_fyc_handle = YieldTermStructureHandle(depoSwapCurve)&#xA;temp_dyc_handle = YieldTermStructureHandle(depoSwapCurve)&#xA;shiftedForwardCurve = ZeroSpreadedTermStructure(temp_fyc_handle, QuoteHandle(SimpleQuote(-shift)))&#xA;shiftedDiscountCurve = ZeroSpreadedTermStructure(temp_dyc_handle, QuoteHandle(SimpleQuote(-shift)))&#xA;discountTermStructure.linkTo(shiftedDiscountCurve)&#xA;forecastTermStructure.linkTo(shiftedForwardCurve)&#xA;P_m = swap.NPV()&#xA;&#xA;dv01 = (P_m - P_p) / 2.0&#xA;print('Swap DV01')&#xA;print(dv01)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;Am I correct in how to use QuantLib Python to calculate interest rate swap DV01? The output of the code above shows that the fixed leg DV01 is smaller than the entire swap's DV01. Is that right?&lt;/p&gt;&#xA;" OwnerUserId="30396" LastEditorUserId="30396" LastEditDate="2017-11-26T20:27:43.190" LastActivityDate="2017-11-28T09:53:08.383" Title="Use QuantLib Python to calculate Swap DV01" Tags="&lt;python&gt;&lt;quantlib&gt;&lt;interest-rate-swap&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="37092" PostTypeId="1" CreationDate="2017-11-26T14:58:24.743" Score="1" ViewCount="744" Body="&lt;p&gt;Programmers often criticize C++, calling it an overly complicated and dying language.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I don't care if this is true or not. My question is, &lt;strong&gt;considering the argument that supports this claim&lt;/strong&gt;, does that argument also apply to the way that C++ is used by a quant, and not by some general developers in the regular software engineering industry?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In other words, is C++ a complicated language if one only wishes to use it for Quantitative Finance purposes? And is C++ dying within the Quant industry (and if so, in exchange for what)?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;NOTE that the words used here are obviously exaggerations. &quot;Overly complicated&quot; is a biased assessment, and &quot;dying&quot; is hyperbole. So, don't get bogged down with those details and provide some easy answer like &quot;herpderp answer is clearly no&quot;. Be NUANCED.&lt;/p&gt;&#xA;" OwnerUserId="30627" LastActivityDate="2017-11-26T18:52:20.837" Title="When people say that C++ is overly complicated, does that also hold for its application in Quant finance?" Tags="&lt;programming&gt;" AnswerCount="2" CommentCount="2" ClosedDate="2017-11-26T18:39:28.773" ContentLicense="CC BY-SA 3.0" />
  <row Id="37093" PostTypeId="2" ParentId="37092" CreationDate="2017-11-26T15:23:54.853" Score="2" Body="&lt;p&gt;Perhaps this claim is based upon the observation that there are more friendly options out there, Python being one. I want to make two remarks about this statement:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;p&gt;&quot;friendly&quot; here is a very vague word. If you have used C++ in the past and are already familiar with its power, you could also claim that Python is &quot;over-complicated&quot;. I believe that there are many advantages of using C++ over Python in some cases, &lt;em&gt;e.g.&lt;/em&gt; the use of MPI (Message Passing Interface) and the level of efficiency you can reach with it is amazing.&lt;/p&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;p&gt;I intentionally use Python because it is also &lt;em&gt;object-oriented&lt;/em&gt;. This shows that if C++ is &quot;dying&quot; it is not because this particular programming paradigm is being replaced by some new novel technique. In my opinion Python is taking over just because it is faster to develop/ship products. However, many libraries used by Python are implemented in C/C++&lt;/p&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="29731" LastEditorUserId="16160" LastEditDate="2017-11-26T17:18:35.603" LastActivityDate="2017-11-26T17:18:35.603" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="37094" PostTypeId="2" ParentId="37092" CreationDate="2017-11-26T18:52:20.837" Score="2" Body="&lt;p&gt;To make a loose analogy, C++ is to Python as a violin is to a guitar. The guitar is more accessible to the beginner, while the violin allows the skillful expert tremendous control. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The choice of programming language involves tradeoffs. A few are:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Speed of running code&lt;/li&gt;&#xA;&lt;li&gt;Speed of writing code&lt;/li&gt;&#xA;&lt;li&gt;Ease of use (i.e. years of software development experience to not suck)&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&#xA;&lt;p&gt;As &lt;a href=&quot;https://softwareengineering.stackexchange.com/a/29136&quot;&gt;this answer&lt;/a&gt; describes, C++ allows high levels of programming abstraction (for productivity) but without performance penalties! In a sense, C++ prioritizes (1), (2) then (3). A number of libraries (eg. &lt;a href=&quot;http://quantlib.org/index.shtml&quot; rel=&quot;nofollow noreferrer&quot;&gt;quantlib&lt;/a&gt;) where performance is important are written in C++. &lt;a href=&quot;https://herbsutter.com/elements-of-modern-c-style/&quot; rel=&quot;nofollow noreferrer&quot;&gt;Updates to the C++ standard&lt;/a&gt; have added various features to modernize it.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;On the other hand, (2) and (3) in practice are perhaps more important than (1) speed for many if not most purposes. &lt;a href=&quot;https://stackoverflow.blog/2017/09/06/incredible-growth-python/&quot;&gt;Python has grown tremendously&lt;/a&gt;, partially because of its accessibility to professionals who didn't study computer science. In Python with &lt;a href=&quot;http://www.numpy.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;numpy&lt;/a&gt; and &lt;a href=&quot;https://pandas.pydata.org/&quot; rel=&quot;nofollow noreferrer&quot;&gt;pandas&lt;/a&gt;, you essentially call libraries written in C, C++ or other compiled languages for speed critical components while using the interpreted Python language for everything else. (Aside: Numpy in fact uses &lt;a href=&quot;https://en.wikipedia.org/wiki/LAPACK&quot; rel=&quot;nofollow noreferrer&quot;&gt;LAPACK&lt;/a&gt; written in Fortran).&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;Example: Pointers are a huge difference in C, C++ vs. Java etc...&lt;/h3&gt;&#xA;&#xA;&lt;p&gt;To code well in C and C++, you need to &lt;em&gt;perfectly&lt;/em&gt; understand how &lt;a href=&quot;https://en.wikipedia.org/wiki/Pointer_(computer_programming)&quot; rel=&quot;nofollow noreferrer&quot;&gt;pointers&lt;/a&gt; work; you must understand the distinction between an object and the memory address of an object.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In C++, you need to explicitly think about memory management to not f*@#($* up while you can survive in some higher level languages like Python and Java just by ignoring or hand waving. Did Pandas give me a copy or a view of a dataframe? One can produce useful code without understanding all the nuance while in C++, you'd probably be dead.&lt;/p&gt;&#xA;&#xA;&lt;h3&gt;A common paradigm?&lt;/h3&gt;&#xA;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Use a language like Python or Java for non-speed critical components&lt;/li&gt;&#xA;&lt;li&gt;Write important, speed sensitive libraries and components in C++&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;" OwnerUserId="20582" LastActivityDate="2017-11-26T18:52:20.837" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37096" PostTypeId="2" ParentId="37055" CreationDate="2017-11-27T02:58:00.520" Score="1" Body="&lt;p&gt;Let $\Delta P = P_t - P_{t-1}$ and expand the continuously compounded return in a Taylor series&#xA;$$ r = \log\left(\frac{P_t}{P_{t-1}}\right) = \log\left(\frac{P_{t-1}+\Delta P}{P_{t-1}}\right) = \log\left(1+\frac{\Delta P}{P_{t-1}}\right) \approx \frac{\Delta P}{P_{t-1}} - \mathcal{O}\left(\left(\frac{\Delta P}{P_{t-1}}\right)^2\right) = \frac{P_t - P_{t-1}}{P_{t-1}} - \mathcal{O}\left(\left(\frac{\Delta P}{P_{t-1}}\right)^2\right)&#xA;$$&#xA;If $\Delta P/P_{t-1}$ is small, which is typically the case for daily or shorter time frames, the higher order terms can be neglected and the continuously compounded return is approximately equal to the simple return.&lt;/p&gt;&#xA;" OwnerUserId="5107" LastActivityDate="2017-11-27T02:58:00.520" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="37097" PostTypeId="1" AcceptedAnswerId="37112" CreationDate="2017-11-27T03:20:37.510" Score="1" ViewCount="79" Body="&lt;p&gt;I am currently trying to arbitrage across two markets A and B. My trading strategy is as follows: if the price between A and B differs by more than X%, then go long on the lower priced market, and short on the higher priced market, and vice versa.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The assets are otherwise fungible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Since there is no actual movement of assets across the markets, two questions are prompted: &lt;br/&gt;&lt;br/&gt;&#xA;1. &lt;strong&gt;Is this technique still arbitrage?&lt;/strong&gt;&lt;br/&gt;&#xA;2. &lt;strong&gt;What is this technique called?&lt;/strong&gt;&lt;/p&gt;&#xA;" OwnerUserId="30633" LastEditorUserId="30633" LastEditDate="2017-11-27T15:20:39.770" LastActivityDate="2017-11-28T02:58:23.273" Title="What is arbitraging without moving assets called?" Tags="&lt;finance&gt;&lt;trading&gt;&lt;arbitrage&gt;" AnswerCount="1" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="37098" PostTypeId="1" AcceptedAnswerId="37100" CreationDate="2017-11-27T05:03:26.757" Score="2" ViewCount="152" Body="&lt;p&gt;I'm currently learning Black-Scholes-Merton partial differential equation, and there are some confusions I can't work out.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Under the Black-Scholes assumption, we have:&#xA;$$df=\left(\frac{\partial f}{\partial S}\mu S+\frac{\partial f}{\partial t}+\frac 12\frac{\partial^2f}{\partial S^2}\sigma^2S^2\right)dt+\frac{\partial f}{\partial S}\sigma S dB_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To construct a portfolio: &#xA;$$\Pi=-f+\frac{\partial f}{\partial S}S$$&#xA;We can eliminate the randomness, so we have:&#xA;$$\Delta \Pi=\left(-\frac{\partial f}{\partial t}-\frac 12\frac{\partial^2f}{\partial S^2}\sigma^2S^2\right)\Delta t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any riskless asset must satisfy $\Delta\Pi=r\Pi\Delta t$, then we can reach to the differential equation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;My question is:&lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Is S in $\Delta \Pi=\left(-\frac{\partial f}{\partial t}-\frac 12\frac{\partial^2f}{\partial S^2}\sigma^2S^2\right)\Delta t$ still a stochastic process? or the stock price at the beginning, which is deterministic?&lt;/li&gt;&#xA;&lt;li&gt;If S is a stochastic process, then according to the Geometric Brownian Motion assumption, $S=S_0e^{\sigma B_t+(\mu-\frac12\sigma^2)t}$ , which contains $\mu$ as a parameter. Then how can we say it has no dependence on $\mu$ and replace $\mu$ with $r^f$ in the risk-neutral world?&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="30571" LastEditorUserId="924" LastEditDate="2017-11-27T09:16:55.050" LastActivityDate="2017-11-27T09:59:32.743" Title="Problems in understanding BSM formula" Tags="&lt;black-scholes&gt;&lt;black-scholes-merton&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="37100" PostTypeId="2" ParentId="37098" CreationDate="2017-11-27T09:59:32.743" Score="2" Body="&lt;p&gt;Regarding your first question, you actually have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ d\Pi_t=-\left(\frac{\partial f_t}{\partial t}+\frac{1}{2}\frac{\partial^2f_t}{\partial S_t^2}\sigma^2S_t^2\right)dt$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The equation represents the portfolio evolution in an infinitesimal timespan $dt$ (i.e. from $t$ to $t+dt$). Note that the term $S_t$ is the stock price &lt;em&gt;at time $t$&lt;/em&gt; hence it is already known during the interval $[t,t+dt]$ so it is not a random variable but a deterministic quantity.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As for your second question, note that the Black-Scholes equation is:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \frac{\partial f_t}{\partial t}+\frac{1}{2}\frac{\partial^2f_t}{\partial S_t^2}\sigma^2 S_t+\frac{\partial f_t}{\partial S_t}rS_t=rf_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;As per the &lt;a href=&quot;https://en.wikipedia.org/wiki/Feynman%E2%80%93Kac_formula&quot; rel=&quot;nofollow noreferrer&quot;&gt;Feynman-Kac formula&lt;/a&gt;, the solution to the PDE above is the discounted expectation of the terminal condition $-$  the terminal condition in this case is the payoff of the derivative at maturity $f(T,S_T)$, for example $\max(0,S_T-K)$ for a European call $-$ &lt;em&gt;for a probability measure $Q$ under which the stock price follows the SDE:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$dS_t=rS_tdt+\sigma S_tdW^Q_t$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;i.e. replacing $\mu$ by $r$ is a mathematical &quot;trick&quot; which comes from Feynman-Kac. This convenient trick $-$ convenient as it allows to compute derivative prices as expectations instead of solutions to PDEs $-$ has been formalized and generalized, for example by &lt;a href=&quot;https://www.sciencedirect.com/science/article/pii/0304414981900260&quot; rel=&quot;nofollow noreferrer&quot;&gt;Harrison and Pliska (1981)&lt;/a&gt;.&lt;/p&gt;&#xA;" OwnerUserId="20454" LastActivityDate="2017-11-27T09:59:32.743" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37101" PostTypeId="1" AcceptedAnswerId="37115" CreationDate="2017-11-27T11:38:30.983" Score="1" ViewCount="939" Body="&lt;p&gt;I have bootstrapped my curve based on end-of-day data for &lt;strong&gt;24th Nov, 2017&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I am then using that to price a off-market swap as below:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;swap = VanillaSwap(VanillaSwap.Payer, 10000.0,&#xA;                       fixed_schedule,&#xA;                       fixed_coupon/100,&#xA;                       Thirty360(),&#xA;                       floating_schedule,&#xA;                       index,&#xA;                       0.0, # &amp;lt;-- libor fixing&#xA;                       Actual360())&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;My swap details are:-&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;Valuation date: 27th Nov, 2017&#xA;Fixed_coupon = 2.2575&#xA;Maturity Date = 27th Nov, 2027&#xA;float freq = Period(3, Months)&#xA;fixed freq = Period(6, Months)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;When I call the below:-&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;swap.NPV()&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;I get : &lt;strong&gt;{Runtime error} 2nd leg: Missing Euribor3M Actual/360 fixing for November 23rd, 2017&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Does this mean I have to pass in a libor fixing when I create my VanillaSwap object?&lt;/p&gt;&#xA;" OwnerUserId="24131" LastActivityDate="2019-11-19T12:13:36.197" Title="Quantlib: Getting error trying to price a Swap" Tags="&lt;derivatives&gt;&lt;swaps&gt;&lt;python&gt;&lt;quantlib&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37102" PostTypeId="2" ParentId="37013" CreationDate="2017-11-27T11:57:42.483" Score="1" Body="&lt;p&gt;i_love_rain: I don´t think it should be negative. A negative Value at Risk should be a potential profit as stated here (or not exist at all): &lt;a href=&quot;https://quant.stackexchange.com/questions/12718/why-is-value-at-risk-non-negative&quot;&gt;Why is Value at Risk non-negative?&lt;/a&gt;. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Seperately both positions have a positive VaR as stated by the OP. Both positions could lose money seperately, one when the share price rises, one when it falls.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The negative correlation as second option presented by the OP is right. If both positions were long (so it would be the same position anyway) the correlation would be 1. When one stock is long, the other short the correlation is -1.&lt;/p&gt;&#xA;" OwnerUserId="22216" LastActivityDate="2017-11-27T11:57:42.483" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37103" PostTypeId="1" CreationDate="2017-11-27T17:01:18.877" Score="1" ViewCount="40" Body="&lt;p&gt;In the context of interest models I came across the following identity for forward rates at time $m$ which, according to my book, has to always be fulfilled due to non-arbitrage: &lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$f_m(t, t+s) = \dfrac{1}{s}\big[f_m(t, t+1) + \ldots + f_m(t + s - 1, t + s)\big]$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The book did not mention why this is the case or even hinted at a derivation.&#xA;Therefore, I have two questions: &lt;/p&gt;&#xA;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;How do you derive this condition formally? &lt;/li&gt;&#xA;&lt;li&gt;What kind of arbitrage exists when the condition is not fulfilled? &lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;" OwnerUserId="30639" LastActivityDate="2017-11-27T17:01:18.877" Title="Identity for forward rates" Tags="&lt;interest-rates&gt;&lt;forward-rate&gt;" AnswerCount="0" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="37106" PostTypeId="1" AcceptedAnswerId="37107" CreationDate="2017-11-27T20:12:32.640" Score="4" ViewCount="956" Body="&lt;p&gt;I have a conceptual question about Ito's lemma, in particular, the multiplication.&#xA;Ito's multiplication rule states, that multiplying dt by itself or by dx (the stochastic differential) equals zero. That I understand. However, it also states, that multiplying dx by itself yields dt. I understand that dx is proportional to the square root of time. Nevertheless, dx^2 is still a stochastic process. Nevertheless, in Ito's Lemma it is then treated as if it were part of the deterministic part of the formula. This I do not understand since the result is still a (albeit different) random process.&#xA;Thanks very much for any enlightenment!&lt;/p&gt;&#xA;" OwnerUserId="28336" LastActivityDate="2017-11-27T20:46:28.780" Title="Ito's Lemma: Multiplication Rule" Tags="&lt;stochastic-processes&gt;&lt;stochastic-calculus&gt;&lt;itos-lemma&gt;" AnswerCount="1" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="37107" PostTypeId="2" ParentId="37106" CreationDate="2017-11-27T20:46:28.780" Score="5" Body="&lt;p&gt;May I point your attention to my following paper, where I address this question in an intuitive manner on page 12:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;von Jouanne-Diedrich, Holger, Ito, Stratonovich and Friends (May 18, 2017).&lt;br&gt;Available at SSRN: &lt;a href=&quot;https://ssrn.com/abstract=2956257&quot; rel=&quot;noreferrer&quot;&gt;https://ssrn.com/abstract=2956257&lt;/a&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The basic idea in the discrete case is to go through all possible branches and then square the differences. In each case you will see that it results in the same number - which renders the stochastic case, for all intents and purposes, deterministic!&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Details can be found in the paper (and I would love to get your feedback on the paper - Thank you :-)&lt;/p&gt;&#xA;" OwnerUserId="12" LastActivityDate="2017-11-27T20:46:28.780" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="37108" PostTypeId="1" CreationDate="2017-11-28T00:14:27.703" Score="1" ViewCount="386" Body="&lt;p&gt;I am trying to price vanilla options using a particular Bayesian approach that I have found in a paper. To do that I need to construct a likelihood function, approximating the tail of the distribution using the derivatives of the call prices with respect to the strike. In the paper the work is carried out using only calls, while my dataset includes both calls and puts. since I want to work with both of them I tried to recover the call prices from the observed put prices simply using the put-call parity relationship. The problem is that I expected to find that the call prices recovered in that way respect the convexity in the strike price, so that the price of the derivative decreases when the strike increases. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here there is an example of what I obtain. These are the initial observed prices for calls and puts (ordered by increasing strike):&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[723.15, 713.1, 490.95, 432.0, 421.9, 393.6, 391.7, 386.5, 372.0, 341.81, 0.05, 319.42, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.08, 0.05, 0.05, 0.05, 0.1, 0.05, 223.65, 0.08, 214.74, 0.1, 0.05, 0.1, 0.1, 0.1, 194.04, 0.1, 0.1, 0.1, 0.09, 0.08, 173.38, 0.13, 0.15, 0.15, 0.1, 0.25, 147.35, 0.18, 136.92, 0.15, 0.15, 0.2, 123.6, 0.2, 122.45, 0.2, 118.6, 0.25, 108.0, 0.3, 102.15, 0.3, 0.31, 99.0, 0.35, 92.0, 0.4, 0.46, 77.18, 0.48, 79.7, 0.46, 71.85, 0.55, 66.95, 0.66, 65.0, 0.65, 59.33, 0.75, 52.8, 0.93, 48.0, 1.1, 42.51, 1.38, 40.7, 1.7, 33.75, 2.03, 28.88, 2.7, 26.4, 3.4, 22.1, 4.6, 18.4, 6.0, 14.15, 7.12, 11.25, 7.8, 9.0, 5.7, 11.36, 3.0, 14.0, 2.25, 18.4, 1.37, 23.8, 0.8, 26.4, 0.51, 33.2, 0.3, 36.5, 0.22, 0.2, 0.2, 51.4, 0.15, 0.15, 0.1, 0.1, 0.1, 0.05, 89.15, 0.1, 0.05, 0.05, 201.05, 251.05]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here instead I have the same observed price after the use of the put-call parity:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[723.15, 713.1, 490.95, 432.0, 421.9, 393.6, 391.7, 386.5, 372.0, 341.81, 340.39, 319.42, 320.39, 310.39, 300.39, 295.39, 290.39, 275.39, 270.39, 265.39, 260.39, 255.42, 250.39, 245.39, 240.39, 235.44, 230.39, 223.65, 225.42, 214.74, 220.44, 215.39, 210.44, 205.44, 200.44, 194.04, 195.44, 190.44, 185.44, 180.43, 175.42, 173.38, 170.47, 165.49, 160.49, 155.44, 150.59, 147.35, 145.52, 136.92, 140.49, 135.49, 130.54, 123.6, 125.54, 122.45, 120.54, 118.6, 115.59, 108.0, 110.64, 102.15, 105.64, 100.65, 99.0, 95.69, 92.0, 90.74, 85.8, 77.18, 80.82, 79.7, 75.8, 71.85, 70.89, 66.95, 66.0, 65.0, 60.99, 59.33, 56.09, 52.8, 51.27, 48.0, 46.44, 42.51, 41.72, 40.7, 37.04, 33.75, 32.37, 28.88, 28.04, 26.4, 23.74, 22.1, 19.94, 18.4, 16.34, 14.15, 12.46, 11.25, 7.8, 9.34, 5.7, 6.7, 3.0, 4.34, 2.25, 3.74, 1.37, 4.14, 0.8, 1.74, 0.51, 3.54, 0.3, 1.84, 0.22, 0.2, 0.2, 1.74, 0.15, 0.15, 0.1, 0.1, 0.1, 0.05, 9.49, 0.1, 0.05, 0.05, 1.39, 1.39]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For completeness these are the respective type of option (call/put) and the strike prices, while the maturity is fixed and very short in this case( the same problem appears also for longer maturities). All options are written on SPX.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[1370.0, 1380.0, 1600.0, 1660.0, 1670.0, 1700.0, 1705.0, 1710.0, 1720.0, 1750.0, 1760.0, 1775.0, 1780.0, 1790.0, 1800.0, 1805.0, 1810.0, 1825.0, 1830.0, 1835.0, 1840.0, 1845.0, 1850.0, 1855.0, 1860.0, 1865.0, 1870.0, 1870.0, 1875.0, 1875.0, 1880.0, 1885.0, 1890.0, 1895.0, 1900.0, 1900.0, 1905.0, 1910.0, 1915.0, 1920.0, 1925.0, 1925.0, 1930.0, 1935.0, 1940.0, 1945.0, 1950.0, 1950.0, 1955.0, 1955.0, 1960.0, 1965.0, 1970.0, 1970.0, 1975.0, 1975.0, 1980.0, 1980.0, 1985.0, 1985.0, 1990.0, 1990.0, 1995.0, 2000.0, 2000.0, 2005.0, 2005.0, 2010.0, 2015.0, 2015.0, 2020.0, 2020.0, 2025.0, 2025.0, 2030.0, 2030.0, 2035.0, 2035.0, 2040.0, 2040.0, 2045.0, 2045.0, 2050.0, 2050.0, 2055.0, 2055.0, 2060.0, 2060.0, 2065.0, 2065.0, 2070.0, 2070.0, 2075.0, 2075.0, 2080.0, 2080.0, 2085.0, 2085.0, 2090.0, 2090.0, 2095.0, 2095.0, 2100.0, 2100.0, 2105.0, 2105.0, 2110.0, 2110.0, 2115.0, 2115.0, 2120.0, 2120.0, 2125.0, 2125.0, 2130.0, 2130.0, 2135.0, 2135.0, 2140.0, 2145.0, 2150.0, 2150.0, 2155.0, 2160.0, 2165.0, 2170.0, 2175.0, 2180.0, 2180.0, 2185.0, 2190.0, 2195.0, 2300.0, 2350.0]&lt;/p&gt;&#xA;&#xA;&lt;p&gt;['C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'P', 'C', 'P', 'P', 'P', 'P', 'P', 'P', 'P', 'P', 'P', 'P', 'P', 'P', 'P', 'P', 'P', 'C', 'P', 'C', 'P', 'P', 'P', 'P', 'P', 'C', 'P', 'P', 'P', 'P', 'P', 'C', 'P', 'P', 'P', 'P', 'P', 'C', 'P', 'C', 'P', 'P', 'P', 'C', 'P', 'C', 'P', 'C', 'P', 'C', 'P', 'C', 'P', 'P', 'C', 'P', 'C', 'P', 'P', 'C', 'P', 'C', 'P', 'C', 'P', 'C', 'P', 'C', 'P', 'C', 'P', 'C', 'P', 'C', 'P', 'C', 'P', 'C', 'P', 'C', 'P', 'C', 'P', 'C', 'P', 'C', 'P', 'C', 'P', 'C', 'P', 'C', 'C', 'P', 'C', 'P', 'C', 'P', 'C', 'P', 'C', 'P', 'C', 'P', 'C', 'P', 'C', 'P', 'C', 'C', 'C', 'P', 'C', 'C', 'C', 'C', 'C', 'C', 'P', 'C', 'C', 'C', 'P', 'P']&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The only simplified assumption that I did is assuming interest rate equal to 0, so that I obtain the call prices like C = P + S - K. Could the problem derive from that assumption or there is another reason that brings to violate the convexity in K of such call prices? Is there an easy way to infer the IR from my available data? One example of my problem is showed by this pair:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;[319.42, 320.39] &#xA;[1775.0, 1780.0]&#xA;['C', 'P']&#xA;In my opinion the call price 320.39 obtained by the PCP should be lower than the previous one, because its strike is higher. This repeats many times in my dataset if I apply the PCP.&lt;/p&gt;&#xA;" OwnerUserId="29555" LastEditorUserId="29555" LastEditDate="2017-11-28T01:16:45.833" LastActivityDate="2017-11-28T01:16:45.833" Title="Convexity of Call option prices using Put-Call parity relationship" Tags="&lt;options&gt;&lt;option-pricing&gt;&lt;put-call-parity&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="37109" PostTypeId="2" ParentId="37065" CreationDate="2017-11-28T00:21:37.807" Score="-1" Body="&lt;p&gt;On formula 3.c on page 8 in his paper.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$\alpha = 1 - v_1/(v_1 + v_2$)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Where a ~ (0,1), therefore $v_1$ and $v_2$ are both between (0,1) and sum to 1 as well. So we can scale both $v_1$ and $v_2$ appropriately ex:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$v^{new}_1 = (1-0.01) * v_1 + 0.01$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This would give us the desired weight range &lt;/p&gt;&#xA;" OwnerUserId="1764" LastActivityDate="2017-11-28T00:21:37.807" CommentCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="37110" PostTypeId="1" AcceptedAnswerId="37111" CreationDate="2017-11-28T02:13:23.843" Score="1" ViewCount="1074" Body="&lt;p&gt;I have the following question from Hull, &lt;a href=&quot;https://www.google.com.au/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=5&amp;amp;ved=0ahUKEwirvZa_6d7XAhXDEbwKHVXPCIcQFghEMAQ&amp;amp;url=http%3A%2F%2Ffinpko.faculty.ku.edu%2Fmyssi%2Findex.php%3Fdir%3DFIN832%2FChapter%2520Problem%2520Solutions%2FHull%25209th%2520Edition%2F%26file%3DHullFund9eCh06ProblemSolutions.doc&amp;amp;usg=AOvVaw0R0H4SHBW8zlbAXHo2UHVI&quot; rel=&quot;nofollow noreferrer&quot;&gt;problem 6.16&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Suppose that it is February 20 and a treasurer realizes that on July 17 the company will have to issue \$5 million of commercial paper with a maturity of 180 days. If the paper were issued today, the company would realize \$4,820,000. (In other words, the company would receive \$4,820,000 for its paper and have to redeem it at \$5,000,000 in 180 days’ time.) The September Eurodollar futures price is quoted as 92.00. How should the treasurer hedge the company’s exposure?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The solution is as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;The company treasurer can hedge the company’s exposure by shorting Eurodollar futures contracts. The Eurodollar futures position leads to a profit if rates rise and a loss if they fall. &#xA;The duration of the commercial paper is twice that of the Eurodollar deposit underlying the Eurodollar futures contract. The contract price of a Eurodollar futures contract is 980,000. The number of contracts that should be shorted is, therefore:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align}Number\ of\ Contracts &amp;amp; =\frac{Portfolio\ Forward\ Value}{Future\ Contract\ Price}\times \frac{Portfolio\ Duration}{Futures\ Duration} \newline &amp;amp; =\frac{\$4\,820\,000}{\bbox[yellow, 5px,border:2px solid red]{$980\,000}}\times \frac{6\ months}{3 \ months} \newline &amp;amp;= 9.84\newline \therefore Number\ of\ Contracts &amp;amp;\approx 10\ \text{contracts}\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Question:&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How does one calculate the &lt;em&gt;future contract price&lt;/em&gt; of $980,000?&lt;/p&gt;&#xA;" OwnerUserId="30520" LastEditorUserId="30520" LastEditDate="2017-11-29T09:43:17.443" LastActivityDate="2017-11-29T09:43:17.443" Title="How does one calculate the Libor future contract price?" Tags="&lt;interest-rates&gt;&lt;futures&gt;&lt;hedging&gt;&lt;eurodollars&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37111" PostTypeId="2" ParentId="37110" CreationDate="2017-11-28T02:41:39.950" Score="5" Body="&lt;p&gt;The quoting convention must be explained somewhere in your book.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For Eurodollar futures, this convention is 100 - yield, 92 means the yield is 8% per annum, so for one quarter you need to divide this discount by 4 to get the price (100% - (8% × (3month/12month)) = 100% - 2% = 98%&lt;/p&gt;&#xA;" OwnerUserId="1181" LastEditorUserId="30520" LastEditDate="2017-11-28T03:05:40.030" LastActivityDate="2017-11-28T03:05:40.030" CommentCount="5" ContentLicense="CC BY-SA 3.0" />
  <row Id="37112" PostTypeId="2" ParentId="37097" CreationDate="2017-11-28T02:58:23.273" Score="0" Body="&lt;p&gt;Arbitrage doesn't necessarily require the assets to be fungible or the profit to be realized by netting them against one another. It is a very generic term. People talk about statistical arbitrage which doesn't guarantee a sure gain, or for instance China-Hong Kong AH shares arbitrage where the underlying stock is not even fungible.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;What you describe could be called pair trading, relative value or arbitrage, it really depends on the assets you are trading.&lt;/p&gt;&#xA;" OwnerUserId="1181" LastActivityDate="2017-11-28T02:58:23.273" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37113" PostTypeId="1" CreationDate="2017-11-28T06:14:43.813" Score="2" ViewCount="81" Body="&lt;p&gt;I am curious about a calculation I saw in &lt;a href=&quot;https://quant.stackexchange.com/questions/29740/what-is-the-correct-convexity-adjustment-for-an-interest-rate-swap-with-unnatura&quot;&gt;this&lt;/a&gt; question.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Specifically in this equation:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;&amp;amp;\ L(T_s, T_p, T_e)  L(T_s, T_s, T_e) \\&#xA;=&amp;amp;\  L(t_0, T_p, T_e) L(t_0, T_s, T_e) e^{-\frac{\sigma_s^2}{2}(T_s-t_0) -\frac{\sigma_p^2}{2}(T_s-t_0) + \sigma_s\big(W_{T_s}^s -W_{t_0}^s\big) + \sigma_p\Big(\rho \big(W_{T_s}^s - W_{t_0}^s\big) + \sqrt{1-\rho^2}\big(W_{T_s}^p - W_{t_0}^p\big)\Big)}.&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'm trying to prove it using Ito's lemma and the dynamics:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;dL(t, T_s, T_e) &amp;amp;= \sigma_s L(t, T_s, T_e) d W_t^s,\\&#xA;dL(t, T_p, T_e) &amp;amp;= \sigma_p L(t, T_p, T_e)d\Big(\rho W_t^s + \sqrt{1-\rho^2}W_t^p\Big), &#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;But when I apply Ito's lemma I end up computing &lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;dL(t, T_s, T_e)dL(t, T_p, T_e) &amp;amp;= \sigma_s \sigma_p L(t, T_s, T_e)L(t, T_p, T_e)  \rho dt&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;And I don't know where the next term is coming from:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;\begin{align*}&#xA;-\frac{\sigma_s^2}{2}(T_s-t_0)-\frac{\sigma_p^2}{2}(T_s-t_0)&#xA;\end{align*}&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Can someone help me with the calculation?&#xA;Thanks&lt;/p&gt;&#xA;" OwnerUserId="30652" LastActivityDate="2017-11-28T06:14:43.813" Title="How to calculate the product of forward rates with different reset times using Ito's lemma?" Tags="&lt;itos-lemma&gt;&lt;forward-rate&gt;&lt;convexity&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="37114" PostTypeId="2" ParentId="37065" CreationDate="2017-11-28T08:54:23.863" Score="4" Body="&lt;p&gt;EDITED&lt;/p&gt;&#xA;&#xA;&lt;p&gt;You are right. We have to look town to the &quot;leaves&quot; in each iteration. I would do it the following way:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $L_i^{(j)}$ is the set of indices in the $j$ branch ($j \in \{1,2\}$), then we define $s_i^{(j)}=\sum_{n \in L_i^{(j)}w_n}$, the weight of the branch before scaling and $n_i^{(j)}=\left|L_i^{(j)}\right|$ the number of leaves in the branch. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;The box constraints for the weights we call $w_\text{min}$ and $w_\text{max}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let $\alpha_i$ be the scaling factor for $L_i^{(1)}$ and $1-\alpha_i$ the scaling factor for $L_i^{(2)}$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To fulfill the constraints, we need to check the resulting weights.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we scale the weights of $L_i^{(j)}$ by $\alpha_i$, we must have enough room to maneuver so that the minimum weight constraint can still fit into the branch weight and we must have a limited weight in order to be able to fulfil the upper bounds:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \alpha_i s_i^{(1)} \geq n_i^{(1)} w_\text{min}$$&#xA;$$ \alpha_i s_i^{(1)} \leq n_i^{(1)} w_\text{max}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For the other side of the branch, we need to check, the analogue thing:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ (1-\alpha_i) s_i^{(2)} \geq n_i^{(2)} w_\text{min}$$&#xA;$$ (1-\alpha_i) s_i^{(2)} \leq n_i^{(2)} w_\text{max}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If we put all four of them together, we get the following inequalities for $\alpha_i$:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \text{max}\left(1-\frac{n_i^{(2)}w_\text{max}}{s_i^{(2)}},\frac{n_i^{(1)}w_\text{max}}{s_i^{(1)}}\right) \leq \alpha_i \leq \text{min}\left(1-\frac{n_i^{(2)}w_\text{min}}{s_i^{(2)}},\frac{n_i^{(1)}w_\text{max}}{s_i^{(1)}}\right)$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if we define the lower bound as $\text{LB}_i$ and the upper bound as $\text{UB}_i$, we adjust the scaling factor as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$ \hat{\alpha}_i = \text{max}(\text{LB}_i,\text{min}(\alpha_i,\text{UB}_i))$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If $\text{UB}_i \leq \text{LB}_i$, then terminate the function. I hope this only happens if the constraints are incompatible but I didnt attempt a proof.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This way, you can proceed with the algorithm while fulfilling the constraints.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Linear constraints on sigle assets are probably the only useful type of constraints you can impose. Constraints on sector weights for example will be impossible here due to the clustering structure. In practice, I can see this being a big drawback.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Compared to the classical inverse volatility Risk Budgeting, this approach is really elegant, since it only ignores the part of the variance covariance matrix that is of little importance if you will.&lt;/p&gt;&#xA;" OwnerUserId="2727" LastEditorUserId="2727" LastEditDate="2017-11-28T17:34:19.517" LastActivityDate="2017-11-28T17:34:19.517" CommentCount="6" ContentLicense="CC BY-SA 3.0" />
  <row Id="37115" PostTypeId="2" ParentId="37101" CreationDate="2017-11-28T09:14:43.517" Score="2" Body="&lt;p&gt;Yes, you have to pass an Euribor fixing because your coupon is fixing in the past with respect to the valuation date and thus its rate can't be forecast on the interest-rate curve.  However, it's not passed through the construtor argument you have commented in your code; that one is used to pass any additional spread (for instance, if the floating leg swap were to pay Euribor plus 10 bps).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The way to store a past fixing is through the &lt;code&gt;index&lt;/code&gt; instance. You can do it as&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;index.addFixing(Date(23,November,2017), rate);&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;after which it will be available to all &lt;code&gt;Euribor3M&lt;/code&gt; instances.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2017-11-28T09:14:43.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37116" PostTypeId="2" ParentId="7698" CreationDate="2017-11-28T09:50:47.507" Score="1" Body="&lt;p&gt;Ciao!&#xA;Let me say that I think you gave the wrong dynamic for $S_t$ (for example because it is a financial asset with Normal dynamic...so it could be negative!!(?) ). &lt;/p&gt;&#xA;&#xA;&lt;p&gt;I'll give a solution for both case (normal and log-normal) but only the log-normal one leads to the right solution.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Log-normal case&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;In this case $S_T$ has the following dynaic in $\mathbb{Q}$:&#xA;$$&#xA;dS_t = S_t \sigma_t dW_t.&#xA; $$&#xA;Integrating $S_t$ starting from $1$ you get:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;S_T = S_1\exp\left[-\frac{1}{2}\int_1^T\sigma_s^2 ds  + \int_1^T\sigma_s dWs\right]&#xA;$$ &lt;/p&gt;&#xA;&#xA;&lt;p&gt;so that $S_T /S_1$ is independent from $S_t \ \forall t$ (this will be important in a minute). &#xA;Morover notice that:&#xA;$$&#xA;S_T/S_1 \sim e^Y&#xA;$$&#xA;where $Y \sim \mathcal N \left( -\frac{1}{2}\int_1^T \sigma_s^2 ds, \int_1^T \sigma_s^2 ds \right) = N \left( -\frac{1}{2}\gamma^2 , \gamma^2  \right) $&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Now we can do the explicit computation. Tee main idea is to use the tower property and divide the integral in two part. After that we will use the previous observation and the fuct that the first integral doesn't depend on $S_1$:&#xA;$$&#xA;\begin{align}&#xA;\mathbb{E} \left[ (S_T - kS_1)^+ | S_t = x \right] &amp;amp; = \mathbb{E} \left[S_1\left. \left( \frac{S_T}{S_1} - k\right)^+ \right| S_t = x \right] \\&#xA;&amp;amp;  =\mathbb{E} \left. \left[ \mathbb{E} \left. \left[S_1\left( \frac{S_T}{S_1} - k\right)^+ \right| S_1\right] \right| S_t = x\right]\\&#xA;&amp;amp; =\mathbb{E} \left. \left[ S_1 \mathbb{E} \left[\left.\left( \frac{S_T}{S_1} - k\right)^+ \right| S_1\right] \right| S_t = x\right] \\&#xA;&amp;amp; =\mathbb{E} \left. \left[ S_1 C(k, 1, \Sigma, 0) \right| S_t = x\right]&#xA;\end{align} &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$C(k, 1, \Sigma, 0)$ is the price of a call option with strike $k$, starting point $1$, rate $0$ and volatility the volatility of $S_T/S_1$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The Call option has starting value $1$ and it doesn't depend on $S_1$ so that we can put it outside the expected value. Now we use the fact that $S_1$ is a martingale in $\mathbb{Q}$ and we obtain:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\mathbb{E} \left[ (S_T - kS_1)^+ | S_t = x \right] =  C(k, 1, \Sigma, 0) S_t&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;which is the final result.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Normal case&lt;/strong&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Here the problem is clear: $S_T/S_1$ depends on $S_1$ so that we cannot use the same technique of the previous case. I have no smart idea so that I will follow the &quot;samurai way&quot; of the brutal computation.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;We have:&#xA;$$&#xA;S_T = S_1 + \int_1^T \sigma_s dW_s \sim \mathcal{N}(S_1, \int_1^T \sigma^2_s ds)&#xA;$$&#xA;so that:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align}&#xA;\mathbb{E} \left[\left. (S_T - kS_1)^+ \right|S_t\right] &amp;amp;= \mathbb{E} \left[ \left. \mathbb{E} \left[\left. (S_T - kS_1)^+ \right| S_1\right] \right|S_t \right] \\&#xA;&amp;amp; = \mathbb{E} \left[\left. \frac{1}{\sqrt{2\pi}\Sigma} \int_0^{+\infty} x\exp\left(\frac{-(x-\mu)^2}{2\Sigma^2} \right) dx \right| S_t\right]&#xA;\end{align}&#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\mu = (1-k)S_1$ and $\Sigma = \int_1^T \sigma_s^2 ds$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Let me focus on the integral:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align}&#xA;\frac{1}{\sqrt{2\pi}\Sigma} \int_0^{+\infty} x\exp\left(\frac{-(x-\mu)^2}{2\Sigma^2} \right) dx &amp;amp; = \frac{1}{\sqrt{2\pi}} \int_{\frac{\mu}{\Sigma}}^{+\infty} (\Sigma \xi + \mu)\exp\left(\frac{-\xi^2}{2} \right) d\xi \\&#xA;&amp;amp; = \frac{\Sigma}{\sqrt{2\pi}} \exp \left(- \frac{\mu^2}{2\Sigma^2}  \right) + \frac{\mu}{\sqrt{2\pi}}\Phi\left( \frac{\mu}{\Sigma} \right)&#xA;\end{align} &#xA;$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;where $\Phi$ is the cumulative function of the standard gaussian. At his point, using the fact that:&#xA;$$&#xA;S_1 = S_t + \int_t^1 \sigma_s dW_s \sim \mathcal{N} \left( S_t, \int_t^1 \sigma_s^2 ds  \right)&#xA;$$&#xA;we have to solve the following integral:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$&#xA;\begin{align}&#xA;\mathbb{E} \left[ \frac{\Sigma}{\sqrt{2\pi}} \exp \left(- \frac{\mu^2}{2\Sigma^2}  \right) + \frac{\mu}{\sqrt{2\pi}}\Phi\left( \frac{\mu}{\Sigma} \right) \right] &amp;amp; = \frac{\Sigma}{\sqrt{2\pi}}\int_\mathbb{R} \exp \left( -\frac{(1-k)^2x^2}{2 \Sigma^2} \right) \exp\left( -\frac{(x-S_t^2)}{2\Gamma^2} \right) dx \\&#xA;&amp;amp; \quad  + \int_\mathbb{R} (1-k)x \Phi\left(  \frac{(1-k)x}{\Sigma} \right)\exp\left(- \frac{(x-S_t)^2}{2\Gamma^2} \right) dx&#xA;\end{align}&#xA;$$&#xA;where $\Gamma = \int_1^t \sigma_s^2 ds $.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The first integral should be easy to compute just by completing the square in the exponent (the result will be very bad looking but easy to do).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;About the second one, it's seems more tricky...it could be usefull the following result:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;strong&gt;Result&lt;/strong&gt;&#xA;$$&#xA;\int_\mathbb{R} x\Phi(x)e^{\frac{-x^2}{2}} = \int_\mathbb{R} e^{-x^2} = \sqrt{\pi}&#xA;$$&#xA;(I'm still working on it)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Ciao!&lt;/p&gt;&#xA;" OwnerUserId="26793" LastActivityDate="2017-11-28T09:50:47.507" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37117" PostTypeId="2" ParentId="37091" CreationDate="2017-11-28T09:53:08.383" Score="8" Body="&lt;p&gt;No, I'm afraid you're comparing apples with oranges.  Your calculation of the DV01 of the swap is correct (with a caveat, see below), but the figure returned from &lt;code&gt;swap.fixedLegBPS&lt;/code&gt; is not comparable.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The DV01 tells you what happens to the NPV if the interest-rate curve change; in the case of the fixed leg, this affects the discount factors used to discount the coupon amounts, but not the amounts themselves which are fixed.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The BPS tells you what happens to the NPV if the rate of the fixed coupons increases by 1 bps and the interest rates (and thus the discount factors) stay the same.  It's useful to calculate the fair rate, or while you're defining the deal, but probably not so much once the swap is built and its rate is fixed. So: different things.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;If you want to calculate the DV01 of the fixed leg alone, you can do something like:&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;shift = 0.0001&#xA;&#xA;temp_dyc_handle = YieldTermStructureHandle(depoSwapCurve)&#xA;shiftedDiscountCurve = ZeroSpreadedTermStructure(temp_dyc_handle, QuoteHandle(SimpleQuote(shift)))&#xA;discountTermStructure.linkTo(shiftedDiscountCurve)&#xA;P_p = CashFlows.npv(swap.fixedLeg(), discountTermStructure, False, settlementDate)&#xA;&#xA;temp_dyc_handle = YieldTermStructureHandle(depoSwapCurve)&#xA;shiftedDiscountCurve = ZeroSpreadedTermStructure(temp_dyc_handle, QuoteHandle(SimpleQuote(-shift)))&#xA;discountTermStructure.linkTo(shiftedDiscountCurve)&#xA;P_m = CashFlows.npv(swap.fixedLeg(), discountTermStructure, False, settlementDate)&#xA;&#xA;dv01 = (P_m - P_p) / 2.0&#xA;print('Fixed Leg DV01')&#xA;print(dv01)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;About the caveat I mentioned above: you're doing&lt;/p&gt;&#xA;&#xA;&lt;pre&gt;&lt;code&gt;discountTermStructure.linkTo(depoSwapCurve)&#xA;forecastTermStructure.linkTo(depoSwapCurve)&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&#xA;&lt;p&gt;that is, you're using the same curve for forecasting the floating-rate fixing and discounting the cash flows, which is what we do in the example included in the QuantLib release.  We should really update that; nowadays, the practice is to use two different curves for forecasting and discounting.  In that case, it probably still makes sense to define the DV01 as the variation of NPV when you shift both curves, as you do now; but make sure that this is what you want.&lt;/p&gt;&#xA;" OwnerUserId="308" LastActivityDate="2017-11-28T09:53:08.383" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37119" PostTypeId="1" CreationDate="2017-11-28T12:28:48.223" Score="1" ViewCount="48" Body="&lt;p&gt;If for example I deposit 10,000 dollars in trading account, and I can buy/sell in 20,000, so I'm using leverage.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How returns are computed? I mean that my balance is consist of 20,000 + sum of returns, so what is actually my account value? 10,000 + sum of returns?&#xA;Thanks guys.&lt;/p&gt;&#xA;" OwnerUserId="29771" LastActivityDate="2017-11-28T13:58:37.583" Title="Returns on leveraged account" Tags="&lt;portfolio-management&gt;" AnswerCount="1" CommentCount="0" ClosedDate="2017-11-29T01:01:07.900" ContentLicense="CC BY-SA 3.0" />
  <row Id="37120" PostTypeId="1" CreationDate="2017-11-28T13:17:20.797" Score="1" ViewCount="206" Body="&lt;p&gt;Are CUSIP identifiers case sensitive like RIC number are?&lt;/p&gt;&#xA;" OwnerUserId="30658" LastEditorUserId="24222" LastEditDate="2017-11-28T13:20:14.397" LastActivityDate="2017-11-28T13:58:46.417" Title="Are CUSIP case sensitive" Tags="&lt;programming&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37121" PostTypeId="2" ParentId="37119" CreationDate="2017-11-28T13:21:14.943" Score="3" Body="&lt;p&gt;You have to keep track of both your cash and your stock positions&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you start you have 10,000 in cash, and no stock positions (i.e. zero shares of any stock)&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you buy shares you decrease cash by the purchase cost and you record an increase in the number of shares of that stock. If the cash goes negative it means you are &quot;on margin&quot;, i.e. have a margin loan.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;When you sell shares you increase cash by the sale proceeds and you decrease the number of shares of stock. If the number of shares goes negative, you are now short.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;At any time you can find the market to market value of your account as cash plus the inner product of you share holdings times the current market price of your shares (the long share values are being added and the short shares are being subtracted) $MV=C+p_1 s_1 + \cdots +p_n s_n$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Once a month you earn interest on your cash balance or pay interest on your margin balance (negative cash balance), and this increases or decreases cash.&lt;/p&gt;&#xA;" OwnerUserId="16148" LastEditorUserId="16148" LastEditDate="2017-11-28T13:58:37.583" LastActivityDate="2017-11-28T13:58:37.583" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="37122" PostTypeId="1" CreationDate="2017-11-28T13:25:15.000" Score="0" ViewCount="354" Body="&lt;p&gt;Are ISIN codes case sensitive like RIC Codes are?&#xA;We need to know this in order to sanitize input.&#xA;This completely describes my problem!&lt;/p&gt;&#xA;" OwnerUserId="30658" LastActivityDate="2017-11-28T13:52:06.783" Title="Are ISIN case sensitive?" Tags="&lt;programming&gt;" AnswerCount="1" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37123" PostTypeId="2" ParentId="37122" CreationDate="2017-11-28T13:52:06.783" Score="4" Body="&lt;p&gt;ISINs are a 12 character alphanumeric code where the letters allowed are A-Z and the digits are 0-9.  &lt;/p&gt;&#xA;&#xA;&lt;p&gt;They are not case sensitive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is defined in the ISO 6166 standard and the alphabetic characters allowed are given in Annex A of the standard - that is, only A through Z (uppercase) are specified.&lt;/p&gt;&#xA;" OwnerUserId="13859" LastActivityDate="2017-11-28T13:52:06.783" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37124" PostTypeId="2" ParentId="37120" CreationDate="2017-11-28T13:58:46.417" Score="4" Body="&lt;p&gt;CUSIPs are not case sensitive.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Any letters within a CUSIP are upper case.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The CUSIP identifier was developed in 1967 by ABA and has not changed significantly.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The specification for CUSIP is detailed here:&#xA;&lt;a href=&quot;https://www.cusip.com/pdf/CUSIP_Intro_03.14.11.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;https://www.cusip.com/pdf/CUSIP_Intro_03.14.11.pdf&lt;/a&gt;&#xA;This provides some further detail about how letters (instead of digits) are used, and mainly relate to debt securities and international issues.&lt;/p&gt;&#xA;" OwnerUserId="13859" LastActivityDate="2017-11-28T13:58:46.417" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37125" PostTypeId="1" CreationDate="2017-11-28T16:13:42.767" Score="7" ViewCount="356" Body="&lt;p&gt;I've been doing a lot of research on implied volatility skewness, and one of the most commonly cited papers I've come across is &lt;a href=&quot;https://pdfs.semanticscholar.org/67d1/ad298a89fcfcb4e469064808c3e4accbefe4.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;&quot;Stock Return Characteristics, Skew Laws, and the Differential Pricing of Individual Equity Options&quot; by G. Bakshi, N. Kapadia, and D. Madan&lt;/a&gt;. In it, they price volatility, cubic, and quartic contracts on page 107. They explain their derivation on page 137, but they're very brief about it, and I don't follow it at all. I know it has something to do with equations 2 and 3 on page 106, but it isn't coming together for me. Would someone be able to derive just one of those equations for me explicitly or provide a reference to a site/paper that does?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank You&lt;/p&gt;&#xA;" OwnerUserId="30659" LastEditorUserId="30659" LastEditDate="2017-11-28T17:31:18.170" LastActivityDate="2017-11-29T10:39:29.023" Title="How are the BKM risk-neutral moments derived?" Tags="&lt;options&gt;&lt;black-scholes&gt;&lt;implied-volatility&gt;&lt;volatility-smile&gt;&lt;skew&gt;" AnswerCount="1" CommentCount="0" FavoriteCount="3" ContentLicense="CC BY-SA 3.0" />
  <row Id="37126" PostTypeId="1" CreationDate="2017-11-28T17:28:20.440" Score="1" ViewCount="44" Body="&lt;p&gt;Does anyone know any academic literature on how government bond yields are related to mortgage rates?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thanks in advance.&lt;/p&gt;&#xA;" OwnerUserId="30661" LastEditorUserId="30661" LastEditDate="2017-11-28T17:33:31.487" LastActivityDate="2017-11-28T17:33:31.487" Title="Relation between government bond yields and mortgage rates?" Tags="&lt;interest-rates&gt;" AnswerCount="0" CommentCount="1" FavoriteCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="37127" PostTypeId="1" CreationDate="2017-11-28T21:35:25.193" Score="2" ViewCount="211" Body="&lt;p&gt;Consider the displaced log-normal process: $$dS(t) = \lambda(t)(a(t)+b(t)S(t))dW(t), S(0) = S_0&amp;gt;0, $$ where $W(t)$ is a one-dimensional Brownian motion. &lt;/p&gt;&#xA;&#xA;&lt;p&gt;We suppose that $(\forall t \ge 0) : \lambda(t)\ge0$ and that there is no restrictions on $t\to a(t)$ and $t\to b(t)$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;This is a local volatility model used to describe the dynamic of the price of an underlying $S$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I implement an Euler scheme to approximate $S(T)$ at a given horizon $T$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;I realize something wrong with my implementation: In fact, if there exists $t'$ such that $a(t')+b(t')S(t')&amp;lt;0$, the values of $\{S(t'')\}_{t'\le t''\le T}$ are negative and very large and the calculations using $S(T)$ are false. But it works fine if we have $(\forall t\ge 0): a(t')+b(t')S(t')\ge0$.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;For me, If I define $\sigma(t,S(t)) = \lambda(t)(a(t)+b(t)S(t))$ so that we can write $dS(t) = \sigma(t,S(t))dW(t)$, the sign of $\sigma(t, S(t))$ doesn't matter because $W(t)$ and $-W(t)$ have the same probability law.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Have you an idea about the source of the problem? And how can we correct it?&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Thank you in advance for any help you can provide!&lt;/p&gt;&#xA;" OwnerUserId="22585" LastEditorUserId="22585" LastEditDate="2017-11-29T06:28:49.897" LastActivityDate="2017-11-29T06:28:49.897" Title="Problem of negative local volatility:" Tags="&lt;stochastic-processes&gt;&lt;local-volatility&gt;&lt;lognormal&gt;&lt;sabr&gt;&lt;euler&gt;" AnswerCount="0" CommentCount="4" ContentLicense="CC BY-SA 3.0" />
  <row Id="37129" PostTypeId="1" AcceptedAnswerId="37132" CreationDate="2017-11-29T05:25:46.297" Score="0" ViewCount="1505" Body="&lt;p&gt;I have the following question from Hull, &lt;a href=&quot;https://www.google.com.au/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=5&amp;amp;ved=0ahUKEwirvZa_6d7XAhXDEbwKHVXPCIcQFghEMAQ&amp;amp;url=http%3A%2F%2Ffinpko.faculty.ku.edu%2Fmyssi%2Findex.php%3Fdir%3DFIN832%2FChapter%2520Problem%2520Solutions%2FHull%25209th%2520Edition%2F%26file%3DHullFund9eCh06ProblemSolutions.doc&amp;amp;usg=AOvVaw0R0H4SHBW8zlbAXHo2UHVI&quot; rel=&quot;nofollow noreferrer&quot;&gt;problem 6.17&lt;/a&gt;:&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;On August 1 a portfolio manager has a bond portfolio worth $10 million. The duration of the portfolio in October will be 7.1 years. The December Treasury bond futures price is currently 91-12 and the cheapest-to-deliver bond will have a duration of 8.8 years at maturity. How should the portfolio manager immunize the portfolio against changes in interest rates over the next two months?&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;The solution is as follows:&lt;/p&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;The treasurer should short Treasury bond futures contract. If bond prices go down, this futures position will provide offsetting gains. The number of contracts that should be shorted is:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;$$\begin{align} Number\ of\ Contracts&amp;amp; =\frac{$\ 10\,000\,000}{\bbox[yellow, 5px,border:2px solid red]{$\ 91\,375}}\times\frac{7.1\ \text{years}}{8.8\ \text{years}} \newline&#xA; &amp;amp; = 88.30 \ \text{contracts}\newline&#xA;\therefore Number\ of\ Contracts &amp;amp;\approx 88\  \text{contracts}\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;hr&gt;&#xA;&#xA;&lt;p&gt;&lt;em&gt;Question:&lt;/em&gt;&lt;/p&gt;&#xA;&#xA;&lt;p&gt;How was the $91,375 calculated?&lt;/p&gt;&#xA;" OwnerUserId="30520" LastEditorUserId="30520" LastEditDate="2017-11-29T06:24:50.543" LastActivityDate="2018-02-09T11:51:00.517" Title="How to calculate a future contracts price?" Tags="&lt;interest-rates&gt;&lt;futures&gt;&lt;hedging&gt;&lt;eurodollars&gt;" AnswerCount="1" CommentCount="2" ContentLicense="CC BY-SA 3.0" />
  <row Id="37130" PostTypeId="2" ParentId="36994" CreationDate="2017-11-29T08:31:19.707" Score="0" Body="&lt;p&gt;Well, the final price at t0 is only dependent on the two nodes on date t1.&#xA;Those nodes (t1) are dependent on the next (t2) and so on.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;So if the bond is going to be called at one of the three nodes in t2 (let's Call this node A), the price is set to 100 (instead of let's say 102) and this will partially (50%) affect one of the nodes in t1.&#xA;Because of this reset, all the nodes coming after node A in t2 (A t3u and At3d) are no longer used for this path.&lt;/p&gt;&#xA;" OwnerUserId="30682" LastActivityDate="2017-11-29T08:31:19.707" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37131" PostTypeId="1" AcceptedAnswerId="37139" CreationDate="2017-11-29T08:57:07.580" Score="-1" ViewCount="139" Body="&lt;p&gt;I recently purchased Paul Wilmott's Quant Finance FAQ book. In the book he states that the binomial option valuation method is 'rubbish'. Can anyone enlighten me as to what method he recommends for pricing an American option?&lt;/p&gt;&#xA;" OwnerUserId="29226" LastEditorUserId="24222" LastEditDate="2017-11-29T09:12:14.667" LastActivityDate="2017-11-29T18:08:10.593" Title="Binomial Option Valuation Paul Wilmott" Tags="&lt;option-pricing&gt;&lt;american-options&gt;" AnswerCount="1" CommentCount="1" ContentLicense="CC BY-SA 3.0" />
  <row Id="37132" PostTypeId="2" ParentId="37129" CreationDate="2017-11-29T09:05:14.770" Score="0" Body="&lt;p&gt;The question reads &quot;&lt;em&gt;...price is currently 91-12...&lt;/em&gt;&quot; where &lt;em&gt;91-12&lt;/em&gt; is  notated in futures quotes (&lt;a href=&quot;https://www.cmegroup.com/education/files/understanding-treasury-futures.pdf&quot; rel=&quot;nofollow noreferrer&quot;&gt;pg. 2 of Treasury Futures&lt;/a&gt;). Coupon-bearing securities are frequently quoted in percent of par to the nearest 1/32nd of 1% of par. This means that:&#xA;$$\begin{align}91\mbox{-}12 &amp;amp; = 91 + \frac{12}{32}\newline &amp;amp; = 91 + 0.375\newline &amp;amp; = 91.375 \newline \newline \therefore 91\mbox{-}12&amp;amp; =91.375\%\end{align}$$&lt;/p&gt;&#xA;&#xA;&lt;p&gt;To calculate the future contract price:&#xA;$$\begin{align}Future\ Contract\ Price&amp;amp; = 91.375\%\times $\ 1\,000\,000\newline &amp;amp;=$\ 91\,375\end{align}$$&lt;/p&gt;&#xA;" OwnerUserId="30520" LastEditorUserId="30520" LastEditDate="2018-02-09T11:51:00.517" LastActivityDate="2018-02-09T11:51:00.517" CommentCount="0" ContentLicense="CC BY-SA 3.0" />
  <row Id="37133" PostTypeId="2" ParentId="36994" CreationDate="2017-11-29T09:56:03.940" Score="2" Body="&lt;p&gt;we basically make assumptions about the possible values of future interest rates, i.e. we jump forward in time and then gradually work our way back to the presence by checking if the bond surpasses a value of 100 in any time where it may be called by the issuer.&lt;/p&gt;&#xA;&#xA;&lt;p&gt;The bond value in any given node of the tree will then depend only on the two previous values (from right to left side) that &quot;lead&quot; into the node, as from the given node the interest rate can only change according to the parameters that we assumed earlier (e.g. go up 30 % with a probability of 50 % or go down 4 % with a probability of 50 % - see the example below).&lt;/p&gt;&#xA;&#xA;&lt;p&gt;Obviously, the bond cannot be called twice, so in a node where the bond may  be called but its value is &gt; 100, we have to set the value to 100. If the bond is callable in a node that is closer to t=0 and the bond value in that node is &gt;100 than we will set that node to 100. The bond value now does &lt;strong&gt;NOT&lt;/strong&gt; depend on the values that follow from that node in later periods as the bond would get called anyways and therefore has a value